summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-12-01 22:56:06 +0000
committerEric Anholt <anholt@freebsd.org>2003-12-01 22:56:06 +0000
commite765a631da6e14afa28de3d31504d84e3470a5ab (patch)
treefc02a2da9287352828160ea7cdf64f0bd3d67f00
parentae2454f65698eef66b3507e586e4f8125cb1790d (diff)
- Initial add of enough of the DRI to create a 2d driver that uses the DRM
for its acceleration. - Converted the ATI driver to use the DRM to execute rendering commands using DMA instead of MMIO when available.
-rw-r--r--GL/apple/aglGlx.c1155
-rw-r--r--GL/apple/indirect.c1341
-rw-r--r--GL/glx/g_disptab.c827
-rw-r--r--GL/glx/g_disptab.h640
-rw-r--r--GL/glx/g_disptab_EXT.c4389
-rw-r--r--GL/glx/g_disptab_EXT.h124
-rw-r--r--GL/glx/g_render.c2113
-rw-r--r--GL/glx/g_renderswap.c3368
-rw-r--r--GL/glx/g_single.c1783
-rw-r--r--GL/glx/g_singleswap.c2204
-rw-r--r--GL/glx/global.c71
-rw-r--r--GL/glx/glxbuf.c292
-rw-r--r--GL/glx/glxbuf.h53
-rw-r--r--GL/glx/glxcmds.c1712
-rw-r--r--GL/glx/glxcmdsswap.c832
-rw-r--r--GL/glx/glxcontext.h161
-rw-r--r--GL/glx/glxdrawable.h107
-rw-r--r--GL/glx/glxerror.h54
-rw-r--r--GL/glx/glxext.c489
-rw-r--r--GL/glx/glxext.h96
-rw-r--r--GL/glx/glxfb.c179
-rw-r--r--GL/glx/glxfb.h48
-rw-r--r--GL/glx/glximports.c180
-rw-r--r--GL/glx/glximports.h62
-rw-r--r--GL/glx/glxmem.c147
-rw-r--r--GL/glx/glxmem.h44
-rw-r--r--GL/glx/glxpix.c128
-rw-r--r--GL/glx/glxpix.h44
-rw-r--r--GL/glx/glxscreens.c394
-rw-r--r--GL/glx/glxscreens.h95
-rw-r--r--GL/glx/glxserver.h284
-rw-r--r--GL/glx/glxutil.c555
-rw-r--r--GL/glx/glxutil.h78
-rw-r--r--GL/glx/impsize.h72
-rw-r--r--GL/glx/render2.c259
-rw-r--r--GL/glx/render2swap.c391
-rw-r--r--GL/glx/renderpix.c307
-rw-r--r--GL/glx/renderpixswap.c550
-rw-r--r--GL/glx/rensize.c920
-rw-r--r--GL/glx/rensizetab.c2442
-rw-r--r--GL/glx/single2.c373
-rw-r--r--GL/glx/single2swap.c350
-rw-r--r--GL/glx/singlepix.c458
-rw-r--r--GL/glx/singlepixswap.c514
-rw-r--r--GL/glx/singlesize.c995
-rw-r--r--GL/glx/singlesize.h81
-rw-r--r--GL/glx/unpack.h236
-rw-r--r--GL/glx/xfont.c191
-rw-r--r--GL/include/GL/glx_ansic.h111
-rw-r--r--GL/include/GL/xf86glx.h39
-rw-r--r--XTrap/xtrapddmi.c184
-rw-r--r--XTrap/xtrapdi.c2152
-rw-r--r--XTrap/xtrapdiswp.c1006
-rw-r--r--XTrap/xtrapditbl.c238
-rw-r--r--Xext/EVI.c198
-rw-r--r--Xext/EVIstruct.h56
-rw-r--r--Xext/README.xtest1-ddx90
-rw-r--r--Xext/SecurityPolicy88
-rw-r--r--Xext/appgroup.c825
-rw-r--r--Xext/appgroup.h10
-rw-r--r--Xext/bigreq.c103
-rw-r--r--Xext/cup.c360
-rw-r--r--Xext/dpms.c445
-rw-r--r--Xext/dpmsproc.h12
-rw-r--r--Xext/dpmsstubs.c50
-rw-r--r--Xext/fontcache.c329
-rw-r--r--Xext/mbuf.c1783
-rw-r--r--Xext/mbufbf.c1026
-rw-r--r--Xext/mbufpx.c647
-rw-r--r--Xext/mitmisc.c172
-rw-r--r--Xext/panoramiX.c1258
-rw-r--r--Xext/panoramiX.h102
-rw-r--r--Xext/panoramiXSwap.c140
-rw-r--r--Xext/panoramiXh.h78
-rw-r--r--Xext/panoramiXprocs.c2368
-rw-r--r--Xext/panoramiXsrv.h44
-rw-r--r--Xext/sampleEVI.c102
-rw-r--r--Xext/saver.c1409
-rw-r--r--Xext/security.c1998
-rw-r--r--Xext/shape.c1276
-rw-r--r--Xext/shm.c1262
-rw-r--r--Xext/sleepuntil.c235
-rw-r--r--Xext/sleepuntil.h43
-rw-r--r--Xext/sync.c2509
-rw-r--r--Xext/xcmisc.c240
-rw-r--r--Xext/xf86bigfont.c783
-rw-r--r--Xext/xprint.c2756
-rw-r--r--Xext/xres.c332
-rw-r--r--Xext/xtest.c603
-rw-r--r--Xext/xtest1dd.c1613
-rw-r--r--Xext/xtest1dd.h123
-rw-r--r--Xext/xtest1di.c949
-rw-r--r--Xext/xvdisp.c2212
-rw-r--r--Xext/xvdisp.h3
-rw-r--r--Xext/xvdix.h291
-rw-r--r--Xext/xvmain.c1198
-rw-r--r--Xext/xvmc.c674
-rw-r--r--Xext/xvmcext.h111
-rw-r--r--Xi/allowev.c141
-rw-r--r--Xi/allowev.h40
-rw-r--r--Xi/chgdctl.c215
-rw-r--r--Xi/chgdctl.h47
-rw-r--r--Xi/chgfctl.c659
-rw-r--r--Xi/chgfctl.h94
-rw-r--r--Xi/chgkbd.c212
-rw-r--r--Xi/chgkbd.h48
-rw-r--r--Xi/chgkmap.c132
-rw-r--r--Xi/chgkmap.h40
-rw-r--r--Xi/chgprop.c170
-rw-r--r--Xi/chgprop.h40
-rw-r--r--Xi/chgptr.c258
-rw-r--r--Xi/chgptr.h69
-rw-r--r--Xi/closedev.c187
-rw-r--r--Xi/closedev.h54
-rw-r--r--Xi/devbell.c169
-rw-r--r--Xi/devbell.h40
-rw-r--r--Xi/exevents.c1362
-rw-r--r--Xi/exglobals.h76
-rw-r--r--Xi/extinit.c1012
-rw-r--r--Xi/getbmap.c150
-rw-r--r--Xi/getbmap.h47
-rw-r--r--Xi/getdctl.c226
-rw-r--r--Xi/getdctl.h55
-rw-r--r--Xi/getfctl.c418
-rw-r--r--Xi/getfctl.h89
-rw-r--r--Xi/getfocus.c153
-rw-r--r--Xi/getfocus.h47
-rw-r--r--Xi/getkmap.c174
-rw-r--r--Xi/getkmap.h47
-rw-r--r--Xi/getmmap.c154
-rw-r--r--Xi/getmmap.h47
-rw-r--r--Xi/getprop.c211
-rw-r--r--Xi/getprop.h56
-rw-r--r--Xi/getselev.c192
-rw-r--r--Xi/getselev.h47
-rw-r--r--Xi/getvers.c153
-rw-r--r--Xi/getvers.h47
-rw-r--r--Xi/grabdev.c228
-rw-r--r--Xi/grabdev.h57
-rw-r--r--Xi/grabdevb.c166
-rw-r--r--Xi/grabdevb.h40
-rw-r--r--Xi/grabdevk.c170
-rw-r--r--Xi/grabdevk.h40
-rw-r--r--Xi/gtmotion.c209
-rw-r--r--Xi/gtmotion.h47
-rw-r--r--Xi/listdev.c403
-rw-r--r--Xi/listdev.h99
-rw-r--r--Xi/opendev.c201
-rw-r--r--Xi/opendev.h47
-rw-r--r--Xi/queryst.c211
-rw-r--r--Xi/queryst.h47
-rw-r--r--Xi/selectev.c155
-rw-r--r--Xi/selectev.h40
-rw-r--r--Xi/sendexev.c177
-rw-r--r--Xi/sendexev.h40
-rw-r--r--Xi/setbmap.c166
-rw-r--r--Xi/setbmap.h47
-rw-r--r--Xi/setdval.c170
-rw-r--r--Xi/setdval.h47
-rw-r--r--Xi/setfocus.c122
-rw-r--r--Xi/setfocus.h40
-rw-r--r--Xi/setmmap.c160
-rw-r--r--Xi/setmmap.h47
-rw-r--r--Xi/setmode.c154
-rw-r--r--Xi/setmode.h47
-rw-r--r--Xi/stubs.c313
-rw-r--r--Xi/ungrdev.c119
-rw-r--r--Xi/ungrdev.h40
-rw-r--r--Xi/ungrdevb.c174
-rw-r--r--Xi/ungrdevb.h40
-rw-r--r--Xi/ungrdevk.c180
-rw-r--r--Xi/ungrdevk.h40
-rw-r--r--XpConfig/C/print/Xprinters43
-rw-r--r--XpConfig/C/print/attributes/document38
-rw-r--r--XpConfig/C/print/attributes/job25
-rw-r--r--XpConfig/C/print/attributes/printer80
-rw-r--r--XpConfig/C/print/ddx-config/raster/pcl39
-rw-r--r--XpConfig/C/print/ddx-config/raster/postscript0
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmfbin5632 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmfbin5732 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmfbin5732 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmfbin5716 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmfbin5656 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmfbin5664 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmfbin5672 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmfbin5660 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmfbin5716 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmfbin5752 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/README197
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias1
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir45
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmfbin4296 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPDJ1600C/model-config44
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmfbin5632 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmfbin5732 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmfbin5732 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmfbin5740 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmfbin5716 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmfbin5656 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmfbin5664 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmfbin5672 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmfbin5660 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmfbin5724 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmfbin5716 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmfbin5752 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmfbin5720 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmfbin5744 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmfbin5736 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmfbin5728 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/README203
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias1
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir45
-rw-r--r--XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmfbin4296 -> 0 bytes
-rw-r--r--XpConfig/C/print/models/HPLJ4family/model-config44
-rw-r--r--XpConfig/C/print/models/SPSPARC2/model-config13
-rw-r--r--Xprint/AttrValid.c700
-rw-r--r--Xprint/AttrValid.h219
-rw-r--r--Xprint/DiPrint.h75
-rw-r--r--Xprint/Init.c1682
-rw-r--r--Xprint/Oid.c3179
-rw-r--r--Xprint/Oid.h290
-rw-r--r--Xprint/OidDefs.h163
-rw-r--r--Xprint/OidStrs.h169
-rw-r--r--Xprint/Util.c392
-rw-r--r--Xprint/ValTree.c189
-rw-r--r--Xprint/attributes.c1553
-rw-r--r--Xprint/attributes.h130
-rw-r--r--Xprint/ddxInit.c371
-rw-r--r--Xprint/mediaSizes.c767
-rw-r--r--Xprint/pcl/Pcl.h621
-rw-r--r--Xprint/pcl/PclArc.c266
-rw-r--r--Xprint/pcl/PclArea.c482
-rw-r--r--Xprint/pcl/PclAttVal.c203
-rw-r--r--Xprint/pcl/PclAttr.c83
-rw-r--r--Xprint/pcl/PclColor.c847
-rw-r--r--Xprint/pcl/PclCursor.c111
-rw-r--r--Xprint/pcl/PclDef.h64
-rw-r--r--Xprint/pcl/PclFonts.c70
-rw-r--r--Xprint/pcl/PclGC.c1042
-rw-r--r--Xprint/pcl/PclInit.c627
-rw-r--r--Xprint/pcl/PclLine.c312
-rw-r--r--Xprint/pcl/PclMisc.c302
-rw-r--r--Xprint/pcl/PclPixel.c155
-rw-r--r--Xprint/pcl/PclPixmap.c81
-rw-r--r--Xprint/pcl/PclPolygon.c349
-rw-r--r--Xprint/pcl/PclPrint.c707
-rw-r--r--Xprint/pcl/PclSFonts.c428
-rw-r--r--Xprint/pcl/PclSFonts.h112
-rw-r--r--Xprint/pcl/PclSpans.c135
-rw-r--r--Xprint/pcl/PclText.c932
-rw-r--r--Xprint/pcl/PclWindow.c448
-rw-r--r--Xprint/pcl/Pclmap.h209
-rw-r--r--Xprint/ps/Ps.h516
-rw-r--r--Xprint/ps/PsArc.c178
-rw-r--r--Xprint/ps/PsArea.c464
-rw-r--r--Xprint/ps/PsAttVal.c211
-rw-r--r--Xprint/ps/PsAttr.c113
-rw-r--r--Xprint/ps/PsCache.c324
-rw-r--r--Xprint/ps/PsColor.c223
-rw-r--r--Xprint/ps/PsDef.h93
-rw-r--r--Xprint/ps/PsFonts.c186
-rw-r--r--Xprint/ps/PsGC.c377
-rw-r--r--Xprint/ps/PsInit.c410
-rw-r--r--Xprint/ps/PsLine.c189
-rw-r--r--Xprint/ps/PsMisc.c321
-rw-r--r--Xprint/ps/PsPixel.c154
-rw-r--r--Xprint/ps/PsPixmap.c597
-rw-r--r--Xprint/ps/PsPolygon.c233
-rw-r--r--Xprint/ps/PsPrint.c431
-rw-r--r--Xprint/ps/PsSpans.c162
-rw-r--r--Xprint/ps/PsText.c474
-rw-r--r--Xprint/ps/PsWindow.c456
-rw-r--r--Xprint/ps/psout.c1638
-rw-r--r--Xprint/ps/psout.h215
-rw-r--r--Xprint/raster/Raster.c1576
-rw-r--r--Xprint/raster/Raster.h115
-rw-r--r--Xprint/raster/RasterAttVal.c265
-rw-r--r--afb/README10
-rw-r--r--afb/Xdaniver.doc218
-rw-r--r--afb/afb.h1132
-rw-r--r--afb/afbbitblt.c473
-rw-r--r--afb/afbblt.c559
-rw-r--r--afb/afbbres.c321
-rw-r--r--afb/afbbresd.c212
-rw-r--r--afb/afbbstore.c152
-rw-r--r--afb/afbclip.c244
-rw-r--r--afb/afbcmap.c121
-rw-r--r--afb/afbfillarc.c355
-rw-r--r--afb/afbfillrct.c290
-rw-r--r--afb/afbfillsp.c1127
-rw-r--r--afb/afbfont.c75
-rw-r--r--afb/afbgc.c707
-rw-r--r--afb/afbgetsp.c163
-rw-r--r--afb/afbhrzvert.c207
-rw-r--r--afb/afbimage.c297
-rw-r--r--afb/afbimggblt.c470
-rw-r--r--afb/afbline.c702
-rw-r--r--afb/afbmisc.c92
-rw-r--r--afb/afbpixmap.c292
-rw-r--r--afb/afbply1rct.c296
-rw-r--r--afb/afbplygblt.c461
-rw-r--r--afb/afbpntarea.c653
-rw-r--r--afb/afbpntwin.c124
-rw-r--r--afb/afbpolypnt.c144
-rw-r--r--afb/afbpushpxl.c255
-rw-r--r--afb/afbscrinit.c244
-rw-r--r--afb/afbsetsp.c265
-rw-r--r--afb/afbtegblt.c584
-rw-r--r--afb/afbtile.c855
-rw-r--r--afb/afbwindow.c314
-rw-r--r--afb/afbzerarc.c206
-rw-r--r--cfb/cfb.h1327
-rw-r--r--cfb/cfb16.h94
-rw-r--r--cfb/cfb24.h94
-rw-r--r--cfb/cfb32.h94
-rw-r--r--cfb/cfb8bit.c467
-rw-r--r--cfb/cfb8bit.h1568
-rw-r--r--cfb/cfb8line.c1500
-rw-r--r--cfb/cfballpriv.c90
-rw-r--r--cfb/cfbbitblt.c1450
-rw-r--r--cfb/cfbblt.c929
-rw-r--r--cfb/cfbbres.c338
-rw-r--r--cfb/cfbbresd.c402
-rw-r--r--cfb/cfbbstore.c141
-rw-r--r--cfb/cfbcmap.c117
-rw-r--r--cfb/cfbcppl.c486
-rw-r--r--cfb/cfbfillarc.c370
-rw-r--r--cfb/cfbfillrct.c303
-rw-r--r--cfb/cfbfillsp.c1002
-rw-r--r--cfb/cfbgc.c791
-rw-r--r--cfb/cfbgetsp.c211
-rw-r--r--cfb/cfbglblt8.c476
-rw-r--r--cfb/cfbhrzvert.c552
-rw-r--r--cfb/cfbigblt8.c104
-rw-r--r--cfb/cfbimage.c206
-rw-r--r--cfb/cfbline.c753
-rw-r--r--cfb/cfbmap.h325
-rw-r--r--cfb/cfbmskbits.c1398
-rw-r--r--cfb/cfbmskbits.h897
-rw-r--r--cfb/cfbpixmap.c371
-rw-r--r--cfb/cfbply1rct.c359
-rw-r--r--cfb/cfbpntwin.c766
-rw-r--r--cfb/cfbpolypnt.c200
-rw-r--r--cfb/cfbpush8.c186
-rw-r--r--cfb/cfbrctstp8.c591
-rw-r--r--cfb/cfbrrop.c225
-rw-r--r--cfb/cfbrrop.h339
-rw-r--r--cfb/cfbscrinit.c228
-rw-r--r--cfb/cfbsetsp.c314
-rw-r--r--cfb/cfbsolid.c1363
-rw-r--r--cfb/cfbtab.h10
-rw-r--r--cfb/cfbteblt8.c588
-rw-r--r--cfb/cfbtegblt.c216
-rw-r--r--cfb/cfbtile32.c515
-rw-r--r--cfb/cfbtileodd.c1243
-rw-r--r--cfb/cfbunmap.h153
-rw-r--r--cfb/cfbwindow.c333
-rw-r--r--cfb/cfbzerarc.c318
-rw-r--r--cfb/stip68kgnu.h123
-rw-r--r--cfb/stipmips.s281
-rw-r--r--cfb/stipsparc.s281
-rw-r--r--cfb/stipsprc32.s282
-rw-r--r--cfb24/cfbrrop24.h54
-rw-r--r--dbe/dbe.c1985
-rw-r--r--dbe/dbestruct.h238
-rw-r--r--dbe/midbe.c851
-rw-r--r--dbe/midbe.h47
-rw-r--r--dbe/midbestr.h96
-rw-r--r--dix/BuiltInAtoms329
-rw-r--r--dix/CHANGES17
-rw-r--r--dix/atom.c214
-rw-r--r--dix/buildatoms43
-rw-r--r--dix/colormap.c2854
-rw-r--r--dix/cursor.c450
-rw-r--r--dix/devices.c1732
-rw-r--r--dix/dispatch.c4075
-rw-r--r--dix/dispatch.h143
-rw-r--r--dix/dixfonts.c2179
-rw-r--r--dix/dixutils.c972
-rw-r--r--dix/events.c4500
-rw-r--r--dix/extension.c486
-rw-r--r--dix/ffs.c37
-rw-r--r--dix/gc.c1331
-rw-r--r--dix/globals.c151
-rw-r--r--dix/glyphcurs.c197
-rw-r--r--dix/grabs.c440
-rw-r--r--dix/initatoms.c80
-rw-r--r--dix/main.c768
-rw-r--r--dix/pixmap.c150
-rw-r--r--dix/privates.c370
-rw-r--r--dix/property.c738
-rw-r--r--dix/resource.c962
-rw-r--r--dix/swaprep.c1459
-rw-r--r--dix/swapreq.c1173
-rw-r--r--dix/tables.c525
-rw-r--r--dix/window.c3853
-rw-r--r--dix/xpstubs.c54
-rw-r--r--doc/Xserver.man.pre759
-rw-r--r--doc/smartsched204
-rw-r--r--fb/fb.h2019
-rw-r--r--fb/fb24_32.c623
-rw-r--r--fb/fb24_32.h49
-rw-r--r--fb/fballpriv.c77
-rw-r--r--fb/fbarc.c118
-rw-r--r--fb/fbbits.c175
-rw-r--r--fb/fbbits.h956
-rw-r--r--fb/fbblt.c926
-rw-r--r--fb/fbbltone.c865
-rw-r--r--fb/fbbstore.c62
-rw-r--r--fb/fbcmap.c668
-rw-r--r--fb/fbcompose.c2864
-rw-r--r--fb/fbcopy.c626
-rw-r--r--fb/fbfill.c212
-rw-r--r--fb/fbfillrect.c111
-rw-r--r--fb/fbfillsp.c99
-rw-r--r--fb/fbgc.c310
-rw-r--r--fb/fbgetsp.c84
-rw-r--r--fb/fbglyph.c472
-rw-r--r--fb/fbimage.c364
-rw-r--r--fb/fbline.c173
-rw-r--r--fb/fboverlay.c446
-rw-r--r--fb/fboverlay.h128
-rw-r--r--fb/fbpict.c1167
-rw-r--r--fb/fbpict.h976
-rw-r--r--fb/fbpixmap.c378
-rw-r--r--fb/fbpoint.c156
-rw-r--r--fb/fbpush.c243
-rw-r--r--fb/fbrop.h139
-rw-r--r--fb/fbscreen.c297
-rw-r--r--fb/fbseg.c723
-rw-r--r--fb/fbsetsp.c100
-rw-r--r--fb/fbsolid.c212
-rw-r--r--fb/fbstipple.c312
-rw-r--r--fb/fbtile.c200
-rw-r--r--fb/fbtrap.c1382
-rw-r--r--fb/fbutil.c361
-rw-r--r--fb/fbwindow.c341
-rw-r--r--hw/darwin/XDarwin.man205
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Localizable.stringsbin1426 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nibbin21843 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp1
-rw-r--r--hw/darwin/bundle/English.lproj/Credits.rtf138
-rw-r--r--hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp5
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings23
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin20640 -> 0 bytes
-rw-r--r--hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/French.lproj/Credits.rtf123
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin1492 -> 0 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nibbin22289 -> 0 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp107
-rw-r--r--hw/darwin/bundle/German.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin1458 -> 0 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nibbin22218 -> 0 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp90
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Credits.rtf135
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin1152 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nibbin21423 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp149
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Credits.rtf139
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin1504 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nibbin20861 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp216
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin1480 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nibbin21989 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp116
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin1464 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nibbin20444 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp108
-rw-r--r--hw/darwin/bundle/XDarwin.icnsbin35134 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin1332 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nibbin21010 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/startXClients.cpp24
-rw-r--r--hw/darwin/darwin.c1019
-rw-r--r--hw/darwin/darwin.h148
-rw-r--r--hw/darwin/darwinClut8.h532
-rw-r--r--hw/darwin/darwinEvents.c439
-rw-r--r--hw/darwin/darwinKeyboard.c900
-rw-r--r--hw/darwin/darwinKeyboard.h50
-rw-r--r--hw/darwin/iokit/xfIOKit.c770
-rw-r--r--hw/darwin/iokit/xfIOKit.h57
-rw-r--r--hw/darwin/iokit/xfIOKitCursor.c735
-rw-r--r--hw/darwin/iokit/xfIOKitStartup.c115
-rw-r--r--hw/darwin/quartz/Preferences.h136
-rw-r--r--hw/darwin/quartz/Preferences.m580
-rw-r--r--hw/darwin/quartz/XApplication.h47
-rw-r--r--hw/darwin/quartz/XApplication.m47
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj2145
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c164
-rw-r--r--hw/darwin/quartz/XDarwinStartup.man75
-rw-r--r--hw/darwin/quartz/XServer.h135
-rw-r--r--hw/darwin/quartz/XServer.m1486
-rw-r--r--hw/darwin/quartz/applewm.c697
-rw-r--r--hw/darwin/quartz/applewmExt.h83
-rw-r--r--hw/darwin/quartz/cr/XView.h42
-rw-r--r--hw/darwin/quartz/cr/XView.m74
-rw-r--r--hw/darwin/quartz/cr/cr.h62
-rw-r--r--hw/darwin/quartz/cr/crAppleWM.m157
-rw-r--r--hw/darwin/quartz/cr/crFrame.m403
-rw-r--r--hw/darwin/quartz/cr/crScreen.m321
-rw-r--r--hw/darwin/quartz/fullscreen/fullscreen.c567
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.c653
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.h44
-rw-r--r--hw/darwin/quartz/keysym2ucs.c909
-rw-r--r--hw/darwin/quartz/keysym2ucs.h37
-rw-r--r--hw/darwin/quartz/pseudoramiX.c420
-rw-r--r--hw/darwin/quartz/pseudoramiX.h9
-rw-r--r--hw/darwin/quartz/quartz.c356
-rw-r--r--hw/darwin/quartz/quartz.h117
-rw-r--r--hw/darwin/quartz/quartzAudio.c342
-rw-r--r--hw/darwin/quartz/quartzAudio.h41
-rw-r--r--hw/darwin/quartz/quartzCocoa.m203
-rw-r--r--hw/darwin/quartz/quartzCommon.h106
-rw-r--r--hw/darwin/quartz/quartzCursor.c653
-rw-r--r--hw/darwin/quartz/quartzCursor.h43
-rw-r--r--hw/darwin/quartz/quartzKeyboard.c380
-rw-r--r--hw/darwin/quartz/quartzPasteboard.c150
-rw-r--r--hw/darwin/quartz/quartzPasteboard.h45
-rw-r--r--hw/darwin/quartz/quartzStartup.c303
-rw-r--r--hw/darwin/quartz/xpr/Xplugin.h591
-rw-r--r--hw/darwin/quartz/xpr/appledri.c350
-rw-r--r--hw/darwin/quartz/xpr/dri.c690
-rw-r--r--hw/darwin/quartz/xpr/dri.h130
-rw-r--r--hw/darwin/quartz/xpr/dristruct.h82
-rw-r--r--hw/darwin/quartz/xpr/x-hash.c341
-rw-r--r--hw/darwin/quartz/xpr/x-hash.h62
-rw-r--r--hw/darwin/quartz/xpr/x-hook.c106
-rw-r--r--hw/darwin/quartz/xpr/x-hook.h44
-rw-r--r--hw/darwin/quartz/xpr/x-list.c316
-rw-r--r--hw/darwin/quartz/xpr/x-list.h78
-rw-r--r--hw/darwin/quartz/xpr/xpr.h47
-rw-r--r--hw/darwin/quartz/xpr/xprAppleWM.c99
-rw-r--r--hw/darwin/quartz/xpr/xprCursor.c420
-rw-r--r--hw/darwin/quartz/xpr/xprFrame.c439
-rw-r--r--hw/darwin/quartz/xpr/xprScreen.c378
-rw-r--r--hw/darwin/utils/README.txt111
-rw-r--r--hw/darwin/utils/dumpkeymap.c1454
-rw-r--r--hw/darwin/utils/dumpkeymap.man1004
-rw-r--r--hw/kdrive/ati/Makefile.am22
-rw-r--r--hw/kdrive/ati/ati.c282
-rw-r--r--hw/kdrive/ati/ati.h116
-rw-r--r--hw/kdrive/ati/ati_draw.c378
-rw-r--r--hw/kdrive/ati/ati_draw.h72
-rw-r--r--hw/kdrive/ati/ati_drawtmp.h217
-rw-r--r--hw/kdrive/ati/ati_dri.c929
-rw-r--r--hw/kdrive/ati/ati_dri.h100
-rw-r--r--hw/kdrive/ati/ati_dripriv.h58
-rw-r--r--hw/kdrive/ati/ati_reg.h36
-rw-r--r--hw/kdrive/ati/ati_sarea.h (renamed from miext/shadow/shrot16pack.c)32
-rw-r--r--hw/kdrive/ati/ati_stub.c23
-rw-r--r--hw/kdrive/ati/r128_common.h171
-rw-r--r--hw/kdrive/ati/r128_sarea.h186
-rw-r--r--hw/kdrive/ati/radeon_common.h461
-rw-r--r--hw/kdrive/ati/radeon_sarea.h222
-rw-r--r--hw/vfb/InitInput.c340
-rw-r--r--hw/vfb/InitOutput.c1042
-rw-r--r--hw/vfb/Xvfb.man.pre131
-rw-r--r--hw/vfb/lk201kbd.h159
-rw-r--r--hw/xfree86/Options409
-rw-r--r--hw/xfree86/common/atKeynames.h298
-rw-r--r--hw/xfree86/common/compiler.h1786
-rw-r--r--hw/xfree86/common/extramodes33
-rw-r--r--hw/xfree86/common/fourcc.h161
-rw-r--r--hw/xfree86/common/modeline2c.pl106
-rw-r--r--hw/xfree86/common/scoasm.h139
-rw-r--r--hw/xfree86/common/vesamodes111
-rw-r--r--hw/xfree86/common/xf86.h448
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c354
-rw-r--r--hw/xfree86/common/xf86Bus.c3227
-rw-r--r--hw/xfree86/common/xf86Bus.h158
-rw-r--r--hw/xfree86/common/xf86Config.c2599
-rw-r--r--hw/xfree86/common/xf86Config.h59
-rw-r--r--hw/xfree86/common/xf86Configure.c999
-rw-r--r--hw/xfree86/common/xf86Cursor.c784
-rw-r--r--hw/xfree86/common/xf86DGA.c1204
-rw-r--r--hw/xfree86/common/xf86DPMS.c207
-rw-r--r--hw/xfree86/common/xf86Date.h33
-rw-r--r--hw/xfree86/common/xf86Debug.c193
-rw-r--r--hw/xfree86/common/xf86DefModes.c156
-rw-r--r--hw/xfree86/common/xf86DoProbe.c105
-rw-r--r--hw/xfree86/common/xf86DoScanPci.c126
-rw-r--r--hw/xfree86/common/xf86Events.c1627
-rw-r--r--hw/xfree86/common/xf86Globals.c247
-rw-r--r--hw/xfree86/common/xf86Helper.c2973
-rw-r--r--hw/xfree86/common/xf86InPriv.h44
-rw-r--r--hw/xfree86/common/xf86Init.c1922
-rw-r--r--hw/xfree86/common/xf86Io.c498
-rw-r--r--hw/xfree86/common/xf86Kbd.c391
-rw-r--r--hw/xfree86/common/xf86KbdBSD.c1262
-rw-r--r--hw/xfree86/common/xf86KbdLnx.c648
-rw-r--r--hw/xfree86/common/xf86KbdMach.c313
-rw-r--r--hw/xfree86/common/xf86Keymap.h451
-rw-r--r--hw/xfree86/common/xf86MiscExt.c653
-rw-r--r--hw/xfree86/common/xf86Mode.c2176
-rw-r--r--hw/xfree86/common/xf86Module.h226
-rw-r--r--hw/xfree86/common/xf86Opt.h114
-rw-r--r--hw/xfree86/common/xf86Option.c880
-rw-r--r--hw/xfree86/common/xf86PM.c213
-rw-r--r--hw/xfree86/common/xf86PciInfo.h624
-rw-r--r--hw/xfree86/common/xf86Priv.h226
-rw-r--r--hw/xfree86/common/xf86Privstr.h224
-rw-r--r--hw/xfree86/common/xf86RandR.c281
-rw-r--r--hw/xfree86/common/xf86Resources.h140
-rw-r--r--hw/xfree86/common/xf86Version.h60
-rw-r--r--hw/xfree86/common/xf86Versions.c77
-rw-r--r--hw/xfree86/common/xf86VidMode.c718
-rw-r--r--hw/xfree86/common/xf86XKB.c78
-rw-r--r--hw/xfree86/common/xf86Xinput.c1503
-rw-r--r--hw/xfree86/common/xf86Xinput.h220
-rw-r--r--hw/xfree86/common/xf86cmap.c1108
-rw-r--r--hw/xfree86/common/xf86cmap.h76
-rw-r--r--hw/xfree86/common/xf86fbBus.c93
-rw-r--r--hw/xfree86/common/xf86fbman.c1443
-rw-r--r--hw/xfree86/common/xf86fbman.h227
-rw-r--r--hw/xfree86/common/xf86isaBus.c138
-rw-r--r--hw/xfree86/common/xf86noBus.c71
-rw-r--r--hw/xfree86/common/xf86pciBus.c3552
-rw-r--r--hw/xfree86/common/xf86pciBus.h95
-rw-r--r--hw/xfree86/common/xf86sbusBus.c705
-rw-r--r--hw/xfree86/common/xf86sbusBus.h98
-rw-r--r--hw/xfree86/common/xf86str.h1072
-rw-r--r--hw/xfree86/common/xf86xv.c2046
-rw-r--r--hw/xfree86/common/xf86xv.h271
-rw-r--r--hw/xfree86/common/xf86xvmc.c239
-rw-r--r--hw/xfree86/common/xf86xvmc.h164
-rw-r--r--hw/xfree86/common/xf86xvpriv.h86
-rw-r--r--hw/xfree86/common/xisb.c176
-rw-r--r--hw/xfree86/common/xisb.h64
-rw-r--r--hw/xfree86/ddc/DDC.HOWTO97
-rw-r--r--hw/xfree86/ddc/ddcPriv.h9
-rw-r--r--hw/xfree86/ddc/ddcProperty.c156
-rw-r--r--hw/xfree86/ddc/edid.c137
-rw-r--r--hw/xfree86/ddc/edid.h424
-rw-r--r--hw/xfree86/ddc/interpret_edid.c226
-rw-r--r--hw/xfree86/ddc/interpret_vdif.c129
-rw-r--r--hw/xfree86/ddc/print_edid.c286
-rw-r--r--hw/xfree86/ddc/print_vdif.c222
-rw-r--r--hw/xfree86/ddc/vdif.h175
-rw-r--r--hw/xfree86/ddc/xf86DDC.c380
-rw-r--r--hw/xfree86/ddc/xf86DDC.h61
-rw-r--r--hw/xfree86/dixmods/GLcoremodule.c60
-rw-r--r--hw/xfree86/dixmods/afbmodule.c49
-rw-r--r--hw/xfree86/dixmods/bitmapmod.c72
-rw-r--r--hw/xfree86/dixmods/cfb16module.c59
-rw-r--r--hw/xfree86/dixmods/cfb24module.c59
-rw-r--r--hw/xfree86/dixmods/cfb32module.c59
-rw-r--r--hw/xfree86/dixmods/cfbmodule.c59
-rw-r--r--hw/xfree86/dixmods/dbemodule.c43
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h144
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c258
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h144
-rw-r--r--hw/xfree86/dixmods/extmod/vidmodeproc.h74
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga.c303
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c771
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dgaext.h8
-rw-r--r--hw/xfree86/dixmods/extmod/xf86misc.c838
-rw-r--r--hw/xfree86/dixmods/extmod/xf86miscproc.h66
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c2199
-rw-r--r--hw/xfree86/dixmods/extmod/xvmod.c20
-rw-r--r--hw/xfree86/dixmods/extmod/xvmodproc.h10
-rw-r--r--hw/xfree86/dixmods/fbmodule.c49
-rw-r--r--hw/xfree86/dixmods/ftmodule.c72
-rw-r--r--hw/xfree86/dixmods/glxmodule.c1266
-rw-r--r--hw/xfree86/dixmods/laymodule.c56
-rw-r--r--hw/xfree86/dixmods/mfbmodule.c48
-rw-r--r--hw/xfree86/dixmods/recordmod.c42
-rw-r--r--hw/xfree86/dixmods/shmodule.c56
-rw-r--r--hw/xfree86/dixmods/type1mod.c87
-rw-r--r--hw/xfree86/dixmods/xf86XTrapModule.c47
-rw-r--r--hw/xfree86/doc/README.DRI1257
-rw-r--r--hw/xfree86/doc/README.fonts1182
-rw-r--r--hw/xfree86/doc/README.rapidaccess48
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG18238
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG.ND418
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG.R51249
-rw-r--r--hw/xfree86/doc/devel/DebuggingHints192
-rw-r--r--hw/xfree86/doc/devel/Domain.note159
-rw-r--r--hw/xfree86/doc/devel/RAC.Notes696
-rw-r--r--hw/xfree86/doc/devel/README.DRIcomp557
-rw-r--r--hw/xfree86/doc/devel/Registry410
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.sgml7417
-rw-r--r--hw/xfree86/dri/dri.c2117
-rw-r--r--hw/xfree86/dri/dri.h330
-rw-r--r--hw/xfree86/dri/drimodule.c121
-rw-r--r--hw/xfree86/dri/dristruct.h104
-rw-r--r--hw/xfree86/dri/sarea.h94
-rw-r--r--hw/xfree86/dri/xf86dri.c710
-rw-r--r--hw/xfree86/dummylib/README7
-rw-r--r--hw/xfree86/dummylib/dummylib.h6
-rw-r--r--hw/xfree86/dummylib/fatalerror.c23
-rw-r--r--hw/xfree86/dummylib/getvalidbios.c16
-rw-r--r--hw/xfree86/dummylib/logvwrite.c18
-rw-r--r--hw/xfree86/dummylib/pcitestmulti.c17
-rw-r--r--hw/xfree86/dummylib/verrorf.c17
-rw-r--r--hw/xfree86/dummylib/xalloc.c92
-rw-r--r--hw/xfree86/dummylib/xf86addrestolist.c21
-rw-r--r--hw/xfree86/dummylib/xf86allocscripi.c17
-rw-r--r--hw/xfree86/dummylib/xf86drvmsg.c21
-rw-r--r--hw/xfree86/dummylib/xf86drvmsgverb.c21
-rw-r--r--hw/xfree86/dummylib/xf86errorf.c30
-rw-r--r--hw/xfree86/dummylib/xf86errorfverb.c21
-rw-r--r--hw/xfree86/dummylib/xf86getpagesize.c19
-rw-r--r--hw/xfree86/dummylib/xf86getverb.c17
-rw-r--r--hw/xfree86/dummylib/xf86info.c10
-rw-r--r--hw/xfree86/dummylib/xf86msg.c21
-rw-r--r--hw/xfree86/dummylib/xf86msgverb.c21
-rw-r--r--hw/xfree86/dummylib/xf86opt.c22
-rw-r--r--hw/xfree86/dummylib/xf86screens.c10
-rw-r--r--hw/xfree86/dummylib/xf86servisinit.c17
-rw-r--r--hw/xfree86/dummylib/xf86verbose.c10
-rw-r--r--hw/xfree86/fbdevhw/README16
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c875
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h52
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.man.pre21
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c170
-rw-r--r--hw/xfree86/fbdevhw/fbpriv.h262
-rw-r--r--hw/xfree86/getconfig/cfg.man.pre138
-rw-r--r--hw/xfree86/getconfig/cfg.sample111
-rw-r--r--hw/xfree86/getconfig/getconfig45
-rw-r--r--hw/xfree86/getconfig/getconfig.man.pre98
-rw-r--r--hw/xfree86/getconfig/getconfig.pl429
-rw-r--r--hw/xfree86/i2c/xf86i2c.c892
-rw-r--r--hw/xfree86/i2c/xf86i2c.h95
-rw-r--r--hw/xfree86/i2c/xf86i2cmodule.c34
-rw-r--r--hw/xfree86/int10/INT10.HOWTO344
-rw-r--r--hw/xfree86/int10/generic.c555
-rw-r--r--hw/xfree86/int10/helper_exec.c606
-rw-r--r--hw/xfree86/int10/helper_mem.c333
-rw-r--r--hw/xfree86/int10/pci.c51
-rw-r--r--hw/xfree86/int10/stub.c66
-rw-r--r--hw/xfree86/int10/xf86int10.c787
-rw-r--r--hw/xfree86/int10/xf86int10.h198
-rw-r--r--hw/xfree86/int10/xf86int10module.c63
-rw-r--r--hw/xfree86/int10/xf86x86emu.c88
-rw-r--r--hw/xfree86/int10/xf86x86emu.h51
-rw-r--r--hw/xfree86/loader/SparcMulDiv.S87
-rw-r--r--hw/xfree86/loader/aout.h231
-rw-r--r--hw/xfree86/loader/aoutloader.c862
-rw-r--r--hw/xfree86/loader/aoutloader.h31
-rw-r--r--hw/xfree86/loader/ar.h71
-rw-r--r--hw/xfree86/loader/coff.h233
-rw-r--r--hw/xfree86/loader/coffloader.c1351
-rw-r--r--hw/xfree86/loader/coffloader.h34
-rw-r--r--hw/xfree86/loader/dixsym.c400
-rw-r--r--hw/xfree86/loader/dlloader.c190
-rw-r--r--hw/xfree86/loader/dlloader.h32
-rw-r--r--hw/xfree86/loader/elf.h707
-rw-r--r--hw/xfree86/loader/elfloader.c3237
-rw-r--r--hw/xfree86/loader/elfloader.h34
-rw-r--r--hw/xfree86/loader/extsym.c80
-rw-r--r--hw/xfree86/loader/fontsym.c104
-rw-r--r--hw/xfree86/loader/hash.c353
-rw-r--r--hw/xfree86/loader/hash.h36
-rw-r--r--hw/xfree86/loader/loader.c1461
-rw-r--r--hw/xfree86/loader/loader.h288
-rw-r--r--hw/xfree86/loader/loaderProcs.h119
-rw-r--r--hw/xfree86/loader/loadext.c433
-rw-r--r--hw/xfree86/loader/loadfont.c77
-rw-r--r--hw/xfree86/loader/loadmod.c1312
-rw-r--r--hw/xfree86/loader/misym.c209
-rw-r--r--hw/xfree86/loader/os.c74
-rw-r--r--hw/xfree86/loader/sym.h46
-rw-r--r--hw/xfree86/loader/xf86sym.c1148
-rw-r--r--hw/xfree86/os-support/README.OS-lib506
-rw-r--r--hw/xfree86/os-support/assyntax.h752
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c713
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c681
-rw-r--r--hw/xfree86/os-support/bsd/bsdResource.c190
-rw-r--r--hw/xfree86/os-support/bsd/bsd_KbdMap.c1075
-rw-r--r--hw/xfree86/os-support/bsd/bsd_VTsw.c92
-rw-r--r--hw/xfree86/os-support/bsd/bsd_apm.c137
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c69
-rw-r--r--hw/xfree86/os-support/bsd/bsd_ev56.c87
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c728
-rw-r--r--hw/xfree86/os-support/bsd/bsd_io.c289
-rw-r--r--hw/xfree86/os-support/bsd/bsd_jstk.c185
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c538
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.h5
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kmod.c27
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kqueue_apm.c199
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c726
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c881
-rw-r--r--hw/xfree86/os-support/bsd/libusb/data.c91
-rw-r--r--hw/xfree86/os-support/bsd/libusb/descr.c72
-rw-r--r--hw/xfree86/os-support/bsd/libusb/parse.c400
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usage.c195
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb.3191
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb.h95
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb_hid_usages1079
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usbvar.h34
-rw-r--r--hw/xfree86/os-support/bsd/memrange.h68
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c137
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c109
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c452
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.h36
-rw-r--r--hw/xfree86/os-support/bus/Pci.c1476
-rw-r--r--hw/xfree86/os-support/bus/Pci.h435
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c633
-rw-r--r--hw/xfree86/os-support/bus/axpPci.c474
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c54
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.h36
-rw-r--r--hw/xfree86/os-support/bus/freebsdPci.c167
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c688
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c584
-rw-r--r--hw/xfree86/os-support/bus/netbsdPci.c128
-rw-r--r--hw/xfree86/os-support/bus/ppcPci.c212
-rw-r--r--hw/xfree86/os-support/bus/sparcPci.c1048
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h807
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h65
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c1056
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.h36
-rw-r--r--hw/xfree86/os-support/drm/drmmodule.c56
-rw-r--r--hw/xfree86/os-support/int10Defines.h86
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c627
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c294
-rw-r--r--hw/xfree86/os-support/linux/lnx.h44
-rw-r--r--hw/xfree86/os-support/linux/lnxResource.c286
-rw-r--r--hw/xfree86/os-support/linux/lnx_KbdMap.c603
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c342
-rw-r--r--hw/xfree86/os-support/linux/lnx_apm.c166
-rw-r--r--hw/xfree86/os-support/linux/lnx_axp.c196
-rw-r--r--hw/xfree86/os-support/linux/lnx_ev56.c147
-rw-r--r--hw/xfree86/os-support/linux/lnx_init.c285
-rw-r--r--hw/xfree86/os-support/linux/lnx_io.c263
-rw-r--r--hw/xfree86/os-support/linux/lnx_jstk.c184
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c533
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.h5
-rw-r--r--hw/xfree86/os-support/linux/lnx_kmod.c109
-rw-r--r--hw/xfree86/os-support/linux/lnx_mouse.c202
-rw-r--r--hw/xfree86/os-support/linux/lnx_pci.c85
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c1113
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_init.c189
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_io.c162
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_mmap.c69
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_mouse.c30
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_noinline.c174
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_ppc.c52
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_video.c706
-rw-r--r--hw/xfree86/os-support/misc/BUSmemcpy.S156
-rw-r--r--hw/xfree86/os-support/misc/BUSmemcpy.c409
-rw-r--r--hw/xfree86/os-support/misc/Delay.c40
-rw-r--r--hw/xfree86/os-support/misc/IODelay.S53
-rw-r--r--hw/xfree86/os-support/misc/IODelay.c24
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.S108
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c110
-rw-r--r--hw/xfree86/os-support/misc/xf86_IlHack.c15
-rw-r--r--hw/xfree86/os-support/misc/xf86_Util.c92
-rw-r--r--hw/xfree86/os-support/sco/VTsw_sco.c115
-rw-r--r--hw/xfree86/os-support/sco/sco_init.c324
-rw-r--r--hw/xfree86/os-support/sco/sco_io.c273
-rw-r--r--hw/xfree86/os-support/sco/sco_iop.c124
-rw-r--r--hw/xfree86/os-support/sco/sco_mouse.c265
-rw-r--r--hw/xfree86/os-support/sco/sco_video.c292
-rw-r--r--hw/xfree86/os-support/shared/VTsw_noop.c52
-rw-r--r--hw/xfree86/os-support/shared/VTsw_usl.c81
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c98
-rw-r--r--hw/xfree86/os-support/shared/at_scancode.c124
-rw-r--r--hw/xfree86/os-support/shared/bios_devmem.c73
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c160
-rw-r--r--hw/xfree86/os-support/shared/inout.S111
-rw-r--r--hw/xfree86/os-support/shared/ioperm_noop.c47
-rw-r--r--hw/xfree86/os-support/shared/kbd.c35
-rw-r--r--hw/xfree86/os-support/shared/kmod_noop.c35
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c2030
-rw-r--r--hw/xfree86/os-support/shared/pm_noop.c44
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c685
-rw-r--r--hw/xfree86/os-support/shared/sigio.c302
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c83
-rw-r--r--hw/xfree86/os-support/shared/stdPci.c48
-rw-r--r--hw/xfree86/os-support/shared/stdResource.c178
-rw-r--r--hw/xfree86/os-support/shared/std_kbdEv.c46
-rw-r--r--hw/xfree86/os-support/shared/sysv_kbd.c102
-rw-r--r--hw/xfree86/os-support/shared/vidmem.c296
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.c46
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.h32
-rw-r--r--hw/xfree86/os-support/solaris/apSolaris.shar768
-rw-r--r--hw/xfree86/os-support/solaris/sun_bios.c100
-rw-r--r--hw/xfree86/os-support/solaris/sun_init.c375
-rw-r--r--hw/xfree86/os-support/solaris/sun_inout.s124
-rw-r--r--hw/xfree86/os-support/solaris/sun_io.c64
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbd.c113
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbdEv.c922
-rw-r--r--hw/xfree86/os-support/solaris/sun_mouse.c322
-rw-r--r--hw/xfree86/os-support/solaris/sun_vid.c229
-rw-r--r--hw/xfree86/os-support/sysv/sysv_init.c250
-rw-r--r--hw/xfree86/os-support/sysv/sysv_io.c74
-rw-r--r--hw/xfree86/os-support/sysv/sysv_mouse.c60
-rw-r--r--hw/xfree86/os-support/sysv/sysv_video.c364
-rw-r--r--hw/xfree86/os-support/sysv/xqueue.c538
-rw-r--r--hw/xfree86/os-support/sysv/xqueue.h8
-rw-r--r--hw/xfree86/os-support/xf86OSKbd.h133
-rw-r--r--hw/xfree86/os-support/xf86OSmouse.h285
-rw-r--r--hw/xfree86/os-support/xf86OSpriv.h53
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h758
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h269
-rw-r--r--hw/xfree86/os-support/xf86_ansic.h353
-rw-r--r--hw/xfree86/os-support/xf86_libc.h704
-rw-r--r--hw/xfree86/parser/Configint.h222
-rw-r--r--hw/xfree86/parser/DRI.c183
-rw-r--r--hw/xfree86/parser/Device.c399
-rw-r--r--hw/xfree86/parser/Files.c291
-rw-r--r--hw/xfree86/parser/Flags.c521
-rw-r--r--hw/xfree86/parser/Input.c211
-rw-r--r--hw/xfree86/parser/Keyboard.c302
-rw-r--r--hw/xfree86/parser/Layout.c509
-rw-r--r--hw/xfree86/parser/Module.c257
-rw-r--r--hw/xfree86/parser/Monitor.c901
-rw-r--r--hw/xfree86/parser/Pointer.c232
-rw-r--r--hw/xfree86/parser/Screen.c574
-rw-r--r--hw/xfree86/parser/Vendor.c254
-rw-r--r--hw/xfree86/parser/Video.c293
-rw-r--r--hw/xfree86/parser/configProcs.h124
-rw-r--r--hw/xfree86/parser/cpconfig.c119
-rw-r--r--hw/xfree86/parser/read.c310
-rw-r--r--hw/xfree86/parser/scan.c918
-rw-r--r--hw/xfree86/parser/write.c214
-rw-r--r--hw/xfree86/parser/xf86Optrec.h109
-rw-r--r--hw/xfree86/parser/xf86Parser.h471
-rw-r--r--hw/xfree86/parser/xf86tokens.h276
-rw-r--r--hw/xfree86/rac/xf86RAC.c1256
-rw-r--r--hw/xfree86/rac/xf86RAC.h18
-rw-r--r--hw/xfree86/rac/xf86RACmodule.c21
-rw-r--r--hw/xfree86/ramdac/BT.c163
-rw-r--r--hw/xfree86/ramdac/BT.h33
-rw-r--r--hw/xfree86/ramdac/BTPriv.h17
-rw-r--r--hw/xfree86/ramdac/CURSOR.NOTES191
-rw-r--r--hw/xfree86/ramdac/IBM.c633
-rw-r--r--hw/xfree86/ramdac/IBM.h383
-rw-r--r--hw/xfree86/ramdac/IBMPriv.h24
-rw-r--r--hw/xfree86/ramdac/TI.c713
-rw-r--r--hw/xfree86/ramdac/TI.h93
-rw-r--r--hw/xfree86/ramdac/TIPriv.h26
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c437
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.h49
-rw-r--r--hw/xfree86/ramdac/xf86CursorPriv.h48
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c523
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.c152
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.h124
-rw-r--r--hw/xfree86/ramdac/xf86RamDacCmap.c72
-rw-r--r--hw/xfree86/ramdac/xf86RamDacMod.c45
-rw-r--r--hw/xfree86/ramdac/xf86RamDacPriv.h10
-rw-r--r--hw/xfree86/scanpci/extrapci.ids44
-rw-r--r--hw/xfree86/scanpci/pci.ids7442
-rw-r--r--hw/xfree86/scanpci/pciid2c.pl387
-rw-r--r--hw/xfree86/scanpci/xf86PciData.h76
-rw-r--r--hw/xfree86/scanpci/xf86PciStdIds.h82421
-rw-r--r--hw/xfree86/scanpci/xf86PciStr.h63
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.c413
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.h45
-rw-r--r--hw/xfree86/shadowfb/sfbmodule.c24
-rw-r--r--hw/xfree86/shadowfb/shadow.c1834
-rw-r--r--hw/xfree86/shadowfb/shadowfb.h44
-rw-r--r--hw/xfree86/utils/gtf/gtf.c743
-rw-r--r--hw/xfree86/utils/gtf/gtf.man.pre45
-rw-r--r--hw/xfree86/utils/ioport/ioport.c493
-rw-r--r--hw/xfree86/utils/kbd_mode/bsd-kbd_mode.c97
-rw-r--r--hw/xfree86/utils/kbd_mode/bsd-kbd_mode.man.pre36
-rw-r--r--hw/xfree86/utils/kbd_mode/sun-kbd_mode.c154
-rw-r--r--hw/xfree86/utils/kbd_mode/sun-kbd_mode.man.pre53
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.c242
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.man.pre64
-rw-r--r--hw/xfree86/utils/scanpci/scanpci.c779
-rw-r--r--hw/xfree86/utils/scanpci/scanpci.man.pre42
-rw-r--r--hw/xfree86/utils/xorgcfg/TODO33
-rw-r--r--hw/xfree86/utils/xorgcfg/accessx.c682
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.c434
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/card.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/card.xpm81
-rw-r--r--hw/xfree86/utils/xorgcfg/cards.c693
-rw-r--r--hw/xfree86/utils/xorgcfg/cards.h90
-rw-r--r--hw/xfree86/utils/xorgcfg/computer.xpm91
-rw-r--r--hw/xfree86/utils/xorgcfg/config.c302
-rw-r--r--hw/xfree86/utils/xorgcfg/config.h248
-rw-r--r--hw/xfree86/utils/xorgcfg/down.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/expert.c4858
-rw-r--r--hw/xfree86/utils/xorgcfg/help.c1786
-rw-r--r--hw/xfree86/utils/xorgcfg/help.h42
-rw-r--r--hw/xfree86/utils/xorgcfg/interface.c2280
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard-cfg.c1379
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard-cfg.h74
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard.xpm66
-rw-r--r--hw/xfree86/utils/xorgcfg/left.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/loader.c396
-rw-r--r--hw/xfree86/utils/xorgcfg/loader.h171
-rw-r--r--hw/xfree86/utils/xorgcfg/loadmod.c682
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.c457
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.h48
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor.xpm79
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.c453
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse.xpm76
-rw-r--r--hw/xfree86/utils/xorgcfg/narrower.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/options.c788
-rw-r--r--hw/xfree86/utils/xorgcfg/options.h51
-rw-r--r--hw/xfree86/utils/xorgcfg/right.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.c556
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/screen.c984
-rw-r--r--hw/xfree86/utils/xorgcfg/screen.h52
-rw-r--r--hw/xfree86/utils/xorgcfg/shorter.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/startx.c150
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.c70
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.h43
-rw-r--r--hw/xfree86/utils/xorgcfg/taller.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/text-mode.c3381
-rw-r--r--hw/xfree86/utils/xorgcfg/up.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.c1347
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.h64
-rw-r--r--hw/xfree86/utils/xorgcfg/wider.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.c983
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.h111
-rw-r--r--hw/xfree86/utils/xorgconfig/Cards3130
-rw-r--r--hw/xfree86/utils/xorgconfig/Cards98647
-rw-r--r--hw/xfree86/utils/xorgconfig/cards.c286
-rw-r--r--hw/xfree86/utils/xorgconfig/cards.h38
-rw-r--r--hw/xfree86/vbe/vbe.c1073
-rw-r--r--hw/xfree86/vbe/vbe.h332
-rw-r--r--hw/xfree86/vbe/vbeModes.c477
-rw-r--r--hw/xfree86/vbe/vbeModes.h91
-rw-r--r--hw/xfree86/vbe/vbe_module.c50
-rw-r--r--hw/xfree86/vgahw/vgaCmap.c301
-rw-r--r--hw/xfree86/vgahw/vgaHW.c2005
-rw-r--r--hw/xfree86/vgahw/vgaHW.h228
-rw-r--r--hw/xfree86/vgahw/vgaHWmodule.c27
-rw-r--r--hw/xfree86/x86emu/debug.c430
-rw-r--r--hw/xfree86/x86emu/decode.c1073
-rw-r--r--hw/xfree86/x86emu/fpu.c966
-rw-r--r--hw/xfree86/x86emu/ops.c11677
-rw-r--r--hw/xfree86/x86emu/ops2.c2805
-rw-r--r--hw/xfree86/x86emu/prim_ops.c2914
-rw-r--r--hw/xfree86/x86emu/sys.c603
-rw-r--r--hw/xfree86/x86emu/validate.c765
-rw-r--r--hw/xfree86/x86emu/x86emu.h194
-rw-r--r--hw/xfree86/x86emu/x86emu/debug.h211
-rw-r--r--hw/xfree86/x86emu/x86emu/decode.h89
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu.h61
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h112
-rw-r--r--hw/xfree86/x86emu/x86emu/ops.h45
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_asm.h971
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_ops.h231
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h330
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h107
-rw-r--r--hw/xfree86/x86emu/x86emu/x86emui.h105
-rw-r--r--hw/xfree86/xaa/XAA.HOWTO1427
-rw-r--r--hw/xfree86/xaa/xaa.h1362
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c219
-rw-r--r--hw/xfree86/xaa/xaaBitOrder.c13
-rw-r--r--hw/xfree86/xaa/xaaBitmap.c475
-rw-r--r--hw/xfree86/xaa/xaaCpyArea.c385
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c206
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c80
-rw-r--r--hw/xfree86/xaa/xaaDashLine.c329
-rw-r--r--hw/xfree86/xaa/xaaFallback.c352
-rw-r--r--hw/xfree86/xaa/xaaFillArc.c213
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c960
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c1093
-rw-r--r--hw/xfree86/xaa/xaaGC.c653
-rw-r--r--hw/xfree86/xaa/xaaGCmisc.c426
-rw-r--r--hw/xfree86/xaa/xaaImage.c519
-rw-r--r--hw/xfree86/xaa/xaaInit.c762
-rw-r--r--hw/xfree86/xaa/xaaInitAccel.c1513
-rw-r--r--hw/xfree86/xaa/xaaLine.c390
-rw-r--r--hw/xfree86/xaa/xaaLineMisc.c148
-rw-r--r--hw/xfree86/xaa/xaaNonTEGlyph.c198
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c588
-rw-r--r--hw/xfree86/xaa/xaaOffscreen.c160
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c306
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c1154
-rw-r--r--hw/xfree86/xaa/xaaPCache.c2372
-rw-r--r--hw/xfree86/xaa/xaaPaintWin.c198
-rw-r--r--hw/xfree86/xaa/xaaPict.c685
-rw-r--r--hw/xfree86/xaa/xaaROP.c164
-rw-r--r--hw/xfree86/xaa/xaaRect.c134
-rw-r--r--hw/xfree86/xaa/xaaSpans.c880
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c1678
-rw-r--r--hw/xfree86/xaa/xaaStipple.c859
-rw-r--r--hw/xfree86/xaa/xaaTEGlyph.c1072
-rw-r--r--hw/xfree86/xaa/xaaTEGlyphBlt.S964
-rw-r--r--hw/xfree86/xaa/xaaTEText.c293
-rw-r--r--hw/xfree86/xaa/xaaTables.c88
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c941
-rw-r--r--hw/xfree86/xaa/xaacexp.h124
-rw-r--r--hw/xfree86/xaa/xaalocal.h1756
-rw-r--r--hw/xfree86/xaa/xaarop.h307
-rw-r--r--hw/xfree86/xaa/xaawrap.h78
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.h109
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.sh25
-rw-r--r--hw/xfree86/xf1bpp/mfbmodule.c48
-rw-r--r--hw/xfree86/xf1bpp/mfbunmap.h109
-rw-r--r--hw/xfree86/xf1bpp/mfbunmap.sh23
-rw-r--r--hw/xfree86/xf1bpp/xf1bpp.h37
-rw-r--r--hw/xfree86/xf4bpp/NOTES194
-rw-r--r--hw/xfree86/xf4bpp/OScompiler.h57
-rw-r--r--hw/xfree86/xf4bpp/emulOpStip.c100
-rw-r--r--hw/xfree86/xf4bpp/emulRepAre.c67
-rw-r--r--hw/xfree86/xf4bpp/emulTile.c350
-rw-r--r--hw/xfree86/xf4bpp/ibmTrace.h10
-rw-r--r--hw/xfree86/xf4bpp/mfbbres.c162
-rw-r--r--hw/xfree86/xf4bpp/mfbbresd.c203
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c299
-rw-r--r--hw/xfree86/xf4bpp/mfbhrzvert.c133
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c503
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c972
-rw-r--r--hw/xfree86/xf4bpp/mfbzerarc.c266
-rw-r--r--hw/xfree86/xf4bpp/offscreen.c359
-rw-r--r--hw/xfree86/xf4bpp/ppcArea.c95
-rw-r--r--hw/xfree86/xf4bpp/ppcBStore.c153
-rw-r--r--hw/xfree86/xf4bpp/ppcCReduce.c236
-rw-r--r--hw/xfree86/xf4bpp/ppcClip.c153
-rw-r--r--hw/xfree86/xf4bpp/ppcCpArea.c468
-rw-r--r--hw/xfree86/xf4bpp/ppcDepth.c52
-rw-r--r--hw/xfree86/xf4bpp/ppcFillRct.c213
-rw-r--r--hw/xfree86/xf4bpp/ppcGC.c458
-rw-r--r--hw/xfree86/xf4bpp/ppcGCstr.h91
-rw-r--r--hw/xfree86/xf4bpp/ppcGetSp.c139
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c252
-rw-r--r--hw/xfree86/xf4bpp/ppcImg.c118
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c502
-rw-r--r--hw/xfree86/xf4bpp/ppcPixmap.c144
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c214
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyPnt.c141
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyRec.c127
-rw-r--r--hw/xfree86/xf4bpp/ppcQuery.c44
-rw-r--r--hw/xfree86/xf4bpp/ppcRslvC.c176
-rw-r--r--hw/xfree86/xf4bpp/ppcSetSp.c315
-rw-r--r--hw/xfree86/xf4bpp/ppcSpMcro.h45
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c278
-rw-r--r--hw/xfree86/xf4bpp/ppcWindow.c224
-rw-r--r--hw/xfree86/xf4bpp/vgaBitBlt.c750
-rw-r--r--hw/xfree86/xf4bpp/vgaGC.c216
-rw-r--r--hw/xfree86/xf4bpp/vgaImages.c458
-rw-r--r--hw/xfree86/xf4bpp/vgaReg.h136
-rw-r--r--hw/xfree86/xf4bpp/vgaSolid.c573
-rw-r--r--hw/xfree86/xf4bpp/vgaStipple.c718
-rw-r--r--hw/xfree86/xf4bpp/vgaVideo.h92
-rw-r--r--hw/xfree86/xf4bpp/vgamodule.c57
-rw-r--r--hw/xfree86/xf4bpp/wm3.c207
-rw-r--r--hw/xfree86/xf4bpp/wm3.h77
-rw-r--r--hw/xfree86/xf4bpp/xf4bpp.h654
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16.h69
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16module.c37
-rw-r--r--hw/xfree86/xf8_16bpp/cfbscrinit.c370
-rw-r--r--hw/xfree86/xf8_16bpp/cfbwindow.c177
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h222
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32module.c38
-rw-r--r--hw/xfree86/xf8_32bpp/cfbbstore.c102
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyarea.c544
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyplane.c39
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgc.c663
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcmisc.c146
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcunder.c637
-rw-r--r--hw/xfree86/xf8_32bpp/cfbimage.c168
-rw-r--r--hw/xfree86/xf8_32bpp/cfbpntwin.c177
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c323
-rw-r--r--hw/xfree86/xf8_32bpp/cfbwindow.c116
-rw-r--r--hw/xfree86/xf8_32bpp/xf86overlay.c1258
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32wid.h93
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32widmodule.c46
-rw-r--r--hw/xfree86/xf8_32wid/cfbscrinit.c382
-rw-r--r--hw/xfree86/xf8_32wid/cfbwid.c147
-rw-r--r--hw/xfree86/xf8_32wid/cfbwindow.c284
-rw-r--r--hw/xnest/Args.c188
-rw-r--r--hw/xnest/Args.h40
-rw-r--r--hw/xnest/Color.c493
-rw-r--r--hw/xnest/Color.h58
-rw-r--r--hw/xnest/Cursor.c206
-rw-r--r--hw/xnest/Display.c199
-rw-r--r--hw/xnest/Display.h47
-rw-r--r--hw/xnest/Drawable.h28
-rw-r--r--hw/xnest/Events.c195
-rw-r--r--hw/xnest/Events.h30
-rw-r--r--hw/xnest/Font.c87
-rw-r--r--hw/xnest/GC.c336
-rw-r--r--hw/xnest/GCOps.c314
-rw-r--r--hw/xnest/GCOps.h70
-rw-r--r--hw/xnest/GetTime.c45
-rw-r--r--hw/xnest/Handlers.c43
-rw-r--r--hw/xnest/Handlers.h24
-rw-r--r--hw/xnest/Init.c182
-rw-r--r--hw/xnest/Init.h21
-rw-r--r--hw/xnest/Keyboard.c283
-rw-r--r--hw/xnest/Keyboard.h27
-rw-r--r--hw/xnest/Pixmap.c137
-rw-r--r--hw/xnest/Pointer.c73
-rw-r--r--hw/xnest/Pointer.h29
-rw-r--r--hw/xnest/Screen.c447
-rw-r--r--hw/xnest/Screen.h27
-rw-r--r--hw/xnest/TestExt.c65
-rw-r--r--hw/xnest/Visual.c68
-rw-r--r--hw/xnest/Visual.h27
-rw-r--r--hw/xnest/Window.c547
-rw-r--r--hw/xnest/XNCursor.h40
-rw-r--r--hw/xnest/XNFont.h37
-rw-r--r--hw/xnest/XNGC.h44
-rw-r--r--hw/xnest/XNPixmap.h45
-rw-r--r--hw/xnest/XNWindow.h79
-rw-r--r--hw/xnest/Xnest.h96
-rw-r--r--hw/xnest/Xnest.man.pre264
-rw-r--r--hw/xnest/icon14
-rw-r--r--hw/xnest/os2Stub.c388
-rw-r--r--hw/xnest/screensaver686
-rw-r--r--hw/xwin/InitInput.c177
-rw-r--r--hw/xwin/InitOutput.c1358
-rw-r--r--hw/xwin/X.icobin4710 -> 0 bytes
-rw-r--r--hw/xwin/XWin.man129
-rw-r--r--hw/xwin/XWin.rc87
-rw-r--r--hw/xwin/_usr_X11R6_lib_X11_system.XWinrc105
-rw-r--r--hw/xwin/ddraw.h2094
-rw-r--r--hw/xwin/win.h1537
-rw-r--r--hw/xwin/winallpriv.c181
-rw-r--r--hw/xwin/winblock.c80
-rw-r--r--hw/xwin/winclip.c40
-rw-r--r--hw/xwin/winclipboard.h160
-rw-r--r--hw/xwin/winclipboardinit.c117
-rw-r--r--hw/xwin/winclipboardtextconv.c153
-rw-r--r--hw/xwin/winclipboardthread.c484
-rw-r--r--hw/xwin/winclipboardunicode.c68
-rw-r--r--hw/xwin/winclipboardwndproc.c86
-rw-r--r--hw/xwin/winclipboardxevents.c743
-rw-r--r--hw/xwin/wincmap.c631
-rw-r--r--hw/xwin/winconfig.c1014
-rw-r--r--hw/xwin/winconfig.h332
-rw-r--r--hw/xwin/wincreatewnd.c572
-rw-r--r--hw/xwin/wincursor.c99
-rwxr-xr-xhw/xwin/windialogs.c320
-rw-r--r--hw/xwin/winengine.c316
-rw-r--r--hw/xwin/winerror.c65
-rw-r--r--hw/xwin/winfillsp.c863
-rw-r--r--hw/xwin/winfont.c54
-rw-r--r--hw/xwin/wingc.c217
-rw-r--r--hw/xwin/wingetsp.c190
-rw-r--r--hw/xwin/winkeybd.c699
-rw-r--r--hw/xwin/winkeybd.h398
-rw-r--r--hw/xwin/winmisc.c147
-rw-r--r--hw/xwin/winmouse.c295
-rw-r--r--hw/xwin/winms.h61
-rw-r--r--hw/xwin/winmsg.c100
-rw-r--r--hw/xwin/winmsg.h47
-rwxr-xr-xhw/xwin/winmultiwindowclass.c284
-rwxr-xr-xhw/xwin/winmultiwindowclass.h110
-rwxr-xr-xhw/xwin/winmultiwindowicons.c378
-rwxr-xr-xhw/xwin/winmultiwindowshape.c212
-rw-r--r--hw/xwin/winmultiwindowwindow.c862
-rw-r--r--hw/xwin/winmultiwindowwm.c1183
-rwxr-xr-xhw/xwin/winmultiwindowwndproc.c1005
-rw-r--r--hw/xwin/winnativegdi.c480
-rw-r--r--hw/xwin/winpfbdd.c654
-rw-r--r--hw/xwin/winpixmap.c212
-rw-r--r--hw/xwin/winpntwin.c45
-rw-r--r--hw/xwin/winpolyline.c55
-rw-r--r--hw/xwin/winprefs.c661
-rw-r--r--hw/xwin/winprefs.h147
-rw-r--r--hw/xwin/winprefslex.l113
-rw-r--r--hw/xwin/winprefsyacc.y334
-rw-r--r--hw/xwin/winpushpxl.c226
-rw-r--r--hw/xwin/winregistry.c66
-rw-r--r--hw/xwin/winrop.c139
-rw-r--r--hw/xwin/winscrinit.c747
-rw-r--r--hw/xwin/winsetsp.c183
-rw-r--r--hw/xwin/winshaddd.c1373
-rw-r--r--hw/xwin/winshadddnl.c1316
-rw-r--r--hw/xwin/winshadgdi.c1180
-rwxr-xr-xhw/xwin/wintrayicon.c209
-rwxr-xr-xhw/xwin/winvideo.c206
-rw-r--r--hw/xwin/winwakeup.c63
-rw-r--r--hw/xwin/winwindow.c541
-rw-r--r--hw/xwin/winwindow.h135
-rw-r--r--hw/xwin/winwndproc.c1072
-rw-r--r--ilbm/README17
-rw-r--r--ilbm/ilbm.h1047
-rw-r--r--ilbm/ilbmbitblt.c479
-rw-r--r--ilbm/ilbmblt.c569
-rw-r--r--ilbm/ilbmbres.c324
-rw-r--r--ilbm/ilbmbresd.c215
-rw-r--r--ilbm/ilbmbstore.c155
-rw-r--r--ilbm/ilbmclip.c242
-rw-r--r--ilbm/ilbmcmap.c124
-rw-r--r--ilbm/ilbmfillarc.c373
-rw-r--r--ilbm/ilbmfillrct.c295
-rw-r--r--ilbm/ilbmfillsp.c1145
-rw-r--r--ilbm/ilbmfont.c78
-rw-r--r--ilbm/ilbmgc.c711
-rw-r--r--ilbm/ilbmgetsp.c166
-rw-r--r--ilbm/ilbmhrzvert.c209
-rw-r--r--ilbm/ilbmimage.c437
-rw-r--r--ilbm/ilbmimggblt.c470
-rw-r--r--ilbm/ilbmline.c701
-rw-r--r--ilbm/ilbmmisc.c95
-rw-r--r--ilbm/ilbmpixmap.c289
-rw-r--r--ilbm/ilbmply1rct.c299
-rw-r--r--ilbm/ilbmplygblt.c465
-rw-r--r--ilbm/ilbmpntarea.c652
-rw-r--r--ilbm/ilbmpntwin.c127
-rw-r--r--ilbm/ilbmpolypnt.c148
-rw-r--r--ilbm/ilbmpushpxl.c259
-rw-r--r--ilbm/ilbmscrinit.c247
-rw-r--r--ilbm/ilbmsetsp.c265
-rw-r--r--ilbm/ilbmtegblt.c595
-rw-r--r--ilbm/ilbmtile.c853
-rw-r--r--ilbm/ilbmwindow.c319
-rw-r--r--ilbm/ilbmzerarc.c210
-rw-r--r--include/XIstubs.h76
-rw-r--r--include/bstore.h23
-rw-r--r--include/bstorestr.h58
-rw-r--r--include/closestr.h159
-rw-r--r--include/closure.h57
-rw-r--r--include/colormap.h184
-rw-r--r--include/colormapst.h120
-rw-r--r--include/cursor.h147
-rw-r--r--include/cursorstr.h86
-rw-r--r--include/dix.h788
-rw-r--r--include/dixevents.h106
-rw-r--r--include/dixfont.h155
-rw-r--r--include/dixfontstr.h95
-rw-r--r--include/dixgrabs.h59
-rw-r--r--include/dixstruct.h211
-rw-r--r--include/exevents.h183
-rw-r--r--include/extension.h67
-rw-r--r--include/extinit.h166
-rw-r--r--include/extnsionst.h152
-rw-r--r--include/gc.h178
-rw-r--r--include/gcstruct.h328
-rw-r--r--include/globals.h52
-rw-r--r--include/input.h376
-rw-r--r--include/inputstr.h311
-rw-r--r--include/misc.h269
-rw-r--r--include/miscstruct.h80
-rw-r--r--include/opaque.h83
-rw-r--r--include/os.h548
-rw-r--r--include/pixmap.h110
-rw-r--r--include/pixmapstr.h84
-rw-r--r--include/property.h74
-rw-r--r--include/propertyst.h76
-rw-r--r--include/region.h53
-rw-r--r--include/regionstr.h403
-rw-r--r--include/resource.h274
-rw-r--r--include/rgb.h54
-rw-r--r--include/screenint.h112
-rw-r--r--include/scrnintstr.h733
-rw-r--r--include/selection.h68
-rw-r--r--include/servermd.h576
-rw-r--r--include/site.h139
-rw-r--r--include/swaprep.h322
-rw-r--r--include/swapreq.h120
-rw-r--r--include/validate.h42
-rw-r--r--include/window.h255
-rw-r--r--include/windowstr.h225
-rw-r--r--iplan2p4/ipl.h1250
-rw-r--r--iplan2p4/iplallpriv.c89
-rw-r--r--iplan2p4/iplbitblt.c384
-rw-r--r--iplan2p4/iplblt.c427
-rw-r--r--iplan2p4/iplbres.c182
-rw-r--r--iplan2p4/iplbresd.c208
-rw-r--r--iplan2p4/iplbstore.c155
-rw-r--r--iplan2p4/iplcmap.c122
-rw-r--r--iplan2p4/iplfillarc.c267
-rw-r--r--iplan2p4/iplfillrct.c277
-rw-r--r--iplan2p4/iplfillsp.c380
-rw-r--r--iplan2p4/iplgc.c782
-rw-r--r--iplan2p4/iplgetsp.c162
-rw-r--r--iplan2p4/iplhrzvert.c124
-rw-r--r--iplan2p4/iplimage.c83
-rw-r--r--iplan2p4/iplline.c754
-rw-r--r--iplan2p4/iplmap.h172
-rw-r--r--iplan2p4/iplmergerop.h142
-rw-r--r--iplan2p4/iplmskbits.c104
-rw-r--r--iplan2p4/iplmskbits.h496
-rw-r--r--iplan2p4/iplpack.c316
-rw-r--r--iplan2p4/iplpack.h10
-rw-r--r--iplan2p4/iplpixmap.c380
-rw-r--r--iplan2p4/iplply1rct.c306
-rw-r--r--iplan2p4/iplpntwin.c337
-rw-r--r--iplan2p4/iplpolypnt.c119
-rw-r--r--iplan2p4/iplrrop.c215
-rw-r--r--iplan2p4/iplrrop.h76
-rw-r--r--iplan2p4/iplscrinit.c229
-rw-r--r--iplan2p4/iplsetsp.c300
-rw-r--r--iplan2p4/iplsolid.c217
-rw-r--r--iplan2p4/ipltegblt.c217
-rw-r--r--iplan2p4/ipltile32.c268
-rw-r--r--iplan2p4/ipltileodd.c865
-rw-r--r--iplan2p4/iplwindow.c339
-rw-r--r--lbx/lbxcmap.c1152
-rw-r--r--lbx/lbxdata.h44
-rw-r--r--lbx/lbxdix.c865
-rw-r--r--lbx/lbxexts.c271
-rw-r--r--lbx/lbxgfx.c850
-rw-r--r--lbx/lbxmain.c1756
-rw-r--r--lbx/lbxopts.c802
-rw-r--r--lbx/lbxprop.c545
-rw-r--r--lbx/lbxserve.h285
-rw-r--r--lbx/lbxsquish.c154
-rw-r--r--lbx/lbxsrvopts.h63
-rw-r--r--lbx/lbxswap.c824
-rw-r--r--lbx/lbxtables.c35
-rw-r--r--lbx/lbxtags.c233
-rw-r--r--lbx/lbxtags.h82
-rw-r--r--lbx/lbxzerorep.c416
-rw-r--r--mfb/fastblt.h94
-rw-r--r--mfb/maskbits.c1051
-rw-r--r--mfb/maskbits.h680
-rw-r--r--mfb/mergerop.h395
-rw-r--r--mfb/mfb.h1120
-rw-r--r--mfb/mfbbitblt.c510
-rw-r--r--mfb/mfbblt.c585
-rw-r--r--mfb/mfbbres.c366
-rw-r--r--mfb/mfbbresd.c205
-rw-r--r--mfb/mfbbstore.c151
-rw-r--r--mfb/mfbclip.c270
-rw-r--r--mfb/mfbcmap.c160
-rw-r--r--mfb/mfbfillarc.c329
-rw-r--r--mfb/mfbfillrct.c224
-rw-r--r--mfb/mfbfillsp.c1024
-rw-r--r--mfb/mfbfont.c72
-rw-r--r--mfb/mfbgc.c1572
-rw-r--r--mfb/mfbgetsp.c155
-rw-r--r--mfb/mfbhrzvert.c175
-rw-r--r--mfb/mfbimage.c173
-rw-r--r--mfb/mfbimggblt.c445
-rw-r--r--mfb/mfbline.c753
-rw-r--r--mfb/mfbmisc.c91
-rw-r--r--mfb/mfbpixmap.c294
-rw-r--r--mfb/mfbply1rct.c257
-rw-r--r--mfb/mfbplygblt.c395
-rw-r--r--mfb/mfbpntarea.c296
-rw-r--r--mfb/mfbpntwin.c123
-rw-r--r--mfb/mfbpolypnt.c141
-rw-r--r--mfb/mfbpushpxl.c278
-rw-r--r--mfb/mfbscrclse.c62
-rw-r--r--mfb/mfbscrinit.c197
-rw-r--r--mfb/mfbsetsp.c279
-rw-r--r--mfb/mfbtegblt.c364
-rw-r--r--mfb/mfbtile.c236
-rw-r--r--mfb/mfbwindow.c337
-rw-r--r--mfb/mfbzerarc.c254
-rw-r--r--mi/cbrt.c48
-rw-r--r--mi/mi.h635
-rw-r--r--mi/miarc.c3715
-rw-r--r--mi/mibank.c2573
-rw-r--r--mi/mibank.h119
-rw-r--r--mi/mibitblt.c837
-rw-r--r--mi/mibstore.c3901
-rw-r--r--mi/mibstore.h30
-rw-r--r--mi/mibstorest.h89
-rw-r--r--mi/miclipn.c80
-rw-r--r--mi/micmap.c674
-rw-r--r--mi/micmap.h65
-rw-r--r--mi/micoord.h71
-rw-r--r--mi/micursor.c73
-rw-r--r--mi/midash.c311
-rw-r--r--mi/midispcur.c811
-rw-r--r--mi/mieq.c190
-rw-r--r--mi/miexpose.c873
-rw-r--r--mi/mifillarc.c813
-rw-r--r--mi/mifillarc.h216
-rw-r--r--mi/mifillrct.c140
-rw-r--r--mi/mifpoly.h111
-rw-r--r--mi/mifpolycon.c280
-rw-r--r--mi/migc.c297
-rw-r--r--mi/migc.h74
-rw-r--r--mi/miglblt.c251
-rw-r--r--mi/miinitext.c553
-rw-r--r--mi/miline.h174
-rw-r--r--mi/mioverlay.c2075
-rw-r--r--mi/mioverlay.h29
-rw-r--r--mi/mipointer.c539
-rw-r--r--mi/mipointer.h162
-rw-r--r--mi/mipointrst.h64
-rw-r--r--mi/mipoly.c125
-rw-r--r--mi/mipoly.h217
-rw-r--r--mi/mipolycon.c244
-rw-r--r--mi/mipolygen.c228
-rw-r--r--mi/mipolypnt.c121
-rw-r--r--mi/mipolyrect.c189
-rw-r--r--mi/mipolyseg.c81
-rw-r--r--mi/mipolytext.c198
-rw-r--r--mi/mipolyutil.c397
-rw-r--r--mi/mipushpxl.c257
-rw-r--r--mi/miregion.c2552
-rw-r--r--mi/miscanfill.h144
-rw-r--r--mi/miscrinit.c368
-rw-r--r--mi/mispans.c559
-rw-r--r--mi/mispans.h117
-rw-r--r--mi/misprite.c2324
-rw-r--r--mi/misprite.h96
-rw-r--r--mi/mispritest.h118
-rw-r--r--mi/mistruct.h65
-rw-r--r--mi/mivalidate.h51
-rw-r--r--mi/mivaltree.c781
-rw-r--r--mi/miwideline.c2234
-rw-r--r--mi/miwideline.h224
-rw-r--r--mi/miwindow.c1174
-rw-r--r--mi/mizerarc.c851
-rw-r--r--mi/mizerarc.h134
-rw-r--r--mi/mizerclip.c632
-rw-r--r--mi/mizerline.c376
-rw-r--r--miext/layer/layer.h145
-rw-r--r--miext/layer/layergc.c190
-rw-r--r--miext/layer/layerinit.c359
-rw-r--r--miext/layer/layerpict.c145
-rw-r--r--miext/layer/layerstr.h421
-rw-r--r--miext/layer/layerwin.c483
-rw-r--r--miext/rootless/accel/rlAccel.h135
-rw-r--r--miext/rootless/accel/rlBlt.c366
-rw-r--r--miext/rootless/accel/rlCopy.c103
-rw-r--r--miext/rootless/accel/rlFill.c217
-rw-r--r--miext/rootless/accel/rlFillRect.c114
-rw-r--r--miext/rootless/accel/rlFillSpans.c102
-rw-r--r--miext/rootless/accel/rlGlyph.c166
-rw-r--r--miext/rootless/accel/rlSolid.c108
-rw-r--r--miext/rootless/rootless.h399
-rw-r--r--miext/rootless/rootlessCommon.c380
-rw-r--r--miext/rootless/rootlessCommon.h254
-rw-r--r--miext/rootless/rootlessConfig.h50
-rw-r--r--miext/rootless/rootlessGC.c1515
-rw-r--r--miext/rootless/rootlessScreen.c666
-rw-r--r--miext/rootless/rootlessValTree.c638
-rw-r--r--miext/rootless/rootlessWindow.c1435
-rw-r--r--miext/rootless/rootlessWindow.h60
-rw-r--r--miext/rootless/safeAlpha/safeAlpha.h46
-rw-r--r--miext/rootless/safeAlpha/safeAlphaPicture.c595
-rw-r--r--miext/rootless/safeAlpha/safeAlphaWindow.c173
-rw-r--r--miext/shadow/shadow.c1539
-rw-r--r--miext/shadow/shadow.h172
-rw-r--r--miext/shadow/shalloc.c48
-rw-r--r--miext/shadow/shpacked.c108
-rw-r--r--miext/shadow/shplanar.c168
-rw-r--r--miext/shadow/shplanar8.c170
-rw-r--r--miext/shadow/shrot16pack_180.c29
-rw-r--r--miext/shadow/shrot16pack_270.c29
-rw-r--r--miext/shadow/shrot16pack_90.c29
-rw-r--r--miext/shadow/shrot32pack.c28
-rw-r--r--miext/shadow/shrot32pack_180.c29
-rw-r--r--miext/shadow/shrot32pack_270.c29
-rw-r--r--miext/shadow/shrot32pack_90.c29
-rw-r--r--miext/shadow/shrot8pack.c28
-rw-r--r--miext/shadow/shrot8pack_180.c29
-rw-r--r--miext/shadow/shrot8pack_270.c29
-rw-r--r--miext/shadow/shrot8pack_90.c29
-rw-r--r--miext/shadow/shrotate.c306
-rw-r--r--miext/shadow/shrotpack.h182
-rw-r--r--os/WaitFor.c676
-rw-r--r--os/access.c1708
-rw-r--r--os/auth.c396
-rw-r--r--os/connection.c1307
-rw-r--r--os/io.c1339
-rw-r--r--os/k5auth.c797
-rw-r--r--os/lbxio.c547
-rw-r--r--os/log.c610
-rw-r--r--os/mitauth.c195
-rw-r--r--os/oscolor.c299
-rw-r--r--os/osdep.h341
-rw-r--r--os/osinit.c242
-rw-r--r--os/rpcauth.c200
-rw-r--r--os/secauth.c201
-rw-r--r--os/strlcat.c57
-rw-r--r--os/strlcpy.c52
-rw-r--r--os/utils.c2044
-rw-r--r--os/xalloc.c812
-rw-r--r--os/xdmauth.c498
-rw-r--r--os/xdmcp.c1679
-rw-r--r--randr/mirandr.c98
-rw-r--r--randr/randr.c1212
-rw-r--r--randr/randrstr.h132
-rw-r--r--record/record.c3048
-rw-r--r--record/set.c706
-rw-r--r--record/set.h150
-rw-r--r--render/animcur.c398
-rw-r--r--render/filter.c263
-rw-r--r--render/glyph.c416
-rw-r--r--render/glyphstr.h127
-rw-r--r--render/miglyph.c239
-rw-r--r--render/miindex.c353
-rw-r--r--render/mipict.c520
-rw-r--r--render/mipict.h210
-rw-r--r--render/mirect.c181
-rw-r--r--render/mitrap.c196
-rw-r--r--render/mitri.c352
-rw-r--r--render/picture.c1305
-rw-r--r--render/picture.h230
-rw-r--r--render/picturestr.h501
-rw-r--r--render/render.c2957
-rw-r--r--xkb/README.compiled13
-rw-r--r--xkb/XKBAlloc.c498
-rw-r--r--xkb/XKBGAlloc.c1015
-rw-r--r--xkb/XKBMAlloc.c988
-rw-r--r--xkb/XKBMisc.c975
-rw-r--r--xkb/ddxBeep.c366
-rw-r--r--xkb/ddxConfig.c211
-rw-r--r--xkb/ddxCtrls.c127
-rw-r--r--xkb/ddxDevBtn.c98
-rw-r--r--xkb/ddxFakeBtn.c57
-rw-r--r--xkb/ddxFakeMtn.c117
-rw-r--r--xkb/ddxInit.c44
-rw-r--r--xkb/ddxKeyClick.c48
-rw-r--r--xkb/ddxKillSrv.c53
-rw-r--r--xkb/ddxLEDs.c70
-rw-r--r--xkb/ddxList.c286
-rw-r--r--xkb/ddxLoad.c511
-rw-r--r--xkb/ddxPrivate.c38
-rw-r--r--xkb/ddxVT.c64
-rw-r--r--xkb/maprules.c1476
-rw-r--r--xkb/xkb.c6231
-rw-r--r--xkb/xkb.h72
-rw-r--r--xkb/xkbAccessX.c750
-rw-r--r--xkb/xkbActions.c1373
-rw-r--r--xkb/xkbDflts.h509
-rw-r--r--xkb/xkbEvents.c1053
-rw-r--r--xkb/xkbInit.c1021
-rw-r--r--xkb/xkbLEDs.c1063
-rw-r--r--xkb/xkbPrKeyEv.c184
-rw-r--r--xkb/xkbPrOtherEv.c80
-rw-r--r--xkb/xkbSwap.c593
-rw-r--r--xkb/xkbUtils.c983
-rw-r--r--xkb/xkbconfig.c1349
-rw-r--r--xkb/xkberrs.c66
-rw-r--r--xkb/xkbfmisc.c683
-rw-r--r--xkb/xkbout.c1060
-rw-r--r--xkb/xkbtext.c1434
-rw-r--r--xkb/xkmread.c1309
1697 files changed, 2976 insertions, 778859 deletions
diff --git a/GL/apple/aglGlx.c b/GL/apple/aglGlx.c
deleted file mode 100644
index ae3276a02..000000000
--- a/GL/apple/aglGlx.c
+++ /dev/null
@@ -1,1155 +0,0 @@
-/*
- * GLX implementation that uses Apple's AGL.framework for OpenGL
- */
-/*
- * Copyright (c) 2002 Greg Parker. All Rights Reserved.
- *
- * Portions of this file are copied from xf86glx.c,
- * which contains the following copyright:
- *
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/GL/apple/aglGlx.c,v 1.3 2003/10/13 00:30:54 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include <AGL/agl.h>
-#include "cr.h"
-
-// X11 and X11's glx
-#undef BOOL
-#define BOOL xBOOL
-#include "quartz.h"
-#include <miscstruct.h>
-#include <windowstr.h>
-#include <resource.h>
-#include <GL/glxint.h>
-#include <GL/glxtokens.h>
-#include <scrnintstr.h>
-#include <glxserver.h>
-#include <glxscreens.h>
-#include <glxdrawable.h>
-#include <glxcontext.h>
-#include <glxext.h>
-#include <glxutil.h>
-#include <glxscreens.h>
-#include <GL/internal/glcore.h>
-#undef BOOL
-
-// Write debugging output, or not
-#ifdef GLAQUA_DEBUG
-#define GLAQUA_DEBUG_MSG ErrorF
-#else
-#define GLAQUA_DEBUG_MSG(a, ...)
-#endif
-
-
-// The following GL functions don't have an EXT suffix in OpenGL.framework.
-GLboolean glAreTexturesResidentEXT (GLsizei a, const GLuint *b, GLboolean *c) {
- return glAreTexturesResident(a, b, c);
-}
-void glDeleteTexturesEXT (GLsizei d, const GLuint *e) {
- glDeleteTextures(d, e);
-}
-void glGenTexturesEXT (GLsizei f, GLuint *g) {
- glGenTextures(f, g);
-}
-GLboolean glIsTextureEXT (GLuint h) {
- return glIsTexture(h);
-}
-
-
-// some prototypes
-static Bool glAquaScreenProbe(int screen);
-static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
- int *nvisualp, int *ndepthp,
- int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB);
-static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
- void **privates);
-static __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC);
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv);
-static void glAquaResetExtension(void);
-
-
-/*
- * This structure is statically allocated in the __glXScreens[]
- * structure. This struct is not used anywhere other than in
- * __glXScreenInit to initialize each of the active screens
- * (__glXActiveScreens[]). Several of the fields must be initialized by
- * the screenProbe routine before they are copied to the active screens
- * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
- * and numUsableVisuals fields must be initialized.
- */
-__GLXscreenInfo __glDDXScreenInfo = {
- glAquaScreenProbe, /* Must be generic and handle all screens */
- glAquaCreateContext, /* Substitute screen's createContext routine */
- glAquaCreateBuffer, /* Substitute screen's createBuffer routine */
- NULL, /* Set up pGlxVisual in probe */
- NULL, /* Set up pVisualPriv in probe */
- 0, /* Set up numVisuals in probe */
- 0, /* Set up numUsableVisuals in probe */
- "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
- "Version String", /* GLXversion is overwritten by __glXScreenInit */
- "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
- NULL /* WrappedPositionWindow is overwritten */
-};
-
-__GLXextensionInfo __glDDXExtensionInfo = {
- GL_CORE_APPLE,
- glAquaResetExtension,
- glAquaInitVisuals,
- glAquaSetVisualConfigs
-};
-
-
-// prototypes
-
-static GLboolean glAquaDestroyContext(__GLcontext *gc);
-static GLboolean glAquaLoseCurrent(__GLcontext *gc);
-static GLboolean glAquaMakeCurrent(__GLcontext *gc);
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare);
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask);
-static GLboolean glAquaForceCurrent(__GLcontext *gc);
-
-/* Drawing surface notification callbacks */
-static GLboolean glAquaNotifyResize(__GLcontext *gc);
-static void glAquaNotifyDestroy(__GLcontext *gc);
-static void glAquaNotifySwapBuffers(__GLcontext *gc);
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc);
-static void glAquaBeginDispatchOverride(__GLcontext *gc);
-static void glAquaEndDispatchOverride(__GLcontext *gc);
-
-
-static __GLexports glAquaExports = {
- glAquaDestroyContext,
- glAquaLoseCurrent,
- glAquaMakeCurrent,
- glAquaShareContext,
- glAquaCopyContext,
- glAquaForceCurrent,
-
- glAquaNotifyResize,
- glAquaNotifyDestroy,
- glAquaNotifySwapBuffers,
-
- glAquaDispatchExec,
- glAquaBeginDispatchOverride,
- glAquaEndDispatchOverride
-};
-
-
-typedef struct {
- int num_vis;
- __GLXvisualConfig *glx_vis;
- void **priv;
-
- // wrapped screen functions
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
-} glAquaScreenRec;
-
-static glAquaScreenRec glAquaScreens[MAXSCREENS];
-
-
-// __GLdrawablePrivate->private
-typedef struct {
- GLboolean (*resize)(__GLdrawableBuffer *buf, GLint x, GLint y,
- GLuint width, GLuint height,
- __GLdrawablePrivate *glPriv,
- GLuint bufferMask);
-} GLAquaDrawableRec;
-
-struct __GLcontextRec {
- struct __GLinterfaceRec interface; // required to be first
-
- AGLContext ctx;
- AGLPixelFormat pixelFormat;
- Bool isAttached; // TRUE if ctx is really attached to a window
-};
-
-
-// Context manipulation; return GL_FALSE on failure
-static GLboolean glAquaDestroyContext(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", gc->ctx);
-
- if (gc) {
- if (gc->ctx) aglDestroyContext(gc->ctx);
- if (gc->pixelFormat) aglDestroyPixelFormat(gc->pixelFormat);
- free(gc);
- }
- return GL_TRUE;
-}
-
-
-static GLboolean glAquaLoseCurrent(__GLcontext *gc)
-{
- // GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", gc->ctx);
- aglSetCurrentContext(NULL);
- __glXLastContext = NULL; // Mesa does this; why?
- return GL_TRUE;
-}
-
-// (x, y, w, h) is global coordinates of view or -1
-// glPriv may be NULL
-static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv,
- int x, int y, int w, int h)
-{
- __GLXdrawablePrivate *glxPriv;
-
- if (glPriv == NULL) {
- // attaching to nothing
- GLAQUA_DEBUG_MSG("unattaching\n");
- aglSetDrawable(gc->ctx, NULL);
- gc->isAttached = FALSE;
- return;
- }
-
- // Note that when resizing, the X11 WindowPtr already has its
- // new size and position, but the Aqua window does not.
-
- glxPriv = (__GLXdrawablePrivate *)glPriv->other;
-
- if (glxPriv->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) glxPriv->pDraw;
- WindowPtr topWin = quartzProcs->TopLevelParent(pWin);
- CRWindowPtr crWinPtr;
- AGLDrawable newPort;
-
- crWinPtr = (CRWindowPtr) quartzProcs->FrameForWindow(pWin, TRUE);
-
- if (crWinPtr) {
- newPort = (AGLDrawable) crWinPtr->port;
- } else {
- newPort = NULL;
- }
-
- if (newPort) {
- // fixme won't be a CGrafPtr if currently offscreen or fullscreen
- AGLDrawable oldPort = aglGetDrawable(gc->ctx);
- // AGLDrawable newPort = GetWindowPort(window);
- GLint frame[4] = {x, y, w, h}; // fixme multi-screen?
- // frame is now X11-global
- frame[0] -= topWin->drawable.x - topWin->borderWidth;
- frame[1] -= topWin->drawable.y - topWin->borderWidth;
- // frame is now window-local
- // GL uses flipped coordinates
- frame[1] = topWin->drawable.height + 2*topWin->borderWidth -
- frame[1] - frame[3];
-
- // GLAQUA_DEBUG_MSG("local size %d %d %d %d\n",
- // frame[0], frame[1], frame[2], frame[3]);
-
- if (oldPort != newPort) {
- // fixme retain/release windows
- aglSetDrawable(gc->ctx, newPort);
- }
- aglSetInteger(gc->ctx, AGL_BUFFER_RECT, frame);
- aglEnable(gc->ctx, AGL_BUFFER_RECT);
- // aglSetInteger(gc->ctx, AGL_SWAP_RECT, frame);
- // aglEnable(gc->ctx, AGL_SWAP_RECT);
- aglUpdateContext(gc->ctx);
- gc->isAttached = TRUE;
- GLAQUA_DEBUG_MSG("attached\n");
- } else {
- // attach to not-yet-realized window - will really attach later
- GLAQUA_DEBUG_MSG("couldn't attach\n");
- aglSetDrawable(gc->ctx, NULL);
- gc->isAttached = FALSE;
- }
- } else {
- GLAQUA_DEBUG_MSG("attach: attach to non-window unimplemented\n");
- aglSetDrawable(gc->ctx, NULL);
- gc->isAttached = FALSE;
- }
-}
-
-static GLboolean glAquaMakeCurrent(__GLcontext *gc)
-{
-#if 0
- __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
- GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", gc->ctx);
-
- if (!gc->isAttached) {
- attach(gc, glPriv, glPriv->xOrigin, glPriv->yOrigin, glPriv->width, glPriv->height);
- }
-#endif
- return aglSetCurrentContext(gc->ctx);
-}
-
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare)
-{
- GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n");
-
- return GL_TRUE;
-}
-
-
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask)
-{
- GLAQUA_DEBUG_MSG("glAquaCopyContext\n");
- aglCopyContext(src->ctx, dst->ctx, mask);
- return GL_TRUE;
-}
-
-static GLboolean glAquaForceCurrent(__GLcontext *gc)
-{
- // GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", gc->ctx);
- return aglSetCurrentContext(gc->ctx);
-}
-
-/* Drawing surface notification callbacks */
-
-static GLboolean glAquaNotifyResize(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize");
- return GL_TRUE;
-}
-
-static void glAquaNotifyDestroy(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy");
-}
-
-static void glAquaNotifySwapBuffers(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers");
-}
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec");
- return NULL;
-}
-
-static void glAquaBeginDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride");
-}
-
-static void glAquaEndDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride");
-}
-
-
-static AGLPixelFormat makeFormat(__GLcontextModes *mode)
-{
- int i;
- GLint attr[64]; // currently uses max of 30
- AGLPixelFormat result;
-
- GLAQUA_DEBUG_MSG("makeFormat\n");
-
- i = 0;
-
- // attr [i++] = AGL_ACCELERATED; // require hwaccel - BAD for multiscreen
- // attr [i++] = AGL_NO_RECOVERY; // disable fallback renderers - BAD
-
- if (mode->stereoMode) {
- attr[i++] = AGL_STEREO;
- }
- if (mode->doubleBufferMode) {
- attr[i++] = AGL_DOUBLEBUFFER;
- }
-
- if (mode->colorIndexMode) {
- attr[i++] = AGL_BUFFER_SIZE;
- attr[i++] = mode->indexBits;
- }
-
- if (mode->rgbMode) {
- attr[i++] = AGL_RGBA;
- attr[i++] = AGL_RED_SIZE;
- attr[i++] = mode->redBits;
- attr[i++] = AGL_GREEN_SIZE;
- attr[i++] = mode->greenBits;
- attr[i++] = AGL_BLUE_SIZE;
- attr[i++] = mode->blueBits;
- attr[i++] = AGL_ALPHA_SIZE;
- attr[i++] = mode->alphaBits;
- }
-
- if (mode->haveAccumBuffer) {
- attr[i++] = AGL_ACCUM_RED_SIZE;
- attr[i++] = mode->accumRedBits;
- attr[i++] = AGL_ACCUM_GREEN_SIZE;
- attr[i++] = mode->accumGreenBits;
- attr[i++] = AGL_ACCUM_BLUE_SIZE;
- attr[i++] = mode->accumBlueBits;
- attr[i++] = AGL_ACCUM_ALPHA_SIZE;
- attr[i++] = mode->accumAlphaBits;
- }
- if (mode->haveDepthBuffer) {
- attr[i++] = AGL_DEPTH_SIZE;
- attr[i++] = mode->depthBits;
- }
- if (mode->haveStencilBuffer) {
- attr[i++] = AGL_STENCIL_SIZE;
- attr[i++] = mode->stencilBits;
- }
-
- attr[i++] = AGL_AUX_BUFFERS;
- attr[i++] = mode->numAuxBuffers;
-
- attr[i++] = AGL_LEVEL;
- attr[i++] = mode->level;
-
- // mode->pixmapMode ?
-
- attr[i++] = AGL_NONE; // end of option list
-
- GLAQUA_DEBUG_MSG("makeFormat almost done\n");
- result = aglChoosePixelFormat(NULL, 0, attr);
- GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", result);
- return result;
-}
-
-static __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC)
-{
- __GLcontext *result;
- __GLcontext *sharectx = (__GLcontext *)shareGC;
- GLint value;
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext\n");
-
- result = (__GLcontext *)malloc(sizeof(__GLcontext));
- if (!result) return NULL;
-
- result->interface.imports = *imports;
- result->interface.exports = glAquaExports;
-
- result->pixelFormat = makeFormat(mode);
- if (!result->pixelFormat) {
- free(result);
- return NULL;
- }
-
- result->ctx = aglCreateContext(result->pixelFormat,
- (sharectx && sharectx->ctx) ? sharectx->ctx : NULL);
-
- if (!result->ctx) {
- aglDestroyPixelFormat(result->pixelFormat);
- free(result);
- return NULL;
- }
-
- result->isAttached = FALSE;
-
- // Tell aglSwapBuffers to wait for vertical retrace
- value = 1;
- aglSetInteger(result->ctx, AGL_SWAP_INTERVAL, &value);
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
- return (__GLinterface *)result;
-}
-
-
-Bool
-glAquaRealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to reattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n");
-
- // Allow the window to be created (RootlessRealizeWindow is inside our wrap)
- pScreen->RealizeWindow = screenPriv->RealizeWindow;
- result = pScreen->RealizeWindow(pWin);
- pScreen->RealizeWindow = glAquaRealizeWindow;
-
- // The Aqua window will already have been created (windows are
- // realized from top down)
-
- // Re-attach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv, glxPriv->xorigin, glxPriv->yorigin,
- glxPriv->width, glxPriv->height);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv, glxPriv->xorigin, glxPriv->yorigin,
- glxPriv->width, glxPriv->height);
- }
- }
-
- return result;
-}
-
-Bool
-glAquaUnrealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to unattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n");
-
- // The Aqua window may have already been destroyed (windows
- // are unrealized from top down)
-
- // Unattach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, NULL, 0, 0, 0, 0);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, NULL, 0, 0, 0, 0);
- }
- }
-
- pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
- result = pScreen->UnrealizeWindow(pWin);
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return result;
-}
-
-
-
-
-
-
-/*
- * In the case the driver has no GLX visuals we'll use these.
- * [0] = RGB, double buffered
- * [1] = RGB, double buffered, stencil, accum
- */
-// Originally copied from Mesa
-
-static int numConfigs = 0;
-static __GLXvisualConfig *visualConfigs = NULL;
-static void **visualPrivates = NULL;
-
-#define NUM_FALLBACK_CONFIGS 2
-static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
- {
- -1, /* vid */
- -1, /* class */
- True, /* rgba */
- -1, -1, -1, 0, /* rgba sizes */
- -1, -1, -1, 0, /* rgba masks */
- 0, 0, 0, 0, /* rgba accum sizes */
- True, /* doubleBuffer */
- False, /* stereo */
- -1, /* bufferSize */
- 16, /* depthSize */
- 0, /* stencilSize */
- 0, /* auxBuffers */
- 0, /* level */
- GLX_NONE_EXT, /* visualRating */
- 0, /* transparentPixel */
- 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
- 0 /* transparentIndex */
- },
- {
- -1, /* vid */
- -1, /* class */
- True, /* rgba */
- -1, -1, -1, 0, /* rgba sizes */
- -1, -1, -1, 0, /* rgba masks */
- 16, 16, 16, 0, /* rgba accum sizes */
- True, /* doubleBuffer */
- False, /* stereo */
- -1, /* bufferSize */
- 16, /* depthSize */
- 8, /* stencilSize */
- 0, /* auxBuffers */
- 0, /* level */
- GLX_NONE_EXT, /* visualRating */
- 0, /* transparentPixel */
- 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
- 0 /* transparentIndex */
- }
-};
-
-
-
-static int count_bits(unsigned int n)
-{
- int bits = 0;
-
- while (n > 0) {
- if (n & 1) bits++;
- n >>= 1;
- }
- return bits;
-}
-
-
-// Mostly copied from Mesa's xf86glx.c
-static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
- VisualID *defaultVisp,
- int ndepth, DepthPtr pdepth,
- int rootDepth)
-{
- int numRGBconfigs;
- int numCIconfigs;
- int numVisuals = *nvisualp;
- int numNewVisuals;
- int numNewConfigs;
- VisualPtr pVisual = *visualp;
- VisualPtr pVisualNew = NULL;
- VisualID *orig_vid = NULL;
- __GLXvisualConfig *glXVisualPtr = NULL;
- __GLXvisualConfig *pNewVisualConfigs = NULL;
- void **glXVisualPriv;
- void **pNewVisualPriv;
- int found_default;
- int i, j, k;
-
- GLAQUA_DEBUG_MSG("init_visuals\n");
-
- if (numConfigs > 0)
- numNewConfigs = numConfigs;
- else
- numNewConfigs = NUM_FALLBACK_CONFIGS;
-
- /* Alloc space for the list of new GLX visuals */
- pNewVisualConfigs = (__GLXvisualConfig *)
- __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
- if (!pNewVisualConfigs) {
- return FALSE;
- }
-
- /* Alloc space for the list of new GLX visual privates */
- pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
- if (!pNewVisualPriv) {
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /*
- ** If SetVisualConfigs was not called, then use default GLX
- ** visual configs.
- */
- if (numConfigs == 0) {
- memcpy(pNewVisualConfigs, FallbackConfigs,
- NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
- memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
- }
- else {
- /* copy driver's visual config info */
- for (i = 0; i < numConfigs; i++) {
- pNewVisualConfigs[i] = visualConfigs[i];
- pNewVisualPriv[i] = visualPrivates[i];
- }
- }
-
- /* Count the number of RGB and CI visual configs */
- numRGBconfigs = 0;
- numCIconfigs = 0;
- for (i = 0; i < numNewConfigs; i++) {
- if (pNewVisualConfigs[i].rgba)
- numRGBconfigs++;
- else
- numCIconfigs++;
- }
-
- /* Count the total number of visuals to compute */
- numNewVisuals = 0;
- for (i = 0; i < numVisuals; i++) {
- numNewVisuals +=
- (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
- ? numRGBconfigs : numCIconfigs;
- }
-
- /* Reset variables for use with the next screen/driver's visual configs */
- visualConfigs = NULL;
- numConfigs = 0;
-
- /* Alloc temp space for the list of orig VisualIDs for each new visual */
- orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
- if (!orig_vid) {
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the list of glXVisuals */
- glXVisualPtr = (__GLXvisualConfig *)__glXMalloc(numNewVisuals *
- sizeof(__GLXvisualConfig));
- if (!glXVisualPtr) {
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the list of glXVisualPrivates */
- glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
- if (!glXVisualPriv) {
- __glXFree(glXVisualPtr);
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the new list of the X server's visuals */
- pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
- if (!pVisualNew) {
- __glXFree(glXVisualPriv);
- __glXFree(glXVisualPtr);
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Initialize the new visuals */
- found_default = FALSE;
- for (i = j = 0; i < numVisuals; i++) {
- int is_rgb = (pVisual[i].class == TrueColor ||
- pVisual[i].class == DirectColor);
-
- for (k = 0; k < numNewConfigs; k++) {
- if (pNewVisualConfigs[k].rgba != is_rgb)
- continue;
-
- /* Initialize the new visual */
- pVisualNew[j] = pVisual[i];
- pVisualNew[j].vid = FakeClientID(0);
-
- /* Check for the default visual */
- if (!found_default && pVisual[i].vid == *defaultVisp) {
- *defaultVisp = pVisualNew[j].vid;
- found_default = TRUE;
- }
-
- /* Save the old VisualID */
- orig_vid[j] = pVisual[i].vid;
-
- /* Initialize the glXVisual */
- glXVisualPtr[j] = pNewVisualConfigs[k];
- glXVisualPtr[j].vid = pVisualNew[j].vid;
-
- /*
- * If the class is -1, then assume the X visual information
- * is identical to what GLX needs, and take them from the X
- * visual. NOTE: if class != -1, then all other fields MUST
- * be initialized.
- */
- if (glXVisualPtr[j].class == -1) {
- glXVisualPtr[j].class = pVisual[i].class;
- glXVisualPtr[j].redSize = count_bits(pVisual[i].redMask);
- glXVisualPtr[j].greenSize = count_bits(pVisual[i].greenMask);
- glXVisualPtr[j].blueSize = count_bits(pVisual[i].blueMask);
- glXVisualPtr[j].alphaSize = glXVisualPtr[j].alphaSize;
- glXVisualPtr[j].redMask = pVisual[i].redMask;
- glXVisualPtr[j].greenMask = pVisual[i].greenMask;
- glXVisualPtr[j].blueMask = pVisual[i].blueMask;
- glXVisualPtr[j].alphaMask = glXVisualPtr[j].alphaMask;
- glXVisualPtr[j].bufferSize = rootDepth;
- }
-
- /* Save the device-dependent private for this visual */
- glXVisualPriv[j] = pNewVisualPriv[k];
-
- j++;
- }
- }
-
- assert(j <= numNewVisuals);
-
- /* Save the GLX visuals in the screen structure */
- glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
- glAquaScreens[screenInfo.numScreens-1].glx_vis = glXVisualPtr;
- glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
-
- /* Set up depth's VisualIDs */
- for (i = 0; i < ndepth; i++) {
- int numVids = 0;
- VisualID *pVids = NULL;
- int k, n = 0;
-
- /* Count the new number of VisualIDs at this depth */
- for (j = 0; j < pdepth[i].numVids; j++)
- for (k = 0; k < numNewVisuals; k++)
- if (pdepth[i].vids[j] == orig_vid[k])
- numVids++;
-
- /* Allocate a new list of VisualIDs for this depth */
- pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
-
- /* Initialize the new list of VisualIDs for this depth */
- for (j = 0; j < pdepth[i].numVids; j++)
- for (k = 0; k < numNewVisuals; k++)
- if (pdepth[i].vids[j] == orig_vid[k])
- pVids[n++] = pVisualNew[k].vid;
-
- /* Update this depth's list of VisualIDs */
- __glXFree(pdepth[i].vids);
- pdepth[i].vids = pVids;
- pdepth[i].numVids = numVids;
- }
-
- /* Update the X server's visuals */
- *nvisualp = numNewVisuals;
- *visualp = pVisualNew;
-
- /* Free the old list of the X server's visuals */
- __glXFree(pVisual);
-
- /* Clean up temporary allocations */
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
-
- /* Free the private list created by DDX HW driver */
- if (visualPrivates)
- xfree(visualPrivates);
- visualPrivates = NULL;
-
- return TRUE;
-}
-
-// Copied from Mesa
-static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
- void **privates)
-{
- GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n");
-
- numConfigs = nconfigs;
- visualConfigs = configs;
- visualPrivates = privates;
-}
-
-// Copied from Mesa
-static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
- int *nvisualp, int *ndepthp,
- int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB)
-{
- GLAQUA_DEBUG_MSG("glAquaInitVisuals\n");
-
- /*
- * Setup the visuals supported by this particular screen.
- */
- return init_visuals(nvisualp, visualp, defaultVisp,
- *ndepthp, *depthp, *rootDepthp);
-}
-
-
-static void fixup_visuals(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
- glAquaScreenRec *pScr = &glAquaScreens[screen];
- __GLXvisualConfig *pGLXVis = pScr->glx_vis;
- VisualPtr pVis;
- int i, j;
-
- GLAQUA_DEBUG_MSG("fixup_visuals\n");
-
- for (i = 0; i < pScr->num_vis; i++, pGLXVis++) {
- pVis = pScreen->visuals;
-
- /* Find a visual that matches the GLX visual's class and size */
- for (j = 0; j < pScreen->numVisuals; j++, pVis++) {
- if (pVis->class == pGLXVis->class &&
- pVis->nplanes == pGLXVis->bufferSize) {
-
- /* Fixup the masks */
- pGLXVis->redMask = pVis->redMask;
- pGLXVis->greenMask = pVis->greenMask;
- pGLXVis->blueMask = pVis->blueMask;
-
- /* Recalc the sizes */
- pGLXVis->redSize = count_bits(pGLXVis->redMask);
- pGLXVis->greenSize = count_bits(pGLXVis->greenMask);
- pGLXVis->blueSize = count_bits(pGLXVis->blueMask);
- }
- }
- }
-}
-
-static void init_screen_visuals(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
- __GLXvisualConfig *pGLXVis = glAquaScreens[screen].glx_vis;
- // XMesaVisual *pXMesaVisual;
- VisualPtr pVis;
- int *used;
- int i, j;
-
- GLAQUA_DEBUG_MSG("init_screen_visuals\n");
-
- /* Alloc space for the list of XMesa visuals */
- // pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis *
- // sizeof(XMesaVisual));
- // __glXMemset(pXMesaVisual, 0,
- // MESAScreens[screen].num_vis * sizeof(XMesaVisual));
-
- used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
- __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
-
- for (i = 0; i < glAquaScreens[screen].num_vis; i++, pGLXVis++) {
- pVis = pScreen->visuals;
- for (j = 0; j < pScreen->numVisuals; j++, pVis++) {
-
- if (pVis->class == pGLXVis->class &&
- pVis->nplanes == pGLXVis->bufferSize &&
- !used[j]) {
-
- if (pVis->redMask == pGLXVis->redMask &&
- pVis->greenMask == pGLXVis->greenMask &&
- pVis->blueMask == pGLXVis->blueMask) {
-
- /* Create the XMesa visual */
- /*
- pXMesaVisual[i] =
- XMesaCreateVisual(pScreen,
- pVis,
- pGLXVis->rgba,
- (pGLXVis->alphaSize > 0),
- pGLXVis->doubleBuffer,
- pGLXVis->stereo,
- GL_TRUE, // ximage_flag
- pGLXVis->depthSize,
- pGLXVis->stencilSize,
- pGLXVis->accumRedSize,
- pGLXVis->accumGreenSize,
- pGLXVis->accumBlueSize,
- pGLXVis->accumAlphaSize,
- 0, // numSamples
- pGLXVis->level,
- pGLXVis->visualRating );
- */
- /* Set the VisualID */
- pGLXVis->vid = pVis->vid;
-
- /* Mark this visual used */
- used[j] = 1;
- break;
- }
- }
- }
- }
-
- __glXFree(used);
-
- // glAquaScreens[screen].xm_vis = pXMesaVisual;
-}
-
-static Bool glAquaScreenProbe(int screen)
-{
- ScreenPtr pScreen;
- glAquaScreenRec *screenPriv;
-
- GLAQUA_DEBUG_MSG("glAquaScreenProbe\n");
-
- /*
- * Set up the current screen's visuals.
- */
- __glDDXScreenInfo.pGlxVisual = glAquaScreens[screen].glx_vis;
- __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv;
- __glDDXScreenInfo.numVisuals =
- __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis;
-
- /*
- * Set the current screen's createContext routine. This could be
- * wrapped by a DDX GLX context creation routine.
- */
- __glDDXScreenInfo.createContext = glAquaCreateContext;
-
- /*
- * The ordering of the rgb compenents might have been changed by the
- * driver after mi initialized them.
- */
- fixup_visuals(screen);
-
- /*
- * Find the GLX visuals that are supported by this screen and create
- * XMesa's visuals.
- */
- init_screen_visuals(screen);
-
- // Wrap RealizeWindow and UnrealizeWindow on this screen
- pScreen = screenInfo.screens[screen];
- screenPriv = &glAquaScreens[screen];
- screenPriv->RealizeWindow = pScreen->RealizeWindow;
- pScreen->RealizeWindow = glAquaRealizeWindow;
- screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return TRUE;
-}
-
-
-static GLboolean glAquaResizeBuffers(__GLdrawableBuffer *buffer,
- GLint x, GLint y,
- GLuint width, GLuint height,
- __GLdrawablePrivate *glPriv,
- GLuint bufferMask)
-{
- GLAquaDrawableRec *aquaPriv = (GLAquaDrawableRec *)glPriv->private;
- __GLXcontext *gx;
- __GLcontext *gc;
- __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
-
- GLAQUA_DEBUG_MSG("glAquaResizeBuffers to (%d %d %d %d)\n", x, y, width, height);
-
- // update all contexts that point at this drawable for drawing (hack?)
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv, x, y, width, height);
- }
-
- // update all contexts that point at this drawable for reading (hack?)
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv, x, y, width, height);
- }
-
- return aquaPriv->resize(buffer, x, y, width, height, glPriv, bufferMask);
-}
-
-
-static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv)
-{
- // fixme AGL software renderer will use properties of current QD port (bad)
-
- // swap buffers on only *one* of the contexts
- // (e.g. the last one for drawing)
- __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
- if (gc && gc->ctx) aglSwapBuffers(gc->ctx);
-
- return GL_TRUE;
-}
-
-static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
-{
- GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
-
- free(glPriv->private);
- glPriv->private = NULL;
-}
-
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv)
-{
- GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec));
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
-
- GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n");
-
- // replace swapBuffers (original is never called)
- glxPriv->swapBuffers = glAquaSwapBuffers;
-
- // wrap front buffer resize
- aquaPriv->resize = glPriv->frontBuffer.resize;
- glPriv->frontBuffer.resize = glAquaResizeBuffers;
-
- // stash private data
- glPriv->private = aquaPriv;
- glPriv->freePrivate = glAquaDestroyDrawablePrivate;
-}
-
-
-static void glAquaResetExtension(void)
-{
- GLAQUA_DEBUG_MSG("glAquaResetExtension\n");
- aglResetLibrary();
-}
-
-
-
-// Extra goodies for glx
-
-GLint __glEvalComputeK(GLenum target)
-{
- switch (target) {
- case GL_MAP1_VERTEX_4:
- case GL_MAP1_COLOR_4:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_4:
- case GL_MAP2_COLOR_4:
- case GL_MAP2_TEXTURE_COORD_4:
- return 4;
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_NORMAL:
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_NORMAL:
- return 3;
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_2:
- return 2;
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP1_INDEX:
- case GL_MAP2_INDEX:
- return 1;
- default:
- return 0;
- }
-}
-
-GLuint __glFloorLog2(GLuint val)
-{
- int c = 0;
-
- while (val > 1) {
- c++;
- val >>= 1;
- }
- return c;
-}
diff --git a/GL/apple/indirect.c b/GL/apple/indirect.c
deleted file mode 100644
index b1292b606..000000000
--- a/GL/apple/indirect.c
+++ /dev/null
@@ -1,1341 +0,0 @@
-/*
- * GLX implementation that uses Apple's OpenGL.framework
- * (Indirect rendering path)
- */
-/*
- * Copyright (c) 2002 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc.
- *
- * Portions of this file are copied from xf86glx.c,
- * which contains the following copyright:
- *
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/GL/apple/indirect.c,v 1.3 2003/10/13 00:30:54 torrey Exp $ */
-
-#include "dri.h"
-#include "quartz.h"
-
-#include <CoreGraphics/CoreGraphics.h>
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/CGLContext.h>
-
-// X11 and X11's glx
-#include <miscstruct.h>
-#include <windowstr.h>
-#include <resource.h>
-#include <GL/glxint.h>
-#include <GL/glxtokens.h>
-#include <scrnintstr.h>
-#include <glxserver.h>
-#include <glxscreens.h>
-#include <glxdrawable.h>
-#include <glxcontext.h>
-#include <glxext.h>
-#include <glxutil.h>
-#include <glxscreens.h>
-#include <GL/internal/glcore.h>
-#include "x-hash.h"
-#include "x-list.h"
-
-// ggs: needed to call back to glx with visual configs
-extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
-
-
-// Write debugging output, or not
-#ifdef GLAQUA_DEBUG
-#define GLAQUA_DEBUG_MSG ErrorF
-#else
-#define GLAQUA_DEBUG_MSG(a, ...)
-#endif
-
-// The following GL functions don't have an EXT suffix in OpenGL.framework.
-GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) {
- return glAreTexturesResident(a, b, c);
-}
-void glDeleteTexturesEXT(GLsizei d, const GLuint *e) {
- glDeleteTextures(d, e);
-}
-void glGenTexturesEXT(GLsizei f, GLuint *g) {
- glGenTextures(f, g);
-}
-GLboolean glIsTextureEXT(GLuint h) {
- return glIsTexture(h);
-}
-
-// some prototypes
-static Bool glAquaScreenProbe(int screen);
-static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
- int *nvisualp, int *ndepthp,
- int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB);
-static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
- void **privates);
-static __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC);
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv);
-static void glAquaResetExtension(void);
-
-/*
- * This structure is statically allocated in the __glXScreens[]
- * structure. This struct is not used anywhere other than in
- * __glXScreenInit to initialize each of the active screens
- * (__glXActiveScreens[]). Several of the fields must be initialized by
- * the screenProbe routine before they are copied to the active screens
- * struct. In particular, the contextCreate, pGlxVisual, numVisuals,
- * and numUsableVisuals fields must be initialized.
- */
-__GLXscreenInfo __glDDXScreenInfo = {
- glAquaScreenProbe, /* Must be generic and handle all screens */
- glAquaCreateContext, /* Substitute screen's createContext routine */
- glAquaCreateBuffer, /* Substitute screen's createBuffer routine */
- NULL, /* Set up pGlxVisual in probe */
- NULL, /* Set up pVisualPriv in probe */
- 0, /* Set up numVisuals in probe */
- 0, /* Set up numUsableVisuals in probe */
- "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
- "Version String", /* GLXversion is overwritten by __glXScreenInit */
- "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
- NULL /* WrappedPositionWindow is overwritten */
-};
-
-__GLXextensionInfo __glDDXExtensionInfo = {
- GL_CORE_APPLE,
- glAquaResetExtension,
- glAquaInitVisuals,
- glAquaSetVisualConfigs
-};
-
-// prototypes
-
-static GLboolean glAquaDestroyContext(__GLcontext *gc);
-static GLboolean glAquaLoseCurrent(__GLcontext *gc);
-static GLboolean glAquaMakeCurrent(__GLcontext *gc);
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare);
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask);
-static GLboolean glAquaForceCurrent(__GLcontext *gc);
-
-/* Drawing surface notification callbacks */
-static GLboolean glAquaNotifyResize(__GLcontext *gc);
-static void glAquaNotifyDestroy(__GLcontext *gc);
-static void glAquaNotifySwapBuffers(__GLcontext *gc);
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc);
-static void glAquaBeginDispatchOverride(__GLcontext *gc);
-static void glAquaEndDispatchOverride(__GLcontext *gc);
-
-static __GLexports glAquaExports = {
- glAquaDestroyContext,
- glAquaLoseCurrent,
- glAquaMakeCurrent,
- glAquaShareContext,
- glAquaCopyContext,
- glAquaForceCurrent,
-
- glAquaNotifyResize,
- glAquaNotifyDestroy,
- glAquaNotifySwapBuffers,
-
- glAquaDispatchExec,
- glAquaBeginDispatchOverride,
- glAquaEndDispatchOverride
-};
-
-typedef struct {
- int num_vis;
- __GLXvisualConfig *glx_vis;
- void **priv;
-
- // wrapped screen functions
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
-} glAquaScreenRec;
-
-static glAquaScreenRec glAquaScreens[MAXSCREENS];
-
-// __GLdrawablePrivate->private
-typedef struct {
- DrawablePtr pDraw;
- xp_surface_id sid;
-} GLAquaDrawableRec;
-
-struct __GLcontextRec {
- struct __GLinterfaceRec interface; // required to be first
-
- CGLContextObj ctx;
- CGLPixelFormatObj pixelFormat;
-
- /* set when attached */
- xp_surface_id sid;
-
- unsigned isAttached :1;
-};
-
-/* maps from surface id -> list of __GLcontext */
-static x_hash_table *surface_hash;
-
-
-// Context manipulation; return GL_FALSE on failure
-static GLboolean glAquaDestroyContext(__GLcontext *gc)
-{
- x_list *lst;
-
- GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", gc->ctx);
-
- if (gc != NULL)
- {
- if (gc->sid != 0 && surface_hash != NULL)
- {
- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
- lst = x_list_remove(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
- }
-
- if (gc->ctx != NULL)
- CGLDestroyContext(gc->ctx);
-
- if (gc->pixelFormat != NULL)
- CGLDestroyPixelFormat(gc->pixelFormat);
-
- free(gc);
- }
-
- return GL_TRUE;
-}
-
-static GLboolean glAquaLoseCurrent(__GLcontext *gc)
-{
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", gc->ctx);
-
- gl_err = CGLSetCurrentContext(NULL);
- if (gl_err != 0)
- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
-
- __glXLastContext = NULL; // Mesa does this; why?
-
- return GL_TRUE;
-}
-
-/* Called when a surface is destroyed as a side effect of destroying
- the window it's attached to. */
-static void surface_notify(void *_arg, void *data)
-{
- DRISurfaceNotifyArg *arg = _arg;
- GLAquaDrawableRec *aquaPriv = data;
- __GLcontext *gc;
- x_list *lst;
-
- switch (arg->kind)
- {
- case AppleDRISurfaceNotifyDestroyed:
- if (surface_hash != NULL)
- x_hash_table_remove(surface_hash, (void *) arg->id);
-
- aquaPriv->pDraw = NULL;
- aquaPriv->sid = 0;
- break;
-
- case AppleDRISurfaceNotifyChanged:
- if (surface_hash != NULL)
- {
- lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL);
- for (; lst != NULL; lst = lst->next)
- {
- gc = lst->data;
- xp_update_gl_context(gc->ctx);
- }
- }
- break;
- }
-}
-
-static void unattach(__GLcontext *gc)
-{
- x_list *lst;
-
- if (gc->isAttached)
- {
- GLAQUA_DEBUG_MSG("unattaching\n");
-
- if (surface_hash != NULL)
- {
- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
- lst = x_list_remove(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
- }
-
- CGLClearDrawable(gc->ctx);
- gc->isAttached = FALSE;
- gc->sid = 0;
- }
-}
-
-static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv)
-{
- __GLXdrawablePrivate *glxPriv;
-
- glxPriv = (__GLXdrawablePrivate *)glPriv->other;
-
- if (glxPriv->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) glxPriv->pDraw;
- GLAquaDrawableRec *aquaPriv = (GLAquaDrawableRec *)glPriv->private;
- x_list *lst;
-
- if (aquaPriv->sid == 0)
- {
- if (!quartzProcs->CreateSurface(pWin->drawable.pScreen,
- pWin->drawable.id, &pWin->drawable,
- 0, &aquaPriv->sid, NULL,
- surface_notify, aquaPriv))
- {
- return;
- }
- aquaPriv->pDraw = &pWin->drawable;
- }
-
- if (!gc->isAttached || gc->sid != aquaPriv->sid)
- {
- if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success)
- {
- quartzProcs->DestroySurface(pWin->drawable.pScreen,
- pWin->drawable.id, &pWin->drawable,
- surface_notify, aquaPriv);
-
- if (surface_hash != NULL)
- x_hash_table_remove(surface_hash, (void *) aquaPriv->sid);
-
- aquaPriv->sid = 0;
- return;
- }
-
- gc->isAttached = TRUE;
- gc->sid = aquaPriv->sid;
-
- if (surface_hash == NULL)
- surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
-
- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
- if (x_list_find(lst, gc) == NULL)
- {
- lst = x_list_prepend(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
- }
-
- GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", pWin->drawable.id,
- aquaPriv->sid);
- }
- } else {
- GLAQUA_DEBUG_MSG("attach: attach to non-window unimplemented\n");
- CGLClearDrawable(gc->ctx);
- gc->isAttached = FALSE;
- }
-}
-
-static GLboolean glAquaMakeCurrent(__GLcontext *gc)
-{
- __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", gc->ctx);
-
- attach(gc, glPriv);
-
- gl_err = CGLSetCurrentContext(gc->ctx);
- if (gl_err != 0)
- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
-
- return gl_err == 0;
-}
-
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare)
-{
- GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n");
-
- return GL_TRUE;
-}
-
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask)
-{
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaCopyContext\n");
-
- gl_err = CGLCopyContext(src->ctx, dst->ctx, mask);
- if (gl_err != 0)
- ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err));
-
- return gl_err == 0;
-}
-
-static GLboolean glAquaForceCurrent(__GLcontext *gc)
-{
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", gc->ctx);
-
- gl_err = CGLSetCurrentContext(gc->ctx);
- if (gl_err != 0)
- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
-
- return gl_err == 0;
-}
-
-/* Drawing surface notification callbacks */
-
-static GLboolean glAquaNotifyResize(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize");
- return GL_TRUE;
-}
-
-static void glAquaNotifyDestroy(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy");
-}
-
-static void glAquaNotifySwapBuffers(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers");
-}
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec");
- return NULL;
-}
-
-static void glAquaBeginDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride");
-}
-
-static void glAquaEndDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride");
-}
-
-static CGLPixelFormatObj makeFormat(__GLcontextModes *mode)
-{
- int i;
- CGLPixelFormatAttribute attr[64]; // currently uses max of 30
- CGLPixelFormatObj result;
- long n_formats;
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("makeFormat\n");
-
- if (!mode->rgbMode)
- return NULL;
-
- i = 0;
-
- // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen
- // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD
-
- if (mode->stereoMode) {
- attr[i++] = kCGLPFAStereo;
- }
- if (mode->doubleBufferMode) {
- attr[i++] = kCGLPFADoubleBuffer;
- }
-
- if (mode->colorIndexMode) {
- /* ignored */
- }
-
- if (mode->rgbMode) {
- attr[i++] = kCGLPFAColorSize;
- attr[i++] = mode->redBits + mode->greenBits + mode->blueBits;
- attr[i++] = kCGLPFAAlphaSize;
- attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */
- }
-
- if (mode->haveAccumBuffer) {
- attr[i++] = kCGLPFAAccumSize;
- attr[i++] = mode->accumRedBits + mode->accumGreenBits
- + mode->accumBlueBits + mode->accumAlphaBits;
- }
- if (mode->haveDepthBuffer) {
- attr[i++] = kCGLPFADepthSize;
- attr[i++] = mode->depthBits;
- }
- if (mode->haveStencilBuffer) {
- attr[i++] = kCGLPFAStencilSize;
- attr[i++] = mode->stencilBits;
- }
-
- attr[i++] = kCGLPFAAuxBuffers;
- attr[i++] = mode->numAuxBuffers;
-
- /* mode->level ignored */
-
- /* mode->pixmapMode ? */
-
- attr[i++] = 0;
-
- GLAQUA_DEBUG_MSG("makeFormat almost done\n");
-
- result = NULL;
- gl_err = CGLChoosePixelFormat(attr, &result, &n_formats);
- if (gl_err != 0)
- ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err));
-
- GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", result);
-
- return result;
-}
-
-static __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC)
-{
- __GLcontext *result;
- __GLcontext *sharectx = (__GLcontext *)shareGC;
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext\n");
-
- result = (__GLcontext *)calloc(1, sizeof(__GLcontext));
- if (!result) return NULL;
-
- result->interface.imports = *imports;
- result->interface.exports = glAquaExports;
-
- result->pixelFormat = makeFormat(mode);
- if (!result->pixelFormat) {
- free(result);
- return NULL;
- }
-
- result->ctx = NULL;
- gl_err = CGLCreateContext(result->pixelFormat,
- sharectx ? sharectx->ctx : NULL,
- &result->ctx);
-
- if (gl_err != 0) {
- ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err));
- CGLDestroyPixelFormat(result->pixelFormat);
- free(result);
- return NULL;
- }
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
- return (__GLinterface *)result;
-}
-
-Bool
-glAquaRealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to reattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n");
-
- // Allow the window to be created (RootlessRealizeWindow is inside our wrap)
- pScreen->RealizeWindow = screenPriv->RealizeWindow;
- result = pScreen->RealizeWindow(pWin);
- pScreen->RealizeWindow = glAquaRealizeWindow;
-
- // The Aqua window will already have been created (windows are
- // realized from top down)
-
- // Re-attach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv);
- }
- }
-
- return result;
-}
-
-Bool
-glAquaUnrealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to unattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n");
-
- // The Aqua window may have already been destroyed (windows
- // are unrealized from top down)
-
- // Unattach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- unattach(gc);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- unattach(gc);
- }
- }
-
- pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
- result = pScreen->UnrealizeWindow(pWin);
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return result;
-}
-
-/*
- * In the case the driver has no GLX visuals we'll use these.
- * [0] = RGB, double buffered
- * [1] = RGB, double buffered, stencil, accum
- */
-// Originally copied from Mesa
-
-static int numConfigs = 0;
-static __GLXvisualConfig *visualConfigs = NULL;
-static void **visualPrivates = NULL;
-
-#define NUM_FALLBACK_CONFIGS 2
-static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
- {
- -1, /* vid */
- -1, /* class */
- True, /* rgba */
- -1, -1, -1, 0, /* rgba sizes */
- -1, -1, -1, 0, /* rgba masks */
- 0, 0, 0, 0, /* rgba accum sizes */
- True, /* doubleBuffer */
- False, /* stereo */
- -1, /* bufferSize */
- 16, /* depthSize */
- 0, /* stencilSize */
- 0, /* auxBuffers */
- 0, /* level */
- GLX_NONE_EXT, /* visualRating */
- 0, /* transparentPixel */
- 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
- 0 /* transparentIndex */
- },
- {
- -1, /* vid */
- -1, /* class */
- True, /* rgba */
- -1, -1, -1, 0, /* rgba sizes */
- -1, -1, -1, 0, /* rgba masks */
- 16, 16, 16, 0, /* rgba accum sizes */
- True, /* doubleBuffer */
- False, /* stereo */
- -1, /* bufferSize */
- 16, /* depthSize */
- 8, /* stencilSize */
- 0, /* auxBuffers */
- 0, /* level */
- GLX_NONE_EXT, /* visualRating */
- 0, /* transparentPixel */
- 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
- 0 /* transparentIndex */
- }
-};
-
-static __GLXvisualConfig NullConfig = {
- -1, /* vid */
- -1, /* class */
- False, /* rgba */
- -1, -1, -1, 0, /* rgba sizes */
- -1, -1, -1, 0, /* rgba masks */
- 0, 0, 0, 0, /* rgba accum sizes */
- False, /* doubleBuffer */
- False, /* stereo */
- -1, /* bufferSize */
- 16, /* depthSize */
- 0, /* stencilSize */
- 0, /* auxBuffers */
- 0, /* level */
- GLX_NONE_EXT, /* visualRating */
- 0, /* transparentPixel */
- 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
- 0 /* transparentIndex */
-};
-
-static inline int count_bits(uint32_t x)
-{
- x = x - ((x >> 1) & 0x55555555);
- x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
- x = (x + (x >> 4)) & 0x0f0f0f0f;
- x = x + (x >> 8);
- x = x + (x >> 16);
- return x & 63;
-}
-
-// Mostly copied from Mesa's xf86glx.c
-static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
- VisualID *defaultVisp,
- int ndepth, DepthPtr pdepth,
- int rootDepth)
-{
- int numRGBconfigs;
- int numCIconfigs;
- int numVisuals = *nvisualp;
- int numNewVisuals;
- int numNewConfigs;
- VisualPtr pVisual = *visualp;
- VisualPtr pVisualNew = NULL;
- VisualID *orig_vid = NULL;
- __GLXvisualConfig *glXVisualPtr = NULL;
- __GLXvisualConfig *pNewVisualConfigs = NULL;
- void **glXVisualPriv;
- void **pNewVisualPriv;
- int found_default;
- int i, j, k;
-
- GLAQUA_DEBUG_MSG("init_visuals\n");
-
- if (numConfigs > 0)
- numNewConfigs = numConfigs;
- else
- numNewConfigs = NUM_FALLBACK_CONFIGS;
-
- /* Alloc space for the list of new GLX visuals */
- pNewVisualConfigs = (__GLXvisualConfig *)
- __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
- if (!pNewVisualConfigs) {
- return FALSE;
- }
-
- /* Alloc space for the list of new GLX visual privates */
- pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
- if (!pNewVisualPriv) {
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /*
- ** If SetVisualConfigs was not called, then use default GLX
- ** visual configs.
- */
- if (numConfigs == 0) {
- memcpy(pNewVisualConfigs, FallbackConfigs,
- NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
- memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
- }
- else {
- /* copy driver's visual config info */
- for (i = 0; i < numConfigs; i++) {
- pNewVisualConfigs[i] = visualConfigs[i];
- pNewVisualPriv[i] = visualPrivates[i];
- }
- }
-
- /* Count the number of RGB and CI visual configs */
- numRGBconfigs = 0;
- numCIconfigs = 0;
- for (i = 0; i < numNewConfigs; i++) {
- if (pNewVisualConfigs[i].rgba)
- numRGBconfigs++;
- else
- numCIconfigs++;
- }
-
- /* Count the total number of visuals to compute */
- numNewVisuals = 0;
- for (i = 0; i < numVisuals; i++) {
- int count;
-
- count = ((pVisual[i].class == TrueColor
- || pVisual[i].class == DirectColor)
- ? numRGBconfigs : numCIconfigs);
- if (count == 0)
- count = 1; /* preserve the existing visual */
-
- numNewVisuals += count;
- }
-
- /* Reset variables for use with the next screen/driver's visual configs */
- visualConfigs = NULL;
- numConfigs = 0;
-
- /* Alloc temp space for the list of orig VisualIDs for each new visual */
- orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
- if (!orig_vid) {
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the list of glXVisuals */
- glXVisualPtr = (__GLXvisualConfig *)__glXMalloc(numNewVisuals *
- sizeof(__GLXvisualConfig));
- if (!glXVisualPtr) {
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the list of glXVisualPrivates */
- glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
- if (!glXVisualPriv) {
- __glXFree(glXVisualPtr);
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Alloc space for the new list of the X server's visuals */
- pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
- if (!pVisualNew) {
- __glXFree(glXVisualPriv);
- __glXFree(glXVisualPtr);
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
- return FALSE;
- }
-
- /* Initialize the new visuals */
- found_default = FALSE;
- for (i = j = 0; i < numVisuals; i++) {
- int is_rgb = (pVisual[i].class == TrueColor ||
- pVisual[i].class == DirectColor);
-
- if (!is_rgb)
- {
- /* We don't support non-rgb visuals for GL. But we don't
- want to remove them either, so just pass them through
- with null glX configs */
-
- pVisualNew[j] = pVisual[i];
- pVisualNew[j].vid = FakeClientID(0);
-
- /* Check for the default visual */
- if (!found_default && pVisual[i].vid == *defaultVisp) {
- *defaultVisp = pVisualNew[j].vid;
- found_default = TRUE;
- }
-
- /* Save the old VisualID */
- orig_vid[j] = pVisual[i].vid;
-
- /* Initialize the glXVisual */
- glXVisualPtr[j] = NullConfig;
- glXVisualPriv[j] = NULL;
-
- j++;
-
- continue;
- }
-
- for (k = 0; k < numNewConfigs; k++) {
- if (pNewVisualConfigs[k].rgba != is_rgb)
- continue;
-
- /* Initialize the new visual */
- pVisualNew[j] = pVisual[i];
- pVisualNew[j].vid = FakeClientID(0);
-
- /* Check for the default visual */
- if (!found_default && pVisual[i].vid == *defaultVisp) {
- *defaultVisp = pVisualNew[j].vid;
- found_default = TRUE;
- }
-
- /* Save the old VisualID */
- orig_vid[j] = pVisual[i].vid;
-
- /* Initialize the glXVisual */
- glXVisualPtr[j] = pNewVisualConfigs[k];
- glXVisualPtr[j].vid = pVisualNew[j].vid;
-
- /*
- * If the class is -1, then assume the X visual information
- * is identical to what GLX needs, and take them from the X
- * visual. NOTE: if class != -1, then all other fields MUST
- * be initialized.
- */
- if (glXVisualPtr[j].class == -1) {
- glXVisualPtr[j].class = pVisual[i].class;
- glXVisualPtr[j].redSize = count_bits(pVisual[i].redMask);
- glXVisualPtr[j].greenSize = count_bits(pVisual[i].greenMask);
- glXVisualPtr[j].blueSize = count_bits(pVisual[i].blueMask);
- glXVisualPtr[j].alphaSize = glXVisualPtr[j].alphaSize;
- glXVisualPtr[j].redMask = pVisual[i].redMask;
- glXVisualPtr[j].greenMask = pVisual[i].greenMask;
- glXVisualPtr[j].blueMask = pVisual[i].blueMask;
- glXVisualPtr[j].alphaMask = glXVisualPtr[j].alphaMask;
- glXVisualPtr[j].bufferSize = rootDepth;
- }
-
- /* Save the device-dependent private for this visual */
- glXVisualPriv[j] = pNewVisualPriv[k];
-
- j++;
- }
- }
-
- assert(j <= numNewVisuals);
-
- /* Save the GLX visuals in the screen structure */
- glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
- glAquaScreens[screenInfo.numScreens-1].glx_vis = glXVisualPtr;
- glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
-
- /* Set up depth's VisualIDs */
- for (i = 0; i < ndepth; i++) {
- int numVids = 0;
- VisualID *pVids = NULL;
- int k, n = 0;
-
- /* Count the new number of VisualIDs at this depth */
- for (j = 0; j < pdepth[i].numVids; j++)
- for (k = 0; k < numNewVisuals; k++)
- if (pdepth[i].vids[j] == orig_vid[k])
- numVids++;
-
- /* Allocate a new list of VisualIDs for this depth */
- pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
-
- /* Initialize the new list of VisualIDs for this depth */
- for (j = 0; j < pdepth[i].numVids; j++)
- for (k = 0; k < numNewVisuals; k++)
- if (pdepth[i].vids[j] == orig_vid[k])
- pVids[n++] = pVisualNew[k].vid;
-
- /* Update this depth's list of VisualIDs */
- __glXFree(pdepth[i].vids);
- pdepth[i].vids = pVids;
- pdepth[i].numVids = numVids;
- }
-
- /* Update the X server's visuals */
- *nvisualp = numNewVisuals;
- *visualp = pVisualNew;
-
- /* Free the old list of the X server's visuals */
- __glXFree(pVisual);
-
- /* Clean up temporary allocations */
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
-
- /* Free the private list created by DDX HW driver */
- if (visualPrivates)
- xfree(visualPrivates);
- visualPrivates = NULL;
-
- return TRUE;
-}
-
-/* based on code in i830_dri.c
- This ends calling glAquaSetVisualConfigs to set the static
- numconfigs, etc. */
-static void
-glAquaInitVisualConfigs(void)
-{
- int lclNumConfigs = 0;
- __GLXvisualConfig *lclVisualConfigs = NULL;
- void **lclVisualPrivates = NULL;
-
- int depth, aux, buffers, stencil, accum;
- int i = 0;
-
- GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs ");
-
- /* count num configs:
- 2 Z buffer (0, 24 bit)
- 2 AUX buffer (0, 2)
- 2 buffers (single, double)
- 2 stencil (0, 8 bit)
- 2 accum (0, 64 bit)
- = 32 configs */
-
- lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
-
- /* alloc */
- lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs);
- lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs);
-
- /* fill in configs */
- if (NULL != lclVisualConfigs) {
- i = 0; /* current buffer */
- for (depth = 0; depth < 2; depth++) {
- for (aux = 0; aux < 2; aux++) {
- for (buffers = 0; buffers < 2; buffers++) {
- for (stencil = 0; stencil < 2; stencil++) {
- for (accum = 0; accum < 2; accum++) {
- lclVisualConfigs[i].vid = -1;
- lclVisualConfigs[i].class = -1;
- lclVisualConfigs[i].rgba = TRUE;
- lclVisualConfigs[i].redSize = -1;
- lclVisualConfigs[i].greenSize = -1;
- lclVisualConfigs[i].blueSize = -1;
- lclVisualConfigs[i].redMask = -1;
- lclVisualConfigs[i].greenMask = -1;
- lclVisualConfigs[i].blueMask = -1;
- lclVisualConfigs[i].alphaMask = 0;
- if (accum) {
- lclVisualConfigs[i].accumRedSize = 16;
- lclVisualConfigs[i].accumGreenSize = 16;
- lclVisualConfigs[i].accumBlueSize = 16;
- lclVisualConfigs[i].accumAlphaSize = 16;
- }
- else {
- lclVisualConfigs[i].accumRedSize = 0;
- lclVisualConfigs[i].accumGreenSize = 0;
- lclVisualConfigs[i].accumBlueSize = 0;
- lclVisualConfigs[i].accumAlphaSize = 0;
- }
- lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
- lclVisualConfigs[i].stereo = FALSE;
- lclVisualConfigs[i].bufferSize = -1;
-
- lclVisualConfigs[i].depthSize = depth? 24 : 0;
- lclVisualConfigs[i].stencilSize = stencil ? 8 : 0;
- lclVisualConfigs[i].auxBuffers = aux ? 2 : 0;
- lclVisualConfigs[i].level = 0;
- lclVisualConfigs[i].visualRating = GLX_NONE_EXT;
- lclVisualConfigs[i].transparentPixel = 0;
- lclVisualConfigs[i].transparentRed = 0;
- lclVisualConfigs[i].transparentGreen = 0;
- lclVisualConfigs[i].transparentBlue = 0;
- lclVisualConfigs[i].transparentAlpha = 0;
- lclVisualConfigs[i].transparentIndex = 0;
- i++;
- }
- }
- }
- }
- }
- }
- if (i != lclNumConfigs)
- GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs");
-
- GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
-}
-
-
-// Copied from Mesa
-static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
- void **privates)
-{
- GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n");
-
- numConfigs = nconfigs;
- visualConfigs = configs;
- visualPrivates = privates;
-}
-
-// Copied from Mesa
-static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
- int *nvisualp, int *ndepthp,
- int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB)
-{
- GLAQUA_DEBUG_MSG("glAquaInitVisuals\n");
-
- if (0 == numConfigs) /* if no configs */
- glAquaInitVisualConfigs(); /* ensure the visula configs are setup */
-
- /*
- * Setup the visuals supported by this particular screen.
- */
- return init_visuals(nvisualp, visualp, defaultVisp,
- *ndepthp, *depthp, *rootDepthp);
-}
-
-static void fixup_visuals(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
- glAquaScreenRec *pScr = &glAquaScreens[screen];
- __GLXvisualConfig *pGLXVis = pScr->glx_vis;
- VisualPtr pVis;
- int i, j;
-
- GLAQUA_DEBUG_MSG("fixup_visuals\n");
-
- for (i = 0; i < pScr->num_vis; i++, pGLXVis++) {
- pVis = pScreen->visuals;
-
- /* Find a visual that matches the GLX visual's class and size */
- for (j = 0; j < pScreen->numVisuals; j++, pVis++) {
- if (pVis->class == pGLXVis->class &&
- pVis->nplanes == pGLXVis->bufferSize) {
-
- /* Fixup the masks */
- pGLXVis->redMask = pVis->redMask;
- pGLXVis->greenMask = pVis->greenMask;
- pGLXVis->blueMask = pVis->blueMask;
-
- /* Recalc the sizes */
- pGLXVis->redSize = count_bits(pGLXVis->redMask);
- pGLXVis->greenSize = count_bits(pGLXVis->greenMask);
- pGLXVis->blueSize = count_bits(pGLXVis->blueMask);
- }
- }
- }
-}
-
-static void init_screen_visuals(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
- __GLXvisualConfig *pGLXVis = glAquaScreens[screen].glx_vis;
- // XMesaVisual *pXMesaVisual;
- VisualPtr pVis;
- int *used;
- int i, j;
-
- GLAQUA_DEBUG_MSG("init_screen_visuals\n");
-
- /* Alloc space for the list of XMesa visuals */
- // pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis *
- // sizeof(XMesaVisual));
- // __glXMemset(pXMesaVisual, 0,
- // MESAScreens[screen].num_vis * sizeof(XMesaVisual));
-
- used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
- __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
-
- for (i = 0; i < glAquaScreens[screen].num_vis; i++, pGLXVis++) {
- pVis = pScreen->visuals;
- for (j = 0; j < pScreen->numVisuals; j++, pVis++) {
-
- if (pVis->class == pGLXVis->class &&
- pVis->nplanes == pGLXVis->bufferSize &&
- !used[j]) {
-
- if (pVis->redMask == pGLXVis->redMask &&
- pVis->greenMask == pGLXVis->greenMask &&
- pVis->blueMask == pGLXVis->blueMask) {
-
- /* Create the XMesa visual */
- /*
- pXMesaVisual[i] =
- XMesaCreateVisual(pScreen,
- pVis,
- pGLXVis->rgba,
- (pGLXVis->alphaSize > 0),
- pGLXVis->doubleBuffer,
- pGLXVis->stereo,
- GL_TRUE, // ximage_flag
- pGLXVis->depthSize,
- pGLXVis->stencilSize,
- pGLXVis->accumRedSize,
- pGLXVis->accumGreenSize,
- pGLXVis->accumBlueSize,
- pGLXVis->accumAlphaSize,
- 0, // numSamples
- pGLXVis->level,
- pGLXVis->visualRating );
- */
- /* Set the VisualID */
- pGLXVis->vid = pVis->vid;
-
- /* Mark this visual used */
- used[j] = 1;
- break;
- }
- }
- }
- }
-
- __glXFree(used);
-
- // glAquaScreens[screen].xm_vis = pXMesaVisual;
-}
-
-static Bool glAquaScreenProbe(int screen)
-{
- ScreenPtr pScreen;
- glAquaScreenRec *screenPriv;
-
- GLAQUA_DEBUG_MSG("glAquaScreenProbe\n");
-
- /*
- * Set up the current screen's visuals.
- */
- __glDDXScreenInfo.pGlxVisual = glAquaScreens[screen].glx_vis;
- __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv;
- __glDDXScreenInfo.numVisuals =
- __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis;
-
- /*
- * Set the current screen's createContext routine. This could be
- * wrapped by a DDX GLX context creation routine.
- */
- __glDDXScreenInfo.createContext = glAquaCreateContext;
-
- /*
- * The ordering of the rgb compenents might have been changed by the
- * driver after mi initialized them.
- */
- fixup_visuals(screen);
-
- /*
- * Find the GLX visuals that are supported by this screen and create
- * XMesa's visuals.
- */
- init_screen_visuals(screen);
-
- // Wrap RealizeWindow and UnrealizeWindow on this screen
- pScreen = screenInfo.screens[screen];
- screenPriv = &glAquaScreens[screen];
- screenPriv->RealizeWindow = pScreen->RealizeWindow;
- pScreen->RealizeWindow = glAquaRealizeWindow;
- screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return TRUE;
-}
-
-static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv)
-{
- // swap buffers on only *one* of the contexts
- // (e.g. the last one for drawing)
- __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n");
-
- if (gc != NULL && gc->ctx != NULL)
- {
- gl_err = CGLFlushDrawable(gc->ctx);
- if (gl_err != 0)
- ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err));
- }
-
- return GL_TRUE;
-}
-
-static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
-{
- GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
-
- /* It doesn't work to call DRIDestroySurface here, the drawable's
- already gone.. But dri.c notices the window destruction and
- frees the surface itself. */
-
- free(glPriv->private);
- glPriv->private = NULL;
-}
-
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv)
-{
- GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec));
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
-
- aquaPriv->sid = 0;
- aquaPriv->pDraw = NULL;
-
- GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n");
-
- // replace swapBuffers (original is never called)
- glxPriv->swapBuffers = glAquaSwapBuffers;
-
- // stash private data
- glPriv->private = aquaPriv;
- glPriv->freePrivate = glAquaDestroyDrawablePrivate;
-}
-
-static void glAquaResetExtension(void)
-{
- GLAQUA_DEBUG_MSG("glAquaResetExtension\n");
- CGLSetOption(kCGLGOResetLibrary, GL_TRUE);
-}
-
-// Extra goodies for glx
-
-GLint __glEvalComputeK(GLenum target)
-{
- switch (target) {
- case GL_MAP1_VERTEX_4:
- case GL_MAP1_COLOR_4:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_4:
- case GL_MAP2_COLOR_4:
- case GL_MAP2_TEXTURE_COORD_4:
- return 4;
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_NORMAL:
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_NORMAL:
- return 3;
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_2:
- return 2;
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP1_INDEX:
- case GL_MAP2_INDEX:
- return 1;
- default:
- return 0;
- }
-}
-
-GLuint __glFloorLog2(GLuint val)
-{
- int c = 0;
-
- while (val > 1) {
- c++;
- val >>= 1;
- }
- return c;
-}
diff --git a/GL/glx/g_disptab.c b/GL/glx/g_disptab.c
deleted file mode 100644
index da05fe290..000000000
--- a/GL/glx/g_disptab.c
+++ /dev/null
@@ -1,827 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.4 2003/09/28 20:15:41 alanh Exp $ */
-/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab.h"
-__GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
- __glXNoSuchSingleOpcode,
- __glXRender,
- __glXRenderLarge,
- __glXCreateContext,
- __glXDestroyContext,
- __glXMakeCurrent,
- __glXIsDirect,
- __glXQueryVersion,
- __glXWaitGL,
- __glXWaitX,
- __glXCopyContext,
- __glXSwapBuffers,
- __glXUseXFont,
- __glXCreateGLXPixmap,
- __glXGetVisualConfigs,
- __glXDestroyGLXPixmap,
- __glXVendorPrivate,
- __glXVendorPrivateWithReply,
- __glXQueryExtensionsString,
- __glXQueryServerString,
- __glXClientInfo,
- __glXNoSuchSingleOpcode, /* glXGetFBConfigs */
- __glXNoSuchSingleOpcode, /* glXCreatePixmap */
- __glXNoSuchSingleOpcode, /* glXDestroyPixmap */
- __glXNoSuchSingleOpcode, /* glXCreateNewContext */
- __glXNoSuchSingleOpcode, /* glXQueryContext */
- __glXMakeContextCurrent,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXDisp_NewList,
- __glXDisp_EndList,
- __glXDisp_DeleteLists,
- __glXDisp_GenLists,
- __glXDisp_FeedbackBuffer,
- __glXDisp_SelectBuffer,
- __glXDisp_RenderMode,
- __glXDisp_Finish,
- __glXDisp_PixelStoref,
- __glXDisp_PixelStorei,
- __glXDisp_ReadPixels,
- __glXDisp_GetBooleanv,
- __glXDisp_GetClipPlane,
- __glXDisp_GetDoublev,
- __glXDisp_GetError,
- __glXDisp_GetFloatv,
- __glXDisp_GetIntegerv,
- __glXDisp_GetLightfv,
- __glXDisp_GetLightiv,
- __glXDisp_GetMapdv,
- __glXDisp_GetMapfv,
- __glXDisp_GetMapiv,
- __glXDisp_GetMaterialfv,
- __glXDisp_GetMaterialiv,
- __glXDisp_GetPixelMapfv,
- __glXDisp_GetPixelMapuiv,
- __glXDisp_GetPixelMapusv,
- __glXDisp_GetPolygonStipple,
- __glXDisp_GetString,
- __glXDisp_GetTexEnvfv,
- __glXDisp_GetTexEnviv,
- __glXDisp_GetTexGendv,
- __glXDisp_GetTexGenfv,
- __glXDisp_GetTexGeniv,
- __glXDisp_GetTexImage,
- __glXDisp_GetTexParameterfv,
- __glXDisp_GetTexParameteriv,
- __glXDisp_GetTexLevelParameterfv,
- __glXDisp_GetTexLevelParameteriv,
- __glXDisp_IsEnabled,
- __glXDisp_IsList,
- __glXDisp_Flush,
- __glXDisp_AreTexturesResident,
- __glXDisp_DeleteTextures,
- __glXDisp_GenTextures,
- __glXDisp_IsTexture,
- __glXDisp_GetColorTable,
- __glXDisp_GetColorTableParameterfv,
- __glXDisp_GetColorTableParameteriv,
- __glXDisp_GetConvolutionFilter,
- __glXDisp_GetConvolutionParameterfv,
- __glXDisp_GetConvolutionParameteriv,
- __glXDisp_GetSeparableFilter,
- __glXDisp_GetHistogram,
- __glXDisp_GetHistogramParameterfv,
- __glXDisp_GetHistogramParameteriv,
- __glXDisp_GetMinmax,
- __glXDisp_GetMinmaxParameterfv,
- __glXDisp_GetMinmaxParameteriv,
-};
-
-__GLXdispatchRenderProcPtr __glXRenderTable[] = {
- __glXNoSuchRenderOpcode,
- __glXDisp_CallList,
- __glXDisp_CallLists,
- __glXDisp_ListBase,
- __glXDisp_Begin,
- __glXDisp_Bitmap,
- __glXDisp_Color3bv,
- __glXDisp_Color3dv,
- __glXDisp_Color3fv,
- __glXDisp_Color3iv,
- __glXDisp_Color3sv,
- __glXDisp_Color3ubv,
- __glXDisp_Color3uiv,
- __glXDisp_Color3usv,
- __glXDisp_Color4bv,
- __glXDisp_Color4dv,
- __glXDisp_Color4fv,
- __glXDisp_Color4iv,
- __glXDisp_Color4sv,
- __glXDisp_Color4ubv,
- __glXDisp_Color4uiv,
- __glXDisp_Color4usv,
- __glXDisp_EdgeFlagv,
- __glXDisp_End,
- __glXDisp_Indexdv,
- __glXDisp_Indexfv,
- __glXDisp_Indexiv,
- __glXDisp_Indexsv,
- __glXDisp_Normal3bv,
- __glXDisp_Normal3dv,
- __glXDisp_Normal3fv,
- __glXDisp_Normal3iv,
- __glXDisp_Normal3sv,
- __glXDisp_RasterPos2dv,
- __glXDisp_RasterPos2fv,
- __glXDisp_RasterPos2iv,
- __glXDisp_RasterPos2sv,
- __glXDisp_RasterPos3dv,
- __glXDisp_RasterPos3fv,
- __glXDisp_RasterPos3iv,
- __glXDisp_RasterPos3sv,
- __glXDisp_RasterPos4dv,
- __glXDisp_RasterPos4fv,
- __glXDisp_RasterPos4iv,
- __glXDisp_RasterPos4sv,
- __glXDisp_Rectdv,
- __glXDisp_Rectfv,
- __glXDisp_Rectiv,
- __glXDisp_Rectsv,
- __glXDisp_TexCoord1dv,
- __glXDisp_TexCoord1fv,
- __glXDisp_TexCoord1iv,
- __glXDisp_TexCoord1sv,
- __glXDisp_TexCoord2dv,
- __glXDisp_TexCoord2fv,
- __glXDisp_TexCoord2iv,
- __glXDisp_TexCoord2sv,
- __glXDisp_TexCoord3dv,
- __glXDisp_TexCoord3fv,
- __glXDisp_TexCoord3iv,
- __glXDisp_TexCoord3sv,
- __glXDisp_TexCoord4dv,
- __glXDisp_TexCoord4fv,
- __glXDisp_TexCoord4iv,
- __glXDisp_TexCoord4sv,
- __glXDisp_Vertex2dv,
- __glXDisp_Vertex2fv,
- __glXDisp_Vertex2iv,
- __glXDisp_Vertex2sv,
- __glXDisp_Vertex3dv,
- __glXDisp_Vertex3fv,
- __glXDisp_Vertex3iv,
- __glXDisp_Vertex3sv,
- __glXDisp_Vertex4dv,
- __glXDisp_Vertex4fv,
- __glXDisp_Vertex4iv,
- __glXDisp_Vertex4sv,
- __glXDisp_ClipPlane,
- __glXDisp_ColorMaterial,
- __glXDisp_CullFace,
- __glXDisp_Fogf,
- __glXDisp_Fogfv,
- __glXDisp_Fogi,
- __glXDisp_Fogiv,
- __glXDisp_FrontFace,
- __glXDisp_Hint,
- __glXDisp_Lightf,
- __glXDisp_Lightfv,
- __glXDisp_Lighti,
- __glXDisp_Lightiv,
- __glXDisp_LightModelf,
- __glXDisp_LightModelfv,
- __glXDisp_LightModeli,
- __glXDisp_LightModeliv,
- __glXDisp_LineStipple,
- __glXDisp_LineWidth,
- __glXDisp_Materialf,
- __glXDisp_Materialfv,
- __glXDisp_Materiali,
- __glXDisp_Materialiv,
- __glXDisp_PointSize,
- __glXDisp_PolygonMode,
- __glXDisp_PolygonStipple,
- __glXDisp_Scissor,
- __glXDisp_ShadeModel,
- __glXDisp_TexParameterf,
- __glXDisp_TexParameterfv,
- __glXDisp_TexParameteri,
- __glXDisp_TexParameteriv,
- __glXDisp_TexImage1D,
- __glXDisp_TexImage2D,
- __glXDisp_TexEnvf,
- __glXDisp_TexEnvfv,
- __glXDisp_TexEnvi,
- __glXDisp_TexEnviv,
- __glXDisp_TexGend,
- __glXDisp_TexGendv,
- __glXDisp_TexGenf,
- __glXDisp_TexGenfv,
- __glXDisp_TexGeni,
- __glXDisp_TexGeniv,
- __glXDisp_InitNames,
- __glXDisp_LoadName,
- __glXDisp_PassThrough,
- __glXDisp_PopName,
- __glXDisp_PushName,
- __glXDisp_DrawBuffer,
- __glXDisp_Clear,
- __glXDisp_ClearAccum,
- __glXDisp_ClearIndex,
- __glXDisp_ClearColor,
- __glXDisp_ClearStencil,
- __glXDisp_ClearDepth,
- __glXDisp_StencilMask,
- __glXDisp_ColorMask,
- __glXDisp_DepthMask,
- __glXDisp_IndexMask,
- __glXDisp_Accum,
- __glXDisp_Disable,
- __glXDisp_Enable,
- __glXNoSuchRenderOpcode,
- __glXDisp_PopAttrib,
- __glXDisp_PushAttrib,
- __glXDisp_Map1d,
- __glXDisp_Map1f,
- __glXDisp_Map2d,
- __glXDisp_Map2f,
- __glXDisp_MapGrid1d,
- __glXDisp_MapGrid1f,
- __glXDisp_MapGrid2d,
- __glXDisp_MapGrid2f,
- __glXDisp_EvalCoord1dv,
- __glXDisp_EvalCoord1fv,
- __glXDisp_EvalCoord2dv,
- __glXDisp_EvalCoord2fv,
- __glXDisp_EvalMesh1,
- __glXDisp_EvalPoint1,
- __glXDisp_EvalMesh2,
- __glXDisp_EvalPoint2,
- __glXDisp_AlphaFunc,
- __glXDisp_BlendFunc,
- __glXDisp_LogicOp,
- __glXDisp_StencilFunc,
- __glXDisp_StencilOp,
- __glXDisp_DepthFunc,
- __glXDisp_PixelZoom,
- __glXDisp_PixelTransferf,
- __glXDisp_PixelTransferi,
- __glXDisp_PixelMapfv,
- __glXDisp_PixelMapuiv,
- __glXDisp_PixelMapusv,
- __glXDisp_ReadBuffer,
- __glXDisp_CopyPixels,
- __glXDisp_DrawPixels,
- __glXDisp_DepthRange,
- __glXDisp_Frustum,
- __glXDisp_LoadIdentity,
- __glXDisp_LoadMatrixf,
- __glXDisp_LoadMatrixd,
- __glXDisp_MatrixMode,
- __glXDisp_MultMatrixf,
- __glXDisp_MultMatrixd,
- __glXDisp_Ortho,
- __glXDisp_PopMatrix,
- __glXDisp_PushMatrix,
- __glXDisp_Rotated,
- __glXDisp_Rotatef,
- __glXDisp_Scaled,
- __glXDisp_Scalef,
- __glXDisp_Translated,
- __glXDisp_Translatef,
- __glXDisp_Viewport,
- __glXDisp_PolygonOffset,
- __glXDisp_DrawArrays,
- __glXDisp_Indexubv,
- __glXDisp_ColorSubTable,
- __glXDisp_CopyColorSubTable,
- __glXDisp_ActiveTextureARB,
- __glXDisp_MultiTexCoord1dvARB,
- __glXDisp_MultiTexCoord1fvARB,
- __glXDisp_MultiTexCoord1ivARB,
- __glXDisp_MultiTexCoord1svARB,
- __glXDisp_MultiTexCoord2dvARB,
- __glXDisp_MultiTexCoord2fvARB,
- __glXDisp_MultiTexCoord2ivARB,
- __glXDisp_MultiTexCoord2svARB,
- __glXDisp_MultiTexCoord3dvARB,
- __glXDisp_MultiTexCoord3fvARB,
- __glXDisp_MultiTexCoord3ivARB,
- __glXDisp_MultiTexCoord3svARB,
- __glXDisp_MultiTexCoord4dvARB,
- __glXDisp_MultiTexCoord4fvARB,
- __glXDisp_MultiTexCoord4ivARB,
- __glXDisp_MultiTexCoord4svARB, /* 213 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 220 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDisp_WindowPos3fARB /* 230 */
-};
-
-__GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
- __glXNoSuchSingleOpcode,
- __glXSwapRender,
- __glXSwapRenderLarge,
- __glXSwapCreateContext,
- __glXSwapDestroyContext,
- __glXSwapMakeCurrent,
- __glXSwapIsDirect,
- __glXSwapQueryVersion,
- __glXSwapWaitGL,
- __glXSwapWaitX,
- __glXSwapCopyContext,
- __glXSwapSwapBuffers,
- __glXSwapUseXFont,
- __glXSwapCreateGLXPixmap,
- __glXSwapGetVisualConfigs,
- __glXSwapDestroyGLXPixmap,
- __glXSwapVendorPrivate,
- __glXSwapVendorPrivateWithReply,
- __glXSwapQueryExtensionsString,
- __glXSwapQueryServerString,
- __glXSwapClientInfo,
- __glXNoSuchSingleOpcode, /* glXGetFBConfigs */
- __glXNoSuchSingleOpcode, /* glXCreatePixmap */
- __glXNoSuchSingleOpcode, /* glXDestroyPixmap */
- __glXNoSuchSingleOpcode, /* glXCreateNewContext */
- __glXNoSuchSingleOpcode, /* glXQueryContext */
- __glXSwapMakeContextCurrent,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXDispSwap_NewList,
- __glXDispSwap_EndList,
- __glXDispSwap_DeleteLists,
- __glXDispSwap_GenLists,
- __glXDispSwap_FeedbackBuffer,
- __glXDispSwap_SelectBuffer,
- __glXDispSwap_RenderMode,
- __glXDispSwap_Finish,
- __glXDispSwap_PixelStoref,
- __glXDispSwap_PixelStorei,
- __glXDispSwap_ReadPixels,
- __glXDispSwap_GetBooleanv,
- __glXDispSwap_GetClipPlane,
- __glXDispSwap_GetDoublev,
- __glXDispSwap_GetError,
- __glXDispSwap_GetFloatv,
- __glXDispSwap_GetIntegerv,
- __glXDispSwap_GetLightfv,
- __glXDispSwap_GetLightiv,
- __glXDispSwap_GetMapdv,
- __glXDispSwap_GetMapfv,
- __glXDispSwap_GetMapiv,
- __glXDispSwap_GetMaterialfv,
- __glXDispSwap_GetMaterialiv,
- __glXDispSwap_GetPixelMapfv,
- __glXDispSwap_GetPixelMapuiv,
- __glXDispSwap_GetPixelMapusv,
- __glXDispSwap_GetPolygonStipple,
- __glXDispSwap_GetString,
- __glXDispSwap_GetTexEnvfv,
- __glXDispSwap_GetTexEnviv,
- __glXDispSwap_GetTexGendv,
- __glXDispSwap_GetTexGenfv,
- __glXDispSwap_GetTexGeniv,
- __glXDispSwap_GetTexImage,
- __glXDispSwap_GetTexParameterfv,
- __glXDispSwap_GetTexParameteriv,
- __glXDispSwap_GetTexLevelParameterfv,
- __glXDispSwap_GetTexLevelParameteriv,
- __glXDispSwap_IsEnabled,
- __glXDispSwap_IsList,
- __glXDispSwap_Flush,
- __glXDispSwap_AreTexturesResident,
- __glXDispSwap_DeleteTextures,
- __glXDispSwap_GenTextures,
- __glXDispSwap_IsTexture,
- __glXDispSwap_GetColorTable,
- __glXDispSwap_GetColorTableParameterfv,
- __glXDispSwap_GetColorTableParameteriv,
- __glXDispSwap_GetConvolutionFilter,
- __glXDispSwap_GetConvolutionParameterfv,
- __glXDispSwap_GetConvolutionParameteriv,
- __glXDispSwap_GetSeparableFilter,
- __glXDispSwap_GetHistogram,
- __glXDispSwap_GetHistogramParameterfv,
- __glXDispSwap_GetHistogramParameteriv,
- __glXDispSwap_GetMinmax,
- __glXDispSwap_GetMinmaxParameterfv,
- __glXDispSwap_GetMinmaxParameteriv,
-};
-
-__GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
- __glXNoSuchRenderOpcode,
- __glXDispSwap_CallList,
- __glXDispSwap_CallLists,
- __glXDispSwap_ListBase,
- __glXDispSwap_Begin,
- __glXDispSwap_Bitmap,
- __glXDispSwap_Color3bv,
- __glXDispSwap_Color3dv,
- __glXDispSwap_Color3fv,
- __glXDispSwap_Color3iv,
- __glXDispSwap_Color3sv,
- __glXDispSwap_Color3ubv,
- __glXDispSwap_Color3uiv,
- __glXDispSwap_Color3usv,
- __glXDispSwap_Color4bv,
- __glXDispSwap_Color4dv,
- __glXDispSwap_Color4fv,
- __glXDispSwap_Color4iv,
- __glXDispSwap_Color4sv,
- __glXDispSwap_Color4ubv,
- __glXDispSwap_Color4uiv,
- __glXDispSwap_Color4usv,
- __glXDispSwap_EdgeFlagv,
- __glXDispSwap_End,
- __glXDispSwap_Indexdv,
- __glXDispSwap_Indexfv,
- __glXDispSwap_Indexiv,
- __glXDispSwap_Indexsv,
- __glXDispSwap_Normal3bv,
- __glXDispSwap_Normal3dv,
- __glXDispSwap_Normal3fv,
- __glXDispSwap_Normal3iv,
- __glXDispSwap_Normal3sv,
- __glXDispSwap_RasterPos2dv,
- __glXDispSwap_RasterPos2fv,
- __glXDispSwap_RasterPos2iv,
- __glXDispSwap_RasterPos2sv,
- __glXDispSwap_RasterPos3dv,
- __glXDispSwap_RasterPos3fv,
- __glXDispSwap_RasterPos3iv,
- __glXDispSwap_RasterPos3sv,
- __glXDispSwap_RasterPos4dv,
- __glXDispSwap_RasterPos4fv,
- __glXDispSwap_RasterPos4iv,
- __glXDispSwap_RasterPos4sv,
- __glXDispSwap_Rectdv,
- __glXDispSwap_Rectfv,
- __glXDispSwap_Rectiv,
- __glXDispSwap_Rectsv,
- __glXDispSwap_TexCoord1dv,
- __glXDispSwap_TexCoord1fv,
- __glXDispSwap_TexCoord1iv,
- __glXDispSwap_TexCoord1sv,
- __glXDispSwap_TexCoord2dv,
- __glXDispSwap_TexCoord2fv,
- __glXDispSwap_TexCoord2iv,
- __glXDispSwap_TexCoord2sv,
- __glXDispSwap_TexCoord3dv,
- __glXDispSwap_TexCoord3fv,
- __glXDispSwap_TexCoord3iv,
- __glXDispSwap_TexCoord3sv,
- __glXDispSwap_TexCoord4dv,
- __glXDispSwap_TexCoord4fv,
- __glXDispSwap_TexCoord4iv,
- __glXDispSwap_TexCoord4sv,
- __glXDispSwap_Vertex2dv,
- __glXDispSwap_Vertex2fv,
- __glXDispSwap_Vertex2iv,
- __glXDispSwap_Vertex2sv,
- __glXDispSwap_Vertex3dv,
- __glXDispSwap_Vertex3fv,
- __glXDispSwap_Vertex3iv,
- __glXDispSwap_Vertex3sv,
- __glXDispSwap_Vertex4dv,
- __glXDispSwap_Vertex4fv,
- __glXDispSwap_Vertex4iv,
- __glXDispSwap_Vertex4sv,
- __glXDispSwap_ClipPlane,
- __glXDispSwap_ColorMaterial,
- __glXDispSwap_CullFace,
- __glXDispSwap_Fogf,
- __glXDispSwap_Fogfv,
- __glXDispSwap_Fogi,
- __glXDispSwap_Fogiv,
- __glXDispSwap_FrontFace,
- __glXDispSwap_Hint,
- __glXDispSwap_Lightf,
- __glXDispSwap_Lightfv,
- __glXDispSwap_Lighti,
- __glXDispSwap_Lightiv,
- __glXDispSwap_LightModelf,
- __glXDispSwap_LightModelfv,
- __glXDispSwap_LightModeli,
- __glXDispSwap_LightModeliv,
- __glXDispSwap_LineStipple,
- __glXDispSwap_LineWidth,
- __glXDispSwap_Materialf,
- __glXDispSwap_Materialfv,
- __glXDispSwap_Materiali,
- __glXDispSwap_Materialiv,
- __glXDispSwap_PointSize,
- __glXDispSwap_PolygonMode,
- __glXDispSwap_PolygonStipple,
- __glXDispSwap_Scissor,
- __glXDispSwap_ShadeModel,
- __glXDispSwap_TexParameterf,
- __glXDispSwap_TexParameterfv,
- __glXDispSwap_TexParameteri,
- __glXDispSwap_TexParameteriv,
- __glXDispSwap_TexImage1D,
- __glXDispSwap_TexImage2D,
- __glXDispSwap_TexEnvf,
- __glXDispSwap_TexEnvfv,
- __glXDispSwap_TexEnvi,
- __glXDispSwap_TexEnviv,
- __glXDispSwap_TexGend,
- __glXDispSwap_TexGendv,
- __glXDispSwap_TexGenf,
- __glXDispSwap_TexGenfv,
- __glXDispSwap_TexGeni,
- __glXDispSwap_TexGeniv,
- __glXDispSwap_InitNames,
- __glXDispSwap_LoadName,
- __glXDispSwap_PassThrough,
- __glXDispSwap_PopName,
- __glXDispSwap_PushName,
- __glXDispSwap_DrawBuffer,
- __glXDispSwap_Clear,
- __glXDispSwap_ClearAccum,
- __glXDispSwap_ClearIndex,
- __glXDispSwap_ClearColor,
- __glXDispSwap_ClearStencil,
- __glXDispSwap_ClearDepth,
- __glXDispSwap_StencilMask,
- __glXDispSwap_ColorMask,
- __glXDispSwap_DepthMask,
- __glXDispSwap_IndexMask,
- __glXDispSwap_Accum,
- __glXDispSwap_Disable,
- __glXDispSwap_Enable,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_PopAttrib,
- __glXDispSwap_PushAttrib,
- __glXDispSwap_Map1d,
- __glXDispSwap_Map1f,
- __glXDispSwap_Map2d,
- __glXDispSwap_Map2f,
- __glXDispSwap_MapGrid1d,
- __glXDispSwap_MapGrid1f,
- __glXDispSwap_MapGrid2d,
- __glXDispSwap_MapGrid2f,
- __glXDispSwap_EvalCoord1dv,
- __glXDispSwap_EvalCoord1fv,
- __glXDispSwap_EvalCoord2dv,
- __glXDispSwap_EvalCoord2fv,
- __glXDispSwap_EvalMesh1,
- __glXDispSwap_EvalPoint1,
- __glXDispSwap_EvalMesh2,
- __glXDispSwap_EvalPoint2,
- __glXDispSwap_AlphaFunc,
- __glXDispSwap_BlendFunc,
- __glXDispSwap_LogicOp,
- __glXDispSwap_StencilFunc,
- __glXDispSwap_StencilOp,
- __glXDispSwap_DepthFunc,
- __glXDispSwap_PixelZoom,
- __glXDispSwap_PixelTransferf,
- __glXDispSwap_PixelTransferi,
- __glXDispSwap_PixelMapfv,
- __glXDispSwap_PixelMapuiv,
- __glXDispSwap_PixelMapusv,
- __glXDispSwap_ReadBuffer,
- __glXDispSwap_CopyPixels,
- __glXDispSwap_DrawPixels,
- __glXDispSwap_DepthRange,
- __glXDispSwap_Frustum,
- __glXDispSwap_LoadIdentity,
- __glXDispSwap_LoadMatrixf,
- __glXDispSwap_LoadMatrixd,
- __glXDispSwap_MatrixMode,
- __glXDispSwap_MultMatrixf,
- __glXDispSwap_MultMatrixd,
- __glXDispSwap_Ortho,
- __glXDispSwap_PopMatrix,
- __glXDispSwap_PushMatrix,
- __glXDispSwap_Rotated,
- __glXDispSwap_Rotatef,
- __glXDispSwap_Scaled,
- __glXDispSwap_Scalef,
- __glXDispSwap_Translated,
- __glXDispSwap_Translatef,
- __glXDispSwap_Viewport,
- __glXDispSwap_PolygonOffset,
- __glXDispSwap_DrawArrays,
- __glXDispSwap_Indexubv,
- __glXDispSwap_ColorSubTable,
- __glXDispSwap_CopyColorSubTable,
- __glXDispSwap_ActiveTextureARB,
- __glXDispSwap_MultiTexCoord1dvARB,
- __glXDispSwap_MultiTexCoord1fvARB,
- __glXDispSwap_MultiTexCoord1ivARB,
- __glXDispSwap_MultiTexCoord1svARB,
- __glXDispSwap_MultiTexCoord2dvARB,
- __glXDispSwap_MultiTexCoord2fvARB,
- __glXDispSwap_MultiTexCoord2ivARB,
- __glXDispSwap_MultiTexCoord2svARB,
- __glXDispSwap_MultiTexCoord3dvARB,
- __glXDispSwap_MultiTexCoord3fvARB,
- __glXDispSwap_MultiTexCoord3ivARB,
- __glXDispSwap_MultiTexCoord3svARB,
- __glXDispSwap_MultiTexCoord4dvARB,
- __glXDispSwap_MultiTexCoord4fvARB,
- __glXDispSwap_MultiTexCoord4ivARB,
- __glXDispSwap_MultiTexCoord4svARB, /* 213 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 220 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_WindowPos3fARB /* 230 */
-};
diff --git a/GL/glx/g_disptab.h b/GL/glx/g_disptab.h
deleted file mode 100644
index ceeab5482..000000000
--- a/GL/glx/g_disptab.h
+++ /dev/null
@@ -1,640 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */
-/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
-#ifndef _GLX_g_disptab_h_
-#define _GLX_g_disptab_h_
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-extern int __glXRender(__GLXclientState*, GLbyte*);
-extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
-extern int __glXCreateContext(__GLXclientState*, GLbyte*);
-extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
-extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
-extern int __glXIsDirect(__GLXclientState*, GLbyte*);
-extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
-extern int __glXWaitGL(__GLXclientState*, GLbyte*);
-extern int __glXWaitX(__GLXclientState*, GLbyte*);
-extern int __glXCopyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
-extern int __glXUseXFont(__GLXclientState*, GLbyte*);
-extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
-extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
-extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
-extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
-extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
-extern int __glXClientInfo(__GLXclientState*, GLbyte*);
-extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
-
-extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
-extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
-extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
-extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
-extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
-extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
-extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
-extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
-
-extern void __glXDisp_CallList(GLbyte*);
-extern void __glXDisp_CallLists(GLbyte*);
-extern void __glXDisp_ListBase(GLbyte*);
-extern void __glXDisp_Begin(GLbyte*);
-extern void __glXDisp_Bitmap(GLbyte*);
-extern void __glXDisp_Color3bv(GLbyte*);
-extern void __glXDisp_Color3dv(GLbyte*);
-extern void __glXDisp_Color3fv(GLbyte*);
-extern void __glXDisp_Color3iv(GLbyte*);
-extern void __glXDisp_Color3sv(GLbyte*);
-extern void __glXDisp_Color3ubv(GLbyte*);
-extern void __glXDisp_Color3uiv(GLbyte*);
-extern void __glXDisp_Color3usv(GLbyte*);
-extern void __glXDisp_Color4bv(GLbyte*);
-extern void __glXDisp_Color4dv(GLbyte*);
-extern void __glXDisp_Color4fv(GLbyte*);
-extern void __glXDisp_Color4iv(GLbyte*);
-extern void __glXDisp_Color4sv(GLbyte*);
-extern void __glXDisp_Color4ubv(GLbyte*);
-extern void __glXDisp_Color4uiv(GLbyte*);
-extern void __glXDisp_Color4usv(GLbyte*);
-extern void __glXDisp_EdgeFlagv(GLbyte*);
-extern void __glXDisp_End(GLbyte*);
-extern void __glXDisp_Indexdv(GLbyte*);
-extern void __glXDisp_Indexfv(GLbyte*);
-extern void __glXDisp_Indexiv(GLbyte*);
-extern void __glXDisp_Indexsv(GLbyte*);
-extern void __glXDisp_Normal3bv(GLbyte*);
-extern void __glXDisp_Normal3dv(GLbyte*);
-extern void __glXDisp_Normal3fv(GLbyte*);
-extern void __glXDisp_Normal3iv(GLbyte*);
-extern void __glXDisp_Normal3sv(GLbyte*);
-extern void __glXDisp_RasterPos2dv(GLbyte*);
-extern void __glXDisp_RasterPos2fv(GLbyte*);
-extern void __glXDisp_RasterPos2iv(GLbyte*);
-extern void __glXDisp_RasterPos2sv(GLbyte*);
-extern void __glXDisp_RasterPos3dv(GLbyte*);
-extern void __glXDisp_RasterPos3fv(GLbyte*);
-extern void __glXDisp_RasterPos3iv(GLbyte*);
-extern void __glXDisp_RasterPos3sv(GLbyte*);
-extern void __glXDisp_RasterPos4dv(GLbyte*);
-extern void __glXDisp_RasterPos4fv(GLbyte*);
-extern void __glXDisp_RasterPos4iv(GLbyte*);
-extern void __glXDisp_RasterPos4sv(GLbyte*);
-extern void __glXDisp_Rectdv(GLbyte*);
-extern void __glXDisp_Rectfv(GLbyte*);
-extern void __glXDisp_Rectiv(GLbyte*);
-extern void __glXDisp_Rectsv(GLbyte*);
-extern void __glXDisp_TexCoord1dv(GLbyte*);
-extern void __glXDisp_TexCoord1fv(GLbyte*);
-extern void __glXDisp_TexCoord1iv(GLbyte*);
-extern void __glXDisp_TexCoord1sv(GLbyte*);
-extern void __glXDisp_TexCoord2dv(GLbyte*);
-extern void __glXDisp_TexCoord2fv(GLbyte*);
-extern void __glXDisp_TexCoord2iv(GLbyte*);
-extern void __glXDisp_TexCoord2sv(GLbyte*);
-extern void __glXDisp_TexCoord3dv(GLbyte*);
-extern void __glXDisp_TexCoord3fv(GLbyte*);
-extern void __glXDisp_TexCoord3iv(GLbyte*);
-extern void __glXDisp_TexCoord3sv(GLbyte*);
-extern void __glXDisp_TexCoord4dv(GLbyte*);
-extern void __glXDisp_TexCoord4fv(GLbyte*);
-extern void __glXDisp_TexCoord4iv(GLbyte*);
-extern void __glXDisp_TexCoord4sv(GLbyte*);
-extern void __glXDisp_Vertex2dv(GLbyte*);
-extern void __glXDisp_Vertex2fv(GLbyte*);
-extern void __glXDisp_Vertex2iv(GLbyte*);
-extern void __glXDisp_Vertex2sv(GLbyte*);
-extern void __glXDisp_Vertex3dv(GLbyte*);
-extern void __glXDisp_Vertex3fv(GLbyte*);
-extern void __glXDisp_Vertex3iv(GLbyte*);
-extern void __glXDisp_Vertex3sv(GLbyte*);
-extern void __glXDisp_Vertex4dv(GLbyte*);
-extern void __glXDisp_Vertex4fv(GLbyte*);
-extern void __glXDisp_Vertex4iv(GLbyte*);
-extern void __glXDisp_Vertex4sv(GLbyte*);
-extern void __glXDisp_ClipPlane(GLbyte*);
-extern void __glXDisp_ColorMaterial(GLbyte*);
-extern void __glXDisp_CullFace(GLbyte*);
-extern void __glXDisp_Fogf(GLbyte*);
-extern void __glXDisp_Fogfv(GLbyte*);
-extern void __glXDisp_Fogi(GLbyte*);
-extern void __glXDisp_Fogiv(GLbyte*);
-extern void __glXDisp_FrontFace(GLbyte*);
-extern void __glXDisp_Hint(GLbyte*);
-extern void __glXDisp_Lightf(GLbyte*);
-extern void __glXDisp_Lightfv(GLbyte*);
-extern void __glXDisp_Lighti(GLbyte*);
-extern void __glXDisp_Lightiv(GLbyte*);
-extern void __glXDisp_LightModelf(GLbyte*);
-extern void __glXDisp_LightModelfv(GLbyte*);
-extern void __glXDisp_LightModeli(GLbyte*);
-extern void __glXDisp_LightModeliv(GLbyte*);
-extern void __glXDisp_LineStipple(GLbyte*);
-extern void __glXDisp_LineWidth(GLbyte*);
-extern void __glXDisp_Materialf(GLbyte*);
-extern void __glXDisp_Materialfv(GLbyte*);
-extern void __glXDisp_Materiali(GLbyte*);
-extern void __glXDisp_Materialiv(GLbyte*);
-extern void __glXDisp_PointSize(GLbyte*);
-extern void __glXDisp_PolygonMode(GLbyte*);
-extern void __glXDisp_PolygonStipple(GLbyte*);
-extern void __glXDisp_Scissor(GLbyte*);
-extern void __glXDisp_ShadeModel(GLbyte*);
-extern void __glXDisp_TexParameterf(GLbyte*);
-extern void __glXDisp_TexParameterfv(GLbyte*);
-extern void __glXDisp_TexParameteri(GLbyte*);
-extern void __glXDisp_TexParameteriv(GLbyte*);
-extern void __glXDisp_TexImage1D(GLbyte*);
-extern void __glXDisp_TexImage2D(GLbyte*);
-extern void __glXDisp_TexEnvf(GLbyte*);
-extern void __glXDisp_TexEnvfv(GLbyte*);
-extern void __glXDisp_TexEnvi(GLbyte*);
-extern void __glXDisp_TexEnviv(GLbyte*);
-extern void __glXDisp_TexGend(GLbyte*);
-extern void __glXDisp_TexGendv(GLbyte*);
-extern void __glXDisp_TexGenf(GLbyte*);
-extern void __glXDisp_TexGenfv(GLbyte*);
-extern void __glXDisp_TexGeni(GLbyte*);
-extern void __glXDisp_TexGeniv(GLbyte*);
-extern void __glXDisp_InitNames(GLbyte*);
-extern void __glXDisp_LoadName(GLbyte*);
-extern void __glXDisp_PassThrough(GLbyte*);
-extern void __glXDisp_PopName(GLbyte*);
-extern void __glXDisp_PushName(GLbyte*);
-extern void __glXDisp_DrawBuffer(GLbyte*);
-extern void __glXDisp_Clear(GLbyte*);
-extern void __glXDisp_ClearAccum(GLbyte*);
-extern void __glXDisp_ClearIndex(GLbyte*);
-extern void __glXDisp_ClearColor(GLbyte*);
-extern void __glXDisp_ClearStencil(GLbyte*);
-extern void __glXDisp_ClearDepth(GLbyte*);
-extern void __glXDisp_StencilMask(GLbyte*);
-extern void __glXDisp_ColorMask(GLbyte*);
-extern void __glXDisp_DepthMask(GLbyte*);
-extern void __glXDisp_IndexMask(GLbyte*);
-extern void __glXDisp_Accum(GLbyte*);
-extern void __glXDisp_Disable(GLbyte*);
-extern void __glXDisp_Enable(GLbyte*);
-extern void __glXDisp_PopAttrib(GLbyte*);
-extern void __glXDisp_PushAttrib(GLbyte*);
-extern void __glXDisp_Map1d(GLbyte*);
-extern void __glXDisp_Map1f(GLbyte*);
-extern void __glXDisp_Map2d(GLbyte*);
-extern void __glXDisp_Map2f(GLbyte*);
-extern void __glXDisp_MapGrid1d(GLbyte*);
-extern void __glXDisp_MapGrid1f(GLbyte*);
-extern void __glXDisp_MapGrid2d(GLbyte*);
-extern void __glXDisp_MapGrid2f(GLbyte*);
-extern void __glXDisp_EvalCoord1dv(GLbyte*);
-extern void __glXDisp_EvalCoord1fv(GLbyte*);
-extern void __glXDisp_EvalCoord2dv(GLbyte*);
-extern void __glXDisp_EvalCoord2fv(GLbyte*);
-extern void __glXDisp_EvalMesh1(GLbyte*);
-extern void __glXDisp_EvalPoint1(GLbyte*);
-extern void __glXDisp_EvalMesh2(GLbyte*);
-extern void __glXDisp_EvalPoint2(GLbyte*);
-extern void __glXDisp_AlphaFunc(GLbyte*);
-extern void __glXDisp_BlendFunc(GLbyte*);
-extern void __glXDisp_LogicOp(GLbyte*);
-extern void __glXDisp_StencilFunc(GLbyte*);
-extern void __glXDisp_StencilOp(GLbyte*);
-extern void __glXDisp_DepthFunc(GLbyte*);
-extern void __glXDisp_PixelZoom(GLbyte*);
-extern void __glXDisp_PixelTransferf(GLbyte*);
-extern void __glXDisp_PixelTransferi(GLbyte*);
-extern void __glXDisp_PixelMapfv(GLbyte*);
-extern void __glXDisp_PixelMapuiv(GLbyte*);
-extern void __glXDisp_PixelMapusv(GLbyte*);
-extern void __glXDisp_ReadBuffer(GLbyte*);
-extern void __glXDisp_CopyPixels(GLbyte*);
-extern void __glXDisp_DrawPixels(GLbyte*);
-extern void __glXDisp_DepthRange(GLbyte*);
-extern void __glXDisp_Frustum(GLbyte*);
-extern void __glXDisp_LoadIdentity(GLbyte*);
-extern void __glXDisp_LoadMatrixf(GLbyte*);
-extern void __glXDisp_LoadMatrixd(GLbyte*);
-extern void __glXDisp_MatrixMode(GLbyte*);
-extern void __glXDisp_MultMatrixf(GLbyte*);
-extern void __glXDisp_MultMatrixd(GLbyte*);
-extern void __glXDisp_Ortho(GLbyte*);
-extern void __glXDisp_PopMatrix(GLbyte*);
-extern void __glXDisp_PushMatrix(GLbyte*);
-extern void __glXDisp_Rotated(GLbyte*);
-extern void __glXDisp_Rotatef(GLbyte*);
-extern void __glXDisp_Scaled(GLbyte*);
-extern void __glXDisp_Scalef(GLbyte*);
-extern void __glXDisp_Translated(GLbyte*);
-extern void __glXDisp_Translatef(GLbyte*);
-extern void __glXDisp_Viewport(GLbyte*);
-extern void __glXDisp_PolygonOffset(GLbyte*);
-extern void __glXDisp_DrawArrays(GLbyte*);
-extern void __glXDisp_Indexubv(GLbyte*);
-extern void __glXDisp_ColorSubTable(GLbyte*);
-extern void __glXDisp_CopyColorSubTable(GLbyte*);
-extern void __glXDisp_ActiveTextureARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
-extern void __glXDisp_WindowPos3fARB(GLbyte *);
-
-extern int __glXSwapRender(__GLXclientState*, GLbyte*);
-extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
-extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
-extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
-extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
-extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
-extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
-extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
-extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
-extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
-extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
-
-extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
-
-extern void __glXDispSwap_CallList(GLbyte*);
-extern void __glXDispSwap_CallLists(GLbyte*);
-extern void __glXDispSwap_ListBase(GLbyte*);
-extern void __glXDispSwap_Begin(GLbyte*);
-extern void __glXDispSwap_Bitmap(GLbyte*);
-extern void __glXDispSwap_Color3bv(GLbyte*);
-extern void __glXDispSwap_Color3dv(GLbyte*);
-extern void __glXDispSwap_Color3fv(GLbyte*);
-extern void __glXDispSwap_Color3iv(GLbyte*);
-extern void __glXDispSwap_Color3sv(GLbyte*);
-extern void __glXDispSwap_Color3ubv(GLbyte*);
-extern void __glXDispSwap_Color3uiv(GLbyte*);
-extern void __glXDispSwap_Color3usv(GLbyte*);
-extern void __glXDispSwap_Color4bv(GLbyte*);
-extern void __glXDispSwap_Color4dv(GLbyte*);
-extern void __glXDispSwap_Color4fv(GLbyte*);
-extern void __glXDispSwap_Color4iv(GLbyte*);
-extern void __glXDispSwap_Color4sv(GLbyte*);
-extern void __glXDispSwap_Color4ubv(GLbyte*);
-extern void __glXDispSwap_Color4uiv(GLbyte*);
-extern void __glXDispSwap_Color4usv(GLbyte*);
-extern void __glXDispSwap_EdgeFlagv(GLbyte*);
-extern void __glXDispSwap_End(GLbyte*);
-extern void __glXDispSwap_Indexdv(GLbyte*);
-extern void __glXDispSwap_Indexfv(GLbyte*);
-extern void __glXDispSwap_Indexiv(GLbyte*);
-extern void __glXDispSwap_Indexsv(GLbyte*);
-extern void __glXDispSwap_Normal3bv(GLbyte*);
-extern void __glXDispSwap_Normal3dv(GLbyte*);
-extern void __glXDispSwap_Normal3fv(GLbyte*);
-extern void __glXDispSwap_Normal3iv(GLbyte*);
-extern void __glXDispSwap_Normal3sv(GLbyte*);
-extern void __glXDispSwap_RasterPos2dv(GLbyte*);
-extern void __glXDispSwap_RasterPos2fv(GLbyte*);
-extern void __glXDispSwap_RasterPos2iv(GLbyte*);
-extern void __glXDispSwap_RasterPos2sv(GLbyte*);
-extern void __glXDispSwap_RasterPos3dv(GLbyte*);
-extern void __glXDispSwap_RasterPos3fv(GLbyte*);
-extern void __glXDispSwap_RasterPos3iv(GLbyte*);
-extern void __glXDispSwap_RasterPos3sv(GLbyte*);
-extern void __glXDispSwap_RasterPos4dv(GLbyte*);
-extern void __glXDispSwap_RasterPos4fv(GLbyte*);
-extern void __glXDispSwap_RasterPos4iv(GLbyte*);
-extern void __glXDispSwap_RasterPos4sv(GLbyte*);
-extern void __glXDispSwap_Rectdv(GLbyte*);
-extern void __glXDispSwap_Rectfv(GLbyte*);
-extern void __glXDispSwap_Rectiv(GLbyte*);
-extern void __glXDispSwap_Rectsv(GLbyte*);
-extern void __glXDispSwap_TexCoord1dv(GLbyte*);
-extern void __glXDispSwap_TexCoord1fv(GLbyte*);
-extern void __glXDispSwap_TexCoord1iv(GLbyte*);
-extern void __glXDispSwap_TexCoord1sv(GLbyte*);
-extern void __glXDispSwap_TexCoord2dv(GLbyte*);
-extern void __glXDispSwap_TexCoord2fv(GLbyte*);
-extern void __glXDispSwap_TexCoord2iv(GLbyte*);
-extern void __glXDispSwap_TexCoord2sv(GLbyte*);
-extern void __glXDispSwap_TexCoord3dv(GLbyte*);
-extern void __glXDispSwap_TexCoord3fv(GLbyte*);
-extern void __glXDispSwap_TexCoord3iv(GLbyte*);
-extern void __glXDispSwap_TexCoord3sv(GLbyte*);
-extern void __glXDispSwap_TexCoord4dv(GLbyte*);
-extern void __glXDispSwap_TexCoord4fv(GLbyte*);
-extern void __glXDispSwap_TexCoord4iv(GLbyte*);
-extern void __glXDispSwap_TexCoord4sv(GLbyte*);
-extern void __glXDispSwap_Vertex2dv(GLbyte*);
-extern void __glXDispSwap_Vertex2fv(GLbyte*);
-extern void __glXDispSwap_Vertex2iv(GLbyte*);
-extern void __glXDispSwap_Vertex2sv(GLbyte*);
-extern void __glXDispSwap_Vertex3dv(GLbyte*);
-extern void __glXDispSwap_Vertex3fv(GLbyte*);
-extern void __glXDispSwap_Vertex3iv(GLbyte*);
-extern void __glXDispSwap_Vertex3sv(GLbyte*);
-extern void __glXDispSwap_Vertex4dv(GLbyte*);
-extern void __glXDispSwap_Vertex4fv(GLbyte*);
-extern void __glXDispSwap_Vertex4iv(GLbyte*);
-extern void __glXDispSwap_Vertex4sv(GLbyte*);
-extern void __glXDispSwap_ClipPlane(GLbyte*);
-extern void __glXDispSwap_ColorMaterial(GLbyte*);
-extern void __glXDispSwap_CullFace(GLbyte*);
-extern void __glXDispSwap_Fogf(GLbyte*);
-extern void __glXDispSwap_Fogfv(GLbyte*);
-extern void __glXDispSwap_Fogi(GLbyte*);
-extern void __glXDispSwap_Fogiv(GLbyte*);
-extern void __glXDispSwap_FrontFace(GLbyte*);
-extern void __glXDispSwap_Hint(GLbyte*);
-extern void __glXDispSwap_Lightf(GLbyte*);
-extern void __glXDispSwap_Lightfv(GLbyte*);
-extern void __glXDispSwap_Lighti(GLbyte*);
-extern void __glXDispSwap_Lightiv(GLbyte*);
-extern void __glXDispSwap_LightModelf(GLbyte*);
-extern void __glXDispSwap_LightModelfv(GLbyte*);
-extern void __glXDispSwap_LightModeli(GLbyte*);
-extern void __glXDispSwap_LightModeliv(GLbyte*);
-extern void __glXDispSwap_LineStipple(GLbyte*);
-extern void __glXDispSwap_LineWidth(GLbyte*);
-extern void __glXDispSwap_Materialf(GLbyte*);
-extern void __glXDispSwap_Materialfv(GLbyte*);
-extern void __glXDispSwap_Materiali(GLbyte*);
-extern void __glXDispSwap_Materialiv(GLbyte*);
-extern void __glXDispSwap_PointSize(GLbyte*);
-extern void __glXDispSwap_PolygonMode(GLbyte*);
-extern void __glXDispSwap_PolygonStipple(GLbyte*);
-extern void __glXDispSwap_Scissor(GLbyte*);
-extern void __glXDispSwap_ShadeModel(GLbyte*);
-extern void __glXDispSwap_TexParameterf(GLbyte*);
-extern void __glXDispSwap_TexParameterfv(GLbyte*);
-extern void __glXDispSwap_TexParameteri(GLbyte*);
-extern void __glXDispSwap_TexParameteriv(GLbyte*);
-extern void __glXDispSwap_TexImage1D(GLbyte*);
-extern void __glXDispSwap_TexImage2D(GLbyte*);
-extern void __glXDispSwap_TexEnvf(GLbyte*);
-extern void __glXDispSwap_TexEnvfv(GLbyte*);
-extern void __glXDispSwap_TexEnvi(GLbyte*);
-extern void __glXDispSwap_TexEnviv(GLbyte*);
-extern void __glXDispSwap_TexGend(GLbyte*);
-extern void __glXDispSwap_TexGendv(GLbyte*);
-extern void __glXDispSwap_TexGenf(GLbyte*);
-extern void __glXDispSwap_TexGenfv(GLbyte*);
-extern void __glXDispSwap_TexGeni(GLbyte*);
-extern void __glXDispSwap_TexGeniv(GLbyte*);
-extern void __glXDispSwap_InitNames(GLbyte*);
-extern void __glXDispSwap_LoadName(GLbyte*);
-extern void __glXDispSwap_PassThrough(GLbyte*);
-extern void __glXDispSwap_PopName(GLbyte*);
-extern void __glXDispSwap_PushName(GLbyte*);
-extern void __glXDispSwap_DrawBuffer(GLbyte*);
-extern void __glXDispSwap_Clear(GLbyte*);
-extern void __glXDispSwap_ClearAccum(GLbyte*);
-extern void __glXDispSwap_ClearIndex(GLbyte*);
-extern void __glXDispSwap_ClearColor(GLbyte*);
-extern void __glXDispSwap_ClearStencil(GLbyte*);
-extern void __glXDispSwap_ClearDepth(GLbyte*);
-extern void __glXDispSwap_StencilMask(GLbyte*);
-extern void __glXDispSwap_ColorMask(GLbyte*);
-extern void __glXDispSwap_DepthMask(GLbyte*);
-extern void __glXDispSwap_IndexMask(GLbyte*);
-extern void __glXDispSwap_Accum(GLbyte*);
-extern void __glXDispSwap_Disable(GLbyte*);
-extern void __glXDispSwap_Enable(GLbyte*);
-extern void __glXDispSwap_PopAttrib(GLbyte*);
-extern void __glXDispSwap_PushAttrib(GLbyte*);
-extern void __glXDispSwap_Map1d(GLbyte*);
-extern void __glXDispSwap_Map1f(GLbyte*);
-extern void __glXDispSwap_Map2d(GLbyte*);
-extern void __glXDispSwap_Map2f(GLbyte*);
-extern void __glXDispSwap_MapGrid1d(GLbyte*);
-extern void __glXDispSwap_MapGrid1f(GLbyte*);
-extern void __glXDispSwap_MapGrid2d(GLbyte*);
-extern void __glXDispSwap_MapGrid2f(GLbyte*);
-extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
-extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
-extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
-extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
-extern void __glXDispSwap_EvalMesh1(GLbyte*);
-extern void __glXDispSwap_EvalPoint1(GLbyte*);
-extern void __glXDispSwap_EvalMesh2(GLbyte*);
-extern void __glXDispSwap_EvalPoint2(GLbyte*);
-extern void __glXDispSwap_AlphaFunc(GLbyte*);
-extern void __glXDispSwap_BlendFunc(GLbyte*);
-extern void __glXDispSwap_LogicOp(GLbyte*);
-extern void __glXDispSwap_StencilFunc(GLbyte*);
-extern void __glXDispSwap_StencilOp(GLbyte*);
-extern void __glXDispSwap_DepthFunc(GLbyte*);
-extern void __glXDispSwap_PixelZoom(GLbyte*);
-extern void __glXDispSwap_PixelTransferf(GLbyte*);
-extern void __glXDispSwap_PixelTransferi(GLbyte*);
-extern void __glXDispSwap_PixelMapfv(GLbyte*);
-extern void __glXDispSwap_PixelMapuiv(GLbyte*);
-extern void __glXDispSwap_PixelMapusv(GLbyte*);
-extern void __glXDispSwap_ReadBuffer(GLbyte*);
-extern void __glXDispSwap_CopyPixels(GLbyte*);
-extern void __glXDispSwap_DrawPixels(GLbyte*);
-extern void __glXDispSwap_DepthRange(GLbyte*);
-extern void __glXDispSwap_Frustum(GLbyte*);
-extern void __glXDispSwap_LoadIdentity(GLbyte*);
-extern void __glXDispSwap_LoadMatrixf(GLbyte*);
-extern void __glXDispSwap_LoadMatrixd(GLbyte*);
-extern void __glXDispSwap_MatrixMode(GLbyte*);
-extern void __glXDispSwap_MultMatrixf(GLbyte*);
-extern void __glXDispSwap_MultMatrixd(GLbyte*);
-extern void __glXDispSwap_Ortho(GLbyte*);
-extern void __glXDispSwap_PopMatrix(GLbyte*);
-extern void __glXDispSwap_PushMatrix(GLbyte*);
-extern void __glXDispSwap_Rotated(GLbyte*);
-extern void __glXDispSwap_Rotatef(GLbyte*);
-extern void __glXDispSwap_Scaled(GLbyte*);
-extern void __glXDispSwap_Scalef(GLbyte*);
-extern void __glXDispSwap_Translated(GLbyte*);
-extern void __glXDispSwap_Translatef(GLbyte*);
-extern void __glXDispSwap_Viewport(GLbyte*);
-extern void __glXDispSwap_PolygonOffset(GLbyte*);
-extern void __glXDispSwap_DrawArrays(GLbyte*);
-extern void __glXDispSwap_Indexubv(GLbyte*);
-extern void __glXDispSwap_ColorSubTable(GLbyte*);
-extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
-extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
-extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
-
-#define __GLX_MIN_GLXCMD_OPCODE 1
-#define __GLX_MAX_GLXCMD_OPCODE 20
-#define __GLX_MIN_RENDER_OPCODE 1
-/*#define __GLX_MAX_RENDER_OPCODE 213*/
-#define __GLX_MAX_RENDER_OPCODE 230
-#define __GLX_MIN_SINGLE_OPCODE 1
-#define __GLX_MAX_SINGLE_OPCODE 159
-#define __GLX_SINGLE_TABLE_SIZE 160
-/*#define __GLX_RENDER_TABLE_SIZE 214*/
-#define __GLX_RENDER_TABLE_SIZE 231
-extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
-extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
-extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
-extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
-#endif /* _GLX_g_disptab_h_ */
diff --git a/GL/glx/g_disptab_EXT.c b/GL/glx/g_disptab_EXT.c
deleted file mode 100644
index 2d8caec92..000000000
--- a/GL/glx/g_disptab_EXT.c
+++ /dev/null
@@ -1,4389 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.c,v 1.4 2003/09/28 20:15:42 alanh Exp $ */
-/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab_EXT.h"
-__GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
- __glXDisp_ColorTable, /* 2053 */
- __glXDisp_ColorTableParameterfv, /* 2054 */
- __glXDisp_ColorTableParameteriv,
- __glXDisp_CopyColorTable,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 2060 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDisp_PointParameterfARB, /* 2065 */
- __glXDisp_PointParameterfvARB, /* 2066 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 2070 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDisp_BlendColor, /* 4096 */
- __glXDisp_BlendEquation, /* 4097 */
- __glXNoSuchRenderOpcode, /* 4098 */
- __glXDisp_TexSubImage1D, /* 4099 */
- __glXDisp_TexSubImage2D, /* 4100 */
- __glXDisp_ConvolutionFilter1D,
- __glXDisp_ConvolutionFilter2D,
- __glXDisp_ConvolutionParameterf,
- __glXDisp_ConvolutionParameterfv,
- __glXDisp_ConvolutionParameteri,
- __glXDisp_ConvolutionParameteriv,
- __glXDisp_CopyConvolutionFilter1D,
- __glXDisp_CopyConvolutionFilter2D,
- __glXDisp_SeparableFilter2D,
- __glXDisp_Histogram, /* 4110 */
- __glXDisp_Minmax,
- __glXDisp_ResetHistogram,
- __glXDisp_ResetMinmax,
- __glXDisp_TexImage3D,
- __glXDisp_TexSubImage3D,
- __glXDisp_DrawArraysEXT,
- __glXDisp_BindTexture,
- __glXDisp_PrioritizeTextures,
- __glXDisp_CopyTexImage1D,
- __glXDisp_CopyTexImage2D, /* 4120 */
- __glXDisp_CopyTexSubImage1D, /* 4121 */
- __glXDisp_CopyTexSubImage2D, /* 4122 */
- __glXDisp_CopyTexSubImage3D, /* 4123 */
- __glXNoSuchRenderOpcode, /* 4124 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4130 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4140 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4150 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4160 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4170 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4180 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4190 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4200 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4210 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4219 */
- __glXDisp_ActiveStencilFaceEXT, /* 4220 */
-};
-__GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
- __glXDisp_AreTexturesResidentEXT, /* 11 */
- __glXDisp_DeleteTexturesEXT, /* 12 */
- __glXDisp_GenTexturesEXT, /* 13 */
- __glXDisp_IsTextureEXT, /* 14 */
-};
-
-
-__GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
- __glXDispSwap_ColorTable, /* 2053 */
- __glXDispSwap_ColorTableParameterfv, /* 2054 */
- __glXDispSwap_ColorTableParameteriv,
- __glXDispSwap_CopyColorTable,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 2060 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_PointParameterfARB, /* 2065 */
- __glXDispSwap_PointParameterfvARB, /* 2066 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 2070 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_BlendColor,
- __glXDispSwap_BlendEquation,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_TexSubImage1D,
- __glXDispSwap_TexSubImage2D,
- __glXDispSwap_ConvolutionFilter1D,
- __glXDispSwap_ConvolutionFilter2D,
- __glXDispSwap_ConvolutionParameterf,
- __glXDispSwap_ConvolutionParameterfv,
- __glXDispSwap_ConvolutionParameteri,
- __glXDispSwap_ConvolutionParameteriv,
- __glXDispSwap_CopyConvolutionFilter1D,
- __glXDispSwap_CopyConvolutionFilter2D,
- __glXDispSwap_SeparableFilter2D,
- __glXDispSwap_Histogram,
- __glXDispSwap_Minmax,
- __glXDispSwap_ResetHistogram,
- __glXDispSwap_ResetMinmax,
- __glXDispSwap_TexImage3D,
- __glXDispSwap_TexSubImage3D,
- __glXDispSwap_DrawArraysEXT,
- __glXDispSwap_BindTexture,
- __glXDispSwap_PrioritizeTextures,
- __glXDispSwap_CopyTexImage1D,
- __glXDispSwap_CopyTexImage2D, /* 4120 */
- __glXDispSwap_CopyTexSubImage1D, /* 4121 */
- __glXDispSwap_CopyTexSubImage2D, /* 4122 */
- __glXDispSwap_CopyTexSubImage3D, /* 4123 */
- __glXNoSuchRenderOpcode, /* 4124 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4130 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4140 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4150 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4160 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4170 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4180 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4190 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4200 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4210 */
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode,
- __glXNoSuchRenderOpcode, /* 4219 */
- __glXDispSwap_ActiveStencilFaceEXT, /* 4220 */
-};
-__GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
- __glXDispSwap_AreTexturesResidentEXT, /* 11 */
- __glXDispSwap_DeleteTexturesEXT, /* 12 */
- __glXDispSwap_GenTexturesEXT, /* 13 */
- __glXDispSwap_IsTextureEXT, /* 14 */
-};
-
diff --git a/GL/glx/g_disptab_EXT.h b/GL/glx/g_disptab_EXT.h
deleted file mode 100644
index d5b67745c..000000000
--- a/GL/glx/g_disptab_EXT.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */
-/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
-#ifndef _GLX_g_disptab_EXT_h_
-#define _GLX_g_disptab_EXT_h_
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-extern int __glXDisp_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
-extern int __glXDisp_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GenTexturesEXT(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsTextureEXT(__GLXclientState*, GLbyte*);
-
-extern void __glXDisp_ColorTable(GLbyte*);
-extern void __glXDisp_ColorTableParameterfv(GLbyte*);
-extern void __glXDisp_ColorTableParameteriv(GLbyte*);
-extern void __glXDisp_CopyColorTable(GLbyte*);
-extern void __glXDisp_BlendColor(GLbyte*);
-extern void __glXDisp_BlendEquation(GLbyte*);
-extern void __glXDisp_TexSubImage1D(GLbyte*);
-extern void __glXDisp_TexSubImage2D(GLbyte*);
-extern void __glXDisp_ConvolutionFilter1D(GLbyte*);
-extern void __glXDisp_ConvolutionFilter2D(GLbyte*);
-extern void __glXDisp_ConvolutionParameterf(GLbyte*);
-extern void __glXDisp_ConvolutionParameterfv(GLbyte*);
-extern void __glXDisp_ConvolutionParameteri(GLbyte*);
-extern void __glXDisp_ConvolutionParameteriv(GLbyte*);
-extern void __glXDisp_CopyConvolutionFilter1D(GLbyte*);
-extern void __glXDisp_CopyConvolutionFilter2D(GLbyte*);
-extern void __glXDisp_SeparableFilter2D(GLbyte*);
-extern void __glXDisp_Histogram(GLbyte*);
-extern void __glXDisp_Minmax(GLbyte*);
-extern void __glXDisp_ResetHistogram(GLbyte*);
-extern void __glXDisp_ResetMinmax(GLbyte*);
-extern void __glXDisp_TexImage3D(GLbyte*);
-extern void __glXDisp_TexSubImage3D(GLbyte*);
-extern void __glXDisp_DrawArraysEXT(GLbyte*);
-extern void __glXDisp_BindTexture(GLbyte*);
-extern void __glXDisp_PrioritizeTextures(GLbyte*);
-extern void __glXDisp_CopyTexImage1D(GLbyte*);
-extern void __glXDisp_CopyTexImage2D(GLbyte*);
-extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
-extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
-extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
-extern void __glXDisp_PointParameterfARB(GLbyte*);
-extern void __glXDisp_PointParameterfvARB(GLbyte*);
-extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
-
-extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GenTexturesEXT(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsTextureEXT(__GLXclientState*, GLbyte*);
-
-extern void __glXDispSwap_ColorTable(GLbyte*);
-extern void __glXDispSwap_ColorTableParameterfv(GLbyte*);
-extern void __glXDispSwap_ColorTableParameteriv(GLbyte*);
-extern void __glXDispSwap_CopyColorTable(GLbyte*);
-extern void __glXDispSwap_BlendColor(GLbyte*);
-extern void __glXDispSwap_BlendEquation(GLbyte*);
-extern void __glXDispSwap_TexSubImage1D(GLbyte*);
-extern void __glXDispSwap_TexSubImage2D(GLbyte*);
-extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
-extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameterf(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameteri(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
-extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
-extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
-extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
-extern void __glXDispSwap_Histogram(GLbyte*);
-extern void __glXDispSwap_Minmax(GLbyte*);
-extern void __glXDispSwap_ResetHistogram(GLbyte*);
-extern void __glXDispSwap_ResetMinmax(GLbyte*);
-extern void __glXDispSwap_TexImage3D(GLbyte*);
-extern void __glXDispSwap_TexSubImage3D(GLbyte*);
-extern void __glXDispSwap_DrawArraysEXT(GLbyte*);
-extern void __glXDispSwap_BindTexture(GLbyte*);
-extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
-extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
-extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
-extern void __glXDispSwap_PointParameterfARB(GLbyte*);
-extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
-extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
-
-#define __GLX_MIN_RENDER_OPCODE_EXT 2053
-#define __GLX_MAX_RENDER_OPCODE_EXT 4220
-#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
-#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
-#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
-#define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
-extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
-extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
-extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
-extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
-#endif /* _GLX_g_disptab_EXT_h_ */
diff --git a/GL/glx/g_render.c b/GL/glx/g_render.c
deleted file mode 100644
index 5e142138e..000000000
--- a/GL/glx/g_render.c
+++ /dev/null
@@ -1,2113 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_render.c,v 1.6 2003/10/28 22:50:17 tsi Exp $ */
-/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-#include "unpack.h"
-#include "impsize.h"
-#include "singlesize.h"
-
-void __glXDisp_CallList(GLbyte *pc)
-{
- glCallList(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_ListBase(GLbyte *pc)
-{
- glListBase(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_Begin(GLbyte *pc)
-{
- glBegin(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3bv(GLbyte *pc)
-{
- glColor3bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glColor3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3fv(GLbyte *pc)
-{
- glColor3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3iv(GLbyte *pc)
-{
- glColor3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3sv(GLbyte *pc)
-{
- glColor3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3ubv(GLbyte *pc)
-{
- glColor3ubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3uiv(GLbyte *pc)
-{
- glColor3uiv(
- (GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_Color3usv(GLbyte *pc)
-{
- glColor3usv(
- (GLushort *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4bv(GLbyte *pc)
-{
- glColor4bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glColor4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4fv(GLbyte *pc)
-{
- glColor4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4iv(GLbyte *pc)
-{
- glColor4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4sv(GLbyte *pc)
-{
- glColor4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4ubv(GLbyte *pc)
-{
- glColor4ubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4uiv(GLbyte *pc)
-{
- glColor4uiv(
- (GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_Color4usv(GLbyte *pc)
-{
- glColor4usv(
- (GLushort *)(pc + 0)
- );
-}
-
-void __glXDisp_EdgeFlagv(GLbyte *pc)
-{
- glEdgeFlagv(
- (GLboolean *)(pc + 0)
- );
-}
-
-void __glXDisp_End(GLbyte *pc)
-{
- glEnd(
- );
-}
-
-void __glXDisp_Indexdv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- glIndexdv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Indexfv(GLbyte *pc)
-{
- glIndexfv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Indexiv(GLbyte *pc)
-{
- glIndexiv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Indexsv(GLbyte *pc)
-{
- glIndexsv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Normal3bv(GLbyte *pc)
-{
- glNormal3bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDisp_Normal3dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glNormal3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Normal3fv(GLbyte *pc)
-{
- glNormal3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Normal3iv(GLbyte *pc)
-{
- glNormal3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Normal3sv(GLbyte *pc)
-{
- glNormal3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos2dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glRasterPos2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos2fv(GLbyte *pc)
-{
- glRasterPos2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos2iv(GLbyte *pc)
-{
- glRasterPos2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos2sv(GLbyte *pc)
-{
- glRasterPos2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos3dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glRasterPos3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos3fv(GLbyte *pc)
-{
- glRasterPos3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos3iv(GLbyte *pc)
-{
- glRasterPos3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos3sv(GLbyte *pc)
-{
- glRasterPos3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos4dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glRasterPos4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos4fv(GLbyte *pc)
-{
- glRasterPos4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos4iv(GLbyte *pc)
-{
- glRasterPos4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_RasterPos4sv(GLbyte *pc)
-{
- glRasterPos4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Rectdv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glRectdv(
- (GLdouble *)(pc + 0),
- (GLdouble *)(pc + 16)
- );
-}
-
-void __glXDisp_Rectfv(GLbyte *pc)
-{
- glRectfv(
- (GLfloat *)(pc + 0),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Rectiv(GLbyte *pc)
-{
- glRectiv(
- (GLint *)(pc + 0),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_Rectsv(GLbyte *pc)
-{
- glRectsv(
- (GLshort *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDisp_TexCoord1dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- glTexCoord1dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord1fv(GLbyte *pc)
-{
- glTexCoord1fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord1iv(GLbyte *pc)
-{
- glTexCoord1iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord1sv(GLbyte *pc)
-{
- glTexCoord1sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord2dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glTexCoord2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord2fv(GLbyte *pc)
-{
- glTexCoord2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord2iv(GLbyte *pc)
-{
- glTexCoord2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord2sv(GLbyte *pc)
-{
- glTexCoord2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord3dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glTexCoord3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord3fv(GLbyte *pc)
-{
- glTexCoord3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord3iv(GLbyte *pc)
-{
- glTexCoord3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord3sv(GLbyte *pc)
-{
- glTexCoord3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord4dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glTexCoord4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord4fv(GLbyte *pc)
-{
- glTexCoord4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord4iv(GLbyte *pc)
-{
- glTexCoord4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_TexCoord4sv(GLbyte *pc)
-{
- glTexCoord4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex2dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glVertex2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex2fv(GLbyte *pc)
-{
- glVertex2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex2iv(GLbyte *pc)
-{
- glVertex2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex2sv(GLbyte *pc)
-{
- glVertex2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex3dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glVertex3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex3fv(GLbyte *pc)
-{
- glVertex3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex3iv(GLbyte *pc)
-{
- glVertex3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex3sv(GLbyte *pc)
-{
- glVertex3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex4dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glVertex4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex4fv(GLbyte *pc)
-{
- glVertex4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex4iv(GLbyte *pc)
-{
- glVertex4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_Vertex4sv(GLbyte *pc)
-{
- glVertex4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDisp_ClipPlane(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
-#endif
- glClipPlane(
- *(GLenum *)(pc + 32),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_ColorMaterial(GLbyte *pc)
-{
- glColorMaterial(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDisp_CullFace(GLbyte *pc)
-{
- glCullFace(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_Fogf(GLbyte *pc)
-{
- glFogf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_Fogfv(GLbyte *pc)
-{
- glFogfv(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_Fogi(GLbyte *pc)
-{
- glFogi(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_Fogiv(GLbyte *pc)
-{
- glFogiv(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_FrontFace(GLbyte *pc)
-{
- glFrontFace(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_Hint(GLbyte *pc)
-{
- glHint(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDisp_Lightf(GLbyte *pc)
-{
- glLightf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Lightfv(GLbyte *pc)
-{
- glLightfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Lighti(GLbyte *pc)
-{
- glLighti(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_Lightiv(GLbyte *pc)
-{
- glLightiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_LightModelf(GLbyte *pc)
-{
- glLightModelf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_LightModelfv(GLbyte *pc)
-{
- glLightModelfv(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_LightModeli(GLbyte *pc)
-{
- glLightModeli(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_LightModeliv(GLbyte *pc)
-{
- glLightModeliv(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_LineStipple(GLbyte *pc)
-{
- glLineStipple(
- *(GLint *)(pc + 0),
- *(GLushort *)(pc + 4)
- );
-}
-
-void __glXDisp_LineWidth(GLbyte *pc)
-{
- glLineWidth(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_Materialf(GLbyte *pc)
-{
- glMaterialf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Materialfv(GLbyte *pc)
-{
- glMaterialfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Materiali(GLbyte *pc)
-{
- glMateriali(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_Materialiv(GLbyte *pc)
-{
- glMaterialiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_PointSize(GLbyte *pc)
-{
- glPointSize(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_PolygonMode(GLbyte *pc)
-{
- glPolygonMode(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDisp_Scissor(GLbyte *pc)
-{
- glScissor(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12)
- );
-}
-
-void __glXDisp_ShadeModel(GLbyte *pc)
-{
- glShadeModel(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_TexParameterf(GLbyte *pc)
-{
- glTexParameterf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexParameterfv(GLbyte *pc)
-{
- glTexParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexParameteri(GLbyte *pc)
-{
- glTexParameteri(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_TexParameteriv(GLbyte *pc)
-{
- glTexParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_TexEnvf(GLbyte *pc)
-{
- glTexEnvf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexEnvfv(GLbyte *pc)
-{
- glTexEnvfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexEnvi(GLbyte *pc)
-{
- glTexEnvi(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_TexEnviv(GLbyte *pc)
-{
- glTexEnviv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_TexGend(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glTexGend(
- *(GLenum *)(pc + 8),
- *(GLenum *)(pc + 12),
- *(GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_TexGendv(GLbyte *pc)
-{
-#ifdef __GLX_ALIGN64
- GLenum pname;
- GLint cmdlen;
- GLint compsize;
-
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGendv_size(pname);
- if (compsize < 0) compsize = 0;
- cmdlen = __GLX_PAD(8+compsize*8);
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, cmdlen);
- pc -= 4;
- }
-#endif
-
- glTexGendv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *)(pc + 8)
- );
-}
-
-void __glXDisp_TexGenf(GLbyte *pc)
-{
- glTexGenf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexGenfv(GLbyte *pc)
-{
- glTexGenfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_TexGeni(GLbyte *pc)
-{
- glTexGeni(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_TexGeniv(GLbyte *pc)
-{
- glTexGeniv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_InitNames(GLbyte *pc)
-{
- glInitNames(
- );
-}
-
-void __glXDisp_LoadName(GLbyte *pc)
-{
- glLoadName(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_PassThrough(GLbyte *pc)
-{
- glPassThrough(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_PopName(GLbyte *pc)
-{
- glPopName(
- );
-}
-
-void __glXDisp_PushName(GLbyte *pc)
-{
- glPushName(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_DrawBuffer(GLbyte *pc)
-{
- glDrawBuffer(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_Clear(GLbyte *pc)
-{
- glClear(
- *(GLbitfield *)(pc + 0)
- );
-}
-
-void __glXDisp_ClearAccum(GLbyte *pc)
-{
- glClearAccum(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLfloat *)(pc + 12)
- );
-}
-
-void __glXDisp_ClearIndex(GLbyte *pc)
-{
- glClearIndex(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_ClearColor(GLbyte *pc)
-{
- glClearColor(
- *(GLclampf *)(pc + 0),
- *(GLclampf *)(pc + 4),
- *(GLclampf *)(pc + 8),
- *(GLclampf *)(pc + 12)
- );
-}
-
-void __glXDisp_ClearStencil(GLbyte *pc)
-{
- glClearStencil(
- *(GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_ClearDepth(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- glClearDepth(
- *(GLclampd *)(pc + 0)
- );
-}
-
-void __glXDisp_StencilMask(GLbyte *pc)
-{
- glStencilMask(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_ColorMask(GLbyte *pc)
-{
- glColorMask(
- *(GLboolean *)(pc + 0),
- *(GLboolean *)(pc + 1),
- *(GLboolean *)(pc + 2),
- *(GLboolean *)(pc + 3)
- );
-}
-
-void __glXDisp_DepthMask(GLbyte *pc)
-{
- glDepthMask(
- *(GLboolean *)(pc + 0)
- );
-}
-
-void __glXDisp_IndexMask(GLbyte *pc)
-{
- glIndexMask(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDisp_Accum(GLbyte *pc)
-{
- glAccum(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_Disable(GLbyte *pc)
-{
- glDisable(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_Enable(GLbyte *pc)
-{
- glEnable(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_PopAttrib(GLbyte *pc)
-{
- glPopAttrib(
- );
-}
-
-void __glXDisp_PushAttrib(GLbyte *pc)
-{
- glPushAttrib(
- *(GLbitfield *)(pc + 0)
- );
-}
-
-void __glXDisp_MapGrid1d(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
-#endif
- glMapGrid1d(
- *(GLint *)(pc + 16),
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8)
- );
-}
-
-void __glXDisp_MapGrid1f(GLbyte *pc)
-{
- glMapGrid1f(
- *(GLint *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_MapGrid2d(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 40);
- pc -= 4;
- }
-#endif
- glMapGrid2d(
- *(GLint *)(pc + 32),
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLint *)(pc + 36),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24)
- );
-}
-
-void __glXDisp_MapGrid2f(GLbyte *pc)
-{
- glMapGrid2f(
- *(GLint *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLfloat *)(pc + 16),
- *(GLfloat *)(pc + 20)
- );
-}
-
-void __glXDisp_EvalCoord1dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- glEvalCoord1dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_EvalCoord1fv(GLbyte *pc)
-{
- glEvalCoord1fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_EvalCoord2dv(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glEvalCoord2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_EvalCoord2fv(GLbyte *pc)
-{
- glEvalCoord2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_EvalMesh1(GLbyte *pc)
-{
- glEvalMesh1(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_EvalPoint1(GLbyte *pc)
-{
- glEvalPoint1(
- *(GLint *)(pc + 0)
- );
-}
-
-void __glXDisp_EvalMesh2(GLbyte *pc)
-{
- glEvalMesh2(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16)
- );
-}
-
-void __glXDisp_EvalPoint2(GLbyte *pc)
-{
- glEvalPoint2(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_AlphaFunc(GLbyte *pc)
-{
- glAlphaFunc(
- *(GLenum *)(pc + 0),
- *(GLclampf *)(pc + 4)
- );
-}
-
-void __glXDisp_BlendFunc(GLbyte *pc)
-{
- glBlendFunc(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDisp_LogicOp(GLbyte *pc)
-{
- glLogicOp(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_StencilFunc(GLbyte *pc)
-{
- glStencilFunc(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLuint *)(pc + 8)
- );
-}
-
-void __glXDisp_StencilOp(GLbyte *pc)
-{
- glStencilOp(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8)
- );
-}
-
-void __glXDisp_DepthFunc(GLbyte *pc)
-{
- glDepthFunc(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_PixelZoom(GLbyte *pc)
-{
- glPixelZoom(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_PixelTransferf(GLbyte *pc)
-{
- glPixelTransferf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_PixelTransferi(GLbyte *pc)
-{
- glPixelTransferi(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_PixelMapfv(GLbyte *pc)
-{
- glPixelMapfv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_PixelMapuiv(GLbyte *pc)
-{
- glPixelMapuiv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLuint *)(pc + 8)
- );
-}
-
-void __glXDisp_PixelMapusv(GLbyte *pc)
-{
- glPixelMapusv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLushort *)(pc + 8)
- );
-}
-
-void __glXDisp_ReadBuffer(GLbyte *pc)
-{
- glReadBuffer(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_CopyPixels(GLbyte *pc)
-{
- glCopyPixels(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12),
- *(GLenum *)(pc + 16)
- );
-}
-
-void __glXDisp_DepthRange(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- glDepthRange(
- *(GLclampd *)(pc + 0),
- *(GLclampd *)(pc + 8)
- );
-}
-
-void __glXDisp_Frustum(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
-#endif
- glFrustum(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24),
- *(GLdouble *)(pc + 32),
- *(GLdouble *)(pc + 40)
- );
-}
-
-void __glXDisp_LoadIdentity(GLbyte *pc)
-{
- glLoadIdentity(
- );
-}
-
-void __glXDisp_LoadMatrixf(GLbyte *pc)
-{
- glLoadMatrixf(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_LoadMatrixd(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
-#endif
- glLoadMatrixd(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_MatrixMode(GLbyte *pc)
-{
- glMatrixMode(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_MultMatrixf(GLbyte *pc)
-{
- glMultMatrixf(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDisp_MultMatrixd(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
-#endif
- glMultMatrixd(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_Ortho(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
-#endif
- glOrtho(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24),
- *(GLdouble *)(pc + 32),
- *(GLdouble *)(pc + 40)
- );
-}
-
-void __glXDisp_PopMatrix(GLbyte *pc)
-{
- glPopMatrix(
- );
-}
-
-void __glXDisp_PushMatrix(GLbyte *pc)
-{
- glPushMatrix(
- );
-}
-
-void __glXDisp_Rotated(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- glRotated(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24)
- );
-}
-
-void __glXDisp_Rotatef(GLbyte *pc)
-{
- glRotatef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLfloat *)(pc + 12)
- );
-}
-
-void __glXDisp_Scaled(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glScaled(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16)
- );
-}
-
-void __glXDisp_Scalef(GLbyte *pc)
-{
- glScalef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Translated(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- glTranslated(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16)
- );
-}
-
-void __glXDisp_Translatef(GLbyte *pc)
-{
- glTranslatef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_Viewport(GLbyte *pc)
-{
- glViewport(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12)
- );
-}
-
-void __glXDisp_PolygonOffset(GLbyte *pc)
-{
- glPolygonOffset(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_CopyTexImage1D(GLbyte *pc)
-{
- glCopyTexImage1D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20),
- *(GLint *)(pc + 24)
- );
-}
-
-void __glXDisp_CopyTexImage2D(GLbyte *pc)
-{
- glCopyTexImage2D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20),
- *(GLsizei *)(pc + 24),
- *(GLint *)(pc + 28)
- );
-}
-
-void __glXDisp_CopyTexSubImage1D(GLbyte *pc)
-{
- glCopyTexSubImage1D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20)
- );
-}
-
-void __glXDisp_CopyTexSubImage2D(GLbyte *pc)
-{
- glCopyTexSubImage2D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLint *)(pc + 20),
- *(GLsizei *)(pc + 24),
- *(GLsizei *)(pc + 28)
- );
-}
-
-void __glXDisp_BindTexture(GLbyte *pc)
-{
- glBindTexture(
- *(GLenum *)(pc + 0),
- *(GLuint *)(pc + 4)
- );
-}
-
-void __glXDisp_PrioritizeTextures(GLbyte *pc)
-{
- GLsizei n;
-
- n = *(GLsizei *)(pc + 0);
-
- glPrioritizeTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLclampf *)(pc + 4+n*4)
- );
-}
-
-void __glXDisp_Indexubv(GLbyte *pc)
-{
- glIndexubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDisp_BlendColor(GLbyte *pc)
-{
- glBlendColor(
- *(GLclampf *)(pc + 0),
- *(GLclampf *)(pc + 4),
- *(GLclampf *)(pc + 8),
- *(GLclampf *)(pc + 12)
- );
-}
-
-void __glXDisp_BlendEquation(GLbyte *pc)
-{
- glBlendEquation(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_ColorTableParameterfv(GLbyte *pc)
-{
- glColorTableParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_ColorTableParameteriv(GLbyte *pc)
-{
- glColorTableParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_CopyColorTable(GLbyte *pc)
-{
- glCopyColorTable(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDisp_CopyColorSubTable(GLbyte *pc)
-{
- glCopyColorSubTable(
- *(GLenum *)(pc + 0),
- *(GLsizei *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDisp_ConvolutionParameterf(GLbyte *pc)
-{
- glConvolutionParameterf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_ConvolutionParameterfv(GLbyte *pc)
-{
- glConvolutionParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDisp_ConvolutionParameteri(GLbyte *pc)
-{
- glConvolutionParameteri(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_ConvolutionParameteriv(GLbyte *pc)
-{
- glConvolutionParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDisp_CopyConvolutionFilter1D(GLbyte *pc)
-{
- glCopyConvolutionFilter1D(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDisp_CopyConvolutionFilter2D(GLbyte *pc)
-{
- glCopyConvolutionFilter2D(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16),
- *(GLsizei *)(pc + 20)
- );
-}
-
-void __glXDisp_Histogram(GLbyte *pc)
-{
- glHistogram(
- *(GLenum *)(pc + 0),
- *(GLsizei *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLboolean *)(pc + 12)
- );
-}
-
-void __glXDisp_Minmax(GLbyte *pc)
-{
- glMinmax(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLboolean *)(pc + 8)
- );
-}
-
-void __glXDisp_ResetHistogram(GLbyte *pc)
-{
- glResetHistogram(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_ResetMinmax(GLbyte *pc)
-{
- glResetMinmax(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_CopyTexSubImage3D(GLbyte *pc)
-{
- glCopyTexSubImage3D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLint *)(pc + 20),
- *(GLint *)(pc + 24),
- *(GLsizei *)(pc + 28),
- *(GLsizei *)(pc + 32)
- );
-}
-
-void __glXDisp_ActiveTextureARB(GLbyte *pc)
-{
- glActiveTextureARB(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_MultiTexCoord1dvARB(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 12);
- pc -= 4;
- }
-#endif
- glMultiTexCoord1dvARB(
- *(GLenum *)(pc + 8),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_MultiTexCoord1fvARB(GLbyte *pc)
-{
- glMultiTexCoord1fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord1ivARB(GLbyte *pc)
-{
- glMultiTexCoord1ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord1svARB(GLbyte *pc)
-{
- glMultiTexCoord1svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord2dvARB(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
-#endif
- glMultiTexCoord2dvARB(
- *(GLenum *)(pc + 16),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_MultiTexCoord2fvARB(GLbyte *pc)
-{
- glMultiTexCoord2fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord2ivARB(GLbyte *pc)
-{
- glMultiTexCoord2ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord2svARB(GLbyte *pc)
-{
- glMultiTexCoord2svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord3dvARB(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 28);
- pc -= 4;
- }
-#endif
- glMultiTexCoord3dvARB(
- *(GLenum *)(pc + 24),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_MultiTexCoord3fvARB(GLbyte *pc)
-{
- glMultiTexCoord3fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord3ivARB(GLbyte *pc)
-{
- glMultiTexCoord3ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord3svARB(GLbyte *pc)
-{
- glMultiTexCoord3svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord4dvARB(GLbyte *pc)
-{
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
-#endif
- glMultiTexCoord4dvARB(
- *(GLenum *)(pc + 32),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDisp_MultiTexCoord4fvARB(GLbyte *pc)
-{
- glMultiTexCoord4fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord4ivARB(GLbyte *pc)
-{
- glMultiTexCoord4ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDisp_MultiTexCoord4svARB(GLbyte *pc)
-{
- glMultiTexCoord4svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-
-/*
- * Extensions
- */
-
-void __glXDisp_PointParameterfARB(GLbyte *pc)
-{
- glPointParameterfARB(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-
-void __glXDisp_PointParameterfvARB(GLbyte *pc)
-{
- glPointParameterfvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDisp_ActiveStencilFaceEXT(GLbyte *pc)
-{
- glActiveStencilFaceEXT(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDisp_WindowPos3fARB(GLbyte *pc)
-{
- glWindowPos3fARB(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
diff --git a/GL/glx/g_renderswap.c b/GL/glx/g_renderswap.c
deleted file mode 100644
index a03db7599..000000000
--- a/GL/glx/g_renderswap.c
+++ /dev/null
@@ -1,3368 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_renderswap.c,v 1.7 2003/10/28 22:50:17 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-#include "unpack.h"
-#include "impsize.h"
-#include "singlesize.h"
-
-void __glXDispSwap_CallList(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glCallList(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ListBase(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glListBase(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Begin(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glBegin(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3bv(GLbyte *pc)
-{
- glColor3bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glColor3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
-
- glColor3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glColor3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glColor3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3ubv(GLbyte *pc)
-{
- glColor3ubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3uiv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glColor3uiv(
- (GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color3usv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glColor3usv(
- (GLushort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4bv(GLbyte *pc)
-{
- glColor4bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glColor4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
-
- glColor4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
-
- glColor4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
-
- glColor4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4ubv(GLbyte *pc)
-{
- glColor4ubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4uiv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
-
- glColor4uiv(
- (GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Color4usv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
-
- glColor4usv(
- (GLushort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EdgeFlagv(GLbyte *pc)
-{
- glEdgeFlagv(
- (GLboolean *)(pc + 0)
- );
-}
-
-void __glXDispSwap_End(GLbyte *pc)
-{
- glEnd(
- );
-}
-
-void __glXDispSwap_Indexdv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
-
- glIndexdv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Indexfv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
-
- glIndexfv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Indexiv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 1);
-
- glIndexiv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Indexsv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
-
- glIndexsv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Normal3bv(GLbyte *pc)
-{
- glNormal3bv(
- (GLbyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Normal3dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glNormal3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Normal3fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
-
- glNormal3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Normal3iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glNormal3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Normal3sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glNormal3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos2dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
-
- glRasterPos2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos2fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
-
- glRasterPos2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos2iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
-
- glRasterPos2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos2sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
-
- glRasterPos2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos3dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glRasterPos3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos3fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
-
- glRasterPos3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos3iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glRasterPos3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos3sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glRasterPos3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos4dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glRasterPos4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos4fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
-
- glRasterPos4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos4iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
-
- glRasterPos4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_RasterPos4sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
-
- glRasterPos4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Rectdv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 16, 2);
-
- glRectdv(
- (GLdouble *)(pc + 0),
- (GLdouble *)(pc + 16)
- );
-}
-
-void __glXDispSwap_Rectfv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, 2);
-
- glRectfv(
- (GLfloat *)(pc + 0),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Rectiv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
- __GLX_SWAP_INT_ARRAY(pc + 8, 2);
-
- glRectiv(
- (GLint *)(pc + 0),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Rectsv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
-
- glRectsv(
- (GLshort *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDispSwap_TexCoord1dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
-
- glTexCoord1dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord1fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
-
- glTexCoord1fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord1iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 1);
-
- glTexCoord1iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord1sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
-
- glTexCoord1sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord2dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
-
- glTexCoord2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord2fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
-
- glTexCoord2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord2iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
-
- glTexCoord2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord2sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
-
- glTexCoord2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord3dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glTexCoord3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord3fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
-
- glTexCoord3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord3iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glTexCoord3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord3sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glTexCoord3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord4dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glTexCoord4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord4fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
-
- glTexCoord4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord4iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
-
- glTexCoord4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexCoord4sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
-
- glTexCoord4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex2dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
-
- glVertex2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex2fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
-
- glVertex2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex2iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
-
- glVertex2iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex2sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
-
- glVertex2sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex3dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glVertex3dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex3fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
-
- glVertex3fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex3iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
-
- glVertex3iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex3sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
-
- glVertex3sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex4dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glVertex4dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex4fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
-
- glVertex4fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex4iv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
-
- glVertex4iv(
- (GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Vertex4sv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
-
- glVertex4sv(
- (GLshort *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ClipPlane(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glClipPlane(
- *(GLenum *)(pc + 32),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ColorMaterial(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glColorMaterial(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDispSwap_CullFace(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glCullFace(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Fogf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glFogf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Fogfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glFogfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
-
- glFogfv(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Fogi(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glFogi(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Fogiv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glFogiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
-
- glFogiv(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_FrontFace(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glFrontFace(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Hint(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glHint(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Lightf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glLightf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Lightfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glLightfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glLightfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Lighti(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glLighti(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Lightiv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glLightiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glLightiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_LightModelf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glLightModelf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LightModelfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glLightModelfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
-
- glLightModelfv(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LightModeli(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glLightModeli(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LightModeliv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glLightModeliv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
-
- glLightModeliv(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LineStipple(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT(pc + 4);
-
- glLineStipple(
- *(GLint *)(pc + 0),
- *(GLushort *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LineWidth(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
-
- glLineWidth(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Materialf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glMaterialf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Materialfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glMaterialfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glMaterialfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Materiali(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glMateriali(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Materialiv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glMaterialiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glMaterialiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_PointSize(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
-
- glPointSize(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_PolygonMode(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glPolygonMode(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Scissor(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
-
- glScissor(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12)
- );
-}
-
-void __glXDispSwap_ShadeModel(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glShadeModel(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexParameterf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glTexParameterf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexParameterfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glTexParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexParameteri(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glTexParameteri(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexParameteriv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glTexParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexEnvf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glTexEnvf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexEnvfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexEnvfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glTexEnvfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexEnvi(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glTexEnvi(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexEnviv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexEnviv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glTexEnviv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexGend(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_DOUBLE(pc + 0);
-
- glTexGend(
- *(GLenum *)(pc + 8),
- *(GLenum *)(pc + 12),
- *(GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_TexGendv(GLbyte *pc)
-{
- GLenum pname;
-#ifdef __GLX_ALIGN64
- GLint cmdlen;
-#endif
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGendv_size(pname);
- if (compsize < 0) compsize = 0;
-
-#ifdef __GLX_ALIGN64
- cmdlen = __GLX_PAD(8+compsize*8);
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, cmdlen);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 8, compsize);
-
- glTexGendv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexGenf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glTexGenf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexGenfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGenfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glTexGenfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexGeni(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glTexGeni(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_TexGeniv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGeniv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glTexGeniv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_InitNames(GLbyte *pc)
-{
- glInitNames(
- );
-}
-
-void __glXDispSwap_LoadName(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glLoadName(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_PassThrough(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
-
- glPassThrough(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_PopName(GLbyte *pc)
-{
- glPopName(
- );
-}
-
-void __glXDispSwap_PushName(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glPushName(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_DrawBuffer(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glDrawBuffer(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Clear(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glClear(
- *(GLbitfield *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ClearAccum(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
-
- glClearAccum(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLfloat *)(pc + 12)
- );
-}
-
-void __glXDispSwap_ClearIndex(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
-
- glClearIndex(
- *(GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ClearColor(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
-
- glClearColor(
- *(GLclampf *)(pc + 0),
- *(GLclampf *)(pc + 4),
- *(GLclampf *)(pc + 8),
- *(GLclampf *)(pc + 12)
- );
-}
-
-void __glXDispSwap_ClearStencil(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glClearStencil(
- *(GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ClearDepth(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
-
- glClearDepth(
- *(GLclampd *)(pc + 0)
- );
-}
-
-void __glXDispSwap_StencilMask(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glStencilMask(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ColorMask(GLbyte *pc)
-{
- glColorMask(
- *(GLboolean *)(pc + 0),
- *(GLboolean *)(pc + 1),
- *(GLboolean *)(pc + 2),
- *(GLboolean *)(pc + 3)
- );
-}
-
-void __glXDispSwap_DepthMask(GLbyte *pc)
-{
- glDepthMask(
- *(GLboolean *)(pc + 0)
- );
-}
-
-void __glXDispSwap_IndexMask(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glIndexMask(
- *(GLuint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Accum(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glAccum(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_Disable(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glDisable(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Enable(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glEnable(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_PopAttrib(GLbyte *pc)
-{
- glPopAttrib(
- );
-}
-
-void __glXDispSwap_PushAttrib(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glPushAttrib(
- *(GLbitfield *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MapGrid1d(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
-
- glMapGrid1d(
- *(GLint *)(pc + 16),
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8)
- );
-}
-
-void __glXDispSwap_MapGrid1f(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glMapGrid1f(
- *(GLint *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_MapGrid2d(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 40);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_INT(pc + 36);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
-
- glMapGrid2d(
- *(GLint *)(pc + 32),
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLint *)(pc + 36),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24)
- );
-}
-
-void __glXDispSwap_MapGrid2f(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_FLOAT(pc + 16);
- __GLX_SWAP_FLOAT(pc + 20);
-
- glMapGrid2f(
- *(GLint *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLfloat *)(pc + 16),
- *(GLfloat *)(pc + 20)
- );
-}
-
-void __glXDispSwap_EvalCoord1dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
-
- glEvalCoord1dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EvalCoord1fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
-
- glEvalCoord1fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EvalCoord2dv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
-
- glEvalCoord2dv(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EvalCoord2fv(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
-
- glEvalCoord2fv(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EvalMesh1(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glEvalMesh1(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_EvalPoint1(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glEvalPoint1(
- *(GLint *)(pc + 0)
- );
-}
-
-void __glXDispSwap_EvalMesh2(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- glEvalMesh2(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16)
- );
-}
-
-void __glXDispSwap_EvalPoint2(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glEvalPoint2(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_AlphaFunc(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glAlphaFunc(
- *(GLenum *)(pc + 0),
- *(GLclampf *)(pc + 4)
- );
-}
-
-void __glXDispSwap_BlendFunc(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glBlendFunc(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
-}
-
-void __glXDispSwap_LogicOp(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glLogicOp(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_StencilFunc(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glStencilFunc(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLuint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_StencilOp(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glStencilOp(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8)
- );
-}
-
-void __glXDispSwap_DepthFunc(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glDepthFunc(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_PixelZoom(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glPixelZoom(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_PixelTransferf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glPixelTransferf(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_PixelTransferi(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glPixelTransferi(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_PixelMapfv(GLbyte *pc)
-{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, mapsize);
-
- glPixelMapfv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_PixelMapuiv(GLbyte *pc)
-{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, mapsize);
-
- glPixelMapuiv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLuint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_PixelMapusv(GLbyte *pc)
-{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 8, mapsize);
-
- glPixelMapusv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- (GLushort *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ReadBuffer(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glReadBuffer(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_CopyPixels(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- glCopyPixels(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12),
- *(GLenum *)(pc + 16)
- );
-}
-
-void __glXDispSwap_DepthRange(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
-
- glDepthRange(
- *(GLclampd *)(pc + 0),
- *(GLclampd *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Frustum(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
- __GLX_SWAP_DOUBLE(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 40);
-
- glFrustum(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24),
- *(GLdouble *)(pc + 32),
- *(GLdouble *)(pc + 40)
- );
-}
-
-void __glXDispSwap_LoadIdentity(GLbyte *pc)
-{
- glLoadIdentity(
- );
-}
-
-void __glXDispSwap_LoadMatrixf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
-
- glLoadMatrixf(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_LoadMatrixd(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
-
- glLoadMatrixd(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MatrixMode(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glMatrixMode(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultMatrixf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
-
- glMultMatrixf(
- (GLfloat *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultMatrixd(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
-
- glMultMatrixd(
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_Ortho(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
- __GLX_SWAP_DOUBLE(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 40);
-
- glOrtho(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24),
- *(GLdouble *)(pc + 32),
- *(GLdouble *)(pc + 40)
- );
-}
-
-void __glXDispSwap_PopMatrix(GLbyte *pc)
-{
- glPopMatrix(
- );
-}
-
-void __glXDispSwap_PushMatrix(GLbyte *pc)
-{
- glPushMatrix(
- );
-}
-
-void __glXDispSwap_Rotated(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
-
- glRotated(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16),
- *(GLdouble *)(pc + 24)
- );
-}
-
-void __glXDispSwap_Rotatef(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
-
- glRotatef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8),
- *(GLfloat *)(pc + 12)
- );
-}
-
-void __glXDispSwap_Scaled(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
-
- glScaled(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16)
- );
-}
-
-void __glXDispSwap_Scalef(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glScalef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Translated(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
-
- glTranslated(
- *(GLdouble *)(pc + 0),
- *(GLdouble *)(pc + 8),
- *(GLdouble *)(pc + 16)
- );
-}
-
-void __glXDispSwap_Translatef(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glTranslatef(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_Viewport(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
-
- glViewport(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12)
- );
-}
-
-void __glXDispSwap_PolygonOffset(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glPolygonOffset(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_CopyTexImage1D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
-
- glCopyTexImage1D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20),
- *(GLint *)(pc + 24)
- );
-}
-
-void __glXDispSwap_CopyTexImage2D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
-
- glCopyTexImage2D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20),
- *(GLsizei *)(pc + 24),
- *(GLint *)(pc + 28)
- );
-}
-
-void __glXDispSwap_CopyTexSubImage1D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
-
- glCopyTexSubImage1D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLsizei *)(pc + 20)
- );
-}
-
-void __glXDispSwap_CopyTexSubImage2D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
-
- glCopyTexSubImage2D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLint *)(pc + 20),
- *(GLsizei *)(pc + 24),
- *(GLsizei *)(pc + 28)
- );
-}
-
-void __glXDispSwap_BindTexture(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glBindTexture(
- *(GLenum *)(pc + 0),
- *(GLuint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_PrioritizeTextures(GLbyte *pc)
-{
- GLsizei n;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4+n*4, n);
-
- glPrioritizeTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLclampf *)(pc + 4+n*4)
- );
-}
-
-void __glXDispSwap_Indexubv(GLbyte *pc)
-{
- glIndexubv(
- (GLubyte *)(pc + 0)
- );
-}
-
-void __glXDispSwap_BlendColor(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
-
- glBlendColor(
- *(GLclampf *)(pc + 0),
- *(GLclampf *)(pc + 4),
- *(GLclampf *)(pc + 8),
- *(GLclampf *)(pc + 12)
- );
-}
-
-void __glXDispSwap_BlendEquation(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glBlendEquation(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ColorTableParameterfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glColorTableParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glColorTableParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ColorTableParameteriv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glColorTableParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glColorTableParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_CopyColorTable(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- glCopyColorTable(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDispSwap_CopyColorSubTable(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- glCopyColorSubTable(
- *(GLenum *)(pc + 0),
- *(GLsizei *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDispSwap_ConvolutionParameterf(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- glConvolutionParameterf(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ConvolutionParameterfv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glConvolutionParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
-
- glConvolutionParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ConvolutionParameteri(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glConvolutionParameteri(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ConvolutionParameteriv(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glConvolutionParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
-
- glConvolutionParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *)(pc + 8)
- );
-}
-
-void __glXDispSwap_CopyConvolutionFilter1D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- glCopyConvolutionFilter1D(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16)
- );
-}
-
-void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
-
- glCopyConvolutionFilter2D(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLsizei *)(pc + 16),
- *(GLsizei *)(pc + 20)
- );
-}
-
-void __glXDispSwap_Histogram(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
-
- glHistogram(
- *(GLenum *)(pc + 0),
- *(GLsizei *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLboolean *)(pc + 12)
- );
-}
-
-void __glXDispSwap_Minmax(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glMinmax(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLboolean *)(pc + 8)
- );
-}
-
-void __glXDispSwap_ResetHistogram(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glResetHistogram(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_ResetMinmax(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glResetMinmax(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_CopyTexSubImage3D(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
- __GLX_SWAP_INT(pc + 32);
-
- glCopyTexSubImage3D(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLint *)(pc + 8),
- *(GLint *)(pc + 12),
- *(GLint *)(pc + 16),
- *(GLint *)(pc + 20),
- *(GLint *)(pc + 24),
- *(GLsizei *)(pc + 28),
- *(GLsizei *)(pc + 32)
- );
-}
-
-void __glXDispSwap_ActiveTextureARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glActiveTextureARB(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultiTexCoord1dvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 12);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
-
- glMultiTexCoord1dvARB(
- *(GLenum *)(pc + 8),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultiTexCoord1fvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 1);
-
- glMultiTexCoord1fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord1ivARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 1);
-
- glMultiTexCoord1ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord1svARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 1);
-
- glMultiTexCoord1svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord2dvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
-
- glMultiTexCoord2dvARB(
- *(GLenum *)(pc + 16),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultiTexCoord2fvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 2);
-
- glMultiTexCoord2fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord2ivARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 2);
-
- glMultiTexCoord2ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord2svARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
-
- glMultiTexCoord2svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord3dvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 28);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
-
- glMultiTexCoord3dvARB(
- *(GLenum *)(pc + 24),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultiTexCoord3fvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 3);
-
- glMultiTexCoord3fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord3ivARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 3);
-
- glMultiTexCoord3ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord3svARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 3);
-
- glMultiTexCoord3svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord4dvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
-#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
-#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
-
- glMultiTexCoord4dvARB(
- *(GLenum *)(pc + 32),
- (GLdouble *)(pc + 0)
- );
-}
-
-void __glXDispSwap_MultiTexCoord4fvARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 4);
-
- glMultiTexCoord4fvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord4ivARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 4);
-
- glMultiTexCoord4ivARB(
- *(GLenum *)(pc + 0),
- (GLint *)(pc + 4)
- );
-}
-
-void __glXDispSwap_MultiTexCoord4svARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 4);
-
- glMultiTexCoord4svARB(
- *(GLenum *)(pc + 0),
- (GLshort *)(pc + 4)
- );
-}
-
-
-/*
- * Extensions
- */
-
-void __glXDispSwap_PointParameterfARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- glPointParameterfARB(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_PointParameterfvARB(GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glPointParameterfvARB_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
-
- glPointParameterfvARB(
- *(GLenum *)(pc + 0),
- (GLfloat *)(pc + 4)
- );
-}
-
-void __glXDispSwap_ActiveStencilFaceEXT(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
-
- glActiveStencilFaceEXT(
- *(GLenum *)(pc + 0)
- );
-}
-
-void __glXDispSwap_WindowPos3fARB(GLbyte *pc)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- glWindowPos3fARB(
- *(GLfloat *)(pc + 0),
- *(GLfloat *)(pc + 4),
- *(GLfloat *)(pc + 8)
- );
-}
diff --git a/GL/glx/g_single.c b/GL/glx/g_single.c
deleted file mode 100644
index 5bcec133c..000000000
--- a/GL/glx/g_single.c
+++ /dev/null
@@ -1,1783 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_single.c,v 1.6 2003/10/28 22:50:17 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-#include "unpack.h"
-#include "impsize.h"
-#include "singlesize.h"
-
-int __glXDisp_NewList(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- glNewList(
- *(GLuint *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_EndList(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- glEndList(
- );
- return Success;
-}
-
-int __glXDisp_DeleteLists(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- glDeleteLists(
- *(GLuint *)(pc + 0),
- *(GLsizei *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_GenLists(__GLXclientState *cl, GLbyte *pc)
-{
- GLuint retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- retval =
- glGenLists(
- *(GLsizei *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDisp_PixelStoref(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- glPixelStoref(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_PixelStorei(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- glPixelStorei(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_GetBooleanv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetBooleanv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetBooleanv(
- *(GLenum *)(pc + 0),
- (GLboolean *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_BYTE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetDoublev(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetDoublev_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetDoublev(
- *(GLenum *)(pc + 0),
- (GLdouble *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetError(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- retval =
- glGetError(
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDisp_GetFloatv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetFloatv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetFloatv(
- *(GLenum *)(pc + 0),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetIntegerv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetIntegerv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetIntegerv(
- *(GLenum *)(pc + 0),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetLightfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetLightfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetLightfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetLightiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetLightiv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetLightiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMapdv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapdv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetMapdv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMapfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapfv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMapfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMapiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapiv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMapiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMaterialfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMaterialfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMaterialfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMaterialiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMaterialiv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMaterialiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetPixelMapfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapfv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetPixelMapfv(
- *(GLenum *)(pc + 0),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetPixelMapuiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapuiv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetPixelMapuiv(
- *(GLenum *)(pc + 0),
- (GLuint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetPixelMapusv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLushort answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapusv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
- __glXClearErrorOccured();
- glGetPixelMapusv(
- *(GLenum *)(pc + 0),
- (GLushort *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_SHORT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*2);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_SHORT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexEnvfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexEnvfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexEnvfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexEnviv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexEnviv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexEnviv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexGendv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGendv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetTexGendv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexGenfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGenfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexGenfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexGeniv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGeniv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexGeniv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexLevelParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 8);
- compsize = __glGetTexLevelParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexLevelParameterfv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexLevelParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 8);
- compsize = __glGetTexLevelParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexLevelParameteriv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_IsEnabled(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- retval =
- glIsEnabled(
- *(GLenum *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDisp_IsList(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- retval =
- glIsList(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDisp_AreTexturesResident(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
- retval =
- glAreTexturesResident(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLboolean *) answer
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(n);
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(n);
- return Success;
-}
-
-int __glXDisp_DeleteTextures(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- glDeleteTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4)
- );
- return Success;
-}
-
-int __glXDisp_GenTextures(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
- glGenTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *) answer
- );
- __GLX_BEGIN_REPLY(n*4);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(n);
- return Success;
-}
-
-int __glXDisp_IsTexture(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- retval =
- glIsTexture(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDisp_GetColorTableParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetColorTableParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetColorTableParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetColorTableParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetColorTableParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetColorTableParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetConvolutionParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetConvolutionParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetConvolutionParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetConvolutionParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetConvolutionParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetConvolutionParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetHistogramParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetHistogramParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetHistogramParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetHistogramParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetHistogramParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetHistogramParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMinmaxParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMinmaxParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMinmaxParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetMinmaxParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMinmaxParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMinmaxParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_SIZE(1);
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_PUT_SIZE(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_AreTexturesResidentEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
- retval =
- glAreTexturesResidentEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLboolean *) answer
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(n);
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(n);
- return Success;
-}
-
-int __glXDisp_DeleteTexturesEXT(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- glDeleteTexturesEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4)
- );
- return Success;
-}
-
-int __glXDisp_GenTexturesEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
- glGenTexturesEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *) answer
- );
- __GLX_BEGIN_REPLY(n*4);
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(n);
- return Success;
-}
-
-int __glXDisp_IsTextureEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- retval =
- glIsTextureEXT(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
diff --git a/GL/glx/g_singleswap.c b/GL/glx/g_singleswap.c
deleted file mode 100644
index 34515997e..000000000
--- a/GL/glx/g_singleswap.c
+++ /dev/null
@@ -1,2204 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/g_singleswap.c,v 1.5 2002/01/14 22:47:08 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-#include "unpack.h"
-#include "impsize.h"
-#include "singlesize.h"
-
-int __glXDispSwap_NewList(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glNewList(
- *(GLuint *)(pc + 0),
- *(GLenum *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_EndList(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- glEndList(
- );
- return Success;
-}
-
-int __glXDispSwap_DeleteLists(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glDeleteLists(
- *(GLuint *)(pc + 0),
- *(GLsizei *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_GenLists(__GLXclientState *cl, GLbyte *pc)
-{
- GLuint retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- retval =
- glGenLists(
- *(GLsizei *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDispSwap_PixelStoref(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
-
- glPixelStoref(
- *(GLenum *)(pc + 0),
- *(GLfloat *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_PixelStorei(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- glPixelStorei(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4)
- );
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_GetBooleanv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetBooleanv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetBooleanv(
- *(GLenum *)(pc + 0),
- (GLboolean *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_BYTE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetDoublev(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetDoublev_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetDoublev(
- *(GLenum *)(pc + 0),
- (GLdouble *) answer
- );
- __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetError(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- retval =
- glGetError(
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDispSwap_GetFloatv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetFloatv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetFloatv(
- *(GLenum *)(pc + 0),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetIntegerv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glGetIntegerv_size(pname);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetIntegerv(
- *(GLenum *)(pc + 0),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetLightfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetLightfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetLightfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetLightiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetLightiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetLightiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMapdv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapdv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetMapdv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *) answer
- );
- __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMapfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapfv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMapfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMapiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum target;
- GLenum query;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- target = *(GLenum *)(pc + 0);
- query = *(GLenum *)(pc + 4);
- compsize = __glGetMapiv_size(target,query);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMapiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMaterialfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMaterialfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMaterialfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMaterialiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMaterialiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMaterialiv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetPixelMapfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapfv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetPixelMapfv(
- *(GLenum *)(pc + 0),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetPixelMapuiv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapuiv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetPixelMapuiv(
- *(GLenum *)(pc + 0),
- (GLuint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetPixelMapusv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum map;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLushort answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- map = *(GLenum *)(pc + 0);
- compsize = __glGetPixelMapusv_size(map);
- if (compsize < 0) compsize = 0;
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
- __glXClearErrorOccured();
- glGetPixelMapusv(
- *(GLenum *)(pc + 0),
- (GLushort *) answer
- );
- __GLX_SWAP_SHORT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_SHORT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*2);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_SHORT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexEnvfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexEnvfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexEnvfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexEnviv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexEnviv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexEnviv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexGendv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGendv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
- __glXClearErrorOccured();
- glGetTexGendv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLdouble *) answer
- );
- __GLX_SWAP_DOUBLE_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_DOUBLE();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*8);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexGenfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGenfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexGenfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexGeniv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexGeniv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexGeniv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetTexParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 8);
- pname = *(GLenum *)(pc + 8);
- compsize = __glGetTexLevelParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexLevelParameterfv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 8);
- pname = *(GLenum *)(pc + 8);
- compsize = __glGetTexLevelParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetTexLevelParameteriv(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_IsEnabled(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- retval =
- glIsEnabled(
- *(GLenum *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDispSwap_IsList(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- retval =
- glIsList(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDispSwap_AreTexturesResident(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
- retval =
- glAreTexturesResident(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLboolean *) answer
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(n);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(n);
- return Success;
-}
-
-int __glXDispSwap_DeleteTextures(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
-
- glDeleteTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4)
- );
- return Success;
-}
-
-int __glXDispSwap_GenTextures(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
- glGenTextures(
- *(GLsizei *)(pc + 0),
- (GLuint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, n);
- __GLX_BEGIN_REPLY(n*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(n);
- return Success;
-}
-
-int __glXDispSwap_IsTexture(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- retval =
- glIsTexture(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
-int __glXDispSwap_GetColorTableParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetColorTableParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetColorTableParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetColorTableParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetColorTableParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetColorTableParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetConvolutionParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetConvolutionParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetConvolutionParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetConvolutionParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetHistogramParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetHistogramParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetHistogramParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetHistogramParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetHistogramParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetHistogramParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLfloat answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMinmaxParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMinmaxParameterfv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLfloat *) answer
- );
- __GLX_SWAP_FLOAT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_FLOAT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_FLOAT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState *cl, GLbyte *pc)
-{
- GLenum pname;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glGetMinmaxParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
- __glXClearErrorOccured();
- glGetMinmaxParameteriv(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- (GLint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, compsize);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(0);
- __GLX_SEND_HEADER();
- } else if (compsize == 1) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(1);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_PUT_INT();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_PUT_SIZE(compsize);
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLboolean answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
- retval =
- glAreTexturesResidentEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4),
- (GLboolean *) answer
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(n);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(n);
- return Success;
-}
-
-int __glXDispSwap_DeleteTexturesEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
-
- glDeleteTexturesEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *)(pc + 4)
- );
- return Success;
-}
-
-int __glXDispSwap_GenTexturesEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei n;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLuint answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
-
- __GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
- glGenTexturesEXT(
- *(GLsizei *)(pc + 0),
- (GLuint *) answer
- );
- __GLX_SWAP_INT_ARRAY(answer, n);
- __GLX_BEGIN_REPLY(n*4);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_INT_ARRAY(n);
- return Success;
-}
-
-int __glXDispSwap_IsTextureEXT(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean retval;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_VENDPRIV_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- retval =
- glIsTextureEXT(
- *(GLuint *)(pc + 0)
- );
- __GLX_PUT_RETVAL(retval);
- __GLX_SWAP_REPLY_RETVAL();
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- return Success;
-}
-
diff --git a/GL/glx/global.c b/GL/glx/global.c
deleted file mode 100644
index 9cd011ec9..000000000
--- a/GL/glx/global.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/global.c,v 1.3 2001/03/21 16:29:35 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-
-/*
-** The last context used by the server. It is the context that is current
-** from the server's perspective.
-*/
-__GLXcontext *__glXLastContext;
-
-/*
-** X resources.
-*/
-RESTYPE __glXContextRes;
-RESTYPE __glXClientRes;
-RESTYPE __glXPixmapRes;
-
-/*
-** Error codes with the extension error base already added in.
-*/
-int __glXBadContext, __glXBadContextState, __glXBadDrawable, __glXBadPixmap;
-int __glXBadContextTag, __glXBadCurrentWindow;
-int __glXBadRenderRequest, __glXBadLargeRequest;
-int __glXUnsupportedPrivateRequest;
-
-/*
-** Reply for most singles.
-*/
-xGLXSingleReply __glXReply;
-
-/*
-** A set of state for each client. The 0th one is unused because client
-** indices start at 1, not 0.
-*/
-__GLXclientState *__glXClients[MAXCLIENTS+1];
-
diff --git a/GL/glx/glxbuf.c b/GL/glx/glxbuf.c
deleted file mode 100644
index 6e6f6142b..000000000
--- a/GL/glx/glxbuf.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.c,v 1.7 2001/10/31 22:50:26 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxserver.h"
-#include "glxutil.h"
-#include "glxbuf.h"
-#include "glxfb.h"
-#include "glxmem.h"
-#include "glxpix.h"
-
-void
-__glXFBInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
-{
- __GLdrawablePrivate *glPriv;
- GLint rgbBits;
- GLint accumBits;
-
- glPriv = &glxPriv->glPriv;
- rgbBits = modes->rgbBits;
- accumBits = modes->accumRedBits + modes->accumGreenBits +
- modes->accumBlueBits + modes->accumAlphaBits;
-
-#if defined(__GL_ALIGNED_BUFFERS)
- /* initialize pixel alignments (for more details see context.h) */
- glPriv->xAlignment = 1;
- glPriv->yAlignment = 1;
-#endif
-
- glxPriv->swapBuffers = __glXFBMemSwapBuffers;
-
- glPriv->yInverted = GL_TRUE; /* Y is upside-down */
-
- if (modes->doubleBufferMode) {
- if (modes->colorIndexMode) {
- __glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
- __glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
- } else {
- __glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
- __glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
- }
- } else {
- if (modes->colorIndexMode) {
- __glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
- } else {
- __glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
- }
- }
-
-#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
- if (modes->maxAuxBuffers > 0) {
- GLint i;
-
- for (i=0; i < modes->maxAuxBuffers; i++) {
- if (modes->colorIndexMode) {
- __glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
- } else {
- __glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
- }
- }
- }
-#endif
-
- if (modes->haveAccumBuffer) {
- __glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
- }
- if (modes->haveDepthBuffer) {
- __glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
- }
- if (modes->haveStencilBuffer) {
- __glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
- }
-}
-
-void
-__glXPixInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
-{
- __GLdrawablePrivate *glPriv;
- GLint rgbBits;
- GLint accumBits;
-
- assert(glxPriv->pGlxPixmap);
-
- glPriv = &glxPriv->glPriv;
- rgbBits = modes->rgbBits;
- accumBits = modes->accumRedBits + modes->accumGreenBits +
- modes->accumBlueBits + modes->accumAlphaBits;
-
-#if defined(__GL_ALIGNED_BUFFERS)
- /* initialize pixel alignments (for more details see context.h) */
- glPriv->xAlignment = 1;
- glPriv->yAlignment = 1;
-#endif
-
- glxPriv->swapBuffers = (GLboolean (*)(__GLXdrawablePrivate *))__glXNop;
-
- glPriv->yInverted = GL_FALSE;
-
- if (modes->doubleBufferMode) {
- if (modes->colorIndexMode) {
- __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
- glxPriv->drawId, glxPriv->pGlxPixmap);
- __glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
- } else {
- __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
- glxPriv->drawId, glxPriv->pGlxPixmap);
- __glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
- }
- } else {
- if (modes->colorIndexMode) {
- __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
- glxPriv->drawId, glxPriv->pGlxPixmap);
- } else {
- __glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
- glxPriv->drawId, glxPriv->pGlxPixmap);
- }
- }
-
-#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
- if (modes->maxAuxBuffers > 0) {
- GLint i;
-
- for (i=0; i < modes->maxAuxBuffers; i++) {
- if (modes->colorIndexMode) {
- __glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
- } else {
- __glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
- }
- }
- }
-#endif
-
- if (modes->haveAccumBuffer) {
- __glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
- }
- if (modes->haveDepthBuffer) {
- __glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
- }
- if (modes->haveStencilBuffer) {
- __glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
- }
-}
-
-
-#define __GLX_SET_ACCEL_BUFFER_MASK(bm) \
- if (status == GL_FALSE) return GL_FALSE; \
- if (status == GL_TRUE) accelBufferMask |= bm; \
- /* for __GL_BUFFER_FALLBACK don't do anything */
-
-GLboolean
-__glXResizeBuffers(__GLdrawablePrivate *glPriv,
- GLint x, GLint y, GLuint width, GLuint height)
-{
- __GLcontextModes *modes;
- __GLdrawableRegion *glRegion;
- GLboolean status;
- GLuint accelBufferMask;
-
- modes = glPriv->modes;
- accelBufferMask = 0;
-
- status = (*glPriv->frontBuffer.resize)(&glPriv->frontBuffer,
- x, y, width, height, glPriv,
- __GL_FRONT_BUFFER_MASK);
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_FRONT_BUFFER_MASK);
-
- if (modes->doubleBufferMode) {
- status = (*glPriv->backBuffer.resize)(&glPriv->backBuffer,
- x, y, width, height, glPriv,
- __GL_BACK_BUFFER_MASK);
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_BACK_BUFFER_MASK);
- }
-
-#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
- if (modes->maxAuxBuffers > 0) {
- GLint i;
-
- for (i=0; i < modes->maxAuxBuffers; i++) {
- status = (*glPriv->auxBuffers[i].resize)(&glPriv->auxBuffer[i],
- x, y, width, height,
- glPriv,
- __GL_AUX_BUFFER_MASK(i));
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_AUX_BUFFER_MASK(i));
- }
- }
-#endif
-
- if (modes->haveAccumBuffer) {
- status = (*glPriv->accumBuffer.resize)(&glPriv->accumBuffer,
- x, y, width, height, glPriv,
- __GL_ACCUM_BUFFER_MASK);
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_ACCUM_BUFFER_MASK);
- }
-
- if (modes->haveDepthBuffer) {
- status = (*glPriv->depthBuffer.resize)(&glPriv->depthBuffer,
- x, y, width, height, glPriv,
- __GL_DEPTH_BUFFER_MASK);
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_DEPTH_BUFFER_MASK);
- }
-
- if (modes->haveStencilBuffer) {
- status = (*glPriv->stencilBuffer.resize)(&glPriv->stencilBuffer,
- x, y, width, height, glPriv,
- __GL_STENCIL_BUFFER_MASK);
- __GLX_SET_ACCEL_BUFFER_MASK(__GL_STENCIL_BUFFER_MASK);
- }
-
- glPriv->accelBufferMask = accelBufferMask;
-
- /* finally, update the ownership region */
- glRegion = &glPriv->ownershipRegion;
- glRegion->numRects = 1;
- glRegion->rects[0].x0 = 0;
- glRegion->rects[0].y0 = 0;
- glRegion->rects[0].x1 = width;
- glRegion->rects[0].y1 = height;
-
- return GL_TRUE;
-}
-
-void
-__glXFreeBuffers(__GLXdrawablePrivate *glxPriv)
-{
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
-#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
- __GLcontextModes *modes = glPriv->modes;
-#endif
-
- if (glPriv->frontBuffer.free) {
- (*glPriv->frontBuffer.free)(&glPriv->frontBuffer, glPriv);
- }
- if (glPriv->backBuffer.free) {
- (*glPriv->backBuffer.free)(&glPriv->backBuffer, glPriv);
- }
-
-#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
- if (modes->maxAuxBuffers > 0) {
- GLint i;
-
- for (i=0; i < modes->maxAuxBuffers; i++) {
- if (glPriv->auxBuffer[i].free) {
- (*glPriv->auxBuffer[i].free)(&glPriv->auxBuffer[i], glPriv);
- }
- }
- }
-#endif
-
- if (glPriv->accumBuffer.free) {
- (*glPriv->accumBuffer.free)(&glPriv->accumBuffer, glPriv);
- }
-
- if (glPriv->depthBuffer.free) {
- (*glPriv->depthBuffer.free)(&glPriv->depthBuffer, glPriv);
- }
-
- if (glPriv->stencilBuffer.free) {
- (*glPriv->stencilBuffer.free)(&glPriv->stencilBuffer, glPriv);
- }
-}
diff --git a/GL/glx/glxbuf.h b/GL/glx/glxbuf.h
deleted file mode 100644
index a298b3471..000000000
--- a/GL/glx/glxbuf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-#ifndef _glxbuf_h_
-#define _glxbuf_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void __glXFBInitDrawable(__GLXdrawablePrivate *glxPriv,
- __GLcontextModes *modes);
-extern void __glXPixInitDrawable(__GLXdrawablePrivate *glxPriv,
- __GLcontextModes *modes);
-
-extern GLboolean __glXResizeBuffers(__GLdrawablePrivate *glPriv,
- GLint x, GLint y,
- GLuint width, GLuint height);
-
-extern void __glXFreeBuffers(__GLXdrawablePrivate *glxPriv);
-extern void __glXUpdatePalette(__GLXdrawablePrivate *);
-
-#endif /* _glxbuf_h_ */
-
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
deleted file mode 100644
index 12e961ee6..000000000
--- a/GL/glx/glxcmds.c
+++ /dev/null
@@ -1,1712 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.11 2003/10/28 22:50:17 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#define FONT_PCF
-#include "glxserver.h"
-#include <GL/glxtokens.h>
-#include <unpack.h>
-#include "g_disptab.h"
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include "g_disptab_EXT.h"
-#include "glximports.h"
-#include "glxutil.h"
-#include "glxext.h"
-#include "GL/glx_ansic.h"
-
-/************************************************************************/
-
-static __GLimports imports = {
- __glXImpMalloc,
- __glXImpCalloc,
- __glXImpRealloc,
- __glXImpFree,
- __glXImpWarning,
- __glXImpFatal,
- __glXImpGetenv,
- __glXImpAtoi,
- __glXImpSprintf,
- __glXImpFopen,
- __glXImpFclose,
- __glXImpFprintf,
- __glXImpGetDrawablePrivate,
- __glXImpGetReadablePrivate,
- NULL
-};
-
-static int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
- GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
-
-/************************************************************************/
-
-/*
-** Create a GL context with the given properties.
-*/
-int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
- VisualPtr pVisual;
- ScreenPtr pScreen;
- __GLXcontext *glxc, *shareglxc;
- __GLXvisualConfig *pGlxVisual;
- __GLXscreenInfo *pGlxScreen;
- __GLinterface *shareGC;
- GLXContextID gcId = req->context;
- GLXContextID shareList = req->shareList;
- VisualID visual = req->visual;
- GLuint screen = req->screen;
- GLboolean isDirect = req->isDirect;
- GLint i;
-
- /*
- ** Check if screen exists.
- */
- if (screen >= screenInfo.numScreens) {
- client->errorValue = screen;
- return BadValue;
- }
- pScreen = screenInfo.screens[screen];
- pGlxScreen = &__glXActiveScreens[screen];
-
- /*
- ** Check if the visual ID is valid for this screen.
- */
- pVisual = pScreen->visuals;
- for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
- if (pVisual->vid == visual) {
- break;
- }
- }
- if (i == pScreen->numVisuals) {
- client->errorValue = visual;
- return BadValue;
- }
-
- /*
- ** Get configuration of the visual. This assumes that the
- ** glXActiveScreens structure contains visual configurations only for the
- ** subset of Visuals that are supported by this implementation of the
- ** OpenGL.
- */
- pGlxVisual = pGlxScreen->pGlxVisual;
- for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == visual) {
- break;
- }
- }
- if (i == pGlxScreen->numVisuals) {
- /*
- ** Visual not support on this screen by this OpenGL implementation.
- */
- client->errorValue = visual;
- return BadValue;
- }
-
- /*
- ** Find the display list space that we want to share.
- **
- ** NOTE: In a multithreaded X server, we would need to keep a reference
- ** count for each display list so that if one client detroyed a list that
- ** another client was using, the list would not really be freed until it
- ** was no longer in use. Since this sample implementation has no support
- ** for multithreaded servers, we don't do this.
- */
- if (shareList == None) {
- shareGC = 0;
- } else {
- shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes);
- if (!shareglxc) {
- client->errorValue = shareList;
- return __glXBadContext;
- }
- if (shareglxc->isDirect) {
- /*
- ** NOTE: no support for sharing display lists between direct
- ** contexts, even if they are in the same address space.
- */
-#if 0
- /* Disabling this code seems to allow shared display lists
- * and texture objects to work. We'll leave it disabled for now.
- */
- client->errorValue = shareList;
- return BadMatch;
-#endif
- } else {
- /*
- ** Create an indirect context regardless of what the client asked
- ** for; this way we can share display list space with shareList.
- */
- isDirect = GL_FALSE;
- }
- shareGC = shareglxc->gc;
- }
-
- /*
- ** Allocate memory for the new context
- */
- glxc = (__GLXcontext *) __glXMalloc(sizeof(__GLXcontext));
- if (!glxc) {
- return BadAlloc;
- }
- __glXMemset(glxc, 0, sizeof(__GLXcontext));
-
- /*
- ** Initially, setup the part of the context that could be used by
- ** a GL core that needs windowing information (e.g., Mesa).
- */
- glxc->pScreen = pScreen;
- glxc->pGlxScreen = pGlxScreen;
- glxc->pVisual = pVisual;
- glxc->pGlxVisual = pGlxVisual;
-
- if (!isDirect) {
- __GLcontextModes *modes;
- /*
- ** first build __GLcontextModes from __GLXvisualConfig
- */
- modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes));
- glxc->modes = modes;
- __glXFormatGLModes(modes, pGlxVisual);
-
- /*
- ** Allocate a GL context
- */
- imports.other = (void *)glxc;
- glxc->gc = (*pGlxScreen->createContext)(&imports, modes, shareGC);
- if (!glxc->gc) {
- __glXFree(glxc);
- client->errorValue = gcId;
- return BadAlloc;
- }
- } else {
- /*
- ** Don't need local GL context for a direct context.
- */
- glxc->gc = 0;
- }
- /*
- ** Register this context as a resource.
- */
- if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
- if (!isDirect) {
- (*glxc->gc->exports.destroyContext)((__GLcontext *)glxc->gc);
- }
- __glXFree(glxc);
- client->errorValue = gcId;
- return BadAlloc;
- }
-
- /*
- ** Finally, now that everything is working, setup the rest of the
- ** context.
- */
- glxc->id = gcId;
- glxc->share_id = shareList;
- glxc->idExists = GL_TRUE;
- glxc->isCurrent = GL_FALSE;
- glxc->isDirect = isDirect;
- glxc->renderMode = GL_RENDER;
-
- return Success;
-}
-
-/*
-** Destroy a GL context as an X resource.
-*/
-int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
- GLXContextID gcId = req->context;
- __GLXcontext *glxc;
-
- glxc = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes);
- if (glxc) {
- /*
- ** Just free the resource; don't actually destroy the context,
- ** because it might be in use. The
- ** destroy method will be called by the resource destruction routine
- ** if necessary.
- */
- FreeResourceByType(gcId, __glXContextRes, FALSE);
- return Success;
- } else {
- client->errorValue = gcId;
- return __glXBadContext;
- }
-}
-
-/*****************************************************************************/
-
-/*
-** For each client, the server keeps a table of all the contexts that are
-** current for that client (each thread of a client may have its own current
-** context). These routines add, change, and lookup contexts in the table.
-*/
-
-/*
-** Add a current context, and return the tag that will be used to refer to it.
-*/
-static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc)
-{
- int i;
- int num = cl->numCurrentContexts;
- __GLXcontext **table = cl->currentContexts;
-
- if (!glxc) return -1;
-
- /*
- ** Try to find an empty slot and use it.
- */
- for (i=0; i < num; i++) {
- if (!table[i]) {
- table[i] = glxc;
- return i+1;
- }
- }
- /*
- ** Didn't find a free slot, so we'll have to grow the table.
- */
- if (!num) {
- table = (__GLXcontext **) __glXMalloc(sizeof(__GLXcontext *));
- } else {
- table = (__GLXcontext **) __glXRealloc(table,
- (num+1)*sizeof(__GLXcontext *));
- }
- table[num] = glxc;
- cl->currentContexts = table;
- cl->numCurrentContexts++;
- return num+1;
-}
-
-/*
-** Given a tag, change the current context for the corresponding entry.
-*/
-static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc,
- GLXContextTag tag)
-{
- __GLXcontext **table = cl->currentContexts;
- table[tag-1] = glxc;
-}
-
-/*
-** For this implementation we have chosen to simply use the index of the
-** context's entry in the table as the context tag. A tag must be greater
-** than 0.
-*/
-__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
-{
- int num = cl->numCurrentContexts;
-
- if (tag < 1 || tag > num) {
- return 0;
- } else {
- return cl->currentContexts[tag-1];
- }
-}
-
-/*****************************************************************************/
-
-static void StopUsingContext(__GLXcontext *glxc)
-{
- if (glxc) {
- if (glxc == __glXLastContext) {
- /* Tell server GL library */
- __glXLastContext = 0;
- }
- glxc->isCurrent = GL_FALSE;
- if (!glxc->idExists) {
- __glXFreeContext(glxc);
- }
- }
-}
-
-static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc)
-{
- glxc->isCurrent = GL_TRUE;
-}
-
-/*****************************************************************************/
-/*
-** Make an OpenGL context and drawable current.
-*/
-
-int __glXMakeCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->drawable,
- req->context, req->oldContextTag );
-}
-
-int __glXMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->readdrawable,
- req->context, req->oldContextTag );
-}
-
-int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->readable,
- req->context, req->oldContextTag );
-}
-
-
-/**
- * Given a drawable ID, get the associated drawable and / or pixmap.
- *
- * If the specified drawable ID is not a pixmap, \c ppPixmap will be set
- * to \c NULL on return. In either case, \c ppDraw will be set to a drawable.
- * In the case where the drawable ID is a pixmap, \c ppDraw will be set to
- * the drawable associated with that pixmap.
- *
- * \param glxc Associated GLX context.
- * \param drawId ID of the drawable.
- * \param ppDraw Location to store the pointer to the drawable.
- * \param ppPixmap Location to store the pointer to the pixmap.
- * \param client Pointer to the client state.
- * \return Zero is returned on success. Otherwise a GLX / X11 protocol error
- * is returned.
- *
- * \notes This function will need some modification when support pbuffers
- * is added.
- */
-static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
- DrawablePtr *ppDraw, __GLXpixmap **ppPixmap,
- ClientPtr client )
-{
- DrawablePtr pDraw;
- __GLXpixmap *drawPixmap = NULL;
-
- pDraw = (DrawablePtr) LookupDrawable(drawId, client);
- if (pDraw) {
- if (pDraw->type == DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X Window.
- */
- WindowPtr pWin = (WindowPtr)pDraw;
- VisualID vid = wVisual(pWin);
-
- /*
- ** Check if window and context are similar.
- */
- if ((vid != glxc->pVisual->vid) ||
- (pWin->drawable.pScreen != glxc->pScreen)) {
- client->errorValue = drawId;
- return BadMatch;
- }
- } else {
- /*
- ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
- ** is, but it must first be created with glxCreateGLXPixmap).
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- } else {
- drawPixmap = (__GLXpixmap *) LookupIDByType(drawId, __glXPixmapRes);
- if (drawPixmap) {
- /*
- ** Check if pixmap and context are similar.
- */
- if (drawPixmap->pScreen != glxc->pScreen ||
- drawPixmap->pGlxVisual != glxc->pGlxVisual) {
- client->errorValue = drawId;
- return BadMatch;
- }
- pDraw = drawPixmap->pDraw;
-
- } else {
- /*
- ** Drawable is neither a Window nor a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
-
- *ppPixmap = drawPixmap;
- *ppDraw = pDraw;
-
- return 0;
-}
-
-
-static int DoMakeCurrent( __GLXclientState *cl,
- GLXDrawable drawId, GLXDrawable readId,
- GLXContextID contextId, GLXContextTag tag )
-{
- ClientPtr client = cl->client;
- DrawablePtr pDraw;
- DrawablePtr pRead;
- xGLXMakeCurrentReply reply;
- __GLXpixmap *drawPixmap = NULL;
- __GLXpixmap *readPixmap = NULL;
- __GLXcontext *glxc, *prevglxc;
- __GLinterface *gc, *prevgc;
- __GLXdrawablePrivate *drawPriv = NULL;
- __GLXdrawablePrivate *readPriv = NULL;
- GLint error;
- GLuint mask;
-
- /*
- ** If one is None and the other isn't, it's a bad match.
- */
-
- mask = (drawId == None) ? (1 << 0) : 0;
- mask |= (readId == None) ? (1 << 1) : 0;
- mask |= (contextId == None) ? (1 << 2) : 0;
-
- if ( (mask != 0x00) && (mask != 0x07) ) {
- return BadMatch;
- }
-
- /*
- ** Lookup old context. If we have one, it must be in a usable state.
- */
- if (tag != 0) {
- prevglxc = __glXLookupContextByTag(cl, tag);
- if (!prevglxc) {
- /*
- ** Tag for previous context is invalid.
- */
- return __glXBadContextTag;
- }
- if (prevglxc->renderMode != GL_RENDER) {
- /* Oops. Not in render mode render. */
- client->errorValue = prevglxc->id;
- return __glXBadContextState;
- }
- prevgc = prevglxc->gc;
- } else {
- prevglxc = 0;
- prevgc = 0;
- }
-
- /*
- ** Lookup new context. It must not be current for someone else.
- */
- if (contextId != None) {
- int status;
-
- glxc = (__GLXcontext *) LookupIDByType(contextId, __glXContextRes);
- if (!glxc) {
- client->errorValue = contextId;
- return __glXBadContext;
- }
- if ((glxc != prevglxc) && glxc->isCurrent) {
- /* Context is current to somebody else */
- return BadAccess;
- }
- gc = glxc->gc;
-
-
- assert( drawId != None );
- assert( readId != None );
-
- status = GetDrawableOrPixmap( glxc, drawId, & pDraw, & drawPixmap,
- client );
- if ( status != 0 ) {
- return status;
- }
-
- if ( readId != drawId ) {
- status = GetDrawableOrPixmap( glxc, readId, & pRead, & readPixmap,
- client );
- if ( status != 0 ) {
- return status;
- }
- } else {
- pRead = pDraw;
- }
-
- /* FIXME: Finish refactoring this. - idr */
- /* get the drawable private */
- if (pDraw) {
- drawPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
- if (drawPriv == NULL) {
- return __glXBadDrawable;
- }
- }
-
- if (pRead != pDraw) {
- readPriv = __glXGetDrawablePrivate(pRead, readId, glxc->modes);
- if (readPriv == NULL) {
- return __glXBadDrawable;
- }
- } else {
- readPriv = drawPriv;
- }
-
- } else {
- /* Switching to no context. Ignore new drawable. */
- glxc = 0;
- gc = 0;
- pDraw = 0;
- pRead = 0;
- }
-
-
- if (prevglxc) {
- /*
- ** Flush the previous context if needed.
- */
- if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
- if (__glXForceCurrent(cl, tag, (int *)&error)) {
- glFlush();
- __GLX_NOTE_FLUSHED_CMDS(prevglxc);
- } else {
- return error;
- }
- }
-
- /*
- ** Make the previous context not current.
- */
- if (!(*prevgc->exports.loseCurrent)((__GLcontext *)prevgc)) {
- return __glXBadContext;
- }
- __glXDeassociateContext(prevglxc);
- }
-
-
- if ((glxc != 0) && !glxc->isDirect) {
-
- glxc->drawPriv = drawPriv;
- glxc->readPriv = readPriv;
- __glXCacheDrawableSize(drawPriv);
-
- /* make the context current */
- if (!(*gc->exports.makeCurrent)((__GLcontext *)gc)) {
- glxc->drawPriv = NULL;
- glxc->readPriv = NULL;
- return __glXBadContext;
- }
-
- /* resize the buffers */
- if (!__glXResizeDrawableBuffers(drawPriv)) {
- /* could not do initial resize. make current failed */
- (*gc->exports.loseCurrent)((__GLcontext *)gc);
- glxc->drawPriv = NULL;
- glxc->readPriv = NULL;
- return __glXBadContext;
- }
-
- glxc->isCurrent = GL_TRUE;
- __glXAssociateContext(glxc);
- assert(drawPriv->drawGlxc == glxc);
- assert(readPriv->readGlxc == glxc);
- }
-
- if (prevglxc) {
- if (prevglxc->drawPixmap) {
- if (prevglxc->drawPixmap != prevglxc->readPixmap) {
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- prevglxc->readPixmap->refcnt--;
- if (!prevglxc->readPixmap->idExists &&
- !prevglxc->readPixmap->refcnt) {
- PixmapPtr pPixmap = (PixmapPtr) prevglxc->readPixmap->pDraw;
- /*
- ** The DestroyPixmap routine should decrement the
- ** refcount of the X pixmap and free only if it's zero.
- */
- (*prevglxc->readPixmap->pScreen->DestroyPixmap)(pPixmap);
- __glXFree(prevglxc->readPixmap);
- }
- }
-
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- prevglxc->drawPixmap->refcnt--;
- if (!prevglxc->drawPixmap->idExists &&
- !prevglxc->drawPixmap->refcnt) {
- PixmapPtr pPixmap = (PixmapPtr) prevglxc->drawPixmap->pDraw;
- /*
- ** The DestroyPixmap routine should decrement the
- ** refcount of the X pixmap and free only if it's zero.
- */
- (*prevglxc->drawPixmap->pScreen->DestroyPixmap)(pPixmap);
- __glXFree(prevglxc->drawPixmap);
- }
-
- prevglxc->drawPixmap = NULL;
- }
- ChangeCurrentContext(cl, glxc, tag);
- StopUsingContext(prevglxc);
- } else {
- tag = AddCurrentContext(cl, glxc);
- }
-
- if (glxc) {
- if (drawPixmap) {
- drawPixmap->refcnt++;
- glxc->drawPixmap = drawPixmap;
- }
-
- if (readPixmap && (readPixmap != drawPixmap)) {
- readPixmap->refcnt++;
- glxc->readPixmap = readPixmap;
- }
-
- StartUsingContext(cl, glxc);
- reply.contextTag = tag;
- } else {
- reply.contextTag = 0;
- }
-
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapMakeCurrentReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply);
- }
- return Success;
-}
-
-int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
- xGLXIsDirectReply reply;
- __GLXcontext *glxc;
-
- /*
- ** Find the GL context.
- */
- glxc = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
- if (!glxc) {
- client->errorValue = req->context;
- return __glXBadContext;
- }
-
- reply.isDirect = glxc->isDirect;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapIsDirectReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
- }
-
- return Success;
-}
-
-int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
- xGLXQueryVersionReply reply;
- GLuint major, minor;
-
- major = req->majorVersion;
- minor = req->minorVersion;
- (void)major;
- (void)minor;
-
- /*
- ** Server should take into consideration the version numbers sent by the
- ** client if it wants to work with older clients; however, in this
- ** implementation the server just returns its version number.
- */
- reply.majorVersion = GLX_SERVER_MAJOR_VERSION;
- reply.minorVersion = GLX_SERVER_MINOR_VERSION;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapQueryVersionReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply);
- }
- return Success;
-}
-
-int __glXWaitGL(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
- int error;
-
- if (!__glXForceCurrent(cl, req->contextTag, &error)) {
- return error;
- }
- glFinish();
- return Success;
-}
-
-int __glXWaitX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
- int error;
-
- if (!__glXForceCurrent(cl, req->contextTag, &error)) {
- return error;
- }
- /*
- ** In a multithreaded server that had separate X and GL threads, we would
- ** have to wait for the X thread to finish before returning. As it stands,
- ** this sample implementation only supports singlethreaded servers, and
- ** nothing needs to be done here.
- */
- return Success;
-}
-
-int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
- GLXContextID source = req->source;
- GLXContextID dest = req->dest;
- GLXContextTag tag = req->contextTag;
- unsigned long mask = req->mask;
- __GLXcontext *src, *dst;
- int error;
-
- /*
- ** Check that each context exists.
- */
- src = (__GLXcontext *) LookupIDByType(source, __glXContextRes);
- if (!src) {
- client->errorValue = source;
- return __glXBadContext;
- }
- dst = (__GLXcontext *) LookupIDByType(dest, __glXContextRes);
- if (!dst) {
- client->errorValue = dest;
- return __glXBadContext;
- }
-
- /*
- ** They must be in the same address space, and same screen.
- ** NOTE: no support for direct rendering contexts here.
- */
- if (src->isDirect || dst->isDirect ||
- (src->pGlxScreen != dst->pGlxScreen)) {
- client->errorValue = source;
- return BadMatch;
- }
-
- /*
- ** The destination context must not be current for any client.
- */
- if (dst->isCurrent) {
- client->errorValue = dest;
- return BadAccess;
- }
-
- if (tag) {
- __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag);
-
- if (!tagcx) {
- return __glXBadContextTag;
- }
- if (tagcx != src) {
- /*
- ** This would be caused by a faulty implementation of the client
- ** library.
- */
- return BadMatch;
- }
- /*
- ** In this case, glXCopyContext is in both GL and X streams, in terms
- ** of sequentiality.
- */
- if (__glXForceCurrent(cl, tag, &error)) {
- /*
- ** Do whatever is needed to make sure that all preceding requests
- ** in both streams are completed before the copy is executed.
- */
- glFinish();
- __GLX_NOTE_FLUSHED_CMDS(tagcx);
- } else {
- return error;
- }
- }
- /*
- ** Issue copy. The only reason for failure is a bad mask.
- */
- if (!(*dst->gc->exports.copyContext)((__GLcontext *)dst->gc,
- (__GLcontext *)src->gc,
- mask)) {
- client->errorValue = mask;
- return BadValue;
- }
- return Success;
-}
-
-int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
- xGLXGetVisualConfigsReply reply;
- __GLXscreenInfo *pGlxScreen;
- __GLXvisualConfig *pGlxVisual;
- CARD32 buf[__GLX_TOTAL_CONFIG];
- unsigned int screen;
- int i, p;
-
- screen = req->screen;
- if (screen >= screenInfo.numScreens) {
- /* The client library must send a valid screen number. */
- client->errorValue = screen;
- return BadValue;
- }
- pGlxScreen = &__glXActiveScreens[screen];
-
- reply.numVisuals = pGlxScreen->numUsableVisuals;
- reply.numProps = __GLX_TOTAL_CONFIG;
- reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
-
- for (i=0; i < pGlxScreen->numVisuals; i++) {
- pGlxVisual = &pGlxScreen->pGlxVisual[i];
- if (pGlxVisual->vid == 0) {
- /* not a usable visual */
- continue;
- }
- p = 0;
- buf[p++] = pGlxVisual->vid;
- buf[p++] = pGlxVisual->class;
- buf[p++] = pGlxVisual->rgba;
-
- buf[p++] = pGlxVisual->redSize;
- buf[p++] = pGlxVisual->greenSize;
- buf[p++] = pGlxVisual->blueSize;
- buf[p++] = pGlxVisual->alphaSize;
- buf[p++] = pGlxVisual->accumRedSize;
- buf[p++] = pGlxVisual->accumGreenSize;
- buf[p++] = pGlxVisual->accumBlueSize;
- buf[p++] = pGlxVisual->accumAlphaSize;
-
- buf[p++] = pGlxVisual->doubleBuffer;
- buf[p++] = pGlxVisual->stereo;
-
- buf[p++] = pGlxVisual->bufferSize;
- buf[p++] = pGlxVisual->depthSize;
- buf[p++] = pGlxVisual->stencilSize;
- buf[p++] = pGlxVisual->auxBuffers;
- buf[p++] = pGlxVisual->level;
- /*
- ** Add token/value pairs for extensions.
- */
- buf[p++] = GLX_VISUAL_CAVEAT_EXT;
- buf[p++] = pGlxVisual->visualRating;
- buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
- buf[p++] = pGlxVisual->transparentPixel;
- buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentRed;
- buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentGreen;
- buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentBlue;
- buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentAlpha;
- buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentIndex;
-
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *)buf);
- }
- return Success;
-}
-
-/*
-** Create a GLX Pixmap from an X Pixmap.
-*/
-int __glXCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
- VisualID visual = req->visual;
- GLuint screenNum = req->screen;
- XID pixmapId = req->pixmap;
- XID glxpixmapId = req->glxpixmap;
- DrawablePtr pDraw;
- ScreenPtr pScreen;
- VisualPtr pVisual;
- __GLXpixmap *pGlxPixmap;
- __GLXscreenInfo *pGlxScreen;
- __GLXvisualConfig *pGlxVisual;
- int i;
-
- pDraw = (DrawablePtr) LookupDrawable(pixmapId, client);
- if (!pDraw || pDraw->type != DRAWABLE_PIXMAP) {
- client->errorValue = pixmapId;
- return BadPixmap;
- }
-
- /*
- ** Check if screen of visual matches screen of pixmap.
- */
- pScreen = pDraw->pScreen;
- if (screenNum != pScreen->myNum) {
- return BadMatch;
- }
-
- /*
- ** Find the VisualRec for this visual.
- */
- pVisual = pScreen->visuals;
- for (i=0; i < pScreen->numVisuals; i++, pVisual++) {
- if (pVisual->vid == visual) {
- break;
- }
- }
- if (i == pScreen->numVisuals) {
- client->errorValue = visual;
- return BadValue;
- }
- /*
- ** Check if depth of visual matches depth of pixmap.
- */
- if (pVisual->nplanes != pDraw->depth) {
- return BadMatch;
- }
-
- /*
- ** Get configuration of the visual.
- */
- pGlxScreen = &__glXActiveScreens[screenNum];
- pGlxVisual = pGlxScreen->pGlxVisual;
- for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == visual) {
- break;
- }
- }
- if (i == pGlxScreen->numVisuals) {
- /*
- ** Visual not support on this screen by this OpenGL implementation.
- */
- client->errorValue = visual;
- return BadValue;
- }
-
- pGlxPixmap = (__GLXpixmap *) __glXMalloc(sizeof(__GLXpixmap));
- if (!pGlxPixmap) {
- return BadAlloc;
- }
- if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
- return BadAlloc;
- }
- pGlxPixmap->pDraw = pDraw;
- pGlxPixmap->pGlxScreen = pGlxScreen;
- pGlxPixmap->pGlxVisual = pGlxVisual;
- pGlxPixmap->pScreen = pScreen;
- pGlxPixmap->idExists = True;
- pGlxPixmap->refcnt = 0;
-
- /*
- ** Bump the ref count on the X pixmap so it won't disappear.
- */
- ((PixmapPtr) pDraw)->refcnt++;
-
- return Success;
-}
-
-int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
- XID glxpixmap = req->glxpixmap;
-
- /*
- ** Check if it's a valid GLX pixmap.
- */
- if (!LookupIDByType(glxpixmap, __glXPixmapRes)) {
- client->errorValue = glxpixmap;
- return __glXBadPixmap;
- }
- FreeResource(glxpixmap, FALSE);
- return Success;
-}
-
-/*****************************************************************************/
-
-/*
-** NOTE: There is no portable implementation for swap buffers as of
-** this time that is of value. Consequently, this code must be
-** implemented by somebody other than SGI.
-*/
-int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- DrawablePtr pDraw;
- xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
- GLXContextTag tag = req->contextTag;
- XID drawId = req->drawable;
- __GLXpixmap *pGlxPixmap;
- __GLXcontext *glxc = NULL;
- int error;
-
- /*
- ** Check that the GLX drawable is valid.
- */
- pDraw = (DrawablePtr) LookupDrawable(drawId, client);
- if (pDraw) {
- if (pDraw->type == DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X window.
- */
- } else {
- /*
- ** Drawable is an X pixmap, which is not allowed.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- } else {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
- if (pGlxPixmap) {
- /*
- ** Drawable is a GLX pixmap.
- */
- } else {
- /*
- ** Drawable is neither a X window nor a GLX pixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
-
- if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc) {
- return __glXBadContextTag;
- }
- /*
- ** The calling thread is swapping its current drawable. In this case,
- ** glxSwapBuffers is in both GL and X streams, in terms of
- ** sequentiality.
- */
- if (__glXForceCurrent(cl, tag, &error)) {
- /*
- ** Do whatever is needed to make sure that all preceding requests
- ** in both streams are completed before the swap is executed.
- */
- glFinish();
- __GLX_NOTE_FLUSHED_CMDS(glxc);
- } else {
- return error;
- }
- }
-
- if (pDraw) {
- __GLXdrawablePrivate *glxPriv;
-
- if (glxc) {
- glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
- if (glxPriv == NULL) {
- return __glXBadDrawable;
- }
- }
- else {
- glxPriv = __glXFindDrawablePrivate(drawId);
- if (glxPriv == NULL) {
- /* This is a window we've never seen before, do nothing */
- return Success;
- }
- }
-
- if ((*glxPriv->swapBuffers)(glxPriv) == GL_FALSE) {
- return __glXBadDrawable;
- }
- }
-
- return Success;
-}
-
-
-int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- __GLXcontext *ctx;
- xGLXQueryContextInfoEXTReq *req;
- xGLXQueryContextInfoEXTReply reply;
- int nProps;
- int *sendBuf, *pSendBuf;
- int nReplyBytes;
-
- req = (xGLXQueryContextInfoEXTReq *)pc;
- ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
- if (!ctx) {
- client->errorValue = req->context;
- return __glXBadContext;
- }
-
- nProps = 3;
- reply.length = nProps << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.n = nProps;
-
- nReplyBytes = reply.length << 2;
- sendBuf = (int *)__glXMalloc((size_t)nReplyBytes);
- if (sendBuf == NULL) {
- return __glXBadContext; /* XXX: Is this correct? */
- }
- pSendBuf = sendBuf;
- *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
- *pSendBuf++ = (int)(ctx->share_id);
- *pSendBuf++ = GLX_VISUAL_ID_EXT;
- *pSendBuf++ = (int)(ctx->pVisual->vid);
- *pSendBuf++ = GLX_SCREEN_EXT;
- *pSendBuf++ = (int)(ctx->pScreen->myNum);
-
- if (client->swapped) {
- __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
- } else {
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
- WriteToClient(client, nReplyBytes, (char *)sendBuf);
- }
- __glXFree((char *)sendBuf);
-
- return Success;
-}
-
-
-/************************************************************************/
-
-/*
-** Render and Renderlarge are not in the GLX API. They are used by the GLX
-** client library to send batches of GL rendering commands.
-*/
-
-/*
-** Execute all the drawing commands in a request.
-*/
-int __glXRender(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderReq *req;
- ClientPtr client= cl->client;
- int left, cmdlen, error;
- int commandsDone;
- CARD16 opcode;
- __GLXrenderHeader *hdr;
- __GLXcontext *glxc;
-
- /*
- ** NOTE: much of this code also appears in the byteswapping version of this
- ** routine, __glXSwapRender(). Any changes made here should also be
- ** duplicated there.
- */
-
- req = (xGLXRenderReq *) pc;
- glxc = __glXForceCurrent(cl, req->contextTag, &error);
- if (!glxc) {
- return error;
- }
-
- commandsDone = 0;
- pc += sz_xGLXRenderReq;
- left = (req->length << 2) - sz_xGLXRenderReq;
- while (left > 0) {
- __GLXrenderSizeData *entry;
- int extra;
- void (* proc)(GLbyte *);
-
- /*
- ** Verify that the header length and the overall length agree.
- ** Also, each command must be word aligned.
- */
- hdr = (__GLXrenderHeader *) pc;
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- /*
- ** Check for core opcodes and grab entry data.
- */
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- entry = &__glXRenderSizeTable[opcode];
- proc = __glXRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- entry =
- &__glXRenderSizeTable_EXT[opcode -
- __GLX_MIN_RENDER_OPCODE_EXT];
- proc = __glXRenderTable_EXT[opcode -
- __GLX_MIN_RENDER_OPCODE_EXT];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = commandsDone;
- return __glXBadRenderRequest;
- }
-
- if (!entry->bytes) {
- /* unused opcode */
- client->errorValue = commandsDone;
- return __glXBadRenderRequest;
- }
- if (entry->varsize) {
- /* variable size command */
- extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False);
- if (extra < 0) {
- extra = 0;
- }
- if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry->bytes)) {
- return BadLength;
- }
- }
- if (left < cmdlen) {
- return BadLength;
- }
-
- /*
- ** Skip over the header and execute the command. We allow the
- ** caller to trash the command memory. This is useful especially
- ** for things that require double alignment - they can just shift
- ** the data towards lower memory (trashing the header) by 4 bytes
- ** and achieve the required alignment.
- */
- (*proc)(pc + __GLX_RENDER_HDR_SIZE);
- pc += cmdlen;
- left -= cmdlen;
- commandsDone++;
- }
- __GLX_NOTE_UNFLUSHED_CMDS(glxc);
- return Success;
-}
-
-/*
-** Execute a large rendering request (one that spans multiple X requests).
-*/
-int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderLargeReq *req;
- ClientPtr client= cl->client;
- GLuint dataBytes;
- void (*proc)(GLbyte *);
- __GLXrenderLargeHeader *hdr;
- __GLXcontext *glxc;
- int error;
- CARD16 opcode;
-
- /*
- ** NOTE: much of this code also appears in the byteswapping version of this
- ** routine, __glXSwapRenderLarge(). Any changes made here should also be
- ** duplicated there.
- */
-
- req = (xGLXRenderLargeReq *) pc;
- glxc = __glXForceCurrent(cl, req->contextTag, &error);
- if (!glxc) {
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return error;
- }
- dataBytes = req->dataBytes;
-
- /*
- ** Check the request length.
- */
- if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
- client->errorValue = req->length;
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return BadLength;
- }
- pc += sz_xGLXRenderLargeReq;
-
- if (cl->largeCmdRequestsSoFar == 0) {
- __GLXrenderSizeData *entry;
- int extra, cmdlen;
- /*
- ** This is the first request of a multi request command.
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (req->requestNumber != 1) {
- client->errorValue = req->requestNumber;
- return __glXBadLargeRequest;
- }
-
- hdr = (__GLXrenderLargeHeader *) pc;
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- /*
- ** Check for core opcodes and grab entry data.
- */
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- entry = &__glXRenderSizeTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- opcode -= __GLX_MIN_RENDER_OPCODE_EXT;
- entry = &__glXRenderSizeTable_EXT[opcode];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
-
- if (!entry->bytes) {
- /* unused opcode */
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
- if (entry->varsize) {
- /*
- ** If it's a variable-size command (a command whose length must
- ** be computed from its parameters), all the parameters needed
- ** will be in the 1st request, so it's okay to do this.
- */
- extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, False);
- if (extra < 0) {
- extra = 0;
- }
- /* large command's header is 4 bytes longer, so add 4 */
- if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry->bytes + 4)) {
- return BadLength;
- }
- }
- /*
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (cl->largeCmdBufSize < cmdlen) {
- if (!cl->largeCmdBuf) {
- cl->largeCmdBuf = (GLbyte *) __glXMalloc((size_t)cmdlen);
- } else {
- cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf,
- (size_t)cmdlen);
- }
- if (!cl->largeCmdBuf) {
- return BadAlloc;
- }
- cl->largeCmdBufSize = cmdlen;
- }
- __glXMemcpy(cl->largeCmdBuf, pc, dataBytes);
-
- cl->largeCmdBytesSoFar = dataBytes;
- cl->largeCmdBytesTotal = cmdlen;
- cl->largeCmdRequestsSoFar = 1;
- cl->largeCmdRequestsTotal = req->requestTotal;
- return Success;
-
- } else {
- /*
- ** We are receiving subsequent (i.e. not the first) requests of a
- ** multi request command.
- */
-
- /*
- ** Check the request number and the total request count.
- */
- if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
- client->errorValue = req->requestNumber;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- if (req->requestTotal != cl->largeCmdRequestsTotal) {
- client->errorValue = req->requestTotal;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
-
- /*
- ** Check that we didn't get too much data.
- */
- if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
- cl->largeCmdBytesSoFar += dataBytes;
- cl->largeCmdRequestsSoFar++;
-
- if (req->requestNumber == cl->largeCmdRequestsTotal) {
- /*
- ** This is the last request; it must have enough bytes to complete
- ** the command.
- */
- /* NOTE: the two pad macros have been added below; they are needed
- ** because the client library pads the total byte count, but not
- ** the per-request byte counts. The Protocol Encoding says the
- ** total byte count should not be padded, so a proposal will be
- ** made to the ARB to relax the padding constraint on the total
- ** byte count, thus preserving backward compatibility. Meanwhile,
- ** the padding done below fixes a bug that did not allow
- ** large commands of odd sizes to be accepted by the server.
- */
- if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
- __GLX_PAD(cl->largeCmdBytesTotal)) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
- opcode = hdr->opcode;
-
- /*
- ** Use the opcode to index into the procedure table.
- */
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- opcode -= __GLX_MIN_RENDER_OPCODE_EXT;
- proc = __glXRenderTable_EXT[opcode];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
-
- /*
- ** Skip over the header and execute the command.
- */
- (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
- __GLX_NOTE_UNFLUSHED_CMDS(glxc);
-
- /*
- ** Reset for the next RenderLarge series.
- */
- __glXResetLargeCommandStatus(cl);
- } else {
- /*
- ** This is neither the first nor the last request.
- */
- }
- return Success;
- }
-}
-
-
-/************************************************************************/
-
-/*
-** No support is provided for the vendor-private requests other than
-** allocating the entry points in the dispatch table.
-*/
-
-int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req;
- GLint vendorcode;
-
- req = (xGLXVendorPrivateReq *) pc;
- vendorcode = req->vendorCode;
-
- if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
- (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
- (*__glXVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])
- (cl, (GLbyte*)req);
- return Success;
- }
- /*
- ** This sample implemention does not support any private requests.
- */
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
-}
-
-int __glXVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateWithReplyReq *req;
- GLint vendorcode;
-
- req = (xGLXVendorPrivateWithReplyReq *) pc;
- vendorcode = req->vendorCode;
-
- switch (vendorcode) {
- case X_GLXvop_QueryContextInfoEXT:
- return __glXQueryContextInfoEXT(cl, pc);
- case X_GLXvop_MakeCurrentReadSGI:
- return __glXMakeCurrentReadSGI(cl, pc);
- default:
- break;
- }
-
- if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
- (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
- return
- (*__glXVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])
- (cl, (GLbyte*)req);
- }
-
- cl->client->errorValue = vendorcode;
- return __glXUnsupportedPrivateRequest;
-}
-
-int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
- xGLXQueryExtensionsStringReply reply;
- GLuint screen;
- size_t n, length;
- const char *ptr;
- char *buf;
-
- screen = req->screen;
- /*
- ** Check if screen exists.
- */
- if (screen >= screenInfo.numScreens) {
- client->errorValue = screen;
- return BadValue;
- }
-
- ptr = __glXActiveScreens[screen].GLXextensions;
-
- n = __glXStrlen(ptr) + 1;
- length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
-
- if ((buf = (char *) __glXMalloc(length << 2)) == NULL) {
- return BadAlloc;
- }
- __glXStrncpy(buf, ptr, n);
-
- if (client->swapped) {
- glxSwapQueryExtensionsStringReply(client, &reply, buf);
- } else {
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply);
- WriteToClient(client, (int)(length << 2), (char *)buf);
- }
-
- __glXFree(buf);
- return Success;
-}
-
-int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
- xGLXQueryServerStringReply reply;
- int name;
- GLuint screen;
- size_t n, length;
- const char *ptr;
- char *buf;
-
- name = req->name;
- screen = req->screen;
- /*
- ** Check if screen exists.
- */
- if (screen >= screenInfo.numScreens) {
- client->errorValue = screen;
- return BadValue;
- }
- switch(name) {
- case GLX_VENDOR:
- ptr = __glXActiveScreens[screen].GLXvendor;
- break;
- case GLX_VERSION:
- ptr = __glXActiveScreens[screen].GLXversion;
- break;
- case GLX_EXTENSIONS:
- ptr = __glXActiveScreens[screen].GLXextensions;
- break;
- default:
- return BadValue;
- }
-
- n = __glXStrlen(ptr) + 1;
- length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
-
- if ((buf = (char *) Xalloc(length << 2)) == NULL) {
- return BadAlloc;
- }
- __glXStrncpy(buf, ptr, n);
-
- if (client->swapped) {
- glxSwapQueryServerStringReply(client, &reply, buf);
- } else {
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply);
- WriteToClient(client, (int)(length << 2), buf);
- }
-
- __glXFree(buf);
- return Success;
-}
-
-int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
- const char *buf;
-
- cl->GLClientmajorVersion = req->major;
- cl->GLClientminorVersion = req->minor;
- if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
- buf = (const char *)(req+1);
- cl->GLClientextensions = __glXStrdup(buf);
-
- return Success;
-}
-
diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
deleted file mode 100644
index 5237ecad0..000000000
--- a/GL/glx/glxcmdsswap.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.9 2003/10/28 22:50:17 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#define FONT_PCF
-#include "glxserver.h"
-#include "glxutil.h"
-#include <GL/glxtokens.h>
-#include <unpack.h>
-#include <g_disptab.h>
-#include <g_disptab_EXT.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include "glxext.h"
-#include "GL/glx_ansic.h"
-
-/************************************************************************/
-
-/*
-** Byteswapping versions of GLX commands. In most cases they just swap
-** the incoming arguments and then call the unswapped routine. For commands
-** that have replies, a separate swapping routine for the reply is provided;
-** it is called at the end of the unswapped routine.
-*/
-
-int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->visual);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->shareList);
-
- return __glXCreateContext(cl, pc);
-}
-
-int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXDestroyContext(cl, pc);
-}
-
-int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXMakeCurrent(cl, pc);
-}
-
-int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->readdrawable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXMakeContextCurrent(cl, pc);
-}
-
-int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->readable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXMakeCurrentReadSGI(cl, pc);
-}
-
-int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXIsDirect(cl, pc);
-}
-
-int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->majorVersion);
- __GLX_SWAP_INT(&req->minorVersion);
-
- return __glXQueryVersion(cl, pc);
-}
-
-int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- return __glXWaitGL(cl, pc);
-}
-
-int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- return __glXWaitX(cl, pc);
-}
-
-int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->source);
- __GLX_SWAP_INT(&req->dest);
- __GLX_SWAP_INT(&req->mask);
-
- return __glXCopyContext(cl, pc);
-}
-
-int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
- xGLXGetVisualConfigsReply reply;
- __GLXscreenInfo *pGlxScreen;
- __GLXvisualConfig *pGlxVisual;
- CARD32 buf[__GLX_TOTAL_CONFIG];
- unsigned int screen;
- int i, p;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&req->screen);
- screen = req->screen;
- if (screen > screenInfo.numScreens) {
- /* The client library must send a valid screen number. */
- client->errorValue = screen;
- return BadValue;
- }
- pGlxScreen = &__glXActiveScreens[screen];
-
- reply.numVisuals = pGlxScreen->numUsableVisuals;
- reply.numProps = __GLX_TOTAL_CONFIG;
- reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
- __GLX_SWAP_INT(&reply.numVisuals);
- __GLX_SWAP_INT(&reply.numProps);
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
-
- for (i=0; i < pGlxScreen->numVisuals; i++) {
- pGlxVisual = &pGlxScreen->pGlxVisual[i];
- if (pGlxVisual->vid == 0) {
- /* not a usable visual */
- continue;
- }
- p = 0;
- buf[p++] = pGlxVisual->vid;
- buf[p++] = pGlxVisual->class;
- buf[p++] = pGlxVisual->rgba;
-
- buf[p++] = pGlxVisual->redSize;
- buf[p++] = pGlxVisual->greenSize;
- buf[p++] = pGlxVisual->blueSize;
- buf[p++] = pGlxVisual->alphaSize;
- buf[p++] = pGlxVisual->accumRedSize;
- buf[p++] = pGlxVisual->accumGreenSize;
- buf[p++] = pGlxVisual->accumBlueSize;
- buf[p++] = pGlxVisual->accumAlphaSize;
-
- buf[p++] = pGlxVisual->doubleBuffer;
- buf[p++] = pGlxVisual->stereo;
-
- buf[p++] = pGlxVisual->bufferSize;
- buf[p++] = pGlxVisual->depthSize;
- buf[p++] = pGlxVisual->stencilSize;
- buf[p++] = pGlxVisual->auxBuffers;
- buf[p++] = pGlxVisual->level;
- /*
- ** Add token/value pairs for extensions.
- */
- buf[p++] = GLX_VISUAL_CAVEAT_EXT;
- buf[p++] = pGlxVisual->visualRating;
- buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
- buf[p++] = pGlxVisual->transparentPixel;
- buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentRed;
- buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentGreen;
- buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentBlue;
- buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentAlpha;
- buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentIndex;
-
- __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *)buf);
- }
- return Success;
-}
-
-int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->visual);
- __GLX_SWAP_INT(&req->pixmap);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXCreateGLXPixmap(cl, pc);
-}
-
-int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXDestroyGLXPixmap(cl, pc);
-}
-
-int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->drawable);
-
- return __glXSwapBuffers(cl, pc);
-}
-
-int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->font);
- __GLX_SWAP_INT(&req->first);
- __GLX_SWAP_INT(&req->count);
- __GLX_SWAP_INT(&req->listBase);
-
- return __glXUseXFont(cl, pc);
-}
-
-
-int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryExtensionsStringReq *req = NULL;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
-
- return __glXQueryExtensionsString(cl, pc);
-}
-
-int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->name);
-
- return __glXQueryServerString(cl, pc);
-}
-
-int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->major);
- __GLX_SWAP_INT(&req->minor);
- __GLX_SWAP_INT(&req->numbytes);
-
- return __glXClientInfo(cl, pc);
-}
-
-int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXQueryContextInfoEXT(cl, pc);
-}
-
-/************************************************************************/
-
-/*
-** Swap replies.
-*/
-
-void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->contextTag);
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
-}
-
-void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
-}
-
-void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->majorVersion);
- __GLX_SWAP_INT(&reply->minorVersion);
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
-}
-
-void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, buf);
-}
-
-void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
- /** no swap is needed for an array of chars **/
- /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
- WriteToClient(client, length << 2, buf);
-}
-
-void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, (char *)buf);
-}
-
-
-/************************************************************************/
-
-/*
-** Render and Renderlarge are not in the GLX API. They are used by the GLX
-** client library to send batches of GL rendering commands.
-*/
-
-int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderReq *req;
- ClientPtr client= cl->client;
- int left, cmdlen, error;
- int commandsDone;
- CARD16 opcode;
- __GLXrenderHeader *hdr;
- __GLXcontext *cx;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- /*
- ** NOTE: much of this code also appears in the nonswapping version of this
- ** routine, __glXRender(). Any changes made here should also be
- ** duplicated there.
- */
-
- req = (xGLXRenderReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- cx = __glXForceCurrent(cl, req->contextTag, &error);
- if (!cx) {
- return error;
- }
-
- commandsDone = 0;
- pc += sz_xGLXRenderReq;
- left = (req->length << 2) - sz_xGLXRenderReq;
- while (left > 0) {
- __GLXrenderSizeData *entry;
- int extra;
- void (* proc)(GLbyte *);
-
- /*
- ** Verify that the header length and the overall length agree.
- ** Also, each command must be word aligned.
- */
- hdr = (__GLXrenderHeader *) pc;
- __GLX_SWAP_SHORT(&hdr->length);
- __GLX_SWAP_SHORT(&hdr->opcode);
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- entry = &__glXRenderSizeTable[opcode];
- proc = __glXSwapRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- entry = &__glXRenderSizeTable_EXT[index];
- proc = __glXSwapRenderTable_EXT[index];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = commandsDone;
- return __glXBadRenderRequest;
- }
- if (!entry->bytes) {
- /* unused opcode */
- client->errorValue = commandsDone;
- return __glXBadRenderRequest;
- }
- if (entry->varsize) {
- /* variable size command */
- extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True);
- if (extra < 0) {
- extra = 0;
- }
- if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry->bytes)) {
- return BadLength;
- }
- }
- if (left < cmdlen) {
- return BadLength;
- }
-
- /*
- ** Skip over the header and execute the command. We allow the
- ** caller to trash the command memory. This is useful especially
- ** for things that require double alignment - they can just shift
- ** the data towards lower memory (trashing the header) by 4 bytes
- ** and achieve the required alignment.
- */
- (*proc)(pc + __GLX_RENDER_HDR_SIZE);
- pc += cmdlen;
- left -= cmdlen;
- commandsDone++;
- }
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-/*
-** Execute a large rendering request (one that spans multiple X requests).
-*/
-int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderLargeReq *req;
- ClientPtr client= cl->client;
- size_t dataBytes;
- void (*proc)(GLbyte *);
- __GLXrenderLargeHeader *hdr;
- __GLXcontext *cx;
- int error;
- CARD16 opcode;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- /*
- ** NOTE: much of this code also appears in the nonswapping version of this
- ** routine, __glXRenderLarge(). Any changes made here should also be
- ** duplicated there.
- */
-
- req = (xGLXRenderLargeReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->dataBytes);
- __GLX_SWAP_SHORT(&req->requestNumber);
- __GLX_SWAP_SHORT(&req->requestTotal);
- cx = __glXForceCurrent(cl, req->contextTag, &error);
- if (!cx) {
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return error;
- }
- dataBytes = req->dataBytes;
-
- /*
- ** Check the request length.
- */
- if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
- client->errorValue = req->length;
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return BadLength;
- }
- pc += sz_xGLXRenderLargeReq;
-
- if (cl->largeCmdRequestsSoFar == 0) {
- __GLXrenderSizeData *entry;
- int extra;
- size_t cmdlen;
- /*
- ** This is the first request of a multi request command.
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (req->requestNumber != 1) {
- client->errorValue = req->requestNumber;
- return __glXBadLargeRequest;
- }
- hdr = (__GLXrenderLargeHeader *) pc;
- __GLX_SWAP_INT(&hdr->length);
- __GLX_SWAP_INT(&hdr->opcode);
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- entry = &__glXRenderSizeTable[opcode];
- proc = __glXSwapRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- entry = &__glXRenderSizeTable_EXT[index];
- proc = __glXSwapRenderTable_EXT[index];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
-
- if (!entry->bytes) {
- /* unused opcode */
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
- if (entry->varsize) {
- /*
- ** If it's a variable-size command (a command whose length must
- ** be computed from its parameters), all the parameters needed
- ** will be in the 1st request, so it's okay to do this.
- */
- extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True);
- if (extra < 0) {
- extra = 0;
- }
- /* large command's header is 4 bytes longer, so add 4 */
- if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry->bytes + 4)) {
- return BadLength;
- }
- }
- /*
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (cl->largeCmdBufSize < cmdlen) {
- if (!cl->largeCmdBuf) {
- cl->largeCmdBuf = (GLbyte *) __glXMalloc(cmdlen);
- } else {
- cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, cmdlen);
- }
- if (!cl->largeCmdBuf) {
- return BadAlloc;
- }
- cl->largeCmdBufSize = cmdlen;
- }
- __glXMemcpy(cl->largeCmdBuf, pc, dataBytes);
-
- cl->largeCmdBytesSoFar = dataBytes;
- cl->largeCmdBytesTotal = cmdlen;
- cl->largeCmdRequestsSoFar = 1;
- cl->largeCmdRequestsTotal = req->requestTotal;
- return Success;
-
- } else {
- /*
- ** We are receiving subsequent (i.e. not the first) requests of a
- ** multi request command.
- */
-
- /*
- ** Check the request number and the total request count.
- */
- if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
- client->errorValue = req->requestNumber;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- if (req->requestTotal != cl->largeCmdRequestsTotal) {
- client->errorValue = req->requestTotal;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
-
- /*
- ** Check that we didn't get too much data.
- */
- if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
- cl->largeCmdBytesSoFar += dataBytes;
- cl->largeCmdRequestsSoFar++;
-
- if (req->requestNumber == cl->largeCmdRequestsTotal) {
- /*
- ** This is the last request; it must have enough bytes to complete
- ** the command.
- */
- /* NOTE: the two pad macros have been added below; they are needed
- ** because the client library pads the total byte count, but not
- ** the per-request byte counts. The Protocol Encoding says the
- ** total byte count should not be padded, so a proposal will be
- ** made to the ARB to relax the padding constraint on the total
- ** byte count, thus preserving backward compatibility. Meanwhile,
- ** the padding done below fixes a bug that did not allow
- ** large commands of odd sizes to be accepted by the server.
- */
- if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
- __GLX_PAD(cl->largeCmdBytesTotal)) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXBadLargeRequest;
- }
- hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
- /*
- ** The opcode and length field in the header had already been
- ** swapped when the first request was received.
- */
-
- /*
- ** Use the opcode to index into the procedure table.
- */
- opcode = hdr->opcode;
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXSwapRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- proc = __glXSwapRenderTable_EXT[index];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = opcode;
- return __glXBadLargeRequest;
- }
-
- /*
- ** Skip over the header and execute the command.
- */
- (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
-
- /*
- ** Reset for the next RenderLarge series.
- */
- __glXResetLargeCommandStatus(cl);
- } else {
- /*
- ** This is neither the first nor the last request.
- */
- }
- return Success;
- }
-}
-
-/************************************************************************/
-
-/*
-** No support is provided for the vendor-private requests other than
-** allocating these entry points in the dispatch table.
-*/
-
-int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req;
- GLint vendorcode;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXVendorPrivateReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
-
- vendorcode = req->vendorCode;
-
- if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
- (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
- (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
- return Success;
- }
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
-}
-
-int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateWithReplyReq *req;
- GLint vendorcode;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXVendorPrivateWithReplyReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
-
- vendorcode = req->vendorCode;
-
- switch (vendorcode) {
- case X_GLXvop_QueryContextInfoEXT:
- return __glXSwapQueryContextInfoEXT(cl, pc);
- case X_GLXvop_MakeCurrentReadSGI:
- return __glXSwapMakeCurrentReadSGI(cl, pc);
- default:
- break;
- }
-
-
- if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
- (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
- return (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
- }
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
-}
diff --git a/GL/glx/glxcontext.h b/GL/glx/glxcontext.h
deleted file mode 100644
index 6454b4952..000000000
--- a/GL/glx/glxcontext.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxcontext.h,v 1.5 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _GLX_context_h_
-#define _GLX_context_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-typedef struct __GLXcontextRec __GLXcontext;
-
-/* XXX: should be defined somewhere globally */
-#define CAPI
-
-#include "GL/internal/glcore.h"
-
-struct __GLXcontextRec {
- /*
- ** list of context structs
- */
- struct __GLXcontextRec *last;
- struct __GLXcontextRec *next;
-
- /*
- ** list of contexts bound to the same drawable
- */
- struct __GLXcontextRec *nextDrawPriv;
- struct __GLXcontextRec *nextReadPriv;
-
- /*
- ** Opaque pointer the context object created by the GL that the
- ** server is bound with. Never dereferenced by this code, but used
- ** as a handle to feed to the routines in the screen info struct.
- */
- __GLinterface *gc;
-
- /*
- ** mode struct for this context
- */
- __GLcontextModes *modes;
-
- /*
- ** Pointer to screen info data for this context. This is set
- ** when the context is created.
- */
- ScreenPtr pScreen;
- __GLXscreenInfo *pGlxScreen;
-
- /*
- ** This context is created with respect to this visual.
- */
- VisualRec *pVisual;
- __GLXvisualConfig *pGlxVisual;
-
- /*
- ** The XID of this context.
- */
- XID id;
-
- /*
- ** The XID of the shareList context.
- */
- XID share_id;
-
- /*
- ** Visual id.
- */
- VisualID vid;
-
- /*
- ** screen number.
- */
- GLint screen;
-
- /*
- ** Whether this context's ID still exists.
- */
- GLboolean idExists;
-
- /*
- ** Whether this context is current for some client.
- */
- GLboolean isCurrent;
-
- /*
- ** Whether this context is a direct rendering context.
- */
- GLboolean isDirect;
-
- /*
- ** Window pending state
- */
- GLuint pendingState;
-
- /*
- ** This flag keeps track of whether there are unflushed GL commands.
- */
- GLboolean hasUnflushedCommands;
-
- /*
- ** Current rendering mode for this context.
- */
- GLenum renderMode;
-
- /*
- ** Buffers for feedback and selection.
- */
- GLfloat *feedbackBuf;
- GLint feedbackBufSize; /* number of elements allocated */
- GLuint *selectBuf;
- GLint selectBufSize; /* number of elements allocated */
-
- /*
- ** Set only if current drawable is a glx pixmap.
- */
- __GLXpixmap *drawPixmap;
- __GLXpixmap *readPixmap;
-
- /*
- ** The drawable private this context is bound to
- */
- __GLXdrawablePrivate *drawPriv;
- __GLXdrawablePrivate *readPriv;
-};
-
-/* pending state defines */
-#define __GLX_PENDING_RESIZE 0x1
-#define __GLX_PENDING_DESTROY 0x2
-#define __GLX_PENDING_SWAP 0x4
-
-#endif /* !__GLX_context_h__ */
diff --git a/GL/glx/glxdrawable.h b/GL/glx/glxdrawable.h
deleted file mode 100644
index a2c806f44..000000000
--- a/GL/glx/glxdrawable.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxdrawable.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _GLX_drawable_h_
-#define _GLX_drawable_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-typedef struct {
-
- DrawablePtr pDraw;
- __GLXvisualConfig *pGlxVisual;
- __GLXscreenInfo *pGlxScreen;
- ScreenPtr pScreen;
- Bool idExists;
- int refcnt;
-
-} __GLXpixmap;
-
-struct __GLXdrawablePrivateRec {
- /*
- ** list of drawable private structs
- */
- struct __GLXdrawablePrivateRec *last;
- struct __GLXdrawablePrivateRec *next;
-
- DrawablePtr pDraw;
- XID drawId;
- __GLXpixmap *pGlxPixmap;
-
- /*
- ** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
- ** Needed by the resource freer because pDraw might already have been
- ** freed.
- */
- int type;
-
- /*
- ** Configuration of the visual to which this drawable was created.
- */
- __GLXvisualConfig *pGlxVisual;
-
- /*
- ** cached drawable size and origin
- */
- GLint xorigin, yorigin;
- GLint width, height;
-
- /*
- ** Lists of contexts bound to this drawable. There are two lists here.
- ** One list is of the contexts that have this drawable bound for drawing,
- ** and the other is the list of contexts that have this drawable bound
- ** for reading.
- */
- struct __GLXcontextRec *drawGlxc;
- struct __GLXcontextRec *readGlxc;
-
- /*
- ** "methods" that the drawble should be able to respond to.
- */
- void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
- void (*updatePalette)(struct __GLXdrawablePrivateRec *);
- GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
-
- /*
- ** The GL drawable (information shared between GLX and the GL core)
- */
- __GLdrawablePrivate glPriv;
-
- /*
- ** reference count
- */
- int refCount;
-};
-
-#endif /* !__GLX_drawable_h__ */
diff --git a/GL/glx/glxerror.h b/GL/glx/glxerror.h
deleted file mode 100644
index 3c1e93c61..000000000
--- a/GL/glx/glxerror.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxerror.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-#ifndef _GLX_error_h_
-#define _GLX_error_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** Error codes. These have the extension error base added to them
-** when the extension initializes.
-*/
-extern int __glXBadContext;
-extern int __glXBadContextState;
-extern int __glXBadDrawable;
-extern int __glXBadPixmap;
-extern int __glXBadCurrentWindow;
-extern int __glXBadContextTag;
-extern int __glXBadRenderRequest;
-extern int __glXBadLargeRequest;
-extern int __glXUnsupportedPrivateRequest;
-
-#endif
diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c
deleted file mode 100644
index 716950953..000000000
--- a/GL/glx/glxext.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $
-** The contents of this file are subject to the GLX Public License Version 1.0
-** (the "License"). You may not use this file except in compliance with the
-** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
-** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
-** or at http://www.sgi.com/software/opensource/glx/license.html.
-**
-** Software distributed under the License is distributed on an "AS IS"
-** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
-** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
-** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
-** language governing rights and limitations under the License.
-**
-** The Original Software is GLX version 1.2 source code, released February,
-** 1999. The developer of the Original Software is Silicon Graphics, Inc.
-** Those portions of the Subject Software created by Silicon Graphics, Inc.
-** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include <windowstr.h>
-#include <propertyst.h>
-#include <os.h>
-#include "g_disptab.h"
-#include "unpack.h"
-#include "glxutil.h"
-#include "glxext.h"
-#include "micmap.h"
-
-
-extern __GLXextensionInfo __glDDXExtensionInfo;
-
-__GLXextensionInfo *__glXExt = &__glDDXExtensionInfo;
-
-/*
-** Forward declarations.
-*/
-static int __glXSwapDispatch(ClientPtr);
-static int __glXDispatch(ClientPtr);
-
-/*
-** Called when the extension is reset.
-*/
-static void ResetExtension(ExtensionEntry* extEntry)
-{
- __glXFlushContextCache();
- (*__glXExt->resetExtension)();
- __glXScreenReset();
-}
-
-/*
-** Initialize the per-client context storage.
-*/
-static void ResetClientState(int clientIndex)
-{
- __GLXclientState *cl = __glXClients[clientIndex];
-
- if (cl->returnBuf) __glXFree(cl->returnBuf);
- if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf);
- if (cl->currentContexts) __glXFree(cl->currentContexts);
- __glXMemset(cl, 0, sizeof(__GLXclientState));
- /*
- ** By default, assume that the client supports
- ** GLX major version 1 minor version 0 protocol.
- */
- cl->GLClientmajorVersion = 1;
- cl->GLClientminorVersion = 0;
- if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
-
-}
-
-/*
-** Reset state used to keep track of large (multi-request) commands.
-*/
-void __glXResetLargeCommandStatus(__GLXclientState *cl)
-{
- cl->largeCmdBytesSoFar = 0;
- cl->largeCmdBytesTotal = 0;
- cl->largeCmdRequestsSoFar = 0;
- cl->largeCmdRequestsTotal = 0;
-}
-
-/*
-** This procedure is called when the client who created the context goes
-** away OR when glXDestroyContext is called. In either case, all we do is
-** flag that the ID is no longer valid, and (maybe) free the context.
-** use.
-*/
-static int ContextGone(__GLXcontext* cx, XID id)
-{
- cx->idExists = GL_FALSE;
- if (!cx->isCurrent) {
- __glXFreeContext(cx);
- }
-
- return True;
-}
-
-/*
-** Free a client's state.
-*/
-static int ClientGone(int clientIndex, XID id)
-{
- __GLXcontext *cx;
- __GLXclientState *cl = __glXClients[clientIndex];
- int i;
-
- if (cl) {
- /*
- ** Free all the contexts that are current for this client.
- */
- for (i=0; i < cl->numCurrentContexts; i++) {
- cx = cl->currentContexts[i];
- if (cx) {
- __glXDeassociateContext(cx);
- cx->isCurrent = GL_FALSE;
- if (!cx->idExists) {
- __glXFreeContext(cx);
- }
- }
- }
- /*
- ** Re-initialize the client state structure. Don't free it because
- ** we'll probably get another client with this index and use the struct
- ** again. There is a maximum of MAXCLIENTS of these structures.
- */
- ResetClientState(clientIndex);
- }
-
- return True;
-}
-
-/*
-** Free a GLX Pixmap.
-*/
-static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
-{
- PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
-
- pGlxPixmap->idExists = False;
- if (!pGlxPixmap->refcnt) {
- /*
- ** The DestroyPixmap routine should decrement the refcount and free
- ** only if it's zero.
- */
- (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
- __glXFree(pGlxPixmap);
- }
-
- return True;
-}
-
-/*
-** Free a context.
-*/
-GLboolean __glXFreeContext(__GLXcontext *cx)
-{
- if (cx->idExists || cx->isCurrent) return GL_FALSE;
-
- if (!cx->isDirect) {
- if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
- return GL_FALSE;
- }
- }
- if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
- if (cx->selectBuf) __glXFree(cx->selectBuf);
- __glXFree(cx);
- if (cx == __glXLastContext) {
- __glXFlushContextCache();
- }
-
- return GL_TRUE;
-}
-
-/************************************************************************/
-
-/*
-** These routines can be used to check whether a particular GL command
-** has caused an error. Specifically, we use them to check whether a
-** given query has caused an error, in which case a zero-length data
-** reply is sent to the client.
-*/
-
-static GLboolean errorOccured = GL_FALSE;
-
-/*
-** The GL was will call this routine if an error occurs.
-*/
-void __glXErrorCallBack(__GLinterface *gc, GLenum code)
-{
- errorOccured = GL_TRUE;
-}
-
-/*
-** Clear the error flag before calling the GL command.
-*/
-void __glXClearErrorOccured(void)
-{
- errorOccured = GL_FALSE;
-}
-
-/*
-** Check if the GL command caused an error.
-*/
-GLboolean __glXErrorOccured(void)
-{
- return errorOccured;
-}
-
-/************************************************************************/
-
-/*
-** Initialize the GLX extension.
-*/
-void GlxExtensionInit(void)
-{
- ExtensionEntry *extEntry;
- int i;
-
-#ifdef X11R5
- __glXContextRes = CreateNewResourceType(ContextGone);
- __glXClientRes = CreateNewResourceType(ClientGone);
- __glXPixmapRes = CreateNewResourceType(PixmapGone);
-#else
- __glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
- __glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
- __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
-#endif
-
- /*
- ** Add extension to server extensions.
- */
- extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
- __GLX_NUMBER_ERRORS, __glXDispatch,
- __glXSwapDispatch, ResetExtension,
- StandardMinorOpcode);
- if (!extEntry) {
- FatalError("__glXExtensionInit: AddExtensions failed\n");
- return;
- }
- if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
- ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
- return;
- }
-
- __glXBadContext = extEntry->errorBase + GLXBadContext;
- __glXBadContextState = extEntry->errorBase + GLXBadContextState;
- __glXBadDrawable = extEntry->errorBase + GLXBadDrawable;
- __glXBadPixmap = extEntry->errorBase + GLXBadPixmap;
- __glXBadContextTag = extEntry->errorBase + GLXBadContextTag;
- __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow;
- __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
- __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
- __glXUnsupportedPrivateRequest = extEntry->errorBase +
- GLXUnsupportedPrivateRequest;
-
- /*
- ** Initialize table of client state. There is never a client 0.
- */
- for (i=1; i <= MAXCLIENTS; i++) {
- __glXClients[i] = 0;
- }
-
- /*
- ** Initialize screen specific data.
- */
- __glXScreenInit(screenInfo.numScreens);
-}
-
-/************************************************************************/
-
-Bool __glXCoreType(void)
-{
- return __glXExt->type;
-}
-
-/************************************************************************/
-
-void GlxSetVisualConfigs(int nconfigs,
- __GLXvisualConfig *configs, void **privates)
-{
- (*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
-}
-
-static miInitVisualsProcPtr saveInitVisualsProc;
-
-Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
- int *nvisualp, int *ndepthp,
- int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB,
- int preferredVis)
-{
- Bool ret;
-
- if (saveInitVisualsProc) {
- ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
- rootDepthp, defaultVisp, sizes, bitsPerRGB,
- preferredVis);
- if (!ret)
- return False;
- }
- (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB);
- return True;
-}
-
-void
-GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
-{
- saveInitVisualsProc = *initVisProc;
- *initVisProc = GlxInitVisuals;
-}
-
-/************************************************************************/
-
-void __glXFlushContextCache(void)
-{
- __glXLastContext = 0;
-}
-
-/*
-** Make a context the current one for the GL (in this implementation, there
-** is only one instance of the GL, and we use it to serve all GL clients by
-** switching it between different contexts). While we are at it, look up
-** a context by its tag and return its (__GLXcontext *).
-*/
-__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
- int *error)
-{
- __GLXcontext *cx;
-
- /*
- ** See if the context tag is legal; it is managed by the extension,
- ** so if it's invalid, we have an implementation error.
- */
- cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag);
- if (!cx) {
- cl->client->errorValue = tag;
- *error = __glXBadContextTag;
- return 0;
- }
-
- if (!cx->isDirect) {
- if (cx->drawPriv == NULL) {
- /*
- ** The drawable has vanished. It must be a window, because only
- ** windows can be destroyed from under us; GLX pixmaps are
- ** refcounted and don't go away until no one is using them.
- */
- *error = __glXBadCurrentWindow;
- return 0;
- }
- }
-
- if (cx == __glXLastContext) {
- /* No need to re-bind */
- return cx;
- }
-
- /* Make this context the current one for the GL. */
- if (!cx->isDirect) {
- if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
- /* Bind failed, and set the error code. Bummer */
- cl->client->errorValue = cx->id;
- *error = __glXBadContextState;
- return 0;
- }
- }
- __glXLastContext = cx;
- return cx;
-}
-
-/************************************************************************/
-
-/*
-** Top level dispatcher; all commands are executed from here down.
-*/
-static int __glXDispatch(ClientPtr client)
-{
- REQUEST(xGLXSingleReq);
- CARD8 opcode;
- int (*proc)(__GLXclientState *cl, GLbyte *pc);
- __GLXclientState *cl;
-
- opcode = stuff->glxCode;
- cl = __glXClients[client->index];
- if (!cl) {
- cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
- __glXClients[client->index] = cl;
- if (!cl) {
- return BadAlloc;
- }
- __glXMemset(cl, 0, sizeof(__GLXclientState));
- }
-
- if (!cl->inUse) {
- /*
- ** This is first request from this client. Associate a resource
- ** with the client so we will be notified when the client dies.
- */
- XID xid = FakeClientID(client->index);
- if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
- return BadAlloc;
- }
- ResetClientState(client->index);
- cl->inUse = GL_TRUE;
- cl->client = client;
- }
-
- /*
- ** Check for valid opcode.
- */
- if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
- return BadRequest;
- }
-
- /*
- ** If we're expecting a glXRenderLarge request, this better be one.
- */
- if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
- client->errorValue = stuff->glxCode;
- return __glXBadLargeRequest;
- }
-
- /*
- ** Use the opcode to index into the procedure table.
- */
- proc = __glXSingleTable[opcode];
- return (*proc)(cl, (GLbyte *) stuff);
-}
-
-static int __glXSwapDispatch(ClientPtr client)
-{
- REQUEST(xGLXSingleReq);
- CARD8 opcode;
- int (*proc)(__GLXclientState *cl, GLbyte *pc);
- __GLXclientState *cl;
-
- opcode = stuff->glxCode;
- cl = __glXClients[client->index];
- if (!cl) {
- cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
- __glXClients[client->index] = cl;
- if (!cl) {
- return BadAlloc;
- }
- __glXMemset(cl, 0, sizeof(__GLXclientState));
- }
-
- if (!cl->inUse) {
- /*
- ** This is first request from this client. Associate a resource
- ** with the client so we will be notified when the client dies.
- */
- XID xid = FakeClientID(client->index);
- if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
- return BadAlloc;
- }
- ResetClientState(client->index);
- cl->inUse = GL_TRUE;
- cl->client = client;
- }
-
- /*
- ** Check for valid opcode.
- */
- if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
- return BadRequest;
- }
-
- /*
- ** Use the opcode to index into the procedure table.
- */
- proc = __glXSwapSingleTable[opcode];
- return (*proc)(cl, (GLbyte *) stuff);
-}
-
-int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
-{
- return BadRequest;
-}
-
-void __glXNoSuchRenderOpcode(GLbyte *pc)
-{
- return;
-}
-
diff --git a/GL/glx/glxext.h b/GL/glx/glxext.h
deleted file mode 100644
index 4ec16d28d..000000000
--- a/GL/glx/glxext.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.7 2003/11/17 22:20:26 dawes Exp $ */
-#ifndef _glxext_h_
-#define _glxext_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
- * Added by VA Linux for XFree86 4.0.x
- */
-typedef struct {
- int type;
- void (*resetExtension)(void);
- Bool (*initVisuals)(
- VisualPtr * visualp,
- DepthPtr * depthp,
- int * nvisualp,
- int * ndepthp,
- int * rootDepthp,
- VisualID * defaultVisp,
- unsigned long sizes,
- int bitsPerRGB
- );
- void (*setVisualConfigs)(
- int nconfigs,
- __GLXvisualConfig *configs,
- void **privates
- );
-} __GLXextensionInfo;
-
-extern GLboolean __glXFreeContext(__GLXcontext *glxc);
-extern void __glXFlushContextCache(void);
-
-extern void __glXNoSuchRenderOpcode(GLbyte*);
-extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
-extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
-extern void __glXClearErrorOccured(void);
-extern GLboolean __glXErrorOccured(void);
-extern void __glXResetLargeCommandStatus(__GLXclientState*);
-
-extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
-
-extern int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
-
-extern void GlxExtensionInit(void);
-
-extern Bool __glXCoreType(void);
-
-extern int GlxInitVisuals(
- VisualPtr * visualp,
- DepthPtr * depthp,
- int * nvisualp,
- int * ndepthp,
- int * rootDepthp,
- VisualID * defaultVisp,
- unsigned long sizes,
- int bitsPerRGB,
- int preferredVis
-);
-
-#endif /* _glxext_h_ */
-
diff --git a/GL/glx/glxfb.c b/GL/glx/glxfb.c
deleted file mode 100644
index 4ce952d51..000000000
--- a/GL/glx/glxfb.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxfb.c,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** An implementation of a buffer which is part of the front buffer
-*/
-
-#include "glxserver.h"
-#include "glxutil.h"
-#include "glxfb.h"
-
-#include <gcstruct.h>
-
-/* so we don't include glmath.h */
-extern GLuint __glFloorLog2(GLuint);
-
-typedef struct __GLFBbufferInfoRec {
- GCPtr pGC;
-} __GLFBbufferInfo;
-
-extern PixmapPtr __glXPrivPixGetPtr(__GLdrawableBuffer *);
-
-/* ---------------------------------------------------------- */
-
-static GLboolean
-Resize(__GLdrawableBuffer *buf,
- GLint x, GLint y, GLuint width, GLuint height,
- __GLdrawablePrivate *glPriv, GLuint bufferMask)
-{
- buf->width = width;
- buf->height = height;
- buf->byteWidth = width * buf->elementSize;
- buf->outerWidth = width;
-
- return GL_TRUE;
-}
-
-static void
-Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-static void
-Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-/*
-** Do a swap buffer with
-** a memory surface as a back buffer
-** a FB surface as a front buffer
-*/
-GLboolean
-__glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv)
-{
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
- __GLdrawableBuffer *front = &glPriv->frontBuffer;
- __GLdrawableBuffer *back = &glPriv->backBuffer;
- __GLFBbufferInfo *bufferInfo;
- GCPtr pGC;
- GLint width, height, depth, pad;
- GLubyte *buf;
-
- bufferInfo = (__GLFBbufferInfo *) front->other;
- pGC = bufferInfo->pGC;
-
- width = back->width;
- height = back->height;
- depth = back->depth;
- buf = back->base;
- pad = back->outerWidth - back->width; /* back buffer padding */
- /* adjust buffer padding. X wants left, GL has right */
- buf -= pad;
-
- ValidateGC(glxPriv->pDraw, pGC);
- (*pGC->ops->PutImage)(glxPriv->pDraw, pGC,
- depth,
- 0, 0, width, height,
- pad, ZPixmap,
- (char *)buf);
-
- return GL_TRUE;
-}
-
-static void
-Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
- __GLFBbufferInfo *bufferInfo;
-
- bufferInfo = (__GLFBbufferInfo *) buf->other;
-
- if (bufferInfo->pGC) {
- FreeScratchGC(bufferInfo->pGC);
- }
-
- __glXFree(bufferInfo);
- buf->other = NULL;
-}
-
-/*
-** function to return the X GC of this buffer (to be used by DDX)
-*/
-GCPtr __glXFBGetGC(__GLdrawableBuffer *buf)
-{
- __GLFBbufferInfo *bufferInfo;
-
- bufferInfo = (__GLFBbufferInfo *) buf->other;
-
- if (bufferInfo) {
- return bufferInfo->pGC;
- } else {
- return NULL;
- }
-}
-
-
-void
-__glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
-{
- __GLFBbufferInfo *bufferInfo;
- __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *) glPriv->other;
- GCPtr pGC;
-
- buf->depth = bits;
- buf->width = buf->height = 0; /* to be filled during Update */
- buf->handle = buf->base = NULL; /* to be filled during Update */
- buf->size = 0;
- buf->byteWidth = 0;
- buf->elementSize = ((bits-1) / 8) + 1;
- buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
-
- buf->resize = Resize;
- buf->lock = Lock;
- buf->unlock = Unlock;
- buf->fill = NULL;
- buf->free = Free;
-
- /* allocate local information */
- bufferInfo = (__GLFBbufferInfo *) __glXMalloc(sizeof(__GLFBbufferInfo));
- buf->other = (void *) bufferInfo;
-
- pGC = CreateScratchGC(glxPriv->pDraw->pScreen,
- glxPriv->pDraw->depth);
- bufferInfo->pGC = pGC;
- (*pGC->funcs->ChangeClip)(pGC, CT_NONE, NULL, 0);
-}
diff --git a/GL/glx/glxfb.h b/GL/glx/glxfb.h
deleted file mode 100644
index 44a72a3e2..000000000
--- a/GL/glx/glxfb.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxfb.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-#ifndef _glxfb_h_
-#define _glxfb_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
- GLint bits);
-
-extern GCPtr __glXFBGetGC(__GLdrawableBuffer *buf);
-
-extern GLboolean __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv);
-
-#endif /* _glxfb_h_ */
-
diff --git a/GL/glx/glximports.c b/GL/glx/glximports.c
deleted file mode 100644
index 7ec1134cd..000000000
--- a/GL/glx/glximports.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glximports.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxserver.h"
-#include "glxcontext.h"
-#include "glximports.h"
-#include "GL/glx_ansic.h"
-
-void *__glXImpMalloc(__GLcontext *gc, size_t size)
-{
- void *addr;
-
- if (size == 0) {
- return NULL;
- }
- addr = xalloc(size);
- if (addr == NULL) {
- /* XXX: handle out of memory error */
- return NULL;
- }
- return addr;
-}
-
-void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
-{
- void *addr;
- size_t size;
-
- if ((numElements == 0) || (elementSize == 0)) {
- return NULL;
- }
- size = numElements * elementSize;
- addr = xalloc(size);
- if (addr == NULL) {
- /* XXX: handle out of memory error */
- return NULL;
- }
- /* zero out memory */
- __glXMemset(addr, 0, size);
-
- return addr;
-}
-
-void __glXImpFree(__GLcontext *gc, void *addr)
-{
- if (addr) {
- xfree(addr);
- }
-}
-
-void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
-{
- void *newAddr;
-
- if (addr) {
- if (newSize == 0) {
- xfree(addr);
- return NULL;
- }
- newAddr = xrealloc(addr, newSize);
- } else {
- if (newSize == 0) {
- return NULL;
- }
- newAddr = xalloc(newSize);
- }
- if (newAddr == NULL) {
- return NULL; /* XXX: out of memory error */
- }
-
- return newAddr;
-}
-
-void __glXImpWarning(__GLcontext *gc, char *msg)
-{
- ErrorF((char *)msg);
-}
-
-void __glXImpFatal(__GLcontext *gc, char *msg)
-{
- ErrorF((char *)msg);
- __glXAbort();
-}
-
-char *__glXImpGetenv(__GLcontext *gc, const char *var)
-{
- return __glXGetenv(var);
-}
-
-int __glXImpAtoi(__GLcontext *gc, const char *str)
-{
- return __glXAtoi(str);
-}
-
-int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- /* have to deal with var args */
- va_start(ap, fmt);
- ret = __glXVsprintf(str, fmt, ap);
- va_end(ap);
-
- return ret;
-}
-
-void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode)
-{
- return (void *) __glXFopen(path, mode);
-}
-
-int __glXImpFclose(__GLcontext *gc, void *stream)
-{
- return __glXFclose((FILE *)stream);
-}
-
-int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- /* have to deal with var args */
- va_start(ap, fmt);
- ret = __glXVfprintf((FILE *)stream, fmt, ap);
- va_end(ap);
-
- return ret;
-}
-
-
-__GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc)
-{
- __GLinterface *glci = (__GLinterface *) gc;
- __GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
-
- return &glrc->drawPriv->glPriv;
-}
-
-
-__GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc)
-{
- __GLinterface *glci = (__GLinterface *) gc;
- __GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
-
- return &glrc->readPriv->glPriv;
-}
diff --git a/GL/glx/glximports.h b/GL/glx/glximports.h
deleted file mode 100644
index e1a65a70e..000000000
--- a/GL/glx/glximports.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glximports.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _glximports_h_
-#define _glximports_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void *__glXImpMalloc(__GLcontext *gc, size_t size);
-extern void *__glXImpCalloc(__GLcontext *gc, size_t nElem, size_t eSize);
-extern void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize);
-extern void __glXImpFree(__GLcontext *gc, void *addr);
-
-extern void __glXImpWarning(__GLcontext *gc, char *msg);
-extern void __glXImpFatal(__GLcontext *gc, char *msg);
-
-extern char *__glXImpGetenv(__GLcontext *gc, const char *var);
-extern int __glXImpAtoi(__GLcontext *gc, const char *str);
-extern int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...);
-extern void *__glXImpFopen(__GLcontext *gc, const char *path,
- const char *mode);
-extern int __glXImpFclose(__GLcontext *gc, void *stream);
-extern int __glXImpFprintf(__GLcontext *gc, void *stream,
- const char *fmt, ...);
-
-extern __GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc);
-extern __GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc);
-
-
-#endif /* _glximports_h_ */
-
diff --git a/GL/glx/glxmem.c b/GL/glx/glxmem.c
deleted file mode 100644
index 0c3ea25a7..000000000
--- a/GL/glx/glxmem.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.c,v 1.7 2002/08/28 06:41:26 torrey Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** Implementation of a buffer in main memory
-*/
-
-#include "glxserver.h"
-#include "glxmem.h"
-#include "glxext.h"
-#include "GL/internal/glcore.h"
-
-/* don't want to include glmath.h */
-extern GLuint __glFloorLog2(GLuint);
-
-/* ---------------------------------------------------------- */
-
-#define BUF_ALIGN 32 /* x86 cache alignment (used for assembly paths) */
-#define BUF_ALIGN_MASK (BUF_ALIGN-1)
-
-static GLboolean
-Resize(__GLdrawableBuffer *buf,
- GLint x, GLint y, GLuint width, GLuint height,
- __GLdrawablePrivate *glPriv, GLuint bufferMask)
-{
- GLuint newSize;
- void *ubase;
- GLint pixelWidth;
- GLint alignedWidth;
-
- /*
- ** Note:
- ** buf->handle : unaligned base
- ** buf->base : aligned base
- */
-
- pixelWidth = BUF_ALIGN / buf->elementSize;
- alignedWidth = (width & ~(pixelWidth-1)) + pixelWidth;
-
- newSize = alignedWidth * height * buf->elementSize;
-
- /*
- ** Only allocate buffer space for the SGI core.
- ** Mesa and Aqua handle their own buffer allocations.
- */
-#if defined(__GL_BUFFER_SIZE_TRACKS_WINDOW)
- if (__glXCoreType() == GL_CORE_SGI) {
-#else
- if (newSize > buf->size && __glXCoreType() == GL_CORE_SGI) {
-#endif
- if (buf->handle) {
- ubase = (*glPriv->realloc)(buf->handle, newSize + BUF_ALIGN_MASK);
- if (ubase == NULL) {
- return GL_FALSE;
- }
- } else {
- ubase = (*glPriv->malloc)(newSize + BUF_ALIGN_MASK);
- if (ubase == NULL) {
- return GL_FALSE;
- }
- }
- buf->size = newSize;
-
- buf->handle = ubase;
- buf->base = (void *)(((size_t)ubase + BUF_ALIGN_MASK) &
- (unsigned int) ~BUF_ALIGN_MASK);
- assert(((size_t)buf->base % BUF_ALIGN) == 0);
- }
-
- buf->width = width;
- buf->height = height;
- buf->byteWidth = alignedWidth * buf->elementSize;
- buf->outerWidth = alignedWidth;
-
- return GL_TRUE;
-}
-
-static void
-Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-static void
-Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-static void
-Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
- if (buf->handle) {
- (*glPriv->free)(buf->handle);
- buf->handle = NULL;
- }
-}
-
-
-void
-__glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
-{
- buf->width = buf->height = 0; /* to be filled during Update */
- buf->depth = bits;
- buf->size = 0;
- buf->handle = buf->base = NULL; /* to be filled during Update */
- buf->byteWidth = 0;
- buf->elementSize = ((bits - 1) / 8) + 1;
- buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
-
- buf->resize = Resize;
- buf->lock = Lock;
- buf->unlock = Unlock;
- buf->fill = NULL;
- buf->free = Free;
-}
diff --git a/GL/glx/glxmem.h b/GL/glx/glxmem.h
deleted file mode 100644
index 93a277559..000000000
--- a/GL/glx/glxmem.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-#ifndef _glxmem_h_
-#define _glxmem_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void __glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
- GLint bits);
-
-#endif /* _glxmem_h_ */
-
diff --git a/GL/glx/glxpix.c b/GL/glx/glxpix.c
deleted file mode 100644
index b21d4ade9..000000000
--- a/GL/glx/glxpix.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.c,v 1.4 2001/03/21 16:29:36 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** An implementation of a glx pixmap buffer
-*/
-
-#include "glxserver.h"
-#include "glxutil.h"
-#include "glxpix.h"
-
-#include <gcstruct.h>
-
-/* don't want to include glmath.h */
-extern GLuint __glFloorLog2(GLuint);
-
-typedef struct __GLPixBufferInfoRec {
- GCPtr pGC;
-} __GLPixBufferInfo;
-
-/* ---------------------------------------------------------- */
-
-static GLboolean
-Resize(__GLdrawableBuffer *buf,
- GLint x, GLint y, GLuint width, GLuint height,
- __GLdrawablePrivate *glPriv, GLuint bufferMask)
-{
- buf->width = width;
- buf->height = width;
- buf->byteWidth = width * buf->elementSize;
- buf->outerWidth = width;
-
- return GL_TRUE;
-}
-
-static void
-Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-static void
-Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
-}
-
-static void
-Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
-{
- __GLPixBufferInfo *bufferInfo;
-
- if (LookupIDByType((XID)(long)buf->handle, __glXPixmapRes)) {
- FreeResource((XID)(long)buf->handle, FALSE);
- buf->handle = NULL;
- }
-
- bufferInfo = (__GLPixBufferInfo *) buf->other;
-
- if (bufferInfo->pGC) {
- FreeScratchGC(bufferInfo->pGC);
- }
-
- __glXFree(bufferInfo);
- buf->other = NULL;
-}
-
-void
-__glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
- GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap)
-{
- __GLPixBufferInfo *bufferInfo;
-
- buf->width = buf->height = 0; /* to be filled during Update */
- buf->depth = bits;
- buf->size = 0;
- buf->base = NULL;
- buf->byteWidth = 0;
- buf->elementSize = ((bits-1) / 8) + 1;
- buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
-
- buf->handle = (void *)(long) glxpixmapId;
- pGlxPixmap->refcnt++;
-
- buf->resize = Resize;
- buf->lock = Lock;
- buf->unlock = Unlock;
- buf->fill = NULL;
- buf->free = Free;
-
- /* allocate local information */
- bufferInfo = (__GLPixBufferInfo *) __glXMalloc(sizeof(__GLPixBufferInfo));
- buf->other = (void *) bufferInfo;
-
- bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen,
- pGlxPixmap->pDraw->depth);
-}
diff --git a/GL/glx/glxpix.h b/GL/glx/glxpix.h
deleted file mode 100644
index d7a9afab0..000000000
--- a/GL/glx/glxpix.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
-#ifndef _glxpix_h_
-#define _glxpix_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
- GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap);
-
-#endif /* _glxpix_h_ */
-
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
deleted file mode 100644
index c141d3cea..000000000
--- a/GL/glx/glxscreens.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.12 2003/09/28 20:15:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#ifdef IN_MODULE
-#include <xf86_ansic.h>
-#else
-#include <string.h>
-#include <signal.h>
-#endif
-
-#include <windowstr.h>
-
-#include "glxserver.h"
-#include "glxutil.h"
-
-static const char GLServerExtensions[] =
- "GL_ARB_depth_texture "
- "GL_ARB_imaging "
- "GL_ARB_multitexture "
- "GL_ARB_point_parameters "
- "GL_ARB_shadow "
- "GL_ARB_shadow_ambient "
- "GL_ARB_texture_border_clamp "
- "GL_ARB_texture_cube_map "
- "GL_ARB_texture_env_add "
- "GL_ARB_texture_env_combine "
- "GL_ARB_texture_env_crossbar "
- "GL_ARB_texture_env_dot3 "
- "GL_ARB_texture_mirrored_repeat "
- "GL_ARB_transpose_matrix "
- "GL_ARB_window_pos "
- "GL_EXT_abgr "
- "GL_EXT_bgra "
- "GL_EXT_blend_color "
- "GL_EXT_blend_func_separate "
- "GL_EXT_blend_logic_op "
- "GL_EXT_blend_minmax "
- "GL_EXT_blend_subtract "
- "GL_EXT_clip_volume_hint "
- "GL_EXT_copy_texture "
- "GL_EXT_draw_range_elements "
- "GL_EXT_fog_coord "
- "GL_EXT_multi_draw_arrays "
- "GL_EXT_packed_pixels "
- "GL_EXT_polygon_offset "
- "GL_EXT_rescale_normal "
- "GL_EXT_secondary_color "
- "GL_EXT_separate_specular_color "
- "GL_EXT_shadow_funcs "
- "GL_EXT_stencil_two_side "
- "GL_EXT_stencil_wrap "
- "GL_EXT_subtexture "
- "GL_EXT_texture "
- "GL_EXT_texture3D "
- "GL_EXT_texture_edge_clamp "
- "GL_EXT_texture_env_add "
- "GL_EXT_texture_env_combine "
- "GL_EXT_texture_env_dot3 "
- "GL_EXT_texture_lod "
- "GL_EXT_texture_lod_bias "
- "GL_EXT_texture_object "
- "GL_EXT_texture_rectangle "
- "GL_EXT_vertex_array "
- "GL_APPLE_packed_pixels "
- "GL_ATI_texture_mirror_once "
- "GL_ATI_texture_env_combine3 "
-#if 0
- /* This is currently removed because there seem to be some problems with
- * it and the software-only indirect rendering path. At this point, I'm
- * not sure which side (client or server) has the problem. - idr
- */
- "GL_HP_occlusion_test "
-#endif
- "GL_IBM_texture_mirrored_repeat "
- "GL_MESA_pack_invert "
- "GL_MESA_ycbcr_texture "
- "GL_NV_blend_square "
- "GL_NV_texgen_reflection "
- "GL_NV_texture_rectangle "
- "GL_SGIS_generate_mipmap "
- "GL_SGIS_texture_border_clamp "
- "GL_SGIS_texture_edge_clamp "
- "GL_SGIS_texture_lod "
- "GL_SGIX_depth_texture "
- "GL_SGIX_shadow "
- "GL_SGIX_shadow_ambient "
- ;
-
-/*
-** We have made the simplifying assuption that the same extensions are
-** supported across all screens in a multi-screen system.
-*/
-static char GLXServerVendorName[] = "SGI";
-static char GLXServerVersion[] = "1.2";
-static char GLXServerExtensions[] =
- "GLX_EXT_visual_info "
- "GLX_EXT_visual_rating "
- "GLX_EXT_import_context "
- "GLX_SGI_make_current_read "
- ;
-
-/*
-** This comes from the GL library that the server will link with. Right
-** now, that is the DDX Sample OpenGL.
-*/
-extern __GLXscreenInfo __glDDXScreenInfo;
-
-__GLXscreenInfo *__glXScreens[] = {
- &__glDDXScreenInfo,
-};
-
-GLint __glXNumStaticScreens = (sizeof __glXScreens / sizeof __glXScreens[0]);
-
-__GLXscreenInfo *__glXActiveScreens;
-GLint __glXNumActiveScreens;
-
-RESTYPE __glXDrawableRes;
-
-#if 0
-static int
-CountBits(unsigned long mask)
-{
- int count = 0;
-
- while(mask) {
- count += (mask&1);
- mask >>= 1;
- }
-
- return count;
-}
-#endif
-
-#if 0
-/*
-** A typical implementation would not probably not run through the screen's
-** visuals to find ones that match the visual configs supplied by the DDX
-** Sample OpenGL as we do here; we have done this to make this code easy to
-** drop into an existing X server.
-*/
-static int matchVisuals(__GLXvisualConfig *pGlxVisual, int numVisuals,
- int screen)
-{
- int i, j;
- __GLXvisualConfig *pvis = pGlxVisual;
- ScreenPtr pScreen = screenInfo.screens[screen];
- VisualPtr pVisual;
- int numMatchingVisuals = 0;
- int *used;
-
- used = (int *)__glXMalloc(pScreen->numVisuals*sizeof(int));
- __glXMemset(used, 0, pScreen->numVisuals*sizeof(int));
-
- for (i=0; i < numVisuals; i++, pvis++) {
- /*
- ** Look through all the server's visuals to see which match.
- */
- pvis->vid = 0;
- pVisual = pScreen->visuals;
- for (j=0; j < pScreen->numVisuals; j++, pVisual++) {
- if (pvis->class == pVisual->class &&
- pvis->bufferSize == pVisual->nplanes &&
- !used[j]) {
- int rBits, gBits, bBits, aBits;
-
- /* count bits per rgb */
- rBits = CountBits(pVisual->redMask);
- gBits = CountBits(pVisual->greenMask);
- bBits = CountBits(pVisual->blueMask);
- aBits = 0;
- if ((pvis->redSize == rBits) &&
- (pvis->greenSize == gBits) &&
- (pvis->blueSize == bBits) &&
- (pvis->alphaSize == aBits)) {
- /*
- ** We'll consider this a match.
- */
- pvis->vid = pVisual->vid;
- pvis->redMask = pVisual->redMask;
- pvis->greenMask = pVisual->greenMask;
- pvis->blueMask = pVisual->blueMask;
- pvis->alphaMask = 0;
- numMatchingVisuals++;
- used[j] = 1;
- break;
- }
- }
- }
- }
- __glXFree(used);
- return numMatchingVisuals;
-}
-#endif
-
-/*
-** Destroy routine that gets called when a drawable is freed. A drawable
-** contains the ancillary buffers needed for rendering.
-*/
-static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
-{
- __GLXcontext *cx, *cx1;
-
- /*
- ** Use glxPriv->type to figure out what kind of drawable this is. Don't
- ** use glxPriv->pDraw->type because by the time this routine is called,
- ** the pDraw might already have been freed.
- */
- if (glxPriv->type == DRAWABLE_WINDOW) {
- /*
- ** When a window is destroyed, notify all context bound to
- ** it, that there are no longer bound to anything.
- */
- for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
- cx1 = cx->nextDrawPriv;
- cx->pendingState |= __GLX_PENDING_DESTROY;
- }
-
- for (cx = glxPriv->readGlxc; cx; cx = cx1) {
- cx1 = cx->nextReadPriv;
- cx->pendingState |= __GLX_PENDING_DESTROY;
- }
- }
-
- /*
- ** set the size to 0, so that context that may still be using this
- ** drawable not do anything harmful
- */
- glxPriv->xorigin = 0;
- glxPriv->yorigin = 0;
- glxPriv->width = 0;
- glxPriv->height = 0;
-
- __glXUnrefDrawablePrivate(glxPriv);
-
- return True;
-}
-
-/*
-** This hook gets called when a window moves or changes size.
-*/
-static Bool PositionWindow(WindowPtr pWin, int x, int y)
-{
- ScreenPtr pScreen;
- __GLXcontext *glxc;
- __GLXdrawablePrivate *glxPriv;
- Bool ret;
-
- /*
- ** Call wrapped position window routine
- */
- pScreen = pWin->drawable.pScreen;
- pScreen->PositionWindow =
- __glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
- ret = (*pScreen->PositionWindow)(pWin, x, y);
- pScreen->PositionWindow = PositionWindow;
-
- /*
- ** Tell all contexts rendering into this window that the window size
- ** has changed.
- */
- glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
- __glXDrawableRes);
- if (glxPriv == NULL) {
- /*
- ** This window is not being used by the OpenGL.
- */
- return ret;
- }
-
- /*
- ** resize the drawable
- */
- /* first change the drawable size */
- if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
- /* resize failed! */
- /* XXX: what can we possibly do here? */
- ret = False;
- }
-
- /* mark contexts as needing resize */
-
- for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
- glxc->pendingState |= __GLX_PENDING_RESIZE;
- }
-
- for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
- glxc->pendingState |= __GLX_PENDING_RESIZE;
- }
-
- return ret;
-}
-
-/*
-** Wrap our own PositionWindow routine around the server's, so we can
-** be notified when a window changes size
-*/
-static void wrapPositionWindow(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
-
- __glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
- pScreen->PositionWindow = PositionWindow;
-}
-
-void __glXScreenInit(GLint numscreens)
-{
- GLint i,j;
-
- /*
- ** This alloc has to work or else the server might as well core dump.
- */
- __glXActiveScreens =
- (__GLXscreenInfo *) __glXMalloc(sizeof(__GLXscreenInfo) * numscreens);
-
- for (i=0; i < numscreens; i++) {
- /*
- ** Probe each static screen to see which exists.
- */
- for (j=0; j < __glXNumStaticScreens; j++) {
- if ((*__glXScreens[j]->screenProbe)(i)) {
- __glXActiveScreens[i] = *__glXScreens[j];
-
-#if 0
- /* we don't use this since matchVisuals doesn't allow alpha */
- __glXActiveScreens[i].numUsableVisuals =
- matchVisuals(__glXActiveScreens[i].pGlxVisual,
- __glXActiveScreens[i].numVisuals, i);
-#else
- __glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
-#endif
- __glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
- __glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
- __glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);
- __glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions);
-
-#ifdef X11R5
- __glXDrawableRes = CreateNewResourceType(DrawableGone);
-#else
- __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
-#endif
- wrapPositionWindow(i);
- }
- }
- }
- __glXNumActiveScreens = numscreens;
-}
-
-void __glXScreenReset(void)
-{
- int i;
-
- for (i = 0; i < __glXNumActiveScreens; i++) {
- __glXFree(__glXActiveScreens[i].GLXvendor);
- __glXFree(__glXActiveScreens[i].GLXversion);
- __glXFree(__glXActiveScreens[i].GLXextensions);
- __glXFree(__glXActiveScreens[i].GLextensions);
- }
- xfree(__glXActiveScreens);
- __glXActiveScreens = NULL;
- __glXNumActiveScreens = 0;
-}
diff --git a/GL/glx/glxscreens.h b/GL/glx/glxscreens.h
deleted file mode 100644
index 99f76dc38..000000000
--- a/GL/glx/glxscreens.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _GLX_screens_h_
-#define _GLX_screens_h_
-
-/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.h,v 1.5 2002/02/22 21:45:07 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/* XXX: should be defined somewhere globally */
-#define CAPI
-
-#include "GL/internal/glcore.h"
-
-/*
-** Screen dependent data. These methods are the interface between the DIX
-** and DDX layers of the GLX server extension. The methods provide an
-** interface for context management on a screen.
-*/
-typedef struct {
- /*
- ** Probe the screen and see if it supports GL rendering. It will
- ** return GL_FALSE if it doesn't, GL_TRUE otherwise.
- */
- Bool (*screenProbe)(int screen);
-
- /*
- ** Create a context using configuration information from modes.
- ** Use imports as callbacks back to the OS. Return an opaque handle
- ** on the context (NULL if failure).
- */
- __GLinterface *(*createContext)(__GLimports *imports,
- __GLcontextModes *modes,
- __GLinterface *shareGC);
-
- /*
- ** Create a buffer using information from glxPriv. This routine
- ** sets up any wrappers necessary to resize, swap or destroy the
- ** buffer.
- */
- void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
-
- __GLXvisualConfig *pGlxVisual;
- void **pVisualPriv;
- GLint numVisuals;
- GLint numUsableVisuals;
-
- char *GLextensions;
-
- char *GLXvendor;
- char *GLXversion;
- char *GLXextensions;
-
- /*
- ** Things that are not statically set.
- */
- Bool (*WrappedPositionWindow)(WindowPtr pWin, int x, int y);
-
-} __GLXscreenInfo;
-
-
-extern void __glXScreenInit(GLint);
-extern void __glXScreenReset(void);
-
-#endif /* !__GLX_screens_h__ */
diff --git a/GL/glx/glxserver.h b/GL/glx/glxserver.h
deleted file mode 100644
index a800f0d73..000000000
--- a/GL/glx/glxserver.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.5 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _GLX_server_h_
-#define _GLX_server_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/Xmd.h>
-#include <misc.h>
-#include <dixstruct.h>
-#include <pixmapstr.h>
-#include <gcstruct.h>
-#include <extnsionst.h>
-#include <resource.h>
-#include <scrnintstr.h>
-#include "GL/glx_ansic.h"
-
-
-/*
-** The X header misc.h defines these math functions.
-*/
-#undef abs
-#undef fabs
-
-#define GL_GLEXT_PROTOTYPES /* we want prototypes */
-#include <GL/gl.h>
-#include <GL/glxproto.h>
-#include <GL/glxint.h>
-
-/* For glxscreens.h */
-typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
-
-#include "glxscreens.h"
-#include "glxdrawable.h"
-#include "glxcontext.h"
-#include "glxerror.h"
-
-
-#define GLX_SERVER_MAJOR_VERSION 1
-#define GLX_SERVER_MINOR_VERSION 2
-
-#ifndef True
-#define True 1
-#endif
-#ifndef False
-#define False 0
-#endif
-
-/*
-** GLX resources.
-*/
-typedef XID GLXContextID;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-
-typedef struct __GLXcontextRec *GLXContext;
-typedef struct __GLXclientStateRec __GLXclientState;
-
-extern __GLXscreenInfo *__glXActiveScreens;
-extern GLint __glXNumActiveScreens;
-
-/************************************************************************/
-
-/*
-** The last context used (from the server's persective) is cached.
-*/
-extern __GLXcontext *__glXLastContext;
-extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
-
-/*
-** Macros to set, unset, and retrieve the flag that says whether a context
-** has unflushed commands.
-*/
-#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
-#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
-#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
-
-/************************************************************************/
-
-/*
-** State kept per client.
-*/
-struct __GLXclientStateRec {
- /*
- ** Whether this structure is currently being used to support a client.
- */
- Bool inUse;
-
- /*
- ** Buffer for returned data.
- */
- GLbyte *returnBuf;
- GLint returnBufSize;
-
- /*
- ** Keep track of large rendering commands, which span multiple requests.
- */
- GLint largeCmdBytesSoFar; /* bytes received so far */
- GLint largeCmdBytesTotal; /* total bytes expected */
- GLint largeCmdRequestsSoFar; /* requests received so far */
- GLint largeCmdRequestsTotal; /* total requests expected */
- GLbyte *largeCmdBuf;
- GLint largeCmdBufSize;
-
- /*
- ** Keep a list of all the contexts that are current for this client's
- ** threads.
- */
- __GLXcontext **currentContexts;
- GLint numCurrentContexts;
-
- /* Back pointer to X client record */
- ClientPtr client;
-
- int GLClientmajorVersion;
- int GLClientminorVersion;
- char *GLClientextensions;
-};
-
-extern __GLXclientState *__glXClients[];
-
-/************************************************************************/
-
-/*
-** Dispatch tables.
-*/
-typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
-typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
-typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
-
-/*
- * Dispatch for GLX commands.
- */
-typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
-extern __GLXprocPtr __glXProcTable[];
-
-/*
- * Tables for computing the size of each rendering command.
- */
-typedef struct {
- int bytes;
- int (*varsize)(GLbyte *pc, Bool swap);
-} __GLXrenderSizeData;
-extern __GLXrenderSizeData __glXRenderSizeTable[];
-extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
-
-/************************************************************************/
-
-/*
-** X resources.
-*/
-extern RESTYPE __glXContextRes;
-extern RESTYPE __glXClientRes;
-extern RESTYPE __glXPixmapRes;
-extern RESTYPE __glXDrawableRes;
-
-/************************************************************************/
-
-/*
-** Prototypes.
-*/
-
-extern char *__glXcombine_strings(const char *, const char *);
-
-/*
-** Routines for sending swapped replies.
-*/
-
-extern void __glXSwapMakeCurrentReply(ClientPtr client,
- xGLXMakeCurrentReply *reply);
-extern void __glXSwapIsDirectReply(ClientPtr client,
- xGLXIsDirectReply *reply);
-extern void __glXSwapQueryVersionReply(ClientPtr client,
- xGLXQueryVersionReply *reply);
-extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply *reply,
- int *buf);
-extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf);
-extern void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf);
-
-
-/*
- * Routines for computing the size of variably-sized rendering commands.
- */
-
-extern int __glXTypeSize(GLenum enm);
-extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLint rowLength, GLint skipRows, GLint alignment);
-extern int __glXImage3DSize(GLenum format, GLenum type,
- GLsizei w, GLsizei h, GLsizei d,
- GLint imageHeight, GLint rowLength,
- GLint skipImages, GLint skipRows,
- GLint alignment);
-
-extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
-extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
-extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
-extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
-
-/*
- * Routines for computing the size of returned data.
- */
-extern int __glXConvolutionParameterivSize(GLenum pname);
-extern int __glXConvolutionParameterfvSize(GLenum pname);
-extern int __glXColorTableParameterfvSize(GLenum pname);
-extern int __glXColorTableParameterivSize(GLenum pname);
-
-extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap);
-
-#endif /* !__GLX_server_h__ */
diff --git a/GL/glx/glxutil.c b/GL/glx/glxutil.c
deleted file mode 100644
index ebc9a2bfc..000000000
--- a/GL/glx/glxutil.c
+++ /dev/null
@@ -1,555 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#define FONT_PCF
-#include "glxserver.h"
-#include <GL/glxtokens.h>
-#include <unpack.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include "glxutil.h"
-#include "glxbuf.h"
-#include "GL/glx_ansic.h"
-
-/************************************************************************/
-
-void __glXNop(void) {}
-
-/************************************************************************/
-
-/* Memory Allocation for GLX */
-
-void *
-__glXMalloc(size_t size)
-{
- void *addr;
-
- if (size == 0) {
- return NULL;
- }
- addr = (void *) xalloc(size);
- if (addr == NULL) {
- /* XXX: handle out of memory error */
- return NULL;
- }
- return addr;
-}
-
-void *
-__glXCalloc(size_t numElements, size_t elementSize)
-{
- void *addr;
- size_t size;
-
- if ((numElements == 0) || (elementSize == 0)) {
- return NULL;
- }
- size = numElements * elementSize;
- addr = (void *) xalloc(size);
- if (addr == NULL) {
- /* XXX: handle out of memory error */
- return NULL;
- }
- __glXMemset(addr, 0, size);
- return addr;
-}
-
-void *
-__glXRealloc(void *addr, size_t newSize)
-{
- void *newAddr;
-
- if (addr) {
- if (newSize == 0) {
- xfree(addr);
- return NULL;
- } else {
- newAddr = xrealloc(addr, newSize);
- }
- } else {
- if (newSize == 0) {
- return NULL;
- } else {
- newAddr = xalloc(newSize);
- }
- }
- if (newAddr == NULL) {
- return NULL; /* XXX: out of memory */
- }
-
- return newAddr;
-}
-
-void
-__glXFree(void *addr)
-{
- if (addr) {
- xfree(addr);
- }
-}
-
-/************************************************************************/
-/* Context stuff */
-
-
-/*
-** associate a context with a drawable
-*/
-void
-__glXAssociateContext(__GLXcontext *glxc)
-{
- glxc->nextDrawPriv = glxc->drawPriv->drawGlxc;
- glxc->drawPriv->drawGlxc = glxc;
-
- __glXRefDrawablePrivate(glxc->drawPriv);
-
-
- glxc->nextReadPriv = glxc->readPriv->readGlxc;
- glxc->readPriv->readGlxc = glxc;
-
- __glXRefDrawablePrivate(glxc->readPriv);
-}
-
-/*
-** Deassociate a context from a drawable
-*/
-void
-__glXDeassociateContext(__GLXcontext *glxc)
-{
- __GLXcontext *curr, *prev;
-
- prev = NULL;
- for ( curr = glxc->drawPriv->drawGlxc
- ; curr != NULL
- ; prev = curr, curr = curr->nextDrawPriv ) {
- if (curr == glxc) {
- /* found context. Deassociate. */
- if (prev == NULL) {
- glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
- } else {
- prev->nextDrawPriv = curr->nextDrawPriv;
- }
- curr->nextDrawPriv = NULL;
- __glXUnrefDrawablePrivate(glxc->drawPriv);
- break;
- }
- }
-
-
- prev = NULL;
- for ( curr = glxc->readPriv->readGlxc
- ; curr != NULL
- ; prev = curr, curr = curr->nextReadPriv ) {
- if (curr == glxc) {
- /* found context. Deassociate. */
- if (prev == NULL) {
- glxc->readPriv->readGlxc = curr->nextReadPriv;
- } else {
- prev->nextReadPriv = curr->nextReadPriv;
- }
- curr->nextReadPriv = NULL;
- __glXUnrefDrawablePrivate(glxc->readPriv);
- break;
- }
- }
-}
-
-/************************************************************************/
-
-void
-__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
- GLint *x, GLint *y, GLuint *width, GLuint *height)
-{
- __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
-
- if (glxPriv) {
- *x = glxPriv->xorigin;
- *y = glxPriv->yorigin;
- *width = glxPriv->width;
- *height = glxPriv->height;
- } else {
- *x = *y = *width = *height = 0;
- }
-}
-
-GLboolean
-__glXResizeDrawable(__GLdrawablePrivate *glPriv)
-{
- /* nothing to be done here */
- return GL_TRUE;
-}
-
-
-/************************************************************************/
-
-void
-__glXFormatGLModes(__GLcontextModes *modes, __GLXvisualConfig *config)
-{
- __glXMemset(modes, 0, sizeof(__GLcontextModes));
-
- modes->rgbMode = (config->rgba != 0);
- modes->colorIndexMode = !(modes->rgbMode);
- modes->doubleBufferMode = (config->doubleBuffer != 0);
- modes->stereoMode = (config->stereo != 0);
-
- modes->haveAccumBuffer = ((config->accumRedSize +
- config->accumGreenSize +
- config->accumBlueSize +
- config->accumAlphaSize) > 0);
- modes->haveDepthBuffer = (config->depthSize > 0);
- modes->haveStencilBuffer = (config->stencilSize > 0);
-
- modes->redBits = config->redSize;
- modes->greenBits = config->greenSize;
- modes->blueBits = config->blueSize;
- modes->alphaBits = config->alphaSize;
- modes->redMask = config->redMask;
- modes->greenMask = config->greenMask;
- modes->blueMask = config->blueMask;
- modes->alphaMask = config->alphaMask;
-#if 0
- modes->rgbBits = modes->redBits + modes->greenBits +
- modes->blueBits + modes->alphaBits;
-#endif
- assert( !modes->rgbMode || ((config->bufferSize & 0x7) == 0) );
- modes->rgbBits = config->bufferSize;
- modes->indexBits = config->bufferSize;
-
- modes->accumRedBits = config->accumRedSize;
- modes->accumGreenBits = config->accumGreenSize;
- modes->accumBlueBits = config->accumBlueSize;
- modes->accumAlphaBits = config->accumAlphaSize;
- modes->depthBits = config->depthSize;
- modes->stencilBits = config->stencilSize;
-
- modes->numAuxBuffers = 0; /* XXX: should be picked up from the visual */
-
- modes->level = config->level;
-}
-
-/*****************************************************************************/
-/* accessing the drawable private */
-
-static void
-LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
-{
- __GLinterface *glci = (__GLinterface *) gc;
- __GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
-
- /* quick exit test */
- if ((glxc->pendingState &
- (__GLX_PENDING_RESIZE |
- __GLX_PENDING_DESTROY |
- __GLX_PENDING_SWAP)) == 0x0)
- return;
-
- /* some pending state. Deal with it */
- if (glxc->pendingState & __GLX_PENDING_RESIZE) {
- glxc->pendingState &= ~__GLX_PENDING_RESIZE;
-
- (*glci->exports.notifyResize)(gc);
- assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
- }
- if (glxc->pendingState & __GLX_PENDING_DESTROY) {
- glxc->pendingState &= ~__GLX_PENDING_DESTROY;
-
- assert(glxc->drawPriv->xorigin == 0);
- assert(glxc->drawPriv->yorigin == 0);
- assert(glxc->drawPriv->width == 0);
- assert(glxc->drawPriv->height == 0);
- assert(glxc->readPriv->xorigin == 0);
- assert(glxc->readPriv->yorigin == 0);
- assert(glxc->readPriv->width == 0);
- assert(glxc->readPriv->height == 0);
- (*glci->exports.notifyDestroy)(gc);
- __glXDeassociateContext(glxc);
- assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
- }
- if (glxc->pendingState & __GLX_PENDING_SWAP) {
-
- glxc->pendingState &= ~__GLX_PENDING_SWAP;
-
- (*glci->exports.notifySwapBuffers)(gc);
- assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
- }
-}
-
-static void
-UnlockDP(__GLdrawablePrivate *glPriv)
-{
-}
-
-/*****************************************************************************/
-/* Drawable private stuff */
-
-void
-__glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
-{
- glxPriv->refCount++;
-}
-
-void
-__glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
-{
- glxPriv->refCount--;
- if (glxPriv->refCount == 0) {
- __glXDestroyDrawablePrivate(glxPriv);
- }
-}
-
-__GLXdrawablePrivate *
-__glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
- __GLcontextModes *modes)
-{
- __GLXdrawablePrivate *glxPriv;
- __GLdrawablePrivate *glPriv;
- __GLXscreenInfo *pGlxScreen;
-
- glxPriv = (__GLXdrawablePrivate *) __glXMalloc(sizeof(*glxPriv));
- __glXMemset(glxPriv, 0, sizeof(__GLXdrawablePrivate));
-
- glxPriv->type = pDraw->type;
- glxPriv->pDraw = pDraw;
- glxPriv->drawId = drawId;
-
- /* if not a pixmap, lookup will fail, so pGlxPixmap will be NULL */
- glxPriv->pGlxPixmap = (__GLXpixmap *)
- LookupIDByType(drawId, __glXPixmapRes);
- /* since we are creating the drawablePrivate, drawId should be new */
- if (!AddResource(drawId, __glXDrawableRes, glxPriv)) {
- /* oops! */
- __glXFree(glxPriv);
- return NULL;
- }
-
- /* fill up glPriv */
- glPriv = &glxPriv->glPriv;
- glPriv->modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes));
- *glPriv->modes = *modes;
- glPriv->malloc = __glXMalloc;
- glPriv->calloc = __glXCalloc;
- glPriv->realloc = __glXRealloc;
- glPriv->free = __glXFree;
- glPriv->addSwapRect = NULL;
- glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
- glPriv->lockDP = LockDP;
- glPriv->unlockDP = UnlockDP;
- glPriv->getDrawableSize = __glXGetDrawableSize;
- glPriv->resize = __glXResizeDrawable;
- glPriv->other = glxPriv;
-
- /* allocate a one-rect ownership region */
- glPriv->ownershipRegion.rects =
- (__GLregionRect *)__glXCalloc(1, sizeof(__GLregionRect));
- glPriv->ownershipRegion.numRects = 1;
-
- glxPriv->freeBuffers = __glXFreeBuffers;
- glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
-
- pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
-
- /* allocate the buffers */
- if (glxPriv->type == DRAWABLE_WINDOW) {
- int i;
- VisualID vid = wVisual((WindowPtr)pDraw);
- __GLXvisualConfig *pGlxVisual = pGlxScreen->pGlxVisual;
-
- for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == vid) {
- glxPriv->pGlxVisual = pGlxVisual;
- break;
- }
- }
- __glXFBInitDrawable(glxPriv, modes);
- } else {
- glxPriv->pGlxVisual = glxPriv->pGlxPixmap->pGlxVisual;
- __glXPixInitDrawable(glxPriv, modes);
- }
-
- /* initialize the core's private buffer information */
- (*pGlxScreen->createBuffer)(glxPriv);
-
- return glxPriv;
-}
-
-GLboolean
-__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
-{
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
-
- /* remove the drawable from the drawable list */
- FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
-
- /* Have the core free any memory it may have attached to the drawable */
- if (glPriv->freePrivate) {
- (*glPriv->freePrivate)(glPriv);
- }
-
- /* Free any framebuffer memory attached to the drawable */
- if (glxPriv->freeBuffers) {
- (*glxPriv->freeBuffers)(glxPriv);
- }
-
- /* Free the drawable Private */
- __glXFree(glxPriv->glPriv.modes);
- __glXFree(glxPriv->glPriv.ownershipRegion.rects);
- __glXFree(glxPriv);
-
- return GL_TRUE;
-}
-
-__GLXdrawablePrivate *
-__glXFindDrawablePrivate(XID drawId)
-{
- __GLXdrawablePrivate *glxPriv;
-
- glxPriv = (__GLXdrawablePrivate *)LookupIDByType(drawId, __glXDrawableRes);
-
- return glxPriv;
-}
-
-__GLXdrawablePrivate *
-__glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
- __GLcontextModes *modes)
-{
- __GLXdrawablePrivate *glxPriv;
-
- glxPriv = __glXFindDrawablePrivate(drawId);
-
- if (glxPriv == NULL) {
- glxPriv = __glXCreateDrawablePrivate(pDraw, drawId, modes);
- if (glxPriv) {
- __glXRefDrawablePrivate(glxPriv);
- }
- }
-
- return glxPriv;
-}
-
-void
-__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
-{
- if (glxPriv) {
- if (glxPriv->pDraw) {
- glxPriv->xorigin = glxPriv->pDraw->x;
- glxPriv->yorigin = glxPriv->pDraw->y;
- glxPriv->width = glxPriv->pDraw->width;
- glxPriv->height = glxPriv->pDraw->height;
- }
- }
-}
-
-/*
-** resize/move the drawable. Called during the actual resize callback
-** to update the drawable side of the buffers
-*/
-GLboolean
-__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
-{
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
- GLint x, y;
- GLuint w, h;
-#if defined(__GL_ALIGNED_BUFFERS)
- GLint xAlignment, yAlignment;
- GLint xOffset, yOffset;
- GLint xStart, xEnd;
- GLint yStart, yEnd;
- GLuint xAlignedMask, yAlignedMask;
-#endif
- GLboolean status = GL_TRUE;
-
- __glXCacheDrawableSize(glxPriv);
-
- w = glxPriv->width;
- h = glxPriv->height;
- x = glxPriv->xorigin;
- y = glxPriv->yorigin;
-
-#if defined(__GL_ALIGNED_BUFFERS)
- xAlignment = glPriv->xAlignment;
- yAlignment = glPriv->yAlignment;
-
- xOffset = x & (xAlignment-1);
- yOffset = y & (yAlignment-1);
-
- xAlignedMask = ~(xAlignment-1);
- yAlignedMask = ~(yAlignment-1);
-
- xStart = x; xEnd = x+w;
- yStart = y; yEnd = y+h;
-
- xStart &= xAlignedMask;
- if (xEnd & ~xAlignedMask) {
- xEnd = (xEnd&xAlignedMask) + xAlignment;
- }
- yStart &= yAlignedMask;
- if (yEnd & ~yAlignedMask) {
- yEnd = (yEnd&yAlignedMask) + yAlignment;
- }
-
- x = xStart; y = yStart;
- w = xEnd-xStart; h = yEnd-yStart;
-#endif
-
- if ((x != glPriv->xOrigin) ||
- (y != glPriv->yOrigin) ||
-#if defined(__GL_ALIGNED_BUFFERS)
- (xOffset != glPriv->xOffset) ||
- (yOffset != glPriv->yOffset) ||
-#endif
- (w != glPriv->width) ||
- (h != glPriv->height) ||
- (!w && !h)) {
- /* set up the glPriv info */
- glPriv->width = w;
- glPriv->height = h;
- glPriv->xOrigin = x;
- glPriv->yOrigin = y;
-#if defined(__GL_ALIGNED_BUFFERS)
- glPriv->xOffset = xOffset;
- glPriv->yOffset = yOffset;
-#endif
-
- /* notify the buffers */
- status = __glXResizeBuffers(glPriv, x, y, w, h);
- }
-
- return status;
-}
-
-/************************************************************************/
-
diff --git a/GL/glx/glxutil.h b/GL/glx/glxutil.h
deleted file mode 100644
index 1f736f0f1..000000000
--- a/GL/glx/glxutil.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _glxcmds_h_
-#define _glxcmds_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern void __glXNop(void);
-
-/* memory management */
-extern void *__glXMalloc(size_t size);
-extern void *__glXCalloc(size_t numElements, size_t elementSize);
-extern void *__glXRealloc(void *addr, size_t newSize);
-extern void __glXFree(void *ptr);
-
-/* relate contexts with drawables */
-extern void __glXAssociateContext(__GLXcontext *glxc);
-extern void __glXDeassociateContext(__GLXcontext *glxc);
-
-/* drawable operation */
-extern void __glXGetDrawableSize(__GLdrawablePrivate *glPriv,
- GLint *x, GLint *y,
- GLuint *width, GLuint *height);
-extern GLboolean __glXResizeDrawable(__GLdrawablePrivate *glPriv);
-extern GLboolean __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv);
-extern void __glXFormatGLModes(__GLcontextModes *modes, __GLXvisualConfig *config);
-
-/* drawable management */
-extern void __glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
-extern void __glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
-extern __GLXdrawablePrivate *__glXCreateDrawablePrivate(DrawablePtr pDraw,
- XID glxpixmapId,
- __GLcontextModes *modes);
-extern GLboolean __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv);
-extern __GLXdrawablePrivate *__glXFindDrawablePrivate(XID glxpixmapId);
-extern __GLXdrawablePrivate *__glXGetDrawablePrivate(DrawablePtr pDraw,
- XID glxpixmapId,
- __GLcontextModes *modes);
-extern void __glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv);
-
-/* context helper routines */
-extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
-
-
-#endif /* _glxcmds_h_ */
-
diff --git a/GL/glx/impsize.h b/GL/glx/impsize.h
deleted file mode 100644
index c923441c2..000000000
--- a/GL/glx/impsize.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
-#ifndef _impsize_h_
-#define _impsize_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
-** These are defined in libsampleGL.a. They are not technically part of
-** the defined interface between libdixGL.a and libsampleGL.a (that interface
-** being the functions in the __glXScreenInfo structure, plus the OpenGL API
-** itself), but we thought it was better to call these routines than to
-** replicate the code in here.
-*/
-extern int __glCallLists_size(GLsizei n, GLenum type);
-extern int __glColorTableParameterfv_size(GLenum pname);
-extern int __glColorTableParameteriv_size(GLenum pname);
-extern int __glConvolutionParameterfv_size(GLenum pname);
-extern int __glConvolutionParameteriv_size(GLenum pname);
-extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h);
-extern int __glFogfv_size(GLenum pname);
-extern int __glFogiv_size(GLenum pname);
-extern int __glLightModelfv_size(GLenum pname);
-extern int __glLightModeliv_size(GLenum pname);
-extern int __glLightfv_size(GLenum pname);
-extern int __glLightiv_size(GLenum pname);
-extern int __glMaterialfv_size(GLenum pname);
-extern int __glMaterialiv_size(GLenum pname);
-extern int __glTexEnvfv_size(GLenum e);
-extern int __glTexEnviv_size(GLenum e);
-extern int __glTexGendv_size(GLenum e);
-extern int __glTexGenfv_size(GLenum e);
-extern int __glTexGeniv_size(GLenum pname);
-extern int __glTexParameterfv_size(GLenum e);
-extern int __glTexParameteriv_size(GLenum e);
-extern int __glEvalComputeK(GLenum target);
-
-extern int __glPointParameterfvARB_size(GLenum pname);
-
-#endif /* _impsize_h_ */
diff --git a/GL/glx/render2.c b/GL/glx/render2.c
deleted file mode 100644
index 7189f9710..000000000
--- a/GL/glx/render2.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.6 2003/10/28 22:50:18 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/* #define NEED_REPLIES */
-#include <glxserver.h>
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-extern GLint __glEvalComputeK(GLenum target);
-
-void __glXDisp_Map1f(GLbyte *pc)
-{
- GLint order, k;
- GLfloat u1, u2, *points;
- GLenum target;
-
- target = *(GLenum *)(pc + 0);
- order = *(GLint *)(pc + 12);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- points = (GLfloat *)(pc + 16);
- k = __glEvalComputeK(target);
-
- glMap1f(target, u1, u2, k, order, points);
-}
-
-void __glXDisp_Map2f(GLbyte *pc)
-{
- GLint uorder, vorder, ustride, vstride, k;
- GLfloat u1, u2, v1, v2, *points;
- GLenum target;
-
- target = *(GLenum *)(pc + 0);
- uorder = *(GLint *)(pc + 12);
- vorder = *(GLint *)(pc + 24);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- v1 = *(GLfloat *)(pc + 16);
- v2 = *(GLfloat *)(pc + 20);
- points = (GLfloat *)(pc + 28);
-
- k = __glEvalComputeK(target);
- ustride = vorder * k;
- vstride = k;
-
- glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-void __glXDisp_Map1d(GLbyte *pc)
-{
- GLint order, k;
-#ifdef __GLX_ALIGN64
- GLint compsize;
-#endif
- GLenum target;
- GLdouble u1, u2, *points;
-
- target = *(GLenum*) (pc + 16);
- order = *(GLint*) (pc + 20);
- k = __glEvalComputeK(target);
-
-#ifdef __GLX_ALIGN64
- if (order < 0 || k < 0) {
- compsize = 0;
- } else {
- compsize = order * k;
- }
-#endif
-
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- pc += 24;
-
-#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
- }
-#else
- points = (GLdouble*) pc;
-#endif
- glMap1d(target, u1, u2, k, order, points);
-}
-
-void __glXDisp_Map2d(GLbyte *pc)
-{
- GLdouble u1, u2, v1, v2, *points;
- GLint uorder, vorder, ustride, vstride, k;
-#ifdef __GLX_ALIGN64
- GLint compsize;
-#endif
- GLenum target;
-
- target = *(GLenum *)(pc + 32);
- uorder = *(GLint *)(pc + 36);
- vorder = *(GLint *)(pc + 40);
- k = __glEvalComputeK(target);
-
-#ifdef __GLX_ALIGN64
- if (vorder < 0 || uorder < 0 || k < 0) {
- compsize = 0;
- } else {
- compsize = uorder * vorder * k;
- }
-#endif
-
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- __GLX_GET_DOUBLE(v1,pc+16);
- __GLX_GET_DOUBLE(v2,pc+24);
- pc += 44;
-
- ustride = vorder * k;
- vstride = k;
-
-#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
- }
-#else
- points = (GLdouble*) pc;
-#endif
- glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-void __glXDisp_CallLists(GLbyte *pc)
-{
- GLenum type;
- GLsizei n;
-
- type = *(GLenum *)(pc + 4);
- n = *(GLsizei *)(pc + 0);
- glCallLists(n, type, pc + 8);
-}
-
-void __glXDisp_DrawArrays(GLbyte *pc)
-{
- __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
- __GLXdispatchDrawArraysComponentHeader *compHeader;
- GLint numVertexes = hdr->numVertexes;
- GLint numComponents = hdr->numComponents;
- GLenum primType = hdr->primType;
- GLint stride = 0;
- int i;
-
- pc += sizeof(__GLXdispatchDrawArraysHeader);
- compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
-
- /* compute stride (same for all component arrays) */
- for (i = 0; i < numComponents; i++) {
- GLenum datatype = compHeader[i].datatype;
- GLint numVals = compHeader[i].numVals;
-
- stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
- }
-
- pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
-
- /* set up component arrays */
- for (i = 0; i < numComponents; i++) {
- GLenum datatype = compHeader[i].datatype;
- GLint numVals = compHeader[i].numVals;
- GLenum component = compHeader[i].component;
-
- switch (component) {
- case GL_VERTEX_ARRAY:
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(numVals, datatype, stride, pc);
- break;
- case GL_NORMAL_ARRAY:
- glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(datatype, stride, pc);
- break;
- case GL_COLOR_ARRAY:
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(numVals, datatype, stride, pc);
- break;
- case GL_INDEX_ARRAY:
- glEnableClientState(GL_INDEX_ARRAY);
- glIndexPointer(datatype, stride, pc);
- break;
- case GL_TEXTURE_COORD_ARRAY:
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(numVals, datatype, stride, pc);
- break;
- case GL_EDGE_FLAG_ARRAY:
- glEnableClientState(GL_EDGE_FLAG_ARRAY);
- glEdgeFlagPointer(stride, (const GLboolean *)pc);
- break;
- default:
- break;
- }
-
- pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
- }
-
- glDrawArrays(primType, 0, numVertexes);
-
- /* turn off anything we might have turned on */
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_INDEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_EDGE_FLAG_ARRAY);
-}
-
-void __glXDisp_DrawArraysEXT(GLbyte *pc)
-{
-#ifdef XXX_STUB
-#endif /*XXX_STUB*/
-}
diff --git a/GL/glx/render2swap.c b/GL/glx/render2swap.c
deleted file mode 100644
index e873d88aa..000000000
--- a/GL/glx/render2swap.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/* #define NEED_REPLIES */
-#include "glxserver.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-extern GLint __glEvalComputeK(GLenum target);
-
-void __glXDispSwap_Map1f(GLbyte *pc)
-{
- GLint order, k;
- GLfloat u1, u2, *points;
- GLenum target;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
-
- target = *(GLenum *)(pc + 0);
- order = *(GLint *)(pc + 12);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- points = (GLfloat *)(pc + 16);
- k = __glEvalComputeK(target);
-
- if (order <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = order * k;
- }
- __GLX_SWAP_FLOAT_ARRAY(points, compsize);
-
- glMap1f(target, u1, u2, k, order, points);
-}
-
-void __glXDispSwap_Map2f(GLbyte *pc)
-{
- GLint uorder, vorder, ustride, vstride, k;
- GLfloat u1, u2, v1, v2, *points;
- GLenum target;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 16);
- __GLX_SWAP_FLOAT(pc + 20);
-
- target = *(GLenum *)(pc + 0);
- uorder = *(GLint *)(pc + 12);
- vorder = *(GLint *)(pc + 24);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- v1 = *(GLfloat *)(pc + 16);
- v2 = *(GLfloat *)(pc + 20);
- points = (GLfloat *)(pc + 28);
-
- k = __glEvalComputeK(target);
- ustride = vorder * k;
- vstride = k;
-
- if (vorder <= 0 || uorder <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = uorder * vorder * k;
- }
- __GLX_SWAP_FLOAT_ARRAY(points, compsize);
-
- glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-void __glXDispSwap_Map1d(GLbyte *pc)
-{
- GLint order, k, compsize;
- GLenum target;
- GLdouble u1, u2, *points;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
-
- target = *(GLenum*) (pc + 16);
- order = *(GLint*) (pc + 20);
- k = __glEvalComputeK(target);
- if (order <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = order * k;
- }
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
- pc += 24;
-
-#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
- }
-#else
- points = (GLdouble*) pc;
-#endif
- glMap1d(target, u1, u2, k, order, points);
-}
-
-void __glXDispSwap_Map2d(GLbyte *pc)
-{
- GLdouble u1, u2, v1, v2, *points;
- GLint uorder, vorder, ustride, vstride, k, compsize;
- GLenum target;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_INT(pc + 36);
- __GLX_SWAP_INT(pc + 40);
-
- target = *(GLenum *)(pc + 32);
- uorder = *(GLint *)(pc + 36);
- vorder = *(GLint *)(pc + 40);
- k = __glEvalComputeK(target);
- if (vorder <= 0 || uorder <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = uorder * vorder * k;
- }
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- __GLX_GET_DOUBLE(v1,pc+16);
- __GLX_GET_DOUBLE(v2,pc+24);
- __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
- pc += 44;
- ustride = vorder * k;
- vstride = k;
-
-#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
- }
-#else
- points = (GLdouble*) pc;
-#endif
- glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-void __glXDispSwap_CallLists(GLbyte *pc)
-{
- GLenum type;
- GLsizei n;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- type = *(GLenum *)(pc + 4);
- n = *(GLsizei *)(pc + 0);
-
- switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- __GLX_SWAP_SHORT_ARRAY(pc+8, n);
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- __GLX_SWAP_INT_ARRAY(pc+8, n);
- break;
- case GL_FLOAT:
- __GLX_SWAP_FLOAT_ARRAY(pc+8, n);
- break;
- }
-
- glCallLists(n, type, pc+8);
-}
-
-static void swapArray(GLint numVals, GLenum datatype,
- GLint stride, GLint numVertexes, GLbyte *pc)
-{
- int i,j;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- switch (datatype) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- /* don't need to swap */
- return;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- for (i=0; i<numVertexes; i++) {
- GLshort *pVal = (GLshort *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_SHORT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- for (i=0; i<numVertexes; i++) {
- GLint *pVal = (GLint *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_INT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_FLOAT:
- for (i=0; i<numVertexes; i++) {
- GLfloat *pVal = (GLfloat *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_FLOAT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_DOUBLE:
- for (i=0; i<numVertexes; i++) {
- GLdouble *pVal = (GLdouble *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_DOUBLE(&pVal[j]);
- }
- pc += stride;
- }
- break;
- default:
- return;
- }
-}
-
-void __glXDispSwap_DrawArrays(GLbyte *pc)
-{
- __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
- __GLXdispatchDrawArraysComponentHeader *compHeader;
- GLint numVertexes = hdr->numVertexes;
- GLint numComponents = hdr->numComponents;
- GLenum primType = hdr->primType;
- GLint stride = 0;
- int i;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&numVertexes);
- __GLX_SWAP_INT(&numComponents);
- __GLX_SWAP_INT(&primType);
-
- pc += sizeof(__GLXdispatchDrawArraysHeader);
- compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
-
- /* compute stride (same for all component arrays) */
- for (i=0; i<numComponents; i++) {
- GLenum datatype = compHeader[i].datatype;
- GLint numVals = compHeader[i].numVals;
- GLenum component = compHeader[i].component;
-
- __GLX_SWAP_INT(&datatype);
- __GLX_SWAP_INT(&numVals);
- __GLX_SWAP_INT(&component);
-
- stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
- }
-
- pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
-
- /* set up component arrays */
- for (i=0; i<numComponents; i++) {
- GLenum datatype = compHeader[i].datatype;
- GLint numVals = compHeader[i].numVals;
- GLenum component = compHeader[i].component;
-
- swapArray(numVals, datatype, stride, numVertexes, pc);
-
- switch (component) {
- case GL_VERTEX_ARRAY:
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(numVals, datatype, stride, pc);
- break;
- case GL_NORMAL_ARRAY:
- glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(datatype, stride, pc);
- break;
- case GL_COLOR_ARRAY:
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(numVals, datatype, stride, pc);
- break;
- case GL_INDEX_ARRAY:
- glEnableClientState(GL_INDEX_ARRAY);
- glIndexPointer(datatype, stride, pc);
- break;
- case GL_TEXTURE_COORD_ARRAY:
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(numVals, datatype, stride, pc);
- break;
- case GL_EDGE_FLAG_ARRAY:
- glEnableClientState(GL_EDGE_FLAG_ARRAY);
- glEdgeFlagPointer(stride, (const GLboolean *)pc);
- break;
- default:
- break;
- }
-
- pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
- }
-
- glDrawArrays(primType, 0, numVertexes);
-
- /* turn off anything we might have turned on */
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_INDEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_EDGE_FLAG_ARRAY);
-}
-
-void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
-{
-#ifdef XXX_STUB
-#endif /*XXX_STUB*/
-}
diff --git a/GL/glx/renderpix.c b/GL/glx/renderpix.c
deleted file mode 100644
index ad5625dd6..000000000
--- a/GL/glx/renderpix.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/renderpix.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-void __glXDisp_PolygonStipple(GLbyte *pc)
-{
- __GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glPolygonStipple((GLubyte *)(hdr+1));
-}
-
-void __glXDisp_Bitmap(GLbyte *pc)
-{
- __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glBitmap((GLsizei) hdr->width,
- (GLsizei) hdr->height,
- (GLfloat) hdr->xorig,
- (GLfloat) hdr->yorig,
- (GLfloat) hdr->xmove,
- (GLfloat) hdr->ymove,
- (GLubyte *)(hdr+1));
-}
-
-void __glXDisp_TexImage1D(GLbyte *pc)
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexImage1D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->components,
- (GLsizei) hdr->width,
- (GLint) hdr->border,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_TexImage2D(GLbyte *pc)
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexImage2D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->components,
- (GLsizei) hdr->width,
- (GLsizei) hdr->height,
- (GLint) hdr->border,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_TexImage3D(GLbyte *pc)
-{
- __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
- hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_DrawPixels(GLbyte *pc)
-{
- __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glDrawPixels((GLsizei) hdr->width,
- (GLsizei) hdr->height,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_TexSubImage1D(GLbyte *pc)
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexSubImage1D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->xoffset,
- (GLsizei) hdr->width,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_TexSubImage2D(GLbyte *pc)
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexSubImage2D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->xoffset,
- (GLint) hdr->yoffset,
- (GLsizei) hdr->width,
- (GLsizei) hdr->height,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_TexSubImage3D(GLbyte *pc)
-{
- __GLXdispatchTexSubImage3DHeader *hdr =
- (__GLXdispatchTexSubImage3DHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
- hdr->zoffset, hdr->width, hdr->height, hdr->depth,
- hdr->format, hdr->type, (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_ColorTable(GLbyte *pc)
-{
- __GLXdispatchColorTableHeader *hdr =
- (__GLXdispatchColorTableHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glColorTable(hdr->target, hdr->internalformat,
- hdr->width, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_ColorSubTable(GLbyte *pc)
-{
- __GLXdispatchColorSubTableHeader *hdr =
- (__GLXdispatchColorSubTableHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
- hdr->type, (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_ConvolutionFilter1D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glConvolutionFilter1D(hdr->target, hdr->internalformat,
- hdr->width, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_ConvolutionFilter2D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glConvolutionFilter2D(hdr->target, hdr->internalformat,
- hdr->width, hdr->height, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDisp_SeparableFilter2D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
- GLint hdrlen, image1len;
-
- hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- /* XXX check this usage - internal code called
- ** a version without the packing parameters
- */
- image1len = __glXImageSize(hdr->format, hdr->type, hdr->width, 1,
- hdr->rowLength, hdr->skipRows, hdr->alignment);
- image1len = __GLX_PAD(image1len);
-
- glSeparableFilter2D(hdr->target, hdr->internalformat,
- hdr->width, hdr->height, hdr->format, hdr->type,
- ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
-}
diff --git a/GL/glx/renderpixswap.c b/GL/glx/renderpixswap.c
deleted file mode 100644
index 3b0e1f6b7..000000000
--- a/GL/glx/renderpixswap.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/renderpixswap.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-void __glXDispSwap_PolygonStipple(GLbyte *pc)
-{
- __GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glPolygonStipple((GLubyte *)(hdr+1));
-}
-
-void __glXDispSwap_Bitmap(GLbyte *pc)
-{
- __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glBitmap((GLsizei) hdr->width,
- (GLsizei) hdr->height,
- (GLfloat) hdr->xorig,
- (GLfloat) hdr->yorig,
- (GLfloat) hdr->xmove,
- (GLfloat) hdr->ymove,
- (GLubyte *)(hdr+1));
-}
-
-void __glXDispSwap_TexImage1D(GLbyte *pc)
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->components);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexImage1D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->components,
- (GLsizei) hdr->width,
- (GLint) hdr->border,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_TexImage2D(GLbyte *pc)
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->components);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexImage2D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->components,
- (GLsizei) hdr->width,
- (GLsizei) hdr->height,
- (GLint) hdr->border,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_TexImage3D(GLbyte *pc)
-{
- __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->depth);
- __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
- hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_DrawPixels(GLbyte *pc)
-{
- __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glDrawPixels((GLsizei) hdr->width,
- (GLsizei) hdr->height,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_TexSubImage1D(GLbyte *pc)
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexSubImage1D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->xoffset,
- (GLsizei) hdr->width,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_TexSubImage2D(GLbyte *pc)
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
-
- glTexSubImage2D(hdr->target,
- (GLint) hdr->level,
- (GLint) hdr->xoffset,
- (GLint) hdr->yoffset,
- (GLsizei) hdr->width,
- (GLsizei) hdr->height,
- hdr->format,
- hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_TexSubImage3D(GLbyte *pc)
-{
- __GLXdispatchTexSubImage3DHeader *hdr =
- (__GLXdispatchTexSubImage3DHeader *) pc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->depth);
- __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
- hdr->zoffset, hdr->width, hdr->height, hdr->depth,
- hdr->format, hdr->type, (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_ColorTable(GLbyte *pc)
-{
- __GLXdispatchColorTableHeader *hdr =
- (__GLXdispatchColorTableHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glColorTable(hdr->target, hdr->internalformat,
- hdr->width, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_ColorSubTable(GLbyte *pc)
-{
- __GLXdispatchColorSubTableHeader *hdr =
- (__GLXdispatchColorSubTableHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->start);
- __GLX_SWAP_INT((GLbyte *)&hdr->count);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
- hdr->type, (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glConvolutionFilter2D(hdr->target, hdr->internalformat,
- hdr->width, 1, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- glConvolutionFilter2D(hdr->target, hdr->internalformat,
- hdr->width, hdr->height, hdr->format, hdr->type,
- (GLvoid *)(hdr+1));
-}
-
-void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
- GLint hdrlen, image1len;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
-
- /*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
-
- /* XXX check this usage - internal code called
- ** a version without the packing parameters
- */
- image1len = __glXImageSize(hdr->format, hdr->type, hdr->width, 1,
- hdr->rowLength, hdr->skipRows, hdr->alignment);
- image1len = __GLX_PAD(image1len);
-
-
- glSeparableFilter2D(hdr->target, hdr->internalformat,
- hdr->width, hdr->height, hdr->format, hdr->type,
- ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
-}
diff --git a/GL/glx/rensize.c b/GL/glx/rensize.c
deleted file mode 100644
index 0a3e537f8..000000000
--- a/GL/glx/rensize.c
+++ /dev/null
@@ -1,920 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/rensize.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include <GL/gl.h>
-#include "glxserver.h"
-#include "GL/glxproto.h"
-#include "unpack.h"
-#include "impsize.h"
-
-#define SWAPL(a) \
- (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \
- ((a & 0xff00U)<<8) | ((a & 0xffU)<<24))
-
-int __glXCallListsReqSize(GLbyte *pc, Bool swap )
-{
- GLsizei n = *(GLsizei *)(pc + 0);
- GLenum type = *(GLenum *)(pc + 4);
-
- if (swap) {
- n = SWAPL( n );
- type = SWAPL( type );
- }
- return __glCallLists_size( n, type ); /* defined in samplegl lib */
-}
-
-int __glXFogivReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 0);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glFogiv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXFogfvReqSize(GLbyte *pc, Bool swap )
-{
- return __glXFogivReqSize( pc, swap );
-}
-
-int __glXLightfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glLightfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXLightivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXLightfvReqSize( pc, swap );
-}
-
-int __glXLightModelfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 0);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glLightModelfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXLightModelivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXLightModelfvReqSize( pc, swap );
-}
-
-int __glXMaterialfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glMaterialfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXMaterialivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXMaterialfvReqSize( pc, swap );
-}
-
-int __glXTexGendvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 8 * __glTexGendv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXTexGenfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glTexGenfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXTexGenivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXTexGenfvReqSize( pc, swap );
-}
-
-int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glTexParameterfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXTexParameterivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXTexParameterfvReqSize( pc, swap );
-}
-
-int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glTexEnvfv_size( pname ); /* defined in samplegl lib */
-}
-
-int __glXTexEnvivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXTexEnvfvReqSize( pc, swap );
-}
-
-static int Map1Size( GLint k, GLint order)
-{
- if (order <= 0 || k < 0) return -1;
- return k * order;
-}
-
-int __glXMap1dReqSize(GLbyte *pc, Bool swap )
-{
- GLenum target;
- GLint order, k;
-
- target = *(GLenum*) (pc + 16);
- order = *(GLint*) (pc + 20);
- if (swap) {
- target = SWAPL( target );
- order = SWAPL( order );
- }
- k = __glEvalComputeK( target );
- return 8 * Map1Size( k, order );
-}
-
-int __glXMap1fReqSize(GLbyte *pc, Bool swap )
-{
- GLenum target;
- GLint order, k;
-
- target = *(GLenum *)(pc + 0);
- order = *(GLint *)(pc + 12);
- if (swap) {
- target = SWAPL( target );
- order = SWAPL( order );
- }
- k = __glEvalComputeK(target);
- return 4 * Map1Size(k, order);
-}
-
-static int Map2Size(int k, int majorOrder, int minorOrder)
-{
- if (majorOrder <= 0 || minorOrder <= 0 || k < 0) return -1;
- return k * majorOrder * minorOrder;
-}
-
-int __glXMap2dReqSize(GLbyte *pc, Bool swap )
-{
- GLenum target;
- GLint uorder, vorder, k;
-
- target = *(GLenum *)(pc + 32);
- uorder = *(GLint *)(pc + 36);
- vorder = *(GLint *)(pc + 40);
- if (swap) {
- target = SWAPL( target );
- uorder = SWAPL( uorder );
- vorder = SWAPL( vorder );
- }
- k = __glEvalComputeK( target );
- return 8 * Map2Size( k, uorder, vorder );
-}
-
-int __glXMap2fReqSize(GLbyte *pc, Bool swap )
-{
- GLenum target;
- GLint uorder, vorder, k;
-
- target = *(GLenum *)(pc + 0);
- uorder = *(GLint *)(pc + 12);
- vorder = *(GLint *)(pc + 24);
- if (swap) {
- target = SWAPL( target );
- uorder = SWAPL( uorder );
- vorder = SWAPL( vorder );
- }
- k = __glEvalComputeK( target );
- return 4 * Map2Size( k, uorder, vorder );
-}
-
-int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap )
-{
- GLint mapsize;
- mapsize = *(GLint *)(pc + 4);
- if (swap) {
- mapsize = SWAPL( mapsize );
- }
- return 4 * mapsize;
-}
-
-int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap )
-{
- return __glXPixelMapfvReqSize( pc, swap );
-}
-
-int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap )
-{
- GLint mapsize;
- mapsize = *(GLint *)(pc + 4);
- if (swap) {
- mapsize = SWAPL( mapsize );
- }
- return 2 * mapsize;
-}
-
-int __glXImageSize( GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLint rowLength, GLint skipRows, GLint alignment )
-{
- return __glXImage3DSize( format, type, w, h, 1, 0, rowLength,
- 0, skipRows, alignment );
-}
-
-/* XXX
- * This should be folded into __glXImageSize().
- */
-int __glXImage3DSize( GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLsizei d, GLint imageHeight, GLint rowLength,
- GLint skipImages, GLint skipRows, GLint alignment )
-{
- GLint bytesPerElement, elementsPerGroup, groupsPerRow;
- GLint groupSize, rowSize, padding, imageSize;
-
- if (w < 0 || h < 0 || d < 0 ||
- (type == GL_BITMAP &&
- (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) {
- return -1;
- }
- if (w==0 || h==0 || d == 0) return 0;
-
- if (type == GL_BITMAP) {
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = w;
- }
- rowSize = (groupsPerRow + 7) >> 3;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- return ((h + skipRows) * rowSize);
- } else {
- switch(format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_INTENSITY:
- elementsPerGroup = 1;
- break;
- case GL_422_EXT:
- case GL_422_REV_EXT:
- case GL_422_AVERAGE_EXT:
- case GL_422_REV_AVERAGE_EXT:
- case GL_DEPTH_STENCIL_NV:
- case GL_DEPTH_STENCIL_MESA:
- case GL_YCBCR_MESA:
- case GL_LUMINANCE_ALPHA:
- elementsPerGroup = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- elementsPerGroup = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- elementsPerGroup = 4;
- break;
- default:
- return -1;
- }
- switch(type) {
- case GL_UNSIGNED_BYTE:
- case GL_BYTE:
- bytesPerElement = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- bytesPerElement = 1;
- elementsPerGroup = 1;
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- bytesPerElement = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- case GL_UNSIGNED_SHORT_8_8_APPLE:
- case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
- case GL_UNSIGNED_SHORT_15_1_MESA:
- case GL_UNSIGNED_SHORT_1_15_REV_MESA:
- bytesPerElement = 2;
- elementsPerGroup = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- bytesPerElement = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- case GL_UNSIGNED_INT_24_8_NV:
- case GL_UNSIGNED_INT_24_8_MESA:
- case GL_UNSIGNED_INT_8_24_REV_MESA:
- bytesPerElement = 4;
- elementsPerGroup = 1;
- break;
- default:
- return -1;
- }
- groupSize = bytesPerElement * elementsPerGroup;
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = w;
- }
- rowSize = groupsPerRow * groupSize;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- if (imageHeight > 0) {
- imageSize = (imageHeight + skipRows) * rowSize;
- } else {
- imageSize = (h + skipRows) * rowSize;
- }
- return ((d + skipImages) * imageSize);
- }
-}
-
-
-int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment );
-}
-
-int __glXBitmapReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- return __glXImageSize( GL_COLOR_INDEX, GL_BITMAP, w, h,
- rowLength, skipRows, alignment );
-}
-
-int __glXTexImage1DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
- GLenum target = hdr->target;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- target = SWAPL( target );
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- if (target == GL_PROXY_TEXTURE_1D) {
- return 0;
- } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) {
- return -1;
- }
- return __glXImageSize( format, type, w, 1, rowLength, skipRows, alignment );
-}
-
-int __glXTexImage2DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
- GLenum target = hdr->target;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- target = SWAPL( target );
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
- return 0;
- } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) {
- return -1;
- }
- return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment );
-}
-
-/* XXX this is used elsewhere - should it be exported from glxserver.h? */
-int __glXTypeSize(GLenum enm)
-{
- switch(enm) {
- case GL_BYTE: return sizeof(GLbyte);
- case GL_UNSIGNED_BYTE: return sizeof(GLubyte);
- case GL_SHORT: return sizeof(GLshort);
- case GL_UNSIGNED_SHORT: return sizeof(GLushort);
- case GL_INT: return sizeof(GLint);
- case GL_UNSIGNED_INT: return sizeof(GLint);
- case GL_FLOAT: return sizeof(GLfloat);
- case GL_DOUBLE: return sizeof(GLdouble);
- default: return -1;
- }
-}
-
-int __glXDrawArraysSize( GLbyte *pc, Bool swap )
-{
- __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
- __GLXdispatchDrawArraysComponentHeader *compHeader;
- GLint numVertexes = hdr->numVertexes;
- GLint numComponents = hdr->numComponents;
- GLint arrayElementSize = 0;
- int i;
-
- if (swap) {
- numVertexes = SWAPL( numVertexes );
- numComponents = SWAPL( numComponents );
- }
-
- pc += sizeof(__GLXdispatchDrawArraysHeader);
- compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
-
- for (i=0; i<numComponents; i++) {
- GLenum datatype = compHeader[i].datatype;
- GLint numVals = compHeader[i].numVals;
- GLint component = compHeader[i].component;
-
- if (swap) {
- datatype = SWAPL( datatype );
- numVals = SWAPL( numVals );
- component = SWAPL( component );
- }
-
- switch (component) {
- case GL_VERTEX_ARRAY:
- case GL_COLOR_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
- break;
- case GL_NORMAL_ARRAY:
- if (numVals != 3) {
- /* bad size */
- return -1;
- }
- break;
- case GL_INDEX_ARRAY:
- if (numVals != 1) {
- /* bad size */
- return -1;
- }
- break;
- case GL_EDGE_FLAG_ARRAY:
- if ((numVals != 1) && (datatype != GL_UNSIGNED_BYTE)) {
- /* bad size or bad type */
- return -1;
- }
- break;
- default:
- /* unknown component type */
- return -1;
- }
-
- arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype));
-
- pc += sizeof(__GLXdispatchDrawArraysComponentHeader);
- }
-
- return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) +
- (numVertexes * arrayElementSize));
-}
-
-int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap )
-{
- GLint n = *(GLsizei *)(pc + 0);
- if (swap) n = SWAPL(n);
- return(8*n); /* 4*n for textures, 4*n for priorities */
-}
-
-int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- return __glXImageSize( format, type, w, 1, rowLength, skipRows, alignment );
-}
-
-int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment );
-}
-
-int __glXTexImage3DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
- GLenum target = hdr->target;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint d = hdr->depth;
- GLint imageHeight = hdr->imageHeight;
- GLint rowLength = hdr->rowLength;
- GLint skipImages = hdr->skipImages;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
- GLint nullImage = hdr->nullimage;
-
- if (swap) {
- target = SWAPL( target );
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- d = SWAPL( d );
- imageHeight = SWAPL( imageHeight );
- rowLength = SWAPL( rowLength );
- skipImages = SWAPL( skipImages );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- if (target == GL_PROXY_TEXTURE_3D || nullImage) {
- return 0;
- } else {
- return __glXImage3DSize( format, type, w, h, d, imageHeight,
- rowLength, skipImages, skipRows,
- alignment);
- }
-}
-
-int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchTexSubImage3DHeader *hdr =
- (__GLXdispatchTexSubImage3DHeader *) pc;
- GLenum target = hdr->target;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint d = hdr->depth;
- GLint imageHeight = hdr->imageHeight;
- GLint rowLength = hdr->rowLength;
- GLint skipImages = hdr->skipImages;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- target = SWAPL( target );
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- d = SWAPL( d );
- imageHeight = SWAPL( imageHeight );
- rowLength = SWAPL( rowLength );
- skipImages = SWAPL( skipImages );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
- if (target == GL_PROXY_TEXTURE_3D) {
- return 0;
- } else {
- return __glXImage3DSize( format, type, w, h, d, imageHeight,
- rowLength, skipImages, skipRows,
- alignment);
- }
-}
-
-int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint rowLength = hdr->rowLength;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- rowLength = SWAPL( rowLength );
- alignment = SWAPL( alignment );
- }
-
- return __glXImageSize ( format, type, w, 1, rowLength, 0, alignment );
-}
-
-int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint skipRows = hdr->skipRows;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- skipRows = SWAPL( skipRows );
- alignment = SWAPL( alignment );
- }
-
- return __glXImageSize ( format, type, w, h, rowLength, skipRows, alignment );
-}
-
-int __glXConvolutionParameterivSize(GLenum pname)
-{
- switch (pname) {
- case GL_CONVOLUTION_BORDER_COLOR:
- case GL_CONVOLUTION_FILTER_SCALE:
- case GL_CONVOLUTION_FILTER_BIAS:
- return 4;
- case GL_CONVOLUTION_BORDER_MODE:
- return 1;
- default:
- return -1;
- }
-}
-
-int __glXConvolutionParameterfvSize(GLenum pname)
-{
- return __glXConvolutionParameterivSize(pname);
-}
-
-int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glXConvolutionParameterivSize( pname );
-}
-
-int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap )
-{
- return __glXConvolutionParameterivReqSize( pc, swap );
-}
-
-int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
-
- GLint image1size, image2size;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint h = hdr->height;
- GLint rowLength = hdr->rowLength;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- h = SWAPL( h );
- rowLength = SWAPL( rowLength );
- alignment = SWAPL( alignment );
- }
-
- /* XXX Should rowLength be used for either or both image? */
- image1size = __glXImageSize ( format, type, w, 1, rowLength, 0, alignment );
- image1size = __GLX_PAD(image1size);
- image2size = __glXImageSize ( format, type, h, 1, rowLength, 0, alignment );
- return image1size + image2size;
-
-}
-
-int __glXColorTableParameterfvSize(GLenum pname)
-{
- /* currently, only scale and bias are supported; return RGBA */
- switch(pname) {
- case GL_COLOR_TABLE_SCALE:
- case GL_COLOR_TABLE_BIAS:
- return 4;
- default:
- return 0;
- }
-}
-
-int __glXColorTableParameterivSize(GLenum pname)
-{
- /* fv and iv are the same in this context */
- return __glXColorTableParameterfvSize(pname);
-}
-
-int __glXColorTableReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchColorTableHeader *hdr =
- (__GLXdispatchColorTableHeader *) pc;
-
- GLenum target = hdr->target;
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint w = hdr->width;
- GLint rowLength = hdr->rowLength;
- GLint alignment = hdr->alignment;
-
- switch (target) {
- case GL_PROXY_TEXTURE_1D:
- case GL_PROXY_TEXTURE_2D:
- case GL_PROXY_TEXTURE_3D:
- case GL_PROXY_COLOR_TABLE:
- case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
- case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return 0;
- }
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- w = SWAPL( w );
- rowLength = SWAPL( rowLength );
- alignment = SWAPL( alignment );
- }
-
- return __glXImageSize ( format, type, w, 1, rowLength, 0, alignment );
-}
-
-int __glXColorSubTableReqSize(GLbyte *pc, Bool swap )
-{
- __GLXdispatchColorSubTableHeader *hdr =
- (__GLXdispatchColorSubTableHeader *) pc;
-
- GLenum format = hdr->format;
- GLenum type = hdr->type;
- GLint count = hdr->count;
- GLint rowLength = hdr->rowLength;
- GLint alignment = hdr->alignment;
-
- if (swap) {
- format = SWAPL( format );
- type = SWAPL( type );
- count = SWAPL( count );
- rowLength = SWAPL( rowLength );
- alignment = SWAPL( alignment );
- }
-
- return __glXImageSize ( format, type, count, 1, rowLength, 0, alignment );
-}
-
-int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 4);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glXColorTableParameterfvSize(pname);
-}
-
-int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap )
-{
- /* no difference between fv and iv versions */
- return __glXColorTableParameterfvReqSize(pc, swap);
-}
-
-int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap )
-{
- GLenum pname = *(GLenum *)(pc + 0);
- if (swap) {
- pname = SWAPL( pname );
- }
- return 4 * __glPointParameterfvARB_size( pname );
-}
diff --git a/GL/glx/rensizetab.c b/GL/glx/rensizetab.c
deleted file mode 100644
index c787366fa..000000000
--- a/GL/glx/rensizetab.c
+++ /dev/null
@@ -1,2442 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/rensizetab.c,v 1.4 2003/09/28 20:15:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxserver.h"
-#include "g_disptab_EXT.h"
-
-__GLXrenderSizeData __glXRenderSizeTable[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
- /* no such opcode */ { 0, 0 },
- /* CallList */ { 8, 0 },
- /* CallLists */ { 12, __glXCallListsReqSize },
- /* ListBase */ { 8, 0 },
- /* Begin */ { 8, 0 },
- /* Bitmap */ { 48, __glXBitmapReqSize },
- /* Color3bv */ { 8, 0 },
- /* Color3dv */ { 28, 0 },
- /* Color3fv */ { 16, 0 },
- /* Color3iv */ { 16, 0 },
- /* Color3sv */ { 12, 0 },
- /* Color3ubv */ { 8, 0 },
- /* Color3uiv */ { 16, 0 },
- /* Color3usv */ { 12, 0 },
- /* Color4bv */ { 8, 0 },
- /* Color4dv */ { 36, 0 },
- /* Color4fv */ { 20, 0 },
- /* Color4iv */ { 20, 0 },
- /* Color4sv */ { 12, 0 },
- /* Color4ubv */ { 8, 0 },
- /* Color4uiv */ { 20, 0 },
- /* Color4usv */ { 12, 0 },
- /* EdgeFlagv */ { 8, 0 },
- /* End */ { 4, 0 },
- /* Indexdv */ { 12, 0 },
- /* Indexfv */ { 8, 0 },
- /* Indexiv */ { 8, 0 },
- /* Indexsv */ { 8, 0 },
- /* Normal3bv */ { 8, 0 },
- /* Normal3dv */ { 28, 0 },
- /* Normal3fv */ { 16, 0 },
- /* Normal3iv */ { 16, 0 },
- /* Normal3sv */ { 12, 0 },
- /* RasterPos2dv */ { 20, 0 },
- /* RasterPos2fv */ { 12, 0 },
- /* RasterPos2iv */ { 12, 0 },
- /* RasterPos2sv */ { 8, 0 },
- /* RasterPos3dv */ { 28, 0 },
- /* RasterPos3fv */ { 16, 0 },
- /* RasterPos3iv */ { 16, 0 },
- /* RasterPos3sv */ { 12, 0 },
- /* RasterPos4dv */ { 36, 0 },
- /* RasterPos4fv */ { 20, 0 },
- /* RasterPos4iv */ { 20, 0 },
- /* RasterPos4sv */ { 12, 0 },
- /* Rectdv */ { 36, 0 },
- /* Rectfv */ { 20, 0 },
- /* Rectiv */ { 20, 0 },
- /* Rectsv */ { 12, 0 },
- /* TexCoord1dv */ { 12, 0 },
- /* TexCoord1fv */ { 8, 0 },
- /* TexCoord1iv */ { 8, 0 },
- /* TexCoord1sv */ { 8, 0 },
- /* TexCoord2dv */ { 20, 0 },
- /* TexCoord2fv */ { 12, 0 },
- /* TexCoord2iv */ { 12, 0 },
- /* TexCoord2sv */ { 8, 0 },
- /* TexCoord3dv */ { 28, 0 },
- /* TexCoord3fv */ { 16, 0 },
- /* TexCoord3iv */ { 16, 0 },
- /* TexCoord3sv */ { 12, 0 },
- /* TexCoord4dv */ { 36, 0 },
- /* TexCoord4fv */ { 20, 0 },
- /* TexCoord4iv */ { 20, 0 },
- /* TexCoord4sv */ { 12, 0 },
- /* Vertex2dv */ { 20, 0 },
- /* Vertex2fv */ { 12, 0 },
- /* Vertex2iv */ { 12, 0 },
- /* Vertex2sv */ { 8, 0 },
- /* Vertex3dv */ { 28, 0 },
- /* Vertex3fv */ { 16, 0 },
- /* Vertex3iv */ { 16, 0 },
- /* Vertex3sv */ { 12, 0 },
- /* Vertex4dv */ { 36, 0 },
- /* Vertex4fv */ { 20, 0 },
- /* Vertex4iv */ { 20, 0 },
- /* Vertex4sv */ { 12, 0 },
- /* ClipPlane */ { 40, 0 },
- /* ColorMaterial */ { 12, 0 },
- /* CullFace */ { 8, 0 },
- /* Fogf */ { 12, 0 },
- /* Fogfv */ { 8, __glXFogfvReqSize },
- /* Fogi */ { 12, 0 },
- /* Fogiv */ { 8, __glXFogivReqSize },
- /* FrontFace */ { 8, 0 },
- /* Hint */ { 12, 0 },
- /* Lightf */ { 16, 0 },
- /* Lightfv */ { 12, __glXLightfvReqSize },
- /* Lighti */ { 16, 0 },
- /* Lightiv */ { 12, __glXLightivReqSize },
- /* LightModelf */ { 12, 0 },
- /* LightModelfv */ { 8, __glXLightModelfvReqSize },
- /* LightModeli */ { 12, 0 },
- /* LightModeliv */ { 8, __glXLightModelivReqSize },
- /* LineStipple */ { 12, 0 },
- /* LineWidth */ { 8, 0 },
- /* Materialf */ { 16, 0 },
- /* Materialfv */ { 12, __glXMaterialfvReqSize },
- /* Materiali */ { 16, 0 },
- /* Materialiv */ { 12, __glXMaterialivReqSize },
- /* PointSize */ { 8, 0 },
- /* PolygonMode */ { 12, 0 },
- /* PolygonStipple */ { 152, 0 },
- /* Scissor */ { 20, 0 },
- /* ShadeModel */ { 8, 0 },
- /* TexParameterf */ { 16, 0 },
- /* TexParameterfv */ { 12, __glXTexParameterfvReqSize },
- /* TexParameteri */ { 16, 0 },
- /* TexParameteriv */ { 12, __glXTexParameterivReqSize },
- /* TexImage1D */ { 56, __glXTexImage1DReqSize },
- /* TexImage2D */ { 56, __glXTexImage2DReqSize },
- /* TexEnvf */ { 16, 0 },
- /* TexEnvfv */ { 12, __glXTexEnvfvReqSize },
- /* TexEnvi */ { 16, 0 },
- /* TexEnviv */ { 12, __glXTexEnvivReqSize },
- /* TexGend */ { 20, 0 },
- /* TexGendv */ { 12, __glXTexGendvReqSize },
- /* TexGenf */ { 16, 0 },
- /* TexGenfv */ { 12, __glXTexGenfvReqSize },
- /* TexGeni */ { 16, 0 },
- /* TexGeniv */ { 12, __glXTexGenivReqSize },
- /* InitNames */ { 4, 0 },
- /* LoadName */ { 8, 0 },
- /* PassThrough */ { 8, 0 },
- /* PopName */ { 4, 0 },
- /* PushName */ { 8, 0 },
- /* DrawBuffer */ { 8, 0 },
- /* Clear */ { 8, 0 },
- /* ClearAccum */ { 20, 0 },
- /* ClearIndex */ { 8, 0 },
- /* ClearColor */ { 20, 0 },
- /* ClearStencil */ { 8, 0 },
- /* ClearDepth */ { 12, 0 },
- /* StencilMask */ { 8, 0 },
- /* ColorMask */ { 8, 0 },
- /* DepthMask */ { 8, 0 },
- /* IndexMask */ { 8, 0 },
- /* Accum */ { 12, 0 },
- /* Disable */ { 8, 0 },
- /* Enable */ { 8, 0 },
- /* no such opcode */ { 0, 0 },
- /* PopAttrib */ { 4, 0 },
- /* PushAttrib */ { 8, 0 },
- /* Map1d */ { 28, __glXMap1dReqSize },
- /* Map1f */ { 20, __glXMap1fReqSize },
- /* Map2d */ { 48, __glXMap2dReqSize },
- /* Map2f */ { 32, __glXMap2fReqSize },
- /* MapGrid1d */ { 24, 0 },
- /* MapGrid1f */ { 16, 0 },
- /* MapGrid2d */ { 44, 0 },
- /* MapGrid2f */ { 28, 0 },
- /* EvalCoord1dv */ { 12, 0 },
- /* EvalCoord1fv */ { 8, 0 },
- /* EvalCoord2dv */ { 20, 0 },
- /* EvalCoord2fv */ { 12, 0 },
- /* EvalMesh1 */ { 16, 0 },
- /* EvalPoint1 */ { 8, 0 },
- /* EvalMesh2 */ { 24, 0 },
- /* EvalPoint2 */ { 12, 0 },
- /* AlphaFunc */ { 12, 0 },
- /* BlendFunc */ { 12, 0 },
- /* LogicOp */ { 8, 0 },
- /* StencilFunc */ { 16, 0 },
- /* StencilOp */ { 16, 0 },
- /* DepthFunc */ { 8, 0 },
- /* PixelZoom */ { 12, 0 },
- /* PixelTransferf */ { 12, 0 },
- /* PixelTransferi */ { 12, 0 },
- /* PixelMapfv */ { 12, __glXPixelMapfvReqSize },
- /* PixelMapuiv */ { 12, __glXPixelMapuivReqSize },
- /* PixelMapusv */ { 12, __glXPixelMapusvReqSize },
- /* ReadBuffer */ { 8, 0 },
- /* CopyPixels */ { 24, 0 },
- /* DrawPixels */ { 40, __glXDrawPixelsReqSize },
- /* DepthRange */ { 20, 0 },
- /* Frustum */ { 52, 0 },
- /* LoadIdentity */ { 4, 0 },
- /* LoadMatrixf */ { 68, 0 },
- /* LoadMatrixd */ { 132, 0 },
- /* MatrixMode */ { 8, 0 },
- /* MultMatrixf */ { 68, 0 },
- /* MultMatrixd */ { 132, 0 },
- /* Ortho */ { 52, 0 },
- /* PopMatrix */ { 4, 0 },
- /* PushMatrix */ { 4, 0 },
- /* Rotated */ { 36, 0 },
- /* Rotatef */ { 20, 0 },
- /* Scaled */ { 28, 0 },
- /* Scalef */ { 16, 0 },
- /* Translated */ { 28, 0 },
- /* Translatef */ { 16, 0 },
- /* Viewport */ { 20, 0 },
- /* PolygonOffset */ { 12, 0 },
- /* no such opcode */ { 0, 0 },
- /* Indexubv */ { 8, 0 },
- /* ColorSubTable */ { 44, __glXColorSubTableReqSize },
- /* CopyColorSubTable */ { 24, 0 },
- /* ActiveTextureARB */ { 8, 0 },
- /* MultiTexCoord1dvARB */ { 16, 0 },
- /* MultiTexCoord1fvARB */ { 12, 0 },
- /* MultiTexCoord1ivARB */ { 12, 0 },
- /* MultiTexCoord1svARB */ { 12, 0 },
- /* MultiTexCoord2dvARB */ { 24, 0 },
- /* MultiTexCoord2fvARB */ { 16, 0 },
- /* MultiTexCoord2ivARB */ { 16, 0 },
- /* MultiTexCoord2svARB */ { 12, 0 },
- /* MultiTexCoord3dvARB */ { 32, 0 },
- /* MultiTexCoord3fvARB */ { 20, 0 },
- /* MultiTexCoord3ivARB */ { 20, 0 },
- /* MultiTexCoord3svARB */ { 16, 0 },
- /* MultiTexCoord4dvARB */ { 40, 0 },
- /* MultiTexCoord4fvARB */ { 24, 0 },
- /* MultiTexCoord4ivARB */ { 24, 0 },
- /* MultiTexCoord4svARB 213 */ { 16, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode 220 */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* WindowPos3fARB 230 */ { 16, 0 },
-};
-__GLXrenderSizeData __glXRenderSizeTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1] = {
- /* ColorTable 2053 */ { 44, __glXColorTableReqSize },
- /* ColorTableParameterfv */ { 12, __glXColorTableParameterfvReqSize },
- /* ColorTableParameteriv */ { 12, __glXColorTableParameterivReqSize },
- /* CopyColorTable */ { 24, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* PointParameterfARB 2065 */ { 12, 0 },
- /* PointParameterfvARB 2066 */ { 8, __glXPointParameterfvARBReqSize },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* BlendColor */ { 20, 0 },
- /* BlendEquation */ { 8, 0 },
- /* no such opcode */ { 0, 0 },
- /* TexSubImage1D */ { 60, __glXTexSubImage1DReqSize },
- /* TexSubImage2D */ { 60, __glXTexSubImage2DReqSize },
- /* ConvolutionFilter1D */ { 48, __glXConvolutionFilter1DReqSize },
- /* ConvolutionFilter2D */ { 48, __glXConvolutionFilter2DReqSize },
- /* ConvolutionParameterf */ { 16, 0 },
- /* ConvolutionParameterfv */ { 12, __glXConvolutionParameterfvReqSize },
- /* ConvolutionParameteri */ { 16, 0 },
- /* ConvolutionParameteriv */ { 12, __glXConvolutionParameterivReqSize },
- /* CopyConvolutionFilter1D */ { 24, },
- /* CopyConvolutionFilter2D */ { 28, },
- /* SeparableFilter2D */ { 48, __glXSeparableFilter2DReqSize },
- /* Histogram */ { 20, },
- /* Minmax */ { 16, },
- /* ResetHistogram */ { 8, },
- /* ResetMinmax */ { 8, },
- /* TexImage3D */ { 84, __glXTexImage3DReqSize },
- /* TexSubImage3D */ { 92, __glXTexSubImage3DReqSize },
- /* DrawArrays */ { 16, __glXDrawArraysSize },
- /* BindTexture */ { 12, 0 },
- /* PrioritizeTextures */ { 8, __glXPrioritizeTexturesReqSize },
- /* CopyTexImage1D */ { 32, 0 },
- /* CopyTexImage2D */ { 36, 0 },
- /* CopyTexSubImage1D */ { 28, 0 },
- /* CopyTexSubImage2D */ { 36, 0 },
- /* CopyTexSubImage3D 4123 */ { 40, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* no such opcode */ { 0, 0 },
- /* ActiveStencilFaceEXT 4220 */ { 8, 0 },
-};
diff --git a/GL/glx/single2.c b/GL/glx/single2.c
deleted file mode 100644
index 286f63d70..000000000
--- a/GL/glx/single2.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.6 2001/06/06 19:00:15 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxutil.h"
-#include "glxext.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "GL/glx_ansic.h"
-
-int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei size;
- GLenum type;
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- size = *(GLsizei *)(pc+0);
- type = *(GLenum *)(pc+4);
- if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
- (size_t)size
- * __GLX_SIZE_FLOAT32);
- if (!cx->feedbackBuf) {
- cl->client->errorValue = size;
- return BadAlloc;
- }
- cx->feedbackBufSize = size;
- }
- glFeedbackBuffer(size, type, cx->feedbackBuf);
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- GLsizei size;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- size = *(GLsizei *)(pc+0);
- if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
- (size_t) size
- * __GLX_SIZE_CARD32);
- if (!cx->selectBuf) {
- cl->client->errorValue = size;
- return BadAlloc;
- }
- cx->selectBufSize = size;
- }
- glSelectBuffer(size, cx->selectBuf);
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client;
- xGLXRenderModeReply reply;
- __GLXcontext *cx;
- GLint nitems=0, retBytes=0, retval, newModeCheck;
- GLubyte *retBuffer = NULL;
- GLenum newMode;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- newMode = *(GLenum*) pc;
- retval = glRenderMode(newMode);
-
- /* Check that render mode worked */
- glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
- if (newModeCheck != newMode) {
- /* Render mode change failed. Bail */
- newMode = newModeCheck;
- goto noChangeAllowed;
- }
-
- /*
- ** Render mode might have still failed if we get here. But in this
- ** case we can't really tell, nor does it matter. If it did fail, it
- ** will return 0, and thus we won't send any data across the wire.
- */
-
- switch (cx->renderMode) {
- case GL_RENDER:
- cx->renderMode = newMode;
- break;
- case GL_FEEDBACK:
- if (retval < 0) {
- /* Overflow happened. Copy the entire buffer */
- nitems = cx->feedbackBufSize;
- } else {
- nitems = retval;
- }
- retBytes = nitems * __GLX_SIZE_FLOAT32;
- retBuffer = (GLubyte*) cx->feedbackBuf;
- cx->renderMode = newMode;
- break;
- case GL_SELECT:
- if (retval < 0) {
- /* Overflow happened. Copy the entire buffer */
- nitems = cx->selectBufSize;
- } else {
- GLuint *bp = cx->selectBuf;
- GLint i;
-
- /*
- ** Figure out how many bytes of data need to be sent. Parse
- ** the selection buffer to determine this fact as the
- ** return value is the number of hits, not the number of
- ** items in the buffer.
- */
- nitems = 0;
- i = retval;
- while (--i >= 0) {
- GLuint n;
-
- /* Parse select data for this hit */
- n = *bp;
- bp += 3 + n;
- }
- nitems = bp - cx->selectBuf;
- }
- retBytes = nitems * __GLX_SIZE_CARD32;
- retBuffer = (GLubyte*) cx->selectBuf;
- cx->renderMode = newMode;
- break;
- }
-
- /*
- ** First reply is the number of elements returned in the feedback or
- ** selection array, as per the API for glRenderMode itself.
- */
- noChangeAllowed:;
- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.retval = retval;
- reply.size = nitems;
- reply.newMode = newMode;
- WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
- if (retBytes) {
- WriteToClient(client, retBytes, (char *)retBuffer);
- }
- return Success;
-}
-
-int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- glFlush();
- __GLX_NOTE_FLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- ClientPtr client;
- int error;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- /* Do a local glFinish */
- glFinish();
- __GLX_NOTE_FLUSHED_CMDS(cx);
-
- /* Send empty reply packet to indicate finish is finished */
- client = cl->client;
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- return Success;
-}
-
-#define SEPARATOR " "
-
-char *__glXcombine_strings(const char *cext_string, const char *sext_string)
-{
- size_t clen, slen;
- char *combo_string, *token, *s1;
- const char *s2, *end;
-
- /* safeguard to prevent potentially fatal errors in the string functions */
- if (!cext_string)
- cext_string = "";
- if (!sext_string)
- sext_string = "";
-
- /*
- ** String can't be longer than min(cstring, sstring)
- ** pull tokens out of shortest string
- ** include space in combo_string for final separator and null terminator
- */
- if ( (clen = __glXStrlen(cext_string)) > (slen = __glXStrlen(sext_string)) ) {
- combo_string = (char *) __glXMalloc(slen + 2);
- s1 = (char *) __glXMalloc(slen + 2); __glXStrcpy(s1, sext_string);
- s2 = cext_string;
- } else {
- combo_string = (char *) __glXMalloc(clen + 2);
- s1 = (char *) __glXMalloc(clen + 2); __glXStrcpy(s1, cext_string);
- s2 = sext_string;
- }
- if (!combo_string || !s1) {
- if (combo_string) __glXFree(combo_string);
- if (s1) __glXFree(s1);
- return NULL;
- }
- combo_string[0] = '\0';
-
- /* Get first extension token */
- token = __glXStrtok( s1, SEPARATOR);
- while ( token != NULL ) {
-
- /*
- ** if token in second string then save it
- ** beware of extension names which are prefixes of other extension names
- */
- const char *p = s2;
- end = p + __glXStrlen(p);
- while (p < end) {
- size_t n = __glXStrcspn(p, SEPARATOR);
- if ((__glXStrlen(token) == n) && (__glXStrncmp(token, p, n) == 0)) {
- combo_string = __glXStrcat( combo_string, token);
- combo_string = __glXStrcat( combo_string, SEPARATOR);
- }
- p += (n + 1);
- }
-
- /* Get next extension token */
- token = __glXStrtok( NULL, SEPARATOR);
- }
- __glXFree(s1);
- return combo_string;
-}
-
-int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client;
- __GLXcontext *cx;
- GLenum name;
- const char *string;
- int error;
- char *buf = NULL, *buf1 = NULL;
- GLint length = 0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- name = *(GLenum *)(pc + 0);
- string = (const char *)glGetString(name);
- client = cl->client;
-
- /*
- ** Restrict extensions to those that are supported by both the
- ** implementation and the connection. That is, return the
- ** intersection of client, server, and core extension strings.
- */
- if (name == GL_EXTENSIONS) {
- buf1 = __glXcombine_strings(string,
- cl->GLClientextensions);
- buf = __glXcombine_strings(buf1,
- cx->pGlxScreen->GLextensions);
- if (buf1 != NULL) {
- __glXFree(buf1);
- }
- string = buf;
- }
- if (string) {
- length = __glXStrlen((const char *) string) + 1;
- }
-
- __GLX_BEGIN_REPLY(length);
- __GLX_PUT_SIZE(length);
- __GLX_SEND_HEADER();
- WriteToClient(client, length, (char *) string);
- if (buf != NULL) {
- __glXFree(buf);
- }
- return Success;
-}
-
-int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answer[4];
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
-
- __glXClearErrorOccured();
- glGetClipPlane(*(GLenum *)(pc + 0), answer);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(32);
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(4);
- }
- return Success;
-}
-
diff --git a/GL/glx/single2swap.c b/GL/glx/single2swap.c
deleted file mode 100644
index 96db415f9..000000000
--- a/GL/glx/single2swap.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxutil.h"
-#include "glxext.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "GL/glx_ansic.h"
-
-int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei size;
- GLenum type;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLXcontext *cx;
- int error;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- size = *(GLsizei *)(pc+0);
- type = *(GLenum *)(pc+4);
- if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
- (size_t) size
- * __GLX_SIZE_FLOAT32);
- if (!cx->feedbackBuf) {
- cl->client->errorValue = size;
- return BadAlloc;
- }
- cx->feedbackBufSize = size;
- }
- glFeedbackBuffer(size, type, cx->feedbackBuf);
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- GLsizei size;
- __GLX_DECLARE_SWAP_VARIABLES;
- int error;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- size = *(GLsizei *)(pc+0);
- if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
- (size_t) size
- * __GLX_SIZE_CARD32);
- if (!cx->selectBuf) {
- cl->client->errorValue = size;
- return BadAlloc;
- }
- cx->selectBufSize = size;
- }
- glSelectBuffer(size, cx->selectBuf);
- __GLX_NOTE_UNFLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client;
- __GLXcontext *cx;
- xGLXRenderModeReply reply;
- GLint nitems=0, retBytes=0, retval, newModeCheck;
- GLubyte *retBuffer = NULL;
- GLenum newMode;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- int error;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc);
- newMode = *(GLenum*) pc;
- retval = glRenderMode(newMode);
-
- /* Check that render mode worked */
- glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
- if (newModeCheck != newMode) {
- /* Render mode change failed. Bail */
- newMode = newModeCheck;
- goto noChangeAllowed;
- }
-
- /*
- ** Render mode might have still failed if we get here. But in this
- ** case we can't really tell, nor does it matter. If it did fail, it
- ** will return 0, and thus we won't send any data across the wire.
- */
-
- switch (cx->renderMode) {
- case GL_RENDER:
- cx->renderMode = newMode;
- break;
- case GL_FEEDBACK:
- if (retval < 0) {
- /* Overflow happened. Copy the entire buffer */
- nitems = cx->feedbackBufSize;
- } else {
- nitems = retval;
- }
- retBytes = nitems * __GLX_SIZE_FLOAT32;
- retBuffer = (GLubyte*) cx->feedbackBuf;
- __GLX_SWAP_FLOAT_ARRAY((GLbyte *)retBuffer, nitems);
- cx->renderMode = newMode;
- break;
- case GL_SELECT:
- if (retval < 0) {
- /* Overflow happened. Copy the entire buffer */
- nitems = cx->selectBufSize;
- } else {
- GLuint *bp = cx->selectBuf;
- GLint i;
-
- /*
- ** Figure out how many bytes of data need to be sent. Parse
- ** the selection buffer to determine this fact as the
- ** return value is the number of hits, not the number of
- ** items in the buffer.
- */
- nitems = 0;
- i = retval;
- while (--i >= 0) {
- GLuint n;
-
- /* Parse select data for this hit */
- n = *bp;
- bp += 3 + n;
- }
- nitems = bp - cx->selectBuf;
- }
- retBytes = nitems * __GLX_SIZE_CARD32;
- retBuffer = (GLubyte*) cx->selectBuf;
- __GLX_SWAP_INT_ARRAY((GLbyte *)retBuffer, nitems);
- cx->renderMode = newMode;
- break;
- }
-
- /*
- ** First reply is the number of elements returned in the feedback or
- ** selection array, as per the API for glRenderMode itself.
- */
- noChangeAllowed:;
- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.retval = retval;
- reply.size = nitems;
- reply.newMode = newMode;
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
- __GLX_SWAP_INT(&reply.retval);
- __GLX_SWAP_INT(&reply.size);
- __GLX_SWAP_INT(&reply.newMode);
- WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
- if (retBytes) {
- WriteToClient(client, retBytes, (char *)retBuffer);
- }
- return Success;
-}
-
-int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- glFlush();
- __GLX_NOTE_FLUSHED_CMDS(cx);
- return Success;
-}
-
-int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- ClientPtr client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- /* Do a local glFinish */
- glFinish();
- __GLX_NOTE_FLUSHED_CMDS(cx);
-
- /* Send empty reply packet to indicate finish is finished */
- client = cl->client;
- __GLX_BEGIN_REPLY(0);
- __GLX_PUT_RETVAL(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
-
- return Success;
-}
-
-int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client;
- __GLXcontext *cx;
- GLenum name;
- const char *string;
- __GLX_DECLARE_SWAP_VARIABLES;
- int error;
- char *buf = NULL, *buf1 = NULL;
- GLint length = 0;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
- name = *(GLenum *)(pc + 0);
- string = (const char *)glGetString(name);
- client = cl->client;
-
- /*
- ** Restrict extensions to those that are supported by both the
- ** implementation and the connection. That is, return the
- ** intersection of client, server, and core extension strings.
- */
- if (name == GL_EXTENSIONS) {
- buf1 = __glXcombine_strings(string,
- cl->GLClientextensions);
- buf = __glXcombine_strings(buf1,
- cx->pGlxScreen->GLextensions);
- if (buf1 != NULL) {
- __glXFree(buf1);
- }
- string = buf;
- }
- if (string) {
- length = __glXStrlen((const char *) string) + 1;
- }
-
- __GLX_BEGIN_REPLY(length);
- __GLX_PUT_SIZE(length);
-
- __GLX_SWAP_REPLY_SIZE();
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- WriteToClient(client, length, (char *) string);
- if (buf != NULL) {
- __glXFree(buf);
- }
-
- return Success;
-}
-
-int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
-{
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLdouble answer[4];
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc + 0);
-
- __glXClearErrorOccured();
- glGetClipPlane(*(GLenum *)(pc + 0), answer);
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- } else {
- __GLX_SWAP_DOUBLE_ARRAY((GLbyte *)answer, 4);
- __GLX_BEGIN_REPLY(32);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_DOUBLE_ARRAY(4);
- }
- return Success;
-}
diff --git a/GL/glx/singlepix.c b/GL/glx/singlepix.c
deleted file mode 100644
index 85be77d85..000000000
--- a/GL/glx/singlepix.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/singlepix.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "singlesize.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei width, height;
- GLenum format, type;
- GLboolean swapBytes, lsbFirst;
- GLint compsize;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- width = *(GLsizei *)(pc + 8);
- height = *(GLsizei *)(pc + 12);
- format = *(GLenum *)(pc + 16);
- type = *(GLenum *)(pc + 20);
- swapBytes = *(GLboolean *)(pc + 24);
- lsbFirst = *(GLboolean *)(pc + 25);
- compsize = __glReadPixels_size(format,type,width,height);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glReadPixels(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12),
- *(GLenum *)(pc + 16),
- *(GLenum *)(pc + 20),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc)
-{
- GLint level, compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0, height=0, depth=1;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- level = *(GLint *)(pc + 4);
- format = *(GLenum *)(pc + 8);
- type = *(GLenum *)(pc + 12);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 16);
-
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
- if ( target == GL_TEXTURE_3D) {
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
- }
- /*
- * The three queries above might fail if we're in a state where queries
- * are illegal, but then width, height, and depth would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetTexImage(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLenum *)(pc + 12),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetTexImageReply *)&__glXReply)->width = width;
- ((xGLXGetTexImageReply *)&__glXReply)->height = height;
- ((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDisp_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean lsbFirst;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLubyte answerBuffer[200];
- char *answer;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- lsbFirst = *(GLboolean *)(pc + 0);
-
- glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
- __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
-
- __glXClearErrorOccured();
- glGetPolygonStipple(
- (GLubyte *) answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(128);
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(128);
- }
- return Success;
-}
-
-int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize, compsize2;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0, height=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
-
- /* target must be SEPARABLE_2D, however I guess we can let the GL
- barf on this one.... */
-
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
- /*
- * The two queries above might fail if we're in a state where queries
- * are illegal, but then width and height would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
-
- if (compsize < 0) compsize = 0;
- if (compsize2 < 0) compsize2 = 0;
- compsize = __GLX_PAD(compsize);
- compsize2 = __GLX_PAD(compsize2);
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
- __glXClearErrorOccured();
- glGetSeparableFilter(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer,
- answer + compsize,
- NULL
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize + compsize2);
- ((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
- ((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize + compsize2);
- }
-
- return Success;
-}
-
-int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0, height=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
-
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
- if (target == GL_CONVOLUTION_1D) {
- height = 1;
- } else {
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
- }
- /*
- * The two queries above might fail if we're in a state where queries
- * are illegal, but then width and height would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetConvolutionFilter(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
- ((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes, reset;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
- reset = *(GLboolean *)(pc + 13);
-
- glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
- /*
- * The one query above might fail if we're in a state where queries
- * are illegal, but then width would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetHistogram( target, reset, format, type, answer);
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetHistogramReply *)&__glXReply)->width = width;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes, reset;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
- reset = *(GLboolean *)(pc + 13);
-
- compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetMinmax( target, reset, format, type, answer);
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- target = *(GLenum *)(pc + 0);
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- swapBytes = *(GLboolean *)(pc + 12);
-
- glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
- /*
- * The one query above might fail if we're in a state where queries
- * are illegal, but then width would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetColorTable(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetColorTableReply *)&__glXReply)->width = width;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
diff --git a/GL/glx/singlepixswap.c b/GL/glx/singlepixswap.c
deleted file mode 100644
index 2b488312e..000000000
--- a/GL/glx/singlepixswap.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/singlepixswap.c,v 1.6 2001/10/31 22:50:27 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxext.h"
-#include "singlesize.h"
-#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
-
-int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
-{
- GLsizei width, height;
- GLenum format, type;
- GLboolean swapBytes, lsbFirst;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
- __GLX_SWAP_INT(pc+12);
- __GLX_SWAP_INT(pc+16);
- __GLX_SWAP_INT(pc+20);
-
- width = *(GLsizei *)(pc + 8);
- height = *(GLsizei *)(pc + 12);
- format = *(GLenum *)(pc + 16);
- type = *(GLenum *)(pc + 20);
- swapBytes = *(GLboolean *)(pc + 24);
- lsbFirst = *(GLboolean *)(pc + 25);
- compsize = __glReadPixels_size(format,type,width,height);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glReadPixels(
- *(GLint *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLsizei *)(pc + 8),
- *(GLsizei *)(pc + 12),
- *(GLenum *)(pc + 16),
- *(GLenum *)(pc + 20),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
-{
- GLint level, compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- char *answer, answerBuffer[200];
- GLint width=0, height=0, depth=1;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
- __GLX_SWAP_INT(pc+12);
-
- level = *(GLint *)(pc + 4);
- format = *(GLenum *)(pc + 8);
- type = *(GLenum *)(pc + 12);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 16);
-
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
- if ( target == GL_TEXTURE_3D) {
- glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
- }
- /*
- * The three queries above might fail if we're in a state where queries
- * are illegal, but then width, height, and depth would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetTexImage(
- *(GLenum *)(pc + 0),
- *(GLint *)(pc + 4),
- *(GLenum *)(pc + 8),
- *(GLenum *)(pc + 12),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SWAP_INT(&width);
- __GLX_SWAP_INT(&height);
- __GLX_SWAP_INT(&depth);
- ((xGLXGetTexImageReply *)&__glXReply)->width = width;
- ((xGLXGetTexImageReply *)&__glXReply)->height = height;
- ((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
- return Success;
-}
-
-int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
-{
- GLboolean lsbFirst;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- GLubyte answerBuffer[200];
- char *answer;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
- pc += __GLX_SINGLE_HDR_SIZE;
- lsbFirst = *(GLboolean *)(pc + 0);
-
- glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
- __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
-
- __glXClearErrorOccured();
- glGetPolygonStipple(
- (GLubyte *) answer
- );
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(128);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_HEADER();
- __GLX_SEND_BYTE_ARRAY(128);
- }
- return Success;
-}
-
-int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize, compsize2;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- char *answer, answerBuffer[200];
- GLint width=0, height=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
-
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
-
- /* target must be SEPARABLE_2D, however I guess we can let the GL
- barf on this one.... */
-
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
- /*
- * The two queries above might fail if we're in a state where queries
- * are illegal, but then width and height would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
-
- if (compsize < 0) compsize = 0;
- if (compsize2 < 0) compsize2 = 0;
- compsize = __GLX_PAD(compsize);
- compsize2 = __GLX_PAD(compsize2);
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
- __glXClearErrorOccured();
- glGetSeparableFilter(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer,
- answer + compsize,
- NULL
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize + compsize2);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SWAP_INT(&width);
- __GLX_SWAP_INT(&height);
- ((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
- ((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
- __GLX_SEND_VOID_ARRAY(compsize + compsize2);
- }
-
- return Success;
-}
-
-int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- char *answer, answerBuffer[200];
- GLint width=0, height=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
-
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
-
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
- if (target == GL_CONVOLUTION_2D) {
- height = 1;
- } else {
- glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
- }
- /*
- * The two queries above might fail if we're in a state where queries
- * are illegal, but then width and height would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetConvolutionFilter(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SWAP_INT(&width);
- __GLX_SWAP_INT(&height);
- ((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
- ((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes, reset;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- char *answer, answerBuffer[200];
- GLint width=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
-
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
- reset = *(GLboolean *)(pc + 13);
-
- glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
- /*
- * The one query above might fail if we're in a state where queries
- * are illegal, but then width would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetHistogram( target, reset, format, type, answer);
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SWAP_INT(&width);
- ((xGLXGetHistogramReply *)&__glXReply)->width = width;
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes, reset;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- char *answer, answerBuffer[200];
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
-
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
- reset = *(GLboolean *)(pc + 13);
-
- compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetMinmax( target, reset, format, type, answer);
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
-
-int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
-{
- GLint compsize;
- GLenum format, type, target;
- GLboolean swapBytes;
- __GLXcontext *cx;
- ClientPtr client = cl->client;
- int error;
- __GLX_DECLARE_SWAP_VARIABLES;
- char *answer, answerBuffer[200];
- GLint width=0;
-
- cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
- if (!cx) {
- return error;
- }
-
- pc += __GLX_SINGLE_HDR_SIZE;
- __GLX_SWAP_INT(pc+0);
- __GLX_SWAP_INT(pc+4);
- __GLX_SWAP_INT(pc+8);
-
- format = *(GLenum *)(pc + 4);
- type = *(GLenum *)(pc + 8);
- target = *(GLenum *)(pc + 0);
- swapBytes = *(GLboolean *)(pc + 12);
-
- glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
- /*
- * The one query above might fail if we're in a state where queries
- * are illegal, but then width would still be zero anyway.
- */
- compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
- if (compsize < 0) compsize = 0;
-
- glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- glGetColorTable(
- *(GLenum *)(pc + 0),
- *(GLenum *)(pc + 4),
- *(GLenum *)(pc + 8),
- answer
- );
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SWAP_REPLY_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- __GLX_SWAP_REPLY_HEADER();
- __GLX_SWAP_INT(&width);
- ((xGLXGetColorTableReply *)&__glXReply)->width = width;
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- return Success;
-}
diff --git a/GL/glx/singlesize.c b/GL/glx/singlesize.c
deleted file mode 100644
index efb13ee94..000000000
--- a/GL/glx/singlesize.c
+++ /dev/null
@@ -1,995 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.c,v 1.6 2003/11/06 18:37:56 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include <GL/gl.h>
-#include "glxserver.h"
-#include "singlesize.h"
-
-/*
-** These routines compute the size of variable-size returned parameters.
-** Unlike the similar routines that do the same thing for variable-size
-** incoming parameters, the samplegl library itself doesn't use these routines.
-** Hence, they are located here, in the GLX extension library.
-*/
-
-GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h)
-{
- return __glXImage3DSize( format, type, w, h, 1, 0, 0, 0, 0, 4 );
-}
-
-GLint __glGetTexEnvfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_ENV_MODE:
- return 1;
- case GL_TEXTURE_ENV_COLOR:
- return 4;
- case GL_TEXTURE_LOD_BIAS_EXT:
- return 1;
- case GL_COMBINE_RGB_ARB:
- case GL_COMBINE_ALPHA_ARB:
- case GL_SOURCE0_RGB_ARB:
- case GL_SOURCE1_RGB_ARB:
- case GL_SOURCE2_RGB_ARB:
- case GL_SOURCE0_ALPHA_ARB:
- case GL_SOURCE1_ALPHA_ARB:
- case GL_SOURCE2_ALPHA_ARB:
- case GL_OPERAND0_RGB_ARB:
- case GL_OPERAND1_RGB_ARB:
- case GL_OPERAND2_RGB_ARB:
- case GL_OPERAND0_ALPHA_ARB:
- case GL_OPERAND1_ALPHA_ARB:
- case GL_OPERAND2_ALPHA_ARB:
- case GL_RGB_SCALE_ARB:
- case GL_ALPHA_SCALE:
- return 1;
- default:
- return -1;
- }
-}
-
-
-GLint __glGetTexEnviv_size(GLenum pname)
-{
- return __glGetTexEnvfv_size(pname);
-}
-
-GLint __glGetTexGenfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_GEN_MODE:
- return 1;
- case GL_OBJECT_PLANE:
- return 4;
- case GL_EYE_PLANE:
- return 4;
- default:
- return -1;
- }
-}
-
-GLint __glGetTexGendv_size(GLenum pname)
-{
- return __glGetTexGenfv_size(pname);
-}
-
-GLint __glGetTexGeniv_size(GLenum pname)
-{
- return __glGetTexGenfv_size(pname);
-}
-
-GLint __glGetTexParameterfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- return 4;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_PRIORITY:
- case GL_TEXTURE_RESIDENT:
-
- /* GL_SGIS_texture_lod / GL_EXT_texture_lod / GL 1.2 */
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
-
- /* GL_SGIX_texture_lod_bias */
- case GL_TEXTURE_LOD_BIAS_S_SGIX:
- case GL_TEXTURE_LOD_BIAS_T_SGIX:
- case GL_TEXTURE_LOD_BIAS_R_SGIX:
-
- /* GL_ARB_shadow / GL 1.4 */
- case GL_TEXTURE_COMPARE_MODE:
- case GL_TEXTURE_COMPARE_FUNC:
-
- /* GL_SGIX_shadow_ambient / GL_ARB_shadow_ambient */
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
-
- /* GL_SGIX_shadow */
- case GL_TEXTURE_COMPARE_SGIX:
- case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
-
- /* GL_SGIX_texture_coordinate_clamp */
- case GL_TEXTURE_MAX_CLAMP_S_SGIX:
- case GL_TEXTURE_MAX_CLAMP_T_SGIX:
- case GL_TEXTURE_MAX_CLAMP_R_SGIX:
- return 1;
-
- default:
- return -1;
- }
-}
-
-GLint __glGetTexParameteriv_size(GLenum pname)
-{
- return __glGetTexParameterfv_size(pname);
-}
-
-GLint __glGetLightfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_AMBIENT:
- return 4;
- case GL_DIFFUSE:
- return 4;
- case GL_SPECULAR:
- return 4;
- case GL_POSITION:
- return 4;
- case GL_SPOT_DIRECTION:
- return 3;
- case GL_SPOT_EXPONENT:
- return 1;
- case GL_SPOT_CUTOFF:
- return 1;
- case GL_CONSTANT_ATTENUATION:
- return 1;
- case GL_LINEAR_ATTENUATION:
- return 1;
- case GL_QUADRATIC_ATTENUATION:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetLightiv_size(GLenum pname)
-{
- return __glGetLightfv_size(pname);
-}
-
-static GLint EvalComputeK(GLenum target)
-{
- switch(target) {
- case GL_MAP1_VERTEX_4:
- case GL_MAP1_COLOR_4:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_4:
- case GL_MAP2_COLOR_4:
- case GL_MAP2_TEXTURE_COORD_4:
- return 4;
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_NORMAL:
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_NORMAL:
- return 3;
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_2:
- return 2;
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP1_INDEX:
- case GL_MAP2_INDEX:
- return 1;
- }
- return 0;
-}
-
-GLint __glGetMap_size(GLenum target, GLenum query)
-{
- GLint k, order=0, majorMinor[2];
-
- /*
- ** Assume target and query are both valid.
- */
- switch (target) {
- case GL_MAP1_COLOR_4:
- case GL_MAP1_NORMAL:
- case GL_MAP1_INDEX:
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_VERTEX_4:
- switch (query) {
- case GL_COEFF:
- k = EvalComputeK(target);
- glGetMapiv(target, GL_ORDER, &order);
- /*
- ** The query above might fail, but then order will be zero anyway.
- */
- return (order * k);
- case GL_DOMAIN:
- return 2;
- case GL_ORDER:
- return 1;
- }
- break;
- case GL_MAP2_COLOR_4:
- case GL_MAP2_NORMAL:
- case GL_MAP2_INDEX:
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_VERTEX_4:
- switch (query) {
- case GL_COEFF:
- k = EvalComputeK(target);
- majorMinor[0] = majorMinor[1] = 0;
- glGetMapiv(target, GL_ORDER, majorMinor);
- /*
- ** The query above might fail, but then majorMinor will be zeroes
- */
- return (majorMinor[0] * majorMinor[1] * k);
- case GL_DOMAIN:
- return 4;
- case GL_ORDER:
- return 2;
- }
- break;
- }
- return -1;
-}
-
-GLint __glGetMapdv_size(GLenum target, GLenum query)
-{
- return __glGetMap_size(target, query);
-}
-
-GLint __glGetMapfv_size(GLenum target, GLenum query)
-{
- return __glGetMap_size(target, query);
-}
-
-GLint __glGetMapiv_size(GLenum target, GLenum query)
-{
- return __glGetMap_size(target, query);
-}
-
-GLint __glGetMaterialfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_SHININESS:
- return 1;
- case GL_COLOR_INDEXES:
- return 3;
- case GL_EMISSION:
- return 4;
- case GL_AMBIENT:
- return 4;
- case GL_DIFFUSE:
- return 4;
- case GL_SPECULAR:
- return 4;
- case GL_AMBIENT_AND_DIFFUSE:
- return 4;
- default:
- return -1;
- }
-}
-
-GLint __glGetMaterialiv_size(GLenum pname)
-{
- return __glGetMaterialfv_size(pname);
-}
-
-GLint __glGetPixelMap_size(GLenum map)
-{
- GLint size;
- GLenum query;
-
- switch (map) {
- case GL_PIXEL_MAP_I_TO_I:
- query = GL_PIXEL_MAP_I_TO_I_SIZE;
- break;
- case GL_PIXEL_MAP_S_TO_S:
- query = GL_PIXEL_MAP_S_TO_S_SIZE;
- break;
- case GL_PIXEL_MAP_I_TO_R:
- query = GL_PIXEL_MAP_I_TO_R_SIZE;
- break;
- case GL_PIXEL_MAP_I_TO_G:
- query = GL_PIXEL_MAP_I_TO_G_SIZE;
- break;
- case GL_PIXEL_MAP_I_TO_B:
- query = GL_PIXEL_MAP_I_TO_B_SIZE;
- break;
- case GL_PIXEL_MAP_I_TO_A:
- query = GL_PIXEL_MAP_I_TO_A_SIZE;
- break;
- case GL_PIXEL_MAP_R_TO_R:
- query = GL_PIXEL_MAP_R_TO_R_SIZE;
- break;
- case GL_PIXEL_MAP_G_TO_G:
- query = GL_PIXEL_MAP_G_TO_G_SIZE;
- break;
- case GL_PIXEL_MAP_B_TO_B:
- query = GL_PIXEL_MAP_B_TO_B_SIZE;
- break;
- case GL_PIXEL_MAP_A_TO_A:
- query = GL_PIXEL_MAP_A_TO_A_SIZE;
- break;
- default:
- return -1;
- }
- glGetIntegerv(query, &size);
- return size;
-}
-
-GLint __glGetPixelMapfv_size(GLenum map)
-{
- return __glGetPixelMap_size(map);
-}
-
-GLint __glGetPixelMapuiv_size(GLenum map)
-{
- return __glGetPixelMap_size(map);
-}
-
-GLint __glGetPixelMapusv_size(GLenum map)
-{
- return __glGetPixelMap_size(map);
-}
-
-/*
-** Return the number of words needed to pass back the requested
-** value.
-*/
-GLint __glGet_size(GLenum sq)
-{
- switch (sq) {
- case GL_MAX_TEXTURE_SIZE:
- return 1;
- case GL_SUBPIXEL_BITS:
- return 1;
- case GL_MAX_LIST_NESTING:
- return 1;
- case GL_MAP1_COLOR_4:
- case GL_MAP1_INDEX:
- case GL_MAP1_NORMAL:
- case GL_MAP1_TEXTURE_COORD_1:
- case GL_MAP1_TEXTURE_COORD_2:
- case GL_MAP1_TEXTURE_COORD_3:
- case GL_MAP1_TEXTURE_COORD_4:
- case GL_MAP1_VERTEX_3:
- case GL_MAP1_VERTEX_4:
- return 1;
- case GL_MAP2_COLOR_4:
- case GL_MAP2_INDEX:
- case GL_MAP2_NORMAL:
- case GL_MAP2_TEXTURE_COORD_1:
- case GL_MAP2_TEXTURE_COORD_2:
- case GL_MAP2_TEXTURE_COORD_3:
- case GL_MAP2_TEXTURE_COORD_4:
- case GL_MAP2_VERTEX_3:
- case GL_MAP2_VERTEX_4:
- return 1;
- case GL_AUTO_NORMAL:
- return 1;
- case GL_CURRENT_COLOR:
- return 4;
- case GL_CURRENT_INDEX:
- return 1;
- case GL_CURRENT_NORMAL:
- return 3;
- case GL_CURRENT_TEXTURE_COORDS:
- return 4;
- case GL_CURRENT_RASTER_INDEX:
- return 1;
- case GL_CURRENT_RASTER_COLOR:
- return 4;
- case GL_CURRENT_RASTER_TEXTURE_COORDS:
- return 4;
- case GL_CURRENT_RASTER_POSITION:
- return 4;
- case GL_CURRENT_RASTER_POSITION_VALID:
- return 1;
- case GL_CURRENT_RASTER_DISTANCE:
- return 1;
- case GL_POINT_SIZE:
- return 1;
- case GL_POINT_SIZE_RANGE:
- /* case GL_SMOOTH_POINT_SIZE_RANGE: */ /* alias */
- return 2;
- case GL_POINT_SIZE_GRANULARITY:
- /* case GL_SMOOTH_POINT_SIZE_GRANULARITY: */ /* alias */
- return 1;
- case GL_ALIASED_POINT_SIZE_RANGE:
- return 2;
- case GL_POINT_SMOOTH:
- return 1;
- case GL_LINE_SMOOTH:
- return 1;
- case GL_LINE_WIDTH:
- return 1;
- case GL_LINE_WIDTH_RANGE:
- /* case GL_SMOOTH_LINE_WIDTH_RANGE: */ /* alias */
- return 2;
- case GL_LINE_WIDTH_GRANULARITY:
- /* case GL_SMOOTH_LINE_WIDTH_GRANULARITY: */ /* alias */
- return 1;
- case GL_ALIASED_LINE_WIDTH_RANGE:
- return 2;
- case GL_LINE_STIPPLE_PATTERN:
- return 1;
- case GL_LINE_STIPPLE_REPEAT:
- return 1;
- case GL_LINE_STIPPLE:
- return 1;
- case GL_POLYGON_MODE:
- return 2;
- case GL_POLYGON_SMOOTH:
- return 1;
- case GL_POLYGON_STIPPLE:
- return 1;
- case GL_EDGE_FLAG:
- return 1;
- case GL_CULL_FACE:
- return 1;
- case GL_CULL_FACE_MODE:
- return 1;
- case GL_FRONT_FACE:
- return 1;
- case GL_LIGHTING:
- return 1;
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- return 1;
- case GL_LIGHT_MODEL_TWO_SIDE:
- return 1;
- case GL_LIGHT_MODEL_AMBIENT:
- return 4;
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- return 1;
- case GL_COLOR_MATERIAL:
- return 1;
- case GL_COLOR_MATERIAL_FACE:
- return 1;
- case GL_COLOR_MATERIAL_PARAMETER:
- return 1;
- case GL_SHADE_MODEL:
- return 1;
- case GL_FOG:
- return 1;
- case GL_FOG_INDEX:
- return 1;
- case GL_FOG_DENSITY:
- return 1;
- case GL_FOG_START:
- return 1;
- case GL_FOG_END:
- return 1;
- case GL_FOG_MODE:
- return 1;
- case GL_FOG_COLOR:
- return 4;
- case GL_DEPTH_RANGE:
- return 2;
- case GL_DEPTH_TEST:
- return 1;
- case GL_DEPTH_WRITEMASK:
- return 1;
- case GL_DEPTH_CLEAR_VALUE:
- return 1;
- case GL_DEPTH_FUNC:
- return 1;
- case GL_ACCUM_CLEAR_VALUE:
- return 4;
- case GL_STENCIL_TEST:
- return 1;
- case GL_STENCIL_CLEAR_VALUE:
- return 1;
- case GL_STENCIL_FUNC:
- return 1;
- case GL_STENCIL_VALUE_MASK:
- return 1;
- case GL_STENCIL_FAIL:
- return 1;
- case GL_STENCIL_PASS_DEPTH_FAIL:
- return 1;
- case GL_STENCIL_PASS_DEPTH_PASS:
- return 1;
- case GL_STENCIL_REF:
- return 1;
- case GL_STENCIL_WRITEMASK:
- return 1;
- case GL_MATRIX_MODE:
- return 1;
- case GL_NORMALIZE:
- return 1;
- case GL_VIEWPORT:
- return 4;
- case GL_ATTRIB_STACK_DEPTH:
- return 1;
- case GL_MODELVIEW_STACK_DEPTH:
- return 1;
- case GL_PROJECTION_STACK_DEPTH:
- return 1;
- case GL_TEXTURE_STACK_DEPTH:
- return 1;
- case GL_MODELVIEW_MATRIX:
- return 16;
- case GL_PROJECTION_MATRIX:
- return 16;
- case GL_TEXTURE_MATRIX:
- return 16;
- case GL_ALPHA_TEST:
- return 1;
- case GL_ALPHA_TEST_FUNC:
- return 1;
- case GL_ALPHA_TEST_REF:
- return 1;
- case GL_DITHER:
- return 1;
- case GL_BLEND_DST:
- return 1;
- case GL_BLEND_SRC:
- return 1;
- case GL_BLEND:
- return 1;
- case GL_LOGIC_OP_MODE:
- return 1;
- case GL_LOGIC_OP:
- return 1;
- case GL_DRAW_BUFFER:
- return 1;
- case GL_READ_BUFFER:
- return 1;
- case GL_SCISSOR_TEST:
- return 1;
- case GL_SCISSOR_BOX:
- return 4;
- case GL_INDEX_CLEAR_VALUE:
- return 1;
- case GL_INDEX_MODE:
- return 1;
- case GL_INDEX_WRITEMASK:
- return 1;
- case GL_COLOR_CLEAR_VALUE:
- return 4;
- case GL_RGBA_MODE:
- return 1;
- case GL_COLOR_WRITEMASK:
- return 4;
- case GL_RENDER_MODE:
- return 1;
- case GL_PERSPECTIVE_CORRECTION_HINT:
- return 1;
- case GL_POINT_SMOOTH_HINT:
- return 1;
- case GL_LINE_SMOOTH_HINT:
- return 1;
- case GL_POLYGON_SMOOTH_HINT:
- return 1;
- case GL_FOG_HINT:
- return 1;
- case GL_LIST_BASE:
- return 1;
- case GL_LIST_INDEX:
- return 1;
- case GL_LIST_MODE:
- return 1;
- case GL_TEXTURE_GEN_S:
- return 1;
- case GL_TEXTURE_GEN_T:
- return 1;
- case GL_TEXTURE_GEN_R:
- return 1;
- case GL_TEXTURE_GEN_Q:
- return 1;
- case GL_PACK_SWAP_BYTES:
- return 1;
- case GL_PACK_LSB_FIRST:
- return 1;
- case GL_PACK_ROW_LENGTH:
- return 1;
- case GL_PACK_IMAGE_HEIGHT:
- return 1;
- case GL_PACK_SKIP_ROWS:
- return 1;
- case GL_PACK_SKIP_PIXELS:
- return 1;
- case GL_PACK_SKIP_IMAGES:
- return 1;
- case GL_PACK_ALIGNMENT:
- return 1;
- case GL_UNPACK_SWAP_BYTES:
- return 1;
- case GL_UNPACK_LSB_FIRST:
- return 1;
- case GL_UNPACK_ROW_LENGTH:
- return 1;
- case GL_UNPACK_IMAGE_HEIGHT:
- return 1;
- case GL_UNPACK_SKIP_ROWS:
- return 1;
- case GL_UNPACK_SKIP_PIXELS:
- return 1;
- case GL_UNPACK_SKIP_IMAGES:
- return 1;
- case GL_UNPACK_ALIGNMENT:
- return 1;
- case GL_MAP_COLOR:
- return 1;
- case GL_MAP_STENCIL:
- return 1;
- case GL_INDEX_SHIFT:
- return 1;
- case GL_INDEX_OFFSET:
- return 1;
- case GL_RED_SCALE:
- case GL_GREEN_SCALE:
- case GL_BLUE_SCALE:
- case GL_ALPHA_SCALE:
- case GL_DEPTH_SCALE:
- return 1;
- case GL_RED_BIAS:
- case GL_GREEN_BIAS:
- case GL_BLUE_BIAS:
- case GL_ALPHA_BIAS:
- case GL_DEPTH_BIAS:
- return 1;
- case GL_ZOOM_X:
- case GL_ZOOM_Y:
- return 1;
- case GL_PIXEL_MAP_I_TO_I_SIZE: case GL_PIXEL_MAP_S_TO_S_SIZE:
- case GL_PIXEL_MAP_I_TO_R_SIZE: case GL_PIXEL_MAP_I_TO_G_SIZE:
- case GL_PIXEL_MAP_I_TO_B_SIZE: case GL_PIXEL_MAP_I_TO_A_SIZE:
- case GL_PIXEL_MAP_R_TO_R_SIZE: case GL_PIXEL_MAP_G_TO_G_SIZE:
- case GL_PIXEL_MAP_B_TO_B_SIZE: case GL_PIXEL_MAP_A_TO_A_SIZE:
- return 1;
- case GL_MAX_EVAL_ORDER:
- return 1;
- case GL_MAX_LIGHTS:
- return 1;
- case GL_MAX_CLIP_PLANES:
- return 1;
- case GL_MAX_PIXEL_MAP_TABLE:
- return 1;
- case GL_MAX_ATTRIB_STACK_DEPTH:
- return 1;
- case GL_MAX_MODELVIEW_STACK_DEPTH:
- return 1;
- case GL_MAX_NAME_STACK_DEPTH:
- return 1;
- case GL_MAX_PROJECTION_STACK_DEPTH:
- return 1;
- case GL_MAX_TEXTURE_STACK_DEPTH:
- return 1;
- case GL_INDEX_BITS:
- return 1;
- case GL_RED_BITS:
- return 1;
- case GL_GREEN_BITS:
- return 1;
- case GL_BLUE_BITS:
- return 1;
- case GL_ALPHA_BITS:
- return 1;
- case GL_DEPTH_BITS:
- return 1;
- case GL_STENCIL_BITS:
- return 1;
- case GL_ACCUM_RED_BITS:
- case GL_ACCUM_GREEN_BITS:
- case GL_ACCUM_BLUE_BITS:
- case GL_ACCUM_ALPHA_BITS:
- return 1;
- case GL_MAP1_GRID_DOMAIN:
- return 2;
- case GL_MAP1_GRID_SEGMENTS:
- return 1;
- case GL_MAP2_GRID_DOMAIN:
- return 4;
- case GL_MAP2_GRID_SEGMENTS:
- return 2;
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- return 1;
- case GL_NAME_STACK_DEPTH:
- return 1;
- case GL_MAX_VIEWPORT_DIMS:
- return 2;
- case GL_DOUBLEBUFFER:
- return 1;
- case GL_AUX_BUFFERS:
- return 1;
- case GL_STEREO:
- return 1;
- case GL_CLIP_PLANE0: case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2: case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4: case GL_CLIP_PLANE5:
- return 1;
- case GL_LIGHT0: case GL_LIGHT1:
- case GL_LIGHT2: case GL_LIGHT3:
- case GL_LIGHT4: case GL_LIGHT5:
- case GL_LIGHT6: case GL_LIGHT7:
- return 1;
- case GL_VERTEX_ARRAY:
- case GL_VERTEX_ARRAY_SIZE:
- case GL_VERTEX_ARRAY_TYPE:
- case GL_VERTEX_ARRAY_STRIDE:
- case GL_NORMAL_ARRAY:
- case GL_NORMAL_ARRAY_TYPE:
- case GL_NORMAL_ARRAY_STRIDE:
- case GL_COLOR_ARRAY:
- case GL_COLOR_ARRAY_SIZE:
- case GL_COLOR_ARRAY_TYPE:
- case GL_COLOR_ARRAY_STRIDE:
- case GL_INDEX_ARRAY:
- case GL_INDEX_ARRAY_TYPE:
- case GL_INDEX_ARRAY_STRIDE:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- case GL_EDGE_FLAG_ARRAY:
- case GL_EDGE_FLAG_ARRAY_STRIDE:
- return 1;
- case GL_TEXTURE_BINDING_1D:
- case GL_TEXTURE_BINDING_2D:
- case GL_TEXTURE_BINDING_3D:
- return 1;
- case GL_BLEND_COLOR:
- return 4;
- case GL_BLEND_EQUATION:
- return 1;
- case GL_COLOR_MATRIX:
- return 16;
- case GL_COLOR_MATRIX_STACK_DEPTH:
- return 1;
- case GL_COLOR_TABLE:
- case GL_POST_CONVOLUTION_COLOR_TABLE:
- case GL_POST_COLOR_MATRIX_COLOR_TABLE:
- case GL_CONVOLUTION_1D:
- case GL_CONVOLUTION_2D:
- case GL_SEPARABLE_2D:
- case GL_HISTOGRAM:
- case GL_MINMAX:
- return 1;
- case GL_POLYGON_OFFSET_FACTOR:
- case GL_POLYGON_OFFSET_UNITS:
- return 1;
- case GL_POST_CONVOLUTION_RED_SCALE:
- case GL_POST_CONVOLUTION_GREEN_SCALE:
- case GL_POST_CONVOLUTION_BLUE_SCALE:
- case GL_POST_CONVOLUTION_ALPHA_SCALE:
- case GL_POST_CONVOLUTION_RED_BIAS:
- case GL_POST_CONVOLUTION_GREEN_BIAS:
- case GL_POST_CONVOLUTION_BLUE_BIAS:
- case GL_POST_CONVOLUTION_ALPHA_BIAS:
- return 1;
- case GL_POST_COLOR_MATRIX_RED_SCALE:
- case GL_POST_COLOR_MATRIX_GREEN_SCALE:
- case GL_POST_COLOR_MATRIX_BLUE_SCALE:
- case GL_POST_COLOR_MATRIX_ALPHA_SCALE:
- case GL_POST_COLOR_MATRIX_RED_BIAS:
- case GL_POST_COLOR_MATRIX_GREEN_BIAS:
- case GL_POST_COLOR_MATRIX_BLUE_BIAS:
- case GL_POST_COLOR_MATRIX_ALPHA_BIAS:
- return 1;
- case GL_RESCALE_NORMAL:
- return 1;
- case GL_MAX_ELEMENTS_INDICES:
- case GL_MAX_ELEMENTS_VERTICES:
- return 1;
- case GL_ACTIVE_TEXTURE_ARB:
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- case GL_MAX_TEXTURE_UNITS_ARB:
- return 1;
- case GL_MAX_COLOR_MATRIX_STACK_DEPTH:
- case GL_MAX_CONVOLUTION_WIDTH:
- case GL_MAX_CONVOLUTION_HEIGHT:
- return 1;
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- return 1;
- case GL_OCCLUSION_TEST_RESULT_HP:
- case GL_OCCLUSION_TEST_HP:
- return 1;
- case GL_PACK_INVERT_MESA:
- return 1;
- case GL_CULL_VERTEX_IBM:
- return 1;
- case GL_RASTER_POSITION_UNCLIPPED_IBM:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetDoublev_size(GLenum sq)
-{
- return __glGet_size(sq);
-}
-
-GLint __glGetFloatv_size(GLenum sq)
-{
- return __glGet_size(sq);
-}
-
-GLint __glGetIntegerv_size(GLenum sq)
-{
- return __glGet_size(sq);
-}
-
-GLint __glGetBooleanv_size(GLenum sq)
-{
- return __glGet_size(sq);
-}
-
-GLint __glGetTexLevelParameterfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_WIDTH:
- case GL_TEXTURE_HEIGHT:
- case GL_TEXTURE_DEPTH:
- case GL_TEXTURE_COMPONENTS:
- case GL_TEXTURE_BORDER:
- case GL_TEXTURE_RED_SIZE:
- case GL_TEXTURE_GREEN_SIZE:
- case GL_TEXTURE_BLUE_SIZE:
- case GL_TEXTURE_ALPHA_SIZE:
- case GL_TEXTURE_LUMINANCE_SIZE:
- case GL_TEXTURE_INTENSITY_SIZE:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetTexLevelParameteriv_size(GLenum pname)
-{
- return __glGetTexLevelParameterfv_size(pname);
-}
-
-GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
- GLenum type, GLint width, GLint height, GLint depth)
-{
- return __glXImage3DSize( format, type, width, height, depth,
- 0, 0, 0, 0, 4 );
-}
-
-GLint __glGetConvolutionParameteriv_size(GLenum pname)
-{
- switch (pname) {
- case GL_CONVOLUTION_BORDER_COLOR:
- case GL_CONVOLUTION_FILTER_SCALE:
- case GL_CONVOLUTION_FILTER_BIAS:
- return 4;
- case GL_CONVOLUTION_BORDER_MODE:
- case GL_CONVOLUTION_FORMAT:
- case GL_CONVOLUTION_WIDTH:
- case GL_CONVOLUTION_HEIGHT:
- case GL_MAX_CONVOLUTION_WIDTH:
- case GL_MAX_CONVOLUTION_HEIGHT:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetConvolutionParameterfv_size(GLenum pname)
-{
- return __glGetConvolutionParameteriv_size(pname);
-}
-
-
-GLint __glGetHistogramParameterfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_HISTOGRAM_WIDTH:
- case GL_HISTOGRAM_FORMAT:
- case GL_HISTOGRAM_RED_SIZE:
- case GL_HISTOGRAM_GREEN_SIZE:
- case GL_HISTOGRAM_BLUE_SIZE:
- case GL_HISTOGRAM_ALPHA_SIZE:
- case GL_HISTOGRAM_LUMINANCE_SIZE:
- case GL_HISTOGRAM_SINK:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetHistogramParameteriv_size(GLenum pname)
-{
- return __glGetHistogramParameterfv_size(pname);
-}
-
-GLint __glGetMinmaxParameterfv_size(GLenum pname)
-{
- switch (pname) {
- case GL_MINMAX_FORMAT:
- case GL_MINMAX_SINK:
- return 1;
- default:
- return -1;
- }
-}
-
-GLint __glGetMinmaxParameteriv_size(GLenum pname)
-{
- return __glGetMinmaxParameterfv_size(pname);
-}
-
-GLint __glGetColorTableParameterfv_size(GLenum pname)
-{
- switch(pname) {
-
- case GL_COLOR_TABLE_SCALE: /* return RGBA */
- case GL_COLOR_TABLE_BIAS:
- return 4;
- case GL_COLOR_TABLE_FORMAT:
- case GL_COLOR_TABLE_WIDTH:
- case GL_COLOR_TABLE_RED_SIZE:
- case GL_COLOR_TABLE_GREEN_SIZE:
- case GL_COLOR_TABLE_BLUE_SIZE:
- case GL_COLOR_TABLE_ALPHA_SIZE:
- case GL_COLOR_TABLE_LUMINANCE_SIZE:
- case GL_COLOR_TABLE_INTENSITY_SIZE:
- return 1;
- default:
- return 0;
- }
-}
-
-GLint __glGetColorTableParameteriv_size(GLenum pname)
-{
- return __glGetColorTableParameterfv_size(pname);
-}
-
diff --git a/GL/glx/singlesize.h b/GL/glx/singlesize.h
deleted file mode 100644
index 829338094..000000000
--- a/GL/glx/singlesize.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
-#ifndef _singlesize_h_
-#define _singlesize_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-extern GLint __glReadPixels_size(GLenum format, GLenum type,
- GLint width, GLint height);
-extern GLint __glGetTexEnvfv_size(GLenum pname);
-extern GLint __glGetTexEnviv_size(GLenum pname);
-extern GLint __glGetTexGenfv_size(GLenum pname);
-extern GLint __glGetTexGendv_size(GLenum pname);
-extern GLint __glGetTexGeniv_size(GLenum pname);
-extern GLint __glGetTexParameterfv_size(GLenum pname);
-extern GLint __glGetTexParameteriv_size(GLenum pname);
-extern GLint __glGetLightfv_size(GLenum pname);
-extern GLint __glGetLightiv_size(GLenum pname);
-extern GLint __glGetMap_size(GLenum pname, GLenum query);
-extern GLint __glGetMapdv_size(GLenum target, GLenum query);
-extern GLint __glGetMapfv_size(GLenum target, GLenum query);
-extern GLint __glGetMapiv_size(GLenum target, GLenum query);
-extern GLint __glGetMaterialfv_size(GLenum pname);
-extern GLint __glGetMaterialiv_size(GLenum pname);
-extern GLint __glGetPixelMap_size(GLenum map);
-extern GLint __glGetPixelMapfv_size(GLenum map);
-extern GLint __glGetPixelMapuiv_size(GLenum map);
-extern GLint __glGetPixelMapusv_size(GLenum map);
-extern GLint __glGet_size(GLenum sq);
-extern GLint __glGetDoublev_size(GLenum sq);
-extern GLint __glGetFloatv_size(GLenum sq);
-extern GLint __glGetIntegerv_size(GLenum sq);
-extern GLint __glGetBooleanv_size(GLenum sq);
-extern GLint __glGetTexLevelParameterfv_size(GLenum pname);
-extern GLint __glGetTexLevelParameteriv_size(GLenum pname);
-extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
- GLenum type, GLint width, GLint height,
- GLint depth);
-extern GLint __glGetColorTableParameterfv_size(GLenum pname);
-extern GLint __glGetColorTableParameteriv_size(GLenum pname);
-extern GLint __glGetConvolutionParameterfv_size(GLenum pname);
-extern GLint __glGetConvolutionParameteriv_size(GLenum pname);
-extern GLint __glGetHistogramParameterfv_size(GLenum pname);
-extern GLint __glGetHistogramParameteriv_size(GLenum pname);
-extern GLint __glGetMinmaxParameterfv_size(GLenum pname);
-extern GLint __glGetMinmaxParameteriv_size(GLenum pname);
-
-#endif /* _singlesize_h_ */
-
diff --git a/GL/glx/unpack.h b/GL/glx/unpack.h
deleted file mode 100644
index 62fc43761..000000000
--- a/GL/glx/unpack.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/unpack.h,v 1.5 2002/10/30 12:52:03 alanh Exp $ */
-#ifndef __GLX_unpack_h__
-#define __GLX_unpack_h__
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
-
-/*
-** Fetch the context-id out of a SingleReq request pointed to by pc.
-*/
-#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
-#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
-
-/*
-** Fetch a double from potentially unaligned memory.
-*/
-#ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n) if (src && dst) memcpy(dst,src,n)
-#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
-#else
-#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
-#endif
-
-extern void __glXMemInit(void);
-
-extern xGLXSingleReply __glXReply;
-
-#define __GLX_BEGIN_REPLY(size) \
- __glXReply.length = __GLX_PAD(size) >> 2; \
- __glXReply.type = X_Reply; \
- __glXReply.sequenceNumber = client->sequence;
-
-#define __GLX_SEND_HEADER() \
- WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
-
-#define __GLX_PUT_RETVAL(a) \
- __glXReply.retval = (a);
-
-#define __GLX_PUT_SIZE(a) \
- __glXReply.size = (a);
-
-#define __GLX_PUT_RENDERMODE(m) \
- __glXReply.pad3 = (m)
-
-/*
-** Get a buffer to hold returned data, with the given alignment. If we have
-** to realloc, allocate size+align, in case the pointer has to be bumped for
-** alignment. The answerBuffer should already be aligned.
-**
-** NOTE: the cast (long)res below assumes a long is large enough to hold a
-** pointer.
-*/
-#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
- if ((size) > sizeof(answerBuffer)) { \
- int bump; \
- if ((cl)->returnBufSize < (size)+(align)) { \
- (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
- (size)+(align)); \
- if (!(cl)->returnBuf) { \
- return BadAlloc; \
- } \
- (cl)->returnBufSize = (size)+(align); \
- } \
- res = (char*)cl->returnBuf; \
- bump = (long)(res) % (align); \
- if (bump) res += (align) - (bump); \
- } else { \
- res = (char *)answerBuffer; \
- }
-
-#define __GLX_PUT_BYTE() \
- *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
-
-#define __GLX_PUT_SHORT() \
- *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
-
-#define __GLX_PUT_INT() \
- *(GLint *)&__glXReply.pad3 = *(GLint *)answer
-
-#define __GLX_PUT_FLOAT() \
- *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
-
-#define __GLX_PUT_DOUBLE() \
- *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
-
-#define __GLX_SEND_BYTE_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
-
-#define __GLX_SEND_SHORT_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
-
-#define __GLX_SEND_INT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
-
-#define __GLX_SEND_FLOAT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
-
-#define __GLX_SEND_DOUBLE_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
-
-
-#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
-#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
-#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
-#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
-
-/*
-** PERFORMANCE NOTE:
-** Machine dependent optimizations abound here; these swapping macros can
-** conceivably be replaced with routines that do the job faster.
-*/
-#define __GLX_DECLARE_SWAP_VARIABLES \
- GLbyte sw
-
-#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
- GLbyte *swapPC; \
- GLbyte *swapEnd
-
-
-#define __GLX_SWAP_INT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
-
-#define __GLX_SWAP_SHORT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = sw;
-
-#define __GLX_SWAP_DOUBLE(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
- ((GLbyte *)(pc))[7] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
- ((GLbyte *)(pc))[6] = sw; \
- sw = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
- ((GLbyte *)(pc))[5] = sw; \
- sw = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
- ((GLbyte *)(pc))[4] = sw;
-
-#define __GLX_SWAP_FLOAT(pc) \
- sw = ((GLbyte *)(pc))[0]; \
- ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
- ((GLbyte *)(pc))[3] = sw; \
- sw = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
-
-#define __GLX_SWAP_INT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_INT(swapPC); \
- swapPC += __GLX_SIZE_INT32; \
- }
-
-#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_SHORT(swapPC); \
- swapPC += __GLX_SIZE_INT16; \
- }
-
-#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_DOUBLE(swapPC); \
- swapPC += __GLX_SIZE_FLOAT64; \
- }
-
-#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
- swapPC = ((GLbyte *)(pc)); \
- swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
- while (swapPC < swapEnd) { \
- __GLX_SWAP_FLOAT(swapPC); \
- swapPC += __GLX_SIZE_FLOAT32; \
- }
-
-#define __GLX_SWAP_REPLY_HEADER() \
- __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
- __GLX_SWAP_INT(&__glXReply.length);
-
-#define __GLX_SWAP_REPLY_RETVAL() \
- __GLX_SWAP_INT(&__glXReply.retval)
-
-#define __GLX_SWAP_REPLY_SIZE() \
- __GLX_SWAP_INT(&__glXReply.size)
-
-#endif /* !__GLX_unpack_h__ */
-
-
-
-
-
diff --git a/GL/glx/xfont.c b/GL/glx/xfont.c
deleted file mode 100644
index 3ea767d2b..000000000
--- a/GL/glx/xfont.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/xfont.c,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#define NEED_REPLIES
-#include "glxserver.h"
-#include "glxutil.h"
-#include "g_disptab.h"
-#include <unpack.h>
-#include <GL/gl.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include <dixfontstr.h>
-
-extern XID clientErrorValue; /* imported kludge from dix layer */
-
-/*
-** Make a single GL bitmap from a single X glyph
-*/
-static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
-{
- int i, j;
- int widthPadded; /* width of glyph in bytes, as padded by X */
- int allocBytes; /* bytes to allocate to store bitmap */
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- register unsigned char *pglyph;
- register unsigned char *p;
- unsigned char *allocbuf;
-#define __GL_CHAR_BUF_SIZE 2048
- unsigned char buf[__GL_CHAR_BUF_SIZE];
-
- w = GLYPHWIDTHPIXELS(pci);
- h = GLYPHHEIGHTPIXELS(pci);
- widthPadded = GLYPHWIDTHBYTESPADDED(pci);
-
- /*
- ** Use the local buf if possible, otherwise malloc.
- */
- allocBytes = widthPadded * h;
- if (allocBytes <= __GL_CHAR_BUF_SIZE) {
- p = buf;
- allocbuf = 0;
- } else {
- p = (unsigned char *) __glXMalloc(allocBytes);
- if (!p)
- return BadAlloc;
- allocbuf = p;
- }
-
- /*
- ** We have to reverse the picture, top to bottom
- */
-
- pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
- for (j=0; j < h; j++) {
- for (i=0; i < widthPadded; i++) {
- p[i] = pglyph[i];
- }
- pglyph -= widthPadded;
- p += widthPadded;
- }
- glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
- pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
-
- if (allocbuf) {
- __glXFree(allocbuf);
- }
- return Success;
-#undef __GL_CHAR_BUF_SIZE
-}
-
-/*
-** Create a GL bitmap for each character in the X font. The bitmap is stored
-** in a display list.
-*/
-
-static int
-MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
-{
- unsigned long i, nglyphs;
- CARD8 chs[2]; /* the font index we are going after */
- CharInfoPtr pci;
- int rv; /* return value */
- int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
- glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
- for (i=0; i < count; i++) {
- chs[0] = (first + i) >> 8; /* high byte is first byte */
- chs[1] = first + i;
-
- (*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
- &nglyphs, &pci);
-
- /*
- ** Define a display list containing just a glBitmap() call.
- */
- glNewList(list_base + i, GL_COMPILE);
- if (nglyphs ) {
- rv = __glXMakeBitmapFromGlyph(pFont, pci);
- if (rv) {
- return rv;
- }
- }
- glEndList();
- }
- return Success;
-}
-
-/************************************************************************/
-
-int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXUseXFontReq *req;
- FontPtr pFont;
- GC *pGC;
- GLuint currentListIndex;
- __GLXcontext *cx;
- int error;
-
- req = (xGLXUseXFontReq *) pc;
- cx = __glXForceCurrent(cl, req->contextTag, &error);
- if (!cx) {
- return error;
- }
-
- glGetIntegerv(GL_LIST_INDEX, (GLint*) &currentListIndex);
- if (currentListIndex != 0) {
- /*
- ** A display list is currently being made. It is an error
- ** to try to make a font during another lists construction.
- */
- client->errorValue = cx->id;
- return __glXBadContextState;
- }
-
- /*
- ** Font can actually be either the ID of a font or the ID of a GC
- ** containing a font.
- */
- pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
- if (!pFont) {
- pGC = (GC *)LookupIDByType(req->font, RT_GC);
- if (!pGC) {
- client->errorValue = req->font;
- return BadFont;
- }
- pFont = pGC->font;
- }
-
- return MakeBitmapsFromFont(pFont, req->first, req->count,
- req->listBase);
-}
diff --git a/GL/include/GL/glx_ansic.h b/GL/include/GL/glx_ansic.h
deleted file mode 100644
index c50288055..000000000
--- a/GL/include/GL/glx_ansic.h
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef _glx_ansic_h_
-#define _glx_ansic_h_
-
-/* $XFree86: xc/programs/Xserver/GL/include/GL/glx_ansic.h,v 1.7 2002/04/04 14:05:36 eich Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/*
-** this needs to check whether we're using XFree86 at all, and then
-** which version we're using. Use these macros if version is 3.9+, else
-** use normal commands below.
-*/
-
-/*
-** turns out this include file only exists for XFree86 3.9+
-** I notice that not having it is not an error and does not stop the build,
-** but having it will allow opengl and glx to be built for 3.9+. We no longer
-** need an explicit define in the Makefile, just point to the correct X source
-** tree and all should be taken care of.
-*/
-
-#ifdef XFree86Server
-
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
-#ifndef assert
-#define assert(a)
-#endif
-
-#else
-
-#if defined(Lynx) && defined(__assert_h)
-#undef __assert_h
-#endif
-#ifdef assert
-#undef assert
-#endif
-#include <assert.h>
-
-#endif
-
-
-#define GLX_STDOUT stdout
-#define GLX_STDERR stderr
-#define __glXPrintf printf
-#define __glXFprintf fprintf
-#define __glXSprintf sprintf
-#define __glXVfprintf vfprintf
-#define __glXVsprintf vsprintf
-#define __glXFopen fopen
-#define __glXFclose fclose
-#define __glXCos(x) cos(x)
-#define __glXSin(x) sin(x)
-#define __glXAtan(x) atan(x)
-#define __glXAbs(x) abs(x)
-#define __glXLog(x) log(x)
-#define __glXCeil(x) ceil(x)
-#define __glXFloor(x) floor(x)
-#define __glXSqrt(x) sqrt(x)
-#define __glXPow(x, y) pow(x, y)
-#define __glXMemmove(dest, src, n) memmove(dest, src, n)
-#define __glXMemcpy(dest, src, n) memcpy(dest, src, n)
-#define __glXMemset(s, c, n) memset(s, c, n)
-#define __glXStrdup(str) xstrdup(str)
-#define __glXStrcpy(dest, src) strcpy(dest, src)
-#define __glXStrncpy(dest, src, n) strncpy(dest, src, n)
-#define __glXStrcat(dest, src) strcat(dest, src)
-#define __glXStrncat(dest, src, n) strncat(dest, src, n)
-#define __glXStrcmp(s1, s2) strcmp(s1, s2)
-#define __glXStrncmp(s1, s2, n) strncmp(s1, s2, n)
-#define __glXStrlen(str) strlen(str)
-#define __glXAbort() abort()
-#define __glXStrtok(s, delim) strtok(s, delim)
-#define __glXStrcspn(s, reject) strcspn(s, reject)
-#define __glXGetenv(a) getenv(a)
-#define __glXAtoi(a) atoi(a)
-
-#endif /* _glx_ansic_h_ */
-
diff --git a/GL/include/GL/xf86glx.h b/GL/include/GL/xf86glx.h
deleted file mode 100644
index 7a467b9b5..000000000
--- a/GL/include/GL/xf86glx.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/include/GL/xf86glx.h,v 1.4 2000/02/23 04:46:54 martin Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#include "miscstruct.h"
-
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
diff --git a/XTrap/xtrapddmi.c b/XTrap/xtrapddmi.c
deleted file mode 100644
index 170726bff..000000000
--- a/XTrap/xtrapddmi.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* $XFree86: xc/programs/Xserver/XTrap/xtrapddmi.c,v 1.2 2002/01/23 03:31:39 dawes Exp $ */
-/*****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*****************************************************************************/
-/*
- * ABSTRACT:
- *
- * This module is the platform-specific but conditionally independent
- * code for the XTrap extension (usually I/O or platform setup).
- * This is shared code and is subject to change only by team approval.
- *
- * CONTRIBUTORS:
- *
- * Dick Annicchiarico
- * Robert Chesler
- * Gene Durso
- * Marc Evans
- * Alan Jamison
- * Mark Henry
- * Ken Miller
- *
- */
-
-#ifndef EXTMODULE
-#include <errno.h>
-#include <X11/Xos.h>
-#ifdef PC
-# include "fcntl.h"
-# include "io.h"
-# define O_NDELAY 0L
-#endif
-#else
-#include "xf86_ansic.h"
-#endif
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <X11/X.h> /* From library include environment */
-#include "input.h" /* From server include env. (must be before Xlib.h!) */
-#ifdef PC
-# include "scrintst.h" /* Screen struct */
-# include "extnsist.h"
-#else
-# include "extnsionst.h" /* Server ExtensionEntry definitions */
-# include "scrnintstr.h" /* Screen struct */
-#endif
-
-#include <X11/extensions/xtrapdi.h>
-#include <X11/extensions/xtrapddmi.h>
-#include <X11/extensions/xtrapproto.h>
-
-extern int XETrapErrorBase;
-extern xXTrapGetAvailReply XETrap_avail;
-extern DevicePtr XETrapKbdDev;
-extern DevicePtr XETrapPtrDev;
-
-/*
- * DESCRIPTION:
- *
- * This function performs the platform specific setup for server
- * extension implementations.
- */
-void XETrapPlatformSetup()
-{
-}
-
-
-#if !defined _XINPUT
-/*
- * DESCRIPTION:
- *
- * This routine processes the simulation of some input event.
- *
- */
-int XETrapSimulateXEvent(register xXTrapInputReq *request,
- register ClientPtr client)
-{
- ScreenPtr pScr = NULL;
- int status = Success;
- xEvent xev;
- register int x = request->input.x;
- register int y = request->input.y;
- DevicePtr keydev = LookupKeyboardDevice();
- DevicePtr ptrdev = LookupPointerDevice();
-
- if (request->input.screen < screenInfo.numScreens)
- {
- pScr = screenInfo.screens[request->input.screen];
- }
- else
- { /* Trying to play bogus events to this WS! */
-#ifdef VERBOSE
- ErrorF("%s: Trying to send events to screen %d!\n", XTrapExtName,
- request->input.screen);
-#endif
- status = XETrapErrorBase + BadScreen;
- }
- /* Fill in the event structure with the information
- * Note: root, event, child, eventX, eventY, state, and sameScreen
- * are all updated by FixUpEventFromWindow() when the events
- * are delivered via DeliverDeviceEvents() or whatever. XTrap
- * needs to only concern itself with type, detail, time, rootX,
- * and rootY.
- */
- if (status == Success)
- {
- xev.u.u.type = request->input.type;
- xev.u.u.detail = request->input.detail;
- xev.u.keyButtonPointer.time = GetTimeInMillis();
- xev.u.keyButtonPointer.rootX = x;
- xev.u.keyButtonPointer.rootY = y;
-
- if (request->input.type == MotionNotify)
- { /* Set new cursor position on screen */
- XETrap_avail.data.cur_x = x;
- XETrap_avail.data.cur_y = y;
- NewCurrentScreen (pScr, x, y); /* fix from amnonc@mercury.co.il */
- if (!(*pScr->SetCursorPosition)(pScr, x, y, xFalse))
- {
- status = BadImplementation;
- }
- }
- }
- if (status == Success)
- {
- switch(request->input.type)
- { /* Now process the event appropriately */
- case KeyPress:
- case KeyRelease:
- (*XETrapKbdDev->realInputProc)(&xev,(DeviceIntPtr)keydev, 1L);
- break;
- case MotionNotify:
- case ButtonPress:
- case ButtonRelease:
- (*XETrapPtrDev->realInputProc)(&xev,(DeviceIntPtr)ptrdev, 1L);
- break;
- default:
- status = BadValue;
- break;
- }
- }
- return(status);
-}
-#endif /* _XINPUT */
-
-#if defined vms && !defined LINKED_IN
-/* Used by swapping code not visible from VMS (from main.c) */
-#ifndef BLADE
-void
-NotImplemented()
-{
- FatalError("Not implemented");
-}
-#endif
-
-int
-#ifdef __STDC__
-ProcBadRequest( ClientPtr client)
-#else
-ProcBadRequest(client)
- ClientPtr client;
-#endif
-{
- return (BadRequest);
-}
-
-#endif /* vms && ! LINKED_IN */
diff --git a/XTrap/xtrapdi.c b/XTrap/xtrapdi.c
deleted file mode 100644
index d09b2120a..000000000
--- a/XTrap/xtrapdi.c
+++ /dev/null
@@ -1,2152 +0,0 @@
-/* $XFree86: xc/programs/Xserver/XTrap/xtrapdi.c,v 1.7 2003/10/28 22:52:10 tsi Exp $ */
-/*****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA
-X11R6 Changes Copyright (c) 1994 by Robert Chesler of Absol-Puter, Hudson, NH.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL AND ABSOL-PUTER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL DIGITAL OR ABSOL-PUTER BE LIABLE FOR ANY
-SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-*****************************************************************************/
-/*
- * ABSTRACT:
- *
- * This module is the main module for extension initialization and setup.
- * It is called by the server and by clients using the extension.
- * This is shared code and is subject to change only by team approval.
- *
- * CONTRIBUTORS:
- *
- * Dick Annicchiarico
- * Robert Chesler
- * Gene Durso
- * Marc Evans
- * Alan Jamison
- * Mark Henry
- * Ken Miller
- *
- * CHANGES:
- *
- * Robert Chesler - grab-impreviousness patch to improve grab behavior
- * Robert Chesler - add client arg to swapping routines for X11R6 port
- *
- */
-
-/*-----------------*
- * Include Files *
- *-----------------*/
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#ifndef EXTMODULE
-#include <stdio.h>
-#include <errno.h>
-#include <X11/Xos.h>
-#else
-#include "xf86_ansic.h"
-#endif
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "input.h" /* Server DevicePtr definitions */
-#include "misc.h" /* Server swapping macros */
-#include "dixstruct.h" /* Server ClientRec definitions */
-#include "resource.h" /* Used with the MakeAtom call */
-#ifdef PC
-# include "scrintst.h" /* Screen struct */
-# include "extnsist.h"
-#else
-# include "extnsionst.h" /* Server ExtensionEntry definitions */
-# include "scrnintstr.h" /* Screen struct */
-#endif
-#include "pixmapstr.h" /* DrawableRec */
-#include "windowstr.h" /* Drawable Lookup structures */
-#include <X11/extensions/xtrapdi.h>
-#include <X11/extensions/xtrapddmi.h>
-#include <X11/extensions/xtrapproto.h>
-#include "colormapst.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#include "cursor.h"
-#endif
-
-
-/*----------------------------*
- * Global Data Declarations *
- *----------------------------*/
-
-DevicePtr XETrapKbdDev = NULL;
-DevicePtr XETrapPtrDev = NULL;
-int XETrapErrorBase = 0L;
-xXTrapGetAvailReply XETrap_avail; /* What's available to clients */
-
-globalref int_function XETrapDispatchVector[10L]; /* Vector of XTrap Rtns */
-globalref int_function XETSwDispatchVector[10L]; /* Swapped XTrap Rtns */
-
-globalref int_function XETrapProcVector[256L]; /* The "shadowed" ProcVector */
- /* The "real" EventVector (XTrap creates it till events
- * truly become vectored
- */
-#ifndef VECTORED_EVENTS
-globalref int_function EventProcVector[XETrapCoreEvents];
-#else
-extern WindowPtr GetCurrentRootWindow();
-globalref int_function EventProcVector[128L];
-#endif
-static int_function keybd_process_inp = NULL; /* Used for VECTORED_EVENTS */
- /* The "shadowed" Event Vector */
-globalref int_function XETrapEventProcVector[XETrapCoreEvents];
-
-globalref void_function XETSwProcVector[256L];/* Vector of Req swapping rtns */
-
-/* This macro returns a true/false indicator based on whether it changes the
- * environment state bits local to the server extension. This is based on the
- * idea that if a valid flag is set and the corresponding data bit is not in
- * the same state as desired, then true is returned, otherwise false is
- * returned.
- */
-#define _CheckChangeBit(valid,data,local,bit) \
- (BitIsFalse(valid,bit) ? 0L : \
- (((BitIsTrue(data,bit) && BitIsTrue(local,bit)) || \
- (BitIsFalse(data,bit) && BitIsFalse(local,bit))) ? 0L : \
- (BitToggle(local,bit), 1L)))
-
-/* This macro is designed to return the number of elements in an
- * automatically allocated array.
- */
-#ifndef ASIZE
-#define ASIZE(array) (sizeof(array)/sizeof(array[0L]))
-#endif
-
-/* This macro is designed to return the number of long words beyond
- * XETrapMinRepSize contained in a data structure.
- */
-#ifndef XEXTRA
-#define XEXTRA(s) \
- ((sizeof(s)+(sizeof(CARD32)-1L)-XETrapMinRepSize)/sizeof(CARD32))
-#endif
-
-/* Static Declarations known to XTrap Only
- * All XTrap clients refer to these single copies!
- */
-/* This carries all of the information XTrap uses for internal information */
-static XETrapEnv *XETenv[MAXCLIENTS] = {NULL};
-#ifndef RESTYPE
-#define RESTYPE unsigned long
-#endif
-static RESTYPE XETrapClass = 0L; /* Resource class for this extension */
-static RESTYPE XETrapType = 0L; /* Resource type for this extension */
-static Bool gate_closed = False; /* The global "gatekeeper" */
-static Bool key_ignore = False; /* The global "keymaster" */
-static Bool ignore_grabs = False;
-static CARD8 next_key = XEKeyIsClear; /* Echo, Clear, or Other */
-#ifdef VECTORED_EVENTS
-static INT16 current_screen = -1L; /* Current screen for events */
-#endif
-static INT16 vectored_requests[256L] = {0L}; /* cnt of vectoring clients */
-static INT16 vectored_events[KeyPress+MotionNotify] = {0L};
-typedef struct _client_list
-{
- struct _client_list *next;
- ClientPtr client;
-} ClientList;
-static ClientList io_clients; /* Linked-list of clients currently doing I/O */
-static ClientList stats_clients; /* Linked-list of clients collecting stats */
-static ClientList cmd_clients; /* Linked-list of clients using command key */
-
-/*----------------------------*
- * Forward Declarations
- *----------------------------*/
-static void _SwapProc (int (**f1 )(), int (**f2 )());
-static void sXETrapEvent (xETrapDataEvent *from , xETrapDataEvent *to );
-static int add_accelerator_node (ClientPtr client , ClientList *accel );
-static void remove_accelerator_node (ClientPtr client , ClientList *accel );
-static void update_protocol (xXTrapGetReq *reqptr , ClientPtr client );
-#ifdef COLOR_REPLIES
-static void GetSendColorRep (ClientPtr client , xResourceReq *req );
-static void GetSendNamedColorRep (ClientPtr client , xResourceReq *req );
-static void GetSendColorCellsRep (ClientPtr client , xResourceReq *req );
-static void GetSendColorPlanesRep (ClientPtr client , xResourceReq *req );
-#endif
-
-/*
- * DESCRIPTION:
- *
- * This routine is called by the server when a given client
- * goes away (as identified by the first argument). All
- * memory allocations, misc. values specific to a given
- * client would be reset here.
- *
- */
-int XETrapDestroyEnv(pointer value, XID id)
-{
- xXTrapReq request;
- XETrapEnv *penv = XETenv[(long)value];
-
- XETrapReset(&request,penv->client);
- /* Free any memory malloc'd for a particular client here */
- /* In case stop I/O wasn't received for this client */
- if (penv->stats)
- { /* Remove from client accelerator list */
- remove_accelerator_node(penv->client, &stats_clients);
- Xfree(penv->stats); /* Free the stats buckets */
- }
- if (cmd_clients.next == NULL)
- { /* No more command key clients! Let's reset the gate */
- gate_closed = False;
- key_ignore = False;
- next_key = XEKeyIsClear;
- }
-
-#ifdef VECTORED_EVENTS
- current_screen = -1L; /* Invalidate current screen */
-#endif
-
-#ifdef VERBOSE
- ErrorF("%s: Client '%d' Disconnected\n", XTrapExtName,
- penv->client->index);
-#endif
-
- Xfree(penv);
- XETenv[(long)value] = NULL;
-
- return 0;
-}
-
-/*
- * DESCRIPTION:
- *
- * This routine is called by the server when the last client
- * (the session manager in most cases) goes away. This is server
- * reset. When the server comes back up, this extension will not
- * be loaded unless this routine makes the proper arrangements.
- *
- * The real concern here is to unload the extension
- * and possibly make arragements to be called upon
- * server restart.
- *
- */
-void XETrapCloseDown(ExtensionEntry *extEntry)
-{
- long i;
-
- for (i=0L; i<MAXCLIENTS; i++)
- {
- if (XETenv[i] != NULL)
- {
- XETrapDestroyEnv((pointer)i,0L);
- }
- }
- ignore_grabs = False;
- return;
-}
-
-/*
- *
- * DESCRIPTION:
- *
- * This routine has been created because of the initialization
- * order that X uses, such that extensions are initialized before
- * devices. This means that this extension must perform a second
- * level of initialization to obtain the device references at some
- * point after they have been initialized. It is assumed that when
- * a client establishes communication with the extension that the
- * devices havae been initialized, and therefore this function can
- * obtain the information it needs.
- *
- * In obtaining the information, this function also places its own
- * functions in place of the *standard* functions. The original
- * functions are retained for vectoring purposes.
- */
-
-Bool XETrapRedirectDevices()
-{
- Bool retval = True;
-
- /* Do we need to redirect the keyboard device? */
- if (XETrapKbdDev == NULL)
- {
- if ((XETrapKbdDev = LookupKeyboardDevice()) == NULL)
- {
- retval = False;
- }
- else
- {
- EventProcVector[KeyPress] =
- (int_function)XETrapKbdDev->realInputProc;
- EventProcVector[KeyRelease] =
- (int_function)XETrapKbdDev->realInputProc;
- }
-#ifdef VECTORED_EVENTS
- keybd_process_inp = EventProcVector[KeyPress];
- EventProcVector[KeyPress] = EventProcVector[KeyRelease] = NULL;
- XETrapEventProcVector[KeyPress] = XETrapEventVector;
- XETrapEventProcVector[KeyRelease] = XETrapEventVector;
-#else /* !VECTORED_EVENTS */
- XETrapEventProcVector[KeyPress] = XETrapKeyboard;
- XETrapEventProcVector[KeyRelease] = XETrapKeyboard;
-#endif /* !VECTORED_EVENTS */
- }
- /* Do we need to redirect the pointer device? */
-#ifndef VECTORED_EVENTS
- if (XETrapPtrDev == NULL)
- {
- if ((XETrapPtrDev = LookupPointerDevice()) == 0L)
- {
- retval = False;
- }
- else
- {
- EventProcVector[ButtonPress] =
- (int_function)XETrapPtrDev->realInputProc;
- EventProcVector[ButtonRelease] =
- (int_function)XETrapPtrDev->realInputProc;
- EventProcVector[MotionNotify] =
- (int_function)XETrapPtrDev->realInputProc;
- }
- XETrapEventProcVector[ButtonPress] = XETrapPointer;
- XETrapEventProcVector[ButtonRelease] = XETrapPointer;
- XETrapEventProcVector[MotionNotify] = XETrapPointer;
- }
-#endif /* !VECTORED_EVENTS */
- return(retval);
-}
-
-/*
- *
- * DESCRIPTION:
- *
- * This routine is the main entry point for the Xtrap extension. It is
- * called by the server to inititalize the Xtrap extension. Once the
- * extension is initialized, life is controlled by the XtrapDispatch
- * routine by the requests it will handle.
- *
- * Initializes all the XTrap data structures with the proper
- * addresses of defined routines that will help control the extension.
- * It is vital that the extension state be kept accurate so that only
- * one call to this routine be made.
- *
- */
-
-void DEC_XTRAPInit()
-{
- register ExtensionEntry *extEntry;
- unsigned int i;
- Atom a;
-
- /* Make the extension known to the server. Must be done every time
- * DEC_XTRAPInit is called, else server will think it failed.
- */
- if ((extEntry = AddExtension(XTrapExtName,XETrapNumEvents,
- XETrapNumErrors,XETrapDispatch,sXETrapDispatch,XETrapCloseDown
- ,StandardMinorOpcode)) == NULL)
- {
- ErrorF("%s: AddExtension Failed!\n", XTrapExtName);
- return;
- }
-#ifdef VERBOSE
- ErrorF("%s: AddExtension assigned Major Opcode '%d'\n",
- XTrapExtName, extEntry->base);
-#endif
- XETrap_avail.data.major_opcode = extEntry->base;
- XETrapErrorBase = extEntry->errorBase;
- XETrap_avail.data.event_base = extEntry->eventBase;
-
- /* Set up our swapped reply vector */
- ReplySwapVector[XETrap_avail.data.major_opcode] =
- (void_function) sReplyXTrapDispatch;
-
- /* Set up our swapped event vector */
- EventSwapVector[extEntry->eventBase + XETrapData] =
- (EventSwapPtr) sXETrapEvent;
-
- /* make an atom saying that the extension is present. The
- * adding of the resource occurs during XETrapCreateEnv().
- */
- if ((a = MakeAtom(XTrapExtName,strlen(XTrapExtName),1L)) == None ||
- (XETrapType = CreateNewResourceType(XETrapDestroyEnv)) == 0L)
- {
- ErrorF("%s: Setup can't create new resource type (%d,%d,%d)\n",
- XTrapExtName, (int)a,(int)XETrapClass,(int)XETrapType);
- return;
- }
- /* initialize the GetAvailable info reply here */
- XETrap_avail.hdr.type = X_Reply;
- XETrap_avail.hdr.length = XEXTRA(xXTrapGetAvailReply);
- XETrap_avail.data.xtrap_release = XETrapRelease;
- XETrap_avail.data.xtrap_version = XETrapVersion;
- XETrap_avail.data.xtrap_revision = XETrapRevision;
- XETrap_avail.data.pf_ident = XETrapPlatform;
- XETrap_avail.data.max_pkt_size = 0xFFFF; /* very large number */
- for (i=0L; i<ASIZE(XETrap_avail.data.valid); i++)
- {
- XETrap_avail.data.valid[i] = 0L; /* Clear bits initially */
- }
- BitTrue(XETrap_avail.data.valid,XETrapTimestamp);
- BitTrue(XETrap_avail.data.valid,XETrapCmd);
- BitTrue(XETrap_avail.data.valid,XETrapCmdKeyMod);
- BitTrue(XETrap_avail.data.valid,XETrapRequest);
- BitTrue(XETrap_avail.data.valid,XETrapEvent);
- BitTrue(XETrap_avail.data.valid,XETrapMaxPacket);
- BitTrue(XETrap_avail.data.valid,XETrapStatistics);
- BitTrue(XETrap_avail.data.valid,XETrapWinXY);
- /* Not yet implemented */
- BitFalse(XETrap_avail.data.valid,XETrapCursor);
-#ifndef _XINPUT
- BitFalse(XETrap_avail.data.valid,XETrapXInput);
-#else
- BitTrue(XETrap_avail.data.valid,XETrapXInput);
-#endif
-#ifndef VECTORED_EVENTS
- BitFalse(XETrap_avail.data.valid,XETrapVectorEvents);
-#else
- BitTrue(XETrap_avail.data.valid,XETrapVectorEvents);
-#endif /* VECTORED_EVENTS */
-#ifndef COLOR_REPLIES
- BitFalse(XETrap_avail.data.valid,XETrapColorReplies);
-#else
- BitTrue(XETrap_avail.data.valid,XETrapColorReplies);
-#endif /* COLOR_REPLIES */
- BitTrue(XETrap_avail.data.valid,XETrapGrabServer);
- /* initialize multi-client accelerator lists */
- io_clients.next = NULL;
- stats_clients.next = NULL;
- cmd_clients.next = NULL;
- for (i=0L; i<256L; i++)
- {
- vectored_requests[i] = 0L;
- }
- for (i=KeyPress; i<=MotionNotify; i++)
- {
- vectored_events[i] = 0L;
- }
- gate_closed = False;
- key_ignore = False;
- next_key = XEKeyIsClear;
-
- XETrapPlatformSetup();
- /* Initialize any local memory we use */
- for (i=0L; i<ASIZE(EventProcVector); i++)
- {
- EventProcVector[i] = NULL;
-#ifndef VECTORED_EVENTS
- XETrapEventProcVector[i] = NULL;
-#else
- XETrapEventProcVector[i] = XETrapEventVector;
-#endif
- }
- XETrapKbdDev = NULL;
- XETrapPtrDev = NULL;
- for (i=0L; i<ASIZE(XETrapProcVector); i++)
- {
- XETrapProcVector[i] = XETrapRequestVector;
- }
- for (i=128L; i<=255L; i++)
- { /* Extension "swapped" requests are not implemented */
- XETSwProcVector[i] = NotImplemented;
- }
-#ifdef VERBOSE
- ErrorF("%s: Vers. %d.%d-%d successfully loaded\n", XTrapExtName,
- XETrap_avail.data.xtrap_release,
- XETrap_avail.data.xtrap_version,
- XETrap_avail.data.xtrap_revision);
-#endif
-
- return;
-}
-
-/*
- * DESCRIPTION:
- *
- * This procedure is called upon dispatch to allocate an
- * environment structure for a new XTrap client. The XETenv[]
- * entry is allocated and initialized with default values.
- * XETrapDestroyEnv() is responsible for deallocating this memory
- * upon client termination.
- *
- * Note: the status of this routine is returned to the caller of
- * the Dispatch routine which will in turn SendErrorToClient if
- * necessary.
- *
- */
-
-int XETrapCreateEnv(ClientPtr client)
-{
- XETrapEnv *penv = NULL;
- int status = Success;
-
- if (client->index > MAXCLIENTS)
- {
- status = BadImplementation;
- }
- else if ((XETenv[client->index] = (XETrapEnv *)Xcalloc(sizeof(XETrapEnv)))
- == NULL)
- {
- status = BadAlloc;
- }
- if (status == Success)
- {
- penv = XETenv[client->index];
- penv->client = client;
- penv->protocol = 31; /* default to backwards compatibility */
- /* prep for client's departure (for memory dealloc, cleanup) */
- AddResource(FakeClientID(client->index),XETrapType,
- (pointer)(long)(client->index));
- if (XETrapRedirectDevices() == False)
- {
- status = XETrapErrorBase + BadDevices;
- }
- /* Initialize the current state */
- if (status == Success)
- {
- status = XETrapReset(NULL, penv->client);
- }
- }
-
-#ifdef VECTORED_EVENTS
- current_screen = -1L; /* Invalidate current screen */
-#endif
-
-#ifdef VERBOSE
- if (status == Success)
- {
- ErrorF("%s: Client '%d' Connection Accepted\n", XTrapExtName,
- penv->client->index);
- }
-#endif
-
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This procedure is defined for the call to AddExtension()
- * in which it is expected to be a parameter of the call.
- *
- * This routine will be called by the server dispatcher
- * when a client makes a request that is handled
- * by the extension and the byte ordering of the client is the
- * SAME as that of the extension.
- *
- * Note: the status of the requests is returned to the caller of
- * the Dispatch routine which will in turn SendErrorToClient if
- * necessary.
- */
-
-int XETrapDispatch(ClientPtr client)
-{
-
- REQUEST(xXTrapReq);
- register int status = Success;
-
- REQUEST_AT_LEAST_SIZE(xXTrapReq);
-
- /* Have we seen this client before? */
- if (XETenv[client->index] == NULL)
- {
- status = XETrapCreateEnv(client);
- }
- /* Do we have a valid request? */
- if (status == Success)
- {
- if (stuff->minor_opcode < ASIZE(XETrapDispatchVector))
- {
- /* Then vector to the pointed to function */
- status =
- (*(XETrapDispatchVector[stuff->minor_opcode]))(stuff,client);
- }
- else
- {
- status = BadRequest;
- }
- }
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This procedure is defined for the call to AddExtension()
- * in which it is expected to be a parameter of the call.
- *
- * This routine would ordinarily be called by the server
- * dispatcher when a client makes a request that is handled
- * by the extension and the byte ordering of the client is
- * DIFFERENT than that of the extension.
- */
-
-int sXETrapDispatch(ClientPtr client)
-{
-
- REQUEST(xXTrapReq);
- register int status = Success;
-
- REQUEST_AT_LEAST_SIZE(xXTrapReq);
-
- /* Have we seen this client before? */
- if (XETenv[client->index] == NULL)
- {
- status = XETrapCreateEnv(client);
- }
- /* Do we have a valid request? */
- if (status == Success)
- {
- if (stuff->minor_opcode < ASIZE(XETSwDispatchVector))
- {
- /* Then vector to the pointed to function */
- status =
- (*(XETSwDispatchVector[stuff->minor_opcode]))(stuff,client);
- }
- else
- {
- status = BadRequest;
- }
- }
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This routine will place the extension in a steady and known
- * state. Any current state will be reset. This is called either
- * by a client request (dispatched) or when a new client environment
- * is created.
- *
- */
-int XETrapReset(xXTrapReq *request, ClientPtr client)
-{
- static xXTrapConfigReq DummyReq;
- register int i;
- register int status = Success;
- XETrapEnv *penv = XETenv[client->index];
-
- /* in case any i/o's pending */
- (void)XETrapStopTrap((xXTrapReq *)NULL, client);
- penv->cur.hdr.type = X_Reply;
- penv->cur.hdr.length = XEXTRA(xXTrapGetCurReply);
- /* Fill in a dummy config request to clear all elements */
- for (i=0L; i<ASIZE(DummyReq.config_flags_valid); i++)
- {
- DummyReq.config_flags_valid[i] = 0xFFL; /* set all the valid flags */
- DummyReq.config_flags_data[i] = 0L; /* clear all data flags */
- }
- /* Don't reset grab server arbitrarily, it must be explicitly
- * de-configured.
- */
- BitSet(DummyReq.config_flags_data, XETrapGrabServer, ignore_grabs);
- for (i=0L; i< ASIZE(DummyReq.config_flags_req); i++)
- {
- DummyReq.config_flags_req[i] = 0xFF; /* Clear all protocol requests */
- }
- for (i=0L; i< ASIZE(DummyReq.config_flags_event); i++)
- {
- DummyReq.config_flags_event[i] = 0xFF; /* Clear all protocol events */
- }
- /* Call config routine to clear all configurable fields */
- status = XETrapConfig(&DummyReq, client);
- /* reset the environment */
- for (i=0L; i<ASIZE(penv->cur.data_state_flags); i++)
- {
- penv->cur.data_state_flags[i] = 0L; /* Clear all env flags */
- }
- penv->cur.data_config_max_pkt_size = XETrap_avail.data.max_pkt_size;
-
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sends a reply back to the requesting client indicating
- * the available states of the extension can be configured for.
- */
-int XETrapGetAvailable(xXTrapGetReq *request, ClientPtr client)
-{
- XETrapEnv *penv = XETenv[client->index];
- update_protocol(request, client);
- /* Initialize the reply as needed */
- XETrap_avail.data.xtrap_protocol = penv->protocol;
- XETrap_avail.hdr.detail = XETrap_GetAvailable;
- XETrap_avail.hdr.sequenceNumber = client->sequence;
- WriteReplyToClient(client, sizeof(xXTrapGetAvailReply), &XETrap_avail);
- return(Success);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sends a reply back to the requesting client indicating
- * the current state of the extension.
- */
-int XETrapGetCurrent(xXTrapReq *request, ClientPtr client)
-{
- XETrapEnv *penv = XETenv[client->index];
- int rep_size = (penv->protocol == 31 ? 284 : sz_xXTrapGetCurReply);
- penv->cur.hdr.length = (rep_size - 32L) / SIZEOF(CARD32);
-
- /* Initialize the reply as needed */
- penv->cur.hdr.detail = XETrap_GetCurrent;
- penv->cur.hdr.sequenceNumber = client->sequence;
- WriteReplyToClient(client, rep_size, &(penv->cur));
-
- return(Success);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sends a reply back to the requesting client dumping
- * statistics (counts) of requests and events. If stat's isn't
- * configured, return failure.
- */
-int XETrapGetStatistics(xXTrapReq *request, ClientPtr client)
-{
- int status = Success;
- XETrapEnv *penv = XETenv[client->index];
-
- if ((BitIsTrue(penv->cur.data_config_flags_data, XETrapStatistics)) &&
- (penv->stats))
- {
- /* Initialize the reply as needed */
- int rep_size = sizeof(xXTrapGetStatsReply);
- penv->stats->detail = XETrap_GetStatistics;
- penv->stats->sequenceNumber = client->sequence;
- if (penv->protocol == 31)
- {
- xXTrapGetStatsReply rep_stats;
- rep_stats = *penv->stats;
-#ifndef VECTORED_EVENTS
- rep_size = 1060;
-#else
- rep_size = 1544;
-#endif
- rep_stats.length = (rep_size - 32L) / SIZEOF(CARD32);
- /*
- * Now we need to shift the data *into* the header area
- * for bug compatibility.
- */
- memcpy(&(rep_stats.pad0),&(penv->stats->data),
- sizeof(XETrapGetStatsRep));
- WriteReplyToClient(client, rep_size, &rep_stats);
- }
- else
- {
- WriteReplyToClient(client, rep_size, penv->stats);
- }
- }
- else
- {
- status = XETrapErrorBase + BadStatistics;
- }
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function is dispatched when a client requests the extension to
- * be configured in some manner.
- */
-int XETrapConfig(xXTrapConfigReq *request, ClientPtr client)
-{
- UByteP vflags = request->config_flags_valid;
- UByteP dflags = request->config_flags_data;
- UByteP req_flags = request->config_flags_req;
- UByteP event_flags = request->config_flags_event;
- XETrapEnv *penv = XETenv[client->index];
- UByteP bit_flags = penv->cur.data_config_flags_data;
- int status = Success;
- CARD32 i = 0L;
-
- /* Check events and swap if desired */
- if (BitIsTrue(vflags,XETrapEvent))
- { /* Loop through all of the events */
- for (i=0L; i<ASIZE(EventProcVector); i++)
- {
- if (BitIsTrue(event_flags,i) && /* Do we care about this one? */
- (BitValue(dflags,XETrapEvent) ^ /* Exclusive Or */
- (BitValue(penv->cur.data_config_flags_event,i))))
- { /* At this point we *know* there's a change. The
- * only question remaining is are there any more
- * clients interested in this specific event. If
- * so, *don't* swap this process!
- */
- if (BitIsTrue(dflags,XETrapEvent))
- { /* Client wants the XTrap rtn */
- if (++(vectored_events[i]) <= 1L)
- { /* first client, so do it */
- _SwapProc(&(XETrapEventProcVector[i]),
- &(EventProcVector[i]));
- }
- }
- else
- { /* Client wants the *real* rtn */
- if (--(vectored_events[i]) <= 0L)
- { /* No more clients using, so do it */
- _SwapProc(&(XETrapEventProcVector[i]),
- &(EventProcVector[i]));
- }
- }
- switch(i)
- {
- case KeyPress: /* needed for command key processing */
- case KeyRelease:
- XETrapKbdDev->processInputProc =
- (void_function)(EventProcVector[i] ?
- (void_function)EventProcVector[i] :
- (void_function)keybd_process_inp);
- XETrapKbdDev->realInputProc =
- (void_function)(EventProcVector[i] ?
- (void_function)EventProcVector[i] :
- (void_function)keybd_process_inp);
- break;
-#ifndef VECTORED_EVENTS
- case ButtonPress: /* hack until events become vectored */
- case ButtonRelease:
- case MotionNotify:
- XETrapPtrDev->processInputProc =
- (void_function)EventProcVector[i];
- XETrapPtrDev->realInputProc =
- (void_function)EventProcVector[i];
- break;
- default:
- status = BadImplementation;
- break;
-#endif /* !VECTORED_EVENTS */
- }
- BitToggle(penv->cur.data_config_flags_event,i);
- }
- }
- }
- if ((status == Success) &&
- (_CheckChangeBit(vflags,dflags,bit_flags,XETrapCmd)))
- {
- if (BitIsTrue(dflags, XETrapCmd))
- { /* Add accelerator entry to cmd_clients list iff necessary */
- penv->cur.data_config_cmd_key = request->config_cmd_key;
- status = add_accelerator_node(penv->client, &cmd_clients);
- }
- else
- {
- penv->cur.data_config_cmd_key = 0L; /* default no KeyCode */
- remove_accelerator_node(penv->client, &cmd_clients);
- }
- }
- if ((status == Success) &&
- (_CheckChangeBit(vflags,dflags,bit_flags,XETrapMaxPacket)))
- {
- if (BitIsTrue(dflags,XETrapMaxPacket))
- { /* Set size to what's passed in */
- if (request->config_max_pkt_size < XETrapMinPktSize)
- { /* Tell them the value is too small */
- status = BadValue;
- }
- else
- {
- penv->cur.data_config_max_pkt_size =
- request->config_max_pkt_size;
- }
- }
- else
- { /* Set it to the default (a *very* big number) */
- penv->cur.data_config_max_pkt_size = 0xFFFF;
- }
- }
- /* If the valid flag is set for requests, then each of the
- * requests is swapped if it's different from current state.
- */
- if (BitIsTrue(vflags,XETrapRequest) && status == Success)
- { /* Loop through all of the core requests */
- for (i=0L; i<ASIZE(XETrapProcVector); i++)
- {
- if (BitIsTrue(req_flags,i) && /* Do we care about this one? */
- (BitValue(dflags,XETrapRequest) ^ /* Exclusive Or */
- (BitValue(penv->cur.data_config_flags_req,i))))
- { /* At this point we *know* there's a change. The
- * only question remaining is are there any more
- * clients interested in this specific request. If
- * so, *don't* swap this process!
- */
- if (BitIsTrue(dflags,XETrapRequest))
- { /* Client wants the XTrap rtn */
- if (++(vectored_requests[i]) <= 1L)
- { /* first client, so do it */
- _SwapProc(&(XETrapProcVector[i]), &(ProcVector[i]));
- }
- }
- else
- { /* Client wants the *real* rtn */
- if (--(vectored_requests[i]) <= 0L)
- { /* No more clients using, so do it */
- _SwapProc(&(XETrapProcVector[i]), &(ProcVector[i]));
- }
- }
- if (status == Success)
- {
- BitToggle(penv->cur.data_config_flags_req,i);
- }
- }
- }
- }
- /* Check & Set the boolean flags */
- if (status == Success)
- {
- _CheckChangeBit(vflags,dflags,bit_flags,XETrapCmdKeyMod);
- _CheckChangeBit(vflags,dflags,bit_flags,XETrapTimestamp);
- _CheckChangeBit(vflags,dflags,bit_flags,XETrapWinXY);
-/* _CheckChangeBit(vflags,dflags,bit_flags,XETrapCursor); */
-#ifdef COLOR_REPLIES
- _CheckChangeBit(vflags,dflags,bit_flags,XETrapColorReplies);
-#endif /* COLOR_REPLIES */
- if (_CheckChangeBit(vflags,dflags,bit_flags,XETrapGrabServer))
- { /* Let any client uncoditionally set/clear Grabs */
- ignore_grabs = BitValue(dflags, XETrapGrabServer);
- }
- }
- /* The statistics vflag/dflag mechanism is a little different
- * from most. The dflag is initially set to 0 to indicate no
- * statistics. When a config request comes in to request
- * statistics, memory's allocated and the dflag is set.
- * Thereafter, whenever a client wants to clear the counters, he
- * simply sets the vflag and clears the dflag. Multiple requests
- * for statistics configuration are ignored, and the stats memory is
- * free'd only when the client disconnects.
- */
- if (status == Success)
- {
- if (_CheckChangeBit(vflags,dflags,bit_flags,XETrapStatistics))
- {
- if (BitIsTrue(dflags,XETrapStatistics))
- { /* Do we need to allocate memory? */
- if (penv->stats == NULL && (penv->stats =
- (xXTrapGetStatsReply *)Xcalloc(sizeof(xXTrapGetStatsReply)))
- != NULL)
- { /* Set up the reply header */
- penv->stats->type = X_Reply;
- penv->stats->length = XEXTRA(xXTrapGetStatsReply);
- /* add accelerator node for stats clients list */
- status = add_accelerator_node(penv->client, &stats_clients);
- }
- else if (penv->stats == NULL)
- { /* No Memory! */
- status = BadAlloc;
- }
- }
- else
- { /* Zero out counters */
- (void)memset(penv->stats->data.requests, 0L,
- sizeof(penv->stats->data.requests));
- (void)memset(penv->stats->data.events, 0L,
- sizeof(penv->stats->data.events));
- /* Re-cock the Stat's flag so that it'll
- * sense a change for next zero'ing out
- * of the counters.
- */
- BitTrue(penv->cur.data_config_flags_data, XETrapStatistics);
- }
- }
- }
- return(status);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sets the XETrapTrapActive bit to indicate that Trapping
- * of requests and/or core events to the client may take place.
- *
- */
-int XETrapStartTrap(xXTrapReq *request, ClientPtr client)
-{
- XETrapEnv *penv = XETenv[client->index];
- int status = add_accelerator_node(penv->client, &io_clients);
- if (status == Success)
- {
- BitTrue(penv->cur.data_state_flags, XETrapTrapActive);
- }
- return(status);
-}
-/*
- * DESCRIPTION:
- *
- * This function clears the XETrapTrapActive bit to indicate that Trapping
- * of requests and/or core events to the client may *not* take place.
- *
- */
-int XETrapStopTrap(xXTrapReq *request, ClientPtr client)
-{
- XETrapEnv *penv = XETenv[client->index];
-
- remove_accelerator_node(penv->client, &io_clients);
- BitFalse(penv->cur.data_state_flags, XETrapTrapActive);
- return(Success);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sends a reply back to the requesting client indicating
- * the specific XTrap version of this extension.
- */
-int XETrapGetVersion(xXTrapGetReq *request, ClientPtr client)
-{
- xXTrapGetVersReply ver_rep;
- XETrapEnv *penv = XETenv[client->index];
-
- update_protocol(request,client); /* to agree on protocol version */
- /* Initialize the reply as needed */
- ver_rep.hdr.type = X_Reply;
- ver_rep.hdr.detail = XETrap_GetVersion;
- ver_rep.hdr.sequenceNumber = client->sequence;
- ver_rep.hdr.length = XEXTRA(xXTrapGetVersReply);
- ver_rep.data.xtrap_release = XETrap_avail.data.xtrap_release;
- ver_rep.data.xtrap_version = XETrap_avail.data.xtrap_version;
- ver_rep.data.xtrap_revision = XETrap_avail.data.xtrap_revision;
- ver_rep.data.xtrap_protocol = penv->protocol; /* return agreed protocol */
- WriteReplyToClient(client, sizeof(xXTrapGetVersReply), &ver_rep);
- return(Success);
-}
-
-/*
- * DESCRIPTION:
- *
- * This function sends a reply back to the requesting client indicating
- * the specific XTrap version of this extension.
- */
-int XETrapGetLastInpTime(xXTrapReq *request, ClientPtr client)
-{
- xXTrapGetLITimReply tim_rep;
- XETrapEnv *penv = XETenv[client->index];
-
- /* Initialize the reply as needed */
- tim_rep.hdr.type = X_Reply;
- tim_rep.hdr.detail = XETrap_GetLastInpTime;
- tim_rep.hdr.sequenceNumber = client->sequence;
- tim_rep.hdr.length = XEXTRA(xXTrapGetLITimReply);
- tim_rep.data_last_time = penv->last_input_time;
- WriteReplyToClient(client, sizeof(xXTrapGetLITimReply), &tim_rep);
- return(Success);
-}
-
-/*
- * DESCRIPTION:
- *
- * This routine is swapped in for the server's output request vectors.
- * After writing the request to one (or more) XTrap client(s), this
- * routine ALWAYS returns by calling the REAL output request vector rtn.
- *
- * Note: Swapped Requests are handled automatically since the unswapped
- * vectored routine is called after the request has been swapped.
- * IOW, all requests are directed through ProcVector eventually and are
- * "unswapped" at that point. It is necessary to swap the data
- * back if writing to a swapped client, however, and this is done
- * by calling the appropriate XETSwProcVector[] routine.
- */
-int XETrapRequestVector(ClientPtr client)
-{
- int status = True;
- XETrapDatum *pdata, *spdata = NULL;
- REQUEST(xResourceReq);
- WindowPtr window_ptr;
- XETrapEnv *penv;
- BYTE *tptr;
- ClientList *ioc = &io_clients;
- ClientList *stc = &stats_clients;
- INT32 asize = sizeof(pdata->hdr) + stuff->length * sizeof(CARD32);
- INT32 size = MAX(asize,XETrapMinPktSize); /* Must be at least */
- INT32 csize; /* size of request to send to the XTrap client */
-
- /* Get memory for the data to be sent */
- if ((pdata = (XETrapDatum *)Xcalloc(size)) == NULL)
- { /* Can't do anything accept set a flag since we don't
- * know who to send the error to yet.
- */
- status = False;
- }
-
- while (ioc->next != NULL)
- {
- ioc = ioc->next;
- penv = XETenv[ioc->client->index];
- if (status == False)
- { /* We didn't get the memory! Complain */
- SendErrorToClient(penv->client,XETrap_avail.data.major_opcode,
- stuff->reqType, 0L, BadAlloc);
- break;
- }
- if (BitIsTrue(penv->cur.data_config_flags_req,stuff->reqType))
- { /* This particular client is interested in *this* request */
- pdata->hdr.client = client->index; /* stuff client index in hdr */
- if (BitIsTrue(penv->cur.data_config_flags_data,XETrapWinXY))
- {
- window_ptr = (WindowPtr) LookupDrawable(stuff->id, client);
- if (window_ptr == 0L)
- { /* Failed...invalidate the X and Y coordinate data. */
- pdata->hdr.win_x = -1L;
- pdata->hdr.win_y = -1L;
- }
- else
- {
- pdata->hdr.screen = window_ptr->drawable.pScreen->myNum;
- pdata->hdr.win_x = window_ptr->drawable.x;
- pdata->hdr.win_y = window_ptr->drawable.y;
- }
- }
- if (BitIsTrue(penv->cur.data_config_flags_data,XETrapTimestamp))
- {
- pdata->hdr.timestamp = GetTimeInMillis();
- }
- /* Copy the information to a location we can write it from */
- (void) memcpy(&(pdata->u.req),stuff,stuff->length*sizeof(CARD32));
- pdata->hdr.count = MIN(penv->cur.data_config_max_pkt_size,asize);
- XETrapSetHeaderRequest(&(pdata->hdr));
-
- /* Perform any needed byte/word swapping. NOTE: This is not
- * the "normal" technique that should be used to perform the
- * swapping. The reason that we do it here is to be sure to
- * do it only once in a controlled manner, which we can not
- * guarentee in the case of the Xlib transport. Notice that
- * we don't swap the XTRAP EVENT information. This is done
- * in the XETrapWriteXLib() routine.
- */
-
- if (penv->client->swapped)
- { /* need to deal with swapped clients */
- if (spdata == NULL)
- { /* Get memory for the swapped data to be sent */
- if ((spdata = (XETrapDatum *)Xcalloc(size)) == NULL)
- {
- SendErrorToClient(penv->client,
- XETrap_avail.data.major_opcode,
- stuff->reqType, 0L, BadAlloc);
- break;
- }
-
- memcpy(spdata,pdata,size); /* fill in the info */
- /* Now call the request-specific rtn to swap the request */
- if (stuff->reqType < 128)
- { /* a core request, good */
- (*XETSwProcVector[stuff->reqType])(&(spdata->u.req),
- penv->client); /* RTC X11R6 */
- }
- else if (penv->cur.data_config_max_pkt_size ==
- XETrapMinPktSize)
- { /* Minimum size, so swap it as an ResourceReq */
- XETSwResourceReq(&(spdata->u.req));
- }
- else
- { /* trying to swap an extension request! */
- SendErrorToClient(penv->client,
- XETrap_avail.data.major_opcode,
- stuff->reqType, 0L, XETrapErrorBase + BadSwapReq);
- }
- }
- /* need to stow in the latest header (count) */
- memcpy(spdata,pdata,SIZEOF(XETrapHeader));
- sXETrapHeader(&(spdata->hdr)); /* swap the XTrap Header */
- }
- /* Write as many bytes of information as the client wants */
- tptr = (BYTE *)(penv->client->swapped ? spdata : pdata);
- csize = MAX(pdata->hdr.count, XETrapMinPktSize);
- if (XETrapWriteXLib(penv, tptr, csize) != csize)
- {
- SendErrorToClient(penv->client,XETrap_avail.data.major_opcode,
- stuff->reqType, 0L, XETrapErrorBase + BadIO);
- }
-#ifdef COLOR_REPLIES
- /* Process Color Replies, if desired, and applicable */
- if (BitIsTrue(penv->cur.data_config_flags_data,XETrapColorReplies))
- { /* wants color replies */
- switch(stuff->reqType)
- {
- case X_AllocColor:
- GetSendColorRep(client, stuff);
- break;
- case X_AllocNamedColor:
- GetSendNamedColorRep(client, stuff);
- break;
- case X_AllocColorCells:
- GetSendColorCellsRep(client, stuff);
- break;
- case X_AllocColorPlanes:
- GetSendColorPlanesRep(client, stuff);
- break;
- default:
- break;
- }
- }
-#endif /* COLOR_REPLIES */
- }
- }
- while (stc->next != NULL)
- { /* increment appropriate stats bucket for each interested client */
- stc = stc->next;
- penv = XETenv[stc->client->index];
- if (BitIsTrue(penv->cur.data_config_flags_req,stuff->reqType))
- { /* This particular client would like this particular stat */
- penv->stats->data.requests[stuff->reqType]++;
- }
- }
-
- if (pdata)
- {
- Xfree(pdata);
- }
- if (spdata)
- {
- Xfree(spdata);
- }
- if (ignore_grabs == True &&
- (stuff->reqType == X_GrabServer || stuff->reqType == X_UngrabServer))
- { /* doesn't want Grab's! Note: this is a "last configured" setting */
-#ifndef NO_NEW_XTRAP
- int status;
-
- if (stuff->reqType == X_GrabServer)
- {
- ClientList *pclient;
-
- /* first call grab server procedure */
- status = (*XETrapProcVector[stuff->reqType])(client);
-
- /* then add XTrap controlling clients */
- for (pclient = &io_clients; pclient; pclient = pclient->next)
- if (pclient->client)
- MakeClientGrabImpervious(pclient->client);
- }
- else
- {
- ClientList *pclient;
-
- /* first drop XTrap controlling clients */
- for (pclient = &io_clients; pclient; pclient = pclient->next)
- if (pclient->client)
- MakeClientGrabPervious(pclient->client);
-
- /* then call ungrab server procedure */
- status = (*XETrapProcVector[stuff->reqType])(client);
- }
- return status;
-#else /* NO_NEW_XTRAP */
- return(Success);
-#endif /* NO_NEW_XTRAP */
- }
- else
- {
- return((*XETrapProcVector[stuff->reqType])(client));
- }
-}
-/*
- *
- * DESCRIPTION:
- *
- * This routine intercepts input xEvents from the keyboard.
- * if XETrapTrapActive, will write record to client(s)
- * and then pass the event to the server iff not command
- * key and gate is open. If it's a command key, then twiddle
- * the gate state as required (optional, see below).
- *
- * This routine implements an optional user specified command key
- * that can be used to close the input pipe into the server
- * while a client command is generated. The keypress of the
- * command key places this routine in command mode, the keyrelease
- * exits command mode.
- *
- * A keypress of the command key followed by the
- * optionally specified lock key will place this routine in continuous
- * command mode until the command key and lock key are pressed again
- * to exit command mode. In the locked state, the client interprets
- * keystrokes as it wishes, as commands or as input to a prior command.
- *
- * Both mechanisms can be used alternately.
- *
- * IMPLICIT INPUTS :
- *
- * penv->cur.data_config_cmd_key :
- * This is the keycode of the key that is used to stop
- * and restart the transmission of intercepted input
- * events to the server. If specified, the gate_state
- * flag will be set or cleared depending on the state of
- * the command_key.
- *
- * penv->cur.data_config_flags_data.XETrapCmdKeyMod:
- * This is the value of the mode in which the command_key
- * will operate. It currently has two values: MODIFIER and
- * COMMAND_LOCK. MODIFIER mode clears gate_state on
- * keypress, and sets gate_state on keyrelease.
- * COMMAND_LOCK mode toggles gate_state on
- * or off.
- *
- * gate_closed:
- * A flag that is set/cleared in the xtrap_keyboard
- * routine that indicates whether intercepted input
- * should be passed to the server at any particular
- * instance.
- *
- *
- * next_key:
- * This variable tracks the state of the next key to be
- * pressed or released. It allows the checking of double
- * presses of the command key to be sent to the server and
- * keeps good state order when the command key is used.
- *
- * key_ignore:
- * This variable indicates whether or not the specific
- * key should be ignored for subsequent server processing.
- *
- */
-int XETrapKeyboard(xEvent *x_event, DevicePtr keybd, int count)
-{
- register BYTE type = x_event->u.u.type;
- register BYTE detail = x_event->u.u.detail;
- XETrapEnv *penv;
- ClientList *stc = &stats_clients;
- ClientList *cmc = &cmd_clients;
- int_function cur_func = XETrapKeyboard;
-
-#ifdef VERBOSE
- if (count != 1L)
- { /* We haven't coded for this situation yet! */
- ErrorF("Warning! Event count != 1 (%d)\n", count);
- }
-#endif
- while (stc->next != NULL)
- { /* increment appropriate stats bucket for each interested client */
- stc = stc->next;
- penv = XETenv[stc->client->index];
- if (BitIsTrue(penv->cur.data_config_flags_event,type))
- { /* This particular client would like this particular stat */
- penv->stats->data.events[type]++;
- }
- }
-#ifndef VECTORED_EVENTS
- /* We *only* StampAndMail command keys with vectored events since
- * we get much more data by waiting till we get called in XETrapEventVector
- */
- XETrapStampAndMail(x_event); /* send to XTrap client if necessry */
-#endif
- while (cmc->next != NULL)
- {
- cmc = cmc->next;
- penv = XETenv[cmc->client->index];
- key_ignore = False;
- if (detail == penv->cur.data_config_cmd_key)
- {
- if (BitIsTrue(penv->cur.data_config_flags_data, XETrapCmdKeyMod))
- {
- switch (type)
- {
- case KeyPress:
- if (next_key == XEKeyIsEcho)
- {
- break;
- }
- gate_closed = True;
- next_key = XEKeyIsClear;
- break;
-
- case KeyRelease:
- if (next_key == XEKeyIsEcho)
- {
- next_key = XEKeyIsClear;
- break;
- }
- if (next_key == XEKeyIsClear)
- {
- next_key = XEKeyIsEcho;
- }
- else
- { /* it's Other, so Clear it */
- next_key = XEKeyIsClear;
- }
- gate_closed = False;
- key_ignore = True;
- break;
-
- default: break;
- }
- }
- else
- {
- switch (type)
- {
- case KeyPress:
- if (next_key == XEKeyIsEcho)
- {
- gate_closed = False;
- break;
- }
- /* Open gate on cmd key release */
- if ((next_key == XEKeyIsOther) &&
- gate_closed == True)
- {
- break;
- }
- gate_closed = True;
- next_key = XEKeyIsClear;
- break;
-
- case KeyRelease:
- if (next_key == XEKeyIsClear)
- {
- next_key = XEKeyIsEcho;
- break;
- }
-
- if (next_key == XEKeyIsEcho)
- {
- next_key = XEKeyIsClear;
- break;
- }
-
- gate_closed = False;
- key_ignore = True;
- next_key = XEKeyIsClear;
- break;
-
- default:
- break;
- }
- }
- }
- else
- {
- next_key = XEKeyIsOther;
- }
- }
-
- /*
- * If the gate to the server is open,
- * and we are not ignoring a keyrelease,
- * pass the event to the server for normal processing.
- */
-#ifndef VECTORED_EVENTS
- if ((gate_closed == False) && (key_ignore == False))
- {
- if (XETrapEventProcVector[type] != cur_func)
- { /* to protect us from infinite loops */
- (void)(*XETrapEventProcVector[type])(x_event,keybd,count);
- }
- else
- {
- (void)(*EventProcVector[type])(x_event,keybd,count);
- }
- }
-#else /* VECTORED_EVENTS */
- if ((gate_closed == False) && (key_ignore == False))
- { /* send event on to server to be trapped again in XETrapEventVector */
- (void)(*keybd_process_inp)(x_event,keybd,count);
- }
- else
- {
- XETrapStampAndMail(x_event); /* send to XTrap client if necessry */
- }
-#endif
- key_ignore = False; /* reset for next time around */
- return 0;
-}
-
-/*
- * DESCRIPTION:
- *
- * This routine intercepts input xEvents from the pointer device
- * and passes the input event back to the server for normal processing.
- *
- * This routine is sensitive to whether input is being passed
- * up to the server or not. This state is set by the keyboard
- * input routine.
- *
- *
- */
-#ifndef VECTORED_EVENTS
-int XETrapPointer(xEvent *x_event, DevicePtr ptrdev, int count)
-{
- XETrapEnv *penv;
- ClientList *stc = &stats_clients;
- int_function cur_func = XETrapPointer;
-
-#ifdef VERBOSE
- if (count != 1L)
- { /* We haven't coded for this situation yet! */
- ErrorF("Warning! Event count != 1 (%d)\n", count);
- }
-#endif
- while (stc->next != NULL)
- { /* increment appropriate stats bucket for each interested client */
- stc = stc->next;
- penv = XETenv[stc->client->index];
- if (BitIsTrue(penv->cur.data_config_flags_event,x_event->u.u.type))
- { /* This particular client would like this particular stat */
- penv->stats->data.events[x_event->u.u.type]++;
- }
- }
- XETrapStampAndMail(x_event); /* send to XTrap client if necessry */
- /*
- * If the gate to the server is open,
- * pass the event up like nothing has happened.
- */
- if (gate_closed == False)
- {
- if (XETrapEventProcVector[x_event->u.u.type] != cur_func)
- { /* to protect us from infinite loops */
- (void)(*XETrapEventProcVector[x_event->u.u.type])(x_event,ptrdev,
- count);
- }
- else
- {
- (void)(*EventProcVector[x_event->u.u.type])(x_event,ptrdev,count);
- }
- }
- return 0;
-}
-#endif /* !VECTORED_EVENTS */
-
-
-/*
- * DESCRIPTION:
- *
- * This routine determines whether it needs to send event data
- * to the XTrap Client(s). If so, it timestamps it appropriately
- * and writes out both the header and detail information.
- *
- */
-void XETrapStampAndMail(xEvent *x_event)
-{
- XETrapDatum data;
- register CARD32 size;
- XETrapEnv *penv;
- ClientList *ioc = &io_clients;
-
- /* Currently, we're intercepting core events *before* most
- * of the event information's filled in. Specifically, the
- * only fields that are valid at this level are: type, detail,
- * time, rootX, rootY, and state.
- */
- /* Loop through all clients wishing I/O */
- while (ioc->next != NULL)
- {
- ioc = ioc->next;
- penv = XETenv[ioc->client->index];
- /* Do we have a valid fd? Do we care about this event? */
- if (BitIsTrue(penv->cur.data_config_flags_event, x_event->u.u.type))
- {
- XETrapSetHeaderEvent(&(data.hdr));
- data.hdr.win_x = data.hdr.win_y = -1L; /* Invalidate req draw */
- data.hdr.screen = 0L; /* not till Events are vectored! */
- data.hdr.client = 0L; /* not till Events are vectored! */
- if (BitIsTrue(penv->cur.data_config_flags_data,
- XETrapTimestamp))
- {
- data.hdr.timestamp = GetTimeInMillis();
- }
- size = data.hdr.count = XETrapMinPktSize; /* Always for evts */
- penv->last_input_time = x_event->u.keyButtonPointer.time;
- /* Copy the event information into our local memory */
- (void)memcpy(&(data.u.event),x_event,sizeof(xEvent));
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension &&
- (data.u.event.u.u.type == MotionNotify ||
- data.u.event.u.u.type == ButtonPress ||
- data.u.event.u.u.type == ButtonRelease ||
- data.u.event.u.u.type == KeyPress ||
- data.u.event.u.u.type == KeyRelease)) {
- int scr = XineramaGetCursorScreen();
- data.u.event.u.keyButtonPointer.rootX +=
- panoramiXdataPtr[scr].x - panoramiXdataPtr[0].x;
- data.u.event.u.keyButtonPointer.rootY +=
- panoramiXdataPtr[scr].y - panoramiXdataPtr[0].y;
- }
-#endif
-
- if (penv->client->swapped)
- { /*
- * Notice that we don't swap the XTRAP EVENT information.
- * This is done in the XETrapWriteXLib() routine.
- */
- xEvent ToEvent;
- (*EventSwapVector[data.u.event.u.u.type & 0177])
- (&data.u.event,&ToEvent);
- (void)memcpy(&(data.u.event),&ToEvent,sizeof(ToEvent));
- sXETrapHeader(&(data.hdr)); /* swap the XTrap Header */
- }
- /* From this point on, the contents of data is swapped and
- * therefore we should not refer to it for information.
- */
- if (XETrapWriteXLib(penv, (BYTE *)&data, size) != size)
- {
- SendErrorToClient(penv->client,
- XETrap_avail.data.major_opcode,
- x_event->u.u.type, 0L, XETrapErrorBase + BadIO);
- }
- }
- }
- return;
-}
-#ifdef VECTORED_EVENTS
-int XETrapEventVector(ClientPtr client, xEvent *x_event)
-{
- XETrapDatum data;
- register CARD32 size;
- XETrapEnv *penv;
- ClientList *ioc = &io_clients;
-
- /* Loop through all clients wishing I/O */
- while (ioc->next != NULL)
- {
- ioc = ioc->next;
- penv = XETenv[ioc->client->index];
- /* Do we care about this event? */
- if (BitIsTrue(penv->cur.data_config_flags_event, x_event->u.u.type))
- {
- XETrapSetHeaderEvent(&(data.hdr));
- data.hdr.client = client->index;
- data.hdr.win_x = data.hdr.win_y = -1L; /* Invalidate req draw */
- if ((current_screen < 0L) || ((x_event->u.u.type >= KeyPress) &&
- (x_event->u.u.type <= MotionNotify) &&
- (!x_event->u.keyButtonPointer.sameScreen)))
- { /* we've moved/warped to another screen */
- WindowPtr root_win = GetCurrentRootWindow();
- current_screen = root_win->drawable.pScreen->myNum;
- }
- data.hdr.screen = current_screen;
- if (BitIsTrue(penv->cur.data_config_flags_data,
- XETrapTimestamp))
- {
- data.hdr.timestamp = GetTimeInMillis();
- }
- size = data.hdr.count = XETrapMinPktSize; /* Always for evts */
- penv->last_input_time = x_event->u.keyButtonPointer.time;
- /* Copy the event information into our local memory */
- (void)memcpy(&(data.u.event),x_event,sizeof(xEvent));
-
- if (penv->client->swapped)
- {
- xEvent ToEvent;
- (*EventSwapVector[data.u.event.u.u.type & 0177])
- (&data.u.event,&ToEvent);
- (void)memcpy(&(data.u.event),&ToEvent,sizeof(ToEvent));
- sXETrapHeader(&(data.hdr)); /* swap the XTrap Header */
- }
- /* From this point on, the contents of pdata is swapped and
- * therefore we should not refer to it for information.
- */
- if (XETrapWriteXLib(penv, (BYTE *)&data, size) != size)
- {
- SendErrorToClient(penv->client,
- XETrap_avail.data.major_opcode,
- x_event->u.u.type, 0L, XETrapErrorBase + BadIO);
- }
- }
- }
- return;
-}
-#endif /* VECTORED_EVENTS */
-void sReplyXTrapDispatch(ClientPtr client, int size, char *reply)
-{
- register XETrapRepHdr *rep = (XETrapRepHdr *)reply;
-
- switch(rep->detail)
- {
- case XETrap_GetAvailable:
- {
- xXTrapGetAvailReply lrep;
- (void)memcpy((char *)&lrep,reply,sizeof(lrep));
- sReplyXETrapGetAvail(client,size,(char *)&lrep);
- }
- break;
- case XETrap_GetCurrent:
- {
- xXTrapGetCurReply lrep;
- (void)memcpy((char *)&lrep,reply,sizeof(lrep));
- sReplyXETrapGetCur(client,size,(char *)&lrep);
- }
- break;
- case XETrap_GetStatistics:
- {
- xXTrapGetStatsReply lrep;
- (void)memcpy((char *)&lrep,reply,sizeof(lrep));
- sReplyXETrapGetStats(client,size,(char *)&lrep);
- }
- break;
- case XETrap_GetVersion:
- {
- xXTrapGetVersReply lrep;
- (void)memcpy((char *)&lrep,reply,sizeof(lrep));
- sReplyXETrapGetVers(client,size,(char *)&lrep);
- }
- break;
- case XETrap_GetLastInpTime:
- {
- xXTrapGetLITimReply lrep;
- (void)memcpy((char *)&lrep,reply,sizeof(lrep));
- sReplyXETrapGetLITim(client,size,(char *)&lrep);
- }
- break;
- default:
- SendErrorToClient(client,XETrap_avail.data.major_opcode,
- rep->detail, 0L, BadImplementation);
- break;
- }
- return;
-}
-
-/*
- * XLib communications routines
- */
-
-/*
- * DESCRIPTION:
- *
- * This function performs the transport specific functions required
- * for writing data back to an XTrap client over XLib. The trick is
- * packaging the data into <=32 byte packets to conform to the sizeof
- * an X Event. nbytes must be at least equal to XETrapMinPktSize
- *
- */
-int XETrapWriteXLib(XETrapEnv *penv, BYTE *data, CARD32 nbytes)
-{
- CARD32 size, total = 0L;
- xETrapDataEvent event;
-
- /* Initialize the detail field to show the beginning of a datum */
- event.detail = XETrapDataStart;
- event.idx = 0L;
-
- /* This loop could be optimized by not calling Write until after all
- * of the events are packaged. However, this would require memory
- * games, and may not therefore be a win.
- */
- while (nbytes > 0L)
- { /* How many bytes can we send in this packet */
- size = (nbytes > sz_EventData) ? sz_EventData : nbytes;
-
- /* Initialize the event */
- event.type = XETrapData + XETrap_avail.data.event_base;
- event.sequenceNumber = penv->client->sequence;
-
- /* Copy the data we are sending */
- (void)memcpy(event.data,data,size);
- if (size < sz_EventData)
- (void)memset(event.data+size,0L,sz_EventData-size);
- data += size;
- nbytes -= size;
- total += size;
-
- /* Set the detail field to show the continuation of datum */
- if (total != size)
- { /* this is not the first one */
- event.detail = (nbytes > 0) ? XETrapDataContinued : XETrapDataLast;
- }
-
- /* Send this part to the client */
- WriteEventsToClient(penv->client, 1L, (xEvent *) &event);
- event.idx++; /* Bump the index for the next event */
- }
- return(total);
-}
-
-/*----------------------------*
- * Static Functions
- *----------------------------*/
-
-static void update_protocol(xXTrapGetReq *reqptr, ClientPtr client)
-{
- XETrapEnv *penv = XETenv[client->index];
- /* update protocol number */
- switch (reqptr->protocol)
- {
- /* known acceptable protocols */
- case 31:
- case XETrapProtocol:
- penv->protocol = reqptr->protocol;
- break;
- /* all else */
- default: /* stay backwards compatible */
- penv->protocol = 31;
- break;
- }
-}
-
-/* Swap 2 functions. This is a function instead of a macro to help to keep
- * lint from complaining about mixed types. It seems to work, but I would
- * probably classify this as a hack.
- */
-static void _SwapProc( register int (**f1)(), register int (**f2)())
-{
- register int (*t1)() = *f1;
- *f1 = *f2;
- *f2 = t1;
-
- return;
-}
-
-/*
- * DESCRIPTION:
- *
- * This function swaps the byte order of fields within
- * the XTrap Event Header. It assumes the data will be
- * swapped by code in XETrapRequestVector().
- *
- */
-static void sXETrapEvent(xETrapDataEvent *from, xETrapDataEvent *to)
-{
- to->type = from->type;
- to->detail = from->detail;
- cpswaps(from->sequenceNumber,to->sequenceNumber);
- cpswapl(from->idx,to->idx);
- /* Assumes that the data's already been swapped by XETrapRequestVector */
- memcpy(to->data, from->data, SIZEOF(EventData));
-}
-
-/*
- * DESCRIPTION:
- *
- * This function adds a node from an accelerator linked-list
- * (either io_clients, stats_clients, or cmd_clients).
- *
- */
-static int add_accelerator_node(ClientPtr client, ClientList *accel)
-{
- Bool found = False;
- int status = Success;
-
- while (accel->next != NULL)
- {
- if (accel->client == client)
- {
- found = True; /* Client's already known */
- break;
- }
- else
- {
- accel = accel->next;
- }
- }
- if (found == False)
- {
- if ((accel->next = (ClientList *)Xcalloc(sizeof(ClientList))) == NULL)
- {
- status = BadAlloc;
- }
- else
- { /* fill in the node */
- accel = accel->next;
- accel->next = NULL;
- accel->client = client;
- }
- }
- return(status);
-}
-/*
- * DESCRIPTION:
- *
- * This function removes a node from an accelerator linked-list
- * (either io_clients, stats_clients, or cmd_clients).
- *
- */
-static void remove_accelerator_node(ClientPtr client, ClientList *accel)
-{
- while (accel->next != NULL)
- {
- if (accel->next->client == client)
- {
- ClientList *tmp = accel->next->next;
- Xfree(accel->next);
- accel->next = tmp;
- break;
- }
- else
- {
- accel = accel->next;
- }
- }
-
- return;
-}
-
-#ifdef COLOR_REPLIES
-static void GetSendColorRep(ClientPtr client, xResourceReq *req)
-{ /* adapted from ProcAllocColor() in dispatch.c */
- XETrapDatum data;
- int retval;
- XETrapEnv *penv = XETenv[client->index];
- xAllocColorReply *crep = (xAllocColorReply *)&(data.u.reply);
- xAllocColorReq *creq = (xAllocColorReq *)req;
- ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP);
-
- /* Fill in the header fields */
- data.hdr.count = XETrapMinPktSize; /* The color replies are 32 bytes */
- XETrapSetHeaderReply(&(data.hdr));
- /* Hack alert:
- * We need to pass the "reply" type in the header since replies don't
- * contain the id's themselves. However, we're not changing the
- * protocol to support this until we decide exactly how we want to
- * do *all* replies (e.g. not just ColorReplies). So until then, stow
- * the reply id in the screen field which wouldn't normally be used in
- * this context.
- */
- data.hdr.screen = req->reqType;
- if (!pmap)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadColor);
- return;
- }
- crep->red = creq->red;
- crep->green = creq->green;
- crep->blue = creq->blue;
- crep->pixel = 0;
- if ((retval = AllocColor(pmap, &(crep->red), &(crep->green),
- &(crep->blue), &(crep->pixel), client->index)) != Success)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, retval);
- return;
- }
- /* Swap data if necessary */
- if (client->swapped)
- {
- INT32 n;
- swaps(&(crep->red), n);
- swaps(&(crep->green), n);
- swaps(&(crep->blue), n);
- swapl(&(crep->pixel), n);
- }
- /* Send data to client */
- if (XETrapWriteXLib(penv, (BYTE *)&data, XETrapMinPktSize)
- != XETrapMinPktSize)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, XETrapErrorBase + BadIO);
- }
-}
-
-static void GetSendNamedColorRep(ClientPtr client, xResourceReq *req)
-{ /* adapted from ProcAllocNamedColor() in dispatch.c */
- XETrapDatum data;
- XETrapEnv *penv = XETenv[client->index];
- int retval;
- xAllocNamedColorReply *nrep = (xAllocNamedColorReply *)&(data.u.reply);
- xAllocNamedColorReq *nreq = (xAllocNamedColorReq *)req;
- ColormapPtr pcmp = (ColormapPtr )LookupIDByType(nreq->cmap, RT_COLORMAP);
-
- data.hdr.count = XETrapMinPktSize; /* The color replies are 32 bytes */
- XETrapSetHeaderReply(&(data.hdr));
- /* Hack alert:
- * We need to pass the "reply" type in the header since replies don't
- * contain the id's themselves. However, we're not changing the
- * protocol to support this until we decide exactly how we want to
- * do *all* replies (e.g. not just ColorReplies). So until then, stow
- * the reply id in the screen field which wouldn't normally be used in
- * this context.
- */
- data.hdr.screen = req->reqType;
- if (!pcmp)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadColor);
- return;
- }
- if (!OsLookupColor(pcmp->pScreen->myNum, (char *)&nreq[1],
- nreq->nbytes, &(nrep->exactRed), &(nrep->exactGreen),
- &(nrep->exactBlue)))
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadName);
- return;
- }
- nrep->screenRed = nrep->exactRed;
- nrep->screenGreen = nrep->exactGreen;
- nrep->screenBlue = nrep->exactBlue;
- nrep->pixel = 0;
- if ((retval = AllocColor(pcmp, &(nrep->screenRed),
- &(nrep->screenGreen), &(nrep->screenBlue), &(nrep->pixel),
- client->index)) != Success)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, retval);
- return;
- }
- /* Swap data if necessary */
- if (client->swapped)
- {
- INT32 n;
- swapl(&(nrep->pixel), n);
- swaps(&(nrep->exactRed), n);
- swaps(&(nrep->exactGreen), n);
- swaps(&(nrep->exactBlue), n);
- swaps(&(nrep->screenRed), n);
- swaps(&(nrep->screenGreen), n);
- swaps(&(nrep->screenBlue), n);
- }
-
- /* Send data to client */
- if (XETrapWriteXLib(penv, (BYTE *)&data, XETrapMinPktSize)
- != XETrapMinPktSize)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, XETrapErrorBase + BadIO);
- }
-}
-
-static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req)
-{ /* adapted from ProcAllocColorCells() in dispatch.c */
- int retval;
- int npixels, nmasks;
- unsigned long *ppixels, *pmasks;
- long length;
- XETrapDatum *data;
- XETrapEnv *penv = XETenv[client->index];
- xAllocColorCellsReply *crep;
- xAllocColorCellsReq *creq = (xAllocColorCellsReq *)req;
- ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP);
-
- if (!pmap)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadColor);
- return;
- }
- npixels = creq->colors;
- if (!npixels)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadValue);
- return;
- }
- nmasks = creq->planes;
- length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
- data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length);
- if (!data)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadAlloc);
- return;
- }
- data->hdr.count = MIN(penv->cur.data_config_max_pkt_size,
- sizeof(XETrapDatum)+length);
- XETrapSetHeaderReply(&(data->hdr));
- data->hdr.screen = req->reqType; /* hack! but necessary */
- ppixels = (unsigned long *)((char *)data + sizeof(XETrapDatum));
- pmasks = ppixels + npixels;
- if ((retval = AllocColorCells(client->index, pmap, npixels,
- nmasks, (Bool)creq->contiguous, ppixels, pmasks)) != Success)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, retval);
- DEALLOCATE_LOCAL(data);
- return;
- }
- crep = (xAllocColorCellsReply *)&(data->u.reply);
- crep->nPixels = npixels;
- crep->nMasks = nmasks;
- /* Swap data if necessary */
- if (client->swapped)
- {
- INT32 n, i, *ptr;
- ptr=(INT32 *)ppixels;
- swaps(&(crep->nPixels), n);
- swaps(&(crep->nMasks), n);
- for (i=0; i<length; i++)
- {
- swapl(&(ptr[i]), n);
- }
- }
- /* Send data to client */
- if (XETrapWriteXLib(penv, (BYTE *)&data, data->hdr.count)
- != data->hdr.count)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, XETrapErrorBase + BadIO);
- }
- DEALLOCATE_LOCAL(data);
-}
-static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req)
-{ /* adapted from ProcAllocColorPlanes() in dispatch.c */
- int retval;
- int npixels, nmasks;
- unsigned long *ppixels, *pmasks;
- long length;
- XETrapDatum *data;
- XETrapEnv *penv = XETenv[client->index];
- xAllocColorPlanesReply *crep;
- xAllocColorPlanesReq *creq = (xAllocColorPlanesReq *)req;
- ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP);
-
- if (!pmap)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadColor);
- return;
- }
- npixels = creq->colors;
- if (!npixels)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadValue);
- return;
- }
- length = (long)npixels * sizeof(Pixel);
- data = (XETrapDatum *)ALLOCATE_LOCAL(sizeof(XETrapDatum)+length);
- if (!data)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, BadAlloc);
- return;
- }
- data->hdr.count = MIN(penv->cur.data_config_max_pkt_size,
- sizeof(XETrapDatum)+length);
- XETrapSetHeaderReply(&(data->hdr));
- data->hdr.screen = req->reqType; /* hack! but necessary */
- ppixels = (unsigned long *)((char *)data + sizeof(XETrapDatum));
- crep = (xAllocColorPlanesReply *)&(data->u.reply);
- if ((retval = AllocColorPlanes(client->index, pmap, npixels,
- (int)creq->red, (int)creq->green, (int)creq->blue,
- (int)creq->contiguous, ppixels, &(crep->redMask), &(crep->greenMask),
- &(crep->blueMask))) != Success)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, retval);
- DEALLOCATE_LOCAL(data);
- return;
- }
- crep->nPixels = npixels;
- /* Swap data if necessary */
- if (client->swapped)
- {
- INT32 n, i, *ptr;
- ptr=(INT32 *)ppixels;
- swaps(&(crep->nPixels), n);
- swapl(&(crep->redMask), n);
- swapl(&(crep->greenMask), n);
- swapl(&(crep->blueMask), n);
- for (i=0; i<length; i++)
- {
- swapl(&(ptr[i]), n);
- }
- }
- /* Send data to client */
- if (XETrapWriteXLib(penv, (BYTE *)&data, data->hdr.count)
- != data->hdr.count)
- {
- SendErrorToClient(penv->client, XETrap_avail.data.major_opcode,
- req->reqType, 0L, XETrapErrorBase + BadIO);
- }
- DEALLOCATE_LOCAL(data);
-}
-#endif /* COLOR_REPLIES */
diff --git a/XTrap/xtrapdiswp.c b/XTrap/xtrapdiswp.c
deleted file mode 100644
index 435ca71f6..000000000
--- a/XTrap/xtrapdiswp.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/* $XFree86: xc/programs/Xserver/XTrap/xtrapdiswp.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */
-/****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991, 1992 by
-
- Digital Equipment Corp., Maynard, MA
-
-X11R6 Changes Copyright (c) 1994 by Robert Chesler of Absol-Puter, Hudson, NH.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL AND ABSOL-PUTER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL DIGITAL OR ABSOL-PUTER BE LIABLE FOR ANY
-SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-*****************************************************************************/
-/*
- * ABSTRACT:
- *
- * This module is the device independent module responsible for all
- * routines required for proper communication in a heterogeneous
- * networking environment (i.e. client & server on different endian
- * machines). The bulk of this module is patterned after X11/R4's
- * server/dix/swapreq.c ; however, they infact swap fields
- * in the exact opposite order since XTrap requires "unswapped" data
- * to become "swapped" before sending it to a "swapped" client.
- *
- * CONTRIBUTORS:
- *
- * Ken Miller
- * Marc Evans
- *
- * CHANGES:
- *
- * Robert Chesler - added client arg for X11R6 port in many spots
- *
- */
-
-#include <X11/X.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <X11/Xproto.h>
-#include <X11/Xprotostr.h>
-#include <X11/extensions/xtrapdi.h>
-#include "input.h" /* Server DevicePtr definitions */
-#include "misc.h"
-#include "dixstruct.h"
-#ifdef PC
-# include "extnsist.h"
-#else
-# include "extnsionst.h" /* Server ExtensionEntry definitions */
-#endif
-# include "swapreq.h" /* Server SwapColorItem definition */
-#include <X11/extensions/xtrapddmi.h>
-#include <X11/extensions/xtrapproto.h>
-
-/* In-coming XTrap requests needing to be swapped to native format */
-
-int sXETrapReset(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapReset(request,client));
-}
-
-int sXETrapGetAvailable(xXTrapGetReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- swaps(&(request->protocol),n);
- return(XETrapGetAvailable(request,client));
-}
-
-int sXETrapConfig(xXTrapConfigReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- swaps(&(request->config_max_pkt_size),n);
- return(XETrapConfig(request,client));
-}
-
-int sXETrapStartTrap(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapStartTrap(request,client));
-}
-
-int sXETrapStopTrap(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapStopTrap(request,client));
-}
-
-int sXETrapGetCurrent(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapGetCurrent(request,client));
-}
-
-int sXETrapGetStatistics(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapGetStatistics(request,client));
-}
-
-#ifndef _XINPUT
-int sXETrapSimulateXEvent(xXTrapInputReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->input.x),n);
- swaps(&(request->input.y),n);
- return(XETrapSimulateXEvent(request,client));
-}
-#endif
-
-int sXETrapGetVersion(xXTrapGetReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- swaps(&(request->protocol),n);
- return(XETrapGetVersion(request,client));
-}
-
-int sXETrapGetLastInpTime(xXTrapReq *request, ClientPtr client)
-{
- register char n;
- swaps(&(request->length),n);
- return(XETrapGetLastInpTime(request,client));
-}
-
-
-/* Out-going XTrap replies needing to be swapped *from* native format */
-
-void sReplyXETrapGetAvail(ClientPtr client, int size, char *reply)
-{
- xXTrapGetAvailReply *rep = (xXTrapGetAvailReply *)reply;
- register char n;
- swaps(&(rep->hdr.sequenceNumber),n);
- swapl(&(rep->hdr.length),n);
- swapl(&(rep->data.pf_ident),n);
- swaps(&(rep->data.xtrap_release),n);
- swaps(&(rep->data.xtrap_version),n);
- swaps(&(rep->data.xtrap_revision),n);
- swaps(&(rep->data.max_pkt_size),n);
- swapl(&(rep->data.major_opcode),n);
- swapl(&(rep->data.event_base),n);
- swaps(&(rep->data.cur_x),n);
- swaps(&(rep->data.cur_y),n);
- (void)WriteToClient(client,size,reply);
- return;
-}
-void sReplyXETrapGetVers(ClientPtr client, int size, char *reply)
-{
- xXTrapGetVersReply *rep = (xXTrapGetVersReply *)reply;
- register char n;
- swaps(&(rep->hdr.sequenceNumber),n);
- swapl(&(rep->hdr.length),n);
- swaps(&(rep->data.xtrap_release),n);
- swaps(&(rep->data.xtrap_version),n);
- swaps(&(rep->data.xtrap_revision),n);
- (void)WriteToClient(client,size,reply);
- return;
-}
-void sReplyXETrapGetLITim(ClientPtr client, int size, char *reply)
-{
- xXTrapGetLITimReply *rep = (xXTrapGetLITimReply *)reply;
- register char n;
- swaps(&(rep->hdr.sequenceNumber),n);
- swapl(&(rep->hdr.length),n);
- swapl(&(rep->data_last_time),n);
- (void)WriteToClient(client,size,reply);
- return;
-}
-void sReplyXETrapGetCur(ClientPtr client, int size, char *reply)
-{
- xXTrapGetCurReply *rep = (xXTrapGetCurReply *)reply;
- register char n;
- swaps(&(rep->hdr.sequenceNumber),n);
- swapl(&(rep->hdr.length),n);
- swaps(&(rep->data_config_max_pkt_size),n);
- (void)WriteToClient(client,size,reply);
- return;
-}
-void sReplyXETrapGetStats(ClientPtr client, int size, char *reply)
-{
- xXTrapGetStatsReply *rep = (xXTrapGetStatsReply *)reply;
- register char n;
- register int i;
- long *p;
-
- swaps(&(rep->sequenceNumber),n);
- swapl(&(rep->length),n);
- for (i=0L, p = (long *)rep->data.requests; i<256L; i++, p++)
- {
- swapl(p,n);
- }
- for (i=0L, p = (long *)rep->data.events; i<XETrapCoreEvents; i++, p++)
- {
- swapl(p,n);
- }
- (void)WriteToClient(client,size,reply);
- return;
-}
-
-/* Out-going XTrap I/O header needing to be swapped *from* native format */
-
-void sXETrapHeader(XETrapHeader *hdr)
-{
- register char n;
-
- swapl(&(hdr->count), n);
- swapl(&(hdr->timestamp), n);
- swaps(&(hdr->win_x), n);
- swaps(&(hdr->win_y), n);
- swaps(&(hdr->client), n);
-}
-
- /* Out-going requests needing to be swapped *from* native format
- * aka swapreq.c "equivalents"
- */
-
-/* The following is used for all requests that have
- no fields to be swapped (except "length") */
-void XETSwSimpleReq(register xReq *data)
-{
- register char n;
- swaps(&(data->length), n);
-}
-
-/* The following is used for all requests that have
- only a single 32-bit field to be swapped, coming
- right after the "length" field */
-
-void XETSwResourceReq(register xResourceReq *data)
-{
- register char n;
-
- swaps(&(data->length), n);
- swapl(&(data->id), n);
-}
-
-void XETSwCreateWindow(register xCreateWindowReq *data,ClientPtr client)
-{
- register char n;
-
- swapl(&(data->wid), n);
- swapl(&(data->parent), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
- swaps(&(data->borderWidth), n);
- swaps(&(data->class), n);
- swapl(&(data->visual), n);
- swapl(&(data->mask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwChangeWindowAttributes(register xChangeWindowAttributesReq *data,
-ClientPtr client)
-{
- register char n;
-
- swapl(&(data->window), n);
- swapl(&(data->valueMask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwReparentWindow(register xReparentWindowReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->parent), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
-}
-
-void XETSwConfigureWindow(xConfigureWindowReq *data, ClientPtr client)
-{
- register char n;
- swapl(&(data->window), n);
- swaps(&(data->mask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-
-void XETSwInternAtom(register xInternAtomReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwChangeProperty(register xChangePropertyReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->property), n);
- swapl(&(data->type), n);
- switch ( data->format ) {
- case 8L : break;
- case 16L:
- SwapShorts((short *)(data + 1), data->nUnits);
- break;
- case 32L:
- SwapLongs((CARD32 *)(data + 1), data->nUnits);
- break;
- }
- swapl(&(data->nUnits), n);
-}
-
-void XETSwDeleteProperty(register xDeletePropertyReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->property), n);
-
-}
-void XETSwGetProperty(register xGetPropertyReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->property), n);
- swapl(&(data->type), n);
- swapl(&(data->longOffset), n);
- swapl(&(data->longLength), n);
-}
-
-void XETSwSetSelectionOwner(register xSetSelectionOwnerReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->selection), n);
- swapl(&(data->time), n);
-}
-
-void XETSwConvertSelection(register xConvertSelectionReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->requestor), n);
- swapl(&(data->selection), n);
- swapl(&(data->target), n);
- swapl(&(data->property), n);
- swapl(&(data->time), n);
-}
-
-void XETSwSendEvent(register xSendEventReq *data)
-{
- register char n;
- xEvent eventT;
- void (*proc)();
- swapl(&(data->destination), n);
- swapl(&(data->eventMask), n);
-
- /* Swap event */
- proc = EventSwapVector[data->event.u.u.type & 0177];
- if (!proc || (int (*)()) proc == (int (*)()) NotImplemented)
- (*proc)(&(data->event), &eventT);
- data->event = eventT;
- swaps(&(data->length), n);
-}
-
-void XETSwGrabPointer(register xGrabPointerReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swaps(&(data->eventMask), n);
- swapl(&(data->confineTo), n);
- swapl(&(data->cursor), n);
- swapl(&(data->time), n);
-}
-
-void XETSwGrabButton(register xGrabButtonReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swaps(&(data->eventMask), n);
- swapl(&(data->confineTo), n);
- swapl(&(data->cursor), n);
- swaps(&(data->modifiers), n);
-}
-
-void XETSwUngrabButton(register xUngrabButtonReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swaps(&(data->modifiers), n);
-}
-
-void XETSwChangeActivePointerGrab(register xChangeActivePointerGrabReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cursor), n);
- swapl(&(data->time), n);
- swaps(&(data->eventMask), n);
-}
-
-void XETSwGrabKeyboard(register xGrabKeyboardReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swapl(&(data->time), n);
-}
-
-void XETSwGrabKey(register xGrabKeyReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swaps(&(data->modifiers), n);
-}
-
-void XETSwUngrabKey(register xUngrabKeyReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->grabWindow), n);
- swaps(&(data->modifiers), n);
-}
-
-void XETSwGetMotionEvents(register xGetMotionEventsReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swapl(&(data->start), n);
- swapl(&(data->stop), n);
-}
-
-void XETSwTranslateCoords(register xTranslateCoordsReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->srcWid), n);
- swapl(&(data->dstWid), n);
- swaps(&(data->srcX), n);
- swaps(&(data->srcY), n);
-}
-
-void XETSwWarpPointer(register xWarpPointerReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->srcWid), n);
- swapl(&(data->dstWid), n);
- swaps(&(data->srcX), n);
- swaps(&(data->srcY), n);
- swaps(&(data->srcWidth), n);
- swaps(&(data->srcHeight), n);
- swaps(&(data->dstX), n);
- swaps(&(data->dstY), n);
-}
-
-void XETSwSetInputFocus(register xSetInputFocusReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->focus), n);
- swapl(&(data->time), n);
-}
-
-void XETSwOpenFont(register xOpenFontReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->fid), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwListFonts(register xListFontsReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->maxNames), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwListFontsWithInfo(register xListFontsWithInfoReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->maxNames), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwSetFontPath(register xSetFontPathReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->nFonts), n);
-}
-
-void XETSwCreatePixmap(register xCreatePixmapReq *data)
-{
- register char n;
-
- swaps(&(data->length), n);
- swapl(&(data->pid), n);
- swapl(&(data->drawable), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
-}
-
-void XETSwCreateGC(register xCreateGCReq *data, ClientPtr client)
-{
- register char n;
- swapl(&(data->gc), n);
- swapl(&(data->drawable), n);
- swapl(&(data->mask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwChangeGC(register xChangeGCReq *data, ClientPtr client)
-{
- register char n;
- swapl(&(data->gc), n);
- swapl(&(data->mask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwCopyGC(register xCopyGCReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->srcGC), n);
- swapl(&(data->dstGC), n);
- swapl(&(data->mask), n);
-}
-
-void XETSwSetDashes(register xSetDashesReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->gc), n);
- swaps(&(data->dashOffset), n);
- swaps(&(data->nDashes), n);
-}
-
-void XETSwSetClipRectangles(register xSetClipRectanglesReq *data, ClientPtr
-client)
-{
- register char n;
- swapl(&(data->gc), n);
- swaps(&(data->xOrigin), n);
- swaps(&(data->yOrigin), n);
- SwapRestS(data);
- swaps(&(data->length), n);
-}
-
-void XETSwClearToBackground(register xClearAreaReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->window), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
-}
-
-void XETSwCopyArea(register xCopyAreaReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->srcDrawable), n);
- swapl(&(data->dstDrawable), n);
- swapl(&(data->gc), n);
- swaps(&(data->srcX), n);
- swaps(&(data->srcY), n);
- swaps(&(data->dstX), n);
- swaps(&(data->dstY), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
-}
-
-void XETSwCopyPlane(register xCopyPlaneReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->srcDrawable), n);
- swapl(&(data->dstDrawable), n);
- swapl(&(data->gc), n);
- swaps(&(data->srcX), n);
- swaps(&(data->srcY), n);
- swaps(&(data->dstX), n);
- swaps(&(data->dstY), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
- swapl(&(data->bitPlane), n);
-}
-
-/* The following routine is used for all Poly drawing requests
- (except FillPoly, which uses a different request format) */
-void XETSwPoly(register xPolyPointReq *data, ClientPtr client)
-{
- register char n;
-
- swapl(&(data->drawable), n);
- swapl(&(data->gc), n);
- SwapRestS(data);
- swaps(&(data->length), n);
-}
- /* cannot use XETSwPoly for this one, because xFillPolyReq
- * is longer than xPolyPointReq, and we don't want to swap
- * the difference as shorts!
- */
-void XETSwFillPoly(register xFillPolyReq *data, ClientPtr client)
-{
- register char n;
-
- swapl(&(data->drawable), n);
- swapl(&(data->gc), n);
- SwapRestS(data);
- swaps(&(data->length), n);
-}
-
-void XETSwPutImage(register xPutImageReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->drawable), n);
- swapl(&(data->gc), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
- swaps(&(data->dstX), n);
- swaps(&(data->dstY), n);
- /* Image should already be swapped */
-}
-
-void XETSwGetImage(register xGetImageReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->drawable), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
- swapl(&(data->planeMask), n);
-}
-
-/* ProcPolyText used for both PolyText8 and PolyText16 */
-
-void XETSwPolyText(register xPolyTextReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->drawable), n);
- swapl(&(data->gc), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
-}
-
-/* ProcImageText used for both ImageText8 and ImageText16 */
-
-void XETSwImageText(register xImageTextReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->drawable), n);
- swapl(&(data->gc), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
-}
-
-void XETSwCreateColormap(register xCreateColormapReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->mid), n);
- swapl(&(data->window), n);
- swapl(&(data->visual), n);
-}
-
-
-void XETSwCopyColormapAndFree(register xCopyColormapAndFreeReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->mid), n);
- swapl(&(data->srcCmap), n);
-
-}
-
-void XETSwAllocColor (register xAllocColorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swaps(&(data->red), n);
- swaps(&(data->green), n);
- swaps(&(data->blue), n);
-}
-
-void XETSwAllocNamedColor (register xAllocNamedColorReq *data)
-{
- register char n;
-
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwAllocColorCells (register xAllocColorCellsReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swaps(&(data->colors), n);
- swaps(&(data->planes), n);
-}
-
-void XETSwAllocColorPlanes(register xAllocColorPlanesReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swaps(&(data->colors), n);
- swaps(&(data->red), n);
- swaps(&(data->green), n);
- swaps(&(data->blue), n);
-}
-
-void XETSwFreeColors (register xFreeColorsReq *data, ClientPtr
-client)
-{
- register char n;
- swapl(&(data->cmap), n);
- swapl(&(data->planeMask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-
-}
-
-void XETSwStoreColors (register xStoreColorsReq *data,ClientPtr
-client)
-{
- register char n;
- unsigned long count;
- xColorItem *pItem;
-
- swapl(&(data->cmap), n);
- pItem = (xColorItem *) &(data[1]);
- for(count = LengthRestB(data)/sizeof(xColorItem); count != 0; count--)
- SwapColorItem(pItem++);
- swaps(&(data->length), n);
-}
-
-void XETSwStoreNamedColor (register xStoreNamedColorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swapl(&(data->pixel), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwQueryColors(register xQueryColorsReq *data, ClientPtr client)
-{
- register char n;
- swapl(&(data->cmap), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwLookupColor(register xLookupColorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cmap), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwCreateCursor(register xCreateCursorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cid), n);
- swapl(&(data->source), n);
- swapl(&(data->mask), n);
- swaps(&(data->foreRed), n);
- swaps(&(data->foreGreen), n);
- swaps(&(data->foreBlue), n);
- swaps(&(data->backRed), n);
- swaps(&(data->backGreen), n);
- swaps(&(data->backBlue), n);
- swaps(&(data->x), n);
- swaps(&(data->y), n);
-}
-
-void XETSwCreateGlyphCursor(register xCreateGlyphCursorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cid), n);
- swapl(&(data->source), n);
- swapl(&(data->mask), n);
- swaps(&(data->sourceChar), n);
- swaps(&(data->maskChar), n);
- swaps(&(data->foreRed), n);
- swaps(&(data->foreGreen), n);
- swaps(&(data->foreBlue), n);
- swaps(&(data->backRed), n);
- swaps(&(data->backGreen), n);
- swaps(&(data->backBlue), n);
-}
-
-
-void XETSwRecolorCursor(register xRecolorCursorReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->cursor), n);
- swaps(&(data->foreRed), n);
- swaps(&(data->foreGreen), n);
- swaps(&(data->foreBlue), n);
- swaps(&(data->backRed), n);
- swaps(&(data->backGreen), n);
- swaps(&(data->backBlue), n);
-}
-
-void XETSwQueryBestSize (register xQueryBestSizeReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swapl(&(data->drawable), n);
- swaps(&(data->width), n);
- swaps(&(data->height), n);
-
-}
-
-void XETSwQueryExtension (register xQueryExtensionReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->nbytes), n);
-}
-
-void XETSwChangeKeyboardMapping (register xChangeKeyboardMappingReq *data)
-{
- register char n;
- register long *p;
- register int i, count;
-
- swaps(&(data->length), n);
- p = (long *)&(data[1]);
- count = data->keyCodes * data->keySymsPerKeyCode;
- for(i = 0; i < count; i++)
- {
- swapl(p, n);
- p++;
- }
-}
-
-
-void XETSwChangeKeyboardControl (register xChangeKeyboardControlReq *data,
- ClientPtr client)
-{
- register char n;
- swapl(&(data->mask), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-void XETSwChangePointerControl (register xChangePointerControlReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->accelNum), n);
- swaps(&(data->accelDenum), n);
- swaps(&(data->threshold), n);
-}
-
-
-void XETSwSetScreenSaver (register xSetScreenSaverReq *data)
-{
- register char n;
- swaps(&(data->length), n);
- swaps(&(data->timeout), n);
- swaps(&(data->interval), n);
-}
-
-void XETSwChangeHosts(register xChangeHostsReq *data)
-{
- register char n;
-
- swaps(&(data->length), n);
- swaps(&(data->hostLength), n);
-
-}
-void XETSwRotateProperties(register xRotatePropertiesReq *data, ClientPtr client)
-{
- register char n;
- swapl(&(data->window), n);
- swaps(&(data->nAtoms), n);
- swaps(&(data->nPositions), n);
- SwapRestL(data);
- swaps(&(data->length), n);
-}
-
-/*ARGSUSED*/
-void XETSwNoOperation(xReq *data)
-{
- /* noop -- don't do anything */
-}
-
-/* Byte swap a list of longs */
-#if defined vms && !defined MITR5
-#ifndef LINKED_IN
-void SwapLongs ( register long *list, register unsigned long count)
-{
- register char n;
-
- while (count >= 8) {
- swapl(list+0, n);
- swapl(list+1, n);
- swapl(list+2, n);
- swapl(list+3, n);
- swapl(list+4, n);
- swapl(list+5, n);
- swapl(list+6, n);
- swapl(list+7, n);
- list += 8;
- count -= 8;
- }
- if (count != 0) {
- do {
- swapl(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-/* Byte swap a list of shorts */
-
-void SwapShorts (register short *list, register unsigned long count)
-{
- register char n;
-
- while (count >= 16) {
- swaps(list+0, n);
- swaps(list+1, n);
- swaps(list+2, n);
- swaps(list+3, n);
- swaps(list+4, n);
- swaps(list+5, n);
- swaps(list+6, n);
- swaps(list+7, n);
- swaps(list+8, n);
- swaps(list+9, n);
- swaps(list+10, n);
- swaps(list+11, n);
- swaps(list+12, n);
- swaps(list+13, n);
- swaps(list+14, n);
- swaps(list+15, n);
- list += 16;
- count -= 16;
- }
- if (count != 0) {
- do {
- swaps(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-SwapColorItem(xColorItem *pItem)
-{
- register char n;
- swapl(&pItem->pixel, n);
- swaps(&pItem->red, n);
- swaps(&pItem->green, n);
- swaps(&pItem->blue, n);
-}
-#endif /* LINKED_IN */
-#endif /* vms */
diff --git a/XTrap/xtrapditbl.c b/XTrap/xtrapditbl.c
deleted file mode 100644
index db06e1cc2..000000000
--- a/XTrap/xtrapditbl.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/* $XFree86: xc/programs/Xserver/XTrap/xtrapditbl.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */
-/****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*****************************************************************************/
-/*
- * ABSTRACT:
- *
- * This module is contains Vector tables used for swapping and general
- * dispatch by the XTrap server extension.
- *
- * CONTRIBUTORS:
- *
- * Ken Miller
- * Marc Evans
- *
- */
-
-/*-----------------*
- * Include Files *
- *-----------------*/
-#include <X11/X.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <X11/Xproto.h>
-#include <X11/Xprotostr.h>
-#include <X11/extensions/xtrapdi.h>
-#include "input.h" /* Server DevicePtr definitions */
-#include "misc.h"
-#include "dixstruct.h"
-#ifdef PC
-# include "extnsist.h"
-#else
-# include "extnsionst.h" /* Server ExtensionEntry definitions */
-#endif
-#include <X11/extensions/xtrapddmi.h>
-#include <X11/extensions/xtrapproto.h>
-
-globaldef void_function XETSwProcVector[256L] =
-{
- (void_function)ProcBadRequest,
- XETSwCreateWindow,
- XETSwChangeWindowAttributes,
- XETSwResourceReq, /* GetWindowAttributes */
- XETSwResourceReq, /* DestroyWindow */
- XETSwResourceReq, /* 5 DestroySubwindows */
- XETSwResourceReq, /* XETSwChangeSaveSet, */
- XETSwReparentWindow,
- XETSwResourceReq, /* MapWindow */
- XETSwResourceReq, /* MapSubwindows */
- XETSwResourceReq, /* 10 UnmapWindow */
- XETSwResourceReq, /* UnmapSubwindows */
- XETSwConfigureWindow,
- XETSwResourceReq, /* XETSwCirculateWindow, */
- XETSwResourceReq, /* GetGeometry */
- XETSwResourceReq, /* 15 QueryTree */
- XETSwInternAtom,
- XETSwResourceReq, /* XETSwGetAtomName, */
- XETSwChangeProperty,
- XETSwDeleteProperty,
- XETSwGetProperty, /* 20 */
- XETSwResourceReq, /* XETSwListProperties, */
- XETSwSetSelectionOwner,
- XETSwResourceReq, /* XETSwGetSelectionOwner, */
- XETSwConvertSelection,
- XETSwSendEvent, /* 25 */
- XETSwGrabPointer,
- XETSwResourceReq, /* XETSwUngrabPointer, */
- XETSwGrabButton,
- XETSwUngrabButton,
- XETSwChangeActivePointerGrab, /* 30 */
- XETSwGrabKeyboard,
- XETSwResourceReq, /* XETSwUngrabKeyboard, */
- XETSwGrabKey,
- XETSwUngrabKey,
- XETSwResourceReq, /* 35 XETSwAllowEvents, */
- XETSwSimpleReq, /* XETSwGrabServer, */
- XETSwSimpleReq, /* XETSwUngrabServer, */
- XETSwResourceReq, /* XETSwQueryPointer, */
- XETSwGetMotionEvents,
- XETSwTranslateCoords, /*40 */
- XETSwWarpPointer,
- XETSwSetInputFocus,
- XETSwSimpleReq, /* XETSwGetInputFocus, */
- XETSwSimpleReq, /* QueryKeymap, */
- XETSwOpenFont, /* 45 */
- XETSwResourceReq, /* XETSwCloseFont, */
- XETSwResourceReq, /* XETSwQueryFont, */
- XETSwResourceReq, /* XETSwQueryTextExtents, */
- XETSwListFonts,
- XETSwListFontsWithInfo, /* 50 */
- XETSwSetFontPath,
- XETSwSimpleReq, /* GetFontPath, */
- XETSwCreatePixmap,
- XETSwResourceReq, /* XETSwFreePixmap, */
- XETSwCreateGC, /* 55 */
- XETSwChangeGC,
- XETSwCopyGC,
- XETSwSetDashes,
- XETSwSetClipRectangles,
- XETSwResourceReq, /* 60 XETSwFreeGC, */
- XETSwClearToBackground,
- XETSwCopyArea,
- XETSwCopyPlane,
- XETSwPoly, /* PolyPoint, */
- XETSwPoly, /* 65 PolyLine */
- XETSwPoly, /* PolySegment, */
- XETSwPoly, /* PolyRectangle, */
- XETSwPoly, /* PolyArc, */
- XETSwFillPoly,
- XETSwPoly, /* 70 PolyFillRectangle */
- XETSwPoly, /* PolyFillArc, */
- XETSwPutImage,
- XETSwGetImage,
- XETSwPolyText,
- XETSwPolyText, /* 75 */
- XETSwImageText,
- XETSwImageText,
- XETSwCreateColormap,
- XETSwResourceReq, /* XETSwFreeColormap, */
- XETSwCopyColormapAndFree, /* 80 */
- XETSwResourceReq, /* XETSwInstallColormap, */
- XETSwResourceReq, /* XETSwUninstallColormap, */
- XETSwResourceReq, /* XETSwListInstalledColormaps, */
- XETSwAllocColor,
- XETSwAllocNamedColor, /* 85 */
- XETSwAllocColorCells,
- XETSwAllocColorPlanes,
- XETSwFreeColors,
- XETSwStoreColors,
- XETSwStoreNamedColor, /* 90 */
- XETSwQueryColors,
- XETSwLookupColor,
- XETSwCreateCursor,
- XETSwCreateGlyphCursor,
- XETSwResourceReq, /* 95 XETSwFreeCursor, */
- XETSwRecolorCursor,
- XETSwQueryBestSize,
- XETSwQueryExtension,
- XETSwSimpleReq, /* ListExtensions, */
- XETSwChangeKeyboardMapping, /* 100 */
- XETSwSimpleReq, /* GetKeyboardMapping, */
- XETSwChangeKeyboardControl,
- XETSwSimpleReq, /* GetKeyboardControl, */
- XETSwSimpleReq, /* Bell, */
- XETSwChangePointerControl, /* 105 */
- XETSwSimpleReq, /* GetPointerControl, */
- XETSwSetScreenSaver,
- XETSwSimpleReq, /* GetScreenSaver, */
- XETSwChangeHosts,
- XETSwSimpleReq, /* 110 ListHosts, */
- XETSwSimpleReq, /* XETSwChangeAccessControl, */
- XETSwSimpleReq, /* XETSwChangeCloseDownMode, */
- XETSwResourceReq, /* XETSwKillClient, */
- XETSwRotateProperties,
- XETSwSimpleReq, /* 115 ForceScreenSaver */
- XETSwSimpleReq, /* SetPointerMapping, */
- XETSwSimpleReq, /* GetPointerMapping, */
- XETSwSimpleReq, /* SetModifierMapping, */
- XETSwSimpleReq, /* GetModifierMapping, */
- NotImplemented, /* 120 */
- NotImplemented,
- NotImplemented,
- NotImplemented,
- NotImplemented,
- NotImplemented, /* 125 */
- NotImplemented,
- XETSwNoOperation
-};
-
-/* NOTE: This array must align with the values of the constants used
- * as minor_opcode values in the request structure. Failure to do this
- * could result in random code paths.
- */
-globaldef int_function XETrapDispatchVector[10L] =
-{
- XETrapReset, /* 0 XETrap_Reset */
- XETrapGetAvailable, /* 1 XETrap_GetAvailable */
- XETrapConfig, /* 2 XETrap_Config */
- XETrapStartTrap, /* 3 XETrap_StartTrap */
- XETrapStopTrap, /* 4 XETrap_StopTrap */
- XETrapGetCurrent, /* 5 XETrap_GetCurrent */
- XETrapGetStatistics, /* 6 XETrap_GetStatistics */
-#ifndef _XINPUT
- XETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */
-#endif
- XETrapGetVersion, /* 8 XETrap_GetVersion */
- XETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */
-};
-
-/* NOTE: This array must align with the values of the constants used
- * as minor_opcode values in the request structure. Failure to do this
- * could result in random code paths.
- */
-globaldef int_function XETSwDispatchVector[10L] =
-{
- sXETrapReset, /* 0 XETrap_Reset */
- sXETrapGetAvailable, /* 1 XETrap_GetAvailable */
- sXETrapConfig, /* 2 XETrap_Config */
- sXETrapStartTrap, /* 3 XETrap_StartTrap */
- sXETrapStopTrap, /* 4 XETrap_StopTrap */
- sXETrapGetCurrent, /* 5 XETrap_GetCurrent */
- sXETrapGetStatistics, /* 6 XETrap_GetStatistics */
-#ifndef _XINPUT
- sXETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */
-#endif
- sXETrapGetVersion, /* 8 XETrap_GetVersion */
- sXETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */
-};
-
-/* ProcVector shadow vector */
-globaldef int_function XETrapProcVector[256L] = {XETrapRequestVector};
-/*
- * Events are faked as if they're vectored since that's
- * the way it'll eventually be (X11 R5?).
- */
-#ifndef VECTORED_EVENTS
-globaldef int_function EventProcVector[XETrapCoreEvents] = {NULL};
-#endif
-globaldef int_function XETrapEventProcVector[XETrapCoreEvents] = {NULL};
-
-
diff --git a/Xext/EVI.c b/Xext/EVI.c
deleted file mode 100644
index 09aa03b64..000000000
--- a/Xext/EVI.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* $Xorg: EVI.c,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/EVI.c,v 3.11 2003/10/28 23:08:43 tsi Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "dix.h"
-#define _XEVI_SERVER_
-#include "XEVIstr.h"
-#include "EVIstruct.h"
-#include "modinit.h"
-
-#if 0
-static unsigned char XEVIReqCode = 0;
-#endif
-static EviPrivPtr eviPriv;
-
-static int
-ProcEVIQueryVersion(ClientPtr client)
-{
- /* REQUEST(xEVIQueryVersionReq); */
- xEVIQueryVersionReply rep;
- register int n;
- REQUEST_SIZE_MATCH (xEVIQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XEVI_MAJOR_VERSION;
- rep.minorVersion = XEVI_MAJOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof (xEVIQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-#define swapEviInfo(eviInfo, l) \
-{ \
- int l1 = l; \
- xExtendedVisualInfo *eviInfo1 = eviInfo; \
- while (l1-- > 0) { \
- swapl(&eviInfo1->core_visual_id, n); \
- swapl(&eviInfo1->transparency_value, n); \
- swaps(&eviInfo1->num_colormap_conflicts, n); \
- eviInfo1++; \
- } \
-}
-#define swapVisual(visual, l) \
-{ \
- int l1 = l; \
- VisualID32 *visual1 = visual; \
- while (l1-- > 0) { \
- swapl(visual1, n); \
- visual1++; \
- } \
-}
-
-static int
-ProcEVIGetVisualInfo(ClientPtr client)
-{
- REQUEST(xEVIGetVisualInfoReq);
- xEVIGetVisualInfoReply rep;
- int n, n_conflict, n_info, sz_info, sz_conflict;
- VisualID32 *conflict;
- xExtendedVisualInfo *eviInfo;
- int status;
- REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual * sz_VisualID32);
- status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual,
- &eviInfo, &n_info, &conflict, &n_conflict);
- if (status != Success)
- return status;
- sz_info = n_info * sz_xExtendedVisualInfo;
- sz_conflict = n_conflict * sz_VisualID32;
- rep.type = X_Reply;
- rep.n_info = n_info;
- rep.n_conflicts = n_conflict;
- rep.sequenceNumber = client->sequence;
- rep.length = (sz_info + sz_conflict) >> 2;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.n_info, n);
- swapl(&rep.n_conflicts, n);
- swapEviInfo(eviInfo, n_info);
- swapVisual(conflict, n_conflict);
- }
- WriteToClient(client, sz_xEVIGetVisualInfoReply, (char *)&rep);
- WriteToClient(client, sz_info, (char *)eviInfo);
- WriteToClient(client, sz_conflict, (char *)conflict);
- eviPriv->freeVisualInfo(eviInfo, conflict);
- return (client->noClientException);
-}
-
-static int
-ProcEVIDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_EVIQueryVersion:
- return ProcEVIQueryVersion (client);
- case X_EVIGetVisualInfo:
- return ProcEVIGetVisualInfo (client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcEVIQueryVersion(ClientPtr client)
-{
- REQUEST(xEVIQueryVersionReq);
- int n;
- swaps(&stuff->length, n);
- return ProcEVIQueryVersion(client);
-}
-
-static int
-SProcEVIGetVisualInfo(ClientPtr client)
-{
- register int n;
- REQUEST(xEVIGetVisualInfoReq);
- swaps(&stuff->length, n);
- return ProcEVIGetVisualInfo(client);
-}
-
-static int
-SProcEVIDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_EVIQueryVersion:
- return SProcEVIQueryVersion (client);
- case X_EVIGetVisualInfo:
- return SProcEVIGetVisualInfo (client);
- default:
- return BadRequest;
- }
-}
-
-/*ARGSUSED*/
-static void
-EVIResetProc(ExtensionEntry *extEntry)
-{
- eviDDXReset();
-}
-
-/****************
- * XEVIExtensionInit
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- ****************/
-void
-EVIExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(EVINAME, 0, 0,
- ProcEVIDispatch,
- SProcEVIDispatch,
- EVIResetProc, StandardMinorOpcode))) {
- XEVIReqCode = (unsigned char)extEntry->base;
-#else
- if (AddExtension(EVINAME, 0, 0,
- ProcEVIDispatch, SProcEVIDispatch,
- EVIResetProc, StandardMinorOpcode)) {
-#endif
- eviPriv = eviDDXInit();
- }
-}
diff --git a/Xext/EVIstruct.h b/Xext/EVIstruct.h
deleted file mode 100644
index dfe4423f8..000000000
--- a/Xext/EVIstruct.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* $Xorg: EVIstruct.h,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/EVIstruct.h,v 3.6 2003/11/17 22:20:26 dawes Exp $ */
-
-#ifndef EVI_STRUCT_H
-#define EVI_STRUCT_H
-
-/*
- ******************************************************************************
- ** Per-ddx data
- ******************************************************************************
- */
-
-typedef int (*GetVisualInfoProc)(
- VisualID32*,
- int,
- xExtendedVisualInfo**,
- int*,
- VisualID32**,
- int*
-);
-
-typedef void (*FreeVisualInfoProc)(
- xExtendedVisualInfo*,
- VisualID32*
-);
-typedef struct _EviPrivRec {
- GetVisualInfoProc getVisualInfo;
- FreeVisualInfoProc freeVisualInfo;
-} EviPrivRec, *EviPrivPtr;
-
-extern EviPrivPtr eviDDXInit(void);
-extern void eviDDXReset(void);
-
-#endif /* EVI_STRUCT_H */
diff --git a/Xext/README.xtest1-ddx b/Xext/README.xtest1-ddx
deleted file mode 100644
index bdf7943b7..000000000
--- a/Xext/README.xtest1-ddx
+++ /dev/null
@@ -1,90 +0,0 @@
-There are several code fragments that need to be placed in the device
-dependent part of the server. These are described below. These code
-fragments are device and implementation dependent.
-
-This code fragment should go in your ddx InitInput() routine:
-
-#ifdef XTESTEXT1
-extern KeyCode xtest_command_key;
-#endif
-
-#ifdef XTESTEXT1
- xtest_command_key = <whatever-is-a-good-keycode-for-your-keyboard>;
-#endif
-
-This code fragment should go at the front of the file that handles
-keyboards:
-
-#ifdef XTESTEXT1
-/*
- * defined in xtestext1di.c
- */
-extern int on_steal_input;
-extern Bool XTestStealKeyData();
-#endif XTESTEXT1
-
-This code fragment should go in the function that parses input from the
-keyboard or pointer after you know what input action has occurred, but before
-you have told the server about it. If conditionalizes the actual function
-call to pass the information on:
-
-#ifdef XTESTEXT1
- if (!on_steal_input ||
- XTestStealKeyData(code, direction, dev_type, x, y))
-#endif /* XTESTEXT1 */
- handle_device_event(...);
-
-This code fragment should go in the function that handles mouse motion after
-you have figured out how much the mouse has moved:
-
-#ifdef XTESTEXT1
- if (on_steal_input)
- XTestStealMotionData(dx, dy, dev, x, y);
-#endif XTESTEXT1
-
-
-This code fragment should go at the front of the os-specific code where
-you wait (by doing a select on the socket in our implementation) for
-something to happen:
-
-#ifdef XTESTEXT1
-extern int playback_on;
-void XTestComputeWaitTime();
-#endif XTESTEXT1
-
-These code fragments should go in the os-specific code on both sides of
-where you wait (by doing a select on the socket in our implementation)
-for something to happen:
-
-#ifdef XTESTEXT1
- if (playback_on)
- XTestComputeWaitTime(wt = &waittime);
-#endif XTESTEXT1
- ... code to do select ...
- WakeupHandler(i, LastSelectMask);
-#ifdef XTESTEXT1
- if (playback_on)
- i = XTestProcessInputAction(i, &waittime);
-#endif XTESTEXT1
-
-
-You also need to implement the following routines (documentation
-is needed; for now, see server/ddx/hp/hp/x_hil.c):
-
-void
-XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey)
- int dev_type;
- int keycode;
- int keystate;
- int mousex;
- int mousey;
-
-void
-XTestGetPointerPos(fmousex, fmousey)
- short *fmousex, *fmousey;
-
-void
-XTestJumpPointer(jx, jy, dev_type)
- int jx;
- int jy;
- int dev_type;
diff --git a/Xext/SecurityPolicy b/Xext/SecurityPolicy
deleted file mode 100644
index cc521c263..000000000
--- a/Xext/SecurityPolicy
+++ /dev/null
@@ -1,88 +0,0 @@
-version-1
-
-# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
-
-# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
-# authorization protocol. The values are arbitrary and site-specific.
-# Refer to the Security Extension Specification for the usage of the policies.
-#sitepolicy A
-#sitepolicy B
-#sitepolicy C
-
-# Property access rules:
-# property <property> <window> <permissions>
-# <window> ::= any | root | <propertyselector>
-# <propertyselector> ::= <property> | <property>=<value>
-# <permissions> :== [ <operation> | <action> | <space> ]*
-# <operation> :== r | w | d
-# r read
-# w write
-# d delete
-# <action> :== a | i | e
-# a allow
-# i ignore
-# e error
-
-# Allow reading of application resources, but not writing.
-property RESOURCE_MANAGER root ar iw
-property SCREEN_RESOURCES root ar iw
-
-# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
-# and allowing access may give away too much information.
-property CUT_BUFFER0 root irw
-property CUT_BUFFER1 root irw
-property CUT_BUFFER2 root irw
-property CUT_BUFFER3 root irw
-property CUT_BUFFER4 root irw
-property CUT_BUFFER5 root irw
-property CUT_BUFFER6 root irw
-property CUT_BUFFER7 root irw
-
-# If you are using Motif, you probably want these.
-property _MOTIF_DEFAULT_BINDINGS root ar iw
-property _MOTIF_DRAG_WINDOW root ar iw
-property _MOTIF_DRAG_TARGETS any ar iw
-property _MOTIF_DRAG_ATOMS any ar iw
-property _MOTIF_DRAG_ATOM_PAIRS any ar iw
-
-# If you are running CDE you also need these
-property _MOTIF_WM_INFO root arw
-property TT_SESSION root irw
-property WM_ICON_SIZE root irw
-property "SDT Pixel Set" any irw
-
-# The next two rules let xwininfo -tree work when untrusted.
-property WM_NAME any ar
-
-# Allow read of WM_CLASS, but only for windows with WM_NAME.
-# This might be more restrictive than necessary, but demonstrates
-# the <required property> facility, and is also an attempt to
-# say "top level windows only."
-property WM_CLASS WM_NAME ar
-
-# These next three let xlsclients work untrusted. Think carefully
-# before including these; giving away the client machine name and command
-# may be exposing too much.
-property WM_STATE WM_NAME ar
-property WM_CLIENT_MACHINE WM_NAME ar
-property WM_COMMAND WM_NAME ar
-
-# To let untrusted clients use the standard colormaps created by
-# xstdcmap, include these lines.
-property RGB_DEFAULT_MAP root ar
-property RGB_BEST_MAP root ar
-property RGB_RED_MAP root ar
-property RGB_GREEN_MAP root ar
-property RGB_BLUE_MAP root ar
-property RGB_GRAY_MAP root ar
-
-# To let untrusted clients use the color management database created
-# by xcmsdb, include these lines.
-property XDCCC_LINEAR_RGB_CORRECTION root ar
-property XDCCC_LINEAR_RGB_MATRICES root ar
-property XDCCC_GRAY_SCREENWHITEPOINT root ar
-property XDCCC_GRAY_CORRECTION root ar
-
-# To let untrusted clients use the overlay visuals that many vendors
-# support, include this line.
-property SERVER_OVERLAY_VISUALS root ar
diff --git a/Xext/appgroup.c b/Xext/appgroup.c
deleted file mode 100644
index 8718e3630..000000000
--- a/Xext/appgroup.c
+++ /dev/null
@@ -1,825 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/appgroup.c,v 1.11 2003/10/28 23:08:43 tsi Exp $ */
-/*
-Copyright 1996, 1998, 2001 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-/* $Xorg: appgroup.c,v 1.6 2001/02/09 02:04:32 xorgcvs Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "colormapst.h"
-#include "servermd.h"
-#define _XAG_SERVER_
-#include "Xagstr.h"
-#include "Xagsrv.h"
-#define _SECURITY_SERVER
-#include "security.h"
-#include "Xfuncproto.h"
-
-#define XSERV_t
-#include <X11/Xtrans.h>
-#include "../os/osdep.h"
-
-#include <stdio.h>
-
-#include "modinit.h"
-#include "appgroup.h"
-
-typedef struct _AppGroupRec {
- struct _AppGroupRec* next;
- XID appgroupId;
- ClientPtr* clients;
- int nclients;
- ClientPtr leader;
- Bool single_screen;
- Window default_root;
- VisualID root_visual;
- Colormap default_colormap;
- Pixel black_pixel;
- Pixel white_pixel;
- xConnSetupPrefix connSetupPrefix;
- char* ConnectionInfo;
-} AppGroupRec, *AppGroupPtr;
-
-static int ProcXagDispatch(ClientPtr client);
-static int SProcXagDispatch(ClientPtr client);
-static void XagResetProc(ExtensionEntry* extEntry);
-
-#if 0
-static unsigned char XagReqCode = 0;
-static int XagErrorBase;
-#endif
-static int XagCallbackRefCount = 0;
-
-static RESTYPE RT_APPGROUP;
-static AppGroupPtr appGrpList = NULL;
-
-extern xConnSetupPrefix connSetupPrefix;
-extern char* ConnectionInfo;
-extern int connBlockScreenStart;
-
-static
-int XagAppGroupFree(
- pointer what,
- XID id) /* unused */
-{
- int i;
- AppGroupPtr pAppGrp = (AppGroupPtr) what;
-
- if (pAppGrp->leader)
- for (i = 0; i < pAppGrp->nclients; i++) {
- pAppGrp->clients[i]->appgroup = NULL;
- CloseDownClient (pAppGrp->clients[i]);
- }
-
- if (pAppGrp == appGrpList)
- appGrpList = appGrpList->next;
- else {
- AppGroupPtr tpAppGrp;
- for (tpAppGrp = appGrpList;
- tpAppGrp->next != NULL;
- tpAppGrp = tpAppGrp->next) {
- if (tpAppGrp->next == pAppGrp) {
- tpAppGrp->next = tpAppGrp->next->next;
- break;
- }
- }
- }
- (void) xfree (pAppGrp->clients);
- (void) xfree (pAppGrp->ConnectionInfo);
- (void) xfree (what);
- return Success;
-}
-
-/* static */
-void XagClientStateChange(
- CallbackListPtr* pcbl,
- pointer nulldata,
- pointer calldata)
-{
- SecurityAuthorizationPtr pAuth;
- NewClientInfoRec* pci = (NewClientInfoRec*) calldata;
- ClientPtr pClient = pci->client;
- AppGroupPtr pAppGrp;
- XID authId = 0;
-
- if (!pClient->appgroup) {
- switch (pClient->clientState) {
-
- case ClientStateAuthenticating:
- case ClientStateRunning:
- case ClientStateCheckingSecurity:
- return;
-
- case ClientStateInitial:
- case ClientStateCheckedSecurity:
- /*
- * If the client is connecting via a firewall proxy (which
- * uses XC-QUERY-SECURITY-1, then the authId is available
- * during ClientStateCheckedSecurity, otherwise it's
- * available during ClientStateInitial.
- *
- * Don't get it from pClient because can't guarantee the order
- * of the callbacks and the security extension might not have
- * plugged it in yet.
- */
- authId = AuthorizationIDOfClient(pClient);
- break;
-
- case ClientStateGone:
- case ClientStateRetained:
- /*
- * Don't get if from AuthorizationIDOfClient because can't
- * guarantee the order of the callbacks and the security
- * extension may have torn down the client's private data
- */
- authId = pClient->authId;
- break;
- }
-
- if (authId == None)
- return;
-
- pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(pClient,
- authId, SecurityAuthorizationResType, SecurityReadAccess);
-
- if (pAuth == NULL)
- return;
-
- for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next)
- if (pAppGrp->appgroupId == pAuth->group) break;
- } else {
- pAppGrp = pClient->appgroup;
- }
-
- if (!pAppGrp)
- return;
-
- switch (pClient->clientState) {
- case ClientStateAuthenticating:
- case ClientStateRunning:
- case ClientStateCheckingSecurity:
- break;
-
- case ClientStateInitial:
- case ClientStateCheckedSecurity:
- /* see the comment above about Initial vs. CheckedSecurity */
- {
- /* if this client already in AppGroup, don't add it again */
- int i;
- for (i = 0; i < pAppGrp->nclients; i++)
- if (pClient == pAppGrp->clients[i]) return;
- }
- pAppGrp->clients = (ClientPtr*) xrealloc (pAppGrp->clients,
- ++pAppGrp->nclients * sizeof (ClientPtr));
- pAppGrp->clients[pAppGrp->nclients - 1] = pClient;
- pClient->appgroup = pAppGrp;
- break;
-
- case ClientStateGone:
- case ClientStateRetained: /* client disconnected, dump it */
- {
- int i;
- for (i = 0; i < pAppGrp->nclients; i++)
- if (pAppGrp->clients[i] == pClient) {
- pAppGrp->clients[i] = NULL;
- break;
- }
- for (i = 0; i < pAppGrp->nclients; i++)
- if (pAppGrp->clients[i] == NULL && i + 1 < pAppGrp->nclients)
- pAppGrp->clients[i] = pAppGrp->clients[i + 1];
- pAppGrp->nclients--;
- }
- pClient->appgroup = NULL; /* redundant, pClient will be freed */
- break;
- }
-}
-
-void
-XagExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry* extEntry;
-
- if ((extEntry = AddExtension (XAGNAME,
- 0,
- XagNumberErrors,
- ProcXagDispatch,
- SProcXagDispatch,
- XagResetProc,
- StandardMinorOpcode))) {
- XagReqCode = (unsigned char)extEntry->base;
- XagErrorBase = extEntry->errorBase;
-#else
- if (AddExtension (XAGNAME,
- 0,
- XagNumberErrors,
- ProcXagDispatch,
- SProcXagDispatch,
- XagResetProc,
- StandardMinorOpcode)) {
-#endif
- RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
- }
-}
-
-/*ARGSUSED*/
-static
-void XagResetProc(
- ExtensionEntry* extEntry)
-{
- DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
- XagCallbackRefCount = 0;
- while (appGrpList) XagAppGroupFree ((pointer) appGrpList, 0);
-}
-
-static
-int ProcXagQueryVersion(
- register ClientPtr client)
-{
- /* REQUEST (xXagQueryVersionReq); */
- xXagQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xXagQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequence_number = client->sequence;
- rep.server_major_version = XAG_MAJOR_VERSION;
- rep.server_minor_version = XAG_MINOR_VERSION;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- swaps (&rep.server_major_version, n);
- swaps (&rep.server_minor_version, n);
- }
- WriteToClient (client, sizeof (xXagQueryVersionReply), (char *)&rep);
- return client->noClientException;
-}
-
-static
-void ProcessAttr(
- AppGroupPtr pAppGrp,
- ClientPtr client,
- unsigned int attrib_mask,
- CARD32* attribs)
-{
- int i;
-
- for (i = 0; i <= XagNappGroupLeader; i++) {
- switch (attrib_mask & (1 << i)) {
- case XagSingleScreenMask:
- pAppGrp->single_screen = *attribs;
- break;
- case XagDefaultRootMask:
- pAppGrp->default_root = *attribs;
- break;
- case XagRootVisualMask:
- pAppGrp->root_visual = *attribs;
- break;
- case XagDefaultColormapMask:
- pAppGrp->default_colormap = *attribs;
- break;
- case XagBlackPixelMask:
- pAppGrp->black_pixel = *attribs;
- break;
- case XagWhitePixelMask:
- pAppGrp->white_pixel = *attribs;
- break;
- case XagAppGroupLeaderMask:
- pAppGrp->leader = client;
- break;
- default: continue;
- }
- attribs++;
- }
-}
-
-static
-void CreateConnectionInfo(
- AppGroupPtr pAppGrp)
-{
- xWindowRoot* rootp;
- xWindowRoot* roots[MAXSCREENS];
- unsigned int rootlens[MAXSCREENS];
- xDepth* depth;
- int olen;
- int snum, i;
-
- rootp = (xWindowRoot*) (ConnectionInfo + connBlockScreenStart);
- for (snum = 0; snum < screenInfo.numScreens; snum++) {
-
- rootlens[snum] = sizeof (xWindowRoot);
- roots[snum] = rootp;
-
- depth = (xDepth*) (rootp + 1);
- for (i = 0; i < rootp->nDepths; i++) {
- rootlens[snum] += sizeof (xDepth) +
- depth->nVisuals * sizeof (xVisualType);
- depth = (xDepth *)(((char*)(depth + 1)) +
- depth->nVisuals * sizeof (xVisualType));
- }
- rootp = (xWindowRoot*) depth;
- }
- snum = 0;
- if (pAppGrp->default_root) {
- for (; snum < screenInfo.numVideoScreens; snum++) {
- if (roots[snum]->windowId == pAppGrp->default_root)
- break;
- }
- }
- olen = connBlockScreenStart + rootlens[snum];
- for (i = screenInfo.numVideoScreens; i < screenInfo.numScreens; i++)
- olen += rootlens[i];
- pAppGrp->ConnectionInfo = (char*) xalloc (olen);
- if (!pAppGrp->ConnectionInfo)
- return;
- memmove (pAppGrp->ConnectionInfo, ConnectionInfo, connBlockScreenStart);
- ((xConnSetup*) (pAppGrp->ConnectionInfo))->numRoots =
- 1 + screenInfo.numScreens - screenInfo.numVideoScreens;
- memmove (pAppGrp->ConnectionInfo + connBlockScreenStart,
- (void*) roots[snum], rootlens[snum]);
- rootp = (xWindowRoot*) (pAppGrp->ConnectionInfo + connBlockScreenStart);
- if (pAppGrp->default_colormap) {
- rootp->defaultColormap = pAppGrp->default_colormap;
- rootp->whitePixel = pAppGrp->white_pixel;
- rootp->blackPixel = pAppGrp->black_pixel;
- }
- if (pAppGrp->root_visual)
- rootp->rootVisualID = pAppGrp->root_visual;
- rootp = (xWindowRoot*) (((char*)rootp) + rootlens[snum]);
- for (i = screenInfo.numVideoScreens; i < screenInfo.numScreens; i++) {
- memmove ((void*) rootp, (void*) roots[i], rootlens[i]);
- rootp = (xWindowRoot*) (((char*) rootp) + rootlens[i]);
- }
- pAppGrp->connSetupPrefix = connSetupPrefix;
- pAppGrp->connSetupPrefix.length = olen >> 2;
-}
-
-static
-AppGroupPtr CreateAppGroup(
- ClientPtr client,
- XID appgroupId,
- unsigned int attrib_mask,
- CARD32* attribs)
-{
- AppGroupPtr pAppGrp;
-
- pAppGrp = (AppGroupPtr) xalloc (sizeof(AppGroupRec));
- if (pAppGrp) {
- pAppGrp->next = appGrpList;
- appGrpList = pAppGrp;
- pAppGrp->appgroupId = appgroupId;
- pAppGrp->clients = (ClientPtr*) xalloc (0);
- pAppGrp->nclients = 0;
- pAppGrp->leader = NULL;
- pAppGrp->default_root = 0;
- pAppGrp->root_visual = 0;
- pAppGrp->default_colormap = 0;
- pAppGrp->black_pixel = -1;
- pAppGrp->white_pixel = -1;
- pAppGrp->ConnectionInfo = NULL;
- ProcessAttr (pAppGrp, client, attrib_mask, attribs);
- }
- return pAppGrp;
-}
-
-static
-int AttrValidate(
- ClientPtr client,
- int attrib_mask,
- AppGroupPtr pAppGrp)
-{
- WindowPtr pWin;
- int idepth, ivids, found;
- ScreenPtr pScreen;
- DepthPtr pDepth;
- ColormapPtr pColormap;
-
- pWin = LookupWindow (pAppGrp->default_root, client);
- /* XXX check that pWin is not NULL */
- pScreen = pWin->drawable.pScreen;
- if (WindowTable[pScreen->myNum]->drawable.id != pAppGrp->default_root)
- return BadWindow;
- pDepth = pScreen->allowedDepths;
- if (pAppGrp->root_visual) {
- found = FALSE;
- for (idepth = 0; idepth < pScreen->numDepths; idepth++, pDepth++) {
- for (ivids = 0; ivids < pDepth->numVids; ivids++) {
- if (pAppGrp->root_visual == pDepth->vids[ivids]) {
- found = TRUE;
- break;
- }
- }
- }
- if (!found)
- return BadMatch;
- }
- if (pAppGrp->default_colormap) {
-
- pColormap = (ColormapPtr)LookupIDByType (pAppGrp->default_colormap, RT_COLORMAP);
- /* XXX check that pColormap is not NULL */
- if (pColormap->pScreen != pScreen)
- return BadColor;
- if (pColormap->pVisual->vid != (pAppGrp->root_visual ? pAppGrp->root_visual : pScreen->rootVisual))
- return BadMatch;
- }
- return client->noClientException;
-}
-
-/* static */
-int ProcXagCreate (
- register ClientPtr client)
-{
- REQUEST (xXagCreateReq);
- AppGroupPtr pAppGrp;
- int ret;
-
- REQUEST_AT_LEAST_SIZE (xXagCreateReq);
-
- LEGAL_NEW_RESOURCE (stuff->app_group, client);
- pAppGrp = CreateAppGroup (client, stuff->app_group,
- stuff->attrib_mask, (CARD32*) &stuff[1]);
- if (!pAppGrp)
- return BadAlloc;
- ret = AttrValidate (client, stuff->attrib_mask, pAppGrp);
- if (ret != Success) {
- XagAppGroupFree ((pointer)pAppGrp, (XID)0);
- return ret;
- }
- if (pAppGrp->single_screen) {
- CreateConnectionInfo (pAppGrp);
- if (!pAppGrp->ConnectionInfo)
- return BadAlloc;
- }
- if (!AddResource (stuff->app_group, RT_APPGROUP, (pointer)pAppGrp))
- return BadAlloc;
- if (XagCallbackRefCount++ == 0)
- (void) AddCallback (&ClientStateCallback, XagClientStateChange, NULL);
- return client->noClientException;
-}
-
-/* static */
-int ProcXagDestroy(
- register ClientPtr client)
-{
- AppGroupPtr pAppGrp;
- REQUEST (xXagDestroyReq);
-
- REQUEST_SIZE_MATCH (xXagDestroyReq);
- pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client,
- (XID)stuff->app_group, RT_APPGROUP, SecurityReadAccess);
- if (!pAppGrp) return XagBadAppGroup;
- FreeResource ((XID)stuff->app_group, RT_NONE);
- if (--XagCallbackRefCount == 0)
- (void) DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
- return client->noClientException;
-}
-
-static
-int ProcXagGetAttr(
- register ClientPtr client)
-{
- AppGroupPtr pAppGrp;
- REQUEST (xXagGetAttrReq);
- xXagGetAttrReply rep;
- int n;
-
- REQUEST_SIZE_MATCH (xXagGetAttrReq);
- pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client,
- (XID)stuff->app_group, RT_APPGROUP, SecurityReadAccess);
- if (!pAppGrp) return XagBadAppGroup;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequence_number = client->sequence;
- rep.default_root = pAppGrp->default_root;
- rep.root_visual = pAppGrp->root_visual;
- rep.default_colormap = pAppGrp->default_colormap;
- rep.black_pixel = pAppGrp->black_pixel;
- rep.white_pixel = pAppGrp->white_pixel;
- rep.single_screen = pAppGrp->single_screen;
- rep.app_group_leader = (pAppGrp->leader) ? 1 : 0;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- swapl (&rep.default_root, n);
- swapl (&rep.root_visual, n);
- swapl (&rep.default_colormap, n);
- swapl (&rep.black_pixel, n);
- swapl (&rep.white_pixel, n);
- }
- WriteToClient (client, sizeof (xXagGetAttrReply), (char *)&rep);
- return client->noClientException;
-}
-
-static
-int ProcXagQuery(
- register ClientPtr client)
-{
- ClientPtr pClient;
- AppGroupPtr pAppGrp;
- REQUEST (xXagQueryReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXagQueryReq);
- pClient = LookupClient (stuff->resource, client);
- for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next)
- for (n = 0; n < pAppGrp->nclients; n++)
- if (pAppGrp->clients[n] == pClient) {
- xXagQueryReply rep;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequence_number = client->sequence;
- rep.app_group = pAppGrp->appgroupId;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- swapl (&rep.app_group, n);
- }
- WriteToClient (client, sizeof (xXagQueryReply), (char *)&rep);
- return client->noClientException;
- }
-
- return BadMatch;
-}
-
-static
-int ProcXagCreateAssoc(
- register ClientPtr client)
-{
- REQUEST (xXagCreateAssocReq);
-
- REQUEST_SIZE_MATCH (xXagCreateAssocReq);
-#ifdef WIN32
- if (stuff->window_type != XagWindowTypeWin32)
-#else
- if (stuff->window_type != XagWindowTypeX11)
-#endif
- return BadMatch;
-#if defined(WIN32) || defined(__CYGWIN__) /* and Mac, etc */
- if (!LocalClient (client))
- return BadAccess;
-#endif
-
-/* Macintosh, OS/2, and MS-Windows servers have some work to do here */
-
- return client->noClientException;
-}
-
-static
-int ProcXagDestroyAssoc(
- register ClientPtr client)
-{
- /* REQUEST (xXagDestroyAssocReq); */
-
- REQUEST_SIZE_MATCH (xXagDestroyAssocReq);
-/* Macintosh, OS/2, and MS-Windows servers have some work to do here */
- return client->noClientException;
-}
-
-static
-int ProcXagDispatch (
- register ClientPtr client)
-{
- REQUEST (xReq);
- switch (stuff->data)
- {
- case X_XagQueryVersion:
- return ProcXagQueryVersion (client);
- case X_XagCreate:
- return ProcXagCreate (client);
- case X_XagDestroy:
- return ProcXagDestroy (client);
- case X_XagGetAttr:
- return ProcXagGetAttr (client);
- case X_XagQuery:
- return ProcXagQuery (client);
- case X_XagCreateAssoc:
- return ProcXagCreateAssoc (client);
- case X_XagDestroyAssoc:
- return ProcXagDestroyAssoc (client);
- default:
- return BadRequest;
- }
-}
-
-static
-int SProcXagQueryVersion(
- register ClientPtr client)
-{
- register int n;
- REQUEST(xXagQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXagQueryVersion(client);
-}
-
-static
-int SProcXagCreate(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagCreateReq);
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xXagCreateReq);
- swapl (&stuff->app_group, n);
- swapl (&stuff->attrib_mask, n);
- SwapRestL (stuff);
- return ProcXagCreate (client);
-}
-
-static
-int SProcXagDestroy(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagDestroyReq);
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xXagDestroyReq);
- swapl (&stuff->app_group, n);
- return ProcXagDestroy (client);
-}
-
-static
-int SProcXagGetAttr(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagGetAttrReq);
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xXagGetAttrReq);
- swapl (&stuff->app_group, n);
- return ProcXagGetAttr (client);
-}
-
-static
-int SProcXagQuery(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagQueryReq);
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xXagQueryReq);
- swapl (&stuff->resource, n);
- return ProcXagQuery (client);
-}
-
-static
-int SProcXagCreateAssoc(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagCreateAssocReq);
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xXagCreateAssocReq);
- swapl (&stuff->window, n);
- swapl (&stuff->window_type, n);
- swaps (&stuff->system_window_len, n);
- return ProcXagCreateAssoc (client);
-}
-
-static
-int SProcXagDestroyAssoc(
- ClientPtr client)
-{
- register int n;
- REQUEST (xXagDestroyAssocReq);
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xXagDestroyAssocReq);
- swapl (&stuff->window, n);
- return ProcXagDestroyAssoc (client);
-}
-
-static
-int SProcXagDispatch(
- register ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XagQueryVersion:
- return SProcXagQueryVersion (client);
- case X_XagCreate:
- return SProcXagCreate (client);
- case X_XagDestroy:
- return SProcXagDestroy (client);
- case X_XagGetAttr:
- return SProcXagGetAttr (client);
- case X_XagQuery:
- return SProcXagQuery (client);
- case X_XagCreateAssoc:
- return SProcXagCreateAssoc (client);
- case X_XagDestroyAssoc:
- return SProcXagDestroyAssoc (client);
- default:
- return BadRequest;
- }
-}
-
-Colormap XagDefaultColormap(
- ClientPtr client)
-{
- return (client->appgroup ? client->appgroup->default_colormap : None);
-}
-
-VisualID XagRootVisual(
- ClientPtr client)
-{
- return (client->appgroup ? client->appgroup->root_visual : 0);
-}
-
-ClientPtr XagLeader(
- ClientPtr client)
-{
- return (client->appgroup ? client->appgroup->leader : NULL);
-}
-
-/*
- * Return whether the Map request event should be sent to the appgroup leader.
- * We don't want to send it to the leader when the window is on a different
- * screen, e.g. a print screen.
- */
-Bool XagIsControlledRoot(
- ClientPtr client,
- WindowPtr pParent)
-{
- if (client->appgroup) {
- if (client->appgroup->single_screen &&
- pParent->drawable.id == client->appgroup->default_root)
- return TRUE;
- else if (!pParent->parent)
- return TRUE;
- else
- return FALSE;
- }
- return FALSE;
-}
-
-void XagConnectionInfo(
- ClientPtr client,
- xConnSetupPrefix** conn_prefix,
- char** conn_info,
- int* num_screen)
-{
- if (client->appgroup && client->appgroup->ConnectionInfo) {
- *conn_prefix = &client->appgroup->connSetupPrefix;
- *conn_info = client->appgroup->ConnectionInfo;
- *num_screen = ((xConnSetup*)(client->appgroup->ConnectionInfo))->numRoots;
- }
-}
-
-XID XagId(
- ClientPtr client)
-{
- return (client->appgroup ? client->appgroup->appgroupId : 0);
-}
-
-void XagGetDeltaInfo(
- ClientPtr client,
- CARD32* buf)
-{
- *buf++ = (CARD32) client->appgroup->default_root;
- *buf++ = (CARD32) client->appgroup->root_visual;
- *buf++ = (CARD32) client->appgroup->default_colormap;
- *buf++ = (CARD32) client->appgroup->black_pixel;
- *buf = (CARD32) client->appgroup->white_pixel;
-}
-
-void XagCallClientStateChange(
- ClientPtr client)
-{
- if (appGrpList) {
- NewClientInfoRec clientinfo;
-
- clientinfo.client = client;
- XagClientStateChange (NULL, NULL, (pointer)&clientinfo);
- }
-}
diff --git a/Xext/appgroup.h b/Xext/appgroup.h
deleted file mode 100644
index d292cf509..000000000
--- a/Xext/appgroup.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/appgroup.h,v 1.1 2003/07/16 01:38:28 dawes Exp $ */
-
-void XagClientStateChange(
- CallbackListPtr* pcbl,
- pointer nulldata,
- pointer calldata);
-int ProcXagCreate (
- register ClientPtr client);
-int ProcXagDestroy(
- register ClientPtr client);
diff --git a/Xext/bigreq.c b/Xext/bigreq.c
deleted file mode 100644
index ae73783d9..000000000
--- a/Xext/bigreq.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* $Xorg: bigreq.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-/*
-
-Copyright 1992, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.9 2003/11/17 22:20:26 dawes Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "bigreqstr.h"
-#include "opaque.h"
-#include "modinit.h"
-
-#if 0
-static unsigned char XBigReqCode;
-#endif
-
-static void BigReqResetProc(
- ExtensionEntry * /* extEntry */
-);
-
-static DISPATCH_PROC(ProcBigReqDispatch);
-
-void
-BigReqExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(XBigReqExtensionName, 0, 0,
- ProcBigReqDispatch, ProcBigReqDispatch,
- BigReqResetProc, StandardMinorOpcode)) != 0)
- XBigReqCode = (unsigned char)extEntry->base;
-#else
- (void) AddExtension(XBigReqExtensionName, 0, 0,
- ProcBigReqDispatch, ProcBigReqDispatch,
- BigReqResetProc, StandardMinorOpcode);
-#endif
-
- DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
-}
-
-/*ARGSUSED*/
-static void
-BigReqResetProc (extEntry)
- ExtensionEntry *extEntry;
-{
-}
-
-static int
-ProcBigReqDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xBigReqEnableReq);
- xBigReqEnableReply rep;
- register int n;
-
- if (client->swapped) {
- swaps(&stuff->length, n);
- }
- if (stuff->brReqType != X_BigReqEnable)
- return BadRequest;
- REQUEST_SIZE_MATCH(xBigReqEnableReq);
- client->big_requests = TRUE;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.max_request_size = maxBigRequestSize;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.max_request_size, n);
- }
- WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
- return(client->noClientException);
-}
diff --git a/Xext/cup.c b/Xext/cup.c
deleted file mode 100644
index 70c6fa610..000000000
--- a/Xext/cup.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/* $Xorg: cup.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-/*
-
-Copyright 1997, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/cup.c,v 1.12 2003/10/28 23:08:43 tsi Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "swapreq.h"
-#define _XCUP_SERVER_
-#include "Xcupstr.h"
-#include "Xfuncproto.h"
-
-#ifndef EXTMODULE
-#include "../os/osdep.h"
-#else
-#include "xf86_ansic.h"
-#endif
-
-#include "modinit.h"
-
-static int ProcDispatch(ClientPtr client);
-static int SProcDispatch(ClientPtr client);
-static void ResetProc(ExtensionEntry* extEntry);
-
-#if 0
-static unsigned char ReqCode = 0;
-static int ErrorBase;
-#endif
-
-#if defined(WIN32) || defined(TESTWIN32)
-#define HAVE_SPECIAL_DESKTOP_COLORS
-#endif
-
-static xColorItem citems[] = {
-#ifndef HAVE_SPECIAL_DESKTOP_COLORS
-#define CUP_BLACK_PIXEL 0
-#define CUP_WHITE_PIXEL 1
- /* pix red green blue */
- { 0, 0, 0, 0, 0, 0 },
- { 1, 0xffff, 0xffff, 0xffff, 0, 0 }
-#else
-#ifndef WIN32
- /*
- This approximates the MS-Windows desktop colormap for testing
- purposes but has black and white pixels in the typical Unix
- locations, which should be switched if necessary if your system
- has blackPixel and whitePixel swapped. No entries are provided
- for colormap entries 254 and 255 because AllocColor/FindColor
- will reuse entries zero and one.
- */
- { 0, 0, 0, 0, 0, 0 },
- { 1, 0xffff, 0xffff, 0xffff, 0, 0 },
- { 2, 0x8000, 0, 0, 0, 0 },
- { 3, 0, 0x8000, 0, 0, 0 },
- { 4, 0x8000, 0x8000, 0, 0, 0 },
- { 5, 0, 0, 0x8000, 0, 0 },
- { 6, 0x8000, 0, 0x8000, 0, 0 },
- { 7, 0, 0x8000, 0x8000, 0, 0 },
- { 8, 0xc000, 0xc000, 0xc000, 0, 0 },
- { 9, 0xc000, 0xdc00, 0xc000, 0, 0 },
- { 246, 0xa000, 0xa000, 0xa000, 0, 0 },
- { 247, 0x8000, 0x8000, 0x8000, 0, 0 },
- { 248, 0xffff, 0, 0, 0, 0 },
- { 249, 0, 0xffff, 0, 0, 0 },
- { 250, 0xffff, 0xffff, 0, 0, 0 },
- { 251, 0, 0, 0xffff, 0, 0 },
- { 252, 0xffff, 0, 0xffff, 0, 0 },
- { 253, 0, 0xffff, 0xffff, 0, 0 }
-#else
- /*
- this is the MS-Windows desktop, adjusted for X's 16-bit color
- specifications.
- */
- { 0, 0, 0, 0, 0, 0 },
- { 1, 0x8000, 0, 0, 0, 0 },
- { 2, 0, 0x8000, 0, 0, 0 },
- { 3, 0x8000, 0x8000, 0, 0, 0 },
- { 4, 0, 0, 0x8000, 0, 0 },
- { 5, 0x8000, 0, 0x8000, 0, 0 },
- { 6, 0, 0x8000, 0x8000, 0, 0 },
- { 7, 0xc000, 0xc000, 0xc000, 0, 0 },
- { 8, 0xc000, 0xdc00, 0xc000, 0, 0 },
- { 9, 0xa600, 0xca00, 0xf000, 0, 0 },
- { 246, 0xff00, 0xfb00, 0xf000, 0, 0 },
- { 247, 0xa000, 0xa000, 0xa400, 0, 0 },
- { 248, 0x8000, 0x8000, 0x8000, 0, 0 },
- { 249, 0xff00, 0, 0, 0, 0 },
- { 250, 0, 0xff00, 0, 0, 0 },
- { 251, 0xff00, 0xff00, 0, 0, 0 },
- { 252, 0, 0, 0xff00, 0, 0 },
- { 253, 0xff00, 0, 0xff00, 0, 0 },
- { 254, 0, 0xff00, 0xff00, 0, 0 },
- { 255, 0xff00, 0xff00, 0xff00, 0, 0 }
-#endif
-#endif
-};
-#define NUM_DESKTOP_COLORS (sizeof citems / sizeof citems[0])
-
-void
-XcupExtensionInit (INITARGS)
-{
-#if 0
- ExtensionEntry* extEntry;
-
- if ((extEntry = AddExtension (XCUPNAME,
- 0,
- XcupNumberErrors,
- ProcDispatch,
- SProcDispatch,
- ResetProc,
- StandardMinorOpcode))) {
- ReqCode = (unsigned char)extEntry->base;
- ErrorBase = extEntry->errorBase;
- }
-#else
- (void) AddExtension (XCUPNAME,
- 0,
- XcupNumberErrors,
- ProcDispatch,
- SProcDispatch,
- ResetProc,
- StandardMinorOpcode);
-#endif
-
- /* PC servers initialize the desktop colors (citems) here! */
-}
-
-/*ARGSUSED*/
-static
-void ResetProc(
- ExtensionEntry* extEntry)
-{
-}
-
-static
-int ProcQueryVersion(
- register ClientPtr client)
-{
- /* REQUEST (xXcupQueryVersionReq); */
- xXcupQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xXcupQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequence_number = client->sequence;
- rep.server_major_version = XCUP_MAJOR_VERSION;
- rep.server_minor_version = XCUP_MINOR_VERSION;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- swaps (&rep.server_major_version, n);
- swaps (&rep.server_minor_version, n);
- }
- WriteToClient (client, sizeof (xXcupQueryVersionReply), (char *)&rep);
- return client->noClientException;
-}
-
-static
-int ProcGetReservedColormapEntries(
- register ClientPtr client)
-{
- REQUEST (xXcupGetReservedColormapEntriesReq);
- xXcupGetReservedColormapEntriesReply rep;
- xColorItem* cptr;
- register int n;
-
- REQUEST_SIZE_MATCH (xXcupGetReservedColormapEntriesReq);
-
-#ifndef HAVE_SPECIAL_DESKTOP_COLORS
- citems[CUP_BLACK_PIXEL].pixel =
- screenInfo.screens[stuff->screen]->blackPixel;
- citems[CUP_WHITE_PIXEL].pixel =
- screenInfo.screens[stuff->screen]->whitePixel;
-#endif
-
- rep.type = X_Reply;
- rep.sequence_number = client->sequence;
- rep.length = NUM_DESKTOP_COLORS * 3;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- }
- WriteToClient (client, sizeof (xXcupGetReservedColormapEntriesReply), (char *)&rep);
- for (n = 0, cptr = citems; n < NUM_DESKTOP_COLORS; n++, cptr++) {
- if (client->swapped) SwapColorItem (cptr);
- WriteToClient (client, SIZEOF(xColorItem), (char *)cptr);
- }
- return client->noClientException;
-}
-
-static
-int ProcStoreColors(
- register ClientPtr client)
-{
- REQUEST (xXcupStoreColorsReq);
- ColormapPtr pcmp;
-
- REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
- pcmp = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
-
- if (pcmp) {
- int ncolors, n;
- xXcupStoreColorsReply rep;
- xColorItem* cptr;
-
- if (!(pcmp->class & DynamicClass))
- return BadMatch;
-
- ncolors = (client->req_len << 2) - SIZEOF (xXcupStoreColorsReq);
- if (ncolors % SIZEOF(xColorItem))
- return BadLength;
-
- ncolors /= SIZEOF (xColorItem);
-
-
- for (n = 0, cptr = (xColorItem*) &stuff[1]; n < ncolors; n++) {
- Pixel pixel = cptr->pixel;
-
- if (AllocColor (pcmp,
- &cptr->red, &cptr->green, &cptr->blue,
- &pixel, client->index) == Success) {
- cptr->pixel = pixel;
- cptr->flags = 0x08;
- } else
- cptr->flags = 0;
- cptr = (xColorItem*) (((char*)cptr) + SIZEOF(xColorItem));
- }
-
- rep.type = X_Reply;
- rep.sequence_number = client->sequence;
- rep.length = ncolors * 3;
- if (client->swapped) {
- swaps (&rep.sequence_number, n);
- swapl (&rep.length, n);
- }
- WriteToClient (client, sizeof (xXcupGetReservedColormapEntriesReply), (char *)&rep);
- for (n = 0, cptr = (xColorItem*) &stuff[1]; n < ncolors; n++) {
- if (client->swapped) SwapColorItem (cptr);
- WriteToClient (client, SIZEOF(xColorItem), (char *)cptr);
- cptr = (xColorItem*) (((char*)cptr) + SIZEOF(xColorItem));
- }
- return client->noClientException;
- } else {
- client->errorValue = stuff->cmap;
- return BadColor;
- }
-}
-
-static
-int ProcDispatch(
- register ClientPtr client)
-{
- REQUEST (xReq);
- switch (stuff->data)
- {
- case X_XcupQueryVersion:
- return ProcQueryVersion (client);
- case X_XcupGetReservedColormapEntries:
- return ProcGetReservedColormapEntries (client);
- case X_XcupStoreColors:
- return ProcStoreColors (client);
- default:
- return BadRequest;
- }
-}
-
-static
-int SProcQueryVersion(
- register ClientPtr client)
-{
- register int n;
-
- REQUEST(xXcupQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcQueryVersion(client);
-}
-
-static
-int SProcGetReservedColormapEntries(
- ClientPtr client)
-{
- register int n;
-
- REQUEST (xXcupGetReservedColormapEntriesReq);
- swaps (&stuff->length, n);
- swapl (&stuff->screen, n);
- REQUEST_AT_LEAST_SIZE (xXcupGetReservedColormapEntriesReq);
- return ProcGetReservedColormapEntries (client);
-}
-
-static
-int SProcXcupStoreColors(
- ClientPtr client)
-{
- register int n;
- int count;
- xColorItem* pItem;
-
- REQUEST (xXcupStoreColorsReq);
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
- swapl(&stuff->cmap, n);
- pItem = (xColorItem*) &stuff[1];
- for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
- SwapColorItem(pItem++);
- return ProcStoreColors (client);
-}
-
-static
-int SProcDispatch(
- register ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XcupQueryVersion:
- return SProcQueryVersion (client);
- case X_XcupGetReservedColormapEntries:
- return SProcGetReservedColormapEntries (client);
- case X_XcupStoreColors:
- return SProcXcupStoreColors (client);
- default:
- return BadRequest;
- }
-}
-
-
diff --git a/Xext/dpms.c b/Xext/dpms.c
deleted file mode 100644
index 584c32b22..000000000
--- a/Xext/dpms.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/* $Xorg: dpms.c,v 1.3 2000/08/17 19:47:56 cpqbld Exp $ */
-/*****************************************************************
-
-Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-
-******************************************************************/
-
-/*
- * HISTORY
- *
- * @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00
- */
-
-/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.11 2003/10/28 23:08:43 tsi Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "opaque.h"
-#define DPMS_SERVER
-#include "dpms.h"
-#include "dpmsstr.h"
-#include "dpmsproc.h"
-#include "modinit.h"
-
-#if 0
-static unsigned char DPMSCode;
-#endif
-static DISPATCH_PROC(ProcDPMSDispatch);
-static DISPATCH_PROC(SProcDPMSDispatch);
-static DISPATCH_PROC(ProcDPMSGetVersion);
-static DISPATCH_PROC(SProcDPMSGetVersion);
-static DISPATCH_PROC(ProcDPMSGetTimeouts);
-static DISPATCH_PROC(SProcDPMSGetTimeouts);
-static DISPATCH_PROC(ProcDPMSSetTimeouts);
-static DISPATCH_PROC(SProcDPMSSetTimeouts);
-static DISPATCH_PROC(ProcDPMSEnable);
-static DISPATCH_PROC(SProcDPMSEnable);
-static DISPATCH_PROC(ProcDPMSDisable);
-static DISPATCH_PROC(SProcDPMSDisable);
-static DISPATCH_PROC(ProcDPMSForceLevel);
-static DISPATCH_PROC(SProcDPMSForceLevel);
-static DISPATCH_PROC(ProcDPMSInfo);
-static DISPATCH_PROC(SProcDPMSInfo);
-static DISPATCH_PROC(ProcDPMSCapable);
-static DISPATCH_PROC(SProcDPMSCapable);
-static void DPMSResetProc(ExtensionEntry* extEntry);
-
-void
-DPMSExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(DPMSExtensionName, 0, 0,
- ProcDPMSDispatch, SProcDPMSDispatch,
- DPMSResetProc, StandardMinorOpcode)))
- DPMSCode = (unsigned char)extEntry->base;
-#else
- (void) AddExtension(DPMSExtensionName, 0, 0,
- ProcDPMSDispatch, SProcDPMSDispatch,
- DPMSResetProc, StandardMinorOpcode);
-#endif
-}
-
-/*ARGSUSED*/
-static void
-DPMSResetProc (extEntry)
- ExtensionEntry *extEntry;
-{
-}
-
-static int
-ProcDPMSGetVersion(client)
- register ClientPtr client;
-{
- /* REQUEST(xDPMSGetVersionReq); */
- xDPMSGetVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = DPMSMajorVersion;
- rep.minorVersion = DPMSMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcDPMSCapable(register ClientPtr client)
-{
- /* REQUEST(xDPMSCapableReq); */
- xDPMSCapableReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xDPMSCapableReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.capable = DPMSCapableFlag;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- }
- WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcDPMSGetTimeouts(client)
- register ClientPtr client;
-{
- /* REQUEST(xDPMSGetTimeoutsReq); */
- xDPMSGetTimeoutsReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
- rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
- rep.off = DPMSOffTime / MILLI_PER_SECOND;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.standby, n);
- swaps(&rep.suspend, n);
- swaps(&rep.off, n);
- }
- WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcDPMSSetTimeouts(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSSetTimeoutsReq);
-
- REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
-
- if ((stuff->off != 0)&&(stuff->off < stuff->suspend))
- {
- client->errorValue = stuff->off;
- return BadValue;
- }
- if ((stuff->suspend != 0)&&(stuff->suspend < stuff->standby))
- {
- client->errorValue = stuff->suspend;
- return BadValue;
- }
-
- DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND;
- DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND;
- DPMSOffTime = stuff->off * MILLI_PER_SECOND;
-
- return(client->noClientException);
-}
-
-static int
-ProcDPMSEnable(client)
- register ClientPtr client;
-{
- /* REQUEST(xDPMSEnableReq); */
-
- REQUEST_SIZE_MATCH(xDPMSEnableReq);
-
- if (DPMSCapableFlag)
- DPMSEnabled = TRUE;
-
- return(client->noClientException);
-}
-
-static int
-ProcDPMSDisable(client)
- register ClientPtr client;
-{
- /* REQUEST(xDPMSDisableReq); */
-
- REQUEST_SIZE_MATCH(xDPMSDisableReq);
-
- DPMSSet(DPMSModeOn);
-
- DPMSEnabled = FALSE;
-
- return(client->noClientException);
-}
-
-static int
-ProcDPMSForceLevel(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSForceLevelReq);
-
- REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
-
- if (!DPMSEnabled)
- return BadMatch;
-
- if (stuff->level == DPMSModeOn) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis();
- } else if (stuff->level == DPMSModeStandby) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSStandbyTime;
- } else if (stuff->level == DPMSModeSuspend) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSSuspendTime;
- } else if (stuff->level == DPMSModeOff) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSOffTime;
- } else {
- client->errorValue = stuff->level;
- return BadValue;
- }
-
- DPMSSet(stuff->level);
-
- return(client->noClientException);
-}
-
-static int
-ProcDPMSInfo(register ClientPtr client)
-{
- /* REQUEST(xDPMSInfoReq); */
- xDPMSInfoReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xDPMSInfoReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.power_level = DPMSPowerLevel;
- rep.state = DPMSEnabled;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.power_level, n);
- }
- WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcDPMSDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_DPMSGetVersion:
- return ProcDPMSGetVersion(client);
- case X_DPMSCapable:
- return ProcDPMSCapable(client);
- case X_DPMSGetTimeouts:
- return ProcDPMSGetTimeouts(client);
- case X_DPMSSetTimeouts:
- return ProcDPMSSetTimeouts(client);
- case X_DPMSEnable:
- return ProcDPMSEnable(client);
- case X_DPMSDisable:
- return ProcDPMSDisable(client);
- case X_DPMSForceLevel:
- return ProcDPMSForceLevel(client);
- case X_DPMSInfo:
- return ProcDPMSInfo(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcDPMSGetVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xDPMSGetVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion, n);
- return ProcDPMSGetVersion(client);
-}
-
-static int
-SProcDPMSCapable(register ClientPtr client)
-{
- REQUEST(xDPMSCapableReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSCapableReq);
-
- return ProcDPMSCapable(client);
-}
-
-static int
-SProcDPMSGetTimeouts(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSGetTimeoutsReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
-
- return ProcDPMSGetTimeouts(client);
-}
-
-static int
-SProcDPMSSetTimeouts(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSSetTimeoutsReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
-
- swaps(&stuff->standby, n);
- swaps(&stuff->suspend, n);
- swaps(&stuff->off, n);
- return ProcDPMSSetTimeouts(client);
-}
-
-static int
-SProcDPMSEnable(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSEnableReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSEnableReq);
-
- return ProcDPMSEnable(client);
-}
-
-static int
-SProcDPMSDisable(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSDisableReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSDisableReq);
-
- return ProcDPMSDisable(client);
-}
-
-static int
-SProcDPMSForceLevel(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSForceLevelReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
-
- swaps(&stuff->level, n);
-
- return ProcDPMSForceLevel(client);
-}
-
-static int
-SProcDPMSInfo(client)
- register ClientPtr client;
-{
- REQUEST(xDPMSInfoReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSInfoReq);
-
- return ProcDPMSInfo(client);
-}
-
-static int
-SProcDPMSDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_DPMSGetVersion:
- return SProcDPMSGetVersion(client);
- case X_DPMSCapable:
- return SProcDPMSCapable(client);
- case X_DPMSGetTimeouts:
- return SProcDPMSGetTimeouts(client);
- case X_DPMSSetTimeouts:
- return SProcDPMSSetTimeouts(client);
- case X_DPMSEnable:
- return SProcDPMSEnable(client);
- case X_DPMSDisable:
- return SProcDPMSDisable(client);
- case X_DPMSForceLevel:
- return SProcDPMSForceLevel(client);
- case X_DPMSInfo:
- return SProcDPMSInfo(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/dpmsproc.h b/Xext/dpmsproc.h
deleted file mode 100644
index b8260491e..000000000
--- a/Xext/dpmsproc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.4 2003/07/16 01:38:29 dawes Exp $ */
-
-/* Prototypes for functions that the DDX must provide */
-
-#ifndef _DPMSPROC_H_
-#define _DPMSPROC_H_
-
-void DPMSSet(int level);
-int DPMSGet(int *plevel);
-Bool DPMSSupported(void);
-
-#endif
diff --git a/Xext/dpmsstubs.c b/Xext/dpmsstubs.c
deleted file mode 100644
index bc85c16ca..000000000
--- a/Xext/dpmsstubs.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $Xorg: dpmsstubs.c,v 1.3 2000/08/17 19:47:56 cpqbld Exp $ */
-/*****************************************************************
-
-Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */
-
-typedef int Bool;
-
-#include "dpmsproc.h"
-
-#define FALSE 0
-
-Bool DPMSSupported(void)
-{
- return FALSE;
-}
-
-int DPMSGet(int *plevel)
-{
- return -1;
-}
-
-void DPMSSet(int level)
-{
-
-}
diff --git a/Xext/fontcache.c b/Xext/fontcache.c
deleted file mode 100644
index 7c3f5a800..000000000
--- a/Xext/fontcache.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*-
- * Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
- * All rights reserved.
- * Copyright (c) 1998-1999 X-TrueType Server Project, All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Id: fontcache.c,v 1.12 1999/01/31 13:47:45 akiyama Exp $
- */
-/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.8 2003/11/17 22:20:26 dawes Exp $ */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "inputstr.h"
-#include "servermd.h"
-#define _FONTCACHE_SERVER_
-#include "fontcacheP.h"
-#include "fontcachstr.h"
-#include "Xfuncproto.h"
-
-#include "swaprep.h"
-#include "modinit.h"
-
-static int miscErrorBase;
-
-static void FontCacheResetProc(
- ExtensionEntry* /* extEntry */
-);
-
-static DISPATCH_PROC(ProcFontCacheDispatch);
-static DISPATCH_PROC(ProcFontCacheGetCacheSettings);
-static DISPATCH_PROC(ProcFontCacheGetCacheStatistics);
-static DISPATCH_PROC(ProcFontCacheQueryVersion);
-static DISPATCH_PROC(ProcFontCacheChangeCacheSettings);
-static DISPATCH_PROC(SProcFontCacheDispatch);
-static DISPATCH_PROC(SProcFontCacheGetCacheSettings);
-static DISPATCH_PROC(SProcFontCacheGetCacheStatistics);
-static DISPATCH_PROC(SProcFontCacheQueryVersion);
-static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
-
-#if 0
-static unsigned char FontCacheReqCode = 0;
-#endif
-
-void
-FontCacheExtensionInit(INITARGS)
-{
- ExtensionEntry* extEntry;
-
- if (
- (extEntry = AddExtension(FONTCACHENAME,
- FontCacheNumberEvents,
- FontCacheNumberErrors,
- ProcFontCacheDispatch,
- SProcFontCacheDispatch,
- FontCacheResetProc,
- StandardMinorOpcode))) {
-#if 0
- FontCacheReqCode = (unsigned char)extEntry->base;
-#endif
- miscErrorBase = extEntry->errorBase;
- }
-}
-
-/*ARGSUSED*/
-static void
-FontCacheResetProc (extEntry)
- ExtensionEntry* extEntry;
-{
-}
-
-static int
-ProcFontCacheQueryVersion(client)
- register ClientPtr client;
-{
- xFontCacheQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xFontCacheQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = FONTCACHE_MAJOR_VERSION;
- rep.minorVersion = FONTCACHE_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, SIZEOF(xFontCacheQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcFontCacheGetCacheSettings(client)
- register ClientPtr client;
-{
- xFontCacheGetCacheSettingsReply rep;
- FontCacheSettings cinfo;
- register int n;
-
- REQUEST_SIZE_MATCH(xFontCacheGetCacheSettingsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
- /* XXX */
- FontCacheGetSettings(&cinfo);
- rep.himark = cinfo.himark;
- rep.lowmark = cinfo.lowmark;
- rep.balance = cinfo.balance;
- rep.reserve0 = 0;
- rep.reserve1 = 0;
- rep.reserve2 = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.himark, n);
- swapl(&rep.lowmark, n);
- swapl(&rep.balance, n);
- swapl(&rep.reserve0, n);
- swapl(&rep.reserve1, n);
- swapl(&rep.reserve2, n);
- }
- /* XXX */
-
- WriteToClient(client, SIZEOF(xFontCacheGetCacheSettingsReply),
- (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcFontCacheGetCacheStatistics(client)
- register ClientPtr client;
-{
- xFontCacheGetCacheStatisticsReply rep;
- FontCacheStatistics cstats;
- register int n;
-
- REQUEST_SIZE_MATCH(xFontCacheGetCacheStatisticsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = (sz_xFontCacheGetCacheStatisticsReply - 32) >> 2;
-
- /* XXX */
- FontCacheGetStatistics(&cstats);
- rep.purge_runs = cstats.purge_runs;
- rep.purge_stat = cstats.purge_stat;
- rep.balance = cstats.balance;
- rep.reserve0 = 0;
- rep.f_hits = cstats.f.hits;
- rep.f_misshits = cstats.f.misshits;
- rep.f_purged = cstats.f.purged;
- rep.f_usage = cstats.f.usage;
- rep.f_reserve0 = 0;
- rep.v_hits = cstats.v.hits;
- rep.v_misshits = cstats.v.misshits;
- rep.v_purged = cstats.v.purged;
- rep.v_usage = cstats.v.usage;
- rep.v_reserve0 = 0;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.purge_runs, n);
- swapl(&rep.purge_stat, n);
- swapl(&rep.balance, n);
- swapl(&rep.reserve0, n);
- swapl(&rep.f_hits, n);
- swapl(&rep.f_misshits, n);
- swapl(&rep.f_purged, n);
- swapl(&rep.f_usage, n);
- swapl(&rep.f_reserve0, n);
- swapl(&rep.v_hits, n);
- swapl(&rep.v_misshits, n);
- swapl(&rep.v_purged, n);
- swapl(&rep.v_usage, n);
- swapl(&rep.v_reserve0, n);
- }
- /* XXX */
- WriteToClient(client, SIZEOF(xFontCacheGetCacheStatisticsReply),
- (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcFontCacheChangeCacheSettings(client)
- register ClientPtr client;
-{
- FontCacheSettings cs;
-
- REQUEST(xFontCacheChangeCacheSettingsReq);
-
- REQUEST_SIZE_MATCH(xFontCacheChangeCacheSettingsReq);
-
- /* XXX */
- cs.himark = stuff->himark;
- cs.lowmark = stuff->lowmark;
- cs.balance = stuff->balance;
-
- if (cs.himark < 0 || cs.lowmark < 0)
- return BadValue;
- if (cs.himark <= cs.lowmark)
- return BadValue;
- if (!(10 <= cs.balance && cs.balance <= 90))
- return BadValue;
-
- if (FontCacheChangeSettings(&cs) == 0)
- return miscErrorBase + FontCacheCannotAllocMemory;
- /* XXX */
-
- return (client->noClientException);
-}
-
-static int
-ProcFontCacheDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_FontCacheQueryVersion:
- return ProcFontCacheQueryVersion(client);
- case X_FontCacheGetCacheSettings:
- return ProcFontCacheGetCacheSettings(client);
- case X_FontCacheGetCacheStatistics:
- return ProcFontCacheGetCacheStatistics(client);
- case X_FontCacheChangeCacheSettings:
- return ProcFontCacheChangeCacheSettings(client);
- default:
- return miscErrorBase + FontCacheBadProtocol;
- }
-}
-
-static int
-SProcFontCacheQueryVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xFontCacheQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcFontCacheQueryVersion(client);
-}
-
-static int
-SProcFontCacheGetCacheSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xFontCacheGetCacheSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xFontCacheGetCacheSettingsReq);
- return ProcFontCacheGetCacheSettings(client);
-}
-
-static int
-SProcFontCacheGetCacheStatistics(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xFontCacheGetCacheStatisticsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xFontCacheGetCacheStatisticsReq);
- return ProcFontCacheGetCacheStatistics(client);
-}
-
-static int
-SProcFontCacheChangeCacheSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xFontCacheChangeCacheSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xFontCacheChangeCacheSettingsReq);
- /* XXX */
- swapl(&stuff->himark, n);
- swapl(&stuff->lowmark, n);
- swapl(&stuff->balance, n);
- /* XXX */
- return ProcFontCacheChangeCacheSettings(client);
-}
-
-static int
-SProcFontCacheDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_FontCacheQueryVersion:
- return SProcFontCacheQueryVersion(client);
- case X_FontCacheGetCacheSettings:
- return SProcFontCacheGetCacheSettings(client);
- case X_FontCacheGetCacheStatistics:
- return SProcFontCacheGetCacheStatistics(client);
- case X_FontCacheChangeCacheSettings:
- return SProcFontCacheChangeCacheSettings(client);
- default:
- return miscErrorBase + FontCacheBadProtocol;
- }
-}
diff --git a/Xext/mbuf.c b/Xext/mbuf.c
deleted file mode 100644
index 4308037be..000000000
--- a/Xext/mbuf.c
+++ /dev/null
@@ -1,1783 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/mbuf.c,v 3.16 2003/11/17 22:20:26 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mbuf.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "window.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "sleepuntil.h"
-#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
-#include "multibufst.h"
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#else
-#include <stdio.h>
-#if !defined(WIN32) && !defined(Lynx)
-#include <sys/time.h>
-#endif
-#endif
-
-/* given an OtherClientPtr obj, get the ClientPtr */
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
-/* given a MultibufferPtr b, get the ClientPtr */
-#define bClient(b) (clients[CLIENT_ID(b->pPixmap->drawable.id)])
-
-#define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask)
-
-#if 0
-static unsigned char MultibufferReqCode;
-#endif
-static int MultibufferEventBase;
-static int MultibufferErrorBase;
-int MultibufferScreenIndex = -1;
-int MultibufferWindowIndex = -1;
-
-static void PerformDisplayRequest (
- MultibuffersPtr * /* ppMultibuffers */,
- MultibufferPtr * /* pMultibuffer */,
- int /* nbuf */
- );
-static Bool QueueDisplayRequest (
- ClientPtr /* client */,
- TimeStamp /* activateTime */
- );
-
-static void BumpTimeStamp (
- TimeStamp * /* ts */,
- CARD32 /* inc */
- );
-
-static void AliasMultibuffer (
- MultibuffersPtr /* pMultibuffers */,
- int /* i */
- );
-static void RecalculateMultibufferOtherEvents (
- MultibufferPtr /* pMultibuffer */
- );
-static int EventSelectForMultibuffer(
- MultibufferPtr /* pMultibuffer */,
- ClientPtr /* client */,
- Mask /* mask */
- );
-
-/*
- * The Pixmap associated with a buffer can be found as a resource
- * with this type
- */
-RESTYPE MultibufferDrawableResType;
-static int MultibufferDrawableDelete (
- pointer /* value */,
- XID /* id */
- );
-/*
- * The per-buffer data can be found as a resource with this type.
- * the resource id of the per-buffer data is the same as the resource
- * id of the pixmap
- */
-static RESTYPE MultibufferResType;
-static int MultibufferDelete (
- pointer /* value */,
- XID /* id */
- );
-
-/*
- * The per-window data can be found as a resource with this type,
- * using the window resource id
- */
-static RESTYPE MultibuffersResType;
-static int MultibuffersDelete (
- pointer /* value */,
- XID /* id */
- );
-
-/*
- * Clients other than the buffer creator attach event masks in
- * OtherClient structures; each has a resource of this type.
- */
-static RESTYPE OtherClientResType;
-static int OtherClientDelete (
- pointer /* value */,
- XID /* id */
- );
-
-/****************
- * MultibufferExtensionInit
- *
- * Called from InitExtensions in main()
- *
- ****************/
-
-extern DISPATCH_PROC(ProcGetBufferAttributes);
-
-static DISPATCH_PROC(ProcClearImageBufferArea);
-static DISPATCH_PROC(ProcCreateImageBuffers);
-static DISPATCH_PROC(ProcDestroyImageBuffers);
-static DISPATCH_PROC(ProcDisplayImageBuffers);
-static DISPATCH_PROC(ProcGetBufferInfo);
-static DISPATCH_PROC(ProcGetBufferVersion);
-static DISPATCH_PROC(ProcGetMBufferAttributes);
-static DISPATCH_PROC(ProcMultibufferDispatch);
-static DISPATCH_PROC(ProcSetBufferAttributes);
-static DISPATCH_PROC(ProcSetMBufferAttributes);
-static DISPATCH_PROC(SProcClearImageBufferArea);
-static DISPATCH_PROC(SProcCreateImageBuffers);
-static DISPATCH_PROC(SProcDestroyImageBuffers);
-static DISPATCH_PROC(SProcDisplayImageBuffers);
-static DISPATCH_PROC(SProcGetBufferAttributes);
-static DISPATCH_PROC(SProcGetBufferInfo);
-static DISPATCH_PROC(SProcGetBufferVersion);
-static DISPATCH_PROC(SProcGetMBufferAttributes);
-static DISPATCH_PROC(SProcMultibufferDispatch);
-static DISPATCH_PROC(SProcSetBufferAttributes);
-static DISPATCH_PROC(SProcSetMBufferAttributes);
-
-static void MultibufferResetProc(
- ExtensionEntry * /* extEntry */
- );
-static void SClobberNotifyEvent(
- xMbufClobberNotifyEvent * /* from */,
- xMbufClobberNotifyEvent * /* to */
- );
-static void SUpdateNotifyEvent(
- xMbufUpdateNotifyEvent * /* from */,
- xMbufUpdateNotifyEvent * /* to */
- );
-static Bool MultibufferPositionWindow(
- WindowPtr /* pWin */,
- int /* x */,
- int /* y */
- );
-
-static void SetupBackgroundPainter (
- WindowPtr /* pWin */,
- GCPtr /* pGC */
- );
-
-static int DeliverEventsToMultibuffer (
- MultibufferPtr /* pMultibuffer */,
- xEvent * /* pEvents */,
- int /* count */,
- Mask /* filter */
- );
-
-void
-MultibufferExtensionInit()
-{
- ExtensionEntry *extEntry;
- int i, j;
- ScreenPtr pScreen;
- MultibufferScreenPtr pMultibufferScreen;
-
- /*
- * allocate private pointers in windows and screens. Allocating
- * window privates may seem like an unnecessary expense, but every
- * PositionWindow call must check to see if the window is
- * multi-buffered; a resource lookup is too expensive.
- */
- MultibufferScreenIndex = AllocateScreenPrivateIndex ();
- if (MultibufferScreenIndex < 0)
- return;
- MultibufferWindowIndex = AllocateWindowPrivateIndex ();
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- if (!AllocateWindowPrivate (pScreen, MultibufferWindowIndex, 0) ||
- !(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
- {
- for (j = 0; j < i; j++)
- xfree (screenInfo.screens[j]->devPrivates[MultibufferScreenIndex].ptr);
- return;
- }
- pScreen->devPrivates[MultibufferScreenIndex].ptr = (pointer) pMultibufferScreen;
- /*
- * wrap PositionWindow to resize the pixmap when the window
- * changes size
- */
- pMultibufferScreen->PositionWindow = pScreen->PositionWindow;
- pScreen->PositionWindow = MultibufferPositionWindow;
- }
- /*
- * create the resource types
- */
- MultibufferDrawableResType =
- CreateNewResourceType(MultibufferDrawableDelete)|RC_CACHED|RC_DRAWABLE;
- MultibufferResType = CreateNewResourceType(MultibufferDelete);
- MultibuffersResType = CreateNewResourceType(MultibuffersDelete);
- OtherClientResType = CreateNewResourceType(OtherClientDelete);
- if (MultibufferDrawableResType && MultibufferResType &&
- MultibuffersResType && OtherClientResType &&
- (extEntry = AddExtension(MULTIBUFFER_PROTOCOL_NAME,
- MultibufferNumberEvents,
- MultibufferNumberErrors,
- ProcMultibufferDispatch, SProcMultibufferDispatch,
- MultibufferResetProc, StandardMinorOpcode)))
- {
-#if 0
- MultibufferReqCode = (unsigned char)extEntry->base;
-#endif
- MultibufferEventBase = extEntry->eventBase;
- MultibufferErrorBase = extEntry->errorBase;
- EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
- EventSwapVector[MultibufferEventBase + MultibufferUpdateNotify] = (EventSwapPtr) SUpdateNotifyEvent;
- }
-}
-
-/*ARGSUSED*/
-static void
-MultibufferResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
- int i;
- ScreenPtr pScreen;
- MultibufferScreenPtr pMultibufferScreen;
-
- if (MultibufferScreenIndex < 0)
- return;
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- if (pScreen->devPrivates[MultibufferScreenIndex].ptr)
- {
- pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr;
- pScreen->PositionWindow = pMultibufferScreen->PositionWindow;
- xfree (pMultibufferScreen);
- }
- }
-}
-
-static int
-ProcGetBufferVersion (client)
- register ClientPtr client;
-{
- xMbufGetBufferVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xMbufGetBufferVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = MULTIBUFFER_MAJOR_VERSION;
- rep.minorVersion = MULTIBUFFER_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof (xMbufGetBufferVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static void
-SetupBackgroundPainter (pWin, pGC)
- WindowPtr pWin;
- GCPtr pGC;
-{
- pointer gcvalues[4];
- int ts_x_origin, ts_y_origin;
- PixUnion background;
- int backgroundState;
- Mask gcmask;
-
- /*
- * First take care of any ParentRelative stuff by altering the
- * tile/stipple origin to match the coordinates of the upper-left
- * corner of the first ancestor without a ParentRelative background.
- * This coordinate is, of course, negative.
- */
-
- ts_x_origin = ts_y_origin = 0;
- while (pWin->backgroundState == ParentRelative) {
- ts_x_origin -= pWin->origin.x;
- ts_y_origin -= pWin->origin.y;
- pWin = pWin->parent;
- }
- backgroundState = pWin->backgroundState;
- background = pWin->background;
-
- switch (backgroundState)
- {
- case BackgroundPixel:
- gcvalues[0] = (pointer) background.pixel;
- gcvalues[1] = (pointer) FillSolid;
- gcmask = GCForeground|GCFillStyle;
- break;
-
- case BackgroundPixmap:
- gcvalues[0] = (pointer) FillTiled;
- gcvalues[1] = (pointer) background.pixmap;
- gcvalues[2] = (pointer)(long) ts_x_origin;
- gcvalues[3] = (pointer)(long) ts_y_origin;
- gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin;
- break;
-
- default:
- gcvalues[0] = (pointer) GXnoop;
- gcmask = GCFunction;
- }
- DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE);
-}
-
-int
-CreateImageBuffers (pWin, nbuf, ids, action, hint)
- WindowPtr pWin;
- int nbuf;
- XID *ids;
- int action;
- int hint;
-{
- MultibuffersPtr pMultibuffers;
- MultibufferPtr pMultibuffer;
- ScreenPtr pScreen;
- int width, height, depth;
- int i;
- GCPtr pClearGC = NULL;
- xRectangle clearRect;
-
- DestroyImageBuffers(pWin);
- pMultibuffers = (MultibuffersPtr) xalloc (sizeof (MultibuffersRec) +
- nbuf * sizeof (MultibufferRec));
- if (!pMultibuffers)
- return BadAlloc;
- pMultibuffers->pWindow = pWin;
- pMultibuffers->buffers = (MultibufferPtr) (pMultibuffers + 1);
- pMultibuffers->refcnt = pMultibuffers->numMultibuffer = 0;
- if (!AddResource (pWin->drawable.id, MultibuffersResType, (pointer) pMultibuffers))
- return BadAlloc;
- width = pWin->drawable.width;
- height = pWin->drawable.height;
- depth = pWin->drawable.depth;
- pScreen = pWin->drawable.pScreen;
-
- if (pWin->backgroundState != None)
- {
- pClearGC = GetScratchGC (pWin->drawable.depth, pScreen);
- SetupBackgroundPainter (pWin, pClearGC);
- clearRect.x = clearRect.y = 0;
- clearRect.width = width;
- clearRect.height = height;
- }
-
- for (i = 0; i < nbuf; i++)
- {
- pMultibuffer = &pMultibuffers->buffers[i];
- pMultibuffer->eventMask = 0L;
- pMultibuffer->otherEventMask = 0L;
- pMultibuffer->otherClients = (OtherClientsPtr) NULL;
- pMultibuffer->number = i;
- pMultibuffer->side = MultibufferSideMono;
- pMultibuffer->clobber = MultibufferUnclobbered;
- pMultibuffer->pMultibuffers = pMultibuffers;
- if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer))
- break;
- pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth);
- if (!pMultibuffer->pPixmap)
- break;
- if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap))
- {
- FreeResource (ids[i], MultibufferResType);
- (*pScreen->DestroyPixmap) (pMultibuffer->pPixmap);
- break;
- }
- pMultibuffer->pPixmap->drawable.id = ids[i];
-
- if (i > 0 && pClearGC)
- {
- ValidateGC((DrawablePtr)pMultibuffer->pPixmap, pClearGC);
- (*pClearGC->ops->PolyFillRect)((DrawablePtr)pMultibuffer->pPixmap,
- pClearGC, 1, &clearRect);
- }
- }
- pMultibuffers->numMultibuffer = i;
- pMultibuffers->refcnt = i;
- pMultibuffers->displayedMultibuffer = -1;
- if (i > 0)
- AliasMultibuffer (pMultibuffers, 0);
- pMultibuffers->updateAction = action;
- pMultibuffers->updateHint = hint;
- pMultibuffers->windowMode = MultibufferModeMono;
- pMultibuffers->lastUpdate.months = 0;
- pMultibuffers->lastUpdate.milliseconds = 0;
- pMultibuffers->width = width;
- pMultibuffers->height = height;
- pWin->devPrivates[MultibufferWindowIndex].ptr = (pointer) pMultibuffers;
- if (pClearGC) FreeScratchGC(pClearGC);
- return Success;
-}
-
-
-static int
-ProcCreateImageBuffers (client)
- register ClientPtr client;
-{
- REQUEST(xMbufCreateImageBuffersReq);
- xMbufCreateImageBuffersReply rep;
- register int n;
- WindowPtr pWin;
- XID *ids;
- int len, nbuf;
- int i;
- int err;
-
- REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq);
- len = stuff->length - (sizeof(xMbufCreateImageBuffersReq) >> 2);
- if (len == 0)
- return BadLength;
- if (!(pWin = LookupWindow (stuff->window, client)))
- return BadWindow;
- if (pWin->drawable.class == InputOnly)
- return BadMatch;
- switch (stuff->updateAction)
- {
- case MultibufferUpdateActionUndefined:
- case MultibufferUpdateActionBackground:
- case MultibufferUpdateActionUntouched:
- case MultibufferUpdateActionCopied:
- break;
- default:
- client->errorValue = stuff->updateAction;
- return BadValue;
- }
- switch (stuff->updateHint)
- {
- case MultibufferUpdateHintFrequent:
- case MultibufferUpdateHintIntermittent:
- case MultibufferUpdateHintStatic:
- break;
- default:
- client->errorValue = stuff->updateHint;
- return BadValue;
- }
- nbuf = len;
- ids = (XID *) &stuff[1];
- for (i = 0; i < nbuf; i++)
- {
- LEGAL_NEW_RESOURCE(ids[i], client);
- }
- err = CreateImageBuffers (pWin, nbuf, ids,
- stuff->updateAction, stuff->updateHint);
- if (err != Success)
- return err;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.numberBuffer = ((MultibuffersPtr) (pWin->devPrivates[MultibufferWindowIndex].ptr))->numMultibuffer;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.numberBuffer, n);
- }
- WriteToClient(client, sizeof (xMbufCreateImageBuffersReply), (char*)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcDisplayImageBuffers (client)
- register ClientPtr client;
-{
- REQUEST(xMbufDisplayImageBuffersReq);
- MultibufferPtr *pMultibuffer;
- MultibuffersPtr *ppMultibuffers;
- int nbuf;
- XID *ids;
- int i, j;
- CARD32 minDelay;
- TimeStamp activateTime, bufferTime;
-
-
- REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq);
- nbuf = stuff->length - (sizeof (xMbufDisplayImageBuffersReq) >> 2);
- if (!nbuf)
- return Success;
- minDelay = stuff->minDelay;
- ids = (XID *) &stuff[1];
- ppMultibuffers = (MultibuffersPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibuffersPtr));
- pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL(nbuf * sizeof (MultibufferPtr));
- if (!ppMultibuffers || !pMultibuffer)
- {
- if (ppMultibuffers) DEALLOCATE_LOCAL(ppMultibuffers);
- if (pMultibuffer) DEALLOCATE_LOCAL(pMultibuffer);
- client->errorValue = 0;
- return BadAlloc;
- }
- activateTime.months = 0;
- activateTime.milliseconds = 0;
- for (i = 0; i < nbuf; i++)
- {
- pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i],
-MultibufferResType);
- if (!pMultibuffer[i])
- {
- DEALLOCATE_LOCAL(ppMultibuffers);
- DEALLOCATE_LOCAL(pMultibuffer);
- client->errorValue = ids[i];
- return MultibufferErrorBase + MultibufferBadBuffer;
- }
- ppMultibuffers[i] = pMultibuffer[i]->pMultibuffers;
- for (j = 0; j < i; j++)
- {
- if (ppMultibuffers[i] == ppMultibuffers[j])
- {
- DEALLOCATE_LOCAL(ppMultibuffers);
- DEALLOCATE_LOCAL(pMultibuffer);
- client->errorValue = ids[i];
- return BadMatch;
- }
- }
- bufferTime = ppMultibuffers[i]->lastUpdate;
- BumpTimeStamp (&bufferTime, minDelay);
- if (CompareTimeStamps (bufferTime, activateTime) == LATER)
- activateTime = bufferTime;
- }
- UpdateCurrentTime ();
- if (CompareTimeStamps (activateTime, currentTime) == LATER &&
- QueueDisplayRequest (client, activateTime))
- {
- ;
- }
- else
- PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf);
-
- DEALLOCATE_LOCAL(ppMultibuffers);
- DEALLOCATE_LOCAL(pMultibuffer);
- return Success;
-}
-
-
-static int
-ProcDestroyImageBuffers (client)
- register ClientPtr client;
-{
- REQUEST (xMbufDestroyImageBuffersReq);
- WindowPtr pWin;
-
- REQUEST_SIZE_MATCH (xMbufDestroyImageBuffersReq);
- if (!(pWin = LookupWindow (stuff->window, client)))
- return BadWindow;
- DestroyImageBuffers (pWin);
- return Success;
-}
-
-static int
-ProcSetMBufferAttributes (client)
- register ClientPtr client;
-{
- REQUEST (xMbufSetMBufferAttributesReq);
- WindowPtr pWin;
- MultibuffersPtr pMultibuffers;
- int len;
- Mask vmask;
- Mask index2;
- CARD32 updateHint;
- XID *vlist;
-
- REQUEST_AT_LEAST_SIZE (xMbufSetMBufferAttributesReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
- if (!pMultibuffers)
- return BadMatch;
- len = stuff->length - (sizeof (xMbufSetMBufferAttributesReq) >> 2);
- vmask = stuff->valueMask;
- if (len != Ones (vmask))
- return BadLength;
- vlist = (XID *) &stuff[1];
- while (vmask)
- {
- index2 = (Mask) lowbit (vmask);
- vmask &= ~index2;
- switch (index2)
- {
- case MultibufferWindowUpdateHint:
- updateHint = (CARD32) *vlist;
- switch (updateHint)
- {
- case MultibufferUpdateHintFrequent:
- case MultibufferUpdateHintIntermittent:
- case MultibufferUpdateHintStatic:
- pMultibuffers->updateHint = updateHint;
- break;
- default:
- client->errorValue = updateHint;
- return BadValue;
- }
- vlist++;
- break;
- default:
- client->errorValue = stuff->valueMask;
- return BadValue;
- }
- }
- return Success;
-}
-
-static int
-ProcGetMBufferAttributes (client)
- ClientPtr client;
-{
- REQUEST (xMbufGetMBufferAttributesReq);
- WindowPtr pWin;
- MultibuffersPtr pMultibuffers;
- XID *ids;
- xMbufGetMBufferAttributesReply rep;
- int i, n;
-
- REQUEST_SIZE_MATCH (xMbufGetMBufferAttributesReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
- if (!pMultibuffers)
- return BadAccess;
- ids = (XID *) ALLOCATE_LOCAL (pMultibuffers->numMultibuffer * sizeof (XID));
- if (!ids)
- return BadAlloc;
- for (i = 0; i < pMultibuffers->numMultibuffer; i++)
- ids[i] = pMultibuffers->buffers[i].pPixmap->drawable.id;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = pMultibuffers->numMultibuffer;
- rep.displayedBuffer = pMultibuffers->displayedMultibuffer;
- rep.updateAction = pMultibuffers->updateAction;
- rep.updateHint = pMultibuffers->updateHint;
- rep.windowMode = pMultibuffers->windowMode;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.displayedBuffer, n);
- SwapLongs (ids, pMultibuffers->numMultibuffer);
- }
- WriteToClient (client, sizeof(xMbufGetMBufferAttributesReply),
- (char *)&rep);
- WriteToClient (client, (int)(pMultibuffers->numMultibuffer * sizeof (XID)),
- (char *)ids);
- DEALLOCATE_LOCAL((pointer) ids);
- return client->noClientException;
-}
-
-static int
-ProcSetBufferAttributes (client)
- register ClientPtr client;
-{
- REQUEST(xMbufSetBufferAttributesReq);
- MultibufferPtr pMultibuffer;
- int len;
- Mask vmask, index2;
- XID *vlist;
- Mask eventMask;
- int result;
-
- REQUEST_AT_LEAST_SIZE (xMbufSetBufferAttributesReq);
- pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
- if (!pMultibuffer)
- return MultibufferErrorBase + MultibufferBadBuffer;
- len = stuff->length - (sizeof (xMbufSetBufferAttributesReq) >> 2);
- vmask = stuff->valueMask;
- if (len != Ones (vmask))
- return BadLength;
- vlist = (XID *) &stuff[1];
- while (vmask)
- {
- index2 = (Mask) lowbit (vmask);
- vmask &= ~index2;
- switch (index2)
- {
- case MultibufferBufferEventMask:
- eventMask = (Mask) *vlist;
- vlist++;
- result = EventSelectForMultibuffer (pMultibuffer, client, eventMask);
- if (result != Success)
- return result;
- break;
- default:
- client->errorValue = stuff->valueMask;
- return BadValue;
- }
- }
- return Success;
-}
-
-int
-ProcGetBufferAttributes (client)
- register ClientPtr client;
-{
- REQUEST(xMbufGetBufferAttributesReq);
- MultibufferPtr pMultibuffer;
- xMbufGetBufferAttributesReply rep;
- OtherClientsPtr other;
- int n;
-
- REQUEST_SIZE_MATCH (xMbufGetBufferAttributesReq);
- pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
- if (!pMultibuffer)
- return MultibufferErrorBase + MultibufferBadBuffer;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.window = pMultibuffer->pMultibuffers->pWindow->drawable.id;
- if (bClient (pMultibuffer) == client)
- rep.eventMask = pMultibuffer->eventMask;
- else
- {
- rep.eventMask = (Mask) 0L;
- for (other = pMultibuffer->otherClients; other; other = other->next)
- if (SameClient (other, client))
- {
- rep.eventMask = other->mask;
- break;
- }
- }
- rep.bufferIndex = pMultibuffer->number;
- rep.side = pMultibuffer->side;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.window, n);
- swapl(&rep.eventMask, n);
- swaps(&rep.bufferIndex, n);
- }
- WriteToClient(client, sizeof (xMbufGetBufferAttributesReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcGetBufferInfo (client)
- register ClientPtr client;
-{
- REQUEST (xMbufGetBufferInfoReq);
- DrawablePtr pDrawable;
- xMbufGetBufferInfoReply rep;
- ScreenPtr pScreen;
- int i, j, k;
- int n;
- xMbufBufferInfo *pInfo;
- int nInfo;
- DepthPtr pDepth;
-
- pDrawable = (DrawablePtr) LookupDrawable (stuff->drawable, client);
- if (!pDrawable)
- return BadDrawable;
- pScreen = pDrawable->pScreen;
- nInfo = 0;
- for (i = 0; i < pScreen->numDepths; i++)
- {
- pDepth = &pScreen->allowedDepths[i];
- nInfo += pDepth->numVids;
- }
- pInfo = (xMbufBufferInfo *)
- ALLOCATE_LOCAL (nInfo * sizeof (xMbufBufferInfo));
- if (!pInfo)
- return BadAlloc;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = nInfo * (sizeof (xMbufBufferInfo) >> 2);
- rep.normalInfo = nInfo;
- rep.stereoInfo = 0;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.normalInfo, n);
- swaps(&rep.stereoInfo, n);
- }
-
- k = 0;
- for (i = 0; i < pScreen->numDepths; i++)
- {
- pDepth = &pScreen->allowedDepths[i];
- for (j = 0; j < pDepth->numVids; j++)
- {
- pInfo[k].visualID = pDepth->vids[j];
- pInfo[k].maxBuffers = 0;
- pInfo[k].depth = pDepth->depth;
- if (client->swapped)
- {
- swapl (&pInfo[k].visualID, n);
- swaps (&pInfo[k].maxBuffers, n);
- }
- k++;
- }
- }
- WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (pointer) &rep);
- WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (pointer) pInfo);
- DEALLOCATE_LOCAL ((pointer) pInfo);
- return client->noClientException;
-}
-
-static int
-ProcClearImageBufferArea (client)
- register ClientPtr client;
-{
- REQUEST (xMbufClearImageBufferAreaReq);
- MultibufferPtr pMultibuffer;
- WindowPtr pWin;
- xRectangle clearRect;
- int width, height;
- DrawablePtr pDrawable;
- ScreenPtr pScreen;
-
- REQUEST_SIZE_MATCH (xMbufClearImageBufferAreaReq);
- pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
- if (!pMultibuffer)
- return MultibufferErrorBase + MultibufferBadBuffer;
- if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse))
- {
- client->errorValue = stuff->exposures;
- return(BadValue);
- }
- pWin = pMultibuffer->pMultibuffers->pWindow;
- width = pWin->drawable.width;
- height = pWin->drawable.height;
- pScreen = pWin->drawable.pScreen;
-
- clearRect.x = stuff->x;
- clearRect.y = stuff->y;
- clearRect.width = stuff->width ? stuff->width : width;
- clearRect.height = stuff->height ? stuff->height : height;
-
- if (pWin->backgroundState != None)
- {
- GCPtr pClearGC;
- pClearGC = GetScratchGC (pWin->drawable.depth, pScreen);
- SetupBackgroundPainter (pWin, pClearGC);
-
- if (pMultibuffer->number == pMultibuffer->pMultibuffers->displayedMultibuffer)
- pDrawable = (DrawablePtr)pWin;
- else
- pDrawable = (DrawablePtr)pMultibuffer->pPixmap;
-
- ValidateGC(pDrawable, pClearGC);
- (*pClearGC->ops->PolyFillRect) (pDrawable, pClearGC, 1, &clearRect);
- FreeScratchGC(pClearGC);
- }
-
- if (stuff->exposures)
- {
- RegionRec region;
- BoxRec box;
- box.x1 = clearRect.x;
- box.y1 = clearRect.y;
- box.x2 = clearRect.x + clearRect.width;
- box.y2 = clearRect.y + clearRect.height;
- REGION_INIT(pScreen, &region, &box, 1);
- MultibufferExpose(pMultibuffer, &region);
- REGION_UNINIT(pScreen, &region);
- }
- return Success;
-}
-
-static int
-ProcMultibufferDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_MbufGetBufferVersion:
- return ProcGetBufferVersion (client);
- case X_MbufCreateImageBuffers:
- return ProcCreateImageBuffers (client);
- case X_MbufDisplayImageBuffers:
- return ProcDisplayImageBuffers (client);
- case X_MbufDestroyImageBuffers:
- return ProcDestroyImageBuffers (client);
- case X_MbufSetMBufferAttributes:
- return ProcSetMBufferAttributes (client);
- case X_MbufGetMBufferAttributes:
- return ProcGetMBufferAttributes (client);
- case X_MbufSetBufferAttributes:
- return ProcSetBufferAttributes (client);
- case X_MbufGetBufferAttributes:
- return ProcGetBufferAttributes (client);
- case X_MbufGetBufferInfo:
- return ProcGetBufferInfo (client);
- case X_MbufClearImageBufferArea:
- return ProcClearImageBufferArea (client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcGetBufferVersion (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufGetBufferVersionReq);
-
- swaps (&stuff->length, n);
- return ProcGetBufferVersion (client);
-}
-
-static int
-SProcCreateImageBuffers (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufCreateImageBuffersReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq);
- swapl (&stuff->window, n);
- SwapRestL(stuff);
- return ProcCreateImageBuffers (client);
-}
-
-static int
-SProcDisplayImageBuffers (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufDisplayImageBuffersReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq);
- swaps (&stuff->minDelay, n);
- swaps (&stuff->maxDelay, n);
- SwapRestL(stuff);
- return ProcDisplayImageBuffers (client);
-}
-
-static int
-SProcDestroyImageBuffers (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufDestroyImageBuffersReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xMbufDestroyImageBuffersReq);
- swapl (&stuff->window, n);
- return ProcDestroyImageBuffers (client);
-}
-
-static int
-SProcSetMBufferAttributes (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufSetMBufferAttributesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xMbufSetMBufferAttributesReq);
- swapl (&stuff->window, n);
- swapl (&stuff->valueMask, n);
- SwapRestL(stuff);
- return ProcSetMBufferAttributes (client);
-}
-
-static int
-SProcGetMBufferAttributes (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufGetMBufferAttributesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xMbufGetMBufferAttributesReq);
- swapl (&stuff->window, n);
- return ProcGetMBufferAttributes (client);
-}
-
-static int
-SProcSetBufferAttributes (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufSetBufferAttributesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xMbufSetBufferAttributesReq);
- swapl (&stuff->buffer, n);
- swapl (&stuff->valueMask, n);
- SwapRestL(stuff);
- return ProcSetBufferAttributes (client);
-}
-
-static int
-SProcGetBufferAttributes (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufGetBufferAttributesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xMbufGetBufferAttributesReq);
- swapl (&stuff->buffer, n);
- return ProcGetBufferAttributes (client);
-}
-
-static int
-SProcGetBufferInfo (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xMbufGetBufferInfoReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xMbufGetBufferInfoReq);
- swapl (&stuff->drawable, n);
- return ProcGetBufferInfo (client);
-}
-
-static int
-SProcClearImageBufferArea(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xMbufClearImageBufferAreaReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xMbufClearImageBufferAreaReq);
- swapl(&stuff->buffer, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return ProcClearImageBufferArea(client);
-}
-
-static int
-SProcMultibufferDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_MbufGetBufferVersion:
- return SProcGetBufferVersion (client);
- case X_MbufCreateImageBuffers:
- return SProcCreateImageBuffers (client);
- case X_MbufDisplayImageBuffers:
- return SProcDisplayImageBuffers (client);
- case X_MbufDestroyImageBuffers:
- return SProcDestroyImageBuffers (client);
- case X_MbufSetMBufferAttributes:
- return SProcSetMBufferAttributes (client);
- case X_MbufGetMBufferAttributes:
- return SProcGetMBufferAttributes (client);
- case X_MbufSetBufferAttributes:
- return SProcSetBufferAttributes (client);
- case X_MbufGetBufferAttributes:
- return SProcGetBufferAttributes (client);
- case X_MbufGetBufferInfo:
- return SProcGetBufferInfo (client);
- case X_MbufClearImageBufferArea:
- return SProcClearImageBufferArea (client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SUpdateNotifyEvent (from, to)
- xMbufUpdateNotifyEvent *from, *to;
-{
- to->type = from->type;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->buffer, to->buffer);
- cpswapl (from->timeStamp, to->timeStamp);
-}
-
-static void
-SClobberNotifyEvent (from, to)
- xMbufClobberNotifyEvent *from, *to;
-{
- to->type = from->type;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->buffer, to->buffer);
- to->state = from->state;
-}
-
-static void
-PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf)
- MultibufferPtr *pMultibuffer;
- MultibuffersPtr *ppMultibuffers;
- int nbuf;
-{
- GCPtr pGC;
- PixmapPtr pPrevPixmap, pNewPixmap;
- xRectangle clearRect;
- WindowPtr pWin;
- RegionPtr pExposed;
- int i;
- MultibufferPtr pPrevMultibuffer;
- XID graphicsExpose;
-
- UpdateCurrentTime ();
- for (i = 0; i < nbuf; i++)
- {
- pWin = ppMultibuffers[i]->pWindow;
- pGC = GetScratchGC (pWin->drawable.depth, pWin->drawable.pScreen);
- pPrevMultibuffer =
- &ppMultibuffers[i]->buffers[ppMultibuffers[i]->displayedMultibuffer];
- pPrevPixmap = pPrevMultibuffer->pPixmap;
- pNewPixmap = pMultibuffer[i]->pPixmap;
- switch (ppMultibuffers[i]->updateAction)
- {
- case MultibufferUpdateActionUndefined:
- break;
- case MultibufferUpdateActionBackground:
- SetupBackgroundPainter (pWin, pGC);
- ValidateGC ((DrawablePtr)pPrevPixmap, pGC);
- clearRect.x = 0;
- clearRect.y = 0;
- clearRect.width = pPrevPixmap->drawable.width;
- clearRect.height = pPrevPixmap->drawable.height;
- (*pGC->ops->PolyFillRect) ((DrawablePtr)pPrevPixmap, pGC,
- 1, &clearRect);
- break;
- case MultibufferUpdateActionUntouched:
- /* copy the window to the pixmap that represents the
- * currently displayed buffer
- */
- if (pPrevMultibuffer->eventMask & ExposureMask)
- {
- graphicsExpose = TRUE;
- DoChangeGC (pGC, GCGraphicsExposures, &graphicsExpose, FALSE);
- }
- ValidateGC ((DrawablePtr)pPrevPixmap, pGC);
- pExposed = (*pGC->ops->CopyArea)
- ((DrawablePtr) pWin,
- (DrawablePtr) pPrevPixmap,
- pGC,
- 0, 0,
- pWin->drawable.width, pWin->drawable.height,
- 0, 0);
-
- /* if we couldn't copy the whole window to the buffer,
- * send expose events (if any client wants them)
- */
- if (pPrevMultibuffer->eventMask & ExposureMask)
- { /* some client wants expose events */
- if (pExposed)
- {
- RegionPtr pWinSize;
-
- pWinSize = CreateUnclippedWinSize (pWin);
- /* pExposed is window-relative, but at this point
- * pWinSize is screen-relative. Make pWinSize be
- * window-relative so that region ops involving
- * pExposed and pWinSize behave sensibly.
- */
- REGION_TRANSLATE(pWin->drawable.pScreen, pWinSize,
- -pWin->drawable.x, -pWin->drawable.y);
- REGION_INTERSECT(pWin->drawable.pScreen, pExposed,
- pExposed, pWinSize);
- REGION_DESTROY(pWin->drawable.pScreen, pWinSize);
- MultibufferExpose (pPrevMultibuffer, pExposed);
- REGION_DESTROY(pWin->drawable.pScreen, pExposed);
- }
- graphicsExpose = FALSE;
- DoChangeGC (pGC, GCGraphicsExposures, &graphicsExpose, FALSE);
- }
- break; /* end case MultibufferUpdateActionUntouched */
-
- case MultibufferUpdateActionCopied:
- ValidateGC ((DrawablePtr)pPrevPixmap, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr)pNewPixmap,
- (DrawablePtr)pPrevPixmap, pGC,
- 0, 0,
- pWin->drawable.width, pWin->drawable.height,
- 0, 0);
- break;
- } /* end switch on update action */
-
- /* display the new buffer */
- ValidateGC ((DrawablePtr)pWin, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr)pNewPixmap, (DrawablePtr)pWin, pGC,
- 0, 0,
- pWin->drawable.width, pWin->drawable.height,
- 0, 0);
- ppMultibuffers[i]->lastUpdate = currentTime;
- MultibufferUpdate (pMultibuffer[i],
- ppMultibuffers[i]->lastUpdate.milliseconds);
- AliasMultibuffer (ppMultibuffers[i],
- pMultibuffer[i] - ppMultibuffers[i]->buffers);
- FreeScratchGC (pGC);
- }
-}
-
-DrawablePtr
-GetBufferPointer (pWin, i)
- WindowPtr pWin;
- int i;
-{
- MultibuffersPtr pMultibuffers;
-
- if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr))
- return NULL;
- return (DrawablePtr) pMultibuffers->buffers[i].pPixmap;
-}
-
-int
-DisplayImageBuffers (ids, nbuf)
- XID *ids;
- int nbuf;
-{
- MultibufferPtr *pMultibuffer;
- MultibuffersPtr *pMultibuffers;
- int i, j;
-
- pMultibuffer = (MultibufferPtr *) ALLOCATE_LOCAL (nbuf * sizeof *pMultibuffer +
- nbuf * sizeof *pMultibuffers);
- if (!pMultibuffer)
- return BadAlloc;
- pMultibuffers = (MultibuffersPtr *) (pMultibuffer + nbuf);
- for (i = 0; i < nbuf; i++)
- {
- pMultibuffer[i] = (MultibufferPtr) LookupIDByType (ids[i], MultibufferResType);
- if (!pMultibuffer[i])
- {
- DEALLOCATE_LOCAL (pMultibuffer);
- return MultibufferErrorBase + MultibufferBadBuffer;
- }
- pMultibuffers[i] = pMultibuffer[i]->pMultibuffers;
- for (j = 0; j < i; j++)
- if (pMultibuffers[i] == pMultibuffers[j])
- {
- DEALLOCATE_LOCAL (pMultibuffer);
- return BadMatch;
- }
- }
- PerformDisplayRequest (pMultibuffers, pMultibuffer, nbuf);
- DEALLOCATE_LOCAL (pMultibuffer);
- return Success;
-}
-
-
-static Bool
-QueueDisplayRequest (client, activateTime)
- ClientPtr client;
- TimeStamp activateTime;
-{
- /* see xtest.c:ProcXTestFakeInput for code similar to this */
-
- if (!ClientSleepUntil(client, &activateTime, NULL, NULL))
- {
- return FALSE;
- }
- /* swap the request back so we can simply re-execute it */
- if (client->swapped)
- {
- register int n;
- REQUEST (xMbufDisplayImageBuffersReq);
-
- SwapRestL(stuff);
- swaps (&stuff->length, n);
- swaps (&stuff->minDelay, n);
- swaps (&stuff->maxDelay, n);
- }
- ResetCurrentRequest (client);
- client->sequence--;
- return TRUE;
-}
-
-
-/*
- * Deliver events to a buffer
- */
-
-static int
-DeliverEventsToMultibuffer (pMultibuffer, pEvents, count, filter)
- MultibufferPtr pMultibuffer;
- xEvent *pEvents;
- int count;
- Mask filter;
-{
- int deliveries = 0, nondeliveries = 0;
- int attempt;
- OtherClients *other;
-
- /* if nobody wants the event, we're done */
- if (!((pMultibuffer->otherEventMask|pMultibuffer->eventMask) & filter))
- return 0;
-
- /* maybe send event to owner */
- if ((attempt = TryClientEvents(
- bClient(pMultibuffer), pEvents, count, pMultibuffer->eventMask, filter, (GrabPtr) 0)) != 0)
- {
- if (attempt > 0)
- deliveries++;
- else
- nondeliveries--;
- }
-
- /* maybe send event to other clients */
- for (other = pMultibuffer->otherClients; other; other=other->next)
- {
- if ((attempt = TryClientEvents(
- rClient(other), pEvents, count, other->mask, filter, (GrabPtr) 0)) != 0)
- {
- if (attempt > 0)
- deliveries++;
- else
- nondeliveries--;
- }
- }
- if (deliveries)
- return deliveries;
- return nondeliveries;
-}
-
-/*
- * Send Expose events to interested clients
- */
-
-void
-MultibufferExpose (pMultibuffer, pRegion)
- MultibufferPtr pMultibuffer;
- RegionPtr pRegion;
-{
- if (pRegion && !REGION_NIL(pRegion))
- {
- xEvent *pEvent;
- PixmapPtr pPixmap;
- register xEvent *pe;
- register BoxPtr pBox;
- register int i;
- int numRects;
-
- pPixmap = pMultibuffer->pPixmap;
- REGION_TRANSLATE(pPixmap->drawable.pScreen, pRegion,
- -pPixmap->drawable.x, -pPixmap->drawable.y);
- /* XXX MultibufferExpose "knows" the region representation */
- numRects = REGION_NUM_RECTS(pRegion);
- pBox = REGION_RECTS(pRegion);
-
- pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent));
- if (pEvent) {
- pe = pEvent;
-
- for (i=1; i<=numRects; i++, pe++, pBox++)
- {
- pe->u.u.type = Expose;
- pe->u.expose.window = pPixmap->drawable.id;
- pe->u.expose.x = pBox->x1;
- pe->u.expose.y = pBox->y1;
- pe->u.expose.width = pBox->x2 - pBox->x1;
- pe->u.expose.height = pBox->y2 - pBox->y1;
- pe->u.expose.count = (numRects - i);
- }
- (void) DeliverEventsToMultibuffer (pMultibuffer, pEvent, numRects,
- ExposureMask);
- DEALLOCATE_LOCAL(pEvent);
- }
- }
-}
-
-/* send UpdateNotify event */
-void
-MultibufferUpdate (pMultibuffer, time2)
- MultibufferPtr pMultibuffer;
- CARD32 time2;
-{
- xMbufUpdateNotifyEvent event;
-
- event.type = MultibufferEventBase + MultibufferUpdateNotify;
- event.buffer = pMultibuffer->pPixmap->drawable.id;
- event.timeStamp = time2;
- (void) DeliverEventsToMultibuffer (pMultibuffer, (xEvent *)&event,
- 1, (Mask)MultibufferUpdateNotifyMask);
-}
-
-/*
- * The sample implementation will never generate MultibufferClobberNotify
- * events
- */
-
-void
-MultibufferClobber (pMultibuffer)
- MultibufferPtr pMultibuffer;
-{
- xMbufClobberNotifyEvent event;
-
- event.type = MultibufferEventBase + MultibufferClobberNotify;
- event.buffer = pMultibuffer->pPixmap->drawable.id;
- event.state = pMultibuffer->clobber;
- (void) DeliverEventsToMultibuffer (pMultibuffer, (xEvent *)&event,
- 1, (Mask)MultibufferClobberNotifyMask);
-}
-
-/*
- * make the resource id for buffer i refer to the window
- * drawable instead of the pixmap;
- */
-
-static void
-AliasMultibuffer (pMultibuffers, i)
- MultibuffersPtr pMultibuffers;
- int i;
-{
- MultibufferPtr pMultibuffer;
-
- if (i == pMultibuffers->displayedMultibuffer)
- return;
- /*
- * remove the old association
- */
- if (pMultibuffers->displayedMultibuffer >= 0)
- {
- pMultibuffer = &pMultibuffers->buffers[pMultibuffers->displayedMultibuffer];
- ChangeResourceValue (pMultibuffer->pPixmap->drawable.id,
- MultibufferDrawableResType,
- (pointer) pMultibuffer->pPixmap);
- }
- /*
- * make the new association
- */
- pMultibuffer = &pMultibuffers->buffers[i];
- ChangeResourceValue (pMultibuffer->pPixmap->drawable.id,
- MultibufferDrawableResType,
- (pointer) pMultibuffers->pWindow);
- pMultibuffers->displayedMultibuffer = i;
-}
-
-/*
- * free everything associated with multibuffering for this
- * window
- */
-
-void
-DestroyImageBuffers (pWin)
- WindowPtr pWin;
-{
- FreeResourceByType (pWin->drawable.id, MultibuffersResType, FALSE);
- /* Zero out the window's pointer to the buffers so they won't be reused */
- pWin->devPrivates[MultibufferWindowIndex].ptr = NULL;
-}
-
-/*
- * resize the buffers when the window is resized
- */
-
-static Bool
-MultibufferPositionWindow (pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- ScreenPtr pScreen;
- MultibufferScreenPtr pMultibufferScreen;
- MultibuffersPtr pMultibuffers;
- MultibufferPtr pMultibuffer;
- int width, height;
- int i;
- int dx, dy, dw, dh;
- int sourcex, sourcey;
- int destx, desty;
- PixmapPtr pPixmap;
- GCPtr pGC;
- int savewidth, saveheight;
- xRectangle clearRect;
- Bool clear;
-
- pScreen = pWin->drawable.pScreen;
- pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr;
- (*pMultibufferScreen->PositionWindow) (pWin, x, y);
-
- /* if this window is not multibuffered, we're done */
- if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr))
- return TRUE;
-
- /* if new size is same as old, we're done */
- if (pMultibuffers->width == pWin->drawable.width &&
- pMultibuffers->height == pWin->drawable.height)
- return TRUE;
-
- width = pWin->drawable.width;
- height = pWin->drawable.height;
- dx = pWin->drawable.x - pMultibuffers->x;
- dy = pWin->drawable.x - pMultibuffers->y;
- dw = width - pMultibuffers->width;
- dh = height - pMultibuffers->height;
- GravityTranslate (0, 0, -dx, -dy, dw, dh,
- pWin->bitGravity, &destx, &desty);
-
- /* if the window grew, remember to paint the window background,
- * and maybe send expose events, for the new areas of the buffers
- */
- clear = pMultibuffers->width < width || pMultibuffers->height < height ||
- pWin->bitGravity == ForgetGravity;
-
- sourcex = 0;
- sourcey = 0;
- savewidth = pMultibuffers->width;
- saveheight = pMultibuffers->height;
- /* clip rectangle to source and destination */
- if (destx < 0)
- {
- savewidth += destx;
- sourcex -= destx;
- destx = 0;
- }
- if (destx + savewidth > width)
- savewidth = width - destx;
- if (desty < 0)
- {
- saveheight += desty;
- sourcey -= desty;
- desty = 0;
- }
- if (desty + saveheight > height)
- saveheight = height - desty;
-
- pMultibuffers->width = width;
- pMultibuffers->height = height;
- pMultibuffers->x = pWin->drawable.x;
- pMultibuffers->y = pWin->drawable.y;
-
- pGC = GetScratchGC (pWin->drawable.depth, pScreen);
- if (clear)
- {
- SetupBackgroundPainter (pWin, pGC);
- clearRect.x = 0;
- clearRect.y = 0;
- clearRect.width = width;
- clearRect.height = height;
- }
- for (i = 0; i < pMultibuffers->numMultibuffer; i++)
- {
- pMultibuffer = &pMultibuffers->buffers[i];
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
- pWin->drawable.depth);
- if (!pPixmap)
- {
- DestroyImageBuffers (pWin);
- break;
- }
- ValidateGC ((DrawablePtr)pPixmap, pGC);
- /*
- * I suppose this could avoid quite a bit of work if
- * it computed the minimal area required.
- */
- if (clear)
- (*pGC->ops->PolyFillRect) ((DrawablePtr)pPixmap, pGC, 1, &clearRect);
- if (pWin->bitGravity != ForgetGravity)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr)pMultibuffer->pPixmap,
- (DrawablePtr)pPixmap, pGC,
- sourcex, sourcey, savewidth, saveheight,
- destx, desty);
- }
- pPixmap->drawable.id = pMultibuffer->pPixmap->drawable.id;
- (*pScreen->DestroyPixmap) (pMultibuffer->pPixmap);
- pMultibuffer->pPixmap = pPixmap;
- if (i != pMultibuffers->displayedMultibuffer)
- {
- ChangeResourceValue (pPixmap->drawable.id,
- MultibufferDrawableResType,
- (pointer) pPixmap);
- }
- }
- FreeScratchGC (pGC);
- return TRUE;
-}
-
-/* Resource delete func for MultibufferDrawableResType */
-/*ARGSUSED*/
-static int
-MultibufferDrawableDelete (value, id)
- pointer value;
- XID id;
-{
- DrawablePtr pDrawable = (DrawablePtr)value;
- WindowPtr pWin;
- MultibuffersPtr pMultibuffers;
- PixmapPtr pPixmap;
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- pWin = (WindowPtr) pDrawable;
- pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr;
- pPixmap = pMultibuffers->buffers[pMultibuffers->displayedMultibuffer].pPixmap;
- }
- else
- {
- pPixmap = (PixmapPtr) pDrawable;
- }
- (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
- return Success;
-}
-
-/* Resource delete func for MultibufferResType */
-/*ARGSUSED*/
-static int
-MultibufferDelete (value, id)
- pointer value;
- XID id;
-{
- MultibufferPtr pMultibuffer = (MultibufferPtr)value;
- MultibuffersPtr pMultibuffers;
-
- pMultibuffers = pMultibuffer->pMultibuffers;
- if (--pMultibuffers->refcnt == 0)
- {
- FreeResourceByType (pMultibuffers->pWindow->drawable.id,
- MultibuffersResType, TRUE);
- xfree (pMultibuffers);
- }
- return Success;
-}
-
-/* Resource delete func for MultibuffersResType */
-/*ARGSUSED*/
-static int
-MultibuffersDelete (value, id)
- pointer value;
- XID id;
-{
- MultibuffersPtr pMultibuffers = (MultibuffersPtr)value;
- int i;
-
- if (pMultibuffers->refcnt == pMultibuffers->numMultibuffer)
- {
- for (i = pMultibuffers->numMultibuffer; --i >= 0; )
- FreeResource (pMultibuffers->buffers[i].pPixmap->drawable.id, 0);
- }
- return Success;
-}
-
-/* Resource delete func for OtherClientResType */
-static int
-OtherClientDelete (value, id)
- pointer value;
- XID id;
-{
- MultibufferPtr pMultibuffer = (MultibufferPtr)value;
- register OtherClientsPtr other, prev;
-
- prev = 0;
- for (other = pMultibuffer->otherClients; other; other = other->next)
- {
- if (other->resource == id)
- {
- if (prev)
- prev->next = other->next;
- else
- pMultibuffer->otherClients = other->next;
- xfree (other);
- RecalculateMultibufferOtherEvents (pMultibuffer);
- break;
- }
- prev = other;
- }
- return Success;
-}
-
-static int
-EventSelectForMultibuffer (pMultibuffer, client, mask)
- MultibufferPtr pMultibuffer;
- ClientPtr client;
- Mask mask;
-{
- OtherClientsPtr other;
-
- if (mask & ~ValidEventMasks)
- {
- client->errorValue = mask;
- return BadValue;
- }
- if (bClient (pMultibuffer) == client)
- {
- pMultibuffer->eventMask = mask;
- }
- else /* some other client besides the creator wants events */
- {
- for (other = pMultibuffer->otherClients; other; other = other->next)
- {
- if (SameClient (other, client))
- {
- if (mask == 0)
- {
- FreeResource (other->resource, RT_NONE);
- break;
- }
- other->mask = mask;
- break;
- }
- }
- if (!other)
- { /* new client that never selected events on this buffer before */
- other = (OtherClients *) xalloc (sizeof (OtherClients));
- if (!other)
- return BadAlloc;
- other->mask = mask;
- other->resource = FakeClientID (client->index);
- if (!AddResource (other->resource, OtherClientResType, (pointer) pMultibuffer))
- {
- xfree (other);
- return BadAlloc;
- }
- other->next = pMultibuffer->otherClients;
- pMultibuffer->otherClients = other;
- }
- RecalculateMultibufferOtherEvents (pMultibuffer);
- }
- return (client->noClientException);
-}
-
-/* or together all the otherClients event masks */
-static void
-RecalculateMultibufferOtherEvents (pMultibuffer)
- MultibufferPtr pMultibuffer;
-{
- Mask otherEventMask;
- OtherClients *other;
-
- otherEventMask = 0L;
- for (other = pMultibuffer->otherClients; other; other = other->next)
- otherEventMask |= other->mask;
- pMultibuffer->otherEventMask = otherEventMask;
-}
-
-/* add milliseconds to a timestamp, handling overflow */
-static void
-BumpTimeStamp (ts, inc)
-TimeStamp *ts;
-CARD32 inc;
-{
- CARD32 newms;
-
- newms = ts->milliseconds + inc;
- if (newms < ts->milliseconds)
- ts->months++;
- ts->milliseconds = newms;
-}
diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c
deleted file mode 100644
index 99400c90a..000000000
--- a/Xext/mbufbf.c
+++ /dev/null
@@ -1,1026 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/mbufbf.c,v 3.6 2003/11/10 18:21:42 tsi Exp $ */
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-
-/* $Xorg: mbufbf.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "inputstr.h"
-#include "validate.h"
-#include <sys/time.h>
-
-#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
-#define _MULTIBUF_BUFFER_
-#include "multibufst.h"
-
-/*
-Support for doublebuffer hardare
-
-This code is designed to support doublebuffer hardware where the
-displayed buffer is selected on a per-pixel basis by an additional bit
-plane, called the select plane. It could probably be easily modified
-to work with systems that use window-id planes.
-
-This is done by creating a new drawable type, DRAWABLE_BUFFER. The
-type has the same exact layout as a window drawable. Your code should
-treat a DRAWABLE_BUFFER the same as it would tread a DRAWABLE_WINDOW
-when handling the gc drawing functions. In addition, PaintWindowBackground,
-CopyWindow, and all of the gc drawing functions to be able to draw into both
-framebuffers. Which framebuffer to draw into is selected by the contents of
- pWin->devPrivates[frameWindowPrivateIndex].
-The content of the devPrivate is either from frameBuffer[0] or
-frameBuffer[1], depending on which buffer is being drawn into. When
- pWin->devPrivates[frameWindowPrivateIndex] == frameBuffer[0],
-the functions should draw into the front framebuffer. When
- pWin->devPrivates[frameWindowPrivateIndex] == frameBuffer[1],
-the functions should draw into the back framebuffer.
-
-In addition, you need to provide a function that allows you to copy
-bits between the buffers (optional since CopyArea can be used) and a
-function that draws into the select plane. Then, you need to register
-your functions and other information, by calling:
-
-void
-RegisterDoubleBufferHardware(pScreen, nInfo, pInfo, frameBuffer, selectPlane,
- CopyBufferBitsFunc, DrawSelectPlaneFunc)
- int nInfo;
- xMbufBufferInfo *pInfo;
- DevUnion *frameBuffer;
- DevUnion selectPlane;
-
-"pInfo" is an array indicating which visuals and depths that double
-buffering is supported on. "nInfo" is the length of the array.
-
-"frameBuffer" is array of length 2. The contents of the array element
-is ddx-specific. The content of frameBuffer[0] should, when placed in
-the window private, indicate that framebuffer 0 should be drawn into.
-The contents of frameBuffer[1], when placed into the window private,
-should indicate that framebuffer 1 should be drawn into.
-
-"selectPlane" is ddx-specific. It should contain information
-neccessary for your displayProc to access the select plane.
-It is passed to DrawSelectPlaneFunc.
-
-"CopyBufferBitsFunc" is a ddx-specific function that copies from one
-buffer of a multibuffered window to another buffer. If the CopyBufferBitsFunc
-is NULL, a default function will be used that calls pScreen->CopyArea.
-
- void CopyBufferBitsFunc(pMBWindow, srcBufferNum, dstBufferNum)
- mbufWindowPtr pMBWindow;
- int srcBufferNum, dstBufferNum;
-
-"DrawSelectPlaneFunc" is a ddx-specific function that fills the
-regions "prgn" of select plane with the value "bufferNum". If
-selectPlane is a DrawablePtr (such as a PixmapPtr), you can pass
-NULL for DrawSelectPlaneFunc, a default function will be used that
-calls FillRectangle on the selectPlane.
-
- void DrawSelectPlaneFunc(pScreen, selectPlane, prgn, bufferNum)
- ScreenPtr pScreen;
- DevUnion selectPlane;
- RegionPtr prgn;
- long bufferNum;
-
-...
-...
-...
-
-*/
-
-#define MAX_BUFFERS 2 /* Only supports 2 buffers */
-#define FRONT_BUFFER 0
-#define BACK_BUFFER 1
-
-
-/* Buffer drawables have the same structure as window drawables */
-typedef WindowRec BufferRec;
-typedef WindowPtr BufferPtr;
-
-
-/*
- * Call RegisterHdwrBuffer for every screen that has doublebuffer hardware.
- */
-
-static int bufNumInfo[MAXSCREENS];
-static xMbufBufferInfo *bufInfo[MAXSCREENS];
-static DevUnion *bufFrameBuffer[MAXSCREENS];
-static DevUnion bufselectPlane[MAXSCREENS];
-static void (* bufCopyBufferBitsFunc[MAXSCREENS])();
-static void (* bufDrawSelectPlaneFunc[MAXSCREENS])();
-
-static Bool bufMultibufferInit();
-
-
-void
-RegisterDoubleBufferHardware(pScreen, nInfo, pInfo, frameBuffer, selectPlane,
- CopyBufferBitsFunc, DrawSelectPlaneFunc)
- ScreenPtr pScreen;
- int nInfo;
- xMbufBufferInfo *pInfo;
- DevUnion *frameBuffer;
- DevUnion selectPlane;
- void (* CopyBufferBitsFunc)();
- void (* DrawSelectPlaneFunc)();
-{
- bufNumInfo[pScreen->myNum] = nInfo;
- bufInfo[pScreen->myNum] = pInfo;
- bufFrameBuffer[pScreen->myNum] = frameBuffer;
- bufselectPlane[pScreen->myNum] = selectPlane;
-
- bufCopyBufferBitsFunc[pScreen->myNum] = CopyBufferBitsFunc;
- bufDrawSelectPlaneFunc[pScreen->myNum] = DrawSelectPlaneFunc;
-
- /* Register ourselves with device-independent multibuffers code */
- RegisterMultibufferInit(pScreen, bufMultibufferInit);
-}
-
-
-/*
- * Called by Multibuffer extension initialization.
- * Initializes mbufScreenRec and its devPrivate.
- */
-
-static Bool NoopDDA_True() { return TRUE; }
-static Bool bufPositionWindow();
-static int bufCreateImageBuffers();
-static void bufDestroyImageBuffers();
-static void bufDisplayImageBuffers();
-static void bufClearImageBufferArea();
-static void bufDestroyBuffer();
-static void bufCopyBufferBits();
-static void bufDrawSelectPlane();
-static void bufWrapScreenFuncs();
-static void bufResetProc();
-
-static void bufPostValidateTree();
-static void bufClipNotify();
-static void bufWindowExposures();
-static Bool bufChangeWindowAttributes();
-static void bufClearToBackground();
-static void bufCopyWindow();
-
-extern WindowPtr *WindowTable;
-
-static Bool
-bufMultibufferInit(pScreen, pMBScreen)
- ScreenPtr pScreen;
- mbufScreenPtr pMBScreen;
-{
- mbufBufferPrivPtr pMBPriv;
- BoxRec box;
-
- /* Multibuffer info */
- pMBScreen->nInfo = bufNumInfo[pScreen->myNum];
- pMBScreen->pInfo = bufInfo[pScreen->myNum];
-
- /* Hooks */
- pMBScreen->CreateImageBuffers = bufCreateImageBuffers;
- pMBScreen->DestroyImageBuffers = bufDestroyImageBuffers;
- pMBScreen->DisplayImageBuffers = bufDisplayImageBuffers;
- pMBScreen->ClearImageBufferArea = bufClearImageBufferArea;
- pMBScreen->ChangeMBufferAttributes = NoopDDA_True;
- pMBScreen->ChangeBufferAttributes = NoopDDA_True;
- pMBScreen->DeleteBufferDrawable = bufDestroyBuffer;
- pMBScreen->WrapScreenFuncs = bufWrapScreenFuncs;
- pMBScreen->ResetProc = bufResetProc;
- /* Create devPrivate part */
- pMBPriv = (mbufBufferPrivPtr) xalloc(sizeof *pMBPriv);
- if (!pMBPriv)
- return (FALSE);
-
- pMBScreen->devPrivate.ptr = (pointer) pMBPriv;
- pMBPriv->frameBuffer = bufFrameBuffer[pScreen->myNum];
- pMBPriv->selectPlane = bufselectPlane[pScreen->myNum];
-
- /*
- * Initializing the subtractRgn to the screen area will ensure that
- * the selectPlane will get cleared on the first PostValidateTree.
- */
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
-
- pMBPriv->rgnChanged = TRUE;
- REGION_INIT(pScreen, &pMBPriv->backBuffer, &box, 1);
- REGION_INIT(pScreen, &pMBPriv->subtractRgn, &box, 1);
- REGION_NULL(pScreen, &pMBPriv->unionRgn);
-
- /* Misc functions */
- pMBPriv->CopyBufferBits = bufCopyBufferBitsFunc[pScreen->myNum];
- pMBPriv->DrawSelectPlane = bufDrawSelectPlaneFunc[pScreen->myNum];
-
- if (!pMBPriv->CopyBufferBits)
- pMBPriv->CopyBufferBits = bufCopyBufferBits;
-
- if (!pMBPriv->DrawSelectPlane)
- pMBPriv->DrawSelectPlane = bufDrawSelectPlane;
-
- /* screen functions */
- pMBPriv->funcsWrapped = 0;
- pMBPriv->inClearToBackground = FALSE;
- pMBPriv->WindowExposures = NULL;
- pMBPriv->CopyWindow = NULL;
- pMBPriv->ClearToBackground = NULL;
- pMBPriv->ClipNotify = NULL;
- pMBPriv->ChangeWindowAttributes = NULL;
-
- /* Start out wrapped to clear select plane */
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,PostValidateTree, bufPostValidateTree);
- return TRUE;
-}
-
-static void
-UpdateBufferFromWindow(pBuffer, pWin)
- BufferPtr pBuffer;
- WindowPtr pWin;
-{
- pBuffer->drawable.x = pWin->drawable.x;
- pBuffer->drawable.y = pWin->drawable.y;
- pBuffer->drawable.width = pWin->drawable.width;
- pBuffer->drawable.height = pWin->drawable.height;
-
- pBuffer->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- /* Update for PaintWindowBackground */
- pBuffer->parent = pWin->parent;
-
- /*
- * Make the borderClip the same as the clipList so
- * NotClippedByChildren comes out with just clipList.
- */
-
- pBuffer->clipList = pWin->clipList;
- pBuffer->borderClip = pWin->clipList;
- pBuffer->winSize = pWin->winSize;
- pBuffer->borderSize = pWin->borderSize;
-
- pBuffer->origin = pWin->origin;
-}
-
-static BufferPtr
-bufCreateBuffer(pScreen, pWin, bufferNum)
- ScreenPtr pScreen;
- WindowPtr pWin;
- int bufferNum;
-{
- mbufBufferPrivPtr pMBPriv;
- DevUnion *devPrivates;
- BufferPtr pBuffer;
- int i;
-
- pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- pBuffer = AllocateWindow(pWin->drawable.pScreen);
- if (!pBuffer)
- return (NULL);
-
- /* XXX- Until we know what is needed, copy everything. */
- devPrivates = pBuffer->devPrivates;
- *pBuffer = *pWin;
- pBuffer->devPrivates = devPrivates;
-
- pBuffer->drawable.type = DRAWABLE_BUFFER;
- pBuffer->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- pBuffer->nextSib = NULL;
- pBuffer->prevSib = NULL;
- pBuffer->firstChild = NULL;
- pBuffer->lastChild = NULL;
-
- /* XXX - Worry about backingstore later */
- pBuffer->backStorage = NULL;
- pBuffer->backingStore = NotUseful;
-
- /* XXX - Need to call pScreen->CreateWindow for tile/stipples
- * or should I just copy the devPrivates?
- */
-
- for (i=0; i < pScreen->WindowPrivateLen; i++)
- pBuffer->devPrivates[i] = pWin->devPrivates[i];
-
- pBuffer->devPrivates[frameWindowPrivateIndex] =
- pMBPriv->frameBuffer[bufferNum];
-
- return pBuffer;
-}
-
-static void
-bufDestroyBuffer(pDrawable)
- DrawablePtr pDrawable;
-{
- xfree(pDrawable);
-}
-
-/*ARGSUSED*/
-static int
-bufCreateImageBuffers (pWin, nbuf, ids, action, hint)
- WindowPtr pWin;
- int nbuf;
- XID *ids;
- int action;
- int hint;
-{
- ScreenPtr pScreen;
- mbufScreenPtr pMBScreen;
- mbufWindowPtr pMBWindow;
- mbufBufferPtr pMBBuffer;
- int i;
-
- pScreen = pWin->drawable.pScreen;
- pMBScreen = MB_SCREEN_PRIV(pScreen);
- pMBWindow = MB_WINDOW_PRIV(pWin);
-
- pMBWindow->devPrivate.ptr = (pointer) REGION_CREATE(pScreen, 0,0);
- if (!pMBWindow->devPrivate.ptr)
- return(0);
- REGION_COPY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr,
- &pWin->clipList);
-
- for (i = 0; i < nbuf; i++)
- {
- pMBBuffer = pMBWindow->buffers + i;
- pMBBuffer->pDrawable = (DrawablePtr) bufCreateBuffer(pScreen,pWin,i);
-
- if (!pMBBuffer->pDrawable)
- break;
-
- if (!AddResource (ids[i], MultibufferDrawableResType,
- (pointer) pMBBuffer->pDrawable))
- {
- bufDestroyBuffer((BufferPtr) pMBBuffer->pDrawable);
- break;
- }
- pMBBuffer->pDrawable->id = ids[i];
-
- /*
- * If window is already mapped, generate exposures and
- * clear the area of the newly buffers.
- */
-
- if ((pWin->realized) && (i != pMBWindow->displayedMultibuffer))
- (* pMBScreen->ClearImageBufferArea)(pMBBuffer, 0,0, 0,0, TRUE);
- }
-
- return i;
-}
-
-static void
-bufDestroyImageBuffers(pWin)
- WindowPtr pWin;
-{
- ScreenPtr pScreen;
- mbufWindowPtr pMBWindow;
-
- pScreen = pWin->drawable.pScreen;
-
- if (pMBWindow = MB_WINDOW_PRIV(pWin))
- {
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- /*
- * if the backbuffer is currently being displayed, move the bits
- * to the frontbuffer and display it instead.
- */
-
- if (pWin->realized && (pMBWindow->displayedMultibuffer == BACK_BUFFER))
- {
- (* pMBPriv->CopyBufferBits)(pMBWindow, BACK_BUFFER, FRONT_BUFFER);
- REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer,
- &pMBPriv->backBuffer, &pWin->clipList);
- (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
- &pWin->clipList, FRONT_BUFFER);
- }
-
- /* Switch window rendering to front buffer */
- pWin->devPrivates[frameWindowPrivateIndex] =
- pMBPriv->frameBuffer[FRONT_BUFFER];
-
- REGION_DESTROY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr);
- pMBWindow->devPrivate.ptr = NULL;
- }
-}
-
-/*
- * Can be replaced by pScreen->ClearToBackground if pBuffer->eventMask
- * and wOtherEventsMasks(pBuffer) were setup.
- */
-
-static void
-bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures)
- mbufBufferPtr pMBBuffer;
- short x,y;
- unsigned short w,h;
- Bool generateExposures;
-{
- BoxRec box;
- RegionRec reg;
- RegionPtr pBSReg = NullRegion;
- ScreenPtr pScreen;
- BoxPtr extents;
- int x1, y1, x2, y2;
- BufferPtr pBuffer;
-
- pBuffer = (BufferPtr) pMBBuffer->pDrawable;
- /* compute everything using ints to avoid overflow */
-
- x1 = pBuffer->drawable.x + x;
- y1 = pBuffer->drawable.y + y;
- if (w)
- x2 = x1 + (int) w;
- else
- x2 = x1 + (int) pBuffer->drawable.width - (int) x;
- if (h)
- y2 = y1 + h;
- else
- y2 = y1 + (int) pBuffer->drawable.height - (int) y;
-
- extents = &pBuffer->clipList.extents;
-
- /* clip the resulting rectangle to the window clipList extents. This
- * makes sure that the result will fit in a box, given that the
- * screen is < 32768 on a side.
- */
-
- if (x1 < extents->x1)
- x1 = extents->x1;
- if (x2 > extents->x2)
- x2 = extents->x2;
- if (y1 < extents->y1)
- y1 = extents->y1;
- if (y2 > extents->y2)
- y2 = extents->y2;
-
- if (x2 <= x1 || y2 <= y1)
- {
- x2 = x1 = 0;
- y2 = y1 = 0;
- }
-
- box.x1 = x1;
- box.x2 = x2;
- box.y1 = y1;
- box.y2 = y2;
-
- pScreen = pBuffer->drawable.pScreen;
- REGION_INIT(pScreen, &reg, &box, 1);
- if (pBuffer->backStorage)
- {
- /*
- * If the window has backing-store on, call through the
- * ClearToBackground vector to handle the special semantics
- * (i.e. things backing store is to be cleared out and
- * an Expose event is to be generated for those areas in backing
- * store if generateExposures is TRUE).
- */
- pBSReg = (* pScreen->ClearBackingStore)(pBuffer, x, y, w, h,
- generateExposures);
- }
-
- REGION_INTERSECT(pScreen, &reg, &reg, &pBuffer->clipList);
- if (pBuffer->backgroundState != None)
- (*pScreen->PaintWindowBackground)(pBuffer, &reg, PW_BACKGROUND);
- if (generateExposures)
- MultibufferExpose(pMBBuffer, &reg);
-#ifdef _notdef
- /* XXBS - This is the original miClearToBackground code.
- * WindowExposures needs to be called (or the functionality emulated)
- * in order for backingStore to work, but first, pBuffer->eventMask
- * and wOtherEventsMasks(pBuffer) need to be setup correctly.
- */
-
- if (generateExposures)
- (*pScreen->WindowExposures)(pBuffer, &reg, pBSReg);
- else if (pBuffer->backgroundState != None)
- (*pScreen->PaintWindowBackground)(pBuffer, &reg, PW_BACKGROUND);
-#endif
- REGION_UNINIT(pScreen, &reg);
- if (pBSReg)
- REGION_DESTROY(pScreen, pBSReg);
-}
-
-static void
-bufWrapScreenFuncs(pScreen)
- ScreenPtr pScreen;
-{
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,PostValidateTree, bufPostValidateTree);
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,ClipNotify, bufClipNotify);
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,WindowExposures,bufWindowExposures);
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,ChangeWindowAttributes, bufChangeWindowAttributes);
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,ClearToBackground,bufClearToBackground);
- WRAP_SCREEN_FUNC(pScreen,pMBPriv,CopyWindow,bufCopyWindow);
-}
-
-static void
-bufResetProc(pScreen)
- ScreenPtr pScreen;
-{
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- /*
- * frameBuffer, selectPlane, and pInfo should be freed by
- * whoever called RegisterDoubleBufferHardware
- */
-
- REGION_UNINIT(pScreen, &pMBPriv->backBuffer);
- REGION_UNINIT(pScreen, &pMBPriv->subtractRgn);
- REGION_UNINIT(pScreen, &pMBPriv->unionRgn);
- xfree(pMBPriv);
-}
-
-/*---------------------------------------------------------------------------*/
-
-/*
- * Used if CopyBufferBitsFunc is not provided when registering.
- * This should work for everybody since CopyArea needs to support
- * copying between buffers anyway.
- */
-
-static void
-bufCopyBufferBits(pMBWindow, srcBufferNum, dstBufferNum)
- mbufWindowPtr pMBWindow;
- int srcBufferNum, dstBufferNum;
-{
- DrawablePtr pSrcBuffer, pDstBuffer;
- GCPtr pGC;
-
- pSrcBuffer = pMBWindow->buffers[srcBufferNum].pDrawable;
- pDstBuffer = pMBWindow->buffers[dstBufferNum].pDrawable;
-
- pGC = GetScratchGC (pDstBuffer->depth, pDstBuffer->pScreen);
- if (!pGC)
- return;
-
- ValidateGC (pDstBuffer, pGC);
- (* pGC->ops->CopyArea) (pSrcBuffer, pDstBuffer, pGC,
- 0,0, pDstBuffer->width, pDstBuffer->height, 0,0);
- FreeScratchGC (pGC);
-}
-
-/*
- * Used if DrawSelectPlanFunc is not provided for when registering.
- * However, it only works if selectPlane.ptr is a drawable. Also
- * assumes that painting with color 0 selects the front buffer,
- * while color 1 selects the back buffer.
- */
-
-static void
-bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
- ScreenPtr pScreen;
- DevUnion selectPlane;
- RegionPtr prgn;
- long bufferNum;
-{
- DrawablePtr pDrawable;
- GCPtr pGC;
- register int i;
- register BoxPtr pbox;
- register xRectangle *prect;
- int numRects;
- XID value;
-
- if (REGION_NUM_RECTS(prgn) == 0)
- return;
-
- pDrawable = (DrawablePtr) selectPlane.ptr;
- pGC = GetScratchGC (pDrawable->depth, pScreen);
- if (!pGC)
- return;
-
- prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) *
- sizeof(xRectangle));
- if (!prect)
- {
- FreeScratchGC(pGC);
- return;
- }
-
- value = (XID) bufferNum;
- DoChangeGC(pGC, GCForeground, &value, 0);
- ValidateGC(pDrawable, pGC);
-
- numRects = REGION_NUM_RECTS(prgn);
- pbox = REGION_RECTS(prgn);
- for (i= numRects; --i >= 0; pbox++, prect++)
- {
- prect->x = pbox->x1;
- prect->y = pbox->y1;
- prect->width = pbox->x2 - pbox->x1;
- prect->height = pbox->y2 - pbox->y1;
- }
- prect -= numRects;
- (* pGC->ops->PolyFillRect)(pDrawable, pGC, numRects, prect);
-
- DEALLOCATE_LOCAL(prect);
- FreeScratchGC (pGC);
-}
-
-
-static void
-bufDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf)
- ScreenPtr pScreen;
- mbufBufferPtr *ppMBBuffer;
- mbufWindowPtr *ppMBWindow;
- int nbuf;
-{
- WindowPtr pWin;
- BufferPtr pPrevBuffer, pNewBuffer;
- int i, number;
- mbufBufferPrivPtr pMBPriv;
- mbufBufferPtr pPrevMBBuffer;
-
- pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- for (i = 0; i < nbuf; i++)
- {
- number = ppMBBuffer[i]->number; /* 0=frontbuffer, 1=backbuffer */
- pWin = ppMBWindow[i]->pWindow;
- pPrevMBBuffer = MB_DISPLAYED_BUFFER(ppMBWindow[i]);
-
- pPrevBuffer = (BufferPtr) pPrevMBBuffer->pDrawable;
- pNewBuffer = (BufferPtr) ppMBBuffer[i]->pDrawable;
-
- if (pPrevBuffer != pNewBuffer)
- {
- RegionPtr backBuffer = &pMBPriv->backBuffer;
-
- /*
- * Update the select plane and the backBuffer region.
- */
-
- (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
- &pWin->clipList, number);
-
- if (number == BACK_BUFFER)
- REGION_UNION(pScreen, backBuffer, backBuffer,
- &pWin->clipList);
- else
- REGION_SUBTRACT(pScreen, backBuffer, backBuffer,
- &pWin->clipList);
-
- /* Switch which framebuffer the window draws into */
- pWin->devPrivates[frameWindowPrivateIndex] =
- pMBPriv->frameBuffer[number];
- }
-
- switch (ppMBWindow[i]->updateAction)
- {
- case MultibufferUpdateActionUndefined:
- break;
- case MultibufferUpdateActionBackground:
- (* MB_SCREEN_PRIV(pScreen)->ClearImageBufferArea)
- (pPrevMBBuffer, 0,0, 0,0, FALSE);
- break;
- case MultibufferUpdateActionUntouched:
- break;
- case MultibufferUpdateActionCopied:
- if (pPrevBuffer != pNewBuffer)
- {
- (* pMBPriv->CopyBufferBits) (ppMBWindow[i],
- ppMBBuffer[i]->number, pPrevMBBuffer->number);
- }
- break;
- }
- }
-}
-
-/* Updates the backBuffer region and paints the selectPlane. */
-
-static void
-bufPostValidateTree(pParent, pChild, kind)
- WindowPtr pParent, pChild;
- VTKind kind;
-{
- ScreenPtr pScreen;
- mbufBufferPrivPtr pMBPriv;
-
- if (pParent)
- pScreen = pParent->drawable.pScreen;
- else if (pChild)
- pScreen = pChild->drawable.pScreen;
- else
- return; /* Hopeless */
-
- pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, PostValidateTree);
- if (pScreen->PostValidateTree)
- (* pScreen->PostValidateTree)(pParent, pChild, kind);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, PostValidateTree);
-
- /* Does backBuffer need to change? */
- if (pMBPriv->rgnChanged)
- {
- RegionRec exposed;
- RegionPtr pSubtractRgn, pUnionRgn;
- Bool overlap;
-
- pMBPriv->rgnChanged = FALSE;
-
- pSubtractRgn = &pMBPriv->subtractRgn;
- pUnionRgn = &pMBPriv->unionRgn;
- REGION_VALIDATE(pScreen, pSubtractRgn, &overlap);
-#ifdef DEBUG
- if (overlap)
- FatalError("bufPostValidateTree: subtractRgn overlaps");
-#endif
- REGION_VALIDATE(pScreen, pUnionRgn, &overlap);
-#ifdef DEBUG
- if (overlap)
- FatalError("bufPostValidateTree: unionRgn overlaps");
-#endif
-
- /* Update backBuffer: subtract must come before union */
- REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer,
- pSubtractRgn);
- REGION_UNION(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer,
- pUnionRgn);
-
- /* Paint gained and lost backbuffer areas in select plane */
- REGION_NULL(pScreen, &exposed);
- REGION_SUBTRACT(pScreen, &exposed, pSubtractRgn, pUnionRgn);
- (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
- &exposed, FRONT_BUFFER);
-
- REGION_SUBTRACT(pScreen, &exposed, pUnionRgn, pSubtractRgn);
- (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
- &exposed, BACK_BUFFER);
-
- REGION_UNINIT(pScreen, &exposed);
- REGION_EMPTY(pScreen, pSubtractRgn);
- REGION_EMPTY(pScreen, pUnionRgn);
- }
-}
-
-/*
- * If the window is multibuffered and displaying the backbuffer,
- * add the old clipList to the subtractRgn and add the new clipList
- * to the unionRgn. PostValidateTree will use subtractRgn and unionRgn
- * to update the backBuffer region and the selectPlane.
- *
- * Copy changes to the window structure into the buffers.
- * Send ClobberNotify events.
- */
-
-static void
-bufClipNotify(pWin, dx,dy)
- WindowPtr pWin;
- int dx,dy;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
- mbufWindowPtr pMBWindow;
- int i;
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, ClipNotify);
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify)(pWin, dx,dy);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, ClipNotify);
-
- if (pMBWindow = MB_WINDOW_PRIV(pWin))
- {
- RegionPtr pOldClipList = (RegionPtr) pMBWindow->devPrivate.ptr;
-
- if (! REGION_EQUAL(pScreen, pOldClipList, &pWin->clipList))
- {
- if (pMBWindow->displayedMultibuffer == BACK_BUFFER)
- {
- pMBPriv->rgnChanged = TRUE;
- REGION_APPEND(pScreen, &pMBPriv->subtractRgn, pOldClipList);
- REGION_APPEND(pScreen, &pMBPriv->unionRgn, &pWin->clipList);
- }
-
- REGION_COPY(pScreen, pOldClipList,&pWin->clipList);
- }
-
- /* Update buffer x,y,w,h, and clipList */
- for (i=0; i<pMBWindow->numMultibuffer; i++)
- {
- mbufBufferPtr pMBBuffer = pMBWindow->buffers + i;
- if (pMBBuffer->clobber != pWin->visibility)
- {
- pMBBuffer->clobber = pWin->visibility;
- MultibufferClobber(pMBBuffer);
- }
- UpdateBufferFromWindow(pMBBuffer->pDrawable, pWin);
- }
- }
-}
-
-/*
- * Updates buffer's background fields when the window's changes.
- * This is necessary because pScreen->PaintWindowBackground
- * is used to paint the buffer.
- *
- * XXBS - Backingstore state will have be tracked too if it is supported.
- */
-
-static Bool
-bufChangeWindowAttributes(pWin, mask)
- WindowPtr pWin;
- unsigned long mask;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
- mbufWindowPtr pMBWindow;
- Bool ret;
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, Bool, ChangeWindowAttributes);
- ret = (* pScreen->ChangeWindowAttributes)(pWin, mask);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, Bool, ChangeWindowAttributes);
-
- if (pMBWindow = MB_WINDOW_PRIV(pWin))
- {
- if (mask & (CWBackPixmap | CWBackPixel))
- {
- BufferPtr pBuffer;
- int i;
-
- for (i=0; i<pMBWindow->displayedMultibuffer; i++)
- {
- pBuffer = (BufferPtr) pMBWindow->buffers[i].pDrawable;
- pBuffer->backgroundState = pWin->backgroundState;
- pBuffer->background = pWin->background;
- }
- }
- }
- return ret;
-}
-
-/*
- * Send exposures and clear the background for a buffer whenever
- * its corresponding window is exposed, except when called by
- * ClearToBackground.
- */
-
-static void
-bufWindowExposures(pWin, prgn, other_exposed)
- WindowPtr pWin;
- register RegionPtr prgn, other_exposed;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- mbufWindowPtr pMBWindow = MB_WINDOW_PRIV(pWin);
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
- RegionRec tmp_rgn;
- int i;
- Bool handleBuffers;
-
- handleBuffers = (!pMBPriv->inClearToBackground) &&
- (pWin->drawable.type == DRAWABLE_WINDOW) &&
- pMBWindow && (prgn && !REGION_NIL(prgn));
-
- /* miWindowExposures munges prgn and other_exposed. */
- if (handleBuffers)
- {
- REGION_NULL(pScreen, &tmp_rgn);
- REGION_COPY(pScreen, &tmp_rgn, prgn);
- }
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures);
- (* pScreen->WindowExposures) (pWin, prgn, other_exposed);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures);
-
- if (!handleBuffers)
- return;
-
- /*
- * Send expose events to all clients. Paint the exposed region for all
- * buffers except the displayed buffer since it is handled when the
- * window is painted.
- *
- * XXBS - Will have to be re-written to handle BackingStore on buffers.
- */
-
- for (i=0; i<pMBWindow->numMultibuffer; i++)
- {
- mbufBufferPtr pMBBuffer;
- BufferPtr pBuffer;
-
- pMBBuffer = pMBWindow->buffers + i;
- pBuffer = (BufferPtr) pMBBuffer->pDrawable;
-
- if (i != pMBWindow->displayedMultibuffer)
- (* pScreen->PaintWindowBackground)(pBuffer,&tmp_rgn,PW_BACKGROUND);
- if ((pMBBuffer->otherEventMask | pMBBuffer->eventMask) & ExposureMask)
- MultibufferExpose(pMBBuffer, &tmp_rgn);
- }
-
- REGION_UNINIT(pScreen, &tmp_rgn);
-}
-
-/*
- * Set ``inClearToBackground'' so that WindowExposures does not attempt
- * to send expose events or clear the background on the buffers.
- */
-
-static void
-bufClearToBackground(pWin, x,y,w,h, sendExpose)
- WindowPtr pWin;
- int x,y, w,h;
- Bool sendExpose;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
-
- pMBPriv->inClearToBackground = TRUE;
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, ClearToBackground);
- (* pScreen->ClearToBackground)(pWin, x,y,w,h, sendExpose);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, ClearToBackground);
-
- pMBPriv->inClearToBackground = FALSE;
-}
-
-/*
- * Move bits in both buffers. It does this by calling pScreen->CopyWindow
- * twice, once with the root window's devPrivate[frameWindowPrivateIndex]
- * pointing to the frontbuffer pixmap and once with it pointed to the
- * backbuffer pixmap. It does this if there are *any* existing multibuffered
- * window... a possible optimization is to copy the backbuffer only if this
- * window or its inferiors are multibuffered. May be faster, maybe not.
- *
- * XXX - Only works if your CopyWindow checks the root window's devPrivate
- * to see which buffer to draw into. Works for cfbPaintWindow.
- */
-
-/*ARGSUSED*/
-static void
-bufCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- mbufBufferPrivPtr pMBPriv = MB_SCREEN_PRIV_BUFFER(pScreen);
- WindowPtr pwinroot;
- DevUnion save;
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, CopyWindow);
-
- pwinroot = WindowTable[pScreen->myNum];
- save = pwinroot->devPrivates[frameWindowPrivateIndex];
-
- /*
- * Copy front buffer
- */
-
- pwinroot->devPrivates[frameWindowPrivateIndex] =
- pMBPriv->frameBuffer[FRONT_BUFFER];
- (* pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
-
- /*
- * Copy back buffer
- */
-
- /* CopyWindow translates prgnSrc... translate it back for 2nd call. */
- REGION_TRANSLATE(pScreen, prgnSrc,
- ptOldOrg.x - pWin->drawable.x,
- ptOldOrg.y - pWin->drawable.y);
- pwinroot->devPrivates[frameWindowPrivateIndex] =
- pMBPriv->frameBuffer[BACK_BUFFER];
- (* pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
-
- pwinroot->devPrivates[frameWindowPrivateIndex] = save;
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, CopyWindow);
-}
diff --git a/Xext/mbufpx.c b/Xext/mbufpx.c
deleted file mode 100644
index 9c531c292..000000000
--- a/Xext/mbufpx.c
+++ /dev/null
@@ -1,647 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/mbufpx.c,v 3.4 2001/12/14 19:58:49 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mbufpx.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "inputstr.h"
-#include <sys/time.h>
-
-#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
-#define _MULTIBUF_PIXMAP_
-#include "multibufst.h"
-
-
-static Bool NoopDDA_True() { return TRUE; }
-
-static Bool pixPositionWindow();
-static int pixCreateImageBuffers();
-static void pixDisplayImageBuffers();
-static void pixClearImageBufferArea();
-static void pixDeleteBufferDrawable();
-static void pixWrapScreenFuncs();
-static void pixResetProc();
-
-Bool
-pixMultibufferInit(pScreen, pMBScreen)
- ScreenPtr pScreen;
- mbufScreenPtr pMBScreen;
-{
- int i, j, k;
- xMbufBufferInfo *pInfo;
- int nInfo;
- DepthPtr pDepth;
- mbufPixmapPrivPtr pMBPriv;
-
- pMBScreen->CreateImageBuffers = pixCreateImageBuffers;
- pMBScreen->DestroyImageBuffers = (void (*)())NoopDDA;
- pMBScreen->DisplayImageBuffers = pixDisplayImageBuffers;
- pMBScreen->ClearImageBufferArea = pixClearImageBufferArea;
- pMBScreen->ChangeMBufferAttributes = NoopDDA_True;
- pMBScreen->ChangeBufferAttributes = NoopDDA_True;
- pMBScreen->DeleteBufferDrawable = pixDeleteBufferDrawable;
- pMBScreen->WrapScreenFuncs = pixWrapScreenFuncs;
- pMBScreen->ResetProc = pixResetProc;
-
- /* Support every depth and visual combination that the screen does */
-
- nInfo = 0;
- for (i = 0; i < pScreen->numDepths; i++)
- {
- pDepth = &pScreen->allowedDepths[i];
- nInfo += pDepth->numVids;
- }
-
- pInfo = (xMbufBufferInfo *) xalloc (nInfo * sizeof (xMbufBufferInfo));
- if (!pInfo)
- return FALSE;
-
- k = 0;
- for (i = 0; i < pScreen->numDepths; i++)
- {
- pDepth = &pScreen->allowedDepths[i];
- for (j = 0; j < pDepth->numVids; j++)
- {
- pInfo[k].visualID = pDepth->vids[j];
- pInfo[k].maxBuffers = 0;
- pInfo[k].depth = pDepth->depth;
- k++;
- }
- }
-
- pMBScreen->nInfo = nInfo;
- pMBScreen->pInfo = pInfo;
-
- /*
- * Setup the devPrivate to mbufScreenRec
- */
-
- pMBPriv = (mbufPixmapPrivPtr) xalloc(sizeof(* pMBPriv));
- if (!pMBPriv)
- {
- xfree(pInfo);
- return (FALSE);
- }
- pMBScreen->devPrivate.ptr = (pointer) pMBPriv;
- pMBPriv->PositionWindow = NULL;
- pMBPriv->funcsWrapped = 0;
-
- return TRUE;
-}
-
-/*ARGSUSED*/
-static int
-pixCreateImageBuffers (pWin, nbuf, ids, action, hint)
- WindowPtr pWin;
- int nbuf;
- XID *ids;
- int action;
- int hint;
-{
- mbufWindowPtr pMBWindow;
- mbufBufferPtr pMBBuffer;
- ScreenPtr pScreen;
- int width, height, depth;
- int i;
-
- pMBWindow = MB_WINDOW_PRIV(pWin);
-
- width = pWin->drawable.width;
- height = pWin->drawable.height;
- depth = pWin->drawable.depth;
- pScreen = pWin->drawable.pScreen;
-
- for (i = 0; i < nbuf; i++)
- {
- pMBBuffer = &pMBWindow->buffers[i];
- pMBBuffer->pDrawable = (DrawablePtr)
- (*pScreen->CreatePixmap) (pScreen, width, height, depth);
- if (!pMBBuffer->pDrawable)
- break;
-
- if (!AddResource (ids[i], MultibufferDrawableResType,
- (pointer) pMBBuffer->pDrawable))
- {
- (*pScreen->DestroyPixmap) ((PixmapPtr) pMBBuffer->pDrawable);
- break;
- }
- pMBBuffer->pDrawable->id = ids[i];
-
- /*
- * In the description of the CreateImageBuffers request:
- * "If the window is mapped, or if these image buffers have
- * backing store, their contents will be tiled with the window
- * background, and zero or more expose events will be generated
- * for each of these buffers."
- */
-
- (* MB_SCREEN_PRIV(pScreen)->ClearImageBufferArea)
- (pMBBuffer, 0,0, 0,0, TRUE);
- }
-
- return i;
-}
-
-/*
- * set up the gc to clear the pixmaps;
- */
-static Bool
-SetupBackgroundPainter (pWin, pGC)
- WindowPtr pWin;
- GCPtr pGC;
-{
- XID gcvalues[4];
- int ts_x_origin, ts_y_origin;
- PixUnion background;
- int backgroundState;
- Mask gcmask;
-
- /*
- * First take care of any ParentRelative stuff by altering the
- * tile/stipple origin to match the coordinates of the upper-left
- * corner of the first ancestor without a ParentRelative background.
- * This coordinate is, of course, negative.
- */
-
- ts_x_origin = ts_y_origin = 0;
- while (pWin->backgroundState == ParentRelative) {
- ts_x_origin -= pWin->origin.x;
- ts_y_origin -= pWin->origin.y;
- pWin = pWin->parent;
- }
- backgroundState = pWin->backgroundState;
- background = pWin->background;
-
- switch (backgroundState)
- {
- case BackgroundPixel:
- gcvalues[0] = (XID) background.pixel;
- gcvalues[1] = FillSolid;
- gcmask = GCForeground|GCFillStyle;
- break;
-
- case BackgroundPixmap:
- gcvalues[0] = FillTiled;
- gcvalues[1] = (XID) background.pixmap;
- gcvalues[2] = ts_x_origin;
- gcvalues[3] = ts_y_origin;
- gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin;
- break;
-
- default:
- return FALSE;
- }
- DoChangeGC(pGC, gcmask, gcvalues, TRUE);
- return TRUE;
-}
-
-static void
-MultibufferPaintBackgroundRectangles(pWin, pDrawable, nrects, pRects)
- WindowPtr pWin;
- DrawablePtr pDrawable;
- int nrects;
- xRectangle *pRects;
-{
- GCPtr pGC;
-
- pGC = GetScratchGC (pWin->drawable.depth, pWin->drawable.pScreen);
- if (SetupBackgroundPainter(pWin, pGC))
- {
- ValidateGC(pDrawable, pGC);
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, nrects, pRects);
- }
- FreeScratchGC(pGC);
-}
-
-static void
-MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
- WindowPtr pWin;
- DrawablePtr pDrawable;
- RegionPtr pRegion;
-{
- xRectangle *pRects;
- int nrects = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
-
- pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle));
- if (pRects)
- {
- int i;
- for (i = 0; i < nrects; i++)
- {
- pRects[i].x = pbox->x1;
- pRects[i].y = pbox->y1;
- pRects[i].width = pbox->x2 - pbox->x1;
- pRects[i].height = pbox->y2 - pbox->y1;
- }
- MultibufferPaintBackgroundRectangles(pWin, pDrawable, nrects, pRects);
- DEALLOCATE_LOCAL(pRects);
- }
-}
-
-static void
-pixDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf)
- mbufBufferPtr *ppMBBuffer;
- mbufWindowPtr *ppMBWindow;
- int nbuf;
-{
- GCPtr pGC = NULL;
- PixmapPtr pPrevPixmap, pNewPixmap;
- WindowPtr pWin;
- RegionPtr pExposed;
- int i;
- mbufBufferPtr pPrevMBBuffer;
- XID bool;
- xRectangle r;
-
- UpdateCurrentTime ();
- for (i = 0; i < nbuf; i++)
- {
- pWin = ppMBWindow[i]->pWindow;
-
- /* Time to get a different scratch GC? */
-
- if (!pGC
- || pGC->depth != pWin->drawable.depth
- || pGC->pScreen != pWin->drawable.pScreen)
- {
- if (pGC) FreeScratchGC(pGC);
- pGC = GetScratchGC (pWin->drawable.depth, pWin->drawable.pScreen);
- }
- pPrevMBBuffer = MB_DISPLAYED_BUFFER(ppMBWindow[i]);
- pPrevPixmap = (PixmapPtr) pPrevMBBuffer->pDrawable;
- pNewPixmap = (PixmapPtr) ppMBBuffer[i]->pDrawable;
-
- if (pPrevPixmap == pNewPixmap)
- {
- /* "If a specified buffer is already displayed, any delays and
- * update action will still be performed for that buffer."
- *
- * We special-case this because applications do occasionally
- * request a redundant DisplayImageBuffers, and we can save
- * strokes by recognizing that the only update action that will
- * change the buffer contents in this case is Background.
- */
- if (ppMBWindow[i]->updateAction == MultibufferUpdateActionBackground)
- {
- r.x = r.y = 0;
- r.width = pWin->drawable.width;
- r.height = pWin->drawable.height;
- MultibufferPaintBackgroundRectangles(pWin, (DrawablePtr)pWin,
- 1, &r);
- }
- }
- else /* different buffer is being displayed */
- {
- /* perform update action */
-
- switch (ppMBWindow[i]->updateAction)
- {
- case MultibufferUpdateActionUndefined:
- break;
-
- case MultibufferUpdateActionBackground:
-
- r.x = r.y = 0;
- r.width = pPrevPixmap->drawable.width;
- r.height = pPrevPixmap->drawable.height;
- MultibufferPaintBackgroundRectangles(pWin,
- (DrawablePtr)pPrevPixmap,
- 1, &r);
- break;
-
- case MultibufferUpdateActionUntouched:
-
- /* copy the window to the pixmap that represents the
- * currently displayed buffer
- */
-
- if (pPrevMBBuffer->eventMask & ExposureMask)
- {
- bool = TRUE;
- DoChangeGC (pGC, GCGraphicsExposures, &bool, FALSE);
- }
- ValidateGC ((DrawablePtr)pPrevPixmap, pGC);
- pExposed = (*pGC->ops->CopyArea)((DrawablePtr) pWin,
- (DrawablePtr) pPrevPixmap,
- pGC,
- 0, 0,
- pWin->drawable.width,
- pWin->drawable.height,
- 0, 0);
-
- /* if we couldn't copy the whole window to the buffer,
- * send expose events (if any client wants them)
- */
-
- if (pPrevMBBuffer->eventMask & ExposureMask)
- { /* some client wants expose events */
- if (pExposed)
- {
- RegionPtr pWinSize;
- extern RegionPtr CreateUnclippedWinSize();
- ScreenPtr pScreen = pWin->drawable.pScreen;
- pWinSize = CreateUnclippedWinSize (pWin);
- /*
- * pExposed is window-relative, but at this point
- * pWinSize is screen-relative. Make pWinSize be
- * window-relative so that region ops involving
- * pExposed and pWinSize behave sensibly.
- */
- REGION_TRANSLATE(pScreen, pWinSize,
- -pWin->drawable.x,
- -pWin->drawable.y);
- REGION_INTERSECT(pScreen, pExposed, pExposed, pWinSize);
- REGION_DESTROY(pScreen, pWinSize);
- MultibufferExpose (pPrevMBBuffer, pExposed);
- REGION_DESTROY(pScreen, pExposed);
- }
- bool = FALSE;
- DoChangeGC (pGC, GCGraphicsExposures, &bool, FALSE);
- } /* end some client wants expose events */
-
- break; /* end case MultibufferUpdateActionUntouched */
-
- case MultibufferUpdateActionCopied:
-
- ValidateGC ((DrawablePtr)pPrevPixmap, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr)pNewPixmap,
- (DrawablePtr)pPrevPixmap, pGC,
- 0, 0, pWin->drawable.width,
- pWin->drawable.height, 0, 0);
- break;
-
- } /* end switch on update action */
-
- /* display the new buffer */
-
- ValidateGC ((DrawablePtr)pWin, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr)pNewPixmap, (DrawablePtr)pWin,
- pGC, 0, 0,
- pWin->drawable.width, pWin->drawable.height,
- 0, 0);
- }
-
- ppMBWindow[i]->lastUpdate = currentTime;
- }
-
- if (pGC) FreeScratchGC (pGC);
- return;
-}
-
-/*
- * resize the buffers when the window is resized
- */
-
-static Bool
-pixPositionWindow (pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- ScreenPtr pScreen;
- mbufPixmapPrivPtr pMBPriv;
- mbufWindowPtr pMBWindow;
- mbufBufferPtr pMBBuffer;
- int width, height;
- int i;
- int dx, dy, dw, dh;
- int sourcex, sourcey;
- int destx, desty;
- PixmapPtr pPixmap;
- GCPtr pGC;
- int savewidth, saveheight;
- Bool clear;
- RegionRec exposedRegion;
- Bool ret;
-
- pScreen = pWin->drawable.pScreen;
- pMBPriv = MB_SCREEN_PRIV_PIXMAP(pScreen);
-
- UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, Bool, PositionWindow);
- ret = (* pScreen->PositionWindow) (pWin, x, y);
- REWRAP_SCREEN_FUNC(pScreen, pMBPriv, Bool, PositionWindow);
-
- if (!(pMBWindow = MB_WINDOW_PRIV(pWin)))
- return ret;
-
- /* if new size is same as old, we're done */
-
- if (pMBWindow->width == pWin->drawable.width &&
- pMBWindow->height == pWin->drawable.height)
- return ret;
-
- width = pWin->drawable.width;
- height = pWin->drawable.height;
- dx = pWin->drawable.x - pMBWindow->x;
- dy = pWin->drawable.x - pMBWindow->y;
- dw = width - pMBWindow->width;
- dh = height - pMBWindow->height;
- GravityTranslate (0, 0, -dx, -dy, dw, dh,
- pWin->bitGravity, &destx, &desty);
-
- /* if the window grew, remember to paint the window background,
- * and maybe send expose events, for the new areas of the buffers
- */
-
- clear = pMBWindow->width < width || pMBWindow->height < height ||
- pWin->bitGravity == ForgetGravity;
-
- sourcex = 0;
- sourcey = 0;
- savewidth = pMBWindow->width;
- saveheight = pMBWindow->height;
- /* clip rectangle to source and destination */
- if (destx < 0)
- {
- savewidth += destx;
- sourcex -= destx;
- destx = 0;
- }
- if (destx + savewidth > width)
- savewidth = width - destx;
- if (desty < 0)
- {
- saveheight += desty;
- sourcey -= desty;
- desty = 0;
- }
- if (desty + saveheight > height)
- saveheight = height - desty;
-
- pMBWindow->width = width;
- pMBWindow->height = height;
- pMBWindow->x = pWin->drawable.x;
- pMBWindow->y = pWin->drawable.y;
-
- if (clear)
- {
- BoxRec box;
-
- box.x1 = box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- REGION_INIT(pScreen, &exposedRegion, &box, 1);
- if (pWin->bitGravity != ForgetGravity)
- {
- RegionRec preservedRegion;
- box.x1 = destx;
- box.y1 = desty;
- box.x2 = destx + savewidth;
- box.y2 = desty + saveheight;
- REGION_INIT(pScreen, &preservedRegion, &box, 1);
- REGION_SUBTRACT(pScreen, &exposedRegion, &exposedRegion, &preservedRegion);
- REGION_UNINIT(pScreen, &preservedRegion);
- }
-
- } /* end if (clear) */
-
- pGC = GetScratchGC (pWin->drawable.depth, pScreen);
-
- /* create buffers with new window size */
-
- for (i = 0; i < pMBWindow->numMultibuffer; i++)
- {
- pMBBuffer = &pMBWindow->buffers[i];
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth);
- if (!pPixmap)
- {
- (* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin);
- break;
- }
- if (clear)
- {
- MultibufferPaintBackgroundRegion(pWin, (DrawablePtr)pPixmap, &exposedRegion);
- MultibufferExpose(pMBBuffer, &exposedRegion);
- }
- if (pWin->bitGravity != ForgetGravity)
- {
- ValidateGC ((DrawablePtr)pPixmap, pGC);
- (*pGC->ops->CopyArea) (pMBBuffer->pDrawable, (DrawablePtr)pPixmap,
- pGC,
- sourcex, sourcey, savewidth, saveheight,
- destx, desty);
- }
- pPixmap->drawable.id = pMBBuffer->pDrawable->id;
- (*pScreen->DestroyPixmap) ((PixmapPtr) pMBBuffer->pDrawable);
- pMBBuffer->pDrawable = (DrawablePtr) pPixmap;
- if (i != pMBWindow->displayedMultibuffer)
- {
- ChangeResourceValue (pPixmap->drawable.id,
- MultibufferDrawableResType,
- (pointer) pPixmap);
- }
- }
- FreeScratchGC (pGC);
- if (clear)
- REGION_UNINIT(pScreen, &exposedRegion);
- return TRUE;
-}
-
-static void
-pixWrapScreenFuncs(pScreen)
- ScreenPtr pScreen;
-{
- mbufPixmapPrivPtr pMBPriv = MB_SCREEN_PRIV_PIXMAP(pScreen);
- WRAP_SCREEN_FUNC(pScreen, pMBPriv, PositionWindow, pixPositionWindow);
-}
-
-static void
-pixResetProc(pScreen)
- ScreenPtr pScreen;
-{
- mbufScreenPtr pMBScreen = MB_SCREEN_PRIV(pScreen);
- mbufPixmapPrivPtr pMBPriv = MB_SCREEN_PRIV_PIXMAP(pScreen);
-
- xfree(pMBScreen->pInfo);
- xfree(pMBPriv);
-}
-
-static void
-pixClearImageBufferArea(pMBBuffer, x,y, width,height, exposures)
- mbufBufferPtr pMBBuffer;
- short x, y;
- unsigned short width, height;
- Bool exposures;
-{
- WindowPtr pWin;
- ScreenPtr pScreen;
- BoxRec box;
- RegionRec region;
- int w_width, w_height;
- DrawablePtr pDrawable;
-
- pWin = pMBBuffer->pMBWindow->pWindow;
- pScreen = pWin->drawable.pScreen;
-
- w_width = pWin->drawable.width;
- w_height = pWin->drawable.height;
-
- box.x1 = x;
- box.y1 = y;
- box.x2 = width ? (box.x1 + width) : w_width;
- box.y2 = height ? (box.y1 + height) : w_height;
-
- if (box.x1 < 0) box.x1 = 0;
- if (box.y1 < 0) box.y1 = 0;
- if (box.x2 > w_width) box.x2 = w_width;
- if (box.y2 > w_height) box.y2 = w_height;
-
- REGION_INIT(pScreen, &region, &box, 1);
-
- if (pMBBuffer->number == pMBBuffer->pMBWindow->displayedMultibuffer)
- pDrawable = (DrawablePtr) pWin;
- else
- pDrawable = pMBBuffer->pDrawable;
-
- MultibufferPaintBackgroundRegion(pWin, pDrawable, &region);
-
- if (exposures)
- MultibufferExpose(pMBBuffer, &region);
-
- REGION_UNINIT(pScreen, &region);
-}
-
-static void
-pixDeleteBufferDrawable(pDrawable)
- DrawablePtr pDrawable;
-{
- (* pDrawable->pScreen->DestroyPixmap)((PixmapPtr) pDrawable);
-}
diff --git a/Xext/mitmisc.c b/Xext/mitmisc.c
deleted file mode 100644
index b911d7ff5..000000000
--- a/Xext/mitmisc.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.7 2003/11/17 22:20:26 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
-
-/* $Xorg: mitmisc.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#define _MITMISC_SERVER_
-#include "mitmiscstr.h"
-#include "modinit.h"
-
-extern Bool permitOldBugs;
-
-#if 0
-static unsigned char MITReqCode;
-#endif
-
-static void MITResetProc(
- ExtensionEntry * /* extEntry */
-);
-
-static DISPATCH_PROC(ProcMITDispatch);
-static DISPATCH_PROC(ProcMITGetBugMode);
-static DISPATCH_PROC(ProcMITSetBugMode);
-static DISPATCH_PROC(SProcMITDispatch);
-static DISPATCH_PROC(SProcMITGetBugMode);
-static DISPATCH_PROC(SProcMITSetBugMode);
-
-void
-MITMiscExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(MITMISCNAME, 0, 0,
- ProcMITDispatch, SProcMITDispatch,
- MITResetProc, StandardMinorOpcode)) != 0)
- MITReqCode = (unsigned char)extEntry->base;
-#else
- (void) AddExtension(MITMISCNAME, 0, 0,
- ProcMITDispatch, SProcMITDispatch,
- MITResetProc, StandardMinorOpcode);
-#endif
-}
-
-/*ARGSUSED*/
-static void
-MITResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
-}
-
-static int
-ProcMITSetBugMode(client)
- register ClientPtr client;
-{
- REQUEST(xMITSetBugModeReq);
-
- REQUEST_SIZE_MATCH(xMITSetBugModeReq);
- if ((stuff->onOff != xTrue) && (stuff->onOff != xFalse))
- {
- client->errorValue = stuff->onOff;
- return BadValue;
- }
- permitOldBugs = stuff->onOff;
- return(client->noClientException);
-}
-
-static int
-ProcMITGetBugMode(client)
- register ClientPtr client;
-{
- xMITGetBugModeReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xMITGetBugModeReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.onOff = permitOldBugs;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xMITGetBugModeReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcMITDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_MITSetBugMode:
- return ProcMITSetBugMode(client);
- case X_MITGetBugMode:
- return ProcMITGetBugMode(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcMITSetBugMode(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xMITSetBugModeReq);
-
- swaps(&stuff->length, n);
- return ProcMITSetBugMode(client);
-}
-
-static int
-SProcMITGetBugMode(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xMITGetBugModeReq);
-
- swaps(&stuff->length, n);
- return ProcMITGetBugMode(client);
-}
-
-static int
-SProcMITDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_MITSetBugMode:
- return SProcMITSetBugMode(client);
- case X_MITGetBugMode:
- return SProcMITGetBugMode(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
deleted file mode 100644
index 89a8a2d2e..000000000
--- a/Xext/panoramiX.c
+++ /dev/null
@@ -1,1258 +0,0 @@
-/* $Xorg: panoramiX.c,v 1.5 2000/08/17 19:47:57 cpqbld Exp $ */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.38 2003/11/10 18:21:43 tsi Exp $ */
-
-#define NEED_REPLIES
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "Xarch.h"
-#include "misc.h"
-#include "cursor.h"
-#include "cursorstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "gc.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "window.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "panoramiX.h"
-#include "panoramiXproto.h"
-#include "panoramiXsrv.h"
-#include "globals.h"
-#include "servermd.h"
-#include "resource.h"
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-#include "modinit.h"
-
-
-#if 0
-static unsigned char PanoramiXReqCode = 0;
-#endif
-/*
- * PanoramiX data declarations
- */
-
-int PanoramiXPixWidth = 0;
-int PanoramiXPixHeight = 0;
-int PanoramiXNumScreens = 0;
-
-PanoramiXData *panoramiXdataPtr = NULL;
-RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
-
-static int PanoramiXNumDepths;
-static DepthPtr PanoramiXDepths;
-static int PanoramiXNumVisuals;
-static VisualPtr PanoramiXVisuals;
-
-/* We support at most 256 visuals */
-XID *PanoramiXVisualTable = NULL;
-
-unsigned long XRC_DRAWABLE;
-unsigned long XRT_WINDOW;
-unsigned long XRT_PIXMAP;
-unsigned long XRT_GC;
-unsigned long XRT_COLORMAP;
-
-/*
- * Function prototypes
- */
-
-static int panoramiXGeneration;
-static int ProcPanoramiXDispatch(ClientPtr client);
-
-static void PanoramiXResetProc(ExtensionEntry*);
-
-/*
- * External references for functions and data variables
- */
-
-#include "panoramiXh.h"
-
-int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
-ScreenInfo *GlobalScrInfo = NULL;
-
-static int PanoramiXGCIndex = -1;
-static int PanoramiXScreenIndex = -1;
-
-typedef struct {
- DDXPointRec clipOrg;
- DDXPointRec patOrg;
- GCFuncs *wrapFuncs;
-} PanoramiXGCRec, *PanoramiXGCPtr;
-
-typedef struct {
- CreateGCProcPtr CreateGC;
- CloseScreenProcPtr CloseScreen;
-} PanoramiXScreenRec, *PanoramiXScreenPtr;
-
-RegionRec XineramaScreenRegions[MAXSCREENS];
-
-static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
-static void XineramaChangeGC(GCPtr, unsigned long);
-static void XineramaCopyGC(GCPtr, unsigned long, GCPtr);
-static void XineramaDestroyGC(GCPtr);
-static void XineramaChangeClip(GCPtr, int, pointer, int);
-static void XineramaDestroyClip(GCPtr);
-static void XineramaCopyClip(GCPtr, GCPtr);
-
-GCFuncs XineramaGCFuncs = {
- XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
- XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
-};
-
-#define Xinerama_GC_FUNC_PROLOGUE(pGC)\
- PanoramiXGCPtr pGCPriv = \
- (PanoramiXGCPtr) (pGC)->devPrivates[PanoramiXGCIndex].ptr;\
- (pGC)->funcs = pGCPriv->wrapFuncs;
-
-#define Xinerama_GC_FUNC_EPILOGUE(pGC)\
- pGCPriv->wrapFuncs = (pGC)->funcs;\
- (pGC)->funcs = &XineramaGCFuncs;
-
-
-static Bool
-XineramaCloseScreen (int i, ScreenPtr pScreen)
-{
- PanoramiXScreenPtr pScreenPriv =
- (PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->CreateGC = pScreenPriv->CreateGC;
-
- REGION_UNINIT(pScreen, &XineramaScreenRegions[pScreen->myNum]);
- if (pScreen->myNum == 0)
- REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
-
- xfree ((pointer) pScreenPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-Bool
-XineramaCreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- PanoramiXScreenPtr pScreenPriv =
- (PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
- Bool ret;
-
- pScreen->CreateGC = pScreenPriv->CreateGC;
- if((ret = (*pScreen->CreateGC)(pGC))) {
- PanoramiXGCPtr pGCPriv =
- (PanoramiXGCPtr) pGC->devPrivates[PanoramiXGCIndex].ptr;
-
- pGCPriv->wrapFuncs = pGC->funcs;
- pGC->funcs = &XineramaGCFuncs;
-
- pGCPriv->clipOrg.x = pGC->clipOrg.x;
- pGCPriv->clipOrg.y = pGC->clipOrg.y;
- pGCPriv->patOrg.x = pGC->patOrg.x;
- pGCPriv->patOrg.y = pGC->patOrg.y;
- }
- pScreen->CreateGC = XineramaCreateGC;
-
- return ret;
-}
-
-static void
-XineramaValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
-
- if((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr)pDraw)->parent)) {
- /* the root window */
- int x_off = panoramiXdataPtr[pGC->pScreen->myNum].x;
- int y_off = panoramiXdataPtr[pGC->pScreen->myNum].y;
- int new_val;
-
- new_val = pGCPriv->clipOrg.x - x_off;
- if(pGC->clipOrg.x != new_val) {
- pGC->clipOrg.x = new_val;
- changes |= GCClipXOrigin;
- }
- new_val = pGCPriv->clipOrg.y - y_off;
- if(pGC->clipOrg.y != new_val) {
- pGC->clipOrg.y = new_val;
- changes |= GCClipYOrigin;
- }
- new_val = pGCPriv->patOrg.x - x_off;
- if(pGC->patOrg.x != new_val) {
- pGC->patOrg.x = new_val;
- changes |= GCTileStipXOrigin;
- }
- new_val = pGCPriv->patOrg.y - y_off;
- if(pGC->patOrg.y != new_val) {
- pGC->patOrg.y = new_val;
- changes |= GCTileStipYOrigin;
- }
- } else {
- if(pGC->clipOrg.x != pGCPriv->clipOrg.x) {
- pGC->clipOrg.x = pGCPriv->clipOrg.x;
- changes |= GCClipXOrigin;
- }
- if(pGC->clipOrg.y != pGCPriv->clipOrg.y) {
- pGC->clipOrg.y = pGCPriv->clipOrg.y;
- changes |= GCClipYOrigin;
- }
- if(pGC->patOrg.x != pGCPriv->patOrg.x) {
- pGC->patOrg.x = pGCPriv->patOrg.x;
- changes |= GCTileStipXOrigin;
- }
- if(pGC->patOrg.y != pGCPriv->patOrg.y) {
- pGC->patOrg.y = pGCPriv->patOrg.y;
- changes |= GCTileStipYOrigin;
- }
- }
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XineramaDestroyGC(GCPtr pGC)
-{
- Xinerama_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->DestroyGC)(pGC);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XineramaChangeGC (
- GCPtr pGC,
- unsigned long mask
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
-
- if(mask & GCTileStipXOrigin)
- pGCPriv->patOrg.x = pGC->patOrg.x;
- if(mask & GCTileStipYOrigin)
- pGCPriv->patOrg.y = pGC->patOrg.y;
- if(mask & GCClipXOrigin)
- pGCPriv->clipOrg.x = pGC->clipOrg.x;
- if(mask & GCClipYOrigin)
- pGCPriv->clipOrg.y = pGC->clipOrg.y;
-
- (*pGC->funcs->ChangeGC) (pGC, mask);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XineramaCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-){
- PanoramiXGCPtr pSrcPriv =
- (PanoramiXGCPtr) pGCSrc->devPrivates[PanoramiXGCIndex].ptr;
- Xinerama_GC_FUNC_PROLOGUE (pGCDst);
-
- if(mask & GCTileStipXOrigin)
- pGCPriv->patOrg.x = pSrcPriv->patOrg.x;
- if(mask & GCTileStipYOrigin)
- pGCPriv->patOrg.y = pSrcPriv->patOrg.y;
- if(mask & GCClipXOrigin)
- pGCPriv->clipOrg.x = pSrcPriv->clipOrg.x;
- if(mask & GCClipYOrigin)
- pGCPriv->clipOrg.y = pSrcPriv->clipOrg.y;
-
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- Xinerama_GC_FUNC_EPILOGUE (pGCDst);
-}
-
-static void
-XineramaChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XineramaCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- Xinerama_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- Xinerama_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-XineramaDestroyClip(GCPtr pGC)
-{
- Xinerama_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-
-int
-XineramaDeleteResource(pointer data, XID id)
-{
- xfree(data);
- return 1;
-}
-
-
-static Bool
-XineramaFindIDOnAnyScreen(pointer resource, XID id, pointer privdata)
-{
- PanoramiXRes *res = (PanoramiXRes*)resource;
- int j;
-
- FOR_NSCREENS(j)
- if(res->info[j].id == *((XID*)privdata)) return TRUE;
-
- return FALSE;
-}
-
-PanoramiXRes *
-PanoramiXFindIDOnAnyScreen(RESTYPE type, XID id)
-{
- return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
- XineramaFindIDOnAnyScreen, &id);
-}
-
-typedef struct {
- int screen;
- int id;
-} PanoramiXSearchData;
-
-
-static Bool
-XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
-{
- PanoramiXRes *res = (PanoramiXRes*)resource;
- PanoramiXSearchData *data = (PanoramiXSearchData*)privdata;
-
- return (res->info[data->screen].id == data->id);
-}
-
-PanoramiXRes *
-PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
-{
- PanoramiXSearchData data;
-
- if(!screen)
- return LookupIDByType(id, type);
-
- data.screen = screen;
- data.id = id;
-
- return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
- XineramaFindIDByScrnum, &data);
-}
-
-WindowPtr
-PanoramiXChangeWindow(int ScrnNum, WindowPtr pWin)
-{
- int num = pWin->drawable.pScreen->myNum;
-
- if(num != ScrnNum) {
- PanoramiXRes *win;
-
- win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, num);
-
- if (win)
- pWin = (WindowPtr) LookupIDByType(win->info[ScrnNum].id, RT_WINDOW);
- }
-
- return pWin;
-}
-
-typedef struct _connect_callback_list {
- void (*func)(void);
- struct _connect_callback_list *next;
-} XineramaConnectionCallbackList;
-
-static XineramaConnectionCallbackList *ConnectionCallbackList = NULL;
-
-Bool
-XineramaRegisterConnectionBlockCallback(void (*func)(void))
-{
- XineramaConnectionCallbackList *newlist;
-
- if(!(newlist = xalloc(sizeof(XineramaConnectionCallbackList))))
- return FALSE;
-
- newlist->next = ConnectionCallbackList;
- newlist->func = func;
- ConnectionCallbackList = newlist;
-
- return TRUE;
-}
-
-/*
- * PanoramiXExtensionInit():
- * Called from InitExtensions in main().
- * Register PanoramiXeen Extension
- * Initialize global variables.
- */
-
-void PanoramiXExtensionInit(int argc, char *argv[])
-{
- int i;
- Bool success = FALSE;
- ExtensionEntry *extEntry;
- ScreenPtr pScreen = screenInfo.screens[0];
- PanoramiXScreenPtr pScreenPriv;
- int w, h;
-
- if (noPanoramiXExtension)
- return;
-
- GlobalScrInfo = &screenInfo; /* For debug visibility */
- PanoramiXNumScreens = screenInfo.numScreens;
- if (PanoramiXNumScreens == 1) { /* Only 1 screen */
- noPanoramiXExtension = TRUE;
- return;
- }
-
- while (panoramiXGeneration != serverGeneration) {
- extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0,
- ProcPanoramiXDispatch,
- SProcPanoramiXDispatch, PanoramiXResetProc,
- StandardMinorOpcode);
- if (!extEntry) {
- ErrorF("PanoramiXExtensionInit(): failed to AddExtension\n");
- break;
- }
-
-#if 0
- PanoramiXReqCode = (unsigned char)extEntry->base;
-#endif
-
- /*
- * First make sure all the basic allocations succeed. If not,
- * run in non-PanoramiXeen mode.
- */
-
- panoramiXdataPtr = (PanoramiXData *)
- xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
-
- BREAK_IF(!panoramiXdataPtr);
- BREAK_IF((PanoramiXGCIndex = AllocateGCPrivateIndex()) < 0);
- BREAK_IF((PanoramiXScreenIndex = AllocateScreenPrivateIndex()) < 0);
-
- for (i = 0; i < PanoramiXNumScreens; i++) {
- pScreen = screenInfo.screens[i];
- if(!AllocateGCPrivate(pScreen, PanoramiXGCIndex,
- sizeof(PanoramiXGCRec))) {
- noPanoramiXExtension = TRUE;
- return;
- }
-
- pScreenPriv = xalloc(sizeof(PanoramiXScreenRec));
- pScreen->devPrivates[PanoramiXScreenIndex].ptr =
- (pointer)pScreenPriv;
- if(!pScreenPriv) {
- noPanoramiXExtension = TRUE;
- return;
- }
-
- pScreenPriv->CreateGC = pScreen->CreateGC;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
-
- pScreen->CreateGC = XineramaCreateGC;
- pScreen->CloseScreen = XineramaCloseScreen;
- }
-
- XRC_DRAWABLE = CreateNewResourceClass();
- XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource) |
- XRC_DRAWABLE;
- XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource) |
- XRC_DRAWABLE;
- XRT_GC = CreateNewResourceType(XineramaDeleteResource);
- XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource);
-
- panoramiXGeneration = serverGeneration;
- success = TRUE;
- }
-
- if (!success) {
- noPanoramiXExtension = TRUE;
- ErrorF("%s Extension failed to initialize\n", PANORAMIX_PROTOCOL_NAME);
- return;
- }
-
-
- REGION_NULL(pScreen, &PanoramiXScreenRegion);
- for (i = 0; i < PanoramiXNumScreens; i++) {
- BoxRec TheBox;
-
- pScreen = screenInfo.screens[i];
-
- panoramiXdataPtr[i].x = dixScreenOrigins[i].x;
- panoramiXdataPtr[i].y = dixScreenOrigins[i].y;
- panoramiXdataPtr[i].width = pScreen->width;
- panoramiXdataPtr[i].height = pScreen->height;
-
- TheBox.x1 = panoramiXdataPtr[i].x;
- TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width;
- TheBox.y1 = panoramiXdataPtr[i].y;
- TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height;
-
- REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1);
- REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion,
- &XineramaScreenRegions[i]);
- }
-
-
- PanoramiXPixWidth = panoramiXdataPtr[0].x + panoramiXdataPtr[0].width;
- PanoramiXPixHeight = panoramiXdataPtr[0].y + panoramiXdataPtr[0].height;
-
- for (i = 1; i < PanoramiXNumScreens; i++) {
- w = panoramiXdataPtr[i].x + panoramiXdataPtr[i].width;
- h = panoramiXdataPtr[i].y + panoramiXdataPtr[i].height;
-
- if(PanoramiXPixWidth < w)
- PanoramiXPixWidth = w;
- if(PanoramiXPixHeight < h)
- PanoramiXPixHeight = h;
- }
-
- /*
- * Put our processes into the ProcVector
- */
-
- for (i = 256; i--; )
- SavedProcVector[i] = ProcVector[i];
-
- ProcVector[X_CreateWindow] = PanoramiXCreateWindow;
- ProcVector[X_ChangeWindowAttributes] = PanoramiXChangeWindowAttributes;
- ProcVector[X_DestroyWindow] = PanoramiXDestroyWindow;
- ProcVector[X_DestroySubwindows] = PanoramiXDestroySubwindows;
- ProcVector[X_ChangeSaveSet] = PanoramiXChangeSaveSet;
- ProcVector[X_ReparentWindow] = PanoramiXReparentWindow;
- ProcVector[X_MapWindow] = PanoramiXMapWindow;
- ProcVector[X_MapSubwindows] = PanoramiXMapSubwindows;
- ProcVector[X_UnmapWindow] = PanoramiXUnmapWindow;
- ProcVector[X_UnmapSubwindows] = PanoramiXUnmapSubwindows;
- ProcVector[X_ConfigureWindow] = PanoramiXConfigureWindow;
- ProcVector[X_CirculateWindow] = PanoramiXCirculateWindow;
- ProcVector[X_GetGeometry] = PanoramiXGetGeometry;
- ProcVector[X_TranslateCoords] = PanoramiXTranslateCoords;
- ProcVector[X_CreatePixmap] = PanoramiXCreatePixmap;
- ProcVector[X_FreePixmap] = PanoramiXFreePixmap;
- ProcVector[X_CreateGC] = PanoramiXCreateGC;
- ProcVector[X_ChangeGC] = PanoramiXChangeGC;
- ProcVector[X_CopyGC] = PanoramiXCopyGC;
- ProcVector[X_SetDashes] = PanoramiXSetDashes;
- ProcVector[X_SetClipRectangles] = PanoramiXSetClipRectangles;
- ProcVector[X_FreeGC] = PanoramiXFreeGC;
- ProcVector[X_ClearArea] = PanoramiXClearToBackground;
- ProcVector[X_CopyArea] = PanoramiXCopyArea;;
- ProcVector[X_CopyPlane] = PanoramiXCopyPlane;;
- ProcVector[X_PolyPoint] = PanoramiXPolyPoint;
- ProcVector[X_PolyLine] = PanoramiXPolyLine;
- ProcVector[X_PolySegment] = PanoramiXPolySegment;
- ProcVector[X_PolyRectangle] = PanoramiXPolyRectangle;
- ProcVector[X_PolyArc] = PanoramiXPolyArc;
- ProcVector[X_FillPoly] = PanoramiXFillPoly;
- ProcVector[X_PolyFillRectangle] = PanoramiXPolyFillRectangle;
- ProcVector[X_PolyFillArc] = PanoramiXPolyFillArc;
- ProcVector[X_PutImage] = PanoramiXPutImage;
- ProcVector[X_GetImage] = PanoramiXGetImage;
- ProcVector[X_PolyText8] = PanoramiXPolyText8;
- ProcVector[X_PolyText16] = PanoramiXPolyText16;
- ProcVector[X_ImageText8] = PanoramiXImageText8;
- ProcVector[X_ImageText16] = PanoramiXImageText16;
- ProcVector[X_CreateColormap] = PanoramiXCreateColormap;
- ProcVector[X_FreeColormap] = PanoramiXFreeColormap;
- ProcVector[X_CopyColormapAndFree] = PanoramiXCopyColormapAndFree;
- ProcVector[X_InstallColormap] = PanoramiXInstallColormap;
- ProcVector[X_UninstallColormap] = PanoramiXUninstallColormap;
- ProcVector[X_AllocColor] = PanoramiXAllocColor;
- ProcVector[X_AllocNamedColor] = PanoramiXAllocNamedColor;
- ProcVector[X_AllocColorCells] = PanoramiXAllocColorCells;
- ProcVector[X_AllocColorPlanes] = PanoramiXAllocColorPlanes;
- ProcVector[X_FreeColors] = PanoramiXFreeColors;
- ProcVector[X_StoreColors] = PanoramiXStoreColors;
- ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
-
-#ifdef RENDER
- PanoramiXRenderInit ();
-#endif
-}
-
-extern Bool CreateConnectionBlock(void);
-
-Bool PanoramiXCreateConnectionBlock(void)
-{
- int i, j, length;
- Bool disableBackingStore = FALSE;
- Bool disableSaveUnders = FALSE;
- int old_width, old_height;
- float width_mult, height_mult;
- xWindowRoot *root;
- xVisualType *visual;
- xDepth *depth;
- VisualPtr pVisual;
- ScreenPtr pScreen;
-
- /*
- * Do normal CreateConnectionBlock but faking it for only one screen
- */
-
- if(!PanoramiXNumDepths) {
- ErrorF("PanoramiX error: Incompatible screens. No common visuals\n");
- return FALSE;
- }
-
- for(i = 1; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if(pScreen->rootDepth != screenInfo.screens[0]->rootDepth) {
- ErrorF("PanoramiX error: Incompatible screens. Root window depths differ\n");
- return FALSE;
- }
- if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport)
- disableBackingStore = TRUE;
- if(pScreen->saveUnderSupport != screenInfo.screens[0]->saveUnderSupport)
- disableSaveUnders = TRUE;
- }
-
- if(disableBackingStore || disableSaveUnders) {
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if(disableBackingStore)
- pScreen->backingStoreSupport = NotUseful;
- if(disableSaveUnders)
- pScreen->saveUnderSupport = NotUseful;
- }
- }
-
- i = screenInfo.numScreens;
- screenInfo.numScreens = 1;
- if (!CreateConnectionBlock()) {
- screenInfo.numScreens = i;
- return FALSE;
- }
-
- screenInfo.numScreens = i;
-
- root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart);
- length = connBlockScreenStart + sizeof(xWindowRoot);
-
- /* overwrite the connection block */
- root->nDepths = PanoramiXNumDepths;
-
- for (i = 0; i < PanoramiXNumDepths; i++) {
- depth = (xDepth *) (ConnectionInfo + length);
- depth->depth = PanoramiXDepths[i].depth;
- depth->nVisuals = PanoramiXDepths[i].numVids;
- length += sizeof(xDepth);
- visual = (xVisualType *)(ConnectionInfo + length);
-
- for (j = 0; j < depth->nVisuals; j++, visual++) {
- visual->visualID = PanoramiXDepths[i].vids[j];
-
- for (pVisual = PanoramiXVisuals;
- pVisual->vid != visual->visualID;
- pVisual++)
- ;
-
- visual->class = pVisual->class;
- visual->bitsPerRGB = pVisual->bitsPerRGBValue;
- visual->colormapEntries = pVisual->ColormapEntries;
- visual->redMask = pVisual->redMask;
- visual->greenMask = pVisual->greenMask;
- visual->blueMask = pVisual->blueMask;
- }
-
- length += (depth->nVisuals * sizeof(xVisualType));
- }
-
- connSetupPrefix.length = length >> 2;
-
- xfree(PanoramiXVisuals);
- for (i = 0; i < PanoramiXNumDepths; i++)
- xfree(PanoramiXDepths[i].vids);
- xfree(PanoramiXDepths);
-
- /*
- * OK, change some dimensions so it looks as if it were one big screen
- */
-
- old_width = root->pixWidth;
- old_height = root->pixHeight;
-
- root->pixWidth = PanoramiXPixWidth;
- root->pixHeight = PanoramiXPixHeight;
- width_mult = (1.0 * root->pixWidth) / old_width;
- height_mult = (1.0 * root->pixHeight) / old_height;
- root->mmWidth *= width_mult;
- root->mmHeight *= height_mult;
-
- while(ConnectionCallbackList) {
- pointer tmp;
-
- tmp = (pointer)ConnectionCallbackList;
- (*ConnectionCallbackList->func)();
- ConnectionCallbackList = ConnectionCallbackList->next;
- xfree(tmp);
- }
-
- return TRUE;
-}
-
-extern
-void PanoramiXConsolidate(void)
-{
- int i, j, k;
- VisualPtr pVisual, pVisual2;
- ScreenPtr pScreen, pScreen2;
- DepthPtr pDepth, pDepth2;
- PanoramiXRes *root, *defmap, *saver;
- Bool foundDepth, missingDepth;
-
- if(!PanoramiXVisualTable)
- PanoramiXVisualTable = xcalloc(256 * MAXSCREENS, sizeof(XID));
-
- pScreen = screenInfo.screens[0];
- pVisual = pScreen->visuals;
- pDepth = pScreen->allowedDepths;
-
- PanoramiXNumDepths = 0;
- PanoramiXDepths = xcalloc(pScreen->numDepths,sizeof(DepthRec));
- PanoramiXNumVisuals = 0;
- PanoramiXVisuals = xcalloc(pScreen->numVisuals,sizeof(VisualRec));
-
- for (i = 0; i < pScreen->numDepths; i++, pDepth++) {
- missingDepth = FALSE;
- for (j = 1; j < PanoramiXNumScreens; j++) {
- pScreen2 = screenInfo.screens[j];
- pDepth2 = pScreen2->allowedDepths;
-
- foundDepth = FALSE;
- for (k = 0; k < pScreen2->numDepths; k++, pDepth2++) {
- if(pDepth2->depth == pDepth->depth) {
- foundDepth = TRUE;
- break;
- }
- }
-
- if(!foundDepth) {
- missingDepth = TRUE;
- break;
- }
- }
-
- if(!missingDepth) {
- PanoramiXDepths[PanoramiXNumDepths].depth = pDepth->depth;
- PanoramiXDepths[PanoramiXNumDepths].numVids = 0;
- if(pDepth->numVids)
- PanoramiXDepths[PanoramiXNumDepths].vids =
- xalloc(sizeof(VisualID) * pDepth->numVids);
- else
- PanoramiXDepths[PanoramiXNumDepths].vids = NULL;
- PanoramiXNumDepths++;
- }
- }
-
- for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
- PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = pVisual->vid;
-
- /* check if the visual exists on all screens */
- for (j = 1; j < PanoramiXNumScreens; j++) {
- pScreen2 = screenInfo.screens[j];
- pVisual2 = pScreen2->visuals;
-
- for (k = 0; k < pScreen2->numVisuals; k++, pVisual2++) {
- if ((pVisual->class == pVisual2->class) &&
- (pVisual->ColormapEntries == pVisual2->ColormapEntries) &&
- (pVisual->nplanes == pVisual2->nplanes) &&
- (pVisual->redMask == pVisual2->redMask) &&
- (pVisual->greenMask == pVisual2->greenMask) &&
- (pVisual->blueMask == pVisual2->blueMask) &&
- (pVisual->offsetRed == pVisual2->offsetRed) &&
- (pVisual->offsetGreen == pVisual2->offsetGreen) &&
- (pVisual->offsetBlue == pVisual2->offsetBlue))
- {
- /* We merely assign the first visual that matches. OpenGL
- will need to get involved at some point if you want
- match GLX visuals */
- PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] =
- pVisual2->vid;
- break;
- }
- }
- }
-
- /* if it doesn't exist on all screens we can't use it */
- for (j = 0; j < PanoramiXNumScreens; j++) {
- if (!PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j]) {
- PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = 0;
- break;
- }
- }
-
- /* if it does, make sure it's in the list of supported depths and visuals */
- if(PanoramiXVisualTable[pVisual->vid * MAXSCREENS]) {
- PanoramiXVisuals[PanoramiXNumVisuals].vid = pVisual->vid;
- PanoramiXVisuals[PanoramiXNumVisuals].class = pVisual->class;
- PanoramiXVisuals[PanoramiXNumVisuals].bitsPerRGBValue = pVisual->bitsPerRGBValue;
- PanoramiXVisuals[PanoramiXNumVisuals].ColormapEntries = pVisual->ColormapEntries;
- PanoramiXVisuals[PanoramiXNumVisuals].nplanes = pVisual->nplanes;
- PanoramiXVisuals[PanoramiXNumVisuals].redMask = pVisual->redMask;
- PanoramiXVisuals[PanoramiXNumVisuals].greenMask = pVisual->greenMask;
- PanoramiXVisuals[PanoramiXNumVisuals].blueMask = pVisual->blueMask;
- PanoramiXVisuals[PanoramiXNumVisuals].offsetRed = pVisual->offsetRed;
- PanoramiXVisuals[PanoramiXNumVisuals].offsetGreen = pVisual->offsetGreen;
- PanoramiXVisuals[PanoramiXNumVisuals].offsetBlue = pVisual->offsetBlue;
- PanoramiXNumVisuals++;
-
- for (j = 0; j < PanoramiXNumDepths; j++) {
- if (PanoramiXDepths[j].depth == pVisual->nplanes) {
- PanoramiXDepths[j].vids[PanoramiXDepths[j].numVids] = pVisual->vid;
- PanoramiXDepths[j].numVids++;
- break;
- }
- }
- }
- }
-
-
- root = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
- root->type = XRT_WINDOW;
- defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
- defmap->type = XRT_COLORMAP;
- saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
- saver->type = XRT_WINDOW;
-
-
- for (i = 0; i < PanoramiXNumScreens; i++) {
- root->info[i].id = WindowTable[i]->drawable.id;
- root->u.win.class = InputOutput;
- root->u.win.root = TRUE;
- saver->info[i].id = savedScreenInfo[i].wid;
- saver->u.win.class = InputOutput;
- saver->u.win.root = TRUE;
- defmap->info[i].id = (screenInfo.screens[i])->defColormap;
- }
-
- AddResource(root->info[0].id, XRT_WINDOW, root);
- AddResource(saver->info[0].id, XRT_WINDOW, saver);
- AddResource(defmap->info[0].id, XRT_COLORMAP, defmap);
-}
-
-
-/*
- * PanoramiXResetProc()
- * Exit, deallocating as needed.
- */
-
-static void PanoramiXResetProc(ExtensionEntry* extEntry)
-{
- int i;
-
-#ifdef RENDER
- PanoramiXRenderReset ();
-#endif
- screenInfo.numScreens = PanoramiXNumScreens;
- for (i = 256; i--; )
- ProcVector[i] = SavedProcVector[i];
-
- Xfree(panoramiXdataPtr);
-}
-
-
-int
-ProcPanoramiXQueryVersion (ClientPtr client)
-{
- /* REQUEST(xPanoramiXQueryVersionReq); */
- xPanoramiXQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = PANORAMIX_MAJOR_VERSION;
- rep.minorVersion = PANORAMIX_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-int
-ProcPanoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPanoramiXExtension;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.state, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
- return client->noClientException;
-
-}
-
-int
-ProcPanoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = PanoramiXNumScreens;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.ScreenCount, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
- return client->noClientException;
-}
-
-int
-ProcPanoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin;
- xPanoramiXGetScreenSizeReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- /* screen dimensions */
- rep.width = panoramiXdataPtr[stuff->screen].width;
- rep.height = panoramiXdataPtr[stuff->screen].height;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.width, n);
- swaps (&rep.height, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-int
-ProcXineramaIsActive(ClientPtr client)
-{
- /* REQUEST(xXineramaIsActiveReq); */
- xXineramaIsActiveReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPanoramiXExtension;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.state, n);
- }
- WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-int
-ProcXineramaQueryScreens(ClientPtr client)
-{
- /* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
- rep.length = rep.number * sz_XineramaScreenInfo >> 2;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.number, n);
- }
- WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
-
- if(!noPanoramiXExtension) {
- xXineramaScreenInfo scratch;
- int i;
-
- for(i = 0; i < PanoramiXNumScreens; i++) {
- scratch.x_org = panoramiXdataPtr[i].x;
- scratch.y_org = panoramiXdataPtr[i].y;
- scratch.width = panoramiXdataPtr[i].width;
- scratch.height = panoramiXdataPtr[i].height;
-
- if(client->swapped) {
- register int n;
- swaps (&scratch.x_org, n);
- swaps (&scratch.y_org, n);
- swaps (&scratch.width, n);
- swaps (&scratch.height, n);
- }
- WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
- }
- }
-
- return client->noClientException;
-}
-
-
-static int
-ProcPanoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return ProcPanoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcPanoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcPanoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcPanoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return ProcXineramaQueryScreens(client);
- }
- return BadRequest;
-}
-
-
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
-#define SHIFT_L(v,s) (v) << (s)
-#define SHIFT_R(v,s) (v) >> (s)
-#else
-#define SHIFT_L(v,s) (v) >> (s)
-#define SHIFT_R(v,s) (v) << (s)
-#endif
-
-static void
-CopyBits(char *dst, int shiftL, char *src, int bytes)
-{
- /* Just get it to work. Worry about speed later */
- int shiftR = 8 - shiftL;
-
- while(bytes--) {
- *dst |= SHIFT_L(*src, shiftL);
- *(dst + 1) |= SHIFT_R(*src, shiftR);
- dst++; src++;
- }
-}
-
-
-/* Caution. This doesn't support 2 and 4 bpp formats. We expect
- 1 bpp and planar data to be already cleared when presented
- to this function */
-
-void
-XineramaGetImageData(
- DrawablePtr *pDrawables,
- int left,
- int top,
- int width,
- int height,
- unsigned int format,
- unsigned long planemask,
- char *data,
- int pitch,
- Bool isRoot
-){
- RegionRec SrcRegion, GrabRegion;
- BoxRec SrcBox, *pbox;
- int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth;
- DrawablePtr pDraw = pDrawables[0];
- ScreenPtr pScreen = pDraw->pScreen;
- char *ScratchMem = NULL;
-
- size = 0;
-
- /* find box in logical screen space */
- SrcBox.x1 = left;
- SrcBox.y1 = top;
- if(!isRoot) {
- SrcBox.x1 += pDraw->x + panoramiXdataPtr[0].x;
- SrcBox.y1 += pDraw->y + panoramiXdataPtr[0].y;
- }
- SrcBox.x2 = SrcBox.x1 + width;
- SrcBox.y2 = SrcBox.y1 + height;
-
- REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1);
- REGION_NULL(pScreen, &GrabRegion);
-
- depth = (format == XYPixmap) ? 1 : pDraw->depth;
-
- for(i = 0; i < PanoramiXNumScreens; i++) {
- pDraw = pDrawables[i];
-
- inOut = RECT_IN_REGION(pScreen,&XineramaScreenRegions[i],&SrcBox);
-
- if(inOut == rgnIN) {
- (*pDraw->pScreen->GetImage)(pDraw,
- SrcBox.x1 - pDraw->x - panoramiXdataPtr[i].x,
- SrcBox.y1 - pDraw->y - panoramiXdataPtr[i].y,
- width, height, format, planemask, data);
- break;
- } else if (inOut == rgnOUT)
- continue;
-
- REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion,
- &XineramaScreenRegions[i]);
-
- nbox = REGION_NUM_RECTS(&GrabRegion);
-
- if(nbox) {
- pbox = REGION_RECTS(&GrabRegion);
-
- while(nbox--) {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
- ScratchPitch = PixmapBytePad(w, depth);
- sizeNeeded = ScratchPitch * h;
-
- if(sizeNeeded > size) {
- char *tmpdata = ScratchMem;
- ScratchMem = xrealloc(ScratchMem, sizeNeeded);
- if(ScratchMem)
- size = sizeNeeded;
- else {
- ScratchMem = tmpdata;
- break;
- }
- }
-
- x = pbox->x1 - pDraw->x - panoramiXdataPtr[i].x;
- y = pbox->y1 - pDraw->y - panoramiXdataPtr[i].y;
-
- (*pDraw->pScreen->GetImage)(pDraw, x, y, w, h,
- format, planemask, ScratchMem);
-
- /* copy the memory over */
-
- if(depth == 1) {
- int k, shift, leftover, index, index2;
-
- x = pbox->x1 - SrcBox.x1;
- y = pbox->y1 - SrcBox.y1;
- shift = x & 7;
- x >>= 3;
- leftover = w & 7;
- w >>= 3;
-
- /* clean up the edge */
- if(leftover) {
- int mask = (1 << leftover) - 1;
- for(j = h, k = w; j--; k += ScratchPitch)
- ScratchMem[k] &= mask;
- }
-
- for(j = 0, index = (pitch * y) + x, index2 = 0; j < h;
- j++, index += pitch, index2 += ScratchPitch)
- {
- if(w) {
- if(!shift)
- memcpy(data + index, ScratchMem + index2, w);
- else
- CopyBits(data + index, shift,
- ScratchMem + index2, w);
- }
-
- if(leftover) {
- data[index + w] |=
- SHIFT_L(ScratchMem[index2 + w], shift);
- if((shift + leftover) > 8)
- data[index + w + 1] |=
- SHIFT_R(ScratchMem[index2 + w],(8 - shift));
- }
- }
- } else {
- j = BitsPerPixel(depth) >> 3;
- x = (pbox->x1 - SrcBox.x1) * j;
- y = pbox->y1 - SrcBox.y1;
- w *= j;
-
- for(j = 0; j < h; j++) {
- memcpy(data + (pitch * (y + j)) + x,
- ScratchMem + (ScratchPitch * j), w);
- }
- }
- pbox++;
- }
-
- REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion);
- if(!REGION_NOTEMPTY(pScreen, &SrcRegion))
- break;
- }
-
- }
-
- if(ScratchMem)
- xfree(ScratchMem);
-
- REGION_UNINIT(pScreen, &SrcRegion);
- REGION_UNINIT(pScreen, &GrabRegion);
-}
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
deleted file mode 100644
index d01b0b854..000000000
--- a/Xext/panoramiX.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $TOG: panoramiX.h /main/4 1998/03/17 06:51:02 kaleb $ */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.6 2003/03/23 04:56:02 mvojkovi Exp $ */
-
-/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
-
-/*
- * PanoramiX definitions
- */
-
-#ifndef _PANORAMIX_H_
-#define _PANORAMIX_H_
-
-#include "panoramiXext.h"
-#include "gcstruct.h"
-
-
-typedef struct _PanoramiXData {
- int x;
- int y;
- int width;
- int height;
-} PanoramiXData;
-
-typedef struct _PanoramiXInfo {
- XID id ;
-} PanoramiXInfo;
-
-typedef struct {
- PanoramiXInfo info[MAXSCREENS];
- RESTYPE type;
- union {
- struct {
- char visibility;
- char class;
- char root;
- } win;
- struct {
- Bool shared;
- } pix;
-#ifdef RENDER
- struct {
- Bool root;
- } pict;
-#endif
- char raw_data[4];
- } u;
-} PanoramiXRes;
-
-#define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
-#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
-#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
-
-#define BREAK_IF(a) if ((a)) break
-#define IF_RETURN(a,b) if ((a)) return (b)
-
-#define FORCE_ROOT(a) { \
- int _j; \
- for (_j = PanoramiXNumScreens - 1; _j; _j--) \
- if ((a).root == WindowTable[_j]->drawable.id) \
- break; \
- (a).rootX += panoramiXdataPtr[_j].x; \
- (a).rootY += panoramiXdataPtr[_j].y; \
- (a).root = WindowTable[0]->drawable.id; \
-}
-
-#define FORCE_WIN(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
-#define FORCE_CMAP(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
-#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
-
-#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return
-
-#endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
deleted file mode 100644
index e3ea803e6..000000000
--- a/Xext/panoramiXSwap.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $Xorg: panoramiXSwap.c,v 1.4 2000/08/17 19:47:57 cpqbld Exp $ */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.10 2003/09/13 21:33:03 dawes Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "cursor.h"
-#include "cursorstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "gc.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "window.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#if 0
-#include <sys/workstation.h>
-#include <X11/Xserver/ws.h>
-#endif
-#include "panoramiX.h"
-#include "panoramiXproto.h"
-#include "panoramiXsrv.h"
-#include "globals.h"
-#include "panoramiXh.h"
-
-static int
-SProcPanoramiXQueryVersion (ClientPtr client)
-{
- REQUEST(xPanoramiXQueryVersionReq);
- register int n;
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcPanoramiXQueryVersion(client);
-}
-
-static int
-SProcPanoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- return ProcPanoramiXGetState(client);
-}
-
-static int
-SProcPanoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- return ProcPanoramiXGetScreenCount(client);
-}
-
-static int
-SProcPanoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- return ProcPanoramiXGetScreenSize(client);
-}
-
-
-static int
-SProcXineramaIsActive(ClientPtr client)
-{
- REQUEST(xXineramaIsActiveReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcXineramaIsActive(client);
-}
-
-
-static int
-SProcXineramaQueryScreens(ClientPtr client)
-{
- REQUEST(xXineramaQueryScreensReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcXineramaQueryScreens(client);
-}
-
-
-int
-SProcPanoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return SProcPanoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcPanoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcPanoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcPanoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return SProcXineramaQueryScreens(client);
- }
- return BadRequest;
-}
diff --git a/Xext/panoramiXh.h b/Xext/panoramiXh.h
deleted file mode 100644
index d15fc8002..000000000
--- a/Xext/panoramiXh.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXh.h,v 1.3 2003/11/17 22:20:26 dawes Exp $ */
-
-/*
- * Server dispatcher function replacements
- */
-
-extern int PanoramiXCreateWindow(ClientPtr client);
-extern int PanoramiXChangeWindowAttributes(ClientPtr client);
-extern int PanoramiXDestroyWindow(ClientPtr client);
-extern int PanoramiXDestroySubwindows(ClientPtr client);
-extern int PanoramiXChangeSaveSet(ClientPtr client);
-extern int PanoramiXReparentWindow(ClientPtr client);
-extern int PanoramiXMapWindow(ClientPtr client);
-extern int PanoramiXMapSubwindows(ClientPtr client);
-extern int PanoramiXUnmapWindow(ClientPtr client);
-extern int PanoramiXUnmapSubwindows(ClientPtr client);
-extern int PanoramiXConfigureWindow(ClientPtr client);
-extern int PanoramiXCirculateWindow(ClientPtr client);
-extern int PanoramiXGetGeometry(ClientPtr client);
-extern int PanoramiXTranslateCoords(ClientPtr client);
-extern int PanoramiXCreatePixmap(ClientPtr client);
-extern int PanoramiXFreePixmap(ClientPtr client);
-extern int PanoramiXCreateGC(ClientPtr client);
-extern int PanoramiXChangeGC(ClientPtr client);
-extern int PanoramiXCopyGC(ClientPtr client);
-extern int PanoramiXCopyColormapAndFree(ClientPtr client);
-extern int PanoramiXSetDashes(ClientPtr client);
-extern int PanoramiXSetClipRectangles(ClientPtr client);
-extern int PanoramiXFreeGC(ClientPtr client);
-extern int PanoramiXClearToBackground(ClientPtr client);
-extern int PanoramiXCopyArea(ClientPtr client);
-extern int PanoramiXCopyPlane(ClientPtr client);
-extern int PanoramiXPolyPoint(ClientPtr client);
-extern int PanoramiXPolyLine(ClientPtr client);
-extern int PanoramiXPolySegment(ClientPtr client);
-extern int PanoramiXPolyRectangle(ClientPtr client);
-extern int PanoramiXPolyArc(ClientPtr client);
-extern int PanoramiXFillPoly(ClientPtr client);
-extern int PanoramiXPolyFillArc(ClientPtr client);
-extern int PanoramiXPolyFillRectangle(ClientPtr client);
-extern int PanoramiXPutImage(ClientPtr client);
-extern int PanoramiXGetImage(ClientPtr client);
-extern int PanoramiXPolyText8(ClientPtr client);
-extern int PanoramiXPolyText16(ClientPtr client);
-extern int PanoramiXImageText8(ClientPtr client);
-extern int PanoramiXImageText16(ClientPtr client);
-extern int PanoramiXCreateColormap(ClientPtr client);
-extern int PanoramiXFreeColormap(ClientPtr client);
-extern int PanoramiXInstallColormap(ClientPtr client);
-extern int PanoramiXUninstallColormap(ClientPtr client);
-extern int PanoramiXAllocColor(ClientPtr client);
-extern int PanoramiXAllocNamedColor(ClientPtr client);
-extern int PanoramiXAllocColorCells(ClientPtr client);
-extern int PanoramiXStoreNamedColor(ClientPtr client);
-extern int PanoramiXFreeColors(ClientPtr client);
-extern int PanoramiXStoreColors(ClientPtr client);
-extern int PanoramiXAllocColorPlanes(ClientPtr client);
-
-#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr)
-
-PROC_EXTERN(ProcPanoramiXQueryVersion);
-PROC_EXTERN(ProcPanoramiXGetState);
-PROC_EXTERN(ProcPanoramiXGetScreenCount);
-PROC_EXTERN(ProcPanoramiXGetScreenSize);
-
-PROC_EXTERN(ProcXineramaQueryScreens);
-PROC_EXTERN(ProcXineramaIsActive);
-extern Bool XineramaCreateGC(GCPtr pGC);
-
-extern int SProcPanoramiXDispatch(ClientPtr client);
-
-extern char *ConnectionInfo;
-extern int connBlockScreenStart;
-extern xConnSetupPrefix connSetupPrefix;
-
-extern ScreenInfo *GlobalScrInfo;
-extern int (* SavedProcVector[256]) (ClientPtr client);
-
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
deleted file mode 100644
index 73a441a88..000000000
--- a/Xext/panoramiXprocs.c
+++ /dev/null
@@ -1,2368 +0,0 @@
-/* $Xorg: panoramiXprocs.c,v 1.5 2000/08/17 19:47:57 cpqbld Exp $ */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-
-/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
-
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.37 2003/11/10 18:21:43 tsi Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "windowstr.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "opaque.h"
-#include "inputstr.h"
-#include "migc.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#include "resource.h"
-#include "panoramiXh.h"
-
-#define XINERAMA_IMAGE_BUFSIZE (256*1024)
-#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
- CWDontPropagate | CWOverrideRedirect | CWCursor )
-
-#if 0
-extern void (* EventSwapVector[128]) (fsError *, fsError *);
-
-extern void Swap32Write();
-extern void SLHostsExtend();
-extern void SQColorsExtend();
-WriteSConnectionInfo();
-extern void WriteSConnSetupPrefix();
-#endif
-
-/* Various of the DIX function interfaces were not designed to allow
- * the client->errorValue to be set on BadValue and other errors.
- * Rather than changing interfaces and breaking untold code we introduce
- * a new global that dispatch can use.
- */
-extern XID clientErrorValue; /* XXX this is a kludge */
-
-int PanoramiXCreateWindow(ClientPtr client)
-{
- PanoramiXRes *parent, *newWin;
- PanoramiXRes *backPix = NULL;
- PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
- REQUEST(xCreateWindowReq);
- int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
- int result = 0, len, j;
- int orig_x, orig_y;
- XID orig_visual, tmp;
- Bool parentIsRoot;
-
- REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
-
- len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if (!(parent = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->parent, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if(stuff->class == CopyFromParent)
- stuff->class = parent->u.win.class;
-
- if((stuff->class == InputOnly) && (stuff->mask & (~INPUTONLY_LEGAL_MASK)))
- return BadMatch;
-
- if ((Mask)stuff->mask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_COLORMAP, SecurityReadAccess)))
- return BadColor;
- }
- }
-
- if(!(newWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newWin->type = XRT_WINDOW;
- newWin->u.win.visibility = VisibilityNotViewable;
- newWin->u.win.class = stuff->class;
- newWin->u.win.root = FALSE;
- newWin->info[0].id = stuff->wid;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newWin->info[j].id = FakeClientID(client->index);
-
- if (stuff->class == InputOnly)
- stuff->visual = CopyFromParent;
- orig_visual = stuff->visual;
- orig_x = stuff->x;
- orig_y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
- (stuff->parent == savedScreenInfo[0].wid);
- FOR_NSCREENS_BACKWARD(j) {
- stuff->wid = newWin->info[j].id;
- stuff->parent = parent->info[j].id;
- if (parentIsRoot) {
- stuff->x = orig_x - panoramiXdataPtr[j].x;
- stuff->y = orig_y - panoramiXdataPtr[j].y;
- }
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
- if ( orig_visual != CopyFromParent )
- stuff->visual = PanoramiXVisualTable[(orig_visual*MAXSCREENS) + j];
- result = (*SavedProcVector[X_CreateWindow])(client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newWin->info[0].id, XRT_WINDOW, newWin);
- else
- xfree(newWin);
-
- return (result);
-}
-
-
-int PanoramiXChangeWindowAttributes(ClientPtr client)
-{
- PanoramiXRes *win;
- PanoramiXRes *backPix = NULL;
- PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
- REQUEST(xChangeWindowAttributesReq);
- int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
- int result = 0, len, j;
- XID tmp;
-
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
-
- len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
- if (Ones(stuff->valueMask) != len)
- return BadLength;
-
- if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if((win->u.win.class == InputOnly) &&
- (stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
- return BadMatch;
-
- if ((Mask)stuff->valueMask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->valueMask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->valueMask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->valueMask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->valueMask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->valueMask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_COLORMAP, SecurityReadAccess)))
- return BadColor;
- }
- }
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
- result = (*SavedProcVector[X_ChangeWindowAttributes])(client);
- }
-
- return (result);
-}
-
-
-int PanoramiXDestroyWindow(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityDestroyAccess)))
- return BadWindow;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_DestroyWindow])(client);
- if(result != Success) break;
- }
-
- /* Since ProcDestroyWindow is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
- return (result);
-}
-
-
-int PanoramiXDestroySubwindows(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityDestroyAccess)))
- return BadWindow;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_DestroySubwindows])(client);
- if(result != Success) break;
- }
-
- /* DestroySubwindows is using FreeResource which will free
- our resources for us on the last pass through the loop above */
-
- return (result);
-}
-
-
-int PanoramiXChangeSaveSet(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xChangeSaveSetReq);
-
- REQUEST_SIZE_MATCH(xChangeSaveSetReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- result = (*SavedProcVector[X_ChangeSaveSet])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXReparentWindow(ClientPtr client)
-{
- PanoramiXRes *win, *parent;
- int result = 0, j;
- int x, y;
- Bool parentIsRoot;
- REQUEST(xReparentWindowReq);
-
- REQUEST_SIZE_MATCH(xReparentWindowReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if(!(parent = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->parent, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- x = stuff->x;
- y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
- (stuff->parent == savedScreenInfo[0].wid);
- FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- stuff->parent = parent->info[j].id;
- if(parentIsRoot) {
- stuff->x = x - panoramiXdataPtr[j].x;
- stuff->y = y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_ReparentWindow])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXMapWindow(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_MapWindow])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXMapSubwindows(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_MapSubwindows])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXUnmapWindow(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_UnmapWindow])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXUnmapSubwindows(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_UnmapSubwindows])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXConfigureWindow(ClientPtr client)
-{
- PanoramiXRes *win;
- PanoramiXRes *sib = NULL;
- WindowPtr pWin;
- int result = 0, j, len, sib_offset = 0, x = 0, y = 0;
- int x_offset = -1;
- int y_offset = -1;
- REQUEST(xConfigureWindowReq);
-
- REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
-
- len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- /* because we need the parent */
- if (!(pWin = (WindowPtr)SecurityLookupIDByType(
- client, stuff->window, RT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if ((Mask)stuff->mask & CWSibling) {
- XID tmp;
- sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) {
- if(!(sib = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
- }
- }
-
- if(pWin->parent && ((pWin->parent == WindowTable[0]) ||
- (pWin->parent->drawable.id == savedScreenInfo[0].wid)))
- {
- if ((Mask)stuff->mask & CWX) {
- x_offset = 0;
- x = *((CARD32 *)&stuff[1]);
- }
- if ((Mask)stuff->mask & CWY) {
- y_offset = (x_offset == -1) ? 0 : 1;
- y = *((CARD32 *) &stuff[1] + y_offset);
- }
- }
-
- /* have to go forward or you get expose events before
- ConfigureNotify events */
- FOR_NSCREENS_FORWARD(j) {
- stuff->window = win->info[j].id;
- if(sib)
- *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
- if(x_offset >= 0)
- *((CARD32 *) &stuff[1] + x_offset) = x - panoramiXdataPtr[j].x;
- if(y_offset >= 0)
- *((CARD32 *) &stuff[1] + y_offset) = y - panoramiXdataPtr[j].y;
- result = (*SavedProcVector[X_ConfigureWindow])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXCirculateWindow(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j;
- REQUEST(xCirculateWindowReq);
-
- REQUEST_SIZE_MATCH(xCirculateWindowReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->window = win->info[j].id;
- result = (*SavedProcVector[X_CirculateWindow])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXGetGeometry(ClientPtr client)
-{
- xGetGeometryReply rep;
- DrawablePtr pDraw;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- VERIFY_GEOMETRABLE (pDraw, stuff->id, client);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.root = WindowTable[0]->drawable.id;
- rep.depth = pDraw->depth;
- rep.width = pDraw->width;
- rep.height = pDraw->height;
- rep.x = rep.y = rep.borderWidth = 0;
-
- if (stuff->id == rep.root) {
- xWindowRoot *root = (xWindowRoot *)
- (ConnectionInfo + connBlockScreenStart);
-
- rep.width = root->pixWidth;
- rep.height = root->pixHeight;
- } else
- if ((pDraw->type == UNDRAWABLE_WINDOW) || (pDraw->type == DRAWABLE_WINDOW))
- {
- WindowPtr pWin = (WindowPtr)pDraw;
- rep.x = pWin->origin.x - wBorderWidth (pWin);
- rep.y = pWin->origin.y - wBorderWidth (pWin);
- if((pWin->parent == WindowTable[0]) ||
- (pWin->parent->drawable.id == savedScreenInfo[0].wid))
- {
- rep.x += panoramiXdataPtr[0].x;
- rep.y += panoramiXdataPtr[0].y;
- }
- rep.borderWidth = pWin->borderWidth;
- }
-
- WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
- return (client->noClientException);
-}
-
-int PanoramiXTranslateCoords(ClientPtr client)
-{
- INT16 x, y;
- REQUEST(xTranslateCoordsReq);
-
- register WindowPtr pWin, pDst;
- xTranslateCoordsReply rep;
-
- REQUEST_SIZE_MATCH(xTranslateCoordsReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client,
- SecurityReadAccess);
- if (!pDst)
- return(BadWindow);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.sameScreen = xTrue;
- rep.child = None;
-
- if((pWin == WindowTable[0]) ||
- (pWin->drawable.id == savedScreenInfo[0].wid))
- {
- x = stuff->srcX - panoramiXdataPtr[0].x;
- y = stuff->srcY - panoramiXdataPtr[0].y;
- } else {
- x = pWin->drawable.x + stuff->srcX;
- y = pWin->drawable.y + stuff->srcY;
- }
- pWin = pDst->firstChild;
- while (pWin) {
-#ifdef SHAPE
- BoxRec box;
-#endif
- if ((pWin->mapped) &&
- (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
- (x < pWin->drawable.x + (int)pWin->drawable.width +
- wBorderWidth (pWin)) &&
- (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
- (y < pWin->drawable.y + (int)pWin->drawable.height +
- wBorderWidth (pWin))
-#ifdef SHAPE
- /* When a window is shaped, a further check
- * is made to see if the point is inside
- * borderSize
- */
- && (!wBoundingShape(pWin) ||
- POINT_IN_REGION(pWin->drawable.pScreen,
- wBoundingShape(pWin),
- x - pWin->drawable.x,
- y - pWin->drawable.y, &box))
-#endif
- )
- {
- rep.child = pWin->drawable.id;
- pWin = (WindowPtr) NULL;
- }
- else
- pWin = pWin->nextSib;
- }
- rep.dstX = x - pDst->drawable.x;
- rep.dstY = y - pDst->drawable.y;
- if((pDst == WindowTable[0]) ||
- (pDst->drawable.id == savedScreenInfo[0].wid))
- {
- rep.dstX += panoramiXdataPtr[0].x;
- rep.dstY += panoramiXdataPtr[0].y;
- }
-
- WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
- return(client->noClientException);
-}
-
-int PanoramiXCreatePixmap(ClientPtr client)
-{
- PanoramiXRes *refDraw, *newPix;
- int result = 0, j;
- REQUEST(xCreatePixmapReq);
-
- REQUEST_SIZE_MATCH(xCreatePixmapReq);
- client->errorValue = stuff->pid;
-
- if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess)))
- return BadDrawable;
-
- if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newPix->type = XRT_PIXMAP;
- newPix->u.pix.shared = FALSE;
- newPix->info[0].id = stuff->pid;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newPix->info[j].id = FakeClientID(client->index);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->pid = newPix->info[j].id;
- stuff->drawable = refDraw->info[j].id;
- result = (*SavedProcVector[X_CreatePixmap])(client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
- else
- xfree(newPix);
-
- return (result);
-}
-
-
-int PanoramiXFreePixmap(ClientPtr client)
-{
- PanoramiXRes *pix;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- client->errorValue = stuff->id;
-
- if(!(pix = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_PIXMAP, SecurityDestroyAccess)))
- return BadPixmap;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = pix->info[j].id;
- result = (*SavedProcVector[X_FreePixmap])(client);
- if(result != Success) break;
- }
-
- /* Since ProcFreePixmap is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
- return (result);
-}
-
-
-int PanoramiXCreateGC(ClientPtr client)
-{
- PanoramiXRes *refDraw;
- PanoramiXRes *newGC;
- PanoramiXRes *stip = NULL;
- PanoramiXRes *tile = NULL;
- PanoramiXRes *clip = NULL;
- REQUEST(xCreateGCReq);
- int tile_offset = 0, stip_offset = 0, clip_offset = 0;
- int result = 0, len, j;
- XID tmp;
-
- REQUEST_AT_LEAST_SIZE(xCreateGCReq);
-
- client->errorValue = stuff->gc;
- len = client->req_len - (sizeof(xCreateGCReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess)))
- return BadDrawable;
-
- if ((Mask)stuff->mask & GCTile) {
- tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
- if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & GCStipple) {
- stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
- if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & GCClipMask) {
- clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
- if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
-
- if(!(newGC = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newGC->type = XRT_GC;
- newGC->info[0].id = stuff->gc;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newGC->info[j].id = FakeClientID(client->index);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = newGC->info[j].id;
- stuff->drawable = refDraw->info[j].id;
- if (tile)
- *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
- if (stip)
- *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
- if (clip)
- *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
- result = (*SavedProcVector[X_CreateGC])(client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newGC->info[0].id, XRT_GC, newGC);
- else
- xfree(newGC);
-
- return (result);
-}
-
-int PanoramiXChangeGC(ClientPtr client)
-{
- PanoramiXRes *gc;
- PanoramiXRes *stip = NULL;
- PanoramiXRes *tile = NULL;
- PanoramiXRes *clip = NULL;
- REQUEST(xChangeGCReq);
- int tile_offset = 0, stip_offset = 0, clip_offset = 0;
- int result = 0, len, j;
- XID tmp;
-
- REQUEST_AT_LEAST_SIZE(xChangeGCReq);
-
- len = client->req_len - (sizeof(xChangeGCReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if (!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if ((Mask)stuff->mask & GCTile) {
- tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
- if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & GCStipple) {
- stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
- if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
- if ((Mask)stuff->mask & GCClipMask) {
- clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
- if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
-
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- if (tile)
- *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
- if (stip)
- *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
- if (clip)
- *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
- result = (*SavedProcVector[X_ChangeGC])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXCopyGC(ClientPtr client)
-{
- PanoramiXRes *srcGC, *dstGC;
- int result = 0, j;
- REQUEST(xCopyGCReq);
-
- REQUEST_SIZE_MATCH(xCopyGCReq);
-
- if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->srcGC, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->dstGC, XRT_GC, SecurityWriteAccess)))
- return BadGC;
-
- FOR_NSCREENS(j) {
- stuff->srcGC = srcGC->info[j].id;
- stuff->dstGC = dstGC->info[j].id;
- result = (*SavedProcVector[X_CopyGC])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXSetDashes(ClientPtr client)
-{
- PanoramiXRes *gc;
- int result = 0, j;
- REQUEST(xSetDashesReq);
-
- REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityWriteAccess)))
- return BadGC;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- result = (*SavedProcVector[X_SetDashes])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXSetClipRectangles(ClientPtr client)
-{
- PanoramiXRes *gc;
- int result = 0, j;
- REQUEST(xSetClipRectanglesReq);
-
- REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityWriteAccess)))
- return BadGC;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- result = (*SavedProcVector[X_SetClipRectangles])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-int PanoramiXFreeGC(ClientPtr client)
-{
- PanoramiXRes *gc;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_GC, SecurityDestroyAccess)))
- return BadGC;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = gc->info[j].id;
- result = (*SavedProcVector[X_FreeGC])(client);
- if(result != Success) break;
- }
-
- /* Since ProcFreeGC is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
- return (result);
-}
-
-
-int PanoramiXClearToBackground(ClientPtr client)
-{
- PanoramiXRes *win;
- int result = 0, j, x, y;
- Bool isRoot;
- REQUEST(xClearAreaReq);
-
- REQUEST_SIZE_MATCH(xClearAreaReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- x = stuff->x;
- y = stuff->y;
- isRoot = win->u.win.root;
- FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- if(isRoot) {
- stuff->x = x - panoramiXdataPtr[j].x;
- stuff->y = y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_ClearArea])(client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-
-/*
- For Window to Pixmap copies you're screwed since each screen's
- pixmap will look like what it sees on its screen. Unless the
- screens overlap and the window lies on each, the two copies
- will be out of sync. To remedy this we do a GetImage and PutImage
- in place of the copy. Doing this as a single Image isn't quite
- correct since it will include the obscured areas but we will
- have to fix this later. (MArk).
-*/
-
-int PanoramiXCopyArea(ClientPtr client)
-{
- int j, result = 0, srcx, srcy, dstx, dsty;
- PanoramiXRes *gc, *src, *dst;
- Bool srcIsRoot = FALSE;
- Bool dstIsRoot = FALSE;
- Bool srcShared, dstShared;
- REQUEST(xCopyAreaReq);
-
- REQUEST_SIZE_MATCH(xCopyAreaReq);
-
- if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess)))
- return BadDrawable;
-
- srcShared = IS_SHARED_PIXMAP(src);
-
- if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- dstShared = IS_SHARED_PIXMAP(dst);
-
- if(dstShared && srcShared)
- return (* SavedProcVector[X_CopyArea])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if((dst->type == XRT_WINDOW) && dst->u.win.root)
- dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) && src->u.win.root)
- srcIsRoot = TRUE;
-
- srcx = stuff->srcX; srcy = stuff->srcY;
- dstx = stuff->dstX; dsty = stuff->dstY;
- if((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
- DrawablePtr drawables[MAXSCREENS];
- DrawablePtr pDst;
- GCPtr pGC;
- char *data;
- int pitch;
-
- FOR_NSCREENS(j)
- VERIFY_DRAWABLE(drawables[j], src->info[j].id, client);
-
- pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
- if(!(data = xcalloc(1, stuff->height * pitch)))
- return BadAlloc;
-
- XineramaGetImageData(drawables, srcx, srcy,
- stuff->width, stuff->height, ZPixmap, ~0, data, pitch,
- srcIsRoot);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, pGC, client);
-
- if(drawables[0]->depth != pDst->depth) {
- client->errorValue = stuff->dstDrawable;
- xfree(data);
- return (BadMatch);
- }
-
- (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
- stuff->width, stuff->height,
- 0, ZPixmap, data);
-
- if(dstShared) break;
- }
-
- xfree(data);
-
- result = Success;
- } else {
- DrawablePtr pDst = NULL, pSrc = NULL;
- GCPtr pGC = NULL;
- RegionPtr pRgn[MAXSCREENS];
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->dstDrawable = dst->info[j].id;
- stuff->srcDrawable = src->info[j].id;
- stuff->gc = gc->info[j].id;
- if (srcIsRoot) {
- stuff->srcX = srcx - panoramiXdataPtr[j].x;
- stuff->srcY = srcy - panoramiXdataPtr[j].y;
- }
- if (dstIsRoot) {
- stuff->dstX = dstx - panoramiXdataPtr[j].x;
- stuff->dstY = dsty - panoramiXdataPtr[j].y;
- }
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
- if (stuff->dstDrawable != stuff->srcDrawable) {
- SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
- SecurityReadAccess);
- if ((pDst->pScreen != pSrc->pScreen) ||
- (pDst->depth != pSrc->depth)) {
- client->errorValue = stuff->dstDrawable;
- return (BadMatch);
- }
- } else
- pSrc = pDst;
-
- pRgn[j] = (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY);
-
- if(dstShared) {
- while(j--) pRgn[j] = NULL;
- break;
- }
- }
-
- if(pGC->graphicsExposures) {
- ScreenPtr pScreen = pDst->pScreen;
- RegionRec totalReg;
- Bool overlap;
-
- REGION_NULL(pScreen, &totalReg);
- FOR_NSCREENS_BACKWARD(j) {
- if(pRgn[j]) {
- if(srcIsRoot) {
- REGION_TRANSLATE(pScreen, pRgn[j],
- panoramiXdataPtr[j].x, panoramiXdataPtr[j].y);
- }
- REGION_APPEND(pScreen, &totalReg, pRgn[j]);
- REGION_DESTROY(pScreen, pRgn[j]);
- }
- }
- REGION_VALIDATE(pScreen, &totalReg, &overlap);
- (*pScreen->SendGraphicsExpose)(
- client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
- REGION_UNINIT(pScreen, &totalReg);
- }
-
- result = client->noClientException;
- }
-
- return (result);
-}
-
-
-int PanoramiXCopyPlane(ClientPtr client)
-{
- int j, srcx, srcy, dstx, dsty;
- PanoramiXRes *gc, *src, *dst;
- Bool srcIsRoot = FALSE;
- Bool dstIsRoot = FALSE;
- Bool srcShared, dstShared;
- DrawablePtr psrcDraw, pdstDraw = NULL;
- GCPtr pGC = NULL;
- RegionPtr pRgn[MAXSCREENS];
- REQUEST(xCopyPlaneReq);
-
- REQUEST_SIZE_MATCH(xCopyPlaneReq);
-
- if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess)))
- return BadDrawable;
-
- srcShared = IS_SHARED_PIXMAP(src);
-
- if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- dstShared = IS_SHARED_PIXMAP(dst);
-
- if(dstShared && srcShared)
- return (* SavedProcVector[X_CopyPlane])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if((dst->type == XRT_WINDOW) && dst->u.win.root)
- dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) && src->u.win.root)
- srcIsRoot = TRUE;
-
- srcx = stuff->srcX; srcy = stuff->srcY;
- dstx = stuff->dstX; dsty = stuff->dstY;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->dstDrawable = dst->info[j].id;
- stuff->srcDrawable = src->info[j].id;
- stuff->gc = gc->info[j].id;
- if (srcIsRoot) {
- stuff->srcX = srcx - panoramiXdataPtr[j].x;
- stuff->srcY = srcy - panoramiXdataPtr[j].y;
- }
- if (dstIsRoot) {
- stuff->dstX = dstx - panoramiXdataPtr[j].x;
- stuff->dstY = dsty - panoramiXdataPtr[j].y;
- }
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
- if (stuff->dstDrawable != stuff->srcDrawable) {
- SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
- SecurityReadAccess);
- if (pdstDraw->pScreen != psrcDraw->pScreen) {
- client->errorValue = stuff->dstDrawable;
- return (BadMatch);
- }
- } else
- psrcDraw = pdstDraw;
-
- if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
- (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) {
- client->errorValue = stuff->bitPlane;
- return(BadValue);
- }
-
- pRgn[j] = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC,
- stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY, stuff->bitPlane);
-
- if(dstShared) {
- while(j--) pRgn[j] = NULL;
- break;
- }
- }
-
- if(pGC->graphicsExposures) {
- ScreenPtr pScreen = pdstDraw->pScreen;
- RegionRec totalReg;
- Bool overlap;
-
- REGION_NULL(pScreen, &totalReg);
- FOR_NSCREENS_BACKWARD(j) {
- if(pRgn[j]) {
- REGION_APPEND(pScreen, &totalReg, pRgn[j]);
- REGION_DESTROY(pScreen, pRgn[j]);
- }
- }
- REGION_VALIDATE(pScreen, &totalReg, &overlap);
- (*pScreen->SendGraphicsExpose)(
- client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
- REGION_UNINIT(pScreen, &totalReg);
- }
-
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyPoint(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- int result = 0, npoint, j;
- xPoint *origPts;
- Bool isRoot;
- REQUEST(xPolyPointReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyPointReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyPoint])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
- npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
- if (npoint > 0) {
- origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
- memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xPoint *pnts = (xPoint*)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
-
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyPoint])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origPts);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyLine(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- int result = 0, npoint, j;
- xPoint *origPts;
- Bool isRoot;
- REQUEST(xPolyLineReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyLineReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyLine])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
- npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
- if (npoint > 0){
- origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
- memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xPoint *pnts = (xPoint*)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
-
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyLine])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origPts);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolySegment(ClientPtr client)
-{
- int result = 0, nsegs, i, j;
- PanoramiXRes *gc, *draw;
- xSegment *origSegs;
- Bool isRoot;
- REQUEST(xPolySegmentReq);
-
- REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolySegment])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
- if(nsegs & 4) return BadLength;
- nsegs >>= 3;
- if (nsegs > 0) {
- origSegs = (xSegment *) ALLOCATE_LOCAL(nsegs * sizeof(xSegment));
- memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xSegment *segs = (xSegment*)&stuff[1];
-
- for (i = nsegs; i--; segs++) {
- segs->x1 -= x_off;
- segs->x2 -= x_off;
- segs->y1 -= y_off;
- segs->y2 -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolySegment])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origSegs);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyRectangle(ClientPtr client)
-{
- int result = 0, nrects, i, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- xRectangle *origRecs;
- REQUEST(xPolyRectangleReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyRectangleReq);
-
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyRectangle])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
- if(nrects & 4) return BadLength;
- nrects >>= 3;
- if (nrects > 0){
- origRecs = (xRectangle *) ALLOCATE_LOCAL(nrects * sizeof(xRectangle));
- memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
-
- if(x_off || y_off) {
- xRectangle *rects = (xRectangle *) &stuff[1];
-
- for (i = nrects; i--; rects++) {
- rects->x -= x_off;
- rects->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyRectangle])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origRecs);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyArc(ClientPtr client)
-{
- int result = 0, narcs, i, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- xArc *origArcs;
- REQUEST(xPolyArcReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyArcReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyArc])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
- if(narcs % sizeof(xArc)) return BadLength;
- narcs /= sizeof(xArc);
- if (narcs > 0){
- origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc));
- memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xArc *arcs = (xArc *) &stuff[1];
-
- for (i = narcs; i--; arcs++) {
- arcs->x -= x_off;
- arcs->y -= y_off;
- }
- }
- }
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyArc])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origArcs);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXFillPoly(ClientPtr client)
-{
- int result = 0, count, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- DDXPointPtr locPts;
- REQUEST(xFillPolyReq);
-
- REQUEST_AT_LEAST_SIZE(xFillPolyReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_FillPoly])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
- if (count > 0){
- locPts = (DDXPointPtr) ALLOCATE_LOCAL(count * sizeof(DDXPointRec));
- memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- DDXPointPtr pnts = (DDXPointPtr)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : count;
-
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_FillPoly])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(locPts);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyFillRectangle(ClientPtr client)
-{
- int result = 0, things, i, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- xRectangle *origRects;
- REQUEST(xPolyFillRectangleReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyFillRectangle])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
- if(things & 4) return BadLength;
- things >>= 3;
- if (things > 0){
- origRects = (xRectangle *) ALLOCATE_LOCAL(things * sizeof(xRectangle));
- memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xRectangle *rects = (xRectangle *) &stuff[1];
-
- for (i = things; i--; rects++) {
- rects->x -= x_off;
- rects->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyFillRectangle])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origRects);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPolyFillArc(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result = 0, narcs, i, j;
- xArc *origArcs;
- REQUEST(xPolyFillArcReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyFillArc])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
- IF_RETURN((narcs % sizeof(xArc)), BadLength);
- narcs /= sizeof(xArc);
- if (narcs > 0) {
- origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc));
- memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
-
- if (isRoot) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xArc *arcs = (xArc *) &stuff[1];
-
- for (i = narcs; i--; arcs++) {
- arcs->x -= x_off;
- arcs->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyFillArc])(client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(origArcs);
- return (result);
- } else
- return (client->noClientException);
-}
-
-
-int PanoramiXPutImage(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int j, result = 0, orig_x, orig_y;
- REQUEST(xPutImageReq);
-
- REQUEST_AT_LEAST_SIZE(xPutImageReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PutImage])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->dstX;
- orig_y = stuff->dstY;
- FOR_NSCREENS_BACKWARD(j){
- if (isRoot) {
- stuff->dstX = orig_x - panoramiXdataPtr[j].x;
- stuff->dstY = orig_y - panoramiXdataPtr[j].y;
- }
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PutImage])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXGetImage(ClientPtr client)
-{
- DrawablePtr drawables[MAXSCREENS];
- DrawablePtr pDraw;
- PanoramiXRes *draw;
- xGetImageReply xgi;
- Bool isRoot;
- char *pBuf;
- int i, x, y, w, h, format;
- Mask plane = 0, planemask;
- int linesDone, nlines, linesPerBuf;
- long widthBytesLine, length;
-
- REQUEST(xGetImageReq);
-
- REQUEST_SIZE_MATCH(xGetImageReq);
-
- if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
- client->errorValue = stuff->format;
- return(BadValue);
- }
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(draw->type == XRT_PIXMAP)
- return (*SavedProcVector[X_GetImage])(client);
-
- VERIFY_DRAWABLE(pDraw, stuff->drawable, client);
-
- if(!((WindowPtr)pDraw)->realized)
- return(BadMatch);
-
- x = stuff->x;
- y = stuff->y;
- w = stuff->width;
- h = stuff->height;
- format = stuff->format;
- planemask = stuff->planeMask;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- if(isRoot) {
- if( /* check for being onscreen */
- x < 0 || x + w > PanoramiXPixWidth ||
- y < 0 || y + h > PanoramiXPixHeight )
- return(BadMatch);
- } else {
- if( /* check for being onscreen */
- panoramiXdataPtr[0].x + pDraw->x + x < 0 ||
- panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
- panoramiXdataPtr[0].y + pDraw->y + y < 0 ||
- panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
- /* check for being inside of border */
- x < - wBorderWidth((WindowPtr)pDraw) ||
- x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- y < -wBorderWidth((WindowPtr)pDraw) ||
- y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
- return(BadMatch);
- }
-
- drawables[0] = pDraw;
- for(i = 1; i < PanoramiXNumScreens; i++)
- VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client);
-
- xgi.visual = wVisual (((WindowPtr) pDraw));
- xgi.type = X_Reply;
- xgi.sequenceNumber = client->sequence;
- xgi.depth = pDraw->depth;
- if(format == ZPixmap) {
- widthBytesLine = PixmapBytePad(w, pDraw->depth);
- length = widthBytesLine * h;
-
-
- } else {
- widthBytesLine = BitmapBytePad(w);
- plane = ((Mask)1) << (pDraw->depth - 1);
- /* only planes asked for */
- length = widthBytesLine * h *
- Ones(planemask & (plane | (plane - 1)));
-
- }
-
- xgi.length = (length + 3) >> 2;
-
- if (widthBytesLine == 0 || h == 0)
- linesPerBuf = 0;
- else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE)
- linesPerBuf = 1;
- else {
- linesPerBuf = XINERAMA_IMAGE_BUFSIZE / widthBytesLine;
- if (linesPerBuf > h)
- linesPerBuf = h;
- }
- length = linesPerBuf * widthBytesLine;
- if(!(pBuf = xalloc(length)))
- return (BadAlloc);
-
- WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
-
- if (linesPerBuf == 0) {
- /* nothing to do */
- }
- else if (format == ZPixmap) {
- linesDone = 0;
- while (h - linesDone > 0) {
- nlines = min(linesPerBuf, h - linesDone);
-
- if(pDraw->depth == 1)
- bzero(pBuf, nlines * widthBytesLine);
-
- XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
- format, planemask, pBuf, widthBytesLine, isRoot);
-
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
- linesDone += nlines;
- }
- } else { /* XYPixmap */
- for (; plane; plane >>= 1) {
- if (planemask & plane) {
- linesDone = 0;
- while (h - linesDone > 0) {
- nlines = min(linesPerBuf, h - linesDone);
-
- bzero(pBuf, nlines * widthBytesLine);
-
- XineramaGetImageData(drawables, x, y + linesDone, w,
- nlines, format, plane, pBuf,
- widthBytesLine, isRoot);
-
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
-
- linesDone += nlines;
- }
- }
- }
- }
- xfree(pBuf);
- return (client->noClientException);
-}
-
-
-/* The text stuff should be rewritten so that duplication happens
- at the GlyphBlt level. That is, loading the font and getting
- the glyphs should only happen once */
-
-int
-PanoramiXPolyText8(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result = 0, j;
- int orig_x, orig_y;
- REQUEST(xPolyTextReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyText8])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->x;
- orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - panoramiXdataPtr[j].x;
- stuff->y = orig_y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_PolyText8])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-int
-PanoramiXPolyText16(ClientPtr client)
-{
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result = 0, j;
- int orig_x, orig_y;
- REQUEST(xPolyTextReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyText16])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->x;
- orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - panoramiXdataPtr[j].x;
- stuff->y = orig_y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_PolyText16])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXImageText8(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int orig_x, orig_y;
- REQUEST(xImageTextReq);
-
- REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_ImageText8])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->x;
- orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - panoramiXdataPtr[j].x;
- stuff->y = orig_y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_ImageText8])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXImageText16(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *gc, *draw;
- Bool isRoot;
- int orig_x, orig_y;
- REQUEST(xImageTextReq);
-
- REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_ImageText16])(client);
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->x;
- orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - panoramiXdataPtr[j].x;
- stuff->y = orig_y - panoramiXdataPtr[j].y;
- }
- result = (*SavedProcVector[X_ImageText16])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-
-int PanoramiXCreateColormap(ClientPtr client)
-{
- PanoramiXRes *win, *newCmap;
- int result = 0, j, orig_visual;
- REQUEST(xCreateColormapReq);
-
- REQUEST_SIZE_MATCH(xCreateColormapReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->window, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- if(!stuff->visual || (stuff->visual > 255))
- return BadValue;
-
- if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newCmap->type = XRT_COLORMAP;
- newCmap->info[0].id = stuff->mid;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newCmap->info[j].id = FakeClientID(client->index);
-
- orig_visual = stuff->visual;
- FOR_NSCREENS_BACKWARD(j){
- stuff->mid = newCmap->info[j].id;
- stuff->window = win->info[j].id;
- stuff->visual = PanoramiXVisualTable[(orig_visual * MAXSCREENS) + j];
- result = (* SavedProcVector[X_CreateColormap])(client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
- else
- xfree(newCmap);
-
- return (result);
-}
-
-
-int PanoramiXFreeColormap(ClientPtr client)
-{
- PanoramiXRes *cmap;
- int result = 0, j;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- client->errorValue = stuff->id;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_COLORMAP, SecurityDestroyAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_FreeColormap])(client);
- if(result != Success) break;
- }
-
- /* Since ProcFreeColormap is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
- return (result);
-}
-
-
-int
-PanoramiXCopyColormapAndFree(ClientPtr client)
-{
- PanoramiXRes *cmap, *newCmap;
- int result = 0, j;
- REQUEST(xCopyColormapAndFreeReq);
-
- REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
-
- client->errorValue = stuff->srcCmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->srcCmap, XRT_COLORMAP,
- SecurityReadAccess | SecurityWriteAccess)))
- return BadColor;
-
- if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newCmap->type = XRT_COLORMAP;
- newCmap->info[0].id = stuff->mid;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newCmap->info[j].id = FakeClientID(client->index);
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->srcCmap = cmap->info[j].id;
- stuff->mid = newCmap->info[j].id;
- result = (* SavedProcVector[X_CopyColormapAndFree])(client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
- else
- xfree(newCmap);
-
- return (result);
-}
-
-
-int PanoramiXInstallColormap(ClientPtr client)
-{
- REQUEST(xResourceReq);
- int result = 0, j;
- PanoramiXRes *cmap;
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- client->errorValue = stuff->id;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_COLORMAP, SecurityReadAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_InstallColormap])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXUninstallColormap(ClientPtr client)
-{
- REQUEST(xResourceReq);
- int result = 0, j;
- PanoramiXRes *cmap;
-
- REQUEST_SIZE_MATCH(xResourceReq);
-
- client->errorValue = stuff->id;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->id, XRT_COLORMAP, SecurityReadAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_UninstallColormap])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXAllocColor(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xAllocColorReq);
-
- REQUEST_SIZE_MATCH(xAllocColorReq);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColor])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXAllocNamedColor(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xAllocNamedColorReq);
-
- REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocNamedColor])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXAllocColorCells(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xAllocColorCellsReq);
-
- REQUEST_SIZE_MATCH(xAllocColorCellsReq);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColorCells])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXAllocColorPlanes(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xAllocColorPlanesReq);
-
- REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColorPlanes])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-
-int PanoramiXFreeColors(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xFreeColorsReq);
-
- REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_FreeColors])(client);
- }
- return (result);
-}
-
-
-int PanoramiXStoreColors(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xStoreColorsReq);
-
- REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_StoreColors])(client);
- if(result != Success) break;
- }
- return (result);
-}
-
-
-int PanoramiXStoreNamedColor(ClientPtr client)
-{
- int result = 0, j;
- PanoramiXRes *cmap;
- REQUEST(xStoreNamedColorReq);
-
- REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
-
- client->errorValue = stuff->cmap;
-
- if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
- return BadColor;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_StoreNamedColor])(client);
- if(result != Success) break;
- }
- return (result);
-}
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
deleted file mode 100644
index 27cbcda52..000000000
--- a/Xext/panoramiXsrv.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXsrv.h,v 1.9 2001/08/11 21:00:06 mvojkovi Exp $ */
-
-#ifndef _PANORAMIXSRV_H_
-#define _PANORAMIXSRV_H_
-
-#include "panoramiX.h"
-
-extern int PanoramiXNumScreens;
-extern PanoramiXData *panoramiXdataPtr;
-extern int PanoramiXPixWidth;
-extern int PanoramiXPixHeight;
-extern RegionRec PanoramiXScreenRegion;
-extern XID *PanoramiXVisualTable;
-
-extern void PanoramiXConsolidate(void);
-extern Bool PanoramiXCreateConnectionBlock(void);
-extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
-extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID);
-extern WindowPtr PanoramiXChangeWindow(int, WindowPtr);
-extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
-extern int XineramaDeleteResource(pointer, XID);
-
-extern RegionRec XineramaScreenRegions[MAXSCREENS];
-
-extern unsigned long XRC_DRAWABLE;
-extern unsigned long XRT_WINDOW;
-extern unsigned long XRT_PIXMAP;
-extern unsigned long XRT_GC;
-extern unsigned long XRT_COLORMAP;
-
-extern void XineramaGetImageData(
- DrawablePtr *pDrawables,
- int left,
- int top,
- int width,
- int height,
- unsigned int format,
- unsigned long planemask,
- char *data,
- int pitch,
- Bool isRoot
-);
-
-#endif /* _PANORAMIXSRV_H_ */
diff --git a/Xext/sampleEVI.c b/Xext/sampleEVI.c
deleted file mode 100644
index 15ed9401c..000000000
--- a/Xext/sampleEVI.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $Xorg: sampleEVI.c,v 1.3 2000/08/17 19:47:58 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/sampleEVI.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "dix.h"
-#define _XEVI_SERVER_
-#include "XEVIstr.h"
-#include "EVIstruct.h"
-#include "scrnintstr.h"
-static int sampleGetVisualInfo(
- VisualID32 *visual,
- int n_visual,
- xExtendedVisualInfo **evi_rn,
- int *n_info_rn,
- VisualID32 **conflict_rn,
- int *n_conflict_rn)
-{
- int max_sz_evi = n_visual * sz_xExtendedVisualInfo * screenInfo.numScreens;
- VisualID32 *temp_conflict;
- xExtendedVisualInfo *evi;
- int max_visuals = 0, max_sz_conflict, sz_conflict = 0;
- register int visualI, scrI, sz_evi = 0, conflictI, n_conflict;
- *evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);
- if (!*evi_rn)
- return BadAlloc;
- for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
- if (screenInfo.screens[scrI]->numVisuals > max_visuals)
- max_visuals = screenInfo.screens[scrI]->numVisuals;
- }
- max_sz_conflict = n_visual * sz_VisualID32 * screenInfo.numScreens * max_visuals;
- temp_conflict = (VisualID32 *)xalloc(max_sz_conflict);
- if (!temp_conflict) {
- xfree(*evi_rn);
- return BadAlloc;
- }
- for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
- for (visualI = 0; visualI < n_visual; visualI++) {
- evi[sz_evi].core_visual_id = visual[visualI];
- evi[sz_evi].screen = scrI;
- evi[sz_evi].level = 0;
- evi[sz_evi].transparency_type = XEVI_TRANSPARENCY_NONE;
- evi[sz_evi].transparency_value = 0;
- evi[sz_evi].min_hw_colormaps = 1;
- evi[sz_evi].max_hw_colormaps = 1;
- evi[sz_evi].num_colormap_conflicts = n_conflict = 0;
- for (conflictI = 0; conflictI < n_conflict; conflictI++)
- temp_conflict[sz_conflict++] = visual[visualI];
- sz_evi++;
- }
- }
- *conflict_rn = temp_conflict;
- *n_conflict_rn = sz_conflict;
- *n_info_rn = sz_evi;
- return Success;
-}
-
-static void sampleFreeVisualInfo(
- xExtendedVisualInfo *evi,
- VisualID32 *conflict)
-{
- if (evi)
- xfree(evi);
- if (conflict)
- xfree(conflict);
-}
-
-EviPrivPtr eviDDXInit(void)
-{
- static EviPrivRec eviPriv;
- eviPriv.getVisualInfo = sampleGetVisualInfo;
- eviPriv.freeVisualInfo = sampleFreeVisualInfo;
- return &eviPriv;
-}
-
-void eviDDXReset(void)
-{
-}
diff --git a/Xext/saver.c b/Xext/saver.c
deleted file mode 100644
index 944009773..000000000
--- a/Xext/saver.c
+++ /dev/null
@@ -1,1409 +0,0 @@
-/*
- * $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $
- *
-Copyright (c) 1992 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.8 2003/11/17 22:20:26 dawes Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "saverproto.h"
-#include "gcstruct.h"
-#include "cursorstr.h"
-#include "colormapst.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-
-#ifdef IN_MODULE
-#include <xf86_ansic.h>
-#else
-#include <stdio.h>
-#endif
-
-#include "modinit.h"
-
-#if 0
-static unsigned char ScreenSaverReqCode = 0;
-#endif
-static int ScreenSaverEventBase = 0;
-
-extern DISPATCH_PROC(ProcScreenSaverQueryInfo);
-static DISPATCH_PROC(ProcScreenSaverDispatch);
-static DISPATCH_PROC(ProcScreenSaverQueryVersion);
-static DISPATCH_PROC(ProcScreenSaverSelectInput);
-static DISPATCH_PROC(ProcScreenSaverSetAttributes);
-static DISPATCH_PROC(ProcScreenSaverUnsetAttributes);
-static DISPATCH_PROC(SProcScreenSaverDispatch);
-static DISPATCH_PROC(SProcScreenSaverQueryInfo);
-static DISPATCH_PROC(SProcScreenSaverQueryVersion);
-static DISPATCH_PROC(SProcScreenSaverSelectInput);
-static DISPATCH_PROC(SProcScreenSaverSetAttributes);
-static DISPATCH_PROC(SProcScreenSaverUnsetAttributes);
-
-static Bool ScreenSaverHandle (
- ScreenPtr /* pScreen */,
- int /* xstate */,
- Bool /* force */
- );
-
-static Bool
-CreateSaverWindow (
- ScreenPtr /* pScreen */
- );
-
-static Bool
-DestroySaverWindow (
- ScreenPtr /* pScreen */
- );
-
-static void
-UninstallSaverColormap (
- ScreenPtr /* pScreen */
- );
-
-static void
-CheckScreenPrivate (
- ScreenPtr /* pScreen */
- );
-
-static void SScreenSaverNotifyEvent (
- xScreenSaverNotifyEvent * /* from */,
- xScreenSaverNotifyEvent * /* to */
- );
-
-static void ScreenSaverResetProc (
- ExtensionEntry * /* extEntry */
- );
-
-/*
- * each screen has a list of clients requesting
- * ScreenSaverNotify events. Each client has a resource
- * for each screen it selects ScreenSaverNotify input for,
- * this resource is used to delete the ScreenSaverNotifyRec
- * entry from the per-screen queue.
- */
-
-static RESTYPE EventType; /* resource type for event masks */
-
-typedef struct _ScreenSaverEvent *ScreenSaverEventPtr;
-
-typedef struct _ScreenSaverEvent {
- ScreenSaverEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
-} ScreenSaverEventRec;
-
-static int ScreenSaverFreeEvents(
- pointer /* value */,
- XID /* id */
-);
-
-static Bool setEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */,
- unsigned long /* mask */
-);
-
-static unsigned long getEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */
-);
-
-/*
- * when a client sets the screen saver attributes, a resource is
- * kept to be freed when the client exits
- */
-
-static RESTYPE AttrType; /* resource type for attributes */
-
-typedef struct _ScreenSaverAttr {
- ScreenPtr screen;
- ClientPtr client;
- XID resource;
- short x, y;
- unsigned short width, height, borderWidth;
- unsigned char class;
- unsigned char depth;
- VisualID visual;
- CursorPtr pCursor;
- PixmapPtr pBackgroundPixmap;
- PixmapPtr pBorderPixmap;
- Colormap colormap;
- unsigned long mask; /* no pixmaps or cursors */
- unsigned long *values;
-} ScreenSaverAttrRec, *ScreenSaverAttrPtr;
-
-static int ScreenSaverFreeAttr (
- pointer /* value */,
- XID /* id */
-);
-
-static void FreeAttrs (
- ScreenSaverAttrPtr /* pAttr */
-);
-
-static void FreeScreenAttr (
- ScreenSaverAttrPtr /* pAttr */
-);
-
-static void
-SendScreenSaverNotify (
- ScreenPtr /* pScreen */,
- int /* state */,
- Bool /* forced */
-);
-
-typedef struct _ScreenSaverScreenPrivate {
- ScreenSaverEventPtr events;
- ScreenSaverAttrPtr attr;
- Bool hasWindow;
- Colormap installedMap;
-} ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr;
-
-static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (
- ScreenPtr /* pScreen */
- );
-
-static int ScreenPrivateIndex;
-
-#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr)
-#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v);
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
-
-#define New(t) ((t *) xalloc (sizeof (t)))
-
-/****************
- * ScreenSaverExtensionInit
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- ****************/
-
-void
-ScreenSaverExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
- ScreenPtr pScreen;
-
- AttrType = CreateNewResourceType(ScreenSaverFreeAttr);
- EventType = CreateNewResourceType(ScreenSaverFreeEvents);
- ScreenPrivateIndex = AllocateScreenPrivateIndex ();
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- SetScreenPrivate (pScreen, NULL);
- }
- if (AttrType && EventType && ScreenPrivateIndex != -1 &&
- (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
- ProcScreenSaverDispatch, SProcScreenSaverDispatch,
- ScreenSaverResetProc, StandardMinorOpcode)))
- {
-#if 0
- ScreenSaverReqCode = (unsigned char)extEntry->base;
-#endif
- ScreenSaverEventBase = extEntry->eventBase;
- EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
- }
-}
-
-/*ARGSUSED*/
-static void
-ScreenSaverResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
-}
-
-static void
-CheckScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (!pPriv)
- return;
- if (!pPriv->attr && !pPriv->events &&
- !pPriv->hasWindow && pPriv->installedMap == None)
- {
- xfree (pPriv);
- SetScreenPrivate (pScreen, NULL);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
- }
-}
-
-static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (pPriv)
- return pPriv;
- pPriv = New (ScreenSaverScreenPrivateRec);
- if (!pPriv)
- return 0;
- pPriv->events = 0;
- pPriv->attr = 0;
- pPriv->hasWindow = FALSE;
- pPriv->installedMap = None;
- SetScreenPrivate (pScreen, pPriv);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = ScreenSaverHandle;
- return pPriv;
-}
-
-static unsigned long
-getEventMask (pScreen, client)
- ScreenPtr pScreen;
- ClientPtr client;
-{
- SetupScreen(pScreen);
- ScreenSaverEventPtr pEv;
-
- if (!pPriv)
- return 0;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
- return 0;
-}
-
-static Bool
-setEventMask (pScreen, client, mask)
- ScreenPtr pScreen;
- ClientPtr client;
- unsigned long mask;
-{
- SetupScreen(pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
-
- if (getEventMask (pScreen, client) == mask)
- return TRUE;
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0)
- {
- FreeResource (pEv->resource, EventType);
- *pPrev = pEv->next;
- xfree (pEv);
- CheckScreenPrivate (pScreen);
- }
- else
- {
- if (!pEv)
- {
- pEv = New (ScreenSaverEventRec);
- if (!pEv)
- {
- CheckScreenPrivate (pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID (client->index);
- if (!AddResource (pEv->resource, EventType, (pointer) pEv))
- return FALSE;
- }
- pEv->mask = mask;
- }
- return TRUE;
-}
-
-static void
-FreeAttrs (pAttr)
- ScreenSaverAttrPtr pAttr;
-{
- PixmapPtr pPixmap;
- CursorPtr pCursor;
-
- if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
- if ((pPixmap = pAttr->pBorderPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
- if ((pCursor = pAttr->pCursor) != 0)
- FreeCursor (pCursor, (Cursor) 0);
-}
-
-static void
-FreeScreenAttr (pAttr)
- ScreenSaverAttrPtr pAttr;
-{
- FreeAttrs (pAttr);
- xfree (pAttr->values);
- xfree (pAttr);
-}
-
-static int
-ScreenSaverFreeEvents (value, id)
- pointer value;
- XID id;
-{
- ScreenSaverEventPtr pOld = (ScreenSaverEventPtr)value;
- ScreenPtr pScreen = pOld->screen;
- SetupScreen (pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
-
- if (!pPriv)
- return TRUE;
- for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
- if (!pEv)
- return TRUE;
- *pPrev = pEv->next;
- xfree (pEv);
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static int
-ScreenSaverFreeAttr (value, id)
- pointer value;
- XID id;
-{
- ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr)value;
- ScreenPtr pScreen = pOldAttr->screen;
- SetupScreen (pScreen);
-
- if (!pPriv)
- return TRUE;
- if (pPriv->attr != pOldAttr)
- return TRUE;
- FreeScreenAttr (pOldAttr);
- pPriv->attr = NULL;
- if (pPriv->hasWindow)
- {
- SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverReset);
- SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverActive);
- }
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static void
-SendScreenSaverNotify (pScreen, state, forced)
- ScreenPtr pScreen;
- int state;
- Bool forced;
-{
- ScreenSaverScreenPrivatePtr pPriv;
- ScreenSaverEventPtr pEv;
- unsigned long mask;
- xScreenSaverNotifyEvent ev;
- ClientPtr client;
- int kind;
-
- UpdateCurrentTimeIf ();
- mask = ScreenSaverNotifyMask;
- if (state == ScreenSaverCycle)
- mask = ScreenSaverCycleMask;
- pScreen = screenInfo.screens[pScreen->myNum];
- pPriv = GetScreenPrivate(pScreen);
- if (!pPriv)
- return;
- if (pPriv->attr)
- kind = ScreenSaverExternal;
- else if (ScreenSaverBlanking != DontPreferBlanking)
- kind = ScreenSaverBlanked;
- else
- kind = ScreenSaverInternal;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- {
- client = pEv->client;
- if (client->clientGone)
- continue;
- if (!(pEv->mask & mask))
- continue;
- ev.type = ScreenSaverNotify + ScreenSaverEventBase;
- ev.state = state;
- ev.sequenceNumber = client->sequence;
- ev.timestamp = currentTime.milliseconds;
- ev.root = WindowTable[pScreen->myNum]->drawable.id;
- ev.window = savedScreenInfo[pScreen->myNum].wid;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient (client, 1, (xEvent *) &ev);
- }
-}
-
-static void
-SScreenSaverNotifyEvent (from, to)
- xScreenSaverNotifyEvent *from, *to;
-{
- to->type = from->type;
- to->state = from->state;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->root, to->root);
- cpswapl (from->window, to->window);
- to->kind = from->kind;
- to->forced = from->forced;
-}
-
-static void
-UninstallSaverColormap (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen(pScreen);
- ColormapPtr pCmap;
-
- if (pPriv && pPriv->installedMap != None)
- {
- pCmap = (ColormapPtr) LookupIDByType (pPriv->installedMap, RT_COLORMAP);
- if (pCmap)
- (*pCmap->pScreen->UninstallColormap) (pCmap);
- pPriv->installedMap = None;
- CheckScreenPrivate (pScreen);
- }
-}
-
-static Bool
-CreateSaverWindow (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
- ScreenSaverStuffPtr pSaver;
- ScreenSaverAttrPtr pAttr;
- WindowPtr pWin;
- int result;
- unsigned long mask;
- Colormap *installedMaps;
- int numInstalled;
- int i;
- Colormap wantMap;
- ColormapPtr pCmap;
-
- pSaver = &savedScreenInfo[pScreen->myNum];
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
- if (pPriv)
- {
- UninstallSaverColormap (pScreen);
- pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- }
- }
-
- if (!pPriv || !(pAttr = pPriv->attr))
- return FALSE;
-
- pPriv->installedMap = None;
-
- if (GrabInProgress && GrabInProgress != pAttr->client->index)
- return FALSE;
-
- pWin = CreateWindow (pSaver->wid, WindowTable[pScreen->myNum],
- pAttr->x, pAttr->y, pAttr->width, pAttr->height,
- pAttr->borderWidth, pAttr->class,
- pAttr->mask, (XID *)pAttr->values,
- pAttr->depth, serverClient, pAttr->visual,
- &result);
- if (!pWin)
- return FALSE;
-
- if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
- return FALSE;
-
- mask = 0;
- if (pAttr->pBackgroundPixmap)
- {
- pWin->backgroundState = BackgroundPixmap;
- pWin->background.pixmap = pAttr->pBackgroundPixmap;
- pAttr->pBackgroundPixmap->refcnt++;
- mask |= CWBackPixmap;
- }
- if (pAttr->pBorderPixmap)
- {
- pWin->borderIsPixel = FALSE;
- pWin->border.pixmap = pAttr->pBorderPixmap;
- pAttr->pBorderPixmap->refcnt++;
- mask |= CWBorderPixmap;
- }
- if (pAttr->pCursor)
- {
- if (!pWin->optional)
- if (!MakeWindowOptional (pWin))
- {
- FreeResource (pWin->drawable.id, RT_NONE);
- return FALSE;
- }
- if (pWin->optional->cursor)
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->optional->cursor = pAttr->pCursor;
- pAttr->pCursor->refcnt++;
- pWin->cursorIsNone = FALSE;
- CheckWindowOptionalNeed (pWin);
- mask |= CWCursor;
- }
- if (mask)
- (*pScreen->ChangeWindowAttributes) (pWin, mask);
-
- if (pAttr->colormap != None)
- (void) ChangeWindowAttributes (pWin, CWColormap, &pAttr->colormap,
- serverClient);
-
- MapWindow (pWin, serverClient);
-
- pPriv->hasWindow = TRUE;
- pSaver->pWindow = pWin;
-
- /* check and install our own colormap if it isn't installed now */
- wantMap = wColormap (pWin);
- if (wantMap == None)
- return TRUE;
- installedMaps = (Colormap *) ALLOCATE_LOCAL (pScreen->maxInstalledCmaps *
- sizeof (Colormap));
- numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
- (pScreen, installedMaps);
- for (i = 0; i < numInstalled; i++)
- if (installedMaps[i] == wantMap)
- break;
-
- DEALLOCATE_LOCAL ((char *) installedMaps);
-
- if (i < numInstalled)
- return TRUE;
-
- pCmap = (ColormapPtr) LookupIDByType (wantMap, RT_COLORMAP);
- if (!pCmap)
- return TRUE;
-
- pPriv->installedMap = wantMap;
-
- (*pCmap->pScreen->InstallColormap) (pCmap);
-
- return TRUE;
-}
-
-static Bool
-DestroySaverWindow (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen(pScreen);
- ScreenSaverStuffPtr pSaver;
-
- if (!pPriv || !pPriv->hasWindow)
- return FALSE;
-
- pSaver = &savedScreenInfo[pScreen->myNum];
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
- }
- pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- UninstallSaverColormap (pScreen);
- return TRUE;
-}
-
-static Bool
-ScreenSaverHandle (pScreen, xstate, force)
- ScreenPtr pScreen;
- int xstate;
- Bool force;
-{
- int state = 0;
- Bool ret = FALSE;
- ScreenSaverScreenPrivatePtr pPriv;
-
- switch (xstate)
- {
- case SCREEN_SAVER_ON:
- state = ScreenSaverOn;
- ret = CreateSaverWindow (pScreen);
- break;
- case SCREEN_SAVER_OFF:
- state = ScreenSaverOff;
- ret = DestroySaverWindow (pScreen);
- break;
- case SCREEN_SAVER_CYCLE:
- state = ScreenSaverCycle;
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->hasWindow)
- ret = TRUE;
-
- }
-#ifdef PANORAMIX
- if(noPanoramiXExtension || !pScreen->myNum)
-#endif
- SendScreenSaverNotify (pScreen, state, force);
- return ret;
-}
-
-static int
-ProcScreenSaverQueryVersion (client)
- register ClientPtr client;
-{
- xScreenSaverQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = ScreenSaverMajorVersion;
- rep.minorVersion = ScreenSaverMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-int
-ProcScreenSaverQueryInfo (client)
- register ClientPtr client;
-{
- REQUEST(xScreenSaverQueryInfoReq);
- xScreenSaverQueryInfoReply rep;
- register int n;
- ScreenSaverStuffPtr pSaver;
- DrawablePtr pDraw;
- CARD32 lastInput;
- ScreenSaverScreenPrivatePtr pPriv;
-
- REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
- pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client);
- if (!pDraw)
- return BadDrawable;
-
- pSaver = &savedScreenInfo[pDraw->pScreen->myNum];
- pPriv = GetScreenPrivate (pDraw->pScreen);
-
- UpdateCurrentTime ();
- lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.window = pSaver->wid;
- if (screenIsSaved != SCREEN_SAVER_OFF)
- {
- rep.state = ScreenSaverOn;
- if (ScreenSaverTime)
- rep.tilOrSince = lastInput - ScreenSaverTime;
- else
- rep.tilOrSince = 0;
- }
- else
- {
- if (ScreenSaverTime)
- {
- rep.state = ScreenSaverOff;
- if (ScreenSaverTime < lastInput)
- rep.tilOrSince = 0;
- else
- rep.tilOrSince = ScreenSaverTime - lastInput;
- }
- else
- {
- rep.state = ScreenSaverDisabled;
- rep.tilOrSince = 0;
- }
- }
- rep.idle = lastInput;
- rep.eventMask = getEventMask (pDraw->pScreen, client);
- if (pPriv && pPriv->attr)
- rep.kind = ScreenSaverExternal;
- else if (ScreenSaverBlanking != DontPreferBlanking)
- rep.kind = ScreenSaverBlanked;
- else
- rep.kind = ScreenSaverInternal;
- if (client->swapped)
- {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.window, n);
- swapl (&rep.tilOrSince, n);
- swapl (&rep.idle, n);
- swapl (&rep.eventMask, n);
- }
- WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcScreenSaverSelectInput (client)
- register ClientPtr client;
-{
- REQUEST(xScreenSaverSelectInputReq);
- DrawablePtr pDraw;
-
- REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
- pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client);
- if (!pDraw)
- return BadDrawable;
- if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
- return BadAlloc;
- return Success;
-}
-
-static int
-ScreenSaverSetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- WindowPtr pParent;
- ScreenPtr pScreen;
- ScreenSaverScreenPrivatePtr pPriv = 0;
- ScreenSaverAttrPtr pAttr = 0;
- int ret;
- int len;
- int class, bw, depth;
- unsigned long visual;
- int idepth, ivisual;
- Bool fOK;
- DepthPtr pDepth;
- WindowOptPtr ancwopt;
- unsigned long *pVlist;
- unsigned long *values = 0;
- unsigned long tmask, imask;
- unsigned long val;
- Pixmap pixID;
- PixmapPtr pPixmap;
- Cursor cursorID;
- CursorPtr pCursor;
- Colormap cmap;
- ColormapPtr pCmap;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
- pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client);
- if (!pDraw)
- return BadDrawable;
- pScreen = pDraw->pScreen;
- pParent = WindowTable[pScreen->myNum];
-
- len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- switch (class = stuff->c_class)
- {
- case CopyFromParent:
- case InputOnly:
- case InputOutput:
- break;
- default:
- client->errorValue = class;
- return BadValue;
- }
- bw = stuff->borderWidth;
- depth = stuff->depth;
- visual = stuff->visualID;
-
- /* copied directly from CreateWindow */
-
- if (class == CopyFromParent)
- class = pParent->drawable.class;
-
- if ((class != InputOutput) && (class != InputOnly))
- {
- client->errorValue = class;
- return BadValue;
- }
-
- if ((class != InputOnly) && (pParent->drawable.class == InputOnly))
- return BadMatch;
-
- if ((class == InputOnly) && ((bw != 0) || (depth != 0)))
- return BadMatch;
-
- if ((class == InputOutput) && (depth == 0))
- depth = pParent->drawable.depth;
- ancwopt = pParent->optional;
- if (!ancwopt)
- ancwopt = FindWindowWithOptional(pParent)->optional;
- if (visual == CopyFromParent)
- visual = ancwopt->visual;
-
- /* Find out if the depth and visual are acceptable for this Screen */
- if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth))
- {
- fOK = FALSE;
- for(idepth = 0; idepth < pScreen->numDepths; idepth++)
- {
- pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
- if ((depth == pDepth->depth) || (depth == 0))
- {
- for (ivisual = 0; ivisual < pDepth->numVids; ivisual++)
- {
- if (visual == pDepth->vids[ivisual])
- {
- fOK = TRUE;
- break;
- }
- }
- }
- }
- if (fOK == FALSE)
- return BadMatch;
- }
-
- if (((stuff->mask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
- (class != InputOnly) &&
- (depth != pParent->drawable.depth))
- {
- return BadMatch;
- }
-
- if (((stuff->mask & CWColormap) == 0) &&
- (class != InputOnly) &&
- ((visual != ancwopt->visual) || (ancwopt->colormap == None)))
- {
- return BadMatch;
- }
-
- /* end of errors from CreateWindow */
-
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->attr)
- {
- if (pPriv->attr->client != client)
- return BadAccess;
- }
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- pAttr = New (ScreenSaverAttrRec);
- if (!pAttr)
- {
- ret = BadAlloc;
- goto bail;
- }
- /* over allocate for override redirect */
- values = (unsigned long *) xalloc ((len + 1) * sizeof (unsigned long));
- if (!values)
- {
- ret = BadAlloc;
- goto bail;
- }
- pAttr->screen = pScreen;
- pAttr->client = client;
- pAttr->x = stuff->x;
- pAttr->y = stuff->y;
- pAttr->width = stuff->width;
- pAttr->height = stuff->height;
- pAttr->borderWidth = stuff->borderWidth;
- pAttr->class = stuff->c_class;
- pAttr->depth = depth;
- pAttr->visual = visual;
- pAttr->colormap = None;
- pAttr->pCursor = NullCursor;
- pAttr->pBackgroundPixmap = NullPixmap;
- pAttr->pBorderPixmap = NullPixmap;
- pAttr->values = values;
- /*
- * go through the mask, checking the values,
- * looking up pixmaps and cursors and hold a reference
- * to them.
- */
- pAttr->mask = tmask = stuff->mask | CWOverrideRedirect;
- pVlist = (unsigned long *) (stuff + 1);
- while (tmask) {
- imask = lowbit (tmask);
- tmask &= ~imask;
- switch (imask)
- {
- case CWBackPixmap:
- pixID = (Pixmap )*pVlist;
- if (pixID == None)
- {
- *values++ = None;
- }
- else if (pixID == ParentRelative)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = ParentRelative;
- }
- else
- {
- pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
- if (pPixmap != (PixmapPtr) NULL)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBackgroundPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBackPixmap;
- }
- else
- {
- ret = BadPixmap;
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBackPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBorderPixmap:
- pixID = (Pixmap ) *pVlist;
- if (pixID == CopyFromParent)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = CopyFromParent;
- }
- else
- {
- pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBorderPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBorderPixmap;
- }
- else
- {
- ret = BadPixmap;
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBorderPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBitGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWWinGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingStore:
- val = (CARD8 )*pVlist;
- if ((val != NotUseful) && (val != WhenMapped) && (val != Always))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingPlanes:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBackingPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWSaveUnder:
- val = (BOOL) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWEventMask:
- *values++ = (CARD32) *pVlist;
- break;
- case CWDontPropagate:
- *values++ = (CARD32) *pVlist;
- break;
- case CWOverrideRedirect:
- if (!(stuff->mask & CWOverrideRedirect))
- pVlist--;
- else
- {
- val = (BOOL ) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- }
- *values++ = xTrue;
- break;
- case CWColormap:
- cmap = (Colormap) *pVlist;
- pCmap = (ColormapPtr)LookupIDByType(cmap, RT_COLORMAP);
- if (!pCmap)
- {
- ret = BadColor;
- client->errorValue = cmap;
- goto PatchUp;
- }
- if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->colormap = cmap;
- pAttr->mask &= ~CWColormap;
- break;
- case CWCursor:
- cursorID = (Cursor ) *pVlist;
- if ( cursorID == None)
- {
- *values++ = None;
- }
- else
- {
- pCursor = (CursorPtr)LookupIDByType(cursorID, RT_CURSOR);
- if (!pCursor)
- {
- ret = BadCursor;
- client->errorValue = cursorID;
- goto PatchUp;
- }
- pCursor->refcnt++;
- pAttr->pCursor = pCursor;
- pAttr->mask &= ~CWCursor;
- }
- break;
- default:
- ret = BadValue;
- client->errorValue = stuff->mask;
- goto PatchUp;
- }
- pVlist++;
- }
- if (pPriv->attr)
- FreeScreenAttr (pPriv->attr);
- pPriv->attr = pAttr;
- pAttr->resource = FakeClientID (client->index);
- if (!AddResource (pAttr->resource, AttrType, (pointer) pAttr))
- return BadAlloc;
- return Success;
-PatchUp:
- FreeAttrs (pAttr);
-bail:
- CheckScreenPrivate (pScreen);
- xfree (pAttr);
- xfree (values);
- return ret;
-}
-
-static int
-ScreenSaverUnsetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- ScreenSaverScreenPrivatePtr pPriv;
-
- REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
- pDraw = (DrawablePtr) LookupDrawable (stuff->drawable, client);
- if (!pDraw)
- return BadDrawable;
- pPriv = GetScreenPrivate (pDraw->pScreen);
- if (pPriv && pPriv->attr && pPriv->attr->client == client)
- {
- FreeScreenAttr (pPriv->attr);
- pPriv->attr = NULL;
- CheckScreenPrivate (pDraw->pScreen);
- }
- return Success;
-}
-
-static int
-ProcScreenSaverSetAttributes (ClientPtr client)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverSetAttributesReq);
- PanoramiXRes *draw;
- PanoramiXRes *backPix = NULL;
- PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
- int i, status = 0, len;
- int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
- XID orig_visual, tmp;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if((Mask)stuff->mask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
-
- if ((Mask)stuff->mask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- }
- }
-
- if ((Mask)stuff->mask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
- client, tmp, XRT_COLORMAP, SecurityReadAccess)))
- return BadColor;
- }
- }
-
- orig_visual = stuff->visualID;
-
- FOR_NSCREENS_BACKWARD(i) {
- stuff->drawable = draw->info[i].id;
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
-
- if (orig_visual != CopyFromParent)
- stuff->visualID =
- PanoramiXVisualTable[(orig_visual*MAXSCREENS) + i];
-
- status = ScreenSaverSetAttributes(client);
- }
-
- return status;
- }
-#endif
-
- return ScreenSaverSetAttributes(client);
-}
-
-static int
-ProcScreenSaverUnsetAttributes (ClientPtr client)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverUnsetAttributesReq);
- PanoramiXRes *draw;
- int i;
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- for(i = PanoramiXNumScreens - 1; i > 0; i--) {
- stuff->drawable = draw->info[i].id;
- ScreenSaverUnsetAttributes(client);
- }
-
- stuff->drawable = draw->info[0].id;
- }
-#endif
-
- return ScreenSaverUnsetAttributes(client);
-}
-
-static DISPATCH_PROC((*NormalVector[])) = {
- ProcScreenSaverQueryVersion,
- ProcScreenSaverQueryInfo,
- ProcScreenSaverSelectInput,
- ProcScreenSaverSetAttributes,
- ProcScreenSaverUnsetAttributes,
-};
-
-#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0]))
-
-static int
-ProcScreenSaverDispatch (client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- if (stuff->data < NUM_REQUESTS)
- return (*NormalVector[stuff->data])(client);
- return BadRequest;
-}
-
-static int
-SProcScreenSaverQueryVersion (client)
- ClientPtr client;
-{
- REQUEST(xScreenSaverQueryVersionReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
- return ProcScreenSaverQueryVersion (client);
-}
-
-static int
-SProcScreenSaverQueryInfo (client)
- ClientPtr client;
-{
- REQUEST(xScreenSaverQueryInfoReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
- swapl (&stuff->drawable, n);
- return ProcScreenSaverQueryInfo (client);
-}
-
-static int
-SProcScreenSaverSelectInput (client)
- ClientPtr client;
-{
- REQUEST(xScreenSaverSelectInputReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
- swapl (&stuff->drawable, n);
- swapl (&stuff->eventMask, n);
- return ProcScreenSaverSelectInput (client);
-}
-
-static int
-SProcScreenSaverSetAttributes (client)
- ClientPtr client;
-{
- REQUEST(xScreenSaverSetAttributesReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
- swapl (&stuff->drawable, n);
- swaps (&stuff->x, n);
- swaps (&stuff->y, n);
- swaps (&stuff->width, n);
- swaps (&stuff->height, n);
- swaps (&stuff->borderWidth, n);
- swapl (&stuff->visualID, n);
- swapl (&stuff->mask, n);
- SwapRestL(stuff);
- return ProcScreenSaverSetAttributes (client);
-}
-
-static int
-SProcScreenSaverUnsetAttributes (client)
- ClientPtr client;
-{
- REQUEST(xScreenSaverUnsetAttributesReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
- swapl (&stuff->drawable, n);
- return ProcScreenSaverUnsetAttributes (client);
-}
-
-static DISPATCH_PROC((*SwappedVector[])) = {
- SProcScreenSaverQueryVersion,
- SProcScreenSaverQueryInfo,
- SProcScreenSaverSelectInput,
- SProcScreenSaverSetAttributes,
- SProcScreenSaverUnsetAttributes,
-};
-
-static int
-SProcScreenSaverDispatch (client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- if (stuff->data < NUM_REQUESTS)
- return (*SwappedVector[stuff->data])(client);
- return BadRequest;
-}
diff --git a/Xext/security.c b/Xext/security.c
deleted file mode 100644
index 568138e36..000000000
--- a/Xext/security.c
+++ /dev/null
@@ -1,1998 +0,0 @@
-/* $Xorg: security.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.16 2003/11/17 22:20:26 dawes Exp $ */
-
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "windowstr.h"
-#include "inputstr.h"
-#include "gcstruct.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#define _SECURITY_SERVER
-#include "securstr.h"
-#include <assert.h>
-#include <stdarg.h>
-#ifdef LBX
-#define _XLBX_SERVER_
-#include "XLbx.h"
-extern unsigned char LbxReqCode;
-#endif
-#ifdef XAPPGROUP
-#include "Xagsrv.h"
-#endif
-#include <stdio.h> /* for file reading operations */
-#include "Xatom.h" /* for XA_STRING */
-
-#ifndef DEFAULTPOLICYFILE
-# define DEFAULTPOLICYFILE NULL
-#endif
-#if defined(WIN32) || defined(__CYGWIN__)
-#include <X11/Xos.h>
-#undef index
-#endif
-
-#include "modinit.h"
-
-static int SecurityErrorBase; /* first Security error number */
-static int SecurityEventBase; /* first Security event number */
-
-CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */
-
-RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
-
-static RESTYPE RTEventClient;
-
-/* Proc vectors for untrusted clients, swapped and unswapped versions.
- * These are the same as the normal proc vectors except that extensions
- * that haven't declared themselves secure will have ProcBadRequest plugged
- * in for their major opcode dispatcher. This prevents untrusted clients
- * from guessing extension major opcodes and using the extension even though
- * the extension can't be listed or queried.
- */
-int (*UntrustedProcVector[256])(
- ClientPtr /*client*/
-);
-int (*SwappedUntrustedProcVector[256])(
- ClientPtr /*client*/
-);
-
-/* SecurityAudit
- *
- * Arguments:
- * format is the formatting string to be used to interpret the
- * remaining arguments.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Writes the message to the log file if security logging is on.
- */
-
-void
-SecurityAudit(char *format, ...)
-{
- va_list args;
-
- if (auditTrailLevel < SECURITY_AUDIT_LEVEL)
- return;
- va_start(args, format);
- VAuditF(format, args);
- va_end(args);
-} /* SecurityAudit */
-
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
-/* SecurityDeleteAuthorization
- *
- * Arguments:
- * value is the authorization to delete.
- * id is its resource ID.
- *
- * Returns: Success.
- *
- * Side Effects:
- * Frees everything associated with the authorization.
- */
-
-static int
-SecurityDeleteAuthorization(
- pointer value,
- XID id)
-{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
- unsigned short name_len, data_len;
- char *name, *data;
- int status;
- int i;
- OtherClientsPtr pEventClient;
-
- /* Remove the auth using the os layer auth manager */
-
- status = AuthorizationFromID(pAuth->id, &name_len, &name,
- &data_len, &data);
- assert(status);
- status = RemoveAuthorization(name_len, name, data_len, data);
- assert(status);
- (void)status;
-
- /* free the auth timer if there is one */
-
- if (pAuth->timer) TimerFree(pAuth->timer);
-
- /* send revoke events */
-
- while ((pEventClient = pAuth->eventClients))
- {
- /* send revocation event event */
- ClientPtr client = rClient(pEventClient);
-
- if (!client->clientGone)
- {
- xSecurityAuthorizationRevokedEvent are;
- are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
- are.sequenceNumber = client->sequence;
- are.authId = pAuth->id;
- WriteEventsToClient(client, 1, (xEvent *)&are);
- }
- FreeResource(pEventClient->resource, RT_NONE);
- }
-
- /* kill all clients using this auth */
-
- for (i = 1; i<currentMaxClients; i++)
- {
- if (clients[i] && (clients[i]->authId == pAuth->id))
- CloseDownClient(clients[i]);
- }
-
- SecurityAudit("revoked authorization ID %d\n", pAuth->id);
- xfree(pAuth);
- return Success;
-
-} /* SecurityDeleteAuthorization */
-
-
-/* resource delete function for RTEventClient */
-static int
-SecurityDeleteAuthorizationEventClient(
- pointer value,
- XID id)
-{
- OtherClientsPtr pEventClient, prev = NULL;
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
-
- for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (pEventClient->resource == id)
- {
- if (prev)
- prev->next = pEventClient->next;
- else
- pAuth->eventClients = pEventClient->next;
- xfree(pEventClient);
- return(Success);
- }
- prev = pEventClient;
- }
- /*NOTREACHED*/
- return -1; /* make compiler happy */
-} /* SecurityDeleteAuthorizationEventClient */
-
-
-/* SecurityComputeAuthorizationTimeout
- *
- * Arguments:
- * pAuth is the authorization for which we are computing the timeout
- * seconds is the number of seconds we want to wait
- *
- * Returns:
- * the number of milliseconds that the auth timer should be set to
- *
- * Side Effects:
- * Sets pAuth->secondsRemaining to any "overflow" amount of time
- * that didn't fit in 32 bits worth of milliseconds
- */
-
-static CARD32
-SecurityComputeAuthorizationTimeout(
- SecurityAuthorizationPtr pAuth,
- unsigned int seconds)
-{
- /* maxSecs is the number of full seconds that can be expressed in
- * 32 bits worth of milliseconds
- */
- CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
-
- if (seconds > maxSecs)
- { /* only come here if we want to wait more than 49 days */
- pAuth->secondsRemaining = seconds - maxSecs;
- return maxSecs * MILLI_PER_SECOND;
- }
- else
- { /* by far the common case */
- pAuth->secondsRemaining = 0;
- return seconds * MILLI_PER_SECOND;
- }
-} /* SecurityStartAuthorizationTimer */
-
-/* SecurityAuthorizationExpired
- *
- * This function is passed as an argument to TimerSet and gets called from
- * the timer manager in the os layer when its time is up.
- *
- * Arguments:
- * timer is the timer for this authorization.
- * time is the current time.
- * pval is the authorization whose time is up.
- *
- * Returns:
- * A new time delay in milliseconds if the timer should wait some
- * more, else zero.
- *
- * Side Effects:
- * Frees the authorization resource if the timeout period is really
- * over, otherwise recomputes pAuth->secondsRemaining.
- */
-
-static CARD32
-SecurityAuthorizationExpired(
- OsTimerPtr timer,
- CARD32 time,
- pointer pval)
-{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
-
- assert(pAuth->timer == timer);
-
- if (pAuth->secondsRemaining)
- {
- return SecurityComputeAuthorizationTimeout(pAuth,
- pAuth->secondsRemaining);
- }
- else
- {
- FreeResource(pAuth->id, RT_NONE);
- return 0;
- }
-} /* SecurityAuthorizationExpired */
-
-/* SecurityStartAuthorizationTimer
- *
- * Arguments:
- * pAuth is the authorization whose timer should be started.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * A timer is started, set to expire after the timeout period for
- * this authorization. When it expires, the function
- * SecurityAuthorizationExpired will be called.
- */
-
-static void
-SecurityStartAuthorizationTimer(
- SecurityAuthorizationPtr pAuth)
-{
- pAuth->timer = TimerSet(pAuth->timer, 0,
- SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout),
- SecurityAuthorizationExpired, pAuth);
-} /* SecurityStartAuthorizationTimer */
-
-
-/* Proc functions all take a client argument, execute the request in
- * client->requestBuffer, and return a protocol error status.
- */
-
-static int
-ProcSecurityQueryVersion(
- ClientPtr client)
-{
- /* REQUEST(xSecurityQueryVersionReq); */
- xSecurityQueryVersionReply rep;
-
- /* paranoia: this "can't happen" because this extension is hidden
- * from untrusted clients, but just in case...
- */
- if (client->trustLevel != XSecurityClientTrusted)
- return BadRequest;
-
- REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SECURITY_MAJOR_VERSION;
- rep.minorVersion = SECURITY_MINOR_VERSION;
- if(client->swapped)
- {
- register char n;
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
- (char *)&rep);
- return (client->noClientException);
-} /* ProcSecurityQueryVersion */
-
-
-static int
-SecurityEventSelectForAuthorization(
- SecurityAuthorizationPtr pAuth,
- ClientPtr client,
- Mask mask)
-{
- OtherClients *pEventClient;
-
- for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (SameClient(pEventClient, client))
- {
- if (mask == 0)
- FreeResource(pEventClient->resource, RT_NONE);
- else
- pEventClient->mask = mask;
- return Success;
- }
- }
-
- pEventClient = (OtherClients *) xalloc(sizeof(OtherClients));
- if (!pEventClient)
- return BadAlloc;
- pEventClient->mask = mask;
- pEventClient->resource = FakeClientID(client->index);
- pEventClient->next = pAuth->eventClients;
- if (!AddResource(pEventClient->resource, RTEventClient,
- (pointer)pAuth))
- {
- xfree(pEventClient);
- return BadAlloc;
- }
- pAuth->eventClients = pEventClient;
-
- return Success;
-} /* SecurityEventSelectForAuthorization */
-
-
-static int
-ProcSecurityGenerateAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityGenerateAuthorizationReq);
- int len; /* request length in CARD32s*/
- Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
- SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
- int err; /* error to return from this function */
- XID authId; /* authorization ID assigned by os layer */
- xSecurityGenerateAuthorizationReply rep; /* reply struct */
- unsigned int trustLevel; /* trust level of new auth */
- XID group; /* group of new auth */
- CARD32 timeout; /* timeout of new auth */
- CARD32 *values; /* list of supplied attributes */
- char *protoname; /* auth proto name sent in request */
- char *protodata; /* auth proto data sent in request */
- unsigned int authdata_len; /* # bytes of generated auth data */
- char *pAuthdata; /* generated auth data */
- Mask eventMask; /* what events on this auth does client want */
-
- /* paranoia: this "can't happen" because this extension is hidden
- * from untrusted clients, but just in case...
- */
- if (client->trustLevel != XSecurityClientTrusted)
- return BadRequest;
-
- /* check request length */
-
- REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
- len = SIZEOF(xSecurityGenerateAuthorizationReq) >> 2;
- len += (stuff->nbytesAuthProto + (unsigned)3) >> 2;
- len += (stuff->nbytesAuthData + (unsigned)3) >> 2;
- values = ((CARD32 *)stuff) + len;
- len += Ones(stuff->valueMask);
- if (client->req_len != len)
- return BadLength;
-
- /* check valuemask */
- if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes)
- {
- client->errorValue = stuff->valueMask;
- return BadValue;
- }
-
- /* check timeout */
- timeout = 60;
- if (stuff->valueMask & XSecurityTimeout)
- {
- timeout = *values++;
- }
-
- /* check trustLevel */
- trustLevel = XSecurityClientUntrusted;
- if (stuff->valueMask & XSecurityTrustLevel)
- {
- trustLevel = *values++;
- if (trustLevel != XSecurityClientTrusted &&
- trustLevel != XSecurityClientUntrusted)
- {
- client->errorValue = trustLevel;
- return BadValue;
- }
- }
-
- /* check group */
- group = None;
- if (stuff->valueMask & XSecurityGroup)
- {
- group = *values++;
- if (SecurityValidateGroupCallback)
- {
- SecurityValidateGroupInfoRec vgi;
- vgi.group = group;
- vgi.valid = FALSE;
- CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi);
-
- /* if nobody said they recognized it, it's an error */
-
- if (!vgi.valid)
- {
- client->errorValue = group;
- return BadValue;
- }
- }
- }
-
- /* check event mask */
- eventMask = 0;
- if (stuff->valueMask & XSecurityEventMask)
- {
- eventMask = *values++;
- if (eventMask & ~XSecurityAllEventMasks)
- {
- client->errorValue = eventMask;
- return BadValue;
- }
- }
-
- protoname = (char *)&stuff[1];
- protodata = protoname + ((stuff->nbytesAuthProto + (unsigned)3) >> 2);
-
- /* call os layer to generate the authorization */
-
- authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
- stuff->nbytesAuthData, protodata,
- &authdata_len, &pAuthdata);
- if ((XID) ~0L == authId)
- {
- err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
- goto bailout;
- }
-
- /* now that we've added the auth, remember to remove it if we have to
- * abort the request for some reason (like allocation failure)
- */
- removeAuth = TRUE;
-
- /* associate additional information with this auth ID */
-
- pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec));
- if (!pAuth)
- {
- err = BadAlloc;
- goto bailout;
- }
-
- /* fill in the auth fields */
-
- pAuth->id = authId;
- pAuth->timeout = timeout;
- pAuth->group = group;
- pAuth->trustLevel = trustLevel;
- pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */
- pAuth->secondsRemaining = 0;
- pAuth->timer = NULL;
- pAuth->eventClients = NULL;
-
- /* handle event selection */
- if (eventMask)
- {
- err = SecurityEventSelectForAuthorization(pAuth, client, eventMask);
- if (err != Success)
- goto bailout;
- }
-
- if (!AddResource(authId, SecurityAuthorizationResType, pAuth))
- {
- err = BadAlloc;
- goto bailout;
- }
-
- /* start the timer ticking */
-
- if (pAuth->timeout != 0)
- SecurityStartAuthorizationTimer(pAuth);
-
- /* tell client the auth id and data */
-
- rep.type = X_Reply;
- rep.length = (authdata_len + 3) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.authId = authId;
- rep.dataLength = authdata_len;
-
- if (client->swapped)
- {
- register char n;
- swapl(&rep.length, n);
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.authId, n);
- swaps(&rep.dataLength, n);
- }
-
- WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
- (char *)&rep);
- WriteToClient(client, authdata_len, pAuthdata);
-
- SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
- client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
- pAuth->group, eventMask);
-
- /* the request succeeded; don't call RemoveAuthorization or free pAuth */
-
- removeAuth = FALSE;
- pAuth = NULL;
- err = client->noClientException;
-
-bailout:
- if (removeAuth)
- RemoveAuthorization(stuff->nbytesAuthProto, protoname,
- authdata_len, pAuthdata);
- if (pAuth) xfree(pAuth);
- return err;
-
-} /* ProcSecurityGenerateAuthorization */
-
-static int
-ProcSecurityRevokeAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityRevokeAuthorizationReq);
- SecurityAuthorizationPtr pAuth;
-
- /* paranoia: this "can't happen" because this extension is hidden
- * from untrusted clients, but just in case...
- */
- if (client->trustLevel != XSecurityClientTrusted)
- return BadRequest;
-
- REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
-
- pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client,
- stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess);
- if (!pAuth)
- return SecurityErrorBase + XSecurityBadAuthorization;
-
- FreeResource(stuff->authId, RT_NONE);
- return Success;
-} /* ProcSecurityRevokeAuthorization */
-
-
-static int
-ProcSecurityDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return ProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return ProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return ProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
- }
-} /* ProcSecurityDispatch */
-
-static int
-SProcSecurityQueryVersion(
- ClientPtr client)
-{
- REQUEST(xSecurityQueryVersionReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion,n);
- return ProcSecurityQueryVersion(client);
-} /* SProcSecurityQueryVersion */
-
-
-static int
-SProcSecurityGenerateAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityGenerateAuthorizationReq);
- register char n;
- CARD32 *values;
- unsigned long nvalues;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
- swaps(&stuff->nbytesAuthProto, n);
- swaps(&stuff->nbytesAuthData, n);
- swapl(&stuff->valueMask, n);
- values = (CARD32 *)(&stuff[1]) +
- ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
- ((stuff->nbytesAuthData + (unsigned)3) >> 2);
- nvalues = (((CARD32 *)stuff) + stuff->length) - values;
- SwapLongs(values, nvalues);
- return ProcSecurityGenerateAuthorization(client);
-} /* SProcSecurityGenerateAuthorization */
-
-
-static int
-SProcSecurityRevokeAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityRevokeAuthorizationReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
- swapl(&stuff->authId, n);
- return ProcSecurityRevokeAuthorization(client);
-} /* SProcSecurityRevokeAuthorization */
-
-
-static int
-SProcSecurityDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return SProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return SProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return SProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
- }
-} /* SProcSecurityDispatch */
-
-static void
-SwapSecurityAuthorizationRevokedEvent(
- xSecurityAuthorizationRevokedEvent *from,
- xSecurityAuthorizationRevokedEvent *to)
-{
- to->type = from->type;
- to->detail = from->detail;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->authId, to->authId);
-}
-
-/* SecurityDetermineEventPropogationLimits
- *
- * This is a helper function for SecurityCheckDeviceAccess.
- *
- * Arguments:
- * dev is the device for which the starting and stopping windows for
- * event propogation should be determined.
- * The values pointed to by ppWin and ppStopWin are not used.
- *
- * Returns:
- * ppWin is filled in with a pointer to the window at which event
- * propogation for the given device should start given the current
- * state of the server (pointer position, window layout, etc.)
- * ppStopWin is filled in with the window at which event propogation
- * should stop; events should not go to ppStopWin.
- *
- * Side Effects: none.
- */
-
-static void
-SecurityDetermineEventPropogationLimits(
- DeviceIntPtr dev,
- WindowPtr *ppWin,
- WindowPtr *ppStopWin)
-{
- WindowPtr pFocusWin = dev->focus ? dev->focus->win : NoneWin;
-
- if (pFocusWin == NoneWin)
- { /* no focus -- events don't go anywhere */
- *ppWin = *ppStopWin = NULL;
- return;
- }
-
- if (pFocusWin == PointerRootWin)
- { /* focus follows the pointer */
- *ppWin = GetSpriteWindow();
- *ppStopWin = NULL; /* propogate all the way to the root */
- }
- else
- { /* a real window is set for the focus */
- WindowPtr pSpriteWin = GetSpriteWindow();
- *ppStopWin = pFocusWin->parent; /* don't go past the focus window */
-
- /* if the pointer is in a subwindow of the focus window, start
- * at that subwindow, else start at the focus window itself
- */
- if (IsParent(pFocusWin, pSpriteWin))
- *ppWin = pSpriteWin;
- else *ppWin = pFocusWin;
- }
-} /* SecurityDetermineEventPropogationLimits */
-
-
-/* SecurityCheckDeviceAccess
- *
- * Arguments:
- * client is the client attempting to access a device.
- * dev is the device being accessed.
- * fromRequest is TRUE if the device access is a direct result of
- * the client executing some request and FALSE if it is a
- * result of the server trying to send an event (e.g. KeymapNotify)
- * to the client.
- * Returns:
- * TRUE if the device access should be allowed, else FALSE.
- *
- * Side Effects:
- * An audit message is generated if access is denied.
- */
-
-Bool
-SecurityCheckDeviceAccess(client, dev, fromRequest)
- ClientPtr client;
- DeviceIntPtr dev;
- Bool fromRequest;
-{
- WindowPtr pWin, pStopWin;
- Bool untrusted_got_event;
- Bool found_event_window;
- Mask eventmask;
- int reqtype = 0;
-
- /* trusted clients always allowed to do anything */
- if (client->trustLevel == XSecurityClientTrusted)
- return TRUE;
-
- /* device security other than keyboard is not implemented yet */
- if (dev != inputInfo.keyboard)
- return TRUE;
-
- /* some untrusted client wants access */
-
- if (fromRequest)
- {
- reqtype = ((xReq *)client->requestBuffer)->reqType;
- switch (reqtype)
- {
- /* never allow these */
- case X_ChangeKeyboardMapping:
- case X_ChangeKeyboardControl:
- case X_SetModifierMapping:
- SecurityAudit("client %d attempted request %d\n",
- client->index, reqtype);
- return FALSE;
- default:
- break;
- }
- }
-
- untrusted_got_event = FALSE;
- found_event_window = FALSE;
-
- if (dev->grab)
- {
- untrusted_got_event =
- ((rClient(dev->grab))->trustLevel != XSecurityClientTrusted);
- }
- else
- {
- SecurityDetermineEventPropogationLimits(dev, &pWin, &pStopWin);
-
- eventmask = KeyPressMask | KeyReleaseMask;
- while ( (pWin != pStopWin) && !found_event_window)
- {
- OtherClients *other;
-
- if (pWin->eventMask & eventmask)
- {
- found_event_window = TRUE;
- client = wClient(pWin);
- if (client->trustLevel != XSecurityClientTrusted)
- {
- untrusted_got_event = TRUE;
- }
- }
- if (wOtherEventMasks(pWin) & eventmask)
- {
- found_event_window = TRUE;
- for (other = wOtherClients(pWin); other; other = other->next)
- {
- if (other->mask & eventmask)
- {
- client = rClient(other);
- if (client->trustLevel != XSecurityClientTrusted)
- {
- untrusted_got_event = TRUE;
- break;
- }
- }
- }
- }
- if (wDontPropagateMask(pWin) & eventmask)
- break;
- pWin = pWin->parent;
- } /* while propogating the event */
- }
-
- /* allow access by untrusted clients only if an event would have gone
- * to an untrusted client
- */
-
- if (!untrusted_got_event)
- {
- char *devname = dev->name;
- if (!devname) devname = "unnamed";
- if (fromRequest)
- SecurityAudit("client %d attempted request %d device %d (%s)\n",
- client->index, reqtype, dev->id, devname);
- else
- SecurityAudit("client %d attempted to access device %d (%s)\n",
- client->index, dev->id, devname);
- }
- return untrusted_got_event;
-} /* SecurityCheckDeviceAccess */
-
-
-
-/* SecurityAuditResourceIDAccess
- *
- * Arguments:
- * client is the client doing the resource access.
- * id is the resource id.
- *
- * Returns: NULL
- *
- * Side Effects:
- * An audit message is generated with details of the denied
- * resource access.
- */
-
-static pointer
-SecurityAuditResourceIDAccess(
- ClientPtr client,
- XID id)
-{
- int cid = CLIENT_ID(id);
- int reqtype = ((xReq *)client->requestBuffer)->reqType;
- switch (reqtype)
- {
- case X_ChangeProperty:
- case X_DeleteProperty:
- case X_GetProperty:
- {
- xChangePropertyReq *req =
- (xChangePropertyReq *)client->requestBuffer;
- int propertyatom = req->property;
- char *propertyname = NameForAtom(propertyatom);
-
- SecurityAudit("client %d attempted request %d with window 0x%x property %s of client %d\n",
- client->index, reqtype, id, propertyname, cid);
- break;
- }
- default:
- {
- SecurityAudit("client %d attempted request %d with resource 0x%x of client %d\n",
- client->index, reqtype, id, cid);
- break;
- }
- }
- return NULL;
-} /* SecurityAuditResourceIDAccess */
-
-
-/* SecurityCheckResourceIDAccess
- *
- * This function gets plugged into client->CheckAccess and is called from
- * SecurityLookupIDByType/Class to determine if the client can access the
- * resource.
- *
- * Arguments:
- * client is the client doing the resource access.
- * id is the resource id.
- * rtype is its type or class.
- * access_mode represents the intended use of the resource; see
- * resource.h.
- * rval is a pointer to the resource structure for this resource.
- *
- * Returns:
- * If access is granted, the value of rval that was passed in, else NULL.
- *
- * Side Effects:
- * Disallowed resource accesses are audited.
- */
-
-static pointer
-SecurityCheckResourceIDAccess(
- ClientPtr client,
- XID id,
- RESTYPE rtype,
- Mask access_mode,
- pointer rval)
-{
- int cid = CLIENT_ID(id);
- int reqtype = ((xReq *)client->requestBuffer)->reqType;
-
- if (SecurityUnknownAccess == access_mode)
- return rval; /* for compatibility, we have to allow access */
-
- switch (reqtype)
- { /* these are always allowed */
- case X_QueryTree:
- case X_TranslateCoords:
- case X_GetGeometry:
- /* property access is controlled in SecurityCheckPropertyAccess */
- case X_GetProperty:
- case X_ChangeProperty:
- case X_DeleteProperty:
- case X_RotateProperties:
- case X_ListProperties:
- return rval;
- default:
- break;
- }
-
- if (cid != 0)
- { /* not a server-owned resource */
- /*
- * The following 'if' restricts clients to only access resources at
- * the same trustLevel. Since there are currently only two trust levels,
- * and trusted clients never call this function, this degenerates into
- * saying that untrusted clients can only access resources of other
- * untrusted clients. One way to add the notion of groups would be to
- * allow values other than Trusted (0) and Untrusted (1) for this field.
- * Clients at the same trust level would be able to use each other's
- * resources, but not those of clients at other trust levels. I haven't
- * tried it, but this probably mostly works already. The obvious
- * competing alternative for grouping clients for security purposes is to
- * use app groups. dpw
- */
- if (client->trustLevel == clients[cid]->trustLevel
-#ifdef XAPPGROUP
- || (RT_COLORMAP == rtype &&
- XagDefaultColormap (client) == (Colormap) id)
-#endif
- )
- return rval;
- else
- return SecurityAuditResourceIDAccess(client, id);
- }
- else /* server-owned resource - probably a default colormap or root window */
- {
- if (RT_WINDOW == rtype || RC_DRAWABLE == rtype)
- {
- switch (reqtype)
- { /* the following operations are allowed on root windows */
- case X_CreatePixmap:
- case X_CreateGC:
- case X_CreateWindow:
- case X_CreateColormap:
- case X_ListProperties:
- case X_GrabPointer:
- case X_UngrabButton:
- case X_QueryBestSize:
- case X_GetWindowAttributes:
- break;
- case X_SendEvent:
- { /* see if it is an event specified by the ICCCM */
- xSendEventReq *req = (xSendEventReq *)
- (client->requestBuffer);
- if (req->propagate == xTrue
- ||
- (req->eventMask != ColormapChangeMask &&
- req->eventMask != StructureNotifyMask &&
- req->eventMask !=
- (SubstructureRedirectMask|SubstructureNotifyMask)
- )
- ||
- (req->event.u.u.type != UnmapNotify &&
- req->event.u.u.type != ConfigureRequest &&
- req->event.u.u.type != ClientMessage
- )
- )
- { /* not an ICCCM event */
- return SecurityAuditResourceIDAccess(client, id);
- }
- break;
- } /* case X_SendEvent on root */
-
- case X_ChangeWindowAttributes:
- { /* Allow selection of PropertyNotify and StructureNotify
- * events on the root.
- */
- xChangeWindowAttributesReq *req =
- (xChangeWindowAttributesReq *)(client->requestBuffer);
- if (req->valueMask == CWEventMask)
- {
- CARD32 value = *((CARD32 *)(req + 1));
- if ( (value &
- ~(PropertyChangeMask|StructureNotifyMask)) == 0)
- break;
- }
- return SecurityAuditResourceIDAccess(client, id);
- } /* case X_ChangeWindowAttributes on root */
-
- default:
- {
-#ifdef LBX
- /* XXX really need per extension dispatching */
- if (reqtype == LbxReqCode) {
- switch (((xReq *)client->requestBuffer)->data) {
- case X_LbxGetProperty:
- case X_LbxChangeProperty:
- return rval;
- default:
- break;
- }
- }
-#endif
- /* others not allowed */
- return SecurityAuditResourceIDAccess(client, id);
- }
- }
- } /* end server-owned window or drawable */
- else if (SecurityAuthorizationResType == rtype)
- {
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)rval;
- if (pAuth->trustLevel != client->trustLevel)
- return SecurityAuditResourceIDAccess(client, id);
- }
- else if (RT_COLORMAP != rtype)
- { /* don't allow anything else besides colormaps */
- return SecurityAuditResourceIDAccess(client, id);
- }
- }
- return rval;
-} /* SecurityCheckResourceIDAccess */
-
-
-/* SecurityClientStateCallback
- *
- * Arguments:
- * pcbl is &ClientStateCallback.
- * nullata is NULL.
- * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h)
- * which contains information about client state changes.
- *
- * Returns: nothing.
- *
- * Side Effects:
- *
- * If a new client is connecting, its authorization ID is copied to
- * client->authID. If this is a generated authorization, its reference
- * count is bumped, its timer is cancelled if it was running, and its
- * trustlevel is copied to client->trustLevel.
- *
- * If a client is disconnecting and the client was using a generated
- * authorization, the authorization's reference count is decremented, and
- * if it is now zero, the timer for this authorization is started.
- */
-
-static void
-SecurityClientStateCallback(
- CallbackListPtr *pcbl,
- pointer nulldata,
- pointer calldata)
-{
- NewClientInfoRec *pci = (NewClientInfoRec *)calldata;
- ClientPtr client = pci->client;
-
- switch (client->clientState)
- {
- case ClientStateRunning:
- {
- XID authId = AuthorizationIDOfClient(client);
- SecurityAuthorizationPtr pAuth;
-
- client->authId = authId;
- pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId,
- SecurityAuthorizationResType);
- if (pAuth)
- { /* it is a generated authorization */
- pAuth->refcnt++;
- if (pAuth->refcnt == 1)
- {
- if (pAuth->timer) TimerCancel(pAuth->timer);
- }
- client->trustLevel = pAuth->trustLevel;
- if (client->trustLevel != XSecurityClientTrusted)
- {
- client->CheckAccess = SecurityCheckResourceIDAccess;
- client->requestVector = client->swapped ?
- SwappedUntrustedProcVector : UntrustedProcVector;
- }
- }
- break;
- }
- case ClientStateGone:
- case ClientStateRetained: /* client disconnected */
- {
- XID authId = client->authId;
- SecurityAuthorizationPtr pAuth;
-
- pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId,
- SecurityAuthorizationResType);
- if (pAuth)
- { /* it is a generated authorization */
- pAuth->refcnt--;
- if (pAuth->refcnt == 0)
- {
- SecurityStartAuthorizationTimer(pAuth);
- }
- }
- break;
- }
- default: break;
- }
-} /* SecurityClientStateCallback */
-
-#ifdef LBX
-Bool
-SecuritySameLevel(client, authId)
- ClientPtr client;
- XID authId;
-{
- SecurityAuthorizationPtr pAuth;
-
- pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId,
- SecurityAuthorizationResType);
- if (pAuth)
- return client->trustLevel == pAuth->trustLevel;
- return client->trustLevel == XSecurityClientTrusted;
-}
-#endif
-
-/* SecurityCensorImage
- *
- * Called after pScreen->GetImage to prevent pieces or trusted windows from
- * being returned in image data from an untrusted window.
- *
- * Arguments:
- * client is the client doing the GetImage.
- * pVisibleRegion is the visible region of the window.
- * widthBytesLine is the width in bytes of one horizontal line in pBuf.
- * pDraw is the source window.
- * x, y, w, h is the rectangle of image data from pDraw in pBuf.
- * format is the format of the image data in pBuf: ZPixmap or XYPixmap.
- * pBuf is the image data.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Any part of the rectangle (x, y, w, h) that is outside the visible
- * region of the window will be destroyed (overwritten) in pBuf.
- */
-void
-SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
- format, pBuf)
- ClientPtr client;
- RegionPtr pVisibleRegion;
- long widthBytesLine;
- DrawablePtr pDraw;
- int x, y, w, h;
- unsigned int format;
- char * pBuf;
-{
- ScreenPtr pScreen = pDraw->pScreen;
- RegionRec imageRegion; /* region representing x,y,w,h */
- RegionRec censorRegion; /* region to obliterate */
- BoxRec imageBox;
- int nRects;
-
- imageBox.x1 = x;
- imageBox.y1 = y;
- imageBox.x2 = x + w;
- imageBox.y2 = y + h;
- REGION_INIT(pScreen, &imageRegion, &imageBox, 1);
- REGION_NULL(pScreen, &censorRegion);
-
- /* censorRegion = imageRegion - visibleRegion */
- REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion);
- nRects = REGION_NUM_RECTS(&censorRegion);
- if (nRects > 0)
- { /* we have something to censor */
- GCPtr pScratchGC = NULL;
- PixmapPtr pPix = NULL;
- xRectangle *pRects = NULL;
- Bool failed = FALSE;
- int depth = 1;
- int bitsPerPixel = 1;
- int i;
- BoxPtr pBox;
-
- /* convert region to list-of-rectangles for PolyFillRect */
-
- pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *));
- if (!pRects)
- {
- failed = TRUE;
- goto failSafe;
- }
- for (pBox = REGION_RECTS(&censorRegion), i = 0;
- i < nRects;
- i++, pBox++)
- {
- pRects[i].x = pBox->x1;
- pRects[i].y = pBox->y1 - imageBox.y1;
- pRects[i].width = pBox->x2 - pBox->x1;
- pRects[i].height = pBox->y2 - pBox->y1;
- }
-
- /* use pBuf as a fake pixmap */
-
- if (format == ZPixmap)
- {
- depth = pDraw->depth;
- bitsPerPixel = pDraw->bitsPerPixel;
- }
-
- pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h,
- depth, bitsPerPixel,
- widthBytesLine, (pointer)pBuf);
- if (!pPix)
- {
- failed = TRUE;
- goto failSafe;
- }
-
- pScratchGC = GetScratchGC(depth, pPix->drawable.pScreen);
- if (!pScratchGC)
- {
- failed = TRUE;
- goto failSafe;
- }
-
- ValidateGC(&pPix->drawable, pScratchGC);
- (* pScratchGC->ops->PolyFillRect)(&pPix->drawable,
- pScratchGC, nRects, pRects);
-
- failSafe:
- if (failed)
- {
- /* Censoring was not completed above. To be safe, wipe out
- * all the image data so that nothing trusted gets out.
- */
- bzero(pBuf, (int)(widthBytesLine * h));
- }
- if (pRects) DEALLOCATE_LOCAL(pRects);
- if (pScratchGC) FreeScratchGC(pScratchGC);
- if (pPix) FreeScratchPixmapHeader(pPix);
- }
- REGION_UNINIT(pScreen, &imageRegion);
- REGION_UNINIT(pScreen, &censorRegion);
-} /* SecurityCensorImage */
-
-/**********************************************************************/
-
-typedef struct _PropertyAccessRec {
- ATOM name;
- ATOM mustHaveProperty;
- char *mustHaveValue;
- char windowRestriction;
-#define SecurityAnyWindow 0
-#define SecurityRootWindow 1
-#define SecurityWindowWithProperty 2
- char readAction;
- char writeAction;
- char destroyAction;
- struct _PropertyAccessRec *next;
-} PropertyAccessRec, *PropertyAccessPtr;
-
-static PropertyAccessPtr PropertyAccessList = NULL;
-static char SecurityDefaultAction = SecurityErrorOperation;
-static char *SecurityPolicyFile = DEFAULTPOLICYFILE;
-static ATOM SecurityMaxPropertyName = 0;
-
-static char *SecurityKeywords[] = {
-#define SecurityKeywordComment 0
- "#",
-#define SecurityKeywordProperty 1
- "property",
-#define SecurityKeywordSitePolicy 2
- "sitepolicy",
-#define SecurityKeywordRoot 3
- "root",
-#define SecurityKeywordAny 4
- "any"
-};
-
-#define NUMKEYWORDS (sizeof(SecurityKeywords) / sizeof(char *))
-
-#undef PROPDEBUG
-/*#define PROPDEBUG 1*/
-
-static void
-SecurityFreePropertyAccessList(void)
-{
- while (PropertyAccessList)
- {
- PropertyAccessPtr freeit = PropertyAccessList;
- PropertyAccessList = PropertyAccessList->next;
- xfree(freeit);
- }
-} /* SecurityFreePropertyAccessList */
-
-#ifndef __UNIXOS2__
-#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') )
-#else
-#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') )
-#endif
-
-static char *
-SecuritySkipWhitespace(
- char *p)
-{
- while (SecurityIsWhitespace(*p))
- p++;
- return p;
-} /* SecuritySkipWhitespace */
-
-
-static char *
-SecurityParseString(
- char **rest)
-{
- char *startOfString;
- char *s = *rest;
- char endChar = 0;
-
- s = SecuritySkipWhitespace(s);
-
- if (*s == '"' || *s == '\'')
- {
- endChar = *s++;
- startOfString = s;
- while (*s && (*s != endChar))
- s++;
- }
- else
- {
- startOfString = s;
- while (*s && !SecurityIsWhitespace(*s))
- s++;
- }
- if (*s)
- {
- *s = '\0';
- *rest = s + 1;
- return startOfString;
- }
- else
- {
- *rest = s;
- return (endChar) ? NULL : startOfString;
- }
-} /* SecurityParseString */
-
-
-static int
-SecurityParseKeyword(
- char **p)
-{
- int i;
- char *s = *p;
- s = SecuritySkipWhitespace(s);
- for (i = 0; i < NUMKEYWORDS; i++)
- {
- int len = strlen(SecurityKeywords[i]);
- if (strncmp(s, SecurityKeywords[i], len) == 0)
- {
- *p = s + len;
- return (i);
- }
- }
- *p = s;
- return -1;
-} /* SecurityParseKeyword */
-
-
-static Bool
-SecurityParsePropertyAccessRule(
- char *p)
-{
- char *propname;
- char c;
- char action = SecurityDefaultAction;
- char readAction, writeAction, destroyAction;
- PropertyAccessPtr pacl, prev, cur;
- char *mustHaveProperty = NULL;
- char *mustHaveValue = NULL;
- Bool invalid;
- char windowRestriction;
- int size;
- int keyword;
-
- /* get property name */
- propname = SecurityParseString(&p);
- if (!propname || (strlen(propname) == 0))
- return FALSE;
-
- /* get window on which property must reside for rule to apply */
-
- keyword = SecurityParseKeyword(&p);
- if (keyword == SecurityKeywordRoot)
- windowRestriction = SecurityRootWindow;
- else if (keyword == SecurityKeywordAny)
- windowRestriction = SecurityAnyWindow;
- else /* not root or any, must be a property name */
- {
- mustHaveProperty = SecurityParseString(&p);
- if (!mustHaveProperty || (strlen(mustHaveProperty) == 0))
- return FALSE;
- windowRestriction = SecurityWindowWithProperty;
- p = SecuritySkipWhitespace(p);
- if (*p == '=')
- { /* property value is specified too */
- p++; /* skip over '=' */
- mustHaveValue = SecurityParseString(&p);
- if (!mustHaveValue)
- return FALSE;
- }
- }
-
- /* get operations and actions */
-
- invalid = FALSE;
- readAction = writeAction = destroyAction = SecurityDefaultAction;
- while ( (c = *p++) && !invalid)
- {
- switch (c)
- {
- case 'i': action = SecurityIgnoreOperation; break;
- case 'a': action = SecurityAllowOperation; break;
- case 'e': action = SecurityErrorOperation; break;
-
- case 'r': readAction = action; break;
- case 'w': writeAction = action; break;
- case 'd': destroyAction = action; break;
-
- default :
- if (!SecurityIsWhitespace(c))
- invalid = TRUE;
- break;
- }
- }
- if (invalid)
- return FALSE;
-
- /* We've successfully collected all the information needed for this
- * property access rule. Now record it in a PropertyAccessRec.
- */
- size = sizeof(PropertyAccessRec);
-
- /* If there is a property value string, allocate space for it
- * right after the PropertyAccessRec.
- */
- if (mustHaveValue)
- size += strlen(mustHaveValue) + 1;
- pacl = (PropertyAccessPtr)Xalloc(size);
- if (!pacl)
- return FALSE;
-
- pacl->name = MakeAtom(propname, strlen(propname), TRUE);
- if (pacl->name == BAD_RESOURCE)
- {
- Xfree(pacl);
- return FALSE;
- }
- if (mustHaveProperty)
- {
- pacl->mustHaveProperty = MakeAtom(mustHaveProperty,
- strlen(mustHaveProperty), TRUE);
- if (pacl->mustHaveProperty == BAD_RESOURCE)
- {
- Xfree(pacl);
- return FALSE;
- }
- }
- else
- pacl->mustHaveProperty = 0;
-
- if (mustHaveValue)
- {
- pacl->mustHaveValue = (char *)(pacl + 1);
- strcpy(pacl->mustHaveValue, mustHaveValue);
- }
- else
- pacl->mustHaveValue = NULL;
-
- SecurityMaxPropertyName = max(SecurityMaxPropertyName, pacl->name);
-
- pacl->windowRestriction = windowRestriction;
- pacl->readAction = readAction;
- pacl->writeAction = writeAction;
- pacl->destroyAction = destroyAction;
-
- /* link the new rule into the list of rules in order of increasing
- * property name (atom) value to make searching easier
- */
-
- for (prev = NULL, cur = PropertyAccessList;
- cur && cur->name <= pacl->name;
- prev = cur, cur = cur->next)
- ;
- if (!prev)
- {
- pacl->next = cur;
- PropertyAccessList = pacl;
- }
- else
- {
- prev->next = pacl;
- pacl->next = cur;
- }
- return TRUE;
-} /* SecurityParsePropertyAccessRule */
-
-static char **SecurityPolicyStrings = NULL;
-static int nSecurityPolicyStrings = 0;
-
-static Bool
-SecurityParseSitePolicy(
- char *p)
-{
- char *policyStr = SecurityParseString(&p);
- char *copyPolicyStr;
- char **newStrings;
-
- if (!policyStr)
- return FALSE;
-
- copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1);
- if (!copyPolicyStr)
- return TRUE;
- strcpy(copyPolicyStr, policyStr);
- newStrings = (char **)Xrealloc(SecurityPolicyStrings,
- sizeof (char *) * (nSecurityPolicyStrings + 1));
- if (!newStrings)
- {
- Xfree(copyPolicyStr);
- return TRUE;
- }
-
- SecurityPolicyStrings = newStrings;
- SecurityPolicyStrings[nSecurityPolicyStrings++] = copyPolicyStr;
-
- return TRUE;
-
-} /* SecurityParseSitePolicy */
-
-
-char **
-SecurityGetSitePolicyStrings(n)
- int *n;
-{
- *n = nSecurityPolicyStrings;
- return SecurityPolicyStrings;
-} /* SecurityGetSitePolicyStrings */
-
-static void
-SecurityFreeSitePolicyStrings(void)
-{
- if (SecurityPolicyStrings)
- {
- assert(nSecurityPolicyStrings);
- while (nSecurityPolicyStrings--)
- {
- Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]);
- }
- Xfree(SecurityPolicyStrings);
- SecurityPolicyStrings = NULL;
- nSecurityPolicyStrings = 0;
- }
-} /* SecurityFreeSitePolicyStrings */
-
-
-static void
-SecurityLoadPropertyAccessList(void)
-{
- FILE *f;
- int lineNumber = 0;
-
- SecurityMaxPropertyName = 0;
-
- if (!SecurityPolicyFile)
- return;
-
-#ifndef __UNIXOS2__
- f = fopen(SecurityPolicyFile, "r");
-#else
- f = fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r");
-#endif
- if (!f)
- {
- ErrorF("error opening security policy file %s\n",
- SecurityPolicyFile);
- return;
- }
-
- while (!feof(f))
- {
- char buf[200];
- Bool validLine;
- char *p;
-
- if (!(p = fgets(buf, sizeof(buf), f)))
- break;
- lineNumber++;
-
- /* if first line, check version number */
- if (lineNumber == 1)
- {
- char *v = SecurityParseString(&p);
- if (strcmp(v, SECURITY_POLICY_FILE_VERSION) != 0)
- {
- ErrorF("%s: invalid security policy file version, ignoring file\n",
- SecurityPolicyFile);
- break;
- }
- validLine = TRUE;
- }
- else
- {
- switch (SecurityParseKeyword(&p))
- {
- case SecurityKeywordComment:
- validLine = TRUE;
- break;
-
- case SecurityKeywordProperty:
- validLine = SecurityParsePropertyAccessRule(p);
- break;
-
- case SecurityKeywordSitePolicy:
- validLine = SecurityParseSitePolicy(p);
- break;
-
- default:
- validLine = (*p == '\0'); /* blank lines OK, others not */
- break;
- }
- }
-
- if (!validLine)
- ErrorF("Line %d of %s invalid, ignoring\n",
- lineNumber, SecurityPolicyFile);
- } /* end while more input */
-
-#ifdef PROPDEBUG
- {
- PropertyAccessPtr pacl;
- char *op = "aie";
- for (pacl = PropertyAccessList; pacl; pacl = pacl->next)
- {
- ErrorF("property %s ", NameForAtom(pacl->name));
- switch (pacl->windowRestriction)
- {
- case SecurityAnyWindow: ErrorF("any "); break;
- case SecurityRootWindow: ErrorF("root "); break;
- case SecurityWindowWithProperty:
- {
- ErrorF("%s ", NameForAtom(pacl->mustHaveProperty));
- if (pacl->mustHaveValue)
- ErrorF(" = \"%s\" ", pacl->mustHaveValue);
-
- }
- break;
- }
- ErrorF("%cr %cw %cd\n", op[pacl->readAction],
- op[pacl->writeAction], op[pacl->destroyAction]);
- }
- }
-#endif /* PROPDEBUG */
-
- fclose(f);
-} /* SecurityLoadPropertyAccessList */
-
-
-static Bool
-SecurityMatchString(
- char *ws,
- char *cs)
-{
- while (*ws && *cs)
- {
- if (*ws == '*')
- {
- Bool match = FALSE;
- ws++;
- while (!(match = SecurityMatchString(ws, cs)) && *cs)
- {
- cs++;
- }
- return match;
- }
- else if (*ws == *cs)
- {
- ws++;
- cs++;
- }
- else break;
- }
- return ( ( (*ws == '\0') || ((*ws == '*') && *(ws+1) == '\0') )
- && (*cs == '\0') );
-} /* SecurityMatchString */
-
-#ifdef PROPDEBUG
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-
-
-char
-SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode)
- ClientPtr client;
- WindowPtr pWin;
- ATOM propertyName;
- Mask access_mode;
-{
- PropertyAccessPtr pacl;
- char action = SecurityDefaultAction;
-
- /* if client trusted or window untrusted, allow operation */
-
- if ( (client->trustLevel == XSecurityClientTrusted) ||
- (wClient(pWin)->trustLevel != XSecurityClientTrusted) )
- return SecurityAllowOperation;
-
-#ifdef PROPDEBUG
- /* For testing, it's more convenient if the property rules file gets
- * reloaded whenever it changes, so we can rapidly try things without
- * having to reset the server.
- */
- {
- struct stat buf;
- static time_t lastmod = 0;
- int ret = stat(SecurityPolicyFile , &buf);
- if ( (ret == 0) && (buf.st_mtime > lastmod) )
- {
- ErrorF("reloading property rules\n");
- SecurityFreePropertyAccessList();
- SecurityLoadPropertyAccessList();
- lastmod = buf.st_mtime;
- }
- }
-#endif
-
- /* If the property atom is bigger than any atoms on the list,
- * we know we won't find it, so don't even bother looking.
- */
- if (propertyName <= SecurityMaxPropertyName)
- {
- /* untrusted client operating on trusted window; see if it's allowed */
-
- for (pacl = PropertyAccessList; pacl; pacl = pacl->next)
- {
- if (pacl->name < propertyName)
- continue;
- if (pacl->name > propertyName)
- break;
-
- /* pacl->name == propertyName, so see if it applies to this window */
-
- switch (pacl->windowRestriction)
- {
- case SecurityAnyWindow: /* always applies */
- break;
-
- case SecurityRootWindow:
- {
- /* if not a root window, this rule doesn't apply */
- if (pWin->parent)
- continue;
- }
- break;
-
- case SecurityWindowWithProperty:
- {
- PropertyPtr pProp = wUserProps (pWin);
- Bool match = FALSE;
- char *p;
- char *pEndData;
-
- while (pProp)
- {
- if (pProp->propertyName == pacl->mustHaveProperty)
- break;
- pProp = pProp->next;
- }
- if (!pProp)
- continue;
- if (!pacl->mustHaveValue)
- break;
- if (pProp->type != XA_STRING || pProp->format != 8)
- continue;
-
- p = pProp->data;
- pEndData = ((char *)pProp->data) + pProp->size;
- while (!match && p < pEndData)
- {
- if (SecurityMatchString(pacl->mustHaveValue, p))
- match = TRUE;
- else
- { /* skip to the next string */
- while (*p++ && p < pEndData)
- ;
- }
- }
- if (!match)
- continue;
- }
- break; /* end case SecurityWindowWithProperty */
- } /* end switch on windowRestriction */
-
- /* If we get here, the property access rule pacl applies.
- * If pacl doesn't apply, something above should have
- * executed a continue, which will skip the follwing code.
- */
- action = SecurityAllowOperation;
- if (access_mode & SecurityReadAccess)
- action = max(action, pacl->readAction);
- if (access_mode & SecurityWriteAccess)
- action = max(action, pacl->writeAction);
- if (access_mode & SecurityDestroyAccess)
- action = max(action, pacl->destroyAction);
- break;
- } /* end for each pacl */
- } /* end if propertyName <= SecurityMaxPropertyName */
-
- if (SecurityAllowOperation != action)
- { /* audit the access violation */
- int cid = CLIENT_ID(pWin->drawable.id);
- int reqtype = ((xReq *)client->requestBuffer)->reqType;
- char *actionstr = (SecurityIgnoreOperation == action) ?
- "ignored" : "error";
- SecurityAudit("client %d attempted request %d with window 0x%x property %s (atom 0x%x) of client %d, %s\n",
- client->index, reqtype, pWin->drawable.id,
- NameForAtom(propertyName), propertyName, cid, actionstr);
- }
- return action;
-} /* SecurityCheckPropertyAccess */
-
-
-/* SecurityResetProc
- *
- * Arguments:
- * extEntry is the extension information for the security extension.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Performs any cleanup needed by Security at server shutdown time.
- */
-
-static void
-SecurityResetProc(
- ExtensionEntry *extEntry)
-{
- SecurityFreePropertyAccessList();
- SecurityFreeSitePolicyStrings();
-} /* SecurityResetProc */
-
-
-int
-XSecurityOptions(argc, argv, i)
- int argc;
- char **argv;
- int i;
-{
- if (strcmp(argv[i], "-sp") == 0)
- {
- if (i < argc)
- SecurityPolicyFile = argv[++i];
- return (i + 1);
- }
- return (i);
-} /* XSecurityOptions */
-
-
-
-/* SecurityExtensionInit
- *
- * Arguments: none.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Enables the Security extension if possible.
- */
-
-void
-SecurityExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
-
- SecurityAuthorizationResType =
- CreateNewResourceType(SecurityDeleteAuthorization);
-
- RTEventClient = CreateNewResourceType(
- SecurityDeleteAuthorizationEventClient);
-
- if (!SecurityAuthorizationResType || !RTEventClient)
- return;
-
- RTEventClient |= RC_NEVERRETAIN;
-
- if (!AddCallback(&ClientStateCallback, SecurityClientStateCallback, NULL))
- return;
-
- extEntry = AddExtension(SECURITY_EXTENSION_NAME,
- XSecurityNumberEvents, XSecurityNumberErrors,
- ProcSecurityDispatch, SProcSecurityDispatch,
- SecurityResetProc, StandardMinorOpcode);
-
- SecurityErrorBase = extEntry->errorBase;
- SecurityEventBase = extEntry->eventBase;
-
- EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
- (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;
-
- /* initialize untrusted proc vectors */
-
- for (i = 0; i < 128; i++)
- {
- UntrustedProcVector[i] = ProcVector[i];
- SwappedUntrustedProcVector[i] = SwappedProcVector[i];
- }
-
- /* make sure insecure extensions are not allowed */
-
- for (i = 128; i < 256; i++)
- {
- if (!UntrustedProcVector[i])
- {
- UntrustedProcVector[i] = ProcBadRequest;
- SwappedUntrustedProcVector[i] = ProcBadRequest;
- }
- }
-
- SecurityLoadPropertyAccessList();
-
-} /* SecurityExtensionInit */
diff --git a/Xext/shape.c b/Xext/shape.c
deleted file mode 100644
index 956a8ebfc..000000000
--- a/Xext/shape.c
+++ /dev/null
@@ -1,1276 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.19 2003/11/17 22:20:26 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: shape.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#define _SHAPE_SERVER_ /* don't want Xlib structures */
-#include "shapestr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-#include "modinit.h"
-
-typedef RegionPtr (*CreateDftPtr)(
- WindowPtr /* pWin */
- );
-
-static int ShapeFreeClient(
- pointer /* data */,
- XID /* id */
- );
-static int ShapeFreeEvents(
- pointer /* data */,
- XID /* id */
- );
-static void SendShapeNotify(
- WindowPtr /* pWin */,
- int /* which */
- );
-static void ShapeResetProc(
- ExtensionEntry * /* extEntry */
- );
-static void SShapeNotifyEvent(
- xShapeNotifyEvent * /* from */,
- xShapeNotifyEvent * /* to */
- );
-static int
-RegionOperate (
- ClientPtr /* client */,
- WindowPtr /* pWin */,
- int /* kind */,
- RegionPtr * /* destRgnp */,
- RegionPtr /* srcRgn */,
- int /* op */,
- int /* xoff */,
- int /* yoff */,
- CreateDftPtr /* create */
- );
-
-#define CREATE_PROC(func) RegionPtr func(WindowPtr /* pWin */)
-
-static CREATE_PROC(CreateBoundingShape);
-static CREATE_PROC(CreateClipShape);
-
-#undef CREATE_PROC
-
-static DISPATCH_PROC(ProcShapeCombine);
-static DISPATCH_PROC(ProcShapeDispatch);
-static DISPATCH_PROC(ProcShapeGetRectangles);
-static DISPATCH_PROC(ProcShapeInputSelected);
-static DISPATCH_PROC(ProcShapeMask);
-static DISPATCH_PROC(ProcShapeOffset);
-static DISPATCH_PROC(ProcShapeQueryExtents);
-static DISPATCH_PROC(ProcShapeQueryVersion);
-static DISPATCH_PROC(ProcShapeRectangles);
-static DISPATCH_PROC(ProcShapeSelectInput);
-static DISPATCH_PROC(SProcShapeCombine);
-static DISPATCH_PROC(SProcShapeDispatch);
-static DISPATCH_PROC(SProcShapeGetRectangles);
-static DISPATCH_PROC(SProcShapeInputSelected);
-static DISPATCH_PROC(SProcShapeMask);
-static DISPATCH_PROC(SProcShapeOffset);
-static DISPATCH_PROC(SProcShapeQueryExtents);
-static DISPATCH_PROC(SProcShapeQueryVersion);
-static DISPATCH_PROC(SProcShapeRectangles);
-static DISPATCH_PROC(SProcShapeSelectInput);
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-#if 0
-static unsigned char ShapeReqCode = 0;
-#endif
-static int ShapeEventBase = 0;
-static RESTYPE ClientType, EventType; /* resource types for event masks */
-
-/*
- * each window has a list of clients requesting
- * ShapeNotify events. Each client has a resource
- * for each window it selects ShapeNotify input for,
- * this resource is used to delete the ShapeNotifyRec
- * entry from the per-window queue.
- */
-
-typedef struct _ShapeEvent *ShapeEventPtr;
-
-typedef struct _ShapeEvent {
- ShapeEventPtr next;
- ClientPtr client;
- WindowPtr window;
- XID clientResource;
-} ShapeEventRec;
-
-/****************
- * ShapeExtensionInit
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- ****************/
-
-void
-ShapeExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
-
- ClientType = CreateNewResourceType(ShapeFreeClient);
- EventType = CreateNewResourceType(ShapeFreeEvents);
- if (ClientType && EventType &&
- (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
- ProcShapeDispatch, SProcShapeDispatch,
- ShapeResetProc, StandardMinorOpcode)))
- {
-#if 0
- ShapeReqCode = (unsigned char)extEntry->base;
-#endif
- ShapeEventBase = extEntry->eventBase;
- EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
- }
-}
-
-/*ARGSUSED*/
-static void
-ShapeResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
-}
-
-static int
-RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
- ClientPtr client;
- WindowPtr pWin;
- int kind;
- RegionPtr *destRgnp, srcRgn;
- int op;
- int xoff, yoff;
- CreateDftPtr create; /* creates a reasonable *destRgnp */
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (srcRgn && (xoff || yoff))
- REGION_TRANSLATE(pScreen, srcRgn, xoff, yoff);
- if (!pWin->parent)
- {
- if (srcRgn)
- REGION_DESTROY(pScreen, srcRgn);
- return Success;
- }
-
- /* May/30/2001:
- * The shape.PS specs say if src is None, existing shape is to be
- * removed (and so the op-code has no meaning in such removal);
- * see shape.PS, page 3, ShapeMask.
- */
- if (srcRgn == NULL) {
- if (*destRgnp != NULL) {
- REGION_DESTROY (pScreen, *destRgnp);
- *destRgnp = 0;
- /* go on to remove shape and generate ShapeNotify */
- }
- else {
- /* May/30/2001:
- * The target currently has no shape in effect, so nothing to
- * do here. The specs say that ShapeNotify is generated whenever
- * the client region is "modified"; since no modification is done
- * here, we do not generate that event. The specs does not say
- * "it is an error to request removal when there is no shape in
- * effect", so we return good status.
- */
- return Success;
- }
- }
- else switch (op) {
- case ShapeSet:
- if (*destRgnp)
- REGION_DESTROY(pScreen, *destRgnp);
- *destRgnp = srcRgn;
- srcRgn = 0;
- break;
- case ShapeUnion:
- if (*destRgnp)
- REGION_UNION(pScreen, *destRgnp, *destRgnp, srcRgn);
- break;
- case ShapeIntersect:
- if (*destRgnp)
- REGION_INTERSECT(pScreen, *destRgnp, *destRgnp, srcRgn);
- else {
- *destRgnp = srcRgn;
- srcRgn = 0;
- }
- break;
- case ShapeSubtract:
- if (!*destRgnp)
- *destRgnp = (*create)(pWin);
- REGION_SUBTRACT(pScreen, *destRgnp, *destRgnp, srcRgn);
- break;
- case ShapeInvert:
- if (!*destRgnp)
- *destRgnp = REGION_CREATE(pScreen, (BoxPtr) 0, 0);
- else
- REGION_SUBTRACT(pScreen, *destRgnp, srcRgn, *destRgnp);
- break;
- default:
- client->errorValue = op;
- return BadValue;
- }
- if (srcRgn)
- REGION_DESTROY(pScreen, srcRgn);
- (*pScreen->SetShape) (pWin);
- SendShapeNotify (pWin, kind);
- return Success;
-}
-
-static RegionPtr
-CreateBoundingShape (pWin)
- WindowPtr pWin;
-{
- BoxRec extents;
-
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- return REGION_CREATE(pWin->drawable.pScreen, &extents, 1);
-}
-
-static RegionPtr
-CreateClipShape (pWin)
- WindowPtr pWin;
-{
- BoxRec extents;
-
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- return REGION_CREATE(pWin->drawable.pScreen, &extents, 1);
-}
-
-static int
-ProcShapeQueryVersion (client)
- register ClientPtr client;
-{
- xShapeQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SHAPE_MAJOR_VERSION;
- rep.minorVersion = SHAPE_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-/*****************
- * ProcShapeRectangles
- *
- *****************/
-
-static int
-ProcShapeRectangles (client)
- register ClientPtr client;
-{
- WindowPtr pWin;
- ScreenPtr pScreen;
- REQUEST(xShapeRectanglesReq);
- xRectangle *prects;
- int nrects, ctype;
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- CreateDftPtr createDefault;
- int destBounding;
-
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
- UpdateCurrentTime();
- pWin = LookupWindow (stuff->dest, client);
- if (!pWin)
- return BadWindow;
- switch (stuff->destKind) {
- case ShapeBounding:
- destBounding = 1;
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- destBounding = 0;
- createDefault = CreateClipShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) &&
- (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded))
- {
- client->errorValue = stuff->ordering;
- return BadValue;
- }
- pScreen = pWin->drawable.pScreen;
- nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
- if (nrects & 4)
- return BadLength;
- nrects >>= 3;
- prects = (xRectangle *) &stuff[1];
- ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering);
- if (ctype < 0)
- return BadMatch;
- srcRgn = RECTS_TO_REGION(pScreen, nrects, prects, ctype);
-
- if (!pWin->optional)
- MakeWindowOptional (pWin);
- if (destBounding)
- destRgn = &pWin->optional->boundingShape;
- else
- destRgn = &pWin->optional->clipShape;
-
- return RegionOperate (client, pWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeRectangles(
- register ClientPtr client)
-{
- REQUEST(xShapeRectanglesReq);
- PanoramiXRes *win;
- int j, result = 0;
-
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->dest, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- result = ProcShapeRectangles (client);
- BREAK_IF(result != Success);
- }
- return (result);
-}
-#endif
-
-
-/**************
- * ProcShapeMask
- **************/
-
-
-static int
-ProcShapeMask (client)
- register ClientPtr client;
-{
- WindowPtr pWin;
- ScreenPtr pScreen;
- REQUEST(xShapeMaskReq);
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- PixmapPtr pPixmap;
- CreateDftPtr createDefault;
- int destBounding;
-
- REQUEST_SIZE_MATCH (xShapeMaskReq);
- UpdateCurrentTime();
- pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess);
- if (!pWin)
- return BadWindow;
- switch (stuff->destKind) {
- case ShapeBounding:
- destBounding = 1;
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- destBounding = 0;
- createDefault = CreateClipShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- pScreen = pWin->drawable.pScreen;
- if (stuff->src == None)
- srcRgn = 0;
- else {
- pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src,
- RT_PIXMAP, SecurityReadAccess);
- if (!pPixmap)
- return BadPixmap;
- if (pPixmap->drawable.pScreen != pScreen ||
- pPixmap->drawable.depth != 1)
- return BadMatch;
- srcRgn = BITMAP_TO_REGION(pScreen, pPixmap);
- if (!srcRgn)
- return BadAlloc;
- }
-
- if (!pWin->optional)
- MakeWindowOptional (pWin);
- if (destBounding)
- destRgn = &pWin->optional->boundingShape;
- else
- destRgn = &pWin->optional->clipShape;
-
- return RegionOperate (client, pWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeMask(
- register ClientPtr client)
-{
- REQUEST(xShapeMaskReq);
- PanoramiXRes *win, *pmap;
- int j, result = 0;
-
- REQUEST_SIZE_MATCH (xShapeMaskReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->dest, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if(stuff->src != None) {
- if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->src, XRT_PIXMAP, SecurityReadAccess)))
- return BadPixmap;
- } else
- pmap = NULL;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- if(pmap)
- stuff->src = pmap->info[j].id;
- result = ProcShapeMask (client);
- BREAK_IF(result != Success);
- }
- return (result);
-}
-#endif
-
-
-/************
- * ProcShapeCombine
- ************/
-
-static int
-ProcShapeCombine (client)
- register ClientPtr client;
-{
- WindowPtr pSrcWin, pDestWin;
- ScreenPtr pScreen;
- REQUEST(xShapeCombineReq);
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- CreateDftPtr createDefault;
- CreateDftPtr createSrc;
- RegionPtr tmp;
- int destBounding;
-
- REQUEST_SIZE_MATCH (xShapeCombineReq);
- UpdateCurrentTime();
- pDestWin = LookupWindow (stuff->dest, client);
- if (!pDestWin)
- return BadWindow;
- if (!pDestWin->optional)
- MakeWindowOptional (pDestWin);
- switch (stuff->destKind) {
- case ShapeBounding:
- destBounding = 1;
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- destBounding = 0;
- createDefault = CreateClipShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- pScreen = pDestWin->drawable.pScreen;
-
- pSrcWin = LookupWindow (stuff->src, client);
- if (!pSrcWin)
- return BadWindow;
- switch (stuff->srcKind) {
- case ShapeBounding:
- srcRgn = wBoundingShape (pSrcWin);
- createSrc = CreateBoundingShape;
- break;
- case ShapeClip:
- srcRgn = wClipShape (pSrcWin);
- createSrc = CreateClipShape;
- break;
- default:
- client->errorValue = stuff->srcKind;
- return BadValue;
- }
- if (pSrcWin->drawable.pScreen != pScreen)
- {
- return BadMatch;
- }
-
- if (srcRgn) {
- tmp = REGION_CREATE(pScreen, (BoxPtr) 0, 0);
- REGION_COPY(pScreen, tmp, srcRgn);
- srcRgn = tmp;
- } else
- srcRgn = (*createSrc) (pSrcWin);
-
- if (!pDestWin->optional)
- MakeWindowOptional (pDestWin);
- if (destBounding)
- destRgn = &pDestWin->optional->boundingShape;
- else
- destRgn = &pDestWin->optional->clipShape;
-
- return RegionOperate (client, pDestWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeCombine(
- register ClientPtr client)
-{
- REQUEST(xShapeCombineReq);
- PanoramiXRes *win, *win2;
- int j, result = 0;
-
- REQUEST_AT_LEAST_SIZE (xShapeCombineReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->dest, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->src, XRT_WINDOW, SecurityReadAccess)))
- return BadWindow;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- stuff->src = win2->info[j].id;
- result = ProcShapeCombine (client);
- BREAK_IF(result != Success);
- }
- return (result);
-}
-#endif
-
-/*************
- * ProcShapeOffset
- *************/
-
-static int
-ProcShapeOffset (client)
- register ClientPtr client;
-{
- WindowPtr pWin;
- ScreenPtr pScreen;
- REQUEST(xShapeOffsetReq);
- RegionPtr srcRgn;
-
- REQUEST_SIZE_MATCH (xShapeOffsetReq);
- UpdateCurrentTime();
- pWin = LookupWindow (stuff->dest, client);
- if (!pWin)
- return BadWindow;
- switch (stuff->destKind) {
- case ShapeBounding:
- srcRgn = wBoundingShape (pWin);
- break;
- case ShapeClip:
- srcRgn = wClipShape(pWin);
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- pScreen = pWin->drawable.pScreen;
- if (srcRgn)
- {
- REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
- (*pScreen->SetShape) (pWin);
- }
- SendShapeNotify (pWin, (int)stuff->destKind);
- return Success;
-}
-
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeOffset(
- register ClientPtr client)
-{
- REQUEST(xShapeOffsetReq);
- PanoramiXRes *win;
- int j, result = 0;
-
- REQUEST_AT_LEAST_SIZE (xShapeOffsetReq);
-
- if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->dest, XRT_WINDOW, SecurityWriteAccess)))
- return BadWindow;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- result = ProcShapeOffset (client);
- if(result != Success) break;
- }
- return (result);
-}
-#endif
-
-
-static int
-ProcShapeQueryExtents (client)
- register ClientPtr client;
-{
- REQUEST(xShapeQueryExtentsReq);
- WindowPtr pWin;
- xShapeQueryExtentsReply rep;
- BoxRec extents, *pExtents;
- register int n;
- RegionPtr region;
-
- REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.boundingShaped = (wBoundingShape(pWin) != 0);
- rep.clipShaped = (wClipShape(pWin) != 0);
- if ((region = wBoundingShape(pWin))) {
- /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
- pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region);
- extents = *pExtents;
- } else {
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- }
- rep.xBoundingShape = extents.x1;
- rep.yBoundingShape = extents.y1;
- rep.widthBoundingShape = extents.x2 - extents.x1;
- rep.heightBoundingShape = extents.y2 - extents.y1;
- if ((region = wClipShape(pWin))) {
- /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
- pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region);
- extents = *pExtents;
- } else {
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- }
- rep.xClipShape = extents.x1;
- rep.yClipShape = extents.y1;
- rep.widthClipShape = extents.x2 - extents.x1;
- rep.heightClipShape = extents.y2 - extents.y1;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.xBoundingShape, n);
- swaps(&rep.yBoundingShape, n);
- swaps(&rep.widthBoundingShape, n);
- swaps(&rep.heightBoundingShape, n);
- swaps(&rep.xClipShape, n);
- swaps(&rep.yClipShape, n);
- swaps(&rep.widthClipShape, n);
- swaps(&rep.heightClipShape, n);
- }
- WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
- return (client->noClientException);
-}
-
-/*ARGSUSED*/
-static int
-ShapeFreeClient (data, id)
- pointer data;
- XID id;
-{
- ShapeEventPtr pShapeEvent;
- WindowPtr pWin;
- ShapeEventPtr *pHead, pCur, pPrev;
-
- pShapeEvent = (ShapeEventPtr) data;
- pWin = pShapeEvent->window;
- pHead = (ShapeEventPtr *) LookupIDByType(pWin->drawable.id, EventType);
- if (pHead) {
- pPrev = 0;
- for (pCur = *pHead; pCur && pCur != pShapeEvent; pCur=pCur->next)
- pPrev = pCur;
- if (pCur)
- {
- if (pPrev)
- pPrev->next = pShapeEvent->next;
- else
- *pHead = pShapeEvent->next;
- }
- }
- xfree ((pointer) pShapeEvent);
- return 1;
-}
-
-/*ARGSUSED*/
-static int
-ShapeFreeEvents (data, id)
- pointer data;
- XID id;
-{
- ShapeEventPtr *pHead, pCur, pNext;
-
- pHead = (ShapeEventPtr *) data;
- for (pCur = *pHead; pCur; pCur = pNext) {
- pNext = pCur->next;
- FreeResource (pCur->clientResource, ClientType);
- xfree ((pointer) pCur);
- }
- xfree ((pointer) pHead);
- return 1;
-}
-
-static int
-ProcShapeSelectInput (client)
- register ClientPtr client;
-{
- REQUEST(xShapeSelectInputReq);
- WindowPtr pWin;
- ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
- XID clientResource;
-
- REQUEST_SIZE_MATCH (xShapeSelectInputReq);
- pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess);
- if (!pWin)
- return BadWindow;
- pHead = (ShapeEventPtr *)SecurityLookupIDByType(client,
- pWin->drawable.id, EventType, SecurityWriteAccess);
- switch (stuff->enable) {
- case xTrue:
- if (pHead) {
-
- /* check for existing entry. */
- for (pShapeEvent = *pHead;
- pShapeEvent;
- pShapeEvent = pShapeEvent->next)
- {
- if (pShapeEvent->client == client)
- return Success;
- }
- }
-
- /* build the entry */
- pNewShapeEvent = (ShapeEventPtr)
- xalloc (sizeof (ShapeEventRec));
- if (!pNewShapeEvent)
- return BadAlloc;
- pNewShapeEvent->next = 0;
- pNewShapeEvent->client = client;
- pNewShapeEvent->window = pWin;
- /*
- * add a resource that will be deleted when
- * the client goes away
- */
- clientResource = FakeClientID (client->index);
- pNewShapeEvent->clientResource = clientResource;
- if (!AddResource (clientResource, ClientType, (pointer)pNewShapeEvent))
- return BadAlloc;
- /*
- * create a resource to contain a pointer to the list
- * of clients selecting input. This must be indirect as
- * the list may be arbitrarily rearranged which cannot be
- * done through the resource database.
- */
- if (!pHead)
- {
- pHead = (ShapeEventPtr *) xalloc (sizeof (ShapeEventPtr));
- if (!pHead ||
- !AddResource (pWin->drawable.id, EventType, (pointer)pHead))
- {
- FreeResource (clientResource, RT_NONE);
- return BadAlloc;
- }
- *pHead = 0;
- }
- pNewShapeEvent->next = *pHead;
- *pHead = pNewShapeEvent;
- break;
- case xFalse:
- /* delete the interest */
- if (pHead) {
- pNewShapeEvent = 0;
- for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
- if (pShapeEvent->client == client)
- break;
- pNewShapeEvent = pShapeEvent;
- }
- if (pShapeEvent) {
- FreeResource (pShapeEvent->clientResource, ClientType);
- if (pNewShapeEvent)
- pNewShapeEvent->next = pShapeEvent->next;
- else
- *pHead = pShapeEvent->next;
- xfree (pShapeEvent);
- }
- }
- break;
- default:
- client->errorValue = stuff->enable;
- return BadValue;
- }
- return Success;
-}
-
-/*
- * deliver the event
- */
-
-static void
-SendShapeNotify (pWin, which)
- WindowPtr pWin;
- int which;
-{
- ShapeEventPtr *pHead, pShapeEvent;
- ClientPtr client;
- xShapeNotifyEvent se;
- BoxRec extents;
- RegionPtr region;
- BYTE shaped;
-
- pHead = (ShapeEventPtr *) LookupIDByType(pWin->drawable.id, EventType);
- if (!pHead)
- return;
- if (which == ShapeBounding) {
- region = wBoundingShape(pWin);
- if (region) {
- extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
- shaped = xTrue;
- } else {
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- shaped = xFalse;
- }
- } else {
- region = wClipShape(pWin);
- if (region) {
- extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
- shaped = xTrue;
- } else {
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- shaped = xFalse;
- }
- }
- for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
- client = pShapeEvent->client;
- if (client == serverClient || client->clientGone)
- continue;
- se.type = ShapeNotify + ShapeEventBase;
- se.kind = which;
- se.window = pWin->drawable.id;
- se.sequenceNumber = client->sequence;
- se.x = extents.x1;
- se.y = extents.y1;
- se.width = extents.x2 - extents.x1;
- se.height = extents.y2 - extents.y1;
- se.time = currentTime.milliseconds;
- se.shaped = shaped;
- WriteEventsToClient (client, 1, (xEvent *) &se);
- }
-}
-
-static int
-ProcShapeInputSelected (client)
- register ClientPtr client;
-{
- REQUEST(xShapeInputSelectedReq);
- WindowPtr pWin;
- ShapeEventPtr pShapeEvent, *pHead;
- int enabled;
- xShapeInputSelectedReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- pHead = (ShapeEventPtr *) SecurityLookupIDByType(client,
- pWin->drawable.id, EventType, SecurityReadAccess);
- enabled = xFalse;
- if (pHead) {
- for (pShapeEvent = *pHead;
- pShapeEvent;
- pShapeEvent = pShapeEvent->next)
- {
- if (pShapeEvent->client == client) {
- enabled = xTrue;
- break;
- }
- }
- }
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.enabled = enabled;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- }
- WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
- return (client->noClientException);
-}
-
-static int
-ProcShapeGetRectangles (client)
- register ClientPtr client;
-{
- REQUEST(xShapeGetRectanglesReq);
- WindowPtr pWin;
- xShapeGetRectanglesReply rep;
- xRectangle *rects;
- int nrects, i;
- RegionPtr region;
- register int n;
-
- REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- switch (stuff->kind) {
- case ShapeBounding:
- region = wBoundingShape(pWin);
- break;
- case ShapeClip:
- region = wClipShape(pWin);
- break;
- default:
- client->errorValue = stuff->kind;
- return BadValue;
- }
- if (!region) {
- nrects = 1;
- rects = (xRectangle *) ALLOCATE_LOCAL (sizeof (xRectangle));
- if (!rects)
- return BadAlloc;
- switch (stuff->kind) {
- case ShapeBounding:
- rects->x = - (int) wBorderWidth (pWin);
- rects->y = - (int) wBorderWidth (pWin);
- rects->width = pWin->drawable.width + wBorderWidth (pWin);
- rects->height = pWin->drawable.height + wBorderWidth (pWin);
- break;
- case ShapeClip:
- rects->x = 0;
- rects->y = 0;
- rects->width = pWin->drawable.width;
- rects->height = pWin->drawable.height;
- break;
- }
- } else {
- BoxPtr box;
- nrects = REGION_NUM_RECTS(region);
- box = REGION_RECTS(region);
- rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle));
- if (!rects && nrects)
- return BadAlloc;
- for (i = 0; i < nrects; i++, box++) {
- rects[i].x = box->x1;
- rects[i].y = box->y1;
- rects[i].width = box->x2 - box->x1;
- rects[i].height = box->y2 - box->y1;
- }
- }
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = (nrects * sizeof (xRectangle)) >> 2;
- rep.ordering = YXBanded;
- rep.nrects = nrects;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.nrects, n);
- SwapShorts ((short *)rects, (unsigned long)nrects * 4);
- }
- WriteToClient (client, sizeof (rep), (char *) &rep);
- WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
- DEALLOCATE_LOCAL (rects);
- return client->noClientException;
-}
-
-static int
-ProcShapeDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_ShapeQueryVersion:
- return ProcShapeQueryVersion (client);
- case X_ShapeRectangles:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeRectangles (client);
- else
-#endif
- return ProcShapeRectangles (client);
- case X_ShapeMask:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeMask (client);
- else
-#endif
- return ProcShapeMask (client);
- case X_ShapeCombine:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeCombine (client);
- else
-#endif
- return ProcShapeCombine (client);
- case X_ShapeOffset:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeOffset (client);
- else
-#endif
- return ProcShapeOffset (client);
- case X_ShapeQueryExtents:
- return ProcShapeQueryExtents (client);
- case X_ShapeSelectInput:
- return ProcShapeSelectInput (client);
- case X_ShapeInputSelected:
- return ProcShapeInputSelected (client);
- case X_ShapeGetRectangles:
- return ProcShapeGetRectangles (client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SShapeNotifyEvent(from, to)
- xShapeNotifyEvent *from, *to;
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswapl (from->window, to->window);
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswaps (from->x, to->x);
- cpswaps (from->y, to->y);
- cpswaps (from->width, to->width);
- cpswaps (from->height, to->height);
- cpswapl (from->time, to->time);
- to->shaped = from->shaped;
-}
-
-static int
-SProcShapeQueryVersion (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xShapeQueryVersionReq);
-
- swaps (&stuff->length, n);
- return ProcShapeQueryVersion (client);
-}
-
-static int
-SProcShapeRectangles (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeRectanglesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- SwapRestS(stuff);
- return ProcShapeRectangles (client);
-}
-
-static int
-SProcShapeMask (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeMaskReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeMaskReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- swapl (&stuff->src, n);
- return ProcShapeMask (client);
-}
-
-static int
-SProcShapeCombine (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeCombineReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeCombineReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- swapl (&stuff->src, n);
- return ProcShapeCombine (client);
-}
-
-static int
-SProcShapeOffset (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeOffsetReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeOffsetReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- return ProcShapeOffset (client);
-}
-
-static int
-SProcShapeQueryExtents (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeQueryExtentsReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
- swapl (&stuff->window, n);
- return ProcShapeQueryExtents (client);
-}
-
-static int
-SProcShapeSelectInput (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST (xShapeSelectInputReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeSelectInputReq);
- swapl (&stuff->window, n);
- return ProcShapeSelectInput (client);
-}
-
-static int
-SProcShapeInputSelected (client)
- register ClientPtr client;
-{
- register int n;
- REQUEST (xShapeInputSelectedReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
- swapl (&stuff->window, n);
- return ProcShapeInputSelected (client);
-}
-
-static int
-SProcShapeGetRectangles (client)
- register ClientPtr client;
-{
- REQUEST(xShapeGetRectanglesReq);
- register char n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
- swapl (&stuff->window, n);
- return ProcShapeGetRectangles (client);
-}
-
-static int
-SProcShapeDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_ShapeQueryVersion:
- return SProcShapeQueryVersion (client);
- case X_ShapeRectangles:
- return SProcShapeRectangles (client);
- case X_ShapeMask:
- return SProcShapeMask (client);
- case X_ShapeCombine:
- return SProcShapeCombine (client);
- case X_ShapeOffset:
- return SProcShapeOffset (client);
- case X_ShapeQueryExtents:
- return SProcShapeQueryExtents (client);
- case X_ShapeSelectInput:
- return SProcShapeSelectInput (client);
- case X_ShapeInputSelected:
- return SProcShapeInputSelected (client);
- case X_ShapeGetRectangles:
- return SProcShapeGetRectangles (client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/shm.c b/Xext/shm.c
deleted file mode 100644
index 9591eab54..000000000
--- a/Xext/shm.c
+++ /dev/null
@@ -1,1262 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.40 2003/11/17 22:20:27 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
-
-/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-#define SHM
-
-#include <sys/types.h>
-#ifndef Lynx
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#else
-#include <ipc.h>
-#include <shm.h>
-#endif
-#include <unistd.h>
-#include <sys/stat.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "extnsionst.h"
-#include "servermd.h"
-#define _XSHM_SERVER_
-#include "shmstr.h"
-#include "Xfuncproto.h"
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-#include "modinit.h"
-
-typedef struct _ShmDesc {
- struct _ShmDesc *next;
- int shmid;
- int refcnt;
- char *addr;
- Bool writable;
- unsigned long size;
-} ShmDescRec, *ShmDescPtr;
-
-static void miShmPutImage(XSHM_PUT_IMAGE_ARGS);
-static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS);
-static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
-static int ShmDetachSegment(
- pointer /* value */,
- XID /* shmseg */
- );
-static void ShmResetProc(
- ExtensionEntry * /* extEntry */
- );
-static void SShmCompletionEvent(
- xShmCompletionEvent * /* from */,
- xShmCompletionEvent * /* to */
- );
-
-static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
-
-static DISPATCH_PROC(ProcShmAttach);
-static DISPATCH_PROC(ProcShmCreatePixmap);
-static DISPATCH_PROC(ProcShmDetach);
-static DISPATCH_PROC(ProcShmDispatch);
-static DISPATCH_PROC(ProcShmGetImage);
-static DISPATCH_PROC(ProcShmPutImage);
-static DISPATCH_PROC(ProcShmQueryVersion);
-static DISPATCH_PROC(SProcShmAttach);
-static DISPATCH_PROC(SProcShmCreatePixmap);
-static DISPATCH_PROC(SProcShmDetach);
-static DISPATCH_PROC(SProcShmDispatch);
-static DISPATCH_PROC(SProcShmGetImage);
-static DISPATCH_PROC(SProcShmPutImage);
-static DISPATCH_PROC(SProcShmQueryVersion);
-
-static unsigned char ShmReqCode;
-int ShmCompletionCode;
-int BadShmSegCode;
-RESTYPE ShmSegType;
-static ShmDescPtr Shmsegs;
-static Bool sharedPixmaps;
-static int pixmapFormat;
-static int shmPixFormat[MAXSCREENS];
-static ShmFuncsPtr shmFuncs[MAXSCREENS];
-static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
-#ifdef PIXPRIV
-static int shmPixmapPrivate;
-#endif
-static ShmFuncs miFuncs = {NULL, miShmPutImage};
-static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
-
-#define VERIFY_SHMSEG(shmseg,shmdesc,client) \
-{ \
- shmdesc = (ShmDescPtr)LookupIDByType(shmseg, ShmSegType); \
- if (!shmdesc) \
- { \
- client->errorValue = shmseg; \
- return BadShmSegCode; \
- } \
-}
-
-#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \
-{ \
- VERIFY_SHMSEG(shmseg, shmdesc, client); \
- if ((offset & 3) || (offset > shmdesc->size)) \
- { \
- client->errorValue = offset; \
- return BadValue; \
- } \
- if (needwrite && !shmdesc->writable) \
- return BadAccess; \
-}
-
-#define VERIFY_SHMSIZE(shmdesc,offset,len,client) \
-{ \
- if ((offset + len) > shmdesc->size) \
- { \
- return BadAccess; \
- } \
-}
-
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
-#include <sys/signal.h>
-
-static Bool badSysCall = FALSE;
-
-static void
-SigSysHandler(signo)
-int signo;
-{
- badSysCall = TRUE;
-}
-
-static Bool CheckForShmSyscall()
-{
- void (*oldHandler)();
- int shmid = -1;
-
- /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
- oldHandler = signal(SIGSYS, SigSysHandler);
-
- badSysCall = FALSE;
- shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
-
- if (shmid != -1)
- {
- /* Successful allocation - clean up */
- shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
- }
- else
- {
- /* Allocation failed */
- badSysCall = TRUE;
- }
- signal(SIGSYS, oldHandler);
- return(!badSysCall);
-}
-
-#define MUST_CHECK_FOR_SHM_SYSCALL
-
-#endif
-
-void
-ShmExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
-
-#ifdef MUST_CHECK_FOR_SHM_SYSCALL
- if (!CheckForShmSyscall())
- {
- ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
- return;
- }
-#endif
-
- sharedPixmaps = xFalse;
- pixmapFormat = 0;
- {
- sharedPixmaps = xTrue;
- pixmapFormat = shmPixFormat[0];
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- if (!shmFuncs[i])
- shmFuncs[i] = &miFuncs;
- if (!shmFuncs[i]->CreatePixmap)
- sharedPixmaps = xFalse;
- if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat))
- {
- sharedPixmaps = xFalse;
- pixmapFormat = 0;
- }
- }
- if (!pixmapFormat)
- pixmapFormat = ZPixmap;
- if (sharedPixmaps)
- {
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
- screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
- }
-#ifdef PIXPRIV
- shmPixmapPrivate = AllocatePixmapPrivateIndex();
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- if (!AllocatePixmapPrivate(screenInfo.screens[i],
- shmPixmapPrivate, 0))
- return;
- }
-#endif
- }
- }
- ShmSegType = CreateNewResourceType(ShmDetachSegment);
- if (ShmSegType &&
- (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
- ProcShmDispatch, SProcShmDispatch,
- ShmResetProc, StandardMinorOpcode)))
- {
- ShmReqCode = (unsigned char)extEntry->base;
- ShmCompletionCode = extEntry->eventBase;
- BadShmSegCode = extEntry->errorBase;
- EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
- }
-}
-
-/*ARGSUSED*/
-static void
-ShmResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
- int i;
-
- for (i = 0; i < MAXSCREENS; i++)
- {
- shmFuncs[i] = (ShmFuncsPtr)NULL;
- shmPixFormat[i] = 0;
- }
-}
-
-void
-ShmRegisterFuncs(
- ScreenPtr pScreen,
- ShmFuncsPtr funcs)
-{
- shmFuncs[pScreen->myNum] = funcs;
-}
-
-void
-ShmSetPixmapFormat(
- ScreenPtr pScreen,
- int format)
-{
- shmPixFormat[pScreen->myNum] = format;
-}
-
-static Bool
-ShmDestroyPixmap (PixmapPtr pPixmap)
-{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- Bool ret;
- if (pPixmap->refcnt == 1)
- {
- ShmDescPtr shmdesc;
-#ifdef PIXPRIV
- shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr;
-#else
- char *base = (char *) pPixmap->devPrivate.ptr;
-
- if (base != (pointer) (pPixmap + 1))
- {
- for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next)
- {
- if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size)
- break;
- }
- }
- else
- shmdesc = 0;
-#endif
- if (shmdesc)
- ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
- }
-
- pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum];
- ret = (*pScreen->DestroyPixmap) (pPixmap);
- destroyPixmap[pScreen->myNum] = pScreen->DestroyPixmap;
- pScreen->DestroyPixmap = ShmDestroyPixmap;
- return ret;
-}
-
-void
-ShmRegisterFbFuncs(pScreen)
- ScreenPtr pScreen;
-{
- shmFuncs[pScreen->myNum] = &fbFuncs;
-}
-
-static int
-ProcShmQueryVersion(client)
- register ClientPtr client;
-{
- xShmQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xShmQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.sharedPixmaps = sharedPixmaps;
- rep.pixmapFormat = pixmapFormat;
- rep.majorVersion = SHM_MAJOR_VERSION;
- rep.minorVersion = SHM_MINOR_VERSION;
- rep.uid = geteuid();
- rep.gid = getegid();
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- swaps(&rep.uid, n);
- swaps(&rep.gid, n);
- }
- WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-/*
- * Simulate the access() system call for a shared memory segement,
- * using the credentials from the client if available
- */
-static int
-shm_access(ClientPtr client, struct ipc_perm *perm, int readonly)
-{
- int uid, gid;
- mode_t mask;
-
- if (LocalClientCred(client, &uid, &gid) != -1) {
-
- /* User id 0 always gets access */
- if (uid == 0) {
- return 0;
- }
- /* Check the owner */
- if (perm->uid == uid || perm->cuid == uid) {
- mask = S_IRUSR;
- if (!readonly) {
- mask |= S_IWUSR;
- }
- return (perm->mode & mask) == mask ? 0 : -1;
- }
- /* Check the group */
- if (perm->gid == gid || perm->cgid == gid) {
- mask = S_IRGRP;
- if (!readonly) {
- mask |= S_IWGRP;
- }
- return (perm->mode & mask) == mask ? 0 : -1;
- }
- }
- /* Otherwise, check everyone else */
- mask = S_IROTH;
- if (!readonly) {
- mask |= S_IWOTH;
- }
- return (perm->mode & mask) == mask ? 0 : -1;
-}
-
-static int
-ProcShmAttach(client)
- register ClientPtr client;
-{
- struct shmid_ds buf;
- ShmDescPtr shmdesc;
- REQUEST(xShmAttachReq);
-
- REQUEST_SIZE_MATCH(xShmAttachReq);
- LEGAL_NEW_RESOURCE(stuff->shmseg, client);
- if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse))
- {
- client->errorValue = stuff->readOnly;
- return(BadValue);
- }
- for (shmdesc = Shmsegs;
- shmdesc && (shmdesc->shmid != stuff->shmid);
- shmdesc = shmdesc->next)
- ;
- if (shmdesc)
- {
- if (!stuff->readOnly && !shmdesc->writable)
- return BadAccess;
- shmdesc->refcnt++;
- }
- else
- {
- shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec));
- if (!shmdesc)
- return BadAlloc;
- shmdesc->addr = shmat(stuff->shmid, 0,
- stuff->readOnly ? SHM_RDONLY : 0);
- if ((shmdesc->addr == ((char *)-1)) ||
- shmctl(stuff->shmid, IPC_STAT, &buf))
- {
- xfree(shmdesc);
- return BadAccess;
- }
-
- /* The attach was performed with root privs. We must
- * do manual checking of access rights for the credentials
- * of the client */
-
- if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) {
- shmdt(shmdesc->addr);
- xfree(shmdesc);
- return BadAccess;
- }
-
- shmdesc->shmid = stuff->shmid;
- shmdesc->refcnt = 1;
- shmdesc->writable = !stuff->readOnly;
- shmdesc->size = buf.shm_segsz;
- shmdesc->next = Shmsegs;
- Shmsegs = shmdesc;
- }
- if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc))
- return BadAlloc;
- return(client->noClientException);
-}
-
-/*ARGSUSED*/
-static int
-ShmDetachSegment(value, shmseg)
- pointer value; /* must conform to DeleteType */
- XID shmseg;
-{
- ShmDescPtr shmdesc = (ShmDescPtr)value;
- ShmDescPtr *prev;
-
- if (--shmdesc->refcnt)
- return TRUE;
- shmdt(shmdesc->addr);
- for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next)
- ;
- *prev = shmdesc->next;
- xfree(shmdesc);
- return Success;
-}
-
-static int
-ProcShmDetach(client)
- register ClientPtr client;
-{
- ShmDescPtr shmdesc;
- REQUEST(xShmDetachReq);
-
- REQUEST_SIZE_MATCH(xShmDetachReq);
- VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
- FreeResource(stuff->shmseg, RT_NONE);
- return(client->noClientException);
-}
-
-static void
-miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
- DrawablePtr dst;
- GCPtr pGC;
- int depth, w, h, sx, sy, sw, sh, dx, dy;
- unsigned int format;
- char *data;
-{
- PixmapPtr pmap;
- GCPtr putGC;
-
- putGC = GetScratchGC(depth, dst->pScreen);
- if (!putGC)
- return;
- pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth);
- if (!pmap)
- {
- FreeScratchGC(putGC);
- return;
- }
- ValidateGC((DrawablePtr)pmap, putGC);
- (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0,
- (format == XYPixmap) ? XYPixmap : ZPixmap, data);
- FreeScratchGC(putGC);
- if (format == XYBitmap)
- (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
- dx, dy, 1L);
- else
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
- dx, dy);
- (*pmap->drawable.pScreen->DestroyPixmap)(pmap);
-}
-
-static void
-fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
- DrawablePtr dst;
- GCPtr pGC;
- int depth, w, h, sx, sy, sw, sh, dx, dy;
- unsigned int format;
- char *data;
-{
- if ((format == ZPixmap) || (depth == 1))
- {
- PixmapPtr pPixmap;
-
- pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
- BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data);
- if (!pPixmap)
- return;
- if (format == XYBitmap)
- (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC,
- sx, sy, sw, sh, dx, dy, 1L);
- else
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC,
- sx, sy, sw, sh, dx, dy);
- FreeScratchPixmapHeader(pPixmap);
- }
- else
- miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
- data);
-}
-
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShmPutImage(register ClientPtr client)
-{
- int j, result = 0, orig_x, orig_y;
- PanoramiXRes *draw, *gc;
- Bool sendEvent, isRoot;
-
- REQUEST(xShmPutImageReq);
- REQUEST_SIZE_MATCH(xShmPutImageReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- orig_x = stuff->dstX;
- orig_y = stuff->dstY;
- sendEvent = stuff->sendEvent;
- stuff->sendEvent = 0;
- FOR_NSCREENS(j) {
- if(!j) stuff->sendEvent = sendEvent;
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->dstX = orig_x - panoramiXdataPtr[j].x;
- stuff->dstY = orig_y - panoramiXdataPtr[j].y;
- }
- result = ProcShmPutImage(client);
- if(result != client->noClientException) break;
- }
- return(result);
-}
-
-static int
-ProcPanoramiXShmGetImage(ClientPtr client)
-{
- PanoramiXRes *draw;
- DrawablePtr drawables[MAXSCREENS];
- DrawablePtr pDraw;
- xShmGetImageReply xgi;
- ShmDescPtr shmdesc;
- int i, x, y, w, h, format;
- Mask plane = 0, planemask;
- long lenPer = 0, length, widthBytesLine;
- Bool isRoot;
-
- REQUEST(xShmGetImageReq);
-
- REQUEST_SIZE_MATCH(xShmGetImageReq);
-
- if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
- client->errorValue = stuff->format;
- return(BadValue);
- }
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if (draw->type == XRT_PIXMAP)
- return ProcShmGetImage(client);
-
- VERIFY_DRAWABLE(pDraw, stuff->drawable, client);
-
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
-
- x = stuff->x;
- y = stuff->y;
- w = stuff->width;
- h = stuff->height;
- format = stuff->format;
- planemask = stuff->planeMask;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- if(isRoot) {
- if( /* check for being onscreen */
- x < 0 || x + w > PanoramiXPixWidth ||
- y < 0 || y + h > PanoramiXPixHeight )
- return(BadMatch);
- } else {
- if( /* check for being onscreen */
- panoramiXdataPtr[0].x + pDraw->x + x < 0 ||
- panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
- panoramiXdataPtr[0].y + pDraw->y + y < 0 ||
- panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
- /* check for being inside of border */
- x < - wBorderWidth((WindowPtr)pDraw) ||
- x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- y < -wBorderWidth((WindowPtr)pDraw) ||
- y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
- return(BadMatch);
- }
-
- drawables[0] = pDraw;
- for(i = 1; i < PanoramiXNumScreens; i++)
- VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client);
-
- xgi.visual = wVisual(((WindowPtr)pDraw));
- xgi.type = X_Reply;
- xgi.length = 0;
- xgi.sequenceNumber = client->sequence;
- xgi.depth = pDraw->depth;
-
- if(format == ZPixmap) {
- widthBytesLine = PixmapBytePad(w, pDraw->depth);
- length = widthBytesLine * h;
- } else {
- widthBytesLine = PixmapBytePad(w, 1);
- lenPer = widthBytesLine * h;
- plane = ((Mask)1) << (pDraw->depth - 1);
- length = lenPer * Ones(planemask & (plane | (plane - 1)));
- }
-
- VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
- xgi.size = length;
-
- if (length == 0) {/* nothing to do */ }
- else if (format == ZPixmap) {
- XineramaGetImageData(drawables, x, y, w, h, format, planemask,
- shmdesc->addr + stuff->offset,
- widthBytesLine, isRoot);
- } else {
-
- length = stuff->offset;
- for (; plane; plane >>= 1) {
- if (planemask & plane) {
- XineramaGetImageData(drawables, x, y, w, h,
- format, plane, shmdesc->addr + length,
- widthBytesLine, isRoot);
- length += lenPer;
- }
- }
- }
-
- if (client->swapped) {
- register int n;
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
- }
- WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
-
- return(client->noClientException);
-}
-
-static int
-ProcPanoramiXShmCreatePixmap(
- register ClientPtr client)
-{
- ScreenPtr pScreen = NULL;
- PixmapPtr pMap = NULL;
- DrawablePtr pDraw;
- DepthPtr pDepth;
- int i, j, result;
- ShmDescPtr shmdesc;
- REQUEST(xShmCreatePixmapReq);
- PanoramiXRes *newPix;
-
- REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
- client->errorValue = stuff->pid;
- if (!sharedPixmaps)
- return BadImplementation;
- LEGAL_NEW_RESOURCE(stuff->pid, client);
- VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- if (stuff->depth != 1)
- {
- pDepth = pDraw->pScreen->allowedDepths;
- for (i=0; i<pDraw->pScreen->numDepths; i++, pDepth++)
- if (pDepth->depth == stuff->depth)
- goto CreatePmap;
- client->errorValue = stuff->depth;
- return BadValue;
- }
-CreatePmap:
- VERIFY_SHMSIZE(shmdesc, stuff->offset,
- PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
- client);
-
- if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
-
- newPix->type = XRT_PIXMAP;
- newPix->u.pix.shared = TRUE;
- newPix->info[0].id = stuff->pid;
- for(j = 1; j < PanoramiXNumScreens; j++)
- newPix->info[j].id = FakeClientID(client->index);
-
- result = (client->noClientException);
-
- FOR_NSCREENS(j) {
- pScreen = screenInfo.screens[j];
-
- pMap = (*shmFuncs[j]->CreatePixmap)(pScreen,
- stuff->width, stuff->height, stuff->depth,
- shmdesc->addr + stuff->offset);
-
- if (pMap) {
-#ifdef PIXPRIV
- pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
- shmdesc->refcnt++;
- pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pMap->drawable.id = newPix->info[j].id;
- if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
- (*pScreen->DestroyPixmap)(pMap);
- result = BadAlloc;
- break;
- }
- } else {
- result = BadAlloc;
- break;
- }
- }
-
- if(result == BadAlloc) {
- while(j--) {
- (*pScreen->DestroyPixmap)(pMap);
- FreeResource(newPix->info[j].id, RT_NONE);
- }
- xfree(newPix);
- } else
- AddResource(stuff->pid, XRT_PIXMAP, newPix);
-
- return result;
-}
-
-#endif
-
-static int
-ProcShmPutImage(client)
- register ClientPtr client;
-{
- register GCPtr pGC;
- register DrawablePtr pDraw;
- long length;
- ShmDescPtr shmdesc;
- REQUEST(xShmPutImageReq);
-
- REQUEST_SIZE_MATCH(xShmPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
- if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
- return BadValue;
- if (stuff->format == XYBitmap)
- {
- if (stuff->depth != 1)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, 1);
- }
- else if (stuff->format == XYPixmap)
- {
- if (pDraw->depth != stuff->depth)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, 1);
- length *= stuff->depth;
- }
- else if (stuff->format == ZPixmap)
- {
- if (pDraw->depth != stuff->depth)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, stuff->depth);
- }
- else
- {
- client->errorValue = stuff->format;
- return BadValue;
- }
-
- VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
- client);
- if (stuff->srcX > stuff->totalWidth)
- {
- client->errorValue = stuff->srcX;
- return BadValue;
- }
- if (stuff->srcY > stuff->totalHeight)
- {
- client->errorValue = stuff->srcY;
- return BadValue;
- }
- if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
- {
- client->errorValue = stuff->srcWidth;
- return BadValue;
- }
- if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
- {
- client->errorValue = stuff->srcHeight;
- return BadValue;
- }
-
- if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
- ((stuff->format != ZPixmap) &&
- (stuff->srcX < screenInfo.bitmapScanlinePad) &&
- ((stuff->format == XYBitmap) ||
- ((stuff->srcY == 0) &&
- (stuff->srcHeight == stuff->totalHeight))))) &&
- ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
- (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
- stuff->dstX, stuff->dstY,
- stuff->totalWidth, stuff->srcHeight,
- stuff->srcX, stuff->format,
- shmdesc->addr + stuff->offset +
- (stuff->srcY * length));
- else
- (*shmFuncs[pDraw->pScreen->myNum]->PutImage)(
- pDraw, pGC, stuff->depth, stuff->format,
- stuff->totalWidth, stuff->totalHeight,
- stuff->srcX, stuff->srcY,
- stuff->srcWidth, stuff->srcHeight,
- stuff->dstX, stuff->dstY,
- shmdesc->addr + stuff->offset);
-
- if (stuff->sendEvent)
- {
- xShmCompletionEvent ev;
-
- ev.type = ShmCompletionCode;
- ev.drawable = stuff->drawable;
- ev.sequenceNumber = client->sequence;
- ev.minorEvent = X_ShmPutImage;
- ev.majorEvent = ShmReqCode;
- ev.shmseg = stuff->shmseg;
- ev.offset = stuff->offset;
- WriteEventsToClient(client, 1, (xEvent *) &ev);
- }
-
- return (client->noClientException);
-}
-
-
-
-static int
-ProcShmGetImage(client)
- register ClientPtr client;
-{
- register DrawablePtr pDraw;
- long lenPer = 0, length;
- Mask plane = 0;
- xShmGetImageReply xgi;
- ShmDescPtr shmdesc;
- int n;
-
- REQUEST(xShmGetImageReq);
-
- REQUEST_SIZE_MATCH(xShmGetImageReq);
- if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
- {
- client->errorValue = stuff->format;
- return(BadValue);
- }
- VERIFY_DRAWABLE(pDraw, stuff->drawable, client);
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- if( /* check for being viewable */
- !((WindowPtr) pDraw)->realized ||
- /* check for being on screen */
- pDraw->x + stuff->x < 0 ||
- pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
- pDraw->y + stuff->y < 0 ||
- pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
- /* check for being inside of border */
- stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
- stuff->x + (int)stuff->width >
- wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
- stuff->y + (int)stuff->height >
- wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
- )
- return(BadMatch);
- xgi.visual = wVisual(((WindowPtr)pDraw));
- }
- else
- {
- if (stuff->x < 0 ||
- stuff->x+(int)stuff->width > pDraw->width ||
- stuff->y < 0 ||
- stuff->y+(int)stuff->height > pDraw->height
- )
- return(BadMatch);
- xgi.visual = None;
- }
- xgi.type = X_Reply;
- xgi.length = 0;
- xgi.sequenceNumber = client->sequence;
- xgi.depth = pDraw->depth;
- if(stuff->format == ZPixmap)
- {
- length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
- }
- else
- {
- lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
- plane = ((Mask)1) << (pDraw->depth - 1);
- /* only planes asked for */
- length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
- }
-
- VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
- xgi.size = length;
-
- if (length == 0)
- {
- /* nothing to do */
- }
- else if (stuff->format == ZPixmap)
- {
- (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
- stuff->width, stuff->height,
- stuff->format, stuff->planeMask,
- shmdesc->addr + stuff->offset);
- }
- else
- {
-
- length = stuff->offset;
- for (; plane; plane >>= 1)
- {
- if (stuff->planeMask & plane)
- {
- (*pDraw->pScreen->GetImage)(pDraw,
- stuff->x, stuff->y,
- stuff->width, stuff->height,
- stuff->format, plane,
- shmdesc->addr + length);
- length += lenPer;
- }
- }
- }
-
- if (client->swapped) {
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
- }
- WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
-
- return(client->noClientException);
-}
-
-static PixmapPtr
-fbShmCreatePixmap (pScreen, width, height, depth, addr)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
- char *addr;
-{
- register PixmapPtr pPixmap;
-
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
- if (!pPixmap)
- return NullPixmap;
-
- if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
- BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) {
- (*pScreen->DestroyPixmap)(pPixmap);
- return NullPixmap;
- }
- return pPixmap;
-}
-
-static int
-ProcShmCreatePixmap(client)
- register ClientPtr client;
-{
- PixmapPtr pMap;
- register DrawablePtr pDraw;
- DepthPtr pDepth;
- register int i;
- ShmDescPtr shmdesc;
- REQUEST(xShmCreatePixmapReq);
-
- REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
- client->errorValue = stuff->pid;
- if (!sharedPixmaps)
- return BadImplementation;
- LEGAL_NEW_RESOURCE(stuff->pid, client);
- VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- if (stuff->depth != 1)
- {
- pDepth = pDraw->pScreen->allowedDepths;
- for (i=0; i<pDraw->pScreen->numDepths; i++, pDepth++)
- if (pDepth->depth == stuff->depth)
- goto CreatePmap;
- client->errorValue = stuff->depth;
- return BadValue;
- }
-CreatePmap:
- VERIFY_SHMSIZE(shmdesc, stuff->offset,
- PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
- client);
- pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
- pDraw->pScreen, stuff->width,
- stuff->height, stuff->depth,
- shmdesc->addr + stuff->offset);
- if (pMap)
- {
-#ifdef PIXPRIV
- pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
- shmdesc->refcnt++;
- pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pMap->drawable.id = stuff->pid;
- if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
- {
- return(client->noClientException);
- }
- }
- return (BadAlloc);
-}
-
-static int
-ProcShmDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_ShmQueryVersion:
- return ProcShmQueryVersion(client);
- case X_ShmAttach:
- return ProcShmAttach(client);
- case X_ShmDetach:
- return ProcShmDetach(client);
- case X_ShmPutImage:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShmPutImage(client);
-#endif
- return ProcShmPutImage(client);
- case X_ShmGetImage:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShmGetImage(client);
-#endif
- return ProcShmGetImage(client);
- case X_ShmCreatePixmap:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShmCreatePixmap(client);
-#endif
- return ProcShmCreatePixmap(client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SShmCompletionEvent(from, to)
- xShmCompletionEvent *from, *to;
-{
- to->type = from->type;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->drawable, to->drawable);
- cpswaps(from->minorEvent, to->minorEvent);
- to->majorEvent = from->majorEvent;
- cpswapl(from->shmseg, to->shmseg);
- cpswapl(from->offset, to->offset);
-}
-
-static int
-SProcShmQueryVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xShmQueryVersionReq);
-
- swaps(&stuff->length, n);
- return ProcShmQueryVersion(client);
-}
-
-static int
-SProcShmAttach(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xShmAttachReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xShmAttachReq);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->shmid, n);
- return ProcShmAttach(client);
-}
-
-static int
-SProcShmDetach(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xShmDetachReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xShmDetachReq);
- swapl(&stuff->shmseg, n);
- return ProcShmDetach(client);
-}
-
-static int
-SProcShmPutImage(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xShmPutImageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xShmPutImageReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->totalWidth, n);
- swaps(&stuff->totalHeight, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->srcWidth, n);
- swaps(&stuff->srcHeight, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
- return ProcShmPutImage(client);
-}
-
-static int
-SProcShmGetImage(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xShmGetImageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xShmGetImageReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->planeMask, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
- return ProcShmGetImage(client);
-}
-
-static int
-SProcShmCreatePixmap(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xShmCreatePixmapReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
- return ProcShmCreatePixmap(client);
-}
-
-static int
-SProcShmDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_ShmQueryVersion:
- return SProcShmQueryVersion(client);
- case X_ShmAttach:
- return SProcShmAttach(client);
- case X_ShmDetach:
- return SProcShmDetach(client);
- case X_ShmPutImage:
- return SProcShmPutImage(client);
- case X_ShmGetImage:
- return SProcShmGetImage(client);
- case X_ShmCreatePixmap:
- return SProcShmCreatePixmap(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/sleepuntil.c b/Xext/sleepuntil.c
deleted file mode 100644
index afde19cba..000000000
--- a/Xext/sleepuntil.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * $Xorg: sleepuntil.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $
- *
-Copyright 1992, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.7 2003/11/17 22:20:27 dawes Exp $ */
-
-/* dixsleep.c - implement millisecond timeouts for X clients */
-
-#include "sleepuntil.h"
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "windowstr.h"
-#include "dixstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-typedef struct _Sertafied {
- struct _Sertafied *next;
- TimeStamp revive;
- ClientPtr pClient;
- XID id;
- void (*notifyFunc)(
- ClientPtr /* client */,
- pointer /* closure */
- );
-
- pointer closure;
-} SertafiedRec, *SertafiedPtr;
-
-static SertafiedPtr pPending;
-static RESTYPE SertafiedResType;
-static Bool BlockHandlerRegistered;
-static int SertafiedGeneration;
-
-static void ClientAwaken(
- ClientPtr /* client */,
- pointer /* closure */
-);
-static int SertafiedDelete(
- pointer /* value */,
- XID /* id */
-);
-static void SertafiedBlockHandler(
- pointer /* data */,
- OSTimePtr /* wt */,
- pointer /* LastSelectMask */
-);
-static void SertafiedWakeupHandler(
- pointer /* data */,
- int /* i */,
- pointer /* LastSelectMask */
-);
-
-int
-ClientSleepUntil (client, revive, notifyFunc, closure)
- ClientPtr client;
- TimeStamp *revive;
- void (*notifyFunc)(
- ClientPtr /* client */,
- pointer /* closure */);
- pointer closure;
-{
- SertafiedPtr pRequest, pReq, pPrev;
-
- if (SertafiedGeneration != serverGeneration)
- {
- SertafiedResType = CreateNewResourceType (SertafiedDelete);
- if (!SertafiedResType)
- return FALSE;
- SertafiedGeneration = serverGeneration;
- BlockHandlerRegistered = FALSE;
- }
- pRequest = (SertafiedPtr) xalloc (sizeof (SertafiedRec));
- if (!pRequest)
- return FALSE;
- pRequest->pClient = client;
- pRequest->revive = *revive;
- pRequest->id = FakeClientID (client->index);
- pRequest->closure = closure;
- if (!BlockHandlerRegistered)
- {
- if (!RegisterBlockAndWakeupHandlers (SertafiedBlockHandler,
- SertafiedWakeupHandler,
- (pointer) 0))
- {
- xfree (pRequest);
- return FALSE;
- }
- BlockHandlerRegistered = TRUE;
- }
- pRequest->notifyFunc = 0;
- if (!AddResource (pRequest->id, SertafiedResType, (pointer) pRequest))
- return FALSE;
- if (!notifyFunc)
- notifyFunc = ClientAwaken;
- pRequest->notifyFunc = notifyFunc;
- /* Insert into time-ordered queue, with earliest activation time coming first. */
- pPrev = 0;
- for (pReq = pPending; pReq; pReq = pReq->next)
- {
- if (CompareTimeStamps (pReq->revive, *revive) == LATER)
- break;
- pPrev = pReq;
- }
- if (pPrev)
- pPrev->next = pRequest;
- else
- pPending = pRequest;
- pRequest->next = pReq;
- IgnoreClient (client);
- return TRUE;
-}
-
-static void
-ClientAwaken (client, closure)
- ClientPtr client;
- pointer closure;
-{
- if (!client->clientGone)
- AttendClient (client);
-}
-
-
-static int
-SertafiedDelete (value, id)
- pointer value;
- XID id;
-{
- SertafiedPtr pRequest = (SertafiedPtr)value;
- SertafiedPtr pReq, pPrev;
-
- pPrev = 0;
- for (pReq = pPending; pReq; pPrev = pReq, pReq = pReq->next)
- if (pReq == pRequest)
- {
- if (pPrev)
- pPrev->next = pReq->next;
- else
- pPending = pReq->next;
- break;
- }
- if (pRequest->notifyFunc)
- (*pRequest->notifyFunc) (pRequest->pClient, pRequest->closure);
- xfree (pRequest);
- return TRUE;
-}
-
-static void
-SertafiedBlockHandler (data, wt, LastSelectMask)
- pointer data; /* unused */
- OSTimePtr wt; /* wait time */
- pointer LastSelectMask;
-{
- SertafiedPtr pReq, pNext;
- unsigned long delay;
- TimeStamp now;
-
- if (!pPending)
- return;
- now.milliseconds = GetTimeInMillis ();
- now.months = currentTime.months;
- if ((int) (now.milliseconds - currentTime.milliseconds) < 0)
- now.months++;
- for (pReq = pPending; pReq; pReq = pNext)
- {
- pNext = pReq->next;
- if (CompareTimeStamps (pReq->revive, now) == LATER)
- break;
- FreeResource (pReq->id, RT_NONE);
-
- /* AttendClient() may have been called via the resource delete
- * function so a client may have input to be processed and so
- * set delay to 0 to prevent blocking in WaitForSomething().
- */
- AdjustWaitForDelay (wt, 0);
- }
- pReq = pPending;
- if (!pReq)
- return;
- delay = pReq->revive.milliseconds - now.milliseconds;
- AdjustWaitForDelay (wt, delay);
-}
-
-static void
-SertafiedWakeupHandler (data, i, LastSelectMask)
- pointer data;
- int i;
- pointer LastSelectMask;
-{
- SertafiedPtr pReq, pNext;
- TimeStamp now;
-
- now.milliseconds = GetTimeInMillis ();
- now.months = currentTime.months;
- if ((int) (now.milliseconds - currentTime.milliseconds) < 0)
- now.months++;
- for (pReq = pPending; pReq; pReq = pNext)
- {
- pNext = pReq->next;
- if (CompareTimeStamps (pReq->revive, now) == LATER)
- break;
- FreeResource (pReq->id, RT_NONE);
- }
- if (!pPending)
- {
- RemoveBlockAndWakeupHandlers (SertafiedBlockHandler,
- SertafiedWakeupHandler,
- (pointer) 0);
- BlockHandlerRegistered = FALSE;
- }
-}
diff --git a/Xext/sleepuntil.h b/Xext/sleepuntil.h
deleted file mode 100644
index f8fcc6cb9..000000000
--- a/Xext/sleepuntil.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.2 2003/11/17 22:20:27 dawes Exp $ */
-/*
- * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef _SLEEPUNTIL_H_
-#define _SLEEPUNTIL_H_ 1
-
-#include "dix.h"
-
-extern int ClientSleepUntil(
- ClientPtr client,
- TimeStamp *revive,
- void (*notifyFunc)(
- ClientPtr /* client */,
- pointer /* closure */
- ),
- pointer Closure
-);
-
-#endif
diff --git a/Xext/sync.c b/Xext/sync.c
deleted file mode 100644
index 25d360bfa..000000000
--- a/Xext/sync.c
+++ /dev/null
@@ -1,2509 +0,0 @@
-/* $Xorg: sync.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/*
-
-Copyright 1991, 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts,
-and Olivetti Research Limited, Cambridge, England.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or Olivetti
-not be used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission. Digital and Olivetti
-make no representations about the suitability of this software
-for any purpose. It is provided "as is" without express or implied warranty.
-
-DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.14 2003/11/17 22:20:27 dawes Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "os.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#define _SYNC_SERVER
-#include "sync.h"
-#include "syncstr.h"
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#else
-#include <stdio.h>
-#if !defined(WIN32) && !defined(Lynx)
-#include <sys/time.h>
-#endif
-#endif
-
-#include "modinit.h"
-
-/*
- * Local Global Variables
- */
-static int SyncEventBase;
-static int SyncErrorBase;
-static RESTYPE RTCounter = 0;
-static RESTYPE RTAwait;
-static RESTYPE RTAlarm;
-static RESTYPE RTAlarmClient;
-static int SyncNumSystemCounters = 0;
-static SyncCounter **SysCounterList = NULL;
-
-#define IsSystemCounter(pCounter) \
- (pCounter && (pCounter->client == NULL))
-
-/* these are all the alarm attributes that pertain to the alarm's trigger */
-#define XSyncCAAllTrigger \
- (XSyncCACounter | XSyncCAValueType | XSyncCAValue | XSyncCATestType)
-
-static int
-FreeAlarm(
- pointer /* addr */,
- XID /* id */
-);
-
-static int
-FreeAlarmClient(
- pointer /* value */,
- XID /* id */
-);
-
-static int
-FreeAwait(
- pointer /* addr */,
- XID /* id */
-);
-
-static void
-ServertimeBracketValues(
- pointer /* pCounter */,
- CARD64 * /* pbracket_less */,
- CARD64 * /* pbracket_greater */
-);
-
-static void
-ServertimeQueryValue(
- pointer /* pCounter */,
- CARD64 * /* pValue_return */
-);
-
-static void
-ServertimeWakeupHandler(
- pointer /* env */,
- int /* rc */,
- pointer /* LastSelectMask */
-);
-
-static int
-SyncInitTrigger(
- ClientPtr /* client */,
- SyncTrigger * /* pTrigger */,
- XSyncCounter /* counter */,
- Mask /* changes */
-);
-
-static void
-SAlarmNotifyEvent(
- xSyncAlarmNotifyEvent * /* from */,
- xSyncAlarmNotifyEvent * /* to */
-);
-
-static void
-SCounterNotifyEvent(
- xSyncCounterNotifyEvent * /* from */,
- xSyncCounterNotifyEvent * /* to */
-);
-
-static void
-ServertimeBlockHandler(
- pointer /* env */,
- struct timeval ** /* wt */,
- pointer /* LastSelectMask */
-);
-
-static int
-SyncAddTriggerToCounter(
- SyncTrigger * /* pTrigger */
-);
-
-extern void
-SyncAlarmCounterDestroyed(
- SyncTrigger * /* pTrigger */
-);
-
-static void
-SyncAlarmTriggerFired(
- SyncTrigger * /* pTrigger */
-);
-
-static void
-SyncAwaitTriggerFired(
- SyncTrigger * /* pTrigger */
-);
-
-static int
-SyncChangeAlarmAttributes(
- ClientPtr /* client */,
- SyncAlarm * /* pAlarm */,
- Mask /* mask */,
- CARD32 * /* values */
-);
-
-static Bool
-SyncCheckTriggerNegativeComparison(
- SyncTrigger * /* pTrigger */,
- CARD64 /* oldval */
-);
-
-static Bool
-SyncCheckTriggerNegativeTransition(
- SyncTrigger * /* pTrigger */,
- CARD64 /* oldval */
-);
-
-static Bool
-SyncCheckTriggerPositiveComparison(
- SyncTrigger * /* pTrigger */,
- CARD64 /* oldval */
-);
-
-static Bool
-SyncCheckTriggerPositiveTransition(
- SyncTrigger * /* pTrigger */,
- CARD64 /* oldval */
-);
-
-static SyncCounter *
-SyncCreateCounter(
- ClientPtr /* client */,
- XSyncCounter /* id */,
- CARD64 /* initialvalue */
-);
-
-static void SyncComputeBracketValues(
- SyncCounter * /* pCounter */,
- Bool /* startOver */
-);
-
-static void
-SyncDeleteTriggerFromCounter(
- SyncTrigger * /* pTrigger */
-);
-
-static Bool
-SyncEventSelectForAlarm(
- SyncAlarm * /* pAlarm */,
- ClientPtr /* client */,
- Bool /* wantevents */
-);
-
-static void
-SyncInitServerTime(
- void
-);
-
-static void
-SyncResetProc(
- ExtensionEntry * /* extEntry */
-);
-
-static void
-SyncSendAlarmNotifyEvents(
- SyncAlarm * /* pAlarm */
-);
-
-static void
-SyncSendCounterNotifyEvents(
- ClientPtr /* client */,
- SyncAwait ** /* ppAwait */,
- int /* num_events */
-);
-
-static DISPATCH_PROC(ProcSyncAwait);
-static DISPATCH_PROC(ProcSyncChangeAlarm);
-static DISPATCH_PROC(ProcSyncChangeCounter);
-static DISPATCH_PROC(ProcSyncCreateAlarm);
-static DISPATCH_PROC(ProcSyncCreateCounter);
-static DISPATCH_PROC(ProcSyncDestroyAlarm);
-static DISPATCH_PROC(ProcSyncDestroyCounter);
-static DISPATCH_PROC(ProcSyncDispatch);
-static DISPATCH_PROC(ProcSyncGetPriority);
-static DISPATCH_PROC(ProcSyncInitialize);
-static DISPATCH_PROC(ProcSyncListSystemCounters);
-static DISPATCH_PROC(ProcSyncQueryAlarm);
-static DISPATCH_PROC(ProcSyncQueryCounter);
-static DISPATCH_PROC(ProcSyncSetCounter);
-static DISPATCH_PROC(ProcSyncSetPriority);
-static DISPATCH_PROC(SProcSyncAwait);
-static DISPATCH_PROC(SProcSyncChangeAlarm);
-static DISPATCH_PROC(SProcSyncChangeCounter);
-static DISPATCH_PROC(SProcSyncCreateAlarm);
-static DISPATCH_PROC(SProcSyncCreateCounter);
-static DISPATCH_PROC(SProcSyncDestroyAlarm);
-static DISPATCH_PROC(SProcSyncDestroyCounter);
-static DISPATCH_PROC(SProcSyncDispatch);
-static DISPATCH_PROC(SProcSyncGetPriority);
-static DISPATCH_PROC(SProcSyncInitialize);
-static DISPATCH_PROC(SProcSyncListSystemCounters);
-static DISPATCH_PROC(SProcSyncQueryAlarm);
-static DISPATCH_PROC(SProcSyncQueryCounter);
-static DISPATCH_PROC(SProcSyncSetCounter);
-static DISPATCH_PROC(SProcSyncSetPriority);
-
-/* Each counter maintains a simple linked list of triggers that are
- * interested in the counter. The two functions below are used to
- * delete and add triggers on this list.
- */
-static void
-SyncDeleteTriggerFromCounter(pTrigger)
- SyncTrigger *pTrigger;
-{
- SyncTriggerList *pCur, *pPrev = NULL;
-
- /* pCounter needs to be stored in pTrigger before calling here. */
-
- if (!pTrigger->pCounter)
- return;
-
- for (pCur = pTrigger->pCounter->pTriglist; pCur; pCur = pCur->next)
- {
- if (pCur->pTrigger == pTrigger)
- {
- if (pPrev)
- pPrev->next = pCur->next;
- else
- pTrigger->pCounter->pTriglist = pCur->next;
- xfree(pCur);
- break;
- }
- }
-
- if (IsSystemCounter(pTrigger->pCounter))
- SyncComputeBracketValues(pTrigger->pCounter, /*startOver*/ TRUE);
-}
-
-
-static int
-SyncAddTriggerToCounter(pTrigger)
- SyncTrigger *pTrigger;
-{
- SyncTriggerList *pCur;
-
- if (!pTrigger->pCounter)
- return Success;
-
- /* don't do anything if it's already there */
- for (pCur = pTrigger->pCounter->pTriglist; pCur; pCur = pCur->next)
- {
- if (pCur->pTrigger == pTrigger)
- return Success;
- }
-
- if (!(pCur = (SyncTriggerList *)xalloc(sizeof(SyncTriggerList))))
- return BadAlloc;
-
- pCur->pTrigger = pTrigger;
- pCur->next = pTrigger->pCounter->pTriglist;
- pTrigger->pCounter->pTriglist = pCur;
-
- if (IsSystemCounter(pTrigger->pCounter))
- SyncComputeBracketValues(pTrigger->pCounter, /*startOver*/ TRUE);
-
- return Success;
-}
-
-
-/* Below are four possible functions that can be plugged into
- * pTrigger->CheckTrigger, corresponding to the four possible
- * test-types. These functions are called after the counter's
- * value changes but are also passed the old counter value
- * so they can inspect both the old and new values.
- * (PositiveTransition and NegativeTransition need to see both
- * pieces of information.) These functions return the truth value
- * of the trigger.
- *
- * All of them include the condition pTrigger->pCounter == NULL.
- * This is because the spec says that a trigger with a counter value
- * of None is always TRUE.
- */
-
-static Bool
-SyncCheckTriggerPositiveComparison(pTrigger, oldval)
- SyncTrigger *pTrigger;
- CARD64 oldval;
-{
- return (pTrigger->pCounter == NULL ||
- XSyncValueGreaterOrEqual(pTrigger->pCounter->value,
- pTrigger->test_value));
-}
-
-static Bool
-SyncCheckTriggerNegativeComparison(pTrigger, oldval)
- SyncTrigger *pTrigger;
- CARD64 oldval;
-{
- return (pTrigger->pCounter == NULL ||
- XSyncValueLessOrEqual(pTrigger->pCounter->value,
- pTrigger->test_value));
-}
-
-static Bool
-SyncCheckTriggerPositiveTransition(pTrigger, oldval)
- SyncTrigger *pTrigger;
- CARD64 oldval;
-{
- return (pTrigger->pCounter == NULL ||
- (XSyncValueLessThan(oldval, pTrigger->test_value) &&
- XSyncValueGreaterOrEqual(pTrigger->pCounter->value,
- pTrigger->test_value)));
-}
-
-static Bool
-SyncCheckTriggerNegativeTransition(pTrigger, oldval)
- SyncTrigger *pTrigger;
- CARD64 oldval;
-{
- return (pTrigger->pCounter == NULL ||
- (XSyncValueGreaterThan(oldval, pTrigger->test_value) &&
- XSyncValueLessOrEqual(pTrigger->pCounter->value,
- pTrigger->test_value)));
-}
-
-
-
-static int
-SyncInitTrigger(client, pTrigger, counter, changes)
- ClientPtr client; /* so we can set errorValue */
- SyncTrigger *pTrigger;
- XSyncCounter counter;
- Mask changes;
-{
- SyncCounter *pCounter = pTrigger->pCounter;
- int status;
- Bool newcounter = FALSE;
-
- if (changes & XSyncCACounter)
- {
- if (counter == None)
- pCounter = NULL;
- else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType(
- client, counter, RTCounter, SecurityReadAccess)))
- {
- client->errorValue = counter;
- return SyncErrorBase + XSyncBadCounter;
- }
- if (pCounter != pTrigger->pCounter)
- { /* new counter for trigger */
- SyncDeleteTriggerFromCounter(pTrigger);
- pTrigger->pCounter = pCounter;
- newcounter = TRUE;
- }
- }
-
- /* if system counter, ask it what the current value is */
-
- if (IsSystemCounter(pCounter))
- {
- (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
- &pCounter->value);
- }
-
- if (changes & XSyncCAValueType)
- {
- if (pTrigger->value_type != XSyncRelative &&
- pTrigger->value_type != XSyncAbsolute)
- {
- client->errorValue = pTrigger->value_type;
- return BadValue;
- }
- }
-
- if (changes & XSyncCATestType)
- {
- if (pTrigger->test_type != XSyncPositiveTransition &&
- pTrigger->test_type != XSyncNegativeTransition &&
- pTrigger->test_type != XSyncPositiveComparison &&
- pTrigger->test_type != XSyncNegativeComparison)
- {
- client->errorValue = pTrigger->test_type;
- return BadValue;
- }
- /* select appropriate CheckTrigger function */
-
- switch (pTrigger->test_type)
- {
- case XSyncPositiveTransition:
- pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition;
- break;
- case XSyncNegativeTransition:
- pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition;
- break;
- case XSyncPositiveComparison:
- pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison;
- break;
- case XSyncNegativeComparison:
- pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison;
- break;
- }
- }
-
- if (changes & (XSyncCAValueType | XSyncCAValue))
- {
- if (pTrigger->value_type == XSyncAbsolute)
- pTrigger->test_value = pTrigger->wait_value;
- else /* relative */
- {
- Bool overflow;
- if (pCounter == NULL)
- return BadMatch;
-
- XSyncValueAdd(&pTrigger->test_value, pCounter->value,
- pTrigger->wait_value, &overflow);
- if (overflow)
- {
- client->errorValue = XSyncValueHigh32(pTrigger->wait_value);
- return BadValue;
- }
- }
- }
-
- /* we wait until we're sure there are no errors before registering
- * a new counter on a trigger
- */
- if (newcounter)
- {
- if ((status = SyncAddTriggerToCounter(pTrigger)) != Success)
- return status;
- }
- else if (IsSystemCounter(pCounter))
- {
- SyncComputeBracketValues(pCounter, /*startOver*/ TRUE);
- }
-
- return Success;
-}
-
-/* AlarmNotify events happen in response to actions taken on an Alarm or
- * the counter used by the alarm. AlarmNotify may be sent to multiple
- * clients. The alarm maintains a list of clients interested in events.
- */
-static void
-SyncSendAlarmNotifyEvents(pAlarm)
- SyncAlarm *pAlarm;
-{
- SyncAlarmClientList *pcl;
- xSyncAlarmNotifyEvent ane;
- SyncTrigger *pTrigger = &pAlarm->trigger;
-
- UpdateCurrentTime();
-
- ane.type = SyncEventBase + XSyncAlarmNotify;
- ane.kind = XSyncAlarmNotify;
- ane.sequenceNumber = pAlarm->client->sequence;
- ane.alarm = pAlarm->alarm_id;
- if (pTrigger->pCounter)
- {
- ane.counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value);
- ane.counter_value_lo = XSyncValueLow32(pTrigger->pCounter->value);
- }
- else
- { /* XXX what else can we do if there's no counter? */
- ane.counter_value_hi = ane.counter_value_lo = 0;
- }
-
- ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value);
- ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value);
- ane.time = currentTime.milliseconds;
- ane.state = pAlarm->state;
-
- /* send to owner */
- if (pAlarm->events && !pAlarm->client->clientGone)
- WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
-
- /* send to other interested clients */
- for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next)
- {
- if (!pAlarm->client->clientGone)
- {
- ane.sequenceNumber = pcl->client->sequence;
- WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
- }
- }
-}
-
-
-/* CounterNotify events only occur in response to an Await. The events
- * go only to the Awaiting client.
- */
-static void
-SyncSendCounterNotifyEvents(client, ppAwait, num_events)
- ClientPtr client;
- SyncAwait **ppAwait;
- int num_events;
-{
- xSyncCounterNotifyEvent *pEvents, *pev;
- int i;
-
- if (client->clientGone)
- return;
- pev = pEvents = (xSyncCounterNotifyEvent *)
- ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent));
- if (!pEvents)
- return;
- UpdateCurrentTime();
- for (i = 0; i < num_events; i++, ppAwait++, pev++)
- {
- SyncTrigger *pTrigger = &(*ppAwait)->trigger;
- pev->type = SyncEventBase + XSyncCounterNotify;
- pev->kind = XSyncCounterNotify;
- pev->sequenceNumber = client->sequence;
- pev->counter = pTrigger->pCounter->id;
- pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value);
- pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
- pev->counter_value_lo = XSyncValueLow32(pTrigger->pCounter->value);
- pev->counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value);
- pev->time = currentTime.milliseconds;
- pev->count = num_events - i - 1; /* events remaining */
- pev->destroyed = pTrigger->pCounter->beingDestroyed;
- }
- /* swapping will be taken care of by this */
- WriteEventsToClient(client, num_events, (xEvent *)pEvents);
- DEALLOCATE_LOCAL(pEvents);
-}
-
-
-/* This function is called when an alarm's counter is destroyed.
- * It is plugged into pTrigger->CounterDestroyed (for alarm triggers).
- */
-void
-SyncAlarmCounterDestroyed(pTrigger)
- SyncTrigger *pTrigger;
-{
- SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
-
- pAlarm->state = XSyncAlarmInactive;
- SyncSendAlarmNotifyEvents(pAlarm);
- pTrigger->pCounter = NULL;
-}
-
-
-/* This function is called when an alarm "goes off."
- * It is plugged into pTrigger->TriggerFired (for alarm triggers).
- */
-static void
-SyncAlarmTriggerFired(pTrigger)
- SyncTrigger *pTrigger;
-{
- SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
- CARD64 new_test_value;
-
- /* no need to check alarm unless it's active */
- if (pAlarm->state != XSyncAlarmActive)
- return;
-
- /* " if the counter value is None, or if the delta is 0 and
- * the test-type is PositiveComparison or NegativeComparison,
- * no change is made to value (test-value) and the alarm
- * state is changed to Inactive before the event is generated."
- */
- if (pAlarm->trigger.pCounter == NULL
- || (XSyncValueIsZero(pAlarm->delta)
- && (pAlarm->trigger.test_type == XSyncPositiveComparison
- || pAlarm->trigger.test_type == XSyncNegativeComparison)))
- pAlarm->state = XSyncAlarmInactive;
-
- new_test_value = pAlarm->trigger.test_value;
-
- if (pAlarm->state == XSyncAlarmActive)
- {
- Bool overflow;
- CARD64 oldvalue;
- SyncTrigger *paTrigger = &pAlarm->trigger;
-
- /* "The alarm is updated by repeatedly adding delta to the
- * value of the trigger and re-initializing it until it
- * becomes FALSE."
- */
- oldvalue = paTrigger->test_value;
-
- /* XXX really should do something smarter here */
-
- do
- {
- XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value,
- pAlarm->delta, &overflow);
- } while (!overflow &&
- (*paTrigger->CheckTrigger)(paTrigger,
- paTrigger->pCounter->value));
-
- new_test_value = paTrigger->test_value;
- paTrigger->test_value = oldvalue;
-
- /* "If this update would cause value to fall outside the range
- * for an INT64...no change is made to value (test-value) and
- * the alarm state is changed to Inactive before the event is
- * generated."
- */
- if (overflow)
- {
- new_test_value = oldvalue;
- pAlarm->state = XSyncAlarmInactive;
- }
- }
- /* The AlarmNotify event has to have the "new state of the alarm"
- * which we can't be sure of until this point. However, it has
- * to have the "old" trigger test value. That's the reason for
- * all the newvalue/oldvalue shuffling above. After we send the
- * events, give the trigger its new test value.
- */
- SyncSendAlarmNotifyEvents(pAlarm);
- pTrigger->test_value = new_test_value;
-}
-
-
-/* This function is called when an Await unblocks, either as a result
- * of the trigger firing OR the counter being destroyed.
- * It goes into pTrigger->TriggerFired AND pTrigger->CounterDestroyed
- * (for Await triggers).
- */
-static void
-SyncAwaitTriggerFired(pTrigger)
- SyncTrigger *pTrigger;
-{
- SyncAwait *pAwait = (SyncAwait *)pTrigger;
- int numwaits;
- SyncAwaitUnion *pAwaitUnion;
- SyncAwait **ppAwait;
- int num_events = 0;
-
- pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
- numwaits = pAwaitUnion->header.num_waitconditions;
- ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *));
- if (!ppAwait)
- goto bail;
-
- pAwait = &(pAwaitUnion+1)->await;
-
- /* "When a client is unblocked, all the CounterNotify events for
- * the Await request are generated contiguously. If count is 0
- * there are no more events to follow for this request. If
- * count is n, there are at least n more events to follow."
- *
- * Thus, it is best to find all the counters for which events
- * need to be sent first, so that an accurate count field can
- * be stored in the events.
- */
- for ( ; numwaits; numwaits--, pAwait++)
- {
- CARD64 diff;
- Bool overflow, diffgreater, diffequal;
-
- /* "A CounterNotify event with the destroyed flag set to TRUE is
- * always generated if the counter for one of the triggers is
- * destroyed."
- */
- if (pAwait->trigger.pCounter->beingDestroyed)
- {
- ppAwait[num_events++] = pAwait;
- continue;
- }
-
- /* "The difference between the counter and the test value is
- * calculated by subtracting the test value from the value of
- * the counter."
- */
- XSyncValueSubtract(&diff, pAwait->trigger.pCounter->value,
- pAwait->trigger.test_value, &overflow);
-
- /* "If the difference lies outside the range for an INT64, an
- * event is not generated."
- */
- if (overflow)
- continue;
- diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold);
- diffequal = XSyncValueEqual(diff, pAwait->event_threshold);
-
- /* "If the test-type is PositiveTransition or
- * PositiveComparison, a CounterNotify event is generated if
- * the difference is at least event-threshold. If the test-type
- * is NegativeTransition or NegativeComparison, a CounterNotify
- * event is generated if the difference is at most
- * event-threshold."
- */
-
- if ( ((pAwait->trigger.test_type == XSyncPositiveComparison ||
- pAwait->trigger.test_type == XSyncPositiveTransition)
- && (diffgreater || diffequal))
- ||
- ((pAwait->trigger.test_type == XSyncNegativeComparison ||
- pAwait->trigger.test_type == XSyncNegativeTransition)
- && (!diffgreater) /* less or equal */
- )
- )
- {
- ppAwait[num_events++] = pAwait;
- }
- }
- if (num_events)
- SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait,
- num_events);
- DEALLOCATE_LOCAL(ppAwait);
-
-bail:
- /* unblock the client */
- AttendClient(pAwaitUnion->header.client);
- /* delete the await */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
-}
-
-
-/* This function should always be used to change a counter's value so that
- * any triggers depending on the counter will be checked.
- */
-void
-SyncChangeCounter(pCounter, newval)
- SyncCounter *pCounter;
- CARD64 newval;
-{
- SyncTriggerList *ptl, *pnext;
- CARD64 oldval;
-
- oldval = pCounter->value;
- pCounter->value = newval;
-
- /* run through triggers to see if any become true */
- for (ptl = pCounter->pTriglist; ptl; ptl = pnext)
- {
- pnext = ptl->next;
- if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, oldval))
- (*ptl->pTrigger->TriggerFired)(ptl->pTrigger);
- }
-
- if (IsSystemCounter(pCounter))
- {
- SyncComputeBracketValues(pCounter, /* startOver */ FALSE);
- }
-}
-
-
-/* loosely based on dix/events.c/EventSelectForWindow */
-static Bool
-SyncEventSelectForAlarm(pAlarm, client, wantevents)
- SyncAlarm *pAlarm;
- ClientPtr client;
- Bool wantevents;
-{
- SyncAlarmClientList *pClients;
-
- if (client == pAlarm->client) /* alarm owner */
- {
- pAlarm->events = wantevents;
- return Success;
- }
-
- /* see if the client is already on the list (has events selected) */
-
- for (pClients = pAlarm->pEventClients; pClients;
- pClients = pClients->next)
- {
- if (pClients->client == client)
- {
- /* client's presence on the list indicates desire for
- * events. If the client doesn't want events, remove it
- * from the list. If the client does want events, do
- * nothing, since it's already got them.
- */
- if (!wantevents)
- {
- FreeResource(pClients->delete_id, RT_NONE);
- }
- return Success;
- }
- }
-
- /* if we get here, this client does not currently have
- * events selected on the alarm
- */
-
- if (!wantevents)
- /* client doesn't want events, and we just discovered that it
- * doesn't have them, so there's nothing to do.
- */
- return Success;
-
- /* add new client to pAlarm->pEventClients */
-
- pClients = (SyncAlarmClientList *) xalloc(sizeof(SyncAlarmClientList));
- if (!pClients)
- return BadAlloc;
-
- /* register it as a resource so it will be cleaned up
- * if the client dies
- */
-
- pClients->delete_id = FakeClientID(client->index);
- if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm))
- {
- xfree(pClients);
- return BadAlloc;
- }
-
- /* link it into list after we know all the allocations succeed */
-
- pClients->next = pAlarm->pEventClients;
- pAlarm->pEventClients = pClients;
- pClients->client = client;
- return Success;
-}
-
-/*
- * ** SyncChangeAlarmAttributes ** This is used by CreateAlarm and ChangeAlarm
- */
-static int
-SyncChangeAlarmAttributes(client, pAlarm, mask, values)
- ClientPtr client;
- SyncAlarm *pAlarm;
- Mask mask;
- CARD32 *values;
-{
- int status;
- XSyncCounter counter;
- Mask origmask = mask;
-
- counter = pAlarm->trigger.pCounter ? pAlarm->trigger.pCounter->id : None;
-
- while (mask)
- {
- int index2 = lowbit(mask);
- mask &= ~index2;
- switch (index2)
- {
- case XSyncCACounter:
- mask &= ~XSyncCACounter;
- /* sanity check in SyncInitTrigger */
- counter = *values++;
- break;
-
- case XSyncCAValueType:
- mask &= ~XSyncCAValueType;
- /* sanity check in SyncInitTrigger */
- pAlarm->trigger.value_type = *values++;
- break;
-
- case XSyncCAValue:
- mask &= ~XSyncCAValue;
- XSyncIntsToValue(&pAlarm->trigger.wait_value, values[1], values[0]);
- values += 2;
- break;
-
- case XSyncCATestType:
- mask &= ~XSyncCATestType;
- /* sanity check in SyncInitTrigger */
- pAlarm->trigger.test_type = *values++;
- break;
-
- case XSyncCADelta:
- mask &= ~XSyncCADelta;
- XSyncIntsToValue(&pAlarm->delta, values[1], values[0]);
- values += 2;
- break;
-
- case XSyncCAEvents:
- mask &= ~XSyncCAEvents;
- if ((*values != xTrue) && (*values != xFalse))
- {
- client->errorValue = *values;
- return BadValue;
- }
- status = SyncEventSelectForAlarm(pAlarm, client,
- (Bool)(*values++));
- if (status != Success)
- return status;
- break;
-
- default:
- client->errorValue = mask;
- return BadValue;
- }
- }
-
- /* "If the test-type is PositiveComparison or PositiveTransition
- * and delta is less than zero, or if the test-type is
- * NegativeComparison or NegativeTransition and delta is
- * greater than zero, a Match error is generated."
- */
- if (origmask & (XSyncCADelta|XSyncCATestType))
- {
- CARD64 zero;
- XSyncIntToValue(&zero, 0);
- if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) ||
- (pAlarm->trigger.test_type == XSyncPositiveTransition))
- && XSyncValueLessThan(pAlarm->delta, zero))
- ||
- (((pAlarm->trigger.test_type == XSyncNegativeComparison) ||
- (pAlarm->trigger.test_type == XSyncNegativeTransition))
- && XSyncValueGreaterThan(pAlarm->delta, zero))
- )
- {
- return BadMatch;
- }
- }
-
- /* postpone this until now, when we're sure nothing else can go wrong */
- if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter,
- origmask & XSyncCAAllTrigger)) != Success)
- return status;
-
- /* XXX spec does not really say to do this - needs clarification */
- pAlarm->state = XSyncAlarmActive;
- return Success;
-}
-
-
-static SyncCounter *
-SyncCreateCounter(client, id, initialvalue)
- ClientPtr client;
- XSyncCounter id;
- CARD64 initialvalue;
-{
- SyncCounter *pCounter;
-
- if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter))))
- return (SyncCounter *)NULL;
-
- if (!AddResource(id, RTCounter, (pointer) pCounter))
- {
- xfree((pointer) pCounter);
- return (SyncCounter *)NULL;
- }
-
- pCounter->client = client;
- pCounter->id = id;
- pCounter->value = initialvalue;
- pCounter->pTriglist = NULL;
- pCounter->beingDestroyed = FALSE;
- pCounter->pSysCounterInfo = NULL;
- return pCounter;
-}
-
-static int FreeCounter(
- pointer /*env*/,
- XID /*id*/
-);
-
-/*
- * ***** System Counter utilities
- */
-
-pointer
-SyncCreateSystemCounter(name, initial, resolution, counterType,
- QueryValue, BracketValues)
- char *name;
- CARD64 initial;
- CARD64 resolution;
- SyncCounterType counterType;
- void (*QueryValue) (
- pointer /* pCounter */,
- CARD64 * /* pValue_return */);
- void (*BracketValues) (
- pointer /* pCounter */,
- CARD64 * /* pbracket_less */,
- CARD64 * /* pbracket_greater */);
-{
- SyncCounter *pCounter;
-
- SysCounterList = (SyncCounter **)xrealloc(SysCounterList,
- (SyncNumSystemCounters+1)*sizeof(SyncCounter *));
- if (!SysCounterList)
- return (pointer)NULL;
-
- /* this function may be called before SYNC has been initialized, so we
- * have to make sure RTCounter is created.
- */
- if (RTCounter == 0)
- {
- RTCounter = CreateNewResourceType(FreeCounter);
- if (RTCounter == 0)
- {
- return (pointer)NULL;
- }
- }
-
- pCounter = SyncCreateCounter((ClientPtr)NULL, FakeClientID(0), initial);
-
- if (pCounter)
- {
- SysCounterInfo *psci;
-
- psci = (SysCounterInfo *)xalloc(sizeof(SysCounterInfo));
- if (!psci)
- {
- FreeResource(pCounter->id, RT_NONE);
- return (pointer) pCounter;
- }
- pCounter->pSysCounterInfo = psci;
- psci->name = name;
- psci->resolution = resolution;
- psci->counterType = counterType;
- psci->QueryValue = QueryValue;
- psci->BracketValues = BracketValues;
- XSyncMaxValue(&psci->bracket_greater);
- XSyncMinValue(&psci->bracket_less);
- SysCounterList[SyncNumSystemCounters++] = pCounter;
- }
- return (pointer) pCounter;
-}
-
-void
-SyncDestroySystemCounter(pSysCounter)
- pointer pSysCounter;
-{
- SyncCounter *pCounter = (SyncCounter *)pSysCounter;
- FreeResource(pCounter->id, RT_NONE);
-}
-
-static void
-SyncComputeBracketValues(pCounter, startOver)
- SyncCounter *pCounter;
- Bool startOver;
-{
- SyncTriggerList *pCur;
- SyncTrigger *pTrigger;
- SysCounterInfo *psci = pCounter->pSysCounterInfo;
- CARD64 *pnewgtval = NULL;
- CARD64 *pnewltval = NULL;
- SyncCounterType ct;
-
- if (!pCounter)
- return;
-
- ct = pCounter->pSysCounterInfo->counterType;
- if (ct == XSyncCounterNeverChanges)
- return;
-
- if (startOver)
- {
- XSyncMaxValue(&psci->bracket_greater);
- XSyncMinValue(&psci->bracket_less);
- }
-
- for (pCur = pCounter->pTriglist; pCur; pCur = pCur->next)
- {
- pTrigger = pCur->pTrigger;
-
- if (pTrigger->test_type == XSyncPositiveComparison &&
- ct != XSyncCounterNeverIncreases)
- {
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- }
- else if (pTrigger->test_type == XSyncNegativeComparison &&
- ct != XSyncCounterNeverDecreases)
- {
- if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
- }
- else if ( (pTrigger->test_type == XSyncPositiveTransition &&
- ct != XSyncCounterNeverIncreases)
- ||
- (pTrigger->test_type == XSyncNegativeTransition &&
- ct != XSyncCounterNeverDecreases)
- )
- {
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value))
- {
- if (XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- else
- if (XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
- }
- }
- } /* end for each trigger */
-
- if (pnewgtval || pnewltval)
- {
- (*psci->BracketValues)((pointer)pCounter, pnewltval, pnewgtval);
- }
-}
-
-/*
- * ***** Resource delete functions
- */
-
-/* ARGSUSED */
-static int
-FreeAlarm(addr, id)
- pointer addr;
- XID id;
-{
- SyncAlarm *pAlarm = (SyncAlarm *) addr;
-
- pAlarm->state = XSyncAlarmDestroyed;
-
- SyncSendAlarmNotifyEvents(pAlarm);
-
- /* delete event selections */
-
- while (pAlarm->pEventClients)
- FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
-
- SyncDeleteTriggerFromCounter(&pAlarm->trigger);
-
- xfree(pAlarm);
- return Success;
-}
-
-
-/*
- * ** Cleanup after the destruction of a Counter
- */
-/* ARGSUSED */
-static int
-FreeCounter(env, id)
- pointer env;
- XID id;
-{
- SyncCounter *pCounter = (SyncCounter *) env;
- SyncTriggerList *ptl, *pnext;
-
- pCounter->beingDestroyed = TRUE;
- /* tell all the counter's triggers that the counter has been destroyed */
- for (ptl = pCounter->pTriglist; ptl; ptl = pnext)
- {
- (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
- pnext = ptl->next;
- xfree(ptl); /* destroy the trigger list as we go */
- }
- if (IsSystemCounter(pCounter))
- {
- int i, found = 0;
-
- xfree(pCounter->pSysCounterInfo);
-
- /* find the counter in the list of system counters and remove it */
-
- if (SysCounterList)
- {
- for (i = 0; i < SyncNumSystemCounters; i++)
- {
- if (SysCounterList[i] == pCounter)
- {
- found = i;
- break;
- }
- }
- if (found < (SyncNumSystemCounters-1))
- {
- for (i = found; i < SyncNumSystemCounters-1; i++)
- {
- SysCounterList[i] = SysCounterList[i+1];
- }
- }
- }
- SyncNumSystemCounters--;
- }
- xfree(pCounter);
- return Success;
-}
-
-/*
- * ** Cleanup after Await
- */
-/* ARGSUSED */
-static int
-FreeAwait(addr, id)
- pointer addr;
- XID id;
-{
- SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr;
- SyncAwait *pAwait;
- int numwaits;
-
- pAwait = &(pAwaitUnion+1)->await; /* first await on list */
-
- /* remove triggers from counters */
-
- for (numwaits = pAwaitUnion->header.num_waitconditions; numwaits;
- numwaits--, pAwait++)
- {
- /* If the counter is being destroyed, FreeCounter will delete
- * the trigger list itself, so don't do it here.
- */
- SyncCounter *pCounter = pAwait->trigger.pCounter;
- if (pCounter && !pCounter->beingDestroyed)
- SyncDeleteTriggerFromCounter(&pAwait->trigger);
- }
- xfree(pAwaitUnion);
- return Success;
-}
-
-/* loosely based on dix/events.c/OtherClientGone */
-static int
-FreeAlarmClient(value, id)
- pointer value; /* must conform to DeleteType */
- XID id;
-{
- SyncAlarm *pAlarm = (SyncAlarm *)value;
- SyncAlarmClientList *pCur, *pPrev;
-
- for (pPrev = NULL, pCur = pAlarm->pEventClients;
- pCur;
- pPrev = pCur, pCur = pCur->next)
- {
- if (pCur->delete_id == id)
- {
- if (pPrev)
- pPrev->next = pCur->next;
- else
- pAlarm->pEventClients = pCur->next;
- xfree(pCur);
- return(Success);
- }
- }
- FatalError("alarm client not on event list");
- /*NOTREACHED*/
-}
-
-
-/*
- * ***** Proc functions
- */
-
-
-/*
- * ** Initialize the extension
- */
-static int
-ProcSyncInitialize(client)
- ClientPtr client;
-{
- xSyncInitializeReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xSyncInitializeReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SYNC_MAJOR_VERSION;
- rep.minorVersion = SYNC_MINOR_VERSION;
- rep.length = 0;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- }
- WriteToClient(client, sizeof(rep), (char *) &rep);
- return (client->noClientException);
-}
-
-/*
- * ** Get list of system counters available through the extension
- */
-static int
-ProcSyncListSystemCounters(client)
- ClientPtr client;
-{
- xSyncListSystemCountersReply rep;
- int i, len;
- xSyncSystemCounter *list = NULL, *walklist = NULL;
-
- REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.nCounters = SyncNumSystemCounters;
-
- for (i = len = 0; i < SyncNumSystemCounters; i++)
- {
- char *name = SysCounterList[i]->pSysCounterInfo->name;
- /* pad to 4 byte boundary */
- len += (sz_xSyncSystemCounter + strlen(name) + 3) & ~3;
- }
-
- if (len)
- {
- walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len);
- if (!list)
- return BadAlloc;
- }
-
- rep.length = len >> 2;
-
- if (client->swapped)
- {
- register char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.nCounters, n);
- }
-
- for (i = 0; i < SyncNumSystemCounters; i++)
- {
- int namelen;
- char *pname_in_reply;
- SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo;
-
- walklist->counter = SysCounterList[i]->id;
- walklist->resolution_hi = XSyncValueHigh32(psci->resolution);
- walklist->resolution_lo = XSyncValueLow32(psci->resolution);
- namelen = strlen(psci->name);
- walklist->name_length = namelen;
-
- if (client->swapped)
- {
- register char n;
- swapl(&walklist->counter, n);
- swapl(&walklist->resolution_hi, n);
- swapl(&walklist->resolution_lo, n);
- swaps(&walklist->name_length, n);
- }
-
- pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
- strncpy(pname_in_reply, psci->name, namelen);
- walklist = (xSyncSystemCounter *) (((char *)walklist) +
- ((sz_xSyncSystemCounter + namelen + 3) & ~3));
- }
-
- WriteToClient(client, sizeof(rep), (char *) &rep);
- if (len)
- {
- WriteToClient(client, len, (char *) list);
- DEALLOCATE_LOCAL(list);
- }
-
- return (client->noClientException);
-}
-
-/*
- * ** Set client Priority
- */
-static int
-ProcSyncSetPriority(client)
- ClientPtr client;
-{
- REQUEST(xSyncSetPriorityReq);
- ClientPtr priorityclient;
-
- REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
-
- if (stuff->id == None)
- priorityclient = client;
- else if (!(priorityclient = LookupClient(stuff->id, client)))
- {
- client->errorValue = stuff->id;
- return BadMatch;
- }
-
- if (priorityclient->priority != stuff->priority)
- {
- priorityclient->priority = stuff->priority;
-
- /* The following will force the server back into WaitForSomething
- * so that the change in this client's priority is immediately
- * reflected.
- */
- isItTimeToYield = TRUE;
- dispatchException |= DE_PRIORITYCHANGE;
- }
- return Success;
-}
-
-/*
- * ** Get client Priority
- */
-static int
-ProcSyncGetPriority(client)
- ClientPtr client;
-{
- REQUEST(xSyncGetPriorityReq);
- xSyncGetPriorityReply rep;
- ClientPtr priorityclient;
-
- REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
-
- if (stuff->id == None)
- priorityclient = client;
- else if (!(priorityclient = LookupClient(stuff->id, client)))
- {
- client->errorValue = stuff->id;
- return BadMatch;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.priority = priorityclient->priority;
-
- if (client->swapped)
- {
- register char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.priority, n);
- }
-
- WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
-
- return (client->noClientException);
-}
-
-/*
- * ** Create a new counter
- */
-static int
-ProcSyncCreateCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncCreateCounterReq);
- CARD64 initial;
-
- REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
-
- LEGAL_NEW_RESOURCE(stuff->cid, client);
-
- XSyncIntsToValue(&initial, stuff->initial_value_lo, stuff->initial_value_hi);
- if (!SyncCreateCounter(client, stuff->cid, initial))
- return BadAlloc;
-
- return (client->noClientException);
-}
-
-/*
- * ** Set Counter value
- */
-static int
-ProcSyncSetCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncSetCounterReq);
- SyncCounter *pCounter;
- CARD64 newvalue;
-
- REQUEST_SIZE_MATCH(xSyncSetCounterReq);
-
- pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid,
- RTCounter, SecurityWriteAccess);
- if (pCounter == NULL)
- {
- client->errorValue = stuff->cid;
- return SyncErrorBase + XSyncBadCounter;
- }
-
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->cid;
- return BadAccess;
- }
-
- XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
- SyncChangeCounter(pCounter, newvalue);
- return Success;
-}
-
-/*
- * ** Change Counter value
- */
-static int
-ProcSyncChangeCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncChangeCounterReq);
- SyncCounter *pCounter;
- CARD64 newvalue;
- Bool overflow;
-
- REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
-
- pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid,
- RTCounter, SecurityWriteAccess);
- if (pCounter == NULL)
- {
- client->errorValue = stuff->cid;
- return SyncErrorBase + XSyncBadCounter;
- }
-
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->cid;
- return BadAccess;
- }
-
- XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
- XSyncValueAdd(&newvalue, pCounter->value, newvalue, &overflow);
- if (overflow)
- {
- /* XXX 64 bit value can't fit in 32 bits; do the best we can */
- client->errorValue = stuff->value_hi;
- return BadValue;
- }
- SyncChangeCounter(pCounter, newvalue);
- return Success;
-}
-
-/*
- * ** Destroy a counter
- */
-static int
-ProcSyncDestroyCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncDestroyCounterReq);
- SyncCounter *pCounter;
-
- REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
-
- pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter,
- RTCounter, SecurityDestroyAccess);
- if (pCounter == NULL)
- {
- client->errorValue = stuff->counter;
- return SyncErrorBase + XSyncBadCounter;
- }
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->counter;
- return BadAccess;
- }
- FreeResource(pCounter->id, RT_NONE);
- return Success;
-}
-
-
-/*
- * ** Await
- */
-static int
-ProcSyncAwait(client)
- ClientPtr client;
-{
- REQUEST(xSyncAwaitReq);
- int len, items;
- int i;
- xSyncWaitCondition *pProtocolWaitConds;
- SyncAwaitUnion *pAwaitUnion;
- SyncAwait *pAwait;
- int status;
-
- REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
-
- len = client->req_len << 2;
- len -= sz_xSyncAwaitReq;
- items = len / sz_xSyncWaitCondition;
-
- if (items * sz_xSyncWaitCondition != len)
- {
- return BadLength;
- }
- if (items == 0)
- {
- client->errorValue = items; /* XXX protocol change */
- return BadValue;
- }
-
- pProtocolWaitConds = (xSyncWaitCondition *) & stuff[1];
-
- /* all the memory for the entire await list is allocated
- * here in one chunk
- */
- pAwaitUnion = (SyncAwaitUnion *)xalloc((items+1) * sizeof(SyncAwaitUnion));
- if (!pAwaitUnion)
- return BadAlloc;
-
- /* first item is the header, remainder are real wait conditions */
-
- pAwaitUnion->header.delete_id = FakeClientID(client->index);
- if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion))
- {
- xfree(pAwaitUnion);
- return BadAlloc;
- }
-
- /* don't need to do any more memory allocation for this request! */
-
- pAwaitUnion->header.client = client;
- pAwaitUnion->header.num_waitconditions = 0;
-
- pAwait = &(pAwaitUnion+1)->await; /* skip over header */
- for (i = 0; i < items; i++, pProtocolWaitConds++, pAwait++)
- {
- if (pProtocolWaitConds->counter == None) /* XXX protocol change */
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on counters
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- client->errorValue = pProtocolWaitConds->counter;
- return SyncErrorBase + XSyncBadCounter;
- }
-
- /* sanity checks are in SyncInitTrigger */
- pAwait->trigger.pCounter = NULL;
- pAwait->trigger.value_type = pProtocolWaitConds->value_type;
- XSyncIntsToValue(&pAwait->trigger.wait_value,
- pProtocolWaitConds->wait_value_lo,
- pProtocolWaitConds->wait_value_hi);
- pAwait->trigger.test_type = pProtocolWaitConds->test_type;
-
- status = SyncInitTrigger(client, &pAwait->trigger,
- pProtocolWaitConds->counter, XSyncCAAllTrigger);
- if (status != Success)
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on counters
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- return status;
- }
- /* this is not a mistake -- same function works for both cases */
- pAwait->trigger.TriggerFired = SyncAwaitTriggerFired;
- pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired;
- XSyncIntsToValue(&pAwait->event_threshold,
- pProtocolWaitConds->event_threshold_lo,
- pProtocolWaitConds->event_threshold_hi);
- pAwait->pHeader = &pAwaitUnion->header;
- pAwaitUnion->header.num_waitconditions++;
- }
-
- IgnoreClient(client);
-
- /* see if any of the triggers are already true */
-
- pAwait = &(pAwaitUnion+1)->await; /* skip over header */
- for (i = 0; i < items; i++, pAwait++)
- {
- /* don't have to worry about NULL counters because the request
- * errors before we get here out if they occur
- */
- if ((*pAwait->trigger.CheckTrigger)(&pAwait->trigger,
- pAwait->trigger.pCounter->value))
- {
- (*pAwait->trigger.TriggerFired)(&pAwait->trigger);
- break; /* once is enough */
- }
- }
- return Success;
-}
-
-
-/*
- * ** Query a counter
- */
-static int
-ProcSyncQueryCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncQueryCounterReq);
- xSyncQueryCounterReply rep;
- SyncCounter *pCounter;
-
- REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
-
- pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter,
- RTCounter, SecurityReadAccess);
- if (pCounter == NULL)
- {
- client->errorValue = stuff->counter;
- return SyncErrorBase + XSyncBadCounter;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- /* if system counter, ask it what the current value is */
-
- if (IsSystemCounter(pCounter))
- {
- (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
- &pCounter->value);
- }
-
- rep.value_hi = XSyncValueHigh32(pCounter->value);
- rep.value_lo = XSyncValueLow32(pCounter->value);
- if (client->swapped)
- {
- register char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.value_hi, n);
- swapl(&rep.value_lo, n);
- }
- WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
- return (client->noClientException);
-}
-
-
-/*
- * ** Create Alarm
- */
-static int
-ProcSyncCreateAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncCreateAlarmReq);
- SyncAlarm *pAlarm;
- int status;
- unsigned long len, vmask;
- SyncTrigger *pTrigger;
-
- REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
-
- LEGAL_NEW_RESOURCE(stuff->id, client);
-
- vmask = stuff->valueMask;
- len = client->req_len - (sizeof(xSyncCreateAlarmReq) >> 2);
- /* the "extra" call to Ones accounts for the presence of 64 bit values */
- if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
- return BadLength;
-
- if (!(pAlarm = (SyncAlarm *) xalloc(sizeof(SyncAlarm))))
- {
- return BadAlloc;
- }
-
- /* set up defaults */
-
- pTrigger = &pAlarm->trigger;
- pTrigger->pCounter = NULL;
- pTrigger->value_type = XSyncAbsolute;
- XSyncIntToValue(&pTrigger->wait_value, 0L);
- pTrigger->test_type = XSyncPositiveComparison;
- pTrigger->TriggerFired = SyncAlarmTriggerFired;
- pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed;
- status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger);
- if (status != Success)
- {
- xfree(pAlarm);
- return status;
- }
-
- pAlarm->client = client;
- pAlarm->alarm_id = stuff->id;
- XSyncIntToValue(&pAlarm->delta, 1L);
- pAlarm->events = TRUE;
- pAlarm->state = XSyncAlarmInactive;
- pAlarm->pEventClients = NULL;
- status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
- (CARD32 *)&stuff[1]);
- if (status != Success)
- {
- xfree(pAlarm);
- return status;
- }
-
- if (!AddResource(stuff->id, RTAlarm, pAlarm))
- {
- xfree(pAlarm);
- return BadAlloc;
- }
-
- /* see if alarm already triggered. NULL counter will not trigger
- * in CreateAlarm and sets alarm state to Inactive.
- */
-
- if (!pTrigger->pCounter)
- {
- pAlarm->state = XSyncAlarmInactive; /* XXX protocol change */
- }
- else if ((*pTrigger->CheckTrigger)(pTrigger, pTrigger->pCounter->value))
- {
- (*pTrigger->TriggerFired)(pTrigger);
- }
-
- return Success;
-}
-
-/*
- * ** Change Alarm
- */
-static int
-ProcSyncChangeAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncChangeAlarmReq);
- SyncAlarm *pAlarm;
- long vmask;
- int len, status;
-
- REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
-
- if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
- RTAlarm, SecurityWriteAccess)))
- {
- client->errorValue = stuff->alarm;
- return SyncErrorBase + XSyncBadAlarm;
- }
-
- vmask = stuff->valueMask;
- len = client->req_len - (sizeof(xSyncChangeAlarmReq) >> 2);
- /* the "extra" call to Ones accounts for the presence of 64 bit values */
- if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
- return BadLength;
-
- if ((status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
- (CARD32 *)&stuff[1])) != Success)
- return status;
-
- /* see if alarm already triggered. NULL counter WILL trigger
- * in ChangeAlarm.
- */
-
- if (!pAlarm->trigger.pCounter ||
- (*pAlarm->trigger.CheckTrigger)(&pAlarm->trigger,
- pAlarm->trigger.pCounter->value))
- {
- (*pAlarm->trigger.TriggerFired)(&pAlarm->trigger);
- }
- return Success;
-}
-
-static int
-ProcSyncQueryAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncQueryAlarmReq);
- SyncAlarm *pAlarm;
- xSyncQueryAlarmReply rep;
- SyncTrigger *pTrigger;
-
- REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
-
- pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
- RTAlarm, SecurityReadAccess);
- if (!pAlarm)
- {
- client->errorValue = stuff->alarm;
- return (SyncErrorBase + XSyncBadAlarm);
- }
-
- rep.type = X_Reply;
- rep.length = (sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)) >> 2;
- rep.sequenceNumber = client->sequence;
-
- pTrigger = &pAlarm->trigger;
- rep.counter = (pTrigger->pCounter) ? pTrigger->pCounter->id : None;
-
-#if 0 /* XXX unclear what to do, depends on whether relative value-types
- * are "consumed" immediately and are considered absolute from then
- * on.
- */
- rep.value_type = pTrigger->value_type;
- rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value);
- rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value);
-#else
- rep.value_type = XSyncAbsolute;
- rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
- rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value);
-#endif
-
- rep.test_type = pTrigger->test_type;
- rep.delta_hi = XSyncValueHigh32(pAlarm->delta);
- rep.delta_lo = XSyncValueLow32(pAlarm->delta);
- rep.events = pAlarm->events;
- rep.state = pAlarm->state;
-
- if (client->swapped)
- {
- register char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.counter, n);
- swapl(&rep.wait_value_hi, n);
- swapl(&rep.wait_value_lo, n);
- swapl(&rep.test_type, n);
- swapl(&rep.delta_hi, n);
- swapl(&rep.delta_lo, n);
- }
-
- WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
- return (client->noClientException);
-}
-
-
-static int
-ProcSyncDestroyAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncDestroyAlarmReq);
-
- REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
-
- if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
- RTAlarm, SecurityDestroyAccess)))
- {
- client->errorValue = stuff->alarm;
- return SyncErrorBase + XSyncBadAlarm;
- }
-
- FreeResource(stuff->alarm, RT_NONE);
- return (client->noClientException);
-}
-
-/*
- * ** Given an extension request, call the appropriate request procedure
- */
-static int
-ProcSyncDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
-
- case X_SyncInitialize:
- return ProcSyncInitialize(client);
- case X_SyncListSystemCounters:
- return ProcSyncListSystemCounters(client);
- case X_SyncCreateCounter:
- return ProcSyncCreateCounter(client);
- case X_SyncSetCounter:
- return ProcSyncSetCounter(client);
- case X_SyncChangeCounter:
- return ProcSyncChangeCounter(client);
- case X_SyncQueryCounter:
- return ProcSyncQueryCounter(client);
- case X_SyncDestroyCounter:
- return ProcSyncDestroyCounter(client);
- case X_SyncAwait:
- return ProcSyncAwait(client);
- case X_SyncCreateAlarm:
- return ProcSyncCreateAlarm(client);
- case X_SyncChangeAlarm:
- return ProcSyncChangeAlarm(client);
- case X_SyncQueryAlarm:
- return ProcSyncQueryAlarm(client);
- case X_SyncDestroyAlarm:
- return ProcSyncDestroyAlarm(client);
- case X_SyncSetPriority:
- return ProcSyncSetPriority(client);
- case X_SyncGetPriority:
- return ProcSyncGetPriority(client);
- default:
- return BadRequest;
- }
-}
-
-/*
- * Boring Swapping stuff ...
- */
-
-static int
-SProcSyncInitialize(client)
- ClientPtr client;
-{
- REQUEST(xSyncInitializeReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncInitializeReq);
-
- return ProcSyncInitialize(client);
-}
-
-static int
-SProcSyncListSystemCounters(client)
- ClientPtr client;
-{
- REQUEST(xSyncListSystemCountersReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
-
- return ProcSyncListSystemCounters(client);
-}
-
-static int
-SProcSyncCreateCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncCreateCounterReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->initial_value_lo, n);
- swapl(&stuff->initial_value_hi, n);
-
- return ProcSyncCreateCounter(client);
-}
-
-static int
-SProcSyncSetCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncSetCounterReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncSetCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->value_lo, n);
- swapl(&stuff->value_hi, n);
-
- return ProcSyncSetCounter(client);
-}
-
-static int
-SProcSyncChangeCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncChangeCounterReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->value_lo, n);
- swapl(&stuff->value_hi, n);
-
- return ProcSyncChangeCounter(client);
-}
-
-static int
-SProcSyncQueryCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncQueryCounterReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
- swapl(&stuff->counter, n);
-
- return ProcSyncQueryCounter(client);
-}
-
-static int
-SProcSyncDestroyCounter(client)
- ClientPtr client;
-{
- REQUEST(xSyncDestroyCounterReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
- swapl(&stuff->counter, n);
-
- return ProcSyncDestroyCounter(client);
-}
-
-static int
-SProcSyncAwait(client)
- ClientPtr client;
-{
- REQUEST(xSyncAwaitReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
- SwapRestL(stuff);
-
- return ProcSyncAwait(client);
-}
-
-
-static int
-SProcSyncCreateAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncCreateAlarmReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
- swapl(&stuff->id, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
-
- return ProcSyncCreateAlarm(client);
-}
-
-static int
-SProcSyncChangeAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncChangeAlarmReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
- swapl(&stuff->alarm, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
- return ProcSyncChangeAlarm(client);
-}
-
-static int
-SProcSyncQueryAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncQueryAlarmReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
- swapl(&stuff->alarm, n);
-
- return ProcSyncQueryAlarm(client);
-}
-
-static int
-SProcSyncDestroyAlarm(client)
- ClientPtr client;
-{
- REQUEST(xSyncDestroyAlarmReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
- swapl(&stuff->alarm, n);
-
- return ProcSyncDestroyAlarm(client);
-}
-
-static int
-SProcSyncSetPriority(client)
- ClientPtr client;
-{
- REQUEST(xSyncSetPriorityReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
- swapl(&stuff->id, n);
- swapl(&stuff->priority, n);
-
- return ProcSyncSetPriority(client);
-}
-
-static int
-SProcSyncGetPriority(client)
- ClientPtr client;
-{
- REQUEST(xSyncGetPriorityReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
- swapl(&stuff->id, n);
-
- return ProcSyncGetPriority(client);
-}
-
-
-static int
-SProcSyncDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SyncInitialize:
- return SProcSyncInitialize(client);
- case X_SyncListSystemCounters:
- return SProcSyncListSystemCounters(client);
- case X_SyncCreateCounter:
- return SProcSyncCreateCounter(client);
- case X_SyncSetCounter:
- return SProcSyncSetCounter(client);
- case X_SyncChangeCounter:
- return SProcSyncChangeCounter(client);
- case X_SyncQueryCounter:
- return SProcSyncQueryCounter(client);
- case X_SyncDestroyCounter:
- return SProcSyncDestroyCounter(client);
- case X_SyncAwait:
- return SProcSyncAwait(client);
- case X_SyncCreateAlarm:
- return SProcSyncCreateAlarm(client);
- case X_SyncChangeAlarm:
- return SProcSyncChangeAlarm(client);
- case X_SyncQueryAlarm:
- return SProcSyncQueryAlarm(client);
- case X_SyncDestroyAlarm:
- return SProcSyncDestroyAlarm(client);
- case X_SyncSetPriority:
- return SProcSyncSetPriority(client);
- case X_SyncGetPriority:
- return SProcSyncGetPriority(client);
- default:
- return BadRequest;
- }
-}
-
-/*
- * Event Swapping
- */
-
-static void
-SCounterNotifyEvent(from, to)
- xSyncCounterNotifyEvent *from, *to;
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->counter, to->counter);
- cpswapl(from->wait_value_lo, to->wait_value_lo);
- cpswapl(from->wait_value_hi, to->wait_value_hi);
- cpswapl(from->counter_value_lo, to->counter_value_lo);
- cpswapl(from->counter_value_hi, to->counter_value_hi);
- cpswapl(from->time, to->time);
- cpswaps(from->count, to->count);
- to->destroyed = from->destroyed;
-}
-
-
-static void
-SAlarmNotifyEvent(from, to)
- xSyncAlarmNotifyEvent *from, *to;
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->alarm, to->alarm);
- cpswapl(from->counter_value_lo, to->counter_value_lo);
- cpswapl(from->counter_value_hi, to->counter_value_hi);
- cpswapl(from->alarm_value_lo, to->alarm_value_lo);
- cpswapl(from->alarm_value_hi, to->alarm_value_hi);
- cpswapl(from->time, to->time);
- to->state = from->state;
-}
-
-/*
- * ** Close everything down. ** This is fairly simple for now.
- */
-/* ARGSUSED */
-static void
-SyncResetProc(extEntry)
- ExtensionEntry *extEntry;
-{
- xfree(SysCounterList);
- SysCounterList = NULL;
- RTCounter = 0;
-}
-
-
-/*
- * ** Initialise the extension.
- */
-void
-SyncExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
-
- if (RTCounter == 0)
- {
- RTCounter = CreateNewResourceType(FreeCounter);
- }
- RTAlarm = CreateNewResourceType(FreeAlarm);
- RTAwait = CreateNewResourceType(FreeAwait)|RC_NEVERRETAIN;
- RTAlarmClient = CreateNewResourceType(FreeAlarmClient)|RC_NEVERRETAIN;
-
- if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 ||
- RTAlarmClient == 0 ||
- (extEntry = AddExtension(SYNC_NAME,
- XSyncNumberEvents, XSyncNumberErrors,
- ProcSyncDispatch, SProcSyncDispatch,
- SyncResetProc,
- StandardMinorOpcode)) == NULL)
- {
- ErrorF("Sync Extension %d.%d failed to Initialise\n",
- SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
- return;
- }
-
- SyncEventBase = extEntry->eventBase;
- SyncErrorBase = extEntry->errorBase;
- EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
- EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent;
-
- /*
- * Although SERVERTIME is implemented by the OS layer, we initialise it
- * here because doing it in OsInit() is too early. The resource database
- * is not initialised when OsInit() is called. This is just about OK
- * because there is always a servertime counter.
- */
- SyncInitServerTime();
-
-#ifdef DEBUG
- fprintf(stderr, "Sync Extension %d.%d\n",
- SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
-#endif
-}
-
-
-/*
- * ***** SERVERTIME implementation - should go in its own file in OS directory?
- */
-
-
-
-static pointer ServertimeCounter;
-static XSyncValue Now;
-static XSyncValue *pnext_time;
-
-#define GetTime()\
-{\
- unsigned long millis = GetTimeInMillis();\
- unsigned long maxis = XSyncValueHigh32(Now);\
- if (millis < XSyncValueLow32(Now)) maxis++;\
- XSyncIntsToValue(&Now, millis, maxis);\
-}
-
-/*
-*** Server Block Handler
-*** code inspired by multibuffer extension
- */
-/*ARGSUSED*/
-static void ServertimeBlockHandler(env, wt, LastSelectMask)
-pointer env;
-struct timeval **wt;
-pointer LastSelectMask;
-{
- XSyncValue delay;
- unsigned long timeout;
-
- if (pnext_time)
- {
- GetTime();
-
- if (XSyncValueGreaterOrEqual(Now, *pnext_time))
- {
- timeout = 0;
- }
- else
- {
- Bool overflow;
- XSyncValueSubtract(&delay, *pnext_time, Now, &overflow);
- (void)overflow;
- timeout = XSyncValueLow32(delay);
- }
- AdjustWaitForDelay(wt, timeout); /* os/utils.c */
- }
-}
-
-/*
-*** Wakeup Handler
- */
-/*ARGSUSED*/
-static void ServertimeWakeupHandler(env, rc, LastSelectMask)
-pointer env;
-int rc;
-pointer LastSelectMask;
-{
- if (pnext_time)
- {
- GetTime();
-
- if (XSyncValueGreaterOrEqual(Now, *pnext_time))
- {
- SyncChangeCounter(ServertimeCounter, Now);
- }
- }
-}
-
-static void
-ServertimeQueryValue(pCounter, pValue_return)
- pointer pCounter;
- CARD64 *pValue_return;
-{
- GetTime();
- *pValue_return = Now;
-}
-
-static void
-ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater)
- pointer pCounter;
- CARD64 *pbracket_less;
- CARD64 *pbracket_greater;
-{
- if (!pnext_time && pbracket_greater)
- {
- RegisterBlockAndWakeupHandlers(ServertimeBlockHandler,
- ServertimeWakeupHandler,
- NULL);
- }
- else if (pnext_time && !pbracket_greater)
- {
- RemoveBlockAndWakeupHandlers(ServertimeBlockHandler,
- ServertimeWakeupHandler,
- NULL);
- }
- pnext_time = pbracket_greater;
-}
-
-static void
-SyncInitServerTime()
-{
- CARD64 resolution;
-
- XSyncIntsToValue(&Now, GetTimeInMillis(), 0);
- XSyncIntToValue(&resolution, 4);
- ServertimeCounter = SyncCreateSystemCounter("SERVERTIME", Now, resolution,
- XSyncCounterNeverDecreases,
- ServertimeQueryValue, ServertimeBracketValues);
- pnext_time = NULL;
-}
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
deleted file mode 100644
index b31057a0d..000000000
--- a/Xext/xcmisc.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/* $Xorg: xcmisc.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.8 2003/11/17 22:20:27 dawes Exp $ */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "swaprep.h"
-#include "xcmiscstr.h"
-#include "modinit.h"
-
-#if 0
-static unsigned char XCMiscCode;
-#endif
-
-static void XCMiscResetProc(
- ExtensionEntry * /* extEntry */
-);
-
-static DISPATCH_PROC(ProcXCMiscDispatch);
-static DISPATCH_PROC(ProcXCMiscGetVersion);
-static DISPATCH_PROC(ProcXCMiscGetXIDList);
-static DISPATCH_PROC(ProcXCMiscGetXIDRange);
-static DISPATCH_PROC(SProcXCMiscDispatch);
-static DISPATCH_PROC(SProcXCMiscGetVersion);
-static DISPATCH_PROC(SProcXCMiscGetXIDList);
-static DISPATCH_PROC(SProcXCMiscGetXIDRange);
-
-void
-XCMiscExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(XCMiscExtensionName, 0, 0,
- ProcXCMiscDispatch, SProcXCMiscDispatch,
- XCMiscResetProc, StandardMinorOpcode)) != 0)
- XCMiscCode = (unsigned char)extEntry->base;
-#else
- (void) AddExtension(XCMiscExtensionName, 0, 0,
- ProcXCMiscDispatch, SProcXCMiscDispatch,
- XCMiscResetProc, StandardMinorOpcode);
-#endif
-
- DeclareExtensionSecurity(XCMiscExtensionName, TRUE);
-}
-
-/*ARGSUSED*/
-static void
-XCMiscResetProc (extEntry)
- ExtensionEntry *extEntry;
-{
-}
-
-static int
-ProcXCMiscGetVersion(client)
- register ClientPtr client;
-{
- xXCMiscGetVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XCMiscMajorVersion;
- rep.minorVersion = XCMiscMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcXCMiscGetXIDRange(client)
- register ClientPtr client;
-{
- xXCMiscGetXIDRangeReply rep;
- register int n;
- XID min_id, max_id;
-
- REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
- GetXIDRange(client->index, FALSE, &min_id, &max_id);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.start_id = min_id;
- rep.count = max_id - min_id + 1;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.start_id, n);
- swapl(&rep.count, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcXCMiscGetXIDList(client)
- register ClientPtr client;
-{
- REQUEST(xXCMiscGetXIDListReq);
- xXCMiscGetXIDListReply rep;
- register int n;
- XID *pids;
- unsigned int count;
-
- REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
-
- pids = (XID *)ALLOCATE_LOCAL(stuff->count * sizeof(XID));
- if (!pids)
- {
- return BadAlloc;
- }
- count = GetXIDList(client, stuff->count, pids);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = count;
- rep.count = count;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.count, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
- if (count)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, count * sizeof(XID), pids);
- }
- DEALLOCATE_LOCAL(pids);
- return(client->noClientException);
-}
-
-static int
-ProcXCMiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XCMiscGetVersion:
- return ProcXCMiscGetVersion(client);
- case X_XCMiscGetXIDRange:
- return ProcXCMiscGetXIDRange(client);
- case X_XCMiscGetXIDList:
- return ProcXCMiscGetXIDList(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcXCMiscGetVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXCMiscGetVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion, n);
- return ProcXCMiscGetVersion(client);
-}
-
-static int
-SProcXCMiscGetXIDRange(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xReq);
-
- swaps(&stuff->length, n);
- return ProcXCMiscGetXIDRange(client);
-}
-
-static int
-SProcXCMiscGetXIDList(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXCMiscGetXIDListReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->count, n);
- return ProcXCMiscGetXIDList(client);
-}
-
-static int
-SProcXCMiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XCMiscGetVersion:
- return SProcXCMiscGetVersion(client);
- case X_XCMiscGetXIDRange:
- return SProcXCMiscGetXIDRange(client);
- case X_XCMiscGetXIDList:
- return SProcXCMiscGetXIDList(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
deleted file mode 100644
index 1da665af0..000000000
--- a/Xext/xf86bigfont.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.18 2003/11/17 22:20:27 dawes Exp $ */
-/*
- * BIGFONT extension for sharing font metrics between clients (if possible)
- * and for transmitting font metrics to clients in a compressed form.
- *
- * Copyright (c) 1999-2000 Bruno Haible
- * Copyright (c) 1999-2000 The XFree86 Project, Inc.
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-/*
- * Big fonts suffer from the following: All clients that have opened a
- * font can access the complete glyph metrics array (the XFontStruct member
- * `per_char') directly, without going through a macro. Moreover these
- * glyph metrics are ink metrics, i.e. are not redundant even for a
- * fixed-width font. For a Unicode font, the size of this array is 768 KB.
- *
- * Problems: 1. It eats a lot of memory in each client. 2. All this glyph
- * metrics data is piped through the socket when the font is opened.
- *
- * This extension addresses these two problems for local clients, by using
- * shared memory. It also addresses the second problem for non-local clients,
- * by compressing the data before transmit by a factor of nearly 6.
- *
- * If you use this extension, your OS ought to nicely support shared memory.
- * This means: Shared memory should be swappable to the swap, and the limits
- * should be high enough (SHMMNI at least 64, SHMMAX at least 768 KB,
- * SHMALL at least 48 MB). It is a plus if your OS allows shmat() calls
- * on segments that have already been marked "removed", because it permits
- * these segments to be cleaned up by the OS if the X server is killed with
- * signal SIGKILL.
- *
- * This extension is transparently exploited by Xlib (functions XQueryFont,
- * XLoadQueryFont).
- */
-
-#include <sys/types.h>
-#ifdef HAS_SHM
-#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2)
-/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */
-/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers):
- Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define
- PAGE_SIZE. It is defined in <asm/page.h>. */
-#include <asm/page.h>
-#endif
-#ifdef SVR4
-#include <sys/sysmacros.h>
-#endif
-#if defined(ISC) || defined(__CYGWIN__) || defined(SCO) || defined(SCO325)
-#include <sys/param.h>
-#include <sys/sysmacros.h>
-#endif
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <errno.h>
-#endif
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "dixfontstr.h"
-#include "extnsionst.h"
-
-#define _XF86BIGFONT_SERVER_
-#include "xf86bigfstr.h"
-
-static void XF86BigfontResetProc(
- ExtensionEntry * /* extEntry */
- );
-
-static DISPATCH_PROC(ProcXF86BigfontDispatch);
-static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
-static DISPATCH_PROC(ProcXF86BigfontQueryFont);
-static DISPATCH_PROC(SProcXF86BigfontDispatch);
-static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
-static DISPATCH_PROC(SProcXF86BigfontQueryFont);
-
-#if 0
-static unsigned char XF86BigfontReqCode;
-#endif
-
-#ifdef HAS_SHM
-
-/* A random signature, transmitted to the clients so they can verify that the
- shared memory segment they are attaching to was really established by the
- X server they are talking to. */
-static CARD32 signature;
-
-/* Index for additional information stored in a FontRec's devPrivates array. */
-static int FontShmdescIndex;
-
-static unsigned int pagesize;
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
-
-#include <sys/signal.h>
-
-static Bool badSysCall = FALSE;
-
-static void
-SigSysHandler(
- int signo)
-{
- badSysCall = TRUE;
-}
-
-static Bool
-CheckForShmSyscall(void)
-{
- void (*oldHandler)(int);
- int shmid = -1;
-
- /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
- oldHandler = signal(SIGSYS, SigSysHandler);
-
- badSysCall = FALSE;
- shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
- if (shmid != -1)
- {
- /* Successful allocation - clean up */
- shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
- }
- else
- {
- /* Allocation failed */
- badSysCall = TRUE;
- }
- signal(SIGSYS, oldHandler);
- return (!badSysCall);
-}
-
-#define MUST_CHECK_FOR_SHM_SYSCALL
-
-#endif
-
-#endif
-
-void
-XFree86BigfontExtensionInit()
-{
-#if 0
- ExtensionEntry* extEntry;
-
- if ((extEntry = AddExtension(XF86BIGFONTNAME,
- XF86BigfontNumberEvents,
- XF86BigfontNumberErrors,
- ProcXF86BigfontDispatch,
- SProcXF86BigfontDispatch,
- XF86BigfontResetProc,
- StandardMinorOpcode))) {
- XF86BigfontReqCode = (unsigned char) extEntry->base;
-#else
- if (AddExtension(XF86BIGFONTNAME,
- XF86BigfontNumberEvents,
- XF86BigfontNumberErrors,
- ProcXF86BigfontDispatch,
- SProcXF86BigfontDispatch,
- XF86BigfontResetProc,
- StandardMinorOpcode)) {
-#endif
-#ifdef HAS_SHM
-#ifdef MUST_CHECK_FOR_SHM_SYSCALL
- /*
- * Note: Local-clients will not be optimized without shared memory
- * support. Remote-client optimization does not depend on shared
- * memory support. Thus, the extension is still registered even
- * when shared memory support is not functional.
- */
- if (!CheckForShmSyscall()) {
- ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n");
- return;
- }
-#endif
-
- srand((unsigned int) time(NULL));
- signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16)
- + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand());
- /* fprintf(stderr, "signature = 0x%08X\n", signature); */
-
- FontShmdescIndex = AllocateFontPrivateIndex();
-
-#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
- pagesize = SHMLBA;
-#else
-# ifdef _SC_PAGESIZE
- pagesize = sysconf(_SC_PAGESIZE);
-# else
- pagesize = getpagesize();
-# endif
-#endif
-#endif
- }
-}
-
-
-/* ========== Management of shared memory segments ========== */
-
-#ifdef HAS_SHM
-
-#ifdef __linux__
-/* On Linux, shared memory marked as "removed" can still be attached.
- Nice feature, because the kernel will automatically free the associated
- storage when the server and all clients are gone. */
-#define EARLY_REMOVE
-#endif
-
-typedef struct _ShmDesc {
- struct _ShmDesc *next;
- struct _ShmDesc **prev;
- int shmid;
- char *attach_addr;
-} ShmDescRec, *ShmDescPtr;
-
-static ShmDescPtr ShmList = (ShmDescPtr) NULL;
-
-static ShmDescPtr
-shmalloc(
- unsigned int size)
-{
- ShmDescPtr pDesc;
- int shmid;
- char *addr;
-
-#ifdef MUST_CHECK_FOR_SHM_SYSCALL
- if (pagesize == 0)
- return (ShmDescPtr) NULL;
-#endif
-
- /* On some older Linux systems, the number of shared memory segments
- system-wide is 127. In Linux 2.4, it is 4095.
- Therefore there is a tradeoff to be made between allocating a
- shared memory segment on one hand, and allocating memory and piping
- the glyph metrics on the other hand. If the glyph metrics size is
- small, we prefer the traditional way. */
- if (size < 3500)
- return (ShmDescPtr) NULL;
-
- pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec));
- if (!pDesc)
- return (ShmDescPtr) NULL;
-
- size = (size + pagesize-1) & -pagesize;
- shmid = shmget(IPC_PRIVATE, size, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
- if (shmid == -1) {
- ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n",
- size, errno);
- xfree(pDesc);
- return (ShmDescPtr) NULL;
- }
-
- if ((addr = shmat(shmid, 0, 0)) == (char *)-1) {
- ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n",
- size, errno);
- shmctl(shmid, IPC_RMID, (void *) 0);
- xfree(pDesc);
- return (ShmDescPtr) NULL;
- }
-
-#ifdef EARLY_REMOVE
- shmctl(shmid, IPC_RMID, (void *) 0);
-#endif
-
- pDesc->shmid = shmid;
- pDesc->attach_addr = addr;
- if (ShmList) ShmList->prev = &pDesc->next;
- pDesc->next = ShmList;
- pDesc->prev = &ShmList;
- ShmList = pDesc;
-
- return pDesc;
-}
-
-static void
-shmdealloc(
- ShmDescPtr pDesc)
-{
-#ifndef EARLY_REMOVE
- shmctl(pDesc->shmid, IPC_RMID, (void *) 0);
-#endif
- shmdt(pDesc->attach_addr);
-
- if (pDesc->next) pDesc->next->prev = pDesc->prev;
- *pDesc->prev = pDesc->next;
- xfree(pDesc);
-}
-
-#endif
-
-/* Called when a font is closed. */
-void
-XF86BigfontFreeFontShm(
- FontPtr pFont)
-{
-#ifdef HAS_SHM
- ShmDescPtr pDesc;
-
- /* If during shutdown of the server, XF86BigfontCleanup() has already
- * called shmdealloc() for all segments, we don't need to do it here.
- */
- if (!ShmList)
- return;
-
- pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
- if (pDesc)
- shmdealloc(pDesc);
-#endif
-}
-
-/* Called upon fatal signal. */
-void
-XF86BigfontCleanup()
-{
-#ifdef HAS_SHM
- while (ShmList)
- shmdealloc(ShmList);
-#endif
-}
-
-/* Called when a server generation dies. */
-static void
-XF86BigfontResetProc(
- ExtensionEntry* extEntry)
-{
- /* This function is normally called from CloseDownExtensions(), called
- * from main(). It will be followed by a call to FreeAllResources(),
- * which will call XF86BigfontFreeFontShm() for each font. Thus it
- * appears that we do not need to do anything in this function. --
- * But I prefer to write robust code, and not keep shared memory lying
- * around when it's not needed any more. (Someone might close down the
- * extension without calling FreeAllResources()...)
- */
- XF86BigfontCleanup();
-}
-
-
-/* ========== Handling of extension specific requests ========== */
-
-static int
-ProcXF86BigfontQueryVersion(
- ClientPtr client)
-{
- xXF86BigfontQueryVersionReply reply;
-
- REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.majorVersion = XF86BIGFONT_MAJOR_VERSION;
- reply.minorVersion = XF86BIGFONT_MINOR_VERSION;
- reply.uid = geteuid();
- reply.gid = getegid();
-#ifdef HAS_SHM
- reply.signature = signature;
-#else
- reply.signature = 0; /* This is redundant. Avoids uninitialized memory. */
-#endif
- reply.capabilities =
-#ifdef HAS_SHM
- (LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
-#else
- 0
-#endif
- ; /* may add more bits here in future versions */
- if (client->swapped) {
- char tmp;
- swaps(&reply.sequenceNumber, tmp);
- swapl(&reply.length, tmp);
- swaps(&reply.majorVersion, tmp);
- swaps(&reply.minorVersion, tmp);
- swapl(&reply.uid, tmp);
- swapl(&reply.gid, tmp);
- swapl(&reply.signature, tmp);
- }
- WriteToClient(client,
- sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
- return client->noClientException;
-}
-
-static void
-swapCharInfo(
- xCharInfo *pCI)
-{
- char tmp;
-
- swaps(&pCI->leftSideBearing, tmp);
- swaps(&pCI->rightSideBearing, tmp);
- swaps(&pCI->characterWidth, tmp);
- swaps(&pCI->ascent, tmp);
- swaps(&pCI->descent, tmp);
- swaps(&pCI->attributes, tmp);
-}
-
-/* static CARD32 hashCI (xCharInfo *p); */
-#define hashCI(p) \
- (CARD32)(((p->leftSideBearing << 27) + (p->leftSideBearing >> 5) + \
- (p->rightSideBearing << 23) + (p->rightSideBearing >> 9) + \
- (p->characterWidth << 16) + \
- (p->ascent << 11) + (p->descent << 6)) ^ p->attributes)
-
-static int
-ProcXF86BigfontQueryFont(
- ClientPtr client)
-{
- FontPtr pFont;
- REQUEST(xXF86BigfontQueryFontReq);
- CARD32 stuff_flags;
- xCharInfo* pmax;
- xCharInfo* pmin;
- int nCharInfos;
- int shmid;
-#ifdef HAS_SHM
- ShmDescPtr pDesc;
-#else
-#define pDesc 0
-#endif
- xCharInfo* pCI;
- CARD16* pIndex2UniqIndex;
- CARD16* pUniqIndex2Index;
- CARD32 nUniqCharInfos;
-
-#if 0
- REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
-#else
- switch (client->req_len) {
- case 2: /* client with version 1.0 libX11 */
- stuff_flags = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
- break;
- case 3: /* client with version 1.1 libX11 */
- stuff_flags = stuff->flags;
- break;
- default:
- return BadLength;
- }
-#endif
- client->errorValue = stuff->id; /* EITHER font or gc */
- pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
- SecurityReadAccess);
- if (!pFont) {
- /* can't use VERIFY_GC because it might return BadGC */
- GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
- SecurityReadAccess);
- if (!pGC) {
- client->errorValue = stuff->id;
- return BadFont; /* procotol spec says only error is BadFont */
- }
- pFont = pGC->font;
- }
-
- pmax = FONTINKMAX(pFont);
- pmin = FONTINKMIN(pFont);
- nCharInfos =
- (pmax->rightSideBearing == pmin->rightSideBearing
- && pmax->leftSideBearing == pmin->leftSideBearing
- && pmax->descent == pmin->descent
- && pmax->ascent == pmin->ascent
- && pmax->characterWidth == pmin->characterWidth)
- ? 0 : N2dChars(pFont);
- shmid = -1;
- pCI = NULL;
- pIndex2UniqIndex = NULL;
- pUniqIndex2Index = NULL;
- nUniqCharInfos = 0;
-
- if (nCharInfos > 0) {
-#ifdef HAS_SHM
- pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
- if (pDesc) {
- pCI = (xCharInfo *) pDesc->attach_addr;
- if (stuff_flags & XF86Bigfont_FLAGS_Shm)
- shmid = pDesc->shmid;
- } else {
- if (stuff_flags & XF86Bigfont_FLAGS_Shm)
- pDesc = shmalloc(nCharInfos * sizeof(xCharInfo)
- + sizeof(CARD32));
- if (pDesc) {
- pCI = (xCharInfo *) pDesc->attach_addr;
- shmid = pDesc->shmid;
- } else {
-#endif
- pCI = (xCharInfo *)
- ALLOCATE_LOCAL(nCharInfos * sizeof(xCharInfo));
- if (!pCI)
- return BadAlloc;
-#ifdef HAS_SHM
- }
-#endif
- /* Fill nCharInfos starting at pCI. */
- {
- xCharInfo* prCI = pCI;
- int ninfos = 0;
- int ncols = pFont->info.lastCol - pFont->info.firstCol + 1;
- int row;
- for (row = pFont->info.firstRow;
- row <= pFont->info.lastRow && ninfos < nCharInfos;
- row++) {
- unsigned char chars[512];
- xCharInfo* tmpCharInfos[256];
- unsigned long count;
- int col;
- unsigned long i;
- i = 0;
- for (col = pFont->info.firstCol;
- col <= pFont->info.lastCol;
- col++) {
- chars[i++] = row;
- chars[i++] = col;
- }
- (*pFont->get_metrics) (pFont, ncols, chars, TwoD16Bit,
- &count, tmpCharInfos);
- for (i = 0; i < count && ninfos < nCharInfos; i++) {
- *prCI++ = *tmpCharInfos[i];
- ninfos++;
- }
- }
- }
-#ifdef HAS_SHM
- if (pDesc) {
- *(CARD32 *)(pCI + nCharInfos) = signature;
- if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
- shmdealloc(pDesc);
- return BadAlloc;
- }
- }
- }
-#endif
- if (shmid == -1) {
- /* Cannot use shared memory, so remove-duplicates the xCharInfos
- using a temporary hash table. */
- /* Note that CARD16 is suitable as index type, because
- nCharInfos <= 0x10000. */
- CARD32 hashModulus;
- CARD16* pHash2UniqIndex;
- CARD16* pUniqIndex2NextUniqIndex;
- CARD32 NextIndex;
- CARD32 NextUniqIndex;
- CARD16* tmp;
- CARD32 i, j;
-
- hashModulus = 67;
- if (hashModulus > nCharInfos+1)
- hashModulus = nCharInfos+1;
-
- tmp = (CARD16*)
- ALLOCATE_LOCAL((4*nCharInfos+1) * sizeof(CARD16));
- if (!tmp) {
- if (!pDesc) DEALLOCATE_LOCAL(pCI);
- return BadAlloc;
- }
- pIndex2UniqIndex = tmp;
- /* nCharInfos elements */
- pUniqIndex2Index = tmp + nCharInfos;
- /* max. nCharInfos elements */
- pUniqIndex2NextUniqIndex = tmp + 2*nCharInfos;
- /* max. nCharInfos elements */
- pHash2UniqIndex = tmp + 3*nCharInfos;
- /* hashModulus (<= nCharInfos+1) elements */
-
- /* Note that we can use 0xffff as end-of-list indicator, because
- even if nCharInfos = 0x10000, 0xffff can not occur as valid
- entry before the last element has been inserted. And once the
- last element has been inserted, we don't need the hash table
- any more. */
- for (j = 0; j < hashModulus; j++)
- pHash2UniqIndex[j] = (CARD16)(-1);
-
- NextUniqIndex = 0;
- for (NextIndex = 0; NextIndex < nCharInfos; NextIndex++) {
- xCharInfo* p = &pCI[NextIndex];
- CARD32 hashCode = hashCI(p) % hashModulus;
- for (i = pHash2UniqIndex[hashCode];
- i != (CARD16)(-1);
- i = pUniqIndex2NextUniqIndex[i]) {
- j = pUniqIndex2Index[i];
- if (pCI[j].leftSideBearing == p->leftSideBearing
- && pCI[j].rightSideBearing == p->rightSideBearing
- && pCI[j].characterWidth == p->characterWidth
- && pCI[j].ascent == p->ascent
- && pCI[j].descent == p->descent
- && pCI[j].attributes == p->attributes)
- break;
- }
- if (i != (CARD16)(-1)) {
- /* Found *p at Index j, UniqIndex i */
- pIndex2UniqIndex[NextIndex] = i;
- } else {
- /* Allocate a new entry in the Uniq table */
- if (hashModulus <= 2*NextUniqIndex
- && hashModulus < nCharInfos+1) {
- /* Time to increate hash table size */
- hashModulus = 2*hashModulus+1;
- if (hashModulus > nCharInfos+1)
- hashModulus = nCharInfos+1;
- for (j = 0; j < hashModulus; j++)
- pHash2UniqIndex[j] = (CARD16)(-1);
- for (i = 0; i < NextUniqIndex; i++)
- pUniqIndex2NextUniqIndex[i] = (CARD16)(-1);
- for (i = 0; i < NextUniqIndex; i++) {
- j = pUniqIndex2Index[i];
- p = &pCI[j];
- hashCode = hashCI(p) % hashModulus;
- pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode];
- pHash2UniqIndex[hashCode] = i;
- }
- p = &pCI[NextIndex];
- hashCode = hashCI(p) % hashModulus;
- }
- i = NextUniqIndex++;
- pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode];
- pHash2UniqIndex[hashCode] = i;
- pUniqIndex2Index[i] = NextIndex;
- pIndex2UniqIndex[NextIndex] = i;
- }
- }
- nUniqCharInfos = NextUniqIndex;
- /* fprintf(stderr, "font metrics: nCharInfos = %d, nUniqCharInfos = %d, hashModulus = %d\n", nCharInfos, nUniqCharInfos, hashModulus); */
- }
- }
-
- {
- int nfontprops = pFont->info.nprops;
- int rlength =
- sizeof(xXF86BigfontQueryFontReply)
- + nfontprops * sizeof(xFontProp)
- + (nCharInfos > 0 && shmid == -1
- ? nUniqCharInfos * sizeof(xCharInfo)
- + (nCharInfos+1)/2 * 2 * sizeof(CARD16)
- : 0);
- xXF86BigfontQueryFontReply* reply =
- (xXF86BigfontQueryFontReply *) ALLOCATE_LOCAL(rlength);
- char* p;
- if (!reply) {
- if (nCharInfos > 0) {
- if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex);
- if (!pDesc) DEALLOCATE_LOCAL(pCI);
- }
- return BadAlloc;
- }
- reply->type = X_Reply;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
- reply->sequenceNumber = client->sequence;
- reply->minBounds = pFont->info.ink_minbounds;
- reply->maxBounds = pFont->info.ink_maxbounds;
- reply->minCharOrByte2 = pFont->info.firstCol;
- reply->maxCharOrByte2 = pFont->info.lastCol;
- reply->defaultChar = pFont->info.defaultCh;
- reply->nFontProps = pFont->info.nprops;
- reply->drawDirection = pFont->info.drawDirection;
- reply->minByte1 = pFont->info.firstRow;
- reply->maxByte1 = pFont->info.lastRow;
- reply->allCharsExist = pFont->info.allExist;
- reply->fontAscent = pFont->info.fontAscent;
- reply->fontDescent = pFont->info.fontDescent;
- reply->nCharInfos = nCharInfos;
- reply->nUniqCharInfos = nUniqCharInfos;
- reply->shmid = shmid;
- reply->shmsegoffset = 0;
- if (client->swapped) {
- char tmp;
- swaps(&reply->sequenceNumber, tmp);
- swapl(&reply->length, tmp);
- swapCharInfo(&reply->minBounds);
- swapCharInfo(&reply->maxBounds);
- swaps(&reply->minCharOrByte2, tmp);
- swaps(&reply->maxCharOrByte2, tmp);
- swaps(&reply->defaultChar, tmp);
- swaps(&reply->nFontProps, tmp);
- swaps(&reply->fontAscent, tmp);
- swaps(&reply->fontDescent, tmp);
- swapl(&reply->nCharInfos, tmp);
- swapl(&reply->nUniqCharInfos, tmp);
- swapl(&reply->shmid, tmp);
- swapl(&reply->shmsegoffset, tmp);
- }
- p = (char*) &reply[1];
- {
- FontPropPtr pFP;
- xFontProp* prFP;
- int i;
- for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) p;
- i < nfontprops;
- i++, pFP++, prFP++) {
- prFP->name = pFP->name;
- prFP->value = pFP->value;
- if (client->swapped) {
- char tmp;
- swapl(&prFP->name, tmp);
- swapl(&prFP->value, tmp);
- }
- }
- p = (char*) prFP;
- }
- if (nCharInfos > 0 && shmid == -1) {
- xCharInfo* pci;
- CARD16* ps;
- int i, j;
- pci = (xCharInfo*) p;
- for (i = 0; i < nUniqCharInfos; i++, pci++) {
- *pci = pCI[pUniqIndex2Index[i]];
- if (client->swapped)
- swapCharInfo(pci);
- }
- ps = (CARD16*) pci;
- for (j = 0; j < nCharInfos; j++, ps++) {
- *ps = pIndex2UniqIndex[j];
- if (client->swapped) {
- char tmp;
- swaps(ps, tmp);
- }
- }
- }
- WriteToClient(client, rlength, (char *)reply);
- DEALLOCATE_LOCAL(reply);
- if (nCharInfos > 0) {
- if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex);
- if (!pDesc) DEALLOCATE_LOCAL(pCI);
- }
- return (client->noClientException);
- }
-}
-
-static int
-ProcXF86BigfontDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data) {
- case X_XF86BigfontQueryVersion:
- return ProcXF86BigfontQueryVersion(client);
- case X_XF86BigfontQueryFont:
- return ProcXF86BigfontQueryFont(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcXF86BigfontQueryVersion(
- ClientPtr client)
-{
- REQUEST(xXF86BigfontQueryVersionReq);
- char tmp;
-
- swaps(&stuff->length, tmp);
- return ProcXF86BigfontQueryVersion(client);
-}
-
-static int
-SProcXF86BigfontQueryFont(
- ClientPtr client)
-{
- REQUEST(xXF86BigfontQueryFontReq);
- char tmp;
-
- swaps(&stuff->length, tmp);
- REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
- swapl(&stuff->id, tmp);
- return ProcXF86BigfontQueryFont(client);
-}
-
-static int
-SProcXF86BigfontDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data) {
- case X_XF86BigfontQueryVersion:
- return SProcXF86BigfontQueryVersion(client);
- case X_XF86BigfontQueryFont:
- return SProcXF86BigfontQueryFont(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/xprint.c b/Xext/xprint.c
deleted file mode 100644
index e50fb4068..000000000
--- a/Xext/xprint.c
+++ /dev/null
@@ -1,2756 +0,0 @@
-/* $Xorg: xprint.c,v 1.5 2001/03/05 20:42:26 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: xprint.c
-** *
-** * Copyright: Copyright 1993, 1995 Hewlett-Packard Company
-** *
-** * Copyright 1989 by The Massachusetts Institute of Technology
-** *
-** * Permission to use, copy, modify, and distribute this
-** * software and its documentation for any purpose and without
-** * fee is hereby granted, provided that the above copyright
-** * notice appear in all copies and that both that copyright
-** * notice and this permission notice appear in supporting
-** * documentation, and that the name of MIT not be used in
-** * advertising or publicity pertaining to distribution of the
-** * software without specific prior written permission.
-** * M.I.T. makes no representation about the suitability of
-** * this software for any purpose. It is provided "as is"
-** * without any express or implied warranty.
-** *
-** * MIT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-** * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-** * NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MIT BE LI-
-** * ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-** * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-** * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-** * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-** * THE USE OR PERFORMANCE OF THIS SOFTWARE.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.15 2003/10/28 23:08:44 tsi Exp $ */
-
-#define _XP_PRINT_SERVER_
-#include "X.h"
-#include "Xos.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#undef NEED_EVENTS
-#include "misc.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "Xatom.h"
-#include "Print.h"
-#include "Printstr.h"
-#include "../Xprint/DiPrint.h"
-#include "../Xprint/attributes.h"
-#include "modinit.h"
-
-static void XpResetProc(ExtensionEntry *);
-
-static int ProcXpDispatch(ClientPtr);
-static int ProcXpSwappedDispatch(ClientPtr);
-
-static int ProcXpQueryVersion(ClientPtr);
-static int ProcXpGetPrinterList(ClientPtr);
-static int ProcXpCreateContext(ClientPtr);
-static int ProcXpSetContext(ClientPtr);
-static int ProcXpGetContext(ClientPtr);
-static int ProcXpDestroyContext(ClientPtr);
-static int ProcXpGetContextScreen(ClientPtr);
-static int ProcXpStartJob(ClientPtr);
-static int ProcXpEndJob(ClientPtr);
-static int ProcXpStartDoc(ClientPtr);
-static int ProcXpEndDoc(ClientPtr);
-static int ProcXpStartPage(ClientPtr);
-static int ProcXpEndPage(ClientPtr);
-static int ProcXpSelectInput(ClientPtr);
-static int ProcXpInputSelected(ClientPtr);
-static int ProcXpPutDocumentData(ClientPtr);
-static int ProcXpGetDocumentData(ClientPtr);
-static int ProcXpGetAttributes(ClientPtr);
-static int ProcXpGetOneAttribute(ClientPtr);
-static int ProcXpSetAttributes(ClientPtr);
-static int ProcXpRehashPrinterList(ClientPtr);
-static int ProcXpQueryScreens(ClientPtr);
-static int ProcXpGetPageDimensions(ClientPtr);
-static int ProcXpSetImageResolution(ClientPtr);
-static int ProcXpGetImageResolution(ClientPtr);
-
-static void SwapXpNotifyEvent(xPrintPrintEvent *, xPrintPrintEvent *);
-static void SwapXpAttributeEvent(xPrintAttributeEvent *, xPrintAttributeEvent *);
-
-static int SProcXpGetPrinterList(ClientPtr);
-static int SProcXpCreateContext(ClientPtr);
-static int SProcXpSetContext(ClientPtr);
-static int SProcXpGetContext(ClientPtr);
-static int SProcXpDestroyContext(ClientPtr);
-static int SProcXpGetContextScreen(ClientPtr);
-static int SProcXpStartJob(ClientPtr);
-static int SProcXpEndJob(ClientPtr);
-static int SProcXpStartDoc(ClientPtr);
-static int SProcXpEndDoc(ClientPtr);
-static int SProcXpStartPage(ClientPtr);
-static int SProcXpEndPage(ClientPtr);
-static int SProcXpSelectInput(ClientPtr);
-static int SProcXpInputSelected(ClientPtr);
-static int SProcXpPutDocumentData(ClientPtr);
-static int SProcXpGetDocumentData(ClientPtr);
-static int SProcXpGetAttributes(ClientPtr);
-static int SProcXpGetOneAttribute(ClientPtr);
-static int SProcXpSetAttributes(ClientPtr);
-static int SProcXpRehashPrinterList(ClientPtr);
-static int SProcXpGetPageDimensions(ClientPtr);
-static int SProcXpSetImageResolution(ClientPtr);
-static int SProcXpGetImageResolution(ClientPtr);
-
-static void SendXpNotify(XpContextPtr, int, int);
-static void SendAttributeNotify(XpContextPtr, int);
-static int XpFreeClient(pointer, XID);
-static int XpFreeContext(pointer, XID);
-static int XpFreePage(pointer, XID);
-static Bool XpCloseScreen(int, ScreenPtr);
-static CARD32 GetAllEventMasks(XpContextPtr);
-static struct _XpClient *CreateXpClient(ClientPtr);
-static void InitContextPrivates(XpContextPtr);
-static void ResetContextPrivates(void);
-static struct _XpClient *FindClient(XpContextPtr, ClientPtr);
-static struct _XpClient *AcquireClient(XpContextPtr, ClientPtr);
-
-typedef struct _driver {
- struct _driver *next;
- char *name;
- int (* CreateContext)(XpContextPtr);
-} XpDriverRec, *XpDriverPtr;
-
-typedef struct _xpScreen {
- Bool (* CloseScreen)(int, ScreenPtr);
- struct _driver *drivers;
-} XpScreenRec, *XpScreenPtr;
-
-/*
- * Each context has a list of XpClients indicating which clients have
- * associated this context with their connection.
- * Each such client has a RTclient resource allocated for it,
- * and this per-client
- * resource is used to delete the XpClientRec if/when the client closes
- * its connection.
- * The list of XpClients is also walked if/when the context is destroyed
- * so that the ContextPtr can be removed from the client's devPrivates.
- */
-typedef struct _XpClient {
- struct _XpClient *pNext;
- ClientPtr client;
- XpContextPtr context;
- CARD32 eventMask;
- XID contextClientID; /* unneeded sanity check? */
-} XpClientRec, *XpClientPtr;
-
-static void FreeXpClient(XpClientPtr, Bool);
-
-/*
- * Each StartPage request specifies a window which forms the top level
- * window of the page. One of the following structs is created as a
- * RTpage resource with the same ID as the window itself. This enables
- * us to clean up when/if the window is destroyed, and to prevent the
- * same window from being simultaneously referenced in multiple contexts.
- * The page resource is created at the first StartPage on a given window,
- * and is only destroyed when/if the window is destroyed. When the
- * EndPage is recieved (or an EndDoc or EndJob) the context field is
- * set to NULL, but the resource remains alive.
- */
-typedef struct _XpPage {
- XpContextPtr context;
-} XpPageRec, *XpPagePtr;
-
-typedef struct _XpStPageRec {
- XpContextPtr pContext;
- Bool slept;
- XpPagePtr pPage;
- WindowPtr pWin;
-} XpStPageRec, *XpStPagePtr;
-
-typedef struct _XpStDocRec {
- XpContextPtr pContext;
- Bool slept;
- CARD8 type;
-} XpStDocRec, *XpStDocPtr;
-
-#define QUADPAD(x) ((((x)+3)>>2)<<2)
-
-/*
- * Possible bit-mask values in the "state" field of a XpContextRec.
- */
-#define JOB_STARTED (1 << 0)
-#define DOC_RAW_STARTED (1 << 1)
-#define DOC_COOKED_STARTED (1 << 2)
-#define PAGE_STARTED (1 << 3)
-#define GET_DOC_DATA_STARTED (1 << 4)
-#define JOB_GET_DATA (1 << 5)
-
-static XpScreenPtr XpScreens[MAXSCREENS];
-static unsigned char XpReqCode;
-static int XpEventBase;
-static int XpErrorBase;
-static unsigned long XpGeneration = 0;
-static int XpClientPrivateIndex;
-
-/* Variables for the context private machinery.
- * These must be initialized at compile time because
- * main() calls InitOutput before InitExtensions, and the
- * output drivers are likely to call AllocateContextPrivate.
- * These variables are reset at CloseScreen time. CloseScreen
- * is used because it occurs after FreeAllResources, and before
- * the next InitOutput cycle.
- */
-static int contextPrivateCount = 0;
-static int contextPrivateLen = 0;
-static unsigned *contextPrivateSizes = (unsigned *)NULL;
-static unsigned totalContextSize = sizeof(XpContextRec);
-
-/*
- * There are three types of resources involved. One is the resource associated
- * with the context itself, with an ID specified by a printing client. The
- * next is a resource created by us on the client's behalf (and unknown to
- * the client) when a client inits or sets a context which allows us to
- * track each client's interest in events
- * on a particular context, and also allows us to clean up this interest
- * record when/if the client's connection is closed. Finally, there is
- * a resource created for each window that's specified in a StartPage. This
- * resource carries the same ID as the window itself, and enables us to
- * easily prevent the same window being referenced in multiple contexts
- * simultaneously, and enables us to clean up if the window is destroyed
- * before the EndPage.
- */
-static RESTYPE RTclient, RTcontext, RTpage;
-
-/*
- * allEvents is the OR of all the legal event mask bits.
- */
-static CARD32 allEvents = XPPrintMask | XPAttributeMask;
-
-
-/*******************************************************************************
- *
- * ExtensionInit, Driver Init functions, QueryVersion, and Dispatch procs
- *
- ******************************************************************************/
-
-/*
- * XpExtensionInit
- *
- * Called from InitExtensions in main() usually through miinitextension
- *
- */
-
-void
-XpExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
-
- RTclient = CreateNewResourceType(XpFreeClient);
- RTcontext = CreateNewResourceType(XpFreeContext);
- RTpage = CreateNewResourceType(XpFreePage);
- if (RTclient && RTcontext && RTpage &&
- (extEntry = AddExtension(XP_PRINTNAME, XP_EVENTS, XP_ERRORS,
- ProcXpDispatch, ProcXpSwappedDispatch,
- XpResetProc, StandardMinorOpcode)))
- {
- XpReqCode = (unsigned char)extEntry->base;
- XpEventBase = extEntry->eventBase;
- XpErrorBase = extEntry->errorBase;
- EventSwapVector[XpEventBase] = (EventSwapPtr) SwapXpNotifyEvent;
- EventSwapVector[XpEventBase+1] = (EventSwapPtr) SwapXpAttributeEvent;
- }
-
- if(XpGeneration != serverGeneration)
- {
- XpClientPrivateIndex = AllocateClientPrivateIndex();
- /*
- * We allocate 0 length & simply stuff a pointer to the
- * ContextRec in the DevUnion.
- */
- if(AllocateClientPrivate(XpClientPrivateIndex, 0) != TRUE)
- {
- /* we can't alloc a client private, should we bail??? XXX */
- }
- XpGeneration = serverGeneration;
- }
-
- for(i = 0; i < MAXSCREENS; i++)
- {
- /*
- * If a screen has registered with our extension, then we
- * wrap the screen's CloseScreen function to allow us to
- * reset our ContextPrivate stuff. Note that this
- * requires a printing DDX to call XpRegisterInitFunc
- * _before_ this extension is initialized - i.e. at screen init
- * time, _not_ at root window creation time.
- */
- if(XpScreens[i] != (XpScreenPtr)NULL)
- {
- XpScreens[i]->CloseScreen = screenInfo.screens[i]->CloseScreen;
- screenInfo.screens[i]->CloseScreen = XpCloseScreen;
- }
- }
- DeclareExtensionSecurity(XP_PRINTNAME, TRUE);
-}
-
-static void
-XpResetProc(ExtensionEntry *extEntry)
-{
- /*
- * We can't free up the XpScreens recs here, because extensions are
- * closed before screens, and our CloseScreen function uses the XpScreens
- * recs.
-
- int i;
-
- for(i = 0; i < MAXSCREENS; i++)
- {
- if(XpScreens[i] != (XpScreenPtr)NULL)
- Xfree(XpScreens[i]);
- XpScreens[i] = (XpScreenPtr)NULL;
- }
- */
-}
-
-static Bool
-XpCloseScreen(int index, ScreenPtr pScreen)
-{
- Bool (* CloseScreen)(int, ScreenPtr);
-
- CloseScreen = XpScreens[index]->CloseScreen;
- if(XpScreens[index] != (XpScreenPtr)NULL)
- {
- XpDriverPtr pDriv, nextDriv;
-
- pDriv = XpScreens[index]->drivers;
- while(pDriv != (XpDriverPtr)NULL)
- {
- nextDriv = pDriv->next;
- Xfree(pDriv);
- pDriv = nextDriv;
- }
- Xfree(XpScreens[index]);
- }
- XpScreens[index] = (XpScreenPtr)NULL;
-
- /*
- * It's wasteful to call ResetContextPrivates() at every CloseScreen,
- * but it's the best we know how to do for now. We do this because we
- * have to wait until after all resources have been freed (so we know
- * how to free the ContextRecs), and before the next InitOutput cycle.
- * See dix/main.c for the order of initialization and reset.
- */
- ResetContextPrivates();
- return (*CloseScreen)(index, pScreen);
-}
-
-#if 0 /* NOT USED */
-static void
-FreeScreenEntry(XpScreenPtr pScreenEntry)
-{
- XpDriverPtr pDriver;
-
- pDriver = pScreenEntry->drivers;
- while(pDriver != (XpDriverPtr)NULL)
- {
- XpDriverPtr tmp;
-
- tmp = pDriver->next;
- xfree(pDriver);
- pDriver = tmp;
- }
- xfree(pScreenEntry);
-}
-#endif
-
-/*
- * XpRegisterInitFunc tells the print extension which screens
- * are printers as opposed to displays, and what drivers are
- * supported on each screen. This eliminates the need of
- * allocating print-related private structures on windows on _all_ screens.
- * It also hands the extension a pointer to the routine to be called
- * whenever a context gets created for a particular driver on this screen.
- */
-void
-XpRegisterInitFunc(ScreenPtr pScreen, char *driverName, int (*initContext)(struct _XpContext *))
-{
- XpDriverPtr pDriver;
-
- if(XpScreens[pScreen->myNum] == 0)
- {
- if((XpScreens[pScreen->myNum] =
- (XpScreenPtr) Xalloc(sizeof(XpScreenRec))) == 0)
- return;
- XpScreens[pScreen->myNum]->CloseScreen = 0;
- XpScreens[pScreen->myNum]->drivers = 0;
- }
-
- if((pDriver = (XpDriverPtr)Xalloc(sizeof(XpDriverRec))) == 0)
- return;
- pDriver->next = XpScreens[pScreen->myNum]->drivers;
- pDriver->name = driverName;
- pDriver->CreateContext = initContext;
- XpScreens[pScreen->myNum]->drivers = pDriver;
-}
-
-static int
-ProcXpDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch(stuff->data)
- {
- case X_PrintQueryVersion:
- return ProcXpQueryVersion(client);
- case X_PrintGetPrinterList:
- return ProcXpGetPrinterList(client);
- case X_PrintCreateContext:
- return ProcXpCreateContext(client);
- case X_PrintSetContext:
- return ProcXpSetContext(client);
- case X_PrintGetContext:
- return ProcXpGetContext(client);
- case X_PrintDestroyContext:
- return ProcXpDestroyContext(client);
- case X_PrintGetContextScreen:
- return ProcXpGetContextScreen(client);
- case X_PrintStartJob:
- return ProcXpStartJob(client);
- case X_PrintEndJob:
- return ProcXpEndJob(client);
- case X_PrintStartDoc:
- return ProcXpStartDoc(client);
- case X_PrintEndDoc:
- return ProcXpEndDoc(client);
- case X_PrintStartPage:
- return ProcXpStartPage(client);
- case X_PrintEndPage:
- return ProcXpEndPage(client);
- case X_PrintSelectInput:
- return ProcXpSelectInput(client);
- case X_PrintInputSelected:
- return ProcXpInputSelected(client);
- case X_PrintPutDocumentData:
- return ProcXpPutDocumentData(client);
- case X_PrintGetDocumentData:
- return ProcXpGetDocumentData(client);
- case X_PrintSetAttributes:
- return ProcXpSetAttributes(client);
- case X_PrintGetAttributes:
- return ProcXpGetAttributes(client);
- case X_PrintGetOneAttribute:
- return ProcXpGetOneAttribute(client);
- case X_PrintRehashPrinterList:
- return ProcXpRehashPrinterList(client);
- case X_PrintQueryScreens:
- return ProcXpQueryScreens(client);
- case X_PrintGetPageDimensions:
- return ProcXpGetPageDimensions(client);
- case X_PrintSetImageResolution:
- return ProcXpSetImageResolution(client);
- case X_PrintGetImageResolution:
- return ProcXpGetImageResolution(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-ProcXpSwappedDispatch(ClientPtr client)
-{
- int temp;
- REQUEST(xReq);
-
- switch(stuff->data)
- {
- case X_PrintQueryVersion:
- swaps(&stuff->length, temp);
- return ProcXpQueryVersion(client);
- case X_PrintGetPrinterList:
- return SProcXpGetPrinterList(client);
- case X_PrintCreateContext:
- return SProcXpCreateContext(client);
- case X_PrintSetContext:
- return SProcXpSetContext(client);
- case X_PrintGetContext:
- return SProcXpGetContext(client);
- case X_PrintDestroyContext:
- return SProcXpDestroyContext(client);
- case X_PrintGetContextScreen:
- return SProcXpGetContextScreen(client);
- case X_PrintStartJob:
- return SProcXpStartJob(client);
- case X_PrintEndJob:
- return SProcXpEndJob(client);
- case X_PrintStartDoc:
- return SProcXpStartDoc(client);
- case X_PrintEndDoc:
- return SProcXpEndDoc(client);
- case X_PrintStartPage:
- return SProcXpStartPage(client);
- case X_PrintEndPage:
- return SProcXpEndPage(client);
- case X_PrintSelectInput:
- return SProcXpSelectInput(client);
- case X_PrintInputSelected:
- return SProcXpInputSelected(client);
- case X_PrintPutDocumentData:
- return SProcXpPutDocumentData(client);
- case X_PrintGetDocumentData:
- return SProcXpGetDocumentData(client);
- case X_PrintSetAttributes:
- return SProcXpSetAttributes(client);
- case X_PrintGetAttributes:
- return SProcXpGetAttributes(client);
- case X_PrintGetOneAttribute:
- return SProcXpGetOneAttribute(client);
- case X_PrintRehashPrinterList:
- return SProcXpRehashPrinterList(client);
- case X_PrintQueryScreens:
- swaps(&stuff->length, temp);
- return ProcXpQueryScreens(client);
- case X_PrintGetPageDimensions:
- return SProcXpGetPageDimensions(client);
- case X_PrintSetImageResolution:
- return SProcXpSetImageResolution(client);
- case X_PrintGetImageResolution:
- return SProcXpGetImageResolution(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-ProcXpQueryVersion(ClientPtr client)
-{
- /* REQUEST(xPrintQueryVersionReq); */
- xPrintQueryVersionReply rep;
- register int n;
- long l;
-
- REQUEST_SIZE_MATCH(xPrintQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XP_MAJOR_VERSION;
- rep.minorVersion = XP_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sz_xPrintQueryVersionReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * GetPrinterList : Return a list of all printers associated with this
- * server. Calls XpDiGetPrinterList, which is defined in
- * the device-independent code in Xserver/Xprint.
- *
- ******************************************************************************/
-
-static int
-ProcXpGetPrinterList(ClientPtr client)
-{
- REQUEST(xPrintGetPrinterListReq);
- int totalSize;
- int numEntries;
- XpDiListEntry **pList;
- xPrintGetPrinterListReply *rep;
- int n, i, totalBytes;
- long l;
- char *curByte;
-
- REQUEST_AT_LEAST_SIZE(xPrintGetPrinterListReq);
-
- totalSize = ((sz_xPrintGetPrinterListReq) >> 2) +
- ((stuff->printerNameLen + 3) >> 2) +
- ((stuff->localeLen + 3) >> 2);
- if(totalSize != client->req_len)
- return BadLength;
-
- pList = XpDiGetPrinterList(stuff->printerNameLen, (char *)(stuff + 1),
- stuff->localeLen, (char *)((stuff + 1) +
- QUADPAD(stuff->printerNameLen)));
-
- for(numEntries = 0, totalBytes = sz_xPrintGetPrinterListReply;
- pList[numEntries] != (XpDiListEntry *)NULL;
- numEntries++)
- {
- totalBytes += 2 * sizeof(CARD32);
- totalBytes += QUADPAD(strlen(pList[numEntries]->name));
- totalBytes += QUADPAD(strlen(pList[numEntries]->description));
- }
-
- if((rep = (xPrintGetPrinterListReply *)xalloc(totalBytes)) ==
- (xPrintGetPrinterListReply *)NULL)
- return BadAlloc;
-
- rep->type = X_Reply;
- rep->length = (totalBytes - sz_xPrintGetPrinterListReply) >> 2;
- rep->sequenceNumber = client->sequence;
- rep->listCount = numEntries;
- if (client->swapped) {
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, l);
- swapl(&rep->listCount, l);
- }
-
- for(i = 0, curByte = (char *)(rep + 1); i < numEntries; i++)
- {
- CARD32 *pCrd;
- int len;
-
- pCrd = (CARD32 *)curByte;
- len = strlen(pList[i]->name);
- *pCrd = len;
- if (client->swapped)
- swapl((long *)curByte, l);
- curByte += sizeof(CARD32);
- strncpy(curByte, pList[i]->name, len);
- curByte += QUADPAD(len);
-
- pCrd = (CARD32 *)curByte;
- len = strlen(pList[i]->description);
- *pCrd = len;
- if (client->swapped)
- swapl((long *)curByte, l);
- curByte += sizeof(CARD32);
- strncpy(curByte, pList[i]->description, len);
- curByte += QUADPAD(len);
- }
-
- XpDiFreePrinterList(pList);
-
- WriteToClient(client, totalBytes, (char *)rep);
- xfree(rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * QueryScreens: Returns the list of screens which are associated with
- * print drivers.
- *
- ******************************************************************************/
-
-static int
-ProcXpQueryScreens(ClientPtr client)
-{
- /* REQUEST(xPrintQueryScreensReq); */
- int i, numPrintScreens, totalSize;
- WINDOW *pWinId;
- xPrintQueryScreensReply *rep;
- long l;
-
- REQUEST_SIZE_MATCH(xPrintQueryScreensReq);
-
- rep = (xPrintQueryScreensReply *)xalloc(sz_xPrintQueryScreensReply);
- pWinId = (WINDOW *)(rep + 1);
-
- for(i = 0, numPrintScreens = 0, totalSize = sz_xPrintQueryScreensReply;
- i < MAXSCREENS; i++)
- {
- /*
- * If a screen has registered with our extension, then it's
- * a printer screen.
- */
- if(XpScreens[i] != (XpScreenPtr)NULL)
- {
- numPrintScreens++;
- totalSize += sizeof(WINDOW);
- rep = (xPrintQueryScreensReply *)xrealloc(rep, totalSize);
- /* fix of bug: pWinId should be set again after reallocate rep */
- pWinId = (WINDOW *)(rep + 1);
- *pWinId = WindowTable[i]->drawable.id;
- if (client->swapped)
- swapl((long *)pWinId, l);
- }
- }
-
- rep->type = X_Reply;
- rep->sequenceNumber = client->sequence;
- rep->length = (totalSize - sz_xPrintQueryScreensReply) >> 2;
- rep->listCount = numPrintScreens;
- if (client->swapped)
- {
- int n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, l);
- swapl(&rep->listCount, l);
- }
-
- WriteToClient(client, totalSize, (char *)rep);
- xfree(rep);
- return client->noClientException;
-}
-
-static int
-ProcXpGetPageDimensions(ClientPtr client)
-{
- REQUEST(xPrintGetPageDimensionsReq);
- CARD16 width, height;
- xRectangle rect;
- xPrintGetPageDimensionsReply rep;
- XpContextPtr pContext;
- int result;
-
- REQUEST_SIZE_MATCH(xPrintGetPageDimensionsReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if((pContext->funcs.GetMediumDimensions == 0) ||
- (pContext->funcs.GetReproducibleArea == 0))
- return BadImplementation;
-
- result = pContext->funcs.GetMediumDimensions(pContext, &width, &height);
- if(result != Success)
- return result;
-
- result = pContext->funcs.GetReproducibleArea(pContext, &rect);
- if(result != Success)
- return result;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.width = width;
- rep.height = height;
- rep.rx = rect.x;
- rep.ry = rect.y;
- rep.rwidth = rect.width;
- rep.rheight = rect.height;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.width, n);
- swaps(&rep.height, n);
- swaps(&rep.rx, n);
- swaps(&rep.ry, n);
- swaps(&rep.rwidth, n);
- swaps(&rep.rheight, n);
- }
-
- WriteToClient(client, sz_xPrintGetPageDimensionsReply, (char *)&rep);
- return client->noClientException;
-}
-
-static int
-ProcXpSetImageResolution(ClientPtr client)
-{
- REQUEST(xPrintSetImageResolutionReq);
- xPrintSetImageResolutionReply rep;
- XpContextPtr pContext;
- Bool status;
- int result;
-
- REQUEST_SIZE_MATCH(xPrintSetImageResolutionReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- rep.prevRes = pContext->imageRes;
- if(pContext->funcs.SetImageResolution != 0) {
- result = pContext->funcs.SetImageResolution(pContext,
- (int)stuff->imageRes,
- &status);
- if(result != Success)
- status = FALSE;
- } else
- status = FALSE;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.prevRes, n);
- }
-
- WriteToClient(client, sz_xPrintSetImageResolutionReply, (char *)&rep);
- return client->noClientException;
-}
-
-static int
-ProcXpGetImageResolution(ClientPtr client)
-{
- REQUEST(xPrintGetImageResolutionReq);
- xPrintGetImageResolutionReply rep;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintGetImageResolutionReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.imageRes = pContext->imageRes;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.imageRes, n);
- }
-
- WriteToClient(client, sz_xPrintGetImageResolutionReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * RehashPrinterList : Cause the server's list of printers to be rebuilt.
- * This allows new printers to be added, or old ones
- * deleted without needing to restart the server.
- *
- ******************************************************************************/
-
-static int
-ProcXpRehashPrinterList(ClientPtr client)
-{
- /* REQUEST(xPrintRehashPrinterListReq); */
-
- REQUEST_SIZE_MATCH(xPrintRehashPrinterListReq);
-
- return XpRehashPrinterList();
-}
-
-/******************************************************************************
- *
- * Context functions: Init, Set, Destroy, FreeContext
- * AllocateContextPrivateIndex, AllocateContextPrivate
- * and supporting functions.
- *
- * Init creates a context, creates a XpClientRec for the calling
- * client, and stores the contextPtr in the client's devPrivates.
- *
- * Set creates a XpClientRec for the calling client, and stores the
- * contextPtr in the client's devPrivates unless the context is None.
- * If the context is None, then the client's connection association
- * with any context is removed.
- *
- * Destroy frees any and all XpClientRecs associated with the context,
- * frees the context itself, and removes the contextPtr from any
- * relevant client devPrivates.
- *
- * FreeContext is called by FreeResource to free up a context.
- *
- ******************************************************************************/
-
-/*
- * CreateContext creates and initializes the memory for the context itself.
- * The driver's CreateContext function
- * is then called.
- */
-static int
-ProcXpCreateContext(ClientPtr client)
-{
- REQUEST(xPrintCreateContextReq);
- XpScreenPtr pPrintScreen;
- WindowPtr pRoot;
- char *driverName;
- XpContextPtr pContext;
- int result = Success;
- XpDriverPtr pDriver;
-
- REQUEST_AT_LEAST_SIZE(xPrintCreateContextReq);
-
- LEGAL_NEW_RESOURCE(stuff->contextID, client);
-
- /*
- * Check to see if the printer name is valid.
- */
- if((pRoot = XpDiValidatePrinter((char *)(stuff + 1), stuff->printerNameLen)) ==
- (WindowPtr)NULL)
- return BadMatch;
-
- pPrintScreen = XpScreens[pRoot->drawable.pScreen->myNum];
-
- /*
- * Allocate and add the context resource.
- */
- if((pContext = (XpContextPtr) xalloc(totalContextSize)) ==
- (XpContextPtr) NULL)
- return BadAlloc;
-
- InitContextPrivates(pContext);
-
- if(AddResource(stuff->contextID, RTcontext, (pointer) pContext)
- != TRUE)
- {
- xfree(pContext);
- return BadAlloc;
- }
-
- pContext->contextID = stuff->contextID;
- pContext->clientHead = (XpClientPtr)NULL;
- pContext->screenNum = pRoot->drawable.pScreen->myNum;
- pContext->state = 0;
- pContext->clientSlept = (ClientPtr)NULL;
- pContext->imageRes = 0;
-
- pContext->funcs.DestroyContext = 0;
- pContext->funcs.StartJob = 0;
- pContext->funcs.EndJob = 0;
- pContext->funcs.StartDoc = 0;
- pContext->funcs.EndDoc = 0;
- pContext->funcs.StartPage = 0;
- pContext->funcs.EndPage = 0;
- pContext->funcs.PutDocumentData = 0;
- pContext->funcs.GetDocumentData = 0;
- pContext->funcs.GetAttributes = 0;
- pContext->funcs.GetOneAttribute = 0;
- pContext->funcs.SetAttributes = 0;
- pContext->funcs.AugmentAttributes = 0;
- pContext->funcs.GetMediumDimensions = 0;
- pContext->funcs.GetReproducibleArea = 0;
- pContext->funcs.SetImageResolution = 0;
-
- if((pContext->printerName = (char *)xalloc(stuff->printerNameLen + 1)) ==
- (char *)NULL)
- {
- /* Freeing the context also causes the XpClients to be freed. */
- FreeResource(stuff->contextID, RT_NONE);
- return BadAlloc;
- }
- strncpy(pContext->printerName, (char *)(stuff + 1), stuff->printerNameLen);
- pContext->printerName[stuff->printerNameLen] = (char)'\0';
-
- driverName = XpDiGetDriverName(pRoot->drawable.pScreen->myNum,
- pContext->printerName);
-
- for(pDriver = pPrintScreen->drivers;
- pDriver != (XpDriverPtr)NULL;
- pDriver = pDriver->next)
- {
- if(!strcmp(driverName, pDriver->name))
- {
- if(pDriver->CreateContext != 0)
- pDriver->CreateContext(pContext);
- else
- return BadImplementation;
- break;
- }
- }
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-/*
- * SetContext creates the calling client's contextClient resource,
- * and stashes the contextID in the client's devPrivate.
- */
-static int
-ProcXpSetContext(ClientPtr client)
-{
- REQUEST(xPrintSetContextReq);
-
- XpContextPtr pContext;
- XpClientPtr pPrintClient;
- int result = Success;
-
- REQUEST_AT_LEAST_SIZE(xPrintSetContextReq);
-
- if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) !=
- (pointer)NULL)
- {
- /*
- * Erase this client's knowledge of its old context, if any.
- */
- if((pPrintClient = FindClient(pContext, client)) != (XpClientPtr)NULL)
- {
- XpUnsetFontResFunc(client);
-
- if(pPrintClient->eventMask == 0)
- FreeXpClient(pPrintClient, TRUE);
- }
-
- client->devPrivates[XpClientPrivateIndex].ptr = (pointer)NULL;
- }
- if(stuff->printContext == None)
- return Success;
-
- /*
- * Check to see that the supplied XID is really a valid print context
- * in this server.
- */
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
- return BadAlloc;
-
- client->devPrivates[XpClientPrivateIndex].ptr = pContext;
-
- XpSetFontResFunc(client);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-XpContextPtr
-XpGetPrintContext(ClientPtr client)
-{
- return (client->devPrivates[XpClientPrivateIndex].ptr);
-}
-
-static int
-ProcXpGetContext(ClientPtr client)
-{
- /* REQUEST(xPrintGetContextReq); */
- xPrintGetContextReply rep;
-
- XpContextPtr pContext;
- register int n;
- register long l;
-
- REQUEST_SIZE_MATCH(xPrintGetContextReq);
-
- if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) ==
- (pointer)NULL)
- rep.printContext = None;
- else
- rep.printContext = pContext->contextID;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.printContext, l);
- }
- WriteToClient(client, sz_xPrintGetContextReply, (char *)&rep);
- return client->noClientException;
-}
-
-
-/*
- * DestroyContext frees the context associated with the calling client.
- * It operates by freeing the context resource ID, thus causing XpFreeContext
- * to be called.
- */
-static int
-ProcXpDestroyContext(ClientPtr client)
-{
- REQUEST(xPrintDestroyContextReq);
-
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintDestroyContextReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityDestroyAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- XpUnsetFontResFunc(client);
-
- FreeResource(pContext->contextID, RT_NONE);
-
- return Success;
-}
-
-static int
-ProcXpGetContextScreen(ClientPtr client)
-{
- REQUEST(xPrintGetContextScreenReq);
- xPrintGetContextScreenReply rep;
- XpContextPtr pContext;
- int n;
- long l;
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadContext;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.rootWindow = WindowTable[pContext->screenNum]->drawable.id;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.rootWindow, l);
- }
-
- WriteToClient(client, sz_xPrintGetContextScreenReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*
- * XpFreeContext is the routine called by dix:FreeResource when a context
- * resource ID is freed.
- * It checks to see if there's a partial job pending on the context, and
- * if so it calls the appropriate End procs with the cancel flag set.
- * It calls the driver's DestroyContext routine to allow the driver to clean
- * up any context-related memory or state.
- * It calls FreeXpClient to free all the
- * associated XpClientRecs and to set all the client->devPrivates to NULL.
- * It frees the printer name string, and frees the context
- * itself.
- */
-static int
-XpFreeContext(pointer data, XID id)
-{
- XpContextPtr pContext = (XpContextPtr)data;
-
- /* Clean up any pending job on this context */
- if(pContext->state != 0)
- {
- if(pContext->state & PAGE_STARTED)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- pContext->funcs.EndPage(pContext, pWin);
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
- pContext->state &= ~PAGE_STARTED;
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
- }
- if((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED))
- {
- pContext->funcs.EndDoc(pContext, TRUE);
- SendXpNotify(pContext, XPEndDocNotify, TRUE);
- pContext->state &= ~DOC_RAW_STARTED;
- pContext->state &= ~DOC_COOKED_STARTED;
- }
- if(pContext->funcs.EndJob != 0)
- {
- pContext->funcs.EndJob(pContext, TRUE);
- SendXpNotify(pContext, XPEndJobNotify, TRUE);
- pContext->state &= ~JOB_STARTED;
- pContext->state &= ~GET_DOC_DATA_STARTED;
- }
- }
-
- /*
- * Tell the driver we're destroying the context
- * This allows the driver to free and ContextPrivate data
- */
- if(pContext->funcs.DestroyContext != 0)
- pContext->funcs.DestroyContext(pContext);
-
- /* Free up all the XpClientRecs */
- while(pContext->clientHead != (XpClientPtr)NULL)
- {
- FreeXpClient(pContext->clientHead, TRUE);
- }
-
- xfree(pContext->printerName);
- xfree(pContext);
- return Success; /* ??? */
-}
-
-/*
- * XpFreeClient is the routine called by dix:FreeResource when a RTclient
- * is freed. It simply calls the FreeXpClient routine to do the work.
- */
-static int
-XpFreeClient(pointer data, XID id)
-{
- FreeXpClient((XpClientPtr)data, TRUE);
- return Success;
-}
-
-/*
- * FreeXpClient
- * frees the ClientRec passed in, and sets the client->devPrivates to NULL
- * if the client->devPrivates points to the same context as the XpClient.
- * Called from XpFreeContext(from FreeResource), and
- * XpFreeClient. The boolean freeResource specifies whether or not to call
- * FreeResource for the XpClientRec's XID. We should free it except if we're
- * called from XpFreeClient (which is itself called from FreeResource for the
- * XpClientRec's XID).
- */
-static void
-FreeXpClient(XpClientPtr pXpClient, Bool freeResource)
-{
- XpClientPtr pCurrent, pPrev;
- XpContextPtr pContext = pXpClient->context;
-
- /*
- * If we're freeing the clientRec associated with the context tied
- * to the client's devPrivates, then we need to clear the devPrivates.
- */
- if(pXpClient->client->devPrivates[XpClientPrivateIndex].ptr ==
- pXpClient->context)
- {
- pXpClient->client->devPrivates[XpClientPrivateIndex].ptr =
- (pointer)NULL;
- }
-
- for(pPrev = (XpClientPtr)NULL, pCurrent = pContext->clientHead;
- pCurrent != (XpClientPtr)NULL;
- pCurrent = pCurrent->pNext)
- {
- if(pCurrent == pXpClient)
- {
- if(freeResource == TRUE)
- FreeResource (pCurrent->contextClientID, RTclient);
-
- if (pPrev != (XpClientPtr)NULL)
- pPrev->pNext = pCurrent->pNext;
- else
- pContext->clientHead = pCurrent->pNext;
-
- xfree (pCurrent);
- break;
- }
- pPrev = pCurrent;
- }
-}
-
-/*
- * CreateXpClient takes a ClientPtr and returns a pointer to a
- * XpClientRec which it allocates. It also initializes the Rec,
- * including adding a resource on behalf of the client to enable the
- * freeing of the Rec when the client's connection is closed.
- */
-static XpClientPtr
-CreateXpClient(ClientPtr client)
-{
- XpClientPtr pNewPrintClient;
- XID clientResource;
-
- if((pNewPrintClient = (XpClientPtr)xalloc(sizeof(XpClientRec))) ==
- (XpClientPtr)NULL)
- return (XpClientPtr)NULL;
-
- clientResource = FakeClientID(client->index);
- if(!AddResource(clientResource, RTclient, (pointer)pNewPrintClient))
- {
- xfree (pNewPrintClient);
- return (XpClientPtr)NULL;
- }
-
- pNewPrintClient->pNext = (XpClientPtr)NULL;
- pNewPrintClient->client = client;
- pNewPrintClient->context = (XpContextPtr)NULL;
- pNewPrintClient->eventMask = 0;
- pNewPrintClient->contextClientID = clientResource;
-
- return pNewPrintClient;
-}
-
-/*
- * XpFreePage is the routine called by dix:FreeResource to free the page
- * resource built with the same ID as a page window. It checks to see
- * if we're in the middle of a page, and if so calls the driver's EndPage
- * function with 'cancel' set TRUE. It frees the memory associated with
- * the page resource.
- */
-static int
-XpFreePage(pointer data, XID id)
-{
- XpPagePtr page = (XpPagePtr)data;
- int result = Success;
- WindowPtr pWin = (WindowPtr )LookupIDByType(id, RT_WINDOW);
-
- /* Check to see if the window's being deleted in the middle of a page */
- if(page->context != (XpContextPtr)NULL &&
- page->context->state & PAGE_STARTED)
- {
- if(page->context->funcs.EndPage != 0)
- result = page->context->funcs.EndPage(page->context, pWin);
- SendXpNotify(page->context, XPEndPageNotify, (int)TRUE);
- page->context->pageWin = 0; /* None, NULL??? XXX */
- }
-
- xfree(page);
- return result;
-}
-
-/*
- * ContextPrivate machinery.
- * Context privates are intended for use by the drivers, allowing the
- * drivers to maintain context-specific data. The driver should free
- * the associated data at DestroyContext time.
- */
-
-static void
-InitContextPrivates(XpContextPtr context)
-{
- register char *ptr;
- DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- if (totalContextSize == sizeof(XpContextRec))
- ppriv = (DevUnion *)NULL;
- else
- ppriv = (DevUnion *)(context + 1);
-
- context->devPrivates = ppriv;
- sizes = contextPrivateSizes;
- ptr = (char *)(ppriv + contextPrivateLen);
- for (i = contextPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
-}
-
-static void
-ResetContextPrivates(void)
-{
- contextPrivateCount = 0;
- contextPrivateLen = 0;
- xfree(contextPrivateSizes);
- contextPrivateSizes = (unsigned *)NULL;
- totalContextSize = sizeof(XpContextRec);
-
-}
-
-int
-XpAllocateContextPrivateIndex(void)
-{
- return contextPrivateCount++;
-}
-
-Bool
-XpAllocateContextPrivate(int index, unsigned amount)
-{
- unsigned oldamount;
-
- if (index >= contextPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(contextPrivateSizes,
- (index + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (contextPrivateLen <= index)
- {
- nsizes[contextPrivateLen++] = 0;
- totalContextSize += sizeof(DevUnion);
- }
- contextPrivateSizes = nsizes;
- }
- oldamount = contextPrivateSizes[index];
- if (amount > oldamount)
- {
- contextPrivateSizes[index] = amount;
- totalContextSize += (amount - oldamount);
- }
- return TRUE;
-}
-
-static XpClientPtr
-AcquireClient(XpContextPtr pContext, ClientPtr client)
-{
- XpClientPtr pXpClient;
-
- if((pXpClient = FindClient(pContext, client)) != (XpClientPtr)NULL)
- return pXpClient;
-
- if((pXpClient = CreateXpClient(client)) == (XpClientPtr)NULL)
- return (XpClientPtr)NULL;
-
- pXpClient->context = pContext;
- pXpClient->pNext = pContext->clientHead;
- pContext->clientHead = pXpClient;
-
- return pXpClient;
-}
-
-static XpClientPtr
-FindClient(XpContextPtr pContext, ClientPtr client)
-{
- XpClientPtr pXpClient;
-
- for(pXpClient = pContext->clientHead; pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- if(pXpClient->client == client) return pXpClient;
- }
- return (XpClientPtr)NULL;
-}
-
-
-/******************************************************************************
- *
- * Start/End Functions: StartJob, EndJob, StartDoc, EndDoc, StartPage, EndPage
- *
- ******************************************************************************/
-
-static int
-ProcXpStartJob(ClientPtr client)
-{
- REQUEST(xPrintStartJobReq);
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintStartJobReq);
-
- /* Check to see that a context has been established by this client. */
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadContext;
-
- if(pContext->state != 0)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->saveData != XPSpool && stuff->saveData != XPGetData)
- {
- client->errorValue = stuff->saveData;
- return BadValue;
- }
-
- if(pContext->funcs.StartJob != 0)
- result = pContext->funcs.StartJob(pContext,
- (stuff->saveData == XPGetData)? TRUE:FALSE,
- client);
- else
- return BadImplementation;
-
- pContext->state = JOB_STARTED;
- if(stuff->saveData == XPGetData)
- pContext->state |= JOB_GET_DATA;
-
- SendXpNotify(pContext, XPStartJobNotify, FALSE);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndJob(ClientPtr client)
-{
- REQUEST(xPrintEndJobReq);
- int result = Success;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintEndJobReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED))
- return XpErrorBase+XPBadSequence;
-
- /* Check for missing EndDoc */
- if((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED))
- {
- if(pContext->state & PAGE_STARTED)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- if(stuff->cancel != TRUE)
- return XpErrorBase+XPBadSequence;
-
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
-
- pContext->state &= ~PAGE_STARTED;
-
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
-
- if(result != Success) return result;
- }
-
- if(pContext->funcs.EndDoc != 0)
- result = pContext->funcs.EndDoc(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndDocNotify, stuff->cancel);
- }
-
- if(pContext->funcs.EndJob != 0)
- result = pContext->funcs.EndJob(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- pContext->state = 0;
-
- SendXpNotify(pContext, XPEndJobNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static Bool
-DoStartDoc(ClientPtr client, XpStDocPtr c)
-{
- XpContextPtr pContext = c->pContext;
-
- if(c->pContext->state & JOB_GET_DATA &&
- !(c->pContext->state & GET_DOC_DATA_STARTED))
- {
- if(!c->slept)
- {
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)DoStartDoc, (pointer) c);
- c->pContext->clientSlept = client;
- }
- return TRUE;
- }
-
- if(pContext->funcs.StartDoc != 0)
- (void) pContext->funcs.StartDoc(pContext, c->type);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- if(c->type == XPDocNormal)
- pContext->state |= DOC_COOKED_STARTED;
- else
- pContext->state |= DOC_RAW_STARTED;
-
- SendXpNotify(pContext, XPStartDocNotify, (int)FALSE);
-
- xfree(c);
- return TRUE;
-}
-
-static int
-ProcXpStartDoc(ClientPtr client)
-{
- REQUEST(xPrintStartDocReq);
- int result = Success;
- XpContextPtr pContext;
- XpStDocPtr c;
-
- REQUEST_SIZE_MATCH(xPrintStartDocReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED) ||
- pContext->state & DOC_RAW_STARTED ||
- pContext->state & DOC_COOKED_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->type != XPDocNormal && stuff->type != XPDocRaw)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- c = (XpStDocPtr)xalloc(sizeof(XpStDocRec));
- c->pContext = pContext;
- c->type = stuff->type;
- c->slept = FALSE;
- (void)DoStartDoc(client, c);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndDoc(ClientPtr client)
-{
- REQUEST(xPrintEndDocReq);
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintEndDocReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & DOC_RAW_STARTED) &&
- !(pContext->state & DOC_COOKED_STARTED))
- return XpErrorBase+XPBadSequence;
-
- if(pContext->state & PAGE_STARTED)
- {
- if(stuff->cancel == TRUE)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
-
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
- }
- else
- return XpErrorBase+XPBadSequence;
- if(result != Success)
- return result;
- }
-
- if(pContext->funcs.EndDoc != 0)
- result = pContext->funcs.EndDoc(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- pContext->state &= ~DOC_RAW_STARTED;
- pContext->state &= ~DOC_COOKED_STARTED;
-
- SendXpNotify(pContext, XPEndDocNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static Bool
-DoStartPage(
- ClientPtr client,
- XpStPagePtr c)
-{
- WindowPtr pWin = c->pWin;
- int result = Success;
- XpContextPtr pContext = c->pContext;
- XpPagePtr pPage;
-
- if(c->pContext->state & JOB_GET_DATA &&
- !(c->pContext->state & GET_DOC_DATA_STARTED))
- {
- if(!c->slept)
- {
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)DoStartPage, (pointer) c);
- c->pContext->clientSlept = client;
- }
- return TRUE;
- }
-
- if(!(pContext->state & DOC_COOKED_STARTED))
- {
- /* Implied StartDoc if it was omitted */
- if(pContext->funcs.StartDoc != 0)
- result = pContext->funcs.StartDoc(pContext, XPDocNormal);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- if(result != Success)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0, result);
- return TRUE;
- }
-
- pContext->state |= DOC_COOKED_STARTED;
- SendXpNotify(pContext, XPStartDocNotify, (int)FALSE);
- }
-
- /* ensure the window's not already being used as a page */
- if((pPage = (XpPagePtr)LookupIDByType(c->pWin->drawable.id, RTpage)) !=
- (XpPagePtr)NULL)
- {
- if(pPage->context != (XpContextPtr)NULL)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadWindow);
- return TRUE;
- }
- }
- else
- {
- if((pPage = (XpPagePtr)xalloc(sizeof(XpPageRec))) == (XpPagePtr)NULL)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadAlloc);
- return TRUE;
- }
- if(AddResource(c->pWin->drawable.id, RTpage, pPage) == FALSE)
- {
- xfree(pPage);
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadAlloc);
- return TRUE;
- }
- }
-
- pPage->context = pContext;
- pContext->pageWin = c->pWin->drawable.id;
-
- if(pContext->funcs.StartPage != 0)
- result = pContext->funcs.StartPage(pContext, pWin);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- pContext->state |= PAGE_STARTED;
-
- (void)MapWindow(pWin, client);
-
- SendXpNotify(pContext, XPStartPageNotify, (int)FALSE);
-
- return TRUE;
-}
-
-static int
-ProcXpStartPage(ClientPtr client)
-{
- REQUEST(xPrintStartPageReq);
- WindowPtr pWin;
- int result = Success;
- XpContextPtr pContext;
- XpStPagePtr c;
-
- REQUEST_SIZE_MATCH(xPrintStartPageReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED))
- return XpErrorBase+XPBadSequence;
-
- /* can't have pages in a raw documented */
- if(pContext->state & DOC_RAW_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(pContext->state & PAGE_STARTED)
- return XpErrorBase+XPBadSequence;
-
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin || pWin->drawable.pScreen->myNum != pContext->screenNum)
- return BadWindow;
-
- if((c = (XpStPagePtr)xalloc(sizeof(XpStPageRec))) == (XpStPagePtr)NULL)
- return BadAlloc;
- c->pContext = pContext;
- c->slept = FALSE;
- c->pWin = pWin;
-
- (void)DoStartPage(client, c);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndPage(ClientPtr client)
-{
- REQUEST(xPrintEndPageReq);
- int result = Success;
- XpContextPtr pContext;
- XpPagePtr page;
- WindowPtr pWin;
-
- REQUEST_SIZE_MATCH(xPrintEndPageReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & PAGE_STARTED))
- return XpErrorBase+XPBadSequence;
-
- pWin = (WindowPtr )LookupIDByType(pContext->pageWin, RT_WINDOW);
-
- /* Call the ddx's EndPage proc. */
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- if((page = (XpPagePtr)LookupIDByType(pContext->pageWin, RTpage)) !=
- (XpPagePtr)NULL)
- page->context = (XpContextPtr)NULL;
-
- pContext->state &= ~PAGE_STARTED;
- pContext->pageWin = 0; /* None, NULL??? XXX */
-
- (void)UnmapWindow(pWin, FALSE);
-
- SendXpNotify(pContext, XPEndPageNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-/*******************************************************************************
- *
- * Document Data Functions: PutDocumentData, GetDocumentData
- *
- ******************************************************************************/
-
-static int
-ProcXpPutDocumentData(ClientPtr client)
-{
- REQUEST(xPrintPutDocumentDataReq);
- XpContextPtr pContext;
- DrawablePtr pDraw;
- int result = Success;
- unsigned totalSize;
- char *pData, *pDoc_fmt, *pOptions;
-
- REQUEST_AT_LEAST_SIZE(xPrintPutDocumentDataReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & DOC_RAW_STARTED) &&
- !(pContext->state & DOC_COOKED_STARTED))
- return XpErrorBase+XPBadSequence;
-
- if (stuff->drawable) {
- if (pContext->state & DOC_RAW_STARTED)
- return BadDrawable;
- pDraw = (DrawablePtr)LookupDrawable(stuff->drawable, client);
- if (!pDraw || pDraw->pScreen->myNum != pContext->screenNum)
- return BadDrawable;
- } else {
- if (pContext->state & DOC_COOKED_STARTED)
- return BadDrawable;
- pDraw = NULL;
- }
-
- pData = (char *)(&stuff[1]);
-
- totalSize = (stuff->len_data + 3) >> 2;
- pDoc_fmt = pData + (totalSize << 2);
-
- totalSize += (stuff->len_fmt + 3) >> 2;
- pOptions = pData + (totalSize << 2);
-
- totalSize += (stuff->len_options + 3) >> 2;
- if((totalSize + (sz_xPrintPutDocumentDataReq >> 2)) != client->req_len)
- return BadLength;
-
- if(pContext->funcs.PutDocumentData != 0)
- {
- result = (*pContext->funcs.PutDocumentData)(pContext, pDraw,
- pData, stuff->len_data,
- pDoc_fmt, stuff->len_fmt,
- pOptions, stuff->len_options,
- client);
- }
- else
- return BadImplementation;
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpGetDocumentData(ClientPtr client)
-{
- REQUEST(xPrintGetDocumentDataReq);
- xPrintGetDocumentDataReply rep;
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintGetDocumentDataReq);
-
- if((pContext = (XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetDocumentData == 0)
- return BadImplementation;
-
- if(!(pContext->state & JOB_GET_DATA) ||
- pContext->state & GET_DOC_DATA_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->maxBufferSize <= 0)
- {
- client->errorValue = stuff->maxBufferSize;
- return BadValue; /* gotta have a positive buffer size */
- }
-
- result = (*pContext->funcs.GetDocumentData)(pContext, client,
- stuff->maxBufferSize);
- if(result != Success)
- {
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.dataLen = 0;
- rep.statusCode = 1;
- rep.finishedFlag = TRUE;
- if (client->swapped) {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.statusCode, l); /* XXX Why are these longs??? */
- swapl(&rep.finishedFlag, l); /* XXX Why are these longs??? */
- }
- (void)WriteToClient(client,sz_xPrintGetDocumentDataReply,(char *)&rep);
- }
- else
- pContext->state |= GET_DOC_DATA_STARTED;
-
- if(pContext->clientSlept != (ClientPtr)NULL)
- {
- ClientSignal(pContext->clientSlept);
- ClientWakeup(pContext->clientSlept);
- pContext->clientSlept = (ClientPtr)NULL;
- }
-
- return result;
-}
-
-/*******************************************************************************
- *
- * Attribute requests: GetAttributes, SetAttributes, GetOneAttribute
- *
- ******************************************************************************/
-
-static int
-ProcXpGetAttributes(ClientPtr client)
-{
- REQUEST(xPrintGetAttributesReq);
- XpContextPtr pContext;
- char *attrs;
- xPrintGetAttributesReply *pRep;
- int totalSize, n;
- unsigned long l;
-
- REQUEST_SIZE_MATCH(xPrintGetAttributesReq);
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- if(stuff->type != XPServerAttr)
- {
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetAttributes == 0)
- return BadImplementation;
- if((attrs = (*pContext->funcs.GetAttributes)(pContext, stuff->type)) ==
- (char *)NULL)
- return BadAlloc;
- }
- else
- {
- if((attrs = XpGetAttributes((XpContextPtr)NULL, XPServerAttr)) ==
- (char *)NULL)
- return BadAlloc;
- }
-
- totalSize = sz_xPrintGetAttributesReply + QUADPAD(strlen(attrs));
- if((pRep = (xPrintGetAttributesReply *)malloc(totalSize)) ==
- (xPrintGetAttributesReply *)NULL)
- return BadAlloc;
-
- pRep->type = X_Reply;
- pRep->length = (totalSize - sz_xPrintGetAttributesReply) >> 2;
- pRep->sequenceNumber = client->sequence;
- pRep->stringLen = strlen(attrs);
-
- if (client->swapped) {
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, l);
- swapl(&pRep->stringLen, l);
- }
-
- strncpy((char*)(pRep + 1), attrs, strlen(attrs));
- xfree(attrs);
-
- WriteToClient(client, totalSize, (char *)pRep);
-
- xfree(pRep);
-
- return client->noClientException;
-}
-
-static int
-ProcXpSetAttributes(ClientPtr client)
-{
- REQUEST(xPrintSetAttributesReq);
- int result = Success;
- XpContextPtr pContext;
- char *attr;
-
- REQUEST_AT_LEAST_SIZE(xPrintSetAttributesReq);
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- /*
- * Disallow changing of read-only attribute pools
- */
- if(stuff->type == XPPrinterAttr || stuff->type == XPServerAttr)
- return BadMatch;
-
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.SetAttributes == 0)
- return BadImplementation;
-
- /*
- * Check for attributes being set after their relevant phase
- * has already begun (e.g. Job attributes set after StartJob).
- */
- if((pContext->state & JOB_STARTED) && stuff->type == XPJobAttr)
- return XpErrorBase+XPBadSequence;
- if(((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED)) && stuff->type == XPDocAttr)
- return XpErrorBase+XPBadSequence;
- if((pContext->state & PAGE_STARTED) && stuff->type == XPPageAttr)
- return XpErrorBase+XPBadSequence;
-
- if((attr = (char *)malloc(stuff->stringLen + 1)) == (char *)NULL)
- return BadAlloc;
-
- strncpy(attr, (char *)(stuff + 1), stuff->stringLen);
- attr[stuff->stringLen] = (char)'\0';
-
- if(stuff->rule == XPAttrReplace)
- (*pContext->funcs.SetAttributes)(pContext, stuff->type, attr);
- else if(stuff->rule == XPAttrMerge)
- (*pContext->funcs.AugmentAttributes)(pContext, stuff->type, attr);
- else
- {
- client->errorValue = stuff->rule;
- result = BadValue;
- }
-
- xfree(attr);
-
- SendAttributeNotify(pContext, stuff->type);
-
- return result;
-}
-
-static int
-ProcXpGetOneAttribute(ClientPtr client)
-{
- REQUEST(xPrintGetOneAttributeReq);
- XpContextPtr pContext;
- char *value, *attrName;
- xPrintGetOneAttributeReply *pRep;
- int totalSize;
- int n;
- unsigned long l;
-
- REQUEST_AT_LEAST_SIZE(xPrintGetOneAttributeReq);
-
- totalSize = ((sz_xPrintGetOneAttributeReq) >> 2) +
- ((stuff->nameLen + 3) >> 2);
- if(totalSize != client->req_len)
- return BadLength;
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- if((attrName = (char *)malloc(stuff->nameLen + 1)) == (char *)NULL)
- return BadAlloc;
- strncpy(attrName, (char *)(stuff+1), stuff->nameLen);
- attrName[stuff->nameLen] = (char)'\0';
-
- if(stuff->type != XPServerAttr)
- {
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetOneAttribute == 0)
- return BadImplementation;
- if((value = (*pContext->funcs.GetOneAttribute)(pContext, stuff->type,
- attrName)) == (char *)NULL)
- return BadAlloc;
- }
- else
- {
- if((value = XpGetOneAttribute((XpContextPtr)NULL, XPServerAttr,
- attrName)) == (char *)NULL)
- return BadAlloc;
- }
-
- free(attrName);
-
- totalSize = sz_xPrintGetOneAttributeReply + QUADPAD(strlen(value));
- if((pRep = (xPrintGetOneAttributeReply *)malloc(totalSize)) ==
- (xPrintGetOneAttributeReply *)NULL)
- return BadAlloc;
-
- pRep->type = X_Reply;
- pRep->length = (totalSize - sz_xPrintGetOneAttributeReply) >> 2;
- pRep->sequenceNumber = client->sequence;
- pRep->valueLen = strlen(value);
-
- if (client->swapped) {
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, l);
- swapl(&pRep->valueLen, l);
- }
-
- strncpy((char*)(pRep + 1), value, strlen(value));
-
- WriteToClient(client, totalSize, (char *)pRep);
-
- xfree(pRep);
-
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * Print Event requests: SelectInput InputSelected, SendXpNotify
- *
- ******************************************************************************/
-
-
-static int
-ProcXpSelectInput(ClientPtr client)
-{
- REQUEST(xPrintSelectInputReq);
- int result = Success;
- XpContextPtr pContext;
- XpClientPtr pPrintClient;
-
- REQUEST_SIZE_MATCH(xPrintSelectInputReq);
-
- /*
- * Check to see that the supplied XID is really a valid print context
- * in this server.
- */
- if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(stuff->eventMask & ~allEvents)
- {
- client->errorValue = stuff->eventMask;
- return BadValue; /* bogus event mask bits */
- }
-
- if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
- return BadAlloc;
-
- pPrintClient->eventMask = stuff->eventMask;
-
- return result;
-}
-
-static int
-ProcXpInputSelected(ClientPtr client)
-{
- REQUEST(xPrintInputSelectedReq);
- xPrintInputSelectedReply rep;
- register int n;
- long l;
- XpClientPtr pXpClient;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintInputSelectedReq);
-
- if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- pXpClient = FindClient(pContext, client);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.eventMask = (pXpClient != (XpClientPtr)NULL)? pXpClient->eventMask : 0;
- rep.allEventsMask = GetAllEventMasks(pContext);
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.eventMask, l);
- swapl(&rep.allEventsMask, l);
- }
-
- WriteToClient(client, sz_xPrintInputSelectedReply, (char *)&rep);
- return client->noClientException;
-}
-
-static void
-SendAttributeNotify(XpContextPtr pContext, int which)
-{
- XpClientPtr pXpClient;
- xPrintAttributeEvent ae;
- ClientPtr client;
-
- pXpClient = pContext->clientHead;
- if(pXpClient == (XpClientPtr)NULL)
- return; /* Nobody's interested in the events (or this context). */
-
- for (pXpClient = pContext->clientHead;
- pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- client = pXpClient->client;
- if (client == serverClient || client->clientGone ||
- !(pXpClient->eventMask & XPAttributeMask))
- continue;
- ae.type = XPAttributeNotify + XpEventBase;
- ae.detail = which;
- ae.printContext = pContext->contextID;
- ae.sequenceNumber = client->sequence;
- WriteEventsToClient (client, 1, (xEvent *) &ae);
- }
-}
-
-static void
-SendXpNotify(XpContextPtr pContext, int which, int val)
-{
- XpClientPtr pXpClient;
- xPrintPrintEvent pe;
- ClientPtr client;
-
- pXpClient = pContext->clientHead;
- if(pXpClient == (XpClientPtr)NULL)
- return; /* Nobody's interested in the events (or this context). */
-
- for (pXpClient = pContext->clientHead;
- pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- client = pXpClient->client;
- if (client == serverClient || client->clientGone ||
- !(pXpClient->eventMask & XPPrintMask))
- continue;
- pe.type = XPPrintNotify + XpEventBase;
- pe.detail = which;
- pe.printContext = pContext->contextID;
- pe.cancel = (Bool)val;
- pe.sequenceNumber = client->sequence;
- WriteEventsToClient (client, 1, (xEvent *) &pe);
- }
-}
-
-static CARD32
-GetAllEventMasks(XpContextPtr pContext)
-{
- XpClientPtr pPrintClient;
- CARD32 totalMask = (CARD32)0;
-
- for (pPrintClient = pContext->clientHead;
- pPrintClient != (XpClientPtr)NULL;
- pPrintClient = pPrintClient->pNext)
- {
- totalMask |= pPrintClient->eventMask;
- }
- return totalMask;
-}
-
-/*
- * XpContextOfClient - returns the XpContextPtr to the context
- * associated with the specified client, or NULL if the client
- * does not currently have a context set.
- */
-XpContextPtr
-XpContextOfClient(ClientPtr client)
-{
- return (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr;
-}
-
-
-/*******************************************************************************
- *
- * Swap-request functions
- *
- ******************************************************************************/
-
-static int
-SProcXpCreateContext(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintCreateContextReq);
-
- swaps(&stuff->length, i);
- swapl(&stuff->contextID, n);
- swapl(&stuff->printerNameLen, n);
- swapl(&stuff->localeLen, n);
- return ProcXpCreateContext(client);
-}
-
-static int
-SProcXpGetPrinterList(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintGetPrinterListReq);
-
- swaps(&stuff->length, i);
- swapl(&stuff->printerNameLen, n);
- swapl(&stuff->localeLen, n);
- return ProcXpGetPrinterList(client);
-}
-
-static int
-SProcXpRehashPrinterList(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintRehashPrinterListReq);
- swaps(&stuff->length, i);
- return ProcXpRehashPrinterList(client);
-}
-
-static int
-SProcXpSetContext(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintSetContextReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, i);
- return ProcXpSetContext(client);
-}
-
-static int
-SProcXpGetContext(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintGetContextReq);
- swaps(&stuff->length, i);
- return ProcXpGetContext(client);
-}
-
-static int
-SProcXpDestroyContext(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintDestroyContextReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpDestroyContext(client);
-}
-
-static int
-SProcXpGetContextScreen(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintGetContextScreenReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetContextScreen(client);
-}
-
-static int
-SProcXpInputSelected(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintInputSelectedReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpInputSelected(client);
-}
-
-static int
-SProcXpStartJob(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintStartJobReq);
- swaps(&stuff->length, i);
- return ProcXpStartJob(client);
-}
-
-static int
-SProcXpEndJob(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndJobReq);
- swaps(&stuff->length, i);
- return ProcXpEndJob(client);
-}
-
-static int
-SProcXpStartDoc(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintStartDocReq);
- swaps(&stuff->length, i);
- return ProcXpStartDoc(client);
-}
-
-static int
-SProcXpEndDoc(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndDocReq);
- swaps(&stuff->length, i);
- return ProcXpEndDoc(client);
-}
-
-static int
-SProcXpStartPage(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintStartPageReq);
- swaps(&stuff->length, i);
- swapl(&stuff->window, n);
- return ProcXpStartPage(client);
-}
-
-static int
-SProcXpEndPage(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndPageReq);
- swaps(&stuff->length, i);
- return ProcXpEndPage(client);
-}
-
-static int
-SProcXpPutDocumentData(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintPutDocumentDataReq);
- swaps(&stuff->length, i);
- swapl(&stuff->drawable, n);
- swapl(&stuff->len_data, n);
- swaps(&stuff->len_fmt, i);
- swaps(&stuff->len_options, i);
- return ProcXpPutDocumentData(client);
-}
-
-static int
-SProcXpGetDocumentData(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetDocumentDataReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->maxBufferSize, n);
- return ProcXpGetDocumentData(client);
-}
-
-static int
-SProcXpGetAttributes(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetAttributesReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetAttributes(client);
-}
-
-static int
-SProcXpSetAttributes(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSetAttributesReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->stringLen, n);
- return ProcXpSetAttributes(client);
-}
-
-static int
-SProcXpGetOneAttribute(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetOneAttributeReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->nameLen, n);
- return ProcXpGetOneAttribute(client);
-}
-
-static int
-SProcXpSelectInput(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSelectInputReq);
- swaps(&stuff->length, i);
- swapl(&stuff->eventMask, n);
- swapl(&stuff->printContext, n);
- return ProcXpSelectInput(client);
-}
-
-static int
-SProcXpGetPageDimensions(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetPageDimensionsReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetPageDimensions(client);
-}
-
-static int
-SProcXpSetImageResolution(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSetImageResolutionReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swaps(&stuff->imageRes, i);
- return ProcXpSetImageResolution(client);
-}
-
-static int
-SProcXpGetImageResolution(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetImageResolutionReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetImageResolution(client);
-}
-
-static void
-SwapXpNotifyEvent(xPrintPrintEvent *src, xPrintPrintEvent *dst)
-{
- /*
- * Swap the sequence number and context fields.
- */
- cpswaps(src->sequenceNumber, dst->sequenceNumber);
- cpswapl(src->printContext, dst->printContext);
-
- /*
- * Copy the byte-long fields.
- */
- dst->type = src->type;
- dst->detail = src->detail;
- dst->cancel = src->cancel;
-}
-
-static void
-SwapXpAttributeEvent(xPrintAttributeEvent *src, xPrintAttributeEvent *dst)
-{
- /*
- * Swap the sequence number and context fields.
- */
- cpswaps(src->sequenceNumber, dst->sequenceNumber);
- cpswapl(src->printContext, dst->printContext);
-
- /*
- * Copy the byte-long fields.
- */
- dst->type = src->type;
- dst->detail = src->detail;
-}
diff --git a/Xext/xres.c b/Xext/xres.c
deleted file mode 100644
index c024f7be8..000000000
--- a/Xext/xres.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- Copyright (c) 2002 XFree86 Inc
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.8 2003/10/28 23:08:44 tsi Exp $ */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "swaprep.h"
-#include "XResproto.h"
-#include "pixmapstr.h"
-#include "modinit.h"
-
-static int
-ProcXResQueryVersion (ClientPtr client)
-{
- REQUEST(xXResQueryVersionReq);
- xXResQueryVersionReply rep;
- CARD16 client_major, client_minor; /* not used */
-
- REQUEST_SIZE_MATCH (xXResQueryVersionReq);
-
- client_major = stuff->client_major;
- client_minor = stuff->client_minor;
- (void) client_major;
- (void) client_minor;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.server_major = XRES_MAJOR_VERSION;
- rep.server_minor = XRES_MINOR_VERSION;
- if (client->swapped) {
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.server_major, n);
- swaps(&rep.server_minor, n);
- }
- WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXResQueryClients (ClientPtr client)
-{
- /* REQUEST(xXResQueryClientsReq); */
- xXResQueryClientsReply rep;
- int *current_clients;
- int i;
-
- REQUEST_SIZE_MATCH(xXResQueryClientsReq);
-
- current_clients = ALLOCATE_LOCAL((currentMaxClients - 1) * sizeof(int));
-
- rep.num_clients = 0;
- for(i = 1; i < currentMaxClients; i++) {
- if(clients[i]) {
- current_clients[rep.num_clients] = i;
- rep.num_clients++;
- }
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = rep.num_clients * sz_xXResClient >> 2;
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.num_clients, n);
- }
- WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
-
- if(rep.num_clients) {
- xXResClient scratch;
-
- for(i = 0; i < rep.num_clients; i++) {
- scratch.resource_base = clients[current_clients[i]]->clientAsMask;
- scratch.resource_mask = RESOURCE_ID_MASK;
-
- if(client->swapped) {
- register int n;
- swapl (&scratch.resource_base, n);
- swapl (&scratch.resource_mask, n);
- }
- WriteToClient (client, sz_xXResClient, (char *) &scratch);
- }
- }
-
- DEALLOCATE_LOCAL(current_clients);
-
- return (client->noClientException);
-}
-
-
-static void
-ResFindAllRes (pointer value, XID id, RESTYPE type, pointer cdata)
-{
- int *counts = (int *)cdata;
-
- counts[(type & TypeMask) - 1]++;
-}
-
-static int
-ProcXResQueryClientResources (ClientPtr client)
-{
- REQUEST(xXResQueryClientResourcesReq);
- xXResQueryClientResourcesReply rep;
- int i, clientID;
- int *counts;
-
- REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
-
- clientID = CLIENT_ID(stuff->xid);
-
- /* we could remove the (clientID == 0) check if we wanted to allow
- probing the X-server's resource usage */
- if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
- client->errorValue = stuff->xid;
- return BadValue;
- }
-
- counts = ALLOCATE_LOCAL((lastResourceType + 1) * sizeof(int));
-
- memset(counts, 0, (lastResourceType + 1) * sizeof(int));
-
- FindAllClientResources(clients[clientID], ResFindAllRes, counts);
-
- rep.num_types = 0;
-
- for(i = 0; i <= lastResourceType; i++) {
- if(counts[i]) rep.num_types++;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = rep.num_types * sz_xXResType >> 2;
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.num_types, n);
- }
- WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
-
- if(rep.num_types) {
- xXResType scratch;
-
- for(i = 0; i < lastResourceType; i++) {
- if(!counts[i]) continue;
-
- if(!ResourceNames[i + 1]) {
- char buf[40];
- sprintf(buf, "Unregistered resource %i", i + 1);
- RegisterResourceName(i + 1, buf);
- }
-
- scratch.resource_type = ResourceNames[i + 1];
- scratch.count = counts[i];
-
- if(client->swapped) {
- register int n;
- swapl (&scratch.resource_type, n);
- swapl (&scratch.count, n);
- }
- WriteToClient (client, sz_xXResType, (char *) &scratch);
- }
- }
-
- DEALLOCATE_LOCAL(counts);
-
- return (client->noClientException);
-}
-
-static void
-ResFindPixmaps (pointer value, XID id, pointer cdata)
-{
- unsigned long *bytes = (unsigned long *)cdata;
- PixmapPtr pix = (PixmapPtr)value;
-
- *bytes += (pix->devKind * pix->drawable.height);
-}
-
-static int
-ProcXResQueryClientPixmapBytes (ClientPtr client)
-{
- REQUEST(xXResQueryClientPixmapBytesReq);
- xXResQueryClientPixmapBytesReply rep;
- int clientID;
- unsigned long bytes;
-
- REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
-
- clientID = CLIENT_ID(stuff->xid);
-
- /* we could remove the (clientID == 0) check if we wanted to allow
- probing the X-server's resource usage */
- if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
- client->errorValue = stuff->xid;
- return BadValue;
- }
-
- bytes = 0;
-
- FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
- (pointer)(&bytes));
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.bytes = bytes;
-#ifdef XSERVER64
- rep.bytes_overflow = bytes >> 32;
-#else
- rep.bytes_overflow = 0;
-#endif
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.bytes, n);
- swapl (&rep.bytes_overflow, n);
- }
- WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
-
- return (client->noClientException);
-}
-
-
-static void
-ResResetProc (ExtensionEntry *extEntry) { }
-
-static int
-ProcResDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_XResQueryVersion:
- return ProcXResQueryVersion(client);
- case X_XResQueryClients:
- return ProcXResQueryClients(client);
- case X_XResQueryClientResources:
- return ProcXResQueryClientResources(client);
- case X_XResQueryClientPixmapBytes:
- return ProcXResQueryClientPixmapBytes(client);
- default: break;
- }
-
- return BadRequest;
-}
-
-static int
-SProcXResQueryVersion (ClientPtr client)
-{
- REQUEST(xXResQueryVersionReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryVersionReq);
- swaps(&stuff->client_major,n);
- swaps(&stuff->client_minor,n);
- return ProcXResQueryVersion(client);
-}
-
-static int
-SProcXResQueryClientResources (ClientPtr client)
-{
- REQUEST(xXResQueryClientResourcesReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
- swaps(&stuff->xid,n);
- return ProcXResQueryClientResources(client);
-}
-
-static int
-SProcXResQueryClientPixmapBytes (ClientPtr client)
-{
- REQUEST(xXResQueryClientPixmapBytesReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
- swaps(&stuff->xid,n);
- return ProcXResQueryClientPixmapBytes(client);
-}
-
-static int
-SProcResDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- int n;
-
- swaps(&stuff->length,n);
-
- switch (stuff->data) {
- case X_XResQueryVersion:
- return SProcXResQueryVersion(client);
- case X_XResQueryClients: /* nothing to swap */
- return ProcXResQueryClients(client);
- case X_XResQueryClientResources:
- return SProcXResQueryClientResources(client);
- case X_XResQueryClientPixmapBytes:
- return SProcXResQueryClientPixmapBytes(client);
- default: break;
- }
-
- return BadRequest;
-}
-
-void
-ResExtensionInit(INITARGS)
-{
- (void) AddExtension(XRES_NAME, 0, 0,
- ProcResDispatch, SProcResDispatch,
- ResResetProc, StandardMinorOpcode);
-
- RegisterResourceName(RT_NONE, "NONE");
- RegisterResourceName(RT_WINDOW, "WINDOW");
- RegisterResourceName(RT_PIXMAP, "PIXMAP");
- RegisterResourceName(RT_GC, "GC");
- RegisterResourceName(RT_FONT, "FONT");
- RegisterResourceName(RT_CURSOR, "CURSOR");
- RegisterResourceName(RT_COLORMAP, "COLORMAP");
- RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
- RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
- RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
-}
diff --git a/Xext/xtest.c b/Xext/xtest.c
deleted file mode 100644
index 89bcae3a4..000000000
--- a/Xext/xtest.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/* $Xorg: xtest.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/*
-
-Copyright 1992, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.11 2003/11/17 22:20:27 dawes Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "windowstr.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "dixevents.h"
-#include "sleepuntil.h"
-#define _XTEST_SERVER_
-#include "XTest.h"
-#include "xteststr.h"
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#define EXTENSION_EVENT_BASE 64
-#include "extinit.h" /* LookupDeviceIntRec */
-#endif /* XINPUT */
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-#include "modinit.h"
-
-#if 0
-static unsigned char XTestReqCode;
-#endif
-
-#ifdef XINPUT
-extern int DeviceValuator;
-#endif /* XINPUT */
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-static void XTestResetProc(
- ExtensionEntry * /* extEntry */
-);
-static int XTestSwapFakeInput(
- ClientPtr /* client */,
- xReq * /* req */
-);
-
-static DISPATCH_PROC(ProcXTestCompareCursor);
-static DISPATCH_PROC(ProcXTestDispatch);
-static DISPATCH_PROC(ProcXTestFakeInput);
-static DISPATCH_PROC(ProcXTestGetVersion);
-static DISPATCH_PROC(ProcXTestGrabControl);
-static DISPATCH_PROC(SProcXTestCompareCursor);
-static DISPATCH_PROC(SProcXTestDispatch);
-static DISPATCH_PROC(SProcXTestFakeInput);
-static DISPATCH_PROC(SProcXTestGetVersion);
-static DISPATCH_PROC(SProcXTestGrabControl);
-
-void
-XTestExtensionInit(INITARGS)
-{
-#if 0
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(XTestExtensionName, 0, 0,
- ProcXTestDispatch, SProcXTestDispatch,
- XTestResetProc, StandardMinorOpcode)) != 0)
- XTestReqCode = (unsigned char)extEntry->base;
-#else
- (void) AddExtension(XTestExtensionName, 0, 0,
- ProcXTestDispatch, SProcXTestDispatch,
- XTestResetProc, StandardMinorOpcode);
-#endif
-}
-
-/*ARGSUSED*/
-static void
-XTestResetProc (extEntry)
-ExtensionEntry *extEntry;
-{
-}
-
-static int
-ProcXTestGetVersion(client)
- register ClientPtr client;
-{
- xXTestGetVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xXTestGetVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XTestMajorVersion;
- rep.minorVersion = XTestMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcXTestCompareCursor(client)
- register ClientPtr client;
-{
- REQUEST(xXTestCompareCursorReq);
- xXTestCompareCursorReply rep;
- WindowPtr pWin;
- CursorPtr pCursor;
- register int n;
-
- REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
- pWin = (WindowPtr)LookupWindow(stuff->window, client);
- if (!pWin)
- return(BadWindow);
- if (stuff->cursor == None)
- pCursor = NullCursor;
- else if (stuff->cursor == XTestCurrentCursor)
- pCursor = GetSpriteCursor();
- else {
- pCursor = (CursorPtr)LookupIDByType(stuff->cursor, RT_CURSOR);
- if (!pCursor)
- {
- client->errorValue = stuff->cursor;
- return (BadCursor);
- }
- }
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.same = (wCursor(pWin) == pCursor);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- }
- WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
- return(client->noClientException);
-}
-
-static int
-ProcXTestFakeInput(client)
- register ClientPtr client;
-{
- REQUEST(xXTestFakeInputReq);
- int nev;
- int n;
- xEvent *ev;
- DeviceIntPtr dev = NULL;
- WindowPtr root;
- int type;
-#ifdef XINPUT
- Bool extension = FALSE;
- deviceValuator *dv = NULL;
- int base;
- int *values;
-#endif /* XINPUT */
-
- nev = (stuff->length << 2) - sizeof(xReq);
- if ((nev % sizeof(xEvent)) || !nev)
- return BadLength;
- nev /= sizeof(xEvent);
- UpdateCurrentTime();
- ev = (xEvent *)&((xReq *)stuff)[1];
- type = ev->u.u.type & 0177;
-#ifdef XINPUT
- if (type >= EXTENSION_EVENT_BASE)
- {
- type -= DeviceValuator;
- switch (type) {
- case XI_DeviceKeyPress:
- case XI_DeviceKeyRelease:
- case XI_DeviceButtonPress:
- case XI_DeviceButtonRelease:
- case XI_DeviceMotionNotify:
- case XI_ProximityIn:
- case XI_ProximityOut:
- break;
- default:
- client->errorValue = ev->u.u.type;
- return BadValue;
- }
- if (nev == 1 && type == XI_DeviceMotionNotify)
- return BadLength;
- if (type == XI_DeviceMotionNotify)
- base = ((deviceValuator *)(ev+1))->first_valuator;
- else
- base = 0;
- for (n = 1; n < nev; n++)
- {
- dv = (deviceValuator *)(ev + n);
- if (dv->type != DeviceValuator)
- {
- client->errorValue = dv->type;
- return BadValue;
- }
- if (dv->first_valuator != base)
- {
- client->errorValue = dv->first_valuator;
- return BadValue;
- }
- if (!dv->num_valuators || dv->num_valuators > 6)
- {
- client->errorValue = dv->num_valuators;
- return BadValue;
- }
- base += dv->num_valuators;
- }
- type = type - XI_DeviceKeyPress + KeyPress;
- extension = TRUE;
- }
- else
-#endif /* XINPUT */
- {
- if (nev != 1)
- return BadLength;
- switch (type)
- {
- case KeyPress:
- case KeyRelease:
- case MotionNotify:
- case ButtonPress:
- case ButtonRelease:
- break;
- default:
- client->errorValue = ev->u.u.type;
- return BadValue;
- }
- }
- if (ev->u.keyButtonPointer.time)
- {
- TimeStamp activateTime;
- CARD32 ms;
-
- activateTime = currentTime;
- ms = activateTime.milliseconds + ev->u.keyButtonPointer.time;
- if (ms < activateTime.milliseconds)
- activateTime.months++;
- activateTime.milliseconds = ms;
- ev->u.keyButtonPointer.time = 0;
-
- /* see mbuf.c:QueueDisplayRequest for code similar to this */
-
- if (!ClientSleepUntil(client, &activateTime, NULL, NULL))
- {
- return BadAlloc;
- }
- /* swap the request back so we can simply re-execute it */
- if (client->swapped)
- {
- (void) XTestSwapFakeInput(client, (xReq *)stuff);
- swaps(&stuff->length, n);
- }
- ResetCurrentRequest (client);
- client->sequence--;
- return Success;
- }
-#ifdef XINPUT
- if (extension)
- {
- dev = LookupDeviceIntRec(stuff->deviceid & 0177);
- if (!dev)
- {
- client->errorValue = stuff->deviceid & 0177;
- return BadValue;
- }
- if (nev > 1)
- {
- dv = (deviceValuator *)(ev + 1);
- if (!dev->valuator || dv->first_valuator >= dev->valuator->numAxes)
- {
- client->errorValue = dv->first_valuator;
- return BadValue;
- }
- if (dv->first_valuator + dv->num_valuators >
- dev->valuator->numAxes)
- {
- client->errorValue = dv->num_valuators;
- return BadValue;
- }
- }
- }
-#endif /* XINPUT */
- switch (type)
- {
- case KeyPress:
- case KeyRelease:
-#ifdef XINPUT
- if (!extension)
-#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupKeyboardDevice();
- if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
- ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
- {
- client->errorValue = ev->u.u.detail;
- return BadValue;
- }
- break;
- case MotionNotify:
-#ifdef XINPUT
- if (extension)
- {
- if (ev->u.u.detail != xFalse && ev->u.u.detail != xTrue)
- {
- client->errorValue = ev->u.u.detail;
- return BadValue;
- }
- if (ev->u.u.detail == xTrue && dev->valuator->mode == Absolute)
- {
- values = dev->valuator->axisVal + dv->first_valuator;
- for (n = 1; n < nev; n++)
- {
- dv = (deviceValuator *)(ev + n);
- switch (dv->num_valuators)
- {
- case 6:
- dv->valuator5 += values[5];
- case 5:
- dv->valuator4 += values[4];
- case 4:
- dv->valuator3 += values[3];
- case 3:
- dv->valuator2 += values[2];
- case 2:
- dv->valuator1 += values[1];
- case 1:
- dv->valuator0 += values[0];
- }
- values += 6;
- }
- }
- break;
- }
-#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupPointerDevice();
- if (ev->u.keyButtonPointer.root == None)
- root = GetCurrentRootWindow();
- else
- {
- root = LookupWindow(ev->u.keyButtonPointer.root, client);
- if (!root)
- return BadWindow;
- if (root->parent)
- {
- client->errorValue = ev->u.keyButtonPointer.root;
- return BadValue;
- }
- }
- if (ev->u.u.detail == xTrue)
- {
- int x, y;
- GetSpritePosition(&x, &y);
- ev->u.keyButtonPointer.rootX += x;
- ev->u.keyButtonPointer.rootY += y;
- }
- else if (ev->u.u.detail != xFalse)
- {
- client->errorValue = ev->u.u.detail;
- return BadValue;
- }
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- ScreenPtr pScreen = root->drawable.pScreen;
- BoxRec box;
- int i;
- int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x;
- int y = ev->u.keyButtonPointer.rootY + panoramiXdataPtr[0].y;
- if (!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- x, y, &box)) {
- FOR_NSCREENS(i) {
- if (i == pScreen->myNum) continue;
- if (POINT_IN_REGION(pScreen,
- &XineramaScreenRegions[i],
- x, y, &box)) {
- root = WindowTable[i];
- x -= panoramiXdataPtr[i].x;
- y -= panoramiXdataPtr[i].y;
- ev->u.keyButtonPointer.rootX = x;
- ev->u.keyButtonPointer.rootY = y;
- break;
- }
- }
- }
- }
-#endif
-
- if (ev->u.keyButtonPointer.rootX < 0)
- ev->u.keyButtonPointer.rootX = 0;
- else if (ev->u.keyButtonPointer.rootX >= root->drawable.width)
- ev->u.keyButtonPointer.rootX = root->drawable.width - 1;
- if (ev->u.keyButtonPointer.rootY < 0)
- ev->u.keyButtonPointer.rootY = 0;
- else if (ev->u.keyButtonPointer.rootY >= root->drawable.height)
- ev->u.keyButtonPointer.rootY = root->drawable.height - 1;
-
-#ifdef PANORAMIX
- if ((!noPanoramiXExtension
- && root->drawable.pScreen->myNum != XineramaGetCursorScreen())
- || (noPanoramiXExtension && root != GetCurrentRootWindow()))
-
-#else
- if (root != GetCurrentRootWindow())
-#endif
- {
- NewCurrentScreen(root->drawable.pScreen,
- ev->u.keyButtonPointer.rootX,
- ev->u.keyButtonPointer.rootY);
- return client->noClientException;
- }
- (*root->drawable.pScreen->SetCursorPosition)
- (root->drawable.pScreen,
- ev->u.keyButtonPointer.rootX,
- ev->u.keyButtonPointer.rootY, FALSE);
- break;
- case ButtonPress:
- case ButtonRelease:
-#ifdef XINPUT
- if (!extension)
-#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupPointerDevice();
- if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
- {
- client->errorValue = ev->u.u.detail;
- return BadValue;
- }
- break;
- }
- if (screenIsSaved == SCREEN_SAVER_ON)
- SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
- ev->u.keyButtonPointer.time = currentTime.milliseconds;
- (*dev->public.processInputProc)(ev, dev, nev);
- return client->noClientException;
-}
-
-static int
-ProcXTestGrabControl(client)
- register ClientPtr client;
-{
- REQUEST(xXTestGrabControlReq);
-
- REQUEST_SIZE_MATCH(xXTestGrabControlReq);
- if ((stuff->impervious != xTrue) && (stuff->impervious != xFalse))
- {
- client->errorValue = stuff->impervious;
- return(BadValue);
- }
- if (stuff->impervious)
- MakeClientGrabImpervious(client);
- else
- MakeClientGrabPervious(client);
- return(client->noClientException);
-}
-
-static int
-ProcXTestDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XTestGetVersion:
- return ProcXTestGetVersion(client);
- case X_XTestCompareCursor:
- return ProcXTestCompareCursor(client);
- case X_XTestFakeInput:
- return ProcXTestFakeInput(client);
- case X_XTestGrabControl:
- return ProcXTestGrabControl(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcXTestGetVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXTestGetVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXTestGetVersionReq);
- swaps(&stuff->minorVersion, n);
- return ProcXTestGetVersion(client);
-}
-
-static int
-SProcXTestCompareCursor(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXTestCompareCursorReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
- swapl(&stuff->window, n);
- swapl(&stuff->cursor, n);
- return ProcXTestCompareCursor(client);
-}
-
-static int
-XTestSwapFakeInput(client, req)
- register ClientPtr client;
- xReq *req;
-{
- register int nev;
- register xEvent *ev;
- xEvent sev;
- EventSwapPtr proc;
-
- nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent);
- for (ev = (xEvent *)&req[1]; --nev >= 0; ev++)
- {
- /* Swap event */
- proc = EventSwapVector[ev->u.u.type & 0177];
- /* no swapping proc; invalid event type? */
- if (!proc || proc == NotImplemented) {
- client->errorValue = ev->u.u.type;
- return BadValue;
- }
- (*proc)(ev, &sev);
- *ev = sev;
- }
- return Success;
-}
-
-static int
-SProcXTestFakeInput(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xReq);
-
- swaps(&stuff->length, n);
- n = XTestSwapFakeInput(client, stuff);
- if (n != Success)
- return n;
- return ProcXTestFakeInput(client);
-}
-
-static int
-SProcXTestGrabControl(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXTestGrabControlReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXTestGrabControlReq);
- return ProcXTestGrabControl(client);
-}
-
-static int
-SProcXTestDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XTestGetVersion:
- return SProcXTestGetVersion(client);
- case X_XTestCompareCursor:
- return SProcXTestCompareCursor(client);
- case X_XTestFakeInput:
- return SProcXTestFakeInput(client);
- case X_XTestGrabControl:
- return SProcXTestGrabControl(client);
- default:
- return BadRequest;
- }
-}
diff --git a/Xext/xtest1dd.c b/Xext/xtest1dd.c
deleted file mode 100644
index 41c78d9c9..000000000
--- a/Xext/xtest1dd.c
+++ /dev/null
@@ -1,1613 +0,0 @@
-/* $Xorg: xtest1dd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/*
- * File: xtest1dd.c
- *
- * This file contains the device dependent parts of the input
- * synthesis extension.
- */
-
-/*
-
-
-Copyright 1986, 1987, 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Hewlett-Packard not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-Hewlett-Packard makes no representations about the
-suitability of this software for any purpose. It is provided
-"as is" without express or implied warranty.
-
-This software is not subject to any license of the American
-Telephone and Telegraph Company or of the Regents of the
-University of California.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.7 2003/11/17 22:20:28 dawes Exp $ */
-
-/***************************************************************
- * include files
- ***************************************************************/
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <stdio.h>
-#include "Xos.h"
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#define XTestSERVER_SIDE
-#include "xtestext1.h"
-
-#include "xtest1dd.h"
-
-/***************************************************************
- * defines
- ***************************************************************/
-
-/*
- * the size of the fake input action array
- */
-#define ACTION_ARRAY_SIZE 100
-
-/***************************************************************
- * externals
- ***************************************************************/
-
-/*
- * Holds the xTestInputAction event type code.
- * This is defined in xtestext1di.c.
- */
-extern int XTestInputActionType;
-/*
- * Holds the xTestFakeAck event type code.
- * This is defined in xtestext1di.c.
- */
-extern int XTestFakeAckType;
-/*
- * used in the WriteReplyToClient macro
- */
-extern int exclusive_steal;
-
-/***************************************************************
- * variables
- ***************************************************************/
-
-/*
- * array to hold fake input actions
- */
-struct {
- /*
- * holds the action type, one of: XTestDELAY_ACTION,
- * XTestKEY_ACTION, XTestMOTION_ACTION, XTestJUMP_ACTION
- */
- CARD8 type;
- /*
- * holds the device type, in the range 0 to 15
- */
- CARD8 device;
- /*
- * for XTestKEY_ACTION type, holds the keycode
- */
- CARD8 keycode;
- /*
- * for XTestKEY_ACTION type, holds the key up/down state
- */
- CARD8 keystate;
- /*
- * for XTestMOTION_ACTION and XTestJUMP_ACTION types,
- * holds the x and y coordinates to move the mouse to
- */
- int x;
- int y;
- /*
- * holds the time to delay (in milliseconds) before performing
- * the action
- */
- CARD32 delay_time;
-}action_array[ACTION_ARRAY_SIZE];
-
-/*
- * write index for input action array
- */
-static int write_index = 0;
-/*
- * read index for input action array
- */
-static int read_index = 0;
-/*
- * this is where the input actions are accumulated until they are sent
- * to a client (in a wire event)
- */
-static xTestInputActionEvent input_action_packet;
-/*
- * holds the index (in bytes) into the input actions buffer in the
- * current input action event
- */
-static int packet_index;
-/*
- * logical x position of the mouse during input action gathering
- */
-short xtest_mousex;
-/*
- * logical y position of the mouse during input action gathering
- */
-short xtest_mousey;
-/*
- * logical x position of the mouse while we are reading fake input actions
- * from the client and putting them into the fake input action array
- */
-static short pmousex;
-/*
- * logical y position of the mouse while we are reading fake input actions
- * from the client and putting them into the fake input action array
- */
-static short pmousey;
-/*
- * The playback_on flag is set to 1 while there are input actions in the
- * input action array. It is set to 0 when the server has received all of
- * the user actions.
- */
-int playback_on = 0;
-/*
- * identity of the client using XTestGetInput to get user input actions
- */
-ClientPtr current_xtest_client;
-/*
- * if 1 send multiple input actions per XTestInputAction event;
- * if 0 send one input action per XTestInputAction event
- */
-static char packed_mode;
-/*
- * identity of the client using the XTestFakeInput function to send some
- * fake input actions to the server
- */
-ClientPtr playback_client = NULL;
-/*
- * Set to 1 when the XTestFAKE_ACK_REQUEST flag is set in a XTestFakeInput
- * request. Set back to 0 when all of the input actions have been sent
- * to the server.
- */
-static int acknowledge = 0;
-/*
- * The server's idea of the current time is saved in these variables when
- * a XTestFakeInput request is received. It is restored when all fake input
- * actions are sent to the server or when the playback client disconnects.
- */
-static int saved_sec;
-static int saved_usec;
-/*
- * Set to 1 when there is a valid time in saved_sec and saved_usec.
- */
-static int time_saved = 0;
-/*
- * holds the extension's notion of what the current time is while it is
- * sending input actions to a client
- */
-static struct timeval current_time;
-/*
- * holds the time when the extension should place the next fake input action
- * into the server's normal events queue
- */
-static struct timeval play_time;
-/*
- * set to 1 when play_time is first set, cleared to 0 when the
- * client using the extension disconnects, or when XTestReset is called
- */
-static char play_clock = 0;
-/*
- * holds the amount of time left until the next input action from the
- * input action array can be sent to the server
- */
-static struct timeval rtime;
-/*
- * Set to 1 after the extension is done waiting for the correct time delay
- * for an input action to be sent to the server. Remains a 1 until the time
- * delay for the next input action is computed. Then set to 0 if the
- * extension has to wait for the correct time delay.
- */
-static int go_for_next = 1;
-/*
- * needed to restore waitime if playback is to be aborted
- */
-static struct timeval *restorewait;
-/*
- * tmon special command key
- *
- * To use the test monitor program (called tmon) efficiently, it is
- * desirable to have the extension be able to recognize a special "trigger"
- * key. If the extension did not do this, tmon would have to have the
- * extension send all keyboard user input actions exclusively to tmon,
- * only to have tmon send them right back if they were not the command key.
- *
- * If the extension can recognize the command key, then tmon can let the
- * extension handle keyboard user input actions normally until the command
- * key is pressed (and released), and only then have the extension start
- * sending keyboard user input actions exclusively to tmon.
- *
- * Any key on the keyboard can be used for this command key. It is most
- * convenient if it is a low-frequency key. If you want to generate a
- * normal occurrance of this key to a client, just hit it twice. Tmon
- * will recognize the first occurrance of the key, take control of the input
- * actions, and wait for certain keys. If it sees another occurrance of the
- * command key, it will send one occurrance of the command key to the
- * extension, and go back to waiting.
- *
- * set and also referenced in device layer
- * XXX there should be a way to set this through the protocol
- */
-KeyCode xtest_command_key = 0;
-
-/***************************************************************
- * function declarations
- ***************************************************************/
-
-static void parse_key_fake(
- XTestKeyInfo * /* fkey */
- );
-static void parse_motion_fake(
- XTestMotionInfo * /* fmotion */
- );
-static void parse_jump_fake(
- XTestJumpInfo * /* fjump */
- );
-static void parse_delay_fake(
- XTestDelayInfo * /* tevent */
- );
-static void send_ack(
- ClientPtr /* client */
- );
-static void start_play_clock(
- void
- );
-static void compute_action_time(
- struct timeval * /* rtime */
- );
-static int find_residual_time(
- struct timeval * /* rtime */
- );
-
-static CARD16 check_time_event(
- void
- );
-static CARD32 current_ms(
- struct timeval * /* otime */
- );
-static int there_is_room(
- int /* actsize */
- );
-
-/******************************************************************************
- *
- * stop_stealing_input
- *
- * Stop stealing input actions.
- */
-void
-stop_stealing_input()
-{
-/*
- * put any code that you might need to stop stealing input actions here
- */
- if (packet_index != 0)
- {
- /*
- * if there is a partially full input action event waiting
- * when this function is called, send it to the client
- */
- flush_input_actions();
- }
-}
-
-/******************************************************************************
- *
- * steal_input
- *
- * Start stealing input actions and sending them to the passed-in client.
- */
-void
-steal_input(client, mode)
-/*
- * which client is to receive the input action events
- */
-ClientPtr client;
-/*
- * what input action packing mode to use. one of 0, XTestPACKED_MOTION,
- * or XTestPACKED_ACTIONS; optionally 'or'ed with XTestEXCLUSIVE,
- */
-CARD32 mode;
-{
- if (packet_index != 0)
- {
- /*
- * if there is a partially full input action event waiting
- * when this function is called, send it to the client
- */
- flush_input_actions();
- }
- else
- {
- /*
- * otherwise, set up a new input action event
- */
- input_action_packet.type = XTestInputActionType;
- packet_index = 0;
- }
- /*
- * set up the new input action packing mode
- */
- packed_mode = mode & ~(XTestEXCLUSIVE);
- /*
- * keep track of where the mouse is
- */
- XTestGetPointerPos(&xtest_mousex, &xtest_mousey);
- /*
- * keep track of which client is getting input actions
- */
- current_xtest_client = client;
- /*
- * find out what time it is
- */
- X_GETTIMEOFDAY(&current_time);
- /*
- * jump to the initial position of the mouse, using a device type of 0.
- */
- XTestStealJumpData(xtest_mousex, xtest_mousey, 0);
-}
-
-/******************************************************************************
- *
- * flush_input_actions
- *
- * Write the input actions event to the current requesting client
- * and re-initialize the input action event.
- */
-void
-flush_input_actions()
-{
- /*
- * pointer to the input action event
- */
- char *rep;
- /*
- * loop index
- */
- int i;
-
- if (packet_index == 0)
- {
- /*
- * empty input actions event
- */
- return;
- }
- else if (packet_index < XTestACTIONS_SIZE)
- {
- /*
- * fill to the end of the input actions event with 0's
- */
- for (i = packet_index; i <XTestACTIONS_SIZE; i++)
- {
- input_action_packet.actions[i] = 0;
- }
- }
- rep = (char *) (&input_action_packet);
-
- /*
- * set the serial number of the input action event
- */
- input_action_packet.sequenceNumber = current_xtest_client->sequence;
- /*
- * send the input action event to the client
- */
- WriteEventsToClient(current_xtest_client, 1, (xEvent *) rep);
- /*
- * re-initialize the input action event
- */
- input_action_packet.type = XTestInputActionType;
- packet_index = 0;
-}
-
-/******************************************************************************
- *
- * XTestStealJumpData
- *
- * Create one or more input actions and put them in the input action
- * event. The input actions will be an (maybe) XTestDELAY_ACTION
- * and an XTestJUMP_ACTION.
- */
-void
-XTestStealJumpData(jx, jy, dev_type)
-/*
- * the x and y coordinates to jump to
- */
-int jx;
-int jy;
-/*
- * which device caused the jump
- */
-int dev_type;
-{
- XTestJumpInfo *jmp_ptr;
- /*
- * time delta (in ms) from previous event
- */
- CARD16 tchar;
-
- /*
- * Get the time delta from the previous event. If needed,
- * the check_time_event routine will put an XTestDELAY_ACTION
- * type action in the input action event.
- */
- tchar = check_time_event();
- if (!there_is_room(sizeof(XTestJumpInfo)))
- {
- /*
- * If there isn't room in the input action event for
- * an XTestJUMP_ACTION, then send that event to the
- * client and start filling an empty one.
- */
- flush_input_actions();
- }
- /*
- * update the logical mouse position
- */
- xtest_mousex = jx;
- xtest_mousey = jy;
- /*
- * point jmp_ptr to the correct place in the input action event
- */
- jmp_ptr = (XTestJumpInfo *)
- &(input_action_packet.actions[packet_index]);
- /*
- * compute the input action header
- */
- jmp_ptr->header = (XTestPackDeviceID(dev_type) | XTestJUMP_ACTION);
- /*
- * set the x and y coordinates to jump to in the input action
- */
- jmp_ptr->jumpx = jx;
- jmp_ptr->jumpy = jy;
- /*
- * set the delay time in the input action
- */
- jmp_ptr->delay_time = tchar;
- /*
- * increment the packet index by the size of the input action
- */
- packet_index = packet_index + sizeof(XTestJumpInfo);
- if (packed_mode == 0)
- {
- /*
- * if input actions are not packed, send the input
- * action event to the client
- */
- flush_input_actions();
- }
-}
-
-/******************************************************************************
- *
- * current_ms
- *
- * Returns the number of milliseconds from the passed-in time to the
- * current time, and then updates the passed-in time to the current time.
- */
-static CARD32
-current_ms(otime)
-struct timeval *otime;
-{
- struct timeval tval;
- unsigned long the_ms;
- unsigned long sec;
- unsigned long usec;
-
- /*
- * get the current time
- */
- X_GETTIMEOFDAY(&tval);
- if (tval.tv_usec < otime->tv_usec)
- {
- /*
- * borrow a second's worth of microseconds if needed
- */
- usec = tval.tv_usec - otime->tv_usec + 1000000;
- sec = tval.tv_sec - 1 - otime->tv_sec;
- }
- else
- {
- usec = tval.tv_usec - otime->tv_usec;
- sec = tval.tv_sec - otime->tv_sec;
- }
- /*
- * update the passed-in time to the new time
- */
- *otime = tval;
- /*
- * compute the number of milliseconds contained in
- * 'sec' seconds and 'usec' microseconds
- */
- the_ms = (sec * 1000000L + usec) / 1000L;
- return (the_ms);
-}
-
-/******************************************************************************
- *
- * check_time_event
- *
- * If time delta is > XTestSHORT_DELAY_TIME then insert a time event
- * and return 0; else return the delay time.
- */
-static CARD16
-check_time_event()
-{
- CARD32 tstamp;
- CARD16 tchar;
- XTestDelayInfo *tptr;
-
- /*
- * get the number of milliseconds between input actions
- */
- tstamp = current_ms(&current_time);
- /*
- * if the number of milliseconds is too large to fit in a CARD16,
- * then add a XTestDELAY_ACTION to the input action event.
- */
- if (tstamp > XTestSHORT_DELAY_TIME)
- {
- /*
- * If there isn't room in the input action event for
- * an XTestDELAY_ACTION, then send that event to the
- * client and start filling an empty one.
- */
- if (!there_is_room(sizeof(XTestDelayInfo)))
- {
- flush_input_actions();
- }
- /*
- * point tptr to the correct place in the input action event
- */
- tptr = (XTestDelayInfo *)
- (&(input_action_packet.actions[packet_index]));
- /*
- * compute the input action header
- */
- tptr->header = XTestPackDeviceID(XTestDELAY_DEVICE_ID) |
- XTestDELAY_ACTION;
- /*
- * set the delay time in the input action
- */
- tptr->delay_time = tstamp;
- /*
- * increment the packet index by the size of the input action
- */
- packet_index = packet_index + (sizeof(XTestDelayInfo));
- if (packed_mode != XTestPACKED_ACTIONS)
- {
- /*
- * if input actions are not packed, send the input
- * action event to the client
- */
- flush_input_actions();
- }
- /*
- * set the returned delay time to 0
- */
- tchar = 0;
- }
- else
- {
- /*
- * set the returned delay time to the computed delay time
- */
- tchar = tstamp;
- }
- return(tchar);
-}
-
-/******************************************************************************
- *
- * there_is_room
- *
- * Checks if there is room in the input_action_packet for an input action
- * of the size actsize bytes. Returns 1 if there is space, 0 otherwise.
- *
- */
-static int
-there_is_room(actsize)
-/*
- * the number of bytes of space needed
- */
-int actsize;
-{
- if ((packet_index + actsize) > XTestACTIONS_SIZE)
- {
- return(0);
- }
- else
- {
- return(1);
- }
-}
-
-/******************************************************************************
- *
- * XTestStealMotionData
- *
- * Put motion information from the locator into an input action.
- *
- * called from x_hil.c
- */
-void
-XTestStealMotionData(dx, dy, dev_type, mx, my)
-/*
- * the x and y delta motion of the locator
- */
-int dx;
-int dy;
-/*
- * which locator did the moving
- */
-int dev_type;
-/*
- * the x and y position of the locator before the delta motion
- */
-int mx;
-int my;
-{
- /*
- * pointer to a XTestMOTION_ACTION input action
- */
- XTestMotionInfo *fm;
- /*
- * time delta from previous event
- */
- CARD16 tchar;
-
- /*
- * if the current position of the locator is not the same as
- * the logical position, then update the logical position
- */
- if ((mx != xtest_mousex) || (my != xtest_mousey))
- {
- XTestStealJumpData(mx, my, dev_type);
- }
- /*
- * if the delta motion is outside the range that can
- * be held in a motion input action, use a jump input action
- */
- if ((dx > XTestMOTION_MAX) || (dx < XTestMOTION_MIN) ||
- (dy > XTestMOTION_MAX) || (dy < XTestMOTION_MIN))
- {
- XTestStealJumpData((xtest_mousex + dx),
- (xtest_mousey + dy), dev_type);
- }
- else
- {
- /*
- * compute the new logical position of the mouse
- */
- xtest_mousex += dx;
- xtest_mousey += dy;
- /*
- * Get the time delta from the previous event. If needed,
- * the check_time_event routine will put an XTestDELAY_ACTION
- * type action in the input action event.
- */
- tchar = check_time_event();
- /*
- * If there isn't room in the input action event for
- * an XTestDELAY_ACTION, then send that event to the
- * client and start filling an empty one.
- */
- if (!there_is_room(sizeof(XTestMotionInfo)))
- {
- flush_input_actions();
- /*
- * point fm to the correct place in the input action event
- */
- }
- fm = (XTestMotionInfo *)
- &(input_action_packet.actions[packet_index]);
- /*
- * compute the input action header
- */
- fm->header = XTestMOTION_ACTION;
- if (dx < 0)
- {
- fm->header |= XTestX_NEGATIVE;
- dx = abs(dx);
- }
- if (dy < 0)
- {
- fm->header |= XTestY_NEGATIVE;
- dy = abs(dy);
- }
- fm->header |= XTestPackDeviceID(dev_type);
- /*
- * compute the motion data byte
- */
- fm->motion_data = XTestPackYMotionValue(dy);
- fm->motion_data |= XTestPackXMotionValue(dx);
- /*
- * set the delay time in the input action
- */
- fm->delay_time = tchar;
- /*
- * increment the packet index by the size of the input action
- */
- packet_index = packet_index + sizeof(XTestMotionInfo);
- if (packed_mode == 0)
- {
- /*
- * if input actions are not packed, send the input
- * action event to the client
- */
- flush_input_actions();
- }
-
- }
-}
-
-/******************************************************************************
- *
- * XTestStealKeyData
- *
- * Place this key data in the input_action_packet.
- *
- */
-Bool
-XTestStealKeyData(keycode, keystate, dev_type, locx, locy)
-/*
- * which key/button moved
- */
-unsigned keycode;
-/*
- * whether the key/button was pressed or released
- */
-int keystate;
-/*
- * which device caused the input action
- */
-int dev_type;
-/*
- * the x and y coordinates of the locator when the action happenned
- */
-int locx;
-int locy;
-{
- /*
- * pointer to key/button motion input action
- */
- XTestKeyInfo *kp;
- /*
- * time delta from previous event
- */
- CARD16 tchar;
- char keytrans = 0;
-
- /*
- * update the logical position of the locator if the physical position
- * of the locator is not the same as the logical position.
- */
- if ((locx != xtest_mousex) || (locy != xtest_mousey))
- {
- XTestStealJumpData(locx, locy, dev_type);
- }
- /*
- * Get the time delta from the previous event. If needed,
- * the check_time_event routine will put an XTestDELAY_ACTION
- * type action in the input action event.
- */
- tchar = check_time_event();
- if (!there_is_room(sizeof(XTestKeyInfo)))
- {
- /*
- * If there isn't room in the input action event for
- * an XTestDELAY_ACTION, then send that event to the
- * client and start filling an empty one.
- */
- flush_input_actions();
- }
- /*
- * point kp to the correct place in the input action event
- */
- kp = (XTestKeyInfo *)
- (&(input_action_packet.actions[packet_index]));
- /*
- * compute the input action header
- */
- kp->header = XTestPackDeviceID(dev_type);
- if ((keystate == KeyRelease) || (keystate == ButtonRelease))
- {
- keytrans = XTestKEY_UP;
- }
- else if ((keystate == KeyPress) || (keystate == ButtonPress))
- {
- keytrans = XTestKEY_DOWN;
- }
- else
- {
- printf("%s: invalid key/button state %d.\n",
- XTestEXTENSION_NAME,
- keystate);
- }
- kp->header = kp->header | keytrans | XTestKEY_ACTION;
- /*
- * set the keycode in the input action
- */
- kp->keycode = keycode;
- /*
- * set the delay time in the input action
- */
- kp->delay_time = tchar;
- /*
- * increment the packet index by the size of the input action
- */
- packet_index = packet_index + sizeof(XTestKeyInfo);
- /*
- * if the command key has been released or input actions are not
- * packed, send the input action event to the client
- */
- if(((keycode == xtest_command_key) && (keystate == KeyRelease)) ||
- (packed_mode != XTestPACKED_ACTIONS))
- {
- flush_input_actions();
- }
- /* return TRUE if the event should be passed on to DIX */
- if (exclusive_steal)
- return ((keystate == KeyRelease) &&
- (keycode == xtest_command_key));
- else
- return ((keystate != KeyRelease) ||
- (keycode != xtest_command_key));
-}
-
-/******************************************************************************
- *
- * parse_fake_input
- *
- * Parsing routine for a XTestFakeInput request. It will take a request
- * and parse its contents into the input action array. Eventually the
- * XTestProcessInputAction routine will be called to take input actions
- * from the input action array and send them to the server to be handled.
- */
-void
-parse_fake_input(client, req)
-/*
- * which client did the XTestFakeInput request
- */
-ClientPtr client;
-/*
- * a pointer to the xTestFakeInputReq structure sent by the client
- */
-char *req;
-{
- /*
- * if set to 1, done processing input actions from the request
- */
- int done = 0;
- /*
- * type of input action
- */
- CARD8 action_type;
- /*
- * device type
- */
- CARD8 dev_type;
- /*
- * pointer to an xTestFakeInputReq structure
- */
- xTestFakeInputReq *request;
- /*
- * holds the index into the action list in the request
- */
- int parse_index;
-
- /*
- * get a correct-type pointer to the client-supplied request data
- */
- request = (xTestFakeInputReq *) req;
- /*
- * save the acknowledge requested state for use in
- * XTestProcessInputAction
- */
- acknowledge = request->ack;
- /*
- * set up an index into the action list in the request
- */
- parse_index = 0;
- if (write_index >= ACTION_ARRAY_SIZE)
- {
- /*
- * if the input action array is full, don't add any more
- */
- done = 1;
- }
- while (!done)
- {
- /*
- * get the type of input action in the list
- */
- action_type = (request->action_list[parse_index])
- & XTestACTION_TYPE_MASK;
- /*
- * get the type of device in the list
- */
- dev_type = XTestUnpackDeviceID(request->action_list[parse_index]);
- /*
- * process the input action appropriately
- */
- switch (action_type)
- {
- case XTestKEY_ACTION:
- parse_key_fake((XTestKeyInfo *)
- &(request->action_list[parse_index]));
- parse_index = parse_index + sizeof(XTestKeyInfo);
- break;
- case XTestMOTION_ACTION:
- parse_motion_fake((XTestMotionInfo *)
- &(request->action_list[parse_index]));
- parse_index = parse_index + sizeof(XTestMotionInfo);
- break;
- case XTestJUMP_ACTION:
- parse_jump_fake((XTestJumpInfo *)
- &(request->action_list[parse_index]));
- parse_index = parse_index + sizeof(XTestJumpInfo);
- break;
- case XTestDELAY_ACTION:
- if (dev_type == XTestDELAY_DEVICE_ID)
- {
- parse_delay_fake((XTestDelayInfo *)
- &(request->action_list[parse_index]));
- parse_index = parse_index +
- sizeof(XTestDelayInfo);
- }
- else
- {
- /*
- * An invalid input action header byte has
- * been detected, so there are no more
- * input actions in this request.
- * The intended invalid action header byte
- * for this case should have a value of 0.
- */
- done = 1;
- }
- break;
- }
- if (parse_index >= XTestMAX_ACTION_LIST_SIZE)
- {
- /*
- * entire XTestFakeInput request has been processed
- */
- done = 1;
- }
- if (write_index >= ACTION_ARRAY_SIZE)
- {
- /*
- * no room in the input actions array
- */
- done = 1;
- }
- }
- if (write_index > read_index)
- {
- /*
- * there are fake input actions in the input action array
- * to be given to the server
- */
- playback_on = 1;
- playback_client = client;
- }
-}
-
-/******************************************************************************
- *
- * parse_key_fake
- *
- * Called from parse_fake_input.
- *
- * Copy the fake key input action from its packed form into the array of
- * pending input events.
- */
-static void
-parse_key_fake(fkey)
-XTestKeyInfo *fkey;
-{
- action_array[write_index].type = XTestKEY_ACTION;
- action_array[write_index].device = XTestUnpackDeviceID(fkey->header);
- action_array[write_index].keycode = fkey->keycode;
- action_array[write_index].keystate = fkey->header & XTestKEY_STATE_MASK;
- action_array[write_index].delay_time = fkey->delay_time;
- write_index++;
-}
-
-/******************************************************************************
- *
- * parse_motion_fake
- *
- * Called from parse_fake_input.
- *
- * Copy the fake motion input action from its packed form into the array of
- * pending input events.
- */
-static void
-parse_motion_fake(fmotion)
-XTestMotionInfo *fmotion;
-{
- int dx;
- int dy;
-
- dx = (XTestUnpackXMotionValue(fmotion->motion_data));
- dy = (XTestUnpackYMotionValue(fmotion->motion_data));
- if (((fmotion->header) & XTestX_SIGN_BIT_MASK) == XTestX_NEGATIVE)
- {
- pmousex -= dx;
- }
- else
- {
- pmousex += dx;
- }
- if (((fmotion->header) & XTestY_SIGN_BIT_MASK) == XTestY_NEGATIVE)
- {
- pmousey -= dy;
- }
- else
- {
- pmousey += dy;
- }
- action_array[write_index].type = XTestJUMP_ACTION;
- action_array[write_index].device = XTestUnpackDeviceID(fmotion->header);
- action_array[write_index].x = pmousex;
- action_array[write_index].y = pmousey;
- action_array[write_index].delay_time = fmotion->delay_time;
- write_index++;
-}
-
-/******************************************************************************
- *
- * parse_jump_fake
- *
- * Called from parse_fake_input.
- *
- * Copy the fake jump input action from its packed form into the array of
- * pending input events.
- */
-static void
-parse_jump_fake(fjump)
-XTestJumpInfo *fjump;
-{
- pmousex = fjump->jumpx;
- pmousey = fjump->jumpy;
- action_array[write_index].type = XTestJUMP_ACTION;
- action_array[write_index].device = XTestUnpackDeviceID(fjump->header);
- action_array[write_index].x = pmousex;
- action_array[write_index].y = pmousey;
- action_array[write_index].delay_time = fjump->delay_time;
- write_index++;
-}
-
-/******************************************************************************
- *
- * parse_delay_fake
- *
- * Called from parse_fake_input.
- *
- * Copy the fake delay input action from its packed form into the array of
- * pending input events.
- */
-static void
-parse_delay_fake(tevent)
-XTestDelayInfo *tevent;
-{
- action_array[write_index].type = XTestDELAY_ACTION;
- action_array[write_index].delay_time = tevent->delay_time;
- write_index++;
-}
-
-/******************************************************************************
- *
- * XTestComputeWaitTime
- *
- * Compute the amount of time the server should wait before sending the
- * next monitor event in playback mode.
- */
-void
-XTestComputeWaitTime(waittime)
-struct timeval *waittime;
-{
- /*
- * The playback_on flag is set to 1 in parse_fake_input. It is set to
- * 0 in XTestProcessInputAction if the server has replayed all input
- * actions.
- */
- if (playback_on)
- {
- if (!play_clock)
- {
- /*
- * if the playback clock has never been set,
- * then do it now
- */
- start_play_clock();
- }
- /*
- * We need to save the waittime the first time through. This
- * is a value the server uses, and we have to restore it when
- * all of the input actions are processed by the server.
- */
- if (!time_saved)
- {
- saved_sec = waittime->tv_sec;
- saved_usec = waittime->tv_usec;
- time_saved = 1;
- }
- if (go_for_next)
- {
- /*
- * if we just processed an input action, figure out
- * how long to wait for the next input action
- */
- compute_action_time(&rtime);
- }
- else
- {
- /*
- * else just find out how much more time to wait
- * on the current input action
- */
- (void)find_residual_time(&rtime);
- }
- waittime->tv_sec = rtime.tv_sec;
- waittime->tv_usec = rtime.tv_usec;
- }
-}
-
-/******************************************************************************
- *
- * XTestProcessInputAction
- *
- * If there are any input actions in the input action array,
- * then take one out and process it.
- *
- */
-int
-XTestProcessInputAction(readable, waittime)
-/*
- * This is the value that a 'select' function returned just before this
- * routine was called. If the select timed out, this value will be 0.
- *
- * This extension modifies the select call's timeout value to cause the
- * select to time out when the next input action is ready to given to
- * the server. This routine is called immediately after the select, to
- * give it a chance to process an input action. If we have an input action
- * to process and the only reason that the select returned was because it
- * timed out, then we change the select value to 1 and return 1 instead of 0.
- */
-int readable;
-/*
- * this is the timeout value that the select was called with
- */
-struct timeval *waittime;
-{
-int mousex, mousey;
- /*
- * if playback_on is 0, then the input action array is empty
- */
- if (playback_on)
- {
- restorewait = waittime;
- /*
- * figure out if we need to wait for the next input action
- */
- if (find_residual_time(&rtime) > 0)
- {
- /*
- * still have to wait before processing the current
- * input action
- */
- go_for_next = 0;
- }
- else
- {
- /*
- * don't have to wait any longer before processing
- * the current input action
- */
- go_for_next = 1;
- }
- /*
- * if we have an input action to process and the only reason
- * that the select returned was because it timed out, then we
- * change the select value to 1 and return 1 instead of 0
- */
- if (readable == 0)
- {
- readable++;
- }
- /*
- * if we don't need to wait, then get an input action from
- * the input action array and process it
- */
- if (go_for_next)
- {
- /*
- * There are three possible types of input actions in
- * the input action array (motion input actions are
- * converted to jump input actions before being put
- * into the input action array). Delay input actions
- * are processed by the compute_action_time function
- * which is called from XTestComputeWaitTime. The
- * other two types of input actions are processed here.
- */
- if (action_array[read_index].type == XTestJUMP_ACTION)
- {
- XTestJumpPointer(
- action_array[read_index].x,
- action_array[read_index].y,
- action_array[read_index].device);
- }
- if (action_array[read_index].type == XTestKEY_ACTION)
- {
- GetSpritePosition(&mousex, &mousey);
- XTestGenerateEvent(
- action_array[read_index].device,
- action_array[read_index].keycode,
- action_array[read_index].keystate,
- mousex,
- mousey);
- }
- read_index++;
- /*
- * if all input actions are processed, then restore
- * the server state
- */
- if (read_index >= write_index)
- {
- waittime->tv_sec = saved_sec;
- waittime->tv_usec = saved_usec;
- time_saved = 0;
- playback_on = 0;
- if (acknowledge)
- {
- /*
- * if the playback client is waiting
- * for an xTestFakeAck event, send
- * it to him
- */
- send_ack(playback_client);
- acknowledge = 0;
- }
- write_index = 0;
- read_index = 0;
- playback_client = (ClientPtr) NULL;
- play_clock = 0;
- }
- }
- }
- return(readable);
-}
-
-/******************************************************************************
- *
- * send_ack
- *
- * send an xTestFakeAck event to the client
- */
-static void
-send_ack(client)
-ClientPtr client;
-{
- xTestFakeAckEvent rep;
-
- /*
- * set the serial number of the xTestFakeAck event
- */
- rep.sequenceNumber = client->sequence;
- rep.type = XTestFakeAckType;
- WriteEventsToClient(client, 1, (xEvent *) &rep);
-}
-
-/******************************************************************************
- *
- * start_play_clock
- *
- * start the clock for play back.
- */
-static void
-start_play_clock()
-{
- X_GETTIMEOFDAY(&play_time);
- /*
- * flag that play_time is valid
- */
- play_clock = 1;
-}
-
-/******************************************************************************
- *
- * compute_action_time
- *
- * Set the play clock to the time when the next input action should be put
- * into the server's input queue. Fill the rtime structure with values
- * for the delta until the time for the next input action.
- */
-static void
-compute_action_time(rtime)
-struct timeval *rtime;
-{
- /*
- * holds the delay time in milliseconds
- */
- unsigned long dtime;
- /*
- * holds the number of microseconds in the sum of the dtime value
- * and the play_time value
- */
- unsigned long tot_usec;
- /*
- * holds the number of seconds and microseconds in the
- * dtime value
- */
- unsigned long sec;
- unsigned long usec;
- /*
- * holds the current time
- */
- struct timeval btime;
-
- /*
- * Put the time from the current input action in dtime
- */
- dtime = action_array[read_index].delay_time;
- /*
- * If the current input action is a delay input action,
- * add in the time from the following input action.
- */
- if ((action_array[read_index].type == XTestDELAY_ACTION) &&
- ((read_index + 1) < write_index))
- {
- read_index++;
- dtime = dtime + action_array[read_index].delay_time;
- }
- /*
- * compute the number of seconds and microseconds in the
- * dtime value
- */
- sec = dtime / 1000;
- usec = (dtime % 1000) * 1000;
- /*
- * get the current time in btime
- */
- X_GETTIMEOFDAY(&btime);
- /*
- * compute the number of microseconds in the sum of the dtime value
- * and the current usec value
- */
- tot_usec = btime.tv_usec + usec;
- /*
- * if it is greater than one second's worth, adjust the seconds
- */
- if (tot_usec >= 1000000)
- {
- tot_usec -= 1000000;
- sec++;
- }
- play_time.tv_usec = tot_usec;
- play_time.tv_sec = btime.tv_sec + sec;
- /*
- * put the time until the next input action in rtime
- */
- rtime->tv_sec = sec;
- rtime->tv_usec = usec;
-}
-
-/******************************************************************************
- *
- * find_residual_time
- *
- * Find the time interval from the current time to the value in play_time.
- * This is the time to wait till putting the next input action into the
- * server's input queue. If the time is already up, reset play_time to
- * the current time.
- */
-static int
-find_residual_time(the_residual)
-struct timeval *the_residual;
-{
- /*
- * if > 0, there is time to wait. If < 0, then don't wait
- */
- int wait = 1;
- /*
- * holds the current time
- */
- struct timeval btime;
- /*
- * holds the current time in seconds and microseconds
- */
- unsigned long bsec;
- unsigned long busec;
- /*
- * holds the playback time in seconds and microseconds
- */
- unsigned long psec;
- unsigned long pusec;
-
- /*
- * get the current time in btime
- */
- X_GETTIMEOFDAY(&btime);
- /*
- * get the current time in seconds and microseconds
- */
- bsec = btime.tv_sec;
- busec = btime.tv_usec;
- /*
- * get the playback time in seconds and microseconds
- */
- psec = play_time.tv_sec;
- pusec = play_time.tv_usec;
- /*
- * if the current time is already later than the playback time,
- * we don't need to wait
- */
- if (bsec > psec)
- {
- wait = -1;
- }
- else
- {
- if (bsec == psec)
- {
- /*
- * if the current and playback times have the same
- * second value, then compare the microsecond values
- */
- if ( busec >= pusec)
- {
- /*
- * if the current time is already later than
- * the playback time, we don't need to wait
- */
- wait = -1;
- }
- else
- {
- the_residual->tv_usec = pusec - busec;
- the_residual->tv_sec = 0;
- }
- }
- else
- {
- if (busec > pusec)
- {
- /*
- * 'borrow' a second's worth of microseconds
- * from the seconds left to wait
- */
- the_residual->tv_usec = 1000000 - busec + pusec;
- psec--;
- the_residual->tv_sec = psec - bsec;
- }
- else
- {
- the_residual->tv_sec = psec - bsec;
- the_residual->tv_usec = pusec - busec;
- }
- }
- }
- if (wait < 0)
- {
- /*
- * if don't need to wait, set the playback time
- * to the current time
- */
- X_GETTIMEOFDAY(&play_time);
- /*
- * set the time to wait to 0
- */
- the_residual->tv_sec = 0;
- the_residual->tv_usec = 0;
- }
- return(wait);
-}
-
-/******************************************************************************
- *
- * abort_play_back
- */
-void
-abort_play_back()
-{
- /*
- * If we were playing back input actions at the time of the abort,
- * restore the original wait time for the select in the main wait
- * loop of the server
- */
- if (playback_on)
- {
- restorewait->tv_sec = saved_sec;
- restorewait->tv_usec = saved_usec;
- }
- /*
- * make the input action array empty
- */
- read_index = 0;
- write_index = 0;
- /*
- * we are no longer playing back anything
- */
- playback_on = 0;
- play_clock = 0;
- go_for_next = 1;
- /*
- * there is no valid wait time saved any more
- */
- time_saved = 0;
- /*
- * there are no valid clients using this extension
- */
- playback_client = (ClientPtr) NULL;
- current_xtest_client = (ClientPtr) NULL;
-}
-
-/******************************************************************************
- *
- * return_input_array_size
- *
- * Return the number of input actions in the input action array.
- */
-void
-return_input_array_size(client)
-/*
- * which client to send the reply to
- */
-ClientPtr client;
-{
- xTestQueryInputSizeReply rep;
-
- rep.type = X_Reply;
- /*
- * set the serial number of the reply
- */
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.size_return = ACTION_ARRAY_SIZE;
- WriteReplyToClient(client,
- sizeof(xTestQueryInputSizeReply),
- (pointer) &rep);
-}
diff --git a/Xext/xtest1dd.h b/Xext/xtest1dd.h
deleted file mode 100644
index 6e258080e..000000000
--- a/Xext/xtest1dd.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.3 2003/11/17 22:20:28 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef XTEST1DD_H
-#define XTEST1DD_H 1
-
-extern short xtest_mousex;
-extern short xtest_mousey;
-extern int playback_on;
-extern ClientPtr current_xtest_client;
-extern ClientPtr playback_client;
-extern KeyCode xtest_command_key;
-
-extern void stop_stealing_input(
- void
-);
-
-extern void
-steal_input(
- ClientPtr /* client */,
- CARD32 /* mode */
-);
-
-extern void
-flush_input_actions(
- void
-);
-
-extern void
-XTestStealJumpData(
- int /* jx */,
- int /* jy */,
- int /* dev_type */
-);
-
-extern void
-XTestStealMotionData(
- int /* dx */,
- int /* dy */,
- int /* dev_type */,
- int /* mx */,
- int /* my */
-);
-
-extern Bool
-XTestStealKeyData(
- unsigned /* keycode */,
- int /* keystate */,
- int /* dev_type */,
- int /* locx */,
- int /* locy */
-);
-
-extern void
-parse_fake_input(
- ClientPtr /* client */,
- char * /* req */
-);
-
-extern void
-XTestComputeWaitTime(
- struct timeval * /* waittime */
-);
-
-extern int
-XTestProcessInputAction(
- int /* readable */,
- struct timeval * /* waittime */
-);
-
-extern void
-abort_play_back(
- void
-);
-
-extern void
-return_input_array_size(
- ClientPtr /* client */
-);
-
-extern void XTestGenerateEvent(
- int /* dev_type */,
- int /* keycode */,
- int /* keystate */,
- int /* mousex */,
- int /* mousey */
-);
-
-extern void XTestGetPointerPos(
- short * /* fmousex */,
- short * /* fmousey */
-);
-
-extern void XTestJumpPointer(
- int /* jx */,
- int /* jy */,
- int /* dev_type */
-);
-
-#endif /* XTEST1DD_H */
diff --git a/Xext/xtest1di.c b/Xext/xtest1di.c
deleted file mode 100644
index 539d14e30..000000000
--- a/Xext/xtest1di.c
+++ /dev/null
@@ -1,949 +0,0 @@
-/* $Xorg: xtest1di.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/*
- * File: xtest1di.c
- *
- * This file contains the device independent parts of the input
- * synthesis extension.
- */
-
-/*
-
-
-Copyright 1986, 1987, 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1986, 1987, 1988 by Hewlett-Packard Corporation
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Hewlett-Packard not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-Hewlett-Packard makes no representations about the
-suitability of this software for any purpose. It is provided
-"as is" without express or implied warranty.
-
-This software is not subject to any license of the American
-Telephone and Telegraph Company or of the Regents of the
-University of California.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.6 2003/11/17 22:20:28 dawes Exp $ */
-
-/*****************************************************************************
- * include files
- ****************************************************************************/
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "gcstruct.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "opaque.h"
-#define XTestSERVER_SIDE
-#include "xtestext1.h"
-#include "modinit.h"
-
-#include "xtest1dd.h"
-
-/*****************************************************************************
- * defines
- ****************************************************************************/
-
-/*****************************************************************************
- * variables
- ****************************************************************************/
-
-/*
- * Holds the request type code for this extension. The request type code
- * for this extension may vary depending on how many extensions are installed
- * already, so the initial value given below will be added to the base request
- * code that is aquired when this extension is installed.
- */
-static int XTestReqCode = 0;
-/*
- * Holds the two event type codes for this extension. The event type codes
- * for this extension may vary depending on how many extensions are installed
- * already, so the initial values given below will be added to the base event
- * code that is aquired when this extension is installed.
- */
-int XTestInputActionType = 0;
-int XTestFakeAckType = 1;
-/*
- * true => monitor stealing input
- */
-int on_steal_input = FALSE;
-/*
- * true => monitor alone getting input
- */
-int exclusive_steal = FALSE;
-/*
- * holds the resource type assigned to this extension
- */
-static RESTYPE XTestType;
-/*
- * holds the resource ID for the client currently using XTestGetInput
- */
-static XID current_client_id;
-
-/*****************************************************************************
- * function declarations
- ****************************************************************************/
-
-static DISPATCH_PROC(ProcXTestDispatch);
-static DISPATCH_PROC(SProcXTestDispatch);
-static DISPATCH_PROC(ProcTestFakeInput);
-static DISPATCH_PROC(SProcTestFakeInput);
-static DISPATCH_PROC(ProcTestGetInput);
-static DISPATCH_PROC(SProcTestGetInput);
-static DISPATCH_PROC(ProcTestStopInput);
-static DISPATCH_PROC(SProcTestStopInput);
-static DISPATCH_PROC(ProcTestReset);
-static DISPATCH_PROC(SProcTestReset);
-static DISPATCH_PROC(ProcTestQueryInputSize);
-static DISPATCH_PROC(SProcTestQueryInputSize);
-
-static void XTestResetProc(
- ExtensionEntry * /* unused */
- );
-static void SReplyXTestDispatch(
- ClientPtr /* client_ptr */,
- int /* size */,
- char * /* reply_ptr */
- );
-static void SEventXTestDispatch(
- xEvent * /* from */,
- xEvent * /* to */
- );
-
-static int XTestCurrentClientGone(
- pointer /* value */,
- XID /* id */
- );
-
-/*****************************************************************************
- *
- * XTestExtension1Init
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- * XTestExtension1Init has no events or errors
- * (other than the core errors).
- */
-void
-XTestExtension1Init(INITARGS)
-{
- /*
- * holds the pointer to the extension entry structure
- */
- ExtensionEntry *extEntry;
-
- extEntry = AddExtension(XTestEXTENSION_NAME,
- XTestEVENT_COUNT,
- 0,
- ProcXTestDispatch,
- SProcXTestDispatch,
- XTestResetProc,
- StandardMinorOpcode);
- if (extEntry)
- {
- /*
- * remember the request code assigned to this extension
- */
- XTestReqCode = extEntry->base;
- /*
- * make an atom saying that this extension is present
- */
- (void) MakeAtom(XTestEXTENSION_NAME,
- strlen(XTestEXTENSION_NAME),
- TRUE);
- /*
- * remember the event codes assigned to this extension
- */
- XTestInputActionType += extEntry->eventBase;
- XTestFakeAckType += extEntry->eventBase;
- /*
- * install the routine to handle byte-swapping the replies
- * for this extension in the ReplySwapVector table
- */
- ReplySwapVector[XTestReqCode] = (ReplySwapPtr) SReplyXTestDispatch;
- /*
- * install the routine to handle byte-swapping the events
- * for this extension in the EventSwapVector table
- */
- EventSwapVector[XTestInputActionType] = SEventXTestDispatch;
- EventSwapVector[XTestFakeAckType] = SEventXTestDispatch;
- /*
- * get the resource type for this extension
- */
- XTestType = CreateNewResourceType(XTestCurrentClientGone);
- if (XTestType == 0)
- {
- FatalError("XTestExtension1Init: CreateNewResourceType failed\n");
- }
- }
- else
- {
- FatalError("XTestExtension1Init: AddExtensions failed\n");
- }
-}
-
-/*****************************************************************************
- *
- * ProcXTestDispatch
- *
- *
- */
-static int
-ProcXTestDispatch(client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- if (stuff->data == X_TestFakeInput)
- {
- return(ProcTestFakeInput(client));
- }
- else if (stuff->data == X_TestGetInput)
- {
- return(ProcTestGetInput(client));
- }
- else if (stuff->data == X_TestStopInput)
- {
- return(ProcTestStopInput(client));
- }
- else if (stuff->data == X_TestReset)
- {
- return(ProcTestReset(client));
- }
- else if (stuff->data == X_TestQueryInputSize)
- {
- return(ProcTestQueryInputSize(client));
- }
- else
- {
- SendErrorToClient(client,
- XTestReqCode,
- stuff->data,
- None,
- BadRequest);
- return(BadRequest);
- }
-}
-
-/*****************************************************************************
- *
- * SProcXTestDispatch
- *
- *
- */
-static int
-SProcXTestDispatch(client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- if (stuff->data == X_TestFakeInput)
- {
- return(SProcTestFakeInput(client));
- }
- else if (stuff->data == X_TestGetInput)
- {
- return(SProcTestGetInput(client));
- }
- else if (stuff->data == X_TestStopInput)
- {
- return(SProcTestStopInput(client));
- }
- else if (stuff->data == X_TestReset)
- {
- return(SProcTestReset(client));
- }
- else if (stuff->data == X_TestQueryInputSize)
- {
- return(SProcTestQueryInputSize(client));
- }
- else
- {
- SendErrorToClient(client,
- XTestReqCode,
- stuff->data,
- None,
- BadRequest);
- return(BadRequest);
- }
-}
-
-/*****************************************************************************
- *
- * SProcTestFakeInput
- *
- *
- */
-static int
-SProcTestFakeInput(client)
- register ClientPtr client;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
- /*
- * index counter
- */
- int i;
- /*
- * pointer to the next input action in the request
- */
- CARD8 *input_action_ptr;
- /*
- * holds the type of the next input action in the request
- */
- int input_action_type;
-
- REQUEST(xTestFakeInputReq);
- /*
- * byte-swap the fields in the request
- */
- swaps(&stuff->length, n);
- swapl(&stuff->ack, n);
- /*
- * have to parse and then byte-swap the input action list here
- */
- for (i = 0; i < XTestMAX_ACTION_LIST_SIZE;)
- {
- /*
- * point to the next input action in the request
- */
- input_action_ptr = &(((xTestFakeInputReq *) stuff)->action_list[i]);
- /*
- * figure out what type of input action it is
- */
- input_action_type = (*input_action_ptr) & XTestACTION_TYPE_MASK;
- /*
- * byte-swap the input action according to it's type
- */
- switch (input_action_type)
- {
- case XTestKEY_ACTION:
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestKeyInfo);
- break;
- case XTestMOTION_ACTION:
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestMotionInfo);
- break;
- case XTestJUMP_ACTION:
- /*
- * byte-swap the jumpx field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n);
- /*
- * byte-swap the jumpy field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n);
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestJumpInfo);
- break;
- default:
- /*
- * if this is a delay input action, then byte-swap it,
- * otherwise we have reached the end of the input
- * actions in this request
- */
- if (XTestUnpackDeviceID(*input_action_ptr) ==
- XTestDELAY_DEVICE_ID)
- {
- /*
- * byte-swap the delay_time field
- */
- swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestDelayInfo);
- }
- else
- {
- /*
- * if the input action header byte is 0 or
- * ill-formed, then there are no more input
- * actions in this request
- */
- i = XTestMAX_ACTION_LIST_SIZE;
- }
- break;
- }
- }
- return(ProcTestFakeInput(client));
-}
-
-/*****************************************************************************
- *
- * SProcTestGetInput
- *
- *
- */
-static int
-SProcTestGetInput(client)
- register ClientPtr client;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
-
- REQUEST(xTestGetInputReq);
- /*
- * byte-swap the fields in the request
- */
- swaps(&stuff->length, n);
- swapl(&stuff->mode, n);
- return(ProcTestGetInput(client));
-}
-
-/*****************************************************************************
- *
- * SProcTestStopInput
- *
- *
- */
-static int
-SProcTestStopInput(client)
- register ClientPtr client;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
-
- REQUEST(xTestStopInputReq);
- /*
- * byte-swap the length field in the request
- */
- swaps(&stuff->length, n);
- return(ProcTestStopInput(client));
-}
-
-/*****************************************************************************
- *
- * SProcTestReset
- *
- *
- */
-static int
-SProcTestReset(client)
- register ClientPtr client;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
-
- REQUEST(xTestResetReq);
- /*
- * byte-swap the length field in the request
- */
- swaps(&stuff->length, n);
- return(ProcTestReset(client));
-}
-
-/*****************************************************************************
- *
- * SProcTestQueryInputSize
- *
- *
- */
-static int
-SProcTestQueryInputSize(client)
- register ClientPtr client;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
-
- REQUEST(xTestQueryInputSizeReq);
- /*
- * byte-swap the length field in the request
- */
- swaps(&stuff->length, n);
- return(ProcTestQueryInputSize(client));
-}
-
-/*****************************************************************************
- *
- * ProcTestFakeInput
- *
- *
- */
-static int
-ProcTestFakeInput(client)
- register ClientPtr client;
-{
- REQUEST(xTestFakeInputReq);
- REQUEST_SIZE_MATCH(xTestFakeInputReq);
-
- if (playback_client == NULL)
- {
- playback_client = client;
- current_client_id = FakeClientID(client->index);
- AddResource(current_client_id,
- XTestType,
- 0);
- MakeClientGrabImpervious(client);
- }
- if (playback_client == client)
- {
- /*
- * This extension does not need to clean up any
- * server state when a client using this function
- * "goes away". The server will just process any
- * input actions that have already been sent to it,
- * and will then reset its association with a client.
- */
- parse_fake_input(client, (char *)stuff);
- return(Success);
- }
- else
- {
- /*
- * this is a request by another client to send fake
- * input while the server is still being used
- */
- SendErrorToClient(client,
- XTestReqCode,
- X_TestFakeInput,
- None,
- BadAccess);
- return(BadAccess);
- }
-}
-
-/*****************************************************************************
- *
- * ProcTestGetInput
- *
- *
- */
-static int
-ProcTestGetInput(client)
- register ClientPtr client;
-{
- REQUEST(xTestGetInputReq);
- REQUEST_SIZE_MATCH(xTestGetInputReq);
- if (on_steal_input)
- {
- /*
- * this is a request by another client to get fake input
- * while the server is still sending input to the first client
- */
- SendErrorToClient(client,
- XTestReqCode,
- X_TestGetInput,
- None,
- BadAccess);
- return(BadAccess);
- }
- else
- {
- /*
- * Set up a resource associated with the client using this
- * function so that this extension gets called when the
- * client "goes away". This allows this extension to
- * clean up the server state.
- */
- current_client_id = FakeClientID(client->index);
- AddResource(current_client_id,
- XTestType,
- 0);
- /*
- * indicate that a client is stealing input
- */
- on_steal_input = TRUE;
- if ((stuff->mode & XTestEXCLUSIVE) == 0)
- {
- exclusive_steal = FALSE;
- }
- else
- {
- exclusive_steal = TRUE;
- }
- steal_input(client, stuff->mode);
- return(Success);
- }
-}
-
-/*****************************************************************************
- *
- * ProcTestStopInput
- *
- *
- */
-static int
-ProcTestStopInput(client)
- register ClientPtr client;
-{
- REQUEST_SIZE_MATCH(xTestStopInputReq);
- if (on_steal_input && (current_xtest_client == client))
- {
- on_steal_input = FALSE;
- exclusive_steal = FALSE;
- stop_stealing_input();
- /*
- * remove the resource associated with this client
- */
- FreeResource(current_client_id, RT_NONE);
- return(Success);
- }
- else
- {
- /*
- * this is a request to stop fake input when fake input has
- * never been started or from a client that hasn't started
- * fake input
- */
- SendErrorToClient(client,
- XTestReqCode,
- X_TestStopInput,
- None,
- BadAccess);
- return(BadAccess);
- }
-}
-
-/*****************************************************************************
- *
- * ProcTestReset
- *
- *
- */
-static int
-ProcTestReset(client)
- register ClientPtr client;
-{
- REQUEST_SIZE_MATCH(xTestResetReq);
- on_steal_input = FALSE;
- exclusive_steal = FALSE;
- /*
- * defined in xtest1dd.c
- */
- stop_stealing_input();
- /*
- * defined in xtest1dd.c
- */
- abort_play_back();
- return(Success);
-}
-
-/*****************************************************************************
- *
- * ProcTestQueryInputSize
- *
- *
- */
-static int
-ProcTestQueryInputSize(client)
- register ClientPtr client;
-{
- REQUEST_SIZE_MATCH(xTestQueryInputSizeReq);
- /*
- * defined in xtest1dd.c
- */
- return_input_array_size(client);
- return(Success);
-}
-
-/*****************************************************************************
- *
- * XTestResetProc
- *
- * This function is called by the server when the server has no clients
- * connected to it. It must put eveything back the way it was before
- * this extension was installed.
- */
-/*ARGSUSED*/
-static void
-XTestResetProc(unused)
- ExtensionEntry * unused;
-{
- /*
- * remove the routine to handle byte-swapping the replies
- * for this extension in the ReplySwapVector table
- */
- ReplySwapVector[XTestReqCode] = ReplyNotSwappd;
- /*
- * remove the routine to handle byte-swapping the events
- * for this extension in the EventSwapVector table
- */
- EventSwapVector[XTestInputActionType] = NotImplemented;
- EventSwapVector[XTestFakeAckType] = NotImplemented;
- /*
- * reset the variables initialized just once at load time
- */
- XTestReqCode = 0;
- XTestInputActionType = 0;
- XTestFakeAckType = 1;
- on_steal_input = FALSE;
- exclusive_steal = FALSE;
- playback_client = 0; /* Don't really need this but it looks nice */
-}
-
-/*****************************************************************************
- *
- * PXTestCurrentClientGone
- *
- * This routine is called when a client that has asked for input actions
- * to be sent to it "goes away". This routine must clean up the
- * server state.
- */
-/*ARGSUSED*/
-static int
-XTestCurrentClientGone(value, id)
- pointer value;
- XID id;
-{
- /*
- * defined in xtest1dd.c
- */
- on_steal_input = FALSE;
- exclusive_steal = FALSE;
- /*
- * defined in xtestdd.c
- */
- playback_client = 0;
- abort_play_back();
- return TRUE;
-}
-
-/*****************************************************************************
- *
- * SReplyXTestDispatch
- *
- * Swap any replies defined in this extension.
- */
-static void
-SReplyXTestDispatch(client_ptr, size, reply_ptr)
- ClientPtr client_ptr;
- int size;
- char *reply_ptr;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
- /*
- * pointer to xTestQueryInputSizeReply
- */
- xTestQueryInputSizeReply *rep_ptr;
-
- /*
- * there is only one reply in this extension, so byte-swap it
- */
- rep_ptr = (xTestQueryInputSizeReply *) reply_ptr;
- swaps(&(rep_ptr->sequenceNumber), n);
- swapl(&(rep_ptr->length), n);
- swapl(&(rep_ptr->size_return), n);
- /*
- * now write the swapped reply to the client
- */
- WriteToClient(client_ptr, size, reply_ptr);
-}
-
-/*****************************************************************************
- *
- * SEventXTestDispatch
- *
- * Swap any events defined in this extension.
- */
-static void
-SEventXTestDispatch(from, to)
- xEvent *from;
- xEvent *to;
-{
- /*
- * used in the swaps and swapl macros for temporary storage space
- */
- register char n;
- /*
- * index counter
- */
- int i;
- /*
- * pointer to the next input action in the event
- */
- CARD8 *input_action_ptr;
- /*
- * holds the type of the next input action in the event
- */
- int input_action_type;
-
-
- /*
- * copy the type information from the "from" event to the "to" event
- */
- ((xTestInputActionEvent *) to)->type =
- ((xTestInputActionEvent *) from)->type;
- /*
- * copy the sequence number information from the "from" event to the
- * "to" event
- */
- ((xTestInputActionEvent *) to)->sequenceNumber =
- ((xTestInputActionEvent *) from)->sequenceNumber;
- /*
- * byte-swap the sequence number in the "to" event
- */
- swaps(&(((xTestInputActionEvent *) to)->sequenceNumber), n);
- /*
- * If the event is an xTestInputActionEvent, then it needs more
- * processing. Otherwise, it is an xTestFakeAckEvent, which
- * has no other information in it.
- */
- if ((((xTestInputActionEvent *) to)->type & 0x7f) ==
- XTestInputActionType)
- {
- /*
- * copy the input actions from the "from" event
- * to the "to" event
- */
- for (i = 0; i < XTestACTIONS_SIZE; i++)
- {
- ((xTestInputActionEvent *) to)->actions[i] =
- ((xTestInputActionEvent *) from)->actions[i];
- }
- /*
- * byte-swap the input actions in the "to" event
- */
- for (i = 0; i < XTestACTIONS_SIZE; i++)
- {
- /*
- * point to the next input action in the event
- */
- input_action_ptr = &(((xTestInputActionEvent *) to)->actions[i]);
- /*
- * figure out what type of input action it is
- */
- input_action_type = (*input_action_ptr) &
- XTestACTION_TYPE_MASK;
- /*
- * byte-swap the input action according to it's type
- */
- switch (input_action_type)
- {
- case XTestKEY_ACTION:
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestKeyInfo);
- break;
- case XTestMOTION_ACTION:
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestMotionInfo);
- break;
- case XTestJUMP_ACTION:
- /*
- * byte-swap the jumpx field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n);
- /*
- * byte-swap the jumpy field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n);
- /*
- * byte-swap the delay_time field
- */
- swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestJumpInfo);
- break;
- default:
- /*
- * if this is a delay input action, then
- * byte-swap it, otherwise we have reached the
- * end of the input actions in this event
- */
- if (XTestUnpackDeviceID(*input_action_ptr) ==
- XTestDELAY_DEVICE_ID)
- {
- /*
- * byte-swap the delay_time field
- */
- swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time), n);
- /*
- * advance to the next input action
- */
- i += sizeof(XTestDelayInfo);
- }
- else
- {
- /*
- * if the input action header byte is 0
- * or ill-formed, then there are no
- * more input actions in this event
- */
- i = XTestACTIONS_SIZE;
- }
- break;
- }
- }
- }
-}
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
deleted file mode 100644
index 40313470c..000000000
--- a/Xext/xvdisp.c
+++ /dev/null
@@ -1,2212 +0,0 @@
-/***********************************************************
-Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.29 2003/10/02 13:29:39 eich Exp $ */
-
-/*
-** File:
-**
-** xvdisp.c --- Xv server extension dispatch module.
-**
-** Author:
-**
-** David Carver (Digital Workstation Engineering/Project Athena)
-**
-** Revisions:
-**
-** 11.06.91 Carver
-** - changed SetPortControl to SetPortAttribute
-** - changed GetPortControl to GetPortAttribute
-** - changed QueryBestSize
-**
-** 15.05.91 Carver
-** - version 2.0 upgrade
-**
-** 24.01.91 Carver
-** - version 1.4 upgrade
-**
-*/
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-
-#include "Xv.h"
-#include "Xvproto.h"
-#include "xvdix.h"
-#ifdef MITSHM
-#define _XSHM_SERVER_
-#include "shmstr.h"
-#endif
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-#include "xvdisp.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-
-unsigned long XvXRTPort;
-
-#ifdef MITSHM
-static int XineramaXvShmPutImage(ClientPtr);
-#endif
-static int XineramaXvPutImage(ClientPtr);
-static int XineramaXvPutVideo(ClientPtr);
-static int XineramaXvPutStill(ClientPtr);
-static int XineramaXvSetPortAttribute(ClientPtr);
-static int XineramaXvStopVideo(ClientPtr);
-#endif
-
-/* INTERNAL */
-
-static int ProcXvQueryExtension(ClientPtr);
-static int ProcXvQueryAdaptors(ClientPtr);
-static int ProcXvQueryEncodings(ClientPtr);
-static int ProcXvPutVideo(ClientPtr);
-static int ProcXvPutStill(ClientPtr);
-static int ProcXvGetVideo(ClientPtr);
-static int ProcXvGetStill(ClientPtr);
-static int ProcXvGrabPort(ClientPtr);
-static int ProcXvUngrabPort(ClientPtr);
-static int ProcXvSelectVideoNotify(ClientPtr);
-static int ProcXvSelectPortNotify(ClientPtr);
-static int ProcXvStopVideo(ClientPtr);
-static int ProcXvSetPortAttribute(ClientPtr);
-static int ProcXvGetPortAttribute(ClientPtr);
-static int ProcXvQueryBestSize(ClientPtr);
-static int ProcXvQueryPortAttributes(ClientPtr);
-static int ProcXvPutImage(ClientPtr);
-#ifdef MITSHM
-static int ProcXvShmPutImage(ClientPtr);
-#endif
-static int ProcXvQueryImageAttributes(ClientPtr);
-static int ProcXvListImageFormats(ClientPtr);
-
-static int SProcXvQueryExtension(ClientPtr);
-static int SProcXvQueryAdaptors(ClientPtr);
-static int SProcXvQueryEncodings(ClientPtr);
-static int SProcXvPutVideo(ClientPtr);
-static int SProcXvPutStill(ClientPtr);
-static int SProcXvGetVideo(ClientPtr);
-static int SProcXvGetStill(ClientPtr);
-static int SProcXvGrabPort(ClientPtr);
-static int SProcXvUngrabPort(ClientPtr);
-static int SProcXvSelectVideoNotify(ClientPtr);
-static int SProcXvSelectPortNotify(ClientPtr);
-static int SProcXvStopVideo(ClientPtr);
-static int SProcXvSetPortAttribute(ClientPtr);
-static int SProcXvGetPortAttribute(ClientPtr);
-static int SProcXvQueryBestSize(ClientPtr);
-static int SProcXvQueryPortAttributes(ClientPtr);
-static int SProcXvPutImage(ClientPtr);
-#ifdef MITSHM
-static int SProcXvShmPutImage(ClientPtr);
-#endif
-static int SProcXvQueryImageAttributes(ClientPtr);
-static int SProcXvListImageFormats(ClientPtr);
-
-static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *);
-static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *);
-static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *);
-static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *);
-static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *);
-static int SWriteFormat(ClientPtr, xvFormat *);
-static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *);
-static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *);
-static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *);
-static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *);
-static int SWriteQueryPortAttributesReply(
- ClientPtr, xvQueryPortAttributesReply *);
-static int SWriteQueryImageAttributesReply(
- ClientPtr, xvQueryImageAttributesReply*);
-static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*);
-static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*);
-
-#define _WriteQueryAdaptorsReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d)
-
-#define _WriteQueryExtensionReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d)
-
-#define _WriteQueryEncodingsReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d)
-
-#define _WriteAdaptorInfo(_c,_d) \
- if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \
- else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d)
-
-#define _WriteAttributeInfo(_c,_d) \
- if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \
- else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d)
-
-#define _WriteEncodingInfo(_c,_d) \
- if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \
- else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d)
-
-#define _WriteFormat(_c,_d) \
- if ((_c)->swapped) SWriteFormat(_c, _d); \
- else WriteToClient(_c, sz_xvFormat, (char*)_d)
-
-#define _WriteGrabPortReply(_c,_d) \
- if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \
- else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d)
-
-#define _WriteGetPortAttributeReply(_c,_d) \
- if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \
- else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d)
-
-#define _WriteQueryBestSizeReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d)
-
-#define _WriteQueryPortAttributesReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d)
-
-#define _WriteQueryImageAttributesReply(_c,_d) \
- if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \
- else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d)
-
-#define _WriteListImageFormatsReply(_c,_d) \
- if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \
- else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d)
-
-#define _WriteImageFormatInfo(_c,_d) \
- if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
- else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d)
-
-#define _AllocatePort(_i,_p) \
- ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
-
-/*
-** ProcXvDispatch
-**
-**
-**
-*/
-
-int
-ProcXvDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- UpdateCurrentTime();
-
- switch (stuff->data)
- {
- case xv_QueryExtension: return(ProcXvQueryExtension(client));
- case xv_QueryAdaptors: return(ProcXvQueryAdaptors(client));
- case xv_QueryEncodings: return(ProcXvQueryEncodings(client));
- case xv_PutVideo:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutVideo(client));
- else
-#endif
- return(ProcXvPutVideo(client));
- case xv_PutStill:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutStill(client));
- else
-#endif
- return(ProcXvPutStill(client));
- case xv_GetVideo: return(ProcXvGetVideo(client));
- case xv_GetStill: return(ProcXvGetStill(client));
- case xv_GrabPort: return(ProcXvGrabPort(client));
- case xv_UngrabPort: return(ProcXvUngrabPort(client));
- case xv_SelectVideoNotify: return(ProcXvSelectVideoNotify(client));
- case xv_SelectPortNotify: return(ProcXvSelectPortNotify(client));
- case xv_StopVideo:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvStopVideo(client));
- else
-#endif
- return(ProcXvStopVideo(client));
- case xv_SetPortAttribute:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvSetPortAttribute(client));
- else
-#endif
- return(ProcXvSetPortAttribute(client));
- case xv_GetPortAttribute: return(ProcXvGetPortAttribute(client));
- case xv_QueryBestSize: return(ProcXvQueryBestSize(client));
- case xv_QueryPortAttributes: return(ProcXvQueryPortAttributes(client));
- case xv_PutImage:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutImage(client));
- else
-#endif
- return(ProcXvPutImage(client));
-#ifdef MITSHM
- case xv_ShmPutImage:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvShmPutImage(client));
- else
-#endif
- return(ProcXvShmPutImage(client));
-#endif
- case xv_QueryImageAttributes: return(ProcXvQueryImageAttributes(client));
- case xv_ListImageFormats: return(ProcXvListImageFormats(client));
- default:
- if (stuff->data < xvNumRequests)
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0,
- BadImplementation);
- return(BadImplementation);
- }
- else
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
- return(BadRequest);
- }
- }
-}
-
-int
-SProcXvDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- UpdateCurrentTime();
-
- switch (stuff->data)
- {
- case xv_QueryExtension: return(SProcXvQueryExtension(client));
- case xv_QueryAdaptors: return(SProcXvQueryAdaptors(client));
- case xv_QueryEncodings: return(SProcXvQueryEncodings(client));
- case xv_PutVideo: return(SProcXvPutVideo(client));
- case xv_PutStill: return(SProcXvPutStill(client));
- case xv_GetVideo: return(SProcXvGetVideo(client));
- case xv_GetStill: return(SProcXvGetStill(client));
- case xv_GrabPort: return(SProcXvGrabPort(client));
- case xv_UngrabPort: return(SProcXvUngrabPort(client));
- case xv_SelectVideoNotify: return(SProcXvSelectVideoNotify(client));
- case xv_SelectPortNotify: return(SProcXvSelectPortNotify(client));
- case xv_StopVideo: return(SProcXvStopVideo(client));
- case xv_SetPortAttribute: return(SProcXvSetPortAttribute(client));
- case xv_GetPortAttribute: return(SProcXvGetPortAttribute(client));
- case xv_QueryBestSize: return(SProcXvQueryBestSize(client));
- case xv_QueryPortAttributes: return(SProcXvQueryPortAttributes(client));
- case xv_PutImage: return(SProcXvPutImage(client));
-#ifdef MITSHM
- case xv_ShmPutImage: return(SProcXvShmPutImage(client));
-#endif
- case xv_QueryImageAttributes: return(SProcXvQueryImageAttributes(client));
- case xv_ListImageFormats: return(SProcXvListImageFormats(client));
- default:
- if (stuff->data < xvNumRequests)
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0,
- BadImplementation);
- return(BadImplementation);
- }
- else
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
- return(BadRequest);
- }
- }
-}
-
-static int
-ProcXvQueryExtension(ClientPtr client)
-{
- xvQueryExtensionReply rep;
- /* REQUEST(xvQueryExtensionReq); */
- REQUEST_SIZE_MATCH(xvQueryExtensionReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.version = XvVersion;
- rep.revision = XvRevision;
-
- _WriteQueryExtensionReply(client, &rep);
-
- return Success;
-
-}
-
-static int
-ProcXvQueryAdaptors(ClientPtr client)
-{
- xvFormat format;
- xvAdaptorInfo ainfo;
- xvQueryAdaptorsReply rep;
- int totalSize;
- int na;
- XvAdaptorPtr pa;
- int nf;
- XvFormatPtr pf;
- WindowPtr pWin;
- ScreenPtr pScreen;
- XvScreenPtr pxvs;
-
- REQUEST(xvQueryAdaptorsReq);
- REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
-
- if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) ))
- {
- client->errorValue = stuff->window;
- return (BadWindow);
- }
-
- pScreen = pWin->drawable.pScreen;
- pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
-
- if (!pxvs)
- {
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_adaptors = 0;
- rep.length = 0;
-
- _WriteQueryAdaptorsReply(client, &rep);
-
- return Success;
- }
-
- (* pxvs->ddQueryAdaptors)(pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_adaptors = pxvs->nAdaptors;
-
- /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
-
- totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo;
-
- /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */
-
- na = pxvs->nAdaptors;
- pa = pxvs->pAdaptors;
- while (na--)
- {
- totalSize += (strlen(pa->name) + 3) & ~3;
- totalSize += pa->nFormats * sz_xvFormat;
- pa++;
- }
-
- rep.length = totalSize >> 2;
-
- _WriteQueryAdaptorsReply(client, &rep);
-
- na = pxvs->nAdaptors;
- pa = pxvs->pAdaptors;
- while (na--)
- {
-
- ainfo.base_id = pa->base_id;
- ainfo.num_ports = pa->nPorts;
- ainfo.type = pa->type;
- ainfo.name_size = strlen(pa->name);
- ainfo.num_formats = pa->nFormats;
-
- _WriteAdaptorInfo(client, &ainfo);
-
- WriteToClient(client, ainfo.name_size, pa->name);
-
- nf = pa->nFormats;
- pf = pa->pFormats;
- while (nf--)
- {
- format.depth = pf->depth;
- format.visual = pf->visual;
- _WriteFormat(client, &format);
- pf++;
- }
-
- pa++;
-
- }
-
- return (client->noClientException);
-
-}
-
-static int
-ProcXvQueryEncodings(ClientPtr client)
-{
- xvEncodingInfo einfo;
- xvQueryEncodingsReply rep;
- int totalSize;
- XvPortPtr pPort;
- int ne;
- XvEncodingPtr pe;
- int status;
-
- REQUEST(xvQueryEncodingsReq);
- REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_encodings = pPort->pAdaptor->nEncodings;
-
- /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
-
- ne = pPort->pAdaptor->nEncodings;
- pe = pPort->pAdaptor->pEncodings;
- totalSize = ne * sz_xvEncodingInfo;
- while (ne--)
- {
- totalSize += (strlen(pe->name) + 3) & ~3;
- pe++;
- }
-
- rep.length = totalSize >> 2;
-
- _WriteQueryEncodingsReply(client, &rep);
-
- ne = pPort->pAdaptor->nEncodings;
- pe = pPort->pAdaptor->pEncodings;
- while (ne--)
- {
- einfo.encoding = pe->id;
- einfo.name_size = strlen(pe->name);
- einfo.width = pe->width;
- einfo.height = pe->height;
- einfo.rate.numerator = pe->rate.numerator;
- einfo.rate.denominator = pe->rate.denominator;
- _WriteEncodingInfo(client, &einfo);
- WriteToClient(client, einfo.name_size, pe->name);
- pe++;
- }
-
- return (client->noClientException);
-
-}
-
-static int
-ProcXvPutVideo(ClientPtr client)
-{
- register DrawablePtr pDraw;
- XvPortPtr pPort;
- register GCPtr pGC;
- int status;
-
- REQUEST(xvPutVideoReq);
- REQUEST_SIZE_MATCH(xvPutVideoReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvInputMask) ||
- !(pPort->pAdaptor->type & XvVideoMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- return XVCALL(diPutVideo)(client, pDraw, pPort, pGC,
- stuff->vid_x, stuff->vid_y,
- stuff->vid_w, stuff->vid_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h);
-
-}
-
-static int
-ProcXvPutStill(ClientPtr client)
-{
- register DrawablePtr pDraw;
- XvPortPtr pPort;
- register GCPtr pGC;
- int status;
-
- REQUEST(xvPutStillReq);
- REQUEST_SIZE_MATCH(xvPutStillReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvInputMask) ||
- !(pPort->pAdaptor->type & XvStillMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- return XVCALL(diPutStill)(client, pDraw, pPort, pGC,
- stuff->vid_x, stuff->vid_y,
- stuff->vid_w, stuff->vid_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h);
-
-}
-
-
-static int
-ProcXvGetVideo(ClientPtr client)
-{
- register DrawablePtr pDraw;
- XvPortPtr pPort;
- register GCPtr pGC;
- int status;
-
- REQUEST(xvGetVideoReq);
- REQUEST_SIZE_MATCH(xvGetVideoReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvOutputMask) ||
- !(pPort->pAdaptor->type & XvVideoMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- return XVCALL(diGetVideo)(client, pDraw, pPort, pGC,
- stuff->vid_x, stuff->vid_y,
- stuff->vid_w, stuff->vid_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h);
-
-}
-
-
-static int
-ProcXvGetStill(ClientPtr client)
-{
- register DrawablePtr pDraw;
- XvPortPtr pPort;
- register GCPtr pGC;
- int status;
-
- REQUEST(xvGetStillReq);
- REQUEST_SIZE_MATCH(xvGetStillReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvOutputMask) ||
- !(pPort->pAdaptor->type & XvStillMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- return XVCALL(diGetStill)(client, pDraw, pPort, pGC,
- stuff->vid_x, stuff->vid_y,
- stuff->vid_w, stuff->vid_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h);
-
-}
-
-static int
-ProcXvSelectVideoNotify(ClientPtr client)
-{
- register DrawablePtr pDraw;
- REQUEST(xvSelectVideoNotifyReq);
- REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
-
- if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) ))
- {
- client->errorValue = stuff->drawable;
- return (BadWindow);
- }
-
- return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff);
-
-}
-
-static int
-ProcXvSelectPortNotify(ClientPtr client)
-{
- int status;
- XvPortPtr pPort;
- REQUEST(xvSelectPortNotifyReq);
- REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff);
-
-}
-
-static int
-ProcXvGrabPort(ClientPtr client)
-{
- int result, status;
- XvPortPtr pPort;
- xvGrabPortReply rep;
- REQUEST(xvGrabPortReq);
- REQUEST_SIZE_MATCH(xvGrabPortReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result);
-
- if (status != Success)
- {
- return status;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.result = result;
-
- _WriteGrabPortReply(client, &rep);
-
- return Success;
-
-}
-
-static int
-ProcXvUngrabPort(ClientPtr client)
-{
- int status;
- XvPortPtr pPort;
- REQUEST(xvGrabPortReq);
- REQUEST_SIZE_MATCH(xvGrabPortReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- return XVCALL(diUngrabPort)(client, pPort, stuff->time);
-
-}
-
-
-static int
-ProcXvStopVideo(ClientPtr client)
-{
- int status;
- register DrawablePtr pDraw;
- XvPortPtr pPort;
- REQUEST(xvStopVideoReq);
- REQUEST_SIZE_MATCH(xvStopVideoReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) ))
- {
- client->errorValue = stuff->drawable;
- return (BadDrawable);
- }
-
- return XVCALL(diStopVideo)(client, pPort, pDraw);
-
-}
-
-static int
-ProcXvSetPortAttribute(ClientPtr client)
-{
- int status;
- XvPortPtr pPort;
- REQUEST(xvSetPortAttributeReq);
- REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!ValidAtom(stuff->attribute))
- {
- client->errorValue = stuff->attribute;
- return(BadAtom);
- }
-
- status = XVCALL(diSetPortAttribute)(client, pPort,
- stuff->attribute, stuff->value);
-
- if (status == BadMatch)
- client->errorValue = stuff->attribute;
- else
- client->errorValue = stuff->value;
-
- return status;
-}
-
-static int
-ProcXvGetPortAttribute(ClientPtr client)
-{
- INT32 value;
- int status;
- XvPortPtr pPort;
- xvGetPortAttributeReply rep;
- REQUEST(xvGetPortAttributeReq);
- REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!ValidAtom(stuff->attribute))
- {
- client->errorValue = stuff->attribute;
- return(BadAtom);
- }
-
- status = XVCALL(diGetPortAttribute)(client, pPort, stuff->attribute, &value);
- if (status != Success)
- {
- client->errorValue = stuff->attribute;
- return status;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.value = value;
-
- _WriteGetPortAttributeReply(client, &rep);
-
- return Success;
-}
-
-static int
-ProcXvQueryBestSize(ClientPtr client)
-{
- int status;
- unsigned int actual_width, actual_height;
- XvPortPtr pPort;
- xvQueryBestSizeReply rep;
- REQUEST(xvQueryBestSizeReq);
- REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
- (* pPort->pAdaptor->ddQueryBestSize)(client, pPort, stuff->motion,
- stuff->vid_w, stuff->vid_h,
- stuff->drw_w, stuff->drw_h,
- &actual_width, &actual_height);
-
- rep.actual_width = actual_width;
- rep.actual_height = actual_height;
-
- _WriteQueryBestSizeReply(client, &rep);
-
- return Success;
-}
-
-
-static int
-ProcXvQueryPortAttributes(ClientPtr client)
-{
- int status, size, i;
- XvPortPtr pPort;
- XvAttributePtr pAtt;
- xvQueryPortAttributesReply rep;
- xvAttributeInfo Info;
- REQUEST(xvQueryPortAttributesReq);
- REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_attributes = pPort->pAdaptor->nAttributes;
- rep.text_size = 0;
-
- for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
- i < rep.num_attributes; i++, pAtt++)
- {
- rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L;
- }
-
- rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size;
- rep.length >>= 2;
-
- _WriteQueryPortAttributesReply(client, &rep);
-
- for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
- i < rep.num_attributes; i++, pAtt++)
- {
- size = strlen(pAtt->name) + 1; /* pass the NULL */
- Info.flags = pAtt->flags;
- Info.min = pAtt->min_value;
- Info.max = pAtt->max_value;
- Info.size = (size + 3) & ~3L;
-
- _WriteAttributeInfo(client, &Info);
-
- WriteToClient(client, size, pAtt->name);
- }
-
- return Success;
-}
-
-
-
-static int
-ProcXvPutImage(ClientPtr client)
-{
- DrawablePtr pDraw;
- XvPortPtr pPort;
- XvImagePtr pImage = NULL;
- GCPtr pGC;
- int status, i, size;
- CARD16 width, height;
-
- REQUEST(xvPutImageReq);
- REQUEST_AT_LEAST_SIZE(xvPutImageReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvImageMask) ||
- !(pPort->pAdaptor->type & XvInputMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- for(i = 0; i < pPort->pAdaptor->nImages; i++) {
- if(pPort->pAdaptor->pImages[i].id == stuff->id) {
- pImage = &(pPort->pAdaptor->pImages[i]);
- break;
- }
- }
-
- if(!pImage)
- return BadMatch;
-
- width = stuff->width;
- height = stuff->height;
- size = (*pPort->pAdaptor->ddQueryImageAttributes)(client,
- pPort, pImage, &width, &height, NULL, NULL);
- size += sizeof(xvPutImageReq);
- size = (size + 3) >> 2;
-
- if((width < stuff->width) || (height < stuff->height))
- return BadValue;
-
- if(client->req_len < size)
- return BadLength;
-
- return XVCALL(diPutImage)(client, pDraw, pPort, pGC,
- stuff->src_x, stuff->src_y,
- stuff->src_w, stuff->src_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h,
- pImage, (unsigned char*)(&stuff[1]), FALSE,
- stuff->width, stuff->height);
-}
-
-#ifdef MITSHM
-/* redefined here since it's not in any header file */
-typedef struct _ShmDesc {
- struct _ShmDesc *next;
- int shmid;
- int refcnt;
- char *addr;
- Bool writable;
- unsigned long size;
-} ShmDescRec, *ShmDescPtr;
-
-extern RESTYPE ShmSegType;
-extern int BadShmSegCode;
-extern int ShmCompletionCode;
-
-static int
-ProcXvShmPutImage(ClientPtr client)
-{
- ShmDescPtr shmdesc;
- DrawablePtr pDraw;
- XvPortPtr pPort;
- XvImagePtr pImage = NULL;
- GCPtr pGC;
- int status, size_needed, i;
- CARD16 width, height;
-
- REQUEST(xvShmPutImageReq);
- REQUEST_SIZE_MATCH(xvShmPutImageReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- if ((status = _AllocatePort(stuff->port, pPort)) != Success)
- {
- client->errorValue = stuff->port;
- return (status);
- }
-
- if (!(pPort->pAdaptor->type & XvImageMask) ||
- !(pPort->pAdaptor->type & XvInputMask))
- {
- client->errorValue = stuff->port;
- return (BadMatch);
- }
-
- status = XVCALL(diMatchPort)(pPort, pDraw);
- if (status != Success)
- {
- return status;
- }
-
- for(i = 0; i < pPort->pAdaptor->nImages; i++) {
- if(pPort->pAdaptor->pImages[i].id == stuff->id) {
- pImage = &(pPort->pAdaptor->pImages[i]);
- break;
- }
- }
-
- if(!pImage)
- return BadMatch;
-
- if(!(shmdesc = (ShmDescPtr)LookupIDByType(stuff->shmseg, ShmSegType)))
- {
- client->errorValue = stuff->shmseg;
- return BadShmSegCode;
- }
-
- width = stuff->width;
- height = stuff->height;
- size_needed = (*pPort->pAdaptor->ddQueryImageAttributes)(client,
- pPort, pImage, &width, &height, NULL, NULL);
- if((size_needed + stuff->offset) > shmdesc->size)
- return BadAccess;
-
- if((width < stuff->width) || (height < stuff->height))
- return BadValue;
-
- status = XVCALL(diPutImage)(client, pDraw, pPort, pGC,
- stuff->src_x, stuff->src_y,
- stuff->src_w, stuff->src_h,
- stuff->drw_x, stuff->drw_y,
- stuff->drw_w, stuff->drw_h, pImage,
- (unsigned char *)shmdesc->addr + stuff->offset,
- stuff->send_event, stuff->width, stuff->height);
-
- if((status == Success) && stuff->send_event) {
- xShmCompletionEvent ev;
-
- ev.type = ShmCompletionCode;
- ev.drawable = stuff->drawable;
- ev.sequenceNumber = client->sequence;
- ev.minorEvent = xv_ShmPutImage;
- ev.majorEvent = XvReqCode;
- ev.shmseg = stuff->shmseg;
- ev.offset = stuff->offset;
- WriteEventsToClient(client, 1, (xEvent *) &ev);
- }
-
- return status;
-}
-#endif
-
-#ifdef XvMCExtension
-#include "xvmcext.h"
-#endif
-
-static int
-ProcXvQueryImageAttributes(ClientPtr client)
-{
- xvQueryImageAttributesReply rep;
- int size, num_planes, i;
- CARD16 width, height;
- XvImagePtr pImage = NULL;
- XvPortPtr pPort;
- int *offsets;
- int *pitches;
- REQUEST(xvQueryImageAttributesReq);
-
- REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- for(i = 0; i < pPort->pAdaptor->nImages; i++) {
- if(pPort->pAdaptor->pImages[i].id == stuff->id) {
- pImage = &(pPort->pAdaptor->pImages[i]);
- break;
- }
- }
-
-#ifdef XvMCExtension
- if(!pImage)
- pImage = XvMCFindXvImage(pPort, stuff->id);
-#endif
-
- if(!pImage)
- return BadMatch;
-
- num_planes = pImage->num_planes;
-
- if(!(offsets = xalloc(num_planes << 3)))
- return BadAlloc;
- pitches = offsets + num_planes;
-
- width = stuff->width;
- height = stuff->height;
-
- size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, pPort, pImage,
- &width, &height, offsets, pitches);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = num_planes << 1;
- rep.num_planes = num_planes;
- rep.width = width;
- rep.height = height;
- rep.data_size = size;
-
- _WriteQueryImageAttributesReply(client, &rep);
- if(client->swapped)
- SwapLongs((CARD32*)offsets, rep.length);
- WriteToClient(client, rep.length << 2, (char*)offsets);
-
- xfree(offsets);
-
- return Success;
-}
-
-static int
-ProcXvListImageFormats(ClientPtr client)
-{
- XvPortPtr pPort;
- XvImagePtr pImage;
- int i;
- xvListImageFormatsReply rep;
- xvImageFormatInfo info;
- REQUEST(xvListImageFormatsReq);
-
- REQUEST_SIZE_MATCH(xvListImageFormatsReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
- {
- client->errorValue = stuff->port;
- return (_XvBadPort);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_formats = pPort->pAdaptor->nImages;
- rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2;
-
- _WriteListImageFormatsReply(client, &rep);
-
- pImage = pPort->pAdaptor->pImages;
-
- for(i = 0; i < rep.num_formats; i++, pImage++) {
- info.id = pImage->id;
- info.type = pImage->type;
- info.byte_order = pImage->byte_order;
- memcpy(&info.guid, pImage->guid, 16);
- info.bpp = pImage->bits_per_pixel;
- info.num_planes = pImage->num_planes;
- info.depth = pImage->depth;
- info.red_mask = pImage->red_mask;
- info.green_mask = pImage->green_mask;
- info.blue_mask = pImage->blue_mask;
- info.format = pImage->format;
- info.y_sample_bits = pImage->y_sample_bits;
- info.u_sample_bits = pImage->u_sample_bits;
- info.v_sample_bits = pImage->v_sample_bits;
- info.horz_y_period = pImage->horz_y_period;
- info.horz_u_period = pImage->horz_u_period;
- info.horz_v_period = pImage->horz_v_period;
- info.vert_y_period = pImage->vert_y_period;
- info.vert_u_period = pImage->vert_u_period;
- info.vert_v_period = pImage->vert_v_period;
- memcpy(&info.comp_order, pImage->component_order, 32);
- info.scanline_order = pImage->scanline_order;
- _WriteImageFormatInfo(client, &info);
- }
-
- return Success;
-}
-
-
-
-/* Swapped Procs */
-
-static int
-SProcXvQueryExtension(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryExtensionReq);
- swaps(&stuff->length, n);
- return ProcXvQueryExtension(client);
-}
-
-static int
-SProcXvQueryAdaptors(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryAdaptorsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- return ProcXvQueryAdaptors(client);
-}
-
-static int
-SProcXvQueryEncodings(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryEncodingsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- return ProcXvQueryEncodings(client);
-}
-
-static int
-SProcXvGrabPort(ClientPtr client)
-{
- register char n;
- REQUEST(xvGrabPortReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->time, n);
- return ProcXvGrabPort(client);
-}
-
-static int
-SProcXvUngrabPort(ClientPtr client)
-{
- register char n;
- REQUEST(xvUngrabPortReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->time, n);
- return ProcXvUngrabPort(client);
-}
-
-static int
-SProcXvPutVideo(ClientPtr client)
-{
- register char n;
- REQUEST(xvPutVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- return ProcXvPutVideo(client);
-}
-
-static int
-SProcXvPutStill(ClientPtr client)
-{
- register char n;
- REQUEST(xvPutStillReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- return ProcXvPutStill(client);
-}
-
-static int
-SProcXvGetVideo(ClientPtr client)
-{
- register char n;
- REQUEST(xvGetVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- return ProcXvGetVideo(client);
-}
-
-static int
-SProcXvGetStill(ClientPtr client)
-{
- register char n;
- REQUEST(xvGetStillReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- return ProcXvGetStill(client);
-}
-
-static int
-SProcXvPutImage(ClientPtr client)
-{
- register char n;
- REQUEST(xvPutImageReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swapl(&stuff->id, n);
- swaps(&stuff->src_x, n);
- swaps(&stuff->src_y, n);
- swaps(&stuff->src_w, n);
- swaps(&stuff->src_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return ProcXvPutImage(client);
-}
-
-#ifdef MITSHM
-static int
-SProcXvShmPutImage(ClientPtr client)
-{
- register char n;
- REQUEST(xvShmPutImageReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->id, n);
- swaps(&stuff->src_x, n);
- swaps(&stuff->src_y, n);
- swaps(&stuff->src_w, n);
- swaps(&stuff->src_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- swaps(&stuff->offset, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return ProcXvShmPutImage(client);
-}
-#endif
-
-
-static int
-SProcXvSelectVideoNotify(ClientPtr client)
-{
- register char n;
- REQUEST(xvSelectVideoNotifyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
- return ProcXvSelectVideoNotify(client);
-}
-
-static int
-SProcXvSelectPortNotify(ClientPtr client)
-{
- register char n;
- REQUEST(xvSelectPortNotifyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- return ProcXvSelectPortNotify(client);
-}
-
-static int
-SProcXvStopVideo(ClientPtr client)
-{
- register char n;
- REQUEST(xvStopVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- return ProcXvStopVideo(client);
-}
-
-static int
-SProcXvSetPortAttribute(ClientPtr client)
-{
- register char n;
- REQUEST(xvSetPortAttributeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->attribute, n);
- return ProcXvSetPortAttribute(client);
-}
-
-static int
-SProcXvGetPortAttribute(ClientPtr client)
-{
- register char n;
- REQUEST(xvGetPortAttributeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->attribute, n);
- return ProcXvGetPortAttribute(client);
-}
-
-static int
-SProcXvQueryBestSize(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryBestSizeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- return ProcXvQueryBestSize(client);
-}
-
-static int
-SProcXvQueryPortAttributes(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryPortAttributesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- return ProcXvQueryPortAttributes(client);
-}
-
-static int
-SProcXvQueryImageAttributes(ClientPtr client)
-{
- register char n;
- REQUEST(xvQueryImageAttributesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->id, n);
- swaps(&stuff->width, n);
- swaps(&stuff->width, n);
- return ProcXvQueryImageAttributes(client);
-}
-
-static int
-SProcXvListImageFormats(ClientPtr client)
-{
- register char n;
- REQUEST(xvListImageFormatsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- return ProcXvListImageFormats(client);
-}
-
-
-static int
-SWriteQueryExtensionReply(
- ClientPtr client,
- xvQueryExtensionReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->version, n);
- swaps(&rep->revision, n);
-
- (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryAdaptorsReply(
- ClientPtr client,
- xvQueryAdaptorsReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_adaptors, n);
-
- (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryEncodingsReply(
- ClientPtr client,
- xvQueryEncodingsReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_encodings, n);
-
- (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteAdaptorInfo(
- ClientPtr client,
- xvAdaptorInfo *pAdaptor
-){
- register char n;
-
- swapl(&pAdaptor->base_id, n);
- swaps(&pAdaptor->name_size, n);
- swaps(&pAdaptor->num_ports, n);
- swaps(&pAdaptor->num_formats, n);
-
- (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
-
- return Success;
-}
-
-static int
-SWriteEncodingInfo(
- ClientPtr client,
- xvEncodingInfo *pEncoding
-){
- register char n;
-
- swapl(&pEncoding->encoding, n);
- swaps(&pEncoding->name_size, n);
- swaps(&pEncoding->width, n);
- swaps(&pEncoding->height, n);
- swapl(&pEncoding->rate.numerator, n);
- swapl(&pEncoding->rate.denominator, n);
- (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
-
- return Success;
-}
-
-static int
-SWriteFormat(
- ClientPtr client,
- xvFormat *pFormat
-){
- register char n;
-
- swapl(&pFormat->visual, n);
- (void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
-
- return Success;
-}
-
-static int
-SWriteAttributeInfo(
- ClientPtr client,
- xvAttributeInfo *pAtt
-){
- register char n;
-
- swapl(&pAtt->flags, n);
- swapl(&pAtt->size, n);
- swapl(&pAtt->min, n);
- swapl(&pAtt->max, n);
- (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
-
- return Success;
-}
-
-static int
-SWriteImageFormatInfo(
- ClientPtr client,
- xvImageFormatInfo *pImage
-){
- register char n;
-
- swapl(&pImage->id, n);
- swapl(&pImage->red_mask, n);
- swapl(&pImage->green_mask, n);
- swapl(&pImage->blue_mask, n);
- swapl(&pImage->y_sample_bits, n);
- swapl(&pImage->u_sample_bits, n);
- swapl(&pImage->v_sample_bits, n);
- swapl(&pImage->horz_y_period, n);
- swapl(&pImage->horz_u_period, n);
- swapl(&pImage->horz_v_period, n);
- swapl(&pImage->vert_y_period, n);
- swapl(&pImage->vert_u_period, n);
- swapl(&pImage->vert_v_period, n);
-
- (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
-
- return Success;
-}
-
-
-
-static int
-SWriteGrabPortReply(
- ClientPtr client,
- xvGrabPortReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
-
- (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteGetPortAttributeReply(
- ClientPtr client,
- xvGetPortAttributeReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->value, n);
-
- (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryBestSizeReply(
- ClientPtr client,
- xvQueryBestSizeReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->actual_width, n);
- swaps(&rep->actual_height, n);
-
- (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryPortAttributesReply(
- ClientPtr client,
- xvQueryPortAttributesReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_attributes, n);
- swapl(&rep->text_size, n);
-
- (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryImageAttributesReply(
- ClientPtr client,
- xvQueryImageAttributesReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_planes, n);
- swapl(&rep->data_size, n);
- swaps(&rep->width, n);
- swaps(&rep->height, n);
-
- (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep);
-
- return Success;
-}
-
-
-static int
-SWriteListImageFormatsReply(
- ClientPtr client,
- xvListImageFormatsReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_formats, n);
-
- (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep);
-
- return Success;
-}
-
-
-#ifdef PANORAMIX
-
-
-
-
-static int
-XineramaXvStopVideo(ClientPtr client)
-{
- int result = Success, i;
- PanoramiXRes *draw, *port;
- REQUEST(xvStopVideoReq);
- REQUEST_SIZE_MATCH(xvStopVideoReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->drawable = draw->info[i].id;
- stuff->port = port->info[i].id;
- result = ProcXvStopVideo(client);
- }
- }
-
- return result;
-}
-
-static int
-XineramaXvSetPortAttribute(ClientPtr client)
-{
- REQUEST(xvSetPortAttributeReq);
- PanoramiXRes *port;
- int result = Success, i;
-
- REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->port = port->info[i].id;
- result = ProcXvSetPortAttribute(client);
- }
- }
- return result;
-}
-
-
-#ifdef MITSHM
-static int
-XineramaXvShmPutImage(ClientPtr client)
-{
- REQUEST(xvShmPutImageReq);
- PanoramiXRes *draw, *gc, *port;
- Bool send_event = stuff->send_event;
- Bool isRoot;
- int result = Success, i, x, y;
-
- REQUEST_SIZE_MATCH(xvShmPutImageReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- x = stuff->drw_x;
- y = stuff->drw_y;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->drawable = draw->info[i].id;
- stuff->port = port->info[i].id;
- stuff->gc = gc->info[i].id;
- stuff->drw_x = x;
- stuff->drw_y = y;
- if(isRoot) {
- stuff->drw_x -= panoramiXdataPtr[i].x;
- stuff->drw_y -= panoramiXdataPtr[i].y;
- }
- stuff->send_event = (send_event && !i) ? 1 : 0;
-
- result = ProcXvShmPutImage(client);
- }
- }
- return result;
-}
-#endif
-
-static int
-XineramaXvPutImage(ClientPtr client)
-{
- REQUEST(xvPutImageReq);
- PanoramiXRes *draw, *gc, *port;
- Bool isRoot;
- int result = Success, i, x, y;
-
- REQUEST_AT_LEAST_SIZE(xvPutImageReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- x = stuff->drw_x;
- y = stuff->drw_y;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->drawable = draw->info[i].id;
- stuff->port = port->info[i].id;
- stuff->gc = gc->info[i].id;
- stuff->drw_x = x;
- stuff->drw_y = y;
- if(isRoot) {
- stuff->drw_x -= panoramiXdataPtr[i].x;
- stuff->drw_y -= panoramiXdataPtr[i].y;
- }
-
- result = ProcXvPutImage(client);
- }
- }
- return result;
-}
-
-static int
-XineramaXvPutVideo(ClientPtr client)
-{
- REQUEST(xvPutImageReq);
- PanoramiXRes *draw, *gc, *port;
- Bool isRoot;
- int result = Success, i, x, y;
-
- REQUEST_AT_LEAST_SIZE(xvPutVideoReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- x = stuff->drw_x;
- y = stuff->drw_y;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->drawable = draw->info[i].id;
- stuff->port = port->info[i].id;
- stuff->gc = gc->info[i].id;
- stuff->drw_x = x;
- stuff->drw_y = y;
- if(isRoot) {
- stuff->drw_x -= panoramiXdataPtr[i].x;
- stuff->drw_y -= panoramiXdataPtr[i].y;
- }
-
- result = ProcXvPutVideo(client);
- }
- }
- return result;
-}
-
-static int
-XineramaXvPutStill(ClientPtr client)
-{
- REQUEST(xvPutImageReq);
- PanoramiXRes *draw, *gc, *port;
- Bool isRoot;
- int result = Success, i, x, y;
-
- REQUEST_AT_LEAST_SIZE(xvPutImageReq);
-
- if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
-
- if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->gc, XRT_GC, SecurityReadAccess)))
- return BadGC;
-
- if(!(port = (PanoramiXRes *)SecurityLookupIDByType(
- client, stuff->port, XvXRTPort, SecurityReadAccess)))
- return _XvBadPort;
-
- isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
-
- x = stuff->drw_x;
- y = stuff->drw_y;
-
- FOR_NSCREENS_BACKWARD(i) {
- if(port->info[i].id) {
- stuff->drawable = draw->info[i].id;
- stuff->port = port->info[i].id;
- stuff->gc = gc->info[i].id;
- stuff->drw_x = x;
- stuff->drw_y = y;
- if(isRoot) {
- stuff->drw_x -= panoramiXdataPtr[i].x;
- stuff->drw_y -= panoramiXdataPtr[i].y;
- }
-
- result = ProcXvPutStill(client);
- }
- }
- return result;
-}
-
-
-void XineramifyXv(void)
-{
- ScreenPtr pScreen, screen0 = screenInfo.screens[0];
- XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr;
- XvAdaptorPtr refAdapt, pAdapt;
- XvAttributePtr pAttr;
- XvScreenPtr xvsp;
- Bool isOverlay, hasOverlay;
- PanoramiXRes *port;
- XvAdaptorPtr MatchingAdaptors[MAXSCREENS];
- int i, j, k, l;
-
- XvXRTPort = CreateNewResourceType(XineramaDeleteResource);
-
- if(!xvsp0) return;
-
- for(i = 0; i < xvsp0->nAdaptors; i++) {
- refAdapt = xvsp0->pAdaptors + i;
-
- bzero(MatchingAdaptors, sizeof(XvAdaptorPtr) * MAXSCREENS);
-
- MatchingAdaptors[0] = refAdapt;
-
- if(!(refAdapt->type & XvInputMask)) continue;
-
- isOverlay = FALSE;
- for(j = 0; j < refAdapt->nAttributes; j++) {
- pAttr = refAdapt->pAttributes + j;
- if(!strcmp(pAttr->name, "XV_COLORKEY")) {
- isOverlay = TRUE;
- break;
- }
- }
-
- for(j = 1; j < PanoramiXNumScreens; j++) {
- pScreen = screenInfo.screens[j];
- xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
-
- /* Do not try to go on if xv is not supported on this screen */
- if (xvsp==NULL) continue ;
-
- /* if the adaptor has the same name it's a perfect match */
- for(k = 0; k < xvsp->nAdaptors; k++) {
- pAdapt = xvsp->pAdaptors + k;
- if(!strcmp(refAdapt->name, pAdapt->name)) {
- MatchingAdaptors[j] = pAdapt;
- break;
- }
- }
- if(MatchingAdaptors[j]) continue; /* found it */
-
- /* otherwise we only look for XvImage adaptors */
- if(!(refAdapt->type & XvImageMask)) continue;
- if(refAdapt->nImages <= 0) continue;
-
- /* prefer overlay/overlay non-overlay/non-overlay pairing */
- for(k = 0; k < xvsp->nAdaptors; k++) {
- pAdapt = xvsp->pAdaptors + k;
- if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) {
- hasOverlay = FALSE;
- for(l = 0; l < pAdapt->nAttributes; l++) {
- if(!strcmp(pAdapt->name, "XV_COLORKEY")) {
- hasOverlay = TRUE;
- break;
- }
- }
- if(isOverlay && hasOverlay) {
- MatchingAdaptors[j] = pAdapt;
- break;
- }
- else if(!isOverlay && !hasOverlay) {
- MatchingAdaptors[j] = pAdapt;
- break;
- }
- }
- }
-
- if(MatchingAdaptors[j]) continue; /* found it */
-
- /* but we'll take any XvImage pairing if we can get it */
-
- for(k = 0; k < xvsp->nAdaptors; k++) {
- pAdapt = xvsp->pAdaptors + k;
- if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) {
- MatchingAdaptors[j] = pAdapt;
- break;
- }
- }
- }
-
- /* now create a resource for each port */
- for(j = 0; j < refAdapt->nPorts; j++) {
- if(!(port = xalloc(sizeof(PanoramiXRes))))
- break;
- port->info[0].id = MatchingAdaptors[0]->base_id + j;
- AddResource(port->info[0].id, XvXRTPort, port);
-
- for(k = 1; k < PanoramiXNumScreens; k++) {
- if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j))
- port->info[k].id = MatchingAdaptors[k]->base_id + j;
- else
- port->info[k].id = 0;
- }
- }
- }
-}
-
-#endif
diff --git a/Xext/xvdisp.h b/Xext/xvdisp.h
deleted file mode 100644
index 342a874e8..000000000
--- a/Xext/xvdisp.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvdisp.h,v 1.1 2003/07/16 01:38:31 dawes Exp $ */
-
-extern void XineramifyXv(void);
diff --git a/Xext/xvdix.h b/Xext/xvdix.h
deleted file mode 100644
index 8dafa8b26..000000000
--- a/Xext/xvdix.h
+++ /dev/null
@@ -1,291 +0,0 @@
-/***********************************************************
-Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.8 2001/07/25 15:05:00 dawes Exp $ */
-
-#ifndef XVDIX_H
-#define XVDIX_H
-/*
-** File:
-**
-** xvdix.h --- Xv device independent header file
-**
-** Author:
-**
-** David Carver (Digital Workstation Engineering/Project Athena)
-**
-** Revisions:
-**
-** 29.08.91 Carver
-** - removed UnrealizeWindow wrapper unrealizing windows no longer
-** preempts video
-**
-** 11.06.91 Carver
-** - changed SetPortControl to SetPortAttribute
-** - changed GetPortControl to GetPortAttribute
-** - changed QueryBestSize
-**
-** 15.05.91 Carver
-** - version 2.0 upgrade
-**
-** 24.01.91 Carver
-** - version 1.4 upgrade
-**
-*/
-
-#include "scrnintstr.h"
-#include "Xvproto.h"
-
-extern int XvScreenIndex;
-extern unsigned long XvExtensionGeneration;
-extern unsigned long XvScreenGeneration;
-extern unsigned long XvResourceGeneration;
-
-extern int XvReqCode;
-extern int XvEventBase;
-extern int XvErrorBase;
-
-extern unsigned long XvRTPort;
-extern unsigned long XvRTEncoding;
-extern unsigned long XvRTGrab;
-extern unsigned long XvRTVideoNotify;
-extern unsigned long XvRTVideoNotifyList;
-extern unsigned long XvRTPortNotify;
-
-typedef struct {
- int numerator;
- int denominator;
-} XvRationalRec, *XvRationalPtr;
-
-typedef struct {
- char depth;
- unsigned long visual;
-} XvFormatRec, *XvFormatPtr;
-
-typedef struct {
- unsigned long id;
- ClientPtr client;
-} XvGrabRec, *XvGrabPtr;
-
-typedef struct _XvVideoNotifyRec {
- struct _XvVideoNotifyRec *next;
- ClientPtr client;
- unsigned long id;
- unsigned long mask;
-} XvVideoNotifyRec, *XvVideoNotifyPtr;
-
-typedef struct _XvPortNotifyRec {
- struct _XvPortNotifyRec *next;
- ClientPtr client;
- unsigned long id;
-} XvPortNotifyRec, *XvPortNotifyPtr;
-
-typedef struct {
- int id;
- ScreenPtr pScreen;
- char *name;
- unsigned short width, height;
- XvRationalRec rate;
-} XvEncodingRec, *XvEncodingPtr;
-
-typedef struct _XvAttributeRec {
- int flags;
- int min_value;
- int max_value;
- char *name;
-} XvAttributeRec, *XvAttributePtr;
-
-typedef struct {
- int id;
- int type;
- int byte_order;
- char guid[16];
- int bits_per_pixel;
- int format;
- int num_planes;
-
- /* for RGB formats only */
- int depth;
- unsigned int red_mask;
- unsigned int green_mask;
- unsigned int blue_mask;
-
- /* for YUV formats only */
- unsigned int y_sample_bits;
- unsigned int u_sample_bits;
- unsigned int v_sample_bits;
- unsigned int horz_y_period;
- unsigned int horz_u_period;
- unsigned int horz_v_period;
- unsigned int vert_y_period;
- unsigned int vert_u_period;
- unsigned int vert_v_period;
- char component_order[32];
- int scanline_order;
-} XvImageRec, *XvImagePtr;
-
-typedef struct {
- unsigned long base_id;
- unsigned char type;
- char *name;
- int nEncodings;
- XvEncodingPtr pEncodings;
- int nFormats;
- XvFormatPtr pFormats;
- int nAttributes;
- XvAttributePtr pAttributes;
- int nImages;
- XvImagePtr pImages;
- int nPorts;
- struct _XvPortRec *pPorts;
- ScreenPtr pScreen;
- int (* ddAllocatePort)(unsigned long, struct _XvPortRec*,
- struct _XvPortRec**);
- int (* ddFreePort)(struct _XvPortRec*);
- int (* ddPutVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
- int (* ddPutStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
- int (* ddGetVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
- int (* ddGetStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
- int (* ddStopVideo)(ClientPtr, struct _XvPortRec*, DrawablePtr);
- int (* ddSetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32);
- int (* ddGetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32*);
- int (* ddQueryBestSize)(ClientPtr, struct _XvPortRec*, CARD8,
- CARD16, CARD16,CARD16, CARD16,
- unsigned int*, unsigned int*);
- int (* ddPutImage)(ClientPtr, DrawablePtr, struct _XvPortRec*, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16,
- XvImagePtr, unsigned char*, Bool,
- CARD16, CARD16);
- int (* ddQueryImageAttributes)(ClientPtr, struct _XvPortRec*, XvImagePtr,
- CARD16*, CARD16*, int*, int*);
- DevUnion devPriv;
-} XvAdaptorRec, *XvAdaptorPtr;
-
-typedef struct _XvPortRec {
- unsigned long id;
- XvAdaptorPtr pAdaptor;
- XvPortNotifyPtr pNotify;
- DrawablePtr pDraw;
- ClientPtr client;
- XvGrabRec grab;
- TimeStamp time;
- DevUnion devPriv;
-} XvPortRec, *XvPortPtr;
-
-#define LOOKUP_PORT(_id, client)\
- ((XvPortPtr)LookupIDByType(_id, XvRTPort))
-
-#define LOOKUP_ENCODING(_id, client)\
- ((XvEncodingPtr)LookupIDByType(_id, XvRTEncoding))
-
-#define LOOKUP_VIDEONOTIFY_LIST(_id, client)\
- ((XvVideoNotifyPtr)LookupIDByType(_id, XvRTVideoNotifyList))
-
-#define LOOKUP_PORTNOTIFY_LIST(_id, client)\
- ((XvPortNotifyPtr)LookupIDByType(_id, XvRTPortNotifyList))
-
-typedef struct {
- int version, revision;
- int nAdaptors;
- XvAdaptorPtr pAdaptors;
- DestroyWindowProcPtr DestroyWindow;
- DestroyPixmapProcPtr DestroyPixmap;
- CloseScreenProcPtr CloseScreen;
- Bool (* ddCloseScreen)(int, ScreenPtr);
- int (* ddQueryAdaptors)(ScreenPtr, XvAdaptorPtr*, int*);
- DevUnion devPriv;
-} XvScreenRec, *XvScreenPtr;
-
-#define SCREEN_PROLOGUE(pScreen, field)\
- ((pScreen)->field = \
- ((XvScreenPtr) \
- (pScreen)->devPrivates[XvScreenIndex].ptr)->field)
-
-#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
-
-/* Errors */
-
-#define _XvBadPort (XvBadPort+XvErrorBase)
-#define _XvBadEncoding (XvBadEncoding+XvErrorBase)
-
-extern int ProcXvDispatch(ClientPtr);
-extern int SProcXvDispatch(ClientPtr);
-
-extern void XvExtensionInit(void);
-extern int XvScreenInit(ScreenPtr);
-extern int XvGetScreenIndex(void);
-extern unsigned long XvGetRTPort(void);
-extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
-extern int XvdiVideoStopped(XvPortPtr, int);
-
-extern int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-extern int XvdiPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-extern int XvdiGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-extern int XvdiGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-extern int XvdiPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16,
- XvImagePtr, unsigned char*, Bool,
- CARD16, CARD16);
-extern int XvdiSelectVideoNotify(ClientPtr, DrawablePtr, BOOL);
-extern int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL);
-extern int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
-extern int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
-extern int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
-extern int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr);
-extern int XvdiMatchPort(XvPortPtr, DrawablePtr);
-extern int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
-extern int XvdiUngrabPort( ClientPtr, XvPortPtr, Time);
-
-
-#if !defined(UNIXCPP)
-
-#define XVCALL(name) Xv##name
-
-#else
-
-#define XVCALL(name) Xv/**/name
-
-#endif
-
-
-#endif /* XVDIX_H */
-
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
deleted file mode 100644
index 2c3f484bd..000000000
--- a/Xext/xvmain.c
+++ /dev/null
@@ -1,1198 +0,0 @@
-/***********************************************************
-Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.16 2003/10/28 23:08:44 tsi Exp $ */
-
-/*
-** File:
-**
-** xvmain.c --- Xv server extension main device independent module.
-**
-** Author:
-**
-** David Carver (Digital Workstation Engineering/Project Athena)
-**
-** Revisions:
-**
-** 04.09.91 Carver
-** - change: stop video always generates an event even when video
-** wasn't active
-**
-** 29.08.91 Carver
-** - change: unrealizing windows no longer preempts video
-**
-** 11.06.91 Carver
-** - changed SetPortControl to SetPortAttribute
-** - changed GetPortControl to GetPortAttribute
-** - changed QueryBestSize
-**
-** 28.05.91 Carver
-** - fixed Put and Get requests to not preempt operations to same drawable
-**
-** 15.05.91 Carver
-** - version 2.0 upgrade
-**
-** 19.03.91 Carver
-** - fixed Put and Get requests to honor grabbed ports.
-** - fixed Video requests to update di structure with new drawable, and
-** client after calling ddx.
-**
-** 24.01.91 Carver
-** - version 1.4 upgrade
-**
-** Notes:
-**
-** Port structures reference client structures in a two different
-** ways: when grabs, or video is active. Each reference is encoded
-** as fake client resources and thus when the client is goes away so
-** does the reference (it is zeroed). No other action is taken, so
-** video doesn't necessarily stop. It probably will as a result of
-** other resources going away, but if a client starts video using
-** none of its own resources, then the video will continue to play
-** after the client disappears.
-**
-**
-*/
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "gc.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "input.h"
-
-#define GLOBAL
-
-#include "Xv.h"
-#include "Xvproto.h"
-#include "xvdix.h"
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#include "xvdisp.h"
-#endif
-
-int XvScreenIndex = -1;
-unsigned long XvExtensionGeneration = 0;
-unsigned long XvScreenGeneration = 0;
-unsigned long XvResourceGeneration = 0;
-
-int XvReqCode;
-int XvEventBase;
-int XvErrorBase;
-
-unsigned long XvRTPort;
-unsigned long XvRTEncoding;
-unsigned long XvRTGrab;
-unsigned long XvRTVideoNotify;
-unsigned long XvRTVideoNotifyList;
-unsigned long XvRTPortNotify;
-
-
-
-/* EXTERNAL */
-
-extern XID clientErrorValue;
-
-static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
-static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
-static Bool CreateResourceTypes(void);
-
-static Bool XvCloseScreen(int, ScreenPtr);
-static Bool XvDestroyPixmap(PixmapPtr);
-static Bool XvDestroyWindow(WindowPtr);
-static void XvResetProc(ExtensionEntry*);
-static int XvdiDestroyGrab(pointer, XID);
-static int XvdiDestroyEncoding(pointer, XID);
-static int XvdiDestroyVideoNotify(pointer, XID);
-static int XvdiDestroyPortNotify(pointer, XID);
-static int XvdiDestroyVideoNotifyList(pointer, XID);
-static int XvdiDestroyPort(pointer, XID);
-static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
-
-
-
-
-/*
-** XvExtensionInit
-**
-**
-*/
-
-void
-XvExtensionInit()
-{
- ExtensionEntry *extEntry;
-
- /* LOOK TO SEE IF ANY SCREENS WERE INITIALIZED; IF NOT THEN
- INIT GLOBAL VARIABLES SO THE EXTENSION CAN FUNCTION */
- if (XvScreenGeneration != serverGeneration)
- {
- if (!CreateResourceTypes())
- {
- ErrorF("XvExtensionInit: Unable to allocate resource types\n");
- return;
- }
- XvScreenIndex = AllocateScreenPrivateIndex ();
- if (XvScreenIndex < 0)
- {
- ErrorF("XvExtensionInit: Unable to allocate screen private index\n");
- return;
- }
-#ifdef PANORAMIX
- XineramaRegisterConnectionBlockCallback(XineramifyXv);
-#endif
- XvScreenGeneration = serverGeneration;
- }
-
- if (XvExtensionGeneration != serverGeneration)
- {
- XvExtensionGeneration = serverGeneration;
-
- extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
- ProcXvDispatch, SProcXvDispatch,
- XvResetProc, StandardMinorOpcode);
- if (!extEntry)
- {
- FatalError("XvExtensionInit: AddExtensions failed\n");
- }
-
- XvReqCode = extEntry->base;
- XvEventBase = extEntry->eventBase;
- XvErrorBase = extEntry->errorBase;
-
- EventSwapVector[XvEventBase+XvVideoNotify] =
- (EventSwapPtr)WriteSwappedVideoNotifyEvent;
- EventSwapVector[XvEventBase+XvPortNotify] =
- (EventSwapPtr)WriteSwappedPortNotifyEvent;
-
- (void)MakeAtom(XvName, strlen(XvName), xTrue);
-
- }
-}
-
-static Bool
-CreateResourceTypes()
-
-{
-
- if (XvResourceGeneration == serverGeneration) return TRUE;
-
- XvResourceGeneration = serverGeneration;
-
- if (!(XvRTPort = CreateNewResourceType(XvdiDestroyPort)))
- {
- ErrorF("CreateResourceTypes: failed to allocate port resource.\n");
- return FALSE;
- }
-
- if (!(XvRTGrab = CreateNewResourceType(XvdiDestroyGrab)))
- {
- ErrorF("CreateResourceTypes: failed to allocate grab resource.\n");
- return FALSE;
- }
-
- if (!(XvRTEncoding = CreateNewResourceType(XvdiDestroyEncoding)))
- {
- ErrorF("CreateResourceTypes: failed to allocate encoding resource.\n");
- return FALSE;
- }
-
- if (!(XvRTVideoNotify = CreateNewResourceType(XvdiDestroyVideoNotify)))
- {
- ErrorF("CreateResourceTypes: failed to allocate video notify resource.\n");
- return FALSE;
- }
-
- if (!(XvRTVideoNotifyList = CreateNewResourceType(XvdiDestroyVideoNotifyList)))
- {
- ErrorF("CreateResourceTypes: failed to allocate video notify list resource.\n");
- return FALSE;
- }
-
- if (!(XvRTPortNotify = CreateNewResourceType(XvdiDestroyPortNotify)))
- {
- ErrorF("CreateResourceTypes: failed to allocate port notify resource.\n");
- return FALSE;
- }
-
- return TRUE;
-
-}
-
-int
-XvScreenInit(ScreenPtr pScreen)
-{
- XvScreenPtr pxvs;
-
- if (XvScreenGeneration != serverGeneration)
- {
- if (!CreateResourceTypes())
- {
- ErrorF("XvScreenInit: Unable to allocate resource types\n");
- return BadAlloc;
- }
- XvScreenIndex = AllocateScreenPrivateIndex ();
- if (XvScreenIndex < 0)
- {
- ErrorF("XvScreenInit: Unable to allocate screen private index\n");
- return BadAlloc;
- }
-#ifdef PANORAMIX
- XineramaRegisterConnectionBlockCallback(XineramifyXv);
-#endif
- XvScreenGeneration = serverGeneration;
- }
-
- if (pScreen->devPrivates[XvScreenIndex].ptr)
- {
- ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
- }
-
- /* ALLOCATE SCREEN PRIVATE RECORD */
-
- pxvs = (XvScreenPtr) xalloc (sizeof (XvScreenRec));
- if (!pxvs)
- {
- ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
- return BadAlloc;
- }
-
- pScreen->devPrivates[XvScreenIndex].ptr = (pointer)pxvs;
-
-
- pxvs->DestroyPixmap = pScreen->DestroyPixmap;
- pxvs->DestroyWindow = pScreen->DestroyWindow;
- pxvs->CloseScreen = pScreen->CloseScreen;
-
- pScreen->DestroyPixmap = XvDestroyPixmap;
- pScreen->DestroyWindow = XvDestroyWindow;
- pScreen->CloseScreen = XvCloseScreen;
-
- return Success;
-}
-
-static Bool
-XvCloseScreen(
- int ii,
- ScreenPtr pScreen
-){
-
- XvScreenPtr pxvs;
-
- pxvs = (XvScreenPtr) pScreen->devPrivates[XvScreenIndex].ptr;
-
- pScreen->DestroyPixmap = pxvs->DestroyPixmap;
- pScreen->DestroyWindow = pxvs->DestroyWindow;
- pScreen->CloseScreen = pxvs->CloseScreen;
-
- (* pxvs->ddCloseScreen)(ii, pScreen);
-
- xfree(pxvs);
-
- pScreen->devPrivates[XvScreenIndex].ptr = (pointer)NULL;
-
- return (*pScreen->CloseScreen)(ii, pScreen);
-
-}
-
-static void
-XvResetProc(ExtensionEntry* extEntry)
-{
-}
-
-int
-XvGetScreenIndex()
-{
- return XvScreenIndex;
-}
-
-unsigned long
-XvGetRTPort()
-{
- return XvRTPort;
-}
-
-static Bool
-XvDestroyPixmap(PixmapPtr pPix)
-{
- Bool status;
- ScreenPtr pScreen;
- XvScreenPtr pxvs;
- XvAdaptorPtr pa;
- int na;
- XvPortPtr pp;
- int np;
-
- pScreen = pPix->drawable.pScreen;
-
- SCREEN_PROLOGUE(pScreen, DestroyPixmap);
-
- pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
-
- /* CHECK TO SEE IF THIS PORT IS IN USE */
-
- pa = pxvs->pAdaptors;
- na = pxvs->nAdaptors;
- while (na--)
- {
- np = pa->nPorts;
- pp = pa->pPorts;
-
- while (np--)
- {
- if (pp->pDraw == (DrawablePtr)pPix)
- {
- XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
-
- (void)(* pp->pAdaptor->ddStopVideo)((ClientPtr)NULL, pp,
- pp->pDraw);
-
- pp->pDraw = (DrawablePtr)NULL;
- pp->client = (ClientPtr)NULL;
- pp->time = currentTime;
- }
- pp++;
- }
- pa++;
- }
-
- status = (* pScreen->DestroyPixmap)(pPix);
-
- SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
-
- return status;
-
-}
-
-static Bool
-XvDestroyWindow(WindowPtr pWin)
-{
- Bool status;
- ScreenPtr pScreen;
- XvScreenPtr pxvs;
- XvAdaptorPtr pa;
- int na;
- XvPortPtr pp;
- int np;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE(pScreen, DestroyWindow);
-
- pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
-
- /* CHECK TO SEE IF THIS PORT IS IN USE */
-
- pa = pxvs->pAdaptors;
- na = pxvs->nAdaptors;
- while (na--)
- {
- np = pa->nPorts;
- pp = pa->pPorts;
-
- while (np--)
- {
- if (pp->pDraw == (DrawablePtr)pWin)
- {
- XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
-
- (void)(* pp->pAdaptor->ddStopVideo)((ClientPtr)NULL, pp,
- pp->pDraw);
-
- pp->pDraw = (DrawablePtr)NULL;
- pp->client = (ClientPtr)NULL;
- pp->time = currentTime;
- }
- pp++;
- }
- pa++;
- }
-
-
- status = (* pScreen->DestroyWindow)(pWin);
-
- SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
-
- return status;
-
-}
-
-/* The XvdiVideoStopped procedure is a hook for the device dependent layer.
- It provides a way for the dd layer to inform the di layer that video has
- stopped in a port for reasons that the di layer had no control over; note
- that it doesn't call back into the dd layer */
-
-int
-XvdiVideoStopped(XvPortPtr pPort, int reason)
-{
-
- /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
-
- if (!pPort->pDraw) return Success;
-
- XvdiSendVideoNotify(pPort, pPort->pDraw, reason);
-
- pPort->pDraw = (DrawablePtr)NULL;
- pPort->client = (ClientPtr)NULL;
- pPort->time = currentTime;
-
- return Success;
-
-}
-
-static int
-XvdiDestroyPort(pointer pPort, XID id)
-{
- return (* ((XvPortPtr)pPort)->pAdaptor->ddFreePort)(pPort);
-}
-
-static int
-XvdiDestroyGrab(pointer pGrab, XID id)
-{
- ((XvGrabPtr)pGrab)->client = (ClientPtr)NULL;
- return Success;
-}
-
-static int
-XvdiDestroyVideoNotify(pointer pn, XID id)
-{
- /* JUST CLEAR OUT THE client POINTER FIELD */
-
- ((XvVideoNotifyPtr)pn)->client = (ClientPtr)NULL;
- return Success;
-}
-
-static int
-XvdiDestroyPortNotify(pointer pn, XID id)
-{
- /* JUST CLEAR OUT THE client POINTER FIELD */
-
- ((XvPortNotifyPtr)pn)->client = (ClientPtr)NULL;
- return Success;
-}
-
-static int
-XvdiDestroyVideoNotifyList(pointer pn, XID id)
-{
- XvVideoNotifyPtr npn,cpn;
-
- /* ACTUALLY DESTROY THE NOTITY LIST */
-
- cpn = (XvVideoNotifyPtr)pn;
-
- while (cpn)
- {
- npn = cpn->next;
- if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify);
- xfree(cpn);
- cpn = npn;
- }
- return Success;
-}
-
-static int
-XvdiDestroyEncoding(pointer value, XID id)
-{
- return Success;
-}
-
-static int
-XvdiSendVideoNotify(pPort, pDraw, reason)
-
-XvPortPtr pPort;
-DrawablePtr pDraw;
-int reason;
-
-{
- xvEvent event;
- XvVideoNotifyPtr pn;
-
- pn = (XvVideoNotifyPtr)LookupIDByType(pDraw->id, XvRTVideoNotifyList);
-
- while (pn)
- {
- if (pn->client)
- {
- event.u.u.type = XvEventBase + XvVideoNotify;
- event.u.u.sequenceNumber = pn->client->sequence;
- event.u.videoNotify.time = currentTime.milliseconds;
- event.u.videoNotify.drawable = pDraw->id;
- event.u.videoNotify.port = pPort->id;
- event.u.videoNotify.reason = reason;
- (void) TryClientEvents(pn->client, (xEventPtr)&event, 1, NoEventMask,
- NoEventMask, NullGrab);
- }
- pn = pn->next;
- }
-
- return Success;
-
-}
-
-
-int
-XvdiSendPortNotify(
- XvPortPtr pPort,
- Atom attribute,
- INT32 value
-){
- xvEvent event;
- XvPortNotifyPtr pn;
-
- pn = pPort->pNotify;
-
- while (pn)
- {
- if (pn->client)
- {
- event.u.u.type = XvEventBase + XvPortNotify;
- event.u.u.sequenceNumber = pn->client->sequence;
- event.u.portNotify.time = currentTime.milliseconds;
- event.u.portNotify.port = pPort->id;
- event.u.portNotify.attribute = attribute;
- event.u.portNotify.value = value;
- (void) TryClientEvents(pn->client, (xEventPtr)&event, 1, NoEventMask,
- NoEventMask, NullGrab);
- }
- pn = pn->next;
- }
-
- return Success;
-
-}
-
-
-#define CHECK_SIZE(dw, dh, sw, sh) { \
- if(!dw || !dh || !sw || !sh) return Success; \
- /* The region code will break these if they are too large */ \
- if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \
- return BadValue; \
-}
-
-
-int
-XvdiPutVideo(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- DrawablePtr pOldDraw;
-
- CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
-
- /* UPDATE TIME VARIABLES FOR USE IN EVENTS */
-
- UpdateCurrentTime();
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if (pPort->grab.client && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- /* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED
- EVENTS TO ANY CLIENTS WHO WANT THEM */
-
- pOldDraw = pPort->pDraw;
- if ((pOldDraw) && (pOldDraw != pDraw))
- {
- XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
- }
-
- (void) (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC,
- vid_x, vid_y, vid_w, vid_h,
- drw_x, drw_y, drw_w, drw_h);
-
- if ((pPort->pDraw) && (pOldDraw != pDraw))
- {
- pPort->client = client;
- XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted);
- }
-
- pPort->time = currentTime;
-
- return (Success);
-
-}
-
-int
-XvdiPutStill(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- int status;
-
- CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
-
- /* UPDATE TIME VARIABLES FOR USE IN EVENTS */
-
- UpdateCurrentTime();
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if (pPort->grab.client && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- pPort->time = currentTime;
-
- status = (* pPort->pAdaptor->ddPutStill)(client, pDraw, pPort, pGC,
- vid_x, vid_y, vid_w, vid_h,
- drw_x, drw_y, drw_w, drw_h);
-
- return status;
-
-}
-
-int
-XvdiPutImage(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 src_x, INT16 src_y,
- CARD16 src_w, CARD16 src_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h,
- XvImagePtr image,
- unsigned char* data,
- Bool sync,
- CARD16 width, CARD16 height
-){
- CHECK_SIZE(drw_w, drw_h, src_w, src_h);
-
- /* UPDATE TIME VARIABLES FOR USE IN EVENTS */
-
- UpdateCurrentTime();
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if (pPort->grab.client && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- pPort->time = currentTime;
-
- return (* pPort->pAdaptor->ddPutImage)(client, pDraw, pPort, pGC,
- src_x, src_y, src_w, src_h,
- drw_x, drw_y, drw_w, drw_h,
- image, data, sync, width, height);
-}
-
-
-int
-XvdiGetVideo(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- DrawablePtr pOldDraw;
-
- CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
-
- /* UPDATE TIME VARIABLES FOR USE IN EVENTS */
-
- UpdateCurrentTime();
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if (pPort->grab.client && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- /* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED
- EVENTS TO ANY CLIENTS WHO WANT THEM */
-
- pOldDraw = pPort->pDraw;
- if ((pOldDraw) && (pOldDraw != pDraw))
- {
- XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
- }
-
- (void) (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC,
- vid_x, vid_y, vid_w, vid_h,
- drw_x, drw_y, drw_w, drw_h);
-
- if ((pPort->pDraw) && (pOldDraw != pDraw))
- {
- pPort->client = client;
- XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted);
- }
-
- pPort->time = currentTime;
-
- return (Success);
-
-}
-
-int
-XvdiGetStill(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- int status;
-
- CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
-
- /* UPDATE TIME VARIABLES FOR USE IN EVENTS */
-
- UpdateCurrentTime();
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if (pPort->grab.client && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- status = (* pPort->pAdaptor->ddGetStill)(client, pDraw, pPort, pGC,
- vid_x, vid_y, vid_w, vid_h,
- drw_x, drw_y, drw_w, drw_h);
-
- pPort->time = currentTime;
-
- return status;
-
-}
-
-int
-XvdiGrabPort(
- ClientPtr client,
- XvPortPtr pPort,
- Time ctime,
- int *p_result
-){
- unsigned long id;
- TimeStamp time;
-
- UpdateCurrentTime();
- time = ClientTimeToServerTime(ctime);
-
- if (pPort->grab.client && (client != pPort->grab.client))
- {
- *p_result = XvAlreadyGrabbed;
- return Success;
- }
-
- if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, pPort->time) == EARLIER))
- {
- *p_result = XvInvalidTime;
- return Success;
- }
-
- if (client == pPort->grab.client)
- {
- *p_result = Success;
- return Success;
- }
-
- id = FakeClientID(client->index);
-
- if (!AddResource(id, XvRTGrab, &pPort->grab))
- {
- return BadAlloc;
- }
-
- /* IF THERE IS ACTIVE VIDEO THEN STOP IT */
-
- if ((pPort->pDraw) && (client != pPort->client))
- {
- XVCALL(diStopVideo)((ClientPtr)NULL, pPort, pPort->pDraw);
- }
-
- pPort->grab.client = client;
- pPort->grab.id = id;
-
- pPort->time = currentTime;
-
- *p_result = Success;
-
- return Success;
-
-}
-
-int
-XvdiUngrabPort(
- ClientPtr client,
- XvPortPtr pPort,
- Time ctime
-){
- TimeStamp time;
-
- UpdateCurrentTime();
- time = ClientTimeToServerTime(ctime);
-
- if ((!pPort->grab.client) || (client != pPort->grab.client))
- {
- return Success;
- }
-
- if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, pPort->time) == EARLIER))
- {
- return Success;
- }
-
- /* FREE THE GRAB RESOURCE; AND SET THE GRAB CLIENT TO NULL */
-
- FreeResource(pPort->grab.id, XvRTGrab);
- pPort->grab.client = (ClientPtr)NULL;
-
- pPort->time = currentTime;
-
- return Success;
-
-}
-
-
-int
-XvdiSelectVideoNotify(
- ClientPtr client,
- DrawablePtr pDraw,
- BOOL onoff
-){
- XvVideoNotifyPtr pn,tpn,fpn;
-
- /* FIND VideoNotify LIST */
-
- pn = (XvVideoNotifyPtr)LookupIDByType(pDraw->id, XvRTVideoNotifyList);
-
- /* IF ONE DONES'T EXIST AND NO MASK, THEN JUST RETURN */
-
- if (!onoff && !pn) return Success;
-
- /* IF ONE DOESN'T EXIST CREATE IT AND ADD A RESOURCE SO THAT THE LIST
- WILL BE DELETED WHEN THE DRAWABLE IS DESTROYED */
-
- if (!pn)
- {
- if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
- return BadAlloc;
- tpn->next = (XvVideoNotifyPtr)NULL;
- if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
- {
- xfree(tpn);
- return BadAlloc;
- }
- }
- else
- {
- /* LOOK TO SEE IF ENTRY ALREADY EXISTS */
-
- fpn = (XvVideoNotifyPtr)NULL;
- tpn = pn;
- while (tpn)
- {
- if (tpn->client == client)
- {
- if (!onoff) tpn->client = (ClientPtr)NULL;
- return Success;
- }
- if (!tpn->client) fpn = tpn; /* TAKE NOTE OF FREE ENTRY */
- tpn = tpn->next;
- }
-
- /* IF TUNNING OFF, THEN JUST RETURN */
-
- if (!onoff) return Success;
-
- /* IF ONE ISN'T FOUND THEN ALLOCATE ONE AND LINK IT INTO THE LIST */
-
- if (fpn)
- {
- tpn = fpn;
- }
- else
- {
- if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
- return BadAlloc;
- tpn->next = pn->next;
- pn->next = tpn;
- }
- }
-
- /* INIT CLIENT PTR IN CASE WE CAN'T ADD RESOURCE */
- /* ADD RESOURCE SO THAT IF CLIENT EXITS THE CLIENT PTR WILL BE CLEARED */
-
- tpn->client = (ClientPtr)NULL;
- tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTVideoNotify, tpn);
-
- tpn->client = client;
- return Success;
-
-}
-
-int
-XvdiSelectPortNotify(
- ClientPtr client,
- XvPortPtr pPort,
- BOOL onoff
-){
- XvPortNotifyPtr pn,tpn;
-
- /* SEE IF CLIENT IS ALREADY IN LIST */
-
- tpn = (XvPortNotifyPtr)NULL;
- pn = pPort->pNotify;
- while (pn)
- {
- if (!pn->client) tpn = pn; /* TAKE NOTE OF FREE ENTRY */
- if (pn->client == client) break;
- pn = pn->next;
- }
-
- /* IS THE CLIENT ALREADY ON THE LIST? */
-
- if (pn)
- {
- /* REMOVE IT? */
-
- if (!onoff)
- {
- pn->client = (ClientPtr)NULL;
- FreeResource(pn->id, XvRTPortNotify);
- }
-
- return Success;
- }
-
- /* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE
- CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */
-
- if (!tpn)
- {
- if (!(tpn = (XvPortNotifyPtr)xalloc(sizeof(XvPortNotifyRec))))
- return BadAlloc;
- tpn->next = pPort->pNotify;
- pPort->pNotify = tpn;
- }
-
- tpn->client = client;
- tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTPortNotify, tpn);
-
- return Success;
-
-}
-
-int
-XvdiStopVideo(
- ClientPtr client,
- XvPortPtr pPort,
- DrawablePtr pDraw
-){
- int status;
-
- /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
-
- if (!pPort->pDraw || (pPort->pDraw != pDraw))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvStopped);
- return Success;
- }
-
- /* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
- INFORM CLIENT OF ITS FAILURE */
-
- if ((client) && (pPort->grab.client) && (pPort->grab.client != client))
- {
- XvdiSendVideoNotify(pPort, pDraw, XvBusy);
- return Success;
- }
-
- XvdiSendVideoNotify(pPort, pDraw, XvStopped);
-
- status = (* pPort->pAdaptor->ddStopVideo)(client, pPort, pDraw);
-
- pPort->pDraw = (DrawablePtr)NULL;
- pPort->client = (ClientPtr)client;
- pPort->time = currentTime;
-
- return status;
-
-}
-
-int
-XvdiPreemptVideo(
- ClientPtr client,
- XvPortPtr pPort,
- DrawablePtr pDraw
-){
- int status;
-
- /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
-
- if (!pPort->pDraw || (pPort->pDraw != pDraw)) return Success;
-
- XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
-
- status = (* pPort->pAdaptor->ddStopVideo)(client, pPort, pPort->pDraw);
-
- pPort->pDraw = (DrawablePtr)NULL;
- pPort->client = (ClientPtr)client;
- pPort->time = currentTime;
-
- return status;
-
-}
-
-int
-XvdiMatchPort(
- XvPortPtr pPort,
- DrawablePtr pDraw
-){
-
- XvAdaptorPtr pa;
- XvFormatPtr pf;
- int nf;
-
- pa = pPort->pAdaptor;
-
- if (pa->pScreen != pDraw->pScreen) return BadMatch;
-
- nf = pa->nFormats;
- pf = pa->pFormats;
-
- while (nf--)
- {
- if ((pf->depth == pDraw->depth)
-#if 0
- && ((pDraw->type == DRAWABLE_PIXMAP) ||
- (wVisual(((WindowPtr)pDraw)) == pf->visual))
-#endif
- )
- return Success;
- pf++;
- }
-
- return BadMatch;
-
-}
-
-int
-XvdiSetPortAttribute(
- ClientPtr client,
- XvPortPtr pPort,
- Atom attribute,
- INT32 value
-){
-
- XvdiSendPortNotify(pPort, attribute, value);
-
- return
- (* pPort->pAdaptor->ddSetPortAttribute)(client, pPort, attribute, value);
-
-}
-
-int
-XvdiGetPortAttribute(
- ClientPtr client,
- XvPortPtr pPort,
- Atom attribute,
- INT32 *p_value
-){
-
- return
- (* pPort->pAdaptor->ddGetPortAttribute)(client, pPort, attribute, p_value);
-
-}
-
-static void
-WriteSwappedVideoNotifyEvent(xvEvent *from, xvEvent *to)
-
-{
-
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.videoNotify.sequenceNumber,
- to->u.videoNotify.sequenceNumber);
- cpswapl(from->u.videoNotify.time, to->u.videoNotify.time);
- cpswapl(from->u.videoNotify.drawable, to->u.videoNotify.drawable);
- cpswapl(from->u.videoNotify.port, to->u.videoNotify.port);
-
-}
-
-static void
-WriteSwappedPortNotifyEvent(xvEvent *from, xvEvent *to)
-
-{
-
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.portNotify.sequenceNumber, to->u.portNotify.sequenceNumber);
- cpswapl(from->u.portNotify.time, to->u.portNotify.time);
- cpswapl(from->u.portNotify.port, to->u.portNotify.port);
- cpswapl(from->u.portNotify.value, to->u.portNotify.value);
-
-}
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
deleted file mode 100644
index cb6c06301..000000000
--- a/Xext/xvmc.c
+++ /dev/null
@@ -1,674 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.9 2003/07/17 16:04:33 dawes Exp $ */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "extnsionst.h"
-#include "servermd.h"
-#include "Xfuncproto.h"
-#include "xvdix.h"
-#include "XvMC.h"
-#include "Xvproto.h"
-#include "XvMCproto.h"
-#include "xvmcext.h"
-
-int XvMCScreenIndex = -1;
-
-unsigned long XvMCGeneration = 0;
-
-int XvMCReqCode;
-int XvMCEventBase;
-int XvMCErrorBase;
-
-unsigned long XvMCRTContext;
-unsigned long XvMCRTSurface;
-unsigned long XvMCRTSubpicture;
-
-typedef struct {
- int num_adaptors;
- XvMCAdaptorPtr adaptors;
- CloseScreenProcPtr CloseScreen;
-} XvMCScreenRec, *XvMCScreenPtr;
-
-#define XVMC_GET_PRIVATE(pScreen) \
- (XvMCScreenPtr)((pScreen)->devPrivates[XvMCScreenIndex].ptr)
-
-
-static int
-XvMCDestroyContextRes(pointer data, XID id)
-{
- XvMCContextPtr pContext = (XvMCContextPtr)data;
-
- pContext->refcnt--;
-
- if(!pContext->refcnt) {
- XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
- (*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext);
- xfree(pContext);
- }
-
- return Success;
-}
-
-static int
-XvMCDestroySurfaceRes(pointer data, XID id)
-{
- XvMCSurfacePtr pSurface = (XvMCSurfacePtr)data;
- XvMCContextPtr pContext = pSurface->context;
- XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
-
- (*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface);
- xfree(pSurface);
-
- XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
-
- return Success;
-}
-
-
-static int
-XvMCDestroySubpictureRes(pointer data, XID id)
-{
- XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr)data;
- XvMCContextPtr pContext = pSubpict->context;
- XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
-
- (*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict);
- xfree(pSubpict);
-
- XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
-
- return Success;
-}
-
-static void
-XvMCResetProc (ExtensionEntry *extEntry)
-{
-}
-
-
-static int
-ProcXvMCQueryVersion(ClientPtr client)
-{
- xvmcQueryVersionReply rep;
- /* REQUEST(xvmcQueryVersionReq); */
- REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.major = XvMCVersion;
- rep.minor = XvMCRevision;
- WriteToClient(client, sizeof(xvmcQueryVersionReply), (char*)&rep);
- return Success;
-}
-
-
-static int
-ProcXvMCListSurfaceTypes(ClientPtr client)
-{
- XvPortPtr pPort;
- int i;
- XvMCScreenPtr pScreenPriv;
- xvmcListSurfaceTypesReply rep;
- xvmcSurfaceInfo info;
- XvMCAdaptorPtr adaptor = NULL;
- XvMCSurfaceInfoPtr surface;
- REQUEST(xvmcListSurfaceTypesReq);
- REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
- client->errorValue = stuff->port;
- return _XvBadPort;
- }
-
- if(XvMCScreenIndex >= 0) { /* any adaptors at all */
- ScreenPtr pScreen = pPort->pAdaptor->pScreen;
- if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
- for(i = 0; i < pScreenPriv->num_adaptors; i++) {
- if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
- adaptor = &(pScreenPriv->adaptors[i]);
- break;
- }
- }
- }
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num = (adaptor) ? adaptor->num_surfaces : 0;
- rep.length = rep.num * sizeof(xvmcSurfaceInfo) >> 2;
-
- WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep);
-
- for(i = 0; i < rep.num; i++) {
- surface = adaptor->surfaces[i];
- info.surface_type_id = surface->surface_type_id;
- info.chroma_format = surface->chroma_format;
- info.max_width = surface->max_width;
- info.max_height = surface->max_height;
- info.subpicture_max_width = surface->subpicture_max_width;
- info.subpicture_max_height = surface->subpicture_max_height;
- info.mc_type = surface->mc_type;
- info.flags = surface->flags;
- WriteToClient(client, sizeof(xvmcSurfaceInfo), (char*)&info);
- }
-
- return Success;
-}
-
-static int
-ProcXvMCCreateContext(ClientPtr client)
-{
- XvPortPtr pPort;
- CARD32 *data = NULL;
- int dwords = 0;
- int i, result, adapt_num = -1;
- ScreenPtr pScreen;
- XvMCContextPtr pContext;
- XvMCScreenPtr pScreenPriv;
- XvMCAdaptorPtr adaptor = NULL;
- XvMCSurfaceInfoPtr surface = NULL;
- xvmcCreateContextReply rep;
- REQUEST(xvmcCreateContextReq);
- REQUEST_SIZE_MATCH(xvmcCreateContextReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
- client->errorValue = stuff->port;
- return _XvBadPort;
- }
-
- pScreen = pPort->pAdaptor->pScreen;
-
- if(XvMCScreenIndex < 0) /* no XvMC adaptors */
- return BadMatch;
-
- if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
- return BadMatch;
-
- for(i = 0; i < pScreenPriv->num_adaptors; i++) {
- if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
- adaptor = &(pScreenPriv->adaptors[i]);
- adapt_num = i;
- break;
- }
- }
-
- if(adapt_num < 0) /* none this port */
- return BadMatch;
-
- for(i = 0; i < adaptor->num_surfaces; i++) {
- if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
- surface = adaptor->surfaces[i];
- break;
- }
- }
-
- /* adaptor doesn't support this suface_type_id */
- if(!surface) return BadMatch;
-
-
- if((stuff->width > surface->max_width) ||
- (stuff->height > surface->max_height))
- return BadValue;
-
- if(!(pContext = xalloc(sizeof(XvMCContextRec)))) {
- return BadAlloc;
- }
-
-
- pContext->pScreen = pScreen;
- pContext->adapt_num = adapt_num;
- pContext->context_id = stuff->context_id;
- pContext->surface_type_id = stuff->surface_type_id;
- pContext->width = stuff->width;
- pContext->height = stuff->height;
- pContext->flags = stuff->flags;
- pContext->refcnt = 1;
-
- result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data);
-
- if(result != Success) {
- xfree(pContext);
- return result;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.width_actual = pContext->width;
- rep.height_actual = pContext->height;
- rep.flags_return = pContext->flags;
- rep.length = dwords;
-
- WriteToClient(client, sizeof(xvmcCreateContextReply), (char*)&rep);
- if(dwords)
- WriteToClient(client, dwords << 2, (char*)data);
- AddResource(pContext->context_id, XvMCRTContext, pContext);
-
- if(data)
- xfree(data);
-
- return Success;
-}
-
-static int
-ProcXvMCDestroyContext(ClientPtr client)
-{
- REQUEST(xvmcDestroyContextReq);
- REQUEST_SIZE_MATCH(xvmcDestroyContextReq);
-
- if(!LookupIDByType(stuff->context_id, XvMCRTContext))
- return (XvMCBadContext + XvMCErrorBase);
-
- FreeResource(stuff->context_id, RT_NONE);
-
- return Success;
-}
-
-static int
-ProcXvMCCreateSurface(ClientPtr client)
-{
- CARD32 *data = NULL;
- int dwords = 0;
- int result;
- XvMCContextPtr pContext;
- XvMCSurfacePtr pSurface;
- XvMCScreenPtr pScreenPriv;
- xvmcCreateSurfaceReply rep;
- REQUEST(xvmcCreateSurfaceReq);
- REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq);
-
- if(!(pContext = LookupIDByType(stuff->context_id, XvMCRTContext)))
- return (XvMCBadContext + XvMCErrorBase);
-
- pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
-
- if(!(pSurface = xalloc(sizeof(XvMCSurfaceRec))))
- return BadAlloc;
-
- pSurface->surface_id = stuff->surface_id;
- pSurface->surface_type_id = pContext->surface_type_id;
- pSurface->context = pContext;
-
- result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSurface)(
- pSurface, &dwords, &data);
-
- if(result != Success) {
- xfree(pSurface);
- return result;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = dwords;
-
- WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char*)&rep);
- if(dwords)
- WriteToClient(client, dwords << 2, (char*)data);
- AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
-
- if(data)
- xfree(data);
-
- pContext->refcnt++;
-
- return Success;
-}
-
-static int
-ProcXvMCDestroySurface(ClientPtr client)
-{
- REQUEST(xvmcDestroySurfaceReq);
- REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq);
-
- if(!LookupIDByType(stuff->surface_id, XvMCRTSurface))
- return (XvMCBadSurface + XvMCErrorBase);
-
- FreeResource(stuff->surface_id, RT_NONE);
-
- return Success;
-}
-
-static int
-ProcXvMCCreateSubpicture(ClientPtr client)
-{
- Bool image_supported = FALSE;
- CARD32 *data = NULL;
- int i, result, dwords = 0;
- XvMCContextPtr pContext;
- XvMCSubpicturePtr pSubpicture;
- XvMCScreenPtr pScreenPriv;
- xvmcCreateSubpictureReply rep;
- XvMCAdaptorPtr adaptor;
- XvMCSurfaceInfoPtr surface = NULL;
- REQUEST(xvmcCreateSubpictureReq);
- REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq);
-
- if(!(pContext = LookupIDByType(stuff->context_id, XvMCRTContext)))
- return (XvMCBadContext + XvMCErrorBase);
-
- pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
-
- adaptor = &(pScreenPriv->adaptors[pContext->adapt_num]);
-
- /* find which surface this context supports */
- for(i = 0; i < adaptor->num_surfaces; i++) {
- if(adaptor->surfaces[i]->surface_type_id == pContext->surface_type_id){
- surface = adaptor->surfaces[i];
- break;
- }
- }
-
- if(!surface) return BadMatch;
-
- /* make sure this surface supports that xvimage format */
- if(!surface->compatible_subpictures) return BadMatch;
-
- for(i = 0; i < surface->compatible_subpictures->num_xvimages; i++) {
- if(surface->compatible_subpictures->xvimage_ids[i] == stuff->xvimage_id) {
- image_supported = TRUE;
- break;
- }
- }
-
- if(!image_supported) return BadMatch;
-
- /* make sure the size is OK */
- if((stuff->width > surface->subpicture_max_width) ||
- (stuff->height > surface->subpicture_max_height))
- return BadValue;
-
- if(!(pSubpicture = xalloc(sizeof(XvMCSubpictureRec))))
- return BadAlloc;
-
- pSubpicture->subpicture_id = stuff->subpicture_id;
- pSubpicture->xvimage_id = stuff->xvimage_id;
- pSubpicture->width = stuff->width;
- pSubpicture->height = stuff->height;
- pSubpicture->num_palette_entries = 0; /* overwritten by DDX */
- pSubpicture->entry_bytes = 0; /* overwritten by DDX */
- pSubpicture->component_order[0] = 0; /* overwritten by DDX */
- pSubpicture->component_order[1] = 0;
- pSubpicture->component_order[2] = 0;
- pSubpicture->component_order[3] = 0;
- pSubpicture->context = pContext;
-
- result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSubpicture)(
- pSubpicture, &dwords, &data);
-
- if(result != Success) {
- xfree(pSubpicture);
- return result;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.width_actual = pSubpicture->width;
- rep.height_actual = pSubpicture->height;
- rep.num_palette_entries = pSubpicture->num_palette_entries;
- rep.entry_bytes = pSubpicture->entry_bytes;
- rep.component_order[0] = pSubpicture->component_order[0];
- rep.component_order[1] = pSubpicture->component_order[1];
- rep.component_order[2] = pSubpicture->component_order[2];
- rep.component_order[3] = pSubpicture->component_order[3];
- rep.length = dwords;
-
- WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char*)&rep);
- if(dwords)
- WriteToClient(client, dwords << 2, (char*)data);
- AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
-
- if(data)
- xfree(data);
-
- pContext->refcnt++;
-
- return Success;
-}
-
-static int
-ProcXvMCDestroySubpicture(ClientPtr client)
-{
- REQUEST(xvmcDestroySubpictureReq);
- REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq);
-
- if(!LookupIDByType(stuff->subpicture_id, XvMCRTSubpicture))
- return (XvMCBadSubpicture + XvMCErrorBase);
-
- FreeResource(stuff->subpicture_id, RT_NONE);
-
- return Success;
-}
-
-
-static int
-ProcXvMCListSubpictureTypes(ClientPtr client)
-{
- XvPortPtr pPort;
- xvmcListSubpictureTypesReply rep;
- XvMCScreenPtr pScreenPriv;
- ScreenPtr pScreen;
- XvMCAdaptorPtr adaptor = NULL;
- XvMCSurfaceInfoPtr surface = NULL;
- xvImageFormatInfo info;
- XvImagePtr pImage;
- int i, j;
- REQUEST(xvmcListSubpictureTypesReq);
- REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq);
-
- if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
- client->errorValue = stuff->port;
- return _XvBadPort;
- }
-
- pScreen = pPort->pAdaptor->pScreen;
-
- if(XvMCScreenIndex < 0) /* No XvMC adaptors */
- return BadMatch;
-
- if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
- return BadMatch; /* None this screen */
-
- for(i = 0; i < pScreenPriv->num_adaptors; i++) {
- if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
- adaptor = &(pScreenPriv->adaptors[i]);
- break;
- }
- }
-
- if(!adaptor) return BadMatch;
-
- for(i = 0; i < adaptor->num_surfaces; i++) {
- if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
- surface = adaptor->surfaces[i];
- break;
- }
- }
-
- if(!surface) return BadMatch;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num = 0;
- if(surface->compatible_subpictures)
- rep.num = surface->compatible_subpictures->num_xvimages;
-
- rep.length = rep.num * sizeof(xvImageFormatInfo) >> 2;
-
- WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep);
-
- for(i = 0; i < rep.num; i++) {
- pImage = NULL;
- for(j = 0; j < adaptor->num_subpictures; j++) {
- if(surface->compatible_subpictures->xvimage_ids[i] ==
- adaptor->subpictures[j]->id)
- {
- pImage = adaptor->subpictures[j];
- break;
- }
- }
- if(!pImage) return BadImplementation;
-
- info.id = pImage->id;
- info.type = pImage->type;
- info.byte_order = pImage->byte_order;
- memcpy(&info.guid, pImage->guid, 16);
- info.bpp = pImage->bits_per_pixel;
- info.num_planes = pImage->num_planes;
- info.depth = pImage->depth;
- info.red_mask = pImage->red_mask;
- info.green_mask = pImage->green_mask;
- info.blue_mask = pImage->blue_mask;
- info.format = pImage->format;
- info.y_sample_bits = pImage->y_sample_bits;
- info.u_sample_bits = pImage->u_sample_bits;
- info.v_sample_bits = pImage->v_sample_bits;
- info.horz_y_period = pImage->horz_y_period;
- info.horz_u_period = pImage->horz_u_period;
- info.horz_v_period = pImage->horz_v_period;
- info.vert_y_period = pImage->vert_y_period;
- info.vert_u_period = pImage->vert_u_period;
- info.vert_v_period = pImage->vert_v_period;
- memcpy(&info.comp_order, pImage->component_order, 32);
- info.scanline_order = pImage->scanline_order;
- WriteToClient(client, sizeof(xvImageFormatInfo), (char*)&info);
- }
-
- return Success;
-}
-
-
-
-int (*ProcXvMCVector[xvmcNumRequest])(ClientPtr) = {
- ProcXvMCQueryVersion,
- ProcXvMCListSurfaceTypes,
- ProcXvMCCreateContext,
- ProcXvMCDestroyContext,
- ProcXvMCCreateSurface,
- ProcXvMCDestroySurface,
- ProcXvMCCreateSubpicture,
- ProcXvMCDestroySubpicture,
- ProcXvMCListSubpictureTypes
-};
-
-static int
-ProcXvMCDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if(stuff->data < xvmcNumRequest)
- return (*ProcXvMCVector[stuff->data])(client);
- else
- return BadRequest;
-}
-
-static int
-SProcXvMCDispatch (ClientPtr client)
-{
- /* We only support local */
- return BadImplementation;
-}
-
-void
-XvMCExtensionInit()
-{
- ExtensionEntry *extEntry;
-
- if(XvMCScreenIndex < 0) /* nobody supports it */
- return;
-
- if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
- return;
-
- if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes)))
- return;
-
- if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes)))
- return;
-
- extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
- ProcXvMCDispatch, SProcXvMCDispatch,
- XvMCResetProc, StandardMinorOpcode);
-
- if(!extEntry) return;
-
- XvMCReqCode = extEntry->base;
- XvMCEventBase = extEntry->eventBase;
- XvMCErrorBase = extEntry->errorBase;
-}
-
-static Bool
-XvMCCloseScreen (int i, ScreenPtr pScreen)
-{
- XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
-
- xfree(pScreenPriv);
-
- return (*pScreen->CloseScreen)(i, pScreen);
-}
-
-
-int
-XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
-{
- XvMCScreenPtr pScreenPriv;
-
- if(XvMCGeneration != serverGeneration) {
- if((XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return BadAlloc;
-
- XvMCGeneration = serverGeneration;
- }
-
- if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
- return BadAlloc;
-
- pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv;
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = XvMCCloseScreen;
-
- pScreenPriv->num_adaptors = num;
- pScreenPriv->adaptors = pAdapt;
-
- return Success;
-}
-
-XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
-{
- XvImagePtr pImage = NULL;
- ScreenPtr pScreen = pPort->pAdaptor->pScreen;
- XvMCScreenPtr pScreenPriv;
- XvMCAdaptorPtr adaptor = NULL;
- int i;
-
- if(XvMCScreenIndex < 0) return NULL;
-
- if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
- return NULL;
-
- for(i = 0; i < pScreenPriv->num_adaptors; i++) {
- if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
- adaptor = &(pScreenPriv->adaptors[i]);
- break;
- }
- }
-
- if(!adaptor) return NULL;
-
- for(i = 0; i < adaptor->num_subpictures; i++) {
- if(adaptor->subpictures[i]->id == id) {
- pImage = adaptor->subpictures[i];
- break;
- }
- }
-
- return pImage;
-}
diff --git a/Xext/xvmcext.h b/Xext/xvmcext.h
deleted file mode 100644
index b589c5487..000000000
--- a/Xext/xvmcext.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.2 2003/07/17 16:04:33 dawes Exp $ */
-
-#ifndef _XVMC_H
-#define _XVMC_H
-#include "Xv.h"
-#include "xvdix.h"
-
-typedef struct {
- int num_xvimages;
- int *xvimage_ids;
-} XvMCImageIDList;
-
-typedef struct {
- int surface_type_id;
- int chroma_format;
- int color_description;
- unsigned short max_width;
- unsigned short max_height;
- unsigned short subpicture_max_width;
- unsigned short subpicture_max_height;
- int mc_type;
- int flags;
- XvMCImageIDList *compatible_subpictures;
-} XvMCSurfaceInfoRec, *XvMCSurfaceInfoPtr;
-
-typedef struct {
- XID context_id;
- ScreenPtr pScreen;
- int adapt_num;
- int surface_type_id;
- unsigned short width;
- unsigned short height;
- CARD32 flags;
- int refcnt;
- pointer port_priv;
- pointer driver_priv;
-} XvMCContextRec, *XvMCContextPtr;
-
-typedef struct {
- XID surface_id;
- int surface_type_id;
- XvMCContextPtr context;
- pointer driver_priv;
-} XvMCSurfaceRec, *XvMCSurfacePtr;
-
-
-typedef struct {
- XID subpicture_id;
- int xvimage_id;
- unsigned short width;
- unsigned short height;
- int num_palette_entries;
- int entry_bytes;
- char component_order[4];
- XvMCContextPtr context;
- pointer driver_priv;
-} XvMCSubpictureRec, *XvMCSubpicturePtr;
-
-typedef int (*XvMCCreateContextProcPtr) (
- XvPortPtr port,
- XvMCContextPtr context,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*XvMCDestroyContextProcPtr) (
- XvMCContextPtr context
-);
-
-typedef int (*XvMCCreateSurfaceProcPtr) (
- XvMCSurfacePtr surface,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*XvMCDestroySurfaceProcPtr) (
- XvMCSurfacePtr surface
-);
-
-typedef int (*XvMCCreateSubpictureProcPtr) (
- XvMCSubpicturePtr subpicture,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*XvMCDestroySubpictureProcPtr) (
- XvMCSubpicturePtr subpicture
-);
-
-
-typedef struct {
- XvAdaptorPtr xv_adaptor;
- int num_surfaces;
- XvMCSurfaceInfoPtr *surfaces;
- int num_subpictures;
- XvImagePtr *subpictures;
- XvMCCreateContextProcPtr CreateContext;
- XvMCDestroyContextProcPtr DestroyContext;
- XvMCCreateSurfaceProcPtr CreateSurface;
- XvMCDestroySurfaceProcPtr DestroySurface;
- XvMCCreateSubpictureProcPtr CreateSubpicture;
- XvMCDestroySubpictureProcPtr DestroySubpicture;
-} XvMCAdaptorRec, *XvMCAdaptorPtr;
-
-void XvMCExtensionInit(void);
-
-int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt);
-
-XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
-
-#endif /* _XVMC_H */
diff --git a/Xi/allowev.c b/Xi/allowev.c
deleted file mode 100644
index 2eb463d41..000000000
--- a/Xi/allowev.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $Xorg: allowev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/allowev.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */
-
-/***********************************************************************
- *
- * Function to allow frozen events to be routed from extension input devices.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "allowev.h"
-#include "dixevents.h"
-
-/***********************************************************************
- *
- * This procedure allows frozen events to be routed.
- *
- */
-
-int
-SProcXAllowDeviceEvents(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xAllowDeviceEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
- swapl(&stuff->time, n);
- return(ProcXAllowDeviceEvents(client));
- }
-
-/***********************************************************************
- *
- * This procedure allows frozen events to be routed.
- *
- */
-
-int
-ProcXAllowDeviceEvents(client)
- register ClientPtr client;
- {
- TimeStamp time;
- DeviceIntPtr thisdev;
-
- REQUEST(xAllowDeviceEventsReq);
- REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
-
- thisdev = LookupDeviceIntRec (stuff->deviceid);
- if (thisdev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadDevice);
- return Success;
- }
- time = ClientTimeToServerTime(stuff->time);
-
- switch (stuff->mode)
- {
- case ReplayThisDevice:
- AllowSome(client, time, thisdev, NOT_GRABBED);
- break;
- case SyncThisDevice:
- AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
- break;
- case AsyncThisDevice:
- AllowSome(client, time, thisdev, THAWED);
- break;
- case AsyncOtherDevices:
- AllowSome(client, time, thisdev, THAW_OTHERS);
- break;
- case SyncAll:
- AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
- break;
- case AsyncAll:
- AllowSome(client, time, thisdev, THAWED_BOTH);
- break;
- default:
- SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0,
- BadValue);
- client->errorValue = stuff->mode;
- return Success;
- }
- return Success;
- }
diff --git a/Xi/allowev.h b/Xi/allowev.h
deleted file mode 100644
index 0202b2cf5..000000000
--- a/Xi/allowev.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef ALLOWEV_H
-#define ALLOWEV_H 1
-
-int
-SProcXAllowDeviceEvents(
- ClientPtr /* client */
- );
-
-int
-ProcXAllowDeviceEvents(
- ClientPtr /* client */
- );
-
-#endif /* ALLOWEV_H */
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
deleted file mode 100644
index f5988d76b..000000000
--- a/Xi/chgdctl.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $Xorg: chgdctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgdctl.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */
-
-/********************************************************************
- *
- * Change Device control attributes for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h" /* control constants */
-#include "XIstubs.h"
-
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "chgdctl.h"
-
-/***********************************************************************
- *
- * This procedure changes the control attributes for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXChangeDeviceControl(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xChangeDeviceControlReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
- swaps(&stuff->control, n);
- return(ProcXChangeDeviceControl(client));
- }
-
-/***********************************************************************
- *
- * Change the control attributes.
- *
- */
-
-int
-ProcXChangeDeviceControl(client)
- ClientPtr client;
- {
- unsigned len;
- int i, status;
- DeviceIntPtr dev;
- xDeviceResolutionCtl *r;
- xChangeDeviceControlReply rep;
- AxisInfoPtr a;
- CARD32 *resolution;
-
- REQUEST(xChangeDeviceControlReq);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
-
- len = stuff->length - (sizeof(xChangeDeviceControlReq) >>2);
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
- BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_ChangeDeviceControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- switch (stuff->control)
- {
- case DEVICE_RESOLUTION:
- r = (xDeviceResolutionCtl *) &stuff[1];
- if ((len < (sizeof(xDeviceResolutionCtl)>>2)) ||
- (len != (sizeof(xDeviceResolutionCtl)>>2) +
- r->num_valuators))
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl,
- 0, BadLength);
- return Success;
- }
- if (!dev->valuator)
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
- BadMatch);
- return Success;
- }
- if ((dev->grab) && !SameClient(dev->grab, client))
- {
- rep.status = AlreadyGrabbed;
- WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
- &rep);
- return Success;
- }
- resolution = (CARD32 *) (r + 1);
- if (r->first_valuator + r->num_valuators > dev->valuator->numAxes)
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
- BadValue);
- return Success;
- }
- status = ChangeDeviceControl(client, dev, (xDeviceCtl*) r);
- if (status == Success)
- {
- a = &dev->valuator->axes[r->first_valuator];
- for (i=0; i<r->num_valuators; i++)
- if (*(resolution+i) < (a+i)->min_resolution ||
- *(resolution+i) > (a+i)->max_resolution)
- {
- SendErrorToClient (client, IReqCode,
- X_ChangeDeviceControl, 0, BadValue);
- return Success;
- }
- for (i=0; i<r->num_valuators; i++)
- (a++)->resolution = *resolution++;
- }
- else if (status == DeviceBusy)
- {
- rep.status = DeviceBusy;
- WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
- &rep);
- return Success;
- }
- else
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
- BadMatch);
- return Success;
- }
- break;
- default:
- SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
- BadValue);
- return Success;
- }
- WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the xChangeDeviceControl function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXChangeDeviceControl (client, size, rep)
- ClientPtr client;
- int size;
- xChangeDeviceControlReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
-
diff --git a/Xi/chgdctl.h b/Xi/chgdctl.h
deleted file mode 100644
index 0d15001a0..000000000
--- a/Xi/chgdctl.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGDCTL_H
-#define CHGDCTL_H 1
-
-int
-SProcXChangeDeviceControl(
- ClientPtr /* client */
- );
-
-int
-ProcXChangeDeviceControl(
- ClientPtr /* client */
- );
-
-void
-SRepXChangeDeviceControl (
- ClientPtr /* client */,
- int /* size */,
- xChangeDeviceControlReply * /* rep */
- );
-
-#endif /* CHGDCTL_H */
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
deleted file mode 100644
index 213fc7bf5..000000000
--- a/Xi/chgfctl.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/* $Xorg: chgfctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgfctl.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */
-
-/********************************************************************
- *
- * Change feedback control attributes for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h" /* control constants */
-
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "chgfctl.h"
-
-#define DO_ALL (-1)
-
-/***********************************************************************
- *
- * This procedure changes the control attributes for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXChangeFeedbackControl(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xChangeFeedbackControlReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
- swapl(&stuff->mask, n);
- return(ProcXChangeFeedbackControl(client));
- }
-
-/***********************************************************************
- *
- * Change the control attributes.
- *
- */
-
-int
-ProcXChangeFeedbackControl(client)
- ClientPtr client;
- {
- unsigned len;
- DeviceIntPtr dev;
- KbdFeedbackPtr k;
- PtrFeedbackPtr p;
- IntegerFeedbackPtr i;
- StringFeedbackPtr s;
- BellFeedbackPtr b;
- LedFeedbackPtr l;
-
- REQUEST(xChangeFeedbackControlReq);
- REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
-
- len = stuff->length - (sizeof(xChangeFeedbackControlReq) >>2);
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadDevice);
- return Success;
- }
-
- switch (stuff->feedbackid)
- {
- case KbdFeedbackClass:
- if (len != (sizeof(xKbdFeedbackCtl)>>2))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (k=dev->kbdfeed; k; k=k->next)
- if (k->ctrl.id == ((xKbdFeedbackCtl *) &stuff[1])->id)
- {
- ChangeKbdFeedback (client, dev, stuff->mask, k, (xKbdFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- case PtrFeedbackClass:
- if (len != (sizeof(xPtrFeedbackCtl)>>2))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (p=dev->ptrfeed; p; p=p->next)
- if (p->ctrl.id == ((xPtrFeedbackCtl *) &stuff[1])->id)
- {
- ChangePtrFeedback (client, dev, stuff->mask, p, (xPtrFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- case StringFeedbackClass:
- {
- register char n;
- xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
- if (client->swapped)
- {
- swaps(&f->num_keysyms,n);
- }
- if (len != ((sizeof(xStringFeedbackCtl)>>2) + f->num_keysyms))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (s=dev->stringfeed; s; s=s->next)
- if (s->ctrl.id == ((xStringFeedbackCtl *) &stuff[1])->id)
- {
- ChangeStringFeedback (client, dev, stuff->mask,s,(xStringFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- }
- case IntegerFeedbackClass:
- if (len != (sizeof(xIntegerFeedbackCtl)>>2))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (i=dev->intfeed; i; i=i->next)
- if (i->ctrl.id == ((xIntegerFeedbackCtl *) &stuff[1])->id)
- {
- ChangeIntegerFeedback (client, dev,stuff->mask,i,(xIntegerFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- case LedFeedbackClass:
- if (len != (sizeof(xLedFeedbackCtl)>>2))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (l=dev->leds; l; l=l->next)
- if (l->ctrl.id == ((xLedFeedbackCtl *) &stuff[1])->id)
- {
- ChangeLedFeedback (client, dev, stuff->mask, l, (xLedFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- case BellFeedbackClass:
- if (len != (sizeof(xBellFeedbackCtl)>>2))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- for (b=dev->bell; b; b=b->next)
- if (b->ctrl.id == ((xBellFeedbackCtl *) &stuff[1])->id)
- {
- ChangeBellFeedback (client, dev, stuff->mask, b, (xBellFeedbackCtl *)&stuff[1]);
- return Success;
- }
- break;
- default:
- break;
- }
-
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes KbdFeedbackClass data.
- *
- */
-
-int
-ChangeKbdFeedback (client, dev, mask, k, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- KbdFeedbackPtr k;
- xKbdFeedbackCtl *f;
- {
- register char n;
- KeybdCtrl kctrl;
- int t;
- int key = DO_ALL;
-
- if (client->swapped)
- {
- swaps(&f->length,n);
- swaps(&f->pitch,n);
- swaps(&f->duration,n);
- swapl(&f->led_mask,n);
- swapl(&f->led_values,n);
- }
-
- kctrl = k->ctrl;
- if (mask & DvKeyClickPercent)
- {
- t = f->click;
- if (t == -1)
- t = defaultKeyboardControl.click;
- else if (t < 0 || t > 100)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- kctrl.click = t;
- }
-
- if (mask & DvPercent)
- {
- t = f->percent;
- if (t == -1)
- t = defaultKeyboardControl.bell;
- else if (t < 0 || t > 100)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- kctrl.bell = t;
- }
-
- if (mask & DvPitch)
- {
- t = f->pitch;
- if (t == -1)
- t = defaultKeyboardControl.bell_pitch;
- else if (t < 0)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- kctrl.bell_pitch = t;
- }
-
- if (mask & DvDuration)
- {
- t = f->duration;
- if (t == -1)
- t = defaultKeyboardControl.bell_duration;
- else if (t < 0)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- kctrl.bell_duration = t;
- }
-
- if (mask & DvLed)
- {
- kctrl.leds &= ~(f->led_mask);
- kctrl.leds |= (f->led_mask & f->led_values);
- }
-
- if (mask & DvKey)
- {
- key = (KeyCode) f->key;
- if (key < 8 || key > 255)
- {
- client->errorValue = key;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- if (!(mask & DvAutoRepeatMode))
- {
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadMatch);
- return Success;
- }
- }
-
- if (mask & DvAutoRepeatMode)
- {
- int inx = (key >> 3);
- int kmask = (1 << (key & 7));
- t = (CARD8) f->auto_repeat_mode;
- if (t == AutoRepeatModeOff)
- {
- if (key == DO_ALL)
- kctrl.autoRepeat = FALSE;
- else
- kctrl.autoRepeats[inx] &= ~kmask;
- }
- else if (t == AutoRepeatModeOn)
- {
- if (key == DO_ALL)
- kctrl.autoRepeat = TRUE;
- else
- kctrl.autoRepeats[inx] |= kmask;
- }
- else if (t == AutoRepeatModeDefault)
- {
- if (key == DO_ALL)
- kctrl.autoRepeat = defaultKeyboardControl.autoRepeat;
- else
- kctrl.autoRepeats[inx] &= ~kmask;
- kctrl.autoRepeats[inx] =
- (kctrl.autoRepeats[inx] & ~kmask) |
- (defaultKeyboardControl.autoRepeats[inx] & kmask);
- }
- else
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- }
-
- k->ctrl = kctrl;
- (*k->CtrlProc)(dev, &k->ctrl);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes PtrFeedbackClass data.
- *
- */
-
-int
-ChangePtrFeedback (client, dev, mask, p, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- PtrFeedbackPtr p;
- xPtrFeedbackCtl *f;
- {
- register char n;
- PtrCtrl pctrl; /* might get BadValue part way through */
-
- if (client->swapped)
- {
- swaps(&f->length,n);
- swaps(&f->num,n);
- swaps(&f->denom,n);
- swaps(&f->thresh,n);
- }
-
- pctrl = p->ctrl;
- if (mask & DvAccelNum)
- {
- int accelNum;
-
- accelNum = f->num;
- if (accelNum == -1)
- pctrl.num = defaultPointerControl.num;
- else if (accelNum < 0)
- {
- client->errorValue = accelNum;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- else pctrl.num = accelNum;
- }
-
- if (mask & DvAccelDenom)
- {
- int accelDenom;
-
- accelDenom = f->denom;
- if (accelDenom == -1)
- pctrl.den = defaultPointerControl.den;
- else if (accelDenom <= 0)
- {
- client->errorValue = accelDenom;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- else pctrl.den = accelDenom;
- }
-
- if (mask & DvThreshold)
- {
- int threshold;
-
- threshold = f->thresh;
- if (threshold == -1)
- pctrl.threshold = defaultPointerControl.threshold;
- else if (threshold < 0)
- {
- client->errorValue = threshold;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- else pctrl.threshold = threshold;
- }
-
- p->ctrl = pctrl;
- (*p->CtrlProc)(dev, &p->ctrl);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes IntegerFeedbackClass data.
- *
- */
-
-int
-ChangeIntegerFeedback (client, dev, mask, i, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- IntegerFeedbackPtr i;
- xIntegerFeedbackCtl *f;
- {
- register char n;
-
- if (client->swapped)
- {
- swaps(&f->length,n);
- swapl(&f->int_to_display,n);
- }
-
- i->ctrl.integer_displayed = f->int_to_display;
- (*i->CtrlProc)(dev, &i->ctrl);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes StringFeedbackClass data.
- *
- */
-
-int
-ChangeStringFeedback (client, dev, mask, s, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- StringFeedbackPtr s;
- xStringFeedbackCtl *f;
- {
- register char n;
- register long *p;
- int i, j;
- KeySym *syms, *sup_syms;
-
- syms = (KeySym *) (f+1);
- if (client->swapped)
- {
- swaps(&f->length,n); /* swapped num_keysyms in calling proc */
- p = (long *) (syms);
- for (i=0; i<f->num_keysyms; i++)
- {
- swapl(p, n);
- p++;
- }
- }
-
- if (f->num_keysyms > s->ctrl.max_symbols)
- {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- sup_syms = s->ctrl.symbols_supported;
- for (i=0; i<f->num_keysyms; i++)
- {
- for (j=0; j<s->ctrl.num_symbols_supported; j++)
- if (*(syms+i) == *(sup_syms+j))
- break;
- if (j==s->ctrl.num_symbols_supported)
- {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
- BadMatch);
- return Success;
- }
- }
-
- s->ctrl.num_symbols_displayed = f->num_keysyms;
- for (i=0; i<f->num_keysyms; i++)
- *(s->ctrl.symbols_displayed+i) = *(syms+i);
- (*s->CtrlProc)(dev, &s->ctrl);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes BellFeedbackClass data.
- *
- */
-
-int
-ChangeBellFeedback (client, dev, mask, b, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- BellFeedbackPtr b;
- xBellFeedbackCtl *f;
- {
- register char n;
- int t;
- BellCtrl bctrl; /* might get BadValue part way through */
-
- if (client->swapped)
- {
- swaps(&f->length,n);
- swaps(&f->pitch,n);
- swaps(&f->duration,n);
- }
-
- bctrl = b->ctrl;
- if (mask & DvPercent)
- {
- t = f->percent;
- if (t == -1)
- t = defaultKeyboardControl.bell;
- else if (t < 0 || t > 100)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- bctrl.percent = t;
- }
-
- if (mask & DvPitch)
- {
- t = f->pitch;
- if (t == -1)
- t = defaultKeyboardControl.bell_pitch;
- else if (t < 0)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- bctrl.pitch = t;
- }
-
- if (mask & DvDuration)
- {
- t = f->duration;
- if (t == -1)
- t = defaultKeyboardControl.bell_duration;
- else if (t < 0)
- {
- client->errorValue = t;
- SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
- BadValue);
- return Success;
- }
- bctrl.duration = t;
- }
- b->ctrl = bctrl;
- (*b->CtrlProc)(dev, &b->ctrl);
- return Success;
- }
-
-/******************************************************************************
- *
- * This procedure changes LedFeedbackClass data.
- *
- */
-
-int
-ChangeLedFeedback (client, dev, mask, l, f)
- ClientPtr client;
- DeviceIntPtr dev;
- unsigned long mask;
- LedFeedbackPtr l;
- xLedFeedbackCtl *f;
- {
- register char n;
- LedCtrl lctrl; /* might get BadValue part way through */
-
- if (client->swapped)
- {
- swaps(&f->length,n);
- swapl(&f->led_values,n);
- swapl(&f->led_mask,n);
- }
-
- f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
- f->led_values &= l->ctrl.led_mask; /* set only supported leds */
- if (mask & DvLed)
- {
- lctrl.led_mask = f->led_mask;
- lctrl.led_values = f->led_values;
- (*l->CtrlProc)(dev, &lctrl);
- l->ctrl.led_values &= ~(f->led_mask); /* zero changed leds */
- l->ctrl.led_values |= (f->led_mask & f->led_values);/* OR in set leds*/
- }
-
- return Success;
- }
diff --git a/Xi/chgfctl.h b/Xi/chgfctl.h
deleted file mode 100644
index 4f833617a..000000000
--- a/Xi/chgfctl.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGFCTL_H
-#define CHGFCTL_H 1
-
-int
-SProcXChangeFeedbackControl(
- ClientPtr /* client */
- );
-
-int
-ProcXChangeFeedbackControl(
- ClientPtr /* client */
- );
-
-int
-ChangeKbdFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- KbdFeedbackPtr /* k */,
- xKbdFeedbackCtl * /* f */
- );
-
-int
-ChangePtrFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- PtrFeedbackPtr /* p */,
- xPtrFeedbackCtl * /* f */
- );
-
-int
-ChangeIntegerFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- IntegerFeedbackPtr /* i */,
- xIntegerFeedbackCtl * /* f */
- );
-
-int
-ChangeStringFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- StringFeedbackPtr /* s */,
- xStringFeedbackCtl * /* f */
- );
-
-int
-ChangeBellFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- BellFeedbackPtr /* b */,
- xBellFeedbackCtl * /* f */
- );
-
-int
-ChangeLedFeedback (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned long /* mask */,
- LedFeedbackPtr /* l */,
- xLedFeedbackCtl * /* f */
- );
-
-#endif /* CHGFCTL_H */
diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c
deleted file mode 100644
index b0b82ee6d..000000000
--- a/Xi/chgkbd.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/* $Xorg: chgkbd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgkbd.c,v 3.6 2001/12/14 19:58:54 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to change the keyboard device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "globals.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "chgkbd.h"
-#include "chgptr.h"
-
-/***********************************************************************
- *
- * This procedure changes the keyboard device.
- *
- */
-
-int
-SProcXChangeKeyboardDevice(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xChangeKeyboardDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
- return(ProcXChangeKeyboardDevice(client));
- }
-
-/***********************************************************************
- *
- * This procedure is invoked to swap the request bytes if the server and
- * client have a different byte order.
- *
- */
-
-int
-ProcXChangeKeyboardDevice (client)
- register ClientPtr client;
- {
- int i;
- DeviceIntPtr xkbd = inputInfo.keyboard;
- DeviceIntPtr dev;
- FocusClassPtr xf = xkbd->focus;
- FocusClassPtr df;
- KeyClassPtr k;
- xChangeKeyboardDeviceReply rep;
- changeDeviceNotify ev;
-
- REQUEST(xChangeKeyboardDeviceReq);
- REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_ChangeKeyboardDevice;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- rep.status = -1;
- SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
- BadDevice);
- return Success;
- }
-
- k = dev->key;
- if (k == NULL)
- {
- rep.status = -1;
- SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
- BadMatch);
- return Success;
- }
-
- if (((dev->grab) && !SameClient(dev->grab, client)) ||
- ((xkbd->grab) && !SameClient(xkbd->grab, client)))
- rep.status = AlreadyGrabbed;
- else if ((dev->sync.frozen &&
- dev->sync.other && !SameClient(dev->sync.other, client)) ||
- (xkbd->sync.frozen &&
- xkbd->sync.other && !SameClient(xkbd->sync.other, client)))
- rep.status = GrabFrozen;
- else
- {
- if (ChangeKeyboardDevice (xkbd, dev) != Success)
- {
- SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
- BadDevice);
- return Success;
- }
- if (!dev->focus)
- InitFocusClassDeviceStruct (dev);
- if (!dev->kbdfeed)
- InitKbdFeedbackClassDeviceStruct(dev, (BellProcPtr)NoopDDA,
- (KbdCtrlProcPtr)NoopDDA);
- df = dev->focus;
- df->win = xf->win;
- df->revert = xf->revert;
- df->time = xf->time;
- df->traceGood = xf->traceGood;
- if (df->traceSize != xf->traceSize)
- {
- Must_have_memory = TRUE; /* XXX */
- df->trace = (WindowPtr *) xrealloc(df->trace,
- xf->traceSize * sizeof(WindowPtr));
- Must_have_memory = FALSE; /* XXX */
- }
- df->traceSize = xf->traceSize;
- for (i=0; i<df->traceSize; i++)
- df->trace[i] = xf->trace[i];
- RegisterOtherDevice (xkbd);
- RegisterKeyboardDevice (dev);
-
- ev.type = ChangeDeviceNotify;
- ev.deviceid = stuff->deviceid;
- ev.time = currentTime.milliseconds;
- ev.request = NewKeyboard;
-
- SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1);
- SendMappingNotify (MappingKeyboard, k->curKeySyms.minKeyCode,
- k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1,client);
-
- rep.status = 0;
- }
-
- WriteReplyToClient (client, sizeof (xChangeKeyboardDeviceReply),
- &rep);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XChangeKeyboardDevice
- * function, if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXChangeKeyboardDevice (client, size, rep)
- ClientPtr client;
- int size;
- xChangeKeyboardDeviceReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/chgkbd.h b/Xi/chgkbd.h
deleted file mode 100644
index 5a2cef2c7..000000000
--- a/Xi/chgkbd.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGKBD_H
-#define CHGKBD_H 1
-
-int
-SProcXChangeKeyboardDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXChangeKeyboardDevice (
- ClientPtr /* client */
- );
-
-void
-SRepXChangeKeyboardDevice (
- ClientPtr /* client */,
- int /* size */,
- xChangeKeyboardDeviceReply * /* rep */
- );
-
-
-#endif /* CHGKBD_H */
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
deleted file mode 100644
index 2b638252f..000000000
--- a/Xi/chgkmap.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* $Xorg: chgkmap.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgkmap.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */
-
-/********************************************************************
- *
- * Change key mapping for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "chgkmap.h"
-
-/***********************************************************************
- *
- * This procedure swaps the request when the client and
- * server have different byte orderings.
- *
- */
-
-int
-SProcXChangeDeviceKeyMapping(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i, count;
-
- REQUEST(xChangeDeviceKeyMappingReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
- p = (long *) &stuff[1];
- count = stuff->keyCodes * stuff->keySymsPerKeyCode;
- for (i = 0; i < count; i++)
- {
- swapl(p, n);
- p++;
- }
- return(ProcXChangeDeviceKeyMapping(client));
- }
-
-/***********************************************************************
- *
- * Change the device key mapping.
- *
- */
-
-int
-ProcXChangeDeviceKeyMapping(client)
- register ClientPtr client;
- {
- int ret;
- unsigned len;
- DeviceIntPtr dev;
-
- REQUEST(xChangeDeviceKeyMappingReq);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceKeyMapping, 0,
- BadDevice);
- return Success;
- }
- len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
-
- ret = ChangeKeyMapping (client, dev, len, DeviceMappingNotify,
- stuff->firstKeyCode, stuff->keyCodes, stuff->keySymsPerKeyCode,
- (KeySym *)&stuff[1]);
-
- if (ret != Success)
- SendErrorToClient (client, IReqCode, X_ChangeDeviceKeyMapping, 0,
- ret);
- return Success;
- }
diff --git a/Xi/chgkmap.h b/Xi/chgkmap.h
deleted file mode 100644
index fd7ed4673..000000000
--- a/Xi/chgkmap.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGKMAP_H
-#define CHGKMAP_H 1
-
-int
-SProcXChangeDeviceKeyMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXChangeDeviceKeyMapping(
- ClientPtr /* client */
- );
-
-#endif /* CHGKMAP_H */
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
deleted file mode 100644
index 96ce0bebe..000000000
--- a/Xi/chgprop.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $Xorg: chgprop.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgprop.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */
-
-/***********************************************************************
- *
- * Function to modify the dont-propagate-list for an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h"
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "chgprop.h"
-#include "grabdev.h"
-
-/***********************************************************************
- *
- * This procedure returns the extension version.
- *
- */
-
-int
-SProcXChangeDeviceDontPropagateList(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
-
- REQUEST(xChangeDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
- p = (long *) &stuff[1];
- for (i=0; i<stuff->count; i++)
- {
- swapl(p, n);
- p++;
- }
- return(ProcXChangeDeviceDontPropagateList(client));
- }
-
-/***********************************************************************
- *
- * This procedure changes the dont-propagate list for the specified window.
- *
- */
-
-int
-ProcXChangeDeviceDontPropagateList (client)
- register ClientPtr client;
- {
- int i;
- WindowPtr pWin;
- struct tmask tmp[EMASKSIZE];
- OtherInputMasks *others;
-
- REQUEST(xChangeDeviceDontPropagateListReq);
- REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
-
- if (stuff->length !=(sizeof(xChangeDeviceDontPropagateListReq)>>2) +
- stuff->count)
- {
- SendErrorToClient (client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
- BadLength);
- return Success;
- }
-
- pWin = (WindowPtr) LookupWindow (stuff->window, client);
- if (!pWin)
- {
- client->errorValue = stuff->window;
- SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
- BadWindow);
- return Success;
- }
-
- if (stuff->mode != AddToList && stuff->mode != DeleteFromList)
- {
- client->errorValue = stuff->window;
- SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
- BadMode);
- return Success;
- }
-
- if (CreateMaskFromList (client, (XEventClass *)&stuff[1],
- stuff->count, tmp, NULL, X_ChangeDeviceDontPropagateList) != Success)
- return Success;
-
- others = wOtherInputMasks(pWin);
- if (!others && stuff->mode == DeleteFromList)
- return Success;
- for (i=0; i<EMASKSIZE; i++)
- {
- if (tmp[i].mask == 0)
- continue;
-
- if (stuff->mode == DeleteFromList)
- tmp[i].mask = (others->dontPropagateMask[i] & ~tmp[i].mask);
- else if (others)
- tmp[i].mask |= others->dontPropagateMask[i];
-
- if (DeviceEventSuppressForWindow (pWin,client,tmp[i].mask,i) != Success)
- {
- SendErrorToClient ( client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
- BadClass);
- return Success;
- }
- }
-
- return Success;
- }
diff --git a/Xi/chgprop.h b/Xi/chgprop.h
deleted file mode 100644
index 9df05b4d0..000000000
--- a/Xi/chgprop.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGPROP_H
-#define CHGPROP_H 1
-
-int
-SProcXChangeDeviceDontPropagateList (
- ClientPtr /* client */
- );
-
-int
-ProcXChangeDeviceDontPropagateList (
- ClientPtr /* client */
- );
-
-#endif /* CHGPROP_H */
diff --git a/Xi/chgptr.c b/Xi/chgptr.c
deleted file mode 100644
index c6ece1d65..000000000
--- a/Xi/chgptr.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/* $Xorg: chgptr.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/chgptr.c,v 3.7 2001/12/14 19:58:55 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to change the pointer device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
-
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-
-#include "dixevents.h"
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "chgptr.h"
-
-/***********************************************************************
- *
- * This procedure is invoked to swap the request bytes if the server and
- * client have a different byte order.
- *
- */
-
-int
-SProcXChangePointerDevice(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xChangePointerDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
- return(ProcXChangePointerDevice(client));
- }
-
-/***********************************************************************
- *
- * This procedure changes the device used as the X pointer.
- *
- */
-
-int
-ProcXChangePointerDevice (client)
- register ClientPtr client;
- {
- DeviceIntPtr xptr = inputInfo.pointer;
- DeviceIntPtr dev;
- ValuatorClassPtr v;
- xChangePointerDeviceReply rep;
- changeDeviceNotify ev;
-
- REQUEST(xChangePointerDeviceReq);
- REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_ChangePointerDevice;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- rep.status = -1;
- SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
- BadDevice);
- return Success;
- }
-
- v = dev->valuator;
- if (v == NULL || v->numAxes < 2 ||
- stuff->xaxis >= v->numAxes ||
- stuff->yaxis >= v->numAxes)
- {
- rep.status = -1;
- SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0, BadMatch);
- return Success;
- }
-
- if (((dev->grab) && !SameClient(dev->grab, client)) ||
- ((xptr->grab) && !SameClient(xptr->grab, client)))
- rep.status = AlreadyGrabbed;
- else if ((dev->sync.frozen &&
- dev->sync.other && !SameClient(dev->sync.other, client)) ||
- (xptr->sync.frozen &&
- xptr->sync.other && !SameClient(xptr->sync.other, client)))
- rep.status = GrabFrozen;
- else
- {
- if (ChangePointerDevice (
- xptr, dev, stuff->xaxis, stuff->yaxis) != Success)
- {
- SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
- BadDevice);
- return Success;
- }
- if (dev->focus)
- DeleteFocusClassDeviceStruct(dev);
- if (!dev->button)
- InitButtonClassDeviceStruct (dev, 0, NULL);
- if (!dev->ptrfeed)
- InitPtrFeedbackClassDeviceStruct(dev, (PtrCtrlProcPtr)NoopDDA);
- RegisterOtherDevice (xptr);
- RegisterPointerDevice (dev);
-
- ev.type = ChangeDeviceNotify;
- ev.deviceid = stuff->deviceid;
- ev.time = currentTime.milliseconds;
- ev.request = NewPointer;
-
- SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1);
- SendMappingNotify (MappingPointer, 0, 0, client);
-
- rep.status = 0;
- }
-
- WriteReplyToClient (client, sizeof (xChangePointerDeviceReply),
- &rep);
- return Success;
- }
-
-void
-DeleteFocusClassDeviceStruct(dev)
- DeviceIntPtr dev;
- {
- xfree(dev->focus->trace);
- xfree(dev->focus);
- dev->focus = NULL;
- }
-
-/***********************************************************************
- *
- * Send an event to interested clients in all windows on all screens.
- *
- */
-
-void
-SendEventToAllWindows (dev, mask, ev, count)
- DeviceIntPtr dev;
- Mask mask;
- xEvent *ev;
- int count;
- {
- int i;
- WindowPtr pWin, p1;
-
- for (i=0; i<screenInfo.numScreens; i++)
- {
- pWin = WindowTable[i];
- (void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id);
- p1 = pWin->firstChild;
- FindInterestedChildren (dev, p1, mask, ev, count);
- }
- }
-
-/***********************************************************************
- *
- * Walk through the window tree, finding all clients that want to know
- * about the ChangeDeviceNotify Event.
- *
- */
-
-void
-FindInterestedChildren (dev, p1, mask, ev, count)
- DeviceIntPtr dev;
- WindowPtr p1;
- Mask mask;
- xEvent *ev;
- int count;
- {
- WindowPtr p2;
-
- while (p1)
- {
- p2 = p1->firstChild;
- (void)DeliverEventsToWindow(p1, ev, count, mask, NullGrab, dev->id);
- FindInterestedChildren (dev, p2, mask, ev, count);
- p1 = p1->nextSib;
- }
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XChangePointerDevice
- * function, if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXChangePointerDevice (client, size, rep)
- ClientPtr client;
- int size;
- xChangePointerDeviceReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/chgptr.h b/Xi/chgptr.h
deleted file mode 100644
index 3168e9710..000000000
--- a/Xi/chgptr.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CHGPTR_H
-#define CHGPTR_H 1
-
-int
-SProcXChangePointerDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXChangePointerDevice (
- ClientPtr /* client */
- );
-
-void
-DeleteFocusClassDeviceStruct(
- DeviceIntPtr /* dev */
- );
-
-void
-SendEventToAllWindows (
- DeviceIntPtr /* dev */,
- Mask /* mask */,
- xEvent * /* ev */,
- int /* count */
- );
-
-void
-FindInterestedChildren ( /* FIXME: could be static? */
- DeviceIntPtr /* dev */,
- WindowPtr /* p1 */,
- Mask /* mask */,
- xEvent * /* ev */,
- int /* count */
- );
-
-void
-SRepXChangePointerDevice (
- ClientPtr /* client */,
- int /* size */,
- xChangePointerDeviceReply * /* rep */
- );
-
-#endif /* CHGPTR_H */
diff --git a/Xi/closedev.c b/Xi/closedev.c
deleted file mode 100644
index 1f7e7dbd2..000000000
--- a/Xi/closedev.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* $Xorg: closedev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/closedev.c,v 3.4 2001/12/14 19:58:55 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to close an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "closedev.h"
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-SProcXCloseDevice(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xCloseDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
- return(ProcXCloseDevice(client));
- }
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-ProcXCloseDevice(client)
- register ClientPtr client;
- {
- int i;
- WindowPtr pWin, p1;
- DeviceIntPtr d;
-
- REQUEST(xCloseDeviceReq);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
-
- d = LookupDeviceIntRec (stuff->deviceid);
- if (d == NULL)
- {
- SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
- return Success;
- }
-
- if (d->grab && SameClient(d->grab, client))
- (*d->DeactivateGrab)(d); /* release active grab */
-
- /* Remove event selections from all windows for events from this device
- and selected by this client.
- Delete passive grabs from all windows for this device. */
-
- for (i=0; i<screenInfo.numScreens; i++)
- {
- pWin = WindowTable[i];
- DeleteDeviceEvents (d, pWin, client);
- p1 = pWin->firstChild;
- DeleteEventsFromChildren (d, p1, client);
- }
-
- CloseInputDevice (d, client);
- return Success;
- }
-
-/***********************************************************************
- *
- * Walk througth the window tree, deleting event selections for this client
- * from this device from all windows.
- *
- */
-
-void
-DeleteEventsFromChildren(dev, p1, client)
- DeviceIntPtr dev;
- WindowPtr p1;
- ClientPtr client;
- {
- WindowPtr p2;
-
- while (p1)
- {
- p2 = p1->firstChild;
- DeleteDeviceEvents (dev, p1, client);
- DeleteEventsFromChildren(dev, p2, client);
- p1 = p1->nextSib;
- }
- }
-
-/***********************************************************************
- *
- * Clear out event selections and passive grabs from a window for the
- * specified device.
- *
- */
-
-void
-DeleteDeviceEvents (dev, pWin, client)
- DeviceIntPtr dev;
- WindowPtr pWin;
- ClientPtr client;
- {
- InputClientsPtr others;
- OtherInputMasks *pOthers;
- GrabPtr grab, next;
-
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- for (others=pOthers->inputClients; others;
- others = others->next)
- if (SameClient(others,client))
- others->mask[dev->id] = NoEventMask;
-
- for (grab = wPassiveGrabs(pWin); grab; grab=next)
- {
- next = grab->next;
- if ((grab->device == dev) &&
- (client->clientAsMask == CLIENT_BITS(grab->resource)))
- FreeResource (grab->resource, RT_NONE);
- }
- }
diff --git a/Xi/closedev.h b/Xi/closedev.h
deleted file mode 100644
index 0295b2c8f..000000000
--- a/Xi/closedev.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef CLOSEDEV_H
-#define CLOSEDEV_H 1
-
-int
-SProcXCloseDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXCloseDevice(
- ClientPtr /* client */
- );
-
-void
-DeleteEventsFromChildren(
- DeviceIntPtr /* dev */,
- WindowPtr /* p1 */,
- ClientPtr /* client */
- );
-
-void
-DeleteDeviceEvents (
- DeviceIntPtr /* dev */,
- WindowPtr /* pWin */,
- ClientPtr /* client */
- );
-
-#endif /* CLOSEDEV_H */
diff --git a/Xi/devbell.c b/Xi/devbell.c
deleted file mode 100644
index 98520ec1c..000000000
--- a/Xi/devbell.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* $Xorg: devbell.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/devbell.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to change the keyboard device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "devbell.h"
-
-/***********************************************************************
- *
- * This procedure is invoked to swap the request bytes if the server and
- * client have a different byte order.
- *
- */
-
-int
-SProcXDeviceBell(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xDeviceBellReq);
- swaps(&stuff->length, n);
- return(ProcXDeviceBell(client));
- }
-
-/***********************************************************************
- *
- * This procedure rings a bell on an extension device.
- *
- */
-
-int
-ProcXDeviceBell (client)
- register ClientPtr client;
- {
- DeviceIntPtr dev;
- KbdFeedbackPtr k;
- BellFeedbackPtr b;
- int base;
- int newpercent;
- CARD8 class;
- pointer ctrl;
- BellProcPtr proc;
-
- REQUEST(xDeviceBellReq);
- REQUEST_SIZE_MATCH(xDeviceBellReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- client->errorValue = stuff->deviceid;
- SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadDevice);
- return Success;
- }
-
- if (stuff->percent < -100 || stuff->percent > 100)
- {
- client->errorValue = stuff->percent;
- SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
- return Success;
- }
- if (stuff->feedbackclass == KbdFeedbackClass)
- {
- for (k=dev->kbdfeed; k; k=k->next)
- if (k->ctrl.id == stuff->feedbackid)
- break;
- if (!k)
- {
- client->errorValue = stuff->feedbackid;
- SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
- return Success;
- }
- base = k->ctrl.bell;
- proc = k->BellProc;
- ctrl = (pointer) &(k->ctrl);
- class = KbdFeedbackClass;
- }
- else if (stuff->feedbackclass == BellFeedbackClass)
- {
- for (b=dev->bell; b; b=b->next)
- if (b->ctrl.id == stuff->feedbackid)
- break;
- if (!b)
- {
- client->errorValue = stuff->feedbackid;
- SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
- return Success;
- }
- base = b->ctrl.percent;
- proc = b->BellProc;
- ctrl = (pointer) &(b->ctrl);
- class = BellFeedbackClass;
- }
- else
- {
- client->errorValue = stuff->feedbackclass;
- SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
- return Success;
- }
- newpercent = (base * stuff->percent) / 100;
- if (stuff->percent < 0)
- newpercent = base + newpercent;
- else
- newpercent = base - newpercent + stuff->percent;
- (*proc)(newpercent, dev, ctrl, class);
-
- return Success;
- }
diff --git a/Xi/devbell.h b/Xi/devbell.h
deleted file mode 100644
index bbf6dea92..000000000
--- a/Xi/devbell.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef DEVBELL_H
-#define DEVBELL_H 1
-
-int
-SProcXDeviceBell (
- ClientPtr /* client */
- );
-
-int
-ProcXDeviceBell (
- ClientPtr /* client */
- );
-
-#endif /* DEVBELL_H */
diff --git a/Xi/exevents.c b/Xi/exevents.c
deleted file mode 100644
index d2b2fb58c..000000000
--- a/Xi/exevents.c
+++ /dev/null
@@ -1,1362 +0,0 @@
-/* $Xorg: exevents.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/exevents.c,v 3.11 2003/11/17 22:20:29 dawes Exp $ */
-
-/********************************************************************
- *
- * Routines to register and initialize extension input devices.
- * This also contains ProcessOtherEvent, the routine called from DDX
- * to route extension events.
- *
- */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "XI.h"
-#include "XIproto.h"
-#include "inputstr.h"
-#include "windowstr.h"
-#include "miscstruct.h"
-#include "region.h"
-#include "exevents.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "dixevents.h" /* DeliverFocusedEvent */
-#include "dixgrabs.h" /* CreateGrab() */
-
-#include "chgptr.h"
-
-#define WID(w) ((w) ? ((w)->drawable.id) : 0)
-#define AllModifiersMask ( \
- ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
- Mod3Mask | Mod4Mask | Mod5Mask )
-#define AllButtonsMask ( \
- Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask )
-#define Motion_Filter(class) (DevicePointerMotionMask | \
- (class)->state | (class)->motionMask)
-
-static Bool ShouldFreeInputMasks(
- WindowPtr /* pWin */,
- Bool /* ignoreSelectedEvents */
- );
-static Bool MakeInputMasks (
- WindowPtr /* pWin */
- );
-
-/**************************************************************************
- *
- * Procedures for extension device event routing.
- *
- */
-
-void
-RegisterOtherDevice (device)
- DeviceIntPtr device;
- {
- device->public.processInputProc = ProcessOtherEvent;
- device->public.realInputProc = ProcessOtherEvent;
- (device)->ActivateGrab = ActivateKeyboardGrab;
- (device)->DeactivateGrab = DeactivateKeyboardGrab;
- }
-
-/*ARGSUSED*/
-void
-ProcessOtherEvent (xE, other, count)
- xEventPtr xE;
- register DeviceIntPtr other;
- int count;
- {
- register BYTE *kptr;
- register int i;
- register CARD16 modifiers;
- register CARD16 mask;
- GrabPtr grab = other->grab;
- Bool deactivateDeviceGrab = FALSE;
- int key = 0, bit = 0, rootX, rootY;
- ButtonClassPtr b = other->button;
- KeyClassPtr k = other->key;
- ValuatorClassPtr v = other->valuator;
- deviceValuator *xV = (deviceValuator *) xE;
-
- if (xE->u.u.type != DeviceValuator) {
- GetSpritePosition(&rootX, &rootY);
- xE->u.keyButtonPointer.rootX = rootX;
- xE->u.keyButtonPointer.rootY = rootY;
- key = xE->u.u.detail;
- NoticeEventTime(xE);
- xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state |
- inputInfo.pointer->button->state;
- bit = 1 << (key & 7);
- }
- if (DeviceEventCallback)
- {
- DeviceEventInfoRec eventinfo;
- eventinfo.events = (xEventPtr) xE;
- eventinfo.count = count;
- CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
- }
- for (i=1; i<count; i++)
- if ((++xV)->type == DeviceValuator)
- {
- int first = xV->first_valuator;
- int *axisvals;
-
- if (xV->num_valuators && (!v || (xV->num_valuators && (first + xV->num_valuators > v->numAxes))))
- FatalError("Bad valuators reported for device %s\n",other->name);
- xV->device_state = 0;
- if (k)
- xV->device_state |= k->state;
- if (b)
- xV->device_state |= b->state;
- if (v && v->axisVal)
- {
- axisvals = v->axisVal;
- switch (xV->num_valuators) {
- case 6:
- *(axisvals+first+5) = xV->valuator5;
- case 5:
- *(axisvals+first+4) = xV->valuator4;
- case 4:
- *(axisvals+first+3) = xV->valuator3;
- case 3:
- *(axisvals+first+2) = xV->valuator2;
- case 2:
- *(axisvals+first+1) = xV->valuator1;
- case 1:
- *(axisvals+first) = xV->valuator0;
- case 0:
- default:
- break;
- }
- }
- }
-
- if (xE->u.u.type == DeviceKeyPress)
- {
- modifiers = k->modifierMap[key];
- kptr = &k->down[key >> 3];
- if (*kptr & bit) /* allow ddx to generate multiple downs */
- {
- if (!modifiers)
- {
- xE->u.u.type = DeviceKeyRelease;
- ProcessOtherEvent(xE, other, count);
- xE->u.u.type = DeviceKeyPress;
- /* release can have side effects, don't fall through */
- ProcessOtherEvent(xE, other, count);
- }
- return;
- }
- if (other->valuator)
- other->valuator->motionHintWindow = NullWindow;
- *kptr |= bit;
- k->prev_state = k->state;
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers)
- {
- /* This key affects modifier "i" */
- k->modifierKeyCount[i]++;
- k->state |= mask;
- modifiers &= ~mask;
- }
- }
- if (!grab && CheckDeviceGrabs(other, xE, 0, count))
- {
- other->activatingKey = key;
- return;
- }
- }
- else if (xE->u.u.type == DeviceKeyRelease)
- {
- kptr = &k->down[key >> 3];
- if (!(*kptr & bit)) /* guard against duplicates */
- return;
- modifiers = k->modifierMap[key];
- if (other->valuator)
- other->valuator->motionHintWindow = NullWindow;
- *kptr &= ~bit;
- k->prev_state = k->state;
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers)
- {
- /* This key affects modifier "i" */
- if (--k->modifierKeyCount[i] <= 0)
- {
- k->modifierKeyCount[i] = 0;
- k->state &= ~mask;
- }
- modifiers &= ~mask;
- }
- }
-
- if (other->fromPassiveGrab && (key == other->activatingKey))
- deactivateDeviceGrab = TRUE;
- }
- else if (xE->u.u.type == DeviceButtonPress)
- {
- kptr = &b->down[key >> 3];
- *kptr |= bit;
- if (other->valuator)
- other->valuator->motionHintWindow = NullWindow;
- b->buttonsDown++;
- b->motionMask = DeviceButtonMotionMask;
- xE->u.u.detail = b->map[key];
- if (xE->u.u.detail == 0)
- return;
- if (xE->u.u.detail <= 5)
- b->state |= (Button1Mask >> 1) << xE->u.u.detail;
- SetMaskForEvent(Motion_Filter(b),DeviceMotionNotify);
- if (!grab)
- if (CheckDeviceGrabs(other, xE, 0, count))
- return;
-
- }
- else if (xE->u.u.type == DeviceButtonRelease)
- {
- kptr = &b->down[key >> 3];
- *kptr &= ~bit;
- if (other->valuator)
- other->valuator->motionHintWindow = NullWindow;
- if (!--b->buttonsDown)
- b->motionMask = 0;
- xE->u.u.detail = b->map[key];
- if (xE->u.u.detail == 0)
- return;
- if (xE->u.u.detail <= 5)
- b->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
- SetMaskForEvent(Motion_Filter(b),DeviceMotionNotify);
- if (!b->state && other->fromPassiveGrab)
- deactivateDeviceGrab = TRUE;
- }
- else if (xE->u.u.type == ProximityIn)
- other->valuator->mode &= ~OutOfProximity;
- else if (xE->u.u.type == ProximityOut)
- other->valuator->mode |= OutOfProximity;
-
- if (grab)
- DeliverGrabbedEvent(xE, other, deactivateDeviceGrab, count);
- else if (other->focus)
- DeliverFocusedEvent(other, xE, GetSpriteWindow(), count);
- else
- DeliverDeviceEvents(GetSpriteWindow(), xE, NullGrab, NullWindow,
- other, count);
-
- if (deactivateDeviceGrab == TRUE)
- (*other->DeactivateGrab)(other);
- }
-
-int
-InitProximityClassDeviceStruct( DeviceIntPtr dev)
-{
- register ProximityClassPtr proxc;
-
- proxc = (ProximityClassPtr)xalloc(sizeof(ProximityClassRec));
- if (!proxc)
- return FALSE;
- dev->proximity = proxc;
- return TRUE;
-}
-
-void
-InitValuatorAxisStruct( DeviceIntPtr dev,
- int axnum,
- int minval,
- int maxval,
- int resolution,
- int min_res,
- int max_res )
-{
- register AxisInfoPtr ax = dev->valuator->axes + axnum;
-
- ax->min_value = minval;
- ax->max_value = maxval;
- ax->resolution = resolution;
- ax->min_resolution = min_res;
- ax->max_resolution = max_res;
-}
-
-static void
-FixDeviceStateNotify (
- DeviceIntPtr dev,
- deviceStateNotify *ev,
- KeyClassPtr k,
- ButtonClassPtr b,
- ValuatorClassPtr v,
- int first)
-{
- ev->type = DeviceStateNotify;
- ev->deviceid = dev->id;
- ev->time = currentTime.milliseconds;
- ev->classes_reported = 0;
- ev->num_keys = 0;
- ev->num_buttons = 0;
- ev->num_valuators = 0;
-
- if (b) {
- ev->classes_reported |= (1 << ButtonClass);
- ev->num_buttons = b->numButtons;
- memmove((char *) &ev->buttons[0], (char *) b->down, 4);
- }
- else if (k) {
- ev->classes_reported |= (1 << KeyClass);
- ev->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode;
- memmove((char *) &ev->keys[0], (char *) k->down, 4);
- }
- if (v) {
- int nval = v->numAxes - first;
- ev->classes_reported |= (1 << ValuatorClass);
- ev->classes_reported |= (dev->valuator->mode << ModeBitsShift);
- ev->num_valuators = nval < 3 ? nval : 3;
- switch (ev->num_valuators)
- {
- case 3:
- ev->valuator2 = v->axisVal[first+2];
- case 2:
- ev->valuator1 = v->axisVal[first+1];
- case 1:
- ev->valuator0 = v->axisVal[first];
- break;
- }
- }
- }
-
-static void
-FixDeviceValuator (
- DeviceIntPtr dev,
- deviceValuator *ev,
- ValuatorClassPtr v,
- int first)
-{
- int nval = v->numAxes - first;
-
- ev->type = DeviceValuator;
- ev->deviceid = dev->id;
- ev->num_valuators = nval < 3 ? nval : 3;
- ev->first_valuator = first;
- switch (ev->num_valuators) {
- case 3:
- ev->valuator2 = v->axisVal[first+2];
- case 2:
- ev->valuator1 = v->axisVal[first+1];
- case 1:
- ev->valuator0 = v->axisVal[first];
- break;
- }
- first += ev->num_valuators;
- }
-
-void
-DeviceFocusEvent(dev, type, mode, detail, pWin)
- DeviceIntPtr dev;
- int type, mode, detail;
- register WindowPtr pWin;
- {
- deviceFocus event;
-
- if (type == FocusIn)
- type = DeviceFocusIn;
- else
- type = DeviceFocusOut;
-
- event.deviceid = dev->id;
- event.mode = mode;
- event.type = type;
- event.detail = detail;
- event.window = pWin->drawable.id;
- event.time = currentTime.milliseconds;
-
- (void) DeliverEventsToWindow(pWin, (xEvent *)&event, 1,
- DeviceFocusChangeMask, NullGrab, dev->id);
-
- if ((type == DeviceFocusIn) &&
- (wOtherInputMasks(pWin)) &&
- (wOtherInputMasks(pWin)->inputEvents[dev->id] & DeviceStateNotifyMask))
- {
- int evcount = 1;
- deviceStateNotify *ev, *sev;
- deviceKeyStateNotify *kev;
- deviceButtonStateNotify *bev;
-
- KeyClassPtr k;
- ButtonClassPtr b;
- ValuatorClassPtr v;
- int nval=0, nkeys=0, nbuttons=0, first=0;
-
- if ((b=dev->button) != NULL) {
- nbuttons = b->numButtons;
- if (nbuttons > 32)
- evcount++;
- }
- if ((k=dev->key) != NULL) {
- nkeys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode;
- if (nkeys > 32)
- evcount++;
- if (nbuttons > 0) {
- evcount++;
- }
- }
- if ((v=dev->valuator) != NULL) {
- nval = v->numAxes;
-
- if (nval > 3)
- evcount++;
- if (nval > 6) {
- if (!(k && b))
- evcount++;
- if (nval > 9)
- evcount += ((nval - 7) / 3);
- }
- }
-
- sev = ev = (deviceStateNotify *) xalloc(evcount * sizeof(xEvent));
- FixDeviceStateNotify (dev, ev, NULL, NULL, NULL, first);
-
- if (b != NULL) {
- FixDeviceStateNotify (dev, ev++, NULL, b, v, first);
- first += 3;
- nval -= 3;
- if (nbuttons > 32) {
- (ev-1)->deviceid |= MORE_EVENTS;
- bev = (deviceButtonStateNotify *) ev++;
- bev->type = DeviceButtonStateNotify;
- bev->deviceid = dev->id;
- memmove((char *) &bev->buttons[0], (char *) &b->down[4], 28);
- }
- if (nval > 0) {
- (ev-1)->deviceid |= MORE_EVENTS;
- FixDeviceValuator (dev, (deviceValuator *) ev++, v, first);
- first += 3;
- nval -= 3;
- }
- }
-
- if (k != NULL) {
- FixDeviceStateNotify (dev, ev++, k, NULL, v, first);
- first += 3;
- nval -= 3;
- if (nkeys > 32) {
- (ev-1)->deviceid |= MORE_EVENTS;
- kev = (deviceKeyStateNotify *) ev++;
- kev->type = DeviceKeyStateNotify;
- kev->deviceid = dev->id;
- memmove((char *) &kev->keys[0], (char *) &k->down[4], 28);
- }
- if (nval > 0) {
- (ev-1)->deviceid |= MORE_EVENTS;
- FixDeviceValuator (dev, (deviceValuator *) ev++, v, first);
- first += 3;
- nval -= 3;
- }
- }
-
- while (nval > 0) {
- FixDeviceStateNotify (dev, ev++, NULL, NULL, v, first);
- first += 3;
- nval -= 3;
- if (nval > 0) {
- (ev-1)->deviceid |= MORE_EVENTS;
- FixDeviceValuator (dev, (deviceValuator *) ev++, v, first);
- first += 3;
- nval -= 3;
- }
- }
-
- (void) DeliverEventsToWindow(pWin, (xEvent *)sev, evcount,
- DeviceStateNotifyMask, NullGrab, dev->id);
- xfree (sev);
- }
- }
-
-int
-GrabButton(
- ClientPtr client,
- DeviceIntPtr dev,
- BYTE this_device_mode,
- BYTE other_devices_mode,
- CARD16 modifiers,
- DeviceIntPtr modifier_device,
- CARD8 button,
- Window grabWindow,
- BOOL ownerEvents,
- Cursor rcursor,
- Window rconfineTo,
- Mask eventMask)
-{
- WindowPtr pWin, confineTo;
- CursorPtr cursor;
- GrabPtr grab;
-
- if ((this_device_mode != GrabModeSync) &&
- (this_device_mode != GrabModeAsync))
- {
- client->errorValue = this_device_mode;
- return BadValue;
- }
- if ((other_devices_mode != GrabModeSync) &&
- (other_devices_mode != GrabModeAsync))
- {
- client->errorValue = other_devices_mode;
- return BadValue;
- }
- if ((modifiers != AnyModifier) &&
- (modifiers & ~AllModifiersMask))
- {
- client->errorValue = modifiers;
- return BadValue;
- }
- if ((ownerEvents != xFalse) && (ownerEvents != xTrue))
- {
- client->errorValue = ownerEvents;
- return BadValue;
- }
- pWin = LookupWindow(grabWindow, client);
- if (!pWin)
- return BadWindow;
- if (rconfineTo == None)
- confineTo = NullWindow;
- else
- {
- confineTo = LookupWindow(rconfineTo, client);
- if (!confineTo)
- return BadWindow;
- }
- if (rcursor == None)
- cursor = NullCursor;
- else
- {
- cursor = (CursorPtr)LookupIDByType(rcursor, RT_CURSOR);
- if (!cursor)
- {
- client->errorValue = rcursor;
- return BadCursor;
- }
- }
-
- grab = CreateGrab(client->index, dev, pWin, eventMask,
- (Bool)ownerEvents, (Bool) this_device_mode, (Bool)other_devices_mode,
- modifier_device, modifiers, DeviceButtonPress, button, confineTo,
- cursor);
- if (!grab)
- return BadAlloc;
- return AddPassiveGrabToList(grab);
- }
-
-int
-GrabKey(
- ClientPtr client,
- DeviceIntPtr dev,
- BYTE this_device_mode,
- BYTE other_devices_mode,
- CARD16 modifiers,
- DeviceIntPtr modifier_device,
- CARD8 key,
- Window grabWindow,
- BOOL ownerEvents,
- Mask mask)
-{
- WindowPtr pWin;
- GrabPtr grab;
- KeyClassPtr k = dev->key;
-
- if (k==NULL)
- return BadMatch;
- if ((other_devices_mode != GrabModeSync) &&
- (other_devices_mode != GrabModeAsync))
- {
- client->errorValue = other_devices_mode;
- return BadValue;
- }
- if ((this_device_mode != GrabModeSync) &&
- (this_device_mode != GrabModeAsync))
- {
- client->errorValue = this_device_mode;
- return BadValue;
- }
- if (((key > k->curKeySyms.maxKeyCode) ||
- (key < k->curKeySyms.minKeyCode))
- && (key != AnyKey))
- {
- client->errorValue = key;
- return BadValue;
- }
- if ((modifiers != AnyModifier) &&
- (modifiers & ~AllModifiersMask))
- {
- client->errorValue = modifiers;
- return BadValue;
- }
- if ((ownerEvents != xTrue) && (ownerEvents != xFalse))
- {
- client->errorValue = ownerEvents;
- return BadValue;
- }
- pWin = LookupWindow(grabWindow, client);
- if (!pWin)
- return BadWindow;
-
- grab = CreateGrab(client->index, dev, pWin,
- mask, ownerEvents, this_device_mode, other_devices_mode,
- modifier_device, modifiers, DeviceKeyPress, key, NullWindow,
- NullCursor);
- if (!grab)
- return BadAlloc;
- return AddPassiveGrabToList(grab);
- }
-
-int
-SelectForWindow(dev, pWin, client, mask, exclusivemasks, validmasks)
- DeviceIntPtr dev;
- WindowPtr pWin;
- ClientPtr client;
- Mask mask;
- Mask exclusivemasks;
- Mask validmasks;
-{
- int mskidx = dev->id;
- int i, ret;
- Mask check;
- InputClientsPtr others;
-
- if (mask & ~validmasks)
- {
- client->errorValue = mask;
- return BadValue;
- }
- check = (mask & exclusivemasks);
- if (wOtherInputMasks(pWin))
- {
- if (check & wOtherInputMasks(pWin)->inputEvents[mskidx])
- { /* It is illegal for two different
- clients to select on any of the
- events for maskcheck. However,
- it is OK, for some client to
- continue selecting on one of those
- events. */
- for (others = wOtherInputMasks(pWin)->inputClients; others;
- others = others->next)
- {
- if (!SameClient(others, client) && (check &
- others->mask[mskidx]))
- return BadAccess;
- }
- }
- for (others = wOtherInputMasks(pWin)->inputClients; others;
- others = others->next)
- {
- if (SameClient(others, client))
- {
- check = others->mask[mskidx];
- others->mask[mskidx] = mask;
- if (mask == 0)
- {
- for (i=0; i<EMASKSIZE; i++)
- if (i != mskidx && others->mask[i] != 0)
- break;
- if (i == EMASKSIZE)
- {
- RecalculateDeviceDeliverableEvents(pWin);
- if (ShouldFreeInputMasks(pWin, FALSE))
- FreeResource(others->resource, RT_NONE);
- return Success;
- }
- }
- goto maskSet;
- }
- }
- }
- check = 0;
- if ((ret = AddExtensionClient (pWin, client, mask, mskidx)) != Success)
- return ret;
-maskSet:
- if (dev->valuator)
- if ((dev->valuator->motionHintWindow == pWin) &&
- (mask & DevicePointerMotionHintMask) &&
- !(check & DevicePointerMotionHintMask) &&
- !dev->grab)
- dev->valuator->motionHintWindow = NullWindow;
- RecalculateDeviceDeliverableEvents(pWin);
- return Success;
-}
-
-int
-AddExtensionClient (pWin, client, mask, mskidx)
- WindowPtr pWin;
- ClientPtr client;
- Mask mask;
- int mskidx;
- {
- InputClientsPtr others;
-
- if (!pWin->optional && !MakeWindowOptional (pWin))
- return BadAlloc;
- others = (InputClients *) xalloc(sizeof(InputClients));
- if (!others)
- return BadAlloc;
- if (!pWin->optional->inputMasks && !MakeInputMasks (pWin))
- return BadAlloc;
- bzero((char *) &others->mask[0], sizeof(Mask)*EMASKSIZE);
- others->mask[mskidx] = mask;
- others->resource = FakeClientID(client->index);
- others->next = pWin->optional->inputMasks->inputClients;
- pWin->optional->inputMasks->inputClients = others;
- if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer)pWin))
- return BadAlloc;
- return Success;
- }
-
-static Bool
-MakeInputMasks (pWin)
- WindowPtr pWin;
- {
- struct _OtherInputMasks *imasks;
-
- imasks = (struct _OtherInputMasks *)
- xalloc (sizeof (struct _OtherInputMasks));
- if (!imasks)
- return FALSE;
- bzero((char *) imasks, sizeof (struct _OtherInputMasks));
- pWin->optional->inputMasks = imasks;
- return TRUE;
- }
-
-void
-RecalculateDeviceDeliverableEvents(pWin)
- WindowPtr pWin;
- {
- register InputClientsPtr others;
- struct _OtherInputMasks *inputMasks; /* default: NULL */
- register WindowPtr pChild, tmp;
- int i;
-
- pChild = pWin;
- while (1)
- {
- if ((inputMasks = wOtherInputMasks(pChild)) != 0)
- {
- for (others = inputMasks->inputClients; others;
- others = others->next)
- {
- for (i=0; i<EMASKSIZE; i++)
- inputMasks->inputEvents[i] |= others->mask[i];
- }
- for (i=0; i<EMASKSIZE; i++)
- inputMasks->deliverableEvents[i] = inputMasks->inputEvents[i];
- for (tmp = pChild->parent; tmp; tmp=tmp->parent)
- if (wOtherInputMasks(tmp))
- for (i=0; i<EMASKSIZE; i++)
- inputMasks->deliverableEvents[i] |=
- (wOtherInputMasks(tmp)->deliverableEvents[i]
- & ~inputMasks->dontPropagateMask[i] & PropagateMask[i]);
- }
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
- }
-
-int
-InputClientGone(pWin, id)
- register WindowPtr pWin;
- XID id;
- {
- register InputClientsPtr other, prev;
- if (!wOtherInputMasks(pWin))
- return(Success);
- prev = 0;
- for (other = wOtherInputMasks(pWin)->inputClients; other;
- other = other->next)
- {
- if (other->resource == id)
- {
- if (prev)
- {
- prev->next = other->next;
- xfree(other);
- }
- else if (!(other->next))
- {
- if (ShouldFreeInputMasks(pWin, TRUE))
- {
- wOtherInputMasks(pWin)->inputClients = other->next;
- xfree(wOtherInputMasks(pWin));
- pWin->optional->inputMasks = (OtherInputMasks *) NULL;
- CheckWindowOptionalNeed (pWin);
- xfree(other);
- }
- else
- {
- other->resource = FakeClientID(0);
- if (!AddResource(other->resource, RT_INPUTCLIENT,
- (pointer)pWin))
- return BadAlloc;
- }
- }
- else
- {
- wOtherInputMasks(pWin)->inputClients = other->next;
- xfree(other);
- }
- RecalculateDeviceDeliverableEvents(pWin);
- return(Success);
- }
- prev = other;
- }
- FatalError("client not on device event list");
- /*NOTREACHED*/
- }
-
-int
-SendEvent (client, d, dest, propagate, ev, mask, count)
- ClientPtr client;
- DeviceIntPtr d;
- Window dest;
- Bool propagate;
- xEvent *ev;
- Mask mask;
- int count;
- {
- WindowPtr pWin;
- WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
- WindowPtr spriteWin=GetSpriteWindow();
-
- if (dest == PointerWindow)
- pWin = spriteWin;
- else if (dest == InputFocus)
- {
- WindowPtr inputFocus;
-
- if (!d->focus)
- inputFocus = spriteWin;
- else
- inputFocus = d->focus->win;
-
- if (inputFocus == FollowKeyboardWin)
- inputFocus = inputInfo.keyboard->focus->win;
-
- if (inputFocus == NoneWin)
- return Success;
-
- /* If the input focus is PointerRootWin, send the event to where
- the pointer is if possible, then perhaps propogate up to root. */
- if (inputFocus == PointerRootWin)
- inputFocus = GetCurrentRootWindow();
-
- if (IsParent(inputFocus, spriteWin))
- {
- effectiveFocus = inputFocus;
- pWin = spriteWin;
- }
- else
- effectiveFocus = pWin = inputFocus;
- }
- else
- pWin = LookupWindow(dest, client);
- if (!pWin)
- return BadWindow;
- if ((propagate != xFalse) && (propagate != xTrue))
- {
- client->errorValue = propagate;
- return BadValue;
- }
- ev->u.u.type |= 0x80;
- if (propagate)
- {
- for (;pWin; pWin = pWin->parent)
- {
- if (DeliverEventsToWindow( pWin, ev, count, mask, NullGrab, d->id))
- return Success;
- if (pWin == effectiveFocus)
- return Success;
- if (wOtherInputMasks(pWin))
- mask &= ~wOtherInputMasks(pWin)->dontPropagateMask[d->id];
- if (!mask)
- break;
- }
- }
- else
- (void)(DeliverEventsToWindow( pWin, ev, count, mask, NullGrab, d->id));
- return Success;
- }
-
-int
-SetButtonMapping (client, dev, nElts, map)
- ClientPtr client;
- DeviceIntPtr dev;
- int nElts;
- BYTE *map;
- {
- register int i;
- ButtonClassPtr b = dev->button;
-
- if (b == NULL)
- return BadMatch;
-
- if (nElts != b->numButtons)
- {
- client->errorValue = nElts;
- return BadValue;
- }
- if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue))
- return BadValue;
- for (i=0; i < nElts; i++)
- if ((b->map[i + 1] != map[i]) &&
- BitIsOn(b->down, i + 1))
- return MappingBusy;
- for (i = 0; i < nElts; i++)
- b->map[i + 1] = map[i];
- return Success;
- }
-
-int
-SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
- ClientPtr client;
- DeviceIntPtr dev;
- int len;
- int rlen;
- int numKeyPerModifier;
- KeyCode *inputMap;
- KeyClassPtr *k;
-{
- KeyCode *map = NULL;
- int inputMapLen;
- register int i;
-
- *k = dev->key;
- if (*k == NULL)
- return BadMatch;
- if (len != ((numKeyPerModifier<<1) + rlen))
- return BadLength;
-
- inputMapLen = 8*numKeyPerModifier;
-
- /*
- * Now enforce the restriction that "all of the non-zero keycodes must be
- * in the range specified by min-keycode and max-keycode in the
- * connection setup (else a Value error)"
- */
- i = inputMapLen;
- while (i--) {
- if (inputMap[i]
- && (inputMap[i] < (*k)->curKeySyms.minKeyCode
- || inputMap[i] > (*k)->curKeySyms.maxKeyCode)) {
- client->errorValue = inputMap[i];
- return -1; /* BadValue collides with MappingFailed */
- }
- }
-
- /*
- * Now enforce the restriction that none of the old or new
- * modifier keys may be down while we change the mapping, and
- * that the DDX layer likes the choice.
- */
- if (!AllModifierKeysAreUp (dev, (*k)->modifierKeyMap,
- (int)(*k)->maxKeysPerModifier, inputMap, (int)numKeyPerModifier)
- ||
- !AllModifierKeysAreUp(dev, inputMap, (int)numKeyPerModifier,
- (*k)->modifierKeyMap, (int)(*k)->maxKeysPerModifier)) {
- return MappingBusy;
- } else {
- for (i = 0; i < inputMapLen; i++) {
- if (inputMap[i] && !LegalModifier(inputMap[i], (DevicePtr)dev)) {
- return MappingFailed;
- }
- }
- }
-
- /*
- * Now build the keyboard's modifier bitmap from the
- * list of keycodes.
- */
- if (inputMapLen) {
- map = (KeyCode *)xalloc(inputMapLen);
- if (!map)
- return BadAlloc;
- }
- if ((*k)->modifierKeyMap)
- xfree((*k)->modifierKeyMap);
- if (inputMapLen) {
- (*k)->modifierKeyMap = map;
- memmove((char *)(*k)->modifierKeyMap, (char *)inputMap, inputMapLen);
- } else
- (*k)->modifierKeyMap = NULL;
-
- (*k)->maxKeysPerModifier = numKeyPerModifier;
- for (i = 0; i < MAP_LENGTH; i++)
- (*k)->modifierMap[i] = 0;
- for (i = 0; i < inputMapLen; i++) if (inputMap[i]) {
- (*k)->modifierMap[inputMap[i]]
- |= (1<<(i/ (*k)->maxKeysPerModifier));
- }
-
- return(MappingSuccess);
- }
-
-void
-SendDeviceMappingNotify(
- CARD8 request,
- KeyCode firstKeyCode,
- CARD8 count,
- DeviceIntPtr dev)
-{
- xEvent event;
- deviceMappingNotify *ev = (deviceMappingNotify *) &event;
-
- ev->type = DeviceMappingNotify;
- ev->request = request;
- ev->deviceid = dev->id;
- ev->time = currentTime.milliseconds;
- if (request == MappingKeyboard)
- {
- ev->firstKeyCode = firstKeyCode;
- ev->count = count;
- }
-
- SendEventToAllWindows (dev, DeviceMappingNotifyMask, (xEvent *)ev, 1);
- }
-
-int
-ChangeKeyMapping(
- ClientPtr client,
- DeviceIntPtr dev,
- unsigned len,
- int type,
- KeyCode firstKeyCode,
- CARD8 keyCodes,
- CARD8 keySymsPerKeyCode,
- KeySym *map)
-{
- KeySymsRec keysyms;
- KeyClassPtr k = dev->key;
-
- if (k == NULL)
- return (BadMatch);
-
- if (len != (keyCodes * keySymsPerKeyCode))
- return BadLength;
-
- if ((firstKeyCode < k->curKeySyms.minKeyCode) ||
- (firstKeyCode + keyCodes - 1 > k->curKeySyms.maxKeyCode))
- {
- client->errorValue = firstKeyCode;
- return BadValue;
- }
- if (keySymsPerKeyCode == 0)
- {
- client->errorValue = 0;
- return BadValue;
- }
- keysyms.minKeyCode = firstKeyCode;
- keysyms.maxKeyCode = firstKeyCode + keyCodes - 1;
- keysyms.mapWidth = keySymsPerKeyCode;
- keysyms.map = map;
- if (!SetKeySymsMap(&k->curKeySyms, &keysyms))
- return BadAlloc;
- SendDeviceMappingNotify(MappingKeyboard, firstKeyCode, keyCodes,
- dev);
- return client->noClientException;
- }
-
-void
-DeleteWindowFromAnyExtEvents(pWin, freeResources)
- WindowPtr pWin;
- Bool freeResources;
- {
- int i;
- DeviceIntPtr dev;
- InputClientsPtr ic;
- struct _OtherInputMasks *inputMasks;
-
- for (dev=inputInfo.devices; dev; dev=dev->next)
- {
- if (dev == inputInfo.pointer ||
- dev == inputInfo.keyboard)
- continue;
- DeleteDeviceFromAnyExtEvents(pWin, dev);
- }
-
- for (dev=inputInfo.off_devices; dev; dev=dev->next)
- DeleteDeviceFromAnyExtEvents(pWin, dev);
-
- if (freeResources)
- while ((inputMasks = wOtherInputMasks(pWin)) != 0)
- {
- ic = inputMasks->inputClients;
- for (i=0; i<EMASKSIZE; i++)
- inputMasks->dontPropagateMask[i] = 0;
- FreeResource(ic->resource, RT_NONE);
- }
- }
-
-void
-DeleteDeviceFromAnyExtEvents(pWin, dev)
- WindowPtr pWin;
- DeviceIntPtr dev;
- {
- WindowPtr parent;
-
- /* Deactivate any grabs performed on this window, before making
- any input focus changes.
- Deactivating a device grab should cause focus events. */
-
- if (dev->grab && (dev->grab->window == pWin))
- (*dev->DeactivateGrab)(dev);
-
- /* If the focus window is a root window (ie. has no parent)
- then don't delete the focus from it. */
-
- if (dev->focus && (pWin==dev->focus->win) && (pWin->parent != NullWindow))
- {
- int focusEventMode = NotifyNormal;
-
- /* If a grab is in progress, then alter the mode of focus events. */
-
- if (dev->grab)
- focusEventMode = NotifyWhileGrabbed;
-
- switch (dev->focus->revert)
- {
- case RevertToNone:
- DoFocusEvents(dev, pWin, NoneWin, focusEventMode);
- dev->focus->win = NoneWin;
- dev->focus->traceGood = 0;
- break;
- case RevertToParent:
- parent = pWin;
- do
- {
- parent = parent->parent;
- dev->focus->traceGood--;
- } while (!parent->realized);
- DoFocusEvents(dev, pWin, parent, focusEventMode);
- dev->focus->win = parent;
- dev->focus->revert = RevertToNone;
- break;
- case RevertToPointerRoot:
- DoFocusEvents(dev, pWin, PointerRootWin, focusEventMode);
- dev->focus->win = PointerRootWin;
- dev->focus->traceGood = 0;
- break;
- case RevertToFollowKeyboard:
- if (inputInfo.keyboard->focus->win) {
- DoFocusEvents(dev, pWin, inputInfo.keyboard->focus->win,
- focusEventMode);
- dev->focus->win = FollowKeyboardWin;
- dev->focus->traceGood = 0;
- } else {
- DoFocusEvents(dev, pWin, NoneWin, focusEventMode);
- dev->focus->win = NoneWin;
- dev->focus->traceGood = 0;
- }
- break;
- }
- }
-
- if (dev->valuator)
- if (dev->valuator->motionHintWindow == pWin)
- dev->valuator->motionHintWindow = NullWindow;
- }
-
-int
-MaybeSendDeviceMotionNotifyHint (pEvents, mask)
- deviceKeyButtonPointer *pEvents;
- Mask mask;
- {
- DeviceIntPtr dev;
-
- dev = LookupDeviceIntRec (pEvents->deviceid & DEVICE_BITS);
- if (pEvents->type == DeviceMotionNotify)
- {
- if (mask & DevicePointerMotionHintMask)
- {
- if (WID(dev->valuator->motionHintWindow) == pEvents->event)
- {
- return 1; /* don't send, but pretend we did */
- }
- pEvents->detail = NotifyHint;
- }
- else
- {
- pEvents->detail = NotifyNormal;
- }
- }
- return (0);
- }
-
-void
-CheckDeviceGrabAndHintWindow (pWin, type, xE, grab, client, deliveryMask)
- WindowPtr pWin;
- int type;
- deviceKeyButtonPointer *xE;
- GrabPtr grab;
- ClientPtr client;
- Mask deliveryMask;
- {
- DeviceIntPtr dev;
-
- dev = LookupDeviceIntRec (xE->deviceid & DEVICE_BITS);
- if (type == DeviceMotionNotify)
- dev->valuator->motionHintWindow = pWin;
- else if ((type == DeviceButtonPress) && (!grab) &&
- (deliveryMask & DeviceButtonGrabMask))
- {
- GrabRec tempGrab;
-
- tempGrab.device = dev;
- tempGrab.resource = client->clientAsMask;
- tempGrab.window = pWin;
- tempGrab.ownerEvents = (deliveryMask & DeviceOwnerGrabButtonMask) ? TRUE : FALSE;
- tempGrab.eventMask = deliveryMask;
- tempGrab.keyboardMode = GrabModeAsync;
- tempGrab.pointerMode = GrabModeAsync;
- tempGrab.confineTo = NullWindow;
- tempGrab.cursor = NullCursor;
- (*dev->ActivateGrab)(dev, &tempGrab, currentTime, TRUE);
- }
- }
-
-Mask
-DeviceEventMaskForClient(dev, pWin, client)
- DeviceIntPtr dev;
- WindowPtr pWin;
- ClientPtr client;
- {
- register InputClientsPtr other;
-
- if (!wOtherInputMasks(pWin))
- return 0;
- for (other = wOtherInputMasks(pWin)->inputClients; other;
- other = other->next)
- {
- if (SameClient(other, client))
- return other->mask[dev->id];
- }
- return 0;
- }
-
-void
-MaybeStopDeviceHint(dev, client)
- register DeviceIntPtr dev;
- ClientPtr client;
-{
- WindowPtr pWin;
- GrabPtr grab = dev->grab;
- pWin = dev->valuator->motionHintWindow;
-
- if ((grab && SameClient(grab, client) &&
- ((grab->eventMask & DevicePointerMotionHintMask) ||
- (grab->ownerEvents &&
- (DeviceEventMaskForClient(dev, pWin, client) &
- DevicePointerMotionHintMask)))) ||
- (!grab &&
- (DeviceEventMaskForClient(dev, pWin, client) &
- DevicePointerMotionHintMask)))
- dev->valuator->motionHintWindow = NullWindow;
-}
-
-int
-DeviceEventSuppressForWindow(pWin, client, mask, maskndx)
- WindowPtr pWin;
- ClientPtr client;
- Mask mask;
- int maskndx;
- {
- struct _OtherInputMasks *inputMasks = wOtherInputMasks (pWin);
-
- if (mask & ~PropagateMask[maskndx])
- {
- client->errorValue = mask;
- return BadValue;
- }
-
- if (mask == 0)
- {
- if (inputMasks)
- inputMasks->dontPropagateMask[maskndx] = mask;
- }
- else
- {
- if (!inputMasks)
- AddExtensionClient (pWin, client, 0, 0);
- inputMasks = wOtherInputMasks(pWin);
- inputMasks->dontPropagateMask[maskndx] = mask;
- }
- RecalculateDeviceDeliverableEvents(pWin);
- if (ShouldFreeInputMasks(pWin, FALSE))
- FreeResource(inputMasks->inputClients->resource, RT_NONE);
- return Success;
- }
-
-static Bool
-ShouldFreeInputMasks (pWin, ignoreSelectedEvents)
- WindowPtr pWin;
- Bool ignoreSelectedEvents;
- {
- int i;
- Mask allInputEventMasks = 0;
- struct _OtherInputMasks *inputMasks = wOtherInputMasks (pWin);
-
- for (i=0; i<EMASKSIZE; i++)
- allInputEventMasks |= inputMasks->dontPropagateMask[i];
- if (!ignoreSelectedEvents)
- for (i=0; i<EMASKSIZE; i++)
- allInputEventMasks |= inputMasks->inputEvents[i];
- if (allInputEventMasks == 0)
- return TRUE;
- else
- return FALSE;
- }
diff --git a/Xi/exglobals.h b/Xi/exglobals.h
deleted file mode 100644
index f07618b84..000000000
--- a/Xi/exglobals.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/exglobals.h,v 3.3 1998/12/05 14:39:57 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/*****************************************************************
- *
- * Globals referenced elsewhere in the server.
- *
- */
-#ifndef EXGLOBALS_H
-#define EXGLOBALS_H 1
-
-extern int IReqCode;
-extern int BadDevice;
-extern int BadEvent;
-extern int BadMode;
-extern int DeviceBusy;
-extern int BadClass;
-
-extern Mask DevicePointerMotionMask;
-extern Mask DevicePointerMotionHintMask;
-extern Mask DeviceFocusChangeMask;
-extern Mask DeviceStateNotifyMask;
-extern Mask ChangeDeviceNotifyMask;
-extern Mask DeviceMappingNotifyMask;
-extern Mask DeviceOwnerGrabButtonMask;
-extern Mask DeviceButtonGrabMask;
-extern Mask DeviceButtonMotionMask;
-extern Mask PropagateMask[];
-
-extern int DeviceValuator;
-extern int DeviceKeyPress;
-extern int DeviceKeyRelease;
-extern int DeviceButtonPress;
-extern int DeviceButtonRelease;
-extern int DeviceMotionNotify;
-extern int DeviceFocusIn;
-extern int DeviceFocusOut;
-extern int ProximityIn;
-extern int ProximityOut;
-extern int DeviceStateNotify;
-extern int DeviceKeyStateNotify;
-extern int DeviceButtonStateNotify;
-extern int DeviceMappingNotify;
-extern int ChangeDeviceNotify;
-
-extern int RT_INPUTCLIENT;
-
-#if 0
-/* FIXME: in dix */
-extern InputInfo inputInfo;
-#endif
-
-#endif /* EXGLOBALS_H */
diff --git a/Xi/extinit.c b/Xi/extinit.c
deleted file mode 100644
index 01d51ba64..000000000
--- a/Xi/extinit.c
+++ /dev/null
@@ -1,1012 +0,0 @@
-/* $Xorg: extinit.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/extinit.c,v 3.7 2003/11/17 22:20:29 dawes Exp $ */
-
-/********************************************************************
- *
- * Dispatch routines and initialization routines for the X input extension.
- *
- */
-
-#define NUMTYPES 15
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h"
-#include "Xproto.h"
-#include "inputstr.h"
-#include "gcstruct.h" /* pointer for extnsionst.h*/
-#include "extnsionst.h" /* extension entry */
-#include "XI.h"
-#include "XIproto.h"
-
-#include "dixevents.h"
-#include "exevents.h"
-#include "extinit.h"
-#include "exglobals.h"
-#include "swaprep.h"
-
-/* modules local to Xi */
-#include "allowev.h"
-#include "chgdctl.h"
-#include "chgfctl.h"
-#include "chgkbd.h"
-#include "chgprop.h"
-#include "chgptr.h"
-#include "closedev.h"
-#include "devbell.h"
-#include "getbmap.h"
-#include "getbmap.h"
-#include "getdctl.h"
-#include "getfctl.h"
-#include "getfocus.h"
-#include "getkmap.h"
-#include "getmmap.h"
-#include "getprop.h"
-#include "getselev.h"
-#include "getvers.h"
-#include "getvers.h"
-#include "grabdev.h"
-#include "grabdevb.h"
-#include "grabdevk.h"
-#include "gtmotion.h"
-#include "listdev.h"
-#include "opendev.h"
-#include "queryst.h"
-#include "selectev.h"
-#include "sendexev.h"
-#include "chgkmap.h"
-#include "setbmap.h"
-#include "setdval.h"
-#include "setfocus.h"
-#include "setmmap.h"
-#include "setmode.h"
-#include "ungrdev.h"
-#include "ungrdevb.h"
-#include "ungrdevk.h"
-
-static Mask lastExtEventMask = 1;
-int ExtEventIndex;
-Mask ExtValidMasks[EMASKSIZE];
-Mask ExtExclusiveMasks[EMASKSIZE];
-
-struct dev_type
- {
- Atom type;
- char *name;
- }dev_type [] = {{0,XI_KEYBOARD},
- {0,XI_MOUSE},
- {0,XI_TABLET},
- {0,XI_TOUCHSCREEN},
- {0,XI_TOUCHPAD},
- {0,XI_BARCODE},
- {0,XI_BUTTONBOX},
- {0,XI_KNOB_BOX},
- {0,XI_ONE_KNOB},
- {0,XI_NINE_KNOB},
- {0,XI_TRACKBALL},
- {0,XI_QUADRATURE},
- {0,XI_ID_MODULE},
- {0,XI_SPACEBALL},
- {0,XI_DATAGLOVE},
- {0,XI_EYETRACKER},
- {0,XI_CURSORKEYS},
- {0,XI_FOOTMOUSE}};
-
-CARD8 event_base [numInputClasses];
-XExtEventInfo EventInfo[32];
-
-/*****************************************************************
- *
- * Globals referenced elsewhere in the server.
- *
- */
-
-int IReqCode = 0;
-int BadDevice = 0;
-int BadEvent = 1;
-int BadMode = 2;
-int DeviceBusy = 3;
-int BadClass = 4;
-
-Mask DevicePointerMotionMask;
-Mask DevicePointerMotionHintMask;
-Mask DeviceFocusChangeMask;
-Mask DeviceStateNotifyMask;
-Mask ChangeDeviceNotifyMask;
-Mask DeviceMappingNotifyMask;
-Mask DeviceOwnerGrabButtonMask;
-Mask DeviceButtonGrabMask;
-Mask DeviceButtonMotionMask;
-
-int DeviceValuator;
-int DeviceKeyPress;
-int DeviceKeyRelease;
-int DeviceButtonPress;
-int DeviceButtonRelease;
-int DeviceMotionNotify;
-int DeviceFocusIn;
-int DeviceFocusOut;
-int ProximityIn;
-int ProximityOut;
-int DeviceStateNotify;
-int DeviceKeyStateNotify;
-int DeviceButtonStateNotify;
-int DeviceMappingNotify;
-int ChangeDeviceNotify;
-
-int RT_INPUTCLIENT;
-
-/*****************************************************************
- *
- * Externs defined elsewhere in the X server.
- *
- */
-
-extern XExtensionVersion AllExtensionVersions[];
-
-Mask PropagateMask[MAX_DEVICES];
-
-/*****************************************************************
- *
- * Declarations of local routines.
- *
- */
-
-static XExtensionVersion thisversion =
- {XI_Present,
- XI_Add_XChangeDeviceControl_Major,
- XI_Add_XChangeDeviceControl_Minor};
-
-/**********************************************************************
- *
- * IExtensionInit - initialize the input extension.
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- * This extension has several events and errors.
- *
- */
-
-void
-XInputExtensionInit()
-{
- ExtensionEntry *extEntry;
-
- extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
- SProcIDispatch, IResetProc, StandardMinorOpcode);
- if (extEntry)
- {
- IReqCode = extEntry->base;
- AllExtensionVersions[IReqCode-128] = thisversion;
- MakeDeviceTypeAtoms ();
- RT_INPUTCLIENT = CreateNewResourceType((DeleteType)InputClientGone);
- FixExtensionEvents (extEntry);
- ReplySwapVector[IReqCode] = (ReplySwapPtr)SReplyIDispatch;
- EventSwapVector[DeviceValuator] = SEventIDispatch;
- EventSwapVector[DeviceKeyPress] = SEventIDispatch;
- EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
- EventSwapVector[DeviceButtonPress] = SEventIDispatch;
- EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
- EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
- EventSwapVector[DeviceFocusIn] = SEventIDispatch;
- EventSwapVector[DeviceFocusOut] = SEventIDispatch;
- EventSwapVector[ProximityIn] = SEventIDispatch;
- EventSwapVector[ProximityOut] = SEventIDispatch;
- EventSwapVector[DeviceStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
- EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
- }
- else
- {
- FatalError("IExtensionInit: AddExtensions failed\n");
- }
- }
-
-/*************************************************************************
- *
- * ProcIDispatch - main dispatch routine for requests to this extension.
- * This routine is used if server and client have the same byte ordering.
- *
- */
-
-int
-ProcIDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- if (stuff->data == X_GetExtensionVersion)
- return(ProcXGetExtensionVersion(client));
- if (stuff->data == X_ListInputDevices)
- return(ProcXListInputDevices(client));
- else if (stuff->data == X_OpenDevice)
- return(ProcXOpenDevice(client));
- else if (stuff->data == X_CloseDevice)
- return(ProcXCloseDevice(client));
- else if (stuff->data == X_SetDeviceMode)
- return(ProcXSetDeviceMode(client));
- else if (stuff->data == X_SelectExtensionEvent)
- return(ProcXSelectExtensionEvent(client));
- else if (stuff->data == X_GetSelectedExtensionEvents)
- return(ProcXGetSelectedExtensionEvents(client));
- else if (stuff->data == X_ChangeDeviceDontPropagateList)
- return(ProcXChangeDeviceDontPropagateList(client));
- else if (stuff->data == X_GetDeviceDontPropagateList)
- return(ProcXGetDeviceDontPropagateList(client));
- else if (stuff->data == X_GetDeviceMotionEvents)
- return(ProcXGetDeviceMotionEvents(client));
- else if (stuff->data == X_ChangeKeyboardDevice)
- return(ProcXChangeKeyboardDevice(client));
- else if (stuff->data == X_ChangePointerDevice)
- return(ProcXChangePointerDevice(client));
- else if (stuff->data == X_GrabDevice)
- return(ProcXGrabDevice(client));
- else if (stuff->data == X_UngrabDevice)
- return(ProcXUngrabDevice(client));
- else if (stuff->data == X_GrabDeviceKey)
- return(ProcXGrabDeviceKey(client));
- else if (stuff->data == X_UngrabDeviceKey)
- return(ProcXUngrabDeviceKey(client));
- else if (stuff->data == X_GrabDeviceButton)
- return(ProcXGrabDeviceButton(client));
- else if (stuff->data == X_UngrabDeviceButton)
- return(ProcXUngrabDeviceButton(client));
- else if (stuff->data == X_AllowDeviceEvents)
- return(ProcXAllowDeviceEvents(client));
- else if (stuff->data == X_GetDeviceFocus)
- return(ProcXGetDeviceFocus(client));
- else if (stuff->data == X_SetDeviceFocus)
- return(ProcXSetDeviceFocus(client));
- else if (stuff->data == X_GetFeedbackControl)
- return(ProcXGetFeedbackControl(client));
- else if (stuff->data == X_ChangeFeedbackControl)
- return(ProcXChangeFeedbackControl(client));
- else if (stuff->data == X_GetDeviceKeyMapping)
- return(ProcXGetDeviceKeyMapping(client));
- else if (stuff->data == X_ChangeDeviceKeyMapping)
- return(ProcXChangeDeviceKeyMapping(client));
- else if (stuff->data == X_GetDeviceModifierMapping)
- return(ProcXGetDeviceModifierMapping(client));
- else if (stuff->data == X_SetDeviceModifierMapping)
- return(ProcXSetDeviceModifierMapping(client));
- else if (stuff->data == X_GetDeviceButtonMapping)
- return(ProcXGetDeviceButtonMapping(client));
- else if (stuff->data == X_SetDeviceButtonMapping)
- return(ProcXSetDeviceButtonMapping(client));
- else if (stuff->data == X_QueryDeviceState)
- return(ProcXQueryDeviceState(client));
- else if (stuff->data == X_SendExtensionEvent)
- return(ProcXSendExtensionEvent(client));
- else if (stuff->data == X_DeviceBell)
- return(ProcXDeviceBell(client));
- else if (stuff->data == X_SetDeviceValuators)
- return(ProcXSetDeviceValuators(client));
- else if (stuff->data == X_GetDeviceControl)
- return(ProcXGetDeviceControl(client));
- else if (stuff->data == X_ChangeDeviceControl)
- return(ProcXChangeDeviceControl(client));
- else
- {
- SendErrorToClient(client, IReqCode, stuff->data, 0, BadRequest);
- }
- return(BadRequest);
- }
-
-/*******************************************************************************
- *
- * SProcXDispatch
- *
- * Main swapped dispatch routine for requests to this extension.
- * This routine is used if server and client do not have the same byte ordering.
- *
- */
-
-int
-SProcIDispatch(client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- if (stuff->data == X_GetExtensionVersion)
- return(SProcXGetExtensionVersion(client));
- if (stuff->data == X_ListInputDevices)
- return(SProcXListInputDevices(client));
- else if (stuff->data == X_OpenDevice)
- return(SProcXOpenDevice(client));
- else if (stuff->data == X_CloseDevice)
- return(SProcXCloseDevice(client));
- else if (stuff->data == X_SetDeviceMode)
- return(SProcXSetDeviceMode(client));
- else if (stuff->data == X_SelectExtensionEvent)
- return(SProcXSelectExtensionEvent(client));
- else if (stuff->data == X_GetSelectedExtensionEvents)
- return(SProcXGetSelectedExtensionEvents(client));
- else if (stuff->data == X_ChangeDeviceDontPropagateList)
- return(SProcXChangeDeviceDontPropagateList(client));
- else if (stuff->data == X_GetDeviceDontPropagateList)
- return(SProcXGetDeviceDontPropagateList(client));
- else if (stuff->data == X_GetDeviceMotionEvents)
- return(SProcXGetDeviceMotionEvents(client));
- else if (stuff->data == X_ChangeKeyboardDevice)
- return(SProcXChangeKeyboardDevice(client));
- else if (stuff->data == X_ChangePointerDevice)
- return(SProcXChangePointerDevice(client));
- else if (stuff->data == X_GrabDevice)
- return(SProcXGrabDevice(client));
- else if (stuff->data == X_UngrabDevice)
- return(SProcXUngrabDevice(client));
- else if (stuff->data == X_GrabDeviceKey)
- return(SProcXGrabDeviceKey(client));
- else if (stuff->data == X_UngrabDeviceKey)
- return(SProcXUngrabDeviceKey(client));
- else if (stuff->data == X_GrabDeviceButton)
- return(SProcXGrabDeviceButton(client));
- else if (stuff->data == X_UngrabDeviceButton)
- return(SProcXUngrabDeviceButton(client));
- else if (stuff->data == X_AllowDeviceEvents)
- return(SProcXAllowDeviceEvents(client));
- else if (stuff->data == X_GetDeviceFocus)
- return(SProcXGetDeviceFocus(client));
- else if (stuff->data == X_SetDeviceFocus)
- return(SProcXSetDeviceFocus(client));
- else if (stuff->data == X_GetFeedbackControl)
- return(SProcXGetFeedbackControl(client));
- else if (stuff->data == X_ChangeFeedbackControl)
- return(SProcXChangeFeedbackControl(client));
- else if (stuff->data == X_GetDeviceKeyMapping)
- return(SProcXGetDeviceKeyMapping(client));
- else if (stuff->data == X_ChangeDeviceKeyMapping)
- return(SProcXChangeDeviceKeyMapping(client));
- else if (stuff->data == X_GetDeviceModifierMapping)
- return(SProcXGetDeviceModifierMapping(client));
- else if (stuff->data == X_SetDeviceModifierMapping)
- return(SProcXSetDeviceModifierMapping(client));
- else if (stuff->data == X_GetDeviceButtonMapping)
- return(SProcXGetDeviceButtonMapping(client));
- else if (stuff->data == X_SetDeviceButtonMapping)
- return(SProcXSetDeviceButtonMapping(client));
- else if (stuff->data == X_QueryDeviceState)
- return(SProcXQueryDeviceState(client));
- else if (stuff->data == X_SendExtensionEvent)
- return(SProcXSendExtensionEvent(client));
- else if (stuff->data == X_DeviceBell)
- return(SProcXDeviceBell(client));
- else if (stuff->data == X_SetDeviceValuators)
- return(SProcXSetDeviceValuators(client));
- else if (stuff->data == X_GetDeviceControl)
- return(SProcXGetDeviceControl(client));
- else if (stuff->data == X_ChangeDeviceControl)
- return(SProcXChangeDeviceControl(client));
- else
- {
- SendErrorToClient(client, IReqCode, stuff->data, 0, BadRequest);
- }
- return(BadRequest);
- }
-
-/**********************************************************************
- *
- * SReplyIDispatch
- * Swap any replies defined in this extension.
- *
- */
-
-/* FIXME: this would be more concise and readable in ANSI C */
-#define DISPATCH(code) \
- if (rep->RepType == X_##code) \
- SRepX##code (client, len, (x##code##Reply *) rep)
-
-void
-SReplyIDispatch (client, len, rep)
- ClientPtr client;
- int len;
- xGrabDeviceReply *rep; /* All we look at is the type field */
-{ /* This is common to all replies */
- if (rep->RepType == X_GetExtensionVersion)
- SRepXGetExtensionVersion (client, len, (xGetExtensionVersionReply *)rep);
- else if (rep->RepType == X_ListInputDevices)
- SRepXListInputDevices (client, len, (xListInputDevicesReply *)rep);
- else if (rep->RepType == X_OpenDevice)
- SRepXOpenDevice (client, len, (xOpenDeviceReply *)rep);
- else if (rep->RepType == X_SetDeviceMode)
- SRepXSetDeviceMode (client, len, (xSetDeviceModeReply *) rep);
- else if (rep->RepType == X_GetSelectedExtensionEvents)
- SRepXGetSelectedExtensionEvents (client, len, (xGetSelectedExtensionEventsReply *) rep);
- else if (rep->RepType == X_GetDeviceDontPropagateList)
- SRepXGetDeviceDontPropagateList (client, len, (xGetDeviceDontPropagateListReply *)rep);
- else if (rep->RepType == X_GetDeviceMotionEvents)
- SRepXGetDeviceMotionEvents (client, len, (xGetDeviceMotionEventsReply *) rep);
- else if (rep->RepType == X_ChangeKeyboardDevice)
- SRepXChangeKeyboardDevice (client, len, (xChangeKeyboardDeviceReply *) rep);
- else if (rep->RepType == X_ChangePointerDevice)
- SRepXChangePointerDevice (client, len, (xChangePointerDeviceReply *)rep);
- else if (rep->RepType == X_GrabDevice)
- SRepXGrabDevice (client, len, (xGrabDeviceReply *)rep);
- else if (rep->RepType == X_GetDeviceFocus)
- SRepXGetDeviceFocus (client, len, (xGetDeviceFocusReply *)rep);
- else if (rep->RepType == X_GetFeedbackControl)
- SRepXGetFeedbackControl (client, len, (xGetFeedbackControlReply *)rep);
- else if (rep->RepType == X_GetDeviceKeyMapping)
- SRepXGetDeviceKeyMapping (client, len, (xGetDeviceKeyMappingReply *)rep);
- else if (rep->RepType == X_GetDeviceModifierMapping)
- SRepXGetDeviceModifierMapping (client, len, (xGetDeviceModifierMappingReply *)rep);
- else if (rep->RepType == X_SetDeviceModifierMapping)
- SRepXSetDeviceModifierMapping (client, len, (xSetDeviceModifierMappingReply *)rep);
- else if (rep->RepType == X_GetDeviceButtonMapping)
- SRepXGetDeviceButtonMapping (client, len, (xGetDeviceButtonMappingReply *)rep);
- else if (rep->RepType == X_SetDeviceButtonMapping)
- SRepXSetDeviceButtonMapping (client, len, (xSetDeviceButtonMappingReply *)rep);
- else if (rep->RepType == X_QueryDeviceState)
- SRepXQueryDeviceState (client, len, (xQueryDeviceStateReply *)rep);
- else if (rep->RepType == X_SetDeviceValuators)
- SRepXSetDeviceValuators (client, len, (xSetDeviceValuatorsReply *)rep);
- else if (rep->RepType == X_GetDeviceControl)
- SRepXGetDeviceControl (client, len, (xGetDeviceControlReply *)rep);
- else if (rep->RepType == X_ChangeDeviceControl)
- SRepXChangeDeviceControl (client, len, (xChangeDeviceControlReply *)rep);
- else
- {
- FatalError("XINPUT confused sending swapped reply");
- }
- }
-
-/*****************************************************************************
- *
- * SEventIDispatch
- *
- * Swap any events defined in this extension.
- */
-#define DO_SWAP(func,type) func ((type *)from, (type *)to)
-
-void
-SEventIDispatch (from, to)
- xEvent *from;
- xEvent *to;
-{
- int type = from->u.u.type & 0177;
-
- if (type == DeviceValuator)
- DO_SWAP(SEventDeviceValuator, deviceValuator);
- else if (type == DeviceKeyPress)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceKeyRelease)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceButtonPress)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceButtonRelease)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceMotionNotify)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceFocusIn)
- DO_SWAP(SEventFocus, deviceFocus);
- else if (type == DeviceFocusOut)
- DO_SWAP(SEventFocus, deviceFocus);
- else if (type == ProximityIn)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == ProximityOut)
- {
- SKeyButtonPtrEvent (from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- }
- else if (type == DeviceStateNotify)
- DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
- else if (type == DeviceKeyStateNotify)
- DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
- else if (type == DeviceButtonStateNotify)
- DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
- else if (type == DeviceMappingNotify)
- DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
- else if (type == ChangeDeviceNotify)
- DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
- else
- {
- FatalError("XInputExtension: Impossible event!\n");
- }
- }
-
-/************************************************************************
- *
- * This function swaps the DeviceValuator event.
- *
- */
-
-void
-SEventDeviceValuator (from, to)
- deviceValuator *from;
- deviceValuator *to;
- {
- register char n;
- register int i;
- INT32 *ip B32;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- swaps(&to->device_state,n);
- ip = &to->valuator0;
- for (i=0; i<6; i++)
- {
- swapl((ip+i),n); /* macro - braces are required */
- }
- }
-
-void
-SEventFocus (from, to)
- deviceFocus *from;
- deviceFocus *to;
-{
- register char n;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- swapl(&to->window, n);
- }
-
-void
-SDeviceStateNotifyEvent (from, to)
- deviceStateNotify *from;
- deviceStateNotify *to;
-{
- register int i;
- register char n;
- INT32 *ip B32;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- ip = &to->valuator0;
- for (i=0; i<3; i++)
- {
- swapl((ip+i),n); /* macro - braces are required */
- }
- }
-
-void
-SDeviceKeyStateNotifyEvent (from, to)
- deviceKeyStateNotify *from;
- deviceKeyStateNotify *to;
-{
- register char n;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- }
-
-void
-SDeviceButtonStateNotifyEvent (from, to)
- deviceButtonStateNotify *from;
- deviceButtonStateNotify *to;
-{
- register char n;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- }
-
-void
-SChangeDeviceNotifyEvent (from, to)
- changeDeviceNotify *from;
- changeDeviceNotify *to;
-{
- register char n;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- }
-
-void
-SDeviceMappingNotifyEvent (from, to)
- deviceMappingNotify *from;
- deviceMappingNotify *to;
-{
- register char n;
-
- *to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- }
-
-/************************************************************************
- *
- * This function sets up extension event types and masks.
- *
- */
-
-void
-FixExtensionEvents (extEntry)
- ExtensionEntry *extEntry;
-{
- Mask mask;
-
- DeviceValuator = extEntry->eventBase;
- DeviceKeyPress = DeviceValuator + 1;
- DeviceKeyRelease = DeviceKeyPress + 1;
- DeviceButtonPress = DeviceKeyRelease + 1;
- DeviceButtonRelease = DeviceButtonPress + 1;
- DeviceMotionNotify = DeviceButtonRelease + 1;
- DeviceFocusIn = DeviceMotionNotify + 1;
- DeviceFocusOut = DeviceFocusIn + 1;
- ProximityIn = DeviceFocusOut + 1;
- ProximityOut = ProximityIn + 1;
- DeviceStateNotify = ProximityOut + 1;
- DeviceMappingNotify = DeviceStateNotify + 1;
- ChangeDeviceNotify = DeviceMappingNotify + 1;
- DeviceKeyStateNotify = ChangeDeviceNotify + 1;
- DeviceButtonStateNotify = DeviceKeyStateNotify + 1;
-
- event_base[KeyClass] = DeviceKeyPress;
- event_base[ButtonClass] = DeviceButtonPress;
- event_base[ValuatorClass] = DeviceMotionNotify;
- event_base[ProximityClass] = ProximityIn;
- event_base[FocusClass] = DeviceFocusIn;
- event_base[OtherClass] = DeviceStateNotify;
-
- BadDevice += extEntry->errorBase;
- BadEvent += extEntry->errorBase;
- BadMode += extEntry->errorBase;
- DeviceBusy += extEntry->errorBase;
- BadClass += extEntry->errorBase;
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, DeviceKeyPress);
- AllowPropagateSuppress (mask);
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, DeviceKeyRelease);
- AllowPropagateSuppress (mask);
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, DeviceButtonPress);
- AllowPropagateSuppress (mask);
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, DeviceButtonRelease);
- AllowPropagateSuppress (mask);
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, ProximityIn);
- SetMaskForExtEvent (mask, ProximityOut);
- AllowPropagateSuppress (mask);
-
- mask = GetNextExtEventMask ();
- DeviceStateNotifyMask = mask;
- SetMaskForExtEvent (mask, DeviceStateNotify);
-
- mask = GetNextExtEventMask ();
- DevicePointerMotionMask = mask;
- SetMaskForExtEvent (mask, DeviceMotionNotify);
- AllowPropagateSuppress (mask);
-
- DevicePointerMotionHintMask = GetNextExtEventMask();
- SetEventInfo (DevicePointerMotionHintMask, _devicePointerMotionHint);
- SetEventInfo (GetNextExtEventMask(), _deviceButton1Motion);
- SetEventInfo (GetNextExtEventMask(), _deviceButton2Motion);
- SetEventInfo (GetNextExtEventMask(), _deviceButton3Motion);
- SetEventInfo (GetNextExtEventMask(), _deviceButton4Motion);
- SetEventInfo (GetNextExtEventMask(), _deviceButton5Motion);
- DeviceButtonMotionMask = GetNextExtEventMask();
- SetEventInfo (DeviceButtonMotionMask, _deviceButtonMotion);
-
- DeviceFocusChangeMask = GetNextExtEventMask ();
- SetMaskForExtEvent (DeviceFocusChangeMask, DeviceFocusIn);
- SetMaskForExtEvent (DeviceFocusChangeMask, DeviceFocusOut);
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, DeviceMappingNotify);
- DeviceMappingNotifyMask = mask;
-
- mask = GetNextExtEventMask ();
- SetMaskForExtEvent (mask, ChangeDeviceNotify);
- ChangeDeviceNotifyMask = mask;
-
- DeviceButtonGrabMask = GetNextExtEventMask();
- SetEventInfo (DeviceButtonGrabMask, _deviceButtonGrab);
- SetExclusiveAccess (DeviceButtonGrabMask);
-
- DeviceOwnerGrabButtonMask = GetNextExtEventMask();
- SetEventInfo (DeviceOwnerGrabButtonMask, _deviceOwnerGrabButton);
- SetEventInfo (0, _noExtensionEvent);
- }
-
-/************************************************************************
- *
- * This function restores extension event types and masks to their
- * initial state.
- *
- */
-
-void
-RestoreExtensionEvents ()
-{
- int i;
-
- IReqCode = 0;
-
- for (i=0; i<ExtEventIndex-1; i++)
- {
- if ((EventInfo[i].type >= LASTEvent) && (EventInfo[i].type < 128))
- SetMaskForEvent(0,EventInfo[i].type);
- EventInfo[i].mask = 0;
- EventInfo[i].type = 0;
- }
- ExtEventIndex = 0;
- lastExtEventMask = 1;
- DeviceValuator = 0;
- DeviceKeyPress = 1;
- DeviceKeyRelease = 2;
- DeviceButtonPress = 3;
- DeviceButtonRelease = 4;
- DeviceMotionNotify = 5;
- DeviceFocusIn = 6;
- DeviceFocusOut = 7;
- ProximityIn = 8;
- ProximityOut = 9;
- DeviceStateNotify = 10;
- DeviceMappingNotify = 11;
- ChangeDeviceNotify = 12;
- DeviceKeyStateNotify = 13;
- DeviceButtonStateNotify = 13;
-
- BadDevice = 0;
- BadEvent = 1;
- BadMode = 2;
- DeviceBusy = 3;
- BadClass = 4;
-
- }
-
-/***********************************************************************
- *
- * IResetProc.
- * Remove reply-swapping routine.
- * Remove event-swapping routine.
- *
- */
-
-void
-IResetProc(unused)
- ExtensionEntry *unused;
- {
-
- ReplySwapVector[IReqCode] = ReplyNotSwappd;
- EventSwapVector[DeviceValuator] = NotImplemented;
- EventSwapVector[DeviceKeyPress] = NotImplemented;
- EventSwapVector[DeviceKeyRelease] = NotImplemented;
- EventSwapVector[DeviceButtonPress] = NotImplemented;
- EventSwapVector[DeviceButtonRelease] = NotImplemented;
- EventSwapVector[DeviceMotionNotify] = NotImplemented;
- EventSwapVector[DeviceFocusIn] = NotImplemented;
- EventSwapVector[DeviceFocusOut] = NotImplemented;
- EventSwapVector[ProximityIn] = NotImplemented;
- EventSwapVector[ProximityOut] = NotImplemented;
- EventSwapVector[DeviceStateNotify] = NotImplemented;
- EventSwapVector[DeviceKeyStateNotify] = NotImplemented;
- EventSwapVector[DeviceButtonStateNotify] = NotImplemented;
- EventSwapVector[DeviceMappingNotify] = NotImplemented;
- EventSwapVector[ChangeDeviceNotify] = NotImplemented;
- RestoreExtensionEvents ();
- }
-
-/***********************************************************************
- *
- * Assign an id and type to an input device.
- *
- */
-
-void
-AssignTypeAndName (dev, type, name)
- DeviceIntPtr dev;
- Atom type;
- char *name;
-{
- dev->type = type;
- dev->name = (char *) xalloc(strlen(name)+1);
- strcpy (dev->name, name);
- }
-
-/***********************************************************************
- *
- * Make device type atoms.
- *
- */
-
-void
-MakeDeviceTypeAtoms ()
- {
- int i;
-
- for (i=0; i<NUMTYPES; i++)
- dev_type[i].type =
- MakeAtom (dev_type[i].name, strlen(dev_type[i].name), 1);
- }
-
-/**************************************************************************
- *
- * Return a DeviceIntPtr corresponding to a specified device id.
- * This will not return the pointer or keyboard, or devices that are not on.
- *
- */
-
-DeviceIntPtr
-LookupDeviceIntRec (
- CARD8 id)
-{
- DeviceIntPtr dev;
-
- for (dev=inputInfo.devices; dev; dev=dev->next)
- {
- if (dev->id == id)
- {
- if (id == inputInfo.pointer->id || id == inputInfo.keyboard->id)
- return (NULL);
- return (dev);
- }
- }
- return (NULL);
- }
-
-/**************************************************************************
- *
- * Allow the specified event to be restricted to being selected by one
- * client at a time.
- * The default is to allow more than one client to select the event.
- *
- */
-
-void
-SetExclusiveAccess (mask)
- Mask mask;
- {
- int i;
-
- for (i=0; i<MAX_DEVICES; i++)
- ExtExclusiveMasks[i] |= mask;
- }
-
-/**************************************************************************
- *
- * Allow the specified event to have its propagation suppressed.
- * The default is to not allow suppression of propagation.
- *
- */
-
-void
-AllowPropagateSuppress (mask)
- Mask mask;
- {
- int i;
-
- for (i=0; i<MAX_DEVICES; i++)
- PropagateMask[i] |= mask;
- }
-
-/**************************************************************************
- *
- * Return the next available extension event mask.
- *
- */
-
-Mask
-GetNextExtEventMask ()
- {
- int i;
- Mask mask = lastExtEventMask;
-
- if (lastExtEventMask == 0)
- {
- FatalError("GetNextExtEventMask: no more events are available.");
- }
- lastExtEventMask <<= 1;
-
- for (i=0; i<MAX_DEVICES; i++)
- ExtValidMasks[i] |= mask;
- return mask;
- }
-
-/**************************************************************************
- *
- * Assign the specified mask to the specified event.
- *
- */
-
-void
-SetMaskForExtEvent(mask, event)
- Mask mask;
- int event;
- {
-
- EventInfo[ExtEventIndex].mask = mask;
- EventInfo[ExtEventIndex++].type = event;
-
- if ((event < LASTEvent) || (event >= 128))
- FatalError("MaskForExtensionEvent: bogus event number");
- SetMaskForEvent(mask,event);
- }
-
-/**************************************************************************
- *
- * Record an event mask where there is no unique corresponding event type.
- * We can't call SetMaskForEvent, since that would clobber the existing
- * mask for that event. MotionHint and ButtonMotion are examples.
- *
- * Since extension event types will never be less than 64, we can use
- * 0-63 in the EventInfo array as the "type" to be used to look up this
- * mask. This means that the corresponding macros such as
- * DevicePointerMotionHint must have access to the same constants.
- *
- */
-
-void
-SetEventInfo(mask, constant)
- Mask mask;
- int constant;
- {
- EventInfo[ExtEventIndex].mask = mask;
- EventInfo[ExtEventIndex++].type = constant;
- }
diff --git a/Xi/getbmap.c b/Xi/getbmap.c
deleted file mode 100644
index fb22a1422..000000000
--- a/Xi/getbmap.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* $Xorg: getbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getbmap.c,v 3.3 2001/12/14 19:58:56 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to return the version of the extension.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getbmap.h"
-
-/***********************************************************************
- *
- * This procedure gets the button mapping for the specified device.
- *
- */
-
-int
-SProcXGetDeviceButtonMapping(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
- return(ProcXGetDeviceButtonMapping(client));
- }
-
-/***********************************************************************
- *
- * This procedure gets the button mapping for the specified device.
- *
- */
-
-int
-ProcXGetDeviceButtonMapping (client)
- register ClientPtr client;
- {
- DeviceIntPtr dev;
- xGetDeviceButtonMappingReply rep;
- ButtonClassPtr b;
-
- REQUEST(xGetDeviceButtonMappingReq);
- REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceButtonMapping;
- rep.nElts = 0;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
- BadDevice);
- return Success;
- }
-
- b = dev->button;
- if (b == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
- BadMatch);
- return Success;
- }
- rep.nElts = b->numButtons;
- rep.length = (rep.nElts + (4-1))/4;
- WriteReplyToClient (client, sizeof (xGetDeviceButtonMappingReply), &rep);
- (void)WriteToClient(client, rep.nElts,
- (char *)&b->map[1]);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceButtonMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceButtonMapping (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceButtonMappingReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getbmap.h b/Xi/getbmap.h
deleted file mode 100644
index 999a7c9f9..000000000
--- a/Xi/getbmap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETBMAP_H
-#define GETBMAP_H 1
-
-int
-SProcXGetDeviceButtonMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceButtonMapping (
- ClientPtr /* client */
- );
-
-void
-SRepXGetDeviceButtonMapping (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceButtonMappingReply * /* rep */
- );
-
-#endif /* GETBMAP_H */
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
deleted file mode 100644
index 5b24bffbe..000000000
--- a/Xi/getdctl.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $Xorg: getdctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getdctl.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */
-
-/********************************************************************
- *
- * Get Device control attributes for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getdctl.h"
-
-/***********************************************************************
- *
- * This procedure gets the control attributes for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetDeviceControl(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceControlReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetDeviceControlReq);
- swaps(&stuff->control, n);
- return(ProcXGetDeviceControl(client));
- }
-
-/***********************************************************************
- *
- * Get the state of the specified device control.
- *
- */
-
-int
-ProcXGetDeviceControl(client)
- ClientPtr client;
- {
- int total_length = 0;
- char *buf, *savbuf;
- register DeviceIntPtr dev;
- xGetDeviceControlReply rep;
-
- REQUEST(xGetDeviceControlReq);
- REQUEST_SIZE_MATCH(xGetDeviceControlReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
- BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- switch (stuff->control)
- {
- case DEVICE_RESOLUTION:
- if (!dev->valuator)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
- total_length = sizeof (xDeviceResolutionState) +
- (3 * sizeof(int) * dev->valuator->numAxes);
- break;
- default:
- SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
- BadValue);
- return Success;
- }
-
- buf = (char *) xalloc (total_length);
- if (!buf)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadAlloc);
- return Success;
- }
- savbuf=buf;
-
- switch (stuff->control)
- {
- case DEVICE_RESOLUTION:
- CopySwapDeviceResolution(client, dev->valuator, buf,
- total_length);
- break;
- default:
- break;
- }
-
- rep.length = (total_length+3) >> 2;
- WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure copies DeviceResolution data, swapping if necessary.
- *
- */
-
-void
-CopySwapDeviceResolution (client, v, buf, length)
- ClientPtr client;
- ValuatorClassPtr v;
- char *buf;
- int length;
- {
- register char n;
- AxisInfoPtr a;
- xDeviceResolutionState *r;
- int i, *iptr;
-
- r = (xDeviceResolutionState *) buf;
- r->control = DEVICE_RESOLUTION;
- r->length = length;
- r->num_valuators = v->numAxes;
- buf += sizeof (xDeviceResolutionState);
- iptr = (int *) buf;
- for (i=0,a=v->axes; i<v->numAxes; i++,a++)
- *iptr++ = a->resolution;
- for (i=0,a=v->axes; i<v->numAxes; i++,a++)
- *iptr++ = a->min_resolution;
- for (i=0,a=v->axes; i<v->numAxes; i++,a++)
- *iptr++ = a->max_resolution;
- if (client->swapped)
- {
- swaps (&r->control,n);
- swaps (&r->length,n);
- swapl (&r->num_valuators,n);
- iptr = (int *) buf;
- for (i=0; i < (3 * v->numAxes); i++,iptr++)
- {
- swapl (iptr,n);
- }
- }
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the xGetDeviceControl function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceControl (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceControlReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
-
diff --git a/Xi/getdctl.h b/Xi/getdctl.h
deleted file mode 100644
index 0318b4387..000000000
--- a/Xi/getdctl.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETDCTL_H
-#define GETDCTL_H 1
-
-int
-SProcXGetDeviceControl (
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceControl (
- ClientPtr /* client */
- );
-
-void
-CopySwapDeviceResolution (
- ClientPtr /* client */,
- ValuatorClassPtr /* v */,
- char * /* buf */,
- int /* length */
- );
-
-void
-SRepXGetDeviceControl (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceControlReply * /* rep */
- );
-
-#endif /* GETDCTL_H */
diff --git a/Xi/getfctl.c b/Xi/getfctl.c
deleted file mode 100644
index 59c2c122b..000000000
--- a/Xi/getfctl.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/* $Xorg: getfctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getfctl.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */
-
-/********************************************************************
- *
- * Get feedback control attributes for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getfctl.h"
-
-/***********************************************************************
- *
- * This procedure gets the control attributes for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetFeedbackControl(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetFeedbackControlReq);
- swaps(&stuff->length, n);
- return(ProcXGetFeedbackControl(client));
- }
-
-/***********************************************************************
- *
- * Get the feedback control state.
- *
- */
-
-int
-ProcXGetFeedbackControl(client)
- ClientPtr client;
- {
- int total_length = 0;
- char *buf, *savbuf;
- register DeviceIntPtr dev;
- KbdFeedbackPtr k;
- PtrFeedbackPtr p;
- IntegerFeedbackPtr i;
- StringFeedbackPtr s;
- BellFeedbackPtr b;
- LedFeedbackPtr l;
- xGetFeedbackControlReply rep;
-
- REQUEST(xGetFeedbackControlReq);
- REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetFeedbackControl, 0,
- BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetFeedbackControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.num_feedbacks = 0;
-
- for (k=dev->kbdfeed; k; k=k->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xKbdFeedbackState);
- }
- for (p=dev->ptrfeed; p; p=p->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xPtrFeedbackState);
- }
- for (s=dev->stringfeed; s; s=s->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xStringFeedbackState) +
- (s->ctrl.num_symbols_supported * sizeof (KeySym));
- }
- for (i=dev->intfeed; i; i=i->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xIntegerFeedbackState);
- }
- for (l=dev->leds; l; l=l->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xLedFeedbackState);
- }
- for (b=dev->bell; b; b=b->next)
- {
- rep.num_feedbacks++;
- total_length += sizeof(xBellFeedbackState);
- }
-
- if (total_length == 0)
- {
- SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0,
- BadMatch);
- return Success;
- }
-
- buf = (char *) xalloc (total_length);
- if (!buf)
- {
- SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0,
- BadAlloc);
- return Success;
- }
- savbuf=buf;
-
- for (k=dev->kbdfeed; k; k=k->next)
- CopySwapKbdFeedback (client, k, &buf);
- for (p=dev->ptrfeed; p; p=p->next)
- CopySwapPtrFeedback (client, p, &buf);
- for (s=dev->stringfeed; s; s=s->next)
- CopySwapStringFeedback (client, s, &buf);
- for (i=dev->intfeed; i; i=i->next)
- CopySwapIntegerFeedback (client, i, &buf);
- for (l=dev->leds; l; l=l->next)
- CopySwapLedFeedback (client, l, &buf);
- for (b=dev->bell; b; b=b->next)
- CopySwapBellFeedback (client, b, &buf);
-
- rep.length = (total_length+3) >> 2;
- WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure copies KbdFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapKbdFeedback (client, k, buf)
- ClientPtr client;
- KbdFeedbackPtr k;
- char **buf;
- {
- int i;
- register char n;
- xKbdFeedbackState *k2;
-
- k2 = (xKbdFeedbackState *) *buf;
- k2->class = KbdFeedbackClass;
- k2->length = sizeof (xKbdFeedbackState);
- k2->id = k->ctrl.id;
- k2->click = k->ctrl.click;
- k2->percent = k->ctrl.bell;
- k2->pitch = k->ctrl.bell_pitch;
- k2->duration = k->ctrl.bell_duration;
- k2->led_mask = k->ctrl.leds;
- k2->global_auto_repeat = k->ctrl.autoRepeat;
- for (i=0; i<32; i++)
- k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
- if (client->swapped)
- {
- swaps(&k2->length,n);
- swaps(&k2->pitch,n);
- swaps(&k2->duration,n);
- swapl(&k2->led_mask,n);
- swapl(&k2->led_values,n);
- }
- *buf += sizeof (xKbdFeedbackState);
- }
-
-/***********************************************************************
- *
- * This procedure copies PtrFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapPtrFeedback (client, p, buf)
- ClientPtr client;
- PtrFeedbackPtr p;
- char **buf;
- {
- register char n;
- xPtrFeedbackState *p2;
-
- p2 = (xPtrFeedbackState *) *buf;
- p2->class = PtrFeedbackClass;
- p2->length = sizeof (xPtrFeedbackState);
- p2->id = p->ctrl.id;
- p2->accelNum = p->ctrl.num;
- p2->accelDenom = p->ctrl.den;
- p2->threshold = p->ctrl.threshold;
- if (client->swapped)
- {
- swaps(&p2->length,n);
- swaps(&p2->accelNum,n);
- swaps(&p2->accelDenom,n);
- swaps(&p2->threshold,n);
- }
- *buf += sizeof (xPtrFeedbackState);
- }
-
-/***********************************************************************
- *
- * This procedure copies IntegerFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapIntegerFeedback (client, i, buf)
- ClientPtr client;
- IntegerFeedbackPtr i;
- char **buf;
- {
- register char n;
- xIntegerFeedbackState *i2;
-
- i2 = (xIntegerFeedbackState *) *buf;
- i2->class = IntegerFeedbackClass;
- i2->length = sizeof (xIntegerFeedbackState);
- i2->id = i->ctrl.id;
- i2->resolution = i->ctrl.resolution;
- i2->min_value = i->ctrl.min_value;
- i2->max_value = i->ctrl.max_value;
- if (client->swapped)
- {
- swaps(&i2->length,n);
- swapl(&i2->resolution,n);
- swapl(&i2->min_value,n);
- swapl(&i2->max_value,n);
- }
- *buf += sizeof (xIntegerFeedbackState);
- }
-
-/***********************************************************************
- *
- * This procedure copies StringFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapStringFeedback (client, s, buf)
- ClientPtr client;
- StringFeedbackPtr s;
- char **buf;
- {
- int i;
- register char n;
- xStringFeedbackState *s2;
- KeySym *kptr;
-
- s2 = (xStringFeedbackState *) *buf;
- s2->class = StringFeedbackClass;
- s2->length = sizeof (xStringFeedbackState) +
- s->ctrl.num_symbols_supported * sizeof (KeySym);
- s2->id = s->ctrl.id;
- s2->max_symbols = s->ctrl.max_symbols;
- s2->num_syms_supported = s->ctrl.num_symbols_supported;
- *buf += sizeof (xStringFeedbackState);
- kptr = (KeySym *) (*buf);
- for (i=0; i<s->ctrl.num_symbols_supported; i++)
- *kptr++ = *(s->ctrl.symbols_supported+i);
- if (client->swapped)
- {
- swaps(&s2->length,n);
- swaps(&s2->max_symbols,n);
- swaps(&s2->num_syms_supported,n);
- kptr = (KeySym *) (*buf);
- for (i=0; i<s->ctrl.num_symbols_supported; i++,kptr++)
- {
- swapl(kptr,n);
- }
- }
- *buf += (s->ctrl.num_symbols_supported * sizeof (KeySym));
- }
-
-/***********************************************************************
- *
- * This procedure copies LedFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapLedFeedback (client, l, buf)
- ClientPtr client;
- LedFeedbackPtr l;
- char **buf;
- {
- register char n;
- xLedFeedbackState *l2;
-
- l2 = (xLedFeedbackState *) *buf;
- l2->class = LedFeedbackClass;
- l2->length = sizeof (xLedFeedbackState);
- l2->id = l->ctrl.id;
- l2->led_values = l->ctrl.led_values;
- l2->led_mask = l->ctrl.led_mask;
- if (client->swapped)
- {
- swaps(&l2->length,n);
- swapl(&l2->led_values,n);
- swapl(&l2->led_mask,n);
- }
- *buf += sizeof (xLedFeedbackState);
- }
-
-/***********************************************************************
- *
- * This procedure copies BellFeedbackClass data, swapping if necessary.
- *
- */
-
-void
-CopySwapBellFeedback (client, b, buf)
- ClientPtr client;
- BellFeedbackPtr b;
- char **buf;
- {
- register char n;
- xBellFeedbackState *b2;
-
- b2 = (xBellFeedbackState *) *buf;
- b2->class = BellFeedbackClass;
- b2->length = sizeof (xBellFeedbackState);
- b2->id = b->ctrl.id;
- b2->percent = b->ctrl.percent;
- b2->pitch = b->ctrl.pitch;
- b2->duration = b->ctrl.duration;
- if (client->swapped)
- {
- swaps(&b2->length,n);
- swaps(&b2->pitch,n);
- swaps(&b2->duration,n);
- }
- *buf += sizeof (xBellFeedbackState);
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the xGetFeedbackControl function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetFeedbackControl (client, size, rep)
- ClientPtr client;
- int size;
- xGetFeedbackControlReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_feedbacks, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getfctl.h b/Xi/getfctl.h
deleted file mode 100644
index 6ba96b066..000000000
--- a/Xi/getfctl.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETFCTL_H
-#define GETFCTL_H 1
-
-int
-SProcXGetFeedbackControl(
- ClientPtr /* client */
- );
-
-int
-ProcXGetFeedbackControl(
- ClientPtr /* client */
- );
-
-void
-CopySwapKbdFeedback (
- ClientPtr /* client */,
- KbdFeedbackPtr /* k */,
- char ** /* buf */
- );
-
-void
-CopySwapPtrFeedback (
- ClientPtr /* client */,
- PtrFeedbackPtr /* p */,
- char ** /* buf */
- );
-
-void
-CopySwapIntegerFeedback (
- ClientPtr /* client */,
- IntegerFeedbackPtr /* i */,
- char ** /* buf */
- );
-
-void
-CopySwapStringFeedback (
- ClientPtr /* client */,
- StringFeedbackPtr /* s */,
- char ** /* buf */
- );
-
-void
-CopySwapLedFeedback (
- ClientPtr /* client */,
- LedFeedbackPtr /* l */,
- char ** /* buf */
- );
-
-void
-CopySwapBellFeedback (
- ClientPtr /* client */,
- BellFeedbackPtr /* b */,
- char ** /* buf */
- );
-
-void
-SRepXGetFeedbackControl (
- ClientPtr /* client */,
- int /* size */,
- xGetFeedbackControlReply * /* rep */
- );
-
-#endif /* GETFCTL_H */
diff --git a/Xi/getfocus.c b/Xi/getfocus.c
deleted file mode 100644
index 2b916da11..000000000
--- a/Xi/getfocus.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $Xorg: getfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getfocus.c,v 3.3 2001/12/14 19:58:56 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to get the focus for an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "windowstr.h" /* focus struct */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getfocus.h"
-
-/***********************************************************************
- *
- * This procedure gets the focus for a device.
- *
- */
-
-int
-SProcXGetDeviceFocus(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceFocusReq);
- swaps(&stuff->length, n);
- return(ProcXGetDeviceFocus(client));
- }
-
-/***********************************************************************
- *
- * This procedure gets the focus for a device.
- *
- */
-
-int
-ProcXGetDeviceFocus(client)
- ClientPtr client;
- {
- DeviceIntPtr dev;
- FocusClassPtr focus;
- xGetDeviceFocusReply rep;
-
- REQUEST(xGetDeviceFocusReq);
- REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL || !dev->focus)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceFocus, 0, BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceFocus;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- focus = dev->focus;
-
- if (focus->win == NoneWin)
- rep.focus = None;
- else if (focus->win == PointerRootWin)
- rep.focus = PointerRoot;
- else if (focus->win == FollowKeyboardWin)
- rep.focus = FollowKeyboard;
- else
- rep.focus = focus->win->drawable.id;
-
- rep.time = focus->time.milliseconds;
- rep.revertTo = focus->revert;
- WriteReplyToClient (client, sizeof(xGetDeviceFocusReply), &rep);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the GetDeviceFocus function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceFocus (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceFocusReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->focus, n);
- swapl(&rep->time, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getfocus.h b/Xi/getfocus.h
deleted file mode 100644
index d3df5ba5f..000000000
--- a/Xi/getfocus.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETFOCUS_H
-#define GETFOCUS_H 1
-
-int
-SProcXGetDeviceFocus(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceFocus(
- ClientPtr /* client */
- );
-
-void
-SRepXGetDeviceFocus (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceFocusReply * /* rep */
- );
-
-#endif /* GETFOCUS_H */
diff --git a/Xi/getkmap.c b/Xi/getkmap.c
deleted file mode 100644
index 4a7a7e296..000000000
--- a/Xi/getkmap.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* $Xorg: getkmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getkmap.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */
-
-/********************************************************************
- *
- * Get the key mapping for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "swaprep.h"
-
-#include "getkmap.h"
-
-/***********************************************************************
- *
- * This procedure gets the key mapping for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetDeviceKeyMapping(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceKeyMappingReq);
- swaps(&stuff->length, n);
- return(ProcXGetDeviceKeyMapping(client));
- }
-
-/***********************************************************************
- *
- * Get the device key mapping.
- *
- */
-
-int
-ProcXGetDeviceKeyMapping(client)
- register ClientPtr client;
- {
- xGetDeviceKeyMappingReply rep;
- DeviceIntPtr dev;
- KeySymsPtr k;
-
- REQUEST(xGetDeviceKeyMappingReq);
- REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
- BadDevice);
- return Success;
- }
-
- if (dev->key == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
- BadMatch);
- return Success;
- }
- k = &dev->key->curKeySyms;
-
- if ((stuff->firstKeyCode < k->minKeyCode) ||
- (stuff->firstKeyCode > k->maxKeyCode))
- {
- client->errorValue = stuff->firstKeyCode;
- SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
- BadValue);
- return Success;
- }
-
- if (stuff->firstKeyCode + stuff->count > k->maxKeyCode + 1)
- {
- client->errorValue = stuff->count;
- SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
- BadValue);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceKeyMapping;
- rep.sequenceNumber = client->sequence;
- rep.keySymsPerKeyCode = k->mapWidth;
- rep.length = (k->mapWidth * stuff->count); /* KeySyms are 4 bytes */
- WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
-
- client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
- WriteSwappedDataToClient(
- client,
- k->mapWidth * stuff->count * sizeof(KeySym),
- &k->map[(stuff->firstKeyCode - k->minKeyCode) *
- k->mapWidth]);
-
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceKeyMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceKeyMapping (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceKeyMappingReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
-
diff --git a/Xi/getkmap.h b/Xi/getkmap.h
deleted file mode 100644
index ebd02f3ef..000000000
--- a/Xi/getkmap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETKMAP_H
-#define GETKMAP_H 1
-
-int
-SProcXGetDeviceKeyMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceKeyMapping(
- ClientPtr /* client */
- );
-
-void
-SRepXGetDeviceKeyMapping (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceKeyMappingReply * /* rep */
- );
-
-#endif /* GETKMAP_H */
diff --git a/Xi/getmmap.c b/Xi/getmmap.c
deleted file mode 100644
index 67e36b442..000000000
--- a/Xi/getmmap.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Xorg: getmmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getmmap.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */
-
-/********************************************************************
- *
- * Get the modifier mapping for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h" /* Request macro */
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getmmap.h"
-
-/***********************************************************************
- *
- * This procedure gets the modifier mapping for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetDeviceModifierMapping(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
- return(ProcXGetDeviceModifierMapping(client));
- }
-
-/***********************************************************************
- *
- * Get the device Modifier mapping.
- *
- */
-
-int
-ProcXGetDeviceModifierMapping(client)
- ClientPtr client;
- {
- CARD8 maxkeys;
- DeviceIntPtr dev;
- xGetDeviceModifierMappingReply rep;
- KeyClassPtr kp;
-
- REQUEST(xGetDeviceModifierMappingReq);
- REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceModifierMapping, 0,
- BadDevice);
- return Success;
- }
-
- kp = dev->key;
- if (kp == NULL)
- {
- SendErrorToClient (client, IReqCode, X_GetDeviceModifierMapping, 0,
- BadMatch);
- return Success;
- }
- maxkeys = kp->maxKeysPerModifier;
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceModifierMapping;
- rep.numKeyPerModifier = maxkeys;
- rep.sequenceNumber = client->sequence;
- /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
- rep.length = 2*maxkeys;
-
- WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
-
- /* Reply with the (modified by DDX) map that SetModifierMapping passed in */
- WriteToClient(client, 8*maxkeys, (char *)kp->modifierKeyMap);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceModifierMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceModifierMapping (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceModifierMappingReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getmmap.h b/Xi/getmmap.h
deleted file mode 100644
index ff317e0c4..000000000
--- a/Xi/getmmap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETMMAP_H
-#define GETMMAP_H 1
-
-int
-SProcXGetDeviceModifierMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceModifierMapping(
- ClientPtr /* client */
- );
-
-void
-SRepXGetDeviceModifierMapping (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceModifierMappingReply * /* rep */
- );
-
-#endif /* GETMMAP_H */
diff --git a/Xi/getprop.c b/Xi/getprop.c
deleted file mode 100644
index a3f3226ea..000000000
--- a/Xi/getprop.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $Xorg: getprop.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getprop.c,v 3.6 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Function to return the dont-propagate-list for an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structs */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "swaprep.h"
-
-#include "getprop.h"
-
-extern XExtEventInfo EventInfo[];
-extern int ExtEventIndex;
-
-/***********************************************************************
- *
- * Handle a request from a client with a different byte order.
- *
- */
-
-int
-SProcXGetDeviceDontPropagateList(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
- return(ProcXGetDeviceDontPropagateList(client));
- }
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-ProcXGetDeviceDontPropagateList (client)
- register ClientPtr client;
- {
- CARD16 count = 0;
- int i;
- XEventClass *buf = NULL, *tbuf;
- WindowPtr pWin;
- xGetDeviceDontPropagateListReply rep;
- OtherInputMasks *others;
-
- REQUEST(xGetDeviceDontPropagateListReq);
- REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceDontPropagateList;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.count = 0;
-
- pWin = (WindowPtr) LookupWindow (stuff->window, client);
- if (!pWin)
- {
- client->errorValue = stuff->window;
- SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
- BadWindow);
- return Success;
- }
-
- if ((others = wOtherInputMasks(pWin)) != 0)
- {
- for (i=0; i<EMASKSIZE; i++)
- tbuf = ClassFromMask (NULL, others->dontPropagateMask[i], i,
- &count, COUNT);
- if (count)
- {
- rep.count = count;
- buf = (XEventClass *) xalloc (rep.count * sizeof(XEventClass));
- rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2;
-
- tbuf = buf;
- for (i=0; i<EMASKSIZE; i++)
- tbuf = ClassFromMask (tbuf, others->dontPropagateMask[i], i,
- NULL, CREATE);
- }
- }
-
- WriteReplyToClient (client, sizeof (xGetDeviceDontPropagateListReply),
- &rep);
-
- if (count)
- {
- client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
- WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
- xfree (buf);
- }
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure gets a list of event classes from a mask word.
- * A single mask may translate to more than one event class.
- *
- */
-
-XEventClass
-*ClassFromMask (buf, mask, maskndx, count, mode)
- XEventClass *buf;
- Mask mask;
- int maskndx;
- CARD16 *count;
- int mode;
- {
- int i,j;
- int id = maskndx;
- Mask tmask = 0x80000000;
-
- for (i=0; i<32; i++,tmask>>=1)
- if (tmask & mask)
- {
- for (j=0; j<ExtEventIndex; j++)
- if (EventInfo[j].mask == tmask)
- {
- if (mode == COUNT)
- (*count)++;
- else
- *buf++ = (id << 8) | EventInfo[j].type;
- }
- }
- return (buf);
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceDontPropagateList function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceDontPropagateList (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceDontPropagateListReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->count, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getprop.h b/Xi/getprop.h
deleted file mode 100644
index 452875bd9..000000000
--- a/Xi/getprop.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETPROP_H
-#define GETPROP_H 1
-
-int
-SProcXGetDeviceDontPropagateList(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceDontPropagateList (
- ClientPtr /* client */
- );
-
-XEventClass *
-ClassFromMask (
- XEventClass * /* buf */,
- Mask /* mask */,
- int /* maskndx */,
- CARD16 * /* count */,
- int /* mode */
- );
-
-void
-SRepXGetDeviceDontPropagateList (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceDontPropagateListReply * /* rep */
- );
-
-#endif /* GETPROP_H */
diff --git a/Xi/getselev.c b/Xi/getselev.c
deleted file mode 100644
index 75b9137a6..000000000
--- a/Xi/getselev.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getselev.c,v 3.6 2001/12/14 19:58:57 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: getselev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/***********************************************************************
- *
- * Extension function to get the current selected events for a given window.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "XI.h"
-#include "XIproto.h"
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window struct */
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "swaprep.h"
-
-#include "getprop.h"
-#include "getselev.h"
-
-/***********************************************************************
- *
- * This procedure gets the current selected extension events.
- *
- */
-
-int
-SProcXGetSelectedExtensionEvents(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetSelectedExtensionEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
- swapl(&stuff->window, n);
- return(ProcXGetSelectedExtensionEvents(client));
- }
-
-/***********************************************************************
- *
- * This procedure gets the current device select mask,
- * if the client and server have a different byte ordering.
- *
- */
-
-int
-ProcXGetSelectedExtensionEvents(client)
- register ClientPtr client;
- {
- int i;
- int total_length = 0;
- xGetSelectedExtensionEventsReply rep;
- WindowPtr pWin;
- XEventClass *buf = NULL;
- XEventClass *tclient;
- XEventClass *aclient;
- OtherInputMasks *pOthers;
- InputClientsPtr others;
-
- REQUEST(xGetSelectedExtensionEventsReq);
- REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_GetSelectedExtensionEvents;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.this_client_count = 0;
- rep.all_clients_count = 0;
-
- if (!(pWin = LookupWindow(stuff->window, client)))
- {
- SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
- BadWindow);
- return Success;
- }
-
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- {
- for (others = pOthers->inputClients; others; others=others->next)
- for (i=0; i<EMASKSIZE; i++)
- tclient = ClassFromMask (NULL, others->mask[i], i,
- &rep.all_clients_count, COUNT);
-
- for (others = pOthers->inputClients; others; others=others->next)
- if (SameClient(others, client))
- {
- for (i=0; i<EMASKSIZE; i++)
- tclient = ClassFromMask (NULL, others->mask[i], i,
- &rep.this_client_count, COUNT);
- break;
- }
-
- total_length = (rep.all_clients_count + rep.this_client_count) *
- sizeof (XEventClass);
- rep.length = (total_length + 3) >> 2;
- buf = (XEventClass *) xalloc (total_length);
-
- tclient = buf;
- aclient = buf + rep.this_client_count;
- if (others)
- for (i=0; i<EMASKSIZE; i++)
- tclient = ClassFromMask (tclient, others->mask[i], i, NULL, CREATE);
-
- for (others = pOthers->inputClients; others; others=others->next)
- for (i=0; i<EMASKSIZE; i++)
- aclient = ClassFromMask (aclient, others->mask[i], i, NULL, CREATE);
- }
-
- WriteReplyToClient (client, sizeof(xGetSelectedExtensionEventsReply), &rep);
-
- if (total_length)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient( client, total_length, buf);
- xfree (buf);
- }
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetSelectedExtensionEvents function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetSelectedExtensionEvents (client, size, rep)
- ClientPtr client;
- int size;
- xGetSelectedExtensionEventsReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->this_client_count, n);
- swaps(&rep->all_clients_count, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getselev.h b/Xi/getselev.h
deleted file mode 100644
index 5ed759c29..000000000
--- a/Xi/getselev.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETSELEV_H
-#define GETSELEV_H 1
-
-int
-SProcXGetSelectedExtensionEvents(
- ClientPtr /* client */
- );
-
-int
-ProcXGetSelectedExtensionEvents(
- ClientPtr /* client */
- );
-
-void
-SRepXGetSelectedExtensionEvents (
- ClientPtr /* client */,
- int /* size */,
- xGetSelectedExtensionEventsReply * /* rep */
- );
-
-#endif /* GETSELEV_H */
diff --git a/Xi/getvers.c b/Xi/getvers.c
deleted file mode 100644
index c220b5a81..000000000
--- a/Xi/getvers.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $Xorg: getvers.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/getvers.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to return the version of the extension.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "getvers.h"
-
-XExtensionVersion AllExtensionVersions[128];
-
-/***********************************************************************
- *
- * Handle a request from a client with a different byte order than us.
- *
- */
-
-int
-SProcXGetExtensionVersion(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetExtensionVersionReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
- swaps(&stuff->nbytes, n);
- return(ProcXGetExtensionVersion(client));
- }
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-ProcXGetExtensionVersion (client)
- register ClientPtr client;
- {
- xGetExtensionVersionReply rep;
-
- REQUEST(xGetExtensionVersionReq);
- REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
-
- if (stuff->length != (sizeof(xGetExtensionVersionReq) +
- stuff->nbytes + 3)>>2)
- {
- SendErrorToClient(client, IReqCode, X_GetExtensionVersion, 0,
- BadLength);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetExtensionVersion;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.major_version = 0;
- rep.minor_version = 0;
-
- rep.present = TRUE;
- if (rep.present)
- {
- rep.major_version =
- AllExtensionVersions[IReqCode-128].major_version;
- rep.minor_version =
- AllExtensionVersions[IReqCode-128].minor_version;
- }
- WriteReplyToClient (client, sizeof (xGetExtensionVersionReply), &rep);
-
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetExtensionVersion function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetExtensionVersion (client, size, rep)
- ClientPtr client;
- int size;
- xGetExtensionVersionReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/getvers.h b/Xi/getvers.h
deleted file mode 100644
index 2304c6639..000000000
--- a/Xi/getvers.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GETVERS_H
-#define GETVERS_H 1
-
-int
-SProcXGetExtensionVersion(
- ClientPtr /* client */
- );
-
-int
-ProcXGetExtensionVersion (
- ClientPtr /* client */
- );
-
-void
-SRepXGetExtensionVersion (
- ClientPtr /* client */,
- int /* size */,
- xGetExtensionVersionReply * /* rep */
- );
-
-#endif /* GETVERS_H */
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
deleted file mode 100644
index 80f948de5..000000000
--- a/Xi/grabdev.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $Xorg: grabdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/grabdev.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to grab an extension device.
- *
- */
-
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "dixevents.h" /* GrabDevice */
-
-#include "grabdev.h"
-
-extern XExtEventInfo EventInfo[];
-extern int ExtEventIndex;
-
-/***********************************************************************
- *
- * Swap the request if the requestor has a different byte order than us.
- *
- */
-
-int
-SProcXGrabDevice(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
-
- REQUEST(xGrabDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
- swapl(&stuff->grabWindow, n);
- swapl(&stuff->time, n);
- swaps(&stuff->event_count, n);
- p = (long *) &stuff[1];
- for (i=0; i<stuff->event_count; i++)
- {
- swapl(p, n);
- p++;
- }
-
- return(ProcXGrabDevice(client));
- }
-
-/***********************************************************************
- *
- * Grab an extension device.
- *
- */
-
-int
-ProcXGrabDevice(client)
- ClientPtr client;
- {
- int error;
- xGrabDeviceReply rep;
- DeviceIntPtr dev;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xGrabDeviceReq);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
-
- if (stuff->length !=(sizeof(xGrabDeviceReq)>>2) + stuff->event_count)
- {
- SendErrorToClient (client, IReqCode, X_GrabDevice, 0, BadLength);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GrabDevice;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDevice, 0, BadDevice);
- return Success;
- }
-
- if (CreateMaskFromList (client, (XEventClass *)&stuff[1],
- stuff->event_count, tmp, dev, X_GrabDevice) != Success)
- return Success;
-
- error = GrabDevice (client, dev, stuff->this_device_mode,
- stuff->other_devices_mode, stuff->grabWindow, stuff->ownerEvents,
- stuff->time, tmp[stuff->deviceid].mask, &rep.status);
-
- if (error != Success)
- {
- SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
- return Success;
- }
- WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
- return Success;
- }
-
-
-/***********************************************************************
- *
- * This procedure creates an event mask from a list of XEventClasses.
- *
- */
-
-int
-CreateMaskFromList (client, list, count, mask, dev, req)
- ClientPtr client;
- XEventClass *list;
- int count;
- struct tmask mask[];
- DeviceIntPtr dev;
- int req;
- {
- int i,j;
- int device;
- DeviceIntPtr tdev;
-
- for (i=0; i<EMASKSIZE; i++)
- {
- mask[i].mask = 0;
- mask[i].dev = NULL;
- }
-
- for (i=0; i<count; i++, list++)
- {
- device = *list >> 8;
- if (device > 255)
- {
- SendErrorToClient(client, IReqCode, req, 0, BadClass);
- return BadClass;
- }
- tdev = LookupDeviceIntRec (device);
- if (tdev==NULL || (dev != NULL && tdev != dev))
- {
- SendErrorToClient(client, IReqCode, req, 0, BadClass);
- return BadClass;
- }
-
- for (j=0; j<ExtEventIndex; j++)
- if (EventInfo[j].type == (*list & 0xff))
- {
- mask[device].mask |= EventInfo[j].mask;
- mask[device].dev = (Pointer) tdev;
- break;
- }
- }
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGrabDevice function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGrabDevice (client, size, rep)
- ClientPtr client;
- int size;
- xGrabDeviceReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/grabdev.h b/Xi/grabdev.h
deleted file mode 100644
index 1eddd24ac..000000000
--- a/Xi/grabdev.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GRABDEV_H
-#define GRABDEV_H 1
-
-int
-SProcXGrabDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXGrabDevice(
- ClientPtr /* client */
- );
-
-int
-CreateMaskFromList (
- ClientPtr /* client */,
- XEventClass * /* list */,
- int /* count */,
- struct tmask /* mask */[],
- DeviceIntPtr /* dev */,
- int /* req */
- );
-
-void
-SRepXGrabDevice (
- ClientPtr /* client */,
- int /* size */,
- xGrabDeviceReply * /* rep */
- );
-
-#endif /* GRABDEV_H */
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
deleted file mode 100644
index cbc4fd8bd..000000000
--- a/Xi/grabdevb.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $Xorg: grabdevb.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/grabdevb.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to grab a button on an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "exevents.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "grabdevb.h"
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order.
- *
- */
-
-int
-SProcXGrabDeviceButton(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
-
- REQUEST(xGrabDeviceButtonReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
- p = (long *) &stuff[1];
- for (i=0; i<stuff->event_count; i++)
- {
- swapl(p, n);
- p++;
- }
-
- return(ProcXGrabDeviceButton(client));
- }
-
-/***********************************************************************
- *
- * Grab a button on an extension device.
- *
- */
-
-int
-ProcXGrabDeviceButton(client)
- ClientPtr client;
- {
- int ret;
- DeviceIntPtr dev;
- DeviceIntPtr mdev;
- XEventClass *class;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xGrabDeviceButtonReq);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
-
- if (stuff->length !=(sizeof(xGrabDeviceButtonReq)>>2) + stuff->event_count)
- {
- SendErrorToClient (client, IReqCode, X_GrabDeviceButton, 0, BadLength);
- return Success;
- }
-
- dev = LookupDeviceIntRec (stuff->grabbed_device);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
- BadDevice);
- return Success;
- }
- if (stuff->modifier_device != UseXKeyboard)
- {
- mdev = LookupDeviceIntRec (stuff->modifier_device);
- if (mdev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
- BadDevice);
- return Success;
- }
- if (mdev->key == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
- BadMatch);
- return Success;
- }
- }
- else
- mdev = (DeviceIntPtr) LookupKeyboardDevice();
-
- class = (XEventClass *) (&stuff[1]); /* first word of values */
-
- if ((ret = CreateMaskFromList (client, class,
- stuff->event_count, tmp, dev, X_GrabDeviceButton)) != Success)
- return Success;
- ret = GrabButton(client, dev, stuff->this_device_mode,
- stuff->other_devices_mode, stuff->modifiers, mdev, stuff->button,
- stuff->grabWindow, stuff->ownerEvents, (Cursor)0, (Window)0,
- tmp[stuff->grabbed_device].mask);
-
- if (ret != Success)
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, ret);
- return(Success);
- }
diff --git a/Xi/grabdevb.h b/Xi/grabdevb.h
deleted file mode 100644
index 8782c12ac..000000000
--- a/Xi/grabdevb.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GRABDEVB_H
-#define GRABDEVB_H 1
-
-int
-SProcXGrabDeviceButton(
- ClientPtr /* client */
- );
-
-int
-ProcXGrabDeviceButton(
- ClientPtr /* client */
- );
-
-#endif /* GRABDEVB_H */
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
deleted file mode 100644
index d7481801b..000000000
--- a/Xi/grabdevk.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $Xorg: grabdevk.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/grabdevk.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to grab a key on an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "exevents.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "grabdevk.h"
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order.
- *
- */
-
-int
-SProcXGrabDeviceKey(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
-
- REQUEST(xGrabDeviceKeyReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
- p = (long *) &stuff[1];
- for (i=0; i<stuff->event_count; i++)
- {
- swapl(p, n);
- p++;
- }
- return(ProcXGrabDeviceKey(client));
- }
-
-/***********************************************************************
- *
- * Grab a key on an extension device.
- *
- */
-
-int
-ProcXGrabDeviceKey(client)
- ClientPtr client;
- {
- int ret;
- DeviceIntPtr dev;
- DeviceIntPtr mdev;
- XEventClass *class;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xGrabDeviceKeyReq);
- REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
-
- if (stuff->length !=(sizeof(xGrabDeviceKeyReq)>>2) + stuff->event_count)
- {
- SendErrorToClient (client, IReqCode, X_GrabDeviceKey, 0, BadLength);
- return Success;
- }
-
- dev = LookupDeviceIntRec (stuff->grabbed_device);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
- BadDevice);
- return Success;
- }
-
- if (stuff->modifier_device != UseXKeyboard)
- {
- mdev = LookupDeviceIntRec (stuff->modifier_device);
- if (mdev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
- BadDevice);
- return Success;
- }
- if (mdev->key == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
- BadMatch);
- return Success;
- }
- }
- else
- mdev = (DeviceIntPtr) LookupKeyboardDevice();
-
- class = (XEventClass *) (&stuff[1]); /* first word of values */
-
- if ((ret = CreateMaskFromList (client, class,
- stuff->event_count, tmp, dev, X_GrabDeviceKey)) != Success)
- return Success;
-
- ret = GrabKey(client, dev, stuff->this_device_mode,
- stuff->other_devices_mode, stuff->modifiers, mdev, stuff->key,
- stuff->grabWindow, stuff->ownerEvents, tmp[stuff->grabbed_device].mask);
-
- if (ret != Success)
- {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, ret);
- return Success;
- }
-
- return Success;
- }
diff --git a/Xi/grabdevk.h b/Xi/grabdevk.h
deleted file mode 100644
index eb8db9511..000000000
--- a/Xi/grabdevk.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GRABDEVK_H
-#define GRABDEVK_H 1
-
-int
-SProcXGrabDeviceKey(
- ClientPtr /* client */
- );
-
-int
-ProcXGrabDeviceKey(
- ClientPtr /* client */
- );
-
-#endif /* GRABDEVK_H */
diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c
deleted file mode 100644
index 1ddcca3ae..000000000
--- a/Xi/gtmotion.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* $Xorg: gtmotion.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/gtmotion.c,v 3.7 2001/12/14 19:58:57 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to get the motion history from an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "gtmotion.h"
-
-/***********************************************************************
- *
- * Swap the request if server and client have different byte ordering.
- *
- */
-
-int
-SProcXGetDeviceMotionEvents(client)
-register ClientPtr client;
- {
- register char n;
-
- REQUEST(xGetDeviceMotionEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- swapl(&stuff->start, n);
- swapl(&stuff->stop, n);
- return(ProcXGetDeviceMotionEvents(client));
- }
-
-/****************************************************************************
- *
- * Get the motion history for an extension pointer devices.
- *
- */
-
-int
-ProcXGetDeviceMotionEvents(client)
- ClientPtr client;
-{
- INT32 *coords = NULL, *bufptr;
- xGetDeviceMotionEventsReply rep;
- unsigned long i;
- int num_events, axes, size = 0, tsize;
- unsigned long nEvents;
- DeviceIntPtr dev;
- TimeStamp start, stop;
- int length = 0;
- ValuatorClassPtr v;
-
- REQUEST(xGetDeviceMotionEventsReq);
-
- REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadDevice);
- return Success;
- }
- v = dev->valuator;
- if (v==NULL || v->numAxes == 0)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadMatch);
- return Success;
- }
- if (dev->valuator->motionHintWindow)
- MaybeStopDeviceHint(dev, client);
- axes = v->numAxes;
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceMotionEvents;
- rep.sequenceNumber = client->sequence;
- rep.nEvents = 0;
- rep.axes = axes;
- rep.mode = v->mode & DeviceMode;
- rep.length = 0;
- start = ClientTimeToServerTime(stuff->start);
- stop = ClientTimeToServerTime(stuff->stop);
- if (CompareTimeStamps(start, stop) == LATER ||
- CompareTimeStamps(start, currentTime) == LATER)
- {
- WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
- return Success;
- }
- if (CompareTimeStamps(stop, currentTime) == LATER)
- stop = currentTime;
- num_events = v->numMotionEvents;
- if (num_events)
- {
- size = sizeof(Time) + (axes * sizeof (INT32));
- tsize = num_events * size;
- coords = (INT32 *) ALLOCATE_LOCAL(tsize);
- if (!coords)
- {
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadAlloc);
- return Success;
- }
- rep.nEvents = (v->GetMotionProc) (
- dev, (xTimecoord *)coords, /* XXX */
- start.milliseconds, stop.milliseconds, (ScreenPtr)NULL);
- }
- if (rep.nEvents > 0)
- {
- length = (rep.nEvents * size +3) >> 2;
- rep.length = length;
- }
- nEvents = rep.nEvents;
- WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
- if (nEvents)
- {
- if (client->swapped)
- {
- register char n;
-
- bufptr = coords;
- for (i=0; i<nEvents * (axes+1); i++)
- {
- swapl(bufptr, n);
- bufptr++;
- }
- }
- WriteToClient(client, length * 4, (char *)coords);
- }
- if (coords)
- DEALLOCATE_LOCAL(coords);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceMotionEvents function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceMotionEvents (client, size, rep)
- ClientPtr client;
- int size;
- xGetDeviceMotionEventsReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->nEvents, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/gtmotion.h b/Xi/gtmotion.h
deleted file mode 100644
index 7d85e566e..000000000
--- a/Xi/gtmotion.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef GTMOTION_H
-#define GTMOTION_H 1
-
-int
-SProcXGetDeviceMotionEvents(
- ClientPtr /* client */
- );
-
-int
-ProcXGetDeviceMotionEvents(
- ClientPtr /* client */
- );
-
-void
-SRepXGetDeviceMotionEvents (
- ClientPtr /* client */,
- int /* size */,
- xGetDeviceMotionEventsReply * /* rep */
- );
-
-#endif /* GTMOTION_H */
diff --git a/Xi/listdev.c b/Xi/listdev.c
deleted file mode 100644
index ac4c875a1..000000000
--- a/Xi/listdev.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/* $Xorg: listdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/listdev.c,v 3.4 2001/12/14 19:58:58 dawes Exp $ */
-
-/***********************************************************************
- *
- * Extension function to list the available input devices.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h" /* FIXME */
-
-#include "listdev.h"
-
-#define VPC 20 /* Max # valuators per chunk */
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-SProcXListInputDevices(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xListInputDevicesReq);
- swaps(&stuff->length, n);
- return(ProcXListInputDevices(client));
- }
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-ProcXListInputDevices (client)
- register ClientPtr client;
- {
- xListInputDevicesReply rep;
- int numdevs;
- int namesize = 1; /* need 1 extra byte for strcpy */
- int size = 0;
- int total_length;
- char *devbuf;
- char *classbuf;
- char *namebuf;
- char *savbuf;
- xDeviceInfo *dev;
- DeviceIntPtr d;
-
- REQUEST_SIZE_MATCH(xListInputDevicesReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_ListInputDevices;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- AddOtherInputDevices ();
- numdevs = inputInfo.numDevices;
-
- for (d=inputInfo.devices; d; d=d->next)
- SizeDeviceInfo (d, &namesize, &size);
- for (d=inputInfo.off_devices; d; d=d->next)
- SizeDeviceInfo (d, &namesize, &size);
-
- total_length = numdevs * sizeof (xDeviceInfo) + size + namesize;
- devbuf = (char *) xalloc (total_length);
- classbuf = devbuf + (numdevs * sizeof (xDeviceInfo));
- namebuf = classbuf + size;
- savbuf = devbuf;
-
- dev = (xDeviceInfoPtr) devbuf;
- for (d=inputInfo.devices; d; d=d->next,dev++)
- ListDeviceInfo (client, d, dev, &devbuf, &classbuf, &namebuf);
- for (d=inputInfo.off_devices; d; d=d->next,dev++)
- ListDeviceInfo (client, d, dev, &devbuf, &classbuf, &namebuf);
-
- rep.ndevices = numdevs;
- rep.length = (total_length + 3) >> 2;
- WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure calculates the size of the information to be returned
- * for an input device.
- *
- */
-
-void
-SizeDeviceInfo (d, namesize, size)
- DeviceIntPtr d;
- int *namesize;
- int *size;
- {
- int chunks;
-
- *namesize += 1;
- if (d->name)
- *namesize += strlen (d->name);
- if (d->key != NULL)
- *size += sizeof (xKeyInfo);
- if (d->button != NULL)
- *size += sizeof (xButtonInfo);
- if (d->valuator != NULL)
- {
- chunks = ((int) d->valuator->numAxes + 19) / VPC;
- *size += (chunks * sizeof(xValuatorInfo) +
- d->valuator->numAxes * sizeof(xAxisInfo));
- }
- }
-
-/***********************************************************************
- *
- * This procedure lists information to be returned for an input device.
- *
- */
-
-void
-ListDeviceInfo (client, d, dev, devbuf, classbuf, namebuf)
- ClientPtr client;
- DeviceIntPtr d;
- xDeviceInfoPtr dev;
- char **devbuf;
- char **classbuf;
- char **namebuf;
- {
- CopyDeviceName (namebuf, d->name);
- CopySwapDevice (client, d, 0, devbuf);
- if (d->key != NULL)
- {
- CopySwapKeyClass(client, d->key, classbuf);
- dev->num_classes++;
- }
- if (d->button != NULL)
- {
- CopySwapButtonClass(client, d->button, classbuf);
- dev->num_classes++;
- }
- if (d->valuator != NULL)
- {
- dev->num_classes += CopySwapValuatorClass(client, d->valuator, classbuf);
- }
- }
-
-/***********************************************************************
- *
- * This procedure copies data to the DeviceInfo struct, swapping if necessary.
- *
- * We need the extra byte in the allocated buffer, because the trailing null
- * hammers one extra byte, which is overwritten by the next name except for
- * the last name copied.
- *
- */
-
-void
-CopyDeviceName (namebuf, name)
- char **namebuf;
- char *name;
- {
- char *nameptr = (char *) *namebuf;
-
- if (name)
- {
- *nameptr++ = strlen (name);
- strcpy (nameptr, name);
- *namebuf += (strlen (name)+1);
- }
- else
- {
- *nameptr++ = 0;
- *namebuf += 1;
- }
- }
-
-/***********************************************************************
- *
- * This procedure copies data to the DeviceInfo struct, swapping if necessary.
- *
- */
-
-void
-CopySwapDevice (client, d, num_classes, buf)
- register ClientPtr client;
- DeviceIntPtr d;
- int num_classes;
- char **buf;
- {
- register char n;
- xDeviceInfoPtr dev;
-
- dev = (xDeviceInfoPtr) *buf;
-
- dev->id = d->id;
- dev->type = d->type;
- dev->num_classes = num_classes;
- if (d == inputInfo.keyboard)
- dev->use = IsXKeyboard;
- else if (d == inputInfo.pointer)
- dev->use = IsXPointer;
- else
- dev->use = IsXExtensionDevice;
- if (client->swapped)
- {
- swapl(&dev->type, n); /* macro - braces are required */
- }
- *buf += sizeof (xDeviceInfo);
- }
-
-/***********************************************************************
- *
- * This procedure copies KeyClass information, swapping if necessary.
- *
- */
-
-void
-CopySwapKeyClass (client, k, buf)
- register ClientPtr client;
- KeyClassPtr k;
- char **buf;
- {
- register char n;
- xKeyInfoPtr k2;
-
- k2 = (xKeyInfoPtr) *buf;
- k2->class = KeyClass;
- k2->length = sizeof (xKeyInfo);
- k2->min_keycode = k->curKeySyms.minKeyCode;
- k2->max_keycode = k->curKeySyms.maxKeyCode;
- k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
- if (client->swapped)
- {
- swaps(&k2->num_keys,n);
- }
- *buf += sizeof (xKeyInfo);
- }
-
-/***********************************************************************
- *
- * This procedure copies ButtonClass information, swapping if necessary.
- *
- */
-
-void
-CopySwapButtonClass (client, b, buf)
- register ClientPtr client;
- ButtonClassPtr b;
- char **buf;
- {
- register char n;
- xButtonInfoPtr b2;
-
- b2 = (xButtonInfoPtr) *buf;
- b2->class = ButtonClass;
- b2->length = sizeof (xButtonInfo);
- b2->num_buttons = b->numButtons;
- if (client->swapped)
- {
- swaps(&b2->num_buttons,n); /* macro - braces are required */
- }
- *buf += sizeof (xButtonInfo);
- }
-
-/***********************************************************************
- *
- * This procedure copies ValuatorClass information, swapping if necessary.
- *
- * Devices may have up to 255 valuators. The length of a ValuatorClass is
- * defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
- * The maximum length is therefore (8 + 255 * 12) = 3068. However, the
- * length field is one byte. If a device has more than 20 valuators, we
- * must therefore return multiple valuator classes to the client.
- *
- */
-
-int
-CopySwapValuatorClass (client, v, buf)
- register ClientPtr client;
- ValuatorClassPtr v;
- char **buf;
-{
- int i, j, axes, t_axes;
- register char n;
- xValuatorInfoPtr v2;
- AxisInfo *a;
- xAxisInfoPtr a2;
-
- for (i=0,axes=v->numAxes; i < ((v->numAxes+19)/VPC); i++, axes-=VPC) {
- t_axes = axes < VPC ? axes : VPC;
- if (t_axes < 0)
- t_axes = v->numAxes % VPC;
- v2 = (xValuatorInfoPtr) *buf;
- v2->class = ValuatorClass;
- v2->length = sizeof (xValuatorInfo) + t_axes * sizeof (xAxisInfo);
- v2->num_axes = t_axes;
- v2->mode = v->mode & DeviceMode;
- v2->motion_buffer_size = v->numMotionEvents;
- if (client->swapped)
- {
- swapl(&v2->motion_buffer_size,n);
- }
- *buf += sizeof (xValuatorInfo);
- a = v->axes + (VPC * i);
- a2 = (xAxisInfoPtr) *buf;
- for (j=0; j<t_axes; j++) {
- a2->min_value = a->min_value;
- a2->max_value = a->max_value;
- a2->resolution = a->resolution;
- if (client->swapped) {
- swapl(&a2->min_value,n);
- swapl(&a2->max_value,n);
- swapl(&a2->resolution,n);
- }
- a2++;
- a++;
- *buf += sizeof (xAxisInfo);
- }
- }
- return (i);
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XListInputDevices function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXListInputDevices (client, size, rep)
- ClientPtr client;
- int size;
- xListInputDevicesReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/listdev.h b/Xi/listdev.h
deleted file mode 100644
index c9553b692..000000000
--- a/Xi/listdev.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef LISTDEV_H
-#define LISTDEV_H 1
-
-int
-SProcXListInputDevices(
- ClientPtr /* client */
- );
-
-int
-ProcXListInputDevices (
- ClientPtr /* client */
- );
-
-void
-SizeDeviceInfo (
- DeviceIntPtr /* d */,
- int * /* namesize */,
- int * /* size */
- );
-
-void
-ListDeviceInfo (
- ClientPtr /* client */,
- DeviceIntPtr /* d */,
- xDeviceInfoPtr /* dev */,
- char ** /* devbuf */,
- char ** /* classbuf */,
- char ** /* namebuf */
- );
-
-void
-CopyDeviceName (
- char ** /* namebuf */,
- char * /* name */
- );
-
-void
-CopySwapDevice (
- ClientPtr /* client */,
- DeviceIntPtr /* d */,
- int /* num_classes */,
- char ** /* buf */
- );
-
-void
-CopySwapKeyClass (
- ClientPtr /* client */,
- KeyClassPtr /* k */,
- char ** /* buf */
- );
-
-void
-CopySwapButtonClass (
- ClientPtr /* client */,
- ButtonClassPtr /* b */,
- char ** /* buf */
- );
-
-int
-CopySwapValuatorClass (
- ClientPtr /* client */,
- ValuatorClassPtr /* v */,
- char ** /* buf */
- );
-
-void
-SRepXListInputDevices (
- ClientPtr /* client */,
- int /* size */,
- xListInputDevicesReply * /* rep */
- );
-
-#endif /* LISTDEV_H */
diff --git a/Xi/opendev.c b/Xi/opendev.c
deleted file mode 100644
index 26210fa86..000000000
--- a/Xi/opendev.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* $Xorg: opendev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/opendev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to open an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "windowstr.h" /* window structure */
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "opendev.h"
-
-extern CARD8 event_base [];
-
-/***********************************************************************
- *
- * This procedure swaps the request if the server and client have different
- * byte orderings.
- *
- */
-
-int
-SProcXOpenDevice(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xOpenDeviceReq);
- swaps(&stuff->length, n);
- return(ProcXOpenDevice(client));
- }
-
-/***********************************************************************
- *
- * This procedure causes the server to open an input device.
- *
- */
-
-int
-ProcXOpenDevice(client)
- register ClientPtr client;
- {
- xInputClassInfo evbase [numInputClasses];
- Bool enableit = FALSE;
- int j=0;
- int status = Success;
- xOpenDeviceReply rep;
- DeviceIntPtr dev;
-
- REQUEST(xOpenDeviceReq);
- REQUEST_SIZE_MATCH(xOpenDeviceReq);
-
- if (stuff->deviceid == inputInfo.pointer->id ||
- stuff->deviceid == inputInfo.keyboard->id)
- {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
- return Success;
- }
-
- if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) /* not open */
- {
- for (dev=inputInfo.off_devices; dev; dev=dev->next)
- if (dev->id == stuff->deviceid)
- break;
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
- return Success;
- }
- enableit = TRUE;
- }
-
- OpenInputDevice (dev, client, &status);
- if (status != Success)
- {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, status);
- return Success;
- }
- if (enableit && dev->inited && dev->startup)
- (void)EnableDevice(dev);
-
- rep.repType = X_Reply;
- rep.RepType = X_OpenDevice;
- rep.sequenceNumber = client->sequence;
- if (dev->key != NULL)
- {
- evbase[j].class = KeyClass;
- evbase[j++].event_type_base = event_base[KeyClass];
- }
- if (dev->button != NULL)
- {
- evbase[j].class = ButtonClass;
- evbase[j++].event_type_base = event_base[ButtonClass];
- }
- if (dev->valuator != NULL)
- {
- evbase[j].class = ValuatorClass;
- evbase[j++].event_type_base = event_base[ValuatorClass];
- }
- if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
- dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL)
- {
- evbase[j].class = FeedbackClass;
- evbase[j++].event_type_base = event_base[FeedbackClass];
- }
- if (dev->focus != NULL)
- {
- evbase[j].class = FocusClass;
- evbase[j++].event_type_base = event_base[FocusClass];
- }
- if (dev->proximity != NULL)
- {
- evbase[j].class = ProximityClass;
- evbase[j++].event_type_base = event_base[ProximityClass];
- }
- evbase[j].class = OtherClass;
- evbase[j++].event_type_base = event_base[OtherClass];
- rep.length = (j * sizeof (xInputClassInfo) + 3) >> 2;
- rep.num_classes = j;
- WriteReplyToClient (client, sizeof (xOpenDeviceReply), &rep);
- WriteToClient(client, j * sizeof (xInputClassInfo), (char *)evbase);
- return (Success);
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XOpenDevice function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXOpenDevice (client, size, rep)
- ClientPtr client;
- int size;
- xOpenDeviceReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/opendev.h b/Xi/opendev.h
deleted file mode 100644
index 818e2d877..000000000
--- a/Xi/opendev.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef OPENDEV_H
-#define OPENDEV_H 1
-
-int
-SProcXOpenDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXOpenDevice(
- ClientPtr /* client */
- );
-
-void
-SRepXOpenDevice (
- ClientPtr /* client */,
- int /* size */,
- xOpenDeviceReply * /* rep */
- );
-
-#endif /* OPENDEV_H */
diff --git a/Xi/queryst.c b/Xi/queryst.c
deleted file mode 100644
index 598ab85ae..000000000
--- a/Xi/queryst.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $Xorg: queryst.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-/*
-
-Copyright 1998, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/Xi/queryst.c,v 3.5 2001/12/14 19:58:58 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to query the state of an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "queryst.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to query the state of a device.
- *
- */
-
-int
-SProcXQueryDeviceState(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xQueryDeviceStateReq);
- swaps(&stuff->length, n);
- return(ProcXQueryDeviceState(client));
- }
-
-/***********************************************************************
- *
- * This procedure allows frozen events to be routed.
- *
- */
-
-int
-ProcXQueryDeviceState(client)
- register ClientPtr client;
- {
- register char n;
- int i;
- int num_classes = 0;
- int total_length = 0;
- char *buf, *savbuf;
- KeyClassPtr k;
- xKeyState *tk;
- ButtonClassPtr b;
- xButtonState *tb;
- ValuatorClassPtr v;
- xValuatorState *tv;
- xQueryDeviceStateReply rep;
- DeviceIntPtr dev;
- int *values;
-
- REQUEST(xQueryDeviceStateReq);
- REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_QueryDeviceState;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
- BadDevice);
- return Success;
- }
-
- v = dev->valuator;
- if (v != NULL && v->motionHintWindow != NULL)
- MaybeStopDeviceHint(dev, client);
-
- k = dev->key;
- if (k != NULL)
- {
- total_length += sizeof (xKeyState);
- num_classes++;
- }
-
- b = dev->button;
- if (b != NULL)
- {
- total_length += sizeof (xButtonState);
- num_classes++;
- }
-
- if (v != NULL)
- {
- total_length += (sizeof(xValuatorState) +
- (v->numAxes * sizeof(int)));
- num_classes++;
- }
- buf = (char *) xalloc (total_length);
- if (!buf)
- {
- SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
- BadAlloc);
- return Success;
- }
- savbuf = buf;
-
- if (k != NULL)
- {
- tk = (xKeyState *) buf;
- tk->class = KeyClass;
- tk->length = sizeof (xKeyState);
- tk->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1;
- for (i = 0; i<32; i++)
- tk->keys[i] = k->down[i];
- buf += sizeof (xKeyState);
- }
-
- if (b != NULL)
- {
- tb = (xButtonState *) buf;
- tb->class = ButtonClass;
- tb->length = sizeof (xButtonState);
- tb->num_buttons = b->numButtons;
- for (i = 0; i<32; i++)
- tb->buttons[i] = b->down[i];
- buf += sizeof (xButtonState);
- }
-
- if (v != NULL)
- {
- tv = (xValuatorState *) buf;
- tv->class = ValuatorClass;
- tv->length = sizeof (xValuatorState);
- tv->num_valuators = v->numAxes;
- tv->mode = v->mode;
- buf += sizeof(xValuatorState);
- for (i=0, values=v->axisVal; i<v->numAxes; i++)
- {
- *((int *) buf) = *values++;
- if (client->swapped)
- {
- swapl ((int *) buf, n);/* macro - braces needed */
- }
- buf += sizeof(int);
- }
- }
-
- rep.num_classes = num_classes;
- rep.length = (total_length + 3) >> 2;
- WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep);
- if (total_length > 0)
- WriteToClient (client, total_length, savbuf);
- xfree (savbuf);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XQueryDeviceState function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXQueryDeviceState (client, size, rep)
- ClientPtr client;
- int size;
- xQueryDeviceStateReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/queryst.h b/Xi/queryst.h
deleted file mode 100644
index 50d36e95e..000000000
--- a/Xi/queryst.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef QUERYST_H
-#define QUERYST_H 1
-
-int
-SProcXQueryDeviceState(
- ClientPtr /* client */
- );
-
-int
-ProcXQueryDeviceState(
- ClientPtr /* client */
- );
-
-void
-SRepXQueryDeviceState (
- ClientPtr /* client */,
- int /* size */,
- xQueryDeviceStateReply * /* rep */
- );
-
-#endif /* QUERYST_H */
diff --git a/Xi/selectev.c b/Xi/selectev.c
deleted file mode 100644
index a46a02928..000000000
--- a/Xi/selectev.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $Xorg: selectev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/selectev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to select input from an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "selectev.h"
-
-extern Mask ExtExclusiveMasks[];
-extern Mask ExtValidMasks[];
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order.
- *
- */
-
-int
-SProcXSelectExtensionEvent (client)
-register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
-
- REQUEST(xSelectExtensionEventReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
- p = (long *) &stuff[1];
- for (i=0; i<stuff->count; i++)
- {
- swapl(p, n);
- p++;
- }
- return(ProcXSelectExtensionEvent(client));
- }
-
-/***********************************************************************
- *
- * This procedure selects input from an extension device.
- *
- */
-
-int
-ProcXSelectExtensionEvent (client)
- register ClientPtr client;
- {
- int ret;
- int i;
- WindowPtr pWin;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xSelectExtensionEventReq);
- REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
-
- if (stuff->length !=(sizeof(xSelectExtensionEventReq)>>2) + stuff->count)
- {
- SendErrorToClient (client, IReqCode, X_SelectExtensionEvent, 0,
- BadLength);
- return Success;
- }
-
- pWin = (WindowPtr) LookupWindow (stuff->window, client);
- if (!pWin)
- {
- client->errorValue = stuff->window;
- SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
- BadWindow);
- return Success;
- }
-
- if ((ret = CreateMaskFromList (client, (XEventClass *)&stuff[1],
- stuff->count, tmp, NULL, X_SelectExtensionEvent)) != Success)
- return Success;
-
- for (i=0; i<EMASKSIZE; i++)
- if (tmp[i].dev != NULL)
- {
- if ((ret = SelectForWindow((DeviceIntPtr)tmp[i].dev, pWin, client, tmp[i].mask,
- ExtExclusiveMasks[i], ExtValidMasks[i])) != Success)
- {
- SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
- ret);
- return Success;
- }
- }
-
- return Success;
- }
diff --git a/Xi/selectev.h b/Xi/selectev.h
deleted file mode 100644
index 2327b94c5..000000000
--- a/Xi/selectev.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SELECTEV_H
-#define SELECTEV_H 1
-
-int
-SProcXSelectExtensionEvent (
- ClientPtr /* client */
- );
-
-int
-ProcXSelectExtensionEvent (
- ClientPtr /* client */
- );
-
-#endif /* SELECTEV_H */
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
deleted file mode 100644
index ae6f8cdc6..000000000
--- a/Xi/sendexev.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* $Xorg: sendexev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/sendexev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to send an extension event.
- *
- */
-
-#define EXTENSION_EVENT_BASE 64
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* Window */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "sendexev.h"
-
-extern int lastEvent; /* Defined in extension.c */
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order than us.
- *
- */
-
-int
-SProcXSendExtensionEvent(client)
- register ClientPtr client;
- {
- register char n;
- register long *p;
- register int i;
- xEvent eventT;
- xEvent *eventP;
- EventSwapPtr proc;
-
- REQUEST(xSendExtensionEventReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
- swapl(&stuff->destination, n);
- swaps(&stuff->count, n);
- eventP = (xEvent *) &stuff[1];
- for (i=0; i<stuff->num_events; i++,eventP++)
- {
- proc = EventSwapVector[eventP->u.u.type & 0177];
- if (proc == NotImplemented) /* no swapping proc; invalid event type? */
- return (BadValue);
- (*proc)(eventP, &eventT);
- *eventP = eventT;
- }
-
- p = (long *) (((xEvent *) &stuff[1]) + stuff->num_events);
- for (i=0; i<stuff->count; i++)
- {
- swapl(p, n);
- p++;
- }
- return(ProcXSendExtensionEvent(client));
- }
-
-/***********************************************************************
- *
- * Send an event to some client, as if it had come from an extension input
- * device.
- *
- */
-
-int
-ProcXSendExtensionEvent (client)
- register ClientPtr client;
- {
- int ret;
- DeviceIntPtr dev;
- xEvent *first;
- XEventClass *list;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xSendExtensionEventReq);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
-
- if (stuff->length !=(sizeof(xSendExtensionEventReq)>>2) + stuff->count +
- (stuff->num_events * (sizeof (xEvent) >> 2)))
- {
- SendErrorToClient (client, IReqCode, X_SendExtensionEvent, 0,
- BadLength);
- return Success;
- }
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0,
- BadDevice);
- return Success;
- }
-
- /* The client's event type must be one defined by an extension. */
-
- first = ((xEvent *) &stuff[1]);
- if ( ! ((EXTENSION_EVENT_BASE <= first->u.u.type) &&
- (first->u.u.type < lastEvent)) )
- {
- client->errorValue = first->u.u.type;
- SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0,
- BadValue);
- return Success;
- }
-
- list = (XEventClass *) (first + stuff->num_events);
- if ((ret = CreateMaskFromList (client, list, stuff->count, tmp, dev,
- X_SendExtensionEvent)) != Success)
- return Success;
-
- ret = (SendEvent (client, dev, stuff->destination,
- stuff->propagate, (xEvent *)&stuff[1], tmp[stuff->deviceid].mask,
- stuff->num_events));
-
- if (ret != Success)
- SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, ret);
-
- return Success;
- }
diff --git a/Xi/sendexev.h b/Xi/sendexev.h
deleted file mode 100644
index c2ace5804..000000000
--- a/Xi/sendexev.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SENDEXEV_H
-#define SENDEXEV_H 1
-
-int
-SProcXSendExtensionEvent(
- ClientPtr /* client */
- );
-
-int
-ProcXSendExtensionEvent(
- ClientPtr /* client */
- );
-
-#endif /* SENDEXEV_H */
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
deleted file mode 100644
index 52553948d..000000000
--- a/Xi/setbmap.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $Xorg: setbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/setbmap.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to change the button mapping of an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#define IsOn(ptr, bit) \
- (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
-
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "exevents.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "setbmap.h"
-
-/***********************************************************************
- *
- * This procedure changes the button mapping.
- *
- */
-
-int
-SProcXSetDeviceButtonMapping(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xSetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
- return(ProcXSetDeviceButtonMapping(client));
- }
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-ProcXSetDeviceButtonMapping (client)
- register ClientPtr client;
- {
- int ret;
- xSetDeviceButtonMappingReply rep;
- DeviceIntPtr dev;
-
- REQUEST(xSetDeviceButtonMappingReq);
- REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
-
- if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) +
- stuff->map_length + 3)>>2)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
- BadLength);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_SetDeviceButtonMapping;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.status = MappingSuccess;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
- BadDevice);
- return Success;
- }
-
- ret = SetButtonMapping (client, dev, stuff->map_length, (BYTE *)&stuff[1]);
-
- if (ret == BadValue || ret == BadMatch)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
- ret);
- return Success;
- }
- else
- {
- rep.status = ret;
- WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
- }
-
- if (ret != MappingBusy)
- SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XSetDeviceButtonMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXSetDeviceButtonMapping (client, size, rep)
- ClientPtr client;
- int size;
- xSetDeviceButtonMappingReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/setbmap.h b/Xi/setbmap.h
deleted file mode 100644
index 77f097104..000000000
--- a/Xi/setbmap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SETBMAP_H
-#define SETBMAP_H 1
-
-int
-SProcXSetDeviceButtonMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXSetDeviceButtonMapping(
- ClientPtr /* client */
- );
-
-void
-SRepXSetDeviceButtonMapping(
- ClientPtr /* client */,
- int /* size */,
- xSetDeviceButtonMappingReply * /* rep */
- );
-
-#endif /* SETBMAP_H */
diff --git a/Xi/setdval.c b/Xi/setdval.c
deleted file mode 100644
index fe2e13853..000000000
--- a/Xi/setdval.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $Xorg: setdval.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/setdval.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to change the mode of an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "setdval.h"
-
-/***********************************************************************
- *
- * Handle a request from a client with a different byte order.
- *
- */
-
-int
-SProcXSetDeviceValuators(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xSetDeviceValuatorsReq);
- swaps(&stuff->length, n);
- return(ProcXSetDeviceValuators(client));
- }
-
-/***********************************************************************
- *
- * This procedure sets the value of valuators on an extension input device.
- *
- */
-
-int
-ProcXSetDeviceValuators(client)
- register ClientPtr client;
- {
- DeviceIntPtr dev;
- xSetDeviceValuatorsReply rep;
-
- REQUEST(xSetDeviceValuatorsReq);
- REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_SetDeviceValuators;
- rep.length = 0;
- rep.status = Success;
- rep.sequenceNumber = client->sequence;
-
- if (stuff->length !=(sizeof(xSetDeviceValuatorsReq)>>2) +
- stuff->num_valuators)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
- BadLength);
- return Success;
- }
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
- BadDevice);
- return Success;
- }
- if (dev->valuator == NULL)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- BadMatch);
- return Success;
- }
-
- if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- BadValue);
- return Success;
- }
-
- if ((dev->grab) && !SameClient(dev->grab, client))
- rep.status = AlreadyGrabbed;
- else
- rep.status = SetDeviceValuators (client, dev, (int *) &stuff[1],
- stuff->first_valuator, stuff->num_valuators);
-
- if (rep.status != Success && rep.status != AlreadyGrabbed)
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- rep.status);
- else
- WriteReplyToClient (client, sizeof (xSetDeviceValuatorsReply), &rep);
-
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XSetDeviceValuators function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXSetDeviceValuators (client, size, rep)
- ClientPtr client;
- int size;
- xSetDeviceValuatorsReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/setdval.h b/Xi/setdval.h
deleted file mode 100644
index e6f08a64c..000000000
--- a/Xi/setdval.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SETDVAL_H
-#define SETDVAL_H 1
-
-int
-SProcXSetDeviceValuators(
- ClientPtr /* client */
- );
-
-int
-ProcXSetDeviceValuators(
- ClientPtr /* client */
- );
-
-void
-SRepXSetDeviceValuators(
- ClientPtr /* client */,
- int /* size */,
- xSetDeviceValuatorsReply * /* rep */
- );
-
-#endif /* SETDVAL_H */
diff --git a/Xi/setfocus.c b/Xi/setfocus.c
deleted file mode 100644
index 599934549..000000000
--- a/Xi/setfocus.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* $Xorg: setfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/setfocus.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to set the focus for an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "windowstr.h" /* focus struct */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-
-#include "dixevents.h"
-
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "setfocus.h"
-
-/***********************************************************************
- *
- * This procedure sets the focus for a device.
- *
- */
-
-int
-SProcXSetDeviceFocus(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xSetDeviceFocusReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
- return(ProcXSetDeviceFocus(client));
- }
-
-/***********************************************************************
- *
- * This procedure sets the focus for a device.
- *
- */
-
-int
-ProcXSetDeviceFocus(client)
- register ClientPtr client;
- {
- int ret;
- register DeviceIntPtr dev;
-
- REQUEST(xSetDeviceFocusReq);
- REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
-
- dev = LookupDeviceIntRec (stuff->device);
- if (dev==NULL || !dev->focus)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, BadDevice);
- return Success;
- }
-
- ret = SetInputFocus (client, dev, stuff->focus, stuff->revertTo,
- stuff->time, TRUE);
- if (ret != Success)
- SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, ret);
-
- return Success;
- }
diff --git a/Xi/setfocus.h b/Xi/setfocus.h
deleted file mode 100644
index 1da6927b4..000000000
--- a/Xi/setfocus.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SETFOCUS_H
-#define SETFOCUS_H 1
-
-int
-SProcXSetDeviceFocus(
- ClientPtr /* client */
- );
-
-int
-ProcXSetDeviceFocus(
- ClientPtr /* client */
- );
-
-#endif /* SETFOCUS_H */
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
deleted file mode 100644
index 4c4d19c8b..000000000
--- a/Xi/setmmap.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $Xorg: setmmap.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/setmmap.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/********************************************************************
- *
- * Set modifier mapping for an extension device.
- *
- */
-
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "exevents.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "setmmap.h"
-
-/***********************************************************************
- *
- * This procedure sets the modifier mapping for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXSetDeviceModifierMapping(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xSetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
- return(ProcXSetDeviceModifierMapping(client));
- }
-
-/***********************************************************************
- *
- * Set the device Modifier mapping.
- *
- */
-
-int
-ProcXSetDeviceModifierMapping(client)
- ClientPtr client;
- {
- int ret;
- xSetDeviceModifierMappingReply rep;
- DeviceIntPtr dev;
- KeyClassPtr kp;
-
- REQUEST(xSetDeviceModifierMappingReq);
- REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceModifierMapping, 0,
- BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_SetDeviceModifierMapping;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- ret = SetModifierMapping(client, dev, stuff->length,
- (sizeof (xSetDeviceModifierMappingReq)>>2), stuff->numKeyPerModifier,
- (BYTE *)&stuff[1], &kp);
-
- if (ret==MappingSuccess || ret==MappingBusy || ret==MappingFailed)
- {
- rep.success = ret;
- if (ret == MappingSuccess)
- SendDeviceMappingNotify(MappingModifier, 0, 0, dev);
- WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),&rep);
- }
- else
- {
- if (ret==-1)
- ret=BadValue;
- SendErrorToClient (client, IReqCode, X_SetDeviceModifierMapping, 0,ret);
- }
-
-
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XSetDeviceModifierMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXSetDeviceModifierMapping (client, size, rep)
- ClientPtr client;
- int size;
- xSetDeviceModifierMappingReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
-
diff --git a/Xi/setmmap.h b/Xi/setmmap.h
deleted file mode 100644
index 30fb57b48..000000000
--- a/Xi/setmmap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SETMMAP_H
-#define SETMMAP_H 1
-
-int
-SProcXSetDeviceModifierMapping(
- ClientPtr /* client */
- );
-
-int
-ProcXSetDeviceModifierMapping(
- ClientPtr /* client */
- );
-
-void
-SRepXSetDeviceModifierMapping(
- ClientPtr /* client */,
- int /* size */,
- xSetDeviceModifierMappingReply * /* rep */
- );
-
-#endif /* SETMMAP_H */
diff --git a/Xi/setmode.c b/Xi/setmode.c
deleted file mode 100644
index 9c3feb4db..000000000
--- a/Xi/setmode.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Xorg: setmode.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/setmode.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to change the mode of an extension input device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "setmode.h"
-
-/***********************************************************************
- *
- * Handle a request from a client with a different byte order.
- *
- */
-
-int
-SProcXSetDeviceMode(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xSetDeviceModeReq);
- swaps(&stuff->length, n);
- return(ProcXSetDeviceMode(client));
- }
-
-/***********************************************************************
- *
- * This procedure sets the mode of a device.
- *
- */
-
-int
-ProcXSetDeviceMode(client)
- register ClientPtr client;
- {
- DeviceIntPtr dev;
- xSetDeviceModeReply rep;
-
- REQUEST(xSetDeviceModeReq);
- REQUEST_SIZE_MATCH(xSetDeviceModeReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_SetDeviceMode;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceMode, 0, BadDevice);
- return Success;
- }
- if (dev->valuator == NULL)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, BadMatch);
- return Success;
- }
- if ((dev->grab) && !SameClient(dev->grab, client))
- rep.status = AlreadyGrabbed;
- else
- rep.status = SetDeviceMode (client, dev, stuff->mode);
-
- if (rep.status == Success)
- dev->valuator->mode = stuff->mode;
- else if (rep.status != AlreadyGrabbed)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, rep.status);
- return Success;
- }
-
- WriteReplyToClient (client, sizeof (xSetDeviceModeReply), &rep);
- return Success;
- }
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XSetDeviceMode function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXSetDeviceMode (client, size, rep)
- ClientPtr client;
- int size;
- xSetDeviceModeReply *rep;
- {
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
- }
diff --git a/Xi/setmode.h b/Xi/setmode.h
deleted file mode 100644
index 63a1dd35b..000000000
--- a/Xi/setmode.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.2 2003/11/17 22:20:29 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SETMODE_H
-#define SETMODE_H 1
-
-int
-SProcXSetDeviceMode(
- ClientPtr /* client */
- );
-
-int
-ProcXSetDeviceMode(
- ClientPtr /* client */
- );
-
-void
-SRepXSetDeviceMode(
- ClientPtr /* client */,
- int /* size */,
- xSetDeviceModeReply * /* rep */
- );
-
-#endif /* SETMODE_H */
diff --git a/Xi/stubs.c b/Xi/stubs.c
deleted file mode 100644
index 879d8e9b7..000000000
--- a/Xi/stubs.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.5 2003/11/17 22:20:30 dawes Exp $ */
-
-/*
- * stubs.c -- stub routines for the X server side of the XINPUT
- * extension. This file is mainly to be used only as documentation.
- * There is not much code here, and you can't get a working XINPUT
- * server just using this.
- * The Xvfb server uses this file so it will compile with the same
- * object files as the real X server for a platform that has XINPUT.
- * Xnest could do the same thing.
- */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "inputstr.h"
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-
-/***********************************************************************
- *
- * Caller: ProcXChangeKeyboardDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the keyboard device.
- *
- * The X keyboard device has a FocusRec. If the device that has been
- * made into the new X keyboard did not have a FocusRec,
- * ProcXChangeKeyboardDevice will allocate one for it.
- *
- * If you do not want clients to be able to focus the old X keyboard
- * device, call DeleteFocusClassDeviceStruct to free the FocusRec.
- *
- * If you support input devices with keys that you do not want to be
- * used as the X keyboard, you need to check for them here and return
- * a BadDevice error.
- *
- * The default implementation is to do nothing (assume you do want
- * clients to be able to focus the old X keyboard). The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- */
-
-int
-ChangeKeyboardDevice (old_dev, new_dev)
- DeviceIntPtr old_dev;
- DeviceIntPtr new_dev;
- {
- /***********************************************************************
- DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
- **********************************************************************/
- return BadMatch;
- }
-
-
-/***********************************************************************
- *
- * Caller: ProcXChangePointerDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the pointer device.
- *
- * The X pointer device does not have a FocusRec. If the device that
- * has been made into the new X pointer had a FocusRec,
- * ProcXChangePointerDevice will free it.
- *
- * If you want clients to be able to focus the old pointer device that
- * has now become accessible through the input extension, you need to
- * add a FocusRec to it here.
- *
- * The XChangePointerDevice protocol request also allows the client
- * to choose which axes of the new pointer device are used to move
- * the X cursor in the X- and Y- directions. If the axes are different
- * than the default ones, you need to keep track of that here.
- *
- * If you support input devices with valuators that you do not want to be
- * used as the X pointer, you need to check for them here and return a
- * BadDevice error.
- *
- * The default implementation is to do nothing (assume you don't want
- * clients to be able to focus the old X pointer). The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- */
-
-int
-ChangePointerDevice (
- DeviceIntPtr old_dev,
- DeviceIntPtr new_dev,
- unsigned char x,
- unsigned char y)
- {
- /***********************************************************************
- InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr*
-
- x_axis = x; * keep track of new x-axis*
- y_axis = y; * keep track of new y-axis*
- if (x_axis != 0 || y_axis != 1)
- axes_changed = TRUE; * remember axes have changed*
- else
- axes_changed = FALSE;
- *************************************************************************/
- return BadMatch;
- }
-
-/***********************************************************************
- *
- * Caller: ProcXCloseDevice
- *
- * Take care of implementation-dependent details of closing a device.
- * Some implementations may actually close the device, others may just
- * remove this clients interest in that device.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- *
- */
-
-void
-CloseInputDevice (d, client)
- DeviceIntPtr d;
- ClientPtr client;
- {
- }
-
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices ()
- {
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
-
- }
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice (dev, client, status)
- DeviceIntPtr dev;
- ClientPtr client;
- int *status;
- {
- }
-
-/****************************************************************************
- *
- * Caller: ProcXSetDeviceMode
- *
- * Change the mode of an extension device.
- * This function is used to change the mode of a device from reporting
- * relative motion to reporting absolute positional information, and
- * vice versa.
- * The default implementation below is that no such devices are supported.
- *
- */
-
-int
-SetDeviceMode (client, dev, mode)
- register ClientPtr client;
- DeviceIntPtr dev;
- int mode;
- {
- return BadMatch;
- }
-
-/****************************************************************************
- *
- * Caller: ProcXSetDeviceValuators
- *
- * Set the value of valuators on an extension input device.
- * This function is used to set the initial value of valuators on
- * those input devices that are capable of reporting either relative
- * motion or an absolute position, and allow an initial position to be set.
- * The default implementation below is that no such devices are supported.
- *
- */
-
-int
-SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
- register ClientPtr client;
- DeviceIntPtr dev;
- int *valuators;
- int first_valuator;
- int num_valuators;
- {
- return BadMatch;
- }
-
-/****************************************************************************
- *
- * Caller: ProcXChangeDeviceControl
- *
- * Change the specified device controls on an extension input device.
- *
- */
-
-int
-ChangeDeviceControl (client, dev, control)
- register ClientPtr client;
- DeviceIntPtr dev;
- xDeviceCtl *control;
- {
- switch (control->control)
- {
- case DEVICE_RESOLUTION:
- return (BadMatch);
- default:
- return (BadMatch);
- }
- }
diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c
deleted file mode 100644
index a1ab911fe..000000000
--- a/Xi/ungrdev.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $Xorg: ungrdev.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/ungrdev.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to release a grab of an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-
-#include "ungrdev.h"
-
-/***********************************************************************
- *
- * Handle requests from a client with a different byte order.
- *
- */
-
-int
-SProcXUngrabDevice(client)
-register ClientPtr client;
- {
- register char n;
-
- REQUEST(xUngrabDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabDeviceReq);
- swapl(&stuff->time, n);
- return(ProcXUngrabDevice(client));
- }
-
-/***********************************************************************
- *
- * Release a grab of an extension device.
- *
- */
-
-int
-ProcXUngrabDevice(client)
-register ClientPtr client;
- {
- DeviceIntPtr dev;
- GrabPtr grab;
- TimeStamp time;
-
- REQUEST(xUngrabDeviceReq);
- REQUEST_SIZE_MATCH(xUngrabDeviceReq);
-
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDevice, 0, BadDevice);
- return Success;
- }
- grab = dev->grab;
-
- time = ClientTimeToServerTime(stuff->time);
- if ((CompareTimeStamps(time, currentTime) != LATER) &&
- (CompareTimeStamps(time, dev->grabTime) != EARLIER) &&
- (grab) && SameClient(grab, client))
- (*dev->DeactivateGrab)(dev);
- return Success;
- }
diff --git a/Xi/ungrdev.h b/Xi/ungrdev.h
deleted file mode 100644
index 9a036901f..000000000
--- a/Xi/ungrdev.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef UNGRDEV_H
-#define UNGRDEV_H 1
-
-int
-SProcXUngrabDevice(
- ClientPtr /* client */
- );
-
-int
-ProcXUngrabDevice(
- ClientPtr /* client */
- );
-
-#endif /* UNGRDEV_H */
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c
deleted file mode 100644
index 66ccc72af..000000000
--- a/Xi/ungrdevb.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* $Xorg: ungrdevb.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.c,v 3.4 2001/12/14 19:59:00 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to release a grab of a button on an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "dixgrabs.h"
-
-#include "ungrdevb.h"
-
-#define AllModifiersMask ( \
- ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
- Mod3Mask | Mod4Mask | Mod5Mask )
-
-/***********************************************************************
- *
- * Handle requests from a client with a different byte order.
- *
- */
-
-int
-SProcXUngrabDeviceButton(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xUngrabDeviceButtonReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return(ProcXUngrabDeviceButton(client));
- }
-
-/***********************************************************************
- *
- * Release a grab of a button on an extension device.
- *
- */
-
-int
-ProcXUngrabDeviceButton(client)
- ClientPtr client;
- {
- DeviceIntPtr dev;
- DeviceIntPtr mdev;
- WindowPtr pWin;
- GrabRec temporaryGrab;
-
- REQUEST(xUngrabDeviceButtonReq);
- REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
-
- dev = LookupDeviceIntRec (stuff->grabbed_device);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadDevice);
- return Success;
- }
- if (dev->button == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadMatch);
- return Success;
- }
-
- if (stuff->modifier_device != UseXKeyboard)
- {
- mdev = LookupDeviceIntRec (stuff->modifier_device);
- if (mdev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadDevice);
- return Success;
- }
- if (mdev->key == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadMatch);
- return Success;
- }
- }
- else
- mdev = (DeviceIntPtr) LookupKeyboardDevice();
-
- pWin = LookupWindow(stuff->grabWindow, client);
- if (!pWin)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadWindow);
- return Success;
- }
-
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
- BadValue);
- return Success;
- }
-
- temporaryGrab.resource = client->clientAsMask;
- temporaryGrab.device = dev;
- temporaryGrab.window = pWin;
- temporaryGrab.type = DeviceButtonPress;
- temporaryGrab.modifierDevice = mdev;
- temporaryGrab.modifiersDetail.exact = stuff->modifiers;
- temporaryGrab.modifiersDetail.pMask = NULL;
- temporaryGrab.detail.exact = stuff->button;
- temporaryGrab.detail.pMask = NULL;
-
- DeletePassiveGrabFromList(&temporaryGrab);
- return Success;
- }
diff --git a/Xi/ungrdevb.h b/Xi/ungrdevb.h
deleted file mode 100644
index 500b77ebb..000000000
--- a/Xi/ungrdevb.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef UNGRDEVB_H
-#define UNGRDEVB_H 1
-
-int
-SProcXUngrabDeviceButton(
- ClientPtr /* client */
- );
-
-int
-ProcXUngrabDeviceButton(
- ClientPtr /* client */
- );
-
-#endif /* UNGRDEVB_H */
diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c
deleted file mode 100644
index d7632db2a..000000000
--- a/Xi/ungrdevk.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* $Xorg: ungrdevk.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.c,v 3.4 2001/12/14 19:59:00 dawes Exp $ */
-
-/***********************************************************************
- *
- * Request to release a grab of a key on an extension device.
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "X.h" /* for inputstr.h */
-#include "Xproto.h" /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "XI.h"
-#include "XIproto.h"
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-#include "exglobals.h"
-#include "dixgrabs.h"
-
-#include "ungrdevk.h"
-
-#define AllModifiersMask ( \
- ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
- Mod3Mask | Mod4Mask | Mod5Mask )
-
-/***********************************************************************
- *
- * Handle requests from a client with a different byte order.
- *
- */
-
-int
-SProcXUngrabDeviceKey(client)
- register ClientPtr client;
- {
- register char n;
-
- REQUEST(xUngrabDeviceKeyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return(ProcXUngrabDeviceKey(client));
- }
-
-/***********************************************************************
- *
- * Release a grab of a key on an extension device.
- *
- */
-
-int
-ProcXUngrabDeviceKey(client)
- ClientPtr client;
- {
- DeviceIntPtr dev;
- DeviceIntPtr mdev;
- WindowPtr pWin;
- GrabRec temporaryGrab;
-
- REQUEST(xUngrabDeviceKeyReq);
- REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
-
- dev = LookupDeviceIntRec (stuff->grabbed_device);
- if (dev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadDevice);
- return Success;
- }
- if (dev->key == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch);
- return Success;
- }
-
- if (stuff->modifier_device != UseXKeyboard)
- {
- mdev = LookupDeviceIntRec (stuff->modifier_device);
- if (mdev == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadDevice);
- return Success;
- }
- if (mdev->key == NULL)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadMatch);
- return Success;
- }
- }
- else
- mdev = (DeviceIntPtr) LookupKeyboardDevice();
-
- pWin = LookupWindow(stuff->grabWindow, client);
- if (!pWin)
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadWindow);
- return Success;
- }
- if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||
- (stuff->key < dev->key->curKeySyms.minKeyCode))
- && (stuff->key != AnyKey))
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadValue);
- return Success;
- }
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
- BadValue);
- return Success;
- }
-
- temporaryGrab.resource = client->clientAsMask;
- temporaryGrab.device = dev;
- temporaryGrab.window = pWin;
- temporaryGrab.type = DeviceKeyPress;
- temporaryGrab.modifierDevice = mdev;
- temporaryGrab.modifiersDetail.exact = stuff->modifiers;
- temporaryGrab.modifiersDetail.pMask = NULL;
- temporaryGrab.detail.exact = stuff->key;
- temporaryGrab.detail.pMask = NULL;
-
- DeletePassiveGrabFromList(&temporaryGrab);
- return Success;
- }
diff --git a/Xi/ungrdevk.h b/Xi/ungrdevk.h
deleted file mode 100644
index c43575ba1..000000000
--- a/Xi/ungrdevk.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.h,v 3.2 2003/11/17 22:20:30 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef UNGRDEVK_H
-#define UNGRDEVK_H 1
-
-int
-SProcXUngrabDeviceKey(
- ClientPtr /* client */
- );
-
-int
-ProcXUngrabDeviceKey(
- ClientPtr /* client */
- );
-
-#endif /* UNGRDEVK_H */
diff --git a/XpConfig/C/print/Xprinters b/XpConfig/C/print/Xprinters
deleted file mode 100644
index 9290636fb..000000000
--- a/XpConfig/C/print/Xprinters
+++ /dev/null
@@ -1,43 +0,0 @@
-########################################################################
-#
-# $Xorg: Xprinters,v 1.3 2000/08/17 19:48:02 cpqbld Exp $
-#
-# X*printers sample configuration file
-#
-#
-# This file belongs in /usr/lib/X11/X*printers, where the "*" is the
-# display number of the server. For example, if the server is
-# invoked using the command X :0, then the X0printers file is used.
-########################################################################
-
-########################################################################
-# Use lpstat to augment the list of printers managed by the
-# server. (This is the default behavior if the X*printers file does
-# not exist, or if an "Augment_Printer_List" line is not specified.)
-########################################################################
-#Augment_Printer_List %(default)%
-
-########################################################################
-# Use the specified command pipeline to augment the list of printers
-# managed by the server.
-########################################################################
-#Augment_Printer_List lpstat -a | cut -d " " -f 1 # equivalent to default
-
-########################################################################
-# Do not augment the list of printers managed by the server.
-########################################################################
-#Augment_Printer_List %none%
-
-########################################################################
-# Add individual printers to the list of printers managed by the
-# server. These are aliases, determined by driver name.
-########################################################################
-
-
-# EXAMPLES
-#
-# Printer xppspr
-# Printer xppclpr
-# Printer xppclmonopr
-# Printer xprasterpr
-
diff --git a/XpConfig/C/print/attributes/document b/XpConfig/C/print/attributes/document
deleted file mode 100644
index e0be64553..000000000
--- a/XpConfig/C/print/attributes/document
+++ /dev/null
@@ -1,38 +0,0 @@
-# $Xorg: document,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
-# Document DPA-Object initial attribute values
-
-# Attribute IDs must be qualified by using one of the following
-# (listed in order of precedence):
-#
-# printer-name
-# Set this attribute for a specific printer.
-# Example: "dj_1.plex: duplex"
-#
-# printer-model
-# Set this attribute for all printers of a specific model.
-# Example: "HPDJ1600C.plex: duplex"
-#
-# '*'
-# Set this attribute for all printers.
-# Example: "*.plex: duplex"
-
-
-*content-orientation: portrait
-*copy-count: 1
-*default-medium: iso-a4
-*default-printer-resolution: 300
-*document-format: {Postscript 2}
-*plex: duplex
-
-
-# EXAMPLES
-#
-# *content-orientation: landscape
-# *copy-count: 3
-# *default-input-tray: main
-# *default-medium: iso-a4
-# *default-printer-resolution: 600
-# *document-format: {PCL 5}
-# *plex: simplex
-# *xp-listfonts-modes: xp-list-internal-printer-fonts
-
diff --git a/XpConfig/C/print/attributes/job b/XpConfig/C/print/attributes/job
deleted file mode 100644
index aa1911dcd..000000000
--- a/XpConfig/C/print/attributes/job
+++ /dev/null
@@ -1,25 +0,0 @@
-# $Xorg: job,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
-# Job DPA-Object initial attribute values
-
-# Attribute IDs must be qualified by using one of the following
-# (listed in order of precedence):
-#
-# printer-name
-# Set this attribute for a specific printer.
-# Example: "laser_1.job-priority: 1"
-#
-# printer-model
-# Set this attribute for all printers of a specific model.
-# Example: "HPDJ1600C.job-priority: 1"
-#
-# '*'
-# Set this attribute for all printers.
-# Example: "*.job-priority: 1"
-
-*notification-profile: {}
-
-# EXAMPLES
-#
-# *job-name: Example Job Name
-# *notification-profile: {{event-report-job-completed} electronic-mail}
-# *xp-spooler-command-options: -onb
diff --git a/XpConfig/C/print/attributes/printer b/XpConfig/C/print/attributes/printer
deleted file mode 100644
index a49afa5f0..000000000
--- a/XpConfig/C/print/attributes/printer
+++ /dev/null
@@ -1,80 +0,0 @@
-# $Xorg: printer,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
-# Printer DPA-Object initial attribute values
-
-# Attribute IDs must be qualified by using one of the following
-# (listed in order of precedence):
-#
-# printer-name
-# Set this attribute for a specific printer.
-# Example: "dj_1.document-formats-ready: {pcl 5}"
-#
-# printer-model
-# Set this attribute for all printers of a specific model.
-# Example: "HPDJ1600C.document-formats-ready: {pcl 5}"
-#
-# '*'
-# Set this attribute for all printers.
-# Example: "*.document-formats-ready: {pcl 5}"
-
-
-*xp-ddx-identifier: XP-POSTSCRIPT
-
-
-# IMPORTANT EXAMPLES
-#
-# The following are examples of how a printer name is bound
-# to a model-config file and ddx driver.
-#
-# Warning: most X-Servers have a hard limit on the number of ddx
-# drivers (ie, screens) they can support at runtime (usually 3 or
-# 4). Whatever the number of printers, they cannot create a
-# dependency for more than the limit on ddx drivers. Assuming
-# "Xprinters" listed all four xp*pr printers below, X-Servers
-# with a limit of 3 would not work.
-#
-# xppspr.xp-model-identifier: HPDJ1600C
-# xppspr.xp-ddx-identifier: XP-POSTSCRIPT
-# xppspr.document-formats-ready: { PostScript 2 }
-#
-# xppclpr.xp-model-identifier: HPDJ1600C
-# xppclpr.xp-ddx-identifier: XP-PCL-COLOR
-# xppclpr.document-formats-ready: { PCL 5 }
-#
-# xppclmonopr.xp-model-identifier: HPDJ1600C
-# xppclmonopr.xp-ddx-identifier: XP-PCL-MONO
-# xppclmonopr.document-formats-ready: { PCL 5 }
-#
-# xprasterpr.xp-model-identifier: HPDJ1600C
-# xprasterpr.xp-ddx-identifier: XP-RASTER
-
-
-# MORE EXAMPLES of items often configured in this file
-#
-# *descriptor: This printer has not been given a name
-# *dt-pdm-command: dtpdm
-# *input-trays-medium: {top na-letter} {bottom iso-a4}
-# *xp-model-identifier: HPDJ1600C
-# *xp-spooler-command: /opt/mystuff/bin/mylp -p %printer-name% -c %copy-count% \
-# -j %job-name% -o %options%
-
-
-# USUALLY SET BY THE ddx driver
-#
-# *content-orientations-supported: portrait landscape reverse-portrait reverse-landscape
-
-
-# USUALLY SET BY THE model-config FILE
-#
-# *document-formats-supported: {PCL 5}
-# *medium-source-sizes-supported: \
-# { top {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} } \
-# { bottom {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} }
-# *plexes-supported: simplex duplex tumble
-# *printer-model: Hewlett-Packard LaserJet IV
-# *printer-resolutions-supported: 300
-# *xp-ddx-identifier: XP-PCL-COLOR
-# *xp-embedded-formats-supported: {PCL 5} {HPGL 2}
-# *xp-listfonts-modes-supported: xp-list-internal-printer-fonts
-# *xp-raw-formats-supported: {PCL 5}
-# *xp-setup-proviso: xp-setup-optional
-
diff --git a/XpConfig/C/print/ddx-config/raster/pcl b/XpConfig/C/print/ddx-config/raster/pcl
deleted file mode 100644
index 15d33e7b3..000000000
--- a/XpConfig/C/print/ddx-config/raster/pcl
+++ /dev/null
@@ -1,39 +0,0 @@
-# $Xorg: pcl,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
-# This is the file which you should customize to include the printers that
-# will print through the raster driver. The early part of this file
-# specifies some commn useful defaults. You can override them when
-# you list your printers in the second part of this file. This file is
-# an X Resource file. To learn more about this file format, consult
-# the functional specification.
-
-# Note that the reference printer for CDEnext is the HP DeskJet 1600C.
-# This driver may work for other printers, but the reference printer
-# is the only officially supported printer.
-
-
-# DEFAULTS
-# ========
-
-# The attributes below apply to all printers unless the section below
-# specifies something different for the printer.
-
-# Default printer attributes
-# --------------------------
-# Printer attributes control the choices that users will see in the
-# setup dialog for those printers.
-
-# The attributes below apply to all printes unless the section below
-# specifies something different for the printer.
-
-*.media-ready: na-letter-white
-*.descriptor: Printer supported by CDEnext DtPrint System.
-*.printer-model: HPDJ1600C
-
-# Printer Specifics
-
-# Use this section to override the defaults listed above or to override the
-# printer attributes described in the model file.
-# The lines describing "laser" are just a sample to help you get started.
-
-# laser.printer-name: laser
-# laser.spooler-name: laser
diff --git a/XpConfig/C/print/ddx-config/raster/postscript b/XpConfig/C/print/ddx-config/raster/postscript
deleted file mode 100644
index e69de29bb..000000000
--- a/XpConfig/C/print/ddx-config/raster/postscript
+++ /dev/null
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf
deleted file mode 100644
index 09cc489a5..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00051.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf
deleted file mode 100644
index b21a9a2a8..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00052.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf
deleted file mode 100644
index 485b874c5..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00053.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf
deleted file mode 100644
index 524934c71..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00054.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf
deleted file mode 100644
index 2ef9bc52c..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00055.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf
deleted file mode 100644
index 3d69311ef..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00056.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf
deleted file mode 100644
index 3833d4f54..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00057.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf
deleted file mode 100644
index 289a95e5c..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00058.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf
deleted file mode 100644
index a5984bed1..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00059.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf
deleted file mode 100644
index df27cd71e..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00060.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf
deleted file mode 100644
index fb2b5a433..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00061.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf
deleted file mode 100644
index f0e58c435..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00062.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf
deleted file mode 100644
index 8821ff155..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00063.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf
deleted file mode 100644
index e5980fc0e..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00064.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf
deleted file mode 100644
index d9a151d7f..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00065.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf
deleted file mode 100644
index d14fca56f..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00066.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf
deleted file mode 100644
index 7a341506f..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00067.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf
deleted file mode 100644
index c20e39a21..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00068.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf
deleted file mode 100644
index 4a4a35281..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00069.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf
deleted file mode 100644
index 8d97d4339..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00070.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf
deleted file mode 100644
index 19844c9c6..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00071.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf
deleted file mode 100644
index 5415c3f44..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00072.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf
deleted file mode 100644
index 038dfdb46..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00073.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf
deleted file mode 100644
index 382a78575..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00074.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf
deleted file mode 100644
index 1c7edf653..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00075.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf
deleted file mode 100644
index 2f077f40f..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00076.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf
deleted file mode 100644
index 1ce190d51..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00077.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf
deleted file mode 100644
index 45d6906ba..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00079.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf
deleted file mode 100644
index b991b5edb..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00080.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf
deleted file mode 100644
index 1935a9f00..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00081.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf
deleted file mode 100644
index 2000dc057..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00082.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf
deleted file mode 100644
index 90f0e45a8..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00083.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf
deleted file mode 100644
index 52ba39b96..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00084.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf
deleted file mode 100644
index f5c9053af..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00085.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf
deleted file mode 100644
index b7586ca61..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00086.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf
deleted file mode 100644
index 82f054999..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00087.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf
deleted file mode 100644
index 591c96b59..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00088.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf
deleted file mode 100644
index c8160954a..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00089.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf
deleted file mode 100644
index 895cfe26a..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00090.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf
deleted file mode 100644
index 3bdcae4ba..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00091.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf
deleted file mode 100644
index a56d47504..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00092.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf
deleted file mode 100644
index c85f3b4de..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00093.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf
deleted file mode 100644
index 875bf1df8..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/9nb00094.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/README b/XpConfig/C/print/models/HPDJ1600C/fonts/README
deleted file mode 100644
index cccc2be32..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/README
+++ /dev/null
@@ -1,197 +0,0 @@
-$Xorg: README,v 1.3 2000/08/17 19:48:04 cpqbld Exp $
-
-This directory contains "printer metric files" for the X Print
-Server suitable for the DeskJet 1600C printer. The following
-*.pmf files were generated by the Hewlett-Packard Company.
-
- 9nb00051.pmf
- 9nb00052.pmf
- 9nb00053.pmf
- 9nb00054.pmf
- 9nb00055.pmf
- 9nb00056.pmf
- 9nb00057.pmf
- 9nb00058.pmf
- 9nb00059.pmf
- 9nb00060.pmf
- 9nb00061.pmf
- 9nb00062.pmf
- 9nb00063.pmf
- 9nb00064.pmf
- 9nb00065.pmf
- 9nb00066.pmf
- 9nb00067.pmf
- 9nb00068.pmf
- 9nb00069.pmf
- 9nb00070.pmf
- 9nb00071.pmf
- 9nb00072.pmf
- 9nb00073.pmf
- 9nb00074.pmf
- 9nb00075.pmf
- 9nb00076.pmf
- 9nb00077.pmf
- 9nb00079.pmf
- 9nb00080.pmf
- 9nb00081.pmf
- 9nb00082.pmf
- 9nb00083.pmf
- 9nb00084.pmf
- 9nb00085.pmf
- 9nb00086.pmf
- 9nb00087.pmf
- 9nb00088.pmf
- 9nb00089.pmf
- 9nb00090.pmf
- 9nb00091.pmf
- 9nb00092.pmf
- 9nb00093.pmf
- 9nb00094.pmf
- lpr0ye1a.pmf
-
-For reasons of not supporting iso8859.1 and hp-roman8, the following
-DeskJet 1600C printer fonts were not converted to *.pmf files.
-
- 9nb00078.pmf
- 9nb00095.pmf
- lpr0ylga.pmf
- lpr0ypca.pmf
- lpr0ypda.pmf
- lpr0ypma.pmf
- lpr0yr8a.pmf
-
-Output from the conversion utility is as follows:
-
- Creating iso8859 1 pmf for 9nb00051.tfm as iso8859.1/9nb00051.pmf
- -COMPUGRAPHIC-Albertus-Extra Bold-r-Normal--8782-2500-2540-2540-P-42480-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00052.tfm as iso8859.1/9nb00052.pmf
- -COMPUGRAPHIC-Albertus-Semi Bold-r-Normal--8782-2500-2540-2540-P-37640-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00053.tfm as iso8859.1/9nb00053.pmf
- -COMPUGRAPHIC-Antique Olive-Bold-r-Normal--8782-2500-2540-2540-P-50490-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00054.tfm as iso8859.1/9nb00054.pmf
- -COMPUGRAPHIC-Antique Olive-Medium-i-Normal--8782-2500-2540-2540-P-46140-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00055.tfm as iso8859.1/9nb00055.pmf
- -COMPUGRAPHIC-Antique Olive-Medium-r-Normal--8782-2500-2540-2540-P-46380-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00056.tfm as iso8859.1/9nb00056.pmf
- -Monotype-Arial-Bold-r-Normal--2048-2500-589-589-P-9800-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00057.tfm as iso8859.1/9nb00057.pmf
- -Monotype-Arial-Medium-i-Normal--2048-2500-589-589-P-9040-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00058.tfm as iso8859.1/9nb00058.pmf
- -Monotype-Arial-Bold-i-Normal--2048-2500-589-589-P-9800-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00059.tfm as iso8859.1/9nb00059.pmf
- -Monotype-Arial-Medium-r-Normal--2048-2500-589-589-P-9040-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00060.tfm as iso8859.1/9nb00060.pmf
- -COMPUGRAPHIC-Clarendon-Bold-r-Condensed--8782-2500-2540-2540-P-35080-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00061.tfm as iso8859.1/9nb00061.pmf
- -COMPUGRAPHIC-Courier-Bold-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00062.tfm as iso8859.1/9nb00062.pmf
- -COMPUGRAPHIC-Courier-Medium-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00063.tfm as iso8859.1/9nb00063.pmf
- -COMPUGRAPHIC-Courier-Bold-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00064.tfm as iso8859.1/9nb00064.pmf
- -COMPUGRAPHIC-Courier-Medium-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00065.tfm as iso8859.1/9nb00065.pmf
- -COMPUGRAPHIC-Garamond-Bold-r-Normal--8782-2500-2540-2540-P-38730-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00066.tfm as iso8859.1/9nb00066.pmf
- -COMPUGRAPHIC-Garamond-Medium-i-Normal--8782-2500-2540-2540-P-34280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00067.tfm as iso8859.1/9nb00067.pmf
- -COMPUGRAPHIC-Garamond-Bold-i-Normal--8782-2500-2540-2540-P-37020-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00068.tfm as iso8859.1/9nb00068.pmf
- -COMPUGRAPHIC-Garamond-Medium-r-Normal--8782-2500-2540-2540-P-36560-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00069.tfm as iso8859.1/9nb00069.pmf
- -COMPUGRAPHIC-Letter Gothic-Bold-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00070.tfm as iso8859.1/9nb00070.pmf
- -COMPUGRAPHIC-Letter Gothic-Medium-i-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00071.tfm as iso8859.1/9nb00071.pmf
- -COMPUGRAPHIC-Letter Gothic-Medium-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00072.tfm as iso8859.1/9nb00072.pmf
- -COMPUGRAPHIC-Marigold-Medium-r-Normal--8782-2500-2540-2540-P-21890-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00073.tfm as iso8859.1/9nb00073.pmf
- -COMPUGRAPHIC-Omega-Bold-r-Normal--8782-2500-2540-2540-P-38600-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00074.tfm as iso8859.1/9nb00074.pmf
- -COMPUGRAPHIC-Omega-Medium-i-Normal--8782-2500-2540-2540-P-37980-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00075.tfm as iso8859.1/9nb00075.pmf
- -COMPUGRAPHIC-Omega-Bold-i-Normal--8782-2500-2540-2540-P-38560-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00076.tfm as iso8859.1/9nb00076.pmf
- -COMPUGRAPHIC-Omega-Medium-r-Normal--8782-2500-2540-2540-P-37770-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00077.tfm as iso8859.1/9nb00077.pmf
- -COMPUGRAPHIC-Coronet-Medium-i-Normal--8782-2500-2540-2540-P-22870-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00079.tfm as iso8859.1/9nb00079.pmf
- -Monotype-Times New Roman-Bold-r-Normal--2048-2500-589-589-P-8740-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00080.tfm as iso8859.1/9nb00080.pmf
- -Monotype-Times New Roman-Medium-i-Normal--2048-2500-589-589-P-8230-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00081.tfm as iso8859.1/9nb00081.pmf
- -Monotype-Times New Roman-Bold-i-Normal--2048-2500-589-589-P-8440-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00082.tfm as iso8859.1/9nb00082.pmf
- -Monotype-Times New Roman-Medium-r-Normal--2048-2500-589-589-P-8210-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00083.tfm as iso8859.1/9nb00083.pmf
- -COMPUGRAPHIC-Times-Bold-r-Normal--8782-2500-2540-2540-P-38200-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00084.tfm as iso8859.1/9nb00084.pmf
- -COMPUGRAPHIC-Times-Medium-i-Normal--8782-2500-2540-2540-P-36000-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00085.tfm as iso8859.1/9nb00085.pmf
- -COMPUGRAPHIC-Times-Bold-i-Normal--8782-2500-2540-2540-P-36900-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00086.tfm as iso8859.1/9nb00086.pmf
- -COMPUGRAPHIC-Times-Medium-r-Normal--8782-2500-2540-2540-P-36080-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00087.tfm as iso8859.1/9nb00087.pmf
- -COMPUGRAPHIC-Univers-Medium-i-Condensed--8782-2500-2540-2540-P-29970-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00088.tfm as iso8859.1/9nb00088.pmf
- -COMPUGRAPHIC-Univers-Bold-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00089.tfm as iso8859.1/9nb00089.pmf
- -COMPUGRAPHIC-Univers-Medium-r-Condensed--8782-2500-2540-2540-P-29970-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00090.tfm as iso8859.1/9nb00090.pmf
- -COMPUGRAPHIC-Univers-Bold-r-Condensed--8782-2500-2540-2540-P-33030-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00091.tfm as iso8859.1/9nb00091.pmf
- -COMPUGRAPHIC-Univers-Bold-i-Condensed--8782-2500-2540-2540-P-33030-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00092.tfm as iso8859.1/9nb00092.pmf
- -COMPUGRAPHIC-Univers-Medium-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00093.tfm as iso8859.1/9nb00093.pmf
- -COMPUGRAPHIC-Univers-Bold-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00094.tfm as iso8859.1/9nb00094.pmf
- -COMPUGRAPHIC-Univers-Medium-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for lpr0ye1a.tfm as iso8859.1/lpr0ye1a.pmf
- -HP-Line Printer-Medium-r-Normal--35-85-300-300-M-180-iso8859-1
- ------------------------------------
-
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias b/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias
deleted file mode 100644
index 1499aa845..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.alias
+++ /dev/null
@@ -1 +0,0 @@
-! So the file isn't empty
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir b/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir
deleted file mode 100644
index da702ccc1..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/fonts.dir
+++ /dev/null
@@ -1,45 +0,0 @@
-44
-lpr0ye1a.pmf -hp-line printer-medium-r-normal--35-85-300-300-m-180-iso8859-1
-9nb00080.pmf -monotype-times new roman-medium-i-normal--2048-2500-589-589-p-8230-iso8859-1
-9nb00092.pmf -compugraphic-univers-medium-i-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00081.pmf -monotype-times new roman-bold-i-normal--2048-2500-589-589-p-8440-iso8859-1
-9nb00093.pmf -compugraphic-univers-bold-i-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00082.pmf -monotype-times new roman-medium-r-normal--2048-2500-589-589-p-8210-iso8859-1
-9nb00090.pmf -compugraphic-univers-bold-r-condensed--8782-2500-2540-2540-p-33030-iso8859-1
-9nb00083.pmf -compugraphic-times-bold-r-normal--8782-2500-2540-2540-p-38200-iso8859-1
-9nb00091.pmf -compugraphic-univers-bold-i-condensed--8782-2500-2540-2540-p-33030-iso8859-1
-9nb00084.pmf -compugraphic-times-medium-i-normal--8782-2500-2540-2540-p-36000-iso8859-1
-9nb00085.pmf -compugraphic-times-bold-i-normal--8782-2500-2540-2540-p-36900-iso8859-1
-9nb00086.pmf -compugraphic-times-medium-r-normal--8782-2500-2540-2540-p-36080-iso8859-1
-9nb00094.pmf -compugraphic-univers-medium-r-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00087.pmf -compugraphic-univers-medium-i-condensed--8782-2500-2540-2540-p-29970-iso8859-1
-9nb00088.pmf -compugraphic-univers-bold-r-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00089.pmf -compugraphic-univers-medium-r-condensed--8782-2500-2540-2540-p-29970-iso8859-1
-9nb00058.pmf -monotype-arial-bold-i-normal--2048-2500-589-589-p-9800-iso8859-1
-9nb00059.pmf -monotype-arial-medium-r-normal--2048-2500-589-589-p-9040-iso8859-1
-9nb00068.pmf -compugraphic-garamond-medium-r-normal--8782-2500-2540-2540-p-36560-iso8859-1
-9nb00069.pmf -compugraphic-letter gothic-bold-r-normal--8782-2500-2540-2540-m-44090-iso8859-1
-9nb00079.pmf -monotype-times new roman-bold-r-normal--2048-2500-589-589-p-8740-iso8859-1
-9nb00052.pmf -compugraphic-albertus-semi bold-r-normal--8782-2500-2540-2540-p-37640-iso8859-1
-9nb00064.pmf -compugraphic-courier-medium-r-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00076.pmf -compugraphic-omega-medium-r-normal--8782-2500-2540-2540-p-37770-iso8859-1
-9nb00053.pmf -compugraphic-antique olive-bold-r-normal--8782-2500-2540-2540-p-50490-iso8859-1
-9nb00065.pmf -compugraphic-garamond-bold-r-normal--8782-2500-2540-2540-p-38730-iso8859-1
-9nb00077.pmf -compugraphic-coronet-medium-i-normal--8782-2500-2540-2540-p-22870-iso8859-1
-9nb00066.pmf -compugraphic-garamond-medium-i-normal--8782-2500-2540-2540-p-34280-iso8859-1
-9nb00074.pmf -compugraphic-omega-medium-i-normal--8782-2500-2540-2540-p-37980-iso8859-1
-9nb00051.pmf -compugraphic-albertus-extra bold-r-normal--8782-2500-2540-2540-p-42480-iso8859-1
-9nb00067.pmf -compugraphic-garamond-bold-i-normal--8782-2500-2540-2540-p-37020-iso8859-1
-9nb00075.pmf -compugraphic-omega-bold-i-normal--8782-2500-2540-2540-p-38560-iso8859-1
-9nb00056.pmf -monotype-arial-bold-r-normal--2048-2500-589-589-p-9800-iso8859-1
-9nb00060.pmf -compugraphic-clarendon-bold-r-condensed--8782-2500-2540-2540-p-35080-iso8859-1
-9nb00072.pmf -compugraphic-marigold-medium-r-normal--8782-2500-2540-2540-p-21890-iso8859-1
-9nb00057.pmf -monotype-arial-medium-i-normal--2048-2500-589-589-p-9040-iso8859-1
-9nb00061.pmf -compugraphic-courier-bold-r-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00073.pmf -compugraphic-omega-bold-r-normal--8782-2500-2540-2540-p-38600-iso8859-1
-9nb00054.pmf -compugraphic-antique olive-medium-i-normal--8782-2500-2540-2540-p-46140-iso8859-1
-9nb00062.pmf -compugraphic-courier-medium-i-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00070.pmf -compugraphic-letter gothic-medium-i-normal--8782-2500-2540-2540-m-44090-iso8859-1
-9nb00055.pmf -compugraphic-antique olive-medium-r-normal--8782-2500-2540-2540-p-46380-iso8859-1
-9nb00063.pmf -compugraphic-courier-bold-i-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00071.pmf -compugraphic-letter gothic-medium-r-normal--8782-2500-2540-2540-m-44090-iso8859-1
diff --git a/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf b/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf
deleted file mode 100644
index 483748893..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/fonts/lpr0ye1a.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPDJ1600C/model-config b/XpConfig/C/print/models/HPDJ1600C/model-config
deleted file mode 100644
index f3bd8af3a..000000000
--- a/XpConfig/C/print/models/HPDJ1600C/model-config
+++ /dev/null
@@ -1,44 +0,0 @@
-# $Xorg: model-config,v 1.3 2000/08/17 19:48:04 cpqbld Exp $
-# This is the configuration file for the HP DeskJet 1600C printer.
-#
-# The CDEnext SI supports two 1600C drivers XP-PCL-MONO and
-# XP-PCL-COLOR, which work with this configuration file.
-#
-# Attribute IDs must be qualified using either the printer-model
-# identifier or an asterisk ('*'). For example, if "HPDJ1600C" is the
-# printer-model, then to initialize the 'plexes-supported' attribute
-# to 'simplex', use: "HPDJ1600C.plexes-supported: simplex". For the
-# asterisk, use: "*.plexes-supported: simplex". If the same attribute
-# is specified using each method, the printer-model qualified entry
-# takes precedence.
-
-HPDJ1600C.printer-model: "Hewlett-Packard DeskJet 1600C"
-HPDJ1600C.printer-resolutions-supported: 300
-HPDJ1600C.content-orientations-supported: portrait landscape
-HPDJ1600C.document-formats-supported: {PCL 5} {PostScript 2}
-HPDJ1600C.plexes-supported: simplex duplex
-HPDJ1600C.xp-ddx-identifier: XP-PCL-COLOR
-HPDJ1600C.xp-embedded-formats-supported: { PCL 5 } { PostScript 2 }
-HPDJ1600C.xp-setup-proviso: setup-optional
-
-# 1/4" unprintable margins
-HPDJ1600C.medium-source-sizes-supported:\
-{ '' \
- {na-letter FALSE {6.35 209.55 6.35 273.05}}\
- {executive FALSE {6.35 177.75 6.35 260.35}}\
- {na-legal FALSE {6.35 209.55 6.35 349.25}}\
- {iso-a3 FALSE {6.35 290.65 6.35 413.35}}\
- {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\
- {jis-b4 FALSE {6.35 251.65 6.35 367.65}}\
- {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\
- {monarch-envelope FALSE {6.35 91.94 6.35 184.15}}\
- {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\
- {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\
- {na-number-10-envelope FALSE {6.35 98.45 6.35 234.95}}\
- {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\
- {ledger FALSE {6.35 273.05 6.35 425.45}}\
- {b FALSE {6.35 273.05 6.35 425.45}}\
- {hp-japanese-postcard FALSE {6 94 6 142 }}\
- {hp-japanese-doublepostcard FALSE {6 142 6 194 }}\
-}
-
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf
deleted file mode 100644
index 09cc489a5..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00051.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf
deleted file mode 100644
index b21a9a2a8..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00052.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf
deleted file mode 100644
index 485b874c5..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00053.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf
deleted file mode 100644
index 524934c71..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00054.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf
deleted file mode 100644
index 2ef9bc52c..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00055.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf
deleted file mode 100644
index 3d69311ef..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00056.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf
deleted file mode 100644
index 3833d4f54..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00057.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf
deleted file mode 100644
index 289a95e5c..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00058.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf
deleted file mode 100644
index a5984bed1..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00059.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf
deleted file mode 100644
index df27cd71e..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00060.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf
deleted file mode 100644
index fb2b5a433..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00061.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf
deleted file mode 100644
index f0e58c435..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00062.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf
deleted file mode 100644
index 8821ff155..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00063.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf
deleted file mode 100644
index e5980fc0e..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00064.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf
deleted file mode 100644
index d9a151d7f..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00065.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf
deleted file mode 100644
index d14fca56f..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00066.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf
deleted file mode 100644
index 7a341506f..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00067.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf
deleted file mode 100644
index c20e39a21..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00068.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf
deleted file mode 100644
index 4a4a35281..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00069.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf
deleted file mode 100644
index 8d97d4339..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00070.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf
deleted file mode 100644
index 19844c9c6..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00071.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf
deleted file mode 100644
index 5415c3f44..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00072.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf
deleted file mode 100644
index 038dfdb46..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00073.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf
deleted file mode 100644
index 382a78575..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00074.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf
deleted file mode 100644
index 1c7edf653..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00075.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf
deleted file mode 100644
index 2f077f40f..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00076.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf
deleted file mode 100644
index 1ce190d51..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00077.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf
deleted file mode 100644
index 45d6906ba..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00079.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf
deleted file mode 100644
index b991b5edb..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00080.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf
deleted file mode 100644
index 1935a9f00..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00081.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf
deleted file mode 100644
index 2000dc057..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00082.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf
deleted file mode 100644
index 90f0e45a8..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00083.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf
deleted file mode 100644
index 52ba39b96..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00084.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf
deleted file mode 100644
index f5c9053af..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00085.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf
deleted file mode 100644
index b7586ca61..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00086.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf
deleted file mode 100644
index 82f054999..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00087.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf
deleted file mode 100644
index 591c96b59..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00088.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf
deleted file mode 100644
index c8160954a..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00089.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf
deleted file mode 100644
index 895cfe26a..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00090.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf
deleted file mode 100644
index 3bdcae4ba..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00091.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf
deleted file mode 100644
index a56d47504..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00092.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf
deleted file mode 100644
index c85f3b4de..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00093.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf
deleted file mode 100644
index 875bf1df8..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/9nb00094.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/README b/XpConfig/C/print/models/HPLJ4family/fonts/README
deleted file mode 100644
index 2c9821834..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/README
+++ /dev/null
@@ -1,203 +0,0 @@
-$Xorg: README,v 1.3 2000/08/17 19:48:04 cpqbld Exp $
-
-This directory contains "printer metric files" for the X Print
-Server suitable for the LaserJet 4 family of printers - 4, 4L,
-4M, 4ML, 4MP, 4P, 4Si, 4Si-MX. The following *.pmf files were
-generated by the Hewlett-Packard Company.
-
- 9nb00051.pmf
- 9nb00052.pmf
- 9nb00053.pmf
- 9nb00054.pmf
- 9nb00055.pmf
- * 9nb00056.pmf
- * 9nb00057.pmf
- * 9nb00058.pmf
- * 9nb00059.pmf
- * 9nb00060.pmf
- 9nb00061.pmf
- 9nb00062.pmf
- 9nb00063.pmf
- 9nb00064.pmf
- * 9nb00065.pmf
- * 9nb00066.pmf
- * 9nb00067.pmf
- * 9nb00068.pmf
- 9nb00069.pmf
- 9nb00070.pmf
- 9nb00071.pmf
- * 9nb00072.pmf
- * 9nb00073.pmf
- * 9nb00074.pmf
- * 9nb00075.pmf
- * 9nb00076.pmf
- 9nb00077.pmf
- * 9nb00079.pmf
- * 9nb00080.pmf
- * 9nb00081.pmf
- * 9nb00082.pmf
- 9nb00083.pmf
- 9nb00084.pmf
- 9nb00085.pmf
- 9nb00086.pmf
- 9nb00087.pmf
- 9nb00088.pmf
- 9nb00089.pmf
- 9nb00090.pmf
- 9nb00091.pmf
- 9nb00092.pmf
- 9nb00093.pmf
- 9nb00094.pmf
- lpr0ye1a.pmf
-
-
- * note - the marked fonts are NOT supported by the 4L printer. If
- making extensive use of the 4L, you may want to create a special
- 4L model-config area and exclude these fonts.
-
-For reasons of not supporting iso8859.1 and hp-roman8, the following
-Laserjet 4 printer fonts were not converted to *.pmf files.
-
- 9nb00078.pmf
- 9nb00095.pmf
- lpr0ylga.pmf
- lpr0ypca.pmf
- lpr0ypda.pmf
- lpr0ypma.pmf
- lpr0yr8a.pmf
-
-Output from the conversion utility is as follows:
-
- Creating iso8859 1 pmf for 9nb00051.tfm as iso8859.1/9nb00051.pmf
- -COMPUGRAPHIC-Albertus-Extra Bold-r-Normal--8782-2500-2540-2540-P-42480-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00052.tfm as iso8859.1/9nb00052.pmf
- -COMPUGRAPHIC-Albertus-Semi Bold-r-Normal--8782-2500-2540-2540-P-37640-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00053.tfm as iso8859.1/9nb00053.pmf
- -COMPUGRAPHIC-Antique Olive-Bold-r-Normal--8782-2500-2540-2540-P-50490-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00054.tfm as iso8859.1/9nb00054.pmf
- -COMPUGRAPHIC-Antique Olive-Medium-i-Normal--8782-2500-2540-2540-P-46140-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00055.tfm as iso8859.1/9nb00055.pmf
- -COMPUGRAPHIC-Antique Olive-Medium-r-Normal--8782-2500-2540-2540-P-46380-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00056.tfm as iso8859.1/9nb00056.pmf
- -Monotype-Arial-Bold-r-Normal--2048-2500-589-589-P-9800-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00057.tfm as iso8859.1/9nb00057.pmf
- -Monotype-Arial-Medium-i-Normal--2048-2500-589-589-P-9040-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00058.tfm as iso8859.1/9nb00058.pmf
- -Monotype-Arial-Bold-i-Normal--2048-2500-589-589-P-9800-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00059.tfm as iso8859.1/9nb00059.pmf
- -Monotype-Arial-Medium-r-Normal--2048-2500-589-589-P-9040-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00060.tfm as iso8859.1/9nb00060.pmf
- -COMPUGRAPHIC-Clarendon-Bold-r-Condensed--8782-2500-2540-2540-P-35080-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00061.tfm as iso8859.1/9nb00061.pmf
- -COMPUGRAPHIC-Courier-Bold-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00062.tfm as iso8859.1/9nb00062.pmf
- -COMPUGRAPHIC-Courier-Medium-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00063.tfm as iso8859.1/9nb00063.pmf
- -COMPUGRAPHIC-Courier-Bold-i-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00064.tfm as iso8859.1/9nb00064.pmf
- -COMPUGRAPHIC-Courier-Medium-r-Normal--8782-2500-2540-2540-M-52910-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00065.tfm as iso8859.1/9nb00065.pmf
- -COMPUGRAPHIC-Garamond-Bold-r-Normal--8782-2500-2540-2540-P-38730-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00066.tfm as iso8859.1/9nb00066.pmf
- -COMPUGRAPHIC-Garamond-Medium-i-Normal--8782-2500-2540-2540-P-34280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00067.tfm as iso8859.1/9nb00067.pmf
- -COMPUGRAPHIC-Garamond-Bold-i-Normal--8782-2500-2540-2540-P-37020-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00068.tfm as iso8859.1/9nb00068.pmf
- -COMPUGRAPHIC-Garamond-Medium-r-Normal--8782-2500-2540-2540-P-36560-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00069.tfm as iso8859.1/9nb00069.pmf
- -COMPUGRAPHIC-Letter Gothic-Bold-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00070.tfm as iso8859.1/9nb00070.pmf
- -COMPUGRAPHIC-Letter Gothic-Medium-i-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00071.tfm as iso8859.1/9nb00071.pmf
- -COMPUGRAPHIC-Letter Gothic-Medium-r-Normal--8782-2500-2540-2540-M-44090-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00072.tfm as iso8859.1/9nb00072.pmf
- -COMPUGRAPHIC-Marigold-Medium-r-Normal--8782-2500-2540-2540-P-21890-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00073.tfm as iso8859.1/9nb00073.pmf
- -COMPUGRAPHIC-Omega-Bold-r-Normal--8782-2500-2540-2540-P-38600-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00074.tfm as iso8859.1/9nb00074.pmf
- -COMPUGRAPHIC-Omega-Medium-i-Normal--8782-2500-2540-2540-P-37980-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00075.tfm as iso8859.1/9nb00075.pmf
- -COMPUGRAPHIC-Omega-Bold-i-Normal--8782-2500-2540-2540-P-38560-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00076.tfm as iso8859.1/9nb00076.pmf
- -COMPUGRAPHIC-Omega-Medium-r-Normal--8782-2500-2540-2540-P-37770-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00077.tfm as iso8859.1/9nb00077.pmf
- -COMPUGRAPHIC-Coronet-Medium-i-Normal--8782-2500-2540-2540-P-22870-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00079.tfm as iso8859.1/9nb00079.pmf
- -Monotype-Times New Roman-Bold-r-Normal--2048-2500-589-589-P-8740-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00080.tfm as iso8859.1/9nb00080.pmf
- -Monotype-Times New Roman-Medium-i-Normal--2048-2500-589-589-P-8230-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00081.tfm as iso8859.1/9nb00081.pmf
- -Monotype-Times New Roman-Bold-i-Normal--2048-2500-589-589-P-8440-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00082.tfm as iso8859.1/9nb00082.pmf
- -Monotype-Times New Roman-Medium-r-Normal--2048-2500-589-589-P-8210-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00083.tfm as iso8859.1/9nb00083.pmf
- -COMPUGRAPHIC-Times-Bold-r-Normal--8782-2500-2540-2540-P-38200-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00084.tfm as iso8859.1/9nb00084.pmf
- -COMPUGRAPHIC-Times-Medium-i-Normal--8782-2500-2540-2540-P-36000-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00085.tfm as iso8859.1/9nb00085.pmf
- -COMPUGRAPHIC-Times-Bold-i-Normal--8782-2500-2540-2540-P-36900-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00086.tfm as iso8859.1/9nb00086.pmf
- -COMPUGRAPHIC-Times-Medium-r-Normal--8782-2500-2540-2540-P-36080-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00087.tfm as iso8859.1/9nb00087.pmf
- -COMPUGRAPHIC-Univers-Medium-i-Condensed--8782-2500-2540-2540-P-29970-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00088.tfm as iso8859.1/9nb00088.pmf
- -COMPUGRAPHIC-Univers-Bold-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00089.tfm as iso8859.1/9nb00089.pmf
- -COMPUGRAPHIC-Univers-Medium-r-Condensed--8782-2500-2540-2540-P-29970-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00090.tfm as iso8859.1/9nb00090.pmf
- -COMPUGRAPHIC-Univers-Bold-r-Condensed--8782-2500-2540-2540-P-33030-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00091.tfm as iso8859.1/9nb00091.pmf
- -COMPUGRAPHIC-Univers-Bold-i-Condensed--8782-2500-2540-2540-P-33030-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00092.tfm as iso8859.1/9nb00092.pmf
- -COMPUGRAPHIC-Univers-Medium-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00093.tfm as iso8859.1/9nb00093.pmf
- -COMPUGRAPHIC-Univers-Bold-i-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for 9nb00094.tfm as iso8859.1/9nb00094.pmf
- -COMPUGRAPHIC-Univers-Medium-r-Normal--8782-2500-2540-2540-P-41280-iso8859-1
- ------------------------------------
- Creating iso8859 1 pmf for lpr0ye1a.tfm as iso8859.1/lpr0ye1a.pmf
- -HP-Line Printer-Medium-r-Normal--35-85-300-300-M-180-iso8859-1
- ------------------------------------
-
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias b/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias
deleted file mode 100644
index 1499aa845..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/fonts.alias
+++ /dev/null
@@ -1 +0,0 @@
-! So the file isn't empty
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir b/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir
deleted file mode 100644
index da702ccc1..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/fonts.dir
+++ /dev/null
@@ -1,45 +0,0 @@
-44
-lpr0ye1a.pmf -hp-line printer-medium-r-normal--35-85-300-300-m-180-iso8859-1
-9nb00080.pmf -monotype-times new roman-medium-i-normal--2048-2500-589-589-p-8230-iso8859-1
-9nb00092.pmf -compugraphic-univers-medium-i-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00081.pmf -monotype-times new roman-bold-i-normal--2048-2500-589-589-p-8440-iso8859-1
-9nb00093.pmf -compugraphic-univers-bold-i-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00082.pmf -monotype-times new roman-medium-r-normal--2048-2500-589-589-p-8210-iso8859-1
-9nb00090.pmf -compugraphic-univers-bold-r-condensed--8782-2500-2540-2540-p-33030-iso8859-1
-9nb00083.pmf -compugraphic-times-bold-r-normal--8782-2500-2540-2540-p-38200-iso8859-1
-9nb00091.pmf -compugraphic-univers-bold-i-condensed--8782-2500-2540-2540-p-33030-iso8859-1
-9nb00084.pmf -compugraphic-times-medium-i-normal--8782-2500-2540-2540-p-36000-iso8859-1
-9nb00085.pmf -compugraphic-times-bold-i-normal--8782-2500-2540-2540-p-36900-iso8859-1
-9nb00086.pmf -compugraphic-times-medium-r-normal--8782-2500-2540-2540-p-36080-iso8859-1
-9nb00094.pmf -compugraphic-univers-medium-r-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00087.pmf -compugraphic-univers-medium-i-condensed--8782-2500-2540-2540-p-29970-iso8859-1
-9nb00088.pmf -compugraphic-univers-bold-r-normal--8782-2500-2540-2540-p-41280-iso8859-1
-9nb00089.pmf -compugraphic-univers-medium-r-condensed--8782-2500-2540-2540-p-29970-iso8859-1
-9nb00058.pmf -monotype-arial-bold-i-normal--2048-2500-589-589-p-9800-iso8859-1
-9nb00059.pmf -monotype-arial-medium-r-normal--2048-2500-589-589-p-9040-iso8859-1
-9nb00068.pmf -compugraphic-garamond-medium-r-normal--8782-2500-2540-2540-p-36560-iso8859-1
-9nb00069.pmf -compugraphic-letter gothic-bold-r-normal--8782-2500-2540-2540-m-44090-iso8859-1
-9nb00079.pmf -monotype-times new roman-bold-r-normal--2048-2500-589-589-p-8740-iso8859-1
-9nb00052.pmf -compugraphic-albertus-semi bold-r-normal--8782-2500-2540-2540-p-37640-iso8859-1
-9nb00064.pmf -compugraphic-courier-medium-r-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00076.pmf -compugraphic-omega-medium-r-normal--8782-2500-2540-2540-p-37770-iso8859-1
-9nb00053.pmf -compugraphic-antique olive-bold-r-normal--8782-2500-2540-2540-p-50490-iso8859-1
-9nb00065.pmf -compugraphic-garamond-bold-r-normal--8782-2500-2540-2540-p-38730-iso8859-1
-9nb00077.pmf -compugraphic-coronet-medium-i-normal--8782-2500-2540-2540-p-22870-iso8859-1
-9nb00066.pmf -compugraphic-garamond-medium-i-normal--8782-2500-2540-2540-p-34280-iso8859-1
-9nb00074.pmf -compugraphic-omega-medium-i-normal--8782-2500-2540-2540-p-37980-iso8859-1
-9nb00051.pmf -compugraphic-albertus-extra bold-r-normal--8782-2500-2540-2540-p-42480-iso8859-1
-9nb00067.pmf -compugraphic-garamond-bold-i-normal--8782-2500-2540-2540-p-37020-iso8859-1
-9nb00075.pmf -compugraphic-omega-bold-i-normal--8782-2500-2540-2540-p-38560-iso8859-1
-9nb00056.pmf -monotype-arial-bold-r-normal--2048-2500-589-589-p-9800-iso8859-1
-9nb00060.pmf -compugraphic-clarendon-bold-r-condensed--8782-2500-2540-2540-p-35080-iso8859-1
-9nb00072.pmf -compugraphic-marigold-medium-r-normal--8782-2500-2540-2540-p-21890-iso8859-1
-9nb00057.pmf -monotype-arial-medium-i-normal--2048-2500-589-589-p-9040-iso8859-1
-9nb00061.pmf -compugraphic-courier-bold-r-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00073.pmf -compugraphic-omega-bold-r-normal--8782-2500-2540-2540-p-38600-iso8859-1
-9nb00054.pmf -compugraphic-antique olive-medium-i-normal--8782-2500-2540-2540-p-46140-iso8859-1
-9nb00062.pmf -compugraphic-courier-medium-i-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00070.pmf -compugraphic-letter gothic-medium-i-normal--8782-2500-2540-2540-m-44090-iso8859-1
-9nb00055.pmf -compugraphic-antique olive-medium-r-normal--8782-2500-2540-2540-p-46380-iso8859-1
-9nb00063.pmf -compugraphic-courier-bold-i-normal--8782-2500-2540-2540-m-52910-iso8859-1
-9nb00071.pmf -compugraphic-letter gothic-medium-r-normal--8782-2500-2540-2540-m-44090-iso8859-1
diff --git a/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf b/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf
deleted file mode 100644
index 483748893..000000000
--- a/XpConfig/C/print/models/HPLJ4family/fonts/lpr0ye1a.pmf
+++ /dev/null
Binary files differ
diff --git a/XpConfig/C/print/models/HPLJ4family/model-config b/XpConfig/C/print/models/HPLJ4family/model-config
deleted file mode 100644
index f69e25718..000000000
--- a/XpConfig/C/print/models/HPLJ4family/model-config
+++ /dev/null
@@ -1,44 +0,0 @@
-# $Xorg: model-config,v 1.3 2000/08/17 19:48:04 cpqbld Exp $
-# This is the configuration file for the HP LaserJet 4 Printers.
-#
-# Though not a deliverable for the CDEnext SI, the XP-PCL-MONO
-# driver should be able to support the LaserJet 4 printers.
-#
-# Attribute IDs must be qualified using either the printer-model
-# identifier or an asterisk ('*'). For example, if "HPLJ4family" is the
-# printer-model, then to initialize the 'plexes-supported' attribute
-# to 'simplex', use: "HPLJ4family.plexes-supported: simplex". For the
-# asterisk, use: "*.plexes-supported: simplex". If the same attribute
-# is specified using each method, the printer-model qualified entry
-# takes precedence.
-
-HPLJ4family.printer-model: "Hewlett-Packard LaserJet 4 Series"
-HPLJ4family.printer-resolutions-supported: 300 600
-HPLJ4family.content-orientations-supported: portrait landscape
-HPLJ4family.document-formats-supported: {PCL 5} {PostScript 2}
-HPLJ4family.plexes-supported: simplex duplex
-HPLJ4family.xp-ddx-identifier: XP-PCL-MONO
-HPLJ4family.xp-embedded-formats-supported: { PCL 5 } { PostScript 2 }
-HPLJ4family.xp-setup-proviso: setup-optional
-
-# 1/4" unprintable margins
-HPLJ4family.medium-source-sizes-supported:\
-{ '' \
- {na-letter FALSE {6.35 209.55 6.35 273.05}}\
- {executive FALSE {6.35 177.75 6.35 260.35}}\
- {na-legal FALSE {6.35 209.55 6.35 349.25}}\
- {iso-a3 FALSE {6.35 290.65 6.35 413.35}}\
- {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\
- {jis-b4 FALSE {6.35 251.65 6.35 367.65}}\
- {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\
- {monarch-envelope FALSE {6.35 91.94 6.35 184.15}}\
- {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\
- {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\
- {na-number-10-envelope FALSE {6.35 98.45 6.35 234.95}}\
- {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\
- {ledger FALSE {6.35 273.05 6.35 425.45}}\
- {b FALSE {6.35 273.05 6.35 425.45}}\
- {hp-japanese-postcard FALSE {6 94 6 142 }}\
- {hp-japanese-doublepostcard FALSE {6 142 6 194 }}\
-}
-
diff --git a/XpConfig/C/print/models/SPSPARC2/model-config b/XpConfig/C/print/models/SPSPARC2/model-config
deleted file mode 100644
index 959e9ff7b..000000000
--- a/XpConfig/C/print/models/SPSPARC2/model-config
+++ /dev/null
@@ -1,13 +0,0 @@
-# $Xorg: model-config,v 1.3 2000/08/17 19:48:04 cpqbld Exp $
-SPSPARC2.printer-model: "SunPics SPARCprinter II"
-SPSPARC2.printer-resolutions-supported: 300
-SPSPARC2.content-orientations-supported: portrait landscape
-SPSPARC2.document-formats-supported: {PostScript 2}
-SPSPARC2.plexes-supported: simplex
-SPSPARC2.xp-ddx-identifier: XP-POSTSCRIPT
-SPSPARC2.xp-embedded-formats-supported: { PostScript 2 }
-*xp-setup-proviso: setup-optional
-SPSPARC2.medium-source-sizes-supported: \
- { '' {na-letter FALSE {6.35 209.55 6.35 273.05}} \
- {na-legal FALSE {6.35 209.55 6.35 349.25}} \
- {iso-a4 FALSE {6.35 203.65 6.35 290.65}}}
diff --git a/Xprint/AttrValid.c b/Xprint/AttrValid.c
deleted file mode 100644
index 83d6b9674..000000000
--- a/Xprint/AttrValid.c
+++ /dev/null
@@ -1,700 +0,0 @@
-/* $Xorg: AttrValid.c,v 1.4 2001/03/14 18:43:17 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/AttrValid.c,v 1.5 2001/12/21 21:02:04 dawes Exp $ */
-
-#include <scrnintstr.h>
-
-#include "attributes.h"
-
-/*
- * default medium-source-sizes supported = na-letter w/.25" margins
- */
-static XpOidMediumDiscreteSize DefaultMediumSize = {
- xpoid_val_medium_size_na_letter, xFalse, {6.35, 209.55, 6.35, 273.05}
-};
-static XpOidMediumDiscreteSizeList DefaultMediumSizeList = {
- &DefaultMediumSize, 1
-};
-static XpOidMediumSourceSize DefaultMediumSourceSize = {
- xpoid_unspecified, XpOidMediumSS_DISCRETE, { &DefaultMediumSizeList }
-};
-static XpOidMediumSS DefaultMediumSS = {
- &DefaultMediumSourceSize, 1
-};
-
-/*
- * if 'valid_oid_list' is NULL any oid found is considered valid
- */
-XpOid
-XpGetOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oid_list)
-{
- XpOid value_oid;
-
- value_oid = XpOidFromString(XpGetStringAttr(pContext, pool, oid));
- if((const XpOidList*)NULL == valid_oid_list
- ||
- XpOidListHasOid(valid_oid_list, value_oid))
- {
- return value_oid;
- }
- else
- {
- return xpoid_none;
- }
-}
-
-void
-XpPutOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- XpOid value_oid)
-{
- XpPutStringAttr(pContext, pool, oid, XpOidString(value_oid));
-}
-
-void
-XpValidateOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oids,
- XpOid default_oid)
-{
- XpOid value_oid;
- value_oid = XpGetOidAttr(pContext, pool, oid, valid_oids);
- XpPutOidAttr(pContext, pool, oid,
- value_oid == xpoid_none ? default_oid : value_oid);
-}
-
-/*
- * if 'valid_card_list' is NULL any cardinal found is considered valid
- */
-unsigned long
-XpGetCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_card_list)
-{
- unsigned long value_card;
-
- if(XpOidParseUnsignedValue(XpGetStringAttr(pContext, pool, oid),
- (const char**)NULL,
- &value_card))
- {
- if((const XpOidCardList*)NULL == valid_card_list
- ||
- XpOidCardListHasCard(valid_card_list, value_card))
- {
- return value_card;
- }
- }
- return 0;
-}
-
-void
-XpPutCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- unsigned long value_card)
-{
- if(value_card > 0)
- {
- char value_out[16];
- sprintf(value_out, "%lu", value_card);
- XpPutStringAttr(pContext, pool, oid, value_out);
- }
- else
- XpPutStringAttr(pContext, pool, oid, (const char*)NULL);
-}
-
-void
-XpValidateCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_cards,
- unsigned long default_card)
-{
- unsigned long value_card;
- value_card = XpGetCardAttr(pContext, pool, oid, valid_cards);
- XpPutCardAttr(pContext, pool, oid,
- value_card == 0 ? default_card : value_card);
-}
-
-XpOidList*
-XpGetListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oid_list)
-{
- return XpOidListNew(XpGetStringAttr(pContext, pool, oid), valid_oid_list);
-}
-
-void
-XpPutListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* list)
-{
- char* value_out;
-
- value_out = XpOidListString(list);
- XpPutStringAttr(pContext, pool, oid, value_out);
- XpOidFree(value_out);
-}
-
-void
-XpValidateListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oids,
- const XpOidList* default_oids)
-{
- XpOidList* list = XpGetListAttr(pContext, pool, oid, valid_oids);
- if(XpOidListCount(list) == 0)
- XpPutListAttr(pContext, pool, oid, default_oids);
- else
- XpPutListAttr(pContext, pool, oid, list);
- XpOidListDelete(list);
-}
-
-XpOidCardList*
-XpGetCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_card_list)
-{
- return XpOidCardListNew(XpGetStringAttr(pContext, pool, oid),
- valid_card_list);
-}
-
-void
-XpPutCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* list)
-{
- char* value_out;
-
- value_out = XpOidCardListString(list);
- XpPutStringAttr(pContext, pool, oid, value_out);
- XpOidFree(value_out);
-}
-
-void
-XpValidateCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_cards,
- const XpOidCardList* default_cards)
-{
- XpOidCardList* list = XpGetCardListAttr(pContext, pool, oid, valid_cards);
- if(XpOidCardListCount(list) == 0 && (XpOidCardList*)NULL != default_cards)
- XpPutCardListAttr(pContext, pool, oid, default_cards);
- else
- XpPutCardListAttr(pContext, pool, oid, list);
- XpOidCardListDelete(list);
-}
-
-XpOidDocFmtList*
-XpGetDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* valid_fmt_list)
-{
- return XpOidDocFmtListNew(XpGetStringAttr(pContext, pool, oid),
- valid_fmt_list);
-}
-
-void
-XpPutDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* list)
-{
- char* value_out;
-
- value_out = XpOidDocFmtListString(list);
- XpPutStringAttr(pContext, pool, oid, value_out);
- XpOidFree(value_out);
-}
-
-void
-XpValidateDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* valid_fmts,
- const XpOidDocFmtList* default_fmts)
-{
- XpOidDocFmtList* list;
-
- list = XpGetDocFmtListAttr(pContext, pool, oid, valid_fmts);
- if(XpOidDocFmtListCount(list) == 0
- &&
- (XpOidDocFmtList*)NULL != default_fmts)
- {
- XpPutDocFmtListAttr(pContext, pool, oid, default_fmts);
- }
- else
- {
- XpPutDocFmtListAttr(pContext, pool, oid, list);
- }
- XpOidDocFmtListDelete(list);
-}
-
-XpOidMediumSS*
-XpGetMediumSSAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_trays,
- const XpOidList* valid_sizes)
-{
- return XpOidMediumSSNew(XpGetStringAttr(pContext, pool, oid),
- valid_trays, valid_sizes);
-}
-
-void
-XpPutMediumSSAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidMediumSS* msss)
-{
- char* value_out;
-
- value_out = XpOidMediumSSString(msss);
- XpPutStringAttr(pContext, pool, oid, value_out);
- XpOidFree(value_out);
-}
-
-const XpOidMediumSS*
-XpGetDefaultMediumSS(void)
-{
- return &DefaultMediumSS;
-}
-
-XpOidTrayMediumList*
-XpGetTrayMediumListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_trays,
- const XpOidMediumSS* msss)
-{
- return XpOidTrayMediumListNew(XpGetStringAttr(pContext, pool, oid),
- valid_trays, msss);
-}
-
-void
-XpPutTrayMediumListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidTrayMediumList* tm)
-{
- char* value_out;
-
- value_out = XpOidTrayMediumListString(tm);
- XpPutStringAttr(pContext, pool, oid, value_out);
- XpOidFree(value_out);
-}
-
-void
-XpValidatePrinterMediaAttrs(XpContextPtr pContext,
- const XpOidList* valid_trays,
- const XpOidList* valid_sizes)
-{
- const XpOidMediumSS* msss;
- XpOidMediumSS* pool_msss;
- XpOidTrayMediumList* tm;
-
- pool_msss = XpGetMediumSSAttr(pContext, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported,
- valid_trays, valid_sizes);
- if(0 == XpOidMediumSSCount(pool_msss))
- msss = XpGetDefaultMediumSS();
- else
- msss = pool_msss;
- XpPutMediumSSAttr(pContext, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported, msss);
-
- tm = XpGetTrayMediumListAttr(pContext, XPPrinterAttr,
- xpoid_att_input_trays_medium,
- valid_trays, msss);
- XpPutTrayMediumListAttr(pContext, XPPrinterAttr,
- xpoid_att_input_trays_medium, tm);
-
- XpOidMediumSSDelete(pool_msss);
- XpOidTrayMediumListDelete(tm);
-}
-
-
-void
-XpValidatePrinterPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr)
-{
- /*
- * content-orientations-supported
- */
- XpValidateListAttr(pContext, XPPrinterAttr,
- xpoid_att_content_orientations_supported,
- vpr->valid_content_orientations_supported,
- vpr->default_content_orientations_supported);
- /*
- * document-formats-supported
- */
- XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
- xpoid_att_document_formats_supported,
- vpr->valid_document_formats_supported,
- vpr->default_document_formats_supported);
- /*
- * plexes-supported
- */
- XpValidateListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported,
- vpr->valid_plexes_supported,
- vpr->default_plexes_supported);
- /*
- * printer-resolutions-supported
- */
- XpValidateCardListAttr(pContext, XPPrinterAttr,
- xpoid_att_printer_resolutions_supported,
- vpr->valid_printer_resolutions_supported,
- vpr->default_printer_resolutions_supported);
- /*
- * xp-embedded-formats-supported
- */
- XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
- xpoid_att_xp_embedded_formats_supported,
- vpr->valid_xp_embedded_formats_supported,
- vpr->default_xp_embedded_formats_supported);
- /*
- * xp-listfonts-modes-supported
- */
- XpValidateListAttr(pContext, XPPrinterAttr,
- xpoid_att_xp_listfonts_modes_supported,
- vpr->valid_xp_listfonts_modes_supported,
- vpr->default_xp_listfonts_modes_supported);
- /*
- * xp-raw-formats-supported
- */
- XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
- xpoid_att_xp_raw_formats_supported,
- vpr->valid_xp_raw_formats_supported,
- vpr->default_xp_raw_formats_supported);
- /*
- * xp-setup-proviso
- */
- XpValidateOidAttr(pContext, XPPrinterAttr, xpoid_att_xp_setup_proviso,
- vpr->valid_xp_setup_proviso, xpoid_none);
- /*
- * medium-source-sizes-supported
- * input-trays-mdeium
- */
- XpValidatePrinterMediaAttrs(pContext,
- vpr->valid_input_trays,
- vpr->valid_medium_sizes);
- /*
- * available-compressions-supported
- */
- XpValidateListAttr(pContext, XPPrinterAttr,
- xpoid_att_available_compressions_supported,
- vpr->valid_available_compressions_supported,
- vpr->default_available_compressions_supported);
-}
-
-
-void
-XpValidateNotificationProfile(XpContextPtr pContext)
-{
- const char* value_in;
- const char* value_out;
-
- value_in = XpGetStringAttr(pContext, XPJobAttr,
- xpoid_att_notification_profile);
- value_out = XpOidNotifyString(XpOidNotifyParse(value_in));
- XpPutStringAttr(pContext, XPJobAttr,
- xpoid_att_notification_profile, value_out);
-}
-
-void
-XpValidateJobPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr)
-{
- /*
- * Note: the 'vpr' argument is unused in this
- * implementation; it is reserved for future use
- */
- XpOidList* job_attrs_supported;
- /*
- * only validate attributes found in job-attributes-supported
- */
- job_attrs_supported = XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_job_attributes_supported,
- (const XpOidList*)NULL);
- /*
- * notification-profile
- */
- if(XpOidListHasOid(job_attrs_supported, xpoid_att_notification_profile))
- {
- XpValidateNotificationProfile(pContext);
- }
- /*
- * clean up
- */
- XpOidListDelete(job_attrs_supported);
-}
-
-
-static void
-XpValidateDocOrPagePool(XpContextPtr pContext,
- XPAttributes pool, /* XPDocAttr or XPPageAttr */
- const XpOidList* attrs_supported,
- const XpValidatePoolsRec* vpr)
-{
- /*
- * content-orientation
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_content_orientation))
- {
- XpOidList* content_orientations_supported;
- content_orientations_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_content_orientations_supported,
- vpr->valid_content_orientations_supported);
- XpValidateOidAttr(pContext, pool, xpoid_att_content_orientation,
- content_orientations_supported, xpoid_none);
- XpOidListDelete(content_orientations_supported);
- }
- /*
- * copy-count
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_copy_count))
- XpValidateCardAttr(pContext, pool, xpoid_att_copy_count,
- (const XpOidCardList*)NULL, 0);
- /*
- * default-printer-resolution
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_default_printer_resolution))
- {
- XpOidCardList* printer_resolutions_supported;
- printer_resolutions_supported =
- XpGetCardListAttr(pContext, XPPrinterAttr,
- xpoid_att_printer_resolutions_supported,
- vpr->valid_printer_resolutions_supported);
- XpValidateCardAttr(pContext, pool,
- xpoid_att_default_printer_resolution,
- printer_resolutions_supported, 0);
- XpOidCardListDelete(printer_resolutions_supported);
- }
- /*
- * default-input-tray
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_default_input_tray))
- {
- XpOidTrayMediumList* input_trays_medium;
- const char* value_in;
- XpOid value_tray;
-
- input_trays_medium =
- XpGetTrayMediumListAttr(pContext, XPPrinterAttr,
- xpoid_att_input_trays_medium,
- (const XpOidList*)NULL,
- (const XpOidMediumSS*)NULL);
- value_in =
- XpGetStringAttr(pContext, pool, xpoid_att_default_input_tray);
- value_tray = XpOidFromString(value_in);
- if(!XpOidTrayMediumListHasTray(input_trays_medium, value_tray))
- value_tray = xpoid_none;
- XpPutOidAttr(pContext, pool, xpoid_att_default_input_tray, value_tray);
- XpOidTrayMediumListDelete(input_trays_medium);
- }
- /*
- * default-medium
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_default_medium))
- {
- XpOidMediumSS* msss;
- const char* value_in;
- XpOid value_size;
-
- msss = XpGetMediumSSAttr(pContext, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported,
- (const XpOidList*)NULL,
- (const XpOidList*)NULL);
- value_in = XpGetStringAttr(pContext, pool, xpoid_att_default_medium);
- value_size = XpOidFromString(value_in);
- if(!XpOidMediumSSHasSize(msss, value_size))
- value_size = xpoid_none;
- XpPutOidAttr(pContext, pool, xpoid_att_default_medium, value_size);
- XpOidMediumSSDelete(msss);
- }
- /*
- * document-format
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_document_format))
- {
- XpOidDocFmtList* document_formats_supported;
- const char* value_in;
- XpOidDocFmt* document_format;
- const char* value_out;
-
- document_formats_supported =
- XpGetDocFmtListAttr(pContext, XPPrinterAttr,
- xpoid_att_document_formats_supported,
- vpr->valid_document_formats_supported);
- value_in = XpGetStringAttr(pContext, pool, xpoid_att_document_format);
- document_format = XpOidDocFmtNew(value_in);
- if(XpOidDocFmtListHasFmt(document_formats_supported, document_format))
- value_out = XpOidDocFmtString(document_format);
- else
- value_out = XpOidDocFmtString(vpr->default_document_format);
- XpOidDocFmtListDelete(document_formats_supported);
- XpOidDocFmtDelete(document_format);
- XpPutStringAttr(pContext, pool, xpoid_att_document_format, value_out);
- XpOidFree(value_out);
- }
- /*
- * plex
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_plex))
- {
- XpOidList* plexes_supported;
- plexes_supported =
- XpGetListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported,
- vpr->valid_plexes_supported);
- XpValidateOidAttr(pContext, pool, xpoid_att_plex,
- plexes_supported, xpoid_none);
- XpOidListDelete(plexes_supported);
- }
- /*
- * xp-listfonts-modes
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_xp_listfonts_modes))
- {
- XpOidList* xp_listfonts_modes_supported;
- xp_listfonts_modes_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_xp_listfonts_modes_supported,
- vpr->valid_xp_listfonts_modes_supported);
- XpValidateListAttr(pContext, pool, xpoid_att_xp_listfonts_modes,
- xp_listfonts_modes_supported,
- (const XpOidList*)NULL);
- XpOidListDelete(xp_listfonts_modes_supported);
- }
- /*
- * available-compressions
- */
- if(XpOidListHasOid(attrs_supported, xpoid_att_available_compression))
- {
- XpOidList* available_compressions_supported;
- available_compressions_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_available_compressions_supported,
- vpr->valid_available_compressions_supported);
- XpValidateOidAttr(pContext, pool, xpoid_att_available_compression,
- available_compressions_supported, xpoid_none);
- XpOidListDelete(available_compressions_supported);
- }
-}
-
-void
-XpValidateDocumentPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr)
-{
- XpOidList* document_attrs_supported;
- /*
- * only validate attributes found in document-attributes-supported
- */
- document_attrs_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_document_attributes_supported,
- (const XpOidList*)NULL);
- /*
- * validate
- */
- XpValidateDocOrPagePool(pContext, XPDocAttr,
- document_attrs_supported, vpr);
- /*
- * clean up
- */
- XpOidListDelete(document_attrs_supported);
-}
-
-void
-XpValidatePagePool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr)
-{
- XpOidList* page_attrs_supported;
- /*
- * only validate attributes found in xp-page-attributes-supported
- */
- page_attrs_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_xp_page_attributes_supported,
- (const XpOidList*)NULL);
- /*
- * validate
- */
- XpValidateDocOrPagePool(pContext, XPPageAttr,
- page_attrs_supported, vpr);
- /*
- * clean up
- */
- XpOidListDelete(page_attrs_supported);
-}
-
-void
-XpValidateAttributePool(XpContextPtr pContext,
- XPAttributes pool,
- const XpValidatePoolsRec* vpr)
-{
- switch(pool)
- {
- case XPPrinterAttr:
- XpValidatePrinterPool(pContext, vpr);
- break;
-
- case XPDocAttr:
- XpValidateDocumentPool(pContext, vpr);
- break;
-
- case XPJobAttr:
- XpValidateJobPool(pContext, vpr);
- break;
-
- case XPPageAttr:
- XpValidatePagePool(pContext, vpr);
- break;
-
- default:
- break;
- }
-}
diff --git a/Xprint/AttrValid.h b/Xprint/AttrValid.h
deleted file mode 100644
index 87ab48b69..000000000
--- a/Xprint/AttrValid.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/* $Xorg: AttrValid.h,v 1.4 2001/03/14 18:43:40 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/AttrValid.h,v 1.7 2001/12/21 21:02:04 dawes Exp $ */
-
-#ifndef _Xp_AttrValid_h
-#define _Xp_AttrValid_h
-
-#include <X11/extensions/Printstr.h>
-#include "Oid.h"
-
-#define XpNumber(a) (sizeof(a) / sizeof(*(a)))
-
-/*
- * Attribute pool validation valid values and defaults
- */
-typedef struct
-{
- XpOidList* valid_content_orientations_supported;
- XpOidList* default_content_orientations_supported;
-
- XpOidDocFmtList* valid_document_formats_supported;
- XpOidDocFmtList* default_document_formats_supported;
-
- XpOidList* valid_input_trays;
- XpOidList* valid_medium_sizes;
-
- XpOidList* valid_plexes_supported;
- XpOidList* default_plexes_supported;
-
- XpOidCardList* valid_printer_resolutions_supported;
- XpOidCardList* default_printer_resolutions_supported;
-
- XpOidDocFmtList* valid_xp_embedded_formats_supported;
- XpOidDocFmtList* default_xp_embedded_formats_supported;
-
- XpOidList* valid_xp_listfonts_modes_supported;
- XpOidList* default_xp_listfonts_modes_supported;
-
- XpOidDocFmtList* valid_xp_raw_formats_supported;
- XpOidDocFmtList* default_xp_raw_formats_supported;
-
- XpOidList* valid_xp_setup_proviso;
-
- XpOidDocFmt* default_document_format;
- XpOidList* valid_available_compressions_supported;
- XpOidList* default_available_compressions_supported;
-
-} XpValidatePoolsRec;
-
-/*
- * XpOid resource access
- */
-#define XpGetStringAttr(pContext, pool, oid) \
- (const char*)XpGetOneAttribute(pContext, pool, (char*)XpOidString(oid))
-#define XpPutStringAttr(pContext, pool, oid, value) \
- XpPutOneAttribute(pContext, pool, XpOidString(oid), value)
-
-#ifdef _XP_PRINT_SERVER_ /* needed for XpContextPtr in Printstr.h */
-
-/*
- * XpOid-valued attribute access
- */
-XpOid XpGetOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oid_list);
-void XpPutOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- XpOid value_oid);
-void XpValidateOidAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oids,
- XpOid default_oid);
-/*
- * cardinal-valued attribute access
- */
-unsigned long XpGetCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_card_list);
-void XpPutCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- unsigned long value_card);
-void XpValidateCardAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_cards,
- unsigned long default_card);
-/*
- * XpOidList-valued attribute access
- */
-XpOidList* XpGetListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oid_list);
-void XpPutListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* list);
-void XpValidateListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_oids,
- const XpOidList* default_oids);
-/*
- * XpOidCardList-valued attribute access
- */
-XpOidCardList* XpGetCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_card_list);
-void XpPutCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* list);
-void XpValidateCardListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidCardList* valid_cards,
- const XpOidCardList* default_cards);
-/*
- * XpOidDocFmtList-valued attribute access
- */
-XpOidDocFmtList* XpGetDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* valid_fmt_list);
-void XpPutDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* list);
-void XpValidateDocFmtListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidDocFmtList* valid_fmts,
- const XpOidDocFmtList* default_fmts);
-/*
- * XpOidMediumSS-valued attribute access
- */
-XpOidMediumSS* XpGetMediumSSAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_trays,
- const XpOidList* valid_sizes);
-void XpPutMediumSSAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidMediumSS* msss);
-const XpOidMediumSS* XpGetDefaultMediumSS(void);
-
-/*
- * XpOidTrayMediumList-valued attribute access
- */
-XpOidTrayMediumList* XpGetTrayMediumListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidList* valid_trays,
- const XpOidMediumSS* msss);
-void XpPutTrayMediumListAttr(XpContextPtr pContext,
- XPAttributes pool,
- XpOid oid,
- const XpOidTrayMediumList* tm);
-BOOL XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray);
-
-/*
- * Attribute pool validation
- */
-void XpValidateAttributePool(XpContextPtr pContext,
- XPAttributes pool,
- const XpValidatePoolsRec* vpr);
-void XpValidateNotificationProfile(XpContextPtr pContext);
-void XpValidatePrinterPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr);
-void XpValidateJobPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr);
-void XpValidateDocumentPool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr);
-void XpValidatePagePool(XpContextPtr pContext,
- const XpValidatePoolsRec* vpr);
-void XpValidatePrinterMediaAttrs(XpContextPtr pContext,
- const XpOidList* valid_trays,
- const XpOidList* valid_sizes);
-
-#endif /* _XP_PRINT_SERVER_ */
-
-#endif /* _Xp_AttrValid_h - don't add anything after this line */
diff --git a/Xprint/DiPrint.h b/Xprint/DiPrint.h
deleted file mode 100644
index 3830c20d2..000000000
--- a/Xprint/DiPrint.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* $Xorg: DiPrint.h,v 1.3 2000/08/17 19:48:04 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/DiPrint.h,v 1.4 2001/01/17 22:36:28 dawes Exp $ */
-
-/*
- * The XpDiListEntry struct is the type of each element of the array
- * handed back to the extension code to handle a GetPrinterList request.
- * We don't use the printerDb directly because of the desire to handle
- * multiple locales. Creating this new array for each GetPrinterList
- * request will allow us to build it with the description in the locale of
- * the requesting client.
- */
-#ifndef _XpDiPrint_H_
-#define _XpDiPrint_H_ 1
-
-#include "scrnintstr.h"
-
-typedef struct _diListEntry {
- char *name;
- char *description;
- char *localeName;
- unsigned long rootWinId;
-} XpDiListEntry;
-
-extern void XpDiFreePrinterList(XpDiListEntry **list);
-
-extern XpDiListEntry **XpDiGetPrinterList(
- int nameLen,
- char *name,
- int localeLen,
- char *locale);
-
-extern char * XpDiGetDriverName(int index, char *printerName);
-
-extern WindowPtr XpDiValidatePrinter(char *printerName, int printerNameLen);
-
-extern int XprintOptions(int argc, char **argv, int i);
-
-extern void PrinterInitOutput(ScreenInfo *pScreenInfo, int argc, char **argv);
-
-extern void _XpVoidNoop(void);
-
-extern Bool _XpBoolNoop(void);
-
-#endif /* _XpDiPrint_H_ */
diff --git a/Xprint/Init.c b/Xprint/Init.c
deleted file mode 100644
index c936f4542..000000000
--- a/Xprint/Init.c
+++ /dev/null
@@ -1,1682 +0,0 @@
-/* $Xorg: Init.c,v 1.5 2001/03/07 17:31:33 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: printer/Init.c
-** *
-** * Contents:
-** * The InitOutput routine here would presumably
-** * be called from the normal server's InitOutput
-** * after all display screens have been added.
-** * There is are ifdef'd routines suitable for
-** * use in building a printer-only server. Turn
-** * on the "PRINTER_ONLY_SERVER" define if this is
-** * to be the only ddx-level driver.
-** *
-** * Copyright: Copyright 1993,1995 Hewlett-Packard Company
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/Init.c,v 1.15 2003/10/29 22:11:54 tsi Exp $ */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <locale.h>
-#ifdef __hpux
-#include <sys/sysmacros.h>
-#endif
-
-#include "X.h"
-#define NEED_EVENTS 1
-#include "Xproto.h"
-#include <servermd.h>
-
-#include "screenint.h"
-#include "input.h"
-#include "cursor.h"
-#include "misc.h"
-#include "windowstr.h"
-#include "inputstr.h"
-
-#include "gcstruct.h"
-#include "fonts/fontstruct.h"
-#include "errno.h"
-
-typedef char *XPointer;
-#define HAVE_XPointer 1
-
-#define Status int
-#include <Xresource.h>
-
-#include "DiPrint.h"
-#include "attributes.h"
-
-#include "os.h"
-
-static void GenericScreenInit(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv);
-static Bool InitPrintDrivers(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv);
-
-/*
- * The following two defines are used to build the name "X*printers", where
- * the "*" is replaced by the display number. This is used to construct
- * the name of the default printers configuration file if the -XpFile
- * command line option was not specified.
- */
-#define XNPRINTERSFILEPREFIX "/X"
-#define XNPRINTERSFILESUFFIX "printers"
-#define XPRINTERSFILENAME "Xprinters"
-
-#define MODELDIRNAME "/models"
-#define FONTDIRNAME "/fonts"
-
-/*
- * The string LIST_QUEUES is fed to a shell to generate an ordered
- * list of available printers on the system. These string definitions
- * are taken from the file PrintSubSys.C within the code for the
- * dtprintinfo program.
- */
-#ifdef AIXV4
-const char *LIST_QUEUES = "lsallq | grep -v '^bsh$' | sort";
-#else
-#ifdef hpux
-const char *LIST_QUEUES = "LANG=C lpstat -v | "
- "awk '"
- " $2 == \"for\" "
- " { "
- " x = match($3, /:/); "
- " print substr($3, 1, x-1)"
- " }' | sort";
-#else
-#ifdef __osf__
- const char *LIST_QUEUES = "LANG=C lpstat -v | "
- "nawk '"
- " $2 == \"for\" "
- " { print $4 }' "
- " | sort";
-#else
-#ifdef __uxp__
-const char *LIST_QUEUES = "LANG=C lpstat -v | "
- "nawk '"
- " $4 == \"for\" "
- " { "
- " x = match($5, /:/); "
- " print substr($5, 1, x-1)"
- " }' | sort";
-#else
-#if defined(CSRG_BASED) || defined(linux) || defined(ISC) || defined(__GNUC__)
-const char *LIST_QUEUES = "LANG=C lpc status | grep -v '^\t' | "
- "sed -e /:/s/// | sort";
-#else
-const char *LIST_QUEUES = "LANG=C lpstat -v | "
- "nawk '"
- " $2 == \"for\" "
- " { "
- " x = match($3, /:/); "
- " print substr($3, 1, x-1)"
- " }' | sort";
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#ifdef XPRASTERDDX
-
-static
-PixmapFormatRec RasterPixmapFormats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD }
-};
-#define NUMRASTFORMATS (sizeof RasterPixmapFormats)/(sizeof RasterPixmapFormats[0])
-
-#include "raster/Raster.h"
-
-#endif
-
-#ifdef XPPCLDDX
-
-static
-PixmapFormatRec ColorPclPixmapFormats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD },
- { 8, 8, BITMAP_SCANLINE_PAD },
- { 24,32, BITMAP_SCANLINE_PAD }
-};
-
-#define NUMCPCLFORMATS (sizeof ColorPclPixmapFormats)/(sizeof ColorPclPixmapFormats[0])
-
-#endif
-
-#ifdef XPMONOPCLDDX
-
-static
-PixmapFormatRec MonoPclPixmapFormats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD }
-};
-
-#define NUMMPCLFORMATS (sizeof MonoPclPixmapFormats)/(sizeof MonoPclPixmapFormats[0])
-
-#endif
-
-#if defined(XPPCLDDX) || defined(XPMONOPCLDDX)
-#include "pcl/Pcl.h"
-#endif
-
-#ifdef XPPSDDX
-
-static
-PixmapFormatRec PSPixmapFormats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD },
- { 8, 8, BITMAP_SCANLINE_PAD },
- { 24,32, BITMAP_SCANLINE_PAD }
-};
-
-#define NUMPSFORMATS (sizeof PSPixmapFormats)/(sizeof PSPixmapFormats[0])
-
-#include "ps/Ps.h"
-
-#endif
-
-/*
- * The driverInitArray contains an entry for each driver the
- * server knows about. Each element contains pointers to pixmap formats, the
- * driver's initialization routine, and pointers to the driver's
- * attribute validation rec, and/or a driver function which
- * returns the maximum medium width&height, and maximum resolution
- * given a printer name. Either the validation rec OR the dimension
- * function can be NULL. If the function is non-NULL then it
- * will be called, and will be passed the (possibly NULL) validation rec.
- * If the function is NULL, then XpGetMaxWidthHeightRes() is called.
- */
-typedef struct _driverInitRec {
- char *driverName;
- pBFunc initFunc;
- XpValidatePoolsRec *pValRec;
- pVFunc dimensionsFunc;
- PixmapFormatRec *pFmts;
- int numFmts;
-} driverInitRec;
-
-static driverInitRec driverInits[] = {
-#ifdef XPRASTERDDX
- {
- "XP-RASTER",
- InitializeRasterDriver,
- &RasterValidatePoolsRec,
- (pVFunc) NULL,
- RasterPixmapFormats,
- NUMRASTFORMATS
- },
-#endif
-#ifdef XPPCLDDX
- {
- "XP-PCL-COLOR",
- InitializeColorPclDriver,
- &PclValidatePoolsRec,
- (pVFunc) NULL,
- ColorPclPixmapFormats,
- NUMCPCLFORMATS
- },
-#endif
-#ifdef XPMONOPCLDDX
- {
- "XP-PCL-MONO",
- InitializeMonoPclDriver,
- &PclValidatePoolsRec,
- (pVFunc) NULL,
- MonoPclPixmapFormats,
- NUMMPCLFORMATS
- },
-#endif
-#ifdef XPPSDDX
- {
- "XP-POSTSCRIPT",
- InitializePsDriver,
- &PsValidatePoolsRec,
- (pVFunc) NULL,
- PSPixmapFormats,
- NUMPSFORMATS
- },
-#endif
-};
-
-
-/*
- * The printerDb variable points to a list of PrinterDbEntry structs
- * which map printer names with screen numbers and driver names.
- */
-typedef struct _printerDbEntry {
- struct _printerDbEntry *next;
- char *name;
- char *qualifier;
- int screenNum;
- char *driverName;
-} PrinterDbEntry, *PrinterDbPtr;
-
-static PrinterDbPtr printerDb = (PrinterDbPtr)NULL;
-
-/*
- * The nameMap is a list used in initializing the attribute store
- * for each printer. The list is freed once the printerDb is built
- * and the attribute stores for all printers have been initialized.
- */
-typedef struct _nameMapEntry {
- struct _nameMapEntry *next;
- char *name;
- char *qualifier;
-} NameMapEntry, *NameMapPtr;
-
-static NameMapPtr nameMap = (NameMapPtr)NULL;
-
-/*
- * The driverMap is a list which provides the mapping between driver names
- * and screen numbers. It is built and used
- * by RehashPrinterList to correctly fill in the screenNum field in the
- * printerDb entries. The list is freed before RehashPrinterList terminates.
- */
-typedef struct _driverMapping {
- struct _driverMapping *next;
- char *driverName;
- int screenNum;
-} DriverMapEntry, *DriverMapPtr;
-
-static char *configFileName = (char *)NULL;
-static Bool freeDefaultFontPath = FALSE;
-static char *origFontPath = (char *)NULL;
-
-/*
- * XprintOptions checks argv[i] to see if it is our command line
- * option specifying a configuration file name. It returns the index
- * of the next option to process.
- */
-int
-XprintOptions(
- int argc,
- char **argv,
- int i)
-{
- if(strcmp(argv[i], "-XpFile") == 0)
- {
- if ((i + 1) >= argc) {
- ddxUseMsg ();
- return i + 2;
- }
- configFileName = argv[i + 1];
- return i + 2;
- }
- else
- return i;
-}
-
-/************************************************************
- * GetInitFunc --
- *
- * This routine is called from the InitPrintDrivers function.
- * Given the name of a driver, return a pointer to the driver's
- * initialization function.
- *
- * Results:
- * Returns a pointer to the initialization function for the driver.
- *
- *
- ************************************************************/
-
-/*
-typedef Bool (*pIFunc)();
-static pIFunc
-GetInitFunc(driverName)
-*/
-
-static pBFunc GetInitFunc(char *driverName)
-{
- driverInitRec *pInitRec;
- int numDrivers = sizeof(driverInits)/sizeof(driverInitRec);
- int i;
-
- for(pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++)
- {
- if( !strcmp( driverName, pInitRec->driverName ) )
- return pInitRec->initFunc;
- }
-
- return 0;
-}
-
-static void
-GetDimFuncAndRec(
- char *driverName,
- XpValidatePoolsRec **pValRec,
- pVFunc *dimensionsFunc)
-{
- driverInitRec *pInitRec;
- int numDrivers = sizeof(driverInits)/sizeof(driverInitRec);
- int i;
-
- for(pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++)
- {
- if( !strcmp( driverName, pInitRec->driverName ) )
- {
- *dimensionsFunc = pInitRec->dimensionsFunc;
- *pValRec = pInitRec->pValRec;
- return ;
- }
- }
-
- *dimensionsFunc = 0;
- *pValRec = 0;
- return;
-}
-
-static void
-FreePrinterDb(void)
-{
- PrinterDbPtr pCurEntry, pNextEntry;
-
- for(pCurEntry = printerDb, pNextEntry = 0;
- pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pNextEntry)
- {
- pNextEntry = pCurEntry->next;
- if(pCurEntry->name != (char *)NULL)
- xfree(pCurEntry->name);
- /*
- * We don't free the driver name, because it's expected to simply
- * be a pointer into the xrm database.
- */
- xfree(pCurEntry);
- }
- printerDb = 0;
-}
-
-/*
- * AddPrinterDbName allocates an entry in the printerDb list, and
- * initializes the "name". It returns TRUE if the element was
- * successfully added, and FALSE if an allocation error ocurred.
- * XXX AddPrinterDbName needs to check for (and not add) duplicate names.
- */
-static Bool
-AddPrinterDbName(char *name)
-{
- PrinterDbPtr pEntry = (PrinterDbPtr)xalloc(sizeof(PrinterDbEntry));
-
- if(pEntry == (PrinterDbPtr)NULL) return FALSE;
- pEntry->name = strdup(name);
- pEntry->qualifier = (char *)NULL;
-
- if(printerDb == (PrinterDbPtr)NULL)
- {
- pEntry->next = (PrinterDbPtr)NULL;
- printerDb = pEntry;
- }
- else
- {
- pEntry->next = printerDb;
- printerDb = pEntry;
- }
- return TRUE;
-}
-
-static void
-AugmentPrinterDb(const char *command)
-{
- FILE *fp;
- char name[256];
-
- fp = popen(command, "r");
- /* XXX is a 256 character limit overly restrictive for printer names? */
- while(fgets(name, 256, fp) != (char *)NULL && strlen(name))
- {
- name[strlen(name) - 1] = (char)'\0'; /* strip the \n */
- AddPrinterDbName(name);
- }
- pclose(fp);
-}
-
-/*
- * FreeNameMap frees all remaining memory associated with the nameMap.
- */
-static void
-FreeNameMap(void)
-{
- NameMapPtr pEntry, pTmp;
-
- for(pEntry = nameMap, pTmp = (NameMapPtr)NULL;
- pEntry != (NameMapPtr)NULL;
- pEntry = pTmp)
- {
- if(pEntry->name != (char *)NULL)
- xfree(pEntry->name);
- if(pEntry->qualifier != (char *)NULL)
- xfree(pEntry->qualifier);
- pTmp = pEntry->next;
- xfree(pEntry);
- }
- nameMap = (NameMapPtr)NULL;
-}
-
-/*
- * AddNameMap adds an element to the nameMap linked list.
- */
-static Bool
-AddNameMap(char *name, char *qualifier)
-{
- NameMapPtr pEntry;
-
- if((pEntry = (NameMapPtr)xalloc(sizeof(NameMapEntry))) == (NameMapPtr)NULL)
- return FALSE;
- pEntry->name = name;
- pEntry->qualifier = qualifier;
- pEntry->next = nameMap;
- nameMap = pEntry;
- return TRUE;
-}
-
-/*
- * MergeNameMap - puts the "map" names (aka qualifiers, aliases) into
- * the printerDb. This should be called once, after both the printerDb
- * and nameMap lists are complete. When/if MergeNameMap finds a map for
- * an entry in the printerDb, the qualifier is _moved_ (not copied) to
- * the printerDb. This means that the qualifier pointer in the nameMap
- * is NULLed out.
- */
-static void
-MergeNameMap(void)
-{
- NameMapPtr pMap;
- PrinterDbPtr pDb;
-
- for(pMap = nameMap; pMap != (NameMapPtr)NULL; pMap = pMap->next)
- {
- for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next)
- {
- if(!strcmp(pMap->name, pDb->name))
- {
- pDb->qualifier = pMap->qualifier;
- pMap->qualifier = (char *)NULL;
- }
- }
- }
-}
-
-/*
- * CreatePrinterAttrs causes the attribute stores to be built for
- * each printer in the printerDb.
- */
-static void
-CreatePrinterAttrs(void)
-{
- PrinterDbPtr pDb;
-
- for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next)
- {
- XpBuildAttributeStore(pDb->name, (pDb->qualifier)?
- pDb->qualifier : pDb->name);
- }
-}
-
-#ifdef XPPSDDX
-#define defaultDriver "XP-POSTSCRIPT"
-#else
-#ifdef XPPCLDDX
-#define defaultDriver "XP-PCL-COLOR"
-#else
-#ifdef XPMONOPCLDDX
-#define defaultDriver "XP-PCL-MONO"
-#else
-#define defaultDriver "XP-RASTER"
-#endif
-#endif
-#endif
-
-/*
- * StoreDriverNames - queries the attribute store for the ddx-identifier.
- * if the ddx-identifier is not in the attribute database, then a default
- * ddx-identifier is store in both the attribute store for the printer,
- * and in the printerDb.
- * The ddx-identifier is stored in the printerDb for use in initializing
- * the screens.
- */
-static void
-StoreDriverNames(void)
-{
- PrinterDbPtr pEntry;
-
- for(pEntry = printerDb; pEntry != (PrinterDbPtr)NULL;
- pEntry = pEntry->next)
- {
- pEntry->driverName = (char*)XpGetPrinterAttribute(pEntry->name,
- "xp-ddx-identifier");
- if(pEntry->driverName == (char *)NULL ||
- strlen(pEntry->driverName) == 0 ||
- GetInitFunc(pEntry->driverName) == 0)
- {
- if (pEntry->driverName && (strlen(pEntry->driverName) != 0)) {
- ErrorF("Xp Extension: Can't load driver %s\n",
- pEntry->driverName);
- ErrorF(" init function missing\n");
- }
-
- pEntry->driverName = defaultDriver;
- XpAddPrinterAttribute(pEntry->name,
- (pEntry->qualifier != (char *)NULL)?
- pEntry->qualifier : pEntry->name,
- "*xp-ddx-identifier", pEntry->driverName);
- }
- }
-}
-
-static char *
-MbStrchr(
- char *str,
- int ch)
-{
- size_t mbCurMax = MB_CUR_MAX;
- wchar_t targetChar, curChar;
- char tmpChar;
- int i, numBytes, byteLen;
-
- if(mbCurMax <= 1) return strchr(str, ch);
-
- tmpChar = (char)ch;
- mbtowc(&targetChar, &tmpChar, mbCurMax);
- for(i = 0, numBytes = 0, byteLen = strlen(str); i < byteLen; i += numBytes)
- {
- numBytes = mbtowc(&curChar, &str[i], mbCurMax);
- if(curChar == targetChar) return &str[i];
- }
- return (char *)NULL;
-}
-
-/*
- * GetConfigFileName - Looks for a "Xprinters" file in
- * $(XPRINTDIR)/$LANG/print, and then in $(XPRINTDIR)/C/print. If it
- * finds such a file, it returns the path to the file. The returned
- * string must be freed by the caller.
- */
-static char *
-GetConfigFileName(void)
-{
- /*
- * We need to find the system-wide file, if one exists. This
- * file can be in either $(XPRINTDIR)/$LANG/print, or in
- * $(PRINTDIR)/C/print, and the file itself is named "Xprinters".
- */
- char *dirName, *filePath;
-
- /*
- * Check for a LANG-specific file.
- */
- if ((dirName = XpGetConfigDir(TRUE)) != 0)
- {
- filePath = (char *)xalloc(strlen(dirName) +
- strlen(XPRINTERSFILENAME) + 2);
-
- if(filePath == (char *)NULL)
- {
- xfree(dirName);
- return (char *)NULL;
- }
-
- sprintf(filePath, "%s/%s", dirName, XPRINTERSFILENAME);
- xfree(dirName);
- if(access(filePath, R_OK) == 0)
- return filePath;
-
- xfree(filePath);
- }
-
- if ((dirName = XpGetConfigDir(FALSE)) != 0)
- {
- filePath = (char *)xalloc(strlen(dirName) +
- strlen(XPRINTERSFILENAME) + 2);
- if(filePath == (char *)NULL)
- {
- xfree(dirName);
- return (char *)NULL;
- }
- sprintf(filePath, "%s/%s", dirName, XPRINTERSFILENAME);
- xfree(dirName);
- if(access(filePath, R_OK) == 0)
- return filePath;
- xfree(filePath);
- }
- return (char *)NULL;
-}
-
-/*
- * BuildPrinterDb - reads the config file if it exists, and if necessary
- * executes a command such as lpstat to generate a list of printers.
- * XXX
- * XXX BuildPrinterDb must be rewritten to allow 16-bit characters in
- * XXX printer names. The will involve replacing the use of strtok() and its
- * XXX related functions.
- * XXX At the same time, BuildPrinterDb and it's support routines should have
- * XXX allocation error checking added.
- * XXX
- */
-static PrinterDbPtr
-BuildPrinterDb(void)
-{
- Bool defaultAugment = TRUE, freeConfigFileName;
-
- if(configFileName && access(configFileName, R_OK) != 0)
- {
- ErrorF("Xp Extension: Can't open file %s\n", configFileName);
- }
- if(!configFileName && (configFileName = GetConfigFileName()))
- freeConfigFileName = TRUE;
- else
- freeConfigFileName = FALSE;
-
- if(configFileName != (char *)NULL && access(configFileName, R_OK) == 0)
- {
- char line[256];
- FILE *fp = fopen(configFileName, "r");
-
- while(fgets(line, 256, fp) != (char *)NULL)
- {
- char *tok, *ptr;
- if((tok = strtok(line, " \t\012")) != (char *)NULL)
- {
- if(tok[0] == (char)'#') continue;
- if(strcmp(tok, "Printer") == 0)
- {
- while((tok = strtok((char *)NULL, " \t")) != (char *)NULL)
- {
- if ((ptr = MbStrchr(tok, '\012')) != 0)
- *ptr = (char)'\0';
- AddPrinterDbName(tok);
- }
- }
- else if(strcmp(tok, "Map") == 0)
- {
- char *name, *qualifier;
-
- if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL)
- continue;
- name = strdup(tok);
- if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL)
- {
- xfree(name);
- continue;
- }
- qualifier = strdup(tok);
- AddNameMap(name, qualifier);
- }
- else if(strcmp(tok, "Augment_Printer_List") == 0)
- {
- if((tok = strtok((char *)NULL, " \t\012")) == (char *)NULL)
- continue;
-
- if(strcmp(tok, "%default%") == 0)
- continue;
- defaultAugment = FALSE;
- if(strcmp(tok, "%none%") == 0)
- continue;
- AugmentPrinterDb(tok);
- }
- else
- break; /* XXX Generate an error? */
- }
- }
- fclose(fp);
- }
-
- if(defaultAugment == TRUE)
- {
- AugmentPrinterDb(LIST_QUEUES);
- }
-
- MergeNameMap();
- FreeNameMap();
-
- /* Create the attribute stores for all printers */
- CreatePrinterAttrs();
-
- /*
- * Find the drivers for each printers, and store the driver names
- * in the printerDb
- */
- StoreDriverNames();
-
- if(freeConfigFileName)
- {
- xfree(configFileName);
- configFileName = (char *)NULL;
- }
-
- return printerDb;
-}
-
-static void
-FreeDriverMap(DriverMapPtr driverMap)
-{
- DriverMapPtr pCurEntry, pNextEntry;
-
- for(pCurEntry = driverMap, pNextEntry = (DriverMapPtr)NULL;
- pCurEntry != (DriverMapPtr)NULL; pCurEntry = pNextEntry)
- {
- pNextEntry = pCurEntry->next;
- if(pCurEntry->driverName != (char *)NULL)
- xfree(pCurEntry->driverName);
- xfree(pCurEntry);
- }
-}
-
-/*
- * XpRehashPrinterList rebuilds the list of printers known to the
- * server. It first walks the printerDb to build a table mapping
- * driver names and screen numbers, since this is not an easy mapping
- * to change in the sample server. The normal configuration files are
- * then read & parsed to create the new list of printers. Printers
- * which require drivers other than those already initialized are
- * deleted from the printerDb. This leaves attribute stores in place
- * for inaccessible printers, but those stores will be cleaned up in
- * the next rehash or server recycle.
- */
-int
-XpRehashPrinterList(void)
-{
- PrinterDbPtr pEntry, pPrev;
- DriverMapPtr driverMap = (DriverMapPtr)NULL, pDrvEnt;
- int result;
-
- /* Build driverMap */
- for(pEntry = printerDb; pEntry != (PrinterDbPtr)NULL; pEntry = pEntry->next)
- {
- for(pDrvEnt = driverMap; pDrvEnt != (DriverMapPtr)NULL;
- pDrvEnt = pDrvEnt->next)
- {
- if(!strcmp(pEntry->driverName, pDrvEnt->driverName))
- break;
- }
-
- if(pDrvEnt != (DriverMapPtr)NULL)
- continue;
-
- if((pDrvEnt = (DriverMapPtr)xalloc(sizeof(DriverMapEntry))) ==
- (DriverMapPtr)NULL)
- {
- FreeDriverMap(driverMap);
- return BadAlloc;
- }
- pDrvEnt->driverName = strdup(pEntry->driverName);
- pDrvEnt->screenNum = pEntry->screenNum;
- pDrvEnt->next = driverMap;
- driverMap = pDrvEnt;
- }
-
- /* Free the old printerDb */
- FreePrinterDb();
-
- /* Free/Rehash attribute stores */
- if((result = XpRehashAttributes()) != Success)
- return result;
-
- /* Build a new printerDb */
- if(BuildPrinterDb() == (PrinterDbPtr)NULL)
- return BadAlloc;
-
- /* Walk PrinterDb & either store screenNum, or delete printerDb entry */
- for(pEntry = printerDb, pPrev = (PrinterDbPtr)NULL;
- pEntry != (PrinterDbPtr)NULL; pEntry = pEntry->next)
- {
- for(pDrvEnt = driverMap; pDrvEnt != (DriverMapPtr)NULL;
- pDrvEnt = pDrvEnt->next)
- {
- if(!strcmp(printerDb->driverName, pDrvEnt->driverName))
- break;
- }
-
- /*
- * Either store the screen number, or delete the printerDb entry.
- * Deleting the entry leaves orphaned attribute stores, but they'll
- * get cleaned up at the next rehash or server recycle.
- */
- if(pDrvEnt != (DriverMapPtr)NULL)
- {
- pEntry->screenNum = pDrvEnt->screenNum;
- pPrev = pEntry;
- }
- else {
- if(pPrev)
- pPrev->next = pEntry->next;
- else
- pPrev = pEntry->next;
- if(pEntry->name != (char *)NULL)
- xfree(pEntry->name);
- xfree(pEntry);
- pEntry = pPrev;
- }
- }
-
- FreeDriverMap(driverMap);
-
- return Success;
-}
-
-/*
- * ValidateFontDir looks for a valid font directory for the specified
- * printer model within the specified configuration directory. It returns
- * the directory name, or NULL if no valid font directory was found.
- * It is the caller's responsibility to free the returned font directory
- * name.
- */
-static char *
-ValidateFontDir(
- char *configDir,
- char *modelName)
-{
- char *pathName;
-
- if(!configDir || !modelName)
- return (char *)NULL;
-
- pathName = (char *)xalloc(strlen(configDir) + strlen(MODELDIRNAME) +
- strlen(modelName) + strlen(FONTDIRNAME) +
- strlen("fonts.dir") + 5);
- if(!pathName)
- return (char *)NULL;
- sprintf(pathName, "%s/%s/%s/%s/%s", configDir, MODELDIRNAME, modelName,
- FONTDIRNAME, "fonts.dir");
- if(access(pathName, R_OK) != 0)
- {
- xfree(pathName);
- return (char *)NULL;
- }
- pathName[strlen(pathName) - 9] = (char)'\0'; /* erase fonts.dir */
- return pathName;
-}
-
-/*
- * FindFontDir returns a pointer to the path name of the font directory
- * for the specified printer model name, if such a directory exists.
- * The directory contents are superficially checked for validity.
- * The caller must free the returned char *.
- *
- * We first look in the locale-specific model-config directory, and
- * then fall back to the C language model-config directory.
- */
-static char *
-FindFontDir(
- char *modelName)
-{
- char *configDir, *fontDir;
-
- if(!modelName || !strlen(modelName))
- return (char *)NULL;
-
- configDir = XpGetConfigDir(TRUE);
- if ((fontDir = ValidateFontDir(configDir, modelName)) != 0)
- {
- xfree(configDir);
- return fontDir;
- }
-
- if(configDir)
- xfree(configDir);
- configDir = XpGetConfigDir(FALSE);
- fontDir = ValidateFontDir(configDir, modelName);
-
- xfree(configDir);
-
- return fontDir;
-}
-
-/*
- * AddToFontPath adds the specified font path element to the global
- * defaultFontPath string. It adds the keyword "PRINTER:" to the front
- * of the path to denote that this is a printer-specific font path
- * element.
- */
-static char PATH_PREFIX[] = "PRINTER:";
-static int PATH_PREFIX_LEN = sizeof(PATH_PREFIX) - 1; /* same as strlen() */
-
-static void
-AddToFontPath(
- char *pathName)
-{
- char *newPath;
- Bool freeOldPath;
-
- if(defaultFontPath == origFontPath)
- freeOldPath = FALSE;
- else
- freeOldPath = TRUE;
-
- newPath = (char *)xalloc(strlen(defaultFontPath) + strlen(pathName) +
- PATH_PREFIX_LEN + 2);
-
- sprintf(newPath, "%s%s,%s", PATH_PREFIX, pathName, defaultFontPath);
-
- if(freeOldPath)
- xfree(defaultFontPath);
-
- defaultFontPath = newPath;
- return;
-}
-
-/*
- * AugmentFontPath adds printer-model-specific font path elements to
- * the front of the font path global variable "defaultFontPath" (dix/globals.c).
- * We can't call SetFontPath() because the font code has not yet been
- * initialized when InitOutput is called (from whence this routine is called).
- *
- * This utilizes the static variables origFontPath and
- * freeDefaultFontPath to track the original contents of defaultFontPath,
- * and to properly free the modified version upon server recycle.
- */
-static void
-AugmentFontPath(void)
-{
- char *modelID, **allIDs = (char **)NULL;
- PrinterDbPtr pDbEntry;
- int numModels, i;
-
- if(!origFontPath)
- origFontPath = defaultFontPath;
-
- if(freeDefaultFontPath)
- {
- xfree(defaultFontPath);
- defaultFontPath = origFontPath;
- freeDefaultFontPath = FALSE;
- }
-
- /*
- * Build a list of printer models to check for internal fonts.
- */
- for(pDbEntry = printerDb, numModels = 0;
- pDbEntry != (PrinterDbPtr)NULL;
- pDbEntry = pDbEntry->next)
- {
- modelID =
- (char*)XpGetPrinterAttribute(pDbEntry->name,
- "xp-model-identifier");
-
- if(modelID && strlen(modelID) != 0)
- {
- /* look for current model in the list of allIDs */
- for(i = 0; i < numModels; i++)
- {
- if(!strcmp(modelID, allIDs[i]))
- {
- modelID = (char *)NULL;
- break;
- }
- }
- }
-
- /*
- * If this printer's model-identifier isn't in the allIDs list,
- * then add it to allIDs.
- */
- if(modelID && strlen(modelID) != 0)
- {
- allIDs = (char **)xrealloc(allIDs, (numModels+2) * sizeof(char *));
- if(allIDs == (char **)NULL)
- return;
- allIDs[numModels] = modelID;
- allIDs[numModels + 1] = (char *)NULL;
- numModels++;
- }
- }
-
- /* for each model, check for a valid font directory, and add it to
- * the front of defaultFontPath.
- */
- for(i = 0; allIDs != (char **)NULL && allIDs[i] != (char *)NULL; i ++)
- {
- char *fontDir;
- if ((fontDir = FindFontDir(allIDs[i])) != 0)
- {
- AddToFontPath(fontDir);
- xfree(fontDir);
- freeDefaultFontPath = TRUE;
- }
- }
-
- if(allIDs)
- xfree(allIDs);
-
- return;
-}
-
-/*
- * XpClientIsBitmapClient is called by the font code to find out if
- * a particular client should be granted access to bitmap fonts.
- * This function works by
- * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine
- * the context associated with the client, and then queries the context's
- * attributes to determine whether the bitmap fonts should be visible.
- * It looks at the value of the xp-listfonts-mode document/page attribute to
- * see if xp-list-glyph-fonts has been left out of the mode list. Only
- * if the xp-listfonts-mode attribute exists, and it does not contain
- * xp-list-glyph-fonts does this function return FALSE. In any other
- * case the funtion returns TRUE, indicating that the bitmap fonts
- * should be visible to the client.
- */
-Bool
-XpClientIsBitmapClient(
- ClientPtr client)
-{
- XpContextPtr pContext;
- char *mode;
-
- if(!(pContext = XpContextOfClient(client)))
- return TRUE;
-
- /*
- * Check the page attributes, and if it's not defined there, then
- * check the document attributes.
- */
- mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-mode");
- if(!mode || !strlen(mode))
- {
- mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-mode");
- if(!mode || !strlen(mode))
- return TRUE;
- }
-
- if(!strstr(mode, "xp-list-glyph-fonts"))
- return FALSE;
-
- return TRUE;
-}
-/*
- * XpClientIsPrintClient is called by the font code to find out if
- * a particular client has set a context which references a printer
- * which utilizes a particular font path. This function works by
- * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine
- * the context associated with the client, and then looks up the
- * font directory for the context. The font directory is then compared
- * with the directory specified in the FontPathElement which is passed in.
- */
-Bool
-XpClientIsPrintClient(
- ClientPtr client,
- FontPathElementPtr fpe)
-{
- XpContextPtr pContext;
- char *modelID, *fontDir;
-
- if(!(pContext = XpContextOfClient(client)))
- return FALSE;
-
- if (!fpe)
- return TRUE;
-
- modelID = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-model-identifier");
- if(!modelID || !strlen(modelID))
- return FALSE;
-
- if(!(fontDir = FindFontDir(modelID)))
- return FALSE;
-
- /*
- * The grunge here is to ignore the PATH_PREFIX at the front of the
- * fpe->name.
- */
- if(fpe->name_length < PATH_PREFIX_LEN ||
- (strlen(fontDir) != (unsigned)(fpe->name_length - PATH_PREFIX_LEN)) ||
- strncmp(fontDir, fpe->name + PATH_PREFIX_LEN,
- fpe->name_length - PATH_PREFIX_LEN))
- {
- xfree(fontDir);
- return FALSE;
- }
- xfree(fontDir);
- return TRUE;
-}
-
-static void
-AddFormats(ScreenInfo *pScreenInfo, char *driverName)
-{
- int i, j;
- driverInitRec *pInitRec;
- int numDrivers = sizeof(driverInits)/sizeof(driverInitRec);
- PixmapFormatRec *formats;
- int numfmts;
-
- for (pInitRec = driverInits, i = 0; i < numDrivers; pInitRec++, i++)
- {
- if ( !strcmp( driverName, pInitRec->driverName ) )
- break;
- }
- if (i >= numDrivers)
- return;
- formats = pInitRec->pFmts;
- numfmts = pInitRec->numFmts;
- for (i = 0; i < numfmts && pScreenInfo->numPixmapFormats < MAXFORMATS; i++)
- {
- for (j = 0; j < pScreenInfo->numPixmapFormats; j++) {
- if (pScreenInfo->formats[j].depth == formats[i].depth &&
- pScreenInfo->formats[j].bitsPerPixel == formats[i].bitsPerPixel &&
- pScreenInfo->formats[j].scanlinePad == formats[i].scanlinePad)
- break;
- }
- if (j == pScreenInfo->numPixmapFormats) {
- pScreenInfo->formats[j] = formats[i];
- pScreenInfo->numPixmapFormats++;
- }
- }
-}
-
-/************************************************************
- * PrinterInitOutput --
- * This routine is to be called from a ddx's InitOutput
- * during the server startup initialization, and when
- * the server is to be reset. The routine creates the
- * screens associated with configured printers by calling
- * dix:AddScreen. The configuration information comes from a
- * database read from the X*printers file.
- *
- * Results:
- * The array of ScreenRec pointers referenced by
- * pScreenInfo->screen is increased by the addition
- * of the printer screen(s), as is the value of
- * pScreenInfo->numScreens. This is done via calls
- * to AddScreen() in dix.
- *
- ************************************************************/
-
-void
-PrinterInitOutput(
- ScreenInfo *pScreenInfo,
- int argc,
- char **argv)
-{
- PrinterDbPtr pDb, pDbEntry;
- int driverCount = 0, i;
- char **driverNames;
- char *configDir;
-
- /*
- * this little test is just a warning at startup to make sure
- * that the config directory exists.
- *
- * what this ugly looking if says is that if both ways of
- * calling configDir works and both directories don't exist,
- * then print an error saying we can't find the non-lang one.
- */
- if (((configDir = XpGetConfigDir(TRUE)) != NULL) &&
- (access(configDir, F_OK) == 0))
- {
- xfree(configDir);
- }
- else if (((configDir = XpGetConfigDir(FALSE)) != NULL) &&
- (access(configDir, F_OK) == 0))
- {
- xfree(configDir);
- }
- else {
- ErrorF("Xp Extension: could not find config dir %s\n",
- configDir ? configDir : XPRINTDIR);
-
- if (configDir) xfree(configDir);
- }
-
- if(printerDb != (PrinterDbPtr)NULL)
- FreePrinterDb();
-
- /*
- * Calling BuildPrinterDb serves to build the printer database,
- * and to initialize the attribute store for each printer.
- * The driver can, if it so desires, modify the attribute
- * store at a later time.
- */
- if((pDb = BuildPrinterDb()) == (PrinterDbPtr)NULL) return;
-
- /*
- * We now have to decide how many screens to initialize, and call
- * AddScreen for each one. The printerDb must be properly initialized
- * for at least one screen's worth of printers prior to calling AddScreen
- * because InitPrintDrivers reads the printerDb to determine which
- * driver(s) to init on a particular screen.
- * We put each driver's printers on a different
- * screen, and call AddScreen for each screen/driver pair.
- */
- /* count the number of printers */
- for(pDbEntry = pDb, driverCount = 0; pDbEntry != (PrinterDbPtr)NULL;
- pDbEntry = pDbEntry->next, driverCount++)
- ;
- /*
- * Allocate memory for the worst case - a driver per printer
- */
- driverNames = (char **)xalloc(sizeof(char *) * driverCount);
-
- /*
- * Assign the driver for the first printer to the first screen
- */
- pDb->screenNum = screenInfo.numScreens;
- driverNames[0] = pDb->driverName;
- driverCount = 1;
- AddFormats(pScreenInfo, pDb->driverName);
-
- /*
- * For each printer, look to see if its driver is already assigned
- * to a screen, and if so copy that screen number into the printerDb.
- * Otherwise, assign a new screen number to the driver for this
- * printer.
- */
- for(pDbEntry = pDb; pDbEntry != (PrinterDbPtr)NULL;
- pDbEntry = pDbEntry->next)
- {
- Bool foundMatch;
-
- for(i = 0, foundMatch = FALSE; i < driverCount; i++)
- {
- if(!strcmp(driverNames[i], pDbEntry->driverName))
- {
- foundMatch = TRUE;
- pDbEntry->screenNum = screenInfo.numScreens + i;
- break;
- }
- }
- if(foundMatch == FALSE)
- {
- driverNames[driverCount] = pDbEntry->driverName;
- pDbEntry->screenNum = screenInfo.numScreens + driverCount;
- AddFormats(pScreenInfo, pDbEntry->driverName);
- driverCount++;
- }
- }
-
- for(i = 0; i < driverCount; i++)
- {
- int curScreen = screenInfo.numScreens;
- if(AddScreen(InitPrintDrivers, argc, argv) < 0)
- {
- PrinterDbPtr pPrev;
- /*
- * AddScreen failed, so we pull the associated printers
- * from the list.
- */
- ErrorF("Xp Extension: Could not add screen for driver %s\n",
- driverNames[i]);
- for(pPrev = pDbEntry = printerDb; pDbEntry != (PrinterDbPtr)NULL;
- pDbEntry = pDbEntry->next)
- {
- if(pDbEntry->screenNum == curScreen)
- {
- if(pPrev == printerDb)
- {
- printerDb = pDbEntry->next;
- pPrev = printerDb;
- }
- else
- pPrev->next = pDbEntry->next;
-
- xfree(pDbEntry->name);
- xfree(pDbEntry);
- pDbEntry = pPrev;
- }
- else
- {
- if(pDbEntry->screenNum > curScreen)
- pDbEntry->screenNum--;
- pPrev = pDbEntry;
- }
- }
- }
- }
-
- xfree(driverNames);
-
- AugmentFontPath();
-
- if(pScreenInfo->numScreens > MAXSCREENS)
- {
- ErrorF("The number of printer screens requested ");
- ErrorF("exceeds the allowable limit of %d screens.\n", MAXSCREENS);
- ErrorF("Please reduce the number of requested printers in your ");
- ErrorF("\nX%sprinters file.", display);
- ErrorF("Server exiting...\n");
- exit(-1);
- }
-}
-
-/*
- * InitPrintDrivers is called from dix:AddScreen. It in turn calls the
- * driver initialization routine for any and all drivers which are
- * implicated in supporting printers on the particular screen number
- * specified by the "index" parameter. The printerDb variable is used
- * to determine which printers are to be associated with a particular
- * screen.
- */
-static Bool
-InitPrintDrivers(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv)
-{
- PrinterDbPtr pDb, pDb2;
-
- GenericScreenInit(index, pScreen, argc, argv);
-
- for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next)
- {
- if(pDb->screenNum == index)
- {
- Bool callInit = TRUE;
- for(pDb2 = printerDb; pDb2 != pDb; pDb2 = pDb2->next)
- {
- if(!strcmp(pDb->driverName, pDb2->driverName))
- {
- callInit = FALSE;
- break;
- }
- }
- if(callInit == TRUE)
- {
- pBFunc initFunc;
- initFunc = GetInitFunc(pDb->driverName);
- if(initFunc(index, pScreen, argc, argv) == FALSE)
- {
- /* XXX - What do I do if the driver's init fails? */
- }
- }
- }
- }
- return TRUE;
-}
-
-void
-_XpVoidNoop(void)
-{
- return;
-}
-
-Bool
-_XpBoolNoop(void)
-{
- return TRUE;
-}
-
-/*
- * GenericScreenInit - The common initializations required by all
- * printer screens and drivers. It sets the screen's cursor functions
- * to Noops, and computes the maximum screen (i.e. medium) dimensions.
- */
-
-static void
-GenericScreenInit(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv)
-{
- float fWidth, fHeight, maxWidth, maxHeight;
- unsigned short width, height;
- PrinterDbPtr pDb;
- int res, maxRes;
-
- /*
- * Set the cursor ops to no-op functions.
- */
- pScreen->DisplayCursor = (DisplayCursorProcPtr)_XpBoolNoop;
- pScreen->RealizeCursor = (RealizeCursorProcPtr)_XpBoolNoop;
- pScreen->UnrealizeCursor = (UnrealizeCursorProcPtr)_XpBoolNoop;
- pScreen->SetCursorPosition = (SetCursorPositionProcPtr)_XpBoolNoop;
- pScreen->ConstrainCursor = (ConstrainCursorProcPtr)_XpVoidNoop;
- pScreen->CursorLimits = (CursorLimitsProcPtr)_XpVoidNoop;
- pScreen->RecolorCursor = (RecolorCursorProcPtr)_XpVoidNoop;
-
- /*
- * Find the largest paper size for all the printers on the given
- * screen.
- */
- maxRes = 0;
- maxWidth = maxHeight = 0.0;
- for( pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next)
- {
- if(pDb->screenNum == index)
- {
- XpValidatePoolsRec *pValRec;
- pVFunc dimensionsFunc;
-
- GetDimFuncAndRec(pDb->driverName, &pValRec, &dimensionsFunc);
- if(dimensionsFunc != (pVFunc)NULL)
- dimensionsFunc(pDb->name, pValRec, &fWidth, &fHeight, &res);
- else
- XpGetMaxWidthHeightRes(pDb->name, pValRec, &fWidth,
- &fHeight, &res);
- if( res > maxRes )
- maxRes = res;
- if( fWidth > maxWidth )
- maxWidth = fWidth;
- if( fHeight > maxHeight )
- maxHeight = fHeight;
- }
- }
-
- width = (unsigned short) (maxWidth * maxRes / 25.4);
- height = (unsigned short) (maxHeight * maxRes / 25.4);
- pScreen->width = pScreen->height = ( width > height ) ? width :
- height;
-
- pScreen->mmWidth = pScreen->mmHeight = ( maxWidth > maxHeight ) ?
- (unsigned short)(maxWidth + 0.5) :
- (unsigned short)(maxHeight + 0.5);
-}
-
-/*
- * FillPrinterListEntry fills in a single XpDiListEntry element with data
- * derived from the supplied PrinterDbPtr element.
- *
- * XXX A smarter (i.e. future) version of this routine might inspect the
- * XXX "locale" parameter and attempt to match the "description" and
- * XXX "localeName" elements of the XpDiListEntry to the specified locale.
- */
-static void
-FillPrinterListEntry(
- XpDiListEntry *pEntry,
- PrinterDbPtr pDb,
- int localeLen,
- char *locale)
-{
- static char *localeStr = (char *)NULL;
-
- if(localeStr == (char *)NULL)
- localeStr = strdup(setlocale(LC_ALL, (const char *)NULL));
-
- pEntry->name = pDb->name;
- pEntry->description =
- (char*)XpGetPrinterAttribute(pDb->name, "descriptor");
- pEntry->localeName = localeStr;
- pEntry->rootWinId = WindowTable[pDb->screenNum]->drawable.id;
-}
-
-/*
- * GetPrinterListInfo fills in the XpDiListEntry struct pointed to by the
- * parameter pEntry with the information regarding the printer specified
- * by the name and nameLen parameters. The pointers placed in the
- * XpDiListEntry structure MUST NOT be freed by the caller. They are
- * pointers into existing long-lived databases.
- *
- */
-static Bool
-GetPrinterListInfo(
- XpDiListEntry *pEntry,
- int nameLen,
- char *name,
- int localeLen,
- char *locale)
-{
- PrinterDbPtr pDb;
-
- for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next)
- {
- if (strlen(pDb->name) == (unsigned)nameLen
- && !strncmp(pDb->name, name, nameLen))
- {
- FillPrinterListEntry(pEntry, pDb, localeLen, locale);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- * XpDiFreePrinterList is the approved method of releasing memory used
- * for a printer list.
- */
-void
-XpDiFreePrinterList(XpDiListEntry **list)
-{
- int i;
-
- for(i = 0; list[i] != (XpDiListEntry *)NULL; i++)
- xfree(list[i]);
- xfree(list);
-}
-
-/*
- * XpDiGetPrinterList returns a pointer to a NULL-terminated array of
- * XpDiListEntry pointers. Each entry structure contains the name,
- * description, root window, and locale of a printer. The call returns
- * either a list of all printers configured on the server, or it returns
- * the information for one specific printer depending on the values passed
- * in. Non-NULL values passed in indicate that only the information for
- * the one specific printer is desired, while NULL values indicate that
- * the information for all printers is desired.
- */
-XpDiListEntry **
-XpDiGetPrinterList(
- int nameLen,
- char *name,
- int localeLen,
- char *locale)
-{
- XpDiListEntry **pList;
-
- if(!nameLen || name == (char *)NULL)
- {
- int i;
- PrinterDbPtr pDb;
-
- for(pDb = printerDb, i = 0; pDb != (PrinterDbPtr)NULL;
- pDb = pDb->next, i++)
- ;
-
- if((pList = (XpDiListEntry **)xalloc((i+1) * sizeof(XpDiListEntry *)))
- == (XpDiListEntry **)NULL)
- return pList;
-
- pList[i] = (XpDiListEntry *)NULL;
- for(pDb = printerDb, i = 0; pDb != (PrinterDbPtr)NULL;
- pDb = pDb->next, i++)
- {
- if((pList[i] = (XpDiListEntry *)xalloc(sizeof(XpDiListEntry)))==
- (XpDiListEntry *)NULL)
- {
- XpDiFreePrinterList(pList);
- return (XpDiListEntry **)NULL;
- }
- FillPrinterListEntry(pList[i], pDb, localeLen, locale);
- }
- }
- else
- {
- if((pList = (XpDiListEntry **)xalloc(2 * sizeof(XpDiListEntry *))) ==
- (XpDiListEntry **)NULL)
- return pList;
-
- if((pList[0] = (XpDiListEntry *)xalloc(sizeof(XpDiListEntry))) ==
- (XpDiListEntry *)NULL)
- {
- xfree(pList);
- return (XpDiListEntry **)NULL;
- }
- pList[1] = (XpDiListEntry *)NULL;
- if(GetPrinterListInfo(pList[0], nameLen, name, localeLen, locale) ==
- FALSE)
- {
- xfree(pList[0]);
- pList[0] = (XpDiListEntry *)NULL;
- }
- }
- return pList;
-}
-
-WindowPtr
-XpDiValidatePrinter(char *printerName, int printerNameLen)
-{
- PrinterDbPtr pCurEntry;
-
- for(pCurEntry = printerDb;
- pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pCurEntry->next)
- {
- if(strlen(pCurEntry->name) == (unsigned)printerNameLen &&
- !strncmp(pCurEntry->name, printerName, printerNameLen))
- return WindowTable[pCurEntry->screenNum];
- }
- return (WindowPtr)NULL;
-}
-
-/*
- * XpDiGetDriverName takes a screen index and a printer name, and returns
- * a pointer to the name of the driver to be used for the specified printer
- * on the specified screen.
- */
-char *
-XpDiGetDriverName(int index, char *printerName)
-{
-
- PrinterDbPtr pCurEntry;
-
- for(pCurEntry = printerDb;
- pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pCurEntry->next)
- {
- if(pCurEntry->screenNum == index &&
- !strcmp(pCurEntry->name, printerName))
- return pCurEntry->driverName;
- }
-
- return (char *)NULL; /* XXX Should we supply a default driverName? */
-}
diff --git a/Xprint/Oid.c b/Xprint/Oid.c
deleted file mode 100644
index 4c23a6e09..000000000
--- a/Xprint/Oid.c
+++ /dev/null
@@ -1,3179 +0,0 @@
-/* $Xorg: Oid.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/Oid.c,v 1.6 2003/10/29 22:11:54 tsi Exp $ */
-
-#include "attributes.h"
-
-/*
- * XpOidNotify value strings
- */
-#define NOTIFY_EMAIL_STR "{{event-report-job-completed} electronic-mail}"
-#define NOTIFY_NONE_STR "{}"
-
-#define SafeStrLen(s) ((s) ? strlen((s)) : 0)
-
-/*
- * entry type for the object identifier string map
- */
-typedef struct _XpOidStringMapEntry
-{
- const char* string;
- int length;
- int msg_set;
- int msg_number;
- const char* default_message;
-
-} XpOidStringMapEntry;
-
-/*
- * include the auto-generated static XpOidStringMap
- */
-#include "OidStrs.h"
-
-/*
- * XpOid static function declarations
- */
-static XpOid XpOidParse(const char* value_string,
- const char** ptr_return);
-/*
- * XpOidList static function declarations
- */
-static XpOidList* XpOidListParse(const char* value_string,
- const XpOidList* valid_oids,
- const char** ptr_return, int i);
-
-/*
- * XpOidList static function declarations
- */
-static XpOidCardList* XpOidCardListParse(const char* value_string,
- const XpOidCardList* valid_cards,
- const char** ptr_return, int i);
-
-/*
- * XpOidMediumSourceSize static function declarations
- */
-static XpOidMediumSS* MediumSSParse(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidList* valid_medium_sizes,
- const char** ptr_return, int i);
-static XpOidMediumContinuousSize* MediumContinuousSizeParse(const char*,
- const char**);
-static void MediumContinuousSizeDelete(XpOidMediumContinuousSize* me);
-static XpOidMediumDiscreteSizeList* MediumDiscreteSizeListParse(const char*,
- const XpOidList*,
- const char**,
- int i);
-static void MediumDiscreteSizeListDelete(XpOidMediumDiscreteSizeList* list);
-
-static BOOL ParseArea(const char* value_string,
- const char** ptr_return,
- XpOidArea* area_return);
-static BOOL ParseRealRange(const char* value_string,
- const char** ptr_return,
- XpOidRealRange* range_return);
-
-/*
- * XpOidTrayMediumList static function declarations
- */
-static XpOidTrayMediumList* TrayMediumListParse(const char* value_string,
- const XpOidList* valid_trays,
- const char** ptr_return,
- int i);
-static void TrayMediumListValidate(XpOidTrayMediumList* me,
- const XpOidMediumSS* msss);
-
-/*
- * XpOidDocFmt
- */
-static BOOL XpOidDocFmtNext(XpOidDocFmt* doc_fmt,
- const char* value_string,
- const char** ptr_return);
-
-/*
- * XpOidDocFmtListParse
- */
-static XpOidDocFmtList* XpOidDocFmtListParse(const char* value_string,
- const XpOidDocFmtList* valid_fmts,
- const char** ptr_return, int i);
-
-/*
- * misc. parsing static function declarations
- */
-static BOOL ParseBoolValue(const char* value_string,
- const char** ptr_return,
- BOOL* bool_return);
-static BOOL ParseRealValue(const char* value_string,
- const char** ptr_return,
- float* real_return);
-static BOOL ParseSeqEnd(
- const char* value_string,
- const char** ptr_return);
-static BOOL ParseSeqStart(
- const char* value_string,
- const char** ptr_return);
-static BOOL ParseUnspecifiedValue(
- const char* value_string,
- const char** ptr_return);
-static int SpanToken(
- const char* string);
-static int SpanWhitespace(
- const char* string);
-
-/*
- * String comparison function.
- */
-#ifdef HAVE_STRCASECMP
-# define StrnCaseCmp(s1, s2, len) strncasecmp(s1, s2, len)
-#else
-static int StrnCaseCmp(const char *s1, const char *s2, size_t len);
-#endif
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidString
- *
- * Description:
- *
- * Obtain the string representation of an XpOid.
- *
- * Example: XpOidString(xpoid_copy_count) returns "copy-count".
- *
- * Return value:
- *
- * A const pointer to the string.
- */
-const char*
-XpOidString(XpOid xp_oid)
-{
- /*
- * XpOid enum values are index values into the string map
- */
- return XpOidStringMap[xp_oid].string;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidStringLength
- *
- * Description:
- *
- * Obtain the length of the string representation for a given
- * XpOid.
- *
- * Return value:
- *
- * The string length in bytes.
- *
- */
-int
-XpOidStringLength(XpOid xp_oid)
-{
- /*
- * XpOid enum values are index values into the string map
- */
- return XpOidStringMap[xp_oid].length;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidFromString
- *
- * Description:
- *
- * Obtains the XpOid given a string representation of an XpOid.
- *
- * Example: XpOidFromString("copy-count") returns 'xpoid_copy_count'.
- *
- * Return value:
- *
- * The XpOid if successful. 'xpoid_none' if the string pointed to by
- * 'value is not recognized or if 'value' is NULL.
- */
-XpOid
-XpOidFromString(const char* value)
-{
- if(value == (const char*)NULL)
- return xpoid_none;
- else
- return XpOidParse(value, (const char**)NULL);
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidParse
- *
- * Description:
- *
- * Parse the next whitespace-delimited string from 'value_string'
- * updating 'ptr_return' to point to the next unparsed location in
- * 'value_string'. 'ptr_return' can be NULL.
- *
- * Return value:
- *
- * The corresponding XpOid for the parsed name string.
- * A return value of xpoid_none is returned if the parsed name
- * was not a valid oid or if no name was found.
- *
- */
-static XpOid
-XpOidParse(const char* value_string,
- const char** ptr_return)
-{
- const char* ptr;
- int length;
- int i;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- /*
- * get the whitespace-delimited token length
- */
- length = SpanToken(ptr);
- /*
- * match the oid string in the map
- */
- for(i = 0; i < XpOidStringMapCount; i++)
- if(length == XpOidStringMap[i].length)
- if(strncmp(ptr, XpOidStringMap[i].string, length) == 0)
- break;
- if(i == XpOidStringMapCount)
- i = xpoid_none;
- /*
- * update the return pointer and return
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr+length;
- return (XpOid)i;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListNew
- *
- * Description:
- *
- * Creates a new XpOidList initialized from a whitespace-delimited
- * list of recognized string representations of oids. The returned
- * list will contain only oids found within the passed 'valid_oids'
- * XpOidList.
- *
- * Note: One may notice that in order to create an XpOidList with
- * this function, an XpOidList is needed; the 'valid_oids' list
- * is often an statically initialized structure. XpOidListInit
- * can also be used.
- *
- * Return value:
- *
- * NULL if the passed 'value_string' is NULL.
- *
- * If the list indicated by 'value_string' is empty or contains only
- * unrecognized oid string representations, a new XpOidList
- * containing zero elements is returned.
- *
- * If 'valid_oids' is NULL all oids are considered valid.
- *
- */
-XpOidList*
-XpOidListNew(const char* value_string,
- const XpOidList* valid_oids)
-{
- if(value_string == (const char*)NULL)
- return (XpOidList*)NULL;
- else
- {
- const char* ptr;
- return XpOidListParse(value_string, valid_oids, &ptr, 0);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListDelete
- *
- * Description:
- *
- * Frees the memory allocated for 'list'.
- *
- * Return value:
- *
- * None.
- *
- */
-void
-XpOidListDelete(XpOidList* list)
-{
- if(list != (XpOidList*)NULL)
- {
- XpOidFree((char*)list->list);
- XpOidFree((char*)list);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListParse
- *
- * Description:
- *
- * This function recursively parses the whitespace-delimited list of
- * oid string representations passed via 'value_string'. Oids are
- * only added to the resulting list if they are found within the
- * passed 'valid_oids' XpOidList.
- *
- * 'ptr_return' points to a char* variable allocated by the
- * caller, and is really only of use during recursion (upon return to
- * the original caller, it will point to the end of value_string).
- *
- * 'value_string' and 'ptr_return' *cannot* be NULL.
- *
- * Return value:
- *
- * A newly allocated and initialized XpOidList.
- *
- * If the list indicated by 'value_string' is empty or contains only
- * unrecognized oid string representations, a new XpOidList
- * containing zero elements is returned.
- *
- * If 'valid_oids' is NULL all oids are considered valid.
- *
- */
-static XpOidList*
-XpOidListParse(const char* value_string,
- const XpOidList* valid_oids,
- const char** ptr_return,
- int i)
-{
- XpOid oid;
- XpOidList* list;
- /*
- * parse the next valid oid out of the value string
- */
- ptr_return = &value_string;
- while(1)
- {
- if(**ptr_return == '\0')
- {
- /*
- * end of value string; stop parsing
- */
- oid = xpoid_none;
- break;
- }
- /*
- * parse the next oid from the value
- */
- oid = XpOidParse(*ptr_return, ptr_return);
- if(xpoid_none == oid)
- {
- /*
- * unrecognized oid; keep parsing
- */
- continue;
- }
- if((const XpOidList*)NULL == valid_oids
- ||
- XpOidListHasOid(valid_oids, oid))
- {
- /*
- * valid oid found; stop parsing
- */
- break;
- }
- }
-
- if(oid == xpoid_none)
- {
- /*
- * end of value string; allocate the list structure
- */
- list = (XpOidList*)XpOidCalloc(1, sizeof(XpOidList));
- list->count = i;
- list->list = (XpOid*)XpOidCalloc(i, sizeof(XpOid));
- }
- else
- {
- /*
- * recurse
- */
- list = XpOidListParse(*ptr_return, valid_oids, ptr_return, i+1);
- /*
- * set the oid in the list
- */
- list->list[i] = oid;
- }
- /*
- * return
- */
- return list;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListHasOid
- *
- * Description:
- *
- * Determines if 'oid' is an element of 'list'.
- *
- * Return value:
- *
- * xTrue if the oid is found in the list.
- *
- * xFalse if the oid is not in the list, or if 'list' is NULL.
- *
- */
-BOOL
-XpOidListHasOid(const XpOidList* list, XpOid oid)
-{
- int i;
- if(list != (XpOidList*)NULL)
- for(i = 0; i < list->count; i++)
- if(list->list[i] == oid)
- return xTrue;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListGetIndex
- *
- * Description:
- *
- * Returns the array index of 'oid' in 'list'
- *
- * Return value:
- *
- * The index of 'oid' in list.
- *
- * -1 if the oid is not in the list, or if 'list' is NULL.
- *
- */
-int
-XpOidListGetIndex(const XpOidList* list, XpOid oid)
-{
- int i;
- if(list != (XpOidList*)NULL)
- for(i = 0; i < list->count; i++)
- if(list->list[i] == oid)
- return i;
- return -1;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidListString
- *
- * Description:
- *
- * Creates a string representation of an XpOidList structure.
- *
- * Return value:
- *
- * A newly allocated
- *
- */
-char*
-XpOidListString(const XpOidList* me)
-{
- int i;
- int length;
- char* str;
- char* ptr;
- /*
- * allocate enough memory for the oid string representations,
- * including intervening whitespace
- */
- for(i = 0, length = 0; i < XpOidListCount(me); i++)
- length += XpOidStringLength(XpOidListGetOid(me, i)) + 1;
- str = XpOidMalloc(length+1);
- /*
- * format the list
- */
- for(i = 0, ptr = str; i < XpOidListCount(me); i++)
-#if defined(sun) && !defined(SVR4)
- {
- sprintf(ptr, "%s ", XpOidString(XpOidListGetOid(me, i)));
- ptr += strlen(ptr);
- }
-#else
- ptr += sprintf(ptr, "%s ", XpOidString(XpOidListGetOid(me, i)));
-#endif
- /*
- * chop trailing whitespace or terminate empty string
- */
- str[length] = '\0';
- /*
- * return
- */
- return str;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListNew
- *
- * Description:
- *
- * Creates a new instance of an empty XpOidLinkedList.
- *
- * Return value:
- *
- * The new XpOidLinkedList.
- *
- */
-XpOidLinkedList*
-XpOidLinkedListNew()
-{
- return (XpOidLinkedList*)XpOidCalloc(1, sizeof(XpOidLinkedList));
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListDelete
- *
- * Description:
- *
- * Frees the memory allocated for a XpOidLinkedList.
- *
- * Return value:
- *
- * None.
- *
- */
-void
-XpOidLinkedListDelete(XpOidLinkedList* me)
-{
- if(me != (XpOidLinkedList*)NULL)
- {
- while(me->head)
- {
- me->current = me->head;
- me->head = me->current->next;
- XpOidFree((char*)me->current);
- }
- XpOidFree((char*)me);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListGetOid
- *
- * Description:
- *
- * Retrieves the oid at position 'i' (zero-based) in the
- * XpOidLinkedList 'me'.
- *
- * Return value:
- *
- * The oid at position 'i'.
- *
- * xpoid_none if the oid was not found, or the list is empty (or if
- * the list contains xpoid_none at position 'i').
- */
-XpOid
-XpOidLinkedListGetOid(XpOidLinkedList* me, int i)
-{
- if(me == (XpOidLinkedList*)NULL || i < 0 || i >= me->count)
- {
- return xpoid_none;
- }
- else
- {
- me->current = me->head;
- while(i--) me->current = me->current->next;
- return me->current->oid;
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListAddOid
- *
- * Description:
- *
- * Adds an oid to the end of an XpOidLinkedList.
- *
- * Return value:
- *
- * None.
- *
- */
-void
-XpOidLinkedListAddOid(XpOidLinkedList* me, XpOid oid)
-{
- me->current = (XpOidNode)XpOidCalloc(1, sizeof(struct XpOidNodeStruct));
- me->current->oid = oid;
- ++me->count;
- if(me->tail)
- {
- me->tail->next = me->current;
- me->tail = me->current;
- }
- else
- me->head = me->tail = me->current;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListGetIndex
- *
- * Description:
- *
- * Returns the position of an oid in a XpOidLinkedList.
- *
- * Return value:
- *
- * The zero-based position of 'oid' in the list.
- *
- * -1 if the oid is not in the list, or if 'me' is NULL.
- *
- */
-int
-XpOidLinkedListGetIndex(XpOidLinkedList* me, XpOid oid)
-{
- if((XpOidLinkedList*)NULL != me)
- {
- int i = 0;
- me->current = me->head;
- while(me->current)
- if(me->current->oid == oid)
- {
- return i;
- }
- else
- {
- ++i;
- me->current = me->current->next;
- }
- }
- return -1;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListHasOid
- *
- * Description:
- *
- * Determines if an oid is an element of a XpOidLinkedList.
- *
- * Return value:
- *
- * xTrue if the oid is found in the list.
- *
- * xFalse if the oid is not in the list, or if 'me' is NULL.
- */
-BOOL
-XpOidLinkedListHasOid(XpOidLinkedList* me,
- XpOid oid)
-{
- if((XpOidLinkedList*)NULL != me)
- {
- me->current = me->head;
- while(me->current)
- if(me->current->oid == oid)
- return xTrue;
- else
- me->current = me->current->next;
- }
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListFirstOid
- *
- * Description:
- *
- * Positions the XpOidLinkedList 'current' pointer to the first entry
- * in the list.
- *
- * Return value:
- *
- * The first oid in the list, or xpoid_none if the list NULL or
- * empty.
- */
-XpOid
-XpOidLinkedListFirstOid(XpOidLinkedList* me)
-{
- if((XpOidLinkedList*)NULL != me && (me->current = me->head))
- return me->current->oid;
- else
- return xpoid_none;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidLinkedListNextOid
- *
- * Description:
- *
- * Positions the XpOidLinkedList 'current' pointer to the next entry
- * in the list.
- *
- * Return value:
- *
- * The next oid, or xpoid_none if the end of the list has been
- * reached.
- */
-XpOid
-XpOidLinkedListNextOid(XpOidLinkedList* me)
-{
- if(me->current ? (me->current = me->current->next) != 0 : xFalse)
- return me->current->oid;
- else
- return xpoid_none;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidMediumSSNew
- *
- * Description:
- *
- * Creates a new XpOidMediumSS initialized from a string value
- * specified using the medium-source-sizes syntax. See
- * MediumSSParse() below for parsing details.
- *
- * Return value:
- *
- * NULL if the passed 'value_string' is NULL, or if a syntax error is
- * encountered while parsing the medium-source-sizes value.
- *
- */
-XpOidMediumSS*
-XpOidMediumSSNew(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidList* valid_medium_sizes)
-{
- if(value_string == (const char*)NULL)
- return (XpOidMediumSS*)NULL;
- else
- {
- const char* ptr = value_string + SpanWhitespace(value_string);
- if(*ptr == '\0')
- return (XpOidMediumSS*)NULL;
- else
- return MediumSSParse(ptr, valid_trays, valid_medium_sizes,
- &ptr, 0);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: MediumSSParse
- *
- * Description:
- *
- * 'ptr_return' *cannot* be NULL.
- *
- *
- * Return value:
- *
- *
- *
- */
-static XpOidMediumSS*
-MediumSSParse(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidList* valid_medium_sizes,
- const char** ptr_return,
- int i)
-{
- XpOidMediumSS* medium_ss;
- XpOidMediumSourceSize mss;
- /*
- * check for the start of a new MediumSourceSize sequence
- */
- if(ParseSeqStart(value_string, ptr_return))
- {
- /*
- * check for an unspecified tray value
- */
- if(ParseUnspecifiedValue(*ptr_return, ptr_return))
- mss.input_tray = xpoid_unspecified;
- else
- {
- const char* tray_str;
- *ptr_return += SpanWhitespace(*ptr_return);
- tray_str = *ptr_return;
- /*
- * parse out the input tray
- */
- mss.input_tray = XpOidParse(*ptr_return, ptr_return);
- if((const XpOidList*)NULL != valid_trays
- &&
- !XpOidListHasOid(valid_trays, mss.input_tray)
- )
- mss.input_tray = xpoid_none;
- if(xpoid_none == mss.input_tray)
- {
- char* invalid_tray_str;
- int len = *ptr_return - tray_str;
- if(len > 0)
- {
- invalid_tray_str = XpOidMalloc(len+1);
- strncpy(invalid_tray_str, tray_str, len);
- invalid_tray_str[len] = '\0';
- ErrorF("%s\nInvalid tray (%s) found. Will attempt to continue parsing.\n",
- XPMSG_WARN_MSS, invalid_tray_str);
- XpOidFree(invalid_tray_str);
- }
- }
- }
- /*
- * attempt to parse a Continuous MediumSize sequence
- */
- mss.ms.continuous_size =
- MediumContinuousSizeParse(*ptr_return, ptr_return);
- if(mss.ms.continuous_size != (XpOidMediumContinuousSize*)NULL)
- {
- mss.mstag = XpOidMediumSS_CONTINUOUS;
- }
- else
- {
- /*
- * not continuous, try Discrete MediumSize
- */
- mss.ms.discrete =
- MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes,
- ptr_return, 0);
- if(mss.ms.discrete == (XpOidMediumDiscreteSizeList*)NULL)
- {
- const char* tray_str;
- /*
- * syntax error (MediumDiscreteSizeListParse reports error)
- */
- switch(mss.input_tray)
- {
- case xpoid_none:
- tray_str = "an invalid";
- break;
- case xpoid_unspecified:
- tray_str = "default (tray specifier omitted)";
- break;
- default:
- tray_str = XpOidString(mss.input_tray);
- break;
- }
- ErrorF("%s\nError occurred while parsing medium sizes for %s tray.\n",
- XPMSG_WARN_MSS, tray_str);
- return NULL;
- }
- mss.mstag = XpOidMediumSS_DISCRETE;
- }
- /*
- * parse out the MediumSourceSize sequence end
- */
- if(!ParseSeqEnd(*ptr_return, ptr_return))
- {
- /*
- * syntax error
- */
- ErrorF("%s\nSequence End expected. Unparsed data: %s\n",
- XPMSG_WARN_MSS, *ptr_return);
- return NULL;
- }
- /*
- * recurse to parse the next MediumSourceSize sequence
- */
- medium_ss = MediumSSParse(*ptr_return,
- valid_trays, valid_medium_sizes,
- ptr_return,
- xpoid_none == mss.input_tray ? i : i+1);
- if(medium_ss == (XpOidMediumSS*)NULL
- ||
- xpoid_none == mss.input_tray)
- {
- /*
- * syntax error or invalid tray - clean up
- */
- switch(mss.mstag)
- {
- case XpOidMediumSS_CONTINUOUS:
- MediumContinuousSizeDelete(mss.ms.continuous_size);
- break;
- case XpOidMediumSS_DISCRETE:
- MediumDiscreteSizeListDelete(mss.ms.discrete);
- break;
- }
- if(medium_ss == (XpOidMediumSS*)NULL)
- /*
- * syntax error - return
- */
- return NULL;
- }
- if(xpoid_none != mss.input_tray)
- {
- /*
- * copy the current MediumSourceSize into the array
- */
- memmove((medium_ss->mss)+i, &mss, sizeof(XpOidMediumSourceSize));
- }
- }
- else
- {
- /*
- * MediumSourceSize sequence start not found
- */
- if(**ptr_return == '\0')
- {
- if(0 == i)
- {
- ErrorF("%s\nNo valid trays found.\n", XPMSG_WARN_MSS);
- return NULL;
- }
- /*
- * end of value string; allocate the MediumSS structure
- */
- medium_ss = (XpOidMediumSS*)XpOidCalloc(1, sizeof(XpOidMediumSS));
- medium_ss->count = i;
- medium_ss->mss = (XpOidMediumSourceSize*)
- XpOidCalloc(i, sizeof(XpOidMediumSourceSize));
- }
- else
- {
- /*
- * syntax error
- */
- ErrorF("%s\nSequence Start expected.\nunparsed data: %s\n",
- XPMSG_WARN_MSS, *ptr_return);
- return NULL;
- }
- }
- return medium_ss;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidMediumSSDelete
- *
- * Description:
- *
- *
- *
- * Return value:
- *
- *
- *
- */
-void
-XpOidMediumSSDelete(XpOidMediumSS* me)
-{
- if(me != (XpOidMediumSS*)NULL)
- {
- int i;
- for(i = 0; i < me->count; i++)
- {
- switch((me->mss)[i].mstag)
- {
- case XpOidMediumSS_CONTINUOUS:
- MediumContinuousSizeDelete((me->mss)[i].ms.continuous_size);
- break;
- case XpOidMediumSS_DISCRETE:
- MediumDiscreteSizeListDelete((me->mss)[i].ms.discrete);
- break;
- }
- }
- XpOidFree((char*)me);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidMediumSSHasSize
- *
- * Description:
- *
- *
- *
- * Return value:
- *
- *
- *
- */
-BOOL
-XpOidMediumSSHasSize(XpOidMediumSS* me, XpOid page_size)
-{
- int i_mss, i_ds;
- XpOidMediumDiscreteSizeList* ds_list;
-
- if(me != (XpOidMediumSS*)NULL && page_size != xpoid_none)
- for(i_mss = 0; i_mss < me->count; i_mss++)
- {
- switch((me->mss)[i_mss].mstag)
- {
- case XpOidMediumSS_DISCRETE:
- ds_list = (me->mss)[i_mss].ms.discrete;
- for(i_ds = 0; i_ds < ds_list->count; i_ds++)
- if(page_size == (ds_list->list)[i_ds].page_size)
- return xTrue;
- break;
-
- case XpOidMediumSS_CONTINUOUS:
- /*
- * unsupported
- */
- break;
- }
- }
- /*
- * return
- */
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidMediumSSString
- *
- * Description:
- *
- * Creates a string representation of an XpOidMediumSS structure.
- *
- * Return value:
- *
- * A newly allocated
- *
- */
-char* XpOidMediumSSString(const XpOidMediumSS* me)
-{
- int itray, isize;
- int valid_size_count;
- int length;
- char* str;
- char* ptr;
- XpOidMediumDiscreteSize* ds;
- char buf[128];
- /*
- * determine the size of the string representation
- */
- for(itray = 0, length = 0; itray < XpOidMediumSSCount(me); itray++)
- {
- if(xpoid_none == me->mss[itray].input_tray
- ||
- XpOidMediumSS_CONTINUOUS == me->mss[itray].mstag)
- {
- /*
- * skip invalid tray or unsupported continuous size spec
- */
- continue;
- }
- for(isize = 0, valid_size_count = 0;
- isize < me->mss[itray].ms.discrete->count;
- isize++)
- {
- ds = me->mss[itray].ms.discrete->list+isize;
- if(ds->page_size == xpoid_none)
- continue;
- ++valid_size_count;
- length += XpOidStringLength(ds->page_size);
- length += ds->long_edge_feeds ? 4 : 5; /* "True" or "False" */
-#if defined(sun) && !defined(SVR4)
- sprintf(buf, "{%.4f %.4f %.4f %.4f}",
- ds->assured_reproduction_area.minimum_x,
- ds->assured_reproduction_area.maximum_x,
- ds->assured_reproduction_area.minimum_y,
- ds->assured_reproduction_area.maximum_y);
- length += strlen(buf);
-#else
- length += sprintf(buf, "{%.4f %.4f %.4f %.4f}",
- ds->assured_reproduction_area.minimum_x,
- ds->assured_reproduction_area.maximum_x,
- ds->assured_reproduction_area.minimum_y,
- ds->assured_reproduction_area.maximum_y);
-#endif
- length += 5; /* "{<size> <feed> <area>} " */
- }
- if(valid_size_count == 0)
- {
- /*
- * no valid sizes, skip
- */
- continue;
- }
- if(xpoid_unspecified == me->mss[itray].input_tray)
- length += 2; /* "''" */
- else
- length += XpOidStringLength(me->mss[itray].input_tray);
- length += 4; /* "{<tray> <sizes>} " */
- }
- /*
- * allocate
- */
- str = XpOidMalloc(length+1);
- /*
- * format
- */
- for(itray = 0, ptr = str; itray < XpOidMediumSSCount(me); itray++)
- {
- if(xpoid_none == me->mss[itray].input_tray
- ||
- XpOidMediumSS_CONTINUOUS == me->mss[itray].mstag)
- {
- /*
- * skip invalid tray or unsupported continuous size spec
- */
- continue;
- }
- /*
- * check to ensure all of the specified sizes are valid
- */
- for(isize = 0, valid_size_count = 0;
- isize < me->mss[itray].ms.discrete->count;
- isize++)
- {
- ds = me->mss[itray].ms.discrete->list+isize;
- if(ds->page_size != xpoid_none)
- ++valid_size_count;
- }
- if(valid_size_count == 0)
- {
- /*
- * no valid sizes, skip
- */
- continue;
- }
-
- if(xpoid_unspecified == me->mss[itray].input_tray)
- {
-#if defined(sun) && !defined(SVR4)
- sprintf(ptr, "{'' ");
- ptr += strlen(ptr);
-#else
- ptr += sprintf(ptr, "{'' ");
-#endif
- }
- else
- {
-#if defined(sun) && !defined(SVR4)
- sprintf(ptr, "{%s ", XpOidString(me->mss[itray].input_tray));
- ptr += strlen(ptr);
-#else
- ptr += sprintf(ptr, "{%s ",
- XpOidString(me->mss[itray].input_tray));
-#endif
- }
- for(isize = 0; isize < me->mss[itray].ms.discrete->count; isize++)
- {
- ds = me->mss[itray].ms.discrete->list+isize;
- if(ds->page_size != xpoid_none)
-#if defined(sun) && !defined(SVR4)
- {
- sprintf(ptr, "{%s %s {%.4f %.4f %.4f %.4f}} ",
- XpOidString(ds->page_size),
- ds->long_edge_feeds ? "True" : "False",
- ds->assured_reproduction_area.minimum_x,
- ds->assured_reproduction_area.maximum_x,
- ds->assured_reproduction_area.minimum_y,
- ds->assured_reproduction_area.maximum_y);
- ptr += strlen(ptr);
- }
-#else
- ptr += sprintf(ptr, "{%s %s {%.4f %.4f %.4f %.4f}} ",
- XpOidString(ds->page_size),
- ds->long_edge_feeds ? "True" : "False",
- ds->assured_reproduction_area.minimum_x,
- ds->assured_reproduction_area.maximum_x,
- ds->assured_reproduction_area.minimum_y,
- ds->assured_reproduction_area.maximum_y);
-#endif
- }
-#if defined(sun) && !defined(SVR4)
- sprintf(ptr, "} ");
- ptr += strlen(ptr);
-#else
- ptr += sprintf(ptr, "} ");
-#endif
- }
- /*
- * chop trailing whitespace or terminate empty string
- */
- str[length] = '\0';
- /*
- * return
- */
- return str;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: MediumContinuousSizeParse
- *
- * Description:
- *
- * 'ptr_return' *cannot* be NULL.
- *
- *
- * Return value:
- *
- *
- *
- */
-static XpOidMediumContinuousSize*
-MediumContinuousSizeParse(const char* value_string,
- const char** ptr_return)
-{
- const char* first_nonws_ptr;
- XpOidMediumContinuousSize* mcs = NULL;
- /*
- * skip leading whitespace
- */
- first_nonws_ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out the MediumSize sequence start char
- */
- if(!ParseSeqStart(first_nonws_ptr, ptr_return))
- goto MediumContinuousSizeParse_error;
- /*
- * peek ahead to see if it looks like we actually have a continuous
- * size spec (looking for the sequence start char on the 1st range spec)
- */
- if(!ParseSeqStart(*ptr_return, (const char**)NULL))
- goto MediumContinuousSizeParse_error;
- /*
- * Ok, let's go for it
- */
- mcs = (XpOidMediumContinuousSize*)
- XpOidCalloc(1, sizeof(XpOidMediumContinuousSize));
- /*
- * "range across the feed direction"
- */
- if(!ParseRealRange(*ptr_return, ptr_return, &mcs->range_across_feed))
- goto MediumContinuousSizeParse_error;
- /*
- * "increment across the feed direction" (optional, default 0)
- */
- if(!ParseUnspecifiedValue(*ptr_return, ptr_return))
- if(!ParseRealValue(*ptr_return, ptr_return,
- &mcs->increment_across_feed))
- goto MediumContinuousSizeParse_error;
- /*
- * "range in the feed direction"
- */
- if(!ParseRealRange(*ptr_return, ptr_return, &mcs->range_in_feed))
- goto MediumContinuousSizeParse_error;
- /*
- * "increment in the feed direction" (optional, default 0)
- */
- if(!ParseUnspecifiedValue(*ptr_return, ptr_return))
- if(!ParseRealValue(*ptr_return, ptr_return,
- &mcs->increment_in_feed))
- goto MediumContinuousSizeParse_error;
- /*
- * "long edge feeds" flag (default TRUE)
- */
- if(ParseUnspecifiedValue(*ptr_return, ptr_return))
- mcs->long_edge_feeds = xTrue;
- else
- if(!ParseBoolValue(*ptr_return, ptr_return, &mcs->long_edge_feeds))
- goto MediumContinuousSizeParse_error;
- /*
- * "generic assured reproduction area"
- */
- if(!ParseArea(*ptr_return, ptr_return, &mcs->assured_reproduction_area))
- goto MediumContinuousSizeParse_error;
- /*
- * parse out the MediumSize sequence end character
- */
- if(!ParseSeqEnd(*ptr_return, ptr_return))
- goto MediumContinuousSizeParse_error;
- /*
- * return
- */
- return mcs;
-
-
- MediumContinuousSizeParse_error:
- /*
- * syntax error - don't log since this function may be called
- * as a lookahead
- */
- *ptr_return = first_nonws_ptr;
- XpOidFree((char*)mcs);
- return NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: MediumContinuousSizeDelete
- *
- * Description:
- *
- * 'ptr_return' *cannot* be NULL.
- *
- *
- * Return value:
- *
- *
- *
- */
-static void
-MediumContinuousSizeDelete(XpOidMediumContinuousSize* me)
-{
- XpOidFree((char*)me);
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: MediumDiscreteSizeListParse
- *
- * Description:
- *
- * 'ptr_return' *cannot* be NULL.
- *
- * Return value:
- *
- *
- *
- */
-static XpOidMediumDiscreteSizeList*
-MediumDiscreteSizeListParse(const char* value_string,
- const XpOidList* valid_medium_sizes,
- const char** ptr_return,
- int i)
-{
- XpOidMediumDiscreteSizeList* list;
- XpOidMediumDiscreteSize mds;
- /*
- * check for the start of a new MediumSize sequence
- */
- if(ParseSeqStart(value_string, ptr_return))
- {
- /*
- * "page size"
- */
- mds.page_size = XpOidParse(*ptr_return, ptr_return);
- if((const XpOidList*)NULL != valid_medium_sizes
- &&
- !XpOidListHasOid(valid_medium_sizes, mds.page_size)
- )
- mds.page_size = xpoid_none;
- /*
- * "long edge feeds" flag (default TRUE)
- */
- if(ParseUnspecifiedValue(*ptr_return, ptr_return))
- mds.long_edge_feeds = xTrue;
- else
- if(!ParseBoolValue(*ptr_return, ptr_return,
- &mds.long_edge_feeds))
- {
- /*
- * syntax error
- */
- ErrorF("%s\nBoolean expected.\nunparsed data: %s\n",
- XPMSG_WARN_MSS, *ptr_return);
- return (XpOidMediumDiscreteSizeList*)NULL;
- }
- /*
- * "assured reproduction area"
- */
- if(!ParseArea(*ptr_return, ptr_return,
- &mds.assured_reproduction_area))
- {
- /*
- * syntax error
- */
- ErrorF("%s\nArea specification error.\nunparsed data: %s\n",
- XPMSG_WARN_MSS, *ptr_return);
- return (XpOidMediumDiscreteSizeList*)NULL;
- }
- /*
- * parse out the MediumSize sequence end character
- */
- if(!ParseSeqEnd(*ptr_return, ptr_return))
- {
- ErrorF("%s\nSequence End expected. Unparsed data: %s\n",
- XPMSG_WARN_MSS, *ptr_return);
- return (XpOidMediumDiscreteSizeList*)NULL;
- }
- /*
- * recurse to parse the next Discrete MediumSize sequence
- */
- if(mds.page_size == xpoid_none)
- {
- list = MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes,
- ptr_return, i);
- }
- else
- {
- list = MediumDiscreteSizeListParse(*ptr_return, valid_medium_sizes,
- ptr_return, i+1);
- if(list != (XpOidMediumDiscreteSizeList*)NULL)
- {
- /*
- * copy the current discrete MediumSize into the list
- */
- memmove((list->list)+i, &mds, sizeof(XpOidMediumDiscreteSize));
- }
- }
- }
- else
- {
- /*
- * MediumSize sequence start not found; end of the discrete sizes
- * list
- */
- if(0 == i)
- {
- ErrorF("%s\nNo valid medium sizes found for tray.\n",
- XPMSG_WARN_MSS);
- return (XpOidMediumDiscreteSizeList*)NULL;
- }
- list = (XpOidMediumDiscreteSizeList*)
- XpOidCalloc(1, sizeof(XpOidMediumDiscreteSizeList));
- list->count = i;
- list->list = (XpOidMediumDiscreteSize*)
- XpOidCalloc(i, sizeof(XpOidMediumDiscreteSize));
- }
- return list;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: MediumDiscreteSizeListDelete
- *
- * Description:
- *
- *
- *
- * Return value:
- *
- *
- *
- */
-static void
-MediumDiscreteSizeListDelete(XpOidMediumDiscreteSizeList* list)
-{
- if(list != (XpOidMediumDiscreteSizeList*)NULL)
- {
- XpOidFree((char*)list->list);
- XpOidFree((char*)list);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidTrayMediumListNew
- *
- * Description:
- *
- * Only need the valid trays; validation requires bumping up against
- * msss using TrayMediumListValidate; this needs valid trays
- * because of unspecified trays ion msss, but
- * TrayMediumListValidate will take care of invalid sizes...
- *
- * Return value:
- *
- *
- *
- */
-XpOidTrayMediumList*
-XpOidTrayMediumListNew(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidMediumSS* msss)
-{
- if(value_string == (const char*)NULL)
- return (XpOidTrayMediumList*)NULL;
- else
- {
- const char* ptr;
- XpOidTrayMediumList* me;
- me = TrayMediumListParse(value_string, valid_trays, &ptr, 0);
- if((XpOidTrayMediumList*)NULL != me)
- TrayMediumListValidate(me, msss);
- return me;
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidTrayMediumListDelete
- *
- * Description:
- *
- *
- *
- * Return value:
- *
- *
- *
- */
-void
-XpOidTrayMediumListDelete(XpOidTrayMediumList* list)
-{
- if(list != (XpOidTrayMediumList*)NULL)
- {
- XpOidFree((char*)list->list);
- XpOidFree((char*)list);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: TrayMediumListParse
- *
- * Description:
- *
- * 'ptr_return' *cannot* be NULL.
- *
- * Return value:
- *
- *
- *
- */
-static XpOidTrayMediumList*
-TrayMediumListParse(const char* value_string,
- const XpOidList* valid_trays,
- const char** ptr_return, int i)
-{
- XpOidTrayMedium tm;
- XpOidTrayMediumList* list;
- /*
- * check for the start of a new InputTrayMedium sequence
- */
- if(ParseSeqStart(value_string, ptr_return))
- {
- /*
- * "input tray"
- */
- tm.input_tray = XpOidParse(*ptr_return, ptr_return);
- if((XpOidList*)NULL != valid_trays
- &&
- !XpOidListHasOid(valid_trays, tm.input_tray)
- )
- tm.input_tray = xpoid_none;
- /*
- * "medium"
- */
- tm.medium = XpOidParse(*ptr_return, ptr_return);
- /*
- * parse out the InputTrayMedium sequence end character
- */
- if(!ParseSeqEnd(*ptr_return, ptr_return))
- {
- ErrorF("%s\n", XPMSG_WARN_ITM);
- return NULL;
- }
- /*
- * recurse to parse the next InputTrayMedium sequence
- */
- list = TrayMediumListParse(*ptr_return, valid_trays, ptr_return, i+1);
- if(list != (XpOidTrayMediumList*)NULL)
- {
- /*
- * copy the current InputTrayMedium into the list
- */
- memmove((list->list)+i, &tm, sizeof(XpOidTrayMedium));
- }
- }
- else
- {
- /*
- * InputTrayMedium sequence start not found
- */
- if(**ptr_return == '\0')
- {
- /*
- * end of the list
- */
- list = (XpOidTrayMediumList*)
- XpOidCalloc(1, sizeof(XpOidTrayMediumList));
- list->count = i;
- list->list = (XpOidTrayMedium*)
- XpOidCalloc(i, sizeof(XpOidTrayMedium));
- }
- else
- {
- /*
- * syntax error
- */
- ErrorF("%s\n", XPMSG_WARN_ITM);
- return NULL;
- }
- }
- /*
- * return
- */
- return list;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: TrayMediumListValidate
- *
- * Description:
- *
- * Validate the input-trays-medium list based on a passed
- * medium-source-sizes-supported structure. The validated
- * input-trays-medium list will have the same number of entries upon
- * return from this function. Invalid entries are indicated by
- * setting the tray specification to xpoid_none.
- *
- * Return value:
- *
- * None.
- *
- */
-static void
-TrayMediumListValidate(XpOidTrayMediumList* me,
- const XpOidMediumSS* msss)
-{
- int i_mss, i_ds, i_itm;
- XpOid current_tray, current_medium;
- XpOidMediumDiscreteSizeList* unspecified_tray_ds;
- XpOidMediumDiscreteSizeList* tray_ds;
-
- if(msss == (XpOidMediumSS*)NULL
- ||
- me == (XpOidTrayMediumList*)NULL)
- {
- return;
- }
- /*
- * loop through the input trays medium list
- */
- for(i_itm = 0; i_itm < XpOidTrayMediumListCount(me); i_itm++)
- {
- current_tray = XpOidTrayMediumListTray(me, i_itm);
- if(current_tray == xpoid_none)
- continue;
- current_medium = XpOidTrayMediumListMedium(me, i_itm);
- if(current_medium == xpoid_none)
- {
- /*
- * no medium; invalidate this entry
- */
- me->list[i_itm].input_tray = xpoid_none;
- continue;
- }
- /*
- * loop through the MediumSourceSizes, looking for an appropriate
- * discrete sizes spec for the current tray
- */
- unspecified_tray_ds = (XpOidMediumDiscreteSizeList*)NULL;
- tray_ds = (XpOidMediumDiscreteSizeList*)NULL;
- for(i_mss = 0;
- i_mss < msss->count &&
- tray_ds == (XpOidMediumDiscreteSizeList*)NULL;
- i_mss++)
- {
- switch((msss->mss)[i_mss].mstag)
- {
- case XpOidMediumSS_DISCRETE:
- if((msss->mss)[i_mss].input_tray == current_tray)
- tray_ds = (msss->mss)[i_mss].ms.discrete;
- else if((msss->mss)[i_mss].input_tray == xpoid_unspecified)
- unspecified_tray_ds = (msss->mss)[i_mss].ms.discrete;
- break;
-
- case XpOidMediumSS_CONTINUOUS:
- /*
- * unsupported
- */
- break;
- }
- }
- /*
- * if the tray was not matched, use the unspecified tray size
- * list
- */
- if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
- {
- if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
- {
- /*
- * not even an unspecified tray, invalidate this
- * input-trays-medium entry.
- */
- me->list[i_itm].input_tray = xpoid_none;
- continue;
- }
- else
- {
- tray_ds = unspecified_tray_ds;
- }
- }
- /*
- * loop through the discrete sizes list, looking for a size that
- * matches the medium for the current input tray
- */
- for(i_ds = 0; i_ds < tray_ds->count; i_ds++)
- {
- /*
- * check to see if the current input tray's medium size
- * matches the current discrete size
- *
- * Note: in the CDEnext SI, medium identifiers coincide with
- * medium-size identifiers. If the DP-Medium object is
- * ever implemented, this check would need to be
- * changed so that the input tray's medium size is
- * obtained from the indicated Medium object, and not
- * inferred from the medium identifier itself.
- */
- if((tray_ds->list)[i_ds].page_size == current_medium)
- {
- /*
- * The current input tray's medium size matches the
- * current discrete medium size.
- */
- break;
- }
- }
- if(i_ds == tray_ds->count)
- {
- /*
- * The current input tray's medium size was not found in the
- * discrete size list; mark the input tray medium entry
- * invalid
- */
- me->list[i_itm].input_tray = xpoid_none;
- }
-
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidTrayMediumListString
- *
- * Description:
- *
- * Creates a string representation of an XpOidTrayMediumList structure.
- *
- * Return value:
- *
- * A newly allocated
- *
- */
-char* XpOidTrayMediumListString(const XpOidTrayMediumList* me)
-{
- int i;
- int length;
- char* str;
- char* ptr;
- XpOid tray;
- /*
- * allocate enough memory for the string representation,
- * including intervening delimiters and whitespace
- */
- for(i = 0, length = 0; i < XpOidTrayMediumListCount(me); i++)
- {
- tray = XpOidTrayMediumListTray(me, i);
- if(xpoid_none != tray)
- {
- length += XpOidStringLength(tray);
- length += XpOidStringLength(XpOidTrayMediumListMedium(me, i));
- length += 4;
- }
- }
- str = XpOidMalloc(length+1);
- /*
- * format the list
- */
- for(i = 0, ptr = str; i < XpOidTrayMediumListCount(me); i++)
- {
- tray = XpOidTrayMediumListTray(me, i);
- if(xpoid_none != tray)
- {
-#if defined(sun) && !defined(SVR4)
- sprintf(ptr, "{%s %s} ",
- XpOidString(tray),
- XpOidString(XpOidTrayMediumListMedium(me, i)));
- ptr += strlen(ptr);
-#else
- ptr += sprintf(ptr, "{%s %s} ",
- XpOidString(tray),
- XpOidString(XpOidTrayMediumListMedium(me, i)));
-#endif
- }
- }
- /*
- * chop trailing whitespace or terminate empty string
- */
- str[length] = '\0';
- /*
- * return
- */
- return str;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidTrayMediumListHasTray
- *
- * Description:
- *
- * Determines if 'tray' is found in 'list'.
- *
- * Return value:
- *
- * xTrue if the tray is found in the list.
- *
- * xFalse if the tray is not in the list, or if 'list' is NULL.
- *
- */
-BOOL
-XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray)
-{
- int i;
- if(list != (XpOidTrayMediumList*)NULL && tray != xpoid_none)
- for(i = 0; i < list->count; i++)
- if(XpOidTrayMediumListTray(list, i) == tray)
- return xTrue;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseArea
- *
- * Description:
- *
- * Skips leading whitespace and parses out and returns a XpOidArea.
- *
- * Return value:
- *
- * xTrue if the XpOidArea was successfully parsed. ptr_return is
- * updated to point to location where the parsing ended.
- *
- * xFalse if a XpOidArea was not found; ptr_return is updated
- * to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseArea(const char* value_string,
- const char** ptr_return,
- XpOidArea* area_return)
-{
- const char* first_nonws_ptr;
- const char* ptr;
- /*
- * skip leading whitespace
- */
- first_nonws_ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out the area sequence start
- */
- if(!ParseSeqStart(first_nonws_ptr, &ptr))
- goto ParseArea_error;
- /*
- * parse the minimum x value
- */
- if(!ParseRealValue(ptr, &ptr,
- area_return ? &area_return->minimum_x : NULL))
- goto ParseArea_error;
- /*
- * parse the maximum x value
- */
- if(!ParseRealValue(ptr, &ptr,
- area_return ? &area_return->maximum_x : NULL))
- goto ParseArea_error;
- /*
- * parse the minimum y value
- */
- if(!ParseRealValue(ptr, &ptr,
- area_return ? &area_return->minimum_y : NULL))
- goto ParseArea_error;
- /*
- * parse the maximum y value
- */
- if(!ParseRealValue(ptr, &ptr,
- area_return ? &area_return->maximum_y : NULL))
- goto ParseArea_error;
- /*
- * parse out the area sequence end
- */
- if(!ParseSeqEnd(ptr, &ptr))
- goto ParseArea_error;
- /*
- * update the return pointer
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- /*
- * return
- */
- return xTrue;
-
-
- ParseArea_error:
- /*
- * syntax error
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = first_nonws_ptr;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseRealRange
- *
- * Description:
- *
- * Skips leading whitespace and parses out and returns a
- * XpOidRealRange.
- *
- * Return value:
- *
- * xTrue if the XpOidRealRange was successfully
- * parsed. ptr_return is updated to point to location where the
- * parsing ended.
- *
- * xFalse if a XpOidRealRange was not found; ptr_return is
- * updated to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseRealRange(const char* value_string,
- const char** ptr_return,
- XpOidRealRange* range_return)
-{
- const char* first_nonws_ptr;
- const char* ptr;
- /*
- * skip leading whitespace
- */
- first_nonws_ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out the range sequence start
- */
- if(!ParseSeqStart(first_nonws_ptr, &ptr))
- goto ParseRealRange_error;
- /*
- * parse the lower bound
- */
- if(!ParseRealValue(ptr, &ptr,
- range_return ? &range_return->lower_bound : NULL))
- goto ParseRealRange_error;
- /*
- * parse the upper bound
- */
- if(!ParseRealValue(ptr, &ptr,
- range_return ? &range_return->upper_bound : NULL))
- goto ParseRealRange_error;
- /*
- * parse out the range sequence end
- */
- if(!ParseSeqEnd(ptr, &ptr))
- goto ParseRealRange_error;
- /*
- * update the return pointer
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- /*
- * return
- */
- return xTrue;
-
-
- ParseRealRange_error:
- /*
- * syntax error
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = first_nonws_ptr;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidNotifyParse
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-XpOidNotify XpOidNotifyParse(const char* value_string)
-{
- const char* ptr = value_string;
-
- if(value_string == (const char*)NULL)
- return XPOID_NOTIFY_NONE;
- /*
- * look for an event handling profile sequence start
- */
- if(!ParseSeqStart(value_string, &ptr))
- {
- if('\0' == *ptr)
- /*
- * empty value is valid
- */
- return XPOID_NOTIFY_NONE;
- else
- return XPOID_NOTIFY_UNSUPPORTED;
- }
- /*
- * look for an event set sequence start
- */
- if(!ParseSeqStart(ptr, &ptr))
- {
- /*
- * check for an empty event handling profile
- */
- if(ParseSeqEnd(ptr, &ptr))
- {
- ptr += SpanWhitespace(ptr);
- if(*ptr == '\0')
- /*
- * valid empty event handling profile sequence
- */
- return XPOID_NOTIFY_NONE;
- }
- return XPOID_NOTIFY_UNSUPPORTED;
- }
- /*
- * the only event in the set should be report job completed
- */
- if(xpoid_val_event_report_job_completed != XpOidParse(ptr, &ptr))
- return XPOID_NOTIFY_UNSUPPORTED;
- /*
- * event set sequence end
- */
- if(!ParseSeqEnd(ptr, &ptr))
- return XPOID_NOTIFY_UNSUPPORTED;
- /*
- * delivery method of electronic mail
- */
- if(xpoid_val_delivery_method_electronic_mail != XpOidParse(ptr, &ptr))
- return XPOID_NOTIFY_UNSUPPORTED;
- /*
- * event handling profile sequence end
- */
- if(!ParseSeqEnd(ptr, &ptr))
- return XPOID_NOTIFY_UNSUPPORTED;
- /*
- * end of value
- */
- ptr += SpanWhitespace(ptr);
- if('\0' == *ptr)
- /*
- * valid supported notification profile
- */
- return XPOID_NOTIFY_EMAIL;
- else
- return XPOID_NOTIFY_UNSUPPORTED;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidNotifyString
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-const char* XpOidNotifyString(XpOidNotify notify)
-{
- switch(notify)
- {
- default:
- case XPOID_NOTIFY_UNSUPPORTED:
- return (const char*)NULL;
- case XPOID_NOTIFY_NONE:
- return NOTIFY_NONE_STR;
- case XPOID_NOTIFY_EMAIL:
- return NOTIFY_EMAIL_STR;
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtNew
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-XpOidDocFmt*
-XpOidDocFmtNew(const char* value_string)
-{
- XpOidDocFmt* doc_fmt;
- const char* ptr;
-
- if((const char*)NULL == value_string)
- return (XpOidDocFmt*)NULL;
- ptr = value_string + SpanWhitespace(value_string);
- if('\0' == *ptr)
- return (XpOidDocFmt*)NULL;
- /*
- * get the document format from the value string
- */
- doc_fmt = (XpOidDocFmt*)XpOidCalloc(1, sizeof(XpOidDocFmt));
- if(xTrue == XpOidDocFmtNext(doc_fmt, ptr, &ptr))
- {
- /*
- * verify that the document format is the only value specified
- */
- ptr += SpanWhitespace(ptr);
- if('\0' == *ptr)
- /*
- * valid document-format value
- */
- return doc_fmt;
- }
- /*
- * invalid
- */
- XpOidDocFmtDelete(doc_fmt);
- ErrorF("%s\n", XPMSG_WARN_DOC_FMT);
- return (XpOidDocFmt*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtDelete
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-void
-XpOidDocFmtDelete(XpOidDocFmt* doc_fmt)
-{
- if((XpOidDocFmt*)NULL != doc_fmt)
- {
- XpOidFree(doc_fmt->format);
- XpOidFree(doc_fmt->variant);
- XpOidFree(doc_fmt->version);
- XpOidFree(doc_fmt);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtString
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-char*
-XpOidDocFmtString(XpOidDocFmt* doc_fmt)
-{
- if((XpOidDocFmt*)NULL != doc_fmt)
- {
- if((char*)NULL != doc_fmt->format)
- {
- char* str = XpOidMalloc(1+SafeStrLen(doc_fmt->format)+
- 1+SafeStrLen(doc_fmt->variant)+
- 1+SafeStrLen(doc_fmt->version)+
- 1+1);
- sprintf(str, "{%s %s %s}", doc_fmt->format,
- (char*)NULL != doc_fmt->variant ? doc_fmt->variant : "",
- (char*)NULL != doc_fmt->version ? doc_fmt->version : "");
- return str;
- }
- }
- return (char*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtNext
- *
- * Description:
- *
- * Assumes non-NULL value string.
- *
- * Return value:
- *
- *
- */
-static BOOL
-XpOidDocFmtNext(XpOidDocFmt* doc_fmt,
- const char* value_string,
- const char** ptr_return)
-{
- const char* ptr;
- const char* first_nonws_ptr;
- const char* format;
- const char* variant;
- const char* version = 0;
- int format_len;
- int variant_len;
- int version_len;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- first_nonws_ptr = ptr;
- /*
- * sequence start
- */
- if(!ParseSeqStart(ptr, &ptr))
- goto XpOidDocFmtNext_error;
- /*
- * skip whitepace to the start of the document format, and save the
- * location
- */
- ptr += SpanWhitespace(ptr);
- format = ptr;
- /*
- * document format
- */
- if(0 == (format_len = SpanToken(ptr)))
- goto XpOidDocFmtNext_error;
- ptr += format_len;
- /*
- * optional variant
- */
- ptr += SpanWhitespace(ptr);
- variant = ptr;
- if(0 != (variant_len = SpanToken(ptr)))
- {
- ptr += variant_len;
- /*
- * optional version
- */
- ptr += SpanWhitespace(ptr);
- version = ptr;
- version_len = SpanToken(ptr);
- ptr += version_len;
- }
- else
- version_len = 0;
- /*
- * sequence end
- */
- if(!ParseSeqEnd(ptr, &ptr))
- goto XpOidDocFmtNext_error;
- /*
- * update return pointer
- */
- if((const char**)NULL != ptr_return)
- *ptr_return = ptr;
- /*
- * update the passed document format struct
- */
- memset(doc_fmt, 0, sizeof(XpOidDocFmt));
- doc_fmt->format = XpOidMalloc(format_len+1);
- strncpy(doc_fmt->format, format, format_len);
- doc_fmt->format[format_len] = '\0';
- if(0 < variant_len)
- {
- doc_fmt->variant = XpOidMalloc(variant_len+1);
- strncpy(doc_fmt->variant, variant, variant_len);
- doc_fmt->variant[variant_len] = '\0';
- if(0 < version_len)
- {
- doc_fmt->version = XpOidMalloc(version_len+1);
- strncpy(doc_fmt->version, version, version_len);
- doc_fmt->version[version_len] = '\0';
- }
- }
- return xTrue;
-
- XpOidDocFmtNext_error:
- if((const char**)NULL != ptr_return)
- *ptr_return = first_nonws_ptr;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtListNew
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-XpOidDocFmtList*
-XpOidDocFmtListNew(const char* value_string,
- const XpOidDocFmtList* valid_fmts)
-{
- if((char*)NULL != value_string)
- {
- const char* ptr;
- return XpOidDocFmtListParse(value_string, valid_fmts, &ptr, 0);
- }
- return (XpOidDocFmtList*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtListDelete
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-void
-XpOidDocFmtListDelete(XpOidDocFmtList* list)
-{
- if((XpOidDocFmtList*)NULL != list)
- {
- int i;
- for(i = 0; i < list->count; i++)
- {
- XpOidFree(list->list[i].format);
- XpOidFree(list->list[i].variant);
- XpOidFree(list->list[i].version);
- }
- XpOidFree(list->list);
- XpOidFree(list);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtListString
- *
- * Description:
- *
- * Assumes the passed structure is valid.
- *
- * Return value:
- *
- *
- */
-char*
-XpOidDocFmtListString(const XpOidDocFmtList* list)
-{
- if((XpOidDocFmtList*)NULL != list)
- {
- if(0 < list->count)
- {
- int i;
- int str_len;
- char* str;
- char* ptr;
- /*
- * allocate the return string
- */
- for(i = 0, str_len = 0; i < list->count; i++)
- {
- str_len +=
- 1 + SafeStrLen(list->list[i].format) +
- 1 + SafeStrLen(list->list[i].variant) +
- 1 + SafeStrLen(list->list[i].version) + 2;
- }
- str = XpOidMalloc(str_len+1);
- /*
- * print the list into the string and return it
- */
- ptr = str;
- for(i = 0; i < list->count; i++)
- {
- XpOidDocFmt* df = &list->list[i];
-
-#if defined(sun) && !defined(SVR4)
- sprintf(ptr, "{%s %s %s} ",
- df->format,
- (char*)NULL != df->variant ? df->variant : "",
- (char*)NULL != df->version ? df->version : "");
- ptr += strlen(ptr);
-#else
- ptr +=
- sprintf(ptr, "{%s %s %s} ",
- df->format,
- (char*)NULL != df->variant ? df->variant : "",
- (char*)NULL != df->version ? df->version : "");
-#endif
- }
- return str;
- }
- }
- return (char*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtListParse
- *
- * Description:
- *
- * Assumes the passed value_string and ptr_return are non-NULL.
- *
- * Return value:
- *
- *
- */
-static XpOidDocFmtList*
-XpOidDocFmtListParse(const char* value_string,
- const XpOidDocFmtList* valid_fmts,
- const char** ptr_return,
- int i)
-{
- XpOidDocFmt doc_fmt;
- XpOidDocFmtList* list;
- BOOL status;
- /*
- * get the next document-format from the value string, skipping
- * values not found in the passed list of valid formats
- */
- *ptr_return = value_string;
- while((status = XpOidDocFmtNext(&doc_fmt, *ptr_return, ptr_return))
- &&
- (const XpOidDocFmtList*)NULL != valid_fmts
- &&
- !XpOidDocFmtListHasFmt(valid_fmts, &doc_fmt)
- );
-
- if(xFalse == status)
- {
- if('\0' == **ptr_return)
- {
- if(0 == i)
- {
- /*
- * empty value string
- */
- return (XpOidDocFmtList*)NULL;
- }
- else
- {
- /*
- * done parsing; allocate the list and return
- */
- list =
- (XpOidDocFmtList*)XpOidCalloc(1, sizeof(XpOidDocFmtList));
- list->count = i;
- list->list = (XpOidDocFmt*)XpOidCalloc(i, sizeof(XpOidDocFmt));
- return list;
- }
- }
- else
- {
- /*
- * invalid document format
- */
- ErrorF("%s\n", XPMSG_WARN_DOCFMT_LIST);
- return (XpOidDocFmtList*)NULL;
- }
- }
- else
- {
- /*
- * recurse to parse remaining document formats
- */
- list = XpOidDocFmtListParse(*ptr_return, valid_fmts, ptr_return, i+1);
- if((XpOidDocFmtList*)NULL != list)
- {
- /*
- * add this doc fmt to the list
- */
- list->list[i].format = doc_fmt.format;
- list->list[i].variant = doc_fmt.variant;
- list->list[i].version = doc_fmt.version;
- }
- return list;
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidDocFmtListHasFmt
- *
- * Description:
- *
- * Assumes the passed structure is valid.
- *
- * Return value:
- *
- *
- */
-BOOL
-XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
- const XpOidDocFmt* fmt)
-{
- int i;
- if(list != (XpOidDocFmtList*)NULL
- &&
- fmt != (XpOidDocFmt*)NULL
- &&
- fmt->format != (char*)NULL
- )
- {
- for(i = 0; i < list->count; i++)
- {
- /*
- * formats must match
- */
- if(strcmp(fmt->format, list->list[i].format) != 0)
- continue;
- /*
- * variants must both be NULL or match
- */
- if(fmt->variant == (char*)NULL)
- {
- if(list->list[i].variant == (char*)NULL)
- return xTrue;
- else
- continue;
- }
- if(list->list[i].variant == (char*)NULL)
- continue;
- if(strcmp(fmt->variant, list->list[i].variant) != 0)
- continue;
- /*
- * versions must both be NULL or match
- */
- if(fmt->version == (char*)NULL)
- {
- if(list->list[i].version == (char*)NULL)
- return xTrue;
- else
- continue;
- }
- if(list->list[i].version == (char*)NULL)
- continue;
- if(strcmp(fmt->version, list->list[i].version) == 0)
- return xTrue;
- }
- }
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidCardListNew
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-XpOidCardList*
-XpOidCardListNew(const char* value_string, const XpOidCardList* valid_cards)
-{
- if((const char*)NULL != value_string)
- {
- const char* ptr;
-
- return XpOidCardListParse(value_string, valid_cards, &ptr, 0);
- }
- else
- return (XpOidCardList*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidCardListDelete
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-void
-XpOidCardListDelete(XpOidCardList* list)
-{
- if((XpOidCardList*)NULL != list)
- {
- XpOidFree(list->list);
- XpOidFree(list);
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidCardListString
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-char*
-XpOidCardListString(const XpOidCardList* list)
-{
- if((XpOidCardList*)NULL != list)
- {
- char buf[48];
- int str_len;
- char* str;
- int i;
- char* ptr;
- /*
- * allocate the output string
- */
- for(i = 0, str_len = 0; i < list->count; i++)
-#if defined(sun) && !defined(SVR4)
- {
- sprintf(buf, "%lu", list->list[i]) + 1;
- str_len += strlen(buf);
- }
-#else
- str_len += sprintf(buf, "%lu", list->list[i]) + 1;
-#endif
- str = XpOidMalloc(str_len+1);
- /*
- * write the list to the string
- */
- for(i = 0, ptr = str; i < list->count; i++)
-#if defined(sun) && !defined(SVR4)
- {
- sprintf(ptr, "%lu ", list->list[i]);
- ptr += strlen(ptr);
- }
-#else
- ptr += sprintf(ptr, "%lu ", list->list[i]);
-#endif
- return str;
- }
- else
- return (char*)NULL;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidCardListHasCard
- *
- * Description:
- *
- * Determines if 'card' is an element of 'list'.
- *
- * Return value:
- *
- * xTrue if the card is found in the list.
- *
- * xFalse if the card is not in the list, or if 'list' is NULL.
- *
- */
-BOOL
-XpOidCardListHasCard(const XpOidCardList* list, unsigned long card)
-{
- int i;
- if(list != (XpOidCardList*)NULL)
- for(i = 0; i < list->count; i++)
- if(list->list[i] == card)
- return xTrue;
- return xFalse;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidCardListParse
- *
- * Description:
- *
- * Assumes the passed value_string and ptr_return are non-NULL.
- *
- * Return value:
- *
- *
- */
-static XpOidCardList*
-XpOidCardListParse(const char* value_string,
- const XpOidCardList* valid_cards,
- const char** ptr_return,
- int i)
-{
- unsigned long card;
- XpOidCardList* list;
- BOOL status;
-
- /*
- * get the next card from the value string, skipping values not
- * found in the passed list of valid cards
- */
- *ptr_return = value_string;
- while((status = XpOidParseUnsignedValue(*ptr_return, ptr_return, &card))
- &&
- (const XpOidCardList*)NULL != valid_cards
- &&
- !XpOidCardListHasCard(valid_cards, card)
- );
-
- if(xFalse == status)
- {
- if('\0' == **ptr_return)
- {
- if(0 == i)
- {
- /*
- * empty value string
- */
- return (XpOidCardList*)NULL;
- }
- else
- {
- /*
- * done parsing; allocate the list and return
- */
- list = (XpOidCardList*)XpOidCalloc(1, sizeof(XpOidCardList));
- list->count = i;
- list->list =
- (unsigned long*)XpOidCalloc(i, sizeof(unsigned long));
- return list;
- }
- }
- else
- {
- /*
- * parsing error
- */
- ErrorF("%s\n", XPMSG_WARN_CARD_LIST);
- return (XpOidCardList*)NULL;
- }
- }
- else
- {
- /*
- * recurse to parse remaining cardinal values
- */
- list = XpOidCardListParse(*ptr_return, valid_cards, ptr_return, i+1);
- if((XpOidCardList*)NULL != list)
- {
- /*
- * add this value to the list
- */
- list->list[i] = card;
- }
- return list;
- }
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseBoolValue
- *
- * Description:
- *
- *
- * Return value:
- *
- *
- */
-static BOOL
-ParseBoolValue(const char* value_string,
- const char** ptr_return,
- BOOL* bool_return)
-{
- const char* ptr;
- int length;
- BOOL status;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- /*
- * get the whitespace-delimited token length
- */
- length = SpanToken(ptr);
- /*
- * determine if true or false or bad
- */
- if(StrnCaseCmp(ptr, "TRUE", length) == 0)
- {
- if(bool_return != (BOOL*)NULL)
- *bool_return = xTrue;
- status = xTrue;
- }
- else if(StrnCaseCmp(ptr, "FALSE", length) == 0)
- {
- if(bool_return != (BOOL*)NULL)
- *bool_return = xFalse;
- status = xTrue;
- }
- else
- {
- /*
- * syntax error
- */
- status = xFalse;
- }
- /*
- * update the return pointer and return
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = status ? ptr+length : ptr;
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: XpOidParseUnsignedValue
- *
- * Description:
- *
- * Skips leading whitespace and parses out and returns a unsigned number.
- *
- * Return value:
- *
- * xTrue if a unsigned number was successfully parsed. ptr_return is
- * updated to point to location where the unsigned number parsing
- * ended.
- *
- * xFalse if a unsigned number was not found; ptr_return is updated
- * to point to the first non-whitespace char in value_string.
- *
- */
-BOOL
-XpOidParseUnsignedValue(const char* value_string,
- const char** ptr_return,
- unsigned long* unsigned_return)
-{
- long value;
- BOOL status;
- const char* first_nonws_ptr;
- const char* ptr;
- /*
- * skip leading whitespace
- */
- first_nonws_ptr = value_string + SpanWhitespace(value_string);
- value = strtol(first_nonws_ptr, (char**)(&ptr), 0);
- if(ptr == first_nonws_ptr || value < 0)
- status = xFalse;
- else
- status = xTrue;
- /*
- * update return parms
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- if(unsigned_return != (unsigned long*)NULL)
- *unsigned_return = (unsigned long)value;
- /*
- * return
- */
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseRealValue
- *
- * Description:
- *
- * Skips leading whitespace and parses out and returns a real number.
- *
- * Return value:
- *
- * xTrue if a real number was successfully parsed. ptr_return is
- * updated to point to location where the real number parsing
- * ended.
- *
- * xFalse if a real number was not found; ptr_return is updated
- * to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseRealValue(const char* value_string,
- const char** ptr_return,
- float* real_return)
-{
- float real_value;
- BOOL status;
- const char* first_nonws_ptr;
- const char* ptr;
- /*
- * skip leading whitespace
- */
- first_nonws_ptr = value_string + SpanWhitespace(value_string);
- real_value = (float)strtod(first_nonws_ptr, (char**)(&ptr));
- if(ptr == first_nonws_ptr)
- status = xFalse;
- else
- status = xTrue;
- /*
- * update return parms
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- if(real_return != (float*)NULL)
- *real_return = real_value;
- /*
- * return
- */
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseSeqEnd
- *
- * Description:
- *
- * Description:
- *
- * Skips leading whitespace and parses out the sequence end
- * character '}'.
- *
- * Return value:
- *
- * xTrue if the sequence end character was parsed; ptr_return is
- * updated to point to the first char following the sequence end
- * character.
- *
- * xFalse if the sequence end character was not found; ptr_return is
- * updated to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseSeqEnd(const char* value_string,
- const char** ptr_return)
-{
- const char* ptr;
- BOOL status;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out the sequence end character
- */
- if(*ptr == '}')
- {
- status = xTrue;
- ++ptr;
- }
- else
- status = xFalse;
- /*
- * update the return pointer
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- /*
- * return
- */
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseSeqStart
- *
- * Description:
- *
- * Skips leading whitespace and parses out the sequence start
- * character '{'.
- *
- * Return value:
- *
- * xTrue if the sequence start character was parsed; ptr_return is
- * updated to point to the first char following the sequence start
- * character.
- *
- * xFalse if the sequence start character was not found; ptr_return is
- * updated to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseSeqStart(const char* value_string,
- const char** ptr_return)
-{
- const char* ptr;
- BOOL status;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out the sequence start character
- */
- if(*ptr == '{')
- {
- status = xTrue;
- ++ptr;
- }
- else
- status = xFalse;
- /*
- * update the return pointer
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- /*
- * return
- */
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: ParseUnspecifiedValue
- *
- * Description:
- *
- * Skips leading whitespace and parses out an unspecified optional
- * value (i.e. matching '' or "" - skips all data between the set of
- * quotes).
- *
- * Return value:
- *
- * xTrue if an unspecified value was parsed; ptr_return is updated to
- * point to the first char following the trailing quote.
- *
- * xFalse if an unspecified value was not found; ptr_return is updated
- * to point to the first non-whitespace char in value_string.
- *
- */
-static BOOL
-ParseUnspecifiedValue(const char* value_string,
- const char** ptr_return)
-{
- BOOL status;
- const char* ptr;
- /*
- * skip leading whitespace
- */
- ptr = value_string + SpanWhitespace(value_string);
- /*
- * parse out an unspecified optional value ('' or "")
- */
- if(*ptr == '\'' || *ptr == '"')
- {
- char delim[2];
-
- if(ptr_return != (const char**)NULL)
- {
- delim[0] = *ptr;
- delim[1] = '\0';
- /*
- * skip over the matching delimiter
- */
- ++ptr;
- ptr += strcspn(ptr, delim);
- if(*ptr != '\0')
- ++ptr;
- }
- status = xTrue;
- }
- else
- status = xFalse;
- /*
- * update the return pointer
- */
- if(ptr_return != (const char**)NULL)
- *ptr_return = ptr;
- /*
- * return
- */
- return status;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: SpanToken
- *
- * Description:
- *
- * Returns the length of the initial segment of the passed string
- * that consists entirely of non-whitespace and non-sequence
- * delimiter characters.
- *
- *
- */
-static int
-SpanToken(const char* string)
-{
- const char* ptr;
- for(ptr = string;
- *ptr != '\0' && !isspace(*ptr) && *ptr != '{' && *ptr != '}';
- ++ptr);
- return ptr - string;
-}
-
-/*
- * ------------------------------------------------------------------------
- * Name: SpanWhitespace
- *
- * Description:
- *
- * Returns the length of the initial segment of the passed string
- * that consists entirely of whitespace characters.
- *
- *
- */
-static int
-SpanWhitespace(const char* string)
-{
- const char* ptr;
- for(ptr = string; *ptr != '\0' && isspace(*ptr); ++ptr);
- return ptr - string;
-}
-
-#ifndef HAVE_STRCASECMP
-/*
- * ------------------------------------------------------------------------
- * Name: StrnCaseCmp
- *
- * Description:
- *
- * Implements strncasecmp() for those platforms that need it.
- *
- *
- */
-static int
-StrnCaseCmp(const char *s1, const char *s2, size_t len)
-{
- char c1, c2;
- int result;
-
- while (len--)
- {
- c1 = *s1++;
- c2 = *s2++;
- result = tolower(c1) - tolower(c2);
-
- if (result != 0)
- return result;
- }
-
- return 0;
-}
-#endif
diff --git a/Xprint/Oid.h b/Xprint/Oid.h
deleted file mode 100644
index c5574b06e..000000000
--- a/Xprint/Oid.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* $Xorg: Oid.h,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/Oid.h,v 1.4 2001/01/17 22:36:28 dawes Exp $ */
-
-#ifndef _Xp_Oid_h
-#define _Xp_Oid_h
-
-#include <Xproto.h>
-
-/*
- * include the auto-generated XpOid enum definition
- */
-#include "OidDefs.h"
-
-/*
- * messages
- */
-#define XPMSG_WARN_MSS "Syntax error parsing medium-source-sizes"
-#define XPMSG_WARN_ITM "Syntax error parsing input-trays-medium"
-#define XPMSG_WARN_DOC_FMT "Syntax error parsing document format"
-#define XPMSG_WARN_DOCFMT_LIST "Syntax error parsing document format list"
-#define XPMSG_WARN_CARD_LIST "Syntax error parsing cardinal list"
-
-/*
- * macros for memory allocation
- */
-#define XpOidMalloc(size) ((char*)Xalloc((unsigned long)(size)))
-#define XpOidCalloc(count, size) \
- ((char*)Xcalloc((unsigned long)((count)*(size))))
-#define XpOidFree(mem) (Xfree((unsigned long*)(mem)))
-
-/*
- * list of object identifiers
- */
-typedef struct _XpOidList
-{
- XpOid* list;
- int count;
-} XpOidList;
-
-/*
- * linked list of object identifiers
- */
-typedef struct XpOidNodeStruct
-{
- XpOid oid;
- struct XpOidNodeStruct* next;
-} *XpOidNode;
-
-typedef struct _XpOidLinkedList
-{
- XpOidNode head;
- XpOidNode tail;
- XpOidNode current;
- int count;
-} XpOidLinkedList;
-
-/*
- * XpOidMediumSourceSize and related definitions
- */
-typedef struct
-{
- float minimum_x;
- float maximum_x;
- float minimum_y;
- float maximum_y;
-} XpOidArea;
-
-typedef struct
-{
- float lower_bound;
- float upper_bound;
-} XpOidRealRange;
-
-typedef struct
-{
- XpOidRealRange range_across_feed;
- float increment_across_feed;
- XpOidRealRange range_in_feed;
- float increment_in_feed;
- BOOL long_edge_feeds;
- XpOidArea assured_reproduction_area;
-} XpOidMediumContinuousSize;
-
-typedef struct
-{
- XpOid page_size;
- BOOL long_edge_feeds;
- XpOidArea assured_reproduction_area;
-} XpOidMediumDiscreteSize;
-
-typedef struct
-{
- XpOidMediumDiscreteSize* list;
- int count;
-} XpOidMediumDiscreteSizeList;
-
-typedef struct
-{
- XpOid input_tray; /* may be set to xpoid_none or xpoid_unspecified */
- enum { XpOidMediumSS_DISCRETE, XpOidMediumSS_CONTINUOUS } mstag;
- union
- {
- XpOidMediumDiscreteSizeList* discrete;
- XpOidMediumContinuousSize* continuous_size;
- } ms; /* "ms" is short for medium-size */
-
-} XpOidMediumSourceSize;
-
-typedef struct
-{
- XpOidMediumSourceSize* mss;
- int count;
-} XpOidMediumSS;
-
-
-typedef struct
-{
- XpOid input_tray; /* may be set to xpoid_none */
- XpOid medium;
-} XpOidTrayMedium;
-
-typedef struct
-{
- XpOidTrayMedium* list;
- int count;
-} XpOidTrayMediumList;
-
-typedef enum {
- XPOID_NOTIFY_UNSUPPORTED,
- XPOID_NOTIFY_NONE,
- XPOID_NOTIFY_EMAIL
-} XpOidNotify;
-
-typedef struct
-{
- unsigned long *list;
- int count;
-} XpOidCardList;
-
-typedef struct
-{
- char* format;
- char* variant;
- char* version;
-} XpOidDocFmt;
-
-typedef struct
-{
- XpOidDocFmt* list;
- int count;
-} XpOidDocFmtList;
-
-
-/*
- * XpOid public methods
- */
-const char* XpOidString(XpOid);
-int XpOidStringLength(XpOid);
-XpOid XpOidFromString(const char* value);
-
-/*
- * XpOidList public methods
- */
-XpOidList* XpOidListNew(const char* value_string,
- const XpOidList* valid_oids);
-#define XpOidListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
-void XpOidListDelete(XpOidList*);
-#define XpOidListCount(l) ((l) ? (l)->count : 0)
-#define XpOidListGetOid(l, i) ((l) ? (l)->list[(i)] : xpoid_none)
-int XpOidListGetIndex(const XpOidList* list, XpOid oid);
-BOOL XpOidListHasOid(const XpOidList* list, XpOid oid);
-char* XpOidListString(const XpOidList*);
-
-
-/*
- * XpOidLinkedList public methods
- */
-XpOidLinkedList* XpOidLinkedListNew(void);
-void XpOidLinkedListDelete(XpOidLinkedList*);
-#define XpOidLinkedListCount(l) ((l) ? (l)->count : 0)
-XpOid XpOidLinkedListGetOid(XpOidLinkedList* list, int i);
-void XpOidLinkedListAddOid(XpOidLinkedList* list, XpOid oid);
-int XpOidLinkedListGetIndex(XpOidLinkedList* list, XpOid oid);
-BOOL XpOidLinkedListHasOid(XpOidLinkedList* list,
- XpOid oid);
-XpOid XpOidLinkedListFirstOid(XpOidLinkedList* list);
-XpOid XpOidLinkedListNextOid(XpOidLinkedList* list);
-
-/*
- * XpOidMediumSourceSize public methods
- */
-XpOidMediumSS* XpOidMediumSSNew(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidList* valid_medium_sizes);
-void XpOidMediumSSDelete(XpOidMediumSS*);
-#define XpOidMediumSSCount(me) ((me) ? (me)->count : 0)
-BOOL XpOidMediumSSHasSize(XpOidMediumSS*, XpOid medium_size);
-char* XpOidMediumSSString(const XpOidMediumSS*);
-
-/*
- * XpOidTrayMediumList public methods
- */
-XpOidTrayMediumList* XpOidTrayMediumListNew(const char* value_string,
- const XpOidList* valid_trays,
- const XpOidMediumSS* msss);
-void XpOidTrayMediumListDelete(XpOidTrayMediumList* me);
-#define XpOidTrayMediumListCount(me) ((me) ? (me)->count : 0)
-#define XpOidTrayMediumListTray(me, i) \
- ((me) ? (me)->list[(i)].input_tray : xpoid_none)
-#define XpOidTrayMediumListMedium(me, i) \
- ((me) ? (me)->list[(i)].medium : xpoid_none)
-char* XpOidTrayMediumListString(const XpOidTrayMediumList*);
-
-/*
- * XpOidNotify public methods
- */
-XpOidNotify XpOidNotifyParse(const char* value_string);
-const char* XpOidNotifyString(XpOidNotify notify);
-
-/*
- * XpOidDocFmt public methods
- */
-XpOidDocFmt* XpOidDocFmtNew(const char* value_string);
-void XpOidDocFmtDelete(XpOidDocFmt*);
-char* XpOidDocFmtString(XpOidDocFmt*);
-
-/*
- * XpOidDocFmtList public methods
- */
-XpOidDocFmtList* XpOidDocFmtListNew(const char* value_string,
- const XpOidDocFmtList* valid_fmts);
-void XpOidDocFmtListDelete(XpOidDocFmtList*);
-char* XpOidDocFmtListString(const XpOidDocFmtList*);
-#define XpOidDocFmtListCount(me) ((me) ? (me)->count : 0)
-#define XpOidDocFmtListGetDocFmt(me, i) \
- ((me) ? &(me)->list[(i)] : (XpDocFmt*)NULL)
-BOOL XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
- const XpOidDocFmt* fmt);
-/*
- * XpOidCardList public methods
- */
-XpOidCardList* XpOidCardListNew(const char* value_string,
- const XpOidCardList* valid_cards);
-#define XpOidCardListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
-void XpOidCardListDelete(XpOidCardList*);
-char* XpOidCardListString(const XpOidCardList*);
-#define XpOidCardListCount(me) ((me) ? (me)->count : 0)
-#define XpOidCardListGetCard(me, i) ((me) ? (me)->list[(i)] : 0)
-BOOL XpOidCardListHasCard(const XpOidCardList*, unsigned long);
-
-/*
- * misc parsing functions
- */
-BOOL XpOidParseUnsignedValue(const char* value_string,
- const char** ptr_return,
- unsigned long* unsigned_return);
-
-
-#endif /* _Xp_Oid_h - don't add anything after this line */
diff --git a/Xprint/OidDefs.h b/Xprint/OidDefs.h
deleted file mode 100644
index 03e530cb2..000000000
--- a/Xprint/OidDefs.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* $Xorg: OidDefs.h,v 1.4 2001/03/14 18:45:13 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* This is an automatically-generated file. Do not edit. */
-
-typedef enum {
- xpoid_none,
- xpoid_unspecified,
- xpoid_att_descriptor,
- xpoid_att_content_orientation,
- xpoid_att_copy_count,
- xpoid_att_default_printer_resolution,
- xpoid_att_default_input_tray,
- xpoid_att_default_medium,
- xpoid_att_document_format,
- xpoid_att_plex,
- xpoid_att_xp_listfonts_modes,
- xpoid_att_job_name,
- xpoid_att_job_owner,
- xpoid_att_notification_profile,
- xpoid_att_xp_setup_state,
- xpoid_att_xp_spooler_command_options,
- xpoid_att_content_orientations_supported,
- xpoid_att_document_formats_supported,
- xpoid_att_dt_pdm_command,
- xpoid_att_input_trays_medium,
- xpoid_att_medium_source_sizes_supported,
- xpoid_att_plexes_supported,
- xpoid_att_printer_model,
- xpoid_att_printer_name,
- xpoid_att_printer_resolutions_supported,
- xpoid_att_xp_embedded_formats_supported,
- xpoid_att_xp_listfonts_modes_supported,
- xpoid_att_xp_page_attributes_supported,
- xpoid_att_xp_raw_formats_supported,
- xpoid_att_xp_setup_proviso,
- xpoid_att_document_attributes_supported,
- xpoid_att_job_attributes_supported,
- xpoid_att_locale,
- xpoid_att_multiple_documents_supported,
- xpoid_att_available_compression,
- xpoid_att_available_compressions_supported,
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape,
- xpoid_val_content_orientation_reverse_portrait,
- xpoid_val_content_orientation_reverse_landscape,
- xpoid_val_medium_size_iso_a0,
- xpoid_val_medium_size_iso_a1,
- xpoid_val_medium_size_iso_a2,
- xpoid_val_medium_size_iso_a3,
- xpoid_val_medium_size_iso_a4,
- xpoid_val_medium_size_iso_a5,
- xpoid_val_medium_size_iso_a6,
- xpoid_val_medium_size_iso_a7,
- xpoid_val_medium_size_iso_a8,
- xpoid_val_medium_size_iso_a9,
- xpoid_val_medium_size_iso_a10,
- xpoid_val_medium_size_iso_b0,
- xpoid_val_medium_size_iso_b1,
- xpoid_val_medium_size_iso_b2,
- xpoid_val_medium_size_iso_b3,
- xpoid_val_medium_size_iso_b4,
- xpoid_val_medium_size_iso_b5,
- xpoid_val_medium_size_iso_b6,
- xpoid_val_medium_size_iso_b7,
- xpoid_val_medium_size_iso_b8,
- xpoid_val_medium_size_iso_b9,
- xpoid_val_medium_size_iso_b10,
- xpoid_val_medium_size_na_letter,
- xpoid_val_medium_size_na_legal,
- xpoid_val_medium_size_executive,
- xpoid_val_medium_size_folio,
- xpoid_val_medium_size_invoice,
- xpoid_val_medium_size_ledger,
- xpoid_val_medium_size_quarto,
- xpoid_val_medium_size_iso_c3,
- xpoid_val_medium_size_iso_c4,
- xpoid_val_medium_size_iso_c5,
- xpoid_val_medium_size_iso_c6,
- xpoid_val_medium_size_iso_designated_long,
- xpoid_val_medium_size_na_10x13_envelope,
- xpoid_val_medium_size_na_9x12_envelope,
- xpoid_val_medium_size_na_number_10_envelope,
- xpoid_val_medium_size_na_7x9_envelope,
- xpoid_val_medium_size_na_9x11_envelope,
- xpoid_val_medium_size_na_10x14_envelope,
- xpoid_val_medium_size_na_number_9_envelope,
- xpoid_val_medium_size_na_6x9_envelope,
- xpoid_val_medium_size_na_10x15_envelope,
- xpoid_val_medium_size_monarch_envelope,
- xpoid_val_medium_size_a,
- xpoid_val_medium_size_b,
- xpoid_val_medium_size_c,
- xpoid_val_medium_size_d,
- xpoid_val_medium_size_e,
- xpoid_val_medium_size_jis_b0,
- xpoid_val_medium_size_jis_b1,
- xpoid_val_medium_size_jis_b2,
- xpoid_val_medium_size_jis_b3,
- xpoid_val_medium_size_jis_b4,
- xpoid_val_medium_size_jis_b5,
- xpoid_val_medium_size_jis_b6,
- xpoid_val_medium_size_jis_b7,
- xpoid_val_medium_size_jis_b8,
- xpoid_val_medium_size_jis_b9,
- xpoid_val_medium_size_jis_b10,
- xpoid_val_plex_simplex,
- xpoid_val_plex_duplex,
- xpoid_val_plex_tumble,
- xpoid_val_input_tray_top,
- xpoid_val_input_tray_middle,
- xpoid_val_input_tray_bottom,
- xpoid_val_input_tray_envelope,
- xpoid_val_input_tray_manual,
- xpoid_val_input_tray_large_capacity,
- xpoid_val_input_tray_main,
- xpoid_val_input_tray_side,
- xpoid_val_event_report_job_completed,
- xpoid_val_delivery_method_electronic_mail,
- xpoid_val_xp_setup_mandatory,
- xpoid_val_xp_setup_optional,
- xpoid_val_xp_setup_ok,
- xpoid_val_xp_setup_incomplete,
- xpoid_val_xp_list_glyph_fonts,
- xpoid_val_xp_list_internal_printer_fonts,
- xpoid_val_available_compressions_0,
- xpoid_val_available_compressions_01,
- xpoid_val_available_compressions_02,
- xpoid_val_available_compressions_03,
- xpoid_val_available_compressions_012,
- xpoid_val_available_compressions_013,
- xpoid_val_available_compressions_023,
- xpoid_val_available_compressions_0123
-} XpOid;
diff --git a/Xprint/OidStrs.h b/Xprint/OidStrs.h
deleted file mode 100644
index 3aab300dc..000000000
--- a/Xprint/OidStrs.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* $Xorg: OidStrs.h,v 1.4 2001/03/14 18:45:40 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/OidStrs.h,v 1.5 2001/12/21 21:02:05 dawes Exp $ */
-
-static int XpOidStringMapCount = 127;
-
-#define OIDATA(name) { name, sizeof(name)-1, 0, 0, 0 }
-
-static const XpOidStringMapEntry XpOidStringMap[] = {
- OIDATA(""),
- OIDATA(""),
- OIDATA("descriptor"),
- OIDATA("content-orientation"),
- OIDATA("copy-count"),
- OIDATA("default-printer-resolution"),
- OIDATA("default-input-tray"),
- OIDATA("default-medium"),
- OIDATA("document-format"),
- OIDATA("plex"),
- OIDATA("xp-listfonts-modes"),
- OIDATA("job-name"),
- OIDATA("job-owner"),
- OIDATA("notification-profile"),
- OIDATA("xp-setup-state"),
- OIDATA("xp-spooler-command-options"),
- OIDATA("content-orientations-supported"),
- OIDATA("document-formats-supported"),
- OIDATA("dt-pdm-command"),
- OIDATA("input-trays-medium"),
- OIDATA("medium-source-sizes-supported"),
- OIDATA("plexes-supported"),
- OIDATA("printer-model"),
- OIDATA("printer-name"),
- OIDATA("printer-resolutions-supported"),
- OIDATA("xp-embedded-formats-supported"),
- OIDATA("xp-listfonts-modes-supported"),
- OIDATA("xp-page-attributes-supported"),
- OIDATA("xp-raw-formats-supported"),
- OIDATA("xp-setup-proviso"),
- OIDATA("document-attributes-supported"),
- OIDATA("job-attributes-supported"),
- OIDATA("locale"),
- OIDATA("multiple-documents-supported"),
- OIDATA("available-compression"),
- OIDATA("available-compressions-supported"),
- OIDATA("portrait"),
- OIDATA("landscape"),
- OIDATA("reverse-portrait"),
- OIDATA("reverse-landscape"),
- OIDATA("iso-a0"),
- OIDATA("iso-a1"),
- OIDATA("iso-a2"),
- OIDATA("iso-a3"),
- OIDATA("iso-a4"),
- OIDATA("iso-a5"),
- OIDATA("iso-a6"),
- OIDATA("iso-a7"),
- OIDATA("iso-a8"),
- OIDATA("iso-a9"),
- OIDATA("iso-a10"),
- OIDATA("iso-b0"),
- OIDATA("iso-b1"),
- OIDATA("iso-b2"),
- OIDATA("iso-b3"),
- OIDATA("iso-b4"),
- OIDATA("iso-b5"),
- OIDATA("iso-b6"),
- OIDATA("iso-b7"),
- OIDATA("iso-b8"),
- OIDATA("iso-b9"),
- OIDATA("iso-b10"),
- OIDATA("na-letter"),
- OIDATA("na-legal"),
- OIDATA("executive"),
- OIDATA("folio"),
- OIDATA("invoice"),
- OIDATA("ledger"),
- OIDATA("quarto"),
- OIDATA("iso-c3"),
- OIDATA("iso-c4"),
- OIDATA("iso-c5"),
- OIDATA("iso-c6"),
- OIDATA("iso-designated-long"),
- OIDATA("na-10x13-envelope"),
- OIDATA("na-9x12-envelope"),
- OIDATA("na-number-10-envelope"),
- OIDATA("na-7x9-envelope"),
- OIDATA("na-9x11-envelope"),
- OIDATA("na-10x14-envelope"),
- OIDATA("na-number-9-envelope"),
- OIDATA("na-6x9-envelope"),
- OIDATA("na-10x15-envelope"),
- OIDATA("monarch-envelope"),
- OIDATA("a"),
- OIDATA("b"),
- OIDATA("c"),
- OIDATA("d"),
- OIDATA("e"),
- OIDATA("jis-b0"),
- OIDATA("jis-b1"),
- OIDATA("jis-b2"),
- OIDATA("jis-b3"),
- OIDATA("jis-b4"),
- OIDATA("jis-b5"),
- OIDATA("jis-b6"),
- OIDATA("jis-b7"),
- OIDATA("jis-b8"),
- OIDATA("jis-b9"),
- OIDATA("jis-b10"),
- OIDATA("simplex"),
- OIDATA("duplex"),
- OIDATA("tumble"),
- OIDATA("top"),
- OIDATA("middle"),
- OIDATA("bottom"),
- OIDATA("envelope"),
- OIDATA("manual"),
- OIDATA("large-capacity"),
- OIDATA("main"),
- OIDATA("side"),
- OIDATA("event-report-job-completed"),
- OIDATA("electronic-mail"),
- OIDATA("xp-setup-mandatory"),
- OIDATA("xp-setup-optional"),
- OIDATA("xp-setup-ok"),
- OIDATA("xp-setup-incomplete"),
- OIDATA("xp-list-glyph-fonts"),
- OIDATA("xp-list-internal-printer-fonts"),
- OIDATA("0"),
- OIDATA("01"),
- OIDATA("02"),
- OIDATA("03"),
- OIDATA("012"),
- OIDATA("013"),
- OIDATA("023"),
- OIDATA("0123")
-};
-
-#undef OIDATA
diff --git a/Xprint/Util.c b/Xprint/Util.c
deleted file mode 100644
index 9e0bdf925..000000000
--- a/Xprint/Util.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* $Xorg: Util.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/Util.c,v 1.13 2001/10/31 22:50:28 tsi Exp $ */
-
-/* To get the tempnam() prototype in <stdio.h> */
-#if defined(linux) && defined(__STRICT_ANSI__)
-#undef __STRICT_ANSI__
-#endif
-
-#include <X11/Xos.h> /* for unistd.h and string.h */
-#include <stdio.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include "misc.h"
-#include "dixstruct.h"
-
-#include <X11/extensions/Print.h>
-
-#include "attributes.h"
-
-#define IN_FILE_STRING "%(InFile)%"
-#define OUT_FILE_STRING "%(OutFile)%"
-
-/*
- * ReplaceAnyString returns a string combining the input strings.
- * It replaces all occurances of 'target' with the supplied
- * 'replacement'.
- * The original input string will generally be freed,
- * and the caller is responsible for freeing whatever string is returned.
- */
-char *
-ReplaceAnyString(
- char *string,
- char *target,
- char *replacement)
-{
- char *pKeyString;
-
- if(replacement != (char *)NULL)
- {
- while((pKeyString = strstr(string, target)) != (char *)NULL)
- {
- char *newString;
-
- newString = (char *)xalloc(strlen(string) + strlen(replacement) -
- strlen(target) + 1);
- strncpy(newString, string, pKeyString - string);
- newString[pKeyString - string] = '\0';
- strcat(newString, replacement);
- strcat(newString, pKeyString + strlen(target));
- xfree(string);
- string = newString;
- }
- }
-
- return string;
-}
-
-/*
- * ReplaceFileString returns a string combining the input strings.
- * It replaces all occurances of IN_FILE_STRING with the supplied
- * inFileName, and all occurances of OUT_FILE_STRING with the
- * supplied outFileName. The original input string will generally be freed,
- * and the caller is responsible for freeing whatever string is returned.
- */
-char *
-ReplaceFileString(
- char *string,
- char *inFileName,
- char *outFileName)
-{
- char *pKeyString,
- *pInFileString = IN_FILE_STRING,
- *pOutFileString = OUT_FILE_STRING;
-
- if(inFileName != (char *)NULL)
- {
- while((pKeyString = strstr(string, pInFileString)) !=
- (char *)NULL)
- {
- char *newString;
-
- newString = (char *)xalloc(strlen(string) +
- strlen(inFileName) + 1);
- strncpy(newString, string, pKeyString - string);
- newString[pKeyString - string] = '\0';
- strcat(newString, inFileName);
- strcat(newString, pKeyString + strlen(pInFileString));
- xfree(string);
- string = newString;
- }
- }
-
- if(outFileName != (char *)NULL)
- {
- while((pKeyString = strstr(string, pOutFileString)) !=
- (char *)NULL)
- {
- char *newString;
-
- newString = (char *)xalloc(strlen(string) +
- strlen(outFileName) + 1);
- strncpy(newString, string, pKeyString - string);
- newString[pKeyString - string] = '\0';
- strcat(newString, outFileName);
- strcat(newString, pKeyString + strlen(pOutFileString));
- xfree(string);
- string = newString;
- }
- }
- return string;
-}
-
-/*
- * ExecCommand takes two character pointers - the command to execute,
- * and the "argv" style NULL-terminated vector of arguments for the command.
- * We wait for the command to terminate before continuing to ensure that
- * we don't delete the job file before the spooler has made a copy.
- */
-void
-ExecCommand(
- char *pCommand,
- char **argVector)
-{
- pid_t childPid;
- int status;
-
- if((childPid = fork()) == 0)
- {
- execv(pCommand, argVector);
- }
- else
- {
- (void) waitpid(childPid, &status, 0);
- }
- return;
-}
-
-/*
- * TransferBytes reads numBytes of data from pSrcFile and writes them
- * to pDstFile. It returns the number of bytes actually transfered,
- * which will be numBytes if it's successful. Neither pSrcFile nor
- * pDstFile are rewound or their pointers otherwise modified prior to
- * beginning the transfer.
- */
-int
-TransferBytes(
- FILE *pSrcFile,
- FILE *pDstFile,
- int numBytes)
-{
- char buf[10240];
-#define BUF_SIZE (sizeof(buf)*sizeof(char))
- int bytesWritten = 0;
- unsigned bytesToXfer;
-
- for(bytesToXfer = min(BUF_SIZE, (unsigned)numBytes);
- bytesToXfer > 0;
- bytesToXfer = min(BUF_SIZE, (unsigned)(numBytes - bytesWritten)))
- {
- if(fread((void *)buf, (size_t) 1, bytesToXfer, pSrcFile) < bytesToXfer)
- return bytesWritten;
- if(fwrite((void *)buf, (size_t) 1, bytesToXfer, pDstFile) < bytesToXfer)
- return bytesWritten;
- bytesWritten += bytesToXfer;
- }
- return bytesWritten;
-}
-
-/*
- * CopyContentsAndDelete - does the work of copying and deleting the
- * pre, no, and post raster files as well as the raster file itself.
- */
-Bool
-CopyContentsAndDelete(
- FILE **ppSrcFile,
- char **pSrcFileName,
- FILE *pDstFile)
-{
- struct stat statBuf;
-
- if(stat(*pSrcFileName, &statBuf) < 0)
- return FALSE;
- rewind(*ppSrcFile);
- if(TransferBytes(*ppSrcFile, pDstFile,
- (int)statBuf.st_size) != (int)statBuf.st_size)
- return FALSE;
- fclose(*ppSrcFile);
- *ppSrcFile = (FILE *)NULL;
- unlink(*pSrcFileName);
- xfree(*pSrcFileName);
- *pSrcFileName = (char *)NULL;
-
- return TRUE;
-}
-
-
-#define QUADPAD(x) ((((x)+3)>>2)<<2)
-
-int
-XpSendDocumentData(
- ClientPtr client,
- FILE *fp,
- int fileLen,
- int maxBufSize)
-{
- xPrintGetDocumentDataReply *pRep;
- int bytesWritten;
- unsigned bytesToWrite;
- int result = Success;
-
- if(client->clientGone)
- return Success;
-
- pRep = (xPrintGetDocumentDataReply *)xalloc(sz_xPrintGetDocumentDataReply+
- QUADPAD(maxBufSize));
-
- for(bytesToWrite = min(maxBufSize, fileLen),
- bytesWritten = 0;
- bytesToWrite > 0;
- bytesToWrite = min(maxBufSize, fileLen - bytesWritten))
- {
- pRep->type = X_Reply;
- pRep->sequenceNumber = client->sequence;
- pRep->length = (QUADPAD(bytesToWrite)) >> 2;
- pRep->dataLen = bytesToWrite;
-
- if(fread((void *)(pRep + 1), 1, bytesToWrite, fp) < bytesToWrite)
- {
- result = BadAlloc; /* XXX poor error choice? */
- pRep->statusCode = 2; /* XXX Is this the right value??? */
- }
- else
- pRep->statusCode = 0; /* XXX Ignored??? */
-
- pRep->finishedFlag = FALSE;
-
- if (client->swapped) {
- int n;
- long l;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, l);
- swapl(&pRep->statusCode, l); /* XXX Why are these longs??? */
- swapl(&pRep->finishedFlag, l); /* XXX Why are these longs??? */
- swapl(&pRep->dataLen, l);
- }
-
- (void)WriteToClient(client,
- sz_xPrintGetDocumentDataReply + bytesToWrite,
- (char *)pRep);
- bytesWritten += bytesToWrite;
- }
-
- xfree(pRep);
- return result;
-}
-
-/*
- * XpFinishDocData - send a DocumentData reply with the "finishedFlag"
- * field set to TRUE. This routine should be called from the EndJob
- * function of a driver after the driver has sent all required
- * document data (presumably via XpSendDocumentData).
- */
-int
-XpFinishDocData(
- ClientPtr client)
-{
- xPrintGetDocumentDataReply rep;
-
- if(client->clientGone)
- return Success;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.dataLen = 0;
- rep.finishedFlag = TRUE;
- rep.statusCode = 0;
-
- if (client->swapped) {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.statusCode, l); /* XXX Why are these longs??? */
- swapl(&rep.finishedFlag, l); /* XXX Why are these longs??? */
- swapl(&rep.dataLen, l);
- }
-
- (void)WriteToClient(client, sz_xPrintGetDocumentDataReply, (char *)&rep);
- return Success;
-}
-
-#ifndef HAS_MKSTEMP
-static
-char *XpDirName(char *fname)
-{
- char *fn, *ptr;
-
- fn = (char *)xalloc(strlen(fname) + 1);
- if (fn) {
- strcpy(fn, fname);
- ptr = strrchr(fn, '/');
- if (!ptr) {
- ptr = fn;
- *ptr++ = '.';
- } else if (ptr == fn)
- ptr++;
- *ptr = '\0';
- }
- return fn;
-}
-#endif
-
-Bool
-XpOpenTmpFile(
- char *mode,
- char **fname,
- FILE **stream)
-{
-#ifndef HAS_MKSTEMP
- char *fn = NULL;
-
- /* note that there is a small race condition here... */
- if (!(*fname = tempnam(NULL, NULL)) ||
- !(fn = XpDirName(*fname)) ||
- access(fn, W_OK) ||
- !(*stream = fopen(*fname, mode)))
-
- {
- xfree(fn);
- xfree(*fname);
- *fname = NULL;
- *stream = NULL;
- return FALSE;
- }
- xfree(fn);
-#else
- int fd;
-
- *stream = NULL;
- *fname = (char *)xalloc(14);
- if (*fname == NULL)
- return FALSE;
- strcpy(*fname, "/tmp/xpXXXXXX");
- fd = mkstemp(*fname);
- if (fd < 0) {
- xfree(*fname);
- *fname = NULL;
- return FALSE;
- }
- *stream = fdopen(fd, mode);
- if (stream == NULL) {
- xfree(*fname);
- *fname = NULL;
- return FALSE;
- }
-#endif
- return TRUE;
-}
diff --git a/Xprint/ValTree.c b/Xprint/ValTree.c
deleted file mode 100644
index 327cb468c..000000000
--- a/Xprint/ValTree.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* $Xorg: ValTree.c,v 1.3 2000/08/17 19:48:06 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/ValTree.c,v 1.2 2003/11/10 18:21:44 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "mivalidate.h"
-
-/*
- * XpValidateTree - a validateTree routine which ignores overlapping
- * top-level windows when computing the clip lists for such windows.
- * This can be used by any driver which maintains a separate memory
- * store for each top-level window (with its respective children).
- * If the pParent is not the root window, then miValidateTree
- * is used unmodified.
- *
- * The strategy if pParent is the root is to save off the
- * current values of pParent->firstChild and pParent->lastChild,
- * replacing both with the single child of interest. We save off
- * pChild->prevSib and pChild->nextSib, and replace them with NullWindow.
- * We save off pParent->clipList, and replace it with
- * pParent->winSize - pChild->winSize. We then call miValidateTree
- * to do the needed ComputeClips on the pChild's heirarchy.
- * pParent's clipList is then recomputed based on the sizes
- * of its children, and the saved pointers are restored.
- * The trees associated with the siblings of pChild must be descended
- * and cleaned of any marks (i.e. the valdata pointer freed, and set to NULL),
- * and pParent' AfterValidate structure's exposed field must be updated.
- */
-/*ARGSUSED*/
-int
-XpValidateTree (pParent, pChild, kind)
- WindowPtr pParent; /* Parent to validate */
- WindowPtr pChild; /* First child of pParent that was
- * affected */
- VTKind kind; /* What kind of configuration caused call */
-{
- RegionRec origPrntClip; /* orig clipList for parent */
- RegionRec childClip; /* The new borderClip for the current
- * child */
- RegionRec tmpPrntClip; /* parent clipList - child borderClip */
- RegionRec exposed; /* For intermediate calculations */
- register ScreenPtr pScreen;
- register WindowPtr pWin;
- Bool overlap;
- int viewvals;
- Bool forward;
-
- WindowPtr origFirstChild, origLastChild, origPrevSib, origNextSib;
-
- /*
- * If we're validating something other than a top-level window,
- * then just invoke miValidateTree.
- */
- if(pParent->parent != NullWindow)
- return miValidateTree(pParent, pChild, kind);
-
- /*
- * If it's a stack change of top levels then it's a no-op for
- * this scheme, so we just clean up any marks on windows and return.
- */
- if(kind == VTStack)
- {
- CleanMarks(pParent);
- return 1;
- }
-
- pScreen = pParent->drawable.pScreen;
- if (pChild == NullWindow)
- pChild = pParent->firstChild;
-
- /* Save off the existing window heirarchy */
- origFirstChild = pParent->firstChild;
- origLastChild = pParent->lastChild;
- origPrevSib = pChild->prevSib;
- origNextSib = pChild->nextSib;
- pParent->firstChild = pChild;
- pParent->lastChild = pChild;
- pChild->prevSib = NullWindow;
- pChild->nextSib = NullWindow;
-
- /*
- * Set pParent's clipList to be its winSize minus the pChild's
- * borderSize.
- */
- origPrntClip = pParent->clipList;
- REGION_NULL(pScreen, &tmpPrntClip);
- REGION_SUBRACT(pScreen, &tmpPrntClip, &pParent->winSize,
- &pChild->borderSize);
- pParent->clipList = tmpPrntClip;
-
- /*
- * Call miValidateTree on the pruned tree.
- */
- (void) miValidateTree(pParent, pChild, kind);
-
- /* Restore the saved heirarchy */
- pChild->prevSib = origPrevSib;
- pChild->nextSib = origNextSib;
- pParent->firstChild = origFirstChild;
- pParent->lastChild = origLastChild;
-
- /*
- * Compute pParent's clipList by taking its winSize and subracting
- * the borderSize of each of its children.
- */
- for(pWin = pParent->firstChild,
- REGION_COPY(pScreen, &pParent->clipList, &pParent->winSize);
- pWin != NullWindow;
- pWin = pWin->nextSib)
- {
- REGION_SUBTRACT(pScreen, &pParent->clipList, &pParent->clipList,
- &pWin->borderSize);
- }
-
- /*
- * Compute pParent's AfterValidate structure by subracting the original
- * clipList from the newly computed clipList.
- */
- REGION_NULL(pScreen, &pParent->valdata->after.exposed);
- REGION_SUBTRACT(pScreen, &pParent->valdata->after.exposed,
- &pParent->clipList, &origPrntClip);
-
- /*
- * Remove the marks from all but pParent and pChild's heirarchy.
- * i.e. from all of pChild's siblings and their children.
- */
- for(pWin = pParent->firstChild; pWin != NullWindow; pWin = pWin->nextSib)
- {
- WindowPtr pCurChild = pWin;
-
- if(pCurChild == pChild)
- continue;
-
- while (1)
- {
- if(pCurChild->valdata)
- {
- xfree(pCurChild->valdata);
- pCurChild->valdata = (ValidatePtr)NULL;
- }
-
- if (pCurChild->firstChild)
- {
- pCurChild = pCurChild->firstChild;
- continue;
- }
- while (!pCurChild->nextSib && (pCurChild != pWin))
- pCurChild = pCurChild->parent;
- if (pCurChild == pWin)
- break;
- pCurChild = pCurChild->nextSib;
- }
- }
-}
diff --git a/Xprint/attributes.c b/Xprint/attributes.c
deleted file mode 100644
index ec60f3032..000000000
--- a/Xprint/attributes.c
+++ /dev/null
@@ -1,1553 +0,0 @@
-/* $Xorg: attributes.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: attributes.c
-** *
-** * Contents:
-** * Implementation of the attribute store for Xp.
-** *
-** * Copyright: Copyright 1995 Hewlett-Packard Company
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/attributes.c,v 1.20 2003/10/29 22:11:54 tsi Exp $ */
-
-#include <X11/Xproto.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <pwd.h>
-#if defined(sun) && defined(SVR4)
-#include <wchar.h>
-#endif
-
-#include "scrnintstr.h"
-
-#include <X11/extensions/Printstr.h>
-
-#include "attributes.h"
-
-#include "Xlib.h"
-#include "Xresource.h"
-#include "Xrm.c"
-
-static XrmDatabase CopyDb(XrmDatabase inDb);
-
-extern XrmDatabase XpSpoolerGetServerAttributes(void);
-
-static unsigned long attrGeneration = 0;
-
-typedef struct {
- XrmDatabase *pDb;
- char *qualifier;
- char *modelId;
-} DbEnumStruct;
-
-typedef struct {
- char *stringDb;
- int nextPos;
- int space;
-} StringDbStruct;
-
-typedef struct _printerAttrs {
- struct _printerAttrs *next;
- char *name;
- char *qualifier;
- XrmDatabase printerAttrs;
- XrmDatabase docAttrs;
- XrmDatabase jobAttrs;
-} PrAttrs, *PrAttrPtr;
-
-static PrAttrPtr attrList = (PrAttrPtr)NULL;
-
-typedef struct _systemAttrs {
- XrmDatabase doc;
- XrmDatabase job;
- XrmDatabase printers;
- XrmDatabase server;
-} SysAttrs, *SysAttrsPtr;
-
-SysAttrs systemAttributes;
-
-/*
- * attrCtxtPrivIndex hold the attribute store's context private index.
- * This index is allocated at the time the attribute store is initialized.
- */
-static int attrCtxtPrivIndex;
-
-/*
- * The ContextAttrs structure descibes the context private space reserved
- * by the attribute store.
- */
-typedef struct _contextAttrs {
- XrmDatabase printerAttrs;
- XrmDatabase docAttrs;
- XrmDatabase jobAttrs;
- XrmDatabase pageAttrs;
-} ContextAttrs, *ContextAttrPtr;
-
-/*
- * XPDIR is relative to (i.e. is a subdir of) XPRINTDIR/$LANG.
- */
-static const char XPDIR[] = "/print";
-/*
- * The following files/directories define or are within subdirectories of the
- * above-defined XPDIR.
- */
-static const char XPPRINTERATTRFILE[] = "/attributes/printer";
-static const char XPJOBATTRFILE[] = "/attributes/job";
-static const char XPDOCATTRFILE[] = "/attributes/document";
-static const char XPMODELDIR[] = "/models";
-
-static char NULL_STRING[] = "\0";
-
-/*
- * XpGetConfigDir returns a string containing the path name of the print
- * server configuration directory. If the useLocale parameter is False
- * the it returns the path to the "/C" directory. If the useLocale
- * parameter is True it returns the path to the directory associated with
- * $LANG. It makes no attempt to ensure that the directory actually exists.
- */
-char *
-XpGetConfigDir(Bool useLocale)
-{
- char *dirName, *langName, *langDir, *configDir;
- Bool freeLangDir = False;
-
- if(useLocale == False) langDir = "/C";
- else
- {
- if((langName = getenv("LANG")) == (char *)NULL)
- return (char *)NULL;
- else
- {
- if(strcmp(langName, "C") == 0)
- return (char *)NULL;
- langDir = (char *)xalloc(strlen(langName) + 2);
- sprintf(langDir, "/%s", langName);
- freeLangDir = True;
- }
- }
-
- /*
- * If the XPCONFIGDIR environment variable is not set, then use the
- * compile-time constant XPRINTDIR. XPRINTDIR is passed in on the
- * compile command line, and is defined in $(TOP)/config/cf/Project.tmpl.
- */
- if((configDir = getenv("XPCONFIGDIR")) == (char *)NULL)
- configDir = XPRINTDIR;
-
- dirName = (char *)xalloc(strlen(configDir) + strlen(XPDIR) +
- strlen(langDir) + 1);
- sprintf(dirName, "%s%s%s", configDir, langDir, XPDIR);
-
- if(freeLangDir == True)
- xfree(langDir);
-
- return dirName;
-}
-
-/*
- * GetMergedDatabase reads and merges xrmdb files from the top-level printer
- * config directory, and from the directory associated with the current
- * locale (if other than the top-level).
- */
-static XrmDatabase
-GetMergedDatabase(const char *attrName)
-{
- char *dirName, *fileName;
- XrmDatabase db;
-
- if((dirName = XpGetConfigDir(False)) == (char *)NULL)
- return (XrmDatabase)NULL;
- if((fileName = (char *)xalloc(strlen(dirName) + strlen(attrName) + 1)) ==
- (char *)NULL)
- return (XrmDatabase)NULL;
- sprintf(fileName, "%s%s", dirName, attrName);
- db = XrmGetFileDatabase(fileName);
- xfree(fileName);
- xfree(dirName);
-
- if((dirName = XpGetConfigDir(True)) == (char *)NULL)
- return db;
- if((fileName = (char *)xalloc(strlen(dirName) + strlen(attrName) + 1)) ==
- (char *)NULL)
- return db;
- sprintf(fileName, "%s%s", dirName, attrName);
- (void)XrmCombineFileDatabase(fileName, &db, True);
- xfree(fileName);
- xfree(dirName);
-
- return db;
-}
-
-/*
- * BuildSystemAttributes reads the on-disk configuration files for printers,
- * initial job, and initial document attributes. The resulting xrm
- * databases are then dissected as needed for each printer.
- * It also allocates a contextPrivate space for the attributes,
- * reserving space to store pointers to the attribute stores for
- * the context.
- */
-static void
-BuildSystemAttributes(void)
-{
- if(systemAttributes.printers != (XrmDatabase)NULL)
- XrmDestroyDatabase(systemAttributes.printers);
- systemAttributes.printers = GetMergedDatabase(XPPRINTERATTRFILE);
- if(systemAttributes.job != (XrmDatabase)NULL)
- XrmDestroyDatabase(systemAttributes.job);
- systemAttributes.job = GetMergedDatabase(XPJOBATTRFILE);
- if(systemAttributes.doc != (XrmDatabase)NULL)
- XrmDestroyDatabase(systemAttributes.doc);
- systemAttributes.doc = GetMergedDatabase(XPDOCATTRFILE);
- if(systemAttributes.server != (XrmDatabase)NULL)
- XrmDestroyDatabase(systemAttributes.server);
- systemAttributes.server = XpSpoolerGetServerAttributes();
- return;
-}
-
-/*
- * AddDbEntry is called by XrmEnumerateDatabase, and adds the supplied
- * database entry to the database pointed to within the "DbEnumStruct"
- * passed as the client_data (aka "closure").
- */
-static Bool
-AddDbEntry(
- XrmDatabase *sourceDB,
- XrmBindingList bindings,
- XrmQuarkList quarks,
- XrmRepresentation *type,
- XrmValue *value,
- XPointer client_data)
-{
- DbEnumStruct *pEnumStruct = (DbEnumStruct *)client_data;
- XrmName xrm_name[5];
- XrmClass xrm_class[5];
- XrmBinding xrm_bind[3];
- XrmValue realVal;
- XrmRepresentation rep_type;
-
- xrm_name[0] = XrmStringToQuark (pEnumStruct->qualifier);
- xrm_class[0] = XrmStringToQuark (pEnumStruct->modelId);
-
- for(;*quarks; quarks++)
- xrm_name[1] = xrm_class[1] = *quarks;
-
- xrm_name[2] = (XrmQuark)NULL;
- xrm_class[2] = (XrmQuark)NULL;
-
- if(XrmQGetResource (*sourceDB, xrm_name, xrm_class, &rep_type, &realVal))
- {
- xrm_bind[0] = XrmBindLoosely;
-
- xrm_name[0] = xrm_name[1];
- xrm_name[1] = NULLQUARK;
-
- XrmQPutStringResource(pEnumStruct->pDb, xrm_bind, xrm_name,
- (char *)realVal.addr);
- }
-
- return FALSE;
-}
-
-/*
- * BuildPrinterAttrs - builds and returns an XrmDatabase for the printer
- * of the specified name/qualifier, if we have enough information.
- * If we don't have a model-config
- * file, then just enumerate the systemAttributes->printers database,
- * otherwise read in the model-config database and merge into it the
- * systemAttributes->printers database. This database is then enumerated
- * with the printer qualifier (and the model name as class if we have it), and
- * the resulting elements are stored into the database for this particular
- * printer.
- */
-static XrmDatabase
-BuildPrinterAttrs(
- char *printerName,
- char *qualifierName)
-{
- XrmDatabase printerDB = (XrmDatabase)NULL;
-
- if(systemAttributes.printers != (XrmDatabase)NULL)
- {
- char *fileName;
- XrmDatabase modelDB = (XrmDatabase)NULL;
- XrmName xrm_name[5], xrm_class[2];
- XrmRepresentation rep_type;
- XrmValue value;
- DbEnumStruct enumStruct;
- Bool freeModelDB = False;
- /*
- * Build the initial db based on the model-config files
- */
- xrm_name[0] = XrmStringToQuark (qualifierName);
- xrm_name[1] = XrmStringToQuark ("xp-model-identifier");
- xrm_name[2] = (XrmQuark)NULL;
- XrmQGetResource (systemAttributes.printers, xrm_name, xrm_name,
- &rep_type, &value);
-
- if(value.addr != (XPointer)NULL)
- {
- fileName = (char *)xalloc(strlen(XPMODELDIR) +
- strlen((char *)value.addr) +
- strlen("model-config") + 3);
- sprintf(fileName, "%s/%s/%s", XPMODELDIR, value.addr,
- "model-config");
- modelDB = GetMergedDatabase(fileName);
- xfree(fileName);
- if(modelDB != (XrmDatabase)NULL)
- {
- XrmDatabase tempDB = (XrmDatabase)NULL;
- /*
- * have to make a temp copy because MergeDatabase destroys
- * the "source" database. Merge in the printers DB
- */
- tempDB = CopyDb(systemAttributes.printers);
- XrmMergeDatabases(tempDB, &modelDB);
- freeModelDB = True;
- }
- }
-
- /*
- * Check to see if we knew the name AND found a database file
- */
- if(modelDB == (XrmDatabase)NULL)
- modelDB = systemAttributes.printers;
-
- xrm_name[0] = XrmStringToQuark (qualifierName);
- xrm_name[1] = (XrmQuark)NULL;
- xrm_class[0] = XrmStringToQuark((char *)value.addr);
- xrm_class[1] = (XrmQuark)NULL;
- enumStruct.pDb = &printerDB;
- enumStruct.qualifier = (char *)qualifierName;
- enumStruct.modelId = (char *)value.addr;
- XrmEnumerateDatabase(modelDB, xrm_name, xrm_class, XrmEnumAllLevels,
- AddDbEntry, (XPointer) &enumStruct);
-
- if(freeModelDB == True) XrmDestroyDatabase(modelDB);
- }
- XrmPutStringResource(&printerDB, "*printer-name", printerName);
- XrmPutStringResource(&printerDB, "*qualifier", qualifierName);
- return printerDB;
-}
-
-/*
- * BuildABase - builds an XrmDatabase by enumerating the supplied sourceBase
- * database for elements relevant for the printer named by printerName,
- * and deriving a class for printerName from the model declared in the
- * systemAttributes.printers database. If no model is defined for this
- * printer then the printerName is used as the class as well.
- *
- * This is used to build the initial value document and initial value
- * job attribute databases for each printer by searching the system
- * level doc and job databases.
- */
-static XrmDatabase
-BuildABase(
- char *printerName,
- char *qualifierName,
- XrmDatabase sourceBase)
-{
- XrmDatabase builtDB = (XrmDatabase)NULL;
-
- if(sourceBase != (XrmDatabase)NULL)
- {
- XrmName xrm_name[5], xrm_class[2];
- XrmRepresentation rep_type;
- XrmValue value;
- DbEnumStruct enumStruct;
-
- /*
- * Retrieve the model name for use as the class.
- */
- xrm_name[0] = XrmStringToQuark (printerName);
- xrm_name[1] = XrmStringToQuark ("xp-model-identifier");
- xrm_name[2] = (XrmQuark)NULL;
- XrmQGetResource (systemAttributes.printers, xrm_name, xrm_name,
- &rep_type, &value);
- /*
- * if we have a model name then use it as the class, otherwise
- * just use the printer name as the class as well as the name.
- */
- if(value.addr != (XPointer)NULL)
- xrm_class[0] = XrmStringToQuark((char *)value.addr);
- else
- xrm_class[0] = xrm_name[0];
- xrm_class[1] = (XrmQuark)NULL;
-
- xrm_name[1] = (XrmQuark)NULL;
-
- enumStruct.pDb = &builtDB;
- enumStruct.qualifier = (char *)qualifierName;
- enumStruct.modelId = (char *)value.addr;
- XrmEnumerateDatabase(sourceBase, xrm_name, xrm_class, XrmEnumAllLevels,
- AddDbEntry, (XPointer) &enumStruct);
- }
-
- XrmPutStringResource(&builtDB, "*qualifier", qualifierName);
-
- return builtDB;
-}
-
-/*
- * FreeAttrList is called upon server recycle, and frees the printer
- * databases stored in the global attrList.
- */
-static void
-FreeAttrList(void)
-{
- PrAttrPtr pAttr, pNext;
-
- for(pAttr = attrList, pNext = attrList;
- pAttr != (PrAttrPtr)NULL;
- pAttr = pNext)
- {
- pNext = pAttr->next;
- if(pAttr->printerAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pAttr->printerAttrs);
- if(pAttr->docAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pAttr->docAttrs);
- if(pAttr->jobAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pAttr->jobAttrs);
- xfree(pAttr->name);
- xfree(pAttr->qualifier);
- xfree(pAttr);
- }
- attrList = (PrAttrPtr)NULL;
-}
-
-/*
- * XpRehashAttributes - frees the per-printer attribute list and
- * calls BuildSystemAttributes to rebuild the overall attribute
- * store. It is expected that a caller of this will follow it
- * by calling XpBuildAttributeStore for a new list of printers.
- */
-int
-XpRehashAttributes(void)
-{
- if(attrList != (PrAttrPtr)NULL)
- FreeAttrList();
- BuildSystemAttributes();
- return Success;
-}
-
-/*
- * XpBuildAttributeStore - creates the attribute database associated
- * with the specified printer. The first time this is called it
- * calls BuildSystemAttributes to create the system-level databases.
- */
-void
-XpBuildAttributeStore(
- char *printerName,
- char *qualifierName)
-{
- PrAttrPtr pAttr;
-
- if((pAttr = (PrAttrPtr)xalloc(sizeof(PrAttrs))) == (PrAttrPtr)NULL)
- return;
-
- if(attrGeneration != serverGeneration)
- {
- if(attrList != (PrAttrPtr)NULL)
- FreeAttrList();
- attrCtxtPrivIndex = XpAllocateContextPrivateIndex();
- XpAllocateContextPrivate(attrCtxtPrivIndex, sizeof(ContextAttrs));
- BuildSystemAttributes();
-
- attrGeneration = serverGeneration;
- }
-
- if(attrList == (PrAttrPtr)NULL)
- {
- pAttr->next = (PrAttrPtr)NULL;
- attrList = pAttr;
- }
- else
- {
- pAttr->next = attrList;
- attrList = pAttr;
- }
-
- pAttr->name = strdup(printerName);
- pAttr->qualifier = strdup(qualifierName);
- pAttr->printerAttrs = BuildPrinterAttrs(printerName, qualifierName);
- pAttr->docAttrs = BuildABase(printerName, qualifierName,
- systemAttributes.doc);
- pAttr->jobAttrs = BuildABase(printerName, qualifierName,
- systemAttributes.job);
-}
-
-
-static Bool
-StoreEntry(
- XrmDatabase *sourceDB,
- XrmBindingList bindings,
- XrmQuarkList quarks,
- XrmRepresentation *type,
- XrmValue *value,
- XPointer client_data)
-{
- XrmDatabase *outDb = (XrmDatabase *)client_data;
-
- XrmQPutStringResource(outDb, bindings, quarks, (char *)value->addr);
-
- return FALSE;
-}
-
-/*
- * XpCopyDb - makes a copy of the specified XrmDatabase and returns
- * the copy.
- */
-static XrmDatabase
-CopyDb(XrmDatabase inDb)
-{
- XrmDatabase outDb = (XrmDatabase)NULL;
- XrmQuark empty = NULLQUARK;
-
- (void)XrmEnumerateDatabase(inDb, &empty, &empty, XrmEnumAllLevels,
- StoreEntry, (XPointer) &outDb);
- return outDb;
-}
-
-/*
- * XpInitAttributes - initializes the attribute store for the specified
- * context. It does this by making copies of the printer, doc, and job
- * attributes databases for the printer associated with the context.
- */
-void
-XpInitAttributes(XpContextPtr pContext)
-{
- ContextAttrPtr pCtxtAttrs;
- PrAttrPtr pPrAttr = attrList;
-
- /* Initialize all the pointers to NULL */
- pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- (void)memset((void *)pCtxtAttrs, 0, (size_t) sizeof(ContextAttrs));
-
- for(pPrAttr = attrList; pPrAttr != (PrAttrPtr)NULL; pPrAttr = pPrAttr->next)
- if(!strcmp(pPrAttr->name, pContext->printerName)) break;
-
- if(pPrAttr != (PrAttrPtr)NULL)
- {
- pCtxtAttrs->printerAttrs = CopyDb(pPrAttr->printerAttrs);
- pCtxtAttrs->docAttrs = CopyDb(pPrAttr->docAttrs);
- pCtxtAttrs->jobAttrs = CopyDb(pPrAttr->jobAttrs);
- }
-}
-
-void
-XpDestroyAttributes(
- XpContextPtr pContext)
-{
- ContextAttrPtr pCtxtAttrs;
-
- pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
-
- if(pCtxtAttrs->printerAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->printerAttrs);
- if(pCtxtAttrs->docAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->docAttrs);
- if(pCtxtAttrs->jobAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->jobAttrs);
- if(pCtxtAttrs->pageAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->pageAttrs);
-}
-
-/*
- * XpGetOneAttribute returns the string value of the specified attribute
- * in the specified class for the specified print context. If the attribute
- * doesn't exist in the database for this context, or if the class database
- * doesn't exist for this context, then NULL is returned. The caller must
- * not free the returned string, as the returned pointer points into the
- * database. This function can also return a value from the server attributes,
- * in which case the pContext parameter is ignored.
- */
-char *
-XpGetOneAttribute(
- XpContextPtr pContext,
- XPAttributes class,
- char *attributeName)
-{
- ContextAttrPtr pCtxtAttrs;
- XrmDatabase db = (XrmDatabase)NULL;
- XrmName xrm_name[3];
- XrmRepresentation rep_type;
- XrmValue value;
-
- if(class == XPServerAttr)
- {
- if(systemAttributes.server == (XrmDatabase)NULL)
- return NULL_STRING;
-
- xrm_name[0] = XrmStringToQuark (attributeName);
- xrm_name[1] = (XrmQuark)NULL;
- XrmQGetResource(systemAttributes.server, xrm_name, xrm_name,
- &rep_type, &value);
-
- if(value.addr == (char *)NULL)
- return NULL_STRING;
- return (char *)value.addr;
- }
- else
- {
- pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- switch(class)
- {
- case XPPrinterAttr:
- db = pCtxtAttrs->printerAttrs;
- break;
- case XPDocAttr:
- db = pCtxtAttrs->docAttrs;
- break;
- case XPJobAttr:
- db = pCtxtAttrs->jobAttrs;
- break;
- case XPPageAttr:
- db = pCtxtAttrs->pageAttrs;
- break;
- default:
- break;
- }
- }
- if(db == (XrmDatabase)NULL)
- return NULL_STRING;
-
- xrm_name[0] = XrmStringToQuark ("qualifier");
- xrm_name[1] = (XrmQuark)NULL;
- XrmQGetResource(db, xrm_name, xrm_name, &rep_type, &value);
-
- xrm_name[0] = XrmStringToQuark (value.addr);
- xrm_name[1] = XrmStringToQuark (attributeName);
- xrm_name[2] = (XrmQuark)NULL;
- if(XrmQGetResource(db, xrm_name, xrm_name, &rep_type, &value))
- return (char *)value.addr;
- else
- return NULL_STRING;
-}
-
-/*
- * XpPutOneAttribute updates one attribute for the specified
- * context and class. This function is intended for use by the attribute
- * validation module which updates the XrmDatabases directly. This
- * function does not recognize XPServerAttr.
- */
-void
-XpPutOneAttribute(
- XpContextPtr pContext,
- XPAttributes class,
- const char* attributeName,
- const char* value)
-{
- ContextAttrPtr pCtxtAttrs;
- XrmDatabase db;
- XrmBinding bindings[1];
- XrmQuark quarks[2];
-
- pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- switch(class)
- {
- case XPPrinterAttr:
- db = pCtxtAttrs->printerAttrs;
- break;
- case XPDocAttr:
- db = pCtxtAttrs->docAttrs;
- break;
- case XPJobAttr:
- db = pCtxtAttrs->jobAttrs;
- break;
- case XPPageAttr:
- db = pCtxtAttrs->pageAttrs;
- break;
- default:
- return;
- }
- bindings[0] = XrmBindLoosely;
- quarks[0] = XrmStringToQuark(attributeName);
- quarks[1] = (XrmQuark)NULL;
- XrmQPutStringResource(&db, bindings, quarks, value ? value : "");
-}
-
-
-
-/*******************************************************************************
- *
- * The following routines: ExpandSpace, PutString, PutByte, and AppendEntry
- * form the functional core of the GetAttributes routine. Xrm does not
- * supply a routine to form a string database from an XrmDatabase, except
- * by writing the database to a file. This code avoids the file system
- * overhead, but is a bit clunky in its memory management.
- *
- ******************************************************************************/
-
-/*
- * ExpandSpace expands the memory allocated for the string database in
- * the StringDbStruct passed in, and updates the "space" field of the
- * struct to indicate the new amount of space available.
- */
-static Bool
-ExpandSpace(
- StringDbStruct *pStr)
-{
- char *newSpace;
-
- if((newSpace = (char *)xrealloc(pStr->stringDb, pStr->nextPos + pStr->space
- + 1024)) == (char *)NULL)
- return False;
- pStr->space += 1024;
- pStr->stringDb = newSpace;
- return True;
-}
-
-/*
- * PutString puts the contents of a null-terminated string into the string
- * database in the StringDbStruct passed in. If there is insufficient room
- * for the string, ExpandSpace is called, and the nextPos and space fields
- * are updated.
- */
-static void
-PutString(
- StringDbStruct *pStr,
- char *pString)
-{
- int len = strlen(pString);
-
- if(len >= pStr->space)
- if(!ExpandSpace(pStr))
- return;
- strcpy(&pStr->stringDb[pStr->nextPos], pString);
- pStr->nextPos += len;
- pStr->space -= len;
-}
-
-/*
- * PutByte puts a single byte value in to the string database in the passed-in
- * StringDbStruct. ExpandSpace is called if there is insufficient room for
- * the byte, and the nextPos and space fields are updated.
- */
-static void
-PutByte(
- StringDbStruct *pStr,
- char byte)
-{
- if(pStr->space <= 1)
- if(!ExpandSpace(pStr))
- return;
- pStr->stringDb[pStr->nextPos] = byte;
- pStr->nextPos++;
- pStr->space--;
-}
-
-/*
- * AppendEntry is called by XrmEnumerateDatabase, and serves to append
- * a database entry onto a string database. The passed-in "closure"
- * struct contains a pointer to the string, and a count of the remaining
- * bytes. If there are insufficient remaining bytes then the struct
- * is realloced, and the count of the space remaining is updated.
- * Database elements of types other than String are ignored!
- * This code is based directly on that in "DumpEntry" in Xrm.c.
- */
-static Bool
-AppendEntry(
- XrmDatabase *db,
- XrmBindingList bindings,
- XrmQuarkList quarks,
- XrmRepresentation *type,
- XrmValuePtr value,
- XPointer data)
-{
- StringDbStruct *pEnumStr = (StringDbStruct *)data;
- Bool firstNameSeen;
- unsigned int i;
- char *s, c;
-
- if (*type != XrmQString)
- return False;
-
- for (firstNameSeen = False; *quarks; bindings++, quarks++) {
- if (*bindings == XrmBindLoosely) {
- PutString(pEnumStr, "*");
- } else if (firstNameSeen) {
- PutString(pEnumStr, ".");
- }
- firstNameSeen = True;
- PutString(pEnumStr, XrmQuarkToString(*quarks));
- }
- s = value->addr;
- i = value->size;
- PutString(pEnumStr, ":\t");
- if(i) i--;
-
- if (i && (*s == ' ' || *s == '\t'))
- PutByte(pEnumStr, '\\'); /* preserve leading whitespace */
-
- while (i--) {
- c = *s++;
- if (c == '\n') {
- if (i)
- PutString(pEnumStr, "\\n\\\n");
- else
- PutString(pEnumStr, "\\n");
- } else if (c == '\\')
- PutString(pEnumStr, "\\\\");
- else if ((c < ' ' && c != '\t') ||
- ((unsigned char)c >= 0x7f && (unsigned char)c < 0xa0))
- {
- char temp[4];
- (void) sprintf(temp, "\\%03o", (unsigned char)c);
- PutString(pEnumStr, temp);
- }
- else
- PutByte(pEnumStr, c);
- }
- PutByte(pEnumStr, '\n');
- pEnumStr->stringDb[pEnumStr->nextPos] = (char)'\0';
- return False;
-}
-
-/*
- * XpGetAttributes returns a string database version of the Xrm database
- * for the specified context and class. This function can also return the
- * contents of the server attributes, in which case the pContext parameter
- * is ignored.
- *
- * The caller is responsible for freeing the returned string,
- * unlike XpGetOneAttribute, where the caller must not free the string.
- */
-char *
-XpGetAttributes(
- XpContextPtr pContext,
- XPAttributes class)
-{
- ContextAttrPtr pCtxtAttrs;
- XrmDatabase db = (XrmDatabase)NULL;
- StringDbStruct enumStruct;
- XrmQuark empty = NULLQUARK;
-
- if(class == XPServerAttr)
- db = systemAttributes.server;
- else
- {
- pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- switch(class)
- {
- case XPServerAttr:
- db = systemAttributes.server;
- break;
- case XPPrinterAttr:
- db = pCtxtAttrs->printerAttrs;
- break;
- case XPDocAttr:
- db = pCtxtAttrs->docAttrs;
- break;
- case XPJobAttr:
- db = pCtxtAttrs->jobAttrs;
- break;
- case XPPageAttr:
- db = pCtxtAttrs->pageAttrs;
- break;
- default:
- break;
- }
- }
- if(db == (XrmDatabase)NULL)
- {
- char *retval = (char *)xalloc(1);
- retval[0] = (char)'\0';
- return retval;
- }
-
- if((enumStruct.stringDb = (char *)xalloc(1024)) == (char *)NULL)
- return (char *)NULL;
- enumStruct.stringDb[0] = (char)'\0';
- enumStruct.nextPos = 0;
- enumStruct.space = 1024;
- (void)XrmEnumerateDatabase(db, &empty, &empty, XrmEnumAllLevels,
- AppendEntry, (XPointer) &enumStruct);
-
- return enumStruct.stringDb;
-}
-
-int
-XpAugmentAttributes(
- XpContextPtr pContext,
- XPAttributes class,
- char *attributes)
-{
- XrmDatabase db;
- ContextAttrPtr pCtxtAttrs;
-
- db = XrmGetStringDatabase(attributes);
- if(db == (XrmDatabase)NULL) return BadAlloc;
-
- pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- switch(class)
- {
- case XPPrinterAttr:
- XrmMergeDatabases(db, &pCtxtAttrs->printerAttrs);
- break;
- case XPDocAttr:
- XrmMergeDatabases(db, &pCtxtAttrs->docAttrs);
- break;
- case XPJobAttr:
- XrmMergeDatabases(db, &pCtxtAttrs->jobAttrs);
- break;
- case XPPageAttr:
- XrmMergeDatabases(db, &pCtxtAttrs->pageAttrs);
- break;
- default:
- break;
- }
- return Success;
-}
-
-/*
- * XpSetAttributes - sets the attribute stores for a specified context.
- */
-int
-XpSetAttributes(
- XpContextPtr pContext,
- XPAttributes class,
- char *attributes)
-{
- XrmDatabase db;
- ContextAttrPtr pCtxtAttrs;
-
- db = XrmGetStringDatabase(attributes);
- if(db == (XrmDatabase)NULL) return BadAlloc;
-
- pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr;
- switch(class)
- {
- case XPPrinterAttr:
- if(pCtxtAttrs->printerAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->printerAttrs);
- pCtxtAttrs->printerAttrs = db;
- break;
- case XPDocAttr:
- if(pCtxtAttrs->docAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->docAttrs);
- pCtxtAttrs->docAttrs = db;
- break;
- case XPJobAttr:
- if(pCtxtAttrs->jobAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->jobAttrs);
- pCtxtAttrs->jobAttrs = db;
- break;
- case XPPageAttr:
- if(pCtxtAttrs->pageAttrs != (XrmDatabase)NULL)
- XrmDestroyDatabase(pCtxtAttrs->pageAttrs);
- pCtxtAttrs->pageAttrs = db;
- break;
- default:
- break;
- }
- return Success;
-}
-
-void
-XpAddPrinterAttribute(
- char *printerName,
- char *printerQualifier,
- char *attributeName,
- char *attributeValue)
-{
- PrAttrPtr pAttr;
-
- for(pAttr = attrList; pAttr != (PrAttrPtr)NULL; pAttr = pAttr->next)
- {
- if(!strcmp(printerQualifier, pAttr->qualifier))
- {
- XrmPutStringResource(&pAttr->printerAttrs, attributeName,
- attributeValue);
- break;
- }
- }
-}
-
-const char *
-XpGetPrinterAttribute(const char *printerName,
- const char *attribute)
-{
- PrAttrPtr pAttr;
- XrmValue value;
- char *type;
-
- for(pAttr = attrList; pAttr != (PrAttrPtr)NULL; pAttr = pAttr->next)
- {
- if(!strcmp(printerName, pAttr->qualifier))
- {
- char *attrStr;
-
- attrStr = (char *)xalloc(strlen(printerName) + strlen(attribute) +
- 2);
- sprintf(attrStr, "%s.%s", printerName, attribute);
- XrmGetResource(pAttr->printerAttrs, attrStr, attrStr,
- &type, &value);
- xfree(attrStr);
- break;
- }
- }
- if(value.addr != (XPointer)NULL && strlen(value.addr) != 0)
- return value.addr;
- else
- return "";
-}
-
-/*******************************************************************************
- *
- * The following routines are not attribute routines, but are rather
- * spooler interface functions. They should presumably move to
- * a SpoolerIf.c of some similarly named file.
- *
- ******************************************************************************/
-#include <locale.h>
-
-static char serverAttrStr[] = "*document-attributes-supported: copy-count\n\
-*job-attributes-supported: job-name job-owner\
- notification-profile xp-spooler-command-options\n\
-*multiple-documents-supported: False";
-
-XrmDatabase
-XpSpoolerGetServerAttributes(void)
-{
- char *totalAttrs, *localeName;
- XrmDatabase db;
-
- localeName = setlocale(LC_CTYPE, (char *)NULL);
- if(!localeName || strlen(localeName) == 0)
- localeName = "C";
-
- if((totalAttrs = (char *)xalloc(strlen(serverAttrStr) + strlen(localeName)
- + 11)) == (char *)NULL)
- return (XrmDatabase)NULL;
- sprintf(totalAttrs, "%s\n%s\t%s", serverAttrStr, "*locale:", localeName);
-
- db = XrmGetStringDatabase(totalAttrs);
- xfree(totalAttrs);
- return db;
-}
-
-/*
- * SendFileToCommand takes three character pointers - the file name,
- * the command to execute,
- * and the "argv" style NULL-terminated vector of arguments for the command.
- * The command is exec'd, and the file contents are sent to the command
- * via stdin.
- *
- * WARNING: This function will try to adopt the userId of the supplied
- * user name prior to exec'ing the supplied command.
- */
-static void
-SendFileToCommand(
- char *fileName,
- char *pCommand,
- char **argVector,
- char *userName)
-{
- pid_t childPid;
- int pipefd[2];
- int status;
- struct stat statBuf;
- FILE *fp, *outPipe;
-
- if(pipe(pipefd))
- return;
-
- if(stat(fileName, &statBuf) < 0 || (int)statBuf.st_size == 0)
- {
- close(pipefd[0]);
- close(pipefd[1]);
- return;
- }
-
- fp = fopen(fileName, "r");
- if(fp == (FILE *)NULL)
- {
- close(pipefd[0]);
- close(pipefd[1]);
- return;
- }
-
- if((childPid = fork()) == 0)
- {
- close(pipefd[1]);
- close(0);
- dup(pipefd[0]);
- close(pipefd[0]);
-
- /*
- * If a user name is specified, try to set our uid to match that
- * user name. This is to allow e.g. a banner page to show the
- * name of the printing user rather than the user who started
- * the print server.
- */
- if(userName)
- {
- if(geteuid() == (uid_t)0)
- {
- struct passwd *pPasswd;
-
- if((pPasswd = getpwnam(userName)))
- {
- setuid((uid_t)pPasswd->pw_uid);
- }
- }
- }
- /* return BadAlloc? */
- if (execv(pCommand, argVector) == -1) {
- FatalError("unable to exec '%s'", pCommand);
- }
- }
- else
- {
- (void) close(pipefd[0]);
-
- outPipe = fdopen(pipefd[1], "w");
- (void) TransferBytes(fp, outPipe, (int)statBuf.st_size);
-
- (void) fclose(outPipe);
- (void) fclose(fp);
-
- (void) waitpid(childPid, &status, 0);
- }
- return;
-}
-
-/*
- * ReplaceAllKeywords causes all the predefined keywords (e.g. %options%)
- * to be replaced with the appropriate values derived from the attribute
- * store for the supplied print context. The ReplaceAnyString utility
- * routine is used to perform the actual replacements.
- */
-
-static char *
-ReplaceAllKeywords(
- XpContextPtr pContext,
- char *command)
-{
- char *cmdOpt;
-
- cmdOpt = XpGetOneAttribute(pContext, XPPrinterAttr,
- "xp-spooler-printer-name");
- if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0)
- command = ReplaceAnyString(command, "%printer-name%", cmdOpt);
- else
- command = ReplaceAnyString(command, "%printer-name%",
- pContext->printerName);
-
- cmdOpt = XpGetOneAttribute(pContext, XPDocAttr, "copy-count");
- if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0)
- command = ReplaceAnyString(command, "%copy-count%", cmdOpt);
- else
- command = ReplaceAnyString(command, "%copy-count%", "1");
-
- cmdOpt = XpGetOneAttribute(pContext, XPJobAttr, "job-name");
- if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0)
- command = ReplaceAnyString(command, "%job-name%", cmdOpt);
- else
- command = ReplaceAnyString(command, "%job-name%", "");
-
- cmdOpt = XpGetOneAttribute(pContext, XPJobAttr, "job-owner");
- if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0)
- command = ReplaceAnyString(command, "%job-owner%", cmdOpt);
- else
- command = ReplaceAnyString(command, "%job-owner%", "");
-
- cmdOpt = XpGetOneAttribute(pContext, XPJobAttr,
- "xp-spooler-command-options");
- if(cmdOpt != (char *)NULL && strlen(cmdOpt) != 0)
- command = ReplaceAnyString(command, "%options%", cmdOpt);
- else
- command = ReplaceAnyString(command, "%options%", "");
-
- return command;
-}
-
-#ifdef __QNX__
-#define toascii( c ) ((unsigned)(c) & 0x007f)
-#endif
-
-#if defined(CSRG_BASED) || \
- defined(linux) || \
- defined(__CYGWIN__) || \
- (defined(sun) && !defined(SVR4)) || \
- (defined(SVR4) && !defined(sun) && !defined(USL)) || \
- defined(__UNIXOS2__) || \
- defined(ISC) || \
- defined(Lynx) || \
- defined(__QNX__) || \
- defined(__DARWIN__)
-#define iswspace(c) (isascii(c) && isspace(toascii(c)))
-#endif
-
-/*
- * GetToken - takes in a string and returns a malloc'd copy of the
- * first non-white-space sequence of characters in the string.
- * It returns the number of _bytes_ (NOT characters) parsed through
- * the inStr to get to the end of the returned token.
- */
-static int
-GetToken(
- char *inStr,
- char **outStr)
-{
- size_t mbCurMax = MB_CUR_MAX;
- wchar_t curChar;
- int i, numBytes, byteLen = strlen(inStr);
- char *tok;
-
- /*
- * read through any leading white space.
- */
- for(i = 0, numBytes = 0; i < byteLen; i += numBytes)
- {
- numBytes = mbtowc(&curChar, &inStr[i], mbCurMax);
- if(!iswspace(curChar))
- break;
- }
- tok = inStr + i;
-
- /*
- * find the end of the token.
- */
- byteLen = strlen(tok);
- for(i = 0, numBytes = 0; i < byteLen; i += numBytes)
- {
- numBytes = mbtowc(&curChar, &tok[i], mbCurMax);
- if(iswspace(curChar))
- break;
- }
-
- if((*outStr = (char *)xalloc(i + 1)) == (char *)NULL)
- return 0;
- strncpy(*outStr, tok, i);
- (*outStr)[i] = (char)'\0';
- return (tok + i) - inStr;
-}
-
-static void
-FreeVector(
- char **vector)
-{
- int i;
-
- if(vector == (char **)NULL) return;
-
- for(i = 0; vector[i] != (char *)NULL; i++)
- xfree(vector[i]);
- xfree(vector);
-}
-
-
-/*
- * AddVector appends the pAddition arg vector to the pTarget arg vector.
- * If the pTarget cannot be realloc'd, then pTarget is set to NULL.
- */
-static void
-AddVector(
- char ***pTarget,
- char **pAddition)
-{
- int numTarget, numAdd, i;
-
- for(numTarget = 0; (*pTarget)[numTarget] != (char *)NULL; numTarget++)
- ;
- for(numAdd = 0; pAddition[numAdd] != (char *)NULL; numAdd++)
- ;
-
- *pTarget = (char **)xrealloc((void *)*pTarget, (numTarget + numAdd + 1) *
- sizeof(char *));
- if(*pTarget == (char **)NULL)
- return;
- for(i = 0; i < numAdd; i++)
- (*pTarget)[numTarget + i] = pAddition[i];
-
- (*pTarget)[numTarget + numAdd] = (char *)NULL;
-}
-
-static char **
-BuildArgVector(
- char *argString,
- XpContextPtr pContext)
-{
- char **pVector;
- char *curTok;
- int numChars, i;
- static int beenHere = 0; /* prevent recursion on embedded %options%
- */
-
- pVector = (char **)xalloc(sizeof(char *));
- pVector[0] = (char *)NULL;
- for(i = 0; (numChars = GetToken(argString, &curTok)) != 0;
- i++, argString += numChars)
- {
- if(beenHere || strcmp(curTok, "%options%"))
- {
- if(curTok[0] == (char)'\0')
- {
- xfree(curTok);
- }
- else
- {
- pVector = (char **)xrealloc((void *)pVector,
- (i + 2)*sizeof(char *));
- if(pVector == (char **)NULL)
- return (char **)NULL;
- pVector[i] = curTok;
- pVector[i + 1] = (char *)NULL;
- }
- }
- else if(!beenHere)
- {
- char **optionsVec;
-
- curTok = ReplaceAllKeywords(pContext, curTok);
- beenHere = 1;
- optionsVec = BuildArgVector(curTok, pContext);
- xfree(curTok);
- beenHere = 0;
- AddVector(&pVector, optionsVec);
- xfree(optionsVec);
- }
- }
- if(numChars == 0 && curTok != (char *)NULL)
- xfree(curTok);
- return pVector;
-}
-
-/*
- * VectorizeCommand takes a string and breaks it into a command name and
- * an array of character pointers suitable for handing to execv. The
- * array is NULL-terminated.
- * The returned char * is the command name, and should be freed when no
- * longer needed. The array elements returned in the pVector parameter
- * should be individually freed, and the array itself should also be
- * freed when no longer needed.
- */
-static char *
-VectorizeCommand(
- char *command,
- char ***pVector,
- XpContextPtr pContext)
-{
- char *cmdName;
-
- if(command == (char *)NULL)
- return (char *)NULL;
-
- (void) GetToken(command, &cmdName);
-
- if(cmdName == (char *)NULL)
- return (char *)NULL;
-
- *pVector = BuildArgVector(command, pContext);
-
- return cmdName;
-}
-
-#ifdef hpux
-static char DEFAULT_SPOOL_COMMAND[] = "/usr/bin/lp -d %printer-name% -o raw -n %copy-count% -t %job-name% %options%";
-#else
-static char DEFAULT_SPOOL_COMMAND[] = "/usr/bin/lp -d %printer-name% -n %copy-count% -t %job-name% %options%";
-#endif
-
-int
-XpSubmitJob(
- char *fileName,
- XpContextPtr pContext)
-{
- char **vector, *cmdNam, *command, *userName;
- int i;
-
- command = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-spooler-command");
- if(command == (char *)NULL || strlen(command) == 0)
- command = strdup(DEFAULT_SPOOL_COMMAND);
- else
- command = strdup(command);
- if(command == (char *)NULL)
- return BadAlloc;
-
- cmdNam = VectorizeCommand(command, &vector, pContext);
- xfree(command);
-
- if(cmdNam == (char *)NULL)
- return BadAlloc;
-
- for(i = 0; vector[i] != (char *)NULL; i++)
- {
- vector[i] = ReplaceAllKeywords(pContext, vector[i]);
- if(vector[i] == (char *)NULL)
- {
- xfree(cmdNam);
- for(i = 0; vector[i] != (char *)NULL; i++)
- xfree(vector[i]);
- xfree(vector);
- return BadAlloc;
- }
- }
-
- userName = XpGetOneAttribute(pContext, XPJobAttr, "job-owner");
- if(userName != (char *)NULL && strlen(userName) == 0)
- userName = (char *)NULL;
-
- SendFileToCommand(fileName, cmdNam, vector, userName);
-
- FreeVector(vector);
- xfree(cmdNam);
- return Success;
-}
-
-/*
- * SearchInputTrays()
- *
- * Given a tray, return the medium in the tray. Conversely, given a
- * medium, return a tray in which it can be found. In either case,
- * return NULL if the given tray or medium cannot be found.
- */
-#define TRAY 0
-#define MEDIUM 1
-
-static char *
-SearchInputTrays(XpContextPtr pCon,
- int which,
- char *val)
-{
- char *inputTraysMedium, tray[80], medium[80], *copy;
- char *pS, *pE, *pLast;
-
- inputTraysMedium = XpGetOneAttribute( pCon, XPPrinterAttr,
- "input-trays-medium" );
-
- copy = strdup( inputTraysMedium );
- pS = copy;
- pLast = copy + strlen( copy );
-
- while( pS < pLast )
- {
- while( *pS && *pS != '{' )
- pS++;
-
- pE = ++pS;
- while( *pE && *pE != '}' )
- pE++;
- *pE = '\0';
-
- sscanf( pS, "%s %s", tray, medium );
-
- if( which == MEDIUM && !strcmp( val, medium ) )
- {
- xfree( copy );
- return strdup( tray );
- }
-
- if( which == TRAY && !strcmp( val, tray ) )
- {
- xfree( copy );
- return strdup( medium );
- }
-
- pS = pE + 1;
- }
-
- xfree( copy );
- return strdup( NULL_STRING );
-}
-
-/*
- * XpGetTrayMediumFromContext()
- *
- * Given a print context, hit the input-trays-medium,
- * default-input-tray and default-medium attributes to find the
- * appropriate tray to use, and the medium in that tray.
- */
-void
-XpGetTrayMediumFromContext(XpContextPtr pCon,
- char **medium,
- char **tray)
-{
- char *defMedium, *defTray;
- char *t, *m;
-
- defMedium = XpGetOneAttribute( pCon, XPPageAttr,
- "default-medium" );
- if( *defMedium == '\0' )
- defMedium = XpGetOneAttribute( pCon, XPDocAttr,
- "default-medium" );
-
- defTray = XpGetOneAttribute( pCon, XPPageAttr,
- "default-input-tray" );
- if( *defTray == '\0' )
- defTray = XpGetOneAttribute( pCon, XPDocAttr,
- "default-input-tray" );
-
- /*
- * First, check to see if the default tray has the default medium
- * installed. This is the ideal case.
- */
- m = SearchInputTrays( pCon, TRAY, defTray );
- if( !strcmp( m, defMedium ) )
- {
- xfree( m );
- *tray = strdup( defTray );
- *medium = strdup( defMedium );
- return;
- }
-
- /*
- * If the default tray doesn't have the default medium, search for
- * a tray which has the default medium.
- */
- t = SearchInputTrays( pCon, MEDIUM, defMedium );
- if( t )
- {
- *tray = t;
- *medium = strdup( defMedium );
- return;
- }
-
- /*
- * If all else fails, just return the default tray, and whatever
- * medium happens to be there. Note that we simply return
- * whatever is in the attribute store. Any further correction is
- * left up to the DDX driver.
- */
- *tray = strdup( defTray );
- *medium = m;
- xfree( t );
-}
diff --git a/Xprint/attributes.h b/Xprint/attributes.h
deleted file mode 100644
index d9d551f32..000000000
--- a/Xprint/attributes.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* $Xorg: attributes.h,v 1.4 2001/03/14 18:42:44 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/attributes.h,v 1.6 2001/12/21 21:02:05 dawes Exp $ */
-
-#ifndef _Xp_attributes_h
-#define _Xp_attributes_h 1
-
-#include "scrnintstr.h"
-#include "AttrValid.h"
-
-#define BFuncArgs int ndx, ScreenPtr pScreen, int argc, char **argv
-typedef Bool (*pBFunc)(BFuncArgs);
-
-#define VFuncArgs char *name, XpValidatePoolsRec *pValRec, float *width, float *height, int *res
-typedef void (*pVFunc)(VFuncArgs);
-
-/*
- * attributes.c
- */
-void XpInitAttributes(XpContextPtr pContext);
-void XpBuildAttributeStore(char *printerName,
- char *qualifierName);
-void XpAddPrinterAttribute(char *printerName,
- char *printerQualifier,
- char *attributeName,
- char *attributeValue);
-void XpDestroyAttributes(XpContextPtr pContext);
-char *XpGetConfigDir(Bool useLocale);
-char *XpGetOneAttribute(XpContextPtr pContext,
- XPAttributes class,
- char *attributeName);
-void XpPutOneAttribute(XpContextPtr pContext,
- XPAttributes class,
- const char* attributeName,
- const char* value);
-int XpRehashAttributes(void);
-char *XpGetAttributes(XpContextPtr pContext,
- XPAttributes class);
-int XpAugmentAttributes(XpContextPtr pContext,
- XPAttributes class,
- char *attributes);
-int XpSetAttributes(XpContextPtr pContext,
- XPAttributes class,
- char *attributes);
-const char *XpGetPrinterAttribute(const char *printerName,
- const char *attribute);
-void XpGetTrayMediumFromContext(XpContextPtr pCon,
- char **medium,
- char **tray);
-int XpSubmitJob(char *fileName, XpContextPtr pContext);
-
-/*
- * mediaSizes.c
- */
-int XpGetResolution(XpContextPtr pContext);
-XpOid XpGetContentOrientation(XpContextPtr pContext);
-XpOid XpGetAvailableCompression(XpContextPtr pContext);
-XpOid XpGetPlex(XpContextPtr pContext);
-XpOid XpGetPageSize(XpContextPtr pContext,
- XpOid* pTray,
- const XpOidMediumSS* msss);
-void XpGetMediumMillimeters(XpOid page_size,
- float *width,
- float *height);
-void XpGetMediumDimensions(XpContextPtr pContext,
- unsigned short *width,
- unsigned short *height);
-void XpGetReproductionArea(XpContextPtr pContext,
- xRectangle *pRect);
-void XpGetMaxWidthHeightRes(const char *printer_name,
- const XpValidatePoolsRec* vpr,
- float *width,
- float *height,
- int* resolution);
-
-/* Util.c */
-char * ReplaceAnyString(char *string,
- char *target,
- char *replacement);
-char * ReplaceFileString(char *string,
- char *inFileName,
- char *outFileName);
-void ExecCommand(char *pCommand,
- char **argVector);
-int TransferBytes(FILE *pSrcFile,
- FILE *pDstFile,
- int numBytes);
-Bool CopyContentsAndDelete(FILE **ppSrcFile,
- char **pSrcFileName,
- FILE *pDstFile);
-int XpSendDocumentData(ClientPtr client,
- FILE *fp,
- int fileLen,
- int maxBufSize);
-int XpFinishDocData(ClientPtr client);
-Bool XpOpenTmpFile(char *mode,
- char **fname,
- FILE **stream);
-
-#endif /* _Xp_attributes_h */
diff --git a/Xprint/ddxInit.c b/Xprint/ddxInit.c
deleted file mode 100644
index 3d29fd1b1..000000000
--- a/Xprint/ddxInit.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/* $Xorg: ddxInit.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/ddxInit.c,v 1.15 2003/06/23 17:35:44 eich Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "windowstr.h"
-#include "servermd.h"
-#include "Xos.h"
-#include "DiPrint.h"
-
-/*-
- *-----------------------------------------------------------------------
- * InitOutput --
- * If this is built as a print-only server, then we must supply
- * an InitOutput routine. If a normal server's real ddx InitOutput
- * is used, then it should call PrinterInitOutput if it so desires.
- * The ddx-level hook is needed to allow the printer stuff to
- * create additional screens. An extension can't reliably do
- * this for two reasons:
- *
- * 1) If InitOutput doesn't create any screens, then main()
- * exits before calling InitExtensions().
- *
- * 2) Other extensions may rely on knowing about all screens
- * when they initialize, and we can't guarantee the order
- * of extension initialization.
- *
- * Results:
- * ScreenInfo filled in, and PrinterInitOutput is called to create
- * the screens associated with printers.
- *
- * Side Effects:
- * None
- *
- *-----------------------------------------------------------------------
- */
-
-void
-InitOutput(
- ScreenInfo *pScreenInfo,
- int argc,
- char **argv)
-{
- pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
-
- pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput */
- screenInfo.numVideoScreens = 0;
-#ifdef PRINT_ONLY_SERVER
- PrinterInitOutput(pScreenInfo, argc, argv);
-#endif
-}
-
-static void
-BellProc(
- int volume,
- DeviceIntPtr pDev)
-{
- return;
-}
-
-static void
-KeyControlProc(
- DeviceIntPtr pDev,
- KeybdCtrl *ctrl)
-{
- return;
-}
-
-static KeySym printKeyMap[256];
-static CARD8 printModMap[256];
-
-static int
-KeyboardProc(
- DevicePtr pKbd,
- int what,
- int argc,
- char *argv[])
-{
- KeySymsRec keySyms;
-
- keySyms.minKeyCode = 8;
- keySyms.maxKeyCode = 8;
- keySyms.mapWidth = 1;
- keySyms.map = printKeyMap;
-
- switch(what)
- {
- case DEVICE_INIT:
- InitKeyboardDeviceStruct(pKbd, &keySyms, printModMap,
- (BellProcPtr)BellProc,
- KeyControlProc);
- break;
- case DEVICE_ON:
- break;
- case DEVICE_OFF:
- break;
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
-
-#include "../mi/mipointer.h"
-static int
-PointerProc(
- DevicePtr pPtr,
- int what,
- int argc,
- char *argv[])
-{
-#define NUM_BUTTONS 1
- CARD8 map[NUM_BUTTONS];
-
- switch(what)
- {
- case DEVICE_INIT:
- {
- map[0] = 0;
- InitPointerDeviceStruct(pPtr, map, NUM_BUTTONS,
- miPointerGetMotionEvents,
- (PtrCtrlProcPtr)_XpVoidNoop,
- miPointerGetMotionBufferSize());
- break;
- }
- case DEVICE_ON:
- break;
- case DEVICE_OFF:
- break;
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
-
-void
-InitInput(
- int argc,
- char **argv)
-{
- DeviceIntPtr ptr, kbd;
-
- ptr = AddInputDevice((DeviceProc)PointerProc, TRUE);
- kbd = AddInputDevice((DeviceProc)KeyboardProc, TRUE);
- RegisterPointerDevice(ptr);
- RegisterKeyboardDevice(kbd);
- return;
-}
-
-
-Bool
-LegalModifier(
- unsigned int key,
- DevicePtr dev)
-{
- return TRUE;
-}
-
-void
-ProcessInputEvents(void)
-{
-}
-
-#ifdef __DARWIN__
-void
-DarwinHandleGUI(int argc, char *argv[])
-{
-}
-#endif
-
-#ifdef DDXOSINIT
-void
-OsVendorInit(void)
-{
-}
-#endif
-
-#ifdef DDXOSFATALERROR
-void
-OsVendorFatalError(void)
-{
-}
-#endif
-
-#ifdef DDXTIME
-CARD32
-GetTimeInMillis(void)
-{
- struct timeval tp;
-
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
-}
-#endif
-
-/****************************************
-* ddxUseMsg()
-*
-* Called my usemsg from os/utils/c
-*
-*****************************************/
-
-void ddxUseMsg(void)
-{
- /* Right now, let's just do nothing */
-}
-
-void AbortDDX (void)
-{
-}
-
-void ddxGiveUp(void) /* Called by GiveUp() */
-{
-}
-
-int
-ddxProcessArgument (
- int argc,
- char *argv[],
- int i)
-{
-#ifdef PRINT_ONLY_SERVER
- return XprintOptions(argc, argv, i) - i;
-#else
- return(0);
-#endif
-}
-
-#ifdef XINPUT
-
-#include "XI.h"
-#include "XIproto.h"
-#include "XIstubs.h"
-
-extern int BadDevice;
-
-int
-ChangePointerDevice (
- DeviceIntPtr old_dev,
- DeviceIntPtr new_dev,
- unsigned char x,
- unsigned char y)
-{
- return (BadDevice);
-}
-
-int
-ChangeDeviceControl (
- register ClientPtr client,
- DeviceIntPtr dev,
- xDeviceCtl *control)
-{
- return BadMatch;
-}
-
-void
-OpenInputDevice (
- DeviceIntPtr dev,
- ClientPtr client,
- int *status)
-{
- return;
-}
-
-void
-AddOtherInputDevices (void)
-{
- return;
-}
-
-void
-CloseInputDevice (
- DeviceIntPtr dev,
- ClientPtr client)
-{
- return;
-}
-
-int
-ChangeKeyboardDevice (
- DeviceIntPtr old_dev,
- DeviceIntPtr new_dev)
-{
- return (Success);
-}
-
-int
-SetDeviceMode (
- register ClientPtr client,
- DeviceIntPtr dev,
- int mode)
-{
- return BadMatch;
-}
-
-int
-SetDeviceValuators (
- register ClientPtr client,
- DeviceIntPtr dev,
- int *valuators,
- int first_valuator,
- int num_valuators)
-{
- return BadMatch;
-}
-
-
-#endif /* XINPUT */
-
-#ifdef XTESTEXT1
-
-void
-XTestJumpPointer(int x, int y, int dev)
-{
- return;
-}
-
-void
-XTestGetPointerPos(int x, int y)
-{
- return;
-}
-
-void
-XTestGenerateEvent(int dev, int keycode, int keystate, int x, int y)
-{
- return;
-}
-
-#endif /* XTESTEXT1 */
-
-#ifdef AIXV3
-/*
- * This is just to get the server to link on AIX, where some bits
- * that should be in os/ are instead in hw/ibm.
- */
-int SelectWaitTime = 10000; /* usec */
-#endif
diff --git a/Xprint/mediaSizes.c b/Xprint/mediaSizes.c
deleted file mode 100644
index 7bb08b412..000000000
--- a/Xprint/mediaSizes.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/* $Xorg: mediaSizes.c,v 1.4 2001/03/14 18:44:37 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/mediaSizes.c,v 1.5 2001/12/21 21:02:05 dawes Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: mediaSizes.c
-** *
-** * Contents:
-** * Routines to return the sizes associated
-** * with particular media and particular printers.
-** *
-** * Created: 2/19/96
-** *
-** * Copyright: Copyright 1993,1995 Hewlett-Packard Company
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <locale.h>
-
-#include "X.h"
-#include "dixstruct.h"
-#include "screenint.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "fontstruct.h"
-
-#include "DiPrint.h"
-#include "attributes.h"
-
-typedef struct {
- XpOid page_size;
- float width;
- float height;
-} PageDimensionsRec;
-
-static PageDimensionsRec PageDimensions[] =
-{
- {xpoid_val_medium_size_na_letter, 215.9, 279.4},
- {xpoid_val_medium_size_na_legal, 215.9, 355.6},
- {xpoid_val_medium_size_executive, 184.15, 266.7},
- {xpoid_val_medium_size_folio, 210.82, 330.2},
- {xpoid_val_medium_size_invoice, 139.7, 215.9},
- {xpoid_val_medium_size_ledger, 279.4, 431.8},
- {xpoid_val_medium_size_quarto, 215.9, 275.082},
- {xpoid_val_medium_size_a, 215.9, 279.4},
- {xpoid_val_medium_size_b, 279.4, 431.8},
- {xpoid_val_medium_size_c, 431.8, 558.8},
- {xpoid_val_medium_size_d, 558.8, 863.6},
- {xpoid_val_medium_size_e, 863.6, 1117.6},
- {xpoid_val_medium_size_na_6x9_envelope, 152.4, 228.6},
- {xpoid_val_medium_size_na_10x15_envelope, 254, 381},
- {xpoid_val_medium_size_monarch_envelope, 98.298, 190.5},
- {xpoid_val_medium_size_na_10x13_envelope, 254, 330.2},
- {xpoid_val_medium_size_na_9x12_envelope, 228.6, 304.8},
- {xpoid_val_medium_size_na_number_10_envelope, 104.775, 241.3},
- {xpoid_val_medium_size_na_7x9_envelope, 177.8, 228.6},
- {xpoid_val_medium_size_na_9x11_envelope, 228.6, 279.4},
- {xpoid_val_medium_size_na_10x14_envelope, 254, 355.6},
- {xpoid_val_medium_size_na_number_9_envelope, 98.425, 225.425},
- {xpoid_val_medium_size_iso_a0, 841, 1189},
- {xpoid_val_medium_size_iso_a1, 594, 841},
- {xpoid_val_medium_size_iso_a2, 420, 594},
- {xpoid_val_medium_size_iso_a3, 297, 420},
- {xpoid_val_medium_size_iso_a4, 210, 297},
- {xpoid_val_medium_size_iso_a5, 148, 210},
- {xpoid_val_medium_size_iso_a6, 105, 148},
- {xpoid_val_medium_size_iso_a7, 74, 105},
- {xpoid_val_medium_size_iso_a8, 52, 74},
- {xpoid_val_medium_size_iso_a9, 37, 52},
- {xpoid_val_medium_size_iso_a10, 26, 37},
- {xpoid_val_medium_size_iso_b0, 1000, 1414},
- {xpoid_val_medium_size_iso_b1, 707, 1000},
- {xpoid_val_medium_size_iso_b2, 500, 707},
- {xpoid_val_medium_size_iso_b3, 353, 500},
- {xpoid_val_medium_size_iso_b4, 250, 353},
- {xpoid_val_medium_size_iso_b5, 176, 250},
- {xpoid_val_medium_size_iso_b6, 125, 176},
- {xpoid_val_medium_size_iso_b7, 88, 125},
- {xpoid_val_medium_size_iso_b8, 62, 88},
- {xpoid_val_medium_size_iso_b9, 44, 62},
- {xpoid_val_medium_size_iso_b10, 31, 44},
- {xpoid_val_medium_size_jis_b0, 1030, 1456},
- {xpoid_val_medium_size_jis_b1, 728, 1030},
- {xpoid_val_medium_size_jis_b2, 515, 728},
- {xpoid_val_medium_size_jis_b3, 364, 515},
- {xpoid_val_medium_size_jis_b4, 257, 364},
- {xpoid_val_medium_size_jis_b5, 182, 257},
- {xpoid_val_medium_size_jis_b6, 128, 182},
- {xpoid_val_medium_size_jis_b7, 91, 128},
- {xpoid_val_medium_size_jis_b8, 64, 91},
- {xpoid_val_medium_size_jis_b9, 45, 64},
- {xpoid_val_medium_size_jis_b10, 32, 45},
- {xpoid_val_medium_size_iso_c3, 324, 458},
- {xpoid_val_medium_size_iso_c4, 229, 324},
- {xpoid_val_medium_size_iso_c5, 162, 229},
- {xpoid_val_medium_size_iso_c6, 114, 162},
- {xpoid_val_medium_size_iso_designated_long, 110, 220}
-};
-
-/*
- * XpGetResolution returns an integer representing the printer resolution
- * in dots-per-inch for the specified print context.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-int
-XpGetResolution(XpContextPtr pContext)
-{
- unsigned long resolution;
-
- resolution = XpGetCardAttr(pContext, XPPageAttr,
- xpoid_att_default_printer_resolution,
- (XpOidCardList*)NULL);
- if(0 == resolution)
- resolution = XpGetCardAttr(pContext, XPDocAttr,
- xpoid_att_default_printer_resolution,
- (XpOidCardList*)NULL);
- if(0 == resolution)
- {
- XpOidCardList* resolutions_supported;
- /*
- * default-printer-resolution not specified; default to 1st entry
- * in printer-resolutions-supported.
- */
- resolutions_supported =
- XpGetCardListAttr(pContext, XPPrinterAttr,
- xpoid_att_printer_resolutions_supported,
- (XpOidCardList*)NULL);
- resolution = XpOidCardListGetCard(resolutions_supported, 0);
- XpOidCardListDelete(resolutions_supported);
- }
- return (int)resolution;
-}
-
-/*
- * XpGetContentOrientation determines the content-orientation as
- * determined by the passed context. The page and document pools are
- * queried in turn for a specified content-orientation attribute. If none
- * is found the first content-orientation in the
- * content-orientations-supported printer attribute is taken as the
- * default.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-XpOid
-XpGetContentOrientation(XpContextPtr pContext)
-{
- XpOid orientation;
-
- orientation = XpGetOidAttr(pContext, XPPageAttr,
- xpoid_att_content_orientation,
- (XpOidList*)NULL);
- if(xpoid_none == orientation)
- orientation = XpGetOidAttr(pContext, XPDocAttr,
- xpoid_att_content_orientation,
- (XpOidList*)NULL);
- if(xpoid_none == orientation)
- {
- XpOidList* content_orientations_supported;
-
- content_orientations_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_content_orientations_supported,
- (XpOidList*)NULL);
- orientation = XpOidListGetOid(content_orientations_supported, 0);
- XpOidListDelete(content_orientations_supported);
- }
- return orientation;
-}
-
-/*
- * XpGetAvailableCompression determines the available-compression as
- * determined by the passed context. The page and document pools are
- * queried in turn for a specified content-orientation attribute. If none
- * is found the first available-compression in the
- * avaiable-compressions-supported printer attribute is taken as the
- * default.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-XpOid
-XpGetAvailableCompression(
- XpContextPtr pContext)
-{
- XpOid compression;
-
- compression = XpGetOidAttr(pContext, XPPageAttr,
- xpoid_att_available_compression,
- (XpOidList*)NULL);
- if(xpoid_none == compression)
- compression = XpGetOidAttr(pContext, XPDocAttr,
- xpoid_att_available_compression,
- (XpOidList*)NULL);
- if(xpoid_none == compression)
- {
- XpOidList* available_compressions_supported;
-
- available_compressions_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_available_compressions_supported,
- (XpOidList*)NULL);
- compression = XpOidListGetOid(available_compressions_supported, 0);
- XpOidListDelete(available_compressions_supported);
- }
- return compression;
-}
-
-/*
- * XpGetPlex determines the plex as determined by the passed context. The page
- * and document pools are queried in turn for a specified plex attribute. If
- * none is found the first plex in the plexes-supported printer attribute is
- * taken as the default.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-XpOid
-XpGetPlex(
- XpContextPtr pContext)
-{
- XpOid plex;
-
- plex = XpGetOidAttr(pContext, XPPageAttr, xpoid_att_plex,
- (XpOidList*)NULL);
- if(xpoid_none == plex)
- plex = XpGetOidAttr(pContext, XPDocAttr, xpoid_att_plex,
- (XpOidList*)NULL);
- if(xpoid_none == plex)
- {
- XpOidList* plexes_supported;
-
- plexes_supported =
- XpGetListAttr(pContext, XPPrinterAttr,
- xpoid_att_plexes_supported,
- (XpOidList*)NULL);
- plex = XpOidListGetOid(plexes_supported, 0);
- XpOidListDelete(plexes_supported);
- }
- return plex;
-}
-
-/*
- * XpGetPageSize returns the XpOid of the current page size (medium names
- * are page sizes in this implementation) as indicated by the passed
- * context.
- *
- * The relevant input-tray is returned in pTray. This parm must not be
- * NULL. If the input-tray is not indicated or irrelevant, xpoid_none
- * will be returned.
- *
- * This function optionally takes a XpOidMediumSS representation of the
- * medium-source-sizes-supported attribute in order to avoid parsing the
- * string value twice for calling functions that need to parse m-s-s-s
- * anyway (e.g. XpGetReproductionArea). If the caller has no other reason
- * to parse medium-source-sizes-supported, it is recommended that NULL be
- * passed. This function will obtain medium-source-sizes-supported if it
- * needs to.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-XpOid
-XpGetPageSize(XpContextPtr pContext,
- XpOid* pTray,
- const XpOidMediumSS* msss)
-{
- XpOid medium;
- /*
- * check to see if default-medium is specified
- */
- medium = XpGetOidAttr(pContext, XPPageAttr, xpoid_att_default_medium,
- (const XpOidList*)NULL);
- if(medium == xpoid_none)
- {
- /*
- * default-medium not in page pool; try the document pool
- */
- medium = XpGetOidAttr(pContext, XPDocAttr, xpoid_att_default_medium,
- (const XpOidList*)NULL);
- }
- if(medium == xpoid_none)
- {
- /*
- * default-medium not specified; try default-input-tray
- */
- *pTray = XpGetOidAttr(pContext, XPPageAttr,
- xpoid_att_default_input_tray,
- (const XpOidList*)NULL);
- if(*pTray == xpoid_none)
- {
- /*
- * default-input-tray not in page pool; try the document pool
- */
- *pTray = XpGetOidAttr(pContext, XPDocAttr,
- xpoid_att_default_input_tray,
- (const XpOidList*)NULL);
- }
- if(*pTray != xpoid_none)
- {
- /*
- * default-input-tray found; get corresponding medium from
- * input-trays-medium
- */
- XpOidTrayMediumList* input_trays_medium;
- int i;
-
- input_trays_medium =
- XpGetTrayMediumListAttr(pContext, XPPrinterAttr,
- xpoid_att_input_trays_medium,
- (const XpOidList*)NULL,
- (const XpOidMediumSS*)NULL);
- for(i = 0; i < XpOidTrayMediumListCount(input_trays_medium); i++)
- {
- if(*pTray == XpOidTrayMediumListTray(input_trays_medium, i))
- {
- medium = XpOidTrayMediumListMedium(input_trays_medium, i);
- break;
- }
- }
- XpOidTrayMediumListDelete(input_trays_medium);
- }
- }
- else
- *pTray = xpoid_none;
-
- if(medium == xpoid_none)
- {
- XpOidMediumSS* local_msss = (XpOidMediumSS*)NULL;
- int i_mss, i_ds;
- XpOidMediumDiscreteSizeList* ds_list;
- /*
- * no medium specified; use 1st page size found in
- * medium-source-sizes-supported
- */
- if((XpOidMediumSS*)NULL == msss)
- msss = local_msss =
- XpGetMediumSSAttr(pContext, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported,
- (const XpOidList*)NULL,
- (const XpOidList*)NULL);
- for(i_mss = 0;
- i_mss < XpOidMediumSSCount(msss) && xpoid_none == medium;
- i_mss++)
- {
- if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag
- &&
- xpoid_none != (msss->mss)[i_mss].input_tray)
- {
- ds_list = (msss->mss)[i_mss].ms.discrete;
- for(i_ds = 0; i_ds < ds_list->count; i_ds++)
- {
- if(xpoid_none != (ds_list->list)[i_ds].page_size)
- {
- medium = (ds_list->list)[i_ds].page_size;
- break;
- }
- }
- }
- }
- XpOidMediumSSDelete(local_msss);
- }
- return medium;
-}
-
-/*
- * XpGetMediumMillimeters returns into the supplied float pointers the
- * width and height in millimeters of the passed page size identifier.
- */
-void
-XpGetMediumMillimeters(
- XpOid page_size,
- float *width, /* return */
- float *height) /* return */
-{
- unsigned i;
-
- *width = *height = 0;
- for(i = 0; i < XpNumber(PageDimensions); i++)
- {
- if(page_size == PageDimensions[i].page_size)
- {
- *width = PageDimensions[i].width;
- *height = PageDimensions[i].height;
- return;
- }
- }
-}
-
-/*
- * Converts a millimeter specification into pixels given a resolution in
- * DPI.
- */
-static float
-MmToPixels(float mm, int resolution)
-{
- float f;
-
- f = mm * resolution;
- f /= 25.4;
- return f;
-}
-
-/*
- * XpGetMediumDimensions returns into the supplied short pointers the
- * width and height in pixels of the medium associated with the specified
- * print context. It obtains the page size associated with the current
- * medium by calling XpGetPageSize. It passes XpGetMediumMillimeters the
- * page size, and converts the returned millimeter dimensions into pixels
- * using the resolution returned by XpGetResolution.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-void
-XpGetMediumDimensions(
- XpContextPtr pContext,
- unsigned short *width, /* return */
- unsigned short *height) /* return */
-{
- XpOid page_size;
- XpOid tray;
- XpOid orientation;
-
- int resolution;
- float w_mm, h_mm;
-
- page_size = XpGetPageSize(pContext, &tray, (XpOidMediumSS*)NULL);
- if(page_size == xpoid_none)
- {
- /*
- * fail-safe: if the pools have been validated, this defaulting logic
- * isn't needed.
- */
- page_size = xpoid_val_medium_size_na_letter;
- }
- XpGetMediumMillimeters(page_size, &w_mm, &h_mm);
- resolution = XpGetResolution(pContext);
- orientation = XpGetContentOrientation(pContext);
- switch(orientation)
- {
- case xpoid_val_content_orientation_landscape:
- case xpoid_val_content_orientation_reverse_landscape:
- /*
- * transpose width and height
- */
- *height = MmToPixels(w_mm, resolution);
- *width = MmToPixels(h_mm, resolution);
- break;
-
- default:
- *width = MmToPixels(w_mm, resolution);
- *height = MmToPixels(h_mm, resolution);
- break;
- }
-}
-
-/*
- * XRectangleFromXpOidArea converts an XpOidArea area specification
- * into an XRectangle. The passed resolution is used to convert from
- * millimeters (XpOidArea) into pixels (XRectangle).
- */
-static void
-XRectangleFromXpOidArea(
- xRectangle *pRect,
- const XpOidArea* repro,
- int resolution,
- XpOid orientation)
-{
- switch(orientation)
- {
- case xpoid_val_content_orientation_landscape:
- case xpoid_val_content_orientation_reverse_landscape:
- /*
- * transpose x and y, width and height
- */
- pRect->y = MmToPixels(repro->minimum_x, resolution);
- pRect->x = MmToPixels(repro->minimum_y, resolution);
- pRect->height =
- MmToPixels(repro->maximum_x - repro->minimum_x, resolution);
- pRect->width =
- MmToPixels(repro->maximum_y - repro->minimum_y, resolution);
- break;
-
- default:
- pRect->x = MmToPixels(repro->minimum_x, resolution);
- pRect->y = MmToPixels(repro->minimum_y, resolution);
- pRect->width =
- MmToPixels(repro->maximum_x - repro->minimum_x, resolution);
- pRect->height =
- MmToPixels(repro->maximum_y - repro->minimum_y, resolution);
- break;
- }
-}
-
-/*
- * XpGetReproductionArea queries the current pool attribute values in
- * order to determine the reproduction area for the currently selected
- * medium.
- *
- * First the current page size (equivalent to current medium) and tray
- * (if specified) is retrieved via XpGetPageSize. The value of the
- * medium-source-sizes-supported attribute is interrogated until a matching
- * entry for the current page size and tray is found. The reproduction
- * area defined for the current entry is converted into an XRectangle
- * using XRectangleFromXpOidArea and returned to the caller.
- *
- * Note: This routine assumes the values found in the passed context's
- * attributes pools have been validated.
- */
-void
-XpGetReproductionArea(XpContextPtr pContext,
- xRectangle *pRect)
-{
- XpOid page_size;
- XpOid tray;
- XpOidMediumSS* msss;
- int i_mss, i_ds;
- XpOidMediumDiscreteSizeList* ds_list;
- XpOidArea* repro;
- BOOL done;
- int resolution;
- XpOid orientation;
- /*
- * find the appropriate assured reproduction area for the current
- * tray and page size in the medium-source-sizes-supported attribute.
- */
- msss = XpGetMediumSSAttr(pContext, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported,
- (const XpOidList*)NULL,
- (const XpOidList*)NULL);
- page_size = XpGetPageSize(pContext, &tray, msss);
- resolution = XpGetResolution(pContext);
- orientation = XpGetContentOrientation(pContext);
-
- memset(pRect, 0, sizeof(xRectangle));
-
- if(xpoid_none == tray)
- {
- /*
- * no tray specified; use 1st matching page size
- */
- for(i_mss = 0, done = xFalse;
- i_mss < XpOidMediumSSCount(msss) && !done;
- i_mss++)
- {
- if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag
- &&
- xpoid_none != (msss->mss)[i_mss].input_tray)
- {
- ds_list = (msss->mss)[i_mss].ms.discrete;
- for(i_ds = 0; i_ds < ds_list->count; i_ds++)
- {
- if(page_size == (ds_list->list)[i_ds].page_size)
- {
- repro =
- &(ds_list->list)[i_ds].assured_reproduction_area;
- XRectangleFromXpOidArea(pRect, repro,
- resolution, orientation);
- done = xTrue;
- break;
- }
- }
- }
- }
- }
- else
- {
- /*
- * tray && page size specified; find matching entry
- */
- for(i_mss = 0, done = xFalse;
- i_mss < XpOidMediumSSCount(msss) && !done;
- i_mss++)
- {
- if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag
- &&
- xpoid_none != (msss->mss)[i_mss].input_tray
- &&
- (tray == (msss->mss)[i_mss].input_tray
- ||
- xpoid_unspecified == (msss->mss)[i_mss].input_tray)
- )
- {
- ds_list = (msss->mss)[i_mss].ms.discrete;
- for(i_ds = 0; i_ds < ds_list->count; i_ds++)
- {
- if(page_size == (ds_list->list)[i_ds].page_size)
- {
- repro =
- &(ds_list->list)[i_ds].assured_reproduction_area;
- XRectangleFromXpOidArea(pRect, repro,
- resolution, orientation);
- if(xpoid_unspecified != (msss->mss)[i_mss].input_tray)
- {
- /*
- * exact match on tray takes precendence over
- * unspecified tray entry in m-s-s-s
- */
- done = xTrue;
- }
- break;
- }
- }
- }
- }
- }
- XpOidMediumSSDelete(msss);
-}
-
-/*
- * XpGetMaxWidthHeightRes returns into the supplied width and height
- * unsigned short pointers the dimensions in millimeters of the largest
- * supported media for a specific printer. It looks at the
- * medium-source-sizes-supported attribute (if it exists) to determine
- * the list of possible media, and calls XpGetMediumMillimeters to get the
- * dimensions for each medium. If the m-s-s-s attribute is not defined,
- * then the dimensions for the na-letter medium is returned.
- *
- * This function also returns the largest resolution in DPI defined in
- * printer-resolutions-supported. If printer-resolutions-supported is not
- * specified, the default is obtained from the passed XpValidatePoolsRec.
- *
- * The passed XpValidatePoolsRec is also used to determine valid values
- * when parsing attribute values.
- */
-void
-XpGetMaxWidthHeightRes(
- const char *printer_name,
- const XpValidatePoolsRec* vpr,
- float *width,
- float *height,
- int* resolution)
-{
- const char* value;
- const char* attr_str;
- XpOidMediumSS* pool_msss;
- const XpOidMediumSS* msss;
- int i_mss, i_ds;
- XpOidMediumDiscreteSizeList* ds_list;
- float w, h;
- XpOidCardList* pool_resolutions_supported;
- const XpOidCardList* resolutions_supported;
- int i;
- int res;
- /*
- * get the max medium width and height
- */
- attr_str = XpOidString(xpoid_att_medium_source_sizes_supported);
- value = XpGetPrinterAttribute(printer_name, attr_str);
- pool_msss = XpOidMediumSSNew(value,
- vpr->valid_input_trays,
- vpr->valid_medium_sizes);
- if(0 == XpOidMediumSSCount(pool_msss))
- msss = XpGetDefaultMediumSS();
- else
- msss = pool_msss;
- *width = *height = 0;
- for(i_mss = 0; i_mss < XpOidMediumSSCount(msss); i_mss++)
- {
- if(XpOidMediumSS_DISCRETE == (msss->mss)[i_mss].mstag
- &&
- xpoid_none != (msss->mss)[i_mss].input_tray)
- {
- ds_list = (msss->mss)[i_mss].ms.discrete;
- for(i_ds = 0; i_ds < ds_list->count; i_ds++)
- {
- if(xpoid_none != (ds_list->list)[i_ds].page_size)
- {
- XpGetMediumMillimeters((ds_list->list)[i_ds].page_size,
- &w, &h);
- if(w > *width) *width = w;
- if(h > *height) *height = h;
- }
- }
- }
- }
- XpOidMediumSSDelete(pool_msss);
- /*
- * get the maximum resolution
- */
- attr_str = XpOidString(xpoid_att_printer_resolutions_supported);
- value = XpGetPrinterAttribute(printer_name, attr_str);
- pool_resolutions_supported =
- XpOidCardListNew(value, vpr->valid_printer_resolutions_supported);
- if(0 == XpOidCardListCount(pool_resolutions_supported))
- resolutions_supported = vpr->default_printer_resolutions_supported;
- else
- resolutions_supported = pool_resolutions_supported;
- *resolution = 0;
- for(i = 0; i < XpOidCardListCount(resolutions_supported); i++)
- {
- res = XpOidCardListGetCard(resolutions_supported, i);
- if(res > *resolution) *resolution = res;
- }
- XpOidCardListDelete(pool_resolutions_supported);
-}
-
-FontResolutionPtr
-XpGetClientResolutions(ClientPtr client, int *num)
-{
- static struct _FontResolution res;
- int resolution = XpGetResolution(XpContextOfClient(client));
-
- res.x_resolution = resolution;
- res.y_resolution = resolution;
-
- res.point_size = 120;
-
- *num = 1;
-
- return &res;
-}
-
-
-void XpSetFontResFunc(ClientPtr client)
-{
- client->fontResFunc = XpGetClientResolutions;
-}
-
-
-void XpUnsetFontResFunc(ClientPtr client)
-{
- client->fontResFunc = NULL;
-}
diff --git a/Xprint/pcl/Pcl.h b/Xprint/pcl/Pcl.h
deleted file mode 100644
index 2af1b2c41..000000000
--- a/Xprint/pcl/Pcl.h
+++ /dev/null
@@ -1,621 +0,0 @@
-/* $Xorg: Pcl.h,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: Pcl.h
-** *
-** * Contents: defines and includes for the Pcl driver
-** * for a printing X server.
-** *
-** * Created: 1/30/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.13 2003/07/16 01:38:34 dawes Exp $ */
-
-#ifndef _PCL_H_
-#define _PCL_H_
-
-#include <stdio.h>
-#include "scrnintstr.h"
-
-#include "PclDef.h"
-#include "Pclmap.h"
-#include "PclSFonts.h"
-
-#include <X11/extensions/Print.h>
-#include <X11/extensions/Printstr.h>
-
-#include "regionstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-
-/*
- * Some sleazes to force the XrmDB stuff into the server
- */
-#ifndef HAVE_XPointer
-typedef char *XPointer;
-#endif
-#define Status int
-#define True 1
-#define False 0
-#include "misc.h"
-#include <X11/Xfuncproto.h>
-#include <X11/Xresource.h>
-#include "attributes.h"
-
-/******
- * externally visible variables from PclInit.c
- ******/
-extern int PclScreenPrivateIndex, PclWindowPrivateIndex;
-extern int PclContextPrivateIndex;
-extern int PclPixmapPrivateIndex;
-extern int PclGCPrivateIndex;
-
-/******
- * externally visible variables from PclAttVal.c
- ******/
-extern XpValidatePoolsRec PclValidatePoolsRec;
-
-/*
- * This structure defines a mapping from an X colormap ID to a list of
- * print contexts which use the colormap.
- */
-typedef struct _pclcontextlist {
- XpContextPtr context;
- struct _pclcontextlist *next;
-} PclContextList, *PclContextListPtr;
-
-typedef struct _pclcmaptocontexts {
- long colormapId;
- PclContextListPtr contexts;
- struct _pclcmaptocontexts *next;
-} PclCmapToContexts;
-
-typedef struct {
- PclCmapToContexts *colormaps;
- CloseScreenProcPtr CloseScreen;
-} PclScreenPrivRec, *PclScreenPrivPtr;
-
-/*
- * This structure defines a mapping from an X colormap ID to a PCL
- * palette ID.
- */
-typedef struct _palettemap {
- long colormapId;
- int paletteId;
- int downloaded;
- struct _palettemap *next;
-} PclPaletteMap, *PclPaletteMapPtr;
-
-typedef struct {
- char *jobFileName;
- FILE *pJobFile;
- char *pageFileName;
- FILE *pPageFile;
- GC lastGC;
- unsigned char *dash;
- int validGC;
- ClientPtr getDocClient;
- int getDocBufSize;
- PclSoftFontInfoPtr pSoftFontInfo;
- PclPaletteMapPtr palettes;
- int currentPalette;
- int nextPaletteId;
- PclPaletteMap staticGrayPalette;
- PclPaletteMap trueColorPalette;
- PclPaletteMap specialTrueColorPalette;
- unsigned char *ctbl;
- int ctbldim;
- int isRaw;
-#ifdef XP_PCL_LJ3
- unsigned int fcount;
- unsigned int fcount_max;
- char *figures;
-#endif /* XP_PCL_LJ3 */
-} PclContextPrivRec, *PclContextPrivPtr;
-
-typedef struct {
- int validContext;
- XpContextPtr context;
-} PclWindowPrivRec, *PclWindowPrivPtr;
-
-typedef struct {
- unsigned long stippleFg, stippleBg;
-} PclGCPrivRec, *PclGCPrivPtr;
-
-typedef struct {
- XpContextPtr context;
- char *tempFileName;
- FILE *tempFile;
- GC lastGC;
- int validGC;
-} PclPixmapPrivRec, *PclPixmapPrivPtr;
-
-/******
- * Defined functions
- ******/
-#define SEND_PCL(f,c) fwrite( c, sizeof( char ), strlen( c ), f )
-#define SEND_PCL_COUNT(f,c,n) fwrite( c, sizeof( char ), n, f )
-
-#ifndef XP_PCL_LJ3
-#define SAVE_PCL(f,p,c) SEND_PCL(f,c)
-#define SAVE_PCL_COUNT(f,p,c,n) SEND_PCL_COUNT(f,c,n)
-#define MACRO_START(f,p) SEND_PCL(f, "\033&f1Y\033&f0X")
-#define MACRO_END(f) SEND_PCL(f, "\033&f1X")
-#else
-#define SAVE_PCL(f,p,c) PclSpoolFigs(p, c, strlen(c))
-#define SAVE_PCL_COUNT(f,p,c,n) PclSpoolFigs(p, c, n)
-#define MACRO_START(f,p) p->fcount = 0
-#define MACRO_END(f) /* do nothing */
-#endif /* XP_PCL_LJ3 */
-
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/******
- * Functions in PclArc.c
- ******/
-extern void PclPolyArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs);
-extern void PclPolyFillArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs);
-
-/******
- * Functions in PclArea.c
- ******/
-extern void PclPutImage(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage);
-extern RegionPtr PclCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty);
-RegionPtr PclCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty,
- unsigned long plane);
-
-
-/******
- * Functions in PclAttr.c
- ******/
-extern char *PclGetAttributes(
- XpContextPtr pCon,
- XPAttributes pool );
-extern char *PclGetOneAttribute(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attr );
-extern int PclAugmentAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs );
-extern int PclSetAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs );
-
-/******
- * Functions in PclColor.c
- ******/
-extern Bool PclCreateDefColormap(ScreenPtr pScreen);
-extern Bool PclCreateColormap(ColormapPtr pColor);
-extern void PclDestroyColormap(ColormapPtr pColor);
-extern void PclInstallColormap(ColormapPtr pColor);
-extern void PclUninstallColormap(ColormapPtr pColor);
-extern int PclListInstalledColormaps(ScreenPtr pScreen,
- XID *pCmapList);
-extern void PclStoreColors(ColormapPtr pColor,
- int ndef,
- xColorItem *pdefs);
-extern void PclResolveColor(unsigned short *pRed,
- unsigned short *pGreen,
- unsigned short *pBlue,
- VisualPtr pVisual);
-extern int PclUpdateColormap(DrawablePtr pDrawable,
- XpContextPtr pCon,
- GCPtr gc,
- FILE *outFile);
-extern void PclLookUp(ColormapPtr cmap,
- PclContextPrivPtr cPriv,
- unsigned short *r,
- unsigned short *g,
- unsigned short *b);
-extern PclPaletteMapPtr PclFindPaletteMap(PclContextPrivPtr cPriv,
- ColormapPtr cmap,
- GCPtr gc);
-extern unsigned char *PclReadMap(char *, int *);
-
-
-/******
- * Functions in PclCursor.c
- ******/
-extern void PclConstrainCursor(
- ScreenPtr pScreen,
- BoxPtr pBox);
-extern void PclCursorLimits(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- BoxPtr pHotBox,
- BoxPtr pTopLeftbox);
-extern Bool PclDisplayCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor);
-extern Bool PclRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor);
-extern Bool PclUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor);
-extern void PclRecolorCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- Bool displayed);
-extern Bool PclSetCursorPosition(
- ScreenPtr pScreen,
- int x,
- int y,
- Bool generateEvent);
-
-/******
- * Functions in PclSFonts.c
- ******/
-extern void
-PclDownloadSoftFont8(
- FILE *fp,
- PclSoftFontInfoPtr pSoftFontInfo,
- PclFontHead8Ptr pfh,
- PclCharDataPtr pcd,
- unsigned char *code);
-extern void PclDownloadSoftFont16(
- FILE *fp,
- PclSoftFontInfoPtr pSoftFontInfo,
- PclFontHead16Ptr pfh,
- PclCharDataPtr pcd,
- unsigned char row,
- unsigned char col);
-extern PclSoftFontInfoPtr PclCreateSoftFontInfo(void);
-extern void PclDestroySoftFontInfo(
- PclSoftFontInfoPtr pSoftFontInfo );
-
-/******
- * Functions in PclGC.c
- ******/
-extern Bool PclCreateGC(GCPtr pGC);
-extern void PclDestroyGC(GCPtr pGC);
-extern int PclUpdateDrawableGC(
- GCPtr pGC,
- DrawablePtr pDrawable,
- FILE **outFile);
-extern void PclValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable);
-extern void PclSetDrawablePrivateStuff(
- DrawablePtr pDrawable,
- GC gc );
-extern int PclGetDrawablePrivateStuff(
- DrawablePtr pDrawable,
- GC *gc,
- unsigned long *valid,
- FILE **file );
-extern void PclSetDrawablePrivateGC(
- DrawablePtr pDrawable,
- GC gc);
-extern void PclComputeCompositeClip(
- GCPtr pGC,
- DrawablePtr pDrawable);
-
-/******
- * Functions in PclInit.c
- ******/
-extern Bool PclCloseScreen(
- int index,
- ScreenPtr pScreen);
-extern Bool InitializeColorPclDriver(
- int ndx,
- ScreenPtr pScreen,
- int argc,
- char **argv);
-extern Bool InitializeMonoPclDriver(
- int ndx,
- ScreenPtr pScreen,
- int argc,
- char **argv);
-extern Bool InitializeLj3PclDriver(
- int ndx,
- ScreenPtr pScreen,
- int argc,
- char **argv);
-extern XpContextPtr PclGetContextFromWindow( WindowPtr win );
-
-/******
- * Functions in PclLine.c
- ******/
-extern void PclPolyLine(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nPoints,
- xPoint *pPoints);
-extern void PclPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSegments,
- xSegment *pSegments);
-
-/******
- * Functions in PclMisc.c
- ******/
-extern void PclQueryBestSize(
- int class,
- short *pwidth,
- short *pheight,
- ScreenPtr pScreen);
-extern char *GetPropString(WindowPtr pWin, char *propName);
-extern int SystemCmd(char *cmdStr);
-extern int PclGetMediumDimensions(
- XpContextPtr pCon,
- CARD16 *pWidth,
- CARD16 *pHeight);
-extern int PclGetReproducibleArea(
- XpContextPtr pCon,
- xRectangle *pRect);
-extern void PclSendData(
- FILE *outFile,
- PclContextPrivPtr pConPriv,
- BoxPtr pbox,
- int nbox,
- double ratio);
-
-/******
- * Functions in PclPixel.c
- ******/
-extern void PclPolyPoint(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nPoints,
- xPoint *pPoints);
-extern void PclPushPixels(
- GCPtr pGC,
- PixmapPtr pBitmap,
- DrawablePtr pDrawable,
- int width,
- int height,
- int x,
- int y);
-
-/******
- * Functions in PclPixmap.c
- ******/
-extern PixmapPtr PclCreatePixmap(
- ScreenPtr pScreen,
- int width,
- int height,
- int depth);
-extern Bool PclDestroyPixmap(PixmapPtr pPixmap);
-
-/******
- * Functions in PclPolygon.c
- ******/
-extern void PclPolyRectangle(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects);
-extern void PclFillPolygon(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int nPoints,
- DDXPointPtr pPoints);
-extern void PclPolyFillRect(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects);
-
-/******
- * Functions in PclSpans.c
- ******/
-extern void PclFillSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSpans,
- DDXPointPtr pPoints,
- int *pWidths,
- int fSorted);
-extern void PclSetSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- char *pSrc,
- DDXPointPtr pPoints,
- int *pWidths,
- int nSpans,
- int fSorted);
-
-/******
- * Functions in PclText.c
- ******/
-extern int PclPolyText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *string);
-extern int PclPolyText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string);
-extern void PclImageText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *string);
-extern void PclImageText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string);
-extern void PclImageGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-extern void PclPolyGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-
-/******
- * Functions in PclWindow.c
- ******/
-extern Bool PclCreateWindow(register WindowPtr pWin);
-extern Bool PclDestroyWindow(WindowPtr pWin);
-extern Bool PclMapWindow(WindowPtr pWindow);
-extern Bool PclPositionWindow(
- register WindowPtr pWin,
- int x,
- int y);
-extern Bool PclUnmapWindow(WindowPtr pWindow);
-extern void PclCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-extern Bool PclChangeWindowAttributes(
- register WindowPtr pWin,
- register unsigned long mask);
-extern void PclPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what);
-
-/******
- * Functions in PclFonts.c
- ******/
-extern Bool PclRealizeFont(
- ScreenPtr pscr,
- FontPtr pFont);
-extern Bool PclUnrealizeFont(
- ScreenPtr pscr,
- FontPtr pFont);
-
-/******
- * Functions in PclPrint.c
- ******/
-extern int PclStartJob(
- XpContextPtr pCon,
- Bool sendClientData,
- ClientPtr client);
-extern int PclEndJob(
- XpContextPtr pCon,
- Bool cancel);
-extern int PclStartPage(
- XpContextPtr pCon,
- WindowPtr pWin);
-extern int PclEndPage(
- XpContextPtr pCon,
- WindowPtr pWin);
-extern int PclStartDoc(XpContextPtr pCon,
- XPDocumentType type);
-extern int PclEndDoc(
- XpContextPtr pCon,
- Bool cancel);
-extern int PclDocumentData(
- XpContextPtr pCon,
- DrawablePtr pDraw,
- char *pData,
- int len_data,
- char *pFmt,
- int len_fmt,
- char *pOpt,
- int len_opt,
- ClientPtr client);
-extern int PclGetDocumentData(
- XpContextPtr pCon,
- ClientPtr client,
- int maxBufferSize);
-
-
-#endif /* _PCL_H_ */
diff --git a/Xprint/pcl/PclArc.c b/Xprint/pcl/PclArc.c
deleted file mode 100644
index ca13b3a84..000000000
--- a/Xprint/pcl/PclArc.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* $Xorg: PclArc.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclArc.c
-** *
-** * Contents:
-** * Arc-drawing code for the PCL DDX driver
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclArc.c,v 1.5 2001/01/17 22:36:30 dawes Exp $ */
-
-#include <stdio.h>
-#include <math.h>
-#include <errno.h>
-
-#include "Pcl.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "attributes.h"
-
-static void
-PclDoArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs,
- void (*DoIt)(FILE *, PclContextPrivPtr, double, double, xArc))
-{
- char t[80];
- FILE *outFile;
- int nbox, i;
- BoxPtr pbox;
- BoxRec r;
- RegionPtr drawRegion, region, transClip;
- short fudge;
- int xoffset, yoffset;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
- xRectangle repro;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- fudge = 3 * pGC->lineWidth;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- XpGetReproductionArea( pCon, &repro );
-
- /*
- * Generate the PCL code to draw the collection of arcs, by
- * defining it as a macro which uses the HP-GL/2 arc drawing
- * function.
- */
-
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0; i < nArcs; i++ )
- {
- xArc Arc = pArcs[i];
- double b, X, Y, ratio;
- double angle1;
-
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- /* Calculate the start of the arc */
- if( ( Arc.angle1 / 64 ) % 360 == 90 )
- {
- X = 0;
- Y = -Arc.height / 2.0;
- }
- else if( ( Arc.angle1 / 64 ) % 360 == 270 )
- {
- X = 0;
- Y = Arc.height / 2.0;
- }
- else
- {
- /* Convert the angle to radians */
- angle1 = ( Arc.angle1 / 64.0 ) * 3.141592654 / 180.0;
-
- b = (Arc.height / 2.0);
- X = b * cos( angle1 );
- Y = -b * sin( angle1 );
- }
-
- /* Change the coordinate system to scale the ellipse */
- ratio = (double)Arc.height / (double)Arc.width;
-
- sprintf( t, "SC%.2f,%.2f,%d,%d;",
- (repro.x - Arc.width / 2 - xoffset - Arc.x) * ratio,
- (repro.x - Arc.width / 2 - xoffset - Arc.x +
- repro.width) * ratio,
- repro.y - Arc.height / 2 - yoffset - Arc.y + repro.height,
- repro.y - Arc.height / 2 - yoffset - Arc.y);
- SAVE_PCL( outFile, pConPriv, t );
-
- DoIt( outFile, pConPriv, X, Y, Arc );
-
- /* Build the bounding box */
- r.x1 = -Arc.width / 2 - fudge;
- r.y1 = -Arc.height / 2 - fudge;
- r.x2 = Arc.width / 2 + fudge;
- r.y2 = Arc.height / 2 + fudge;
- drawRegion = REGION_CREATE( pGC->pScreen, &r, 0 );
-
- SAVE_PCL( outFile, pConPriv, "\033%0A" );
- MACRO_END( outFile );
-
- /*
- * Intersect the bounding box with the clip region.
- */
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- transClip = REGION_CREATE( pGC->pScreen, NULL, 0 );
- REGION_COPY( pGC->pScreen, transClip, pGC->pCompositeClip );
- REGION_TRANSLATE( pGC->pScreen, transClip,
- -(xoffset + Arc.x + Arc.width / 2),
- -(yoffset + Arc.y + Arc.height / 2) );
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, transClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the collection of arcs to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, ratio);
-
- /*
- * Restore the coordinate system
- */
- sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x,
- repro.x + repro.width, repro.y + repro.height,
- repro.y );
- SEND_PCL( outFile, t );
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- REGION_DESTROY( pGC->pScreen, transClip );
- }
-}
-
-/*
- * Draw a simple non-filled arc, centered on the origin and starting
- * at the given point.
- */
-static void
-DrawArc(FILE *outFile,
- PclContextPrivPtr pConPriv,
- double X,
- double Y,
- xArc A)
-{
- char t[80];
-
- sprintf( t, "PU%d,%d;PD;AA0,0,%.2f;", (int)X, (int)Y,
- (float)A.angle2 / -64.0 );
- SAVE_PCL(outFile, pConPriv, t);
-}
-
-void
-PclPolyArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs)
-{
- PclDoArc( pDrawable, pGC, nArcs, pArcs, DrawArc );
-}
-
-/*
- * Draw a filled wedge, from the origin, to the given point, through
- * the appropriate angle, and back to the origin.
- */
-static void
-DoWedge(FILE *outFile,
- PclContextPrivPtr pConPriv,
- double X,
- double Y,
- xArc A)
-{
- char t[80];
-
- sprintf( t, "PU0,0;WG%.2f,%.2f,%.2f;", sqrt( X * X + Y * Y ),
- (float)A.angle1 / -64.0,
- (float)A.angle2 / -64.0 );
- SAVE_PCL(outFile, pConPriv, t);
-}
-
-static void
-DoChord(FILE *outFile,
- PclContextPrivPtr pConPriv,
- double X,
- double Y,
- xArc A)
-{
- char t[80];
-
- sprintf( t, "PU%d,%d;PM0;AA0,0,%.2f;PA%d,%d;PM2;FP;", (int)X, (int)Y,
- (float)A.angle2 / -64.0 , (int)X, (int)Y );
- SAVE_PCL(outFile, pConPriv, t);
-}
-
-
-void
-PclPolyFillArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs)
-{
- switch( pGC->arcMode )
- {
- case ArcChord:
- PclDoArc( pDrawable, pGC, nArcs, pArcs, DoChord );
- break;
- case ArcPieSlice:
- PclDoArc( pDrawable, pGC, nArcs, pArcs, DoWedge );
- break;
- }
-}
diff --git a/Xprint/pcl/PclArea.c b/Xprint/pcl/PclArea.c
deleted file mode 100644
index 971506da6..000000000
--- a/Xprint/pcl/PclArea.c
+++ /dev/null
@@ -1,482 +0,0 @@
-/* $Xorg: PclArea.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclArea.c
-** *
-** * Contents:
-** * Image and Area functions for the PCL DDX driver
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclArea.c,v 1.9 2001/10/28 03:32:54 tsi Exp $ */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "Pcl.h"
-#include "pixmapstr.h"
-#include "region.h"
-
-#include "cfb.h"
-#if 1
-#include "cfb32.h"
-#endif
-
-void
-PclPutImage(DrawablePtr pDrawable,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage)
-{
- PixmapPtr pPixmap;
- unsigned long oldFg, oldBg;
- XID gcv[3];
- unsigned long oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- if( ( w == 0 ) || ( h == 0 ) )
- return;
-
- if( format != XYPixmap )
- {
- pPixmap = GetScratchPixmapHeader( pDrawable->pScreen,
- w+leftPad, h, depth,
- BitsPerPixel( depth ),
- PixmapBytePad( w + leftPad,
- depth ), (pointer)pImage );
- if( !pPixmap )
- return;
-
- if( format == ZPixmap )
- (void)(*pGC->ops->CopyArea)( (DrawablePtr)pPixmap, pDrawable, pGC,
- leftPad, 0, w, h, x, y );
- else
- (void)(*pGC->ops->CopyPlane)( (DrawablePtr)pPixmap, pDrawable, pGC,
- leftPad, 0, w, h, x, y, 1 );
- FreeScratchPixmapHeader( pPixmap );
- }
- else
- {
- pPixmap = GetScratchPixmapHeader( pDrawable->pScreen,
- w+leftPad, h, depth,
- BitsPerPixel( depth ),
- PixmapBytePad( w + leftPad,
- depth ), (pointer)pImage );
-
- if( !pPixmap )
- return;
-
- depth = pGC->depth;
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0] = ~0L;
- gcv[1] = 0;
- DoChangeGC( pGC, GCForeground | GCBackground, gcv, 0 );
- bytesPer = (long)h * BitmapBytePad( w + leftPad );
-
- for( i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer )
- {
- if( i & oldPlanemask )
- {
- gcv[0] = i;
- DoChangeGC( pGC, GCPlaneMask, gcv, 0 );
- ValidateGC( pDrawable, pGC );
- if (pPixmap->drawable.depth <= 8 )
- cfbPutImage( (DrawablePtr)pPixmap, pGC, 1, x, y, w, h,
- leftPad, XYBitmap, pImage );
- else if (pPixmap->drawable.depth <= 32 )
- cfb32PutImage( (DrawablePtr)pPixmap, pGC, 1, x, y, w, h,
- leftPad, XYBitmap, pImage );
- }
- }
- gcv[0] = oldPlanemask;
- gcv[1] = oldFg;
- gcv[2] = oldBg;
- DoChangeGC( pGC, GCPlaneMask | GCForeground | GCBackground,
- gcv, 0 );
-
- PclCopyArea( (DrawablePtr)pPixmap, pDrawable, pGC, leftPad,
- 0, w, h, x, y );
- FreeScratchPixmapHeader( pPixmap );
- }
-}
-
-/*
- * PclMonoPixmapFragment()
- *
- * Given a 1-bit-deep pixmap, send the appropriate part of it to the
- * output file as a PCL raster graphics command.
- */
-static void
-PclMonoPixmapFragment(FILE *outFile,
- PixmapPtr pix,
- short x1,
- short y1,
- short x2,
- short y2,
- short dstx,
- short dsty)
-{
- char *bits, t[80], *row;
- int h, w, i;
-
- /*
- * Create a storage area large enough to hold the entire pixmap,
- * then use mfbGetImage to get the appropriate bits.
- */
- h = y2 - y1;
- w = BitmapBytePad( x2 - x1 );
-
- bits = (char *)xalloc( h * w );
- mfbGetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h,
- XYPixmap, ~0, bits );
-
- /*
- * Move the cursor to the appropriate place on the page. We have
- * to jump into HP-GL/2 to do this correctly, then go back to PCL
- * for the actual drawing.
- */
- sprintf( t, "\033%%0BPU%d,%d;\033%%1A", dstx, dsty );
- SEND_PCL( outFile, t );
-
- /*
- * Now, wrap the raster in the appropriate PCL code. Right now,
- * it's going to go down the wire without any compression. That
- * will have to be good enough for the sample implementation.
- */
- sprintf( t, "\033*t300R\033*r%dT\033*r%dS\033*r1A\033*b0M",
- h, x2 - x1 );
- SEND_PCL( outFile, t );
-
- sprintf( t, "\033*b%dW", w );
- for( row = bits, i = 0; i <= h; i++, row += w )
- {
- SEND_PCL( outFile, t );
- SEND_PCL_COUNT( outFile, row, w );
- }
-
- SEND_PCL( outFile, "\033*rC" );
-
- /*
- * Clean things up a bit
- */
- xfree( bits );
-}
-
-static void
-PclColorPixmapFragment(FILE *outFile,
- PixmapPtr pix,
- short x1,
- short y1,
- short x2,
- short y2,
- short dstx,
- short dsty)
-{
- char *bits, t[80], *row;
- int h, w, i;
-
- /*
- * Create a storage area large enough to hold the entire pixmap,
- * then use cfbGetImage to get the appropriate bits.
- */
- h = y2 - y1;
- w = PixmapBytePad( x2 - x1, pix->drawable.depth );
-
- bits = (char *)xalloc( h * w );
- if (pix->drawable.depth <= 8)
- cfbGetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h,
- ZPixmap, ~0, bits );
- else if (pix->drawable.depth <= 32)
- cfb32GetImage( (DrawablePtr)pix, x1, y1, x2 - x1, h,
- ZPixmap, ~0, bits );
-
- /*
- * Move the cursor to the appropriate place on the page. We have
- * to jump into HP-GL/2 to do this correctly, then go back to PCL
- * for the actual drawing.
- */
- sprintf( t, "\033%%0BPU%d,%d;\033%%1A", dstx, dsty );
- SEND_PCL( outFile, t );
-
- /*
- * Now, wrap the raster in the appropriate PCL code. Right now,
- * it's going to go down the wire without any compression. That
- * will have to be good enough for the sample implementation.
- */
- sprintf( t, "\033*t300R\033*r%dt%ds1A\033*b0M",
- h, x2 - x1 );
- SEND_PCL( outFile, t );
-
- sprintf( t, "\033*b%dW", w );
- for( row = bits, i = 0; i < h; i++, row += w )
- {
- SEND_PCL( outFile, t );
- SEND_PCL_COUNT( outFile, row, w );
- }
-
- SEND_PCL( outFile, "\033*rC" );
-
- /*
- * Clean things up a bit
- */
- xfree( bits );
-}
-
-RegionPtr
-PclCopyArea(DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty)
-{
- PixmapPtr pixSrc = (PixmapPtr)pSrc;
-/*
- FILE *srcFile;
- GC srcGC;
-*/
- FILE *dstFile;
- GC dstGC;
- unsigned long valid;
- RegionPtr drawRegion, region, whole, ret;
- BoxRec box;
- BoxPtr prect;
- int nrect;
- void (*doFragment)(FILE *, PixmapPtr, short, short, short, short,
- short, short );
-
- /*
- * Since we don't store any information on a per-window basis, we
- * can't copy from a window.
- */
- if( pSrc->type == DRAWABLE_WINDOW )
- return NULL;
-
- /*
- * If we're copying from a pixmap to a pixmap, we just use the
- * mfb/cfb code to do the work.
- */
- if( pDst->type == DRAWABLE_PIXMAP )
- {
- if( pSrc->depth == 1 )
- return mfbCopyArea( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty );
- else if( pSrc->depth <= 8 )
- return cfbCopyArea( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty );
- else if( pSrc->depth <= 32 )
- return cfb32CopyArea( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty );
- }
-
-/*
- PclGetDrawablePrivateStuff( pSrc, &srcGC, &valid, &srcFile );
-*/
- PclGetDrawablePrivateStuff( pDst, &dstGC, &valid, &dstFile );
-
- /*
- * If we're copying to a window, we have to do some actual
- * drawing, instead of just handing it off to mfb or cfb. Start
- * by determining the region that will be drawn.
- */
- box.x1 = srcx;
- box.y1 = srcy;
- box.x2 = srcx + width;
- box.y2 = srcy + height;
- drawRegion = REGION_CREATE( pGC->pScreen, &box, 0 );
- REGION_TRANSLATE( pGC->pScreen, drawRegion, dstx, dsty );
-
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * Now select the operation to be performed on each box in the
- * region.
- */
- if( pSrc->depth == 1 )
- doFragment = PclMonoPixmapFragment;
- else
- doFragment = PclColorPixmapFragment;
-
- /*
- * Actually draw each section of the bitmap.
- */
- nrect = REGION_NUM_RECTS( region );
- prect = REGION_RECTS( region );
-
- while( nrect )
- {
- (*doFragment)( dstFile, (PixmapPtr)pSrc, prect->x1 - dstx,
- prect->y1 - dsty, prect->x2 - dstx,
- prect->y2 - dsty, prect->x1, prect->y1 );
-
- nrect--;
- prect++;
- }
-
- /*
- * Update the destination's GC to the source's GC.
- */
-/*
- PclSetDrawablePrivateGC( pDst, srcGC );
-*/
-
- /*
- * Determine the region that needs to be returned. This is the
- * region of the source that falls outside the boundary of the
- * pixmap.
- */
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pixSrc->drawable.width;
- box.y2 = pixSrc->drawable.height;
- whole = REGION_CREATE( pGC->pScreen, &box, 0 );
- ret = REGION_CREATE( pGC->pScreen, NULL, 0 );
-
- REGION_TRANSLATE( pGC->pScreen, drawRegion, -dstx, -dsty );
- REGION_SUBTRACT( pGC->pScreen, ret, drawRegion, whole );
-
- /*
- * Clean up the regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- REGION_DESTROY( pGC->pScreen, whole );
-
- if( REGION_NOTEMPTY( pGC->pScreen, ret ) )
- return ret;
- else
- {
- REGION_DESTROY( pGC->pScreen, ret );
- return NULL;
- }
-}
-
-RegionPtr
-PclCopyPlane(DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty,
- unsigned long plane)
-{
- RegionPtr reg;
- GCPtr scratchGC;
- PixmapPtr scratchPix;
-
- /*
- * Since we don't store PCL on a per-window basis, there's no good
- * way to copy from a window.
- */
- if( pSrc->type == DRAWABLE_WINDOW )
- return NULL;
-
- /*
- * Copying from a pixmap to a pixmap is already implemented by
- * mfb/cfb.
- */
- if( pSrc->type == DRAWABLE_PIXMAP &&
- pDst->type == DRAWABLE_PIXMAP )
- {
- if( pDst->depth == 1 )
- return mfbCopyPlane( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty, plane );
- else if( pDst->depth <= 8 )
- return cfbCopyPlane( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty, plane );
- else if( pDst->depth <= 32 )
- return cfb32CopyPlane( pSrc, pDst, pGC, srcx, srcy, width,
- height, dstx, dsty, plane );
- }
-
- /*
- * We can use the mfb/cfbCopyPlane function to do the work of grabbing
- * the plane and converting it to the desired visual. Once that's
- * done, we already know how to do a CopyArea.
- */
- scratchPix = (*pDst->pScreen->CreatePixmap)( pDst->pScreen, width,
- height, pDst->depth );
-
- scratchGC = GetScratchGC( pDst->depth, pDst->pScreen );
- CopyGC( pGC, scratchGC, ~0L );
-
- if( pDst->depth == 1 )
- {
- mfbValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix );
- mfbCopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC,
- srcx, srcy, width, height, 0, 0, plane );
- }
- else if( pDst->depth <= 8 )
- {
- cfbValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix );
- cfbCopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC,
- srcx, srcy, width, height, 0, 0, plane );
- }
- else if( pDst->depth <= 32 )
- {
- cfb32ValidateGC( scratchGC, ~0L, (DrawablePtr)scratchPix );
- cfb32CopyPlane( pSrc, (DrawablePtr)scratchPix, scratchGC,
- srcx, srcy, width, height, 0, 0, plane );
- }
-
- reg = PclCopyArea( (DrawablePtr)scratchPix, pDst, pGC, 0, 0, width,
- height, dstx, dsty );
-
- FreeScratchGC( scratchGC );
-
- (*pDst->pScreen->DestroyPixmap)( scratchPix );
-
- return reg;
-}
diff --git a/Xprint/pcl/PclAttVal.c b/Xprint/pcl/PclAttVal.c
deleted file mode 100644
index 88fcf23b5..000000000
--- a/Xprint/pcl/PclAttVal.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * $Xorg: PclAttVal.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $
- */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-#include "Pcl.h"
-#include "AttrValid.h"
-
-/*
- * define valid values and defaults for Printer pool
- */
-static XpOid ValidContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape,
- xpoid_val_content_orientation_reverse_portrait,
- xpoid_val_content_orientation_reverse_landscape
-};
-static XpOidList ValidContentOrientations = {
- ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids)
-};
-
-static XpOid DefaultContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape
-};
-static XpOidList DefaultContentOrientations = {
- DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids)
-};
-
-static XpOid ValidPlexesOids[] = {
- xpoid_val_plex_simplex, xpoid_val_plex_duplex, xpoid_val_plex_tumble
-};
-static XpOidList ValidPlexes = {
- ValidPlexesOids, XpNumber(ValidPlexesOids)
-};
-
-static XpOid DefaultPlexesOids[] = {
- xpoid_val_plex_simplex
-};
-static XpOidList DefaultPlexes = {
- DefaultPlexesOids, XpNumber(DefaultPlexesOids)
-};
-
-static unsigned long ValidPrinterResolutionsCards[] = {
- 300
-};
-static XpOidCardList ValidPrinterResolutions = {
- ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards)
-};
-
-static unsigned long DefaultPrinterResolutionsCards[] = {
- 300
-};
-static XpOidCardList DefaultPrinterResolutions = {
- DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards)
-};
-
-static XpOid ValidListfontsModesOids[] = {
- xpoid_val_xp_list_internal_printer_fonts, xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList ValidListfontsModes = {
- ValidListfontsModesOids, XpNumber(ValidListfontsModesOids)
-};
-
-static XpOid DefaultListfontsModesOids[] = {
- xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList DefaultListfontsModes = {
- DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids)
-};
-
-static XpOid ValidSetupProvisoOids[] = {
- xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional
-};
-static XpOidList ValidSetupProviso = {
-
-
- ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids)
-};
-
-static XpOidDocFmt ValidDocFormatsSupportedFmts[] = {
- { "PCL", "5", NULL },
-};
-static XpOidDocFmtList ValidDocFormatsSupported = {
- ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = {
- { "PCL", "5", NULL }
-};
-static XpOidDocFmtList DefaultDocFormatsSupported = {
- DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmt ValidEmbeddedFormatsSupportedFmts[] = {
- { "HPGL", "2", NULL },
-};
-static XpOidDocFmtList ValidEmbeddedFormatsSupported = {
- ValidEmbeddedFormatsSupportedFmts, XpNumber(ValidEmbeddedFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultEmbeddedFormatsSupportedFmts[] = {
- { "HPGL", "2", NULL }
-};
-static XpOidDocFmtList DefaultEmbeddedFormatsSupported = {
- DefaultEmbeddedFormatsSupportedFmts, XpNumber(DefaultEmbeddedFormatsSupportedFmts)
-};
-
-static XpOidDocFmt ValidRawFormatsSupportedFmts[] = {
- { "PCL", "5", NULL },
- { "Postscript", "2", NULL },
- { "ASCII", NULL, NULL }
-
-};
-static XpOidDocFmtList ValidRawFormatsSupported = {
- ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = {
- { "PCL", "5", NULL }
-};
-static XpOidDocFmtList DefaultRawFormatsSupported = {
- DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts)
-};
-
-static XpOid ValidInputTraysOids[] = {
- xpoid_val_input_tray_manual,
- xpoid_val_input_tray_main,
- xpoid_val_input_tray_envelope,
- xpoid_val_input_tray_large_capacity,
- xpoid_val_input_tray_bottom
-};
-static XpOidList ValidInputTrays = {
- ValidInputTraysOids, XpNumber(ValidInputTraysOids)
-};
-
-static XpOid ValidMediumSizesOids[] = {
- xpoid_val_medium_size_iso_a3,
- xpoid_val_medium_size_iso_a4,
- xpoid_val_medium_size_na_letter,
- xpoid_val_medium_size_na_legal,
- xpoid_val_medium_size_executive,
- xpoid_val_medium_size_ledger,
- xpoid_val_medium_size_iso_c5,
- xpoid_val_medium_size_iso_designated_long,
- xpoid_val_medium_size_na_number_10_envelope,
- xpoid_val_medium_size_monarch_envelope,
- xpoid_val_medium_size_jis_b5,
-};
-static XpOidList ValidMediumSizes = {
- ValidMediumSizesOids, XpNumber(ValidMediumSizesOids)
-};
-
-static XpOidDocFmt DefaultDocumentFormat = {
- "PCL", "5", NULL
-};
-
-
-/*
- * init struct for XpValidate*Pool
- */
-XpValidatePoolsRec PclValidatePoolsRec = {
- &ValidContentOrientations, &DefaultContentOrientations,
- &ValidDocFormatsSupported, &DefaultDocFormatsSupported,
- &ValidInputTrays, &ValidMediumSizes,
- &ValidPlexes, &DefaultPlexes,
- &ValidPrinterResolutions, &DefaultPrinterResolutions,
- &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported,
- &ValidListfontsModes, &DefaultListfontsModes,
- &ValidRawFormatsSupported, &DefaultRawFormatsSupported,
- &ValidSetupProviso,
- &DefaultDocumentFormat
-};
diff --git a/Xprint/pcl/PclAttr.c b/Xprint/pcl/PclAttr.c
deleted file mode 100644
index 2612a821f..000000000
--- a/Xprint/pcl/PclAttr.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $Xorg: PclAttr.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclAttr.c
-** *
-** * Contents:
-** * Attribute-handling functions for the PCL driver
-** *
-** * Created: 2/2/96
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-#include "Pcl.h"
-#include "attributes.h"
-
-char *
-PclGetAttributes(
- XpContextPtr pCon,
- XPAttributes pool )
-{
- return XpGetAttributes( pCon, pool );
-}
-
-char *
-PclGetOneAttribute(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attr )
-{
- return XpGetOneAttribute( pCon, pool, attr );
-}
-int
-PclAugmentAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs )
-{
- return XpAugmentAttributes( pCon, pool, attrs );
-}
-
-int
-PclSetAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs )
-{
- return XpSetAttributes( pCon, pool, attrs );
-}
diff --git a/Xprint/pcl/PclColor.c b/Xprint/pcl/PclColor.c
deleted file mode 100644
index c279c8024..000000000
--- a/Xprint/pcl/PclColor.c
+++ /dev/null
@@ -1,847 +0,0 @@
-/* $Xorg: PclColor.c,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclColorInit.c
-** *
-** * Contents:
-** * Colormap handing code of Pcl driver for the
-** * print server.
-** *
-** * Created: 4/8/96
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclColor.c,v 1.10 2003/10/29 22:11:00 tsi Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <math.h>
-
-#include "colormapst.h"
-#include "windowstr.h"
-#include "resource.h"
-
-#include "Pcl.h"
-#include "cfb.h"
-
-static void lookup(unsigned char *src,
- unsigned char *dst,
- int num,
- unsigned char *map,
- int dim);
-static void trilinear(unsigned char *p,
- unsigned char *out,
- unsigned char *d,
- int dim,
- unsigned char def);
-
-
-/*
- * This seems to be (and is) a duplication of effort; one would think
- * that cfbCreateDefColormap would be sufficient. It almost is. The
- * only change made in this function is that the black and white pixels
- * are allocated with three separate variables for red, green and blue
- * values, instead of the single variable in cfbCreateDefColormap. The
- * single variable leads to the one value being corrected by
- * ResolveColor three times, which leads to incorrect colors.
- */
-
-Bool
-PclCreateDefColormap(ScreenPtr pScreen)
-{
- unsigned short wp_red = ~0, wp_green = ~0, wp_blue = ~0;
- unsigned short bp_red = 0, bp_green = 0, bp_blue = 0;
- VisualPtr pVisual;
- ColormapPtr cmap;
- Pixel wp, bp;
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
-
- if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
- 0)
- != Success)
- return FALSE;
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
- if ((AllocColor(cmap, &wp_red, &wp_green, &wp_blue, &wp, 0) !=
- Success) ||
- (AllocColor(cmap, &bp_red, &bp_green, &bp_blue, &bp, 0) !=
- Success))
- return FALSE;
-
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
-
- (*pScreen->InstallColormap)(cmap);
- return TRUE;
-}
-
-/*
- * Add colormap to list of colormaps on screen
- */
-Bool
-PclCreateColormap(ColormapPtr pColor)
-{
- PclCmapToContexts *new;
- PclScreenPrivPtr sPriv;
-
- sPriv = (PclScreenPrivPtr)pColor->pScreen
- ->devPrivates[PclScreenPrivateIndex].ptr;
-
- /*
- * Use existing code to initialize the values in the colormap
- */
- cfbInitializeColormap( pColor );
-
- /*
- * Set up the mapping between the color map and the context
- */
- new = (PclCmapToContexts *)xalloc( sizeof( PclCmapToContexts ) );
-
- if( new )
- {
- new->colormapId = pColor->mid;
- new->contexts = NULL;
- new->next = sPriv->colormaps;
- sPriv->colormaps = new;
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-void
-PclDestroyColormap(ColormapPtr pColor)
-{
- PclScreenPrivPtr sPriv;
- PclCmapToContexts *pCmap, *tCmap = 0;
- PclContextListPtr con, tCon;
- PclContextPrivPtr cPriv;
- PclPaletteMapPtr pPal;
- char t[80];
-
- /*
- * At DestroyContext time, colormaps may be destroyed twice, so if the
- * pointer is NULL, just crash out.
- */
- if( !pColor )
- return;
-
- /*
- * Find the colormap <-> contexts mapping
- */
- sPriv = (PclScreenPrivPtr)pColor->pScreen
- ->devPrivates[PclScreenPrivateIndex].ptr;
- pCmap = sPriv->colormaps;
- while( pCmap )
- {
- if( pCmap->colormapId == pColor->mid )
- break;
- tCmap = pCmap;
- pCmap = pCmap->next;
- }
-
- /*
- * For each context, delete the palette in the printer and
- * free the mapping.
- */
- if( pCmap )
- {
- con = pCmap->contexts;
- while( con )
- {
- cPriv = con->context->devPrivates[PclContextPrivateIndex].ptr;
-
- pPal = cPriv->palettes;
- while( pPal )
- {
- if( pPal->colormapId == pColor->mid )
- break;
- pPal = pPal->next;
- }
-
- if( cPriv->pPageFile )
- {
- sprintf( t, "\033&p%dI\033*p2C", pPal->paletteId );
- SEND_PCL( cPriv->pPageFile, t );
- }
-
- tCon = con;
- con = con->next;
- xfree( tCon );
- }
-
- /*
- * Delete the colormap<->contexts mapping
- */
- if( sPriv->colormaps == pCmap )
- /* Delete from the front */
- sPriv->colormaps = pCmap->next;
- else
- /* Delete from the middle */
- tCmap->next = pCmap->next;
- free( pCmap );
- }
-}
-
-void
-PclInstallColormap(ColormapPtr pColor)
-{
-}
-
-void
-PclUninstallColormap(ColormapPtr pColor)
-{
-}
-
-int
-PclListInstalledColormaps(ScreenPtr pScreen,
- XID *pCmapList)
-{
- return 0;
-}
-
-void
-PclStoreColors(ColormapPtr pColor,
- int ndef,
- xColorItem *pdefs)
-{
- PclCmapToContexts *p;
- PclScreenPrivPtr sPriv;
- PclContextListPtr con;
- PclContextPrivPtr cPriv;
- PclPaletteMapPtr pMap;
- char t[80];
- int i;
-
- sPriv = (PclScreenPrivPtr)pColor->pScreen
- ->devPrivates[PclScreenPrivateIndex].ptr;
- p = sPriv->colormaps;
- while( p )
- {
- if( p->colormapId == pColor->mid )
- break;
- p = p->next;
- }
-
- if( p )
- {
- con = p->contexts;
- while( con )
- {
- /*
- * For each context, get the palette ID and update the
- * appropriate palette.
- */
- cPriv = con->context
- ->devPrivates[PclContextPrivateIndex].ptr;
- pMap = PclFindPaletteMap( cPriv, pColor, NULL );
-
- /*
- * Update the palette
- */
- sprintf( t, "\033&p%dS", pMap->paletteId );
- SEND_PCL( cPriv->pPageFile, t );
-
- if( pColor->class == PseudoColor )
- {
- unsigned short r, g, b;
- unsigned int pID;
- for( i = 0; i < ndef; i++ )
- {
- pID = pdefs[i].pixel;
- if ( pColor->red[i].fShared )
- {
- r = pColor->red[pID].co.shco.red->color;
- g = pColor->red[pID].co.shco.green->color;
- b = pColor->red[pID].co.shco.blue->color;
- }
- else
- {
- r = pColor->red[pID].co.local.red;
- g = pColor->red[pID].co.local.green;
- b = pColor->red[pID].co.local.blue;
- }
-
- if( pdefs[i].flags & DoRed )
- r = pdefs[i].red;
- if( pdefs[i].flags & DoGreen )
- g = pdefs[i].green;
- if( pdefs[i].flags & DoBlue )
- b = pdefs[i].blue;
- PclLookUp(pColor, cPriv, &r, &g, &b);
- sprintf( t, "\033*v%ua%ub%uc%dI", r, g, b, pID);
- SEND_PCL( cPriv->pPageFile, t );
- }
- }
-
- sprintf( t, "\033&p%dS", cPriv->currentPalette );
- SEND_PCL( cPriv->pPageFile, t );
-
- con = con->next;
- }
- }
-}
-
-void
-PclResolveColor(unsigned short *pRed,
- unsigned short *pGreen,
- unsigned short *pBlue,
- VisualPtr pVisual)
-{
- /*
- * We need to map the X color range of [0,65535] to the PCL color
- * range of [0,32767].
- */
- *pRed >>= 1;
- *pGreen >>= 1;
- *pBlue >>= 1;
-}
-
-PclPaletteMapPtr
-PclFindPaletteMap(PclContextPrivPtr cPriv,
- ColormapPtr cmap,
- GCPtr gc)
-{
- PclPaletteMapPtr p = cPriv->palettes, new;
-
- /*
- * If the colormap is static, grab one of the special palettes. If we come
- * into this from StoreColors, there will be no GC, but by definition we're
- * looking at a dynamic color map, so the special colors will not be
- * needed.
- */
- if( gc )
- {
- if( cmap->pVisual->class == StaticGray )
- return &( cPriv->staticGrayPalette );
- else if( cmap->pVisual->class == TrueColor )
- {
- if( gc->fillStyle == FillTiled && !( gc->tileIsPixel ) )
- return &( cPriv->specialTrueColorPalette );
- else
- return &( cPriv->trueColorPalette );
- }
- }
-
-
- /* Look for the colormap ID <-> palette ID mapping */
- while( p )
- {
- if( p->colormapId == cmap->mid )
- return p;
- p = p->next;
- }
-
- /* If the colormap isn't already there, make an entry for it */
- new = (PclPaletteMapPtr)xalloc( sizeof( PclPaletteMap ) );
- new->colormapId = cmap->mid;
- new->paletteId = cPriv->nextPaletteId++;
- new->downloaded = 0;
- new->next = cPriv->palettes;
- cPriv->palettes = new;
- return new;
-}
-
-int
-PclUpdateColormap(DrawablePtr pDrawable,
- XpContextPtr pCon,
- GCPtr gc,
- FILE *outFile)
-{
- PclScreenPrivPtr sPriv;
-
- PclContextPrivPtr cPriv;
- PclPaletteMapPtr pMap;
- PclCmapToContexts *pCmap;
- PclContextListPtr new;
- char t[80];
- Colormap c;
- ColormapPtr cmap;
- WindowPtr win = (WindowPtr)pDrawable;
- unsigned short r, g, b, rr, gg, bb;
- int i;
-
- cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- c = wColormap( win );
- cmap = (ColormapPtr)LookupIDByType( c, RT_COLORMAP );
- pMap = PclFindPaletteMap( cPriv, cmap, gc );
-
- if( cPriv->currentPalette == pMap->paletteId )
- /*
- * If the requested colormap is already active, nothing needs to
- * be done.
- */
- return FALSE;
-
- /*
- * Now we activate the palette in the printer
- */
- sprintf( t, "\033&p%dS", pMap->paletteId );
- SEND_PCL( outFile, t );
- cPriv->currentPalette = pMap->paletteId;
-
- if( pMap->downloaded == 0 )
- /*
- * If the requested colormap has not been downloaded to the
- * printer, we need to do that before activating it.
- */
- {
- /*
- * Add the colormap to the screen-level colormap<->context mapping.
- */
- sPriv = (PclScreenPrivPtr)cmap->pScreen
- ->devPrivates[PclScreenPrivateIndex].ptr;
- pCmap = sPriv->colormaps;
- while( pCmap && ( pCmap->colormapId != cmap->mid ) )
- pCmap = pCmap->next;
- new = (PclContextListPtr)xalloc( sizeof( PclContextList ) );
- new->context = pCon;
- new->next = pCmap->contexts;
- pCmap->contexts = new;
-
- /*
- * XXX Download the colormap
- */
- if( cmap->class == StaticGray )
- {
-#ifdef XP_PCL_COLOR
- sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1, 1, 1, 1, 1 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 12 );
-
- /* Send the white reference point... */
- sprintf( t, "%c%c%c%c%c%c", 0x7f, 0xff, 0x7f, 0xff,
- 0x7f, 0xff );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* ... and the black reference point */
- sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* Now program the two colors */
- sprintf( t, "\033*v0a0b0c%ldI", (long) cmap->pScreen->blackPixel );
- SEND_PCL( cPriv->pPageFile, t );
- sprintf( t, "\033*v32767a32767b32767c%ldI",
- (long) cmap->pScreen->whitePixel );
- SEND_PCL( cPriv->pPageFile, t );
-#endif /* XP_PCL_COLOR */
- }
- else if( cmap->class == PseudoColor )
- {
- sprintf( t,
- "\033*v18W%c%c%c%c%c%c",
- 0, 1, cmap->pVisual->nplanes, 16, 16, 16 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 12 );
-
- /* Send the white reference point... */
- if ( cPriv->ctbl != NULL )
- sprintf( t, "%c%c%c%c%c%c", 0x00, 0xff, 0x00, 0xff,
- 0x00, 0xff );
- else
- sprintf( t, "%c%c%c%c%c%c", 0x7f, 0xff, 0x7f, 0xff,
- 0x7f, 0xff );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* ... and the black reference point */
- sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- for(i = 0; i < cmap->pVisual->ColormapEntries; i++ )
- {
- if( cmap->red[i].fShared )
- {
- r = cmap->red[i].co.shco.red->color;
- g = cmap->red[i].co.shco.green->color;
- b = cmap->red[i].co.shco.blue->color;
- }
- else
- {
- r = cmap->red[i].co.local.red;
- g = cmap->red[i].co.local.green;
- b = cmap->red[i].co.local.blue;
- }
- PclLookUp(cmap, cPriv, &r, &g, &b);
- sprintf( t, "\033*v%ua%ub%uc%dI", r, g, b, i );
- SEND_PCL( outFile, t );
- }
- }
- else if( cmap->class == TrueColor )
- {
- unsigned short lim;
-
- if( gc->fillStyle == FillTiled && !( gc->tileIsPixel ) )
- {
- if( cPriv->ctbl != NULL )
- {
- /* Send the "special" colormap for 24-bit fills */
- sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1,
- 8,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 12 );
-
- /* Send the white reference point... */
- sprintf( t, "%c%c%c%c%c%c",
- 0x00, 0xff,
- 0x00, 0xff,
- 0x00, 0xff );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* ... and the black reference point */
- sprintf( t, "%c%c%c%c%c%c",
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* Now send the color entries, RRRGGGBB */
- i=0;
- for( r = 0; r < 8; r++ )
- for( g = 0; g < 8; g ++ )
- for( b = 0; b < 4; b++ )
- {
- rr = (r * 0xff)/7;
- gg = (g * 0xff)/7;
- bb = (b * 0xff)/3;
- PclLookUp(cmap, cPriv, &rr, &gg, &bb);
- sprintf( t, "\033*v%ua%ub%uc%dI",
- rr, gg, bb, i );
- SEND_PCL( outFile, t );
- i++;
- }
- }
- else
- {
- /* Send the "special" colormap for 24-bit fills */
- sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 1,
- 8,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 12 );
-
- /* Send the white reference point... */
- sprintf( t, "%c%c%c%c%c%c",
- 0x00, 0x07,
- 0x00, 0x07,
- 0x00, 0x03 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* ... and the black reference point */
- sprintf( t, "%c%c%c%c%c%c",
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* Now send the color entries, RRRGGGBB */
- i=0;
- for( r = 0; r < 8; r++ )
- for( g = 0; g < 8; g ++ )
- for( b = 0; b < 4; b++ )
- {
- sprintf( t, "\033*v%ua%ub%uc%dI",
- r, g, b, i );
- SEND_PCL( outFile, t );
- i++;
- }
- }
-
- }
- else
- {
- lim = (1 << cmap->pVisual->bitsPerRGBValue) - 1;
-
- /* Send the "special" colormap for 24-bit fills */
- sprintf( t, "\033*v18W%c%c%c%c%c%c", 0, 3,
- cmap->pVisual->nplanes,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue,
- cmap->pVisual->bitsPerRGBValue );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 12 );
-
- /* Send the white reference point... */
- sprintf( t, "%c%c%c%c%c%c",
- (lim >> 8) & 0xff, lim & 0xff,
- (lim >> 8) & 0xff, lim & 0xff,
- (lim >> 8) & 0xff, lim & 0xff);
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
-
- /* ... and the black reference point */
- sprintf( t, "%c%c%c%c%c%c", 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00 );
- SEND_PCL_COUNT( cPriv->pPageFile, t, 6 );
- }
-
- }
- pMap->downloaded = 1;
- }
- return TRUE;
-
-}
-
-void PclLookUp(
- ColormapPtr cmap,
- PclContextPrivPtr cPriv,
- unsigned short *r,
- unsigned short *g,
- unsigned short *b
-)
-{
- unsigned char cdata[3];
-
- if( cmap->class == PseudoColor )
- {
- if( cPriv->ctbl != NULL )
- {
- cdata[0] = *r >> 8;
- cdata[1] = *g >> 8;
- cdata[2] = *b >> 8;
- lookup(cdata, cdata, 1, cPriv->ctbl, cPriv->ctbldim);
- *r = cdata[0];
- *g = cdata[1];
- *b = cdata[2];
- }
- else
- {
- *r >>= 1;
- *g >>= 1;
- *b >>= 1;
- }
- }
- else if( cmap->class == TrueColor )
- {
- if( cPriv->ctbl != NULL )
- {
- cdata[0] = *r;
- cdata[1] = *g;
- cdata[2] = *b;
- lookup(cdata, cdata, 1, cPriv->ctbl, cPriv->ctbldim);
- *r = cdata[0];
- *g = cdata[1];
- *b = cdata[2];
- }
- }
- return;
-}
-
-unsigned char *PclReadMap(char *name, int *dim)
-{
- FILE *fp;
- unsigned char *data;
- long size;
-
- if ((fp=fopen(name, "r")) == NULL) {
- return(NULL);
- }
-
- fseek(fp, 0, SEEK_END);
- size = ftell(fp);
-
- /* Could do this with a lookup table, if the constraint is that the
- 3 map dimensions must be equal. */
- switch (size) {
- case 8*8*8*3:
- *dim = 8;
- break;
- case 16*16*16*3:
- *dim = 16;
- break;
- case 17*17*17*3:
- *dim = 17;
- break;
- case 65*65*65*3:
- *dim = 65;
- break;
- default:
- fclose(fp);
- return(NULL);
- }
-
- if ((data = (unsigned char *) xalloc(sizeof(char) * size)) == NULL) {
- fclose(fp);
- return(NULL);
- }
-
- fseek(fp, 0, SEEK_SET);
-
- if (fread(data, sizeof(char), size, fp) != (unsigned) size) {
- fclose(fp);
- free(data);
- return(NULL);
- }
-
- fclose(fp);
- return(data);
-}
-
-/************************************************************************
- *
- * Here is the mapper.
- *
- ************************************************************************/
-
-#define SCL(x) ((x)*(dim-1)/255)
-/* Interleaved-map lookup */
-static void lookup(unsigned char *src, unsigned char *dst, int num, unsigned char *map, int dim)
-{
- int i;
-
-#define _INTERPOLATE
-#ifndef _INTERPOLATE
- unsigned char *p1, *p2, *p3;
-
- for (i=0; i<num; i++) {
- p1 = map + (SCL(src[0])*dim*dim + SCL(src[1])*dim + SCL(src[2])) * 3;
- *dst++ = *p1++;
- *dst++ = *p1++;
- *dst++ = *p1++;
- src += 3;
- }
-#else
- for (i=0; i<num; i++) {
- trilinear(src, dst, map, dim, 128);
- src += 3;
- dst += 3;
- }
-#endif
-}
-
-/*
- * C code from the article
- * "Tri-linear Interpolation"
- * by Steve Hill, sah@ukc.ac.uk
- * in "Graphics Gems IV", Academic Press, 1994
- *
- * Fri Feb 16 14:12:43 PST 1996
- * Modified to use for 8-bit color mapping -- A. Fitzhugh,
- * HP Labs, Printing Technology Department
- */
-
-/* linear interpolation from l (when a=0) to h (when a=1)*/
-/* (equal to (a*h)+((1-a)*l) */
-#define LERP(a,l,h) ((l)+((((h)-(l))*(a))>>8))
-
-static void trilinear(unsigned char *p, unsigned char *out, unsigned char *d, int dim, unsigned char def)
-{
-#define DENS(X, Y, Z, ch) d[((X*dim+Y)*dim+Z)*3+ch]
-
- int x0, y0, z0,
- x1, y1, z1,
- i;
- unsigned char *dp,
- fx, fy, fz,
- d000, d001, d010, d011,
- d100, d101, d110, d111,
- dx00, dx01, dx10, dx11,
- dxy0, dxy1;
- float scale;
-
- scale = 255.0 / (dim-1);
-
- x0 = p[0] / scale;
- y0 = p[1] / scale;
- z0 = p[2] / scale;
-
- /* Fractions should range from 0-1.0 (fixed point 8-256) */
- fx = (((int) (p[0] - x0 * scale)) << 8) / 255;
- fy = (((int) (p[1] - y0 * scale)) << 8) / 255;
- fz = (((int) (p[2] - z0 * scale)) << 8) / 255;
-
- x1 = x0 + 1;
- y1 = y0 + 1;
- z1 = z0 + 1;
-
- for (i=0; i<3; i++) {
-
- if (x0 >= 0 && x1 < dim &&
- y0 >= 0 && y1 < dim &&
- z0 >= 0 && z1 < dim) {
- dp = &DENS(x0, y0, z0, i);
- d000 = dp[0];
- d100 = dp[3];
- dp += dim*3;
- d010 = dp[0];
- d110 = dp[3];
- dp += dim*dim*3;
- d011 = dp[0];
- d111 = dp[3];
- dp -= dim*3;
- d001 = dp[0];
- d101 = dp[3];
- } else {
-# define INRANGE(X, Y, Z) \
- ((X) >= 0 && (X) < dim && \
- (Y) >= 0 && (Y) < dim && \
- (Z) >= 0 && (Z) < dim)
-
- d000 = INRANGE(x0, y0, z0) ? DENS(x0, y0, z0, i) : def;
- d001 = INRANGE(x0, y0, z1) ? DENS(x0, y0, z1, i) : def;
- d010 = INRANGE(x0, y1, z0) ? DENS(x0, y1, z0, i) : def;
- d011 = INRANGE(x0, y1, z1) ? DENS(x0, y1, z1, i) : def;
-
- d100 = INRANGE(x1, y0, z0) ? DENS(x1, y0, z0, i) : def;
- d101 = INRANGE(x1, y0, z1) ? DENS(x1, y0, z1, i) : def;
- d110 = INRANGE(x1, y1, z0) ? DENS(x1, y1, z0, i) : def;
- d111 = INRANGE(x1, y1, z1) ? DENS(x1, y1, z1, i) : def;
- }
-
- dx00 = LERP(fx, d000, d100);
- dx01 = LERP(fx, d001, d101);
- dx10 = LERP(fx, d010, d110);
- dx11 = LERP(fx, d011, d111);
-
- dxy0 = LERP(fy, dx00, dx10);
- dxy1 = LERP(fy, dx01, dx11);
-
- out[i] = LERP(fz, dxy0, dxy1);
- }
-}
-
diff --git a/Xprint/pcl/PclCursor.c b/Xprint/pcl/PclCursor.c
deleted file mode 100644
index 7e463d498..000000000
--- a/Xprint/pcl/PclCursor.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $Xorg: PclCursor.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclCursor.c
-** *
-** * Contents:
-** * Cursor-handling code for the PCL DDX driver
-** *
-** * Created: 1/18/96
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclCursor.c,v 1.4 2001/01/17 22:36:30 dawes Exp $ */
-
-#include <stdio.h>
-
-#include "Pcl.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PclConstrainCursor(
- ScreenPtr pScreen,
- BoxPtr pBox)
-{
-}
-
-void
-PclCursorLimits(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- BoxPtr pHotBox,
- BoxPtr pTopLeftBox)
-{
-}
-
-Bool
-PclDisplayCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- return True;
-}
-
-Bool
-PclRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- return True;
-}
-
-Bool
-PclUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- return True;
-}
-
-void
-PclRecolorCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- Bool displayed)
-{
-}
-
-Bool
-PclSetCursorPosition(
- ScreenPtr pScreen,
- int x,
- int y,
- Bool generateEvent)
-{
- return True;
-}
diff --git a/Xprint/pcl/PclDef.h b/Xprint/pcl/PclDef.h
deleted file mode 100644
index 2638748b2..000000000
--- a/Xprint/pcl/PclDef.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $Xorg: PclDef.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclDef.h
-** *
-** * Contents: extran defines and includes for the Pcl driver
-** * for a printing X server.
-** *
-** * Created: 7/31/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-#ifndef _PCLDEF_H_
-#define _PCLDEF_H_
-
-#define DT_PRINT_JOB_HEADER "DT_PRINT_JOB_HEADER"
-#define DT_PRINT_JOB_TRAILER "DT_PRINT_JOB_TRAILER"
-#define DT_PRINT_JOB_COMMAND "DT_PRINT_JOB_COMMAND"
-#define DT_PRINT_JOB_EXEC_COMMAND "DT_PRINT_JOB_EXEC_COMMAND"
-#define DT_PRINT_JOB_EXEC_OPTIONS "DT_PRINT_JOB_EXEC_OPTION"
-#define DT_PRINT_PAGE_HEADER "DT_PRINT_PAGE_HEADER"
-#define DT_PRINT_PAGE_TRAILER "DT_PRINT_PAGE_TRAILER"
-#define DT_PRINT_PAGE_COMMAND "DT_PRINT_PAGE_COMMAND"
-
-#define DT_IN_FILE_STRING "%(InFile)%"
-#define DT_OUT_FILE_STRING "%(OutFile)%"
-#define DT_ALLOWED_COMMANDS_FILE "printCommands"
-
-#endif /* _PCLDEF_H_ */
diff --git a/Xprint/pcl/PclFonts.c b/Xprint/pcl/PclFonts.c
deleted file mode 100644
index f2141f9ff..000000000
--- a/Xprint/pcl/PclFonts.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $Xorg: PclFonts.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclFonts.c
-** *
-** * Contents:
-** * Font code for Pcl driver.
-** *
-** * Created: 2/03/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclFonts.c,v 1.2 2003/07/16 01:38:34 dawes Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-#include "regionstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-
-#include "Pcl.h"
-
-Bool
-PclRealizeFont(
- ScreenPtr pscr,
- FontPtr pFont)
-{
- return TRUE;
-}
-
-Bool
-PclUnrealizeFont(
- ScreenPtr pscr,
- FontPtr pFont)
-{
- return TRUE;
-}
diff --git a/Xprint/pcl/PclGC.c b/Xprint/pcl/PclGC.c
deleted file mode 100644
index e1fe772bd..000000000
--- a/Xprint/pcl/PclGC.c
+++ /dev/null
@@ -1,1042 +0,0 @@
-/* $Xorg: PclGC.c,v 1.4 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclGC.c
-** *
-** * Contents:
-** * Graphics Context handling for the PCL driver
-** *
-** * Created: 10/11/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclGC.c,v 1.10 2001/10/28 03:32:54 tsi Exp $ */
-
-#include "gcstruct.h"
-
-#include "Pcl.h"
-#include "pixmapstr.h"
-#include "colormapst.h"
-#include "windowstr.h"
-#include "cfb.h"
-#include "cfb32.h"
-#include "migc.h"
-#include "scrnintstr.h"
-#include "resource.h"
-
-static GCOps PclGCOps =
-{
- PclFillSpans,
- PclSetSpans,
- PclPutImage,
- PclCopyArea,
- PclCopyPlane,
- PclPolyPoint,
- PclPolyLine,
- PclPolySegment,
- PclPolyRectangle,
- PclPolyArc,
- PclFillPolygon,
- PclPolyFillRect,
- PclPolyFillArc,
- PclPolyText8,
- PclPolyText16,
- PclImageText8,
- PclImageText16,
- PclImageGlyphBlt,
- PclPolyGlyphBlt,
- PclPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-}
-;
-
-
-static GCFuncs PclGCFuncs =
-{
- PclValidateGC,
- miChangeGC,
- miCopyGC,
- PclDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-}
-;
-
-Bool
-PclCreateGC(GCPtr pGC)
-{
- if( pGC->depth == 1 )
- {
- if( mfbCreateGC( pGC ) == FALSE )
- return FALSE;
- }
- else if( pGC->depth <= 32 )
- {
-#if PSZ == 8
- if( cfbCreateGC( pGC ) == FALSE )
-#else
- if( cfb32CreateGC( pGC ) == FALSE )
-#endif
- return FALSE;
- }
- else
- return FALSE;
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- pGC->ops = &PclGCOps;
- pGC->funcs = &PclGCFuncs;
-
- return TRUE;
-}
-
-void
-PclDestroyGC(GCPtr pGC)
-{
- /* Handle the mfb and cfb, which share a GC private struct */
- miDestroyGC( pGC );
-}
-
-
-int
-PclGetDrawablePrivateStuff(
- DrawablePtr pDrawable,
- GC *gc,
- unsigned long *valid,
- FILE **file)
-{
- XpContextPtr pCon;
- PclContextPrivPtr cPriv;
-
- switch( pDrawable->type )
- {
- case DRAWABLE_PIXMAP:
- /*
- * If we ever get here, something is wrong.
- */
- return FALSE;
-
- case DRAWABLE_WINDOW:
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
-
- if( pCon == NULL )
- return FALSE;
- else
- {
- cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr;
- *gc = cPriv->lastGC;
- *valid = cPriv->validGC;
- *file = cPriv->pPageFile;
- return TRUE;
- }
-
- default:
- return FALSE;
- }
-}
-
-void
-PclSetDrawablePrivateGC(
- DrawablePtr pDrawable,
- GC gc)
-{
- PixmapPtr pix;
- XpContextPtr pCon;
- PclPixmapPrivPtr pixPriv;
- PclContextPrivPtr pPriv;
- int i;
-
- switch( pDrawable->type )
- {
- case DRAWABLE_PIXMAP:
- pix = (PixmapPtr)pDrawable;
- pixPriv = pix->devPrivates[PclPixmapPrivateIndex].ptr;
-
- pixPriv->lastGC = gc;
- pixPriv->validGC = 1;
- break;
-
- case DRAWABLE_WINDOW:
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
- pPriv = ((PclContextPrivPtr)
- (pCon->devPrivates[PclContextPrivateIndex].ptr));
-
- pPriv->validGC = 1;
- pPriv->lastGC = gc;
-
- /*
- * Store the dash list separately, to avoid having it freed
- * out from under us.
- */
- if( pPriv->dash != NULL )
- xfree( pPriv->dash );
- if( gc.numInDashList != 0 )
- {
- pPriv->dash = (unsigned char *)xalloc( sizeof( unsigned char )
- * gc.numInDashList );
- for( i = 0; i < gc.numInDashList; i++ )
- pPriv->dash[i] = gc.dash[i];
- }
- else
- pPriv->dash = NULL;
-
-
- /*
- * Store the dash list separately, to avoid having it freed
- * out from under us.
- */
- if( pPriv->dash != NULL )
- xfree( pPriv->dash );
- if( gc.numInDashList != 0 )
- {
- pPriv->dash = (unsigned char *)xalloc( sizeof( unsigned char )
- * gc.numInDashList );
- for( i = 0; i < gc.numInDashList; i++ )
- pPriv->dash[i] = gc.dash[i];
- }
- else
- pPriv->dash = NULL;
-
- break;
- }
-}
-
-static void
-PclSendPattern(char *bits,
- int sz,
- int depth,
- int h,
- int w,
- int patNum,
- FILE *outFile)
-{
- char t[80], *row, *mod;
- int w2;
- int i, j;
-
- SEND_PCL( outFile, "\033%0A" );
-
- if( depth == 1 )
- {
- /* Each row must be word-aligned */
- w2 = ( w / 8 ) + ( ( w%8 ) ? 1 : 0 );
-/*
- if( w2 % 2 )
- w2++;
-*/
-
- sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 );
- SEND_PCL( outFile, t );
-
- sprintf( t, "%c%c%c%c%c%c%c%c", 0, 0, 1, 0, h>>8, h&0xff, w>>8,
- w&0xff );
- SEND_PCL_COUNT( outFile, t, 8 );
-
- for( row = bits, i = 0; i < h; i++, row += BitmapBytePad( w ) )
- SEND_PCL_COUNT( outFile, row, w2 );
- }
- else if( depth == 8 )
- {
- w2 = ( w % 2 ) ? w + 1 : w;
-
- sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 );
- SEND_PCL( outFile, t );
-
- sprintf( t, "%c%c%c%c%c%c%c%c", 1, 0, 8, 0, h>>8, h&0xff,
- w>>8, w&0xff );
- SEND_PCL_COUNT( outFile, t, 8 );
-
- for( row = bits, i = 0; i < h; i++,
- row += PixmapBytePad( w, 8 ) )
- SEND_PCL_COUNT( outFile, row, w2 );
- }
- else
- {
- w2 = ( w % 2 ) ? w + 1 : w;
-
- sprintf( t, "\033*c%dg%dW", patNum, h * w2 + 8 );
- SEND_PCL( outFile, t );
-
- sprintf( t, "%c%c%c%c%c%c%c%c", 1, 0, 8, 0, h>>8, h&0xff,
- w>>8, w&0xff );
- SEND_PCL_COUNT( outFile, t, 8 );
-
- mod = (char *)xalloc( w2 );
-
- for( row = bits, i = 0; i < h; i++,
- row += PixmapBytePad( w, 24 ) )
- {
- char r, g, b;
- for( j = 0; j < w2; j++ ) {
- r = ((row[j*4+1] >> 5) & 0x7) << 5;
- g = ((row[j*4+2] >> 5) & 0x7) << 2;
- b = ((row[j*4+3] >> 6) & 0x3);
- mod[j] = r | g | b;
- }
- SEND_PCL_COUNT( outFile, mod, w2 );
- }
-
- xfree( mod );
- }
-
- SEND_PCL( outFile, "\033%0B" );
-}
-
-int
-PclUpdateDrawableGC(
- GCPtr pGC,
- DrawablePtr pDrawable,
- FILE **outFile)
-{
- Mask changeMask = 0;
- GC dGC;
- unsigned long valid;
- int i;
- XpContextPtr pCon;
- PclContextPrivPtr cPriv;
- PclGCPrivPtr gcPriv = (PclGCPrivPtr)
- (pGC->devPrivates[PclGCPrivateIndex].ptr);
-
- if( !PclGetDrawablePrivateStuff( pDrawable, &dGC, &valid, outFile ) )
- return FALSE;
-
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
- cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Here's where we update the colormap. Since there can be
- * different colormaps installed on each window, we need to check
- * before each drawing request that the correct palette is active in
- * the printer. This is as good a place as any.
- */
- if( !PclUpdateColormap( pDrawable, pCon, pGC, *outFile ) )
- return FALSE;
-
- /*
- * If the drawable's last GC is NULL, this means that this is
- * the first time the drawable is being used. Therefore, we need
- * to emit PCL for all the GC fields.
- */
- if( valid == 0 )
- changeMask = ~0;
-
- /*
- * If we have two different GC structures, there is no alternative
- * but to scan through them both to determine the changeMask.
- */
- else
- {
- if( dGC.alu != pGC->alu )
- changeMask |= GCFunction;
- if( dGC.fgPixel != pGC->fgPixel )
- changeMask |= GCForeground;
- if( dGC.bgPixel != pGC->bgPixel )
- changeMask |= GCBackground;
- if( dGC.lineWidth != pGC->lineWidth )
- changeMask |= GCLineWidth;
- if( dGC.lineStyle != pGC->lineStyle )
- changeMask |= GCLineStyle;
- if( dGC.capStyle != pGC->capStyle )
- changeMask |= GCCapStyle;
- if( dGC.joinStyle != pGC->joinStyle )
- changeMask |= GCJoinStyle;
- if( dGC.fillStyle != pGC->fillStyle )
- changeMask |= GCFillStyle;
- if( dGC.tile.pixmap != pGC->tile.pixmap )
- changeMask |= GCTile;
- if( dGC.stipple != pGC->stipple )
- changeMask |= GCStipple;
- if( dGC.patOrg.x != pGC->patOrg.x )
- changeMask |= GCTileStipXOrigin;
- if( dGC.patOrg.y != pGC->patOrg.y )
- changeMask |= GCTileStipYOrigin;
-
- if( dGC.numInDashList == pGC->numInDashList )
- {
- for( i = 0; i < dGC.numInDashList; i++ )
- if( cPriv->dash[i] != pGC->dash[i] )
- {
- changeMask |= GCDashList;
- break;
- }
- }
- else
- changeMask |= GCDashList;
- }
-
- /*
- * Once the changeMask has been determined, we scan it and emit
- * the appropriate PCL code to set the drawing attributes.
- */
-
- /* Must be in HP-GL/2 mode to set attributes */
- SEND_PCL( *outFile, "\033%0B" );
-
- if( changeMask & GCFunction )
- {
-#ifdef XP_PCL_COLOR
-
- if( pGC->alu == GXclear )
- SEND_PCL( *outFile, "SP0;" );
- else
- SEND_PCL( *outFile, "SP1;" );
-#else
- if( pGC->alu == GXclear )
- SEND_PCL( *outFile, "SP0;" );
- else
- SEND_PCL( *outFile, "SP1;" );
-#endif /* XP_PCL_COLOR */
- }
-
-#if 0
- if( changeMask & GCFunction )
- {
- int rop = -1;
- char t[10];
-
- switch( pGC->alu )
- {
- case GXclear:
- rop = 1;
- break;
- case GXand:
- rop = 136;
- break;
- case GXandReverse:
- rop = 68;
- break;
- case GXcopy:
- rop = 204;
- break;
- case GXandInverted:
- rop = 34;
- break;
- case GXnoop:
- rop = 170;
- break;
- case GXxor:
- rop = 238;
- break;
- case GXor:
- rop = 238;
- break;
- case GXnor:
- rop = 17;
- break;
- case GXequiv:
- rop = 153;
- break;
- case GXinvert:
- rop = 85;
- break;
- case GXorReverse:
- rop = 221;
- break;
- case GXcopyInverted:
- rop = 51;
- break;
- case GXorInverted:
- rop = 187;
- break;
- case GXnand:
- rop = 119;
- break;
- case GXset:
- rop = 0;
- break;
- }
- if( rop != -1 )
- {
- sprintf( t, "MC1,%d;", rop );
- SEND_PCL( *outFile, t );
-#endif
-
- if( changeMask & GCForeground )
- switch( pGC->fgPixel )
- {
- case 1:
- SEND_PCL( *outFile, "SP1;" );
- break;
- default:
- SEND_PCL( *outFile, "SP0;" );
- break;
- }
-
- if( changeMask & GCForeground )
- {
-#ifdef XP_PCL_COLOR
- ColormapPtr cmap;
- Colormap c;
- char t[40];
-
- c = wColormap( ((WindowPtr)pDrawable) );
- cmap = (ColormapPtr)LookupIDByType( c, RT_COLORMAP );
-
- if( cmap->class == TrueColor )
- {
- if( pGC->fillStyle != FillTiled || pGC->tileIsPixel ) {
- unsigned short r, g, b;
-
- r = (pGC->fgPixel & cmap->pVisual->redMask)
- >> (cmap->pVisual->offsetRed );
- g = (pGC->fgPixel & cmap->pVisual->greenMask)
- >> (cmap->pVisual->offsetGreen);
- b = (pGC->fgPixel & cmap->pVisual->blueMask)
- >> (cmap->pVisual->offsetBlue);
-
- PclLookUp(cmap, cPriv, &r, &g, &b);
- sprintf( t, "\033%%0A\033*v%ua%ub%uc0I\033%%0B", r, g, b);
- SEND_PCL( *outFile, t );
- }
- }
- else /* PseudoColor or StaticGray */
- {
- sprintf( t, "SP%ld;", (long) pGC->fgPixel );
- SEND_PCL( *outFile, t );
- }
-#else
- ScreenPtr screen;
- screen = pDrawable->pScreen;
- if ( pGC->fgPixel == screen->whitePixel )
- SEND_PCL( *outFile, "SP0;");
- else
- SEND_PCL( *outFile, "SP1;");
-#endif /* XP_PCL_COLOR */
- }
-
- if( changeMask & GCJoinStyle )
- switch( pGC->joinStyle )
- {
- case JoinMiter:
- SEND_PCL( *outFile, "LA2,1;" );
- break;
- case JoinRound:
- SEND_PCL( *outFile, "LA2,4;" );
- break;
- case JoinBevel:
- SEND_PCL( *outFile, "LA2,5;" );
- break;
- }
-
- if( changeMask & GCCapStyle )
- switch( pGC->capStyle )
- {
- case CapNotLast:
- case CapButt:
- SEND_PCL( *outFile, "LA1,1;" );
- break;
- case CapRound:
- SEND_PCL( *outFile, "LA1,4;" );
- break;
- case CapProjecting:
- SEND_PCL( *outFile, "LA1,2;" );
- break;
- }
-
- if( changeMask & GCLineWidth )
- {
- float penWidth, pixelsPerMM;
- ScreenPtr screen;
- char temp[30];
-
- if( pGC->lineWidth == 0 || pGC->lineWidth == 1 )
- /* A pen width of 0.0 mm gives a one-pixel-wide line */
- penWidth = 0.0;
- else
- {
- screen = pDrawable->pScreen;
- pixelsPerMM = (float)screen->width / (float)screen->mmWidth;
-
- penWidth = pGC->lineWidth / pixelsPerMM;
- }
- sprintf( temp, "PW%g;", penWidth );
- SEND_PCL( *outFile, temp );
- }
-
- if( changeMask & GCLineStyle )
- {
- int i, num = pGC->numInDashList;
- double total;
- char t[30];
-
- switch( pGC->lineStyle )
- {
- case LineSolid:
- SEND_PCL( *outFile, "LT;" );
- break;
- case LineOnOffDash:
- /*
- * Calculate the pattern length of the dashes, in pixels,
- * then convert to mm
- */
- for( i = 0, total = 0.0; i < 20 && i < num; i++ )
- total += pGC->dash[i];
- if( num % 2 )
- for( i = num; i < 20 && i < num + num; i++ )
- total += pGC->dash[i-num];
-
- total *= ( (double)pDrawable->pScreen->mmWidth /
- (double)pDrawable->pScreen->width );
-
- sprintf( t, "LT8,%f,1;", total );
- SEND_PCL( *outFile, t );
- break;
- }
- }
-
-
- if( changeMask & GCFillStyle )
- switch( pGC->fillStyle )
- {
- case FillSolid:
- SEND_PCL( *outFile, "FT1;TR0;CF;" );
- break;
- case FillTiled:
- SEND_PCL( *outFile, "FT22,100;TR0;CF2,0;" );
- break;
- case FillOpaqueStippled:
- SEND_PCL( *outFile, "FT22,101;TR0;CF2,0;" );
- if( pGC->fgPixel != gcPriv->stippleFg ||
- pGC->bgPixel != gcPriv->stippleBg )
- changeMask |= GCStipple;
- break;
- case FillStippled:
- SEND_PCL( *outFile, "FT22,102;TR1;CF2,0;" );
- break;
- }
-
- if( changeMask & GCTile && !pGC->tileIsPixel )
- {
- char *bits;
- int h, w, sz;
-
- h = pGC->tile.pixmap->drawable.height;
- w = pGC->tile.pixmap->drawable.width;
-
- if( pGC->tile.pixmap->drawable.depth == 1 )
- {
- sz = h * BitmapBytePad( w );
-
- bits = (char *)xalloc( sz );
- mfbGetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, XYPixmap, ~0, bits);
- PclSendPattern( bits, sz, 1, h, w, 100, *outFile );
- xfree( bits );
- }
- else if( pGC->tile.pixmap->drawable.depth == 8 )
- {
- sz = h * PixmapBytePad( w, 8 );
- bits = (char *)xalloc( sz );
- cfbGetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, ZPixmap, ~0, bits);
- PclSendPattern( bits, sz, 8, h, w, 100, *outFile );
- xfree( bits );
- }
-#if PSZ == 32
- else
- {
- sz = h * PixmapBytePad( w, 24 );
-
- bits = (char *)xalloc( sz );
- cfb32GetImage(&(pGC->tile.pixmap->drawable), 0, 0, w, h, ZPixmap, ~0, bits);
- PclSendPattern( bits, sz, 24, h, w, 100, *outFile );
- xfree( bits );
- }
-#endif
- }
-
- if( changeMask & ( GCTileStipXOrigin | GCTileStipYOrigin ) )
- {
- char t[30];
-
- sprintf( t, "AC%d,%d;", pGC->patOrg.x, pGC->patOrg.y );
- SEND_PCL( *outFile, t );
- }
-
- /*
- * We have to resend the stipple pattern either when the stipple itself
- * changes, or if we're in FillOpaqueStippled mode and either the
- * foreground or the background color changes.
- */
- if( changeMask & GCStipple ||
- ( pGC->fillStyle == FillOpaqueStippled &&
- ( pGC->fgPixel != gcPriv->stippleFg ||
- pGC->bgPixel != gcPriv->stippleBg ) ) )
- {
- int h, w, i, sz, w2;
- char *bits, *row, t[30];
- PixmapPtr scratchPix;
- GCPtr scratchGC;
-
- if( pGC->stipple != NULL )
- {
- SEND_PCL( *outFile, "\033%0A" );
-
- h = pGC->stipple->drawable.height;
- w = pGC->stipple->drawable.width;
- sz = h * BitmapBytePad( w );
-
- bits = (char *)xalloc( sz );
- mfbGetImage( &(pGC->stipple->drawable), 0, 0, w, h, XYPixmap, ~0, bits );
-
- w2 = ( w / 8 ) + ( ( w%8 ) ? 1 : 0 );
- /*
- * XXX The PCL docs say that I need to word-align each
- * XXX row, but I get garbage when I do...
- */
- /*
- if( w2 % 2 )
- w2++;
- */
-
- sprintf( t, "\033*c102g%dW", h * w2 + 8 );
- SEND_PCL( *outFile, t );
-
- sprintf( t, "%c%c%c%c%c%c%c%c", 0, 0, 1, 0, h>>8, h&0xff, w>>8,
- w&0xff );
- SEND_PCL_COUNT( *outFile, t, 8 );
-
- for( row = bits, i = 0; i < h; i++, row += BitmapBytePad( w ) )
- SEND_PCL_COUNT( *outFile, row, w2 );
-
- SEND_PCL( *outFile, "\033%0B" );
-
- xfree( bits );
-
- /*
- * Also do the opaque stipple, as a tile
- */
- if( pGC->depth != 1 )
- sz = h * PixmapBytePad( w, pGC->depth );
- bits = (char *)xalloc( sz );
-
- scratchPix =
- (*pGC->pScreen->CreatePixmap)( pGC->pScreen,
- w, h, pGC->depth );
- scratchGC = GetScratchGC( pGC->depth, pGC->pScreen );
- CopyGC( pGC, scratchGC, ~0L );
-
- if( pGC->depth == 1 )
- {
- mfbValidateGC( scratchGC, ~0L,
- (DrawablePtr)scratchPix );
- mfbCopyPlane( &(pGC->stipple->drawable),
- (DrawablePtr)scratchPix, scratchGC, 0,
- 0, w, h, 0, 0, 1 );
- mfbGetImage( &(scratchPix->drawable), 0, 0, w, h, XYPixmap, ~0,
- bits );
- }
- else if( pGC->depth <= 32 )
- {
-#if PSZ == 8
- cfbValidateGC( scratchGC, ~0L,
- (DrawablePtr)scratchPix );
- cfbCopyPlane( &(pGC->stipple->drawable),
- (DrawablePtr)scratchPix, scratchGC, 0,
- 0, w, h, 0, 0, 1 );
- cfbGetImage( &(scratchPix->drawable), 0, 0, w, h, ZPixmap, ~0,
- bits );
-#else
- cfb32ValidateGC( scratchGC, ~0L,
- (DrawablePtr)scratchPix );
- cfb32CopyPlane( pGC->stipple,
- (DrawablePtr)scratchPix, scratchGC, 0,
- 0, w, h, 0, 0, 1 );
- cfb32GetImage( scratchPix, 0, 0, w, h, ZPixmap, ~0,
- bits );
-#endif
- }
- PclSendPattern( bits, sz, pGC->depth, h, w, 101, *outFile );
- FreeScratchGC( scratchGC );
- (*pGC->pScreen->DestroyPixmap)( scratchPix );
- xfree( bits );
- }
- }
-
- if( changeMask & ( GCTileStipXOrigin | GCTileStipYOrigin ) )
- {
- char t[30];
-
- sprintf( t, "AC%d,%d;", pGC->patOrg.x, pGC->patOrg.y );
- SEND_PCL( *outFile, t );
- }
-
- if( changeMask & GCDashList )
- {
- int num = pGC->numInDashList;
- double total;
- char dashes[20];
- char t[100], t2[20];
-
- /* Make up the doubled dash list, if necessary */
- for( i = 0; i < 20 && i < num; i++ )
- dashes[i] = pGC->dash[i];
-
- if( num % 2 )
- {
- for( i = num; i < 20 && i < num + num; i++ )
- dashes[i] = dashes[i-num];
- if( ( num *= 2 ) > 20 )
- num = 20;
- }
-
- /* Add up dash lengths to get percentage */
- for( i = 0, total = 0; i < num; i++ )
- total += dashes[i];
-
- /* Build up the HP-GL/2 for the dash list */
- strcpy( t, "UL8" );
- for( i = 0; i < num; i++ )
- {
- sprintf( t2, ",%d",
- (int)( ( (double)dashes[i] / total * 100.0 ) + 0.5 ) );
- strcat( t, t2 );
- }
- strcat( t, ";" );
- SEND_PCL( *outFile, t );
- }
-
-
- /* Go back to PCL mode */
- SEND_PCL( *outFile, "\033%0A" );
-
- /*
- * Update the drawable's private information, which includes
- * erasing the drawable's private changeMask, since all the
- * changes have been made.
- */
- if( changeMask )
- PclSetDrawablePrivateGC( pDrawable, *pGC );
-
- return TRUE;
-}
-
-/*
- * PclComputeCompositeClip()
- *
- * I'd like to use the miComputeCompositeClip function, but it sticks
- * things into the mi GC privates, where the PCL driver can't get at
- * it. So, rather than mess around with the mi code, I ripped it out
- * and made the appropriate changes here.
- */
-
-
-void
-PclComputeCompositeClip(
- GCPtr pGC,
- DrawablePtr pDrawable)
-{
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors)
- {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- }
- else
- {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy (or
- * maybe re-use) it later. this way, we avoid unnecessary copying of
- * regions. (this wins especially if many clients clip by children
- * and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE)
- {
- if (freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- }
- else
- {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip)
- {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pGC->pScreen, pregWin);
- }
- else if (freeTmpClip)
- {
- REGION_INTERSECT(pGC->pScreen, pregWin, pregWin,
- pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- }
- else
- {
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- }
- } /* end of composite clip for a window */
- else
- {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- pixbounds.x1 = 0;
- pixbounds.y1 = 0;
- pixbounds.x2 = pDrawable->width;
- pixbounds.y2 = pDrawable->height;
-
- if (pGC->freeCompClip)
- {
- REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
- }
- else
- {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION)
- {
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
- -pGC->clipOrg.x, -pGC->clipOrg.y);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
- pGC->clipOrg.x, pGC->clipOrg.y);
- }
- } /* end of composite clip for pixmap */
-}
-
-/*
- * PclValidateGC()
- *
- * Unlike many screen GCValidate routines, this function should not need
- * to mess with setting the drawing functions. Different drawing
- * functions are usually needed to optimize such things as drawing
- * wide or dashed lines; this functionality will be handled primarily
- * by the printer itself, while the necessary PCL code to set the
- * attributes will be done in PclUpdateDrawableGC().
- */
-
-/*ARGSUSED*/
-void
-PclValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable)
-{
- /*
- * Pixmaps should be handled by their respective validation
- * functions.
- */
- if( pDrawable->type == DRAWABLE_PIXMAP )
- {
- if( pDrawable->depth == 1 )
- {
- mfbValidateGC( pGC, ~0, pDrawable );
- }
- else if( pDrawable->depth <= 32 )
- {
-#if PSZ == 8
- cfbValidateGC( pGC, ~0, pDrawable );
-#else
- cfb32ValidateGC( pGC, ~0, pDrawable );
-#endif
- }
- return;
- }
-
- /*
- * Reset the drawing operations
- */
- pGC->ops = &PclGCOps;
-
- /*
- * Validate the information, and correct it if necessary.
- */
-
- /*
- * If necessary, compute the composite clip region. (Code ripped
- * from migc.c)
- */
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- PclComputeCompositeClip(pGC, pDrawable);
- }
-
- /*
- * PCL does not directly support the DoubleDash line style, nor is
- * there an easy way to simulate it, so we'll just change it to a
- * LineOnOffDash, which is supported by PCL.
- */
- if( ( changes & GCLineStyle ) && ( pGC->lineStyle == LineDoubleDash ) )
- pGC->lineStyle = LineOnOffDash;
-
- /*
- * Update the drawable's changeMask to reflect the changes made to the GC.
- */
-/*
- PclSetDrawablePrivateGC( pDrawable, *pGC, changes );
-*/
-}
diff --git a/Xprint/pcl/PclInit.c b/Xprint/pcl/PclInit.c
deleted file mode 100644
index 5ee49631e..000000000
--- a/Xprint/pcl/PclInit.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* $Xorg: PclInit.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclInit.c
-** *
-** * Contents:
-** * Initialization code of Pcl driver for the print server.
-** *
-** * Created: 1/30/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclInit.c,v 1.12 2002/10/16 21:13:32 dawes Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "Pcl.h"
-
-#include "cfb.h"
-#include "Xos.h" /* for unlink() */
-
-#include "attributes.h"
-#include "DiPrint.h"
-
-#define MODELDIRNAME "/models"
-
-static void AllocatePclPrivates(ScreenPtr pScreen);
-static int PclInitContext(XpContextPtr pCon);
-static Bool PclDestroyContext(XpContextPtr pCon);
-
-int PclScreenPrivateIndex;
-int PclContextPrivateIndex;
-int PclPixmapPrivateIndex;
-int PclWindowPrivateIndex;
-int PclGCPrivateIndex;
-
-#ifdef XP_PCL_COLOR
-/*
- * The supported visuals on this screen
- */
-static VisualRec Visuals[] =
-{
- { 1, StaticGray, 1, 2, 1, 0, 0, 0, 0, 0, 0 },
- { 2, PseudoColor, 8, 256, 8, 0, 0, 0, 0, 0, 0 },
- { 3, TrueColor, 8, 256, 24, 0xFF0000, 0xFF00, 0xFF, 16, 8, 0 }
-};
-
-/*
- * The supported depths on this screen
- */
-static DepthRec Depths[] =
-{
- { 1, 1, NULL },
- { 8, 1, NULL },
- { 24, 1, NULL }
-};
-#else
-/*
- * The supported visuals on this screen
- */
-static VisualRec Visuals[] =
-{
- { 1, StaticGray, 1, 2, 1, 0, 0, 0, 0, 0, 0}
-};
-
-/*
- * The supported depths on this screen
- */
-static DepthRec Depths[] =
-{
- { 1, 1, NULL }
-};
-#endif /* XP_PCL_COLOR */
-
-
-#define NUM_VISUALS(visuals) (sizeof(visuals) / sizeof(VisualRec))
-#define NUM_DEPTHS(depths) (sizeof(depths) / sizeof(DepthRec))
-
-Bool
-PclCloseScreen(int index,
- ScreenPtr pScreen)
-{
- PclScreenPrivPtr pPriv = pScreen->devPrivates[PclScreenPrivateIndex].ptr;
-
- pScreen->CloseScreen = pPriv->CloseScreen;
- xfree( pPriv );
-
- return (*pScreen->CloseScreen)(index, pScreen);
-}
-
-Bool
-InitializePclDriver(
- int ndx,
- ScreenPtr pScreen,
- int argc,
- char **argv)
-{
- int maxRes, xRes, yRes, maxDim;
- unsigned i;
- PclScreenPrivPtr pPriv;
-
- /*
- * Register this driver's InitContext function with the print
- * extension. This is a bit sleazy, as the extension hasn't yet
- * been initialized, but the extensionneeds to know this, and this
- * seems the best time to provide the information.
- */
-#ifdef XP_PCL_COLOR
- XpRegisterInitFunc( pScreen, "XP-PCL-COLOR", PclInitContext );
-#elif XP_PCL_MONO
- XpRegisterInitFunc( pScreen, "XP-PCL-MONO", PclInitContext );
-#else
- XpRegisterInitFunc( pScreen, "XP-PCL-LJ3", PclInitContext );
-#endif /* XP_PCL_MONO */
-
- /*
- * Create and fill in the devPrivate for the PCL driver.
- */
- AllocatePclPrivates(pScreen);
-
- pPriv =
- (PclScreenPrivPtr)pScreen->devPrivates[PclScreenPrivateIndex].ptr;
-
- maxDim = MAX( pScreen->height, pScreen->width );
- xRes = pScreen->width / ( pScreen->mmWidth / 25.4 );
- yRes = pScreen->height / ( pScreen->mmHeight / 25.4 );
- maxRes = MAX( xRes, yRes );
-
-#ifdef XP_PCL_COLOR
- cfbScreenInit( pScreen, NULL, maxDim, maxDim, maxRes, maxRes,
- maxRes );
- /*
- * Clean up the fields that we stomp (code taken from cfbCloseScreen)
- */
- for( i = 0; (int) i < pScreen->numDepths; i++ )
- xfree( pScreen->allowedDepths[i].vids );
- xfree( pScreen->allowedDepths );
- xfree( pScreen->visuals );
-#else
- mfbScreenInit( pScreen, NULL, maxDim, maxDim, maxRes, maxRes,
- maxRes );
-#endif /* XP_PCL_COLOR */
-
- miInitializeBackingStore ( pScreen );
-
- pScreen->defColormap = FakeClientID(0);
- pScreen->blackPixel = 1;
- pScreen->whitePixel = 0;
-
- pPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = PclCloseScreen;
-
- pScreen->QueryBestSize = (QueryBestSizeProcPtr)PclQueryBestSize;
- pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop;
- pScreen->GetImage = (GetImageProcPtr)_XpVoidNoop;
- pScreen->GetSpans = (GetSpansProcPtr)_XpVoidNoop;
- pScreen->CreateWindow = PclCreateWindow;
- pScreen->DestroyWindow = PclDestroyWindow;
-/*
- pScreen->PositionWindow = PclPositionWindow;
-*/
- pScreen->ChangeWindowAttributes = PclChangeWindowAttributes;
-/*
- pScreen->RealizeWindow = PclMapWindow;
- pScreen->UnrealizeWindow = PclUnmapWindow;
-*/
- pScreen->PaintWindowBackground = PclPaintWindow;
- pScreen->PaintWindowBorder = PclPaintWindow;
- pScreen->CopyWindow = PclCopyWindow; /* XXX Hard routine to write! */
-
- pScreen->CreatePixmap = PclCreatePixmap;
- pScreen->DestroyPixmap = PclDestroyPixmap;
- pScreen->RealizeFont = PclRealizeFont;
- pScreen->UnrealizeFont = PclUnrealizeFont;
- pScreen->CreateGC = PclCreateGC;
-
- pScreen->CreateColormap = PclCreateColormap;
- pScreen->DestroyColormap = PclDestroyColormap;
- pScreen->InstallColormap = (InstallColormapProcPtr)NoopDDA;
- pScreen->UninstallColormap = (UninstallColormapProcPtr)NoopDDA;
- pScreen->ListInstalledColormaps = PclListInstalledColormaps;
- pScreen->StoreColors = PclStoreColors;
-/*
- pScreen->ResolveColor = PclResolveColor;
-*/
-
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- pScreen->ConstrainCursor = PclConstrainCursor;
- pScreen->CursorLimits = PclCursorLimits;
- pScreen->DisplayCursor = PclDisplayCursor;
- pScreen->RealizeCursor = PclRealizeCursor;
- pScreen->UnrealizeCursor = PclUnrealizeCursor;
- pScreen->RecolorCursor = PclRecolorCursor;
- pScreen->SetCursorPosition = PclSetCursorPosition;
-
- pScreen->visuals = Visuals;
- pScreen->numVisuals = NUM_VISUALS( Visuals );
- pScreen->allowedDepths = Depths;
- pScreen->numDepths = NUM_DEPTHS( Depths );
-
- for( i = 0; i < NUM_DEPTHS( Depths ); i++ )
- {
- pScreen->allowedDepths[i].vids =
- (VisualID *)xalloc( sizeof(VisualID ) );
- pScreen->allowedDepths[i].vids[0] = i + 1;
- }
-
-#ifdef XP_PCL_COLOR
- pScreen->rootVisual = 2;
- pScreen->rootDepth = 8;
-#else
- pScreen->rootVisual = 1;
- pScreen->rootDepth = 1;
-#endif /* XP_PCL_COLOR */
-
- pPriv->colormaps = NULL;
- PclCreateDefColormap( pScreen );
-
- return TRUE;
-}
-
-static void
-AllocatePclPrivates(ScreenPtr pScreen)
-{
- static unsigned long PclGeneration = 0;
-
- if((unsigned long) PclGeneration != serverGeneration)
- {
- PclScreenPrivateIndex = AllocateScreenPrivateIndex();
-
- PclWindowPrivateIndex = AllocateWindowPrivateIndex();
- AllocateWindowPrivate( pScreen, PclWindowPrivateIndex,
- sizeof( PclWindowPrivRec ) );
-
- PclContextPrivateIndex = XpAllocateContextPrivateIndex();
- XpAllocateContextPrivate( PclContextPrivateIndex,
- sizeof( PclContextPrivRec ) );
-
- PclGCPrivateIndex = AllocateGCPrivateIndex();
- AllocateGCPrivate( pScreen, PclGCPrivateIndex,
- sizeof( PclGCPrivRec ) );
-
- PclPixmapPrivateIndex = AllocatePixmapPrivateIndex();
- AllocatePixmapPrivate( pScreen, PclPixmapPrivateIndex,
- sizeof( PclPixmapPrivRec ) );
-
- PclGeneration = serverGeneration;
- }
-
- pScreen->devPrivates[PclScreenPrivateIndex].ptr = (pointer)xalloc(
- sizeof(PclScreenPrivRec));
-}
-
-/*
- * PclInitContext
- *
- * Establish the appropriate values for a PrintContext used with the PCL
- * driver.
- */
-
-static char DOC_ATT_SUPP[]="document-attributes-supported";
-static char DOC_ATT_VAL[]="document-format";
-static char JOB_ATT_SUPP[]="job-attributes-supported";
-static char JOB_ATT_VAL[]="";
-static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
-static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \
-default-input-tray default-medium plex";
-
-static int
-PclInitContext(XpContextPtr pCon)
-{
- XpDriverFuncsPtr pFuncs;
- PclContextPrivPtr pConPriv;
- char *server, *attrStr;
- char *modelID;
- char *configDir;
- char *pathName;
- int i, j;
- float width, height;
- XpOidMediumDiscreteSizeList* ds_list;
- XpOidArea* repro;
- XpOid page_size;
- XpOidMediumSS* m;
-
- /*
- * Initialize the attribute store for this printer.
- */
- XpInitAttributes( pCon );
-
- /*
- * Initialize the function pointers
- */
- pFuncs = &( pCon->funcs );
- pFuncs->StartJob = PclStartJob;
- pFuncs->EndJob = PclEndJob;
- pFuncs->StartDoc = PclStartDoc;
- pFuncs->EndDoc = PclEndDoc;
- pFuncs->StartPage = PclStartPage;
- pFuncs->EndPage = PclEndPage;
- pFuncs->PutDocumentData = PclDocumentData;
- pFuncs->GetDocumentData = PclGetDocumentData;
- pFuncs->GetAttributes = PclGetAttributes;
- pFuncs->SetAttributes = PclSetAttributes;
- pFuncs->AugmentAttributes = PclAugmentAttributes;
- pFuncs->GetOneAttribute = PclGetOneAttribute;
- pFuncs->DestroyContext = PclDestroyContext;
- pFuncs->GetMediumDimensions = PclGetMediumDimensions;
- pFuncs->GetReproducibleArea = PclGetReproducibleArea;
-
-
- /*
- * Set up the context privates
- */
- pConPriv =
- (PclContextPrivPtr)pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- pConPriv->jobFileName = (char *)NULL;
- pConPriv->pageFileName = (char *)NULL;
- pConPriv->pJobFile = (FILE *)NULL;
- pConPriv->pPageFile = (FILE *)NULL;
- pConPriv->dash = NULL;
- pConPriv->validGC = 0;
-
- pConPriv->getDocClient = (ClientPtr)NULL;
- pConPriv->getDocBufSize = 0;
- modelID = XpGetOneAttribute(pCon, XPPrinterAttr, "xp-model-identifier");
- if ( (configDir = XpGetConfigDir(False)) != (char *) NULL ) {
- pathName = (char *)xalloc(strlen(configDir) + strlen(MODELDIRNAME) +
- strlen(modelID) + strlen("color.map") + 4);
- if (pathName) {
- sprintf(pathName, "%s/%s/%s/%s", configDir, MODELDIRNAME, modelID,
- "color.map");
- pConPriv->ctbl = PclReadMap(pathName, &pConPriv->ctbldim);
- xfree(pathName);
-
- } else
- pConPriv->ctbl = NULL;
- } else
- pConPriv->ctbl = NULL;
-
-#ifdef XP_PCL_LJ3
- /*
- * Initialize the spooling buffer for saving the figures temporary
- * (LaserJet IIIs printers don't support the macro function which
- * includes some HP-GL/2 commands.)
- */
- pConPriv->fcount = 0;
- if ( !(pConPriv->figures = (char *)xalloc(1024)) )
- pConPriv->fcount_max = 0;
- else
- pConPriv->fcount_max = 1024;
-#endif /* XP_PCL_LJ3 */
-
- /*
- * document-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP );
- if( ( attrStr = (char *)xalloc(strlen(server) + strlen(DOC_ATT_SUPP)
- + strlen(DOC_ATT_VAL) +
- strlen(PAGE_ATT_VAL) + 6 ) )
- == (char *)NULL )
- return BadAlloc;
- sprintf( attrStr, "*%s:\t%s %s %s", DOC_ATT_SUPP, server,
- DOC_ATT_VAL, PAGE_ATT_VAL );
- XpAugmentAttributes( pCon, XPPrinterAttr, attrStr );
- xfree( attrStr );
-
- /*
- * job-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP );
- if( ( attrStr = (char *)xalloc(strlen(server) + strlen(JOB_ATT_SUPP)
- + strlen(JOB_ATT_VAL) + 4 ) )
- == (char *)NULL )
- return BadAlloc;
- sprintf( attrStr, "*%s:\t%s %s", JOB_ATT_SUPP, server, JOB_ATT_VAL );
- XpAugmentAttributes( pCon, XPPrinterAttr, attrStr );
- xfree( attrStr );
-
- /*
- * xp-page-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP );
- if( ( attrStr = (char *)xalloc(strlen(server) + strlen(PAGE_ATT_SUPP)
- + strlen(PAGE_ATT_VAL) + 4 ) )
- == (char *)NULL )
- return BadAlloc;
- sprintf( attrStr, "*%s:\t%s %s", PAGE_ATT_SUPP, server, PAGE_ATT_VAL );
- XpAugmentAttributes( pCon, XPPrinterAttr, attrStr );
- xfree( attrStr );
-
- /*
- * Validate the attribute pools
- */
- XpValidateAttributePool( pCon, XPPrinterAttr, &PclValidatePoolsRec );
-
- /*
- * Munge the reproducible areas to reflect the fact that PCL will not let
- * me move the right or left margins closer than .25" to the edge of the
- * paper.
- */
- m = XpGetMediumSSAttr( pCon, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported,
- (const XpOidList*) NULL,
- (const XpOidList*) NULL );
- for( i = 0; i < XpOidMediumSSCount( m ); i++ )
- {
- if( XpOidMediumSS_DISCRETE == (m->mss)[i].mstag )
- {
- ds_list = (m->mss)[i].ms.discrete;
- for( j = 0; j < ds_list->count; j++ )
- {
- repro = &(ds_list->list)[j].assured_reproduction_area;
- page_size = (ds_list->list)[j].page_size;
- XpGetMediumMillimeters( page_size, &width, &height );
-
- if( repro->minimum_x < 6.35 )
- repro->minimum_x = 6.35;
- if( width - repro->maximum_x < 6.35 )
- repro->maximum_x = width - 6.35;
- }
- }
- }
- XpPutMediumSSAttr( pCon, XPPrinterAttr,
- xpoid_att_medium_source_sizes_supported, m );
- XpOidMediumSSDelete( m );
-
- /*
- * Finish validating the attribute pools
- */
-
- XpValidateAttributePool( pCon, XPDocAttr, &PclValidatePoolsRec );
- XpValidateAttributePool( pCon, XPJobAttr, &PclValidatePoolsRec );
- XpValidateAttributePool( pCon, XPPageAttr, &PclValidatePoolsRec );
-
- /*
- * Clear out the colormap storage
- */
- pConPriv->palettes = NULL;
-
- return Success;
-}
-
-static Bool
-PclDestroyContext(XpContextPtr pCon)
-{
- PclContextPrivPtr pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- PclPaletteMapPtr p, t;
- PclCmapToContexts *pCmap;
- ScreenPtr screen;
- PclScreenPrivPtr sPriv;
- PclContextListPtr con, prevCon, temp;
-
-
- /*
- * Clean up the temporary files
- */
- if( pConPriv->pPageFile != (FILE *)NULL )
- {
- fclose( pConPriv->pPageFile );
- pConPriv->pPageFile = (FILE *)NULL;
- }
- if( pConPriv->pageFileName != (char *)NULL )
- {
- unlink( pConPriv->pageFileName );
- xfree( pConPriv->pageFileName );
- pConPriv->pageFileName = (char *)NULL;
- }
-
- if( pConPriv->pJobFile != (FILE *)NULL )
- {
- fclose( pConPriv->pJobFile );
- pConPriv->pJobFile = NULL;
- }
- if( pConPriv->jobFileName != (char *)NULL )
- {
- unlink( pConPriv->jobFileName );
- xfree( pConPriv->jobFileName );
- pConPriv->jobFileName = (char *)NULL;
- }
-
- xfree( pConPriv->dash );
- xfree(pConPriv->ctbl);
- pConPriv->ctbl = NULL;
-#ifdef XP_PCL_LJ3
- xfree( pConPriv->figures );
-#endif /* XP_PCL_LJ3 */
-
- /*
- * Destroy the colormap<->palette mappings
- */
- p = pConPriv->palettes;
- while( p )
- {
- t = p;
- p = p->next;
- xfree( t );
- }
- pConPriv->palettes = NULL;
-
- /*
- * Remove the context from the screen-level colormap<->contexts mappings
- */
- screen = screenInfo.screens[pCon->screenNum];
- sPriv = (PclScreenPrivPtr)screen->devPrivates[PclScreenPrivateIndex].ptr;
- pCmap = sPriv->colormaps;
- while( pCmap )
- {
- con = pCmap->contexts;
- prevCon = NULL;
-
- while( con )
- {
- if( con->context->contextID == pCon->contextID )
- {
- if( prevCon )
- {
- temp = con;
- prevCon->next = con = con->next;
- }
- else
- {
- temp = pCmap->contexts;
- pCmap->contexts = con = con->next;
- }
- xfree( temp );
- }
- else
- con = con->next;
- }
-
- pCmap = pCmap->next;
- }
-
- XpDestroyAttributes(pCon);
-
- return Success;
-}
-
-XpContextPtr
-PclGetContextFromWindow(WindowPtr win)
-{
- PclWindowPrivPtr pPriv;
-
- while( win )
- {
- pPriv =
- (PclWindowPrivPtr)win->devPrivates[PclWindowPrivateIndex].ptr;
- if( pPriv->validContext )
- return pPriv->context;
-
- win = win->parent;
- }
-
- return NULL;
-}
diff --git a/Xprint/pcl/PclLine.c b/Xprint/pcl/PclLine.c
deleted file mode 100644
index 3c10f97ca..000000000
--- a/Xprint/pcl/PclLine.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* $Xorg: PclLine.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclLine.c
-** *
-** * Contents:
-** * Line drawing routines for the PCL driver
-** *
-** * Created: 10/11/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclLine.c,v 1.7 2001/01/17 22:36:30 dawes Exp $ */
-
-#include "Pcl.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-/*
- * PclPolyLine()
- * PclPolySegment()
- *
- * Generates PCL code to draw a polyline, or a collection of distinct
- * line segments, clipped by the current clip region. Since PCL
- * supports clipping to a rectangle, and the clip region is
- * represented as a collection of visible rectangles, we can draw and
- * clip the line by repeatedly drawing the complete line, clipped to
- * each rectangle in the clip region.
- *
- * Since each box in the clipping region generates approximately 30
- * bytes of PCL code, we have to have a way to avoid having a large
- * number of boxes. The worst problem the case where the clipping
- * region is a collection of one-pixel-high boxes, perhaps arising
- * from a bitmap clip mask, or a region defined by a non-rectangular
- * polygon.
- *
- * To alleviate this problem, we create a second clipping region,
- * which consists of the union of the bounding boxes of each line
- * segment. (Each bounding box is also increased by some amount
- * related to the current line width to allow for non-zero-width
- * lines, and for the various end and join styles.) This region is
- * intersected with the "real" clipping region to get the region used
- * to actually clip the polyline. This should result in a significant
- * reduction in the number of clip rectangles, as the region-handling
- * code should consolidate many of the fragments of one-pixel-high
- * rectangles into larger rectangles.
- */
-
-void
-PclPolyLine(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nPoints,
- xPoint *pPoints)
-{
- char t[80];
- FILE *outFile;
- int xoffset = 0, yoffset = 0;
- int nbox;
- BoxPtr pbox;
- xRectangle *drawRects, *r;
- RegionPtr drawRegion, region;
- short fudge;
- int i;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Allocate the storage required to deal with the clipping
- * regions.
- */
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- drawRects = (xRectangle *)
- xalloc( ( nPoints - 1 ) * sizeof( xRectangle ) );
-
- /*
- * Calculate the "fudge factor" based on the line width.
- * Multiplying by three seems to be a good first guess.
- * XXX I need to think of a way to test this.
- */
- fudge = 3 * pGC->lineWidth + 1;
-
- /*
- * Generate the PCL code to draw the polyline, by defining it as a
- * macro which uses the HP-GL/2 line drawing function.
- */
-
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- sprintf( t, "PU%d,%dPD\n", pPoints[0].x + pDrawable->x,
- pPoints[0].y + pDrawable->y );
- SAVE_PCL( outFile, pConPriv, t ); /* Move to the start of the polyline */
-
- switch( mode )
- {
- case CoordModeOrigin:
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
- SAVE_PCL( outFile, pConPriv, "PA" );
- break;
- case CoordModePrevious:
- xoffset = yoffset = 0;
- SAVE_PCL( outFile, pConPriv, "PR" );
- break;
- }
-
- /*
- * Build the "drawing region" as we build the PCL to draw the
- * line.
- */
- for(i = 1, r = drawRects; i < nPoints; i++, r++ )
- {
- if( i != 1 )
- SAVE_PCL( outFile, pConPriv, "," );
-
- sprintf( t, "%d,%d", pPoints[i].x + xoffset,
- pPoints[i].y + yoffset );
- SAVE_PCL( outFile, pConPriv, t );
-
- r->x = MIN( pPoints[i-1].x, pPoints[i].x ) + xoffset - fudge;
- r->y = MIN( pPoints[i-1].y, pPoints[i].y ) + yoffset - fudge;
- r->width = abs( pPoints[i-1].x - pPoints[i].x ) + 2 * fudge;
- r->height = abs( pPoints[i-1].y - pPoints[i].y ) + 2 * fudge;
- }
- SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */
- MACRO_END( outFile );
-
- /*
- * Convert the collection of rectangles into a proper region, then
- * intersect it with the clip region.
- */
- drawRegion = RECTS_TO_REGION( pGC->pScreen, nPoints - 1,
- drawRects, CT_UNSORTED );
- if( mode == CoordModePrevious )
- REGION_TRANSLATE( pGC->pScreen, drawRegion, pPoints[0].x, pPoints[0].y );
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the entire polyline to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- xfree( drawRects );
-}
-
-void
-PclPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSegments,
- xSegment *pSegments)
-{
- FILE *outFile, *dummy;
- char t[80];
- int xoffset, yoffset;
- int nbox, i;
- unsigned long valid;
- BoxPtr pbox;
- xRectangle *drawRects, *r;
- RegionPtr drawRegion, region;
- short fudge;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
- GC cacheGC;
-
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Allocate the storage for the temporary regions.
- */
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- drawRects = (xRectangle *)
- xalloc( nSegments * sizeof( xRectangle ) );
-
- /*
- * Calculate the fudge factor, based on the line width
- */
- fudge = pGC->lineWidth * 3 + 1;
-
- /*
- * Turn off line joining.
- */
- SEND_PCL( outFile, "\033%0BLA2,6;\033%0A" );
-
- /*
- * Generate the PCL code to draw the segments, by defining them as
- * a macro which uses the HP-GL/2 line drawing function.
- *
- * XXX I wonder if this should be implemented using the Encoded
- * XXX Polyline function. Since I'm only sending it once, it's not
- * XXX necessarily too important.
- */
-
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0, r = drawRects; i < nSegments; i++, r++ )
- {
- r->x = MIN( pSegments[i].x1, pSegments[i].x2 ) + xoffset;
- r->y = MIN( pSegments[i].y1, pSegments[i].y2 ) + yoffset;
- r->width = abs( pSegments[i].x1 - pSegments[i].x2 );
- r->height = abs( pSegments[i].y1 - pSegments[i].y2 );
-
- sprintf( t, "PU%d,%d;PD%d,%d;", pSegments[i].x1 + xoffset,
- pSegments[i].y1 + yoffset, pSegments[i].x2 +
- xoffset, pSegments[i].y2 + yoffset );
- SAVE_PCL( outFile, pConPriv, t );
-
- r->x -= fudge;
- r->y -= fudge;
- r->width += 2 * fudge;
- r->height += 2 * fudge;
- }
- SAVE_PCL( outFile, pConPriv, "\033%0A" );
- MACRO_END ( outFile );
-
- /*
- * Convert the collection of rectangles into a proper region, then
- * intersect it with the clip region.
- */
- drawRegion = RECTS_TO_REGION( pGC->pScreen, nSegments,
- drawRects, CT_UNSORTED );
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the entire set of segments to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Now we need to reset the line join mode to whatever it was at before.
- * The easiest way is to force the cached GC's joinstyle to be different
- * from the current GC's joinstyle, then re-update the GC. This way, we
- * don't have to duplicate code unnecessarily.
- */
- PclGetDrawablePrivateStuff( pDrawable, &cacheGC, &valid, &dummy );
- cacheGC.joinStyle = !cacheGC.joinStyle;
- PclSetDrawablePrivateGC( pDrawable, cacheGC );
- PclUpdateDrawableGC( pGC, pDrawable, &outFile );
-
- /*
- * Clean up
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- xfree( drawRects );
-}
diff --git a/Xprint/pcl/PclMisc.c b/Xprint/pcl/PclMisc.c
deleted file mode 100644
index 5b0939df2..000000000
--- a/Xprint/pcl/PclMisc.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* $Xorg: PclMisc.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclMisc.c
-** *
-** * Contents:
-** * Miscellaneous code for Pcl driver.
-** *
-** * Created: 2/01/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclMisc.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */
-
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include "Xos.h" /* for SIGCLD on pre-POSIX systems */
-#include "Pcl.h"
-
-#include "cursor.h"
-#include "resource.h"
-
-#include "windowstr.h"
-#include "propertyst.h"
-#include "attributes.h"
-
-
-/*ARGSUSED*/
-void
-PclQueryBestSize(
- int type,
- short *pwidth,
- short *pheight,
- ScreenPtr pScreen)
-{
- unsigned width, highBit;
-
- switch(type)
- {
- case CursorShape:
- *pwidth = 0;
- *pheight = 0;
- break;
- case TileShape:
- case StippleShape:
- width = *pwidth;
- if (!width) break;
- /* Return the nearest power of two >= what they gave us */
- highBit = 0x80000000;
- /* Find the highest 1 bit in the given width */
- while(!(highBit & width))
- highBit >>= 1;
- /* If greater than that then return the next power of two */
- if((highBit - 1) & width)
- highBit <<= 1;
- *pwidth = highBit;
- /* height is a don't-care */
- break;
- }
-}
-
-/*
- * GetPropString searches the window heirarchy from pWin up looking for
- * a property by the name of propName. If found, returns the property's
- * value. If not, it returns NULL.
- */
-char *
-GetPropString(
- WindowPtr pWin,
- char *propName)
-{
- Atom atom;
- PropertyPtr pProp = (PropertyPtr)NULL;
- char *retVal;
-
- atom = MakeAtom(propName, strlen(propName), FALSE);
- if(atom != BAD_RESOURCE)
- {
- WindowPtr pPropWin;
- int n;
-
- /*
- * The atom has been defined, but it might only exist as a
- * property on an unrelated window.
- */
- for(pPropWin = pWin; pPropWin != (WindowPtr)NULL;
- pPropWin = pPropWin->parent)
- {
- for(pProp = (PropertyPtr)(wUserProps(pPropWin));
- pProp != (PropertyPtr)NULL;
- pProp = pProp->next)
- {
- if (pProp->propertyName == atom)
- break;
- }
- if(pProp != (PropertyPtr)NULL)
- break;
- }
- if(pProp == (PropertyPtr)NULL)
- return (char *)NULL;
-
- n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
- retVal = (char *)xalloc(n + 1);
- (void)memcpy((void *)retVal, (void *)pProp->data, n);
- retVal[n] = '\0';
-
- return retVal;
- }
-
- return (char *)NULL;
-}
-
-#include <signal.h>
-#include <errno.h>
-
-/* ARGSUSED */
-static void SigchldHndlr (
- int dummy)
-{
- int status;
- int olderrno = errno;
- struct sigaction act;
- sigfillset(&act.sa_mask);
- act.sa_flags = 0;
- act.sa_handler = SigchldHndlr;
-
- (void) wait (&status);
-
- /*
- * Is this really necessary?
- */
- sigaction(SIGCHLD, &act, (struct sigaction *)NULL);
- errno = olderrno;
-}
-
-/*
- * SystemCmd provides a wrapper for the 'system' library call. The call
- * appears to be sensitive to the handling of SIGCHLD, so this wrapper
- * sets the status to SIG_DFL, and then resets the established handler
- * after system returns.
- */
-int
-SystemCmd(char *cmdStr)
-{
- int status;
- struct sigaction newAct, oldAct;
- sigfillset(&newAct.sa_mask);
- newAct.sa_flags = 0;
- newAct.sa_handler = SIG_DFL;
- sigfillset(&oldAct.sa_mask);
- oldAct.sa_flags = 0;
- oldAct.sa_handler = SigchldHndlr;
-
- /*
- * get the old handler, and set the action to IGN
- */
- sigaction(SIGCHLD, &newAct, &oldAct);
-
- status = system (cmdStr);
-
- sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL);
- return status;
-}
-
-
-/*
- * PclGetMediumDimensions is installed in the GetMediumDimensions field
- * of each Pcl-initialized context.
- */
-int
-PclGetMediumDimensions(XpContextPtr pCon,
- CARD16 *width,
- CARD16 *height)
-{
- XpGetMediumDimensions(pCon, width, height);
- return Success;
-}
-
-/*
- * PclGetReproducibleArea is installed in the GetReproducibleArea field
- * of each Pcl-initialized context.
- */
-int
-PclGetReproducibleArea(XpContextPtr pCon,
- xRectangle *pRect)
-{
- XpGetReproductionArea(pCon, pRect);
- return Success;
-}
-
-#ifdef XP_PCL_LJ3
-/*
- * PclSpoolFigs spooled the rendering PCL/HP-GL2 commands into the
- * temporary buffer pointed by figures pointer in pcl private context.
- * LaserJet IIIs printers don't support the macro function which
- * includes some HP-GL/2 commands.
- */
-void
-PclSpoolFigs(PclContextPrivPtr pConPriv, char *t, int n)
-{
-char *ptr;
-
- ptr = pConPriv->figures;
- while ( ( pConPriv->fcount + n) > pConPriv->fcount_max ) {
- ptr = (char *)xrealloc(ptr, 1024 + pConPriv->fcount_max);
- if ( !ptr )
- return;
- pConPriv->figures = ptr;
- pConPriv->fcount_max += 1024;
- }
- ptr += pConPriv->fcount;
- pConPriv->fcount += n;
- memcpy(ptr, t, n);
-}
-#endif /* XP_PCL_LJ3 */
-
-/*
- * PclSendData:
- * For XP-PCL-COLOR/XP-PCL-MONO, it executes the macro stored before
- * in the clipped area.
- * For XP-PCL-LJ3, it draws the spooled figures in the clipped area.
- */
-void
-PclSendData(
- FILE *outFile,
- PclContextPrivPtr pConPriv,
- BoxPtr pbox,
- int nbox,
- double ratio
-)
-{
-char *ptr;
-int n;
-char t[80];
-
-#ifdef XP_PCL_LJ3
- ptr = pConPriv->figures;
- n = pConPriv->fcount;
-#else
- ptr = "\033&f3X";
- n = 5;
-#endif /* XP_PCL_LJ3 */
-
- while( nbox )
- {
- /*
- * Set the HP-GL/2 input window to the current
- * rectangle in the clip region, then send the code to
- * execute the macro defined above.
- */
- if (ratio == 1.0)
- sprintf( t, "\033%%0BIW%d,%d,%d,%d;\033%%0A",
- pbox->x1, pbox->y1,
- pbox->x2, pbox->y2 );
- else
- sprintf( t, "\033%%0BIW%g,%d,%g,%d;\033%%0A",
- ratio * pbox->x1, pbox->y1,
- ratio * pbox->x2, pbox->y2 );
-
- SEND_PCL( outFile, t );
- SEND_PCL_COUNT( outFile, ptr, n);
-
- nbox--;
- pbox++;
- }
-}
diff --git a/Xprint/pcl/PclPixel.c b/Xprint/pcl/PclPixel.c
deleted file mode 100644
index 238a159ab..000000000
--- a/Xprint/pcl/PclPixel.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $Xorg: PclPixel.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclPixel.c
-** *
-** * Contents:
-** * Pixel-drawing code for the PCL DDX driver
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixel.c,v 1.7 2003/10/29 22:11:00 tsi Exp $ */
-
-#include <stdio.h>
-
-#include "windowstr.h"
-#include "gcstruct.h"
-
-#include "Pcl.h"
-
-void
-PclPolyPoint( pDrawable, pGC, mode, nPoints, pPoints )
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int nPoints;
- xPoint *pPoints;
-{
- char t[80];
- FILE *outFile;
- int xoffset, yoffset;
- BoxRec box;
- int xloc, yloc, i;
-#if 0
- XpContextPtr pCon;
- PclContextPrivPtr cPriv;
- PclPixmapPrivPtr pPriv;
-#endif
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- /*
- * Enter HP-GL/2 and change the line style to one in which only
- * the vertices of the specified polyline are drawn. We must also
- * temporarily change the line width so that only a single pixel
- * is drawn. Then move to the first possible location.
- */
- xloc = pPoints[0].x + pDrawable->x;
- yloc = pPoints[0].y + pDrawable->y;
-
- sprintf( t, "\27%%0BPW0,0;LT0;PU;PA%d,%d", xloc, yloc );
- SEND_PCL( outFile, t );
-
- /*
- * Check each point against the clip region. If it is outside the
- * region, don't send the PCL to the printer.
- */
-
- for( i = 0; i < nPoints; i++ )
- {
- if( POINT_IN_REGION( pGC->pScreen, pGC->clientClip, xloc, yloc, &box ) )
- {
- sprintf( t, ",%d,%d", xloc, yloc );
- SEND_PCL( outFile, t );
- }
-
- if( mode == CoordModeOrigin )
- {
- xloc = pPoints[i+1].x + xoffset;
- yloc = pPoints[i+1].y + yoffset;
- }
- else
- {
- xloc += pPoints[i+1].x;
- yloc += pPoints[i+1].y;
- }
- }
-
-#if 0
- /*
- * Change the line style and width back to what they were before
- * this routine was called. No, this isn't pretty...
- */
- if( pDrawable->type == DRAWABLE_WINDOW )
- {
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
- cPriv = pCon->devPrivates[PclContextPrivateIndex].ptr;
- cPriv->changeMask = GCLineWidth | GCLineStyle;
- }
- else
- {
- pPriv =
- ((PixmapPtr)pDrawable)->devPrivates[PclPixmapPrivateIndex].ptr;
- pPriv->changeMask = GCLineWidth | GCLineStyle;
- }
-#endif
-
- PclUpdateDrawableGC( pGC, pDrawable, &outFile );
-
- /*
- * Go back to PCL
- */
- SEND_PCL( outFile, "\27%0A" );
-}
-
-void
-PclPushPixels( pGC, pBitmap, pDrawable, width, height, x, y )
- GCPtr pGC;
- PixmapPtr pBitmap;
- DrawablePtr pDrawable;
- int width;
- int height;
- int x;
- int y;
-{
-}
diff --git a/Xprint/pcl/PclPixmap.c b/Xprint/pcl/PclPixmap.c
deleted file mode 100644
index ba91fc9ec..000000000
--- a/Xprint/pcl/PclPixmap.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $Xorg: PclPixmap.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclPixmap.c
-** *
-** * Contents:
-** * Pixmap handling code for the PCL DDX driver
-** *
-** * Created: 2/19/96
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPixmap.c,v 1.4 2001/01/17 22:36:30 dawes Exp $ */
-
-#include "Pcl.h"
-#include "cfb.h"
-#include "cfb32.h"
-#include "mfb.h"
-#include "pixmapstr.h"
-
-PixmapPtr
-PclCreatePixmap(ScreenPtr pScreen,
- int width,
- int height,
- int depth)
-{
- if( depth == 1 )
- return mfbCreatePixmap( pScreen, width, height, depth );
- else if( depth <= 8 )
- return cfbCreatePixmap( pScreen, width, height, depth );
- else if( depth <= 32 )
- return cfb32CreatePixmap( pScreen, width, height, depth );
- return 0;
-}
-
-
-Bool
-PclDestroyPixmap(PixmapPtr pPixmap)
-{
- if( pPixmap->drawable.depth == 1 )
- return mfbDestroyPixmap( pPixmap );
- else if( pPixmap->drawable.depth <= 8 )
- return cfbDestroyPixmap( pPixmap );
- else if( pPixmap->drawable.depth <= 32 )
- return cfb32DestroyPixmap( pPixmap );
- return 0;
-}
diff --git a/Xprint/pcl/PclPolygon.c b/Xprint/pcl/PclPolygon.c
deleted file mode 100644
index a5de77399..000000000
--- a/Xprint/pcl/PclPolygon.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/* $Xorg: PclPolygon.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclPolygon.c
-** *
-** * Contents:
-** * Draws Polygons and Rectangles for the PCL DDX
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPolygon.c,v 1.7 2001/01/17 22:36:30 dawes Exp $ */
-
-
-#include "Pcl.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PclPolyRectangle(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects)
-{
- char t[80];
- FILE *outFile;
- int nbox, i;
- BoxPtr pbox;
- xRectangle *drawRects, *r;
- RegionPtr drawRegion, region;
- short fudge;
- int xoffset, yoffset;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Allocate the storage required to deal with the clipping
- * regions.
- */
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- drawRects = (xRectangle *)xalloc( nRects * sizeof( xRectangle ) );
-
- fudge = 3 * pGC->lineWidth + 1;
-
- /*
- * Generate the PCL code to draw the rectangles, by defining them
- * as a macro which uses the HP-GL/2 rectangle drawing function.
- */
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0, r = drawRects; i < nRects; i++, r++ )
- {
- xRectangle rect = pRects[i];
-
- /* Draw the rectangle */
- sprintf( t, "PU%d,%d;ER%d,%d;", rect.x + xoffset,
- rect.y + yoffset, rect.width, rect.height );
- SAVE_PCL( outFile, pConPriv, t );
-
- /* Build the bounding box */
- r->x = MIN( rect.x, rect.x + rect.width ) + xoffset -
- fudge;
- r->y = MIN( rect.y, rect.y + rect.height ) + yoffset -
- fudge;
- r->width = rect.width + 2 * fudge;
- r->height = rect.height + 2 * fudge;
- }
- SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */
- MACRO_END( outFile );
-
- /*
- * Convert the collection of rectangles to a proper region, then
- * intersect it with the clip region.
- */
- drawRegion = RECTS_TO_REGION( pGC->pScreen, nRects,
- drawRects, CT_UNSORTED );
-
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the set of rectangles to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- xfree( drawRects );
-}
-
-void
-PclFillPolygon(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int nPoints,
- DDXPointPtr pPoints)
-{
- char t[80];
- FILE *outFile;
- int nbox, i;
- BoxPtr pbox;
- BoxRec box;
- RegionPtr drawRegion, region;
- int xoffset, yoffset;
- int xtop, xbottom, yleft, yright;
- int fillRule;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
- char *command;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Generate the PCL code to draw the filled polygon, by defining
- * it as a macro which uses the HP-GL/2 polygon drawing function.
- */
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- if( mode == CoordModeOrigin )
- {
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
- command = "PA";
- }
- else
- {
- xoffset = yoffset = 0;
- command = "PR";
- }
-
- /* Begin the polygon */
- sprintf( t, "PU%d,%d;PM0;%s", pPoints[0].x + xoffset, pPoints[0].y
- + yoffset, command );
- SAVE_PCL( outFile, pConPriv, t );
-
- /* Seed the bounding box */
- xtop = xbottom = pPoints[0].x + xoffset;
- yleft = yright = pPoints[0].y + yoffset;
-
- /* Add the rest of the points to the polygon */
- for( i = 1; i < nPoints; i++ )
- {
- if( i != 1 )
- SAVE_PCL( outFile, pConPriv, "," );
-
- sprintf( t, "%d,%d", pPoints[i].x + xoffset, pPoints[i].y +
- yoffset );
- SAVE_PCL( outFile, pConPriv, t );
-
- /* Update the bounding box */
- xtop = MIN( xtop, pPoints[i].x + xoffset );
- xbottom = MAX( xbottom, pPoints[i].x + xoffset );
- yleft = MIN( yleft, pPoints[i].y + yoffset );
- yright = MAX( yright, pPoints[i].y + yoffset );
- }
-
- /* Close the polygon and the macro */
-
- if( pGC->fillRule == EvenOddRule )
- fillRule = 0;
- else
- fillRule = 1;
-
- sprintf( t, ";PM2;FP%d;\033%%0A", fillRule );
- SAVE_PCL( outFile, pConPriv, t );
- MACRO_END ( outFile );
-
- /*
- * Build the bounding region from the bounding box of the polygon
- */
- box.x1 = xtop;
- box.y1 = yleft;
- box.x2 = xbottom;
- box.y2 = yright;
- drawRegion = REGION_CREATE( pGC->pScreen, &box, 0 );
-
- if( mode == CoordModePrevious )
- REGION_TRANSLATE( pGC->pScreen, drawRegion, pPoints[0].x, pPoints[0].y );
-
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
-
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the polygon to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
-}
-
-void
-PclPolyFillRect(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects)
-{
- char t[80];
- FILE *outFile;
- int nbox, i;
- BoxPtr pbox;
- xRectangle *drawRects, *r;
- RegionPtr drawRegion, region;
- int xoffset, yoffset;
- short fudge;
- XpContextPtr pCon;
- PclContextPrivPtr pConPriv;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- pCon = PclGetContextFromWindow( (WindowPtr) pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- /*
- * Allocate the storage required to deal with the clipping
- * regions.
- */
- region = REGION_CREATE( pGC->pScreen, NULL, 0 );
- drawRects = (xRectangle *)xalloc( nRects * sizeof( xRectangle ) );
-
-
- fudge = 3 * pGC->lineWidth + 1;
-
- /*
- * Generate the PCL code to draw the filled rectangles, by
- * defining them as a macro which uses the HP-GL/2 rectangle
- * drawing function.
- */
- MACRO_START( outFile, pConPriv );
- SAVE_PCL( outFile, pConPriv, "\033%0B" );
-
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0, r = drawRects; i < nRects; i++, r++ )
- {
- xRectangle rect = pRects[i];
-
- /* Draw the rectangle */
- sprintf( t, "PU%d,%d;RR%d,%d;", rect.x + xoffset, rect.y +
- yoffset, rect.width, rect.height );
- SAVE_PCL( outFile, pConPriv, t );
-
- /* Build the bounding box */
- r->x = MIN( rect.x, rect.x + rect.width ) + xoffset - fudge;
- r->y = MIN( rect.y, rect.y + rect.height ) + yoffset -
- fudge;
- r->width = rect.width + 2 * fudge;
- r->height = rect.height + 2 * fudge;
- }
- SAVE_PCL( outFile, pConPriv, ";\033%0A" ); /* End the macro */
- MACRO_END( outFile );
-
- /*
- * Convert the collection of rectangles to a proper region, then
- * intersect it with the clip region.
- */
- drawRegion = RECTS_TO_REGION( pGC->pScreen, nRects,
- drawRects, CT_UNSORTED );
- REGION_INTERSECT( pGC->pScreen, region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the set of rectangles to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
- xfree( drawRects );
-}
diff --git a/Xprint/pcl/PclPrint.c b/Xprint/pcl/PclPrint.c
deleted file mode 100644
index aa2164c92..000000000
--- a/Xprint/pcl/PclPrint.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/* $Xorg: PclPrint.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclPrint.c
-** *
-** * Contents: Print extension code of Pcl driver
-** *
-** * Created: 2/03/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclPrint.c,v 1.8 2003/10/29 22:11:00 tsi Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <X11/Xprotostr.h>
-
-#define NEED_EVENTS
-#include "Xproto.h"
-#undef NEED_EVENTS
-
-#include "Pcl.h"
-
-#include "windowstr.h"
-#include "attributes.h"
-#include "AttrValid.h"
-#include "Oid.h"
-
-int
-PclStartJob(
- XpContextPtr pCon,
- Bool sendClientData,
- ClientPtr client)
-{
- PclContextPrivPtr pConPriv =
- (PclContextPrivPtr)pCon->devPrivates[PclContextPrivateIndex].ptr;
- PclPaletteMap *pal;
-
- /*
- * Check for existing page file, and delete it if it exists.
- */
- if(pConPriv->pageFileName != (char *)NULL)
- {
- if(pConPriv->pPageFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- }
- unlink(pConPriv->pageFileName);
- xfree(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- }
-
- /*
- * Create a temporary file to store the printer output.
- */
- if (!XpOpenTmpFile("w+", &pConPriv->jobFileName, &pConPriv->pJobFile))
- return BadAlloc;
-
- /*
- * Create/Initialize the SoftFontInfo structure
- */
- pConPriv->pSoftFontInfo = PclCreateSoftFontInfo();
-
- /*
- * Set up the colormap handling
- */
- pConPriv->palettes = NULL;
- pConPriv->nextPaletteId = 4;
- pConPriv->currentPalette = 0;
-
- pal = &( pConPriv->staticGrayPalette );
- pal->paletteId = 1;
- pal->downloaded = 0;
-
- pal = &( pConPriv->trueColorPalette );
- pal->paletteId = 2;
- pal->downloaded = 0;
-
- pal = &( pConPriv->specialTrueColorPalette );
- pal->paletteId = 3;
- pal->downloaded = 0;
-
- return Success;
-}
-
-int
-PclEndJob(
- XpContextPtr pCon,
- Bool cancel)
-{
- PclContextPrivPtr priv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
-#ifdef CCP_DEBUG
- FILE *xpoutput;
-#endif
- FILE *fp;
- int retVal;
- char *fileName, *trailer;
- struct stat statBuf;
- PclPaletteMapPtr p;
-
- trailer = "\033%-12345X@PJL RESET\n";
-
- if( cancel == True )
- {
- if( priv->getDocClient != (ClientPtr)NULL ) {
- XpFinishDocData( priv->getDocClient );
-
- priv->getDocClient = NULL;
- priv->getDocBufSize = 0;
- }
-
- return Success;
- }
-
- if( priv->getDocClient != (ClientPtr)NULL && priv->getDocBufSize > 0 )
- {
- /*
- * We need to stash the trailer information somewhere...
- */
- if (!XpOpenTmpFile("w+", &fileName, &fp))
- return BadAlloc;
-
-#ifndef XP_PCL_LJ3
- SEND_PCL( fp, trailer );
- rewind( fp );
-
- retVal = XpSendDocumentData( priv->getDocClient, fp,
- strlen( trailer ),
- priv->getDocBufSize );
-#endif /* XP_PCL_LJ3 */
-
- fclose( fp );
- unlink( fileName );
- xfree( fileName );
-
- if( priv->getDocClient != (ClientPtr)NULL ) {
- XpFinishDocData( priv->getDocClient );
-
- priv->getDocClient = NULL;
- priv->getDocBufSize = 0;
- }
-
- return retVal;
- }
-
-#ifndef XP_PCL_LJ3
- SEND_PCL( priv->pJobFile, trailer );
-#endif /* XP_PCL_LJ3 */
-
- /*
- * Submit the job to the spooler
- */
- fflush( priv->pJobFile );
-
- /*
- * Dump the job file to another output file, for testing
- * purposes.
- */
- rewind( priv->pJobFile );
- stat( priv->jobFileName, &statBuf );
-
-#ifdef CCP_DEBUG
- unlink( "/users/prince/XpOutput" );
- xpoutput = fopen( "/users/prince/XpOutput", "w" );
-
- rewind( priv->pJobFile );
- TransferBytes( priv->pJobFile, xpoutput,
- (int)statBuf.st_size );
- fclose( xpoutput );
-#endif
-
- XpSubmitJob( priv->jobFileName, pCon );
- fclose( priv->pJobFile );
- unlink( priv->jobFileName );
- xfree( priv->jobFileName );
- priv->jobFileName = NULL;
-
- PclDestroySoftFontInfo(priv->pSoftFontInfo);
- priv->pSoftFontInfo = (PclSoftFontInfoPtr) NULL;
-
- /*
- * Clear out the colormap cache
- */
- p = priv->palettes;
- while( p )
- {
- p->downloaded = 0;
- p = p->next;
- }
-
- return Success;
-}
-
-/* StartPage
- *
- * If page file exists
- * close page file
- * set page file pointer = NULL
- * unlink page file
- * Create a new page file
- * Send the page header information to the page file
- * ClearArea the window and all descendant windows
- */
-int
-PclStartPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- PclContextPrivPtr pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- PclWindowPrivPtr pWinPriv =
- (PclWindowPrivPtr)pWin->devPrivates[PclWindowPrivateIndex].ptr;
- xRectangle repro;
- char t[80];
- XpOid orient, plex, tray, medium;
- int dir, plexNum, num;
-
- /*
- * Put a pointer to the context in the window private structure
- */
- pWinPriv->validContext = 1;
- pWinPriv->context = pCon;
-
- /*
- * Clear out the old page file, if necessary
- */
- if(pConPriv->pPageFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- }
- if(pConPriv->pageFileName != (char *)NULL)
- {
- unlink(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- }
-
- /*
- * Make up a new page file.
- */
- if (!XpOpenTmpFile("w+", &pConPriv->pageFileName, &pConPriv->pPageFile))
- return BadAlloc;
-
- /*
- * Reset the GC cached in the context private struct.
- */
- pConPriv->validGC = 0;
-
- /*
- * Set the page orientation
- */
- orient = XpGetContentOrientation( pCon );
- switch( orient )
- {
- case xpoid_val_content_orientation_landscape:
- dir = 1;
- break;
- case xpoid_val_content_orientation_reverse_portrait:
- dir = 2;
- break;
- case xpoid_val_content_orientation_reverse_landscape:
- dir = 3;
- break;
- case xpoid_val_content_orientation_portrait:
- default:
- dir = 0;
- break;
- }
- sprintf( t, "\033&l%dO", dir );
- SEND_PCL( pConPriv->pPageFile, t );
-
- /*
- * Set the duplexing method. Since PCL wants to think of it in
- * terms of the "binding edge," and the attribute store thinks in
- * "duplex/tumble," this is a little complicated.
- *
- * Actually, this has no bearing on the output, since the HP1600C
- * will only print on one side of the paper, and ignore all
- * requests to enable duplexing. But, in an attempt to keep this
- * driver somewhat generic, we'll enable it anyway.
- */
- plex = XpGetPlex( pCon );
-
- if( plex == xpoid_val_plex_duplex )
- {
- if( dir == 0 || dir == 2 )
- plexNum = 1;
- else
- plexNum = 2;
- }
- else if( plex == xpoid_val_plex_tumble )
- {
- if( dir == 0 || dir == 2 )
- plexNum = 2;
- else
- plexNum = 1;
- }
- else
- plexNum = 0;
- sprintf( t, "\033&l%dS", plexNum );
- SEND_PCL( pConPriv->pPageFile, t );
-
- /*
- * Set the input tray or medium. If XpGetPageSize gives us a valid medium,
- * we can just send that to the printer, and let the printer handle the
- * details. Otherwise, we select the tray returned from XpGetPageSize,
- * which will be either a tray that should contain the correct medium
- * (possibly with operator intervention), or the default tray from the
- * config files.
- */
- medium = XpGetPageSize( pCon, &tray, NULL );
- if( medium != xpoid_none )
- {
- switch( medium )
- {
- case xpoid_val_medium_size_na_legal:
- num = 3;
- break;
- case xpoid_val_medium_size_iso_a3:
- num = 27;
- break;
- case xpoid_val_medium_size_iso_a4:
- num = 26;
- break;
- case xpoid_val_medium_size_executive:
- num = 1;
- break;
- case xpoid_val_medium_size_ledger:
- num = 6;
- break;
- case xpoid_val_medium_size_monarch_envelope:
- num = 80;
- break;
- case xpoid_val_medium_size_na_number_10_envelope:
- num = 81;
- break;
- case xpoid_val_medium_size_iso_designated_long:
- num = 90;
- break;
- case xpoid_val_medium_size_iso_c5:
- num = 91;
- break;
- case xpoid_val_medium_size_iso_b5:
- num = 100;
- break;
- case xpoid_val_medium_size_jis_b5:
- num = 45;
- break;
- case xpoid_val_medium_size_na_letter:
- default:
- num = 2;
- break;
- }
- sprintf( t, "\033&l%dA", num );
- SEND_PCL( pConPriv->pPageFile, t );
- }
- else
- {
- switch( tray )
- {
- case xpoid_val_input_tray_manual:
- num = 2;
- break;
- case xpoid_val_input_tray_envelope:
- num = 3;
- break;
- case xpoid_val_input_tray_large_capacity:
- num = 5;
- break;
- case xpoid_val_input_tray_bottom:
- num = 4;
- break;
- case xpoid_val_input_tray_main:
- default:
- num = 1;
- break;
- }
- sprintf( t, "\033&l%dH", num );
- SEND_PCL( pConPriv->pPageFile, t );
- }
-
- /*
- * Set the scaling factors so that the HP-GL/2 coordinate system
- * matches the X coordinate system, both in axis orientation and
- * in unit<->pixel conversion.
- */
- XpGetReproductionArea( pCon, &repro );
-
- sprintf( t, "\033&l0E\033*p%dx%dY", repro.x - 75, repro.y );
- SEND_PCL( pConPriv->pPageFile, t );
-
- sprintf( t, "\033*c%dx%dY\033*c0T", (int)(repro.width / 300.0 * 720.0),
- (int)(repro.height / 300.0 * 720.0) );
- SEND_PCL( pConPriv->pPageFile, t );
-
- sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x, repro.x +
- repro.width, repro.y + repro.height, repro.y );
- SEND_PCL( pConPriv->pPageFile, t );
-
- return Success;
-}
-
-/*
- * When sending the generated PCL code back to the client, we send everything
- * that we have generated so far for the job. After sending the data, we clean
- * out the job file, to avoid repeatedly sending the same data.
- */
-
-static int
-SendDocData( PclContextPrivPtr pPriv )
-{
- struct stat statBuf;
- int ret;
-
- rewind( pPriv->pJobFile );
- if( stat( pPriv->jobFileName, &statBuf ) < 0 )
- return BadAlloc;
-
- ret = XpSendDocumentData( pPriv->getDocClient, pPriv->pJobFile,
- (int)statBuf.st_size, pPriv->getDocBufSize );
-
- /*
- * Clean out the job file
- */
- fclose( pPriv->pJobFile );
- unlink( pPriv->jobFileName );
-
- xfree(pPriv->jobFileName);
-
- if (!XpOpenTmpFile("w+", &pPriv->jobFileName, &pPriv->pJobFile))
- return BadAlloc;
-
- return ret;
-}
-
-/*
- * EndPage:
- *
- * Write page trailer to page file
- * Write page file to job file
- */
-int
-PclEndPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- PclContextPrivPtr pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- struct stat statBuf;
-
- /*
- * Send the page trailer to the page file.
- */
- SEND_PCL( pConPriv->pPageFile, "\014" );
- fflush( pConPriv->pPageFile );
-
- /*
- * Write the page file contents to the job file, or to the
- * whatever client has called GetDocumentData.
- *
- * pWinPriv->pPageFile must first be set to the start of the page file.
- */
- rewind(pConPriv->pPageFile);
- if(stat(pConPriv->pageFileName, &statBuf) < 0)
- return BadAlloc;
-
- if(TransferBytes(pConPriv->pPageFile, pConPriv->pJobFile,
- (int)statBuf.st_size) != (int)statBuf.st_size)
- return BadAlloc;
-
- if( pConPriv->getDocClient != (ClientPtr)NULL &&
- pConPriv->getDocBufSize > 0 )
- {
- return SendDocData( pConPriv );
- }
-
- return Success;
-}
-
-/*
- * The PclStartDoc() and PclEndDoc() functions serve basically as NOOP
- * placeholders. This driver doesn't deal with the notion of multiple
- * documents per page.
- */
-
-int
-PclStartDoc(XpContextPtr pCon,
- XPDocumentType type)
-{
- PclContextPrivPtr pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
-#ifndef XP_PCL_LJ3
- /*
- * Set the printer resolution for the page. Since we can only
- * render color at 300dpi, we just hard-code this.
- */
- SEND_PCL( pConPriv->pJobFile,
- "\033%-12345X@PJL SET RESOLUTION = 300\r\n" );
-#endif /* XP_PCL_LJ3 */
-
- /*
- * Initialize HP-GL/2
- */
- SEND_PCL( pConPriv->pJobFile, "\033E\033%0BIN,SP1,TR0;\033%0A" );
-
- /*
- * Stash the type of the document (used by PutDocumentData operation)
- */
- pConPriv->isRaw = (type == XPDocRaw);
-
- return Success;
-}
-
-int
-PclEndDoc(
- XpContextPtr pCon,
- Bool cancel)
-{
- /*
- * XXX What should I do if I get cancel == TRUE?
- */
- return Success;
-}
-
-/*
- * PclDocumentData()
- *
- * Hand any pre-generated PDL down to the spool files, formatting it
- * as necessary to fit the given window.
- *
- */
-
-#define DOC_PCL 1
-#define DOC_HPGL 2
-
-int
-PclDocumentData(
- XpContextPtr pCon,
- DrawablePtr pDraw,
- char *pData,
- int len_data,
- char *pFmt,
- int len_fmt,
- char *pOpt,
- int len_opt,
- ClientPtr client)
-{
- int type = 0;
- PclContextPrivPtr pPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- XpOidDocFmtList *formats;
- XpOidDocFmt *f;
- char t[80];
- xRectangle repro;
-
- /*
- * Verify the input format
- */
- formats = XpGetDocFmtListAttr( pCon, XPPrinterAttr,
- (pPriv->isRaw) ?
- xpoid_att_xp_raw_formats_supported :
- xpoid_att_xp_embedded_formats_supported,
- NULL );
- f = XpOidDocFmtNew( pFmt );
- if( !XpOidDocFmtListHasFmt( formats, f ) )
- {
- XpOidDocFmtListDelete( formats );
- XpOidDocFmtDelete( f );
- return BadMatch;
- }
- XpOidDocFmtListDelete( formats );
-
- if( !(pPriv->isRaw) )
- {
- if( !strcmp( f->format, "PCL" ) )
- type = DOC_PCL;
- else if( !strcmp( f->format, "HPGL" ) )
- type = DOC_HPGL;
- else
- {
- XpOidDocFmtDelete( f );
- return BadMatch;
- }
-
- switch( type )
- {
- case DOC_HPGL:
- /*
- * Move the picture frame to the appropriate place on the page,
- * then assume that the embedded code will scale it properly.
- */
- sprintf( t, "\033&l0E\033*p%dx%dY",
- pDraw->x - 75,
- pDraw->y );
- SEND_PCL( pPriv->pPageFile, t );
-
- sprintf( t, "\033*c%dx%dY\033*coT",
- (int)( pDraw->width / 300.0 * 720.0 ),
- (int)( pDraw->height / 300.0 * 720.0 ) );
- SEND_PCL( pPriv->pPageFile, t );
- break;
- }
- }
-
-
- /*
- * Send the data down the pipe
- */
- SEND_PCL_COUNT( pPriv->pPageFile, pData, len_data );
-
- /*
- * If it's not a raw document, clean up the embedding
- */
- if( !(pPriv->isRaw) )
- switch( type )
- {
- case DOC_HPGL:
- /*
- * Reset the picture frame
- */
- XpGetReproductionArea( pCon, &repro );
-
- sprintf( t, "\033&l0E\033*p%dx%dY", repro.x - 75, repro.y );
- SEND_PCL( pPriv->pPageFile, t );
-
- sprintf( t, "\033*c%dx%dY\033*c0T",
- (int)(repro.width / 300.0 * 720.0),
- (int)(repro.height / 300.0 * 720.0) );
- SEND_PCL( pPriv->pPageFile, t );
-
- sprintf( t, "\033%%0BSC%d,%d,%d,%d;\033%%0A", repro.x, repro.x +
- repro.width, repro.y + repro.height, repro.y );
- SEND_PCL( pPriv->pPageFile, t );
- break;
- }
-
- XpOidDocFmtDelete( f );
- return Success;
-}
-
-/*
- *
- * PclGetDocumentData()
- *
- * This function allows the driver to send the generated PCL back to
- * the client.
- *
- * XXX This function is barely spec'ed, much less implemented!
- */
-
-int
-PclGetDocumentData(
- XpContextPtr pCon,
- ClientPtr client,
- int maxBufferSize)
-{
- PclContextPrivPtr pPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
-
- pPriv->getDocClient = client;
- pPriv->getDocBufSize = maxBufferSize;
-
- return Success;
-}
diff --git a/Xprint/pcl/PclSFonts.c b/Xprint/pcl/PclSFonts.c
deleted file mode 100644
index d1ad8dc29..000000000
--- a/Xprint/pcl/PclSFonts.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/* $Xorg: PclSFonts.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclSFonts.c
-** *
-** * Contents:
-** * Send Soft Font Download data to the specified
-** * file pointer.
-** *
-** * Created: 3/4/96
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSFonts.c,v 1.7 2003/10/29 22:11:00 tsi Exp $ */
-
-
-#include <stdio.h>
-#include "Pcl.h"
-
-static char tmp1;
-static short tmp2;
-#define Put1byte(fp, x) tmp1=x; fwrite((char *)&tmp1, 1, 1, fp)
-#define Put2bytes(fp, x) tmp2=x; fwrite((char *)&tmp2, 2, 1, fp)
-
-#define ESC 0x1b
-#define SYMBOL_SET 277
-#define MAX_CINDEX 255
-
-static unsigned int PclDownloadChar(FILE *,PclCharDataPtr,unsigned short,unsigned char);
-static unsigned int PclDownloadHeader(FILE *, PclFontDescPtr, unsigned short);
-
-#ifdef PCL_FONT_COMPRESS
-static unsigned char *compress_bitmap_data(PclCharDataPtr, unsigned int *);
-#endif /* PCL_FONT_COMPRESS */
-
-/* -*- PclDownloadSoftFont8 -*-
- * Send the Character Definition Command for 8-bit font
- * **************************************************************************/
-void
-PclDownloadSoftFont8(
- FILE *fp,
- PclSoftFontInfoPtr pSoftFontInfo,
- PclFontHead8Ptr pfh,
- PclCharDataPtr pcd,
- unsigned char *code
-)
-{
- /*
- * Check whether the font header has already been downloaded.
- * If not, download it.
- */
-
- if ( !pfh->fid ) {
- pfh->fid = pSoftFontInfo->cur_max_fid++;
- PclDownloadHeader(fp, &(pfh->fd), pfh->fid);
- }
- pfh->index[*code] = *code;
- PclDownloadChar(fp, pcd, pfh->fid, pfh->index[*code]);
-
-}
-
-/* -*- PclDownloadSoftFont16 -*-
- * Send the Character Definition Command for 16 bit font
- * **************************************************************************/
-void
-PclDownloadSoftFont16(
- FILE *fp,
- PclSoftFontInfoPtr pSoftFontInfo,
- PclFontHead16Ptr pfh,
- PclCharDataPtr pcd,
- unsigned char row,
- unsigned char col
-)
-{
- /*
- * Check whether the font header is already downloaded.
- * If not, download it.
- */
-
- if ( !pfh->cur_cindex ) {
- pfh->cur_fid = pSoftFontInfo->cur_max_fid++;
- PclDownloadHeader(fp, &(pfh->fd), pfh->cur_fid);
- }
- pfh->index[row][col].fid = pfh->cur_fid;
- pfh->index[row][col].cindex = pfh->cur_cindex++;
- if ( pfh->cur_cindex > MAX_CINDEX )
- pfh->cur_cindex = 0;
-
- PclDownloadChar(fp, pcd, pfh->index[row][col].fid, pfh->index[row][col].cindex);
-}
-
-/* -*- PclCreateSoftFontInfo -*-
- * Create and Initialize the structure for storing the information
- * of the downloaded soft font.
- * **************************************************************************/
-PclSoftFontInfoPtr
-PclCreateSoftFontInfo(void)
-{
-PclSoftFontInfoPtr pSoftFontInfo;
-
- pSoftFontInfo = (PclSoftFontInfoPtr)xalloc(sizeof(PclSoftFontInfoRec));
- if ( pSoftFontInfo == (PclSoftFontInfoPtr) NULL)
- return (PclSoftFontInfoPtr) NULL;
- pSoftFontInfo->phead8 = (PclFontHead8Ptr)NULL;
- pSoftFontInfo->phead16 = (PclFontHead16Ptr)NULL;
- pSoftFontInfo->pinfont = (PclInternalFontPtr)NULL;
- pSoftFontInfo->cur_max_fid = 1;
- return pSoftFontInfo;
-}
-
-/* -*- PclDestroySoftFontInfo -*-
- * Destroy the soft font information structure
- * **************************************************************************/
-void
-PclDestroySoftFontInfo( PclSoftFontInfoPtr pSoftFontInfo )
-{
-PclFontHead8Ptr pfh8, pfh8_next;
-PclFontHead16Ptr pfh16, pfh16_next;
-PclInternalFontPtr pin, pin_next;
-unsigned char nindex_row;
-int i;
-
- if ( pSoftFontInfo == (PclSoftFontInfoPtr) NULL )
- return;
-
- pfh8 = pSoftFontInfo->phead8;
- while (pfh8 != (PclFontHead8Ptr) NULL) {
- xfree(pfh8->fontname);
- xfree(pfh8->index);
- pfh8_next = pfh8->next;
- xfree(pfh8);
- pfh8 = pfh8_next;
- }
-
- pfh16 = pSoftFontInfo->phead16;
- while (pfh16 != (PclFontHead16Ptr) NULL) {
- xfree(pfh16->fontname);
- nindex_row = pfh16->lastRow - pfh16->firstRow + 1;
- for (i=0; i<nindex_row; i++)
- xfree(pfh16->index[i]);
- xfree(pfh16->index);
- pfh16_next = pfh16->next;
- xfree(pfh16);
- pfh16 = pfh16_next;
- }
-
- pin = pSoftFontInfo->pinfont;
- while (pin != (PclInternalFontPtr) NULL) {
- xfree(pin->fontname);
- pin_next = pin->next;
- xfree(pin);
- pin = pin_next;
- }
-
- xfree(pSoftFontInfo);
-}
-
-/* -*- PclDownloadHeader -*-
- * Send the Font Header Commnad.
- * Format 0 : Font Header for Pcl Bitmapped Fonts
- * Format 20 : Font Header for Resolution Specified Bitmapped Fonts
- * **************************************************************************/
-static unsigned int
-PclDownloadHeader(
- FILE *fp,
- PclFontDescPtr fd,
- unsigned short fid
-)
-{
-int nbytes;
-
-#ifdef XP_PCL_LJ3
- nbytes = 64;
-#else
- nbytes = 68;
-#endif /* XP_PCL_LJ3 */
- /*
- * Font ID Command : Esc *c#D
- * (Default = 0, Range = 0 - 32767)
- */
- fprintf(fp, "%c*c%dD", ESC, fid);
-
- /*
- * Font Header Commnad : Esc )s#W[font header data]
- * (Default = 0, Range = 0 - 32767)
- */
- fprintf(fp, "%c)s%dW", ESC, nbytes);
-
- Put2bytes(fp, nbytes); /* Font Description Size */
-#ifdef XP_PCL_LJ3
- Put1byte(fp, 0); /* Header Format */
-#else
- Put1byte(fp, 20); /* Header Format */
-#endif /* XP_PCL_LJ3 */
- Put1byte(fp, 2); /* Font Type */
- Put2bytes(fp, 0); /* Style MSB */
- Put2bytes(fp, fd->ascent); /* BaseLine Position */
- Put2bytes(fp, fd->cellwidth); /* Cell Width */
- Put2bytes(fp, fd->cellheight); /* Cell Height */
- Put1byte(fp, 0); /* Orienation */
- Put1byte(fp, fd->spacing); /* Spacing */
- Put2bytes(fp, SYMBOL_SET); /* Symbol Set */
- Put2bytes(fp, fd->pitch*4); /* font pitch */
- Put2bytes(fp, fd->cellheight * 4); /* Height */
- Put2bytes(fp, 0); /* x-Height */
- Put1byte(fp, 0); /* width type (normal) */
- Put1byte(fp, 0); /* Style LSB */
- Put1byte(fp, 0); /* Stroke Weight */
- Put1byte(fp, 5); /* Typeface LSB */
- Put1byte(fp, 0); /* Typeface MSB */
- Put1byte(fp, 0); /* Serif Style */
- Put1byte(fp, 0); /* Quality */
- Put1byte(fp, 0); /* Placement */
- Put1byte(fp, 0); /* Underline Position */
- Put1byte(fp, 0); /* Underline Thickness */
- Put2bytes(fp, fd->cellheight*1.2); /* Text Height */
- Put2bytes(fp, fd->cellwidth * 4); /* Text Width */
- Put2bytes(fp, 0); /* First Code */
- Put2bytes(fp, 255); /* Last Code */
- Put1byte(fp, 0); /* Pitch Extend */
- Put1byte(fp, 0); /* Height Extend */
- Put2bytes(fp, 0); /* Cap Height */
- Put2bytes(fp, 0); /* Font Number 1 */
- Put2bytes(fp, 0); /* Font Number 2 */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
- Put2bytes(fp, 0); /* Font Name */
-
-#ifdef XP_PCL_LJ3
- return 64;
-#else
- Put2bytes(fp, 300); /* X Resolution */
- Put2bytes(fp, 300); /* Y Resolution */
- return 68;
-#endif /* XP_PCL_LJ3 */
-
-}
-
-/* -*- PclDownloadCharacter -*-
- * Send the Character Definition Command.
- * **************************************************************************/
-static unsigned int
-PclDownloadChar(
- FILE *fp,
- PclCharDataPtr cd,
- unsigned short fid,
- unsigned char code
-)
-{
-unsigned int nbytes, n;
-unsigned char *raster;
-
- /*
- * Font ID Command : Esc *c#D
- * (Default = 0, Range = 0 - 32767)
- * Character Code Command : Esc *c#E
- * (Default = 0, Range = 0 - 65535)
- */
- fprintf(fp, "%c*c%dd%dE", ESC, fid, code);
-
- /*
- * Character Definition Command : Esc (s#W[character descriptor and data]
- * (Default = N/A, Range = 0 - 32767)
- */
-
- nbytes = n = cd->height * ((cd->width + 7) / 8);
-#ifdef PCL_FONT_COMPRESS
- raster = compress_bitmap_data(cd, &nbytes);
-#else
- raster = (unsigned char *)NULL;
-#endif /* PCL_FONT_COMPRESS */
- fprintf(fp, "%c(s%dW", ESC, nbytes + 16);
-
- Put1byte(fp, 4); /* Format */
- Put1byte(fp, 0); /* Continuation */
- Put1byte(fp, 14); /* Descriptor Size */
- if (raster) { /* Class */
- Put1byte(fp, 2);
- } else {
- Put1byte(fp, 1); /* Class */
- }
- Put2bytes(fp, 0); /* Orientation */
- Put2bytes(fp, cd->h_offset); /* left offset */
- Put2bytes(fp, cd->v_offset); /* top offset */
- Put2bytes(fp, cd->width); /* character width */
- Put2bytes(fp, cd->height); /* character height */
- Put2bytes(fp, cd->font_pitch*4); /* delta X */
-
- /*
- * Raster Character Data
- */
- if (raster) {
- fwrite(raster, nbytes, 1, fp);
- xfree(raster);
- } else
- fwrite(cd->raster_top, nbytes, 1, fp);
-
- return n + 16;
-}
-
-
-#ifdef PCL_FONT_COMPRESS
-/* -*- compress_bitmap_data -*-
- * Compress Bitmap data
- * **************************************************************************/
-static unsigned char *
-compress_bitmap_data(
- PclCharDataPtr cd,
- unsigned int *nbytes
-)
-{
-unsigned int byte_width;
-unsigned char *raster, *rptr_s, *rptr_e, *rptr_end;
-unsigned char *tmp_s, *tmp_ptr;
-unsigned char *p;
-unsigned char cur, pixel;
-unsigned int num;
-
-int i, j, k, w;
-
- byte_width = (cd->width + 7) / 8;
- *nbytes = cd->height * byte_width;
-
- /* Create buffer for storing compress bitmap glyph */
- raster = (unsigned char *)xalloc(*nbytes);
- rptr_s = raster;
- rptr_e = raster;
- rptr_end = raster + *nbytes;
-
- tmp_s = (unsigned char *)xalloc(cd->width * 8 + 2);
-
- p = cd->raster_top;
- for (i=0; i<cd->height; i++) {
- tmp_ptr = tmp_s;
- *tmp_ptr++ = 0;
- if ( (*p>>7)&0x1 == 1 ) {
- *tmp_ptr++ = 0;
- cur = 1;
- } else {
- cur = 0;
- }
- num = 0;
- for (j=0, w=0; j<byte_width; j++, p++) {
- for (k=0; k<8 && w<cd->width; k++, w++) {
- pixel = (*p>>(7-k))&0x1;
- if ( pixel == cur ) {
- num++;
- } else {
- cur = pixel;
- while (num > 255) {
- *tmp_ptr++ = 255;
- *tmp_ptr++ = 0;
- num -= 255;
- }
- *tmp_ptr++ = num;
- num = 1;
- }
- }
- }
- if ( pixel == cur ) {
- while (num > 255) {
- *tmp_ptr++ = 255;
- *tmp_ptr++ = 0;
- num -= 255;
- }
- *tmp_ptr++ = num&0xff;
- } else
- *tmp_ptr++ = num;
-
- if ( ((rptr_e - rptr_s) == (tmp_ptr - tmp_s)) &&
- !memcmp(rptr_s+1, tmp_s+1, (tmp_ptr - tmp_s) - 1) )
- *rptr_s += 1;
- else {
- if ( rptr_e + (tmp_ptr - tmp_s) > rptr_end ) {
- xfree(raster);
- xfree(tmp_s);
- return (unsigned char *)NULL;
- }
- memcpy (rptr_e, tmp_s, tmp_ptr - tmp_s);
- rptr_s = rptr_e;
- rptr_e = rptr_s + (tmp_ptr - tmp_s);
- }
- }
- xfree(tmp_s);
- *nbytes = rptr_e - raster;
-
- return raster;
-}
-#endif /* PCL_FONT_COMPRESS */
diff --git a/Xprint/pcl/PclSFonts.h b/Xprint/pcl/PclSFonts.h
deleted file mode 100644
index 5992c12af..000000000
--- a/Xprint/pcl/PclSFonts.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* $Xorg: PclSFonts.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-#ifndef _PCLFONTS_H
-#define _PCLFONTS_H
-
-/* -*-H-*-
-******************************************************************************
-******************************************************************************
-*
-* File: PclFonts.h
-* Description: Send Soft Font Download data to the specified file pointer.
-*
-*
-******************************************************************************
-******************************************************************************
-*/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-
-typedef struct {
- unsigned char fid; /* sfont font ID */
- unsigned char cindex; /* character indext */
-} PclFontMapRec, PclFontMapPtr;
-
-typedef struct {
- int h_offset;
- int v_offset;
- unsigned int width;
- unsigned int height;
- int font_pitch;
- unsigned char *raster_top;
-} PclCharDataRec, *PclCharDataPtr;
-
-typedef struct {
- unsigned char spacing;
- unsigned int pitch;
- unsigned int cellheight;
- unsigned int cellwidth;
- int ascent;
- int descent;
-} PclFontDescRec, *PclFontDescPtr;
-
-typedef struct _PclFontHead8Rec {
- char *fontname;
- PclFontDescRec fd;
- unsigned short fid;
- unsigned char *index;
- struct _PclFontHead8Rec *next;
-} PclFontHead8Rec, *PclFontHead8Ptr;
-
-typedef struct _PclFontHead16Rec {
- char *fontname;
- PclFontDescRec fd;
- unsigned short cur_fid;
- unsigned char cur_cindex;
- PclFontMapRec **index;
- unsigned short firstCol;
- unsigned short lastCol;
- unsigned short firstRow;
- unsigned short lastRow;
- struct _PclFontHead16Rec *next;
-} PclFontHead16Rec, *PclFontHead16Ptr;
-
-typedef struct _PclInternalFontRec {
- char *fontname;
- float pitch;
- float height;
- char *pcl_font_name;
- char *spacing;
- struct _PclInternalFontRec *next;
-} PclInternalFontRec, *PclInternalFontPtr;
-
-typedef struct {
- PclFontHead8Ptr phead8;
- PclFontHead16Ptr phead16;
- PclInternalFontPtr pinfont;
- unsigned char cur_max_fid;
-} PclSoftFontInfoRec, *PclSoftFontInfoPtr;
-
-#define MONOSPACE 0
-#define PROPSPACE 1
-
-#endif /* _PCLFONTS_H */
diff --git a/Xprint/pcl/PclSpans.c b/Xprint/pcl/PclSpans.c
deleted file mode 100644
index 98c17dcf9..000000000
--- a/Xprint/pcl/PclSpans.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $Xorg: PclSpans.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclSpans.c
-** *
-** * Contents:
-** * Code to set and fill spans in the PCL DDX
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclSpans.c,v 1.6 2001/01/17 22:36:30 dawes Exp $ */
-
-
-#include "Pcl.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PclFillSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSpans,
- DDXPointPtr pPoints,
- int *pWidths,
- int fSorted)
-{
- char t[80];
- FILE *outFile;
- int xoffset, yoffset;
- xRectangle *rects, *r;
- RegionPtr fillRegion, region = 0;
- int i;
- int nbox;
- BoxPtr pbox;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return;
-
- /*
- * Build a region out of the spans
- */
- rects = (xRectangle *)xalloc( nSpans * sizeof( xRectangle ) );
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0, r = rects; i < nSpans; i++, r++ )
- {
- r->x = pPoints[i].x + xoffset;
- r->y = pPoints[i].y + yoffset;
- r->width = pWidths[i];
- r->height = 1;
- }
- fillRegion = RECTS_TO_REGION( pGC->pScreen, nSpans, rects, ( fSorted ) ?
- CT_YSORTED : CT_UNSORTED );
-
- /*
- * Intersect this region with the clip region. Whatever's left,
- * should be filled.
- */
- REGION_INTERSECT( pGC->pScreen, region, fillRegion, pGC->clientClip );
-
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- /* Enter HP-GL/2 */
- SEND_PCL( outFile, "\27%0B" );
-
- while( nbox )
- {
- sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1,
- pbox->x2, pbox->y2 );
- SEND_PCL( outFile, t );
-
- nbox--;
- pbox++;
- }
-
- /* Go back to PCL */
- SEND_PCL( outFile, "\27%0A" );
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, fillRegion );
- REGION_DESTROY( pGC->pScreen, region );
- xfree( rects );
-}
-
-void
-PclSetSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- char *pSrc,
- DDXPointPtr pPoints,
- int *pWidths,
- int nSpans,
- int fSorted)
-{
-}
diff --git a/Xprint/pcl/PclText.c b/Xprint/pcl/PclText.c
deleted file mode 100644
index 48b468427..000000000
--- a/Xprint/pcl/PclText.c
+++ /dev/null
@@ -1,932 +0,0 @@
-/* $Xorg: PclText.c,v 1.5 2001/03/06 16:28:48 pookie Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclText.c
-** *
-** * Contents:
-** * Character-drawing routines for the PCL DDX
-** *
-** * Created: 10/23/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclText.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */
-
-#ifdef DO_TWO_BYTE_PCL
-#include "iconv.h"
-#endif /* DO_TWO_BYTE_PCL */
-#include "gcstruct.h"
-#include "windowstr.h"
-
-#include "Pcl.h"
-#include "migc.h"
-#include "Xatom.h"
-
-#include "PclSFonts.h"
-
-static PclFontHead8Ptr makeFontHeader8 (FontPtr, PclSoftFontInfoPtr);
-static PclFontHead16Ptr makeFontHeader16(FontPtr, PclSoftFontInfoPtr);
-static PclInternalFontPtr makeInternalFont(FontPtr, PclSoftFontInfoPtr);
-static void fillFontDescData(FontPtr, PclFontDescPtr, unsigned int);
-static PclCharDataPtr fillCharDescData(PclCharDataPtr, CharInfoPtr);
-static void output_text(FILE *, PclContextPrivPtr, unsigned char);
-static char * getFontName(FontPtr);
-static char isInternal(FontPtr);
-static void selectInternalFont(FILE *, PclInternalFontPtr, int);
-static void selectSize(FILE *, PclContextPrivPtr, PclInternalFontPtr);
-static char t[80];
-
-#ifdef DO_TWO_BYTE_PCL
-static void code_conv(PclSoftFontInfoPtr, FontPtr, char *, char *);
-#endif /* DO_TWO_BYTE_PCL */
-
-#define ESC 0x1b
-#define PER 0x25
-#define ETX 0x3
-#define ETX_ALT 0x2a
-#define DOWNLOAD_FONT 0
-#define INTERNAL_FONT 1
-
-int
-PclPolyText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *string)
-{
-XpContextPtr pCon;
-PclContextPrivPtr pConPriv;
-unsigned long n, i;
-int w;
-CharInfoPtr charinfo[255], *chinfo;
-
-FILE *outFile;
-PclSoftFontInfoPtr pSoftFontInfo;
-PclFontHead8Ptr pfh8 = (PclFontHead8Ptr)NULL;
-PclInternalFontPtr pin = (PclInternalFontPtr)NULL;
-PclCharDataRec cd;
-unsigned char *p;
-unsigned char last_fid;
-int max_ascent, max_descent;
-
-int nbox;
-BoxPtr pbox;
-BoxRec box;
-RegionPtr drawRegion, region;
-char font_type;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return x;
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string,
- Linear8Bit, &n, charinfo);
- if ( n == 0 )
- return x;
-
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- pSoftFontInfo = pConPriv->pSoftFontInfo;
- font_type = isInternal(pGC->font);
- if ( font_type == DOWNLOAD_FONT ) {
- /*
- * Create Soft Font Header Information
- */
- pfh8 = makeFontHeader8(pGC->font, pSoftFontInfo);
- if (!pfh8)
- return x;
-
- /*
- * exec Soft Font Downloading
- */
- p = (unsigned char *)string;
- for (i=0, chinfo=charinfo; i<n; i++, p++, chinfo++) {
- if ( !pfh8->index[*p] ) {
- fillCharDescData(&cd, *chinfo);
- PclDownloadSoftFont8(pConPriv->pJobFile, pSoftFontInfo,
- pfh8, &cd, p);
- xfree(cd.raster_top);
- }
- }
-
- /*
- * print characters
- */
- MACRO_START( outFile, pConPriv );
- sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;",
- x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent,
- ETX);
- SAVE_PCL( outFile, pConPriv, t );
- SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 );
-
- last_fid = 0;
- w = 0;
- max_ascent = charinfo[0]->metrics.ascent;
- max_descent = charinfo[0]->metrics.descent;
- p = (unsigned char *)string;
- for (i=0, chinfo=charinfo; i<n; i++, p++, chinfo++) {
- if ( last_fid != pfh8->fid ) {
- sprintf(t, "%c;FI%d;SS;LB", ETX, pfh8->fid);
- SAVE_PCL( outFile, pConPriv, t );
-
- last_fid = pfh8->fid;
- }
-
- output_text(outFile, pConPriv, pfh8->index[*p]);
-
- w += (*chinfo)->metrics.characterWidth;
- max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent);
- max_descent = MAX(max_descent, (*chinfo)->metrics.descent);
- }
-
- sprintf(t, "%c", ETX);
- SAVE_PCL_COUNT( outFile, pConPriv, t, 1 );
- sprintf(t, "TD0;\033%%1A");
- SAVE_PCL( outFile, pConPriv, t );
- MACRO_END( outFile );
-
- } else {
- int fid = 0;
-
- pin = makeInternalFont(pGC->font, pSoftFontInfo);
- if (!pin)
- return x;
-
- selectInternalFont(outFile, pin, fid);
-
- /*
- * print characters
- */
- MACRO_START( outFile, pConPriv );
- sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;",
- x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent,
- ETX);
- SAVE_PCL( outFile, pConPriv, t );
- selectSize(outFile, pConPriv, pin);
- SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 );
-
- w = 0;
- max_ascent = charinfo[0]->metrics.ascent;
- max_descent = charinfo[0]->metrics.descent;
- p = (unsigned char *)string;
- for (i=0, chinfo=charinfo; i<n; i++, p++, chinfo++) {
- output_text(outFile, pConPriv, *p);
-
- w += (*chinfo)->metrics.characterWidth;
- max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent);
- max_descent = MAX(max_descent, (*chinfo)->metrics.descent);
- }
- sprintf(t, "%c", ETX);
- SAVE_PCL_COUNT( outFile, pConPriv, t, 1 );
- sprintf(t, "TD0;\033%%1A");
- SAVE_PCL( outFile, pConPriv, t );
- MACRO_END( outFile );
- }
-
- /*
- * Convert the collection of rectangles into a proper region, then
- * intersect it with the clip region.
- */
- box.x1 = x + pDrawable->x;
- box.y1 = y - max_ascent + pDrawable->y + pGC->font->info.fontAscent;
- box.x2 = x + w + pDrawable->x;
- box.y2 = y + max_descent + pDrawable->y + pGC->font->info.fontAscent;
-
- drawRegion = miRegionCreate( &box, 0 );
- region = miRegionCreate( NULL, 0 );
- miIntersect( region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the entire polyline to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
-
- return x+w;
-}
-
-int
-PclPolyText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string)
-{
-XpContextPtr pCon;
-PclContextPrivPtr pConPriv;
-unsigned long n, i;
-int w;
-CharInfoPtr charinfo[255], *chinfo;
-
-FILE *outFile;
-PclSoftFontInfoPtr pSoftFontInfo;
-PclFontHead16Ptr pfh16 = (PclFontHead16Ptr)NULL;
-PclCharDataRec cd;
-FontInfoPtr pfi;
-unsigned char row, col;
-char *p;
-unsigned char last_fid;
-int max_ascent, max_descent;
-unsigned short def;
-
-int nbox;
-BoxPtr pbox;
-BoxRec box;
-RegionPtr drawRegion, region;
-char font_type;
-
- if( PclUpdateDrawableGC( pGC, pDrawable, &outFile ) == FALSE )
- return x;
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
-
- pCon = PclGetContextFromWindow( (WindowPtr)pDrawable );
- pConPriv = (PclContextPrivPtr)
- pCon->devPrivates[PclContextPrivateIndex].ptr;
- pSoftFontInfo = pConPriv->pSoftFontInfo;
-
- font_type = isInternal(pGC->font);
- if ( font_type == DOWNLOAD_FONT ) {
- /*
- * Create Soft Font Header Information
- */
- pfh16 = makeFontHeader16(pGC->font, pSoftFontInfo);
- if (!pfh16)
- return x;
-
- /*
- * exec Soft Font Downloading
- */
- pfi = (FontInfoRec *)&pGC->font->info;
- p = (char *)string;
- for (i=0, p=(char *)string, chinfo=charinfo; i<n; i++, p+=2, chinfo++) {
- row = *p & 0xff;
- col = *(p+1) & 0xff;
- if ( (pfi->firstRow <= row) && (row <= pfi->lastRow)
- && (pfi->firstCol <= col) && (col <= pfi->lastCol) ) {
- row = row - pfi->firstRow;
- col = col - pfi->firstCol;
- } else {
- def = pfi->defaultCh;
- row = ((def>>8)&0xff) - pfi->firstRow;
- col = (def&0xff) - pfi->firstCol;
- }
- if ( !pfh16->index[row][col].fid ) {
- fillCharDescData(&cd, *chinfo);
- PclDownloadSoftFont16(pConPriv->pJobFile, pSoftFontInfo,
- pfh16, &cd, row, col);
- xfree(cd.raster_top);
- }
- }
-
- /*
- * print characters
- */
- MACRO_START( outFile, pConPriv );
- sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;",
- x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent,
- ETX);
- SAVE_PCL( outFile, pConPriv, t );
- SAVE_PCL_COUNT( outFile, pConPriv, "FI0;SS;LB", 9 );
-
- last_fid = 0;
-
- w = 0;
- max_ascent = charinfo[0]->metrics.ascent;
- max_descent = charinfo[0]->metrics.descent;
- for (i=0, p=(char *)string, chinfo=charinfo; i<n; i++, p+=2, chinfo++) {
- row = *p & 0xff;
- col = *(p+1) & 0xff;
- if ( (pfi->firstRow <= row) && (row <= pfi->lastRow)
- && (pfi->firstCol <= col) && (col <= pfi->lastCol) ) {
- row = row - pfi->firstRow;
- col = col - pfi->firstCol;
- } else {
- def = pfi->defaultCh;
- row = ((def>>8)&0xff) - pfi->firstRow;
- col = (def&0xff) - pfi->firstCol;
- }
- if ( last_fid != pfh16->index[row][col].fid ) {
- sprintf(t, "%cFI%d;SS;LB",
- ETX, pfh16->index[row][col].fid);
- SAVE_PCL( outFile, pConPriv, t );
- last_fid = pfh16->index[row][col].fid;
- }
-
- output_text(outFile, pConPriv, pfh16->index[row][col].cindex);
-
- w += (*chinfo)->metrics.characterWidth;
- max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent);
- max_descent = MAX(max_descent, (*chinfo)->metrics.descent);
- }
- sprintf(t, "%c", ETX);
- SAVE_PCL_COUNT( outFile, pConPriv, t, 1 );
- sprintf(t, "TD0;\033%%1A");
- SAVE_PCL( outFile, pConPriv, t );
- MACRO_END( outFile );
-
- } else {
-#ifdef DO_TWO_BYTE_PCL
- PclInternalFontPtr pin;
- int fid = 0;
-
- pin = makeInternalFont(pGC->font, pSoftFontInfo);
- if (!pin)
- return x;
-
- selectInternalFont(outFile, pin, fid);
- fprintf(outFile, "%c&t31P", ESC);
-
- /*
- * print characters
- */
- MACRO_START( outFile, pConPriv );
- sprintf(t, "\033%%0B;PU%d,%dPD;TD1;DT%c,1;",
- x + pDrawable->x, y + pDrawable->y + pGC->font->info.fontAscent,
- ETX);
- SAVE_PCL( outFile, pConPriv, t );
- sprintf(t, "TD0;\033%%1A");
- SAVE_PCL( outFile, pConPriv, t );
-
- w = 0;
- last_fid = 0;
- max_ascent = charinfo[0]->metrics.ascent;
- max_descent = charinfo[0]->metrics.descent;
- for (i=0, p=(char *)string, chinfo=charinfo; i<n; i++, p+=2, chinfo++) {
- char tobuf[3];
- code_conv(pSoftFontInfo, pGC->font, (char *)p, tobuf);
- fprintf(outFile, "%c%c", tobuf[0], tobuf[1]);
-
- w += (*chinfo)->metrics.characterWidth;
- max_ascent = MAX(max_ascent, (*chinfo)->metrics.ascent);
- max_descent = MAX(max_descent, (*chinfo)->metrics.descent);
- }
- MACRO_END( outFile );
-#else
- return x;
-#endif /* DO_TWO_BYTE_PCL */
- }
-
- /*
- * Convert the collection of rectangles into a proper region, then
- * intersect it with the clip region.
- */
- box.x1 = x + pDrawable->x;
- box.y1 = y - max_ascent + pDrawable->y + pGC->font->info.fontAscent;
- box.x2 = x + w + pDrawable->x;
- box.y2 = y + max_descent + pDrawable->y + pGC->font->info.fontAscent;
-
- drawRegion = miRegionCreate( &box, 0 );
- region = miRegionCreate( NULL, 0 );
- miIntersect( region, drawRegion, pGC->pCompositeClip );
-
- /*
- * For each rectangle in the clip region, set the HP-GL/2 "input
- * window" and render the entire polyline to it.
- */
- pbox = REGION_RECTS( region );
- nbox = REGION_NUM_RECTS( region );
-
- PclSendData(outFile, pConPriv, pbox, nbox, 1.0);
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY( pGC->pScreen, drawRegion );
- REGION_DESTROY( pGC->pScreen, region );
-
- return x+w;
-}
-
-void
-PclImageText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x, int y,
- int count,
- char *string)
-{
-}
-
-void
-PclImageText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string)
-{
-}
-
-void
-PclImageGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x, int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
-}
-
-void
-PclPolyGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x, int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-static PclFontHead8Ptr
-makeFontHeader8(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo)
-{
-PclFontHead8Ptr phead8 = pSoftFontInfo->phead8;
-PclFontHead8Ptr pfh8 = phead8;
-PclFontHead8Ptr prev = (PclFontHead8Ptr)NULL;
-FontInfoPtr pfi;
-char *fontname;
-unsigned char nindex;
-int i;
-unsigned long n;
-CharInfoPtr charinfo[1];
-unsigned int space_width;
-
- if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL)
- return (PclFontHead8Ptr)NULL;
-
- /*
- * Verify it has already been created, if so, return it.
- */
- if ( (fontname = getFontName(pfont)) == (char *)NULL)
- return (PclFontHead8Ptr)NULL;
-
- while (pfh8 != (PclFontHead8Ptr) NULL) {
- if (!strcmp(pfh8->fontname, fontname))
- return pfh8;
- prev = pfh8;
- pfh8 = pfh8->next;
- }
-
- /*
- * Create Font Header Information
- */
- pfh8 = (PclFontHead8Ptr)xalloc(sizeof(PclFontHead8Rec));
- if (pfh8 == (PclFontHead8Ptr)NULL)
- return (PclFontHead8Ptr)NULL;
-
- pfi = (FontInfoRec *)&pfont->info;
- GetGlyphs(pfont, 1, (unsigned char *)&pfi->defaultCh,
- Linear8Bit, &n, charinfo);
- if ( n )
- space_width = charinfo[0]->metrics.characterWidth;
- else
- space_width = FONTMAXBOUNDS(pfont,characterWidth);
-
- fillFontDescData(pfont, &(pfh8->fd), space_width);
- pfh8->fid = 0;
- pfh8->fontname = (char *)xalloc(strlen(fontname) + 1);
- if (pfh8->fontname == (char *)NULL) {
- xfree(pfh8);
- return (PclFontHead8Ptr) NULL;
- }
- strcpy(pfh8->fontname, fontname);
-
- nindex = 0xff;
- pfh8->index = (unsigned char *)xalloc(nindex);
- if ( pfh8->index == (unsigned char *) NULL ) {
- xfree(pfh8->fontname);
- xfree(pfh8);
- return (PclFontHead8Ptr) NULL;
- }
-
- for (i=0; i<=nindex; i++)
- pfh8->index[i] = 0x0;
-
- pfh8->next = (PclFontHead8Ptr)NULL;
-
- if ( prev == (PclFontHead8Ptr) NULL)
- pSoftFontInfo->phead8 = pfh8;
- else
- prev->next = pfh8;
-
- return pfh8;
-}
-
-static PclFontHead16Ptr
-makeFontHeader16(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo)
-{
-PclFontHead16Ptr phead16 = pSoftFontInfo->phead16;
-PclFontHead16Ptr pfh16 = phead16;
-PclFontHead16Ptr prev = (PclFontHead16Ptr)NULL;
-PclFontMapRec ** index;
-FontInfoPtr pfi;
-char *fontname;
-unsigned char nindex_row, nindex_col;
-int i, j;
-unsigned long n;
-CharInfoPtr charinfo[1];
-unsigned int space_width;
-
- if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL)
- return (PclFontHead16Ptr)NULL;
-
- /*
- * Verify it has already been created, if so, return it.
- */
- if ( (fontname = getFontName(pfont)) == (char *)NULL)
- return (PclFontHead16Ptr)NULL;
-
- while (pfh16 != (PclFontHead16Ptr) NULL) {
- if (!strcmp(pfh16->fontname, fontname))
- return pfh16;
- prev = pfh16;
- pfh16 = pfh16->next;
- }
-
- /*
- * Create Font Header Information
- */
- pfh16 = (PclFontHead16Ptr)xalloc(sizeof(PclFontHead16Rec));
- if (pfh16 == (PclFontHead16Ptr)NULL)
- return (PclFontHead16Ptr)NULL;
-
- pfi = (FontInfoRec *)&pfont->info;
- GetGlyphs(pfont, 1, (unsigned char *)&pfi->defaultCh,
- (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
-
- if ( n )
- space_width = charinfo[0]->metrics.characterWidth;
- else
- space_width = FONTMAXBOUNDS(pfont,characterWidth);
-
- fillFontDescData(pfont, &(pfh16->fd), space_width);
- pfh16->cur_fid = 0;
- pfh16->cur_cindex = 0;
- pfh16->fontname = (char *)xalloc(strlen(fontname) + 1);
- if (pfh16->fontname == (char *)NULL) {
- xfree(pfh16);
- return (PclFontHead16Ptr) NULL;
- }
- strcpy(pfh16->fontname, fontname);
-
- pfi = (FontInfoRec *)&pfont->info;
- nindex_col = pfi->lastCol - pfi->firstCol + 1;
- nindex_row = pfi->lastRow - pfi->firstRow + 1;
- index = (PclFontMapRec **)xalloc(sizeof(PclFontMapRec *)*nindex_row);
- if (index == (PclFontMapRec **)NULL) {
- xfree(pfh16->fontname);
- xfree(pfh16);
- return (PclFontHead16Ptr) NULL;
- }
- for (i=0; i<nindex_row; i++) {
- index[i] = (PclFontMapRec *)xalloc(sizeof(PclFontMapRec)*nindex_col);
- if (index[i] == (PclFontMapRec *)NULL) {
- for(j=0; j<i; j++)
- xfree(index[j]);
- xfree(pfh16->fontname);
- xfree(pfh16);
- return (PclFontHead16Ptr) NULL;
- }
- for (j=0; j<=nindex_col; j++)
- index[i][j].fid = 0x0;
- }
-
- pfh16->index = index;
- pfh16->firstCol = pfi->firstCol;
- pfh16->lastCol = pfi->lastCol;
- pfh16->firstRow = pfi->firstRow;
- pfh16->lastRow = pfi->lastRow;
- pfh16->next = (PclFontHead16Ptr)NULL;
-
- if ( prev == (PclFontHead16Ptr) NULL)
- pSoftFontInfo->phead16 = pfh16;
- else
- prev->next = pfh16;
-
- return pfh16;
-}
-
-static PclInternalFontPtr
-makeInternalFont(FontPtr pfont, PclSoftFontInfoPtr pSoftFontInfo)
-{
-PclInternalFontPtr pinfont = pSoftFontInfo->pinfont;
-PclInternalFontPtr pin = pinfont;
-PclInternalFontPtr prev = (PclInternalFontPtr)NULL;
-FontPropPtr props;
-FontInfoPtr pfi;
-char *fontname;
-Atom xa_pcl_font_name, xa_res, xa_ave_width, xa_spacing;
-int width = 1;
-int mask;
-int i;
-
- if (pSoftFontInfo == (PclSoftFontInfoPtr) NULL)
- return (PclInternalFontPtr)NULL;
-
- /*
- * Verify it has already been created, if so, return it.
- */
- if ( (fontname = getFontName(pfont)) == (char *)NULL)
- return (PclInternalFontPtr)NULL;
-
- while (pin != (PclInternalFontPtr) NULL) {
- if (!strcmp(pin->fontname, fontname))
- return pin;
- prev = pin;
- pin = pin->next;
- }
-
- /*
- * Create Internal Font Information
- */
- pin = (PclInternalFontPtr)xalloc(sizeof(PclInternalFontRec));
- if (pin == (PclInternalFontPtr)NULL)
- return (PclInternalFontPtr)NULL;
-
- pin->fontname = (char *)xalloc(strlen(fontname) + 1);
- if (pin->fontname == (char *)NULL) {
- xfree(pin);
- return (PclInternalFontPtr) NULL;
- }
- strcpy(pin->fontname, fontname);
-
- xa_pcl_font_name = MakeAtom("PCL_FONT_NAME", strlen("PCL_FONT_NAME"), TRUE);
- xa_res = MakeAtom("RESOLUTION_X", strlen("RESOLUTION_X"), TRUE);
- xa_ave_width = MakeAtom("AVERAGE_WIDTH", strlen("AVERAGE_WIDTH"), TRUE);
- xa_spacing = MakeAtom("SPACING", strlen("SPACING"), TRUE);
- pfi = (FontInfoRec *)&pfont->info;
- props = pfi->props;
-
- mask = 0;
- for (i=0; i<pfi->nprops; i++, props++) {
- if ( (Atom) props->name == xa_pcl_font_name ) {
- pin->pcl_font_name = NameForAtom(props->value);
- mask |= 0x1;
- } else if ( props->name == XA_POINT_SIZE ) {
- pin->height = (float) props->value / 10.0;
- mask |= 0x2;
- } else if ( (Atom) props->name == xa_res ) {
- mask |= 0x4;
- } else if ( (Atom) props->name == xa_ave_width ) {
- width = (int) props->value / 10;
- mask |= 0x8;
- } else if ( (Atom) props->name == xa_spacing ) {
- pin->spacing = NameForAtom(props->value);
- mask |= 0x10;
- }
- }
- if ( mask != 0x1f ) {
- xfree(pin->fontname);
- xfree(pin);
- return (PclInternalFontPtr) NULL;
- }
-
- if ( *pin->spacing != 'P' || *pin->spacing != 'p' ) {
- if (width == 0)
- width = 1;
- pin->pitch = (float) 300.0 / width; /* Hard-Code: Resolution is 300 */
- }
-
- pin->next = (PclInternalFontPtr)NULL;
- if ( prev == (PclInternalFontPtr) NULL)
- pSoftFontInfo->pinfont = pin;
- else
- prev->next = pin;
-
- return pin;
-}
-
-static void
-fillFontDescData(FontPtr pfont, PclFontDescPtr pfd, unsigned int space)
-{
-FontInfoPtr pfi;
-
- pfi = (FontInfoRec *)&pfont->info;
-
- if ( (pfi->maxbounds.leftSideBearing == pfi->minbounds.leftSideBearing)
- && (pfi->maxbounds.rightSideBearing == pfi->minbounds.rightSideBearing)
- && (pfi->maxbounds.characterWidth == pfi->minbounds.characterWidth)
- && (pfi->maxbounds.ascent == pfi->minbounds.ascent)
- && (pfi->maxbounds.descent == pfi->minbounds.descent)
- )
- pfd->spacing = MONOSPACE;
- else
- pfd->spacing = PROPSPACE;
-
- pfd->pitch = space;
- pfd->cellheight = FONTMAXBOUNDS(pfont,ascent)
- + FONTMAXBOUNDS(pfont,descent);
- pfd->cellwidth = FONTMAXBOUNDS(pfont,rightSideBearing)
- - FONTMINBOUNDS(pfont,leftSideBearing);
- pfd->ascent = FONTMAXBOUNDS(pfont,ascent); /*FONTASCENT(pfont);*/
- pfd->descent = FONTMAXBOUNDS(pfont,descent); /*FONTDESCENT(pfont);*/
-}
-
-static PclCharDataPtr
-fillCharDescData(PclCharDataPtr pcd, CharInfoPtr pci)
-{
-unsigned int byte_width;
-unsigned char *p;
-register int nbyGlyphWidth;
-unsigned char *pglyph, *pg;
-unsigned int i, j;
-
- pcd->h_offset = pci->metrics.leftSideBearing;
- pcd->v_offset = pci->metrics.ascent;
- pcd->width = pci->metrics.rightSideBearing
- - pci->metrics.leftSideBearing;
- pcd->height = pci->metrics.ascent + pci->metrics.descent;
- pcd->font_pitch = pci->metrics.characterWidth;
-
- byte_width = (pcd->width + 7)/8;
- pcd->raster_top = (unsigned char *)xalloc(byte_width * pcd->height);
- if (pcd->raster_top == (unsigned char *)NULL)
- return (PclCharDataPtr)NULL;
-
- p = pcd->raster_top;
- nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci);
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- for (i=0; i<pcd->height; i++) {
- pg = pglyph + nbyGlyphWidth * i;
- for (j=0; j<byte_width; j++)
- *p++ = *pg++;
- }
- return pcd;
-}
-
-static void
-output_text(FILE *outFile,
- PclContextPrivPtr pConPriv,
- unsigned char index)
-{
- if ( index == ETX ) {
- sprintf(t, "%c;DT%c,1;LB%c%c;DT%c,1;LB",
- ETX, ETX_ALT, ETX, ETX_ALT, ETX);
- SAVE_PCL( outFile, pConPriv, t );
- } else {
- sprintf(t, "%c", index);
- SAVE_PCL_COUNT( outFile, pConPriv, t, 1 );
- }
-}
-
-static char *
-getFontName(FontPtr pfont)
-{
-int i;
-FontInfoPtr pfi;
-FontPropPtr props;
-char *fontname;
-
- pfi = (FontInfoRec *)&pfont->info;
- props = pfi->props;
- fontname = (char *) NULL;
- for (i=0; i<pfi->nprops; i++, props++) {
- if ( props->name == XA_FONT ) {
- fontname = (char *)NameForAtom(props->value);
- break;
- }
- }
- return fontname;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Internal Font Selection */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-static char
-isInternal(FontPtr pfont)
-{
-int i;
-FontInfoPtr pfi;
-FontPropPtr props;
-Atom dest;
-
- dest = MakeAtom("PRINTER_RESIDENT_FONT", strlen("PRINTER_RESIDENT_FONT"), TRUE);
-
- pfi = (FontInfoRec *)&pfont->info;
- props = pfi->props;
- for (i=0; i<pfi->nprops; i++, props++) {
- if ( (Atom) props->name == dest && props->value == 2 )
- return INTERNAL_FONT;
- }
- return DOWNLOAD_FONT;
-}
-
-static void
-selectInternalFont(FILE *outFile, PclInternalFontPtr pin, int fid)
-{
- fprintf(outFile, "%c*c%dD", ESC, fid);
- if ( *pin->spacing == 'P' || *pin->spacing == 'p' )
- fprintf(outFile, pin->pcl_font_name, pin->height);
- else
- fprintf(outFile, pin->pcl_font_name, pin->pitch);
- fprintf(outFile, "%c*c6F", ESC);
-}
-
-static void
-selectSize(FILE *outFile,
- PclContextPrivPtr pConPriv,
- PclInternalFontPtr pin)
-{
- if ( *pin->spacing == 'P' || *pin->spacing == 'p' ) {
- sprintf(t, "SD4,%f;", pin->height);
- SAVE_PCL( outFile, pConPriv, t );
- } else {
- sprintf(t, "SD3,%f;", pin->pitch);
- SAVE_PCL( outFile, pConPriv, t );
- }
- return;
-}
-
-#ifdef DO_TWO_BYTE_PCL
-static void
-code_conv(
- PclSoftFontInfoPtr pSoftFontInfo,
- FontPtr pfont,
- char *from,
- char *to
-)
-{
-iconv_t cd;
-char frombuf[9], *fromptr;
-size_t inbyte = 5, outbyte=2;
-
- fromptr = frombuf;
- frombuf[0] = 0x1b; /* Esc */
- frombuf[1] = 0x24; /* $ */
- frombuf[2] = 0x42; /* B */
- frombuf[3] = *from;
- frombuf[4] = *(from+1);
- frombuf[5] = 0x1b; /* Esc */
- frombuf[6] = 0x28; /* ( */
- frombuf[7] = 0x4a; /* J */
- frombuf[8] = 0x0;
- if ((cd = iconv_open("sjis", "jis")) == (iconv_t)(-1)) {
- *to = (unsigned char)NULL;
- return;
- }
-
- if ( iconv(cd, &fromptr, &inbyte, &to, &outbyte) == -1 )
- *to = (unsigned char)NULL;
-
- iconv_close(cd);
- return;
-}
-#endif /* DO_TWO_BYTE_PCL */
diff --git a/Xprint/pcl/PclWindow.c b/Xprint/pcl/PclWindow.c
deleted file mode 100644
index 27d8ea97d..000000000
--- a/Xprint/pcl/PclWindow.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/* $Xorg: PclWindow.c,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PclWindow.c
-** *
-** * Contents:
-** * Window code for Pcl driver.
-** *
-** * Created: 2/02/95
-** *
-** *********************************************************
-**
-********************************************************************/
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/PclWindow.c,v 1.11 2003/10/29 22:11:00 tsi Exp $ */
-
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "mistruct.h"
-#include "regionstr.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-
-#include "Pcl.h"
-
-#if 0
-/*
- * The following list of strings defines the properties which will be
- * placed on the screen's root window if the property was defined in
- * the start-up configuration resource database.
- */
-static /* const */ char *propStrings[] = {
- DT_PRINT_JOB_HEADER,
- DT_PRINT_JOB_TRAILER,
- DT_PRINT_JOB_COMMAND, /* old-obsolete */
- DT_PRINT_JOB_EXEC_COMMAND,
- DT_PRINT_JOB_EXEC_OPTIONS,
- DT_PRINT_PAGE_HEADER,
- DT_PRINT_PAGE_TRAILER,
- DT_PRINT_PAGE_COMMAND,
- (char *)NULL
-};
-#endif
-
-/*
- * PclCreateWindow - watch for the creation of the root window.
- * When it's created, register the screen with the print extension,
- * and put the default command/header properties on it.
- */
-/*ARGSUSED*/
-
-Bool
-PclCreateWindow(
- register WindowPtr pWin)
-{
- PclWindowPrivPtr pPriv;
-
-#if 0
- Bool status = Success;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- PclScreenPrivPtr pScreenPriv = (PclScreenPrivPtr)
- pScreen->devPrivates[PclScreenPrivateIndex].ptr;
- PclWindowPrivPtr pWinPriv = (PclWindowPrivPtr)
- pWin->devPrivates[PclWindowPrivateIndex].ptr;
-
- /*
- * Initialize this window's private struct.
- */
- pWinPriv->jobFileName = (char *)NULL;
- pWinPriv->pJobFile = (FILE *)NULL;
- pWinPriv->pageFileName = (char *)NULL;
- pWinPriv->pPageFile = (FILE *)NULL;
-
- if(pWin->parent == (WindowPtr)NULL) /* root window? */
- {
- Atom propName; /* type = XA_STRING */
- char *propVal;
- int i;
- XrmDatabase rmdb = pScreenPriv->resDB;
-
- /*
- * Put the defaults spec'd in the config files in properties on this
- * screen's root window.
- */
- for(i = 0; propStrings[i] != (char *)NULL; i++)
- {
- if((propVal = _DtPrintGetPrinterResource(pWin, rmdb,
- propStrings[i])) !=
- (char *)NULL)
- {
- propName = MakeAtom(propStrings[i], strlen(propStrings[i]),
- TRUE);
- ChangeWindowProperty(pWin, propName, XA_STRING, 8,
- PropModeReplace, strlen(propVal),
- (pointer)propVal, FALSE);
- xfree(propVal);
- }
- }
- }
-
- return status;
-#endif
-
- /*
- * Invalidate the window's private print context.
- */
- pPriv = (PclWindowPrivPtr)pWin->devPrivates[PclWindowPrivateIndex].ptr;
- pPriv->validContext = 0;
-
- return TRUE;
-}
-
-
-/*ARGSUSED*/
-Bool PclMapWindow(
- WindowPtr pWindow)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-Bool
-PclPositionWindow(
- register WindowPtr pWin,
- int x,
- int y)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-Bool
-PclUnmapWindow(
- WindowPtr pWindow)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-void
-PclCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
-}
-
-/*ARGSUSED*/
-Bool
-PclChangeWindowAttributes(
- register WindowPtr pWin,
- register unsigned long mask)
-{
- if( pWin->backingStore != NotUseful )
- {
- pWin->backingStore = NotUseful;
- mask |= CWBackingStore;
- }
-
- return TRUE;
-}
-
-
-/*
- * This function is largely ripped from miPaintWindow, but modified so
- * that the background is not painted to the root window, and so that
- * the backing store is not referenced.
- */
-void
-PclPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
-
-#define FUNCTION 0
-#define FOREGROUND 1
-#define TILE 2
-#define FILLSTYLE 3
-#define ABSX 4
-#define ABSY 5
-#define CLIPMASK 6
-#define SUBWINDOW 7
-#define COUNT_BITS 8
-
- pointer gcval[7];
- pointer newValues [COUNT_BITS];
-
- BITS32 gcmask, index, mask;
- RegionRec prgnWin;
- DDXPointRec oldCorner;
- BoxRec box;
- WindowPtr pBgWin;
- GCPtr pGC;
- register int i;
- register BoxPtr pbox;
- register ScreenPtr pScreen = pWin->drawable.pScreen;
- register xRectangle *prect;
- int numRects;
-
- gcmask = 0;
-
- /*
- * We don't want to paint a window that has no place to put the
- * PCL output.
- */
- if( PclGetContextFromWindow( pWin ) == (XpContextPtr)NULL )
- return;
-
- if (what == PW_BACKGROUND)
- {
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- (*pWin->parent->drawable.pScreen->PaintWindowBackground)
- (pWin->parent, pRegion, what);
- return;
- case BackgroundPixel:
- newValues[FOREGROUND] = (pointer)pWin->background.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- break;
- case BackgroundPixmap:
- newValues[TILE] = (pointer)pWin->background.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin |
- GCTileStipYOrigin;
- break;
- }
- }
- else
- {
- if (pWin->borderIsPixel)
- {
- newValues[FOREGROUND] = (pointer)pWin->border.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- }
- else
- {
- newValues[TILE] = (pointer)pWin->border.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin
- | GCTileStipYOrigin;
- }
- }
-
- prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) *
- sizeof(xRectangle));
- if (!prect)
- return;
-
- newValues[FUNCTION] = (pointer)GXcopy;
- gcmask |= GCFunction | GCClipMask;
-
- i = pScreen->myNum;
-
- pBgWin = pWin;
- if (what == PW_BORDER)
- {
- while (pBgWin->backgroundState == ParentRelative)
- pBgWin = pBgWin->parent;
- }
-
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
- if (!pGC)
- {
- DEALLOCATE_LOCAL(prect);
- return;
- }
- /*
- * mash the clip list so we can paint the border by
- * mangling the window in place, pretending it
- * spans the entire screen
- */
- if (what == PW_BORDER)
- {
- prgnWin = pWin->clipList;
- oldCorner.x = pWin->drawable.x;
- oldCorner.y = pWin->drawable.y;
- pWin->drawable.x = pWin->drawable.y = 0;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT(pScreen, &pWin->clipList, &box, 1);
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- newValues[ABSX] = (pointer)(long)pBgWin->drawable.x;
- newValues[ABSY] = (pointer)(long)pBgWin->drawable.y;
- }
- else
- {
- newValues[ABSX] = (pointer)0;
- newValues[ABSY] = (pointer)0;
- }
-
-/*
- * XXX Backing store is turned off for the PCL driver
-
- if (pWin->backStorage)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC,
- GuaranteeVisBack);
- */
-
- mask = gcmask;
- gcmask = 0;
- i = 0;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
- switch (index) {
- case GCFunction:
- if ((pointer)(long) pGC->alu != newValues[FUNCTION]) {
- gcmask |= index;
- gcval[i++] = newValues[FUNCTION];
- }
- break;
- case GCTileStipXOrigin:
- if ((pointer)(long) pGC->patOrg.x != newValues[ABSX]) {
- gcmask |= index;
- gcval[i++] = newValues[ABSX];
- }
- break;
- case GCTileStipYOrigin:
- if ((pointer)(long) pGC->patOrg.y != newValues[ABSY]) {
- gcmask |= index;
- gcval[i++] = newValues[ABSY];
- }
- break;
- case GCClipMask:
- if ((pointer)(long) pGC->clientClipType != (pointer)CT_NONE) {
- gcmask |= index;
- gcval[i++] = (pointer)CT_NONE;
- }
- break;
- case GCSubwindowMode:
- if ((pointer)(long) pGC->subWindowMode != newValues[SUBWINDOW]) {
- gcmask |= index;
- gcval[i++] = newValues[SUBWINDOW];
- }
- break;
- case GCTile:
- if (pGC->tileIsPixel ||
- (pointer) pGC->tile.pixmap != newValues[TILE])
- {
- gcmask |= index;
- gcval[i++] = newValues[TILE];
- }
- break;
- case GCFillStyle:
- if ((pointer)(long) pGC->fillStyle != newValues[FILLSTYLE]) {
- gcmask |= index;
- gcval[i++] = newValues[FILLSTYLE];
- }
- break;
- case GCForeground:
- if ((pointer) pGC->fgPixel != newValues[FOREGROUND]) {
- gcmask |= index;
- gcval[i++] = newValues[FOREGROUND];
- }
- break;
- }
- }
-
- if (gcmask)
- DoChangeGC(pGC, gcmask, (XID *)gcval, 1);
-
- if (pWin->drawable.serialNumber != pGC->serialNumber)
- ValidateGC((DrawablePtr)pWin, pGC);
-
- numRects = REGION_NUM_RECTS(pRegion);
- pbox = REGION_RECTS(pRegion);
- for (i= numRects; --i >= 0; pbox++, prect++)
- {
- prect->x = pbox->x1 - pWin->drawable.x;
- prect->y = pbox->y1 - pWin->drawable.y;
- prect->width = pbox->x2 - pbox->x1;
- prect->height = pbox->y2 - pbox->y1;
- }
- prect -= numRects;
- (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect);
- DEALLOCATE_LOCAL(prect);
-
-/*
- * XXX Backing store is turned off for the PCL driver
-
- if (pWin->backStorage)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC,
- GuaranteeNothing);
- */
-
- if (what == PW_BORDER)
- {
- REGION_UNINIT(pScreen, &pWin->clipList);
- pWin->clipList = prgnWin;
- pWin->drawable.x = oldCorner.x;
- pWin->drawable.y = oldCorner.y;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- FreeScratchGC(pGC);
-
-}
-
-/*ARGSUSED*/
-Bool
-PclDestroyWindow(
- WindowPtr pWin)
-{
- return TRUE;
-}
-
diff --git a/Xprint/pcl/Pclmap.h b/Xprint/pcl/Pclmap.h
deleted file mode 100644
index 1386b0ab4..000000000
--- a/Xprint/pcl/Pclmap.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/* $Xorg: Pclmap.h,v 1.3 2000/08/17 19:48:08 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pclmap.h,v 1.6 2001/12/21 21:02:05 dawes Exp $ */
-
-#ifndef _PCLMAP_H_
-#define _PCLMAP_H_
-
-#ifdef XP_PCL_COLOR
-#ifdef CATNAME
-#undef CATNAME
-#endif
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define PCLNAME(subname) PclCr##subname
-#define CATNAME(prefix,subname) prefix##Color##subname
-#else
-#define PCLNAME(subname) PclCr/**/subname
-#define CATNAME(prefix,subname) prefix/**/Color/**/subname
-#endif
-#endif /* XP_PCL_COLOR */
-
-#ifdef XP_PCL_MONO
-#ifdef CATNAME
-#undef CATNAME
-#endif
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define PCLNAME(subname) PclMn##subname
-#define CATNAME(prefix,subname) prefix##Mono##subname
-#else
-#define PCLNAME(subname) PclMn/**/subname
-#define CATNAME(prefix,subname) prefix/**/Mono/**/subname
-#endif
-#endif /* XP_PCL_MONO */
-
-#ifdef XP_PCL_LJ3
-#ifdef CATNAME
-#undef CATNAME
-#endif
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define PCLNAME(subname) PclLj3##subname
-#define CATNAME(prefix,subname) prefix##Lj3##subname
-#else
-#define PCLNAME(subname) PclLj3/**/subname
-#define CATNAME(prefix,subname) prefix/**/Lj3/**/subname
-#endif
-#endif /* XP_PCL_LJ3 */
-
-#ifdef PCLNAME
-
-/* PclInit.c */
-#define InitializePclDriver CATNAME(Initialize, PclDriver)
-#define PclCloseScreen PCLNAME(CloseScreen)
-#define PclGetContextFromWindow PCLNAME(GetContextFromWindow)
-#define PclScreenPrivateIndex PCLNAME(ScreenPrivateIndex)
-#define PclWindowPrivateIndex PCLNAME(WindowPrivateIndex)
-#define PclContextPrivateIndex PCLNAME(ContextPrivateIndex)
-#define PclPixmapPrivateIndex PCLNAME(PixmapPrivateIndex)
-#define PclGCPrivateIndex PCLNAME(GCPrivateIndex)
-
-/* PclPrint.c */
-#define PclStartJob PCLNAME(StartJob)
-#define PclEndJob PCLNAME(EndJob)
-#define PclStartPage PCLNAME(StartPage)
-#define PclEndPage PCLNAME(EndPage)
-#define PclStartDoc PCLNAME(StartDoc)
-#define PclEndDoc PCLNAME(EndDoc)
-#define PclDocumentData PCLNAME(DocumentData)
-#define PclGetDocumentData PCLNAME(GetDocumentData)
-
-/* PclWindow.c */
-#define PclCreateWindow PCLNAME(CreateWindow)
-#define PclMapWindow PCLNAME(MapWindow)
-#define PclPositionWindow PCLNAME(PositionWindow)
-#define PclUnmapWindow PCLNAME(UnmapWindow)
-#define PclCopyWindow PCLNAME(CopyWindow)
-#define PclChangeWindowAttributes PCLNAME(ChangeWindowAttributes)
-#define PclPaintWindow PCLNAME(PaintWindow)
-#define PclDestroyWindow PCLNAME(DestroyWindow)
-
-/* PclGC.c */
-#define PclCreateGC PCLNAME(CreateGC)
-#define PclDestroyGC PCLNAME(DestroyGC)
-#define PclGetDrawablePrivateStuff PCLNAME(GetDrawablePrivateStuff)
-#define PclSetDrawablePrivateGC PCLNAME(SetDrawablePrivateGC)
-#define PclSendPattern PCLNAME(SendPattern)
-#define PclUpdateDrawableGC PCLNAME(UpdateDrawableGC)
-#define PclComputeCompositeClip PCLNAME(ComputeCompositeClip)
-#define PclValidateGC PCLNAME(ValidateGC)
-
-/* PclAttr.c */
-#define PclGetAttributes PCLNAME(GetAttributes)
-#define PclGetOneAttribute PCLNAME(GetOneAttribute)
-#define PclAugmentAttributes PCLNAME(AugmentAttributes)
-#define PclSetAttributes PCLNAME(SetAttributes)
-
-/* PclColor.c */
-#define PclLookUp PCLNAME(LookUp)
-#define PclCreateDefColormap PCLNAME(CreateDefColormap)
-#define PclCreateColormap PCLNAME(CreateColormap)
-#define PclDestroyColormap PCLNAME(DestroyColormap)
-#define PclInstallColormap PCLNAME(InstallColormap)
-#define PclUninstallColormap PCLNAME(UninstallColormap)
-#define PclListInstalledColormaps PCLNAME(ListInstalledColormaps)
-#define PclStoreColors PCLNAME(StoreColors)
-#define PclResolveColor PCLNAME(ResolveColor)
-#define PclFindPaletteMap PCLNAME(FindPaletteMap)
-#define PclUpdateColormap PCLNAME(UpdateColormap)
-#define PclReadMap PCLNAME(ReadMap)
-
-/* PclPixmap.c */
-#define PclCreatePixmap PCLNAME(CreatePixmap)
-#define PclDestroyPixmap PCLNAME(DestroyPixmap)
-
-/* PclArc.c */
-#define PclDoArc PCLNAME(DoArc)
-#define PclPolyArc PCLNAME(PolyArc)
-#define PclPolyFillArc PCLNAME(PolyFillArc)
-
-/* PclArea.c */
-#define PclPutImage PCLNAME(PutImage)
-#define PclCopyArea PCLNAME(CopyArea)
-#define PclCopyPlane PCLNAME(CopyPlane)
-
-/* PclLine */
-#define PclPolyLine PCLNAME(PolyLine)
-#define PclPolySegment PCLNAME(PolySegment)
-
-/* PclPixel.c */
-#define PclPolyPoint PCLNAME(PolyPoint)
-#define PclPushPixels PCLNAME(PushPixels)
-
-/* PclPolygon.c */
-#define PclPolyRectangle PCLNAME(PolyRectangle)
-#define PclFillPolygon PCLNAME(FillPolygon)
-#define PclPolyFillRect PCLNAME(PolyFillRect)
-
-/* PclSpans.c */
-#define PclFillSpans PCLNAME(FillSpans)
-#define PclSetSpans PCLNAME(SetSpans)
-
-/* PclText.c */
-#define PclPolyText8 PCLNAME(PolyText8)
-#define PclPolyText16 PCLNAME(PolyText16)
-#define PclImageText8 PCLNAME(ImageText8)
-#define PclImageText16 PCLNAME(ImageText16)
-#define PclImageGlyphBlt PCLNAME(ImageGlyphBlt)
-#define PclPolyGlyphBlt PCLNAME(PolyGlyphBlt)
-#define PclPolyGlyphBlt PCLNAME(PolyGlyphBlt)
-
-/* PclFonts.c */
-#define PclRealizeFont PCLNAME(RealizeFont)
-#define PclUnrealizeFont PCLNAME(UnrealizeFont)
-
-/* PclSFonts.c */
-#define PclDownloadSoftFont8 PCLNAME(DownloadSoftFont8)
-#define PclDownloadSoftFont16 PCLNAME(DownloadSoftFont16)
-#define PclCreateSoftFontInfo PCLNAME(CreateSoftFontInfo)
-#define PclDestroySoftFontInfo PCLNAME(DestroySoftFontInfo)
-
-/* PclMisc.c */
-#define PclQueryBestSize PCLNAME(QueryBestSize)
-#define GetPropString PCLNAME(GetPropString)
-#define SystemCmd PCLNAME(SystemCmd)
-#define PclGetMediumDimensions PCLNAME(GetMediumDimensions)
-#define PclGetReproducibleArea PCLNAME(GetReproducibleArea)
-#define PclSpoolFigs PCLNAME(SpoolFigs)
-#define PclSendData PCLNAME(SendData)
-
-/* PclCursor.c */
-#define PclConstrainCursor PCLNAME(ConstrainCursor)
-#define PclCursorLimits PCLNAME(CursorLimits)
-#define PclDisplayCursor PCLNAME(DisplayCursor)
-#define PclRealizeCursor PCLNAME(RealizeCursor)
-#define PclUnrealizeCursor PCLNAME(UnrealizeCursor)
-#define PclRecolorCursor PCLNAME(RecolorCursor)
-#define PclSetCursorPosition PCLNAME(SetCursorPosition)
-
-#endif
-
-#endif /* _PCLMAP_H_ */
diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h
deleted file mode 100644
index 7b0aaeb39..000000000
--- a/Xprint/ps/Ps.h
+++ /dev/null
@@ -1,516 +0,0 @@
-/* $Xorg: Ps.h,v 1.5 2001/02/09 02:04:35 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: Ps.h
-** *
-** * Contents: defines and includes for the Ps driver
-** * for a printing X server.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/Ps.h,v 1.14 2003/07/16 01:38:34 dawes Exp $ */
-
-#ifndef _PS_H_
-#define _PS_H_
-
-#include <stdio.h>
-
-#ifdef abs
-#undef abs /* this is because of a non-Spec1170ness in misc.h */
-#endif
-#include <stdlib.h>
-#include "scrnintstr.h"
-#include "dix.h"
-
-#include "PsDef.h"
-#include "psout.h"
-
-#include <X11/extensions/Print.h>
-#include <X11/extensions/Printstr.h>
-
-#include "regionstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-
-/*
- * Some sleazes to force the XrmDB stuff into the server
- */
-#ifndef HAVE_XPointer
-typedef char *XPointer;
-#define Status int
-#define True 1
-#define False 0
-#endif
-
-#include "misc.h"
-#include <X11/Xfuncproto.h>
-#include <X11/Xresource.h>
-#include "attributes.h"
-
-/*
- * Public index variables from PsInit.c
- */
-
-extern int PsScreenPrivateIndex;
-extern int PsWindowPrivateIndex;
-extern int PsContextPrivateIndex;
-extern int PsPixmapPrivateIndex;
-extern XpValidatePoolsRec PsValidatePoolsRec;
-
-/*
- * Display list structures
- */
-
-#define DPY_BLOCKSIZE 4096
-
-typedef struct
-{
- int mode;
- int nPoints;
- xPoint *pPoints;
-} PsPolyPointsRec;
-
-typedef struct
-{
- int nSegments;
- xSegment *pSegments;
-} PsSegmentsRec;
-
-typedef struct
-{
- int nRects;
- xRectangle *pRects;
-} PsRectanglesRec;
-
-typedef struct
-{
- int nArcs;
- xArc *pArcs;
-} PsArcsRec;
-
-typedef struct
-{
- int x;
- int y;
- int count;
- char *string;
-} PsText8Rec;
-
-typedef struct
-{
- int x;
- int y;
- int count;
- unsigned short *string;
-} PsText16Rec;
-
-typedef struct
-{
- int depth;
- int x;
- int y;
- int w;
- int h;
- int leftPad;
- int format;
- int res; /* image resolution */
- char *pData;
-} PsImageRec;
-
-typedef struct
-{
- int x;
- int y;
- int w;
- int h;
-} PsFrameRec;
-
-typedef enum
-{
- PolyPointCmd,
- PolyLineCmd,
- PolySegmentCmd,
- PolyRectangleCmd,
- FillPolygonCmd,
- PolyFillRectCmd,
- PolyArcCmd,
- PolyFillArcCmd,
- Text8Cmd,
- Text16Cmd,
- TextI8Cmd,
- TextI16Cmd,
- PutImageCmd,
- BeginFrameCmd,
- EndFrameCmd
-} DisplayElmType;
-
-typedef struct _DisplayElmRec
-{
- DisplayElmType type;
- GCPtr gc;
- union
- {
- PsPolyPointsRec polyPts;
- PsSegmentsRec segments;
- PsRectanglesRec rects;
- PsArcsRec arcs;
- PsText8Rec text8;
- PsText16Rec text16;
- PsImageRec image;
- PsFrameRec frame;
- } c;
-} DisplayElmRec;
-
-typedef DisplayElmRec *DisplayElmPtr;
-
-typedef struct _DisplayListRec
-{
- struct _DisplayListRec *next;
- int nelms;
- DisplayElmRec elms[DPY_BLOCKSIZE];
-} DisplayListRec;
-
-typedef DisplayListRec *DisplayListPtr;
-
-/*
- * Private structures
- */
-
-typedef struct
-{
- XrmDatabase resDB;
- ColormapPtr CMap;
- Bool (*DestroyWindow)(WindowPtr);
-} PsScreenPrivRec, *PsScreenPrivPtr;
-
-typedef struct
-{
- char *jobFileName;
- FILE *pJobFile;
- GC lastGC;
- unsigned char *dash;
- int validGC;
- ClientPtr getDocClient;
- int getDocBufSize;
- PsOutPtr pPsOut;
-} PsContextPrivRec, *PsContextPrivPtr;
-
-typedef struct
-{
- int validContext;
- XpContextPtr context;
-} PsWindowPrivRec, *PsWindowPrivPtr;
-
-typedef struct
-{
- XpContextPtr context;
- GC lastGC;
- int validGC;
- DisplayListPtr dispList;
-} PsPixmapPrivRec, *PsPixmapPrivPtr;
-
-/*
- * Macro functions
- */
-
-#define SEND_PS(f,c) fwrite( c, sizeof( char ), strlen( c ), f )
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/*
- * Functions in PsInit.c
- */
-
-extern Bool InitializePsDriver(int ndx, ScreenPtr pScreen, int argc,
- char **argv);
-extern XpContextPtr PsGetContextFromWindow(WindowPtr win);
-
-/*
- * Functions in PsPrint.c
- */
-
-extern int PsStartJob(XpContextPtr pCon, Bool sendClientData, ClientPtr client);
-extern int PsEndJob(XpContextPtr pCon, Bool cancel);
-extern int PsStartPage(XpContextPtr pCon, WindowPtr pWin);
-extern int PsEndPage(XpContextPtr pCon, WindowPtr pWin);
-extern int PsStartDoc(XpContextPtr pCon, XPDocumentType type);
-extern int PsEndDoc(XpContextPtr pCon, Bool cancel);
-extern int PsDocumentData(XpContextPtr pCon, DrawablePtr pDraw, char *pData,
- int len_data, char *pFmt, int len_fmt, char *pOpt, int len_opt,
- ClientPtr client);
-extern int PsGetDocumentData(XpContextPtr pCon, ClientPtr client,
- int maxBufferSize);
-
-/*
- * Functions in PsGC.c
- */
-
-extern Bool PsCreateGC(GCPtr pGC);
-extern int PsUpdateDrawableGC(GCPtr pGC, DrawablePtr pDrawable,
- PsOutPtr *psOut, ColormapPtr *cMap);
-extern void PsValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
-extern void PsChangeGC(GCPtr pGC, unsigned long changes);
-extern void PsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-extern void PsDestroyGC(GCPtr pGC);
-extern void PsChangeClip(GCPtr pGC, int type, pointer pValue, int nrects);
-extern void PsDestroyClip(GCPtr pGC);
-extern void PsCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-extern GCPtr PsCreateAndCopyGC(DrawablePtr pDrawable, GCPtr pSrc);
-
-/*
- * Functions in PsMisc.c
- */
-
-extern void PsQueryBestSize(int type, short *pwidth, short *pheight,
- ScreenPtr pScreen);
-extern Bool PsCloseScreen(int index, ScreenPtr pScreen);
-extern void PsLineAttrs(PsOutPtr psOut, GCPtr pGC, ColormapPtr cMap);
-extern int PsGetMediumDimensions(
- XpContextPtr pCon,
- CARD16 *pWidth,
- CARD16 *pHeight);
-extern int PsGetReproducibleArea(
- XpContextPtr pCon,
- xRectangle *pRect);
-extern int PsSetImageResolution(
- XpContextPtr pCon,
- int imageRes,
- Bool *status);
-
-/*
- * Functions in PsSpans.c
- */
-
-extern void PsFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans,
- DDXPointPtr pPoints, int *pWidths, int fSorted);
-extern void PsSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
- DDXPointPtr pPoints, int *pWidths, int nSpans,
- int fSorted);
-
-/*
- * Functions in PsArea.c
- */
-
-extern void PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad, int format,
- int imageRes, char *pImage);
-extern void PsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad, int format,
- char *pImage);
-extern void PsPutImageMask(DrawablePtr pDrawable, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad, int format,
- char *pImage);
-extern RegionPtr PsCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height,
- int dstx, int dsty);
-extern RegionPtr PsCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long plane);
-
-/*
- * Functions in PsPixel.c
- */
-
-extern void PsPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int nPoints, xPoint *pPoints);
-extern void PsPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable,
- int width, int height, int x, int y);
-
-/*
- * Functions in PsLine.c
- */
-
-extern void PsPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int nPoints, xPoint *pPoints);
-extern void PsPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
- xSegment *pSegments);
-
-/*
- * Functions in PsPolygon.c
- */
-
-extern void PsPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRects,
- xRectangle *pRects);
-extern void PsFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int nPoints, DDXPointPtr pPoints);
-extern void PsPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRects,
- xRectangle *pRects);
-
-/*
- * Functions in PsPolygon.c
- */
-
-extern void PsPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs,
- xArc *pArcs);
-extern void PsPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs,
- xArc *pArcs);
-
-/*
- * Functions in PsText.c
- */
-
-extern int PsPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- int count, char *string);
-extern int PsPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- int count, unsigned short *string);
-extern void PsImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- int count, char *string);
-extern void PsImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- int count, unsigned short *string);
-extern void PsImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-extern void PsPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-
-/*
- * Functions in PsWindow.c
- */
-
-extern Bool PsCreateWindow(WindowPtr pWin);
-extern Bool PsMapWindow(WindowPtr pWin);
-extern Bool PsPositionWindow(WindowPtr pWin, int x, int y);
-extern Bool PsUnmapWindow(WindowPtr pWin);
-extern void PsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-extern Bool PsChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
-extern void PsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-extern Bool PsDestroyWindow(WindowPtr pWin);
-
-/*
- * Functions in PsFonts.c
- */
-
-extern Bool PsRealizeFont(ScreenPtr pscr, FontPtr pFont);
-extern Bool PsUnrealizeFont(ScreenPtr pscr, FontPtr pFont);
-extern char *PsGetFontName(FontPtr pFont);
-extern int PsGetFontSize(FontPtr pFont, float *mtx);
-extern char *PsGetPSFontName(FontPtr pFont);
-extern int PsIsISOLatin1Encoding(FontPtr pFont);
-
-/*
- * Functions in PsAttr.c
- */
-
-extern char *PsGetAttributes(XpContextPtr pCon, XPAttributes pool);
-extern char *PsGetOneAttribute(XpContextPtr pCon, XPAttributes pool,
- char *attr);
-extern int PsAugmentAttributes(XpContextPtr pCon, XPAttributes pool,
- char *attrs);
-extern int PsSetAttributes(XpContextPtr pCon, XPAttributes pool, char *attrs);
-
-/*
- * Functions in PsColor.c
- */
-
-extern Bool PsCreateColormap(ColormapPtr pColor);
-extern void PsDestroyColormap(ColormapPtr pColor);
-extern void PsInstallColormap(ColormapPtr pColor);
-extern void PsUninstallColormap(ColormapPtr pColor);
-extern int PsListInstalledColormaps(ScreenPtr pScreen, XID *pCmapList);
-extern void PsStoreColors(ColormapPtr pColor, int ndef, xColorItem *pdefs);
-extern void PsResolveColor(unsigned short *pRed, unsigned short *pGreen,
- unsigned short *pBlue, VisualPtr pVisual);
-extern int PsGetPixelColor(ColormapPtr cMap, int pixval);
-extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
- ColormapPtr cMap);
-
-/*
- * Functions in PsPixmap.c
- */
-
-extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height,
- int depth);
-extern Bool PsDestroyPixmap(PixmapPtr pPixmap);
-extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv);
-extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable);
-extern int PsCloneDisplayElm(PixmapPtr dst,
- DisplayElmPtr elm, DisplayElmPtr newElm,
- int xoff, int yoff);
-extern void PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff,
- int yoff, int x, int y, int w, int h);
-extern PsElmPtr PsCreateFillElementList(PixmapPtr pix, int *nElms);
-extern PsElmPtr PsCloneFillElementList(int nElms, PsElmPtr elms);
-extern void PsDestroyFillElementList(int nElms, PsElmPtr elms);
-
-/*
- * Functions in PsCache.c
- */
-
-#ifdef BM_CACHE
-extern int PsBmIsImageCached(int gWidth, int gHeight, char *pBuffer);
-extern int PsBmPutImageInCache(int gWidth, int gHeight, char *pBuffer);
-extern void PsBmClearImageCache(void);
-#endif
-
-#endif /* _PS_H_ */
diff --git a/Xprint/ps/PsArc.c b/Xprint/ps/PsArc.c
deleted file mode 100644
index 76804bb18..000000000
--- a/Xprint/ps/PsArc.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* $Xorg: PsArc.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsArc.c
-** *
-** * Contents: Arc-drawing code for the PS DDX driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include <stdio.h>
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PsPolyArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyArcCmd;
- elm->gc = gc;
- elm->c.arcs.nArcs = nArcs;
- elm->c.arcs.pArcs = (xArc *)xalloc(nArcs*sizeof(xArc));
- memcpy(elm->c.arcs.pArcs, pArcs, nArcs*sizeof(xArc));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- PsLineAttrs(psOut, pGC, cMap);
- for( i=0 ; i<nArcs ; i++ )
- {
- PsOut_DrawArc(psOut, (int)pArcs[i].x, (int)pArcs[i].y,
- (int)pArcs[i].width, (int)pArcs[i].height,
- (float)pArcs[i].angle1/64.,
- (float)pArcs[i].angle2/64.);
- }
- }
-}
-
-void
-PsPolyFillArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArcs,
- xArc *pArcs)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyFillArcCmd;
- elm->gc = gc;
- elm->c.arcs.nArcs = nArcs;
- elm->c.arcs.pArcs = (xArc *)xalloc(nArcs*sizeof(xArc));
- memcpy(elm->c.arcs.pArcs, pArcs, nArcs*sizeof(xArc));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- PsArcEnum styl;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsSetFillColor(pDrawable, pGC, psOut, cMap);
- PsLineAttrs(psOut, pGC, cMap);
- if( pGC->arcMode==ArcChord ) styl = PsChord;
- else styl = PsPieSlice;
- for( i=0 ; i<nArcs ; i++ )
- {
- PsOut_FillArc(psOut, (int)pArcs[i].x, (int)pArcs[i].y,
- (int)pArcs[i].width, (int)pArcs[i].height,
- (float)pArcs[i].angle1/64.,
- (float)pArcs[i].angle2/64., styl);
- }
- }
-}
diff --git a/Xprint/ps/PsArea.c b/Xprint/ps/PsArea.c
deleted file mode 100644
index eed650ada..000000000
--- a/Xprint/ps/PsArea.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* $Xorg: PsArea.c,v 1.6 2001/03/14 18:27:44 pookie Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996, 2000 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsArea.c
-** *
-** * Contents: Image and Area functions for the PS DDX driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, int imageRes, char *pImage)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- int size = PixmapBytePad(w, depth)*h;
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
- elm = &disp->elms[disp->nelms];
- elm->type = PutImageCmd;
- elm->gc = gc;
- elm->c.image.depth = depth;
- elm->c.image.x = x;
- elm->c.image.y = y;
- elm->c.image.w = w;
- elm->c.image.h = h;
- elm->c.image.leftPad = leftPad;
- elm->c.image.format = format;
- elm->c.image.res = imageRes;
- elm->c.image.pData = (char *)xalloc(size);
- memcpy(elm->c.image.pData, pImage, size);
- disp->nelms += 1;
- }
- else
- {
- int i, j;
- int r, c;
- int swap;
- char *pt;
- PsOutPtr psOut;
- ColormapPtr cMap;
- int pageRes, sw, sh;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- if (!imageRes) {
- sw = w;
- sh = h;
- } else {
- pageRes = XpGetResolution(XpGetPrintContext(requestingClient));
- sw = (float)w * (float)pageRes / (float)imageRes + 0.5;
- sh = (float)h * (float)pageRes / (float)imageRes + 0.5;
- }
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- pt = (char *)(&i); i = 1; if( pt[0]=='\001' ) swap = 1; else swap = 0;
-
- if( depth==24 )
- {
- PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3);
- if( format==XYPixmap )
- {
- int rowsiz = PixmapBytePad(w, depth);
- char *planes[3];
- planes[0] = pImage;
- planes[1] = &pImage[rowsiz*h];
- planes[2] = &pImage[rowsiz*h*2];
- for( r=0 ; r<h ; r++ )
- {
- char *pt[3];
- for( i=0 ; i<3 ; i++ ) pt[i] = &planes[i][rowsiz*r];
- for( c=0 ; c<w ; c++ )
- {
- for( i=0 ; i<3 ; i++ )
- { PsOut_OutImageBytes(psOut, 1, &pt[i][c]); pt[i]++; }
- }
- }
- }
- else if( format==ZPixmap )
- {
- int rowsiz = PixmapBytePad(w, depth);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( c=0 ; c<w ; c++,pt+=4 )
- {
- if( swap )
- {
- char tmp[4];
- tmp[0] = pt[3]; tmp[1] = pt[2]; tmp[2] = pt[1]; tmp[3] = pt[0];
- PsOut_OutImageBytes(psOut, 3, &tmp[1]);
- }
- else
- PsOut_OutImageBytes(psOut, 3, &pt[1]);
- }
- }
- }
- else goto error;
- PsOut_EndImage(psOut);
- }
- else if( depth==8 )
- {
- int rowsiz = PixmapBytePad(w, depth);
- PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( c=0 ; c<w ; c++,pt++ )
- {
- int val = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
- char *ipt = (char *)&val;
- if( swap )
- {
- char tmp[4];
- tmp[0] = ipt[3]; tmp[1] = ipt[2]; tmp[2] = ipt[1]; tmp[3] = ipt[0];
- PsOut_OutImageBytes(psOut, 3, &tmp[1]);
- }
- else
- PsOut_OutImageBytes(psOut, 3, &ipt[1]);
- }
- }
- PsOut_EndImage(psOut);
- }
- else if( depth==1 )
- {
- {
- int rowsiz = BitmapBytePad(w);
- int psrsiz = (w+7)/8;
- PsOut_BeginImage(psOut, PsGetPixelColor(cMap, pGC->bgPixel),
- PsGetPixelColor(cMap, pGC->fgPixel),
- x, y, w, h, sw, sh, 1);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( i=0 ; i<psrsiz ; i++ )
- {
- int iv_, iv = (int)pt[i]&0xFF;
- char c;
- if( swap )
- { for( j=0,iv_=0 ; j<8 ; j++ ) iv_ |= (((iv>>j)&1)<<(7-j)); }
- else
- iv_ = iv;
- c = iv_;
- PsOut_OutImageBytes(psOut, 1, &c);
- }
- }
- PsOut_EndImage(psOut);
- }
- }
- }
-error:
- return;
-}
-
-static void
-PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, int imageRes, char *pImage)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- int size = PixmapBytePad(w, depth)*h;
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
- elm = &disp->elms[disp->nelms];
- elm->type = PutImageCmd;
- elm->gc = gc;
- elm->c.image.depth = depth;
- elm->c.image.x = x;
- elm->c.image.y = y;
- elm->c.image.w = w;
- elm->c.image.h = h;
- elm->c.image.leftPad = leftPad;
- elm->c.image.format = format;
- elm->c.image.res = imageRes;
- elm->c.image.pData = (char *)xalloc(size);
- memcpy(elm->c.image.pData, pImage, size);
- disp->nelms += 1;
- }
- else
- {
- int i, j;
- int r, c;
- int swap;
- char *pt;
- PsOutPtr psOut;
- ColormapPtr cMap;
- int pageRes, sw, sh;
-#ifdef BM_CACHE
- long cache_id = 0;
-#endif
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- if (!imageRes) {
- sw = w;
- sh = h;
- } else {
- pageRes = XpGetResolution(XpGetPrintContext(requestingClient));
- sw = (float)w * (float)pageRes / (float)imageRes + 0.5;
- sh = (float)h * (float)pageRes / (float)imageRes + 0.5;
- }
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- pt = (char *)(&i); i = 1; if( pt[0]=='\001' ) swap = 1; else swap = 0;
-
-#ifdef BM_CACHE
- cache_id = PsBmIsImageCached(w, h, pImage);
-
- if(!cache_id)
- {
- cache_id = PsBmPutImageInCache(w, h, pImage);
-
- if(!cache_id)
- return;
-
- PsOut_BeginImageCache(psOut, cache_id);
-#endif
- if( depth==24 )
- {
- PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3);
- if( format==XYPixmap )
- {
- int rowsiz = PixmapBytePad(w, depth);
- char *planes[3];
- planes[0] = pImage;
- planes[1] = &pImage[rowsiz*h];
- planes[2] = &pImage[rowsiz*h*2];
- for( r=0 ; r<h ; r++ )
- {
- char *pt[3];
- for( i=0 ; i<3 ; i++ ) pt[i] = &planes[i][rowsiz*r];
- for( c=0 ; c<w ; c++ )
- {
- for( i=0 ; i<3 ; i++ )
- { PsOut_OutImageBytes(psOut, 1, &pt[i][c]); pt[i]++; }
- }
- }
- }
- else if( format==ZPixmap )
- {
- int rowsiz = PixmapBytePad(w, depth);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( c=0 ; c<w ; c++,pt+=4 )
- {
- if( swap )
- {
- char tmp[4];
- tmp[0] = pt[3]; tmp[1] = pt[2]; tmp[2] = pt[1]; tmp[3] = pt[0];
- PsOut_OutImageBytes(psOut, 3, &tmp[1]);
- }
- else
- PsOut_OutImageBytes(psOut, 3, &pt[1]);
- }
- }
- }
- else goto error;
- PsOut_EndImage(psOut);
- }
- else if( depth==8 )
- {
- int rowsiz = PixmapBytePad(w, depth);
- PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( c=0 ; c<w ; c++,pt++ )
- {
- int val = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
- char *ipt = (char *)&val;
- if( swap )
- {
- char tmp[4];
- tmp[0] = ipt[3]; tmp[1] = ipt[2]; tmp[2] = ipt[1]; tmp[3] = ipt[0];
- PsOut_OutImageBytes(psOut, 3, &tmp[1]);
- }
- else
- PsOut_OutImageBytes(psOut, 3, &ipt[1]);
- }
- }
- PsOut_EndImage(psOut);
- }
- else if( depth==1 )
- {
- {
- int rowsiz = BitmapBytePad(w);
- int psrsiz = (w+7)/8;
- PsOut_BeginImageIM(psOut, PsGetPixelColor(cMap, pGC->bgPixel),
- PsGetPixelColor(cMap, pGC->fgPixel),
- x, y, w, h, sw, sh, 1);
- for( r=0 ; r<h ; r++ )
- {
- char *pt = &pImage[rowsiz*r];
- for( i=0 ; i<psrsiz ; i++ )
- {
- int iv_, iv = (int)pt[i]&0xFF;
- char c;
- if( swap )
- { for( j=0,iv_=0 ; j<8 ; j++ ) iv_ |= (((iv>>j)&1)<<(7-j)); }
- else
- iv_ = iv;
- c = iv_;
- PsOut_OutImageBytes(psOut, 1, &c);
- }
- }
- PsOut_EndImage(psOut);
- }
- }
-#ifdef BM_CACHE
- PsOut_EndImageCache(psOut);
- }
- PsOut_ImageCache(psOut, x, y, cache_id, PsGetPixelColor(cMap, pGC->bgPixel),
- PsGetPixelColor(cMap, pGC->fgPixel));
-#endif
- }
-error:
- return;
-}
-void
-PsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage)
-{
- XpContextPtr pcon;
- if (requestingClient && (pcon = XpGetPrintContext(requestingClient)))
- PsPutScaledImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format,
- pcon->imageRes, pImage);
-}
-void
-PsPutImageMask(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage)
-{
- XpContextPtr pcon;
- if (requestingClient && (pcon = XpGetPrintContext(requestingClient)))
- PsPutScaledImageIM(pDrawable, pGC, depth, x, y, w, h, leftPad, format,
- pcon->imageRes, pImage);
-}
-
-RegionPtr
-PsCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
- int width, int height, int dstx, int dsty)
-{
- PixmapPtr src = (PixmapPtr)pSrc;
- PixmapPtr dst = (PixmapPtr)pDst;
-
- if( pSrc->type!=DRAWABLE_PIXMAP ) return NULL;
- if( pDst->type!=DRAWABLE_PIXMAP )
- {
- PsOutPtr psOut;
- ColormapPtr cMap;
- if( PsUpdateDrawableGC(pGC, pDst, &psOut, &cMap)==FALSE ) return NULL;
- PsOut_Offset(psOut, pDst->x, pDst->y);
- PsOut_BeginFrame(psOut, dstx-srcx, dsty-srcy, dstx, dsty, width, height);
- PsReplayPixmap(src, pDst);
- PsOut_EndFrame(psOut);
- }
- else PsCopyDisplayList(src, dst, dstx-srcx, dsty-srcy, dstx, dsty,
- width, height);
- return NULL;
-}
-
-RegionPtr
-PsCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
- int width, int height, int dstx, int dsty, unsigned long plane)
-{
- PixmapPtr src = (PixmapPtr)pSrc;
- PixmapPtr dst = (PixmapPtr)pDst;
-
- if( pSrc->type!=DRAWABLE_PIXMAP ) return NULL;
- if( pDst->type!=DRAWABLE_PIXMAP )
- {
- PsOutPtr psOut;
- ColormapPtr cMap;
- if( PsUpdateDrawableGC(pGC, pDst, &psOut, &cMap)==FALSE ) return NULL;
- PsOut_Offset(psOut, pDst->x, pDst->y);
- PsOut_BeginFrame(psOut, dstx-srcx, dsty-srcy, dstx, dsty, width, height);
- PsReplayPixmap(src, pDst);
- PsOut_EndFrame(psOut);
- }
- else PsCopyDisplayList(src, dst, dstx-srcx, dsty-srcy, dstx, dsty,
- width, height);
- return NULL;
-}
diff --git a/Xprint/ps/PsAttVal.c b/Xprint/ps/PsAttVal.c
deleted file mode 100644
index a6a375487..000000000
--- a/Xprint/ps/PsAttVal.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * $Xorg: PsAttVal.c,v 1.5 2001/03/13 18:45:31 pookie Exp $
- */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsAttVal.c,v 1.5 2001/12/19 21:28:44 dawes Exp $ */
-
-#include "Ps.h"
-#include "AttrValid.h"
-
-/*
- * define valid values and defaults for Printer pool
- */
-static XpOid ValidContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape,
- xpoid_val_content_orientation_reverse_portrait,
- xpoid_val_content_orientation_reverse_landscape
-};
-static XpOidList ValidContentOrientations = {
- ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids)
-};
-
-static XpOid DefaultContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape
-};
-static XpOidList DefaultContentOrientations = {
- DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids)
-};
-
-static XpOid ValidPlexesOids[] = {
- xpoid_val_plex_simplex, xpoid_val_plex_duplex, xpoid_val_plex_tumble
-};
-static XpOidList ValidPlexes = {
- ValidPlexesOids, XpNumber(ValidPlexesOids)
-};
-
-static XpOid DefaultPlexesOids[] = {
- xpoid_val_plex_simplex
-};
-static XpOidList DefaultPlexes = {
- DefaultPlexesOids, XpNumber(DefaultPlexesOids)
-};
-
-static unsigned long ValidPrinterResolutionsCards[] = {
- 300,
- 600,
- 720,
- 940,
- 1200,
- 1440,
- 2400
-};
-static XpOidCardList ValidPrinterResolutions = {
- ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards)
-};
-
-static unsigned long DefaultPrinterResolutionsCards[] = {
- 300
-};
-static XpOidCardList DefaultPrinterResolutions = {
- DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards)
-};
-
-static XpOid ValidListfontsModesOids[] = {
- xpoid_val_xp_list_internal_printer_fonts, xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList ValidListfontsModes = {
- ValidListfontsModesOids, XpNumber(ValidListfontsModesOids)
-};
-
-static XpOid DefaultListfontsModesOids[] = {
- xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList DefaultListfontsModes = {
- DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids)
-};
-
-static XpOid ValidSetupProvisoOids[] = {
- xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional
-};
-static XpOidList ValidSetupProviso = {
-
-
- ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids)
-};
-
-static XpOidDocFmt ValidDocFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList ValidDocFormatsSupported = {
- ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList DefaultDocFormatsSupported = {
- DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmt ValidEmbeddedFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList ValidEmbeddedFormatsSupported = {
- ValidEmbeddedFormatsSupportedFmts, XpNumber(ValidEmbeddedFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultEmbeddedFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList DefaultEmbeddedFormatsSupported = {
- DefaultEmbeddedFormatsSupportedFmts, XpNumber(DefaultEmbeddedFormatsSupportedFmts)
-};
-
-/*
-** So filtered printers that accept other raw formats can be
-** used with this driver.
-**
-** Noah Roberts (jik-)
-*/
-#if 0
-static XpOidDocFmt ValidRawFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-
-};
-static XpOidDocFmtList ValidRawFormatsSupported = {
- ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts)
-};
-#endif
-
-static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList DefaultRawFormatsSupported = {
- DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts)
-};
-
-static XpOid ValidInputTraysOids[] = {
- xpoid_val_input_tray_manual,
- xpoid_val_input_tray_main,
- xpoid_val_input_tray_envelope,
- xpoid_val_input_tray_large_capacity,
- xpoid_val_input_tray_bottom
-};
-static XpOidList ValidInputTrays = {
- ValidInputTraysOids, XpNumber(ValidInputTraysOids)
-};
-
-static XpOid ValidMediumSizesOids[] = {
- xpoid_val_medium_size_iso_a4,
- xpoid_val_medium_size_na_letter,
- xpoid_val_medium_size_na_legal,
- xpoid_val_medium_size_executive,
- xpoid_val_medium_size_iso_designated_long,
- xpoid_val_medium_size_na_number_10_envelope
-};
-static XpOidList ValidMediumSizes = {
- ValidMediumSizesOids, XpNumber(ValidMediumSizesOids)
-};
-
-static XpOidDocFmt DefaultDocumentFormat = {
- "Postscript", "2", NULL
-};
-
-
-/*
- * init struct for XpValidate*Pool
- */
-XpValidatePoolsRec PsValidatePoolsRec = {
- &ValidContentOrientations, &DefaultContentOrientations,
- &ValidDocFormatsSupported, &DefaultDocFormatsSupported,
- &ValidInputTrays, &ValidMediumSizes,
- &ValidPlexes, &DefaultPlexes,
- &ValidPrinterResolutions, &DefaultPrinterResolutions,
- &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported,
- &ValidListfontsModes, &DefaultListfontsModes,
- NULL /* Any raw format specified (NR)*/, &DefaultRawFormatsSupported,
- &ValidSetupProviso,
- &DefaultDocumentFormat
-};
diff --git a/Xprint/ps/PsAttr.c b/Xprint/ps/PsAttr.c
deleted file mode 100644
index 13c4e1978..000000000
--- a/Xprint/ps/PsAttr.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $Xorg: PsAttr.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsAttr.c,v 1.5 2001/12/14 19:59:15 dawes Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsAttr.c
-** *
-** * Contents: Attribute-handling functions for the PS driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "Ps.h"
-
-char *
-PsGetAttributes(
- XpContextPtr pCon,
- XPAttributes pool)
-{
- return XpGetAttributes(pCon, pool);
-}
-
-char *
-PsGetOneAttribute(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attr)
-{
- return XpGetOneAttribute(pCon, pool, attr);
-}
-
-int
-PsAugmentAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs)
-{
- return XpAugmentAttributes(pCon, pool, attrs);
-}
-
-int
-PsSetAttributes(
- XpContextPtr pCon,
- XPAttributes pool,
- char *attrs)
-{
- return XpSetAttributes(pCon, pool, attrs);
-}
diff --git a/Xprint/ps/PsCache.c b/Xprint/ps/PsCache.c
deleted file mode 100644
index b688fbba1..000000000
--- a/Xprint/ps/PsCache.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996, 2000 Sun Microsystems, Inc. All Rights Reserved.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsCache.c
-** *
-** * Contents: Character-caching routines
-** *
-** * Created By: Jay Hobson (Sun MicroSystems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "fntfil.h"
-#include "fntfilst.h"
-
-#define GET 0
-#define RESET 1
-
-struct bm_cache_list {
- struct bm_cache_list *next;
- struct bm_cache_list *prev;
- int height;
- long id;
- char *pBuffer;
-};
-
-struct bm_cache_head {
- struct bm_cache_list *head;
- int width;
- struct bm_cache_head *next;
- struct bm_cache_head *prev;
-};
-
-static struct bm_cache_head *bm_cache = NULL;
-
-static long
-PsBmUniqueId(int func)
-{
- static long unique_id = 0;
-
- if(func == RESET)
- {
- unique_id = 0;
- return 0;
- }
- else
- return ++unique_id;
-}
-
-int
-PsBmIsImageCached(
- int gWidth,
- int gHeight,
- char *pBuffer)
-{
- int return_val = 0;
- struct bm_cache_head *pList = bm_cache;
-
- while(pList != NULL && !return_val)
- {
- if(pList->width == gWidth)
- {
- struct bm_cache_list *pItem = pList->head;
-
- while(pItem != NULL)
- {
- if(pItem->height == gHeight)
- {
- int length = 4*(gWidth/32+(gWidth%32!=0))*gHeight;
-
- if(!memcmp(pItem->pBuffer, pBuffer, sizeof(char)*length))
- {
- return_val = pItem->id;
- break;
- }
- }
- else if(pItem->height > gHeight)
- break;
-
- pItem = pItem->next;
- }
- }
- else if(pList->width > gWidth)
- break;
-
- pList = pList->next;
- }
- return return_val;
-}
-
-int
-PsBmPutImageInCache(
- int gWidth,
- int gHeight,
- char *pBuffer)
-{
- int return_val = 0;
- struct bm_cache_head *pList = bm_cache;
- struct bm_cache_list *pNew;
- int length = 4*(gWidth/32+(gWidth%32!=0))*gHeight;
-
- if(gWidth == 1 && gHeight == 1 && pBuffer[0] == 0)
- return return_val;
-
- pNew = (struct bm_cache_list *)malloc(sizeof(struct bm_cache_list));
- pNew->next = NULL;
- pNew->prev = NULL;
- pNew->height = gHeight;
- pNew->id = PsBmUniqueId(GET);
- pNew->pBuffer = (char *)malloc(sizeof(char)*length);
-
- memcpy(pNew->pBuffer, pBuffer, length);
-
- while(pList != NULL)
- {
- if(pList->width == gWidth)
- {
- struct bm_cache_list *pItem = pList->head;
-
- while(pItem != NULL)
- {
- if(pItem->height >= gHeight)
- {
- pNew->next = pItem;
- pNew->prev = pItem->prev;
- if(pItem->prev != NULL)
- pItem->prev->next = pNew;
- else
- pList->head = pNew;
- pItem->prev = pNew;
-
- return_val = pNew->id;
-
- break;
- }
- else if(pItem->next == NULL)
- {
- pNew->prev = pItem;
- pItem->next = pNew;
-
- return_val = pNew->id;
-
- break;
- }
-
- pItem = pItem->next;
- }
-
- break;
- }
-
- pList = pList->next;
- }
-
- if(pList == NULL)
- {
- struct bm_cache_head *pNewList;
-
- pNewList = (struct bm_cache_head *)malloc(sizeof(struct bm_cache_head));
-
- pNewList->next = NULL;
- pNewList->prev = NULL;
- pNewList->width = gWidth;
- pNewList->head = pNew;
-
- if(bm_cache == NULL)
- {
- bm_cache = pNewList;
- return_val = pNew->id;
- }
- else
- {
- pList = bm_cache;
-
- while(pList != NULL)
- {
- if(pList->width > gWidth)
- {
- pNewList->next = pList;
- pNewList->prev = pList->prev;
-
- if(pList->prev != NULL)
- pList->prev->next = pNewList;
- else
- bm_cache = pNewList;
- pList->prev = pNewList;
-
- return_val = pNew->id;
-
- break;
- }
- else if(pList->next == NULL)
- {
- pNewList->prev = pList;
- pList->next = pNewList;
-
- return_val = pNew->id;
-
- break;
- }
-
- pList = pList->next;
- }
- }
- }
-
- return return_val;
-}
-
-
-static void
-PsBmClearImageCacheItem(
- struct bm_cache_list *pItem)
-{
- if(pItem != NULL)
- {
- if(pItem->pBuffer != NULL)
- free(pItem->pBuffer);
- pItem->pBuffer = NULL;
-
- if(pItem->next)
- PsBmClearImageCacheItem(pItem->next);
- pItem->next = NULL;
-
- free(pItem);
- pItem = NULL;
- }
-}
-
-static void
-PsBmClearImageCacheList(
- struct bm_cache_head *pList)
-{
- if(pList != NULL)
- {
- if(pList->head)
- PsBmClearImageCacheItem(pList->head);
- pList->head = NULL;
-
- if(pList->next)
- PsBmClearImageCacheList(pList->next);
- pList->next = NULL;
-
- free(pList);
- pList = NULL;
- }
-}
-
-void
-PsBmClearImageCache()
-{
- PsBmClearImageCacheList(bm_cache);
-
- bm_cache = NULL;
-
- PsBmUniqueId(RESET);
-}
-
diff --git a/Xprint/ps/PsColor.c b/Xprint/ps/PsColor.c
deleted file mode 100644
index 92082226f..000000000
--- a/Xprint/ps/PsColor.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* $Xorg: PsColor.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsColor.c
-** *
-** * Contents: Color routines for the PS driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsColor.c,v 1.3 2001/12/14 19:59:15 dawes Exp $ */
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "colormapst.h"
-
-Bool
-PsCreateColormap(ColormapPtr pColor)
-{
- int i;
- unsigned short rgb;
- VisualPtr pVisual = pColor->pVisual;
-
- if( pVisual->class==TrueColor )
- {
- for( i=0 ; i<pVisual->ColormapEntries ; i++ )
- {
- rgb = (i<<8)|i;
-
- pColor->red[i].fShared = FALSE;
- pColor->red[i].co.local.red = rgb;
- pColor->red[i].co.local.green = 0;
- pColor->red[i].co.local.blue = 0;
-
- pColor->green[i].fShared = FALSE;
- pColor->green[i].co.local.red = 0;
- pColor->green[i].co.local.green = rgb;
- pColor->green[i].co.local.blue = 0;
-
- pColor->blue[i].fShared = FALSE;
- pColor->blue[i].co.local.red = 0;
- pColor->blue[i].co.local.green = 0;
- pColor->blue[i].co.local.blue = rgb;
- }
- }
- return TRUE;
-}
-
-void
-PsDestroyColormap(ColormapPtr pColor)
-{
-}
-
-void
-PsInstallColormap(ColormapPtr pColor)
-{
- PsScreenPrivPtr pPriv =
- (PsScreenPrivPtr)pColor->pScreen->devPrivates[PsScreenPrivateIndex].ptr;
- pPriv->CMap = pColor;
-}
-
-void
-PsUninstallColormap(ColormapPtr pColor)
-{
-}
-
-int
-PsListInstalledColormaps(
- ScreenPtr pScreen,
- XID *pCmapList)
-{
- return 0;
-}
-
-void
-PsStoreColors(
- ColormapPtr pColor,
- int ndef,
- xColorItem *pdefs)
-{
- int i;
- for( i=0 ; i<ndef ; i++ )
- {
- if( pdefs[i].flags&DoRed )
- pColor->red[pdefs[i].pixel].co.local.red = pdefs[i].red;
- if( pdefs[i].flags&DoGreen )
- pColor->red[pdefs[i].pixel].co.local.green = pdefs[i].green;
- if( pdefs[i].flags&DoBlue )
- pColor->red[pdefs[i].pixel].co.local.blue = pdefs[i].blue;
- }
-}
-
-void
-PsResolveColor(
- unsigned short *pRed,
- unsigned short *pGreen,
- unsigned short *pBlue,
- VisualPtr pVisual)
-{
-}
-
-int
-PsGetPixelColor(ColormapPtr cMap, int pixval)
-{
- int r, g, b;
- if( cMap->pVisual->class==TrueColor ) return(pixval);
- if( pixval<0 || pixval>255 ) return(0);
- r = cMap->red[pixval].co.local.red>>8;
- g = cMap->red[pixval].co.local.green>>8;
- b = cMap->red[pixval].co.local.blue>>8;
- return((r<<16)|(g<<8)|b);
-}
-
-void
-PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
- ColormapPtr cMap)
-{
- switch(pGC->fillStyle)
- {
- case FillSolid:
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- break;
- case FillTiled:
- if( !PsOut_BeginPattern(psOut, pGC->tile.pixmap,
- pGC->tile.pixmap->drawable.width,
- pGC->tile.pixmap->drawable.height, PsTile, 0, 0) )
- {
- PsReplayPixmap(pGC->tile.pixmap, pDrawable);
- PsOut_EndPattern(psOut);
- }
- PsOut_SetPattern(psOut, pGC->tile.pixmap, PsTile);
- break;
- case FillStippled:
- if( !PsOut_BeginPattern(psOut, pGC->stipple,
- pGC->stipple->drawable.width,
- pGC->stipple->drawable.height, PsStip, 0,
- PsGetPixelColor(cMap, pGC->fgPixel)) )
- {
- PsReplayPixmap(pGC->stipple, pDrawable);
- PsOut_EndPattern(psOut);
- }
- PsOut_SetPattern(psOut, pGC->stipple, PsStip);
- break;
- case FillOpaqueStippled:
- if( !PsOut_BeginPattern(psOut, pGC->stipple,
- pGC->stipple->drawable.width,
- pGC->stipple->drawable.height, PsOpStip,
- PsGetPixelColor(cMap, pGC->bgPixel),
- PsGetPixelColor(cMap, pGC->fgPixel)) )
- {
- PsReplayPixmap(pGC->stipple, pDrawable);
- PsOut_EndPattern(psOut);
- }
- PsOut_SetPattern(psOut, pGC->stipple, PsOpStip);
- break;
- }
-}
diff --git a/Xprint/ps/PsDef.h b/Xprint/ps/PsDef.h
deleted file mode 100644
index ec648c442..000000000
--- a/Xprint/ps/PsDef.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $Xorg: PsDef.h,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsDef.h
-** *
-** * Contents: extran defines and includes for the Ps driver
-** * for a printing X server.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-#ifndef _PSDEF_H_
-#define _PSDEF_H_
-
-#define DT_PRINT_JOB_HEADER "DT_PRINT_JOB_HEADER"
-#define DT_PRINT_JOB_TRAILER "DT_PRINT_JOB_TRAILER"
-#define DT_PRINT_JOB_COMMAND "DT_PRINT_JOB_COMMAND"
-#define DT_PRINT_JOB_EXEC_COMMAND "DT_PRINT_JOB_EXEC_COMMAND"
-#define DT_PRINT_JOB_EXEC_OPTIONS "DT_PRINT_JOB_EXEC_OPTION"
-#define DT_PRINT_PAGE_HEADER "DT_PRINT_PAGE_HEADER"
-#define DT_PRINT_PAGE_TRAILER "DT_PRINT_PAGE_TRAILER"
-#define DT_PRINT_PAGE_COMMAND "DT_PRINT_PAGE_COMMAND"
-
-#define DT_IN_FILE_STRING "%(InFile)%"
-#define DT_OUT_FILE_STRING "%(OutFile)%"
-#define DT_ALLOWED_COMMANDS_FILE "printCommands"
-
-#endif /* _PSDEF_H_ */
diff --git a/Xprint/ps/PsFonts.c b/Xprint/ps/PsFonts.c
deleted file mode 100644
index 9792dae4d..000000000
--- a/Xprint/ps/PsFonts.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* $Xorg: PsFonts.c,v 1.6 2001/03/06 16:30:15 pookie Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsFonts.c,v 1.7 2003/07/16 01:38:34 dawes Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsFonts.c
-** *
-** * Contents: Font code for PS driver.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "regionstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-#include "fontxlfd.h"
-
-#include "Ps.h"
-
-Bool
-PsRealizeFont(
- ScreenPtr pscr,
- FontPtr pFont)
-{
- return TRUE;
-}
-
-Bool
-PsUnrealizeFont(
- ScreenPtr pscr,
- FontPtr pFont)
-{
- return TRUE;
-}
-
-char *
-PsGetFontName(FontPtr pFont)
-{
- int i;
- int nprops = pFont->info.nprops;
- FontPropPtr props = pFont->info.props;
- Atom name = MakeAtom("FONT", 4, True);
- Atom value = (Atom)0;
-
- for( i=0 ; i<nprops ; i++ )
- {
- if( (Atom)props[i].name == name )
- { value = props[i].value; break; }
- }
- if( !value ) return (char *)0;
- return NameForAtom(value);
-}
-
-int
-PsGetFontSize(FontPtr pFont, float *mtx)
-{
- FontScalableRec vals;
- char *name = PsGetFontName(pFont);
- int value = 0;
-
- FontParseXLFDName(name, &vals, FONT_XLFD_REPLACE_NONE);
- if( vals.values_supplied&PIXELSIZE_ARRAY )
- {
- int i;
- for( i=0 ; i<4 ; i++ )
- mtx[i] = (float)vals.pixel_matrix[i];
- }
- else
- {
- value = vals.pixel;
- if( !value ) value = 20;
- }
- return value;
-}
-
-char *
-PsGetPSFontName(FontPtr pFont)
-{
- int i;
- int nprops = pFont->info.nprops;
- FontPropPtr props = pFont->info.props;
- Atom name = MakeAtom("PRINTER_RESIDENT_FONT", 21, True);
- Atom value = (Atom)0;
-
- for( i=0 ; i<nprops ; i++ )
- {
- if( (Atom)props[i].name == name )
- { value = props[i].value; break; }
- }
- if( !value ) return (char *)0;
- return NameForAtom(value);
-}
-
-int
-PsIsISOLatin1Encoding(FontPtr pFont)
-{
- int i;
- int nprops = pFont->info.nprops;
- FontPropPtr props = pFont->info.props;
- Atom reg = MakeAtom("CHARSET_REGISTRY", 16, True);
- Atom enc = MakeAtom("CHARSET_ENCODING", 16, True);
- Atom rv = 0, ev = 0;
- char *rp = 0;
- char *ep = 0;
-
- for( i=0 ; i<nprops ; i++ )
- {
- if( (Atom)props[i].name == reg ) rv = props[i].value;
- if( (Atom)props[i].name == enc ) ev = props[i].value;
- }
- if( rv ) rp = NameForAtom(rv);
- if( ev ) ep = NameForAtom(ev);
- if( (!rp) || (!ep) ) return(0);
- if( (char)tolower(rp[0])!='i' ||
- (char)tolower(rp[1])!='s' ||
- (char)tolower(rp[2])!='o' ||
- memcmp(&rp[3], "8859", 4)!=0 ||
- ep[0]!='1' ) return(0);
- return(1);
-}
diff --git a/Xprint/ps/PsGC.c b/Xprint/ps/PsGC.c
deleted file mode 100644
index 1c2877231..000000000
--- a/Xprint/ps/PsGC.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/* $Xorg: PsGC.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsGC.c,v 1.7 2003/10/29 22:11:55 tsi Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsGC.c
-** *
-** * Contents: Graphics Context handling for the PS driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "migc.h"
-#include "scrnintstr.h"
-
-static GCOps PsGCOps =
-{
- PsFillSpans,
- PsSetSpans,
- PsPutImage,
- PsCopyArea,
- PsCopyPlane,
- PsPolyPoint,
- PsPolyLine,
- PsPolySegment,
- PsPolyRectangle,
- PsPolyArc,
- PsFillPolygon,
- PsPolyFillRect,
- PsPolyFillArc,
- PsPolyText8,
- PsPolyText16,
- PsImageText8,
- PsImageText16,
- PsImageGlyphBlt,
- PsPolyGlyphBlt,
- PsPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-
-static GCFuncs PsGCFuncs =
-{
- PsValidateGC,
- PsChangeGC,
- PsCopyGC,
- PsDestroyGC,
- PsChangeClip,
- PsDestroyClip,
- PsCopyClip
-};
-
-Bool
-PsCreateGC(pGC)
- GCPtr pGC;
-{
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- pGC->ops = &PsGCOps;
- pGC->funcs = &PsGCFuncs;
-
- pGC->clientClip = (pointer)xalloc(sizeof(PsClipRec));
- memset(pGC->clientClip, 0, sizeof(PsClipRec));
- return TRUE;
-}
-
-static int
-PsGetDrawablePrivateStuff(
- DrawablePtr pDrawable,
- GC *gc,
- unsigned long *valid,
- PsOutPtr *psOut,
- ColormapPtr *cMap)
-{
- XpContextPtr pCon;
- PsContextPrivPtr cPriv;
- PsScreenPrivPtr sPriv;
-
- switch(pDrawable->type)
- {
- case DRAWABLE_PIXMAP:
- return FALSE;
- case DRAWABLE_WINDOW:
- pCon = PsGetContextFromWindow((WindowPtr)pDrawable);
- if( pCon==NULL ) return FALSE;
- else
- {
- cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr;
- sPriv = (PsScreenPrivPtr)
- pDrawable->pScreen->devPrivates[PsScreenPrivateIndex].ptr;
- *gc = cPriv->lastGC;
- *valid = cPriv->validGC;
- *psOut = cPriv->pPsOut;
- *cMap = sPriv->CMap;
- return TRUE;
- }
- default:
- return FALSE;
- }
-}
-
-int
-PsUpdateDrawableGC(
- GCPtr pGC,
- DrawablePtr pDrawable,
- PsOutPtr *psOut,
- ColormapPtr *cMap)
-{
- GC dGC;
- unsigned long valid;
- int i;
- BoxPtr boxes;
-
- if (!PsGetDrawablePrivateStuff(pDrawable, &dGC, &valid, psOut, cMap))
- return FALSE;
-
- switch (pDrawable->type) {
-
- case DRAWABLE_PIXMAP:
- /* we don't support pixmaps yet! */
- return FALSE;
- break;
- case DRAWABLE_WINDOW:
- if( pGC )
- {
- RegionPtr pReg;
- WindowPtr pWin = (WindowPtr)pDrawable;
- Bool freeClip;
- PsClipPtr clp = (PsClipPtr)pGC->clientClip;
- if( clp->outterClips )
- { xfree(clp->outterClips); clp->outterClips = 0; }
- clp->nOutterClips = 0;
- if( pGC->subWindowMode==IncludeInferiors )
- {
- pReg = NotClippedByChildren(pWin);
- freeClip = TRUE;
- }
- else
- {
- pReg = &pWin->clipList;
- freeClip = FALSE;
- }
-
- if( pReg->data )
- {
- boxes = (BoxPtr)((char *)pReg->data+sizeof(long)*2);
- clp->nOutterClips = pReg->data->numRects;
- clp->outterClips =
- (PsRectPtr)xalloc(clp->nOutterClips*sizeof(PsRectRec));
- for( i=0 ; i<clp->nOutterClips ; i++ )
- {
- clp->outterClips[i].x = boxes[i].x1;
- clp->outterClips[i].y = boxes[i].y1;
- clp->outterClips[i].w = (boxes[i].x2-boxes[i].x1)+1;
- clp->outterClips[i].h = (boxes[i].y2-boxes[i].y1)+1;
- }
- }
-
- if( freeClip ) REGION_DESTROY(pGC->pScreen, pReg);
- PsOut_Offset(*psOut, pDrawable->x, pDrawable->y);
- PsOut_Clip(*psOut, pGC->clientClipType, (PsClipPtr)pGC->clientClip);
- }
- break;
- }
- return TRUE;
-}
-
-void
-PsValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
- pGC->ops = &PsGCOps;
-}
-
-void
-PsChangeGC(GCPtr pGC, unsigned long changes)
-{
-}
-
-void
-PsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
-}
-
-void
-PsDestroyGC(GCPtr pGC)
-{
- PsDestroyClip(pGC);
- xfree(pGC->clientClip);
-}
-
-void
-PsChangeClip(GCPtr pGC, int type, pointer pValue, int nrects)
-{
- int i;
- PsClipPtr clp = (PsClipPtr)pGC->clientClip;
- RegionPtr rgn;
- BoxPtr boxes;
- xRectangle *rects;
-
- PsDestroyClip(pGC);
- pGC->clientClipType = type;
- switch(type)
- {
- case CT_NONE: break;
- case CT_PIXMAP:
- clp->elms = PsCreateFillElementList((PixmapPtr)pValue, &clp->nElms);
- (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue);
- break;
- case CT_REGION:
- rgn = (RegionPtr)pValue;
- boxes = (BoxPtr)((char *)rgn->data+sizeof(long)*2);
- clp->nRects = rgn->data->numRects;
- clp->rects = (PsRectPtr)xalloc(clp->nRects*sizeof(PsRectRec));
- for( i=0 ; i<clp->nRects ; i++ )
- {
- clp->rects[i].x = boxes[i].x1;
- clp->rects[i].y = boxes[i].y1;
- clp->rects[i].w = (boxes[i].x2-boxes[i].x1)+1;
- clp->rects[i].h = (boxes[i].y2-boxes[i].y1)+1;
- }
- REGION_DESTROY(pGC->pScreen, (RegionPtr)pValue);
- break;
- case CT_UNSORTED:
- case CT_YSORTED:
- case CT_YXSORTED:
- case CT_YXBANDED:
- rects = (xRectangle *)pValue;
- clp->nRects = nrects;
- clp->rects = (PsRectPtr)xalloc(clp->nRects*sizeof(PsRectRec));
- for( i=0 ; i<clp->nRects ; i++ )
- {
- clp->rects[i].x = rects[i].x;
- clp->rects[i].y = rects[i].y;
- clp->rects[i].w = rects[i].width;
- clp->rects[i].h = rects[i].height;
- }
- xfree(pValue);
- break;
- }
-}
-
-void
-PsDestroyClip(GCPtr pGC)
-{
- PsClipPtr clp = (PsClipPtr)pGC->clientClip;
-
- if( clp->rects ) xfree(clp->rects);
- if( clp->outterClips ) xfree(clp->outterClips);
- clp->rects = (PsRectPtr)0;
- clp->outterClips = (PsRectPtr)0;
- clp->nRects = 0;
- clp->nOutterClips = 0;
- if( clp->elms ) PsDestroyFillElementList(clp->nElms, clp->elms);
- clp->elms = (PsElmPtr)0;
- clp->nElms = 0;
- pGC->clientClipType = CT_NONE;
-}
-
-void
-PsCopyClip(GCPtr pDst, GCPtr pSrc)
-{
- PsClipPtr src = (PsClipPtr)pSrc->clientClip;
- PsClipPtr dst = (PsClipPtr)pDst->clientClip;
-
- PsDestroyClip(pDst);
- pDst->clientClipType = pSrc->clientClipType;
- *dst = *src;
- if( src->rects )
- {
- dst->rects = (PsRectPtr)xalloc(src->nRects*sizeof(PsRectRec));
- memcpy(dst->rects, src->rects, src->nRects*sizeof(PsRectRec));
- }
- if( src->elms )
- dst->elms = PsCloneFillElementList(src->nElms, src->elms);
-}
-
-
-GCPtr
-PsCreateAndCopyGC(DrawablePtr pDrawable, GCPtr pSrc)
-{
- GCPtr pDst;
-
- if ((pDst =
- CreateScratchGC(pDrawable->pScreen, pDrawable->depth)) == NULL)
- {
- return NULL;
- }
-
- if (CopyGC(pSrc, pDst,
- GCFunction | GCPlaneMask | GCForeground | GCBackground |
- GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle |
- GCFillStyle | GCFillRule | GCTile | GCStipple |
- GCTileStipXOrigin | GCTileStipYOrigin | GCFont |
- GCSubwindowMode | GCGraphicsExposures | GCClipXOrigin |
- GCClipYOrigin | GCClipMask | GCDashOffset | GCDashList |
- GCArcMode) != Success)
- {
- (void)FreeGC(pDst, (GContext)0);
-
- return NULL;
- }
-
- return pDst;
-}
-
diff --git a/Xprint/ps/PsInit.c b/Xprint/ps/PsInit.c
deleted file mode 100644
index 193fc0518..000000000
--- a/Xprint/ps/PsInit.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/* $Xorg: PsInit.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsInit.c
-** *
-** * Contents: Initialization code of Ps driver for the print server.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsInit.c,v 1.14 2003/10/29 22:11:55 tsi Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-
-#include "Ps.h"
-#include "mi.h"
-#include "AttrValid.h"
-#include "../../mfb/mfb.h"
-
-#include "windowstr.h"
-#include "DiPrint.h"
-
-static void AllocatePsPrivates(ScreenPtr pScreen);
-static int PsInitContext(XpContextPtr pCon);
-static int PsDestroyContext(XpContextPtr pCon);
-
-extern Bool cfbCreateDefColormap(ScreenPtr pScreen);
-
-int PsScreenPrivateIndex;
-int PsContextPrivateIndex;
-int PsPixmapPrivateIndex;
-int PsWindowPrivateIndex;
-
-Bool
-InitializePsDriver(ndx, pScreen, argc, argv)
- int ndx;
- ScreenPtr pScreen;
- int argc;
- char **argv;
-{
-#if 0
- PsScreenPrivPtr pPriv;
-#endif
- int nVisuals;
- int nDepths;
- VisualPtr visuals;
- DepthPtr depths;
-
-/*
- * Register this driver's InitContext function with the print
- * extension.
- */
- XpRegisterInitFunc(pScreen, "XP-POSTSCRIPT", PsInitContext);
-
-/*
- * Create and fill in the devPrivate for the PS driver.
- */
- AllocatePsPrivates(pScreen);
-
-#if 0
- pPriv = (PsScreenPrivPtr)pScreen->devPrivates[PsScreenPrivateIndex].ptr;
- pPriv->resDB = rmdb;
-#endif
-
- pScreen->defColormap = (Colormap) FakeClientID(0);
- pScreen->blackPixel = 1;
- pScreen->whitePixel = 0;
- pScreen->QueryBestSize = (QueryBestSizeProcPtr)PsQueryBestSize;
- pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop;
- pScreen->GetImage = (GetImageProcPtr)_XpVoidNoop;
- pScreen->GetSpans = (GetSpansProcPtr)_XpVoidNoop;
- pScreen->CreateWindow = PsCreateWindow;
- pScreen->DestroyWindow = PsDestroyWindow;
- pScreen->PositionWindow = PsPositionWindow;
- pScreen->ChangeWindowAttributes = PsChangeWindowAttributes;
- pScreen->RealizeWindow = PsMapWindow;
- pScreen->UnrealizeWindow = PsUnmapWindow;
- pScreen->PaintWindowBackground = PsPaintWindow;
- pScreen->PaintWindowBorder = PsPaintWindow;
- pScreen->CloseScreen = PsCloseScreen;
- pScreen->CopyWindow = PsCopyWindow;
- /* XXX Hard routine to write! */
-
-/*
- * These two are going to be VERY different...
- */
- pScreen->CreatePixmap = PsCreatePixmap;
- pScreen->DestroyPixmap = PsDestroyPixmap;
- pScreen->RealizeFont = PsRealizeFont;
- pScreen->UnrealizeFont = PsUnrealizeFont;
- pScreen->CreateGC = PsCreateGC;
- pScreen->CreateColormap = PsCreateColormap;
- pScreen->DestroyColormap = PsDestroyColormap;
- pScreen->InstallColormap = PsInstallColormap;
- pScreen->UninstallColormap = PsUninstallColormap;
- pScreen->ListInstalledColormaps = PsListInstalledColormaps;
- pScreen->StoreColors = PsStoreColors;
- pScreen->ResolveColor = PsResolveColor;
- /* Will BitmapToRegion make any difference at all? */
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- nVisuals = 2;
- nDepths = 2;
- visuals = (VisualPtr)xalloc(nVisuals*sizeof(VisualRec));
- depths = (DepthPtr) xalloc(nDepths*sizeof(DepthRec));
-
- visuals[0].vid = FakeClientID(0);
- visuals[0].class = TrueColor;
- visuals[0].bitsPerRGBValue = 8;
- visuals[0].ColormapEntries = 256;
- visuals[0].nplanes = 24;
- visuals[0].redMask = 0x00FF0000;
- visuals[0].greenMask = 0x0000FF00;
- visuals[0].blueMask = 0x000000FF;
- visuals[0].offsetRed = 16;
- visuals[0].offsetGreen = 8;
- visuals[0].offsetBlue = 0;
-
- visuals[1].vid = FakeClientID(0);
- visuals[1].class = PseudoColor;
- visuals[1].bitsPerRGBValue = 0;
- visuals[1].ColormapEntries = 256;
- visuals[1].nplanes = 8;
- visuals[1].redMask = 0x0;
- visuals[1].greenMask = 0x0;
- visuals[1].blueMask = 0x0;
- visuals[1].offsetRed = 0x0;
- visuals[1].offsetGreen = 0x0;
- visuals[1].offsetBlue = 0x0;
-
- depths[0].depth = 24;
- depths[0].numVids = 1;
- depths[0].vids = &visuals[0].vid;
-
- depths[1].depth = 8;
- depths[1].numVids = 1;
- depths[1].vids = &visuals[1].vid;
-
-/* THE FOLLOWING CAUSES SERVER DEFAULT VISUAL TO BE 24 BIT */
-/* miScreenInit(pScreen, (pointer)0,
- pScreen->width, pScreen->height,
- pScreen->width / (pScreen->mmWidth / 25.40),
- pScreen->height / (pScreen->mmHeight / 25.40),
- 0, 24, nDepths,
- depths, visuals[1].vid, nVisuals, visuals); */
-
-/* THE FOLLOWING CAUSES SERVER DEFAULT VISUAL TO BE 8 BIT */
- miScreenInit(pScreen, (pointer)0,
- pScreen->width, pScreen->height,
- (int) (pScreen->width / (pScreen->mmWidth / 25.40)),
- (int) (pScreen->height / (pScreen->mmHeight / 25.40)),
- 0, 8, nDepths,
- depths, visuals[1].vid, nVisuals, visuals);
-
- if( cfbCreateDefColormap(pScreen)==FALSE ) return FALSE;
-
-/*scalingScreenInit(pScreen);*/
-
- return TRUE;
-}
-
-static void
-AllocatePsPrivates(ScreenPtr pScreen)
-{
- static unsigned long PsGeneration = 0;
-
- if((unsigned long)PsGeneration != serverGeneration)
- {
- PsScreenPrivateIndex = AllocateScreenPrivateIndex();
-
- PsWindowPrivateIndex = AllocateWindowPrivateIndex();
- AllocateWindowPrivate(pScreen, PsWindowPrivateIndex,
- sizeof(PsWindowPrivRec));
-
- PsContextPrivateIndex = XpAllocateContextPrivateIndex();
- XpAllocateContextPrivate(PsContextPrivateIndex,
- sizeof(PsContextPrivRec));
-
- PsPixmapPrivateIndex = AllocatePixmapPrivateIndex();
- AllocatePixmapPrivate(pScreen, PsPixmapPrivateIndex,
- sizeof(PsPixmapPrivRec));
-
- PsGeneration = serverGeneration;
- }
- pScreen->devPrivates[PsScreenPrivateIndex].ptr =
- (pointer)xalloc(sizeof(PsScreenPrivRec));
-}
-
-/*
- * PsInitContext
- *
- * Establish the appropriate values for a PrintContext used with the PS
- * driver.
- */
-
-static char DOC_ATT_SUPP[]="document-attributes-supported";
-static char DOC_ATT_VAL[]="document-format";
-static char JOB_ATT_SUPP[]="job-attributes-supported";
-static char JOB_ATT_VAL[]="";
-static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
-static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \
-default-input-tray default-medium plex";
-
-static int
-PsInitContext(pCon)
- XpContextPtr pCon;
-{
- XpDriverFuncsPtr pFuncs;
- PsContextPrivPtr pConPriv;
- char *server, *attrStr;
-
- /*
- * Initialize the attribute store for this printer.
- */
- XpInitAttributes(pCon);
-
- /*
- * Initialize the function pointers
- */
- pFuncs = &(pCon->funcs);
- pFuncs->StartJob = PsStartJob;
- pFuncs->EndJob = PsEndJob;
- pFuncs->StartDoc = PsStartDoc;
- pFuncs->EndDoc = PsEndDoc;
- pFuncs->StartPage = PsStartPage;
- pFuncs->EndPage = PsEndPage;
- pFuncs->PutDocumentData = PsDocumentData;
- pFuncs->GetDocumentData = PsGetDocumentData;
- pFuncs->GetAttributes = PsGetAttributes;
- pFuncs->SetAttributes = PsSetAttributes;
- pFuncs->AugmentAttributes = PsAugmentAttributes;
- pFuncs->GetOneAttribute = PsGetOneAttribute;
- pFuncs->DestroyContext = PsDestroyContext;
- pFuncs->GetMediumDimensions = PsGetMediumDimensions;
- pFuncs->GetReproducibleArea = PsGetReproducibleArea;
- pFuncs->SetImageResolution = PsSetImageResolution;
-
- /*
- * Set up the context privates
- */
- pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- pConPriv->jobFileName = (char *)NULL;
- pConPriv->pJobFile = (FILE *)NULL;
-
- pConPriv->getDocClient = (ClientPtr)NULL;
- pConPriv->getDocBufSize = 0;
-
- /*
- * document-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP );
- if ((attrStr = (char *) xalloc(strlen(server) +
- strlen(DOC_ATT_SUPP) + strlen(DOC_ATT_VAL)
- + strlen(PAGE_ATT_VAL) + 6)) == NULL)
- {
- return BadAlloc;
- }
- sprintf(attrStr, "*%s:\t%s %s %s",
- DOC_ATT_SUPP, server, DOC_ATT_VAL, PAGE_ATT_VAL);
- XpAugmentAttributes( pCon, XPPrinterAttr, attrStr);
- xfree(attrStr);
-
- /*
- * job-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP );
- if ((attrStr = (char *) xalloc(strlen(server) + strlen(JOB_ATT_SUPP) +
- strlen(JOB_ATT_VAL) + 4)) == NULL)
- {
- return BadAlloc;
- }
- sprintf(attrStr, "*%s:\t%s %s", JOB_ATT_SUPP, server, JOB_ATT_VAL);
- XpAugmentAttributes(pCon, XPPrinterAttr, attrStr);
- xfree(attrStr);
-
- /*
- * xp-page-attributes-supported
- */
- server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP );
- if ((attrStr = (char *) xalloc(strlen(server) + strlen(PAGE_ATT_SUPP) +
- strlen(PAGE_ATT_VAL) + 4)) == NULL)
- {
- return BadAlloc;
- }
- sprintf(attrStr, "*%s:\t%s %s", PAGE_ATT_SUPP, server, PAGE_ATT_VAL);
- XpAugmentAttributes(pCon, XPPrinterAttr, attrStr);
- xfree(attrStr);
-
- /*
- * Validate the attribute pools
- */
- XpValidateAttributePool(pCon, XPPrinterAttr, &PsValidatePoolsRec);
- XpValidateAttributePool(pCon, XPDocAttr, &PsValidatePoolsRec);
- XpValidateAttributePool(pCon, XPJobAttr, &PsValidatePoolsRec);
- XpValidateAttributePool(pCon, XPPageAttr, &PsValidatePoolsRec);
-
- return Success;
-}
-
-static Bool
-PsDestroyContext(pCon)
- XpContextPtr pCon;
-{
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- if( pConPriv->pJobFile!=(FILE *)NULL )
- {
- fclose(pConPriv->pJobFile);
- pConPriv->pJobFile = NULL;
- }
- if( pConPriv->jobFileName!=(char *)NULL )
- {
- unlink(pConPriv->jobFileName);
- xfree(pConPriv->jobFileName);
- pConPriv->jobFileName = (char *)NULL;
- }
-
-/*### free up visuals/depths ###*/
-
- return Success;
-}
-
-XpContextPtr
-PsGetContextFromWindow(win)
- WindowPtr win;
-{
- PsWindowPrivPtr pPriv;
-
- while( win )
- {
- pPriv = (PsWindowPrivPtr)win->devPrivates[PsWindowPrivateIndex].ptr;
- if( pPriv->validContext ) return pPriv->context;
- win = win->parent;
- }
-
- return NULL;
-}
diff --git a/Xprint/ps/PsLine.c b/Xprint/ps/PsLine.c
deleted file mode 100644
index ff4c6da80..000000000
--- a/Xprint/ps/PsLine.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* $Xorg: PsLine.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsLine.c
-** *
-** * Contents: Line drawing routines for the PS driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsLine.c,v 1.6 2001/12/14 19:59:16 dawes Exp $ */
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PsPolyLine(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nPoints,
- xPoint *pPoints)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyLineCmd;
- elm->gc = gc;
- elm->c.polyPts.mode = mode;
- elm->c.polyPts.nPoints = nPoints;
- elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint));
- memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- PsPointPtr pts;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- PsLineAttrs(psOut, pGC, cMap);
- pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints);
- if( mode==CoordModeOrigin )
- {
- for( i=0 ; i<nPoints ; i++ )
- { pts[i].x = pPoints[i].x; pts[i].y = pPoints[i].y; }
- }
- else
- {
- pts[0].x = pPoints[0].x; pts[0].y = pPoints[0].y;
- for( i=1 ; i<nPoints ; i++ )
- {
- pts[i].x = pts[i-1].x+pPoints[i].x;
- pts[i].y = pts[i-1].y+pPoints[i].y;
- }
- }
- PsOut_Lines(psOut, nPoints, pts);
- xfree(pts);
- }
-}
-
-void
-PsPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSegments,
- xSegment *pSegments)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolySegmentCmd;
- elm->gc = gc;
- elm->c.segments.nSegments = nSegments;
- elm->c.segments.pSegments = (xSegment *)xalloc(nSegments*sizeof(xSegment));
- memcpy(elm->c.segments.pSegments, pSegments, nSegments*sizeof(xSegment));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- PsPointRec pts[2];
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- PsLineAttrs(psOut, pGC, cMap);
- for( i=0 ; i<nSegments ; i++ )
- {
- pts[0].x = pSegments[i].x1;
- pts[0].y = pSegments[i].y1;
- pts[1].x = pSegments[i].x2;
- pts[1].y = pSegments[i].y2;
- PsOut_Lines(psOut, 2, pts);
- }
- }
-}
diff --git a/Xprint/ps/PsMisc.c b/Xprint/ps/PsMisc.c
deleted file mode 100644
index 75f692d56..000000000
--- a/Xprint/ps/PsMisc.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* $Xorg: PsMisc.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsMisc.c
-** *
-** * Contents: Miscellaneous code for Ps driver.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsMisc.c,v 1.6 2001/12/14 19:59:16 dawes Exp $ */
-
-#include "Xos.h" /* for SIGCLD on pre-POSIX systems */
-#include <stdio.h>
-#include "Ps.h"
-
-#include "cursor.h"
-#include "resource.h"
-
-#include "windowstr.h"
-#include "propertyst.h"
-
-
-/*ARGSUSED*/
-void
-PsQueryBestSize(
- int type,
- short *pwidth,
- short *pheight,
- ScreenPtr pScreen)
-{
- unsigned width, highBit;
-
- switch(type)
- {
- case CursorShape:
- *pwidth = 0;
- *pheight = 0;
- break;
- case TileShape:
- case StippleShape:
- width = *pwidth;
- if (!width) break;
- /* Return the nearest power of two >= what they gave us */
- highBit = 0x80000000;
- /* Find the highest 1 bit in the given width */
- while(!(highBit & width))
- highBit >>= 1;
- /* If greater than that then return the next power of two */
- if((highBit - 1) & width)
- highBit <<= 1;
- *pwidth = highBit;
- /* height is a don't-care */
- break;
- }
-}
-
-/*
- * PsGetMediumDimensions is installed in the GetMediumDimensions field
- * of each Ps-initialized context.
- */
-int
-PsGetMediumDimensions(XpContextPtr pCon, CARD16 *width, CARD16 *height)
-{
- XpGetMediumDimensions(pCon, width, height);
- return Success;
-}
-
-/*
- * PsGetReproducibleArea is installed in the GetReproducibleArea field
- * of each Ps-initialized context.
- */
-int
-PsGetReproducibleArea(XpContextPtr pCon, xRectangle *pRect)
-{
- XpGetReproductionArea(pCon, pRect);
- return Success;
-}
-
-/*
- * PsSetImageResolution is installed in the SetImageResolution field
- * of each Ps-initialized context.
- */
-int
-PsSetImageResolution(XpContextPtr pCon, int imageRes, Bool *status)
-{
- pCon->imageRes = imageRes;
- *status = True;
- return Success;
-}
-
-/*
- * GetPropString searches the window heirarchy from pWin up looking for
- * a property by the name of propName. If found, returns the property's
- * value. If not, it returns NULL.
- */
-/*
-char *
-GetPropString(
- WindowPtr pWin,
- char *propName)
-{
- Atom atom;
- PropertyPtr pProp = (PropertyPtr)NULL;
- char *retVal;
-
- atom = MakeAtom(propName, strlen(propName), FALSE);
- if(atom != BAD_RESOURCE)
- {
- WindowPtr pPropWin;
- int n;
-*/
-
- /*
- * The atom has been defined, but it might only exist as a
- * property on an unrelated window.
- */
-/*
- for(pPropWin = pWin; pPropWin != (WindowPtr)NULL;
- pPropWin = pPropWin->parent)
- {
- for(pProp = (PropertyPtr)(wUserProps(pPropWin));
- pProp != (PropertyPtr)NULL;
- pProp = pProp->next)
- {
- if (pProp->propertyName == atom)
- break;
- }
- if(pProp != (PropertyPtr)NULL)
- break;
- }
- if(pProp == (PropertyPtr)NULL)
- return (char *)NULL;
-
- n = (pProp->format/8) * pProp->size; *//* size (bytes) of prop */
-/*
- retVal = (char *)xalloc(n + 1);
- (void)memcpy((void *)retVal, (void *)pProp->data, n);
- retVal[n] = '\0';
-
- return retVal;
- }
-
- return (char *)NULL;
-}
-
-#include <signal.h>
-
-*/
-/* ARGSUSED */
-/*
-static void SigchldHndlr (int dummy)
-{
- int status, w;
- struct sigaction act;
- sigfillset(&act.sa_mask);
- act.sa_flags = 0;
- act.sa_handler = SigchldHndlr;
-
- w = wait (&status);
-
-*/
- /*
- * Is this really necessary?
- */
-/*
- sigaction(SIGCHLD, &act, (struct sigaction *)NULL);
-}
-*/
-
-/*
- * SystemCmd provides a wrapper for the 'system' library call. The call
- * appears to be sensitive to the handling of SIGCHLD, so this wrapper
- * sets the status to SIG_DFL, and then resets the established handler
- * after system returns.
- */
-/*
-int
-SystemCmd(char *cmdStr)
-{
- int status;
- struct sigaction newAct, oldAct;
- sigfillset(&newAct.sa_mask);
- newAct.sa_flags = 0;
- newAct.sa_handler = SIG_DFL;
- sigfillset(&oldAct.sa_mask);
- oldAct.sa_flags = 0;
- oldAct.sa_handler = SigchldHndlr;
-
-*/
- /*
- * get the old handler, and set the action to IGN
- */
-/*
- sigaction(SIGCHLD, &newAct, &oldAct);
-
- status = system (cmdStr);
-
- sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL);
- return status;
-}
-*/
-
-Bool
-PsCloseScreen(
- int index,
- ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-void
-PsLineAttrs(
- PsOutPtr psOut,
- GCPtr pGC,
- ColormapPtr cMap)
-{
- int i;
- int nDsh;
- int dshOff;
- int *dsh;
- PsCapEnum cap;
- PsJoinEnum join;
-
- switch(pGC->capStyle) {
- case CapButt: cap = PsCButt; break;
- case CapRound: cap = PsCRound; break;
- case CapProjecting: cap = PsCSquare; break;
- default: cap = PsCButt; break; }
- switch(pGC->joinStyle) {
- case JoinMiter: join = PsJMiter; break;
- case JoinRound: join = PsJRound; break;
- case JoinBevel: join = PsJBevel; break;
- default: join = PsJBevel; break; }
- if( pGC->lineStyle==LineSolid ) { nDsh = dshOff = 0; dsh = (int *)0; }
- else
- {
- nDsh = pGC->numInDashList;
- dshOff = pGC->dashOffset;
- if( !nDsh ) dsh = (int *)0;
- else
- {
- dsh = (int *)xalloc(sizeof(int)*nDsh);
- for( i=0 ; i<nDsh ; i++ ) dsh[i] = (int)pGC->dash[i]&0xFF;
- }
- }
-
- if( pGC->lineStyle!=LineDoubleDash )
- PsOut_LineAttrs(psOut, (int)pGC->lineWidth,
- cap, join, nDsh, dsh, dshOff, -1);
- else
- PsOut_LineAttrs(psOut, (int)pGC->lineWidth,
- cap, join, nDsh, dsh, dshOff,
- PsGetPixelColor(cMap, pGC->bgPixel));
- if( nDsh && dsh ) xfree(dsh);
-}
diff --git a/Xprint/ps/PsPixel.c b/Xprint/ps/PsPixel.c
deleted file mode 100644
index 09a89fa2d..000000000
--- a/Xprint/ps/PsPixel.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Xorg: PsPixel.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsPixel.c
-** *
-** * Contents: Pixel-drawing code for the PS DDX driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1995 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsPixel.c,v 1.6 2001/12/14 19:59:16 dawes Exp $ */
-
-#include <stdio.h>
-
-#include "windowstr.h"
-#include "gcstruct.h"
-
-#include "Ps.h"
-
-void
-PsPolyPoint(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nPoints,
- xPoint *pPoints)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyPointCmd;
- elm->gc = gc;
- elm->c.polyPts.mode = mode;
- elm->c.polyPts.nPoints = nPoints;
- elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint));
- memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- PsPointPtr pts;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints);
- if( mode==CoordModeOrigin )
- {
- for( i=0 ; i<nPoints ; i++ )
- { pts[i].x = pPoints[i].x; pts[i].y = pPoints[i].y; }
- }
- else
- {
- pts[0].x = pPoints[0].x; pts[0].y = pPoints[0].y;
- for( i=1 ; i<nPoints ; i++ )
- {
- pts[i].x = pts[i-1].x+pPoints[i].x;
- pts[i].y = pts[i-1].y+pPoints[i].y;
- }
- }
- PsOut_Points(psOut, nPoints, pts);
- xfree(pts);
- }
-}
-
-void
-PsPushPixels(
- GCPtr pGC,
- PixmapPtr pBitmap,
- DrawablePtr pDrawable,
- int width,
- int height,
- int x,
- int y)
-{
-}
diff --git a/Xprint/ps/PsPixmap.c b/Xprint/ps/PsPixmap.c
deleted file mode 100644
index 2e821aa1c..000000000
--- a/Xprint/ps/PsPixmap.c
+++ /dev/null
@@ -1,597 +0,0 @@
-/* $Xorg: PsPixmap.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsPixmap.c,v 1.5 2001/12/14 19:59:16 dawes Exp $ */
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsPixmap.c
-** *
-** * Contents: Pixmap functions for the PS DDX driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1995 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include "windowstr.h"
-#include "gcstruct.h"
-
-#include "Ps.h"
-
-PixmapPtr
-PsCreatePixmap(
- ScreenPtr pScreen,
- int width,
- int height,
- int depth)
-{
- PixmapPtr pPixmap;
-
- pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec));
- if( !pPixmap) return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth);
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = 0;
- pPixmap->refcnt = 1;
-
- pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xalloc(sizeof(PsPixmapPrivRec));
- if( !pPixmap->devPrivate.ptr )
- { xfree(pPixmap); return NullPixmap; }
- memset(pPixmap->devPrivate.ptr, 0, sizeof(PsPixmapPrivRec));
- return pPixmap;
-}
-
-Bool
-PsDestroyPixmap(PixmapPtr pPixmap)
-{
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr;
- DisplayListPtr disp = priv->dispList;
-
- if( --pPixmap->refcnt ) return TRUE;
- while( disp )
- {
- int i;
- DisplayListPtr oldDisp = disp;
- disp = disp->next;
- for( i=0 ; i<oldDisp->nelms ; i++ )
- {
- DisplayElmPtr elm = &oldDisp->elms[i];
-
- switch(elm->type)
- {
- case PolyPointCmd:
- case PolyLineCmd:
- if( elm->c.polyPts.pPoints ) xfree(elm->c.polyPts.pPoints);
- break;
- case PolySegmentCmd:
- if( elm->c.segments.pSegments ) xfree(elm->c.segments.pSegments);
- break;
- case PolyRectangleCmd:
- if( elm->c.rects.pRects ) xfree(elm->c.rects.pRects);
- break;
- case FillPolygonCmd:
- if( elm->c.polyPts.pPoints ) xfree(elm->c.polyPts.pPoints);
- break;
- case PolyFillRectCmd:
- if( elm->c.rects.pRects ) xfree(elm->c.rects.pRects);
- break;
- case PolyArcCmd:
- if( elm->c.arcs.pArcs ) xfree(elm->c.arcs.pArcs);
- break;
- case PolyFillArcCmd:
- if( elm->c.arcs.pArcs ) xfree(elm->c.arcs.pArcs);
- break;
- case Text8Cmd:
- case TextI8Cmd:
- if( elm->c.text8.string ) xfree(elm->c.text8.string);
- break;
- case Text16Cmd:
- case TextI16Cmd:
- if( elm->c.text16.string ) xfree(elm->c.text16.string);
- break;
- case PutImageCmd:
- if( elm->c.image.pData ) xfree(elm->c.image.pData);
- break;
- case BeginFrameCmd:
- break;
- case EndFrameCmd:
- break;
- }
-
- if (elm->type != BeginFrameCmd && elm->type != EndFrameCmd) {
- (void) FreeGC(elm->gc, (GContext) 0);
- }
- }
- xfree(oldDisp);
- }
- xfree(priv);
- xfree(pPixmap);
- return TRUE;
-}
-
-DisplayListPtr
-PsGetFreeDisplayBlock(PsPixmapPrivPtr priv)
-{
- DisplayListPtr disp = priv->dispList;
-
- for(; disp ; disp=disp->next )
- {
- if( disp->nelms>=DPY_BLOCKSIZE && disp->next ) continue;
- if( disp->nelms<DPY_BLOCKSIZE ) return(disp);
- disp->next = (DisplayListPtr)xalloc(sizeof(DisplayListRec));
- disp->next->next = (DisplayListPtr)0;
- disp->next->nelms = 0;
- }
- disp = (DisplayListPtr)xalloc(sizeof(DisplayListRec));
- disp->next = (DisplayListPtr)0;
- disp->nelms = 0;
- priv->dispList = disp;
- return(disp);
-}
-
-static void
-PsReplay(DisplayElmPtr elm, DrawablePtr pDrawable)
-{
- switch(elm->type)
- {
- case PolyPointCmd:
- PsPolyPoint(pDrawable, elm->gc, elm->c.polyPts.mode,
- elm->c.polyPts.nPoints, elm->c.polyPts.pPoints);
- break;
- case PolyLineCmd:
- PsPolyLine(pDrawable, elm->gc, elm->c.polyPts.mode,
- elm->c.polyPts.nPoints, elm->c.polyPts.pPoints);
- break;
- case PolySegmentCmd:
- PsPolySegment(pDrawable, elm->gc, elm->c.segments.nSegments,
- elm->c.segments.pSegments);
- break;
- case PolyRectangleCmd:
- PsPolyRectangle(pDrawable, elm->gc, elm->c.rects.nRects,
- elm->c.rects.pRects);
- break;
- case FillPolygonCmd:
- PsFillPolygon(pDrawable, elm->gc, 0, elm->c.polyPts.mode,
- elm->c.polyPts.nPoints, elm->c.polyPts.pPoints);
- break;
- case PolyFillRectCmd:
- PsPolyFillRect(pDrawable, elm->gc, elm->c.rects.nRects,
- elm->c.rects.pRects);
- break;
- case PolyArcCmd:
- PsPolyArc(pDrawable, elm->gc, elm->c.arcs.nArcs, elm->c.arcs.pArcs);
- break;
- case PolyFillArcCmd:
- PsPolyFillArc(pDrawable, elm->gc, elm->c.arcs.nArcs, elm->c.arcs.pArcs);
- break;
- case Text8Cmd:
- PsPolyText8(pDrawable, elm->gc, elm->c.text8.x, elm->c.text8.y,
- elm->c.text8.count, elm->c.text8.string);
- break;
- case Text16Cmd:
- PsPolyText16(pDrawable, elm->gc, elm->c.text16.x, elm->c.text16.y,
- elm->c.text16.count, elm->c.text16.string);
- break;
- case TextI8Cmd:
- PsImageText8(pDrawable, elm->gc, elm->c.text8.x, elm->c.text8.y,
- elm->c.text8.count, elm->c.text8.string);
- break;
- case TextI16Cmd:
- PsImageText16(pDrawable, elm->gc, elm->c.text16.x, elm->c.text16.y,
- elm->c.text16.count, elm->c.text16.string);
- break;
- case PutImageCmd:
- PsPutScaledImage(pDrawable, elm->gc, elm->c.image.depth,
- elm->c.image.x, elm->c.image.y,
- elm->c.image.w, elm->c.image.h, elm->c.image.leftPad,
- elm->c.image.format, elm->c.image.res,
- elm->c.image.pData);
- break;
- case BeginFrameCmd:
- {
- PsOutPtr psOut;
- ColormapPtr cMap;
- if( PsUpdateDrawableGC(NULL, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_BeginFrame(psOut, 0, 0, elm->c.frame.x, elm->c.frame.y,
- elm->c.frame.w, elm->c.frame.h);
- }
- break;
- case EndFrameCmd:
- {
- PsOutPtr psOut;
- ColormapPtr cMap;
- if( PsUpdateDrawableGC(NULL, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_EndFrame(psOut);
- }
- break;
- }
-}
-
-void
-PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable)
-{
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp = priv->dispList;
- DisplayElmPtr elm;
-
- for(; disp ; disp=disp->next )
- {
- int i;
- for( i=0,elm=disp->elms ; i<disp->nelms ; i++,elm++ )
- PsReplay(elm, pDrawable);
- }
-}
-
-int
-PsCloneDisplayElm(PixmapPtr dst, DisplayElmPtr elm, DisplayElmPtr newElm,
- int xoff, int yoff)
-{
- int i;
- int size;
- int status = 0;
-
- *newElm = *elm;
-
- /* I think this is the correct return value */
- if ((newElm->gc = PsCreateAndCopyGC(&dst->drawable, elm->gc)) == NULL) {
- return 1;
- }
-
- switch(elm->type)
- {
- case PolyPointCmd:
- case PolyLineCmd:
- newElm->c.polyPts.pPoints =
- (xPoint *)xalloc(elm->c.polyPts.nPoints*sizeof(xPoint));
- for( i=0 ; i<elm->c.polyPts.nPoints ; i++ )
- {
- newElm->c.polyPts.pPoints[i].x = elm->c.polyPts.pPoints[i].x+xoff;
- newElm->c.polyPts.pPoints[i].y = elm->c.polyPts.pPoints[i].y+yoff;
- }
- break;
- case PolySegmentCmd:
- newElm->c.segments.pSegments =
- (xSegment *)xalloc(elm->c.segments.nSegments*sizeof(xSegment));
- for( i=0 ; i<elm->c.segments.nSegments ; i++ )
- {
- newElm->c.segments.pSegments[i].x1 =
- elm->c.segments.pSegments[i].x1+xoff;
- newElm->c.segments.pSegments[i].y1 =
- elm->c.segments.pSegments[i].y1+yoff;
- newElm->c.segments.pSegments[i].x2 =
- elm->c.segments.pSegments[i].x2+xoff;
- newElm->c.segments.pSegments[i].y2 =
- elm->c.segments.pSegments[i].y2+yoff;
- }
- break;
- case PolyRectangleCmd:
- newElm->c.rects.pRects =
- (xRectangle *)xalloc(elm->c.rects.nRects*sizeof(xRectangle));
- for( i=0 ; i<elm->c.rects.nRects ; i++ )
- {
- newElm->c.rects.pRects[i].x = elm->c.rects.pRects[i].x+xoff;
- newElm->c.rects.pRects[i].y = elm->c.rects.pRects[i].y+yoff;
- newElm->c.rects.pRects[i].width = elm->c.rects.pRects[i].width;
- newElm->c.rects.pRects[i].height = elm->c.rects.pRects[i].height;
- }
- break;
- case FillPolygonCmd:
- newElm->c.polyPts.pPoints =
- (xPoint *)xalloc(elm->c.polyPts.nPoints*sizeof(xPoint));
- for( i=0 ; i<elm->c.polyPts.nPoints ; i++ )
- {
- newElm->c.polyPts.pPoints[i].x = elm->c.polyPts.pPoints[i].x+xoff;
- newElm->c.polyPts.pPoints[i].y = elm->c.polyPts.pPoints[i].y+yoff;
- }
- break;
- case PolyFillRectCmd:
- newElm->c.rects.pRects =
- (xRectangle *)xalloc(elm->c.rects.nRects*sizeof(xRectangle));
- for( i=0 ; i<elm->c.rects.nRects ; i++ )
- {
- newElm->c.rects.pRects[i].x = elm->c.rects.pRects[i].x+xoff;
- newElm->c.rects.pRects[i].y = elm->c.rects.pRects[i].y+yoff;
- newElm->c.rects.pRects[i].width = elm->c.rects.pRects[i].width;
- newElm->c.rects.pRects[i].height = elm->c.rects.pRects[i].height;
- }
- break;
- case PolyArcCmd:
- newElm->c.arcs.pArcs =
- (xArc *)xalloc(elm->c.arcs.nArcs*sizeof(xArc));
- for( i=0 ; i<elm->c.arcs.nArcs ; i++ )
- {
- newElm->c.arcs.pArcs[i].x = elm->c.arcs.pArcs[i].x+xoff;
- newElm->c.arcs.pArcs[i].y = elm->c.arcs.pArcs[i].y+yoff;
- newElm->c.arcs.pArcs[i].width = elm->c.arcs.pArcs[i].width;
- newElm->c.arcs.pArcs[i].height = elm->c.arcs.pArcs[i].height;
- newElm->c.arcs.pArcs[i].angle1 = elm->c.arcs.pArcs[i].angle1;
- newElm->c.arcs.pArcs[i].angle2 = elm->c.arcs.pArcs[i].angle2;
- }
- break;
- case PolyFillArcCmd:
- newElm->c.arcs.pArcs =
- (xArc *)xalloc(elm->c.arcs.nArcs*sizeof(xArc));
- for( i=0 ; i<elm->c.arcs.nArcs ; i++ )
- {
- newElm->c.arcs.pArcs[i].x = elm->c.arcs.pArcs[i].x+xoff;
- newElm->c.arcs.pArcs[i].y = elm->c.arcs.pArcs[i].y+yoff;
- newElm->c.arcs.pArcs[i].width = elm->c.arcs.pArcs[i].width;
- newElm->c.arcs.pArcs[i].height = elm->c.arcs.pArcs[i].height;
- newElm->c.arcs.pArcs[i].angle1 = elm->c.arcs.pArcs[i].angle1;
- newElm->c.arcs.pArcs[i].angle2 = elm->c.arcs.pArcs[i].angle2;
- }
- break;
- case Text8Cmd:
- case TextI8Cmd:
- newElm->c.text8.string = (char *)xalloc(elm->c.text8.count);
- memcpy(newElm->c.text8.string, elm->c.text8.string, elm->c.text8.count);
- newElm->c.text8.x += xoff;
- newElm->c.text8.y += yoff;
- break;
- case Text16Cmd:
- case TextI16Cmd:
- newElm->c.text16.string =
- (unsigned short *)xalloc(elm->c.text16.count*sizeof(unsigned short));
- memcpy(newElm->c.text16.string, elm->c.text16.string,
- elm->c.text16.count*sizeof(unsigned short));
- newElm->c.text16.x += xoff;
- newElm->c.text16.y += yoff;
- break;
- case PutImageCmd:
- size = PixmapBytePad(elm->c.image.w, elm->c.image.depth)*elm->c.image.h;
- newElm->c.image.pData = (char *)xalloc(size);
- memcpy(newElm->c.image.pData, elm->c.image.pData, size);
- newElm->c.image.x += xoff;
- newElm->c.image.y += yoff;
- break;
- case BeginFrameCmd:
- case EndFrameCmd:
- status = 1;
- break;
- }
- return(status);
-}
-
-void
-PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff, int yoff,
- int x, int y, int w, int h)
-{
- PsPixmapPrivPtr sPriv = (PsPixmapPrivPtr)src->devPrivate.ptr;
- PsPixmapPrivPtr dPriv = (PsPixmapPrivPtr)dst->devPrivate.ptr;
- DisplayListPtr sDisp;
- DisplayListPtr dDisp = PsGetFreeDisplayBlock(dPriv);
- DisplayElmPtr elm = &dDisp->elms[dDisp->nelms];
-
- elm->type = BeginFrameCmd;
- elm->c.frame.x = x;
- elm->c.frame.y = y;
- elm->c.frame.w = w;
- elm->c.frame.h = h;
- dDisp->nelms += 1;
-
- sDisp = sPriv->dispList;
- for(; sDisp ; sDisp=sDisp->next )
- {
- int i;
- for( i=0,elm=sDisp->elms ; i<sDisp->nelms ; i++,elm++ )
- {
- dDisp = PsGetFreeDisplayBlock(dPriv);
- if (PsCloneDisplayElm(dst, elm, &dDisp->elms[dDisp->nelms],
- xoff, yoff)==0)
- {
- dDisp->nelms += 1;
- }
- }
- }
-
- dDisp = PsGetFreeDisplayBlock(dPriv);
- elm = &dDisp->elms[dDisp->nelms];
- elm->type = EndFrameCmd;
- dDisp->nelms += 1;
-}
-
-PsElmPtr
-PsCreateFillElementList(PixmapPtr pix, int *nElms)
-{
- PsElmPtr elms = (PsElmPtr)0;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp = priv->dispList;
- PsArcEnum styl;
-
- *nElms = 0;
- for(; disp ; disp=disp->next )
- {
- int i;
- DisplayElmPtr elm = disp->elms;
-
- for( i=0 ; i<disp->nelms ; i++,elm++ )
- {
- if( !elm->gc->fgPixel ) continue;
- switch(elm->type)
- {
- case FillPolygonCmd:
- *nElms += 1;
- break;
- case PolyFillRectCmd:
- *nElms += elm->c.rects.nRects;
- break;
- case PolyFillArcCmd:
- *nElms += elm->c.arcs.nArcs;
- break;
- default:
- break;
- }
- }
- }
-
- if( (*nElms) )
- {
- elms = (PsElmPtr)xalloc((*nElms)*sizeof(PsElmRec));
- if( elms )
- {
- disp = priv->dispList;
- *nElms = 0;
- for(; disp ; disp=disp->next )
- {
- int i, k;
- DisplayElmPtr elm = disp->elms;
-
- for( i=0 ; i<disp->nelms ; i++,elm++ )
- {
- if( !elm->gc->fgPixel ) continue;
- switch(elm->type)
- {
- case FillPolygonCmd:
- elms[*nElms].type = PSOUT_POINTS;
- elms[*nElms].nPoints = elm->c.polyPts.nPoints;
- elms[*nElms].c.points =
- (PsPointPtr)xalloc(elms[*nElms].nPoints*sizeof(PsPointRec));
- for( k=0 ; k<elms[*nElms].nPoints ; k++ )
- {
- elms[*nElms].c.points[k].x = elm->c.polyPts.pPoints[k].x;
- elms[*nElms].c.points[k].y = elm->c.polyPts.pPoints[k].y;
- }
- *nElms += 1;
- break;
- case PolyFillRectCmd:
- for( k=0 ; k<elm->c.rects.nRects ; k++ )
- {
- elms[*nElms].type = PSOUT_RECT;
- elms[*nElms].nPoints = 0;
- elms[*nElms].c.rect.x = elm->c.rects.pRects[k].x;
- elms[*nElms].c.rect.y = elm->c.rects.pRects[k].y;
- elms[*nElms].c.rect.w = elm->c.rects.pRects[k].width;
- elms[*nElms].c.rect.h = elm->c.rects.pRects[k].height;
- *nElms += 1;
- }
- break;
- case PolyFillArcCmd:
- if( elm->gc->arcMode==ArcChord ) styl = PsChord;
- else styl = PsPieSlice;
- for( k=0 ; k<elm->c.rects.nRects ; k++ )
- {
- elms[*nElms].type = PSOUT_ARC;
- elms[*nElms].nPoints = 0;
- elms[*nElms].c.arc.x = elm->c.arcs.pArcs[k].x;
- elms[*nElms].c.arc.y = elm->c.arcs.pArcs[k].y;
- elms[*nElms].c.arc.w = elm->c.arcs.pArcs[k].width;
- elms[*nElms].c.arc.h = elm->c.arcs.pArcs[k].height;
- elms[*nElms].c.arc.a1 = elm->c.arcs.pArcs[k].angle1;
- elms[*nElms].c.arc.a2 = elm->c.arcs.pArcs[k].angle2;
- elms[*nElms].c.arc.style = styl;
- *nElms += 1;
- }
- break;
- default:
- break;
- }
- }
- }
- }
- }
- return(elms);
-}
-
-PsElmPtr
-PsCloneFillElementList(int nElms, PsElmPtr elms)
-{
- int i;
- PsElmPtr newElms;
-
- newElms = (PsElmPtr)xalloc(nElms*sizeof(PsElmRec));
- if( !newElms ) return(newElms);
- for( i=0 ; i<nElms ; i++ )
- {
- newElms[i] = elms[i];
-
- if( elms[i].type==PSOUT_POINTS )
- {
- newElms[i].c.points =
- (PsPointPtr)xalloc(elms[i].nPoints*sizeof(PsElmRec));
- memcpy(newElms[i].c.points, elms[i].c.points,
- elms[i].nPoints*sizeof(PsPointRec));
- }
- }
- return(newElms);
-}
-
-void
-PsDestroyFillElementList(int nElms, PsElmPtr elms)
-{
- int i;
-
- for( i=0 ; i<nElms ; i++ )
- { if( elms[i].type==PSOUT_POINTS ) xfree(elms[i].c.points); }
-
- xfree(elms);
-}
diff --git a/Xprint/ps/PsPolygon.c b/Xprint/ps/PsPolygon.c
deleted file mode 100644
index 0cd826f43..000000000
--- a/Xprint/ps/PsPolygon.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $Xorg: PsPolygon.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsPolygon.c
-** *
-** * Contents: Draws Polygons and Rectangles for the PS DDX
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsPolygon.c,v 1.7 2001/12/14 19:59:17 dawes Exp $ */
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PsPolyRectangle(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyRectangleCmd;
- elm->gc = gc;
- elm->c.rects.nRects = nRects;
- elm->c.rects.pRects = (xRectangle *)xalloc(nRects*sizeof(xRectangle));
- memcpy(elm->c.rects.pRects, pRects, nRects*sizeof(xRectangle));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- PsLineAttrs(psOut, pGC, cMap);
- for( i=0 ; i<nRects ; i++ )
- {
- PsOut_DrawRect(psOut, (int)pRects[i].x, (int)pRects[i].y,
- (int)pRects[i].width, (int)pRects[i].height);
- }
- }
-}
-
-void
-PsFillPolygon(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int nPoints,
- DDXPointPtr pPoints)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = FillPolygonCmd;
- elm->gc = gc;
- elm->c.polyPts.mode = mode;
- elm->c.polyPts.nPoints = nPoints;
- elm->c.polyPts.pPoints = (xPoint *)xalloc(nPoints*sizeof(xPoint));
- memcpy(elm->c.polyPts.pPoints, pPoints, nPoints*sizeof(xPoint));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- PsPointPtr pts;
- PsRuleEnum rule;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsSetFillColor(pDrawable, pGC, psOut, cMap);
- if( pGC->fillRule==EvenOddRule ) rule = PsEvenOdd;
- else rule = PsNZWinding;
- PsOut_FillRule(psOut, rule);
- pts = (PsPointPtr)xalloc(sizeof(PsPointRec)*nPoints);
- if( mode==CoordModeOrigin )
- {
- for( i=0 ; i<nPoints ; i++ )
- { pts[i].x = pPoints[i].x; pts[i].y = pPoints[i].y; }
- }
- else
- {
- pts[0].x = pPoints[0].x; pts[0].y = pPoints[0].y;
- for( i=1 ; i<nPoints ; i++ )
- {
- pts[i].x = pts[i-1].x+pPoints[i].x;
- pts[i].y = pts[i-1].y+pPoints[i].y;
- }
- }
- PsOut_Polygon(psOut, nPoints, pts);
- xfree(pts);
- }
-}
-
-void
-PsPolyFillRect(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = PolyFillRectCmd;
- elm->gc = gc;
- elm->c.rects.nRects = nRects;
- elm->c.rects.pRects = (xRectangle *)xalloc(nRects*sizeof(xRectangle));
- memcpy(elm->c.rects.pRects, pRects, nRects*sizeof(xRectangle));
- disp->nelms += 1;
- }
- else
- {
- int i;
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsSetFillColor(pDrawable, pGC, psOut, cMap);
- for( i=0 ; i<nRects ; i++ )
- {
- PsOut_FillRect(psOut, (int)pRects[i].x, (int)pRects[i].y,
- (int)pRects[i].width, (int)pRects[i].height);
- }
- }
-}
diff --git a/Xprint/ps/PsPrint.c b/Xprint/ps/PsPrint.c
deleted file mode 100644
index 8a06205e5..000000000
--- a/Xprint/ps/PsPrint.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/* $Xorg: PsPrint.c,v 1.7 2001/03/14 18:28:18 pookie Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996, 2000 Sun Microsystems, Inc. All rights reserved.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsPrint.c
-** *
-** * Contents: Print extension code of Ps driver
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsPrint.c,v 1.11 2001/12/21 21:02:06 dawes Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <errno.h>
-#include <X11/Xprotostr.h>
-
-#define NEED_EVENTS
-#include "Xproto.h"
-#undef NEED_EVENTS
-
-#include "Ps.h"
-
-#include "windowstr.h"
-#include "Oid.h"
-
-/* static utility function to get document/page attributes */
-static void
-S_GetPageAttributes(XpContextPtr pCon,int *iorient,int *icount, int *iplex,
- int *ires, unsigned short *iwd, unsigned short *iht)
-{
- char *count;
- XpOid orient, plex;
- /*
- * Get the orientation
- */
- orient = XpGetContentOrientation(pCon);
- switch (orient) {
- case xpoid_val_content_orientation_landscape:
- *iorient = 1;
- break;
- case xpoid_val_content_orientation_reverse_portrait:
- *iorient = 2;
- break;
- case xpoid_val_content_orientation_reverse_landscape:
- *iorient = 3;
- break;
- case xpoid_val_content_orientation_portrait:
- default:
- *iorient = 0;
- break;
- }
-
- /*
- * Get the count
- */
- count = XpGetOneAttribute(pCon, XPDocAttr, "copy-count");
- if( count )
- {
- int ii = sscanf(count, "%d", icount);
- if( ii!=1 ) *icount = 1;
- }
- else *icount = 1;
-
- /*
- * Get the plex
- */
- plex = XpGetPlex(pCon);
- switch(plex)
- {
- case xpoid_val_plex_duplex:
- *iplex = 1;
- break;
- case xpoid_val_plex_tumble:
- *iplex = 2;
- break;
- default:
- *iplex = 0;
- break;
- }
-
- /*
- * Get the resolution and media size
- */
- *ires = XpGetResolution(pCon);
- XpGetMediumDimensions(pCon, iwd, iht);
-}
-
-
-int
-PsStartJob(
- XpContextPtr pCon,
- Bool sendClientData,
- ClientPtr client)
-{
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- /*
- * Create a temporary file to store the printer output.
- */
- if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile))
- return BadAlloc;
-
- return Success;
-}
-
-
-
-/* I thought about making this following code into a set of routines
- or using a goto, or something, but in the end decided not to,
- because the plain old listing here makes the logic clearer. */
-int
-PsEndJob(
- XpContextPtr pCon,
- Bool cancel)
-{
- int r;
- struct stat buffer;
- int error;
-
- PsContextPrivPtr priv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- if (cancel == True) {
- if (priv->getDocClient != (ClientPtr) NULL) {
- (void) XpFinishDocData( priv->getDocClient );
-
- priv->getDocClient = NULL;
- priv->getDocBufSize = 0;
- }
-
- /* job is cancelled - do we really care if we're out of space? */
- (void) fclose(priv->pJobFile);
- priv->pJobFile = NULL;
-
- unlink(priv->jobFileName);
- xfree(priv->jobFileName);
- priv->jobFileName = (char *)NULL;
-
- return Success;
- }
-
- /*
- * Append any trailing information here
- */
- PsOut_EndFile(priv->pPsOut, 0);
-
- /* this is where we find out if we're out of space */
- error = (fclose(priv->pJobFile) == EOF);
- priv->pJobFile = NULL;
-
- /* status to the client if we have ran out of space on the disk or
- some other resource problem with the temporary file... */
- if (error) {
- if (priv->getDocClient != (ClientPtr) NULL) {
- (void) XpFinishDocData( priv->getDocClient );
-
- priv->getDocClient = NULL;
- priv->getDocBufSize = 0;
- }
-
- unlink(priv->jobFileName);
- xfree(priv->jobFileName);
- priv->jobFileName = (char *)NULL;
-
- return BadAlloc;
- }
-
- /* we have finished without incident & no cancel */
-
- if (priv->getDocClient != NULL && priv->getDocBufSize > 0) {
- FILE *file;
-
- file = fopen(priv->jobFileName, "r");
- if (!file || (fstat(fileno(file), &buffer) < 0))
- r = BadAlloc;
- else
- r = XpSendDocumentData(priv->getDocClient, file, buffer.st_size,
- priv->getDocBufSize);
- if (file)
- fclose(file);
-
- (void) XpFinishDocData(priv->getDocClient);
-
- priv->getDocClient = NULL;
- priv->getDocBufSize = 0;
- }
- else {
- XpSubmitJob(priv->jobFileName, pCon);
-
- r = Success;
- }
-
- unlink(priv->jobFileName);
- xfree(priv->jobFileName);
- priv->jobFileName = (char *)NULL;
-
-#ifdef BM_CACHE
- PsBmClearImageCache();
-#endif
-
- return r;
-}
-
-/* StartPage
- */
-int
-PsStartPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- int iorient, iplex, icount, ires;
- unsigned short iwd, iht;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
- PsWindowPrivPtr pWinPriv =
- (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
-
-/*
- * Put a pointer to the context in the window private structure
- */
- pWinPriv->validContext = 1;
- pWinPriv->context = pCon;
-
- /* get page level attributes */
- S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht);
- /*
- * Start the page
- */
- if (pConPriv->pPsOut == NULL) {
- pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile,
- iorient, icount, iplex, ires,
- (int)iwd, (int)iht, False);
- }
- PsOut_BeginPage(pConPriv->pPsOut, iorient, icount, iplex, ires,
- (int)iwd, (int)iht);
-
- return Success;
-}
-
-
-/*
- * EndPage:
- *
- * Write page trailer to page file
- * Write page file to job file
- */
-int
-PsEndPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- PsWindowPrivPtr pWinPriv =
- (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- PsOut_EndPage(pConPriv->pPsOut);
-
- pWinPriv->validContext = 0;
- pWinPriv->context = NULL;
-
- /* status to the client if we have ran out of space on the disk or
- some other resource problem with the temporary file... */
-/* if (ferror(pConPriv->pJobFile)) return BadAlloc; */
-
- return Success;
-}
-
-/*
- * The PsStartDoc() and PsEndDoc() functions serve basically as NOOP
- * placeholders. This driver doesn't deal with the notion of multiple
- * documents per page.
- */
-
-int
-PsStartDoc(XpContextPtr pCon, XPDocumentType type)
-{
- int iorient, iplex, icount, ires;
- unsigned short iwd, iht;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- /* get document level attributes */
- S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht);
-
- pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile,
- iorient, icount, iplex, ires,
- (int)iwd, (int)iht, (type == XPDocRaw));
-
- return Success;
-}
-
-int
-PsEndDoc(
- XpContextPtr pCon,
- Bool cancel)
-{
- return Success;
-}
-
-/*
- * PsDocumentData()
- *
- * Hand any pre-generated PDL down to the spool files, formatting it
- * as necessary to fit the given window.
- */
-
-int
-PsDocumentData(
- XpContextPtr pCon,
- DrawablePtr pDraw,
- char *pData,
- int len_data,
- char *pFmt,
- int len_fmt,
- char *pOpt,
- int len_opt,
- ClientPtr client)
-{
- PsContextPrivPtr cPriv;
- PsOutPtr psOut;
-
- if (len_fmt != 12 || !strcmp(pFmt, "PostScript 2") || len_opt)
- return BadValue;
- cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr;
- psOut = cPriv->pPsOut;
-
- if (pDraw)
- PsOut_BeginFrame(psOut, 0, 0, pDraw->x, pDraw->y,
- pDraw->width, pDraw->height);
- PsOut_RawData(psOut, pData, len_data);
- if (pDraw)
- PsOut_EndFrame(psOut);
-
- return Success;
-}
-
-/*
- *
- * PsGetDocumentData()
- *
- * This function allows the driver to send the generated PS back to
- * the client.
- */
-
-int
-PsGetDocumentData(
- XpContextPtr pCon,
- ClientPtr client,
- int maxBufferSize)
-{
- PsContextPrivPtr pPriv = (PsContextPrivPtr)
- pCon->devPrivates[PsContextPrivateIndex].ptr;
-
- pPriv->getDocClient = client;
- pPriv->getDocBufSize = maxBufferSize;
-
- return Success;
-}
-
diff --git a/Xprint/ps/PsSpans.c b/Xprint/ps/PsSpans.c
deleted file mode 100644
index 32ca58d20..000000000
--- a/Xprint/ps/PsSpans.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* $Xorg: PsSpans.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsSpans.c
-** *
-** * Contents: Code to set and fill spans in the PS DDX
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsSpans.c,v 1.9 2001/12/14 19:59:17 dawes Exp $ */
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-
-void
-PsFillSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nSpans,
- DDXPointPtr pPoints,
- int *pWidths,
- int fSorted)
-{
- PsOutPtr psOut;
- int xoffset, yoffset;
- xRectangle *rects, *r;
- RegionPtr fillRegion, region = 0;
- int i;
- int nbox;
- BoxPtr pbox;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
-
- /*
- * Build a region out of the spans
- */
- rects = (xRectangle *)xalloc(nSpans*sizeof(xRectangle));
- xoffset = pDrawable->x;
- yoffset = pDrawable->y;
-
- for( i = 0, r = rects; i < nSpans; i++, r++ )
- {
- r->x = pPoints[i].x + xoffset;
- r->y = pPoints[i].y + yoffset;
- r->width = pWidths[i];
- r->height = 1;
- }
- fillRegion = RECTS_TO_REGION(pGC->pScreen, nSpans, rects,
- (fSorted)?CT_YSORTED:CT_UNSORTED);
-
- /*
- * Intersect this region with the clip region. Whatever's left,
- * should be filled.
- */
-/*REGION_INTERSECT(pGC->pScreen, region, fillRegion, pGC->clientClip);*/
-
- pbox = REGION_RECTS(region);
- nbox = REGION_NUM_RECTS(region);
-
- /* Enter HP-GL/2 */
- /*###SEND_PCL( outFile, "\27%0B" );*/
-
- while( nbox )
- {
-/*###
- sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, pbox->x2, pbox->y2);
- SEND_PCL( outFile, t );
-*/
- nbox--;
- pbox++;
- }
-
- /* Go back to PCL */
- /*###SEND_PCL( outFile, "\27%0A" );*/
-
- /*
- * Clean up the temporary regions
- */
- REGION_DESTROY(pGC->pScreen, fillRegion);
- REGION_DESTROY(pGC->pScreen, region);
- xfree(rects);
-}
-
-void
-PsSetSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- char *pSrc,
- DDXPointPtr pPoints,
- int *pWidths,
- int nSpans,
- int fSorted)
-{
-}
diff --git a/Xprint/ps/PsText.c b/Xprint/ps/PsText.c
deleted file mode 100644
index b04d910d5..000000000
--- a/Xprint/ps/PsText.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/* $Xorg: PsText.c,v 1.7 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsText.c
-** *
-** * Contents: Character-drawing routines for the PS DDX
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsText.c,v 1.13 2003/10/29 22:11:55 tsi Exp $ */
-
-#include "Ps.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "fntfilst.h"
-#include <sys/stat.h>
-
-static int readFontName(char *fileName, char *file_name, char *dlfnam)
-{
- FILE *file;
- struct stat statb;
- char buf[256];
- char *front, *fn;
-
- file = fopen(fileName, "r");
- if(file)
- {
- if (fstat (fileno(file), &statb) == -1)
- return 0;
- while(fgets(buf, 255, file))
- {
- if((fn = strstr(buf, " -")))
- {
- strcpy(file_name, buf);
- file_name[fn - buf - 4] = '\0';
- fn++;
- if((front = strstr(fn, "normal-")))
- {
- fn[front - fn] = '\0';
- if(strstr(dlfnam, fn))
- {
- fclose(file);
- return 1;
- }
- }
- }
- }
- }
- file_name[0] = '\0';
- fclose(file);
- return 0;
-}
-
-int
-PsPolyText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *string)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return x;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = Text8Cmd;
- elm->gc = gc;
- elm->c.text8.x = x;
- elm->c.text8.y = y;
- elm->c.text8.count = count;
- elm->c.text8.string = (char *)xalloc(count);
- memcpy(elm->c.text8.string, string, count);
- disp->nelms += 1;
- }
- else
- {
- char *fnam, ffname[512], *dlfnam;
- FontDirectoryPtr dir;
- char file_name[MAXFONTNAMELEN];
-
- dir = pGC->font->fpe->private;
- sprintf(ffname, "%s%s", dir->directory, "fonts.dir");
-
- fnam = PsGetPSFontName(pGC->font);
- if(!fnam){
- if(!(dlfnam = PsGetFontName(pGC->font)))
- return x;
- /* If Type1 font, try to download to printer first */
- if(strstr(ffname, "Type1") && readFontName(ffname, file_name, dlfnam))
- {
- int siz;
- float mtx[4];
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE )
- return x;
- sprintf(ffname, "%s%s%s", dir->directory, file_name, ".pfa");
- PsOut_DownloadType1(psOut, file_name, ffname);
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- siz = PsGetFontSize(pGC->font, mtx);
- if( !siz ) PsOut_TextAttrsMtx(psOut, file_name, mtx, 1);
- else PsOut_TextAttrs(psOut, file_name, siz, 1);
- PsOut_Text(psOut, x, y, string, count, -1);
- return x;
- }
- {
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255];
-
- GetGlyphs(pGC->font, (unsigned long)count,
- (unsigned char *)string, Linear8Bit,&n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- PsPolyGlyphBlt(pDrawable, pGC, x, y, n,
- charinfo, FONTGLYPHS(pGC->font));
- x += w;
- }
- }else{
- int iso;
- int siz;
- float mtx[4];
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return x;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- siz = PsGetFontSize(pGC->font, mtx);
- iso = PsIsISOLatin1Encoding(pGC->font);
- if( !siz ) PsOut_TextAttrsMtx(psOut, fnam, mtx, iso);
- else PsOut_TextAttrs(psOut, fnam, siz, iso);
- PsOut_Text(psOut, x, y, string, count, -1);
- }
- }
- return x;
-}
-
-int
-PsPolyText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return x;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = Text16Cmd;
- elm->gc = gc;
- elm->c.text16.x = x;
- elm->c.text16.y = y;
- elm->c.text16.count = count;
- elm->c.text16.string =
- (unsigned short *)xalloc(count*sizeof(unsigned short));
- memcpy(elm->c.text16.string, string, count*sizeof(unsigned short));
- disp->nelms += 1;
- }
- else
- {
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)string,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- PsPolyGlyphBlt(pDrawable, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
- x += w;
- }
- return x;
-}
-
-void
-PsImageText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *string)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = TextI8Cmd;
- elm->gc = gc;
- elm->c.text8.x = x;
- elm->c.text8.y = y;
- elm->c.text8.count = count;
- elm->c.text8.string = (char *)xalloc(count);
- memcpy(elm->c.text8.string, string, count);
- disp->nelms += 1;
- }
- else
- {
- int iso;
- int siz;
- float mtx[4];
- char *fnam;
- PsOutPtr psOut;
- ColormapPtr cMap;
-
- if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return;
- PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
- PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel));
- fnam = PsGetPSFontName(pGC->font);
- if( !fnam ) fnam = "Times-Roman";
- siz = PsGetFontSize(pGC->font, mtx);
- iso = PsIsISOLatin1Encoding(pGC->font);
- if( !siz ) PsOut_TextAttrsMtx(psOut, fnam, mtx, iso);
- else PsOut_TextAttrs(psOut, fnam, siz, iso);
- PsOut_Text(psOut, x, y, string, count, PsGetPixelColor(cMap, pGC->bgPixel));
- }
-}
-
-void
-PsImageText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *string)
-{
- if( pDrawable->type==DRAWABLE_PIXMAP )
- {
- DisplayElmPtr elm;
- PixmapPtr pix = (PixmapPtr)pDrawable;
- PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pix->devPrivate.ptr;
- DisplayListPtr disp;
- GCPtr gc;
-
- if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
-
- disp = PsGetFreeDisplayBlock(priv);
-
- elm = &disp->elms[disp->nelms];
- elm->type = TextI16Cmd;
- elm->gc = gc;
- elm->c.text16.x = x;
- elm->c.text16.y = y;
- elm->c.text16.count = count;
- elm->c.text16.string =
- (unsigned short *)xalloc(count*sizeof(unsigned short));
- memcpy(elm->c.text16.string, string, count*sizeof(unsigned short));
- disp->nelms += 1;
- }
- else
- {
- int i;
- char *str;
- if( !count ) return;
- str = (char *)xalloc(count);
- for( i=0 ; i<count ; i++ ) str[i] = string[i];
- PsImageText8(pDrawable, pGC, x, y, count, str);
- free(str);
- }
-}
-
-void
-PsImageGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
- /* NOT TO BE IMPLEMENTED */
-}
-
-void
-PsPolyGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nGlyphs,
- CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
- int width, height;
- PixmapPtr pPixmap = NullPixmap;
- int nbyLine; /* bytes per line of padded pixmap */
- FontPtr pfont;
- GCPtr pGCtmp;
- register int i;
- register int j;
- unsigned char *pbits; /* buffer for PutImage */
- register unsigned char *pb; /* temp pointer into buffer */
- register CharInfoPtr pci; /* currect char info */
- register unsigned char *pglyph; /* pointer bits in glyph */
- int gWidth, gHeight; /* width and height of glyph */
- register int nbyGlyphWidth; /* bytes per scanline of glyph */
- int nbyPadGlyph; /* server padded line of glyph */
- int w;
- XID gcvals[3];
-
- pfont = pGC->font;
- width = FONTMAXBOUNDS(pfont,rightSideBearing) -
- FONTMINBOUNDS(pfont,leftSideBearing);
- height = FONTMAXBOUNDS(pfont,ascent) +
- FONTMAXBOUNDS(pfont,descent);
-
- if ((width == 0) || (height == 0) )
- return;
- {
- int i;
- w = 0;
- for (i=0; i < nGlyphs; i++) w += pCharInfo[i]->metrics.characterWidth;
- }
- pGCtmp = GetScratchGC(1, pDrawable->pScreen);
- if (!pGCtmp)
- {
- (*pDrawable->pScreen->DestroyPixmap)(pPixmap);
- return;
- }
-
- gcvals[0] = GXcopy;
- gcvals[1] = pGC->fgPixel;
- gcvals[2] = pGC->bgPixel;
-
- DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0);
-
-
- nbyLine = BitmapBytePad(width);
- pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine);
- if (!pbits){
- PsDestroyPixmap(pPixmap);
- return;
- }
- while(nGlyphs--)
- {
- pci = *pCharInfo++;
- pglyph = FONTGLYPHBITS(pGlyphBase, pci);
- gWidth = GLYPHWIDTHPIXELS(pci);
- gHeight = GLYPHHEIGHTPIXELS(pci);
- if (gWidth && gHeight)
- {
- nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci);
- nbyPadGlyph = BitmapBytePad(gWidth);
-
- if (nbyGlyphWidth == nbyPadGlyph
-#if GLYPHPADBYTES != 4
- && (((int) pglyph) & 3) == 0
-#endif
- )
- {
- pb = pglyph;
- }
- else
- {
- for (i=0, pb = pbits; i<gHeight; i++, pb = pbits+(i*nbyPadGlyph))
- for (j = 0; j < nbyGlyphWidth; j++)
- *pb++ = *pglyph++;
- pb = pbits;
- }
-
- PsPutImageMask((DrawablePtr)pDrawable, pGCtmp,
- 1, x + pci->metrics.leftSideBearing,
- y - pci->metrics.ascent, gWidth, gHeight,
- 0, XYBitmap, (char *)pb);
- x += pci->metrics.characterWidth;
- }
- }
- DEALLOCATE_LOCAL(pbits);
- FreeScratchGC(pGCtmp);
-}
diff --git a/Xprint/ps/PsWindow.c b/Xprint/ps/PsWindow.c
deleted file mode 100644
index e39b602cb..000000000
--- a/Xprint/ps/PsWindow.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/* $Xorg: PsWindow.c,v 1.4 2001/02/09 02:04:36 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: PsWindow.c
-** *
-** * Contents: Window code for PS driver.
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsWindow.c,v 1.13 2003/10/29 22:11:55 tsi Exp $ */
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "mistruct.h"
-#include "regionstr.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-
-#include "Ps.h"
-
-#if 0
-/*
- * The following list of strings defines the properties which will be
- * placed on the screen's root window if the property was defined in
- * the start-up configuration resource database.
- */
-static char *propStrings[] = {
- DT_PRINT_JOB_HEADER,
- DT_PRINT_JOB_TRAILER,
- DT_PRINT_JOB_COMMAND,
- DT_PRINT_JOB_EXEC_COMMAND,
- DT_PRINT_JOB_EXEC_OPTIONS,
- DT_PRINT_PAGE_HEADER,
- DT_PRINT_PAGE_TRAILER,
- DT_PRINT_PAGE_COMMAND,
- (char *)NULL
-};
-#endif
-
-/*
- * PsCreateWindow - watch for the creation of the root window.
- * When it's created, register the screen with the print extension,
- * and put the default command/header properties on it.
- */
-/*ARGSUSED*/
-
-Bool
-PsCreateWindow(WindowPtr pWin)
-{
- PsWindowPrivPtr pPriv;
-
-#if 0
- Bool status = Success;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- PsScreenPrivPtr pScreenPriv = (PsScreenPrivPtr)
- pScreen->devPrivates[PsScreenPrivateIndex].ptr;
- PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr)
- pWin->devPrivates[PsWindowPrivateIndex].ptr;
-
- /*
- * Initialize this window's private struct.
- */
- pWinPriv->jobFileName = (char *)NULL;
- pWinPriv->pJobFile = (FILE *)NULL;
- pWinPriv->pageFileName = (char *)NULL;
- pWinPriv->pPageFile = (FILE *)NULL;
-
- if(pWin->parent == (WindowPtr)NULL) /* root window? */
- {
- Atom propName; /* type = XA_STRING */
- char *propVal;
- int i;
- XrmDatabase rmdb = pScreenPriv->resDB;
-
- /*
- * Put the defaults spec'd in the config files in properties on this
- * screen's root window.
- */
- for(i = 0; propStrings[i] != (char *)NULL; i++)
- {
- if((propVal = _DtPrintGetPrinterResource(pWin, rmdb,
- propStrings[i])) !=
- (char *)NULL)
- {
- propName = MakeAtom(propStrings[i], strlen(propStrings[i]),
- TRUE);
- ChangeWindowProperty(pWin, propName, XA_STRING, 8,
- PropModeReplace, strlen(propVal),
- (pointer)propVal, FALSE);
- xfree(propVal);
- }
- }
- }
-
- return status;
-#endif
-
- pPriv = (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
- pPriv->validContext = 0;
-
- return TRUE;
-}
-
-
-/*ARGSUSED*/
-Bool PsMapWindow(WindowPtr pWindow)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-Bool
-PsPositionWindow(
- WindowPtr pWin,
- int x,
- int y)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-Bool
-PsUnmapWindow(WindowPtr pWindow)
-{
- return TRUE;
-}
-
-/*ARGSUSED*/
-void
-PsCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
-}
-
-/*ARGSUSED*/
-Bool
-PsChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask)
-{
- return TRUE;
-}
-
-
-void
-PsPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
-
-#define FUNCTION 0
-#define FOREGROUND 1
-#define TILE 2
-#define FILLSTYLE 3
-#define ABSX 4
-#define ABSY 5
-#define CLIPMASK 6
-#define SUBWINDOW 7
-#define COUNT_BITS 8
-
- pointer gcval[7];
- pointer newValues [COUNT_BITS];
-
- BITS32 gcmask, index, mask;
- RegionRec prgnWin;
- DDXPointRec oldCorner;
- BoxRec box;
- WindowPtr pBgWin;
- GCPtr pGC;
- register int i;
- register BoxPtr pbox;
- register ScreenPtr pScreen = pWin->drawable.pScreen;
- register xRectangle *prect;
- int numRects;
-
- gcmask = 0;
-
- /*
- * We don't want to paint a window that has no place to put the
- * PS output.
- */
- if( PsGetContextFromWindow(pWin)==(XpContextPtr)NULL ) return;
-
- if( what==PW_BACKGROUND )
- {
- switch(pWin->backgroundState)
- {
- case None: return;
- case ParentRelative:
- (*pWin->parent->drawable.pScreen->PaintWindowBackground)
- (pWin->parent, pRegion, what);
- return;
- case BackgroundPixel:
- newValues[FOREGROUND] = (pointer)pWin->background.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- break;
- case BackgroundPixmap:
- newValues[TILE] = (pointer)pWin->background.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- break;
- }
- }
- else
- {
- if( pWin->borderIsPixel )
- {
- newValues[FOREGROUND] = (pointer)pWin->border.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- }
- else
- {
- newValues[TILE] = (pointer)pWin->border.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- }
- }
-
- prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) *
- sizeof(xRectangle));
- if( !prect ) return;
-
- newValues[FUNCTION] = (pointer)GXcopy;
- gcmask |= GCFunction | GCClipMask;
-
- i = pScreen->myNum;
-
- pBgWin = pWin;
- if (what == PW_BORDER)
- {
- while( pBgWin->backgroundState==ParentRelative ) pBgWin = pBgWin->parent;
- }
-
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
- if( !pGC )
- {
- DEALLOCATE_LOCAL(prect);
- return;
- }
- /*
- * mash the clip list so we can paint the border by
- * mangling the window in place, pretending it
- * spans the entire screen
- */
- if( what==PW_BORDER )
- {
- prgnWin = pWin->clipList;
- oldCorner.x = pWin->drawable.x;
- oldCorner.y = pWin->drawable.y;
- pWin->drawable.x = pWin->drawable.y = 0;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT(pScreen, &pWin->clipList, &box, 1);
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- newValues[ABSX] = (pointer)(long)pBgWin->drawable.x;
- newValues[ABSY] = (pointer)(long)pBgWin->drawable.y;
- }
- else
- {
- newValues[ABSX] = (pointer)0;
- newValues[ABSY] = (pointer)0;
- }
-
-/*
- * XXX Backing store is turned off for the PS driver
-
- if( pWin->backStorage )
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
- */
-
- mask = gcmask;
- gcmask = 0;
- i = 0;
- while( mask )
- {
- index = lowbit (mask);
- mask &= ~index;
- switch(index)
- {
- case GCFunction:
- if( (pointer)(long)pGC->alu!=newValues[FUNCTION] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FUNCTION];
- }
- break;
- case GCTileStipXOrigin:
- if( (pointer)(long)pGC->patOrg.x!=newValues[ABSX] )
- {
- gcmask |= index;
- gcval[i++] = newValues[ABSX];
- }
- break;
- case GCTileStipYOrigin:
- if( (pointer)(long)pGC->patOrg.y!=newValues[ABSY] )
- {
- gcmask |= index;
- gcval[i++] = newValues[ABSY];
- }
- break;
- case GCClipMask:
- if( (pointer)(long)pGC->clientClipType!=(pointer)CT_NONE )
- {
- gcmask |= index;
- gcval[i++] = (pointer)CT_NONE;
- }
- break;
- case GCSubwindowMode:
- if( (pointer)(long)pGC->subWindowMode!=newValues[SUBWINDOW] )
- {
- gcmask |= index;
- gcval[i++] = newValues[SUBWINDOW];
- }
- break;
- case GCTile:
- if( pGC->tileIsPixel || (pointer)pGC->tile.pixmap!=newValues[TILE] )
- {
- gcmask |= index;
- gcval[i++] = newValues[TILE];
- }
- break;
- case GCFillStyle:
- if( (pointer)(long)pGC->fillStyle!=newValues[FILLSTYLE] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FILLSTYLE];
- }
- break;
- case GCForeground:
- if( (pointer)pGC->fgPixel!=newValues[FOREGROUND] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FOREGROUND];
- }
- break;
- }
- }
-
- if( gcmask ) DoChangeGC(pGC, gcmask, (XID *)gcval, 1);
-
- if( pWin->drawable.serialNumber!=pGC->serialNumber )
- ValidateGC((DrawablePtr)pWin, pGC);
-
- numRects = REGION_NUM_RECTS(pRegion);
- pbox = REGION_RECTS(pRegion);
- for( i=numRects ; --i >= 0 ; pbox++,prect++ )
- {
- prect->x = pbox->x1 - pWin->drawable.x;
- prect->y = pbox->y1 - pWin->drawable.y;
- prect->width = pbox->x2 - pbox->x1;
- prect->height = pbox->y2 - pbox->y1;
- }
- prect -= numRects;
- (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect);
- DEALLOCATE_LOCAL(prect);
-
-/*
- * XXX Backing store is turned off for the PS driver
-
- if( pWin->backStorage )
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing);
- */
-
- if( what==PW_BORDER )
- {
- REGION_UNINIT(pScreen, &pWin->clipList);
- pWin->clipList = prgnWin;
- pWin->drawable.x = oldCorner.x;
- pWin->drawable.y = oldCorner.y;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- FreeScratchGC(pGC);
-}
-
-/*ARGSUSED*/
-Bool
-PsDestroyWindow(WindowPtr pWin)
-{
- return TRUE;
-}
diff --git a/Xprint/ps/psout.c b/Xprint/ps/psout.c
deleted file mode 100644
index f1507d849..000000000
--- a/Xprint/ps/psout.c
+++ /dev/null
@@ -1,1638 +0,0 @@
-/* $Xorg: psout.c,v 1.9 2001/03/26 15:25:12 coskrey Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996, 2000 Sun Microsystems, Inc. All Rights Reserved.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: psout.c
-** *
-** * Contents: Code to output PostScript to file
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/psout.c,v 1.12 2001/12/21 21:02:06 dawes Exp $ */
-
-/*
- * For XFree86 3.3.3:
- *
- * As a *quick* way of preventing some buffers overflowing onto the stack,
- * they have been made static. There are potential problems with
- * PsOutRec.Buf overflowing too which should be investigated as part of a
- * review of this code, but that is at least always allocated with malloc
- * and shouldn't pose an immediate stack trashing problem.
- *
- */
-
-#include <stdlib.h>
-#include "os.h"
-#include "Ps.h"
-#include "psout.h"
-
-typedef void *voidPtr;
-
-typedef struct PsPatRec_
-{
- PsFillEnum type;
- voidPtr tag;
-} PsPatRec;
-
-typedef PsPatRec *PsPatPtr;
-
-typedef struct PsOutRec_
-{
- FILE *Fp;
- char Buf[256];
- int CurColor;
- int LineWidth;
- PsCapEnum LineCap;
- PsJoinEnum LineJoin;
- int NDashes;
- int *Dashes;
- int DashOffset;
- int LineBClr;
- PsRuleEnum FillRule;
- char *FontName;
- int FontSize;
- float FontMtx[4];
- int ImageFormat;
- int RevImage;
- int NPatterns;
- int MxPatterns;
- PsPatPtr Patterns;
- int ClipType;
- PsClipRec Clip;
- int InFrame;
- int XOff;
- int YOff;
-
- PsFillEnum InTile;
- int ImgSkip;
- int ImgBClr;
- int ImgFClr;
- int ImgX;
- int ImgY;
- int ImgW;
- int ImgH;
- int SclW;
- int SclH;
-
- int NDownloads;
- int MxDownloads;
- char **Downloads;
- Bool isRaw;
-
- int start_image;
-} PsOutRec;
-
-/*
- * Standard definitions
- */
-
-static char *S_StandardDefs = "\
-/d{def}bind def\
-/b{bind}bind d\
-/bd{b d}b d\
-/x{exch}bd\
-/xd{x d}bd\
-/dp{dup}bd\
-/t{true}bd\
-/f{false}bd\
-/p{pop}bd\
-/r{roll}bd\
-/c{copy}bd\
-/i{index}bd\
-/rp{repeat}bd\
-/n{newpath}bd\
-/w{setlinewidth}bd\
-/lc{setlinecap}bd\
-/lj{setlinejoin}bd\
-/sml{setmiterlimit}bd\
-/ds{setdash}bd\
-/ie{ifelse}bd\
-/len{length}bd\
-/m{moveto}bd\
-/l{lineto}bd\
-/rl{rlineto}bd\
-/a{arc}bd\
-/an{arcn}bd\
-/st{stroke}bd\
-/fl{fill}bd\
-/ef{eofill}bd\
-/sp{showpage}bd\
-/cp{closepath}bd\
-/clp{clippath}bd\
-/cl{clip}bd\
-/pb{pathbbox}bd\
-/tr{translate}bd\
-/rt{rotate}bd\
-/dv{div}bd\
-/ml{mul}bd\
-/ad{add}bd\
-/ng{neg}bd\
-/scl{scale}bd\
-/sc{setrgbcolor}bd\
-/g{setgray}bd\
-/gs{gsave}bd\
-/gr{grestore}bd\
-/sv{save}bd\
-/rs{restore}bd\
-/mx{matrix}bd\
-/cm{currentmatrix}bd\
-/sm{setmatrix}bd\
-/ccm{concatmatrix}bd\
-/cc{concat}bd\
-/ff{findfont}bd\
-/mf{makefont}bd\
-/sf{setfont}bd\
-/cft{currentfont}bd\
-/fd{FontDirectory}bd\
-/sh{show}bd\
-/stw{stringwidth}bd\
-/ci{colorimage}bd\
-/ig{image}bd\
-/im{imagemask}bd\
-/cf{currentfile}bd\
-/rh{readhexstring}bd\
-/str{string}bd\
-/al{aload}bd\
-/wh{where}bd\
-/kn{known}bd\
-/stp{stopped}bd\
-/bg{begin}bd\
-/ed{end}bd\
-/fa{forall}bd\
-/pi{putinterval}bd\
-/mk{mark}bd\
-/ctm{cleartomark}bd\
-/df{definefont}bd\
-/cd{currentdict}bd\
-/db{20 dict dp bg}bd\
-/de{ed}bd\
-/languagelevel wh{p languagelevel}{1}ie\
- 1 eq{/makepattern{p}bd/setpattern{p}bd/setpagedevice{p}bd}if\
-/mp{makepattern}bd\
-/spt{setpattern}bd\
-/spd{setpagedevice}bd\
-";
-
-/*
- * Composite definitions
- *
- *
- * XYr - Return X/Y dpi for device
- *
- * XYr <xdpi> <ydpi>
- *
- * Cs - Coordinate setup (for origin upper left)
- *
- * <orient(0,1,2,3)> Cs
- *
- * P - Draw a point
- *
- * <x> <y> P
- *
- * R - Add rectangle to path
- *
- * <x> <y> <w> <h> R
- *
- * Ac - Add arc to path
- *
- * <x> <y> <w> <h> <ang1> <ang2> Ac
- *
- * An - Add arc to path (counterclockwise)
- *
- * <x> <y> <w> <h> <ang1> <ang2> An
- *
- * Tf - Set font
- *
- * <font_name> <size> <iso> Tf
- *
- * Tfm - Set font with matrix
- *
- * <font_name> <matrix> <iso> Tfm
- *
- * T - Draw text
- *
- * <text> <x> <y> T
- *
- * Tb - Draw text with background color
- *
- * <text> <x> <y> <bg_red> <bg_green> <bg_blue> Tb
- *
- * Im1 - Image 1 bit monochrome imagemask
- *
- * <x> <y> <w> <h> <sw> <sh> Im1
- *
- * Im24 - Image 24 bit RGB color
- *
- * <x> <y> <w> <h> <sw> <sh> Im24
- *
- * Im1t - Image 1 bit monochrome imagemask (in tile)
- *
- * <data> <x> <y> <w> <h> <sw> <sh> Im1t
- *
- * Im24t - Image 24 bit RGB color (in tile)
- *
- * <data> <x> <y> <w> <h> <sw> <sh> Im24t
- */
-
-static char *S_CompositeDefs = "\
-/XYr{/currentpagedevice wh\
- {p currentpagedevice dp /HWResolution kn\
- {/HWResolution get al p}{p 300 300}ie}{300 300}ie}bd\
-/Cs{dp 0 eq{0 pHt tr XYr -1 x dv 72 ml x 1 x dv 72 ml x scl}if\
- dp 1 eq{90 rt XYr -1 x dv 72 ml x 1 x dv 72 ml x scl}if\
- dp 2 eq{pWd 0 tr XYr 1 x dv 72 ml x -1 x dv 72 ml x scl}if\
- 3 eq{pHt pWd tr 90 rt XYr 1 x dv 72 ml x -1 x dv 72 ml x scl}if}bd\
-/P{gs 1 w [] 0 ds 2 c m .1 ad x .1 ad x l st gr}bd\
-/R{4 2 r m 1 i 0 rl 0 x rl ng 0 rl cp}bd\
-/Ac{mx_ cm p 6 -2 r tr 4 2 r ng scl 0 0 .5 5 3 r a mx_ sm}bd\
-/An{mx_ cm p 6 -2 r tr 4 2 r ng scl 0 0 .5 5 3 r an mx_ sm}bd\
-/ISO{dp len dict bg{1 i/FID ne{d}{p p}ie}fa\
- /Encoding ISOLatin1Encoding d cd ed df}bd\
-/iN{dp len str cvs dp len x 1 i 3 ad str 2 c c p x p dp 3 -1 r(ISO)pi}bd\
-/Tp{{x dp iN dp fd x kn{x p dp/f_ x d ff}{dp/f_ x d x ff ISO}ie x}\
- {x dp/f_ x d ff x}ie}bd\
-/Tf{Tp[x 0 0 2 i ng 0 0] dp/fm_ x d mf sf}bd\
-/Tfm{Tp 1 -1 tm1_ scl tm2_ ccm dp/fm_ x d mf sf}bd\
-/T{m sh}bd\
-/Tb{gs sc f_ ff sf cft/FontMatrix get 3 get\
- cft/FontBBox get dp 1 get x 3 get 2 i ml 3 1 r ml\
- 0 0 m 4 i stw p 4 i 4 i m fm_ cc\
- 0 2 i rl dp 0 rl 0 2 i ng rl 0 3 i rl ng 0 rl cp fl p p\
- gr T}bd\
-/Im1{6 4 r tr scl t [3 i 0 0 5 i 0 0]{cf str1 rh p} im}bd\
-/Im1rev{6 4 r tr scl f [3 i 0 0 5 i 0 0]{cf str1 rh p} im}bd\
-/Im24{gs 6 4 r tr scl 8 [3 i 0 0 5 i 0 0]{cf str3 rh p} f 3 ci}bd\
-/Im1t{6 4 r tr scl t [3 i 0 0 5 i 0 0]{} im}bd\
-/Im24t{gs 6 4 r tr scl 8 [3 i 0 0 5 i 0 0]{} f 3 ci}bd\
-/ck2{/currentpagedevice wh \
-{p dp currentpagedevice dp 3 -1 r kn \
-{x get al p 3 -1 r eq 3 1 r eq and } \
-{p p p p t}ie} \
-{p p p t}ie}bd \
-/ck1{/currentpagedevice wh \
-{p dp currentpagedevice dp 3 -1 r kn \
-{x get eq} {p p p t}ie} \
-{p p t}ie}bd \
-/mtx{scl t [3 i 0 0 5 i 0 0]}bd \
-";
-
-int pagenum = 0;
-char *pg_orient[] = {"Portrait","Landscape","Reverse Portrait","Reverse Landscape"};
-/*
- * Setup definitions
- */
-
-static char *S_SetupDefs = "\
- /mx_ mx d\
- /im_ mx d\
- /tm1_ mx d\
- /tm2_ mx d\
- /str3 3 str d\
- /str1 1 str d\
-";
-
-/*******************************************************************
- * PRIVATE FUNCTIONS *
- *******************************************************************/
-
-static void
-S_Flush(PsOutPtr self)
-{
- if( self->Buf[0] )
- {
- if( self->Buf[strlen(self->Buf)-1]!='\n' ) strcat(self->Buf, "\n");
-
- if (!ferror(self->Fp)) {
- (void) fputs(self->Buf, self->Fp);
- }
-
- self->Buf[0] = '\0';
- }
-}
-
-static void
-S_Comment(PsOutPtr self, char *comment)
-{
- S_Flush(self);
- strcpy(self->Buf, comment);
- S_Flush(self);
-}
-
-static void
-S_OutDefs(PsOutPtr self, char *defs)
-{
- int i, k=0;
- S_Flush(self);
- memset(self->Buf, 0, 256);
- for( i=0 ; defs[i]!='\0' ;)
- {
- if( k>70 && (i==0 || (i && defs[i-1]!='/')) &&
- (defs[i]==' ' || defs[i]=='/' || defs[i]=='{') )
- {
- S_Flush(self);
- k = 0;
- memset(self->Buf, 0, 256);
- }
- if( k && self->Buf[k-1]==' ' && defs[i]==' ' ) { i++; continue; }
- self->Buf[k] = defs[i];
- k++; i++;
- }
- S_Flush(self);
-}
-
-static void
-S_OutNum(PsOutPtr self, float num)
-{
- int i;
- static char buf[64];
- sprintf(buf, "%.3f", num);
- for( i=strlen(buf)-1 ; buf[i]=='0' ; i-- ); buf[i+1] = '\0';
- if( buf[strlen(buf)-1]=='.' ) buf[strlen(buf)-1] = '\0';
- if( self->Buf[0] ) strcat(self->Buf, " ");
- strcat(self->Buf, buf);
- if( strlen(self->Buf)>70 ) S_Flush(self);
-}
-
-static void
-S_OutStr(PsOutPtr self, char *txt, int txtl)
-{
- int i, k;
- static char buf[512];
- for( i=0,k=0 ; i<txtl ; i++ )
- {
- if( (txt[i]>=' ' && txt[i]<='~') &&
- txt[i]!='(' && txt[i]!=')' && txt[i]!='\\' )
- { buf[k] = txt[i]; k++; continue; }
- buf[k] = '\\'; k++;
- sprintf(&buf[k], "%03o", txt[i]&0xFF);
- k += 3;
- }
- strcat(self->Buf, "(");
- i = strlen(self->Buf);
- memcpy(&self->Buf[i], buf, k);
- self->Buf[i+k] = '\0';
- strcat(self->Buf, ")");
- if( strlen(self->Buf)>70 ) S_Flush(self);
-}
-
-static void
-S_OutTok(PsOutPtr self, char *tok, int cr)
-{
- if( self->Buf[0] ) strcat(self->Buf, " ");
- strcat(self->Buf, tok);
- if( cr ) S_Flush(self);
-}
-
-static void
-S_Color(PsOutPtr self, int clr)
-{
- int ir, ig, ib;
- ir = clr>>16; ig = (clr>>8)&0xFF; ib = clr&0xFF;
- if( ir==ig && ig==ib )
- { S_OutNum(self, (float)ir/255.); S_OutTok(self, "g", 1); }
- else
- {
- S_OutNum(self, (float)ir/255.);
- S_OutNum(self, (float)ig/255.);
- S_OutNum(self, (float)ib/255.);
- S_OutTok(self, "sc", 1);
- }
-}
-
-static void
-S_SetPageDevice(PsOutPtr self, int orient, int count, int plex, int res,
- int wd, int ht, int isPage)
-{
- float fwd = ((float)wd/(float)res)*72.;
- float fht = ((float)ht/(float)res)*72.;
-
- S_OutTok(self, "/pWd", 0);
- S_OutNum(self, fwd);
- S_OutTok(self, "d /pHt", 0);
- S_OutNum(self, fht);
- S_OutTok(self, "d", 1);
-
- /*
- * if these are page attributes, have PostScript check to see if they
- * have changed. If not, don't do setpagedevice, since it will cause
- * a page flush and screw up duplex printing. Having PostScript check
- * means we don't have to keep track ourselves.
- */
- if(isPage) {
- S_OutNum(self, (float) orient);
- S_OutTok(self, "/Orientation ck1", 0);
- S_OutTok(self, "pWd pHt /PageSize ck2 and not {", 1);
- }
- S_OutTok(self, "{db", 0);
-
- S_OutTok(self, "/Orientation", 0);
- S_OutNum(self, (float) orient);
- S_OutTok(self, " d ", 0);
- S_OutTok(self, "/PageSize [pWd pHt] d", 0);
-
- S_OutTok(self, " de spd", 0);
- /*
- * save a flag to show if we failed to set orientation... determined
- * by both/either Orientation and/or PageSize, use this
- * later to set/not set orientation using Cs command.
- */
- S_OutTok(self,"}stp /orientationFailed x d", 1);
- /*
- * if these are page attributes, have PostScript check to see if they
- * have changed. If not, don't do setpagedevice, since it will cause
- * a page flush and screw up duplex printing. Having PostScript check
- * means we don't have to keep track ourselves.
- */
- if(isPage)
- {
- S_OutTok(self,"}if",1);
-
- S_OutTok(self, (plex==0)?"f":"t", 0);
- S_OutTok(self, "/Duplex ck1 ", 0);
-
- S_OutTok(self, (plex==2)?"t":"f", 0);
- S_OutTok(self, "/Tumble ck1 and ", 0);
-
-
- S_OutNum(self, (float)res);
- S_OutNum(self, (float)res);
- S_OutTok(self, " /HWResolution ck2 and", 0);
-
- if( count>1 )
- {
- S_OutNum(self, (float)count);
- S_OutTok(self, " /NumCopies", 0);
- S_OutTok(self, " ck1 and ", 0);
- }
- S_OutTok(self," not {",1);
- }
- S_OutTok(self, "{db", 0);
-
- S_OutTok(self, "/Duplex ", 0);
- S_OutTok(self, (plex==0)?"f":"t", 0);
- S_OutTok(self, " d ", 0);
-
- S_OutTok(self, "/Tumble ", 0);
- S_OutTok(self, (plex==2)?"t":"f", 0);
- S_OutTok(self, " d ", 0);
-
- S_OutTok(self, " /HWResolution [", 0);
- S_OutNum(self, (float)res);
- S_OutNum(self, (float)res);
- S_OutTok(self, "] d ", 0);
-
- if( count>1 )
- {
- S_OutTok(self, " /NumCopies", 0);
- S_OutNum(self, (float)count);
- S_OutTok(self, " d ", 0);
- }
- S_OutTok(self, " de spd}stp p", 1);
-
- if(isPage)
- {
- S_OutTok(self, "}if", 1);
- }
-}
-
-/*******************************************************************
- * PUBLIC FUNCTIONS *
- *******************************************************************/
-
-FILE *
-PsOut_ChangeFile(PsOutPtr self, FILE *fp)
-{
- FILE *nfp;
-
- nfp = self->Fp;
-
- self->Fp = fp;
-
- return nfp;
-}
-
-PsOutPtr
-PsOut_BeginFile(FILE *fp, int orient, int count, int plex, int res,
- int wd, int ht, Bool raw)
-{
- int i;
-/*
- * Get ready to output PostScript header
- */
- PsOutPtr psout;
- psout = (PsOutPtr)xalloc(sizeof(PsOutRec));
- memset(psout, 0, sizeof(PsOutRec));
- psout->Fp = fp;
- psout->isRaw = raw;
- pagenum = 0;
-
- if (!raw) {
-/*
- * Output PostScript header
- */
- S_Comment(psout, "%!PS-Adobe-3.0 EPSF-3.0");
- S_Comment(psout, "%%Creator: The Open Group PostScript Print Server");
- /*### BoundingBox ###*/
- S_Comment(psout, "%%EndComments");
- S_Comment(psout, "%%BeginProlog");
- S_Comment(psout, "%%BeginProcSet: XServer_PS_Functions");
- S_OutDefs(psout, S_StandardDefs);
- S_OutDefs(psout, S_CompositeDefs);
- S_Comment(psout, "%%EndProcSet");
- S_Comment(psout, "%%EndProlog");
- S_Comment(psout, "%%BeginSetup");
- /* set document level page attributes */
- S_SetPageDevice(psout, orient, count, plex, res, wd, ht, 0);
- S_Comment(psout, "%%Pages: atend");
- S_OutDefs(psout, S_SetupDefs);
- S_Comment(psout, "%%EndSetup");
- }
-/*
- * Initialize the structure
- */
- psout->CurColor = 0xFFFFFFFF;
- psout->LineWidth = 1;
- psout->LineCap = PsCButt;
- psout->LineJoin = PsJMiter;
- psout->NDashes = 0;
- psout->Dashes = (int *)0;
- psout->FontName = (char *)0;
- psout->FontSize = 0;
- psout->start_image = 0;
- for( i=0 ; i<4 ; i++ ) psout->FontMtx[i] = 0.;
- psout->ImageFormat = 0;
- return(psout);
-}
-
-void
-PsOut_EndFile(PsOutPtr self, int closeFile)
-{
- char coms[50];
- int i;
-
- if (!self->isRaw) {
- S_Comment(self,"%%Trailer");
- sprintf(coms,"%%%%Pages: %d",pagenum);
- S_Comment(self, coms);
- S_Comment(self, "%%EOF");
- }
- if( self->NDashes && self->Dashes ) xfree(self->Dashes);
- if( self->FontName ) xfree(self->FontName);
- if( self->Patterns ) xfree(self->Patterns);
- if( self->Clip.rects ) xfree(self->Clip.rects);
- if( closeFile ) fclose(self->Fp);
- for( i=0 ; i<self->NDownloads ; i++ ) xfree(self->Downloads[i]);
- if( self->Downloads ) xfree(self->Downloads);
- pagenum = 0; /* reset page num back to 0 */
- xfree(self);
-}
-
-void
-PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex, int res,
- int wd, int ht)
-{
- char coms[50];
-
-/*** comment for pagenumbers *****/
-
- S_Comment(self,"%%PageHeader");
- pagenum++;
- sprintf(coms,"%%%%Page: %d %d",pagenum,pagenum);
- S_Comment(self, coms);
- sprintf(coms,"%%%%PageOrientation: %s",pg_orient[orient]);
- S_Comment(self, coms);
-
-/*** end comment *****************/
-
- /* set page level page attributes */
- S_SetPageDevice(self, orient, count, plex, res, wd, ht, 1);
-
- S_OutTok(self, "gs ", 0);
- /*
- * check to see if we set orientation already; if it wasn't set,
- * use Cs to set orientation here.
- */
- S_OutNum(self, (float)orient);
- S_OutTok(self, "orientationFailed { ", 0);
- S_OutNum(self, (float)orient);
- S_OutTok(self, " } { 0 }ie Cs 100 sml gs", 1);
-}
-
-void
-PsOut_EndPage(PsOutPtr self)
-{
- S_OutTok(self, "gr gr sp", 1);
-
- /* did grestore: mark attributes 'dirty' so they will be re-sent */
- PsOut_DirtyAttributes(self);
-
-/*** comment for pagenumbers *****/
-
- S_Comment(self,"%%PageTrailer");
-
-/*** end comment *****************/
-}
-
-void
-PsOut_DirtyAttributes(PsOutPtr self)
-{
- int i;
- self->CurColor = 0xFFFFFFFF;
- self->LineWidth = -1;
- self->LineCap = (PsCapEnum)-1;
- self->LineJoin = (PsJoinEnum)-1;
- self->NDashes = -1;
- self->FontSize = -1;
- for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.;
- if( self->Dashes ) { xfree(self->Dashes); self->Dashes = (int *)0; }
- if( self->FontName ) { xfree(self->FontName); self->FontName = (char *)0; }
-}
-
-void
-PsOut_Comment(PsOutPtr self, char *comment)
-{
- S_Comment(self, comment);
-}
-
-void
-PsOut_Offset(PsOutPtr self, int x, int y)
-{
- self->XOff = x;
- self->YOff = y;
-}
-
-void
-PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf)
-{
- int i, k;
- int changed = 0;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InTile ) return;
- if( self->InFrame ) xo = yo = 0;
- if( clpTyp!=self->ClipType ) changed = 1;
- else
- {
- if( clpinf->nRects!=self->Clip.nRects ) changed = 1;
- else
- {
- if( clpinf->nOutterClips!=self->Clip.nOutterClips ) changed = 1;
- else
- {
- for( i=0 ; i<clpinf->nOutterClips ; i++ )
- {
- if( memcmp(&clpinf->outterClips[i], &self->Clip.outterClips[i],
- sizeof(PsRectRec))!=0 ) break;
- }
- if( i<clpinf->nOutterClips ) changed = 1;
- else
- {
- for( i=0 ; i<clpinf->nRects ; i++ )
- {
- if( memcmp(&clpinf->rects[i], &self->Clip.rects[i],
- sizeof(PsRectRec))!=0 ) { changed = 1; break; }
- }
- }
- }
- }
- if( clpinf->nElms!=self->Clip.nElms ) changed = 1;
- else
- {
- for( i=0 ; i<clpinf->nElms ; i++ )
- {
- if( clpinf->elms[i].type!=PSOUT_POINTS )
- {
- if( memcmp(&clpinf->elms[i], &self->Clip.elms[i],
- sizeof(PsElmRec))!=0 ) { changed = 1; break; }
- }
- else
- {
- if( clpinf->elms[i].type!=self->Clip.elms[i].type ||
- clpinf->elms[i].nPoints!=self->Clip.elms[i].nPoints )
- { changed = 1; break; }
- else
- {
- for( k=0 ; k<clpinf->elms[i].nPoints ; k++ )
- {
- if( memcmp(&clpinf->elms[i].c.points[k],
- &self->Clip.elms[i].c.points[k], sizeof(PsPointRec)) )
- { changed = 1; break; }
- }
- if( changed ) break;
- }
- }
- }
- }
- }
-
- if( self->Clip.rects ) xfree(self->Clip.rects);
- if( self->Clip.outterClips ) xfree(self->Clip.outterClips);
- if( self->Clip.elms )
- PsDestroyFillElementList(self->Clip.nElms, self->Clip.elms);
- self->ClipType = clpTyp;
- self->Clip.nRects = clpinf->nRects;
- self->Clip.nElms = clpinf->nElms;
- self->Clip.nOutterClips = clpinf->nOutterClips;
- if( clpinf->nRects )
- {
- self->Clip.rects = (PsRectPtr)xalloc(clpinf->nRects*sizeof(PsRectRec));
- memcpy(self->Clip.rects, clpinf->rects, clpinf->nRects*sizeof(PsRectRec));
- }
- else self->Clip.rects = 0;
- if( clpinf->nOutterClips )
- {
- self->Clip.outterClips = (PsRectPtr)xalloc(clpinf->nOutterClips*
- sizeof(PsRectRec));
- memcpy(self->Clip.outterClips, clpinf->outterClips,
- clpinf->nOutterClips*sizeof(PsRectRec));
- }
- else self->Clip.outterClips = 0;
- if( clpinf->nElms )
- self->Clip.elms = PsCloneFillElementList(clpinf->nElms, clpinf->elms);
- else self->Clip.elms = 0;
-
- PsOut_DirtyAttributes(self);
- S_OutTok(self, "gr gs", 1);
- if( self->Clip.nOutterClips )
- {
- for( i=0 ; i<self->Clip.nOutterClips ; i++ )
- {
- S_OutNum(self, (float)(self->Clip.outterClips[i].x));
- S_OutNum(self, (float)(self->Clip.outterClips[i].y));
- S_OutNum(self, (float)self->Clip.outterClips[i].w);
- S_OutNum(self, (float)self->Clip.outterClips[i].h);
- S_OutTok(self, "R", 1);
- }
- S_OutTok(self, "cl n", 1);
- }
- if( self->Clip.nRects )
- {
- for( i=0 ; i<self->Clip.nRects ; i++ )
- {
- S_OutNum(self, (float)(self->Clip.rects[i].x+xo));
- S_OutNum(self, (float)(self->Clip.rects[i].y+yo));
- S_OutNum(self, (float)self->Clip.rects[i].w);
- S_OutNum(self, (float)self->Clip.rects[i].h);
- S_OutTok(self, "R", 1);
- }
- S_OutTok(self, "cl n", 1);
- }
- if( self->Clip.nElms )
- {
- PsElmPtr elm = self->Clip.elms;
- for( i=0 ; i<self->Clip.nElms ; i++,elm++ )
- {
- switch(elm->type)
- {
- case PSOUT_POINTS:
- for( k=0 ; k<elm->nPoints ; k++ )
- {
- S_OutNum(self, (float)elm->c.points[k].x+xo);
- S_OutNum(self, (float)elm->c.points[k].y+yo);
- if( k==0 ) S_OutTok(self, "m", 0);
- else S_OutTok(self, "l", 0);
- }
- S_OutTok(self, "cp", 1);
- break;
- case PSOUT_RECT:
- S_OutNum(self, (float)elm->c.rect.x+xo);
- S_OutNum(self, (float)elm->c.rect.y+yo);
- S_OutNum(self, (float)elm->c.rect.w);
- S_OutNum(self, (float)elm->c.rect.h);
- S_OutTok(self, "R", 1);
- break;
- case PSOUT_ARC:
- if( elm->c.arc.style==PsPieSlice )
- {
- S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.);
- S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.);
- S_OutTok(self, "m", 0);
- }
- S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.);
- S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.);
- S_OutNum(self, (float)elm->c.arc.w);
- S_OutNum(self, (float)elm->c.arc.h);
- S_OutNum(self, (float)elm->c.arc.a1/64.);
- S_OutNum(self, (float)elm->c.arc.a1/64.+(float)elm->c.arc.a2/64.);
- if( elm->c.arc.a2<0 ) S_OutTok(self, "An cp", 1);
- else S_OutTok(self, "Ac cp", 1);
- break;
- }
- }
- S_OutTok(self, "cl n", 1);
- }
-}
-
-void
-PsOut_Color(PsOutPtr self, int clr)
-{
- if( clr==self->CurColor || self->InTile>=PsStip ) return;
- self->CurColor = clr;
- S_Color(self, clr);
-}
-
-void
-PsOut_FillRule(PsOutPtr self, PsRuleEnum rule)
-{
- self->FillRule = rule;
-}
-
-void
-PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join,
- int nDsh, int *dsh, int dshOff, int bclr)
-{
- int i;
- int same = 1;
-
- if( wd!=self->LineWidth && wd>=0 )
- {
- if( wd==0 ) wd = 1;
- self->LineWidth = wd;
- S_OutNum(self, (float)wd); S_OutTok(self, "w", 1);
- }
- if( cap!=self->LineCap )
- {
- self->LineCap = cap;
- S_OutNum(self, (float)cap); S_OutTok(self, "lc", 1);
- }
- if( join!=self->LineJoin )
- {
- self->LineJoin = join;
- S_OutNum(self, (float)join); S_OutTok(self, "lj", 1);
- }
- if( nDsh!=self->NDashes ) same = 0;
- else if( dshOff!=self->DashOffset ) same = 0;
- else if( nDsh )
- {
- for( i=0 ; i<nDsh ; i++ )
- { if( dsh[i]!=self->Dashes[i] ) break; }
- if( i<nDsh ) same = 0;
- }
- if( !same )
- {
- if( self->NDashes && self->Dashes )
- { xfree(self->Dashes); self->Dashes = (int *)0; }
- self->NDashes = nDsh;
- self->DashOffset = dshOff;
- if( nDsh ) self->Dashes = (int *)xalloc(sizeof(int)*nDsh);
- S_OutTok(self, "[", 0);
- for( i=0 ; i<nDsh ; i++ )
- {
- self->Dashes[i] = dsh[i];
- S_OutNum(self, (float)dsh[i]);
- }
- S_OutTok(self, "]", 0);
- S_OutNum(self, (float)dshOff);
- S_OutTok(self, "ds", 1);
- }
-
- if( nDsh ) self->LineBClr = bclr; else bclr = -1;
-}
-
-void
-PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso)
-{
- int i;
- static char buf[256];
- if( self->FontName && strcmp(fnam, self->FontName)==0 &&
- siz==self->FontSize ) return;
- if( self->FontName ) xfree(self->FontName);
- self->FontName = (char *)xalloc(strlen(fnam)+1);
- strcpy(self->FontName, fnam);
- self->FontSize = siz;
- for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.;
- strcpy(buf, "/"); strcat(buf, fnam);
- S_OutTok(self, buf, 0);
- S_OutNum(self, (float)siz);
- if( iso ) S_OutTok(self, "t", 0);
- else S_OutTok(self, "f", 0);
- S_OutTok(self, "Tf", 1);
-}
-
-void
-PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso)
-{
- int i;
- static char buf[256];
- if( self->FontName && strcmp(fnam, self->FontName)==0 &&
- mtx[0]==self->FontMtx[0] && mtx[1]==self->FontMtx[1] &&
- mtx[2]==self->FontMtx[2] && mtx[3]==self->FontMtx[3] ) return;
- if( self->FontName ) xfree(self->FontName);
- self->FontName = (char *)xalloc(strlen(fnam)+1);
- strcpy(self->FontName, fnam);
- for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = mtx[i];
- self->FontSize = -1;
- strcpy(buf, "/"); strcat(buf, fnam); strcat(buf, " [");
- S_OutTok(self, buf, 0);
- for( i=0 ; i<4 ; i++ ) S_OutNum(self, mtx[i]);
- S_OutTok(self, "0 0]", 0);
- if( iso ) S_OutTok(self, "t", 0);
- else S_OutTok(self, "f", 0);
- S_OutTok(self, "Tfm", 1);
-}
-
-void
-PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts)
-{
- int i;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- if( nPts<=2 ) return;
- for( i=0 ; i<nPts ; i++ )
- {
- S_OutNum(self, (float)(pts[i].x+xo));
- S_OutNum(self, (float)(pts[i].y+yo));
- if( i==0 ) S_OutTok(self, "m", 0);
- else S_OutTok(self, "l", 0);
- }
- if( self->FillRule==PsEvenOdd ) S_OutTok(self, "cp ef", 1);
- else S_OutTok(self, "cp fl", 1);
-}
-
-void
-PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutTok(self, "R fl", 1);
-}
-
-void
-PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h,
- float ang1, float ang2, PsArcEnum style)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- if( style==PsPieSlice )
- {
- S_OutNum(self, (float)x+(float)w/2.);
- S_OutNum(self, (float)y+(float)h/2.);
- S_OutTok(self, "m", 0);
- }
- S_OutNum(self, (float)x+(float)w/2.);
- S_OutNum(self, (float)y+(float)h/2.);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutNum(self, ang1);
- S_OutNum(self, ang1+ang2);
- if( ang2<0 ) S_OutTok(self, "An cp fl", 1);
- else S_OutTok(self, "Ac cp fl", 1);
-}
-
-void
-PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts)
-{
- int i;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- if( nPts<1 ) return;
- for( i=0 ; i<nPts ; i++ )
- {
- S_OutNum(self, (float)(pts[i].x+xo));
- S_OutNum(self, (float)(pts[i].y+yo));
- if( i==0 ) S_OutTok(self, "m", 0);
- else S_OutTok(self, "l", 0);
- }
- if( self->LineBClr>=0 )
- {
- S_OutTok(self, "gs", 0);
- S_Color(self, self->LineBClr);
- S_OutTok(self, "[] 0 ds st gr", 0);
- }
- S_OutTok(self, "st", 1);
-}
-
-void
-PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts)
-{
- int i;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- if( nPts<1 ) return;
- for( i=0 ; i<nPts ; i++ )
- {
- S_OutNum(self, (float)(pts[i].x+xo));
- S_OutNum(self, (float)(pts[i].y+yo));
- S_OutTok(self, "P", 1);
- }
-}
-
-void
-PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutTok(self, "R", 0);
- if( self->LineBClr>=0 )
- {
- S_OutTok(self, "gs", 0);
- S_Color(self, self->LineBClr);
- S_OutTok(self, "[] 0 ds st gr", 0);
- }
- S_OutTok(self, "st", 1);
-}
-
-void
-PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
- float ang1, float ang2)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- S_OutNum(self, (float)x+(float)w/2.);
- S_OutNum(self, (float)y+(float)h/2.);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutNum(self, ang1);
- S_OutNum(self, ang1+ang2);
- if( ang2<0 ) S_OutTok(self, "An", 0);
- else S_OutTok(self, "Ac", 0);
- if( self->LineBClr>=0 )
- {
- S_OutTok(self, "gs", 0);
- S_Color(self, self->LineBClr);
- S_OutTok(self, "[] 0 ds st gr", 0);
- }
- S_OutTok(self, "st", 1);
-}
-
-void
-PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, int bclr)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- S_OutStr(self, text, textl);
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
- if( bclr<0 ) S_OutTok(self, "T", 1);
- else
- {
- int ir = bclr>>16;
- int ig = (bclr>>8)&0xFF;
- int ib = bclr&0xFF;
- S_OutNum(self, (float)ir/255.);
- S_OutNum(self, (float)ig/255.);
- S_OutNum(self, (float)ib/255.);
- S_OutTok(self, "Tb", 1);
- }
-}
-
-#ifdef BM_CACHE
-void /* new */
-PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, int bclr, int fclr)
-{
- char cacheID[10];
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- sprintf(cacheID, "c%ldi", cache_id);
-
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
-
- if( fclr==0xFFFFFF )
- {
- int ir, ig, ib;
- ir = bclr>>16; ig = (bclr>>8)&0xFF; ib = bclr&0xFF;
- if( ir==ig && ig==ib )
- S_OutNum(self, (float)ir/255.);
- else
- S_OutNum(self, (float)0);
- self->RevImage = 1;
- }
- else
- {
- int ir, ig, ib;
- ir = fclr>>16; ig = (fclr>>8)&0xFF; ib = fclr&0xFF;
- if( ir==ig && ig==ib )
- S_OutNum(self, (float)ir/255.);
- else
- S_OutNum(self, (float)0);
- }
-
- S_OutTok(self, cacheID, 1);
-} /* new */
-
-void /* new */
-PsOut_BeginImageCache(PsOutPtr self, long cache_id)
-{
- char cacheID[10];
-
- sprintf(cacheID, "/c%ldi {", cache_id);
-
- S_OutTok(self, cacheID, 0);
-} /* new */
-
-void /* new */
-PsOut_EndImageCache(PsOutPtr self)
-{
- S_OutTok(self, "}bd", 1);
-} /* new */
-#endif
-
-void
-PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
- int w, int h, int sw, int sh, int format)
-{
- int savClr = self->CurColor;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- if( self->InTile )
- {
- if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; }
- self->ImgBClr = bclr; self->ImgFClr = fclr;
- self->ImgX = x; self->ImgY = y;
- self->ImgW = w; self->ImgH = h;
- self->SclW = sw; self->SclH = sh;
- S_OutTok(self, "<", 0);
- self->ImageFormat = format;
- self->RevImage = 0;
- if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF )
- self->RevImage = 1;
- return;
- }
-
- self->RevImage = 0;
- if( format==1 )
- {
- S_OutTok(self, "gs", 0);
- if( fclr==0xFFFFFF )
- {
- PsOut_Color(self, fclr);
- PsOut_FillRect(self, x, y, sw, sh);
- PsOut_Color(self, bclr);
- self->RevImage = 1;
- }
- else
- {
- PsOut_Color(self, bclr);
- PsOut_FillRect(self, x, y, sw, sh);
- PsOut_Color(self, fclr);
- }
- }
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutNum(self, (float)sw);
- S_OutNum(self, (float)sh);
- if( format==1 ) {
- if(self->RevImage)
- S_OutTok(self, "Im1rev", 1);
- else
- S_OutTok(self, "Im1", 1);
- }
- else S_OutTok(self, "Im24", 1);
- self->ImageFormat = format;
- self->CurColor = savClr;
-}
-
-void
-PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
- int w, int h, int sw, int sh, int format)
-{
- int savClr = self->CurColor;
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame || self->InTile ) xo = yo = 0;
- x += xo; y += yo;
- if( self->InTile )
- {
- if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; }
- self->ImgBClr = bclr; self->ImgFClr = fclr;
- self->ImgX = x; self->ImgY = y;
- self->ImgW = w; self->ImgH = h;
- self->SclW = sw; self->SclH = sh;
- S_OutTok(self, "<", 0);
- self->ImageFormat = format;
- self->RevImage = 0;
- if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF )
- self->RevImage = 1;
- return;
- }
-
- self->RevImage = 0;
- if( format==1 )
- {
- S_OutTok(self, "gs", 0);
-#ifdef BM_CACHE
- S_OutTok(self, "g", 1);
-#else
- if( fclr==0xFFFFFF )
- {
- PsOut_Color(self, bclr);
- self->RevImage = 1;
- }
- else
- {
- PsOut_Color(self, fclr);
- }
-#endif
- }
-
-#ifdef BM_CACHE
- S_OutTok(self, "tr", 0); /* new */
-#else
- S_OutNum(self, (float)x);
- S_OutNum(self, (float)y);
-#endif
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutNum(self, (float)sw);
- S_OutNum(self, (float)sh);
-#ifdef BM_CACHE
- S_OutTok(self, "mtx", 1); /* new */
- S_OutTok(self, "<", 0); /* new */
- self->start_image = 1;
-#else
- if( format==1 ){
- if(self->RevImage)
- S_OutTok(self, "Im1rev", 1);
- else
- S_OutTok(self, "Im1", 1);
- }
- else S_OutTok(self, "Im24", 1);
-#endif
- self->ImageFormat = format;
- self->CurColor = savClr;
-}
-
-void
-PsOut_EndImage(PsOutPtr self)
-{
- if( self->ImgSkip ) { self->ImgSkip = 0; return; }
- if( self->InTile )
- {
- S_OutTok(self, ">", 1);
- if( self->ImageFormat==1 && self->InTile==PsTile )
- {
- if( self->ImgFClr==0xFFFFFF )
- {
- PsOut_Color(self, self->ImgFClr);
- PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH);
- PsOut_Color(self, self->ImgBClr);
- }
- else
- {
- PsOut_Color(self, self->ImgBClr);
- PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH);
- PsOut_Color(self, self->ImgFClr);
- }
- }
- S_OutNum(self, (float)self->ImgX);
- S_OutNum(self, (float)self->ImgY);
- S_OutNum(self, (float)self->ImgW);
- S_OutNum(self, (float)self->ImgH);
- S_OutNum(self, (float)self->SclW);
- S_OutNum(self, (float)self->SclH);
- if( self->ImageFormat==1 ) S_OutTok(self, "Im1t", 1);
- else S_OutTok(self, "Im24t", 1);
- self->ImageFormat = 0;
- self->RevImage = 0;
- return;
- }
-
-#ifdef BM_CACHE
- if(self->start_image)
- S_OutTok(self, "> im", 1); /* new */
-#endif
- self->ImageFormat = 0;
- self->RevImage = 0;
- S_Flush(self);
-#ifdef BM_CACHE
- if(self->start_image)
- {
- self->start_image = 0;
- S_OutTok(self, "gr", 0);
- }
- else
- S_OutTok(self, "gr", 1);
-#else
- S_OutTok(self, "gr", 1);
-#endif
-}
-
-void
-PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes)
-{
- int i;
- char buf[5];
-
- if( (!self->ImageFormat) || self->ImgSkip ) return;
- for( i=0 ; i<nBytes ; i++ )
- {
- if( self->RevImage ) sprintf(buf, "%02x", (int)(bytes[i]^0xFF)&0xFF);
- else sprintf(buf, "%02x", (int)bytes[i]&0xFF);
- strcat(self->Buf, buf);
- if( strlen(self->Buf)>70 ) S_Flush(self);
- }
-}
-
-void
-PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y,
- int w, int h)
-{
- int xo = self->XOff;
- int yo = self->YOff;
-
- if( self->InFrame ) xo = yo = 0;
- S_OutTok(self, "gs", 0);
- S_OutNum(self, (float)(x+xo));
- S_OutNum(self, (float)(y+yo));
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutTok(self, "R cl n", 0);
- xoff += xo; yoff += yo;
- if( xoff || yoff )
- {
- S_OutNum(self, (float)xoff);
- S_OutNum(self, (float)yoff);
- S_OutTok(self, "tr", 0);
- }
- S_OutTok(self, "gs", 1);
- self->InFrame += 1;
-}
-
-void
-PsOut_EndFrame(PsOutPtr self)
-{
- self->InFrame -= 1;
- if( self->InFrame<0 ) self->InFrame = 0;
- S_OutTok(self, "gr gr", 1);
- PsOut_DirtyAttributes(self);
-}
-
-int
-PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, PsFillEnum type,
- int bclr, int fclr)
-{
- int i;
- char key[64];
-
- for( i=0 ; i<self->NPatterns ; i++ )
- { if( self->Patterns[i].tag==tag && self->Patterns[i].type==type ) break; }
- if( i<self->NPatterns ) return(1);
- if( (self->NPatterns+1)>self->MxPatterns )
- {
- if( self->Patterns )
- {
- self->MxPatterns *= 2;
- self->Patterns =
- (PsPatPtr)xrealloc(self->Patterns, sizeof(PsPatRec)*self->MxPatterns);
- }
- else
- {
- self->MxPatterns = 64;
- self->Patterns = (PsPatPtr)xalloc(sizeof(PsPatRec)*self->MxPatterns);
- }
- }
- self->Patterns[self->NPatterns].tag = tag;
- self->Patterns[self->NPatterns].type = type;
- sprintf(key, "/ %ld", (long)tag);
- switch(type) {
- case PsTile: key[1] = 't'; break;
- case PsStip: key[1] = 's'; break;
- case PsOpStip: key[1] = 'o'; break;
- default: break;
- }
- S_OutTok(self, key, 0);
- S_OutTok(self, "db/PatternType 1 d/PaintType 1 d", 0);
- S_OutTok(self, "/TilingType 1 d/BBox[0 0", 0);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutTok(self, "]d/XStep", 0);
- S_OutNum(self, (float)w);
- S_OutTok(self, "d/YStep", 0);
- S_OutNum(self, (float)h);
- S_OutTok(self, "d/PaintProc{bg sv", 1);
- if( type==PsOpStip )
- {
- S_Color(self, bclr);
- S_OutTok(self, "0 0", 0);
- S_OutNum(self, (float)w);
- S_OutNum(self, (float)h);
- S_OutTok(self, "R fl", 1);
- }
- if( type!=PsTile ) S_Color(self, fclr);
- self->NPatterns += 1;
- self->InTile = type;
- return(0);
-}
-
-void
-PsOut_EndPattern(PsOutPtr self)
-{
- self->InTile = PsSolid;
- S_OutTok(self, "rs ed}d de im_ mp d", 1);
-}
-
-void
-PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type)
-{
- int i;
- char key[64];
-
- for( i=0 ; i<self->NPatterns ; i++ )
- { if( tag==self->Patterns[i].tag && type==self->Patterns[i].type ) break; }
- if( i>=self->NPatterns ) return;
- sprintf(key, " %ld", (long)tag);
- switch(type) {
- case PsTile: key[0] = 't'; break;
- case PsStip: key[0] = 's'; break;
- case PsOpStip: key[0] = 'o'; break;
- default: break;
- }
- S_OutTok(self, key, 0);
- S_OutTok(self, "spt", 1);
- self->CurColor = 0xFFFFFFFF;
-}
-
-void
-PsOut_RawData(PsOutPtr self, char *data, int len)
-{
- S_Flush(self);
- if (!ferror(self->Fp)) {
- (void) fwrite(data, 1, len, self->Fp);
- }
-}
-
-void
-PsOut_DownloadType1(PsOutPtr self, char *name, char *fname)
-{
- int i;
- int stt;
- static char buf[256];
- FILE *fp;
-
- for( i=0 ; i<self->NDownloads ; i++ )
- { if( strcmp(name, self->Downloads[i])==0 ) break; }
- if( i<self->NDownloads ) return;
-
- if( (self->NDownloads+1)>self->MxDownloads )
- {
- if( self->NDownloads )
- {
- self->MxDownloads *= 2;
- self->Downloads = (char **)xrealloc(self->Downloads,
- self->MxDownloads*sizeof(char *));
- }
- else
- {
- self->MxDownloads = 32;
- self->Downloads = (char **)xalloc(self->MxDownloads*sizeof(char *));
- }
- }
-
- self->Downloads[self->NDownloads] = (char *)xalloc(strlen(name)+1);
- strcpy(self->Downloads[self->NDownloads], name);
- self->NDownloads += 1;
-
- S_Flush(self);
- sprintf(buf, "%%%%BeginFont: %s", name);
- S_Comment(self, buf);
- fp = fopen(fname, "r");
- if( !fp ) return;
- fread(buf, 1, 1, fp);
- fseek(fp, (long)0, 0);
- if( (buf[0]&0xFF)==0x80 )
- {
- int len;
-
- for(;;)
- {
- stt = fread(buf, 1, 2, fp);
- if( stt!=2 || (buf[0]&0xFF)!=0x80 ) break;
- if( (int)buf[1]<1 || (int)buf[1]>2 ) break;
- stt = fread(buf, 1, 4, fp);
- if( stt!=4 ) break;
- len = ((buf[3]&0xFF)<<24)|((buf[2]&0xFF)<<16)|
- ((buf[1]&0xFF)<<8)|(buf[0]&0xFF);
- for(; len ;)
- {
- i = len<256 ? len : 256;
- stt = fread(buf, 1, i, fp);
- if( stt<=0 ) break;
- if (!ferror(self->Fp)) {
- (void) fwrite(buf, 1, stt, self->Fp);
- }
- if( stt<i ) break;
- len -= i;
- }
- }
- }
- else
- {
- for(;;)
- {
- stt = fread(buf, 1, 256, fp);
- if( stt<=0 ) break;
- if (!ferror(self->Fp)) {
- (void) fwrite(buf, 1, stt, self->Fp);
- }
- if( stt<256 ) break;
- }
- }
- fclose(fp);
- S_Flush(self);
- S_Comment(self, "%%EndFont");
-}
diff --git a/Xprint/ps/psout.h b/Xprint/ps/psout.h
deleted file mode 100644
index 2fe83ffc7..000000000
--- a/Xprint/ps/psout.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $Xorg: psout.h,v 1.6 2001/02/09 02:04:37 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * (c) Copyright 1996 Hewlett-Packard Company
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 Digital Equipment Corp.
- * (c) Copyright 1996 Fujitsu Limited
- * (c) Copyright 1996 Hitachi, Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the names of the copyright holders
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from said copyright holders.
- */
-/* $XFree86: xc/programs/Xserver/Xprint/ps/psout.h,v 1.5 2001/12/21 21:02:06 dawes Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: psout.h
-** *
-** * Contents: Include file for psout.c
-** *
-** * Created By: Roger Helmendach (Liberty Systems)
-** *
-** * Copyright: Copyright 1996 The Open Group, Inc.
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#ifndef _psout_
-#define _psout_
-
-#include <stdio.h>
-
-typedef enum PsCapEnum_ { PsCButt=0, PsCRound, PsCSquare } PsCapEnum;
-typedef enum PsJoinEnum_ { PsJMiter=0, PsJRound, PsJBevel } PsJoinEnum;
-typedef enum PsArcEnum_ { PsChord, PsPieSlice } PsArcEnum;
-typedef enum PsRuleEnum_ { PsEvenOdd, PsNZWinding } PsRuleEnum;
-typedef enum PsFillEnum_ { PsSolid=0, PsTile, PsStip, PsOpStip } PsFillEnum;
-
-typedef struct PsPointRec_
-{
- int x;
- int y;
-} PsPointRec;
-
-typedef PsPointRec *PsPointPtr;
-
-typedef struct PsRectRec_
-{
- int x;
- int y;
- int w;
- int h;
-} PsRectRec;
-
-typedef PsRectRec *PsRectPtr;
-
-typedef struct PsArcRec_
-{
- int x;
- int y;
- int w;
- int h;
- int a1;
- int a2;
- PsArcEnum style;
-} PsArcRec;
-
-typedef PsArcRec *PsArcPtr;
-
-#define PSOUT_RECT 0
-#define PSOUT_ARC 1
-#define PSOUT_POINTS 2
-
-typedef struct PsElmRec_
-{
- int type;
- int nPoints;
- union
- {
- PsRectRec rect;
- PsArcRec arc;
- PsPointPtr points;
- } c;
-} PsElmRec;
-
-typedef PsElmRec *PsElmPtr;
-
-typedef struct PsClipRec_
-{
- int nRects;
- PsRectPtr rects;
- int nElms;
- PsElmPtr elms;
- int nOutterClips;
- PsRectPtr outterClips;
-} PsClipRec;
-
-typedef PsClipRec *PsClipPtr;
-
-typedef struct PsOutRec_ *PsOutPtr;
-
-extern PsOutPtr PsOut_BeginFile(FILE *fp, int orient, int count, int plex,
- int res, int wd, int ht, Bool raw);
-extern void PsOut_EndFile(PsOutPtr self, int closeFile);
-extern void PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex,
- int res, int wd, int ht);
-extern void PsOut_EndPage(PsOutPtr self);
-extern void PsOut_DirtyAttributes(PsOutPtr self);
-extern void PsOut_Comment(PsOutPtr self, char *comment);
-extern void PsOut_Offset(PsOutPtr self, int x, int y);
-
-extern void PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf);
-
-extern void PsOut_Color(PsOutPtr self, int clr);
-extern void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule);
-extern void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap,
- PsJoinEnum join, int nDsh, int *dsh, int dshOff,
- int bclr);
-extern void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso);
-extern void PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso);
-
-extern void PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts);
-extern void PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h);
-extern void PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h,
- float ang1, float ang2, PsArcEnum style);
-
-extern void PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts);
-extern void PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts);
-extern void PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h);
-extern void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
- float ang1, float ang2);
-
-extern void PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl,
- int bclr);
-
-extern void PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
- int w, int h, int sw, int sh, int format);
-extern void PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
- int w, int h, int sw, int sh, int format);
-extern void PsOut_EndImage(PsOutPtr self);
-extern void PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes);
-
-extern void PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y,
- int w, int h);
-extern void PsOut_EndFrame(PsOutPtr self);
-
-extern int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h,
- PsFillEnum type, int bclr, int fclr);
-extern void PsOut_EndPattern(PsOutPtr self);
-extern void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type);
-
-extern void PsOut_RawData(PsOutPtr self, char *data, int len);
-extern void PsOut_DownloadType1(PsOutPtr self, char *name, char *fname);
-
-#ifdef BM_CACHE
-extern void PsOut_BeginImageCache(PsOutPtr self, long cache_id);
-extern void PsOut_EndImageCache(PsOutPtr self);
-extern void PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id,
- int bclr, int fclr);
-#endif
-
-extern FILE *PsOut_ChangeFile(PsOutPtr self, FILE *fp);
-
-
-#endif
diff --git a/Xprint/raster/Raster.c b/Xprint/raster/Raster.c
deleted file mode 100644
index d306dea21..000000000
--- a/Xprint/raster/Raster.c
+++ /dev/null
@@ -1,1576 +0,0 @@
-/* $Xorg: Raster.c,v 1.4 2001/03/14 18:46:12 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-
-/* $XFree86: xc/programs/Xserver/Xprint/raster/Raster.c,v 1.12 2003/10/29 22:11:55 tsi Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: printer/Raster.c
-** *
-** * Contents:
-** * Raster driver for the print server.
-** *
-** * Copyright: Copyright 1993, 1995 Hewlett-Packard Company
-** *
-** *********************************************************
-**
-********************************************************************/
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "X.h"
-#include "Xos.h" /* for SIGCLD on pre-POSIX systems */
-#define NEED_EVENTS
-#include "Xproto.h"
-#undef NEED_EVENTS
-#include "Xatom.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "scrnintstr.h"
-#include "screenint.h"
-#include "colormapst.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "servermd.h" /* needed for IMAGE_BUFSIZE */
-#include "mfb.h"
-#include "mi.h"
-
-#include <X11/extensions/Print.h>
-#include "Raster.h"
-
-#include "attributes.h"
-#include "AttrValid.h"
-#include "DiPrint.h"
-
-static void AllocateRasterPrivates(
- ScreenPtr pScreen);
-static Bool RasterChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask);
-static int StartJob(
- XpContextPtr pCon,
- Bool sendClientData,
- ClientPtr client);
-static int StartPage(
- XpContextPtr pCon,
- WindowPtr pWin);
-static int StartDoc(
- XpContextPtr pCon,
- XPDocumentType type);
-static int EndDoc(
- XpContextPtr pCon,
- Bool cancel);
-static int EndJob(
- XpContextPtr pCon,
- Bool cancel);
-static int EndPage(
- XpContextPtr pCon,
- WindowPtr pWin);
-static int DocumentData(
- XpContextPtr pCon,
- DrawablePtr pDraw,
- char *pData,
- int len_data,
- char *pDoc_fmt,
- int len_fmt,
- char *pOptions,
- int len_options,
- ClientPtr client);
-static int GetDocumentData(
- XpContextPtr pContext,
- ClientPtr client,
- int maxBufferSize);
-static void FreePageFiles(
- RasterContextPrivPtr pWinPriv);
-static int SystemCmd(
- char *pCommand);
-static Bool RasterCloseScreen(
- int index,
- ScreenPtr pScreen);
-static int RasterInitContext(XpContextPtr pCon);
-static Bool RasterDestroyContext(XpContextPtr pCon);
-static char *RasterGetAttributes(
- XpContextPtr pContext,
- XPAttributes class);
-static char *RasterGetOneAttribute(XpContextPtr pCon,
- XPAttributes class,
- char *attribute);
-static int RasterSetAttributes(XpContextPtr pCon,
- XPAttributes class,
- char *attributes);
-static int RasterAugmentAttributes(XpContextPtr pCon,
- XPAttributes class,
- char *attributes);
-static int RasterMediumDimensions(XpContextPtr pCon,
- CARD16 *width,
- CARD16 *height);
-static int RasterReproducibleArea(XpContextPtr pCon,
- xRectangle *pRect);
-
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#define DOC_PCL 1
-#define DOC_RASTER 2
-
-static int RasterScreenPrivateIndex, RasterContextPrivateIndex;
-static int RasterGeneration = 0;
-static char RASTER_DRIV_NAME[] = "XP-RASTER";
-static int doc_type = DOC_RASTER;
-
-#define ABSOLUTE_PCLCOMP_PATH1 "/usr/openwin/bin/pclcomp"
-#define ABSOLUTE_PCLCOMP_PATH2 "/usr/X11/bin/pclcomp"
-
-static char *pcl3_output_cmds[] = {
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -0 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -01 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -02 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -03 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -012 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -013 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -023 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% | pclcomp -0123 > %(OutFile)%",
- "xpr -device ljet -rv -landscape < %(InFile)% > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -0 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -01 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -02 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -03 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -012 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -013 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -023 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% | pclcomp -0123 > %(OutFile)%",
- "xpr -device ljet -rv < %(InFile)% > %(OutFile)%"};
-
-Bool
-InitializeRasterDriver(
- int ndx,
- ScreenPtr pScreen,
- int argc,
- char **argv)
-{
- int xRes, yRes;
- int maxRes, maxDim, numBytes;
- RasterScreenPrivPtr pPriv;
-
- /*
- * Register this driver's InitContext function with the print extension.
- * This is a bit
- * sleazy, as the extension hasn't yet been initialized, but the
- * extension needs to know this, and this seems the best time to
- * provide the information.
- */
- XpRegisterInitFunc( pScreen, RASTER_DRIV_NAME, RasterInitContext );
-
- /*
- * Create and load the devPrivate for the printer layer.
- */
- AllocateRasterPrivates(pScreen);
-
- pPriv = (RasterScreenPrivPtr)
- pScreen->devPrivates[RasterScreenPrivateIndex].ptr;
-
- maxDim = MAX( pScreen->height, pScreen->width );
- numBytes = maxDim + BITMAP_SCANLINE_PAD - 1; /* pixels per row */
- numBytes *= maxDim;
- numBytes /= 8; /* bytes per row */
- xRes = pScreen->width / (pScreen->mmWidth / 25.4);
- yRes = pScreen->height / (pScreen->mmHeight / 25.4);
- maxRes = MAX( xRes, yRes );
-
- pPriv->pBits = (char *)xalloc(numBytes);
-
- /*
- * Have to allocate maxDim X maxDim to allow for landscape mode.
- */
- mfbScreenInit(pScreen, pPriv->pBits, maxDim, maxDim, maxRes,
- maxRes, maxDim);
- miInitializeBackingStore(pScreen);
- pScreen->blackPixel = 1;
- pScreen->whitePixel = 0;
- if(mfbCreateDefColormap(pScreen) == FALSE)
- ; /* XXX what do I do if it fails? */
-
- /*
- cfbScreenInit(pScreen, pPriv->pBits, maxWidth, maxHeight, maxXres,
- maxYres, maxWidth);
- miInitializeBackingStore(pScreen);
- scalingScreenInit(pScreen);
- */
-
- pScreen->SaveScreen = (SaveScreenProcPtr)_XpBoolNoop;
- pPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pScreen->ChangeWindowAttributes = RasterChangeWindowAttributes;
- pPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = RasterCloseScreen;
-
- return TRUE;
-}
-
-/*
- * GetPropString searches the context's config database for a property
- * by the name of propName. If found, it returns the property's
- * value, otherwise it returns NULL unless the requested attribute
- * is RASTER_PRINT_PAGE_COMMAND, in which case it returns a hard-coded
- * default string to invoke xpr to produce a PostScript(tm) formatted
- * raster.
- */
-
-static char *
-GetPropString(
- XpContextPtr pCon,
- char *propName)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
- char *type;
- XrmValue val;
- struct stat status;
- int pclcomp_exists = 0;
-
- if( XrmGetResource(pConPriv->config, propName, propName, &type, &val) ==
- True )
- return (char *)val.addr;
-
- if( !strcmp( propName, RASTER_PRINT_PAGE_COMMAND ) )
- if( doc_type == DOC_RASTER )
- return "xpr -device ps %(InFile)% > %(OutFile)%";
- else
- {
- XpOid orientation;
- XpOid compression;
- int pcl3_output_index = 0;
-
- orientation = XpGetContentOrientation(pCon);
- compression = XpGetAvailableCompression(pCon);
-
- switch(orientation) {
- case xpoid_val_content_orientation_landscape:
- pcl3_output_index = 0;
- break;
- default:
- pcl3_output_index += 9;
- break;
- }
-
- if(stat(ABSOLUTE_PCLCOMP_PATH1, &status) != -1)
- pclcomp_exists = 1;
- else if(stat(ABSOLUTE_PCLCOMP_PATH2, &status) != -1)
- pclcomp_exists = 1;
-
- if(pclcomp_exists)
- switch(compression) {
- case xpoid_val_available_compressions_0:
- pcl3_output_index += 0;
- break;
- case xpoid_val_available_compressions_01:
- pcl3_output_index += 1;
- break;
- case xpoid_val_available_compressions_02:
- pcl3_output_index += 2;
- break;
- case xpoid_val_available_compressions_03:
- pcl3_output_index += 3;
- break;
- case xpoid_val_available_compressions_012:
- pcl3_output_index += 4;
- break;
- case xpoid_val_available_compressions_013:
- pcl3_output_index += 5;
- break;
- case xpoid_val_available_compressions_023:
- pcl3_output_index += 6;
- break;
- default:
- pcl3_output_index += 7;
- break;
- }
- else
- pcl3_output_index += 8;
-
- return pcl3_output_cmds[pcl3_output_index];
- }
- else
- return NULL;
-}
-
-static void
-SetDocumentType(
- XpContextPtr pCon)
-{
- XpOidList* attrs_supported;
-
- /*
- * only validate attributes found in document-attributes-supported
- */
- attrs_supported =
- XpGetListAttr(pCon, XPPrinterAttr,
- xpoid_att_document_attributes_supported,
- (const XpOidList*)NULL);
-
- if(XpOidListHasOid(attrs_supported, xpoid_att_document_format))
- {
- const char* value_in;
- XpOidDocFmt *f;
-
- value_in = XpGetStringAttr(pCon, XPDocAttr, xpoid_att_document_format);
-
- f = XpOidDocFmtNew( value_in );
-
- if( f != NULL )
- {
- if( !strcmp( f->format, "PCL" ) )
- doc_type = DOC_PCL;
- else
- doc_type = DOC_RASTER;
-
- XpOidDocFmtDelete( f );
- }
- }
-
- /*
- * clean up
- */
- XpOidListDelete(attrs_supported);
-}
-
-static int
-StartJob(
- XpContextPtr pCon,
- Bool sendClientData,
- ClientPtr client)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- SetDocumentType( pCon );
-
- /*
- * Check for existing page file, and delete it if it exists.
- */
- if(pConPriv->pageFileName != (char *)NULL)
- {
- if(pConPriv->pPageFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- }
- unlink(pConPriv->pageFileName);
- Xfree(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- }
-
- /*
- * Create a temporary file to store the printer output.
- */
- if(!sendClientData)
- {
- /*
- * Create a temporary file to store the printer output.
- */
- if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile))
- return BadAlloc;
- }
-
- return Success;
-}
-
-/*
- * StartDoc and EndDoc are just no-ops in this implementation, since
- * our view of the spooler really doesn't recognize documents.
- */
-
-static int
-StartDoc(
- XpContextPtr pCon,
- XPDocumentType type)
-{
- return Success;
-}
-
-static int EndDoc(
- XpContextPtr pCon,
- Bool cancel)
-{
- return Success;
-}
-
-#if 0
-
-/* XXX Not used. */
-
-/*
- * BuidArgVector takes a pointer to a comma-separated list of command
- * options and splits it out into an array of argument pointers. The
- * caller must not free the optionList after calling this function until
- * the returned arg vector is no longer needed, at which time the arg
- * vector should also be freed.
- */
-
-#define SEPARATOR_CHAR (char)','
-
-static char **
-BuildArgVector(
- char *optionList,
- char **argVector,
- int argCount)
-{
- char *curArg, *lastChar, *endArg;
-
- curArg = optionList;
- lastChar = optionList + strlen(optionList); /* includes final NULL */
-
- while(curArg != (char *)NULL && curArg < lastChar)
- {
- /* strip leading white space */
- while(curArg < lastChar && isascii((int)*curArg) &&
- isspace((int)*curArg))
- curArg++;
-
- if(curArg < lastChar)
- {
- argVector = (char **)Xrealloc(argVector,
- sizeof(char *) * (argCount + 2));
- argVector[argCount] = curArg;
- argVector[++argCount] = (char *)NULL;
-
- endArg = strchr(curArg, SEPARATOR_CHAR);
-
- /* Should I strip trailing white space ??? */
-
- if(endArg != (char *)NULL)
- {
- *endArg = (char)'\0';
- curArg = endArg + 1;
- }
- else
- curArg = (char *)NULL;
- }
- }
-
- return argVector;
-}
-#endif
-
-static int
-EndJob(
- XpContextPtr pCon,
- Bool cancel)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- if( cancel == True )
- {
- if(pConPriv->getDocClient != (ClientPtr)NULL) {
- XpFinishDocData(pConPriv->getDocClient);
-
- pConPriv->getDocClient = (ClientPtr)NULL;
- pConPriv->getDocBufSize = 0;
- }
-
- if(pConPriv->jobFileName != (char *)NULL)
- {
- unlink(pConPriv->jobFileName);
- Xfree(pConPriv->jobFileName);
- pConPriv->jobFileName = (char *)NULL;
- }
-
- return Success;
- }
-
- if(pConPriv->getDocClient != (ClientPtr)NULL&&pConPriv->getDocBufSize > 0)
- {
- XpFinishDocData(pConPriv->getDocClient);
-
- pConPriv->getDocClient = (ClientPtr)NULL;
- pConPriv->getDocBufSize = 0;
-
- return Success;
- }
-
- if(pConPriv->pJobFile != (FILE *)NULL)
- {
- fclose(pConPriv->pJobFile);
- pConPriv->pJobFile = (FILE *)NULL;
-
- if(pConPriv->jobFileName != (char *)NULL)
- {
- XpSubmitJob( pConPriv->jobFileName, pCon );
- unlink(pConPriv->jobFileName);
- Xfree(pConPriv->jobFileName);
- pConPriv->jobFileName = (char *)NULL;
- }
- }
-
- return Success;
-}
-
-/* StartPage
- *
- * If page file exists
- * close page file
- * set page file pointer = NULL
- * unlink page file
- */
-static int
-StartPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- if(pConPriv->pPageFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- }
- if(pConPriv->pageFileName != (char *)NULL)
- {
- unlink(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- }
-
- return Success;
-}
-
-#include "X11/XWDFile.h"
-
-
-#define lowbit(x) ((x) & (~(x) + 1))
-
-/*
- * Get the XWDColors of all pixels in colormap - returns # of colors
- */
-static XWDColor *
-Get_XWDColors(
- ColormapPtr pCmap)
-{
- int i, ncolors;
- xrgb *prgbList;
- Pixel *pPixels;
- XWDColor *colors;
-
- ncolors = pCmap->pVisual->ColormapEntries;
- if (!(colors = (XWDColor *) malloc (sizeof(XWDColor) * ncolors)))
- return (XWDColor *) NULL;
- if (!(prgbList = (xrgb*) malloc(sizeof(xrgb) * ncolors)))
- {
- Xfree(colors);
- return (XWDColor *) NULL;
- }
- if (!(pPixels = (Pixel*) malloc(sizeof(Pixel) * ncolors)))
- {
- Xfree(colors);
- Xfree(prgbList);
- return (XWDColor *) NULL;
- }
-
- if (pCmap->pVisual->class == DirectColor ||
- pCmap->pVisual->class == TrueColor) {
- Pixel red, green, blue, red1, green1, blue1;
-
- red = green = blue = 0;
- red1 = lowbit(pCmap->pVisual->redMask);
- green1 = lowbit(pCmap->pVisual->greenMask);
- blue1 = lowbit(pCmap->pVisual->blueMask);
- for (i=0; i<ncolors; i++) {
- colors[i].pixel = red|green|blue;
- colors[i].pad = 0;
- red += red1;
- if (red > pCmap->pVisual->redMask)
- red = 0;
- green += green1;
- if (green > pCmap->pVisual->greenMask)
- green = 0;
- blue += blue1;
- if (blue > pCmap->pVisual->blueMask)
- blue = 0;
- }
- } else {
- for (i=0; i<ncolors; i++) {
- colors[i].pixel = i;
- colors[i].pad = 0;
- }
- }
-
- for(i = 0; i < ncolors; i++)
- pPixels[i] = colors[i].pixel;
-
- QueryColors(pCmap, ncolors, pPixels, prgbList);
- Xfree(pPixels);
-
- for(i = 0; i < ncolors; i++)
- {
- colors[i].red = prgbList[i].red;
- colors[i].green = prgbList[i].green;
- colors[i].blue = prgbList[i].blue;
- }
- Xfree(prgbList);
-
- return(colors);
-}
-
-static void
-_swapshort (
- register char *bp,
- register unsigned n)
-{
- register char c;
- register char *ep = bp + n;
-
- while (bp < ep) {
- c = *bp;
- *bp = *(bp + 1);
- bp++;
- *bp++ = c;
- }
-}
-
-static void
-_swaplong (
- register char *bp,
- register unsigned n)
-{
- register char c;
- register char *ep = bp + n;
- register char *sp;
-
- while (bp < ep) {
- sp = bp + 3;
- c = *sp;
- *sp = *bp;
- *bp++ = c;
- sp = bp + 1;
- c = *sp;
- *sp = *bp;
- *bp++ = c;
- bp += 2;
- }
-}
-static int
-WriteWindowRaster(
- WindowPtr pWin,
- FILE *pRasterFile)
-{
- long widthBytesLine, length;
- int nlines, linesPerBuf, height, linesDone;
- char *pBuf;
- DrawablePtr pDraw = &pWin->drawable;
- XWDFileHeader header;
- int win_name_size;
- int header_size;
- int ncolors, i;
- char *win_name;
- VisualPtr pVisual;
- ColormapPtr pCmap;
- XWDColor *pColors;
- unsigned long swaptest = 1;
-
- widthBytesLine = PixmapBytePad(pWin->drawable.width, pWin->drawable.depth);
- length = widthBytesLine * pWin->drawable.height;
- height = pWin->drawable.height;
-
- if(length <= 0)
- return Success;
-
- if (widthBytesLine >= IMAGE_BUFSIZE)
- linesPerBuf = 1;
- else
- {
- linesPerBuf = IMAGE_BUFSIZE / widthBytesLine;
- if (linesPerBuf > height)
- linesPerBuf = height;
- }
- length = linesPerBuf * widthBytesLine;
- if (linesPerBuf < height)
- {
- /* we have to make sure intermediate buffers don't need padding */
- while ((linesPerBuf > 1) && (length & 3))
- {
- linesPerBuf--;
- length -= widthBytesLine;
- }
- while (length & 3)
- {
- linesPerBuf++;
- length += widthBytesLine;
- }
- }
- if(!(pBuf = (char *) Xalloc(length)))
- return (BadAlloc);
-
- /*
- * Start of Xwd header code.
- */
-
- /*
- * XXX - Should we use the real window name???
- */
- win_name = "xwdump";
- /* sizeof(char) is included for the null string terminator. */
- win_name_size = strlen(win_name) + sizeof(char);
-
- pCmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP);
- pVisual = pCmap->pVisual;
- if((pColors = Get_XWDColors(pCmap)) == (XWDColor *)NULL)
- {
- Xfree(pBuf);
- return (BadAlloc);
- }
-
- /*
- * Write out header information.
- */
- header_size = sizeof(header) + win_name_size;
- header.header_size = (CARD32) header_size;
- header.file_version = (CARD32) XWD_FILE_VERSION;
- header.pixmap_format = (CARD32) ZPixmap; /* Must match GetImage below */
- header.pixmap_depth = (CARD32) pDraw->depth;
- header.pixmap_width = (CARD32) pDraw->width;
- header.pixmap_height = (CARD32) pDraw->height;
- header.xoffset = (CARD32) 0;
- header.byte_order = (CARD32) screenInfo.imageByteOrder;
- header.bitmap_unit = (CARD32) screenInfo.bitmapScanlineUnit;
- header.bitmap_bit_order = (CARD32) screenInfo.bitmapBitOrder;
- header.bitmap_pad = (CARD32) screenInfo.bitmapScanlinePad;
- header.bits_per_pixel = (CARD32) pDraw->bitsPerPixel;
- header.bytes_per_line = (CARD32) widthBytesLine;
- header.visual_class = (CARD32) pVisual->class;
- header.red_mask = (CARD32) pVisual->redMask;
- header.green_mask = (CARD32) pVisual->greenMask;
- header.blue_mask = (CARD32) pVisual->blueMask;
- header.bits_per_rgb = (CARD32) pVisual->bitsPerRGBValue;
- header.colormap_entries = (CARD32) pVisual->ColormapEntries;
- header.ncolors = ncolors = (CARD32) pVisual->ColormapEntries;
- header.window_width = (CARD32) pDraw->width;
- header.window_height = (CARD32) pDraw->height;
- header.window_x = 0;
- header.window_y = 0;
- header.window_bdrwidth = (CARD32) 0;
-
- if (*(char *) &swaptest) {
- _swaplong((char *) &header, sizeof(header));
- for (i = 0; i < ncolors; i++) {
- _swaplong((char *) &pColors[i].pixel, sizeof(long));
- _swapshort((char *) &pColors[i].red, 3 * sizeof(short));
- }
- }
-
- (void) fwrite((char *)&header, sizeof(header), 1, pRasterFile);
- (void) fwrite(win_name, win_name_size, 1, pRasterFile);
- (void) fwrite((char *) pColors, sizeof(XWDColor), ncolors, pRasterFile);
-
- Xfree(pColors);
-
- /*
- * End of Xwd header code.
- */
-
- linesDone = 0;
- while(height - linesDone > 0)
- {
- nlines = min(linesPerBuf, height - linesDone);
- (*pDraw->pScreen->GetImage) (pDraw,
- 0,
- linesDone,
- pWin->drawable.width,
- nlines,
- ZPixmap,
- ~0,
- pBuf);
-
- if(fwrite(pBuf, sizeof(char), (size_t)(nlines * widthBytesLine),
- pRasterFile) !=
- (size_t)(nlines * widthBytesLine))
- {
- Xfree(pBuf);
- return BadAlloc;
- }
- linesDone += nlines;
- }
- Xfree(pBuf);
- return Success;
-}
-
-
-static int
-SendPage( XpContextPtr pCon )
-{
- struct stat statBuf;
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- if(stat(pConPriv->pageFileName, &statBuf) < 0)
- return BadAlloc;
-
- return XpSendDocumentData(pConPriv->getDocClient,
- pConPriv->pPageFile, (int)statBuf.st_size,
- pConPriv->getDocBufSize);
-}
-
-/*
- * EndPage:
- *
- * If page file doesn't exist:
- * {
- * Create page file
- * Open page file
- * Write page header to page file
- * if(preRasterFile exists)
- * copy preRasterFile contents to page file
- * if(noRasterFile exists)
- * write noRasterFile contents to page file
- * else
- * Create raster image file
- * Open raster image file
- * GetImage data
- * Write Image data to raster image file
- * invoke page_command on raster image file
- * Write raster image file contents to page file
- * Unlink tempPage file
- * if(postRasterFile exists)
- * write postRasterFile contents to page file
- * Write page trailer to page file
- * }
- * Write page file to job file
- */
-static int
-EndPage(
- XpContextPtr pCon,
- WindowPtr pWin)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
- struct stat statBuf;
- char *rasterFileName = (char *)NULL, *pCommand = (char *)NULL;
- FILE *pRasterFile = (FILE *)NULL;
-
- if(pConPriv->pageFileName == (char *)NULL)
- {
- /*
- * Open the page file.
- */
- if (!XpOpenTmpFile("w+", &pConPriv->pageFileName,
- &pConPriv->pPageFile))
- goto BAD_PAGE_ALLOC;
-
- /*
- * Copy any pre-raster document data to the page file.
- */
- if(pConPriv->pPreRasterFile != (FILE *)NULL)
- {
- if(CopyContentsAndDelete(&pConPriv->pPreRasterFile,
- &pConPriv->preRasterFileName,
- pConPriv->pPageFile) == FALSE)
- goto BAD_PAGE_ALLOC;
- }
-
- /*
- * Copy either the no-raster document data, or the raster
- * data itself to the page file.
- * If the no-raster file exists, then we don't process the
- * actual window raster bits.
- */
- if(pConPriv->pNoRasterFile != (FILE *)NULL)
- {
- if(CopyContentsAndDelete(&pConPriv->pNoRasterFile,
- &pConPriv->noRasterFileName,
- pConPriv->pPageFile) == FALSE)
- goto BAD_PAGE_ALLOC;
- }
- else
- {
- /*
- * Open the raster image file.
- */
- if (!XpOpenTmpFile("w", &rasterFileName, &pRasterFile))
- goto BAD_PAGE_ALLOC;
-
- /*
- * Write the page image data to the raster image file.
- */
- if(WriteWindowRaster(pWin, pRasterFile) != Success)
- goto BAD_PAGE_ALLOC;
-
- /*
- * Invoke the page_command on the raster image file.
- */
- if((pCommand = GetPropString(pCon, RASTER_PRINT_PAGE_COMMAND)) !=
- (char *)NULL)
- {
- char *outFileName;
- FILE *pOutFile;
-
- if (!XpOpenTmpFile("w", &outFileName, &pOutFile))
- goto BAD_PAGE_ALLOC;
- fclose(pOutFile);
-
- pCommand = ReplaceFileString(strdup(pCommand), rasterFileName,
- outFileName);
- fclose(pRasterFile);
- SystemCmd(pCommand);
- free(pCommand);
- /*
- * Delete the unprocessed raster file.
- */
- unlink(rasterFileName);
- Xfree(rasterFileName);
- rasterFileName = outFileName;
- if((pRasterFile = fopen(rasterFileName, "r")) == (FILE *)NULL)
- goto BAD_PAGE_ALLOC;
- }
- else
- {
- fclose(pRasterFile);
- if((pRasterFile = fopen(rasterFileName, "r")) == (FILE *)NULL)
- goto BAD_PAGE_ALLOC;
- }
-
- /*
- * Copy the raster image file contents to the page file.
- * Note that pRasterFile must be set to the start of the
- * raster file.
- */
- if(CopyContentsAndDelete(&pRasterFile,
- &rasterFileName,
- pConPriv->pPageFile) == FALSE)
- goto BAD_PAGE_ALLOC;
- }
-
- /*
- * Copy any post-raster document data to the page file.
- */
- if(pConPriv->pPostRasterFile != (FILE *)NULL)
- {
- if(CopyContentsAndDelete(&pConPriv->pPostRasterFile,
- &pConPriv->postRasterFileName,
- pConPriv->pPageFile) == FALSE)
- goto BAD_PAGE_ALLOC;
- }
-
- }
-
- /*
- * Write the page file contents to the job file or to the client
- * performing GetDocumentData.
- * pConPriv->pPageFile must first be set to the start of the page file.
- */
- rewind(pConPriv->pPageFile);
- if(stat(pConPriv->pageFileName, &statBuf) < 0)
- goto BAD_PAGE_ALLOC;
-
- /*
- * Send the page data to whatever client has called GetDocumentData.
- */
- if(pConPriv->getDocClient != (ClientPtr)NULL&&pConPriv->getDocBufSize > 0)
- {
- int retval;
- /*
- * We should do something like the following: suspend the
- * caller until we can gracefully write all the data in small
- * chunks to the receiver, but for now we'll just call WriteToClient
- * on the huge chunk
- */
- retval = SendPage(pCon);
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- unlink(pConPriv->pageFileName);
- free(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- return retval;
- }
-
- if(pConPriv->pJobFile == (FILE *)NULL)
- {
- /*
- * This shouldn't be necessary. I believe we only get here if
- * someone calls "EndPage" prior to "StartJob". This error
- * condition should probably be trapped at a higher level.
- */
-
- if(pConPriv->jobFileName != (char *)NULL)
- Xfree(pConPriv->jobFileName);
- /*
- * Create a temporary file to store the printer output.
- */
- if (!XpOpenTmpFile("w", &pConPriv->jobFileName, &pConPriv->pJobFile))
- goto BAD_PAGE_ALLOC;
- }
-
- if(TransferBytes(pConPriv->pPageFile, pConPriv->pJobFile,
- (int)statBuf.st_size) != (int)statBuf.st_size)
- goto BAD_PAGE_ALLOC;
-
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- unlink(pConPriv->pageFileName);
- free(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
-
- return Success;
-
- BAD_PAGE_ALLOC:
-
- FreePageFiles(pConPriv);
-
- if(pRasterFile != (FILE *)NULL)
- fclose(pRasterFile);
- if(rasterFileName != (char *)NULL)
- {
- unlink(rasterFileName);
- Xfree(rasterFileName);
- }
- return BadAlloc;
-}
-
-static int
-DocumentData(
- XpContextPtr pCon,
- DrawablePtr pDraw,
- char *pData,
- int len_data,
- char *pDoc_fmt,
- int len_fmt,
- char *pOptions,
- int len_options,
- ClientPtr client)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
- char *preRasterStr = PRE_RASTER, *postRasterStr = POST_RASTER,
- *noRasterStr = NO_RASTER;
-
- /*
- * Check that options equals either PRE_RASTER or POST_RASTER.
- */
- if(len_options == strlen(preRasterStr) &&
- strncmp(pOptions, preRasterStr, strlen(preRasterStr)) == 0)
- {
- if(pConPriv->pPreRasterFile == (FILE *)NULL)
- {
- if (!XpOpenTmpFile("w+", &pConPriv->preRasterFileName,
- &pConPriv->pPreRasterFile))
- return BadAlloc;
- }
- if(fwrite(pData, sizeof(char), (size_t)len_data,
- pConPriv->pPreRasterFile) != (size_t)len_data)
- return BadAlloc;
- fflush(pConPriv->pPreRasterFile);
- }
- else if(len_options == strlen(postRasterStr) &&
- strncmp(pOptions, postRasterStr, strlen(postRasterStr)) == 0)
- {
- if(pConPriv->pPostRasterFile == (FILE *)NULL)
- {
- if (!XpOpenTmpFile("w+", &pConPriv->postRasterFileName,
- &pConPriv->pPostRasterFile))
- return BadAlloc;
- }
- if(fwrite(pData, sizeof(char), (size_t)len_data,
- pConPriv->pPostRasterFile) != (size_t)len_data)
- return BadAlloc;
- fflush(pConPriv->pPostRasterFile);
- }
- else if(len_options == strlen(noRasterStr) &&
- strncmp(pOptions, noRasterStr, strlen(noRasterStr)) == 0)
- {
- if(pConPriv->pNoRasterFile == (FILE *)NULL)
- {
- if (!XpOpenTmpFile("w+", &pConPriv->noRasterFileName,
- &pConPriv->pNoRasterFile))
- return BadAlloc;
- }
- if(fwrite(pData, sizeof(char), (size_t)len_data,
- pConPriv->pNoRasterFile) != (size_t)len_data)
- return BadAlloc;
- fflush(pConPriv->pNoRasterFile);
- }
- else
- return BadValue;
-
- return Success;
-}
-
-/*
- * GetDocumentData notes which client is requesting the document data for
- * a particular context. The Raster driver's EndPage function causes the
- * data to be written to the proper client.
- */
-static int
-GetDocumentData(
- XpContextPtr pContext,
- ClientPtr client,
- int maxBufferSize)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pContext->devPrivates[RasterContextPrivateIndex].ptr;
-
- pConPriv->getDocClient = client;
- pConPriv->getDocBufSize = maxBufferSize;
- return Success;
-}
-
-static void
-AllocateRasterPrivates(
- ScreenPtr pScreen)
-{
- if(RasterGeneration != serverGeneration)
- {
- RasterScreenPrivateIndex = AllocateScreenPrivateIndex();
- RasterContextPrivateIndex = XpAllocateContextPrivateIndex();
- XpAllocateContextPrivate( RasterContextPrivateIndex,
- sizeof( RasterContextPrivRec ) );
-
- RasterGeneration = serverGeneration;
- }
- pScreen->devPrivates[RasterScreenPrivateIndex].ptr = (pointer)Xalloc(
- sizeof(RasterScreenPrivRec));
-}
-
-/*
- * RasterChangeWindowAttributes - Make sure that the window's backing
- * store is turned on.
- */
-static Bool
-RasterChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask)
-{
- Bool status = Success;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RasterScreenPrivPtr pScreenPriv = (RasterScreenPrivPtr)
- pScreen->devPrivates[RasterScreenPrivateIndex].ptr;
-
- if(pWin->backingStore == NotUseful)
- {
- pWin->backingStore = WhenMapped;
- mask |= CWBackingStore;
- }
-
- if(pScreenPriv->ChangeWindowAttributes != NULL)
- {
- pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
- status = pScreen->ChangeWindowAttributes(pWin, mask);
- pScreen->ChangeWindowAttributes = RasterChangeWindowAttributes;
- }
- return status;
-}
-
-/*
- * RasterValidateDocFormats - Inspects the files available in the
- * ddx-config/XP-RASTER directory to find the names of PDLs for which
- * we have processing commands. These names are then intersected with
- * the contents of the printer's document-formats-supported attribute,
- * and the result is stored back into document-formats-supported.
- * We have hard-coded knowledge of how to produce PS, so we always
- * leave that in, if it's listed in document-formats-supported,
- * even if we don't have a configuration file. If there is a
- * configuration file for PS, then its contents will override our default.
- */
-static void
-RasterValidateDocFormats(
- XpContextPtr pCon)
-{
-}
-
-/*
- * RasterValidateAttrs - Inspects and Corrects the attribute values
- * in the specified context.
- */
-static void
-RasterValidateAttrs(
- XpContextPtr pCon)
-{
- RasterValidateDocFormats(pCon);
- XpValidatePrinterPool(pCon, &RasterValidatePoolsRec);
- XpValidateJobPool(pCon, &RasterValidatePoolsRec);
- XpValidateDocumentPool(pCon, &RasterValidatePoolsRec);
-}
-
-/*
- * RasterInitContext - Establish the appropriate values for a
- * PrintContext used with the Raster Driver.
- */
-static char DOC_ATT_SUPP[]="document-attributes-supported:\tdefault-medium document-format";
-static char JOB_ATT_SUPP[]="job-attributes-supported:\t";
-static char DDX_DIR[]="ddx-config";
-
-static int
-RasterInitContext(
- XpContextPtr pCon)
-{
- char *configFileName, *val, *attrStr;
- RasterContextPrivPtr pConPriv;
- XpDriverFuncsPtr pFuncs;
-
- /*
- * Initialize the attribute store for this printer.
- */
- XpInitAttributes( pCon );
-
- /*
- * Validate the attributes
- */
- RasterValidateAttrs( pCon );
-
-
- /*
- * Initialize the function pointers
- */
- pFuncs = &( pCon->funcs );
- pFuncs->StartJob = StartJob;
- pFuncs->EndJob = EndJob;
- pFuncs->StartDoc = StartDoc;
- pFuncs->EndDoc = EndDoc;
- pFuncs->StartPage = StartPage;
- pFuncs->EndPage = EndPage;
- pFuncs->PutDocumentData = DocumentData;
- pFuncs->GetDocumentData = GetDocumentData;
- pFuncs->DestroyContext = RasterDestroyContext;
- pFuncs->GetAttributes = RasterGetAttributes;
- pFuncs->GetOneAttribute = RasterGetOneAttribute;
- pFuncs->SetAttributes = RasterSetAttributes;
- pFuncs->AugmentAttributes = RasterAugmentAttributes;
- pFuncs->GetMediumDimensions = RasterMediumDimensions;
- pFuncs->GetReproducibleArea = RasterReproducibleArea;
-
- /*
- * Set up the context privates
- */
- pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- pConPriv->jobFileName = (char *)NULL;
- pConPriv->pageFileName = (char *)NULL;
- pConPriv->preRasterFileName = (char *)NULL;
- pConPriv->postRasterFileName = (char *)NULL;
- pConPriv->noRasterFileName = (char *)NULL;
- pConPriv->pJobFile = (FILE *)NULL;
- pConPriv->pPageFile = (FILE *)NULL;
- pConPriv->pPreRasterFile = (FILE *)NULL;
- pConPriv->pPostRasterFile = (FILE *)NULL;
- pConPriv->pNoRasterFile = (FILE *)NULL;
-
- pConPriv->getDocClient = (ClientPtr)NULL;
- pConPriv->getDocBufSize = 0;
-
- /*
- * Get the configuration information for the context's printer
- */
- configFileName = XpGetOneAttribute( pCon, XPPrinterAttr,
- "xp-ddx-config-file-name" );
- if(configFileName && strlen(configFileName))
- {
- if( configFileName[0] == '/' )
- pConPriv->config = XrmGetFileDatabase( configFileName );
- else
- {
- char *configDir, *configFilePath;
-
- configDir = XpGetConfigDir(FALSE);
- configFilePath = (char *)malloc((strlen(configDir) +
- strlen(DDX_DIR) +
- strlen(RASTER_DRIV_NAME) +
- strlen(configFileName) +
- 4)* sizeof(char));
- sprintf(configFilePath, "%s/%s/%s/%s", configDir, DDX_DIR,
- RASTER_DRIV_NAME, configFileName);
- pConPriv->config = XrmGetFileDatabase(configFilePath);
- free(configDir);
- free(configFilePath);
- }
- }
- else
- pConPriv->config = (XrmDatabase)NULL;
-
- /*
- * Add our own attribute initialization
- */
- /*
- * document-attributes-supported
- */
- val = XpGetOneAttribute(pCon, XPServerAttr, "document-attributes-supported");
- if((attrStr = (char *)xalloc(strlen(val) + strlen(DOC_ATT_SUPP) + 4)) ==
- (char *)NULL)
- return BadAlloc;
- sprintf(attrStr, "*%s %s", DOC_ATT_SUPP, val);
- XpAugmentAttributes(pCon, XPPrinterAttr, attrStr);
- xfree(attrStr);
-
- /*
- * job-attributes-supported
- */
- val = XpGetOneAttribute(pCon, XPServerAttr, "job-attributes-supported");
- if((attrStr = (char *)xalloc(strlen(val) + strlen(JOB_ATT_SUPP) + 4)) ==
- (char *)NULL)
- return BadAlloc;
- sprintf(attrStr, "*%s %s", JOB_ATT_SUPP, val);
- XpAugmentAttributes(pCon, XPPrinterAttr, attrStr);
- xfree(attrStr);
-
- /*
- * PageAttributesSupported
- */
- XpAugmentAttributes(pCon, XPPrinterAttr, "*xp-page-attributes-supported:");
-
- return Success;
-}
-
-
-
-static Bool
-RasterDestroyContext(
- XpContextPtr pCon)
-{
- RasterContextPrivPtr pConPriv = (RasterContextPrivPtr)
- pCon->devPrivates[RasterContextPrivateIndex].ptr;
-
- /*
- * Clean up the temporary files
- */
- FreePageFiles( pConPriv );
-
- if( pConPriv->pJobFile != (FILE *)NULL )
- {
- fclose( pConPriv->pJobFile );
- pConPriv->pJobFile = (FILE *)NULL;
- }
- if( pConPriv->jobFileName != (char *)NULL )
- {
- unlink( pConPriv->jobFileName );
- Xfree( pConPriv->jobFileName );
- }
- if(pConPriv->config)
- {
- XrmDestroyDatabase(pConPriv->config);
- pConPriv->config = (XrmDatabase)NULL;
- }
-
- XpDestroyAttributes( pCon );
- return Success;
-}
-
-static char *
-RasterGetAttributes(
- XpContextPtr pContext,
- XPAttributes class)
-{
- return XpGetAttributes( pContext, class );
-}
-
-static char *
-RasterGetOneAttribute(
- XpContextPtr pContext,
- XPAttributes class,
- char *attr)
-{
- return XpGetOneAttribute( pContext, class, attr );
-}
-
-static int
-RasterSetAttributes(XpContextPtr pCon,
- XPAttributes class,
- char *attributes)
-{
- return XpSetAttributes( pCon, class, attributes );
-}
-
-static int
-RasterAugmentAttributes(
- XpContextPtr pCon,
- XPAttributes class,
- char *attributes)
-{
- return XpAugmentAttributes( pCon, class, attributes );
-}
-
-static void
-FreePageFiles(
- RasterContextPrivPtr pConPriv)
-{
- if(pConPriv->pPageFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPageFile);
- pConPriv->pPageFile = (FILE *)NULL;
- }
- if(pConPriv->pageFileName != (char *)NULL)
- {
- unlink(pConPriv->pageFileName);
- Xfree(pConPriv->pageFileName);
- pConPriv->pageFileName = (char *)NULL;
- }
- if(pConPriv->pPreRasterFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPreRasterFile);
- pConPriv->pPreRasterFile = (FILE *)NULL;
- }
- if(pConPriv->preRasterFileName != (char *)NULL)
- {
- unlink(pConPriv->preRasterFileName);
- Xfree(pConPriv->preRasterFileName);
- pConPriv->preRasterFileName = (char *)NULL;
- }
- if(pConPriv->pPostRasterFile != (FILE *)NULL)
- {
- fclose(pConPriv->pPostRasterFile);
- pConPriv->pPostRasterFile = (FILE *)NULL;
- }
- if(pConPriv->postRasterFileName != (char *)NULL)
- {
- unlink(pConPriv->postRasterFileName);
- Xfree(pConPriv->postRasterFileName);
- pConPriv->postRasterFileName = (char *)NULL;
- }
- if(pConPriv->pNoRasterFile != (FILE *)NULL)
- {
- fclose(pConPriv->pNoRasterFile);
- pConPriv->pNoRasterFile = (FILE *)NULL;
- }
- if(pConPriv->noRasterFileName != (char *)NULL)
- {
- unlink(pConPriv->noRasterFileName);
- Xfree(pConPriv->noRasterFileName);
- pConPriv->noRasterFileName = (char *)NULL;
- }
-}
-
-/*
- * RasterCloseScreen - Call any wrapped CloseScreen function,
- * and free the screen memory.
- */
-static Bool
-RasterCloseScreen(
- int index,
- ScreenPtr pScreen)
-{
- Bool status = Success;
- RasterScreenPrivPtr pScreenPriv = (RasterScreenPrivPtr)
- pScreen->devPrivates[RasterScreenPrivateIndex].ptr;
-
- /*
- * Call any wrapped CloseScreen proc.
- */
- if(pScreenPriv->CloseScreen != NULL)
- {
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- status = pScreen->CloseScreen(index, pScreen);
- pScreen->CloseScreen = RasterCloseScreen;
- }
-
- Xfree(pScreenPriv->pBits);
- Xfree(pScreenPriv);
-
- return status;
-}
-
-#include <signal.h>
-
-/* ARGSUSED */
-static void SigchldHndlr (int dummy)
-{
- int status;
- int olderrno = errno;
- struct sigaction act;
- sigfillset(&act.sa_mask);
- act.sa_flags = 0;
- act.sa_handler = SigchldHndlr;
-
- (void) wait (&status);
-
- /*
- * Is this really necessary?
- */
- sigaction(SIGCHLD, &act, (struct sigaction *)NULL);
- errno = olderrno;
-}
-
-/*
- * SystemCmd provides a wrapper for the 'system' library call. The call
- * appears to be sensitive to the handling of SIGCHLD, so this wrapper
- * sets the status to SIG_DFL, and then resets the established handler
- * after system returns.
- */
-static int
-SystemCmd(char *cmdStr)
-{
- int status;
- struct sigaction newAct, oldAct;
- sigfillset(&newAct.sa_mask);
- newAct.sa_flags = 0;
- newAct.sa_handler = SIG_DFL;
- sigfillset(&oldAct.sa_mask);
- oldAct.sa_flags = 0;
- oldAct.sa_handler = SigchldHndlr;
-
- /*
- * get the old handler, and set the action to IGN
- */
- sigaction(SIGCHLD, &newAct, &oldAct);
-
- status = system (cmdStr);
-
- sigaction(SIGCHLD, &oldAct, (struct sigaction *)NULL);
- return status;
-}
-
-/*
- * RasterMediumDimensions is installed in the GetMediumDimensions field
- * of each raster-initialized context.
- */
-static int
-RasterMediumDimensions(XpContextPtr pCon,
- CARD16 *width,
- CARD16 *height)
-{
- XpGetMediumDimensions(pCon, width, height);
- return Success;
-}
-
-/*
- * RasterReproducibleArea is installed in the GetReproducibleArea field
- * of each raster-initialized context.
- */
-static int
-RasterReproducibleArea(XpContextPtr pCon,
- xRectangle *pRect)
-{
- XpGetReproductionArea(pCon, pRect);
- return Success;
-}
diff --git a/Xprint/raster/Raster.h b/Xprint/raster/Raster.h
deleted file mode 100644
index 0533cd5b2..000000000
--- a/Xprint/raster/Raster.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $Xorg: Raster.h,v 1.3 2000/08/17 19:48:12 cpqbld Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/raster/Raster.h,v 1.4 2001/12/21 21:02:06 dawes Exp $ */
-
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: printer/Raster.h
-** *
-** * Contents: defines and includes for the raster layer
-** * for a printing X server.
-** *
-** * Copyright: Copyright 1993 Hewlett-Packard Company
-** *
-** *********************************************************
-**
-********************************************************************/
-#ifndef _RASTER_H_
-#define _RASTER_H_
-
-/*
- * Some sleazes to force the XrmDB stuff into the server
- */
-#ifndef HAVE_XPointer
-typedef char *XPointer;
-#endif
-#define Status int
-#define True 1
-#define False 0
-#include "misc.h"
-#include <Xfuncproto.h>
-#include <X11/Xresource.h>
-#include "attributes.h"
-
-#include <X11/extensions/Printstr.h>
-
-#define MAX_TOKEN_LEN 512
-
-#define RASTER_PRINT_PAGE_COMMAND "_XP_RASTER_PAGE_PROC_COMMAND"
-
-#define RASTER_IN_FILE_STRING "%(InFile)%"
-#define RASTER_OUT_FILE_STRING "%(OutFile)%"
-
-#define RASTER_ALLOWED_COMMANDS_FILE "printCommands"
-
-/*
- * Defines for the "options" in DtPrintDocumentData.
- */
-#define PRE_RASTER "PRE-RASTER"
-#define POST_RASTER "POST-RASTER"
-#define NO_RASTER "NO-RASTER"
-
-
-typedef struct {
- char *pBits;
- CreateWindowProcPtr CreateWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- DestroyWindowProcPtr DestroyWindow;
- CloseScreenProcPtr CloseScreen;
-} RasterScreenPrivRec, *RasterScreenPrivPtr;
-
-typedef struct {
- XrmDatabase config;
- char *jobFileName;
- FILE *pJobFile;
- char *pageFileName;
- FILE *pPageFile;
- char *preRasterFileName; /* Pre-raster document data */
- FILE *pPreRasterFile;
- char *noRasterFileName; /* Raster replacement document data */
- FILE *pNoRasterFile;
- char *postRasterFileName; /* Post-raster document data */
- FILE *pPostRasterFile;
- ClientPtr getDocClient;
- int getDocBufSize;
-} RasterContextPrivRec, *RasterContextPrivPtr;
-
-
-extern XpValidatePoolsRec RasterValidatePoolsRec;
-
-extern Bool InitializeRasterDriver(int ndx, ScreenPtr pScreen, int argc,
- char **argv);
-
-#endif /* _RASTER_H_ */
diff --git a/Xprint/raster/RasterAttVal.c b/Xprint/raster/RasterAttVal.c
deleted file mode 100644
index 7cce3f22a..000000000
--- a/Xprint/raster/RasterAttVal.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* $Xorg: RasterAttVal.c,v 1.4 2001/03/14 18:46:34 pookie Exp $ */
-/*
-(c) Copyright 1996 Hewlett-Packard Company
-(c) Copyright 1996 International Business Machines Corp.
-(c) Copyright 1996 Sun Microsystems, Inc.
-(c) Copyright 1996 Novell, Inc.
-(c) Copyright 1996 Digital Equipment Corp.
-(c) Copyright 1996 Fujitsu Limited
-(c) Copyright 1996 Hitachi, Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the names of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from said
-copyright holders.
-*/
-/* $XFree86: xc/programs/Xserver/Xprint/raster/RasterAttVal.c,v 1.4 2001/12/21 21:02:06 dawes Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "scrnintstr.h"
-#include "screenint.h"
-#include <X11/extensions/Print.h>
-#include "Raster.h"
-
-#include "attributes.h"
-#include "AttrValid.h"
-
-/*
- * define valid values and defaults for Printer pool
- */
-static XpOid ValidContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape
-};
-static XpOidList ValidContentOrientations = {
- ValidContentOrientationsOids, XpNumber(ValidContentOrientationsOids)
-};
-
-static XpOid DefaultContentOrientationsOids[] = {
- xpoid_val_content_orientation_portrait,
- xpoid_val_content_orientation_landscape
-};
-static XpOidList DefaultContentOrientations = {
- DefaultContentOrientationsOids, XpNumber(DefaultContentOrientationsOids)
-};
-
-static XpOid ValidPlexesOids[] = {
- xpoid_val_plex_simplex
-};
-static XpOidList ValidPlexes = {
- ValidPlexesOids, XpNumber(ValidPlexesOids)
-};
-
-static XpOid DefaultPlexesOids[] = {
- xpoid_val_plex_simplex
-};
-static XpOidList DefaultPlexes = {
- DefaultPlexesOids, XpNumber(DefaultPlexesOids)
-};
-
-static unsigned long ValidPrinterResolutionsCards[] = {
- 150, 300, 600
-};
-static XpOidCardList ValidPrinterResolutions = {
- ValidPrinterResolutionsCards, XpNumber(ValidPrinterResolutionsCards)
-};
-
-static unsigned long DefaultPrinterResolutionsCards[] = {
- 300
-};
-static XpOidCardList DefaultPrinterResolutions = {
- DefaultPrinterResolutionsCards, XpNumber(DefaultPrinterResolutionsCards)
-};
-
-static XpOid ValidListfontsModesOids[] = {
- xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList ValidListfontsModes = {
- ValidListfontsModesOids, XpNumber(ValidListfontsModesOids)
-};
-
-static XpOid DefaultListfontsModesOids[] = {
- xpoid_val_xp_list_glyph_fonts
-};
-static XpOidList DefaultListfontsModes = {
- DefaultListfontsModesOids, XpNumber(DefaultListfontsModesOids)
-};
-
-static XpOid ValidSetupProvisoOids[] = {
- xpoid_val_xp_setup_mandatory, xpoid_val_xp_setup_optional
-};
-static XpOidList ValidSetupProviso = {
- ValidSetupProvisoOids, XpNumber(ValidSetupProvisoOids)
-};
-
-static XpOidDocFmt ValidDocFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL },
- { "PCL", "3", NULL }
-};
-static XpOidDocFmtList ValidDocFormatsSupported = {
- ValidDocFormatsSupportedFmts, XpNumber(ValidDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultDocFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList DefaultDocFormatsSupported = {
- DefaultDocFormatsSupportedFmts, XpNumber(DefaultDocFormatsSupportedFmts)
-};
-
-static XpOidDocFmtList ValidEmbeddedFormatsSupported = {
- (XpOidDocFmt *)NULL, 0
-};
-
-static XpOidDocFmtList DefaultEmbeddedFormatsSupported = {
- (XpOidDocFmt *)NULL, 0
-};
-
-static XpOidDocFmt ValidRawFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL },
- { "PCL", "3", NULL }
-};
-static XpOidDocFmtList ValidRawFormatsSupported = {
- ValidRawFormatsSupportedFmts, XpNumber(ValidRawFormatsSupportedFmts)
-};
-
-static XpOidDocFmt DefaultRawFormatsSupportedFmts[] = {
- { "Postscript", "2", NULL }
-};
-static XpOidDocFmtList DefaultRawFormatsSupported = {
- DefaultRawFormatsSupportedFmts, XpNumber(DefaultRawFormatsSupportedFmts)
-};
-
-static XpOidList ValidInputTrays = {
- (XpOid *)NULL, 0
-};
-
-static XpOid ValidMediumSizesOids[] = {
- xpoid_val_medium_size_iso_a0,
- xpoid_val_medium_size_iso_a1,
- xpoid_val_medium_size_iso_a2,
- xpoid_val_medium_size_iso_a3,
- xpoid_val_medium_size_iso_a4,
- xpoid_val_medium_size_iso_a5,
- xpoid_val_medium_size_iso_a6,
- xpoid_val_medium_size_iso_a7,
- xpoid_val_medium_size_iso_a8,
- xpoid_val_medium_size_iso_a9,
- xpoid_val_medium_size_iso_a10,
- xpoid_val_medium_size_iso_b0,
- xpoid_val_medium_size_iso_b1,
- xpoid_val_medium_size_iso_b2,
- xpoid_val_medium_size_iso_b3,
- xpoid_val_medium_size_iso_b4,
- xpoid_val_medium_size_iso_b5,
- xpoid_val_medium_size_iso_b6,
- xpoid_val_medium_size_iso_b7,
- xpoid_val_medium_size_iso_b8,
- xpoid_val_medium_size_iso_b9,
- xpoid_val_medium_size_iso_b10,
- xpoid_val_medium_size_na_letter,
- xpoid_val_medium_size_na_legal,
- xpoid_val_medium_size_executive,
- xpoid_val_medium_size_folio,
- xpoid_val_medium_size_invoice,
- xpoid_val_medium_size_ledger,
- xpoid_val_medium_size_quarto,
- xpoid_val_medium_size_iso_c3,
- xpoid_val_medium_size_iso_c4,
- xpoid_val_medium_size_iso_c5,
- xpoid_val_medium_size_iso_c6,
- xpoid_val_medium_size_iso_designated_long,
- xpoid_val_medium_size_na_10x13_envelope,
- xpoid_val_medium_size_na_9x12_envelope,
- xpoid_val_medium_size_na_number_10_envelope,
- xpoid_val_medium_size_na_7x9_envelope,
- xpoid_val_medium_size_na_9x11_envelope,
- xpoid_val_medium_size_na_10x14_envelope,
- xpoid_val_medium_size_na_number_9_envelope,
- xpoid_val_medium_size_monarch_envelope,
- xpoid_val_medium_size_a,
- xpoid_val_medium_size_b,
- xpoid_val_medium_size_c,
- xpoid_val_medium_size_d,
- xpoid_val_medium_size_e,
- xpoid_val_medium_size_jis_b0,
- xpoid_val_medium_size_jis_b1,
- xpoid_val_medium_size_jis_b2,
- xpoid_val_medium_size_jis_b3,
- xpoid_val_medium_size_jis_b4,
- xpoid_val_medium_size_jis_b5,
- xpoid_val_medium_size_jis_b6,
- xpoid_val_medium_size_jis_b7,
- xpoid_val_medium_size_jis_b8,
- xpoid_val_medium_size_jis_b9,
- xpoid_val_medium_size_jis_b10
-};
-static XpOidList ValidMediumSizes = {
- ValidMediumSizesOids, XpNumber(ValidMediumSizesOids)
-};
-
-static XpOidDocFmt DefaultDocumentFormat = {
- "Postscript", "2", NULL
-};
-
-static XpOid ValidAvailableCompressionsOids[] = {
- xpoid_val_available_compressions_0,
- xpoid_val_available_compressions_01,
- xpoid_val_available_compressions_02,
- xpoid_val_available_compressions_03,
- xpoid_val_available_compressions_012,
- xpoid_val_available_compressions_013,
- xpoid_val_available_compressions_023,
- xpoid_val_available_compressions_0123
-};
-
-static XpOidList ValidAvailableCompressions = {
- ValidAvailableCompressionsOids, XpNumber(ValidAvailableCompressionsOids)
-};
-
-static XpOid DefaultAvailableCompressionsOids[] = {
- xpoid_val_available_compressions_0123,
- xpoid_val_available_compressions_0
-};
-
-static XpOidList DefaultAvailableCompressions = {
- DefaultAvailableCompressionsOids, XpNumber(DefaultAvailableCompressionsOids)
-};
-
-
-/*
- * init struct for XpValidate*Pool
- */
-XpValidatePoolsRec RasterValidatePoolsRec = {
- &ValidContentOrientations, &DefaultContentOrientations,
- &ValidDocFormatsSupported, &DefaultDocFormatsSupported,
- &ValidInputTrays, &ValidMediumSizes,
- &ValidPlexes, &DefaultPlexes,
- &ValidPrinterResolutions, &DefaultPrinterResolutions,
- &ValidEmbeddedFormatsSupported, &DefaultEmbeddedFormatsSupported,
- &ValidListfontsModes, &DefaultListfontsModes,
- &ValidRawFormatsSupported, &DefaultRawFormatsSupported,
- &ValidSetupProviso,
- &DefaultDocumentFormat,
- &ValidAvailableCompressions, &DefaultAvailableCompressions
-};
diff --git a/afb/README b/afb/README
deleted file mode 100644
index 5c9586013..000000000
--- a/afb/README
+++ /dev/null
@@ -1,10 +0,0 @@
-
-All stuff in this directory is based on Xdaniver (read Xdaniver.doc).
-
-Actually this is the same code as in the ilbm directory, except that here the
-conversion from normal bitplanes to interleaved bitplanes didn't happen.
-
---
-Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be
-Wavelets, Linux/m68k on Amiga http://www.cs.kuleuven.ac.be/~geert/
-Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
diff --git a/afb/Xdaniver.doc b/afb/Xdaniver.doc
deleted file mode 100644
index 1c8ad5ad4..000000000
--- a/afb/Xdaniver.doc
+++ /dev/null
@@ -1,218 +0,0 @@
-
-What is it?
------------
-
-Xdaniver is a fast, colour X11R6 server for the Amiga's custom chip set
-under NetBSD 1.0 and NetBSD-current, supporting all the Amiga's display
-depths from 1 to 4 (upto 16 colours) on ECS machines and 1 to 8 (upto 256
-colours) on AGA machines (though, not all resolutions are available, see
-General Information below).
-
-Xdaniver is designed to be a drop-in replacement for the Xmono server provided
-with the X11R6 binary distribution supplied by Bernd Ernesti available from
-ftp.uni-regensburg.de or one of its mirrors.
-
-Unlike previous colour X servers for the Amiga that emulate a chunky pixel
-screen in fast RAM, use the standard frame buffer drivers provided with the
-X11R6 source code to draw and then use a chunky to planar conversion routine
-to write the results to the screen (all very slow), Xdaniver uses a heavily
-modified mono frame buffer driver to draw directly using the Amiga's planar
-format. The net result is much faster drawing and support for all the Amiga's
-custom display depths but, as usual, the fewer planes used, the faster the
-drawing operations of the X server. Even so, on my A1200 with a 33Mhz 68030,
-I'm getting reasonable performance when using 8 bit planes in Dbl NTSC mode.
-
-Installation
-------------
-
-You will need to have first obtained and installed the X11R6 binary
-distribution available from ftp.uni-regensburg.de in
-/pub/NetBSD-Amiga/contrib/X11 or one of its mirrors. Xdaniver has been
-compiled to expect font and configuration files sitting under
-/usr/local/X11R6, if your setup is different you will need to provide a
-symbolic link from /usr/local/X11R6 to where your tree resides or supply
-several command line flags to the server.
-
-To get Xdaniver running as the default X server, copy the uncompressed binary
-into /usr/local/X11R6/bin, remove the current X file from that directory
-(which is a symbolic link to Xmono) and replace it with a link to Xdaniver:
-
- gzip -d < X11R6.Xdaniver.1.01.tar.gz | tar xvf -
- mv Xdaniver /usr/local/X11R6/bin
- cd /usr/local/X11R6/bin
- rm X
- ln -s Xdaniver X
-
-Note that on some setups, the devices /dev/kbd, /dev/mouse and /dev/view??
-have been created to be accessable only by superuser; Xdaniver needs to open
-these devices. To workaround this problem, log on as superuser and then
-either make Xdaniver setuid root:
-
- chown root Xdaniver
- chmod 4755 Xdaniver
-
-or give everyone access the devices:
-
- chmod 666 /dev/kbd /dev/mouse /dev/view??
-
-the latter option is a possible cause of a security hole if your machine is
-ever used multi-user.
-
-General Information
--------------------
-
-The default resolution of the server is 700x430 and the default depth 4. AGA
-users might what to increase the display depth by editing the startx script
-and providing a -depth <depth> argument to Xdaniver on the xinit line of the
-script. As always, the lower the depth, the faster the drawing and window
-manipulation of the server.
-
-The resolution can be altered similarly by suppling -width <width> and
--height <height> arguments to the server.
-
-The NetBSD kernel selects actual screen modes by picking a mode who's
-natural, non-overscanned size best-fits the requested resolution.
-Unfortunately, for AGA users, the 1.0 kernel only has support for the
-Dbl-NTSC AGA display mode and only this mode has support for depths greater
-than 4. The NetBSD-current (work-in-progress) kernel also has support for
-Dbl-PAL but still no support for the Super72 or other super-hires modes
-(perhaps some kind, kernel-hacker could add support for them ?).
-
-If you have a 2 button mouse (like me) you might want to try and use the 3
-button mouse emulation. On other systems, it is usual for the left and right
-buttons to be provided and emulate the middle button by pressing both
-buttons together, however, the middle button is tends to be used more than
-the right button so I have provided two options:
-
--emulateright (or -3), the two physical mouse buttons act as left and middle
-and pressing them both together emulates the right button.
-
--emulatemiddle (or -2), the two physical mouse buttons act as left and right
-and pressing them both together emulated the middle button.
-
-When using screen depths of less than 6 (4 is the maximum for ECS machines)
-the lack of possible colours on screen at once causes problems for many X
-applications. Specifying -cc 2 as a command line argument to Xdaniver
-causes the server to switch the default visual type from PsuedoColor to
-StaticColor; to put it simply, the server prefills the colormap with a
-selection of 16 colours (depth 4) and when an application asks for a
-particular colour, its gets allocated one that is closest to one from the
-selection of 16. This removes the 'WARNING: Cannot allocate colormap entry
-for "XXX"' errors but at the expense of applications not being able to get
-the precise colour they wanted. Also, some badly written X applications fail
-altogether when presented with a StaticColor visual.
-
-Bugs/Limitations
-----------------
-
-The limited choice of display resolutions for AGA/ECS machines is a real
-pain - requires a kernel change to fix. Worse still, the kernel specifies
-the maximum overscan resolution on the Dbl-NTSC to be 724x482 but selecting
-anything more than 702x430 on my machine causes the screen either sheer
-diagonally (as if the bytes per row calculation in Xdaniver or the kernel is
-wrong) or completely loose sync (suggesting a custom chip register sync
-calculation bug). As other, non-aga modes aren't affected when selection
-overscan both problems seem to point to a kernel driver bug. Also, depths
-greater than 4 for AGA users are only supported by the kernel in the Dbl-NTSC
-mode (and Dbl-PAL with the current-NetBSD kernel).
-
-I know of one bug so-far (there will be more), The PutImage request of an XY
-format image expects the bitplane order to be the reverse of that specified
-in the X protocol but since virtually all applications use the Z (chunky)
-format, you are unlikely to come across this problem.
-
-The PutImage request of Z format images is a little slow - when I have time
-I'll try and add one of the fast assembly chunky-to-planar routines developed
-for doom style games/demos. Unfortunately, the current crop all require a
-picture size that is a multiple of 32 pixels and so cannot be used out-of-the-
-box.
-
-Some extra performance could easily be squeezed out of the terminal font
-drawing code (used by xterm) - when I have time I'll add the code.
-
-The Amiga's blitter and sprites are totally unused and will remain so
-until/if someone else adds support to the kernel. The blitter would help
-speed up screen scrolling and window manipulation and sprite support could
-be used for the X pointer shape (if small enough) which would speed up all
-drawing operations (no need to remove the software based pointer shape
-first, draw, then replace the pointer shape).
-
-I removed the X image extension (XIE) from the X server as it increased the
-size of the binary by some 400k. I haven't come across any applications that
-need it yet (I haven't been looking!) so if you need the extension for some
-reason send me e-mail and I'll build a server with the extension included.
-
-The 3 button mouse emulation is very simple - to emulate the 3rd button you
-have to press both button precisely at the same moment - I've got quite good
-at it now. When I have some spare time I'll add a timer so you will have a
-few milli-seconds between one button being pressed and the next and it still
-being registered as the emulated button.
-
-AGA users don't forget to provide the -A flag to loadbsd to enable the one
-AGA mode in the 1.0 kernel but only if you have a VGA, multisync or dual-scan
-monitor, of course !
-
-Xdaniver has been tested on:
-
-A1200, 33Mhz 68030, 8Mb RAM and NetBSD 1.0 by myself.
-A4000/40, 12Mb RAM and NetBSD 1.0 by Andreas Holzhammer.
-A3000, 12Mb RAM and NetBSD 1.0 by Charlie Root, Stuart Park and others.
-A3000, 25Mhz 68040, 18Mb RAM and NetBSD-current by Michael K. Sanders.
-A2000, 8Mb RAM and NetBSD (version unknown) by Hubert Feyrer.
-
-Release and Bug Fix History
----------------------------
-
-1.0 - First release
-
-1.01 Bugs fixed:
- - Narrow (<32 pixels) Z format GetImage requests corrupted the stack
- and could cause the server to core dump. (Xpaint caused this problem)
- - Drawing dots (PolyPoint request) into a clipped window caused a
- c pointer to go out of range, causing a core dump (xv showed this
- problem).
-
- New features:
- - Simple 3 button mouse emulation using a 2 button mouse; specify
- -emulate_middle (or -2) or -emulate_right (or -3) on the server's
- command line and press both mouse buttons together emulate the 'missing'
- button.
- - Basic beep sound support added by sending bell characters to the
- console.
- - Source code released.
-
-Disclaimer and Copyright Notices
---------------------------------
-
-Multi-depth planar frame buffer code:
-Copyright (c) 1995 by Daniver Limited.
-
-Large portions:
-Copyright (c) 1994 by Eduardo Horvath.
-Copyright (c) 1987-1995 by the Regents of the University of California.
-Copyright (c) 1987 by Sun Microsystems, Inc. Mountain View, CA.
-Copyright (c) 1987-1995 by X Consortium.
-Copyright (c) 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-Copyright (c) 1989 Network Computing Devices, Inc., Mountain View, California.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted, provided
-that the above copyright notice appear in all copies. The Daniver Limited,
-the above companies and individuals makes no representations about the
-suitability of this software for any purpose. It is provided "as is" without
-express or implied warranty.
-
-Credits
--------
-
-Thanks to Bernd Ernesti for making the operating system server source code
-available for others to use and Eduardo Horvath and Andy Heffernan, who (I
-think) did the original Xmono server port.
-
-Also, many thanks to the first brave users who tested Xdaniver for me on other
-Amiga setups and found a few bugs in the process.
-
-Gary Henderson.
-
-Daytime: garyh@wet.sbi.com
-Home: gary@daniver.demon.co.uk
diff --git a/afb/afb.h b/afb/afb.h
deleted file mode 100644
index 1f6401782..000000000
--- a/afb/afb.h
+++ /dev/null
@@ -1,1132 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.11 2003/11/17 22:20:32 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afb.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */
-/* Monochrome Frame Buffer definitions
- written by drewry, september 1986
-*/
-
-#include "pixmap.h"
-#include "region.h"
-#include "gc.h"
-#include "colormap.h"
-#include "regionstr.h"
-#include "mibstore.h"
-#include "mfb.h"
-
-extern int afbInverseAlu[];
-extern int afbScreenPrivateIndex;
-/* warning: PixelType definition duplicated in maskbits.h */
-#ifndef PixelType
-#define PixelType CARD32
-#endif /* PixelType */
-
-#define AFB_MAX_DEPTH 8
-
-/* afbbitblt.c */
-
-extern void afbDoBitblt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-extern RegionPtr afbBitBlt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (*doBitBlt)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
- ),
- unsigned long /*planemask*/
-);
-
-extern RegionPtr afbCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-extern RegionPtr afbCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/
-);
-
-extern void afbCopy1ToN(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbltC.c */
-
-extern void afbDoBitbltCopy(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbltCI.c */
-
-extern void afbDoBitbltCopyInverted(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbltG.c */
-
-extern void afbDoBitbltGeneral(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbltO.c */
-
-extern void afbDoBitbltOr(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbltX.c */
-
-extern void afbDoBitbltXor(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* afbbres.c */
-
-extern void afbBresS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-/* afbbresd.c */
-
-extern void afbBresD(
- int * /*pdashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pdashOffset*/,
- int /*isDoubleDash*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/,
- unsigned char * /*rrops*/,
- unsigned char * /*bgrrops*/
-);
-/* afbbstore.c */
-
-extern void afbSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void afbRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-/* afbclip.c */
-
-extern RegionPtr afbPixmapToRegion(
- PixmapPtr /*pPix*/
-);
-
-/* afbcmap.c */
-
-extern int afbListInstalledColormaps(
- ScreenPtr /*pScreen*/,
- Colormap * /*pmaps*/
-);
-
-extern void afbInstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void afbUninstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void afbResolveColor(
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/,
- VisualPtr /*pVisual*/
-);
-
-extern Bool afbInitializeColormap(
- ColormapPtr /*pmap*/
-);
-
-extern int afbExpandDirectColors(
- ColormapPtr /*pmap*/,
- int /*ndefs*/,
- xColorItem * /*indefs*/,
- xColorItem * /*outdefs*/
-);
-
-extern Bool afbCreateDefColormap(
- ScreenPtr /*pScreen*/
-);
-
-extern Bool afbSetVisualTypes(
- int /*depth*/,
- int /*visuals*/,
- int /*bitsPerRGB*/
-);
-
-extern Bool afbInitVisuals(
- VisualPtr * /*visualp*/,
- DepthPtr * /*depthp*/,
- int * /*nvisualp*/,
- int * /*ndepthp*/,
- int * /*rootDepthp*/,
- VisualID * /*defaultVisp*/,
- unsigned long /*sizes*/,
- int /*bitsPerRGB*/
-);
-
-/* afbfillarc.c */
-
-extern void afbPolyFillArcSolid(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* afbfillrct.c */
-
-extern void afbPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-
-/* afbply1rct.c */
-extern void afbFillPolygonSolid(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*shape*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-
-/* afbfillsp.c */
-
-extern void afbSolidFS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbUnnaturalTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbUnnaturalStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbOpaqueStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void afbUnnaturalOpaqueStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-/* afbfont.c */
-
-extern Bool afbRealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-
-extern Bool afbUnrealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-/* afbgc.c */
-
-extern Bool afbCreateGC(
- GCPtr /*pGC*/
-);
-
-extern void afbValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-extern void afbDestroyGC(
- GCPtr /*pGC*/
-);
-
-extern void afbReduceRop(
- int /*alu*/,
- Pixel /*src*/,
- unsigned long /*planemask*/,
- int /*depth*/,
- unsigned char * /*rrops*/
-);
-
-extern void afbReduceOpaqueStipple (
- Pixel /*fg*/,
- Pixel /*bg*/,
- unsigned long /*planemask*/,
- int /*depth*/,
- unsigned char * /*rrops*/
-);
-
-extern void afbComputeCompositeClip(
- GCPtr /*pGC*/,
- DrawablePtr /*pDrawable*/
-);
-
-/* afbgetsp.c */
-
-extern void afbGetSpans(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/
-);
-/* afbhrzvert.c */
-
-extern void afbHorzS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-
-extern void afbVertS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-/* afbigbblak.c */
-
-extern void afbImageGlyphBlt (
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* afbigbwht.c */
-
-/* afbimage.c */
-
-extern void afbPutImage(
- DrawablePtr /*dst*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-extern void afbGetImage(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-/* afbline.c */
-
-extern void afbLineSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void afbLineSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-/* afbmisc.c */
-
-extern void afbQueryBestSize(
- int /*class*/,
- unsigned short * /*pwidth*/,
- unsigned short * /*pheight*/,
- ScreenPtr /*pScreen*/
-);
-/* afbpntarea.c */
-
-extern void afbSolidFillArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- unsigned char * /*rrops*/
-);
-
-extern void afbStippleAreaPPW(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- PixmapPtr /*pstipple*/,
- unsigned char * /*rrops*/
-);
-extern void afbStippleArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- PixmapPtr /*pstipple*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char * /*rrops*/
-);
-/* afbplygblt.c */
-
-extern void afbPolyGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-
-/* afbpixmap.c */
-
-extern PixmapPtr afbCreatePixmap(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/
-);
-
-extern Bool afbDestroyPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern PixmapPtr afbCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void afbPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern void afbXRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rw*/
-);
-
-extern void afbYRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rh*/
-);
-
-extern void afbCopyRotatePixmap(
- PixmapPtr /*psrcPix*/,
- PixmapPtr * /*ppdstPix*/,
- int /*xrot*/,
- int /*yrot*/
-);
-extern void afbPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*pRegion*/,
- int /*what*/
-);
-/* afbpolypnt.c */
-
-extern void afbPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-/* afbpushpxl.c */
-
-extern void afbPushPixels(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-/* afbscrclse.c */
-
-extern Bool afbCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-/* afbscrinit.c */
-
-extern Bool afbAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*pWinIndex*/,
- int * /*pGCIndex*/
-);
-
-extern Bool afbScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern PixmapPtr afbGetWindowPixmap(
- WindowPtr /*pWin*/
-);
-
-extern void afbSetWindowPixmap(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/
-);
-
-/* afbseg.c */
-
-extern void afbSegmentSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-
-extern void afbSegmentSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-/* afbsetsp.c */
-
-extern void afbSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- PixelType * /*psrc*/,
- int /*alu*/,
- PixelType * /*pdstBase*/,
- int /*widthDst*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*sizeSrc*/
-);
-
-extern void afbSetSpans(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/
-);
-/* afbtegblt.c */
-
-extern void afbTEGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* afbtileC.c */
-
-extern void afbTileAreaPPWCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned long /*planemask*/
-);
-/* afbtileG.c */
-
-extern void afbTileAreaPPWGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned long /*planemask*/
-);
-
-extern void afbTileAreaCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned long /*planemask*/
-);
-/* afbtileG.c */
-
-extern void afbTileAreaGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned long /*planemask*/
-);
-
-extern void afbOpaqueStippleAreaPPWCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-/* afbtileG.c */
-
-extern void afbOpaqueStippleAreaPPWGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-
-extern void afbOpaqueStippleAreaCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-/* afbtileG.c */
-
-extern void afbOpaqueStippleAreaGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-
-/* afbwindow.c */
-
-extern Bool afbCreateWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool afbDestroyWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool afbMapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern Bool afbPositionWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/
-);
-
-extern Bool afbUnmapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern void afbCopyWindow(
- WindowPtr /*pWin*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/
-);
-
-extern Bool afbChangeWindowAttributes(
- WindowPtr /*pWin*/,
- unsigned long /*mask*/
-);
-/* afbzerarc.c */
-
-extern void afbZeroPolyArcSS(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-/*
- private field of pixmap
- pixmap.devPrivate = (PixelType *)pointer_to_bits
- pixmap.devKind = width_of_pixmap_in_bytes
-
- private field of screen
- a pixmap, for which we allocate storage. devPrivate is a pointer to
-the bits in the hardware framebuffer. note that devKind can be poked to
-make the code work for framebuffers that are wider than their
-displayable screen (e.g. the early vsII, which displayed 960 pixels
-across, but was 1024 in the hardware.)
-
- private field of GC
-*/
-
-typedef struct {
- unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */
- unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */
-} afbPrivGC;
-typedef afbPrivGC *afbPrivGCPtr;
-
-extern int afbGCPrivateIndex; /* index into GC private array */
-extern int afbWindowPrivateIndex; /* index into Window private array */
-#ifdef PIXMAP_PER_WINDOW
-extern int frameWindowPrivateIndex; /* index into Window private array */
-#endif
-
-#define afbGetGCPrivate(pGC) \
- ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
-
-/* private field of window */
-typedef struct {
- unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
- unsigned char fastBackground;
- unsigned short unused; /* pad for alignment with Sun compiler */
- DDXPointRec oldRotate;
- PixmapPtr pRotatedBackground;
- PixmapPtr pRotatedBorder;
-} afbPrivWin;
-
-/* Common macros for extracting drawing information */
-
-#define afbGetTypedWidth(pDrawable,wtype)( \
- (((pDrawable)->type == DRAWABLE_WINDOW) ? \
- (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
- (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
-
-#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
-
-#define afbGetPixelWidth(pDrawable) afbGetTypedWidth(pDrawable, PixelType)
-
-#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
- else \
- _pPix = (PixmapPtr)(pDrawable); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
- else \
- _pPix = (PixmapPtr)(pDrawable); \
- (pointer) = (PixelType *)_pPix->devPrivate.ptr; \
- (width) = ((int)_pPix->devKind) / sizeof (PixelType); \
- (size) = (width) * _pPix->drawable.height; \
- (dep) = _pPix->drawable.depth; (void)(dep); \
-}
-
-#define afbGetByteWidthAndPointer(pDrawable, width, pointer) \
- afbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
-
-#define afbGetPixelWidthAndPointer(pDrawable, width, pointer) \
- afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define afbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
- afbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
-
-#define afbGetWindowByteWidthAndPointer(pWin, width, pointer) \
- afbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
-
-/* afb uses the following macros to calculate addresses in drawables.
- * To support banked framebuffers, the macros come in four flavors.
- * All four collapse into the same definition on unbanked devices.
- *
- * afbScanlineFoo - calculate address and do bank switching
- * afbScanlineFooNoBankSwitch - calculate address, don't bank switch
- * afbScanlineFooSrc - calculate address, switch source bank
- * afbScanlineFooDst - calculate address, switch destination bank
- */
-
-/* The NoBankSwitch versions are the same for banked and unbanked cases */
-
-#define afbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
-#define afbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
-#define afbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
- afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
-#define afbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
- afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
-
-#ifdef MFB_LINE_BANK
-
-#include "afblinebank.h" /* get macro definitions from this file */
-
-#else /* !MFB_LINE_BANK - unbanked case */
-
-#define afbScanlineInc(_ptr, _off) afbScanlineIncNoBankSwitch(_ptr, _off)
-#define afbScanlineIncSrc(_ptr, _off) afbScanlineInc(_ptr, _off)
-#define afbScanlineIncDst(_ptr, _off) afbScanlineInc(_ptr, _off)
-
-#define afbScanlineOffset(_ptr, _off) afbScanlineOffsetNoBankSwitch(_ptr, _off)
-#define afbScanlineOffsetSrc(_ptr, _off) afbScanlineOffset(_ptr, _off)
-#define afbScanlineOffsetDst(_ptr, _off) afbScanlineOffset(_ptr, _off)
-
-#define afbScanlineSrc(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
-#define afbScanlineDst(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
-
-#define afbScanlineDeltaSrc(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
-#define afbScanlineDeltaDst(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
-
-#endif /* MFB_LINE_BANK */
-
-#define afbScanlineDelta(_ptr, _y, _w) \
- afbScanlineOffset(_ptr, (_y) * (_w))
-
-#define afbScanline(_ptr, _x, _y, _w) \
- afbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
-
-/* precomputed information about each glyph for GlyphBlt code.
- this saves recalculating the per glyph information for each box.
-*/
-
-typedef struct _afbpos{
- int xpos; /* xposition of glyph's origin */
- int xchar; /* x position mod 32 */
- int leftEdge;
- int rightEdge;
- int topEdge;
- int bottomEdge;
- PixelType *pdstBase; /* longword with character origin */
- int widthGlyph; /* width in bytes of this glyph */
-} afbTEXTPOS;
-
-/* reduced raster ops for afb */
-#define RROP_BLACK GXclear
-#define RROP_WHITE GXset
-#define RROP_NOP GXnoop
-#define RROP_INVERT GXinvert
-#define RROP_COPY GXcopy
-
-/* macros for afbbitblt.c, afbfillsp.c
- these let the code do one switch on the rop per call, rather
- than a switch on the rop per item (span or rectangle.)
-*/
-
-#define fnCLEAR(src, dst) (0)
-#define fnAND(src, dst) (src & dst)
-#define fnANDREVERSE(src, dst) (src & ~dst)
-#define fnCOPY(src, dst) (src)
-#define fnANDINVERTED(src, dst) (~src & dst)
-#define fnNOOP(src, dst) (dst)
-#define fnXOR(src, dst) (src ^ dst)
-#define fnOR(src, dst) (src | dst)
-#define fnNOR(src, dst) (~(src | dst))
-#define fnEQUIV(src, dst) (~src ^ dst)
-#define fnINVERT(src, dst) (~dst)
-#define fnORREVERSE(src, dst) (src | ~dst)
-#define fnCOPYINVERTED(src, dst) (~src)
-#define fnORINVERTED(src, dst) (~src | dst)
-#define fnNAND(src, dst) (~(src & dst))
-#undef fnSET
-#define fnSET(src, dst) (~0)
-
-/* Using a "switch" statement is much faster in most cases
- * since the compiler can do a look-up table or multi-way branch
- * instruction, depending on the architecture. The result on
- * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
- * distribution of RasterOp operation types.
- *
- * However, doing some profiling on a running system reveals
- * GXcopy is the operation over 99.5% of the time and
- * GXxor is the next most frequent (about .4%), so we make special
- * checks for those first.
- *
- * Note that this requires a change to the "calling sequence"
- * since we can't engineer a "switch" statement to have an lvalue.
- */
-#undef DoRop
-#define DoRop(result, alu, src, dst) \
-{ \
- if (alu == GXcopy) \
- result = fnCOPY (src, dst); \
- else if (alu == GXxor) \
- result = fnXOR (src, dst); \
- else \
- switch (alu) { \
- case GXclear: \
- result = fnCLEAR (src, dst); \
- break; \
- case GXand: \
- result = fnAND (src, dst); \
- break; \
- case GXandReverse: \
- result = fnANDREVERSE (src, dst); \
- break; \
- case GXandInverted: \
- result = fnANDINVERTED (src, dst); \
- break; \
- default: \
- case GXnoop: \
- result = fnNOOP (src, dst); \
- break; \
- case GXor: \
- result = fnOR (src, dst); \
- break; \
- case GXnor: \
- result = fnNOR (src, dst); \
- break; \
- case GXequiv: \
- result = fnEQUIV (src, dst); \
- break; \
- case GXinvert: \
- result = fnINVERT (src, dst); \
- break; \
- case GXorReverse: \
- result = fnORREVERSE (src, dst); \
- break; \
- case GXcopyInverted: \
- result = fnCOPYINVERTED (src, dst); \
- break; \
- case GXorInverted: \
- result = fnORINVERTED (src, dst); \
- break; \
- case GXnand: \
- result = fnNAND (src, dst); \
- break; \
- case GXset: \
- result = fnSET (src, dst); \
- break; \
- } \
-}
-
-
-/* C expression fragments for various operations. These get passed in
- * as -D's on the compile command line. See afb/Imakefile. This
- * fixes XBUG 6319.
- *
- * This seems like a good place to point out that afb's use of the
- * words black and white is an unfortunate misnomer. In afb code, black
- * means zero, and white means one.
- */
-#define MFB_OPEQ_WHITE |=
-#define MFB_OPEQ_BLACK &=~
-#define MFB_OPEQ_INVERT ^=
-#define MFB_EQWHOLEWORD_WHITE =~0
-#define MFB_EQWHOLEWORD_BLACK =0
-#define MFB_EQWHOLEWORD_INVERT ^=~0
-#define MFB_OP_WHITE /* nothing */
-#define MFB_OP_BLACK ~
-
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
-
diff --git a/afb/afbbitblt.c b/afb/afbbitblt.c
deleted file mode 100644
index 7f04a7de0..000000000
--- a/afb/afbbitblt.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbbitblt.c,v 3.6 2003/11/10 18:21:44 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbbitblt.c,v 5.25 94/04/17 20:28:16 dpw Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mi.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-
-static unsigned char afbRropsOS[AFB_MAX_DEPTH];
-
-/* CopyArea and CopyPlane for a monchrome frame buffer
-
-
- clip the source rectangle to the source's available bits. (this
-avoids copying unnecessary pieces that will just get exposed anyway.)
-this becomes the new shape of the destination.
- clip the destination region to the composite clip in the
-GC. this requires translating the destination region to (dstx, dsty).
- build a list of source points, one for each rectangle in the
-destination. this is a simple translation.
- go do the multiple rectangle copies
- do graphics exposures
-*/
-/** Optimized for drawing pixmaps into windows, especially when drawing into
- ** unobscured windows. Calls to the general-purpose region code were
- ** replaced with rectangle-to-rectangle clipping comparisions. This is
- ** possible, since the pixmap is a single rectangle. In an unobscured
- ** window, the destination clip is also a single rectangle, and region
- ** code can be avoided entirely. This is a big savings, since the region
- ** code uses XAlloc() and makes many function calls.
- **
- ** In addition, if source is a pixmap, there is no need to call the
- ** expensive miHandleExposures() routine. Instead, we simply return NULL.
- **
- ** Previously, drawing a pixmap into an unobscured window executed at least
- ** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code.
- **
- ** Now, the same operation requires no XAlloc()'s, no region function calls,
- ** and much less overhead. Nice for drawing lots of small pixmaps.
- */
-
-void
-afbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- switch (alu) {
- case GXcopy:
- afbDoBitbltCopy(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXxor:
- afbDoBitbltXor(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXcopyInverted:
- afbDoBitbltCopyInverted(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXor:
- afbDoBitbltOr(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- default:
- afbDoBitbltGeneral(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- }
-}
-
-RegionPtr
-afbCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
-{
- void (*doBitBlt)();
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = afbDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = afbDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = afbDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = afbDoBitbltOr;
- break;
- default:
- doBitBlt = afbDoBitbltGeneral;
- break;
- }
-
- return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
- width, height, dstx, dsty, doBitBlt, pGC->planemask));
-}
-
-RegionPtr
-afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty, doBitBlt, planemask)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- register GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- void (*doBitBlt)();
- unsigned long planemask;
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) && pSrcDrawable->pScreen->SourceValidate)
- (*pSrcDrawable->pScreen->SourceValidate)(pSrcDrawable, srcx, srcy, width,
- height);
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else
- fastClip = 1;
- else if (pGC->subWindowMode == IncludeInferiors)
- if (!((WindowPtr)pSrcDrawable)->parent)
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- else if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- else
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip) {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x) {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y) {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int)pSrcDrawable->width) {
- fastBox.x2 = pSrcDrawable->x + (int)pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int)pSrcDrawable->height) {
- fastBox.y2 = pSrcDrawable->y + (int)pSrcDrawable->height;
- fastExpose = 0;
- }
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- if (!((WindowPtr)pDstDrawable)->realized) {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip) {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
- cclip = pGC->pCompositeClip;
- if (REGION_NUM_RECTS(cclip) == 1) {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1)
- fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2)
- fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1)
- fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2)
- fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
- REGION_NULL(pGC->pScreen, &rgnDst);
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- } else {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
- }
- } else
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
-
- if (!fastClip) {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
- pGC->pCompositeClip);
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height) {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec)))) {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc,
- planemask);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose) {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height, origDest.x,
- origDest.y, (unsigned long)0);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-RegionPtr
-afbCopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty, plane)
-DrawablePtr pSrcDrawable, pDstDrawable;
-register GC *pGC;
-int srcx, srcy;
-int width, height;
-int dstx, dsty;
-unsigned long plane;
-{
- int alu;
- RegionPtr prgnExposed = NULL;
- unsigned long old_planemask;
-
- if (pDstDrawable->depth == 1) {
- old_planemask = pGC->planemask;
- pGC->planemask = plane;
- if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) {
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- } else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) {
- unsigned char rop;
-
- afbReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop);
- alu = pGC->alu;
- pGC->alu = rop;
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- } else { /* need to invert the src */
- alu = pGC->alu;
- pGC->alu = afbInverseAlu[alu];
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- }
- pGC->planemask = old_planemask;
- } else {
- int free_pixmap = FALSE;
- PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable;
- ScreenPtr pScreen = pSrcDrawable->pScreen;
- GCPtr pGC1 = NULL;
-
- if (pSrcDrawable == pDstDrawable ||
- pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) {
- /* Copy a plane from source drawable to a tmp 1-bit deep pixmap */
- /* XXX: Range check width and height */
- pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1);
-
- if (!pBitmap)
- return(NULL);
- pGC1 = GetScratchGC(1, pScreen);
- if (!pGC1) {
- (*pScreen->DestroyPixmap)(pBitmap);
- return(NULL);
- }
- ValidateGC((DrawablePtr)pBitmap, pGC1);
- (void)afbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy,
- width, height, 0, 0, afbDoBitbltCopy, plane);
- free_pixmap = TRUE;
- }
-#if 0
- else {
- /* XXX: could cope with N-deep pixmap source case without using tmp
- * src bitmap by setting up a scratch pixmap header and fiddle
- * around with the pbits pointer.
- */
- }
-#endif
- afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, afbRropsOS);
- (void)afbBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width,
- height, dstx, dsty, afbCopy1ToN, pGC->planemask);
- if (free_pixmap) {
- (*pScreen->DestroyPixmap)(pBitmap);
- FreeScratchGC(pGC1);
- }
-
- if (pGC->fExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx,
- srcy, width, height, dstx, dsty,
- plane);
- }
- return prgnExposed;
-}
-
-void
-afbCopy1ToN(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- int numRects = REGION_NUM_RECTS(prgnDst);
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int r;
-
- for (r = 0; r < numRects; r++, pbox++, pptSrc++) {
- int dx = pptSrc->x;
- int dy = pptSrc->y;
-
- if (alu == GXcopy)
- afbOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy,
- afbRropsOS, planemask);
- else
- afbOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx,
- dy, afbRropsOS, planemask);
- }
-}
diff --git a/afb/afbblt.c b/afb/afbblt.c
deleted file mode 100644
index c0b48130e..000000000
--- a/afb/afbblt.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbblt.c,v 3.1 2001/10/28 03:32:57 tsi Exp $ */
-/*
- * afb copy area
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-Author: Keith Packard
-
-*/
-/* $XConsortium: afbblt.c,v 1.11 94/04/17 20:28:16 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-#include "fastblt.h"
-#include "mergerop.h"
-
-void
-MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- PixelType *psrcBase, *pdstBase; /* start of src and dst bitmaps */
- int widthSrc, widthDst; /* add to get to same position in next line */
- int sizeSrc, sizeDst;
-
- BoxPtr pbox;
- int nbox;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int xdir; /* 1 = left right, -1 = right left/ */
- int ydir; /* 1 = top down, -1 = bottom up */
-
- PixelType *psrcLine, *pdstLine;
- /* pointers to line with current src and dst */
- register PixelType *psrc; /* pointer to current src longword */
- register PixelType *pdst; /* pointer to current dst longword */
-
- MROP_DECLARE_REG()
-
- /* following used for looping through a line */
- PixelType startmask, endmask; /* masks for writing ends of dst */
- int nlMiddle; /* whole longwords in dst */
- int xoffSrc, xoffDst;
- register int leftShift, rightShift;
- register PixelType bits;
- register PixelType bits1;
- register int nl; /* temp copy of nlMiddle */
-
- int careful;
- int depthSrc;
- int depthDst;
-
- MROP_INITIALIZE(alu,0);
-
- afbGetPixelWidthSizeDepthAndPointer(pSrc, widthSrc, sizeSrc, depthSrc,
- psrcBase);
- afbGetPixelWidthSizeDepthAndPointer(pDst, widthDst, sizeDst, depthDst,
- pdstBase);
-
- /* Special case where depth of dest pixmap is 1 but source pixmap isn't
- * Used for GetImage to copy a plane from a source pixmap to a particular
- * dest pixmap plane.
- * Note: planemask should have only one bit set or several planes from
- * the source will be copied to the same dest plane.
- */
- if (depthDst == 1 && depthDst != depthSrc)
- sizeDst = 0;
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1)) {
- /* walk source botttom to top */
- ydir = -1;
- widthSrc = -widthSrc;
- widthDst = -widthDst;
-
- if (nbox > 1) {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if(!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1)) {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1) {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2) {
- if (pptNew2)
- DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2)
- DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) && (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* walk source left to right */
- xdir = 1;
- }
-
- while(nbox--) {
- int d;
- for (d = 0; d < depthSrc; d++) {
- PixelType *psrcB;
- PixelType *pdstB;
-
- if (!(planemask & (1 << d)))
- continue;
-
- psrcB = psrcBase + sizeSrc * d; /* @@@ NEXT PLANE @@@ */
- pdstB = pdstBase + sizeDst * d; /* @@@ NEXT PLANE @@@ */
-
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- if (ydir == -1) { /* start at last scanline of rectangle */
- psrcLine = afbScanlineDeltaSrc(psrcB, -(pptSrc->y+h-1), widthSrc);
- pdstLine = afbScanlineDeltaDst(pdstB, -(pbox->y2-1), widthDst);
- } else { /* start at first scanline */
- psrcLine = afbScanlineDeltaSrc(psrcB, pptSrc->y, widthSrc);
- pdstLine = afbScanlineDeltaDst(pdstB, pbox->y1, widthDst);
- }
- if ((pbox->x1 & PIM) + w <= PPW) {
- maskpartialbits (pbox->x1, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
- }
- if (xdir == 1) {
- xoffSrc = pptSrc->x & PIM;
- xoffDst = pbox->x1 & PIM;
- pdstLine += (pbox->x1 >> PWSH);
- psrcLine += (pptSrc->x >> PWSH);
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)(((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- if (startmask) {
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- psrc++;
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
-#ifdef NOTDEF
- /* you'd think this would be faster --
- * a single instruction instead of 6
- * but measurements show it to be ~15% slower
- */
- while ((nl -= 6) >= 0) {
- asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
- : "=m" (*(char *)pdst)
- : "m" (*(char *)psrc)
- : "d0", "d1", "d2", "d3",
- "a2", "a3");
- pdst += 6;
- }
- nl += 6;
- while (nl--)
- *pdst++ = *psrc++;
-#endif
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif
-
- if (endmask)
- *pdst = MROP_MASK(*psrc, *pdst, endmask);
- afbScanlineIncDst(pdstLine, widthDst);
- afbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else {
- if (xoffSrc > xoffDst) {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- } else {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- }
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffSrc > xoffDst)
- bits = *psrc++;
- if (startmask) {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc++;
- bits1 |= BitRight(bits,rightShift);
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
-bits = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
-bits1 = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
-pdst++;
-
-#define BodyEven(n) \
-bits1 = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
-pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-
- if (endmask) {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift)) {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- afbScanlineIncDst(pdstLine, widthDst);
- afbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#endif /* DO_UNALIGNED_BITBLT */
- } else { /* xdir == -1 */
- xoffSrc = (pptSrc->x + w - 1) & PIM;
- xoffDst = (pbox->x2 - 1) & PIM;
- pdstLine += ((pbox->x2-1) >> PWSH) + 1;
- psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)
- (((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- if (endmask) {
- pdst--;
- psrc--;
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
-
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset \
-pdst -= UNROLL;\
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
-#define BodyEven(n) BodyOdd(n)
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl,label3,
- --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
-#endif
-
- if (startmask) {
- --pdst;
- --psrc;
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- }
- afbScanlineIncDst(pdstLine, widthDst);
- afbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else {
- if (xoffDst > xoffSrc) {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- } else {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- }
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffDst > xoffSrc)
- bits = *--psrc;
- if (endmask) {
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- pdst--;
- *pdst = MROP_MASK(bits1, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) \
-bits = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
-
-#define BodyEven(n) \
-bits1 = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
-
-#define LoopReset \
-pdst -= UNROLL; \
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
-
-#define BodyEven(n) \
-bits1 = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
-
-#define LoopReset ;
-
-#endif
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl, label4,
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- --pdst;
- *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
- )
-#endif
-
- if (startmask) {
- bits1 = BitRight(bits, rightShift);
- if (BitRight (startmask, leftShift)) {
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- }
- --pdst;
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- }
- afbScanlineIncDst(pdstLine, widthDst);
- afbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#endif
- }
- }
- pbox++;
- pptSrc++;
- }
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
diff --git a/afb/afbbres.c b/afb/afbbres.c
deleted file mode 100644
index 227f3bc1f..000000000
--- a/afb/afbbres.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbbres.c,v 3.0 1996/08/18 01:45:25 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbbres.c,v 1.22 94/04/17 20:28:17 dpw Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "afb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-afbBresS(addrlbase, nlwidth, sizeDst, depthDst, signdx, signdy, axis, x1, y1,
- e, e1, e2, len, rrops)
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int sizeDst;
-int depthDst;
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-unsigned char *rrops;
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl; /* bitmask long pointer */
- register PixelType bit; /* current bit being set/cleared/etc. */
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
-
- register int e3 = e2-e1;
- PixelType tmp;
- int saveE;
- int saveLen;
- int d;
-
- /* point to longword containing first point */
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
-
- if (!len)
- return;
-
- saveLen = len;
- saveE = e;
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(addrlbase, x1, y1, nlwidth);
- addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */
- len = saveLen;
- e = saveE;
- bit = mask[x1 & PIM];
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- tmp = *addrl;
- for (;;) {
- tmp &= ~bit;
- if (!--len)
- break;
- bit = SCRRIGHT(bit,1);
- e += e1;
- if (e >= 0) {
- *addrl = tmp;
- afbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- } else {
- tmp = *addrl;
- for (;;) {
- tmp &= ~bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- afbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while(len--) {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- } else {
- while(len--) {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- break;
-
- case RROP_WHITE:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- tmp = *addrl;
- for (;;) {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRRIGHT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- afbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- } else {
- tmp = *addrl;
- for (;;) {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- afbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while(len--) {
- *addrl |= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- } else {
- while(len--) {
- *addrl |= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- break;
-
- case RROP_INVERT:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- while(len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- afbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- }
- } else {
- while(len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- afbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- }
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while(len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- } else {
- while(len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl --; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- } /* switch */
- } /* for (d = ... ) */
-}
diff --git a/afb/afbbresd.c b/afb/afbbresd.c
deleted file mode 100644
index 57309175e..000000000
--- a/afb/afbbresd.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbbresd.c,v 3.0 1996/08/18 01:45:26 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbbresd.c,v 1.10 94/04/17 20:28:18 dpw Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "afb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Dashed bresenham line */
-
-#define StepDash\
- if (!--dashRemaining) { \
- if (++ dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- rop = fgrop; \
- if (dashIndex & 1) \
- rop = bgrop; \
- }
-
-void
-afbBresD(pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrlbase, nlwidth, sizeDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, len, rrops, bgrrops)
-int *pdashIndex; /* current dash */
-unsigned char *pDash; /* dash list */
-int numInDashList; /* total length of dash list */
-int *pdashOffset; /* offset into current dash */
-int isDoubleDash;
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int sizeDst;
-int depthDst;
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-unsigned char *rrops;
-unsigned char *bgrrops;
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl;
- register int e3 = e2-e1;
- register unsigned long bit;
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- int rop;
- int fgrop;
- int bgrop;
- int saveE;
- int saveLen;
- int d;
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- dashRemaining = pDash[dashIndex] - dashOffset;
- /* point to longword containing first point */
-
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
-
- saveE = e;
- saveLen = len;
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(addrlbase, x1, y1, nlwidth);
- addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- fgrop = rrops[d];
- bgrop = bgrrops[d];
-
- e = saveE;
- len = saveLen;
- bit = mask[x1 & PIM];
-
- rop = fgrop;
- if (!isDoubleDash)
- bgrop = -1;
- if (dashIndex & 1)
- rop = bgrop;
-
- if (axis == X_AXIS) {
- if (signdx > 0) {
- while(len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- afbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- StepDash
- }
- } else {
- while(len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- afbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- StepDash
- }
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while(len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- StepDash
- }
- } else {
- while(len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- afbScanlineInc(addrl, yinc);
- StepDash
- }
- }
- } /* else Y_AXIS */
- } /* for (d = ...) */
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/afb/afbbstore.c b/afb/afbbstore.c
deleted file mode 100644
index 725f93d48..000000000
--- a/afb/afbbstore.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbbstore.c,v 3.0 1996/08/18 01:45:28 dawes Exp $ */
-/* $XConsortium: afbbstore.c,v 5.7 94/04/17 20:28:18 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-*/
-
-#include "afb.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * afbSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * afbDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-afbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- afbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr,
- (DrawablePtr)pPixmap,
- GXcopy,
- prgnSave,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * afbRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * afbDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-afbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- afbDoBitblt((DrawablePtr)pPixmap,
- (DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr,
- GXcopy,
- prgnRestore,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
diff --git a/afb/afbclip.c b/afb/afbclip.c
deleted file mode 100644
index 07eb3b816..000000000
--- a/afb/afbclip.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbclip.c,v 3.3 2003/07/16 01:38:35 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbclip.c,v 5.6 94/04/17 20:28:19 dpw Exp $ */
-
-#include "X.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gc.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "afb.h"
-
-#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
-if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
- (!((reg)->data->numRects && \
- ((r-1)->y1 == (ry1)) && \
- ((r-1)->y2 == (ry2)) && \
- ((r-1)->x1 <= (rx1)) && \
- ((r-1)->x2 >= (rx2))))) \
-{ \
- if ((reg)->data->numRects == (reg)->data->size) \
- { \
- miRectAlloc(reg, 1); \
- fr = REGION_BOXPTR(reg); \
- r = fr + (reg)->data->numRects; \
- } \
- r->x1 = (rx1); \
- r->y1 = (ry1); \
- r->x2 = (rx2); \
- r->y2 = (ry2); \
- (reg)->data->numRects++; \
- if(r->x1 < (reg)->extents.x1) \
- (reg)->extents.x1 = r->x1; \
- if(r->x2 > (reg)->extents.x2) \
- (reg)->extents.x2 = r->x2; \
- r++; \
-}
-
-/* Convert bitmap clip mask into clipping region.
- * First, goes through each line and makes boxes by noting the transitions
- * from 0 to 1 and 1 to 0.
- * Then it coalesces the current line with the previous if they have boxes
- * at the same X coordinates.
- */
-RegionPtr
-afbPixmapToRegion(pPix)
- PixmapPtr pPix;
-{
- register RegionPtr pReg;
- register PixelType *pw, w;
- register int ib;
- int width, h, base, rx1 = 0, crects;
- PixelType *pwLineEnd;
- int irectPrevStart, irectLineStart;
- register BoxPtr prectO, prectN;
- BoxPtr FirstRect, rects, prectLineStart;
- Bool fInBox, fSame;
- register PixelType mask0 = mask[0];
- PixelType *pwLine;
- int nWidth;
-
- pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1);
- if(!pReg)
- return NullRegion;
- FirstRect = REGION_BOXPTR(pReg);
- rects = FirstRect;
-
- pwLine = (PixelType *) pPix->devPrivate.ptr;
- nWidth = pPix->devKind / PGSZB;
-
- width = pPix->drawable.width;
- pReg->extents.x1 = width - 1;
- pReg->extents.x2 = 0;
- irectPrevStart = -1;
- for(h = 0; h < pPix->drawable.height; h++) {
- pw = pwLine;
- pwLine += nWidth;
- irectLineStart = rects - FirstRect;
- /* If the Screen left most bit of the word is set, we're starting in
- * a box */
- if(*pw & mask0) {
- fInBox = TRUE;
- rx1 = 0;
- }
- else
- fInBox = FALSE;
- /* Process all words which are fully in the pixmap */
- pwLineEnd = pw + (width >> PWSH);
- for (base = 0; pw < pwLineEnd; base += PPW) {
- w = *pw++;
- if (fInBox) {
- if (!~w)
- continue;
- } else {
- if (!w)
- continue;
- }
- for(ib = 0; ib < PPW; ib++) {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0) {
- if(!fInBox) {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if(fInBox) {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- if(width & PIM) {
- /* Process final partial word on line */
- w = *pw++;
- for(ib = 0; ib < (width & PIM); ib++) {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0) {
- if(!fInBox) {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if(fInBox) {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox) {
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + (width & PIM), h + 1);
- }
- /* if all rectangles on this line have the same x-coords as
- * those on the previous line, then add 1 to all the previous y2s and
- * throw away all the rectangles from this line
- */
- fSame = FALSE;
- if(irectPrevStart != -1) {
- crects = irectLineStart - irectPrevStart;
- if(crects == ((rects - FirstRect) - irectLineStart)) {
- prectO = FirstRect + irectPrevStart;
- prectN = prectLineStart = FirstRect + irectLineStart;
- fSame = TRUE;
- while(prectO < prectLineStart) {
- if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) {
- fSame = FALSE;
- break;
- }
- prectO++;
- prectN++;
- }
- if (fSame) {
- prectO = FirstRect + irectPrevStart;
- while(prectO < prectLineStart) {
- prectO->y2 += 1;
- prectO++;
- }
- rects -= crects;
- pReg->data->numRects -= crects;
- }
- }
- }
- if(!fSame)
- irectPrevStart = irectLineStart;
- }
- if (!pReg->data->numRects)
- pReg->extents.x1 = pReg->extents.x2 = 0;
- else
- {
- pReg->extents.y1 = REGION_BOXPTR(pReg)->y1;
- pReg->extents.y2 = REGION_END(pReg)->y2;
- if (pReg->data->numRects == 1) {
- xfree(pReg->data);
- pReg->data = (RegDataPtr)NULL;
- }
- }
-#ifdef DEBUG
- if (!miValidRegion(pReg))
- FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
-#endif
- return(pReg);
-}
diff --git a/afb/afbcmap.c b/afb/afbcmap.c
deleted file mode 100644
index e56558972..000000000
--- a/afb/afbcmap.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbcmap.c,v 3.1 1998/11/22 10:36:58 dawes Exp $ */
-/* $XConsortium: afbcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "micmap.h"
-
-int
-afbListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-
-void
-afbInstallColormap(pmap)
- ColormapPtr pmap;
-{
- miInstallColormap(pmap);
-}
-
-void
-afbUninstallColormap(pmap)
- ColormapPtr pmap;
-{
- miUninstallColormap(pmap);
-}
-
-void
-afbResolveColor(pred, pgreen, pblue, pVisual)
- unsigned short *pred, *pgreen, *pblue;
- register VisualPtr pVisual;
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-afbInitializeColormap(pmap)
- register ColormapPtr pmap;
-{
- return miInitializeColormap(pmap);
-}
-
-int
-afbExpandDirectColors(pmap, ndef, indefs, outdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *indefs, *outdefs;
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-afbCreateDefColormap(pScreen)
- ScreenPtr pScreen;
-{
- return miCreateDefColormap(pScreen);
-}
-
-Bool
-afbSetVisualTypes(depth, visuals, bitsPerRGB)
- int depth;
- int visuals;
- int bitsPerRGB;
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which correspond to
- * the set which can be used with this version of afb.
- */
-
-Bool
-afbInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp,
- sizes, bitsPerRGB)
- VisualPtr *visualp;
- DepthPtr *depthp;
- int *nvisualp, *ndepthp;
- int *rootDepthp;
- VisualID *defaultVisp;
- unsigned long sizes;
- int bitsPerRGB;
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
diff --git a/afb/afbfillarc.c b/afb/afbfillarc.c
deleted file mode 100644
index 1db48b07c..000000000
--- a/afb/afbfillarc.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbfillarc.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: afbfillarc.c,v 5.14 94/04/17 20:28:20 dpw Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "afb.h"
-#include "maskbits.h"
-#include "mifillarc.h"
-#include "mi.h"
-
-static void
-afbFillEllipseSolid(pDraw, arc, rrops)
- DrawablePtr pDraw;
- xArc *arc;
- register unsigned char *rrops;
-{
- int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- register int slw;
- miFillArcRec info;
- PixelType *addrlt, *addrlb;
- register PixelType *pdst;
- PixelType *addrl;
- register int n;
- register int d;
- int nlwidth;
- register int xpos;
- PixelType startmask, endmask;
- int nlmiddle;
- int depthDst;
- int sizeDst;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- addrlt);
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- while (y) {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
- pdst = addrl = afbScanlineOffset(addrlt, (xpos >> PWSH));
- if (((xpos & PIM) + slw) < PPW) {
- maskpartialbits(xpos, slw, startmask);
- for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~startmask;
- break;
- case RROP_WHITE:
- *pdst |= startmask;
- break;
- case RROP_INVERT:
- *pdst ^= startmask;
- break;
- case RROP_NOP:
- break;
- }
- }
- if (miFillArcLower(slw)) {
- pdst = afbScanlineOffset(addrlb, (xpos >> PWSH));
-
- for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~startmask;
- break;
- case RROP_WHITE:
- *pdst |= startmask;
- break;
- case RROP_INVERT:
- *pdst ^= startmask;
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */
- n = nlmiddle;
- pdst = addrl;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *pdst++ &= ~startmask;
- while (n--)
- *pdst++ = 0;
- if (endmask)
- *pdst &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *pdst++ |= startmask;
- while (n--)
- *pdst++ = ~0;
- if (endmask)
- *pdst |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *pdst++ ^= startmask;
- while (n--)
- *pdst++ ^= ~0;
- if (endmask)
- *pdst ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- }
- }
- if (!miFillArcLower(slw))
- continue;
- addrl = afbScanlineOffset(addrlb, (xpos >> PWSH));
- for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */
- n = nlmiddle;
- pdst = addrl;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *pdst++ &= ~startmask;
- while (n--)
- *pdst++ = 0;
- if (endmask)
- *pdst &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *pdst++ |= startmask;
- while (n--)
- *pdst++ = ~0;
- if (endmask)
- *pdst |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *pdst++ ^= startmask;
- while (n--)
- *pdst++ ^= ~0;
- if (endmask)
- *pdst ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- }
- }
- }
-}
-
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) { \
- width = xr - xl + 1; \
- addrl = afbScanlineOffset(addr, (xl >> PWSH)); \
- if (((xl & PIM) + width) < PPW) { \
- maskpartialbits(xl, width, startmask); \
- for (pdst = addrl, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ \
- switch (rrops[d]) { \
- case RROP_BLACK: \
- *pdst &= ~startmask; \
- break; \
- case RROP_WHITE: \
- *pdst |= startmask; \
- break; \
- case RROP_INVERT: \
- *pdst ^= startmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
- } \
- } else { \
- maskbits(xl, width, startmask, endmask, nlmiddle); \
- for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */ \
- n = nlmiddle; \
- pdst = addrl; \
- switch (rrops[d]) { \
- case RROP_BLACK: \
- if (startmask) \
- *pdst++ &= ~startmask; \
- while (n--) \
- *pdst++ = 0; \
- if (endmask) \
- *pdst &= ~endmask; \
- break; \
- case RROP_WHITE: \
- if (startmask) \
- *pdst++ |= startmask; \
- while (n--) \
- *pdst++ = ~0; \
- if (endmask) \
- *pdst |= endmask; \
- break; \
- case RROP_INVERT: \
- if (startmask) \
- *pdst++ ^= startmask; \
- while (n--) \
- *pdst++ ^= ~0; \
- if (endmask) \
- *pdst ^= endmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
- } \
- } \
- }
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) { \
- FILLSPAN(xl, xr, addr); \
- } else { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
- register unsigned char *rrops;
-{
- PixelType *addrl;
- register PixelType *pdst;
- register int n;
- register int d;
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
- PixelType *addrlt, *addrlb;
- int nlwidth;
- int width;
- PixelType startmask, endmask;
- int nlmiddle;
- int sizeDst;
- int depthDst;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- addrlt);
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt = afbScanlineDeltaNoBankSwitch(addrlt, yorg - y, nlwidth);
- addrlb = afbScanlineDeltaNoBankSwitch(addrlb, yorg + y + dy, nlwidth);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0) {
- afbScanlineIncNoBankSwitch(addrlt, nlwidth);
- afbScanlineIncNoBankSwitch(addrlb, -nlwidth);
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice)) {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrlt);
- }
- if (miFillSliceLower(slice)) {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrlb);
- }
- }
-}
-
-void
-afbPolyFillArcSolid(pDraw, pGC, narcs, parcs)
- register DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- afbPrivGC *priv;
- register xArc *arc;
- register int i;
- BoxRec box;
- RegionPtr cclip;
- unsigned char *rrops;
-
- priv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr;
- rrops = priv->rrops;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++) {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc)) {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- box.x2 = box.x1 + (int)arc->width + 1;
- box.y2 = box.y1 + (int)arc->height + 1;
- if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- afbFillEllipseSolid(pDraw, arc, rrops);
- else
- afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/afb/afbfillrct.c b/afb/afbfillrct.c
deleted file mode 100644
index 25ab5e56e..000000000
--- a/afb/afbfillrct.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbfillrct.c,v 3.3 2003/10/29 22:15:19 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbfillrct.c,v 5.10 94/04/17 20:28:21 dpw Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-#define MODEQ(a, b) ((a) %= (b))
-void afbPaintOddSize();
-
-/*
- filled rectangles.
- translate the rectangles, clip them, and call the
-helper function in the GC.
-*/
-
-#define NUM_STACK_RECTS 1024
-
-void
-afbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- int numRects;
- int n;
- int xorg, yorg;
- afbPrivGC *priv;
- unsigned char *rrops;
- unsigned char *rropsOS;
-
- priv = (afbPrivGC *)pGC->devPrivates[afbGCPrivateIndex].ptr;
- prgnClip = pGC->pCompositeClip;
- rrops = priv->rrops;
- rropsOS = priv->rropOS;
-
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg) {
- prect = prectInit;
- n = nrectFill;
- Duff(n, prect->x += xorg; prect->y += yorg; prect++);
- }
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS) {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1) {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--) {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2)) {
- pboxClipped++;
- }
- }
- } else {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--) {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--) {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2) {
- pboxClipped++;
- }
- }
- }
- }
- if (pboxClipped != pboxClippedBase) {
- switch (pGC->fillStyle) {
- case FillSolid:
- afbSolidFillArea(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, rrops);
- break;
- case FillTiled:
- switch (pGC->alu) {
- case GXcopy:
- if (pGC->pRotatedPixmap)
- afbTileAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->pRotatedPixmap, pGC->planemask);
- else
- afbTileAreaCopy (pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->tile.pixmap,
- pGC->patOrg.x, pGC->patOrg.y,
- pGC->planemask);
- break;
-
- default:
- if (pGC->pRotatedPixmap)
- afbTileAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->pRotatedPixmap,
- pGC->planemask);
- else
- afbTileAreaGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->tile.pixmap,
- pGC->patOrg.x, pGC->patOrg.y,
- pGC->planemask);
- break;
- } /* switch (alu) */
- break;
-
- case FillStippled:
- if (pGC->pRotatedPixmap)
- afbStippleAreaPPW(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->pRotatedPixmap, rrops);
- else
- afbStippleArea(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->stipple,
- pGC->patOrg.x, pGC->patOrg.y, rrops);
- break;
-
- case FillOpaqueStippled:
- switch (pGC->alu) {
- case GXcopy:
- if (pGC->pRotatedPixmap)
- afbOpaqueStippleAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->pRotatedPixmap,
- rropsOS, pGC->planemask);
- else
- afbOpaqueStippleAreaCopy(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->stipple,
- pGC->patOrg.x, pGC->patOrg.y, rropsOS,
- pGC->planemask);
- break;
-
- default:
- if (pGC->pRotatedPixmap)
- afbOpaqueStippleAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->pRotatedPixmap,
- rropsOS,
- pGC->planemask);
- else
- afbOpaqueStippleAreaGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->stipple,
- pGC->patOrg.x, pGC->patOrg.y,
- rropsOS,
- pGC->planemask);
- break;
- } /* switch (alu) */
- break;
- }
- }
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/afb/afbfillsp.c b/afb/afbfillsp.c
deleted file mode 100644
index 69985aebc..000000000
--- a/afb/afbfillsp.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbfillsp.c,v 3.4 2001/10/28 03:32:58 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbfillsp.c,v 5.13 94/04/17 20:28:21 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "afb.h"
-
-#include "maskbits.h"
-
-#include "mergerop.h"
-
-#include "servermd.h"
-#include "mi.h"
-#include "mispans.h"
-
-/* scanline filling for monochrome frame buffer
- written by drewry, oct 1986
-
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in afbCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-
-*/
-
-
-void
-afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int depthDst;
- int sizeDst;
- int d;
- unsigned char *rrops;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
- while (n--) {
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
-
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (*pwidth) {
- addrl = addrlBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- }
- break;
-
- case RROP_WHITE:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- }
- break;
- case RROP_INVERT:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- }
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pStipple;
- PixelType *psrc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int d;
- int depthDst;
- int sizeDst;
- unsigned char *rrops;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- pStipple = pGC->pRotatedPixmap;
- tileHeight = pStipple->drawable.height;
- psrc = (PixelType *)(pStipple->devPrivate.ptr);
-
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
- while (n--) {
- src = psrc[ppt->y % tileHeight];
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- addrl = addrlBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~(src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~(src & startmask);
- Duff (nlmiddle, *addrl++ &= ~src);
- if (endmask)
- *addrl &= ~(src & endmask);
- }
- break;
- case RROP_WHITE:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= (src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= (src & startmask);
- Duff (nlmiddle, *addrl++ |= src);
- if (endmask)
- *addrl |= (src & endmask);
- }
- break;
- case RROP_INVERT:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= (src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= (src & startmask);
- Duff (nlmiddle, *addrl++ ^= src);
- if (endmask)
- *addrl ^= (src & endmask);
- }
- break;
-
- case RROP_NOP:
- break;
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pTile;
- PixelType *psrc;
- int tileHeight;
- int rop;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int sizeDst;
- int depthDst;
- int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- pTile = pGC->pRotatedPixmap;
- tileHeight = pTile->drawable.height;
- psrc = (PixelType *)(pTile->devPrivate.ptr);
- rop = pGC->alu;
-
- switch(rop) {
- case GXcopy:
-#define DoMaskCopyRop(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask)))
- while (n--) {
- if (*pwidth) {
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
-
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- addrl = addrlBase;
- src = psrc[ppt->y % tileHeight + tileHeight * d];
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = src;
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskCopyRop (src, *addrl, endmask);
- }
- }
- }
- pwidth++;
- ppt++;
- }
- break;
-
- default:
- {
- register DeclareMergeRop ();
-
- InitializeMergeRop(rop,~0);
- while (n--) {
- if (*pwidth) {
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- addrl = addrlBase;
-
- src = psrc[ppt->y % tileHeight + tileHeight * d];
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = DoMergeRop (src, *addrl);
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskMergeRop (src, *addrl, endmask);
- }
- }
- }
- pwidth++;
- ppt++;
- }
- break;
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src = 0;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pTile;
- PixelType *psrc;
- int tileHeight;
- int rop;
- unsigned char *rropsOS;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int sizeDst;
- int depthDst;
- int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- pTile = pGC->pRotatedPixmap;
- tileHeight = pTile->drawable.height;
- psrc = (PixelType *)(pTile->devPrivate.ptr);
- rop = pGC->alu;
- rropsOS = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rropOS;
-
- switch(rop) {
- case GXcopy:
- while (n--) {
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
- if (*pwidth) {
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- src = 0;
- break;
- case RROP_WHITE:
- src = ~0;
- break;
- case RROP_INVERT:
- src = ~psrc[ppt->y % tileHeight];
- break;
- case RROP_COPY:
- src = psrc[ppt->y % tileHeight];
- break;
- case RROP_NOP:
- continue;
- }
-
- addrl = addrlBase;
-
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = src;
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskCopyRop (src, *addrl, endmask);
- }
- } /* for (d = ...) */
- }
-
- pwidth++;
- ppt++;
- }
- break;
-
- default:
- {
- register DeclareMergeRop ();
-
- InitializeMergeRop(rop,~0);
- while (n--) {
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
- if (*pwidth) {
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- src = 0;
- break;
- case RROP_WHITE:
- src = ~0;
- break;
- case RROP_INVERT:
- src = ~psrc[ppt->y % tileHeight];
- break;
- case RROP_COPY:
- src = psrc[ppt->y % tileHeight];
- break;
- case RROP_NOP:
- continue;
- }
-
- addrl = addrlBase;
-
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = DoMergeRop (src, *addrl);
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskMergeRop (src, *addrl, endmask);
- }
- } /* for (d = ...) */
- }
- pwidth++;
- ppt++;
- } /* while (n) */
- break;
- }
- } /* switch (rop) */
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with tiles that aren't PPW bits wide */
-void
-afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- int iline; /* first line of tile to use */
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst;/* pointer to current word in bitmap */
- register PixelType *psrc;/* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- PixelType endmask, *psrcT;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int sizeDst;
- int sizeTile;
- int depthDst;
- register int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->tile.pixmap;
- tlwidth = pTile->devKind / PGSZB;
- rop = pGC->alu;
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- sizeTile = tlwidth * tileHeight;
-
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
-
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
-
- for (d = 0; d < depthDst; d++, psrcT += sizeTile, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- if (*pwidth) {
- x = ppt->x;
- pdst = addrlBase;
- width = *pwidth;
- while(width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrop((psrc+endinc), (rem&PIM), (x & PIM), w, pdst, rop);
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- putbitsrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- getandputrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if(endmask) {
- getandputrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with stipples that aren't PPW bits wide */
-void
-afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- int iline; /* first line of tile to use */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst; /* pointer to current word in bitmap */
- register PixelType *psrc; /* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- PixelType endmask, *psrcT;
- int tlwidth, rem, tileWidth, endinc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- unsigned char *rrops;
- register int d;
- int sizeDst;
- int depthDst;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->stipple;
- tlwidth = pTile->devKind / PGSZB;
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
- /* this replaces rotating the stipple. Instead, we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
-
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- rop = rrops[d];
- if (rop == RROP_NOP)
- continue;
-
- pdst = addrlBase;
- x = ppt->x;
-
- if (*pwidth) {
- width = *pwidth;
- while(width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrrop((psrc + endinc), (rem & PIM), (x & PIM),
- w, pdst, rop)
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- getandputrrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if(endmask) {
- getandputrrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with OpaqueStipples that aren't PPW bits wide */
-void
-afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- int iline; /* first line of tile to use */
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst;/* pointer to current word in bitmap */
- register PixelType *psrc;/* pointer to current word in tile */
- register int nlMiddle;
- register int d;
- register PixelType tmpsrc = 0;
- register PixelType tmpdst;
- register int alu, nstart;
- register unsigned char *rropsOS;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- PixelType endmask, *psrcT;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int sizeDst;
- int depthDst;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->stipple;
- tlwidth = pTile->devKind / PGSZB;
- alu = pGC->alu;
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- rropsOS = afbGetGCPrivate(pGC)->rropOS;
-
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
-
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
-
- for (d = 0; d < depthDst; d++, addrlBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- if (*pwidth) {
- x = ppt->x;
- pdst = addrlBase;
- width = *pwidth;
- while(width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), w, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
-
- putbits (tmpsrc, (x & PIM), w, pdst);
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), w, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), nstart, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- getbits (psrc, nstart, PPW, tmpsrc);
- break;
- case RROP_INVERT:
- getbits (psrc, nstart, PPW, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
- if (alu != GXcopy) {
- tmpdst = *pdst;
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++;*/
- psrc++;
- }
- if(endmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits (psrc, nstart, nend, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits (psrc, nstart, nend, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
- if (alu != GXcopy) {
- tmpdst = *pdst;
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/afb/afbfont.c b/afb/afbfont.c
deleted file mode 100644
index 0ad8d9de3..000000000
--- a/afb/afbfont.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbfont.c,v 3.0 1996/08/18 01:45:35 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: afbfont.c,v 1.18 94/04/17 20:28:22 keith Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-
-/*ARGSUSED*/
-Bool
-afbRealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-afbUnrealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
diff --git a/afb/afbgc.c b/afb/afbgc.c
deleted file mode 100644
index fe88475a3..000000000
--- a/afb/afbgc.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbgc.c,v 3.3 2001/10/28 03:32:58 tsi Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbgc.c,v 5.35 94/04/17 20:28:23 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "migc.h"
-
-#include "maskbits.h"
-
-static GCFuncs afbFuncs = {
- afbValidateGC,
- miChangeGC,
- miCopyGC,
- afbDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip
-};
-
-static GCOps afbGCOps = {
- afbSolidFS,
- afbSetSpans,
- afbPutImage,
- afbCopyArea,
- miCopyPlane,
- afbPolyPoint,
- afbLineSS,
- afbSegmentSS,
- miPolyRectangle,
- afbZeroPolyArcSS,
- afbFillPolygonSolid,
- afbPolyFillRect,
- afbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- afbTEGlyphBlt,
- afbPolyGlyphBlt,
- afbPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-
-Bool
-afbCreateGC(pGC)
- register GCPtr pGC;
-{
- afbPrivGC *pPriv;
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- /* some of the output primitives aren't really necessary, since
- they will be filled in ValidateGC because of dix/CreateGC()
- setting all the change bits. Others are necessary because although
- they depend on being a monochrome frame buffer, they don't change
- */
-
- pGC->ops = &afbGCOps;
- pGC->funcs = &afbFuncs;
-
- /* afb wants to translate before scan convesion */
- pGC->miTranslate = 1;
-
- pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
- afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, pPriv->rropOS);
-
- pGC->fExpose = TRUE;
- pGC->pRotatedPixmap = NullPixmap;
- pGC->freeCompClip = FALSE;
- return TRUE;
-}
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-/*ARGSUSED*/
-void
-afbValidateGC(pGC, changes, pDrawable)
- register GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- register afbPrivGCPtr devPriv;
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int xrot, yrot; /* rotations for tile and stipple pattern */
- /* flags for changing the proc vector
- and updating things in devPriv
- */
- int new_rotate, new_rrop, new_line, new_text, new_fill;
- DDXPointRec oldOrg; /* origin of thing GC was last used with */
-
- oldOrg = pGC->lastWinOrg;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
-
- /* we need to re-rotate the tile if the previous window/pixmap
- origin (oldOrg) differs from the new window/pixmap origin
- (pGC->lastWinOrg)
- */
- new_rotate = (oldOrg.x != pGC->lastWinOrg.x) ||
- (oldOrg.y != pGC->lastWinOrg.y);
-
-
- devPriv = ((afbPrivGCPtr)(pGC->devPrivates[afbGCPrivateIndex].ptr));
-
-
- /*
- if the client clip is different or moved OR
- the subwindowMode has changed OR
- the window's clip has changed since the last validation
- we need to recompute the composite clip
- */
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
- afbComputeCompositeClip(pGC, pDrawable);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fill = FALSE;
-
- mask = changes;
- while (mask) {
- index = lowbit(mask);
- mask &= ~index;
-
- /* this switch acculmulates a list of which procedures
- might have to change due to changes in the GC. in
- some cases (e.g. changing one 16 bit tile for another)
- we might not really need a change, but the code is
- being paranoid.
- this sort of batching wins if, for example, the alu
- and the font have been changed, or any other pair
- of items that both change the same thing.
- */
- switch (index) {
- case GCPlaneMask:
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCBackground:
- new_rrop = TRUE; /* for opaque stipples */
- break;
- case GCLineStyle:
- case GCLineWidth:
- case GCJoinStyle:
- new_line = TRUE;
- break;
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_fill = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- if(pGC->tileIsPixel)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCStipple:
- if(pGC->stipple == (PixmapPtr)NULL)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCTileStipXOrigin:
- new_rotate = TRUE;
- break;
-
- case GCTileStipYOrigin:
- new_rotate = TRUE;
- break;
-
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- break;
- case GCGraphicsExposures:
- break;
- case GCClipXOrigin:
- break;
- case GCClipYOrigin:
- break;
- case GCClipMask:
- break;
- case GCDashOffset:
- break;
- case GCDashList:
- break;
- case GCArcMode:
- break;
- default:
- break;
- }
- }
-
- /* deal with the changes we've collected .
- new_rrop must be done first because subsequent things
- depend on it.
- */
-
- if(new_rotate || new_fill) {
- Bool new_pix = FALSE;
-
- /* figure out how much to rotate */
- xrot = pGC->patOrg.x;
- yrot = pGC->patOrg.y;
- xrot += pDrawable->x;
- yrot += pDrawable->y;
-
- switch (pGC->fillStyle) {
- case FillTiled:
- /* copy current tile and stipple */
- if (!pGC->tileIsPixel &&
- (pGC->tile.pixmap->drawable.width <= PPW) &&
- !(pGC->tile.pixmap->drawable.width &
- (pGC->tile.pixmap->drawable.width - 1))) {
- afbCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- break;
- case FillStippled:
- case FillOpaqueStippled:
- if (pGC->stipple && (pGC->stipple->drawable.width <= PPW) &&
- !(pGC->stipple->drawable.width &
- (pGC->stipple->drawable.width - 1))) {
- afbCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- }
- /* destroy any previously rotated tile or stipple */
- if (!new_pix && pGC->pRotatedPixmap) {
- (*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- pGC->pRotatedPixmap = (PixmapPtr)NULL;
- }
- }
-
- /*
- * duck out here when the GC is unchanged
- */
-
- if (!changes)
- return;
-
- if (new_rrop || new_fill) {
- afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pDrawable->depth,
- devPriv->rrops);
- afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, devPriv->rropOS);
- new_fill = TRUE;
- }
-
- if (new_line || new_fill || new_text) {
- if (!pGC->ops->devPrivate.val) {
- pGC->ops = miCreateGCOps(pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
-
- if (new_line || new_fill) {
- if (pGC->lineWidth == 0) {
- if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid)
- pGC->ops->PolyArc = afbZeroPolyArcSS;
- else
- pGC->ops->PolyArc = miZeroPolyArc;
- } else
- pGC->ops->PolyArc = miPolyArc;
- if (pGC->lineStyle == LineSolid) {
- if(pGC->lineWidth == 0) {
- if (pGC->fillStyle == FillSolid) {
- pGC->ops->PolySegment = afbSegmentSS;
- pGC->ops->Polylines = afbLineSS;
- }
- else
- {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miZeroLine;
- }
- } else {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miWideLine;
- }
- } else {
- if(pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) {
- pGC->ops->PolySegment = afbSegmentSD;
- pGC->ops->Polylines = afbLineSD;
- } else {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miWideDash;
- }
- }
- }
-
- if (new_text || new_fill) {
- if ((pGC->font) &&
- (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)) {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- } else {
- /* special case ImageGlyphBlt for terminal emulator fonts */
- if ((pGC->font) &&
- TERMINALFONT(pGC->font)) {
- pGC->ops->ImageGlyphBlt = afbTEGlyphBlt;
- } else {
- pGC->ops->ImageGlyphBlt = afbImageGlyphBlt;
- }
-
- /* now do PolyGlyphBlt */
- if (pGC->fillStyle == FillSolid) {
- pGC->ops->PolyGlyphBlt = afbPolyGlyphBlt;
- } else {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- }
- }
- }
-
- if (new_fill) {
- /* install a suitable fillspans and pushpixels */
- pGC->ops->PushPixels = afbPushPixels;
- pGC->ops->FillPolygon = miFillPolygon;
- pGC->ops->PolyFillArc = miPolyFillArc;
-
- switch (pGC->fillStyle) {
- case FillSolid:
- pGC->ops->FillSpans = afbSolidFS;
- pGC->ops->FillPolygon = afbFillPolygonSolid;
- pGC->ops->PolyFillArc = afbPolyFillArcSolid;
- break;
- case FillTiled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = afbTileFS;
- else
- pGC->ops->FillSpans = afbUnnaturalTileFS;
- break;
- case FillOpaqueStippled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = afbOpaqueStippleFS;
- else
- pGC->ops->FillSpans = afbUnnaturalOpaqueStippleFS;
- break;
-
- case FillStippled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = afbStippleFS;
- else
- pGC->ops->FillSpans = afbUnnaturalStippleFS;
- break;
- }
- } /* end of new_fill */
-}
-
-void
-afbDestroyGC(pGC)
- GCPtr pGC;
-{
- if (pGC->pRotatedPixmap)
- (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- if (pGC->freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- miDestroyGCOps(pGC->ops);
-}
-
-/* table to map alu(src, dst) to alu(~src, dst) */
-int afbInverseAlu[16] = {
- GXclear,
- GXandInverted,
- GXnor,
- GXcopyInverted,
- GXand,
- GXnoop,
- GXequiv,
- GXorInverted,
- GXandReverse,
- GXxor,
- GXinvert,
- GXnand,
- GXcopy,
- GXor,
- GXorReverse,
- GXset
-};
-
-void
-afbReduceOpaqueStipple(fg, bg, planemask, depth, rop)
-register PixelType fg;
-register PixelType bg;
-register unsigned long planemask;
-int depth;
-register unsigned char *rop;
-{
- register int d;
- register Pixel mask = 1;
-
- bg ^= fg;
-
- for (d = 0; d < depth; d++, mask <<= 1) {
- if (!(planemask & mask))
- rop[d] = RROP_NOP;
- else if (!(bg & mask)) {
- /* Both fg and bg have a 0 or 1 in this plane */
- if (fg & mask)
- rop[d] = RROP_WHITE;
- else
- rop[d] = RROP_BLACK;
- } else {
- /* Both fg and bg have different bits on this plane */
- if (fg & mask)
- rop[d] = RROP_COPY;
- else
- rop[d] = RROP_INVERT;
- }
- }
-}
-
-void
-afbReduceRop(alu, src, planemask, depth, rop)
- register int alu;
- register Pixel src;
- register unsigned long planemask;
- int depth;
- register unsigned char *rop;
-{
- register int d;
- register Pixel mask = 1;
-
- for (d = 0; d < depth; d++, mask <<= 1) {
- if (!(planemask & mask))
- rop[d] = RROP_NOP;
- else if ((src & mask) == 0) /* src is black */
- switch (alu) {
- case GXclear:
- rop[d] = RROP_BLACK;
- break;
- case GXand:
- rop[d] = RROP_BLACK;
- break;
- case GXandReverse:
- rop[d] = RROP_BLACK;
- break;
- case GXcopy:
- rop[d] = RROP_BLACK;
- break;
- case GXandInverted:
- rop[d] = RROP_NOP;
- break;
- case GXnoop:
- rop[d] = RROP_NOP;
- break;
- case GXxor:
- rop[d] = RROP_NOP;
- break;
- case GXor:
- rop[d] = RROP_NOP;
- break;
- case GXnor:
- rop[d] = RROP_INVERT;
- break;
- case GXequiv:
- rop[d] = RROP_INVERT;
- break;
- case GXinvert:
- rop[d] = RROP_INVERT;
- break;
- case GXorReverse:
- rop[d] = RROP_INVERT;
- break;
- case GXcopyInverted:
- rop[d] = RROP_WHITE;
- break;
- case GXorInverted:
- rop[d] = RROP_WHITE;
- break;
- case GXnand:
- rop[d] = RROP_WHITE;
- break;
- case GXset:
- rop[d] = RROP_WHITE;
- break;
- }
- else /* src is white */
- switch (alu) {
- case GXclear:
- rop[d] = RROP_BLACK;
- break;
- case GXand:
- rop[d] = RROP_NOP;
- break;
- case GXandReverse:
- rop[d] = RROP_INVERT;
- break;
- case GXcopy:
- rop[d] = RROP_WHITE;
- break;
- case GXandInverted:
- rop[d] = RROP_BLACK;
- break;
- case GXnoop:
- rop[d] = RROP_NOP;
- break;
- case GXxor:
- rop[d] = RROP_INVERT;
- break;
- case GXor:
- rop[d] = RROP_WHITE;
- break;
- case GXnor:
- rop[d] = RROP_BLACK;
- break;
- case GXequiv:
- rop[d] = RROP_NOP;
- break;
- case GXinvert:
- rop[d] = RROP_INVERT;
- break;
- case GXorReverse:
- rop[d] = RROP_WHITE;
- break;
- case GXcopyInverted:
- rop[d] = RROP_BLACK;
- break;
- case GXorInverted:
- rop[d] = RROP_NOP;
- break;
- case GXnand:
- rop[d] = RROP_INVERT;
- break;
- case GXset:
- rop[d] = RROP_WHITE;
- break;
- }
- }
-}
-
-void
-afbComputeCompositeClip(pGC, pDrawable)
- GCPtr pGC;
- DrawablePtr pDrawable;
-{
- if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors) {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- } else {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy (or
- * maybe re-use) it later. this way, we avoid unnecessary copying of
- * regions. (this wins especially if many clients clip by children
- * and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE) {
- if (freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- } else {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip) {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
- pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pGC->pScreen, pregWin);
- } else if (freeTmpClip) {
- REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- } else {
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- }
- } /* end of composite clip for a window */
- else {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- pixbounds.x1 = 0;
- pixbounds.y1 = 0;
- pixbounds.x2 = pDrawable->width;
- pixbounds.y2 = pDrawable->height;
-
- if (pGC->freeCompClip) {
- REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
- } else {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION) {
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
- -pGC->clipOrg.y);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
- pGC->clipOrg.y);
- }
- } /* end of composite clip for pixmap */
-} /* end afbComputeCompositeClip */
diff --git a/afb/afbgetsp.c b/afb/afbgetsp.c
deleted file mode 100644
index 0fa825d21..000000000
--- a/afb/afbgetsp.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbgetsp.c,v 3.1 2001/10/28 03:32:58 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbgetsp.c,v 5.10 94/04/17 20:28:24 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "region.h"
-#include "gc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-/*ARGSUSED*/
-void
-afbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pchardstStart; /* where to put the bits */
-{
- PixelType *pdstStart = (PixelType *)pchardstStart;
- register PixelType *pdst; /* where to put the bits */
- register PixelType *psrc; /* where to get the bits */
- register PixelType tmpSrc; /* scratch buffer for bits */
- PixelType *psrcBase; /* start of src bitmap */
- int widthSrc; /* width of pixmap in bytes */
- int sizeSrc;
- int depthSrc;
- register DDXPointPtr pptLast; /* one past last point to get */
- int xEnd; /* last pixel to copy from */
- register int nstart;
- register int d;
- int nend = 0;
- int srcStartOver;
- PixelType startmask, endmask;
- unsigned int srcBit;
- int nlMiddle, nl;
- int w;
-
- pptLast = ppt + nspans;
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc, depthSrc,
- psrcBase);
- pdst = pdstStart;
-
- while(ppt < pptLast) {
- /* XXX should this really be << PWSH, or * 8, or * PGSZB? */
- xEnd = min(ppt->x + *pwidth, widthSrc << PWSH);
- pwidth++;
- for (d = 0; d < depthSrc; d++) {
- psrc = afbScanline(psrcBase, ppt->x, ppt->y, widthSrc);
- psrcBase += sizeSrc; /* @@@ NEXT PLANE @@@ */
- w = xEnd - ppt->x;
- srcBit = ppt->x & PIM;
-
- if (srcBit + w <= PPW)
- {
- getandputbits0(psrc, srcBit, w, pdst);
- pdst++;
- }
- else
- {
-
- maskbits(ppt->x, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - srcBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- srcStartOver = srcBit + nstart > PLST;
- if (startmask)
- {
- getandputbits0(psrc, srcBit, nstart, pdst);
- if(srcStartOver)
- psrc++;
- }
- nl = nlMiddle;
-#ifdef FASTPUTBITS
- Duff(nl, putbits(*psrc, nstart, PPW, pdst); psrc++; pdst++;);
-#else
- while (nl--)
- {
- tmpSrc = *psrc;
- putbits(tmpSrc, nstart, PPW, pdst);
- psrc++;
- pdst++;
- }
-#endif
- if (endmask)
- {
- putbits(*psrc, nstart, nend, pdst);
- if(nstart + nend > PPW)
- pdst++;
- }
- if (startmask || endmask)
- pdst++;
- }
- }
- ppt++;
- }
-}
diff --git a/afb/afbhrzvert.c b/afb/afbhrzvert.c
deleted file mode 100644
index b50c357b4..000000000
--- a/afb/afbhrzvert.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbhrzvert.c,v 3.1 2001/08/01 00:44:47 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbhrzvert.c,v 1.15 94/04/17 20:28:24 dpw Exp $ */
-
-#include "X.h"
-
-#include "gc.h"
-#include "window.h"
-#include "pixmap.h"
-#include "region.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-void
-afbHorzS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops)
-PixelType *pbase; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int sizeDst;
-int depthDst;
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-register unsigned char *rrops;
-{
- register PixelType *addrl;
- register PixelType startmask;
- register PixelType endmask;
- register int nlmiddle;
- register int d;
- int saveNLmiddle;
-
- /* force the line to go left to right
- but don't draw the last point
- */
- if (len < 0) {
- x1 += len;
- x1 += 1;
- len = -len;
- }
-
- /* all bits inside same longword */
- if ( ((x1 & PIM) + len) < PPW) {
- maskpartialbits(x1, len, startmask);
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(pbase, x1, y1, nlwidth);
- pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- *addrl &= ~startmask;
- break;
- case RROP_WHITE:
- *addrl |= startmask;
- break;
- case RROP_INVERT:
- *addrl ^= startmask;
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- } else {
- maskbits(x1, len, startmask, endmask, nlmiddle);
- saveNLmiddle = nlmiddle;
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(pbase, x1, y1, nlwidth);
- pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
- nlmiddle = saveNLmiddle;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ... ) */
- }
-}
-
-/* vertical solid line
- this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
- better code. sigh. we know that len will never be 0 or 1, so
- it's OK to use it.
-*/
-void
-afbVertS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops)
-PixelType *pbase; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int sizeDst;
-int depthDst;
-int x1, y1; /* initial point */
-register int len; /* length of line */
-unsigned char *rrops;
-{
- register PixelType *addrl;
- register PixelType bitmask;
- int saveLen;
- int d;
-
- if (len < 0) {
- nlwidth = -nlwidth;
- len = -len;
- }
-
- saveLen = len;
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(pbase, x1, y1, nlwidth);
- pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
- len = saveLen;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- bitmask = rmask[x1 & PIM];
- Duff(len, *addrl &= bitmask; afbScanlineInc(addrl, nlwidth) );
- break;
-
- case RROP_WHITE:
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl |= bitmask; afbScanlineInc(addrl, nlwidth) );
- break;
-
- case RROP_INVERT:
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl ^= bitmask; afbScanlineInc(addrl, nlwidth) );
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-}
diff --git a/afb/afbimage.c b/afb/afbimage.c
deleted file mode 100644
index cfb230e36..000000000
--- a/afb/afbimage.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbimage.c,v 3.3 2001/10/28 03:32:58 tsi Exp $ */
-
-#include "X.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "afb.h"
-#include "maskbits.h"
-#include "servermd.h"
-#include "mfb.h"
-
-void
-afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
- DrawablePtr pDraw;
- GCPtr pGC;
- int depth, x, y, width, height;
- int leftPad;
- int format;
- char *pImage;
-{
- PixmapPtr pPixmap;
-
- if ((width == 0) || (height == 0))
- return;
-
- if (format != ZPixmap || depth == 1 || pDraw->depth == 1) {
- pPixmap = GetScratchPixmapHeader(pDraw->pScreen, width+leftPad, height,
- depth, depth,
- BitmapBytePad(width+leftPad),
- (pointer)pImage);
- if (!pPixmap)
- return;
-
- pGC->fExpose = FALSE;
- if (format == XYBitmap)
- (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
- 0, width, height, x, y, 1);
- else {
-#if 0
- /* XXX: bit plane order wronge ! */
- pPixmap->drawable.depth = 1;
- pPixmap->drawable.bitsPerPixel = 1;
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = afbDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = afbDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = afbDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = afbDoBitbltOr;
- break;
- default:
- doBitBlt = afbDoBitbltGeneral;
- break;
- }
-
- for (plane = (1L << (pPixmap->drawable.depth - 1)); plane;
- plane >>= 1) {
- (void)afbBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
- width, height, x, y, doBitBlt, plane);
- /* pDraw->devKind += sizeDst; */
- }
-#else
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
- 0, width, height, x, y);
-#endif
- }
-
- pGC->fExpose = TRUE;
- FreeScratchPixmapHeader(pPixmap);
- } else {
- /* Chunky to planar conversion required */
-
- PixmapPtr pPixmap;
- ScreenPtr pScreen = pDraw->pScreen;
- int widthSrc;
- int start_srcshift;
- register int b;
- register int dstshift;
- register int shift_step;
- register PixelType dst;
- register PixelType srcbits;
- register PixelType *pdst;
- register PixelType *psrc;
- int start_bit;
- register int nl;
- register int h;
- register int d;
- int sizeDst;
- PixelType *pdstBase;
- int widthDst;
- int depthDst;
-
- /* Create a tmp pixmap */
- pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth);
- if (!pPixmap)
- return;
-
- afbGetPixelWidthSizeDepthAndPointer((DrawablePtr)pPixmap, widthDst,
- sizeDst, depthDst, pdstBase);
-
- widthSrc = PixmapWidthInPadUnits(width, depth);
- /* XXX: if depth == 8, use fast chunky to planar assembly function.*/
- if (depth > 4) {
- start_srcshift = 24;
- shift_step = 8;
- } else {
- start_srcshift = 28;
- shift_step = 4;
- }
-
- for (d = 0; d < depth; d++, pdstBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- start_bit = start_srcshift + d;
- psrc = (PixelType *)pImage;
- pdst = pdstBase;
- h = height;
-
- while (h--) {
- dstshift = PPW - 1;
- dst = 0;
- nl = widthSrc;
- while (nl--) {
- srcbits = *psrc++;
- for (b = start_bit; b >= 0; b -= shift_step) {
- dst |= ((srcbits >> b) & 1) << dstshift;
- if (--dstshift < 0) {
- dstshift = PPW - 1;
- *pdst++ = dst;
- dst = 0;
- }
- }
- }
- if (dstshift != PPW - 1)
- *pdst++ = dst;
- }
- } /* for (d = ...) */
-
- pGC->fExpose = FALSE;
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
- width, height, x, y);
- pGC->fExpose = TRUE;
- (*pScreen->DestroyPixmap)(pPixmap);
- }
-}
-
-void
-afbGetImage(pDrawable, sx, sy, width, height, format, planemask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, width, height;
- unsigned int format;
- unsigned long planemask;
- char *pdstLine;
-{
- BoxRec box;
- DDXPointRec ptSrc;
- RegionRec rgnDst;
- ScreenPtr pScreen;
- PixmapPtr pPixmap;
-
- if ((width == 0) || (height == 0))
- return;
-
- pScreen = pDrawable->pScreen;
- sx += pDrawable->x;
- sy += pDrawable->y;
-
- if (format == XYPixmap || pDrawable->depth == 1) {
- pPixmap = GetScratchPixmapHeader(pScreen, width, height, 1, 1,
- BitmapBytePad(width), (pointer)pdstLine);
- if (!pPixmap)
- return;
-
- ptSrc.x = sx;
- ptSrc.y = sy;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
-
- pPixmap->drawable.depth = 1;
- pPixmap->drawable.bitsPerPixel = 1;
- /* dix layer only ever calls GetImage with 1 bit set in planemask
- * when format is XYPixmap.
- */
- afbDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, &ptSrc,
- planemask);
-
- FreeScratchPixmapHeader(pPixmap);
- REGION_UNINIT(pScreen, &rgnDst);
- } else {
- /* Planar to chunky conversion required */
-
- PixelType *psrcBits;
- PixelType *psrcLine;
- PixelType startmask, endmask;
- int depthSrc;
- int widthSrc;
- int sizeSrc;
- int sizeDst;
- int widthDst;
- register PixelType *psrc;
- register PixelType *pdst;
- register PixelType dst;
- register PixelType srcbits;
- register int d;
- register int b;
- register int dstshift;
- register int shift_step;
- register int start_endbit;
- int start_startbit;
- register int end_endbit = 0;
- register int start_dstshift;
- register int nl;
- register int h;
- int nlmiddle;
-
- widthDst = PixmapWidthInPadUnits(width, pDrawable->depth);
- sizeDst = widthDst * height;
-
- /* Clear the dest image */
- bzero(pdstLine, sizeDst << 2);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc,
- depthSrc, psrcBits);
-
- psrcBits = afbScanline(psrcBits, sx, sy, widthSrc);
-
- start_startbit = PPW - 1 - (sx & PIM);
- if ((sx & PIM) + width < PPW) {
- maskpartialbits(sx, width, startmask);
- nlmiddle = 0;
- endmask = 0;
- start_endbit = PPW - ((sx + width) & PIM);
- } else {
- maskbits(sx, width, startmask, endmask, nlmiddle);
- start_endbit = 0;
- end_endbit = PPW - ((sx + width) & PIM);
- }
- /* ZPixmap images have either 4 or 8 bits per pixel dependent on
- * depth.
- */
- if (depthSrc > 4) {
- start_dstshift = 24;
- shift_step = 8;
- } else {
- start_dstshift = 28;
- shift_step = 4;
- }
-#define SHIFT_BITS(start_bit,end_bit) \
-for (b = (start_bit); b >= (end_bit); b--) { \
- dst |= ((srcbits >> b) & 1) << dstshift; \
- if ((dstshift -= shift_step) < 0) { \
- dstshift = start_dstshift + d; \
- *pdst++ = dst; \
- dst = *pdst; \
- } \
-} \
-
- for (d = 0; d < depthSrc; d++, psrcBits += sizeSrc) { /* @@@ NEXT PLANE @@@ */
- psrcLine = psrcBits;
- pdst = (PixelType *)pdstLine;
- h = height;
-
- while (h--) {
- psrc = psrcLine;
- psrcLine += widthSrc;
- dst = *pdst;
- dstshift = start_dstshift + d;
-
- if (startmask) {
- srcbits = *psrc++ & startmask;
- SHIFT_BITS(start_startbit, start_endbit);
- }
-
- nl = nlmiddle;
- while (nl--) {
- srcbits = *psrc++;
- SHIFT_BITS(PPW - 1, 0);
- }
- if (endmask) {
- srcbits = *psrc & endmask;
- SHIFT_BITS(PPW - 1, end_endbit);
- }
-
- if (dstshift != start_dstshift + d)
- *pdst++ = dst;
- } /* while (h--) */
- } /* for (d = ...) */
- }
-}
diff --git a/afb/afbimggblt.c b/afb/afbimggblt.c
deleted file mode 100644
index 60d212ca0..000000000
--- a/afb/afbimggblt.c
+++ /dev/null
@@ -1,470 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbimggblt.c,v 3.2 2003/10/29 22:15:19 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- we should eventually special-case fixed-width fonts for ImageText.
-
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
- the register allocations for startmask and endmask may not
-be the right thing. are there two other deserving candidates?
-xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
-*/
-
-void
-afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
- xRectangle backrect;/* backing rectangle to paint.
- in the general case, NOT necessarily
- the same as the string's bounding box
- */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst;
- /* pointer to current longword in dst */
-
- register int d;
- int depthDst;
- int sizeDst;
- int hSave;
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- unsigned char rrops[AFB_MAX_DEPTH];
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
- unsigned char *pglyphSave;
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
-
- register int nFirst;/* bits of glyph in current longword */
- PixelType *pdstSave;
- int oldFill;
- afbPrivGC *pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
- pdstBase);
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- backrect.x = x;
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.width = info.overallWidth;
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
- x += xorg;
- y += yorg;
-
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- oldFill = pGC->fillStyle;
- pGC->fillStyle = FillSolid;
- afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- afbPolyFillRect(pDrawable, pGC, 1, &backrect);
- pGC->fillStyle = oldFill;
- afbReduceRop (pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- afbReduceRop (GXcopy, pGC->fgPixel, pGC->planemask, pGC->depth, rrops);
-
- /* the faint-hearted can open their eyes now */
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xchar = x & PIM;
-
- while(nglyph--) {
- pci = *ppci;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- hSave = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
- /* start at top scanline of glyph */
- pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent,
- widthDst);
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST) {
- pdstSave++;
- xoff &= PIM;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } /* glyph crosses longwords boundary */
- } /* depth loop */
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar -= PPW;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- afbTEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
-#if GETLEFTBITS_ALIGNMENT > 1
- int getWidth; /* bits to get from glyph */
-#endif
-
- if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS))))
- return;
-
- pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i = 0; i < nglyph; i++) {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar &= PIM;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while(nbox--) {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for(i=0; i<nglyph; i++) {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- hSave = bottomEdge - topEdge;
- if (hSave <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- pglyphSave += (glyphRow * widthGlyph);
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
-#if GETLEFTBITS_ALIGNMENT > 1
- getWidth = w + glyphCol;
-#endif
-
- pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
- widthDst);
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST) {
- xoff &= PIM;
- pdstSave++;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- maskpartialbits(xoff, w, startmask);
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- }
- } /* depth */
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
-
- default:
- break;
- }
-}
diff --git a/afb/afbline.c b/afb/afbline.c
deleted file mode 100644
index 796ddffeb..000000000
--- a/afb/afbline.c
+++ /dev/null
@@ -1,702 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbline.c,v 3.2 2001/10/28 03:32:58 tsi Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbline.c,v 5.18 94/04/17 20:28:26 dpw Exp $ */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "afb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-
-void
-#ifdef POLYSEGMENT
-afbSegmentSS(pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-afbLineSS(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* pointer to start of drawable */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int depthDst;
-#ifndef POLYSEGMENT
- PixelType *addrl; /* address of destination pixmap */
- int d;
-#endif
- int sizeDst;
- unsigned char *rrops;
-
- /* a bunch of temporaries */
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
-
- cclip = pGC->pCompositeClip;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- addrlBase);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2) {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- if (nbox) {
- /* stop when lower edge of box is beyond end of line */
- while((nbox) && (y2 >= pbox->y1)) {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- afbVertS(addrlBase, nlwidth, sizeDst, depthDst, x1, y1t,
- y2t-y1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- } else if (y1 == y2) /* horizontal line */ {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2) {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while( (nbox) && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1)) {
- int tmp;
-
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while((nbox) && (pbox->y1 == tmp)) {
- int x1t, x2t;
-
- if (pbox->x2 <= x1) {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2) {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- afbHorzS(addrlBase, nlwidth, sizeDst, depthDst, x1t, y1,
- x2t-x1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady,
- signdx, signdy, 1, 1, octant);
-
- if (adx > ady) {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- } else {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--) {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0) {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx, signdy,
- axis, x1, y1, e, e1, e2, len, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- break;
- } else if (oc1 & oc2) {
- pbox++;
- } else {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1) {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx,
- signdy, axis, new_x1, new_y1, err, e1, e2, len,
- rrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
-
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1))) {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--) {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
- (y2 < pbox->y2)) {
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(addrlBase, x2, y2, nlwidth);
- addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- switch(rrops[d]) {
- case RROP_BLACK:
- *addrl &= rmask[x2 & PIM];
- break;
- case RROP_WHITE:
- *addrl |= mask[x2 & PIM];
- break;
- case RROP_INVERT:
- *addrl ^= mask[x2 & PIM];
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- break;
- } else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-void
-#ifdef POLYSEGMENT
-afbSegmentSD(pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-afbLineSD(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int sizeDst;
- int depthDst;
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- unsigned char *rrops;
- unsigned char bgrrops[AFB_MAX_DEPTH];
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
-#ifndef POLYSEGMENT
- PixelType *addrl;
- int d;
-#endif
-
- cclip = pGC->pCompositeClip;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- addrlBase);
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- if (isDoubleDash)
- afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
- bgrrops);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady) {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- } else {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--) {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0) {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
- isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
- rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- break;
-#else
- afbBresD(&dashIndex, pDash, numInDashList, &dashOffset,
- isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
- rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- goto dontStep;
-#endif
- } else if (oc1 & oc2) {
- pbox++;
- } else /* have to clip */ {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1) {
- pbox++;
- continue;
- }
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- if (clip1) {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
- isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
- signdx, signdy, axis, new_x1, new_y1, err, e1, e2,
- len, rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1))) {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--) {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
- (y2 < pbox->y2)) {
- int rop;
-
- for (d = 0; d < depthDst; d++) {
- addrl = afbScanline(addrlBase, x2, y2, nlwidth);
- addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- rop = rrops[d];
- if (dashIndex & 1)
- rop = bgrrops[d];
-
- switch (rop) {
- case RROP_BLACK:
- *addrl &= rmask[x2 & PIM];
- break;
- case RROP_WHITE:
- *addrl |= mask[x2 & PIM];
- break;
-
- case RROP_INVERT:
- *addrl ^= mask[x2 & PIM];
- break;
-
- case RROP_NOP:
- break;
- }
- } /* for (d = ...) */
- break;
- } else
- pbox++;
- }
- }
-#endif
-}
diff --git a/afb/afbmisc.c b/afb/afbmisc.c
deleted file mode 100644
index c0ae1c545..000000000
--- a/afb/afbmisc.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbmisc.c,v 3.0 1996/08/18 01:45:44 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbmisc.c,v 5.4 94/04/17 20:28:27 dpw Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "cursor.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-
-/*ARGSUSED*/
-void
-afbQueryBestSize(class, pwidth, pheight, pScreen)
-int class;
-unsigned short *pwidth;
-unsigned short *pheight;
-ScreenPtr pScreen;
-{
- unsigned width, test;
-
- switch(class) {
- case CursorShape:
- if (*pwidth > pScreen->width)
- *pwidth = pScreen->width;
- if (*pheight > pScreen->height)
- *pheight = pScreen->height;
- break;
- case TileShape:
- case StippleShape:
- width = *pwidth;
- if (!width) break;
- /* Return the closes power of two not less than what they gave me */
- test = 0x80000000;
- /* Find the highest 1 bit in the width given */
- while(!(test & width))
- test >>= 1;
- /* If their number is greater than that, bump up to the next
- * power of two */
- if((test - 1) & width)
- test <<= 1;
- *pwidth = test;
- /* We don't care what height they use */
- break;
- }
-}
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
deleted file mode 100644
index fe0d8bc79..000000000
--- a/afb/afbpixmap.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbpixmap.c,v 3.1 1997/06/03 14:11:07 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbpixmap.c,v 5.13 94/04/17 20:28:28 dpw Exp $ */
-
-/* pixmap management
- written by drewry, september 1986
-
- on a monchrome device, a pixmap is a bitmap.
-*/
-
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "maskbits.h"
-
-#include "afb.h"
-#include "mi.h"
-
-#include "servermd.h"
-#include "mfb.h"
-
-PixmapPtr
-afbCreatePixmap(pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
-
- paddedWidth = BitmapBytePad(width);
- datasize = height * paddedWidth * depth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return(NullPixmap);
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = depth;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = datasize ?
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
- pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
- return(pPixmap);
-}
-
-Bool
-afbDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- if(--pPixmap->refcnt)
- return(TRUE);
- xfree(pPixmap);
- return(TRUE);
-}
-
-
-PixmapPtr
-afbCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
- ScreenPtr pScreen;
-
- size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
- pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
- if (!pDst)
- return(NullPixmap);
- memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
- return(pDst);
-}
-
-
-/* replicates a pattern to be a full 32 bits wide.
- relies on the fact that each scnaline is longword padded.
- doesn't do anything if pixmap is not a factor of 32 wide.
- changes width field of pixmap if successful, so that the fast
- XRotatePixmap code gets used if we rotate the pixmap later.
-
- calculate number of times to repeat
- for each scanline of pattern
- zero out area to be filled with replicate
- left shift and or in original as many times as needed
-*/
-void
-afbPadPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- register int width = pPixmap->drawable.width;
- register int h;
- register PixelType mask;
- register PixelType *p;
- register PixelType bits; /* real pattern bits */
- register int i;
- int d;
- int rep; /* repeat count for pattern */
-
- if (width >= PPW)
- return;
-
- rep = PPW/width;
- if (rep*width != PPW)
- return;
-
- mask = endtab[width];
-
- p = (PixelType *)(pPixmap->devPrivate.ptr);
-
- for (d = 0; d < pPixmap->drawable.depth; d++) {
- for (h = 0; h < pPixmap->drawable.height; h++) {
- *p &= mask;
- bits = *p;
- for(i = 1; i < rep; i++) {
- bits = SCRRIGHT(bits, width);
- *p |= bits;
- }
- p++; /* @@@ NEXT PLANE @@@ */
- }
- }
- pPixmap->drawable.width = PPW;
-}
-
-/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
- * words are PPW bits wide, and that the least significant bit appears on the
- * left.
- */
-void
-afbXRotatePixmap(pPix, rw)
- PixmapPtr pPix;
- register int rw;
-{
- register PixelType *pw, *pwFinal;
- register PixelType t;
-
- if (pPix == NullPixmap)
- return;
-
- pw = (PixelType *)pPix->devPrivate.ptr;
- rw %= (int)pPix->drawable.width;
- if (rw < 0)
- rw += (int)pPix->drawable.width;
- if(pPix->drawable.width == PPW) {
- pwFinal = pw + pPix->drawable.height * pPix->drawable.depth;
- while(pw < pwFinal) {
- t = *pw;
- *pw++ = SCRRIGHT(t, rw) |
- (SCRLEFT(t, (PPW-rw)) & endtab[rw]);
- }
- } else {
- /* We no longer do this. Validate doesn't try to rotate odd-size
- * tiles or stipples. afbUnnatural<tile/stipple>FS works directly off
- * the unrotate tile/stipple in the GC
- */
- ErrorF("X internal error: trying to rotate odd-sized pixmap.\n");
- }
-
-}
-
-/* Rotates pixmap pPix by h lines. Assumes that h is always less than
- pPix->height
- works on any width.
- */
-void
-afbYRotatePixmap(pPix, rh)
- register PixmapPtr pPix;
- int rh;
-{
- int nbyDown; /* bytes to move down to row 0; also offset of
- row rh */
- int nbyUp; /* bytes to move up to line rh; also
- offset of first line moved down to 0 */
- char *pbase;
- char *ptmp;
- int height;
- int d;
-
- if (pPix == NullPixmap)
- return;
- height = (int) pPix->drawable.height;
- rh %= height;
- if (rh < 0)
- rh += height;
-
- nbyDown = rh * pPix->devKind;
- nbyUp = (pPix->devKind * height) - nbyDown;
-
- if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
- return;
-
- for (d = 0; d < pPix->drawable.depth; d++) {
- pbase = (char *)pPix->devPrivate.ptr + pPix->devKind * height * d; /* @@@ NEXT PLANE @@@ */
-
- memmove(ptmp, pbase, nbyUp); /* save the low rows */
- memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
- memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */
- }
- DEALLOCATE_LOCAL(ptmp);
-}
-
-void
-afbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
- register PixmapPtr psrcPix, *ppdstPix;
- int xrot, yrot;
-{
- register PixmapPtr pdstPix;
-
- if ((pdstPix = *ppdstPix) &&
- (pdstPix->devKind == psrcPix->devKind) &&
- (pdstPix->drawable.height == psrcPix->drawable.height) &&
- (pdstPix->drawable.depth == psrcPix->drawable.depth)) {
- memmove((char *)pdstPix->devPrivate.ptr,
- (char *)psrcPix->devPrivate.ptr,
- psrcPix->drawable.height * psrcPix->devKind *
- psrcPix->drawable.depth);
- pdstPix->drawable.width = psrcPix->drawable.width;
- pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- } else {
- if (pdstPix)
- /* FIX XBUG 6168 */
- (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
- *ppdstPix = pdstPix = afbCopyPixmap(psrcPix);
- if (!pdstPix)
- return;
- }
- afbPadPixmap(pdstPix);
- if (xrot)
- afbXRotatePixmap(pdstPix, xrot);
- if (yrot)
- afbYRotatePixmap(pdstPix, yrot);
-}
diff --git a/afb/afbply1rct.c b/afb/afbply1rct.c
deleted file mode 100644
index c0c2065f1..000000000
--- a/afb/afbply1rct.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbply1rct.c,v 3.2 2001/10/28 03:32:58 tsi Exp $ */
-/*
- * $XConsortium: afbply1rct.c,v 1.9 94/04/17 20:28:28 dpw Exp $
- *
-Copyright (c) 1990 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-#if defined(mips) || defined(sparc)
-#define GetHighWord(x) (((int)(x)) >> 16)
-#else
-#define GetHighWord(x) (((int)(x)) / 65536)
-#endif
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) (i))))
-#define coordToInt(x,y) (((x) << 16) | (y))
-#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int)((short) i))
-#else
-#define intToCoord(i,x,y) (((x) = (int)((short) (i))), ((y) = GetHighWord(i)))
-#define coordToInt(x,y) (((y) << 16) | (x))
-#define intToX(i) ((int)((short) (i)))
-#define intToY(i) (GetHighWord(i))
-#endif
-
-void
-afbFillPolygonSolid (pDrawable, pGC, shape, mode, count, ptsIn)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int shape;
- int mode;
- int count;
- DDXPointPtr ptsIn;
-{
- afbPrivGCPtr devPriv;
- int nlwidth;
- PixelType *addrl, *addr;
- int maxy;
- int origin;
- register int vertex1, vertex2;
- int c;
- BoxPtr extents;
- int clip;
- int y;
- int *vertex1p = NULL, *vertex2p;
- int *endp;
- int x1 = 0, x2 = 0;
- int dx1 = 0, dx2 = 0;
- int dy1 = 0, dy2 = 0;
- int e1 = 0, e2 = 0;
- int step1 = 0, step2 = 0;
- int sign1 = 0, sign2 = 0;
- int h;
- int l, r;
- PixelType mask, bits = ~((PixelType)0);
- int nmiddle;
- register unsigned char *rrops;
- register int n;
- register int d;
- int sizeDst;
- int depthDst;
- register PixelType *pdst;
-
- devPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
-
- if (mode == CoordModePrevious || shape != Convex ||
- REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
- origin = *((int *) &pDrawable->x);
- origin -= (origin & 0x8000) << 1;
- extents = &pGC->pCompositeClip->extents;
- vertex1 = *((int *) &extents->x1) - origin;
- vertex2 = *((int *) &extents->x2) - origin - 0x00010001;
- clip = 0;
- y = 32767;
- maxy = 0;
- vertex2p = (int *) ptsIn;
- endp = vertex2p + count;
- while (count--) {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y) {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- }
- if (y == maxy)
- return;
-
- if (clip & 0x80008000) {
- miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
- return;
- }
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- addrl);
- rrops = devPriv->rrops;
- addrl = afbScanlineDelta(addrl, y + pDrawable->y, nlwidth);
- origin = intToX(origin);
- vertex2p = vertex1p;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
- x = intToX(vertex); \
- if ((dy = intToY(c) - y)) { \
- dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx = dx % dy; \
- } \
- } else { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx = dx % dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) { \
- x += sign; \
- e -= dy; \
- } \
-}
- for (;;) {
- if (y == intToY(vertex1)) {
- do {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
- } while (y >= intToY(vertex1));
- h = dy1;
- } else {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2)) {
- do {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- } else {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
- /* fill spans for this segment */
- y += h;
- for (;;) {
- l = x1;
- r = x2;
- nmiddle = x2 - x1;
- if (nmiddle < 0) {
- nmiddle = -nmiddle;
- l = x2;
- r = x1;
- }
- c = l & PIM;
- l -= c;
- l = l >> PWSH;
- addr = addrl + l;
- if (c + nmiddle < PPW) {
- mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle);
- for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- *pdst |= mask;
- break;
- case RROP_INVERT:
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- } else {
- if (c) {
- mask = SCRRIGHT(bits, c);
- for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- *pdst |= mask;
- break;
- case RROP_INVERT:
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- nmiddle += c - PPW;
- addr++;
- }
- nmiddle >>= PWSH;
- mask = ~SCRRIGHT(bits, r & PIM);
-
- for (d = 0; d < depthDst; d++, addr += sizeDst) { /* @@@ NEXT PLANE @@@ */
- n = nmiddle;
- pdst = addr;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- Duff (n, *pdst++ = 0;)
- if (mask)
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- Duff (n, *pdst++ = ~0;);
- if (mask)
- *pdst |= mask;
- break;
- case RROP_INVERT:
- Duff (n, *pdst++ ^= ~0;);
- if (mask)
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- if (!--h)
- break;
- afbScanlineInc(addrl, nlwidth);
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if (y == maxy)
- break;
- afbScanlineInc(addrl, nlwidth);
- }
-}
diff --git a/afb/afbplygblt.c b/afb/afbplygblt.c
deleted file mode 100644
index 3938433c3..000000000
--- a/afb/afbplygblt.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbplygblt.c,v 3.3 2003/10/29 22:15:19 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
-*/
-
-void
-afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst; /* pointer to current longword in dst */
-
- register int d;
- int depthDst;
- int sizeDst;
- int hSave;
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- unsigned char *rrops;
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
- unsigned char *pglyphSave;
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
-
- register int nFirst; /* bits of glyph in current longword */
- PixelType *pdstSave;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
- pdstBase);
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- x += xorg;
- y += yorg;
-
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rrops;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xchar = x & PIM;
-
- while(nglyph--) {
- pci = *ppci;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- hSave = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
- /* start at top scanline of glyph */
- pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent,
- widthDst);
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST) {
- pdstSave++;
- xoff &= PIM;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- }
- } else {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- }
- } /* glyph crosses longwords boundary */
- } /* depth loop */
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar -= PPW;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- afbTEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
-#if GETLEFTBITS_ALIGNMENT > 1
- int getWidth; /* bits to get from glyph */
-#endif
-
- if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS))))
- return;
-
- pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i = 0; i < nglyph; i++) {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar &= PIM;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while(nbox--) {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for(i=0; i<nglyph; i++) {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- hSave = bottomEdge - topEdge;
- if (hSave <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- pglyphSave += (glyphRow * widthGlyph);
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
-#if GETLEFTBITS_ALIGNMENT > 1
- getWidth = w + glyphCol;
-#endif
-
- pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
- widthDst);
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST) {
- xoff &= PIM;
- pdstSave++;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- maskpartialbits(xoff, w, startmask);
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- }
- } else {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- afbScanlineInc(pdst, widthDst);
- }
- break;
- }
- }
- } /* depth */
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
-
- default:
- break;
- }
-}
diff --git a/afb/afbpntarea.c b/afb/afbpntarea.c
deleted file mode 100644
index 239346ceb..000000000
--- a/afb/afbpntarea.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbpntarea.c,v 3.1 2001/10/28 03:32:58 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbpntarea.c,v 5.7 94/04/17 20:28:29 dpw Exp $ */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-/*
- the solid fillers are called for rectangles and window backgrounds.
- the boxes are already translated.
- maybe this should always take a pixmap instead of a drawable?
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*ARGSUSED*/
-void
-afbSolidFillArea (pDraw, nbox, pbox, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- register unsigned char *rrops;
-{
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int h; /* height of current box */
- register PixelType *p; /* pointer to bits we're writing */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType startmask;
- register PixelType endmask;
- /* masks for reggedy bits at either end of line */
- register int nlwExtra;
- /* to get from right of box to left of next span */
- int nlwMiddle; /* number of longwords between sides of boxes */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- int saveH;
- int depthDst;
- int sizeDst;
- register int d;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pbits);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
-
- saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- for (d = 0; d < depthDst; d++) {
- h = saveH;
- p = saveP;
- saveP += sizeDst; /* @@@ NEXT PLANE @@@ */
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- Duff(h, *p &= ~startmask; afbScanlineInc(p, nlwExtra));
- break;
- case RROP_WHITE:
- Duff(h, *p |= startmask; afbScanlineInc(p, nlwExtra));
- break;
- case RROP_INVERT:
- Duff(h, *p ^= startmask; afbScanlineInc(p, nlwExtra));
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ..) */
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++) {
- h = saveH;
- p = saveP;
- saveP += sizeDst; /* @@@ NEXT PLANE @@@ */
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- *p &= ~startmask;
- p++;
- Duff(nlw, *p++ = 0);
- *p &= ~endmask;
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- *p |= startmask;
- p++;
- Duff(nlw, *p++ = ~0);
- *p |= endmask;
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- *p ^= startmask;
- p++;
- Duff(nlw, *p++ ^= ~0);
- *p ^= endmask;
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- *p &= ~startmask;
- p++;
- Duff(nlw, *p++ = 0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- *p |= startmask;
- p++;
- Duff(nlw, *p++ = ~0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- *p ^= startmask;
- p++;
- Duff(nlw, *p++ ^= ~0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else if (!startmask && endmask) {
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = 0);
- *p &= ~endmask;
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = ~0);
- *p |= endmask;
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= ~0);
- *p ^= endmask;
- afbScanlineInc(p, nlwExtra);
- }
- case RROP_NOP:
- break;
- }
- } else { /* no ragged bits at either end */
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = 0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = ~0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= ~0);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- }
- } /* for (d = 0 ... ) */
- }
- pbox++;
- }
-}
-
-/* stipple a list of boxes -
-
-you can use the reduced rasterop for stipples. if rrop is
-black, AND the destination with (not stipple pattern). if rrop is
-white OR the destination with the stipple pattern. if rrop is invert,
-XOR the destination with the stipple pattern.
-*/
-
-/*ARGSUSED*/
-void
-afbStippleAreaPPW (pDraw, nbox, pbox, pstipple, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- PixmapPtr pstipple;
- unsigned char *rrops;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
-
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- register int h; /* height of current box */
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- int sizeDst;
- int depthDst;
- int d;
- int saveIy;
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *pBase;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pBase);
-
- tileHeight = pstipple->drawable.height;
- psrc = (PixelType *)(pstipple->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveIy = pbox->y1 % tileHeight;
- pbits = pBase;
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- for (d = 0; d < depthDst; d++) {
- p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
- pbits += sizeDst; /* @@@ NEXT PLANE @@@ */
- iy = saveIy;
- h = pbox->y2 - pbox->y1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p &= ~(srcpix & startmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p |= (srcpix & startmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p ^= (srcpix & startmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++) {
- nlwExtra = nlwidth - nlwMiddle;
- p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
- pbits += sizeDst; /* @@@ NEXT PLANE @@@ */
- iy = saveIy;
- h = pbox->y2 - pbox->y1;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p &= ~(srcpix & startmask);
- p++;
- Duff (nlw, *p++ &= ~srcpix);
- *p &= ~(srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p |= (srcpix & startmask);
- p++;
- Duff (nlw, *p++ |= srcpix);
- *p |= (srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p ^= (srcpix & startmask);
- p++;
- Duff (nlw, *p++ ^= srcpix);
- *p ^= (srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p &= ~(srcpix & startmask);
- p++;
- Duff(nlw, *p++ &= ~srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p |= (srcpix & startmask);
- p++;
- Duff(nlw, *p++ |= srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p ^= (srcpix & startmask);
- p++;
- Duff(nlw, *p++ ^= srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else if (!startmask && endmask) {
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ &= ~srcpix);
- *p &= ~(srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ |= srcpix);
- *p |= (srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= srcpix);
- *p ^= (srcpix & endmask);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else { /* no ragged bits at either end */
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ &= ~srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ |= srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= srcpix);
- afbScanlineInc(p, nlwExtra);
- }
- break;
- } /* switch */
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-afbStippleArea (pDraw, nbox, pbox, pTile, xOff, yOff, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- unsigned char *rrops;
-{
- register PixelType *psrc; /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- int sizeDst;
- int depthDst;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- register int rop;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pBase);
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind / sizeof (PixelType);
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
-
- for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- rop = rrops[d];
-
- while(width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrrop((psrc + endinc), (rem & PIM), (x & PIM),
- w, pdst, rop)
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- getandputrrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
-
- if(endmask) {
- getandputrrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += nlwidth;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
diff --git a/afb/afbpntwin.c b/afb/afbpntwin.c
deleted file mode 100644
index 17d924059..000000000
--- a/afb/afbpntwin.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbpntwin.c,v 3.0 1996/08/18 01:45:50 dawes Exp $ */
-/* $XConsortium: afbpntwin.c,v 5.12 94/04/17 20:28:30 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-#include "mi.h"
-
-void
-afbPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- register afbPrivWin *pPrivWin;
- unsigned char rrops[AFB_MAX_DEPTH];
-
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- return;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground) {
- afbTileAreaPPWCopy((DrawablePtr)pWin,
- REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBackground, ~0);
- return;
- } else {
- afbTileAreaCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pWin->background.pixmap, 0, 0, ~0);
- return;
- }
- break;
- case BackgroundPixel:
- afbReduceRop(GXcopy, pWin->background.pixel, ~0,
- pWin->drawable.depth, rrops);
- afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), rrops);
- return;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel) {
- afbReduceRop(GXcopy, pWin->border.pixel, ~0, pWin->drawable.depth,
- rrops);
- afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), rrops);
- return;
- } else if (pPrivWin->fastBorder) {
- afbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBorder, ~0);
- return;
- }
- break;
- }
- miPaintWindow(pWin, pRegion, what);
-}
diff --git a/afb/afbpolypnt.c b/afb/afbpolypnt.c
deleted file mode 100644
index b09f3b037..000000000
--- a/afb/afbpolypnt.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbpolypnt.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbpolypnt.c,v 5.6 94/04/17 20:28:30 dpw Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-void
-afbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- register DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
-
- register BoxPtr pbox;
- register int nbox;
- register int d;
-
- register PixelType *addrl;
- PixelType *pBase;
- PixelType *pBaseSave;
- int nlwidth;
- int sizeDst;
- int depthDst;
-
- int nptTmp;
- register xPoint *ppt;
-
- register int x;
- register int y;
- register unsigned char *rrops;
- afbPrivGC *pGCPriv;
-
- pGCPriv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr;
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
- pBaseSave);
-
- rrops = pGCPriv->rrops;
- if ((mode == CoordModePrevious) && (npt > 1))
- for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
-
- nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
- pbox = REGION_RECTS(pGC->pCompositeClip);
- for (; --nbox >= 0; pbox++)
- for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
- addrl = pBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *afbScanline(addrl, x, y, nlwidth) &= rmask[x & PIM];
- }
- break;
-
- case RROP_WHITE:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *afbScanline(addrl, x, y, nlwidth) |= mask[x & PIM];
- }
- break;
-
- case RROP_INVERT:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *afbScanline(addrl, x, y, nlwidth) ^= mask[x & PIM];
- }
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-}
diff --git a/afb/afbpushpxl.c b/afb/afbpushpxl.c
deleted file mode 100644
index d556acd8c..000000000
--- a/afb/afbpushpxl.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbpushpxl.c,v 3.2 2003/07/16 01:38:35 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbpushpxl.c,v 5.6 94/04/17 20:28:31 dpw Exp $ */
-
-#include "X.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-#include "afb.h"
-
-/* afbSolidPP is courtesy of xhacks@csri.toronto.edu
-
- For fillStyle==FillSolid, a monochrome PushPixels can be reduced to
- a ROP in the following way: (Note that the ROP is the same as the
- result of ROP(src=0x3,dst=0x5))
-
- src=0011 0000 0011
- dst=0101 0101 0101
- rop fg=0 fg=1
- GXclear 0x0 0000 0100 0100 0
- GXand 0x1 0001 0100 0101 s&d
- GXandReverse 0x2 0010 0100 0110 s&~d
- GXcopy 0x3 0011 0100 0111 s
- GXandInverted 0x4 0100 0101 0100 ~s&d
- GXnoop 0x5 0101 0101 0101 d
- GXxor 0x6 0110 0101 0110 s^d
- GXor 0x7 0111 0101 0111 s|d
- GXnor 0x8 1000 0110 0100 ~s&~d
- GXequiv 0x9 1001 0110 0101 ~s^d
- GXinvert 0xa 1010 0110 0110 ~d
- GXorReverse 0xb 1011 0110 0111 s|~d
- GXcopyInverted 0xc 1100 0111 0100 ~s
- GXorInverted 0xd 1101 0111 0101 ~s|d
- GXnand 0xe 1110 0111 0110 ~s|~d
- GXset 0xf 1111 0111 0111 1
-
-For src=0: newRop = 0x4|(rop>>2)
-For src=1: newRop = 0x4|(rop&3)
-*/
-
-/* afbSolidPP -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-afbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- unsigned char alu;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- BoxRec srcBox;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
-
- if (!pGC->planemask & 1) return;
-
- /* compute the reduced rop function */
- alu = pGC->alu;
- if (!(pGC->fgPixel&1)) alu >>= 2;
- alu = (alu & 0x3) | 0x4;
- if (alu == GXnoop) return;
-
- srcBox.x1 = xOrg;
- srcBox.y1 = yOrg;
- srcBox.x2 = xOrg + dx;
- srcBox.y2 = yOrg + dy;
- REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1);
-
- /* clip the shape of the dst to the destination composite clip */
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
-
- if (!REGION_NIL(&rgnDst)) {
- i = REGION_NUM_RECTS(&rgnDst);
- pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if(pptSrc) {
- for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; --i >= 0;
- pbox++, ppt++) {
- ppt->x = pbox->x1 - xOrg;
- ppt->y = pbox->y1 - yOrg;
- }
- afbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc,
- pGC->planemask);
- DEALLOCATE_LOCAL(pptSrc);
- }
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
-}
-
-#define NPT 128
-
-/* afbPushPixels -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-afbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- int h, dxDivPPW, ibEnd;
- PixelType *pwLineStart;
- register PixelType *pw, *pwEnd;
- register PixelType mask;
- register int ib;
- register PixelType w;
- register int ipt; /* index into above arrays */
- Bool fInBox;
- DDXPointRec pt[NPT];
- int width[NPT];
-
- /* Now scan convert the pixmap and use the result to call fillspans in
- * in the drawable with the original GC */
- ipt = 0;
- dxDivPPW = dx/PPW;
- for (h = 0; h < dy; h++) {
-
- pw = (PixelType *)
- (((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind));
- pwLineStart = pw;
- /* Process all words which are fully in the pixmap */
-
- fInBox = FALSE;
- pwEnd = pwLineStart + dxDivPPW;
- while(pw < pwEnd) {
- w = *pw;
- mask = endtab[1];
- for(ib = 0; ib < PPW; ib++) {
- if(w & mask) {
- if(!fInBox) {
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if(fInBox) {
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- /* end box */
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- pw++;
- }
- ibEnd = dx & PIM;
- if(ibEnd) {
- /* Process final partial word on line */
- w = *pw;
- mask = endtab[1];
- for(ib = 0; ib < ibEnd; ib++) {
- if(w & mask) {
- if(!fInBox) {
- /* start new box */
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- fInBox = TRUE;
- }
- } else {
- if(fInBox) {
- /* end box */
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox) {
- width[ipt] = dx + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- }
- }
- /* Flush any remaining spans */
- if (ipt) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
- }
-}
diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c
deleted file mode 100644
index d2b3fd02b..000000000
--- a/afb/afbscrinit.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbscrinit.c,v 3.5 1998/11/22 10:36:59 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbscrinit.c,v 5.17 94/04/17 20:28:34 dpw Exp $ */
-
-#include "X.h"
-#include "Xproto.h" /* for xColorItem */
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "afb.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "servermd.h"
-
-#ifdef PIXMAP_PER_WINDOW
-int frameWindowPrivateIndex;
-#endif
-int afbWindowPrivateIndex;
-int afbGCPrivateIndex;
-int afbScreenPrivateIndex;
-
-static unsigned long afbGeneration = 0;
-
-BSFuncRec afbBSFuncRec = {
- afbSaveAreas,
- afbRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-Bool
-afbCloseScreen(index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- int d;
- DepthPtr depths = pScreen->allowedDepths;
-
- for (d = 0; d < pScreen->numDepths; d++)
- xfree(depths[d].vids);
- xfree(depths);
- xfree(pScreen->visuals);
- xfree(pScreen->devPrivates[afbScreenPrivateIndex].ptr);
- return(TRUE);
-}
-
-Bool
-afbCreateScreenResources(pScreen)
- ScreenPtr pScreen;
-{
- Bool retval;
-
- pointer oldDevPrivate = pScreen->devPrivate;
-
- pScreen->devPrivate = pScreen->devPrivates[afbScreenPrivateIndex].ptr;
- retval = miCreateScreenResources(pScreen);
-
- /* Modify screen's pixmap devKind value stored off devPrivate to
- * be the width of a single plane in longs rather than the width
- * of a chunky screen in longs as incorrectly setup by the mi routine.
- */
- ((PixmapPtr)pScreen->devPrivate)->devKind = BitmapBytePad(pScreen->width);
- pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
- return(retval);
-}
-
-Bool
-afbAllocatePrivates(pScreen, pWinIndex, pGCIndex)
- ScreenPtr pScreen;
- int *pWinIndex, *pGCIndex;
-{
- if (afbGeneration != serverGeneration) {
-#ifdef PIXMAP_PER_WINDOW
- frameWindowPrivateIndex = AllocateWindowPrivateIndex();
-#endif
- afbWindowPrivateIndex = AllocateWindowPrivateIndex();
- afbGCPrivateIndex = AllocateGCPrivateIndex();
- afbGeneration = serverGeneration;
- }
- if (pWinIndex)
- *pWinIndex = afbWindowPrivateIndex;
- if (pGCIndex)
- *pGCIndex = afbGCPrivateIndex;
-
- afbScreenPrivateIndex = AllocateScreenPrivateIndex();
- pScreen->GetWindowPixmap = afbGetWindowPixmap;
- pScreen->SetWindowPixmap = afbSetWindowPixmap;
- return(AllocateWindowPrivate(pScreen, afbWindowPrivateIndex, sizeof(afbPrivWin)) &&
- AllocateGCPrivate(pScreen, afbGCPrivateIndex, sizeof(afbPrivGC)));
-}
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-afbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
- pointer oldDevPrivate;
-
- rootdepth = 0;
- if (!afbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual, 256, 8)) {
- ErrorF("afbInitVisuals: FALSE\n");
- return FALSE;
- }
- if (!afbAllocatePrivates(pScreen,(int *)NULL, (int *)NULL)) {
- ErrorF("afbAllocatePrivates: FALSE\n");
- return FALSE;
- }
-
- pScreen->defColormap = (Colormap)FakeClientID(0);
- /* whitePixel, blackPixel */
- pScreen->blackPixel = 0;
- pScreen->whitePixel = 0;
- pScreen->QueryBestSize = afbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = afbGetImage;
- pScreen->GetSpans = afbGetSpans;
- pScreen->CreateWindow = afbCreateWindow;
- pScreen->DestroyWindow = afbDestroyWindow;
- pScreen->PositionWindow = afbPositionWindow;
- pScreen->ChangeWindowAttributes = afbChangeWindowAttributes;
- pScreen->RealizeWindow = afbMapWindow;
- pScreen->UnrealizeWindow = afbUnmapWindow;
- pScreen->PaintWindowBackground = afbPaintWindow;
- pScreen->PaintWindowBorder = afbPaintWindow;
- pScreen->CopyWindow = afbCopyWindow;
- pScreen->CreatePixmap = afbCreatePixmap;
- pScreen->DestroyPixmap = afbDestroyPixmap;
- pScreen->RealizeFont = afbRealizeFont;
- pScreen->UnrealizeFont = afbUnrealizeFont;
- pScreen->CreateGC = afbCreateGC;
- pScreen->CreateColormap = afbInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
- pScreen->InstallColormap = afbInstallColormap;
- pScreen->UninstallColormap = afbUninstallColormap;
- pScreen->ListInstalledColormaps = afbListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
- pScreen->ResolveColor = afbResolveColor;
- pScreen->BitmapToRegion = afbPixmapToRegion;
- oldDevPrivate = pScreen->devPrivate;
- if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth,
- ndepths, depths, defaultVisual, nvisuals, visuals)) {
- ErrorF("miScreenInit: FALSE\n");
- return FALSE;
- }
-
- pScreen->CloseScreen = afbCloseScreen;
- pScreen->CreateScreenResources = afbCreateScreenResources;
- pScreen->BackingStoreFuncs = afbBSFuncRec;
-
- pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
-
- return TRUE;
-}
-
-PixmapPtr
-afbGetWindowPixmap(pWin)
- WindowPtr pWin;
-{
-#ifdef PIXMAP_PER_WINDOW
- return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
-#else
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- return (* pScreen->GetScreenPixmap)(pScreen);
-#endif
-}
-
-void
-afbSetWindowPixmap(pWin, pPix)
- WindowPtr pWin;
- PixmapPtr pPix;
-{
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
-#else
- (* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
-#endif
-}
diff --git a/afb/afbsetsp.c b/afb/afbsetsp.c
deleted file mode 100644
index 93331b857..000000000
--- a/afb/afbsetsp.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbsetsp.c,v 3.3 2001/10/28 03:32:58 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbsetsp.c,v 5.8 94/04/17 20:28:34 dpw Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-
-/* afbSetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-void
-afbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst,
- sizeDst, depthDst, sizeSrc)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register PixelType *psrc;
- register int alu; /* raster op */
- PixelType *pdstBase; /* start of the drawable */
- int widthDst; /* width of drawable in words */
- int sizeDst;
- int depthDst;
- int sizeSrc;
-{
- int w; /* width of scanline in bits */
- register PixelType *pdst; /* where to put the bits */
- register PixelType tmpSrc; /* scratch buffer to collect bits in */
- int dstBit; /* offset in bits from beginning of
- * word */
- register int nstart; /* number of bits from first partial */
- register int nend; /* " " last partial word */
- int offSrc;
- PixelType startmask, endmask;
- PixelType *savePsrc = psrc + ((xStart - xOrigin) >> PWSH);
- int nlMiddle, nl;
- int d;
-
- for (d = 0; d < depthDst; d++) {
- pdst = afbScanline(pdstBase, xStart, y, widthDst) + sizeDst * d; /* @@@ NEXT PLANE @@@ */
- psrc = savePsrc + sizeSrc * d; /* @@@ NEXT PLANE @@@ */
- offSrc = (xStart - xOrigin) & PIM;
- w = xEnd - xStart;
- dstBit = xStart & PIM;
-
- if (dstBit + w <= PPW) {
- getandputrop(psrc, offSrc, dstBit, w, pdst, alu)
- } else {
- maskbits(xStart, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - dstBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- else
- nend = 0;
- if (startmask) {
- getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
- pdst++;
- offSrc += nstart;
- if (offSrc > PLST) {
- psrc++;
- offSrc -= PPW;
- }
- }
- nl = nlMiddle;
- while (nl--) {
- getbits(psrc, offSrc, PPW, tmpSrc);
- DoRop(*pdst, alu, tmpSrc, *pdst);
- pdst++;
- psrc++;
- }
- if (endmask) {
- getandputrop0(psrc, offSrc, nend, pdst, alu);
- }
- }
- }
-}
-
-
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-afbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *pcharsrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- PixelType *psrc = (PixelType *)pcharsrc;
- PixelType *pdstBase; /* start of dst bitmap */
- int widthDst; /* width of bitmap in words */
- int sizeDst;
- int depthDst;
- int sizeSrc = 0;
- register BoxPtr pbox, pboxLast, pboxTest;
- register DDXPointPtr pptLast;
- int alu;
- RegionPtr prgnDst;
- int xStart, xEnd;
- int yMax;
-
- alu = pGC->alu;
- prgnDst = pGC->pCompositeClip;
-
- pptLast = ppt + nspans;
-
- yMax = pDrawable->y + (int) pDrawable->height;
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
- pdstBase);
-
- pbox = REGION_RECTS(prgnDst);
- pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
-
- if(fSorted) {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- pboxTest = pbox;
- while(ppt < pptLast) {
- pbox = pboxTest;
- if(ppt->y >= yMax)
- break;
- while(pbox < pboxLast) {
- if(pbox->y1 > ppt->y) {
- /* scanline is before clip box */
- break;
- } else if(pbox->y2 <= ppt->y) {
- /* clip box is before scanline */
- pboxTest = ++pbox;
- continue;
- } else if(pbox->x1 > ppt->x + *pwidth) {
- /* clip box is to right of scanline */
- break;
- } else if(pbox->x2 <= ppt->x) {
- /* scanline is to right of clip box */
- pbox++;
- continue;
- }
-
- /* at least some of the scanline is in the current clip box */
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(ppt->x + *pwidth, pbox->x2);
- sizeSrc = PixmapWidthInPadUnits(*pwidth, 1);
- afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase,
- widthDst, sizeDst, depthDst, sizeSrc);
- if(ppt->x + *pwidth <= pbox->x2) {
- /* End of the line, as it were */
- break;
- } else
- pbox++;
- }
- /* We've tried this line against every box; it must be outside them
- * all. move on to the next point */
- ppt++;
- psrc += sizeSrc * depthDst;
- pwidth++;
- }
- } else {
- /* scan lines not sorted. We must clip each line against all the boxes */
- while(ppt < pptLast) {
- if(ppt->y >= 0 && ppt->y < yMax) {
- for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++) {
- if(pbox->y1 > ppt->y) {
- /* rest of clip region is above this scanline,
- * skip it */
- break;
- }
- if(pbox->y2 <= ppt->y) {
- /* clip box is below scanline */
- pbox++;
- break;
- }
- if(pbox->x1 <= ppt->x + *pwidth &&
- pbox->x2 > ppt->x) {
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(pbox->x2, ppt->x + *pwidth);
- sizeSrc = PixmapWidthInPadUnits(*pwidth, 1);
- afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- pdstBase, widthDst, sizeDst, depthDst,
- sizeSrc);
- }
-
- }
- }
- psrc += sizeSrc * depthDst;
- ppt++;
- pwidth++;
- }
- }
-}
diff --git a/afb/afbtegblt.c b/afb/afbtegblt.c
deleted file mode 100644
index b12eeb252..000000000
--- a/afb/afbtegblt.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbtegblt.c,v 3.2 2001/10/28 03:32:58 tsi Exp $ */
-/* $XConsortium: afbtegblt.c,v 5.14 94/04/17 20:28:35 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "afb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= PPW bits wide.
-
- This should be called only with a terminal-emulator font;
-this means that the FIXED_METRICS flag is set, and that
-glyphbounds == charbounds.
-
- in theory, this goes faster; even if it doesn't, it reduces the
-flicker caused by writing a string over itself with image text (since
-the background gets repainted per character instead of per string.)
-this seems to be important for some converted X10 applications.
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
-*/
-
-#if defined(NO_3_60_CG4) && defined(FASTPUTBITS) && defined(FASTGETBITS)
-#define FASTCHARS
-#endif
-
-/*
- * this macro "knows" that only characters <= 8 bits wide will
- * fit this case (which is why it is independent of GLYPHPADBYTES)
- */
-
-#if (BITMAP_BIT_ORDER == MSBFirst) && (GLYPHPADBYTES != 4)
-#if GLYPHPADBYTES == 1
-#define ShiftAmnt 24
-#else
-#define ShiftAmnt 16
-#endif
-
-/*
- * Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its
- * first argument more than once. Thus the imbedded char++ have to be moved.
- * (DHD)
- */
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#if PPW == 32
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
-#else /* PPW */
-#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
- (SCRRIGHT (*char2++ << ShiftAmnt, xoff2) << 32 ) | \
- (SCRRIGHT (*char3++ << ShiftAmnt, xoff3) << 32 ) | \
- (SCRRIGHT (*char4++ << ShiftAmnt, xoff4) << 32 ) | \
- (*char5++ << ShiftAmnt) | \
- SCRRIGHT (*char6++ << ShiftAmnt, xoff6) | \
- SCRRIGHT (*char7++ << ShiftAmnt, xoff7) | \
- SCRRIGHT (*char8++ << ShiftAmnt, xoff8);
-#endif /* PPW */
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#if PPW == 32
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4 << ShiftAmnt, xoff4); \
- char2++; char3++; char4++;
-#else /* PPW == 64 */
-#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
- (SCRRIGHT (*char2 << ShiftAmnt, xoff2) << 32 ) | \
- (SCRRIGHT (*char3 << ShiftAmnt, xoff3) << 32 ) | \
- (SCRRIGHT (*char4 << ShiftAmnt, xoff4) << 32 ) | \
- (*char5++ << ShiftAmnt) | \
- SCRRIGHT (*char6 << ShiftAmnt, xoff6) | \
- SCRRIGHT (*char7 << ShiftAmnt, xoff7) | \
- SCRRIGHT (*char8 << ShiftAmnt, xoff8); \
- char2++; char3++; char4++; char6++; char7++; char8++;
-#endif /* PPW */
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */
-
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#if PPW == 32
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2++, xoff2) | \
- SCRRIGHT (*char3++, xoff3) | \
- SCRRIGHT (*char4++, xoff4);
-#else /* PPW == 64 */
-#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
- (SCRRIGHT (*char2++, xoff2) << 64 ) | \
- (SCRRIGHT (*char3++, xoff3) << 64 ) | \
- (SCRRIGHT (*char4++, xoff4) << 64 ) | \
- SCRRIGHT (*char5++, xoff5) | \
- SCRRIGHT (*char6++, xoff6) | \
- SCRRIGHT (*char7++, xoff7) | \
- SCRRIGHT (*char8++, xoff8));
-#endif /* PPW */
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#if PPW == 32
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2, xoff2) | \
- SCRRIGHT (*char3, xoff3) | \
- SCRRIGHT (*char4, xoff4); \
- char2++; char3++; char4++;
-#else /* PPW == 64 */
-#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
- (SCRRIGHT (*char2, xoff2) << 64 ) | \
- (SCRRIGHT (*char3, xoff3) << 64 ) | \
- (SCRRIGHT (*char4, xoff4) << 64 ) | \
- SCRRIGHT (*char5, xoff5) | \
- SCRRIGHT (*char6, xoff6) | \
- SCRRIGHT (*char7, xoff7) | \
- SCRRIGHT (*char8, xoff8)); \
- char2++; char3++; char4++; \
- char5++; char6++; char7++; char8++;
-#endif /* PPW */
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */
-
-
-#if GLYPHPADBYTES == 1
-typedef unsigned char *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 2
-typedef unsigned short *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 4
-typedef unsigned int *glyphPointer;
-#endif
-
-#ifdef USE_LEFTBITS
-#define GetBits1 getleftbits (char1, widthGlyph, c); \
- c &= glyphMask; \
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
-#define GetBits1 c = *char1++;
-#endif
-
-void
-afbTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- FontPtr pfont = pGC->font;
- int widthDst;
- PixelType *pdstBase; /* pointer to longword with top row
- of current glyph */
-
- int h; /* height of glyph and char */
- register int xpos; /* current x */
- int ypos; /* current y */
- int widthGlyph;
-
- int hTmp; /* counter for height */
- register PixelType startmask, endmask;
- int nfirst; /* used if glyphs spans a longword boundary */
- BoxRec bbox; /* for clipping */
- int widthGlyphs;
- int sizeDst;
- int depthDst;
- PixelType *saveDst;
- register PixelType *dst;
- register PixelType c;
- register int d;
- register int xoff1, xoff2, xoff3, xoff4;
- register glyphPointer char1, char2, char3, char4;
- glyphPointer schar1, schar2, schar3, schar4;
-#if PPW == 64
- register int xoff5, xoff6, xoff7, xoff8;
- register glyphPointer char5, char6, char7, char8;
- glyphPointer schar5, schar6, schar7, schar8;
-#endif /* PPW */
-
- unsigned char *rrops;
-#ifdef USE_LEFTBITS
- register PixelType glyphMask;
- register PixelType tmpSrc;
- register int glyphBytes;
-#endif
-
- afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
- pdstBase);
-
- xpos = x + pDrawable->x;
- ypos = y + pDrawable->y;
-
- widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
-
- xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
- ypos -= FONTASCENT(pfont);
-
- rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rropOS;
-
- bbox.x1 = xpos;
- bbox.x2 = xpos + (widthGlyph * nglyph);
- bbox.y1 = ypos;
- bbox.y2 = ypos + h;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnPART:
- /* this is the WRONG thing to do, but it works.
- calling the non-terminal text is easy, but slow, given
- what we know about the font.
-
- the right thing to do is something like:
- for each clip rectangle
- compute at which row the glyph starts to be in it,
- and at which row the glyph ceases to be in it
- compute which is the first glyph inside the left
- edge, and the last one inside the right edge
- draw a fractional first glyph, using only
- the rows we know are in
- draw all the whole glyphs, using the appropriate rows
- draw any pieces of the last glyph, using the right rows
-
- this way, the code would take advantage of knowing that
- all glyphs are the same height and don't overlap.
-
- one day...
- */
- afbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- case rgnOUT:
- return;
- }
- pdstBase = afbScanlineDeltaNoBankSwitch(pdstBase, ypos, widthDst);
- widthGlyphs = widthGlyph * PGSZB;
-
-#ifdef USE_LEFTBITS
- glyphMask = endtab[widthGlyph];
- glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
-#endif
-
- if (nglyph >= PGSZB && widthGlyphs <= PPW) {
- while (nglyph >= PGSZB) {
- nglyph -= PGSZB;
- xoff1 = xpos & PIM;
- xoff2 = widthGlyph;
- xoff3 = xoff2 + widthGlyph;
- xoff4 = xoff3 + widthGlyph;
-#if PPW == 64
- xoff5 = xoff4 + widthGlyph;
- xoff6 = xoff5 + widthGlyph;
- xoff7 = xoff6 + widthGlyph;
- xoff8 = xoff7 + widthGlyph;
-#endif /* PPW */
- schar1 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar2 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar3 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar4 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
-#if PPW == 64
- schar5 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar6 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar7 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar8 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
-#endif /* PPW */
-
- hTmp = h;
- saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */
-
-#ifndef FASTCHARS
- if (xoff1 + widthGlyphs <= PPW) {
- maskpartialbits (xoff1, widthGlyphs, startmask);
-#endif
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
-#ifdef FASTCHARS
- FASTPUTBITS(0, xoff1, widthGlyphs, dst);
-#else
- *(dst) &= ~startmask;
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
-#ifdef FASTCHARS
- FASTPUTBITS(~0, xoff1, widthGlyphs, dst);
-#else
- *(dst) |= startmask;
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_INVERT:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
- /* XXX */
- while (hTmp--) {
- GetBits4
-#ifdef FASTCHARS
-# if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyphs;
-# endif
- FASTPUTBITS(~c, xoff1, widthGlyphs, dst);
-#else
- *(dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask);
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_COPY:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
-#ifdef FASTCHARS
-# if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyphs;
-#endif
- FASTPUTBITS(c, xoff1, widthGlyphs, dst);
-#else
- *(dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask);
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch (rrops[d]) */
- } /* for (d = ... ) */
-#ifndef FASTCHARS
- } else {
- maskPPWbits (xoff1, widthGlyphs, startmask, endmask);
- nfirst = PPW - xoff1;
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- dst[0] &= ~startmask;
- dst[1] &= ~endmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- dst[0] |= startmask;
- dst[1] |= endmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_INVERT:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
- dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask);
- dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask);
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_COPY:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
- dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask);
- dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask);
- afbScanlineInc(dst, widthDst);
- }
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ... ) */
- }
-#endif
- xpos += widthGlyphs;
- }
- }
-
- while(nglyph--) {
- xoff1 = xpos & PIM;
- schar1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- hTmp = h;
- saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH));
-
- if (xoff1 + widthGlyph <= PPW) {
- maskpartialbits (xoff1, widthGlyph, startmask);
-
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
- char1 = schar1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- (*dst) &= ~startmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- (*dst) |= startmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (hTmp--) {
-#ifdef FASTCHARS
-#ifdef USE_LEFTBITS
- FASTGETBITS (char1,0,widthGlyph,c);
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
- c = *char1++;
-#if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyph;
-#endif
-#endif
- FASTPUTBITS (~c,xoff1,widthGlyph,dst);
-#else
- GetBits1
- (*dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask);
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_COPY:
- while (hTmp--) {
-#ifdef FASTCHARS
-#ifdef USE_LEFTBITS
- FASTGETBITS (char1,0,widthGlyph,c);
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
- c = *char1++;
-#if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyph;
-#endif
-#endif
- FASTPUTBITS (c,xoff1,widthGlyph,dst);
-#else
- GetBits1
- (*dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask);
-#endif
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- } else {
- maskPPWbits (xoff1, widthGlyph, startmask, endmask);
- nfirst = PPW - xoff1;
-
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
- char1 = schar1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- dst[0] &= ~startmask;
- dst[1] &= ~endmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- dst[0] |= startmask;
- dst[1] |= endmask;
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_INVERT:
- while (hTmp--) {
- GetBits1
- dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask);
- dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask);
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_COPY:
- while (hTmp--) {
- GetBits1
- dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask);
- dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask);
- afbScanlineInc(dst, widthDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- }
-
- xpos += widthGlyph;
- }
-}
diff --git a/afb/afbtile.c b/afb/afbtile.c
deleted file mode 100644
index 3b861b822..000000000
--- a/afb/afbtile.c
+++ /dev/null
@@ -1,855 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbtile.c,v 3.4 2003/10/29 22:15:19 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: afbtile.c,v 5.8 94/04/17 20:28:36 dpw Exp $ */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "afb.h"
-
-#include "maskbits.h"
-
-#include "mergerop.h"
-/*
-
- the boxes are already translated.
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*
- tile area with a PPW bit wide pixmap
-*/
-void
-MROP_NAME(afbTileAreaPPW)(pDraw, nbox, pbox, alu, ptile, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- int sizeDst;
- int depthDst;
- register int d;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pSaveSrc;
- int saveH;
- int saveIY;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pbits);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = ptile->drawable.height;
- pSaveSrc = (PixelType *)(ptile->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
- saveIY = pbox->y1 % tileHeight;
- saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
- psrc = pSaveSrc;
-
- if (((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
-
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- *p = MROP_MASK(srcpix,*p,startmask);
- afbScanlineInc(p, nlwExtra);
- }
- }
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK (srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- afbScanlineInc(p, nlwExtra);
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK(srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
- afbScanlineInc(p, nlwExtra);
- }
- } else if (!startmask && endmask) {
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- afbScanlineInc(p, nlwExtra);
- }
- } else { /* no ragged bits at either end */
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID (srcpix,*p);
- p++;
- }
- afbScanlineInc(p, nlwExtra);
- }
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-MROP_NAME(afbTileArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- register PixelType tmpsrc;
-#if (MROP) != Mcopy
- register PixelType tmpdst;
-#endif
- int sizeDst;
- int depthDst;
- int sizeTile;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pBase);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind / sizeof (PixelType);
- sizeTile = tlwidth * tileHeight;
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
-
- for (d = 0; d < depthDst; d++, psrcT += sizeTile, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- while(width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
-
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
-
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- tmpsrc = *psrc;
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- tmpsrc = *psrc;
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), nstart, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- getbits (psrc, nstart, PPW, tmpsrc);
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++;*/
- psrc++;
- }
-
- if(endmask) {
- getbits (psrc, nstart, nend, tmpsrc);
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += nlwidth;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
-
-void
-MROP_NAME(afbOpaqueStippleAreaPPW)(pDraw, nbox, pbox, alu, ptile,
- rropsOS, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
- register unsigned char *rropsOS;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix = 0;
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- int sizeDst;
- int depthDst;
- register int d;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- int saveH;
- int saveIY;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pbits);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = ptile->drawable.height;
- psrc = (PixelType *)(ptile->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
- saveIY = pbox->y1 % tileHeight;
- saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
-
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- *p = MROP_MASK(srcpix,*p,startmask);
- afbScanlineInc(p, nlwExtra);
- }
- }
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK (srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- afbScanlineInc(p, nlwExtra);
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK(srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
- afbScanlineInc(p, nlwExtra);
- }
- } else if (!startmask && endmask) {
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- afbScanlineInc(p, nlwExtra);
- }
- } else { /* no ragged bits at either end */
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID (srcpix,*p);
- p++;
- }
- afbScanlineInc(p, nlwExtra);
- }
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-MROP_NAME(afbOpaqueStippleArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff,
- rropsOS, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- register unsigned char *rropsOS;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- register PixelType tmpsrc = 0;
-#if (MROP) != Mcopy
- register PixelType tmpdst;
-#endif
- int sizeDst;
- int depthDst;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- pBase);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind / sizeof (PixelType);
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
-
- for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- while(width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
-
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
-
- if((x & PIM) + w >= PPW)
- pdst++;
- } else if(((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), nstart, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- getbits (psrc, nstart, PPW, tmpsrc);
- break;
- case RROP_INVERT:
- getbits (psrc, nstart, PPW, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++; */
- psrc++;
- }
-
- if(endmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits (psrc, nstart, nend, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits (psrc, nstart, nend, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += nlwidth;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
diff --git a/afb/afbwindow.c b/afb/afbwindow.c
deleted file mode 100644
index 024fc04b6..000000000
--- a/afb/afbwindow.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbwindow.c,v 3.1 2003/09/13 21:33:04 dawes Exp $ */
-/* $XConsortium: afbwindow.c,v 5.14 94/04/17 20:28:36 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "afb.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-Bool
-afbCreateWindow(pWin)
- register WindowPtr pWin;
-{
- register afbPrivWin *pPrivWin;
-
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- pWin->pDrawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr;
-#endif
-
- return (TRUE);
-}
-
-/* This always returns true, because Xfree can't fail. It might be possible
- * on some devices for Destroy to fail */
-Bool
-afbDestroyWindow(pWin)
- WindowPtr pWin;
-{
- register afbPrivWin *pPrivWin;
-
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
-
- if (pPrivWin->pRotatedBorder)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
- if (pPrivWin->pRotatedBackground)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
-
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-afbMapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* (x, y) is the upper left corner of the window on the screen
- do we really need to pass this? (is it a;ready in pWin->absCorner?)
- we only do the rotation for pixmaps that are 32 bits wide (padded
-or otherwise.)
- afbChangeWindowAttributes() has already put a copy of the pixmap
-in pPrivWin->pRotated*
-*/
-
-/*ARGSUSED*/
-Bool
-afbPositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- register afbPrivWin *pPrivWin;
- int reset = 0;
-
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
- if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) {
- afbXRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- afbYRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
-
- if (!pWin->borderIsPixel && pPrivWin->fastBorder) {
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
- afbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- afbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
- if (reset) {
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
-
- /* This is the "wrong" fix to the right problem, but it doesn't really
- * cost very much. When the window is moved, we need to invalidate any
- * RotatedPixmap that exists in any GC currently validated against this
- * window.
- */
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-afbUnmapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* UNCLEAN!
- this code calls the bitblt helper code directly.
-
- afbCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-
-void
-afbCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- RegionPtr prgnDst;
- register BoxPtr pbox;
- register int dx, dy;
- register int i, nbox;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
- prgnSrc);
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
- if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- return;
- ppt = pptSrc;
-
- for (i=nbox; --i >= 0; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst,
- pptSrc, ~0);
- DEALLOCATE_LOCAL(pptSrc);
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
-}
-
-
-
-/* swap in correct PaintWindow* routine. If we can use a fast output
-routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
-of it in devPrivate.
-*/
-Bool
-afbChangeWindowAttributes(pWin, mask)
- register WindowPtr pWin;
- register unsigned long mask;
-{
- register unsigned long index;
- register afbPrivWin *pPrivWin;
- WindowPtr pBgWin;
-
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
- /*
- * When background state changes from ParentRelative and
- * we had previously rotated the fast border pixmap to match
- * the parent relative origin, rerotate to match window
- */
- if (mask & (CWBackPixmap | CWBackPixel) &&
- pWin->backgroundState != ParentRelative && pPrivWin->fastBorder &&
- (pPrivWin->oldRotate.x != pWin->drawable.x ||
- pPrivWin->oldRotate.y != pWin->drawable.y)) {
- afbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- afbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- while(mask) {
- index = lowbit (mask);
- mask &= ~index;
- switch(index) {
- case CWBackPixmap:
- if (pWin->backgroundState == None)
- pPrivWin->fastBackground = FALSE;
- else if (pWin->backgroundState == ParentRelative) {
- pPrivWin->fastBackground = FALSE;
- /* Rotate border to match parent origin */
- if (pPrivWin->pRotatedBorder) {
- for (pBgWin = pWin->parent;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- afbXRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.x - pPrivWin->oldRotate.x);
- afbYRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- } else if ((pWin->background.pixmap->drawable.width <= PPW) &&
- !(pWin->background.pixmap->drawable.width &
- (pWin->background.pixmap->drawable.width - 1))) {
- afbCopyRotatePixmap(pWin->background.pixmap,
- &pPrivWin->pRotatedBackground,
- pWin->drawable.x, pWin->drawable.y);
- if (pPrivWin->pRotatedBackground) {
- pPrivWin->fastBackground = TRUE;
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- } else
- pPrivWin->fastBackground = FALSE;
- } else
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBackPixel:
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBorderPixmap:
- if ((pWin->border.pixmap->drawable.width <= PPW) &&
- !(pWin->border.pixmap->drawable.width &
- (pWin->border.pixmap->drawable.width - 1))) {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- afbCopyRotatePixmap(pWin->border.pixmap,
- &pPrivWin->pRotatedBorder,
- pBgWin->drawable.x, pBgWin->drawable.y);
- if (pPrivWin->pRotatedBorder) {
- pPrivWin->fastBorder = TRUE;
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- } else
- pPrivWin->fastBorder = FALSE;
- } else
- pPrivWin->fastBorder = FALSE;
- break;
- case CWBorderPixel:
- pPrivWin->fastBorder = FALSE;
- break;
- }
- }
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
diff --git a/afb/afbzerarc.c b/afb/afbzerarc.c
deleted file mode 100644
index db1bd2bfd..000000000
--- a/afb/afbzerarc.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbzerarc.c,v 3.3 2003/07/16 01:38:36 dawes Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: afbzerarc.c,v 5.19 94/04/17 20:28:37 dpw Exp $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "afb.h"
-#include "maskbits.h"
-#include "mizerarc.h"
-#include "mi.h"
-
-/*
- * Note: LEFTMOST must be the bit leftmost in the actual screen
- * representation. This depends also on the IMAGE_BYTE_ORDER.
- * LONG2CHARS() takes care of the re-ordering as required. (DHD)
- */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define LEFTMOST ((PixelType) LONG2CHARS((1 << PLST)))
-#else
-#define LEFTMOST ((PixelType) LONG2CHARS(1))
-#endif
-
-#define Pixelate(base,yoff,xoff) \
-{ \
- paddr = afbScanlineOffset(base, (yoff) + ((xoff)>>PWSH)); \
- pmask = SCRRIGHT(LEFTMOST, (xoff) & PIM); \
- for (de = 0; de < depthDst; de++, paddr += sizeDst) /* @@@ NEXT PLANE @@@ */ \
- switch (rrops[de]) { \
- case RROP_BLACK: \
- *paddr &= ~pmask; \
- break; \
- case RROP_WHITE: \
- *paddr |= pmask; \
- break; \
- case RROP_INVERT: \
- *paddr ^= pmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
-}
-
-#define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff);
-
-static void
-afbZeroArcSS(pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
-{
- miZeroArcRec info;
- Bool do360;
- register int de;
- register int x, y, a, b, d, mask;
- register int k1, k3, dx, dy;
- PixelType *addrl;
- PixelType *yorgl, *yorgol;
- int nlwidth, yoffset, dyoffset;
- int sizeDst, depthDst;
- PixelType pmask;
- register PixelType *paddr;
- register unsigned char *rrops;
-
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
- afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
- addrl);
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
- yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
- info.xorg += pDraw->x;
- info.xorgo += pDraw->x;
- MIARCSETUP();
- yoffset = y ? nlwidth : 0;
- dyoffset = 0;
- mask = info.initialMask;
- if (!(arc->width & 1)) {
- DoPix(2, yorgl, 0, info.xorgo);
- DoPix(8, yorgol, 0, info.xorgo);
- }
- if (!info.end.x || !info.end.y) {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1)) {
- int xoffset = nlwidth;
- PixelType *yorghl = afbScanlineDeltaNoBankSwitch(yorgl, info.h, nlwidth);
- int xorghp = info.xorg + info.h;
- int xorghn = info.xorg - info.h;
-
- while (1) {
- Pixelate(yorgl, yoffset, info.xorg + x);
- Pixelate(yorgl, yoffset, info.xorg - x);
- Pixelate(yorgol, -yoffset, info.xorg - x);
- Pixelate(yorgol, -yoffset, info.xorg + x);
- if (a < 0)
- break;
- Pixelate(yorghl, -xoffset, xorghp - y);
- Pixelate(yorghl, -xoffset, xorghn + y);
- Pixelate(yorghl, xoffset, xorghn + y);
- Pixelate(yorghl, xoffset, xorghp - y);
- xoffset += nlwidth;
- MIARCCIRCLESTEP(yoffset += nlwidth;);
- }
- x = info.w;
- yoffset = info.h * nlwidth;
- } else if (do360) {
- while (y < info.h || x < info.w) {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- Pixelate(yorgl, yoffset, info.xorg + x);
- Pixelate(yorgl, yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorg + x);
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- } else {
- while (y < info.h || x < info.w) {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- if ((x == info.start.x) || (y == info.start.y)) {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- if ((x == info.end.x) || (y == info.end.y)) {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- if (arc->height & 1) {
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- }
-}
-
-void
-afbZeroPolyArcSS(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- RegionPtr cclip;
-
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++) {
- if (miCanZeroArc(arc)) {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- box.x2 = box.x1 + (int)arc->width + 1;
- box.y2 = box.y1 + (int)arc->height + 1;
- if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
- afbZeroArcSS(pDraw, pGC, arc);
- else
- miZeroPolyArc(pDraw, pGC, 1, arc);
- } else
- miPolyArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/cfb/cfb.h b/cfb/cfb.h
deleted file mode 100644
index b7d027905..000000000
--- a/cfb/cfb.h
+++ /dev/null
@@ -1,1327 +0,0 @@
-/* $Xorg: cfb.h,v 1.3 2000/08/17 19:48:12 cpqbld Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.30 2003/07/19 13:22:27 tsi Exp $ */
-
-#if !defined(__CFB_H__) || defined(CFB_PROTOTYPES_ONLY)
-
-#include "X.h"
-#include "globals.h"
-#include "pixmap.h"
-#include "region.h"
-#include "gc.h"
-#include "colormap.h"
-#include "miscstruct.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "mfb.h"
-#undef PixelType
-
-#include "cfbmap.h"
-
-#ifndef CfbBits
-#define CfbBits CARD32
-#endif
-
-#ifndef CFB_PROTOTYPES_ONLY
-#define __CFB_H__
-/*
- private filed of pixmap
- pixmap.devPrivate = (unsigned int *)pointer_to_bits
- pixmap.devKind = width_of_pixmap_in_bytes
-*/
-
-extern int cfbGCPrivateIndex;
-extern int cfbWindowPrivateIndex;
-
-/* private field of GC */
-typedef struct {
- unsigned char rop; /* special case rop values */
- /* next two values unused in cfb, included for compatibility with mfb */
- unsigned char ropOpStip; /* rop for opaque stipple */
- /* this value is ropFillArea in mfb, usurped for cfb */
- unsigned char oneRect; /* drawable has one clip rect */
- CfbBits xor, and; /* reduced rop values */
- } cfbPrivGC;
-
-typedef cfbPrivGC *cfbPrivGCPtr;
-
-#define cfbGetGCPrivate(pGC) ((cfbPrivGCPtr)\
- (pGC)->devPrivates[cfbGCPrivateIndex].ptr)
-
-#define cfbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
-
-/* way to carry RROP info around */
-typedef struct {
- unsigned char rop;
- CfbBits xor, and;
-} cfbRRopRec, *cfbRRopPtr;
-
-/* private field of window */
-typedef struct {
- unsigned char fastBorder; /* non-zero if border is 32 bits wide */
- unsigned char fastBackground;
- unsigned short unused; /* pad for alignment with Sun compiler */
- DDXPointRec oldRotate;
- PixmapPtr pRotatedBackground;
- PixmapPtr pRotatedBorder;
- } cfbPrivWin;
-
-#define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\
- (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr)
-
-
-/* cfb8bit.c */
-
-extern int cfbSetStipple(
- int /*alu*/,
- CfbBits /*fg*/,
- CfbBits /*planemask*/
-);
-
-extern int cfbSetOpaqueStipple(
- int /*alu*/,
- CfbBits /*fg*/,
- CfbBits /*bg*/,
- CfbBits /*planemask*/
-);
-
-extern int cfbComputeClipMasks32(
- BoxPtr /*pBox*/,
- int /*numRects*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- CARD32 * /*clips*/
-);
-#endif /* !CFB_PROTOTYPES_ONLY */
-/* cfb8cppl.c */
-
-extern void cfbCopyImagePlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern void cfbCopyPlane8to1(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-
-extern void cfbCopyPlane16to1(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-
-extern void cfbCopyPlane24to1(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-
-extern void cfbCopyPlane32to1(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-#endif
-
-/* cfb8lineCO.c */
-
-extern int cfb8LineSS1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void cfb8LineSS1Rect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void cfb8ClippedLineCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* cfb8lineCP.c */
-
-extern int cfb8LineSS1RectPreviousCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-/* cfb8lineG.c */
-
-extern int cfb8LineSS1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void cfb8ClippedLineGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* cfb8lineX.c */
-
-extern int cfb8LineSS1RectXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void cfb8ClippedLineXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* cfb8segC.c */
-
-extern int cfb8SegmentSS1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* cfb8segCS.c */
-
-extern int cfb8SegmentSS1RectShiftCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-
-extern void cfb8SegmentSS1Rect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* cfb8segG.c */
-
-extern int cfb8SegmentSS1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* cfbsegX.c */
-
-extern int cfb8SegmentSS1RectXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* cfballpriv.c */
-
-extern Bool cfbAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*window_index*/,
- int * /*gc_index*/
-);
-/* cfbbitblt.c */
-
-extern RegionPtr cfbBitBlt(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (* /*doBitBlt*/)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
- ),
- unsigned long /*bitPlane*/
-);
-
-#define cfbCopyPlaneExpand cfbBitBlt
-
-extern RegionPtr cfbCopyPlaneReduce(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (* /*doCopyPlane*/)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/ /* We must know which plane to reduce! */
- ),
- unsigned long /*bitPlane*/
-);
-
-extern void cfbDoBitblt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-extern RegionPtr cfbCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern void cfbCopyPlane1to8(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-#endif
-
-extern RegionPtr cfbCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*bitPlane*/
-);
-/* cfbbltC.c */
-
-extern void cfbDoBitbltCopy(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* cfbbltG.c */
-
-extern void cfbDoBitbltGeneral(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* cfbbltO.c */
-
-extern void cfbDoBitbltOr(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* cfbbltX.c */
-
-extern void cfbDoBitbltXor(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* cfbbres.c */
-
-extern void cfbBresS(
- int /*rop*/,
- CfbBits /*and*/,
- CfbBits /*xor*/,
- CfbBits * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* cfbbresd.c */
-
-extern void cfbBresD(
- cfbRRopPtr /*rrops*/,
- int * /*pdashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pdashOffset*/,
- int /*isDoubleDash*/,
- CfbBits * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* cfbbstore.c */
-
-extern void cfbSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void cfbRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-/* cfbcmap.c */
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern int cfbListInstalledColormaps(
- ScreenPtr /*pScreen*/,
- Colormap * /*pmaps*/
-);
-
-extern void cfbInstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void cfbUninstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void cfbResolveColor(
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/,
- VisualPtr /*pVisual*/
-);
-
-extern Bool cfbInitializeColormap(
- ColormapPtr /*pmap*/
-);
-
-extern int cfbExpandDirectColors(
- ColormapPtr /*pmap*/,
- int /*ndef*/,
- xColorItem * /*indefs*/,
- xColorItem * /*outdefs*/
-);
-
-extern Bool cfbCreateDefColormap(
- ScreenPtr /*pScreen*/
-);
-
-extern Bool cfbSetVisualTypes(
- int /*depth*/,
- int /*visuals*/,
- int /*bitsPerRGB*/
-);
-
-extern void cfbClearVisualTypes(void);
-
-extern Bool cfbInitVisuals(
- VisualPtr * /*visualp*/,
- DepthPtr * /*depthp*/,
- int * /*nvisualp*/,
- int * /*ndepthp*/,
- int * /*rootDepthp*/,
- VisualID * /*defaultVisp*/,
- unsigned long /*sizes*/,
- int /*bitsPerRGB*/
-);
-#endif
-/* cfbfillarcC.c */
-
-extern void cfbPolyFillArcSolidCopy(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* cfbfillarcG.c */
-
-extern void cfbPolyFillArcSolidGeneral(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* cfbfillrct.c */
-
-extern void cfbFillBoxTileOdd(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- BoxPtr /*rects*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/
-);
-
-extern void cfbFillRectTileOdd(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-/* cfbfillsp.c */
-
-extern void cfbUnnaturalTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void cfbUnnaturalStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern void cfb8Stipple32FS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void cfb8OpaqueStipple32FS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-#endif
-/* cfbgc.c */
-
-extern GCOpsPtr cfbMatchCommon(
- GCPtr /*pGC*/,
- cfbPrivGCPtr /*devPriv*/
-);
-
-extern Bool cfbCreateGC(
- GCPtr /*pGC*/
-);
-
-extern void cfbValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-/* cfbgetsp.c */
-
-extern void cfbGetSpans(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/
-);
-/* cfbglblt8.c */
-
-extern void cfbPolyGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* cfbglrop8.c */
-
-extern void cfbPolyGlyphRop8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* cfbhrzvert.c */
-
-extern void cfbHorzS(
- int /*rop*/,
- CfbBits /*and*/,
- CfbBits /*xor*/,
- CfbBits * /*addrl*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-
-extern void cfbVertS(
- int /*rop*/,
- CfbBits /*and*/,
- CfbBits /*xor*/,
- CfbBits * /*addrl*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-/* cfbigblt8.c */
-
-extern void cfbImageGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* cfbimage.c */
-
-extern void cfbPutImage(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-extern void cfbGetImage(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-/* cfbline.c */
-
-extern void cfbLineSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void cfbLineSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-/* cfbmskbits.c */
-/* cfbpixmap.c */
-
-extern PixmapPtr cfbCreatePixmap(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/
-);
-
-extern Bool cfbDestroyPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern PixmapPtr cfbCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void cfbPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern void cfbXRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rw*/
-);
-
-extern void cfbYRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rh*/
-);
-
-extern void cfbCopyRotatePixmap(
- PixmapPtr /*psrcPix*/,
- PixmapPtr * /*ppdstPix*/,
- int /*xrot*/,
- int /*yrot*/
-);
-/* cfbply1rctC.c */
-
-extern void cfbFillPoly1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* cfbply1rctG.c */
-
-extern void cfbFillPoly1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* cfbpntwin.c */
-
-extern void cfbPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*pRegion*/,
- int /*what*/
-);
-
-extern void cfbFillBoxSolid(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- unsigned long /*pixel*/
-);
-
-extern void cfbFillBoxTile32(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/
-);
-/* cfbpolypnt.c */
-
-extern void cfbPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-/* cfbpush8.c */
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern void cfbPushPixels8(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitmap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-/* cfbrctstp8.c */
-
-extern void cfb8FillRectOpaqueStippled32(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfb8FillRectTransparentStippled32(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfb8FillRectStippledUnnatural(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-#endif
-/* cfbrrop.c */
-
-extern int cfbReduceRasterOp(
- int /*rop*/,
- CfbBits /*fg*/,
- CfbBits /*pm*/,
- CfbBits * /*andp*/,
- CfbBits * /*xorp*/
-);
-/* cfbscrinit.c */
-
-extern Bool cfbCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-
-extern Bool cfbSetupScreen(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern Bool cfbFinishScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern Bool cfbScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern PixmapPtr cfbGetScreenPixmap(
- ScreenPtr /*pScreen*/
-);
-
-extern void cfbSetScreenPixmap(
- PixmapPtr /*pPix*/
-);
-
-/* cfbseg.c */
-
-extern void cfbSegmentSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-
-extern void cfbSegmentSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-/* cfbsetsp.c */
-
-extern void cfbSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- unsigned int * /*psrc*/,
- int /*alu*/,
- int * /*pdstBase*/,
- int /*widthDst*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbSetSpans(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/
-);
-/* cfbsolidC.c */
-
-extern void cfbFillRectSolidCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbSolidSpansCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* cfbsolidG.c */
-
-extern void cfbFillRectSolidGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbSolidSpansGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* cfbsolidX.c */
-
-extern void cfbFillRectSolidXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbSolidSpansXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* cfbteblt8.c */
-
-#ifndef CFB_PROTOTYPES_ONLY
-extern void cfbTEGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*xInit*/,
- int /*yInit*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-#endif
-/* cfbtegblt.c */
-
-extern void cfbTEGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* cfbtile32C.c */
-
-extern void cfbFillRectTile32Copy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbTile32FSCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* cfbtile32G.c */
-
-extern void cfbFillRectTile32General(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void cfbTile32FSGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* cfbtileoddC.c */
-
-extern void cfbFillBoxTileOddCopy(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillSpanTileOddCopy(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillBoxTile32sCopy(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillSpanTile32sCopy(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-/* cfbtileoddG.c */
-
-extern void cfbFillBoxTileOddGeneral(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillSpanTileOddGeneral(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillBoxTile32sGeneral(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void cfbFillSpanTile32sGeneral(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-/* cfbwindow.c */
-
-extern Bool cfbCreateWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool cfbDestroyWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool cfbMapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern Bool cfbPositionWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/
-);
-
-extern Bool cfbUnmapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern void cfbCopyWindow(
- WindowPtr /*pWin*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/
-);
-
-extern Bool cfbChangeWindowAttributes(
- WindowPtr /*pWin*/,
- unsigned long /*mask*/
-);
-/* cfbzerarcC.c */
-
-extern void cfbZeroPolyArcSS8Copy(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* cfbzerarcG.c */
-
-extern void cfbZeroPolyArcSS8General(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* cfbzerarcX.c */
-
-extern void cfbZeroPolyArcSS8Xor(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-#if (!defined(SINGLEDEPTH) && PSZ != 8) || defined(FORCE_SEPARATE_PRIVATE)
-
-#define CFB_NEED_SCREEN_PRIVATE
-
-extern int cfbScreenPrivateIndex;
-#endif
-
-#ifndef CFB_PROTOTYPES_ONLY
-
-/* Common macros for extracting drawing information */
-
-#define cfbGetWindowPixmap(d) \
- ((* ((DrawablePtr)(d))->pScreen->GetWindowPixmap)((WindowPtr)(d)))
-
-#define cfbGetTypedWidth(pDrawable,wtype) (\
- (((pDrawable)->type != DRAWABLE_PIXMAP) ? \
- (int) (cfbGetWindowPixmap(pDrawable)->devKind) : \
- (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
-
-#define cfbGetByteWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned char)
-
-#define cfbGetPixelWidth(pDrawable) cfbGetTypedWidth(pDrawable, PixelType)
-
-#define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, CfbBits)
-
-#define cfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) \
- _pPix = cfbGetWindowPixmap(pDrawable); \
- else \
- _pPix = (PixmapPtr) (pDrawable); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define cfbGetByteWidthAndPointer(pDrawable, width, pointer) \
- cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
-
-#define cfbGetLongWidthAndPointer(pDrawable, width, pointer) \
- cfbGetTypedWidthAndPointer(pDrawable, width, pointer, CfbBits, CfbBits)
-
-#define cfbGetPixelWidthAndPointer(pDrawable, width, pointer) \
- cfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-#define cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = cfbGetWindowPixmap((DrawablePtr) (pWin)); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define cfbGetWindowLongWidthAndPointer(pWin, width, pointer) \
- cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, CfbBits, CfbBits)
-
-#define cfbGetWindowByteWidthAndPointer(pWin, width, pointer) \
- cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char)
-
-#define cfbGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \
- cfbGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-/*
- * XFree86 empties the root BorderClip when the VT is inactive,
- * here's a macro which uses that to disable GetImage and GetSpans
- */
-#define cfbWindowEnabled(pWin) \
- REGION_NOTEMPTY((pWin)->drawable.pScreen, \
- &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
-
-#define cfbDrawableEnabled(pDrawable) \
- ((pDrawable)->type == DRAWABLE_PIXMAP ? \
- TRUE : cfbWindowEnabled((WindowPtr) pDrawable))
-
-#include "micoord.h"
-
-/*
- * if CFB is built as a module, it shouldn't call libc functions.
- */
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
-#endif /* !CFB_PROTOTYPES_ONLY */
-
-#endif
diff --git a/cfb/cfb16.h b/cfb/cfb16.h
deleted file mode 100644
index 3d51cd142..000000000
--- a/cfb/cfb16.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfb16.h,v 1.4 1998/11/28 10:42:50 dawes Exp $ */
-/*
- * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef _CFB16_H_
-#define _CFB16_H_
-
-/*
- * C's preprocessing language substitutes >text<, not values...
- */
-
-#ifdef OLDPSZ
-# undef OLDPSZ
-#endif
-
-#ifdef PSZ
-
-# if (PSZ == 8)
-# define OLDPSZ 8
-# endif
-
-# if (PSZ == 16)
-# define OLDPSZ 16
-# endif
-
-# if (PSZ == 24)
-# define OLDPSZ 24
-# endif
-
-# if (PSZ == 32)
-# define OLDPSZ 32
-# endif
-
-# ifndef OLDPSZ
- /* Maybe an #error here ? */
-# endif
-
-# undef PSZ
-
-#endif
-
-#define PSZ 16
-#define CFB_PROTOTYPES_ONLY
-#include "cfb.h"
-#undef CFB_PROTOTYPES_ONLY
-#include "cfbunmap.h"
-
-#undef PSZ
-#ifdef OLDPSZ
-
-# if (OLDPSZ == 8)
-# define PSZ 8
-# endif
-
-# if (OLDPSZ == 16)
-# define PSZ 16
-# endif
-
-# if (OLDPSZ == 24)
-# define PSZ 24
-# endif
-
-# if (OLDPSZ == 32)
-# define PSZ 32
-# endif
-
-# undef OLDPSZ
-
-#endif
-
-#endif /* _CFB16_H_ */
diff --git a/cfb/cfb24.h b/cfb/cfb24.h
deleted file mode 100644
index f1876f74d..000000000
--- a/cfb/cfb24.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfb24.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */
-/*
- * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef _CFB24_H_
-#define _CFB24_H_
-
-/*
- * C's preprocessing language substitutes >text<, not values...
- */
-
-#ifdef OLDPSZ
-# undef OLDPSZ
-#endif
-
-#ifdef PSZ
-
-# if (PSZ == 8)
-# define OLDPSZ 8
-# endif
-
-# if (PSZ == 16)
-# define OLDPSZ 16
-# endif
-
-# if (PSZ == 24)
-# define OLDPSZ 24
-# endif
-
-# if (PSZ == 32)
-# define OLDPSZ 32
-# endif
-
-# ifndef OLDPSZ
- /* Maybe an #error here ? */
-# endif
-
-# undef PSZ
-
-#endif
-
-#define PSZ 24
-#define CFB_PROTOTYPES_ONLY
-#include "cfb.h"
-#undef CFB_PROTOTYPES_ONLY
-#include "cfbunmap.h"
-
-#undef PSZ
-#ifdef OLDPSZ
-
-# if (OLDPSZ == 8)
-# define PSZ 8
-# endif
-
-# if (OLDPSZ == 16)
-# define PSZ 16
-# endif
-
-# if (OLDPSZ == 24)
-# define PSZ 24
-# endif
-
-# if (OLDPSZ == 32)
-# define PSZ 32
-# endif
-
-# undef OLDPSZ
-
-#endif
-
-#endif /* _CFB24_H_ */
diff --git a/cfb/cfb32.h b/cfb/cfb32.h
deleted file mode 100644
index 5ea4c13c8..000000000
--- a/cfb/cfb32.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfb32.h,v 1.4 1998/11/28 10:42:51 dawes Exp $ */
-/*
- * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef _CFB32_H_
-#define _CFB32_H_
-
-/*
- * C's preprocessing language substitutes >text<, not values...
- */
-
-#ifdef OLDPSZ
-# undef OLDPSZ
-#endif
-
-#ifdef PSZ
-
-# if (PSZ == 8)
-# define OLDPSZ 8
-# endif
-
-# if (PSZ == 16)
-# define OLDPSZ 16
-# endif
-
-# if (PSZ == 24)
-# define OLDPSZ 24
-# endif
-
-# if (PSZ == 32)
-# define OLDPSZ 32
-# endif
-
-# ifndef OLDPSZ
- /* Maybe an #error here ? */
-# endif
-
-# undef PSZ
-
-#endif
-
-#define PSZ 32
-#define CFB_PROTOTYPES_ONLY
-#include "cfb.h"
-#undef CFB_PROTOTYPES_ONLY
-#include "cfbunmap.h"
-
-#undef PSZ
-#ifdef OLDPSZ
-
-# if (OLDPSZ == 8)
-# define PSZ 8
-# endif
-
-# if (OLDPSZ == 16)
-# define PSZ 16
-# endif
-
-# if (OLDPSZ == 24)
-# define PSZ 24
-# endif
-
-# if (OLDPSZ == 32)
-# define PSZ 32
-# endif
-
-# undef OLDPSZ
-
-#endif
-
-#endif /* _CFB32_H_ */
diff --git a/cfb/cfb8bit.c b/cfb/cfb8bit.c
deleted file mode 100644
index 1dd742c60..000000000
--- a/cfb/cfb8bit.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/* $Xorg: cfb8bit.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-/*
-
-Copyright 1989, 1994, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.c,v 1.5 2001/12/14 19:59:20 dawes Exp $ */
-
-/*
- * cfb8bit.c
- *
- * 8 bit color frame buffer utility routines
- */
-
-
-#if PSZ == 8
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-PixelGroup cfb8StippleMasks[NUM_MASKS] = {
-#if NUM_MASKS == 16
- 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
- 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
- 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
- 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
-#else /* NUM_MASKS == 256 */
- 0x0000000000000000, 0x00000000000000ff,
- 0x000000000000ff00, 0x000000000000ffff,
- 0x0000000000ff0000, 0x0000000000ff00ff,
- 0x0000000000ffff00, 0x0000000000ffffff,
- 0x00000000ff000000, 0x00000000ff0000ff,
- 0x00000000ff00ff00, 0x00000000ff00ffff,
- 0x00000000ffff0000, 0x00000000ffff00ff,
- 0x00000000ffffff00, 0x00000000ffffffff,
- 0x000000ff00000000, 0x000000ff000000ff,
- 0x000000ff0000ff00, 0x000000ff0000ffff,
- 0x000000ff00ff0000, 0x000000ff00ff00ff,
- 0x000000ff00ffff00, 0x000000ff00ffffff,
- 0x000000ffff000000, 0x000000ffff0000ff,
- 0x000000ffff00ff00, 0x000000ffff00ffff,
- 0x000000ffffff0000, 0x000000ffffff00ff,
- 0x000000ffffffff00, 0x000000ffffffffff,
- 0x0000ff0000000000, 0x0000ff00000000ff,
- 0x0000ff000000ff00, 0x0000ff000000ffff,
- 0x0000ff0000ff0000, 0x0000ff0000ff00ff,
- 0x0000ff0000ffff00, 0x0000ff0000ffffff,
- 0x0000ff00ff000000, 0x0000ff00ff0000ff,
- 0x0000ff00ff00ff00, 0x0000ff00ff00ffff,
- 0x0000ff00ffff0000, 0x0000ff00ffff00ff,
- 0x0000ff00ffffff00, 0x0000ff00ffffffff,
- 0x0000ffff00000000, 0x0000ffff000000ff,
- 0x0000ffff0000ff00, 0x0000ffff0000ffff,
- 0x0000ffff00ff0000, 0x0000ffff00ff00ff,
- 0x0000ffff00ffff00, 0x0000ffff00ffffff,
- 0x0000ffffff000000, 0x0000ffffff0000ff,
- 0x0000ffffff00ff00, 0x0000ffffff00ffff,
- 0x0000ffffffff0000, 0x0000ffffffff00ff,
- 0x0000ffffffffff00, 0x0000ffffffffffff,
- 0x00ff000000000000, 0x00ff0000000000ff,
- 0x00ff00000000ff00, 0x00ff00000000ffff,
- 0x00ff000000ff0000, 0x00ff000000ff00ff,
- 0x00ff000000ffff00, 0x00ff000000ffffff,
- 0x00ff0000ff000000, 0x00ff0000ff0000ff,
- 0x00ff0000ff00ff00, 0x00ff0000ff00ffff,
- 0x00ff0000ffff0000, 0x00ff0000ffff00ff,
- 0x00ff0000ffffff00, 0x00ff0000ffffffff,
- 0x00ff00ff00000000, 0x00ff00ff000000ff,
- 0x00ff00ff0000ff00, 0x00ff00ff0000ffff,
- 0x00ff00ff00ff0000, 0x00ff00ff00ff00ff,
- 0x00ff00ff00ffff00, 0x00ff00ff00ffffff,
- 0x00ff00ffff000000, 0x00ff00ffff0000ff,
- 0x00ff00ffff00ff00, 0x00ff00ffff00ffff,
- 0x00ff00ffffff0000, 0x00ff00ffffff00ff,
- 0x00ff00ffffffff00, 0x00ff00ffffffffff,
- 0x00ffff0000000000, 0x00ffff00000000ff,
- 0x00ffff000000ff00, 0x00ffff000000ffff,
- 0x00ffff0000ff0000, 0x00ffff0000ff00ff,
- 0x00ffff0000ffff00, 0x00ffff0000ffffff,
- 0x00ffff00ff000000, 0x00ffff00ff0000ff,
- 0x00ffff00ff00ff00, 0x00ffff00ff00ffff,
- 0x00ffff00ffff0000, 0x00ffff00ffff00ff,
- 0x00ffff00ffffff00, 0x00ffff00ffffffff,
- 0x00ffffff00000000, 0x00ffffff000000ff,
- 0x00ffffff0000ff00, 0x00ffffff0000ffff,
- 0x00ffffff00ff0000, 0x00ffffff00ff00ff,
- 0x00ffffff00ffff00, 0x00ffffff00ffffff,
- 0x00ffffffff000000, 0x00ffffffff0000ff,
- 0x00ffffffff00ff00, 0x00ffffffff00ffff,
- 0x00ffffffffff0000, 0x00ffffffffff00ff,
- 0x00ffffffffffff00, 0x00ffffffffffffff,
- 0xff00000000000000, 0xff000000000000ff,
- 0xff0000000000ff00, 0xff0000000000ffff,
- 0xff00000000ff0000, 0xff00000000ff00ff,
- 0xff00000000ffff00, 0xff00000000ffffff,
- 0xff000000ff000000, 0xff000000ff0000ff,
- 0xff000000ff00ff00, 0xff000000ff00ffff,
- 0xff000000ffff0000, 0xff000000ffff00ff,
- 0xff000000ffffff00, 0xff000000ffffffff,
- 0xff0000ff00000000, 0xff0000ff000000ff,
- 0xff0000ff0000ff00, 0xff0000ff0000ffff,
- 0xff0000ff00ff0000, 0xff0000ff00ff00ff,
- 0xff0000ff00ffff00, 0xff0000ff00ffffff,
- 0xff0000ffff000000, 0xff0000ffff0000ff,
- 0xff0000ffff00ff00, 0xff0000ffff00ffff,
- 0xff0000ffffff0000, 0xff0000ffffff00ff,
- 0xff0000ffffffff00, 0xff0000ffffffffff,
- 0xff00ff0000000000, 0xff00ff00000000ff,
- 0xff00ff000000ff00, 0xff00ff000000ffff,
- 0xff00ff0000ff0000, 0xff00ff0000ff00ff,
- 0xff00ff0000ffff00, 0xff00ff0000ffffff,
- 0xff00ff00ff000000, 0xff00ff00ff0000ff,
- 0xff00ff00ff00ff00, 0xff00ff00ff00ffff,
- 0xff00ff00ffff0000, 0xff00ff00ffff00ff,
- 0xff00ff00ffffff00, 0xff00ff00ffffffff,
- 0xff00ffff00000000, 0xff00ffff000000ff,
- 0xff00ffff0000ff00, 0xff00ffff0000ffff,
- 0xff00ffff00ff0000, 0xff00ffff00ff00ff,
- 0xff00ffff00ffff00, 0xff00ffff00ffffff,
- 0xff00ffffff000000, 0xff00ffffff0000ff,
- 0xff00ffffff00ff00, 0xff00ffffff00ffff,
- 0xff00ffffffff0000, 0xff00ffffffff00ff,
- 0xff00ffffffffff00, 0xff00ffffffffffff,
- 0xffff000000000000, 0xffff0000000000ff,
- 0xffff00000000ff00, 0xffff00000000ffff,
- 0xffff000000ff0000, 0xffff000000ff00ff,
- 0xffff000000ffff00, 0xffff000000ffffff,
- 0xffff0000ff000000, 0xffff0000ff0000ff,
- 0xffff0000ff00ff00, 0xffff0000ff00ffff,
- 0xffff0000ffff0000, 0xffff0000ffff00ff,
- 0xffff0000ffffff00, 0xffff0000ffffffff,
- 0xffff00ff00000000, 0xffff00ff000000ff,
- 0xffff00ff0000ff00, 0xffff00ff0000ffff,
- 0xffff00ff00ff0000, 0xffff00ff00ff00ff,
- 0xffff00ff00ffff00, 0xffff00ff00ffffff,
- 0xffff00ffff000000, 0xffff00ffff0000ff,
- 0xffff00ffff00ff00, 0xffff00ffff00ffff,
- 0xffff00ffffff0000, 0xffff00ffffff00ff,
- 0xffff00ffffffff00, 0xffff00ffffffffff,
- 0xffffff0000000000, 0xffffff00000000ff,
- 0xffffff000000ff00, 0xffffff000000ffff,
- 0xffffff0000ff0000, 0xffffff0000ff00ff,
- 0xffffff0000ffff00, 0xffffff0000ffffff,
- 0xffffff00ff000000, 0xffffff00ff0000ff,
- 0xffffff00ff00ff00, 0xffffff00ff00ffff,
- 0xffffff00ffff0000, 0xffffff00ffff00ff,
- 0xffffff00ffffff00, 0xffffff00ffffffff,
- 0xffffffff00000000, 0xffffffff000000ff,
- 0xffffffff0000ff00, 0xffffffff0000ffff,
- 0xffffffff00ff0000, 0xffffffff00ff00ff,
- 0xffffffff00ffff00, 0xffffffff00ffffff,
- 0xffffffffff000000, 0xffffffffff0000ff,
- 0xffffffffff00ff00, 0xffffffffff00ffff,
- 0xffffffffffff0000, 0xffffffffffff00ff,
- 0xffffffffffffff00, 0xffffffffffffffff
-#endif
-};
-
-int cfb8StippleMode, cfb8StippleAlu, cfb8StippleRRop;
-PixelGroup cfb8StippleFg, cfb8StippleBg, cfb8StipplePm;
-PixelGroup cfb8StippleAnd[NUM_MASKS], cfb8StippleXor[NUM_MASKS];
-
-int
-cfb8SetStipple (alu, fg, planemask)
-int alu;
-CfbBits fg, planemask;
-{
- CfbBits and, xor, rrop;
- int s;
- CfbBits c;
-
- cfb8StippleMode = FillStippled;
- cfb8StippleAlu = alu;
- cfb8StippleFg = fg & PMSK;
- cfb8StipplePm = planemask & PMSK;
- rrop = cfbReduceRasterOp (alu, fg, planemask, &and, &xor);
- cfb8StippleRRop = rrop;
- /*
- * create the appropriate pixel-fill bits for current
- * foreground
- */
- for (s = 0; s < NUM_MASKS; s++)
- {
- c = cfb8StippleMasks[s];
- cfb8StippleAnd[s] = and | ~c;
- cfb8StippleXor[s] = xor & c;
- }
- return TRUE;
-}
-
-
-int
-cfb8SetOpaqueStipple (alu, fg, bg, planemask)
-int alu;
-CfbBits fg, bg, planemask;
-{
- CfbBits andfg, xorfg, andbg, xorbg, rropfg, rropbg;
- int s;
- CfbBits c;
-
- cfb8StippleMode = FillOpaqueStippled;
- cfb8StippleAlu = alu;
- cfb8StippleFg = fg & PMSK;
- cfb8StippleBg = bg & PMSK;
- cfb8StipplePm = planemask & PMSK;
- rropfg = cfbReduceRasterOp (alu, cfb8StippleFg, cfb8StipplePm, &andfg, &xorfg);
- rropbg = cfbReduceRasterOp (alu, cfb8StippleBg, cfb8StipplePm, &andbg, &xorbg);
- if (rropfg == rropbg)
- cfb8StippleRRop = rropfg;
- else
- cfb8StippleRRop = GXset;
- /*
- * create the appropriate pixel-fill bits for current
- * foreground
- */
- for (s = 0; s < NUM_MASKS; s++)
- {
- c = cfb8StippleMasks[s];
- cfb8StippleAnd[s] = (andfg | ~c) & (andbg | c);
- cfb8StippleXor[s] = (xorfg & c) | (xorbg & ~c);
- }
- return TRUE;
-}
-
-/*
- * a grungy little routine. This computes clip masks
- * for partial character blts. Returns rgnOUT if the
- * entire character is clipped; returns rgnIN if the entire
- * character is unclipped; returns rgnPART if a portion of
- * the character is visible. Computes clip masks for each
- * longword of the character -- and those with the
- * contents of the glyph to compute the visible bits.
- */
-
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
-PixelGroup cfb8BitLenMasks[PGSZ] = {
- 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff,
- 0x0fffffff, 0x07ffffff, 0x03ffffff, 0x01ffffff,
- 0x00ffffff, 0x007fffff, 0x003fffff, 0x001fffff,
- 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff,
- 0x0000ffff, 0x00007fff, 0x00003fff, 0x00001fff,
- 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff,
- 0x000000ff, 0x0000007f, 0x0000003f, 0x0000001f,
- 0x0000000f, 0x00000007, 0x00000003, 0x00000001,
-};
-#else
-PixelGroup cfb8BitLenMasks[PGSZ] = {
- 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8,
- 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80,
- 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800,
- 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000,
- 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000,
- 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000,
- 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000,
- 0xf0000000, 0xe0000000, 0xc0000000, 0x80000000,
-};
-#endif /* BITMAP_BIT_ORDER */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-PixelGroup cfb8BitLenMasks[PGSZ] = {
- 0xffffffffffffffff, 0x7fffffffffffffff,
- 0x3fffffffffffffff, 0x1fffffffffffffff,
- 0x0fffffffffffffff, 0x07ffffffffffffff,
- 0x03ffffffffffffff, 0x01ffffffffffffff,
- 0x00ffffffffffffff, 0x007fffffffffffff,
- 0x003fffffffffffff, 0x001fffffffffffff,
- 0x000fffffffffffff, 0x0007ffffffffffff,
- 0x0003ffffffffffff, 0x0001ffffffffffff,
- 0x0000ffffffffffff, 0x00007fffffffffff,
- 0x00003fffffffffff, 0x00001fffffffffff,
- 0x00000fffffffffff, 0x000007ffffffffff,
- 0x000003ffffffffff, 0x000001ffffffffff,
- 0x000000ffffffffff, 0x0000007fffffffff,
- 0x0000003fffffffff, 0x0000001fffffffff,
- 0x0000000fffffffff, 0x00000007ffffffff,
- 0x00000003ffffffff, 0x00000001ffffffff,
- 0x00000000ffffffff, 0x000000007fffffff,
- 0x000000003fffffff, 0x000000001fffffff,
- 0x000000000fffffff, 0x0000000007ffffff,
- 0x0000000003ffffff, 0x0000000001ffffff,
- 0x0000000000ffffff, 0x00000000007fffff,
- 0x00000000003fffff, 0x00000000001fffff,
- 0x00000000000fffff, 0x000000000007ffff,
- 0x000000000003ffff, 0x000000000001ffff,
- 0x000000000000ffff, 0x0000000000007fff,
- 0x0000000000003fff, 0x0000000000001fff,
- 0x0000000000000fff, 0x00000000000007ff,
- 0x00000000000003ff, 0x00000000000001ff,
- 0x00000000000000ff, 0x000000000000007f,
- 0x000000000000003f, 0x000000000000001f,
- 0x000000000000000f, 0x0000000000000007,
- 0x0000000000000003, 0x0000000000000001
-};
-#else
-PixelGroup cfb8BitLenMasks[PGSZ] = {
- 0xffffffffffffffff, 0xfffffffffffffffe,
- 0xfffffffffffffffc, 0xfffffffffffffff8,
- 0xfffffffffffffff0, 0xffffffffffffffe0,
- 0xffffffffffffffc0, 0xffffffffffffff80,
- 0xffffffffffffff00, 0xfffffffffffffe00,
- 0xfffffffffffffc00, 0xfffffffffffff800,
- 0xfffffffffffff000, 0xffffffffffffe000,
- 0xffffffffffffc000, 0xffffffffffff8000,
- 0xffffffffffff0000, 0xfffffffffffe0000,
- 0xfffffffffffc0000, 0xfffffffffff80000,
- 0xfffffffffff00000, 0xffffffffffe00000,
- 0xffffffffffc00000, 0xffffffffff800000,
- 0xffffffffff000000, 0xfffffffffe000000,
- 0xfffffffffc000000, 0xfffffffff8000000,
- 0xfffffffff0000000, 0xffffffffe0000000,
- 0xffffffffc0000000, 0xffffffff80000000,
- 0xffffffff00000000, 0xfffffffe00000000,
- 0xfffffffc00000000, 0xfffffff800000000,
- 0xfffffff000000000, 0xffffffe000000000,
- 0xffffffc000000000, 0xffffff8000000000,
- 0xffffff0000000000, 0xfffffe0000000000,
- 0xfffffc0000000000, 0xfffff80000000000,
- 0xfffff00000000000, 0xffffe00000000000,
- 0xffffc00000000000, 0xffff800000000000,
- 0xffff000000000000, 0xfffe000000000000,
- 0xfffc000000000000, 0xfff8000000000000,
- 0xfff0000000000000, 0xffe0000000000000,
- 0xffc0000000000000, 0xff80000000000000,
- 0xff00000000000000, 0xfe00000000000000,
- 0xfc00000000000000, 0xf800000000000000,
- 0xf000000000000000, 0xe000000000000000,
- 0xc000000000000000, 0x8000000000000000
-};
-#endif /* BITMAP_BIT_ORDER */
-#endif /* PGSZ */
-
-
-
-int
-cfb8ComputeClipMasks32 (pBox, numRects, x, y, w, h, clips)
- BoxPtr pBox;
- int numRects;
- int x, y, w, h;
- CARD32 *clips;
-{
- int yBand, yBandBot;
- int ch;
- CfbBits clip;
- int partIN = FALSE, partOUT = FALSE;
- int result;
-
- if (numRects == 0)
- return rgnOUT;
- while (numRects && pBox->y2 <= y)
- {
- --numRects;
- ++pBox;
- }
- if (!numRects || pBox->y1 >= y + h)
- return rgnOUT;
- yBand = pBox->y1;
- while (numRects && pBox->y1 == yBand && pBox->x2 <= x)
- {
- --numRects;
- ++pBox;
- }
- if (!numRects || pBox->y1 >= y + h)
- return rgnOUT;
- if (numRects &&
- x >= pBox->x1 &&
- x + w <= pBox->x2 &&
- y >= pBox->y1 &&
- y + h <= pBox->y2)
- {
- return rgnIN;
- }
- ch = 0;
- while (numRects && pBox->y1 < y + h)
- {
- yBand = pBox->y1;
- yBandBot = pBox->y2;
- while (ch < h && y + ch < yBand)
- {
- partOUT = TRUE;
- clips[ch++] = 0;
- }
- if (ch >= h)
- break;
- while (numRects && pBox->y1 == yBand && pBox->x2 <= x)
- {
- --numRects;
- ++pBox;
- }
- if (!numRects)
- break;
- clip = 0;
- while (numRects && pBox->y1 == yBand && pBox->x1 < x + w)
- {
- if (x < pBox->x1)
- if (pBox->x2 < x + w)
- clip |= cfb8BitLenMasks[pBox->x1 - x] & ~cfb8BitLenMasks[pBox->x2 - x];
- else
- clip |= cfb8BitLenMasks[pBox->x1 - x];
- else
- if (pBox->x2 < x + w)
- clip |= ~cfb8BitLenMasks[pBox->x2 - x];
- else
- clip = ~0;
- --numRects;
- ++pBox;
- }
- if (clip != 0)
- partIN = TRUE;
- if (clip != ~0)
- partOUT = TRUE;
- while (ch < h && y + ch < yBandBot)
- clips[ch++] = clip;
- while (numRects && pBox->y1 == yBand)
- {
- --numRects;
- ++pBox;
- }
- }
- while (ch < h)
- {
- partOUT = TRUE;
- clips[ch++] = 0;
- }
- result = rgnOUT;
- if (partIN)
- {
- if (partOUT)
- result = rgnPART;
- else
- result = rgnIN;
- }
- return result;
-}
-
-#endif /* PSZ == 8 */
diff --git a/cfb/cfb8bit.h b/cfb/cfb8bit.h
deleted file mode 100644
index 0c6b51925..000000000
--- a/cfb/cfb8bit.h
+++ /dev/null
@@ -1,1568 +0,0 @@
-/*
- * cfb8bit.h
- *
- * Defines which are only useful to 8 bit color frame buffers
- *
- * That doesn't seem to be true any more. Some of the macros in here
- * are used for depths other than 8. Perhaps the file should be
- * renamed. dpw
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.8 2003/11/17 22:20:32 dawes Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $Xorg: cfb8bit.h,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "servermd.h"
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define GetBitGroup(x) (((PixelGroup) (x)) >> (PGSZ - PGSZB))
-#define NextBitGroup(x) ((x) <<= PGSZB)
-#define NextSomeBits(x,n) ((x) <<= (n))
-#else
-#define GetBitGroup(x) ((x) & PGSZBMSK)
-#define NextBitGroup(x) ((x) >>= PGSZB)
-#define NextSomeBits(x,n) ((x) >>= (n))
-#endif
-
-#define RotBitsLeft(x,k) ((x) = BitLeft (x,k) | \
- BitRight (x, PGSZ-(k)))
-
-#if defined(__GNUC__) && defined(mc68020)
-#undef RotBitsLeft
-#define RotBitsLeft(x,k) asm("rol%.l %2,%0" \
- : "=d" (x) \
- : "0" (x), "dI" (k))
-#endif
-
-#if PSZ == 8
-
-#define GetPixelGroup(x) (cfb8StippleXor[GetBitGroup(x)])
-#define RRopPixels(dst,x) (DoRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x]))
-#define RRopPixelGroup(dst,x) (RRopPixels(dst,GetBitGroup(x)))
-#define MaskRRopPixels(dst,x,mask) (DoMaskRRop(dst,cfb8StippleAnd[x], cfb8StippleXor[x], mask))
-
-#define NUM_MASKS (1<<PPW) /* XXX goes in cfbmskbits.h? */
-extern int cfb8StippleMode, cfb8StippleAlu;
-extern PixelGroup cfb8StippleFg, cfb8StippleBg, cfb8StipplePm;
-extern PixelGroup cfb8StippleMasks[NUM_MASKS];
-extern PixelGroup cfb8StippleAnd[NUM_MASKS], cfb8StippleXor[NUM_MASKS];
-extern int cfb8StippleRRop;
-
-#define cfb8PixelMasks cfb8StippleMasks
-#define cfb8Pixels cfb8StippleXor
-
-#define cfb8CheckPixels(fg, bg) \
- (FillOpaqueStippled == cfb8StippleMode && \
- GXcopy == cfb8StippleAlu && \
- ((fg) & PMSK) == cfb8StippleFg && \
- ((bg) & PMSK) == cfb8StippleBg && \
- PMSK == cfb8StipplePm)
-
-#define cfb8CheckOpaqueStipple(alu,fg,bg,pm) \
- ((FillOpaqueStippled == cfb8StippleMode && \
- (alu) == cfb8StippleAlu && \
- ((fg) & PMSK) == cfb8StippleFg && \
- ((bg) & PMSK) == cfb8StippleBg && \
- ((pm) & PMSK) == cfb8StipplePm) ? 0 : cfb8SetOpaqueStipple(alu,fg,bg,pm))
-
-#define cfb8CheckStipple(alu,fg,pm) \
- ((FillStippled == cfb8StippleMode && \
- (alu) == cfb8StippleAlu && \
- ((fg) & PMSK) == cfb8StippleFg && \
- ((pm) & PMSK) == cfb8StipplePm) ? 0 : cfb8SetStipple(alu,fg,pm))
-
-#define cfb8SetPixels(fg,bg) cfb8SetOpaqueStipple(GXcopy,fg,bg,PMSK)
-
-/*
- * These macros are shared between the unnatural spans code
- * and the unnatural rectangle code. No reasonable person
- * would attempt to use them anyplace else.
- */
-
-#define NextUnnaturalStippleWord \
- if (bitsLeft >= MFB_PPW) \
- { \
- inputBits = *srcTemp++; \
- bitsLeft -= MFB_PPW; \
- partBitsLeft = MFB_PPW; \
- } \
- else \
- { \
- inputBits = 0; \
- if (bitsLeft) \
- inputBits = *srcTemp & ~cfb8BitLenMasks[bitsLeft]; \
- srcTemp = srcStart; \
- partBitsLeft = bitsLeft; \
- bitsLeft = bitsWhole; \
- }
-
-#define NextUnnaturalStippleBits \
- if (partBitsLeft >= PPW) { \
- bits = GetBitGroup (inputBits); \
- NextBitGroup (inputBits); \
- partBitsLeft -= PPW; \
- } else { \
- bits = GetBitGroup (inputBits); \
- nextPartBits = PPW - partBitsLeft; \
- NextUnnaturalStippleWord \
- if (partBitsLeft < nextPartBits) { \
- if (partBitsLeft) {\
- bits |= BitRight (GetBitGroup (inputBits), \
- PPW - nextPartBits) & PPWMSK;\
- nextPartBits -= partBitsLeft; \
- } \
- NextUnnaturalStippleWord \
- } \
- bits |= BitRight (GetBitGroup (inputBits), \
- PPW - nextPartBits) & PPWMSK; \
- NextSomeBits (inputBits, nextPartBits); \
- partBitsLeft -= nextPartBits; \
- }
-
-#define NextUnnaturalStippleBitsFast \
- if (partBitsLeft >= PPW) { \
- bits = GetBitGroup(inputBits); \
- NextBitGroup(inputBits); \
- partBitsLeft -= PPW; \
- } else { \
- bits = GetBitGroup (inputBits); \
- nextPartBits = PPW - partBitsLeft; \
- inputBits = *srcTemp++; \
- bits |= BitRight (GetBitGroup (inputBits), \
- partBitsLeft) & PPWMSK; \
- NextSomeBits (inputBits, nextPartBits); \
- partBitsLeft = MFB_PPW - nextPartBits; \
- }
-
-/*
- * WriteBitGroup takes the destination address, a pixel
- * value (which must be 8 bits duplicated 4 time with PFILL)
- * and the PPW bits to write, which must be in the low order
- * bits of the register (probably from GetBitGroup) and writes
- * the appropriate locations in memory with the pixel value. This
- * is a copy-mode only operation.
- */
-
-#define RRopBitGroup(dst,bits) \
- { \
- *(dst) = RRopPixels(*(dst),bits); \
- }
-
-#define MaskRRopBitGroup(dst,bits,mask) \
- { \
- *(dst) = MaskRRopPixels(*(dst),bits,mask); \
- }
-#endif /* PSZ == 8 */
-
-#if !defined(AVOID_MEMORY_READ) && PSZ == 8
-
-#define WriteBitGroup(dst,pixel,bits) \
- { \
- register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \
- *(dst) = (*(dst) & ~_maskTmp) | ((pixel) & _maskTmp); \
- }
-
-#define SwitchBitGroup(dst,pixel,bits) \
- { \
- register PixelGroup _maskTmp = cfb8PixelMasks[(bits)]; \
- register PixelGroup _pixTmp = ((pixel) & _maskTmp); \
- _maskTmp = ~_maskTmp; \
- SwitchBitsLoop (*(dst) = (*(dst) & _maskTmp) | _pixTmp;) \
- }
-
-#else /* AVOID_MEMORY_READ */
-
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define SinglePixel0 3
-#define SinglePixel1 2
-#define SinglePixel2 1
-#define SinglePixel3 0
-#define SinglePixel4 7
-#define SinglePixel5 6
-#define SinglePixel6 5
-#define SinglePixel7 4
-#define SinglePixel8 0xB
-#define SinglePixel9 0xA
-#define DoublePixel0 1
-#define DoublePixel1 0
-#define DoublePixel2 3
-#define DoublePixel3 2
-#define DoublePixel4 5
-#define DoublePixel5 4
-#else
-#define SinglePixel0 0
-#define SinglePixel1 1
-#define SinglePixel2 2
-#define SinglePixel3 3
-#define SinglePixel4 4
-#define SinglePixel5 5
-#define SinglePixel6 6
-#define SinglePixel7 7
-#define SinglePixel8 8
-#define SinglePixel9 9
-#define DoublePixel0 0
-#define DoublePixel1 1
-#define DoublePixel2 2
-#define DoublePixel3 3
-#define DoublePixel4 4
-#define DoublePixel5 5
-#endif
-#define QuadPixel0 0
-#define QuadPixel1 1
-#define QuadPixel2 2
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define SinglePixel0 7
-#define SinglePixel1 6
-#define SinglePixel2 5
-#define SinglePixel3 4
-#define SinglePixel4 3
-#define SinglePixel5 2
-#define SinglePixel6 1
-#define SinglePixel7 0
-#define DoublePixel0 3
-#define DoublePixel1 2
-#define DoublePixel2 1
-#define DoublePixel3 0
-#define QuadPixel0 1
-#define QuadPixel1 0
-#else
-#define SinglePixel0 0
-#define SinglePixel1 1
-#define SinglePixel2 2
-#define SinglePixel3 3
-#define SinglePixel4 4
-#define SinglePixel5 5
-#define SinglePixel6 6
-#define SinglePixel7 7
-#define DoublePixel0 0
-#define DoublePixel1 1
-#define DoublePixel2 2
-#define DoublePixel3 3
-#define QuadPixel0 0
-#define QuadPixel1 1
-#endif
-#define OctaPixel0 0
-#endif /* PGSZ == 64 */
-
-#if PSZ == 8
-
-#if PGSZ == 32
-#define WriteBitGroup(dst,pixel,bits) \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- break; \
- case 4: \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 13: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 14: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[0] = (pixel); \
- break; \
- }
-#else /* PGSZ == 64 */
-#define WriteBitGroup(dst,pixel,bits) \
- if ( bits == 0xff ) \
- ((PixelGroup *) (dst))[OctaPixel0] = (pixel); \
- else { \
- switch (bits & 0x0f) { \
- case 0: \
- break; \
- case 1: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- break; \
- case 4: \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 13: \
- ((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 14: \
- ((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[QuadPixel0] = (pixel); \
- break; \
- } \
- switch ((bits & 0xf0) >> 4) { \
- case 0: \
- break; \
- case 1: \
- ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- break; \
- case 2: \
- ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 3: \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- break; \
- case 4: \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 5: \
- ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 6: \
- ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 7: \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 8: \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 9: \
- ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 10: \
- ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 11: \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 12: \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 13: \
- ((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 14: \
- ((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
- break; \
- } \
- }
-#endif /* PGSZ == 64 */
-
-#if PGSZ == 32
-#define SwitchBitGroup(dst,pixel,bits) { \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);) \
- break; \
- case 4: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 13: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 14: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[0] = (pixel);) \
- break; \
- } \
-}
-#else /* PGSZ == 64 */
-#define SwitchBitGroup(dst,pixel,bits) { \
- if ( bits == 0xff ) \
- SwitchBitsLoop (((PixelGroup *) (dst))[OctaPixel0] = (pixel);) \
- else { \
- switch (bits & 0x0f) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel);)\
- break; \
- case 4: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
- break; \
- case 13: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
- break; \
- case 14: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel1] = (pixel);)\
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel);) \
- break; \
- } \
- switch ((bits & 0xf0) >> 4) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel);)\
- break; \
- case 4: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel6] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel7] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
- break; \
- case 13: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
- break; \
- case 14: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel);)\
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel1] = (pixel);) \
- break; \
- } \
- } \
-}
-#endif /* PGSZ == 64 */
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-
-#if PGSZ == 32
-#define WriteBitGroup(dst,pixel,bits) \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- break; \
- case 4: \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 13: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 14: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- }
-#else /* PGSZ == 64 */
-#define WriteBitGroup(dst,pixel,bits) \
- if ( bits == 0xff ) { \
- ((PixelGroup *) (dst))[QuadPixel0] = (pixel); \
- ((PixelGroup *) (dst))[QuadPixel1] = (pixel); \
- } \
- else { \
- switch (bits & 0x0f) { \
- case 0: \
- break; \
- case 1: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- break; \
- case 4: \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 13: \
- ((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 14: \
- ((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel); \
- break; \
- } \
- switch ((bits & 0xf0) >> 4) { \
- case 0: \
- break; \
- case 1: \
- ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
- break; \
- case 2: \
- ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
- break; \
- case 4: \
- ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 5: \
- ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 6: \
- ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 8: \
- ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 9: \
- ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 10: \
- ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 13: \
- ((CARD16 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 14: \
- ((CARD16 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel3] = (pixel); \
- break; \
- } \
- }
-#endif /* PGSZ */
-
-#if PGSZ == 32
-#define SwitchBitGroup(dst,pixel,bits) { \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel);) \
- break; \
- case 4: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD16 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 13: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 14: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD32 *) (dst))[DoublePixel1] = (pixel);) \
- break; \
- } \
-}
-#else /* PGSZ == 64 */
-#define SwitchBitGroup(dst,pixel,bits) { \
- cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
-#endif /* PGSZ */
-
-#endif /* PSZ == 16 */
-
-#if PSZ == 24
-/* 32 000011112222*/
-/* 24 000111222333*/
-/* 16 001122334455*/
-/* 8 0123456789AB*/
-#if PGSZ == 32
-#define WriteBitGroup(dst,pixel,bits) \
- { \
- register CARD32 reg_pixel = (pixel); \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel2] = ((reg_pixel>>16)&0xFF); \
- break; \
- case 2: \
- ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \
- ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \
- break; \
- case 3: \
- ((CARD8 *) (dst))[SinglePixel3] = reg_pixel & 0xFF; \
- ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
- ((CARD16 *) (dst))[DoublePixel2] = (reg_pixel>>8)&0xFFFF; \
- ((CARD8 *) (dst))[SinglePixel2] = (reg_pixel>>16&0xFF); \
- break; \
- case 4: \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel8] = (reg_pixel>>16)&0xFF; \
- break; \
- case 5: \
- ((CARD16 *) (dst))[DoublePixel0] = \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- reg_pixel >>= 16; \
- ((CARD8 *) (dst))[SinglePixel2] = \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
- break; \
- case 6: \
- ((CARD8 *) (dst))[SinglePixel3] = reg_pixel; \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
- break; \
- case 7: \
- ((CARD16 *) (dst))[DoublePixel0] = \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel3] = reg_pixel&0xFF; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel2] = \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel&0xFF; \
- break; \
- case 8: \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
- ((CARD16 *) (dst))[DoublePixel5] = (reg_pixel>>8); \
- break; \
- case 9: \
- ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel2] = reg_pixel&0xFF; \
- break; \
- case 10: \
- ((CARD8 *) (dst))[SinglePixel3] = \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel&0xFF; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- break; \
- case 11: \
- ((CARD8 *) (dst))[SinglePixel3] = \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
- ((CARD16 *) (dst))[DoublePixel0] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \
- break; \
- case 12: \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
- break; \
- case 13: \
- ((CARD16 *) (dst))[DoublePixel0] = \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel2] = \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
- break; \
- case 14: \
- ((CARD8 *) (dst))[SinglePixel3] = \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel8] = reg_pixel; \
- break; \
- case 15: \
- ((CARD16 *) (dst))[DoublePixel0] = \
- ((CARD16 *) (dst))[DoublePixel3] = reg_pixel; \
- ((CARD8 *) (dst))[SinglePixel3] = \
- ((CARD8 *) (dst))[SinglePixel9] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD16 *) (dst))[DoublePixel2] = \
- ((CARD16 *) (dst))[DoublePixel5] = reg_pixel; \
- reg_pixel >>= 8; \
- ((CARD8 *) (dst))[SinglePixel8] = \
- ((CARD8 *) (dst))[SinglePixel2] = reg_pixel; \
- break; \
- } \
- }
-#else /* PGSZ == 64 */
-#define WriteBitGroup(dst,pixel,bits) \
- if ( bits == 0xff ) { \
- ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \
- } \
- else { \
- switch (bits & 0x0f) { \
- case 0: \
- break; \
- case 1: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 4: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 13: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 14: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- } \
- switch ((bits & 0xf0) >> 4) { \
- case 0: \
- break; \
- case 1: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- break; \
- case 2: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 4: \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 5: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 6: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 8: \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 9: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 10: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 13: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 14: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- } \
- }
-#endif /* PGSZ */
-
-#if PGSZ == 32
-#define SwitchBitGroup(dst,pixel,bits) { \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel);) \
- break; \
- case 4: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel8] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel9] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel2] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel);) \
- ((CARD8 *) (dst))[SinglePixel9] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel5] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
- break; \
- case 13: \
- SwitchBitsLoop (((CARD16 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD8 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD16 *) (dst))[DoublePixel3] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
- break; \
- case 14: \
- SwitchBitsLoop (((CARD8 *) (dst))[SinglePixel3] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[QuadPixel0] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel1] = (pixel); \
- ((CARD32 *) (dst))[QuadPixel2] = (pixel);) \
- break; \
- } \
-}
-#else /* PGSZ == 64 */
-#define SwitchBitGroup(dst,pixel,bits) { \
- cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
-#endif /* PGSZ */
-
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-
-#if PGSZ == 32
-#define WriteBitGroup(dst,pixel,bits) \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 4: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 13: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 14: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- }
-#else /* PGSZ == 64 */
-#define WriteBitGroup(dst,pixel,bits) \
- if ( bits == 0xff ) { \
- ((PixelGroup *) (dst))[DoublePixel0] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel1] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel2] = (pixel); \
- ((PixelGroup *) (dst))[DoublePixel3] = (pixel); \
- } \
- else { \
- switch (bits & 0x0f) { \
- case 0: \
- break; \
- case 1: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- break; \
- case 2: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- break; \
- case 4: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 5: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 6: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- break; \
- case 8: \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 9: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 10: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 13: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 14: \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel); \
- break; \
- } \
- switch ((bits & 0xf0) >> 4) { \
- case 0: \
- break; \
- case 1: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- break; \
- case 2: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 3: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- break; \
- case 4: \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 5: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 6: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 7: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- break; \
- case 8: \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 9: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 10: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 11: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 12: \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 13: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 14: \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- case 15: \
- ((CARD32 *) (dst))[SinglePixel4] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel5] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel6] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel7] = (pixel); \
- break; \
- } \
- }
-#endif /* PGSZ */
-
-#if PGSZ == 32
-#define SwitchBitGroup(dst,pixel,bits) { \
- switch (bits) { \
- case 0: \
- break; \
- case 1: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel);) \
- break; \
- case 2: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel);) \
- break; \
- case 3: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel);) \
- break; \
- case 4: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 5: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 6: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 7: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel);) \
- break; \
- case 8: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 9: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 10: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 11: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 12: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 13: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 14: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- case 15: \
- SwitchBitsLoop (((CARD32 *) (dst))[SinglePixel0] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel1] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel2] = (pixel); \
- ((CARD32 *) (dst))[SinglePixel3] = (pixel);) \
- break; \
- } \
-}
-#else /* PGSZ == 64 */
-#define SwitchBitGroup(dst,pixel,bits) { \
- cfb cannot hack 64-bit SwitchBitGroup psz=PSZ
-#endif /* PGSZ */
-
-#endif /* PSZ == 32 */
-#endif /* AVOID_MEMORY_READ */
-
-extern PixelGroup cfb8BitLenMasks[PGSZ];
-
-extern int cfb8SetStipple (
- int /*alu*/,
- CfbBits /*fg*/,
- CfbBits /*planemask*/
-);
-
-extern int cfb8SetOpaqueStipple (
- int /*alu*/,
- CfbBits /*fg*/,
- CfbBits /*bg*/,
- CfbBits /*planemask*/
-);
-
-extern int cfb8ComputeClipMasks32 (
- BoxPtr /*pBox*/,
- int /*numRects*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- CARD32 * /*clips*/
-);
diff --git a/cfb/cfb8line.c b/cfb/cfb8line.c
deleted file mode 100644
index 01c412b97..000000000
--- a/cfb/cfb8line.c
+++ /dev/null
@@ -1,1500 +0,0 @@
-/*
- * $Xorg: cfb8line.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- *
- * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.19 2003/10/29 22:44:52 tsi Exp $
- * Jeff Anton'x fixes: cfb8line.c 97/02/07
- */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfbrrop.h"
-#include "miline.h"
-
-#ifdef PIXEL_ADDR
-
-#if defined(__GNUC__) && defined(mc68020)
-#define STUPID volatile
-#define REARRANGE
-#else
-#define STUPID
-#endif
-
-#ifdef __GNUC__
-/* lame compiler doesn't even look at 'register' attributes */
-#define I_H do{
-#define I_T }while(0);
-#define IMPORTANT_START I_H I_H I_H I_H I_H I_H I_H I_H I_H I_H
-#define IMPORTANT_END I_T I_T I_T I_T I_T I_T I_T I_T I_T I_T
-#else
-#define IMPORTANT_START
-#define IMPORTANT_END
-#endif
-
-#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & ClipMask)
-
-#ifdef POLYSEGMENT
-
-# if (defined(sun) || defined(__bsdi__)) && \
- (defined(sparc) || defined(__sparc__))
-# define WIDTH_FAST 1152
-# endif
-
-# ifdef ultrix
-# define WIDTH_FAST 1024
-# endif
-
-# ifdef Mips
-# define WIDTH_FAST 4096
-# endif
-# ifdef WIDTH_FAST
-# if WIDTH_FAST == 1024
-# define FAST_MUL(y) ((y) << 10)
-# endif
-
-# if WIDTH_FAST == 1152
-# define FAST_MUL(y) (((y) << 10) + ((y) << 7))
-# endif
-
-# if WIDTH_FAST == 1280
-# define FAST_MUL(y) (((y) << 10) + ((y) << 8))
-# endif
-
-# if WIDTH_FAST == 2048
-# define FAST_MUL(y) ((y) << 11)
-# endif
-
-# if WIDTH_FAST == 4096
-# define FAST_MUL(y) ((y) << 12)
-# endif
-# endif
-
-# if defined(WIDTH_SHIFT)
-# ifdef FAST_MUL
-# define FUNC_NAME(e) RROP_NAME(RROP_NAME_CAT(e,Shift))
-# if RROP == GXcopy
-# define INCLUDE_OTHERS
-# define SERIOUS_UNROLLING
-# endif
-# define INCLUDE_DRAW
-# define NWIDTH(nwidth) WIDTH_FAST
-# define WIDTH_MUL(y,w) FAST_MUL(y)
-# endif
-# else
-# define FUNC_NAME(e) RROP_NAME(e)
-# define WIDTH_MUL(y,w) ((y) * (w))
-# define NWIDTH(nwidth) (nwidth)
-# define INCLUDE_DRAW
-# if !defined (FAST_MUL) && RROP == GXcopy
-# define INCLUDE_OTHERS
-# define SERIOUS_UNROLLING
-# endif
-# endif
-#else
-
-# define INCLUDE_DRAW
-# define WIDTH_MUL(y,w) ((y) * (w))
-# define NWIDTH(nwidth) nwidth
-# ifdef PREVIOUS
-# define FUNC_NAME(e) RROP_NAME(RROP_NAME_CAT(e,Previous))
-# else
-# define FUNC_NAME(e) RROP_NAME(e)
-# if RROP == GXcopy
-# define INCLUDE_OTHERS
-# ifdef PLENTIFUL_REGISTERS
-# define SAVE_X2Y2
-# endif
-# define ORIGIN
-# define SERIOUS_UNROLLING
-# else
-# define EITHER_MODE
-# endif
-# endif
-#endif
-
-#if PSZ == 24
-#define PXL2ADR(x) ((x)*3 >> 2)
-
-#if RROP == GXcopy
-#define body_rop \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp = (*addrp & 0xFF000000)|(piQxelXor[0] & 0xFFFFFF); \
- break; \
- case 1: \
- *addrp = (*addrp & 0xFF)|(piQxelXor[2] & 0xFFFFFF00); \
- break; \
- case 3: \
- *addrp = (*addrp & 0xFFFFFF)|(piQxelXor[0] & 0xFF000000); \
- *(addrp+1)=(*(addrp+1) & 0xFFFF0000)|(piQxelXor[1] & 0xFFFF); \
- break; \
- case 2: \
- *addrp = (*addrp & 0xFFFF)|(piQxelXor[1] & 0xFFFF0000); \
- *(addrp+1)=(*(addrp+1) & 0xFFFFFF00)|(piQxelXor[2] & 0xFF); \
- break; \
- }
-#endif
-#if RROP == GXxor
-#define body_rop \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp ^= piQxelXor[0] & 0xFFFFFF; \
- break; \
- case 1: \
- *addrp ^= piQxelXor[2] & 0xFFFFFF00; \
- break; \
- case 3: \
- *addrp ^= piQxelXor[0] & 0xFF000000; \
- *(addrp+1) ^= piQxelXor[1] & 0xFFFF; \
- break; \
- case 2: \
- *addrp ^= piQxelXor[1] & 0xFFFF0000; \
- *(addrp+1) ^= piQxelXor[2] & 0xFF; \
- break; \
- }
-#endif
-#if RROP == GXand
-#define body_rop \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp &= piQxelAnd[0] | 0xFF000000; \
- break; \
- case 1: \
- *addrp &= piQxelAnd[2] | 0xFF; \
- break; \
- case 3: \
- *addrp &= 0xFFFFFF | piQxelAnd[0]; \
- *(addrp+1) &= 0xFFFF0000 | piQxelAnd[1]; \
- break; \
- case 2: \
- *addrp &= 0xFFFF | piQxelAnd[1]; \
- *(addrp+1) &= 0xFFFFFF00 | piQxelAnd[2]; \
- break; \
- }
-#endif
-#if RROP == GXor
-#define body_rop \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp |= piQxelOr[0] & 0xFFFFFF; \
- break; \
- case 1: \
- *addrp |= piQxelOr[2] & 0xFFFFFF00; \
- break; \
- case 3: \
- *addrp |= piQxelOr[0] & 0xFF000000; \
- *(addrp+1) |= piQxelOr[1] & 0xFFFF; \
- break; \
- case 2: \
- *addrp |= piQxelOr[1] & 0xFFFF0000; \
- *(addrp+1) |= piQxelOr[2] & 0xFF; \
- break; \
- }
-#endif
-#if RROP == GXset
-#define body_rop \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp = (*addrp & (piQxelAnd[0]|0xFF000000)) \
- ^ (piQxelXor[0] & 0xFFFFFF); \
- break; \
- case 1: \
- *addrp = (*addrp & (piQxelAnd[2]|0xFF)) \
- ^ (piQxelXor[2] & 0xFFFFFF00); \
- break; \
- case 3: \
- *addrp = (*addrp & (piQxelAnd[0]|0xFFFFFF)) \
- ^ (piQxelXor[0] & 0xFF000000); \
- *(addrp+1) = (*(addrp+1) & (piQxelAnd[1]|0xFFFF0000)) \
- ^ (piQxelXor[1] & 0xFFFF); \
- break; \
- case 2: \
- *addrp = (*addrp & (piQxelAnd[1]|0xFFFF)) \
- ^ (piQxelXor[1] & 0xFFFF0000); \
- *(addrp+1) = (*(addrp+1) & (piQxelAnd[2]|0xFFFFFF00)) \
- ^ (piQxelXor[2] & 0xFF); \
- break; \
- }
-#endif
-#endif /* PSZ == 24 */
-
-#define BUGFIX_clip
-
-#ifdef INCLUDE_DRAW
-
-int
-#ifdef POLYSEGMENT
-FUNC_NAME(cfb8SegmentSS1Rect) (pDrawable, pGC, nseg, pSegInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- xSegment *pSegInit;
-#else
-FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
- x1p,y1p,x2p,y2p)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit, pptInitOrig;
- int *x1p, *y1p, *x2p, *y2p;
-#endif /* POLYSEGMENT */
-{
- register long e;
- register int y1_or_e1;
- register PixelType *addrp;
- register int stepmajor;
- register int stepminor;
-#ifndef REARRANGE
- register long e3;
-#endif
-#ifdef mc68000
- register short x1_or_len;
-#else
- register int x1_or_len;
-#endif
- RROP_DECLARE
-
-#ifdef SAVE_X2Y2
-# define c2 y2
-#else
- register int c2;
-#endif
-#if !defined(ORIGIN) && !defined(POLYSEGMENT)
- register int _x1 = 0, _y1 = 0, _x2 = 0, _y2 = 0;
- int extents_x1, extents_y1, extents_x2, extents_y2;
-#endif /* !ORIGIN */
-#ifndef PREVIOUS
- register int upperleft, lowerright;
- CARD32 ClipMask = 0x80008000;
-#endif /* !PREVIOUS */
-#ifdef POLYSEGMENT
- register int capStyle;
-#endif /* POLYSEGMENT */
-#ifdef SAVE_X2Y2
- register int x2, y2;
-# define X1 x1_or_len
-# define Y1 y1_or_e1
-# define X2 x2
-# define Y2 y2
-#else
-# ifdef POLYSEGMENT
-# define X1 x1_or_len
-# define Y1 y1_or_e1
-# else
-# define X1 intToX(y1_or_e1)
-# define Y1 intToY(y1_or_e1)
-# endif /* POLYSEGMENT */
-# define X2 intToX(c2)
-# define Y2 intToY(c2)
-#endif /* SAVE_X2Y2 */
- PixelType *addr;
- int nwidth;
- cfbPrivGCPtr devPriv;
- BoxPtr extents;
- int *ppt;
-#if PSZ == 24
- int xBase; /* x of addr */
- int xOffset; /* x of addrp */
- PixelType *addrLineEnd;
- char *addrb;
- int stepmajor3, stepminor3, majordx, minordx;
-#endif
-#ifndef POLYSEGMENT
-#ifndef ORIGIN
-#ifdef BUGFIX_clip
- int ex_x1, ex_y1, ex_x2, ex_y2;
-#endif
-#endif
-#endif
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- devPriv = cfbGetGCPrivate(pGC);
- cfbGetPixelWidthAndPointer (pDrawable, nwidth, addr);
-#ifndef REARRANGE
- RROP_FETCH_GCPRIV(devPriv);
-#endif
- extents = &pGC->pCompositeClip->extents;
-#ifndef PREVIOUS
- c2 = *((int *) &pDrawable->x);
- c2 -= (c2 & 0x8000) << 1;
- upperleft = *((int *) &extents->x1) - c2;
- lowerright = *((int *) &extents->x2) - c2 - 0x00010001;
-#endif /* !PREVIOUS */
-#ifndef POLYSEGMENT
-#ifndef ORIGIN
-#ifdef BUGFIX_clip
- ex_x1 = extents->x1 - pDrawable->x;
- ex_y1 = extents->y1 - pDrawable->y;
- ex_x2 = extents->x2 - pDrawable->x;
- ex_y2 = extents->y2 - pDrawable->y;
-#endif
-#endif
-#endif
-#if PSZ == 24
- xBase = pDrawable->x;
- addr += WIDTH_MUL(pDrawable->y,nwidth);
-#else
- addr = addr + WIDTH_MUL(pDrawable->y,nwidth) + pDrawable->x;
-#endif
-#ifdef POLYSEGMENT
- capStyle = pGC->capStyle - CapNotLast;
- ppt = (int *) pSegInit;
- while (nseg--)
-#else /* POLYSEGMENT */
-#ifdef EITHER_MODE
- mode -= CoordModePrevious;
- if (!mode)
-#endif /* EITHER_MODE */
-#ifndef ORIGIN
- { /* CoordModePrevious */
- ppt = (int *)pptInit + 1;
- _x1 = *x1p;
- _y1 = *y1p;
- extents_x1 = extents->x1 - pDrawable->x;
- extents_x2 = extents->x2 - pDrawable->x;
- extents_y1 = extents->y1 - pDrawable->y;
- extents_y2 = extents->y2 - pDrawable->y;
- if (_x1 < extents_x1 || _x1 >= extents_x2 ||
- _y1 < extents_y1 || _y1 >= extents_y2)
- {
- c2 = *ppt++;
- intToCoord(c2, _x2, _y2);
- *x2p = _x1 + _x2;
- *y2p = _y1 + _y2;
- return 1;
- }
-#if PSZ == 24
- addrLineEnd = addr + WIDTH_MUL(_y1, nwidth);
- xOffset = xBase + _x1;
- addrb = (char *)addrLineEnd + xOffset * 3;
- addrp = (PixelType *)((unsigned long)addrb & ~0x03);
-#else
- addrp = addr + WIDTH_MUL(_y1, nwidth) + _x1;
-#endif
- _x2 = _x1;
- _y2 = _y1;
- }
-#endif /* !ORIGIN */
-#ifdef EITHER_MODE
- else
-#endif /* EITHER_MODE */
-#ifndef PREVIOUS
- {
- ppt = (int *) pptInit;
- c2 = *ppt++;
- if (isClipped (c2, upperleft, lowerright))
- {
- return 1;
- }
-#ifdef SAVE_X2Y2
- intToCoord(c2,x2,y2);
-#endif
-#if PSZ == 24
- addrLineEnd = addr + WIDTH_MUL(Y2, nwidth);
- xOffset = xBase + X2;
- addrb = (char *)addrLineEnd + xOffset * 3;
- addrp = (PixelType *)((unsigned long)addrb & ~0x03);
-#else
- addrp = addr + WIDTH_MUL(Y2, nwidth) + X2;
-#endif
- }
-#endif /* !PREVIOUS */
- while (--npt)
-#endif /* POLYSEGMENT */
- {
-#ifdef POLYSEGMENT
- y1_or_e1 = ppt[0];
- c2 = ppt[1];
- ppt += 2;
- if (isClipped(y1_or_e1,upperleft,lowerright)|isClipped(c2,upperleft,lowerright))
- break;
- intToCoord(y1_or_e1,x1_or_len,y1_or_e1);
- /* compute now to avoid needing x1, y1 later */
-#if PSZ == 24
- addrLineEnd = addr + WIDTH_MUL(y1_or_e1, nwidth);
- xOffset = xBase + x1_or_len;
- addrb = (char *)addrLineEnd + xOffset * 3;
- addrp = (PixelType *)((unsigned long)addrb & ~0x03);
-#else
- addrp = addr + WIDTH_MUL(y1_or_e1, nwidth) + x1_or_len;
-#endif
-#else /* !POLYSEGMENT */
-#ifdef EITHER_MODE
- if (!mode)
-#endif /* EITHER_MODE */
-#ifndef ORIGIN
- {
- /* CoordModePrevious */
- _x1 = _x2;
- _y1 = _y2;
- c2 = *ppt++;
- intToCoord(c2, _x2, _y2);
- _x2 = _x1 + _x2;
- _y2 = _y1 + _y2;
-
-#ifdef BUGFIX_clip
- if (_x2 < ex_x1 || _x2 >= ex_x2 ||
- _y2 < ex_y1 || _y2 >= ex_y2)
-#else
- if (_x2 < extents_x1 || _x2 >= extents_x2 ||
- _y2 < extents_y1 || _y2 >= extents_y2)
-#endif
- {
- break;
- }
- CalcLineDeltas(_x1, _y1, _x2, _y2, x1_or_len, y1_or_e1,
- stepmajor, stepminor, 1, NWIDTH(nwidth), octant);
- }
-#endif /* !ORIGIN */
-#ifdef EITHER_MODE
- else
-#endif /* EITHER_MODE */
-#ifndef PREVIOUS
- {
-#ifndef SAVE_X2Y2
- y1_or_e1 = c2;
-#else
- y1_or_e1 = y2;
- x1_or_len = x2;
-#endif /* SAVE_X2Y2 */
- c2 = *ppt++;
-
- if (isClipped (c2, upperleft, lowerright))
- break;
-#ifdef SAVE_X2Y2
- intToCoord(c2,x2,y2);
-#endif
- CalcLineDeltas(X1, Y1, X2, Y2, x1_or_len, y1_or_e1,
- stepmajor, stepminor, 1, NWIDTH(nwidth), octant);
- }
-#endif /* !PREVIOUS */
-#endif /* POLYSEGMENT */
-
-#ifdef POLYSEGMENT
- CalcLineDeltas(X1, Y1, X2, Y2, x1_or_len, y1_or_e1,
- stepmajor, stepminor, 1, NWIDTH(nwidth), octant);
- /*
- * although the horizontal code works for polyline, it
- * slows down 10 pixel lines by 15%. Thus, this
- * code is optimized for horizontal segments and
- * random orientation lines, which seems like a reasonable
- * assumption
- */
- if (y1_or_e1 != 0)
- {
-#endif /* POLYSEGMENT */
- if (x1_or_len < y1_or_e1)
- {
-#ifdef REARRANGE
- register int e3;
-#endif
-
- e3 = x1_or_len;
- x1_or_len = y1_or_e1;
- y1_or_e1 = e3;
-
- e3 = stepminor;
- stepminor = stepmajor;
- stepmajor = e3;
- SetYMajorOctant(octant);
- }
-
- e = -x1_or_len;
-#ifdef POLYSEGMENT
- if (!capStyle)
- x1_or_len--;
-#endif
-
- {
-#ifdef REARRANGE
- register int e3;
- RROP_DECLARE
- RROP_FETCH_GCPRIV(devPriv);
-#endif
-
- y1_or_e1 = y1_or_e1 << 1;
- e3 = e << 1;
-
- FIXUP_ERROR(e, octant, bias);
-
-#if PSZ == 24
- if (stepmajor == 1 || stepmajor == -1){
- stepmajor3 = stepmajor * 3;
- stepminor3 = stepminor * sizeof (CfbBits);
- majordx = stepmajor; minordx = 0;
- } else {
- stepmajor3 = stepmajor * sizeof (CfbBits);
- stepminor3 = stepminor * 3;
- majordx = 0; minordx = stepminor;
- }
-#endif
-
-#if PSZ == 24
-#define body {\
- body_rop \
- addrb += stepmajor3; \
- xOffset += majordx; \
- e += y1_or_e1; \
- if (e >= 0){ \
- addrb += stepminor3; \
- xOffset += minordx; \
- e += e3; \
- } \
- }
-#else /* PSZ == 24 */
-
-#define body {\
- RROP_SOLID(addrp); \
- addrp += stepmajor; \
- e += y1_or_e1; \
- if (e >= 0) \
- { \
- addrp += stepminor; \
- e += e3; \
- } \
- }
-#endif /* PSZ == 24 */
-
-#ifdef LARGE_INSTRUCTION_CACHE
-
-# ifdef SERIOUS_UNROLLING
-# define UNROLL 16
-# else
-# define UNROLL 4
-# endif
-#define CASE(n) case -n: body
-
- while ((x1_or_len -= UNROLL) >= 0)
- {
- body body body body
-# if UNROLL >= 8
- body body body body
-# endif
-# if UNROLL >= 12
- body body body body
-# endif
-# if UNROLL >= 16
- body body body body
-# endif
- }
- switch (x1_or_len)
- {
- CASE(1) CASE(2) CASE(3)
-# if UNROLL >= 8
- CASE(4) CASE(5) CASE(6) CASE(7)
-# endif
-# if UNROLL >= 12
- CASE(8) CASE(9) CASE(10) CASE(11)
-# endif
-# if UNROLL >= 16
- CASE(12) CASE(13) CASE(14) CASE(15)
-# endif
- }
-#else /* !LARGE_INSTRUCTION_CACHE */
-
- IMPORTANT_START
- IMPORTANT_START
-
- if (x1_or_len & 1)
- body
- x1_or_len >>= 1;
- while (x1_or_len--) {
- body body
- }
-
- IMPORTANT_END
- IMPORTANT_END
-#endif /* LARGE_INSTRUCTION_CACHE */
-
-#ifdef POLYSEGMENT
-#if PSZ == 24
- body_rop
-#else
- RROP_SOLID(addrp);
-#endif
-#endif
-#if PSZ == 24
- addrp = (PixelType *)((unsigned long)addrb & ~0x03);
-#endif
- }
-#undef body
-#ifdef POLYSEGMENT
- }
- else /* Polysegment horizontal line optimization */
- {
-# ifdef REARRANGE
- register int e3;
- RROP_DECLARE
- RROP_FETCH_GCPRIV(devPriv);
-# endif /* REARRANGE */
- if (stepmajor < 0)
- {
-#if PSZ == 24
- xOffset -= x1_or_len;
- addrp = addrLineEnd + PXL2ADR(xOffset);
-#else
- addrp -= x1_or_len;
-#endif
- if (capStyle)
- x1_or_len++;
- else
-#if PSZ == 24
- xOffset++;
- addrp = addrLineEnd + PXL2ADR(xOffset);
-#else
- addrp++;
-#endif
- }
- else
- {
-#if PSZ == 24
- addrp = addrLineEnd + PXL2ADR(xOffset);
-#endif
- if (capStyle)
- x1_or_len++;
- }
-# if PSZ == 24
- y1_or_e1 = xOffset & 3;
-# else
-# if PGSZ == 64 /* PIM value from <cfbmskbits.h> is not it! (for 16/32 PSZ)*/
- y1_or_e1 = ((long) addrp) & 0x7;
- addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1);
-# else
- y1_or_e1 = ((long) addrp) & PIM;
- addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1);
-# endif
-#if PGSZ == 32
-# if PWSH != 2
- y1_or_e1 >>= (2 - PWSH);
-# endif
-#else /* PGSZ == 64 */
-# if PWSH != 3
- y1_or_e1 >>= (3 - PWSH);
-# endif
-#endif /* PGSZ */
-# endif /* PSZ == 24 */
-#if PSZ == 24
- {
-#if RROP == GXcopy
- register int nlmiddle;
- int leftIndex = xOffset & 3;
- int rightIndex = (xOffset + x1_or_len) & 3;
-#else
- register int pidx;
-#endif
-
-#if RROP == GXcopy
- nlmiddle = x1_or_len;
- if(leftIndex){
- nlmiddle -= (4 - leftIndex);
- }
- if(rightIndex){
- nlmiddle -= rightIndex;
- }
-
- nlmiddle >>= 2;
- switch(leftIndex+x1_or_len){
- case 4:
- switch(leftIndex){
- case 0:
- *addrp++ = piQxelXor[0];
- *addrp++ = piQxelXor[1];
- *addrp = piQxelXor[2];
- break;
- case 1:
- *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrp++;
- *addrp = piQxelXor[1];
- addrp++;
- *addrp = piQxelXor[2];
- break;
- case 2:
- *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- addrp++;
- *addrp = piQxelXor[2];
- break;
- case 3:
- *addrp = ((*addrp) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
- *addrp++ = piQxelXor[0];
- *addrp++ = piQxelXor[1];
- *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
- case 1:
- *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrp++;
- *addrp = piQxelXor[1];
- addrp++;
- *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
- case 2:
- *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- addrp++;
- *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
- }
- break;
- case 2:
- switch(leftIndex){
-/*
- case 2:
- *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- addrp++;
- *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
-*/
- case 1:
- *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrp++;
- *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- break;
- case 0:
- *addrp++ = piQxelXor[0];
- *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- break;
- }
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
- if(x1_or_len){
- *addrp = ((*addrp) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
- }
-/*
- else{
- *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrp++;
- *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- }
-*/
- break;
- case 0: /*never*/
- break;
- default:
- {
-/*
- maskbits(y1_or_e1, x1_or_len, e, e3, x1_or_len)
-*/
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrp++;
- *addrp = piQxelXor[1];
- addrp++;
- *addrp = piQxelXor[2];
- addrp++;
- break;
- case 2:
- *addrp = ((*addrp) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- addrp++;
- *addrp = piQxelXor[2];
- addrp++;
- break;
- case 3:
- *addrp = ((*addrp) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
- addrp++;
- break;
- }
- while(nlmiddle--){
- *addrp++ = piQxelXor[0];
- *addrp++ = piQxelXor[1];
- *addrp++ = piQxelXor[2];
- }
- switch(rightIndex++){
- case 0:
- break;
- case 1:
- *addrp = ((*addrp) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
- break;
- case 2:
- *addrp++ = piQxelXor[0];
- *addrp = ((*addrp) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- break;
- case 3:
- *addrp++ = piQxelXor[0];
- *addrp++ = piQxelXor[1];
- *addrp = ((*addrp) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
- }
-/*
- if (e3){
- e3 &= 0xFFFFFF;
- switch(rightIndex&3){
- case 0:
- *addrp = ((*addrp) & (0xFF000000 | ~e3))
- | (piQxelXor[0] & 0xFFFFFF & e3);
- break;
- case 1:
- *addrp = ((*addrp) & (0xFFFFFF | ~(e3<<24)))
- + (piQxelXor[0] & 0xFF000000 & (e3<<24));
- addrp++;
- *addrp = ((*addrp) & (0xFFFF0000|~(e3 >> 8)))
- | (piQxelXor[1] & 0xFFFF & (e3 >> 8));
- break;
- case 2:
- *addrp = ((*addrp) & (0xFFFF|~(e3 << 16)))
- | (piQxelXor[1] & 0xFFFF0000 & (e3 << 16));
- addrp++;
- *addrp = ((*addrp) & (0xFFFFFF00|~(e3>>16)))
- | (piQxelXor[2] & 0xFF & (e3 >> 16));
- break;
- case 3:
- *addrp = ((*addrp) & (0xFF|~(e3<<8)))
- | (piQxelXor[2] & 0xFFFFFF00 & (e3<<8));
- addrp++;
- break;
- }
- }
-*/
- }
- }
-#else /* GXcopy */
- addrp = (PixelType *)((char *)addrLineEnd + ((xOffset * 3) & ~0x03));
- if (x1_or_len <= 1){
- if (x1_or_len)
- RROP_SOLID24(addrp, xOffset);
- } else {
- maskbits(xOffset, x1_or_len, e, e3, x1_or_len);
- pidx = xOffset & 3;
- if (e){
- RROP_SOLID_MASK(addrp, e, pidx-1);
- addrp++;
- if (pidx == 3)
- pidx = 0;
- }
- while (--x1_or_len >= 0){
- RROP_SOLID(addrp, pidx);
- addrp++;
- if (++pidx == 3)
- pidx = 0;
- }
- if (e3)
- RROP_SOLID_MASK(addrp, e3, pidx);
- }
-#endif /* GXcopy */
- }
-#else /* PSZ == 24 */
- if (y1_or_e1 + x1_or_len <= PPW)
- {
- if (x1_or_len)
- {
- maskpartialbits(y1_or_e1, x1_or_len, e)
- RROP_SOLID_MASK((CfbBits *) addrp, e);
- }
- }
- else
- {
- maskbits(y1_or_e1, x1_or_len, e, e3, x1_or_len)
- if (e)
- {
- RROP_SOLID_MASK((CfbBits *) addrp, e);
- addrp += PPW;
- }
- RROP_SPAN(addrp, x1_or_len)
- if (e3)
- RROP_SOLID_MASK((CfbBits *) addrp, e3);
- }
-#endif /* PSZ == 24 */
- }
-#endif /* POLYSEGMENT */
- }
-#ifdef POLYSEGMENT
- if (nseg >= 0)
- return (xSegment *) ppt - pSegInit;
-#else
- if (npt)
- {
-#ifdef EITHER_MODE
- if (!mode)
-#endif /* EITHER_MODE */
-#ifndef ORIGIN
- {
- *x1p = _x1;
- *y1p = _y1;
- *x2p = _x2;
- *y2p = _y2;
- }
-#endif /* !ORIGIN */
- return ((DDXPointPtr) ppt - pptInit) - 1;
- }
-
-# ifndef ORIGIN
-# define C2 c2
-# else
-# define C2 ppt[-1]
-# endif
-#ifdef EITHER_MODE
- if (pGC->capStyle != CapNotLast &&
- ((mode ? (C2 != *((int *) pptInitOrig))
- : ((_x2 != pptInitOrig->x) ||
- (_y2 != pptInitOrig->y)))
- || (ppt == ((int *)pptInitOrig) + 2)))
-#endif /* EITHER_MODE */
-#ifdef PREVIOUS
- if (pGC->capStyle != CapNotLast &&
- ((_x2 != pptInitOrig->x) ||
- (_y2 != pptInitOrig->y) ||
- (ppt == ((int *)pptInitOrig) + 2)))
-#endif /* PREVIOUS */
-#ifdef ORIGIN
- if (pGC->capStyle != CapNotLast &&
- ((C2 != *((int *) pptInitOrig)) ||
- (ppt == ((int *)pptInitOrig) + 2)))
-#endif /* !PREVIOUS */
- {
-# ifdef REARRANGE
- RROP_DECLARE
-
- RROP_FETCH_GCPRIV(devPriv);
-# endif
-#if PSZ == 24
-#if RROP == GXcopy
- switch(xOffset & 3){
- case 0:
- *addrp = ((*addrp)&0xFF000000)|(piQxelXor[0] & 0xFFFFFF);
- break;
- case 3:
- *addrp = ((*addrp)&0xFF)|(piQxelXor[2] & 0xFFFFFF00);
- break;
- case 1:
- *addrp = ((*addrp)&0xFFFFFF)|(piQxelXor[0] & 0xFF000000);
- *(addrp+1) = ((*(addrp+1))&0xFFFF0000)|(piQxelXor[1] & 0xFFFF);
- break;
- case 2:
- *addrp = ((*addrp)&0xFFFF)|(piQxelXor[1] & 0xFFFF0000);
- *(addrp+1) = ((*(addrp+1))&0xFFFFFF00)|(piQxelXor[2] & 0xFF);
- break;
- }
-#endif
-#if RROP == GXxor
- switch(xOffset & 3){
- case 0:
- *addrp ^= (piQxelXor[0] & 0xFFFFFF);
- break;
- case 3:
- *addrp ^= (piQxelXor[2] & 0xFFFFFF00);
- break;
- case 1:
- *addrp ^= (piQxelXor[0] & 0xFF000000);
- *(addrp+1) ^= (piQxelXor[1] & 0xFFFF);
- break;
- case 2:
- *addrp ^= (piQxelXor[1] & 0xFFFF0000);
- *(addrp+1) ^= (piQxelXor[2] & 0xFF);
- break;
- }
-#endif
-#if RROP == GXand
- switch(xOffset & 3){
- case 0:
- *addrp &= (piQxelAnd[0] | 0xFF000000);
- break;
- case 3:
- *addrp &= (piQxelAnd[2] | 0xFF);
- break;
- case 1:
- *addrp &= (0xFFFFFF|piQxelAnd[0]);
- *(addrp+1) &= (0xFFFF0000|piQxelAnd[1]);
- break;
- case 2:
- *addrp &= (0xFFFF|piQxelAnd[1]);
- *(addrp+1) &= (0xFFFFFF00|piQxelAnd[2]);
- break;
- }
-#endif
-#if RROP == GXor
- switch(xOffset & 3){
- case 0:
- *addrp |= (piQxelOr[0] & 0xFFFFFF);
- break;
- case 3:
- *addrp |= (piQxelOr[2] & 0xFFFFFF00);
- break;
- case 1:
- *addrp |= (piQxelOr[0] & 0xFF000000);
- *(addrp+1) |= (piQxelOr[1] & 0xFFFF);
- break;
- case 2:
- *addrp |= (piQxelOr[1] & 0xFFFF0000);
- *(addrp+1) |= (piQxelOr[2] & 0xFF);
- break;
- }
-#endif
-#if RROP == GXset
- switch(xOffset & 3){
- case 0:
- *addrp = (((*addrp)&(piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF));
- break;
- case 3:
- *addrp = (((*addrp)&(piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00));
- break;
- case 1:
- *addrp = (((*addrp)&(piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000));
- *(addrp+1) = (((*(addrp+1))&(piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF));
- break;
- case 2:
- *addrp = (((*addrp)&(piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000));
- *(addrp+1) = (((*(addrp+1))&(piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF));
- break;
- }
-#endif
-#else
- RROP_SOLID (addrp);
-# endif
- }
-#endif /* !POLYSEGMENT */
- RROP_UNDECLARE;
- return -1;
-}
-
-#endif /* INCLUDE_DRAW */
-
-
-#ifdef INCLUDE_OTHERS
-
-#ifdef POLYSEGMENT
-
-void
-cfb8SegmentSS1Rect (pDrawable, pGC, nseg, pSegInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- xSegment *pSegInit;
-{
- int (*func)(DrawablePtr, GCPtr, int, xSegment *);
- void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool);
- int drawn;
- cfbPrivGCPtr devPriv;
-
-#if defined(__arm32__) && PSZ != 8
- /* XXX -JJK */
- /* There is a painting bug when PSZ != 8; I need to track it down! */
- cfbSegmentSS(pDrawable, pGC, nseg, pSegInit);
- return;
-#endif
-
- devPriv = cfbGetGCPrivate(pGC);
-#ifdef NO_ONE_RECT
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
- {
- cfbSegmentSS(pDrawable, pGC, nseg, pSegInit);
- return;
- }
-#endif
- switch (devPriv->rop)
- {
- case GXcopy:
- func = cfb8SegmentSS1RectCopy;
- clip = cfb8ClippedLineCopy;
-#ifdef FAST_MUL
- if (cfbGetPixelWidth (pDrawable) == WIDTH_FAST)
- func = cfb8SegmentSS1RectShiftCopy;
-#endif
- break;
- case GXxor:
- func = cfb8SegmentSS1RectXor;
- clip = cfb8ClippedLineXor;
- break;
- default:
- func = cfb8SegmentSS1RectGeneral;
- clip = cfb8ClippedLineGeneral;
- break;
- }
- while (nseg)
- {
- drawn = (*func) (pDrawable, pGC, nseg, pSegInit);
- if (drawn == -1)
- break;
- (*clip) (pDrawable, pGC,
- pSegInit[drawn-1].x1, pSegInit[drawn-1].y1,
- pSegInit[drawn-1].x2, pSegInit[drawn-1].y2,
- &pGC->pCompositeClip->extents,
- pGC->capStyle == CapNotLast);
- pSegInit += drawn;
- nseg -= drawn;
- }
-}
-
-#else /* POLYSEGMENT */
-
-void
-cfb8LineSS1Rect (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- DDXPointPtr pptInit;
-{
- int (*func)(DrawablePtr, GCPtr, int, int,
- DDXPointPtr, DDXPointPtr,
- int *, int *, int *, int *);
- void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool);
- int drawn;
- cfbPrivGCPtr devPriv;
- int x1, y1, x2, y2;
- DDXPointPtr pptInitOrig = pptInit;
-
-#if defined(__arm32__) && PSZ != 8
- /* XXX -JJK */
- /* There is a painting bug when PSZ != 8; I need to track it down! */
- cfbLineSS(pDrawable, pGC, mode, npt, pptInit);
- return;
-#endif
-
- devPriv = cfbGetGCPrivate(pGC);
-#ifdef NO_ONE_RECT
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
- {
- cfbLineSS(pDrawable, pGC, mode, npt, pptInit);
- return;
- }
-#endif
- switch (devPriv->rop)
- {
- case GXcopy:
- func = cfb8LineSS1RectCopy;
- clip = cfb8ClippedLineCopy;
- if (mode == CoordModePrevious)
- func = cfb8LineSS1RectPreviousCopy;
- break;
- case GXxor:
- func = cfb8LineSS1RectXor;
- clip = cfb8ClippedLineXor;
- break;
- default:
- func = cfb8LineSS1RectGeneral;
- clip = cfb8ClippedLineGeneral;
- break;
- }
- if (mode == CoordModePrevious)
- {
- x1 = pptInit->x;
- y1 = pptInit->y;
- while (npt > 1)
- {
- drawn = (*func) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
- &x1, &y1, &x2, &y2);
- if (drawn == -1)
- break;
- (*clip) (pDrawable, pGC, x1, y1, x2, y2,
- &pGC->pCompositeClip->extents,
- drawn != npt - 1 || pGC->capStyle == CapNotLast);
- pptInit += drawn;
- npt -= drawn;
- x1 = x2;
- y1 = y2;
- }
- }
- else
- {
- while (npt > 1)
- {
- drawn = (*func) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
- &x1, &y1, &x2, &y2);
- if (drawn == -1)
- break;
- (*clip) (pDrawable, pGC,
- pptInit[drawn-1].x, pptInit[drawn-1].y,
- pptInit[drawn].x, pptInit[drawn].y,
- &pGC->pCompositeClip->extents,
- drawn != npt - 1 || pGC->capStyle == CapNotLast);
- pptInit += drawn;
- npt -= drawn;
- }
- }
-}
-
-#endif /* else POLYSEGMENT */
-#endif /* INCLUDE_OTHERS */
-
-#if !defined(POLYSEGMENT) && !defined (PREVIOUS)
-
-void
-RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x1, y1, x2, y2;
- BoxPtr boxp;
- Bool shorten;
-{
- int oc1, oc2;
- int e, e1, e3, len;
- int adx, ady;
-
- PixelType *addr;
- int nwidth;
- int stepx, stepy;
- int xorg, yorg;
- int new_x1, new_y1, new_x2, new_y2;
- Bool pt1_clipped, pt2_clipped;
- int changex, changey, result;
-#if PSZ == 24
- PixelType *addrLineEnd;
- char *addrb;
- int stepx3, stepy3;
-#endif
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- cfbGetPixelWidthAndPointer(pDrawable, nwidth, addr);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- x1 += xorg;
- y1 += yorg;
- x2 += xorg;
- y2 += yorg;
- oc1 = 0;
- oc2 = 0;
- OUTCODES (oc1, x1, y1, boxp);
- OUTCODES (oc2, x2, y2, boxp);
-
- if (oc1 & oc2)
- return;
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, stepx, stepy, 1, nwidth, octant);
-
- if (adx <= ady)
- {
- int t;
-
- t = adx;
- adx = ady;
- ady = t;
-
- t = stepx;
- stepx = stepy;
- stepy = t;
-
- SetYMajorOctant(octant);
- }
- e = - adx;
- e1 = ady << 1;
- e3 = - (adx << 1);
-
- FIXUP_ERROR(e, octant, bias);
-
- new_x1 = x1;
- new_y1 = y1;
- new_x2 = x2;
- new_y2 = y2;
- pt1_clipped = 0;
- pt2_clipped = 0;
-
- if (IsXMajorOctant(octant))
- {
- result = miZeroClipLine(boxp->x1, boxp->y1, boxp->x2 - 1, boxp->y2 - 1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady,
- &pt1_clipped, &pt2_clipped,
- octant, bias, oc1, oc2);
- if (result == -1)
- return;
-
- len = abs(new_x2 - new_x1) - 1; /* this routine needs the "-1" */
-
- /* if we've clipped the endpoint, always draw the full length
- * of the segment, because then the capstyle doesn't matter
- * if x2,y2 isn't clipped, use the capstyle
- * (shorten == TRUE <--> CapNotLast)
- */
- if (pt2_clipped || !shorten)
- len++;
-
- if (pt1_clipped)
- {
- /* must calculate new error terms */
- changex = abs(new_x1 - x1);
- changey = abs(new_y1 - y1);
- e = e + changey * e3 + changex * e1;
- }
- }
- else /* Y_AXIS */
- {
- result = miZeroClipLine(boxp->x1, boxp->y1, boxp->x2 - 1, boxp->y2 - 1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- ady, adx,
- &pt1_clipped, &pt2_clipped,
- octant, bias, oc1, oc2);
- if (result == -1)
- return;
-
- len = abs(new_y2 - new_y1) - 1; /* this routine needs the "-1" */
-
- /* if we've clipped the endpoint, always draw the full length
- * of the segment, because then the capstyle doesn't matter
- * if x2,y2 isn't clipped, use the capstyle
- * (shorten == TRUE <--> CapNotLast)
- */
- if (pt2_clipped || !shorten)
- len++;
-
- if (pt1_clipped)
- {
- /* must calculate new error terms */
- changex = abs(new_x1 - x1);
- changey = abs(new_y1 - y1);
- e = e + changex * e3 + changey * e1;
- }
- }
- x1 = new_x1;
- y1 = new_y1;
- {
- register PixelType *addrp;
- RROP_DECLARE
-
- RROP_FETCH_GC(pGC);
-
-#if PSZ == 24
- addrLineEnd = addr + (y1 * nwidth);
- addrb = (char *)addrLineEnd + x1 * 3;
- if (stepx == 1 || stepx == -1){
- stepx3 = stepx * 3;
- stepy3 = stepy * sizeof (CfbBits);
- } else {
- stepx3 = stepx * sizeof (CfbBits);
- stepy3 = stepy * 3;
- }
-#else
- addrp = addr + (y1 * nwidth) + x1;
-#endif
-
-#ifndef REARRANGE
- if (!ady)
- {
-#if PSZ == 24
-#define body {\
- body_rop \
- addrb += stepx3; \
- }
-#else
-#define body { RROP_SOLID(addrp); addrp += stepx; }
-#endif
- while (len >= PGSZB)
- {
- body body body body
-#if PGSZ == 64
- body body body body
-#endif
- len -= PGSZB;
- }
- switch (len)
- {
-#if PGSZ == 64
- case 7: body case 6: body case 5: body case 4: body
-#endif
- case 3: body case 2: body case 1: body
- }
-#undef body
- }
- else
-#endif /* !REARRANGE */
- {
-#if PSZ == 24
-#define body {\
- body_rop \
- addrb += stepx3; \
- e += e1; \
- if (e >= 0) \
- { \
- addrb += stepy3; \
- e += e3; \
- } \
- }
-#else
-#define body {\
- RROP_SOLID(addrp); \
- addrp += stepx; \
- e += e1; \
- if (e >= 0) \
- { \
- addrp += stepy; \
- e += e3; \
- } \
- }
-#endif
-
-#ifdef LARGE_INSTRUCTION_CACHE
- while ((len -= PGSZB) >= 0)
- {
- body body body body
-#if PGSZ == 64
- body body body body
-#endif
- }
- switch (len)
- {
- case -1: body case -2: body case -3: body
-#if PGSZ == 64
- case -4: body case -5: body case -6: body case -7: body
-#endif
- }
-#else /* !LARGE_INSTRUCTION_CACHE */
- IMPORTANT_START;
-
- while ((len -= 2) >= 0)
- {
- body body;
- }
- if (len & 1)
- body;
-
- IMPORTANT_END;
-#endif /* LARGE_INSTRUCTION_CACHE */
- }
-#if PSZ == 24
- body_rop
-#else
- RROP_SOLID(addrp);
-#endif
-#undef body
- RROP_UNDECLARE
- }
-}
-
-#endif /* !POLYSEGMENT && !PREVIOUS */
-#endif /* PIXEL_ADDR */
diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c
deleted file mode 100644
index 6c2fa30f3..000000000
--- a/cfb/cfballpriv.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * $Xorg: cfballpriv.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $
- *
-Copyright 1991, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfballpriv.c,v 1.12 2001/12/14 19:59:21 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "cfb.h"
-#include "mi.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "cfbmskbits.h"
-#include "mibstore.h"
-
-#if PSZ==8
-int cfbWindowPrivateIndex;
-int cfbGCPrivateIndex;
-#endif
-#ifdef CFB_NEED_SCREEN_PRIVATE
-int cfbScreenPrivateIndex = -1;
-static unsigned long cfbGeneration = 0;
-#endif
-
-
-Bool
-cfbAllocatePrivates(pScreen, window_index, gc_index)
- ScreenPtr pScreen;
- int *window_index, *gc_index;
-{
- if (!window_index || !gc_index ||
- (*window_index == -1 && *gc_index == -1))
- {
- if (!mfbAllocatePrivates(pScreen,
- &cfbWindowPrivateIndex, &cfbGCPrivateIndex))
- return FALSE;
- if (window_index)
- *window_index = cfbWindowPrivateIndex;
- if (gc_index)
- *gc_index = cfbGCPrivateIndex;
- }
- else
- {
- cfbWindowPrivateIndex = *window_index;
- cfbGCPrivateIndex = *gc_index;
- }
- if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex,
- sizeof(cfbPrivWin)) ||
- !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
- return FALSE;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- if (cfbGeneration != serverGeneration)
- {
- cfbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- cfbGeneration = serverGeneration;
- }
- if (cfbScreenPrivateIndex == -1)
- return FALSE;
-#endif
- return TRUE;
-}
diff --git a/cfb/cfbbitblt.c b/cfb/cfbbitblt.c
deleted file mode 100644
index 18f90f1fd..000000000
--- a/cfb/cfbbitblt.c
+++ /dev/null
@@ -1,1450 +0,0 @@
-/*
- * cfb copy area
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.20 2003/11/10 18:21:44 tsi Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Keith Packard
-
-*/
-/* $Xorg: cfbbitblt.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "mi.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-#include "fastblt.h"
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-#if PSZ == 8
-#define cfbCopyPlane1toN cfbCopyPlane1to8
-#define cfbCopyPlaneNto1 cfbCopyPlane8to1
-#else
-static unsigned int FgPixel, BgPixel;
-# if PSZ == 16
-#define cfbCopyPlane1toN cfbCopyPlane1to16
-#define cfbCopyPlaneNto1 cfbCopyPlane16to1
-# endif
-# if PSZ == 24
-#define cfbCopyPlane1toN cfbCopyPlane1to24
-#define cfbCopyPlaneNto1 cfbCopyPlane24to1
-# endif
-# if PSZ == 32
-#define cfbCopyPlane1toN cfbCopyPlane1to32
-#define cfbCopyPlaneNto1 cfbCopyPlane32to1
-# endif
-#endif
-
-/* cfbBitBltcfb == cfbCopyPlaneExpand */
-RegionPtr
-cfbBitBlt (
- register DrawablePtr pSrcDrawable,
- register DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- void (*doBitBlt)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/),
- unsigned long bitPlane)
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = cfbGetCompositeClip(pGC);
- }
- else
- {
- fastClip = 1;
- }
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- /*
- * XFree86 DDX empties the border clip when the
- * VT is inactive
- */
- if (!((WindowPtr) pSrcDrawable)->parent &&
- REGION_NOTEMPTY (pSrcDrawable->pScreen,
- &((WindowPtr) pSrcDrawable)->borderClip))
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = cfbGetCompositeClip(pGC);
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip)
- {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x)
- {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y)
- {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- if (!((WindowPtr)pDstDrawable)->realized)
- {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip)
- {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
-
- /* XXX because CopyPlane uses this routine for 8-to-1 bit
- * copies, this next line *must* also correctly fetch the
- * composite clip from an mfb gc
- */
-
- cclip = cfbGetCompositeClip(pGC);
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
- }
- }
- else
- {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst,
- &rgnDst,
- cfbGetCompositeClip(pGC));
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height)
- {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask);
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose)
- {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed =
- miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, bitPlane);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-
-RegionPtr
-cfbCopyPlaneReduce (
- register DrawablePtr pSrcDrawable,
- register DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- void (*doCopyPlane)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/),
- unsigned long bitPlane)
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = cfbGetCompositeClip(pGC);
- }
- else
- {
- fastClip = 1;
- }
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- /*
- * XFree86 DDX empties the border clip when the
- * VT is inactive
- */
- if (!((WindowPtr) pSrcDrawable)->parent &&
- REGION_NOTEMPTY (pSrcDrawable->pScreen,
- &((WindowPtr) pSrcDrawable)->borderClip))
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = cfbGetCompositeClip(pGC);
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip)
- {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x)
- {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y)
- {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- if (!((WindowPtr)pDstDrawable)->realized)
- {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip)
- {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
-
- /* XXX because CopyPlane uses this routine for 8-to-1 bit
- * copies, this next line *must* also correctly fetch the
- * composite clip from an mfb gc
- */
-
- cclip = cfbGetCompositeClip(pGC);
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst,
- &rgnDst,
- cfbGetCompositeClip(pGC));
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height)
- {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane);
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose)
- {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed =
- miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, bitPlane);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-
-void
-cfbDoBitblt (pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- void (*doBitBlt)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/)
- = cfbDoBitbltGeneral;
-
- if ((planemask & PMSK) == PMSK) {
- switch (alu) {
- case GXcopy:
- doBitBlt = cfbDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = cfbDoBitbltXor;
- break;
- case GXor:
- doBitBlt = cfbDoBitbltOr;
- break;
- }
- }
- (*doBitBlt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask);
-}
-
-RegionPtr
-cfbCopyArea(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
-{
- void (*doBitBlt) (
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/);
-
- doBitBlt = cfbDoBitbltCopy;
- if (pGC->alu != GXcopy || (pGC->planemask & PMSK) != PMSK)
- {
- doBitBlt = cfbDoBitbltGeneral;
- if ((pGC->planemask & PMSK) == PMSK)
- {
- switch (pGC->alu) {
- case GXxor:
- doBitBlt = cfbDoBitbltXor;
- break;
- case GXor:
- doBitBlt = cfbDoBitbltOr;
- break;
- }
- }
- }
- return cfbBitBlt (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, 0L);
-}
-
-#if PSZ == 8
-void
-cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
- DrawablePtr pSrcDrawable; /* must be a bitmap */
- DrawablePtr pDstDrawable; /* must be depth 8 drawable */
- int rop; /* not used; caller must call cfb8CheckOpaqueStipple
- * beforehand to get cfb8StippleRRop set correctly */
- RegionPtr prgnDst; /* region in destination to draw to;
- * screen relative coords. if dest is a window;
- * drawable relative if dest is a pixmap */
- DDXPointPtr pptSrc; /* drawable relative src coords to copy from;
- * must be one point for each box in prgnDst */
- unsigned long planemask; /* to apply to destination writes */
-{
- int srcx, srcy; /* upper left corner of box being copied in source */
- int dstx, dsty; /* upper left corner of box being copied in dest */
- int width, height; /* in pixels, unpadded, of box being copied */
- int xoffSrc; /* bit # in leftmost word of row from which copying starts */
- int xoffDst; /* byte # in leftmost word of row from which copying starts */
- CfbBits *psrcBase, *pdstBase; /* start of drawable's pixel data */
- int widthSrc; /* # of groups of 32 pixels (1 bit/pixel) in src bitmap*/
- int widthDst; /* # of groups of 4 pixels (8 bits/pixel) in dst */
- CfbBits *psrcLine, *pdstLine; /* steps a row at a time thru src/dst;
- * may point into middle of row */
- register CfbBits *psrc, *pdst; /* steps within the row */
- register CfbBits bits, tmp; /* bits from source */
- register int leftShift;
- register int rightShift;
- CfbBits startmask; /* left edge pixel mask */
- CfbBits endmask; /* right edge pixel mask */
- register int nlMiddle; /* number of words in middle of the row to draw */
- register int nl;
- int firstoff = 0;
- int secondoff = 0;
- CfbBits src;
- int nbox; /* number of boxes in region to copy */
- BoxPtr pbox; /* steps thru boxes in region */
- int pixelsRemainingOnRightEdge; /* # pixels to be drawn on a row after
- * the main "middle" loop */
-
- cfbGetLongWidthAndPointer (pSrcDrawable, widthSrc, psrcBase)
- cfbGetLongWidthAndPointer (pDstDrawable, widthDst, pdstBase)
-
- nbox = REGION_NUM_RECTS(prgnDst);
- pbox = REGION_RECTS(prgnDst);
- while (nbox--)
- {
- dstx = pbox->x1;
- dsty = pbox->y1;
- srcx = pptSrc->x;
- srcy = pptSrc->y;
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
- pbox++;
- pptSrc++;
-
- psrcLine = psrcBase + srcy * widthSrc + (srcx >> MFB_PWSH);
- pdstLine = pdstBase + dsty * widthDst + (dstx >> PWSH);
- xoffSrc = srcx & MFB_PIM; /* finds starting bit in src */
- xoffDst = dstx & PIM; /* finds starting byte in dst */
-
- /* compute startmask, endmask, nlMiddle */
-
- if (xoffDst + width < PPW) /* XXX should this be '<= PPW' ? */
- { /* the copy only affects one word per row in destination */
- maskpartialbits(dstx, width, startmask);
- endmask = 0; /* nothing on right edge */
- nlMiddle = 0; /* nothing in middle */
- }
- else
- { /* the copy will affect multiple words per row in destination */
- maskbits(dstx, width, startmask, endmask, nlMiddle);
- }
-
- /*
- * compute constants for the first four bits to be
- * copied. This avoids troubles with partial first
- * writes, and difficult shift computation
- */
- if (startmask)
- {
- firstoff = xoffSrc - xoffDst;
- if (firstoff > (MFB_PPW-PPW))
- secondoff = MFB_PPW - firstoff;
- if (xoffDst)
- {
- srcx += (PPW-xoffDst);
- xoffSrc = srcx & MFB_PIM;
- }
- }
- leftShift = xoffSrc;
- rightShift = MFB_PPW - leftShift;
-
- pixelsRemainingOnRightEdge = (nlMiddle & 7) * PPW +
- ((dstx + width) & PIM);
-
- /* setup is done; now let's move some bits */
-
- /* caller must call cfb8CheckOpaqueStipple before this function
- * to set cfb8StippleRRop!
- */
-
- if (cfb8StippleRRop == GXcopy)
- {
- while (height--)
- { /* one iteration of this loop copies one row */
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- bits = *psrc++;
- if (startmask)
- {
- if (firstoff < 0)
- tmp = BitRight (bits, -firstoff);
- else
- {
- tmp = BitLeft (bits, firstoff);
- /*
- * need a more cautious test for partialmask
- * case...
- */
- if (firstoff >= (MFB_PPW-PPW))
- {
- bits = *psrc++;
- if (firstoff != (MFB_PPW-PPW))
- tmp |= BitRight (bits, secondoff);
- }
- }
- *pdst = (*pdst & ~startmask) | (GetPixelGroup(tmp) & startmask);
- pdst++;
- }
- nl = nlMiddle;
- while (nl >= 8)
- {
- nl -= 8;
- tmp = BitLeft(bits, leftShift);
- bits = *psrc++;
- if (rightShift != MFB_PPW)
- tmp |= BitRight(bits, rightShift);
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-# define StorePixels(pdst,o,pixels) (pdst)[o] = (pixels)
-# define EndStep(pdst,o) (pdst) += (o)
-# define StoreRopPixels(pdst,o,and,xor) (pdst)[o] = DoRRop((pdst)[o],and,xor);
-#else
-# define StorePixels(pdst,o,pixels) *(pdst)++ = (pixels)
-# define EndStep(pdst,o)
-# define StoreRopPixels(pdst,o,and,xor) *(pdst) = DoRRop(*(pdst),and,xor); (pdst)++;
-#endif
-
-#define Step(c) NextBitGroup(c);
-#define StoreBitsPlain(o,c) StorePixels(pdst,o,GetPixelGroup(c))
-#define StoreRopBitsPlain(o,c) StoreRopPixels(pdst,o,\
- cfb8StippleAnd[GetBitGroup(c)], \
- cfb8StippleXor[GetBitGroup(c)])
-#define StoreBits0(c) StoreBitsPlain(0,c)
-#define StoreRopBits0(c) StoreRopBitsPlain(0,c)
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-# define StoreBits(o,c) StoreBitsPlain(o,c)
-# define StoreRopBits(o,c) StoreRopBitsPlain(o,c)
-# define FirstStep(c) Step(c)
-#else /* BITMAP_BIT_ORDER == LSBFirst */
-#if PGSZ == 64
-# define StoreBits(o,c) StorePixels(pdst,o, (cfb8Pixels[c & 0xff]))
-# define StoreRopBits(o,c) StoreRopPixels(pdst,o, \
- (cfb8StippleAnd[c & 0xff]), \
- (cfb8StippleXor[c & 0xff]))
-# define FirstStep(c) c = BitLeft (c, 8);
-#else
-/* 0x3c is 0xf << 2 (4 bits, long word) */
-# define StoreBits(o,c) StorePixels(pdst,o,*((CfbBits *)\
- (((char *) cfb8Pixels) + (c & 0x3c))))
-# define StoreRopBits(o,c) StoreRopPixels(pdst,o, \
- *((CfbBits *) (((char *) cfb8StippleAnd) + (c & 0x3c))), \
- *((CfbBits *) (((char *) cfb8StippleXor) + (c & 0x3c))))
-# define FirstStep(c) c = BitLeft (c, 2);
-#endif /* PGSZ */
-#endif /* BITMAP_BIT_ORDER */
-
- StoreBits0(tmp); FirstStep(tmp);
- StoreBits(1,tmp); Step(tmp);
- StoreBits(2,tmp); Step(tmp);
- StoreBits(3,tmp); Step(tmp);
- StoreBits(4,tmp); Step(tmp);
- StoreBits(5,tmp); Step(tmp);
- StoreBits(6,tmp); Step(tmp);
- StoreBits(7,tmp); EndStep (pdst,8);
- }
-
- /* do rest of middle and partial word on right edge */
-
- if (pixelsRemainingOnRightEdge)
- {
- tmp = BitLeft(bits, leftShift);
-
- if (pixelsRemainingOnRightEdge > rightShift)
- {
- bits = *psrc++;
- tmp |= BitRight (bits, rightShift);
- }
- EndStep (pdst, nl);
- switch (nl)
- {
- case 7:
- StoreBitsPlain(-7,tmp); Step(tmp);
- case 6:
- StoreBitsPlain(-6,tmp); Step(tmp);
- case 5:
- StoreBitsPlain(-5,tmp); Step(tmp);
- case 4:
- StoreBitsPlain(-4,tmp); Step(tmp);
- case 3:
- StoreBitsPlain(-3,tmp); Step(tmp);
- case 2:
- StoreBitsPlain(-2,tmp); Step(tmp);
- case 1:
- StoreBitsPlain(-1,tmp); Step(tmp);
- }
- if (endmask)
- *pdst = (*pdst & ~endmask) | (GetPixelGroup(tmp) & endmask);
- }
- }
- }
- else /* cfb8StippleRRop != GXcopy */
- {
- while (height--)
- { /* one iteration of this loop copies one row */
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- bits = *psrc++;
-
- /* do partial word on left edge */
-
- if (startmask)
- {
- if (firstoff < 0)
- tmp = BitRight (bits, -firstoff);
- else
- {
- tmp = BitLeft (bits, firstoff);
- if (firstoff >= (MFB_PPW-PPW))
- {
- bits = *psrc++;
- if (firstoff != (MFB_PPW-PPW))
- tmp |= BitRight (bits, secondoff);
- }
- }
- src = GetBitGroup(tmp);
- *pdst = MaskRRopPixels (*pdst, src, startmask);
- pdst++;
- }
-
- /* do middle of row */
-
- nl = nlMiddle;
- while (nl >= 8)
- {
- nl -= 8;
- tmp = BitLeft(bits, leftShift);
- bits = *psrc++;
- if (rightShift != MFB_PPW)
- tmp |= BitRight(bits, rightShift);
- StoreRopBits0(tmp); FirstStep(tmp);
- StoreRopBits(1,tmp); Step(tmp);
- StoreRopBits(2,tmp); Step(tmp);
- StoreRopBits(3,tmp); Step(tmp);
- StoreRopBits(4,tmp); Step(tmp);
- StoreRopBits(5,tmp); Step(tmp);
- StoreRopBits(6,tmp); Step(tmp);
- StoreRopBits(7,tmp); EndStep(pdst,8);
- }
-
- /* do rest of middle and partial word on right edge */
-
- if (pixelsRemainingOnRightEdge)
- {
- tmp = BitLeft(bits, leftShift);
-
- if (pixelsRemainingOnRightEdge > rightShift)
- {
- bits = *psrc++; /* XXX purify abr here */
- tmp |= BitRight (bits, rightShift);
- }
- while (nl--)
- {
- src = GetBitGroup (tmp);
- *pdst = RRopPixels (*pdst, src);
- pdst++;
- NextBitGroup(tmp);
- }
- if (endmask)
- {
- src = GetBitGroup (tmp);
- *pdst = MaskRRopPixels (*pdst, src, endmask);
- }
- }
- } /* end copy one row */
- } /* end alu is non-copy-mode case */
- } /* end iteration over region boxes */
-}
-
-#else /* PSZ == 8 */
-
-#define mfbmaskbits(x, w, startmask, endmask, nlw) \
- startmask = starttab[(x)&0x1f]; \
- endmask = endtab[((x)+(w)) & 0x1f]; \
- if (startmask) \
- nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \
- else \
- nlw = (w) >> 5;
-
-#define mfbmaskpartialbits(x, w, mask) \
- mask = partmasks[(x)&0x1f][(w)&0x1f];
-
-#define LeftMost 0
-#define StepBit(bit, inc) ((bit) += (inc))
-
-
-#define GetBits(psrc, nBits, curBit, bitPos, bits) {\
- bits = 0; \
- while (nBits--) \
- { \
- bits |= ((*psrc++ >> bitPos) & 1) << curBit; \
- StepBit (curBit, 1); \
- } \
-}
-
-/******************************************************************/
-
-static void
-#if PSZ == 16
-cfbCopyPlane1to16
-#endif
-#if PSZ == 24
-cfbCopyPlane1to24
-#endif
-#if PSZ == 32
-cfbCopyPlane1to32
-#endif
-(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask)
-{
- int srcx, srcy, dstx, dsty;
- int width, height;
- int xoffSrc;
- CfbBits *psrcBase, *pdstBase;
- int widthSrc, widthDst;
- unsigned int *psrcLine;
- register unsigned int *psrc;
-#if PSZ == 16
- unsigned short *pdstLine;
- register unsigned short *pdst;
-#endif
-#if PSZ == 32
- unsigned int *pdstLine;
- register unsigned int *pdst;
-#endif
-#if PSZ == 24
- unsigned char *pdstLine;
- register unsigned char *pdst;
-#endif
- register unsigned int bits, tmp;
- register unsigned int fgpixel, bgpixel;
- register unsigned int src;
-#if PSZ == 24
- register unsigned int dst;
-#endif
- register int leftShift, rightShift;
- register int i, nl;
- int nbox;
- BoxPtr pbox;
- int result;
-
-#if PSZ == 16
- unsigned int doublet[4]; /* Pixel values for 16bpp expansion. */
-#endif
-#if PSZ == 32
- unsigned int doublet[8]; /* Pixel values for 32bpp expansion */
-#endif
-
- fgpixel = FgPixel & planemask;
- bgpixel = BgPixel & planemask;
-
-#if PSZ == 16
- if (rop == GXcopy && (planemask & PMSK) == PMSK) {
- doublet[0] = bgpixel | (bgpixel << 16);
- doublet[1] = fgpixel | (bgpixel << 16);
- doublet[2] = bgpixel | (fgpixel << 16);
- doublet[3] = fgpixel | (fgpixel << 16);
- }
-#endif
-#if PSZ == 32
- if (rop == GXcopy && (planemask & PMSK) == PMSK) {
- doublet[0] = bgpixel; doublet[1] = bgpixel;
- doublet[2] = fgpixel; doublet[3] = bgpixel;
- doublet[4] = bgpixel; doublet[5] = fgpixel;
- doublet[6] = fgpixel; doublet[7] = fgpixel;
- }
-#endif
-
- /* must explicitly ask for "int" widths, as code below expects it */
- /* on some machines (Alpha), "long" and "int" are not the same size */
- cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits)
- cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits)
-
-#if PSZ == 16
- widthDst <<= 1;
-#endif
-#if PSZ == 24
- widthDst <<= 2;
-#endif
-
- nbox = REGION_NUM_RECTS(prgnDst);
- pbox = REGION_RECTS(prgnDst);
-
- while (nbox--)
- {
- dstx = pbox->x1;
- dsty = pbox->y1;
- srcx = pptSrc->x;
- srcy = pptSrc->y;
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
- pbox++;
- pptSrc++;
- psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + (srcx >> 5);
-#if PSZ == 16
- pdstLine = (unsigned short *)pdstBase + dsty * widthDst + dstx;
-#endif
-#if PSZ == 24
- pdstLine = (unsigned char *)pdstBase + dsty * widthDst + dstx * 3;
-#endif
-#if PSZ == 32
- pdstLine = (unsigned int *)pdstBase + dsty * widthDst + dstx;
-#endif
- xoffSrc = srcx & 0x1f;
-
- /*
- * compute constants for the first four bits to be
- * copied. This avoids troubles with partial first
- * writes, and difficult shift computation
- */
- leftShift = xoffSrc;
- rightShift = 32 - leftShift;
-
- if (rop == GXcopy && (planemask & PMSK) == PMSK)
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- bits = *psrc++;
- nl = width;
- while (nl >= 32)
- {
- tmp = BitLeft(bits, leftShift);
- bits = *psrc++;
- if (rightShift != 32)
- tmp |= BitRight(bits, rightShift);
- i = 0;
-#if PSZ == 16
- /*
- * I've thrown in some optimization to at least write
- * some aligned 32-bit words instead of 16-bit shorts.
- */
- if ((unsigned long)psrc & 2) {
- /* Write unaligned 16-bit word at left edge. */
- if (tmp & 0x01)
- *pdst = fgpixel;
- else
- *pdst = bgpixel;
- pdst++;
- i++;
- }
- while (i <= 24)
- {
- unsigned tmpbits = tmp >> i;
- *(unsigned int *)pdst = doublet[tmpbits & 0x03];
- *(unsigned int *)(pdst + 2) =
- doublet[(tmpbits >> 2) & 0x03];
- *(unsigned int *)(pdst + 4) =
- doublet[(tmpbits >> 4) & 0x03];
- *(unsigned int *)(pdst + 6) =
- doublet[(tmpbits >> 6) & 0x03];
- pdst += 8; /* Advance four 32-bit words. */
- i += 8;
- }
- while (i <= 30)
- {
- *(unsigned int *)pdst =
- doublet[(tmp >> i) & 0x03];
- pdst += 2; /* Advance one 32-bit word. */
- i += 2;
- }
- if (i == 31) {
- if ((tmp >> 31) & 0x01)
- *pdst = fgpixel;
- else
- *pdst = bgpixel;
- pdst++;
- }
-#endif
-#if PSZ == 24
- while (i < 32) {
- if ((tmp >> i) & 0x01) {
- *pdst = fgpixel;
- *(pdst + 1) = fgpixel >> 8;
- *(pdst + 2) = fgpixel >> 16;
- }
- else {
- *pdst = bgpixel;
- *(pdst + 1) = bgpixel >> 8;
- *(pdst + 2) = bgpixel >> 16;
- }
- pdst += 3;
- i++;
- }
-#endif
-#if PSZ == 32
- while (i <= 28) {
- int pair;
- pair = (tmp >> i) & 0x03;
- *pdst = doublet[pair * 2];
- *(pdst + 1) = doublet[pair * 2 + 1];
- pair = (tmp >> (i + 2)) & 0x03;
- *(pdst + 2) = doublet[pair * 2];
- *(pdst + 3) = doublet[pair * 2 + 1];
- pdst += 4;
- i += 4;
- }
- while (i < 32) {
- *pdst = ((tmp >> i) & 0x01) ? fgpixel : bgpixel;
- pdst++;
- i++;
- }
-#endif
- nl -= 32;
- }
-
- if (nl)
- {
- tmp = BitLeft(bits, leftShift);
- /*
- * better condition needed -- mustn't run
- * off the end of the source...
- */
- if (rightShift != 32)
- {
- bits = *psrc++;
- tmp |= BitRight (bits, rightShift);
- }
- i = 32;
- while (nl--)
- {
- --i;
-#if PSZ == 24
- if ((tmp >> (31 - i)) & 0x01) {
- *pdst = fgpixel;
- *(pdst + 1) = fgpixel >> 8;
- *(pdst + 2) = fgpixel >> 16;
- }
- else {
- *pdst = bgpixel;
- *(pdst + 1) = bgpixel >> 8;
- *(pdst + 2) = bgpixel >> 16;
- }
- pdst += 3;
-#else
- *pdst = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
- pdst++;
-#endif
- }
- }
- }
- }
- else
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- bits = *psrc++;
- nl = width;
- while (nl >= 32)
- {
- tmp = BitLeft(bits, leftShift);
- bits = *psrc++;
- if (rightShift != 32)
- tmp |= BitRight(bits, rightShift);
- i = 32;
- while (i--)
- {
- src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
-#if PSZ == 24
- dst = *pdst;
- dst |= (*(pdst + 1)) << 8;
- dst |= (*(pdst + 2)) << 16;
- DoRop (result, rop, src, dst);
- *pdst = (dst & ~planemask) |
- (result & planemask);
- *(pdst+1) = ((dst & ~planemask) >> 8) |
- ((result & planemask) >> 8);
- *(pdst+2) = ((dst & ~planemask) >> 16) |
- ((result & planemask) >> 16);
- pdst += 3;
-#else
- DoRop (result, rop, src, *pdst);
-
- *pdst = (*pdst & ~planemask) |
- (result & planemask);
- pdst++;
-#endif
- }
- nl -= 32;
- }
-
- if (nl)
- {
- tmp = BitLeft(bits, leftShift);
- /*
- * better condition needed -- mustn't run
- * off the end of the source...
- */
- if (rightShift != 32)
- {
- bits = *psrc++;
- tmp |= BitRight (bits, rightShift);
- }
- i = 32;
- while (nl--)
- {
- --i;
- src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
-#if PSZ == 24
- dst = *pdst;
- dst |= (*(pdst + 1)) << 8;
- dst |= (*(pdst + 2)) << 16;
- DoRop (result, rop, src, dst);
- *pdst = (dst & ~planemask) |
- (result & planemask);
- *(pdst+1) = ((dst & ~planemask) >> 8) |
- ((result & planemask) >> 8);
- *(pdst+2) = ((dst & ~planemask) >> 16) |
- ((result & planemask) >> 16);
- pdst += 3;
-#else
- DoRop (result, rop, src, *pdst);
-
- *pdst = (*pdst & ~planemask) |
- (result & planemask);
- pdst++;
-#endif
- }
- }
- }
- }
- }
-}
-
-#endif /* PSZ == 8 */
-
-/* shared among all different cfb depths through linker magic */
-
-RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GCPtr pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- unsigned long bitPlane;
-{
- RegionPtr ret;
-
-#if IMAGE_BYTE_ORDER == LSBFirst
-
- void (*doCopyPlaneExpand)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/);
-
- if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == PSZ)
- {
- if (bitPlane == 1)
- {
- doCopyPlaneExpand = cfbCopyPlane1toN;
-#if PSZ == 8
- cfb8CheckOpaqueStipple (pGC->alu,
- pGC->fgPixel, pGC->bgPixel,
- pGC->planemask);
-#else
- FgPixel = pGC->fgPixel;
- BgPixel = pGC->bgPixel;
-#endif
- ret = cfbCopyPlaneExpand (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doCopyPlaneExpand, bitPlane);
- }
- else
- ret = miHandleExposures (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- }
- else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == 1)
- {
- int oldalu;
-
- oldalu = pGC->alu;
- if ((pGC->fgPixel & 1) == 0 && (pGC->bgPixel&1) == 1)
- pGC->alu = InverseAlu[pGC->alu];
- else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))
- pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel);
- ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty,
- cfbCopyPlaneNto1, bitPlane);
- pGC->alu = oldalu;
- }
- else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == PSZ)
- {
- PixmapPtr pBitmap;
- ScreenPtr pScreen = pSrcDrawable->pScreen;
- GCPtr pGC1;
-
- pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1);
- if (!pBitmap)
- return NULL;
- pGC1 = GetScratchGC (1, pScreen);
- if (!pGC1)
- {
- (*pScreen->DestroyPixmap) (pBitmap);
- return NULL;
- }
- /*
- * don't need to set pGC->fgPixel,bgPixel as copyPlaneNto1
- * ignores pixel values, expecting the rop to "do the
- * right thing", which GXcopy will.
- */
- ValidateGC ((DrawablePtr) pBitmap, pGC1);
- /* no exposures here, scratch GC's don't get graphics expose */
- cfbCopyPlaneReduce(pSrcDrawable, (DrawablePtr) pBitmap,
- pGC1, srcx, srcy, width, height, 0, 0,
- cfbCopyPlaneNto1, bitPlane);
-#if PSZ == 8
- cfb8CheckOpaqueStipple (pGC->alu,
- pGC->fgPixel, pGC->bgPixel,
- pGC->planemask);
-#else
- FgPixel = pGC->fgPixel;
- BgPixel = pGC->bgPixel;
-#endif
- /* no exposures here, copy bits from inside a pixmap */
- cfbCopyPlaneExpand((DrawablePtr) pBitmap, pDstDrawable, pGC,
- 0, 0, width, height, dstx, dsty, cfbCopyPlane1toN, 1);
- FreeScratchGC (pGC1);
- (*pScreen->DestroyPixmap) (pBitmap);
- /* compute resultant exposures */
- ret = miHandleExposures (pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height,
- dstx, dsty, bitPlane);
- }
- else
-#endif
- ret = miCopyPlane (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- return ret;
-}
-
-
diff --git a/cfb/cfbblt.c b/cfb/cfbblt.c
deleted file mode 100644
index 5d2e084fd..000000000
--- a/cfb/cfbblt.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/*
- * cfb copy area
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.14 2003/10/29 22:44:53 tsi Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Keith Packard
-
-*/
-/* $Xorg: cfbblt.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-/* 24-bit bug fixes: Peter Wainwright, 1998/11/28 */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-#include "fastblt.h"
-#include "mergerop.h"
-
-#ifdef notdef /* XXX fails right now, walks off end of pixmaps */
-#if defined (FAST_UNALIGNED_READS) && PSZ == 8
-#define DO_UNALIGNED_BITBLT
-#endif
-#endif
-
-#if defined(FAST_MEMCPY) && (MROP == Mcopy) && PSZ == 8
-#define DO_MEMCPY
-#endif
-
-/* ................................................. */
-/* SPECIAL CODE FOR 24 BITS by Peter Wainwright */
-
-#if PSZ == 24 && (MROP) == 0
-
-/* The default macros are defined in mergerop.h, and none of them are
- really appropriate for what we want to do.
-
- There are two ways of fixing this: either define SLOW_24BIT_COPY
- to copy pixel by pixel, or (by default) use the following macros
- modified from mergerop.h
-
- MROP_SOLID and MROP_MASK are defined for each of the operations,
- i.e. each value of MROP.
-
- There are special cases for Mcopy, McopyInverted, Mxor, and Mor.
- There is a completely generic version for MROP=0, and a simplified
- generic version which works for (Mcopy|Mxor|MandReverse|Mor).
-
- However, the generic version does not work for the 24-bit case
- because the pixels cannot be packed exactly into a machine word (32
- bits).
-
- Alternative macros MROP_SOLID24 and MROP_MASK24 are provided for
- the 24-bit case. However, these each copy a single *pixel*, not a
- single machine word. They take an rvalue source pixel, an lvalue
- destination, and the pixel index. The latter is used to find the
- position of the pixel data within the two words *dst and *(dst+1).
-
- Further macros MROP_SOLID24P and MROP_MASK24P are used to copy from
- an lvalue source to an lvalue destination. MROP_PIXEL24 is used to
- assemble the source pixel from the adjacent words *src and
- *(src+1), and this is then split between the destination words
- using the non-P macros above.
-
- But we want to copy entire words for the sake of efficiency.
- Unfortunately if a plane mask is specified this must be shifted
- from one word to the next. Fortunately the pattern repeats after 3
- words, so we unroll the planemask here and redefine MROP_SOLID
- and MROP_MASK. */
-
-
-#endif /* MROP == 0 && PSZ == 24 */
-
-/* ................................................. */
-
-#if PSZ == 24
-#define BYPP 3
-#if PGSZ == 32
-#define P3W 4 /* pixels in 3 machine words */
-#define PAM 3 /* pixel align mask; PAM = P3W -1 */
-#define P2WSH 2
-#else
-#define P3W 8 /* pixels in 3 machine words */
-#define PAM 7 /* pixel align mask; PAM = P3W -1 */
-#define P2WSH 3
-#endif
-#endif
-
-void
-MROP_NAME(cfbDoBitblt)(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int alu,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask)
-{
- CfbBits *psrcBase, *pdstBase;
- /* start of src and dst bitmaps */
- int widthSrc, widthDst; /* add to get to same position in next line */
-
- BoxPtr pbox;
- int nbox;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int xdir; /* 1 = left right, -1 = right left/ */
- int ydir; /* 1 = top down, -1 = bottom up */
-
- CfbBits *psrcLine, *pdstLine;
- /* pointers to line with current src and dst */
- register CfbBits *psrc;/* pointer to current src longword */
- register CfbBits *pdst;/* pointer to current dst longword */
-
- MROP_DECLARE_REG()
-
- /* following used for looping through a line */
- CfbBits startmask, endmask; /* masks for writing ends of dst */
- int nlMiddle; /* whole longwords in dst */
- int xoffSrc, xoffDst;
- register int nl; /* temp copy of nlMiddle */
- int careful;
-
-#if (PSZ != 24) || (MROP != 0)
- register int leftShift, rightShift;
- register CfbBits bits;
- register CfbBits bits1;
-#endif
-
-#if PSZ == 24
-#ifdef DO_MEMCPY
- int w2;
-#endif
-
-#if MROP == 0
- int widthSrcBytes = cfbGetByteWidth(pSrc);
- int widthDstBytes = cfbGetByteWidth(pDst);
-#endif
-#endif
-
- MROP_INITIALIZE(alu,planemask)
-
- cfbGetLongWidthAndPointer (pSrc, widthSrc, psrcBase)
-
- cfbGetLongWidthAndPointer (pDst, widthDst, pdstBase)
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1))
- {
- /* walk source botttom to top */
- ydir = -1;
- widthSrc = -widthSrc;
- widthDst = -widthDst;
-
- if (nbox > 1)
- {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1)
- {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox)
- {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase)
- {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- }
- else
- {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1))
- {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1)
- {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2)
- {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase)
- {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- }
- else
- {
- /* walk source left to right */
- xdir = 1;
- }
-
- while(nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
-#if PSZ == 24
-#ifdef DO_MEMCPY
- w2 = w * BYPP;
-#endif
-#endif
- if (ydir == -1) /* start at last scanline of rectangle */
- {
- psrcLine = psrcBase + ((pptSrc->y+h-1) * -widthSrc);
- pdstLine = pdstBase + ((pbox->y2-1) * -widthDst);
- }
- else /* start at first scanline */
- {
- psrcLine = psrcBase + (pptSrc->y * widthSrc);
- pdstLine = pdstBase + (pbox->y1 * widthDst);
- }
-#if PSZ == 24
- if (w == 1 && ((pbox->x1 & PAM) == 0 || (pbox->x1 & PAM) == PAM))
-#else
- if ((pbox->x1 & PIM) + w <= PPW)
-#endif
- {
- maskpartialbits (pbox->x1, w, endmask);
- startmask = 0;
- nlMiddle = 0;
- }
- else
- {
- maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
- }
-
-#if PSZ == 24
-#if 0
- nlMiddle = w - (pbox->x2 &PAM);;
- if(pbox->x1 & PAM){
- nlMiddle -= (PAM+1 - (pbox->x1 &PAM));
- }
- nlMiddle >>= P2WSH;
- if(nlMiddle < 0)
- nlMiddle = 0;
-#endif
-#endif
-
-#ifdef DO_MEMCPY
- /* If the src and dst scanline don't overlap, do forward case. */
-
- if ((xdir == 1) || (pptSrc->y != pbox->y1)
- || (pptSrc->x + w <= pbox->x1))
- {
-#if PSZ == 24
- char *psrc = (char *) psrcLine + (pptSrc->x * BYPP);
- char *pdst = (char *) pdstLine + (pbox->x1 * BYPP);
-#else
- char *psrc = (char *) psrcLine + pptSrc->x;
- char *pdst = (char *) pdstLine + pbox->x1;
-#endif
- while (h--)
- {
-#if PSZ == 24
- memcpy(pdst, psrc, w2);
-#else
- memcpy(pdst, psrc, w);
-#endif
- pdst += widthDst << PWSH;
- psrc += widthSrc << PWSH;
- }
- }
-#else /* ! DO_MEMCPY */
- if (xdir == 1)
- {
-#if PSZ == 24 && MROP == 0
- /* Note: x is a pixel number; the byte offset is 3*x;
- therefore the offset within a word is (3*x) & 3 ==
- (4*x-x) & 3 == (-x) & 3. The offsets therefore
- DECREASE by 1 for each pixel.
- */
- xoffSrc = ( - pptSrc->x) & PAM;
- xoffDst = ( - pbox->x1) & PAM;
-#if 1
- if((int)xoffSrc != (int)xoffDst /* Alignments must be same. */
- || ((widthDstBytes & PAM) != (widthSrcBytes & PAM) && h > 1))
-#else
- if(1)
-#endif
- /* Width also must be same, if hight > 1 */
- {
- /* ...otherwise, pixel by pixel operation */
- while (h--)
- {
- register int i, si, sii, di;
-
- for (i = 0, si = pptSrc->x, di = pbox->x1;
- i < w;
- i++, si++, di++) {
- psrc = psrcLine + ((si * BYPP) >> P2WSH);
- pdst = pdstLine + ((di * BYPP) >> P2WSH);
- sii = (si & 3);
- MROP_SOLID24P(psrc, pdst, sii, di);
- }
- pdstLine += widthDst;
- psrcLine += widthSrc;
- }
- }
- else
-#endif
- {
-
-#if PSZ == 24
-
-#if MROP != 0
- xoffSrc = ( - pptSrc->x) & PAM;
- xoffDst = ( - pbox->x1) & PAM;
-#endif
- pdstLine += (pbox->x1 * BYPP) >> P2WSH;
- psrcLine += (pptSrc->x * BYPP) >> P2WSH;
-#else
- xoffSrc = pptSrc->x & PIM;
- xoffDst = pbox->x1 & PIM;
- pdstLine += (pbox->x1 >> PWSH);
- psrcLine += (pptSrc->x >> PWSH);
-#endif
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (CfbBits *)
- (((unsigned char *) psrcLine) + nl);
-#else
-#if PSZ == 24 && MROP == 0
- /* alredy satisfied */
-#else
- if (xoffSrc == xoffDst)
-#endif
-#endif
- {
- while (h--)
- {
-#if PSZ == 24 && MROP == 0
- register int index;
- register int im3;
-#endif /* PSZ == 24 && MROP == 0 */
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
-#if PSZ == 24 && MROP == 0
- index = (int)(pdst - pdstBase);
- im3 = index % 3;
-#endif /* PSZ == 24 && MROP == 0 */
- if (startmask)
- {
-#if PSZ == 24 && MROP == 0
- *pdst = DoMaskMergeRop24u(*psrc, *pdst, startmask, im3);
- index++;
- im3 = index % 3;
-#else /* PSZ != 24 || MROP != 0 */
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
-#endif /* PSZ == 24 && MROP == 0 */
- psrc++;
- pdst++;
- }
-
- nl = nlMiddle;
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#if PSZ == 24 && MROP == 0
-#define BodyOdd(n) pdst[-n] = DoMergeRop24u(psrc[-n], pdst[-n], ((int)(pdst - n - pdstBase))%3);
-#define BodyEven(n) pdst[-n] = DoMergeRop24u(psrc[-n], pdst[-n], ((int)(pdst - n - pdstBase))%3);
-#else /* PSZ != 24 || MROP != 0 */
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#endif /* PSZ == 24 && MROP == 0 */
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#if PSZ == 24 && MROP == 0
-#define BodyOdd(n) *pdst = DoMergeRop24u(*psrc, *pdst, im3); pdst++; psrc++; index++; im3 = index % 3;
-#define BodyEven(n) BodyOdd(n)
-#else /* PSZ != 24 || MROP != 0 */
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-#endif /* PSZ == 24 && MROP == 0 */
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
-#ifdef NOTDEF
- /* you'd think this would be faster --
- * a single instruction instead of 6
- * but measurements show it to be ~15% slower
- */
- while ((nl -= 6) >= 0)
- {
- asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
- : "=m" (*(char *)pdst)
- : "m" (*(char *)psrc)
- : "d0", "d1", "d2", "d3",
- "a2", "a3");
- pdst += 6;
- }
- nl += 6;
- while (nl--)
- *pdst++ = *psrc++;
-#endif
-#if 0 /*PSZ == 24 && MROP == 0*/
- DuffL(nl, label1,
- *pdst = DoMergeRop24u(*psrc, *pdst, im3);
- pdst++; psrc++; index++;im3 = index % 3;)
-#else /* !(PSZ == 24 && MROP == 0) */
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif /* PSZ == 24 && MROP == 0 */
-#endif
-
- if (endmask)
-#if PSZ == 24 && MROP == 0
- *pdst = DoMaskMergeRop24u(*psrc, *pdst, endmask, (int)(pdst - pdstBase) % 3);
-#else /* !(PSZ == 24 && MROP == 0) */
- *pdst = MROP_MASK(*psrc, *pdst, endmask);
-#endif /* PSZ == 24 && MROP == 0 */
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
-#if PSZ == 24 && MROP == 0
- /* can not happen */
-#else /* !(PSZ == 24 && MROP == 0) */
- else /* xoffSrc != xoffDst */
- {
- if (xoffSrc > xoffDst)
- {
-#if PSZ == 24
- leftShift = (xoffSrc - xoffDst) << 3;
-#else
-#if PGSZ == 32
- leftShift = (xoffSrc - xoffDst) << (5 - PWSH);
-#else /* PGSZ == 64 */
- leftShift = (xoffSrc - xoffDst) << (6 - PWSH);
-#endif /* PGSZ */
-#endif
- rightShift = PGSZ - leftShift;
- }
- else
- {
-#if PSZ == 24
- rightShift = (xoffDst - xoffSrc) << 3;
-#else
-#if PGSZ == 32
- rightShift = (xoffDst - xoffSrc) << (5 - PWSH);
-#else /* PGSZ == 64 */
- rightShift = (xoffDst - xoffSrc) << (6 - PWSH);
-#endif /* PGSZ */
-#endif
- leftShift = PGSZ - rightShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- bits = 0;
- if (xoffSrc > xoffDst)
- bits = *psrc++;
- if (startmask)
- {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc++;
- bits1 |= BitRight(bits,rightShift);
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nl = nlMiddle;
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
-bits = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
-bits1 = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
-pdst++;
-
-#define BodyEven(n) \
-bits1 = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
-pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-
- if (endmask)
- {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift))
- {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- }
- }
-#endif /* (PSZ == 24 && MROP == 0) */
-#endif /* DO_UNALIGNED_BITBLT */
-
- }
- }
-#endif /* ! DO_MEMCPY */
- else /* xdir == -1 */
- {
-#if PSZ == 24 && MROP == 0
- xoffSrc = (-(pptSrc->x + w)) & PAM;
- xoffDst = (-pbox->x2) & PAM;
-#if 1
- if(xoffSrc != xoffDst /* Alignments must be same. */
- || ((widthDstBytes & PAM) != (widthSrcBytes & PAM) && h > 1))
-#else
- if(1)
-#endif
- /* Width also must be same, if hight > 1 */
- {
- /* ...otherwise, pixel by pixel operation */
- while (h--)
- {
- register int i, si, sii, di;
-
- for (i = 0, si = pptSrc->x + w - 1, di = pbox->x2 - 1;
- i < w;
- i++, si--, di--) {
- psrc = psrcLine + ((si * BYPP) >> P2WSH);
- pdst = pdstLine + ((di * BYPP) >> P2WSH);
- sii = (si & PAM);
- MROP_SOLID24P(psrc, pdst, sii, di);
- }
- psrcLine += widthSrc;
- pdstLine += widthDst;
- }
- }else
-#endif /* MROP == 0 && PSZ == 24 */
- {
-
-#if PSZ == 24
-#if MROP == 0
- /* already calculated */
-#else
- xoffSrc = (pptSrc->x + w) & PAM;
- xoffDst = pbox->x2 & PAM;
-#endif
- pdstLine += ((pbox->x2 * BYPP - 1) >> P2WSH) + 1;
- psrcLine += (((pptSrc->x+w) * BYPP - 1) >> P2WSH) + 1;
-#else
- xoffSrc = (pptSrc->x + w - 1) & PIM;
- xoffDst = (pbox->x2 - 1) & PIM;
- pdstLine += ((pbox->x2-1) >> PWSH) + 1;
- psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
-#endif
-#ifdef DO_UNALIGNED_BITBLT
-#if PSZ == 24
- nl = xoffDst - xoffSrc;
-#else
- nl = xoffSrc - xoffDst;
-#endif
- psrcLine = (CfbBits *)
- (((unsigned char *) psrcLine) + nl);
-#else
-#if PSZ == 24 && MROP == 0
- /* already satisfied */
-#else
- if (xoffSrc == xoffDst)
-#endif
-#endif
- {
- while (h--)
- {
-#if PSZ == 24 && MROP == 0
- register int index;
- register int im3;
-#endif /* PSZ == 24 && MROP == 0 */
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
-#if PSZ == 24 && MROP == 0
- index = (int)(pdst - pdstBase);
-#endif /* PSZ == 24 && MROP == 0 */
-
- if (endmask)
- {
- pdst--;
- psrc--;
-#if PSZ == 24 && MROP == 0
- index--;
- im3 = index % 3;
- *pdst = DoMaskMergeRop24u(*psrc, *pdst, endmask, im3);
-#else /* !(PSZ == 24 && MROP == 0) */
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
-#endif /* PSZ == 24 && MROP == 0 */
- }
- nl = nlMiddle;
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#if PSZ == 24 && MROP == 0
-#define BodyOdd(n) pdst[n-1] = DoMergeRop24u(psrc[n-1], pdst[n-1], ((int)(pdst - (n - 1) -pdstBase)) % 3);
-#else /* !(PSZ == 24 && MROP == 0) */
-#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
-#endif /* PSZ == 24 && MROP == 0 */
-
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset \
-pdst -= UNROLL;\
-psrc -= UNROLL;
-
-#else
-
-#if PSZ == 24 && MROP == 0
-#define BodyOdd(n) --pdst; --psrc; --index; im3 = index % 3;*pdst = DoMergeRop24u(*psrc, *pdst, im3);
-#else /* !(PSZ == 24 && MROP == 0) */
-#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
-#endif /* PSZ == 24 && MROP == 0 */
-#define BodyEven(n) BodyOdd(n)
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
-#if PSZ == 24 && MROP == 0
- DuffL(nl,label3,
- --pdst; --psrc; --index; im3= index%3;*pdst = DoMergeRop24u(*psrc, *pdst, im3);)
-#else /* !(PSZ == 24 && MROP == 0) */
- DuffL(nl,label3,
- --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
-#endif /* PSZ == 24 && MROP == 0 */
-#endif
-
- if (startmask)
- {
- --pdst;
- --psrc;
-#if PSZ == 24 && MROP == 0
- *pdst = DoMaskMergeRop24u(*psrc, *pdst, startmask, (int)(pdst - pdstBase) % 3);
-#else /* !(PSZ == 24 && MROP == 0) */
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
-#endif /* PSZ == 24 && MROP == 0 */
- }
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
-#if PSZ == 24 && MROP == 0
- /* can not happen */
-#else /* !( PSZ == 24 && MROP == 0) */
- else
- {
- if (xoffDst > xoffSrc)
- {
-#if PSZ == 24
- leftShift = (xoffDst - xoffSrc) << 3;
- rightShift = PGSZ - leftShift;
-#else
-#if PGSZ == 32
- rightShift = (xoffDst - xoffSrc) << (5 - PWSH);
-#else /* PGSZ == 64 */
- rightShift = (xoffDst - xoffSrc) << (6 - PWSH);
-#endif /* PGSZ */
- leftShift = PGSZ - rightShift;
-#endif
- }
- else
- {
-#if PSZ == 24
- rightShift = (xoffSrc - xoffDst) << 3;
- leftShift = PGSZ - rightShift;
-#else
-#if PGSZ == 32
- leftShift = (xoffSrc - xoffDst) << (5 - PWSH);
-#else /* PGSZ == 64 */
- leftShift = (xoffSrc - xoffDst) << (6 - PWSH);
-#endif /* PGSZ */
- rightShift = PGSZ - leftShift;
-#endif
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- bits = 0;
-#if PSZ == 24
- if (xoffSrc > xoffDst)
-#else
- if (xoffDst > xoffSrc)
-#endif
- bits = *--psrc;
- if (endmask)
- {
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- pdst--;
- *pdst = MROP_MASK(bits1, *pdst, endmask);
- }
- nl = nlMiddle;
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) \
-bits = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
-
-#define BodyEven(n) \
-bits1 = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
-
-#define LoopReset \
-pdst -= UNROLL; \
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
-
-#define BodyEven(n) \
-bits1 = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
-
-#define LoopReset ;
-
-#endif
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl, label4,
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- --pdst;
- *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
- )
-#endif
-
- if (startmask)
- {
- bits1 = BitRight(bits, rightShift);
- if (BitRight (startmask, leftShift))
- {
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- }
- --pdst;
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- }
- }
- }
-#endif /* PSZ == 24 && MROP == 0 */
-#endif
- }
- }
- pbox++;
- pptSrc++;
- }
- if (pboxNew2)
- {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
diff --git a/cfb/cfbbres.c b/cfb/cfbbres.c
deleted file mode 100644
index 452259581..000000000
--- a/cfb/cfbbres.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbbres.c,v 3.5 2001/12/14 19:59:21 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cfbbres.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-#include "X.h"
-#include "misc.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "servermd.h"
-#include "miline.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1,
- e2, len)
- int rop;
- CfbBits and, xor;
- CfbBits *addrl; /* pointer to base of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register int signdx;
- int signdy; /* signs of directions */
- int axis; /* major axis (Y_AXIS or X_AXIS) */
- int x1, y1; /* initial point */
- register int e; /* error accumulator */
- register int e1; /* bresenham increments */
- int e2;
- int len; /* length of line */
-{
- register int e3 = e2-e1;
-#if PSZ == 24
- CfbBits piQxelXor[3],piQxelAnd[3];
- char *addrb;
- int nlwidth3, signdx3;
-#endif
-#ifdef PIXEL_ADDR
- register PixelType *addrp; /* Pixel pointer */
-
- if (len == 0)
- return;
- /* point to first point */
- nlwidth <<= PWSH;
-#if PSZ == 24
- addrp = (PixelType *)(addrl) + (y1 * nlwidth);
- addrb = (char *)addrp + x1 * 3;
-
- piQxelXor[0] = (xor << 24) | xor;
- piQxelXor[1] = (xor << 16)| (xor >> 8);
- piQxelXor[2] = (xor << 8) | (xor >> 16);
- piQxelAnd[0] = (and << 24) | and;
- piQxelAnd[1] = (and << 16)| (and >> 8);
- piQxelAnd[2] = (and << 8) | (and >> 16);
-#else
- addrp = (PixelType *)(addrl) + (y1 * nlwidth) + x1;
-#endif
- if (signdy < 0)
- nlwidth = -nlwidth;
- e = e-e1; /* to make looping easier */
-#if PSZ == 24
- nlwidth3 = nlwidth * sizeof (CfbBits);
- signdx3 = signdx * 3;
-#endif
-
- if (axis == Y_AXIS)
- {
- int t;
-
- t = nlwidth;
- nlwidth = signdx;
- signdx = t;
-#if PSZ == 24
- t = nlwidth3;
- nlwidth3 = signdx3;
- signdx3 = t;
-#endif
- }
- if (rop == GXcopy)
- {
- --len;
-#if PSZ == 24
-#define body_copy \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp = ((*addrp)&0xFF000000)|(piQxelXor[0] & 0xFFFFFF); \
- break; \
- case 1: \
- *addrp = ((*addrp)&0xFF)|(piQxelXor[2] & 0xFFFFFF00); \
- break; \
- case 3: \
- *addrp = ((*addrp)&0xFFFFFF)|(piQxelXor[0] & 0xFF000000); \
- *(addrp+1) = ((*(addrp+1))&0xFFFF0000)|(piQxelXor[1] & 0xFFFF); \
- break; \
- case 2: \
- *addrp = ((*addrp)&0xFFFF)|(piQxelXor[1] & 0xFFFF0000); \
- *(addrp+1) = ((*(addrp+1))&0xFFFFFF00)|(piQxelXor[2] & 0xFF); \
- break; \
- }
-#define body {\
- body_copy \
- addrb += signdx3; \
- e += e1; \
- if (e >= 0) \
- { \
- addrb += nlwidth3; \
- e += e3; \
- } \
- }
-#else /* PSZ == 24 */
-#define body {\
- *addrp = xor; \
- addrp += signdx; \
- e += e1; \
- if (e >= 0) \
- { \
- addrp += nlwidth; \
- e += e3; \
- } \
- }
-#endif /* PSZ == 24 */
- while (len >= 4)
- {
- body body body body
- len -= 4;
- }
- switch (len)
- {
- case 3: body case 2: body case 1: body
- }
-#undef body
-#if PSZ == 24
- body_copy
-# undef body_copy
-#else
- *addrp = xor;
-#endif
- }
- else /* not GXcopy */
- {
- while(len--)
- {
-#if PSZ == 24
- addrp = (PixelType *)((unsigned long)addrb & ~0x03);
- switch((unsigned long)addrb & 3){
- case 0:
- *addrp = (*addrp & (piQxelAnd[0]|0xFF000000))
- ^ (piQxelXor[0] & 0xFFFFFF);
- break;
- case 1:
- *addrp = (*addrp & (piQxelAnd[2]|0xFF))
- ^ (piQxelXor[2] & 0xFFFFFF00);
- break;
- case 3:
- *addrp = (*addrp & (piQxelAnd[0]|0xFFFFFF))
- ^ (piQxelXor[0] & 0xFF000000);
- *(addrp+1) = (*(addrp+1) & (piQxelAnd[1]|0xFFFF0000))
- ^ (piQxelXor[1] & 0xFFFF);
- break;
- case 2:
- *addrp = (*addrp & (piQxelAnd[1]|0xFFFF))
- ^ (piQxelXor[1] & 0xFFFF0000);
- *(addrp+1) = (*(addrp+1) & (piQxelAnd[2]|0xFFFFFF00))
- ^ (piQxelXor[2] & 0xFF);
- break;
- }
- e += e1;
- if (e >= 0)
- {
- addrb += nlwidth3;
- e += e3;
- }
- addrb += signdx3;
-#else /* PSZ == 24 */
- *addrp = DoRRop (*addrp, and, xor);
- e += e1;
- if (e >= 0)
- {
- addrp += nlwidth;
- e += e3;
- }
- addrp += signdx;
-#endif /* PSZ == 24 */
- }
- }
-#else /* !PIXEL_ADDR */
- register CfbBits tmp, bit;
- CfbBits leftbit, rightbit;
-
- /* point to longword containing first point */
-#if PSZ == 24
- addrl = (addrl + (y1 * nlwidth) + ((x1 * 3) >>2);
-#else
- addrl = (addrl + (y1 * nlwidth) + (x1 >> PWSH));
-#endif
- if (signdy < 0)
- nlwidth = -nlwidth;
- e = e-e1; /* to make looping easier */
-
- leftbit = cfbmask[0];
-#if PSZ == 24
- rightbit = cfbmask[(PPW-1)<<1];
- bit = cfbmask[(x1 & 3)<<1];
-#else
- rightbit = cfbmask[PPW-1];
- bit = cfbmask[x1 & PIM];
-#endif
-
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while (len--)
- {
- *addrl = DoMaskRRop (*addrl, and, xor, bit);
- bit = SCRRIGHT(bit,1);
- e += e1;
- if (e >= 0)
- {
- addrl += nlwidth;
- e += e3;
- }
- if (!bit)
- {
- bit = leftbit;
- addrl++;
- }
- }
- }
- else
- {
- while (len--)
- {
- *addrl = DoMaskRRop (*addrl, and, xor, bit);
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0)
- {
- addrl += nlwidth;
- e += e3;
- }
- if (!bit)
- {
- bit = rightbit;
- addrl--;
- }
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- *addrl = DoMaskRRop (*addrl, and, xor, bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit)
- {
- bit = leftbit;
- addrl++;
- }
- e += e3;
- }
- addrl += nlwidth;
- }
- }
- else
- {
- while(len--)
- {
- *addrl = DoMaskRRop (*addrl, and, xor, bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit)
- {
- bit = rightbit;
- addrl--;
- }
- e += e3;
- }
- addrl += nlwidth;
- }
- }
- } /* else Y_AXIS */
-#endif
-}
diff --git a/cfb/cfbbresd.c b/cfb/cfbbresd.c
deleted file mode 100644
index 7fe71fa2f..000000000
--- a/cfb/cfbbresd.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbbresd.c,v 3.6 2001/12/14 19:59:22 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cfbbresd.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-#include "X.h"
-#include "misc.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "miline.h"
-
-/* Dashed bresenham line */
-
-void
-cfbBresD(rrops,
- pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1, e, e1, e2, len)
- cfbRRopPtr rrops;
- int *pdashIndex; /* current dash */
- unsigned char *pDash; /* dash list */
- int numInDashList; /* total length of dash list */
- int *pdashOffset; /* offset into current dash */
- int isDoubleDash;
- CfbBits *addrl; /* pointer to base of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- int signdx, signdy; /* signs of directions */
- int axis; /* major axis (Y_AXIS or X_AXIS) */
- int x1, y1; /* initial point */
- register int e; /* error accumulator */
- register int e1; /* bresenham increments */
- int e2;
- int len; /* length of line */
-{
-#ifdef PIXEL_ADDR
- register PixelType *addrp;
-#endif
- register int e3 = e2-e1;
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- CfbBits xorFg, andFg, xorBg, andBg;
- Bool isCopy;
- int thisDash;
-#if PSZ == 24
- CfbBits xorPiQxlFg[3], andPiQxlFg[3], xorPiQxlBg[3], andPiQxlBg[3];
- char *addrb;
- int signdx3, signdy3;
-#endif
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- isCopy = (rrops[0].rop == GXcopy && rrops[1].rop == GXcopy);
-#if PSZ == 24
- xorFg = rrops[0].xor & 0xffffff;
- andFg = rrops[0].and & 0xffffff;
- xorBg = rrops[1].xor & 0xffffff;
- andBg = rrops[1].and & 0xffffff;
- xorPiQxlFg[0] = xorFg | (xorFg << 24);
- xorPiQxlFg[1] = (xorFg >> 8) | (xorFg << 16);
- xorPiQxlFg[2] = (xorFg >> 16) | (xorFg << 8);
- andPiQxlFg[0] = andFg | (andFg << 24);
- andPiQxlFg[1] = (andFg >> 8) | (andFg << 16);
- andPiQxlFg[2] = (andFg >> 16) | (andFg << 8);
- xorPiQxlBg[0] = xorBg | (xorBg << 24);
- xorPiQxlBg[1] = (xorBg >> 8) | (xorBg << 16);
- xorPiQxlBg[2] = (xorBg >> 16) | (xorBg << 8);
- andPiQxlBg[0] = andBg | (andBg << 24);
- andPiQxlBg[1] = (andBg >> 8) | (andBg << 16);
- andPiQxlBg[2] = (andFg >> 16) | (andBg << 8);
-#else
- xorFg = rrops[0].xor;
- andFg = rrops[0].and;
- xorBg = rrops[1].xor;
- andBg = rrops[1].and;
-#endif
- dashRemaining = pDash[dashIndex] - dashOffset;
- if ((thisDash = dashRemaining) >= len)
- {
- thisDash = len;
- dashRemaining -= len;
- }
- e = e-e1; /* to make looping easier */
-
-#define BresStep(minor,major) {if ((e += e1) >= 0) { e += e3; minor; } major;}
-
-#define NextDash {\
- dashIndex++; \
- if (dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- if ((thisDash = dashRemaining) >= len) \
- { \
- dashRemaining -= len; \
- thisDash = len; \
- } \
-}
-
-#ifdef PIXEL_ADDR
-
-#if PSZ == 24
-#define Loop(store) while (thisDash--) {\
- store; \
- BresStep(addrb+=signdy3,addrb+=signdx3) \
- }
- /* point to first point */
- nlwidth <<= PWSH;
- addrp = (PixelType *)(addrl) + (y1 * nlwidth);
- addrb = (char *)addrp + x1 * 3;
-
-#else
-#define Loop(store) while (thisDash--) {\
- store; \
- BresStep(addrp+=signdy,addrp+=signdx) \
- }
- /* point to first point */
- nlwidth <<= PWSH;
- addrp = (PixelType *)(addrl) + (y1 * nlwidth) + x1;
-#endif
- signdy *= nlwidth;
-#if PSZ == 24
- signdx3 = signdx * 3;
- signdy3 = signdy * sizeof (CfbBits);
-#endif
- if (axis == Y_AXIS)
- {
- int t;
-
- t = signdx;
- signdx = signdy;
- signdy = t;
-#if PSZ == 24
- t = signdx3;
- signdx3 = signdy3;
- signdy3 = t;
-#endif
- }
-
- if (isCopy)
- {
-#if PSZ == 24
-#define body_copy(pix) { \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp = (*addrp & 0xFF000000)|((pix)[0] & 0xFFFFFF); \
- break; \
- case 1: \
- *addrp = (*addrp & 0xFF)|((pix)[2] & 0xFFFFFF00); \
- break; \
- case 3: \
- *addrp = (*addrp & 0xFFFFFF)|((pix)[0] & 0xFF000000); \
- *(addrp+1) = (*(addrp+1) & 0xFFFF0000)|((pix)[1] & 0xFFFF); \
- break; \
- case 2: \
- *addrp = (*addrp & 0xFFFF)|((pix)[1] & 0xFFFF0000); \
- *(addrp+1) = (*(addrp+1) & 0xFFFFFF00)|((pix)[2] & 0xFF); \
- break; \
- } \
-}
-#endif /* PSZ == 24 */
-
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
-#if PSZ == 24
- Loop(body_copy(xorPiQxlBg))
-#else
- Loop(*addrp = xorBg)
-#endif
- } else {
- Loop(;)
- }
- } else {
-#if PSZ == 24
- Loop(body_copy(xorPiQxlFg))
-#else
- Loop(*addrp = xorFg)
-#endif
- }
- if (!len)
- break;
- NextDash
- }
-#undef body_copy
- }
- else
- {
-#define body_set(and, xor) { \
- addrp = (PixelType *)((unsigned long)addrb & ~0x03); \
- switch((unsigned long)addrb & 3){ \
- case 0: \
- *addrp = (*addrp & ((and)[0]|0xFF000000)) ^ ((xor)[0] & 0xFFFFFF); \
- break; \
- case 1: \
- *addrp = (*addrp & ((and)[2]|0xFF)) ^ ((xor)[2] & 0xFFFFFF00); \
- break; \
- case 3: \
- *addrp = (*addrp & ((and)[0]|0xFFFFFF)) ^ ((xor)[0] & 0xFF000000); \
- *(addrp+1)=(*(addrp+1)&((and)[1]|0xFFFF0000)) ^ ((xor)[1]&0xFFFF); \
- break; \
- case 2: \
- *addrp = (*addrp & ((and)[1]|0xFFFF)) ^ ((xor)[1] & 0xFFFF0000); \
- *(addrp+1)=(*(addrp+1)&((and)[2]|0xFFFFFF00)) ^ ((xor)[2] & 0xFF); \
- break; \
- } \
-}
-
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
-#if PSZ == 24
- Loop(body_set(andPiQxlBg, xorPiQxlBg))
-#else
- Loop(*addrp = DoRRop(*addrp,andBg, xorBg))
-#endif
- } else {
- Loop(;)
- }
- } else {
-#if PSZ == 24
- Loop(body_set(andPiQxlFg, xorPiQxlFg))
-#else
- Loop(*addrp = DoRRop(*addrp,andFg, xorFg))
-#endif
- }
- if (!len)
- break;
- NextDash
- }
-#undef body_set
- }
-#else /* !PIXEL_ADDR */
- {
- register CfbBits tmp;
- CfbBits startbit, bit;
-
- /* point to longword containing first point */
-#if PSZ == 24
- addrl = (addrl + (y1 * nlwidth) + ((x1*3) >> 2);
-#else
- addrl = (addrl + (y1 * nlwidth) + (x1 >> PWSH));
-#endif
- signdy = signdy * nlwidth;
-
- if (signdx > 0)
- startbit = cfbmask[0];
- else
-#if PSZ == 24
- startbit = cfbmask[(PPW-1)<<1];
- bit = cfbmask[(x1 & 3)<<1];
-#else
- startbit = cfbmask[PPW-1];
- bit = cfbmask[x1 & PIM];
-#endif
-
-#if PSZ == 24
-#define X_Loop(store) while(thisDash--) {\
- store; \
- BresStep(addrl += signdy, \
- if (signdx > 0) \
- bit = SCRRIGHT(bit,1); \
- else \
- bit = SCRLEFT(bit,1); \
- if (!bit) \
- { \
- bit = startbit; \
- addrl += signdx; \
- }) \
- }
-#define Y_Loop(store) while(thisDash--) {\
- store; \
- BresStep(if (signdx > 0) \
- bit = SCRRIGHT(bit,1); \
- else \
- bit = SCRLEFT(bit,1); \
- if (!bit) \
- { \
- bit = startbit; \
- addrl += signdx; \
- }, \
- addrl += signdy) \
- }
-#else
-#define X_Loop(store) while(thisDash--) {\
- store; \
- BresStep(addrl += signdy, \
- if (signdx > 0) \
- bit = SCRRIGHT(bit,1); \
- else \
- bit = SCRLEFT(bit,1); \
- if (!bit) \
- { \
- bit = startbit; \
- addrl += signdx; \
- }) \
- }
-#define Y_Loop(store) while(thisDash--) {\
- store; \
- BresStep(if (signdx > 0) \
- bit = SCRRIGHT(bit,1); \
- else \
- bit = SCRLEFT(bit,1); \
- if (!bit) \
- { \
- bit = startbit; \
- addrl += signdx; \
- }, \
- addrl += signdy) \
- }
-#endif
-
- if (axis == X_AXIS)
- {
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
- X_Loop(*addrl = DoMaskRRop(*addrl, andBg, xorBg, bit));
- } else {
- X_Loop(;)
- }
- } else {
- X_Loop(*addrl = DoMaskRRop(*addrl, andFg, xorFg, bit));
- }
- if (!len)
- break;
- NextDash
- }
- } /* if X_AXIS */
- else
- {
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
- Y_Loop(*addrl = DoMaskRRop(*addrl, andBg, xorBg, bit));
- } else {
- Y_Loop(;)
- }
- } else {
- Y_Loop(*addrl = DoMaskRRop(*addrl, andFg, xorFg, bit));
- }
- if (!len)
- break;
- NextDash
- }
- } /* else Y_AXIS */
- }
-#endif
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/cfb/cfbbstore.c b/cfb/cfbbstore.c
deleted file mode 100644
index 5e7b91471..000000000
--- a/cfb/cfbbstore.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbbstore.c,v 1.5 2001/01/17 22:36:34 dawes Exp $ */
-/*-
- * cfbbstore.c --
- * Functions required by the backing-store implementation in MI.
- *
- * Copyright (c) 1987 by the Regents of the University of California
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- *
- */
-/* $Xorg: cfbbstore.c,v 1.3 2000/08/17 19:48:13 cpqbld Exp $ */
-
-#include "cfb.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * cfbSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * cfbDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- i = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- pScrPix = (*pScreen->GetWindowPixmap)(pWin);
-
-
- cfbDoBitbltCopy((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
- GXcopy, prgnSave, pPtsInit, ~0L);
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * cfbRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * cfbDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- i = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- pScrPix = (*pScreen->GetWindowPixmap)(pWin);
-
- cfbDoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, ~0L);
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
diff --git a/cfb/cfbcmap.c b/cfb/cfbcmap.c
deleted file mode 100644
index 1830ffa5e..000000000
--- a/cfb/cfbcmap.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* $Xorg: cfbcmap.c,v 1.3 2000/08/17 19:48:13 cpqbld Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbcmap.c,v 3.13 2001/01/17 22:36:34 dawes Exp $ */
-
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "micmap.h"
-#include "cfb.h"
-
-int
-cfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-void
-cfbInstallColormap(ColormapPtr pmap)
-{
- miInstallColormap(pmap);
-}
-
-void
-cfbUninstallColormap(ColormapPtr pmap)
-{
- miUninstallColormap(pmap);
-}
-
-void
-cfbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-cfbInitializeColormap(ColormapPtr pmap)
-{
- return miInitializeColormap(pmap);
-}
-
-int
-cfbExpandDirectColors (ColormapPtr pmap, int ndef,
- xColorItem *indefs, xColorItem *outdefs)
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-cfbCreateDefColormap(ScreenPtr pScreen)
-{
- return miCreateDefColormap(pScreen);
-}
-
-void
-cfbClearVisualTypes(void)
-{
- miClearVisualTypes();
-}
-
-Bool
-cfbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of cfb.
- */
-
-Bool
-cfbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB)
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
diff --git a/cfb/cfbcppl.c b/cfb/cfbcppl.c
deleted file mode 100644
index ee4c18fdc..000000000
--- a/cfb/cfbcppl.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * $TOG: cfb8cppl.c /main/16 1998/02/09 14:04:13 kaleb $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.7 2003/07/16 01:38:37 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "cfb.h"
-#if PSZ == 8
-#undef PSZ /* for maskbits.h */
-#include "maskbits.h"
-#define PSZ 8
-#include "mergerop.h"
-#else /* PSZ==8 */
-#include "cfbtab.h" /* provides starttab, endttab, partmasks */
-#endif /* PSZ==8 */
-
-
-void
-cfbCopyImagePlane(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask)
-{
- /* note: there must be some sort of trick behind,
- passing a planemask value with all bits set
- whilst using the current planemask for the bitPlane value. */
-#if PSZ == 8
- cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- (unsigned long) ~0L, planemask);
-#endif
-#if PSZ == 16
- cfbCopyPlane16to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- (unsigned long) ~0L, planemask);
-#endif
-#if PSZ == 24
- cfbCopyPlane24to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- (unsigned long) ~0L, planemask);
-#endif
-#if PSZ == 32
- cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- (unsigned long) ~0L, planemask);
-#endif
-}
-
-#if PSZ == 8
-
-#if BITMAP_BIT_ORDER == MSBFirst
-#define LeftMost (MFB_PPW-1)
-#define StepBit(bit, inc) ((bit) -= (inc))
-#else
-#define LeftMost 0
-#define StepBit(bit, inc) ((bit) += (inc))
-#endif
-
-#define GetBits(psrc, nBits, curBit, bitPos, bits) {\
- bits = 0; \
- while (nBits--) \
- { \
- bits |= (PixelType)(((*psrc++ >> bitPos) & 1)) << curBit; \
- StepBit (curBit, 1); \
- } \
-}
-
-void
-cfbCopyPlane8to1(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask,
- unsigned long bitPlane)
-{
- int srcx, srcy, dstx, dsty, width, height;
- unsigned char *psrcBase;
- PixelType *pdstBase;
- int widthSrc, widthDst;
- unsigned char *psrcLine;
- PixelType *pdstLine;
- register unsigned char *psrc;
- register int i;
- register int curBit;
- register int bitPos;
- register CfbBits bits;
- register PixelType *pdst;
- PixelType startmask, endmask;
- int niStart = 0, niEnd = 0;
- int bitStart = 0, bitEnd = 0;
- int nl, nlMiddle;
- int nbox;
- BoxPtr pbox;
- MROP_DECLARE()
-
- if (!(planemask & 1))
- return;
-
- if (rop != GXcopy)
- MROP_INITIALIZE (rop, planemask);
-
- cfbGetByteWidthAndPointer (pSrcDrawable, widthSrc, psrcBase)
-
- mfbGetPixelWidthAndPointer (pDstDrawable, widthDst, pdstBase)
-
- bitPos = ffs (bitPlane) - 1;
-
- nbox = REGION_NUM_RECTS(prgnDst);
- pbox = REGION_RECTS(prgnDst);
- while (nbox--)
- {
- dstx = pbox->x1;
- dsty = pbox->y1;
- srcx = pptSrc->x;
- srcy = pptSrc->y;
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
- pbox++;
- pptSrc++;
- psrcLine = psrcBase + srcy * widthSrc + srcx;
- pdstLine = mfbScanline(pdstBase, dstx, dsty, widthDst);
- dstx &= MFB_PIM;
- if (dstx + width <= MFB_PPW)
- {
- maskpartialbits(dstx, width, startmask);
- nlMiddle = 0;
- endmask = 0;
- }
- else
- {
- maskbits (dstx, width, startmask, endmask, nlMiddle);
- }
- if (startmask)
- {
- niStart = min(MFB_PPW - dstx, width);
- bitStart = LeftMost;
- StepBit (bitStart, dstx);
- }
- if (endmask)
- {
- niEnd = (dstx + width) & MFB_PIM;
- bitEnd = LeftMost;
- }
- if (rop == GXcopy)
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- mfbScanlineInc(pdstLine, widthDst);
- if (startmask)
- {
- i = niStart;
- curBit = bitStart;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst = (*pdst & ~startmask) | bits;
- pdst++;
- }
- nl = nlMiddle;
- while (nl--)
- {
- i = MFB_PPW;
- curBit = LeftMost;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst++ = bits;
- }
- if (endmask)
- {
- i = niEnd;
- curBit = bitEnd;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst = (*pdst & ~endmask) | bits;
- }
- }
- }
- else
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- mfbScanlineInc(pdstLine, widthDst);
- if (startmask)
- {
- i = niStart;
- curBit = bitStart;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst = MROP_MASK(bits, *pdst, startmask);
- pdst++;
- }
- nl = nlMiddle;
- while (nl--)
- {
- i = MFB_PPW;
- curBit = LeftMost;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst = MROP_SOLID(bits, *pdst);
- pdst++;
- }
- if (endmask)
- {
- i = niEnd;
- curBit = bitEnd;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst = MROP_MASK (bits, *pdst, endmask);
- }
- }
- }
- }
-}
-
-#else /* PSZ == 8 */
-
-#define mfbmaskbits(x, w, startmask, endmask, nlw) \
- startmask = starttab[(x)&0x1f]; \
- endmask = endtab[((x)+(w)) & 0x1f]; \
- if (startmask) \
- nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \
- else \
- nlw = (w) >> 5;
-
-#define mfbmaskpartialbits(x, w, mask) \
- mask = partmasks[(x)&0x1f][(w)&0x1f];
-
-#define LeftMost 0
-#define StepBit(bit, inc) ((bit) += (inc))
-
-
-#if PSZ == 24
-#define GetBits(psrc, nBits, curBit, bitPos, bits) {\
- bits = 0; \
- while (nBits--) \
- { \
- if (bitPos < 8) \
- { \
- bits |= ((*psrc++ >> bitPos) & 1) << curBit; \
- psrc += 2; \
- } \
- else if (bitPos < 16) \
- { \
- psrc++; \
- bits |= ((*psrc++ >> (bitPos - 8)) & 1) << curBit; \
- psrc++; \
- } \
- else \
- { \
- psrc += 2; \
- bits |= ((*psrc++ >> (bitPos - 16)) & 1) << curBit; \
- } \
- StepBit (curBit, 1); \
- } \
-}
-#else
-#define GetBits(psrc, nBits, curBit, bitPos, bits) {\
- bits = 0; \
- while (nBits--) \
- { \
- bits |= ((*psrc++ >> bitPos) & 1) << curBit; \
- StepBit (curBit, 1); \
- } \
-}
-#endif
-
-void
-#if PSZ == 16
-cfbCopyPlane16to1
-#endif
-#if PSZ == 24
-cfbCopyPlane24to1
-#endif
-#if PSZ == 32
-cfbCopyPlane32to1
-#endif
-(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask,
- unsigned long bitPlane)
-{
- int srcx, srcy, dstx, dsty, width, height;
- CfbBits *psrcBase;
- CfbBits *pdstBase;
- int widthSrc, widthDst;
-#if PSZ == 16
- unsigned short *psrcLine;
- register unsigned short *psrc;
-#endif
-#if PSZ == 24
- unsigned char *psrcLine;
- register unsigned char *psrc;
-#endif
-#if PSZ == 32
- unsigned int *psrcLine;
- register unsigned int *psrc;
-#endif
- unsigned int *pdstLine;
- register unsigned int *pdst;
- register int i;
- register int curBit;
- register int bitPos;
- register unsigned int bits;
- unsigned int startmask = 0, endmask = 0;
- int niStart = 0, niEnd = 0;
- int bitStart = 0, bitEnd = 0;
- int nl, nlMiddle;
- int nbox;
- BoxPtr pbox;
- int result;
-
-
- if (!(planemask & 1))
- return;
-
- /* must explicitly ask for "int" widths, as code below expects it */
- /* on some machines (Alpha), "long" and "int" are not the same size */
- cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits)
- cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits)
-
-#if PSZ == 16
- widthSrc <<= 1;
-#endif
-#if PSZ == 24
- widthSrc <<= 2;
-#endif
-
- bitPos = ffs (bitPlane) - 1;
-
- nbox = REGION_NUM_RECTS(prgnDst);
- pbox = REGION_RECTS(prgnDst);
- while (nbox--)
- {
- dstx = pbox->x1;
- dsty = pbox->y1;
- srcx = pptSrc->x;
- srcy = pptSrc->y;
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
- pbox++;
- pptSrc++;
-#if PSZ == 16
- psrcLine = (unsigned short *)psrcBase + srcy * widthSrc + srcx;
-#endif
-#if PSZ == 24
- psrcLine = (unsigned char *)psrcBase + srcy * widthSrc + srcx * 3;
-#endif
-#if PSZ == 32
- psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + srcx;
-#endif
- pdstLine = (unsigned int *)pdstBase + dsty * widthDst + (dstx >> 5);
- if (dstx + width <= 32)
- {
- mfbmaskpartialbits(dstx, width, startmask);
- nlMiddle = 0;
- endmask = 0;
- }
- else
- {
- mfbmaskbits (dstx, width, startmask, endmask, nlMiddle);
- }
- if (startmask)
- {
- niStart = 32 - (dstx & 0x1f);
- bitStart = LeftMost;
- StepBit (bitStart, (dstx & 0x1f));
- }
- if (endmask)
- {
- niEnd = (dstx + width) & 0x1f;
- bitEnd = LeftMost;
- }
- if (rop == GXcopy)
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- if (startmask)
- {
- i = niStart;
- curBit = bitStart;
- GetBits (psrc, i, curBit, bitPos, bits);
-
- *pdst = (*pdst & ~startmask) | bits;
- pdst++;
- }
- nl = nlMiddle;
- while (nl--)
- {
- i = 32;
- curBit = LeftMost;
- GetBits (psrc, i, curBit, bitPos, bits);
- *pdst++ = bits;
- }
- if (endmask)
- {
- i = niEnd;
- curBit = bitEnd;
- GetBits (psrc, i, curBit, bitPos, bits);
-
- *pdst = (*pdst & ~endmask) | bits;
- }
- }
- }
- else
- {
- while (height--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- psrcLine += widthSrc;
- pdstLine += widthDst;
- if (startmask)
- {
- i = niStart;
- curBit = bitStart;
- GetBits (psrc, i, curBit, bitPos, bits);
- DoRop (result, rop, bits, *pdst);
-
- *pdst = (*pdst & ~startmask) |
- (result & startmask);
- pdst++;
- }
- nl = nlMiddle;
- while (nl--)
- {
- i = 32;
- curBit = LeftMost;
- GetBits (psrc, i, curBit, bitPos, bits);
- DoRop (result, rop, bits, *pdst);
- *pdst = result;
- ++pdst;
- }
- if (endmask)
- {
- i = niEnd;
- curBit = bitEnd;
- GetBits (psrc, i, curBit, bitPos, bits);
- DoRop (result, rop, bits, *pdst);
-
- *pdst = (*pdst & ~endmask) |
- (result & endmask);
- }
- }
- }
- }
-}
-
-#endif /* PSZ == 8 */
diff --git a/cfb/cfbfillarc.c b/cfb/cfbfillarc.c
deleted file mode 100644
index 64ec508c8..000000000
--- a/cfb/cfbfillarc.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: cfbfillarc.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "mifillarc.h"
-#include "cfbrrop.h"
-#include "mi.h"
-
-/* gcc 1.35 is stupid */
-#if defined(__GNUC__) && __GNUC__ < 2 && defined(mc68020)
-#define STUPID volatile
-#else
-#define STUPID
-#endif
-
-static void
-RROP_NAME(cfbFillEllipseSolid)(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc)
-{
- STUPID int x, y, e;
- STUPID int yk, xk, ym, xm, dx, dy, xorg, yorg;
- miFillArcRec info;
-#if PSZ == 24
- unsigned char *addrlt, *addrlb;
-#else
- CfbBits *addrlt, *addrlb;
-#endif
- register CfbBits *addrl;
- register int n;
- int nlwidth;
- RROP_DECLARE
- register int xpos;
- register int slw;
- CfbBits startmask, endmask;
- int nlmiddle;
-#if PSZ == 24
- register int pidx;
- int xpos3;
-#endif
-
-#if PSZ == 24
- cfbGetByteWidthAndPointer (pDraw, nlwidth, addrlt)
-#else
- cfbGetLongWidthAndPointer (pDraw, nlwidth, addrlt)
-#endif
-
- RROP_FETCH_GC(pGC);
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- while (y)
- {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
-#if PSZ == 24
- xpos3 = (xpos * 3) & ~0x03;
- addrl = (CfbBits *)((char *)addrlt + xpos3);
- if (slw == 1){
- RROP_SOLID24(addrl, xpos);
- if (miFillArcLower(slw)){
- addrl = (CfbBits *)((char *)addrlb + xpos3);
- RROP_SOLID24(addrl, xpos);
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- xpos &= 3;
- pidx = xpos;
- if (startmask){
- RROP_SOLID_MASK(addrl, startmask, pidx-1);
- addrl++;
- if (pidx == 3)
- pidx = 0;
- }
- n = nlmiddle;
- while (--n >= 0){
- RROP_SOLID(addrl, pidx);
- addrl++;
- if (++pidx == 3)
- pidx = 0;
- }
- if (endmask)
- RROP_SOLID_MASK(addrl, endmask, pidx);
- if (!miFillArcLower(slw))
- continue;
- addrl = (CfbBits *)((char *)addrlb + xpos3);
- pidx = xpos;
- if (startmask){
- RROP_SOLID_MASK(addrl, startmask, pidx-1);
- addrl++;
- if (pidx == 3)
- pidx = 0;
- }
- n = nlmiddle;
- while (--n >= 0){
- RROP_SOLID(addrl, pidx);
- addrl++;
- if (++pidx == 3)
- pidx = 0;
- }
- if (endmask)
- RROP_SOLID_MASK(addrl, endmask, pidx);
-#else /* PSZ == 24 */
- addrl = addrlt + (xpos >> PWSH);
- if (((xpos & PIM) + slw) <= PPW)
- {
- maskpartialbits(xpos, slw, startmask);
- RROP_SOLID_MASK(addrl,startmask);
- if (miFillArcLower(slw))
- {
- addrl = addrlb + (xpos >> PWSH);
- RROP_SOLID_MASK(addrl, startmask);
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- if (startmask)
- {
- RROP_SOLID_MASK(addrl, startmask);
- addrl++;
- }
- n = nlmiddle;
- RROP_SPAN(addrl,n)
-
- if (endmask)
- RROP_SOLID_MASK(addrl, endmask);
- if (!miFillArcLower(slw))
- continue;
- addrl = addrlb + (xpos >> PWSH);
- if (startmask)
- {
- RROP_SOLID_MASK(addrl, startmask);
- addrl++;
- }
- n = nlmiddle;
- RROP_SPAN(addrl, n);
- if (endmask)
- RROP_SOLID_MASK(addrl, endmask);
-#endif /* PSZ == 24 */
- }
- RROP_UNDECLARE
-}
-
-#if PSZ == 24
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl){ \
- n = xr - xl + 1; \
- addrl = (CfbBits *)((char *)addr + ((xl * 3) & ~0x03)); \
- if (n <= 1){ \
- if (n) \
- RROP_SOLID24(addrl, xl); \
- } else { \
- maskbits(xl, n, startmask, endmask, n); \
- pidx = xl & 3; \
- if (startmask){ \
- RROP_SOLID_MASK(addrl, startmask, pidx-1); \
- addrl++; \
- if (pidx == 3) \
- pidx = 0; \
- } \
- while (--n >= 0){ \
- RROP_SOLID(addrl, pidx); \
- addrl++; \
- if (++pidx == 3) \
- pidx = 0; \
- } \
- if (endmask) \
- RROP_SOLID_MASK(addrl, endmask, pidx); \
- } \
- }
-#else /* PSZ == 24 */
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) \
- { \
- n = xr - xl + 1; \
- addrl = addr + (xl >> PWSH); \
- if (((xl & PIM) + n) <= PPW) \
- { \
- maskpartialbits(xl, n, startmask); \
- RROP_SOLID_MASK(addrl, startmask); \
- } \
- else \
- { \
- maskbits(xl, n, startmask, endmask, n); \
- if (startmask) \
- { \
- RROP_SOLID_MASK(addrl, startmask); \
- addrl++; \
- } \
- while (n--) \
- { \
- RROP_SOLID(addrl); \
- ++addrl; \
- } \
- if (endmask) \
- RROP_SOLID_MASK(addrl, endmask); \
- } \
- }
-#endif /* PSZ == 24 */
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) \
- { \
- FILLSPAN(xl, xr, addr); \
- } \
- else \
- { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-RROP_NAME(cfbFillArcSliceSolid)(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc)
-{
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
-#if PSZ == 24
- unsigned char *addrlt, *addrlb;
-#else
- CfbBits *addrlt, *addrlb;
-#endif
- register CfbBits *addrl;
- register int n;
- int nlwidth;
- RROP_DECLARE
- CfbBits startmask, endmask;
-#if PSZ == 24
- register int pidx;
-#endif /* PSZ == 24 */
-
-#if PSZ == 24
- cfbGetByteWidthAndPointer (pDraw, nlwidth, addrlt)
-#else
- cfbGetLongWidthAndPointer (pDraw, nlwidth, addrlt)
-#endif
-
- RROP_FETCH_GC(pGC);
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0)
- {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrlt);
- }
- if (miFillSliceLower(slice))
- {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrlb);
- }
- }
- RROP_UNDECLARE
-}
-
-void
-RROP_NAME(cfbPolyFillArcSolid) (pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- int x2, y2;
- BoxRec box;
- RegionPtr cclip;
-
- cclip = cfbGetCompositeClip(pGC);
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- RROP_NAME(cfbFillEllipseSolid)(pDraw, pGC, arc);
- else
- RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/cfb/cfbfillrct.c b/cfb/cfbfillrct.c
deleted file mode 100644
index c6a7270c2..000000000
--- a/cfb/cfbfillrct.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Fill rectangles.
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbfillrct.c,v 3.8 2001/12/14 19:59:22 dawes Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $Xorg: cfbfillrct.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "mergerop.h"
-
-
-void
-cfbFillBoxTileOdd (pDrawable, n, rects, tile, xrot, yrot)
- DrawablePtr pDrawable;
- int n;
- BoxPtr rects;
- PixmapPtr tile;
- int xrot, yrot;
-{
-#if PSZ == 24
- if (tile->drawable.width & 3)
-#else
- if (tile->drawable.width & PIM)
-#endif
- cfbFillBoxTileOddCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L);
- else
- cfbFillBoxTile32sCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L);
-}
-
-void
-cfbFillRectTileOdd (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox;
- BoxPtr pBox;
-{
- int xrot, yrot;
- void (*fill)(DrawablePtr, int, BoxPtr, PixmapPtr, int, int, int, unsigned long);
-
- xrot = pDrawable->x + pGC->patOrg.x;
- yrot = pDrawable->y + pGC->patOrg.y;
-#if PSZ == 24
- if (pGC->tile.pixmap->drawable.width & 3)
-#else
- if (pGC->tile.pixmap->drawable.width & PIM)
-#endif
- {
- fill = cfbFillBoxTileOddGeneral;
- if ((pGC->planemask & PMSK) == PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = cfbFillBoxTileOddCopy;
- }
- }
- else
- {
- fill = cfbFillBoxTile32sGeneral;
- if ((pGC->planemask & PMSK) == PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = cfbFillBoxTile32sCopy;
- }
- }
- (*fill) (pDrawable, nBox, pBox, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask);
-}
-
-#define NUM_STACK_RECTS 1024
-
-void
-cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- cfbPrivGC *priv;
- int numRects;
- void (*BoxFill)(DrawablePtr, GCPtr, int, BoxPtr);
- int n;
- int xorg, yorg;
-
-#if PSZ != 8
- if ((pGC->fillStyle == FillStippled) ||
- (pGC->fillStyle == FillOpaqueStippled)) {
- miPolyFillRect(pDrawable, pGC, nrectFill, prectInit);
- return;
- }
-#endif
-
- priv = cfbGetGCPrivate(pGC);
- prgnClip = pGC->pCompositeClip;
-
- BoxFill = 0;
- switch (pGC->fillStyle)
- {
- case FillSolid:
- switch (priv->rop) {
- case GXcopy:
- BoxFill = cfbFillRectSolidCopy;
- break;
- case GXxor:
- BoxFill = cfbFillRectSolidXor;
- break;
- default:
- BoxFill = cfbFillRectSolidGeneral;
- break;
- }
- break;
- case FillTiled:
- if (!pGC->pRotatedPixmap)
- BoxFill = cfbFillRectTileOdd;
- else
- {
- if (pGC->alu == GXcopy && (pGC->planemask & PMSK) == PMSK)
- BoxFill = cfbFillRectTile32Copy;
- else
- BoxFill = cfbFillRectTile32General;
- }
- break;
-#if PSZ == 8
- case FillStippled:
- if (!pGC->pRotatedPixmap)
- BoxFill = cfb8FillRectStippledUnnatural;
- else
- BoxFill = cfb8FillRectTransparentStippled32;
- break;
- case FillOpaqueStippled:
- if (!pGC->pRotatedPixmap)
- BoxFill = cfb8FillRectStippledUnnatural;
- else
- BoxFill = cfb8FillRectOpaqueStippled32;
- break;
-#endif
- }
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg)
- {
- prect = prectInit;
- n = nrectFill;
- while(n--)
- {
- prect->x += xorg;
- prect->y += yorg;
- prect++;
- }
- }
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS)
- {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1)
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2))
- {
- pboxClipped++;
- }
- }
- }
- else
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2)
- {
- pboxClipped++;
- }
- }
- }
- }
- if (pboxClipped != pboxClippedBase)
- (*BoxFill) (pDrawable, pGC,
- pboxClipped-pboxClippedBase, pboxClippedBase);
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/cfb/cfbfillsp.c b/cfb/cfbfillsp.c
deleted file mode 100644
index 14a6a9d52..000000000
--- a/cfb/cfbfillsp.c
+++ /dev/null
@@ -1,1002 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: cfbfillsp.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-#include "mergerop.h"
-
-#if PSZ == 8
-#include "cfb8bit.h"
-#endif
-
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-/* scanline filling for color frame buffer
- written by drewry, oct 1986 modified by smarks
- changes for compatibility with Little-endian systems Jul 1987; MIT:yba.
-
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in cfbCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-
- FillSolid is overloaded to be used for OpaqueStipple as well,
-if fgPixel == bgPixel.
-Note that for solids, PrivGC.rop == PrivGC.ropOpStip
-
-
- FillTiled is overloaded to be used for OpaqueStipple, if
-fgPixel != bgPixel. based on the fill style, it uses
-{RotatedTile, gc.alu} or {RotatedStipple, PrivGC.ropOpStip}
-*/
-
-#ifdef notdef
-#include <stdio.h>
-static
-dumpspans(n, ppt, pwidth)
- int n;
- DDXPointPtr ppt;
- int *pwidth;
-{
- fprintf(stderr,"%d spans\n", n);
- while (n--) {
- fprintf(stderr, "[%d,%d] %d\n", ppt->x, ppt->y, *pwidth);
- ppt++;
- pwidth++;
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-/* Fill spans with tiles that aren't 32 bits wide */
-void
-cfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
-DrawablePtr pDrawable;
-GC *pGC;
-int nInit; /* number of spans to fill */
-DDXPointPtr pptInit; /* pointer to list of start points */
-int *pwidthInit; /* pointer to list of n widths */
-int fSorted;
-{
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- void (*fill)(DrawablePtr, int, DDXPointPtr, int *, PixmapPtr, int, int, int, unsigned long);
- int xrot, yrot;
-
- if (!(pGC->planemask))
- return;
-
-#if PSZ == 24
- if (pGC->tile.pixmap->drawable.width & 3)
-#else
- if (pGC->tile.pixmap->drawable.width & PIM)
-#endif
- {
- fill = cfbFillSpanTileOddGeneral;
- if ((pGC->planemask & PMSK) == PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = cfbFillSpanTileOddCopy;
- }
- }
- else
- {
- fill = cfbFillSpanTile32sGeneral;
- if ((pGC->planemask & PMSK) == PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = cfbFillSpanTile32sCopy;
- }
- }
- n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
- if ( n == 0 )
- return;
- pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!ppt || !pwidth)
- {
- if (ppt) DEALLOCATE_LOCAL(ppt);
- if (pwidth) DEALLOCATE_LOCAL(pwidth);
- return;
- }
- n = miClipSpans( cfbGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- xrot = pDrawable->x + pGC->patOrg.x;
- yrot = pDrawable->y + pGC->patOrg.y;
-
- (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask);
-
- DEALLOCATE_LOCAL(ppt);
- DEALLOCATE_LOCAL(pwidth);
-}
-
-#if PSZ == 8
-
-void
-cfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
-DrawablePtr pDrawable;
-GC *pGC;
-int nInit; /* number of spans to fill */
-DDXPointPtr pptInit; /* pointer to list of start points */
-int *pwidthInit; /* pointer to list of n widths */
-int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidth; /* pointer to list of n widths */
- int *pwidthFree;/* copies of the pointers to free */
- DDXPointPtr pptFree;
- CfbBits *pdstBase; /* pointer to start of bitmap */
- int nlwDst; /* width in longwords of bitmap */
- register CfbBits *pdst; /* pointer to current word in bitmap */
- PixmapPtr pStipple; /* pointer to stipple we want to fill with */
- int nlw;
- int x, y, w, xrem, xSrc, ySrc;
- int stwidth, stippleWidth;
- int stippleHeight;
- register CfbBits bits, inputBits;
- register int partBitsLeft;
- int nextPartBits;
- int bitsLeft, bitsWhole;
- CfbBits *srcTemp, *srcStart;
- CfbBits *psrcBase;
- CfbBits startmask, endmask;
-
- if (pGC->fillStyle == FillStippled)
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
- else
- cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask);
-
- if (cfb8StippleRRop == GXnoop)
- return;
-
- n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
- if ( n == 0 )
- return;
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
-
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans( cfbGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- /*
- * OK, so what's going on here? We have two Drawables:
- *
- * The Stipple:
- * Depth = 1
- * Width = stippleWidth
- * Words per scanline = stwidth
- * Pointer to pixels = pStipple->devPrivate.ptr
- */
-
- pStipple = pGC->stipple;
-
- stwidth = pStipple->devKind >> PWSH;
- stippleWidth = pStipple->drawable.width;
- stippleHeight = pStipple->drawable.height;
- psrcBase = (CfbBits *) pStipple->devPrivate.ptr;
-
- /*
- * The Target:
- * Depth = PSZ
- * Width = determined from *pwidth
- * Words per scanline = nlwDst
- * Pointer to pixels = addrlBase
- */
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pdstBase)
-
- /* this replaces rotating the stipple. Instead we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and xrem always stay within the stipple bounds.
- */
-
- modulus (pGC->patOrg.x, stippleWidth, xSrc);
- xSrc += pDrawable->x - stippleWidth;
- modulus (pGC->patOrg.y, stippleHeight, ySrc);
- ySrc += pDrawable->y - stippleHeight;
-
- bitsWhole = stippleWidth;
-
- while (n--)
- {
- x = ppt->x;
- y = ppt->y;
- ppt++;
- w = *pwidth++;
- pdst = pdstBase + y * nlwDst + (x >> PWSH);
- y = (y - ySrc) % stippleHeight;
- srcStart = psrcBase + y * stwidth;
- xrem = ((x & ~(PGSZB-1)) - xSrc) % stippleWidth;
- srcTemp = srcStart + (xrem >> MFB_PWSH);
- bitsLeft = stippleWidth - (xrem & ~MFB_PIM);
- xrem &= MFB_PIM;
- NextUnnaturalStippleWord
- if (partBitsLeft < xrem)
- FatalError ("cfbUnnaturalStippleFS bad partBitsLeft %d xrem %d",
- partBitsLeft, xrem);
- NextSomeBits (inputBits, xrem);
- partBitsLeft -= xrem;
- if (((x & PIM) + w) <= PPW)
- {
- maskpartialbits (x, w, startmask)
- NextUnnaturalStippleBits
- *pdst = MaskRRopPixels(*pdst,bits,startmask);
- }
- else
- {
- maskbits (x, w, startmask, endmask, nlw);
- nextPartBits = (x & (PGSZB-1)) + w;
- if (nextPartBits < partBitsLeft)
- {
- if (startmask)
- {
- MaskRRopBitGroup(pdst,GetBitGroup(inputBits),startmask)
- pdst++;
- NextBitGroup (inputBits);
- }
- while (nlw--)
- {
- RRopBitGroup (pdst, GetBitGroup (inputBits));
- pdst++;
- NextBitGroup (inputBits);
- }
- if (endmask)
- {
- MaskRRopBitGroup(pdst,GetBitGroup(inputBits),endmask)
- }
- }
- else if (bitsLeft != bitsWhole && nextPartBits < partBitsLeft + bitsLeft)
- {
- NextUnnaturalStippleBitsFast
- if (startmask)
- {
- *pdst = MaskRRopPixels(*pdst,bits,startmask);
- pdst++;
- NextUnnaturalStippleBitsFast
- }
- while (nlw--)
- {
- *pdst = RRopPixels(*pdst,bits);
- pdst++;
- NextUnnaturalStippleBitsFast
- }
- if (endmask)
- *pdst = MaskRRopPixels (*pdst,bits,endmask);
- }
- else
- {
- NextUnnaturalStippleBits
- if (startmask)
- {
- *pdst = MaskRRopPixels(*pdst,bits,startmask);
- pdst++;
- NextUnnaturalStippleBits
- }
- while (nlw--)
- {
- *pdst = RRopPixels(*pdst,bits);
- pdst++;
- NextUnnaturalStippleBits
- }
- if (endmask)
- *pdst = MaskRRopPixels(*pdst,bits,endmask);
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-#else /* PSZ != 8 */
-
-/* Fill spans with stipples that aren't 32 bits wide */
-void
-cfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
-DrawablePtr pDrawable;
-GC *pGC;
-int nInit; /* number of spans to fill */
-DDXPointPtr pptInit; /* pointer to list of start points */
-int *pwidthInit; /* pointer to list of n widths */
-int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- int iline; /* first line of tile to use */
- CfbBits *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register CfbBits *pdst; /* pointer to current word in bitmap */
- PixmapPtr pStipple; /* pointer to stipple we want to fill with */
- register int w;
- int width, x, xrem, xSrc, ySrc;
- CfbBits tmpSrc, tmpDst1, tmpDst2;
- int stwidth, stippleWidth;
- CfbBits *psrcS;
- int rop, stiprop = 0;
- int stippleHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- CfbBits fgfill, bgfill;
-
- if (!(pGC->planemask))
- return;
-
- n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
- if ( n == 0 )
- return;
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans( cfbGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
- rop = pGC->alu;
- if (pGC->fillStyle == FillStippled) {
- switch (rop) {
- case GXand:
- case GXcopy:
- case GXnoop:
- case GXor:
- stiprop = rop;
- break;
- default:
- stiprop = rop;
- rop = GXcopy;
- }
- }
- fgfill = PFILL(pGC->fgPixel);
- bgfill = PFILL(pGC->bgPixel);
-
- /*
- * OK, so what's going on here? We have two Drawables:
- *
- * The Stipple:
- * Depth = 1
- * Width = stippleWidth
- * Words per scanline = stwidth
- * Pointer to pixels = pStipple->devPrivate.ptr
- */
- pStipple = pGC->stipple;
-
- stwidth = pStipple->devKind / PGSZB;
- stippleWidth = pStipple->drawable.width;
- stippleHeight = pStipple->drawable.height;
-
- /*
- * The Target:
- * Depth = PSZ
- * Width = determined from *pwidth
- * Words per scanline = nlwidth
- * Pointer to pixels = addrlBase
- */
-
- cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrlBase)
-
- /* this replaces rotating the stipple. Instead we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and xrem always stay within the stipple bounds.
- */
- modulus (pGC->patOrg.x, stippleWidth, xSrc);
- xSrc += pDrawable->x - stippleWidth;
- modulus (pGC->patOrg.y, stippleHeight, ySrc);
- ySrc += pDrawable->y - stippleHeight;
-
- while (n--)
- {
- iline = (ppt->y - ySrc) % stippleHeight;
- x = ppt->x;
- pdst = addrlBase + (ppt->y * nlwidth);
- psrcS = (CfbBits *) pStipple->devPrivate.ptr + (iline * stwidth);
-
- if (*pwidth)
- {
- width = *pwidth;
- while(width > 0)
- {
- int xtemp;
-#if PSZ != 32 || PPW != 1
- int tmpx;
-#endif
- register CfbBits *ptemp;
- register CfbBits *pdsttmp;
- /*
- * Do a stripe through the stipple & destination w pixels
- * wide. w is not more than:
- * - the width of the destination
- * - the width of the stipple
- * - the distance between x and the next word
- * boundary in the destination
- * - the distance between x and the next word
- * boundary in the stipple
- */
-
- /* width of dest/stipple */
- xrem = (x - xSrc) % stippleWidth;
-#if PSZ == 24
- w = 1;
-#else
- w = min((stippleWidth - xrem), width);
- /* dist to word bound in dest */
- w = min(w, PPW - (x & PIM));
- /* dist to word bound in stip */
- w = min(w, MFB_PPW - (x & MFB_PIM));
-#endif
-
- xtemp = (xrem & MFB_PIM);
- ptemp = (CfbBits *)(psrcS + (xrem >> MFB_PWSH));
-#if PSZ == 24
- tmpx = x & 3;
- pdsttmp = pdst + ((x * 3)>>2);
-#else
-#if PSZ != 32 || PPW != 1
- tmpx = x & PIM;
-#endif
- pdsttmp = pdst + (x>>PWSH);
-#endif
- switch ( pGC->fillStyle ) {
- case FillOpaqueStippled:
-#if PSZ == 24
- getstipplepixels24(ptemp, xtemp, 0, &bgfill, &tmpDst1, xrem);
- getstipplepixels24(ptemp, xtemp, 1, &fgfill, &tmpDst2, xrem);
-#else
- getstipplepixels(ptemp, xtemp, w, 0, &bgfill, &tmpDst1);
- getstipplepixels(ptemp, xtemp, w, 1, &fgfill, &tmpDst2);
-#endif
- break;
- case FillStippled:
- /* Fill tmpSrc with the source pixels */
-#if PSZ == 24
- getbits24(pdsttmp, tmpSrc, x);
- getstipplepixels24(ptemp, xtemp, 0, &tmpSrc, &tmpDst1, xrem);
-#else
- getbits(pdsttmp, tmpx, w, tmpSrc);
- getstipplepixels(ptemp, xtemp, w, 0, &tmpSrc, &tmpDst1);
-#endif
- if (rop != stiprop) {
-#if PSZ == 24
- putbitsrop24(fgfill, 0, &tmpSrc, pGC->planemask, stiprop);
-#else
- putbitsrop(fgfill, 0, w, &tmpSrc, pGC->planemask, stiprop);
-#endif
- } else {
- tmpSrc = fgfill;
- }
-#if PSZ == 24
- getstipplepixels24(ptemp, xtemp, 1, &tmpSrc, &tmpDst2, xrem);
-#else
- getstipplepixels(ptemp, xtemp, w, 1, &tmpSrc, &tmpDst2);
-#endif
- break;
- }
- tmpDst2 |= tmpDst1;
-#if PSZ == 24
- putbitsrop24(tmpDst2, tmpx, pdsttmp, pGC->planemask, rop);
-#else
- putbitsrop(tmpDst2, tmpx, w, pdsttmp, pGC->planemask, rop);
-#endif
- x += w;
- width -= w;
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-#endif /* PSZ == 8 */
-
-#if PSZ == 8
-
-void
-cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidth; /* pointer to list of n widths */
- CfbBits *src; /* pointer to bits in stipple, if needed */
- int stippleHeight; /* height of the stipple */
- PixmapPtr stipple;
-
- int nlwDst; /* width in longwords of the dest pixmap */
- int x,y,w; /* current span */
- CfbBits startmask;
- CfbBits endmask;
- register CfbBits *dst; /* pointer to bits we're writing */
- register int nlw;
- CfbBits *dstTmp;
- int nlwTmp;
-
- CfbBits *pbits; /* pointer to start of pixmap */
- register CfbBits xor;
- register CfbBits mask;
- register CfbBits bits; /* bits from stipple */
- int wEnd;
-
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- cfbPrivGCPtr devPriv;
-
- devPriv = cfbGetGCPrivate(pGC);
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- if ( n == 0 )
- return;
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- stipple = pGC->pRotatedPixmap;
- src = (CfbBits *)stipple->devPrivate.ptr;
- stippleHeight = stipple->drawable.height;
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
- while (n--)
- {
- w = *pwidth++;
- x = ppt->x;
- y = ppt->y;
- ppt++;
- dst = pbits + (y * nlwDst) + (x >> PWSH);
- if (((x & PIM) + w) <= PPW)
- {
- maskpartialbits(x, w, startmask);
- endmask = 0;
- nlw = 0;
- }
- else
- {
- maskbits (x, w, startmask, endmask, nlw);
- }
- bits = src[y % stippleHeight];
- RotBitsLeft (bits, (x & ((PGSZ-1) & ~PIM)));
-#if PPW == 4
- if (cfb8StippleRRop == GXcopy)
- {
- xor = devPriv->xor;
- if (w < (PGSZ*2))
- {
- if (startmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dst = (*dst & ~(mask & startmask)) |
- (xor & (mask & startmask));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- while (nlw--)
- {
- WriteBitGroup (dst,xor,GetBitGroup(bits))
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dst = (*dst & ~(mask & endmask)) |
- (xor & (mask & endmask));
- }
- }
- else
- { /* XXX constants probably not OK here */
- wEnd = 7 - (nlw & 7);
- nlw = (nlw >> 3) + 1;
- dstTmp = dst;
- nlwTmp = nlw;
- if (startmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dstTmp = (*dstTmp & ~(mask & startmask)) |
- (xor & (mask & startmask));
- dstTmp++;
- RotBitsLeft (bits, PGSZB);
- }
- w = 7 - wEnd;
- while (w--)
- {
- dst = dstTmp;
- dstTmp++;
- nlw = nlwTmp;
-#if defined(__GNUC__) && defined(mc68020)
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- xor = xor & mask;
- mask = ~mask;
- while (nlw--)
- {
- *dst = (*dst & mask) | xor;
- dst += 8;
- }
- xor = devPriv->xor;
-#else
-#define SwitchBitsLoop(body) \
- while (nlw--) \
- { \
- body \
- dst += 8; \
- }
- SwitchBitGroup(dst, xor, GetBitGroup(bits));
-#undef SwitchBitsLoop
-#endif
- NextBitGroup (bits);
- }
- nlwTmp--;
- w = wEnd + 1;
- if (endmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- dst = dstTmp + (nlwTmp << 3);
- *dst = (*dst & ~(mask & endmask)) |
- (xor & (mask & endmask));
- }
- while (w--)
- {
- nlw = nlwTmp;
- dst = dstTmp;
- dstTmp++;
-#if defined(__GNUC__) && defined(mc68020)
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- xor = xor & mask;
- mask = ~mask;
- while (nlw--)
- {
- *dst = (*dst & mask) | xor;
- dst += 8;
- }
- xor = devPriv->xor;
-#else
-#define SwitchBitsLoop(body) \
- while (nlw--) \
- { \
- body \
- dst += 8; \
- }
- SwitchBitGroup(dst, xor, GetBitGroup(bits));
-#undef SwitchBitsLoop
-#endif
- NextBitGroup (bits);
- }
- }
- }
- else
-#endif /* PPW == 4 */
- {
- if (startmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- while (nlw--)
- {
- RRopBitGroup(dst, GetBitGroup(bits));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, endmask);
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidth; /* pointer to list of n widths */
- CfbBits *src; /* pointer to bits in stipple, if needed */
- int stippleHeight; /* height of the stipple */
- PixmapPtr stipple;
-
- int nlwDst; /* width in longwords of the dest pixmap */
- int x,y,w; /* current span */
- CfbBits startmask;
- CfbBits endmask;
- register CfbBits *dst; /* pointer to bits we're writing */
- register int nlw;
- CfbBits *dstTmp;
- int nlwTmp;
-
- CfbBits *pbits; /* pointer to start of pixmap */
- register CfbBits xor;
- register CfbBits bits; /* bits from stipple */
- int wEnd;
-
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- cfbPrivGCPtr devPriv;
-
- devPriv = cfbGetGCPrivate(pGC);
-
- cfb8CheckOpaqueStipple(pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask);
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- if ( n == 0 )
- return;
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- stipple = pGC->pRotatedPixmap;
- src = (CfbBits *)stipple->devPrivate.ptr;
- stippleHeight = stipple->drawable.height;
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
- while (n--)
- {
- w = *pwidth++;
- x = ppt->x;
- y = ppt->y;
- ppt++;
- dst = pbits + (y * nlwDst) + (x >> PWSH);
- if (((x & PIM) + w) <= PPW)
- {
- maskpartialbits(x, w, startmask);
- endmask = 0;
- nlw = 0;
- }
- else
- {
- maskbits (x, w, startmask, endmask, nlw);
- }
- bits = src[y % stippleHeight];
- RotBitsLeft (bits, (x & ((PGSZ-1) & ~PIM)));
-#if PPW == 4
- if (cfb8StippleRRop == GXcopy)
- {
- xor = devPriv->xor;
- if (w < PGSZ*2)
- {
- if (startmask)
- {
- *dst = (*dst & ~startmask) |
- (GetPixelGroup (bits) & startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- while (nlw--)
- {
- *dst++ = GetPixelGroup(bits);
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- *dst = (*dst & ~endmask) |
- (GetPixelGroup (bits) & endmask);
- }
- }
- else
- { /* XXX consts probably not OK here */
- wEnd = 7 - (nlw & 7);
- nlw = (nlw >> 3) + 1;
- dstTmp = dst;
- nlwTmp = nlw;
- if (startmask)
- {
- *dstTmp = (*dstTmp & ~startmask) |
- (GetPixelGroup (bits) & startmask);
- dstTmp++;
- RotBitsLeft (bits, PGSZB);
- }
- w = 7 - wEnd;
- while (w--)
- {
- nlw = nlwTmp;
- dst = dstTmp;
- dstTmp++;
- xor = GetPixelGroup (bits);
- while (nlw--)
- {
- *dst = xor;
- dst += 8;
- }
- NextBitGroup (bits);
- }
- nlwTmp--;
- w = wEnd + 1;
- if (endmask)
- {
- dst = dstTmp + (nlwTmp << 3);
- *dst = (*dst & ~endmask) |
- (GetPixelGroup (bits) & endmask);
- }
- while (w--)
- {
- nlw = nlwTmp;
- dst = dstTmp;
- dstTmp++;
- xor = GetPixelGroup (bits);
- while (nlw--)
- {
- *dst = xor;
- dst += 8;
- }
- NextBitGroup (bits);
- }
- }
- }
- else
-#endif /* PPW == 4 */
- {
- if (startmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- while (nlw--)
- {
- RRopBitGroup(dst, GetBitGroup(bits));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, endmask);
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-#endif /* PSZ == 8 */
diff --git a/cfb/cfbgc.c b/cfb/cfbgc.c
deleted file mode 100644
index c2e7a5965..000000000
--- a/cfb/cfbgc.c
+++ /dev/null
@@ -1,791 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbgc.c,v 1.6 2001/12/14 19:59:22 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: cfbgc.c,v 1.4 2001/02/09 02:04:37 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "mibstore.h"
-#include "migc.h"
-
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-#if PSZ == 8
-# define useTEGlyphBlt cfbTEGlyphBlt8
-#else
-# ifdef WriteBitGroup
-# define useTEGlyphBlt cfbImageGlyphBlt8
-# else
-# define useTEGlyphBlt cfbTEGlyphBlt
-# endif
-#endif
-
-#ifdef WriteBitGroup
-# define useImageGlyphBlt cfbImageGlyphBlt8
-# define usePolyGlyphBlt cfbPolyGlyphBlt8
-#else
-# define useImageGlyphBlt miImageGlyphBlt
-# define usePolyGlyphBlt miPolyGlyphBlt
-#endif
-
-#ifdef FOUR_BIT_CODE
-# define usePushPixels cfbPushPixels8
-#else
-#ifndef LOWMEMFTPT
-# define usePushPixels mfbPushPixels
-#else
-# define usePushPixels miPushPixels
-#endif /* ifndef LOWMEMFTPT */
-#endif
-
-#ifdef PIXEL_ADDR
-# define ZeroPolyArc cfbZeroPolyArcSS8Copy
-#else
-# define ZeroPolyArc miZeroPolyArc
-#endif
-
-GCFuncs cfbGCFuncs = {
- cfbValidateGC,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-
-GCOps cfbTEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps cfbNonTEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps cfbTEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
- ZeroPolyArc,
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps cfbNonTEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
-#ifdef PIXEL_ADDR
- cfbZeroPolyArcSS8Copy,
-#else
- miZeroPolyArc,
-#endif
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps *
-cfbMatchCommon (pGC, devPriv)
- GCPtr pGC;
- cfbPrivGCPtr devPriv;
-{
- if (pGC->lineWidth != 0)
- return 0;
- if (pGC->lineStyle != LineSolid)
- return 0;
- if (pGC->fillStyle != FillSolid)
- return 0;
- if (devPriv->rop != GXcopy)
- return 0;
- if (pGC->font &&
- FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
- FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
- {
- if (TERMINALFONT(pGC->font)
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
-#ifdef NO_ONE_RECT
- return &cfbTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfbTEOps1Rect;
- else
- return &cfbTEOps;
-#endif
- else
-#ifdef NO_ONE_RECT
- return &cfbNonTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfbNonTEOps1Rect;
- else
- return &cfbNonTEOps;
-#endif
- }
- return 0;
-}
-
-Bool
-cfbCreateGC(pGC)
- register GCPtr pGC;
-{
- cfbPrivGC *pPriv;
-
- if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD)
- return (mfbCreateGC(pGC));
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- /*
- * some of the output primitives aren't really necessary, since they
- * will be filled in ValidateGC because of dix/CreateGC() setting all
- * the change bits. Others are necessary because although they depend
- * on being a color frame buffer, they don't change
- */
-
- pGC->ops = &cfbNonTEOps;
- pGC->funcs = &cfbGCFuncs;
-
- /* cfb wants to translate before scan conversion */
- pGC->miTranslate = 1;
-
- pPriv = cfbGetGCPrivate(pGC);
- pPriv->rop = pGC->alu;
- pPriv->oneRect = FALSE;
- pGC->fExpose = TRUE;
- pGC->freeCompClip = FALSE;
- pGC->pRotatedPixmap = (PixmapPtr) NULL;
- return TRUE;
-}
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-void
-cfbValidateGC(pGC, changes, pDrawable)
- register GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int new_rrop;
- int new_line, new_text, new_fillspans, new_fillarea;
- int new_rotate;
- int xrot, yrot;
- /* flags for changing the proc vector */
- cfbPrivGCPtr devPriv;
- int oneRect;
-
- new_rotate = pGC->lastWinOrg.x != pDrawable->x ||
- pGC->lastWinOrg.y != pDrawable->y;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
- devPriv = cfbGetGCPrivate(pGC);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fillspans = FALSE;
- new_fillarea = FALSE;
-
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- miComputeCompositeClip (pGC, pDrawable);
-#ifdef NO_ONE_RECT
- devPriv->oneRect = FALSE;
-#else
- oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
- if (oneRect != devPriv->oneRect)
- new_line = TRUE;
- devPriv->oneRect = oneRect;
-#endif
- }
-
- mask = changes;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
-
- /*
- * this switch acculmulates a list of which procedures might have
- * to change due to changes in the GC. in some cases (e.g.
- * changing one 16 bit tile for another) we might not really need
- * a change, but the code is being paranoid. this sort of batching
- * wins if, for example, the alu and the font have been changed,
- * or any other pair of items that both change the same thing.
- */
- switch (index) {
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCPlaneMask:
- new_rrop = TRUE;
- new_text = TRUE;
- break;
- case GCBackground:
- break;
- case GCLineStyle:
- case GCLineWidth:
- new_line = TRUE;
- break;
- case GCJoinStyle:
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_text = TRUE;
- new_fillspans = TRUE;
- new_line = TRUE;
- new_fillarea = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
-
- case GCStipple:
- if (pGC->stipple)
- {
- int width = pGC->stipple->drawable.width;
- PixmapPtr nstipple;
-
- if ((width <= PGSZ) && !(width & (width - 1)) &&
- (nstipple = cfbCopyPixmap(pGC->stipple)))
- {
- cfbPadPixmap(nstipple);
- (*pGC->pScreen->DestroyPixmap)(pGC->stipple);
- pGC->stipple = nstipple;
- }
- }
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
-
- case GCTileStipXOrigin:
- new_rotate = TRUE;
- break;
-
- case GCTileStipYOrigin:
- new_rotate = TRUE;
- break;
-
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- break;
- case GCGraphicsExposures:
- break;
- case GCClipXOrigin:
- break;
- case GCClipYOrigin:
- break;
- case GCClipMask:
- break;
- case GCDashOffset:
- break;
- case GCDashList:
- break;
- case GCArcMode:
- break;
- default:
- break;
- }
- }
-
- /*
- * If the drawable has changed, ensure suitable
- * entries are in the proc vector.
- */
- if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS))) {
- new_fillspans = TRUE; /* deal with FillSpans later */
- }
-
- if (new_rotate || new_fillspans)
- {
- Bool new_pix = FALSE;
-
- xrot = pGC->patOrg.x + pDrawable->x;
- yrot = pGC->patOrg.y + pDrawable->y;
-
- switch (pGC->fillStyle)
- {
- case FillTiled:
- if (!pGC->tileIsPixel)
- {
- int width = pGC->tile.pixmap->drawable.width * PSZ;
-
- if ((width <= PGSZ) && !(width & (width - 1)))
- {
- cfbCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- }
- break;
-#ifdef FOUR_BIT_CODE
- case FillStippled:
- case FillOpaqueStippled:
- {
- int width = pGC->stipple->drawable.width;
-
- if ((width <= PGSZ) && !(width & (width - 1)))
- {
- mfbCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- }
- break;
-#endif
- }
- if (!new_pix && pGC->pRotatedPixmap)
- {
- (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- pGC->pRotatedPixmap = (PixmapPtr) NULL;
- }
- }
-
- if (new_rrop)
- {
- int old_rrop;
-
- old_rrop = devPriv->rop;
- devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
- pGC->planemask,
- &devPriv->and, &devPriv->xor);
- if (old_rrop == devPriv->rop)
- new_rrop = FALSE;
- else
- {
-#ifdef PIXEL_ADDR
- new_line = TRUE;
-#endif
-#ifdef WriteBitGroup
- new_text = TRUE;
-#endif
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- }
- }
-
- if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
- {
- GCOps *newops;
-
- if ((newops = cfbMatchCommon (pGC, devPriv)))
- {
- if (pGC->ops->devPrivate.val)
- miDestroyGCOps (pGC->ops);
- pGC->ops = newops;
- new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
- }
- else
- {
- if (!pGC->ops->devPrivate.val)
- {
- pGC->ops = miCreateGCOps (pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
- }
-
- /* deal with the changes we've collected */
- if (new_line)
- {
- pGC->ops->FillPolygon = miFillPolygon;
-#ifdef NO_ONE_RECT
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#else
- if (devPriv->oneRect && pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#endif
- if (pGC->lineWidth == 0)
- {
-#ifdef PIXEL_ADDR
- if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
- {
- switch (devPriv->rop)
- {
- case GXxor:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
- break;
- case GXcopy:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
- break;
- default:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
- break;
- }
- }
- else
-#endif
- pGC->ops->PolyArc = miZeroPolyArc;
- }
- else
- pGC->ops->PolyArc = miPolyArc;
- pGC->ops->PolySegment = miPolySegment;
- switch (pGC->lineStyle)
- {
- case LineSolid:
- if(pGC->lineWidth == 0)
- {
- if (pGC->fillStyle == FillSolid)
- {
-#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
- if (devPriv->oneRect &&
- ((pDrawable->x >= pGC->pScreen->width - 32768) &&
- (pDrawable->y >= pGC->pScreen->height - 32768)))
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- } else
-#endif
-#ifdef NO_ONE_RECT
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- }
-#else
- {
- pGC->ops->Polylines = cfbLineSS;
- pGC->ops->PolySegment = cfbSegmentSS;
- }
-#endif
- }
- else
- pGC->ops->Polylines = miZeroLine;
- }
- else
- pGC->ops->Polylines = miWideLine;
- break;
- case LineOnOffDash:
- case LineDoubleDash:
- if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
- {
- pGC->ops->Polylines = cfbLineSD;
- pGC->ops->PolySegment = cfbSegmentSD;
- } else
- pGC->ops->Polylines = miWideDash;
- break;
- }
- }
-
- if (new_text && (pGC->font))
- {
- if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- else
- {
-#ifdef WriteBitGroup
- if (pGC->fillStyle == FillSolid)
- {
- if (devPriv->rop == GXcopy)
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
- else
-#ifdef FOUR_BIT_CODE
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
-#else
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
-#endif
- }
- else
-#endif
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- /* special case ImageGlyphBlt for terminal emulator fonts */
-#if !defined(WriteBitGroup) || PSZ == 8
- if (TERMINALFONT(pGC->font) &&
- (pGC->planemask & PMSK) == PMSK
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
- {
- pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
- }
- else
-#endif
- {
-#ifdef WriteBitGroup
- if (devPriv->rop == GXcopy &&
- pGC->fillStyle == FillSolid &&
- (pGC->planemask & PMSK) == PMSK)
- pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
- else
-#endif
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- }
- }
-
-
- if (new_fillspans) {
- switch (pGC->fillStyle) {
- case FillSolid:
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillSpans = cfbSolidSpansCopy;
- break;
- case GXxor:
- pGC->ops->FillSpans = cfbSolidSpansXor;
- break;
- default:
- pGC->ops->FillSpans = cfbSolidSpansGeneral;
- break;
- }
- break;
- case FillTiled:
- if (pGC->pRotatedPixmap)
- {
- if (pGC->alu == GXcopy && (pGC->planemask & PMSK) == PMSK)
- pGC->ops->FillSpans = cfbTile32FSCopy;
- else
- pGC->ops->FillSpans = cfbTile32FSGeneral;
- }
- else
- pGC->ops->FillSpans = cfbUnnaturalTileFS;
- break;
- case FillStippled:
-#ifdef FOUR_BIT_CODE
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = cfb8Stipple32FS;
- else
-#endif
- pGC->ops->FillSpans = cfbUnnaturalStippleFS;
- break;
- case FillOpaqueStippled:
-#ifdef FOUR_BIT_CODE
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = cfb8OpaqueStipple32FS;
- else
-#endif
- pGC->ops->FillSpans = cfbUnnaturalStippleFS;
- break;
- default:
- FatalError("cfbValidateGC: illegal fillStyle\n");
- }
- } /* end of new_fillspans */
-
- if (new_fillarea) {
-#ifndef FOUR_BIT_CODE
- pGC->ops->PolyFillRect = miPolyFillRect;
- if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
- {
- pGC->ops->PolyFillRect = cfbPolyFillRect;
- }
-#endif
-#ifdef FOUR_BIT_CODE
-#ifndef LOWMEMFTPT
- pGC->ops->PushPixels = mfbPushPixels;
-#else
- pGC->ops->PushPixels = miPushPixels;
-#endif /* ifndef LOWMEMFTPT */
- if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
- pGC->ops->PushPixels = cfbPushPixels8;
-#endif
- pGC->ops->PolyFillArc = miPolyFillArc;
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop)
- {
- case GXcopy:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
- break;
- default:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
- break;
- }
- }
- }
-}
diff --git a/cfb/cfbgetsp.c b/cfb/cfbgetsp.c
deleted file mode 100644
index 737f30237..000000000
--- a/cfb/cfbgetsp.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $Xorg: cfbgetsp.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.10 2003/10/29 22:44:53 tsi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-#include "misc.h"
-#include "region.h"
-#include "gc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-void
-cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pchardstStart; /* where to put the bits */
-{
- PixelGroup *pdstStart = (PixelGroup *)pchardstStart;
- register PixelGroup *pdst; /* where to put the bits */
- register PixelGroup *psrc; /* where to get the bits */
- register PixelGroup tmpSrc; /* scratch buffer for bits */
- PixelGroup *psrcBase; /* start of src bitmap */
- int widthSrc; /* width of pixmap in bytes */
- register DDXPointPtr pptLast; /* one past last point to get */
- int xEnd; /* last pixel to copy from */
- int nl, srcBit;
- int w;
- PixelGroup *pdstNext;
-#if PSZ == 24
- register char *psrcb, *pdstb;
- register int xIndex = 0;
-#else
- register int nstart;
-#if PSZ != 32 || PPW != 1
- int nend;
-#endif
- PixelGroup startmask, endmask;
- int nlMiddle;
-#endif
-
- switch (pDrawable->bitsPerPixel) {
- case 1:
- mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart);
- return;
- case PSZ:
- break;
- default:
- FatalError("cfbGetSpans: invalid depth\n");
- }
-
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!cfbDrawableEnabled(pDrawable))
- return;
-
- cfbGetLongWidthAndPointer (pDrawable, widthSrc, psrcBase)
-
-#ifdef PIXEL_ADDR
-# if PSZ != 24
- if ((nspans == 1) && (*pwidth == 1))
- {
- tmpSrc = *((PixelType *)(psrcBase + (ppt->y * widthSrc))
- + ppt->x);
-#if BITMAP_BIT_ORDER == MSBFirst
- tmpSrc <<= (sizeof (CfbBits) - sizeof (PixelType)) * 8;
-#endif
- *pdstStart = tmpSrc;
- return;
- }
-# endif /* PSZ != 24 */
-#endif
- pdst = pdstStart;
- pptLast = ppt + nspans;
- while(ppt < pptLast)
- {
-#if PSZ == 24
- xEnd = min(ppt->x + *pwidth, widthSrc * sizeof(CfbBits) / 3);
- w = xEnd - ppt->x;
- psrc = psrcBase + ppt->y * widthSrc;
- srcBit = ppt->x;
- psrcb = (char *)psrc + (ppt->x * 3);
- xIndex = 0;
- pdstb = (char *)pdst;
- pdstNext = pdst + ((w * 3 + 3) >> 2);
-#else
- xEnd = min(ppt->x + *pwidth, widthSrc << PWSH);
- w = xEnd - ppt->x;
- psrc = psrcBase + ppt->y * widthSrc + (ppt->x >> PWSH);
- srcBit = ppt->x & PIM;
- pdstNext = pdst + ((w + PPW - 1) >> PWSH);
-#endif
-
-#if PSZ == 24
- if (w < 0)
- FatalError("cfb24GetSpans: Internal error (w < 0)\n");
- nl = w;
- while (nl--){
- psrc = (PixelGroup *)((unsigned long)psrcb & ~0x03);
- getbits24(psrc, tmpSrc, srcBit);
- pdst = (PixelGroup *)((unsigned long)pdstb & ~0x03);
- putbits24(tmpSrc, PPW, pdst, ~((CfbBits)0), xIndex);
- srcBit++;
- psrcb += 3;
- xIndex++;
- pdstb += 3;
- }
- pdst = pdstNext;
-#else /* PSZ == 24 */
- if (srcBit + w <= PPW)
- {
- getbits(psrc, srcBit, w, tmpSrc);
- putbits(tmpSrc, 0, w, pdst, ~((CfbBits)0));
- pdst++;
- }
- else
- {
- maskbits(ppt->x, w, startmask, endmask, nlMiddle);
- nstart = 0;
- if (startmask)
- {
- nstart = PPW - srcBit;
- getbits(psrc, srcBit, nstart, tmpSrc);
- putbits(tmpSrc, 0, nstart, pdst, ~((CfbBits)0));
- if(srcBit + nstart >= PPW)
- psrc++;
- }
- nl = nlMiddle;
- while (nl--)
- {
- tmpSrc = *psrc;
- putbits(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0));
- psrc++;
- pdst++;
- }
- if (endmask)
- {
-#if PSZ != 32 || PPW != 1
- nend = xEnd & PIM;
-#endif
- getbits(psrc, 0, nend, tmpSrc);
- putbits(tmpSrc, nstart, nend, pdst, ~((CfbBits)0));
- }
- pdst = pdstNext;
- }
-#endif /* PSZ == 24 */
- ppt++;
- pwidth++;
- }
-}
diff --git a/cfb/cfbglblt8.c b/cfb/cfbglblt8.c
deleted file mode 100644
index 60a012c28..000000000
--- a/cfb/cfbglblt8.c
+++ /dev/null
@@ -1,476 +0,0 @@
-/* $Xorg: cfbglblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.8 2003/08/06 14:04:02 eich Exp $ */
-
-/*
- * Poly glyph blt. Accepts an arbitrary font <= 32 bits wide, in Copy mode
- * only.
- */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-#define BOX_OVERLAP(box1, box2, xoffset, yoffset) \
- ((box1)->x1 <= ((int) (box2)->x2 + (xoffset)) && \
- ((int) (box2)->x1 + (xoffset)) <= (box1)->x2 && \
- (box1)->y1 <= ((int) (box2)->y2 + (yoffset)) && \
- ((int) (box2)->y1 + (yoffset)) <= (box1)->y2)
-
-#define BOX_CONTAINS(box1, box2, xoffset, yoffset) \
- ((box1)->x1 <= ((int) (box2)->x1 + (xoffset)) && \
- ((int) (box2)->x2 + (xoffset)) <= (box1)->x2 && \
- (box1)->y1 <= ((int) (box2)->y1 + (yoffset)) && \
- ((int) (box2)->y2 + (yoffset)) <= (box1)->y2)
-
-#if defined(FOUR_BIT_CODE) || defined(WriteBitGroup) && !defined(GLYPHROP)
-
-#if GLYPHPADBYTES != 4
-#define USE_LEFTBITS
-#endif
-
-#ifdef USE_LEFTBITS
-typedef unsigned char *glyphPointer;
-extern CfbBits endtab[];
-
-#define GlyphBits(bits,width,dst) getleftbits(bits,width,dst); \
- (dst) &= widthMask; \
- (bits) += widthGlyph;
-#define GlyphBitsS(bits,width,dst,off) GlyphBits(bits,width,dst); \
- dst = BitRight (dst, off);
-#else
-typedef CARD32 *glyphPointer;
-
-#define GlyphBits(bits,width,dst) dst = *bits++;
-#define GlyphBitsS(bits,width,dst,off) dst = BitRight(*bits++, off);
-#endif
-
-#ifdef GLYPHROP
-#define cfbPolyGlyphBlt8 cfbPolyGlyphRop8
-#define cfbPolyGlyphBlt8Clipped cfbPolyGlyphRop8Clipped
-
-#undef WriteBitGroup
-#define WriteBitGroup(dst,pixel,bits) RRopBitGroup(dst,bits)
-
-#endif
-
-static void cfbPolyGlyphBlt8Clipped(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppci, /* array of character info */
- unsigned char *pglyphBase); /* start of array of glyphs */
-
-#if defined(HAS_STIPPLE_CODE) && !defined(GLYPHROP) && !defined(USE_LEFTBITS)
-#define USE_STIPPLE_CODE
-#endif
-
-#if defined(__GNUC__) && !defined(GLYPHROP) && (defined(mc68020) || defined(mc68000) || defined(__mc68000__)) && PSZ == 8 && !defined(USE_LEFTBITS)
-#ifdef USE_STIPPLE_CODE
-#undef USE_STIPPLE_CODE
-#endif
-#include "stip68kgnu.h"
-#endif
-
-#if PSZ == 24
-#define DST_INC 3
-#else
-#define DST_INC (PGSZB >> PWSH)
-#endif
-
-/* cfbStippleStack/cfbStippleStackTE are coded in assembly language.
- * They are only provided on some architecures.
- */
-#ifdef USE_STIPPLE_CODE
-extern void cfbStippleStack (), cfbStippleStackTE ();
-#endif
-
-void
-cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
-#ifndef GLYPHROP
- register CfbBits pixel;
-#endif
-#if !defined(STIPPLE) && !defined(USE_STIPPLE_CODE)
- register CfbBits c;
- register CfbBits *dst;
-#endif
- register glyphPointer glyphBits;
- register int xoff;
-
- FontPtr pfont = pGC->font;
- CharInfoPtr pci;
- CfbBits *dstLine;
- CfbBits *pdstBase;
- int hTmp;
- int bwidthDst;
- int widthDst;
- int h;
- BoxRec bbox; /* for clipping */
- int w;
- RegionPtr clip;
- BoxPtr extents;
-#ifdef USE_LEFTBITS
- int widthGlyph;
- CfbBits widthMask;
-#endif
-#ifndef STIPPLE
-#ifdef USE_STIPPLE_CODE
- void (*stipple)();
-
- stipple = cfbStippleStack;
- if (FONTCONSTMETRICS(pfont))
- stipple = cfbStippleStackTE;
-#endif
-#endif
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- /* compute an approximate (but covering) bounding box */
- bbox.x1 = 0;
- if ((ppci[0]->metrics.leftSideBearing < 0))
- bbox.x1 = ppci[0]->metrics.leftSideBearing;
- h = nglyph - 1;
- w = ppci[h]->metrics.rightSideBearing;
- while (--h >= 0)
- w += ppci[h]->metrics.characterWidth;
- bbox.x2 = w;
- bbox.y1 = -FONTMAXBOUNDS(pfont,ascent);
- bbox.y2 = FONTMAXBOUNDS(pfont,descent);
-
- clip = cfbGetCompositeClip(pGC);
- extents = &clip->extents;
-
- if (!clip->data)
- {
- if (!BOX_CONTAINS(extents, &bbox, x, y))
- {
- if (BOX_OVERLAP (extents, &bbox, x, y))
- cfbPolyGlyphBlt8Clipped(pDrawable, pGC, x, y,
- nglyph, ppci, pglyphBase);
- return;
- }
- }
- else
- {
- /* check to make sure some of the text appears on the screen */
- if (!BOX_OVERLAP (extents, &bbox, x, y))
- return;
-
- bbox.x1 += x;
- bbox.x2 += x;
- bbox.y1 += y;
- bbox.y2 += y;
-
- switch (RECT_IN_REGION(pGC->pScreen, clip, &bbox))
- {
- case rgnPART:
- cfbPolyGlyphBlt8Clipped(pDrawable, pGC, x, y,
- nglyph, ppci, pglyphBase);
- case rgnOUT:
- return;
- }
- }
-
-#ifdef GLYPHROP
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
-#else
- pixel = cfbGetGCPrivate(pGC)->xor;
-#endif
-
- cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits)
-
- widthDst = bwidthDst / PGSZB;
- while (nglyph--)
- {
- pci = *ppci++;
- glyphBits = (glyphPointer) FONTGLYPHBITS(pglyphBase,pci);
- xoff = x + pci->metrics.leftSideBearing;
-#if PSZ == 24
- dstLine = pdstBase + (y - pci->metrics.ascent) * widthDst +((xoff>> 2)*3);
-#else
- dstLine = pdstBase +
- (y - pci->metrics.ascent) * widthDst + (xoff >> PWSH);
-#endif
- x += pci->metrics.characterWidth;
- if ((hTmp = pci->metrics.descent + pci->metrics.ascent))
- {
-#if PSZ == 24
- xoff &= 0x03;
-#else
- xoff &= PIM;
-#endif /* PSZ == 24 */
-#ifdef STIPPLE
- STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff);
-#else
-#ifdef USE_STIPPLE_CODE
- (*stipple)(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff);
-#else
-#ifdef USE_LEFTBITS
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- widthGlyph = PADGLYPHWIDTHBYTES(w);
- widthMask = endtab[w];
-#endif
- do {
- dst = dstLine;
- dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst);
- GlyphBits(glyphBits, w, c)
- WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff)));
- dst += DST_INC;
- c = BitLeft(c,PGSZB - xoff);
- while (c)
- {
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst += DST_INC;
- }
- } while (--hTmp);
-#endif /* USE_STIPPLE_CODE else */
-#endif /* STIPPLE else */
- }
- }
-}
-
-static void
-cfbPolyGlyphBlt8Clipped(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppci, /* array of character info */
- unsigned char *pglyphBase) /* start of array of glyphs */
-{
-#ifndef GLYPHROP
- register CfbBits pixel;
-#endif
-#if !defined(STIPPLE) && !defined(USE_STIPPLE_CODE)
- register CfbBits c;
-#endif
- register glyphPointer glyphBits;
- register int xoff;
-#if defined(USE_LEFTBITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE))
- register CfbBits *dst;
-#endif
-
- CharInfoPtr pci;
- FontPtr pfont = pGC->font;
- CfbBits *dstLine;
- CfbBits *pdstBase;
-#ifdef USE_LEFTBITS
- CARD32 *cTmp;
-#endif
- CARD32 *clips;
- int maxAscent, maxDescent;
- int minLeftBearing;
- int hTmp;
- int widthDst;
- int bwidthDst;
- int xG, yG;
- BoxPtr pBox;
- int numRects;
- int w;
- RegionPtr pRegion;
- int yBand;
-#ifdef GLYPHROP
- CfbBits bits;
-#endif
-#ifdef USE_LEFTBITS
- int widthGlyph;
- CfbBits widthMask;
-#endif
-
-#ifdef GLYPHROP
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
-#else
- pixel = cfbGetGCPrivate(pGC)->xor;
-#endif
-
- cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits)
-
- widthDst = bwidthDst / PGSZB;
- maxAscent = FONTMAXBOUNDS(pfont,ascent);
- maxDescent = FONTMAXBOUNDS(pfont,descent);
- minLeftBearing = FONTMINBOUNDS(pfont,leftSideBearing);
-
- pRegion = cfbGetCompositeClip(pGC);
-
- pBox = REGION_RECTS(pRegion);
- numRects = REGION_NUM_RECTS (pRegion);
- while (numRects && pBox->y2 <= y - maxAscent)
- {
- ++pBox;
- --numRects;
- }
- if (!numRects || pBox->y1 >= y + maxDescent)
- return;
- yBand = pBox->y1;
- while (numRects && pBox->y1 == yBand && pBox->x2 <= x + minLeftBearing)
- {
- ++pBox;
- --numRects;
- }
- if (!numRects)
- return;
- clips = (CARD32 *)ALLOCATE_LOCAL ((maxAscent + maxDescent) *
- sizeof (CARD32));
- while (nglyph--)
- {
- pci = *ppci++;
- glyphBits = (glyphPointer) FONTGLYPHBITS(pglyphBase,pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- xG = x + pci->metrics.leftSideBearing;
- yG = y - pci->metrics.ascent;
- x += pci->metrics.characterWidth;
- if ((hTmp = pci->metrics.descent + pci->metrics.ascent))
- {
-#if PSZ == 24
- dstLine = pdstBase + yG * widthDst + ((xG>> 2)*3);
- /* never use (xG*3)>>2 */
-#else
- dstLine = pdstBase + yG * widthDst + (xG >> PWSH);
-#endif
-#if PSZ == 24
- xoff = xG & 3;
-#else
- xoff = xG & PIM;
-#endif
-#ifdef USE_LEFTBITS
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- widthGlyph = PADGLYPHWIDTHBYTES(w);
- widthMask = endtab[w];
-#endif
- switch (cfb8ComputeClipMasks32 (pBox, numRects, xG, yG, w, hTmp, clips))
- {
- case rgnPART:
-#ifdef USE_LEFTBITS
- cTmp = clips;
- do {
- dst = dstLine;
- dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst);
- GlyphBits(glyphBits, w, c)
- c &= *cTmp++;
- if (c)
- {
- WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff)));
- c = BitLeft(c,PGSZB - xoff);
- dst += DST_INC;
- while (c)
- {
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst += DST_INC;
- }
- }
- } while (--hTmp);
- break;
-#else /* !USE_LEFTBITS */
- {
- int h;
-
- h = hTmp;
- do
- {
- --h;
- clips[h] = clips[h] & glyphBits[h];
- } while (h);
- }
- glyphBits = clips;
- /* fall through */
-#endif /* USE_LEFTBITS */
- case rgnIN:
-#ifdef STIPPLE
- STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff);
-#else
-#ifdef USE_STIPPLE_CODE
- cfbStippleStackTE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff);
-#else
- do {
- dst = dstLine;
- dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst);
- GlyphBits(glyphBits, w, c)
- if (c)
- {
- /* This code originally could read memory locations
- * that were not mapped. Hence we have to check the
- * trailing bits to see whether they are zero and if
- * then skip them correctly. This is no problem for
- * the GXcopy case, since there only the pixels that
- * are non-zero are written ...
- */
-#ifndef GLYPHROP
- WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff)));
- c = BitLeft(c,PGSZB - xoff);
- dst += DST_INC;
-#else /* GLYPHROP */
- if ((bits = GetBitGroup(BitRight(c,xoff))))
- WriteBitGroup(dst, pixel, bits);
- c = BitLeft(c,PGSZB - xoff);
- dst += DST_INC;
-
- while (c && ((bits = GetBitGroup(c)) == 0))
- {
- NextBitGroup(c);
- dst += DST_INC;
- }
-#endif /* GLYPHROP */
- while (c)
- {
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst += DST_INC;
- }
- }
- } while (--hTmp);
-#endif /* USE_STIPPLE_CODE else */
-#endif /* STIPPLE else */
- break;
- }
- }
- }
- DEALLOCATE_LOCAL (clips);
-}
-
-#endif /* FOUR_BIT_CODE */
diff --git a/cfb/cfbhrzvert.c b/cfb/cfbhrzvert.c
deleted file mode 100644
index 6f4f7abe6..000000000
--- a/cfb/cfbhrzvert.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbhrzvert.c,v 3.8 2002/09/16 18:05:30 eich Exp $ */
-/***********************************************************
-
-Copyright 1987,1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cfbhrzvert.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-#include "X.h"
-
-#include "gc.h"
-#include "window.h"
-#include "pixmap.h"
-#include "region.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-void
-cfbHorzS(rop, and, xor, addrl, nlwidth, x1, y1, len)
-register int rop;
-register CfbBits and;
-register CfbBits xor;
-register CfbBits *addrl; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-{
- register int nlmiddle;
-
-#if PSZ == 24
-
- int leftIndex, rightIndex;
- CfbBits piQxelAnd[3], piQxelXor[3];
- piQxelAnd[0] = (and & 0xFFFFFF) | ((and<<24) & 0xFF000000);
- piQxelAnd[1] = ((and>>8) & 0xFFFF)| ((and<<16) & 0xFFFF0000);
- piQxelAnd[2] = ((and<<8) & 0xFFFFFF00) | ((and>>16) & 0xFF);
-
- piQxelXor[0] = (xor & 0xFFFFFF) | ((xor<<24) & 0xFF000000);
- piQxelXor[1] = ((xor>>8) & 0xFFFF)| ((xor<<16) & 0xFFFF0000);
- piQxelXor[2] = ((xor<<8) & 0xFFFFFF00) | ((xor>>16) & 0xFF);
-
- leftIndex = x1 & 3;
- rightIndex = ((x1 + len) < 5)?0:(x1 + len)&3;
- nlmiddle = len;
- if(leftIndex){
- nlmiddle -= (4 - leftIndex);
- }
- if(rightIndex){
- nlmiddle -= rightIndex;
- }
- if (nlmiddle < 0)
- nlmiddle = 0;
-
- nlmiddle >>= 2;
-
- addrl += (y1 * nlwidth) + (x1 >> 2)*3 + (leftIndex?leftIndex-1:0);
-
- switch(leftIndex+len){
- case 4:
- switch(leftIndex){
- case 0:
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- break;
- case 1:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- break;
- case 2:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- break;
- case 3:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF);
- break;
- case 1:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF);
- break;
- case 2:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- addrl++;
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF);
- break;
- }
- break;
- case 2:
- if(leftIndex){
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000);
- addrl++;
- }
- else{
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- }
- *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF);
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
- break;
- case 0: /*never*/
- break;
- default:
- {
- if (rop == GXcopy){
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *addrl = ((*addrl) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- addrl++;
- *addrl++ = piQxelXor[1];
- *addrl++ = piQxelXor[2];
- break;
- case 2:
- *addrl = ((*addrl) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- addrl++;
- *addrl++ = piQxelXor[2];
- break;
- case 3:
- *addrl = ((*addrl) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
- addrl++;
- break;
- }
- while(nlmiddle--){
- *addrl++ = piQxelXor[0];
- *addrl++ = piQxelXor[1];
- *addrl++ = piQxelXor[2];
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
- *addrl = ((*addrl) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
- break;
- case 2:
- *addrl++ = piQxelXor[0];
- *addrl = ((*addrl) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- break;
- case 3:
- *addrl++ = piQxelXor[0];
- *addrl++ = piQxelXor[1];
- *addrl = ((*addrl) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- break;
- }
- }
- else{
- if(rop == GXxor){
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *addrl++ ^= (piQxelXor[0]&0xFF000000);
- *addrl++ ^= piQxelXor[1];
- *addrl++ ^= piQxelXor[2];
- break;
- case 2:
- *addrl++ ^= (piQxelXor[1]& 0xFFFF0000);
- *addrl++ ^= piQxelXor[2];
- break;
- case 3:
- *addrl++ ^= (piQxelXor[2]& 0xFFFFFF00);
- break;
- }
- while(nlmiddle--){
- *addrl++ ^= piQxelXor[0];
- *addrl++ ^= piQxelXor[1];
- *addrl++ ^= piQxelXor[2];
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
- *addrl ^= (piQxelXor[0]& 0xFFFFFF);
- break;
- case 2:
- *addrl++ ^= piQxelXor[0];
- *addrl ^= (piQxelXor[1]&0xFFFF);
- break;
- case 3:
- *addrl++ ^= piQxelXor[0];
- *addrl++ ^= piQxelXor[1];
- *addrl ^= (piQxelXor[2]&0xFF);
- break;
- }
- }
- else{
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFF000000);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- addrl++;
- break;
- case 2:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- addrl++;
- break;
- case 3:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
- addrl++;
- break;
- }
- while(nlmiddle--){
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
- addrl++;
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
- *addrl = DoMaskRRop (*addrl, piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
- addrl++;
- break;
- case 2:
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- *addrl = DoMaskRRop (*addrl, piQxelAnd[1], piQxelXor[1], 0xFFFF);
- break;
- case 3:
- *addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
- addrl++;
- *addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
- addrl++;
- *addrl = DoMaskRRop (*addrl, piQxelAnd[2], piQxelXor[2], 0xFF);
- break;
- }
-
- }
- }
- }
- }
-#else
- register CfbBits startmask;
- register CfbBits endmask;
-
- addrl = addrl + (y1 * nlwidth) + (x1 >> PWSH);
-
- /* all bits inside same longword */
- if ( ((x1 & PIM) + len) < PPW)
- {
- maskpartialbits(x1, len, startmask);
- *addrl = DoMaskRRop (*addrl, and, xor, startmask);
- }
- else
- {
- maskbits(x1, len, startmask, endmask, nlmiddle);
- if (rop == GXcopy)
- {
- if (startmask)
- {
- *addrl = (*addrl & ~startmask) | (xor & startmask);
- addrl++;
- }
- while (nlmiddle--)
- *addrl++ = xor;
- if (endmask)
- *addrl = (*addrl & ~endmask) | (xor & endmask);
- }
- else
- {
- if (startmask)
- {
- *addrl = DoMaskRRop (*addrl, and, xor, startmask);
- addrl++;
- }
- if (rop == GXxor)
- {
- while (nlmiddle--)
- *addrl++ ^= xor;
- }
- else
- {
- while (nlmiddle--)
- {
- *addrl = DoRRop (*addrl, and, xor);
- addrl++;
- }
- }
- if (endmask)
- *addrl = DoMaskRRop (*addrl, and, xor, endmask);
- }
- }
-#endif
-}
-
-/* vertical solid line */
-
-void
-cfbVertS(rop, and, xor, addrl, nlwidth, x1, y1, len)
-int rop;
-register CfbBits and, xor;
-register CfbBits *addrl; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int x1, y1; /* initial point */
-register int len; /* length of line */
-{
-#if PSZ == 24
- int xIdx;
- CfbBits and2 = 0, xor2 = 0, mask = 0, mask2;
-#endif
-#ifdef PIXEL_ADDR
- register PixelType *bits = (PixelType *) addrl;
-
-#if PSZ == 24
- nlwidth <<= PWSH;
- xIdx = x1 & 3;
- bits = (PixelType *)(addrl + (y1 * nlwidth) + ((x1*3) >> 2));
-#else
- nlwidth <<= PWSH;
- bits = bits + (y1 * nlwidth) + x1;
-#endif
-#if PSZ == 24
- mask2 = 0;
- switch(xIdx){
- case 0:
- mask = 0xFF000000;
- xor &= 0xFFFFFF;
- and |= 0xFF000000;
- break;
- case 3:
- mask = 0xFF;
- xor &= 0xFFFFFF;
- xor <<= 8;
- and <<= 8;
- and |= 0xFF;
- break;
- case 1:
- mask = 0xFFFFFF;
- mask2 = 0xFFFF0000;
- xor2 = (xor>>8) & 0xFFFF;
- xor &= 0xFF;
- xor <<= 24;
- and2 = (and >> 8 ) | 0xFFFF0000;
- and <<= 24;
- and |= 0xFFFFFF;
- break;
- case 2:
- mask = 0x0000FFFF;
- mask2 = 0xFFFFFF00;
- xor2 = (xor >> 16) & 0xFF;
- xor <<= 16;
- xor &= 0xFFFF0000;
- and2 = (and >> 16) | 0xFFFFFF00;
- and <<= 16;
- and |= 0xFFFF;
- break;
- }
-#endif
-
- /*
- * special case copy and xor to avoid a test per pixel
- */
- if (rop == GXcopy)
- {
-#if PSZ == 24
- switch(xIdx){
- case 0:
- case 3:
- while (len--){
- *bits = (*bits & mask)| xor;
- bits += nlwidth;
- }
- break;
- case 1:
- case 2:
- while (len--){
- *bits = (*bits & mask)| xor;
- bits++;
- *bits = (*bits & mask2)| xor2;
- bits--;
- bits += nlwidth;
- }
- break;
- }
-#else
- while (len--)
- {
- *bits = xor;
- bits += nlwidth;
- }
-#endif
- }
- else if (rop == GXxor)
- {
-#if PSZ == 24
- switch(xIdx){
- case 0:
- case 3:
- while (len--){
- *bits ^= xor;
- bits += nlwidth;
- }
- break;
- case 1:
- case 2:
- while (len--){
- *bits ^= xor;
- bits++;
- *bits ^= xor2;
- bits--;
- bits += nlwidth;
- }
- break;
- }
-#else
- while (len--)
- {
- *bits ^= xor;
- bits += nlwidth;
- }
-#endif
- }
- else
- {
-#if PSZ == 24
- switch(xIdx){
- case 0:
- while (len--){
- *bits = DoMaskRRop(*bits, and, xor, 0x00FFFFFF);
- bits += nlwidth;
- }
- break;
- case 3:
- while (len--){
- *bits = DoMaskRRop(*bits, and, xor, 0xFFFFFF00);
- bits += nlwidth;
- }
- break;
- case 1:
- while (len--){
- *bits = DoMaskRRop(*bits, and, xor, 0xFF000000);
- bits++;
- *bits = DoMaskRRop(*bits, and2, xor2, 0x0000FFFF);
- bits--;
- bits += nlwidth;
- }
- break;
- case 2:
- while (len--){
- *bits = DoMaskRRop(*bits, and, xor, 0xFFFF0000);
- bits++;
- *bits = DoMaskRRop(*bits, and2, xor2, 0x000000FF);
- bits--;
- bits += nlwidth;
- }
- break;
- }
-#else
- while (len--)
- {
- *bits = DoRRop(*bits, and, xor);
- bits += nlwidth;
- }
-#endif
- }
-#else /* !PIXEL_ADDR */
-#if PSZ == 24
- addrl = addrl + (y1 * nlwidth) + ((x1*3) >>2);
-
- and |= ~cfbmask[(x1 & 3)<<1];
- xor &= cfbmask[(x1 & 3)<<1];
-#else
- addrl = addrl + (y1 * nlwidth) + (x1 >> PWSH);
-
- and |= ~cfbmask[x1 & PIM];
- xor &= cfbmask[x1 & PIM];
-#endif
-
- while (len--)
- {
- *addrl = DoRRop (*addrl, and, xor);
- addrl += nlwidth;
- }
-#endif
-}
diff --git a/cfb/cfbigblt8.c b/cfb/cfbigblt8.c
deleted file mode 100644
index aa1060240..000000000
--- a/cfb/cfbigblt8.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * $Xorg: cfbigblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbigblt8.c,v 1.6 2001/12/14 19:59:23 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mi.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-void
-cfbImageGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci;
- pointer pglyphBase;
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- xRectangle backrect;
- int fgPixel;
- cfbPrivGC *priv;
-
- /*
- * We can't avoid GC validations if calling mi functions.
- */
- if ((pGC->ops->PolyFillRect == miPolyFillRect) ||
- (pGC->ops->PolyGlyphBlt == miPolyGlyphBlt))
- {
- miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- return;
- }
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- if (info.overallWidth >= 0)
- {
- backrect.x = x;
- backrect.width = info.overallWidth;
- }
- else
- {
- backrect.x = x + info.overallWidth;
- backrect.width = -info.overallWidth;
- }
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
- priv = cfbGetGCPrivate(pGC);
-
- /* this code cheats by knowing that ValidateGC isn't
- * necessary for PolyFillRect
- */
-
- fgPixel = pGC->fgPixel;
-
- pGC->fgPixel = pGC->bgPixel;
- priv->xor = PFILL(pGC->bgPixel);
-
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &backrect);
-
- pGC->fgPixel = fgPixel;
-
- priv->xor = PFILL(pGC->fgPixel);
-
- (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-
-}
diff --git a/cfb/cfbimage.c b/cfb/cfbimage.c
deleted file mode 100644
index 1983ae48a..000000000
--- a/cfb/cfbimage.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbimage.c,v 1.13 2001/12/14 19:59:23 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cfbimage.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-
-#include "X.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "servermd.h"
-#include "mi.h"
-
-void
-cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
- DrawablePtr pDraw;
- GCPtr pGC;
- int depth, x, y, w, h;
- int leftPad;
- int format;
- char *pImage;
-{
- PixmapPtr pPixmap;
-
- if ((w == 0) || (h == 0))
- return;
-
- if (format != XYPixmap)
- {
- pPixmap = GetScratchPixmapHeader(pDraw->pScreen, w+leftPad, h, depth,
- BitsPerPixel(depth), PixmapBytePad(w+leftPad, depth),
- (pointer)pImage);
- if (!pPixmap)
- return;
-
- pGC->fExpose = FALSE;
- if (format == ZPixmap)
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC,
- leftPad, 0, w, h, x, y);
- else
- (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC,
- leftPad, 0, w, h, x, y, 1);
- pGC->fExpose = TRUE;
- FreeScratchPixmapHeader(pPixmap);
- }
- else
- {
- CfbBits oldFg, oldBg;
- XID gcv[3];
- CfbBits oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- depth = pGC->depth;
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0] = ~0L;
- gcv[1] = 0;
- DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
- bytesPer = (long)h * BitmapBytePad(w + leftPad);
-
- for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
- {
- if (i & oldPlanemask)
- {
- gcv[0] = i;
- DoChangeGC(pGC, GCPlaneMask, gcv, 0);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
- XYBitmap, pImage);
- }
- }
- gcv[0] = oldPlanemask;
- gcv[1] = oldFg;
- gcv[2] = oldBg;
- DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
- ValidateGC(pDraw, pGC);
- }
-}
-
-void
-cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char *pdstLine;
-{
- BoxRec box;
- DDXPointRec ptSrc;
- RegionRec rgnDst;
- ScreenPtr pScreen;
- PixmapPtr pPixmap;
-
- if ((w == 0) || (h == 0))
- return;
- if (pDrawable->bitsPerPixel == 1)
- {
-#ifndef LOWMEMFTPT
- mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-#else
- miGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-#endif /* ifndef LOWMEMFTPT */
- return;
- }
- pScreen = pDrawable->pScreen;
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!cfbDrawableEnabled (pDrawable))
- return;
- if (format == ZPixmap)
- {
- pPixmap = GetScratchPixmapHeader(pScreen, w, h,
- pDrawable->depth, pDrawable->bitsPerPixel,
- PixmapBytePad(w,pDrawable->depth), (pointer)pdstLine);
- if (!pPixmap)
- return;
- if ((planeMask & PMSK) != PMSK)
- bzero((char *)pdstLine, pPixmap->devKind * h);
- ptSrc.x = sx + pDrawable->x;
- ptSrc.y = sy + pDrawable->y;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
- cfbDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
- &ptSrc, planeMask);
- REGION_UNINIT(pScreen, &rgnDst);
- FreeScratchPixmapHeader(pPixmap);
- }
- else
- {
-
-#if IMAGE_BYTE_ORDER == LSBFirst
-
- pPixmap = GetScratchPixmapHeader(pScreen, w, h, /*depth*/ 1,
- /*bpp*/ 1, BitmapBytePad(w), (pointer)pdstLine);
- if (!pPixmap)
- return;
-
- ptSrc.x = sx + pDrawable->x;
- ptSrc.y = sy + pDrawable->y;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
- cfbCopyImagePlane (pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
- &ptSrc, planeMask);
- REGION_UNINIT(pScreen, &rgnDst);
- FreeScratchPixmapHeader(pPixmap);
-#else
- miGetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-#endif
- }
-}
diff --git a/cfb/cfbline.c b/cfb/cfbline.c
deleted file mode 100644
index 432cb62d9..000000000
--- a/cfb/cfbline.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbline.c,v 3.6 2001/12/14 19:59:23 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cfbline.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "miline.h"
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-
-void
-#ifdef POLYSEGMENT
-cfbSegmentSS (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-cfbLineSS (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- CfbBits *addrl; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- /* a bunch of temporaries */
- int tmp;
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
- cfbPrivGCPtr devPriv;
- CfbBits xor, and;
- int alu;
-
- devPriv = cfbGetGCPrivate(pGC);
- cclip = pGC->pCompositeClip;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrl)
-
- alu = devPriv->rop;
- xor = devPriv->xor;
- and = devPriv->and;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2)
- {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- if (nbox)
- {
- /* stop when lower edge of box is beyond end of line */
- while((nbox) && (y2 >= pbox->y1))
- {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2))
- {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- {
- cfbVertS (alu, and, xor,
- addrl, nlwidth,
- x1, y1t, y2t-y1t);
- }
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- }
- else if (y1 == y2) /* horizontal line */
- {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2)
- {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while( (nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1))
- {
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while((nbox) && (pbox->y1 == tmp))
- {
- int x1t, x2t;
-
- if (pbox->x2 <= x1)
- {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2)
- {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- {
- cfbHorzS (alu, and, xor,
- addrl, nlwidth,
- x1t, y1, x2t-x1t);
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- cfbBresS (alu, and, xor,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, len);
- break;
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- cfbBresS(alu, and, xor,
- addrl, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- CfbBits mask;
- CfbBits scrbits;
-
-#if PSZ == 24
- mask = cfbmask[(x2 & 3)<<1];
- addrl += (y2 * nlwidth) + ((x2*3) >> 2);
-#else
- mask = cfbmask[x2 & PIM];
- addrl += (y2 * nlwidth) + (x2 >> PWSH);
-#endif
- scrbits = *addrl;
- *addrl = (scrbits & ~mask) |
- (DoRRop (scrbits, and, xor) & mask);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-void
-#ifdef POLYSEGMENT
-cfbSegmentSD (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-cfbLineSD( pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- CfbBits *addrl; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- cfbRRopRec rrops[2];
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
- cfbPrivGCPtr devPriv;
-
- devPriv = cfbGetGCPrivate(pGC);
- cclip = pGC->pCompositeClip;
- rrops[0].rop = devPriv->rop;
- rrops[0].and = devPriv->and;
- rrops[0].xor = devPriv->xor;
- if (pGC->alu == GXcopy)
- {
- rrops[1].rop = GXcopy;
- rrops[1].and = 0;
- rrops[1].xor = PFILL (pGC->bgPixel);
- }
- else
- {
- rrops[1].rop = cfbReduceRasterOp (pGC->alu,
- pGC->bgPixel, pGC->planemask,
- &rrops[1].and, &rrops[1].xor);
- }
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- cfbGetLongWidthAndPointer (pDrawable, nlwidth, addrl)
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- cfbBresD (rrops,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- break;
-#else
- cfbBresD (rrops,
- &dashIndex, pDash, numInDashList,
- &dashOffset, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- goto dontStep;
-#endif
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else /* have to clip */
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
-
- if (clip1)
- {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- cfbBresD (rrops,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- CfbBits mask;
- int pix;
-
- pix = 0;
- if (dashIndex & 1)
- pix = 1;
-#if PSZ == 24
- mask = cfbmask[(x2 & 3)<<1];
- addrl += (y2 * nlwidth) + ((x2 *3)>> 2);
-#else
- mask = cfbmask[x2 & PIM];
- addrl += (y2 * nlwidth) + (x2 >> PWSH);
-#endif
- *addrl = DoMaskRRop (*addrl, rrops[pix].and, rrops[pix].xor, mask);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h
deleted file mode 100644
index 42056345a..000000000
--- a/cfb/cfbmap.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * $Xorg: cfbmap.h,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1991, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.12 2003/07/19 13:22:27 tsi Exp $ */
-
-/*
- * Map names around so that multiple depths can be supported simultaneously
- */
-
-#if 0
-#undef QuartetBitsTable
-#undef QuartetPixelMaskTable
-#undef cfb8ClippedLineCopy
-#undef cfb8ClippedLineGeneral
-#undef cfb8ClippedLineXor
-#undef cfb8LineSS1Rect
-#undef cfb8LineSS1RectCopy
-#undef cfb8LineSS1RectGeneral
-#undef cfb8LineSS1RectPreviousCopy
-#undef cfb8LineSS1RectXor
-#undef cfb8SegmentSS1Rect
-#undef cfb8SegmentSS1RectCopy
-#undef cfb8SegmentSS1RectGeneral
-#undef cfb8SegmentSS1RectShiftCopy
-#undef cfb8SegmentSS1RectXor
-#undef cfbAllocatePrivates
-#undef cfbBSFuncRec
-#undef cfbBitBlt
-#undef cfbBresD
-#undef cfbBresS
-#undef cfbChangeWindowAttributes
-#undef cfbCloseScreen
-#undef cfbCopyArea
-#undef cfbCopyImagePlane
-#undef cfbCopyPixmap
-#undef cfbCopyPlane
-#undef cfbCopyPlaneReduce
-#undef cfbCopyRotatePixmap
-#undef cfbCopyWindow
-#undef cfbCreateGC
-#undef cfbCreatePixmap
-#undef cfbCreateScreenResources
-#undef cfbCreateWindow
-#undef cfbDestroyPixmap
-#undef cfbDestroyWindow
-#undef cfbDoBitblt
-#undef cfbDoBitbltCopy
-#undef cfbDoBitbltGeneral
-#undef cfbDoBitbltOr
-#undef cfbDoBitbltXor
-#undef cfbFillBoxSolid
-#undef cfbFillBoxTile32
-#undef cfbFillBoxTile32sCopy
-#undef cfbFillBoxTile32sGeneral
-#undef cfbFillBoxTileOdd
-#undef cfbFillBoxTileOddCopy
-#undef cfbFillBoxTileOddGeneral
-#undef cfbFillPoly1RectCopy
-#undef cfbFillPoly1RectGeneral
-#undef cfbFillRectSolidCopy
-#undef cfbFillRectSolidGeneral
-#undef cfbFillRectSolidXor
-#undef cfbFillRectTile32Copy
-#undef cfbFillRectTile32General
-#undef cfbFillRectTileOdd
-#undef cfbFillSpanTile32sCopy
-#undef cfbFillSpanTile32sGeneral
-#undef cfbFillSpanTileOddCopy
-#undef cfbFillSpanTileOddGeneral
-#undef cfbFinishScreenInit
-#undef cfbGCFuncs
-#undef cfbGetImage
-#undef cfbGetScreenPixmap
-#undef cfbGetSpans
-#undef cfbHorzS
-#undef cfbImageGlyphBlt8
-#undef cfbLineSD
-#undef cfbLineSS
-#undef cfbMapWindow
-#undef cfbMatchCommon
-#undef cfbNonTEOps
-#undef cfbNonTEOps1Rect
-#undef cfbPadPixmap
-#undef cfbPaintWindow
-#undef cfbPolyFillArcSolidCopy
-#undef cfbPolyFillArcSolidGeneral
-#undef cfbPolyFillRect
-#undef cfbPolyGlyphBlt8
-#undef cfbPolyGlyphRop8
-#undef cfbPolyPoint
-#undef cfbPositionWindow
-#undef cfbPutImage
-#undef cfbReduceRasterOp
-#undef cfbRestoreAreas
-#undef cfbSaveAreas
-#undef cfbScreenInit
-#undef cfbScreenPrivateIndex
-#undef cfbSegmentSD
-#undef cfbSegmentSS
-#undef cfbSetScanline
-#undef cfbSetScreenPixmap
-#undef cfbSetSpans
-#undef cfbSetupScreen
-#undef cfbSolidSpansCopy
-#undef cfbSolidSpansGeneral
-#undef cfbSolidSpansXor
-#undef cfbStippleStack
-#undef cfbStippleStackTE
-#undef cfbTEGlyphBlt
-#undef cfbTEOps
-#undef cfbTEOps1Rect
-#undef cfbTile32FSCopy
-#undef cfbTile32FSGeneral
-#undef cfbUnmapWindow
-#undef cfbUnnaturalStippleFS
-#undef cfbUnnaturalTileFS
-#undef cfbValidateGC
-#undef cfbVertS
-#undef cfbXRotatePixmap
-#undef cfbYRotatePixmap
-#undef cfbZeroPolyArcSS8Copy
-#undef cfbZeroPolyArcSS8General
-#undef cfbZeroPolyArcSS8Xor
-#undef cfbendpartial
-#undef cfbendtab
-#undef cfbmask
-#undef cfbrmask
-#undef cfbstartpartial
-#undef cfbstarttab
-#endif
-
-/* a losing vendor cpp dumps core if we define CFBNAME in terms of CATNAME */
-
-#if PSZ != 8
-
-#if PSZ == 32
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CFBNAME(subname) cfb32##subname
-#else
-#define CFBNAME(subname) cfb32/**/subname
-#endif
-#endif
-
-#if PSZ == 24
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CFBNAME(subname) cfb24##subname
-#else
-#define CFBNAME(subname) cfb24/**/subname
-#endif
-#endif
-
-#if PSZ == 16
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CFBNAME(subname) cfb16##subname
-#else
-#define CFBNAME(subname) cfb16/**/subname
-#endif
-#endif
-
-#if PSZ == 4
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CFBNAME(subname) cfb4##subname
-#else
-#define CFBNAME(subname) cfb4/**/subname
-#endif
-#endif
-
-#ifndef CFBNAME
-cfb can not hack PSZ yet
-#endif
-
-#undef CATNAME
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CATNAME(prefix,subname) prefix##subname
-#else
-#define CATNAME(prefix,subname) prefix/**/subname
-#endif
-
-#define QuartetBitsTable CFBNAME(QuartetBitsTable)
-#define QuartetPixelMaskTable CFBNAME(QuartetPixelMaskTable)
-#define cfb8ClippedLineCopy CFBNAME(ClippedLineCopy)
-#define cfb8ClippedLineGeneral CFBNAME(ClippedLineGeneral )
-#define cfb8ClippedLineXor CFBNAME(ClippedLineXor)
-#define cfb8LineSS1Rect CFBNAME(LineSS1Rect)
-#define cfb8LineSS1RectCopy CFBNAME(LineSS1RectCopy)
-#define cfb8LineSS1RectGeneral CFBNAME(LineSS1RectGeneral )
-#define cfb8LineSS1RectPreviousCopy CFBNAME(LineSS1RectPreviousCopy)
-#define cfb8LineSS1RectXor CFBNAME(LineSS1RectXor)
-#define cfb8SegmentSS1Rect CFBNAME(SegmentSS1Rect)
-#define cfb8SegmentSS1RectCopy CFBNAME(SegmentSS1RectCopy)
-#define cfb8SegmentSS1RectGeneral CFBNAME(SegmentSS1RectGeneral )
-#define cfb8SegmentSS1RectShiftCopy CFBNAME(SegmentSS1RectShiftCopy)
-#define cfb8SegmentSS1RectXor CFBNAME(SegmentSS1RectXor)
-#define cfbAllocatePrivates CFBNAME(AllocatePrivates)
-#define cfbBSFuncRec CFBNAME(BSFuncRec)
-#define cfbBitBlt CFBNAME(BitBlt)
-#define cfbBresD CFBNAME(BresD)
-#define cfbBresS CFBNAME(BresS)
-#define cfbChangeWindowAttributes CFBNAME(ChangeWindowAttributes)
-#define cfbCloseScreen CFBNAME(CloseScreen)
-#define cfbCopyArea CFBNAME(CopyArea)
-#define cfbCopyImagePlane CFBNAME(CopyImagePlane)
-#define cfbCopyPixmap CFBNAME(CopyPixmap)
-#define cfbCopyPlane CFBNAME(CopyPlane)
-#define cfbCopyPlaneReduce CFBNAME(CopyPlaneReduce)
-#define cfbCopyRotatePixmap CFBNAME(CopyRotatePixmap)
-#define cfbCopyWindow CFBNAME(CopyWindow)
-#define cfbCreateGC CFBNAME(CreateGC)
-#define cfbCreatePixmap CFBNAME(CreatePixmap)
-#define cfbCreateScreenResources CFBNAME(CreateScreenResources)
-#define cfbCreateWindow CFBNAME(CreateWindow)
-#define cfbDestroyPixmap CFBNAME(DestroyPixmap)
-#define cfbDestroyWindow CFBNAME(DestroyWindow)
-#define cfbDoBitblt CFBNAME(DoBitblt)
-#define cfbDoBitbltCopy CFBNAME(DoBitbltCopy)
-#define cfbDoBitbltGeneral CFBNAME(DoBitbltGeneral)
-#define cfbDoBitbltOr CFBNAME(DoBitbltOr)
-#define cfbDoBitbltXor CFBNAME(DoBitbltXor)
-#define cfbFillBoxSolid CFBNAME(FillBoxSolid)
-#define cfbFillBoxTile32 CFBNAME(FillBoxTile32)
-#define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy)
-#define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral)
-#define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd)
-#define cfbFillBoxTileOddCopy CFBNAME(FillBoxTileOddCopy)
-#define cfbFillBoxTileOddGeneral CFBNAME(FillBoxTileOddGeneral)
-#define cfbFillPoly1RectCopy CFBNAME(FillPoly1RectCopy)
-#define cfbFillPoly1RectGeneral CFBNAME(FillPoly1RectGeneral)
-#define cfbFillRectSolidCopy CFBNAME(FillRectSolidCopy)
-#define cfbFillRectSolidGeneral CFBNAME(FillRectSolidGeneral)
-#define cfbFillRectSolidXor CFBNAME(FillRectSolidXor)
-#define cfbFillRectTile32Copy CFBNAME(FillRectTile32Copy)
-#define cfbFillRectTile32General CFBNAME(FillRectTile32General)
-#define cfbFillRectTileOdd CFBNAME(FillRectTileOdd)
-#define cfbFillSpanTile32sCopy CFBNAME(FillSpanTile32sCopy)
-#define cfbFillSpanTile32sGeneral CFBNAME(FillSpanTile32sGeneral)
-#define cfbFillSpanTileOddCopy CFBNAME(FillSpanTileOddCopy)
-#define cfbFillSpanTileOddGeneral CFBNAME(FillSpanTileOddGeneral)
-#define cfbFinishScreenInit CFBNAME(FinishScreenInit)
-#define cfbGCFuncs CFBNAME(GCFuncs)
-#define cfbGetImage CFBNAME(GetImage)
-#define cfbGetScreenPixmap CFBNAME(GetScreenPixmap)
-#define cfbGetSpans CFBNAME(GetSpans)
-#define cfbHorzS CFBNAME(HorzS)
-#define cfbImageGlyphBlt8 CFBNAME(ImageGlyphBlt8)
-#define cfbLineSD CFBNAME(LineSD)
-#define cfbLineSS CFBNAME(LineSS)
-#define cfbMapWindow CFBNAME(MapWindow)
-#define cfbMatchCommon CFBNAME(MatchCommon)
-#define cfbNonTEOps CFBNAME(NonTEOps)
-#define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect)
-#define cfbPadPixmap CFBNAME(PadPixmap)
-#define cfbPaintWindow CFBNAME(PaintWindow)
-#define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy)
-#define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral)
-#define cfbPolyFillRect CFBNAME(PolyFillRect)
-#define cfbPolyGlyphBlt8 CFBNAME(PolyGlyphBlt8)
-#define cfbPolyGlyphRop8 CFBNAME(PolyGlyphRop8)
-#define cfbPolyPoint CFBNAME(PolyPoint)
-#define cfbPositionWindow CFBNAME(PositionWindow)
-#define cfbPutImage CFBNAME(PutImage)
-#define cfbReduceRasterOp CFBNAME(ReduceRasterOp)
-#define cfbRestoreAreas CFBNAME(RestoreAreas)
-#define cfbSaveAreas CFBNAME(SaveAreas)
-#define cfbScreenInit CFBNAME(ScreenInit)
-#define cfbScreenPrivateIndex CFBNAME(ScreenPrivateIndex)
-#define cfbSegmentSD CFBNAME(SegmentSD)
-#define cfbSegmentSS CFBNAME(SegmentSS)
-#define cfbSetScanline CFBNAME(SetScanline)
-#define cfbSetScreenPixmap CFBNAME(SetScreenPixmap)
-#define cfbSetSpans CFBNAME(SetSpans)
-#define cfbSetupScreen CFBNAME(SetupScreen)
-#define cfbSolidSpansCopy CFBNAME(SolidSpansCopy)
-#define cfbSolidSpansGeneral CFBNAME(SolidSpansGeneral)
-#define cfbSolidSpansXor CFBNAME(SolidSpansXor)
-#define cfbStippleStack CFBNAME(StippleStack)
-#define cfbStippleStackTE CFBNAME(StippleStackTE)
-#define cfbTEGlyphBlt CFBNAME(TEGlyphBlt)
-#define cfbTEOps CFBNAME(TEOps)
-#define cfbTEOps1Rect CFBNAME(TEOps1Rect)
-#define cfbTile32FSCopy CFBNAME(Tile32FSCopy)
-#define cfbTile32FSGeneral CFBNAME(Tile32FSGeneral)
-#define cfbUnmapWindow CFBNAME(UnmapWindow)
-#define cfbUnnaturalStippleFS CFBNAME(UnnaturalStippleFS)
-#define cfbUnnaturalTileFS CFBNAME(UnnaturalTileFS)
-#define cfbValidateGC CFBNAME(ValidateGC)
-#define cfbVertS CFBNAME(VertS)
-#define cfbXRotatePixmap CFBNAME(XRotatePixmap)
-#define cfbYRotatePixmap CFBNAME(YRotatePixmap)
-#define cfbZeroPolyArcSS8Copy CFBNAME(ZeroPolyArcSSCopy)
-#define cfbZeroPolyArcSS8General CFBNAME(ZeroPolyArcSSGeneral)
-#define cfbZeroPolyArcSS8Xor CFBNAME(ZeroPolyArcSSXor)
-#define cfbendpartial CFBNAME(endpartial)
-#define cfbendtab CFBNAME(endtab)
-#define cfbmask CFBNAME(mask)
-#define cfbrmask CFBNAME(rmask)
-#define cfbstartpartial CFBNAME(startpartial)
-#define cfbstarttab CFBNAME(starttab)
-
-#endif /* PSZ != 8 */
diff --git a/cfb/cfbmskbits.c b/cfb/cfbmskbits.c
deleted file mode 100644
index cbf364770..000000000
--- a/cfb/cfbmskbits.c
+++ /dev/null
@@ -1,1398 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.c,v 3.2 2001/01/17 22:36:35 dawes Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: cfbmskbits.c,v 1.3 2000/08/17 19:48:14 cpqbld Exp $ */
-
-/*
- * ==========================================================================
- * Converted to Color Frame Buffer by smarks@sun, April-May 1987. The "bit
- * numbering" in the doc below really means "byte numbering" now.
- * ==========================================================================
- */
-
-/*
- these tables are used by several macros in the cfb code.
-
- the vax numbers everything left to right, so bit indices on the
-screen match bit indices in longwords. the pc-rt and Sun number
-bits on the screen the way they would be written on paper,
-(i.e. msb to the left), and so a bit index n on the screen is
-bit index 32-n in a longword
-
- see also cfbmskbits.h
-*/
-#include <X.h>
-#include <Xmd.h>
-#include <servermd.h>
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-#define _cfbBits(a) (PixelGroup)(a)
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define cfbBits(v) _cfbBits(v)
-#else /* BITMAP_BIT_ORDER == LSBFirst */
-#define cfbFlip2(a) ((((a) & 0x1) << 1) | (((a) & 0x2) >> 1))
-#define cfbFlip4(a) ((cfbFlip2(a) << 2) | cfbFlip2(a >> 2))
-#define cfbFlip8(a) ((cfbFlip4(a) << 4) | cfbFlip4(a >> 4))
-#define cfbFlip16(a) ((cfbFlip8(a) << 8) | cfbFlip8(a >> 8))
-#define cfbFlip32(a) ((cfbFlip16(a) << 16) | cfbFlip16(a >> 16))
-#if PGSZ == 32
-#define cfbBits(a) cfbFlip32(_cfbBits(a))
-#else /* PGSZ == 64 */
-#define cfbFlip64(a) ((cfbFlip32(a) << 32) | cfbFlip32(a >> 32))
-#define cfbBits(a) cfbFlip64(_cfbBits(a))
-#endif /* PGSZ */
-#endif /* BITMAP_BIT_ORDER */
-
-/* NOTE:
-the first element in starttab could be 0xffffffff. making it 0
-lets us deal with a full first word in the middle loop, rather
-than having to do the multiple reads and masks that we'd
-have to do if we thought it was partial.
-*/
-#if PSZ == 4
-#if PGSZ == 32
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0x0FFFFFFF),
- cfbBits(0x00FFFFFF),
- cfbBits(0x000FFFFF),
- cfbBits(0x0000FFFF),
- cfbBits(0x00000FFF),
- cfbBits(0x000000FF),
- cfbBits(0x0000000F)
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0xF0000000),
- cfbBits(0xFF000000),
- cfbBits(0xFFF00000),
- cfbBits(0xFFFF0000),
- cfbBits(0xFFFFF000),
- cfbBits(0xFFFFFF00),
- cfbBits(0xFFFFFFF0)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x0FFFFFFFFFFFFFFF),
- cfbBits(0x00FFFFFFFFFFFFFF),
- cfbBits(0x000FFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x00000FFFFFFFFFFF),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x0000000FFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x000000000FFFFFFF),
- cfbBits(0x0000000000FFFFFF),
- cfbBits(0x00000000000FFFFF),
- cfbBits(0x000000000000FFFF),
- cfbBits(0x0000000000000FFF),
- cfbBits(0x00000000000000FF),
- cfbBits(0x000000000000000F),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0xF000000000000000),
- cfbBits(0xFF00000000000000),
- cfbBits(0xFFF0000000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFF00000000000),
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0xFFFFFFF000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFF0000000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFFFFFFFFF00000),
- cfbBits(0xFFFFFFFFFFFF0000),
- cfbBits(0xFFFFFFFFFFFFF000),
- cfbBits(0xFFFFFFFFFFFFFF00),
- cfbBits(0xFFFFFFFFFFFFFFF0),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 4 */
-
-#if PSZ == 8
-#if PGSZ == 32
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0x00FFFFFF),
- cfbBits(0x0000FFFF),
- cfbBits(0x000000FF)
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0xFF000000),
- cfbBits(0xFFFF0000),
- cfbBits(0xFFFFFF00)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x00FFFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x0000000000FFFFFF),
- cfbBits(0x000000000000FFFF),
- cfbBits(0x00000000000000FF)
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0xFF00000000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFFFFFFFFFF0000),
- cfbBits(0xFFFFFFFFFFFFFF00)
- };
-#endif /* PGSZ */
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-#if PGSZ == 32
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0x0000FFFF),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0xFFFF0000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x000000000000FFFF),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFFFFF0000),
- };
-#endif /* PGSZ */
-#endif
-
-#if PSZ == 24
-#if PGSZ == 32
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0x000000FF),
- cfbBits(0x0000FFFF),
- cfbBits(0x00FFFFFF),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x00000000),
- cfbBits(0xFFFFFF00),
- cfbBits(0xFFFF0000),
- cfbBits(0xFF000000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x000000000000FFFF),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFF000000000000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-#if PGSZ == 32
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x00000000),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x00000000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstarttab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x00000000FFFFFFFF),
- };
-PixelGroup cfbendtab[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0xFFFFFFFF00000000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 32 */
-
-/* a hack, for now, since the entries for 0 need to be all
- 1 bits, not all zeros.
- this means the code DOES NOT WORK for segments of length
- 0 (which is only a problem in the horizontal line code.)
-*/
-#if PSZ == 4
-#if PGSZ == 32
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0x0FFFFFFF),
- cfbBits(0x00FFFFFF),
- cfbBits(0x000FFFFF),
- cfbBits(0x0000FFFF),
- cfbBits(0x00000FFF),
- cfbBits(0x000000FF),
- cfbBits(0x0000000F)
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0xF0000000),
- cfbBits(0xFF000000),
- cfbBits(0xFFF00000),
- cfbBits(0xFFFF0000),
- cfbBits(0xFFFFF000),
- cfbBits(0xFFFFFF00),
- cfbBits(0xFFFFFFF0)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0x0FFFFFFFFFFFFFFF),
- cfbBits(0x00FFFFFFFFFFFFFF),
- cfbBits(0x000FFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x00000FFFFFFFFFFF),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x0000000FFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x000000000FFFFFFF),
- cfbBits(0x0000000000FFFFFF),
- cfbBits(0x00000000000FFFFF),
- cfbBits(0x000000000000FFFF),
- cfbBits(0x0000000000000FFF),
- cfbBits(0x00000000000000FF),
- cfbBits(0x000000000000000F),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0xF000000000000000),
- cfbBits(0xFF00000000000000),
- cfbBits(0xFFF0000000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFF00000000000),
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0xFFFFFFF000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFF0000000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFFFFFFFFF00000),
- cfbBits(0xFFFFFFFFFFFF0000),
- cfbBits(0xFFFFFFFFFFFFF000),
- cfbBits(0xFFFFFFFFFFFFFF00),
- cfbBits(0xFFFFFFFFFFFFFFF0),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 4 */
-
-#if PSZ == 8
-#if PGSZ == 32
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0x00FFFFFF),
- cfbBits(0x0000FFFF),
- cfbBits(0x000000FF)
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0xFF000000),
- cfbBits(0xFFFF0000),
- cfbBits(0xFFFFFF00)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0x00FFFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x0000000000FFFFFF),
- cfbBits(0x000000000000FFFF),
- cfbBits(0x00000000000000FF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0xFF00000000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFFFFFFFFFF0000),
- cfbBits(0xFFFFFFFFFFFFFF00),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-#if PGSZ == 32
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0x0000FFFF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0xFFFF0000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x000000000000FFFF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFFFFFFFF0000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 16 */
-
-#if PSZ == 24
-#if PGSZ == 32
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0x000000FF),
- cfbBits(0x0000FFFF),
- cfbBits(0x00FFFFFF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- cfbBits(0xFFFFFF00),
- cfbBits(0xFFFF0000),
- cfbBits(0xFF000000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0x0000000000FFFFFF),
- cfbBits(0x000000000000FFFF),
- cfbBits(0x00000000000000FF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0xFFFFFFFFFFFF0000),
- cfbBits(0xFFFFFFFFFF000000),
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0xFFFF000000000000),
- cfbBits(0xFF00000000000000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-#if PGSZ == 32
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFF),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbstartpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0x00000000FFFFFFFF),
- };
-
-PixelGroup cfbendpartial[] =
- {
- cfbBits(0xFFFFFFFFFFFFFFFF),
- cfbBits(0xFFFFFFFF00000000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 32 */
-
-/* used for masking bits in bresenham lines
- mask[n] is used to mask out all but bit n in a longword (n is a
-screen position).
- rmask[n] is used to mask out the single bit at position n (n
-is a screen posiotion.)
-*/
-
-#if PSZ == 4
-#if PGSZ == 32
-PixelGroup cfbmask[] =
- {
- cfbBits(0xF0000000),
- cfbBits(0x0F000000),
- cfbBits(0x00F00000),
- cfbBits(0x000F0000),
- cfbBits(0x0000F000),
- cfbBits(0x00000F00),
- cfbBits(0x000000F0),
- cfbBits(0x0000000F)
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x0FFFFFFF),
- cfbBits(0xF0FFFFFF),
- cfbBits(0xFF0FFFFF),
- cfbBits(0xFFF0FFFF),
- cfbBits(0xFFFF0FFF),
- cfbBits(0xFFFFF0FF),
- cfbBits(0xFFFFFF0F),
- cfbBits(0xFFFFFFF0)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbmask[] =
- {
- cfbBits(0xF000000000000000),
- cfbBits(0x0F00000000000000),
- cfbBits(0x00F0000000000000),
- cfbBits(0x000F000000000000),
- cfbBits(0x0000F00000000000),
- cfbBits(0x00000F0000000000),
- cfbBits(0x000000F000000000),
- cfbBits(0x0000000F00000000),
- cfbBits(0x00000000F0000000),
- cfbBits(0x000000000F000000),
- cfbBits(0x0000000000F00000),
- cfbBits(0x00000000000F0000),
- cfbBits(0x000000000000F000),
- cfbBits(0x0000000000000F00),
- cfbBits(0x00000000000000F0),
- cfbBits(0x000000000000000F),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x0FFFFFFFFFFFFFFF),
- cfbBits(0xF0FFFFFFFFFFFFFF),
- cfbBits(0xFF0FFFFFFFFFFFFF),
- cfbBits(0xFFF0FFFFFFFFFFFF),
- cfbBits(0xFFFF0FFFFFFFFFFF),
- cfbBits(0xFFFFF0FFFFFFFFFF),
- cfbBits(0xFFFFFF0FFFFFFFFF),
- cfbBits(0xFFFFFFF0FFFFFFFF),
- cfbBits(0xFFFFFFFF0FFFFFFF),
- cfbBits(0xFFFFFFFFF0FFFFFF),
- cfbBits(0xFFFFFFFFFF0FFFFF),
- cfbBits(0xFFFFFFFFFFF0FFFF),
- cfbBits(0xFFFFFFFFFFFF0FFF),
- cfbBits(0xFFFFFFFFFFFFF0FF),
- cfbBits(0xFFFFFFFFFFFFFF0F),
- cfbBits(0xFFFFFFFFFFFFFFF0),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 4 */
-
-#if PSZ == 8
-#if PGSZ == 32
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFF000000),
- cfbBits(0x00FF0000),
- cfbBits(0x0000FF00),
- cfbBits(0x000000FF)
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x00FFFFFF),
- cfbBits(0xFF00FFFF),
- cfbBits(0xFFFF00FF),
- cfbBits(0xFFFFFF00)
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFF00000000000000),
- cfbBits(0x00FF000000000000),
- cfbBits(0x0000FF0000000000),
- cfbBits(0x000000FF00000000),
- cfbBits(0x00000000FF000000),
- cfbBits(0x0000000000FF0000),
- cfbBits(0x000000000000FF00),
- cfbBits(0x00000000000000FF),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x00FFFFFFFFFFFFFF),
- cfbBits(0xFF00FFFFFFFFFFFF),
- cfbBits(0xFFFF00FFFFFFFFFF),
- cfbBits(0xFFFFFF00FFFFFFFF),
- cfbBits(0xFFFFFFFF00FFFFFF),
- cfbBits(0xFFFFFFFFFF00FFFF),
- cfbBits(0xFFFFFFFFFFFF00FF),
- cfbBits(0xFFFFFFFFFFFFFF00),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-#if PGSZ == 32
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFF0000),
- cfbBits(0x0000FFFF),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x0000FFFF),
- cfbBits(0xFFFF0000),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFF000000000000),
- cfbBits(0x0000FFFF00000000),
- cfbBits(0x00000000FFFF0000),
- cfbBits(0x000000000000FFFF),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x0000FFFFFFFFFFFF),
- cfbBits(0xFFFF0000FFFFFFFF),
- cfbBits(0xFFFFFFFF0000FFFF),
- cfbBits(0xFFFFFFFFFFFF0000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 16 */
-
-#if PSZ == 24
-#if PGSZ == 32
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFFFF00),
- cfbBits(0x00000000),
- cfbBits(0x000000FF),
- cfbBits(0xFFFF0000),
- cfbBits(0x0000FFFF),
- cfbBits(0xFF000000),
- cfbBits(0x00FFFFFF),
- cfbBits(0x00000000),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x000000FF),
- cfbBits(0xFFFFFFFF),
- cfbBits(0xFFFFFF00),
- cfbBits(0x0000FFFF),
- cfbBits(0xFFFF0000),
- cfbBits(0x00FFFFFF),
- cfbBits(0xFF000000),
- cfbBits(0xFFFFFFFF),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFFFF0000000000),
- cfbBits(0x000000FFFFFF0000),
- cfbBits(0x000000000000FFFF),
- };
-PixelGroup cfbmask2[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x0000000000000000),
- cfbBits(0xFF00000000000000),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x000000FFFFFFFFFF),
- cfbBits(0xFFFFFF000000FFFF),
- cfbBits(0xFFFFFFFFFFFF0000),
- };
-PixelGroup cfbrmask2[] =
- {
- cfbBits(0x0000000000000000),
- cfbBits(0x0000000000000000),
- cfbBits(0x00FFFFFFFFFFFFFF),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-#if PGSZ == 32
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFFFFFF),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0xFFFFFFFF),
- };
-#else /* PGSZ == 64 */
-PixelGroup cfbmask[] =
- {
- cfbBits(0xFFFFFFFF00000000),
- cfbBits(0x00000000FFFFFFFF),
- };
-PixelGroup cfbrmask[] =
- {
- cfbBits(0x00000000FFFFFFFF),
- cfbBits(0xFFFFFFFF00000000),
- };
-#endif /* PGSZ */
-#endif /* PSZ == 32 */
-
-/*
- * QuartetBitsTable contains PPW+1 masks whose binary values are masks in the
- * low order quartet that contain the number of bits specified in the
- * index. This table is used by getstipplepixels.
- */
-#if PSZ == 4
-PixelGroup QuartetBitsTable[] = {
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 00000000 */
- 0x00000080, /* 1 - 10000000 */
- 0x000000C0, /* 2 - 11000000 */
- 0x000000E0, /* 3 - 11100000 */
- 0x000000F0, /* 4 - 11110000 */
- 0x000000F8, /* 5 - 11111000 */
- 0x000000FC, /* 6 - 11111100 */
- 0x000000FE, /* 7 - 11111110 */
- 0x000000FF /* 8 - 11111111 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 00000000 */
- 0x00000001, /* 1 - 00000001 */
- 0x00000003, /* 2 - 00000011 */
- 0x00000007, /* 3 - 00000111 */
- 0x0000000F, /* 4 - 00001111 */
- 0x0000001F, /* 5 - 00011111 */
- 0x0000003F, /* 6 - 00111111 */
- 0x0000007F, /* 7 - 01111111 */
- 0x000000FF /* 8 - 11111111 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 0000000000000000 */
- 0x00008000, /* 1 - 1000000000000000 */
- 0x0000C000, /* 2 - 1100000000000000 */
- 0x0000E000, /* 3 - 1110000000000000 */
- 0x0000F000, /* 4 - 1111000000000000 */
- 0x0000F800, /* 5 - 1111100000000000 */
- 0x0000FC00, /* 6 - 1111110000000000 */
- 0x0000FE00, /* 7 - 1111111000000000 */
- 0x0000FF00, /* 8 - 1111111100000000 */
- 0x0000FF80, /* 9 - 1111111110000000 */
- 0x0000FFC0, /* 10- 1111111111000000 */
- 0x0000FFE0, /* 11- 1111111111100000 */
- 0x0000FFF0, /* 12- 1111111111110000 */
- 0x0000FFF8, /* 13- 1111111111111000 */
- 0x0000FFFC, /* 14- 1111111111111100 */
- 0x0000FFFE, /* 15- 1111111111111110 */
- 0x0000FFFF, /* 16- 1111111111111111 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 0000000000000000 */
- 0x00000001, /* 1 - 0000000000000001 */
- 0x00000003, /* 2 - 0000000000000011 */
- 0x00000007, /* 3 - 0000000000000111 */
- 0x0000000F, /* 4 - 0000000000001111 */
- 0x0000001F, /* 5 - 0000000000011111 */
- 0x0000003F, /* 6 - 0000000000111111 */
- 0x0000007F, /* 7 - 0000000001111111 */
- 0x000000FF, /* 8 - 0000000011111111 */
- 0x000001FF, /* 9 - 0000000111111111 */
- 0x000003FF, /* 10- 0000001111111111 */
- 0x000007FF, /* 11- 0000011111111111 */
- 0x00000FFF, /* 12- 0000111111111111 */
- 0x00001FFF, /* 13- 0001111111111111 */
- 0x00003FFF, /* 14- 0011111111111111 */
- 0x00007FFF, /* 15- 0111111111111111 */
- 0x0000FFFF, /* 16- 1111111111111111 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif /* PGSZ */
-};
-#endif /* PSZ == 4 */
-
-#if PSZ == 8
-PixelGroup QuartetBitsTable[] = {
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 0000 */
- 0x00000008, /* 1 - 1000 */
- 0x0000000C, /* 2 - 1100 */
- 0x0000000E, /* 3 - 1110 */
- 0x0000000F /* 4 - 1111 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 0000 */
- 0x00000001, /* 1 - 0001 */
- 0x00000003, /* 2 - 0011 */
- 0x00000007, /* 3 - 0111 */
- 0x0000000F /* 4 - 1111 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 00000000 */
- 0x00000080, /* 1 - 10000000 */
- 0x000000C0, /* 2 - 11000000 */
- 0x000000E0, /* 3 - 11100000 */
- 0x000000F0, /* 4 - 11110000 */
- 0x000000F8, /* 5 - 11111000 */
- 0x000000FC, /* 6 - 11111100 */
- 0x000000FE, /* 7 - 11111110 */
- 0x000000FF /* 8 - 11111111 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 00000000 */
- 0x00000001, /* 1 - 00000001 */
- 0x00000003, /* 2 - 00000011 */
- 0x00000007, /* 3 - 00000111 */
- 0x0000000F, /* 4 - 10000111 */
- 0x0000001F, /* 5 - 00011111 */
- 0x0000003F, /* 6 - 00111111 */
- 0x0000007F, /* 7 - 01111111 */
- 0x000000FF /* 8 - 11111111 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif /* PGSZ */
-};
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-PixelGroup QuartetBitsTable[] = {
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 00 */
- 0x00000002, /* 1 - 10 */
- 0x00000003, /* 2 - 11 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 00 */
- 0x00000001, /* 1 - 01 */
- 0x00000003, /* 2 - 11 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 0000 */
- 0x00000008, /* 1 - 1000 */
- 0x0000000C, /* 2 - 1100 */
- 0x0000000E, /* 3 - 1110 */
- 0x0000000F, /* 4 - 1111 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 0000 */
- 0x00000001, /* 1 - 0001 */
- 0x00000003, /* 2 - 0011 */
- 0x00000007, /* 3 - 0111 */
- 0x0000000F, /* 4 - 1111 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif /* PGSZ */
-};
-#endif /* PSZ == 16 */
-
-#if PSZ == 24
-PixelGroup QuartetBitsTable[] = {
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 0 */
- 0x00000001, /* 1 - 1 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 0 */
- 0x00000001, /* 1 - 1 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 00 */
- 0x00000002, /* 1 - 10 */
- 0x00000003, /* 2 - 11*/
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 00 */
- 0x00000001, /* 1 - 01 */
- 0x00000003, /* 2 - 11 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif /* PGSZ */
-};
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-PixelGroup QuartetBitsTable[] = {
-#if PGSZ == 32
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 0 */
- 0x00000001, /* 1 - 1 */
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 0 */
- 0x00000001, /* 1 - 1 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#else /* PGSZ == 64 */
-#if (BITMAP_BIT_ORDER == MSBFirst)
- 0x00000000, /* 0 - 00 */
- 0x00000002, /* 1 - 10 */
- 0x00000003, /* 2 - 11*/
-#else /* (BITMAP_BIT_ORDER == LSBFirst */
- 0x00000000, /* 0 - 00 */
- 0x00000001, /* 1 - 01 */
- 0x00000003, /* 2 - 11 */
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif /* PGSZ */
-};
-#endif /* PSZ == 32 */
-
-/*
- * QuartetPixelMaskTable is used by getstipplepixels to get a pixel mask
- * corresponding to a quartet of bits. Note: the bit/byte order dependency
- * is handled by QuartetBitsTable above.
- */
-#if PSZ == 4
-#if PGSZ == 32
-PixelGroup QuartetPixelMaskTable[] = {
- 0x00000000,
- 0x0000000F,
- 0x000000F0,
- 0x000000FF,
- 0x00000F00,
- 0x00000F0F,
- 0x00000FF0,
- 0x00000FFF,
- 0x0000F000,
- 0x0000F00F,
- 0x0000F0F0,
- 0x0000F0FF,
- 0x0000FF00,
- 0x0000FF0F,
- 0x0000FFF0,
- 0x0000FFFF,
- 0x000F0000,
- 0x000F000F,
- 0x000F00F0,
- 0x000F00FF,
- 0x000F0F00,
- 0x000F0F0F,
- 0x000F0FF0,
- 0x000F0FFF,
- 0x000FF000,
- 0x000FF00F,
- 0x000FF0F0,
- 0x000FF0FF,
- 0x000FFF00,
- 0x000FFF0F,
- 0x000FFFF0,
- 0x000FFFFF,
- 0x00F00000,
- 0x00F0000F,
- 0x00F000F0,
- 0x00F000FF,
- 0x00F00F00,
- 0x00F00F0F,
- 0x00F00FF0,
- 0x00F00FFF,
- 0x00F0F000,
- 0x00F0F00F,
- 0x00F0F0F0,
- 0x00F0F0FF,
- 0x00F0FF00,
- 0x00F0FF0F,
- 0x00F0FFF0,
- 0x00F0FFFF,
- 0x00FF0000,
- 0x00FF000F,
- 0x00FF00F0,
- 0x00FF00FF,
- 0x00FF0F00,
- 0x00FF0F0F,
- 0x00FF0FF0,
- 0x00FF0FFF,
- 0x00FFF000,
- 0x00FFF00F,
- 0x00FFF0F0,
- 0x00FFF0FF,
- 0x00FFFF00,
- 0x00FFFF0F,
- 0x00FFFFF0,
- 0x00FFFFFF,
- 0x0F000000,
- 0x0F00000F,
- 0x0F0000F0,
- 0x0F0000FF,
- 0x0F000F00,
- 0x0F000F0F,
- 0x0F000FF0,
- 0x0F000FFF,
- 0x0F00F000,
- 0x0F00F00F,
- 0x0F00F0F0,
- 0x0F00F0FF,
- 0x0F00FF00,
- 0x0F00FF0F,
- 0x0F00FFF0,
- 0x0F00FFFF,
- 0x0F0F0000,
- 0x0F0F000F,
- 0x0F0F00F0,
- 0x0F0F00FF,
- 0x0F0F0F00,
- 0x0F0F0F0F,
- 0x0F0F0FF0,
- 0x0F0F0FFF,
- 0x0F0FF000,
- 0x0F0FF00F,
- 0x0F0FF0F0,
- 0x0F0FF0FF,
- 0x0F0FFF00,
- 0x0F0FFF0F,
- 0x0F0FFFF0,
- 0x0F0FFFFF,
- 0x0FF00000,
- 0x0FF0000F,
- 0x0FF000F0,
- 0x0FF000FF,
- 0x0FF00F00,
- 0x0FF00F0F,
- 0x0FF00FF0,
- 0x0FF00FFF,
- 0x0FF0F000,
- 0x0FF0F00F,
- 0x0FF0F0F0,
- 0x0FF0F0FF,
- 0x0FF0FF00,
- 0x0FF0FF0F,
- 0x0FF0FFF0,
- 0x0FF0FFFF,
- 0x0FFF0000,
- 0x0FFF000F,
- 0x0FFF00F0,
- 0x0FFF00FF,
- 0x0FFF0F00,
- 0x0FFF0F0F,
- 0x0FFF0FF0,
- 0x0FFF0FFF,
- 0x0FFFF000,
- 0x0FFFF00F,
- 0x0FFFF0F0,
- 0x0FFFF0FF,
- 0x0FFFFF00,
- 0x0FFFFF0F,
- 0x0FFFFFF0,
- 0x0FFFFFFF,
- 0xF0000000,
- 0xF000000F,
- 0xF00000F0,
- 0xF00000FF,
- 0xF0000F00,
- 0xF0000F0F,
- 0xF0000FF0,
- 0xF0000FFF,
- 0xF000F000,
- 0xF000F00F,
- 0xF000F0F0,
- 0xF000F0FF,
- 0xF000FF00,
- 0xF000FF0F,
- 0xF000FFF0,
- 0xF000FFFF,
- 0xF00F0000,
- 0xF00F000F,
- 0xF00F00F0,
- 0xF00F00FF,
- 0xF00F0F00,
- 0xF00F0F0F,
- 0xF00F0FF0,
- 0xF00F0FFF,
- 0xF00FF000,
- 0xF00FF00F,
- 0xF00FF0F0,
- 0xF00FF0FF,
- 0xF00FFF00,
- 0xF00FFF0F,
- 0xF00FFFF0,
- 0xF00FFFFF,
- 0xF0F00000,
- 0xF0F0000F,
- 0xF0F000F0,
- 0xF0F000FF,
- 0xF0F00F00,
- 0xF0F00F0F,
- 0xF0F00FF0,
- 0xF0F00FFF,
- 0xF0F0F000,
- 0xF0F0F00F,
- 0xF0F0F0F0,
- 0xF0F0F0FF,
- 0xF0F0FF00,
- 0xF0F0FF0F,
- 0xF0F0FFF0,
- 0xF0F0FFFF,
- 0xF0FF0000,
- 0xF0FF000F,
- 0xF0FF00F0,
- 0xF0FF00FF,
- 0xF0FF0F00,
- 0xF0FF0F0F,
- 0xF0FF0FF0,
- 0xF0FF0FFF,
- 0xF0FFF000,
- 0xF0FFF00F,
- 0xF0FFF0F0,
- 0xF0FFF0FF,
- 0xF0FFFF00,
- 0xF0FFFF0F,
- 0xF0FFFFF0,
- 0xF0FFFFFF,
- 0xFF000000,
- 0xFF00000F,
- 0xFF0000F0,
- 0xFF0000FF,
- 0xFF000F00,
- 0xFF000F0F,
- 0xFF000FF0,
- 0xFF000FFF,
- 0xFF00F000,
- 0xFF00F00F,
- 0xFF00F0F0,
- 0xFF00F0FF,
- 0xFF00FF00,
- 0xFF00FF0F,
- 0xFF00FFF0,
- 0xFF00FFFF,
- 0xFF0F0000,
- 0xFF0F000F,
- 0xFF0F00F0,
- 0xFF0F00FF,
- 0xFF0F0F00,
- 0xFF0F0F0F,
- 0xFF0F0FF0,
- 0xFF0F0FFF,
- 0xFF0FF000,
- 0xFF0FF00F,
- 0xFF0FF0F0,
- 0xFF0FF0FF,
- 0xFF0FFF00,
- 0xFF0FFF0F,
- 0xFF0FFFF0,
- 0xFF0FFFFF,
- 0xFFF00000,
- 0xFFF0000F,
- 0xFFF000F0,
- 0xFFF000FF,
- 0xFFF00F00,
- 0xFFF00F0F,
- 0xFFF00FF0,
- 0xFFF00FFF,
- 0xFFF0F000,
- 0xFFF0F00F,
- 0xFFF0F0F0,
- 0xFFF0F0FF,
- 0xFFF0FF00,
- 0xFFF0FF0F,
- 0xFFF0FFF0,
- 0xFFF0FFFF,
- 0xFFFF0000,
- 0xFFFF000F,
- 0xFFFF00F0,
- 0xFFFF00FF,
- 0xFFFF0F00,
- 0xFFFF0F0F,
- 0xFFFF0FF0,
- 0xFFFF0FFF,
- 0xFFFFF000,
- 0xFFFFF00F,
- 0xFFFFF0F0,
- 0xFFFFF0FF,
- 0xFFFFFF00,
- 0xFFFFFF0F,
- 0xFFFFFFF0,
- 0xFFFFFFFF,
-};
-#else /* PGSZ == 64 */
-No QuartetPixelMaskTable for psz=PSZ
-this would be a 64K entry table, a bit much I think.
-Try breaking things in two:
-mask = table[index&0xff00]<<32 | table[index&0xff]
-#endif /* PGSZ */
-#endif /* PSZ == 4 */
-
-#if PSZ == 8
-PixelGroup QuartetPixelMaskTable[] = {
-#if PGSZ == 32
- 0x00000000,
- 0x000000FF,
- 0x0000FF00,
- 0x0000FFFF,
- 0x00FF0000,
- 0x00FF00FF,
- 0x00FFFF00,
- 0x00FFFFFF,
- 0xFF000000,
- 0xFF0000FF,
- 0xFF00FF00,
- 0xFF00FFFF,
- 0xFFFF0000,
- 0xFFFF00FF,
- 0xFFFFFF00,
- 0xFFFFFFFF
-#else /* PGSZ == 64 */
- 0x0000000000000000, 0x00000000000000FF,
- 0x000000000000FF00, 0x000000000000FFFF,
- 0x0000000000FF0000, 0x0000000000FF00FF,
- 0x0000000000FFFF00, 0x0000000000FFFFFF,
- 0x00000000FF000000, 0x00000000FF0000FF,
- 0x00000000FF00FF00, 0x00000000FF00FFFF,
- 0x00000000FFFF0000, 0x00000000FFFF00FF,
- 0x00000000FFFFFF00, 0x00000000FFFFFFFF,
- 0x000000FF00000000, 0x000000FF000000FF,
- 0x000000FF0000FF00, 0x000000FF0000FFFF,
- 0x000000FF00FF0000, 0x000000FF00FF00FF,
- 0x000000FF00FFFF00, 0x000000FF00FFFFFF,
- 0x000000FFFF000000, 0x000000FFFF0000FF,
- 0x000000FFFF00FF00, 0x000000FFFF00FFFF,
- 0x000000FFFFFF0000, 0x000000FFFFFF00FF,
- 0x000000FFFFFFFF00, 0x000000FFFFFFFFFF,
- 0x0000FF0000000000, 0x0000FF00000000FF,
- 0x0000FF000000FF00, 0x0000FF000000FFFF,
- 0x0000FF0000FF0000, 0x0000FF0000FF00FF,
- 0x0000FF0000FFFF00, 0x0000FF0000FFFFFF,
- 0x0000FF00FF000000, 0x0000FF00FF0000FF,
- 0x0000FF00FF00FF00, 0x0000FF00FF00FFFF,
- 0x0000FF00FFFF0000, 0x0000FF00FFFF00FF,
- 0x0000FF00FFFFFF00, 0x0000FF00FFFFFFFF,
- 0x0000FFFF00000000, 0x0000FFFF000000FF,
- 0x0000FFFF0000FF00, 0x0000FFFF0000FFFF,
- 0x0000FFFF00FF0000, 0x0000FFFF00FF00FF,
- 0x0000FFFF00FFFF00, 0x0000FFFF00FFFFFF,
- 0x0000FFFFFF000000, 0x0000FFFFFF0000FF,
- 0x0000FFFFFF00FF00, 0x0000FFFFFF00FFFF,
- 0x0000FFFFFFFF0000, 0x0000FFFFFFFF00FF,
- 0x0000FFFFFFFFFF00, 0x0000FFFFFFFFFFFF,
- 0x00FF000000000000, 0x00FF0000000000FF,
- 0x00FF00000000FF00, 0x00FF00000000FFFF,
- 0x00FF000000FF0000, 0x00FF000000FF00FF,
- 0x00FF000000FFFF00, 0x00FF000000FFFFFF,
- 0x00FF0000FF000000, 0x00FF0000FF0000FF,
- 0x00FF0000FF00FF00, 0x00FF0000FF00FFFF,
- 0x00FF0000FFFF0000, 0x00FF0000FFFF00FF,
- 0x00FF0000FFFFFF00, 0x00FF0000FFFFFFFF,
- 0x00FF00FF00000000, 0x00FF00FF000000FF,
- 0x00FF00FF0000FF00, 0x00FF00FF0000FFFF,
- 0x00FF00FF00FF0000, 0x00FF00FF00FF00FF,
- 0x00FF00FF00FFFF00, 0x00FF00FF00FFFFFF,
- 0x00FF00FFFF000000, 0x00FF00FFFF0000FF,
- 0x00FF00FFFF00FF00, 0x00FF00FFFF00FFFF,
- 0x00FF00FFFFFF0000, 0x00FF00FFFFFF00FF,
- 0x00FF00FFFFFFFF00, 0x00FF00FFFFFFFFFF,
- 0x00FFFF0000000000, 0x00FFFF00000000FF,
- 0x00FFFF000000FF00, 0x00FFFF000000FFFF,
- 0x00FFFF0000FF0000, 0x00FFFF0000FF00FF,
- 0x00FFFF0000FFFF00, 0x00FFFF0000FFFFFF,
- 0x00FFFF00FF000000, 0x00FFFF00FF0000FF,
- 0x00FFFF00FF00FF00, 0x00FFFF00FF00FFFF,
- 0x00FFFF00FFFF0000, 0x00FFFF00FFFF00FF,
- 0x00FFFF00FFFFFF00, 0x00FFFF00FFFFFFFF,
- 0x00FFFFFF00000000, 0x00FFFFFF000000FF,
- 0x00FFFFFF0000FF00, 0x00FFFFFF0000FFFF,
- 0x00FFFFFF00FF0000, 0x00FFFFFF00FF00FF,
- 0x00FFFFFF00FFFF00, 0x00FFFFFF00FFFFFF,
- 0x00FFFFFFFF000000, 0x00FFFFFFFF0000FF,
- 0x00FFFFFFFF00FF00, 0x00FFFFFFFF00FFFF,
- 0x00FFFFFFFFFF0000, 0x00FFFFFFFFFF00FF,
- 0x00FFFFFFFFFFFF00, 0x00FFFFFFFFFFFFFF,
- 0xFF00000000000000, 0xFF000000000000FF,
- 0xFF0000000000FF00, 0xFF0000000000FFFF,
- 0xFF00000000FF0000, 0xFF00000000FF00FF,
- 0xFF00000000FFFF00, 0xFF00000000FFFFFF,
- 0xFF000000FF000000, 0xFF000000FF0000FF,
- 0xFF000000FF00FF00, 0xFF000000FF00FFFF,
- 0xFF000000FFFF0000, 0xFF000000FFFF00FF,
- 0xFF000000FFFFFF00, 0xFF000000FFFFFFFF,
- 0xFF0000FF00000000, 0xFF0000FF000000FF,
- 0xFF0000FF0000FF00, 0xFF0000FF0000FFFF,
- 0xFF0000FF00FF0000, 0xFF0000FF00FF00FF,
- 0xFF0000FF00FFFF00, 0xFF0000FF00FFFFFF,
- 0xFF0000FFFF000000, 0xFF0000FFFF0000FF,
- 0xFF0000FFFF00FF00, 0xFF0000FFFF00FFFF,
- 0xFF0000FFFFFF0000, 0xFF0000FFFFFF00FF,
- 0xFF0000FFFFFFFF00, 0xFF0000FFFFFFFFFF,
- 0xFF00FF0000000000, 0xFF00FF00000000FF,
- 0xFF00FF000000FF00, 0xFF00FF000000FFFF,
- 0xFF00FF0000FF0000, 0xFF00FF0000FF00FF,
- 0xFF00FF0000FFFF00, 0xFF00FF0000FFFFFF,
- 0xFF00FF00FF000000, 0xFF00FF00FF0000FF,
- 0xFF00FF00FF00FF00, 0xFF00FF00FF00FFFF,
- 0xFF00FF00FFFF0000, 0xFF00FF00FFFF00FF,
- 0xFF00FF00FFFFFF00, 0xFF00FF00FFFFFFFF,
- 0xFF00FFFF00000000, 0xFF00FFFF000000FF,
- 0xFF00FFFF0000FF00, 0xFF00FFFF0000FFFF,
- 0xFF00FFFF00FF0000, 0xFF00FFFF00FF00FF,
- 0xFF00FFFF00FFFF00, 0xFF00FFFF00FFFFFF,
- 0xFF00FFFFFF000000, 0xFF00FFFFFF0000FF,
- 0xFF00FFFFFF00FF00, 0xFF00FFFFFF00FFFF,
- 0xFF00FFFFFFFF0000, 0xFF00FFFFFFFF00FF,
- 0xFF00FFFFFFFFFF00, 0xFF00FFFFFFFFFFFF,
- 0xFFFF000000000000, 0xFFFF0000000000FF,
- 0xFFFF00000000FF00, 0xFFFF00000000FFFF,
- 0xFFFF000000FF0000, 0xFFFF000000FF00FF,
- 0xFFFF000000FFFF00, 0xFFFF000000FFFFFF,
- 0xFFFF0000FF000000, 0xFFFF0000FF0000FF,
- 0xFFFF0000FF00FF00, 0xFFFF0000FF00FFFF,
- 0xFFFF0000FFFF0000, 0xFFFF0000FFFF00FF,
- 0xFFFF0000FFFFFF00, 0xFFFF0000FFFFFFFF,
- 0xFFFF00FF00000000, 0xFFFF00FF000000FF,
- 0xFFFF00FF0000FF00, 0xFFFF00FF0000FFFF,
- 0xFFFF00FF00FF0000, 0xFFFF00FF00FF00FF,
- 0xFFFF00FF00FFFF00, 0xFFFF00FF00FFFFFF,
- 0xFFFF00FFFF000000, 0xFFFF00FFFF0000FF,
- 0xFFFF00FFFF00FF00, 0xFFFF00FFFF00FFFF,
- 0xFFFF00FFFFFF0000, 0xFFFF00FFFFFF00FF,
- 0xFFFF00FFFFFFFF00, 0xFFFF00FFFFFFFFFF,
- 0xFFFFFF0000000000, 0xFFFFFF00000000FF,
- 0xFFFFFF000000FF00, 0xFFFFFF000000FFFF,
- 0xFFFFFF0000FF0000, 0xFFFFFF0000FF00FF,
- 0xFFFFFF0000FFFF00, 0xFFFFFF0000FFFFFF,
- 0xFFFFFF00FF000000, 0xFFFFFF00FF0000FF,
- 0xFFFFFF00FF00FF00, 0xFFFFFF00FF00FFFF,
- 0xFFFFFF00FFFF0000, 0xFFFFFF00FFFF00FF,
- 0xFFFFFF00FFFFFF00, 0xFFFFFF00FFFFFFFF,
- 0xFFFFFFFF00000000, 0xFFFFFFFF000000FF,
- 0xFFFFFFFF0000FF00, 0xFFFFFFFF0000FFFF,
- 0xFFFFFFFF00FF0000, 0xFFFFFFFF00FF00FF,
- 0xFFFFFFFF00FFFF00, 0xFFFFFFFF00FFFFFF,
- 0xFFFFFFFFFF000000, 0xFFFFFFFFFF0000FF,
- 0xFFFFFFFFFF00FF00, 0xFFFFFFFFFF00FFFF,
- 0xFFFFFFFFFFFF0000, 0xFFFFFFFFFFFF00FF,
- 0xFFFFFFFFFFFFFF00, 0xFFFFFFFFFFFFFFFF,
-#endif /* PGSZ */
-};
-#endif /* PSZ == 8 */
-
-#if PSZ == 16
-PixelGroup QuartetPixelMaskTable[] = {
-#if PGSZ == 32
- 0x00000000,
- 0x0000FFFF,
- 0xFFFF0000,
- 0xFFFFFFFF,
-#else /* PGSZ == 64 */
- 0x0000000000000000, 0x000000000000FFFF,
- 0x00000000FFFF0000, 0x00000000FFFFFFFF,
- 0x0000FFFF00000000, 0x0000FFFF0000FFFF,
- 0x0000FFFFFFFF0000, 0x0000FFFFFFFFFFFF,
- 0xFFFF000000000000, 0xFFFF00000000FFFF,
- 0xFFFF0000FFFF0000, 0xFFFF0000FFFFFFFF,
- 0xFFFFFFFF00000000, 0xFFFFFFFF0000FFFF,
- 0xFFFFFFFFFFFF0000, 0xFFFFFFFFFFFFFFFF,
-#endif /* PGSZ */
-};
-#endif /* PSZ == 16 */
-
-#if PSZ == 24
-PixelGroup QuartetPixelMaskTable[] = {
-#if PGSZ == 32
-/* Four pixels consist three pixel groups....*/
- 0x00000000, 0x00FFFFFF, /*0x00000000, *//*0*/
-/* 0x00000000, 0x00000000, 0x00000000,*/ /*0*/
-/* 0x00FFFFFF, 0x00000000, 0x00000000,*/ /*1*/
-/* 0xFF000000, 0x0000FFFF, 0x00000000,*/ /*2*/
-/* 0xFFFFFFFF, 0x0000FFFF, 0x00000000,*/ /*3*/
-/* 0x00000000, 0xFFFF0000, 0x000000FF,*/ /*4*/
-/* 0x00FFFFFF, 0xFFFF0000, 0x000000FF,*/ /*5*/
-/* 0xFF000000, 0xFFFFFFFF, 0x000000FF,*/ /*6*/
-/* 0xFFFFFFFF, 0xFFFFFFFF, 0x000000FF,*/ /*7*/
-/* 0x00000000, 0x00000000, 0xFFFFFF00,*/ /*8*/
-/* 0x00FFFFFF, 0x00000000, 0xFFFFFF00,*/ /*9*/
-/* 0xFF000000, 0x0000FFFF, 0xFFFFFF00,*/ /*10*/
-/* 0xFFFFFFFF, 0x0000FFFF, 0xFFFFFF00,*/ /*11*/
-/* 0x00000000, 0xFFFF0000, 0xFFFFFFFF,*/ /*12*/
-/* 0x00FFFFFF, 0xFFFF0000, 0xFFFFFFFF,*/ /*13*/
-/* 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF,*/ /*14*/
-/* 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,*/ /*15*/
-#else /* PGSZ == 64 */
- 0x0000000000000000, 0x0000000000FFFFFF,
- 0x0000FFFFFF000000, 0xFFFFFFFFFFFFFFFF
-#endif /* PGSZ */
-};
-#endif /* PSZ == 24 */
-
-#if PSZ == 32
-PixelGroup QuartetPixelMaskTable[] = {
-#if PGSZ == 32
- 0x00000000,
- 0xFFFFFFFF,
-#else /* PGSZ == 64 */
- 0x0000000000000000,
- 0x00000000FFFFFFFF,
- 0xFFFFFFFF00000000,
- 0xFFFFFFFFFFFFFFFF
-#endif /* PGSZ */
-};
-#endif /* PSZ == 32 */
-
-#if PSZ == 24
-int cfb24Shift[] =
-#if (BITMAP_BIT_ORDER == MSBFirst)
-{8,0,16,16,8,24,0,0};
-#else /* (BITMAP_BIT_ORDER == LSBFirst) */
-{0,0,24,8,16,16,8,0};
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-#endif
diff --git a/cfb/cfbmskbits.h b/cfb/cfbmskbits.h
deleted file mode 100644
index b7f9969dd..000000000
--- a/cfb/cfbmskbits.h
+++ /dev/null
@@ -1,897 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.14 2003/10/29 22:44:53 tsi Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: cfbmskbits.h,v 1.3 2000/08/17 19:48:14 cpqbld Exp $ */
-/* Optimizations for PSZ == 32 added by Kyle Marvin (marvin@vitec.com) */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#if defined(XFREE86) || ( defined(__OpenBSD__) && defined(__alpha__) ) \
- || (defined(__bsdi__))
-#include "xf86_ansic.h"
-#include "compiler.h"
-#endif
-
-/*
- * ==========================================================================
- * Converted from mfb to support memory-mapped color framebuffer by smarks@sun,
- * April-May 1987.
- *
- * The way I did the conversion was to consider each longword as an
- * array of four bytes instead of an array of 32 one-bit pixels. So
- * getbits() and putbits() retain much the same calling sequence, but
- * they move bytes around instead of bits. Of course, this entails the
- * removal of all of the one-bit-pixel dependencies from the other
- * files, but the major bit-hacking stuff should be covered here.
- *
- * I've created some new macros that make it easier to understand what's
- * going on in the pixel calculations, and that make it easier to change the
- * pixel size.
- *
- * name explanation
- * ---- -----------
- * PSZ pixel size (in bits)
- * PGSZ pixel group size (in bits)
- * PGSZB pixel group size (in bytes)
- * PGSZBMSK mask with lowest PGSZB bits set to 1
- * PPW pixels per word (pixels per pixel group)
- * PPWMSK mask with lowest PPW bits set to 1
- * PLST index of last pixel in a word (should be PPW-1)
- * PIM pixel index mask (index within a pixel group)
- * PWSH pixel-to-word shift (should be log2(PPW))
- * PMSK mask with lowest PSZ bits set to 1
- *
- *
- * Here are some sample values. In the notation cfbA,B: A is PSZ, and
- * B is PGSZB. All the other values are derived from these
- * two. This table does not show all combinations!
- *
- * name cfb8,4 cfb24,4 cfb32,4 cfb8,8 cfb24,8 cfb32,8
- * ---- ------ ------- ------ ------ ------ -------
- * PSZ 8 24 32 8 24 32
- * PGSZ 32 32 32 64 64 64
- * PGSZB 4 4 4 8 8 8
- * PGSZBMSK 0xF 0xF? 0xF 0xFF 0xFF 0xFF
- * PPW 4 1 1 8 2 2
- * PPWMSK 0xF 0x1 0x1 0xFF 0x3? 0x3
- * PLST 3 0 0 7 1 1
- * PIM 0x3 0x0 0x0 0x7 0x1? 0x1
- * PWSH 2 0 0 3 1 1
- * PMSK 0xFF 0xFFFFFF 0xFFFFFFFF 0xFF 0xFFFFFF 0xFFFFFFFF
- *
- *
- * I have also added a new macro, PFILL, that takes one pixel and
- * replicates it throughout a word. This macro definition is dependent
- * upon pixel and word size; it doesn't use macros like PPW and so
- * forth. Examples: for monochrome, PFILL(1) => 0xffffffff, PFILL(0) =>
- * 0x00000000. For 8-bit color, PFILL(0x5d) => 0x5d5d5d5d. This macro
- * is used primarily for replicating a plane mask into a word.
- *
- * Color framebuffers operations also support the notion of a plane
- * mask. This mask determines which planes of the framebuffer can be
- * altered; the others are left unchanged. I have added another
- * parameter to the putbits and putbitsrop macros that is the plane
- * mask.
- * ==========================================================================
- *
- * Keith Packard (keithp@suse.com)
- * 64bit code is no longer supported; it requires DIX support
- * for repadding images which significantly impacts performance
- */
-
-/*
- * PSZ needs to be defined before we get here. Usually it comes from a
- * -DPSZ=foo on the compilation command line.
- */
-
-#ifndef PSZ
-#define PSZ 8
-#endif
-
-/*
- * PixelGroup is the data type used to operate on groups of pixels.
- * We typedef it here to CARD32 with the assumption that you
- * want to manipulate 32 bits worth of pixels at a time as you can. If CARD32
- * is not appropriate for your server, define it to something else
- * before including this file. In this case you will also have to define
- * PGSZB to the size in bytes of PixelGroup.
- */
-#ifndef PixelGroup
-#define PixelGroup CARD32
-#define PGSZB 4
-#endif /* PixelGroup */
-
-#ifndef CfbBits
-#define CfbBits CARD32
-#endif
-
-#define PGSZ (PGSZB << 3)
-#define PPW (PGSZ/PSZ)
-#define PLST (PPW-1)
-#define PIM PLST
-#define PMSK (((PixelGroup)1 << PSZ) - 1)
-#define PPWMSK (((PixelGroup)1 << PPW) - 1) /* instead of BITMSK */
-#define PGSZBMSK (((PixelGroup)1 << PGSZB) - 1)
-
-/* set PWSH = log2(PPW) using brute force */
-
-#if PPW == 1
-#define PWSH 0
-#else
-#if PPW == 2
-#define PWSH 1
-#else
-#if PPW == 4
-#define PWSH 2
-#else
-#if PPW == 8
-#define PWSH 3
-#else
-#if PPW == 16
-#define PWSH 4
-#endif /* PPW == 16 */
-#endif /* PPW == 8 */
-#endif /* PPW == 4 */
-#endif /* PPW == 2 */
-#endif /* PPW == 1 */
-
-/* Defining PIXEL_ADDR means that individual pixels are addressable by this
- * machine (as type PixelType). A possible CFB architecture which supported
- * 8-bits-per-pixel on a non byte-addressable machine would not have this
- * defined.
- *
- * Defining FOUR_BIT_CODE means that cfb knows how to stipple on this machine;
- * eventually, stippling code for 16 and 32 bit devices should be written
- * which would allow them to also use FOUR_BIT_CODE. There isn't that
- * much to do in those cases, but it would make them quite a bit faster.
- */
-
-#if PSZ == 8
-#define PIXEL_ADDR
-typedef CARD8 PixelType;
-#define FOUR_BIT_CODE
-#endif
-
-#if PSZ == 16
-#define PIXEL_ADDR
-typedef CARD16 PixelType;
-#endif
-
-#if PSZ == 24
-#undef PMSK
-#define PMSK 0xFFFFFF
-/*#undef PIM
-#define PIM 3*/
-#define PIXEL_ADDR
-typedef CARD32 PixelType;
-#endif
-
-#if PSZ == 32
-#undef PMSK
-#define PMSK 0xFFFFFFFF
-#define PIXEL_ADDR
-typedef CARD32 PixelType;
-#endif
-
-
-/* the following notes use the following conventions:
-SCREEN LEFT SCREEN RIGHT
-in this file and maskbits.c, left and right refer to screen coordinates,
-NOT bit numbering in registers.
-
-cfbstarttab[n]
- pixels[0,n-1] = 0's pixels[n,PPW-1] = 1's
-cfbendtab[n] =
- pixels[0,n-1] = 1's pixels[n,PPW-1] = 0's
-
-cfbstartpartial[], cfbendpartial[]
- these are used as accelerators for doing putbits and masking out
-bits that are all contained between longword boudaries. the extra
-256 bytes of data seems a small price to pay -- code is smaller,
-and narrow things (e.g. window borders) go faster.
-
-the names may seem misleading; they are derived not from which end
-of the word the bits are turned on, but at which end of a scanline
-the table tends to be used.
-
-look at the tables and macros to understand boundary conditions.
-(careful readers will note that starttab[n] = ~endtab[n] for n != 0)
-
------------------------------------------------------------------------
-these two macros depend on the screen's bit ordering.
-in both of them x is a screen position. they are used to
-combine bits collected from multiple longwords into a
-single destination longword, and to unpack a single
-source longword into multiple destinations.
-
-SCRLEFT(dst, x)
- takes dst[x, PPW] and moves them to dst[0, PPW-x]
- the contents of the rest of dst are 0 ONLY IF
- dst is UNSIGNED.
- is cast as an unsigned.
- this is a right shift on the VAX, left shift on
- Sun and pc-rt.
-
-SCRRIGHT(dst, x)
- takes dst[0,x] and moves them to dst[PPW-x, PPW]
- the contents of the rest of dst are 0 ONLY IF
- dst is UNSIGNED.
- this is a left shift on the VAX, right shift on
- Sun and pc-rt.
-
-
-the remaining macros are cpu-independent; all bit order dependencies
-are built into the tables and the two macros above.
-
-maskbits(x, w, startmask, endmask, nlw)
- for a span of width w starting at position x, returns
-a mask for ragged pixels at start, mask for ragged pixels at end,
-and the number of whole longwords between the ends.
-
-maskpartialbits(x, w, mask)
- works like maskbits(), except all the pixels are in the
- same longword (i.e. (x&0xPIM + w) <= PPW)
-
-mask32bits(x, w, startmask, endmask, nlw)
- as maskbits, but does not calculate nlw. it is used by
- cfbGlyphBlt to put down glyphs <= PPW bits wide.
-
-getbits(psrc, x, w, dst)
- starting at position x in psrc (x < PPW), collect w
- pixels and put them in the screen left portion of dst.
- psrc is a longword pointer. this may span longword boundaries.
- it special-cases fetching all w bits from one longword.
-
- +--------+--------+ +--------+
- | | m |n| | ==> | m |n| |
- +--------+--------+ +--------+
- x x+w 0 w
- psrc psrc+1 dst
- m = PPW - x
- n = w - m
-
- implementation:
- get m pixels, move to screen-left of dst, zeroing rest of dst;
- get n pixels from next word, move screen-right by m, zeroing
- lower m pixels of word.
- OR the two things together.
-
-putbits(src, x, w, pdst, planemask)
- starting at position x in pdst, put down the screen-leftmost
- w bits of src. pdst is a longword pointer. this may
- span longword boundaries.
- it special-cases putting all w bits into the same longword.
-
- +--------+ +--------+--------+
- | m |n| | ==> | | m |n| |
- +--------+ +--------+--------+
- 0 w x x+w
- dst pdst pdst+1
- m = PPW - x
- n = w - m
-
- implementation:
- get m pixels, shift screen-right by x, zero screen-leftmost x
- pixels; zero rightmost m bits of *pdst and OR in stuff
- from before the semicolon.
- shift src screen-left by m, zero bits n-32;
- zero leftmost n pixels of *(pdst+1) and OR in the
- stuff from before the semicolon.
-
-putbitsrop(src, x, w, pdst, planemask, ROP)
- like putbits but calls DoRop with the rasterop ROP (see cfb.h for
- DoRop)
-
-getleftbits(psrc, w, dst)
- get the leftmost w (w<=PPW) bits from *psrc and put them
- in dst. this is used by the cfbGlyphBlt code for glyphs
- <=PPW bits wide.
-*/
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define BitRight(lw,n) ((lw) >> (n))
-#define BitLeft(lw,n) ((lw) << (n))
-#else /* (BITMAP_BIT_ORDER == LSBFirst) */
-#define BitRight(lw,n) ((lw) << (n))
-#define BitLeft(lw,n) ((lw) >> (n))
-#endif /* (BITMAP_BIT_ORDER == MSBFirst) */
-
-#define SCRLEFT(lw, n) BitLeft (lw, (n) * PSZ)
-#define SCRRIGHT(lw, n) BitRight(lw, (n) * PSZ)
-
-/*
- * Note that the shift direction is independent of the byte ordering of the
- * machine. The following is portable code.
- */
-#if PPW == 16
-#define PFILL(p) ( ((p)&PMSK) | \
- ((p)&PMSK) << PSZ | \
- ((p)&PMSK) << 2*PSZ | \
- ((p)&PMSK) << 3*PSZ | \
- ((p)&PMSK) << 4*PSZ | \
- ((p)&PMSK) << 5*PSZ | \
- ((p)&PMSK) << 6*PSZ | \
- ((p)&PMSK) << 7*PSZ | \
- ((p)&PMSK) << 8*PSZ | \
- ((p)&PMSK) << 9*PSZ | \
- ((p)&PMSK) << 10*PSZ | \
- ((p)&PMSK) << 11*PSZ | \
- ((p)&PMSK) << 12*PSZ | \
- ((p)&PMSK) << 13*PSZ | \
- ((p)&PMSK) << 14*PSZ | \
- ((p)&PMSK) << 15*PSZ )
-#define PFILL2(p, pf) { \
- pf = (p) & PMSK; \
- pf |= (pf << PSZ); \
- pf |= (pf << 2*PSZ); \
- pf |= (pf << 4*PSZ); \
- pf |= (pf << 8*PSZ); \
-}
-#endif /* PPW == 16 */
-#if PPW == 8
-#define PFILL(p) ( ((p)&PMSK) | \
- ((p)&PMSK) << PSZ | \
- ((p)&PMSK) << 2*PSZ | \
- ((p)&PMSK) << 3*PSZ | \
- ((p)&PMSK) << 4*PSZ | \
- ((p)&PMSK) << 5*PSZ | \
- ((p)&PMSK) << 6*PSZ | \
- ((p)&PMSK) << 7*PSZ )
-#define PFILL2(p, pf) { \
- pf = (p) & PMSK; \
- pf |= (pf << PSZ); \
- pf |= (pf << 2*PSZ); \
- pf |= (pf << 4*PSZ); \
-}
-#endif
-#if PPW == 4
-#define PFILL(p) ( ((p)&PMSK) | \
- ((p)&PMSK) << PSZ | \
- ((p)&PMSK) << 2*PSZ | \
- ((p)&PMSK) << 3*PSZ )
-#define PFILL2(p, pf) { \
- pf = (p) & PMSK; \
- pf |= (pf << PSZ); \
- pf |= (pf << 2*PSZ); \
-}
-#endif
-#if PPW == 2
-#define PFILL(p) ( ((p)&PMSK) | \
- ((p)&PMSK) << PSZ )
-#define PFILL2(p, pf) { \
- pf = (p) & PMSK; \
- pf |= (pf << PSZ); \
-}
-#endif
-#if PPW == 1
-#define PFILL(p) (p)
-#define PFILL2(p,pf) (pf = (p))
-#endif
-
-/*
- * Reduced raster op - using precomputed values, perform the above
- * in three instructions
- */
-
-#define DoRRop(dst, and, xor) (((dst) & (and)) ^ (xor))
-
-#define DoMaskRRop(dst, and, xor, mask) \
- (((dst) & ((and) | ~(mask))) ^ (xor & mask))
-
-#if PSZ != 32 || PPW != 1
-
-# if (PSZ == 24 && PPW == 1)
-#define maskbits(x, w, startmask, endmask, nlw) {\
- startmask = cfbstarttab[(x)&3]; \
- endmask = cfbendtab[((x)+(w)) & 3]; \
- nlw = ((((x)+(w))*3)>>2) - (((x)*3 +3)>>2); \
-}
-
-#define mask32bits(x, w, startmask, endmask) \
- startmask = cfbstarttab[(x)&3]; \
- endmask = cfbendtab[((x)+(w)) & 3];
-
-#define maskpartialbits(x, w, mask) \
- mask = cfbstartpartial[(x) & 3] & cfbendpartial[((x)+(w)) & 3];
-
-#define maskbits24(x, w, startmask, endmask, nlw) \
- startmask = cfbstarttab24[(x) & 3]; \
- endmask = cfbendtab24[((x)+(w)) & 3]; \
- if (startmask){ \
- nlw = (((w) - (4 - ((x) & 3))) >> 2); \
- } else { \
- nlw = (w) >> 2; \
- }
-
-#define getbits24(psrc, dst, index) {\
- register int idx; \
- switch(idx = ((index)&3)<<1){ \
- case 0: \
- dst = (*(psrc) &cfbmask[idx]); \
- break; \
- case 6: \
- dst = BitLeft((*(psrc) &cfbmask[idx]), cfb24Shift[idx]); \
- break; \
- default: \
- dst = BitLeft((*(psrc) &cfbmask[idx]), cfb24Shift[idx]) | \
- BitRight(((*((psrc)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \
- }; \
-}
-
-#define putbits24(src, w, pdst, planemask, index) {\
- register PixelGroup dstpixel; \
- register unsigned int idx; \
- switch(idx = ((index)&3)<<1){ \
- case 0: \
- dstpixel = (*(pdst) &cfbmask[idx]); \
- break; \
- case 6: \
- dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx]); \
- break; \
- default: \
- dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx])| \
- BitRight(((*((pdst)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \
- }; \
- dstpixel &= ~(planemask); \
- dstpixel |= (src & planemask); \
- *(pdst) &= cfbrmask[idx]; \
- switch(idx){ \
- case 0: \
- *(pdst) |= (dstpixel & cfbmask[idx]); \
- break; \
- case 2: \
- case 4: \
- pdst++;idx++; \
- *(pdst) = ((*(pdst)) & cfbrmask[idx]) | \
- (BitLeft(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \
- pdst--;idx--; \
- case 6: \
- *(pdst) |= (BitRight(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \
- break; \
- }; \
-}
-
-#define putbitsrop24(src, x, pdst, planemask, rop) \
-{ \
- register PixelGroup t1, dstpixel; \
- register unsigned int idx; \
- switch(idx = (x)<<1){ \
- case 0: \
- dstpixel = (*(pdst) &cfbmask[idx]); \
- break; \
- case 6: \
- dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx]); \
- break; \
- default: \
- dstpixel = BitLeft((*(pdst) &cfbmask[idx]), cfb24Shift[idx])| \
- BitRight(((*((pdst)+1)) &cfbmask[idx+1]), cfb24Shift[idx+1]); \
- }; \
- DoRop(t1, rop, (src), dstpixel); \
- dstpixel &= ~planemask; \
- dstpixel |= (t1 & planemask); \
- *(pdst) &= cfbrmask[idx]; \
- switch(idx){ \
- case 0: \
- *(pdst) |= (dstpixel & cfbmask[idx]); \
- break; \
- case 2: \
- case 4: \
- *((pdst)+1) = ((*((pdst)+1)) & cfbrmask[idx+1]) | \
- (BitLeft(dstpixel, cfb24Shift[idx+1]) & (cfbmask[idx+1])); \
- case 6: \
- *(pdst) |= (BitRight(dstpixel, cfb24Shift[idx]) & cfbmask[idx]); \
- }; \
-}
-# else /* PSZ == 24 && PPW == 1 */
-#define maskbits(x, w, startmask, endmask, nlw) \
- startmask = cfbstarttab[(x)&PIM]; \
- endmask = cfbendtab[((x)+(w)) & PIM]; \
- if (startmask) \
- nlw = (((w) - (PPW - ((x)&PIM))) >> PWSH); \
- else \
- nlw = (w) >> PWSH;
-
-#define maskpartialbits(x, w, mask) \
- mask = cfbstartpartial[(x) & PIM] & cfbendpartial[((x) + (w)) & PIM];
-
-#define mask32bits(x, w, startmask, endmask) \
- startmask = cfbstarttab[(x)&PIM]; \
- endmask = cfbendtab[((x)+(w)) & PIM];
-
-/* FIXME */
-#define maskbits24(x, w, startmask, endmask, nlw) \
- abort()
-#define getbits24(psrc, dst, index) \
- abort()
-#define putbits24(src, w, pdst, planemask, index) \
- abort()
-#define putbitsrop24(src, x, pdst, planemask, rop) \
- abort()
-
-#endif /* PSZ == 24 && PPW == 1 */
-
-#define getbits(psrc, x, w, dst) \
-if ( ((x) + (w)) <= PPW) \
-{ \
- dst = SCRLEFT(*(psrc), (x)); \
-} \
-else \
-{ \
- int m; \
- m = PPW-(x); \
- dst = (SCRLEFT(*(psrc), (x)) & cfbendtab[m]) | \
- (SCRRIGHT(*((psrc)+1), m) & cfbstarttab[m]); \
-}
-
-
-#define putbits(src, x, w, pdst, planemask) \
-if ( ((x)+(w)) <= PPW) \
-{ \
- PixelGroup tmpmask; \
- maskpartialbits((x), (w), tmpmask); \
- tmpmask &= PFILL(planemask); \
- *(pdst) = (*(pdst) & ~tmpmask) | (SCRRIGHT(src, x) & tmpmask); \
-} \
-else \
-{ \
- unsigned int m; \
- unsigned int n; \
- PixelGroup pm = PFILL(planemask); \
- m = PPW-(x); \
- n = (w) - m; \
- *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | \
- (SCRRIGHT(src, x) & (cfbstarttab[x] & pm)); \
- *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
- (SCRLEFT(src, m) & (cfbendtab[n] & pm)); \
-}
-#if defined(__GNUC__) && defined(mc68020)
-#undef getbits
-#define FASTGETBITS(psrc, x, w, dst) \
- asm ("bfextu %3{%1:%2},%0" \
- : "=d" (dst) : "di" (x), "di" (w), "o" (*(char *)(psrc)))
-
-#define getbits(psrc,x,w,dst) \
-{ \
- FASTGETBITS(psrc, (x) * PSZ, (w) * PSZ, dst); \
- dst = SCRLEFT(dst,PPW-(w)); \
-}
-
-#define FASTPUTBITS(src, x, w, pdst) \
- asm ("bfins %3,%0{%1:%2}" \
- : "=o" (*(char *)(pdst)) \
- : "di" (x), "di" (w), "d" (src), "0" (*(char *) (pdst)))
-
-#undef putbits
-#define putbits(src, x, w, pdst, planemask) \
-{ \
- if (planemask != PMSK) { \
- PixelGroup _m, _pm; \
- FASTGETBITS(pdst, (x) * PSZ , (w) * PSZ, _m); \
- PFILL2(planemask, _pm); \
- _m &= (~_pm); \
- _m |= (SCRRIGHT(src, PPW-(w)) & _pm); \
- FASTPUTBITS(_m, (x) * PSZ, (w) * PSZ, pdst); \
- } else { \
- FASTPUTBITS(SCRRIGHT(src, PPW-(w)), (x) * PSZ, (w) * PSZ, pdst); \
- } \
-}
-
-
-#endif /* mc68020 */
-
-#define putbitsrop(src, x, w, pdst, planemask, rop) \
-if ( ((x)+(w)) <= PPW) \
-{ \
- PixelGroup tmpmask; \
- PixelGroup t1, t2; \
- maskpartialbits((x), (w), tmpmask); \
- PFILL2(planemask, t1); \
- tmpmask &= t1; \
- t1 = SCRRIGHT((src), (x)); \
- DoRop(t2, rop, t1, *(pdst)); \
- *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
-} \
-else \
-{ \
- CfbBits m; \
- CfbBits n; \
- PixelGroup t1, t2; \
- PixelGroup pm; \
- PFILL2(planemask, pm); \
- m = PPW-(x); \
- n = (w) - m; \
- t1 = SCRRIGHT((src), (x)); \
- DoRop(t2, rop, t1, *(pdst)); \
- *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | (t2 & (cfbstarttab[x] & pm));\
- t1 = SCRLEFT((src), m); \
- DoRop(t2, rop, t1, *((pdst) + 1)); \
- *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
- (t2 & (cfbendtab[n] & pm)); \
-}
-
-#else /* PSZ == 32 && PPW == 1*/
-
-/*
- * These macros can be optimized for 32-bit pixels since there is no
- * need to worry about left/right edge masking. These macros were
- * derived from the above using the following reductions:
- *
- * - x & PIW = 0 [since PIW = 0]
- * - all masking tables are only indexed by 0 [ due to above ]
- * - cfbstartab[0] and cfbendtab[0] = 0 [ no left/right edge masks]
- * - cfbstartpartial[0] and cfbendpartial[0] = ~0 [no partial pixel mask]
- *
- * Macro reduction based upon constants cannot be performed automatically
- * by the compiler since it does not know the contents of the masking
- * arrays in cfbmskbits.c.
- */
-#define maskbits(x, w, startmask, endmask, nlw) \
- startmask = endmask = 0; \
- nlw = (w);
-
-#define maskpartialbits(x, w, mask) \
- mask = 0xFFFFFFFF;
-
-#define mask32bits(x, w, startmask, endmask) \
- startmask = endmask = 0;
-
-/*
- * For 32-bit operations, getbits(), putbits(), and putbitsrop()
- * will only be invoked with x = 0 and w = PPW (1). The getbits()
- * macro is only called within left/right edge logic, which doesn't
- * happen for 32-bit pixels.
- */
-#define getbits(psrc, x, w, dst) (dst) = *(psrc)
-
-#define putbits(src, x, w, pdst, planemask) \
- *(pdst) = (*(pdst) & ~planemask) | (src & planemask);
-
-#define putbitsrop(src, x, w, pdst, planemask, rop) \
-{ \
- PixelGroup t1; \
- DoRop(t1, rop, (src), *(pdst)); \
- *(pdst) = (*(pdst) & ~planemask) | (t1 & planemask); \
-}
-
-#endif /* PSZ != 32 */
-
-/*
- * Use these macros only when you're using the MergeRop stuff
- * in ../mfb/mergerop.h
- */
-
-/* useful only when not spanning destination longwords */
-#if PSZ == 24
-#define putbitsmropshort24(src,x,w,pdst,index) {\
- PixelGroup _tmpmask; \
- PixelGroup _t1; \
- maskpartialbits ((x), (w), _tmpmask); \
- _t1 = SCRRIGHT((src), (x)); \
- DoMaskMergeRop24(_t1, pdst, _tmpmask, index); \
-}
-#endif
-#define putbitsmropshort(src,x,w,pdst) {\
- PixelGroup _tmpmask; \
- PixelGroup _t1; \
- maskpartialbits ((x), (w), _tmpmask); \
- _t1 = SCRRIGHT((src), (x)); \
- *pdst = DoMaskMergeRop(_t1, *pdst, _tmpmask); \
-}
-
-/* useful only when spanning destination longwords */
-#define putbitsmroplong(src,x,w,pdst) { \
- PixelGroup _startmask, _endmask; \
- int _m; \
- PixelGroup _t1; \
- _m = PPW - (x); \
- _startmask = cfbstarttab[x]; \
- _endmask = cfbendtab[(w) - _m]; \
- _t1 = SCRRIGHT((src), (x)); \
- pdst[0] = DoMaskMergeRop(_t1,pdst[0],_startmask); \
- _t1 = SCRLEFT ((src),_m); \
- pdst[1] = DoMaskMergeRop(_t1,pdst[1],_endmask); \
-}
-
-#define putbitsmrop(src,x,w,pdst) \
-if ((x) + (w) <= PPW) {\
- putbitsmropshort(src,x,w,pdst); \
-} else { \
- putbitsmroplong(src,x,w,pdst); \
-}
-
-#if GETLEFTBITS_ALIGNMENT == 1
-#define getleftbits(psrc, w, dst) dst = *((unsigned int *) psrc)
-#define getleftbits24(psrc, w, dst, idx){ \
- regiseter int index; \
- switch(index = ((idx)&3)<<1){ \
- case 0: \
- dst = (*((unsigned int *) psrc))&cfbmask[index]; \
- break; \
- case 2: \
- case 4: \
- dst = BitLeft(((*((unsigned int *) psrc))&cfbmask[index]), cfb24Shift[index]); \
- dst |= BitRight(((*((unsigned int *) psrc)+1)&cfbmask[index]), cfb4Shift[index]); \
- break; \
- case 6: \
- dst = BitLeft((*((unsigned int *) psrc)),cfb24Shift[index]); \
- break; \
- }; \
-}
-#endif /* GETLEFTBITS_ALIGNMENT == 1 */
-
-#define getglyphbits(psrc, x, w, dst) \
-{ \
- dst = BitLeft((unsigned) *(psrc), (x)); \
- if ( ((x) + (w)) > 32) \
- dst |= (BitRight((unsigned) *((psrc)+1), 32-(x))); \
-}
-#if GETLEFTBITS_ALIGNMENT == 2
-#define getleftbits(psrc, w, dst) \
- { \
- if ( ((int)(psrc)) & 0x01 ) \
- getglyphbits( ((unsigned int *)(((char *)(psrc))-1)), 8, (w), (dst) ); \
- else \
- dst = *((unsigned int *) psrc); \
- }
-#endif /* GETLEFTBITS_ALIGNMENT == 2 */
-
-#if GETLEFTBITS_ALIGNMENT == 4
-#define getleftbits(psrc, w, dst) \
- { \
- int off, off_b; \
- off_b = (off = ( ((int)(psrc)) & 0x03)) << 3; \
- getglyphbits( \
- (unsigned int *)( ((char *)(psrc)) - off), \
- (off_b), (w), (dst) \
- ); \
- }
-#endif /* GETLEFTBITS_ALIGNMENT == 4 */
-
-/*
- * getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix )
- *
- * Converts bits to pixels in a reasonable way. Takes w (1 <= w <= PPW)
- * bits from *psrcstip, starting at bit x; call this a quartet of bits.
- * Then, takes the pixels from *psrcpix corresponding to the one-bits (if
- * ones is TRUE) or the zero-bits (if ones is FALSE) of the quartet
- * and puts these pixels into destpix.
- *
- * Example:
- *
- * getstipplepixels( &(0x08192A3B), 17, 4, 1, &(0x4C5D6E7F), dest )
- *
- * 0x08192A3B = 0000 1000 0001 1001 0010 1010 0011 1011
- *
- * This will take 4 bits starting at bit 17, so the quartet is 0x5 = 0101.
- * It will take pixels from 0x4C5D6E7F corresponding to the one-bits in this
- * quartet, so dest = 0x005D007F.
- *
- * XXX Works with both byte order.
- * XXX This works for all values of x and w within a doubleword.
- */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \
-{ \
- PixelGroup q; \
- int m; \
- if ((m = ((x) - ((PPW*PSZ)-PPW))) > 0) { \
- q = (*(psrcstip)) << m; \
- if ( (x)+(w) > (PPW*PSZ) ) \
- q |= *((psrcstip)+1) >> ((PPW*PSZ)-m); \
- } \
- else \
- q = (*(psrcstip)) >> -m; \
- q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
- *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
-}
-/* I just copied this to get the linker satisfied on PowerPC,
- * so this may not be correct at all.
- */
-#define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \
-{ \
- PixelGroup q; \
- q = *(psrcstip) >> (xt); \
- q = ((ones) ? q : ~q) & 1; \
- *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
-}
-#else /* BITMAP_BIT_ORDER == LSB */
-
-/* this must load 32 bits worth; for most machines, thats an int */
-#define CfbFetchUnaligned(x) ldl_u(x)
-
-#define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \
-{ \
- PixelGroup q; \
- q = CfbFetchUnaligned(psrcstip) >> (xt); \
- if ( ((xt)+(w)) > (PPW*PSZ) ) \
- q |= (CfbFetchUnaligned((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \
- q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
- *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
-}
-#if PSZ == 24
-# if 0
-#define getstipplepixels24(psrcstip,xt,w,ones,psrcpix,destpix,stipindex,srcindex,dstindex) \
-{ \
- PixelGroup q; \
- CfbBits src; \
- register unsigned int sidx; \
- register unsigned int didx; \
- sidx = ((srcindex) & 3)<<1; \
- didx = ((dstindex) & 3)<<1; \
- q = *(psrcstip) >> (xt); \
-/* if((srcindex)!=0)*/ \
-/* src = (((*(psrcpix)) << cfb24Shift[sidx]) & (cfbmask[sidx])) |*/ \
-/* (((*((psrcpix)+1)) << cfb24Shift[sidx+1]) & (cfbmask[sidx+1])); */\
-/* else */\
- src = (*(psrcpix))&0xFFFFFF; \
- if ( ((xt)+(w)) > PGSZ ) \
- q |= (*((psrcstip)+1)) << (PGSZ -(xt)); \
- q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
- src &= QuartetPixelMaskTable[q]; \
- *(destpix) &= cfbrmask[didx]; \
- switch(didx) {\
- case 0: \
- *(destpix) |= (src &cfbmask[didx]); \
- break; \
- case 2: \
- case 4: \
- destpix++;didx++; \
- *(destpix) = ((*(destpix)) & (cfbrmask[didx]))| \
- (BitLeft(src, cfb24Shift[didx]) & (cfbmask[didx])); \
- destpix--; didx--;\
- case 6: \
- *(destpix) |= (BitRight(src, cfb24Shift[didx]) & cfbmask[didx]); \
- break; \
- }; \
-}
-# else
-#define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \
-{ \
- PixelGroup q; \
- q = *(psrcstip) >> (xt); \
- q = ((ones) ? q : ~q) & 1; \
- *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
-}
-# endif
-#endif /* PSZ == 24 */
-#endif
-
-extern PixelGroup cfbstarttab[];
-extern PixelGroup cfbendtab[];
-extern PixelGroup cfbstartpartial[];
-extern PixelGroup cfbendpartial[];
-extern PixelGroup cfbrmask[];
-extern PixelGroup cfbmask[];
-extern PixelGroup QuartetBitsTable[];
-extern PixelGroup QuartetPixelMaskTable[];
-#if PSZ == 24
-extern int cfb24Shift[];
-#endif
diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c
deleted file mode 100644
index bd2e1b6f1..000000000
--- a/cfb/cfbpixmap.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/* $Xorg: cfbpixmap.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbpixmap.c,v 1.5 2001/12/14 19:59:23 dawes Exp $ */
-/* pixmap management
- written by drewry, september 1986
-
- on a monchrome device, a pixmap is a bitmap.
-*/
-
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "mi.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-extern CfbBits endtab[];
-
-PixmapPtr
-cfbCreatePixmap (pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
-
- paddedWidth = PixmapBytePad(width, depth);
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth);
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = datasize ?
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
- pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
- return pPixmap;
-}
-
-Bool
-cfbDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- if(--pPixmap->refcnt)
- return TRUE;
- xfree(pPixmap);
- return TRUE;
-}
-
-PixmapPtr
-cfbCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
- ScreenPtr pScreen;
-
- size = pSrc->drawable.height * pSrc->devKind;
- pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
- if (!pDst)
- return NullPixmap;
- memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
- return pDst;
-}
-
-
-/* replicates a pattern to be a full 32 bits wide.
- relies on the fact that each scnaline is longword padded.
- doesn't do anything if pixmap is not a factor of 32 wide.
- changes width field of pixmap if successful, so that the fast
- cfbXRotatePixmap code gets used if we rotate the pixmap later.
- cfbYRotatePixmap code gets used if we rotate the pixmap later.
-
- calculate number of times to repeat
- for each scanline of pattern
- zero out area to be filled with replicate
- left shift and or in original as many times as needed
-*/
-void
-cfbPadPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- register int width = (pPixmap->drawable.width) * (pPixmap->drawable.bitsPerPixel);
- register int h;
- register CfbBits mask;
- register CfbBits *p;
- register CfbBits bits; /* real pattern bits */
- register int i;
- int rep; /* repeat count for pattern */
-
- if (width >= PGSZ)
- return;
-
- rep = PGSZ/width;
- if (rep*width != PGSZ)
- return;
-
- mask = endtab[width];
-
- p = (CfbBits *)(pPixmap->devPrivate.ptr);
- for (h=0; h < pPixmap->drawable.height; h++)
- {
- *p &= mask;
- bits = *p;
- for(i=1; i<rep; i++)
- {
-#if (BITMAP_BIT_ORDER == MSBFirst)
- bits >>= width;
-#else
- bits <<= width;
-#endif
- *p |= bits;
- }
- p++;
- }
- pPixmap->drawable.width = PGSZ/(pPixmap->drawable.bitsPerPixel);
-}
-
-
-#ifdef notdef
-/*
- * cfb debugging routine -- assumes pixmap is 1 byte deep
- */
-static cfbdumppixmap(pPix)
- PixmapPtr pPix;
-{
- unsigned int *pw;
- char *psrc, *pdst;
- int i, j;
- char line[66];
-
- ErrorF( "pPixmap: 0x%x\n", pPix);
- ErrorF( "%d wide %d high\n", pPix->drawable.width, pPix->drawable.height);
- if (pPix->drawable.width > 64)
- {
- ErrorF( "too wide to see\n");
- return;
- }
-
- pw = (unsigned int *) pPix->devPrivate.ptr;
- psrc = (char *) pw;
-
-/*
- for ( i=0; i<pPix->drawable.height; ++i )
- ErrorF( "0x%x\n", pw[i] );
-*/
-
- for ( i = 0; i < pPix->drawable.height; ++i ) {
- pdst = line;
- for(j = 0; j < pPix->drawable.width; j++) {
- *pdst++ = *psrc++ ? 'X' : ' ' ;
- }
- *pdst++ = '\n';
- *pdst++ = '\0';
- ErrorF( "%s", line);
- }
-}
-#endif /* notdef */
-
-/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
- * words are PGSZ bits wide, and that the least significant bit appears on the
- * left.
- */
-void
-cfbXRotatePixmap(pPix, rw)
- PixmapPtr pPix;
- register int rw;
-{
- register CfbBits *pw, *pwFinal;
- register CfbBits t;
- int rot;
-
- if (pPix == NullPixmap)
- return;
-
- switch (((DrawablePtr) pPix)->bitsPerPixel) {
- case PSZ:
- break;
- case 1:
- mfbXRotatePixmap(pPix, rw);
- return;
- default:
- ErrorF("cfbXRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel);
- return;
- }
- pw = (CfbBits *)pPix->devPrivate.ptr;
- modulus (rw, (int) pPix->drawable.width, rot);
- if(pPix->drawable.width == PPW)
- {
- pwFinal = pw + pPix->drawable.height;
- while(pw < pwFinal)
- {
- t = *pw;
- *pw++ = SCRRIGHT(t, rot) |
- (SCRLEFT(t, (PPW-rot)) & cfbendtab[rot]);
- }
- }
- else
- {
- ErrorF("cfb internal error: trying to rotate odd-sized pixmap.\n");
-#ifdef notdef
- register CfbBits *pwTmp;
- int size, tsize;
-
- tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth);
- pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize);
- if (!pwTmp)
- return;
- /* divide pw (the pixmap) in two vertically at (w - rot) and swap */
- tsize >>= 2;
- size = pPix->devKind >> SIZE0F(PixelGroup);
- cfbQuickBlt((CfbBits *)pw, (CfbBits *)pwTmp,
- 0, 0, 0, 0,
- (int)pPix->drawable.width - rot, (int)pPix->drawable.height,
- size, tsize);
- cfbQuickBlt((CfbBits *)pw, (CfbBits *)pw,
- (int)pPix->drawable.width - rot, 0, 0, 0,
- rot, (int)pPix->drawable.height,
- size, size);
- cfbQuickBlt((CfbBits *)pwTmp, (CfbBits *)pw,
- 0, 0, rot, 0,
- (int)pPix->drawable.width - rot, (int)pPix->drawable.height,
- tsize, size);
- DEALLOCATE_LOCAL(pwTmp);
-#endif
- }
-}
-
-/* Rotates pixmap pPix by h lines. Assumes that h is always less than
- pPix->drawable.height
- works on any width.
- */
-void
-cfbYRotatePixmap(pPix, rh)
- register PixmapPtr pPix;
- int rh;
-{
- int nbyDown; /* bytes to move down to row 0; also offset of
- row rh */
- int nbyUp; /* bytes to move up to line rh; also
- offset of first line moved down to 0 */
- char *pbase;
- char *ptmp;
- int rot;
-
- if (pPix == NullPixmap)
- return;
- switch (((DrawablePtr) pPix)->bitsPerPixel) {
- case PSZ:
- break;
- case 1:
- mfbYRotatePixmap(pPix, rh);
- return;
- default:
- ErrorF("cfbYRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel);
- return;
- }
-
- modulus (rh, (int) pPix->drawable.height, rot);
- pbase = (char *)pPix->devPrivate.ptr;
-
- nbyDown = rot * pPix->devKind;
- nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown;
- if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
- return;
-
- memmove(ptmp, pbase, nbyUp); /* save the low rows */
- memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
- memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */
- DEALLOCATE_LOCAL(ptmp);
-}
-
-void
-cfbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
- register PixmapPtr psrcPix, *ppdstPix;
- int xrot, yrot;
-{
- register PixmapPtr pdstPix;
-
- if ((pdstPix = *ppdstPix) &&
- (pdstPix->devKind == psrcPix->devKind) &&
- (pdstPix->drawable.height == psrcPix->drawable.height))
- {
- memmove((char *)pdstPix->devPrivate.ptr,
- (char *)psrcPix->devPrivate.ptr,
- psrcPix->drawable.height * psrcPix->devKind);
- pdstPix->drawable.width = psrcPix->drawable.width;
- pdstPix->drawable.depth = psrcPix->drawable.depth;
- pdstPix->drawable.bitsPerPixel = psrcPix->drawable.bitsPerPixel;
- pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- else
- {
- if (pdstPix)
- /* FIX XBUG 6168 */
- (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
- *ppdstPix = pdstPix = cfbCopyPixmap(psrcPix);
- if (!pdstPix)
- return;
- }
- cfbPadPixmap(pdstPix);
- if (xrot)
- cfbXRotatePixmap(pdstPix, xrot);
- if (yrot)
- cfbYRotatePixmap(pdstPix, yrot);
-}
diff --git a/cfb/cfbply1rct.c b/cfb/cfbply1rct.c
deleted file mode 100644
index 0b14bc614..000000000
--- a/cfb/cfbply1rct.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * $Xorg: cfbply1rct.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.11 2003/10/30 14:53:39 tsi Exp $ */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfbrrop.h"
-
-void
-RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int shape;
- int mode;
- int count;
- DDXPointPtr ptsIn;
-{
- cfbPrivGCPtr devPriv;
- int nwidth;
- CfbBits *addrl, *addr;
-#if PSZ == 24
- CfbBits startmask, endmask;
- register int pidx;
-#else
-#if PPW > 1
- CfbBits mask, bits = ~((CfbBits)0);
-#endif
-#endif
- int maxy;
- int origin;
- register int vertex1, vertex2;
- int c = 0;
- BoxPtr extents;
- int clip;
- int y;
- int *vertex1p = NULL, *vertex2p;
- int *endp;
- int x1 = 0, x2 = 0;
- int dx1 = 0, dx2 = 0;
- int dy1 = 0, dy2 = 0;
- int e1 = 0, e2 = 0;
- int step1 = 0, step2 = 0;
- int sign1 = 0, sign2 = 0;
- int h;
- int l;
-#if PSZ != 24 && PPW > 1
- int r;
-#endif
- int nmiddle;
- RROP_DECLARE
-
- if (mode == CoordModePrevious)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- devPriv = cfbGetGCPrivate(pGC);
-#ifdef NO_ONE_RECT
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
-#endif
- origin = *((int *) &pDrawable->x);
- vertex2 = origin - ((origin & 0x8000) << 1);
- extents = &pGC->pCompositeClip->extents;
- RROP_FETCH_GCPRIV(devPriv);
- vertex1 = *((int *) &extents->x1) - vertex2;
- vertex2 = *((int *) &extents->x2) - vertex2 - 0x00010001;
- clip = 0;
- y = 32767;
- maxy = 0;
- vertex2p = (int *) ptsIn;
- endp = vertex2p + count;
- if (shape == Convex)
- {
- while (count--)
- {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y)
- {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- }
- }
- else
- {
- int yFlip = 0;
- dx1 = 1;
- x2 = -1;
- x1 = -1;
- while (count--)
- {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y)
- {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- if (c == x1)
- continue;
- if (dx1 > 0)
- {
- if (x2 < 0)
- x2 = c;
- else
- dx2 = dx1 = (c - x1) >> 31;
- }
- else
- if ((c - x1) >> 31 != dx1)
- {
- dx1 = ~dx1;
- yFlip++;
- }
- x1 = c;
- }
- x1 = (x2 - c) >> 31;
- if (x1 != dx1)
- yFlip++;
- if (x1 != dx2)
- yFlip++;
- if (yFlip != 2)
- clip = 0x8000;
- }
- if (y == maxy)
- return;
-
- if (clip & 0x80008000)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
- return;
- }
-
-#define AddrYPlus(a,y) (CfbBits *) (((unsigned char *) (a)) + (y) * nwidth)
-
- cfbGetTypedWidthAndPointer(pDrawable, nwidth, addrl, unsigned char, CfbBits);
- addrl = AddrYPlus(addrl,y + pDrawable->y);
- origin = intToX(origin);
- vertex2p = vertex1p;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
- x = intToX(vertex); \
- if ((dy = intToY(c) - y)) { \
- dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) \
- { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx = dx % dy; \
- } \
- } \
- else \
- { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx = dx % dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) \
- { \
- x += sign; \
- e -= dy; \
- } \
-}
- for (;;)
- {
- if (y == intToY(vertex1))
- {
- do
- {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
- } while (y >= intToY(vertex1));
- h = dy1;
- }
- else
- {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2))
- {
- do
- {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- }
- else
- {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
- /* fill spans for this segment */
- y += h;
- for (;;)
- {
- l = x1;
-#if PSZ != 24 && PPW > 1
- r = x2;
-#endif
- nmiddle = x2 - x1;
- if (nmiddle < 0)
- {
- nmiddle = -nmiddle;
- l = x2;
-#if PSZ != 24 && PPW > 1
- r = x1;
-#endif
- }
-#if PPW > 1
- c = l & PIM;
- l -= c;
-#endif
-
-#if PGSZ == 32
-#define LWRD_SHIFT 2
-#else /* PGSZ == 64 */
-#define LWRD_SHIFT 3
-#endif /* PGSZ */
-
-#if PSZ == 24
- addr = (CfbBits *)((char *)addrl + ((l * 3) & ~0x03));
- if (nmiddle <= 1){
- if (nmiddle)
- RROP_SOLID24(addr, l);
- } else {
- maskbits(l, nmiddle, startmask, endmask, nmiddle);
- pidx = l & 3;
- if (startmask){
- RROP_SOLID_MASK(addr, startmask, pidx-1);
- addr++;
- if (pidx == 3)
- pidx = 0;
- }
- while (--nmiddle >= 0){
- RROP_SOLID(addr, pidx);
- addr++;
- if (++pidx == 3)
- pidx = 0;
- }
- if (endmask)
- RROP_SOLID_MASK(addr, endmask, pidx);
- }
-#else /* PSZ == 24 */
-#if PWSH > LWRD_SHIFT
- l = l >> (PWSH - LWRD_SHIFT);
-#endif
-#if PWSH < LWRD_SHIFT
- l = l << (LWRD_SHIFT - PWSH);
-#endif
- addr = (CfbBits *) (((char *) addrl) + l);
-#if PPW > 1
- if (c + nmiddle < PPW)
- {
- mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle);
- RROP_SOLID_MASK(addr,mask);
- }
- else
- {
- if (c)
- {
- mask = SCRRIGHT(bits, c);
- RROP_SOLID_MASK(addr,mask);
- nmiddle += c - PPW;
- addr++;
- }
-#endif
- nmiddle >>= PWSH;
- while (--nmiddle >= 0) {
- RROP_SOLID(addr); addr++;
- }
-#if PPW > 1
- if ((mask = ~SCRRIGHT(bits, r & PIM)))
- RROP_SOLID_MASK(addr,mask);
- }
-#endif
-#endif /* PSZ == 24 */
- if (!--h)
- break;
- addrl = AddrYPlus (addrl, 1);
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if (y == maxy)
- break;
- addrl = AddrYPlus (addrl, 1);
- }
- RROP_UNDECLARE
-}
diff --git a/cfb/cfbpntwin.c b/cfb/cfbpntwin.c
deleted file mode 100644
index c77d01961..000000000
--- a/cfb/cfbpntwin.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/* $Xorg: cfbpntwin.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "mi.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-void
-cfbPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- register cfbPrivWin *pPrivWin;
- WindowPtr pBgWin;
-
- pPrivWin = cfbGetWindowPrivate(pWin);
-
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground)
- {
- cfbFillBoxTile32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pPrivWin->pRotatedBackground);
- }
- else
- {
- int xorg = pWin->drawable.x;
- int yorg = pWin->drawable.y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pWin->drawable.pScreen->myNum;
- if(WindowTable[index] == pWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- cfbFillBoxTileOdd ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixmap,
- xorg, yorg);
- }
- break;
- case BackgroundPixel:
- cfbFillBoxSolid ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- cfbFillBoxSolid ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- }
- else if (pPrivWin->fastBorder)
- {
- cfbFillBoxTile32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pPrivWin->pRotatedBorder);
- }
- else
- {
- int xorg, yorg;
-
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- xorg = pBgWin->drawable.x;
- yorg = pBgWin->drawable.y;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pWin->drawable.pScreen->myNum;
- if(WindowTable[index] == pBgWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
-
- cfbFillBoxTileOdd ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixmap,
- xorg, yorg);
- }
- break;
- }
-}
-
-/*
- * Use the RROP macros in copy mode
- */
-
-#define RROP GXcopy
-#include "cfbrrop.h"
-
-#ifdef RROP_UNROLL
-# define Expand(left,right,leftAdjust) {\
- int part = nmiddle & RROP_UNROLL_MASK; \
- int widthStep; \
- widthStep = widthDst - nmiddle - leftAdjust; \
- nmiddle >>= RROP_UNROLL_SHIFT; \
- while (h--) { \
- left \
- pdst += part; \
- switch (part) { \
- RROP_UNROLL_CASE(pdst) \
- } \
- m = nmiddle; \
- while (m) { \
- pdst += RROP_UNROLL; \
- RROP_UNROLL_LOOP(pdst) \
- m--; \
- } \
- right \
- pdst += widthStep; \
- } \
-}
-
-#else
-# define Expand(left, right, leftAdjust) { \
- int widthStep; \
- widthStep = widthDst - nmiddle - leftAdjust; \
- while (h--) { \
- left \
- m = nmiddle; \
- while (m--) {\
- RROP_SOLID(pdst); \
- pdst++; \
- } \
- right \
- pdst += widthStep; \
- } \
-}
-#endif
-
-void
-cfbFillBoxSolid (pDrawable, nBox, pBox, pixel)
- DrawablePtr pDrawable;
- int nBox;
- BoxPtr pBox;
- unsigned long pixel;
-{
- CfbBits *pdstBase;
- int widthDst;
- register int h;
- register CfbBits *pdst;
- int nmiddle;
- int w;
-#if PSZ == 24
- int leftIndex, rightIndex;
- CfbBits piQxelArray[3], *pdstULC; /*upper left corner*/
-
- piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24);
- piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16);
- piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16);
-#else
- register CfbBits rrop_xor;
- register CfbBits leftMask, rightMask;
- register int m;
-#endif
-
- cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase);
-
-#if PSZ != 24
- rrop_xor = PFILL(pixel);
-#endif
- for (; nBox; nBox--, pBox++)
- {
- pdst = pdstBase + pBox->y1 * widthDst;
- h = pBox->y2 - pBox->y1;
- w = pBox->x2 - pBox->x1;
-#if PSZ == 8
- if (w == 1)
- {
- register char *pdstb = ((char *) pdst) + pBox->x1;
- int incr = widthDst * PGSZB;
-
- while (h--)
- {
- *pdstb = rrop_xor;
- pdstb += incr;
- }
- }
- else
- {
-#endif
-#if PSZ == 24
-/* _Box has x1, y1, x2, y2*/
- leftIndex = pBox->x1 & 3;
- rightIndex = ((leftIndex+w)<5)?0:(pBox->x2 &3);
- nmiddle = w - rightIndex;
- if(leftIndex){
- nmiddle -= (4 - leftIndex);
- }
- nmiddle >>= 2;
- if(nmiddle < 0)
- nmiddle = 0;
-
- pdst = pdstBase + pBox->y1 * widthDst + ((pBox->x1*3) >> 2);
-
- switch(leftIndex+w){
- case 4:
- switch(leftIndex){
- case 0:
- while(h--){
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = piQxelArray[2];
- pdst -=2;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst = piQxelArray[2];
- pdst -=2;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst-- = piQxelArray[2];
- pdst += widthDst;
- }
- break;
- case 3:
- while(h--){
- *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00);
- pdst += widthDst;
- }
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
- while(h--){
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst--;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst += widthDst;
- }
- break;
- }
- break;
- case 2:
- while(h--){
- if(leftIndex){
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- }
- else{
- *pdst++ = piQxelArray[0];
- }
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF);
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
- while(h--){
- *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF);
- pdst += widthDst;
- }
- break;
- case 0: /*never*/
- break;
- default:
- {
- w = nmiddle;
- pdstULC = pdst;
-/* maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);*/
- while(h--){
- nmiddle = w;
- pdst = pdstULC;
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst++ = piQxelArray[2];
- break;
- case 2:
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst++ = piQxelArray[2];
- break;
- case 3:
- *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00);
- pdst++;
- break;
- }
- while(nmiddle--){
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst++ = piQxelArray[2];
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
- *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF);
- break;
- case 2:
- *pdst++ = piQxelArray[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF);
- break;
- case 3:
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- break;
- }
- pdstULC += widthDst;
- }
-
- }
- }
-#else
- pdst += (pBox->x1 >> PWSH);
- if ((pBox->x1 & PIM) + w <= PPW)
- {
- maskpartialbits(pBox->x1, w, leftMask);
- while (h--) {
- *pdst = (*pdst & ~leftMask) | (rrop_xor & leftMask);
- pdst += widthDst;
- }
- }
- else
- {
- maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);
- if (leftMask)
- {
- if (rightMask)
- {
- Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++; ,
- RROP_SOLID_MASK (pdst, rightMask); ,
- 1)
- }
- else
- {
- Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++;,
- ;,
- 1)
- }
- }
- else
- {
- if (rightMask)
- {
- Expand (;,
- RROP_SOLID_MASK (pdst, rightMask);,
- 0)
- }
- else
- {
- Expand (;,
- ;,
- 0)
- }
- }
- }
-#endif
-#if PSZ == 8
- }
-#endif
- }
-}
-
-void
-cfbFillBoxTile32 (pDrawable, nBox, pBox, tile)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* rotated, expanded tile */
-{
- register CfbBits *pdst;
- CfbBits *psrc;
- int tileHeight;
-
- int widthDst;
- int w;
- int h;
- int nmiddle;
- int y;
- int srcy;
-
- CfbBits *pdstBase;
-#if PSZ == 24
- int leftIndex, rightIndex;
- CfbBits piQxelArray[3], *pdstULC;
-#else
- register CfbBits rrop_xor;
- register CfbBits leftMask;
- register CfbBits rightMask;
- register int m;
-#endif
-
- tileHeight = tile->drawable.height;
- psrc = (CfbBits *)tile->devPrivate.ptr;
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase);
-
- while (nBox--)
- {
-#if PSZ == 24
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
- leftIndex = pBox->x1 & 3;
-/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/
- rightIndex = pBox->x2 &3;
- nmiddle = w - rightIndex;
- if(leftIndex){
- nmiddle -= (4 - leftIndex);
- }
- nmiddle >>= 2;
- if(nmiddle < 0)
- nmiddle = 0;
-
- pdst = pdstBase + ((pBox->x1 *3)>> 2) + pBox->y1 * widthDst;
- srcy = y % tileHeight;
-
-#define StepTile piQxelArray[0] = (psrc[srcy] & 0xFFFFFF) | ((psrc[srcy] & 0xFF)<<24); \
- piQxelArray[1] = (psrc[srcy] & 0xFFFF00) | ((psrc[srcy] & 0xFFFF)<<16); \
- piQxelArray[2] = ((psrc[srcy] & 0xFF0000)>>16) | \
- ((psrc[srcy] & 0xFFFFFF)<<8); \
- /*rrop_xor = psrc[srcy];*/ \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0;
-
- switch(leftIndex+w){
- case 4:
- switch(leftIndex){
- case 0:
- while(h--){
- StepTile
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = piQxelArray[2];
- pdst-=2;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst = piQxelArray[2];
- pdst-=2;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst-- = piQxelArray[2];
- pdst += widthDst;
- }
- break;
- case 3:
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00);
- pdst += widthDst;
- }
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
- while(h--){
- StepTile
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst--;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- pdst--;
- pdst += widthDst;
- }
- break;
- }
- break;
- case 2:
- while(h--){
- StepTile
- if(leftIndex){
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- }
- else{
- *pdst++ = piQxelArray[0];
- }
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF);
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
- while(h--){
- StepTile
- *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF);
- pdst += widthDst;
- }
- break;
- case 0: /*never*/
- break;
- default:
- {
- w = nmiddle;
- pdstULC = pdst;
-
- while(h--){
- StepTile
- nmiddle = w;
- pdst = pdstULC;
- switch(leftIndex){
- case 0:
- break;
- case 1:
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelArray[1];
- *pdst++ = piQxelArray[2];
- break;
- case 2:
- *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000);
- pdst++;
- *pdst++ = piQxelArray[2];
- break;
- case 3:
- *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00);
- pdst++;
- break;
- }
- while(nmiddle--){
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst++ = piQxelArray[2];
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
- *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF);
- break;
- case 2:
- *pdst++ = piQxelArray[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF);
- break;
- case 3:
- *pdst++ = piQxelArray[0];
- *pdst++ = piQxelArray[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF);
- break;
- }
- pdstULC += widthDst;
- }
- }
- }
-#else
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
- pdst = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH);
- srcy = y % tileHeight;
-
-#define StepTile rrop_xor = psrc[srcy]; \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0;
-
- if ( ((pBox->x1 & PIM) + w) < PPW)
- {
- maskpartialbits(pBox->x1, w, leftMask);
- rightMask = ~leftMask;
- while (h--)
- {
- StepTile
- *pdst = (*pdst & rightMask) | (rrop_xor & leftMask);
- pdst += widthDst;
- }
- }
- else
- {
- maskbits(pBox->x1, w, leftMask, rightMask, nmiddle);
-
- if (leftMask)
- {
- if (rightMask)
- {
- Expand (StepTile
- RROP_SOLID_MASK(pdst, leftMask); pdst++;,
- RROP_SOLID_MASK(pdst, rightMask);,
- 1)
- }
- else
- {
- Expand (StepTile
- RROP_SOLID_MASK(pdst, leftMask); pdst++;,
- ;,
- 1)
- }
- }
- else
- {
- if (rightMask)
- {
- Expand (StepTile
- ,
- RROP_SOLID_MASK(pdst, rightMask);,
- 0)
- }
- else
- {
- Expand (StepTile
- ,
- ;,
- 0)
- }
- }
- }
-#endif
- pBox++;
- }
-}
diff --git a/cfb/cfbpolypnt.c b/cfb/cfbpolypnt.c
deleted file mode 100644
index d8b781397..000000000
--- a/cfb/cfbpolypnt.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbpolypnt.c,v 3.6 2001/12/14 19:59:24 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: cfbpolypnt.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-
-#include "X.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & ClipMask)
-
-/* WARNING: pbox contains two shorts. This code assumes they are packed
- * and can be referenced together as an INT32.
- */
-
-#define PointLoop(fill) { \
- for (nbox = REGION_NUM_RECTS(cclip), pbox = REGION_RECTS(cclip); \
- --nbox >= 0; \
- pbox++) \
- { \
- c1 = *((INT32 *) &pbox->x1) - off; \
- c2 = *((INT32 *) &pbox->x2) - off - 0x00010001; \
- for (ppt = (INT32 *) pptInit, i = npt; --i >= 0;) \
- { \
- pt = *ppt++; \
- if (!isClipped(pt,c1,c2)) { \
- fill \
- } \
- } \
- } \
-}
-
-#if PSZ == 24
-# include "cfbrrop24.h"
-#endif
-
-void
-cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- xPoint *pptInit;
-{
- register INT32 pt;
- register INT32 c1, c2;
- register CARD32 ClipMask = 0x80008000;
- register CfbBits xor;
-#ifdef PIXEL_ADDR
- register PixelType *addrp;
- register int npwidth;
-#if PSZ != 24
- PixelType *addrpt;
-#endif
-#else
- register CfbBits *addrl;
- register int nlwidth;
- register int xoffset;
- CfbBits *addrlt;
-#endif
-#if PSZ == 24
- RROP_DECLARE
- register int xtmp;
- register PixelType *p;
-#endif
- register INT32 *ppt;
- RegionPtr cclip;
- int nbox;
- register int i;
- register BoxPtr pbox;
- CfbBits and;
- int rop = pGC->alu;
- int off;
- cfbPrivGCPtr devPriv;
- xPoint *pptPrev;
-
- devPriv =cfbGetGCPrivate(pGC);
- rop = devPriv->rop;
- if (rop == GXnoop)
- return;
- cclip = pGC->pCompositeClip;
- xor = devPriv->xor;
- if ((mode == CoordModePrevious) && (npt > 1))
- {
- for (pptPrev = pptInit + 1, i = npt - 1; --i >= 0; pptPrev++)
- {
- pptPrev->x += (pptPrev-1)->x;
- pptPrev->y += (pptPrev-1)->y;
- }
- }
- off = *((int *) &pDrawable->x);
- off -= (off & 0x8000) << 1;
-#ifdef PIXEL_ADDR
- cfbGetPixelWidthAndPointer(pDrawable, npwidth, addrp);
-#if PSZ == 24
- addrp = addrp + pDrawable->y * npwidth;
-#else
- addrp = addrp + pDrawable->y * npwidth + pDrawable->x;
-#endif
- if (rop == GXcopy)
- {
-#if PSZ == 24
- RROP_COPY_SETUP(xor)
-#endif
- if (!(npwidth & (npwidth - 1)))
- {
- npwidth = ffs(npwidth) - 1;
-#if PSZ == 24
- PointLoop(
- xtmp = pDrawable->x + intToX(pt);
- p = addrp + (intToY(pt) << npwidth) + ((xtmp * 3) >>2);
- RROP_SOLID24_COPY(p, xtmp))
-#else
- PointLoop(*(addrp + (intToY(pt) << npwidth) + intToX(pt)) = xor;)
-#endif
- }
-#ifdef sun
- else if (npwidth == 1152)
- {
- register int y;
- PointLoop(y = intToY(pt); *(addrp + (y << 10) + (y << 7) + intToX(pt)) = xor;)
- }
-#endif
- else
- {
-#if PSZ == 24
- PointLoop(
- xtmp = pDrawable->x + intToX(pt);
- p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2);
- RROP_SOLID24_COPY(p, xtmp))
-#else
- PointLoop(*(addrp + intToY(pt) * npwidth + intToX(pt)) = xor;)
-#endif
- }
- }
- else
- {
- and = devPriv->and;
-#if PSZ == 24
- RROP_SET_SETUP(xor, and)
- PointLoop(
- xtmp = pDrawable->x + intToX(pt);
- p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2);
- RROP_SOLID24_SET(p, xtmp))
-#else
- PointLoop( addrpt = addrp + intToY(pt) * npwidth + intToX(pt);
- *addrpt = DoRRop (*addrpt, and, xor);)
-#endif
- }
-#else /* !PIXEL_ADDR */
- cfbGetLongWidthAndPointer(pDrawable, nlwidth, addrl);
- addrl = addrl + pDrawable->y * nlwidth + (pDrawable->x >> PWSH);
- xoffset = pDrawable->x & PIM;
- and = devPriv->and;
-#if PSZ == 24
- PointLoop( addrlt = addrl + intToY(pt) * nlwidth
- + ((intToX(pt) + xoffset) >> PWSH);
- *addrlt = DoRRop (*addrlt,
- and | ~cfbmask[(intToX(pt) + xoffset) & PIM],
- xor & cfbmask[(intToX(pt) + xoffset) & PIM]);
- )
-#else
- PointLoop( addrlt = addrl + intToY(pt) * nlwidth
- + ((intToX(pt) + xoffset) >> PWSH);
- *addrlt = DoRRop (*addrlt,
- and | ~cfbmask[((intToX(pt) + xoffset) & 3)<<1],
- xor & cfbmask[((intToX(pt) + xoffset) & 3)<<1]);
- )
-#endif
-#endif /* PIXEL_ADDR */
-}
diff --git a/cfb/cfbpush8.c b/cfb/cfbpush8.c
deleted file mode 100644
index 0de172f03..000000000
--- a/cfb/cfbpush8.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Push Pixels for 8 bit displays.
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbpush8.c,v 1.6 2001/12/14 19:59:24 dawes Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $Xorg: cfbpush8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-
-#if PSZ == 8
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-void
-cfbPushPixels8 (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitmap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- register CfbBits *src, *dst;
- register CfbBits pixel;
- register CfbBits c, bits;
- CfbBits *pdstLine, *psrcLine;
- CfbBits *pdstBase;
- int srcWidth;
- int dstWidth;
- int xoff;
- int nBitmapLongs, nPixmapLongs;
- int nBitmapTmp, nPixmapTmp;
- CfbBits rightMask;
- BoxRec bbox;
- cfbPrivGCPtr devPriv;
-
- bbox.x1 = xOrg;
- bbox.y1 = yOrg;
- bbox.x2 = bbox.x1 + dx;
- bbox.y2 = bbox.y1 + dy;
- devPriv = cfbGetGCPrivate(pGC);
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
- {
- case rgnPART:
-#ifndef LOWMEMFTPT
- mfbPushPixels(pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg);
-#else
- miPushPixels(pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg);
-#endif /* ifndef LOWMEMFTPT */
- case rgnOUT:
- return;
- }
-
- cfbGetLongWidthAndPointer (pDrawable, dstWidth, pdstBase)
-
- psrcLine = (CfbBits *) pBitmap->devPrivate.ptr;
- srcWidth = (int) pBitmap->devKind >> PWSH;
-
- pixel = devPriv->xor;
- xoff = xOrg & PIM;
- nBitmapLongs = (dx + xoff) >> MFB_PWSH;
- nPixmapLongs = (dx + PGSZB + xoff) >> PWSH;
-
- rightMask = ~cfb8BitLenMasks[((dx + xoff) & MFB_PIM)];
-
- pdstLine = pdstBase + (yOrg * dstWidth) + (xOrg >> PWSH);
-
- while (dy--)
- {
- c = 0;
- nPixmapTmp = nPixmapLongs;
- nBitmapTmp = nBitmapLongs;
- src = psrcLine;
- dst = pdstLine;
- while (nBitmapTmp--)
- {
- bits = *src++;
- c |= BitRight (bits, xoff);
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- nPixmapTmp -= 8;
- c = 0;
- if (xoff)
- c = BitLeft (bits, PGSZ - xoff);
- }
- if (BitLeft (rightMask, xoff))
- c |= BitRight (*src, xoff);
- c &= rightMask;
- switch (nPixmapTmp) {
- case 8:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 7:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 6:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 5:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 4:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 3:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 2:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 1:
- WriteBitGroup(dst, pixel, GetBitGroup(c));
- NextBitGroup(c);
- dst++;
- case 0:
- break;
- }
- pdstLine += dstWidth;
- psrcLine += srcWidth;
- }
-}
-
-#endif
diff --git a/cfb/cfbrctstp8.c b/cfb/cfbrctstp8.c
deleted file mode 100644
index 7f6e93919..000000000
--- a/cfb/cfbrctstp8.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Fill 32 bit stippled rectangles for 8 bit frame buffers
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbrctstp8.c,v 3.6 2001/12/14 19:59:24 dawes Exp $ */
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Keith Packard, MIT X Consortium
-
-*/
-
-/* $Xorg: cfbrctstp8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-
-#if PSZ == 8
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-void
-cfb8FillRectOpaqueStippled32 (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox; /* number of boxes to fill */
- register BoxPtr pBox; /* pointer to list of boxes to fill */
-{
- CfbBits *src;
- int stippleHeight;
-
- int nlwDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- register int h; /* height of current box */
- CfbBits startmask;
- CfbBits endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- register int nlw; /* loop version of nlwMiddle */
- CfbBits *dstLine;
- register CfbBits *dst; /* pointer to bits we're writing */
- CfbBits *dstTmp;
- int y; /* current scan line */
-
- CfbBits *pbits;/* pointer to start of pixmap */
- register CfbBits bits; /* bits from stipple */
- int rot;
- register CfbBits xor;
- PixmapPtr stipple;
- int wEnd;
-
- stipple = pGC->pRotatedPixmap;
-
- cfb8CheckOpaqueStipple(pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask);
-
- stippleHeight = stipple->drawable.height;
- src = (CfbBits *)stipple->devPrivate.ptr;
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
- dstLine = pbits + (pBox->y1 * nlwDst) + ((pBox->x1 & ~PIM) >> PWSH);
- if (((pBox->x1 & PIM) + w) <= PPW)
- {
- maskpartialbits(pBox->x1, w, startmask);
- nlwMiddle = 0;
- endmask = 0;
- }
- else
- {
- maskbits (pBox->x1, w, startmask, endmask, nlwMiddle);
- }
- rot = (pBox->x1 & ((PGSZ-1) & ~PIM));
- pBox++;
- y = y % stippleHeight;
-#if PPW == 4
- if (cfb8StippleRRop == GXcopy)
- {
- if (w < PGSZ*2)
- {
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot)
- RotBitsLeft(bits,rot);
- dst = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- *dst = (*dst & ~startmask) |
- (GetPixelGroup (bits) & startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- nlw = nlwMiddle;
- while (nlw--)
- {
- *dst++ = GetPixelGroup(bits);
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- *dst = (*dst & ~endmask) |
- (GetPixelGroup (bits) & endmask);
- }
- }
- }
- else
- {
- wEnd = 7 - (nlwMiddle & 7);
- nlwMiddle = (nlwMiddle >> 3) + 1;
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot != 0)
- RotBitsLeft (bits, rot);
- dstTmp = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- *dstTmp = (*dstTmp & ~startmask) |
- (GetPixelGroup (bits) & startmask);
- dstTmp++;
- RotBitsLeft (bits, PGSZB);
- }
- w = 7 - wEnd;
- while (w--)
- {
- nlw = nlwMiddle;
- dst = dstTmp;
- dstTmp++;
- xor = GetPixelGroup (bits);
- while (nlw--)
- {
- *dst = xor;
- dst += 8;
- }
- NextBitGroup (bits);
- }
- nlwMiddle--;
- w = wEnd + 1;
- if (endmask)
- {
- dst = dstTmp + (nlwMiddle << 3);
- *dst = (*dst & ~endmask) |
- (GetPixelGroup(bits) & endmask);
- }
- while (w--)
- {
- nlw = nlwMiddle;
- dst = dstTmp;
- dstTmp++;
- xor = GetPixelGroup (bits);
- while (nlw--)
- {
- *dst = xor;
- dst += 8;
- }
- NextBitGroup (bits);
- }
- nlwMiddle++;
- }
- }
- }
- else
-#endif /* PPW == 4 */
- {
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot)
- RotBitsLeft(bits,rot);
- dst = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- nlw = nlwMiddle;
- while (nlw--)
- {
- RRopBitGroup(dst, GetBitGroup(bits));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, endmask);
- }
- }
- }
- }
-}
-
-void
-cfb8FillRectTransparentStippled32 (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox; /* number of boxes to fill */
- BoxPtr pBox; /* pointer to list of boxes to fill */
-{
- int x, y, w, h;
- int nlwMiddle, nlwDst;
- CfbBits startmask, endmask;
- register CfbBits *dst;
- CfbBits *dstLine, *pbits, *dstTmp;
- CfbBits *src;
- register CfbBits xor;
- register CfbBits bits, mask;
- int rot;
- int wEnd;
- cfbPrivGCPtr devPriv;
- PixmapPtr stipple;
- int stippleHeight;
- register int nlw;
-
- devPriv = cfbGetGCPrivate(pGC);
- stipple = pGC->pRotatedPixmap;
- src = (CfbBits *)stipple->devPrivate.ptr;
- stippleHeight = stipple->drawable.height;
-
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
- while (nBox--)
- {
- x = pBox->x1;
- w = pBox->x2 - x;
- if (((x & PIM) + w) <= PPW)
- {
- maskpartialbits(x, w, startmask);
- endmask = 0;
- nlwMiddle = 0;
- }
- else
- {
- maskbits (x, w, startmask, endmask, nlwMiddle);
- }
- rot = (x & ((PGSZ-1) & ~PIM));
- y = pBox->y1;
- dstLine = pbits + (y * nlwDst) + (x >> PWSH);
- h = pBox->y2 - y;
- pBox++;
- y %= stippleHeight;
-#if PPW == 4
- if (cfb8StippleRRop == GXcopy)
- {
- xor = devPriv->xor;
- if (w < PGSZ*2)
- {
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot != 0)
- RotBitsLeft (bits, rot);
- dst = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dst = (*dst & ~(mask & startmask)) |
- (xor & (mask & startmask));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- nlw = nlwMiddle;
- while (nlw--)
- {
- WriteBitGroup (dst,xor,GetBitGroup(bits))
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dst = (*dst & ~(mask & endmask)) |
- (xor & (mask & endmask));
- }
- }
- }
- else
- {
- wEnd = 7 - (nlwMiddle & 7);
- nlwMiddle = (nlwMiddle >> 3) + 1;
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot != 0)
- RotBitsLeft (bits, rot);
- dstTmp = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- *dstTmp = (*dstTmp & ~(mask & startmask)) |
- (xor & (mask & startmask));
- dstTmp++;
- RotBitsLeft (bits, PGSZB);
- }
- w = 7 - wEnd;
- while (w--)
- {
- nlw = nlwMiddle;
- dst = dstTmp;
- dstTmp++;
-#if defined(__GNUC__) && defined(mc68020)
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- xor = xor & mask;
- mask = ~mask;
- while (nlw--)
- {
- *dst = (*dst & mask) | xor;
- dst += 8;
- }
- xor = devPriv->xor;
-#else
-#define SwitchBitsLoop(body) \
- while (nlw--) \
- { \
- body \
- dst += 8; \
- }
- SwitchBitGroup(dst, xor, GetBitGroup(bits));
-#undef SwitchBitsLoop
-#endif
- NextBitGroup (bits);
- }
- nlwMiddle--;
- w = wEnd + 1;
- if (endmask)
- {
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- dst = dstTmp + (nlwMiddle << 3);
- *dst = (*dst & ~(mask & endmask)) |
- (xor & (mask & endmask));
- }
- while (w--)
- {
- nlw = nlwMiddle;
- dst = dstTmp;
- dstTmp++;
-#if defined(__GNUC__) && defined(mc68020)
- mask = cfb8PixelMasks[GetBitGroup(bits)];
- xor = xor & mask;
- mask = ~mask;
- while (nlw--)
- {
- *dst = (*dst & mask) | xor;
- dst += 8;
- }
- xor = devPriv->xor;
-#else
-#define SwitchBitsLoop(body) \
- while (nlw--) \
- { \
- body \
- dst += 8; \
- }
- SwitchBitGroup(dst, xor, GetBitGroup(bits));
-#undef SwitchBitsLoop
-#endif
- NextBitGroup (bits);
- }
- nlwMiddle++;
- }
- }
- }
- else
-#endif /* PPW == 4 */
- {
- while (h--)
- {
- bits = src[y];
- y++;
- if (y == stippleHeight)
- y = 0;
- if (rot != 0)
- RotBitsLeft (bits, rot);
- dst = dstLine;
- dstLine += nlwDst;
- if (startmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, startmask);
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- nlw = nlwMiddle;
- while (nlw--)
- {
- RRopBitGroup(dst, GetBitGroup(bits));
- dst++;
- RotBitsLeft (bits, PGSZB);
- }
- if (endmask)
- {
- xor = GetBitGroup(bits);
- *dst = MaskRRopPixels(*dst, xor, endmask);
- }
- }
- }
- }
-}
-
-
-void
-cfb8FillRectStippledUnnatural (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox;
- register BoxPtr pBox;
-{
- CfbBits *pdstBase; /* pointer to start of bitmap */
- CfbBits *pdstLine; /* current destination line */
- int nlwDst; /* width in longwords of bitmap */
- PixmapPtr pStipple; /* pointer to stipple we want to fill with */
- int nlwMiddle;
- register int nlw;
- int x, y, w, h, xrem, xSrc, ySrc;
- int stwidth, stippleWidth;
- int stippleHeight;
- register CfbBits bits, inputBits;
- register int partBitsLeft;
- int nextPartBits;
- int bitsLeft, bitsWhole;
- register CfbBits *pdst; /* pointer to current word in bitmap */
- CfbBits *srcTemp, *srcStart;
- CfbBits *psrcBase;
- CfbBits startmask, endmask;
-
- if (pGC->fillStyle == FillStippled)
- cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask);
- else
- cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask);
-
- if (cfb8StippleRRop == GXnoop)
- return;
-
- /*
- * OK, so what's going on here? We have two Drawables:
- *
- * The Stipple:
- * Depth = 1
- * Width = stippleWidth
- * Words per scanline = stwidth
- * Pointer to pixels = pStipple->devPrivate.ptr
- */
-
- pStipple = pGC->stipple;
-
- stwidth = pStipple->devKind >> PWSH;
- stippleWidth = pStipple->drawable.width;
- stippleHeight = pStipple->drawable.height;
- psrcBase = (CfbBits *) pStipple->devPrivate.ptr;
-
- /*
- * The Target:
- * Depth = PSZ
- * Width = determined from *pwidth
- * Words per scanline = nlwDst
- * Pointer to pixels = addrlBase
- */
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pdstBase)
-
- /* this replaces rotating the stipple. Instead we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and xrem always stay within the stipple bounds.
- */
-
- xSrc += (pGC->patOrg.x % stippleWidth) - stippleWidth;
- ySrc += (pGC->patOrg.y % stippleHeight) - stippleHeight;
-
- bitsWhole = stippleWidth;
-
- while (nBox--)
- {
- x = pBox->x1;
- y = pBox->y1;
- w = pBox->x2 - x;
- h = pBox->y2 - y;
- pBox++;
- pdstLine = pdstBase + y * nlwDst + (x >> PWSH);
- y = (y - ySrc) % stippleHeight;
- srcStart = psrcBase + y * stwidth;
- xrem = ((x & ~PIM) - xSrc) % stippleWidth;
- if (((x & PIM) + w) < PPW)
- {
- maskpartialbits (x, w, startmask);
- nlwMiddle = 0;
- endmask = 0;
- }
- else
- {
- maskbits (x, w, startmask, endmask, nlwMiddle);
- }
- while (h--)
- {
- srcTemp = srcStart + (xrem >> MFB_PWSH);
- bitsLeft = stippleWidth - (xrem & ~MFB_PIM);
- NextUnnaturalStippleWord
- NextSomeBits (inputBits, (xrem & MFB_PIM));
- partBitsLeft -= (xrem & MFB_PIM);
- NextUnnaturalStippleBits
- nlw = nlwMiddle;
- pdst = pdstLine;
- if (startmask)
- {
- *pdst = MaskRRopPixels(*pdst,bits,startmask);
- pdst++;
- NextUnnaturalStippleBits
- }
- while (nlw--)
- {
- *pdst = RRopPixels(*pdst,bits);
- pdst++;
- NextUnnaturalStippleBits
- }
- if (endmask)
- *pdst = MaskRRopPixels(*pdst,bits,endmask);
- pdstLine += nlwDst;
- y++;
- srcStart += stwidth;
- if (y == stippleHeight)
- {
- y = 0;
- srcStart = psrcBase;
- }
- }
- }
-}
-
-#endif /* PSZ == 8 */
diff --git a/cfb/cfbrrop.c b/cfb/cfbrrop.c
deleted file mode 100644
index 1ee6771e0..000000000
--- a/cfb/cfbrrop.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * $Xorg: cfbrrop.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.c,v 1.6 2001/12/14 19:59:24 dawes Exp $ */
-
-/* cfb reduced rasterop computations */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-
-/* A description:
- *
- * There are four possible operations on each bit in the destination word,
- *
- * 1 2 3 4
- *
- * 0 0 0 1 1
- * 1 0 1 0 1
- *
- * On examination of the reduced rop equation (dst = (dst & and) ^ xor),
- * these four fall to reduced rops as follows:
- *
- * and 0 1 1 0
- * xor 0 0 1 1
- *
- * or, (if 'and' is expensive) (dst = (dst | or) ^ xor)
- *
- * or 1 0 0 1
- * xor 1 0 1 0
- *
- * The trouble with using this later equation is that trivial
- * rasterop reduction is more difficult; some common rasterops
- * use complicated expressions of xor/and instead of the simple
- * ones while other common rasterops are not made any simpler:
- *
- * GXcopy: *dst = ~xor instead of *dst = xor
- * GXand: *dst = *dst & ~or instead of *dst = *dst & and
- * GXor: *dst = *dst | or instead of *dst = *dst | xor
- * GXxor: *dst = *dst ^ xor instead of *dst = *dst ^ xor
- *
- * If you're really set on using this second mechanism, the changes
- * are pretty simple.
- *
- * All that remains is to provide a mechanism for computing and/xor values
- * based on the raster op and foreground value.
- *
- * The 16 rops fall as follows, with the associated reduced
- * rop and/xor and or/xor values. The values in parenthesis following the
- * reduced values gives an equation using the source value for
- * the reduced value, and is one of {0, src, ~src, 1} as appropriate.
- *
- * clear and andReverse copy
- * src 0 1 0 1 0 1 0 1
- * dst 0 0 0 0 0 0 0 0 1 0 0 1
- * 1 0 0 1 0 1 1 0 0 1 0 1
- *
- * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0)
- * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src)
- *
- * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1)
- * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src)
- *
- * andInverted noop xor or
- * src 0 1 0 1 0 1 0 1
- * dst 0 0 0 0 0 0 0 0 1 0 0 1
- * 1 1 0 1 1 1 1 1 0 1 1 1
- *
- * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src)
- * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src)
- *
- * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src)
- * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0)
- *
- * nor equiv invert orReverse
- * src 0 1 0 1 0 1 0 1
- * dst 0 1 0 0 1 0 0 1 1 0 1 1
- * 1 0 0 1 0 1 1 0 0 1 0 1
- *
- * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src)
- * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1)
- *
- * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src)
- * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src)
- *
- * copyInverted orInverted nand set
- * src 0 1 0 1 0 1 0 1
- * dst 0 1 0 0 1 0 0 1 1 0 1 1
- * 1 1 0 1 1 1 1 1 0 1 1 1
- *
- * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0)
- * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1)
- *
- * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1)
- * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0)
- */
-
-int
-cfbReduceRasterOp (rop, fg, pm, andp, xorp)
- int rop;
- CfbBits fg, pm;
- CfbBits *andp, *xorp;
-{
- CfbBits and, xor;
- int rrop;
-
- fg = PFILL (fg);
- pm = PFILL (pm);
- switch (rop)
- {
- case GXclear:
- and = 0;
- xor = 0;
- break;
- case GXand:
- and = fg;
- xor = 0;
- break;
- case GXandReverse:
- and = fg;
- xor = fg;
- break;
- case GXcopy:
- and = 0;
- xor = fg;
- break;
- case GXandInverted:
- and = ~fg;
- xor = 0;
- break;
- case GXnoop:
- and = ~0;
- xor = 0;
- break;
- case GXxor:
- and = ~0;
- xor = fg;
- break;
- case GXor:
- and = ~fg;
- xor = fg;
- break;
- case GXnor:
- and = ~fg;
- xor = ~fg;
- break;
- case GXequiv:
- and = ~0;
- xor = ~fg;
- break;
- case GXinvert:
- and = ~0;
- xor = ~0;
- break;
- case GXorReverse:
- and = ~fg;
- xor = ~0;
- break;
- case GXcopyInverted:
- and = 0;
- xor = ~fg;
- break;
- case GXorInverted:
- and = fg;
- xor = ~fg;
- break;
- case GXnand:
- and = fg;
- xor = ~0;
- break;
- case GXset:
- and = 0;
- xor = ~0;
- break;
- default:
- and = xor = 0;
- break;
- }
- and |= ~pm;
- xor &= pm;
- *andp = and;
- *xorp = xor;
- /* check for some special cases to reduce computation */
- if (and == 0)
- rrop = GXcopy;
- /* nothing checks for GXnoop
- else if (and == ~0 && xor == 0)
- rrop = GXnoop;
- */
- else if (and == ~0)
- rrop = GXxor;
- else if (xor == 0)
- rrop = GXand;
- else if ( (and ^ xor) == ~0) /* fix XBUG 6541 */
- rrop = GXor;
- else
- rrop = GXset; /* rop not reduced */
- return rrop;
-}
diff --git a/cfb/cfbrrop.h b/cfb/cfbrrop.h
deleted file mode 100644
index d8dce082c..000000000
--- a/cfb/cfbrrop.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * $Xorg: cfbrrop.h,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.11 2003/10/29 22:44:53 tsi Exp $ */
-
-#ifndef GXcopy
-#include "X.h"
-#endif
-
-#define RROP_FETCH_GC(gc) \
- RROP_FETCH_GCPRIV(((cfbPrivGCPtr)(gc)->devPrivates[cfbGCPrivateIndex].ptr))
-
-#ifndef RROP
-#define RROP GXset
-#endif
-
-#if RROP == GXcopy
-#if PSZ == 24
-#define RROP_DECLARE register CfbBits rrop_xor; \
- CfbBits piQxelXor[3], spiQxelXor[8];
-#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \
- spiQxelXor[0] = rrop_xor & 0xFFFFFF; \
- spiQxelXor[2] = rrop_xor << 24; \
- spiQxelXor[3] = (rrop_xor & 0xFFFF00)>> 8; \
- spiQxelXor[4] = rrop_xor << 16; \
- spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \
- spiQxelXor[6] = rrop_xor << 8; \
- spiQxelXor[1] = spiQxelXor[7] = 0; \
- piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \
- piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \
- piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16);
-#define RROP_SOLID24(dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \
- if (idx == 2 || idx == 4){ \
- idx++; \
- *((dst)+1) = (*((dst)+1) & cfbrmask[idx])|spiQxelXor[idx]; \
- } \
- }
-#define RROP_SOLID(dst, idx) \
- (*(dst) = piQxelXor[(idx)])
-#define RROP_SOLID_MASK(dst,mask,idx) \
- (*(dst) = (*(dst) & ~(mask))|(piQxelXor[(idx)] & (mask)))
-#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor;
-#else
-#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor;
-#define RROP_DECLARE register CfbBits rrop_xor;
-#define RROP_SOLID(dst) (*(dst) = (rrop_xor))
-#define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask)))
-#define RROP_UNDECLARE
-#endif
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Copy)
-#endif /* GXcopy */
-
-#if RROP == GXxor
-#if PSZ == 24
-#define RROP_DECLARE register CfbBits rrop_xor; \
- CfbBits piQxelXor[3], spiQxelXor[8];
-#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \
- spiQxelXor[0] = rrop_xor & 0xFFFFFF; \
- spiQxelXor[2] = rrop_xor << 24; \
- spiQxelXor[3] = (rrop_xor & 0xFFFF00)>> 8; \
- spiQxelXor[4] = rrop_xor << 16; \
- spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \
- spiQxelXor[6] = rrop_xor << 8; \
- spiQxelXor[1] = spiQxelXor[7] = 0; \
- piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \
- piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \
- piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16);
-#define RROP_SOLID24(dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(dst) ^= spiQxelXor[idx]; \
- if (idx == 2 || idx == 4) \
- *((dst)+1) ^= spiQxelXor[idx+1]; \
- }
-#define RROP_SOLID(dst,idx) \
- (*(dst) ^= piQxelXor[(idx)])
-#define RROP_SOLID_MASK(dst,mask,idx) \
- (*(dst) ^= (piQxelXor[(idx)] & (mask)))
-#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor;
-#else
-#define RROP_DECLARE register CfbBits rrop_xor;
-#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor;
-#define RROP_SOLID(dst) (*(dst) ^= (rrop_xor))
-#define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask)))
-#define RROP_UNDECLARE
-#endif
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Xor)
-#endif /* GXxor */
-
-#if RROP == GXand
-#if PSZ == 24
-#define RROP_DECLARE register CfbBits rrop_and; \
- CfbBits piQxelAnd[3], spiQxelAnd[6];
-#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \
- spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \
- spiQxelAnd[2] = (rrop_and << 24) | 0xFFFFFF; \
- spiQxelAnd[3] = ((rrop_and & 0xFFFF00)>> 8) | 0xFFFF0000; \
- spiQxelAnd[4] = (rrop_and << 16) | 0xFFFF; \
- spiQxelAnd[5] = ((rrop_and & 0xFF0000)>> 16) | 0xFFFFFF00; \
- spiQxelAnd[1] = (rrop_and << 8) | 0xFF; \
- piQxelAnd[0] = (rrop_and & 0xFFFFFF)|(rrop_and << 24); \
- piQxelAnd[1] = (rrop_and << 16)|((rrop_and & 0xFFFF00)>> 8); \
- piQxelAnd[2] = (rrop_and << 8)|((rrop_and & 0xFF0000)>> 16);
-#define RROP_SOLID24(dst,index) {\
- switch((index) & 3){ \
- case 0: \
- *(dst) &= spiQxelAnd[0]; \
- break; \
- case 3: \
- *(dst) &= spiQxelAnd[1]; \
- break; \
- case 1: \
- *(dst) &= spiQxelAnd[2]; \
- *((dst)+1) &= spiQxelAnd[3]; \
- break; \
- case 2: \
- *(dst) &= spiQxelAnd[4]; \
- *((dst)+1) &= spiQxelAnd[5]; \
- break; \
- } \
- }
-#define RROP_SOLID(dst,idx) \
- (*(dst) &= piQxelAnd[(idx)])
-#define RROP_SOLID_MASK(dst,mask,idx) \
- (*(dst) &= (piQxelAnd[(idx)] | ~(mask)))
-#define RROP_UNDECLARE (void)piQxelAnd; (void)spiQxelAnd;
-#else
-#define RROP_DECLARE register CfbBits rrop_and;
-#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and;
-#define RROP_SOLID(dst) (*(dst) &= (rrop_and))
-#define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask)))
-#define RROP_UNDECLARE
-#endif
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,And)
-#endif /* GXand */
-
-#if RROP == GXor
-#if PSZ == 24
-#define RROP_DECLARE register CfbBits rrop_or; \
- CfbBits piQxelOr[3], spiQxelOr[6];
-#define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; \
- spiQxelOr[0] = rrop_or & 0xFFFFFF; \
- spiQxelOr[1] = rrop_or << 24; \
- spiQxelOr[2] = rrop_or << 16; \
- spiQxelOr[3] = rrop_or << 8; \
- spiQxelOr[4] = (rrop_or & 0xFFFF00)>> 8; \
- spiQxelOr[5] = (rrop_or & 0xFF0000)>> 16; \
- piQxelOr[0] = (rrop_or & 0xFFFFFF)|(rrop_or << 24); \
- piQxelOr[1] = (rrop_or << 16)|((rrop_or & 0xFFFF00)>> 8); \
- piQxelOr[2] = (rrop_or << 8)|((rrop_or & 0xFF0000)>> 16);
-#define RROP_SOLID24(dst,index) {\
- switch((index) & 3){ \
- case 0: \
- *(dst) |= spiQxelOr[0]; \
- break; \
- case 3: \
- *(dst) |= spiQxelOr[3]; \
- break; \
- case 1: \
- *(dst) |= spiQxelOr[1]; \
- *((dst)+1) |= spiQxelOr[4]; \
- break; \
- case 2: \
- *(dst) |= spiQxelOr[2]; \
- *((dst)+1) |= spiQxelOr[5]; \
- break; \
- } \
- }
-#define RROP_SOLID(dst,idx) \
- (*(dst) |= piQxelOr[(idx)])
-#define RROP_SOLID_MASK(dst,mask,idx) \
- (*(dst) |= (piQxelOr[(idx)] & (mask)))
-#define RROP_UNDECLARE (void)piQxelOr; (void)spiQxelOr;
-#else
-#define RROP_DECLARE register CfbBits rrop_or;
-#define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor;
-#define RROP_SOLID(dst) (*(dst) |= (rrop_or))
-#define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask)))
-#define RROP_UNDECLARE
-#endif
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Or)
-#endif /* GXor */
-
-#if RROP == GXnoop
-#define RROP_DECLARE
-#define RROP_FETCH_GCPRIV(devPriv)
-#define RROP_SOLID(dst)
-#define RROP_SOLID_MASK(dst,mask)
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Noop)
-#define RROP_UNDECLARE
-#endif /* GXnoop */
-
-#if RROP == GXset
-#if PSZ == 24
-#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; \
- CfbBits piQxelAnd[3], piQxelXor[3], spiQxelAnd[6], spiQxelXor[6];
-#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \
- rrop_xor = (devPriv)->xor; \
- spiQxelXor[0] = rrop_xor & 0xFFFFFF; \
- spiQxelXor[1] = rrop_xor << 24; \
- spiQxelXor[2] = rrop_xor << 16; \
- spiQxelXor[3] = rrop_xor << 8; \
- spiQxelXor[4] = (rrop_xor & 0xFFFF00)>> 8; \
- spiQxelXor[5] = (rrop_xor & 0xFF0000)>> 16; \
- spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \
- spiQxelAnd[1] = (rrop_and << 24) | 0xFFFFFF; \
- spiQxelAnd[2] = (rrop_and << 16) | 0xFFFF; \
- spiQxelAnd[3] = (rrop_and << 8) | 0xFF; \
- spiQxelAnd[4] = ((rrop_and & 0xFFFF00)>> 8) | 0xFFFF0000; \
- spiQxelAnd[5] = ((rrop_and & 0xFF0000)>> 16) | 0xFFFFFF00; \
- piQxelAnd[0] = (rrop_and & 0xFFFFFF)|(rrop_and << 24); \
- piQxelAnd[1] = (rrop_and << 16)|((rrop_and & 0xFFFF00)>> 8); \
- piQxelAnd[2] = (rrop_and << 8)|((rrop_and & 0xFF0000)>> 16); \
- piQxelXor[0] = (rrop_xor & 0xFFFFFF)|(rrop_xor << 24); \
- piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \
- piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16);
-#define RROP_SOLID24(dst,index) {\
- switch((index) & 3){ \
- case 0: \
- *(dst) = ((*(dst) & (piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); \
- break; \
- case 3: \
- *(dst) = ((*(dst) & (piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); \
- break; \
- case 1: \
- *(dst) = ((*(dst) & (piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); \
- *((dst)+1) = ((*((dst)+1) & (piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); \
- break; \
- case 2: \
- *(dst) = ((*(dst) & (piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); \
- *((dst)+1) = ((*((dst)+1) & (piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); \
- break; \
- } \
- }
-#define RROP_SOLID(dst,idx) \
- (*(dst) = DoRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)]))
-#define RROP_SOLID_MASK(dst,mask,idx) \
- (*(dst) = DoMaskRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)], (mask)))
-#define RROP_UNDECLARE (void)piQxelAnd; (void)piQxelXor; \
- (void)spiQxelAnd; (void)spiQxelXor;
-#else
-#define RROP_DECLARE register CfbBits rrop_and, rrop_xor;
-#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \
- rrop_xor = (devPriv)->xor;
-#define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor))
-#define RROP_SOLID_MASK(dst,mask) (*(dst) = DoMaskRRop (*(dst), rrop_and, rrop_xor, (mask)))
-#define RROP_UNDECLARE
-#endif
-#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,General)
-#endif /* GXset */
-
-#define RROP_UNROLL_CASE1(p,i) case (i): RROP_SOLID((p) - (i));
-#define RROP_UNROLL_CASE2(p,i) RROP_UNROLL_CASE1(p,(i)+1) RROP_UNROLL_CASE1(p,i)
-#define RROP_UNROLL_CASE4(p,i) RROP_UNROLL_CASE2(p,(i)+2) RROP_UNROLL_CASE2(p,i)
-#define RROP_UNROLL_CASE8(p,i) RROP_UNROLL_CASE4(p,(i)+4) RROP_UNROLL_CASE4(p,i)
-#define RROP_UNROLL_CASE16(p,i) RROP_UNROLL_CASE8(p,(i)+8) RROP_UNROLL_CASE8(p,i)
-#define RROP_UNROLL_CASE3(p) RROP_UNROLL_CASE2(p,2) RROP_UNROLL_CASE1(p,1)
-#define RROP_UNROLL_CASE7(p) RROP_UNROLL_CASE4(p,4) RROP_UNROLL_CASE3(p)
-#define RROP_UNROLL_CASE15(p) RROP_UNROLL_CASE8(p,8) RROP_UNROLL_CASE7(p)
-#define RROP_UNROLL_CASE31(p) RROP_UNROLL_CASE16(p,16) RROP_UNROLL_CASE15(p)
-#ifdef LONG64
-#define RROP_UNROLL_CASE63(p) RROP_UNROLL_CASE32(p,32) RROP_UNROLL_CASE31(p)
-#endif /* LONG64 */
-
-#define RROP_UNROLL_LOOP1(p,i) RROP_SOLID((p) + (i));
-#define RROP_UNROLL_LOOP2(p,i) RROP_UNROLL_LOOP1(p,(i)) RROP_UNROLL_LOOP1(p,(i)+1)
-#define RROP_UNROLL_LOOP4(p,i) RROP_UNROLL_LOOP2(p,(i)) RROP_UNROLL_LOOP2(p,(i)+2)
-#define RROP_UNROLL_LOOP8(p,i) RROP_UNROLL_LOOP4(p,(i)) RROP_UNROLL_LOOP4(p,(i)+4)
-#define RROP_UNROLL_LOOP16(p,i) RROP_UNROLL_LOOP8(p,(i)) RROP_UNROLL_LOOP8(p,(i)+8)
-#define RROP_UNROLL_LOOP32(p,i) RROP_UNROLL_LOOP16(p,(i)) RROP_UNROLL_LOOP16(p,(i)+16)
-#ifdef LONG64
-#define RROP_UNROLL_LOOP64(p,i) RROP_UNROLL_LOOP32(p,(i)) RROP_UNROLL_LOOP32(p,(i)+32)
-#endif /* LONG64 */
-
-#if defined (FAST_CONSTANT_OFFSET_MODE) && defined (SHARED_IDCACHE) && (RROP == GXcopy)
-
-#ifdef LONG64
-#define RROP_UNROLL_SHIFT 6
-#define RROP_UNROLL_CASE(p) RROP_UNROLL_CASE63(p)
-#define RROP_UNROLL_LOOP(p) RROP_UNROLL_LOOP64(p,-64)
-#else /* not LONG64 */
-#define RROP_UNROLL_SHIFT 5
-#define RROP_UNROLL_CASE(p) RROP_UNROLL_CASE31(p)
-#define RROP_UNROLL_LOOP(p) RROP_UNROLL_LOOP32(p,-32)
-#endif /* LONG64 */
-#define RROP_UNROLL (1<<RROP_UNROLL_SHIFT)
-#define RROP_UNROLL_MASK (RROP_UNROLL-1)
-
-#define RROP_SPAN(pdst,nmiddle) {\
- int part = (nmiddle) & RROP_UNROLL_MASK; \
- (nmiddle) >>= RROP_UNROLL_SHIFT; \
- (pdst) += part * (sizeof (CfbBits) / sizeof (*pdst)); \
- switch (part) {\
- RROP_UNROLL_CASE((CfbBits *) (pdst)) \
- } \
- while (--(nmiddle) >= 0) { \
- (pdst) += RROP_UNROLL * (sizeof (CfbBits) / sizeof (*pdst)); \
- RROP_UNROLL_LOOP((CfbBits *) (pdst)) \
- } \
-}
-#else
-#define RROP_SPAN(pdst,nmiddle) \
- while (--(nmiddle) >= 0) { \
- RROP_SOLID((CfbBits *) (pdst)); \
- (pdst) += sizeof (CfbBits) / sizeof (*pdst); \
- }
-#endif
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define RROP_NAME_CAT(prefix,suffix) prefix##suffix
-#else
-#define RROP_NAME_CAT(prefix,suffix) prefix/**/suffix
-#endif
diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c
deleted file mode 100644
index 7e0d15dd4..000000000
--- a/cfb/cfbscrinit.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.20 2003/07/16 01:38:37 dawes Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $Xorg: cfbscrinit.c,v 1.3 2000/08/17 19:48:15 cpqbld Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "cfb.h"
-#include "mi.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "cfbmskbits.h"
-#include "mibstore.h"
-
-BSFuncRec cfbBSFuncRec = {
- cfbSaveAreas,
- cfbRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-Bool
-cfbCloseScreen (index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- int d;
- DepthPtr depths = pScreen->allowedDepths;
-
- for (d = 0; d < pScreen->numDepths; d++)
- xfree (depths[d].vids);
- xfree (depths);
- xfree (pScreen->visuals);
-#ifdef CFB_NEED_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[cfbScreenPrivateIndex].ptr);
-#else
- xfree (pScreen->devPrivate);
-#endif
- return TRUE;
-}
-
-static void DestroyColormapNoop(
- ColormapPtr pColormap)
-{
- /* NOOP */
-}
-
-static void StoreColorsNoop(
- ColormapPtr pColormap,
- int ndef,
- xColorItem * pdef)
-{
- /* NOOP */
-}
-
-Bool
-cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0))
- return FALSE;
- pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = mfbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = cfbGetImage;
- pScreen->GetSpans = cfbGetSpans;
- pScreen->CreateWindow = cfbCreateWindow;
- pScreen->DestroyWindow = cfbDestroyWindow;
- pScreen->PositionWindow = cfbPositionWindow;
- pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes;
- pScreen->RealizeWindow = cfbMapWindow;
- pScreen->UnrealizeWindow = cfbUnmapWindow;
- pScreen->PaintWindowBackground = cfbPaintWindow;
- pScreen->PaintWindowBorder = cfbPaintWindow;
- pScreen->CopyWindow = cfbCopyWindow;
- pScreen->CreatePixmap = cfbCreatePixmap;
- pScreen->DestroyPixmap = cfbDestroyPixmap;
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = cfbCreateGC;
- pScreen->CreateColormap = cfbInitializeColormap;
- pScreen->DestroyColormap = DestroyColormapNoop;
- pScreen->InstallColormap = cfbInstallColormap;
- pScreen->UninstallColormap = cfbUninstallColormap;
- pScreen->ListInstalledColormaps = cfbListInstalledColormaps;
- pScreen->StoreColors = StoreColorsNoop;
- pScreen->ResolveColor = cfbResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
- return TRUE;
-}
-
-#ifdef CFB_NEED_SCREEN_PRIVATE
-Bool
-cfbCreateScreenResources(pScreen)
- ScreenPtr pScreen;
-{
- Bool retval;
-
- pointer oldDevPrivate = pScreen->devPrivate;
- pScreen->devPrivate = pScreen->devPrivates[cfbScreenPrivateIndex].ptr;
- retval = miCreateScreenResources(pScreen);
- pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
- return retval;
-}
-#endif
-
-Bool
-cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pointer oldDevPrivate;
-#endif
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- if (!cfbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(PSZ-1)), 8))
- return FALSE;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- oldDevPrivate = pScreen->devPrivate;
-#endif
- if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals))
- return FALSE;
- /* overwrite miCloseScreen with our own */
- pScreen->CloseScreen = cfbCloseScreen;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pScreen->CreateScreenResources = cfbCreateScreenResources;
- pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
-#endif
- pScreen->BackingStoreFuncs = cfbBSFuncRec;
- pScreen->GetScreenPixmap = cfbGetScreenPixmap;
- pScreen->SetScreenPixmap = cfbSetScreenPixmap;
- return TRUE;
-}
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-cfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- if (!cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width))
- return FALSE;
- return cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width);
-}
-
-PixmapPtr
-cfbGetScreenPixmap(pScreen)
- ScreenPtr pScreen;
-{
-#ifdef CFB_NEED_SCREEN_PRIVATE
- return (PixmapPtr)pScreen->devPrivates[cfbScreenPrivateIndex].ptr;
-#else
- return (PixmapPtr)pScreen->devPrivate;
-#endif
-}
-
-void
-cfbSetScreenPixmap(pPix)
- PixmapPtr pPix;
-{
-#ifdef CFB_NEED_SCREEN_PRIVATE
- if (pPix)
- pPix->drawable.pScreen->devPrivates[cfbScreenPrivateIndex].ptr =
- (pointer)pPix;
-#else
- if (pPix)
- pPix->drawable.pScreen->devPrivate = (pointer)pPix;
-#endif
-}
diff --git a/cfb/cfbsetsp.c b/cfb/cfbsetsp.c
deleted file mode 100644
index 4f7dfaee1..000000000
--- a/cfb/cfbsetsp.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/* $Xorg: cfbsetsp.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.6 2003/10/29 22:44:53 tsi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include <mergerop.h>
-
-/* cfbSetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-void
-cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemask)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register unsigned int *psrc;
- register int alu; /* raster op */
- int *pdstBase; /* start of the drawable */
- int widthDst; /* width of drawable in words */
- unsigned long planemask;
-{
- int w; /* width of scanline in bits */
- register int *pdst; /* where to put the bits */
- register int tmpSrc; /* scratch buffer to collect bits in */
- int offSrc;
- int nl;
-#if PSZ == 24
- register char *psrcb, *pdstb;
- register int xIndex;
-#else
- int dstBit; /* offset in bits from beginning of
- * word */
- register int nstart; /* number of bits from first partial */
-#if PSZ != 32 || PPW != 1
- register int nend; /* " " last partial word */
-#endif
- int startmask, endmask, nlMiddle;
-#endif
- DeclareMergeRop()
-
- InitializeMergeRop(alu,planemask);
-#if PSZ == 24
- pdst = pdstBase + (y * widthDst);
- xIndex = xStart;
- pdstb = (char *)pdst + (xStart * 3);
- offSrc = xStart - xOrigin;
- psrcb = (char *)psrc + (offSrc * 3);
-#else
- pdst = pdstBase + (y * widthDst) + (xStart >> PWSH);
- psrc += (xStart - xOrigin) >> PWSH;
- offSrc = (xStart - xOrigin) & PIM;
-#endif
- w = xEnd - xStart;
-
-#if PSZ == 24
- nl = w;
- while (nl--){
- psrc = (unsigned int *)((unsigned long)psrcb & ~0x03);
- getbits24(psrc, tmpSrc, offSrc);
- pdst = (int *)((unsigned long)pdstb & ~0x03);
- DoMergeRop24(tmpSrc, pdst, xIndex);
- offSrc++;
- psrcb += 3;
- xIndex++;
- pdstb += 3;
- }
-#else /* PSZ == 24 */
- dstBit = xStart & PIM;
- if (dstBit + w <= PPW)
- {
- maskpartialbits(dstBit, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- maskbits(xStart, w, startmask, endmask, nlMiddle);
- }
- if (startmask)
- nstart = PPW - dstBit;
- else
- nstart = 0;
-#if PSZ != 32 || PPW != 1
- if (endmask)
- nend = xEnd & PIM;
- else
- nend = 0;
-#endif
- if (startmask)
- {
- getbits(psrc, offSrc, nstart, tmpSrc);
- putbitsmropshort(tmpSrc, dstBit, nstart, pdst);
- pdst++;
- offSrc += nstart;
- if (offSrc > PLST)
- {
- psrc++;
- offSrc -= PPW;
- }
- }
- nl = nlMiddle;
- while (nl--)
- {
- getbits(psrc, offSrc, PPW, tmpSrc);
- *pdst = DoMergeRop(tmpSrc, *pdst);
- pdst++;
- psrc++;
- }
- if (endmask)
- {
- getbits(psrc, offSrc, nend, tmpSrc);
- putbitsmropshort(tmpSrc, 0, nend, pdst);
- }
-#endif /* PSZ == 24 */
-}
-
-
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-cfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *pcharsrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- unsigned int *psrc = (unsigned int *)pcharsrc;
- CfbBits *pdstBase; /* start of dst bitmap */
- int widthDst; /* width of bitmap in words */
- register BoxPtr pbox, pboxLast, pboxTest;
- register DDXPointPtr pptLast;
- int alu;
- RegionPtr prgnDst;
- int xStart, xEnd;
- int yMax;
-
- alu = pGC->alu;
- prgnDst = cfbGetCompositeClip(pGC);
- pptLast = ppt + nspans;
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- yMax = (int) pDrawable->y + (int) pDrawable->height;
-
- pbox = REGION_RECTS(prgnDst);
- pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
-
- if(fSorted)
- {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- pboxTest = pbox;
- while(ppt < pptLast)
- {
- pbox = pboxTest;
- if(ppt->y >= yMax)
- break;
- while(pbox < pboxLast)
- {
- if(pbox->y1 > ppt->y)
- {
- /* scanline is before clip box */
- break;
- }
- else if(pbox->y2 <= ppt->y)
- {
- /* clip box is before scanline */
- pboxTest = ++pbox;
- continue;
- }
- else if(pbox->x1 > ppt->x + *pwidth)
- {
- /* clip box is to right of scanline */
- break;
- }
- else if(pbox->x2 <= ppt->x)
- {
- /* scanline is to right of clip box */
- pbox++;
- continue;
- }
-
- /* at least some of the scanline is in the current clip box */
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(ppt->x + *pwidth, pbox->x2);
- cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- (int *)pdstBase, widthDst, pGC->planemask);
- if(ppt->x + *pwidth <= pbox->x2)
- {
- /* End of the line, as it were */
- break;
- }
- else
- pbox++;
- }
- /* We've tried this line against every box; it must be outside them
- * all. move on to the next point */
- ppt++;
- psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth);
- pwidth++;
- }
- }
- else
- {
- /* scan lines not sorted. We must clip each line against all the boxes */
- while(ppt < pptLast)
- {
- if(ppt->y >= 0 && ppt->y < yMax)
- {
-
- for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++)
- {
- if(pbox->y1 > ppt->y)
- {
- /* rest of clip region is above this scanline,
- * skip it */
- break;
- }
- if(pbox->y2 <= ppt->y)
- {
- /* clip box is below scanline */
- pbox++;
- break;
- }
- if(pbox->x1 <= ppt->x + *pwidth &&
- pbox->x2 > ppt->x)
- {
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(pbox->x2, ppt->x + *pwidth);
- cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- (int *)pdstBase, widthDst, pGC->planemask);
- }
-
- }
- }
- psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
- }
-}
-
diff --git a/cfb/cfbsolid.c b/cfb/cfbsolid.c
deleted file mode 100644
index f0a3e361e..000000000
--- a/cfb/cfbsolid.c
+++ /dev/null
@@ -1,1363 +0,0 @@
-/*
- * $Xorg: cfbsolid.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.9 2003/10/29 22:44:53 tsi Exp $ */
-
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfbrrop.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-#if defined(FAST_CONSTANT_OFFSET_MODE) && (RROP != GXcopy)
-# define Expand(left,right,leftAdjust) {\
- int part = nmiddle & 3; \
- int widthStep; \
- widthStep = widthDst - nmiddle - leftAdjust; \
- nmiddle >>= 2; \
- pdst = pdstRect; \
- while (h--) { \
- left \
- pdst += part; \
- switch (part) { \
- RROP_UNROLL_CASE3(pdst) \
- } \
- m = nmiddle; \
- while (m) { \
- pdst += 4; \
- RROP_UNROLL_LOOP4(pdst,-4) \
- m--; \
- } \
- right \
- pdst += widthStep; \
- } \
-}
-#else
-# ifdef RROP_UNROLL
-# define Expand(left,right,leftAdjust) {\
- int part = nmiddle & RROP_UNROLL_MASK; \
- int widthStep; \
- widthStep = widthDst - nmiddle - leftAdjust; \
- nmiddle >>= RROP_UNROLL_SHIFT; \
- pdst = pdstRect; \
- while (h--) { \
- left \
- pdst += part; \
- switch (part) { \
- RROP_UNROLL_CASE(pdst) \
- } \
- m = nmiddle; \
- while (m) { \
- pdst += RROP_UNROLL; \
- RROP_UNROLL_LOOP(pdst) \
- m--; \
- } \
- right \
- pdst += widthStep; \
- } \
-}
-
-# else
-# define Expand(left, right, leftAdjust) { \
- while (h--) { \
- pdst = pdstRect; \
- left \
- m = nmiddle; \
- while (m--) {\
- RROP_SOLID(pdst); \
- pdst++; \
- } \
- right \
- pdstRect += widthDst; \
- } \
-}
-# endif
-#endif
-
-
-void
-RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox;
- BoxPtr pBox;
-{
- register int m;
- register CfbBits *pdst;
- RROP_DECLARE
- CfbBits *pdstBase, *pdstRect;
- int nmiddle;
- int h;
- int w;
- int widthDst;
-#if PSZ == 24
- int leftIndex, rightIndex;
-#else
- register CfbBits leftMask, rightMask;
-#endif
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- RROP_FETCH_GC(pGC)
-
- for (; nBox; nBox--, pBox++)
- {
- pdstRect = pdstBase + pBox->y1 * widthDst;
- h = pBox->y2 - pBox->y1;
- w = pBox->x2 - pBox->x1;
-#if PSZ == 8
- if (w == 1)
- {
- register char *pdstb = ((char *) pdstRect) + pBox->x1;
- int incr = widthDst * PGSZB;
-
- while (h--)
- {
- RROP_SOLID (pdstb);
- pdstb += incr;
- }
- }
- else
- {
-#endif
-#if PSZ == 24
- leftIndex = pBox->x1 &3;
-/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/
- rightIndex = pBox->x2 &3;
-
- nmiddle = w - rightIndex;
- if(leftIndex){
- nmiddle -= (4 - leftIndex);
- }
- nmiddle >>= 2;
- if(nmiddle < 0)
- nmiddle = 0;
-
- pdstRect += (pBox->x1 * 3) >> 2;
- pdst = pdstRect;
- switch(leftIndex+w){
- case 4:
- switch(leftIndex){
- case 0:
- while(h--){
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- pdst--;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- pdst++;
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- pdst += widthDst;
- }
- break;
- case 3:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXxor
- *pdst ^= (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXand
- *pdst &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst |= (piQxelOr[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
-#endif
- pdst += widthDst;
- }
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
- while(h--){
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= (piQxeAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst--;
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst--;
- pdst += widthDst;
- }
- break;
- case 2:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst += widthDst;
- }
- break;
- case 3:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXxor
- *pdst ^= (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXand
- *pdst &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst |= (piQxelOr[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
-#endif
- pdst += widthDst;
- }
- break;
- }
- break;
- case 2: /* leftIndex + w = 2*/
- switch(leftIndex){
- case 2:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF0000);
- *pdst-- &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst += widthDst;
- }
- break;
- case 1:
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst-- ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFFFFFF);
- *pdst-- &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst-- |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst--;
-#endif
- pdst += widthDst;
- }
- break;
- case 0: /*case 2 leftIndex == 0 */
- while(h--){
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst-- ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst-- &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst-- |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst--;
-#endif
- pdst += widthDst;
- }
- break;
- }
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
- while(h--){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXxor
- *pdst ^= (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXand
- *pdst &= (piQxelAnd[0] | 0xFF000000);
-#endif
-#if RROP == GXor
- *pdst |= (piQxelOr[0] & 0xFFFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
-#endif
- pdst += widthDst;
- }
- break;
- case 0: /*never*/
- break;
- default:
- {
- while(h--){
- pdst = pdstRect;
- switch(leftIndex){
- case 0:
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- break;
- case 2:
-#if RROP == GXcopy
- *pdst = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000));
- pdst++;
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^=(piQxelXor[1] & 0xFFFF0000);
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- break;
- case 3:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
- pdst++;
-#endif
- break;
- }
- m = nmiddle;
- while(m--){
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFFFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
- pdst++;
-#endif
- break;
- case 2:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst++;
-#endif
- break;
- case 3:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst++ |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst++;
-#endif
- break;
- }
- pdstRect += widthDst;
- }
- }
- }
-#else /* PSZ != 24 */
- pdstRect += (pBox->x1 >> PWSH);
- if ((pBox->x1 & PIM) + w <= PPW)
- {
- maskpartialbits(pBox->x1, w, leftMask);
- pdst = pdstRect;
- while (h--) {
- RROP_SOLID_MASK (pdst, leftMask);
- pdst += widthDst;
- }
- }
- else
- {
- maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);
- if (leftMask)
- {
- if (rightMask) /* left mask and right mask */
- {
- Expand(RROP_SOLID_MASK (pdst, leftMask); pdst++;,
- RROP_SOLID_MASK (pdst, rightMask);, 1)
- }
- else /* left mask and no right mask */
- {
- Expand(RROP_SOLID_MASK (pdst, leftMask); pdst++;,
- ;, 1)
- }
- }
- else
- {
- if (rightMask) /* no left mask and right mask */
- {
- Expand(;,
- RROP_SOLID_MASK (pdst, rightMask);, 0)
- }
- else /* no left mask and no right mask */
- {
- Expand(;,
- ;, 0)
- }
- }
- }
-#endif
-#if PSZ == 8
- }
-#endif
- }
- RROP_UNDECLARE
-}
-
-void
-RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- CfbBits *pdstBase;
- int widthDst;
-
- RROP_DECLARE
-
- register CfbBits *pdst;
- register int nlmiddle;
- register int w;
- int x;
-
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidthFree;/* copies of the pointers to free */
- DDXPointPtr pptFree;
- int *pwidth;
- cfbPrivGCPtr devPriv;
-#if PSZ == 24
- int leftIndex, rightIndex;
-#else
- register CfbBits startmask, endmask;
-#endif
-
- devPriv = cfbGetGCPrivate(pGC);
- RROP_FETCH_GCPRIV(devPriv)
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (n--)
- {
- x = ppt->x;
- pdst = pdstBase + (ppt->y * widthDst);
- ++ppt;
- w = *pwidth++;
- if (!w)
- continue;
-#if PSZ == 24
- leftIndex = x &3;
-/* rightIndex = ((leftIndex+w)<5)?0:(x+w)&3;*/
- rightIndex = (x+w)&3;
-
- nlmiddle = w - rightIndex;
- if(leftIndex){
- nlmiddle -= (4 - leftIndex);
- }
-/* nlmiddle += 3;*/
- nlmiddle >>= 2;
- if(nlmiddle < 0)
- nlmiddle = 0;
-
- pdst += (x >> 2)*3;
- pdst += leftIndex? (leftIndex -1):0;
- switch(leftIndex+w){
- case 4:
- switch(leftIndex){
- case 0:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- pdst--;
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- pdst--;
- break;
- case 2:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- pdst++;
- *pdst-- = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
- *pdst-- ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst-- &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst-- |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst--;
-#endif
- break;
- case 3:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXxor
- *pdst ^= (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXand
- *pdst &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst |= (piQxelOr[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
-#endif
- break;
- }
- break;
- case 3:
- switch(leftIndex){
- case 0:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
-
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst--;
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0x00FFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- pdst--;
- break;
- case 2:
-/* pdst++;*/
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
- *pdst-- ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst-- &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst-- |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst--;
-#endif
- break;
- }
- break;
- case 2: /* leftIndex + w = 2*/
- if(leftIndex){
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst-- ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFFFFFF);
- *pdst-- &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst-- |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst--;
-#endif
- }
- else{ /*case 2 leftIndex === 0 */
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst--;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst-- ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst-- &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst-- |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst--;
-#endif
- }
- break;
- case 1: /*only if leftIndex = 0 and w = 1*/
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXxor
- *pdst ^= (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXand
- *pdst &= (piQxelAnd[0] | 0xFF000000);
-#endif
-#if RROP == GXor
- *pdst |= (piQxelOr[0] & 0xFFFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
-#endif
- break;
- case 0: /*never*/
- break;
- default:
- {
- switch(leftIndex){
- case 0:
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
- pdst++;
- *pdst++ = piQxelXor[1];
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFF000000);
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFFFFFF);
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFF000000);
- *pdst++ |= piQxelOr[1];
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFF000000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- break;
- case 2:
-#if RROP == GXcopy
- *pdst = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000));
- pdst++;
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^=(piQxelXor[1] & 0xFFFF0000);
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[1] | 0xFFFF);
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[1] & 0xFFFF0000);
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF0000);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- break;
- case 3:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[2] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[2] & 0xFFFFFF00);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFFFFFF00);
- pdst++;
-#endif
- break;
- }
- while(nlmiddle--){
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst++ = piQxelXor[2];
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= piQxelXor[2];
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= piQxelAnd[2];
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst++ |= piQxelOr[2];
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[2], piQxelXor[2]);
- pdst++;
-#endif
- }
- switch(rightIndex){
- case 0:
- break;
- case 1:
-#if RROP == GXcopy
- *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= (piQxelXor[0] & 0xFFFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= (piQxelAnd[0] | 0xFF);
-#endif
-#if RROP == GXor
- *pdst++ |= (piQxelOr[0] & 0xFFFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoMaskRRop((*pdst), piQxelAnd[0], piQxelXor[0], 0xFFFFFF);
-#endif
- break;
- case 2:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= (piQxelXor[1] & 0xFFFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= (piQxelAnd[1] | 0xFFFF0000);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= (piQxelOr[1] & 0xFFFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF);
- pdst++;
-#endif
- break;
- case 3:
-#if RROP == GXcopy
- *pdst++ = piQxelXor[0];
- *pdst++ = piQxelXor[1];
- *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
- pdst++;
-#endif
-#if RROP == GXxor
- *pdst++ ^= piQxelXor[0];
- *pdst++ ^= piQxelXor[1];
- *pdst++ ^= (piQxelXor[2] & 0xFF);
-#endif
-#if RROP == GXand
- *pdst++ &= piQxelAnd[0];
- *pdst++ &= piQxelAnd[1];
- *pdst++ &= (piQxelAnd[2] | 0xFFFFFF00);
-#endif
-#if RROP == GXor
- *pdst++ |= piQxelOr[0];
- *pdst++ |= piQxelOr[1];
- *pdst++ |= (piQxelOr[2] & 0xFF);
-#endif
-#if RROP == GXset
- *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]);
- pdst++;
- *pdst = DoRRop((*pdst), piQxelAnd[1], piQxelXor[1]);
- pdst++;
- *pdst = DoMaskRRop((*pdst), piQxelAnd[2], piQxelXor[2], 0xFF);
- pdst++;
-#endif
- break;
- }
- }
-}
-#else
-#if PSZ == 8
- if (w <= PGSZB)
- {
- register char *addrb;
-
- addrb = ((char *) pdst) + x;
- while (w--)
- {
- RROP_SOLID (addrb);
- addrb++;
- }
- }
-#else
- if ((x & PIM) + w <= PPW)
- {
- pdst += x >> PWSH;
- maskpartialbits (x, w, startmask);
- RROP_SOLID_MASK (pdst, startmask);
- }
-#endif
- else
- {
- pdst += x >> PWSH;
- maskbits (x, w, startmask, endmask, nlmiddle);
- if (startmask)
- {
- RROP_SOLID_MASK (pdst, startmask);
- ++pdst;
- }
-
- RROP_SPAN(pdst,nlmiddle)
- if (endmask)
- {
- RROP_SOLID_MASK (pdst, endmask);
- }
- }
-#endif
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
- RROP_UNDECLARE
-}
diff --git a/cfb/cfbtab.h b/cfb/cfbtab.h
deleted file mode 100644
index 5c4f1c445..000000000
--- a/cfb/cfbtab.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbtab.h,v 1.1 2003/07/16 01:38:37 dawes Exp $ */
-
-#ifndef _CFBTAB_H_
-#define _CFBTAB_H_
-
-/* prototypes */
-extern int starttab[32], endtab[32];
-extern unsigned int partmasks[32][32];
-
-#endif /* _CFBTAB_H_ */
diff --git a/cfb/cfbteblt8.c b/cfb/cfbteblt8.c
deleted file mode 100644
index 0cdbddc7a..000000000
--- a/cfb/cfbteblt8.c
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- * TEGblt - ImageText expanded glyph fonts only. For
- * 8 bit displays, in Copy mode with no clipping.
- */
-
-/* $XFree86: xc/programs/Xserver/cfb/cfbteblt8.c,v 1.6 2001/12/14 19:59:25 dawes Exp $ */
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $Xorg: cfbteblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */
-
-#if PSZ == 8
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-/*
- * this code supports up to 5 characters at a time. The performance
- * differences between 4 and 5 is usually small (~7% on PMAX) and
- * frequently negative (SPARC and Sun3), so this file is compiled
- * only once for now. If you want to use the other options, you'll
- * need to hack cfbgc.c as well.
- */
-
-#ifndef NGLYPHS
-#define NGLYPHS 4
-#define DO_COMMON
-#endif
-
-#ifdef DO_COMMON
-#define CFBTEGBLT8 cfbTEGlyphBlt8
-#endif
-
-/*
- * On little-endian machines (or where fonts are padded to 32-bit
- * boundaries) we can use some magic to avoid the expense of getleftbits
- */
-
-#if ((BITMAP_BIT_ORDER == LSBFirst && NGLYPHS >= 4) || GLYPHPADBYTES == 4)
-
-#if GLYPHPADBYTES == 1
-typedef unsigned char *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 2
-typedef unsigned short *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 4
-typedef unsigned int *glyphPointer;
-#endif
-
-#define GetBitsL c = BitLeft (*leftChar++, lshift)
-#define NGetBits1S(r) c = BitRight(*char1++ r, xoff1)
-#define NGetBits1L(r) GetBitsL | BitRight(*char1++ r, xoff1)
-#define NGetBits1U(r) c = *char1++ r
-#define NGetBits2S(r) NGetBits1S(| BitRight(*char2++ r, widthGlyph))
-#define NGetBits2L(r) NGetBits1L(| BitRight(*char2++ r, widthGlyph))
-#define NGetBits2U(r) NGetBits1U(| BitRight(*char2++ r, widthGlyph))
-#define NGetBits3S(r) NGetBits2S(| BitRight(*char3++ r, widthGlyph))
-#define NGetBits3L(r) NGetBits2L(| BitRight(*char3++ r, widthGlyph))
-#define NGetBits3U(r) NGetBits2U(| BitRight(*char3++ r, widthGlyph))
-#define NGetBits4S(r) NGetBits3S(| BitRight(*char4++ r, widthGlyph))
-#define NGetBits4L(r) NGetBits3L(| BitRight(*char4++ r, widthGlyph))
-#define NGetBits4U(r) NGetBits3U(| BitRight(*char4++ r, widthGlyph))
-#define NGetBits5S(r) NGetBits4S(| BitRight(*char5++ r, widthGlyph))
-#define NGetBits5L(r) NGetBits4L(| BitRight(*char5++ r, widthGlyph))
-#define NGetBits5U(r) NGetBits4U(| BitRight(*char5++ r, widthGlyph))
-#define GetBits1S c = BitRight(*char1++, xoff1)
-#define GetBits1L GetBitsL | BitRight(*char1++, xoff1)
-#define GetBits1U c = *char1++
-#define GetBits2S NGetBits1S(| BitRight(*char2++, widthGlyph))
-#define GetBits2L NGetBits1L(| BitRight(*char2++, widthGlyph))
-#define GetBits2U NGetBits1U(| BitRight(*char2++, widthGlyph))
-#define GetBits3S NGetBits2S(| BitRight(*char3++, widthGlyph))
-#define GetBits3L NGetBits2L(| BitRight(*char3++, widthGlyph))
-#define GetBits3U NGetBits2U(| BitRight(*char3++, widthGlyph))
-#define GetBits4S NGetBits3S(| BitRight(*char4++, widthGlyph))
-#define GetBits4L NGetBits3L(| BitRight(*char4++, widthGlyph))
-#define GetBits4U NGetBits3U(| BitRight(*char4++, widthGlyph))
-#define GetBits5S NGetBits4S(| BitRight(*char5++, widthGlyph))
-#define GetBits5L NGetBits4L(| BitRight(*char5++, widthGlyph))
-#define GetBits5U NGetBits4U(| BitRight(*char5++, widthGlyph))
-
-#else
-
-typedef unsigned int *glyphPointer;
-
-#define USE_LEFTBITS
-#define ALL_LEFTBITS
-
-#define GetBitsL WGetBitsL
-#define GetBits1S WGetBits1S
-#define GetBits1L WGetBits1L
-#define GetBits1U WGetBits1U
-
-#define GetBits2S GetBits1S Get1Bits (char2, tmpSrc) \
- c |= BitRight(tmpSrc, xoff2);
-#define GetBits2L GetBits1L Get1Bits (char2, tmpSrc) \
- c |= BitRight(tmpSrc, xoff2);
-#define GetBits2U GetBits1U Get1Bits (char2, tmpSrc) \
- c |= BitRight(tmpSrc, xoff2);
-
-#define GetBits3S GetBits2S Get1Bits (char3, tmpSrc) \
- c |= BitRight(tmpSrc, xoff3);
-#define GetBits3L GetBits2L Get1Bits (char3, tmpSrc) \
- c |= BitRight(tmpSrc, xoff3);
-#define GetBits3U GetBits2U Get1Bits (char3, tmpSrc) \
- c |= BitRight(tmpSrc, xoff3);
-
-#define GetBits4S GetBits3S Get1Bits (char4, tmpSrc) \
- c |= BitRight(tmpSrc, xoff4);
-#define GetBits4L GetBits3L Get1Bits (char4, tmpSrc) \
- c |= BitRight(tmpSrc, xoff4);
-#define GetBits4U GetBits3U Get1Bits (char4, tmpSrc) \
- c |= BitRight(tmpSrc, xoff4);
-
-#define GetBits5S GetBits4S Get1Bits (char5, tmpSrc) \
- c |= BitRight(tmpSrc, xoff5);
-#define GetBits5L GetBits4L Get1Bits (char5, tmpSrc) \
- c |= BitRight(tmpSrc, xoff5);
-#define GetBits5U GetBits4U Get1Bits (char5, tmpSrc) \
- c |= BitRight(tmpSrc, xoff5);
-
-#endif
-
-#ifdef USE_LEFTBITS
-extern CfbBits endtab[];
-
-#define IncChar(c) (c = (glyphPointer) (((char *) c) + glyphBytes))
-
-#define Get1Bits(ch,dst) glyphbits (ch, widthGlyph, glyphMask, dst); \
- IncChar (ch);
-
-#define glyphbits(bits,width,mask,dst) getleftbits(bits,width,dst); \
- dst &= mask;
-
-#define WGetBitsL Get1Bits(leftChar,c); \
- c = BitLeft (c, lshift);
-#define WGetBits1S Get1Bits (char1, c) \
- c = BitRight (c, xoff1);
-#define WGetBits1L WGetBitsL Get1Bits (char1, tmpSrc) \
- c |= BitRight (tmpSrc, xoff1);
-#define WGetBits1U Get1Bits (char1, c)
-
-#else
-#define WGetBitsL GetBitsL
-#define WGetBits1S GetBits1S
-#define WGetBits1L GetBits1L
-#define WGetBits1U GetBits1U
-#endif
-
-#if NGLYPHS == 2
-# define GetBitsNS GetBits2S
-# define GetBitsNL GetBits2L
-# define GetBitsNU GetBits2U
-# define LastChar char2
-#ifndef CFBTEGBLT8
-# define CFBTEGBLT8 cfbTEGlyphBlt8x2
-#endif
-#endif
-#if NGLYPHS == 3
-# define GetBitsNS GetBits3S
-# define GetBitsNL GetBits3L
-# define GetBitsNU GetBits3U
-# define LastChar char3
-#ifndef CFBTEGBLT8
-# define CFBTEGBLT8 cfbTEGlyphBlt8x3
-#endif
-#endif
-#if NGLYPHS == 4
-# define GetBitsNS GetBits4S
-# define GetBitsNL GetBits4L
-# define GetBitsNU GetBits4U
-# define LastChar char4
-#ifndef CFBTEGBLT8
-# define CFBTEGBLT8 cfbTEGlyphBlt8x4
-#endif
-#endif
-#if NGLYPHS == 5
-# define GetBitsNS GetBits5S
-# define GetBitsNL GetBits5L
-# define GetBitsNU GetBits5U
-# define LastChar char5
-#ifndef CFBTEGBLT8
-# define CFBTEGBLT8 cfbTEGlyphBlt8x5
-#endif
-#endif
-
-/* another ugly giant macro */
-#define SwitchEm switch (ew) \
- { \
- case 0: \
- break; \
- case 1: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 \
- Loop \
- } \
- break; \
- case 2: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) \
- Loop \
- } \
- break; \
- case 3: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step StoreBits(2) \
- Loop \
- } \
- break; \
- case 4: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step \
- StoreBits(2) Step StoreBits(3) \
- Loop \
- } \
- break; \
- case 5: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step \
- StoreBits(2) Step StoreBits(3) Step \
- StoreBits(4) \
- Loop \
- } \
- break; \
- case 6: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step \
- StoreBits(2) Step StoreBits(3) Step \
- StoreBits(4) Step StoreBits(5) \
- Loop \
- } \
- break; \
- case 7: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step \
- StoreBits(2) Step StoreBits(3) Step \
- StoreBits(4) Step StoreBits(5) Step \
- StoreBits(6) \
- Loop \
- } \
- break; \
- case 8: \
- while (hTmp--) { \
- GetBits; \
- StoreBits0 FirstStep StoreBits(1) Step \
- StoreBits(2) Step StoreBits(3) Step \
- StoreBits(4) Step StoreBits(5) Step \
- StoreBits(6) Step StoreBits(7) \
- Loop \
- } \
- break; \
- }
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-#define StorePixels(o,p) dst[o] = p
-#define Loop dst += widthDst;
-#else
-#define StorePixels(o,p) *dst++ = (p)
-#define Loop dst += widthLeft;
-#endif
-
-#define Step NextBitGroup(c);
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define StoreBits(o) StorePixels(o,GetPixelGroup(c));
-#define FirstStep Step
-#else
-#if PGSZ == 64
-#define StoreBits(o) StorePixels(o,cfb8Pixels[(c) & PGSZBMSK]);
-#define FirstStep Step
-#else /* PGSZ == 32 */
-#define StoreBits(o) StorePixels(o,*((CfbBits *) (((char *) cfb8Pixels) + (c & 0x3c))));
-#define FirstStep c = BitLeft (c, 2);
-#endif /* PGSZ */
-#endif /* BITMAP_BIT_ORDER */
-
-
-void
-CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int xInit, yInit;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- register CfbBits c;
- register CfbBits *dst;
- register CfbBits leftMask, rightMask;
- register int hTmp;
- register int xoff1;
- register glyphPointer char1;
- register glyphPointer char2;
-#if NGLYPHS >= 3
- register glyphPointer char3;
-#endif
-#if NGLYPHS >= 4
- register glyphPointer char4;
-#endif
-#if NGLYPHS >= 5
- register glyphPointer char5;
-#endif
-#ifdef ALL_LEFTBITS
- int xoff2, xoff3, xoff4, xoff5;
-#endif
-
- FontPtr pfont = pGC->font;
- CfbBits *dstLine;
- glyphPointer oldRightChar;
- CfbBits *pdstBase;
- glyphPointer leftChar;
- int widthDst;
-#ifndef FAST_CONSTANT_OFFSET_MODE
- int widthLeft;
-#endif
- int widthGlyph;
- int h;
- int ew;
- int x, y;
- BoxRec bbox; /* for clipping */
- int lshift;
- int widthGlyphs;
-#ifdef USE_LEFTBITS
- register CfbBits glyphMask;
- register CfbBits tmpSrc;
- register int glyphBytes;
-#endif
-
- widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
- if (!h)
- return;
- x = xInit + FONTMAXBOUNDS(pfont,leftSideBearing) + pDrawable->x;
- y = yInit - FONTASCENT(pfont) + pDrawable->y;
- bbox.x1 = x;
- bbox.x2 = x + (widthGlyph * nglyph);
- bbox.y1 = y;
- bbox.y2 = y + h;
-
- switch (RECT_IN_REGION(pGC->pScreen, cfbGetCompositeClip(pGC), &bbox))
- {
- case rgnPART:
- cfbImageGlyphBlt8(pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
- case rgnOUT:
- return;
- }
-
- if (!cfb8CheckPixels (pGC->fgPixel, pGC->bgPixel))
- cfb8SetPixels (pGC->fgPixel, pGC->bgPixel);
-
- leftChar = 0;
-
- cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase)
-
-#if NGLYPHS == 2
- widthGlyphs = widthGlyph << 1;
-#else
-#if NGLYPHS == 4
- widthGlyphs = widthGlyph << 2;
-#else
- widthGlyphs = widthGlyph * NGLYPHS;
-#endif
-#endif
-
-#ifdef USE_LEFTBITS
- glyphMask = endtab[widthGlyph];
- glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
-#endif
-
- pdstBase += y * widthDst;
-#ifdef DO_COMMON
- if (widthGlyphs <= 32)
-#endif
- while (nglyph >= NGLYPHS)
- {
- nglyph -= NGLYPHS;
- hTmp = h;
- dstLine = pdstBase + (x >> PWSH);
- xoff1 = x & PIM;
- char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
- char2 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
-#ifdef ALL_LEFTBITS
- xoff2 = xoff1 + widthGlyph;
-#endif
-#if NGLYPHS >= 3
- char3 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
-#ifdef ALL_LEFTBITS
- xoff3 = xoff2 + widthGlyph;
-#endif
-#endif
-#if NGLYPHS >= 4
- char4 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
-#ifdef ALL_LEFTBITS
- xoff4 = xoff3 + widthGlyph;
-#endif
-#endif
-#if NGLYPHS >= 5
- char5 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
-#ifdef ALL_LEFTBITS
- xoff5 = xoff4 + widthGlyph;
-#endif
-#endif
- oldRightChar = LastChar;
- dst = dstLine;
- if (xoff1)
- {
- ew = ((widthGlyphs - (PGSZB - xoff1)) >> PWSH) + 1;
-#ifndef FAST_CONSTANT_OFFSET_MODE
- widthLeft = widthDst - ew;
-#endif
- if (!leftChar)
- {
- leftMask = cfbendtab[xoff1];
- rightMask = cfbstarttab[xoff1];
-
-#define StoreBits0 StorePixels (0, (dst[0] & leftMask) | \
- (GetPixelGroup(c) & rightMask));
-#define GetBits GetBitsNS
-
- SwitchEm
-
-#undef GetBits
-#undef StoreBits0
-
- }
- else
- {
- lshift = widthGlyph - xoff1;
-
-#define StoreBits0 StorePixels (0,GetPixelGroup(c));
-#define GetBits GetBitsNL
-
- SwitchEm
-
-#undef GetBits
-#undef StoreBits0
-
- }
- }
- else
- {
-#if NGLYPHS == 4 && PGSZ == 32
- ew = widthGlyph; /* widthGlyphs >> 2 */
-#else
- ew = widthGlyphs >> PWSH;
-#endif
-#ifndef FAST_CONSTANT_OFFSET_MODE
- widthLeft = widthDst - ew;
-#endif
-
-#define StoreBits0 StorePixels (0,GetPixelGroup(c));
-#define GetBits GetBitsNU
-
- SwitchEm
-
-#undef GetBits
-#undef StoreBits0
-
- }
- x += widthGlyphs;
- leftChar = oldRightChar;
- }
- while (nglyph--)
- {
- xoff1 = x & PIM;
- char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++);
- hTmp = h;
- dstLine = pdstBase + (x >> PWSH);
- oldRightChar = char1;
- dst = dstLine;
- if (xoff1)
- {
- ew = ((widthGlyph - (PGSZB - xoff1)) >> PWSH) + 1;
-#ifndef FAST_CONSTANT_OFFSET_MODE
- widthLeft = widthDst - ew;
-#endif
- if (!leftChar)
- {
- leftMask = cfbendtab[xoff1];
- rightMask = cfbstarttab[xoff1];
-
-#define StoreBits0 StorePixels (0, (dst[0] & leftMask) | \
- (GetPixelGroup(c) & rightMask));
-#define GetBits WGetBits1S
-
- SwitchEm
-#undef GetBits
-#undef StoreBits0
-
- }
- else
- {
- lshift = widthGlyph - xoff1;
-
-#define StoreBits0 StorePixels (0,GetPixelGroup(c));
-#define GetBits WGetBits1L
-
- SwitchEm
-#undef GetBits
-#undef StoreBits0
-
- }
- }
- else
- {
- ew = widthGlyph >> PWSH;
-
-#ifndef FAST_CONSTANT_OFFSET_MODE
- widthLeft = widthDst - ew;
-#endif
-
-#define StoreBits0 StorePixels (0,GetPixelGroup(c));
-#define GetBits WGetBits1U
-
- SwitchEm
-
-#undef GetBits
-#undef StoreBits0
-
- }
- x += widthGlyph;
- leftChar = oldRightChar;
- }
- /*
- * draw the tail of the last character
- */
- xoff1 = x & PIM;
- if (xoff1)
- {
- rightMask = cfbstarttab[xoff1];
- leftMask = cfbendtab[xoff1];
- lshift = widthGlyph - xoff1;
- dst = pdstBase + (x >> PWSH);
- hTmp = h;
- while (hTmp--)
- {
- GetBitsL;
- *dst = (*dst & rightMask) | (GetPixelGroup(c) & leftMask);
- dst += widthDst;
- }
- }
-}
-#endif /* PSZ == 8 */
diff --git a/cfb/cfbtegblt.c b/cfb/cfbtegblt.c
deleted file mode 100644
index 7450c7829..000000000
--- a/cfb/cfbtegblt.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* $Xorg: cfbtegblt.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "mi.h"
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= 32 bits wide, on an
- arbitrarily deep display. Use cfbTEGlyphBlt8 for 8 bit displays.
-
- This should be called only with a terminal-emulator font;
-this means that the FIXED_METRICS flag is set, and that
-glyphbounds == charbounds.
-
- in theory, this goes faster; even if it doesn't, it reduces the
-flicker caused by writing a string over itself with image text (since
-the background gets repainted per character instead of per string.)
-this seems to be important for some converted X10 applications.
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
-*/
-
-void
-cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- FontPtr pfont = pGC->font;
- int widthDst;
- CfbBits *pdstBase; /* pointer to longword with top row
- of current glyph */
-
- int w; /* width of glyph and char */
- int h; /* height of glyph and char */
- register int xpos=x; /* current x%32 */
- int ypos=y; /* current y%32 */
- register unsigned char *pglyph;
- int widthGlyph;
-
- register CfbBits *pdst;/* pointer to current longword in dst */
- int hTmp; /* counter for height */
- BoxRec bbox; /* for clipping */
-
- register int wtmp,xtemp,width;
- CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp;
-#if PSZ != 24
- int tmpx;
-#endif
-
- xpos += pDrawable->x;
- ypos += pDrawable->y;
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- wtmp = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
- widthGlyph = GLYPHWIDTHBYTESPADDED(*ppci);
-
- xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
- ypos -= FONTASCENT(pfont);
-
- bbox.x1 = xpos;
- bbox.x2 = xpos + (wtmp * nglyph);
- bbox.y1 = ypos;
- bbox.y2 = ypos + h;
-
- fgfill = PFILL(pGC->fgPixel);
- bgfill = PFILL(pGC->bgPixel);
-
- switch (RECT_IN_REGION(pGC->pScreen, cfbGetCompositeClip(pGC), &bbox))
- {
- case rgnOUT:
- break;
- case rgnPART:
- /* this is the WRONG thing to do, but it works.
- calling the non-terminal text is easy, but slow, given
- what we know about the font.
-
- the right thing to do is something like:
- for each clip rectangle
- compute at which row the glyph starts to be in it,
- and at which row the glyph ceases to be in it
- compute which is the first glyph inside the left
- edge, and the last one inside the right edge
- draw a fractional first glyph, using only
- the rows we know are in
- draw all the whole glyphs, using the appropriate rows
- draw any pieces of the last glyph, using the right rows
-
- this way, the code would take advantage of knowing that
- all glyphs are the same height and don't overlap.
-
- one day...
- */
- cfbImageGlyphBlt8(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- break;
- case rgnIN:
-
- pdtmp = pdstBase + (widthDst * ypos);
- while(nglyph--)
- {
-
- pglyph = FONTGLYPHBITS(pglyphBase, *ppci++);
- pdst = pdtmp;
- hTmp = h;
-
- while (hTmp--)
- {
- x = xpos;
- width = wtmp;
- xtemp = 0;
-
- while (width > 0)
- {
-#if PSZ == 24
- w = 1;
- ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2));
- getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp);
- getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp);
-#else
- tmpx = x & PIM;
- w = min(width, PPW - tmpx);
- w = min(w, (PGSZ - xtemp));
- ptemp = (CfbBits *)(pglyph + (xtemp >> MFB_PWSH));
- getstipplepixels(ptemp,xtemp,w,0,&bgfill,&tmpDst1);
- getstipplepixels(ptemp,xtemp,w,1,&fgfill,&tmpDst2);
-#endif
-
- {
- CfbBits tmpDst = tmpDst1 | tmpDst2;
-#if PSZ == 24
- CfbBits *pdsttmp = pdst + ((x*3) >> 2);
- putbits24(tmpDst,w,pdsttmp,pGC->planemask,x);
-#else
- CfbBits *pdsttmp = pdst + (x >> PWSH);
- putbits(tmpDst,tmpx,w,pdsttmp,pGC->planemask);
-#endif
- }
- x += w;
- xtemp += w;
- width -= w;
- }
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- xpos += wtmp;
- }
- break;
- }
-}
diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c
deleted file mode 100644
index b202943e8..000000000
--- a/cfb/cfbtile32.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow.
- * no depth dependencies.
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $Xorg: cfbtile32.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-#include "mergerop.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-#ifdef sparc
-#define SHARED_IDCACHE
-#endif
-
-#if PSZ == 24
-#define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p)))
-/*#define STORE24(p,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(p) = (((MROP_PREBUILT_SOLID(srcpix,*(p))<<cfb24Shift[idx])&cfbmask[idx])| \
- (*(p)&cfbrmask[idx])); \
- idx++; \
- (p)++; \
- *(p) = (((MROP_PREBUILT_SOLID(srcpix,*(p))>>cfb24Shift[idx])&cfbmask[idx])| \
- (*(p)&cfbrmask[idx])); \
- (p)--; \
- }*/
-#define STORE24(p,index) MROP_PREBUILT_SOLID24(srcpix, (p), index)
-
-#define STORE_MASK(p,mask) (*(p) = MROP_PREBUILT_MASK(srcpix,*(p),(mask)))
-#define QSTORE(p) ((*(p) = MROP_PREBUILT_SOLID(((srcpix<<24)|srcpix),*(p))), \
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)),*(p))), \
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)),*(p))))
-
-#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE)
-# define Expand(left,right) {\
- int part = nlwMiddle & ((PGSZB*2)-1); \
- nlwMiddle *= 3; \
- nlwMiddle >>= PWSH + 3; \
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0; \
- left \
- p += part; \
- switch (part) { \
- case 7: \
- STORE24(p - 7, xtmp - 7); \
- case 6: \
- STORE24(p - 6, xtmp - 6); \
- case 5: \
- STORE24(p - 5, xtmp - 5); \
- case 4: \
- STORE24(p - 4, xtmp - 4); \
- case 3: \
- STORE24(p - 3, xtmp - 3); \
- case 2: \
- STORE24(p - 2, xtmp - 2); \
- case 1: \
- STORE24(p - 1, xtmp - 1); \
- } \
- nlw = nlwMiddle; \
- while (nlw) { \
- STORE24 (p + 0, xtmp + 0); \
- STORE24 (p + 1, xtmp + 1); \
- STORE24 (p + 2, xtmp + 2); \
- STORE24 (p + 3, xtmp + 3); \
- STORE24 (p + 4, xtmp + 4); \
- STORE24 (p + 5, xtmp + 5); \
- STORE24 (p + 6, xtmp + 6); \
- STORE24 (p + 7, xtmp + 7); \
- p += 8; \
- xtmp += 8; \
- nlw--; \
- } \
- right \
- p += nlwExtra; \
- } \
-}
-#else
-#define Expand(left,right) {\
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0; \
- left \
- while (nlw--) \
- { \
- STORE24(p,xtmp); \
- if(xtmp&3) p++; \
- xtmp++; \
- } \
- right \
- p += nlwExtra; \
- } \
-}
-#endif
-#else /*PSZ != 24*/
-#define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p)))
-
-#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE)
-# define Expand(left,right) {\
- int part = nlwMiddle & ((PGSZB*2)-1); \
- nlwMiddle >>= PWSH + 1; \
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0; \
- left \
- p += part; \
- switch (part) { \
- case 7: \
- STORE(p - 7); \
- case 6: \
- STORE(p - 6); \
- case 5: \
- STORE(p - 5); \
- case 4: \
- STORE(p - 4); \
- case 3: \
- STORE(p - 3); \
- case 2: \
- STORE(p - 2); \
- case 1: \
- STORE(p - 1); \
- } \
- nlw = nlwMiddle; \
- while (nlw) { \
- STORE (p + 0); \
- STORE (p + 1); \
- STORE (p + 2); \
- STORE (p + 3); \
- STORE (p + 4); \
- STORE (p + 5); \
- STORE (p + 6); \
- STORE (p + 7); \
- p += 8; \
- nlw--; \
- } \
- right \
- p += nlwExtra; \
- } \
-}
-#else
-#define Expand(left,right) {\
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0; \
- left \
- nlw = nlwMiddle; \
- while (nlw--) \
- { \
- STORE(p); \
- p++; \
- } \
- right \
- p += nlwExtra; \
- } \
-}
-#endif
-#endif /*PSZ == 24*/
-
-void
-MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox; /* number of boxes to fill */
- BoxPtr pBox; /* pointer to list of boxes to fill */
-{
- register CfbBits srcpix;
- CfbBits *psrc; /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
-
- int nlwDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- register int h; /* height of current box */
- register CfbBits startmask;
- register CfbBits endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int nlw = 0; /* loop version of nlwMiddle */
- register CfbBits *p; /* pointer to bits we're writing */
- int y; /* current scan line */
- int srcy; /* current tile position */
-
- CfbBits *pbits;/* pointer to start of pixmap */
- PixmapPtr tile; /* rotated, expanded tile */
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop()
-#else
- MROP_DECLARE_REG()
-#endif
- MROP_PREBUILT_DECLARE()
-#if PSZ == 24
- CfbBits xtmp;
-#endif
-
- tile = pGC->pRotatedPixmap;
- tileHeight = tile->drawable.height;
- psrc = (CfbBits *)tile->devPrivate.ptr;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop(pGC->alu, pGC->planemask);
-#else
- MROP_INITIALIZE(pGC->alu, pGC->planemask);
-#endif
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
-#if PSZ == 24
- xtmp = pBox->x1;
- p = pbits + (y * nlwDst) + ((pBox->x1*3) >> 2);
-/* p = pbits + (y * nlwDst) + ((pBox->x1>> 2)*3);*/
-#else
- p = pbits + (y * nlwDst) + (pBox->x1 >> PWSH);
-#endif
- srcy = y % tileHeight;
-
-#if PSZ == 24
- if (w == 1 && ((pBox->x1 & 3) == 0 || (pBox->x1 & 3) == 3))
-#else
- if ( ((pBox->x1 & PIM) + w) <= PPW)
-#endif
- {
- maskpartialbits(pBox->x1, w, startmask);
- nlwExtra = nlwDst;
- while (h--)
- {
- srcpix = psrc[srcy];
- MROP_PREBUILD(srcpix);
- ++srcy;
- if (srcy == tileHeight)
- srcy = 0;
- *p = MROP_PREBUILT_MASK (srcpix, *p, startmask);
- p += nlwExtra;
- }
- }
- else
- {
- maskbits(pBox->x1, w, startmask, endmask, nlwMiddle);
- nlwExtra = nlwDst - nlwMiddle;
-
- if (startmask)
- {
- nlwExtra -= 1;
- if (endmask)
- {
- Expand(*p = MROP_PREBUILT_MASK(srcpix, *p, startmask); p++;,
- *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);)
- }
- else
- {
- Expand(*p = MROP_PREBUILT_MASK(srcpix, *p, startmask); p++;,
- ;)
- }
- }
- else
- {
- if (endmask)
- {
- Expand(;,
- *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);)
- }
- else
- {
- Expand(;,
- ;)
- }
- }
- }
- pBox++;
- }
-}
-
-void
-MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidth;/* pointer to list of n widths */
- CfbBits *pbits; /* pointer to start of bitmap */
- int nlwDst; /* width in longwords of bitmap */
- register CfbBits *p; /* pointer to current longword in bitmap */
- register int w; /* current span width */
- register int nlw;
- register int x;
- register CfbBits startmask;
- register CfbBits endmask;
- register CfbBits srcpix;
- int y;
- int *pwidthFree;/* copies of the pointers to free */
- DDXPointPtr pptFree;
- PixmapPtr tile;
- CfbBits *psrc; /* pointer to bits in tile */
- int tileHeight;/* height of the tile */
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop()
-#else
- MROP_DECLARE_REG()
-#endif
- MROP_PREBUILT_DECLARE()
-#if PSZ == 24
- CfbBits xtmp;
-#endif
-
- n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) );
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans( cfbGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- tile = pGC->pRotatedPixmap;
- tileHeight = tile->drawable.height;
- psrc = (CfbBits *)tile->devPrivate.ptr;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop(pGC->alu, pGC->planemask);
-#else
- MROP_INITIALIZE(pGC->alu, pGC->planemask);
-#endif
-
- cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
-
-#if MROP == Mcopy
- if (!(tileHeight & (tileHeight-1)))
- {
- tileHeight--;
- while (n--)
- {
- x = ppt->x;
- y = ppt->y;
- ++ppt;
- w = *pwidth++;
-#if PSZ == 24
-/* p = pbits + (y * nlwDst) + ((x*3) >> 2);*/
- xtmp = x;
- p = pbits + (y * nlwDst) + ((x >> 2)*3);
-#else
- p = pbits + (y * nlwDst) + (x >> PWSH);
-#endif
- srcpix = psrc[y & tileHeight];
- MROP_PREBUILD(srcpix);
-
-#if PSZ == 24
- if ((x & 3) + w < 5)
-#else
- if ((x & PIM) + w < PPW)
-#endif
- {
- maskpartialbits(x, w, startmask);
- *p = MROP_PREBUILT_MASK (srcpix, *p, startmask);
- }
- else
- {
- maskbits(x, w, startmask, endmask, nlw);
- if (startmask)
- {
- *p = MROP_PREBUILT_MASK(srcpix, *p, startmask);
-#if PSZ == 24
- if(xtmp&3) p++;
- xtmp++;
-#else
- p++;
-#endif
- }
- while (nlw--)
- {
-#if PSZ == 24
- STORE24(p,xtmp);
- if(xtmp&3) p++;
- ++xtmp;
-#else
- STORE(p);
- ++p;
-#endif
- }
- if (endmask)
- {
- *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);
- }
- }
- }
- }
- else
-#endif
- {
- while (n--)
- {
- x = ppt->x;
- y = ppt->y;
- ++ppt;
- w = *pwidth++;
-#if PSZ == 24
-/* p = pbits + (y * nlwDst) + ((x *3)>> 2);*/
- p = pbits + (y * nlwDst) + ((x >> 2)*3);
- xtmp = x;
-#else
- p = pbits + (y * nlwDst) + (x >> PWSH);
-#endif
- srcpix = psrc[y % tileHeight];
- MROP_PREBUILD(srcpix);
-
-#if PSZ == 24
- if ((x & 3) + w < 5)
-#else
- if ((x & PIM) + w < PPW)
-#endif
- {
- maskpartialbits(x, w, startmask);
- *p = MROP_PREBUILT_MASK (srcpix, *p, startmask);
- }
- else
- {
- maskbits(x, w, startmask, endmask, nlw);
- if (startmask)
- {
- *p = MROP_PREBUILT_MASK(srcpix, *p, startmask);
-#if PSZ == 24
- if(xtmp&3)p++;
- xtmp++;
-#else
- p++;
-#endif
- }
- while (nlw--)
- {
-#if PSZ == 24
- STORE24(p,xtmp);
- if(xtmp&3)p++;
- xtmp++;
-#else
- STORE(p);
- ++p;
-#endif
- }
- if (endmask)
- {
- *p = MROP_PREBUILT_MASK(srcpix, *p, endmask);
- }
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/cfb/cfbtileodd.c b/cfb/cfbtileodd.c
deleted file mode 100644
index e372fe87d..000000000
--- a/cfb/cfbtileodd.c
+++ /dev/null
@@ -1,1243 +0,0 @@
-/*
- * Fill odd tiled rectangles and spans.
- * no depth dependencies.
- */
-/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $Xorg: cfbtileodd.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-#include "mergerop.h"
-
-#if PSZ == 24
-#define LEFTSHIFT_AMT (3)
-#else /* PSZ != 24 */
-#define LEFTSHIFT_AMT (5 - PWSH)
-#endif /* PSZ == 24*/
-
-#define LastTileBits {\
- tmp = bits; \
- if (tileEndPart) \
- bits = (*pSrc & tileEndMask) | BitRight (*pSrcLine, tileEndLeftShift); \
- else \
- bits = *pSrc; \
-}
-
-#if PSZ == 24
-#define ResetTileBits {\
- pSrc = pSrcLine; \
- nlwSrc = widthSrc;\
- if (tileEndPart) { \
- if (4 - xoff + tileEndPart <= 4) {\
- bits = *pSrc++; \
- nlwSrc--; \
- } else \
- bits = BitLeft(tmp, tileEndLeftShift) | \
- BitRight(bits, tileEndRightShift); \
- xoff = (xoff + xoffStep) & 3; \
- leftShift = xoff << LEFTSHIFT_AMT; \
- rightShift = PGSZ - leftShift; \
- }\
-}
-#else
-#define ResetTileBits {\
- pSrc = pSrcLine; \
- nlwSrc = widthSrc;\
- if (tileEndPart) { \
- if (PPW - xoff + tileEndPart <= PPW) {\
- bits = *pSrc++; \
- nlwSrc--; \
- } else \
- bits = BitLeft(tmp, tileEndLeftShift) | \
- BitRight(bits, tileEndRightShift); \
- xoff = (xoff + xoffStep) & PIM; \
- leftShift = xoff << LEFTSHIFT_AMT; \
- rightShift = PGSZ - leftShift; \
- }\
-}
-#endif
-
-#define NextTileBits {\
- if (nlwSrc == 1) {\
- LastTileBits\
- } else { \
- if (nlwSrc == 0) {\
- ResetTileBits\
- } \
- if (nlwSrc == 1) {\
- LastTileBits\
- } else {\
- tmp = bits; \
- bits = *pSrc++; \
- }\
- }\
- nlwSrc--; \
-}
-
-void
-MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- register BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* tile */
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile in pixels */
- int tileHeight; /* height of the tile */
- int widthSrc;
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- int h; /* height of current box */
- CfbBits startmask;
- CfbBits endmask;/* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwSrc; /* number of whole longwords in source */
-
- register int nlw; /* loop version of nlwMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int xoffDst, xoffSrc;
- int leftShift, rightShift;
-
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop24()
-#else
- MROP_DECLARE_REG()
-#endif
-
- CfbBits *pdstBase; /* pointer to start of dest */
- CfbBits *pDstLine; /* poitner to start of dest box */
- CfbBits *pSrcBase; /* pointer to start of source */
- CfbBits *pSrcLine; /* pointer to start of source line */
- register CfbBits *pDst;
- register CfbBits *pSrc;
- register CfbBits bits, tmp = 0;
- int xoffStart, xoff;
- int leftShiftStart, rightShiftStart, nlwSrcStart;
- CfbBits tileEndMask;
- int tileEndLeftShift, tileEndRightShift;
- int xoffStep;
- int tileEndPart;
- int needFirst;
- CfbBits narrow[2];
- CfbBits narrowMask = 0;
- int narrowShift = 0;
- Bool narrowTile;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop24 (alu, planemask)
-#else
- MROP_INITIALIZE (alu, planemask)
-#endif
-
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / PGSZB;
- narrowTile = FALSE;
- if (widthSrc == 1)
- {
- narrowShift = tileWidth;
- narrowMask = cfbendpartial [tileWidth];
- tileWidth *= 2;
- widthSrc = 2;
- narrowTile = TRUE;
- }
- pSrcBase = (CfbBits *)tile->devPrivate.ptr;
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
-#if PSZ == 24
- tileEndPart = (4 - tileWidth) & 3;
- tileEndMask = cfbendpartial[tileWidth & 3];
-#else
- tileEndPart = tileWidth & PIM;
- tileEndMask = cfbendpartial[tileEndPart];
-#endif /* PSZ == 24 */
- tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT;
- tileEndRightShift = PGSZ - tileEndLeftShift;
-#if PSZ == 24
- xoffStep = 4 - tileEndPart;
-#else
- xoffStep = PPW - tileEndPart;
-#endif /* PSZ == 24 */
- /*
- * current assumptions: tile > 32 bits wide.
- */
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- modulus (pBox->x1 - xrot, tileWidth, srcx);
- modulus (pBox->y1 - yrot, tileHeight, srcy);
-#if PSZ == 24
- xoffDst = (4 - pBox->x1) & 3;
- if (w == 1 && (xoffDst == 0 || xoffDst == 1))
-#else
- xoffDst = pBox->x1 & PIM;
- if (xoffDst + w < PPW)
-#endif
- {
- maskpartialbits(pBox->x1, w, startmask);
- endmask = 0;
- nlwMiddle = 0;
- }
- else
- {
- maskbits (pBox->x1, w, startmask, endmask, nlwMiddle)
- }
-#if PSZ == 24
- pDstLine = pdstBase + (pBox->y1 * widthDst) + ((pBox->x1*3) >> 2);
-#else
- pDstLine = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH);
-#endif
- pSrcLine = pSrcBase + (srcy * widthSrc);
-#if PSZ == 24
- xoffSrc = (4 - srcx) & 3;
-#else
- xoffSrc = srcx & PIM;
-#endif
- if (xoffSrc >= xoffDst)
- {
- xoffStart = xoffSrc - xoffDst;
- needFirst = 1;
- }
- else
- {
-#if PSZ == 24
- xoffStart = 4 - (xoffDst - xoffSrc);
-#else
- xoffStart = PPW - (xoffDst - xoffSrc);
-#endif
- needFirst = 0;
- }
- leftShiftStart = (xoffStart) << LEFTSHIFT_AMT;
- rightShiftStart = PGSZ - leftShiftStart;
-#if PSZ == 24
- nlwSrcStart = widthSrc - ((srcx*3) >> 2);
-#else
- nlwSrcStart = widthSrc - (srcx >> PWSH);
-#endif
- while (h--)
- {
- /* XXX only works when narrowShift >= PPW/2 */
- if (narrowTile)
- {
- tmp = pSrcBase[srcy] & narrowMask; /* source width == 1 */
- narrow[0] = tmp | SCRRIGHT (tmp, narrowShift);
-#if PSZ == 24
- narrow[1] = BitLeft (tmp, 8) |
- BitRight(tmp, 16);
-#else
- narrow[1] = SCRLEFT (tmp, PPW - narrowShift) |
- SCRRIGHT(tmp, 2 * narrowShift - PPW);
-#endif
- pSrcLine = narrow;
- }
- xoff = xoffStart;
- leftShift = leftShiftStart;
- rightShift = rightShiftStart;
- nlwSrc = nlwSrcStart;
-#if PSZ == 24
- pSrc = pSrcLine + ((srcx * 3) >> 2);
-#else
- pSrc = pSrcLine + (srcx >> PWSH);
-#endif
- pDst = pDstLine;
- bits = 0;
- if (needFirst)
- {
- NextTileBits
- }
- if (startmask)
- {
- NextTileBits
- tmp = BitLeft(tmp, leftShift);
- if (rightShift != PGSZ)
- tmp |= BitRight(bits,rightShift);
- *pDst = MROP_MASK (tmp, *pDst, startmask);
- ++pDst;
- }
- nlw = nlwMiddle;
- while (nlw)
- {
-#if MROP == Mcopy
- if (nlwSrc > 1)
- {
- int nlwPart = nlw;
-
- if (nlwPart >= nlwSrc)
- nlwPart = nlwSrc - 1;
- nlw -= nlwPart;
- nlwSrc -= nlwPart;
- if (rightShift != PGSZ)
- {
- while (nlwPart--)
- {
- tmp = bits;
- bits = *pSrc++;
- *pDst = MROP_SOLID(BitLeft(tmp, leftShift) |
- BitRight (bits, rightShift),
- *pDst);
- ++pDst;
- }
- }
- else
- {
- if (nlwPart)
- {
- *pDst = MROP_SOLID (bits, *pDst);
- ++pDst;
- nlwPart--;
- while (nlwPart--)
- {
- *pDst = MROP_SOLID(*pSrc, *pDst);
- ++pDst; ++pSrc;
- }
- bits = *pSrc++;
- }
- }
- }
- else
-#endif
- {
- NextTileBits
- if (rightShift != PGSZ)
- {
- *pDst = MROP_SOLID(BitLeft(tmp, leftShift) |
- BitRight(bits, rightShift),
- *pDst);
- }
- else
- {
- *pDst = MROP_SOLID (tmp, *pDst);
- }
- ++pDst;
- nlw--;
- }
- }
- if (endmask)
- {
- NextTileBits
- if (rightShift == PGSZ)
- bits = 0;
- *pDst = MROP_MASK (BitLeft(tmp, leftShift) |
- BitRight(bits,rightShift),
- *pDst, endmask);
- }
- pDstLine += widthDst;
- pSrcLine += widthSrc;
- if (++srcy == tileHeight)
- {
- srcy = 0;
- pSrcLine = pSrcBase;
- }
- }
- pBox++;
- }
-}
-
-void
-MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int n;
- DDXPointPtr ppt;
- int *pwidth;
- PixmapPtr tile;
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile in pixels */
- int tileHeight; /* height of the tile */
- int widthSrc;
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current span */
- CfbBits startmask;
- CfbBits endmask; /* masks for reggedy bits at either end of line */
- int nlwSrc; /* number of whole longwords in source */
-
- register int nlw; /* loop version of nlwMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int xoffDst, xoffSrc;
- int leftShift, rightShift;
-
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop24()
-#else
- MROP_DECLARE_REG()
-#endif
-
- CfbBits *pdstBase; /* pointer to start of dest */
- CfbBits *pDstLine; /* poitner to start of dest box */
- CfbBits *pSrcBase; /* pointer to start of source */
- CfbBits *pSrcLine; /* pointer to start of source line */
- register CfbBits *pDst;
- register CfbBits *pSrc;
- register CfbBits bits, tmp = 0;
- int xoffStart, xoff;
- int leftShiftStart, rightShiftStart, nlwSrcStart;
- CfbBits tileEndMask;
- int tileEndLeftShift, tileEndRightShift;
- int xoffStep;
- int tileEndPart;
- int needFirst;
- CfbBits narrow[2];
- CfbBits narrowMask = 0;
- int narrowShift = 0;
- Bool narrowTile;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop24 (alu, planemask)
-#else
- MROP_INITIALIZE (alu, planemask)
-#endif
-
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / PGSZB;
- narrowTile = FALSE;
- if (widthSrc == 1)
- {
- narrowShift = tileWidth;
- narrowMask = cfbendpartial [tileWidth];
- tileWidth *= 2;
- widthSrc = 2;
- narrowTile = TRUE;
- }
- pSrcBase = (CfbBits *)tile->devPrivate.ptr;
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
-#if PSZ == 24
- tileEndPart = (4 - tileWidth) & 3;
- tileEndMask = cfbendpartial[tileWidth & 3];
-#else
- tileEndPart = tileWidth & PIM;
- tileEndMask = cfbendpartial[tileEndPart];
-#endif
- tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT;
- tileEndRightShift = PGSZ - tileEndLeftShift;
-#if PSZ == 24
- xoffStep = 4 - tileEndPart;
-#else
- xoffStep = PPW - tileEndPart;
-#endif
- while (n--)
- {
- w = *pwidth++;
- modulus (ppt->x - xrot, tileWidth, srcx);
- modulus (ppt->y - yrot, tileHeight, srcy);
-#if PSZ == 24
- xoffDst = (4 - ppt->x) & 3;
- if (w == 1 && (xoffDst == 0 || xoffDst == 1))
-#else
- xoffDst = ppt->x & PIM;
- if (xoffDst + w < PPW)
-#endif
- {
- maskpartialbits(ppt->x, w, startmask);
- endmask = 0;
- nlw = 0;
- }
- else
- {
- maskbits (ppt->x, w, startmask, endmask, nlw)
- }
-#if PSZ == 24
- pDstLine = pdstBase + (ppt->y * widthDst) + ((ppt->x *3)>> 2);
-#else
- pDstLine = pdstBase + (ppt->y * widthDst) + (ppt->x >> PWSH);
-#endif
- pSrcLine = pSrcBase + (srcy * widthSrc);
-#if PSZ == 24
- xoffSrc = (4 - srcx) & 3;
-#else
- xoffSrc = srcx & PIM;
-#endif
- if (xoffSrc >= xoffDst)
- {
- xoffStart = xoffSrc - xoffDst;
- needFirst = 1;
- }
- else
- {
-#if PSZ == 24
- xoffStart = 4 - (xoffDst - xoffSrc);
-#else
- xoffStart = PPW - (xoffDst - xoffSrc);
-#endif
- needFirst = 0;
- }
- leftShiftStart = (xoffStart) << LEFTSHIFT_AMT;
- rightShiftStart = PGSZ - leftShiftStart;
-#if PSZ == 24
- nlwSrcStart = widthSrc - ((srcx*3) >> 2);
-#else
- nlwSrcStart = widthSrc - (srcx >> PWSH);
-#endif
- /* XXX only works when narrowShift >= PPW/2 */
- if (narrowTile)
- {
- tmp = pSrcBase[srcy] & narrowMask; /* source width == 1 */
- narrow[0] = tmp | SCRRIGHT (tmp, narrowShift);
-#if PSZ == 24
- narrow[1] = BitLeft (tmp, 8) |
- BitRight(tmp, 16);
-#else
- narrow[1] = SCRLEFT (tmp, PPW - narrowShift) |
- SCRRIGHT(tmp, 2 * narrowShift - PPW);
-#endif
- pSrcLine = narrow;
- }
- xoff = xoffStart;
- leftShift = leftShiftStart;
- rightShift = rightShiftStart;
- nlwSrc = nlwSrcStart;
-#if PSZ == 24
- pSrc = pSrcLine + ((srcx * 3) >> 2);
-#else
- pSrc = pSrcLine + (srcx >> PWSH);
-#endif
- pDst = pDstLine;
- bits = 0;
- if (needFirst)
- {
- NextTileBits
- }
- if (startmask)
- {
- NextTileBits
- tmp = BitLeft(tmp, leftShift);
- if (rightShift != PGSZ)
- tmp |= BitRight(bits,rightShift);
- *pDst = MROP_MASK (tmp, *pDst, startmask);
- ++pDst;
- }
- while (nlw)
- {
-#if MROP == Mcopy
- if (nlwSrc > 1)
- {
- int nlwPart = nlw;
-
- if (nlwPart >= nlwSrc)
- nlwPart = nlwSrc - 1;
- nlw -= nlwPart;
- nlwSrc -= nlwPart;
- if (rightShift != PGSZ)
- {
- while (nlwPart--)
- {
- tmp = bits;
- bits = *pSrc++;
- *pDst = MROP_SOLID(BitLeft(tmp, leftShift) |
- BitRight (bits, rightShift),
- *pDst);
- ++pDst;
- }
- }
- else
- {
- if (nlwPart)
- {
- *pDst = MROP_SOLID (bits, *pDst);
- ++pDst;
- nlwPart--;
- while (nlwPart--)
- {
- *pDst = MROP_SOLID(*pSrc, *pDst);
- ++pDst; ++pSrc;
- }
- bits = *pSrc++;
- }
- }
- }
- else
-#endif
- {
- NextTileBits
- if (rightShift != PGSZ)
- {
- *pDst = MROP_SOLID(BitLeft(tmp, leftShift) |
- BitRight(bits, rightShift),
- *pDst);
- ++pDst;
- }
- else
- {
- *pDst = MROP_SOLID (tmp, *pDst);
- ++pDst;
- }
- nlw--;
- }
- }
- if (endmask)
- {
- NextTileBits
- if (rightShift == PGSZ)
- bits = 0;
- *pDst = MROP_MASK (BitLeft(tmp, leftShift) |
- BitRight(bits,rightShift),
- *pDst, endmask);
- }
- ppt++;
- }
-}
-
-# include "fastblt.h"
-
-#define IncSrcPtr psrc++; if (!--srcRemaining) { srcRemaining = widthSrc; psrc = psrcStart; }
-
-void
-MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- register BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* tile */
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile */
- int tileHeight; /* height of the tile */
- int widthSrc; /* width in longwords of the source tile */
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- int h; /* height of current box */
- CfbBits startmask;
- CfbBits endmask;/* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
-
- register int nl; /* loop version of nlMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int srcRemaining; /* number of longwords remaining in source */
- int xoffDst, xoffSrc;
- int srcStart; /* number of longwords source offset at left of box */
- int leftShift, rightShift;
-
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop24()
-#else
- MROP_DECLARE_REG()
-#endif
-
- CfbBits *pdstBase; /* pointer to start of dest */
- CfbBits *pdstLine; /* poitner to start of dest box */
- CfbBits *psrcBase; /* pointer to start of source */
- CfbBits *psrcLine; /* pointer to fetch point of source */
- CfbBits *psrcStart; /* pointer to start of source line */
- register CfbBits *pdst;
- register CfbBits *psrc;
- register CfbBits bits, bits1;
- register int nlTemp;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop24 (alu, planemask)
-#else
- MROP_INITIALIZE (alu, planemask)
-#endif
-
- psrcBase = (CfbBits *)tile->devPrivate.ptr;
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
-#if PSZ == 24
- widthSrc = tile->devKind / PGSZB;
-#else
- widthSrc = tileWidth >> PWSH;
-#endif
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
-
- /* set up source */
- modulus (pBox->x1 - xrot, tileWidth, srcx);
- modulus (pBox->y1 - yrot, tileHeight, srcy);
-#if PSZ == 24
- xoffSrc = (4 - srcx) & 3;
- srcStart = (srcx * 3) >> 2;
-#else
- xoffSrc = srcx & PIM;
- srcStart = (srcx >> PWSH);
-#endif
- psrcStart = psrcBase + (srcy * widthSrc);
- psrcLine = psrcStart + srcStart;
-
- /* set up dest */
-#if PSZ == 24
- xoffDst = (4 - pBox->x1) & 3;
- pdstLine = pdstBase + (pBox->y1 * widthDst) + ((pBox->x1*3) >> 2);
-#else
- xoffDst = pBox->x1 & PIM;
- pdstLine = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH);
-#endif
- /* set up masks */
-#if PSZ == 24
- if (w == 1 && (xoffDst == 0 || xoffDst == 1))
-#else
- if (xoffDst + w < PPW)
-#endif
- {
- maskpartialbits(pBox->x1, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- maskbits (pBox->x1, w, startmask, endmask, nlMiddle)
- }
- if (xoffSrc == xoffDst)
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- srcRemaining = widthSrc - srcStart;
- if (startmask)
- {
- *pdst = MROP_MASK (*psrc, *pdst, startmask);
- pdst++;
- IncSrcPtr
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
-#if MROP == Mcopy
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif
-#else
- while (nl--) {
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;
- }
-#endif
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
- if (endmask)
- {
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
- }
- pdstLine += widthDst;
- psrcLine += widthSrc;
- psrcStart += widthSrc;
- if (++srcy == tileHeight)
- {
- psrcStart = psrcBase;
- psrcLine = psrcStart + srcStart;
- srcy = 0;
- }
- }
- }
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT;
- rightShift = PGSZ - leftShift;
- }
- else
- {
- rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT;
- leftShift = PGSZ - rightShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- srcRemaining = widthSrc - srcStart;
- if (xoffSrc > xoffDst)
- {
- bits = *psrc;
- IncSrcPtr
- }
- if (startmask)
- {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc;
- IncSrcPtr
- bits1 |= BitRight(bits,rightShift);
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
-#if MROP == Mcopy
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
- bits = psrc[-n]; \
- pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
- bits1 = psrc[-n]; \
- pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
- pdst += UNROLL; \
- psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
- bits = *psrc++; \
- *pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
- pdst++;
-
-#define BodyEven(n) \
- bits1 = *psrc++; \
- *pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
- pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-#else
- while (nl--) {
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- }
-#endif
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
-
- if (endmask)
- {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift))
- {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- pdstLine += widthDst;
- psrcLine += widthSrc;
- psrcStart += widthSrc;
- if (++srcy == tileHeight)
- {
- psrcStart = psrcBase;
- psrcLine = psrcStart + srcStart;
- srcy = 0;
- }
- }
- }
- pBox++;
- }
-}
-
-void
-MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int n;
- DDXPointPtr ppt;
- int *pwidth;
- PixmapPtr tile;
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile */
- int tileHeight; /* height of the tile */
- int widthSrc; /* width in longwords of the source tile */
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- CfbBits startmask;
- CfbBits endmask;/* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
-
- register int nl; /* loop version of nlMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int srcRemaining; /* number of longwords remaining in source */
- int xoffDst, xoffSrc;
- int srcStart; /* number of longwords source offset at left of box */
- int leftShift, rightShift;
-
-#if MROP == 0 && PSZ == 24
- DeclareMergeRop24()
-#else
- MROP_DECLARE_REG()
-#endif
-
- CfbBits *pdstBase; /* pointer to start of dest */
- CfbBits *pdstLine; /* poitner to start of dest box */
- CfbBits *psrcBase; /* pointer to start of source */
- CfbBits *psrcLine; /* pointer to fetch point of source */
- CfbBits *psrcStart; /* pointer to start of source line */
- register CfbBits *pdst;
- register CfbBits *psrc;
- register CfbBits bits, bits1;
- register int nlTemp;
-
-#if MROP == 0 && PSZ == 24
- InitializeMergeRop24 (alu, planemask)
-#else
- MROP_INITIALIZE (alu, planemask)
-#endif
-
- psrcBase = (CfbBits *)tile->devPrivate.ptr;
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
-#if PSZ == 24
- widthSrc = tile->devKind / PGSZB;
-#else
- widthSrc = tileWidth >> PWSH;
-#endif
-
- cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (n--)
- {
- w = *pwidth++;
-
- /* set up source */
- modulus (ppt->x - xrot, tileWidth, srcx);
- modulus (ppt->y - yrot, tileHeight, srcy);
-#if PSZ == 24
- xoffSrc = (4 - srcx) & 3;
- srcStart = (srcx * 3) >> 2;
-#else
- xoffSrc = srcx & PIM;
- srcStart = (srcx >> PWSH);
-#endif
- psrcStart = psrcBase + (srcy * widthSrc);
- psrcLine = psrcStart + srcStart;
-
- /* set up dest */
-#if PSZ == 24
- xoffDst = (4 - ppt->x) & 3;
- pdstLine = pdstBase + (ppt->y * widthDst) + ((ppt->x *3) >> 2);
- /* set up masks */
- if (w == 1 && (xoffDst == 0 || xoffDst == 1))
-#else
- xoffDst = ppt->x & PIM;
- pdstLine = pdstBase + (ppt->y * widthDst) + (ppt->x >> PWSH);
- /* set up masks */
- if (xoffDst + w < PPW)
-#endif
- {
- maskpartialbits(ppt->x, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- maskbits (ppt->x, w, startmask, endmask, nlMiddle)
- }
-
- if (xoffSrc == xoffDst)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- srcRemaining = widthSrc - srcStart;
- if (startmask)
- {
- *pdst = MROP_MASK (*psrc, *pdst, startmask);
- pdst++;
- IncSrcPtr
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
-#if MROP == Mcopy
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif
-#else
- while (nl--) {
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;
- }
-#endif
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
- if (endmask)
- {
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
- }
- }
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT;
- rightShift = PGSZ - leftShift;
- }
- else
- {
- rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT;
- leftShift = PGSZ - rightShift;
- }
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- srcRemaining = widthSrc - srcStart;
- if (xoffSrc > xoffDst)
- {
- bits = *psrc;
- IncSrcPtr
- }
- if (startmask)
- {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc;
- IncSrcPtr
- bits1 |= BitRight(bits,rightShift);
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
-#if MROP == Mcopy
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
-bits = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
-bits1 = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
-pdst++;
-
-#define BodyEven(n) \
-bits1 = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
-pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-#else
- while (nl--) {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID(bits1|BitRight(bits,rightShift), *pdst);
- pdst++;
- }
-#endif
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
-
- if (endmask)
- {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift))
- {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- }
- ppt++;
- }
-}
diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h
deleted file mode 100644
index af1754c40..000000000
--- a/cfb/cfbunmap.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.6 2003/07/19 13:22:28 tsi Exp $ */
-/*
- * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-/*
- * Unmap names
- */
-
-#undef CFBNAME
-#undef CATNAME
-
-#undef QuartetBitsTable
-#undef QuartetPixelMaskTable
-#undef cfb8ClippedLineCopy
-#undef cfb8ClippedLineGeneral
-#undef cfb8ClippedLineXor
-#undef cfb8LineSS1Rect
-#undef cfb8LineSS1RectCopy
-#undef cfb8LineSS1RectGeneral
-#undef cfb8LineSS1RectPreviousCopy
-#undef cfb8LineSS1RectXor
-#undef cfb8SegmentSS1Rect
-#undef cfb8SegmentSS1RectCopy
-#undef cfb8SegmentSS1RectGeneral
-#undef cfb8SegmentSS1RectShiftCopy
-#undef cfb8SegmentSS1RectXor
-#undef cfbAllocatePrivates
-#undef cfbBSFuncRec
-#undef cfbBitBlt
-#undef cfbBresD
-#undef cfbBresS
-#undef cfbChangeWindowAttributes
-#undef cfbCloseScreen
-#undef cfbCopyArea
-#undef cfbCopyImagePlane
-#undef cfbCopyPixmap
-#undef cfbCopyPlane
-#undef cfbCopyPlaneReduce
-#undef cfbCopyRotatePixmap
-#undef cfbCopyWindow
-#undef cfbCreateGC
-#undef cfbCreatePixmap
-#undef cfbCreateScreenResources
-#undef cfbCreateWindow
-#undef cfbDestroyPixmap
-#undef cfbDestroyWindow
-#undef cfbDoBitblt
-#undef cfbDoBitbltCopy
-#undef cfbDoBitbltGeneral
-#undef cfbDoBitbltOr
-#undef cfbDoBitbltXor
-#undef cfbFillBoxSolid
-#undef cfbFillBoxTile32
-#undef cfbFillBoxTile32sCopy
-#undef cfbFillBoxTile32sGeneral
-#undef cfbFillBoxTileOdd
-#undef cfbFillBoxTileOddCopy
-#undef cfbFillBoxTileOddGeneral
-#undef cfbFillPoly1RectCopy
-#undef cfbFillPoly1RectGeneral
-#undef cfbFillRectSolidCopy
-#undef cfbFillRectSolidGeneral
-#undef cfbFillRectSolidXor
-#undef cfbFillRectTile32Copy
-#undef cfbFillRectTile32General
-#undef cfbFillRectTileOdd
-#undef cfbFillSpanTile32sCopy
-#undef cfbFillSpanTile32sGeneral
-#undef cfbFillSpanTileOddCopy
-#undef cfbFillSpanTileOddGeneral
-#undef cfbFinishScreenInit
-#undef cfbGCFuncs
-#undef cfbGetImage
-#undef cfbGetScreenPixmap
-#undef cfbGetSpans
-#undef cfbHorzS
-#undef cfbImageGlyphBlt8
-#undef cfbLineSD
-#undef cfbLineSS
-#undef cfbMapWindow
-#undef cfbMatchCommon
-#undef cfbNonTEOps
-#undef cfbNonTEOps1Rect
-#undef cfbPadPixmap
-#undef cfbPaintWindow
-#undef cfbPolyFillArcSolidCopy
-#undef cfbPolyFillArcSolidGeneral
-#undef cfbPolyFillRect
-#undef cfbPolyGlyphBlt8
-#undef cfbPolyGlyphRop8
-#undef cfbPolyPoint
-#undef cfbPositionWindow
-#undef cfbPutImage
-#undef cfbReduceRasterOp
-#undef cfbRestoreAreas
-#undef cfbSaveAreas
-#undef cfbScreenInit
-#undef cfbScreenPrivateIndex
-#undef cfbSegmentSD
-#undef cfbSegmentSS
-#undef cfbSetScanline
-#undef cfbSetScreenPixmap
-#undef cfbSetSpans
-#undef cfbSetupScreen
-#undef cfbSolidSpansCopy
-#undef cfbSolidSpansGeneral
-#undef cfbSolidSpansXor
-#undef cfbStippleStack
-#undef cfbStippleStackTE
-#undef cfbTEGlyphBlt
-#undef cfbTEOps
-#undef cfbTEOps1Rect
-#undef cfbTile32FSCopy
-#undef cfbTile32FSGeneral
-#undef cfbUnmapWindow
-#undef cfbUnnaturalStippleFS
-#undef cfbUnnaturalTileFS
-#undef cfbValidateGC
-#undef cfbVertS
-#undef cfbXRotatePixmap
-#undef cfbYRotatePixmap
-#undef cfbZeroPolyArcSS8Copy
-#undef cfbZeroPolyArcSS8General
-#undef cfbZeroPolyArcSS8Xor
-#undef cfbendpartial
-#undef cfbendtab
-#undef cfbmask
-#undef cfbrmask
-#undef cfbstartpartial
-#undef cfbstarttab
diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c
deleted file mode 100644
index cae13cf3c..000000000
--- a/cfb/cfbwindow.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/* $Xorg: cfbwindow.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.6 2003/11/10 18:21:45 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "cfb.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-
-Bool
-cfbCreateWindow(pWin)
- WindowPtr pWin;
-{
- cfbPrivWin *pPrivWin;
-
- pPrivWin = cfbGetWindowPrivate(pWin);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
- pPrivWin->oldRotate.x = 0;
- pPrivWin->oldRotate.y = 0;
-
-#ifdef PIXMAP_PER_WINDOW
- /* Setup pointer to Screen pixmap */
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- (pointer) cfbGetScreenPixmap(pWin->drawable.pScreen);
-#endif
-
- return TRUE;
-}
-
-Bool
-cfbDestroyWindow(pWin)
- WindowPtr pWin;
-{
- cfbPrivWin *pPrivWin;
-
- pPrivWin = cfbGetWindowPrivate(pWin);
-
- if (pPrivWin->pRotatedBorder)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
- if (pPrivWin->pRotatedBackground)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
- return(TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-cfbMapWindow(pWindow)
- WindowPtr pWindow;
-{
- return(TRUE);
-}
-
-/* (x, y) is the upper left corner of the window on the screen
- do we really need to pass this? (is it a;ready in pWin->absCorner?)
- we only do the rotation for pixmaps that are 32 bits wide (padded
-or otherwise.)
- cfbChangeWindowAttributes() has already put a copy of the pixmap
-in pPrivWin->pRotated*
-*/
-/*ARGSUSED*/
-Bool
-cfbPositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- cfbPrivWin *pPrivWin;
- int setxy = 0;
-
- pPrivWin = cfbGetWindowPrivate(pWin);
- if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground)
- {
- cfbXRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- cfbYRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- setxy = 1;
- }
-
- if (!pWin->borderIsPixel && pPrivWin->fastBorder)
- {
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
- cfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- cfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- setxy = 1;
- }
- if (setxy)
- {
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-cfbUnmapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* UNCLEAN!
- this code calls the bitblt helper code directly.
-
- cfbCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-
-void
-cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- RegionRec rgnDst;
- register BoxPtr pbox;
- register int dx, dy;
- register int i, nbox;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- REGION_NULL(pWin->drawable.pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- for (i = nbox; --i >= 0; ppt++, pbox++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0L);
- DEALLOCATE_LOCAL(pptSrc);
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
-}
-
-
-
-/* swap in correct PaintWindow* routine. If we can use a fast output
-routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
-of it in devPrivates[cfbWindowPrivateIndex].ptr.
-*/
-Bool
-cfbChangeWindowAttributes(pWin, mask)
- WindowPtr pWin;
- unsigned long mask;
-{
- register unsigned long index;
- register cfbPrivWin *pPrivWin;
- int width;
- WindowPtr pBgWin;
-
- pPrivWin = cfbGetWindowPrivate(pWin);
-
- /*
- * When background state changes from ParentRelative and
- * we had previously rotated the fast border pixmap to match
- * the parent relative origin, rerotate to match window
- */
- if (mask & (CWBackPixmap | CWBackPixel) &&
- pWin->backgroundState != ParentRelative &&
- pPrivWin->fastBorder &&
- (pPrivWin->oldRotate.x != pWin->drawable.x ||
- pPrivWin->oldRotate.y != pWin->drawable.y))
- {
- cfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- cfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- while(mask)
- {
- index = lowbit (mask);
- mask &= ~index;
- switch(index)
- {
- case CWBackPixmap:
- if (pWin->backgroundState == None)
- {
- pPrivWin->fastBackground = FALSE;
- }
- else if (pWin->backgroundState == ParentRelative)
- {
- pPrivWin->fastBackground = FALSE;
- /* Rotate border to match parent origin */
- if (pPrivWin->pRotatedBorder) {
- for (pBgWin = pWin->parent;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- cfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.x - pPrivWin->oldRotate.x);
- cfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- }
- else if (((width = (pWin->background.pixmap->drawable.width * PSZ))
- <= PGSZ) && !(width & (width - 1)))
- {
- cfbCopyRotatePixmap(pWin->background.pixmap,
- &pPrivWin->pRotatedBackground,
- pWin->drawable.x,
- pWin->drawable.y);
- if (pPrivWin->pRotatedBackground)
- {
- pPrivWin->fastBackground = TRUE;
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- break;
-
- case CWBackPixel:
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBorderPixmap:
- if (((width = (pWin->border.pixmap->drawable.width * PSZ)) <= PGSZ) &&
- !(width & (width - 1)))
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- cfbCopyRotatePixmap(pWin->border.pixmap,
- &pPrivWin->pRotatedBorder,
- pBgWin->drawable.x,
- pBgWin->drawable.y);
- if (pPrivWin->pRotatedBorder)
- {
- pPrivWin->fastBorder = TRUE;
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- break;
- case CWBorderPixel:
- pPrivWin->fastBorder = FALSE;
- break;
- }
- }
- return (TRUE);
-}
-
diff --git a/cfb/cfbzerarc.c b/cfb/cfbzerarc.c
deleted file mode 100644
index 3703a5105..000000000
--- a/cfb/cfbzerarc.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.5 2003/10/29 22:44:53 tsi Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: cfbzerarc.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "mizerarc.h"
-#include "cfbrrop.h"
-#include "mi.h"
-
-#ifdef PIXEL_ADDR
-
-static void
-RROP_NAME(cfbZeroArcSS8)(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc)
-{
- miZeroArcRec info;
- Bool do360;
- register int x;
- PixelType *addrp;
- register PixelType *yorgp, *yorgop;
-#if PSZ == 24
- int xorg, xorg3, xorgo, xorgo3;
- register int xtmp;
-#endif
- RROP_DECLARE
- register int yoffset;
- int npwidth, dyoffset;
- register int y, a, b, d, mask;
- register int k1, k3, dx, dy;
-
- cfbGetPixelWidthAndPointer(pDraw,npwidth, addrp)
-
- RROP_FETCH_GC (pGC);
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgp = addrp + ((info.yorg + pDraw->y) * npwidth);
- yorgop = addrp + ((info.yorgo + pDraw->y) * npwidth);
- info.xorg += pDraw->x;
- info.xorgo += pDraw->x;
-#if PSZ == 24
- xorg = info.xorg;
- xorg3 = xorg * 3;
- info.xorg = (info.xorg * 3) >> 2;
- xorgo = info.xorgo;
- xorgo3 = xorgo * 3;
- info.xorgo = (info.xorgo * 3) >> 2;
-#endif
- MIARCSETUP();
- yoffset = y ? npwidth : 0;
- dyoffset = 0;
- mask = info.initialMask;
- if (!(arc->width & 1))
- {
-#if PSZ == 24
- if (mask & 2)
- RROP_SOLID24((yorgp + info.xorgo), xorgo);
- if (mask & 8)
- RROP_SOLID24((yorgop + info.xorgo), xorgo);
-#else
- if (mask & 2)
- RROP_SOLID((yorgp + info.xorgo));
- if (mask & 8)
- RROP_SOLID((yorgop + info.xorgo));
-#endif /* PSZ == 24 */
- }
- if (!info.end.x || !info.end.y)
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1))
- {
- register int xoffset = npwidth;
-#if PSZ == 24
- PixelType *yorghb = yorgp + (info.h * npwidth);
- register int tmp1, tmp2, tmp1_3, tmp2_3;
-
- tmp1 = xorg + info.h;
- tmp1_3 = tmp1 * 3;
- tmp2 = xorg - info.h;
- tmp2_3 = tmp2 * 3;
- while (1)
- {
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
- RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
- xtmp = (xorg3 - x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorg - x);
- RROP_SOLID24(yorgop - yoffset + xtmp, xorg - x);
- if (a < 0)
- break;
- xtmp = (tmp1_3 - y * 3) >> 2;
- RROP_SOLID24(yorghb - xoffset + xtmp, tmp1 - y);
- RROP_SOLID24(yorghb + xoffset + xtmp, tmp1 - y);
- xtmp = (tmp2_3 + y * 3) >> 2;
- RROP_SOLID24(yorghb - xoffset + xtmp, tmp2 + y);
- RROP_SOLID24(yorghb + xoffset + xtmp, tmp2 + y);
- xoffset += npwidth;
- MIARCCIRCLESTEP(yoffset += npwidth;);
- }
-#else
- PixelType *yorghb = yorgp + (info.h * npwidth) + info.xorg;
- PixelType *yorgohb = yorghb - info.h;
-
- yorgp += info.xorg;
- yorgop += info.xorg;
- yorghb += info.h;
- while (1)
- {
- RROP_SOLID(yorgp + yoffset + x);
- RROP_SOLID(yorgp + yoffset - x);
- RROP_SOLID(yorgop - yoffset - x);
- RROP_SOLID(yorgop - yoffset + x);
- if (a < 0)
- break;
- RROP_SOLID(yorghb - xoffset - y);
- RROP_SOLID(yorgohb - xoffset + y);
- RROP_SOLID(yorgohb + xoffset + y);
- RROP_SOLID(yorghb + xoffset - y);
- xoffset += npwidth;
- MIARCCIRCLESTEP(yoffset += npwidth;);
- }
- yorgp -= info.xorg;
- yorgop -= info.xorg;
-#endif /* PSZ == 24 */
- x = info.w;
- yoffset = info.h * npwidth;
- }
- else if (do360)
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = npwidth;);
-#if PSZ == 24
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
- RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
- xtmp = (xorgo3 - x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
- RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
-#else
- RROP_SOLID(yorgp + yoffset + info.xorg + x);
- RROP_SOLID(yorgp + yoffset + info.xorgo - x);
- RROP_SOLID(yorgop - yoffset + info.xorgo - x);
- RROP_SOLID(yorgop - yoffset + info.xorg + x);
-#endif
- MIARCSTEP(yoffset += dyoffset;, yoffset += npwidth;);
- }
- }
- else
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = npwidth;);
- if ((x == info.start.x) || (y == info.start.y))
- {
- mask = info.start.mask;
- info.start = info.altstart;
- }
-#if PSZ == 24
- if (mask & 1){
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
- }
- if (mask & 2){
- xtmp = (xorgo3 - x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
- }
- if (mask & 4){
- xtmp = (xorgo3 - x * 3) >> 2;
- RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
- }
- if (mask & 8){
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
- }
-#else
- if (mask & 1)
- RROP_SOLID(yorgp + yoffset + info.xorg + x);
- if (mask & 2)
- RROP_SOLID(yorgp + yoffset + info.xorgo - x);
- if (mask & 4)
- RROP_SOLID(yorgop - yoffset + info.xorgo - x);
- if (mask & 8)
- RROP_SOLID(yorgop - yoffset + info.xorg + x);
-#endif /* PSZ == 24 */
- if ((x == info.end.x) || (y == info.end.y))
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += npwidth;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
-#if PSZ == 24
- if (mask & 1){
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorg + x);
- }
- if (mask & 4){
- xtmp = (xorgo3 - x * 3) >> 2;
- RROP_SOLID24(yorgop - yoffset + xtmp, xorgo - x);
- }
-#else
- if (mask & 1)
- RROP_SOLID(yorgp + yoffset + info.xorg + x);
- if (mask & 4)
- RROP_SOLID(yorgop - yoffset + info.xorgo - x);
-#endif /* PSZ == 24 */
- if (arc->height & 1)
- {
-#if PSZ == 24
- if (mask & 2){
- xtmp = (xorgo3 - x * 3) >> 2;
- RROP_SOLID24(yorgp + yoffset + xtmp, xorgo - x);
- }
- if (mask & 8){
- xtmp = (xorg3 + x * 3) >> 2;
- RROP_SOLID24(yorgop - yoffset + xtmp, xorg + x);
- }
-#else
- if (mask & 2)
- RROP_SOLID(yorgp + yoffset + info.xorgo - x);
- if (mask & 8)
- RROP_SOLID(yorgop - yoffset + info.xorg + x);
-#endif /* PSZ == 24 */
- }
- RROP_UNDECLARE
-}
-
-void
-RROP_NAME (cfbZeroPolyArcSS8) (pDraw, pGC, narcs, parcs)
- register DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- int x2, y2;
- RegionPtr cclip;
-
- cclip = cfbGetCompositeClip(pGC);
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miCanZeroArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- RROP_NAME (cfbZeroArcSS8) (pDraw, pGC, arc);
- else
- miZeroPolyArc(pDraw, pGC, 1, arc);
- }
- else
- miPolyArc(pDraw, pGC, 1, arc);
- }
-}
-
-#endif
diff --git a/cfb/stip68kgnu.h b/cfb/stip68kgnu.h
deleted file mode 100644
index 9a2bac720..000000000
--- a/cfb/stip68kgnu.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * $Xorg: stip68kgnu.h,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/stip68kgnu.h,v 3.4 2001/12/14 19:59:25 dawes Exp $ */
-
-/*
- * Stipple stack macro for 68k GCC
- */
-
-#define STIPPLE(addr,stipple,value,width,count,shift) \
- __asm volatile ( \
- "lea 5f,%/a1\n\
- moveq #28,%/d2\n\
- addl %2,%/d2\n\
- moveq #28,%/d3\n\
- subql #4,%2\n\
- negl %2\n\
-1:\n\
- movel %0,%/a0\n\
- addl %6,%0\n\
- movel %3@+,%/d1\n\
- jeq 3f\n\
- movel %/d1,%/d0\n\
- lsrl %/d2,%/d0\n\
- lsll #5,%/d0\n\
- lsll %2,%/d1\n\
- jmp %/a1@(%/d0:l)\n\
-2:\n\
- addl #4,%/a0\n\
- movel %/d1,%/d0\n\
- lsrl %/d3,%/d0\n\
- lsll #5,%/d0\n\
- lsll #4,%/d1\n\
- jmp %/a1@(%/d0:l)\n\
-5:\n\
- jne 2b ; dbra %1,1b ; jra 4f\n\
- . = 5b + 0x20\n\
- moveb %5,%/a0@(3)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\
- . = 5b + 0x40\n\
- moveb %5,%/a0@(2)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\
- . = 5b + 0x60\n\
- movew %5,%/a0@(2)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f\n\
- . = 5b + 0x80\n\
- moveb %5,%/a0@(1)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0xa0\n\
- moveb %5,%/a0@(3) ; moveb %5,%/a0@(1)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0xc0\n\
- movew %5,%/a0@(1)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0xe0\n\
- movew %5,%/a0@(2) ; moveb %5,%/a0@(1)\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x100\n\
- moveb %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x120\n\
- moveb %5,%/a0@(3) ; moveb %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x140\n\
- moveb %5,%/a0@(2) ; moveb %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x160\n\
- movew %5,%/a0@(2) ; moveb %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x180\n\
- movew %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x1a0\n\
- moveb %5,%/a0@(3) ; movew %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x1c0\n\
- moveb %5,%/a0@(2) ; movew %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; dbra %1,1b ; jra 4f ;\n\
- . = 5b + 0x1e0\n\
- movel %5,%/a0@\n\
- andl %/d1,%/d1 ; jne 2b ; \n\
-3: dbra %1,1b ; \n\
-4:\n"\
- : "=a" (addr), /* %0 */ \
- "=d" (count), /* %1 */ \
- "=d" (shift), /* %2 */ \
- "=a" (stipple) /* %3 */ \
- : "0" (addr), /* %4 */ \
- "d" (value), /* %5 */ \
- "a" (width), /* %6 */ \
- "1" (count-1), /* %7 */ \
- "2" (shift), /* %8 */ \
- "3" (stipple) /* %9 */ \
- : /* ctemp */ "d0", \
- /* c */ "d1", \
- /* lshift */ "d2", \
- /* rshift */ "d3", \
- /* atemp */ "a0", \
- /* case */ "a1")
diff --git a/cfb/stipmips.s b/cfb/stipmips.s
deleted file mode 100644
index c42d9b5ae..000000000
--- a/cfb/stipmips.s
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * $Xorg: stipmips.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/*
- * MIPS assembly code for optimized text rendering.
- *
- * Other stippling could be done in assembly, but the payoff is
- * not nearly as large. Mostly because large areas are heavily
- * optimized already.
- */
-
-#ifdef MIPSEL
-# define BitsR sll
-# define BitsL srl
-# define BO(o) o
-# define HO(o) o
-# define WO(o) o
-# define FourBits(dest,bits) and dest, bits, 0xf
-#else
-# define BitsR srl
-# define BitsL sll
-# define BO(o) 3-o
-# define HO(o) 2-o
-# define WO(o) o
-# define FourBits(dest,bits) srl dest, bits, 28
-#endif
-
-/* reordering instructions would be fatal here */
- .set noreorder
-
-
-/*
- * cfbStippleStack(addr, stipple, value, stride, Count, Shift)
- * 4 5 6 7 16(sp) 20(sp)
- *
- * Apply successive 32-bit stipples starting at addr, addr+stride, ...
- *
- * Used for text rendering, but only when no data could be lost
- * when the stipple is shifted left by Shift bits
- */
-/* arguments */
-#define addr $4
-#define stipple $5
-#define value $6
-#define stride $7
-#define Count 16($sp)
-#define Shift 20($sp)
-
-/* local variables */
-#define count $14
-#define shift $13
-#define atemp $12
-#define bits $11
-#define lshift $9
-#define sbase $8
-#define stemp $2
-
-#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */
-#define CASE_MASK 0x1e0 /* first case mask */
-
-#define ForEachLine $200
-#define NextLine $201
-#define NextLine1 $202
-#define CaseBegin $203
-#define ForEachBits $204
-#define ForEachBits1 $205
-#define NextBits $206
-
-#ifdef TETEXT
-#define cfbStippleStack cfbStippleStackTE
-#endif
-
- .globl cfbStippleStack
- .ent cfbStippleStack 2
-cfbStippleStack:
- .frame $sp, 0, $31
- lw count, Count /* fetch stack params */
- la sbase,CaseBegin /* load up switch table */
- lw shift, Shift
- li lshift, 4 /* compute offset within */
- subu lshift, lshift, shift /* stipple of remaining bits */
-#ifdef MIPSEL
- addu shift, shift, CASE_SIZE /* first shift for LSB */
-#else
- addu shift, shift, 28-CASE_SIZE /* first shift for MSB */
-#endif
- /* do ... while (--count > 0); */
-ForEachLine:
- lw bits, 0(stipple) /* get stipple bits */
- move atemp, addr /* set up for this line */
-#ifdef TETEXT
- /* Terminal emulator fonts are expanded and have many 0 rows */
- beqz bits, NextLine /* skip out early on 0 */
-#endif
- addu addr, addr, stride /* step for the loop */
- BitsR stemp, bits, shift /* get first bits */
- and stemp, stemp, CASE_MASK /* compute first branch */
- addu stemp, stemp, sbase /* ... */
- j stemp /* ... */
- BitsL bits, bits, lshift /* set remaining bits */
-
-ForEachBits:
- addu atemp, atemp, 4
-ForEachBits1:
- FourBits(stemp, bits) /* compute jump for */
- sll stemp, stemp, CASE_SIZE /* next four bits */
- addu stemp, stemp, sbase /* ... */
- j stemp /* ... */
- BitsL bits, bits, 4 /* step for remaining bits */
-CaseBegin:
- bnez bits, ForEachBits1 /* 0 */
- addu atemp, atemp, 4
-NextLine:
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* 1 */
- sb value, BO(0)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* 2 */
- sb value, BO(1)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* 3 */
- sh value, HO(0)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* 4 */
- sb value, BO(2)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- sb value, BO(0)(atemp) /* 5 */
- bnez bits, ForEachBits
- sb value, BO(2)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- sb value, BO(1)(atemp) /* 6 */
- bnez bits, ForEachBits
- sb value, BO(2)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- bnez bits, ForEachBits /* 7 */
- swl value, BO(2)(atemp) /* untested on MSB */
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* 8 */
- sb value, BO(3)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- sb value, BO(0)(atemp) /* 9 */
- bnez bits, ForEachBits
- sb value, BO(3)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- sb value, BO(1)(atemp) /* a */
- bnez bits, ForEachBits
- sb value, BO(3)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- sh value, HO(0)(atemp) /* b */
- bnez bits, ForEachBits
- sb value, BO(3)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- bnez bits, ForEachBits /* c */
- sh value, HO(2)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- sb value, BO(0)(atemp) /* d */
- bnez bits, ForEachBits
- sh value, HO(2)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
-
- bnez bits, ForEachBits /* e */
- swr value, BO(1)(atemp) /* untested on MSB */
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- bnez bits, ForEachBits /* f */
- sw value, WO(0)(atemp)
- addu count, count, -1
- bnez count, ForEachLine
- addu stipple, stipple, 4
- j $31
- nop
- nop
-
- .end cfbStippleStack
diff --git a/cfb/stipsparc.s b/cfb/stipsparc.s
deleted file mode 100644
index 185795605..000000000
--- a/cfb/stipsparc.s
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * $Xorg: stipsparc.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/stipsparc.s,v 1.5 2001/12/14 19:59:26 dawes Exp $ */
-
-/*
- * SPARC assembly code for optimized text rendering.
- *
- * Other stippling could be done in assembly, but the payoff is
- * not nearly as large. Mostly because large areas are heavily
- * optimized already.
- */
-
-/* not that I expect to ever see an LSB SPARC, but ... */
-#ifdef LITTLE_ENDIAN
-# define BitsR sll
-# define BitsL srl
-# define BO(o) o
-# define HO(o) o
-# define WO(o) o
-# define FourBits(dest,bits) and bits, 0xf, dest
-#else
-# define BitsR srl
-# define BitsL sll
-# define BO(o) 3-o
-# define HO(o) 2-o
-# define WO(o) o
-# define FourBits(dest,bits) srl bits, 28, dest
-#endif
-
-/*
- * cfbStippleStack(addr, stipple, value, stride, Count, Shift)
- * 4 5 6 7 16(sp) 20(sp)
- *
- * Apply successive 32-bit stipples starting at addr, addr+stride, ...
- *
- * Used for text rendering, but only when no data could be lost
- * when the stipple is shifted left by Shift bits
- */
-/* arguments */
-#define addr %i0
-#define stipple %i1
-#define value %i2
-#define stride %i3
-#define count %i4
-#define shift %i5
-
-/* local variables */
-#define atemp %l0
-#define bits %l1
-#define lshift %l2
-#define sbase %l3
-#define stemp %l4
-
-#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */
-#define CASE_MASK 0x1e0 /* first case mask */
-
-#define ForEachLine LY1
-#define NextLine LY2
-#define CaseBegin LY3
-#define ForEachBits LY4
-#define NextBits LY5
-
-#if defined(SVR4) || defined(__ELF__)
-#ifdef TETEXT
-#define _cfbStippleStack cfbStippleStackTE
-#else
-#define _cfbStippleStack cfbStippleStack
-#endif
-#else
-#ifdef TETEXT
-#define _cfbStippleStack _cfbStippleStackTE
-#endif
-#endif
- .seg "text"
- .proc 16
- .globl _cfbStippleStack
-_cfbStippleStack:
- save %sp,-64,%sp
- sethi %hi(CaseBegin),sbase /* load up switch table */
- or sbase,%lo(CaseBegin),sbase
-
- mov 4,lshift /* compute offset within */
- sub lshift, shift, lshift /* stipple of remaining bits */
-#ifdef LITTLE_ENDIAN
- inc CASE_SIZE, shift /* first shift for LSB */
-#else
- inc 28-CASE_SIZE, shift /* first shift for MSB */
-#endif
- /* do ... while (--count > 0); */
-ForEachLine:
- ld [stipple],bits /* get stipple bits */
- mov addr,atemp /* set up for this line */
-#ifdef TETEXT
- /* Terminal emulator fonts are expanded and have many 0 rows */
- tst bits
- bz NextLine /* skip out early on 0 */
-#endif
- add addr, stride, addr /* step for the loop */
- BitsR bits, shift, stemp /* get first bits */
- and stemp, CASE_MASK, stemp /* compute first jump */
- BitsL bits, lshift, bits /* set remaining bits */
- jmp sbase+stemp /* ... */
- tst bits
-
-ForEachBits:
- inc 4, atemp
-ForEachBits1:
- FourBits(stemp, bits) /* compute jump for */
- sll stemp, CASE_SIZE, stemp /* these four bits */
- BitsL bits, 4, bits /* step for remaining bits */
- jmp sbase+stemp /* jump */
- tst bits
-CaseBegin:
- bnz,a ForEachBits1 /* 0 */
- inc 4, atemp
-NextLine:
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 1 */
- stb value, [atemp+BO(0)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 2 */
- stb value, [atemp+BO(1)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 3 */
- sth value, [atemp+HO(0)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 4 */
- stb value, [atemp+BO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- stb value, [atemp+BO(0)] /* 5 */
- bnz ForEachBits
- stb value, [atemp+BO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- stb value, [atemp+BO(1)] /* 6 */
- bnz ForEachBits
- stb value, [atemp+BO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- sth value, [atemp+HO(0)] /* 7 */
- bnz ForEachBits
- stb value, [atemp+BO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- bnz ForEachBits /* 8 */
- stb value, [atemp+BO(3)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- stb value, [atemp+BO(0)] /* 9 */
- bnz ForEachBits
- stb value, [atemp+BO(3)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- stb value, [atemp+BO(1)] /* a */
- bnz ForEachBits
- stb value, [atemp+BO(3)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- sth value, [atemp+HO(0)] /* b */
- bnz ForEachBits
- stb value, [atemp+BO(3)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- bnz ForEachBits /* c */
- sth value, [atemp+HO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- stb value, [atemp+BO(0)] /* d */
- bnz ForEachBits
- sth value, [atemp+HO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- stb value, [atemp+BO(1)] /* e */
- bnz ForEachBits
- sth value, [atemp+HO(2)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- bnz ForEachBits /* f */
- st value, [atemp+WO(0)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
diff --git a/cfb/stipsprc32.s b/cfb/stipsprc32.s
deleted file mode 100644
index f878fbf80..000000000
--- a/cfb/stipsprc32.s
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * $Xorg: stipsprc32.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/cfb/stipsprc32.s,v 1.5 2001/12/14 19:59:26 dawes Exp $ */
-
-/*
- * SPARC assembly code for optimized text rendering.
- *
- * Other stippling could be done in assembly, but the payoff is
- * not nearly as large. Mostly because large areas are heavily
- * optimized already.
- */
-
-/* not that I expect to ever see an LSB SPARC, but ... */
-#ifdef LITTLE_ENDIAN
-# define BitsR sll
-# define BitsL srl
-# define WO(o) 3-o
-# define FourBits(dest,bits) and bits, 0xf, dest
-#else
-# define BitsR srl
-# define BitsL sll
-# define WO(o) o
-# define FourBits(dest,bits) srl bits, 28, dest
-#endif
-
-/*
- * cfb32StippleStack(addr, stipple, value, stride, Count, Shift)
- * 4 5 6 7 16(sp) 20(sp)
- *
- * Apply successive 32-bit stipples starting at addr, addr+stride, ...
- *
- * Used for text rendering, but only when no data could be lost
- * when the stipple is shifted left by Shift bits
- */
-/* arguments */
-#define addr %i0
-#define stipple %i1
-#define value %i2
-#define stride %i3
-#define count %i4
-#define shift %i5
-
-/* local variables */
-#define atemp %l0
-#define bits %l1
-#define lshift %l2
-#define sbase %l3
-#define stemp %l4
-
-#define CASE_SIZE 5 /* case blocks are 2^5 bytes each */
-#define CASE_MASK 0x1e0 /* first case mask */
-
-#define ForEachLine LY1
-#define NextLine LY2
-#define CaseBegin LY3
-#define ForEachBits LY4
-#define NextBits LY5
-
-#if defined(SVR4) || defined(__ELF__)
-#ifdef TETEXT
-#define _cfb32StippleStack cfb32StippleStackTE
-#else
-#define _cfb32StippleStack cfb32StippleStack
-#endif
-#else
-#ifdef TETEXT
-#define _cfb32StippleStack _cfb32StippleStackTE
-#endif
-#endif
-
- .seg "text"
- .proc 16
- .globl _cfb32StippleStack
-_cfb32StippleStack:
- save %sp,-64,%sp
- sethi %hi(CaseBegin),sbase /* load up switch table */
- or sbase,%lo(CaseBegin),sbase
-
- mov 4,lshift /* compute offset within */
- sub lshift, shift, lshift /* stipple of remaining bits */
-#ifdef LITTLE_ENDIAN
- inc CASE_SIZE, shift /* first shift for LSB */
-#else
- inc 28-CASE_SIZE, shift /* first shift for MSB */
-#endif
- /* do ... while (--count > 0); */
-ForEachLine:
- ld [stipple],bits /* get stipple bits */
- mov addr,atemp /* set up for this line */
-#ifdef TETEXT
- /* Terminal emulator fonts are expanded and have many 0 rows */
- tst bits
- bz NextLine /* skip out early on 0 */
-#endif
- add addr, stride, addr /* step for the loop */
- BitsR bits, shift, stemp /* get first bits */
- and stemp, CASE_MASK, stemp /* compute first jump */
- BitsL bits, lshift, bits /* set remaining bits */
- jmp sbase+stemp /* ... */
- tst bits
-
-ForEachBits:
- inc 16, atemp
-ForEachBits1:
- FourBits(stemp, bits) /* compute jump for */
- sll stemp, CASE_SIZE, stemp /* these four bits */
- BitsL bits, 4, bits /* step for remaining bits */
- jmp sbase+stemp /* jump */
- tst bits
-CaseBegin:
- bnz,a ForEachBits1 /* 0 */
- inc 16, atemp
-NextLine:
- deccc 1, count
-NextLine1:
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 1 */
- st value, [atemp+WO(12)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- bnz ForEachBits /* 2 */
- st value, [atemp+WO(8)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- st value, [atemp+WO(8)] /* 3 */
- bnz ForEachBits
- st value, [atemp+WO(12)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- bnz ForEachBits /* 4 */
- st value, [atemp+WO(4)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- st value, [atemp+WO(4)] /* 5 */
- bnz ForEachBits
- st value, [atemp+WO(12)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- st value, [atemp+WO(4)] /* 6 */
- bnz ForEachBits
- st value, [atemp+WO(8)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- st value, [atemp+WO(4)] /* 7 */
- st value, [atemp+WO(8)]
- bnz ForEachBits
- st value, [atemp+WO(12)]
- b NextLine1
- deccc 1, count
- nop
- nop
-
- bnz ForEachBits /* 8 */
- st value, [atemp+WO(0)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
- nop
-
- st value, [atemp+WO(0)] /* 9 */
- bnz ForEachBits
- st value, [atemp+WO(12)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- st value, [atemp+WO(0)] /* a */
- bnz ForEachBits
- st value, [atemp+WO(8)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- st value, [atemp+WO(0)] /* b */
- st value, [atemp+WO(8)]
- bnz ForEachBits
- st value, [atemp+WO(12)]
- b NextLine1
- deccc 1, count
- nop
- nop
-
- st value, [atemp+WO(0)] /* c */
- bnz ForEachBits
- st value, [atemp+WO(4)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
-
- st value, [atemp+WO(0)] /* d */
- st value, [atemp+WO(4)]
- bnz ForEachBits
- st value, [atemp+WO(12)]
- b NextLine1
- deccc 1, count
- nop
- nop
-
- st value, [atemp+WO(0)] /* e */
- st value, [atemp+WO(4)]
- bnz ForEachBits
- st value, [atemp+WO(8)]
- b NextLine1
- deccc 1, count
- nop
- nop
-
- st value, [atemp+WO(0)] /* f */
- st value, [atemp+WO(4)]
- st value, [atemp+WO(8)]
- bnz ForEachBits
- st value, [atemp+WO(12)]
- deccc 1, count
- bnz,a ForEachLine
- inc 4, stipple
- ret
- restore
diff --git a/cfb24/cfbrrop24.h b/cfb24/cfbrrop24.h
deleted file mode 100644
index 0bb97ce5b..000000000
--- a/cfb24/cfbrrop24.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb24/cfbrrop24.h,v 3.2 2003/10/29 22:46:27 tsi Exp $ */
-
-#define RROP_DECLARE \
- unsigned long piQxelAnd[3], piQxelXor[3], spiQxelXor[8];
-
-#define RROP_COPY_SETUP(ptn) \
- spiQxelXor[0] = ptn & 0xFFFFFF; \
- spiQxelXor[2] = ptn << 24; \
- spiQxelXor[3] = (ptn & 0xFFFF00)>> 8; \
- spiQxelXor[4] = ptn << 16; \
- spiQxelXor[5] = (ptn & 0xFF0000)>> 16; \
- spiQxelXor[6] = ptn << 8; \
- spiQxelXor[1] = spiQxelXor[7] = 0;
-
-#define RROP_SOLID24_COPY(dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \
- idx++; \
- *((dst)+1) = (*((dst)+1) & cfbrmask[idx])|spiQxelXor[idx]; \
- }
-
-#define RROP_SET_SETUP(xor, and) \
- spiQxelXor[0] = xor & 0xFFFFFF; \
- spiQxelXor[1] = xor << 24; \
- spiQxelXor[2] = xor << 16; \
- spiQxelXor[3] = xor << 8; \
- spiQxelXor[4] = (xor >> 8) & 0xFFFF; \
- spiQxelXor[5] = (xor >> 16) & 0xFF; \
- piQxelAnd[0] = (and & 0xFFFFFF)|(and << 24); \
- piQxelAnd[1] = (and << 16)|((and >> 8) & 0xFFFF); \
- piQxelAnd[2] = (and << 8)|((and >> 16) & 0xFF); \
- piQxelXor[0] = (xor & 0xFFFFFF)|(xor << 24); \
- piQxelXor[1] = (xor << 16)|((xor >> 8) & 0xFFFF); \
- piQxelXor[2] = (xor << 8)|((xor >> 16) & 0xFF);
-
-
-#define RROP_SOLID24_SET(dst,index) {\
- switch((index) & 3){ \
- case 0: \
- *(dst) = ((*(dst) & (piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); \
- break; \
- case 3: \
- *(dst) = ((*(dst) & (piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); \
- break; \
- case 1: \
- *(dst) = ((*(dst) & (piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); \
- *((dst)+1) = ((*((dst)+1) & (piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); \
- break; \
- case 2: \
- *(dst) = ((*(dst) & (piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); \
- *((dst)+1) = ((*((dst)+1) & (piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); \
- break; \
- } \
- }
diff --git a/dbe/dbe.c b/dbe/dbe.c
deleted file mode 100644
index 6b92baac7..000000000
--- a/dbe/dbe.c
+++ /dev/null
@@ -1,1985 +0,0 @@
-/* $Xorg: dbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */
-/******************************************************************************
- *
- * Copyright (c) 1994, 1995 Hewlett-Packard Company
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the Hewlett-Packard
- * Company shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization from the Hewlett-Packard Company.
- *
- * DIX DBE code
- *
- *****************************************************************************/
-/* $XFree86: xc/programs/Xserver/dbe/dbe.c,v 3.11 2001/10/28 03:33:04 tsi Exp $ */
-
-
-/* INCLUDES */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "extnsionst.h"
-#include "gcstruct.h"
-#include "dixstruct.h"
-#define NEED_DBE_PROTOCOL
-#include "dbestruct.h"
-#include "midbe.h"
-
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
-
-/* GLOBALS */
-
-/* Per-screen initialization functions [init'ed by DbeRegisterFunction()] */
-static Bool (* DbeInitFunct[MAXSCREENS])(); /* pScreen, pDbeScreenPriv */
-
-/* These are static globals copied to DBE's screen private for use by DDX */
-static int dbeScreenPrivIndex;
-static int dbeWindowPrivIndex;
-
-/* These are static globals copied to DBE's screen private for use by DDX */
-static RESTYPE dbeDrawableResType;
-static RESTYPE dbeWindowPrivResType;
-
-/* This global is used by DbeAllocWinPrivPrivIndex() */
-static int winPrivPrivCount = 0;
-
-/* Used to generate DBE's BadBuffer error. */
-static int dbeErrorBase;
-
-/* Used by DbeRegisterFunction() to initialize the initialization function
- * table only once per server lifetime.
- */
-static Bool firstRegistrationPass = TRUE;
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeValidateBuffer
- *
- * Description:
- *
- * This function is called from VALIDATE_DRAWABLE_AND_GC and from
- * various places in dispatch.c if the server has been compiled with
- * the flags -DNEED_DBE_BUF_BITS and -DNEED_DBE_BUF_VALIDATE.
- * When pWin->dstBuffer changes, this function will be called with pWin
- * as the first argument, the drawable ID that was specified as the
- * second argument (could be a back buffer id), and True for the third
- * argument.
- * When pWin->srcBuffer changes, the third argument will be False, and
- * the first two arguments are as described for dstBuffer.
- *
- * This function should prepare the hardware to access the specified
- * buffer for reads (if dstbuf is False) or writes (if dstbuf is True).
- *
- *****************************************************************************/
-
-void
-DbeValidateBuffer(pWin, drawID, dstbuf)
- WindowPtr pWin;
- XID drawID;
- Bool dstbuf;
-{
- DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
- if (pDbeScreenPriv->ValidateBuffer)
- (*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf);
-}
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeRegisterFunction
- *
- * Description:
- *
- * This function registers the DBE init function for the specified screen.
- *
- *****************************************************************************/
-
-void
-DbeRegisterFunction(pScreen, funct)
- ScreenPtr pScreen;
- Bool (*funct)();
-{
- int i;
-
- /* Initialize the initialization function table if it has not been
- * initialized already.
- */
- if (firstRegistrationPass)
- {
- for (i = 0; i < MAXSCREENS; i++)
- {
- DbeInitFunct[i] = NULL;
- }
-
- firstRegistrationPass = FALSE;
- }
-
- DbeInitFunct[pScreen->myNum] = funct;
-
-} /* DbeRegisterFunction() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeAllocWinPriv
- *
- * Description:
- *
- * This function was cloned from AllocateWindow() in window.c.
- * This function allocates a window priv structure to be associated
- * with a double-buffered window.
- *
- *****************************************************************************/
-static DbeWindowPrivPtr
-DbeAllocWinPriv(pScreen)
- ScreenPtr pScreen;
-{
- DbeWindowPrivPtr pDbeWindowPriv;
- DbeScreenPrivPtr pDbeScreenPriv;
- register char *ptr;
- register DevUnion *ppriv;
- register unsigned int *sizes;
- register unsigned int size;
- register int i;
-
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
- pDbeWindowPriv = (DbeWindowPrivPtr)xalloc(pDbeScreenPriv->totalWinPrivSize);
-
- if (pDbeWindowPriv)
- {
- ppriv = (DevUnion *)(pDbeWindowPriv + 1);
- pDbeWindowPriv->devPrivates = ppriv;
- sizes = pDbeScreenPriv->winPrivPrivSizes;
- ptr = (char *)(ppriv + pDbeScreenPriv->winPrivPrivLen);
- for (i = pDbeScreenPriv->winPrivPrivLen; --i >= 0; ppriv++, sizes++)
- {
- if ((size = *sizes))
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- }
-
- return(pDbeWindowPriv);
-
-} /* DbeAllocWinPriv() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeFallbackAllocWinPriv
- *
- * Description:
- *
- * This is a fallback function for AllocWinPriv().
- *
- *****************************************************************************/
-
-#if 0 /* NOT USED */
-static DbeWindowPrivPtr
-DbeFallbackAllocWinPriv(pScreen)
- ScreenPtr pScreen;
-{
- return (NULL);
-} /* DbeFallbackAllocWinPriv() */
-#endif
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeAllocWinPrivPrivIndex
- *
- * Description:
- *
- * This function was cloned from AllocateWindowPrivateIndex() in window.c.
- * This function allocates a new window priv priv index by simply returning
- * an incremented private counter.
- *
- *****************************************************************************/
-
-static int
-DbeAllocWinPrivPrivIndex()
-{
- return winPrivPrivCount++;
-
-} /* DbeAllocWinPrivPrivIndex() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeAllocWinPrivPriv
- *
- * Description:
- *
- * This function was cloned from AllocateWindowPrivate() in privates.c.
- * This function allocates a private structure to be hung off
- * a window private.
- *
- *****************************************************************************/
-
-static Bool
-DbeAllocWinPrivPriv(pScreen, index, amount)
- register ScreenPtr pScreen;
- int index;
- unsigned int amount;
-{
- DbeScreenPrivPtr pDbeScreenPriv;
- unsigned int oldamount;
-
-
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- if (index >= pDbeScreenPriv->winPrivPrivLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pDbeScreenPriv->winPrivPrivSizes,
- (index + 1) * sizeof(unsigned));
- if (!nsizes)
- {
- return(FALSE);
- }
-
- while (pDbeScreenPriv->winPrivPrivLen <= index)
- {
- nsizes[pDbeScreenPriv->winPrivPrivLen++] = 0;
- pDbeScreenPriv->totalWinPrivSize += sizeof(DevUnion);
- }
-
- pDbeScreenPriv->winPrivPrivSizes = nsizes;
- }
-
- oldamount = pDbeScreenPriv->winPrivPrivSizes[index];
-
- if (amount > oldamount)
- {
- pDbeScreenPriv->winPrivPrivSizes[index] = amount;
- pDbeScreenPriv->totalWinPrivSize += (amount - oldamount);
- }
- return(TRUE);
-
-} /* DbeAllocWinPrivPriv() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeStubScreen
- *
- * Description:
- *
- * This is function stubs the function pointers in the given DBE screen
- * private and increments the number of stubbed screens.
- *
- *****************************************************************************/
-
-static void
-DbeStubScreen(pDbeScreenPriv, nStubbedScreens)
- DbeScreenPrivPtr pDbeScreenPriv;
- int *nStubbedScreens;
-{
- /* Stub DIX. */
- pDbeScreenPriv->SetupBackgroundPainter = NULL;
- pDbeScreenPriv->AllocWinPriv = NULL;
- pDbeScreenPriv->AllocWinPrivPrivIndex = NULL;
- pDbeScreenPriv->AllocWinPrivPriv = NULL;
-
- /* Do not unwrap PositionWindow nor DestroyWindow. If the DDX
- * initialization function failed, we assume that it did not wrap
- * PositionWindow. Also, DestroyWindow is only wrapped if the DDX
- * initialization function succeeded.
- */
-
- /* Stub DDX. */
- pDbeScreenPriv->GetVisualInfo = NULL;
- pDbeScreenPriv->AllocBackBufferName = NULL;
- pDbeScreenPriv->SwapBuffers = NULL;
- pDbeScreenPriv->BeginIdiom = NULL;
- pDbeScreenPriv->EndIdiom = NULL;
- pDbeScreenPriv->WinPrivDelete = NULL;
- pDbeScreenPriv->ResetProc = NULL;
- pDbeScreenPriv->ValidateBuffer = NULL;
-
- (*nStubbedScreens)++;
-
-} /* DbeStubScreen() */
-
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeGetVersion
- *
- * Description:
- *
- * This function is for processing a DbeGetVersion request.
- * This request returns the major and minor version numbers of this
- * extension.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeGetVersion(client)
- ClientPtr client;
-{
- /* REQUEST(xDbeGetVersionReq); */
- xDbeGetVersionReply rep;
- register int n;
-
-
- REQUEST_SIZE_MATCH(xDbeGetVersionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = DBE_MAJOR_VERSION;
- rep.minorVersion = DBE_MINOR_VERSION;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- }
-
- WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
-
- return(client->noClientException);
-
-} /* ProcDbeGetVersion() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeAllocateBackBufferName
- *
- * Description:
- *
- * This function is for processing a DbeAllocateBackBufferName request.
- * This request allocates a drawable ID used to refer to the back buffer
- * of a window.
- *
- * Return Values:
- *
- * BadAlloc - server can not allocate resources
- * BadIDChoice - id is out of range for client; id is already in use
- * BadMatch - window is not an InputOutput window;
- * visual of window is not on list returned by
- * DBEGetVisualInfo;
- * BadValue - invalid swap action is specified
- * BadWindow - window is not a valid window
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeAllocateBackBufferName(client)
- ClientPtr client;
-{
- REQUEST(xDbeAllocateBackBufferNameReq);
- WindowPtr pWin;
- DbeScreenPrivPtr pDbeScreenPriv;
- DbeWindowPrivPtr pDbeWindowPriv;
- XdbeScreenVisualInfo scrVisInfo;
- register int i;
- Bool visualMatched = FALSE;
- xDbeSwapAction swapAction;
- VisualID visual;
- int status;
-
-
- REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
-
- /* The window must be valid. */
- if (!(pWin = SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess)))
- {
- return(BadWindow);
- }
-
- /* The window must be InputOutput. */
- if (pWin->drawable.class != InputOutput)
- {
- return(BadMatch);
- }
-
- /* The swap action must be valid. */
- swapAction = stuff->swapAction; /* use local var for performance. */
- if ((swapAction != XdbeUndefined ) &&
- (swapAction != XdbeBackground) &&
- (swapAction != XdbeUntouched ) &&
- (swapAction != XdbeCopied ))
- {
- return(BadValue);
- }
-
- /* The id must be in range and not already in use. */
- LEGAL_NEW_RESOURCE(stuff->buffer, client);
-
- /* The visual of the window must be in the list returned by
- * GetVisualInfo.
- */
- pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
- if (!pDbeScreenPriv->GetVisualInfo)
- return(BadMatch); /* screen doesn't support double buffering */
-
- if (!(*pDbeScreenPriv->GetVisualInfo)(pWin->drawable.pScreen, &scrVisInfo))
- {
- /* GetVisualInfo() failed to allocate visual info data. */
- return(BadAlloc);
- }
-
- /* See if the window's visual is on the list. */
- visual = wVisual(pWin);
- for (i = 0; (i < scrVisInfo.count) && !visualMatched; i++)
- {
- if (scrVisInfo.visinfo[i].visual == visual)
- {
- visualMatched = TRUE;
- }
- }
-
- /* Free what was allocated by the GetVisualInfo() call above. */
- xfree(scrVisInfo.visinfo);
-
- if (!visualMatched)
- {
- return(BadMatch);
- }
-
- if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)) == NULL)
- {
- /* There is no buffer associated with the window.
- * Allocate a window priv.
- */
-
- if (!(pDbeWindowPriv =
- (*pDbeScreenPriv->AllocWinPriv)(pWin->drawable.pScreen)))
- {
- return(BadAlloc);
- }
-
- /* Make the window priv a DBE window priv resource. */
- if (!AddResource(stuff->buffer, dbeWindowPrivResType,
- (pointer)pDbeWindowPriv))
- {
- xfree(pDbeWindowPriv);
- return(BadAlloc);
- }
-
- /* Fill out window priv information. */
- pDbeWindowPriv->pWindow = pWin;
- pDbeWindowPriv->width = pWin->drawable.width;
- pDbeWindowPriv->height = pWin->drawable.height;
- pDbeWindowPriv->x = pWin->drawable.x;
- pDbeWindowPriv->y = pWin->drawable.y;
- pDbeWindowPriv->nBufferIDs = 0;
-
- /* Set the buffer ID array pointer to the initial (static) array). */
- pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs;
-
- /* Initialize the buffer ID list. */
- pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
- pDbeWindowPriv->IDs[0] = stuff->buffer;
- for (i = 1; i < DBE_INIT_MAX_IDS; i++)
- {
- pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
- }
-
-
- /* Actually connect the window priv to the window. */
- pWin->devPrivates[dbeWindowPrivIndex].ptr = (pointer)pDbeWindowPriv;
-
- } /* if -- There is no buffer associated with the window. */
-
- else
- {
- /* A buffer is already associated with the window.
- * Add the new buffer ID to the array, reallocating the array memory
- * if necessary.
- */
-
- /* Determine if there is a free element in the ID array. */
- for (i = 0; i < pDbeWindowPriv->maxAvailableIDs; i++)
- {
- if (pDbeWindowPriv->IDs[i] == DBE_FREE_ID_ELEMENT)
- {
- /* There is still room in the ID array. */
- break;
- }
- }
-
- if (i == pDbeWindowPriv->maxAvailableIDs)
- {
- /* No more room in the ID array -- reallocate another array. */
- XID *pIDs;
-
-
- /* Setup an array pointer for the realloc operation below. */
- if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS)
- {
- /* We will malloc a new array. */
- pIDs = NULL;
- }
- else
- {
- /* We will realloc a new array. */
- pIDs = pDbeWindowPriv->IDs;
- }
-
- /* malloc/realloc a new array and initialize all elements to 0. */
- pDbeWindowPriv->IDs = (XID *)xrealloc(pIDs,
- (pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID));
- if (!pDbeWindowPriv->IDs)
- {
- return(BadAlloc);
- }
- memset(&pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs], 0,
- (pDbeWindowPriv->maxAvailableIDs + DBE_INCR_MAX_IDS -
- pDbeWindowPriv->nBufferIDs) * sizeof(XID));
-
- if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS)
- {
- /* We just went from using the initial (static) array to a
- * newly allocated array. Copy the IDs from the initial array
- * to the new array.
- */
- memcpy(pDbeWindowPriv->IDs, pDbeWindowPriv->initIDs,
- DBE_INIT_MAX_IDS * sizeof(XID));
- }
-
- pDbeWindowPriv->maxAvailableIDs += DBE_INCR_MAX_IDS;
- }
-
- /* Finally, record the buffer ID in the array. */
- pDbeWindowPriv->IDs[i] = stuff->buffer;
-
- /* Associate the new ID with an existing window priv. */
- if (!AddResource(stuff->buffer, dbeWindowPrivResType,
- (pointer)pDbeWindowPriv))
- {
- pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
- return(BadAlloc);
- }
-
- } /* else -- A buffer is already associated with the window. */
-
-
- /* Call the DDX routine to allocate the back buffer. */
- status = (*pDbeScreenPriv->AllocBackBufferName)(pWin, stuff->buffer,
- stuff->swapAction);
-
- if ((status != Success) && (pDbeWindowPriv->nBufferIDs == 0))
- {
- /* The DDX buffer allocation routine failed for the first buffer of
- * this window.
- */
- xfree(pDbeWindowPriv);
- return(status);
- }
-
- /* Increment the number of buffers (XIDs) associated with this window. */
- pDbeWindowPriv->nBufferIDs++;
-
- /* Set swap action on all calls. */
- pDbeWindowPriv->swapAction = stuff->swapAction;
-
-
- return(status);
-
-} /* ProcDbeAllocateBackBufferName() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeDeallocateBackBufferName
- *
- * Description:
- *
- * This function is for processing a DbeDeallocateBackBufferName request.
- * This request frees a drawable ID that was obtained by a
- * DbeAllocateBackBufferName request.
- *
- * Return Values:
- *
- * BadBuffer - buffer to deallocate is not associated with a window
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeDeallocateBackBufferName(client)
- ClientPtr client;
-{
- REQUEST(xDbeDeallocateBackBufferNameReq);
- DbeWindowPrivPtr pDbeWindowPriv;
- int i;
-
-
- REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
-
- /* Buffer name must be valid */
- if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
- stuff->buffer, dbeWindowPrivResType, SecurityDestroyAccess)) ||
- !(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType,
- SecurityDestroyAccess)))
- {
- client->errorValue = stuff->buffer;
- return(dbeErrorBase + DbeBadBuffer);
- }
-
- /* Make sure that the id is valid for the window.
- * This is paranoid code since we already looked up the ID by type
- * above.
- */
-
- for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++)
- {
- /* Loop through the ID list to find the ID. */
- if (pDbeWindowPriv->IDs[i] == stuff->buffer)
- {
- break;
- }
- }
-
- if (i == pDbeWindowPriv->nBufferIDs)
- {
- /* We did not find the ID in the ID list. */
- client->errorValue = stuff->buffer;
- return(dbeErrorBase + DbeBadBuffer);
- }
-
- FreeResource(stuff->buffer, RT_NONE);
-
- return(Success);
-
-} /* ProcDbeDeallocateBackBufferName() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeSwapBuffers
- *
- * Description:
- *
- * This function is for processing a DbeSwapBuffers request.
- * This request swaps the buffers for all windows listed, applying the
- * appropriate swap action for each window.
- *
- * Return Values:
- *
- * BadAlloc - local allocation failed; this return value is not defined
- * by the protocol
- * BadMatch - a window in request is not double-buffered; a window in
- * request is listed more than once
- * BadValue - invalid swap action is specified; no swap action is
- * specified
- * BadWindow - a window in request is not valid
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeSwapBuffers(client)
- ClientPtr client;
-{
- REQUEST(xDbeSwapBuffersReq);
- WindowPtr pWin;
- DbeScreenPrivPtr pDbeScreenPriv;
- DbeSwapInfoPtr swapInfo;
- xDbeSwapInfo *dbeSwapInfo;
- int error;
- register int i, j;
- int nStuff;
-
-
- REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
- nStuff = stuff->n; /* use local variable for performance. */
-
- if (nStuff == 0)
- {
- return(Success);
- }
-
- /* Get to the swap info appended to the end of the request. */
- dbeSwapInfo = (xDbeSwapInfo *)&stuff[1];
-
- /* Allocate array to record swap information. */
- swapInfo = (DbeSwapInfoPtr)ALLOCATE_LOCAL(nStuff * sizeof(DbeSwapInfoRec));
- if (swapInfo == NULL)
- {
- return(BadAlloc);
- }
-
-
- for (i = 0; i < nStuff; i++)
- {
- /* Check all windows to swap. */
-
- /* Each window must be a valid window - BadWindow. */
- if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
- SecurityWriteAccess)))
- {
- DEALLOCATE_LOCAL(swapInfo);
- return(BadWindow);
- }
-
- /* Each window must be double-buffered - BadMatch. */
- if (DBE_WINDOW_PRIV(pWin) == NULL)
- {
- DEALLOCATE_LOCAL(swapInfo);
- return(BadMatch);
- }
-
- /* Each window must only be specified once - BadMatch. */
- for (j = i + 1; j < nStuff; j++)
- {
- if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
- {
- DEALLOCATE_LOCAL(swapInfo);
- return(BadMatch);
- }
- }
-
- /* Each swap action must be valid - BadValue. */
- if ((dbeSwapInfo[i].swapAction != XdbeUndefined ) &&
- (dbeSwapInfo[i].swapAction != XdbeBackground) &&
- (dbeSwapInfo[i].swapAction != XdbeUntouched ) &&
- (dbeSwapInfo[i].swapAction != XdbeCopied ))
- {
- DEALLOCATE_LOCAL(swapInfo);
- return(BadValue);
- }
-
- /* Everything checks out OK. Fill in the swap info array. */
- swapInfo[i].pWindow = pWin;
- swapInfo[i].swapAction = dbeSwapInfo[i].swapAction;
-
- } /* for (i = 0; i < nStuff; i++) */
-
-
- /* Call the DDX routine to perform the swap(s). The DDX routine should
- * scan the swap list (swap info), swap any buffers that it knows how to
- * handle, delete them from the list, and update nStuff to indicate how
- * many windows it did not handle.
- *
- * This scheme allows a range of sophistication in the DDX SwapBuffers()
- * implementation. Naive implementations could just swap the first buffer
- * in the list, move the last buffer to the front, decrement nStuff, and
- * return. The next level of sophistication could be to scan the whole
- * list for windows on the same screen. Up another level, the DDX routine
- * could deal with cross-screen synchronization.
- */
-
- while (nStuff > 0)
- {
- pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(swapInfo[0].pWindow);
- error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo);
- if (error != Success)
- {
- DEALLOCATE_LOCAL(swapInfo);
- return(error);
- }
- }
-
- DEALLOCATE_LOCAL(swapInfo);
- return(Success);
-
-} /* ProcDbeSwapBuffers() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeBeginIdiom
- *
- * Description:
- *
- * This function is for processing a DbeBeginIdiom request.
- * This request informs the server that a complex swap will immediately
- * follow this request.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeBeginIdiom(client)
- ClientPtr client;
-{
- /* REQUEST(xDbeBeginIdiomReq); */
- DbeScreenPrivPtr pDbeScreenPriv;
- register int i;
-
-
- REQUEST_SIZE_MATCH(xDbeBeginIdiomReq);
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pDbeScreenPriv = DBE_SCREEN_PRIV(screenInfo.screens[i]);
-
- /* Call the DDX begin idiom procedure if there is one. */
- if (pDbeScreenPriv->BeginIdiom)
- {
- (*pDbeScreenPriv->BeginIdiom)(client);
- }
- }
-
- return(Success);
-
-} /* ProcDbeBeginIdiom() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeGetVisualInfo
- *
- * Description:
- *
- * This function is for processing a ProcDbeGetVisualInfo request.
- * This request returns information about which visuals support
- * double buffering.
- *
- * Return Values:
- *
- * BadDrawable - value in screen specifiers is not a valid drawable
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeGetVisualInfo(client)
- ClientPtr client;
-{
- REQUEST(xDbeGetVisualInfoReq);
- DbeScreenPrivPtr pDbeScreenPriv;
- xDbeGetVisualInfoReply rep;
- Drawable *drawables;
- DrawablePtr *pDrawables = NULL;
- register int i, j, n;
- register int count; /* number of visual infos in reply */
- register int length; /* length of reply */
- ScreenPtr pScreen;
- XdbeScreenVisualInfo *pScrVisInfo;
-
-
- REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
-
- /* Make sure any specified drawables are valid. */
- if (stuff->n != 0)
- {
- if (!(pDrawables = (DrawablePtr *)ALLOCATE_LOCAL(stuff->n *
- sizeof(DrawablePtr))))
- {
- return(BadAlloc);
- }
-
- drawables = (Drawable *)&stuff[1];
-
- for (i = 0; i < stuff->n; i++)
- {
- if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
- drawables[i], client, SecurityReadAccess)))
- {
- DEALLOCATE_LOCAL(pDrawables);
- return(BadDrawable);
- }
- }
- }
-
- count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n;
- if (!(pScrVisInfo = (XdbeScreenVisualInfo *)xalloc(count *
- sizeof(XdbeScreenVisualInfo))))
- {
- if (pDrawables)
- {
- DEALLOCATE_LOCAL(pDrawables);
- }
-
- return(BadAlloc);
- }
-
- length = 0;
-
- for (i = 0; i < count; i++)
- {
- pScreen = (stuff->n == 0) ? screenInfo.screens[i] :
- pDrawables[i]->pScreen;
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- if (!(*pDbeScreenPriv->GetVisualInfo)(pScreen, &pScrVisInfo[i]))
- {
- /* We failed to alloc pScrVisInfo[i].visinfo. */
-
- /* Free visinfos that we allocated for previous screen infos.*/
- for (j = 0; j < i; j++)
- {
- xfree(pScrVisInfo[j].visinfo);
- }
-
- /* Free pDrawables if we needed to allocate it above. */
- if (pDrawables)
- {
- DEALLOCATE_LOCAL(pDrawables);
- }
-
- return(BadAlloc);
- }
-
- /* Account for n, number of xDbeVisInfo items in list. */
- length += sizeof(CARD32);
-
- /* Account for n xDbeVisInfo items */
- length += pScrVisInfo[i].count * sizeof(xDbeVisInfo);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = length >> 2;
- rep.m = count;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.m, n);
- }
-
- /* Send off reply. */
- WriteToClient(client, sizeof(xDbeGetVisualInfoReply), (char *)&rep);
-
- for (i = 0; i < count; i++)
- {
- CARD32 data32;
-
- /* For each screen in the reply, send off the visual info */
-
- /* Send off number of visuals. */
- data32 = (CARD32)pScrVisInfo[i].count;
-
- if (client->swapped)
- {
- swapl(&data32, n);
- }
-
- WriteToClient(client, sizeof(CARD32), (char *)&data32);
-
- /* Now send off visual info items. */
- for (j = 0; j < pScrVisInfo[i].count; j++)
- {
- xDbeVisInfo visInfo;
-
- /* Copy the data in the client data structure to a protocol
- * data structure. We will send data to the client from the
- * protocol data structure.
- */
-
- visInfo.visualID = (CARD32)pScrVisInfo[i].visinfo[j].visual;
- visInfo.depth = (CARD8) pScrVisInfo[i].visinfo[j].depth;
- visInfo.perfLevel = (CARD8) pScrVisInfo[i].visinfo[j].perflevel;
-
- if (client->swapped)
- {
- swapl(&visInfo.visualID, n);
-
- /* We do not need to swap depth and perfLevel since they are
- * already 1 byte quantities.
- */
- }
-
- /* Write visualID(32), depth(8), perfLevel(8), and pad(16). */
- WriteToClient(client, 2*sizeof(CARD32), (char *)&visInfo.visualID);
- }
- }
-
- /* Clean up memory. */
- for (i = 0; i < count; i++)
- {
- xfree(pScrVisInfo[i].visinfo);
- }
- xfree(pScrVisInfo);
-
- if (pDrawables)
- {
- DEALLOCATE_LOCAL(pDrawables);
- }
-
- return(client->noClientException);
-
-} /* ProcDbeGetVisualInfo() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeGetbackBufferAttributes
- *
- * Description:
- *
- * This function is for processing a ProcDbeGetbackBufferAttributes
- * request. This request returns information about a back buffer.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-ProcDbeGetBackBufferAttributes(client)
- ClientPtr client;
-{
- REQUEST(xDbeGetBackBufferAttributesReq);
- xDbeGetBackBufferAttributesReply rep;
- DbeWindowPrivPtr pDbeWindowPriv;
- int n;
-
-
- REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
-
- if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client,
- stuff->buffer, dbeWindowPrivResType, SecurityReadAccess)))
- {
- rep.attributes = None;
- }
- else
- {
- rep.attributes = pDbeWindowPriv->pWindow->drawable.id;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.attributes, n);
- }
-
- WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
- (char *)&rep);
- return(client->noClientException);
-
-} /* ProcDbeGetbackBufferAttributes() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: ProcDbeDispatch
- *
- * Description:
- *
- * This function dispatches DBE requests.
- *
- *****************************************************************************/
-
-static int
-ProcDbeDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
-
- switch (stuff->data)
- {
- case X_DbeGetVersion:
- return(ProcDbeGetVersion(client));
-
- case X_DbeAllocateBackBufferName:
- return(ProcDbeAllocateBackBufferName(client));
-
- case X_DbeDeallocateBackBufferName:
- return(ProcDbeDeallocateBackBufferName(client));
-
- case X_DbeSwapBuffers:
- return(ProcDbeSwapBuffers(client));
-
- case X_DbeBeginIdiom:
- return(ProcDbeBeginIdiom(client));
-
- case X_DbeEndIdiom:
- return(Success);
-
- case X_DbeGetVisualInfo:
- return(ProcDbeGetVisualInfo(client));
-
- case X_DbeGetBackBufferAttributes:
- return(ProcDbeGetBackBufferAttributes(client));
-
- default:
- return(BadRequest);
- }
-
-} /* ProcDbeDispatch() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeGetVersion
- *
- * Description:
- *
- * This function is for processing a DbeGetVersion request on a swapped
- * server. This request returns the major and minor version numbers of
- * this extension.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeGetVersion(client)
- ClientPtr client;
-{
- REQUEST(xDbeGetVersionReq);
- register int n;
-
-
- swaps(&stuff->length, n);
- return(ProcDbeGetVersion(client));
-
-} /* SProcDbeGetVersion() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeAllocateBackBufferName
- *
- * Description:
- *
- * This function is for processing a DbeAllocateBackBufferName request on
- * a swapped server. This request allocates a drawable ID used to refer
- * to the back buffer of a window.
- *
- * Return Values:
- *
- * BadAlloc - server can not allocate resources
- * BadIDChoice - id is out of range for client; id is already in use
- * BadMatch - window is not an InputOutput window;
- * visual of window is not on list returned by
- * DBEGetVisualInfo;
- * BadValue - invalid swap action is specified
- * BadWindow - window is not a valid window
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeAllocateBackBufferName(client)
- ClientPtr client;
-{
- REQUEST(xDbeAllocateBackBufferNameReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
-
- swapl(&stuff->window, n);
- swapl(&stuff->buffer, n);
- /* stuff->swapAction is a byte. We do not need to swap this field. */
-
- return(ProcDbeAllocateBackBufferName(client));
-
-} /* SProcDbeAllocateBackBufferName() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeDeallocateBackBufferName
- *
- * Description:
- *
- * This function is for processing a DbeDeallocateBackBufferName request
- * on a swapped server. This request frees a drawable ID that was
- * obtained by a DbeAllocateBackBufferName request.
- *
- * Return Values:
- *
- * BadBuffer - buffer to deallocate is not associated with a window
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeDeallocateBackBufferName(client)
- ClientPtr client;
-{
- REQUEST (xDbeDeallocateBackBufferNameReq);
- register int n;
-
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
-
- swapl(&stuff->buffer, n);
-
- return(ProcDbeDeallocateBackBufferName(client));
-
-} /* SProcDbeDeallocateBackBufferName() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeSwapBuffers
- *
- * Description:
- *
- * This function is for processing a DbeSwapBuffers request on a swapped
- * server. This request swaps the buffers for all windows listed,
- * applying the appropriate swap action for each window.
- *
- * Return Values:
- *
- * BadMatch - a window in request is not double-buffered; a window in
- * request is listed more than once; all windows in request do
- * not have the same root
- * BadValue - invalid swap action is specified
- * BadWindow - a window in request is not valid
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeSwapBuffers(client)
- ClientPtr client;
-{
- REQUEST(xDbeSwapBuffersReq);
- register int i, n;
- xDbeSwapInfo *pSwapInfo;
-
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
-
- swapl(&stuff->n, n);
-
- if (stuff->n != 0)
- {
- pSwapInfo = (xDbeSwapInfo *)stuff+1;
-
- /* The swap info following the fix part of this request is a window(32)
- * followed by a 1 byte swap action and then 3 pad bytes. We only need
- * to swap the window information.
- */
- for (i = 0; i < stuff->n; i++)
- {
- swapl(&pSwapInfo->window, n);
- }
- }
-
- return(ProcDbeSwapBuffers(client));
-
-} /* SProcDbeSwapBuffers() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeBeginIdiom
- *
- * Description:
- *
- * This function is for processing a DbeBeginIdiom request on a swapped
- * server. This request informs the server that a complex swap will
- * immediately follow this request.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeBeginIdiom(client)
- ClientPtr client;
-{
- REQUEST(xDbeBeginIdiomReq);
- register int n;
-
- swaps(&stuff->length, n);
- return(ProcDbeBeginIdiom(client));
-
-} /* SProcDbeBeginIdiom() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeGetVisualInfo
- *
- * Description:
- *
- * This function is for processing a ProcDbeGetVisualInfo request on a
- * swapped server. This request returns information about which visuals
- * support double buffering.
- *
- * Return Values:
- *
- * BadDrawable - value in screen specifiers is not a valid drawable
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeGetVisualInfo(client)
- ClientPtr client;
-{
- REQUEST(xDbeGetVisualInfoReq);
- register int n;
-
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
-
- swapl(&stuff->n, n);
- SwapRestL(stuff);
-
- return(ProcDbeGetVisualInfo(client));
-
-} /* SProcDbeGetVisualInfo() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeGetbackBufferAttributes
- *
- * Description:
- *
- * This function is for processing a ProcDbeGetbackBufferAttributes
- * request on a swapped server. This request returns information about a
- * back buffer.
- *
- * Return Values:
- *
- * Success
- *
- *****************************************************************************/
-
-static int
-SProcDbeGetBackBufferAttributes(client)
- ClientPtr client;
-{
- REQUEST (xDbeGetBackBufferAttributesReq);
- register int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
-
- swapl(&stuff->buffer, n);
-
- return(ProcDbeGetBackBufferAttributes(client));
-
-} /* SProcDbeGetBackBufferAttributes() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: SProcDbeDispatch
- *
- * Description:
- *
- * This function dispatches DBE requests on a swapped server.
- *
- *****************************************************************************/
-
-static int
-SProcDbeDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
-
- switch (stuff->data)
- {
- case X_DbeGetVersion:
- return(SProcDbeGetVersion(client));
-
- case X_DbeAllocateBackBufferName:
- return(SProcDbeAllocateBackBufferName(client));
-
- case X_DbeDeallocateBackBufferName:
- return(SProcDbeDeallocateBackBufferName(client));
-
- case X_DbeSwapBuffers:
- return(SProcDbeSwapBuffers(client));
-
- case X_DbeBeginIdiom:
- return(SProcDbeBeginIdiom(client));
-
- case X_DbeEndIdiom:
- return(Success);
-
- case X_DbeGetVisualInfo:
- return(SProcDbeGetVisualInfo(client));
-
- case X_DbeGetBackBufferAttributes:
- return(SProcDbeGetBackBufferAttributes(client));
-
- default:
- return (BadRequest);
- }
-
-} /* SProcDbeDispatch() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeSetupBackgroundPainter
- *
- * Description:
- *
- * This function sets up pGC to clear pixmaps.
- *
- * Return Values:
- *
- * TRUE - setup was successful
- * FALSE - the window's background state is NONE
- *
- *****************************************************************************/
-
-static Bool
-DbeSetupBackgroundPainter(pWin, pGC)
- WindowPtr pWin;
- GCPtr pGC;
-{
- pointer gcvalues[4];
- int ts_x_origin, ts_y_origin;
- PixUnion background;
- int backgroundState;
- Mask gcmask;
-
-
- /* First take care of any ParentRelative stuff by altering the
- * tile/stipple origin to match the coordinates of the upper-left
- * corner of the first ancestor without a ParentRelative background.
- * This coordinate is, of course, negative.
- */
- ts_x_origin = ts_y_origin = 0;
- while (pWin->backgroundState == ParentRelative)
- {
- ts_x_origin -= pWin->origin.x;
- ts_y_origin -= pWin->origin.y;
-
- pWin = pWin->parent;
- }
- backgroundState = pWin->backgroundState;
- background = pWin->background;
-
- switch (backgroundState)
- {
- case BackgroundPixel:
- gcvalues[0] = (pointer)background.pixel;
- gcvalues[1] = (pointer)FillSolid;
- gcmask = GCForeground|GCFillStyle;
- break;
-
- case BackgroundPixmap:
- gcvalues[0] = (pointer)FillTiled;
- gcvalues[1] = (pointer)background.pixmap;
- gcvalues[2] = (pointer)(long)ts_x_origin;
- gcvalues[3] = (pointer)(long)ts_y_origin;
- gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin;
- break;
-
- default:
- /* pWin->backgroundState == None */
- return(FALSE);
- }
-
- if (DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE) != 0)
- {
- return(FALSE);
- }
-
- return(TRUE);
-
-} /* DbeSetupBackgroundPainter() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeDrawableDelete
- *
- * Description:
- *
- * This is the resource delete function for dbeDrawableResType.
- * It is registered when the drawable resource type is created in
- * DbeExtensionInit().
- *
- * To make resource deletion simple, we do not do anything in this function
- * and leave all resource deleteion to DbeWindowPrivDelete(), which will
- * eventually be called or already has been called. Deletion functions are
- * not guaranteed to be called in any particular order.
- *
- *****************************************************************************/
-static int
-DbeDrawableDelete(pDrawable, id)
- pointer pDrawable;
- XID id;
-{
- return(Success);
-
-} /* DbeDrawableDelete() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeWindowPrivDelete
- *
- * Description:
- *
- * This is the resource delete function for dbeWindowPrivResType.
- * It is registered when the drawable resource type is created in
- * DbeExtensionInit().
- *
- *****************************************************************************/
-static int
-DbeWindowPrivDelete(pDbeWinPriv, id)
- pointer pDbeWinPriv;
- XID id;
-{
- DbeScreenPrivPtr pDbeScreenPriv;
- DbeWindowPrivPtr pDbeWindowPriv = (DbeWindowPrivPtr)pDbeWinPriv;
- int i;
-
-
- /*
- **************************************************************************
- ** Remove the buffer ID from the ID array.
- **************************************************************************
- */
-
- /* Find the ID in the ID array. */
- i = 0;
- while ((i < pDbeWindowPriv->nBufferIDs) && (pDbeWindowPriv->IDs[i] != id))
- {
- i++;
- }
-
- if (i == pDbeWindowPriv->nBufferIDs)
- {
- /* We did not find the ID in the array. We should never get here. */
- return(BadValue);
- }
-
- /* Remove the ID from the array. */
-
- if (i < (pDbeWindowPriv->nBufferIDs - 1))
- {
- /* Compress the buffer ID array, overwriting the ID in the process. */
- memmove(&pDbeWindowPriv->IDs[i], &pDbeWindowPriv->IDs[i+1],
- (pDbeWindowPriv->nBufferIDs - i - 1) * sizeof(XID));
- }
- else
- {
- /* We are removing the last ID in the array, in which case, the
- * assignement below is all that we need to do.
- */
- }
- pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs - 1] = DBE_FREE_ID_ELEMENT;
-
- pDbeWindowPriv->nBufferIDs--;
-
- /* If an extended array was allocated, then check to see if the remaining
- * buffer IDs will fit in the static array.
- */
-
- if ((pDbeWindowPriv->maxAvailableIDs > DBE_INIT_MAX_IDS) &&
- (pDbeWindowPriv->nBufferIDs == DBE_INIT_MAX_IDS))
- {
- /* Copy the IDs back into the static array. */
- memcpy(pDbeWindowPriv->initIDs, pDbeWindowPriv->IDs,
- DBE_INIT_MAX_IDS * sizeof(XID));
-
- /* Free the extended array; use the static array. */
- xfree(pDbeWindowPriv->IDs);
- pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs;
- pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
- }
-
-
- /*
- **************************************************************************
- ** Perform DDX level tasks.
- **************************************************************************
- */
-
- pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW_PRIV(
- (DbeWindowPrivPtr)pDbeWindowPriv);
- (*pDbeScreenPriv->WinPrivDelete)((DbeWindowPrivPtr)pDbeWindowPriv, id);
-
-
- /*
- **************************************************************************
- ** Perform miscellaneous tasks if this is the last buffer associated
- ** with the window.
- **************************************************************************
- */
-
- if (pDbeWindowPriv->nBufferIDs == 0)
- {
- /* Reset the DBE window priv pointer. */
- pDbeWindowPriv->pWindow->devPrivates[dbeWindowPrivIndex].ptr =
- (pointer)NULL;
-
- /* We are done with the window priv. */
- xfree(pDbeWindowPriv);
- }
-
- return(Success);
-
-} /* DbeWindowPrivDelete() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeResetProc
- *
- * Description:
- *
- * This routine is called at the end of every server generation.
- * It deallocates any memory reserved for the extension and performs any
- * other tasks related to shutting down the extension.
- *
- *****************************************************************************/
-static void
-DbeResetProc(extEntry)
- ExtensionEntry *extEntry;
-{
- int i;
- ScreenPtr pScreen;
- DbeScreenPrivPtr pDbeScreenPriv;
-
-
- if (dbeScreenPrivIndex < 0)
- {
- return;
- }
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- if (pDbeScreenPriv)
- {
- /* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit().*/
- pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
-
- if (pDbeScreenPriv->ResetProc)
- (*pDbeScreenPriv->ResetProc)(pScreen);
-
- if (pDbeScreenPriv->winPrivPrivSizes)
- {
- xfree(pDbeScreenPriv->winPrivPrivSizes);
- }
-
- xfree(pDbeScreenPriv);
- }
- }
-
- /* We want to init the initialization function table after every server
- * reset in DbeRegisterFunction().
- */
- firstRegistrationPass = TRUE;
-
-} /* DbeResetProc() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeDestroyWindow
- *
- * Description:
- *
- * This is the wrapper for pScreen->DestroyWindow.
- * This function frees buffer resources for a window before it is
- * destroyed.
- *
- *****************************************************************************/
-
-static Bool
-DbeDestroyWindow(pWin)
- WindowPtr pWin;
-{
- DbeScreenPrivPtr pDbeScreenPriv;
- DbeWindowPrivPtr pDbeWindowPriv;
- ScreenPtr pScreen;
- Bool ret;
-
-
- /*
- **************************************************************************
- ** 1. Unwrap the member routine.
- **************************************************************************
- */
-
- pScreen = pWin->drawable.pScreen;
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
- pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
-
- /*
- **************************************************************************
- ** 2. Do any work necessary before the member routine is called.
- **
- ** Call the window priv delete function for all buffer IDs associated
- ** with this window.
- **************************************************************************
- */
-
- if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
- {
- while (pDbeWindowPriv)
- {
- /* *DbeWinPrivDelete() will free the window private and set it to
- * NULL if there are no more buffer IDs associated with this
- * window.
- */
- FreeResource(pDbeWindowPriv->IDs[0], RT_NONE);
- pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
- }
- }
-
- /*
- **************************************************************************
- ** 3. Call the member routine, saving its result if necessary.
- **************************************************************************
- */
-
- ret = (*pScreen->DestroyWindow)(pWin);
-
- /*
- **************************************************************************
- ** 4. Rewrap the member routine, restoring the wrapper value first in case
- ** the wrapper (or something that it wrapped) change this value.
- **************************************************************************
- */
-
- pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- pScreen->DestroyWindow = DbeDestroyWindow;
-
- /*
- **************************************************************************
- ** 5. Do any work necessary after the member routine has been called.
- **
- ** In this case we do not need to do anything.
- **************************************************************************
- */
-
- return(ret);
-
-} /* DbeDestroyWindow() */
-
-
-/******************************************************************************
- *
- * DBE DIX Procedure: DbeExtensionInit
- *
- * Description:
- *
- * Called from InitExtensions in main()
- *
- *****************************************************************************/
-
-void
-DbeExtensionInit()
-{
- ExtensionEntry *extEntry;
- register int i, j;
- ScreenPtr pScreen = NULL;
- DbeScreenPrivPtr pDbeScreenPriv;
- int nStubbedScreens = 0;
- Bool ddxInitSuccess;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) return;
-#endif
-
- /* Allocate private pointers in windows and screens. */
-
- if ((dbeScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
- {
- return;
- }
-
- if ((dbeWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
- {
- return;
- }
-
- /* Initialize the priv priv counts between server generations. */
- winPrivPrivCount = 0;
-
- /* Create the resource types. */
- dbeDrawableResType =
- CreateNewResourceType(DbeDrawableDelete) | RC_CACHED | RC_DRAWABLE;
- dbeWindowPrivResType =
- CreateNewResourceType(DbeWindowPrivDelete);
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- /* For each screen, set up DBE screen privates and init DIX and DDX
- * interface.
- */
-
- pScreen = screenInfo.screens[i];
-
- if (!AllocateWindowPrivate(pScreen, dbeWindowPrivIndex, 0) ||
- !(pDbeScreenPriv =
- (DbeScreenPrivPtr)Xcalloc(sizeof(DbeScreenPrivRec))))
- {
- /* If we can not alloc a window or screen private,
- * then free any privates that we already alloc'ed and return
- */
-
- for (j = 0; j < i; j++)
- {
- xfree(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr);
- screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr = NULL;
- }
- return;
- }
-
- pScreen->devPrivates[dbeScreenPrivIndex].ptr = (pointer)pDbeScreenPriv;
-
- /* Store the DBE priv priv size info for later use when allocating
- * priv privs at the driver level.
- */
- pDbeScreenPriv->winPrivPrivLen = 0;
- pDbeScreenPriv->winPrivPrivSizes = (unsigned *)NULL;
- pDbeScreenPriv->totalWinPrivSize = sizeof(DbeWindowPrivRec);
-
- /* Copy the resource types */
- pDbeScreenPriv->dbeDrawableResType = dbeDrawableResType;
- pDbeScreenPriv->dbeWindowPrivResType = dbeWindowPrivResType;
-
- /* Copy the private indices */
- pDbeScreenPriv->dbeScreenPrivIndex = dbeScreenPrivIndex;
- pDbeScreenPriv->dbeWindowPrivIndex = dbeWindowPrivIndex;
-
- if(DbeInitFunct[i])
- {
- /* This screen supports DBE. */
-
- /* Setup DIX. */
- pDbeScreenPriv->SetupBackgroundPainter = DbeSetupBackgroundPainter;
- pDbeScreenPriv->AllocWinPriv = DbeAllocWinPriv;
- pDbeScreenPriv->AllocWinPrivPrivIndex = DbeAllocWinPrivPrivIndex;
- pDbeScreenPriv->AllocWinPrivPriv = DbeAllocWinPrivPriv;
-
- /* Setup DDX. */
- ddxInitSuccess = (*DbeInitFunct[i])(pScreen, pDbeScreenPriv);
-
- /* DDX DBE initialization may have the side affect of
- * reallocating pDbeScreenPriv, so we need to update it.
- */
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- if (ddxInitSuccess)
- {
- /* Wrap DestroyWindow. The DDX initialization function
- * already wrapped PositionWindow for us.
- */
-
- pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- pScreen->DestroyWindow = DbeDestroyWindow;
- }
- else
- {
- /* DDX initialization failed. Stub the screen. */
- DbeStubScreen(pDbeScreenPriv, &nStubbedScreens);
- }
- }
- else
- {
- /* This screen does not support DBE. */
-
-#ifndef DISABLE_MI_DBE_BY_DEFAULT
- /* Setup DIX. */
- pDbeScreenPriv->SetupBackgroundPainter = DbeSetupBackgroundPainter;
- pDbeScreenPriv->AllocWinPriv = DbeAllocWinPriv;
- pDbeScreenPriv->AllocWinPrivPrivIndex = DbeAllocWinPrivPrivIndex;
- pDbeScreenPriv->AllocWinPrivPriv = DbeAllocWinPrivPriv;
-
- /* Setup DDX. */
- ddxInitSuccess = miDbeInit(pScreen, pDbeScreenPriv);
-
- /* DDX DBE initialization may have the side affect of
- * reallocating pDbeScreenPriv, so we need to update it.
- */
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- if (ddxInitSuccess)
- {
- /* Wrap DestroyWindow. The DDX initialization function
- * already wrapped PositionWindow for us.
- */
-
- pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- pScreen->DestroyWindow = DbeDestroyWindow;
- }
- else
- {
- /* DDX initialization failed. Stub the screen. */
- DbeStubScreen(pDbeScreenPriv, &nStubbedScreens);
- }
-#else
- DbeStubScreen(pDbeScreenPriv, &nStubbedScreens);
-#endif
-
- } /* else -- this screen does not support DBE. */
-
- } /* for (i = 0; i < screenInfo.numScreens; i++) */
-
-
- if (nStubbedScreens == screenInfo.numScreens)
- {
- /* All screens stubbed. Clean up and return. */
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- xfree(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr);
- pScreen->devPrivates[dbeScreenPrivIndex].ptr = NULL;
- }
- return;
- }
-
-
- /* Now add the extension. */
- extEntry = AddExtension(DBE_PROTOCOL_NAME, DbeNumberEvents,
- DbeNumberErrors, ProcDbeDispatch, SProcDbeDispatch,
- DbeResetProc, StandardMinorOpcode);
-
- dbeErrorBase = extEntry->errorBase;
-
-} /* DbeExtensionInit() */
-
diff --git a/dbe/dbestruct.h b/dbe/dbestruct.h
deleted file mode 100644
index 3634fe7d7..000000000
--- a/dbe/dbestruct.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/* $Xorg: dbestruct.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */
-/******************************************************************************
- *
- * Copyright (c) 1994, 1995 Hewlett-Packard Company
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the Hewlett-Packard
- * Company shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization from the Hewlett-Packard Company.
- *
- * Header file for DIX-related DBE
- *
- *****************************************************************************/
-/* $XFree86: xc/programs/Xserver/dbe/dbestruct.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */
-
-
-#ifndef DBE_STRUCT_H
-#define DBE_STRUCT_H
-
-
-/* INCLUDES */
-
-#define NEED_DBE_PROTOCOL
-#include "Xdbeproto.h"
-#include "windowstr.h"
-
-
-/* DEFINES */
-
-#define DBE_SCREEN_PRIV(pScreen) \
- ((dbeScreenPrivIndex < 0) ? \
- NULL : \
- ((DbeScreenPrivPtr)((pScreen)->devPrivates[dbeScreenPrivIndex].ptr)))
-
-#define DBE_SCREEN_PRIV_FROM_DRAWABLE(pDrawable) \
- DBE_SCREEN_PRIV((pDrawable)->pScreen)
-
-#define DBE_SCREEN_PRIV_FROM_WINDOW_PRIV(pDbeWindowPriv) \
- DBE_SCREEN_PRIV((pDbeWindowPriv)->pWindow->drawable.pScreen)
-
-#define DBE_SCREEN_PRIV_FROM_WINDOW(pWindow) \
- DBE_SCREEN_PRIV((pWindow)->drawable.pScreen)
-
-#define DBE_SCREEN_PRIV_FROM_PIXMAP(pPixmap) \
- DBE_SCREEN_PRIV((pPixmap)->drawable.pScreen)
-
-#define DBE_SCREEN_PRIV_FROM_GC(pGC)\
- DBE_SCREEN_PRIV((pGC)->pScreen)
-
-#define DBE_WINDOW_PRIV(pWindow)\
- ((dbeWindowPrivIndex < 0) ? \
- NULL : \
- ((DbeWindowPrivPtr)(pWindow->devPrivates[dbeWindowPrivIndex].ptr)))
-
-/* Initial size of the buffer ID array in the window priv. */
-#define DBE_INIT_MAX_IDS 2
-
-/* Reallocation increment for the buffer ID array. */
-#define DBE_INCR_MAX_IDS 4
-
-/* Marker for free elements in the buffer ID array. */
-#define DBE_FREE_ID_ELEMENT 0
-
-
-/* TYPEDEFS */
-
-/* Record used to pass swap information between DIX and DDX swapping
- * procedures.
- */
-typedef struct _DbeSwapInfoRec
-{
- WindowPtr pWindow;
- unsigned char swapAction;
-
-} DbeSwapInfoRec, *DbeSwapInfoPtr;
-
-/*
- ******************************************************************************
- ** Per-window data
- ******************************************************************************
- */
-
-typedef struct _DbeWindowPrivRec
-{
- /* A pointer to the window with which the DBE window private (buffer) is
- * associated.
- */
- WindowPtr pWindow;
-
- /* Last known swap action for this buffer. Legal values for this field
- * are XdbeUndefined, XdbeBackground, XdbeUntouched, and XdbeCopied.
- */
- unsigned char swapAction;
-
- /* Last known buffer size.
- */
- unsigned short width, height;
-
- /* Coordinates used for static gravity when the window is positioned.
- */
- short x, y;
-
- /* Number of XIDs associated with this buffer.
- */
- int nBufferIDs;
-
- /* Capacity of the current buffer ID array, IDs. */
- int maxAvailableIDs;
-
- /* Pointer to the array of buffer IDs. This initially points to initIDs.
- * When the static limit of the initIDs array is reached, the array is
- * reallocated and this pointer is set to the new array instead of initIDs.
- */
- XID *IDs;
-
- /* Initial array of buffer IDs. We are defining the XID array within the
- * window priv to optimize for data locality. In most cases, only one
- * buffer will be associated with a window. Having the array declared
- * here can prevent us from accessing the data in another memory page,
- * possibly resulting in a page swap and loss of performance. Initially we
- * will use this array to store buffer IDs. For situations where we have
- * more IDs than can fit in this static array, we will allocate a larger
- * array to use, possibly suffering a performance loss.
- */
- XID initIDs[DBE_INIT_MAX_IDS];
-
- /* Device-specific private information.
- */
- DevUnion *devPrivates;
-
-} DbeWindowPrivRec, *DbeWindowPrivPtr;
-
-
-/*
- ******************************************************************************
- ** Per-screen data
- ******************************************************************************
- */
-
-typedef struct _DbeScreenPrivRec
-{
- /* Info for creating window privs */
- int winPrivPrivLen; /* Length of privs in DbeWindowPrivRec */
- unsigned int *winPrivPrivSizes; /* Array of private record sizes */
- unsigned int totalWinPrivSize; /* PrivRec + size of all priv priv ptrs */
-
- /* Resources created by DIX to be used by DDX */
- RESTYPE dbeDrawableResType;
- RESTYPE dbeWindowPrivResType;
-
- /* Private indices created by DIX to be used by DDX */
- int dbeScreenPrivIndex;
- int dbeWindowPrivIndex;
-
- /* Wrapped functions
- * It is the responsibilty of the DDX layer to wrap PositionWindow().
- * DbeExtensionInit wraps DestroyWindow().
- */
- PositionWindowProcPtr PositionWindow;
- DestroyWindowProcPtr DestroyWindow;
-
- /* Per-screen DIX routines */
- Bool (*SetupBackgroundPainter)(
- WindowPtr /*pWin*/,
- GCPtr /*pGC*/
-);
- DbeWindowPrivPtr (*AllocWinPriv)(
- ScreenPtr /*pScreen*/
-);
- int (*AllocWinPrivPrivIndex)(
- void
-);
- Bool (*AllocWinPrivPriv)(
- ScreenPtr /*pScreen*/,
- int /*index*/,
- unsigned /*amount*/
-);
-
- /* Per-screen DDX routines */
- Bool (*GetVisualInfo)(
- ScreenPtr /*pScreen*/,
- XdbeScreenVisualInfo * /*pVisInfo*/
-);
- int (*AllocBackBufferName)(
- WindowPtr /*pWin*/,
- XID /*bufId*/,
- int /*swapAction*/
-);
- int (*SwapBuffers)(
- ClientPtr /*client*/,
- int * /*pNumWindows*/,
- DbeSwapInfoPtr /*swapInfo*/
-);
- void (*BeginIdiom)(
- ClientPtr /*client*/
-);
- void (*EndIdiom)(
- ClientPtr /*client*/
-);
- void (*WinPrivDelete)(
- DbeWindowPrivPtr /*pDbeWindowPriv*/,
- XID /*bufId*/
-);
- void (*ResetProc)(
- ScreenPtr /*pScreen*/
-);
- void (*ValidateBuffer)(
- WindowPtr /*pWin*/,
- XID /*bufId*/,
- Bool /*dstbuffer*/
-);
-
- /* Device-specific private information.
- */
- DevUnion *devPrivates;
-
-} DbeScreenPrivRec, *DbeScreenPrivPtr;
-
-#endif /* DBE_STRUCT_H */
diff --git a/dbe/midbe.c b/dbe/midbe.c
deleted file mode 100644
index e7617e728..000000000
--- a/dbe/midbe.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/* $Xorg: midbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */
-/******************************************************************************
- *
- * Copyright (c) 1994, 1995 Hewlett-Packard Company
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the Hewlett-Packard
- * Company shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization from the Hewlett-Packard Company.
- *
- * Machine-independent DBE code
- *
- *****************************************************************************/
-/* $XFree86: xc/programs/Xserver/dbe/midbe.c,v 3.5 2001/08/23 14:19:24 alanh Exp $ */
-
-
-/* INCLUDES */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include "dbestruct.h"
-#include "midbestr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "inputstr.h"
-
-#ifndef IN_MODULE
-#include <stdio.h>
-#else
-#include "xf86_ansic.h"
-#endif
-
-/* DEFINES */
-
-
-/* TYPEDEFS */
-
-
-/* GLOBALS */
-
-static int miDbePrivPrivGeneration = 0;
-static int miDbeWindowPrivPrivIndex = -1;
-RESTYPE dbeDrawableResType;
-RESTYPE dbeWindowPrivResType;
-int dbeScreenPrivIndex = -1;
-int dbeWindowPrivIndex = -1;
-
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeGetVisualInfo
- *
- * Description:
- *
- * This is the MI function for the DbeGetVisualInfo request. This function
- * is called through pDbeScreenPriv->GetVisualInfo. This function is also
- * called for the DbeAllocateBackBufferName request at the extension level;
- * it is called by ProcDbeAllocateBackBufferName() in dbe.c.
- *
- * If memory allocation fails or we can not get the visual info, this
- * function returns FALSE. Otherwise, it returns TRUE for success.
- *
- *****************************************************************************/
-
-static Bool
-miDbeGetVisualInfo(pScreen, pScrVisInfo)
- ScreenPtr pScreen;
- XdbeScreenVisualInfo *pScrVisInfo;
-{
- register int i, j, k;
- register int count;
- DepthPtr pDepth;
- XdbeVisualInfo *visInfo;
-
-
- /* Determine number of visuals for this screen. */
- for (i = 0, count = 0; i < pScreen->numDepths; i++)
- {
- count += pScreen->allowedDepths[i].numVids;
- }
-
- /* Allocate an array of XdbeVisualInfo items. */
- if (!(visInfo = (XdbeVisualInfo *)xalloc(count * sizeof(XdbeVisualInfo))))
- {
- return(FALSE); /* memory alloc failure */
- }
-
- for (i = 0, k = 0; i < pScreen->numDepths; i++)
- {
- /* For each depth of this screen, get visual information. */
-
- pDepth = &pScreen->allowedDepths[i];
-
- for (j = 0; j < pDepth->numVids; j++)
- {
- /* For each visual for this depth of this screen, get visual ID
- * and visual depth. Since this is MI code, we will always return
- * the same performance level for all visuals (0). A higher
- * performance level value indicates higher performance.
- */
- visInfo[k].visual = pDepth->vids[j];
- visInfo[k].depth = pDepth->depth;
- visInfo[k].perflevel = 0;
- k++;
- }
- }
-
- /* Record the number of visuals and point visual_depth to
- * the array of visual info.
- */
- pScrVisInfo->count = count;
- pScrVisInfo->visinfo = visInfo;
-
- return(TRUE); /* success */
-
-} /* miDbeGetVisualInfo() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miAllocBackBufferName
- *
- * Description:
- *
- * This is the MI function for the DbeAllocateBackBufferName request.
- *
- *****************************************************************************/
-
-static int
-miDbeAllocBackBufferName(pWin, bufId, swapAction)
- WindowPtr pWin;
- XID bufId;
- int swapAction;
-{
- ScreenPtr pScreen;
- DbeWindowPrivPtr pDbeWindowPriv;
- MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
- DbeScreenPrivPtr pDbeScreenPriv;
- GCPtr pGC;
- xRectangle clearRect;
-
-
- pScreen = pWin->drawable.pScreen;
- pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
-
- if (pDbeWindowPriv->nBufferIDs == 0)
- {
- /* There is no buffer associated with the window.
- * We have to create the window priv priv. Remember, the window
- * priv was created at the DIX level, so all we need to do is
- * create the priv priv and attach it to the priv.
- */
-
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- /* Setup the window priv priv. */
- pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
- pDbeWindowPrivPriv->pDbeWindowPriv = pDbeWindowPriv;
-
- /* Get a front pixmap. */
- if (!(pDbeWindowPrivPriv->pFrontBuffer =
- (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
- pDbeWindowPriv->height,
- pWin->drawable.depth)))
- {
- return(BadAlloc);
- }
-
- /* Get a back pixmap. */
- if (!(pDbeWindowPrivPriv->pBackBuffer =
- (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
- pDbeWindowPriv->height,
- pWin->drawable.depth)))
- {
- (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
- return(BadAlloc);
- }
-
-
- /* Make the back pixmap a DBE drawable resource. */
- if (!AddResource(bufId, dbeDrawableResType,
- (pointer)pDbeWindowPrivPriv->pBackBuffer))
- {
- /* free the buffer and the drawable resource */
- FreeResource(bufId, RT_NONE);
- return(BadAlloc);
- }
-
-
- /* Attach the priv priv to the priv. */
- pDbeWindowPriv->devPrivates[miDbeWindowPrivPrivIndex].ptr =
- (pointer)pDbeWindowPrivPriv;
-
-
- /* Clear the back buffer. */
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
- if ((*pDbeScreenPriv->SetupBackgroundPainter)(pWin, pGC))
- {
- ValidateGC((DrawablePtr)pDbeWindowPrivPriv->pBackBuffer, pGC);
- clearRect.x = clearRect.y = 0;
- clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width;
- clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height;
- (*pGC->ops->PolyFillRect)(
- (DrawablePtr)pDbeWindowPrivPriv->pBackBuffer, pGC, 1,
- &clearRect);
- }
- FreeScratchGC(pGC);
-
- } /* if no buffer associated with the window */
-
- else
- {
- /* A buffer is already associated with the window.
- * Place the new buffer ID information at the head of the ID list.
- */
-
- /* Associate the new ID with an existing pixmap. */
- pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
- if (!AddResource(bufId, dbeDrawableResType,
- (pointer)pDbeWindowPrivPriv->pBackBuffer))
- {
- return(BadAlloc);
- }
-
- }
-
- return(Success);
-
-} /* miDbeAllocBackBufferName() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeAliasBuffers
- *
- * Description:
- *
- * This function associates all XIDs of a buffer with the back pixmap
- * stored in the window priv.
- *
- *****************************************************************************/
-
-static void
-miDbeAliasBuffers(pDbeWindowPriv)
- DbeWindowPrivPtr pDbeWindowPriv;
-{
- int i;
- MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv =
- MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
-
- for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++)
- {
- ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType,
- (pointer)pDbeWindowPrivPriv->pBackBuffer);
- }
-
-} /* miDbeAliasBuffers() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeSwapBuffers
- *
- * Description:
- *
- * This is the MI function for the DbeSwapBuffers request.
- *
- *****************************************************************************/
-
-static int
-miDbeSwapBuffers(client, pNumWindows, swapInfo)
- ClientPtr client;
- int *pNumWindows;
- DbeSwapInfoPtr swapInfo;
-{
- DbeScreenPrivPtr pDbeScreenPriv;
- GCPtr pGC;
- WindowPtr pWin;
- MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
- PixmapPtr pTmpBuffer;
- xRectangle clearRect;
-
-
- pWin = swapInfo[0].pWindow;
- pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
- pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin);
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
-
- /*
- **********************************************************************
- ** Setup before swap.
- **********************************************************************
- */
-
- switch(swapInfo[0].swapAction)
- {
- case XdbeUndefined:
- break;
-
- case XdbeBackground:
- break;
-
- case XdbeUntouched:
- ValidateGC((DrawablePtr)pDbeWindowPrivPriv->pFrontBuffer, pGC);
- (*pGC->ops->CopyArea)((DrawablePtr)pWin,
- (DrawablePtr)pDbeWindowPrivPriv->pFrontBuffer,
- pGC, 0, 0, pWin->drawable.width,
- pWin->drawable.height, 0, 0);
- break;
-
- case XdbeCopied:
- break;
-
- }
-
- /*
- **********************************************************************
- ** Swap.
- **********************************************************************
- */
-
- ValidateGC((DrawablePtr)pWin, pGC);
- (*pGC->ops->CopyArea)((DrawablePtr)pDbeWindowPrivPriv->pBackBuffer,
- (DrawablePtr)pWin, pGC, 0, 0,
- pWin->drawable.width, pWin->drawable.height,
- 0, 0);
-
- /*
- **********************************************************************
- ** Tasks after swap.
- **********************************************************************
- */
-
- switch(swapInfo[0].swapAction)
- {
- case XdbeUndefined:
- break;
-
- case XdbeBackground:
- if ((*pDbeScreenPriv->SetupBackgroundPainter)(pWin, pGC))
- {
- ValidateGC((DrawablePtr)pDbeWindowPrivPriv->pBackBuffer, pGC);
- clearRect.x = 0;
- clearRect.y = 0;
- clearRect.width =
- pDbeWindowPrivPriv->pBackBuffer->drawable.width;
- clearRect.height =
- pDbeWindowPrivPriv->pBackBuffer->drawable.height;
- (*pGC->ops->PolyFillRect)(
- (DrawablePtr)pDbeWindowPrivPriv->pBackBuffer,
- pGC, 1, &clearRect);
- }
- break;
-
- case XdbeUntouched:
- /* Swap pixmap pointers. */
- pTmpBuffer = pDbeWindowPrivPriv->pBackBuffer;
- pDbeWindowPrivPriv->pBackBuffer =
- pDbeWindowPrivPriv->pFrontBuffer;
- pDbeWindowPrivPriv->pFrontBuffer = pTmpBuffer;
-
- miDbeAliasBuffers(pDbeWindowPrivPriv->pDbeWindowPriv);
-
- break;
-
- case XdbeCopied:
- break;
-
- }
-
- /* Remove the swapped window from the swap information array and decrement
- * pNumWindows to indicate to the DIX level how many windows were actually
- * swapped.
- */
-
- if (*pNumWindows > 1)
- {
- /* We were told to swap more than one window, but we only swapped the
- * first one. Remove the first window in the list by moving the last
- * window to the beginning.
- */
- swapInfo[0].pWindow = swapInfo[*pNumWindows - 1].pWindow;
- swapInfo[0].swapAction = swapInfo[*pNumWindows - 1].swapAction;
-
- /* Clear the last window information just to be safe. */
- swapInfo[*pNumWindows - 1].pWindow = (WindowPtr)NULL;
- swapInfo[*pNumWindows - 1].swapAction = 0;
- }
- else
- {
- /* Clear the window information just to be safe. */
- swapInfo[0].pWindow = (WindowPtr)NULL;
- swapInfo[0].swapAction = 0;
- }
-
- (*pNumWindows)--;
-
- FreeScratchGC(pGC);
-
- return(Success);
-
-} /* miSwapBuffers() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeWinPrivDelete
- *
- * Description:
- *
- * This is the MI function for deleting the dbeWindowPrivResType resource.
- * This function is invoked indirectly by calling FreeResource() to free
- * the resources associated with a DBE buffer ID. There are 5 ways that
- * miDbeWinPrivDelete() can be called by FreeResource(). They are:
- *
- * - A DBE window is destroyed, in which case the DbeDestroyWindow()
- * wrapper is invoked. The wrapper calls FreeResource() for all DBE
- * buffer IDs.
- *
- * - miDbeAllocBackBufferName() calls FreeResource() to clean up resources
- * after a buffer allocation failure.
- *
- * - The PositionWindow wrapper, miDbePositionWindow(), calls
- * FreeResource() when it fails to create buffers of the new size.
- * FreeResource() is called for all DBE buffer IDs.
- *
- * - FreeClientResources() calls FreeResource() when a client dies or the
- * the server resets.
- *
- * When FreeResource() is called for a DBE buffer ID, the delete function
- * for the only other type of DBE resource, dbeDrawableResType, is also
- * invoked. This delete function (DbeDrawableDelete) is a NOOP to make
- * resource deletion easier. It is not guaranteed which delete function is
- * called first. Hence, we will let miDbeWinPrivDelete() free all DBE
- * resources.
- *
- * This function deletes/frees the following stuff associated with
- * the window private:
- *
- * - the ID node in the ID list representing the passed in ID.
- *
- * In addition, pDbeWindowPriv->nBufferIDs is decremented.
- *
- * If this function is called for the last/only buffer ID for a window,
- * these are additionally deleted/freed:
- *
- * - the front and back pixmaps
- * - the window priv itself
- *
- *****************************************************************************/
-
-static void
-miDbeWinPrivDelete(pDbeWindowPriv, bufId)
- DbeWindowPrivPtr pDbeWindowPriv;
- XID bufId;
-{
- MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
-
-
- if (pDbeWindowPriv->nBufferIDs != 0)
- {
- /* We still have at least one more buffer ID associated with this
- * window.
- */
- return;
- }
-
-
- /* We have no more buffer IDs associated with this window. We need to
- * free some stuff.
- */
-
- pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
-
- /* Destroy the front and back pixmaps. */
- if (pDbeWindowPrivPriv->pFrontBuffer)
- {
- (*pDbeWindowPriv->pWindow->drawable.pScreen->DestroyPixmap)(
- pDbeWindowPrivPriv->pFrontBuffer);
- }
- if (pDbeWindowPrivPriv->pBackBuffer)
- {
- (*pDbeWindowPriv->pWindow->drawable.pScreen->DestroyPixmap)(
- pDbeWindowPrivPriv->pBackBuffer);
- }
-
-} /* miDbeWinPrivDelete() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbePositionWindow
- *
- * Description:
- *
- * This function was cloned from miMbxPositionWindow() in mimultibuf.c.
- * This function resizes the buffer when the window is resized.
- *
- *****************************************************************************/
-
-static Bool
-miDbePositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x;
- int y;
-{
- ScreenPtr pScreen;
- DbeScreenPrivPtr pDbeScreenPriv;
- DbeWindowPrivPtr pDbeWindowPriv;
- int width, height;
- int dx, dy, dw, dh;
- int sourcex, sourcey;
- int destx, desty;
- int savewidth, saveheight;
- PixmapPtr pFrontBuffer;
- PixmapPtr pBackBuffer;
- Bool clear;
- GCPtr pGC;
- xRectangle clearRect;
- Bool ret;
-
-
- /*
- **************************************************************************
- ** 1. Unwrap the member routine.
- **************************************************************************
- */
-
- pScreen = pWin->drawable.pScreen;
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
- pScreen->PositionWindow = pDbeScreenPriv->PositionWindow;
-
- /*
- **************************************************************************
- ** 2. Do any work necessary before the member routine is called.
- **
- ** In this case we do not need to do anything.
- **************************************************************************
- */
-
- /*
- **************************************************************************
- ** 3. Call the member routine, saving its result if necessary.
- **************************************************************************
- */
-
- ret = (*pScreen->PositionWindow)(pWin, x, y);
-
- /*
- **************************************************************************
- ** 4. Rewrap the member routine, restoring the wrapper value first in case
- ** the wrapper (or something that it wrapped) change this value.
- **************************************************************************
- */
-
- pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
- pScreen->PositionWindow = miDbePositionWindow;
-
- /*
- **************************************************************************
- ** 5. Do any work necessary after the member routine has been called.
- **************************************************************************
- */
-
- if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
- {
- return(ret);
- }
-
- if (pDbeWindowPriv->width == pWin->drawable.width &&
- pDbeWindowPriv->height == pWin->drawable.height)
- {
- return(ret);
- }
-
- width = pWin->drawable.width;
- height = pWin->drawable.height;
-
- dx = pWin->drawable.x - pDbeWindowPriv->x;
- dy = pWin->drawable.y - pDbeWindowPriv->y;
- dw = width - pDbeWindowPriv->width;
- dh = height - pDbeWindowPriv->height;
-
- GravityTranslate (0, 0, -dx, -dy, dw, dh, pWin->bitGravity, &destx, &desty);
-
- clear = ((pDbeWindowPriv->width < (unsigned short)width ) ||
- (pDbeWindowPriv->height < (unsigned short)height) ||
- (pWin->bitGravity == ForgetGravity));
-
- sourcex = 0;
- sourcey = 0;
- savewidth = pDbeWindowPriv->width;
- saveheight = pDbeWindowPriv->height;
-
- /* Clip rectangle to source and destination. */
- if (destx < 0)
- {
- savewidth += destx;
- sourcex -= destx;
- destx = 0;
- }
-
- if (destx + savewidth > width)
- {
- savewidth = width - destx;
- }
-
- if (desty < 0)
- {
- saveheight += desty;
- sourcey -= desty;
- desty = 0;
- }
-
- if (desty + saveheight > height)
- {
- saveheight = height - desty;
- }
-
- pDbeWindowPriv->width = width;
- pDbeWindowPriv->height = height;
- pDbeWindowPriv->x = pWin->drawable.x;
- pDbeWindowPriv->y = pWin->drawable.y;
-
- pGC = GetScratchGC (pWin->drawable.depth, pScreen);
-
- if (clear)
- {
- if ((*pDbeScreenPriv->SetupBackgroundPainter)(pWin, pGC))
- {
- clearRect.x = 0;
- clearRect.y = 0;
- clearRect.width = width;
- clearRect.height = height;
- }
- else
- {
- clear = FALSE;
- }
- }
-
- /* Create DBE buffer pixmaps equal to size of resized window. */
- pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
- pWin->drawable.depth);
-
- pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
- pWin->drawable.depth);
-
- if (!pFrontBuffer || !pBackBuffer)
- {
- /* We failed at creating 1 or 2 of the pixmaps. */
-
- if (pFrontBuffer)
- {
- (*pScreen->DestroyPixmap)(pFrontBuffer);
- }
-
- if (pBackBuffer)
- {
- (*pScreen->DestroyPixmap)(pBackBuffer);
- }
-
- /* Destroy all buffers for this window. */
- while (pDbeWindowPriv)
- {
- /* DbeWindowPrivDelete() will free the window private if there no
- * more buffer IDs associated with this window.
- */
- FreeResource(pDbeWindowPriv->IDs[0], RT_NONE);
- pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
- }
-
- FreeScratchGC(pGC);
- return(FALSE);
- }
-
- else
- {
- /* Clear out the new DBE buffer pixmaps. */
-
- MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
-
-
- pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
- ValidateGC((DrawablePtr)pFrontBuffer, pGC);
-
- /* I suppose this could avoid quite a bit of work if
- * it computed the minimal area required.
- */
- if (clear)
- {
- (*pGC->ops->PolyFillRect)((DrawablePtr)pFrontBuffer, pGC, 1,
- &clearRect);
- (*pGC->ops->PolyFillRect)((DrawablePtr)pBackBuffer , pGC, 1,
- &clearRect);
- }
-
- /* Copy the contents of the old DBE pixmaps to the new pixmaps. */
- if (pWin->bitGravity != ForgetGravity)
- {
- (*pGC->ops->CopyArea)((DrawablePtr)pDbeWindowPrivPriv->pFrontBuffer,
- (DrawablePtr)pFrontBuffer, pGC, sourcex,
- sourcey, savewidth, saveheight, destx, desty);
- (*pGC->ops->CopyArea)((DrawablePtr)pDbeWindowPrivPriv->pBackBuffer,
- (DrawablePtr)pBackBuffer, pGC, sourcex,
- sourcey, savewidth, saveheight, destx, desty);
- }
-
- /* Destroy the old pixmaps, and point the DBE window priv to the new
- * pixmaps.
- */
-
- (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
- (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pBackBuffer);
-
- pDbeWindowPrivPriv->pFrontBuffer = pFrontBuffer;
- pDbeWindowPrivPriv->pBackBuffer = pBackBuffer;
-
- /* Make sure all XID are associated with the new back pixmap. */
- miDbeAliasBuffers(pDbeWindowPriv);
-
- FreeScratchGC(pGC);
- }
-
- return(ret);
-
-} /* miDbePositionWindow() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeResetProc
- *
- * Description:
- *
- * This function is called from DbeResetProc(), which is called at the end
- * of every server generation. This function peforms any MI-specific
- * shutdown tasks.
- *
- *****************************************************************************/
-
-static void
-miDbeResetProc(pScreen)
- ScreenPtr pScreen;
-{
- DbeScreenPrivPtr pDbeScreenPriv;
-
-
- pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
-
- /* Unwrap wrappers */
- pScreen->PositionWindow = pDbeScreenPriv->PositionWindow;
-
-} /* miDbeResetProc() */
-
-
-/******************************************************************************
- *
- * DBE MI Procedure: miDbeInit
- *
- * Description:
- *
- * This is the MI initialization function called by DbeExtensionInit().
- *
- *****************************************************************************/
-
-Bool
-miDbeInit(pScreen, pDbeScreenPriv)
- ScreenPtr pScreen;
- DbeScreenPrivPtr pDbeScreenPriv;
-{
- /* Copy resource types created by DIX */
- dbeDrawableResType = pDbeScreenPriv->dbeDrawableResType;
- dbeWindowPrivResType = pDbeScreenPriv->dbeWindowPrivResType;
-
- /* Copy private indices created by DIX */
- dbeScreenPrivIndex = pDbeScreenPriv->dbeScreenPrivIndex;
- dbeWindowPrivIndex = pDbeScreenPriv->dbeWindowPrivIndex;
-
- /* Reset the window priv privs if generations do not match. */
- if (miDbePrivPrivGeneration != serverGeneration)
- {
- /*
- **********************************************************************
- ** Allocate the window priv priv.
- **********************************************************************
- */
-
- miDbeWindowPrivPrivIndex = (*pDbeScreenPriv->AllocWinPrivPrivIndex)();
-
- /* Make sure we only do this code once. */
- miDbePrivPrivGeneration = serverGeneration;
-
- } /* if -- Reset priv privs. */
-
- if (!(*pDbeScreenPriv->AllocWinPrivPriv)(pScreen,
- miDbeWindowPrivPrivIndex, sizeof(MiDbeWindowPrivPrivRec)))
- {
- return(FALSE);
- }
-
- /* Wrap functions. */
- pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
- pScreen->PositionWindow = miDbePositionWindow;
-
- /* Initialize the per-screen DBE function pointers. */
- pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo;
- pDbeScreenPriv->AllocBackBufferName = miDbeAllocBackBufferName;
- pDbeScreenPriv->SwapBuffers = miDbeSwapBuffers;
- pDbeScreenPriv->BeginIdiom = 0;
- pDbeScreenPriv->EndIdiom = 0;
- pDbeScreenPriv->ResetProc = miDbeResetProc;
- pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
-
- /* The mi implementation doesn't need buffer validation. */
- pDbeScreenPriv->ValidateBuffer = (void (*)())NoopDDA;
-
- return(TRUE);
-
-} /* miDbeInit() */
diff --git a/dbe/midbe.h b/dbe/midbe.h
deleted file mode 100644
index 7b1237633..000000000
--- a/dbe/midbe.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $Xorg: midbe.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */
-/******************************************************************************
- *
- * Copyright (c) 1994, 1995 Hewlett-Packard Company
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the Hewlett-Packard
- * Company shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization from the Hewlett-Packard Company.
- *
- * Header file for users of machine-independent DBE code
- *
- *****************************************************************************/
-/* $XFree86: xc/programs/Xserver/dbe/midbe.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */
-
-
-#ifndef MIDBE_H
-#define MIDBE_H
-
-/* EXTERNS */
-
-extern Bool miDbeInit(
- ScreenPtr pScreen,
- DbeScreenPrivPtr pDbeScreenPriv
-);
-
-#endif /* MIDBE_H */
-
diff --git a/dbe/midbestr.h b/dbe/midbestr.h
deleted file mode 100644
index 8c351072e..000000000
--- a/dbe/midbestr.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $Xorg: midbestr.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */
-/******************************************************************************
- *
- * Copyright (c) 1994, 1995 Hewlett-Packard Company
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the Hewlett-Packard
- * Company shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization from the Hewlett-Packard Company.
- *
- * Header file for users of machine-independent DBE code
- *
- *****************************************************************************/
-
-
-#ifndef MIDBE_STRUCT_H
-#define MIDBE_STRUCT_H
-
-
-/* DEFINES */
-
-#define MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv) \
- (((miDbeWindowPrivPrivIndex < 0) || (!pDbeWindowPriv)) ? \
- NULL : \
- ((MiDbeWindowPrivPrivPtr) \
- ((pDbeWindowPriv)->devPrivates[miDbeWindowPrivPrivIndex].ptr)))
-
-#define MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin)\
- MI_DBE_WINDOW_PRIV_PRIV(DBE_WINDOW_PRIV(pWin))
-
-#define MI_DBE_SCREEN_PRIV_PRIV(pDbeScreenPriv) \
- (((miDbeScreenPrivPrivIndex < 0) || (!pDbeScreenPriv)) ? \
- NULL : \
- ((MiDbeScreenPrivPrivPtr) \
- ((pDbeScreenPriv)->devPrivates[miDbeScreenPrivPrivIndex].ptr)))
-
-
-/* TYPEDEFS */
-
-typedef struct _MiDbeWindowPrivPrivRec
-{
- /* Place machine-specific fields in here.
- * Since this is mi code, we do not really have machine-specific fields.
- */
-
- /* Pointer to a drawable that contains the contents of the back buffer.
- */
- PixmapPtr pBackBuffer;
-
- /* Pointer to a drawable that contains the contents of the front buffer.
- * This pointer is only used for the XdbeUntouched swap action. For that
- * swap action, we need to copy the front buffer (window) contents into
- * this drawable, copy the contents of current back buffer drawable (the
- * back buffer) into the window, swap the front and back drawable pointers,
- * and then swap the drawable/resource associations in the resource
- * database.
- */
- PixmapPtr pFrontBuffer;
-
- /* Pointer back to our window private with which we are associated. */
- DbeWindowPrivPtr pDbeWindowPriv;
-
-} MiDbeWindowPrivPrivRec, *MiDbeWindowPrivPrivPtr;
-
-typedef struct _MiDbeScreenPrivPrivRec
-{
- /* Place machine-specific fields in here.
- * Since this is mi code, we do not really have machine-specific fields.
- */
-
- /* Pointer back to our screen private with which we are associated. */
- DbeScreenPrivPtr pDbeScreenPriv;
-
-} MiDbeScreenPrivPrivRec, *MiDbeScreenPrivPrivPtr;
-
-#endif /* MIDBE_STRUCT_H */
-
diff --git a/dix/BuiltInAtoms b/dix/BuiltInAtoms
deleted file mode 100644
index 910c62706..000000000
--- a/dix/BuiltInAtoms
+++ /dev/null
@@ -1,329 +0,0 @@
-File: .../x11/server/dix/BuiltInAtoms
-
-This file is of a fixed format and is used to generate both the file
-include/XAtom.h and dix/initatoms.c. Neither of those files should be
-edited directly. Changing the atoms in this file, or even the order in
-which they occur, is equivalent to forcing a new (minor) version number
-on the server. Take care.
-
-The format of the file is that each built in atom starts in column 1
-with no text, other than spaces and tabs, on that line other than a
-mandatory trailing "@" at the end of the line. For each atom (Foo)
-below the defines will be of the form
- #define XA_Foo <n>
-and the string value of the atom will be "Foo".
-
-The comment lines in this file are not guaranteed to be accurate. To see the
-current truth, look at the Xlib documentation as well as the protocol spec.
-
-Atoms occur in five distinct name spaces within the protocol. Any particular
-atom may or may not have some client interpretation within each of the name
-spaces. For each of the built in atoms, the intended semantics and the space
-within which it is defined is indicated.
-
-Those name spaces are
- Property names
- Property types
- Selections
- Font properties
- Type of a ClientMessage event (none built into server)
-
-For the font properties mentioned here, see the spec for more information.
-
- -- Selections --
-
-PRIMARY @
- Selection.
-SECONDARY @
- Selection.
-
- -- Property types and names --
-
-ARC @
- Property type:
- x, y: INT16
- width, height: CARD16,
- angle1, angle2: INT16
-ATOM @
- Property type:
- atom: ATOM
-BITMAP @
- Property type:
- bitmap: PIXMAP
- This is asserted to be of depth 1.
-CARDINAL @
- Property type:
- card: CARD32 or CARD16 or CARD8
- the datum size is dependent on the property format
-COLORMAP @
- Property type:
- colormap: COLORMAP
-CURSOR @
- Property type:
- cursor: CURSOR
-CUT_BUFFER0 @
-CUT_BUFFER1 @
-CUT_BUFFER2 @
-CUT_BUFFER3 @
-CUT_BUFFER4 @
-CUT_BUFFER5 @
-CUT_BUFFER6 @
-CUT_BUFFER7 @
- Property name: (type: STRING)
- Used to implement cut buffer ring, in particular Andrew uses
- this mechanism. Anyone else using this sort of IPC mechanism
- should use these properties.
-
- Data is normally fetched and stored out of CUT_BUFFER0; the
- RotateProperties request is used to rotate these buffers.
-DRAWABLE @
- Property type:
- drawable: DRAWABLE
-FONT @
- Property type:
- font: FONT
-INTEGER @
- Property type:
- card: INT32 or INT16 or INT8
- the datum size is dependent on the property format
-PIXMAP @
- Property type:
- pixmap: PIXMAP
-POINT @
- Property type:
- x, y: INT16
-RECTANGLE @
- Property type:
- x, y: INT16
- width, height: CARD16
-RESOURCE_MANAGER @
- Property name: (type: STRING)
- Contents of the user's resource manager data base.
-RGB_COLOR_MAP @
- Property type:
- colormap: COLORMAP
- red-max: CARD32
- red-mult: CARD32
- green-max: CARD32
- green-mult: CARD32
- blue-max: CARD32
- blue-mult: CARD32
- base-pixel: CARD32
-
- The fields `red_max', `green_max', and `blue_max' give the maximum
- red, green, and blue values, respectively. Each color
- coefficient ranges from 0 to its max, inclusive. For example,
- a common colormap allocation is 3/3/2: 3 planes for red, 3
- planes for green, and 2 planes for blue. Such a colormap would
- have red_max == 7, green_max = 7, and blue_max = 3. An alternate
- allocation that uses only 216 colors is red_max = 5, green_max =
- 5, and blue_max = 5.
-
- The fields `red_mult', `green_mult', and `blue_mult' give the
- scale factors used to compose a full pixel value. (See next
- paragraph.) For a 3/3/2 allocation red_mult might be 32,
- green_mult might be 4, and blue_mult might be 1. For a
- 6-colors-each allocation, red_mult might be 36, green_mult might
- be 6, and blue_mult might be 1.
-
- The field `base_pixel' gives the base pixel value used to
- compose a full pixel value. Normally base_pixel is obtained
- from a call to XAllocColorPlanes(). Given integer red, green,
- and blue coefficients in their appropriate ranges, one can
- compute a corresponding pixel value with the expression:
-
- r * red_mult + g * green_mult + b * blue_mult + base_pixel
-
- For gray-scale colormaps, only the colormap, red_max, red_mult,
- and base_pixel fields are defined; the other fields are
- ignored. To compute a gray-scale pixel value, use:
-
- gray * red_mult + base_pixel
-
- This is provided to allow applications to share color maps.
-
-RGB_BEST_MAP @
-RGB_BLUE_MAP @
-RGB_DEFAULT_MAP @
-RGB_GRAY_MAP @
-RGB_GREEN_MAP @
-RGB_RED_MAP @
- Property name: (type: RGB_COLOR_MAP)
- The needs of most applications can be met with five colormaps.
- Polite applications may need only a small RGB space, and can
- use a portion of the default color map. Applications doing
- high-quality RGB rendering will need an entire colormap,
- filled with as large an RGB space as possible, e.g. 332. For
- color separations, an application may need maximum device
- resolution for each of red, green, and blue, even if this
- requires three renderings with three colormaps.
-
- Each of the above five names would be used for sharing color
- maps.
-STRING @
- Property type:
- sequence of Bytes
-VISUALID @
- Property type:
- visual: VISUALID
-WINDOW @
- Property type:
- window: WINDOW
-WM_COMMAND @
- Property name: (type: STRING)
- Command line arguments used to invoke this application. The
- arguments are delimited by null characters (ASCII 0).
-WM_HINTS @
- Property type:
- flags: CARD32
- input: BOOL32
- initial-state: CARD32
- icon-pixmap: PIXMAP
- icon-window: WINDOW
- icon_mask: BITMAP
- icon-x, icon-y: INT32
- flags contains the following bits
- 0x00000001 input hint
- 0x00000002 state hint
- 0x00000004 icon pixmap hint
- 0x00000008 icon window hint
- 0x00000010 icon position hint
- values for initial-state
- 0 unspecified -> application does not
- care and WM should pick one.
- 1 normal
- 2 zoomed
- 3 iconic
- 4 inactive -> application believes
- itself to be seldomly used. WM may wish to
- place it on an inactive menu.
- This type is potentially extensible. The order is critical;
- append to the end only.
- Property name: (type: WM_HINTS)
- Additional hints set by the client for use by the window
- manager.
-WM_CLIENT_MACHINE @
- Property name: (type: STRING)
- used to communicate with the window manager. The host name
- of the machine the client is running on may be set here.
-WM_ICON_NAME @
- Property name: (type: STRING)
- what the application would like the label to be for
- the iconic form of the window.
-WM_ICON_SIZE @
- Property type:
- minWidth, min-height: CARD32
- maxWidth, max-height: CARD32
- widthInc, height-inc: CARD32
- Property name: (type: ICON_SIZE)
- The window manager may set this property on the root window
- to specify the icon sizes it allows.
-WM_NAME @
- Property name: (type: STRING)
- used to communicate with the window manager. This is
- what the application would like the label for the window.
-WM_NORMAL_HINTS @
- Property name: (type: SIZE_HINTS)
- used to communicate with the window manager. This is size
- hints for a window in its "normal" state.
-WM_SIZE_HINTS @
- Property type:
- flags: CARD32
- x, y: INT32
- width, height: CARD32
- min-width, min-height: CARD32
- max-width, max-height: CARD32
- width-inc, height-inc: CARD32
- min-aspect-x, min-aspect-y: CARD32
- max-aspect-x, max-aspect-y: CARD32
- flags contains the following bits
- 0x00000001 user specified x and y
- 0x00000002 user specified width and height
- 0x00000004 program specified position
- 0x00000008 program specified size
- 0x00000010 program specified minimum size
- 0x00000020 program specified maximum size
- 0x00000040 program specified resize increment
- 0x00000080 program specified aspect ratio
- This type is potentially extensible. The order is critical;
- append to the end only.
-WM_ZOOM_HINTS @
- Property name: (type: SIZE_HINTS)
- used to communicate with the window manager. This is size
- hints for a window in its "zoomed" state.
-
- -- Font properties --
-
-MIN_SPACE @
- Font property: CARD32
-NORM_SPACE @
- Font property: CARD32
-MAX_SPACE @
- Font property: CARD32
-END_SPACE @
- Font property: CARD32
-SUPERSCRIPT_X @
- Font property: INT32
-SUPERSCRIPT_Y @
- Font property: INT32
-SUBSCRIPT_X @
- Font property: INT32
-SUBSCRIPT_Y @
- Font property: INT32
-UNDERLINE_POSITION @
- Font property: INT32
-UNDERLINE_THICKNESS @
- Font property: CARD32
-STRIKEOUT_ASCENT @
- Font property: INT32
-STRIKEOUT_DESCENT @
- Font property: INT32
-ITALIC_ANGLE @
- Font property: INT32
-X_HEIGHT @
- Font property: INT32
-QUAD_WIDTH @
- Font property: INT32
-WEIGHT @
- Font property: CARD32
-POINT_SIZE @
- Font property: CARD32
-RESOLUTION @
- Font property: CARD32
-
-The following optional properties on fonts have values that are atoms. The
-atom print name is the useful information.
-
-COPYRIGHT @
- of the font distribution
-NOTICE @
- trademark/copyright of the character shapes
-FONT_NAME @
- name of this particular instance of a font
-FAMILY_NAME @
- name of the 'font family' to which it belongs
-FULL_NAME @
- full text name of the font
-
-The following aren't in order but putting them at the end avoids encoding
-changes.
-
-CAP_HEIGHT @
- Font property: CARD32
-
-
-WM_CLASS @
- Property name: (type: STRING)
- Used (possibly by some window managers; definitely by
- session managers) to look up resources in the resource
- data base on behalf of the client who set this property.
- There are 2 elements:
- {char *resource_name; char *resource_class;}
- delimited by a null character (ascii 0)
-
-WM_TRANSIENT_FOR @
- Property name: (type: WINDOW)
- Used by transient top-level windows, such as dialog
- boxes, to point to their logical "parents". The window
- manager can then take down the dialog boxes when the
- "parent" gets iconified, for instance.
diff --git a/dix/CHANGES b/dix/CHANGES
deleted file mode 100644
index d8fb7c31a..000000000
--- a/dix/CHANGES
+++ /dev/null
@@ -1,17 +0,0 @@
-The following changes have been made to this directory since R3 (for
-a full description, see doc/Server/r4.tbl.ms):
-
- o Windows restructured (memory reduction, devPrivates and speedups)
- o GCs restructured (memory reduction, devPrivates and wrappers)
- o Screens restructured (window ops merged in, devPrivates)
- o Pixmaps restructured (drawable changes mostly)
- o Cursors restructured (shares glyph bits now)
- o Visuals restructured (screen index removed, fields rearranged)
- o Devices restructured (input extension changes)
- o Out of memory changes. Many interfaces now return OutOfMemory
- status.
- o Synchronous grab code rewritten. Should conform to our
- understanding of the protocol now. Be careful when time
- stamping events (don't allow time to run backwards).
- o Resource types redesigned and rewritten.
- o Internal fake color allocation routine for software cursors.
diff --git a/dix/atom.c b/dix/atom.c
deleted file mode 100644
index 66c045583..000000000
--- a/dix/atom.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/atom.c,v 3.4 2002/02/19 11:09:21 alanh Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: atom.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xatom.h"
-#include "misc.h"
-#include "resource.h"
-#include "dix.h"
-
-#define InitialTableSize 100
-
-typedef struct _Node {
- struct _Node *left, *right;
- Atom a;
- unsigned int fingerPrint;
- char *string;
-} NodeRec, *NodePtr;
-
-static Atom lastAtom = None;
-static NodePtr atomRoot = (NodePtr)NULL;
-static unsigned long tableLength;
-static NodePtr *nodeTable;
-
-void FreeAtom(NodePtr patom);
-
-Atom
-MakeAtom(string, len, makeit)
- char *string;
- unsigned len;
- Bool makeit;
-{
- register NodePtr * np;
- unsigned i;
- int comp;
- register unsigned int fp = 0;
-
- np = &atomRoot;
- for (i = 0; i < (len+1)/2; i++)
- {
- fp = fp * 27 + string[i];
- fp = fp * 27 + string[len - 1 - i];
- }
- while (*np != (NodePtr) NULL)
- {
- if (fp < (*np)->fingerPrint)
- np = &((*np)->left);
- else if (fp > (*np)->fingerPrint)
- np = &((*np)->right);
- else
- { /* now start testing the strings */
- comp = strncmp(string, (*np)->string, (int)len);
- if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
- np = &((*np)->left);
- else if (comp > 0)
- np = &((*np)->right);
- else
- return(*np)->a;
- }
- }
- if (makeit)
- {
- register NodePtr nd;
-
- nd = (NodePtr) xalloc(sizeof(NodeRec));
- if (!nd)
- return BAD_RESOURCE;
- if (lastAtom < XA_LAST_PREDEFINED)
- {
- nd->string = string;
- }
- else
- {
- nd->string = (char *) xalloc(len + 1);
- if (!nd->string) {
- xfree(nd);
- return BAD_RESOURCE;
- }
- strncpy(nd->string, string, (int)len);
- nd->string[len] = 0;
- }
- if ((lastAtom + 1) >= tableLength) {
- NodePtr *table;
-
- table = (NodePtr *) xrealloc(nodeTable,
- tableLength * (2 * sizeof(NodePtr)));
- if (!table) {
- if (nd->string != string)
- xfree(nd->string);
- xfree(nd);
- return BAD_RESOURCE;
- }
- tableLength <<= 1;
- nodeTable = table;
- }
- *np = nd;
- nd->left = nd->right = (NodePtr) NULL;
- nd->fingerPrint = fp;
- nd->a = (++lastAtom);
- *(nodeTable+lastAtom) = nd;
- return nd->a;
- }
- else
- return None;
-}
-
-Bool
-ValidAtom(atom)
- Atom atom;
-{
- return (atom != None) && (atom <= lastAtom);
-}
-
-char *
-NameForAtom(atom)
- Atom atom;
-{
- NodePtr node;
- if (atom > lastAtom) return 0;
- if ((node = nodeTable[atom]) == (NodePtr)NULL) return 0;
- return node->string;
-}
-
-void
-AtomError()
-{
- FatalError("initializing atoms");
-}
-
-void
-FreeAtom(NodePtr patom)
-{
- if(patom->left)
- FreeAtom(patom->left);
- if(patom->right)
- FreeAtom(patom->right);
- if (patom->a > XA_LAST_PREDEFINED)
- xfree(patom->string);
- xfree(patom);
-}
-
-void
-FreeAllAtoms()
-{
- if(atomRoot == (NodePtr)NULL)
- return;
- FreeAtom(atomRoot);
- atomRoot = (NodePtr)NULL;
- xfree(nodeTable);
- nodeTable = (NodePtr *)NULL;
- lastAtom = None;
-}
-
-void
-InitAtoms()
-{
- FreeAllAtoms();
- tableLength = InitialTableSize;
- nodeTable = (NodePtr *)xalloc(InitialTableSize*sizeof(NodePtr));
- if (!nodeTable)
- AtomError();
- nodeTable[None] = (NodePtr)NULL;
- MakePredeclaredAtoms();
- if (lastAtom != XA_LAST_PREDEFINED)
- AtomError ();
-}
-
-
diff --git a/dix/buildatoms b/dix/buildatoms
deleted file mode 100644
index dfbbca8a9..000000000
--- a/dix/buildatoms
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-hfile=../../../include/Xatom.h
-cfile=initatoms.c
-rm -f $hfile $cfile
-umask 222
-awk '
-BEGIN {
- hfile = "'$hfile'";
- cfile = "'$cfile'";
- hformat = "#define XA_%s ((Atom) %d)\n";
- printf("#ifndef XATOM_H\n") > hfile;
- printf("#define XATOM_H 1\n\n") > hfile;
- printf("/* THIS IS A GENERATED FILE\n") > hfile;
- printf(" *\n") > hfile;
- printf(" * Do not change! Changing this file implies a protocol change!\n") > hfile;
- printf(" */\n\n") > hfile;
-
- printf("/* THIS IS A GENERATED FILE\n") > cfile;
- printf(" *\n") > cfile;
- printf(" * Do not change! Changing this file implies a protocol change!\n") > cfile;
- printf(" */\n\n") > cfile;
- printf("#include \"X.h\"\n") > cfile;
- printf("#include \"Xatom.h\"\n") > cfile;
- printf("#include \"misc.h\"\n") > cfile;
- printf("#include \"dix.h\"\n") > cfile;
- printf("void MakePredeclaredAtoms()\n") > cfile;
- printf("{\n") > cfile;
-
- }
-
-NF == 2 && $2 == "@" {
- printf(hformat, $1, ++atomno) > hfile ;
- printf(" if (MakeAtom(\"%s\", %d, 1) != XA_%s) AtomError();\n", $1, length($1), $1) > cfile ;
- }
-
-END {
- printf("\n") > hfile;
- printf(hformat, "LAST_PREDEFINED", atomno) > hfile ;
- printf("#endif /* XATOM_H */\n") > hfile;
- printf("}\n") > cfile ;
- }
-' BuiltInAtoms
-exit 0
diff --git a/dix/colormap.c b/dix/colormap.c
deleted file mode 100644
index af959ed86..000000000
--- a/dix/colormap.c
+++ /dev/null
@@ -1,2854 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.12 2003/11/17 22:20:33 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: colormap.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "misc.h"
-#include "dix.h"
-#include "colormapst.h"
-#include "os.h"
-#include "scrnintstr.h"
-#include "resource.h"
-#include "windowstr.h"
-#ifdef LBX
-#include "lbxserve.h"
-#endif
-
-extern XID clientErrorValue;
-extern int colormapPrivateCount;
-
-static Pixel FindBestPixel(
- EntryPtr /*pentFirst*/,
- int /*size*/,
- xrgb * /*prgb*/,
- int /*channel*/
-);
-
-static int AllComp(
- EntryPtr /*pent*/,
- xrgb * /*prgb*/
-);
-
-static int RedComp(
- EntryPtr /*pent*/,
- xrgb * /*prgb*/
-);
-
-static int GreenComp(
- EntryPtr /*pent*/,
- xrgb * /*prgb*/
-);
-
-static int BlueComp(
- EntryPtr /*pent*/,
- xrgb * /*prgb*/
-);
-
-static void FreePixels(
- register ColormapPtr /*pmap*/,
- register int /*client*/
-);
-
-static void CopyFree(
- int /*channel*/,
- int /*client*/,
- ColormapPtr /*pmapSrc*/,
- ColormapPtr /*pmapDst*/
-);
-
-static void FreeCell(
- ColormapPtr /*pmap*/,
- Pixel /*i*/,
- int /*channel*/
-);
-
-static void UpdateColors(
- ColormapPtr /*pmap*/
-);
-
-static int AllocDirect(
- int /*client*/,
- ColormapPtr /*pmap*/,
- int /*c*/,
- int /*r*/,
- int /*g*/,
- int /*b*/,
- Bool /*contig*/,
- Pixel * /*pixels*/,
- Pixel * /*prmask*/,
- Pixel * /*pgmask*/,
- Pixel * /*pbmask*/
-);
-
-static int AllocPseudo(
- int /*client*/,
- ColormapPtr /*pmap*/,
- int /*c*/,
- int /*r*/,
- Bool /*contig*/,
- Pixel * /*pixels*/,
- Pixel * /*pmask*/,
- Pixel ** /*pppixFirst*/
-);
-
-static Bool AllocCP(
- ColormapPtr /*pmap*/,
- EntryPtr /*pentFirst*/,
- int /*count*/,
- int /*planes*/,
- Bool /*contig*/,
- Pixel * /*pixels*/,
- Pixel * /*pMask*/
-);
-
-static Bool AllocShared(
- ColormapPtr /*pmap*/,
- Pixel * /*ppix*/,
- int /*c*/,
- int /*r*/,
- int /*g*/,
- int /*b*/,
- Pixel /*rmask*/,
- Pixel /*gmask*/,
- Pixel /*bmask*/,
- Pixel * /*ppixFirst*/
-);
-
-static int FreeCo(
- ColormapPtr /*pmap*/,
- int /*client*/,
- int /*color*/,
- int /*npixIn*/,
- Pixel * /*ppixIn*/,
- Pixel /*mask*/
-);
-
-static int TellNoMap(
- WindowPtr /*pwin*/,
- Colormap * /*pmid*/
-);
-
-static void FindColorInRootCmap (
- ColormapPtr /* pmap */,
- EntryPtr /* pentFirst */,
- int /* size */,
- xrgb* /* prgb */,
- Pixel* /* pPixel */,
- int /* channel */,
- ColorCompareProcPtr /* comp */
-);
-
-#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
-#define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1)
-#define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1)
-#define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask)
-
-/* GetNextBitsOrBreak(bits, mask, base) --
- * (Suggestion: First read the macro, then read this explanation.
- *
- * Either generate the next value to OR in to a pixel or break out of this
- * while loop
- *
- * This macro is used when we're trying to generate all 2^n combinations of
- * bits in mask. What we're doing here is counting in binary, except that
- * the bits we use to count may not be contiguous. This macro will be
- * called 2^n times, returning a different value in bits each time. Then
- * it will cause us to break out of a surrounding loop. (It will always be
- * called from within a while loop.)
- * On call: mask is the value we want to find all the combinations for
- * base has 1 bit set where the least significant bit of mask is set
- *
- * For example,if mask is 01010, base should be 0010 and we count like this:
- * 00010 (see this isn't so hard),
- * then we add base to bits and get 0100. (bits & ~mask) is (0100 & 0100) so
- * we add that to bits getting (0100 + 0100) =
- * 01000 for our next value.
- * then we add 0010 to get
- * 01010 and we're done (easy as 1, 2, 3)
- */
-#define GetNextBitsOrBreak(bits, mask, base) \
- if((bits) == (mask)) \
- break; \
- (bits) += (base); \
- while((bits) & ~(mask)) \
- (bits) += ((bits) & ~(mask));
-/* ID of server as client */
-#define SERVER_ID 0
-
-typedef struct _colorResource
-{
- Colormap mid;
- int client;
-} colorResource;
-
-/* Invariants:
- * refcnt == 0 means entry is empty
- * refcnt > 0 means entry is useable by many clients, so it can't be changed
- * refcnt == AllocPrivate means entry owned by one client only
- * fShared should only be set if refcnt == AllocPrivate, and only in red map
- */
-
-
-/* Create and initialize the color map */
-int
-CreateColormap (mid, pScreen, pVisual, ppcmap, alloc, client)
- Colormap mid; /* resource to use for this colormap */
- ScreenPtr pScreen;
- VisualPtr pVisual;
- ColormapPtr *ppcmap;
- int alloc; /* 1 iff all entries are allocated writeable */
- int client;
-{
- int class, size;
- unsigned long sizebytes;
- ColormapPtr pmap;
- register EntryPtr pent;
- int i;
- register Pixel *ppix, **pptr;
-
- class = pVisual->class;
- if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID))
- return (BadMatch);
-
- size = pVisual->ColormapEntries;
- sizebytes = (size * sizeof(Entry)) +
- (MAXCLIENTS * sizeof(Pixel *)) +
- (MAXCLIENTS * sizeof(int));
- if ((class | DynamicClass) == DirectColor)
- sizebytes *= 3;
- sizebytes += sizeof(ColormapRec);
- pmap = (ColormapPtr) xalloc(sizebytes);
- if (!pmap)
- return (BadAlloc);
- pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec));
- sizebytes = size * sizeof(Entry);
- pmap->clientPixelsRed = (Pixel **)((char *)pmap->red + sizebytes);
- pmap->numPixelsRed = (int *)((char *)pmap->clientPixelsRed +
- (MAXCLIENTS * sizeof(Pixel *)));
- pmap->mid = mid;
- pmap->flags = 0; /* start out with all flags clear */
- if(mid == pScreen->defColormap)
- pmap->flags |= IsDefault;
- pmap->pScreen = pScreen;
- pmap->pVisual = pVisual;
- pmap->class = class;
- if ((class | DynamicClass) == DirectColor)
- size = NUMRED(pVisual);
- pmap->freeRed = size;
- bzero ((char *) pmap->red, (int)sizebytes);
- bzero((char *) pmap->numPixelsRed, MAXCLIENTS * sizeof(int));
- for (pptr = &pmap->clientPixelsRed[MAXCLIENTS]; --pptr >= pmap->clientPixelsRed; )
- *pptr = (Pixel *)NULL;
- if (alloc == AllocAll)
- {
- if (class & DynamicClass)
- pmap->flags |= AllAllocated;
- for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--)
- pent->refcnt = AllocPrivate;
- pmap->freeRed = 0;
- ppix = (Pixel *)xalloc(size * sizeof(Pixel));
- if (!ppix)
- {
- xfree(pmap);
- return (BadAlloc);
- }
- pmap->clientPixelsRed[client] = ppix;
- for(i = 0; i < size; i++)
- ppix[i] = i;
- pmap->numPixelsRed[client] = size;
- }
-
- if ((class | DynamicClass) == DirectColor)
- {
- pmap->freeGreen = NUMGREEN(pVisual);
- pmap->green = (EntryPtr)((char *)pmap->numPixelsRed +
- (MAXCLIENTS * sizeof(int)));
- pmap->clientPixelsGreen = (Pixel **)((char *)pmap->green + sizebytes);
- pmap->numPixelsGreen = (int *)((char *)pmap->clientPixelsGreen +
- (MAXCLIENTS * sizeof(Pixel *)));
- pmap->freeBlue = NUMBLUE(pVisual);
- pmap->blue = (EntryPtr)((char *)pmap->numPixelsGreen +
- (MAXCLIENTS * sizeof(int)));
- pmap->clientPixelsBlue = (Pixel **)((char *)pmap->blue + sizebytes);
- pmap->numPixelsBlue = (int *)((char *)pmap->clientPixelsBlue +
- (MAXCLIENTS * sizeof(Pixel *)));
-
- bzero ((char *) pmap->green, (int)sizebytes);
- bzero ((char *) pmap->blue, (int)sizebytes);
-
- memmove((char *) pmap->clientPixelsGreen,
- (char *) pmap->clientPixelsRed,
- MAXCLIENTS * sizeof(Pixel *));
- memmove((char *) pmap->clientPixelsBlue,
- (char *) pmap->clientPixelsRed,
- MAXCLIENTS * sizeof(Pixel *));
- bzero((char *) pmap->numPixelsGreen, MAXCLIENTS * sizeof(int));
- bzero((char *) pmap->numPixelsBlue, MAXCLIENTS * sizeof(int));
-
- /* If every cell is allocated, mark its refcnt */
- if (alloc == AllocAll)
- {
- size = pmap->freeGreen;
- for(pent = &pmap->green[size-1]; pent >= pmap->green; pent--)
- pent->refcnt = AllocPrivate;
- pmap->freeGreen = 0;
- ppix = (Pixel *) xalloc(size * sizeof(Pixel));
- if (!ppix)
- {
- xfree(pmap->clientPixelsRed[client]);
- xfree(pmap);
- return(BadAlloc);
- }
- pmap->clientPixelsGreen[client] = ppix;
- for(i = 0; i < size; i++)
- ppix[i] = i;
- pmap->numPixelsGreen[client] = size;
-
- size = pmap->freeBlue;
- for(pent = &pmap->blue[size-1]; pent >= pmap->blue; pent--)
- pent->refcnt = AllocPrivate;
- pmap->freeBlue = 0;
- ppix = (Pixel *) xalloc(size * sizeof(Pixel));
- if (!ppix)
- {
- xfree(pmap->clientPixelsGreen[client]);
- xfree(pmap->clientPixelsRed[client]);
- xfree(pmap);
- return(BadAlloc);
- }
- pmap->clientPixelsBlue[client] = ppix;
- for(i = 0; i < size; i++)
- ppix[i] = i;
- pmap->numPixelsBlue[client] = size;
- }
- }
- if (!AddResource(mid, RT_COLORMAP, (pointer)pmap))
- return (BadAlloc);
- /* If the device wants a chance to initialize the colormap in any way,
- * this is it. In specific, if this is a Static colormap, this is the
- * time to fill in the colormap's values */
- pmap->flags |= BeingCreated;
-
-
- /*
- * Allocate the array of devPrivate's for this colormap.
- */
-
- if (colormapPrivateCount == 0)
- pmap->devPrivates = NULL;
- else
- {
- pmap->devPrivates = (DevUnion *) xalloc (
- colormapPrivateCount * sizeof(DevUnion));
-
- if (!pmap->devPrivates)
- {
- FreeResource (mid, RT_NONE);
- return BadAlloc;
- }
- }
-
- if (!(*pScreen->CreateColormap)(pmap))
- {
- FreeResource (mid, RT_NONE);
- return BadAlloc;
- }
- pmap->flags &= ~BeingCreated;
- *ppcmap = pmap;
- return (Success);
-}
-
-int
-FreeColormap (value, mid)
- pointer value; /* must conform to DeleteType */
- XID mid;
-{
- int i;
- register EntryPtr pent;
- ColormapPtr pmap = (ColormapPtr)value;
-
- if(CLIENT_ID(mid) != SERVER_ID)
- {
- (*pmap->pScreen->UninstallColormap) (pmap);
- WalkTree(pmap->pScreen, (VisitWindowProcPtr)TellNoMap, (pointer) &mid);
- }
-
- /* This is the device's chance to undo anything it needs to, especially
- * to free any storage it allocated */
- (*pmap->pScreen->DestroyColormap)(pmap);
-
- if(pmap->clientPixelsRed)
- {
- for(i = 0; i < MAXCLIENTS; i++)
- xfree(pmap->clientPixelsRed[i]);
- }
-
- if ((pmap->class == PseudoColor) || (pmap->class == GrayScale))
- {
- for(pent = &pmap->red[pmap->pVisual->ColormapEntries - 1];
- pent >= pmap->red;
- pent--)
- {
- if(pent->fShared)
- {
- if (--pent->co.shco.red->refcnt == 0)
- xfree(pent->co.shco.red);
- if (--pent->co.shco.green->refcnt == 0)
- xfree(pent->co.shco.green);
- if (--pent->co.shco.blue->refcnt == 0)
- xfree(pent->co.shco.blue);
- }
- }
- }
- if((pmap->class | DynamicClass) == DirectColor)
- {
- for(i = 0; i < MAXCLIENTS; i++)
- {
- xfree(pmap->clientPixelsGreen[i]);
- xfree(pmap->clientPixelsBlue[i]);
- }
- }
-
- if (pmap->devPrivates)
- xfree(pmap->devPrivates);
-
- xfree(pmap);
- return(Success);
-}
-
-/* Tell window that pmid has disappeared */
-static int
-TellNoMap (pwin, pmid)
- WindowPtr pwin;
- Colormap *pmid;
-{
- xEvent xE;
-
- if (wColormap(pwin) == *pmid)
- {
- /* This should be call to DeliverEvent */
- xE.u.u.type = ColormapNotify;
- xE.u.colormap.window = pwin->drawable.id;
- xE.u.colormap.colormap = None;
- xE.u.colormap.new = TRUE;
- xE.u.colormap.state = ColormapUninstalled;
-#ifdef PANORAMIX
- if(noPanoramiXExtension || !pwin->drawable.pScreen->myNum)
-#endif
- DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL);
- if (pwin->optional) {
- pwin->optional->colormap = None;
- CheckWindowOptionalNeed (pwin);
- }
- }
-
- return (WT_WALKCHILDREN);
-}
-
-/* Tell window that pmid got uninstalled */
-int
-TellLostMap (pwin, value)
- WindowPtr pwin;
- pointer value;
-{
- Colormap *pmid = (Colormap *)value;
- xEvent xE;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
- return WT_STOPWALKING;
-#endif
- if (wColormap(pwin) == *pmid)
- {
- /* This should be call to DeliverEvent */
- xE.u.u.type = ColormapNotify;
- xE.u.colormap.window = pwin->drawable.id;
- xE.u.colormap.colormap = *pmid;
- xE.u.colormap.new = FALSE;
- xE.u.colormap.state = ColormapUninstalled;
- DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL);
- }
-
- return (WT_WALKCHILDREN);
-}
-
-/* Tell window that pmid got installed */
-int
-TellGainedMap (pwin, value)
- WindowPtr pwin;
- pointer value;
-{
- Colormap *pmid = (Colormap *)value;
- xEvent xE;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum)
- return WT_STOPWALKING;
-#endif
- if (wColormap (pwin) == *pmid)
- {
- /* This should be call to DeliverEvent */
- xE.u.u.type = ColormapNotify;
- xE.u.colormap.window = pwin->drawable.id;
- xE.u.colormap.colormap = *pmid;
- xE.u.colormap.new = FALSE;
- xE.u.colormap.state = ColormapInstalled;
- DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL);
- }
-
- return (WT_WALKCHILDREN);
-}
-
-
-int
-CopyColormapAndFree (mid, pSrc, client)
- Colormap mid;
- ColormapPtr pSrc;
- int client;
-{
- ColormapPtr pmap = (ColormapPtr) NULL;
- int result, alloc, size;
- Colormap midSrc;
- ScreenPtr pScreen;
- VisualPtr pVisual;
-
- pScreen = pSrc->pScreen;
- pVisual = pSrc->pVisual;
- midSrc = pSrc->mid;
- alloc = ((pSrc->flags & AllAllocated) && CLIENT_ID(midSrc) == client) ?
- AllocAll : AllocNone;
- size = pVisual->ColormapEntries;
-
- /* If the create returns non-0, it failed */
- result = CreateColormap (mid, pScreen, pVisual, &pmap, alloc, client);
- if(result != Success)
- return(result);
- if(alloc == AllocAll)
- {
- memmove((char *)pmap->red, (char *)pSrc->red, size * sizeof(Entry));
- if((pmap->class | DynamicClass) == DirectColor)
- {
- memmove((char *)pmap->green, (char *)pSrc->green, size * sizeof(Entry));
- memmove((char *)pmap->blue, (char *)pSrc->blue, size * sizeof(Entry));
- }
- pSrc->flags &= ~AllAllocated;
- FreePixels(pSrc, client);
- UpdateColors(pmap);
- return(Success);
- }
-
- CopyFree(REDMAP, client, pSrc, pmap);
- if ((pmap->class | DynamicClass) == DirectColor)
- {
- CopyFree(GREENMAP, client, pSrc, pmap);
- CopyFree(BLUEMAP, client, pSrc, pmap);
- }
- if (pmap->class & DynamicClass)
- UpdateColors(pmap);
- /* XXX should worry about removing any RT_CMAPENTRY resource */
- return(Success);
-}
-
-/* Helper routine for freeing large numbers of cells from a map */
-static void
-CopyFree (channel, client, pmapSrc, pmapDst)
- int channel, client;
- ColormapPtr pmapSrc, pmapDst;
-{
- int z, npix;
- EntryPtr pentSrcFirst, pentDstFirst;
- EntryPtr pentSrc, pentDst;
- Pixel *ppix;
- int nalloc;
-
- switch(channel)
- {
- default: /* so compiler can see that everything gets initialized */
- case REDMAP:
- ppix = (pmapSrc->clientPixelsRed)[client];
- npix = (pmapSrc->numPixelsRed)[client];
- pentSrcFirst = pmapSrc->red;
- pentDstFirst = pmapDst->red;
- break;
- case GREENMAP:
- ppix = (pmapSrc->clientPixelsGreen)[client];
- npix = (pmapSrc->numPixelsGreen)[client];
- pentSrcFirst = pmapSrc->green;
- pentDstFirst = pmapDst->green;
- break;
- case BLUEMAP:
- ppix = (pmapSrc->clientPixelsBlue)[client];
- npix = (pmapSrc->numPixelsBlue)[client];
- pentSrcFirst = pmapSrc->blue;
- pentDstFirst = pmapDst->blue;
- break;
- }
- nalloc = 0;
- if (pmapSrc->class & DynamicClass)
- {
- for(z = npix; --z >= 0; ppix++)
- {
- /* Copy entries */
- pentSrc = pentSrcFirst + *ppix;
- pentDst = pentDstFirst + *ppix;
- if (pentDst->refcnt > 0)
- {
- pentDst->refcnt++;
- }
- else
- {
- *pentDst = *pentSrc;
- nalloc++;
- if (pentSrc->refcnt > 0)
- pentDst->refcnt = 1;
- else
- pentSrc->fShared = FALSE;
- }
- FreeCell(pmapSrc, *ppix, channel);
- }
- }
-
- /* Note that FreeCell has already fixed pmapSrc->free{Color} */
- switch(channel)
- {
- case REDMAP:
- pmapDst->freeRed -= nalloc;
- (pmapDst->clientPixelsRed)[client] =
- (pmapSrc->clientPixelsRed)[client];
- (pmapSrc->clientPixelsRed)[client] = (Pixel *) NULL;
- (pmapDst->numPixelsRed)[client] = (pmapSrc->numPixelsRed)[client];
- (pmapSrc->numPixelsRed)[client] = 0;
- break;
- case GREENMAP:
- pmapDst->freeGreen -= nalloc;
- (pmapDst->clientPixelsGreen)[client] =
- (pmapSrc->clientPixelsGreen)[client];
- (pmapSrc->clientPixelsGreen)[client] = (Pixel *) NULL;
- (pmapDst->numPixelsGreen)[client] = (pmapSrc->numPixelsGreen)[client];
- (pmapSrc->numPixelsGreen)[client] = 0;
- break;
- case BLUEMAP:
- pmapDst->freeBlue -= nalloc;
- pmapDst->clientPixelsBlue[client] = pmapSrc->clientPixelsBlue[client];
- pmapSrc->clientPixelsBlue[client] = (Pixel *) NULL;
- pmapDst->numPixelsBlue[client] = pmapSrc->numPixelsBlue[client];
- pmapSrc->numPixelsBlue[client] = 0;
- break;
- }
-}
-
-/* Free the ith entry in a color map. Must handle freeing of
- * colors allocated through AllocColorPlanes */
-static void
-FreeCell (pmap, i, channel)
- ColormapPtr pmap;
- Pixel i;
- int channel;
-{
- EntryPtr pent;
- int *pCount;
-
-
- switch (channel)
- {
- default: /* so compiler can see that everything gets initialized */
- case PSEUDOMAP:
- case REDMAP:
- pent = (EntryPtr) &pmap->red[i];
- pCount = &pmap->freeRed;
- break;
- case GREENMAP:
- pent = (EntryPtr) &pmap->green[i];
- pCount = &pmap->freeGreen;
- break;
- case BLUEMAP:
- pent = (EntryPtr) &pmap->blue[i];
- pCount = &pmap->freeBlue;
- break;
- }
- /* If it's not privately allocated and it's not time to free it, just
- * decrement the count */
- if (pent->refcnt > 1)
- pent->refcnt--;
- else
- {
- /* If the color type is shared, find the sharedcolor. If decremented
- * refcnt is 0, free the shared cell. */
- if (pent->fShared)
- {
- if(--pent->co.shco.red->refcnt == 0)
- xfree(pent->co.shco.red);
- if(--pent->co.shco.green->refcnt == 0)
- xfree(pent->co.shco.green);
- if(--pent->co.shco.blue->refcnt == 0)
- xfree(pent->co.shco.blue);
- pent->fShared = FALSE;
- }
- pent->refcnt = 0;
- *pCount += 1;
- }
-}
-
-static void
-UpdateColors (pmap)
- ColormapPtr pmap;
-{
- xColorItem *defs;
- register xColorItem *pdef;
- register EntryPtr pent;
- register VisualPtr pVisual;
- int i, n, size;
-
- pVisual = pmap->pVisual;
- size = pVisual->ColormapEntries;
- defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem));
- if (!defs)
- return;
- n = 0;
- pdef = defs;
- if (pmap->class == DirectColor)
- {
- for (i = 0; i < size; i++)
- {
- if (!pmap->red[i].refcnt &&
- !pmap->green[i].refcnt &&
- !pmap->blue[i].refcnt)
- continue;
- pdef->pixel = ((Pixel)i << pVisual->offsetRed) |
- ((Pixel)i << pVisual->offsetGreen) |
- ((Pixel)i << pVisual->offsetBlue);
- pdef->red = pmap->red[i].co.local.red;
- pdef->green = pmap->green[i].co.local.green;
- pdef->blue = pmap->blue[i].co.local.blue;
- pdef->flags = DoRed|DoGreen|DoBlue;
- pdef++;
- n++;
- }
- }
- else
- {
- for (i = 0, pent = pmap->red; i < size; i++, pent++)
- {
- if (!pent->refcnt)
- continue;
- pdef->pixel = i;
- if(pent->fShared)
- {
- pdef->red = pent->co.shco.red->color;
- pdef->green = pent->co.shco.green->color;
- pdef->blue = pent->co.shco.blue->color;
- }
- else
- {
- pdef->red = pent->co.local.red;
- pdef->green = pent->co.local.green;
- pdef->blue = pent->co.local.blue;
- }
- pdef->flags = DoRed|DoGreen|DoBlue;
- pdef++;
- n++;
- }
- }
- if (n)
- (*pmap->pScreen->StoreColors)(pmap, n, defs);
- DEALLOCATE_LOCAL(defs);
-}
-
-/* Get a read-only color from a ColorMap (probably slow for large maps)
- * Returns by changing the value in pred, pgreen, pblue and pPix
- */
-int
-AllocColor (pmap, pred, pgreen, pblue, pPix, client)
- ColormapPtr pmap;
- unsigned short *pred, *pgreen, *pblue;
- Pixel *pPix;
- int client;
-{
- Pixel pixR, pixG, pixB;
- int entries;
- xrgb rgb;
- int class;
- VisualPtr pVisual;
- int npix;
- Pixel *ppix;
-
- pVisual = pmap->pVisual;
- (*pmap->pScreen->ResolveColor) (pred, pgreen, pblue, pVisual);
- rgb.red = *pred;
- rgb.green = *pgreen;
- rgb.blue = *pblue;
- class = pmap->class;
- entries = pVisual->ColormapEntries;
-
- /* If the colormap is being created, then we want to be able to change
- * the colormap, even if it's a static type. Otherwise, we'd never be
- * able to initialize static colormaps
- */
- if(pmap->flags & BeingCreated)
- class |= DynamicClass;
-
- /* If this is one of the static storage classes, and we're not initializing
- * it, the best we can do is to find the closest color entry to the
- * requested one and return that.
- */
- switch (class) {
- case StaticColor:
- case StaticGray:
- /* Look up all three components in the same pmap */
- *pPix = pixR = FindBestPixel(pmap->red, entries, &rgb, PSEUDOMAP);
- *pred = pmap->red[pixR].co.local.red;
- *pgreen = pmap->red[pixR].co.local.green;
- *pblue = pmap->red[pixR].co.local.blue;
- npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
- (npix + 1) * sizeof(Pixel));
- if (!ppix)
- return (BadAlloc);
- ppix[npix] = pixR;
- pmap->clientPixelsRed[client] = ppix;
- pmap->numPixelsRed[client]++;
- break;
-
- case TrueColor:
- /* Look up each component in its own map, then OR them together */
- pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP);
- pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb, GREENMAP);
- pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP);
- *pPix = (pixR << pVisual->offsetRed) |
- (pixG << pVisual->offsetGreen) |
- (pixB << pVisual->offsetBlue);
- *pred = pmap->red[pixR].co.local.red;
- *pgreen = pmap->green[pixG].co.local.green;
- *pblue = pmap->blue[pixB].co.local.blue;
- npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
- (npix + 1) * sizeof(Pixel));
- if (!ppix)
- return (BadAlloc);
- ppix[npix] = pixR;
- pmap->clientPixelsRed[client] = ppix;
- npix = pmap->numPixelsGreen[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
- (npix + 1) * sizeof(Pixel));
- if (!ppix)
- return (BadAlloc);
- ppix[npix] = pixG;
- pmap->clientPixelsGreen[client] = ppix;
- npix = pmap->numPixelsBlue[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
- (npix + 1) * sizeof(Pixel));
- if (!ppix)
- return (BadAlloc);
- ppix[npix] = pixB;
- pmap->clientPixelsBlue[client] = ppix;
- pmap->numPixelsRed[client]++;
- pmap->numPixelsGreen[client]++;
- pmap->numPixelsBlue[client]++;
- break;
-
- case GrayScale:
- case PseudoColor:
- if (pmap->mid != pmap->pScreen->defColormap &&
- pmap->pVisual->vid == pmap->pScreen->rootVisual)
- {
- ColormapPtr prootmap = (ColormapPtr)
- SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap,
- RT_COLORMAP, SecurityReadAccess);
-
- if (pmap->class == prootmap->class)
- FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb,
- pPix, PSEUDOMAP, AllComp);
- }
- if (FindColor(pmap, pmap->red, entries, &rgb, pPix, PSEUDOMAP,
- client, AllComp) != Success)
- return (BadAlloc);
- break;
-
- case DirectColor:
- if (pmap->mid != pmap->pScreen->defColormap &&
- pmap->pVisual->vid == pmap->pScreen->rootVisual)
- {
- ColormapPtr prootmap = (ColormapPtr)
- SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap,
- RT_COLORMAP, SecurityReadAccess);
-
- if (pmap->class == prootmap->class)
- {
- pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed;
- FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb,
- &pixR, REDMAP, RedComp);
- pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen;
- FindColorInRootCmap (prootmap, prootmap->green, entries, &rgb,
- &pixG, GREENMAP, GreenComp);
- pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue;
- FindColorInRootCmap (prootmap, prootmap->blue, entries, &rgb,
- &pixB, BLUEMAP, BlueComp);
- *pPix = pixR | pixG | pixB;
- }
- }
-
- pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed;
- if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP,
- client, RedComp) != Success)
- return (BadAlloc);
- pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen;
- if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG,
- GREENMAP, client, GreenComp) != Success)
- {
- (void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
- return (BadAlloc);
- }
- pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue;
- if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP,
- client, BlueComp) != Success)
- {
- (void)FreeCo(pmap, client, GREENMAP, 1, &pixG, (Pixel)0);
- (void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
- return (BadAlloc);
- }
- *pPix = pixR | pixG | pixB;
- break;
- }
-
- /* if this is the client's first pixel in this colormap, tell the
- * resource manager that the client has pixels in this colormap which
- * should be freed when the client dies */
- if ((pmap->numPixelsRed[client] == 1) &&
- (CLIENT_ID(pmap->mid) != client) &&
- !(pmap->flags & BeingCreated))
- {
- colorResource *pcr;
-
- pcr = (colorResource *) xalloc(sizeof(colorResource));
- if (!pcr)
- {
- (void)FreeColors(pmap, client, 1, pPix, (Pixel)0);
- return (BadAlloc);
- }
- pcr->mid = pmap->mid;
- pcr->client = client;
- if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr))
- return (BadAlloc);
- }
- return (Success);
-}
-
-/*
- * FakeAllocColor -- fake an AllocColor request by
- * returning a free pixel if availible, otherwise returning
- * the closest matching pixel. This is used by the mi
- * software sprite code to recolor cursors. A nice side-effect
- * is that this routine will never return failure.
- */
-
-void
-FakeAllocColor (pmap, item)
- register ColormapPtr pmap;
- register xColorItem *item;
-{
- Pixel pixR, pixG, pixB;
- Pixel temp;
- int entries;
- xrgb rgb;
- int class;
- register VisualPtr pVisual;
-
- pVisual = pmap->pVisual;
- rgb.red = item->red;
- rgb.green = item->green;
- rgb.blue = item->blue;
- (*pmap->pScreen->ResolveColor) (&rgb.red, &rgb.green, &rgb.blue, pVisual);
- class = pmap->class;
- entries = pVisual->ColormapEntries;
-
- switch (class) {
- case GrayScale:
- case PseudoColor:
- item->pixel = 0;
- if (FindColor(pmap, pmap->red, entries, &rgb, &temp, PSEUDOMAP,
- -1, AllComp) == Success) {
- item->pixel = temp;
- break;
- }
- /* fall through ... */
- case StaticColor:
- case StaticGray:
- item->pixel = FindBestPixel(pmap->red, entries, &rgb, PSEUDOMAP);
- break;
-
- case DirectColor:
- /* Look up each component in its own map, then OR them together */
- pixR = (item->pixel & pVisual->redMask) >> pVisual->offsetRed;
- pixG = (item->pixel & pVisual->greenMask) >> pVisual->offsetGreen;
- pixB = (item->pixel & pVisual->blueMask) >> pVisual->offsetBlue;
- if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP,
- -1, RedComp) != Success)
- pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP)
- << pVisual->offsetRed;
- if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG,
- GREENMAP, -1, GreenComp) != Success)
- pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb,
- GREENMAP) << pVisual->offsetGreen;
- if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP,
- -1, BlueComp) != Success)
- pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP)
- << pVisual->offsetBlue;
- item->pixel = pixR | pixG | pixB;
- break;
-
- case TrueColor:
- /* Look up each component in its own map, then OR them together */
- pixR = FindBestPixel(pmap->red, NUMRED(pVisual), &rgb, REDMAP);
- pixG = FindBestPixel(pmap->green, NUMGREEN(pVisual), &rgb, GREENMAP);
- pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP);
- item->pixel = (pixR << pVisual->offsetRed) |
- (pixG << pVisual->offsetGreen) |
- (pixB << pVisual->offsetBlue);
- break;
- }
-}
-
-/* free a pixel value obtained from FakeAllocColor */
-void
-FakeFreeColor(pmap, pixel)
- register ColormapPtr pmap;
- Pixel pixel;
-{
- register VisualPtr pVisual;
- Pixel pixR, pixG, pixB;
-
- switch (pmap->class) {
- case GrayScale:
- case PseudoColor:
- if (pmap->red[pixel].refcnt == AllocTemporary)
- pmap->red[pixel].refcnt = 0;
- break;
- case DirectColor:
- pVisual = pmap->pVisual;
- pixR = (pixel & pVisual->redMask) >> pVisual->offsetRed;
- pixG = (pixel & pVisual->greenMask) >> pVisual->offsetGreen;
- pixB = (pixel & pVisual->blueMask) >> pVisual->offsetBlue;
- if (pmap->red[pixR].refcnt == AllocTemporary)
- pmap->red[pixR].refcnt = 0;
- if (pmap->green[pixG].refcnt == AllocTemporary)
- pmap->green[pixG].refcnt = 0;
- if (pmap->blue[pixB].refcnt == AllocTemporary)
- pmap->blue[pixB].refcnt = 0;
- break;
- }
-}
-
-typedef unsigned short BigNumUpper;
-typedef unsigned long BigNumLower;
-
-#define BIGNUMLOWERBITS 24
-#define BIGNUMUPPERBITS 16
-#define BIGNUMLOWER (1 << BIGNUMLOWERBITS)
-#define BIGNUMUPPER (1 << BIGNUMUPPERBITS)
-#define UPPERPART(i) ((i) >> BIGNUMLOWERBITS)
-#define LOWERPART(i) ((i) & (BIGNUMLOWER - 1))
-
-typedef struct _bignum {
- BigNumUpper upper;
- BigNumLower lower;
-} BigNumRec, *BigNumPtr;
-
-#define BigNumGreater(x,y) (((x)->upper > (y)->upper) ||\
- ((x)->upper == (y)->upper && (x)->lower > (y)->lower))
-
-#define UnsignedToBigNum(u,r) (((r)->upper = UPPERPART(u)), \
- ((r)->lower = LOWERPART(u)))
-
-#define MaxBigNum(r) (((r)->upper = BIGNUMUPPER-1), \
- ((r)->lower = BIGNUMLOWER-1))
-
-static void
-BigNumAdd (BigNumPtr x, BigNumPtr y, BigNumPtr r)
-{
- BigNumLower lower, carry = 0;
-
- lower = x->lower + y->lower;
- if (lower >= BIGNUMLOWER) {
- lower -= BIGNUMLOWER;
- carry = 1;
- }
- r->lower = lower;
- r->upper = x->upper + y->upper + carry;
-}
-
-static Pixel
-FindBestPixel(pentFirst, size, prgb, channel)
- EntryPtr pentFirst;
- int size;
- xrgb *prgb;
- int channel;
-{
- EntryPtr pent;
- Pixel pixel, final;
- long dr, dg, db;
- unsigned long sq;
- BigNumRec minval, sum, temp;
-
- final = 0;
- MaxBigNum(&minval);
- /* look for the minimal difference */
- for (pent = pentFirst, pixel = 0; pixel < size; pent++, pixel++)
- {
- dr = dg = db = 0;
- switch(channel)
- {
- case PSEUDOMAP:
- dg = (long) pent->co.local.green - prgb->green;
- db = (long) pent->co.local.blue - prgb->blue;
- case REDMAP:
- dr = (long) pent->co.local.red - prgb->red;
- break;
- case GREENMAP:
- dg = (long) pent->co.local.green - prgb->green;
- break;
- case BLUEMAP:
- db = (long) pent->co.local.blue - prgb->blue;
- break;
- }
- sq = dr * dr;
- UnsignedToBigNum (sq, &sum);
- sq = dg * dg;
- UnsignedToBigNum (sq, &temp);
- BigNumAdd (&sum, &temp, &sum);
- sq = db * db;
- UnsignedToBigNum (sq, &temp);
- BigNumAdd (&sum, &temp, &sum);
- if (BigNumGreater (&minval, &sum))
- {
- final = pixel;
- minval = sum;
- }
- }
- return(final);
-}
-
-static void
-FindColorInRootCmap (pmap, pentFirst, size, prgb, pPixel, channel, comp)
- ColormapPtr pmap;
- EntryPtr pentFirst;
- int size;
- xrgb* prgb;
- Pixel* pPixel;
- int channel;
- ColorCompareProcPtr comp;
-{
- EntryPtr pent;
- Pixel pixel;
- int count;
-
- if ((pixel = *pPixel) >= size)
- pixel = 0;
- for (pent = pentFirst + pixel, count = size; --count >= 0; pent++, pixel++)
- {
- if (pent->refcnt > 0 && (*comp) (pent, prgb))
- {
- switch (channel)
- {
- case REDMAP:
- pixel <<= pmap->pVisual->offsetRed;
- break;
- case GREENMAP:
- pixel <<= pmap->pVisual->offsetGreen;
- break;
- case BLUEMAP:
- pixel <<= pmap->pVisual->offsetBlue;
- break;
- default: /* PSEUDOMAP */
- break;
- }
- *pPixel = pixel;
- }
- }
-}
-
-/* Tries to find a color in pmap that exactly matches the one requested in prgb
- * if it can't it allocates one.
- * Starts looking at pentFirst + *pPixel, so if you want a specific pixel,
- * load *pPixel with that value, otherwise set it to 0
- */
-int
-FindColor (pmap, pentFirst, size, prgb, pPixel, channel, client, comp)
- ColormapPtr pmap;
- EntryPtr pentFirst;
- int size;
- xrgb *prgb;
- Pixel *pPixel;
- int channel;
- int client;
- ColorCompareProcPtr comp;
-{
- EntryPtr pent;
- Bool foundFree;
- Pixel pixel, Free = 0;
- int npix, count, *nump = NULL;
- Pixel **pixp = NULL, *ppix;
- xColorItem def;
-
- foundFree = FALSE;
-
- if((pixel = *pPixel) >= size)
- pixel = 0;
- /* see if there is a match, and also look for a free entry */
- for (pent = pentFirst + pixel, count = size; --count >= 0; )
- {
- if (pent->refcnt > 0)
- {
- if ((*comp) (pent, prgb))
- {
- if (client >= 0)
- pent->refcnt++;
- *pPixel = pixel;
- switch(channel)
- {
- case REDMAP:
- *pPixel <<= pmap->pVisual->offsetRed;
- case PSEUDOMAP:
- break;
- case GREENMAP:
- *pPixel <<= pmap->pVisual->offsetGreen;
- break;
- case BLUEMAP:
- *pPixel <<= pmap->pVisual->offsetBlue;
- break;
- }
- goto gotit;
- }
- }
- else if (!foundFree && pent->refcnt == 0)
- {
- Free = pixel;
- foundFree = TRUE;
- /* If we're initializing the colormap, then we are looking for
- * the first free cell we can find, not to minimize the number
- * of entries we use. So don't look any further. */
- if(pmap->flags & BeingCreated)
- break;
- }
- pixel++;
- if(pixel >= size)
- {
- pent = pentFirst;
- pixel = 0;
- }
- else
- pent++;
- }
-
- /* If we got here, we didn't find a match. If we also didn't find
- * a free entry, we're out of luck. Otherwise, we'll usurp a free
- * entry and fill it in */
- if (!foundFree)
- return (BadAlloc);
- pent = pentFirst + Free;
- pent->fShared = FALSE;
- pent->refcnt = (client >= 0) ? 1 : AllocTemporary;
-
- switch (channel)
- {
- case PSEUDOMAP:
- pent->co.local.red = prgb->red;
- pent->co.local.green = prgb->green;
- pent->co.local.blue = prgb->blue;
- def.red = prgb->red;
- def.green = prgb->green;
- def.blue = prgb->blue;
- def.flags = (DoRed|DoGreen|DoBlue);
- if (client >= 0)
- pmap->freeRed--;
- def.pixel = Free;
- break;
-
- case REDMAP:
- pent->co.local.red = prgb->red;
- def.red = prgb->red;
- def.green = pmap->green[0].co.local.green;
- def.blue = pmap->blue[0].co.local.blue;
- def.flags = DoRed;
- if (client >= 0)
- pmap->freeRed--;
- def.pixel = Free << pmap->pVisual->offsetRed;
- break;
-
- case GREENMAP:
- pent->co.local.green = prgb->green;
- def.red = pmap->red[0].co.local.red;
- def.green = prgb->green;
- def.blue = pmap->blue[0].co.local.blue;
- def.flags = DoGreen;
- if (client >= 0)
- pmap->freeGreen--;
- def.pixel = Free << pmap->pVisual->offsetGreen;
- break;
-
- case BLUEMAP:
- pent->co.local.blue = prgb->blue;
- def.red = pmap->red[0].co.local.red;
- def.green = pmap->green[0].co.local.green;
- def.blue = prgb->blue;
- def.flags = DoBlue;
- if (client >= 0)
- pmap->freeBlue--;
- def.pixel = Free << pmap->pVisual->offsetBlue;
- break;
- }
- (*pmap->pScreen->StoreColors) (pmap, 1, &def);
- pixel = Free;
- *pPixel = def.pixel;
-
-gotit:
- if (pmap->flags & BeingCreated || client == -1)
- return(Success);
- /* Now remember the pixel, for freeing later */
- switch (channel)
- {
- case PSEUDOMAP:
- case REDMAP:
- nump = pmap->numPixelsRed;
- pixp = pmap->clientPixelsRed;
- break;
-
- case GREENMAP:
- nump = pmap->numPixelsGreen;
- pixp = pmap->clientPixelsGreen;
- break;
-
- case BLUEMAP:
- nump = pmap->numPixelsBlue;
- pixp = pmap->clientPixelsBlue;
- break;
- }
- npix = nump[client];
- ppix = (Pixel *) xrealloc (pixp[client], (npix + 1) * sizeof(Pixel));
- if (!ppix)
- {
- pent->refcnt--;
- if (!pent->fShared)
- switch (channel)
- {
- case PSEUDOMAP:
- case REDMAP:
- pmap->freeRed++;
- break;
- case GREENMAP:
- pmap->freeGreen++;
- break;
- case BLUEMAP:
- pmap->freeBlue++;
- break;
- }
- return(BadAlloc);
- }
- ppix[npix] = pixel;
- pixp[client] = ppix;
- nump[client]++;
-
- return(Success);
-}
-
-/* Comparison functions -- passed to FindColor to determine if an
- * entry is already the color we're looking for or not */
-static int
-AllComp (pent, prgb)
- EntryPtr pent;
- xrgb *prgb;
-{
- if((pent->co.local.red == prgb->red) &&
- (pent->co.local.green == prgb->green) &&
- (pent->co.local.blue == prgb->blue) )
- return (1);
- return (0);
-}
-
-static int
-RedComp (pent, prgb)
- EntryPtr pent;
- xrgb *prgb;
-{
- if (pent->co.local.red == prgb->red)
- return (1);
- return (0);
-}
-
-static int
-GreenComp (pent, prgb)
- EntryPtr pent;
- xrgb *prgb;
-{
- if (pent->co.local.green == prgb->green)
- return (1);
- return (0);
-}
-
-static int
-BlueComp (pent, prgb)
- EntryPtr pent;
- xrgb *prgb;
-{
- if (pent->co.local.blue == prgb->blue)
- return (1);
- return (0);
-}
-
-
-/* Read the color value of a cell */
-
-int
-QueryColors (pmap, count, ppixIn, prgbList)
- ColormapPtr pmap;
- int count;
- Pixel *ppixIn;
- xrgb *prgbList;
-{
- Pixel *ppix, pixel;
- xrgb *prgb;
- VisualPtr pVisual;
- EntryPtr pent;
- Pixel i;
- int errVal = Success;
-
- pVisual = pmap->pVisual;
- if ((pmap->class | DynamicClass) == DirectColor)
- {
- int numred, numgreen, numblue;
- Pixel rgbbad;
-
- numred = NUMRED(pVisual);
- numgreen = NUMGREEN(pVisual);
- numblue = NUMBLUE(pVisual);
- rgbbad = ~RGBMASK(pVisual);
- for( ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++)
- {
- pixel = *ppix;
- if (pixel & rgbbad) {
- clientErrorValue = pixel;
- errVal = BadValue;
- continue;
- }
- i = (pixel & pVisual->redMask) >> pVisual->offsetRed;
- if (i >= numred)
- {
- clientErrorValue = pixel;
- errVal = BadValue;
- continue;
- }
- prgb->red = pmap->red[i].co.local.red;
- i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen;
- if (i >= numgreen)
- {
- clientErrorValue = pixel;
- errVal = BadValue;
- continue;
- }
- prgb->green = pmap->green[i].co.local.green;
- i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue;
- if (i >= numblue)
- {
- clientErrorValue = pixel;
- errVal = BadValue;
- continue;
- }
- prgb->blue = pmap->blue[i].co.local.blue;
- }
- }
- else
- {
- for( ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++)
- {
- pixel = *ppix;
- if (pixel >= pVisual->ColormapEntries)
- {
- clientErrorValue = pixel;
- errVal = BadValue;
- }
- else
- {
- pent = (EntryPtr)&pmap->red[pixel];
- if (pent->fShared)
- {
- prgb->red = pent->co.shco.red->color;
- prgb->green = pent->co.shco.green->color;
- prgb->blue = pent->co.shco.blue->color;
- }
- else
- {
- prgb->red = pent->co.local.red;
- prgb->green = pent->co.local.green;
- prgb->blue = pent->co.local.blue;
- }
- }
- }
- }
- return (errVal);
-}
-
-static void
-FreePixels(pmap, client)
- register ColormapPtr pmap;
- register int client;
-{
- register Pixel *ppix, *ppixStart;
- register int n;
- int class;
-#ifdef LBX
- Bool grabbed;
- Bool zeroRefCount;
- Bool anyRefCountReachedZero = 0;
-#endif
-
- class = pmap->class;
- ppixStart = pmap->clientPixelsRed[client];
- if (class & DynamicClass)
- {
- n = pmap->numPixelsRed[client];
-#ifdef LBX
- grabbed = LbxCheckCmapGrabbed (pmap);
- if (grabbed)
- {
- /*
- * If the colormap is grabbed by a proxy, the server must
- * notify the proxy of all cells that are freed (the refcount
- * has reached zero on these cells).
- */
-
- LbxBeginFreeCellsEvent (pmap);
- LbxSortPixelList (ppixStart, n);
- }
-#endif
- for (ppix = ppixStart; --n >= 0; )
- {
- FreeCell(pmap, *ppix, REDMAP);
-#ifdef LBX
- /*
- * Only PSEUDO colormaps are grabbed by LBX proxies.
- * Check if the ref count reached zero on this pixel.
- */
-
- zeroRefCount = pmap->red[*ppix].refcnt == 0;
- if (zeroRefCount)
- anyRefCountReachedZero = 1;
-
- if (grabbed && zeroRefCount)
- LbxAddFreeCellToEvent (pmap, *ppix);
-#endif
- ppix++;
- }
-#ifdef LBX
- if (grabbed)
- LbxEndFreeCellsEvent (pmap);
- else if (anyRefCountReachedZero)
- {
- /*
- * We only send LbxFreeCell events to a proxy that has the colormap
- * grabbed. If the colormap is not grabbed, the proxy that last
- * had the colormap grabbed will not be able to do a smart grab
- * in the future. A smart grab can only occur if the proxy is kept
- * up to date on every alloc/free change in the colormap.
- */
-
- LbxDisableSmartGrab (pmap);
- }
-#endif
- }
-
- xfree(ppixStart);
- pmap->clientPixelsRed[client] = (Pixel *) NULL;
- pmap->numPixelsRed[client] = 0;
- if ((class | DynamicClass) == DirectColor)
- {
- ppixStart = pmap->clientPixelsGreen[client];
- if (class & DynamicClass)
- for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;)
- FreeCell(pmap, *ppix++, GREENMAP);
- xfree(ppixStart);
- pmap->clientPixelsGreen[client] = (Pixel *) NULL;
- pmap->numPixelsGreen[client] = 0;
-
- ppixStart = pmap->clientPixelsBlue[client];
- if (class & DynamicClass)
- for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0; )
- FreeCell(pmap, *ppix++, BLUEMAP);
- xfree(ppixStart);
- pmap->clientPixelsBlue[client] = (Pixel *) NULL;
- pmap->numPixelsBlue[client] = 0;
- }
-}
-
-/* Free all of a client's colors and cells */
-/*ARGSUSED*/
-int
-FreeClientPixels (value, fakeid)
- pointer value; /* must conform to DeleteType */
- XID fakeid;
-{
- ColormapPtr pmap;
- colorResource *pcr = (colorResource *)value;
-
- pmap = (ColormapPtr) LookupIDByType(pcr->mid, RT_COLORMAP);
- if (pmap)
- FreePixels(pmap, pcr->client);
- xfree(pcr);
- return Success;
-}
-
-int
-AllocColorCells (client, pmap, colors, planes, contig, ppix, masks)
- int client;
- ColormapPtr pmap;
- int colors, planes;
- Bool contig;
- Pixel *ppix;
- Pixel *masks;
-{
- Pixel rmask, gmask, bmask, *ppixFirst, r, g, b;
- int n, class;
- int ok;
- int oldcount;
- colorResource *pcr = (colorResource *)NULL;
-
- class = pmap->class;
- if (!(class & DynamicClass))
- return (BadAlloc); /* Shouldn't try on this type */
- oldcount = pmap->numPixelsRed[client];
- if (pmap->class == DirectColor)
- oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
- if (!oldcount && (CLIENT_ID(pmap->mid) != client))
- {
- pcr = (colorResource *) xalloc(sizeof(colorResource));
- if (!pcr)
- return (BadAlloc);
- }
-
- if (pmap->class == DirectColor)
- {
- ok = AllocDirect (client, pmap, colors, planes, planes, planes,
- contig, ppix, &rmask, &gmask, &bmask);
- if(ok == Success)
- {
- for (r = g = b = 1, n = planes; --n >= 0; r += r, g += g, b += b)
- {
- while(!(rmask & r))
- r += r;
- while(!(gmask & g))
- g += g;
- while(!(bmask & b))
- b += b;
- *masks++ = r | g | b;
- }
- }
- }
- else
- {
- ok = AllocPseudo (client, pmap, colors, planes, contig, ppix, &rmask,
- &ppixFirst);
- if(ok == Success)
- {
- for (r = 1, n = planes; --n >= 0; r += r)
- {
- while(!(rmask & r))
- r += r;
- *masks++ = r;
- }
- }
- }
-
- /* if this is the client's first pixels in this colormap, tell the
- * resource manager that the client has pixels in this colormap which
- * should be freed when the client dies */
- if ((ok == Success) && pcr)
- {
- pcr->mid = pmap->mid;
- pcr->client = client;
- if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr))
- ok = BadAlloc;
- } else if (pcr)
- xfree(pcr);
-
- return (ok);
-}
-
-
-int
-AllocColorPlanes (client, pmap, colors, r, g, b, contig, pixels,
- prmask, pgmask, pbmask)
- int client;
- ColormapPtr pmap;
- int colors, r, g, b;
- Bool contig;
- Pixel *pixels;
- Pixel *prmask, *pgmask, *pbmask;
-{
- int ok;
- Pixel mask, *ppixFirst;
- register Pixel shift;
- register int i;
- int class;
- int oldcount;
- colorResource *pcr = (colorResource *)NULL;
-
- class = pmap->class;
- if (!(class & DynamicClass))
- return (BadAlloc); /* Shouldn't try on this type */
- oldcount = pmap->numPixelsRed[client];
- if (class == DirectColor)
- oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
- if (!oldcount && (CLIENT_ID(pmap->mid) != client))
- {
- pcr = (colorResource *) xalloc(sizeof(colorResource));
- if (!pcr)
- return (BadAlloc);
- }
-
- if (class == DirectColor)
- {
- ok = AllocDirect (client, pmap, colors, r, g, b, contig, pixels,
- prmask, pgmask, pbmask);
- }
- else
- {
- /* Allocate the proper pixels */
- /* XXX This is sort of bad, because of contig is set, we force all
- * r + g + b bits to be contiguous. Should only force contiguity
- * per mask
- */
- ok = AllocPseudo (client, pmap, colors, r + g + b, contig, pixels,
- &mask, &ppixFirst);
-
- if(ok == Success)
- {
- /* now split that mask into three */
- *prmask = *pgmask = *pbmask = 0;
- shift = 1;
- for (i = r; --i >= 0; shift += shift)
- {
- while (!(mask & shift))
- shift += shift;
- *prmask |= shift;
- }
- for (i = g; --i >= 0; shift += shift)
- {
- while (!(mask & shift))
- shift += shift;
- *pgmask |= shift;
- }
- for (i = b; --i >= 0; shift += shift)
- {
- while (!(mask & shift))
- shift += shift;
- *pbmask |= shift;
- }
-
- /* set up the shared color cells */
- if (!AllocShared(pmap, pixels, colors, r, g, b,
- *prmask, *pgmask, *pbmask, ppixFirst))
- {
- (void)FreeColors(pmap, client, colors, pixels, mask);
- ok = BadAlloc;
- }
- }
- }
-
- /* if this is the client's first pixels in this colormap, tell the
- * resource manager that the client has pixels in this colormap which
- * should be freed when the client dies */
- if ((ok == Success) && pcr)
- {
- pcr->mid = pmap->mid;
- pcr->client = client;
- if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr))
- ok = BadAlloc;
- } else if (pcr)
- xfree(pcr);
-
- return (ok);
-}
-
-static int
-AllocDirect (client, pmap, c, r, g, b, contig, pixels, prmask, pgmask, pbmask)
- int client;
- ColormapPtr pmap;
- int c, r, g, b;
- Bool contig;
- Pixel *pixels;
- Pixel *prmask, *pgmask, *pbmask;
-{
- Pixel *ppixRed, *ppixGreen, *ppixBlue;
- Pixel *ppix, *pDst, *p;
- int npix, npixR, npixG, npixB;
- Bool okR, okG, okB;
- Pixel *rpix = 0, *gpix = 0, *bpix = 0;
-
- npixR = c << r;
- npixG = c << g;
- npixB = c << b;
- if ((r >= 32) || (g >= 32) || (b >= 32) ||
- (npixR > pmap->freeRed) || (npixR < c) ||
- (npixG > pmap->freeGreen) || (npixG < c) ||
- (npixB > pmap->freeBlue) || (npixB < c))
- return BadAlloc;
-
- /* start out with empty pixels */
- for(p = pixels; p < pixels + c; p++)
- *p = 0;
-
- ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel));
- ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel));
- ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel));
- if (!ppixRed || !ppixGreen || !ppixBlue)
- {
- if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue);
- if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen);
- if (ppixRed) DEALLOCATE_LOCAL(ppixRed);
- return(BadAlloc);
- }
-
- okR = AllocCP(pmap, pmap->red, c, r, contig, ppixRed, prmask);
- okG = AllocCP(pmap, pmap->green, c, g, contig, ppixGreen, pgmask);
- okB = AllocCP(pmap, pmap->blue, c, b, contig, ppixBlue, pbmask);
-
- if (okR && okG && okB)
- {
- rpix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
- (pmap->numPixelsRed[client] + (c << r)) *
- sizeof(Pixel));
- if (rpix)
- pmap->clientPixelsRed[client] = rpix;
- gpix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
- (pmap->numPixelsGreen[client] + (c << g)) *
- sizeof(Pixel));
- if (gpix)
- pmap->clientPixelsGreen[client] = gpix;
- bpix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
- (pmap->numPixelsBlue[client] + (c << b)) *
- sizeof(Pixel));
- if (bpix)
- pmap->clientPixelsBlue[client] = bpix;
- }
-
- if (!okR || !okG || !okB || !rpix || !gpix || !bpix)
- {
- if (okR)
- for(ppix = ppixRed, npix = npixR; --npix >= 0; ppix++)
- pmap->red[*ppix].refcnt = 0;
- if (okG)
- for(ppix = ppixGreen, npix = npixG; --npix >= 0; ppix++)
- pmap->green[*ppix].refcnt = 0;
- if (okB)
- for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++)
- pmap->blue[*ppix].refcnt = 0;
- DEALLOCATE_LOCAL(ppixBlue);
- DEALLOCATE_LOCAL(ppixGreen);
- DEALLOCATE_LOCAL(ppixRed);
- return(BadAlloc);
- }
-
- *prmask <<= pmap->pVisual->offsetRed;
- *pgmask <<= pmap->pVisual->offsetGreen;
- *pbmask <<= pmap->pVisual->offsetBlue;
-
- ppix = rpix + pmap->numPixelsRed[client];
- for (pDst = pixels, p = ppixRed; p < ppixRed + npixR; p++)
- {
- *ppix++ = *p;
- if(p < ppixRed + c)
- *pDst++ |= *p << pmap->pVisual->offsetRed;
- }
- pmap->numPixelsRed[client] += npixR;
- pmap->freeRed -= npixR;
-
- ppix = gpix + pmap->numPixelsGreen[client];
- for (pDst = pixels, p = ppixGreen; p < ppixGreen + npixG; p++)
- {
- *ppix++ = *p;
- if(p < ppixGreen + c)
- *pDst++ |= *p << pmap->pVisual->offsetGreen;
- }
- pmap->numPixelsGreen[client] += npixG;
- pmap->freeGreen -= npixG;
-
- ppix = bpix + pmap->numPixelsBlue[client];
- for (pDst = pixels, p = ppixBlue; p < ppixBlue + npixB; p++)
- {
- *ppix++ = *p;
- if(p < ppixBlue + c)
- *pDst++ |= *p << pmap->pVisual->offsetBlue;
- }
- pmap->numPixelsBlue[client] += npixB;
- pmap->freeBlue -= npixB;
-
- DEALLOCATE_LOCAL(ppixBlue);
- DEALLOCATE_LOCAL(ppixGreen);
- DEALLOCATE_LOCAL(ppixRed);
-
- return (Success);
-}
-
-static int
-AllocPseudo (client, pmap, c, r, contig, pixels, pmask, pppixFirst)
- int client;
- ColormapPtr pmap;
- int c, r;
- Bool contig;
- Pixel *pixels;
- Pixel *pmask;
- Pixel **pppixFirst;
-{
- Pixel *ppix, *p, *pDst, *ppixTemp;
- int npix;
- Bool ok;
-
- npix = c << r;
- if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
- return(BadAlloc);
- if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel))))
- return(BadAlloc);
- ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask);
-
- if (ok)
- {
-
- /* all the allocated pixels are added to the client pixel list,
- * but only the unique ones are returned to the client */
- ppix = (Pixel *)xrealloc(pmap->clientPixelsRed[client],
- (pmap->numPixelsRed[client] + npix) * sizeof(Pixel));
- if (!ppix)
- {
- for (p = ppixTemp; p < ppixTemp + npix; p++)
- pmap->red[*p].refcnt = 0;
- return (BadAlloc);
- }
- pmap->clientPixelsRed[client] = ppix;
- ppix += pmap->numPixelsRed[client];
- *pppixFirst = ppix;
- pDst = pixels;
- for (p = ppixTemp; p < ppixTemp + npix; p++)
- {
- *ppix++ = *p;
- if(p < ppixTemp + c)
- *pDst++ = *p;
- }
- pmap->numPixelsRed[client] += npix;
- pmap->freeRed -= npix;
- }
- DEALLOCATE_LOCAL(ppixTemp);
- return (ok ? Success : BadAlloc);
-}
-
-/* Allocates count << planes pixels from colormap pmap for client. If
- * contig, then the plane mask is made of consecutive bits. Returns
- * all count << pixels in the array pixels. The first count of those
- * pixels are the unique pixels. *pMask has the mask to Or with the
- * unique pixels to get the rest of them.
- *
- * Returns True iff all pixels could be allocated
- * All cells allocated will have refcnt set to AllocPrivate and shared to FALSE
- * (see AllocShared for why we care)
- */
-static Bool
-AllocCP (pmap, pentFirst, count, planes, contig, pixels, pMask)
- ColormapPtr pmap;
- EntryPtr pentFirst;
- int count, planes;
- Bool contig;
- Pixel *pixels, *pMask;
-
-{
- EntryPtr ent;
- Pixel pixel, base, entries, maxp, save;
- int dplanes, found;
- Pixel *ppix;
- Pixel mask;
- Pixel finalmask;
-
- dplanes = pmap->pVisual->nplanes;
-
- /* Easy case. Allocate pixels only */
- if (planes == 0)
- {
- /* allocate writable entries */
- ppix = pixels;
- ent = pentFirst;
- pixel = 0;
- while (--count >= 0)
- {
- /* Just find count unallocated cells */
- while (ent->refcnt)
- {
- ent++;
- pixel++;
- }
- ent->refcnt = AllocPrivate;
- *ppix++ = pixel;
- ent->fShared = FALSE;
- }
- *pMask = 0;
- return (TRUE);
- }
- else if (planes > dplanes)
- {
- return (FALSE);
- }
-
- /* General case count pixels * 2 ^ planes cells to be allocated */
-
- /* make room for new pixels */
- ent = pentFirst;
-
- /* first try for contiguous planes, since it's fastest */
- for (mask = (((Pixel)1) << planes) - 1, base = 1, dplanes -= (planes - 1);
- --dplanes >= 0;
- mask += mask, base += base)
- {
- ppix = pixels;
- found = 0;
- pixel = 0;
- entries = pmap->pVisual->ColormapEntries - mask;
- while (pixel < entries)
- {
- save = pixel;
- maxp = pixel + mask + base;
- /* check if all are free */
- while (pixel != maxp && ent[pixel].refcnt == 0)
- pixel += base;
- if (pixel == maxp)
- {
- /* this one works */
- *ppix++ = save;
- found++;
- if (found == count)
- {
- /* found enough, allocate them all */
- while (--count >= 0)
- {
- pixel = pixels[count];
- maxp = pixel + mask;
- while (1)
- {
- ent[pixel].refcnt = AllocPrivate;
- ent[pixel].fShared = FALSE;
- if (pixel == maxp)
- break;
- pixel += base;
- *ppix++ = pixel;
- }
- }
- *pMask = mask;
- return (TRUE);
- }
- }
- pixel = save + 1;
- if (pixel & mask)
- pixel += mask;
- }
- }
-
- dplanes = pmap->pVisual->nplanes;
- if (contig || planes == 1 || dplanes < 3)
- return (FALSE);
-
- /* this will be very slow for large maps, need a better algorithm */
-
- /*
- we can generate the smallest and largest numbers that fits in dplanes
- bits and contain exactly planes bits set as follows. First, we need to
- check that it is possible to generate such a mask at all.
- (Non-contiguous masks need one more bit than contiguous masks). Then
- the smallest such mask consists of the rightmost planes-1 bits set, then
- a zero, then a one in position planes + 1. The formula is
- (3 << (planes-1)) -1
- The largest such masks consists of the leftmost planes-1 bits set, then
- a zero, then a one bit in position dplanes-planes-1. If dplanes is
- smaller than 32 (the number of bits in a word) then the formula is:
- (1<<dplanes) - (1<<(dplanes-planes+1) + (1<<dplanes-planes-1)
- If dplanes = 32, then we can't calculate (1<<dplanes) and we have
- to use:
- ( (1<<(planes-1)) - 1) << (dplanes-planes+1) + (1<<(dplanes-planes-1))
-
- << Thank you, Loretta>>>
-
- */
-
- finalmask =
- (((((Pixel)1)<<(planes-1)) - 1) << (dplanes-planes+1)) +
- (((Pixel)1)<<(dplanes-planes-1));
- for (mask = (((Pixel)3) << (planes -1)) - 1; mask <= finalmask; mask++)
- {
- /* next 3 magic statements count number of ones (HAKMEM #169) */
- pixel = (mask >> 1) & 033333333333;
- pixel = mask - pixel - ((pixel >> 1) & 033333333333);
- if ((((pixel + (pixel >> 3)) & 030707070707) % 077) != planes)
- continue;
- ppix = pixels;
- found = 0;
- entries = pmap->pVisual->ColormapEntries - mask;
- base = lowbit (mask);
- for (pixel = 0; pixel < entries; pixel++)
- {
- if (pixel & mask)
- continue;
- maxp = 0;
- /* check if all are free */
- while (ent[pixel + maxp].refcnt == 0)
- {
- GetNextBitsOrBreak(maxp, mask, base);
- }
- if ((maxp < mask) || (ent[pixel + mask].refcnt != 0))
- continue;
- /* this one works */
- *ppix++ = pixel;
- found++;
- if (found < count)
- continue;
- /* found enough, allocate them all */
- while (--count >= 0)
- {
- pixel = (pixels)[count];
- maxp = 0;
- while (1)
- {
- ent[pixel + maxp].refcnt = AllocPrivate;
- ent[pixel + maxp].fShared = FALSE;
- GetNextBitsOrBreak(maxp, mask, base);
- *ppix++ = pixel + maxp;
- }
- }
-
- *pMask = mask;
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-static Bool
-AllocShared (pmap, ppix, c, r, g, b, rmask, gmask, bmask, ppixFirst)
- ColormapPtr pmap;
- Pixel *ppix;
- int c, r, g, b;
- Pixel rmask, gmask, bmask;
- Pixel *ppixFirst; /* First of the client's new pixels */
-{
- Pixel *pptr, *cptr;
- int npix, z, npixClientNew, npixShared;
- Pixel basemask, base, bits, common;
- SHAREDCOLOR *pshared, **ppshared, **psharedList;
-
- npixClientNew = c << (r + g + b);
- npixShared = (c << r) + (c << g) + (c << b);
- psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared *
- sizeof(SHAREDCOLOR *));
- if (!psharedList)
- return FALSE;
- ppshared = psharedList;
- for (z = npixShared; --z >= 0; )
- {
- if (!(ppshared[z] = (SHAREDCOLOR *)xalloc(sizeof(SHAREDCOLOR))))
- {
- for (z++ ; z < npixShared; z++)
- xfree(ppshared[z]);
- return FALSE;
- }
- }
- for(pptr = ppix, npix = c; --npix >= 0; pptr++)
- {
- basemask = ~(gmask | bmask);
- common = *pptr & basemask;
- if (rmask)
- {
- bits = 0;
- base = lowbit (rmask);
- while(1)
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (g + b);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == (common | bits))
- {
- pmap->red[*cptr].fShared = TRUE;
- pmap->red[*cptr].co.shco.red = pshared;
- }
- }
- GetNextBitsOrBreak(bits, rmask, base);
- }
- }
- else
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (g + b);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == common)
- {
- pmap->red[*cptr].fShared = TRUE;
- pmap->red[*cptr].co.shco.red = pshared;
- }
- }
- }
- basemask = ~(rmask | bmask);
- common = *pptr & basemask;
- if (gmask)
- {
- bits = 0;
- base = lowbit (gmask);
- while(1)
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (r + b);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == (common | bits))
- {
- pmap->red[*cptr].co.shco.green = pshared;
- }
- }
- GetNextBitsOrBreak(bits, gmask, base);
- }
- }
- else
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (g + b);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == common)
- {
- pmap->red[*cptr].co.shco.green = pshared;
- }
- }
- }
- basemask = ~(rmask | gmask);
- common = *pptr & basemask;
- if (bmask)
- {
- bits = 0;
- base = lowbit (bmask);
- while(1)
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (r + g);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == (common | bits))
- {
- pmap->red[*cptr].co.shco.blue = pshared;
- }
- }
- GetNextBitsOrBreak(bits, bmask, base);
- }
- }
- else
- {
- pshared = *ppshared++;
- pshared->refcnt = 1 << (g + b);
- for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++)
- {
- if ((*cptr & basemask) == common)
- {
- pmap->red[*cptr].co.shco.blue = pshared;
- }
- }
- }
- }
- DEALLOCATE_LOCAL(psharedList);
- return TRUE;
-}
-
-
-/* Free colors and/or cells (probably slow for large numbers) */
-
-int
-FreeColors (pmap, client, count, pixels, mask)
- ColormapPtr pmap;
- int client, count;
- Pixel *pixels;
- Pixel mask;
-{
- int rval, result, class;
- Pixel rmask;
-
- class = pmap->class;
- if (pmap->flags & AllAllocated)
- return(BadAccess);
- if ((class | DynamicClass) == DirectColor)
- {
- rmask = mask & RGBMASK(pmap->pVisual);
- result = FreeCo(pmap, client, REDMAP, count, pixels,
- mask & pmap->pVisual->redMask);
- /* If any of the three calls fails, we must report that, if more
- * than one fails, it's ok that we report the last one */
- rval = FreeCo(pmap, client, GREENMAP, count, pixels,
- mask & pmap->pVisual->greenMask);
- if(rval != Success)
- result = rval;
- rval = FreeCo(pmap, client, BLUEMAP, count, pixels,
- mask & pmap->pVisual->blueMask);
- if(rval != Success)
- result = rval;
- }
- else
- {
- rmask = mask & ((((Pixel)1) << pmap->pVisual->nplanes) - 1);
- result = FreeCo(pmap, client, PSEUDOMAP, count, pixels, rmask);
- }
- if ((mask != rmask) && count)
- {
- clientErrorValue = *pixels | mask;
- result = BadValue;
- }
- /* XXX should worry about removing any RT_CMAPENTRY resource */
- return (result);
-}
-
-/* Helper for FreeColors -- frees all combinations of *newpixels and mask bits
- * which the client has allocated in channel colormap cells of pmap.
- * doesn't change newpixels if it doesn't need to */
-static int
-FreeCo (pmap, client, color, npixIn, ppixIn, mask)
- ColormapPtr pmap; /* which colormap head */
- int client;
- int color; /* which sub-map, eg RED, BLUE, PSEUDO */
- int npixIn; /* number of pixels passed in */
- Pixel *ppixIn; /* list of base pixels */
- Pixel mask; /* mask client gave us */
-{
-
- Pixel *ppixClient, pixTest;
- int npixClient, npixNew, npix;
- Pixel bits, base, cmask, rgbbad;
- Pixel *pptr, *cptr;
- int n, zapped;
- int errVal = Success;
- int offset, numents;
-#ifdef LBX
- Bool grabbed;
- Bool zeroRefCount;
- Bool anyRefCountReachedZero = 0;
-#endif
-
- if (npixIn == 0)
- return (errVal);
- bits = 0;
- zapped = 0;
- base = lowbit (mask);
-
- switch(color)
- {
- case REDMAP:
- cmask = pmap->pVisual->redMask;
- rgbbad = ~RGBMASK(pmap->pVisual);
- offset = pmap->pVisual->offsetRed;
- numents = (cmask >> offset) + 1;
- ppixClient = pmap->clientPixelsRed[client];
- npixClient = pmap->numPixelsRed[client];
- break;
- case GREENMAP:
- cmask = pmap->pVisual->greenMask;
- rgbbad = ~RGBMASK(pmap->pVisual);
- offset = pmap->pVisual->offsetGreen;
- numents = (cmask >> offset) + 1;
- ppixClient = pmap->clientPixelsGreen[client];
- npixClient = pmap->numPixelsGreen[client];
- break;
- case BLUEMAP:
- cmask = pmap->pVisual->blueMask;
- rgbbad = ~RGBMASK(pmap->pVisual);
- offset = pmap->pVisual->offsetBlue;
- numents = (cmask >> offset) + 1;
- ppixClient = pmap->clientPixelsBlue[client];
- npixClient = pmap->numPixelsBlue[client];
- break;
- default: /* so compiler can see that everything gets initialized */
- case PSEUDOMAP:
- cmask = ~((Pixel)0);
- rgbbad = 0;
- offset = 0;
- numents = pmap->pVisual->ColormapEntries;
- ppixClient = pmap->clientPixelsRed[client];
- npixClient = pmap->numPixelsRed[client];
- break;
- }
-
-#ifdef LBX
- grabbed = LbxCheckCmapGrabbed (pmap);
-
- if (grabbed)
- {
- /*
- * If the colormap is grabbed by a proxy, the server must
- * notify the proxy of all cells that are freed (the refcount
- * has reached zero on these cells).
- */
-
- LbxBeginFreeCellsEvent (pmap);
- LbxSortPixelList (ppixIn, npixIn);
- }
-#endif
-
- /* zap all pixels which match */
- while (1)
- {
- /* go through pixel list */
- for (pptr = ppixIn, n = npixIn; --n >= 0; pptr++)
- {
- pixTest = ((*pptr | bits) & cmask) >> offset;
- if ((pixTest >= numents) || (*pptr & rgbbad))
- {
- clientErrorValue = *pptr | bits;
- errVal = BadValue;
- continue;
- }
-
- /* find match in client list */
- for (cptr = ppixClient, npix = npixClient;
- --npix >= 0 && *cptr != pixTest;
- cptr++) ;
-
- if (npix >= 0)
- {
- if (pmap->class & DynamicClass)
- {
- FreeCell(pmap, pixTest, color);
-#ifdef LBX
- /*
- * Only PSEUDO colormaps are grabbed by LBX proxies.
- * Check if the ref count reached zero on this pixel.
- */
-
- zeroRefCount = pmap->red[pixTest].refcnt == 0;
- if (zeroRefCount)
- anyRefCountReachedZero = 1;
-
- if (grabbed && zeroRefCount)
- LbxAddFreeCellToEvent (pmap, pixTest);
-#endif
- }
- *cptr = ~((Pixel)0);
- zapped++;
- }
- else
- errVal = BadAccess;
- }
- /* generate next bits value */
- GetNextBitsOrBreak(bits, mask, base);
- }
-
-#ifdef LBX
- if (grabbed)
- LbxEndFreeCellsEvent (pmap);
- else if (anyRefCountReachedZero)
- {
- /*
- * We only send LbxFreeCell events to a proxy that has the colormap
- * grabbed. If the colormap is not grabbed, the proxy that last
- * had the colormap grabbed will not be able to do a smart grab
- * in the future. A smart grab can only occur if the proxy is kept
- * up to date on every alloc/free change in the colormap.
- */
-
- LbxDisableSmartGrab (pmap);
- }
-#endif
-
- /* delete freed pixels from client pixel list */
- if (zapped)
- {
- npixNew = npixClient - zapped;
- if (npixNew)
- {
- /* Since the list can only get smaller, we can do a copy in
- * place and then realloc to a smaller size */
- pptr = cptr = ppixClient;
-
- /* If we have all the new pixels, we don't have to examine the
- * rest of the old ones */
- for(npix = 0; npix < npixNew; cptr++)
- {
- if (*cptr != ~((Pixel)0))
- {
- *pptr++ = *cptr;
- npix++;
- }
- }
- pptr = (Pixel *)xrealloc(ppixClient, npixNew * sizeof(Pixel));
- if (pptr)
- ppixClient = pptr;
- npixClient = npixNew;
- }
- else
- {
- npixClient = 0;
- xfree(ppixClient);
- ppixClient = (Pixel *)NULL;
- }
- switch(color)
- {
- case PSEUDOMAP:
- case REDMAP:
- pmap->clientPixelsRed[client] = ppixClient;
- pmap->numPixelsRed[client] = npixClient;
- break;
- case GREENMAP:
- pmap->clientPixelsGreen[client] = ppixClient;
- pmap->numPixelsGreen[client] = npixClient;
- break;
- case BLUEMAP:
- pmap->clientPixelsBlue[client] = ppixClient;
- pmap->numPixelsBlue[client] = npixClient;
- break;
- }
- }
- return (errVal);
-}
-
-
-
-/* Redefine color values */
-int
-StoreColors (pmap, count, defs)
- ColormapPtr pmap;
- int count;
- xColorItem *defs;
-{
- register Pixel pix;
- register xColorItem *pdef;
- register EntryPtr pent, pentT, pentLast;
- register VisualPtr pVisual;
- SHAREDCOLOR *pred, *pgreen, *pblue;
- int n, ChgRed, ChgGreen, ChgBlue, idef;
- int class, errVal = Success;
- int ok;
-
-
- class = pmap->class;
- if(!(class & DynamicClass) && !(pmap->flags & BeingCreated))
- {
- return(BadAccess);
- }
- pVisual = pmap->pVisual;
-
- idef = 0;
- if((class | DynamicClass) == DirectColor)
- {
- int numred, numgreen, numblue;
- Pixel rgbbad;
-
- numred = NUMRED(pVisual);
- numgreen = NUMGREEN(pVisual);
- numblue = NUMBLUE(pVisual);
- rgbbad = ~RGBMASK(pVisual);
- for (pdef = defs, n = 0; n < count; pdef++, n++)
- {
- ok = TRUE;
- (*pmap->pScreen->ResolveColor)
- (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual);
-
- if (pdef->pixel & rgbbad)
- {
- errVal = BadValue;
- clientErrorValue = pdef->pixel;
- continue;
- }
- pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed;
- if (pix >= numred)
- {
- errVal = BadValue;
- ok = FALSE;
- }
- else if (pmap->red[pix].refcnt != AllocPrivate)
- {
- errVal = BadAccess;
- ok = FALSE;
- }
- else if (pdef->flags & DoRed)
- {
- pmap->red[pix].co.local.red = pdef->red;
- }
- else
- {
- pdef->red = pmap->red[pix].co.local.red;
- }
-
- pix = (pdef->pixel & pVisual->greenMask) >> pVisual->offsetGreen;
- if (pix >= numgreen)
- {
- errVal = BadValue;
- ok = FALSE;
- }
- else if (pmap->green[pix].refcnt != AllocPrivate)
- {
- errVal = BadAccess;
- ok = FALSE;
- }
- else if (pdef->flags & DoGreen)
- {
- pmap->green[pix].co.local.green = pdef->green;
- }
- else
- {
- pdef->green = pmap->green[pix].co.local.green;
- }
-
- pix = (pdef->pixel & pVisual->blueMask) >> pVisual->offsetBlue;
- if (pix >= numblue)
- {
- errVal = BadValue;
- ok = FALSE;
- }
- else if (pmap->blue[pix].refcnt != AllocPrivate)
- {
- errVal = BadAccess;
- ok = FALSE;
- }
- else if (pdef->flags & DoBlue)
- {
- pmap->blue[pix].co.local.blue = pdef->blue;
- }
- else
- {
- pdef->blue = pmap->blue[pix].co.local.blue;
- }
- /* If this is an o.k. entry, then it gets added to the list
- * to be sent to the hardware. If not, skip it. Once we've
- * skipped one, we have to copy all the others.
- */
- if(ok)
- {
- if(idef != n)
- defs[idef] = defs[n];
- idef++;
- } else
- clientErrorValue = pdef->pixel;
- }
- }
- else
- {
- for (pdef = defs, n = 0; n < count; pdef++, n++)
- {
-
- ok = TRUE;
- if (pdef->pixel >= pVisual->ColormapEntries)
- {
- clientErrorValue = pdef->pixel;
- errVal = BadValue;
- ok = FALSE;
- }
- else if (pmap->red[pdef->pixel].refcnt != AllocPrivate)
- {
- errVal = BadAccess;
- ok = FALSE;
- }
-
- /* If this is an o.k. entry, then it gets added to the list
- * to be sent to the hardware. If not, skip it. Once we've
- * skipped one, we have to copy all the others.
- */
- if(ok)
- {
- if(idef != n)
- defs[idef] = defs[n];
- idef++;
- }
- else
- continue;
-
- (*pmap->pScreen->ResolveColor)
- (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual);
-
- pent = &pmap->red[pdef->pixel];
-
- if(pdef->flags & DoRed)
- {
- if(pent->fShared)
- {
- pent->co.shco.red->color = pdef->red;
- if (pent->co.shco.red->refcnt > 1)
- ok = FALSE;
- }
- else
- pent->co.local.red = pdef->red;
- }
- else
- {
- if(pent->fShared)
- pdef->red = pent->co.shco.red->color;
- else
- pdef->red = pent->co.local.red;
- }
- if(pdef->flags & DoGreen)
- {
- if(pent->fShared)
- {
- pent->co.shco.green->color = pdef->green;
- if (pent->co.shco.green->refcnt > 1)
- ok = FALSE;
- }
- else
- pent->co.local.green = pdef->green;
- }
- else
- {
- if(pent->fShared)
- pdef->green = pent->co.shco.green->color;
- else
- pdef->green = pent->co.local.green;
- }
- if(pdef->flags & DoBlue)
- {
- if(pent->fShared)
- {
- pent->co.shco.blue->color = pdef->blue;
- if (pent->co.shco.blue->refcnt > 1)
- ok = FALSE;
- }
- else
- pent->co.local.blue = pdef->blue;
- }
- else
- {
- if(pent->fShared)
- pdef->blue = pent->co.shco.blue->color;
- else
- pdef->blue = pent->co.local.blue;
- }
-
- if(!ok)
- {
- /* have to run through the colormap and change anybody who
- * shares this value */
- pred = pent->co.shco.red;
- pgreen = pent->co.shco.green;
- pblue = pent->co.shco.blue;
- ChgRed = pdef->flags & DoRed;
- ChgGreen = pdef->flags & DoGreen;
- ChgBlue = pdef->flags & DoBlue;
- pentLast = pmap->red + pVisual->ColormapEntries;
-
- for(pentT = pmap->red; pentT < pentLast; pentT++)
- {
- if(pentT->fShared && (pentT != pent))
- {
- xColorItem defChg;
-
- /* There are, alas, devices in this world too dumb
- * to read their own hardware colormaps. Sick, but
- * true. So we're going to be really nice and load
- * the xColorItem with the proper value for all the
- * fields. We will only set the flags for those
- * fields that actually change. Smart devices can
- * arrange to change only those fields. Dumb devices
- * can rest assured that we have provided for them,
- * and can change all three fields */
-
- defChg.flags = 0;
- if(ChgRed && pentT->co.shco.red == pred)
- {
- defChg.flags |= DoRed;
- }
- if(ChgGreen && pentT->co.shco.green == pgreen)
- {
- defChg.flags |= DoGreen;
- }
- if(ChgBlue && pentT->co.shco.blue == pblue)
- {
- defChg.flags |= DoBlue;
- }
- if(defChg.flags != 0)
- {
- defChg.pixel = pentT - pmap->red;
- defChg.red = pentT->co.shco.red->color;
- defChg.green = pentT->co.shco.green->color;
- defChg.blue = pentT->co.shco.blue->color;
- (*pmap->pScreen->StoreColors) (pmap, 1, &defChg);
- }
- }
- }
-
- }
- }
- }
- /* Note that we use idef, the count of acceptable entries, and not
- * count, the count of proposed entries */
- if (idef != 0)
- ( *pmap->pScreen->StoreColors) (pmap, idef, defs);
- return (errVal);
-}
-
-int
-IsMapInstalled(map, pWin)
- Colormap map;
- WindowPtr pWin;
-{
- Colormap *pmaps;
- int imap, nummaps, found;
-
- pmaps = (Colormap *) ALLOCATE_LOCAL(
- pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap));
- if(!pmaps)
- return(FALSE);
- nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
- (pWin->drawable.pScreen, pmaps);
- found = FALSE;
- for(imap = 0; imap < nummaps; imap++)
- {
- if(pmaps[imap] == map)
- {
- found = TRUE;
- break;
- }
- }
- DEALLOCATE_LOCAL(pmaps);
- return (found);
-}
diff --git a/dix/cursor.c b/dix/cursor.c
deleted file mode 100644
index 2ef9e5e24..000000000
--- a/dix/cursor.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.9 2003/11/17 22:20:33 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-
-/* $Xorg: cursor.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "dixstruct.h"
-#include "cursorstr.h"
-#include "dixfontstr.h"
-#include "opaque.h"
-
-typedef struct _GlyphShare {
- FontPtr font;
- unsigned short sourceChar;
- unsigned short maskChar;
- CursorBitsPtr bits;
- struct _GlyphShare *next;
-} GlyphShare, *GlyphSharePtr;
-
-static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL;
-
-static void
-FreeCursorBits(CursorBitsPtr bits)
-{
- if (--bits->refcnt > 0)
- return;
- xfree(bits->source);
- xfree(bits->mask);
-#ifdef ARGB_CURSOR
- xfree(bits->argb);
-#endif
- if (bits->refcnt == 0)
- {
- register GlyphSharePtr *prev, this;
-
- for (prev = &sharedGlyphs;
- (this = *prev) && (this->bits != bits);
- prev = &this->next)
- ;
- if (this)
- {
- *prev = this->next;
- CloseFont(this->font, (Font)0);
- xfree(this);
- }
- xfree(bits);
- }
-}
-
-/*
- * To be called indirectly by DeleteResource; must use exactly two args
- */
-/*ARGSUSED*/
-int
-FreeCursor(value, cid)
- pointer value; /* must conform to DeleteType */
- XID cid;
-{
- int nscr;
- CursorPtr pCurs = (CursorPtr)value;
-
- ScreenPtr pscr;
-
- if ( --pCurs->refcnt > 0)
- return(Success);
-
- for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
- {
- pscr = screenInfo.screens[nscr];
- (void)( *pscr->UnrealizeCursor)( pscr, pCurs);
- }
- FreeCursorBits(pCurs->bits);
- xfree( pCurs);
- return(Success);
-}
-
-
-/*
- * We check for empty cursors so that we won't have to display them
- */
-static void
-CheckForEmptyMask(CursorBitsPtr bits)
-{
- register unsigned char *msk = bits->mask;
- int n = BitmapBytePad(bits->width) * bits->height;
-
- bits->emptyMask = FALSE;
- while(n--)
- if(*(msk++) != 0) return;
-#ifdef ARGB_CURSOR
- if (bits->argb)
- {
- CARD32 *argb = bits->argb;
- int n = bits->width * bits->height;
- while (n--)
- if (*argb++ & 0xff000000) return;
- }
-#endif
- bits->emptyMask = TRUE;
-}
-
-/*
- * does nothing about the resource table, just creates the data structure.
- * does not copy the src and mask bits
- */
-CursorPtr
-AllocCursorARGB(psrcbits, pmaskbits, argb, cm,
- foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue)
- unsigned char * psrcbits; /* server-defined padding */
- unsigned char * pmaskbits; /* server-defined padding */
- CARD32 * argb; /* no padding */
- CursorMetricPtr cm;
- unsigned foreRed, foreGreen, foreBlue;
- unsigned backRed, backGreen, backBlue;
-{
- CursorBitsPtr bits;
- CursorPtr pCurs;
- int nscr;
- ScreenPtr pscr;
-
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
- if (!pCurs)
- {
- xfree(psrcbits);
- xfree(pmaskbits);
- return (CursorPtr)NULL;
- }
- bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec));
- bits->source = psrcbits;
- bits->mask = pmaskbits;
-#ifdef ARGB_CURSOR
- bits->argb = argb;
-#endif
- bits->width = cm->width;
- bits->height = cm->height;
- bits->xhot = cm->xhot;
- bits->yhot = cm->yhot;
- bits->refcnt = -1;
- CheckForEmptyMask(bits);
-
- pCurs->bits = bits;
- pCurs->refcnt = 1;
-
- pCurs->foreRed = foreRed;
- pCurs->foreGreen = foreGreen;
- pCurs->foreBlue = foreBlue;
-
- pCurs->backRed = backRed;
- pCurs->backGreen = backGreen;
- pCurs->backBlue = backBlue;
-
- /*
- * realize the cursor for every screen
- */
- for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
- {
- pscr = screenInfo.screens[nscr];
- if (!( *pscr->RealizeCursor)( pscr, pCurs))
- {
- while (--nscr >= 0)
- {
- pscr = screenInfo.screens[nscr];
- ( *pscr->UnrealizeCursor)( pscr, pCurs);
- }
- FreeCursorBits(bits);
- xfree(pCurs);
- return (CursorPtr)NULL;
- }
- }
- return pCurs;
-}
-
-CursorPtr
-AllocCursor(psrcbits, pmaskbits, cm,
- foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue)
- unsigned char * psrcbits; /* server-defined padding */
- unsigned char * pmaskbits; /* server-defined padding */
- CursorMetricPtr cm;
- unsigned foreRed, foreGreen, foreBlue;
- unsigned backRed, backGreen, backBlue;
-{
- return AllocCursorARGB (psrcbits, pmaskbits, (CARD32 *) 0, cm,
- foreRed, foreGreen, foreBlue,
- backRed, backGreen, backBlue);
-}
-
-int
-AllocGlyphCursor(source, sourceChar, mask, maskChar,
- foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue,
- ppCurs, client)
- Font source, mask;
- unsigned int sourceChar, maskChar;
- unsigned foreRed, foreGreen, foreBlue;
- unsigned backRed, backGreen, backBlue;
- CursorPtr *ppCurs;
- ClientPtr client;
-{
- FontPtr sourcefont, maskfont;
- unsigned char *srcbits;
- unsigned char *mskbits;
- CursorMetricRec cm;
- int res;
- CursorBitsPtr bits;
- CursorPtr pCurs;
- int nscr;
- ScreenPtr pscr;
- GlyphSharePtr pShare;
-
- sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT,
- SecurityReadAccess);
- maskfont = (FontPtr) SecurityLookupIDByType(client, mask, RT_FONT,
- SecurityReadAccess);
-
- if (!sourcefont)
- {
- client->errorValue = source;
- return(BadFont);
- }
- if (!maskfont && (mask != None))
- {
- client->errorValue = mask;
- return(BadFont);
- }
- if (sourcefont != maskfont)
- pShare = (GlyphSharePtr)NULL;
- else
- {
- for (pShare = sharedGlyphs;
- pShare &&
- ((pShare->font != sourcefont) ||
- (pShare->sourceChar != sourceChar) ||
- (pShare->maskChar != maskChar));
- pShare = pShare->next)
- ;
- }
- if (pShare)
- {
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec));
- if (!pCurs)
- return BadAlloc;
- bits = pShare->bits;
- bits->refcnt++;
- }
- else
- {
- if (!CursorMetricsFromGlyph(sourcefont, sourceChar, &cm))
- {
- client->errorValue = sourceChar;
- return BadValue;
- }
- if (!maskfont)
- {
- register long n;
- register unsigned char *mskptr;
-
- n = BitmapBytePad(cm.width)*(long)cm.height;
- mskptr = mskbits = (unsigned char *)xalloc(n);
- if (!mskptr)
- return BadAlloc;
- while (--n >= 0)
- *mskptr++ = ~0;
- }
- else
- {
- if (!CursorMetricsFromGlyph(maskfont, maskChar, &cm))
- {
- client->errorValue = maskChar;
- return BadValue;
- }
- if ((res = ServerBitsFromGlyph(maskfont, maskChar, &cm, &mskbits)) != 0)
- return res;
- }
- if ((res = ServerBitsFromGlyph(sourcefont, sourceChar, &cm, &srcbits)) != 0)
- {
- xfree(mskbits);
- return res;
- }
- if (sourcefont != maskfont)
- {
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
- if (pCurs)
- bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec));
- else
- bits = (CursorBitsPtr)NULL;
- }
- else
- {
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec));
- if (pCurs)
- bits = (CursorBitsPtr)xalloc(sizeof(CursorBits));
- else
- bits = (CursorBitsPtr)NULL;
- }
- if (!bits)
- {
- xfree(pCurs);
- xfree(mskbits);
- xfree(srcbits);
- return BadAlloc;
- }
- bits->source = srcbits;
- bits->mask = mskbits;
-#ifdef ARGB_CURSOR
- bits->argb = 0;
-#endif
- bits->width = cm.width;
- bits->height = cm.height;
- bits->xhot = cm.xhot;
- bits->yhot = cm.yhot;
- if (sourcefont != maskfont)
- bits->refcnt = -1;
- else
- {
- bits->refcnt = 1;
- pShare = (GlyphSharePtr)xalloc(sizeof(GlyphShare));
- if (!pShare)
- {
- FreeCursorBits(bits);
- return BadAlloc;
- }
- pShare->font = sourcefont;
- sourcefont->refcnt++;
- pShare->sourceChar = sourceChar;
- pShare->maskChar = maskChar;
- pShare->bits = bits;
- pShare->next = sharedGlyphs;
- sharedGlyphs = pShare;
- }
- }
- CheckForEmptyMask(bits);
- pCurs->bits = bits;
- pCurs->refcnt = 1;
-
- pCurs->foreRed = foreRed;
- pCurs->foreGreen = foreGreen;
- pCurs->foreBlue = foreBlue;
-
- pCurs->backRed = backRed;
- pCurs->backGreen = backGreen;
- pCurs->backBlue = backBlue;
-
- /*
- * realize the cursor for every screen
- */
- for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
- {
- pscr = screenInfo.screens[nscr];
- if (!( *pscr->RealizeCursor)( pscr, pCurs))
- {
- while (--nscr >= 0)
- {
- pscr = screenInfo.screens[nscr];
- ( *pscr->UnrealizeCursor)( pscr, pCurs);
- }
- FreeCursorBits(pCurs->bits);
- xfree(pCurs);
- return BadAlloc;
- }
- }
- *ppCurs = pCurs;
- return Success;
-}
-
-/***********************************************************
- * CreateRootCursor
- *
- * look up the name of a font
- * open the font
- * add the font to the resource table
- * make a cursor from the glyphs
- * add the cursor to the resource table
- *************************************************************/
-
-CursorPtr
-CreateRootCursor(pfilename, glyph)
- char * pfilename;
- unsigned int glyph;
-{
- CursorPtr curs;
- FontPtr cursorfont;
- int err;
- XID fontID;
-
- fontID = FakeClientID(0);
- err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync,
- (unsigned)strlen( pfilename), pfilename);
- if (err != Success)
- return NullCursor;
-
- cursorfont = (FontPtr)LookupIDByType(fontID, RT_FONT);
- if (!cursorfont)
- return NullCursor;
- if (AllocGlyphCursor(fontID, glyph, fontID, glyph + 1,
- 0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success)
- return NullCursor;
-
- if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs))
- return NullCursor;
-
- return curs;
-}
diff --git a/dix/devices.c b/dix/devices.c
deleted file mode 100644
index 46af5eabc..000000000
--- a/dix/devices.c
+++ /dev/null
@@ -1,1732 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.21 2003/11/17 22:20:33 dawes Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-
-/* $Xorg: devices.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "resource.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "windowstr.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "dixstruct.h"
-#include "site.h"
-#define XKB_IN_SERVER
-#ifdef XKB
-#include "XKBsrv.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-#ifdef LBX
-#include "lbxserve.h"
-#endif
-
-#include "dispatch.h"
-#include "swaprep.h"
-#include "dixevents.h"
-
-DeviceIntPtr
-_AddInputDevice(deviceProc, autoStart)
- DeviceProc deviceProc;
- Bool autoStart;
-{
- register DeviceIntPtr dev;
-
- if (inputInfo.numDevices >= MAX_DEVICES)
- return (DeviceIntPtr)NULL;
- dev = (DeviceIntPtr) xalloc(sizeof(DeviceIntRec));
- if (!dev)
- return (DeviceIntPtr)NULL;
- dev->name = (char *)NULL;
- dev->type = 0;
- dev->id = inputInfo.numDevices;
- inputInfo.numDevices++;
- dev->public.on = FALSE;
- dev->public.processInputProc = (ProcessInputProc)NoopDDA;
- dev->public.realInputProc = (ProcessInputProc)NoopDDA;
- dev->public.enqueueInputProc = EnqueueEvent;
- dev->deviceProc = deviceProc;
- dev->startup = autoStart;
- dev->sync.frozen = FALSE;
- dev->sync.other = NullGrab;
- dev->sync.state = NOT_GRABBED;
- dev->sync.event = (xEvent *) NULL;
- dev->sync.evcount = 0;
- dev->grab = NullGrab;
- dev->grabTime = currentTime;
- dev->fromPassiveGrab = FALSE;
- dev->key = (KeyClassPtr)NULL;
- dev->valuator = (ValuatorClassPtr)NULL;
- dev->button = (ButtonClassPtr)NULL;
- dev->focus = (FocusClassPtr)NULL;
- dev->proximity = (ProximityClassPtr)NULL;
- dev->kbdfeed = (KbdFeedbackPtr)NULL;
- dev->ptrfeed = (PtrFeedbackPtr)NULL;
- dev->intfeed = (IntegerFeedbackPtr)NULL;
- dev->stringfeed = (StringFeedbackPtr)NULL;
- dev->bell = (BellFeedbackPtr)NULL;
- dev->leds = (LedFeedbackPtr)NULL;
- dev->next = inputInfo.off_devices;
-#ifdef XKB
- dev->xkb_interest= NULL;
-#endif
- inputInfo.off_devices = dev;
- return dev;
-}
-
-Bool
-EnableDevice(dev)
- register DeviceIntPtr dev;
-{
- register DeviceIntPtr *prev;
-
- for (prev = &inputInfo.off_devices;
- *prev && (*prev != dev);
- prev = &(*prev)->next)
- ;
- if ((*prev != dev) || !dev->inited ||
- ((*dev->deviceProc)(dev, DEVICE_ON) != Success))
- return FALSE;
- *prev = dev->next;
- dev->next = inputInfo.devices;
- inputInfo.devices = dev;
- return TRUE;
-}
-
-Bool
-DisableDevice(dev)
- register DeviceIntPtr dev;
-{
- register DeviceIntPtr *prev;
-
- for (prev = &inputInfo.devices;
- *prev && (*prev != dev);
- prev = &(*prev)->next)
- ;
- if (*prev != dev)
- return FALSE;
- (void)(*dev->deviceProc)(dev, DEVICE_OFF);
- *prev = dev->next;
- dev->next = inputInfo.off_devices;
- inputInfo.off_devices = dev;
- return TRUE;
-}
-
-int
-InitAndStartDevices()
-{
- register DeviceIntPtr dev, next;
-
- for (dev = inputInfo.off_devices; dev; dev = dev->next)
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- for (dev = inputInfo.off_devices; dev; dev = next)
- {
- next = dev->next;
- if (dev->inited && dev->startup)
- (void)EnableDevice(dev);
- }
- for (dev = inputInfo.devices;
- dev && (dev != inputInfo.keyboard);
- dev = dev->next)
- ;
- if (!dev || (dev != inputInfo.keyboard)) {
- ErrorF("No core keyboard\n");
- return BadImplementation;
- }
- for (dev = inputInfo.devices;
- dev && (dev != inputInfo.pointer);
- dev = dev->next)
- ;
- if (!dev || (dev != inputInfo.pointer)) {
- ErrorF("No core pointer\n");
- return BadImplementation;
- }
- return Success;
-}
-
-static void
-CloseDevice(register DeviceIntPtr dev)
-{
- KbdFeedbackPtr k, knext;
- PtrFeedbackPtr p, pnext;
- IntegerFeedbackPtr i, inext;
- StringFeedbackPtr s, snext;
- BellFeedbackPtr b, bnext;
- LedFeedbackPtr l, lnext;
-
- if (dev->inited)
- (void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
- xfree(dev->name);
- if (dev->key)
- {
-#ifdef XKB
- if (dev->key->xkbInfo)
- XkbFreeInfo(dev->key->xkbInfo);
-#endif
- xfree(dev->key->curKeySyms.map);
- xfree(dev->key->modifierKeyMap);
- xfree(dev->key);
- }
- xfree(dev->valuator);
-#ifdef XKB
- if ((dev->button)&&(dev->button->xkb_acts))
- xfree(dev->button->xkb_acts);
-#endif
- xfree(dev->button);
- if (dev->focus)
- {
- xfree(dev->focus->trace);
- xfree(dev->focus);
- }
- xfree(dev->proximity);
- for (k=dev->kbdfeed; k; k=knext)
- {
- knext = k->next;
-#ifdef XKB
- if (k->xkb_sli)
- XkbFreeSrvLedInfo(k->xkb_sli);
-#endif
- xfree(k);
- }
- for (p=dev->ptrfeed; p; p=pnext)
- {
- pnext = p->next;
- xfree(p);
- }
- for (i=dev->intfeed; i; i=inext)
- {
- inext = i->next;
- xfree(i);
- }
- for (s=dev->stringfeed; s; s=snext)
- {
- snext = s->next;
- xfree(s->ctrl.symbols_supported);
- xfree(s->ctrl.symbols_displayed);
- xfree(s);
- }
- for (b=dev->bell; b; b=bnext)
- {
- bnext = b->next;
- xfree(b);
- }
- for (l=dev->leds; l; l=lnext)
- {
- lnext = l->next;
-#ifdef XKB
- if (l->xkb_sli)
- XkbFreeSrvLedInfo(l->xkb_sli);
-#endif
- xfree(l);
- }
-#ifdef XKB
- while (dev->xkb_interest) {
- XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
- }
-#endif
- xfree(dev->sync.event);
- xfree(dev);
-}
-
-void
-CloseDownDevices()
-{
- register DeviceIntPtr dev, next;
-
- for (dev = inputInfo.devices; dev; dev = next)
- {
- next = dev->next;
- CloseDevice(dev);
- }
- for (dev = inputInfo.off_devices; dev; dev = next)
- {
- next = dev->next;
- CloseDevice(dev);
- }
- inputInfo.devices = NULL;
- inputInfo.off_devices = NULL;
- inputInfo.keyboard = NULL;
- inputInfo.pointer = NULL;
-}
-
-void
-RemoveDevice(dev)
- register DeviceIntPtr dev;
-{
- register DeviceIntPtr prev,tmp,next;
-
- prev= NULL;
- for (tmp= inputInfo.devices; tmp; (prev = tmp), (tmp = next)) {
- next = tmp->next;
- if (tmp==dev) {
- CloseDevice(tmp);
- if (prev==NULL)
- inputInfo.devices = next;
- else
- prev->next = next;
- inputInfo.numDevices--;
- if (inputInfo.keyboard == tmp)
- inputInfo.keyboard = NULL;
- else if (inputInfo.pointer == tmp)
- inputInfo.pointer = NULL;
- return;
- }
- }
-
- prev= NULL;
- for (tmp= inputInfo.off_devices; tmp; (prev = tmp), (tmp = next)) {
- next = tmp->next;
- if (tmp==dev) {
- CloseDevice(tmp);
- if (prev==NULL)
- inputInfo.off_devices = next;
- else
- prev->next = next;
- inputInfo.numDevices--;
- if (inputInfo.keyboard == tmp)
- inputInfo.keyboard = NULL;
- else if (inputInfo.pointer == tmp)
- inputInfo.pointer = NULL;
- return;
- }
- }
- ErrorF("Internal Error! Attempt to remove a non-existent device\n");
- return;
-}
-
-int
-NumMotionEvents()
-{
- return inputInfo.pointer->valuator->numMotionEvents;
-}
-
-void
-_RegisterPointerDevice(device)
- DeviceIntPtr device;
-{
- inputInfo.pointer = device;
-#ifdef XKB
- if (noXkbExtension) {
- device->public.processInputProc = CoreProcessPointerEvent;
- device->public.realInputProc = CoreProcessPointerEvent;
- } else {
- device->public.processInputProc = ProcessPointerEvent;
- device->public.realInputProc = ProcessPointerEvent;
- }
-#else
- device->public.processInputProc = ProcessPointerEvent;
- device->public.realInputProc = ProcessPointerEvent;
-#endif
- device->ActivateGrab = ActivatePointerGrab;
- device->DeactivateGrab = DeactivatePointerGrab;
- if (!device->name)
- {
- char *p = "pointer";
- device->name = (char *)xalloc(strlen(p) + 1);
- strcpy(device->name, p);
- }
-}
-
-void
-_RegisterKeyboardDevice(device)
- DeviceIntPtr device;
-{
- inputInfo.keyboard = device;
-#ifdef XKB
- if (noXkbExtension) {
- device->public.processInputProc = CoreProcessKeyboardEvent;
- device->public.realInputProc = CoreProcessKeyboardEvent;
- } else {
- device->public.processInputProc = ProcessKeyboardEvent;
- device->public.realInputProc = ProcessKeyboardEvent;
- }
-#else
- device->public.processInputProc = ProcessKeyboardEvent;
- device->public.realInputProc = ProcessKeyboardEvent;
-#endif
- device->ActivateGrab = ActivateKeyboardGrab;
- device->DeactivateGrab = DeactivateKeyboardGrab;
- if (!device->name)
- {
- char *k = "keyboard";
- device->name = (char *)xalloc(strlen(k) + 1);
- strcpy(device->name, k);
- }
-}
-
-DevicePtr
-LookupKeyboardDevice()
-{
- return inputInfo.keyboard ? &inputInfo.keyboard->public : NULL;
-}
-
-DevicePtr
-LookupPointerDevice()
-{
- return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
-}
-
-DevicePtr
-LookupDevice(id)
- int id;
-{
- DeviceIntPtr dev;
-
- for (dev=inputInfo.devices; dev; dev=dev->next) {
- if (dev->id == (CARD8)id)
- return (DevicePtr)dev;
- }
- for (dev=inputInfo.off_devices; dev; dev=dev->next) {
- if (dev->id == (CARD8)id)
- return (DevicePtr)dev;
- }
- return NULL;
-}
-
-void
-QueryMinMaxKeyCodes(minCode, maxCode)
- KeyCode *minCode, *maxCode;
-{
- if (inputInfo.keyboard) {
- *minCode = inputInfo.keyboard->key->curKeySyms.minKeyCode;
- *maxCode = inputInfo.keyboard->key->curKeySyms.maxKeyCode;
- }
-}
-
-Bool
-SetKeySymsMap(dst, src)
- register KeySymsPtr dst, src;
-{
- int i, j;
- int rowDif = src->minKeyCode - dst->minKeyCode;
- /* if keysym map size changes, grow map first */
-
- if (src->mapWidth < dst->mapWidth)
- {
- for (i = src->minKeyCode; i <= src->maxKeyCode; i++)
- {
-#define SI(r, c) (((r-src->minKeyCode)*src->mapWidth) + (c))
-#define DI(r, c) (((r - dst->minKeyCode)*dst->mapWidth) + (c))
- for (j = 0; j < src->mapWidth; j++)
- dst->map[DI(i, j)] = src->map[SI(i, j)];
- for (j = src->mapWidth; j < dst->mapWidth; j++)
- dst->map[DI(i, j)] = NoSymbol;
-#undef SI
-#undef DI
- }
- return TRUE;
- }
- else if (src->mapWidth > dst->mapWidth)
- {
- KeySym *map;
- int bytes = sizeof(KeySym) * src->mapWidth *
- (dst->maxKeyCode - dst->minKeyCode + 1);
- map = (KeySym *)xalloc(bytes);
- if (!map)
- return FALSE;
- bzero((char *)map, bytes);
- if (dst->map)
- {
- for (i = 0; i <= dst->maxKeyCode-dst->minKeyCode; i++)
- memmove((char *)&map[i*src->mapWidth],
- (char *)&dst->map[i*dst->mapWidth],
- dst->mapWidth * sizeof(KeySym));
- xfree(dst->map);
- }
- dst->mapWidth = src->mapWidth;
- dst->map = map;
- }
- memmove((char *)&dst->map[rowDif * dst->mapWidth],
- (char *)src->map,
- (int)(src->maxKeyCode - src->minKeyCode + 1) *
- dst->mapWidth * sizeof(KeySym));
- return TRUE;
-}
-
-static Bool
-InitModMap(register KeyClassPtr keyc)
-{
- int i, j;
- CARD8 keysPerModifier[8];
- CARD8 mask;
-
- keyc->maxKeysPerModifier = 0;
- for (i = 0; i < 8; i++)
- keysPerModifier[i] = 0;
- for (i = 8; i < MAP_LENGTH; i++)
- {
- for (j = 0, mask = 1; j < 8; j++, mask <<= 1)
- {
- if (mask & keyc->modifierMap[i])
- {
- if (++keysPerModifier[j] > keyc->maxKeysPerModifier)
- keyc->maxKeysPerModifier = keysPerModifier[j];
- }
- }
- }
- keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier);
- if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier)
- return (FALSE);
- bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier);
- for (i = 0; i < 8; i++)
- keysPerModifier[i] = 0;
- for (i = 8; i < MAP_LENGTH; i++)
- {
- for (j = 0, mask = 1; j < 8; j++, mask <<= 1)
- {
- if (mask & keyc->modifierMap[i])
- {
- keyc->modifierKeyMap[(j*keyc->maxKeysPerModifier) +
- keysPerModifier[j]] = i;
- keysPerModifier[j]++;
- }
- }
- }
- return TRUE;
-}
-
-Bool
-InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers)
- DeviceIntPtr dev;
- KeySymsPtr pKeySyms;
- CARD8 pModifiers[];
-{
- int i;
- register KeyClassPtr keyc;
-
- keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec));
- if (!keyc)
- return FALSE;
- keyc->curKeySyms.map = (KeySym *)NULL;
- keyc->curKeySyms.mapWidth = 0;
- keyc->curKeySyms.minKeyCode = pKeySyms->minKeyCode;
- keyc->curKeySyms.maxKeyCode = pKeySyms->maxKeyCode;
- keyc->modifierKeyMap = (KeyCode *)NULL;
- keyc->state = 0;
- keyc->prev_state = 0;
- if (pModifiers)
- memmove((char *)keyc->modifierMap, (char *)pModifiers, MAP_LENGTH);
- else
- bzero((char *)keyc->modifierMap, MAP_LENGTH);
- bzero((char *)keyc->down, DOWN_LENGTH);
- for (i = 0; i < 8; i++)
- keyc->modifierKeyCount[i] = 0;
- if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc))
- {
- xfree(keyc->curKeySyms.map);
- xfree(keyc->modifierKeyMap);
- xfree(keyc);
- return FALSE;
- }
- dev->key = keyc;
-#ifdef XKB
- dev->key->xkbInfo= NULL;
- if (!noXkbExtension) XkbInitDevice(dev);
-#endif
- return TRUE;
-}
-
-Bool
-InitButtonClassDeviceStruct(dev, numButtons, map)
- register DeviceIntPtr dev;
- int numButtons;
- CARD8 *map;
-{
- register ButtonClassPtr butc;
- int i;
-
- butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec));
- if (!butc)
- return FALSE;
- butc->numButtons = numButtons;
- for (i = 1; i <= numButtons; i++)
- butc->map[i] = map[i];
- butc->buttonsDown = 0;
- butc->state = 0;
- butc->motionMask = 0;
- bzero((char *)butc->down, DOWN_LENGTH);
-#ifdef XKB
- butc->xkb_acts= NULL;
-#endif
- dev->button = butc;
- return TRUE;
-}
-
-Bool
-InitValuatorClassDeviceStruct(dev, numAxes, motionProc, numMotionEvents, mode)
- DeviceIntPtr dev;
- ValuatorMotionProcPtr motionProc;
- int numAxes;
- int numMotionEvents;
- int mode;
-{
- int i;
- register ValuatorClassPtr valc;
-
- valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) +
- numAxes * sizeof(AxisInfo) +
- numAxes * sizeof(unsigned int));
- if (!valc)
- return FALSE;
- valc->GetMotionProc = motionProc;
- valc->numMotionEvents = numMotionEvents;
- valc->motionHintWindow = NullWindow;
- valc->numAxes = numAxes;
- valc->mode = mode;
- valc->axes = (AxisInfoPtr)(valc + 1);
- valc->axisVal = (int *)(valc->axes + numAxes);
- for (i=0; i<numAxes; i++)
- valc->axisVal[i]=0;
- dev->valuator = valc;
- return TRUE;
-}
-
-Bool
-InitFocusClassDeviceStruct(dev)
- DeviceIntPtr dev;
-{
- register FocusClassPtr focc;
-
- focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec));
- if (!focc)
- return FALSE;
- focc->win = PointerRootWin;
- focc->revert = None;
- focc->time = currentTime;
- focc->trace = (WindowPtr *)NULL;
- focc->traceSize = 0;
- focc->traceGood = 0;
- dev->focus = focc;
- return TRUE;
-}
-
-Bool
-InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc)
- DeviceIntPtr dev;
- BellProcPtr bellProc;
- KbdCtrlProcPtr controlProc;
-{
- register KbdFeedbackPtr feedc;
-
- feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->BellProc = bellProc;
- feedc->CtrlProc = controlProc;
-#ifdef XKB
- defaultKeyboardControl.autoRepeat = TRUE;
-#endif
- feedc->ctrl = defaultKeyboardControl;
- feedc->ctrl.id = 0;
- if ((feedc->next = dev->kbdfeed) != 0)
- feedc->ctrl.id = dev->kbdfeed->ctrl.id + 1;
- dev->kbdfeed = feedc;
-#ifdef XKB
- feedc->xkb_sli= NULL;
- if (!noXkbExtension)
- XkbFinishDeviceInit(dev);
-#endif
- (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
- return TRUE;
-}
-
-Bool
-InitPtrFeedbackClassDeviceStruct(dev, controlProc)
- DeviceIntPtr dev;
- PtrCtrlProcPtr controlProc;
-{
- register PtrFeedbackPtr feedc;
-
- feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->CtrlProc = controlProc;
-#ifdef sgi
- feedc->ctrl.num = 1;
- feedc->ctrl.den = 1;
- feedc->ctrl.threshold = 1;
-#else
- feedc->ctrl = defaultPointerControl;
-#endif
- feedc->ctrl.id = 0;
- if ( (feedc->next = dev->ptrfeed) )
- feedc->ctrl.id = dev->ptrfeed->ctrl.id + 1;
- dev->ptrfeed = feedc;
- (*controlProc)(dev, &feedc->ctrl);
- return TRUE;
-}
-
-
-LedCtrl defaultLedControl = {
- DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0};
-
-BellCtrl defaultBellControl = {
- DEFAULT_BELL,
- DEFAULT_BELL_PITCH,
- DEFAULT_BELL_DURATION,
- 0};
-
-IntegerCtrl defaultIntegerControl = {
- DEFAULT_INT_RESOLUTION,
- DEFAULT_INT_MIN_VALUE,
- DEFAULT_INT_MAX_VALUE,
- DEFAULT_INT_DISPLAYED,
- 0};
-
-Bool
-InitStringFeedbackClassDeviceStruct (dev, controlProc, max_symbols,
- num_symbols_supported, symbols)
- DeviceIntPtr dev;
- StringCtrlProcPtr controlProc;
- int max_symbols;
- int num_symbols_supported;
- KeySym *symbols;
-{
- int i;
- register StringFeedbackPtr feedc;
-
- feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->CtrlProc = controlProc;
- feedc->ctrl.num_symbols_supported = num_symbols_supported;
- feedc->ctrl.num_symbols_displayed = 0;
- feedc->ctrl.max_symbols = max_symbols;
- feedc->ctrl.symbols_supported = (KeySym *)
- xalloc (sizeof (KeySym) * num_symbols_supported);
- feedc->ctrl.symbols_displayed = (KeySym *)
- xalloc (sizeof (KeySym) * max_symbols);
- if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed)
- {
- if (feedc->ctrl.symbols_supported)
- xfree(feedc->ctrl.symbols_supported);
- if (feedc->ctrl.symbols_displayed)
- xfree(feedc->ctrl.symbols_displayed);
- xfree(feedc);
- return FALSE;
- }
- for (i=0; i<num_symbols_supported; i++)
- *(feedc->ctrl.symbols_supported+i) = *symbols++;
- for (i=0; i<max_symbols; i++)
- *(feedc->ctrl.symbols_displayed+i) = (KeySym) NULL;
- feedc->ctrl.id = 0;
- if ( (feedc->next = dev->stringfeed) )
- feedc->ctrl.id = dev->stringfeed->ctrl.id + 1;
- dev->stringfeed = feedc;
- (*controlProc)(dev, &feedc->ctrl);
- return TRUE;
-}
-
-Bool
-InitBellFeedbackClassDeviceStruct (dev, bellProc, controlProc)
- DeviceIntPtr dev;
- BellProcPtr bellProc;
- BellCtrlProcPtr controlProc;
-{
- register BellFeedbackPtr feedc;
-
- feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->CtrlProc = controlProc;
- feedc->BellProc = bellProc;
- feedc->ctrl = defaultBellControl;
- feedc->ctrl.id = 0;
- if ( (feedc->next = dev->bell) )
- feedc->ctrl.id = dev->bell->ctrl.id + 1;
- dev->bell = feedc;
- (*controlProc)(dev, &feedc->ctrl);
- return TRUE;
-}
-
-Bool
-InitLedFeedbackClassDeviceStruct (dev, controlProc)
- DeviceIntPtr dev;
- LedCtrlProcPtr controlProc;
-{
- register LedFeedbackPtr feedc;
-
- feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->CtrlProc = controlProc;
- feedc->ctrl = defaultLedControl;
- feedc->ctrl.id = 0;
- if ( (feedc->next = dev->leds) )
- feedc->ctrl.id = dev->leds->ctrl.id + 1;
-#ifdef XKB
- feedc->xkb_sli= NULL;
-#endif
- dev->leds = feedc;
- (*controlProc)(dev, &feedc->ctrl);
- return TRUE;
-}
-
-Bool
-InitIntegerFeedbackClassDeviceStruct (dev, controlProc)
- DeviceIntPtr dev;
- IntegerCtrlProcPtr controlProc;
-{
- register IntegerFeedbackPtr feedc;
-
- feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec));
- if (!feedc)
- return FALSE;
- feedc->CtrlProc = controlProc;
- feedc->ctrl = defaultIntegerControl;
- feedc->ctrl.id = 0;
- if ( (feedc->next = dev->intfeed) )
- feedc->ctrl.id = dev->intfeed->ctrl.id + 1;
- dev->intfeed = feedc;
- (*controlProc)(dev, &feedc->ctrl);
- return TRUE;
-}
-
-Bool
-InitPointerDeviceStruct(device, map, numButtons, motionProc, controlProc,
- numMotionEvents)
- DevicePtr device;
- CARD8 *map;
- int numButtons;
- PtrCtrlProcPtr controlProc;
- ValuatorMotionProcPtr motionProc;
- int numMotionEvents;
-{
- DeviceIntPtr dev = (DeviceIntPtr)device;
-
- return(InitButtonClassDeviceStruct(dev, numButtons, map) &&
- InitValuatorClassDeviceStruct(dev, 2, motionProc,
- numMotionEvents, 0) &&
- InitPtrFeedbackClassDeviceStruct(dev, controlProc));
-}
-
-Bool
-InitKeyboardDeviceStruct(device, pKeySyms, pModifiers, bellProc, controlProc)
- DevicePtr device;
- KeySymsPtr pKeySyms;
- CARD8 pModifiers[];
- BellProcPtr bellProc;
- KbdCtrlProcPtr controlProc;
-{
- DeviceIntPtr dev = (DeviceIntPtr)device;
-
- return(InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers) &&
- InitFocusClassDeviceStruct(dev) &&
- InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc));
-}
-
-void
-SendMappingNotify(request, firstKeyCode, count, client)
- unsigned int request, count;
- unsigned int firstKeyCode;
- ClientPtr client;
-{
- int i;
- xEvent event;
-
- event.u.u.type = MappingNotify;
- event.u.mappingNotify.request = request;
- if (request == MappingKeyboard)
- {
- event.u.mappingNotify.firstKeyCode = firstKeyCode;
- event.u.mappingNotify.count = count;
- }
-#ifdef XKB
- if (!noXkbExtension &&
- ((request == MappingKeyboard) || (request == MappingModifier))) {
- XkbApplyMappingChange(inputInfo.keyboard,request,firstKeyCode,count,
- client);
- }
-#endif
-
- /* 0 is the server client */
- for (i=1; i<currentMaxClients; i++)
- {
- if (clients[i] && clients[i]->clientState == ClientStateRunning)
- {
-#ifdef XKB
- if (!noXkbExtension &&
- (request == MappingKeyboard) &&
- (clients[i]->xkbClientFlags != 0) &&
- (clients[i]->mapNotifyMask&XkbKeySymsMask))
- continue;
-#endif
- event.u.u.sequenceNumber = clients[i]->sequence;
- WriteEventsToClient(clients[i], 1, &event);
- }
- }
-}
-
-/*
- * n-squared algorithm. n < 255 and don't want to copy the whole thing and
- * sort it to do the checking. How often is it called? Just being lazy?
- */
-Bool
-BadDeviceMap(buff, length, low, high, errval)
- register BYTE *buff;
- int length;
- unsigned low, high;
- XID *errval;
-{
- register int i, j;
-
- for (i = 0; i < length; i++)
- if (buff[i]) /* only check non-zero elements */
- {
- if ((low > buff[i]) || (high < buff[i]))
- {
- *errval = buff[i];
- return TRUE;
- }
- for (j = i + 1; j < length; j++)
- if (buff[i] == buff[j])
- {
- *errval = buff[i];
- return TRUE;
- }
- }
- return FALSE;
-}
-
-Bool
-AllModifierKeysAreUp(dev, map1, per1, map2, per2)
- register DeviceIntPtr dev;
- register CARD8 *map1, *map2;
- int per1, per2;
-{
- register int i, j, k;
- register CARD8 *down = dev->key->down;
-
- for (i = 8; --i >= 0; map2 += per2)
- {
- for (j = per1; --j >= 0; map1++)
- {
- if (*map1 && BitIsOn(down, *map1))
- {
- for (k = per2; (--k >= 0) && (*map1 != map2[k]);)
- ;
- if (k < 0)
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-int
-ProcSetModifierMapping(client)
- ClientPtr client;
-{
- xSetModifierMappingReply rep;
- REQUEST(xSetModifierMappingReq);
- KeyCode *inputMap;
- int inputMapLen;
- register int i;
- DeviceIntPtr keybd = inputInfo.keyboard;
- register KeyClassPtr keyc = keybd->key;
-
- REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
-
- if (client->req_len != ((stuff->numKeyPerModifier<<1) +
- (sizeof (xSetModifierMappingReq)>>2)))
- return BadLength;
-
- inputMapLen = 8*stuff->numKeyPerModifier;
- inputMap = (KeyCode *)&stuff[1];
-
- /*
- * Now enforce the restriction that "all of the non-zero keycodes must be
- * in the range specified by min-keycode and max-keycode in the
- * connection setup (else a Value error)"
- */
- i = inputMapLen;
- while (i--)
- {
- if (inputMap[i]
- && (inputMap[i] < keyc->curKeySyms.minKeyCode
- || inputMap[i] > keyc->curKeySyms.maxKeyCode))
- {
- client->errorValue = inputMap[i];
- return BadValue;
- }
- }
-
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, keybd, TRUE))
- return BadAccess;
-#endif
-
-#ifdef LBX
- LbxFlushModifierMapTag();
-#endif
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.success = MappingSuccess;
-
- /*
- * Now enforce the restriction that none of the old or new
- * modifier keys may be down while we change the mapping, and
- * that the DDX layer likes the choice.
- */
- if (!AllModifierKeysAreUp(keybd, keyc->modifierKeyMap,
- (int)keyc->maxKeysPerModifier,
- inputMap, (int)stuff->numKeyPerModifier)
- ||
- !AllModifierKeysAreUp(keybd, inputMap, (int)stuff->numKeyPerModifier,
- keyc->modifierKeyMap,
- (int)keyc->maxKeysPerModifier))
- {
- rep.success = MappingBusy;
- }
- else
- {
- for (i = 0; i < inputMapLen; i++)
- {
- if (inputMap[i] && !LegalModifier(inputMap[i], (DevicePtr)keybd))
- {
- rep.success = MappingFailed;
- break;
- }
- }
- }
-
- if (rep.success == MappingSuccess)
- {
- KeyCode *map;
- /*
- * Now build the keyboard's modifier bitmap from the
- * list of keycodes.
- */
- map = (KeyCode *)xalloc(inputMapLen);
- if (!map && inputMapLen)
- return BadAlloc;
- if (keyc->modifierKeyMap)
- xfree(keyc->modifierKeyMap);
- keyc->modifierKeyMap = map;
- memmove((char *)map, (char *)inputMap, inputMapLen);
-
- keyc->maxKeysPerModifier = stuff->numKeyPerModifier;
- for (i = 0; i < MAP_LENGTH; i++)
- keyc->modifierMap[i] = 0;
- for (i = 0; i < inputMapLen; i++)
- {
- if (inputMap[i])
- keyc->modifierMap[inputMap[i]] |=
- (1<<(((unsigned int)i)/keyc->maxKeysPerModifier));
- }
- }
-
- if (rep.success == MappingSuccess)
- SendMappingNotify(MappingModifier, 0, 0, client);
-
- WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
-
- return(client->noClientException);
-}
-
-int
-ProcGetModifierMapping(client)
- ClientPtr client;
-{
- xGetModifierMappingReply rep;
- register KeyClassPtr keyc = inputInfo.keyboard->key;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.numKeyPerModifier = keyc->maxKeysPerModifier;
- rep.sequenceNumber = client->sequence;
- /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
- rep.length = keyc->maxKeysPerModifier << 1;
-
- WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep);
-
- /* Use the (modified by DDX) map that SetModifierMapping passed in */
- (void)WriteToClient(client, (int)(keyc->maxKeysPerModifier << 3),
- (char *)keyc->modifierKeyMap);
- return client->noClientException;
-}
-
-int
-ProcChangeKeyboardMapping(client)
- ClientPtr client;
-{
- REQUEST(xChangeKeyboardMappingReq);
- unsigned len;
- KeySymsRec keysyms;
- register KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms;
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
-
- len = client->req_len - (sizeof(xChangeKeyboardMappingReq) >> 2);
- if (len != (stuff->keyCodes * stuff->keySymsPerKeyCode))
- return BadLength;
- if ((stuff->firstKeyCode < curKeySyms->minKeyCode) ||
- (stuff->firstKeyCode > curKeySyms->maxKeyCode))
- {
- client->errorValue = stuff->firstKeyCode;
- return BadValue;
- }
- if ( ((unsigned)(stuff->firstKeyCode + stuff->keyCodes - 1) >
- curKeySyms->maxKeyCode) ||
- (stuff->keySymsPerKeyCode == 0))
- {
- client->errorValue = stuff->keySymsPerKeyCode;
- return BadValue;
- }
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard,
- TRUE))
- return BadAccess;
-#endif
- keysyms.minKeyCode = stuff->firstKeyCode;
- keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1;
- keysyms.mapWidth = stuff->keySymsPerKeyCode;
- keysyms.map = (KeySym *)&stuff[1];
- if (!SetKeySymsMap(curKeySyms, &keysyms))
- return BadAlloc;
-#ifdef LBX
- LbxFlushKeyboardMapTag();
-#endif
- SendMappingNotify(MappingKeyboard, stuff->firstKeyCode, stuff->keyCodes,
- client);
- return client->noClientException;
-
-}
-
-int
-ProcSetPointerMapping(client)
- ClientPtr client;
-{
- REQUEST(xSetPointerMappingReq);
- BYTE *map;
- xSetPointerMappingReply rep;
- register unsigned int i;
- DeviceIntPtr mouse = inputInfo.pointer;
-
- REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
- if (client->req_len != (sizeof(xSetPointerMappingReq)+stuff->nElts+3) >> 2)
- return BadLength;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.success = MappingSuccess;
- map = (BYTE *)&stuff[1];
- if (stuff->nElts != mouse->button->numButtons)
- {
- client->errorValue = stuff->nElts;
- return BadValue;
- }
- if (BadDeviceMap(&map[0], (int)stuff->nElts, 1, 255, &client->errorValue))
- return BadValue;
- for (i=0; i < stuff->nElts; i++)
- if ((mouse->button->map[i + 1] != map[i]) &&
- BitIsOn(mouse->button->down, i + 1))
- {
- rep.success = MappingBusy;
- WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
- return Success;
- }
- for (i = 0; i < stuff->nElts; i++)
- mouse->button->map[i + 1] = map[i];
- SendMappingNotify(MappingPointer, 0, 0, client);
- WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
- return Success;
-}
-
-int
-ProcGetKeyboardMapping(client)
- ClientPtr client;
-{
- xGetKeyboardMappingReply rep;
- REQUEST(xGetKeyboardMappingReq);
- KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms;
-
- REQUEST_SIZE_MATCH(xGetKeyboardMappingReq);
-
- if ((stuff->firstKeyCode < curKeySyms->minKeyCode) ||
- (stuff->firstKeyCode > curKeySyms->maxKeyCode))
- {
- client->errorValue = stuff->firstKeyCode;
- return BadValue;
- }
- if (stuff->firstKeyCode + stuff->count >
- (unsigned)(curKeySyms->maxKeyCode + 1))
- {
- client->errorValue = stuff->count;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.keySymsPerKeyCode = curKeySyms->mapWidth;
- /* length is a count of 4 byte quantities and KeySyms are 4 bytes */
- rep.length = (curKeySyms->mapWidth * stuff->count);
- WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep);
- client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
- WriteSwappedDataToClient(
- client,
- curKeySyms->mapWidth * stuff->count * sizeof(KeySym),
- &curKeySyms->map[(stuff->firstKeyCode - curKeySyms->minKeyCode) *
- curKeySyms->mapWidth]);
-
- return client->noClientException;
-}
-
-int
-ProcGetPointerMapping(client)
- ClientPtr client;
-{
- xGetPointerMappingReply rep;
- ButtonClassPtr butc = inputInfo.pointer->button;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.nElts = butc->numButtons;
- rep.length = ((unsigned)rep.nElts + (4-1))/4;
- WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
- (void)WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]);
- return Success;
-}
-
-void
-NoteLedState(keybd, led, on)
- DeviceIntPtr keybd;
- int led;
- Bool on;
-{
- KeybdCtrl *ctrl = &keybd->kbdfeed->ctrl;
- if (on)
- ctrl->leds |= ((Leds)1 << (led - 1));
- else
- ctrl->leds &= ~((Leds)1 << (led - 1));
-}
-
-int
-Ones(mask) /* HACKMEM 169 */
- unsigned long mask;
-{
- register unsigned long y;
-
- y = (mask >> 1) &033333333333;
- y = mask - y - ((y >>1) & 033333333333);
- return (((y + (y >> 3)) & 030707070707) % 077);
-}
-
-int
-ProcChangeKeyboardControl (client)
- ClientPtr client;
-{
-#define DO_ALL (-1)
- KeybdCtrl ctrl;
- DeviceIntPtr keybd = inputInfo.keyboard;
- XID *vlist;
- int t;
- int led = DO_ALL;
- int key = DO_ALL;
- BITS32 vmask, index2;
- int mask, i;
- REQUEST(xChangeKeyboardControlReq);
-
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
- vmask = stuff->mask;
- if (client->req_len != (sizeof(xChangeKeyboardControlReq)>>2)+Ones(vmask))
- return BadLength;
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, keybd, TRUE))
- return BadAccess;
-#endif
- vlist = (XID *)&stuff[1]; /* first word of values */
- ctrl = keybd->kbdfeed->ctrl;
- while (vmask)
- {
- index2 = (BITS32) lowbit (vmask);
- vmask &= ~index2;
- switch (index2)
- {
- case KBKeyClickPercent:
- t = (INT8)*vlist;
- vlist++;
- if (t == -1)
- t = defaultKeyboardControl.click;
- else if (t < 0 || t > 100)
- {
- client->errorValue = t;
- return BadValue;
- }
- ctrl.click = t;
- break;
- case KBBellPercent:
- t = (INT8)*vlist;
- vlist++;
- if (t == -1)
- t = defaultKeyboardControl.bell;
- else if (t < 0 || t > 100)
- {
- client->errorValue = t;
- return BadValue;
- }
- ctrl.bell = t;
- break;
- case KBBellPitch:
- t = (INT16)*vlist;
- vlist++;
- if (t == -1)
- t = defaultKeyboardControl.bell_pitch;
- else if (t < 0)
- {
- client->errorValue = t;
- return BadValue;
- }
- ctrl.bell_pitch = t;
- break;
- case KBBellDuration:
- t = (INT16)*vlist;
- vlist++;
- if (t == -1)
- t = defaultKeyboardControl.bell_duration;
- else if (t < 0)
- {
- client->errorValue = t;
- return BadValue;
- }
- ctrl.bell_duration = t;
- break;
- case KBLed:
- led = (CARD8)*vlist;
- vlist++;
- if (led < 1 || led > 32)
- {
- client->errorValue = led;
- return BadValue;
- }
- if (!(stuff->mask & KBLedMode))
- return BadMatch;
- break;
- case KBLedMode:
- t = (CARD8)*vlist;
- vlist++;
- if (t == LedModeOff)
- {
- if (led == DO_ALL)
- ctrl.leds = 0x0;
- else
- ctrl.leds &= ~(((Leds)(1)) << (led - 1));
- }
- else if (t == LedModeOn)
- {
- if (led == DO_ALL)
- ctrl.leds = ~0L;
- else
- ctrl.leds |= (((Leds)(1)) << (led - 1));
- }
- else
- {
- client->errorValue = t;
- return BadValue;
- }
-#ifdef XKB
- if (!noXkbExtension) {
- XkbEventCauseRec cause;
- XkbSetCauseCoreReq(&cause,X_ChangeKeyboardControl,client);
- XkbSetIndicators(keybd,((led == DO_ALL) ? ~0L : (1L<<(led-1))),
- ctrl.leds, &cause);
- ctrl.leds = keybd->kbdfeed->ctrl.leds;
- }
-#endif
- break;
- case KBKey:
- key = (KeyCode)*vlist;
- vlist++;
- if ((KeyCode)key < inputInfo.keyboard->key->curKeySyms.minKeyCode ||
- (KeyCode)key > inputInfo.keyboard->key->curKeySyms.maxKeyCode)
- {
- client->errorValue = key;
- return BadValue;
- }
- if (!(stuff->mask & KBAutoRepeatMode))
- return BadMatch;
- break;
- case KBAutoRepeatMode:
- i = (key >> 3);
- mask = (1 << (key & 7));
- t = (CARD8)*vlist;
- vlist++;
-#ifdef XKB
- if (!noXkbExtension && key != DO_ALL)
- XkbDisableComputedAutoRepeats(keybd,key);
-#endif
- if (t == AutoRepeatModeOff)
- {
- if (key == DO_ALL)
- ctrl.autoRepeat = FALSE;
- else
- ctrl.autoRepeats[i] &= ~mask;
- }
- else if (t == AutoRepeatModeOn)
- {
- if (key == DO_ALL)
- ctrl.autoRepeat = TRUE;
- else
- ctrl.autoRepeats[i] |= mask;
- }
- else if (t == AutoRepeatModeDefault)
- {
- if (key == DO_ALL)
- ctrl.autoRepeat = defaultKeyboardControl.autoRepeat;
- else
- ctrl.autoRepeats[i] =
- (ctrl.autoRepeats[i] & ~mask) |
- (defaultKeyboardControl.autoRepeats[i] & mask);
- }
- else
- {
- client->errorValue = t;
- return BadValue;
- }
- break;
- default:
- client->errorValue = stuff->mask;
- return BadValue;
- }
- }
- keybd->kbdfeed->ctrl = ctrl;
-#ifdef XKB
- /* The XKB RepeatKeys control and core protocol global autorepeat */
- /* value are linked */
- if (!noXkbExtension) {
- XkbSetRepeatKeys(keybd,key,keybd->kbdfeed->ctrl.autoRepeat);
- }
- else
-#endif
- (*keybd->kbdfeed->CtrlProc)(keybd, &keybd->kbdfeed->ctrl);
- return Success;
-#undef DO_ALL
-}
-
-int
-ProcGetKeyboardControl (client)
- ClientPtr client;
-{
- int i;
- register KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl;
- xGetKeyboardControlReply rep;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.length = 5;
- rep.sequenceNumber = client->sequence;
- rep.globalAutoRepeat = ctrl->autoRepeat;
- rep.keyClickPercent = ctrl->click;
- rep.bellPercent = ctrl->bell;
- rep.bellPitch = ctrl->bell_pitch;
- rep.bellDuration = ctrl->bell_duration;
- rep.ledMask = ctrl->leds;
- for (i = 0; i < 32; i++)
- rep.map[i] = ctrl->autoRepeats[i];
- WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep);
- return Success;
-}
-
-int
-ProcBell(client)
- ClientPtr client;
-{
- register DeviceIntPtr keybd = inputInfo.keyboard;
- int base = keybd->kbdfeed->ctrl.bell;
- int newpercent;
- REQUEST(xBellReq);
- REQUEST_SIZE_MATCH(xBellReq);
- if (stuff->percent < -100 || stuff->percent > 100)
- {
- client->errorValue = stuff->percent;
- return BadValue;
- }
- newpercent = (base * stuff->percent) / 100;
- if (stuff->percent < 0)
- newpercent = base + newpercent;
- else
- newpercent = base - newpercent + stuff->percent;
-#ifdef XKB
- if (!noXkbExtension)
- XkbHandleBell(FALSE,FALSE, keybd, newpercent, &keybd->kbdfeed->ctrl, 0,
- None, NULL, client);
- else
-#endif
- (*keybd->kbdfeed->BellProc)(newpercent, keybd,
- (pointer) &keybd->kbdfeed->ctrl, 0);
- return Success;
-}
-
-int
-ProcChangePointerControl(client)
- ClientPtr client;
-{
- DeviceIntPtr mouse = inputInfo.pointer;
- PtrCtrl ctrl; /* might get BadValue part way through */
- REQUEST(xChangePointerControlReq);
-
- REQUEST_SIZE_MATCH(xChangePointerControlReq);
- ctrl = mouse->ptrfeed->ctrl;
- if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse))
- {
- client->errorValue = stuff->doAccel;
- return(BadValue);
- }
- if ((stuff->doThresh != xTrue) && (stuff->doThresh != xFalse))
- {
- client->errorValue = stuff->doThresh;
- return(BadValue);
- }
- if (stuff->doAccel)
- {
- if (stuff->accelNum == -1)
- ctrl.num = defaultPointerControl.num;
- else if (stuff->accelNum < 0)
- {
- client->errorValue = stuff->accelNum;
- return BadValue;
- }
- else ctrl.num = stuff->accelNum;
- if (stuff->accelDenum == -1)
- ctrl.den = defaultPointerControl.den;
- else if (stuff->accelDenum <= 0)
- {
- client->errorValue = stuff->accelDenum;
- return BadValue;
- }
- else ctrl.den = stuff->accelDenum;
- }
- if (stuff->doThresh)
- {
- if (stuff->threshold == -1)
- ctrl.threshold = defaultPointerControl.threshold;
- else if (stuff->threshold < 0)
- {
- client->errorValue = stuff->threshold;
- return BadValue;
- }
- else ctrl.threshold = stuff->threshold;
- }
- mouse->ptrfeed->ctrl = ctrl;
- (*mouse->ptrfeed->CtrlProc)(mouse, &mouse->ptrfeed->ctrl);
- return Success;
-}
-
-int
-ProcGetPointerControl(client)
- ClientPtr client;
-{
- register PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl;
- xGetPointerControlReply rep;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.threshold = ctrl->threshold;
- rep.accelNumerator = ctrl->num;
- rep.accelDenominator = ctrl->den;
- WriteReplyToClient(client, sizeof(xGenericReply), &rep);
- return Success;
-}
-
-void
-MaybeStopHint(dev, client)
- register DeviceIntPtr dev;
- ClientPtr client;
-{
- GrabPtr grab = dev->grab;
-
- if ((grab && SameClient(grab, client) &&
- ((grab->eventMask & PointerMotionHintMask) ||
- (grab->ownerEvents &&
- (EventMaskForClient(dev->valuator->motionHintWindow, client) &
- PointerMotionHintMask)))) ||
- (!grab &&
- (EventMaskForClient(dev->valuator->motionHintWindow, client) &
- PointerMotionHintMask)))
- dev->valuator->motionHintWindow = NullWindow;
-}
-
-int
-ProcGetMotionEvents(client)
- ClientPtr client;
-{
- WindowPtr pWin;
- xTimecoord * coords = (xTimecoord *) NULL;
- xGetMotionEventsReply rep;
- int i, count, xmin, xmax, ymin, ymax;
- unsigned long nEvents;
- DeviceIntPtr mouse = inputInfo.pointer;
- TimeStamp start, stop;
- REQUEST(xGetMotionEventsReq);
-
- REQUEST_SIZE_MATCH(xGetMotionEventsReq);
- pWin = SecurityLookupWindow(stuff->window, client, TRUE);
- if (!pWin)
- return BadWindow;
- if (mouse->valuator->motionHintWindow)
- MaybeStopHint(mouse, client);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- nEvents = 0;
- start = ClientTimeToServerTime(stuff->start);
- stop = ClientTimeToServerTime(stuff->stop);
- if ((CompareTimeStamps(start, stop) != LATER) &&
- (CompareTimeStamps(start, currentTime) != LATER) &&
- mouse->valuator->numMotionEvents)
- {
- if (CompareTimeStamps(stop, currentTime) == LATER)
- stop = currentTime;
- coords = (xTimecoord *)ALLOCATE_LOCAL(mouse->valuator->numMotionEvents
- * sizeof(xTimecoord));
- if (!coords)
- return BadAlloc;
- count = (*mouse->valuator->GetMotionProc) (mouse, coords,
- start.milliseconds,
- stop.milliseconds,
- pWin->drawable.pScreen);
- xmin = pWin->drawable.x - wBorderWidth (pWin);
- xmax = pWin->drawable.x + (int)pWin->drawable.width +
- wBorderWidth (pWin);
- ymin = pWin->drawable.y - wBorderWidth (pWin);
- ymax = pWin->drawable.y + (int)pWin->drawable.height +
- wBorderWidth (pWin);
- for (i = 0; i < count; i++)
- if ((xmin <= coords[i].x) && (coords[i].x < xmax) &&
- (ymin <= coords[i].y) && (coords[i].y < ymax))
- {
- coords[nEvents].time = coords[i].time;
- coords[nEvents].x = coords[i].x - pWin->drawable.x;
- coords[nEvents].y = coords[i].y - pWin->drawable.y;
- nEvents++;
- }
- }
- rep.length = nEvents * (sizeof(xTimecoord) >> 2);
- rep.nEvents = nEvents;
- WriteReplyToClient(client, sizeof(xGetMotionEventsReply), &rep);
- if (nEvents)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) SwapTimeCoordWrite;
- WriteSwappedDataToClient(client, nEvents * sizeof(xTimecoord),
- (char *)coords);
- }
- if (coords)
- DEALLOCATE_LOCAL(coords);
- return Success;
-}
-
-int
-ProcQueryKeymap(client)
- ClientPtr client;
-{
- xQueryKeymapReply rep;
- int i;
- CARD8 *down = inputInfo.keyboard->key->down;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 2;
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
- {
- bzero((char *)&rep.map[0], 32);
- }
- else
-#endif
- for (i = 0; i<32; i++)
- rep.map[i] = down[i];
- WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
- return Success;
-}
-
-/******************************************************************************
- * The following entrypoints are provided for binary compatibility with
- * previous versions (they make casts, where the current version changes types
- * for more stringent prototype checking).
- ******************************************************************************/
-#ifdef AddInputDevice
-#undef AddInputDevice
-
-DevicePtr
-AddInputDevice(
- DeviceProc deviceProc,
- Bool autoStart)
-{
- return (DevicePtr)_AddInputDevice(deviceProc, autoStart);
-}
-#endif /* AddInputDevice */
-
-#ifdef RegisterPointerDevice
-#undef RegisterPointerDevice
-
-void
-RegisterPointerDevice(DevicePtr device)
-{
- _RegisterPointerDevice((DeviceIntPtr)device);
-}
-#endif /* RegisterPointerDevice */
-
-#ifdef RegisterKeyboardDevice
-#undef RegisterKeyboardDevice
-
-void
-RegisterKeyboardDevice(DevicePtr device)
-{
- _RegisterKeyboardDevice((DeviceIntPtr)device);
-}
-#endif /* RegisterKeyboardDevice */
diff --git a/dix/dispatch.c b/dix/dispatch.c
deleted file mode 100644
index cd1ce6790..000000000
--- a/dix/dispatch.c
+++ /dev/null
@@ -1,4075 +0,0 @@
-/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
-/************************************************************
-
-Copyright 1987, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.33 2003/11/17 22:20:33 dawes Exp $ */
-
-#ifdef PANORAMIX_DEBUG
-#include <stdio.h>
-int ProcInitialConnection();
-#endif
-
-#include "windowstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "selection.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "opaque.h"
-#include "input.h"
-#include "servermd.h"
-#include "extnsionst.h"
-#include "dixfont.h"
-#include "dispatch.h"
-#include "swaprep.h"
-#include "swapreq.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-#ifdef XAPPGROUP
-#include "Xagsrv.h"
-#endif
-#ifdef XKB
-#define XKB_IN_SERVER
-#include "inputstr.h"
-#include "XKBsrv.h"
-#endif
-#ifdef LBX
-#include "lbxserve.h"
-#endif
-
-#define mskcnt ((MAXCLIENTS + 31) / 32)
-#define BITMASK(i) (1U << ((i) & 31))
-#define MASKIDX(i) ((i) >> 5)
-#define MASKWORD(buf, i) buf[MASKIDX(i)]
-#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i)
-#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i)
-#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i))
-
-extern xConnSetupPrefix connSetupPrefix;
-extern char *ConnectionInfo;
-
-Selection *CurrentSelections;
-int NumCurrentSelections;
-
-static ClientPtr grabClient;
-#define GrabNone 0
-#define GrabActive 1
-#define GrabKickout 2
-static int grabState = GrabNone;
-static long grabWaiters[mskcnt];
-CallbackListPtr ServerGrabCallback = NULL;
-HWEventQueuePtr checkForInput[2];
-extern int connBlockScreenStart;
-
-static void KillAllClients(
- void
-);
-
-static void DeleteClientFromAnySelections(
- ClientPtr /*client*/
-);
-
-static int nextFreeClientID; /* always MIN free client ID */
-
-static int nClients; /* number of authorized clients */
-
-CallbackListPtr ClientStateCallback;
-char dispatchException = 0;
-char isItTimeToYield;
-
-/* Various of the DIX function interfaces were not designed to allow
- * the client->errorValue to be set on BadValue and other errors.
- * Rather than changing interfaces and breaking untold code we introduce
- * a new global that dispatch can use.
- */
-XID clientErrorValue; /* XXX this is a kludge */
-
-#define SAME_SCREENS(a, b) (\
- (a.pScreen == b.pScreen))
-
-void
-SetInputCheck(c0, c1)
- HWEventQueuePtr c0, c1;
-{
- checkForInput[0] = c0;
- checkForInput[1] = c1;
-}
-
-void
-UpdateCurrentTime()
-{
- TimeStamp systime;
-
- /* To avoid time running backwards, we must call GetTimeInMillis before
- * calling ProcessInputEvents.
- */
- systime.months = currentTime.months;
- systime.milliseconds = GetTimeInMillis();
- if (systime.milliseconds < currentTime.milliseconds)
- systime.months++;
- if (*checkForInput[0] != *checkForInput[1])
- ProcessInputEvents();
- if (CompareTimeStamps(systime, currentTime) == LATER)
- currentTime = systime;
-}
-
-/* Like UpdateCurrentTime, but can't call ProcessInputEvents */
-void
-UpdateCurrentTimeIf()
-{
- TimeStamp systime;
-
- systime.months = currentTime.months;
- systime.milliseconds = GetTimeInMillis();
- if (systime.milliseconds < currentTime.milliseconds)
- systime.months++;
- if (*checkForInput[0] == *checkForInput[1])
- currentTime = systime;
-}
-
-void
-InitSelections()
-{
- if (CurrentSelections)
- xfree(CurrentSelections);
- CurrentSelections = (Selection *)NULL;
- NumCurrentSelections = 0;
-}
-
-void
-FlushClientCaches(id)
- XID id;
-{
- int i;
- register ClientPtr client;
-
- client = clients[CLIENT_ID(id)];
- if (client == NullClient)
- return ;
- for (i=0; i<currentMaxClients; i++)
- {
- client = clients[i];
- if (client != NullClient)
- {
- if (client->lastDrawableID == id)
- {
- client->lastDrawableID = WindowTable[0]->drawable.id;
- client->lastDrawable = (DrawablePtr)WindowTable[0];
- }
- else if (client->lastGCID == id)
- {
- client->lastGCID = INVALID;
- client->lastGC = (GCPtr)NULL;
- }
- }
- }
-}
-#ifdef SMART_SCHEDULE
-
-#undef SMART_DEBUG
-
-#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */
-#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */
-
-Bool SmartScheduleDisable;
-long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
-long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
-long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
-long SmartScheduleTime;
-ClientPtr SmartLastClient;
-int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
-int SmartScheduleClient(int *clientReady, int nready);
-
-#ifdef SMART_DEBUG
-long SmartLastPrint;
-#endif
-
-void Dispatch(void);
-void InitProcVectors(void);
-
-int
-SmartScheduleClient (int *clientReady, int nready)
-{
- ClientPtr pClient;
- int i;
- int client;
- int bestPrio, best = 0;
- int bestRobin, robin;
- long now = SmartScheduleTime;
- long idle;
-
- bestPrio = -0x7fffffff;
- bestRobin = 0;
- idle = 2 * SmartScheduleSlice;
- for (i = 0; i < nready; i++)
- {
- client = clientReady[i];
- pClient = clients[client];
- /* Praise clients which are idle */
- if ((now - pClient->smart_check_tick) >= idle)
- {
- if (pClient->smart_priority < 0)
- pClient->smart_priority++;
- }
- pClient->smart_check_tick = now;
-
- /* check priority to select best client */
- robin = (pClient->index - SmartLastIndex[pClient->smart_priority-SMART_MIN_PRIORITY]) & 0xff;
- if (pClient->smart_priority > bestPrio ||
- (pClient->smart_priority == bestPrio && robin > bestRobin))
- {
- bestPrio = pClient->smart_priority;
- bestRobin = robin;
- best = client;
- }
-#ifdef SMART_DEBUG
- if ((now - SmartLastPrint) >= 5000)
- fprintf (stderr, " %2d: %3d", client, pClient->smart_priority);
-#endif
- }
-#ifdef SMART_DEBUG
- if ((now - SmartLastPrint) >= 5000)
- {
- fprintf (stderr, " use %2d\n", best);
- SmartLastPrint = now;
- }
-#endif
- pClient = clients[best];
- SmartLastIndex[bestPrio-SMART_MIN_PRIORITY] = pClient->index;
- /*
- * Set current client pointer
- */
- if (SmartLastClient != pClient)
- {
- pClient->smart_start_tick = now;
- SmartLastClient = pClient;
- }
- /*
- * Adjust slice
- */
- if (nready == 1)
- {
- /*
- * If it's been a long time since another client
- * has run, bump the slice up to get maximal
- * performance from a single client
- */
- if ((now - pClient->smart_start_tick) > 1000 &&
- SmartScheduleSlice < SmartScheduleMaxSlice)
- {
- SmartScheduleSlice += SmartScheduleInterval;
- }
- }
- else
- {
- SmartScheduleSlice = SmartScheduleInterval;
- }
- return best;
-}
-#endif
-
-#define MAJOROP ((xReq *)client->requestBuffer)->reqType
-
-void
-Dispatch(void)
-{
- register int *clientReady; /* array of request ready clients */
- register int result;
- register ClientPtr client;
- register int nready;
- register HWEventQueuePtr* icheck = checkForInput;
-#ifdef SMART_SCHEDULE
- int start_tick;
-#endif
-
- nextFreeClientID = 1;
- InitSelections();
- nClients = 0;
-
- clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
- if (!clientReady)
- return;
-
- while (!dispatchException)
- {
- if (*icheck[0] != *icheck[1])
- {
- ProcessInputEvents();
- FlushIfCriticalOutputPending();
- }
-
- nready = WaitForSomething(clientReady);
-
-#ifdef SMART_SCHEDULE
- if (nready && !SmartScheduleDisable)
- {
- clientReady[0] = SmartScheduleClient (clientReady, nready);
- nready = 1;
- }
-#endif
- /*****************
- * Handle events in round robin fashion, doing input between
- * each round
- *****************/
-
- while (!dispatchException && (--nready >= 0))
- {
- client = clients[clientReady[nready]];
- if (! client)
- {
- /* KillClient can cause this to happen */
- continue;
- }
- /* GrabServer activation can cause this to be true */
- if (grabState == GrabKickout)
- {
- grabState = GrabActive;
- break;
- }
- isItTimeToYield = FALSE;
-
- requestingClient = client;
-#ifdef SMART_SCHEDULE
- start_tick = SmartScheduleTime;
-#endif
- while (!isItTimeToYield)
- {
- if (*icheck[0] != *icheck[1])
- {
- ProcessInputEvents();
- FlushIfCriticalOutputPending();
- }
-#ifdef SMART_SCHEDULE
- if (!SmartScheduleDisable &&
- (SmartScheduleTime - start_tick) >= SmartScheduleSlice)
- {
- /* Penalize clients which consume ticks */
- if (client->smart_priority > SMART_MIN_PRIORITY)
- client->smart_priority--;
- break;
- }
-#endif
- /* now, finally, deal with client requests */
-
- result = ReadRequestFromClient(client);
- if (result <= 0)
- {
- if (result < 0)
- CloseDownClient(client);
- break;
- }
-
- client->sequence++;
-#ifdef DEBUG
- if (client->requestLogIndex == MAX_REQUEST_LOG)
- client->requestLogIndex = 0;
- client->requestLog[client->requestLogIndex] = MAJOROP;
- client->requestLogIndex++;
-#endif
- if (result > (maxBigRequestSize << 2))
- result = BadLength;
- else
- result = (* client->requestVector[MAJOROP])(client);
-
- if (result != Success)
- {
- if (client->noClientException != Success)
- CloseDownClient(client);
- else
- SendErrorToClient(client, MAJOROP,
- MinorOpcodeOfRequest(client),
- client->errorValue, result);
- break;
- }
- }
- FlushAllOutput();
-#ifdef SMART_SCHEDULE
- client = clients[clientReady[nready]];
- if (client)
- client->smart_stop_tick = SmartScheduleTime;
-#endif
- requestingClient = NULL;
- }
- dispatchException &= ~DE_PRIORITYCHANGE;
- }
- KillAllClients();
- DEALLOCATE_LOCAL(clientReady);
- dispatchException &= ~DE_RESET;
-}
-
-#undef MAJOROP
-
-/*ARGSUSED*/
-int
-ProcBadRequest(client)
- ClientPtr client;
-{
- return (BadRequest);
-}
-
-int
-ProcCreateWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pParent, pWin;
- REQUEST(xCreateWindowReq);
- int result;
- int len;
-
- REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
-
- LEGAL_NEW_RESOURCE(stuff->wid, client);
- if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client,
- SecurityWriteAccess)))
- return BadWindow;
- len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- pWin = CreateWindow(stuff->wid, pParent, stuff->x,
- stuff->y, stuff->width, stuff->height,
- stuff->borderWidth, stuff->class,
- stuff->mask, (XID *) &stuff[1],
- (int)stuff->depth,
- client, stuff->visual, &result);
- if (pWin)
- {
- Mask mask = pWin->eventMask;
-
- pWin->eventMask = 0; /* subterfuge in case AddResource fails */
- if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin))
- return BadAlloc;
- pWin->eventMask = mask;
- }
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-int
-ProcChangeWindowAttributes(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xChangeWindowAttributesReq);
- register int result;
- int len;
-
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
- if (len != Ones(stuff->valueMask))
- return BadLength;
- result = ChangeWindowAttributes(pWin,
- stuff->valueMask,
- (XID *) &stuff[1],
- client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-int
-ProcGetWindowAttributes(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
- xGetWindowAttributesReply wa;
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- GetWindowAttributes(pWin, client, &wa);
- WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa);
- return(client->noClientException);
-}
-
-int
-ProcDestroyWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityDestroyAccess);
- if (!pWin)
- return(BadWindow);
- if (pWin->parent)
- FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
-}
-
-int
-ProcDestroySubwindows(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityDestroyAccess);
- if (!pWin)
- return(BadWindow);
- DestroySubwindows(pWin, client);
- return(client->noClientException);
-}
-
-int
-ProcChangeSaveSet(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xChangeSaveSetReq);
- register int result;
-
- REQUEST_SIZE_MATCH(xChangeSaveSetReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
- return BadMatch;
- if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete))
- {
- result = AlterSaveSetForClient(client, pWin, stuff->mode);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- else
- {
- client->errorValue = stuff->mode;
- return( BadValue );
- }
-}
-
-int
-ProcReparentWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin, pParent;
- REQUEST(xReparentWindowReq);
- register int result;
-
- REQUEST_SIZE_MATCH(xReparentWindowReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client,
- SecurityWriteAccess);
- if (!pParent)
- return(BadWindow);
- if (SAME_SCREENS(pWin->drawable, pParent->drawable))
- {
- if ((pWin->backgroundState == ParentRelative) &&
- (pParent->drawable.depth != pWin->drawable.depth))
- return BadMatch;
- if ((pWin->drawable.class != InputOnly) &&
- (pParent->drawable.class == InputOnly))
- return BadMatch;
- result = ReparentWindow(pWin, pParent,
- (short)stuff->x, (short)stuff->y, client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- else
- return (BadMatch);
-}
-
-int
-ProcMapWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- MapWindow(pWin, client);
- /* update cache to say it is mapped */
- return(client->noClientException);
-}
-
-int
-ProcMapSubwindows(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- MapSubwindows(pWin, client);
- /* update cache to say it is mapped */
- return(client->noClientException);
-}
-
-int
-ProcUnmapWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- UnmapWindow(pWin, FALSE);
- /* update cache to say it is mapped */
- return(client->noClientException);
-}
-
-int
-ProcUnmapSubwindows(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- UnmapSubwindows(pWin);
- return(client->noClientException);
-}
-
-int
-ProcConfigureWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xConfigureWindowReq);
- register int result;
- int len;
-
- REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
- pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
- if (Ones((Mask)stuff->mask) != len)
- return BadLength;
- result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1],
- client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-int
-ProcCirculateWindow(client)
- register ClientPtr client;
-{
- register WindowPtr pWin;
- REQUEST(xCirculateWindowReq);
-
- REQUEST_SIZE_MATCH(xCirculateWindowReq);
- if ((stuff->direction != RaiseLowest) &&
- (stuff->direction != LowerHighest))
- {
- client->errorValue = stuff->direction;
- return BadValue;
- }
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- CirculateWindow(pWin, (int)stuff->direction, client);
- return(client->noClientException);
-}
-
-int
-GetGeometry(client, rep)
- register ClientPtr client;
- xGetGeometryReply *rep;
-{
- register DrawablePtr pDraw;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess);
- rep->type = X_Reply;
- rep->length = 0;
- rep->sequenceNumber = client->sequence;
- rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id;
- rep->depth = pDraw->depth;
- rep->width = pDraw->width;
- rep->height = pDraw->height;
-
- /* XXX - Because the pixmap-implementation of the multibuffer extension
- * may have the buffer-id's drawable resource value be a pointer
- * to the buffer's window instead of the buffer itself
- * (this happens if the buffer is the displayed buffer),
- * we also have to check that the id matches before we can
- * truly say that it is a DRAWABLE_WINDOW.
- */
-
- if ((pDraw->type == UNDRAWABLE_WINDOW) ||
- ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id)))
- {
- register WindowPtr pWin = (WindowPtr)pDraw;
- rep->x = pWin->origin.x - wBorderWidth (pWin);
- rep->y = pWin->origin.y - wBorderWidth (pWin);
- rep->borderWidth = pWin->borderWidth;
- }
- else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */
- {
- rep->x = rep->y = rep->borderWidth = 0;
- }
-
- return Success;
-}
-
-
-int
-ProcGetGeometry(client)
- register ClientPtr client;
-{
- xGetGeometryReply rep;
- int status;
-
- if ((status = GetGeometry(client, &rep)) != Success)
- return status;
-
- WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
- return(client->noClientException);
-}
-
-
-int
-ProcQueryTree(client)
- register ClientPtr client;
-{
- xQueryTreeReply reply;
- int numChildren = 0;
- register WindowPtr pChild, pWin, pHead;
- Window *childIDs = (Window *)NULL;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- reply.type = X_Reply;
- reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id;
- reply.sequenceNumber = client->sequence;
- if (pWin->parent)
- reply.parent = pWin->parent->drawable.id;
- else
- reply.parent = (Window)None;
- pHead = RealChildHead(pWin);
- for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
- numChildren++;
- if (numChildren)
- {
- int curChild = 0;
-
- childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window));
- if (!childIDs)
- return BadAlloc;
- for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
- childIDs[curChild++] = pChild->drawable.id;
- }
-
- reply.nChildren = numChildren;
- reply.length = (numChildren * sizeof(Window)) >> 2;
-
- WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply);
- if (numChildren)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
- DEALLOCATE_LOCAL(childIDs);
- }
-
- return(client->noClientException);
-}
-
-int
-ProcInternAtom(client)
- register ClientPtr client;
-{
- Atom atom;
- char *tchar;
- REQUEST(xInternAtomReq);
-
- REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes);
- if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse))
- {
- client->errorValue = stuff->onlyIfExists;
- return(BadValue);
- }
- tchar = (char *) &stuff[1];
- atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
- if (atom != BAD_RESOURCE)
- {
- xInternAtomReply reply;
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.atom = atom;
- WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
- return(client->noClientException);
- }
- else
- return (BadAlloc);
-}
-
-int
-ProcGetAtomName(client)
- register ClientPtr client;
-{
- char *str;
- xGetAtomNameReply reply;
- int len;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- if ( (str = NameForAtom(stuff->id)) )
- {
- len = strlen(str);
- reply.type = X_Reply;
- reply.length = (len + 3) >> 2;
- reply.sequenceNumber = client->sequence;
- reply.nameLength = len;
- WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
- (void)WriteToClient(client, len, str);
- return(client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadAtom);
- }
-}
-
-#ifdef K5AUTH
-extern int k5_bad();
-#endif
-
-int
-ProcSetSelectionOwner(client)
- register ClientPtr client;
-{
- WindowPtr pWin;
- TimeStamp time;
- REQUEST(xSetSelectionOwnerReq);
-
- REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
- UpdateCurrentTime();
- time = ClientTimeToServerTime(stuff->time);
-
- /* If the client's time stamp is in the future relative to the server's
- time stamp, do not set the selection, just return success. */
- if (CompareTimeStamps(time, currentTime) == LATER)
- return Success;
- if (stuff->window != None)
- {
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- }
- else
- pWin = (WindowPtr)None;
- if (ValidAtom(stuff->selection))
- {
- int i = 0;
-
- /*
- * First, see if the selection is already set...
- */
- while ((i < NumCurrentSelections) &&
- CurrentSelections[i].selection != stuff->selection)
- i++;
- if (i < NumCurrentSelections)
- {
- xEvent event;
-
- /* If the timestamp in client's request is in the past relative
- to the time stamp indicating the last time the owner of the
- selection was set, do not set the selection, just return
- success. */
- if (CompareTimeStamps(time, CurrentSelections[i].lastTimeChanged)
- == EARLIER)
- return Success;
- if (CurrentSelections[i].client &&
- (!pWin || (CurrentSelections[i].client != client)))
- {
- event.u.u.type = SelectionClear;
- event.u.selectionClear.time = time.milliseconds;
- event.u.selectionClear.window = CurrentSelections[i].window;
- event.u.selectionClear.atom = CurrentSelections[i].selection;
- (void) TryClientEvents (CurrentSelections[i].client, &event, 1,
- NoEventMask, NoEventMask /* CantBeFiltered */,
- NullGrab);
- }
- }
- else
- {
- /*
- * It doesn't exist, so add it...
- */
- Selection *newsels;
-
- if (i == 0)
- newsels = (Selection *)xalloc(sizeof(Selection));
- else
- newsels = (Selection *)xrealloc(CurrentSelections,
- (NumCurrentSelections + 1) * sizeof(Selection));
- if (!newsels)
- return BadAlloc;
- NumCurrentSelections++;
- CurrentSelections = newsels;
- CurrentSelections[i].selection = stuff->selection;
- }
- CurrentSelections[i].lastTimeChanged = time;
- CurrentSelections[i].window = stuff->window;
- CurrentSelections[i].pWin = pWin;
- CurrentSelections[i].client = (pWin ? client : NullClient);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->selection;
- return (BadAtom);
- }
-}
-
-int
-ProcGetSelectionOwner(client)
- register ClientPtr client;
-{
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- if (ValidAtom(stuff->id))
- {
- int i;
- xGetSelectionOwnerReply reply;
-
- i = 0;
- while ((i < NumCurrentSelections) &&
- CurrentSelections[i].selection != stuff->id) i++;
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- if (i < NumCurrentSelections)
- reply.owner = CurrentSelections[i].window;
- else
- reply.owner = None;
- WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
- return(client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadAtom);
- }
-}
-
-int
-ProcConvertSelection(client)
- register ClientPtr client;
-{
- Bool paramsOkay;
- xEvent event;
- WindowPtr pWin;
- REQUEST(xConvertSelectionReq);
-
- REQUEST_SIZE_MATCH(xConvertSelectionReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
-
- paramsOkay = (ValidAtom(stuff->selection) && ValidAtom(stuff->target));
- if (stuff->property != None)
- paramsOkay &= ValidAtom(stuff->property);
- if (paramsOkay)
- {
- int i;
-
- i = 0;
- while ((i < NumCurrentSelections) &&
- CurrentSelections[i].selection != stuff->selection) i++;
- if ((i < NumCurrentSelections) &&
- (CurrentSelections[i].window != None)
-#ifdef XCSECURITY
- && (!client->CheckAccess ||
- (* client->CheckAccess)(client, CurrentSelections[i].window,
- RT_WINDOW, SecurityReadAccess,
- CurrentSelections[i].pWin))
-#endif
- )
- {
- event.u.u.type = SelectionRequest;
- event.u.selectionRequest.time = stuff->time;
- event.u.selectionRequest.owner =
- CurrentSelections[i].window;
- event.u.selectionRequest.requestor = stuff->requestor;
- event.u.selectionRequest.selection = stuff->selection;
- event.u.selectionRequest.target = stuff->target;
- event.u.selectionRequest.property = stuff->property;
- if (TryClientEvents(
- CurrentSelections[i].client, &event, 1, NoEventMask,
- NoEventMask /* CantBeFiltered */, NullGrab))
- return (client->noClientException);
- }
- event.u.u.type = SelectionNotify;
- event.u.selectionNotify.time = stuff->time;
- event.u.selectionNotify.requestor = stuff->requestor;
- event.u.selectionNotify.selection = stuff->selection;
- event.u.selectionNotify.target = stuff->target;
- event.u.selectionNotify.property = None;
- (void) TryClientEvents(client, &event, 1, NoEventMask,
- NoEventMask /* CantBeFiltered */, NullGrab);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->property;
- return (BadAtom);
- }
-}
-
-int
-ProcGrabServer(client)
- register ClientPtr client;
-{
- REQUEST_SIZE_MATCH(xReq);
- if (grabState != GrabNone && client != grabClient)
- {
- ResetCurrentRequest(client);
- client->sequence--;
- BITSET(grabWaiters, client->index);
- IgnoreClient(client);
- return(client->noClientException);
- }
- OnlyListenToOneClient(client);
- grabState = GrabKickout;
- grabClient = client;
-
- if (ServerGrabCallback)
- {
- ServerGrabInfoRec grabinfo;
- grabinfo.client = client;
- grabinfo.grabstate = SERVER_GRABBED;
- CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo);
- }
-
- return(client->noClientException);
-}
-
-static void
-UngrabServer(ClientPtr client)
-{
- int i;
-
- grabState = GrabNone;
- ListenToAllClients();
- for (i = mskcnt; --i >= 0 && !grabWaiters[i]; )
- ;
- if (i >= 0)
- {
- i <<= 5;
- while (!GETBIT(grabWaiters, i))
- i++;
- BITCLEAR(grabWaiters, i);
- AttendClient(clients[i]);
- }
-
- if (ServerGrabCallback)
- {
- ServerGrabInfoRec grabinfo;
- grabinfo.client = client;
- grabinfo.grabstate = SERVER_UNGRABBED;
- CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo);
- }
-}
-
-int
-ProcUngrabServer(client)
- register ClientPtr client;
-{
- REQUEST_SIZE_MATCH(xReq);
- UngrabServer(client);
- return(client->noClientException);
-}
-
-int
-ProcTranslateCoords(client)
- register ClientPtr client;
-{
- REQUEST(xTranslateCoordsReq);
-
- register WindowPtr pWin, pDst;
- xTranslateCoordsReply rep;
-
- REQUEST_SIZE_MATCH(xTranslateCoordsReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client,
- SecurityReadAccess);
- if (!pDst)
- return(BadWindow);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (!SAME_SCREENS(pWin->drawable, pDst->drawable))
- {
- rep.sameScreen = xFalse;
- rep.child = None;
- rep.dstX = rep.dstY = 0;
- }
- else
- {
- INT16 x, y;
- rep.sameScreen = xTrue;
- rep.child = None;
- /* computing absolute coordinates -- adjust to destination later */
- x = pWin->drawable.x + stuff->srcX;
- y = pWin->drawable.y + stuff->srcY;
- pWin = pDst->firstChild;
- while (pWin)
- {
-#ifdef SHAPE
- BoxRec box;
-#endif
- if ((pWin->mapped) &&
- (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
- (x < pWin->drawable.x + (int)pWin->drawable.width +
- wBorderWidth (pWin)) &&
- (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
- (y < pWin->drawable.y + (int)pWin->drawable.height +
- wBorderWidth (pWin))
-#ifdef SHAPE
- /* When a window is shaped, a further check
- * is made to see if the point is inside
- * borderSize
- */
- && (!wBoundingShape(pWin) ||
- POINT_IN_REGION(pWin->drawable.pScreen,
- &pWin->borderSize, x, y, &box))
-#endif
- )
- {
- rep.child = pWin->drawable.id;
- pWin = (WindowPtr) NULL;
- }
- else
- pWin = pWin->nextSib;
- }
- /* adjust to destination coordinates */
- rep.dstX = x - pDst->drawable.x;
- rep.dstY = y - pDst->drawable.y;
- }
- WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
- return(client->noClientException);
-}
-
-int
-ProcOpenFont(client)
- register ClientPtr client;
-{
- int err;
- REQUEST(xOpenFontReq);
-
- REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes);
- client->errorValue = stuff->fid;
- LEGAL_NEW_RESOURCE(stuff->fid, client);
- err = OpenFont(client, stuff->fid, (Mask) 0,
- stuff->nbytes, (char *)&stuff[1]);
- if (err == Success)
- {
- return(client->noClientException);
- }
- else
- return err;
-}
-
-int
-ProcCloseFont(client)
- register ClientPtr client;
-{
- FontPtr pFont;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
- SecurityDestroyAccess);
- if ( pFont != (FontPtr)NULL) /* id was valid */
- {
- FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadFont);
- }
-}
-
-int
-ProcQueryFont(client)
- register ClientPtr client;
-{
- xQueryFontReply *reply;
- FontPtr pFont;
- register GC *pGC;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- client->errorValue = stuff->id; /* EITHER font or gc */
- pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
- SecurityReadAccess);
- if (!pFont)
- {
- /* can't use VERIFY_GC because it might return BadGC */
- pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
- SecurityReadAccess);
- if (!pGC)
- {
- client->errorValue = stuff->id;
- return(BadFont); /* procotol spec says only error is BadFont */
- }
- pFont = pGC->font;
- }
-
- {
- xCharInfo *pmax = FONTINKMAX(pFont);
- xCharInfo *pmin = FONTINKMIN(pFont);
- int nprotoxcistructs;
- int rlength;
-
- nprotoxcistructs = (
- pmax->rightSideBearing == pmin->rightSideBearing &&
- pmax->leftSideBearing == pmin->leftSideBearing &&
- pmax->descent == pmin->descent &&
- pmax->ascent == pmin->ascent &&
- pmax->characterWidth == pmin->characterWidth) ?
- 0 : N2dChars(pFont);
-
- rlength = sizeof(xQueryFontReply) +
- FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
- nprotoxcistructs * sizeof(xCharInfo);
- reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength);
- if(!reply)
- {
- return(BadAlloc);
- }
-
- reply->type = X_Reply;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
- reply->sequenceNumber = client->sequence;
- QueryFont( pFont, reply, nprotoxcistructs);
-
- WriteReplyToClient(client, rlength, reply);
- DEALLOCATE_LOCAL(reply);
- return(client->noClientException);
- }
-}
-
-int
-ProcQueryTextExtents(client)
- register ClientPtr client;
-{
- REQUEST(xQueryTextExtentsReq);
- xQueryTextExtentsReply reply;
- FontPtr pFont;
- GC *pGC;
- ExtentInfoRec info;
- unsigned long length;
-
- REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq);
-
- pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT,
- SecurityReadAccess);
- if (!pFont)
- {
- pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC,
- SecurityReadAccess);
- if (!pGC)
- {
- client->errorValue = stuff->fid;
- return(BadFont);
- }
- pFont = pGC->font;
- }
- length = client->req_len - (sizeof(xQueryTextExtentsReq) >> 2);
- length = length << 1;
- if (stuff->oddLength)
- {
- if (length == 0)
- return(BadLength);
- length--;
- }
- if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info))
- return(BadAlloc);
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.drawDirection = info.drawDirection;
- reply.fontAscent = info.fontAscent;
- reply.fontDescent = info.fontDescent;
- reply.overallAscent = info.overallAscent;
- reply.overallDescent = info.overallDescent;
- reply.overallWidth = info.overallWidth;
- reply.overallLeft = info.overallLeft;
- reply.overallRight = info.overallRight;
- WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
- return(client->noClientException);
-}
-
-int
-ProcListFonts(client)
- register ClientPtr client;
-{
- REQUEST(xListFontsReq);
-
- REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes);
-
- return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes,
- stuff->maxNames);
-}
-
-int
-ProcListFontsWithInfo(client)
- register ClientPtr client;
-{
- REQUEST(xListFontsWithInfoReq);
-
- REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes);
-
- return StartListFontsWithInfo(client, stuff->nbytes,
- (unsigned char *) &stuff[1], stuff->maxNames);
-}
-
-/*ARGSUSED*/
-int
-dixDestroyPixmap(value, pid)
- pointer value; /* must conform to DeleteType */
- XID pid;
-{
- PixmapPtr pPixmap = (PixmapPtr)value;
- return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
-}
-
-int
-ProcCreatePixmap(client)
- register ClientPtr client;
-{
- PixmapPtr pMap;
- register DrawablePtr pDraw;
- REQUEST(xCreatePixmapReq);
- DepthPtr pDepth;
- register int i;
-
- REQUEST_SIZE_MATCH(xCreatePixmapReq);
- client->errorValue = stuff->pid;
- LEGAL_NEW_RESOURCE(stuff->pid, client);
- SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client,
- SecurityReadAccess);
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- if (stuff->depth != 1)
- {
- pDepth = pDraw->pScreen->allowedDepths;
- for (i=0; i<pDraw->pScreen->numDepths; i++, pDepth++)
- if (pDepth->depth == stuff->depth)
- goto CreatePmap;
- client->errorValue = stuff->depth;
- return BadValue;
- }
-CreatePmap:
- pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, stuff->width,
- stuff->height, stuff->depth);
- if (pMap)
- {
- pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pMap->drawable.id = stuff->pid;
- if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
- return(client->noClientException);
- }
- return (BadAlloc);
-}
-
-int
-ProcFreePixmap(client)
- register ClientPtr client;
-{
- PixmapPtr pMap;
-
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP,
- SecurityDestroyAccess);
- if (pMap)
- {
- FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadPixmap);
- }
-}
-
-int
-ProcCreateGC(client)
- register ClientPtr client;
-{
- int error;
- GC *pGC;
- register DrawablePtr pDraw;
- unsigned len;
- REQUEST(xCreateGCReq);
-
- REQUEST_AT_LEAST_SIZE(xCreateGCReq);
- client->errorValue = stuff->gc;
- LEGAL_NEW_RESOURCE(stuff->gc, client);
- SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client,
- SecurityReadAccess);
- len = client->req_len - (sizeof(xCreateGCReq) >> 2);
- if (len != Ones(stuff->mask))
- return BadLength;
- pGC = (GC *)CreateGC(pDraw, stuff->mask,
- (XID *) &stuff[1], &error);
- if (error != Success)
- return error;
- if (!AddResource(stuff->gc, RT_GC, (pointer)pGC))
- return (BadAlloc);
- return(client->noClientException);
-}
-
-int
-ProcChangeGC(client)
- register ClientPtr client;
-{
- GC *pGC;
- REQUEST(xChangeGCReq);
- int result;
- unsigned len;
-
- REQUEST_AT_LEAST_SIZE(xChangeGCReq);
- SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess);
- len = client->req_len - (sizeof(xChangeGCReq) >> 2);
- if (len != Ones(stuff->mask))
- return BadLength;
-
- result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return(result);
- }
-}
-
-int
-ProcCopyGC(client)
- register ClientPtr client;
-{
- register GC *dstGC;
- register GC *pGC;
- int result;
- REQUEST(xCopyGCReq);
-
- REQUEST_SIZE_MATCH(xCopyGCReq);
- SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess);
- SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess);
- if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth))
- return (BadMatch);
- result = CopyGC(pGC, dstGC, stuff->mask);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return(result);
- }
-}
-
-int
-ProcSetDashes(client)
- register ClientPtr client;
-{
- register GC *pGC;
- int result;
- REQUEST(xSetDashesReq);
-
- REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes);
- if (stuff->nDashes == 0)
- {
- client->errorValue = 0;
- return BadValue;
- }
-
- SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess);
-
- result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes,
- (unsigned char *)&stuff[1]);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return(result);
- }
-}
-
-int
-ProcSetClipRectangles(client)
- register ClientPtr client;
-{
- int nr;
- int result;
- register GC *pGC;
- REQUEST(xSetClipRectanglesReq);
-
- REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
- if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) &&
- (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded))
- {
- client->errorValue = stuff->ordering;
- return BadValue;
- }
- SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess);
-
- nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq);
- if (nr & 4)
- return(BadLength);
- nr >>= 3;
- result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin,
- nr, (xRectangle *)&stuff[1], (int)stuff->ordering);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-int
-ProcFreeGC(client)
- register ClientPtr client;
-{
- register GC *pGC;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess);
- FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
-}
-
-int
-ProcClearToBackground(client)
- register ClientPtr client;
-{
- REQUEST(xClearAreaReq);
- register WindowPtr pWin;
-
- REQUEST_SIZE_MATCH(xClearAreaReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (pWin->drawable.class == InputOnly)
- {
- client->errorValue = stuff->window;
- return (BadMatch);
- }
- if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse))
- {
- client->errorValue = stuff->exposures;
- return(BadValue);
- }
- (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y,
- stuff->width, stuff->height,
- (Bool)stuff->exposures);
- return(client->noClientException);
-}
-
-int
-ProcCopyArea(client)
- register ClientPtr client;
-{
- register DrawablePtr pDst;
- register DrawablePtr pSrc;
- register GC *pGC;
- REQUEST(xCopyAreaReq);
- RegionPtr pRgn;
-
- REQUEST_SIZE_MATCH(xCopyAreaReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
- if (stuff->dstDrawable != stuff->srcDrawable)
- {
- SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
- SecurityReadAccess);
- if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth))
- {
- client->errorValue = stuff->dstDrawable;
- return (BadMatch);
- }
- }
- else
- pSrc = pDst;
-
- SET_DBE_SRCBUF(pSrc, stuff->srcDrawable);
-
- pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY);
- if (pGC->graphicsExposures)
- {
- (*pDst->pScreen->SendGraphicsExpose)
- (client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
- if (pRgn)
- REGION_DESTROY(pDst->pScreen, pRgn);
- }
-
- return(client->noClientException);
-}
-
-int
-ProcCopyPlane(client)
- register ClientPtr client;
-{
- register DrawablePtr psrcDraw, pdstDraw;
- register GC *pGC;
- REQUEST(xCopyPlaneReq);
- RegionPtr pRgn;
-
- REQUEST_SIZE_MATCH(xCopyPlaneReq);
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
- if (stuff->dstDrawable != stuff->srcDrawable)
- {
- SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
- SecurityReadAccess);
- if (pdstDraw->pScreen != psrcDraw->pScreen)
- {
- client->errorValue = stuff->dstDrawable;
- return (BadMatch);
- }
- }
- else
- psrcDraw = pdstDraw;
-
- SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable);
-
- /* Check to see if stuff->bitPlane has exactly ONE good bit set */
- if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
- (stuff->bitPlane > (1L << (psrcDraw->depth - 1))))
- {
- client->errorValue = stuff->bitPlane;
- return(BadValue);
- }
-
- pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY, stuff->bitPlane);
- if (pGC->graphicsExposures)
- {
- (*pdstDraw->pScreen->SendGraphicsExpose)
- (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
- if (pRgn)
- REGION_DESTROY(pdstDraw->pScreen, pRgn);
- }
- return(client->noClientException);
-}
-
-int
-ProcPolyPoint(client)
- register ClientPtr client;
-{
- int npoint;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyPointReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyPointReq);
- if ((stuff->coordMode != CoordModeOrigin) &&
- (stuff->coordMode != CoordModePrevious))
- {
- client->errorValue = stuff->coordMode;
- return BadValue;
- }
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
- if (npoint)
- (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint,
- (xPoint *) &stuff[1]);
- return (client->noClientException);
-}
-
-int
-ProcPolyLine(client)
- register ClientPtr client;
-{
- int npoint;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyLineReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyLineReq);
- if ((stuff->coordMode != CoordModeOrigin) &&
- (stuff->coordMode != CoordModePrevious))
- {
- client->errorValue = stuff->coordMode;
- return BadValue;
- }
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
- if (npoint > 1)
- (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint,
- (DDXPointPtr) &stuff[1]);
- return(client->noClientException);
-}
-
-int
-ProcPolySegment(client)
- register ClientPtr client;
-{
- int nsegs;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolySegmentReq);
-
- REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
- if (nsegs & 4)
- return(BadLength);
- nsegs >>= 3;
- if (nsegs)
- (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]);
- return (client->noClientException);
-}
-
-int
-ProcPolyRectangle (client)
- register ClientPtr client;
-{
- int nrects;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyRectangleReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyRectangleReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
- if (nrects & 4)
- return(BadLength);
- nrects >>= 3;
- if (nrects)
- (*pGC->ops->PolyRectangle)(pDraw, pGC,
- nrects, (xRectangle *) &stuff[1]);
- return(client->noClientException);
-}
-
-int
-ProcPolyArc(client)
- register ClientPtr client;
-{
- int narcs;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyArcReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyArcReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
- if (narcs % sizeof(xArc))
- return(BadLength);
- narcs /= sizeof(xArc);
- if (narcs)
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]);
- return (client->noClientException);
-}
-
-int
-ProcFillPoly(client)
- register ClientPtr client;
-{
- int things;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xFillPolyReq);
-
- REQUEST_AT_LEAST_SIZE(xFillPolyReq);
- if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) &&
- (stuff->shape != Convex))
- {
- client->errorValue = stuff->shape;
- return BadValue;
- }
- if ((stuff->coordMode != CoordModeOrigin) &&
- (stuff->coordMode != CoordModePrevious))
- {
- client->errorValue = stuff->coordMode;
- return BadValue;
- }
-
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
- if (things)
- (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
- stuff->coordMode, things,
- (DDXPointPtr) &stuff[1]);
- return(client->noClientException);
-}
-
-int
-ProcPolyFillRectangle(client)
- register ClientPtr client;
-{
- int things;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyFillRectangleReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
- if (things & 4)
- return(BadLength);
- things >>= 3;
-
- if (things)
- (*pGC->ops->PolyFillRect) (pDraw, pGC, things,
- (xRectangle *) &stuff[1]);
- return (client->noClientException);
-}
-
-int
-ProcPolyFillArc(client)
- register ClientPtr client;
-{
- int narcs;
- register GC *pGC;
- register DrawablePtr pDraw;
- REQUEST(xPolyFillArcReq);
-
- REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
- if (narcs % sizeof(xArc))
- return(BadLength);
- narcs /= sizeof(xArc);
- if (narcs)
- (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]);
- return (client->noClientException);
-}
-
-#ifdef MATCH_CLIENT_ENDIAN
-
-int
-ServerOrder (void)
-{
- int whichbyte = 1;
-
- if (*((char *) &whichbyte))
- return LSBFirst;
- return MSBFirst;
-}
-
-#define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder())
-
-void
-ReformatImage (char *base, int nbytes, int bpp, int order)
-{
- switch (bpp) {
- case 1: /* yuck */
- if (BITMAP_BIT_ORDER != order)
- BitOrderInvert ((unsigned char *) base, nbytes);
-#if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8
- ReformatImage (base, nbytes, BITMAP_SCANLINE_UNIT, order);
-#endif
- break;
- case 4:
- break; /* yuck */
- case 8:
- break;
- case 16:
- if (IMAGE_BYTE_ORDER != order)
- TwoByteSwap ((unsigned char *) base, nbytes);
- break;
- case 32:
- if (IMAGE_BYTE_ORDER != order)
- FourByteSwap ((unsigned char *) base, nbytes);
- break;
- }
-}
-#else
-#define ReformatImage(b,n,bpp,o)
-#endif
-
-/* 64-bit server notes: the protocol restricts padding of images to
- * 8-, 16-, or 32-bits. We would like to have 64-bits for the server
- * to use internally. Removes need for internal alignment checking.
- * All of the PutImage functions could be changed individually, but
- * as currently written, they call other routines which require things
- * to be 64-bit padded on scanlines, so we changed things here.
- * If an image would be padded differently for 64- versus 32-, then
- * copy each scanline to a 64-bit padded scanline.
- * Also, we need to make sure that the image is aligned on a 64-bit
- * boundary, even if the scanlines are padded to our satisfaction.
- */
-int
-ProcPutImage(client)
- register ClientPtr client;
-{
- register GC *pGC;
- register DrawablePtr pDraw;
- long length; /* length of scanline server padded */
- long lengthProto; /* length of scanline protocol padded */
- char *tmpImage;
- REQUEST(xPutImageReq);
-
- REQUEST_AT_LEAST_SIZE(xPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
- if (stuff->format == XYBitmap)
- {
- if ((stuff->depth != 1) ||
- (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad))
- return BadMatch;
- length = BitmapBytePad(stuff->width + stuff->leftPad);
- }
- else if (stuff->format == XYPixmap)
- {
- if ((pDraw->depth != stuff->depth) ||
- (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad))
- return BadMatch;
- length = BitmapBytePad(stuff->width + stuff->leftPad);
- length *= stuff->depth;
- }
- else if (stuff->format == ZPixmap)
- {
- if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0))
- return BadMatch;
- length = PixmapBytePad(stuff->width, stuff->depth);
- }
- else
- {
- client->errorValue = stuff->format;
- return BadValue;
- }
-
- tmpImage = (char *)&stuff[1];
- lengthProto = length;
-
- if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) +
- (sizeof(xPutImageReq) >> 2)) != client->req_len)
- return BadLength;
-
- ReformatImage (tmpImage, lengthProto * stuff->height,
- stuff->format == ZPixmap ? BitsPerPixel (stuff->depth) : 1,
- ClientOrder(client));
-
- (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY,
- stuff->width, stuff->height,
- stuff->leftPad, stuff->format, tmpImage);
-
- return (client->noClientException);
-}
-
-
-int
-DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return)
- register ClientPtr client;
- Drawable drawable;
- int format;
- int x, y, width, height;
- Mask planemask;
- xGetImageReply **im_return;
-{
- register DrawablePtr pDraw;
- int nlines, linesPerBuf;
- register int linesDone;
- long widthBytesLine, length;
- Mask plane = 0;
- char *pBuf;
- xGetImageReply xgi;
- RegionPtr pVisibleRegion = NULL;
-
- if ((format != XYPixmap) && (format != ZPixmap))
- {
- client->errorValue = format;
- return(BadValue);
- }
- SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess);
- if(pDraw->type == DRAWABLE_WINDOW)
- {
- if( /* check for being viewable */
- !((WindowPtr) pDraw)->realized ||
- /* check for being on screen */
- pDraw->x + x < 0 ||
- pDraw->x + x + width > pDraw->pScreen->width ||
- pDraw->y + y < 0 ||
- pDraw->y + y + height > pDraw->pScreen->height ||
- /* check for being inside of border */
- x < - wBorderWidth((WindowPtr)pDraw) ||
- x + width > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- y < -wBorderWidth((WindowPtr)pDraw) ||
- y + height > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height
- )
- return(BadMatch);
- xgi.visual = wVisual (((WindowPtr) pDraw));
- }
- else
- {
- if(x < 0 ||
- x+width > (int)pDraw->width ||
- y < 0 ||
- y+height > (int)pDraw->height
- )
- return(BadMatch);
- xgi.visual = None;
- }
-
- SET_DBE_SRCBUF(pDraw, drawable);
-
- xgi.type = X_Reply;
- xgi.sequenceNumber = client->sequence;
- xgi.depth = pDraw->depth;
- if(format == ZPixmap)
- {
- widthBytesLine = PixmapBytePad(width, pDraw->depth);
- length = widthBytesLine * height;
-
- }
- else
- {
- widthBytesLine = BitmapBytePad(width);
- plane = ((Mask)1) << (pDraw->depth - 1);
- /* only planes asked for */
- length = widthBytesLine * height *
- Ones(planemask & (plane | (plane - 1)));
-
- }
-
- xgi.length = length;
-
- if (im_return) {
- pBuf = (char *)xalloc(sz_xGetImageReply + length);
- if (!pBuf)
- return (BadAlloc);
- if (widthBytesLine == 0)
- linesPerBuf = 0;
- else
- linesPerBuf = height;
- *im_return = (xGetImageReply *)pBuf;
- *(xGetImageReply *)pBuf = xgi;
- pBuf += sz_xGetImageReply;
- } else {
- xgi.length = (xgi.length + 3) >> 2;
- if (widthBytesLine == 0 || height == 0)
- linesPerBuf = 0;
- else if (widthBytesLine >= IMAGE_BUFSIZE)
- linesPerBuf = 1;
- else
- {
- linesPerBuf = IMAGE_BUFSIZE / widthBytesLine;
- if (linesPerBuf > height)
- linesPerBuf = height;
- }
- length = linesPerBuf * widthBytesLine;
- if (linesPerBuf < height)
- {
- /* we have to make sure intermediate buffers don't need padding */
- while ((linesPerBuf > 1) &&
- (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1)))
- {
- linesPerBuf--;
- length -= widthBytesLine;
- }
- while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1))
- {
- linesPerBuf++;
- length += widthBytesLine;
- }
- }
- if(!(pBuf = (char *) ALLOCATE_LOCAL(length)))
- return (BadAlloc);
- WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
- }
-
-#ifdef XCSECURITY
- if (client->trustLevel != XSecurityClientTrusted &&
- pDraw->type == DRAWABLE_WINDOW)
- {
- pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
- if (pVisibleRegion)
- {
- REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y);
- }
- }
-#endif
-
- if (linesPerBuf == 0)
- {
- /* nothing to do */
- }
- else if (format == ZPixmap)
- {
- linesDone = 0;
- while (height - linesDone > 0)
- {
- nlines = min(linesPerBuf, height - linesDone);
- (*pDraw->pScreen->GetImage) (pDraw,
- x,
- y + linesDone,
- width,
- nlines,
- format,
- planemask,
- (pointer) pBuf);
-#ifdef XCSECURITY
- if (pVisibleRegion)
- SecurityCensorImage(client, pVisibleRegion, widthBytesLine,
- pDraw, x, y + linesDone, width,
- nlines, format, pBuf);
-#endif
-
- /* Note that this is NOT a call to WriteSwappedDataToClient,
- as we do NOT byte swap */
- if (!im_return)
- {
- ReformatImage (pBuf, (int)(nlines * widthBytesLine),
- BitsPerPixel (pDraw->depth),
- ClientOrder(client));
-
-/* Don't split me, gcc pukes when you do */
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
- }
- linesDone += nlines;
- }
- }
- else /* XYPixmap */
- {
- for (; plane; plane >>= 1)
- {
- if (planemask & plane)
- {
- linesDone = 0;
- while (height - linesDone > 0)
- {
- nlines = min(linesPerBuf, height - linesDone);
- (*pDraw->pScreen->GetImage) (pDraw,
- x,
- y + linesDone,
- width,
- nlines,
- format,
- plane,
- (pointer)pBuf);
-#ifdef XCSECURITY
- if (pVisibleRegion)
- SecurityCensorImage(client, pVisibleRegion,
- widthBytesLine,
- pDraw, x, y + linesDone, width,
- nlines, format, pBuf);
-#endif
-
- /* Note: NOT a call to WriteSwappedDataToClient,
- as we do NOT byte swap */
- if (im_return) {
- pBuf += nlines * widthBytesLine;
- } else {
- ReformatImage (pBuf,
- (int)(nlines * widthBytesLine),
- 1,
- ClientOrder (client));
-
-/* Don't split me, gcc pukes when you do */
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
- }
- linesDone += nlines;
- }
- }
- }
- }
-#ifdef XCSECURITY
- if (pVisibleRegion)
- REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
-#endif
- if (!im_return)
- DEALLOCATE_LOCAL(pBuf);
- return (client->noClientException);
-}
-
-int
-ProcGetImage(client)
- register ClientPtr client;
-{
- REQUEST(xGetImageReq);
-
- REQUEST_SIZE_MATCH(xGetImageReq);
-
- return DoGetImage(client, stuff->format, stuff->drawable,
- stuff->x, stuff->y,
- (int)stuff->width, (int)stuff->height,
- stuff->planeMask, (xGetImageReply **)NULL);
-}
-
-int
-ProcPolyText(client)
- register ClientPtr client;
-{
- int err;
- REQUEST(xPolyTextReq);
- DrawablePtr pDraw;
- GC *pGC;
-
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- err = PolyText(client,
- pDraw,
- pGC,
- (unsigned char *)&stuff[1],
- ((unsigned char *) stuff) + (client->req_len << 2),
- stuff->x,
- stuff->y,
- stuff->reqType,
- stuff->drawable);
-
- if (err == Success)
- {
- return(client->noClientException);
- }
- else
- return err;
-}
-
-int
-ProcImageText8(client)
- register ClientPtr client;
-{
- int err;
- register DrawablePtr pDraw;
- register GC *pGC;
-
- REQUEST(xImageTextReq);
-
- REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- err = ImageText(client,
- pDraw,
- pGC,
- stuff->nChars,
- (unsigned char *)&stuff[1],
- stuff->x,
- stuff->y,
- stuff->reqType,
- stuff->drawable);
-
- if (err == Success)
- {
- return(client->noClientException);
- }
- else
- return err;
-}
-
-int
-ProcImageText16(client)
- register ClientPtr client;
-{
- int err;
- register DrawablePtr pDraw;
- register GC *pGC;
-
- REQUEST(xImageTextReq);
-
- REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
-
- err = ImageText(client,
- pDraw,
- pGC,
- stuff->nChars,
- (unsigned char *)&stuff[1],
- stuff->x,
- stuff->y,
- stuff->reqType,
- stuff->drawable);
-
- if (err == Success)
- {
- return(client->noClientException);
- }
- else
- return err;
-}
-
-
-int
-ProcCreateColormap(client)
- register ClientPtr client;
-{
- VisualPtr pVisual;
- ColormapPtr pmap;
- Colormap mid;
- register WindowPtr pWin;
- ScreenPtr pScreen;
- REQUEST(xCreateColormapReq);
- int i, result;
-
- REQUEST_SIZE_MATCH(xCreateColormapReq);
-
- if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll))
- {
- client->errorValue = stuff->alloc;
- return(BadValue);
- }
- mid = stuff->mid;
- LEGAL_NEW_RESOURCE(mid, client);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
-
- pScreen = pWin->drawable.pScreen;
- for (i = 0, pVisual = pScreen->visuals;
- i < pScreen->numVisuals;
- i++, pVisual++)
- {
- if (pVisual->vid != stuff->visual)
- continue;
- result = CreateColormap(mid, pScreen, pVisual, &pmap,
- (int)stuff->alloc, client->index);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- client->errorValue = stuff->visual;
- return(BadValue);
-}
-
-int
-ProcFreeColormap(client)
- register ClientPtr client;
-{
- ColormapPtr pmap;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP,
- SecurityDestroyAccess);
- if (pmap)
- {
- /* Freeing a default colormap is a no-op */
- if (!(pmap->flags & IsDefault))
- FreeResource(stuff->id, RT_NONE);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadColor);
- }
-}
-
-
-int
-ProcCopyColormapAndFree(client)
- register ClientPtr client;
-{
- Colormap mid;
- ColormapPtr pSrcMap;
- REQUEST(xCopyColormapAndFreeReq);
- int result;
-
- REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
- mid = stuff->mid;
- LEGAL_NEW_RESOURCE(mid, client);
- if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap,
- RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) )
- {
- result = CopyColormapAndFree(mid, pSrcMap, client->index);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- else
- {
- client->errorValue = stuff->srcCmap;
- return(BadColor);
- }
-}
-
-int
-ProcInstallColormap(client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id,
- RT_COLORMAP, SecurityReadAccess);
- if (pcmp)
- {
- (*(pcmp->pScreen->InstallColormap)) (pcmp);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadColor);
- }
-}
-
-int
-ProcUninstallColormap(client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id,
- RT_COLORMAP, SecurityReadAccess);
- if (pcmp)
- {
- if(pcmp->mid != pcmp->pScreen->defColormap)
- (*(pcmp->pScreen->UninstallColormap)) (pcmp);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadColor);
- }
-}
-
-int
-ProcListInstalledColormaps(client)
- register ClientPtr client;
-{
- xListInstalledColormapsReply *preply;
- int nummaps;
- WindowPtr pWin;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
-
- if (!pWin)
- return(BadWindow);
-
- preply = (xListInstalledColormapsReply *)
- ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
- pWin->drawable.pScreen->maxInstalledCmaps *
- sizeof(Colormap));
- if(!preply)
- return(BadAlloc);
-
- preply->type = X_Reply;
- preply->sequenceNumber = client->sequence;
- nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
- (pWin->drawable.pScreen, (Colormap *)&preply[1]);
- preply->nColormaps = nummaps;
- preply->length = nummaps;
- WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
- DEALLOCATE_LOCAL(preply);
- return(client->noClientException);
-}
-
-int
-ProcAllocColor(client)
- register ClientPtr client;
-{
- ColormapPtr pmap;
- int retval;
- xAllocColorReply acr;
- REQUEST(xAllocColorReq);
-
- REQUEST_SIZE_MATCH(xAllocColorReq);
- pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pmap)
- {
-#ifdef LBX
- /*
- * If the colormap is grabbed by a proxy, the server will have
- * to regain control over the colormap. This AllocColor request
- * will be handled after the server gets back the colormap control.
- */
- if (LbxCheckColorRequest (client, pmap, (xReq *) stuff))
- return Success;
-#endif
- acr.type = X_Reply;
- acr.length = 0;
- acr.sequenceNumber = client->sequence;
- acr.red = stuff->red;
- acr.green = stuff->green;
- acr.blue = stuff->blue;
- acr.pixel = 0;
- if( (retval = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
- &acr.pixel, client->index)) )
- {
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return (retval);
- }
-#ifdef PANORAMIX
- if (noPanoramiXExtension || !pmap->pScreen->myNum)
-#endif
- WriteReplyToClient(client, sizeof(xAllocColorReply), &acr);
- return (client->noClientException);
-
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcAllocNamedColor (client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xAllocNamedColorReq);
-
- REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- int retval;
-
- xAllocNamedColorReply ancr;
-
-#ifdef LBX
- /*
- * If the colormap is grabbed by a proxy, the server will have
- * to regain control over the colormap. This AllocNamedColor request
- * will be handled after the server gets back the colormap control.
- */
- if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff))
- return Success;
-#endif
- ancr.type = X_Reply;
- ancr.length = 0;
- ancr.sequenceNumber = client->sequence;
-
- if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes,
- &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue))
- {
- ancr.screenRed = ancr.exactRed;
- ancr.screenGreen = ancr.exactGreen;
- ancr.screenBlue = ancr.exactBlue;
- ancr.pixel = 0;
- if( (retval = AllocColor(pcmp,
- &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue,
- &ancr.pixel, client->index)) )
- {
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(retval);
- }
-#ifdef PANORAMIX
- if (noPanoramiXExtension || !pcmp->pScreen->myNum)
-#endif
- WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr);
- return (client->noClientException);
- }
- else
- return(BadName);
-
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcAllocColorCells (client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xAllocColorCellsReq);
-
- REQUEST_SIZE_MATCH(xAllocColorCellsReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- xAllocColorCellsReply accr;
- int npixels, nmasks, retval;
- long length;
- Pixel *ppixels, *pmasks;
-
-#ifdef LBX
- /*
- * If the colormap is grabbed by a proxy, the server will have
- * to regain control over the colormap. This AllocColorCells request
- * will be handled after the server gets back the colormap control.
- */
- if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff))
- return Success;
-#endif
- npixels = stuff->colors;
- if (!npixels)
- {
- client->errorValue = npixels;
- return (BadValue);
- }
- if (stuff->contiguous != xTrue && stuff->contiguous != xFalse)
- {
- client->errorValue = stuff->contiguous;
- return (BadValue);
- }
- nmasks = stuff->planes;
- length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
- if(!ppixels)
- return(BadAlloc);
- pmasks = ppixels + npixels;
-
- if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks,
- (Bool)stuff->contiguous, ppixels, pmasks)) )
- {
- DEALLOCATE_LOCAL(ppixels);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(retval);
- }
-#ifdef PANORAMIX
- if (noPanoramiXExtension || !pcmp->pScreen->myNum)
-#endif
- {
- accr.type = X_Reply;
- accr.length = length >> 2;
- accr.sequenceNumber = client->sequence;
- accr.nPixels = npixels;
- accr.nMasks = nmasks;
- WriteReplyToClient(client, sizeof (xAllocColorCellsReply), &accr);
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, length, ppixels);
- }
- DEALLOCATE_LOCAL(ppixels);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcAllocColorPlanes(client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xAllocColorPlanesReq);
-
- REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- xAllocColorPlanesReply acpr;
- int npixels, retval;
- long length;
- Pixel *ppixels;
-
-#ifdef LBX
- /*
- * If the colormap is grabbed by a proxy, the server will have
- * to regain control over the colormap. This AllocColorPlanes request
- * will be handled after the server gets back the colormap control.
- */
- if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff))
- return Success;
-#endif
- npixels = stuff->colors;
- if (!npixels)
- {
- client->errorValue = npixels;
- return (BadValue);
- }
- if (stuff->contiguous != xTrue && stuff->contiguous != xFalse)
- {
- client->errorValue = stuff->contiguous;
- return (BadValue);
- }
- acpr.type = X_Reply;
- acpr.sequenceNumber = client->sequence;
- acpr.nPixels = npixels;
- length = (long)npixels * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
- if(!ppixels)
- return(BadAlloc);
- if( (retval = AllocColorPlanes(client->index, pcmp, npixels,
- (int)stuff->red, (int)stuff->green, (int)stuff->blue,
- (Bool)stuff->contiguous, ppixels,
- &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
- {
- DEALLOCATE_LOCAL(ppixels);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(retval);
- }
- acpr.length = length >> 2;
-#ifdef PANORAMIX
- if (noPanoramiXExtension || !pcmp->pScreen->myNum)
-#endif
- {
- WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr);
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, length, ppixels);
- }
- DEALLOCATE_LOCAL(ppixels);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcFreeColors (client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xFreeColorsReq);
-
- REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- int count;
- int retval;
-
- if(pcmp->flags & AllAllocated)
- return(BadAccess);
- count = ((client->req_len << 2)- sizeof(xFreeColorsReq)) >> 2;
- retval = FreeColors(pcmp, client->index, count,
- (Pixel *)&stuff[1], (Pixel)stuff->planeMask);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return(retval);
- }
-
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcStoreColors (client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xStoreColorsReq);
-
- REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- int count;
- int retval;
-
- count = (client->req_len << 2) - sizeof(xStoreColorsReq);
- if (count % sizeof(xColorItem))
- return(BadLength);
- count /= sizeof(xColorItem);
- retval = StoreColors(pcmp, count, (xColorItem *)&stuff[1]);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return(retval);
- }
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcStoreNamedColor (client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xStoreNamedColorReq);
-
- REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityWriteAccess);
- if (pcmp)
- {
- xColorItem def;
- int retval;
-
- if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1],
- stuff->nbytes, &def.red, &def.green, &def.blue))
- {
- def.flags = stuff->flags;
- def.pixel = stuff->pixel;
- retval = StoreColors(pcmp, 1, &def);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(retval);
- }
- return (BadName);
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcQueryColors(client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xQueryColorsReq);
-
- REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityReadAccess);
- if (pcmp)
- {
- int count, retval;
- xrgb *prgbs;
- xQueryColorsReply qcr;
-
- count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
- prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb));
- if(!prgbs && count)
- return(BadAlloc);
- if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
- {
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- client->errorValue = clientErrorValue;
- return (retval);
- }
- }
- qcr.type = X_Reply;
- qcr.length = (count * sizeof(xrgb)) >> 2;
- qcr.sequenceNumber = client->sequence;
- qcr.nColors = count;
- WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr);
- if (count)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
- WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
- }
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
- return(client->noClientException);
-
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcLookupColor(client)
- register ClientPtr client;
-{
- ColormapPtr pcmp;
- REQUEST(xLookupColorReq);
-
- REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes);
- pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP, SecurityReadAccess);
- if (pcmp)
- {
- xLookupColorReply lcr;
-
- if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes,
- &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue))
- {
- lcr.type = X_Reply;
- lcr.length = 0;
- lcr.sequenceNumber = client->sequence;
- lcr.screenRed = lcr.exactRed;
- lcr.screenGreen = lcr.exactGreen;
- lcr.screenBlue = lcr.exactBlue;
- (*pcmp->pScreen->ResolveColor)(&lcr.screenRed,
- &lcr.screenGreen,
- &lcr.screenBlue,
- pcmp->pVisual);
- WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
- return(client->noClientException);
- }
- return (BadName);
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-int
-ProcCreateCursor( client)
- register ClientPtr client;
-{
- CursorPtr pCursor;
-
- register PixmapPtr src;
- register PixmapPtr msk;
- unsigned char * srcbits;
- unsigned char * mskbits;
- unsigned short width, height;
- long n;
- CursorMetricRec cm;
-
-
- REQUEST(xCreateCursorReq);
-
- REQUEST_SIZE_MATCH(xCreateCursorReq);
- LEGAL_NEW_RESOURCE(stuff->cid, client);
-
- src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source,
- RT_PIXMAP, SecurityReadAccess);
- msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask,
- RT_PIXMAP, SecurityReadAccess);
- if ( src == (PixmapPtr)NULL)
- {
- client->errorValue = stuff->source;
- return (BadPixmap);
- }
- if ( msk == (PixmapPtr)NULL)
- {
- if (stuff->mask != None)
- {
- client->errorValue = stuff->mask;
- return (BadPixmap);
- }
- }
- else if ( src->drawable.width != msk->drawable.width
- || src->drawable.height != msk->drawable.height
- || src->drawable.depth != 1
- || msk->drawable.depth != 1)
- return (BadMatch);
-
- width = src->drawable.width;
- height = src->drawable.height;
-
- if ( stuff->x > width
- || stuff->y > height )
- return (BadMatch);
-
- n = BitmapBytePad(width)*height;
- srcbits = (unsigned char *)xalloc(n);
- if (!srcbits)
- return (BadAlloc);
- mskbits = (unsigned char *)xalloc(n);
- if (!mskbits)
- {
- xfree(srcbits);
- return (BadAlloc);
- }
-
- /* zeroing the (pad) bits helps some ddx cursor handling */
- bzero((char *)srcbits, n);
- (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height,
- XYPixmap, 1, (pointer)srcbits);
- if ( msk == (PixmapPtr)NULL)
- {
- register unsigned char *bits = mskbits;
- while (--n >= 0)
- *bits++ = ~0;
- }
- else
- {
- /* zeroing the (pad) bits helps some ddx cursor handling */
- bzero((char *)mskbits, n);
- (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width,
- height, XYPixmap, 1, (pointer)mskbits);
- }
- cm.width = width;
- cm.height = height;
- cm.xhot = stuff->x;
- cm.yhot = stuff->y;
- pCursor = AllocCursor( srcbits, mskbits, &cm,
- stuff->foreRed, stuff->foreGreen, stuff->foreBlue,
- stuff->backRed, stuff->backGreen, stuff->backBlue);
-
- if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
- return (client->noClientException);
- return BadAlloc;
-}
-
-int
-ProcCreateGlyphCursor( client)
- register ClientPtr client;
-{
- CursorPtr pCursor;
- int res;
-
- REQUEST(xCreateGlyphCursorReq);
-
- REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
- LEGAL_NEW_RESOURCE(stuff->cid, client);
-
- res = AllocGlyphCursor(stuff->source, stuff->sourceChar,
- stuff->mask, stuff->maskChar,
- stuff->foreRed, stuff->foreGreen, stuff->foreBlue,
- stuff->backRed, stuff->backGreen, stuff->backBlue,
- &pCursor, client);
- if (res != Success)
- return res;
- if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
- return client->noClientException;
- return BadAlloc;
-}
-
-
-int
-ProcFreeCursor(client)
- register ClientPtr client;
-{
- CursorPtr pCursor;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id,
- RT_CURSOR, SecurityDestroyAccess);
- if (pCursor)
- {
- FreeResource(stuff->id, RT_NONE);
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadCursor);
- }
-}
-
-int
-ProcQueryBestSize (client)
- register ClientPtr client;
-{
- xQueryBestSizeReply reply;
- register DrawablePtr pDraw;
- ScreenPtr pScreen;
- REQUEST(xQueryBestSizeReq);
-
- REQUEST_SIZE_MATCH(xQueryBestSizeReq);
- if ((stuff->class != CursorShape) &&
- (stuff->class != TileShape) &&
- (stuff->class != StippleShape))
- {
- client->errorValue = stuff->class;
- return(BadValue);
- }
- SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client,
- SecurityReadAccess);
- if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW)
- return (BadMatch);
- pScreen = pDraw->pScreen;
- (* pScreen->QueryBestSize)(stuff->class, &stuff->width,
- &stuff->height, pScreen);
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.width = stuff->width;
- reply.height = stuff->height;
- WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
- return (client->noClientException);
-}
-
-
-int
-ProcSetScreenSaver (client)
- register ClientPtr client;
-{
- int blankingOption, exposureOption;
- REQUEST(xSetScreenSaverReq);
-
- REQUEST_SIZE_MATCH(xSetScreenSaverReq);
- blankingOption = stuff->preferBlank;
- if ((blankingOption != DontPreferBlanking) &&
- (blankingOption != PreferBlanking) &&
- (blankingOption != DefaultBlanking))
- {
- client->errorValue = blankingOption;
- return BadValue;
- }
- exposureOption = stuff->allowExpose;
- if ((exposureOption != DontAllowExposures) &&
- (exposureOption != AllowExposures) &&
- (exposureOption != DefaultExposures))
- {
- client->errorValue = exposureOption;
- return BadValue;
- }
- if (stuff->timeout < -1)
- {
- client->errorValue = stuff->timeout;
- return BadValue;
- }
- if (stuff->interval < -1)
- {
- client->errorValue = stuff->interval;
- return BadValue;
- }
-
- if (blankingOption == DefaultBlanking)
- ScreenSaverBlanking = defaultScreenSaverBlanking;
- else
- ScreenSaverBlanking = blankingOption;
- if (exposureOption == DefaultExposures)
- ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
- else
- ScreenSaverAllowExposures = exposureOption;
-
- if (stuff->timeout >= 0)
- ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND;
- else
- ScreenSaverTime = defaultScreenSaverTime;
- if (stuff->interval >= 0)
- ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND;
- else
- ScreenSaverInterval = defaultScreenSaverInterval;
-
- SetScreenSaverTimer();
- return (client->noClientException);
-}
-
-int
-ProcGetScreenSaver(client)
- register ClientPtr client;
-{
- xGetScreenSaverReply rep;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.timeout = ScreenSaverTime / MILLI_PER_SECOND;
- rep.interval = ScreenSaverInterval / MILLI_PER_SECOND;
- rep.preferBlanking = ScreenSaverBlanking;
- rep.allowExposures = ScreenSaverAllowExposures;
- WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
- return (client->noClientException);
-}
-
-int
-ProcChangeHosts(client)
- register ClientPtr client;
-{
- REQUEST(xChangeHostsReq);
- int result;
-
- REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength);
-
- if(stuff->mode == HostInsert)
- result = AddHost(client, (int)stuff->hostFamily,
- stuff->hostLength, (pointer)&stuff[1]);
- else if (stuff->mode == HostDelete)
- result = RemoveHost(client, (int)stuff->hostFamily,
- stuff->hostLength, (pointer)&stuff[1]);
- else
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
- if (!result)
- result = client->noClientException;
- return (result);
-}
-
-int
-ProcListHosts(client)
- register ClientPtr client;
-{
- xListHostsReply reply;
- int len, nHosts, result;
- pointer pdata;
- /* REQUEST(xListHostsReq); */
-
- REQUEST_SIZE_MATCH(xListHostsReq);
-#ifdef XCSECURITY
- /* untrusted clients can't list hosts */
- if (client->trustLevel != XSecurityClientTrusted)
- {
- SecurityAudit("client %d attempted to list hosts\n", client->index);
- return BadAccess;
- }
-#endif
- result = GetHosts(&pdata, &nHosts, &len, &reply.enabled);
- if (result != Success)
- return(result);
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.nHosts = nHosts;
- reply.length = len >> 2;
- WriteReplyToClient(client, sizeof(xListHostsReply), &reply);
- if (nHosts)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
- WriteSwappedDataToClient(client, len, pdata);
- }
- xfree(pdata);
- return (client->noClientException);
-}
-
-int
-ProcChangeAccessControl(client)
- register ClientPtr client;
-{
- int result;
- REQUEST(xSetAccessControlReq);
-
- REQUEST_SIZE_MATCH(xSetAccessControlReq);
- if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess))
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
- result = ChangeAccessControl(client, stuff->mode == EnableAccess);
- if (!result)
- result = client->noClientException;
- return (result);
-}
-
-int
-ProcKillClient(client)
- register ClientPtr client;
-{
- REQUEST(xResourceReq);
- ClientPtr killclient;
-
- REQUEST_SIZE_MATCH(xResourceReq);
- if (stuff->id == AllTemporary)
- {
- CloseDownRetainedResources();
- return (client->noClientException);
- }
-
- if ((killclient = LookupClient(stuff->id, client)))
- {
- CloseDownClient(killclient);
- /* if an LBX proxy gets killed, isItTimeToYield will be set */
- if (isItTimeToYield || (client == killclient))
- {
- /* force yield and return Success, so that Dispatch()
- * doesn't try to touch client
- */
- isItTimeToYield = TRUE;
- return (Success);
- }
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->id;
- return (BadValue);
- }
-}
-
-int
-ProcSetFontPath(client)
- register ClientPtr client;
-{
- unsigned char *ptr;
- unsigned long nbytes, total;
- long nfonts;
- int n, result;
- int error;
- REQUEST(xSetFontPathReq);
-
- REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
-
- nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq);
- total = nbytes;
- ptr = (unsigned char *)&stuff[1];
- nfonts = stuff->nFonts;
- while (--nfonts >= 0)
- {
- if ((total == 0) || (total < (n = (*ptr + 1))))
- return(BadLength);
- total -= n;
- ptr += n;
- }
- if (total >= 4)
- return(BadLength);
- result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1],
- &error);
- if (!result)
- {
- result = client->noClientException;
- client->errorValue = error;
- }
- return (result);
-}
-
-int
-ProcGetFontPath(client)
- register ClientPtr client;
-{
- xGetFontPathReply reply;
- int stringLens, numpaths;
- unsigned char *bufferStart;
- /* REQUEST (xReq); */
-
- REQUEST_SIZE_MATCH(xReq);
- bufferStart = GetFontPath(&numpaths, &stringLens);
-
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = (stringLens + numpaths + 3) >> 2;
- reply.nPaths = numpaths;
-
- WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
- if (stringLens || numpaths)
- (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart);
- return(client->noClientException);
-}
-
-int
-ProcChangeCloseDownMode(client)
- register ClientPtr client;
-{
- REQUEST(xSetCloseDownModeReq);
-
- REQUEST_SIZE_MATCH(xSetCloseDownModeReq);
- if ((stuff->mode == AllTemporary) ||
- (stuff->mode == RetainPermanent) ||
- (stuff->mode == RetainTemporary))
- {
- client->closeDownMode = stuff->mode;
- return (client->noClientException);
- }
- else
- {
- client->errorValue = stuff->mode;
- return (BadValue);
- }
-}
-
-int ProcForceScreenSaver(client)
- register ClientPtr client;
-{
- REQUEST(xForceScreenSaverReq);
-
- REQUEST_SIZE_MATCH(xForceScreenSaverReq);
-
- if ((stuff->mode != ScreenSaverReset) &&
- (stuff->mode != ScreenSaverActive))
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
- SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode);
- return client->noClientException;
-}
-
-int ProcNoOperation(client)
- register ClientPtr client;
-{
- REQUEST_AT_LEAST_SIZE(xReq);
-
- /* noop -- don't do anything */
- return(client->noClientException);
-}
-
-void
-InitProcVectors(void)
-{
- int i;
- for (i = 0; i<256; i++)
- {
- if(!ProcVector[i])
- {
- ProcVector[i] = SwappedProcVector[i] = ProcBadRequest;
- ReplySwapVector[i] = ReplyNotSwappd;
- }
-#ifdef K5AUTH
- if (!k5_Vector[i])
- {
- k5_Vector[i] = k5_bad;
- }
-#endif
- }
- for(i = LASTEvent; i < 128; i++)
- {
- EventSwapVector[i] = NotImplemented;
- }
-
-}
-
-/**********************
- * CloseDownClient
- *
- * Client can either mark his resources destroy or retain. If retained and
- * then killed again, the client is really destroyed.
- *********************/
-
-char dispatchExceptionAtReset = DE_RESET;
-
-void
-CloseDownClient(client)
- register ClientPtr client;
-{
- Bool really_close_down = client->clientGone ||
- client->closeDownMode == DestroyAll;
-
- if (!client->clientGone)
- {
- /* ungrab server if grabbing client dies */
- if (grabState != GrabNone && grabClient == client)
- {
- UngrabServer(client);
- }
- BITCLEAR(grabWaiters, client->index);
- DeleteClientFromAnySelections(client);
- ReleaseActiveGrabs(client);
- DeleteClientFontStuff(client);
- if (!really_close_down)
- {
- /* This frees resources that should never be retained
- * no matter what the close down mode is. Actually we
- * could do this unconditionally, but it's probably
- * better not to traverse all the client's resources
- * twice (once here, once a few lines down in
- * FreeClientResources) in the common case of
- * really_close_down == TRUE.
- */
- FreeClientNeverRetainResources(client);
- client->clientState = ClientStateRetained;
- if (ClientStateCallback)
- {
- NewClientInfoRec clientinfo;
-
- clientinfo.client = client;
- clientinfo.prefix = (xConnSetupPrefix *)NULL;
- clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
- }
- }
- client->clientGone = TRUE; /* so events aren't sent to client */
- if (ClientIsAsleep(client))
- ClientSignal (client);
- ProcessWorkQueueZombies();
-#ifdef LBX
- ProcessQTagZombies();
-#endif
- CloseDownConnection(client);
-
- /* If the client made it to the Running stage, nClients has
- * been incremented on its behalf, so we need to decrement it
- * now. If it hasn't gotten to Running, nClients has *not*
- * been incremented, so *don't* decrement it.
- */
- if (client->clientState != ClientStateInitial &&
- client->clientState != ClientStateAuthenticating )
- {
- --nClients;
- }
- }
-
- if (really_close_down)
- {
- if (client->clientState == ClientStateRunning && nClients == 0)
- dispatchException |= dispatchExceptionAtReset;
-
- client->clientState = ClientStateGone;
- if (ClientStateCallback)
- {
- NewClientInfoRec clientinfo;
-
- clientinfo.client = client;
- clientinfo.prefix = (xConnSetupPrefix *)NULL;
- clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
- }
- FreeClientResources(client);
- if (client->index < nextFreeClientID)
- nextFreeClientID = client->index;
- clients[client->index] = NullClient;
-#ifdef SMART_SCHEDULE
- SmartLastClient = NullClient;
-#endif
- xfree(client);
-
- while (!clients[currentMaxClients-1])
- currentMaxClients--;
- }
-}
-
-static void
-KillAllClients()
-{
- int i;
- for (i=1; i<currentMaxClients; i++)
- if (clients[i]) {
- /* Make sure Retained clients are released. */
- clients[i]->closeDownMode = DestroyAll;
- CloseDownClient(clients[i]);
- }
-}
-
-/*********************
- * CloseDownRetainedResources
- *
- * Find all clients that are gone and have terminated in RetainTemporary
- * and destroy their resources.
- *********************/
-
-void
-CloseDownRetainedResources()
-{
- register int i;
- register ClientPtr client;
-
- for (i=1; i<currentMaxClients; i++)
- {
- client = clients[i];
- if (client && (client->closeDownMode == RetainTemporary)
- && (client->clientGone))
- CloseDownClient(client);
- }
-}
-
-void InitClient(client, i, ospriv)
- ClientPtr client;
- int i;
- pointer ospriv;
-{
- client->index = i;
- client->sequence = 0;
- client->clientAsMask = ((Mask)i) << CLIENTOFFSET;
- client->clientGone = FALSE;
- if (i)
- {
- client->closeDownMode = DestroyAll;
- client->lastDrawable = (DrawablePtr)WindowTable[0];
- client->lastDrawableID = WindowTable[0]->drawable.id;
- }
- else
- {
- client->closeDownMode = RetainPermanent;
- client->lastDrawable = (DrawablePtr)NULL;
- client->lastDrawableID = INVALID;
- }
- client->lastGC = (GCPtr) NULL;
- client->lastGCID = INVALID;
- client->numSaved = 0;
- client->saveSet = (pointer *)NULL;
- client->noClientException = Success;
-#ifdef DEBUG
- client->requestLogIndex = 0;
-#endif
- client->requestVector = InitialVector;
- client->osPrivate = ospriv;
- client->swapped = FALSE;
- client->big_requests = FALSE;
- client->priority = 0;
- client->clientState = ClientStateInitial;
-#ifdef XKB
- if (!noXkbExtension) {
- client->xkbClientFlags = 0;
- client->mapNotifyMask = 0;
- QueryMinMaxKeyCodes(&client->minKC,&client->maxKC);
- }
-#endif
- client->replyBytesRemaining = 0;
-#ifdef LBX
- client->readRequest = StandardReadRequestFromClient;
-#endif
-#ifdef XCSECURITY
- client->trustLevel = XSecurityClientTrusted;
- client->CheckAccess = NULL;
- client->authId = 0;
-#endif
-#ifdef XAPPGROUP
- client->appgroup = NULL;
-#endif
- client->fontResFunc = NULL;
-#ifdef SMART_SCHEDULE
- client->smart_priority = 0;
- client->smart_start_tick = SmartScheduleTime;
- client->smart_stop_tick = SmartScheduleTime;
- client->smart_check_tick = SmartScheduleTime;
-#endif
-}
-
-extern int clientPrivateLen;
-extern unsigned *clientPrivateSizes;
-extern unsigned totalClientSize;
-
-int
-InitClientPrivates(client)
- ClientPtr client;
-{
- register char *ptr;
- DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- if (totalClientSize == sizeof(ClientRec))
- ppriv = (DevUnion *)NULL;
- else if (client->index)
- ppriv = (DevUnion *)(client + 1);
- else
- {
- ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec));
- if (!ppriv)
- return 0;
- }
- client->devPrivates = ppriv;
- sizes = clientPrivateSizes;
- ptr = (char *)(ppriv + clientPrivateLen);
- for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- return 1;
-}
-
-/************************
- * int NextAvailableClient(ospriv)
- *
- * OS dependent portion can't assign client id's because of CloseDownModes.
- * Returns NULL if there are no free clients.
- *************************/
-
-ClientPtr
-NextAvailableClient(ospriv)
- pointer ospriv;
-{
- register int i;
- register ClientPtr client;
- xReq data;
-
- i = nextFreeClientID;
- if (i == MAXCLIENTS)
- return (ClientPtr)NULL;
- clients[i] = client = (ClientPtr)xalloc(totalClientSize);
- if (!client)
- return (ClientPtr)NULL;
- InitClient(client, i, ospriv);
- InitClientPrivates(client);
- if (!InitClientResources(client))
- {
- xfree(client);
- return (ClientPtr)NULL;
- }
- data.reqType = 1;
- data.length = (sz_xReq + sz_xConnClientPrefix) >> 2;
- if (!InsertFakeRequest(client, (char *)&data, sz_xReq))
- {
- FreeClientResources(client);
- xfree(client);
- return (ClientPtr)NULL;
- }
- if (i == currentMaxClients)
- currentMaxClients++;
- while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID])
- nextFreeClientID++;
- if (ClientStateCallback)
- {
- NewClientInfoRec clientinfo;
-
- clientinfo.client = client;
- clientinfo.prefix = (xConnSetupPrefix *)NULL;
- clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
- }
- return(client);
-}
-
-int
-ProcInitialConnection(client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- register xConnClientPrefix *prefix;
- int whichbyte = 1;
-
- prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
- if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
- return (client->noClientException = -1);
- if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l')))
- {
- client->swapped = TRUE;
- SwapConnClientPrefix(prefix);
- }
- stuff->reqType = 2;
- stuff->length += ((prefix->nbytesAuthProto + (unsigned)3) >> 2) +
- ((prefix->nbytesAuthString + (unsigned)3) >> 2);
- if (client->swapped)
- {
- swaps(&stuff->length, whichbyte);
- }
- ResetCurrentRequest(client);
- return (client->noClientException);
-}
-
-#ifdef LBX
-void
-IncrementClientCount()
-{
- nClients++;
-}
-#endif
-
-int
-SendConnSetup(client, reason)
- register ClientPtr client;
- char *reason;
-{
- register xWindowRoot *root;
- register int i;
- int numScreens;
- char* lConnectionInfo;
- xConnSetupPrefix* lconnSetupPrefix;
-
- if (reason)
- {
- xConnSetupPrefix csp;
-
- csp.success = xFalse;
- csp.lengthReason = strlen(reason);
- csp.length = (csp.lengthReason + (unsigned)3) >> 2;
- csp.majorVersion = X_PROTOCOL;
- csp.minorVersion = X_PROTOCOL_REVISION;
- if (client->swapped)
- WriteSConnSetupPrefix(client, &csp);
- else
- (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp);
- (void)WriteToClient(client, (int)csp.lengthReason, reason);
- return (client->noClientException = -1);
- }
-
- numScreens = screenInfo.numScreens;
- lConnectionInfo = ConnectionInfo;
- lconnSetupPrefix = &connSetupPrefix;
-
- /* We're about to start speaking X protocol back to the client by
- * sending the connection setup info. This means the authorization
- * step is complete, and we can count the client as an
- * authorized one.
- */
- nClients++;
-
- client->requestVector = client->swapped ? SwappedProcVector : ProcVector;
- client->sequence = 0;
-#ifdef XAPPGROUP
- XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens);
-#endif
- ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask;
- ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK;
-#ifdef MATCH_CLIENT_ENDIAN
- ((xConnSetup *)lConnectionInfo)->imageByteOrder = ClientOrder (client);
- ((xConnSetup *)lConnectionInfo)->bitmapBitOrder = ClientOrder (client);
-#endif
- /* fill in the "currentInputMask" */
- root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart);
-#ifdef PANORAMIX
- if (noPanoramiXExtension)
- numScreens = screenInfo.numScreens;
- else
- numScreens = ((xConnSetup *)ConnectionInfo)->numRoots;
-#endif
-
- for (i=0; i<numScreens; i++)
- {
- register unsigned int j;
- register xDepth *pDepth;
-
- root->currentInputMask = WindowTable[i]->eventMask |
- wOtherEventMasks (WindowTable[i]);
- pDepth = (xDepth *)(root + 1);
- for (j = 0; j < root->nDepths; j++)
- {
- pDepth = (xDepth *)(((char *)(pDepth + 1)) +
- pDepth->nVisuals * sizeof(xVisualType));
- }
- root = (xWindowRoot *)pDepth;
- }
-
- if (client->swapped)
- {
- WriteSConnSetupPrefix(client, lconnSetupPrefix);
- WriteSConnectionInfo(client,
- (unsigned long)(lconnSetupPrefix->length << 2),
- lConnectionInfo);
- }
- else
- {
- (void)WriteToClient(client, sizeof(xConnSetupPrefix),
- (char *) lconnSetupPrefix);
- (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2),
- lConnectionInfo);
- }
- client->clientState = ClientStateRunning;
- if (ClientStateCallback)
- {
- NewClientInfoRec clientinfo;
-
- clientinfo.client = client;
- clientinfo.prefix = lconnSetupPrefix;
- clientinfo.setup = (xConnSetup *)lConnectionInfo;
- CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
- }
- return (client->noClientException);
-}
-
-int
-ProcEstablishConnection(client)
- register ClientPtr client;
-{
- char *reason, *auth_proto, *auth_string;
- register xConnClientPrefix *prefix;
- REQUEST(xReq);
-
- prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
- auth_proto = (char *)prefix + sz_xConnClientPrefix;
- auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3);
- if ((prefix->majorVersion != X_PROTOCOL) ||
- (prefix->minorVersion != X_PROTOCOL_REVISION))
- reason = "Protocol version mismatch";
- else
- reason = ClientAuthorized(client,
- (unsigned short)prefix->nbytesAuthProto,
- auth_proto,
- (unsigned short)prefix->nbytesAuthString,
- auth_string);
- /*
- * If Kerberos is being used for this client, the clientState
- * will be set to ClientStateAuthenticating at this point.
- * More messages need to be exchanged among the X server, Kerberos
- * server, and client to figure out if everyone is authorized.
- * So we don't want to send the connection setup info yet, since
- * the auth step isn't really done.
- */
- if (client->clientState == ClientStateCheckingSecurity)
- client->clientState = ClientStateCheckedSecurity;
- else if (client->clientState != ClientStateAuthenticating)
- return(SendConnSetup(client, reason));
- return(client->noClientException);
-}
-
-void
-SendErrorToClient(client, majorCode, minorCode, resId, errorCode)
- ClientPtr client;
- unsigned int majorCode;
- unsigned int minorCode;
- XID resId;
- int errorCode;
-{
- xError rep;
-
- rep.type = X_Error;
- rep.sequenceNumber = client->sequence;
- rep.errorCode = errorCode;
- rep.majorCode = majorCode;
- rep.minorCode = minorCode;
- rep.resourceID = resId;
-
- WriteEventsToClient (client, 1, (xEvent *)&rep);
-}
-
-void
-DeleteWindowFromAnySelections(pWin)
- WindowPtr pWin;
-{
- register int i;
-
- for (i = 0; i< NumCurrentSelections; i++)
- if (CurrentSelections[i].pWin == pWin)
- {
- CurrentSelections[i].pWin = (WindowPtr)NULL;
- CurrentSelections[i].window = None;
- CurrentSelections[i].client = NullClient;
- }
-}
-
-static void
-DeleteClientFromAnySelections(client)
- ClientPtr client;
-{
- register int i;
-
- for (i = 0; i< NumCurrentSelections; i++)
- if (CurrentSelections[i].client == client)
- {
- CurrentSelections[i].pWin = (WindowPtr)NULL;
- CurrentSelections[i].window = None;
- CurrentSelections[i].client = NullClient;
- }
-}
-
-void
-MarkClientException(client)
- ClientPtr client;
-{
- client->noClientException = -1;
-}
diff --git a/dix/dispatch.h b/dix/dispatch.h
deleted file mode 100644
index d144c6c70..000000000
--- a/dix/dispatch.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/dispatch.h,v 3.3 2002/02/19 11:09:21 alanh Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/*
- * This prototypes the dispatch.c module (except for functions declared in
- * global headers), plus related dispatch procedures from devices.c, events.c,
- * extension.c, property.c.
- */
-
-#ifndef DISPATCH_H
-#define DISPATCH_H 1
-
-DISPATCH_PROC(InitClientPrivates);
-DISPATCH_PROC(ProcAllocColor);
-DISPATCH_PROC(ProcAllocColorCells);
-DISPATCH_PROC(ProcAllocColorPlanes);
-DISPATCH_PROC(ProcAllocNamedColor);
-DISPATCH_PROC(ProcBell);
-DISPATCH_PROC(ProcChangeAccessControl);
-DISPATCH_PROC(ProcChangeCloseDownMode);
-DISPATCH_PROC(ProcChangeGC);
-DISPATCH_PROC(ProcChangeHosts);
-DISPATCH_PROC(ProcChangeKeyboardControl);
-DISPATCH_PROC(ProcChangeKeyboardMapping);
-DISPATCH_PROC(ProcChangePointerControl);
-DISPATCH_PROC(ProcChangeProperty);
-DISPATCH_PROC(ProcChangeSaveSet);
-DISPATCH_PROC(ProcChangeWindowAttributes);
-DISPATCH_PROC(ProcCirculateWindow);
-DISPATCH_PROC(ProcClearToBackground);
-DISPATCH_PROC(ProcCloseFont);
-DISPATCH_PROC(ProcConfigureWindow);
-DISPATCH_PROC(ProcConvertSelection);
-DISPATCH_PROC(ProcCopyArea);
-DISPATCH_PROC(ProcCopyColormapAndFree);
-DISPATCH_PROC(ProcCopyGC);
-DISPATCH_PROC(ProcCopyPlane);
-DISPATCH_PROC(ProcCreateColormap);
-DISPATCH_PROC(ProcCreateCursor);
-DISPATCH_PROC(ProcCreateGC);
-DISPATCH_PROC(ProcCreateGlyphCursor);
-DISPATCH_PROC(ProcCreatePixmap);
-DISPATCH_PROC(ProcCreateWindow);
-DISPATCH_PROC(ProcDeleteProperty);
-DISPATCH_PROC(ProcDestroySubwindows);
-DISPATCH_PROC(ProcDestroyWindow);
-DISPATCH_PROC(ProcEstablishConnection);
-DISPATCH_PROC(ProcFillPoly);
-DISPATCH_PROC(ProcForceScreenSaver);
-DISPATCH_PROC(ProcFreeColormap);
-DISPATCH_PROC(ProcFreeColors);
-DISPATCH_PROC(ProcFreeCursor);
-DISPATCH_PROC(ProcFreeGC);
-DISPATCH_PROC(ProcFreePixmap);
-DISPATCH_PROC(ProcGetAtomName);
-DISPATCH_PROC(ProcGetFontPath);
-DISPATCH_PROC(ProcGetGeometry);
-DISPATCH_PROC(ProcGetImage);
-DISPATCH_PROC(ProcGetKeyboardControl);
-DISPATCH_PROC(ProcGetKeyboardMapping);
-DISPATCH_PROC(ProcGetModifierMapping);
-DISPATCH_PROC(ProcGetMotionEvents);
-DISPATCH_PROC(ProcGetPointerControl);
-DISPATCH_PROC(ProcGetPointerMapping);
-DISPATCH_PROC(ProcGetProperty);
-DISPATCH_PROC(ProcGetScreenSaver);
-DISPATCH_PROC(ProcGetSelectionOwner);
-DISPATCH_PROC(ProcGetWindowAttributes);
-DISPATCH_PROC(ProcGrabServer);
-DISPATCH_PROC(ProcImageText16);
-DISPATCH_PROC(ProcImageText8);
-DISPATCH_PROC(ProcInitialConnection);
-DISPATCH_PROC(ProcInstallColormap);
-DISPATCH_PROC(ProcInternAtom);
-DISPATCH_PROC(ProcKillClient);
-DISPATCH_PROC(ProcListExtensions);
-DISPATCH_PROC(ProcListFonts);
-DISPATCH_PROC(ProcListFontsWithInfo);
-DISPATCH_PROC(ProcListHosts);
-DISPATCH_PROC(ProcListInstalledColormaps);
-DISPATCH_PROC(ProcListProperties);
-DISPATCH_PROC(ProcLookupColor);
-DISPATCH_PROC(ProcMapSubwindows);
-DISPATCH_PROC(ProcMapWindow);
-DISPATCH_PROC(ProcNoOperation);
-DISPATCH_PROC(ProcOpenFont);
-DISPATCH_PROC(ProcPolyArc);
-DISPATCH_PROC(ProcPolyFillArc);
-DISPATCH_PROC(ProcPolyFillRectangle);
-DISPATCH_PROC(ProcPolyLine);
-DISPATCH_PROC(ProcPolyPoint);
-DISPATCH_PROC(ProcPolyRectangle);
-DISPATCH_PROC(ProcPolySegment);
-DISPATCH_PROC(ProcPolyText);
-DISPATCH_PROC(ProcPutImage);
-DISPATCH_PROC(ProcQueryBestSize);
-DISPATCH_PROC(ProcQueryColors);
-DISPATCH_PROC(ProcQueryExtension);
-DISPATCH_PROC(ProcQueryFont);
-DISPATCH_PROC(ProcQueryKeymap);
-DISPATCH_PROC(ProcQueryTextExtents);
-DISPATCH_PROC(ProcQueryTree);
-DISPATCH_PROC(ProcReparentWindow);
-DISPATCH_PROC(ProcRotateProperties);
-DISPATCH_PROC(ProcSetClipRectangles);
-DISPATCH_PROC(ProcSetDashes);
-DISPATCH_PROC(ProcSetFontPath);
-DISPATCH_PROC(ProcSetModifierMapping);
-DISPATCH_PROC(ProcSetPointerMapping);
-DISPATCH_PROC(ProcSetScreenSaver);
-DISPATCH_PROC(ProcSetSelectionOwner);
-DISPATCH_PROC(ProcStoreColors);
-DISPATCH_PROC(ProcStoreNamedColor);
-DISPATCH_PROC(ProcTranslateCoords);
-DISPATCH_PROC(ProcUngrabServer);
-DISPATCH_PROC(ProcUninstallColormap);
-DISPATCH_PROC(ProcUnmapSubwindows);
-DISPATCH_PROC(ProcUnmapWindow);
-
-#endif /* DISPATCH_H */
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
deleted file mode 100644
index d971260c7..000000000
--- a/dix/dixfonts.c
+++ /dev/null
@@ -1,2179 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.29 2003/11/17 22:20:34 dawes Exp $ */
-/************************************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-************************************************************************/
-
-/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */
-
-#define NEED_REPLIES
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "cursorstr.h"
-#include "misc.h"
-#include "opaque.h"
-#include "dixfontstr.h"
-#include "closestr.h"
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#endif
-
-#ifdef LBX
-#include "lbxserve.h"
-#endif
-
-#ifdef XF86BIGFONT
-#define _XF86BIGFONT_SERVER_
-#include "xf86bigfont.h"
-#endif
-
-#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics
-
-extern pointer fosNaturalParams;
-extern FontPtr defaultFont;
-
-static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0;
-static int num_fpes = 0;
-FPEFunctions *fpe_functions = (FPEFunctions *) 0;
-static int num_fpe_types = 0;
-
-static unsigned char *font_path_string;
-
-static int num_slept_fpes = 0;
-static int size_slept_fpes = 0;
-static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0;
-static FontPatternCachePtr patternCache;
-
-int
-FontToXError(err)
- int err;
-{
- switch (err) {
- case Successful:
- return Success;
- case AllocError:
- return BadAlloc;
- case BadFontName:
- return BadName;
- case BadFontPath:
- case BadFontFormat: /* is there something better? */
- case BadCharRange:
- return BadValue;
- default:
- return err;
- }
-}
-
-
-/*
- * adding RT_FONT prevents conflict with default cursor font
- */
-Bool
-SetDefaultFont(defaultfontname)
- char *defaultfontname;
-{
- int err;
- FontPtr pf;
- XID fid;
-
- fid = FakeClientID(0);
- err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync,
- (unsigned) strlen(defaultfontname), defaultfontname);
- if (err != Success)
- return FALSE;
- pf = (FontPtr) LookupIDByType(fid, RT_FONT);
- if (pf == (FontPtr) NULL)
- return FALSE;
- defaultFont = pf;
- return TRUE;
-}
-
-/*
- * note that the font wakeup queue is not refcounted. this is because
- * an fpe needs to be added when it's inited, and removed when it's finally
- * freed, in order to handle any data that isn't requested, like FS events.
- *
- * since the only thing that should call these routines is the renderer's
- * init_fpe() and free_fpe(), there shouldn't be any problem in using
- * freed data.
- */
-void
-QueueFontWakeup(fpe)
- FontPathElementPtr fpe;
-{
- int i;
- FontPathElementPtr *new;
-
- for (i = 0; i < num_slept_fpes; i++) {
- if (slept_fpes[i] == fpe) {
-
-#ifdef DEBUG
- fprintf(stderr, "re-queueing fpe wakeup\n");
-#endif
-
- return;
- }
- }
- if (num_slept_fpes == size_slept_fpes) {
- new = (FontPathElementPtr *)
- xrealloc(slept_fpes,
- sizeof(FontPathElementPtr) * (size_slept_fpes + 4));
- if (!new)
- return;
- slept_fpes = new;
- size_slept_fpes += 4;
- }
- slept_fpes[num_slept_fpes] = fpe;
- num_slept_fpes++;
-}
-
-void
-RemoveFontWakeup(fpe)
- FontPathElementPtr fpe;
-{
- int i,
- j;
-
- for (i = 0; i < num_slept_fpes; i++) {
- if (slept_fpes[i] == fpe) {
- for (j = i; j < num_slept_fpes; j++) {
- slept_fpes[j] = slept_fpes[j + 1];
- }
- num_slept_fpes--;
- return;
- }
- }
-}
-
-/* ARGSUSED */
-void
-FontWakeup(data, count, LastSelectMask)
- pointer data;
- int count;
- pointer LastSelectMask;
-{
- int i;
- FontPathElementPtr fpe;
-
- if (count < 0)
- return;
- /* wake up any fpe's that may be waiting for information */
- for (i = 0; i < num_slept_fpes; i++) {
- fpe = slept_fpes[i];
- (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask);
- }
-}
-
-/* XXX -- these two funcs may want to be broken into macros */
-static void
-UseFPE(FontPathElementPtr fpe)
-{
- fpe->refcount++;
-}
-
-static void
-FreeFPE (FontPathElementPtr fpe)
-{
- fpe->refcount--;
- if (fpe->refcount == 0) {
- (*fpe_functions[fpe->type].free_fpe) (fpe);
- xfree(fpe->name);
- xfree(fpe);
- }
-}
-
-static Bool
-doOpenFont(ClientPtr client, OFclosurePtr c)
-{
- FontPtr pfont = NullFont;
- FontPathElementPtr fpe = NULL;
- ScreenPtr pScr;
- int err = Successful;
- int i;
- char *alias,
- *newname;
- int newlen;
- int aliascount = 20;
- /*
- * Decide at runtime what FontFormat to use.
- */
- Mask FontFormat =
-
- ((screenInfo.imageByteOrder == LSBFirst) ?
- BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) |
-
- ((screenInfo.bitmapBitOrder == LSBFirst) ?
- BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) |
-
- BitmapFormatImageRectMin |
-
-#if GLYPHPADBYTES == 1
- BitmapFormatScanlinePad8 |
-#endif
-
-#if GLYPHPADBYTES == 2
- BitmapFormatScanlinePad16 |
-#endif
-
-#if GLYPHPADBYTES == 4
- BitmapFormatScanlinePad32 |
-#endif
-
-#if GLYPHPADBYTES == 8
- BitmapFormatScanlinePad64 |
-#endif
-
- BitmapFormatScanlineUnit8;
-
- if (client->clientGone)
- {
- if (c->current_fpe < c->num_fpes)
- {
- fpe = c->fpe_list[c->current_fpe];
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- }
- err = Successful;
- goto bail;
- }
- while (c->current_fpe < c->num_fpes) {
- fpe = c->fpe_list[c->current_fpe];
- err = (*fpe_functions[fpe->type].open_font)
- ((pointer) client, fpe, c->flags,
- c->fontname, c->fnamelen, FontFormat,
- BitmapFormatMaskByte |
- BitmapFormatMaskBit |
- BitmapFormatMaskImageRectangle |
- BitmapFormatMaskScanLinePad |
- BitmapFormatMaskScanLineUnit,
- c->fontid, &pfont, &alias,
- c->non_cachable_font && c->non_cachable_font->fpe == fpe ?
- c->non_cachable_font :
- (FontPtr)0);
-
- if (err == FontNameAlias && alias) {
- newlen = strlen(alias);
- newname = (char *) xrealloc(c->fontname, newlen);
- if (!newname) {
- err = AllocError;
- break;
- }
- memmove(newname, alias, newlen);
- c->fontname = newname;
- c->fnamelen = newlen;
- c->current_fpe = 0;
- if (--aliascount <= 0)
- break;
- continue;
- }
- if (err == BadFontName) {
- c->current_fpe++;
- continue;
- }
- if (err == Suspended) {
- if (!c->slept) {
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c);
- }
- return TRUE;
- }
- break;
- }
-
- if (err != Successful)
- goto bail;
- if (!pfont) {
- err = BadFontName;
- goto bail;
- }
- if (!pfont->fpe)
- pfont->fpe = fpe;
- pfont->refcnt++;
- if (pfont->refcnt == 1) {
- UseFPE(pfont->fpe);
- for (i = 0; i < screenInfo.numScreens; i++) {
- pScr = screenInfo.screens[i];
- if (pScr->RealizeFont)
- {
- if (!(*pScr->RealizeFont) (pScr, pfont))
- {
- CloseFont (pfont, (Font) 0);
- err = AllocError;
- goto bail;
- }
- }
- }
- }
- if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) {
- err = AllocError;
- goto bail;
- }
- if (patternCache && pfont != c->non_cachable_font)
- CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen,
- pfont);
-bail:
- if (err != Successful && c->client != serverClient) {
- SendErrorToClient(c->client, X_OpenFont, 0,
- c->fontid, FontToXError(err));
- }
- if (c->slept)
- ClientWakeup(c->client);
- for (i = 0; i < c->num_fpes; i++) {
- FreeFPE(c->fpe_list[i]);
- }
- xfree(c->fpe_list);
- xfree(c->fontname);
- xfree(c);
- return TRUE;
-}
-
-int
-OpenFont(client, fid, flags, lenfname, pfontname)
- ClientPtr client;
- XID fid;
- Mask flags;
- unsigned lenfname;
- char *pfontname;
-{
- OFclosurePtr c;
- int i;
- FontPtr cached = (FontPtr)0;
-
-#ifdef FONTDEBUG
- char *f;
- f = (char *)xalloc(lenfname + 1);
- memmove(f, pfontname, lenfname);
- f[lenfname] = '\0';
- ErrorF("OpenFont: fontname is \"%s\"\n", f);
- xfree(f);
-#endif
- if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
- return BadName;
- if (patternCache)
- {
-
- /*
- ** Check name cache. If we find a cached version of this font that
- ** is cachable, immediately satisfy the request with it. If we find
- ** a cached version of this font that is non-cachable, we do not
- ** satisfy the request with it. Instead, we pass the FontPtr to the
- ** FPE's open_font code (the fontfile FPE in turn passes the
- ** information to the rasterizer; the fserve FPE ignores it).
- **
- ** Presumably, the font is marked non-cachable because the FPE has
- ** put some licensing restrictions on it. If the FPE, using
- ** whatever logic it relies on, determines that it is willing to
- ** share this existing font with the client, then it has the option
- ** to return the FontPtr we passed it as the newly-opened font.
- ** This allows the FPE to exercise its licensing logic without
- ** having to create another instance of a font that already exists.
- */
-
- cached = FindCachedFontPattern(patternCache, pfontname, lenfname);
- if (cached && cached->info.cachable)
- {
- if (!AddResource(fid, RT_FONT, (pointer) cached))
- return BadAlloc;
- cached->refcnt++;
- return Success;
- }
- }
- c = (OFclosurePtr) xalloc(sizeof(OFclosureRec));
- if (!c)
- return BadAlloc;
- c->fontname = (char *) xalloc(lenfname);
- c->origFontName = pfontname;
- c->origFontNameLen = lenfname;
- if (!c->fontname) {
- xfree(c);
- return BadAlloc;
- }
- /*
- * copy the current FPE list, so that if it gets changed by another client
- * while we're blocking, the request still appears atomic
- */
- c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
- if (!c->fpe_list) {
- xfree(c->fontname);
- xfree(c);
- return BadAlloc;
- }
- memmove(c->fontname, pfontname, lenfname);
- for (i = 0; i < num_fpes; i++) {
- c->fpe_list[i] = font_path_elements[i];
- UseFPE(c->fpe_list[i]);
- }
- c->client = client;
- c->fontid = fid;
- c->current_fpe = 0;
- c->num_fpes = num_fpes;
- c->fnamelen = lenfname;
- c->slept = FALSE;
- c->flags = flags;
- c->non_cachable_font = cached;
-
- (void) doOpenFont(client, c);
- return Success;
-}
-
-/*
- * Decrement font's ref count, and free storage if ref count equals zero
- */
-/*ARGSUSED*/
-int
-CloseFont(value, fid)
- pointer value; /* must conform to DeleteType */
- XID fid;
-{
- int nscr;
- ScreenPtr pscr;
- FontPathElementPtr fpe;
- FontPtr pfont = (FontPtr)value;
-
- if (pfont == NullFont)
- return (Success);
- if (--pfont->refcnt == 0) {
- if (patternCache)
- RemoveCachedFontPattern (patternCache, pfont);
- /*
- * since the last reference is gone, ask each screen to free any
- * storage it may have allocated locally for it.
- */
- for (nscr = 0; nscr < screenInfo.numScreens; nscr++) {
- pscr = screenInfo.screens[nscr];
- if (pscr->UnrealizeFont)
- (*pscr->UnrealizeFont) (pscr, pfont);
- }
- if (pfont == defaultFont)
- defaultFont = NULL;
-#ifdef LBX
- LbxFreeFontTag(pfont);
-#endif
-#ifdef XF86BIGFONT
- XF86BigfontFreeFontShm(pfont);
-#endif
- fpe = pfont->fpe;
- (*fpe_functions[fpe->type].close_font) (fpe, pfont);
- FreeFPE(fpe);
- }
- return (Success);
-}
-
-
-/***====================================================================***/
-
- /*
- * \ Sets up pReply as the correct QueryFontReply for pFont with the first
- * nProtoCCIStructs char infos. \
- */
-
-void
-QueryFont(pFont, pReply, nProtoCCIStructs)
- FontPtr pFont;
- xQueryFontReply *pReply; /* caller must allocate this storage */
- int nProtoCCIStructs;
-{
- FontPropPtr pFP;
- int r,
- c,
- i;
- xFontProp *prFP;
- xCharInfo *prCI;
- xCharInfo *charInfos[256];
- unsigned char chars[512];
- int ninfos;
- unsigned long ncols;
- unsigned long count;
-
- /* pr->length set in dispatch */
- pReply->minCharOrByte2 = pFont->info.firstCol;
- pReply->defaultChar = pFont->info.defaultCh;
- pReply->maxCharOrByte2 = pFont->info.lastCol;
- pReply->drawDirection = pFont->info.drawDirection;
- pReply->allCharsExist = pFont->info.allExist;
- pReply->minByte1 = pFont->info.firstRow;
- pReply->maxByte1 = pFont->info.lastRow;
- pReply->fontAscent = pFont->info.fontAscent;
- pReply->fontDescent = pFont->info.fontDescent;
-
- pReply->minBounds = pFont->info.ink_minbounds;
- pReply->maxBounds = pFont->info.ink_maxbounds;
-
- pReply->nFontProps = pFont->info.nprops;
- pReply->nCharInfos = nProtoCCIStructs;
-
- for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]);
- i < pFont->info.nprops;
- i++, pFP++, prFP++) {
- prFP->name = pFP->name;
- prFP->value = pFP->value;
- }
-
- ninfos = 0;
- ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1);
- prCI = (xCharInfo *) (prFP);
- for (r = pFont->info.firstRow;
- ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow;
- r++) {
- i = 0;
- for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) {
- chars[i++] = r;
- chars[i++] = c;
- }
- (*pFont->get_metrics) (pFont, ncols, chars,
- TwoD16Bit, &count, charInfos);
- i = 0;
- for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) {
- *prCI = *charInfos[i];
- prCI++;
- ninfos++;
- }
- }
- return;
-}
-
-static Bool
-doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
-{
- FontPathElementPtr fpe;
- int err = Successful;
- FontNamesPtr names = NULL;
- char *name, *resolved=NULL;
- int namelen, resolvedlen;
- int nnames;
- int stringLens;
- int i;
- xListFontsReply reply;
- char *bufptr;
- char *bufferStart;
- int aliascount = 0;
-
- if (client->clientGone)
- {
- if (c->current.current_fpe < c->num_fpes)
- {
- fpe = c->fpe_list[c->current.current_fpe];
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- }
- err = Successful;
- goto bail;
- }
-
- if (!c->current.patlen)
- goto finish;
-
- while (c->current.current_fpe < c->num_fpes) {
- fpe = c->fpe_list[c->current.current_fpe];
- err = Successful;
-
- if (!fpe_functions[fpe->type].start_list_fonts_and_aliases)
- {
- /* This FPE doesn't support/require list_fonts_and_aliases */
-
- err = (*fpe_functions[fpe->type].list_fonts)
- ((pointer) c->client, fpe, c->current.pattern,
- c->current.patlen, c->current.max_names - c->names->nnames,
- c->names);
-
- if (err == Suspended) {
- if (!c->slept) {
- c->slept = TRUE;
- ClientSleep(client,
- (ClientSleepProcPtr)doListFontsAndAliases,
- (pointer) c);
- }
- return TRUE;
- }
-
- err = BadFontName;
- }
- else
- {
- /* Start of list_fonts_and_aliases functionality. Modeled
- after list_fonts_with_info in that it resolves aliases,
- except that the information collected from FPEs is just
- names, not font info. Each list_next_font_or_alias()
- returns either a name into name/namelen or an alias into
- name/namelen and its target name into resolved/resolvedlen.
- The code at this level then resolves the alias by polling
- the FPEs. */
-
- if (!c->current.list_started) {
- err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases)
- ((pointer) c->client, fpe, c->current.pattern,
- c->current.patlen, c->current.max_names - c->names->nnames,
- &c->current.private);
- if (err == Suspended) {
- if (!c->slept) {
- ClientSleep(client,
- (ClientSleepProcPtr)doListFontsAndAliases,
- (pointer) c);
- c->slept = TRUE;
- }
- return TRUE;
- }
- if (err == Successful)
- c->current.list_started = TRUE;
- }
- if (err == Successful) {
- char *tmpname;
- name = 0;
- err = (*fpe_functions[fpe->type].list_next_font_or_alias)
- ((pointer) c->client, fpe, &name, &namelen, &tmpname,
- &resolvedlen, c->current.private);
- if (err == Suspended) {
- if (!c->slept) {
- ClientSleep(client,
- (ClientSleepProcPtr)doListFontsAndAliases,
- (pointer) c);
- c->slept = TRUE;
- }
- return TRUE;
- }
- if (err == FontNameAlias) {
- if (resolved) xfree(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
- if (resolved)
- memmove(resolved, tmpname, resolvedlen + 1);
- }
- }
-
- if (err == Successful)
- {
- if (c->haveSaved)
- {
- if (c->savedName)
- (void)AddFontNamesName(c->names, c->savedName,
- c->savedNameLen);
- }
- else
- (void)AddFontNamesName(c->names, name, namelen);
- }
-
- /*
- * When we get an alias back, save our state and reset back to
- * the start of the FPE looking for the specified name. As
- * soon as a real font is found for the alias, pop back to the
- * old state
- */
- else if (err == FontNameAlias) {
- char tmp_pattern[XLFDMAXFONTNAMELEN];
- /*
- * when an alias recurses, we need to give
- * the last FPE a chance to clean up; so we call
- * it again, and assume that the error returned
- * is BadFontName, indicating the alias resolution
- * is complete.
- */
- memmove(tmp_pattern, resolved, resolvedlen);
- if (c->haveSaved)
- {
- char *tmpname;
- int tmpnamelen;
-
- tmpname = 0;
- (void) (*fpe_functions[fpe->type].list_next_font_or_alias)
- ((pointer) c->client, fpe, &tmpname, &tmpnamelen,
- &tmpname, &tmpnamelen, c->current.private);
- if (--aliascount <= 0)
- {
- err = BadFontName;
- goto ContBadFontName;
- }
- }
- else
- {
- c->saved = c->current;
- c->haveSaved = TRUE;
- if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
- if (c->savedName)
- memmove(c->savedName, name, namelen + 1);
- c->savedNameLen = namelen;
- aliascount = 20;
- }
- memmove(c->current.pattern, tmp_pattern, resolvedlen);
- c->current.patlen = resolvedlen;
- c->current.max_names = c->names->nnames + 1;
- c->current.current_fpe = -1;
- c->current.private = 0;
- err = BadFontName;
- }
- }
- /*
- * At the end of this FPE, step to the next. If we've finished
- * processing an alias, pop state back. If we've collected enough
- * font names, quit.
- */
- if (err == BadFontName) {
- ContBadFontName: ;
- c->current.list_started = FALSE;
- c->current.current_fpe++;
- err = Successful;
- if (c->haveSaved)
- {
- if (c->names->nnames == c->current.max_names ||
- c->current.current_fpe == c->num_fpes) {
- c->haveSaved = FALSE;
- c->current = c->saved;
- /* Give the saved namelist a chance to clean itself up */
- continue;
- }
- }
- if (c->names->nnames == c->current.max_names)
- break;
- }
- }
-
- /*
- * send the reply
- */
- if (err != Successful) {
- SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err));
- goto bail;
- }
-
-finish:
-
- names = c->names;
- nnames = names->nnames;
- client = c->client;
- stringLens = 0;
- for (i = 0; i < nnames; i++)
- stringLens += (names->length[i] <= 255) ? names->length[i] : 0;
-
- reply.type = X_Reply;
- reply.length = (stringLens + nnames + 3) >> 2;
- reply.nFonts = nnames;
- reply.sequenceNumber = client->sequence;
-
- bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2);
-
- if (!bufptr && reply.length) {
- SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
- goto bail;
- }
- /*
- * since WriteToClient long word aligns things, copy to temp buffer and
- * write all at once
- */
- for (i = 0; i < nnames; i++) {
- if (names->length[i] > 255)
- reply.nFonts--;
- else
- {
- *bufptr++ = names->length[i];
- memmove( bufptr, names->names[i], names->length[i]);
- bufptr += names->length[i];
- }
- }
- nnames = reply.nFonts;
- reply.length = (stringLens + nnames + 3) >> 2;
- client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
- WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
- (void) WriteToClient(client, stringLens + nnames, bufferStart);
- DEALLOCATE_LOCAL(bufferStart);
-
-bail:
- if (c->slept)
- ClientWakeup(client);
- for (i = 0; i < c->num_fpes; i++)
- FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
- FreeFontNames(names);
- xfree(c);
- if (resolved) xfree(resolved);
- return TRUE;
-}
-
-int
-ListFonts(client, pattern, length, max_names)
- ClientPtr client;
- unsigned char *pattern;
- unsigned int length;
- unsigned int max_names;
-{
- int i;
- LFclosurePtr c;
-
- /*
- * The right error to return here would be BadName, however the
- * specification does not allow for a Name error on this request.
- * Perhaps a better solution would be to return a nil list, i.e.
- * a list containing zero fontnames.
- */
- if (length > XLFDMAXFONTNAMELEN)
- return BadAlloc;
-
- if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
- return BadAlloc;
- c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
- if (!c->fpe_list) {
- xfree(c);
- return BadAlloc;
- }
- c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100);
- if (!c->names)
- {
- xfree(c->fpe_list);
- xfree(c);
- return BadAlloc;
- }
- memmove( c->current.pattern, pattern, length);
- for (i = 0; i < num_fpes; i++) {
- c->fpe_list[i] = font_path_elements[i];
- UseFPE(c->fpe_list[i]);
- }
- c->client = client;
- c->num_fpes = num_fpes;
- c->current.patlen = length;
- c->current.current_fpe = 0;
- c->current.max_names = max_names;
- c->current.list_started = FALSE;
- c->current.private = 0;
- c->haveSaved = FALSE;
- c->slept = FALSE;
- c->savedName = 0;
- doListFontsAndAliases(client, c);
- return Success;
-}
-
-int
-doListFontsWithInfo(client, c)
- ClientPtr client;
- LFWIclosurePtr c;
-{
- FontPathElementPtr fpe;
- int err = Successful;
- char *name;
- int namelen;
- int numFonts;
- FontInfoRec fontInfo,
- *pFontInfo;
- xListFontsWithInfoReply *reply;
- int length;
- xFontProp *pFP;
- int i;
- int aliascount = 0;
- xListFontsWithInfoReply finalReply;
-
- if (client->clientGone)
- {
- if (c->current.current_fpe < c->num_fpes)
- {
- fpe = c->fpe_list[c->current.current_fpe];
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- }
- err = Successful;
- goto bail;
- }
- client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo];
- if (!c->current.patlen)
- goto finish;
- while (c->current.current_fpe < c->num_fpes)
- {
- fpe = c->fpe_list[c->current.current_fpe];
- err = Successful;
- if (!c->current.list_started)
- {
- err = (*fpe_functions[fpe->type].start_list_fonts_with_info)
- (client, fpe, c->current.pattern, c->current.patlen,
- c->current.max_names, &c->current.private);
- if (err == Suspended)
- {
- if (!c->slept)
- {
- ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c);
- c->slept = TRUE;
- }
- return TRUE;
- }
- if (err == Successful)
- c->current.list_started = TRUE;
- }
- if (err == Successful)
- {
- name = 0;
- pFontInfo = &fontInfo;
- err = (*fpe_functions[fpe->type].list_next_font_with_info)
- (client, fpe, &name, &namelen, &pFontInfo,
- &numFonts, c->current.private);
- if (err == Suspended)
- {
- if (!c->slept)
- {
- ClientSleep(client,
- (ClientSleepProcPtr)doListFontsWithInfo,
- c);
- c->slept = TRUE;
- }
- return TRUE;
- }
- }
- /*
- * When we get an alias back, save our state and reset back to the
- * start of the FPE looking for the specified name. As soon as a real
- * font is found for the alias, pop back to the old state
- */
- if (err == FontNameAlias)
- {
- /*
- * when an alias recurses, we need to give
- * the last FPE a chance to clean up; so we call
- * it again, and assume that the error returned
- * is BadFontName, indicating the alias resolution
- * is complete.
- */
- if (c->haveSaved)
- {
- char *tmpname;
- int tmpnamelen;
- FontInfoPtr tmpFontInfo;
-
- tmpname = 0;
- tmpFontInfo = &fontInfo;
- (void) (*fpe_functions[fpe->type].list_next_font_with_info)
- (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo,
- &numFonts, c->current.private);
- if (--aliascount <= 0)
- {
- err = BadFontName;
- goto ContBadFontName;
- }
- }
- else
- {
- c->saved = c->current;
- c->haveSaved = TRUE;
- c->savedNumFonts = numFonts;
- if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
- if (c->savedName)
- memmove(c->savedName, name, namelen + 1);
- aliascount = 20;
- }
- memmove(c->current.pattern, name, namelen);
- c->current.patlen = namelen;
- c->current.max_names = 1;
- c->current.current_fpe = 0;
- c->current.private = 0;
- c->current.list_started = FALSE;
- }
- /*
- * At the end of this FPE, step to the next. If we've finished
- * processing an alias, pop state back. If we've sent enough font
- * names, quit. Always wait for BadFontName to let the FPE
- * have a chance to clean up.
- */
- else if (err == BadFontName)
- {
- ContBadFontName: ;
- c->current.list_started = FALSE;
- c->current.current_fpe++;
- err = Successful;
- if (c->haveSaved)
- {
- if (c->current.max_names == 0 ||
- c->current.current_fpe == c->num_fpes)
- {
- c->haveSaved = FALSE;
- c->saved.max_names -= (1 - c->current.max_names);
- c->current = c->saved;
- }
- }
- else if (c->current.max_names == 0)
- break;
- }
- else if (err == Successful)
- {
- length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp);
- reply = c->reply;
- if (c->length < length)
- {
- reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length);
- if (!reply)
- {
- err = AllocError;
- break;
- }
- c->reply = reply;
- c->length = length;
- }
- if (c->haveSaved)
- {
- numFonts = c->savedNumFonts;
- name = c->savedName;
- namelen = strlen(name);
- }
- reply->type = X_Reply;
- reply->length = (sizeof *reply - sizeof(xGenericReply) +
- pFontInfo->nprops * sizeof(xFontProp) +
- namelen + 3) >> 2;
- reply->sequenceNumber = client->sequence;
- reply->nameLength = namelen;
- reply->minBounds = pFontInfo->ink_minbounds;
- reply->maxBounds = pFontInfo->ink_maxbounds;
- reply->minCharOrByte2 = pFontInfo->firstCol;
- reply->maxCharOrByte2 = pFontInfo->lastCol;
- reply->defaultChar = pFontInfo->defaultCh;
- reply->nFontProps = pFontInfo->nprops;
- reply->drawDirection = pFontInfo->drawDirection;
- reply->minByte1 = pFontInfo->firstRow;
- reply->maxByte1 = pFontInfo->lastRow;
- reply->allCharsExist = pFontInfo->allExist;
- reply->fontAscent = pFontInfo->fontAscent;
- reply->fontDescent = pFontInfo->fontDescent;
- reply->nReplies = numFonts;
- pFP = (xFontProp *) (reply + 1);
- for (i = 0; i < pFontInfo->nprops; i++)
- {
- pFP->name = pFontInfo->props[i].name;
- pFP->value = pFontInfo->props[i].value;
- pFP++;
- }
- WriteSwappedDataToClient(client, length, reply);
- (void) WriteToClient(client, namelen, name);
- if (pFontInfo == &fontInfo)
- {
- xfree(fontInfo.props);
- xfree(fontInfo.isStringProp);
- }
- --c->current.max_names;
- }
- }
-finish:
- length = sizeof(xListFontsWithInfoReply);
- bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply));
- finalReply.type = X_Reply;
- finalReply.sequenceNumber = client->sequence;
- finalReply.length = (sizeof(xListFontsWithInfoReply)
- - sizeof(xGenericReply)) >> 2;
- WriteSwappedDataToClient(client, length, &finalReply);
-bail:
- if (c->slept)
- ClientWakeup(client);
- for (i = 0; i < c->num_fpes; i++)
- FreeFPE(c->fpe_list[i]);
- xfree(c->reply);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
- xfree(c);
- return TRUE;
-}
-
-int
-StartListFontsWithInfo(client, length, pattern, max_names)
- ClientPtr client;
- int length;
- unsigned char *pattern;
- int max_names;
-{
- int i;
- LFWIclosurePtr c;
-
- /*
- * The right error to return here would be BadName, however the
- * specification does not allow for a Name error on this request.
- * Perhaps a better solution would be to return a nil list, i.e.
- * a list containing zero fontnames.
- */
- if (length > XLFDMAXFONTNAMELEN)
- return BadAlloc;
-
- if (!(c = (LFWIclosurePtr) xalloc(sizeof *c)))
- goto badAlloc;
- c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
- if (!c->fpe_list)
- {
- xfree(c);
- goto badAlloc;
- }
- memmove(c->current.pattern, pattern, length);
- for (i = 0; i < num_fpes; i++)
- {
- c->fpe_list[i] = font_path_elements[i];
- UseFPE(c->fpe_list[i]);
- }
- c->client = client;
- c->num_fpes = num_fpes;
- c->reply = 0;
- c->length = 0;
- c->current.patlen = length;
- c->current.current_fpe = 0;
- c->current.max_names = max_names;
- c->current.list_started = FALSE;
- c->current.private = 0;
- c->savedNumFonts = 0;
- c->haveSaved = FALSE;
- c->slept = FALSE;
- c->savedName = 0;
- doListFontsWithInfo(client, c);
- return Success;
-badAlloc:
- return BadAlloc;
-}
-
-#define TextEltHeader 2
-#define FontShiftSize 5
-static XID clearGC[] = { CT_NONE };
-#define clearGCmask (GCClipMask)
-
-int
-doPolyText(client, c)
- ClientPtr client;
- register PTclosurePtr c;
-{
- register FontPtr pFont = c->pGC->font, oldpFont;
- Font fid, oldfid;
- int err = Success, lgerr; /* err is in X error, not font error, space */
- enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
- FontPathElementPtr fpe;
- GC *origGC = NULL;
-
- if (client->clientGone)
- {
- fpe = c->pGC->font->fpe;
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
-
- if (c->slept)
- {
- /* Client has died, but we cannot bail out right now. We
- need to clean up after the work we did when going to
- sleep. Setting the drawable pointer to 0 makes this
- happen without any attempts to render or perform other
- unnecessary activities. */
- c->pDraw = (DrawablePtr)0;
- }
- else
- {
- err = Success;
- goto bail;
- }
- }
-
- /* Make sure our drawable hasn't disappeared while we slept. */
- if (c->slept &&
- c->pDraw &&
- c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did,
- RC_DRAWABLE, SecurityWriteAccess))
- {
- /* Our drawable has disappeared. Treat like client died... ask
- the FPE code to clean up after client and avoid further
- rendering while we clean up after ourself. */
- fpe = c->pGC->font->fpe;
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- c->pDraw = (DrawablePtr)0;
- }
-
- client_state = c->slept ? SLEEPING : NEVER_SLEPT;
-
- while (c->endReq - c->pElt > TextEltHeader)
- {
- if (*c->pElt == FontChange)
- {
- if (c->endReq - c->pElt < FontShiftSize)
- {
- err = BadLength;
- goto bail;
- }
-
- oldpFont = pFont;
- oldfid = fid;
-
- fid = ((Font)*(c->pElt+4)) /* big-endian */
- | ((Font)*(c->pElt+3)) << 8
- | ((Font)*(c->pElt+2)) << 16
- | ((Font)*(c->pElt+1)) << 24;
- pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT,
- SecurityReadAccess);
- if (!pFont)
- {
- client->errorValue = fid;
- err = BadFont;
- /* restore pFont and fid for step 4 (described below) */
- pFont = oldpFont;
- fid = oldfid;
-
- /* If we're in START_SLEEP mode, the following step
- shortens the request... in the unlikely event that
- the fid somehow becomes valid before we come through
- again to actually execute the polytext, which would
- then mess up our refcounting scheme badly. */
- c->err = err;
- c->endReq = c->pElt;
-
- goto bail;
- }
-
- /* Step 3 (described below) on our new font */
- if (client_state == START_SLEEP)
- pFont->refcnt++;
- else
- {
- if (pFont != c->pGC->font && c->pDraw)
- {
- ChangeGC( c->pGC, GCFont, &fid);
- ValidateGC(c->pDraw, c->pGC);
- if (c->reqType == X_PolyText8)
- c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
- else
- c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16;
- }
-
- /* Undo the refcnt++ we performed when going to sleep */
- if (client_state == SLEEPING)
- (void)CloseFont(c->pGC->font, (Font)0);
- }
- c->pElt += FontShiftSize;
- }
- else /* print a string */
- {
- unsigned char *pNextElt;
- pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize;
- if ( pNextElt > c->endReq)
- {
- err = BadLength;
- goto bail;
- }
- if (client_state == START_SLEEP)
- {
- c->pElt = pNextElt;
- continue;
- }
- if (c->pDraw)
- {
- lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize,
- c->pElt + TextEltHeader);
- }
- else lgerr = Successful;
-
- if (lgerr == Suspended)
- {
- if (!c->slept) {
- int len;
- GC *pGC;
- PTclosurePtr new_closure;
-
- /* We're putting the client to sleep. We need to do a few things
- to ensure successful and atomic-appearing execution of the
- remainder of the request. First, copy the remainder of the
- request into a safe malloc'd area. Second, create a scratch GC
- to use for the remainder of the request. Third, mark all fonts
- referenced in the remainder of the request to prevent their
- deallocation. Fourth, make the original GC look like the
- request has completed... set its font to the final font value
- from this request. These GC manipulations are for the unlikely
- (but possible) event that some other client is using the GC.
- Steps 3 and 4 are performed by running this procedure through
- the remainder of the request in a special no-render mode
- indicated by client_state = START_SLEEP. */
-
- /* Step 1 */
- /* Allocate a malloc'd closure structure to replace
- the local one we were passed */
- new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec));
- if (!new_closure)
- {
- err = BadAlloc;
- goto bail;
- }
- *new_closure = *c;
- c = new_closure;
-
- len = c->endReq - c->pElt;
- c->data = (unsigned char *)xalloc(len);
- if (!c->data)
- {
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- memmove(c->data, c->pElt, len);
- c->pElt = c->data;
- c->endReq = c->pElt + len;
-
- /* Step 2 */
-
- pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
- if (!pGC)
- {
- xfree(c->data);
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- if ((err = CopyGC(c->pGC, pGC, GCFunction |
- GCPlaneMask | GCForeground |
- GCBackground | GCFillStyle |
- GCTile | GCStipple |
- GCTileStipXOrigin |
- GCTileStipYOrigin | GCFont |
- GCSubwindowMode | GCClipXOrigin |
- GCClipYOrigin | GCClipMask)) !=
- Success)
- {
- FreeScratchGC(pGC);
- xfree(c->data);
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- origGC = c->pGC;
- c->pGC = pGC;
- ValidateGC(c->pDraw, c->pGC);
-
- c->slept = TRUE;
- ClientSleep(client,
- (ClientSleepProcPtr)doPolyText,
- (pointer) c);
-
- /* Set up to perform steps 3 and 4 */
- client_state = START_SLEEP;
- continue; /* on to steps 3 and 4 */
- }
- return TRUE;
- }
- else if (lgerr != Successful)
- {
- err = FontToXError(lgerr);
- goto bail;
- }
- if (c->pDraw)
- {
- c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */
- c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg,
- *c->pElt, c->pElt + TextEltHeader);
- }
- c->pElt = pNextElt;
- }
- }
-
-bail:
-
- if (client_state == START_SLEEP)
- {
- /* Step 4 */
- if (pFont != origGC->font)
- {
- ChangeGC(origGC, GCFont, &fid);
- ValidateGC(c->pDraw, origGC);
- }
-
- /* restore pElt pointer for execution of remainder of the request */
- c->pElt = c->data;
- return TRUE;
- }
-
- if (c->err != Success) err = c->err;
- if (err != Success && c->client != serverClient) {
-#ifdef PANORAMIX
- if (noPanoramiXExtension || !c->pGC->pScreen->myNum)
-#endif
- SendErrorToClient(c->client, c->reqType, 0, 0, err);
- }
- if (c->slept)
- {
- ClientWakeup(c->client);
- ChangeGC(c->pGC, clearGCmask, clearGC);
-
- /* Unreference the font from the scratch GC */
- CloseFont(c->pGC->font, (Font)0);
- c->pGC->font = NullFont;
-
- FreeScratchGC(c->pGC);
- xfree(c->data);
- xfree(c);
- }
- return TRUE;
-}
-
-int
-PolyText(client, pDraw, pGC, pElt, endReq, xorg, yorg, reqType, did)
- ClientPtr client;
- DrawablePtr pDraw;
- GC *pGC;
- unsigned char *pElt;
- unsigned char *endReq;
- int xorg;
- int yorg;
- int reqType;
- XID did;
-{
- PTclosureRec local_closure;
-
- local_closure.pElt = pElt;
- local_closure.endReq = endReq;
- local_closure.client = client;
- local_closure.pDraw = pDraw;
- local_closure.xorg = xorg;
- local_closure.yorg = yorg;
- if ((local_closure.reqType = reqType) == X_PolyText8)
- {
- local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8;
- local_closure.itemSize = 1;
- }
- else
- {
- local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16;
- local_closure.itemSize = 2;
- }
- local_closure.pGC = pGC;
- local_closure.did = did;
- local_closure.err = Success;
- local_closure.slept = FALSE;
-
- (void) doPolyText(client, &local_closure);
- return Success;
-}
-
-
-#undef TextEltHeader
-#undef FontShiftSize
-
-int
-doImageText(client, c)
- ClientPtr client;
- register ITclosurePtr c;
-{
- int err = Success, lgerr; /* err is in X error, not font error, space */
- FontPathElementPtr fpe;
-
- if (client->clientGone)
- {
- fpe = c->pGC->font->fpe;
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- err = Success;
- goto bail;
- }
-
- /* Make sure our drawable hasn't disappeared while we slept. */
- if (c->slept &&
- c->pDraw &&
- c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did,
- RC_DRAWABLE, SecurityWriteAccess))
- {
- /* Our drawable has disappeared. Treat like client died... ask
- the FPE code to clean up after client. */
- fpe = c->pGC->font->fpe;
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- err = Success;
- goto bail;
- }
-
- lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data);
- if (lgerr == Suspended)
- {
- if (!c->slept) {
- GC *pGC;
- unsigned char *data;
- ITclosurePtr new_closure;
-
- /* We're putting the client to sleep. We need to
- save some state. Similar problem to that handled
- in doPolyText, but much simpler because the
- request structure is much simpler. */
-
- new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec));
- if (!new_closure)
- {
- err = BadAlloc;
- goto bail;
- }
- *new_closure = *c;
- c = new_closure;
-
- data = (unsigned char *)xalloc(c->nChars * c->itemSize);
- if (!data)
- {
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- memmove(data, c->data, c->nChars * c->itemSize);
- c->data = data;
-
- pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
- if (!pGC)
- {
- xfree(c->data);
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask |
- GCForeground | GCBackground | GCFillStyle |
- GCTile | GCStipple | GCTileStipXOrigin |
- GCTileStipYOrigin | GCFont |
- GCSubwindowMode | GCClipXOrigin |
- GCClipYOrigin | GCClipMask)) != Success)
- {
- FreeScratchGC(pGC);
- xfree(c->data);
- xfree(c);
- err = BadAlloc;
- goto bail;
- }
- c->pGC = pGC;
- ValidateGC(c->pDraw, c->pGC);
-
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c);
- }
- return TRUE;
- }
- else if (lgerr != Successful)
- {
- err = FontToXError(lgerr);
- goto bail;
- }
- if (c->pDraw)
- {
- (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg,
- c->nChars, c->data);
- }
-
-bail:
-
- if (err != Success && c->client != serverClient) {
- SendErrorToClient(c->client, c->reqType, 0, 0, err);
- }
- if (c->slept)
- {
- ClientWakeup(c->client);
- ChangeGC(c->pGC, clearGCmask, clearGC);
-
- /* Unreference the font from the scratch GC */
- CloseFont(c->pGC->font, (Font)0);
- c->pGC->font = NullFont;
-
- FreeScratchGC(c->pGC);
- xfree(c->data);
- xfree(c);
- }
- return TRUE;
-}
-
-int
-ImageText(client, pDraw, pGC, nChars, data, xorg, yorg, reqType, did)
- ClientPtr client;
- DrawablePtr pDraw;
- GC *pGC;
- int nChars;
- unsigned char *data;
- int xorg;
- int yorg;
- int reqType;
- XID did;
-{
- ITclosureRec local_closure;
-
- local_closure.client = client;
- local_closure.pDraw = pDraw;
- local_closure.pGC = pGC;
- local_closure.nChars = nChars;
- local_closure.data = data;
- local_closure.xorg = xorg;
- local_closure.yorg = yorg;
- if ((local_closure.reqType = reqType) == X_ImageText8)
- {
- local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8;
- local_closure.itemSize = 1;
- }
- else
- {
- local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16;
- local_closure.itemSize = 2;
- }
- local_closure.did = did;
- local_closure.slept = FALSE;
-
- (void) doImageText(client, &local_closure);
- return Success;
-}
-
-
-/* does the necessary magic to figure out the fpe type */
-static int
-DetermineFPEType(char *pathname)
-{
- int i;
-
- for (i = 0; i < num_fpe_types; i++) {
- if ((*fpe_functions[i].name_check) (pathname))
- return i;
- }
- return -1;
-}
-
-
-static void
-FreeFontPath(FontPathElementPtr *list, int n, Bool force)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- if (force) {
- /* Sanity check that all refcounts will be 0 by the time
- we get to the end of the list. */
- int found = 1; /* the first reference is us */
- int j;
- for (j = i+1; j < n; j++) {
- if (list[j] == list[i])
- found++;
- }
- if (list[i]->refcount != found) {
- ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
- list[i]->name_length, list[i]->name,
- list[i]->refcount, found);
- list[i]->refcount = found; /* ensure it will get freed */
- }
- }
- FreeFPE(list[i]);
- }
- xfree((char *) list);
-}
-
-static FontPathElementPtr
-find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len)
-{
- FontPathElementPtr fpe;
- int i;
-
- for (i = 0; i < num; i++) {
- fpe = list[i];
- if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0)
- return fpe;
- }
- return (FontPathElementPtr) 0;
-}
-
-
-static int
-SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
-{
- int i, err = 0;
- int valid_paths = 0;
- unsigned int len;
- unsigned char *cp = paths;
- FontPathElementPtr fpe = NULL, *fplist;
-
- fplist = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * npaths);
- if (!fplist) {
- *bad = 0;
- return BadAlloc;
- }
- for (i = 0; i < num_fpe_types; i++) {
- if (fpe_functions[i].set_path_hook)
- (*fpe_functions[i].set_path_hook) ();
- }
- for (i = 0; i < npaths; i++)
- {
- len = (unsigned int) (*cp++);
-
- if (len == 0)
- {
- if (persist)
- ErrorF ("Removing empty element from the valid list of fontpaths\n");
- err = BadValue;
- }
- else
- {
- /* if it's already in our active list, just reset it */
- /*
- * note that this can miss FPE's in limbo -- may be worth catching
- * them, though it'd muck up refcounting
- */
- fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len);
- if (fpe)
- {
- err = (*fpe_functions[fpe->type].reset_fpe) (fpe);
- if (err == Successful)
- {
- UseFPE(fpe);/* since it'll be decref'd later when freed
- * from the old list */
- }
- else
- fpe = 0;
- }
- /* if error or can't do it, act like it's a new one */
- if (!fpe)
- {
- fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec));
- if (!fpe)
- {
- err = BadAlloc;
- goto bail;
- }
- fpe->name = (char *) xalloc(len + 1);
- if (!fpe->name)
- {
- xfree(fpe);
- err = BadAlloc;
- goto bail;
- }
- fpe->refcount = 1;
-
- strncpy(fpe->name, (char *) cp, (int) len);
- fpe->name[len] = '\0';
- fpe->name_length = len;
- fpe->type = DetermineFPEType(fpe->name);
- if (fpe->type == -1)
- err = BadValue;
- else
- err = (*fpe_functions[fpe->type].init_fpe) (fpe);
- if (err != Successful)
- {
- if (persist)
- {
- ErrorF("Could not init font path element %s, removing from list!\n",
- fpe->name);
- }
- xfree (fpe->name);
- xfree (fpe);
- }
- }
- }
- if (err != Successful)
- {
- if (!persist)
- goto bail;
- }
- else
- {
- fplist[valid_paths++] = fpe;
- }
- cp += len;
- }
-
- FreeFontPath(font_path_elements, num_fpes, FALSE);
- font_path_elements = fplist;
- if (patternCache)
- EmptyFontPatternCache(patternCache);
- num_fpes = valid_paths;
-
- return Success;
-bail:
- *bad = i;
- while (--valid_paths >= 0)
- FreeFPE(fplist[valid_paths]);
- xfree(fplist);
- return FontToXError(err);
-}
-
-/* XXX -- do we need to pass error down to each renderer? */
-int
-SetFontPath(client, npaths, paths, error)
- ClientPtr client;
- int npaths;
- unsigned char *paths;
- int *error;
-{
- int err = Success;
-
- if (npaths == 0) {
- if (SetDefaultFontPath(defaultFontPath) != Success)
- return BadValue;
- } else {
- err = SetFontPathElements(npaths, paths, error, FALSE);
- }
- return err;
-}
-
-int
-SetDefaultFontPath(path)
- char *path;
-{
- unsigned char *cp,
- *pp,
- *nump,
- *newpath;
- int num = 1,
- len,
- err,
- size = 0,
- bad;
-
- /* get enough for string, plus values -- use up commas */
- len = strlen(path) + 1;
- nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len);
- if (!newpath)
- return BadAlloc;
- pp = (unsigned char *) path;
- cp++;
- while (*pp) {
- if (*pp == ',') {
- *nump = (unsigned char) size;
- nump = cp++;
- pp++;
- num++;
- size = 0;
- } else {
- *cp++ = *pp++;
- size++;
- }
- }
- *nump = (unsigned char) size;
-
- err = SetFontPathElements(num, newpath, &bad, TRUE);
-
- DEALLOCATE_LOCAL(newpath);
-
- return err;
-}
-
-unsigned char *
-GetFontPath(count, length)
- int *count;
- int *length;
-{
- int i;
- unsigned char *c;
- int len;
- FontPathElementPtr fpe;
-
- len = 0;
- for (i = 0; i < num_fpes; i++) {
- fpe = font_path_elements[i];
- len += fpe->name_length + 1;
- }
- font_path_string = (unsigned char *) xrealloc(font_path_string, len);
- if (!font_path_string)
- return NULL;
-
- c = font_path_string;
- *length = 0;
- for (i = 0; i < num_fpes; i++) {
- fpe = font_path_elements[i];
- *c = fpe->name_length;
- *length += *c++;
- memmove(c, fpe->name, fpe->name_length);
- c += fpe->name_length;
- }
- *count = num_fpes;
- return font_path_string;
-}
-
-int
-LoadGlyphs(client, pfont, nchars, item_size, data)
- ClientPtr client;
- FontPtr pfont;
- unsigned nchars;
- int item_size;
- unsigned char *data;
-{
- if (fpe_functions[pfont->fpe->type].load_glyphs)
- return (*fpe_functions[pfont->fpe->type].load_glyphs)
- (client, pfont, 0, nchars, item_size, data);
- else
- return Successful;
-}
-
-void
-DeleteClientFontStuff(client)
- ClientPtr client;
-{
- int i;
- FontPathElementPtr fpe;
-
- for (i = 0; i < num_fpes; i++)
- {
- fpe = font_path_elements[i];
- if (fpe_functions[fpe->type].client_died)
- (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe);
- }
-}
-
-void
-InitFonts ()
-{
- patternCache = MakeFontPatternCache();
-
-#ifndef KDRIVESERVER
- if (screenInfo.numScreens > screenInfo.numVideoScreens) {
- PrinterFontRegisterFpeFunctions();
- FontFileCheckRegisterFpeFunctions();
- check_fs_register_fpe_functions();
- } else
-#endif
- {
-#ifdef KDRIVESERVER
- BuiltinRegisterFpeFunctions();
-#endif
- FontFileRegisterFpeFunctions();
-#ifndef NOFONTSERVERACCESS
- fs_register_fpe_functions();
-#endif
- }
-}
-
-int
-GetDefaultPointSize ()
-{
- return 120;
-}
-
-
-FontResolutionPtr
-GetClientResolutions (num)
- int *num;
-{
- if (requestingClient && requestingClient->fontResFunc != NULL &&
- !requestingClient->clientGone)
- {
- return (*requestingClient->fontResFunc)(requestingClient, num);
- }
- else {
- static struct _FontResolution res;
- ScreenPtr pScreen;
-
- pScreen = screenInfo.screens[0];
- res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
- /*
- * XXX - we'll want this as long as bitmap instances are prevalent
- so that we can match them from scalable fonts
- */
- if (res.x_resolution < 88)
- res.x_resolution = 75;
- else
- res.x_resolution = 100;
- res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight;
- if (res.y_resolution < 88)
- res.y_resolution = 75;
- else
- res.y_resolution = 100;
- res.point_size = 120;
- *num = 1;
- return &res;
- }
-}
-
-/*
- * returns the type index of the new fpe
- *
- * should be called (only once!) by each type of fpe when initialized
- */
-
-int
-RegisterFPEFunctions(NameCheckFunc name_func,
- InitFpeFunc init_func,
- FreeFpeFunc free_func,
- ResetFpeFunc reset_func,
- OpenFontFunc open_func,
- CloseFontFunc close_func,
- ListFontsFunc list_func,
- StartLfwiFunc start_lfwi_func,
- NextLfwiFunc next_lfwi_func,
- WakeupFpeFunc wakeup_func,
- ClientDiedFunc client_died,
- LoadGlyphsFunc load_glyphs,
- StartLaFunc start_list_alias_func,
- NextLaFunc next_list_alias_func,
- SetPathFunc set_path_func)
-{
- FPEFunctions *new;
-
- /* grow the list */
- new = (FPEFunctions *) xrealloc(fpe_functions,
- (num_fpe_types + 1) * sizeof(FPEFunctions));
- if (!new)
- return -1;
- fpe_functions = new;
-
- fpe_functions[num_fpe_types].name_check = name_func;
- fpe_functions[num_fpe_types].open_font = open_func;
- fpe_functions[num_fpe_types].close_font = close_func;
- fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func;
- fpe_functions[num_fpe_types].list_fonts = list_func;
- fpe_functions[num_fpe_types].start_list_fonts_with_info =
- start_lfwi_func;
- fpe_functions[num_fpe_types].list_next_font_with_info =
- next_lfwi_func;
- fpe_functions[num_fpe_types].init_fpe = init_func;
- fpe_functions[num_fpe_types].free_fpe = free_func;
- fpe_functions[num_fpe_types].reset_fpe = reset_func;
- fpe_functions[num_fpe_types].client_died = client_died;
- fpe_functions[num_fpe_types].load_glyphs = load_glyphs;
- fpe_functions[num_fpe_types].start_list_fonts_and_aliases =
- start_list_alias_func;
- fpe_functions[num_fpe_types].list_next_font_or_alias =
- next_list_alias_func;
- fpe_functions[num_fpe_types].set_path_hook = set_path_func;
-
- return num_fpe_types++;
-}
-
-void
-FreeFonts()
-{
- if (patternCache) {
- FreeFontPatternCache(patternCache);
- patternCache = 0;
- }
- FreeFontPath(font_path_elements, num_fpes, TRUE);
- font_path_elements = 0;
- num_fpes = 0;
- xfree(fpe_functions);
- num_fpe_types = 0;
- fpe_functions = (FPEFunctions *) 0;
-}
-
-/* convenience functions for FS interface */
-
-FontPtr
-find_old_font(id)
- XID id;
-{
- return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE,
- SecurityUnknownAccess);
-}
-
-Font
-GetNewFontClientID()
-{
- return FakeClientID(0);
-}
-
-int
-StoreFontClientFont(pfont, id)
- FontPtr pfont;
- Font id;
-{
- return AddResource(id, RT_NONE, (pointer) pfont);
-}
-
-void
-DeleteFontClientID(id)
- Font id;
-{
- FreeResource(id, RT_NONE);
-}
-
-int
-client_auth_generation(client)
- ClientPtr client;
-{
- return 0;
-}
-
-static int fs_handlers_installed = 0;
-static unsigned int last_server_gen;
-
-int
-init_fs_handlers(fpe, block_handler)
- FontPathElementPtr fpe;
- BlockHandlerProcPtr block_handler;
-{
- /* if server has reset, make sure the b&w handlers are reinstalled */
- if (last_server_gen < serverGeneration) {
- last_server_gen = serverGeneration;
- fs_handlers_installed = 0;
- }
- if (fs_handlers_installed == 0) {
-
-#ifdef DEBUG
- fprintf(stderr, "adding FS b & w handlers\n");
-#endif
-
- if (!RegisterBlockAndWakeupHandlers(block_handler,
- FontWakeup, (pointer) 0))
- return AllocError;
- fs_handlers_installed++;
- }
- QueueFontWakeup(fpe);
- return Successful;
-}
-
-void
-remove_fs_handlers(fpe, block_handler, all)
- FontPathElementPtr fpe;
- BlockHandlerProcPtr block_handler;
- Bool all;
-{
- if (all) {
- /* remove the handlers if no one else is using them */
- if (--fs_handlers_installed == 0) {
-
-#ifdef DEBUG
- fprintf(stderr, "removing FS b & w handlers\n");
-#endif
-
- RemoveBlockAndWakeupHandlers(block_handler, FontWakeup,
- (pointer) 0);
- }
- }
- RemoveFontWakeup(fpe);
-}
-
-#ifdef DEBUG
-#define GLWIDTHBYTESPADDED(bits,nbytes) \
- ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
- :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
- :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
- :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \
- : 0)
-
-#define GLYPH_SIZE(ch, nbytes) \
- GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \
- (ch)->metrics.leftSideBearing, (nbytes))
-dump_char_ascii(cip)
- CharInfoPtr cip;
-{
- int r,
- l;
- int bpr;
- int byte;
- static unsigned maskTab[] = {
- (1 << 7), (1 << 6), (1 << 5), (1 << 4),
- (1 << 3), (1 << 2), (1 << 1), (1 << 0),
- };
-
- bpr = GLYPH_SIZE(cip, 4);
- for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) {
- pointer row = (pointer) cip->bits + r * bpr;
-
- byte = 0;
- for (l = 0; l <= (cip->metrics.rightSideBearing -
- cip->metrics.leftSideBearing); l++) {
- if (maskTab[l & 7] & row[l >> 3])
- putchar('X');
- else
- putchar('.');
- }
- putchar('\n');
- }
-}
-
-#endif
diff --git a/dix/dixutils.c b/dix/dixutils.c
deleted file mode 100644
index 38cfd4e0d..000000000
--- a/dix/dixutils.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/*
-
-(c)Copyright 1988,1991 Adobe Systems Incorporated. All rights reserved.
-
-Permission to use, copy, modify, distribute, and sublicense this software and its
-documentation for any purpose and without fee is hereby granted, provided that
-the above copyright notices appear in all copies and that both those copyright
-notices and this permission notice appear in supporting documentation and that
-the name of Adobe Systems Incorporated not be used in advertising or publicity
-pertaining to distribution of the software without specific, written prior
-permission. No trademark license to use the Adobe trademarks is hereby
-granted. If the Adobe trademark "Display PostScript"(tm) is used to describe
-this software, its functionality or for any other purpose, such use shall be
-limited to a statement that this software works in conjunction with the Display
-PostScript system. Proper trademark attribution to reflect Adobe's ownership
-of the trademark shall be given whenever any such reference to the Display
-PostScript system is made.
-
-ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY
-PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ADOBE
-DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-
-INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU
-OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,NEGLIGENCE, STRICT
-LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT PROVIDE ANY TRAINING OR OTHER
-SUPPORT FOR THE SOFTWARE.
-
-Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
-Incorporated which may be registered in certain jurisdictions.
-
-Author: Adobe Systems Incorporated
-
-*/
-
-/* $Xorg: dixutils.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "windowstr.h"
-#include "dixstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#define XK_LATIN1
-#include "keysymdef.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-
-/*
- * CompareTimeStamps returns -1, 0, or +1 depending on if the first
- * argument is less than, equal to or greater than the second argument.
- */
-
-int
-CompareTimeStamps(a, b)
- TimeStamp a, b;
-{
- if (a.months < b.months)
- return EARLIER;
- if (a.months > b.months)
- return LATER;
- if (a.milliseconds < b.milliseconds)
- return EARLIER;
- if (a.milliseconds > b.milliseconds)
- return LATER;
- return SAMETIME;
-}
-
-/*
- * convert client times to server TimeStamps
- */
-
-#define HALFMONTH ((unsigned long) 1<<31)
-TimeStamp
-ClientTimeToServerTime(c)
- CARD32 c;
-{
- TimeStamp ts;
- if (c == CurrentTime)
- return currentTime;
- ts.months = currentTime.months;
- ts.milliseconds = c;
- if (c > currentTime.milliseconds)
- {
- if (((unsigned long) c - currentTime.milliseconds) > HALFMONTH)
- ts.months -= 1;
- }
- else if (c < currentTime.milliseconds)
- {
- if (((unsigned long)currentTime.milliseconds - c) > HALFMONTH)
- ts.months += 1;
- }
- return ts;
-}
-
-/*
- * ISO Latin-1 case conversion routine
- *
- * this routine always null-terminates the result, so
- * beware of too-small buffers
- */
-
-void
-CopyISOLatin1Lowered(dest, source, length)
- register unsigned char *dest, *source;
- int length;
-{
- register int i;
-
- for (i = 0; i < length; i++, source++, dest++)
- {
- if ((*source >= XK_A) && (*source <= XK_Z))
- *dest = *source + (XK_a - XK_A);
- else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis))
- *dest = *source + (XK_agrave - XK_Agrave);
- else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn))
- *dest = *source + (XK_oslash - XK_Ooblique);
- else
- *dest = *source;
- }
- *dest = '\0';
-}
-
-#ifdef XCSECURITY
-
-/* SecurityLookupWindow and SecurityLookupDrawable:
- * Look up the window/drawable taking into account the client doing
- * the lookup and the type of access desired. Return the window/drawable
- * if it exists and the client is allowed access, else return NULL.
- * Most Proc* functions should be calling these instead of
- * LookupWindow and LookupDrawable, which do no access checks.
- */
-
-WindowPtr
-SecurityLookupWindow(rid, client, access_mode)
- XID rid;
- ClientPtr client;
- Mask access_mode;
-{
- WindowPtr pWin;
-
- client->errorValue = rid;
- if(rid == INVALID)
- return NULL;
- if (client->trustLevel != XSecurityClientTrusted)
- return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode);
- if (client->lastDrawableID == rid)
- {
- if (client->lastDrawable->type == DRAWABLE_WINDOW)
- return ((WindowPtr) client->lastDrawable);
- return (WindowPtr) NULL;
- }
- pWin = (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode);
- if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) {
- client->lastDrawable = (DrawablePtr) pWin;
- client->lastDrawableID = rid;
- client->lastGCID = INVALID;
- client->lastGC = (GCPtr)NULL;
- }
- return pWin;
-}
-
-
-pointer
-SecurityLookupDrawable(rid, client, access_mode)
- XID rid;
- ClientPtr client;
- Mask access_mode;
-{
- register DrawablePtr pDraw;
-
- if(rid == INVALID)
- return (pointer) NULL;
- if (client->trustLevel != XSecurityClientTrusted)
- return (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE,
- access_mode);
- if (client->lastDrawableID == rid)
- return ((pointer) client->lastDrawable);
- pDraw = (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE,
- access_mode);
- if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW))
- return (pointer)pDraw;
- return (pointer)NULL;
-}
-
-/* We can't replace the LookupWindow and LookupDrawable functions with
- * macros because of compatibility with loadable servers.
- */
-
-WindowPtr
-LookupWindow(rid, client)
- XID rid;
- ClientPtr client;
-{
- return SecurityLookupWindow(rid, client, SecurityUnknownAccess);
-}
-
-pointer
-LookupDrawable(rid, client)
- XID rid;
- ClientPtr client;
-{
- return SecurityLookupDrawable(rid, client, SecurityUnknownAccess);
-}
-
-#else /* not XCSECURITY */
-
-WindowPtr
-LookupWindow(rid, client)
- XID rid;
- ClientPtr client;
-{
- WindowPtr pWin;
-
- client->errorValue = rid;
- if(rid == INVALID)
- return NULL;
- if (client->lastDrawableID == rid)
- {
- if (client->lastDrawable->type == DRAWABLE_WINDOW)
- return ((WindowPtr) client->lastDrawable);
- return (WindowPtr) NULL;
- }
- pWin = (WindowPtr)LookupIDByType(rid, RT_WINDOW);
- if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) {
- client->lastDrawable = (DrawablePtr) pWin;
- client->lastDrawableID = rid;
- client->lastGCID = INVALID;
- client->lastGC = (GCPtr)NULL;
- }
- return pWin;
-}
-
-
-pointer
-LookupDrawable(rid, client)
- XID rid;
- ClientPtr client;
-{
- register DrawablePtr pDraw;
-
- if(rid == INVALID)
- return (pointer) NULL;
- if (client->lastDrawableID == rid)
- return ((pointer) client->lastDrawable);
- pDraw = (DrawablePtr)LookupIDByClass(rid, RC_DRAWABLE);
- if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW))
- return (pointer)pDraw;
- return (pointer)NULL;
-}
-
-#endif /* XCSECURITY */
-
-ClientPtr
-LookupClient(rid, client)
- XID rid;
- ClientPtr client;
-{
- pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY,
- SecurityReadAccess);
- int clientIndex = CLIENT_ID(rid);
-
- if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT))
- {
- return clients[clientIndex];
- }
- return (ClientPtr)NULL;
-}
-
-
-int
-AlterSaveSetForClient(client, pWin, mode)
- ClientPtr client;
- WindowPtr pWin;
- unsigned mode;
-{
- int numnow;
- pointer *pTmp = NULL;
- int j;
-
- numnow = client->numSaved;
- j = 0;
- if (numnow)
- {
- pTmp = client->saveSet;
- while ((j < numnow) && (pTmp[j] != (pointer)pWin))
- j++;
- }
- if (mode == SetModeInsert)
- {
- if (j < numnow) /* duplicate */
- return(Success);
- numnow++;
- pTmp = (pointer *)xrealloc(client->saveSet, sizeof(pointer) * numnow);
- if (!pTmp)
- return(BadAlloc);
- client->saveSet = pTmp;
- client->numSaved = numnow;
- client->saveSet[numnow - 1] = (pointer)pWin;
- return(Success);
- }
- else if ((mode == SetModeDelete) && (j < numnow))
- {
- while (j < numnow-1)
- {
- pTmp[j] = pTmp[j+1];
- j++;
- }
- numnow--;
- if (numnow)
- {
- pTmp = (pointer *)xrealloc(client->saveSet,
- sizeof(pointer) * numnow);
- if (pTmp)
- client->saveSet = pTmp;
- }
- else
- {
- xfree(client->saveSet);
- client->saveSet = (pointer *)NULL;
- }
- client->numSaved = numnow;
- return(Success);
- }
- return(Success);
-}
-
-void
-DeleteWindowFromAnySaveSet(pWin)
- WindowPtr pWin;
-{
- register int i;
- register ClientPtr client;
-
- for (i = 0; i< currentMaxClients; i++)
- {
- client = clients[i];
- if (client && client->numSaved)
- (void)AlterSaveSetForClient(client, pWin, SetModeDelete);
- }
-}
-
-/* No-op Don't Do Anything : sometimes we need to be able to call a procedure
- * that doesn't do anything. For example, on screen with only static
- * colormaps, if someone calls install colormap, it's easier to have a dummy
- * procedure to call than to check if there's a procedure
- */
-void
-NoopDDA(void)
-{
-}
-
-typedef struct _BlockHandler {
- BlockHandlerProcPtr BlockHandler;
- WakeupHandlerProcPtr WakeupHandler;
- pointer blockData;
- Bool deleted;
-} BlockHandlerRec, *BlockHandlerPtr;
-
-static BlockHandlerPtr handlers;
-static int numHandlers;
-static int sizeHandlers;
-static Bool inHandler;
-static Bool handlerDeleted;
-
-/* called from the OS layer */
-void
-BlockHandler(pTimeout, pReadmask)
-pointer pTimeout; /* DIX doesn't want to know how OS represents time */
-pointer pReadmask; /* nor how it represents the set of descriptors */
-{
- register int i, j;
-
- ++inHandler;
- for (i = 0; i < screenInfo.numScreens; i++)
- (* screenInfo.screens[i]->BlockHandler)(i,
- screenInfo.screens[i]->blockData,
- pTimeout, pReadmask);
- for (i = 0; i < numHandlers; i++)
- (*handlers[i].BlockHandler) (handlers[i].blockData,
- pTimeout, pReadmask);
- if (handlerDeleted)
- {
- for (i = 0; i < numHandlers;)
- if (handlers[i].deleted)
- {
- for (j = i; j < numHandlers - 1; j++)
- handlers[j] = handlers[j+1];
- numHandlers--;
- }
- else
- i++;
- handlerDeleted = FALSE;
- }
- --inHandler;
-}
-
-void
-WakeupHandler(result, pReadmask)
-int result; /* 32 bits of undefined result from the wait */
-pointer pReadmask; /* the resulting descriptor mask */
-{
- register int i, j;
-
- ++inHandler;
- for (i = numHandlers - 1; i >= 0; i--)
- (*handlers[i].WakeupHandler) (handlers[i].blockData,
- result, pReadmask);
- for (i = 0; i < screenInfo.numScreens; i++)
- (* screenInfo.screens[i]->WakeupHandler)(i,
- screenInfo.screens[i]->wakeupData,
- result, pReadmask);
- if (handlerDeleted)
- {
- for (i = 0; i < numHandlers;)
- if (handlers[i].deleted)
- {
- for (j = i; j < numHandlers - 1; j++)
- handlers[j] = handlers[j+1];
- numHandlers--;
- }
- else
- i++;
- handlerDeleted = FALSE;
- }
- --inHandler;
-}
-
-/* Reentrant with BlockHandler and WakeupHandler, except wakeup won't
- * get called until next time
- */
-
-Bool
-RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData)
- BlockHandlerProcPtr blockHandler;
- WakeupHandlerProcPtr wakeupHandler;
- pointer blockData;
-{
- BlockHandlerPtr new;
-
- if (numHandlers >= sizeHandlers)
- {
- new = (BlockHandlerPtr) xrealloc (handlers, (numHandlers + 1) *
- sizeof (BlockHandlerRec));
- if (!new)
- return FALSE;
- handlers = new;
- sizeHandlers = numHandlers + 1;
- }
- handlers[numHandlers].BlockHandler = blockHandler;
- handlers[numHandlers].WakeupHandler = wakeupHandler;
- handlers[numHandlers].blockData = blockData;
- handlers[numHandlers].deleted = FALSE;
- numHandlers = numHandlers + 1;
- return TRUE;
-}
-
-void
-RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData)
- BlockHandlerProcPtr blockHandler;
- WakeupHandlerProcPtr wakeupHandler;
- pointer blockData;
-{
- int i;
-
- for (i = 0; i < numHandlers; i++)
- if (handlers[i].BlockHandler == blockHandler &&
- handlers[i].WakeupHandler == wakeupHandler &&
- handlers[i].blockData == blockData)
- {
- if (inHandler)
- {
- handlerDeleted = TRUE;
- handlers[i].deleted = TRUE;
- }
- else
- {
- for (; i < numHandlers - 1; i++)
- handlers[i] = handlers[i+1];
- numHandlers--;
- }
- break;
- }
-}
-
-void
-InitBlockAndWakeupHandlers ()
-{
- xfree (handlers);
- handlers = (BlockHandlerPtr) 0;
- numHandlers = 0;
- sizeHandlers = 0;
-}
-
-/*
- * A general work queue. Perform some task before the server
- * sleeps for input.
- */
-
-WorkQueuePtr workQueue;
-static WorkQueuePtr *workQueueLast = &workQueue;
-
-void
-ProcessWorkQueue(void)
-{
- WorkQueuePtr q, *p;
-
- p = &workQueue;
- /*
- * Scan the work queue once, calling each function. Those
- * which return TRUE are removed from the queue, otherwise
- * they will be called again. This must be reentrant with
- * QueueWorkProc.
- */
- while ((q = *p))
- {
- if ((*q->function) (q->client, q->closure))
- {
- /* remove q from the list */
- *p = q->next; /* don't fetch until after func called */
- xfree (q);
- }
- else
- {
- p = &q->next; /* don't fetch until after func called */
- }
- }
- workQueueLast = p;
-}
-
-void
-ProcessWorkQueueZombies(void)
-{
- WorkQueuePtr q, *p;
-
- p = &workQueue;
- while ((q = *p))
- {
- if (q->client && q->client->clientGone)
- {
- (void) (*q->function) (q->client, q->closure);
- /* remove q from the list */
- *p = q->next; /* don't fetch until after func called */
- xfree (q);
- }
- else
- {
- p = &q->next; /* don't fetch until after func called */
- }
- }
- workQueueLast = p;
-}
-
-Bool
-QueueWorkProc (
- Bool (*function)(
- ClientPtr /* pClient */,
- pointer /* closure */
- ),
- ClientPtr client,
- pointer closure)
-{
- WorkQueuePtr q;
-
- q = (WorkQueuePtr) xalloc (sizeof *q);
- if (!q)
- return FALSE;
- q->function = function;
- q->client = client;
- q->closure = closure;
- q->next = NULL;
- *workQueueLast = q;
- workQueueLast = &q->next;
- return TRUE;
-}
-
-/*
- * Manage a queue of sleeping clients, awakening them
- * when requested, by using the OS functions IgnoreClient
- * and AttendClient. Note that this *ignores* the troubles
- * with request data interleaving itself with events, but
- * we'll leave that until a later time.
- */
-
-typedef struct _SleepQueue {
- struct _SleepQueue *next;
- ClientPtr client;
- ClientSleepProcPtr function;
- pointer closure;
-} SleepQueueRec, *SleepQueuePtr;
-
-static SleepQueuePtr sleepQueue = NULL;
-
-Bool
-ClientSleep (client, function, closure)
- ClientPtr client;
- ClientSleepProcPtr function;
- pointer closure;
-{
- SleepQueuePtr q;
-
- q = (SleepQueuePtr) xalloc (sizeof *q);
- if (!q)
- return FALSE;
-
- IgnoreClient (client);
- q->next = sleepQueue;
- q->client = client;
- q->function = function;
- q->closure = closure;
- sleepQueue = q;
- return TRUE;
-}
-
-Bool
-ClientSignal (client)
- ClientPtr client;
-{
- SleepQueuePtr q;
-
- for (q = sleepQueue; q; q = q->next)
- if (q->client == client)
- {
- return QueueWorkProc (q->function, q->client, q->closure);
- }
- return FALSE;
-}
-
-void
-ClientWakeup (client)
- ClientPtr client;
-{
- SleepQueuePtr q, *prev;
-
- prev = &sleepQueue;
- while ( (q = *prev) )
- {
- if (q->client == client)
- {
- *prev = q->next;
- xfree (q);
- if (client->clientGone)
- /* Oops -- new zombie cleanup code ensures this only
- * happens from inside CloseDownClient; don't want to
- * recurse here...
- */
- /* CloseDownClient(client) */;
- else
- AttendClient (client);
- break;
- }
- prev = &q->next;
- }
-}
-
-Bool
-ClientIsAsleep (client)
- ClientPtr client;
-{
- SleepQueuePtr q;
-
- for (q = sleepQueue; q; q = q->next)
- if (q->client == client)
- return TRUE;
- return FALSE;
-}
-
-/*
- * Generic Callback Manager
- */
-
-/* ===== Private Procedures ===== */
-
-static int numCallbackListsToCleanup = 0;
-static CallbackListPtr **listsToCleanup = NULL;
-
-static Bool
-_AddCallback(
- CallbackListPtr *pcbl,
- CallbackProcPtr callback,
- pointer data)
-{
- CallbackPtr cbr;
-
- cbr = (CallbackPtr) xalloc(sizeof(CallbackRec));
- if (!cbr)
- return FALSE;
- cbr->proc = callback;
- cbr->data = data;
- cbr->next = (*pcbl)->list;
- cbr->deleted = FALSE;
- (*pcbl)->list = cbr;
- return TRUE;
-}
-
-static Bool
-_DeleteCallback(
- CallbackListPtr *pcbl,
- CallbackProcPtr callback,
- pointer data)
-{
- CallbackListPtr cbl = *pcbl;
- CallbackPtr cbr, pcbr;
-
- for (pcbr = NULL, cbr = cbl->list;
- cbr != NULL;
- pcbr = cbr, cbr = cbr->next)
- {
- if ((cbr->proc == callback) && (cbr->data == data))
- break;
- }
- if (cbr != NULL)
- {
- if (cbl->inCallback)
- {
- ++(cbl->numDeleted);
- cbr->deleted = TRUE;
- }
- else
- {
- if (pcbr == NULL)
- cbl->list = cbr->next;
- else
- pcbr->next = cbr->next;
- xfree(cbr);
- }
- return TRUE;
- }
- return FALSE;
-}
-
-static void
-_CallCallbacks(
- CallbackListPtr *pcbl,
- pointer call_data)
-{
- CallbackListPtr cbl = *pcbl;
- CallbackPtr cbr, pcbr;
-
- ++(cbl->inCallback);
- for (cbr = cbl->list; cbr != NULL; cbr = cbr->next)
- {
- (*(cbr->proc)) (pcbl, cbr->data, call_data);
- }
- --(cbl->inCallback);
-
- if (cbl->inCallback) return;
-
- /* Was the entire list marked for deletion? */
-
- if (cbl->deleted)
- {
- DeleteCallbackList(pcbl);
- return;
- }
-
- /* Were some individual callbacks on the list marked for deletion?
- * If so, do the deletions.
- */
-
- if (cbl->numDeleted)
- {
- for (pcbr = NULL, cbr = cbl->list; (cbr != NULL) && cbl->numDeleted; )
- {
- if (cbr->deleted)
- {
- if (pcbr)
- {
- cbr = cbr->next;
- xfree(pcbr->next);
- pcbr->next = cbr;
- } else
- {
- cbr = cbr->next;
- xfree(cbl->list);
- cbl->list = cbr;
- }
- cbl->numDeleted--;
- }
- else /* this one wasn't deleted */
- {
- pcbr = cbr;
- cbr = cbr->next;
- }
- }
- }
-}
-
-static void
-_DeleteCallbackList(
- CallbackListPtr *pcbl)
-{
- CallbackListPtr cbl = *pcbl;
- CallbackPtr cbr, nextcbr;
- int i;
-
- if (cbl->inCallback)
- {
- cbl->deleted = TRUE;
- return;
- }
-
- for (i = 0; i < numCallbackListsToCleanup; i++)
- {
- if ((listsToCleanup[i] = pcbl) != 0)
- {
- listsToCleanup[i] = NULL;
- break;
- }
- }
-
- for (cbr = cbl->list; cbr != NULL; cbr = nextcbr)
- {
- nextcbr = cbr->next;
- xfree(cbr);
- }
- xfree(cbl);
- *pcbl = NULL;
-}
-
-static CallbackFuncsRec default_cbfuncs =
-{
- _AddCallback,
- _DeleteCallback,
- _CallCallbacks,
- _DeleteCallbackList
-};
-
-/* ===== Public Procedures ===== */
-
-Bool
-CreateCallbackList(pcbl, cbfuncs)
- CallbackListPtr *pcbl;
- CallbackFuncsPtr cbfuncs;
-{
- CallbackListPtr cbl;
- int i;
-
- if (!pcbl) return FALSE;
- cbl = (CallbackListPtr) xalloc(sizeof(CallbackListRec));
- if (!cbl) return FALSE;
- cbl->funcs = cbfuncs ? *cbfuncs : default_cbfuncs;
- cbl->inCallback = 0;
- cbl->deleted = FALSE;
- cbl->numDeleted = 0;
- cbl->list = NULL;
- *pcbl = cbl;
-
- for (i = 0; i < numCallbackListsToCleanup; i++)
- {
- if (!listsToCleanup[i])
- {
- listsToCleanup[i] = pcbl;
- return TRUE;
- }
- }
-
- listsToCleanup = (CallbackListPtr **)xnfrealloc(listsToCleanup,
- sizeof(CallbackListPtr *) * (numCallbackListsToCleanup+1));
- listsToCleanup[numCallbackListsToCleanup] = pcbl;
- numCallbackListsToCleanup++;
- return TRUE;
-}
-
-Bool
-AddCallback(pcbl, callback, data)
- CallbackListPtr *pcbl;
- CallbackProcPtr callback;
- pointer data;
-{
- if (!pcbl) return FALSE;
- if (!*pcbl)
- { /* list hasn't been created yet; go create it */
- if (!CreateCallbackList(pcbl, (CallbackFuncsPtr)NULL))
- return FALSE;
- }
- return ((*(*pcbl)->funcs.AddCallback) (pcbl, callback, data));
-}
-
-Bool
-DeleteCallback(pcbl, callback, data)
- CallbackListPtr *pcbl;
- CallbackProcPtr callback;
- pointer data;
-{
- if (!pcbl || !*pcbl) return FALSE;
- return ((*(*pcbl)->funcs.DeleteCallback) (pcbl, callback, data));
-}
-
-void
-CallCallbacks(pcbl, call_data)
- CallbackListPtr *pcbl;
- pointer call_data;
-{
- if (!pcbl || !*pcbl) return;
- (*(*pcbl)->funcs.CallCallbacks) (pcbl, call_data);
-}
-
-void
-DeleteCallbackList(pcbl)
- CallbackListPtr *pcbl;
-{
- if (!pcbl || !*pcbl) return;
- (*(*pcbl)->funcs.DeleteCallbackList) (pcbl);
-}
-
-void
-InitCallbackManager()
-{
- int i;
-
- for (i = 0; i < numCallbackListsToCleanup; i++)
- {
- DeleteCallbackList(listsToCleanup[i]);
- }
- if (listsToCleanup) xfree(listsToCleanup);
-
- numCallbackListsToCleanup = 0;
- listsToCleanup = NULL;
-}
diff --git a/dix/events.c b/dix/events.c
deleted file mode 100644
index 2131b5fd4..000000000
--- a/dix/events.c
+++ /dev/null
@@ -1,4500 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.50 2003/11/17 22:20:34 dawes Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "resource.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "windowstr.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-
-#include "dixstruct.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-#include "globals.h"
-
-#ifdef XKB
-#include "XKBsrv.h"
-extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
-#endif
-
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-
-#include "XIproto.h"
-#include "exevents.h"
-#include "extnsionst.h"
-
-#include "dixevents.h"
-#include "dixgrabs.h"
-#include "dispatch.h"
-
-#define EXTENSION_EVENT_BASE 64
-
-#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */
-#define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask )
-#define AllButtonsMask ( \
- Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask )
-#define MotionMask ( \
- PointerMotionMask | Button1MotionMask | \
- Button2MotionMask | Button3MotionMask | Button4MotionMask | \
- Button5MotionMask | ButtonMotionMask )
-#define PropagateMask ( \
- KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
- MotionMask )
-#define PointerGrabMask ( \
- ButtonPressMask | ButtonReleaseMask | \
- EnterWindowMask | LeaveWindowMask | \
- PointerMotionHintMask | KeymapStateMask | \
- MotionMask )
-#define AllModifiersMask ( \
- ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
- Mod3Mask | Mod4Mask | Mod5Mask )
-#define AllEventMasks (lastEventMask|(lastEventMask-1))
-/*
- * The following relies on the fact that the Button<n>MotionMasks are equal
- * to the corresponding Button<n>Masks from the current modifier/button state.
- */
-#define Motion_Filter(class) (PointerMotionMask | \
- (class)->state | (class)->motionMask)
-
-
-#define WID(w) ((w) ? ((w)->drawable.id) : 0)
-
-#define XE_KBPTR (xE->u.keyButtonPointer)
-
-
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
-CallbackListPtr EventCallback;
-CallbackListPtr DeviceEventCallback;
-
-#define DNPMCOUNT 8
-
-Mask DontPropagateMasks[DNPMCOUNT];
-static int DontPropagateRefCnts[DNPMCOUNT];
-
-#ifdef DEBUG
-static debug_events = 0;
-#endif
-InputInfo inputInfo;
-
-static struct {
- QdEventPtr pending, *pendtail;
- DeviceIntPtr replayDev; /* kludgy rock to put flag for */
- WindowPtr replayWin; /* ComputeFreezes */
- Bool playingEvents;
- TimeStamp time;
-} syncEvents;
-
-/*
- * The window trace information is used to avoid having to compute all the
- * windows between the root and the current pointer window each time a button
- * or key goes down. The grabs on each of those windows must be checked.
- */
-static WindowPtr *spriteTrace = (WindowPtr *)NULL;
-#define ROOT spriteTrace[0]
-static int spriteTraceSize = 0;
-static int spriteTraceGood;
-
-typedef struct {
- int x, y;
- ScreenPtr pScreen;
-} HotSpot;
-
-static struct {
- CursorPtr current;
- BoxRec hotLimits; /* logical constraints of hot spot */
- Bool confined; /* confined to screen */
-#if defined(SHAPE) || defined(PANORAMIX)
- RegionPtr hotShape; /* additional logical shape constraint */
-#endif
- BoxRec physLimits; /* physical constraints of hot spot */
- WindowPtr win; /* window of logical position */
- HotSpot hot; /* logical pointer position */
- HotSpot hotPhys; /* physical pointer position */
-#ifdef PANORAMIX
- ScreenPtr screen; /* all others are in Screen 0 coordinates */
- RegionRec Reg1; /* Region 1 for confining motion */
- RegionRec Reg2; /* Region 2 for confining virtual motion */
- WindowPtr windows[MAXSCREENS];
- WindowPtr confineWin; /* confine window */
-#endif
-} sprite; /* info about the cursor sprite */
-
-static void DoEnterLeaveEvents(
- WindowPtr /*fromWin*/,
- WindowPtr /*toWin*/,
- int /*mode*/
-);
-
-static WindowPtr XYToWindow(
- int /*x*/,
- int /*y*/
-);
-
-extern int lastEvent;
-
-static Mask lastEventMask;
-
-#ifdef XINPUT
-extern int DeviceMotionNotify;
-#endif
-
-#define CantBeFiltered NoEventMask
-static Mask filters[128] =
-{
- NoSuchEvent, /* 0 */
- NoSuchEvent, /* 1 */
- KeyPressMask, /* KeyPress */
- KeyReleaseMask, /* KeyRelease */
- ButtonPressMask, /* ButtonPress */
- ButtonReleaseMask, /* ButtonRelease */
- PointerMotionMask, /* MotionNotify (initial state) */
- EnterWindowMask, /* EnterNotify */
- LeaveWindowMask, /* LeaveNotify */
- FocusChangeMask, /* FocusIn */
- FocusChangeMask, /* FocusOut */
- KeymapStateMask, /* KeymapNotify */
- ExposureMask, /* Expose */
- CantBeFiltered, /* GraphicsExpose */
- CantBeFiltered, /* NoExpose */
- VisibilityChangeMask, /* VisibilityNotify */
- SubstructureNotifyMask, /* CreateNotify */
- StructureAndSubMask, /* DestroyNotify */
- StructureAndSubMask, /* UnmapNotify */
- StructureAndSubMask, /* MapNotify */
- SubstructureRedirectMask, /* MapRequest */
- StructureAndSubMask, /* ReparentNotify */
- StructureAndSubMask, /* ConfigureNotify */
- SubstructureRedirectMask, /* ConfigureRequest */
- StructureAndSubMask, /* GravityNotify */
- ResizeRedirectMask, /* ResizeRequest */
- StructureAndSubMask, /* CirculateNotify */
- SubstructureRedirectMask, /* CirculateRequest */
- PropertyChangeMask, /* PropertyNotify */
- CantBeFiltered, /* SelectionClear */
- CantBeFiltered, /* SelectionRequest */
- CantBeFiltered, /* SelectionNotify */
- ColormapChangeMask, /* ColormapNotify */
- CantBeFiltered, /* ClientMessage */
- CantBeFiltered /* MappingNotify */
-};
-
-static CARD8 criticalEvents[32] =
-{
- 0x7c /* key and button events */
-};
-
-#ifdef PANORAMIX
-
-static void ConfineToShape(RegionPtr shape, int *px, int *py);
-static void SyntheticMotion(int x, int y);
-static void PostNewCursor(void);
-
-static Bool
-XineramaSetCursorPosition(
- int x,
- int y,
- Bool generateEvent
-){
- ScreenPtr pScreen;
- BoxRec box;
- int i;
-
- /* x,y are in Screen 0 coordinates. We need to decide what Screen
- to send the message too and what the coordinates relative to
- that screen are. */
-
- pScreen = sprite.screen;
- x += panoramiXdataPtr[0].x;
- y += panoramiXdataPtr[0].y;
-
- if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- x, y, &box))
- {
- FOR_NSCREENS(i)
- {
- if(i == pScreen->myNum)
- continue;
- if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
- {
- pScreen = screenInfo.screens[i];
- break;
- }
- }
- }
-
- sprite.screen = pScreen;
- sprite.hotPhys.x = x - panoramiXdataPtr[0].x;
- sprite.hotPhys.y = y - panoramiXdataPtr[0].y;
- x -= panoramiXdataPtr[pScreen->myNum].x;
- y -= panoramiXdataPtr[pScreen->myNum].y;
-
- return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent);
-}
-
-
-static void
-XineramaConstrainCursor(void)
-{
- ScreenPtr pScreen = sprite.screen;
- BoxRec newBox = sprite.physLimits;
-
- /* Translate the constraining box to the screen
- the sprite is actually on */
- newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
- newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
- newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
- newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
-
- (* pScreen->ConstrainCursor)(pScreen, &newBox);
-}
-
-static void
-XineramaCheckPhysLimits(
- CursorPtr cursor,
- Bool generateEvents
-){
- HotSpot new;
-
- if (!cursor)
- return;
-
- new = sprite.hotPhys;
-
- /* I don't care what the DDX has to say about it */
- sprite.physLimits = sprite.hotLimits;
-
- /* constrain the pointer to those limits */
- if (new.x < sprite.physLimits.x1)
- new.x = sprite.physLimits.x1;
- else
- if (new.x >= sprite.physLimits.x2)
- new.x = sprite.physLimits.x2 - 1;
- if (new.y < sprite.physLimits.y1)
- new.y = sprite.physLimits.y1;
- else
- if (new.y >= sprite.physLimits.y2)
- new.y = sprite.physLimits.y2 - 1;
-
- if (sprite.hotShape) /* more work if the shape is a mess */
- ConfineToShape(sprite.hotShape, &new.x, &new.y);
-
- if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y))
- {
- XineramaSetCursorPosition (new.x, new.y, generateEvents);
- if (!generateEvents)
- SyntheticMotion(new.x, new.y);
- }
-
- /* Tell DDX what the limits are */
- XineramaConstrainCursor();
-}
-
-
-static Bool
-XineramaSetWindowPntrs(WindowPtr pWin)
-{
- if(pWin == WindowTable[0]) {
- memcpy(sprite.windows, WindowTable,
- PanoramiXNumScreens*sizeof(WindowPtr));
- } else {
- PanoramiXRes *win;
- int i;
-
- win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW);
-
- if(!win)
- return FALSE;
-
- for(i = 0; i < PanoramiXNumScreens; i++) {
- sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW);
- if(!sprite.windows[i]) /* window is being unmapped */
- return FALSE;
- }
- }
- return TRUE;
-}
-
-static void
-XineramaCheckVirtualMotion(
- QdEventPtr qe,
- WindowPtr pWin
-){
-
- if (qe)
- {
- sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
- sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
- sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
- pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
- NullWindow;
- }
- if (pWin)
- {
- int x, y, off_x, off_y, i;
- BoxRec lims;
-
- if(!XineramaSetWindowPntrs(pWin))
- return;
-
- i = PanoramiXNumScreens - 1;
-
- REGION_COPY(sprite.screen, &sprite.Reg2,
- &sprite.windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
-
- while(i--) {
- x = off_x - panoramiXdataPtr[i].x;
- y = off_y - panoramiXdataPtr[i].y;
-
- if(x || y)
- REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y);
-
- REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2,
- &sprite.windows[i]->borderSize);
-
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
- }
-
- lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
-
- if (sprite.hot.x < lims.x1)
- sprite.hot.x = lims.x1;
- else if (sprite.hot.x >= lims.x2)
- sprite.hot.x = lims.x2 - 1;
- if (sprite.hot.y < lims.y1)
- sprite.hot.y = lims.y1;
- else if (sprite.hot.y >= lims.y2)
- sprite.hot.y = lims.y2 - 1;
-
- if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
- ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y);
-
- if (qe)
- {
- qe->pScreen = sprite.hot.pScreen;
- qe->event->u.keyButtonPointer.rootX = sprite.hot.x;
- qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
- }
- }
-}
-
-
-static Bool
-XineramaCheckMotion(xEvent *xE)
-{
- WindowPtr prevSpriteWin = sprite.win;
-
- if (xE && !syncEvents.playingEvents)
- {
- /* Motion events entering DIX get translated to Screen 0
- coordinates. Replayed events have already been
- translated since they've entered DIX before */
- XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x -
- panoramiXdataPtr[0].x;
- XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
- panoramiXdataPtr[0].y;
-
- sprite.hot.x = XE_KBPTR.rootX;
- sprite.hot.y = XE_KBPTR.rootY;
- if (sprite.hot.x < sprite.physLimits.x1)
- sprite.hot.x = sprite.physLimits.x1;
- else if (sprite.hot.x >= sprite.physLimits.x2)
- sprite.hot.x = sprite.physLimits.x2 - 1;
- if (sprite.hot.y < sprite.physLimits.y1)
- sprite.hot.y = sprite.physLimits.y1;
- else if (sprite.hot.y >= sprite.physLimits.y2)
- sprite.hot.y = sprite.physLimits.y2 - 1;
-
- if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
-
- sprite.hotPhys = sprite.hot;
- if ((sprite.hotPhys.x != XE_KBPTR.rootX) ||
- (sprite.hotPhys.y != XE_KBPTR.rootY))
- {
- XineramaSetCursorPosition(
- sprite.hotPhys.x, sprite.hotPhys.y, FALSE);
- }
- XE_KBPTR.rootX = sprite.hot.x;
- XE_KBPTR.rootY = sprite.hot.y;
- }
-
- sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
-
- if (sprite.win != prevSpriteWin)
- {
- if (prevSpriteWin != NullWindow) {
- if (!xE)
- UpdateCurrentTimeIf();
- DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal);
- }
- PostNewCursor();
- return FALSE;
- }
- return TRUE;
-}
-
-
-static void
-XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
-{
-
- if (syncEvents.playingEvents)
- {
- XineramaCheckVirtualMotion((QdEventPtr)NULL, pWin);
- SyntheticMotion(sprite.hot.x, sprite.hot.y);
- }
- else
- {
- int x, y, off_x, off_y, i;
-
- if(!XineramaSetWindowPntrs(pWin))
- return;
-
- i = PanoramiXNumScreens - 1;
-
- REGION_COPY(sprite.screen, &sprite.Reg1,
- &sprite.windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
-
- while(i--) {
- x = off_x - panoramiXdataPtr[i].x;
- y = off_y - panoramiXdataPtr[i].y;
-
- if(x || y)
- REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y);
-
- REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1,
- &sprite.windows[i]->borderSize);
-
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
- }
-
- sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1);
-
- if(REGION_NUM_RECTS(&sprite.Reg1) > 1)
- sprite.hotShape = &sprite.Reg1;
- else
- sprite.hotShape = NullRegion;
-
- sprite.confined = FALSE;
- sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin;
-
- XineramaCheckPhysLimits(sprite.current, generateEvents);
- }
-}
-
-
-static void
-XineramaChangeToCursor(CursorPtr cursor)
-{
- if (cursor != sprite.current)
- {
- if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
- (sprite.current->bits->yhot != cursor->bits->yhot))
- XineramaCheckPhysLimits(cursor, FALSE);
- (*sprite.screen->DisplayCursor)(sprite.screen, cursor);
- sprite.current = cursor;
- }
-}
-
-
-#endif /* PANORAMIX */
-
-void
-SetMaskForEvent(mask, event)
- Mask mask;
- int event;
-{
- if ((event < LASTEvent) || (event >= 128))
- FatalError("SetMaskForEvent: bogus event number");
- filters[event] = mask;
-}
-
-void
-SetCriticalEvent(event)
- int event;
-{
- if (event >= 128)
- FatalError("SetCriticalEvent: bogus event number");
- criticalEvents[event >> 3] |= 1 << (event & 7);
-}
-
-static void
-SyntheticMotion(int x, int y)
-{
- xEvent xE;
-
-#ifdef PANORAMIX
- /* Translate back to the sprite screen since processInputProc
- will translate from sprite screen to screen 0 upon reentry
- to the DIX layer */
- if(!noPanoramiXExtension) {
- x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x;
- y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y;
- }
-#endif
- xE.u.keyButtonPointer.rootX = x;
- xE.u.keyButtonPointer.rootY = y;
- if (syncEvents.playingEvents)
- xE.u.keyButtonPointer.time = syncEvents.time.milliseconds;
- else
- xE.u.keyButtonPointer.time = currentTime.milliseconds;
- xE.u.u.type = MotionNotify;
- (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1);
-}
-
-#ifdef SHAPE
-static void
-ConfineToShape(RegionPtr shape, int *px, int *py)
-{
- BoxRec box;
- int x = *px, y = *py;
- int incx = 1, incy = 1;
-
- if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box))
- return;
- box = *REGION_EXTENTS(sprite.hot.pScreen, shape);
- /* this is rather crude */
- do {
- x += incx;
- if (x >= box.x2)
- {
- incx = -1;
- x = *px - 1;
- }
- else if (x < box.x1)
- {
- incx = 1;
- x = *px;
- y += incy;
- if (y >= box.y2)
- {
- incy = -1;
- y = *py - 1;
- }
- else if (y < box.y1)
- return; /* should never get here! */
- }
- } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box));
- *px = x;
- *py = y;
-}
-#endif
-
-static void
-CheckPhysLimits(
- CursorPtr cursor,
- Bool generateEvents,
- Bool confineToScreen,
- ScreenPtr pScreen)
-{
- HotSpot new;
-
- if (!cursor)
- return;
- new = sprite.hotPhys;
- if (pScreen)
- new.pScreen = pScreen;
- else
- pScreen = new.pScreen;
- (*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits,
- &sprite.physLimits);
- sprite.confined = confineToScreen;
- (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits);
- if (new.x < sprite.physLimits.x1)
- new.x = sprite.physLimits.x1;
- else
- if (new.x >= sprite.physLimits.x2)
- new.x = sprite.physLimits.x2 - 1;
- if (new.y < sprite.physLimits.y1)
- new.y = sprite.physLimits.y1;
- else
- if (new.y >= sprite.physLimits.y2)
- new.y = sprite.physLimits.y2 - 1;
-#ifdef SHAPE
- if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &new.x, &new.y);
-#endif
- if ((pScreen != sprite.hotPhys.pScreen) ||
- (new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y))
- {
- if (pScreen != sprite.hotPhys.pScreen)
- sprite.hotPhys = new;
- (*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents);
- if (!generateEvents)
- SyntheticMotion(new.x, new.y);
- }
-}
-
-static void
-CheckVirtualMotion(
- register QdEventPtr qe,
- register WindowPtr pWin)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- XineramaCheckVirtualMotion(qe, pWin);
- return;
- }
-#endif
- if (qe)
- {
- sprite.hot.pScreen = qe->pScreen;
- sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
- sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
- pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
- NullWindow;
- }
- if (pWin)
- {
- BoxRec lims;
-
- if (sprite.hot.pScreen != pWin->drawable.pScreen)
- {
- sprite.hot.pScreen = pWin->drawable.pScreen;
- sprite.hot.x = sprite.hot.y = 0;
- }
- lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
- if (sprite.hot.x < lims.x1)
- sprite.hot.x = lims.x1;
- else if (sprite.hot.x >= lims.x2)
- sprite.hot.x = lims.x2 - 1;
- if (sprite.hot.y < lims.y1)
- sprite.hot.y = lims.y1;
- else if (sprite.hot.y >= lims.y2)
- sprite.hot.y = lims.y2 - 1;
-#ifdef SHAPE
- if (wBoundingShape(pWin))
- ConfineToShape(&pWin->borderSize, &sprite.hot.x, &sprite.hot.y);
-#endif
- if (qe)
- {
- qe->pScreen = sprite.hot.pScreen;
- qe->event->u.keyButtonPointer.rootX = sprite.hot.x;
- qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
- }
- }
- ROOT = WindowTable[sprite.hot.pScreen->myNum];
-}
-
-static void
-ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- XineramaConfineCursorToWindow(pWin, generateEvents);
- return;
- }
-#endif
-
- if (syncEvents.playingEvents)
- {
- CheckVirtualMotion((QdEventPtr)NULL, pWin);
- SyntheticMotion(sprite.hot.x, sprite.hot.y);
- }
- else
- {
- sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
-#ifdef SHAPE
- sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize
- : NullRegion;
-#endif
- CheckPhysLimits(sprite.current, generateEvents, confineToScreen,
- pScreen);
- }
-}
-
-Bool
-PointerConfinedToScreen()
-{
- return sprite.confined;
-}
-
-static void
-ChangeToCursor(CursorPtr cursor)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- XineramaChangeToCursor(cursor);
- return;
- }
-#endif
-
- if (cursor != sprite.current)
- {
- if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
- (sprite.current->bits->yhot != cursor->bits->yhot))
- CheckPhysLimits(cursor, FALSE, sprite.confined,
- (ScreenPtr)NULL);
- (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen,
- cursor);
- sprite.current = cursor;
- }
-}
-
-/* returns true if b is a descendent of a */
-Bool
-IsParent(a, b)
- register WindowPtr a, b;
-{
- for (b = b->parent; b; b = b->parent)
- if (b == a) return TRUE;
- return FALSE;
-}
-
-static void
-PostNewCursor(void)
-{
- register WindowPtr win;
- register GrabPtr grab = inputInfo.pointer->grab;
-
- if (syncEvents.playingEvents)
- return;
- if (grab)
- {
- if (grab->cursor)
- {
- ChangeToCursor(grab->cursor);
- return;
- }
- if (IsParent(grab->window, sprite.win))
- win = sprite.win;
- else
- win = grab->window;
- }
- else
- win = sprite.win;
- for (; win; win = win->parent)
- if (win->optional && win->optional->cursor != NullCursor)
- {
- ChangeToCursor(win->optional->cursor);
- return;
- }
-}
-
-WindowPtr
-GetCurrentRootWindow()
-{
- return ROOT;
-}
-
-WindowPtr
-GetSpriteWindow()
-{
- return sprite.win;
-}
-
-CursorPtr
-GetSpriteCursor()
-{
- return sprite.current;
-}
-
-void
-GetSpritePosition(px, py)
- int *px, *py;
-{
- *px = sprite.hotPhys.x;
- *py = sprite.hotPhys.y;
-}
-
-#ifdef PANORAMIX
-int
-XineramaGetCursorScreen()
-{
- if(!noPanoramiXExtension) {
- return sprite.screen->myNum;
- } else {
- return 0;
- }
-}
-#endif /* PANORAMIX */
-
-#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */
-
-static void
-MonthChangedOrBadTime(register xEvent *xE)
-{
- /* If the ddx/OS is careless about not processing timestamped events from
- * different sources in sorted order, then it's possible for time to go
- * backwards when it should not. Here we ensure a decent time.
- */
- if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP)
- currentTime.months++;
- else
- XE_KBPTR.time = currentTime.milliseconds;
-}
-
-#define NoticeTime(xE) { \
- if ((xE)->u.keyButtonPointer.time < currentTime.milliseconds) \
- MonthChangedOrBadTime(xE); \
- currentTime.milliseconds = (xE)->u.keyButtonPointer.time; \
- lastDeviceEventTime = currentTime; }
-
-void
-NoticeEventTime(xE)
- register xEvent *xE;
-{
- if (!syncEvents.playingEvents)
- NoticeTime(xE);
-}
-
-/**************************************************************************
- * The following procedures deal with synchronous events *
- **************************************************************************/
-
-void
-EnqueueEvent(xE, device, count)
- xEvent *xE;
- DeviceIntPtr device;
- int count;
-{
- register QdEventPtr tail = *syncEvents.pendtail;
- register QdEventPtr qe;
- xEvent *qxE;
-
- NoticeTime(xE);
-
-#ifdef XKB
- /* Fix for key repeating bug. */
- if (xE->u.u.type == KeyRelease)
- AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail);
-#endif
-
- if (DeviceEventCallback)
- {
- DeviceEventInfoRec eventinfo;
- /* The RECORD spec says that the root window field of motion events
- * must be valid. At this point, it hasn't been filled in yet, so
- * we do it here. The long expression below is necessary to get
- * the current root window; the apparently reasonable alternative
- * GetCurrentRootWindow()->drawable.id doesn't give you the right
- * answer on the first motion event after a screen change because
- * the data that GetCurrentRootWindow relies on hasn't been
- * updated yet.
- */
- if (xE->u.u.type == MotionNotify)
- XE_KBPTR.root =
- WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
- eventinfo.events = xE;
- eventinfo.count = count;
- CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
- }
- if (xE->u.u.type == MotionNotify)
- {
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x -
- panoramiXdataPtr[0].x;
- XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
- panoramiXdataPtr[0].y;
- }
-#endif
- sprite.hotPhys.x = XE_KBPTR.rootX;
- sprite.hotPhys.y = XE_KBPTR.rootY;
- /* do motion compression */
- if (tail &&
- (tail->event->u.u.type == MotionNotify) &&
- (tail->pScreen == sprite.hotPhys.pScreen))
- {
- tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x;
- tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y;
- tail->event->u.keyButtonPointer.time = XE_KBPTR.time;
- tail->months = currentTime.months;
- return;
- }
- }
- qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent)));
- if (!qe)
- return;
- qe->next = (QdEventPtr)NULL;
- qe->device = device;
- qe->pScreen = sprite.hotPhys.pScreen;
- qe->months = currentTime.months;
- qe->event = (xEvent *)(qe + 1);
- qe->evcount = count;
- for (qxE = qe->event; --count >= 0; qxE++, xE++)
- *qxE = *xE;
- if (tail)
- syncEvents.pendtail = &tail->next;
- *syncEvents.pendtail = qe;
-}
-
-static void
-PlayReleasedEvents(void)
-{
- register QdEventPtr *prev, qe;
- register DeviceIntPtr dev;
-
- prev = &syncEvents.pending;
- while ( (qe = *prev) )
- {
- if (!qe->device->sync.frozen)
- {
- *prev = qe->next;
- if (*syncEvents.pendtail == *prev)
- syncEvents.pendtail = prev;
- if (qe->event->u.u.type == MotionNotify)
- CheckVirtualMotion(qe, NullWindow);
- syncEvents.time.months = qe->months;
- syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time;
-#ifdef PANORAMIX
- /* Translate back to the sprite screen since processInputProc
- will translate from sprite screen to screen 0 upon reentry
- to the DIX layer */
- if(!noPanoramiXExtension) {
- qe->event->u.keyButtonPointer.rootX +=
- panoramiXdataPtr[0].x -
- panoramiXdataPtr[sprite.screen->myNum].x;
- qe->event->u.keyButtonPointer.rootY +=
- panoramiXdataPtr[0].y -
- panoramiXdataPtr[sprite.screen->myNum].y;
- }
-#endif
- (*qe->device->public.processInputProc)(qe->event, qe->device,
- qe->evcount);
- xfree(qe);
- for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next)
- ;
- if (!dev)
- break;
- /* Playing the event may have unfrozen another device. */
- /* So to play it safe, restart at the head of the queue */
- prev = &syncEvents.pending;
- }
- else
- prev = &qe->next;
- }
-}
-
-static void
-FreezeThaw(register DeviceIntPtr dev, Bool frozen)
-{
- dev->sync.frozen = frozen;
- if (frozen)
- dev->public.processInputProc = dev->public.enqueueInputProc;
- else
- dev->public.processInputProc = dev->public.realInputProc;
-}
-
-void
-ComputeFreezes()
-{
- register DeviceIntPtr replayDev = syncEvents.replayDev;
- register int i;
- WindowPtr w;
- register xEvent *xE;
- int count;
- GrabPtr grab;
- register DeviceIntPtr dev;
-
- for (dev = inputInfo.devices; dev; dev = dev->next)
- FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN));
- if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending))
- return;
- syncEvents.playingEvents = TRUE;
- if (replayDev)
- {
- xE = replayDev->sync.event;
- count = replayDev->sync.evcount;
- syncEvents.replayDev = (DeviceIntPtr)NULL;
-
- w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY);
- for (i = 0; i < spriteTraceGood; i++)
- {
- if (syncEvents.replayWin == spriteTrace[i])
- {
- if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) {
- if (replayDev->focus)
- DeliverFocusedEvent(replayDev, xE, w, count);
- else
- DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
- replayDev, count);
- }
- goto playmore;
- }
- }
- /* must not still be in the same stack */
- if (replayDev->focus)
- DeliverFocusedEvent(replayDev, xE, w, count);
- else
- DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count);
- }
-playmore:
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (!dev->sync.frozen)
- {
- PlayReleasedEvents();
- break;
- }
- }
- syncEvents.playingEvents = FALSE;
- /* the following may have been skipped during replay, so do it now */
- if ((grab = inputInfo.pointer->grab) && grab->confineTo)
- {
- if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen)
- sprite.hotPhys.x = sprite.hotPhys.y = 0;
- ConfineCursorToWindow(grab->confineTo, TRUE, TRUE);
- }
- else
- ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum],
- TRUE, FALSE);
- PostNewCursor();
-}
-
-#ifdef RANDR
-void
-ScreenRestructured (ScreenPtr pScreen)
-{
- GrabPtr grab;
-
- if ((grab = inputInfo.pointer->grab) && grab->confineTo)
- {
- if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen)
- sprite.hotPhys.x = sprite.hotPhys.y = 0;
- ConfineCursorToWindow(grab->confineTo, TRUE, TRUE);
- }
- else
- ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum],
- TRUE, FALSE);
-}
-#endif
-
-void
-CheckGrabForSyncs(thisDev, thisMode, otherMode)
- register DeviceIntPtr thisDev;
- Bool thisMode, otherMode;
-{
- register GrabPtr grab = thisDev->grab;
- register DeviceIntPtr dev;
-
- if (thisMode == GrabModeSync)
- thisDev->sync.state = FROZEN_NO_EVENT;
- else
- { /* free both if same client owns both */
- thisDev->sync.state = THAWED;
- if (thisDev->sync.other &&
- (CLIENT_BITS(thisDev->sync.other->resource) ==
- CLIENT_BITS(grab->resource)))
- thisDev->sync.other = NullGrab;
- }
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev != thisDev)
- {
- if (otherMode == GrabModeSync)
- dev->sync.other = grab;
- else
- { /* free both if same client owns both */
- if (dev->sync.other &&
- (CLIENT_BITS(dev->sync.other->resource) ==
- CLIENT_BITS(grab->resource)))
- dev->sync.other = NullGrab;
- }
- }
- }
- ComputeFreezes();
-}
-
-void
-ActivatePointerGrab(mouse, grab, time, autoGrab)
- register GrabPtr grab;
- register DeviceIntPtr mouse;
- TimeStamp time;
- Bool autoGrab;
-{
- WindowPtr oldWin = (mouse->grab) ? mouse->grab->window
- : sprite.win;
-
- if (grab->confineTo)
- {
- if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen)
- sprite.hotPhys.x = sprite.hotPhys.y = 0;
- ConfineCursorToWindow(grab->confineTo, FALSE, TRUE);
- }
- DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab);
- mouse->valuator->motionHintWindow = NullWindow;
- if (syncEvents.playingEvents)
- mouse->grabTime = syncEvents.time;
- else
- mouse->grabTime = time;
- if (grab->cursor)
- grab->cursor->refcnt++;
- mouse->activeGrab = *grab;
- mouse->grab = &mouse->activeGrab;
- mouse->fromPassiveGrab = autoGrab;
- PostNewCursor();
- CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode);
-}
-
-void
-DeactivatePointerGrab(mouse)
- register DeviceIntPtr mouse;
-{
- register GrabPtr grab = mouse->grab;
- register DeviceIntPtr dev;
-
- mouse->valuator->motionHintWindow = NullWindow;
- mouse->grab = NullGrab;
- mouse->sync.state = NOT_GRABBED;
- mouse->fromPassiveGrab = FALSE;
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev->sync.other == grab)
- dev->sync.other = NullGrab;
- }
- DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab);
- if (grab->confineTo)
- ConfineCursorToWindow(ROOT, FALSE, FALSE);
- PostNewCursor();
- if (grab->cursor)
- FreeCursor(grab->cursor, (Cursor)0);
- ComputeFreezes();
-}
-
-void
-ActivateKeyboardGrab(keybd, grab, time, passive)
- register DeviceIntPtr keybd;
- GrabPtr grab;
- TimeStamp time;
- Bool passive;
-{
- WindowPtr oldWin;
-
- if (keybd->grab)
- oldWin = keybd->grab->window;
- else if (keybd->focus)
- oldWin = keybd->focus->win;
- else
- oldWin = sprite.win;
- if (oldWin == FollowKeyboardWin)
- oldWin = inputInfo.keyboard->focus->win;
- if (keybd->valuator)
- keybd->valuator->motionHintWindow = NullWindow;
- DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
- if (syncEvents.playingEvents)
- keybd->grabTime = syncEvents.time;
- else
- keybd->grabTime = time;
- keybd->activeGrab = *grab;
- keybd->grab = &keybd->activeGrab;
- keybd->fromPassiveGrab = passive;
- CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode);
-}
-
-void
-DeactivateKeyboardGrab(keybd)
- register DeviceIntPtr keybd;
-{
- register GrabPtr grab = keybd->grab;
- register DeviceIntPtr dev;
- register WindowPtr focusWin = keybd->focus ? keybd->focus->win
- : sprite.win;
-
- if (focusWin == FollowKeyboardWin)
- focusWin = inputInfo.keyboard->focus->win;
- if (keybd->valuator)
- keybd->valuator->motionHintWindow = NullWindow;
- keybd->grab = NullGrab;
- keybd->sync.state = NOT_GRABBED;
- keybd->fromPassiveGrab = FALSE;
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev->sync.other == grab)
- dev->sync.other = NullGrab;
- }
- DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
- ComputeFreezes();
-}
-
-void
-AllowSome(client, time, thisDev, newState)
- ClientPtr client;
- TimeStamp time;
- register DeviceIntPtr thisDev;
- int newState;
-{
- Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced;
- TimeStamp grabTime;
- register DeviceIntPtr dev;
-
- thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client);
- thisSynced = FALSE;
- otherGrabbed = FALSE;
- othersFrozen = TRUE;
- grabTime = thisDev->grabTime;
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev == thisDev)
- continue;
- if (dev->grab && SameClient(dev->grab, client))
- {
- if (!(thisGrabbed || otherGrabbed) ||
- (CompareTimeStamps(dev->grabTime, grabTime) == LATER))
- grabTime = dev->grabTime;
- otherGrabbed = TRUE;
- if (thisDev->sync.other == dev->grab)
- thisSynced = TRUE;
- if (dev->sync.state < FROZEN)
- othersFrozen = FALSE;
- }
- else if (!dev->sync.other || !SameClient(dev->sync.other, client))
- othersFrozen = FALSE;
- }
- if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced))
- return;
- if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, grabTime) == EARLIER))
- return;
- switch (newState)
- {
- case THAWED: /* Async */
- if (thisGrabbed)
- thisDev->sync.state = THAWED;
- if (thisSynced)
- thisDev->sync.other = NullGrab;
- ComputeFreezes();
- break;
- case FREEZE_NEXT_EVENT: /* Sync */
- if (thisGrabbed)
- {
- thisDev->sync.state = FREEZE_NEXT_EVENT;
- if (thisSynced)
- thisDev->sync.other = NullGrab;
- ComputeFreezes();
- }
- break;
- case THAWED_BOTH: /* AsyncBoth */
- if (othersFrozen)
- {
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev->grab && SameClient(dev->grab, client))
- dev->sync.state = THAWED;
- if (dev->sync.other && SameClient(dev->sync.other, client))
- dev->sync.other = NullGrab;
- }
- ComputeFreezes();
- }
- break;
- case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */
- if (othersFrozen)
- {
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev->grab && SameClient(dev->grab, client))
- dev->sync.state = FREEZE_BOTH_NEXT_EVENT;
- if (dev->sync.other && SameClient(dev->sync.other, client))
- dev->sync.other = NullGrab;
- }
- ComputeFreezes();
- }
- break;
- case NOT_GRABBED: /* Replay */
- if (thisGrabbed && thisDev->sync.state == FROZEN_WITH_EVENT)
- {
- if (thisSynced)
- thisDev->sync.other = NullGrab;
- syncEvents.replayDev = thisDev;
- syncEvents.replayWin = thisDev->grab->window;
- (*thisDev->DeactivateGrab)(thisDev);
- syncEvents.replayDev = (DeviceIntPtr)NULL;
- }
- break;
- case THAW_OTHERS: /* AsyncOthers */
- if (othersFrozen)
- {
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev == thisDev)
- continue;
- if (dev->grab && SameClient(dev->grab, client))
- dev->sync.state = THAWED;
- if (dev->sync.other && SameClient(dev->sync.other, client))
- dev->sync.other = NullGrab;
- }
- ComputeFreezes();
- }
- break;
- }
-}
-
-int
-ProcAllowEvents(client)
- register ClientPtr client;
-{
- TimeStamp time;
- DeviceIntPtr mouse = inputInfo.pointer;
- DeviceIntPtr keybd = inputInfo.keyboard;
- REQUEST(xAllowEventsReq);
-
- REQUEST_SIZE_MATCH(xAllowEventsReq);
- time = ClientTimeToServerTime(stuff->time);
- switch (stuff->mode)
- {
- case ReplayPointer:
- AllowSome(client, time, mouse, NOT_GRABBED);
- break;
- case SyncPointer:
- AllowSome(client, time, mouse, FREEZE_NEXT_EVENT);
- break;
- case AsyncPointer:
- AllowSome(client, time, mouse, THAWED);
- break;
- case ReplayKeyboard:
- AllowSome(client, time, keybd, NOT_GRABBED);
- break;
- case SyncKeyboard:
- AllowSome(client, time, keybd, FREEZE_NEXT_EVENT);
- break;
- case AsyncKeyboard:
- AllowSome(client, time, keybd, THAWED);
- break;
- case SyncBoth:
- AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT);
- break;
- case AsyncBoth:
- AllowSome(client, time, keybd, THAWED_BOTH);
- break;
- default:
- client->errorValue = stuff->mode;
- return BadValue;
- }
- return Success;
-}
-
-void
-ReleaseActiveGrabs(client)
- ClientPtr client;
-{
- register DeviceIntPtr dev;
- Bool done;
-
- /* XXX CloseDownClient should remove passive grabs before
- * releasing active grabs.
- */
- do {
- done = TRUE;
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev->grab && SameClient(dev->grab, client))
- {
- (*dev->DeactivateGrab)(dev);
- done = FALSE;
- }
- }
- } while (!done);
-}
-
-/**************************************************************************
- * The following procedures deal with delivering events *
- **************************************************************************/
-
-int
-TryClientEvents (client, pEvents, count, mask, filter, grab)
- ClientPtr client;
- GrabPtr grab;
- xEvent *pEvents;
- int count;
- Mask mask, filter;
-{
- int i;
- int type;
-
-#ifdef DEBUG
- if (debug_events) ErrorF(
- "Event([%d, %d], mask=0x%x), client=%d",
- pEvents->u.u.type, pEvents->u.u.detail, mask, client->index);
-#endif
- if ((client) && (client != serverClient) && (!client->clientGone) &&
- ((filter == CantBeFiltered) || (mask & filter)))
- {
- if (grab && !SameClient(grab, client))
- return -1; /* don't send, but notify caller */
- type = pEvents->u.u.type;
- if (type == MotionNotify)
- {
- if (mask & PointerMotionHintMask)
- {
- if (WID(inputInfo.pointer->valuator->motionHintWindow) ==
- pEvents->u.keyButtonPointer.event)
- {
-#ifdef DEBUG
- if (debug_events) ErrorF("\n");
- fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n");
-#endif
- return 1; /* don't send, but pretend we did */
- }
- pEvents->u.u.detail = NotifyHint;
- }
- else
- {
- pEvents->u.u.detail = NotifyNormal;
- }
- }
-#ifdef XINPUT
- else
- {
- if ((type == DeviceMotionNotify) &&
- MaybeSendDeviceMotionNotifyHint
- ((deviceKeyButtonPointer*)pEvents, mask) != 0)
- return 1;
- }
-#endif
- type &= 0177;
- if (type != KeymapNotify)
- {
- /* all extension events must have a sequence number */
- for (i = 0; i < count; i++)
- pEvents[i].u.u.sequenceNumber = client->sequence;
- }
-
- if (BitIsOn(criticalEvents, type))
- {
-#ifdef SMART_SCHEDULE
- if (client->smart_priority < SMART_MAX_PRIORITY)
- client->smart_priority++;
-#endif
- SetCriticalOutputPending();
- }
-
- WriteEventsToClient(client, count, pEvents);
-#ifdef DEBUG
- if (debug_events) ErrorF( " delivered\n");
-#endif
- return 1;
- }
- else
- {
-#ifdef DEBUG
- if (debug_events) ErrorF("\n");
-#endif
- return 0;
- }
-}
-
-int
-DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx)
- register WindowPtr pWin;
- GrabPtr grab;
- xEvent *pEvents;
- int count;
- Mask filter;
- int mskidx;
-{
- int deliveries = 0, nondeliveries = 0;
- int attempt;
- register InputClients *other;
- ClientPtr client = NullClient;
- Mask deliveryMask = 0; /* If a grab occurs due to a button press, then
- this mask is the mask of the grab. */
- int type = pEvents->u.u.type;
-
- /* CantBeFiltered means only window owner gets the event */
- if ((filter == CantBeFiltered) || !(type & EXTENSION_EVENT_BASE))
- {
- /* if nobody ever wants to see this event, skip some work */
- if (filter != CantBeFiltered &&
- !((wOtherEventMasks(pWin)|pWin->eventMask) & filter))
- return 0;
- if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count,
- pWin->eventMask, filter, grab)) )
- {
- if (attempt > 0)
- {
- deliveries++;
- client = wClient(pWin);
- deliveryMask = pWin->eventMask;
- } else
- nondeliveries--;
- }
- }
- if (filter != CantBeFiltered)
- {
- if (type & EXTENSION_EVENT_BASE)
- {
- OtherInputMasks *inputMasks;
-
- inputMasks = wOtherInputMasks(pWin);
- if (!inputMasks ||
- !(inputMasks->inputEvents[mskidx] & filter))
- return 0;
- other = inputMasks->inputClients;
- }
- else
- other = (InputClients *)wOtherClients(pWin);
- for (; other; other = other->next)
- {
- if ( (attempt = TryClientEvents(rClient(other), pEvents, count,
- other->mask[mskidx], filter, grab)) )
- {
- if (attempt > 0)
- {
- deliveries++;
- client = rClient(other);
- deliveryMask = other->mask[mskidx];
- } else
- nondeliveries--;
- }
- }
- }
- if ((type == ButtonPress) && deliveries && (!grab))
- {
- GrabRec tempGrab;
-
- tempGrab.device = inputInfo.pointer;
- tempGrab.resource = client->clientAsMask;
- tempGrab.window = pWin;
- tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE;
- tempGrab.eventMask = deliveryMask;
- tempGrab.keyboardMode = GrabModeAsync;
- tempGrab.pointerMode = GrabModeAsync;
- tempGrab.confineTo = NullWindow;
- tempGrab.cursor = NullCursor;
- (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab,
- currentTime, TRUE);
- }
- else if ((type == MotionNotify) && deliveries)
- inputInfo.pointer->valuator->motionHintWindow = pWin;
-#ifdef XINPUT
- else
- {
- if (((type == DeviceMotionNotify) || (type == DeviceButtonPress)) &&
- deliveries)
- CheckDeviceGrabAndHintWindow (pWin, type,
- (deviceKeyButtonPointer*) pEvents,
- grab, client, deliveryMask);
- }
-#endif
- if (deliveries)
- return deliveries;
- return nondeliveries;
-}
-
-/* If the event goes to dontClient, don't send it and return 0. if
- send works, return 1 or if send didn't work, return 2.
- Only works for core events.
-*/
-
-#ifdef PANORAMIX
-static int
-XineramaTryClientEventsResult(
- ClientPtr client,
- GrabPtr grab,
- Mask mask,
- Mask filter
-){
- if ((client) && (client != serverClient) && (!client->clientGone) &&
- ((filter == CantBeFiltered) || (mask & filter)))
- {
- if (grab && !SameClient(grab, client)) return -1;
- else return 1;
- }
- return 0;
-}
-#endif
-
-int
-MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
- register WindowPtr pWin;
- xEvent *pEvents;
- int count;
- Mask filter;
- ClientPtr dontClient;
-{
- register OtherClients *other;
-
-
- if (pWin->eventMask & filter)
- {
- if (wClient(pWin) == dontClient)
- return 0;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
- return XineramaTryClientEventsResult(
- wClient(pWin), NullGrab, pWin->eventMask, filter);
-#endif
- return TryClientEvents(wClient(pWin), pEvents, count,
- pWin->eventMask, filter, NullGrab);
- }
- for (other = wOtherClients(pWin); other; other = other->next)
- {
- if (other->mask & filter)
- {
- if (SameClient(other, dontClient))
- return 0;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
- return XineramaTryClientEventsResult(
- rClient(other), NullGrab, other->mask, filter);
-#endif
- return TryClientEvents(rClient(other), pEvents, count,
- other->mask, filter, NullGrab);
- }
- }
- return 2;
-}
-
-static void
-FixUpEventFromWindow(
- xEvent *xE,
- WindowPtr pWin,
- Window child,
- Bool calcChild)
-{
- if (calcChild)
- {
- WindowPtr w=spriteTrace[spriteTraceGood-1];
- /* If the search ends up past the root should the child field be
- set to none or should the value in the argument be passed
- through. It probably doesn't matter since everyone calls
- this function with child == None anyway. */
-
- while (w)
- {
- /* If the source window is same as event window, child should be
- none. Don't bother going all all the way back to the root. */
-
- if (w == pWin)
- {
- child = None;
- break;
- }
-
- if (w->parent == pWin)
- {
- child = w->drawable.id;
- break;
- }
- w = w->parent;
- }
- }
- XE_KBPTR.root = ROOT->drawable.id;
- XE_KBPTR.event = pWin->drawable.id;
- if (sprite.hot.pScreen == pWin->drawable.pScreen)
- {
- XE_KBPTR.sameScreen = xTrue;
- XE_KBPTR.child = child;
- XE_KBPTR.eventX =
- XE_KBPTR.rootX - pWin->drawable.x;
- XE_KBPTR.eventY =
- XE_KBPTR.rootY - pWin->drawable.y;
- }
- else
- {
- XE_KBPTR.sameScreen = xFalse;
- XE_KBPTR.child = None;
- XE_KBPTR.eventX = 0;
- XE_KBPTR.eventY = 0;
- }
-}
-
-int
-DeliverDeviceEvents(pWin, xE, grab, stopAt, dev, count)
- register WindowPtr pWin, stopAt;
- register xEvent *xE;
- GrabPtr grab;
- DeviceIntPtr dev;
- int count;
-{
- Window child = None;
- int type = xE->u.u.type;
- Mask filter = filters[type];
- int deliveries = 0;
-
- if (type & EXTENSION_EVENT_BASE)
- {
- register OtherInputMasks *inputMasks;
- int mskidx = dev->id;
-
- inputMasks = wOtherInputMasks(pWin);
- if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx]))
- return 0;
- while (pWin)
- {
- if (inputMasks && (inputMasks->inputEvents[mskidx] & filter))
- {
- FixUpEventFromWindow(xE, pWin, child, FALSE);
- deliveries = DeliverEventsToWindow(pWin, xE, count, filter,
- grab, mskidx);
- if (deliveries > 0)
- return deliveries;
- }
- if ((deliveries < 0) ||
- (pWin == stopAt) ||
- (inputMasks &&
- (filter & inputMasks->dontPropagateMask[mskidx])))
- return 0;
- child = pWin->drawable.id;
- pWin = pWin->parent;
- if (pWin)
- inputMasks = wOtherInputMasks(pWin);
- }
- }
- else
- {
- if (!(filter & pWin->deliverableEvents))
- return 0;
- while (pWin)
- {
- if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter)
- {
- FixUpEventFromWindow(xE, pWin, child, FALSE);
- deliveries = DeliverEventsToWindow(pWin, xE, count, filter,
- grab, 0);
- if (deliveries > 0)
- return deliveries;
- }
- if ((deliveries < 0) ||
- (pWin == stopAt) ||
- (filter & wDontPropagateMask(pWin)))
- return 0;
- child = pWin->drawable.id;
- pWin = pWin->parent;
- }
- }
- return 0;
-}
-
-/* not useful for events that propagate up the tree or extension events */
-int
-DeliverEvents(pWin, xE, count, otherParent)
- register WindowPtr pWin, otherParent;
- register xEvent *xE;
- int count;
-{
- Mask filter;
- int deliveries;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
- return count;
-#endif
-
- if (!count)
- return 0;
- filter = filters[xE->u.u.type];
- if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify))
- xE->u.destroyNotify.event = pWin->drawable.id;
- if (filter != StructureAndSubMask)
- return DeliverEventsToWindow(pWin, xE, count, filter, NullGrab, 0);
- deliveries = DeliverEventsToWindow(pWin, xE, count, StructureNotifyMask,
- NullGrab, 0);
- if (pWin->parent)
- {
- xE->u.destroyNotify.event = pWin->parent->drawable.id;
- deliveries += DeliverEventsToWindow(pWin->parent, xE, count,
- SubstructureNotifyMask, NullGrab,
- 0);
- if (xE->u.u.type == ReparentNotify)
- {
- xE->u.destroyNotify.event = otherParent->drawable.id;
- deliveries += DeliverEventsToWindow(otherParent, xE, count,
- SubstructureNotifyMask,
- NullGrab, 0);
- }
- }
- return deliveries;
-}
-
-
-static Bool
-PointInBorderSize(WindowPtr pWin, int x, int y)
-{
- BoxRec box;
-
- if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box))
- return TRUE;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) {
- int i;
-
- for(i = 1; i < PanoramiXNumScreens; i++) {
- if(POINT_IN_REGION(sprite.screen,
- &sprite.windows[i]->borderSize,
- x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
- y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
- &box))
- return TRUE;
- }
- }
-#endif
- return FALSE;
-}
-
-static WindowPtr
-XYToWindow(int x, int y)
-{
- register WindowPtr pWin;
-
- spriteTraceGood = 1; /* root window still there */
- pWin = ROOT->firstChild;
- while (pWin)
- {
- if ((pWin->mapped) &&
- (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
- (x < pWin->drawable.x + (int)pWin->drawable.width +
- wBorderWidth(pWin)) &&
- (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
- (y < pWin->drawable.y + (int)pWin->drawable.height +
- wBorderWidth (pWin))
-#ifdef SHAPE
- /* When a window is shaped, a further check
- * is made to see if the point is inside
- * borderSize
- */
- && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
-#endif
- )
- {
- if (spriteTraceGood >= spriteTraceSize)
- {
- spriteTraceSize += 10;
- Must_have_memory = TRUE; /* XXX */
- spriteTrace = (WindowPtr *)xrealloc(
- spriteTrace, spriteTraceSize*sizeof(WindowPtr));
- Must_have_memory = FALSE; /* XXX */
- }
- spriteTrace[spriteTraceGood++] = pWin;
- pWin = pWin->firstChild;
- }
- else
- pWin = pWin->nextSib;
- }
- return spriteTrace[spriteTraceGood-1];
-}
-
-static Bool
-CheckMotion(xEvent *xE)
-{
- WindowPtr prevSpriteWin = sprite.win;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return XineramaCheckMotion(xE);
-#endif
-
- if (xE && !syncEvents.playingEvents)
- {
- if (sprite.hot.pScreen != sprite.hotPhys.pScreen)
- {
- sprite.hot.pScreen = sprite.hotPhys.pScreen;
- ROOT = WindowTable[sprite.hot.pScreen->myNum];
- }
- sprite.hot.x = XE_KBPTR.rootX;
- sprite.hot.y = XE_KBPTR.rootY;
- if (sprite.hot.x < sprite.physLimits.x1)
- sprite.hot.x = sprite.physLimits.x1;
- else if (sprite.hot.x >= sprite.physLimits.x2)
- sprite.hot.x = sprite.physLimits.x2 - 1;
- if (sprite.hot.y < sprite.physLimits.y1)
- sprite.hot.y = sprite.physLimits.y1;
- else if (sprite.hot.y >= sprite.physLimits.y2)
- sprite.hot.y = sprite.physLimits.y2 - 1;
-#ifdef SHAPE
- if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
-#endif
- sprite.hotPhys = sprite.hot;
- if ((sprite.hotPhys.x != XE_KBPTR.rootX) ||
- (sprite.hotPhys.y != XE_KBPTR.rootY))
- {
- (*sprite.hotPhys.pScreen->SetCursorPosition)(
- sprite.hotPhys.pScreen,
- sprite.hotPhys.x, sprite.hotPhys.y, FALSE);
- }
- XE_KBPTR.rootX = sprite.hot.x;
- XE_KBPTR.rootY = sprite.hot.y;
- }
-
- sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
-#ifdef notyet
- if (!(sprite.win->deliverableEvents &
- Motion_Filter(inputInfo.pointer->button))
- !syncEvents.playingEvents)
- {
- /* XXX Do PointerNonInterestBox here */
- }
-#endif
- if (sprite.win != prevSpriteWin)
- {
- if (prevSpriteWin != NullWindow) {
- if (!xE)
- UpdateCurrentTimeIf();
- DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal);
- }
- PostNewCursor();
- return FALSE;
- }
- return TRUE;
-}
-
-void
-WindowsRestructured()
-{
- (void) CheckMotion((xEvent *)NULL);
-}
-
-void
-DefineInitialRootWindow(win)
- register WindowPtr win;
-{
- register ScreenPtr pScreen = win->drawable.pScreen;
-
- sprite.hotPhys.pScreen = pScreen;
- sprite.hotPhys.x = pScreen->width / 2;
- sprite.hotPhys.y = pScreen->height / 2;
- sprite.hot = sprite.hotPhys;
- sprite.hotLimits.x2 = pScreen->width;
- sprite.hotLimits.y2 = pScreen->height;
- sprite.win = win;
- sprite.current = wCursor (win);
- spriteTraceGood = 1;
- ROOT = win;
- (*pScreen->CursorLimits) (
- pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits);
- sprite.confined = FALSE;
- (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits);
- (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
- (*pScreen->DisplayCursor) (pScreen, sprite.current);
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- sprite.hotLimits.x1 = -panoramiXdataPtr[0].x;
- sprite.hotLimits.y1 = -panoramiXdataPtr[0].y;
- sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x;
- sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
- sprite.physLimits = sprite.hotLimits;
- sprite.confineWin = NullWindow;
-#ifdef SHAPE
- sprite.hotShape = NullRegion;
-#endif
- sprite.screen = pScreen;
- /* gotta UNINIT these someplace */
- REGION_NULL(pScreen, &sprite.Reg1);
- REGION_NULL(pScreen, &sprite.Reg2);
- }
-#endif
-}
-
-/*
- * This does not take any shortcuts, and even ignores its argument, since
- * it does not happen very often, and one has to walk up the tree since
- * this might be a newly instantiated cursor for an intermediate window
- * between the one the pointer is in and the one that the last cursor was
- * instantiated from.
- */
-/*ARGSUSED*/
-void
-WindowHasNewCursor(pWin)
- WindowPtr pWin;
-{
- PostNewCursor();
-}
-
-void
-NewCurrentScreen(newScreen, x, y)
- ScreenPtr newScreen;
- int x,y;
-{
- sprite.hotPhys.x = x;
- sprite.hotPhys.y = y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
- panoramiXdataPtr[0].x;
- sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
- panoramiXdataPtr[0].y;
- if (newScreen != sprite.screen) {
- sprite.screen = newScreen;
- /* Make sure we tell the DDX to update its copy of the screen */
- if(sprite.confineWin)
- XineramaConfineCursorToWindow(sprite.confineWin, TRUE);
- else
- XineramaConfineCursorToWindow(WindowTable[0], TRUE);
- /* if the pointer wasn't confined, the DDX won't get
- told of the pointer warp so we reposition it here */
- if(!syncEvents.playingEvents)
- (*sprite.screen->SetCursorPosition)(sprite.screen,
- sprite.hotPhys.x + panoramiXdataPtr[0].x -
- panoramiXdataPtr[sprite.screen->myNum].x,
- sprite.hotPhys.y + panoramiXdataPtr[0].y -
- panoramiXdataPtr[sprite.screen->myNum].y, FALSE);
- }
- } else
-#endif
- if (newScreen != sprite.hotPhys.pScreen)
- ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE);
-}
-
-#ifdef PANORAMIX
-
-static Bool
-XineramaPointInWindowIsVisible(
- WindowPtr pWin,
- int x,
- int y
-)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- BoxRec box;
- int i, xoff, yoff;
-
- if (!pWin->realized) return FALSE;
-
- if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box))
- return TRUE;
-
- if(!XineramaSetWindowPntrs(pWin)) return FALSE;
-
- xoff = x + panoramiXdataPtr[0].x;
- yoff = y + panoramiXdataPtr[0].y;
-
- for(i = 1; i < PanoramiXNumScreens; i++) {
- pWin = sprite.windows[i];
- pScreen = pWin->drawable.pScreen;
- x = xoff - panoramiXdataPtr[i].x;
- y = yoff - panoramiXdataPtr[i].y;
-
- if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box))
- return TRUE;
-
- }
-
- return FALSE;
-}
-
-static int
-XineramaWarpPointer(ClientPtr client)
-{
- WindowPtr dest = NULL;
- int x, y;
-
- REQUEST(xWarpPointerReq);
-
-
- if (stuff->dstWid != None)
- {
- dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess);
- if (!dest)
- return BadWindow;
- }
- x = sprite.hotPhys.x;
- y = sprite.hotPhys.y;
-
- if (stuff->srcWid != None)
- {
- int winX, winY;
- XID winID = stuff->srcWid;
- WindowPtr source;
-
- source = SecurityLookupWindow(winID, client, SecurityReadAccess);
- if (!source) return BadWindow;
-
- winX = source->drawable.x;
- winY = source->drawable.y;
- if(source == WindowTable[0]) {
- winX -= panoramiXdataPtr[0].x;
- winY -= panoramiXdataPtr[0].y;
- }
- if (x < winX + stuff->srcX ||
- y < winY + stuff->srcY ||
- (stuff->srcWidth != 0 &&
- winX + stuff->srcX + (int)stuff->srcWidth < x) ||
- (stuff->srcHeight != 0 &&
- winY + stuff->srcY + (int)stuff->srcHeight < y) ||
- !XineramaPointInWindowIsVisible(source, x, y))
- return Success;
- }
- if (dest) {
- x = dest->drawable.x;
- y = dest->drawable.y;
- if(dest == WindowTable[0]) {
- x -= panoramiXdataPtr[0].x;
- y -= panoramiXdataPtr[0].y;
- }
- }
-
- x += stuff->dstX;
- y += stuff->dstY;
-
- if (x < sprite.physLimits.x1)
- x = sprite.physLimits.x1;
- else if (x >= sprite.physLimits.x2)
- x = sprite.physLimits.x2 - 1;
- if (y < sprite.physLimits.y1)
- y = sprite.physLimits.y1;
- else if (y >= sprite.physLimits.y2)
- y = sprite.physLimits.y2 - 1;
- if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &x, &y);
-
- XineramaSetCursorPosition(x, y, TRUE);
-
- return Success;
-}
-
-#endif
-
-
-int
-ProcWarpPointer(client)
- ClientPtr client;
-{
- WindowPtr dest = NULL;
- int x, y;
- ScreenPtr newScreen;
-
- REQUEST(xWarpPointerReq);
-
- REQUEST_SIZE_MATCH(xWarpPointerReq);
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return XineramaWarpPointer(client);
-#endif
-
- if (stuff->dstWid != None)
- {
- dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess);
- if (!dest)
- return BadWindow;
- }
- x = sprite.hotPhys.x;
- y = sprite.hotPhys.y;
-
- if (stuff->srcWid != None)
- {
- int winX, winY;
- XID winID = stuff->srcWid;
- WindowPtr source;
-
- source = SecurityLookupWindow(winID, client, SecurityReadAccess);
- if (!source) return BadWindow;
-
- winX = source->drawable.x;
- winY = source->drawable.y;
- if (source->drawable.pScreen != sprite.hotPhys.pScreen ||
- x < winX + stuff->srcX ||
- y < winY + stuff->srcY ||
- (stuff->srcWidth != 0 &&
- winX + stuff->srcX + (int)stuff->srcWidth < x) ||
- (stuff->srcHeight != 0 &&
- winY + stuff->srcY + (int)stuff->srcHeight < y) ||
- !PointInWindowIsVisible(source, x, y))
- return Success;
- }
- if (dest)
- {
- x = dest->drawable.x;
- y = dest->drawable.y;
- newScreen = dest->drawable.pScreen;
- } else
- newScreen = sprite.hotPhys.pScreen;
-
- x += stuff->dstX;
- y += stuff->dstY;
-
- if (x < 0)
- x = 0;
- else if (x >= newScreen->width)
- x = newScreen->width - 1;
- if (y < 0)
- y = 0;
- else if (y >= newScreen->height)
- y = newScreen->height - 1;
-
- if (newScreen == sprite.hotPhys.pScreen)
- {
- if (x < sprite.physLimits.x1)
- x = sprite.physLimits.x1;
- else if (x >= sprite.physLimits.x2)
- x = sprite.physLimits.x2 - 1;
- if (y < sprite.physLimits.y1)
- y = sprite.physLimits.y1;
- else if (y >= sprite.physLimits.y2)
- y = sprite.physLimits.y2 - 1;
-#if defined(SHAPE)
- if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &x, &y);
-#endif
- (*newScreen->SetCursorPosition)(newScreen, x, y, TRUE);
- }
- else if (!PointerConfinedToScreen())
- {
- NewCurrentScreen(newScreen, x, y);
- }
- return Success;
-}
-
-static Bool
-BorderSizeNotEmpty(WindowPtr pWin)
-{
- if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize))
- return TRUE;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) {
- int i;
-
- for(i = 1; i < PanoramiXNumScreens; i++) {
- if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize))
- return TRUE;
- }
- }
-#endif
- return FALSE;
-}
-
-/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a
- passive grab set on the window to be activated. */
-
-static Bool
-CheckPassiveGrabsOnWindow(
- WindowPtr pWin,
- register DeviceIntPtr device,
- register xEvent *xE,
- int count)
-{
- register GrabPtr grab = wPassiveGrabs(pWin);
- GrabRec tempGrab;
- register xEvent *dxE;
-
- if (!grab)
- return FALSE;
- tempGrab.window = pWin;
- tempGrab.device = device;
- tempGrab.type = xE->u.u.type;
- tempGrab.detail.exact = xE->u.u.detail;
- tempGrab.detail.pMask = NULL;
- tempGrab.modifiersDetail.pMask = NULL;
- for (; grab; grab = grab->next)
- {
-#ifdef XKB
- DeviceIntPtr gdev;
- XkbSrvInfoPtr xkbi;
-
- gdev= grab->modifierDevice;
- xkbi= gdev->key->xkbInfo;
-#endif
- tempGrab.modifierDevice = grab->modifierDevice;
- if (device == grab->modifierDevice &&
- (xE->u.u.type == KeyPress
-#ifdef XINPUT
- || xE->u.u.type == DeviceKeyPress
-#endif
- ))
- tempGrab.modifiersDetail.exact =
-#ifdef XKB
- (noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods);
-#else
- grab->modifierDevice->key->prev_state;
-#endif
- else
- tempGrab.modifiersDetail.exact =
-#ifdef XKB
- (noXkbExtension ? gdev->key->state : xkbi->state.grab_mods);
-#else
- grab->modifierDevice->key->state;
-#endif
- if (GrabMatchesSecond(&tempGrab, grab) &&
- (!grab->confineTo ||
- (grab->confineTo->realized &&
- BorderSizeNotEmpty(grab->confineTo))))
- {
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE))
- return FALSE;
-#endif
-#ifdef XKB
- if (!noXkbExtension) {
- XE_KBPTR.state &= 0x1f00;
- XE_KBPTR.state |=
- tempGrab.modifiersDetail.exact&(~0x1f00);
- }
-#endif
- (*device->ActivateGrab)(device, grab, currentTime, TRUE);
-
- FixUpEventFromWindow(xE, grab->window, None, TRUE);
-
- (void) TryClientEvents(rClient(grab), xE, count,
- filters[xE->u.u.type],
- filters[xE->u.u.type], grab);
-
- if (device->sync.state == FROZEN_NO_EVENT)
- {
- if (device->sync.evcount < count)
- {
- Must_have_memory = TRUE; /* XXX */
- device->sync.event = (xEvent *)xrealloc(device->sync.event,
- count*
- sizeof(xEvent));
- Must_have_memory = FALSE; /* XXX */
- }
- device->sync.evcount = count;
- for (dxE = device->sync.event; --count >= 0; dxE++, xE++)
- *dxE = *xE;
- device->sync.state = FROZEN_WITH_EVENT;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
-"CheckDeviceGrabs" handles both keyboard and pointer events that may cause
-a passive grab to be activated. If the event is a keyboard event, the
-ancestors of the focus window are traced down and tried to see if they have
-any passive grabs to be activated. If the focus window itself is reached and
-it's descendants contain they pointer, the ancestors of the window that the
-pointer is in are then traced down starting at the focus window, otherwise no
-grabs are activated. If the event is a pointer event, the ancestors of the
-window that the pointer is in are traced down starting at the root until
-CheckPassiveGrabs causes a passive grab to activate or all the windows are
-tried. PRH
-*/
-
-Bool
-CheckDeviceGrabs(device, xE, checkFirst, count)
- register DeviceIntPtr device;
- register xEvent *xE;
- int checkFirst;
- int count;
-{
- register int i;
- register WindowPtr pWin = NULL;
- register FocusClassPtr focus = device->focus;
-
- if ((xE->u.u.type == ButtonPress
-#ifdef XINPUT
- || xE->u.u.type == DeviceButtonPress
-#endif
- ) && device->button->buttonsDown != 1)
- return FALSE;
-
- i = checkFirst;
-
- if (focus)
- {
- for (; i < focus->traceGood; i++)
- {
- pWin = focus->trace[i];
- if (pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, xE, count))
- return TRUE;
- }
-
- if ((focus->win == NoneWin) ||
- (i >= spriteTraceGood) ||
- ((i > checkFirst) && (pWin != spriteTrace[i-1])))
- return FALSE;
- }
-
- for (; i < spriteTraceGood; i++)
- {
- pWin = spriteTrace[i];
- if (pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, xE, count))
- return TRUE;
- }
-
- return FALSE;
-}
-
-void
-DeliverFocusedEvent(keybd, xE, window, count)
- xEvent *xE;
- DeviceIntPtr keybd;
- WindowPtr window;
- int count;
-{
- WindowPtr focus = keybd->focus->win;
- int mskidx = 0;
-
- if (focus == FollowKeyboardWin)
- focus = inputInfo.keyboard->focus->win;
- if (!focus)
- return;
- if (focus == PointerRootWin)
- {
- DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count);
- return;
- }
- if ((focus == window) || IsParent(focus, window))
- {
- if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count))
- return;
- }
- /* just deliver it to the focus window */
- FixUpEventFromWindow(xE, focus, None, FALSE);
- if (xE->u.u.type & EXTENSION_EVENT_BASE)
- mskidx = keybd->id;
- (void)DeliverEventsToWindow(focus, xE, count, filters[xE->u.u.type],
- NullGrab, mskidx);
-}
-
-void
-DeliverGrabbedEvent(xE, thisDev, deactivateGrab, count)
- register xEvent *xE;
- register DeviceIntPtr thisDev;
- Bool deactivateGrab;
- int count;
-{
- register GrabPtr grab = thisDev->grab;
- int deliveries = 0;
- register DeviceIntPtr dev;
- register xEvent *dxE;
-
- if (grab->ownerEvents)
- {
- WindowPtr focus;
-
- if (thisDev->focus)
- {
- focus = thisDev->focus->win;
- if (focus == FollowKeyboardWin)
- focus = inputInfo.keyboard->focus->win;
- }
- else
- focus = PointerRootWin;
- if (focus == PointerRootWin)
- deliveries = DeliverDeviceEvents(sprite.win, xE, grab, NullWindow,
- thisDev, count);
- else if (focus && (focus == sprite.win || IsParent(focus, sprite.win)))
- deliveries = DeliverDeviceEvents(sprite.win, xE, grab, focus,
- thisDev, count);
- else if (focus)
- deliveries = DeliverDeviceEvents(focus, xE, grab, focus,
- thisDev, count);
- }
- if (!deliveries)
- {
- FixUpEventFromWindow(xE, grab->window, None, TRUE);
- deliveries = TryClientEvents(rClient(grab), xE, count,
- (Mask)grab->eventMask,
- filters[xE->u.u.type], grab);
- if (deliveries && (xE->u.u.type == MotionNotify
-#ifdef XINPUT
- || xE->u.u.type == DeviceMotionNotify
-#endif
- ))
- thisDev->valuator->motionHintWindow = grab->window;
- }
- if (deliveries && !deactivateGrab && (xE->u.u.type != MotionNotify
-#ifdef XINPUT
- && xE->u.u.type != DeviceMotionNotify
-#endif
- ))
- switch (thisDev->sync.state)
- {
- case FREEZE_BOTH_NEXT_EVENT:
- for (dev = inputInfo.devices; dev; dev = dev->next)
- {
- if (dev == thisDev)
- continue;
- FreezeThaw(dev, TRUE);
- if ((dev->sync.state == FREEZE_BOTH_NEXT_EVENT) &&
- (CLIENT_BITS(dev->grab->resource) ==
- CLIENT_BITS(thisDev->grab->resource)))
- dev->sync.state = FROZEN_NO_EVENT;
- else
- dev->sync.other = thisDev->grab;
- }
- /* fall through */
- case FREEZE_NEXT_EVENT:
- thisDev->sync.state = FROZEN_WITH_EVENT;
- FreezeThaw(thisDev, TRUE);
- if (thisDev->sync.evcount < count)
- {
- Must_have_memory = TRUE; /* XXX */
- thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event,
- count*sizeof(xEvent));
- Must_have_memory = FALSE; /* XXX */
- }
- thisDev->sync.evcount = count;
- for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++)
- *dxE = *xE;
- break;
- }
-}
-
-void
-#ifdef XKB
-CoreProcessKeyboardEvent (xE, keybd, count)
-#else
-ProcessKeyboardEvent (xE, keybd, count)
-#endif
- register xEvent *xE;
- register DeviceIntPtr keybd;
- int count;
-{
- int key, bit;
- register BYTE *kptr;
- register int i;
- register CARD8 modifiers;
- register CARD16 mask;
- GrabPtr grab = keybd->grab;
- Bool deactivateGrab = FALSE;
- register KeyClassPtr keyc = keybd->key;
-
- if (!syncEvents.playingEvents)
- {
- NoticeTime(xE);
- if (DeviceEventCallback)
- {
- DeviceEventInfoRec eventinfo;
- eventinfo.events = xE;
- eventinfo.count = count;
- CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
- }
- }
- XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state);
- XE_KBPTR.rootX = sprite.hot.x;
- XE_KBPTR.rootY = sprite.hot.y;
- key = xE->u.u.detail;
- kptr = &keyc->down[key >> 3];
- bit = 1 << (key & 7);
- modifiers = keyc->modifierMap[key];
-#ifdef DEBUG
- if ((xkbDebugFlags&0x4)&&
- ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) {
- ErrorF("CoreProcessKbdEvent: Key %d %s\n",key,
- (xE->u.u.type==KeyPress?"down":"up"));
- }
-#endif
- switch (xE->u.u.type)
- {
- case KeyPress:
- if (*kptr & bit) /* allow ddx to generate multiple downs */
- {
- if (!modifiers)
- {
- xE->u.u.type = KeyRelease;
- (*keybd->public.processInputProc)(xE, keybd, count);
- xE->u.u.type = KeyPress;
- /* release can have side effects, don't fall through */
- (*keybd->public.processInputProc)(xE, keybd, count);
- }
- return;
- }
- inputInfo.pointer->valuator->motionHintWindow = NullWindow;
- *kptr |= bit;
- keyc->prev_state = keyc->state;
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers)
- {
- /* This key affects modifier "i" */
- keyc->modifierKeyCount[i]++;
- keyc->state |= mask;
- modifiers &= ~mask;
- }
- }
- if (!grab && CheckDeviceGrabs(keybd, xE, 0, count))
- {
- keybd->activatingKey = key;
- return;
- }
- break;
- case KeyRelease:
- if (!(*kptr & bit)) /* guard against duplicates */
- return;
- inputInfo.pointer->valuator->motionHintWindow = NullWindow;
- *kptr &= ~bit;
- keyc->prev_state = keyc->state;
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers) {
- /* This key affects modifier "i" */
- if (--keyc->modifierKeyCount[i] <= 0) {
- keyc->state &= ~mask;
- keyc->modifierKeyCount[i] = 0;
- }
- modifiers &= ~mask;
- }
- }
- if (keybd->fromPassiveGrab && (key == keybd->activatingKey))
- deactivateGrab = TRUE;
- break;
- default:
- FatalError("Impossible keyboard event");
- }
- if (grab)
- DeliverGrabbedEvent(xE, keybd, deactivateGrab, count);
- else
- DeliverFocusedEvent(keybd, xE, sprite.win, count);
- if (deactivateGrab)
- (*keybd->DeactivateGrab)(keybd);
-}
-
-#ifdef XKB
-/* This function is used to set the key pressed or key released state -
- this is only used when the pressing of keys does not cause
- CoreProcessKeyEvent to be called, as in for example Mouse Keys.
-*/
-void
-FixKeyState (xE, keybd)
- register xEvent *xE;
- register DeviceIntPtr keybd;
-{
- int key, bit;
- register BYTE *kptr;
- register KeyClassPtr keyc = keybd->key;
-
- key = xE->u.u.detail;
- kptr = &keyc->down[key >> 3];
- bit = 1 << (key & 7);
-#ifdef DEBUG
- if ((xkbDebugFlags&0x4)&&
- ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) {
- ErrorF("FixKeyState: Key %d %s\n",key,
- (xE->u.u.type==KeyPress?"down":"up"));
- }
-#endif
- switch (xE->u.u.type)
- {
- case KeyPress:
- *kptr |= bit;
- break;
- case KeyRelease:
- *kptr &= ~bit;
- break;
- default:
- FatalError("Impossible keyboard event");
- }
-}
-#endif
-
-void
-#ifdef XKB
-CoreProcessPointerEvent (xE, mouse, count)
-#else
-ProcessPointerEvent (xE, mouse, count)
-#endif
- register xEvent *xE;
- register DeviceIntPtr mouse;
- int count;
-{
- register GrabPtr grab = mouse->grab;
- Bool deactivateGrab = FALSE;
- register ButtonClassPtr butc = mouse->button;
-#ifdef XKB
- XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo;
-#endif
-
- if (!syncEvents.playingEvents)
- NoticeTime(xE)
- XE_KBPTR.state = (butc->state | (
-#ifdef XKB
- (noXkbExtension ?
- inputInfo.keyboard->key->state :
- xkbi->state.grab_mods)
-#else
- inputInfo.keyboard->key->state
-#endif
- ));
- {
- NoticeTime(xE);
- if (DeviceEventCallback)
- {
- DeviceEventInfoRec eventinfo;
- /* see comment in EnqueueEvents regarding the next three lines */
- if (xE->u.u.type == MotionNotify)
- XE_KBPTR.root =
- WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
- eventinfo.events = xE;
- eventinfo.count = count;
- CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
- }
- }
- if (xE->u.u.type != MotionNotify)
- {
- register int key;
- register BYTE *kptr;
- int bit;
-
- XE_KBPTR.rootX = sprite.hot.x;
- XE_KBPTR.rootY = sprite.hot.y;
-
- key = xE->u.u.detail;
- kptr = &butc->down[key >> 3];
- bit = 1 << (key & 7);
- switch (xE->u.u.type)
- {
- case ButtonPress:
- mouse->valuator->motionHintWindow = NullWindow;
- if (!(*kptr & bit))
- butc->buttonsDown++;
- butc->motionMask = ButtonMotionMask;
- *kptr |= bit;
-#if !defined(XFree86Server) || !defined(XINPUT)
- xE->u.u.detail = butc->map[key];
-#endif
- if (xE->u.u.detail == 0)
- return;
- if (xE->u.u.detail <= 5)
- butc->state |= (Button1Mask >> 1) << xE->u.u.detail;
- filters[MotionNotify] = Motion_Filter(butc);
- if (!grab)
- if (CheckDeviceGrabs(mouse, xE, 0, count))
- return;
- break;
- case ButtonRelease:
- mouse->valuator->motionHintWindow = NullWindow;
- if (*kptr & bit)
- --butc->buttonsDown;
- if (!butc->buttonsDown)
- butc->motionMask = 0;
- *kptr &= ~bit;
-#if !defined(XFree86Server) || !defined(XINPUT)
- xE->u.u.detail = butc->map[key];
-#endif
- if (xE->u.u.detail == 0)
- return;
- if (xE->u.u.detail <= 5)
- butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
- filters[MotionNotify] = Motion_Filter(butc);
- if (!butc->state && mouse->fromPassiveGrab)
- deactivateGrab = TRUE;
- break;
- default:
- FatalError("bogus pointer event from ddx");
- }
- }
- else if (!CheckMotion(xE))
- return;
- if (grab)
- DeliverGrabbedEvent(xE, mouse, deactivateGrab, count);
- else
- DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow,
- mouse, count);
- if (deactivateGrab)
- (*mouse->DeactivateGrab)(mouse);
-}
-
-#define AtMostOneClient \
- (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask)
-
-void
-RecalculateDeliverableEvents(pWin)
- register WindowPtr pWin;
-{
- register OtherClients *others;
- register WindowPtr pChild;
-
- pChild = pWin;
- while (1)
- {
- if (pChild->optional)
- {
- pChild->optional->otherEventMasks = 0;
- for (others = wOtherClients(pChild); others; others = others->next)
- {
- pChild->optional->otherEventMasks |= others->mask;
- }
- }
- pChild->deliverableEvents = pChild->eventMask|
- wOtherEventMasks(pChild);
- if (pChild->parent)
- pChild->deliverableEvents |=
- (pChild->parent->deliverableEvents &
- ~wDontPropagateMask(pChild) & PropagateMask);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-int
-OtherClientGone(value, id)
- pointer value; /* must conform to DeleteType */
- XID id;
-{
- register OtherClientsPtr other, prev;
- register WindowPtr pWin = (WindowPtr)value;
-
- prev = 0;
- for (other = wOtherClients(pWin); other; other = other->next)
- {
- if (other->resource == id)
- {
- if (prev)
- prev->next = other->next;
- else
- {
- if (!(pWin->optional->otherClients = other->next))
- CheckWindowOptionalNeed (pWin);
- }
- xfree(other);
- RecalculateDeliverableEvents(pWin);
- return(Success);
- }
- prev = other;
- }
- FatalError("client not on event list");
- /*NOTREACHED*/
- return -1; /* make compiler happy */
-}
-
-int
-EventSelectForWindow(pWin, client, mask)
- register WindowPtr pWin;
- register ClientPtr client;
- Mask mask;
-{
- Mask check;
- OtherClients * others;
-
- if (mask & ~AllEventMasks)
- {
- client->errorValue = mask;
- return BadValue;
- }
- check = (mask & AtMostOneClient);
- if (check & (pWin->eventMask|wOtherEventMasks(pWin)))
- { /* It is illegal for two different
- clients to select on any of the
- events for AtMostOneClient. However,
- it is OK, for some client to
- continue selecting on one of those
- events. */
- if ((wClient(pWin) != client) && (check & pWin->eventMask))
- return BadAccess;
- for (others = wOtherClients (pWin); others; others = others->next)
- {
- if (!SameClient(others, client) && (check & others->mask))
- return BadAccess;
- }
- }
- if (wClient (pWin) == client)
- {
- check = pWin->eventMask;
-#ifdef SGIMISC
- pWin->eventMask =
- (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask);
-#else
- pWin->eventMask = mask;
-#endif
- }
- else
- {
- for (others = wOtherClients (pWin); others; others = others->next)
- {
- if (SameClient(others, client))
- {
- check = others->mask;
-#ifdef SGIMISC
- mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask);
-#endif
- if (mask == 0)
- {
- FreeResource(others->resource, RT_NONE);
- return Success;
- }
- else
- others->mask = mask;
- goto maskSet;
- }
- }
- check = 0;
- if (!pWin->optional && !MakeWindowOptional (pWin))
- return BadAlloc;
- others = (OtherClients *) xalloc(sizeof(OtherClients));
- if (!others)
- return BadAlloc;
- others->mask = mask;
- others->resource = FakeClientID(client->index);
- others->next = pWin->optional->otherClients;
- pWin->optional->otherClients = others;
- if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin))
- return BadAlloc;
- }
-maskSet:
- if ((inputInfo.pointer->valuator->motionHintWindow == pWin) &&
- (mask & PointerMotionHintMask) &&
- !(check & PointerMotionHintMask) &&
- !inputInfo.pointer->grab)
- inputInfo.pointer->valuator->motionHintWindow = NullWindow;
- RecalculateDeliverableEvents(pWin);
- return Success;
-}
-
-/*ARGSUSED*/
-int
-EventSuppressForWindow(pWin, client, mask, checkOptional)
- register WindowPtr pWin;
- register ClientPtr client;
- Mask mask;
- Bool *checkOptional;
-{
- register int i, free;
-
- if ((mask & ~PropagateMask) && !permitOldBugs)
- {
- client->errorValue = mask;
- return BadValue;
- }
- if (pWin->dontPropagate)
- DontPropagateRefCnts[pWin->dontPropagate]--;
- if (!mask)
- i = 0;
- else
- {
- for (i = DNPMCOUNT, free = 0; --i > 0; )
- {
- if (!DontPropagateRefCnts[i])
- free = i;
- else if (mask == DontPropagateMasks[i])
- break;
- }
- if (!i && free)
- {
- i = free;
- DontPropagateMasks[i] = mask;
- }
- }
- if (i || !mask)
- {
- pWin->dontPropagate = i;
- if (i)
- DontPropagateRefCnts[i]++;
- if (pWin->optional)
- {
- pWin->optional->dontPropagateMask = mask;
- *checkOptional = TRUE;
- }
- }
- else
- {
- if (!pWin->optional && !MakeWindowOptional (pWin))
- {
- if (pWin->dontPropagate)
- DontPropagateRefCnts[pWin->dontPropagate]++;
- return BadAlloc;
- }
- pWin->dontPropagate = 0;
- pWin->optional->dontPropagateMask = mask;
- }
- RecalculateDeliverableEvents(pWin);
- return Success;
-}
-
-static WindowPtr
-CommonAncestor(
- register WindowPtr a,
- register WindowPtr b)
-{
- for (b = b->parent; b; b = b->parent)
- if (IsParent(b, a)) return b;
- return NullWindow;
-}
-
-static void
-EnterLeaveEvent(
- int type,
- int mode,
- int detail,
- register WindowPtr pWin,
- Window child)
-{
- xEvent event;
- register DeviceIntPtr keybd = inputInfo.keyboard;
- WindowPtr focus;
- register DeviceIntPtr mouse = inputInfo.pointer;
- register GrabPtr grab = mouse->grab;
- Mask mask;
-
- if ((pWin == mouse->valuator->motionHintWindow) &&
- (detail != NotifyInferior))
- mouse->valuator->motionHintWindow = NullWindow;
- if (grab)
- {
- mask = (pWin == grab->window) ? grab->eventMask : 0;
- if (grab->ownerEvents)
- mask |= EventMaskForClient(pWin, rClient(grab));
- }
- else
- {
- mask = pWin->eventMask | wOtherEventMasks(pWin);
- }
- if (mask & filters[type])
- {
- event.u.u.type = type;
- event.u.u.detail = detail;
- event.u.enterLeave.time = currentTime.milliseconds;
- event.u.enterLeave.rootX = sprite.hot.x;
- event.u.enterLeave.rootY = sprite.hot.y;
- /* Counts on the same initial structure of crossing & button events! */
- FixUpEventFromWindow(&event, pWin, None, FALSE);
- /* Enter/Leave events always set child */
- event.u.enterLeave.child = child;
- event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ?
- ELFlagSameScreen : 0;
-#ifdef XKB
- if (!noXkbExtension) {
- event.u.enterLeave.state = mouse->button->state & 0x1f00;
- event.u.enterLeave.state |=
- XkbGrabStateFromRec(&keybd->key->xkbInfo->state);
- } else
-#endif
- event.u.enterLeave.state = keybd->key->state | mouse->button->state;
- event.u.enterLeave.mode = mode;
- focus = keybd->focus->win;
- if ((focus != NoneWin) &&
- ((pWin == focus) || (focus == PointerRootWin) ||
- IsParent(focus, pWin)))
- event.u.enterLeave.flags |= ELFlagFocus;
- if (grab)
- (void)TryClientEvents(rClient(grab), &event, 1, mask,
- filters[type], grab);
- else
- (void)DeliverEventsToWindow(pWin, &event, 1, filters[type],
- NullGrab, 0);
- }
- if ((type == EnterNotify) && (mask & KeymapStateMask))
- {
- xKeymapEvent ke;
-
-#ifdef XCSECURITY
- ClientPtr client = grab ? rClient(grab)
- : clients[CLIENT_ID(pWin->drawable.id)];
- if (!SecurityCheckDeviceAccess(client, keybd, FALSE))
- {
- bzero((char *)&ke.map[0], 31);
- }
- else
-#endif
- memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31);
- ke.type = KeymapNotify;
- if (grab)
- (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask,
- KeymapStateMask, grab);
- else
- (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1,
- KeymapStateMask, NullGrab, 0);
- }
-}
-
-static void
-EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail)
-{
- WindowPtr parent = child->parent;
-
- if (ancestor == parent)
- return;
- EnterNotifies(ancestor, parent, mode, detail);
- EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id);
-}
-
-static void
-LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
-{
- register WindowPtr pWin;
-
- if (ancestor == child)
- return;
- for (pWin = child->parent; pWin != ancestor; pWin = pWin->parent)
- {
- EnterLeaveEvent(LeaveNotify, mode, detail, pWin, child->drawable.id);
- child = pWin;
- }
-}
-
-static void
-DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode)
-{
- if (fromWin == toWin)
- return;
- if (IsParent(fromWin, toWin))
- {
- EnterLeaveEvent(LeaveNotify, mode, NotifyInferior, fromWin, None);
- EnterNotifies(fromWin, toWin, mode, NotifyVirtual);
- EnterLeaveEvent(EnterNotify, mode, NotifyAncestor, toWin, None);
- }
- else if (IsParent(toWin, fromWin))
- {
- EnterLeaveEvent(LeaveNotify, mode, NotifyAncestor, fromWin, None);
- LeaveNotifies(fromWin, toWin, mode, NotifyVirtual);
- EnterLeaveEvent(EnterNotify, mode, NotifyInferior, toWin, None);
- }
- else
- { /* neither fromWin nor toWin is descendent of the other */
- WindowPtr common = CommonAncestor(toWin, fromWin);
- /* common == NullWindow ==> different screens */
- EnterLeaveEvent(LeaveNotify, mode, NotifyNonlinear, fromWin, None);
- LeaveNotifies(fromWin, common, mode, NotifyNonlinearVirtual);
- EnterNotifies(common, toWin, mode, NotifyNonlinearVirtual);
- EnterLeaveEvent(EnterNotify, mode, NotifyNonlinear, toWin, None);
- }
-}
-
-static void
-FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin)
-{
- xEvent event;
-
-#ifdef XINPUT
- if (dev != inputInfo.keyboard)
- {
- DeviceFocusEvent(dev, type, mode, detail, pWin);
- return;
- }
-#endif
- event.u.focus.mode = mode;
- event.u.u.type = type;
- event.u.u.detail = detail;
- event.u.focus.window = pWin->drawable.id;
- (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], NullGrab,
- 0);
- if ((type == FocusIn) &&
- ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask))
- {
- xKeymapEvent ke;
-#ifdef XCSECURITY
- ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)];
- if (!SecurityCheckDeviceAccess(client, dev, FALSE))
- {
- bzero((char *)&ke.map[0], 31);
- }
- else
-#endif
- memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31);
- ke.type = KeymapNotify;
- (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1,
- KeymapStateMask, NullGrab, 0);
- }
-}
-
- /*
- * recursive because it is easier
- * no-op if child not descended from ancestor
- */
-static Bool
-FocusInEvents(
- DeviceIntPtr dev,
- WindowPtr ancestor, WindowPtr child, WindowPtr skipChild,
- int mode, int detail,
- Bool doAncestor)
-{
- if (child == NullWindow)
- return ancestor == NullWindow;
- if (ancestor == child)
- {
- if (doAncestor)
- FocusEvent(dev, FocusIn, mode, detail, child);
- return TRUE;
- }
- if (FocusInEvents(dev, ancestor, child->parent, skipChild, mode, detail,
- doAncestor))
- {
- if (child != skipChild)
- FocusEvent(dev, FocusIn, mode, detail, child);
- return TRUE;
- }
- return FALSE;
-}
-
-/* dies horribly if ancestor is not an ancestor of child */
-static void
-FocusOutEvents(
- DeviceIntPtr dev,
- WindowPtr child, WindowPtr ancestor,
- int mode, int detail,
- Bool doAncestor)
-{
- register WindowPtr pWin;
-
- for (pWin = child; pWin != ancestor; pWin = pWin->parent)
- FocusEvent(dev, FocusOut, mode, detail, pWin);
- if (doAncestor)
- FocusEvent(dev, FocusOut, mode, detail, ancestor);
-}
-
-void
-DoFocusEvents(dev, fromWin, toWin, mode)
- DeviceIntPtr dev;
- WindowPtr fromWin, toWin;
- int mode;
-{
- int out, in; /* for holding details for to/from
- PointerRoot/None */
- int i;
-
- if (fromWin == toWin)
- return;
- out = (fromWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot;
- in = (toWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot;
- /* wrong values if neither, but then not referenced */
-
- if ((toWin == NullWindow) || (toWin == PointerRootWin))
- {
- if ((fromWin == NullWindow) || (fromWin == PointerRootWin))
- {
- if (fromWin == PointerRootWin)
- FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer,
- TRUE);
- /* Notify all the roots */
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
- else
-#endif
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
- }
- else
- {
- if (IsParent(fromWin, sprite.win))
- FocusOutEvents(dev, sprite.win, fromWin, mode, NotifyPointer,
- FALSE);
- FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin);
- /* next call catches the root too, if the screen changed */
- FocusOutEvents(dev, fromWin->parent, NullWindow, mode,
- NotifyNonlinearVirtual, FALSE);
- }
- /* Notify all the roots */
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusIn, mode, in, WindowTable[0]);
- else
-#endif
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusIn, mode, in, WindowTable[i]);
- if (toWin == PointerRootWin)
- (void)FocusInEvents(dev, ROOT, sprite.win, NullWindow, mode,
- NotifyPointer, TRUE);
- }
- else
- {
- if ((fromWin == NullWindow) || (fromWin == PointerRootWin))
- {
- if (fromWin == PointerRootWin)
- FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer,
- TRUE);
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
- else
-#endif
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
- if (toWin->parent != NullWindow)
- (void)FocusInEvents(dev, ROOT, toWin, toWin, mode,
- NotifyNonlinearVirtual, TRUE);
- FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin);
- if (IsParent(toWin, sprite.win))
- (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, mode,
- NotifyPointer, FALSE);
- }
- else
- {
- if (IsParent(toWin, fromWin))
- {
- FocusEvent(dev, FocusOut, mode, NotifyAncestor, fromWin);
- FocusOutEvents(dev, fromWin->parent, toWin, mode,
- NotifyVirtual, FALSE);
- FocusEvent(dev, FocusIn, mode, NotifyInferior, toWin);
- if ((IsParent(toWin, sprite.win)) &&
- (sprite.win != fromWin) &&
- (!IsParent(fromWin, sprite.win)) &&
- (!IsParent(sprite.win, fromWin)))
- (void)FocusInEvents(dev, toWin, sprite.win, NullWindow,
- mode, NotifyPointer, FALSE);
- }
- else
- if (IsParent(fromWin, toWin))
- {
- if ((IsParent(fromWin, sprite.win)) &&
- (sprite.win != fromWin) &&
- (!IsParent(toWin, sprite.win)) &&
- (!IsParent(sprite.win, toWin)))
- FocusOutEvents(dev, sprite.win, fromWin, mode,
- NotifyPointer, FALSE);
- FocusEvent(dev, FocusOut, mode, NotifyInferior, fromWin);
- (void)FocusInEvents(dev, fromWin, toWin, toWin, mode,
- NotifyVirtual, FALSE);
- FocusEvent(dev, FocusIn, mode, NotifyAncestor, toWin);
- }
- else
- {
- /* neither fromWin or toWin is child of other */
- WindowPtr common = CommonAncestor(toWin, fromWin);
- /* common == NullWindow ==> different screens */
- if (IsParent(fromWin, sprite.win))
- FocusOutEvents(dev, sprite.win, fromWin, mode,
- NotifyPointer, FALSE);
- FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin);
- if (fromWin->parent != NullWindow)
- FocusOutEvents(dev, fromWin->parent, common, mode,
- NotifyNonlinearVirtual, FALSE);
- if (toWin->parent != NullWindow)
- (void)FocusInEvents(dev, common, toWin, toWin, mode,
- NotifyNonlinearVirtual, FALSE);
- FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin);
- if (IsParent(toWin, sprite.win))
- (void)FocusInEvents(dev, toWin, sprite.win, NullWindow,
- mode, NotifyPointer, FALSE);
- }
- }
- }
-}
-
-int
-SetInputFocus(
- ClientPtr client,
- DeviceIntPtr dev,
- Window focusID,
- CARD8 revertTo,
- Time ctime,
- Bool followOK)
-{
- register FocusClassPtr focus;
- register WindowPtr focusWin;
- int mode;
- TimeStamp time;
-
- UpdateCurrentTime();
- if ((revertTo != RevertToParent) &&
- (revertTo != RevertToPointerRoot) &&
- (revertTo != RevertToNone) &&
- ((revertTo != RevertToFollowKeyboard) || !followOK))
- {
- client->errorValue = revertTo;
- return BadValue;
- }
- time = ClientTimeToServerTime(ctime);
- if ((focusID == None) || (focusID == PointerRoot))
- focusWin = (WindowPtr)(long)focusID;
- else if ((focusID == FollowKeyboard) && followOK)
- focusWin = inputInfo.keyboard->focus->win;
- else if (!(focusWin = SecurityLookupWindow(focusID, client,
- SecurityReadAccess)))
- return BadWindow;
- else
- {
- /* It is a match error to try to set the input focus to an
- unviewable window. */
-
- if(!focusWin->realized)
- return(BadMatch);
- }
- focus = dev->focus;
- if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, focus->time) == EARLIER))
- return Success;
- mode = (dev->grab) ? NotifyWhileGrabbed : NotifyNormal;
- if (focus->win == FollowKeyboardWin)
- DoFocusEvents(dev, inputInfo.keyboard->focus->win, focusWin, mode);
- else
- DoFocusEvents(dev, focus->win, focusWin, mode);
- focus->time = time;
- focus->revert = revertTo;
- if (focusID == FollowKeyboard)
- focus->win = FollowKeyboardWin;
- else
- focus->win = focusWin;
- if ((focusWin == NoneWin) || (focusWin == PointerRootWin))
- focus->traceGood = 0;
- else
- {
- int depth = 0;
- register WindowPtr pWin;
-
- for (pWin = focusWin; pWin; pWin = pWin->parent) depth++;
- if (depth > focus->traceSize)
- {
- focus->traceSize = depth+1;
- Must_have_memory = TRUE; /* XXX */
- focus->trace = (WindowPtr *)xrealloc(focus->trace,
- focus->traceSize *
- sizeof(WindowPtr));
- Must_have_memory = FALSE; /* XXX */
- }
- focus->traceGood = depth;
- for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)
- focus->trace[depth] = pWin;
- }
- return Success;
-}
-
-int
-ProcSetInputFocus(client)
- ClientPtr client;
-{
- REQUEST(xSetInputFocusReq);
-
- REQUEST_SIZE_MATCH(xSetInputFocusReq);
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
- return Success;
-#endif
- return SetInputFocus(client, inputInfo.keyboard, stuff->focus,
- stuff->revertTo, stuff->time, FALSE);
-}
-
-int
-ProcGetInputFocus(client)
- ClientPtr client;
-{
- xGetInputFocusReply rep;
- /* REQUEST(xReq); */
- FocusClassPtr focus = inputInfo.keyboard->focus;
-
- REQUEST_SIZE_MATCH(xReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (focus->win == NoneWin)
- rep.focus = None;
- else if (focus->win == PointerRootWin)
- rep.focus = PointerRoot;
- else rep.focus = focus->win->drawable.id;
- rep.revertTo = focus->revert;
- WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
- return Success;
-}
-
-int
-ProcGrabPointer(client)
- ClientPtr client;
-{
- xGrabPointerReply rep;
- DeviceIntPtr device = inputInfo.pointer;
- GrabPtr grab;
- WindowPtr pWin, confineTo;
- CursorPtr cursor, oldCursor;
- REQUEST(xGrabPointerReq);
- TimeStamp time;
-
- REQUEST_SIZE_MATCH(xGrabPointerReq);
- UpdateCurrentTime();
- if ((stuff->pointerMode != GrabModeSync) &&
- (stuff->pointerMode != GrabModeAsync))
- {
- client->errorValue = stuff->pointerMode;
- return BadValue;
- }
- if ((stuff->keyboardMode != GrabModeSync) &&
- (stuff->keyboardMode != GrabModeAsync))
- {
- client->errorValue = stuff->keyboardMode;
- return BadValue;
- }
- if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue))
- {
- client->errorValue = stuff->ownerEvents;
- return BadValue;
- }
- if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs)
- {
- client->errorValue = stuff->eventMask;
- return BadValue;
- }
- pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- if (stuff->confineTo == None)
- confineTo = NullWindow;
- else
- {
- confineTo = SecurityLookupWindow(stuff->confineTo, client,
- SecurityReadAccess);
- if (!confineTo)
- return BadWindow;
- }
- if (stuff->cursor == None)
- cursor = NullCursor;
- else
- {
- cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
- RT_CURSOR, SecurityReadAccess);
- if (!cursor)
- {
- client->errorValue = stuff->cursor;
- return BadCursor;
- }
- }
- /* at this point, some sort of reply is guaranteed. */
- time = ClientTimeToServerTime(stuff->time);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- grab = device->grab;
- if ((grab) && !SameClient(grab, client))
- rep.status = AlreadyGrabbed;
- else if ((!pWin->realized) ||
- (confineTo &&
- !(confineTo->realized && BorderSizeNotEmpty(confineTo))))
- rep.status = GrabNotViewable;
- else if (device->sync.frozen &&
- device->sync.other && !SameClient(device->sync.other, client))
- rep.status = GrabFrozen;
- else if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, device->grabTime) == EARLIER))
- rep.status = GrabInvalidTime;
- else
- {
- GrabRec tempGrab;
-
- oldCursor = NullCursor;
- if (grab)
- {
- if (grab->confineTo && !confineTo)
- ConfineCursorToWindow(ROOT, FALSE, FALSE);
- oldCursor = grab->cursor;
- }
- tempGrab.cursor = cursor;
- tempGrab.resource = client->clientAsMask;
- tempGrab.ownerEvents = stuff->ownerEvents;
- tempGrab.eventMask = stuff->eventMask;
- tempGrab.confineTo = confineTo;
- tempGrab.window = pWin;
- tempGrab.keyboardMode = stuff->keyboardMode;
- tempGrab.pointerMode = stuff->pointerMode;
- tempGrab.device = device;
- (*device->ActivateGrab)(device, &tempGrab, time, FALSE);
- if (oldCursor)
- FreeCursor (oldCursor, (Cursor)0);
- rep.status = GrabSuccess;
- }
- WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep);
- return Success;
-}
-
-int
-ProcChangeActivePointerGrab(client)
- ClientPtr client;
-{
- DeviceIntPtr device = inputInfo.pointer;
- register GrabPtr grab = device->grab;
- CursorPtr newCursor, oldCursor;
- REQUEST(xChangeActivePointerGrabReq);
- TimeStamp time;
-
- REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
- if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs)
- {
- client->errorValue = stuff->eventMask;
- return BadValue;
- }
- if (stuff->cursor == None)
- newCursor = NullCursor;
- else
- {
- newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
- RT_CURSOR, SecurityReadAccess);
- if (!newCursor)
- {
- client->errorValue = stuff->cursor;
- return BadCursor;
- }
- }
- if (!grab)
- return Success;
- if (!SameClient(grab, client))
- return Success;
- time = ClientTimeToServerTime(stuff->time);
- if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, device->grabTime) == EARLIER))
- return Success;
- oldCursor = grab->cursor;
- grab->cursor = newCursor;
- if (newCursor)
- newCursor->refcnt++;
- PostNewCursor();
- if (oldCursor)
- FreeCursor(oldCursor, (Cursor)0);
- grab->eventMask = stuff->eventMask;
- return Success;
-}
-
-int
-ProcUngrabPointer(client)
- ClientPtr client;
-{
- DeviceIntPtr device = inputInfo.pointer;
- GrabPtr grab;
- TimeStamp time;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- UpdateCurrentTime();
- grab = device->grab;
- time = ClientTimeToServerTime(stuff->id);
- if ((CompareTimeStamps(time, currentTime) != LATER) &&
- (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
- (grab) && SameClient(grab, client))
- (*device->DeactivateGrab)(device);
- return Success;
-}
-
-int
-GrabDevice(client, dev, this_mode, other_mode, grabWindow, ownerEvents, ctime,
- mask, status)
- register ClientPtr client;
- register DeviceIntPtr dev;
- unsigned this_mode;
- unsigned other_mode;
- Window grabWindow;
- unsigned ownerEvents;
- Time ctime;
- Mask mask;
- CARD8 *status;
-{
- register WindowPtr pWin;
- register GrabPtr grab;
- TimeStamp time;
-
- UpdateCurrentTime();
- if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync))
- {
- client->errorValue = this_mode;
- return BadValue;
- }
- if ((other_mode != GrabModeSync) && (other_mode != GrabModeAsync))
- {
- client->errorValue = other_mode;
- return BadValue;
- }
- if ((ownerEvents != xFalse) && (ownerEvents != xTrue))
- {
- client->errorValue = ownerEvents;
- return BadValue;
- }
- pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- time = ClientTimeToServerTime(ctime);
- grab = dev->grab;
- if (grab && !SameClient(grab, client))
- *status = AlreadyGrabbed;
- else if (!pWin->realized)
- *status = GrabNotViewable;
- else if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, dev->grabTime) == EARLIER))
- *status = GrabInvalidTime;
- else if (dev->sync.frozen &&
- dev->sync.other && !SameClient(dev->sync.other, client))
- *status = GrabFrozen;
- else
- {
- GrabRec tempGrab;
-
- tempGrab.window = pWin;
- tempGrab.resource = client->clientAsMask;
- tempGrab.ownerEvents = ownerEvents;
- tempGrab.keyboardMode = this_mode;
- tempGrab.pointerMode = other_mode;
- tempGrab.eventMask = mask;
- tempGrab.device = dev;
- (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE);
- *status = GrabSuccess;
- }
- return Success;
-}
-
-int
-ProcGrabKeyboard(client)
- ClientPtr client;
-{
- xGrabKeyboardReply rep;
- REQUEST(xGrabKeyboardReq);
- int result;
-
- REQUEST_SIZE_MATCH(xGrabKeyboardReq);
-#ifdef XCSECURITY
- if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
- {
- result = Success;
- rep.status = AlreadyGrabbed;
- }
- else
-#endif
- result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode,
- stuff->pointerMode, stuff->grabWindow,
- stuff->ownerEvents, stuff->time,
- KeyPressMask | KeyReleaseMask, &rep.status);
- if (result != Success)
- return result;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep);
- return Success;
-}
-
-int
-ProcUngrabKeyboard(client)
- ClientPtr client;
-{
- DeviceIntPtr device = inputInfo.keyboard;
- GrabPtr grab;
- TimeStamp time;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- UpdateCurrentTime();
- grab = device->grab;
- time = ClientTimeToServerTime(stuff->id);
- if ((CompareTimeStamps(time, currentTime) != LATER) &&
- (CompareTimeStamps(time, device->grabTime) != EARLIER) &&
- (grab) && SameClient(grab, client))
- (*device->DeactivateGrab)(device);
- return Success;
-}
-
-int
-ProcQueryPointer(client)
- ClientPtr client;
-{
- xQueryPointerReply rep;
- WindowPtr pWin, t;
- REQUEST(xResourceReq);
- DeviceIntPtr mouse = inputInfo.pointer;
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- if (mouse->valuator->motionHintWindow)
- MaybeStopHint(mouse, client);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.mask = mouse->button->state | inputInfo.keyboard->key->state;
- rep.length = 0;
- rep.root = (ROOT)->drawable.id;
- rep.rootX = sprite.hot.x;
- rep.rootY = sprite.hot.y;
- rep.child = None;
- if (sprite.hot.pScreen == pWin->drawable.pScreen)
- {
- rep.sameScreen = xTrue;
- rep.winX = sprite.hot.x - pWin->drawable.x;
- rep.winY = sprite.hot.y - pWin->drawable.y;
- for (t = sprite.win; t; t = t->parent)
- if (t->parent == pWin)
- {
- rep.child = t->drawable.id;
- break;
- }
- }
- else
- {
- rep.sameScreen = xFalse;
- rep.winX = 0;
- rep.winY = 0;
- }
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- rep.rootX += panoramiXdataPtr[0].x;
- rep.rootY += panoramiXdataPtr[0].y;
- if(stuff->id == rep.root) {
- rep.winX += panoramiXdataPtr[0].x;
- rep.winY += panoramiXdataPtr[0].y;
- }
- }
-#endif
-
- WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
-
- return(Success);
-}
-
-void
-InitEvents()
-{
- int i;
-
- sprite.hot.pScreen = sprite.hotPhys.pScreen = (ScreenPtr)NULL;
- inputInfo.numDevices = 0;
- inputInfo.devices = (DeviceIntPtr)NULL;
- inputInfo.off_devices = (DeviceIntPtr)NULL;
- inputInfo.keyboard = (DeviceIntPtr)NULL;
- inputInfo.pointer = (DeviceIntPtr)NULL;
- if (spriteTraceSize == 0)
- {
- spriteTraceSize = 32;
- spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr));
- if (!spriteTrace)
- FatalError("failed to allocate spriteTrace");
- }
- spriteTraceGood = 0;
- lastEventMask = OwnerGrabButtonMask;
- filters[MotionNotify] = PointerMotionMask;
- sprite.win = NullWindow;
- sprite.current = NullCursor;
- sprite.hotLimits.x1 = 0;
- sprite.hotLimits.y1 = 0;
- sprite.hotLimits.x2 = 0;
- sprite.hotLimits.y2 = 0;
- sprite.confined = FALSE;
- syncEvents.replayDev = (DeviceIntPtr)NULL;
- syncEvents.replayWin = NullWindow;
- while (syncEvents.pending)
- {
- QdEventPtr next = syncEvents.pending->next;
- xfree(syncEvents.pending);
- syncEvents.pending = next;
- }
- syncEvents.pendtail = &syncEvents.pending;
- syncEvents.playingEvents = FALSE;
- syncEvents.time.months = 0;
- syncEvents.time.milliseconds = 0; /* hardly matters */
- currentTime.months = 0;
- currentTime.milliseconds = GetTimeInMillis();
- lastDeviceEventTime = currentTime;
- for (i = 0; i < DNPMCOUNT; i++)
- {
- DontPropagateMasks[i] = 0;
- DontPropagateRefCnts[i] = 0;
- }
-}
-
-void
-CloseDownEvents(void)
-{
- xfree(spriteTrace);
- spriteTrace = NULL;
- spriteTraceSize = 0;
-}
-
-int
-ProcSendEvent(client)
- ClientPtr client;
-{
- WindowPtr pWin;
- WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
- REQUEST(xSendEventReq);
-
- REQUEST_SIZE_MATCH(xSendEventReq);
-
- /* The client's event type must be a core event type or one defined by an
- extension. */
-
- if ( ! ((stuff->event.u.u.type > X_Reply &&
- stuff->event.u.u.type < LASTEvent) ||
- (stuff->event.u.u.type >= EXTENSION_EVENT_BASE &&
- stuff->event.u.u.type < (unsigned)lastEvent)))
- {
- client->errorValue = stuff->event.u.u.type;
- return BadValue;
- }
- if (stuff->event.u.u.type == ClientMessage &&
- stuff->event.u.u.detail != 8 &&
- stuff->event.u.u.detail != 16 &&
- stuff->event.u.u.detail != 32 &&
- !permitOldBugs)
- {
- client->errorValue = stuff->event.u.u.detail;
- return BadValue;
- }
- if ((stuff->eventMask & ~AllEventMasks) && !permitOldBugs)
- {
- client->errorValue = stuff->eventMask;
- return BadValue;
- }
-
- if (stuff->destination == PointerWindow)
- pWin = sprite.win;
- else if (stuff->destination == InputFocus)
- {
- WindowPtr inputFocus = inputInfo.keyboard->focus->win;
-
- if (inputFocus == NoneWin)
- return Success;
-
- /* If the input focus is PointerRootWin, send the event to where
- the pointer is if possible, then perhaps propogate up to root. */
- if (inputFocus == PointerRootWin)
- inputFocus = ROOT;
-
- if (IsParent(inputFocus, sprite.win))
- {
- effectiveFocus = inputFocus;
- pWin = sprite.win;
- }
- else
- effectiveFocus = pWin = inputFocus;
- }
- else
- pWin = SecurityLookupWindow(stuff->destination, client,
- SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue))
- {
- client->errorValue = stuff->propagate;
- return BadValue;
- }
- stuff->event.u.u.type |= 0x80;
- if (stuff->propagate)
- {
- for (;pWin; pWin = pWin->parent)
- {
- if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
- NullGrab, 0))
- return Success;
- if (pWin == effectiveFocus)
- return Success;
- stuff->eventMask &= ~wDontPropagateMask(pWin);
- if (!stuff->eventMask)
- break;
- }
- }
- else
- (void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
- NullGrab, 0);
- return Success;
-}
-
-int
-ProcUngrabKey(client)
- ClientPtr client;
-{
- REQUEST(xUngrabKeyReq);
- WindowPtr pWin;
- GrabRec tempGrab;
- DeviceIntPtr keybd = inputInfo.keyboard;
-
- REQUEST_SIZE_MATCH(xUngrabKeyReq);
- pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
-
- if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) ||
- (stuff->key < keybd->key->curKeySyms.minKeyCode))
- && (stuff->key != AnyKey))
- {
- client->errorValue = stuff->key;
- return BadValue;
- }
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- client->errorValue = stuff->modifiers;
- return BadValue;
- }
- tempGrab.resource = client->clientAsMask;
- tempGrab.device = keybd;
- tempGrab.window = pWin;
- tempGrab.modifiersDetail.exact = stuff->modifiers;
- tempGrab.modifiersDetail.pMask = NULL;
- tempGrab.modifierDevice = inputInfo.keyboard;
- tempGrab.type = KeyPress;
- tempGrab.detail.exact = stuff->key;
- tempGrab.detail.pMask = NULL;
-
- if (!DeletePassiveGrabFromList(&tempGrab))
- return(BadAlloc);
- return(Success);
-}
-
-int
-ProcGrabKey(client)
- ClientPtr client;
-{
- WindowPtr pWin;
- REQUEST(xGrabKeyReq);
- GrabPtr grab;
- DeviceIntPtr keybd = inputInfo.keyboard;
-
- REQUEST_SIZE_MATCH(xGrabKeyReq);
- if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse))
- {
- client->errorValue = stuff->ownerEvents;
- return(BadValue);
- }
- if ((stuff->pointerMode != GrabModeSync) &&
- (stuff->pointerMode != GrabModeAsync))
- {
- client->errorValue = stuff->pointerMode;
- return BadValue;
- }
- if ((stuff->keyboardMode != GrabModeSync) &&
- (stuff->keyboardMode != GrabModeAsync))
- {
- client->errorValue = stuff->keyboardMode;
- return BadValue;
- }
- if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) ||
- (stuff->key < keybd->key->curKeySyms.minKeyCode))
- && (stuff->key != AnyKey))
- {
- client->errorValue = stuff->key;
- return BadValue;
- }
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- client->errorValue = stuff->modifiers;
- return BadValue;
- }
- pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
-
- grab = CreateGrab(client->index, keybd, pWin,
- (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents,
- (Bool)stuff->keyboardMode, (Bool)stuff->pointerMode,
- keybd, stuff->modifiers, KeyPress, stuff->key,
- NullWindow, NullCursor);
- if (!grab)
- return BadAlloc;
- return AddPassiveGrabToList(grab);
-}
-
-
-int
-ProcGrabButton(client)
- ClientPtr client;
-{
- WindowPtr pWin, confineTo;
- REQUEST(xGrabButtonReq);
- CursorPtr cursor;
- GrabPtr grab;
-
- REQUEST_SIZE_MATCH(xGrabButtonReq);
- if ((stuff->pointerMode != GrabModeSync) &&
- (stuff->pointerMode != GrabModeAsync))
- {
- client->errorValue = stuff->pointerMode;
- return BadValue;
- }
- if ((stuff->keyboardMode != GrabModeSync) &&
- (stuff->keyboardMode != GrabModeAsync))
- {
- client->errorValue = stuff->keyboardMode;
- return BadValue;
- }
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- client->errorValue = stuff->modifiers;
- return BadValue;
- }
- if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue))
- {
- client->errorValue = stuff->ownerEvents;
- return BadValue;
- }
- if (stuff->eventMask & ~PointerGrabMask)
- {
- client->errorValue = stuff->eventMask;
- return BadValue;
- }
- pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- if (stuff->confineTo == None)
- confineTo = NullWindow;
- else {
- confineTo = SecurityLookupWindow(stuff->confineTo, client,
- SecurityReadAccess);
- if (!confineTo)
- return BadWindow;
- }
- if (stuff->cursor == None)
- cursor = NullCursor;
- else
- {
- cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
- RT_CURSOR, SecurityReadAccess);
- if (!cursor)
- {
- client->errorValue = stuff->cursor;
- return BadCursor;
- }
- }
-
-
- grab = CreateGrab(client->index, inputInfo.pointer, pWin,
- permitOldBugs ? (Mask)(stuff->eventMask |
- ButtonPressMask | ButtonReleaseMask) :
- (Mask)stuff->eventMask,
- (Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode,
- (Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers,
- ButtonPress, stuff->button, confineTo, cursor);
- if (!grab)
- return BadAlloc;
- return AddPassiveGrabToList(grab);
-}
-
-int
-ProcUngrabButton(client)
- ClientPtr client;
-{
- REQUEST(xUngrabButtonReq);
- WindowPtr pWin;
- GrabRec tempGrab;
-
- REQUEST_SIZE_MATCH(xUngrabButtonReq);
- if ((stuff->modifiers != AnyModifier) &&
- (stuff->modifiers & ~AllModifiersMask))
- {
- client->errorValue = stuff->modifiers;
- return BadValue;
- }
- pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- tempGrab.resource = client->clientAsMask;
- tempGrab.device = inputInfo.pointer;
- tempGrab.window = pWin;
- tempGrab.modifiersDetail.exact = stuff->modifiers;
- tempGrab.modifiersDetail.pMask = NULL;
- tempGrab.modifierDevice = inputInfo.keyboard;
- tempGrab.type = ButtonPress;
- tempGrab.detail.exact = stuff->button;
- tempGrab.detail.pMask = NULL;
-
- if (!DeletePassiveGrabFromList(&tempGrab))
- return(BadAlloc);
- return(Success);
-}
-
-void
-DeleteWindowFromAnyEvents(pWin, freeResources)
- WindowPtr pWin;
- Bool freeResources;
-{
- WindowPtr parent;
- DeviceIntPtr mouse = inputInfo.pointer;
- DeviceIntPtr keybd = inputInfo.keyboard;
- FocusClassPtr focus = keybd->focus;
- OtherClientsPtr oc;
- GrabPtr passive;
-
-
- /* Deactivate any grabs performed on this window, before making any
- input focus changes. */
-
- if (mouse->grab &&
- ((mouse->grab->window == pWin) || (mouse->grab->confineTo == pWin)))
- (*mouse->DeactivateGrab)(mouse);
-
- /* Deactivating a keyboard grab should cause focus events. */
-
- if (keybd->grab && (keybd->grab->window == pWin))
- (*keybd->DeactivateGrab)(keybd);
-
- /* If the focus window is a root window (ie. has no parent) then don't
- delete the focus from it. */
-
- if ((pWin == focus->win) && (pWin->parent != NullWindow))
- {
- int focusEventMode = NotifyNormal;
-
- /* If a grab is in progress, then alter the mode of focus events. */
-
- if (keybd->grab)
- focusEventMode = NotifyWhileGrabbed;
-
- switch (focus->revert)
- {
- case RevertToNone:
- DoFocusEvents(keybd, pWin, NoneWin, focusEventMode);
- focus->win = NoneWin;
- focus->traceGood = 0;
- break;
- case RevertToParent:
- parent = pWin;
- do
- {
- parent = parent->parent;
- focus->traceGood--;
- } while (!parent->realized
-/* This would be a good protocol change -- windows being reparented
- during SaveSet processing would cause the focus to revert to the
- nearest enclosing window which will survive the death of the exiting
- client, instead of ending up reverting to a dying window and thence
- to None
- */
-#ifdef NOTDEF
- || clients[CLIENT_ID(parent->drawable.id)]->clientGone
-#endif
- );
- DoFocusEvents(keybd, pWin, parent, focusEventMode);
- focus->win = parent;
- focus->revert = RevertToNone;
- break;
- case RevertToPointerRoot:
- DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode);
- focus->win = PointerRootWin;
- focus->traceGood = 0;
- break;
- }
- }
-
- if (mouse->valuator->motionHintWindow == pWin)
- mouse->valuator->motionHintWindow = NullWindow;
-
- if (freeResources)
- {
- if (pWin->dontPropagate)
- DontPropagateRefCnts[pWin->dontPropagate]--;
- while ( (oc = wOtherClients(pWin)) )
- FreeResource(oc->resource, RT_NONE);
- while ( (passive = wPassiveGrabs(pWin)) )
- FreeResource(passive->resource, RT_NONE);
- }
-#ifdef XINPUT
- DeleteWindowFromAnyExtEvents(pWin, freeResources);
-#endif
-}
-
-/* Call this whenever some window at or below pWin has changed geometry */
-
-/*ARGSUSED*/
-void
-CheckCursorConfinement(pWin)
- WindowPtr pWin;
-{
- GrabPtr grab = inputInfo.pointer->grab;
- WindowPtr confineTo;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return;
-#endif
-
- if (grab && (confineTo = grab->confineTo))
- {
- if (!BorderSizeNotEmpty(confineTo))
- (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer);
- else if ((pWin == confineTo) || IsParent(pWin, confineTo))
- ConfineCursorToWindow(confineTo, TRUE, TRUE);
- }
-}
-
-Mask
-EventMaskForClient(pWin, client)
- WindowPtr pWin;
- ClientPtr client;
-{
- register OtherClientsPtr other;
-
- if (wClient (pWin) == client)
- return pWin->eventMask;
- for (other = wOtherClients(pWin); other; other = other->next)
- {
- if (SameClient(other, client))
- return other->mask;
- }
- return 0;
-}
-
-int
-ProcRecolorCursor(client)
- ClientPtr client;
-{
- CursorPtr pCursor;
- int nscr;
- ScreenPtr pscr;
- Bool displayed;
- REQUEST(xRecolorCursorReq);
-
- REQUEST_SIZE_MATCH(xRecolorCursorReq);
- pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
- RT_CURSOR, SecurityWriteAccess);
- if ( !pCursor)
- {
- client->errorValue = stuff->cursor;
- return (BadCursor);
- }
-
- pCursor->foreRed = stuff->foreRed;
- pCursor->foreGreen = stuff->foreGreen;
- pCursor->foreBlue = stuff->foreBlue;
-
- pCursor->backRed = stuff->backRed;
- pCursor->backGreen = stuff->backGreen;
- pCursor->backBlue = stuff->backBlue;
-
- for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
- {
- pscr = screenInfo.screens[nscr];
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- displayed = (pscr == sprite.screen);
- else
-#endif
- displayed = (pscr == sprite.hotPhys.pScreen);
- ( *pscr->RecolorCursor)(pscr, pCursor,
- (pCursor == sprite.current) && displayed);
- }
- return (Success);
-}
-
-void
-WriteEventsToClient(pClient, count, events)
- ClientPtr pClient;
- int count;
- xEvent *events;
-{
-#ifdef PANORAMIX
- xEvent eventCopy;
-#endif
- xEvent eventTo, *eventFrom;
- int i;
-
-#ifdef XKB
- if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events)))
- return;
-#endif
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension &&
- (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y))
- {
- switch(events->u.u.type) {
- case MotionNotify:
- case ButtonPress:
- case ButtonRelease:
- case KeyPress:
- case KeyRelease:
- case EnterNotify:
- case LeaveNotify:
- /*
- When multiple clients want the same event DeliverEventsToWindow
- passes the same event structure multiple times so we can't
- modify the one passed to us
- */
- count = 1; /* should always be 1 */
- memcpy(&eventCopy, events, sizeof(xEvent));
- eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x;
- eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y;
- if(eventCopy.u.keyButtonPointer.event ==
- eventCopy.u.keyButtonPointer.root)
- {
- eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x;
- eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y;
- }
- events = &eventCopy;
- break;
- default: break;
- }
- }
-#endif
-
- if (EventCallback)
- {
- EventInfoRec eventinfo;
- eventinfo.client = pClient;
- eventinfo.events = events;
- eventinfo.count = count;
- CallCallbacks(&EventCallback, (pointer)&eventinfo);
- }
- if(pClient->swapped)
- {
- for(i = 0; i < count; i++)
- {
- eventFrom = &events[i];
- /* Remember to strip off the leading bit of type in case
- this event was sent with "SendEvent." */
- (*EventSwapVector[eventFrom->u.u.type & 0177])
- (eventFrom, &eventTo);
- (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo);
- }
- }
- else
- {
- (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events);
- }
-}
diff --git a/dix/extension.c b/dix/extension.c
deleted file mode 100644
index 36f053f02..000000000
--- a/dix/extension.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "dispatch.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-#ifdef LBX
-#include "lbxserve.h"
-#endif
-
-#define EXTENSION_BASE 128
-#define EXTENSION_EVENT_BASE 64
-#define LAST_EVENT 128
-#define LAST_ERROR 255
-
-ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
-
-static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
-
-int lastEvent = EXTENSION_EVENT_BASE;
-static int lastError = FirstExtensionError;
-static unsigned int NumExtensions = 0;
-
-ExtensionEntry *
-AddExtension(char *name, int NumEvents, int NumErrors,
- int (*MainProc)(ClientPtr c1),
- int (*SwappedMainProc)(ClientPtr c2),
- void (*CloseDownProc)(ExtensionEntry *e),
- unsigned short (*MinorOpcodeProc)(ClientPtr c3))
-{
- int i;
- register ExtensionEntry *ext, **newexts;
-
- if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc)
- return((ExtensionEntry *) NULL);
- if ((lastEvent + NumEvents > LAST_EVENT) ||
- (unsigned)(lastError + NumErrors > LAST_ERROR))
- return((ExtensionEntry *) NULL);
-
- ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry));
- if (!ext)
- return((ExtensionEntry *) NULL);
- ext->name = (char *)xalloc(strlen(name) + 1);
- ext->num_aliases = 0;
- ext->aliases = (char **)NULL;
- if (!ext->name)
- {
- xfree(ext);
- return((ExtensionEntry *) NULL);
- }
- strcpy(ext->name, name);
- i = NumExtensions;
- newexts = (ExtensionEntry **) xrealloc(extensions,
- (i + 1) * sizeof(ExtensionEntry *));
- if (!newexts)
- {
- xfree(ext->name);
- xfree(ext);
- return((ExtensionEntry *) NULL);
- }
- NumExtensions++;
- extensions = newexts;
- extensions[i] = ext;
- ext->index = i;
- ext->base = i + EXTENSION_BASE;
- ext->CloseDown = CloseDownProc;
- ext->MinorOpcode = MinorOpcodeProc;
- ProcVector[i + EXTENSION_BASE] = MainProc;
- SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc;
- if (NumEvents)
- {
- ext->eventBase = lastEvent;
- ext->eventLast = lastEvent + NumEvents;
- lastEvent += NumEvents;
- }
- else
- {
- ext->eventBase = 0;
- ext->eventLast = 0;
- }
- if (NumErrors)
- {
- ext->errorBase = lastError;
- ext->errorLast = lastError + NumErrors;
- lastError += NumErrors;
- }
- else
- {
- ext->errorBase = 0;
- ext->errorLast = 0;
- }
-#ifdef XCSECURITY
- ext->secure = FALSE;
-#endif
-
-#ifdef LBX
- (void) LbxAddExtension(name, ext->base, ext->eventBase, ext->errorBase);
-#endif
- return(ext);
-}
-
-Bool AddExtensionAlias(alias, ext)
- char *alias;
- ExtensionEntry *ext;
-{
- char *name;
- char **aliases;
-
- aliases = (char **)xrealloc(ext->aliases,
- (ext->num_aliases + 1) * sizeof(char *));
- if (!aliases)
- return FALSE;
- ext->aliases = aliases;
- name = (char *)xalloc(strlen(alias) + 1);
- if (!name)
- return FALSE;
- strcpy(name, alias);
- ext->aliases[ext->num_aliases] = name;
- ext->num_aliases++;
-#ifdef LBX
- return LbxAddExtensionAlias(ext->index, alias);
-#else
- return TRUE;
-#endif
-}
-
-static int
-FindExtension(char *extname, int len)
-{
- int i, j;
-
- for (i=0; i<NumExtensions; i++)
- {
- if ((strlen(extensions[i]->name) == len) &&
- !strncmp(extname, extensions[i]->name, len))
- break;
- for (j = extensions[i]->num_aliases; --j >= 0;)
- {
- if ((strlen(extensions[i]->aliases[j]) == len) &&
- !strncmp(extname, extensions[i]->aliases[j], len))
- break;
- }
- if (j >= 0) break;
- }
- return ((i == NumExtensions) ? -1 : i);
-}
-
-/*
- * CheckExtension returns the extensions[] entry for the requested
- * extension name. Maybe this could just return a Bool instead?
- */
-ExtensionEntry *
-CheckExtension(const char *extname)
-{
- int n;
-
- n = FindExtension((char*)extname, strlen(extname));
- if (n != -1)
- return extensions[n];
- else
- return NULL;
-}
-
-void
-DeclareExtensionSecurity(extname, secure)
- char *extname;
- Bool secure;
-{
-#ifdef XCSECURITY
- int i = FindExtension(extname, strlen(extname));
- if (i >= 0)
- {
- int majorop = extensions[i]->base;
- extensions[i]->secure = secure;
- if (secure)
- {
- UntrustedProcVector[majorop] = ProcVector[majorop];
- SwappedUntrustedProcVector[majorop] = SwappedProcVector[majorop];
- }
- else
- {
- UntrustedProcVector[majorop] = ProcBadRequest;
- SwappedUntrustedProcVector[majorop] = ProcBadRequest;
- }
- }
-#endif
-#ifdef LBX
- LbxDeclareExtensionSecurity(extname, secure);
-#endif
-}
-
-unsigned short
-StandardMinorOpcode(client)
- ClientPtr client;
-{
- return ((xReq *)client->requestBuffer)->data;
-}
-
-unsigned short
-MinorOpcodeOfRequest(client)
- ClientPtr client;
-{
- unsigned char major;
-
- major = ((xReq *)client->requestBuffer)->reqType;
- if (major < EXTENSION_BASE)
- return 0;
- major -= EXTENSION_BASE;
- if (major >= NumExtensions)
- return 0;
- return (*extensions[major]->MinorOpcode)(client);
-}
-
-void
-CloseDownExtensions()
-{
- register int i,j;
-
-#ifdef LBX
- LbxCloseDownExtensions();
-#endif
-
- for (i = NumExtensions - 1; i >= 0; i--)
- {
- (* extensions[i]->CloseDown)(extensions[i]);
- NumExtensions = i;
- xfree(extensions[i]->name);
- for (j = extensions[i]->num_aliases; --j >= 0;)
- xfree(extensions[i]->aliases[j]);
- xfree(extensions[i]->aliases);
- xfree(extensions[i]);
- }
- xfree(extensions);
- extensions = (ExtensionEntry **)NULL;
- lastEvent = EXTENSION_EVENT_BASE;
- lastError = FirstExtensionError;
- for (i=0; i<MAXSCREENS; i++)
- {
- register ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
-
- while (spentry->num)
- {
- spentry->num--;
- xfree(spentry->procList[spentry->num].name);
- }
- xfree(spentry->procList);
- spentry->procList = (ProcEntryPtr)NULL;
- }
-}
-
-
-int
-ProcQueryExtension(client)
- ClientPtr client;
-{
- xQueryExtensionReply reply;
- int i;
- REQUEST(xQueryExtensionReq);
-
- REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes);
-
- reply.type = X_Reply;
- reply.length = 0;
- reply.major_opcode = 0;
- reply.sequenceNumber = client->sequence;
-
- if ( ! NumExtensions )
- reply.present = xFalse;
- else
- {
- i = FindExtension((char *)&stuff[1], stuff->nbytes);
- if (i < 0
-#ifdef XCSECURITY
- /* don't show insecure extensions to untrusted clients */
- || (client->trustLevel == XSecurityClientUntrusted &&
- !extensions[i]->secure)
-#endif
- )
- reply.present = xFalse;
- else
- {
- reply.present = xTrue;
- reply.major_opcode = extensions[i]->base;
- reply.first_event = extensions[i]->eventBase;
- reply.first_error = extensions[i]->errorBase;
- }
- }
- WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply);
- return(client->noClientException);
-}
-
-int
-ProcListExtensions(client)
- ClientPtr client;
-{
- xListExtensionsReply reply;
- char *bufptr, *buffer;
- int total_length = 0;
-
- REQUEST_SIZE_MATCH(xReq);
-
- reply.type = X_Reply;
- reply.nExtensions = 0;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- buffer = NULL;
-
- if ( NumExtensions )
- {
- register int i, j;
-
- for (i=0; i<NumExtensions; i++)
- {
-#ifdef XCSECURITY
- /* don't show insecure extensions to untrusted clients */
- if (client->trustLevel == XSecurityClientUntrusted &&
- !extensions[i]->secure)
- continue;
-#endif
- total_length += strlen(extensions[i]->name) + 1;
- reply.nExtensions += 1 + extensions[i]->num_aliases;
- for (j = extensions[i]->num_aliases; --j >= 0;)
- total_length += strlen(extensions[i]->aliases[j]) + 1;
- }
- reply.length = (total_length + 3) >> 2;
- buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length);
- if (!buffer)
- return(BadAlloc);
- for (i=0; i<NumExtensions; i++)
- {
- int len;
-#ifdef XCSECURITY
- if (client->trustLevel == XSecurityClientUntrusted &&
- !extensions[i]->secure)
- continue;
-#endif
- *bufptr++ = len = strlen(extensions[i]->name);
- memmove(bufptr, extensions[i]->name, len);
- bufptr += len;
- for (j = extensions[i]->num_aliases; --j >= 0;)
- {
- *bufptr++ = len = strlen(extensions[i]->aliases[j]);
- memmove(bufptr, extensions[i]->aliases[j], len);
- bufptr += len;
- }
- }
- }
- WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);
- if (reply.length)
- {
- WriteToClient(client, total_length, buffer);
- DEALLOCATE_LOCAL(buffer);
- }
- return(client->noClientException);
-}
-
-
-ExtensionLookupProc
-LookupProc(name, pGC)
- char *name;
- GCPtr pGC;
-{
- register int i;
- register ScreenProcEntry *spentry;
- spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum];
- if (spentry->num)
- {
- for (i = 0; i < spentry->num; i++)
- if (strcmp(name, spentry->procList[i].name) == 0)
- return(spentry->procList[i].proc);
- }
- return (ExtensionLookupProc)NULL;
-}
-
-Bool
-RegisterProc(name, pGC, proc)
- char *name;
- GC *pGC;
- ExtensionLookupProc proc;
-{
- return RegisterScreenProc(name, pGC->pScreen, proc);
-}
-
-Bool
-RegisterScreenProc(name, pScreen, proc)
- char *name;
- ScreenPtr pScreen;
- ExtensionLookupProc proc;
-{
- register ScreenProcEntry *spentry;
- register ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
- char *newname;
- int i;
-
- spentry = &AuxillaryScreenProcs[pScreen->myNum];
- /* first replace duplicates */
- if (spentry->num)
- {
- for (i = 0; i < spentry->num; i++)
- if (strcmp(name, spentry->procList[i].name) == 0)
- {
- procEntry = &spentry->procList[i];
- break;
- }
- }
- if (procEntry)
- procEntry->proc = proc;
- else
- {
- newname = (char *)xalloc(strlen(name)+1);
- if (!newname)
- return FALSE;
- procEntry = (ProcEntryPtr)
- xrealloc(spentry->procList,
- sizeof(ProcEntryRec) * (spentry->num+1));
- if (!procEntry)
- {
- xfree(newname);
- return FALSE;
- }
- spentry->procList = procEntry;
- procEntry += spentry->num;
- procEntry->name = newname;
- strcpy(newname, name);
- procEntry->proc = proc;
- spentry->num++;
- }
- return TRUE;
-}
diff --git a/dix/ffs.c b/dix/ffs.c
deleted file mode 100644
index 8d0954689..000000000
--- a/dix/ffs.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $Xorg: ffs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
-ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
-ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-The Open Group.
-
-*/
-
-int
-ffs(int i)
-{
- int j;
- for (j = 1; (i & 1) == 0; j++)
- i >>= 1;
- return j;
-}
diff --git a/dix/gc.c b/dix/gc.c
deleted file mode 100644
index 11f215c8d..000000000
--- a/dix/gc.c
+++ /dev/null
@@ -1,1331 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.10 2003/11/17 22:20:34 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: gc.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "resource.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "dix.h"
-#include <assert.h>
-
-extern XID clientErrorValue;
-extern FontPtr defaultFont;
-
-static Bool CreateDefaultTile(
- GCPtr /*pGC*/
-);
-
-unsigned char DefaultDash[2] = {4, 4};
-
-void
-ValidateGC(pDraw, pGC)
- DrawablePtr pDraw;
- GC *pGC;
-{
- (*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw);
- pGC->stateChanges = 0;
- pGC->serialNumber = pDraw->serialNumber;
-}
-
-
-/* dixChangeGC(client, pGC, mask, pC32, pUnion)
- *
- * This function was created as part of the Security extension
- * implementation. The client performing the gc change must be passed so
- * that access checks can be performed on any tiles, stipples, or fonts
- * that are specified. ddxen can call this too; they should normally
- * pass NullClient for the client since any access checking should have
- * already been done at a higher level.
- *
- * Since we had to create a new function anyway, we decided to change the
- * way the list of gc values is passed to eliminate the compiler warnings
- * caused by the DoChangeGC interface. You can pass the values via pC32
- * or pUnion, but not both; one of them must be NULL. If you don't need
- * to pass any pointers, you can use either one:
- *
- * example calling dixChangeGC using pC32 parameter
- *
- * CARD32 v[2];
- * v[0] = foreground;
- * v[1] = background;
- * dixChangeGC(client, pGC, GCForeground|GCBackground, v, NULL);
- *
- * example calling dixChangeGC using pUnion parameter;
- * same effect as above
- *
- * ChangeGCVal v[2];
- * v[0].val = foreground;
- * v[1].val = background;
- * dixChangeGC(client, pGC, GCForeground|GCBackground, NULL, v);
- *
- * However, if you need to pass a pointer to a pixmap or font, you MUST
- * use the pUnion parameter.
- *
- * example calling dixChangeGC passing pointers in the value list
- * v[1].ptr is a pointer to a pixmap
- *
- * ChangeGCVal v[2];
- * v[0].val = FillTiled;
- * v[1].ptr = pPixmap;
- * dixChangeGC(client, pGC, GCFillStyle|GCTile, NULL, v);
- *
- * Note: we could have gotten by with just the pUnion parameter, but on
- * 64 bit machines that would have forced us to copy the value list that
- * comes in the ChangeGC request.
- *
- * Ideally, we'd change all the DoChangeGC calls to dixChangeGC, but this
- * is far too many changes to consider at this time, so we've only
- * changed the ones that caused compiler warnings. New code should use
- * dixChangeGC.
- *
- * dpw
- */
-
-#define NEXTVAL(_type, _var) { \
- if (pC32) _var = (_type)*pC32++; \
- else { \
- _var = (_type)(pUnion->val); pUnion++; \
- } \
- }
-
-#define NEXT_PTR(_type, _var) { \
- assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; }
-
-int
-dixChangeGC(client, pGC, mask, pC32, pUnion)
- ClientPtr client;
- register GC *pGC;
- register BITS32 mask;
- CARD32 *pC32;
- ChangeGCValPtr pUnion;
-{
- register BITS32 index2;
- register int error = 0;
- PixmapPtr pPixmap;
- BITS32 maskQ;
-
- assert( (pC32 && !pUnion) || (!pC32 && pUnion) );
- pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
-
- maskQ = mask; /* save these for when we walk the GCque */
- while (mask && !error)
- {
- index2 = (BITS32) lowbit (mask);
- mask &= ~index2;
- pGC->stateChanges |= index2;
- switch (index2)
- {
- case GCFunction:
- {
- CARD8 newalu;
- NEXTVAL(CARD8, newalu);
- if (newalu <= GXset)
- pGC->alu = newalu;
- else
- {
- clientErrorValue = newalu;
- error = BadValue;
- }
- break;
- }
- case GCPlaneMask:
- NEXTVAL(unsigned long, pGC->planemask);
- break;
- case GCForeground:
- NEXTVAL(unsigned long, pGC->fgPixel);
- /*
- * this is for CreateGC
- */
- if (!pGC->tileIsPixel && !pGC->tile.pixmap)
- {
- pGC->tileIsPixel = TRUE;
- pGC->tile.pixel = pGC->fgPixel;
- }
- break;
- case GCBackground:
- NEXTVAL(unsigned long, pGC->bgPixel);
- break;
- case GCLineWidth: /* ??? line width is a CARD16 */
- NEXTVAL(CARD16, pGC->lineWidth);
- break;
- case GCLineStyle:
- {
- unsigned int newlinestyle;
- NEXTVAL(unsigned int, newlinestyle);
- if (newlinestyle <= LineDoubleDash)
- pGC->lineStyle = newlinestyle;
- else
- {
- clientErrorValue = newlinestyle;
- error = BadValue;
- }
- break;
- }
- case GCCapStyle:
- {
- unsigned int newcapstyle;
- NEXTVAL(unsigned int, newcapstyle);
- if (newcapstyle <= CapProjecting)
- pGC->capStyle = newcapstyle;
- else
- {
- clientErrorValue = newcapstyle;
- error = BadValue;
- }
- break;
- }
- case GCJoinStyle:
- {
- unsigned int newjoinstyle;
- NEXTVAL(unsigned int, newjoinstyle);
- if (newjoinstyle <= JoinBevel)
- pGC->joinStyle = newjoinstyle;
- else
- {
- clientErrorValue = newjoinstyle;
- error = BadValue;
- }
- break;
- }
- case GCFillStyle:
- {
- unsigned int newfillstyle;
- NEXTVAL(unsigned int, newfillstyle);
- if (newfillstyle <= FillOpaqueStippled)
- pGC->fillStyle = newfillstyle;
- else
- {
- clientErrorValue = newfillstyle;
- error = BadValue;
- }
- break;
- }
- case GCFillRule:
- {
- unsigned int newfillrule;
- NEXTVAL(unsigned int, newfillrule);
- if (newfillrule <= WindingRule)
- pGC->fillRule = newfillrule;
- else
- {
- clientErrorValue = newfillrule;
- error = BadValue;
- }
- break;
- }
- case GCTile:
- {
- XID newpix = 0;
- if (pUnion)
- {
- NEXT_PTR(PixmapPtr, pPixmap);
- }
- else
- {
- NEXTVAL(XID, newpix);
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
- newpix, RT_PIXMAP, SecurityReadAccess);
- }
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != pGC->depth) ||
- (pPixmap->drawable.pScreen != pGC->pScreen))
- {
- error = BadMatch;
- }
- else
- {
- pPixmap->refcnt++;
- if (!pGC->tileIsPixel)
- (* pGC->pScreen->DestroyPixmap)(pGC->tile.pixmap);
- pGC->tileIsPixel = FALSE;
- pGC->tile.pixmap = pPixmap;
- }
- }
- else
- {
- clientErrorValue = newpix;
- error = BadPixmap;
- }
- break;
- }
- case GCStipple:
- {
- XID newstipple = 0;
- if (pUnion)
- {
- NEXT_PTR(PixmapPtr, pPixmap);
- }
- else
- {
- NEXTVAL(XID, newstipple)
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
- newstipple, RT_PIXMAP, SecurityReadAccess);
- }
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != 1) ||
- (pPixmap->drawable.pScreen != pGC->pScreen))
- {
- error = BadMatch;
- }
- else
- {
- pPixmap->refcnt++;
- if (pGC->stipple)
- (* pGC->pScreen->DestroyPixmap)(pGC->stipple);
- pGC->stipple = pPixmap;
- }
- }
- else
- {
- clientErrorValue = newstipple;
- error = BadPixmap;
- }
- break;
- }
- case GCTileStipXOrigin:
- NEXTVAL(INT16, pGC->patOrg.x);
- break;
- case GCTileStipYOrigin:
- NEXTVAL(INT16, pGC->patOrg.y);
- break;
- case GCFont:
- {
- FontPtr pFont;
- XID newfont = 0;
- if (pUnion)
- {
- NEXT_PTR(FontPtr, pFont);
- }
- else
- {
- NEXTVAL(XID, newfont)
- pFont = (FontPtr)SecurityLookupIDByType(client, newfont,
- RT_FONT, SecurityReadAccess);
- }
- if (pFont)
- {
- pFont->refcnt++;
- if (pGC->font)
- CloseFont(pGC->font, (Font)0);
- pGC->font = pFont;
- }
- else
- {
- clientErrorValue = newfont;
- error = BadFont;
- }
- break;
- }
- case GCSubwindowMode:
- {
- unsigned int newclipmode;
- NEXTVAL(unsigned int, newclipmode);
- if (newclipmode <= IncludeInferiors)
- pGC->subWindowMode = newclipmode;
- else
- {
- clientErrorValue = newclipmode;
- error = BadValue;
- }
- break;
- }
- case GCGraphicsExposures:
- {
- unsigned int newge;
- NEXTVAL(unsigned int, newge);
- if (newge <= xTrue)
- pGC->graphicsExposures = newge;
- else
- {
- clientErrorValue = newge;
- error = BadValue;
- }
- break;
- }
- case GCClipXOrigin:
- NEXTVAL(INT16, pGC->clipOrg.x);
- break;
- case GCClipYOrigin:
- NEXTVAL(INT16, pGC->clipOrg.y);
- break;
- case GCClipMask:
- {
- Pixmap pid = 0;
- int clipType = 0;
-
- if (pUnion)
- {
- NEXT_PTR(PixmapPtr, pPixmap);
- }
- else
- {
- NEXTVAL(Pixmap, pid)
- if (pid == None)
- {
- clipType = CT_NONE;
- pPixmap = NullPixmap;
- }
- else
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
- pid, RT_PIXMAP, SecurityReadAccess);
- }
-
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != 1) ||
- (pPixmap->drawable.pScreen != pGC->pScreen))
- {
- error = BadMatch;
- }
- else
- {
- clipType = CT_PIXMAP;
- pPixmap->refcnt++;
- }
- }
- else if (!pUnion && (pid != None))
- {
- clientErrorValue = pid;
- error = BadPixmap;
- }
- if(error == Success)
- {
- (*pGC->funcs->ChangeClip)(pGC, clipType,
- (pointer)pPixmap, 0);
- }
- break;
- }
- case GCDashOffset:
- NEXTVAL(INT16, pGC->dashOffset);
- break;
- case GCDashList:
- {
- CARD8 newdash;
- NEXTVAL(CARD8, newdash);
- if (newdash == 4)
- {
- if (pGC->dash != DefaultDash)
- {
- xfree(pGC->dash);
- pGC->numInDashList = 2;
- pGC->dash = DefaultDash;
- }
- }
- else if (newdash != 0)
- {
- unsigned char *dash;
-
- dash = (unsigned char *)xalloc(2 * sizeof(unsigned char));
- if (dash)
- {
- if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
- pGC->numInDashList = 2;
- pGC->dash = dash;
- dash[0] = newdash;
- dash[1] = newdash;
- }
- else
- error = BadAlloc;
- }
- else
- {
- clientErrorValue = newdash;
- error = BadValue;
- }
- break;
- }
- case GCArcMode:
- {
- unsigned int newarcmode;
- NEXTVAL(unsigned int, newarcmode);
- if (newarcmode <= ArcPieSlice)
- pGC->arcMode = newarcmode;
- else
- {
- clientErrorValue = newarcmode;
- error = BadValue;
- }
- break;
- }
- default:
- clientErrorValue = maskQ;
- error = BadValue;
- break;
- }
- } /* end while mask && !error */
-
- if (pGC->fillStyle == FillTiled && pGC->tileIsPixel)
- {
- if (!CreateDefaultTile (pGC))
- {
- pGC->fillStyle = FillSolid;
- error = BadAlloc;
- }
- }
- (*pGC->funcs->ChangeGC)(pGC, maskQ);
- return error;
-}
-
-#undef NEXTVAL
-#undef NEXT_PTR
-
-/* Publically defined entry to ChangeGC. Just calls dixChangeGC and tells
- * it that all of the entries are constants or IDs */
-int
-ChangeGC(pGC, mask, pval)
- register GC *pGC;
- register BITS32 mask;
- XID *pval;
-{
- return (dixChangeGC(NullClient, pGC, mask, pval, NULL));
-}
-
-/* DoChangeGC(pGC, mask, pval, fPointer)
- mask is a set of bits indicating which values to change.
- pval contains an appropriate value for each mask.
- fPointer is true if the values for tiles, stipples, fonts or clipmasks
- are pointers instead of IDs. Note: if you are passing pointers you
- MUST declare the array of values as type pointer! Other data types
- may not be large enough to hold pointers on some machines. Yes,
- this means you have to cast to (XID *) when you pass the array to
- DoChangeGC. Similarly, if you are not passing pointers (fPointer = 0) you
- MUST declare the array as type XID (not unsigned long!), or again the wrong
- size data type may be used. To avoid this cruftiness, use dixChangeGC
- above.
-
- if there is an error, the value is marked as changed
- anyway, which is probably wrong, but infrequent.
-
-NOTE:
- all values sent over the protocol for ChangeGC requests are
-32 bits long
-*/
-int
-DoChangeGC(pGC, mask, pval, fPointer)
- register GC *pGC;
- register BITS32 mask;
- XID *pval;
- int fPointer;
-{
- if (fPointer)
- /* XXX might be a problem on 64 bit big-endian servers */
- return dixChangeGC(NullClient, pGC, mask, NULL, (ChangeGCValPtr)pval);
- else
- return dixChangeGC(NullClient, pGC, mask, pval, NULL);
-}
-
-
-/* CreateGC(pDrawable, mask, pval, pStatus)
- creates a default GC for the given drawable, using mask to fill
- in any non-default values.
- Returns a pointer to the new GC on success, NULL otherwise.
- returns status of non-default fields in pStatus
-BUG:
- should check for failure to create default tile
-
-*/
-
-static GCPtr
-AllocateGC(ScreenPtr pScreen)
-{
- GCPtr pGC;
- register char *ptr;
- register DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- pGC = (GCPtr)xalloc(pScreen->totalGCSize);
- if (pGC)
- {
- ppriv = (DevUnion *)(pGC + 1);
- pGC->devPrivates = ppriv;
- sizes = pScreen->GCPrivateSizes;
- ptr = (char *)(ppriv + pScreen->GCPrivateLen);
- for (i = pScreen->GCPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- }
- return pGC;
-}
-
-GCPtr
-CreateGC(pDrawable, mask, pval, pStatus)
- DrawablePtr pDrawable;
- BITS32 mask;
- XID *pval;
- int *pStatus;
-{
- register GCPtr pGC;
-
- pGC = AllocateGC(pDrawable->pScreen);
- if (!pGC)
- {
- *pStatus = BadAlloc;
- return (GCPtr)NULL;
- }
-
- pGC->pScreen = pDrawable->pScreen;
- pGC->depth = pDrawable->depth;
- pGC->alu = GXcopy; /* dst <- src */
- pGC->planemask = ~0;
- pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
- pGC->funcs = 0;
-
- pGC->fgPixel = 0;
- pGC->bgPixel = 1;
- pGC->lineWidth = 0;
- pGC->lineStyle = LineSolid;
- pGC->capStyle = CapButt;
- pGC->joinStyle = JoinMiter;
- pGC->fillStyle = FillSolid;
- pGC->fillRule = EvenOddRule;
- pGC->arcMode = ArcPieSlice;
- if (mask & GCForeground)
- {
- /*
- * magic special case -- ChangeGC checks for this condition
- * and snags the Foreground value to create a pseudo default-tile
- */
- pGC->tileIsPixel = FALSE;
- pGC->tile.pixmap = NullPixmap;
- }
- else
- {
- pGC->tileIsPixel = TRUE;
- pGC->tile.pixel = 0;
- }
-
- pGC->patOrg.x = 0;
- pGC->patOrg.y = 0;
- pGC->subWindowMode = ClipByChildren;
- pGC->graphicsExposures = TRUE;
- pGC->clipOrg.x = 0;
- pGC->clipOrg.y = 0;
- pGC->clientClipType = CT_NONE;
- pGC->clientClip = (pointer)NULL;
- pGC->numInDashList = 2;
- pGC->dash = DefaultDash;
- pGC->dashOffset = 0;
- pGC->lastWinOrg.x = 0;
- pGC->lastWinOrg.y = 0;
-
- /* use the default font and stipple */
- pGC->font = defaultFont;
- defaultFont->refcnt++;
- pGC->stipple = pGC->pScreen->PixmapPerDepth[0];
- pGC->stipple->refcnt++;
-
- pGC->stateChanges = (1 << (GCLastBit+1)) - 1;
- if (!(*pGC->pScreen->CreateGC)(pGC))
- *pStatus = BadAlloc;
- else if (mask)
- *pStatus = ChangeGC(pGC, mask, pval);
- else
- *pStatus = Success;
- if (*pStatus != Success)
- {
- if (!pGC->tileIsPixel && !pGC->tile.pixmap)
- pGC->tileIsPixel = TRUE; /* undo special case */
- FreeGC(pGC, (XID)0);
- pGC = (GCPtr)NULL;
- }
-
- return (pGC);
-}
-
-static Bool
-CreateDefaultTile (pGC)
- GCPtr pGC;
-{
- XID tmpval[3];
- PixmapPtr pTile;
- GCPtr pgcScratch;
- xRectangle rect;
- CARD16 w, h;
-
- w = 1;
- h = 1;
- (*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen);
- pTile = (PixmapPtr)
- (*pGC->pScreen->CreatePixmap)(pGC->pScreen,
- w, h, pGC->depth);
- pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
- if (!pTile || !pgcScratch)
- {
- if (pTile)
- (*pTile->drawable.pScreen->DestroyPixmap)(pTile);
- if (pgcScratch)
- FreeScratchGC(pgcScratch);
- return FALSE;
- }
- tmpval[0] = GXcopy;
- tmpval[1] = pGC->tile.pixel;
- tmpval[2] = FillSolid;
- (void)ChangeGC(pgcScratch, GCFunction | GCForeground | GCFillStyle,
- tmpval);
- ValidateGC((DrawablePtr)pTile, pgcScratch);
- rect.x = 0;
- rect.y = 0;
- rect.width = w;
- rect.height = h;
- (*pgcScratch->ops->PolyFillRect)((DrawablePtr)pTile, pgcScratch, 1, &rect);
- /* Always remember to free the scratch graphics context after use. */
- FreeScratchGC(pgcScratch);
-
- pGC->tileIsPixel = FALSE;
- pGC->tile.pixmap = pTile;
- return TRUE;
-}
-
-int
-CopyGC(pgcSrc, pgcDst, mask)
- register GC *pgcSrc;
- register GC *pgcDst;
- register BITS32 mask;
-{
- register BITS32 index2;
- BITS32 maskQ;
- int error = 0;
-
- if (pgcSrc == pgcDst)
- return Success;
- pgcDst->serialNumber |= GC_CHANGE_SERIAL_BIT;
- pgcDst->stateChanges |= mask;
- maskQ = mask;
- while (mask)
- {
- index2 = (BITS32) lowbit (mask);
- mask &= ~index2;
- switch (index2)
- {
- case GCFunction:
- pgcDst->alu = pgcSrc->alu;
- break;
- case GCPlaneMask:
- pgcDst->planemask = pgcSrc->planemask;
- break;
- case GCForeground:
- pgcDst->fgPixel = pgcSrc->fgPixel;
- break;
- case GCBackground:
- pgcDst->bgPixel = pgcSrc->bgPixel;
- break;
- case GCLineWidth:
- pgcDst->lineWidth = pgcSrc->lineWidth;
- break;
- case GCLineStyle:
- pgcDst->lineStyle = pgcSrc->lineStyle;
- break;
- case GCCapStyle:
- pgcDst->capStyle = pgcSrc->capStyle;
- break;
- case GCJoinStyle:
- pgcDst->joinStyle = pgcSrc->joinStyle;
- break;
- case GCFillStyle:
- pgcDst->fillStyle = pgcSrc->fillStyle;
- break;
- case GCFillRule:
- pgcDst->fillRule = pgcSrc->fillRule;
- break;
- case GCTile:
- {
- if (EqualPixUnion(pgcDst->tileIsPixel,
- pgcDst->tile,
- pgcSrc->tileIsPixel,
- pgcSrc->tile))
- {
- break;
- }
- if (!pgcDst->tileIsPixel)
- (* pgcDst->pScreen->DestroyPixmap)(pgcDst->tile.pixmap);
- pgcDst->tileIsPixel = pgcSrc->tileIsPixel;
- pgcDst->tile = pgcSrc->tile;
- if (!pgcDst->tileIsPixel)
- pgcDst->tile.pixmap->refcnt++;
- break;
- }
- case GCStipple:
- {
- if (pgcDst->stipple == pgcSrc->stipple)
- break;
- if (pgcDst->stipple)
- (* pgcDst->pScreen->DestroyPixmap)(pgcDst->stipple);
- pgcDst->stipple = pgcSrc->stipple;
- if (pgcDst->stipple)
- pgcDst->stipple->refcnt ++;
- break;
- }
- case GCTileStipXOrigin:
- pgcDst->patOrg.x = pgcSrc->patOrg.x;
- break;
- case GCTileStipYOrigin:
- pgcDst->patOrg.y = pgcSrc->patOrg.y;
- break;
- case GCFont:
- if (pgcDst->font == pgcSrc->font)
- break;
- if (pgcDst->font)
- CloseFont(pgcDst->font, (Font)0);
- if ((pgcDst->font = pgcSrc->font) != NullFont)
- (pgcDst->font)->refcnt++;
- break;
- case GCSubwindowMode:
- pgcDst->subWindowMode = pgcSrc->subWindowMode;
- break;
- case GCGraphicsExposures:
- pgcDst->graphicsExposures = pgcSrc->graphicsExposures;
- break;
- case GCClipXOrigin:
- pgcDst->clipOrg.x = pgcSrc->clipOrg.x;
- break;
- case GCClipYOrigin:
- pgcDst->clipOrg.y = pgcSrc->clipOrg.y;
- break;
- case GCClipMask:
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- break;
- case GCDashOffset:
- pgcDst->dashOffset = pgcSrc->dashOffset;
- break;
- case GCDashList:
- if (pgcSrc->dash == DefaultDash)
- {
- if (pgcDst->dash != DefaultDash)
- {
- xfree(pgcDst->dash);
- pgcDst->numInDashList = pgcSrc->numInDashList;
- pgcDst->dash = pgcSrc->dash;
- }
- }
- else
- {
- unsigned char *dash;
- unsigned int i;
-
- dash = (unsigned char *)xalloc(pgcSrc->numInDashList *
- sizeof(unsigned char));
- if (dash)
- {
- if (pgcDst->dash != DefaultDash)
- xfree(pgcDst->dash);
- pgcDst->numInDashList = pgcSrc->numInDashList;
- pgcDst->dash = dash;
- for (i=0; i<pgcSrc->numInDashList; i++)
- dash[i] = pgcSrc->dash[i];
- }
- else
- error = BadAlloc;
- }
- break;
- case GCArcMode:
- pgcDst->arcMode = pgcSrc->arcMode;
- break;
- default:
- clientErrorValue = maskQ;
- error = BadValue;
- break;
- }
- }
- if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel)
- {
- if (!CreateDefaultTile (pgcDst))
- {
- pgcDst->fillStyle = FillSolid;
- error = BadAlloc;
- }
- }
- (*pgcDst->funcs->CopyGC) (pgcSrc, maskQ, pgcDst);
- return error;
-}
-
-/*****************
- * FreeGC
- * does the diX part of freeing the characteristics in the GC
- ***************/
-
-/*ARGSUSED*/
-int
-FreeGC(value, gid)
- pointer value; /* must conform to DeleteType */
- XID gid;
-{
- GCPtr pGC = (GCPtr)value;
-
- CloseFont(pGC->font, (Font)0);
- (* pGC->funcs->DestroyClip)(pGC);
-
- if (!pGC->tileIsPixel)
- (* pGC->pScreen->DestroyPixmap)(pGC->tile.pixmap);
- if (pGC->stipple)
- (* pGC->pScreen->DestroyPixmap)(pGC->stipple);
-
- (*pGC->funcs->DestroyGC) (pGC);
- if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
- xfree(pGC);
- return(Success);
-}
-
-void
-SetGCMask(pGC, selectMask, newDataMask)
- GCPtr pGC;
- Mask selectMask;
- Mask newDataMask;
-{
- pGC->stateChanges = (~selectMask & pGC->stateChanges) |
- (selectMask & newDataMask);
- if (selectMask & newDataMask)
- pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
-}
-
-
-
-/* CreateScratchGC(pScreen, depth)
- like CreateGC, but doesn't do the default tile or stipple,
-since we can't create them without already having a GC. any code
-using the tile or stipple has to set them explicitly anyway,
-since the state of the scratch gc is unknown. This is OK
-because ChangeGC() has to be able to deal with NULL tiles and
-stipples anyway (in case the CreateGC() call has provided a
-value for them -- we can't set the default tile until the
-client-supplied attributes are installed, since the fgPixel
-is what fills the default tile. (maybe this comment should
-go with CreateGC() or ChangeGC().)
-*/
-
-GCPtr
-CreateScratchGC(pScreen, depth)
- ScreenPtr pScreen;
- unsigned depth;
-{
- register GCPtr pGC;
-
- pGC = AllocateGC(pScreen);
- if (!pGC)
- return (GCPtr)NULL;
-
- pGC->pScreen = pScreen;
- pGC->depth = depth;
- pGC->alu = GXcopy; /* dst <- src */
- pGC->planemask = ~0;
- pGC->serialNumber = 0;
-
- pGC->fgPixel = 0;
- pGC->bgPixel = 1;
- pGC->lineWidth = 0;
- pGC->lineStyle = LineSolid;
- pGC->capStyle = CapButt;
- pGC->joinStyle = JoinMiter;
- pGC->fillStyle = FillSolid;
- pGC->fillRule = EvenOddRule;
- pGC->arcMode = ArcPieSlice;
- pGC->font = defaultFont;
- if ( pGC->font) /* necessary, because open of default font could fail */
- pGC->font->refcnt++;
- pGC->tileIsPixel = TRUE;
- pGC->tile.pixel = 0;
- pGC->stipple = NullPixmap;
- pGC->patOrg.x = 0;
- pGC->patOrg.y = 0;
- pGC->subWindowMode = ClipByChildren;
- pGC->graphicsExposures = TRUE;
- pGC->clipOrg.x = 0;
- pGC->clipOrg.y = 0;
- pGC->clientClipType = CT_NONE;
- pGC->dashOffset = 0;
- pGC->numInDashList = 2;
- pGC->dash = DefaultDash;
- pGC->lastWinOrg.x = 0;
- pGC->lastWinOrg.y = 0;
-
- pGC->stateChanges = (1 << (GCLastBit+1)) - 1;
- if (!(*pScreen->CreateGC)(pGC))
- {
- FreeGC(pGC, (XID)0);
- pGC = (GCPtr)NULL;
- }
- return pGC;
-}
-
-void
-FreeGCperDepth(screenNum)
- int screenNum;
-{
- register int i;
- register ScreenPtr pScreen;
- GCPtr *ppGC;
-
- pScreen = screenInfo.screens[screenNum];
- ppGC = pScreen->GCperDepth;
-
- for (i = 0; i <= pScreen->numDepths; i++)
- (void)FreeGC(ppGC[i], (XID)0);
- pScreen->rgf = ~0L;
-}
-
-
-Bool
-CreateGCperDepth(screenNum)
- int screenNum;
-{
- register int i;
- register ScreenPtr pScreen;
- DepthPtr pDepth;
- GCPtr *ppGC;
-
- pScreen = screenInfo.screens[screenNum];
- pScreen->rgf = 0;
- ppGC = pScreen->GCperDepth;
- /* do depth 1 separately because it's not included in list */
- if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
- return FALSE;
- ppGC[0]->graphicsExposures = FALSE;
-
- pDepth = pScreen->allowedDepths;
- for (i=0; i<pScreen->numDepths; i++, pDepth++)
- {
- if (!(ppGC[i+1] = CreateScratchGC(pScreen, pDepth->depth)))
- {
- for (; i >= 0; i--)
- (void)FreeGC(ppGC[i], (XID)0);
- return FALSE;
- }
- ppGC[i+1]->graphicsExposures = FALSE;
- }
- return TRUE;
-}
-
-Bool
-CreateDefaultStipple(screenNum)
- int screenNum;
-{
- register ScreenPtr pScreen;
- XID tmpval[3];
- xRectangle rect;
- CARD16 w, h;
- GCPtr pgcScratch;
-
- pScreen = screenInfo.screens[screenNum];
-
- w = 16;
- h = 16;
- (* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen);
- if (!(pScreen->PixmapPerDepth[0] =
- (*pScreen->CreatePixmap)(pScreen, w, h, 1)))
- return FALSE;
- /* fill stipple with 1 */
- tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid;
- pgcScratch = GetScratchGC(1, pScreen);
- if (!pgcScratch)
- {
- (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
- return FALSE;
- }
- (void)ChangeGC(pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
- ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
- rect.x = 0;
- rect.y = 0;
- rect.width = w;
- rect.height = h;
- (*pgcScratch->ops->PolyFillRect)((DrawablePtr)pScreen->PixmapPerDepth[0],
- pgcScratch, 1, &rect);
- FreeScratchGC(pgcScratch);
- return TRUE;
-}
-
-void
-FreeDefaultStipple(screenNum)
- int screenNum;
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
-}
-
-int
-SetDashes(pGC, offset, ndash, pdash)
-register GCPtr pGC;
-unsigned offset;
-register unsigned ndash;
-register unsigned char *pdash;
-{
- register long i;
- register unsigned char *p, *indash;
- BITS32 maskQ = 0;
-
- i = ndash;
- p = pdash;
- while (i--)
- {
- if (!*p++)
- {
- /* dash segment must be > 0 */
- clientErrorValue = 0;
- return BadValue;
- }
- }
-
- if (ndash & 1)
- p = (unsigned char *)xalloc(2 * ndash * sizeof(unsigned char));
- else
- p = (unsigned char *)xalloc(ndash * sizeof(unsigned char));
- if (!p)
- return BadAlloc;
-
- pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
- if (offset != pGC->dashOffset)
- {
- pGC->dashOffset = offset;
- pGC->stateChanges |= GCDashOffset;
- maskQ |= GCDashOffset;
- }
-
- if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
- pGC->numInDashList = ndash;
- pGC->dash = p;
- if (ndash & 1)
- {
- pGC->numInDashList += ndash;
- indash = pdash;
- i = ndash;
- while (i--)
- *p++ = *indash++;
- }
- while(ndash--)
- *p++ = *pdash++;
- pGC->stateChanges |= GCDashList;
- maskQ |= GCDashList;
-
- if (pGC->funcs->ChangeGC)
- (*pGC->funcs->ChangeGC) (pGC, maskQ);
- return Success;
-}
-
-int
-VerifyRectOrder(nrects, prects, ordering)
- int nrects;
- xRectangle *prects;
- int ordering;
-{
- register xRectangle *prectP, *prectN;
- register int i;
-
- switch(ordering)
- {
- case Unsorted:
- return CT_UNSORTED;
- case YSorted:
- if(nrects > 1)
- {
- for(i = 1, prectP = prects, prectN = prects + 1;
- i < nrects;
- i++, prectP++, prectN++)
- if(prectN->y < prectP->y)
- return -1;
- }
- return CT_YSORTED;
- case YXSorted:
- if(nrects > 1)
- {
- for(i = 1, prectP = prects, prectN = prects + 1;
- i < nrects;
- i++, prectP++, prectN++)
- if((prectN->y < prectP->y) ||
- ( (prectN->y == prectP->y) &&
- (prectN->x < prectP->x) ) )
- return -1;
- }
- return CT_YXSORTED;
- case YXBanded:
- if(nrects > 1)
- {
- for(i = 1, prectP = prects, prectN = prects + 1;
- i < nrects;
- i++, prectP++, prectN++)
- if((prectN->y != prectP->y &&
- prectN->y < prectP->y + (int) prectP->height) ||
- ((prectN->y == prectP->y) &&
- (prectN->height != prectP->height ||
- prectN->x < prectP->x + (int) prectP->width)))
- return -1;
- }
- return CT_YXBANDED;
- }
- return -1;
-}
-
-int
-SetClipRects(pGC, xOrigin, yOrigin, nrects, prects, ordering)
- GCPtr pGC;
- int xOrigin, yOrigin;
- int nrects;
- xRectangle *prects;
- int ordering;
-{
- int newct, size;
- xRectangle *prectsNew;
-
- newct = VerifyRectOrder(nrects, prects, ordering);
- if (newct < 0)
- return(BadMatch);
- size = nrects * sizeof(xRectangle);
- prectsNew = (xRectangle *) xalloc(size);
- if (!prectsNew && size)
- return BadAlloc;
-
- pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
- pGC->clipOrg.x = xOrigin;
- pGC->stateChanges |= GCClipXOrigin;
-
- pGC->clipOrg.y = yOrigin;
- pGC->stateChanges |= GCClipYOrigin;
-
- if (size)
- memmove((char *)prectsNew, (char *)prects, size);
- (*pGC->funcs->ChangeClip)(pGC, newct, (pointer)prectsNew, nrects);
- if (pGC->funcs->ChangeGC)
- (*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin|GCClipYOrigin|GCClipMask);
- return Success;
-}
-
-
-/*
- sets reasonable defaults
- if we can get a pre-allocated one, use it and mark it as used.
- if we can't, create one out of whole cloth (The Velveteen GC -- if
- you use it often enough it will become real.)
-*/
-GCPtr
-GetScratchGC(depth, pScreen)
- register unsigned depth;
- register ScreenPtr pScreen;
-{
- register int i;
- register GCPtr pGC;
-
- for (i=0; i<=pScreen->numDepths; i++)
- if ( pScreen->GCperDepth[i]->depth == depth &&
- !(pScreen->rgf & (1L << (i+1)))
- )
- {
- pScreen->rgf |= (1L << (i+1));
- pGC = (pScreen->GCperDepth[i]);
-
- pGC->alu = GXcopy;
- pGC->planemask = ~0;
- pGC->serialNumber = 0;
- pGC->fgPixel = 0;
- pGC->bgPixel = 1;
- pGC->lineWidth = 0;
- pGC->lineStyle = LineSolid;
- pGC->capStyle = CapButt;
- pGC->joinStyle = JoinMiter;
- pGC->fillStyle = FillSolid;
- pGC->fillRule = EvenOddRule;
- pGC->arcMode = ArcChord;
- pGC->patOrg.x = 0;
- pGC->patOrg.y = 0;
- pGC->subWindowMode = ClipByChildren;
- pGC->graphicsExposures = FALSE;
- pGC->clipOrg.x = 0;
- pGC->clipOrg.y = 0;
- if (pGC->clientClipType != CT_NONE)
- (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0);
- pGC->stateChanges = (1 << (GCLastBit+1)) - 1;
- return pGC;
- }
- /* if we make it this far, need to roll our own */
- pGC = CreateScratchGC(pScreen, depth);
- if (pGC)
- pGC->graphicsExposures = FALSE;
- return pGC;
-}
-
-/*
- if the gc to free is in the table of pre-existing ones,
-mark it as available.
- if not, free it for real
-*/
-void
-FreeScratchGC(pGC)
- register GCPtr pGC;
-{
- register ScreenPtr pScreen = pGC->pScreen;
- register int i;
-
- for (i=0; i<=pScreen->numDepths; i++)
- {
- if ( pScreen->GCperDepth[i] == pGC)
- {
- pScreen->rgf &= ~(1L << (i+1));
- return;
- }
- }
- (void)FreeGC(pGC, (GContext)0);
-}
diff --git a/dix/globals.c b/dix/globals.c
deleted file mode 100644
index 1ec71aac1..000000000
--- a/dix/globals.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12 2003/11/10 18:21:46 tsi Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: globals.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "input.h"
-#include "dixfont.h"
-#include "site.h"
-#include "dixstruct.h"
-#include "os.h"
-
-ScreenInfo screenInfo;
-KeybdCtrl defaultKeyboardControl = {
- DEFAULT_KEYBOARD_CLICK,
- DEFAULT_BELL,
- DEFAULT_BELL_PITCH,
- DEFAULT_BELL_DURATION,
- DEFAULT_AUTOREPEAT,
- DEFAULT_AUTOREPEATS,
- DEFAULT_LEDS,
- 0};
-
-PtrCtrl defaultPointerControl = {
- DEFAULT_PTR_NUMERATOR,
- DEFAULT_PTR_DENOMINATOR,
- DEFAULT_PTR_THRESHOLD,
- 0};
-
-ClientPtr *clients;
-ClientPtr serverClient;
-int currentMaxClients; /* current size of clients array */
-long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
-
-WindowPtr *WindowTable;
-
-unsigned long globalSerialNumber = 0;
-unsigned long serverGeneration = 0;
-
-/* these next four are initialized in main.c */
-CARD32 ScreenSaverTime;
-CARD32 ScreenSaverInterval;
-int ScreenSaverBlanking;
-int ScreenSaverAllowExposures;
-
-#ifdef DPMSExtension
-#define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2
-#define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3
-#define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4
-CARD32 defaultDPMSStandbyTime = DEFAULT_STANDBY_TIME;
-CARD32 defaultDPMSSuspendTime = DEFAULT_SUSPEND_TIME;
-CARD32 defaultDPMSOffTime = DEFAULT_OFF_TIME;
-CARD16 DPMSPowerLevel = 0;
-Bool defaultDPMSEnabled = FALSE;
-Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command line */
-Bool DPMSDisabledSwitch = FALSE; /* switch states */
-Bool DPMSCapableFlag = FALSE;
-CARD32 DPMSStandbyTime;
-CARD32 DPMSSuspendTime;
-CARD32 DPMSOffTime;
-Bool DPMSEnabled;
-#endif
-
-CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME;
-CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL;
-int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING;
-int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES;
-#ifndef NOLOGOHACK
-int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
-#endif
-
-char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
-char *defaultTextFont = COMPILEDDEFAULTFONT;
-char *defaultCursorFont = COMPILEDCURSORFONT;
-char *rgbPath = RGB_DB;
-char *defaultDisplayClass = COMPILEDDISPLAYCLASS;
-FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in
- every compilation of dix code */
-Bool loadableFonts = FALSE;
-CursorPtr rootCursor;
-Bool blackRoot=FALSE;
-ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
-
-TimeStamp currentTime;
-TimeStamp lastDeviceEventTime;
-
-Bool permitOldBugs = FALSE; /* turn off some error checking, to permit certain
- * old broken clients (like R2/R3 xterms) to work
- */
-
-int defaultColorVisualClass = -1;
-int monitorResolution = 0;
-
-char *display;
-
-CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
-int argcGlobal;
-char **argvGlobal;
-
-DDXPointRec dixScreenOrigins[MAXSCREENS];
-
-volatile ScreenPtr currentRegionScreen;
diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c
deleted file mode 100644
index 630e98fa3..000000000
--- a/dix/glyphcurs.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/************************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-************************************************************************/
-
-/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "misc.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "resource.h"
-#include "dix.h"
-#include "cursorstr.h"
-#include "opaque.h"
-#include "servermd.h"
-
-
-/*
- get the bits out of the font in a portable way. to avoid
-dealing with padding and such-like, we draw the glyph into
-a bitmap, then read the bits out with GetImage, which
-uses server-natural format.
- since all screens return the same bitmap format, we'll just use
-the first one we find.
- the character origin lines up with the hotspot in the
-cursor metrics.
-*/
-
-int
-ServerBitsFromGlyph(pfont, ch, cm, ppbits)
- FontPtr pfont;
- unsigned int ch;
- register CursorMetricPtr cm;
- unsigned char **ppbits;
-{
- register ScreenPtr pScreen;
- register GCPtr pGC;
- xRectangle rect;
- PixmapPtr ppix;
- long nby;
- char *pbits;
- ChangeGCVal gcval[3];
- unsigned char char2b[2];
-
- /* turn glyph index into a protocol-format char2b */
- char2b[0] = (unsigned char)(ch >> 8);
- char2b[1] = (unsigned char)(ch & 0xff);
-
- pScreen = screenInfo.screens[0];
- nby = BitmapBytePad(cm->width) * (long)cm->height;
- pbits = (char *)xalloc(nby);
- if (!pbits)
- return BadAlloc;
- /* zeroing the (pad) bits seems to help some ddx cursor handling */
- bzero(pbits, nby);
-
- ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width,
- cm->height, 1);
- pGC = GetScratchGC(1, pScreen);
- if (!ppix || !pGC)
- {
- if (ppix)
- (*pScreen->DestroyPixmap)(ppix);
- if (pGC)
- FreeScratchGC(pGC);
- xfree(pbits);
- return BadAlloc;
- }
-
- rect.x = 0;
- rect.y = 0;
- rect.width = cm->width;
- rect.height = cm->height;
-
- /* fill the pixmap with 0 */
- gcval[0].val = GXcopy;
- gcval[1].val = 0;
- gcval[2].ptr = (pointer)pfont;
- dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont,
- NULL, gcval);
- ValidateGC((DrawablePtr)ppix, pGC);
- (*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect);
-
- /* draw the glyph */
- gcval[0].val = 1;
- dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval);
- ValidateGC((DrawablePtr)ppix, pGC);
- (*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot,
- 1, (unsigned short *)char2b);
- (*pScreen->GetImage)((DrawablePtr)ppix, 0, 0, cm->width, cm->height,
- XYPixmap, 1, pbits);
- *ppbits = (unsigned char *)pbits;
- FreeScratchGC(pGC);
- (*pScreen->DestroyPixmap)(ppix);
- return Success;
-}
-
-
-Bool
-CursorMetricsFromGlyph( pfont, ch, cm)
- register FontPtr pfont;
- unsigned ch;
- register CursorMetricPtr cm;
-{
- CharInfoPtr pci;
- unsigned long nglyphs;
- CARD8 chs[2];
- FontEncoding encoding;
-
- chs[0] = ch >> 8;
- chs[1] = ch;
- encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit;
- if (encoding == Linear16Bit)
- {
- if (ch < pfont->info.firstCol || pfont->info.lastCol < ch)
- return FALSE;
- }
- else
- {
- if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0])
- return FALSE;
- if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1])
- return FALSE;
- }
- (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci);
- if (nglyphs == 0)
- return FALSE;
- cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- cm->height = pci->metrics.descent + pci->metrics.ascent;
- if (pci->metrics.leftSideBearing > 0)
- {
- cm->width += pci->metrics.leftSideBearing;
- cm->xhot = 0;
- }
- else
- {
- cm->xhot = -pci->metrics.leftSideBearing;
- if (pci->metrics.rightSideBearing < 0)
- cm->width -= pci->metrics.rightSideBearing;
- }
- if (pci->metrics.ascent < 0)
- {
- cm->height -= pci->metrics.ascent;
- cm->yhot = 0;
- }
- else
- {
- cm->yhot = pci->metrics.ascent;
- if (pci->metrics.descent < 0)
- cm->height -= pci->metrics.descent;
- }
- return TRUE;
-}
diff --git a/dix/grabs.c b/dix/grabs.c
deleted file mode 100644
index 7a9fbcdb5..000000000
--- a/dix/grabs.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/* $Xorg: grabs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN action OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.5 2003/11/17 22:20:34 dawes Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "windowstr.h"
-#include "inputstr.h"
-#include "cursorstr.h"
-#include "dixgrabs.h"
-
-#define BITMASK(i) (((Mask)1) << ((i) & 31))
-#define MASKIDX(i) ((i) >> 5)
-#define MASKWORD(buf, i) buf[MASKIDX(i)]
-#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i)
-#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i)
-#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i))
-
-GrabPtr
-CreateGrab(
- int client,
- DeviceIntPtr device,
- WindowPtr window,
- Mask eventMask,
- Bool ownerEvents, Bool keyboardMode, Bool pointerMode,
- DeviceIntPtr modDevice,
- unsigned short modifiers,
- int type,
- KeyCode keybut, /* key or button */
- WindowPtr confineTo,
- CursorPtr cursor)
-{
- GrabPtr grab;
-
- grab = (GrabPtr)xalloc(sizeof(GrabRec));
- if (!grab)
- return (GrabPtr)NULL;
- grab->resource = FakeClientID(client);
- grab->device = device;
- grab->coreGrab = ((device == inputInfo.keyboard) ||
- (device == inputInfo.pointer));
- grab->window = window;
- grab->eventMask = eventMask;
- grab->ownerEvents = ownerEvents;
- grab->keyboardMode = keyboardMode;
- grab->pointerMode = pointerMode;
- grab->modifiersDetail.exact = modifiers;
- grab->modifiersDetail.pMask = NULL;
- grab->modifierDevice = modDevice;
- grab->coreMods = ((modDevice == inputInfo.keyboard) ||
- (modDevice == inputInfo.pointer));
- grab->type = type;
- grab->detail.exact = keybut;
- grab->detail.pMask = NULL;
- grab->confineTo = confineTo;
- grab->cursor = cursor;
- if (cursor)
- cursor->refcnt++;
- return grab;
-
-}
-
-static void
-FreeGrab(GrabPtr pGrab)
-{
- if (pGrab->modifiersDetail.pMask != NULL)
- xfree(pGrab->modifiersDetail.pMask);
-
- if (pGrab->detail.pMask != NULL)
- xfree(pGrab->detail.pMask);
-
- if (pGrab->cursor)
- FreeCursor(pGrab->cursor, (Cursor)0);
-
- xfree(pGrab);
-}
-
-/*ARGSUSED*/
-int
-DeletePassiveGrab(value, id)
- pointer value;
- XID id;
-{
- register GrabPtr g, prev;
- GrabPtr pGrab = (GrabPtr)value;
-
- /* it is OK if the grab isn't found */
- prev = 0;
- for (g = (wPassiveGrabs (pGrab->window)); g; g = g->next)
- {
- if (pGrab == g)
- {
- if (prev)
- prev->next = g->next;
- else
- if (!(pGrab->window->optional->passiveGrabs = g->next))
- CheckWindowOptionalNeed (pGrab->window);
- break;
- }
- prev = g;
- }
- FreeGrab(pGrab);
- return Success;
-}
-
-static Mask *
-DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail)
-{
- register Mask *mask;
- register int i;
-
- mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask);
- if (mask)
- {
- if (pDetailMask)
- for (i = 0; i < MasksPerDetailMask; i++)
- mask[i]= pDetailMask[i];
- else
- for (i = 0; i < MasksPerDetailMask; i++)
- mask[i]= ~0L;
- BITCLEAR(mask, detail);
- }
- return mask;
-}
-
-static Bool
-IsInGrabMask(
- DetailRec firstDetail,
- DetailRec secondDetail,
- unsigned short exception)
-{
- if (firstDetail.exact == exception)
- {
- if (firstDetail.pMask == NULL)
- return TRUE;
-
- /* (at present) never called with two non-null pMasks */
- if (secondDetail.exact == exception)
- return FALSE;
-
- if (GETBIT(firstDetail.pMask, secondDetail.exact))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static Bool
-IdenticalExactDetails(
- unsigned short firstExact,
- unsigned short secondExact,
- unsigned short exception)
-{
- if ((firstExact == exception) || (secondExact == exception))
- return FALSE;
-
- if (firstExact == secondExact)
- return TRUE;
-
- return FALSE;
-}
-
-static Bool
-DetailSupersedesSecond(
- DetailRec firstDetail,
- DetailRec secondDetail,
- unsigned short exception)
-{
- if (IsInGrabMask(firstDetail, secondDetail, exception))
- return TRUE;
-
- if (IdenticalExactDetails(firstDetail.exact, secondDetail.exact,
- exception))
- return TRUE;
-
- return FALSE;
-}
-
-static Bool
-GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
-{
- if (!DetailSupersedesSecond(pFirstGrab->modifiersDetail,
- pSecondGrab->modifiersDetail,
- (unsigned short)AnyModifier))
- return FALSE;
-
- if (DetailSupersedesSecond(pFirstGrab->detail,
- pSecondGrab->detail, (unsigned short)AnyKey))
- return TRUE;
-
- return FALSE;
-}
-
-Bool
-GrabMatchesSecond(pFirstGrab, pSecondGrab)
- GrabPtr pFirstGrab, pSecondGrab;
-{
- if ((pFirstGrab->device != pSecondGrab->device) ||
- (pFirstGrab->modifierDevice != pSecondGrab->modifierDevice) ||
- (pFirstGrab->type != pSecondGrab->type))
- return FALSE;
-
- if (GrabSupersedesSecond(pFirstGrab, pSecondGrab) ||
- GrabSupersedesSecond(pSecondGrab, pFirstGrab))
- return TRUE;
-
- if (DetailSupersedesSecond(pSecondGrab->detail, pFirstGrab->detail,
- (unsigned short)AnyKey)
- &&
- DetailSupersedesSecond(pFirstGrab->modifiersDetail,
- pSecondGrab->modifiersDetail,
- (unsigned short)AnyModifier))
- return TRUE;
-
- if (DetailSupersedesSecond(pFirstGrab->detail, pSecondGrab->detail,
- (unsigned short)AnyKey)
- &&
- DetailSupersedesSecond(pSecondGrab->modifiersDetail,
- pFirstGrab->modifiersDetail,
- (unsigned short)AnyModifier))
- return TRUE;
-
- return FALSE;
-}
-
-int
-AddPassiveGrabToList(pGrab)
- GrabPtr pGrab;
-{
- GrabPtr grab;
-
- for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
- {
- if (GrabMatchesSecond(pGrab, grab))
- {
- if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource))
- {
- FreeGrab(pGrab);
- return BadAccess;
- }
- }
- }
-
- if (!pGrab->window->optional && !MakeWindowOptional (pGrab->window))
- {
- FreeGrab(pGrab);
- return BadAlloc;
- }
- pGrab->next = pGrab->window->optional->passiveGrabs;
- pGrab->window->optional->passiveGrabs = pGrab;
- if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (pointer)pGrab))
- return Success;
- return BadAlloc;
-}
-
-/* the following is kinda complicated, because we need to be able to back out
- * if any allocation fails
- */
-
-Bool
-DeletePassiveGrabFromList(pMinuendGrab)
- GrabPtr pMinuendGrab;
-{
- register GrabPtr grab;
- GrabPtr *deletes, *adds;
- Mask ***updates, **details;
- int i, ndels, nadds, nups;
- Bool ok;
-
-#define UPDATE(mask,exact) \
- if (!(details[nups] = DeleteDetailFromMask(mask, exact))) \
- ok = FALSE; \
- else \
- updates[nups++] = &(mask)
-
- i = 0;
- for (grab = wPassiveGrabs(pMinuendGrab->window); grab; grab = grab->next)
- i++;
- if (!i)
- return TRUE;
- deletes = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr));
- adds = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr));
- updates = (Mask ***)ALLOCATE_LOCAL(i * sizeof(Mask **));
- details = (Mask **)ALLOCATE_LOCAL(i * sizeof(Mask *));
- if (!deletes || !adds || !updates || !details)
- {
- if (details) DEALLOCATE_LOCAL(details);
- if (updates) DEALLOCATE_LOCAL(updates);
- if (adds) DEALLOCATE_LOCAL(adds);
- if (deletes) DEALLOCATE_LOCAL(deletes);
- return FALSE;
- }
- ndels = nadds = nups = 0;
- ok = TRUE;
- for (grab = wPassiveGrabs(pMinuendGrab->window);
- grab && ok;
- grab = grab->next)
- {
- if ((CLIENT_BITS(grab->resource) != CLIENT_BITS(pMinuendGrab->resource)) ||
- !GrabMatchesSecond(grab, pMinuendGrab))
- continue;
- if (GrabSupersedesSecond(pMinuendGrab, grab))
- {
- deletes[ndels++] = grab;
- }
- else if ((grab->detail.exact == AnyKey)
- && (grab->modifiersDetail.exact != AnyModifier))
- {
- UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
- }
- else if ((grab->modifiersDetail.exact == AnyModifier)
- && (grab->detail.exact != AnyKey))
- {
- UPDATE(grab->modifiersDetail.pMask,
- pMinuendGrab->modifiersDetail.exact);
- }
- else if ((pMinuendGrab->detail.exact != AnyKey)
- && (pMinuendGrab->modifiersDetail.exact != AnyModifier))
- {
- GrabPtr pNewGrab;
-
- UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
-
- pNewGrab = CreateGrab(CLIENT_ID(grab->resource), grab->device,
- grab->window, (Mask)grab->eventMask,
- (Bool)grab->ownerEvents,
- (Bool)grab->keyboardMode,
- (Bool)grab->pointerMode,
- grab->modifierDevice,
- AnyModifier, (int)grab->type,
- pMinuendGrab->detail.exact,
- grab->confineTo, grab->cursor);
- if (!pNewGrab)
- ok = FALSE;
- else if (!(pNewGrab->modifiersDetail.pMask =
- DeleteDetailFromMask(grab->modifiersDetail.pMask,
- pMinuendGrab->modifiersDetail.exact))
- ||
- (!pNewGrab->window->optional &&
- !MakeWindowOptional(pNewGrab->window)))
- {
- FreeGrab(pNewGrab);
- ok = FALSE;
- }
- else if (!AddResource(pNewGrab->resource, RT_PASSIVEGRAB,
- (pointer)pNewGrab))
- ok = FALSE;
- else
- adds[nadds++] = pNewGrab;
- }
- else if (pMinuendGrab->detail.exact == AnyKey)
- {
- UPDATE(grab->modifiersDetail.pMask,
- pMinuendGrab->modifiersDetail.exact);
- }
- else
- {
- UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
- }
- }
-
- if (!ok)
- {
- for (i = 0; i < nadds; i++)
- FreeResource(adds[i]->resource, RT_NONE);
- for (i = 0; i < nups; i++)
- xfree(details[i]);
- }
- else
- {
- for (i = 0; i < ndels; i++)
- FreeResource(deletes[i]->resource, RT_NONE);
- for (i = 0; i < nadds; i++)
- {
- grab = adds[i];
- grab->next = grab->window->optional->passiveGrabs;
- grab->window->optional->passiveGrabs = grab;
- }
- for (i = 0; i < nups; i++)
- {
- xfree(*updates[i]);
- *updates[i] = details[i];
- }
- }
- DEALLOCATE_LOCAL(details);
- DEALLOCATE_LOCAL(updates);
- DEALLOCATE_LOCAL(adds);
- DEALLOCATE_LOCAL(deletes);
- return ok;
-
-#undef UPDATE
-}
diff --git a/dix/initatoms.c b/dix/initatoms.c
deleted file mode 100644
index 7aadd909a..000000000
--- a/dix/initatoms.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* THIS IS A GENERATED FILE
- *
- * Do not change! Changing this file implies a protocol change!
- */
-
-#include "X.h"
-#include "Xatom.h"
-#include "misc.h"
-#include "dix.h"
-void MakePredeclaredAtoms()
-{
- if (MakeAtom("PRIMARY", 7, 1) != XA_PRIMARY) AtomError();
- if (MakeAtom("SECONDARY", 9, 1) != XA_SECONDARY) AtomError();
- if (MakeAtom("ARC", 3, 1) != XA_ARC) AtomError();
- if (MakeAtom("ATOM", 4, 1) != XA_ATOM) AtomError();
- if (MakeAtom("BITMAP", 6, 1) != XA_BITMAP) AtomError();
- if (MakeAtom("CARDINAL", 8, 1) != XA_CARDINAL) AtomError();
- if (MakeAtom("COLORMAP", 8, 1) != XA_COLORMAP) AtomError();
- if (MakeAtom("CURSOR", 6, 1) != XA_CURSOR) AtomError();
- if (MakeAtom("CUT_BUFFER0", 11, 1) != XA_CUT_BUFFER0) AtomError();
- if (MakeAtom("CUT_BUFFER1", 11, 1) != XA_CUT_BUFFER1) AtomError();
- if (MakeAtom("CUT_BUFFER2", 11, 1) != XA_CUT_BUFFER2) AtomError();
- if (MakeAtom("CUT_BUFFER3", 11, 1) != XA_CUT_BUFFER3) AtomError();
- if (MakeAtom("CUT_BUFFER4", 11, 1) != XA_CUT_BUFFER4) AtomError();
- if (MakeAtom("CUT_BUFFER5", 11, 1) != XA_CUT_BUFFER5) AtomError();
- if (MakeAtom("CUT_BUFFER6", 11, 1) != XA_CUT_BUFFER6) AtomError();
- if (MakeAtom("CUT_BUFFER7", 11, 1) != XA_CUT_BUFFER7) AtomError();
- if (MakeAtom("DRAWABLE", 8, 1) != XA_DRAWABLE) AtomError();
- if (MakeAtom("FONT", 4, 1) != XA_FONT) AtomError();
- if (MakeAtom("INTEGER", 7, 1) != XA_INTEGER) AtomError();
- if (MakeAtom("PIXMAP", 6, 1) != XA_PIXMAP) AtomError();
- if (MakeAtom("POINT", 5, 1) != XA_POINT) AtomError();
- if (MakeAtom("RECTANGLE", 9, 1) != XA_RECTANGLE) AtomError();
- if (MakeAtom("RESOURCE_MANAGER", 16, 1) != XA_RESOURCE_MANAGER) AtomError();
- if (MakeAtom("RGB_COLOR_MAP", 13, 1) != XA_RGB_COLOR_MAP) AtomError();
- if (MakeAtom("RGB_BEST_MAP", 12, 1) != XA_RGB_BEST_MAP) AtomError();
- if (MakeAtom("RGB_BLUE_MAP", 12, 1) != XA_RGB_BLUE_MAP) AtomError();
- if (MakeAtom("RGB_DEFAULT_MAP", 15, 1) != XA_RGB_DEFAULT_MAP) AtomError();
- if (MakeAtom("RGB_GRAY_MAP", 12, 1) != XA_RGB_GRAY_MAP) AtomError();
- if (MakeAtom("RGB_GREEN_MAP", 13, 1) != XA_RGB_GREEN_MAP) AtomError();
- if (MakeAtom("RGB_RED_MAP", 11, 1) != XA_RGB_RED_MAP) AtomError();
- if (MakeAtom("STRING", 6, 1) != XA_STRING) AtomError();
- if (MakeAtom("VISUALID", 8, 1) != XA_VISUALID) AtomError();
- if (MakeAtom("WINDOW", 6, 1) != XA_WINDOW) AtomError();
- if (MakeAtom("WM_COMMAND", 10, 1) != XA_WM_COMMAND) AtomError();
- if (MakeAtom("WM_HINTS", 8, 1) != XA_WM_HINTS) AtomError();
- if (MakeAtom("WM_CLIENT_MACHINE", 17, 1) != XA_WM_CLIENT_MACHINE) AtomError();
- if (MakeAtom("WM_ICON_NAME", 12, 1) != XA_WM_ICON_NAME) AtomError();
- if (MakeAtom("WM_ICON_SIZE", 12, 1) != XA_WM_ICON_SIZE) AtomError();
- if (MakeAtom("WM_NAME", 7, 1) != XA_WM_NAME) AtomError();
- if (MakeAtom("WM_NORMAL_HINTS", 15, 1) != XA_WM_NORMAL_HINTS) AtomError();
- if (MakeAtom("WM_SIZE_HINTS", 13, 1) != XA_WM_SIZE_HINTS) AtomError();
- if (MakeAtom("WM_ZOOM_HINTS", 13, 1) != XA_WM_ZOOM_HINTS) AtomError();
- if (MakeAtom("MIN_SPACE", 9, 1) != XA_MIN_SPACE) AtomError();
- if (MakeAtom("NORM_SPACE", 10, 1) != XA_NORM_SPACE) AtomError();
- if (MakeAtom("MAX_SPACE", 9, 1) != XA_MAX_SPACE) AtomError();
- if (MakeAtom("END_SPACE", 9, 1) != XA_END_SPACE) AtomError();
- if (MakeAtom("SUPERSCRIPT_X", 13, 1) != XA_SUPERSCRIPT_X) AtomError();
- if (MakeAtom("SUPERSCRIPT_Y", 13, 1) != XA_SUPERSCRIPT_Y) AtomError();
- if (MakeAtom("SUBSCRIPT_X", 11, 1) != XA_SUBSCRIPT_X) AtomError();
- if (MakeAtom("SUBSCRIPT_Y", 11, 1) != XA_SUBSCRIPT_Y) AtomError();
- if (MakeAtom("UNDERLINE_POSITION", 18, 1) != XA_UNDERLINE_POSITION) AtomError();
- if (MakeAtom("UNDERLINE_THICKNESS", 19, 1) != XA_UNDERLINE_THICKNESS) AtomError();
- if (MakeAtom("STRIKEOUT_ASCENT", 16, 1) != XA_STRIKEOUT_ASCENT) AtomError();
- if (MakeAtom("STRIKEOUT_DESCENT", 17, 1) != XA_STRIKEOUT_DESCENT) AtomError();
- if (MakeAtom("ITALIC_ANGLE", 12, 1) != XA_ITALIC_ANGLE) AtomError();
- if (MakeAtom("X_HEIGHT", 8, 1) != XA_X_HEIGHT) AtomError();
- if (MakeAtom("QUAD_WIDTH", 10, 1) != XA_QUAD_WIDTH) AtomError();
- if (MakeAtom("WEIGHT", 6, 1) != XA_WEIGHT) AtomError();
- if (MakeAtom("POINT_SIZE", 10, 1) != XA_POINT_SIZE) AtomError();
- if (MakeAtom("RESOLUTION", 10, 1) != XA_RESOLUTION) AtomError();
- if (MakeAtom("COPYRIGHT", 9, 1) != XA_COPYRIGHT) AtomError();
- if (MakeAtom("NOTICE", 6, 1) != XA_NOTICE) AtomError();
- if (MakeAtom("FONT_NAME", 9, 1) != XA_FONT_NAME) AtomError();
- if (MakeAtom("FAMILY_NAME", 11, 1) != XA_FAMILY_NAME) AtomError();
- if (MakeAtom("FULL_NAME", 9, 1) != XA_FULL_NAME) AtomError();
- if (MakeAtom("CAP_HEIGHT", 10, 1) != XA_CAP_HEIGHT) AtomError();
- if (MakeAtom("WM_CLASS", 8, 1) != XA_WM_CLASS) AtomError();
- if (MakeAtom("WM_TRANSIENT_FOR", 16, 1) != XA_WM_TRANSIENT_FOR) AtomError();
-}
diff --git a/dix/main.c b/dix/main.c
deleted file mode 100644
index 37add2a62..000000000
--- a/dix/main.c
+++ /dev/null
@@ -1,768 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.44 2003/11/17 22:20:34 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: main.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-/* $TOG: main.c /main/86 1998/02/09 14:20:03 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xos.h" /* for unistd.h */
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "extension.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "font.h"
-#include "opaque.h"
-#include "servermd.h"
-#include "site.h"
-#include "dixfont.h"
-#include "extnsionst.h"
-#ifdef PANORAMIX
-#include "panoramiXsrv.h"
-#else
-#include "dixevents.h" /* InitEvents() */
-#include "dispatch.h" /* InitProcVectors() */
-#endif
-
-#ifdef DPMSExtension
-#define DPMS_SERVER
-#include "dpms.h"
-#include "dpmsproc.h"
-#endif
-
-extern int InitClientPrivates(
- ClientPtr /*client*/
-);
-
-extern void Dispatch(
- void
-);
-
-char *ConnectionInfo;
-xConnSetupPrefix connSetupPrefix;
-
-extern FontPtr defaultFont;
-extern int screenPrivateCount;
-
-extern void InitProcVectors(void);
-extern Bool CreateGCperDepthArray(void);
-
-#ifndef PANORAMIX
-static
-#endif
-Bool CreateConnectionBlock(void);
-
-static void FreeScreen(ScreenPtr);
-
-PaddingInfo PixmapWidthPaddingInfo[33];
-
-int connBlockScreenStart;
-
-static int restart = 0;
-
-void
-NotImplemented(xEvent *from, xEvent *to)
-{
- FatalError("Not implemented");
-}
-
-/*
- * Dummy entry for ReplySwapVector[]
- */
-/*ARGSUSED*/
-void
-ReplyNotSwappd(
- ClientPtr pClient ,
- int size ,
- void * pbuf
- )
-{
- FatalError("Not implemented");
-}
-
-/*
- * This array encodes the answer to the question "what is the log base 2
- * of the number of pixels that fit in a scanline pad unit?"
- * Note that ~0 is an invalid entry (mostly for the benefit of the reader).
- */
-static int answer[6][4] = {
- /* pad pad pad pad*/
- /* 8 16 32 64 */
-
- { 3, 4, 5 , 6 }, /* 1 bit per pixel */
- { 1, 2, 3 , 4 }, /* 4 bits per pixel */
- { 0, 1, 2 , 3 }, /* 8 bits per pixel */
- { ~0, 0, 1 , 2 }, /* 16 bits per pixel */
- { ~0, ~0, 0 , 1 }, /* 24 bits per pixel */
- { ~0, ~0, 0 , 1 } /* 32 bits per pixel */
-};
-
-/*
- * This array gives the answer to the question "what is the first index for
- * the answer array above given the number of bits per pixel?"
- * Note that ~0 is an invalid entry (mostly for the benefit of the reader).
- */
-static int indexForBitsPerPixel[ 33 ] = {
- ~0, 0, ~0, ~0, /* 1 bit per pixel */
- 1, ~0, ~0, ~0, /* 4 bits per pixel */
- 2, ~0, ~0, ~0, /* 8 bits per pixel */
- ~0,~0, ~0, ~0,
- 3, ~0, ~0, ~0, /* 16 bits per pixel */
- ~0,~0, ~0, ~0,
- 4, ~0, ~0, ~0, /* 24 bits per pixel */
- ~0,~0, ~0, ~0,
- 5 /* 32 bits per pixel */
-};
-
-/*
- * This array gives the bytesperPixel value for cases where the number
- * of bits per pixel is a multiple of 8 but not a power of 2.
- */
-static int answerBytesPerPixel[ 33 ] = {
- ~0, 0, ~0, ~0, /* 1 bit per pixel */
- 0, ~0, ~0, ~0, /* 4 bits per pixel */
- 0, ~0, ~0, ~0, /* 8 bits per pixel */
- ~0,~0, ~0, ~0,
- 0, ~0, ~0, ~0, /* 16 bits per pixel */
- ~0,~0, ~0, ~0,
- 3, ~0, ~0, ~0, /* 24 bits per pixel */
- ~0,~0, ~0, ~0,
- 0 /* 32 bits per pixel */
-};
-
-/*
- * This array gives the answer to the question "what is the second index for
- * the answer array above given the number of bits per scanline pad unit?"
- * Note that ~0 is an invalid entry (mostly for the benefit of the reader).
- */
-static int indexForScanlinePad[ 65 ] = {
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- 0, ~0, ~0, ~0, /* 8 bits per scanline pad unit */
- ~0, ~0, ~0, ~0,
- 1, ~0, ~0, ~0, /* 16 bits per scanline pad unit */
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- 2, ~0, ~0, ~0, /* 32 bits per scanline pad unit */
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- ~0, ~0, ~0, ~0,
- 3 /* 64 bits per scanline pad unit */
-};
-
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
-int
-main(int argc, char *argv[], char *envp[])
-{
- int i, j, k, error;
- char *xauthfile;
- HWEventQueueType alwaysCheckForInput[2];
-
- display = "0";
-
- /* Quartz support on Mac OS X requires that the Cocoa event loop be in
- * the main thread. This allows the X server main to be called again
- * from another thread. */
-#if defined(__DARWIN__) && defined(DARWIN_WITH_QUARTZ)
- DarwinHandleGUI(argc, argv, envp);
-#endif
-
- /* Notice if we're restarted. Probably this is because we jumped through
- * an uninitialized pointer */
- if (restart)
- FatalError("server restarted. Jumped through uninitialized pointer?\n");
- else
- restart = 1;
-
- CheckUserParameters(argc, argv, envp);
-
- CheckUserAuthorization();
-
-#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
- ExpandCommandLine(&argc, &argv);
-#endif
-
- InitConnectionLimits();
-
- /* These are needed by some routines which are called from interrupt
- * handlers, thus have no direct calling path back to main and thus
- * can't be passed argc, argv as parameters */
- argcGlobal = argc;
- argvGlobal = argv;
- /* prep X authority file from environment; this can be overriden by a
- * command line option */
- xauthfile = getenv("XAUTHORITY");
- if (xauthfile) InitAuthorization (xauthfile);
- ProcessCommandLine(argc, argv);
-
- alwaysCheckForInput[0] = 0;
- alwaysCheckForInput[1] = 1;
- while(1)
- {
- serverGeneration++;
- ScreenSaverTime = defaultScreenSaverTime;
- ScreenSaverInterval = defaultScreenSaverInterval;
- ScreenSaverBlanking = defaultScreenSaverBlanking;
- ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
-#ifdef DPMSExtension
- DPMSStandbyTime = defaultDPMSStandbyTime;
- DPMSSuspendTime = defaultDPMSSuspendTime;
- DPMSOffTime = defaultDPMSOffTime;
- DPMSEnabled = defaultDPMSEnabled;
- DPMSPowerLevel = 0;
-#endif
- InitBlockAndWakeupHandlers();
- /* Perform any operating system dependent initializations you'd like */
- OsInit();
- if(serverGeneration == 1)
- {
- CreateWellKnownSockets();
- InitProcVectors();
- clients = (ClientPtr *)xalloc(MAXCLIENTS * sizeof(ClientPtr));
- if (!clients)
- FatalError("couldn't create client array");
- for (i=1; i<MAXCLIENTS; i++)
- clients[i] = NullClient;
- serverClient = (ClientPtr)xalloc(sizeof(ClientRec));
- if (!serverClient)
- FatalError("couldn't create server client");
- InitClient(serverClient, 0, (pointer)NULL);
- }
- else
- ResetWellKnownSockets ();
- clients[0] = serverClient;
- currentMaxClients = 1;
-
- if (!InitClientResources(serverClient)) /* for root resources */
- FatalError("couldn't init server resources");
-
- SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]);
- screenInfo.arraySize = MAXSCREENS;
- screenInfo.numScreens = 0;
- screenInfo.numVideoScreens = -1;
- WindowTable = (WindowPtr *)xalloc(MAXSCREENS * sizeof(WindowPtr));
- if (!WindowTable)
- FatalError("couldn't create root window table");
-
- /*
- * Just in case the ddx doesnt supply a format for depth 1 (like qvss).
- */
- j = indexForBitsPerPixel[ 1 ];
- k = indexForScanlinePad[ BITMAP_SCANLINE_PAD ];
- PixmapWidthPaddingInfo[1].padRoundUp = BITMAP_SCANLINE_PAD-1;
- PixmapWidthPaddingInfo[1].padPixelsLog2 = answer[j][k];
- j = indexForBitsPerPixel[8]; /* bits per byte */
- PixmapWidthPaddingInfo[1].padBytesLog2 = answer[j][k];
- PixmapWidthPaddingInfo[1].bitsPerPixel = 1;
-
- InitAtoms();
- InitEvents();
- InitGlyphCaching();
- ResetClientPrivates();
- ResetScreenPrivates();
- ResetWindowPrivates();
- ResetGCPrivates();
-#ifdef PIXPRIV
- ResetPixmapPrivates();
-#endif
- ResetColormapPrivates();
- ResetFontPrivateIndex();
- InitCallbackManager();
- InitVisualWrap();
- InitOutput(&screenInfo, argc, argv);
- if (screenInfo.numScreens < 1)
- FatalError("no screens found");
- if (screenInfo.numVideoScreens < 0)
- screenInfo.numVideoScreens = screenInfo.numScreens;
-#ifdef XPRINT
- PrinterInitOutput(&screenInfo, argc, argv);
-#endif
- InitExtensions(argc, argv);
- if (!InitClientPrivates(serverClient))
- FatalError("failed to allocate serverClient devprivates");
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ScreenPtr pScreen = screenInfo.screens[i];
- if (!CreateScratchPixmapsForScreen(i))
- FatalError("failed to create scratch pixmaps");
- if (pScreen->CreateScreenResources &&
- !(*pScreen->CreateScreenResources)(pScreen))
- FatalError("failed to create screen resources");
- if (!CreateGCperDepth(i))
- FatalError("failed to create scratch GCs");
- if (!CreateDefaultStipple(i))
- FatalError("failed to create default stipple");
- if (!CreateRootWindow(pScreen))
- FatalError("failed to create root window");
- }
- InitInput(argc, argv);
- if (InitAndStartDevices() != Success)
- FatalError("failed to initialize core devices");
-
- InitFonts();
- if (loadableFonts) {
- SetFontPath(0, 0, (unsigned char *)defaultFontPath, &error);
- } else {
- if (SetDefaultFontPath(defaultFontPath) != Success)
- ErrorF("failed to set default font path '%s'",
- defaultFontPath);
- }
- if (!SetDefaultFont(defaultTextFont))
- FatalError("could not open default font '%s'", defaultTextFont);
- if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0)))
- FatalError("could not open default cursor font '%s'",
- defaultCursorFont);
-#ifdef DPMSExtension
- /* check all screens, looking for DPMS Capabilities */
- DPMSCapableFlag = DPMSSupported();
- if (!DPMSCapableFlag)
- DPMSEnabled = FALSE;
-#endif
-
-#ifdef PANORAMIX
- /*
- * Consolidate window and colourmap information for each screen
- */
- if (!noPanoramiXExtension)
- PanoramiXConsolidate();
-#endif
-
- for (i = 0; i < screenInfo.numScreens; i++)
- InitRootWindow(WindowTable[i]);
- DefineInitialRootWindow(WindowTable[0]);
- SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
-#ifdef DPMSExtension
- SetDPMSTimers();
-#endif
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- if (!PanoramiXCreateConnectionBlock())
- FatalError("could not create connection block info");
- } else
-#endif
- {
- if (!CreateConnectionBlock())
- FatalError("could not create connection block info");
- }
-
- Dispatch();
-
- /* Now free up whatever must be freed */
- if (screenIsSaved == SCREEN_SAVER_ON)
- SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
- FreeScreenSaverTimer();
- CloseDownExtensions();
-
-#ifdef PANORAMIX
- {
- Bool remember_it = noPanoramiXExtension;
- noPanoramiXExtension = TRUE;
- FreeAllResources();
- noPanoramiXExtension = remember_it;
- }
-#else
- FreeAllResources();
-#endif
-
- CloseDownDevices();
- for (i = screenInfo.numScreens - 1; i >= 0; i--)
- {
- FreeScratchPixmapsForScreen(i);
- FreeGCperDepth(i);
- FreeDefaultStipple(i);
- (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]);
- FreeScreen(screenInfo.screens[i]);
- screenInfo.numScreens = i;
- }
- CloseDownEvents();
- xfree(WindowTable);
- WindowTable = NULL;
- FreeFonts();
-
-#ifdef DPMSExtension
- FreeDPMSTimers();
-#endif
- FreeAuditTimer();
-
- xfree(serverClient->devPrivates);
- serverClient->devPrivates = NULL;
-
- if (dispatchException & DE_TERMINATE)
- {
- CloseWellKnownConnections();
- }
-
- OsCleanup((dispatchException & DE_TERMINATE) != 0);
-
- if (dispatchException & DE_TERMINATE)
- {
- ddxGiveUp();
- break;
- }
-
- xfree(ConnectionInfo);
- ConnectionInfo = NULL;
- }
- return(0);
-}
-
-static int padlength[4] = {0, 3, 2, 1};
-
-#ifndef PANORAMIX
-static
-#endif
-Bool
-CreateConnectionBlock()
-{
- xConnSetup setup;
- xWindowRoot root;
- xDepth depth;
- xVisualType visual;
- xPixmapFormat format;
- unsigned long vid;
- int i, j, k,
- lenofblock,
- sizesofar = 0;
- char *pBuf;
-
-
- /* Leave off the ridBase and ridMask, these must be sent with
- connection */
-
- setup.release = VENDOR_RELEASE;
- /*
- * per-server image and bitmap parameters are defined in Xmd.h
- */
- setup.imageByteOrder = screenInfo.imageByteOrder;
-
- setup.bitmapScanlineUnit = screenInfo.bitmapScanlineUnit;
- setup.bitmapScanlinePad = screenInfo.bitmapScanlinePad;
-
- setup.bitmapBitOrder = screenInfo.bitmapBitOrder;
- setup.motionBufferSize = NumMotionEvents();
- setup.numRoots = screenInfo.numScreens;
- setup.nbytesVendor = strlen(VENDOR_STRING);
- setup.numFormats = screenInfo.numPixmapFormats;
- setup.maxRequestSize = MAX_REQUEST_SIZE;
- QueryMinMaxKeyCodes(&setup.minKeyCode, &setup.maxKeyCode);
-
- lenofblock = sizeof(xConnSetup) +
- ((setup.nbytesVendor + 3) & ~3) +
- (setup.numFormats * sizeof(xPixmapFormat)) +
- (setup.numRoots * sizeof(xWindowRoot));
- ConnectionInfo = (char *) xalloc(lenofblock);
- if (!ConnectionInfo)
- return FALSE;
-
- memmove(ConnectionInfo, (char *)&setup, sizeof(xConnSetup));
- sizesofar = sizeof(xConnSetup);
- pBuf = ConnectionInfo + sizeof(xConnSetup);
-
- memmove(pBuf, VENDOR_STRING, (int)setup.nbytesVendor);
- sizesofar += setup.nbytesVendor;
- pBuf += setup.nbytesVendor;
- i = padlength[setup.nbytesVendor & 3];
- sizesofar += i;
- while (--i >= 0)
- *pBuf++ = 0;
-
- for (i=0; i<screenInfo.numPixmapFormats; i++)
- {
- format.depth = screenInfo.formats[i].depth;
- format.bitsPerPixel = screenInfo.formats[i].bitsPerPixel;
- format.scanLinePad = screenInfo.formats[i].scanlinePad;
- memmove(pBuf, (char *)&format, sizeof(xPixmapFormat));
- pBuf += sizeof(xPixmapFormat);
- sizesofar += sizeof(xPixmapFormat);
- }
-
- connBlockScreenStart = sizesofar;
- for (i=0; i<screenInfo.numScreens; i++)
- {
- ScreenPtr pScreen;
- DepthPtr pDepth;
- VisualPtr pVisual;
-
- pScreen = screenInfo.screens[i];
- root.windowId = WindowTable[i]->drawable.id;
- root.defaultColormap = pScreen->defColormap;
- root.whitePixel = pScreen->whitePixel;
- root.blackPixel = pScreen->blackPixel;
- root.currentInputMask = 0; /* filled in when sent */
- root.pixWidth = pScreen->width;
- root.pixHeight = pScreen->height;
- root.mmWidth = pScreen->mmWidth;
- root.mmHeight = pScreen->mmHeight;
- root.minInstalledMaps = pScreen->minInstalledCmaps;
- root.maxInstalledMaps = pScreen->maxInstalledCmaps;
- root.rootVisualID = pScreen->rootVisual;
- root.backingStore = pScreen->backingStoreSupport;
- root.saveUnders = pScreen->saveUnderSupport != NotUseful;
- root.rootDepth = pScreen->rootDepth;
- root.nDepths = pScreen->numDepths;
- memmove(pBuf, (char *)&root, sizeof(xWindowRoot));
- sizesofar += sizeof(xWindowRoot);
- pBuf += sizeof(xWindowRoot);
-
- pDepth = pScreen->allowedDepths;
- for(j = 0; j < pScreen->numDepths; j++, pDepth++)
- {
- lenofblock += sizeof(xDepth) +
- (pDepth->numVids * sizeof(xVisualType));
- pBuf = (char *)xrealloc(ConnectionInfo, lenofblock);
- if (!pBuf)
- {
- xfree(ConnectionInfo);
- return FALSE;
- }
- ConnectionInfo = pBuf;
- pBuf += sizesofar;
- depth.depth = pDepth->depth;
- depth.nVisuals = pDepth->numVids;
- memmove(pBuf, (char *)&depth, sizeof(xDepth));
- pBuf += sizeof(xDepth);
- sizesofar += sizeof(xDepth);
- for(k = 0; k < pDepth->numVids; k++)
- {
- vid = pDepth->vids[k];
- for (pVisual = pScreen->visuals;
- pVisual->vid != vid;
- pVisual++)
- ;
- visual.visualID = vid;
- visual.class = pVisual->class;
- visual.bitsPerRGB = pVisual->bitsPerRGBValue;
- visual.colormapEntries = pVisual->ColormapEntries;
- visual.redMask = pVisual->redMask;
- visual.greenMask = pVisual->greenMask;
- visual.blueMask = pVisual->blueMask;
- memmove(pBuf, (char *)&visual, sizeof(xVisualType));
- pBuf += sizeof(xVisualType);
- sizesofar += sizeof(xVisualType);
- }
- }
- }
- connSetupPrefix.success = xTrue;
- connSetupPrefix.length = lenofblock/4;
- connSetupPrefix.majorVersion = X_PROTOCOL;
- connSetupPrefix.minorVersion = X_PROTOCOL_REVISION;
- return TRUE;
-}
-
-/*
- grow the array of screenRecs if necessary.
- call the device-supplied initialization procedure
-with its screen number, a pointer to its ScreenRec, argc, and argv.
- return the number of successfully installed screens.
-
-*/
-
-int
-AddScreen(
- Bool (* pfnInit)(
- int /*index*/,
- ScreenPtr /*pScreen*/,
- int /*argc*/,
- char ** /*argv*/
- ),
- int argc,
- char **argv)
-{
-
- int i;
- int scanlinepad, format, depth, bitsPerPixel, j, k;
- ScreenPtr pScreen;
-#ifdef DEBUG
- void (**jNI) ();
-#endif /* DEBUG */
-
- i = screenInfo.numScreens;
- if (i == MAXSCREENS)
- return -1;
-
- pScreen = (ScreenPtr) xalloc(sizeof(ScreenRec));
- if (!pScreen)
- return -1;
-
- pScreen->devPrivates = (DevUnion *)xcalloc(sizeof(DevUnion),
- screenPrivateCount);
- if (!pScreen->devPrivates && screenPrivateCount)
- {
- xfree(pScreen);
- return -1;
- }
- pScreen->myNum = i;
- pScreen->WindowPrivateLen = 0;
- pScreen->WindowPrivateSizes = (unsigned *)NULL;
- pScreen->totalWindowSize =
- ((sizeof(WindowRec) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
- pScreen->GCPrivateLen = 0;
- pScreen->GCPrivateSizes = (unsigned *)NULL;
- pScreen->totalGCSize =
- ((sizeof(GC) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
-#ifdef PIXPRIV
- pScreen->PixmapPrivateLen = 0;
- pScreen->PixmapPrivateSizes = (unsigned *)NULL;
- pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8);
-#endif
- pScreen->ClipNotify = 0; /* for R4 ddx compatibility */
- pScreen->CreateScreenResources = 0;
-
-#ifdef DEBUG
- for (jNI = &pScreen->QueryBestSize;
- jNI < (void (**) ()) &pScreen->SendGraphicsExpose;
- jNI++)
- *jNI = NotImplemented;
-#endif /* DEBUG */
-
- /*
- * This loop gets run once for every Screen that gets added,
- * but thats ok. If the ddx layer initializes the formats
- * one at a time calling AddScreen() after each, then each
- * iteration will make it a little more accurate. Worst case
- * we do this loop N * numPixmapFormats where N is # of screens.
- * Anyway, this must be called after InitOutput and before the
- * screen init routine is called.
- */
- for (format=0; format<screenInfo.numPixmapFormats; format++)
- {
- depth = screenInfo.formats[format].depth;
- bitsPerPixel = screenInfo.formats[format].bitsPerPixel;
- scanlinepad = screenInfo.formats[format].scanlinePad;
- j = indexForBitsPerPixel[ bitsPerPixel ];
- k = indexForScanlinePad[ scanlinepad ];
- PixmapWidthPaddingInfo[ depth ].padPixelsLog2 = answer[j][k];
- PixmapWidthPaddingInfo[ depth ].padRoundUp =
- (scanlinepad/bitsPerPixel) - 1;
- j = indexForBitsPerPixel[ 8 ]; /* bits per byte */
- PixmapWidthPaddingInfo[ depth ].padBytesLog2 = answer[j][k];
- PixmapWidthPaddingInfo[ depth ].bitsPerPixel = bitsPerPixel;
- if (answerBytesPerPixel[bitsPerPixel])
- {
- PixmapWidthPaddingInfo[ depth ].notPower2 = 1;
- PixmapWidthPaddingInfo[ depth ].bytesPerPixel =
- answerBytesPerPixel[bitsPerPixel];
- }
- else
- {
- PixmapWidthPaddingInfo[ depth ].notPower2 = 0;
- }
- }
-
- /* This is where screen specific stuff gets initialized. Load the
- screen structure, call the hardware, whatever.
- This is also where the default colormap should be allocated and
- also pixel values for blackPixel, whitePixel, and the cursor
- Note that InitScreen is NOT allowed to modify argc, argv, or
- any of the strings pointed to by argv. They may be passed to
- multiple screens.
- */
- pScreen->rgf = ~0L; /* there are no scratch GCs yet*/
- WindowTable[i] = NullWindow;
- screenInfo.screens[i] = pScreen;
- screenInfo.numScreens++;
- if (!(*pfnInit)(i, pScreen, argc, argv))
- {
- FreeScreen(pScreen);
- screenInfo.numScreens--;
- return -1;
- }
- return i;
-}
-
-static void
-FreeScreen(pScreen)
- ScreenPtr pScreen;
-{
- xfree(pScreen->WindowPrivateSizes);
- xfree(pScreen->GCPrivateSizes);
-#ifdef PIXPRIV
- xfree(pScreen->PixmapPrivateSizes);
-#endif
- xfree(pScreen->devPrivates);
- xfree(pScreen);
-}
diff --git a/dix/pixmap.c b/dix/pixmap.c
deleted file mode 100644
index fda07801c..000000000
--- a/dix/pixmap.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.5 2001/12/14 19:59:32 dawes Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "servermd.h"
-#include "site.h"
-
-
-/*
- * Scratch pixmap management and device independent pixmap allocation
- * function.
- */
-
-
-/* callable by ddx */
-PixmapPtr
-GetScratchPixmapHeader(pScreen, width, height, depth, bitsPerPixel, devKind,
- pPixData)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
- int bitsPerPixel;
- int devKind;
- pointer pPixData;
-{
- PixmapPtr pPixmap = pScreen->pScratchPixmap;
-
- if (pPixmap)
- pScreen->pScratchPixmap = NULL;
- else
- /* width and height of 0 means don't allocate any pixmap data */
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
-
- if (pPixmap) {
- if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
- bitsPerPixel, devKind, pPixData))
- return pPixmap;
- (*pScreen->DestroyPixmap)(pPixmap);
- }
- return NullPixmap;
-}
-
-
-/* callable by ddx */
-void
-FreeScratchPixmapHeader(pPixmap)
- PixmapPtr pPixmap;
-{
- if (pPixmap)
- {
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
-
- pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */
- if (pScreen->pScratchPixmap)
- (*pScreen->DestroyPixmap)(pPixmap);
- else
- pScreen->pScratchPixmap = pPixmap;
- }
-}
-
-
-Bool
-CreateScratchPixmapsForScreen(scrnum)
- int scrnum;
-{
- /* let it be created on first use */
- screenInfo.screens[scrnum]->pScratchPixmap = NULL;
- return TRUE;
-}
-
-
-void
-FreeScratchPixmapsForScreen(scrnum)
- int scrnum;
-{
- FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap);
-}
-
-
-/* callable by ddx */
-PixmapPtr
-AllocatePixmap(pScreen, pixDataSize)
- ScreenPtr pScreen;
- int pixDataSize;
-{
- PixmapPtr pPixmap;
-#ifdef PIXPRIV
- char *ptr;
- DevUnion *ppriv;
- unsigned *sizes;
- unsigned size;
- int i;
-
- pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize);
- if (!pPixmap)
- return NullPixmap;
- ppriv = (DevUnion *)(pPixmap + 1);
- pPixmap->devPrivates = ppriv;
- sizes = pScreen->PixmapPrivateSizes;
- ptr = (char *)(ppriv + pScreen->PixmapPrivateLen);
- for (i = pScreen->PixmapPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ((size = *sizes) != 0)
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
-#else
- pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
-#endif
- return pPixmap;
-}
diff --git a/dix/privates.c b/dix/privates.c
deleted file mode 100644
index 2d0885846..000000000
--- a/dix/privates.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* $Xorg: privates.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/dix/privates.c,v 3.8 2001/12/14 19:59:32 dawes Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "colormapst.h"
-#include "servermd.h"
-#include "site.h"
-
-/*
- * See the Wrappers and devPrivates section in "Definition of the
- * Porting Layer for the X v11 Sample Server" (doc/Server/ddx.tbl.ms)
- * for information on how to use devPrivates.
- */
-
-/*
- * client private machinery
- */
-
-static int clientPrivateCount;
-int clientPrivateLen;
-unsigned *clientPrivateSizes;
-unsigned totalClientSize;
-
-void
-ResetClientPrivates()
-{
- clientPrivateCount = 0;
- clientPrivateLen = 0;
- xfree(clientPrivateSizes);
- clientPrivateSizes = (unsigned *)NULL;
- totalClientSize =
- ((sizeof(ClientRec) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
-}
-
-int
-AllocateClientPrivateIndex()
-{
- return clientPrivateCount++;
-}
-
-Bool
-AllocateClientPrivate(index2, amount)
- int index2;
- unsigned amount;
-{
- unsigned oldamount;
-
- /* Round up sizes for proper alignment */
- amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long);
-
- if (index2 >= clientPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(clientPrivateSizes,
- (index2 + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (clientPrivateLen <= index2)
- {
- nsizes[clientPrivateLen++] = 0;
- totalClientSize += sizeof(DevUnion);
- }
- clientPrivateSizes = nsizes;
- }
- oldamount = clientPrivateSizes[index2];
- if (amount > oldamount)
- {
- clientPrivateSizes[index2] = amount;
- totalClientSize += (amount - oldamount);
- }
- return TRUE;
-}
-
-/*
- * screen private machinery
- */
-
-int screenPrivateCount;
-
-void
-ResetScreenPrivates()
-{
- screenPrivateCount = 0;
-}
-
-/* this can be called after some screens have been created,
- * so we have to worry about resizing existing devPrivates
- */
-int
-AllocateScreenPrivateIndex()
-{
- int idx;
- int i;
- ScreenPtr pScreen;
- DevUnion *nprivs;
-
- idx = screenPrivateCount++;
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- nprivs = (DevUnion *)xrealloc(pScreen->devPrivates,
- screenPrivateCount * sizeof(DevUnion));
- if (!nprivs)
- {
- screenPrivateCount--;
- return -1;
- }
- /* Zero the new private */
- bzero(&nprivs[idx], sizeof(DevUnion));
- pScreen->devPrivates = nprivs;
- }
- return idx;
-}
-
-
-/*
- * window private machinery
- */
-
-static int windowPrivateCount;
-
-void
-ResetWindowPrivates()
-{
- windowPrivateCount = 0;
-}
-
-int
-AllocateWindowPrivateIndex()
-{
- return windowPrivateCount++;
-}
-
-Bool
-AllocateWindowPrivate(pScreen, index2, amount)
- register ScreenPtr pScreen;
- int index2;
- unsigned amount;
-{
- unsigned oldamount;
-
- /* Round up sizes for proper alignment */
- amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long);
-
- if (index2 >= pScreen->WindowPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->WindowPrivateSizes,
- (index2 + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (pScreen->WindowPrivateLen <= index2)
- {
- nsizes[pScreen->WindowPrivateLen++] = 0;
- pScreen->totalWindowSize += sizeof(DevUnion);
- }
- pScreen->WindowPrivateSizes = nsizes;
- }
- oldamount = pScreen->WindowPrivateSizes[index2];
- if (amount > oldamount)
- {
- pScreen->WindowPrivateSizes[index2] = amount;
- pScreen->totalWindowSize += (amount - oldamount);
- }
- return TRUE;
-}
-
-
-/*
- * gc private machinery
- */
-
-static int gcPrivateCount;
-
-void
-ResetGCPrivates()
-{
- gcPrivateCount = 0;
-}
-
-int
-AllocateGCPrivateIndex()
-{
- return gcPrivateCount++;
-}
-
-Bool
-AllocateGCPrivate(pScreen, index2, amount)
- register ScreenPtr pScreen;
- int index2;
- unsigned amount;
-{
- unsigned oldamount;
-
- /* Round up sizes for proper alignment */
- amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long);
-
- if (index2 >= pScreen->GCPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->GCPrivateSizes,
- (index2 + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (pScreen->GCPrivateLen <= index2)
- {
- nsizes[pScreen->GCPrivateLen++] = 0;
- pScreen->totalGCSize += sizeof(DevUnion);
- }
- pScreen->GCPrivateSizes = nsizes;
- }
- oldamount = pScreen->GCPrivateSizes[index2];
- if (amount > oldamount)
- {
- pScreen->GCPrivateSizes[index2] = amount;
- pScreen->totalGCSize += (amount - oldamount);
- }
- return TRUE;
-}
-
-
-/*
- * pixmap private machinery
- */
-#ifdef PIXPRIV
-static int pixmapPrivateCount;
-
-void
-ResetPixmapPrivates()
-{
- pixmapPrivateCount = 0;
-}
-
-int
-AllocatePixmapPrivateIndex()
-{
- return pixmapPrivateCount++;
-}
-
-Bool
-AllocatePixmapPrivate(pScreen, index2, amount)
- register ScreenPtr pScreen;
- int index2;
- unsigned amount;
-{
- unsigned oldamount;
-
- /* Round up sizes for proper alignment */
- amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long);
-
- if (index2 >= pScreen->PixmapPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->PixmapPrivateSizes,
- (index2 + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (pScreen->PixmapPrivateLen <= index2)
- {
- nsizes[pScreen->PixmapPrivateLen++] = 0;
- pScreen->totalPixmapSize += sizeof(DevUnion);
- }
- pScreen->PixmapPrivateSizes = nsizes;
- }
- oldamount = pScreen->PixmapPrivateSizes[index2];
- if (amount > oldamount)
- {
- pScreen->PixmapPrivateSizes[index2] = amount;
- pScreen->totalPixmapSize += (amount - oldamount);
- }
- pScreen->totalPixmapSize = BitmapBytePad(pScreen->totalPixmapSize * 8);
- return TRUE;
-}
-#endif
-
-
-/*
- * colormap private machinery
- */
-
-int colormapPrivateCount;
-
-void
-ResetColormapPrivates()
-{
- colormapPrivateCount = 0;
-}
-
-
-int
-AllocateColormapPrivateIndex (initPrivFunc)
-
-InitCmapPrivFunc initPrivFunc;
-
-{
- int index;
- int i;
- ColormapPtr pColormap;
- DevUnion *privs;
-
- index = colormapPrivateCount++;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- /*
- * AllocateColormapPrivateIndex may be called after the
- * default colormap has been created on each screen!
- *
- * We must resize the devPrivates array for the default
- * colormap on each screen, making room for this new private.
- * We also call the initialization function 'initPrivFunc' on
- * the new private allocated for each default colormap.
- */
-
- ScreenPtr pScreen = screenInfo.screens[i];
-
- pColormap = (ColormapPtr) LookupIDByType (
- pScreen->defColormap, RT_COLORMAP);
-
- if (pColormap)
- {
- privs = (DevUnion *) xrealloc (pColormap->devPrivates,
- colormapPrivateCount * sizeof(DevUnion));
-
- pColormap->devPrivates = privs;
-
- if (!privs || !(*initPrivFunc)(pColormap))
- {
- colormapPrivateCount--;
- return -1;
- }
- }
- }
-
- return index;
-}
diff --git a/dix/property.c b/dix/property.c
deleted file mode 100644
index 1af6156b5..000000000
--- a/dix/property.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.13 2003/07/16 01:38:37 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "dixstruct.h"
-#include "dispatch.h"
-#include "swaprep.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-#ifdef LBX
-#include "lbxserve.h"
-#include "lbxtags.h"
-#endif
-
-#if defined(LBX) || defined(LBX_COMPAT)
-#if 0 /* no header in X11 environment, not used in X11 environment */
-int fWriteToClient(ClientPtr client, int len, char *buf)
-{
- return WriteToClient(client, len, buf);
-}
-#endif
-#endif
-
-/*****************************************************************
- * Property Stuff
- *
- * ChangeProperty, DeleteProperty, GetProperties,
- * ListProperties
- *
- * Properties below to windows. A allocate slots each time
- * a property is added. No fancy searching done.
- *
- *****************************************************************/
-
-#ifdef notdef
-static void
-PrintPropertys(pWin)
- WindowPtr pWin;
-{
- PropertyPtr pProp;
- register int j;
-
- pProp = pWin->userProps;
- while (pProp)
- {
- ErrorF( "%x %x\n", pProp->propertyName, pProp->type);
- ErrorF("property format: %d\n", pProp->format);
- ErrorF("property data: \n");
- for (j=0; j<(pProp->format/8)*pProp->size; j++)
- ErrorF("%c\n", pProp->data[j]);
- pProp = pProp->next;
- }
-}
-#endif
-
-int
-ProcRotateProperties(client)
- ClientPtr client;
-{
- int i, j, delta;
- REQUEST(xRotatePropertiesReq);
- WindowPtr pWin;
- register Atom * atoms;
- PropertyPtr * props; /* array of pointer */
- PropertyPtr pProp;
- xEvent event;
-
- REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2);
- UpdateCurrentTime();
- pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (!stuff->nAtoms)
- return(Success);
- atoms = (Atom *) & stuff[1];
- props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr));
- if (!props)
- return(BadAlloc);
- for (i = 0; i < stuff->nAtoms; i++)
- {
-#ifdef XCSECURITY
- char action = SecurityCheckPropertyAccess(client, pWin, atoms[i],
- SecurityReadAccess|SecurityWriteAccess);
-#endif
- if (!ValidAtom(atoms[i])
-#ifdef XCSECURITY
- || (SecurityErrorOperation == action)
-#endif
- )
- {
- DEALLOCATE_LOCAL(props);
- client->errorValue = atoms[i];
- return BadAtom;
- }
-#ifdef XCSECURITY
- if (SecurityIgnoreOperation == action)
- {
- DEALLOCATE_LOCAL(props);
- return Success;
- }
-#endif
- for (j = i + 1; j < stuff->nAtoms; j++)
- if (atoms[j] == atoms[i])
- {
- DEALLOCATE_LOCAL(props);
- return BadMatch;
- }
- pProp = wUserProps (pWin);
- while (pProp)
- {
- if (pProp->propertyName == atoms[i])
- goto found;
- pProp = pProp->next;
- }
- DEALLOCATE_LOCAL(props);
- return BadMatch;
-found:
- props[i] = pProp;
- }
- delta = stuff->nPositions;
-
- /* If the rotation is a complete 360 degrees, then moving the properties
- around and generating PropertyNotify events should be skipped. */
-
- if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 )
- {
- while (delta < 0) /* faster if abs value is small */
- delta += stuff->nAtoms;
- for (i = 0; i < stuff->nAtoms; i++)
- {
- /* Generate a PropertyNotify event for each property whose value
- is changed in the order in which they appear in the request. */
-
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyNewValue;
- event.u.property.atom = props[i]->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
-
- props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms];
- }
- }
- DEALLOCATE_LOCAL(props);
- return Success;
-}
-
-int
-ProcChangeProperty(client)
- ClientPtr client;
-{
- WindowPtr pWin;
- char format, mode;
- unsigned long len;
- int sizeInBytes;
- int totalSize;
- int err;
- REQUEST(xChangePropertyReq);
-
- REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
- UpdateCurrentTime();
- format = stuff->format;
- mode = stuff->mode;
- if ((mode != PropModeReplace) && (mode != PropModeAppend) &&
- (mode != PropModePrepend))
- {
- client->errorValue = mode;
- return BadValue;
- }
- if ((format != 8) && (format != 16) && (format != 32))
- {
- client->errorValue = format;
- return BadValue;
- }
- len = stuff->nUnits;
- if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2))
- return BadLength;
- sizeInBytes = format>>3;
- totalSize = len * sizeInBytes;
- REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
-
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return(BadAtom);
- }
- if (!ValidAtom(stuff->type))
- {
- client->errorValue = stuff->type;
- return(BadAtom);
- }
-
-#ifdef XCSECURITY
- switch (SecurityCheckPropertyAccess(client, pWin, stuff->property,
- SecurityWriteAccess))
- {
- case SecurityErrorOperation:
- client->errorValue = stuff->property;
- return BadAtom;
- case SecurityIgnoreOperation:
- return Success;
- }
-#endif
-
-#ifdef LBX
- err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type,
- (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL);
-#else
- err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
- (int)mode, len, (pointer)&stuff[1], TRUE);
-#endif
- if (err != Success)
- return err;
- else
- return client->noClientException;
-}
-
-int
-ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent)
- WindowPtr pWin;
- Atom property, type;
- int format, mode;
- unsigned long len;
- pointer value;
- Bool sendevent;
-{
-#ifdef LBX
- return LbxChangeWindowProperty(NULL, pWin, property, type,
- format, mode, len, TRUE, value,
- sendevent, NULL);
-#else
- PropertyPtr pProp;
- xEvent event;
- int sizeInBytes;
- int totalSize;
- pointer data;
-
- sizeInBytes = format>>3;
- totalSize = len * sizeInBytes;
-
- /* first see if property already exists */
-
- pProp = wUserProps (pWin);
- while (pProp)
- {
- if (pProp->propertyName == property)
- break;
- pProp = pProp->next;
- }
- if (!pProp) /* just add to list */
- {
- if (!pWin->optional && !MakeWindowOptional (pWin))
- return(BadAlloc);
- pProp = (PropertyPtr)xalloc(sizeof(PropertyRec));
- if (!pProp)
- return(BadAlloc);
- data = (pointer)xalloc(totalSize);
- if (!data && len)
- {
- xfree(pProp);
- return(BadAlloc);
- }
- pProp->propertyName = property;
- pProp->type = type;
- pProp->format = format;
- pProp->data = data;
- if (len)
- memmove((char *)data, (char *)value, totalSize);
- pProp->size = len;
- pProp->next = pWin->optional->userProps;
- pWin->optional->userProps = pProp;
- }
- else
- {
- /* To append or prepend to a property the request format and type
- must match those of the already defined property. The
- existing format and type are irrelevant when using the mode
- "PropModeReplace" since they will be written over. */
-
- if ((format != pProp->format) && (mode != PropModeReplace))
- return(BadMatch);
- if ((pProp->type != type) && (mode != PropModeReplace))
- return(BadMatch);
- if (mode == PropModeReplace)
- {
- if (totalSize != pProp->size * (pProp->format >> 3))
- {
- data = (pointer)xrealloc(pProp->data, totalSize);
- if (!data && len)
- return(BadAlloc);
- pProp->data = data;
- }
- if (len)
- memmove((char *)pProp->data, (char *)value, totalSize);
- pProp->size = len;
- pProp->type = type;
- pProp->format = format;
- }
- else if (len == 0)
- {
- /* do nothing */
- }
- else if (mode == PropModeAppend)
- {
- data = (pointer)xrealloc(pProp->data,
- sizeInBytes * (len + pProp->size));
- if (!data)
- return(BadAlloc);
- pProp->data = data;
- memmove(&((char *)data)[pProp->size * sizeInBytes],
- (char *)value,
- totalSize);
- pProp->size += len;
- }
- else if (mode == PropModePrepend)
- {
- data = (pointer)xalloc(sizeInBytes * (len + pProp->size));
- if (!data)
- return(BadAlloc);
- memmove(&((char *)data)[totalSize], (char *)pProp->data,
- (int)(pProp->size * sizeInBytes));
- memmove((char *)data, (char *)value, totalSize);
- xfree(pProp->data);
- pProp->data = data;
- pProp->size += len;
- }
- }
- if (sendevent)
- {
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyNewValue;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- }
- return(Success);
-#endif
-}
-
-int
-DeleteProperty(pWin, propName)
- WindowPtr pWin;
- Atom propName;
-{
- PropertyPtr pProp, prevProp;
- xEvent event;
-
- if (!(pProp = wUserProps (pWin)))
- return(Success);
- prevProp = (PropertyPtr)NULL;
- while (pProp)
- {
- if (pProp->propertyName == propName)
- break;
- prevProp = pProp;
- pProp = pProp->next;
- }
- if (pProp)
- {
- if (prevProp == (PropertyPtr)NULL) /* takes care of head */
- {
- if (!(pWin->optional->userProps = pProp->next))
- CheckWindowOptionalNeed (pWin);
- }
- else
- {
- prevProp->next = pProp->next;
- }
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- xfree(pProp->data);
- xfree(pProp);
- }
- return(Success);
-}
-
-void
-DeleteAllWindowProperties(pWin)
- WindowPtr pWin;
-{
- PropertyPtr pProp, pNextProp;
- xEvent event;
-
- pProp = wUserProps (pWin);
- while (pProp)
- {
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- pNextProp = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
- pProp = pNextProp;
- }
-}
-
-static int
-NullPropertyReply(
- ClientPtr client,
- ATOM propertyType,
- int format,
- xGetPropertyReply *reply)
-{
- reply->nItems = 0;
- reply->length = 0;
- reply->bytesAfter = 0;
- reply->propertyType = propertyType;
- reply->format = format;
- WriteReplyToClient(client, sizeof(xGenericReply), reply);
- return(client->noClientException);
-}
-
-/*****************
- * GetProperty
- * If type Any is specified, returns the property from the specified
- * window regardless of its type. If a type is specified, returns the
- * property only if its type equals the specified type.
- * If delete is True and a property is returned, the property is also
- * deleted from the window and a PropertyNotify event is generated on the
- * window.
- *****************/
-
-int
-ProcGetProperty(client)
- ClientPtr client;
-{
- PropertyPtr pProp, prevProp;
- unsigned long n, len, ind;
- WindowPtr pWin;
- xGetPropertyReply reply;
- REQUEST(xGetPropertyReq);
-
- REQUEST_SIZE_MATCH(xGetPropertyReq);
- if (stuff->delete)
- UpdateCurrentTime();
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return BadWindow;
-
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return(BadAtom);
- }
- if ((stuff->delete != xTrue) && (stuff->delete != xFalse))
- {
- client->errorValue = stuff->delete;
- return(BadValue);
- }
- if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type))
- {
- client->errorValue = stuff->type;
- return(BadAtom);
- }
-
- pProp = wUserProps (pWin);
- prevProp = (PropertyPtr)NULL;
- while (pProp)
- {
- if (pProp->propertyName == stuff->property)
- break;
- prevProp = pProp;
- pProp = pProp->next;
- }
-
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- if (!pProp)
- return NullPropertyReply(client, None, 0, &reply);
-
-#ifdef XCSECURITY
- {
- Mask access_mode = SecurityReadAccess;
-
- if (stuff->delete)
- access_mode |= SecurityDestroyAccess;
- switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
- access_mode))
- {
- case SecurityErrorOperation:
- client->errorValue = stuff->property;
- return BadAtom;;
- case SecurityIgnoreOperation:
- return NullPropertyReply(client, pProp->type, pProp->format,
- &reply);
- }
- }
-#endif
- /* If the request type and actual type don't match. Return the
- property information, but not the data. */
-
- if (((stuff->type != pProp->type) &&
- (stuff->type != AnyPropertyType))
- )
- {
- reply.bytesAfter = pProp->size;
- reply.format = pProp->format;
- reply.length = 0;
- reply.nItems = 0;
- reply.propertyType = pProp->type;
- WriteReplyToClient(client, sizeof(xGenericReply), &reply);
- return(Success);
- }
-#ifdef LBX
- /* make sure we have the current value */
- if (pProp->tag_id && pProp->owner_pid) {
- LbxStallPropRequest(client, pProp);
- return client->noClientException;
- }
-#endif
-
-/*
- * Return type, format, value to client
- */
- n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
- ind = stuff->longOffset << 2;
-
- /* If longOffset is invalid such that it causes "len" to
- be negative, it's a value error. */
-
- if (n < ind)
- {
- client->errorValue = stuff->longOffset;
- return BadValue;
- }
-
- len = min(n - ind, 4 * stuff->longLength);
-
- reply.bytesAfter = n - (ind + len);
- reply.format = pProp->format;
- reply.length = (len + 3) >> 2;
- reply.nItems = len / (pProp->format / 8 );
- reply.propertyType = pProp->type;
-
- if (stuff->delete && (reply.bytesAfter == 0))
- { /* send the event */
- xEvent event;
-
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- }
-
- WriteReplyToClient(client, sizeof(xGenericReply), &reply);
- if (len)
- {
- switch (reply.format) {
- case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break;
- case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break;
- default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break;
- }
- WriteSwappedDataToClient(client, len,
- (char *)pProp->data + ind);
- }
-
- if (stuff->delete && (reply.bytesAfter == 0))
- { /* delete the Property */
-#ifdef LBX
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
-#endif
- if (prevProp == (PropertyPtr)NULL) /* takes care of head */
- {
- if (!(pWin->optional->userProps = pProp->next))
- CheckWindowOptionalNeed (pWin);
- }
- else
- prevProp->next = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
- }
- return(client->noClientException);
-}
-
-int
-ProcListProperties(client)
- ClientPtr client;
-{
- Atom *pAtoms = NULL, *temppAtoms;
- xListPropertiesReply xlpr;
- int numProps = 0;
- WindowPtr pWin;
- PropertyPtr pProp;
- REQUEST(xResourceReq);
-
- REQUEST_SIZE_MATCH(xResourceReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
-
- pProp = wUserProps (pWin);
- while (pProp)
- {
- pProp = pProp->next;
- numProps++;
- }
- if (numProps)
- if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom))))
- return(BadAlloc);
-
- xlpr.type = X_Reply;
- xlpr.nProperties = numProps;
- xlpr.length = (numProps * sizeof(Atom)) >> 2;
- xlpr.sequenceNumber = client->sequence;
- pProp = wUserProps (pWin);
- temppAtoms = pAtoms;
- while (pProp)
- {
- *temppAtoms++ = pProp->propertyName;
- pProp = pProp->next;
- }
- WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
- if (numProps)
- {
- client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
- WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- DEALLOCATE_LOCAL(pAtoms);
- }
- return(client->noClientException);
-}
-
-int
-ProcDeleteProperty(client)
- register ClientPtr client;
-{
- WindowPtr pWin;
- REQUEST(xDeletePropertyReq);
- int result;
-
- REQUEST_SIZE_MATCH(xDeletePropertyReq);
- UpdateCurrentTime();
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return(BadWindow);
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return (BadAtom);
- }
-
-#ifdef XCSECURITY
- switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
- SecurityDestroyAccess))
- {
- case SecurityErrorOperation:
- client->errorValue = stuff->property;
- return BadAtom;;
- case SecurityIgnoreOperation:
- return Success;
- }
-#endif
-
- result = DeleteProperty(pWin, stuff->property);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
diff --git a/dix/resource.c b/dix/resource.c
deleted file mode 100644
index d885c03ef..000000000
--- a/dix/resource.c
+++ /dev/null
@@ -1,962 +0,0 @@
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
-
-
-/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */
-
-/* Routines to manage various kinds of resources:
- *
- * CreateNewResourceType, CreateNewResourceClass, InitClientResources,
- * FakeClientID, AddResource, FreeResource, FreeClientResources,
- * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange
- */
-
-/*
- * A resource ID is a 32 bit quantity, the upper 2 bits of which are
- * off-limits for client-visible resources. The next 8 bits are
- * used as client ID, and the low 22 bits come from the client.
- * A resource ID is "hashed" by extracting and xoring subfields
- * (varying with the size of the hash table).
- *
- * It is sometimes necessary for the server to create an ID that looks
- * like it belongs to a client. This ID, however, must not be one
- * the client actually can create, or we have the potential for conflict.
- * The 31st bit of the ID is reserved for the server's use for this
- * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to
- * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a
- * resource "owned" by the client.
- */
-/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "misc.h"
-#include "os.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "opaque.h"
-#include "windowstr.h"
-#include "dixfont.h"
-#include "colormap.h"
-#include "inputstr.h"
-#include "dixevents.h"
-#include "dixgrabs.h"
-#include "cursor.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-#include <assert.h>
-
-static void RebuildTable(
- int /*client*/
-);
-
-#define SERVER_MINID 32
-
-#define INITBUCKETS 64
-#define INITHASHSIZE 6
-#define MAXHASHSIZE 11
-
-typedef struct _Resource {
- struct _Resource *next;
- XID id;
- RESTYPE type;
- pointer value;
-} ResourceRec, *ResourcePtr;
-#define NullResource ((ResourcePtr)NULL)
-
-typedef struct _ClientResource {
- ResourcePtr *resources;
- int elements;
- int buckets;
- int hashsize; /* log(2)(buckets) */
- XID fakeID;
- XID endFakeID;
- XID expectID;
-} ClientResourceRec;
-
-RESTYPE lastResourceType;
-static RESTYPE lastResourceClass;
-RESTYPE TypeMask;
-
-static DeleteType *DeleteFuncs = (DeleteType *)NULL;
-
-#ifdef XResExtension
-
-Atom * ResourceNames = NULL;
-
-void RegisterResourceName (RESTYPE type, char *name)
-{
- ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE);
-}
-
-#endif
-
-RESTYPE
-CreateNewResourceType(deleteFunc)
- DeleteType deleteFunc;
-{
- RESTYPE next = lastResourceType + 1;
- DeleteType *funcs;
-
- if (next & lastResourceClass)
- return 0;
- funcs = (DeleteType *)xrealloc(DeleteFuncs,
- (next + 1) * sizeof(DeleteType));
- if (!funcs)
- return 0;
-
-#ifdef XResExtension
- {
- Atom *newnames;
- newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom));
- if(!newnames)
- return 0;
- ResourceNames = newnames;
- ResourceNames[next] = 0;
- }
-#endif
-
- lastResourceType = next;
- DeleteFuncs = funcs;
- DeleteFuncs[next] = deleteFunc;
- return next;
-}
-
-RESTYPE
-CreateNewResourceClass()
-{
- RESTYPE next = lastResourceClass >> 1;
-
- if (next & lastResourceType)
- return 0;
- lastResourceClass = next;
- TypeMask = next - 1;
- return next;
-}
-
-ClientResourceRec clientTable[MAXCLIENTS];
-
-/*****************
- * InitClientResources
- * When a new client is created, call this to allocate space
- * in resource table
- *****************/
-
-Bool
-InitClientResources(client)
- ClientPtr client;
-{
- register int i, j;
-
- if (client == serverClient)
- {
- lastResourceType = RT_LASTPREDEF;
- lastResourceClass = RC_LASTPREDEF;
- TypeMask = RC_LASTPREDEF - 1;
- if (DeleteFuncs)
- xfree(DeleteFuncs);
- DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) *
- sizeof(DeleteType));
- if (!DeleteFuncs)
- return FALSE;
- DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA;
- DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow;
- DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap;
- DeleteFuncs[RT_GC & TypeMask] = FreeGC;
- DeleteFuncs[RT_FONT & TypeMask] = CloseFont;
- DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor;
- DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap;
- DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels;
- DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone;
- DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab;
-
-#ifdef XResExtension
- if(ResourceNames)
- xfree(ResourceNames);
- ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom));
- if(!ResourceNames)
- return FALSE;
-#endif
- }
- clientTable[i = client->index].resources =
- (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr));
- if (!clientTable[i].resources)
- return FALSE;
- clientTable[i].buckets = INITBUCKETS;
- clientTable[i].elements = 0;
- clientTable[i].hashsize = INITHASHSIZE;
- /* Many IDs allocated from the server client are visible to clients,
- * so we don't use the SERVER_BIT for them, but we have to start
- * past the magic value constants used in the protocol. For normal
- * clients, we can start from zero, with SERVER_BIT set.
- */
- clientTable[i].fakeID = client->clientAsMask |
- (client->index ? SERVER_BIT : SERVER_MINID);
- clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1;
- clientTable[i].expectID = client->clientAsMask;
- for (j=0; j<INITBUCKETS; j++)
- {
- clientTable[i].resources[j] = NullResource;
- }
- return TRUE;
-}
-
-
-static int
-Hash(int client, register XID id)
-{
- id &= RESOURCE_ID_MASK;
- switch (clientTable[client].hashsize)
- {
- case 6:
- return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12))));
- case 7:
- return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13))));
- case 8:
- return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16))));
- case 9:
- return ((int)(0x1FF & (id ^ (id>>9))));
- case 10:
- return ((int)(0x3FF & (id ^ (id>>10))));
- case 11:
- return ((int)(0x7FF & (id ^ (id>>11))));
- }
- return -1;
-}
-
-static XID
-AvailableID(
- register int client,
- register XID id,
- register XID maxid,
- register XID goodid)
-{
- register ResourcePtr res;
-
- if ((goodid >= id) && (goodid <= maxid))
- return goodid;
- for (; id <= maxid; id++)
- {
- res = clientTable[client].resources[Hash(client, id)];
- while (res && (res->id != id))
- res = res->next;
- if (!res)
- return id;
- }
- return 0;
-}
-
-void
-GetXIDRange(client, server, minp, maxp)
- int client;
- Bool server;
- XID *minp, *maxp;
-{
- register XID id, maxid;
- register ResourcePtr *resp;
- register ResourcePtr res;
- register int i;
- XID goodid;
-
- id = (Mask)client << CLIENTOFFSET;
- if (server)
- id |= client ? SERVER_BIT : SERVER_MINID;
- maxid = id | RESOURCE_ID_MASK;
- goodid = 0;
- for (resp = clientTable[client].resources, i = clientTable[client].buckets;
- --i >= 0;)
- {
- for (res = *resp++; res; res = res->next)
- {
- if ((res->id < id) || (res->id > maxid))
- continue;
- if (((res->id - id) >= (maxid - res->id)) ?
- (goodid = AvailableID(client, id, res->id - 1, goodid)) :
- !(goodid = AvailableID(client, res->id + 1, maxid, goodid)))
- maxid = res->id - 1;
- else
- id = res->id + 1;
- }
- }
- if (id > maxid)
- id = maxid = 0;
- *minp = id;
- *maxp = maxid;
-}
-
-/* GetXIDList is called by the XC-MISC extension's MiscGetXIDList function.
- * This function tries to find count unused XIDs for the given client. It
- * puts the IDs in the array pids and returns the number found, which should
- * almost always be the number requested.
- *
- * The circumstances that lead to a call to this function are very rare.
- * Xlib must run out of IDs while trying to generate a request that wants
- * multiple ID's, like the Multi-buffering CreateImageBuffers request.
- *
- * No rocket science in the implementation; just iterate over all
- * possible IDs for the given client and pick the first count IDs
- * that aren't in use. A more efficient algorithm could probably be
- * invented, but this will be used so rarely that this should suffice.
- */
-
-unsigned int
-GetXIDList(pClient, count, pids)
- ClientPtr pClient;
- unsigned int count;
- XID *pids;
-{
- unsigned int found = 0;
- XID id = pClient->clientAsMask;
- XID maxid;
-
- maxid = id | RESOURCE_ID_MASK;
- while ( (found < count) && (id <= maxid) )
- {
- if (!LookupIDByClass(id, RC_ANY))
- {
- pids[found++] = id;
- }
- id++;
- }
- return found;
-}
-
-/*
- * Return the next usable fake client ID.
- *
- * Normally this is just the next one in line, but if we've used the last
- * in the range, we need to find a new range of safe IDs to avoid
- * over-running another client.
- */
-
-XID
-FakeClientID(client)
- register int client;
-{
- XID id, maxid;
-
- id = clientTable[client].fakeID++;
- if (id != clientTable[client].endFakeID)
- return id;
- GetXIDRange(client, TRUE, &id, &maxid);
- if (!id) {
- if (!client)
- FatalError("FakeClientID: server internal ids exhausted\n");
- MarkClientException(clients[client]);
- id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3);
- maxid = id | RESOURCE_ID_MASK;
- }
- clientTable[client].fakeID = id + 1;
- clientTable[client].endFakeID = maxid + 1;
- return id;
-}
-
-Bool
-AddResource(id, type, value)
- XID id;
- RESTYPE type;
- pointer value;
-{
- int client;
- register ClientResourceRec *rrec;
- register ResourcePtr res, *head;
-
- client = CLIENT_ID(id);
- rrec = &clientTable[client];
- if (!rrec->buckets)
- {
- ErrorF("AddResource(%lx, %lx, %lx), client=%d \n",
- (unsigned long)id, type, (unsigned long)value, client);
- FatalError("client not in use\n");
- }
- if ((rrec->elements >= 4*rrec->buckets) &&
- (rrec->hashsize < MAXHASHSIZE))
- RebuildTable(client);
- head = &rrec->resources[Hash(client, id)];
- res = (ResourcePtr)xalloc(sizeof(ResourceRec));
- if (!res)
- {
- (*DeleteFuncs[type & TypeMask])(value, id);
- return FALSE;
- }
- res->next = *head;
- res->id = id;
- res->type = type;
- res->value = value;
- *head = res;
- rrec->elements++;
- if (!(id & SERVER_BIT) && (id >= rrec->expectID))
- rrec->expectID = id + 1;
- return TRUE;
-}
-
-static void
-RebuildTable(client)
- int client;
-{
- register int j;
- register ResourcePtr res, next;
- ResourcePtr **tails, *resources;
- register ResourcePtr **tptr, *rptr;
-
- /*
- * For now, preserve insertion order, since some ddx layers depend
- * on resources being free in the opposite order they are added.
- */
-
- j = 2 * clientTable[client].buckets;
- tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *));
- if (!tails)
- return;
- resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr));
- if (!resources)
- {
- DEALLOCATE_LOCAL(tails);
- return;
- }
- for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
- {
- *rptr = NullResource;
- *tptr = rptr;
- }
- clientTable[client].hashsize++;
- for (j = clientTable[client].buckets,
- rptr = clientTable[client].resources;
- --j >= 0;
- rptr++)
- {
- for (res = *rptr; res; res = next)
- {
- next = res->next;
- res->next = NullResource;
- tptr = &tails[Hash(client, res->id)];
- **tptr = res;
- *tptr = &res->next;
- }
- }
- DEALLOCATE_LOCAL(tails);
- clientTable[client].buckets *= 2;
- xfree(clientTable[client].resources);
- clientTable[client].resources = resources;
-}
-
-void
-FreeResource(id, skipDeleteFuncType)
- XID id;
- RESTYPE skipDeleteFuncType;
-{
- int cid;
- register ResourcePtr res;
- register ResourcePtr *prev, *head;
- register int *eltptr;
- int elements;
- Bool gotOne = FALSE;
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
- {
- head = &clientTable[cid].resources[Hash(cid, id)];
- eltptr = &clientTable[cid].elements;
-
- prev = head;
- while ( (res = *prev) )
- {
- if (res->id == id)
- {
- RESTYPE rtype = res->type;
- *prev = res->next;
- elements = --*eltptr;
- if (rtype & RC_CACHED)
- FlushClientCaches(res->id);
- if (rtype != skipDeleteFuncType)
- (*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
- xfree(res);
- if (*eltptr != elements)
- prev = head; /* prev may no longer be valid */
- gotOne = TRUE;
- }
- else
- prev = &res->next;
- }
- if(clients[cid] && (id == clients[cid]->lastDrawableID))
- {
- clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0];
- clients[cid]->lastDrawableID = WindowTable[0]->drawable.id;
- }
- }
- if (!gotOne)
- FatalError("Freeing resource id=%lX which isn't there",
- (unsigned long)id);
-}
-
-
-void
-FreeResourceByType(id, type, skipFree)
- XID id;
- RESTYPE type;
- Bool skipFree;
-{
- int cid;
- register ResourcePtr res;
- register ResourcePtr *prev, *head;
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
- {
- head = &clientTable[cid].resources[Hash(cid, id)];
-
- prev = head;
- while ( (res = *prev) )
- {
- if (res->id == id && res->type == type)
- {
- *prev = res->next;
- if (type & RC_CACHED)
- FlushClientCaches(res->id);
- if (!skipFree)
- (*DeleteFuncs[type & TypeMask])(res->value, res->id);
- xfree(res);
- break;
- }
- else
- prev = &res->next;
- }
- if(clients[cid] && (id == clients[cid]->lastDrawableID))
- {
- clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0];
- clients[cid]->lastDrawableID = WindowTable[0]->drawable.id;
- }
- }
-}
-
-/*
- * Change the value associated with a resource id. Caller
- * is responsible for "doing the right thing" with the old
- * data
- */
-
-Bool
-ChangeResourceValue (id, rtype, value)
- XID id;
- RESTYPE rtype;
- pointer value;
-{
- int cid;
- register ResourcePtr res;
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
- {
- res = clientTable[cid].resources[Hash(cid, id)];
-
- for (; res; res = res->next)
- if ((res->id == id) && (res->type == rtype))
- {
- if (rtype & RC_CACHED)
- FlushClientCaches(res->id);
- res->value = value;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/* Note: if func adds or deletes resources, then func can get called
- * more than once for some resources. If func adds new resources,
- * func might or might not get called for them. func cannot both
- * add and delete an equal number of resources!
- */
-
-void
-FindClientResourcesByType(
- ClientPtr client,
- RESTYPE type,
- FindResType func,
- pointer cdata
-){
- register ResourcePtr *resources;
- register ResourcePtr this, next;
- int i, elements;
- register int *eltptr;
-
- if (!client)
- client = serverClient;
-
- resources = clientTable[client->index].resources;
- eltptr = &clientTable[client->index].elements;
- for (i = 0; i < clientTable[client->index].buckets; i++)
- {
- for (this = resources[i]; this; this = next)
- {
- next = this->next;
- if (!type || this->type == type) {
- elements = *eltptr;
- (*func)(this->value, this->id, cdata);
- if (*eltptr != elements)
- next = resources[i]; /* start over */
- }
- }
- }
-}
-
-void
-FindAllClientResources(
- ClientPtr client,
- FindAllRes func,
- pointer cdata
-){
- register ResourcePtr *resources;
- register ResourcePtr this, next;
- int i, elements;
- register int *eltptr;
-
- if (!client)
- client = serverClient;
-
- resources = clientTable[client->index].resources;
- eltptr = &clientTable[client->index].elements;
- for (i = 0; i < clientTable[client->index].buckets; i++)
- {
- for (this = resources[i]; this; this = next)
- {
- next = this->next;
- elements = *eltptr;
- (*func)(this->value, this->id, this->type, cdata);
- if (*eltptr != elements)
- next = resources[i]; /* start over */
- }
- }
-}
-
-
-pointer
-LookupClientResourceComplex(
- ClientPtr client,
- RESTYPE type,
- FindComplexResType func,
- pointer cdata
-){
- ResourcePtr *resources;
- ResourcePtr this;
- int i;
-
- if (!client)
- client = serverClient;
-
- resources = clientTable[client->index].resources;
- for (i = 0; i < clientTable[client->index].buckets; i++) {
- for (this = resources[i]; this; this = this->next) {
- if (!type || this->type == type) {
- if((*func)(this->value, this->id, cdata))
- return this->value;
- }
- }
- }
- return NULL;
-}
-
-
-void
-FreeClientNeverRetainResources(ClientPtr client)
-{
- ResourcePtr *resources;
- ResourcePtr this;
- ResourcePtr *prev;
- int j;
-
- if (!client)
- return;
-
- resources = clientTable[client->index].resources;
- for (j=0; j < clientTable[client->index].buckets; j++)
- {
- prev = &resources[j];
- while ( (this = *prev) )
- {
- RESTYPE rtype = this->type;
- if (rtype & RC_NEVERRETAIN)
- {
- *prev = this->next;
- if (rtype & RC_CACHED)
- FlushClientCaches(this->id);
- (*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
- xfree(this);
- }
- else
- prev = &this->next;
- }
- }
-}
-
-void
-FreeClientResources(client)
- ClientPtr client;
-{
- register ResourcePtr *resources;
- register ResourcePtr this;
- int j;
-
- /* This routine shouldn't be called with a null client, but just in
- case ... */
-
- if (!client)
- return;
-
- HandleSaveSet(client);
-
- resources = clientTable[client->index].resources;
- for (j=0; j < clientTable[client->index].buckets; j++)
- {
- /* It may seem silly to update the head of this resource list as
- we delete the members, since the entire list will be deleted any way,
- but there are some resource deletion functions "FreeClientPixels" for
- one which do a LookupID on another resource id (a Colormap id in this
- case), so the resource list must be kept valid up to the point that
- it is deleted, so every time we delete a resource, we must update the
- head, just like in FreeResource. I hope that this doesn't slow down
- mass deletion appreciably. PRH */
-
- ResourcePtr *head;
-
- head = &resources[j];
-
- for (this = *head; this; this = *head)
- {
- RESTYPE rtype = this->type;
- *head = this->next;
- if (rtype & RC_CACHED)
- FlushClientCaches(this->id);
- (*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
- xfree(this);
- }
- }
- xfree(clientTable[client->index].resources);
- clientTable[client->index].resources = NULL;
- clientTable[client->index].buckets = 0;
-}
-
-void
-FreeAllResources()
-{
- int i;
-
- for (i = currentMaxClients; --i >= 0; )
- {
- if (clientTable[i].buckets)
- FreeClientResources(clients[i]);
- }
-}
-
-Bool
-LegalNewID(id, client)
- XID id;
- register ClientPtr client;
-{
-
-#ifdef PANORAMIX
- XID minid, maxid;
-
- if (!noPanoramiXExtension) {
- minid = client->clientAsMask | (client->index ?
- SERVER_BIT : SERVER_MINID);
- maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1;
- if ((id >= minid) && (id <= maxid))
- return TRUE;
- }
-#endif /* PANORAMIX */
- return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) &&
- ((clientTable[client->index].expectID <= id) ||
- !LookupIDByClass(id, RC_ANY)));
-}
-
-#ifdef XCSECURITY
-
-/* SecurityLookupIDByType and SecurityLookupIDByClass:
- * These are the heart of the resource ID security system. They take
- * two additional arguments compared to the old LookupID functions:
- * the client doing the lookup, and the access mode (see resource.h).
- * The resource is returned if it exists and the client is allowed access,
- * else NULL is returned.
- */
-
-pointer
-SecurityLookupIDByType(client, id, rtype, mode)
- ClientPtr client;
- XID id;
- RESTYPE rtype;
- Mask mode;
-{
- int cid;
- register ResourcePtr res;
- pointer retval = NULL;
-
- assert(client == NullClient ||
- (client->index <= currentMaxClients && clients[client->index] == client));
- assert( (rtype & TypeMask) <= lastResourceType);
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
- clientTable[cid].buckets)
- {
- res = clientTable[cid].resources[Hash(cid, id)];
-
- for (; res; res = res->next)
- if ((res->id == id) && (res->type == rtype))
- {
- retval = res->value;
- break;
- }
- }
- if (retval && client && client->CheckAccess)
- retval = (* client->CheckAccess)(client, id, rtype, mode, retval);
- return retval;
-}
-
-
-pointer
-SecurityLookupIDByClass(client, id, classes, mode)
- ClientPtr client;
- XID id;
- RESTYPE classes;
- Mask mode;
-{
- int cid;
- register ResourcePtr res = NULL;
- pointer retval = NULL;
-
- assert(client == NullClient ||
- (client->index <= currentMaxClients && clients[client->index] == client));
- assert (classes >= lastResourceClass);
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
- clientTable[cid].buckets)
- {
- res = clientTable[cid].resources[Hash(cid, id)];
-
- for (; res; res = res->next)
- if ((res->id == id) && (res->type & classes))
- {
- retval = res->value;
- break;
- }
- }
- if (retval && client && client->CheckAccess)
- retval = (* client->CheckAccess)(client, id, res->type, mode, retval);
- return retval;
-}
-
-/* We can't replace the LookupIDByType and LookupIDByClass functions with
- * macros because of compatibility with loadable servers.
- */
-
-pointer
-LookupIDByType(id, rtype)
- XID id;
- RESTYPE rtype;
-{
- return SecurityLookupIDByType(NullClient, id, rtype,
- SecurityUnknownAccess);
-}
-
-pointer
-LookupIDByClass(id, classes)
- XID id;
- RESTYPE classes;
-{
- return SecurityLookupIDByClass(NullClient, id, classes,
- SecurityUnknownAccess);
-}
-
-#else /* not XCSECURITY */
-
-/*
- * LookupIDByType returns the object with the given id and type, else NULL.
- */
-pointer
-LookupIDByType(id, rtype)
- XID id;
- RESTYPE rtype;
-{
- int cid;
- register ResourcePtr res;
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
- clientTable[cid].buckets)
- {
- res = clientTable[cid].resources[Hash(cid, id)];
-
- for (; res; res = res->next)
- if ((res->id == id) && (res->type == rtype))
- return res->value;
- }
- return (pointer)NULL;
-}
-
-/*
- * LookupIDByClass returns the object with the given id and any one of the
- * given classes, else NULL.
- */
-pointer
-LookupIDByClass(id, classes)
- XID id;
- RESTYPE classes;
-{
- int cid;
- register ResourcePtr res;
-
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
- clientTable[cid].buckets)
- {
- res = clientTable[cid].resources[Hash(cid, id)];
-
- for (; res; res = res->next)
- if ((res->id == id) && (res->type & classes))
- return res->value;
- }
- return (pointer)NULL;
-}
-
-#endif /* XCSECURITY */
diff --git a/dix/swaprep.c b/dix/swaprep.c
deleted file mode 100644
index 494471730..000000000
--- a/dix/swaprep.c
+++ /dev/null
@@ -1,1459 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.8 2003/11/17 22:20:35 dawes Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: swaprep.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "fontstruct.h"
-#include "scrnintstr.h"
-#include "swaprep.h"
-#include "globals.h"
-
-static void SwapFontInfo(
- xQueryFontReply * /* pr */
-);
-
-#ifndef LBX
-static void SwapCharInfo(
- xCharInfo * /* pInfo */
- );
-
-static void SwapFont(
- xQueryFontReply * /* pr */,
- Bool /* hasGlyphs */
- );
-#endif
-
-/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
-void
-Swap32Write(pClient, size, pbuf)
- ClientPtr pClient;
- int size; /* in bytes */
- register CARD32 *pbuf;
-{
- register int i;
- register char n;
-
- size >>= 2;
- for(i = 0; i < size; i++)
- /* brackets are mandatory here, because "swapl" macro expands
- to several statements */
- {
- swapl(&pbuf[i], n);
- }
- (void)WriteToClient(pClient, size << 2, (char *) pbuf);
-}
-
-void
-CopySwap32Write(pClient, size, pbuf)
- ClientPtr pClient;
- int size; /* in bytes */
- CARD32 *pbuf;
-{
- int bufsize = size;
- CARD32 *pbufT;
- register CARD32 *from, *to, *fromLast, *toLast;
- CARD32 tmpbuf[1];
-
- /* Allocate as big a buffer as we can... */
- while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize)))
- {
- bufsize >>= 1;
- if (bufsize == 4)
- {
- pbufT = tmpbuf;
- break;
- }
- }
-
- /* convert lengths from # of bytes to # of longs */
- size >>= 2;
- bufsize >>= 2;
-
- from = pbuf;
- fromLast = from + size;
- while (from < fromLast) {
- int nbytes;
- to = pbufT;
- toLast = to + min (bufsize, fromLast - from);
- nbytes = (toLast - to) << 2;
- while (to < toLast) {
- /* can't write "cpswapl(*from++, *to++)" because cpswapl is a macro
- that evaulates its args more than once */
- cpswapl(*from, *to);
- from++;
- to++;
- }
- (void)WriteToClient (pClient, nbytes, (char *) pbufT);
- }
-
- if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
-}
-
-void
-CopySwap16Write(pClient, size, pbuf)
- ClientPtr pClient;
- int size; /* in bytes */
- short *pbuf;
-{
- int bufsize = size;
- short *pbufT;
- register short *from, *to, *fromLast, *toLast;
- short tmpbuf[2];
-
- /* Allocate as big a buffer as we can... */
- while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize)))
- {
- bufsize >>= 1;
- if (bufsize == 4)
- {
- pbufT = tmpbuf;
- break;
- }
- }
-
- /* convert lengths from # of bytes to # of shorts */
- size >>= 1;
- bufsize >>= 1;
-
- from = pbuf;
- fromLast = from + size;
- while (from < fromLast) {
- int nbytes;
- to = pbufT;
- toLast = to + min (bufsize, fromLast - from);
- nbytes = (toLast - to) << 1;
- while (to < toLast) {
- /* can't write "cpswaps(*from++, *to++)" because cpswaps is a macro
- that evaulates its args more than once */
- cpswaps(*from, *to);
- from++;
- to++;
- }
- (void)WriteToClient (pClient, nbytes, (char *) pbufT);
- }
-
- if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
-}
-
-
-/* Extra-small reply */
-void
-SGenericReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGenericReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-/* Extra-large reply */
-void
-SGetWindowAttributesReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetWindowAttributesReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->visualID, n);
- swaps(&pRep->class, n);
- swapl(&pRep->backingBitPlanes, n);
- swapl(&pRep->backingPixel, n);
- swapl(&pRep->colormap, n);
- swapl(&pRep->allEventMasks, n);
- swapl(&pRep->yourEventMask, n);
- swaps(&pRep->doNotPropagateMask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetGeometryReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetGeometryReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->root, n);
- swaps(&pRep->x, n);
- swaps(&pRep->y, n);
- swaps(&pRep->width, n);
- swaps(&pRep->height, n);
- swaps(&pRep->borderWidth, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryTreeReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryTreeReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->root, n);
- swapl(&pRep->parent, n);
- swaps(&pRep->nChildren, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SInternAtomReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xInternAtomReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->atom, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetAtomNameReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetAtomNameReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nameLength, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SGetPropertyReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetPropertyReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->propertyType, n);
- swapl(&pRep->bytesAfter, n);
- swapl(&pRep->nItems, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListPropertiesReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListPropertiesReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nProperties, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetSelectionOwnerReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetSelectionOwnerReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->owner, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SQueryPointerReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryPointerReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->root, n);
- swapl(&pRep->child, n);
- swaps(&pRep->rootX, n);
- swaps(&pRep->rootY, n);
- swaps(&pRep->winX, n);
- swaps(&pRep->winY, n);
- swaps(&pRep->mask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SwapTimecoord(pCoord)
- xTimecoord *pCoord;
-{
- register char n;
-
- swapl(&pCoord->time, n);
- swaps(&pCoord->x, n);
- swaps(&pCoord->y, n);
-}
-
-void
-SwapTimeCoordWrite(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xTimecoord *pRep;
-{
- int i, n;
- xTimecoord *pRepT;
-
- n = size / sizeof(xTimecoord);
- pRepT = pRep;
- for(i = 0; i < n; i++)
- {
- SwapTimecoord(pRepT);
- pRepT++;
- }
- (void)WriteToClient(pClient, size, (char *) pRep);
-
-}
-void
-SGetMotionEventsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetMotionEventsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->nEvents, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-STranslateCoordsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xTranslateCoordsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->child, n);
- swaps(&pRep->dstX, n);
- swaps(&pRep->dstY, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetInputFocusReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetInputFocusReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->focus, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-/* extra long reply */
-void
-SQueryKeymapReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryKeymapReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-#ifndef LBX
-static
-#endif
-void
-SwapCharInfo(pInfo)
- xCharInfo *pInfo;
-{
- register char n;
-
- swaps(&pInfo->leftSideBearing, n);
- swaps(&pInfo->rightSideBearing, n);
- swaps(&pInfo->characterWidth, n);
- swaps(&pInfo->ascent, n);
- swaps(&pInfo->descent, n);
- swaps(&pInfo->attributes, n);
-}
-
-static void
-SwapFontInfo(pr)
- xQueryFontReply *pr;
-{
- register char n;
-
- swaps(&pr->minCharOrByte2, n);
- swaps(&pr->maxCharOrByte2, n);
- swaps(&pr->defaultChar, n);
- swaps(&pr->nFontProps, n);
- swaps(&pr->fontAscent, n);
- swaps(&pr->fontDescent, n);
- SwapCharInfo( &pr->minBounds);
- SwapCharInfo( &pr->maxBounds);
- swapl(&pr->nCharInfos, n);
-}
-
-#ifndef LBX
-static
-#endif
-void
-SwapFont( pr, hasGlyphs)
- xQueryFontReply * pr;
- Bool hasGlyphs;
-{
- unsigned i;
- xCharInfo * pxci;
- unsigned nchars, nprops;
- char *pby;
- register char n;
-
- swaps(&pr->sequenceNumber, n);
- swapl(&pr->length, n);
- nchars = pr->nCharInfos;
- nprops = pr->nFontProps;
- SwapFontInfo(pr);
- pby = (char *) &pr[1];
- /* Font properties are an atom and either an int32 or a CARD32, so
- * they are always 2 4 byte values */
- for(i = 0; i < nprops; i++)
- {
- swapl(pby, n);
- pby += 4;
- swapl(pby, n);
- pby += 4;
- }
- if (hasGlyphs)
- {
- pxci = (xCharInfo *)pby;
- for(i = 0; i< nchars; i++, pxci++)
- SwapCharInfo(pxci);
- }
-}
-
-void
-SQueryFontReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryFontReply *pRep;
-{
- SwapFont(pRep, TRUE);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryTextExtentsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryTextExtentsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->fontAscent, n);
- swaps(&pRep->fontDescent, n);
- swaps(&pRep->overallAscent, n);
- swaps(&pRep->overallDescent, n);
- swapl(&pRep->overallWidth, n);
- swapl(&pRep->overallLeft, n);
- swapl(&pRep->overallRight, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListFontsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListFontsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nFonts, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListFontsWithInfoReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListFontsWithInfoReply *pRep;
-{
- SwapFont((xQueryFontReply *)pRep, FALSE);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetFontPathReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetFontPathReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPaths, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetImageReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetImageReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->visual, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
- /* Fortunately, image doesn't need swapping */
-}
-
-void
-SListInstalledColormapsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListInstalledColormapsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nColormaps, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocColorReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xAllocColorReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->red, n);
- swaps(&pRep->green, n);
- swaps(&pRep->blue, n);
- swapl(&pRep->pixel, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocNamedColorReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xAllocNamedColorReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->pixel, n);
- swaps(&pRep->exactRed, n);
- swaps(&pRep->exactGreen, n);
- swaps(&pRep->exactBlue, n);
- swaps(&pRep->screenRed, n);
- swaps(&pRep->screenGreen, n);
- swaps(&pRep->screenBlue, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocColorCellsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xAllocColorCellsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPixels, n);
- swaps(&pRep->nMasks, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SAllocColorPlanesReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xAllocColorPlanesReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPixels, n);
- swapl(&pRep->redMask, n);
- swapl(&pRep->greenMask, n);
- swapl(&pRep->blueMask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SwapRGB(prgb)
- xrgb *prgb;
-{
- register char n;
-
- swaps(&prgb->red, n);
- swaps(&prgb->green, n);
- swaps(&prgb->blue, n);
-}
-
-void
-SQColorsExtend(pClient, size, prgb)
- ClientPtr pClient;
- int size;
- xrgb *prgb;
-{
- int i, n;
- xrgb *prgbT;
-
- n = size / sizeof(xrgb);
- prgbT = prgb;
- for(i = 0; i < n; i++)
- {
- SwapRGB(prgbT);
- prgbT++;
- }
- (void)WriteToClient(pClient, size, (char *) prgb);
-}
-
-void
-SQueryColorsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryColorsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nColors, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SLookupColorReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xLookupColorReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->exactRed, n);
- swaps(&pRep->exactGreen, n);
- swaps(&pRep->exactBlue, n);
- swaps(&pRep->screenRed, n);
- swaps(&pRep->screenGreen, n);
- swaps(&pRep->screenBlue, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryBestSizeReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xQueryBestSizeReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->width, n);
- swaps(&pRep->height, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListExtensionsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListExtensionsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetKeyboardMappingReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetKeyboardMappingReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetPointerMappingReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetPointerMappingReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetModifierMappingReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetModifierMappingReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetKeyboardControlReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetKeyboardControlReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->ledMask, n);
- swaps(&pRep->bellPitch, n);
- swaps(&pRep->bellDuration, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetPointerControlReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetPointerControlReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->accelNumerator, n);
- swaps(&pRep->accelDenominator, n);
- swaps(&pRep->threshold, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetScreenSaverReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xGetScreenSaverReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->timeout, n);
- swaps(&pRep->interval, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SLHostsExtend(pClient, size, buf)
- ClientPtr pClient;
- int size;
- char *buf;
-{
- char *bufT = buf;
- char *endbuf = buf + size;
- while (bufT < endbuf) {
- xHostEntry *host = (xHostEntry *) bufT;
- int len = host->length;
- register char n;
- swaps (&host->length, n);
- bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2);
- }
- (void)WriteToClient (pClient, size, buf);
-}
-
-void
-SListHostsReply(pClient, size, pRep)
- ClientPtr pClient;
- int size;
- xListHostsReply *pRep;
-{
- register char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nHosts, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-
-void
-SErrorEvent(from, to)
- xError *from, *to;
-{
- to->type = X_Error;
- to->errorCode = from->errorCode;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->resourceID, to->resourceID);
- cpswaps(from->minorCode, to->minorCode);
- to->majorCode = from->majorCode;
-}
-
-void
-SKeyButtonPtrEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.keyButtonPointer.time,
- to->u.keyButtonPointer.time);
- cpswapl(from->u.keyButtonPointer.root,
- to->u.keyButtonPointer.root);
- cpswapl(from->u.keyButtonPointer.event,
- to->u.keyButtonPointer.event);
- cpswapl(from->u.keyButtonPointer.child,
- to->u.keyButtonPointer.child);
- cpswaps(from->u.keyButtonPointer.rootX,
- to->u.keyButtonPointer.rootX);
- cpswaps(from->u.keyButtonPointer.rootY,
- to->u.keyButtonPointer.rootY);
- cpswaps(from->u.keyButtonPointer.eventX,
- to->u.keyButtonPointer.eventX);
- cpswaps(from->u.keyButtonPointer.eventY,
- to->u.keyButtonPointer.eventY);
- cpswaps(from->u.keyButtonPointer.state,
- to->u.keyButtonPointer.state);
- to->u.keyButtonPointer.sameScreen =
- from->u.keyButtonPointer.sameScreen;
-}
-
-void
-SEnterLeaveEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.enterLeave.time, to->u.enterLeave.time);
- cpswapl(from->u.enterLeave.root, to->u.enterLeave.root);
- cpswapl(from->u.enterLeave.event, to->u.enterLeave.event);
- cpswapl(from->u.enterLeave.child, to->u.enterLeave.child);
- cpswaps(from->u.enterLeave.rootX, to->u.enterLeave.rootX);
- cpswaps(from->u.enterLeave.rootY, to->u.enterLeave.rootY);
- cpswaps(from->u.enterLeave.eventX, to->u.enterLeave.eventX);
- cpswaps(from->u.enterLeave.eventY, to->u.enterLeave.eventY);
- cpswaps(from->u.enterLeave.state, to->u.enterLeave.state);
- to->u.enterLeave.mode = from->u.enterLeave.mode;
- to->u.enterLeave.flags = from->u.enterLeave.flags;
-}
-
-void
-SFocusEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.focus.window, to->u.focus.window);
- to->u.focus.mode = from->u.focus.mode;
-}
-
-void
-SExposeEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.expose.window, to->u.expose.window);
- cpswaps(from->u.expose.x, to->u.expose.x);
- cpswaps(from->u.expose.y, to->u.expose.y);
- cpswaps(from->u.expose.width, to->u.expose.width);
- cpswaps(from->u.expose.height, to->u.expose.height);
- cpswaps(from->u.expose.count, to->u.expose.count);
-}
-
-void
-SGraphicsExposureEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.graphicsExposure.drawable,
- to->u.graphicsExposure.drawable);
- cpswaps(from->u.graphicsExposure.x,
- to->u.graphicsExposure.x);
- cpswaps(from->u.graphicsExposure.y,
- to->u.graphicsExposure.y);
- cpswaps(from->u.graphicsExposure.width,
- to->u.graphicsExposure.width);
- cpswaps(from->u.graphicsExposure.height,
- to->u.graphicsExposure.height);
- cpswaps(from->u.graphicsExposure.minorEvent,
- to->u.graphicsExposure.minorEvent);
- cpswaps(from->u.graphicsExposure.count,
- to->u.graphicsExposure.count);
- to->u.graphicsExposure.majorEvent =
- from->u.graphicsExposure.majorEvent;
-}
-
-void
-SNoExposureEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.noExposure.drawable, to->u.noExposure.drawable);
- cpswaps(from->u.noExposure.minorEvent, to->u.noExposure.minorEvent);
- to->u.noExposure.majorEvent = from->u.noExposure.majorEvent;
-}
-
-void
-SVisibilityEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.visibility.window, to->u.visibility.window);
- to->u.visibility.state = from->u.visibility.state;
-}
-
-void
-SCreateNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.createNotify.window, to->u.createNotify.window);
- cpswapl(from->u.createNotify.parent, to->u.createNotify.parent);
- cpswaps(from->u.createNotify.x, to->u.createNotify.x);
- cpswaps(from->u.createNotify.y, to->u.createNotify.y);
- cpswaps(from->u.createNotify.width, to->u.createNotify.width);
- cpswaps(from->u.createNotify.height, to->u.createNotify.height);
- cpswaps(from->u.createNotify.borderWidth,
- to->u.createNotify.borderWidth);
- to->u.createNotify.override = from->u.createNotify.override;
-}
-
-void
-SDestroyNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.destroyNotify.event, to->u.destroyNotify.event);
- cpswapl(from->u.destroyNotify.window, to->u.destroyNotify.window);
-}
-
-void
-SUnmapNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.unmapNotify.event, to->u.unmapNotify.event);
- cpswapl(from->u.unmapNotify.window, to->u.unmapNotify.window);
- to->u.unmapNotify.fromConfigure = from->u.unmapNotify.fromConfigure;
-}
-
-void
-SMapNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.mapNotify.event, to->u.mapNotify.event);
- cpswapl(from->u.mapNotify.window, to->u.mapNotify.window);
- to->u.mapNotify.override = from->u.mapNotify.override;
-}
-
-void
-SMapRequestEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.mapRequest.parent, to->u.mapRequest.parent);
- cpswapl(from->u.mapRequest.window, to->u.mapRequest.window);
-}
-
-void
-SReparentEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.reparent.event, to->u.reparent.event);
- cpswapl(from->u.reparent.window, to->u.reparent.window);
- cpswapl(from->u.reparent.parent, to->u.reparent.parent);
- cpswaps(from->u.reparent.x, to->u.reparent.x);
- cpswaps(from->u.reparent.y, to->u.reparent.y);
- to->u.reparent.override = from->u.reparent.override;
-}
-
-void
-SConfigureNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.configureNotify.event,
- to->u.configureNotify.event);
- cpswapl(from->u.configureNotify.window,
- to->u.configureNotify.window);
- cpswapl(from->u.configureNotify.aboveSibling,
- to->u.configureNotify.aboveSibling);
- cpswaps(from->u.configureNotify.x, to->u.configureNotify.x);
- cpswaps(from->u.configureNotify.y, to->u.configureNotify.y);
- cpswaps(from->u.configureNotify.width, to->u.configureNotify.width);
- cpswaps(from->u.configureNotify.height,
- to->u.configureNotify.height);
- cpswaps(from->u.configureNotify.borderWidth,
- to->u.configureNotify.borderWidth);
- to->u.configureNotify.override = from->u.configureNotify.override;
-}
-
-void
-SConfigureRequestEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail; /* actually stack-mode */
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.configureRequest.parent,
- to->u.configureRequest.parent);
- cpswapl(from->u.configureRequest.window,
- to->u.configureRequest.window);
- cpswapl(from->u.configureRequest.sibling,
- to->u.configureRequest.sibling);
- cpswaps(from->u.configureRequest.x, to->u.configureRequest.x);
- cpswaps(from->u.configureRequest.y, to->u.configureRequest.y);
- cpswaps(from->u.configureRequest.width,
- to->u.configureRequest.width);
- cpswaps(from->u.configureRequest.height,
- to->u.configureRequest.height);
- cpswaps(from->u.configureRequest.borderWidth,
- to->u.configureRequest.borderWidth);
- cpswaps(from->u.configureRequest.valueMask,
- to->u.configureRequest.valueMask);
-}
-
-
-void
-SGravityEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.gravity.event, to->u.gravity.event);
- cpswapl(from->u.gravity.window, to->u.gravity.window);
- cpswaps(from->u.gravity.x, to->u.gravity.x);
- cpswaps(from->u.gravity.y, to->u.gravity.y);
-}
-
-void
-SResizeRequestEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.resizeRequest.window, to->u.resizeRequest.window);
- cpswaps(from->u.resizeRequest.width, to->u.resizeRequest.width);
- cpswaps(from->u.resizeRequest.height, to->u.resizeRequest.height);
-}
-
-void
-SCirculateEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.circulate.event, to->u.circulate.event);
- cpswapl(from->u.circulate.window, to->u.circulate.window);
- cpswapl(from->u.circulate.parent, to->u.circulate.parent);
- to->u.circulate.place = from->u.circulate.place;
-}
-
-void
-SPropertyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.property.window, to->u.property.window);
- cpswapl(from->u.property.atom, to->u.property.atom);
- cpswapl(from->u.property.time, to->u.property.time);
- to->u.property.state = from->u.property.state;
-}
-
-void
-SSelectionClearEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionClear.time, to->u.selectionClear.time);
- cpswapl(from->u.selectionClear.window, to->u.selectionClear.window);
- cpswapl(from->u.selectionClear.atom, to->u.selectionClear.atom);
-}
-
-void
-SSelectionRequestEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionRequest.time, to->u.selectionRequest.time);
- cpswapl(from->u.selectionRequest.owner,
- to->u.selectionRequest.owner);
- cpswapl(from->u.selectionRequest.requestor,
- to->u.selectionRequest.requestor);
- cpswapl(from->u.selectionRequest.selection,
- to->u.selectionRequest.selection);
- cpswapl(from->u.selectionRequest.target,
- to->u.selectionRequest.target);
- cpswapl(from->u.selectionRequest.property,
- to->u.selectionRequest.property);
-}
-
-void
-SSelectionNotifyEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionNotify.time, to->u.selectionNotify.time);
- cpswapl(from->u.selectionNotify.requestor,
- to->u.selectionNotify.requestor);
- cpswapl(from->u.selectionNotify.selection,
- to->u.selectionNotify.selection);
- cpswapl(from->u.selectionNotify.target,
- to->u.selectionNotify.target);
- cpswapl(from->u.selectionNotify.property,
- to->u.selectionNotify.property);
-}
-
-void
-SColormapEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.colormap.window, to->u.colormap.window);
- cpswapl(from->u.colormap.colormap, to->u.colormap.colormap);
- to->u.colormap.new = from->u.colormap.new;
- to->u.colormap.state = from->u.colormap.state;
-}
-
-void
-SMappingEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- to->u.mappingNotify.request = from->u.mappingNotify.request;
- to->u.mappingNotify.firstKeyCode =
- from->u.mappingNotify.firstKeyCode;
- to->u.mappingNotify.count = from->u.mappingNotify.count;
-}
-
-void
-SClientMessageEvent(from, to)
- xEvent *from, *to;
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail; /* actually format */
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.clientMessage.window, to->u.clientMessage.window);
- cpswapl(from->u.clientMessage.u.l.type,
- to->u.clientMessage.u.l.type);
- switch (from->u.u.detail) {
- case 8:
- memmove(to->u.clientMessage.u.b.bytes,
- from->u.clientMessage.u.b.bytes,20);
- break;
- case 16:
- cpswaps(from->u.clientMessage.u.s.shorts0,
- to->u.clientMessage.u.s.shorts0);
- cpswaps(from->u.clientMessage.u.s.shorts1,
- to->u.clientMessage.u.s.shorts1);
- cpswaps(from->u.clientMessage.u.s.shorts2,
- to->u.clientMessage.u.s.shorts2);
- cpswaps(from->u.clientMessage.u.s.shorts3,
- to->u.clientMessage.u.s.shorts3);
- cpswaps(from->u.clientMessage.u.s.shorts4,
- to->u.clientMessage.u.s.shorts4);
- cpswaps(from->u.clientMessage.u.s.shorts5,
- to->u.clientMessage.u.s.shorts5);
- cpswaps(from->u.clientMessage.u.s.shorts6,
- to->u.clientMessage.u.s.shorts6);
- cpswaps(from->u.clientMessage.u.s.shorts7,
- to->u.clientMessage.u.s.shorts7);
- cpswaps(from->u.clientMessage.u.s.shorts8,
- to->u.clientMessage.u.s.shorts8);
- cpswaps(from->u.clientMessage.u.s.shorts9,
- to->u.clientMessage.u.s.shorts9);
- break;
- case 32:
- cpswapl(from->u.clientMessage.u.l.longs0,
- to->u.clientMessage.u.l.longs0);
- cpswapl(from->u.clientMessage.u.l.longs1,
- to->u.clientMessage.u.l.longs1);
- cpswapl(from->u.clientMessage.u.l.longs2,
- to->u.clientMessage.u.l.longs2);
- cpswapl(from->u.clientMessage.u.l.longs3,
- to->u.clientMessage.u.l.longs3);
- cpswapl(from->u.clientMessage.u.l.longs4,
- to->u.clientMessage.u.l.longs4);
- break;
- }
-}
-
-void
-SKeymapNotifyEvent(from, to)
- xEvent *from, *to;
-{
- /* Keymap notify events are special; they have no
- sequence number field, and contain entirely 8-bit data */
- *to = *from;
-}
-
-void
-SwapConnSetupInfo(
- char *pInfo,
- char *pInfoT
-)
-{
- int i, j, k;
- xConnSetup *pConnSetup = (xConnSetup *)pInfo;
- xDepth *depth;
- xWindowRoot *root;
-
- SwapConnSetup(pConnSetup, (xConnSetup *)pInfoT);
- pInfo += sizeof(xConnSetup);
- pInfoT += sizeof(xConnSetup);
-
- /* Copy the vendor string */
- i = (pConnSetup->nbytesVendor + 3) & ~3;
- memcpy(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- /* The Pixmap formats don't need to be swapped, just copied. */
- i = sizeof(xPixmapFormat) * pConnSetup->numFormats;
- memcpy(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- for(i = 0; i < pConnSetup->numRoots; i++)
- {
- root = (xWindowRoot*)pInfo;
- SwapWinRoot(root, (xWindowRoot *)pInfoT);
- pInfo += sizeof(xWindowRoot);
- pInfoT += sizeof(xWindowRoot);
-
- for(j = 0; j < root->nDepths; j++)
- {
- depth = (xDepth*)pInfo;
- ((xDepth *)pInfoT)->depth = depth->depth;
- cpswaps(depth->nVisuals, ((xDepth *)pInfoT)->nVisuals);
- pInfo += sizeof(xDepth);
- pInfoT += sizeof(xDepth);
- for(k = 0; k < depth->nVisuals; k++)
- {
- SwapVisual((xVisualType *)pInfo, (xVisualType *)pInfoT);
- pInfo += sizeof(xVisualType);
- pInfoT += sizeof(xVisualType);
- }
- }
- }
-}
-
-
-void
-WriteSConnectionInfo(pClient, size, pInfo)
- ClientPtr pClient;
- unsigned long size;
- char *pInfo;
-{
- char *pInfoTBase;
-
- pInfoTBase = (char *) ALLOCATE_LOCAL(size);
- if (!pInfoTBase)
- {
- pClient->noClientException = -1;
- return;
- }
- SwapConnSetupInfo(pInfo, pInfoTBase);
- (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
- DEALLOCATE_LOCAL(pInfoTBase);
-}
-
-void
-SwapConnSetup(pConnSetup, pConnSetupT)
- xConnSetup *pConnSetup, *pConnSetupT;
-{
- cpswapl(pConnSetup->release, pConnSetupT->release);
- cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
- cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
- cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
- cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
- cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
- pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
- pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
- pConnSetupT->numRoots = pConnSetup->numRoots;
- pConnSetupT->numFormats = pConnSetup->numFormats;
- pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
- pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
- pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
- pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
-}
-
-void
-SwapWinRoot(pRoot, pRootT)
- xWindowRoot *pRoot, *pRootT;
-{
- cpswapl(pRoot->windowId, pRootT->windowId);
- cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
- cpswapl(pRoot->whitePixel, pRootT->whitePixel);
- cpswapl(pRoot->blackPixel, pRootT->blackPixel);
- cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
- cpswaps(pRoot->pixWidth, pRootT->pixWidth);
- cpswaps(pRoot->pixHeight, pRootT->pixHeight);
- cpswaps(pRoot->mmWidth, pRootT->mmWidth);
- cpswaps(pRoot->mmHeight, pRootT->mmHeight);
- cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
- cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
- cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
- pRootT->backingStore = pRoot->backingStore;
- pRootT->saveUnders = pRoot->saveUnders;
- pRootT->rootDepth = pRoot->rootDepth;
- pRootT->nDepths = pRoot->nDepths;
-}
-
-void
-SwapVisual(pVis, pVisT)
- xVisualType *pVis, *pVisT;
-{
- cpswapl(pVis->visualID, pVisT->visualID);
- pVisT->class = pVis->class;
- pVisT->bitsPerRGB = pVis->bitsPerRGB;
- cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
- cpswapl(pVis->redMask, pVisT->redMask);
- cpswapl(pVis->greenMask, pVisT->greenMask);
- cpswapl(pVis->blueMask, pVisT->blueMask);
-}
-
-void
-SwapConnSetupPrefix(pcspFrom, pcspTo)
- xConnSetupPrefix *pcspFrom;
- xConnSetupPrefix *pcspTo;
-{
- pcspTo->success = pcspFrom->success;
- pcspTo->lengthReason = pcspFrom->lengthReason;
- cpswaps(pcspFrom->majorVersion, pcspTo->majorVersion);
- cpswaps(pcspFrom->minorVersion, pcspTo->minorVersion);
- cpswaps(pcspFrom->length, pcspTo->length);
-}
-
-void
-WriteSConnSetupPrefix(pClient, pcsp)
- ClientPtr pClient;
- xConnSetupPrefix *pcsp;
-{
- xConnSetupPrefix cspT;
-
- SwapConnSetupPrefix(pcsp, &cspT);
- (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT);
-}
diff --git a/dix/swapreq.c b/dix/swapreq.c
deleted file mode 100644
index 358ec8139..000000000
--- a/dix/swapreq.c
+++ /dev/null
@@ -1,1173 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/swapreq.c,v 3.5 2002/02/19 11:09:22 alanh Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: swapreq.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "Xprotostr.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h" /* for SendEvent */
-#include "swapreq.h"
-
-/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
-
-/* Byte swap a list of longs */
-
-void
-SwapLongs (list, count)
- register CARD32 *list;
- register unsigned long count;
-{
- register char n;
-
- while (count >= 8) {
- swapl(list+0, n);
- swapl(list+1, n);
- swapl(list+2, n);
- swapl(list+3, n);
- swapl(list+4, n);
- swapl(list+5, n);
- swapl(list+6, n);
- swapl(list+7, n);
- list += 8;
- count -= 8;
- }
- if (count != 0) {
- do {
- swapl(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-/* Byte swap a list of shorts */
-
-void
-SwapShorts (list, count)
- register short *list;
- register unsigned long count;
-{
- register char n;
-
- while (count >= 16) {
- swaps(list+0, n);
- swaps(list+1, n);
- swaps(list+2, n);
- swaps(list+3, n);
- swaps(list+4, n);
- swaps(list+5, n);
- swaps(list+6, n);
- swaps(list+7, n);
- swaps(list+8, n);
- swaps(list+9, n);
- swaps(list+10, n);
- swaps(list+11, n);
- swaps(list+12, n);
- swaps(list+13, n);
- swaps(list+14, n);
- swaps(list+15, n);
- list += 16;
- count -= 16;
- }
- if (count != 0) {
- do {
- swaps(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-/* The following is used for all requests that have
- no fields to be swapped (except "length") */
-int
-SProcSimpleReq(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xReq);
- swaps(&stuff->length, n);
- return(*ProcVector[stuff->reqType])(client);
-}
-
-/* The following is used for all requests that have
- only a single 32-bit field to be swapped, coming
- right after the "length" field */
-int
-SProcResourceReq(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xResourceReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
- swapl(&stuff->id, n);
- return(*ProcVector[stuff->reqType])(client);
-}
-
-int
-SProcCreateWindow(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xCreateWindowReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
- swapl(&stuff->wid, n);
- swapl(&stuff->parent, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swaps(&stuff->borderWidth, n);
- swaps(&stuff->class, n);
- swapl(&stuff->visual, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_CreateWindow])(client));
-}
-
-int
-SProcChangeWindowAttributes(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xChangeWindowAttributesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
- swapl(&stuff->window, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeWindowAttributes])(client));
-}
-
-int
-SProcReparentWindow(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xReparentWindowReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xReparentWindowReq);
- swapl(&stuff->window, n);
- swapl(&stuff->parent, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[X_ReparentWindow])(client));
-}
-
-int
-SProcConfigureWindow(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xConfigureWindowReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
- swapl(&stuff->window, n);
- swaps(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ConfigureWindow])(client));
-
-}
-
-
-int
-SProcInternAtom(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xInternAtomReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xInternAtomReq);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_InternAtom])(client));
-}
-
-int
-SProcChangeProperty(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangePropertyReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- switch ( stuff->format ) {
- case 8 :
- break;
- case 16:
- SwapRestS(stuff);
- break;
- case 32:
- SwapRestL(stuff);
- break;
- }
- return((* ProcVector[X_ChangeProperty])(client));
-}
-
-int
-SProcDeleteProperty(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xDeletePropertyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDeletePropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- return((* ProcVector[X_DeleteProperty])(client));
-
-}
-
-int
-SProcGetProperty(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGetPropertyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetPropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- return((* ProcVector[X_GetProperty])(client));
-}
-
-int
-SProcSetSelectionOwner(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetSelectionOwnerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
- swapl(&stuff->window, n);
- swapl(&stuff->selection, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_SetSelectionOwner])(client));
-}
-
-int
-SProcConvertSelection(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xConvertSelectionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xConvertSelectionReq);
- swapl(&stuff->requestor, n);
- swapl(&stuff->selection, n);
- swapl(&stuff->target, n);
- swapl(&stuff->property, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_ConvertSelection])(client));
-}
-
-int
-SProcSendEvent(client)
- register ClientPtr client;
-{
- register char n;
- xEvent eventT;
- EventSwapPtr proc;
- REQUEST(xSendEventReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSendEventReq);
- swapl(&stuff->destination, n);
- swapl(&stuff->eventMask, n);
-
- /* Swap event */
- proc = EventSwapVector[stuff->event.u.u.type & 0177];
- if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
- return (BadValue);
- (*proc)(&stuff->event, &eventT);
- stuff->event = eventT;
-
- return((* ProcVector[X_SendEvent])(client));
-}
-
-int
-SProcGrabPointer(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGrabPointerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabPointerReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->eventMask, n);
- swapl(&stuff->confineTo, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_GrabPointer])(client));
-}
-
-int
-SProcGrabButton(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGrabButtonReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->eventMask, n);
- swapl(&stuff->confineTo, n);
- swapl(&stuff->cursor, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_GrabButton])(client));
-}
-
-int
-SProcUngrabButton(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xUngrabButtonReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_UngrabButton])(client));
-}
-
-int
-SProcChangeActivePointerGrab(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangeActivePointerGrabReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swaps(&stuff->eventMask, n);
- return((* ProcVector[X_ChangeActivePointerGrab])(client));
-}
-
-int
-SProcGrabKeyboard(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGrabKeyboardReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabKeyboardReq);
- swapl(&stuff->grabWindow, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_GrabKeyboard])(client));
-}
-
-int
-SProcGrabKey(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGrabKeyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_GrabKey])(client));
-}
-
-int
-SProcUngrabKey(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xUngrabKeyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_UngrabKey])(client));
-}
-
-int
-SProcGetMotionEvents(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGetMotionEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetMotionEventsReq);
- swapl(&stuff->window, n);
- swapl(&stuff->start, n);
- swapl(&stuff->stop, n);
- return((* ProcVector[X_GetMotionEvents])(client));
-}
-
-int
-SProcTranslateCoords(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xTranslateCoordsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xTranslateCoordsReq);
- swapl(&stuff->srcWid, n);
- swapl(&stuff->dstWid, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- return((* ProcVector[X_TranslateCoords])(client));
-}
-
-int
-SProcWarpPointer(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xWarpPointerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xWarpPointerReq);
- swapl(&stuff->srcWid, n);
- swapl(&stuff->dstWid, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->srcWidth, n);
- swaps(&stuff->srcHeight, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- return((* ProcVector[X_WarpPointer])(client));
-}
-
-int
-SProcSetInputFocus(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetInputFocusReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetInputFocusReq);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_SetInputFocus])(client));
-}
-
-int
-SProcOpenFont(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xOpenFontReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xOpenFontReq);
- swapl(&stuff->fid, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_OpenFont])(client));
-}
-
-int
-SProcListFonts(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xListFontsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xListFontsReq);
- swaps(&stuff->maxNames, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_ListFonts])(client));
-}
-
-int
-SProcListFontsWithInfo(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xListFontsWithInfoReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
- swaps(&stuff->maxNames, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_ListFontsWithInfo])(client));
-}
-
-int
-SProcSetFontPath(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetFontPathReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
- swaps(&stuff->nFonts, n);
- return((* ProcVector[X_SetFontPath])(client));
-}
-
-int
-SProcCreatePixmap(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCreatePixmapReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreatePixmapReq);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_CreatePixmap])(client));
-}
-
-int
-SProcCreateGC(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCreateGCReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xCreateGCReq);
- swapl(&stuff->gc, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_CreateGC])(client));
-}
-
-int
-SProcChangeGC(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangeGCReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeGCReq);
- swapl(&stuff->gc, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeGC])(client));
-}
-
-int
-SProcCopyGC(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCopyGCReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyGCReq);
- swapl(&stuff->srcGC, n);
- swapl(&stuff->dstGC, n);
- swapl(&stuff->mask, n);
- return((* ProcVector[X_CopyGC])(client));
-}
-
-int
-SProcSetDashes(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetDashesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetDashesReq);
- swapl(&stuff->gc, n);
- swaps(&stuff->dashOffset, n);
- swaps(&stuff->nDashes, n);
- return((* ProcVector[X_SetDashes])(client));
-
-}
-
-int
-SProcSetClipRectangles(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetClipRectanglesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
- swapl(&stuff->gc, n);
- swaps(&stuff->xOrigin, n);
- swaps(&stuff->yOrigin, n);
- SwapRestS(stuff);
- return((* ProcVector[X_SetClipRectangles])(client));
-}
-
-int
-SProcClearToBackground(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xClearAreaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xClearAreaReq);
- swapl(&stuff->window, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_ClearArea])(client));
-}
-
-int
-SProcCopyArea(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCopyAreaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyAreaReq);
- swapl(&stuff->srcDrawable, n);
- swapl(&stuff->dstDrawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_CopyArea])(client));
-}
-
-int
-SProcCopyPlane(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCopyPlaneReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyPlaneReq);
- swapl(&stuff->srcDrawable, n);
- swapl(&stuff->dstDrawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->bitPlane, n);
- return((* ProcVector[X_CopyPlane])(client));
-}
-
-/* The following routine is used for all Poly drawing requests
- (except FillPoly, which uses a different request format) */
-int
-SProcPoly(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xPolyPointReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPolyPointReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- SwapRestS(stuff);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-/* cannot use SProcPoly for this one, because xFillPolyReq
- is longer than xPolyPointReq, and we don't want to swap
- the difference as shorts! */
-int
-SProcFillPoly(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xFillPolyReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xFillPolyReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- SwapRestS(stuff);
- return((* ProcVector[X_FillPoly])(client));
-}
-
-int
-SProcPutImage(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xPutImageReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPutImageReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- /* Image should already be swapped */
- return((* ProcVector[X_PutImage])(client));
-
-}
-
-int
-SProcGetImage(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xGetImageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetImageReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->planeMask, n);
- return((* ProcVector[X_GetImage])(client));
-}
-
-/* ProcPolyText used for both PolyText8 and PolyText16 */
-
-int
-SProcPolyText(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xPolyTextReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-/* ProcImageText used for both ImageText8 and ImageText16 */
-
-int
-SProcImageText(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xImageTextReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xImageTextReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-int
-SProcCreateColormap(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCreateColormapReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateColormapReq);
- swapl(&stuff->mid, n);
- swapl(&stuff->window, n);
- swapl(&stuff->visual, n);
- return((* ProcVector[X_CreateColormap])(client));
-}
-
-
-int
-SProcCopyColormapAndFree(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCopyColormapAndFreeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
- swapl(&stuff->mid, n);
- swapl(&stuff->srcCmap, n);
- return((* ProcVector[X_CopyColormapAndFree])(client));
-
-}
-
-int
-SProcAllocColor (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xAllocColorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- return((* ProcVector[X_AllocColor])(client));
-}
-
-int
-SProcAllocNamedColor (client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xAllocNamedColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_AllocNamedColor])(client));
-}
-
-int
-SProcAllocColorCells (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xAllocColorCellsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorCellsReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->planes, n);
- return((* ProcVector[X_AllocColorCells])(client));
-}
-
-int
-SProcAllocColorPlanes(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xAllocColorPlanesReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- return((* ProcVector[X_AllocColorPlanes])(client));
-}
-
-int
-SProcFreeColors (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xFreeColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
- swapl(&stuff->cmap, n);
- swapl(&stuff->planeMask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_FreeColors])(client));
-
-}
-
-void
-SwapColorItem(pItem)
- xColorItem *pItem;
-{
- register char n;
-
- swapl(&pItem->pixel, n);
- swaps(&pItem->red, n);
- swaps(&pItem->green, n);
- swaps(&pItem->blue, n);
-}
-
-int
-SProcStoreColors (client)
- register ClientPtr client;
-{
- register char n;
- long count;
- xColorItem *pItem;
-
- REQUEST(xStoreColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
- swapl(&stuff->cmap, n);
- pItem = (xColorItem *) &stuff[1];
- for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
- SwapColorItem(pItem++);
- return((* ProcVector[X_StoreColors])(client));
-}
-
-int
-SProcStoreNamedColor (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xStoreNamedColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
- swapl(&stuff->cmap, n);
- swapl(&stuff->pixel, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_StoreNamedColor])(client));
-}
-
-int
-SProcQueryColors(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xQueryColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
- swapl(&stuff->cmap, n);
- SwapRestL(stuff);
- return((* ProcVector[X_QueryColors])(client));
-}
-
-int
-SProcLookupColor(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xLookupColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xLookupColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_LookupColor])(client));
-}
-
-int
-SProcCreateCursor( client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCreateCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateCursorReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->source, n);
- swapl(&stuff->mask, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[X_CreateCursor])(client));
-}
-
-int
-SProcCreateGlyphCursor( client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xCreateGlyphCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->source, n);
- swapl(&stuff->mask, n);
- swaps(&stuff->sourceChar, n);
- swaps(&stuff->maskChar, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- return((* ProcVector[X_CreateGlyphCursor])(client));
-}
-
-
-int
-SProcRecolorCursor(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xRecolorCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecolorCursorReq);
- swapl(&stuff->cursor, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- return((* ProcVector[X_RecolorCursor])(client));
-}
-
-int
-SProcQueryBestSize (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xQueryBestSizeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xQueryBestSizeReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_QueryBestSize])(client));
-
-}
-
-int
-SProcQueryExtension (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xQueryExtensionReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_QueryExtension])(client));
-}
-
-int
-SProcChangeKeyboardMapping (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangeKeyboardMappingReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeKeyboardMapping])(client));
-}
-
-
-int
-SProcChangeKeyboardControl (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangeKeyboardControlReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeKeyboardControl])(client));
-}
-
-int
-SProcChangePointerControl (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xChangePointerControlReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangePointerControlReq);
- swaps(&stuff->accelNum, n);
- swaps(&stuff->accelDenum, n);
- swaps(&stuff->threshold, n);
- return((* ProcVector[X_ChangePointerControl])(client));
-}
-
-
-int
-SProcSetScreenSaver (client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xSetScreenSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetScreenSaverReq);
- swaps(&stuff->timeout, n);
- swaps(&stuff->interval, n);
- return((* ProcVector[X_SetScreenSaver])(client));
-}
-
-int
-SProcChangeHosts(client)
- register ClientPtr client;
-{
- register char n;
-
- REQUEST(xChangeHostsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
- swaps(&stuff->hostLength, n);
- return((* ProcVector[X_ChangeHosts])(client));
-
-}
-
-int SProcRotateProperties(client)
- register ClientPtr client;
-{
- register char n;
- REQUEST(xRotatePropertiesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
- swapl(&stuff->window, n);
- swaps(&stuff->nAtoms, n);
- swaps(&stuff->nPositions, n);
- SwapRestL(stuff);
- return ((* ProcVector[X_RotateProperties])(client));
-}
-
-/*ARGSUSED*/
-int
-SProcNoOperation(client)
- ClientPtr client;
-{
- register char n;
- REQUEST(xReq);
- swaps(&stuff->length, n);
- return ((* ProcVector[X_NoOperation])(client));
-}
-
-void
-SwapConnClientPrefix(pCCP)
- xConnClientPrefix *pCCP;
-{
- register char n;
-
- swaps(&pCCP->majorVersion, n);
- swaps(&pCCP->minorVersion, n);
- swaps(&pCCP->nbytesAuthProto, n);
- swaps(&pCCP->nbytesAuthString, n);
-}
diff --git a/dix/tables.c b/dix/tables.c
deleted file mode 100644
index a76bc7535..000000000
--- a/dix/tables.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.6 2003/11/17 22:20:35 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: tables.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "windowstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "dixevents.h"
-#include "dispatch.h"
-#include "swaprep.h"
-#include "swapreq.h"
-
-#ifdef K5AUTH
-extern int
- k5_stage1(), k5_stage2(), k5_stage3(), k5_bad();
-#endif
-
-int (* InitialVector[3]) (
- ClientPtr /* client */
- ) =
-{
- 0,
- ProcInitialConnection,
- ProcEstablishConnection
-};
-
-int (* ProcVector[256]) (
- ClientPtr /* client */
- ) =
-{
- ProcBadRequest,
- ProcCreateWindow,
- ProcChangeWindowAttributes,
- ProcGetWindowAttributes,
- ProcDestroyWindow,
- ProcDestroySubwindows, /* 5 */
- ProcChangeSaveSet,
- ProcReparentWindow,
- ProcMapWindow,
- ProcMapSubwindows,
- ProcUnmapWindow, /* 10 */
- ProcUnmapSubwindows,
- ProcConfigureWindow,
- ProcCirculateWindow,
- ProcGetGeometry,
- ProcQueryTree, /* 15 */
- ProcInternAtom,
- ProcGetAtomName,
- ProcChangeProperty,
- ProcDeleteProperty,
- ProcGetProperty, /* 20 */
- ProcListProperties,
- ProcSetSelectionOwner,
- ProcGetSelectionOwner,
- ProcConvertSelection,
- ProcSendEvent, /* 25 */
- ProcGrabPointer,
- ProcUngrabPointer,
- ProcGrabButton,
- ProcUngrabButton,
- ProcChangeActivePointerGrab, /* 30 */
- ProcGrabKeyboard,
- ProcUngrabKeyboard,
- ProcGrabKey,
- ProcUngrabKey,
- ProcAllowEvents, /* 35 */
- ProcGrabServer,
- ProcUngrabServer,
- ProcQueryPointer,
- ProcGetMotionEvents,
- ProcTranslateCoords, /* 40 */
- ProcWarpPointer,
- ProcSetInputFocus,
- ProcGetInputFocus,
- ProcQueryKeymap,
- ProcOpenFont, /* 45 */
- ProcCloseFont,
- ProcQueryFont,
- ProcQueryTextExtents,
- ProcListFonts,
- ProcListFontsWithInfo, /* 50 */
- ProcSetFontPath,
- ProcGetFontPath,
- ProcCreatePixmap,
- ProcFreePixmap,
- ProcCreateGC, /* 55 */
- ProcChangeGC,
- ProcCopyGC,
- ProcSetDashes,
- ProcSetClipRectangles,
- ProcFreeGC, /* 60 */
- ProcClearToBackground,
- ProcCopyArea,
- ProcCopyPlane,
- ProcPolyPoint,
- ProcPolyLine, /* 65 */
- ProcPolySegment,
- ProcPolyRectangle,
- ProcPolyArc,
- ProcFillPoly,
- ProcPolyFillRectangle, /* 70 */
- ProcPolyFillArc,
- ProcPutImage,
- ProcGetImage,
- ProcPolyText,
- ProcPolyText, /* 75 */
- ProcImageText8,
- ProcImageText16,
- ProcCreateColormap,
- ProcFreeColormap,
- ProcCopyColormapAndFree, /* 80 */
- ProcInstallColormap,
- ProcUninstallColormap,
- ProcListInstalledColormaps,
- ProcAllocColor,
- ProcAllocNamedColor, /* 85 */
- ProcAllocColorCells,
- ProcAllocColorPlanes,
- ProcFreeColors,
- ProcStoreColors,
- ProcStoreNamedColor, /* 90 */
- ProcQueryColors,
- ProcLookupColor,
- ProcCreateCursor,
- ProcCreateGlyphCursor,
- ProcFreeCursor, /* 95 */
- ProcRecolorCursor,
- ProcQueryBestSize,
- ProcQueryExtension,
- ProcListExtensions,
- ProcChangeKeyboardMapping, /* 100 */
- ProcGetKeyboardMapping,
- ProcChangeKeyboardControl,
- ProcGetKeyboardControl,
- ProcBell,
- ProcChangePointerControl, /* 105 */
- ProcGetPointerControl,
- ProcSetScreenSaver,
- ProcGetScreenSaver,
- ProcChangeHosts,
- ProcListHosts, /* 110 */
- ProcChangeAccessControl,
- ProcChangeCloseDownMode,
- ProcKillClient,
- ProcRotateProperties,
- ProcForceScreenSaver, /* 115 */
- ProcSetPointerMapping,
- ProcGetPointerMapping,
- ProcSetModifierMapping,
- ProcGetModifierMapping,
- 0, /* 120 */
- 0,
- 0,
- 0,
- 0,
- 0, /* 125 */
- 0,
- ProcNoOperation
-};
-
-int (* SwappedProcVector[256]) (
- ClientPtr /* client */
- ) =
-{
- ProcBadRequest,
- SProcCreateWindow,
- SProcChangeWindowAttributes,
- SProcResourceReq, /* GetWindowAttributes */
- SProcResourceReq, /* DestroyWindow */
- SProcResourceReq, /* 5 DestroySubwindows */
- SProcResourceReq, /* SProcChangeSaveSet, */
- SProcReparentWindow,
- SProcResourceReq, /* MapWindow */
- SProcResourceReq, /* MapSubwindows */
- SProcResourceReq, /* 10 UnmapWindow */
- SProcResourceReq, /* UnmapSubwindows */
- SProcConfigureWindow,
- SProcResourceReq, /* SProcCirculateWindow, */
- SProcResourceReq, /* GetGeometry */
- SProcResourceReq, /* 15 QueryTree */
- SProcInternAtom,
- SProcResourceReq, /* SProcGetAtomName, */
- SProcChangeProperty,
- SProcDeleteProperty,
- SProcGetProperty, /* 20 */
- SProcResourceReq, /* SProcListProperties, */
- SProcSetSelectionOwner,
- SProcResourceReq, /* SProcGetSelectionOwner, */
- SProcConvertSelection,
- SProcSendEvent, /* 25 */
- SProcGrabPointer,
- SProcResourceReq, /* SProcUngrabPointer, */
- SProcGrabButton,
- SProcUngrabButton,
- SProcChangeActivePointerGrab, /* 30 */
- SProcGrabKeyboard,
- SProcResourceReq, /* SProcUngrabKeyboard, */
- SProcGrabKey,
- SProcUngrabKey,
- SProcResourceReq, /* 35 SProcAllowEvents, */
- SProcSimpleReq, /* SProcGrabServer, */
- SProcSimpleReq, /* SProcUngrabServer, */
- SProcResourceReq, /* SProcQueryPointer, */
- SProcGetMotionEvents,
- SProcTranslateCoords, /*40 */
- SProcWarpPointer,
- SProcSetInputFocus,
- SProcSimpleReq, /* SProcGetInputFocus, */
- SProcSimpleReq, /* QueryKeymap, */
- SProcOpenFont, /* 45 */
- SProcResourceReq, /* SProcCloseFont, */
- SProcResourceReq, /* SProcQueryFont, */
- SProcResourceReq, /* SProcQueryTextExtents, */
- SProcListFonts,
- SProcListFontsWithInfo, /* 50 */
- SProcSetFontPath,
- SProcSimpleReq, /* GetFontPath, */
- SProcCreatePixmap,
- SProcResourceReq, /* SProcFreePixmap, */
- SProcCreateGC, /* 55 */
- SProcChangeGC,
- SProcCopyGC,
- SProcSetDashes,
- SProcSetClipRectangles,
- SProcResourceReq, /* 60 SProcFreeGC, */
- SProcClearToBackground,
- SProcCopyArea,
- SProcCopyPlane,
- SProcPoly, /* PolyPoint, */
- SProcPoly, /* 65 PolyLine */
- SProcPoly, /* PolySegment, */
- SProcPoly, /* PolyRectangle, */
- SProcPoly, /* PolyArc, */
- SProcFillPoly,
- SProcPoly, /* 70 PolyFillRectangle */
- SProcPoly, /* PolyFillArc, */
- SProcPutImage,
- SProcGetImage,
- SProcPolyText,
- SProcPolyText, /* 75 */
- SProcImageText,
- SProcImageText,
- SProcCreateColormap,
- SProcResourceReq, /* SProcFreeColormap, */
- SProcCopyColormapAndFree, /* 80 */
- SProcResourceReq, /* SProcInstallColormap, */
- SProcResourceReq, /* SProcUninstallColormap, */
- SProcResourceReq, /* SProcListInstalledColormaps, */
- SProcAllocColor,
- SProcAllocNamedColor, /* 85 */
- SProcAllocColorCells,
- SProcAllocColorPlanes,
- SProcFreeColors,
- SProcStoreColors,
- SProcStoreNamedColor, /* 90 */
- SProcQueryColors,
- SProcLookupColor,
- SProcCreateCursor,
- SProcCreateGlyphCursor,
- SProcResourceReq, /* 95 SProcFreeCursor, */
- SProcRecolorCursor,
- SProcQueryBestSize,
- SProcQueryExtension,
- SProcSimpleReq, /* ListExtensions, */
- SProcChangeKeyboardMapping, /* 100 */
- SProcSimpleReq, /* GetKeyboardMapping, */
- SProcChangeKeyboardControl,
- SProcSimpleReq, /* GetKeyboardControl, */
- SProcSimpleReq, /* Bell, */
- SProcChangePointerControl, /* 105 */
- SProcSimpleReq, /* GetPointerControl, */
- SProcSetScreenSaver,
- SProcSimpleReq, /* GetScreenSaver, */
- SProcChangeHosts,
- SProcSimpleReq, /* 110 ListHosts, */
- SProcSimpleReq, /* SProcChangeAccessControl, */
- SProcSimpleReq, /* SProcChangeCloseDownMode, */
- SProcResourceReq, /* SProcKillClient, */
- SProcRotateProperties,
- SProcSimpleReq, /* 115 ForceScreenSaver */
- SProcSimpleReq, /* SetPointerMapping, */
- SProcSimpleReq, /* GetPointerMapping, */
- SProcSimpleReq, /* SetModifierMapping, */
- SProcSimpleReq, /* GetModifierMapping, */
- 0, /* 120 */
- 0,
- 0,
- 0,
- 0,
- 0, /* 125 */
- 0,
- SProcNoOperation
-};
-
-EventSwapPtr EventSwapVector[128] =
-{
- (EventSwapPtr)SErrorEvent,
- NotImplemented,
- SKeyButtonPtrEvent,
- SKeyButtonPtrEvent,
- SKeyButtonPtrEvent,
- SKeyButtonPtrEvent, /* 5 */
- SKeyButtonPtrEvent,
- SEnterLeaveEvent,
- SEnterLeaveEvent,
- SFocusEvent,
- SFocusEvent, /* 10 */
- SKeymapNotifyEvent,
- SExposeEvent,
- SGraphicsExposureEvent,
- SNoExposureEvent,
- SVisibilityEvent, /* 15 */
- SCreateNotifyEvent,
- SDestroyNotifyEvent,
- SUnmapNotifyEvent,
- SMapNotifyEvent,
- SMapRequestEvent, /* 20 */
- SReparentEvent,
- SConfigureNotifyEvent,
- SConfigureRequestEvent,
- SGravityEvent,
- SResizeRequestEvent, /* 25 */
- SCirculateEvent,
- SCirculateEvent,
- SPropertyEvent,
- SSelectionClearEvent,
- SSelectionRequestEvent, /* 30 */
- SSelectionNotifyEvent,
- SColormapEvent,
- SClientMessageEvent,
- SMappingEvent,
-};
-
-
-ReplySwapPtr ReplySwapVector[256] =
-{
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetWindowAttributesReply,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 5 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 10 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetGeometryReply,
- (ReplySwapPtr)SQueryTreeReply, /* 15 */
- (ReplySwapPtr)SInternAtomReply,
- (ReplySwapPtr)SGetAtomNameReply,
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetPropertyReply, /* 20 */
- (ReplySwapPtr)SListPropertiesReply,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetSelectionOwnerReply,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 25 */
- (ReplySwapPtr)SGenericReply, /* SGrabPointerReply, */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 30 */
- (ReplySwapPtr)SGenericReply, /* SGrabKeyboardReply, */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 35 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SQueryPointerReply,
- (ReplySwapPtr)SGetMotionEventsReply,
- (ReplySwapPtr)STranslateCoordsReply, /* 40 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetInputFocusReply,
- (ReplySwapPtr)SQueryKeymapReply,
- ReplyNotSwappd, /* 45 */
- ReplyNotSwappd,
- (ReplySwapPtr)SQueryFontReply,
- (ReplySwapPtr)SQueryTextExtentsReply,
- (ReplySwapPtr)SListFontsReply,
- (ReplySwapPtr)SListFontsWithInfoReply, /* 50 */
- ReplyNotSwappd,
- (ReplySwapPtr)SGetFontPathReply,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 55 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 60 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 65 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 70 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetImageReply,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 75 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 80 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- (ReplySwapPtr)SListInstalledColormapsReply,
- (ReplySwapPtr)SAllocColorReply,
- (ReplySwapPtr)SAllocNamedColorReply, /* 85 */
- (ReplySwapPtr)SAllocColorCellsReply,
- (ReplySwapPtr)SAllocColorPlanesReply,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 90 */
- (ReplySwapPtr)SQueryColorsReply,
- (ReplySwapPtr)SLookupColorReply,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 95 */
- ReplyNotSwappd,
- (ReplySwapPtr)SQueryBestSizeReply,
- (ReplySwapPtr)SGenericReply, /* SQueryExtensionReply, */
- (ReplySwapPtr)SListExtensionsReply,
- ReplyNotSwappd, /* 100 */
- (ReplySwapPtr)SGetKeyboardMappingReply,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetKeyboardControlReply,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 105 */
- (ReplySwapPtr)SGetPointerControlReply,
- ReplyNotSwappd,
- (ReplySwapPtr)SGetScreenSaverReply,
- ReplyNotSwappd,
- (ReplySwapPtr)SListHostsReply, /* 110 */
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd,
- ReplyNotSwappd, /* 115 */
- (ReplySwapPtr)SGenericReply, /* SetPointerMapping */
- (ReplySwapPtr)SGetPointerMappingReply,
- (ReplySwapPtr)SGenericReply, /* SetModifierMapping */
- (ReplySwapPtr)SGetModifierMappingReply, /* 119 */
- ReplyNotSwappd, /* 120 */
- ReplyNotSwappd, /* 121 */
- ReplyNotSwappd, /* 122 */
- ReplyNotSwappd, /* 123 */
- ReplyNotSwappd, /* 124 */
- ReplyNotSwappd, /* 125 */
- ReplyNotSwappd, /* 126 */
- ReplyNotSwappd, /* NoOperation */
- ReplyNotSwappd
-};
-
-#ifdef K5AUTH
-int (*k5_Vector[256])() =
-{
- k5_bad,
- k5_stage1,
- k5_bad,
- k5_stage3
-};
-#endif
diff --git a/dix/window.c b/dix/window.c
deleted file mode 100644
index 0ed9cb083..000000000
--- a/dix/window.c
+++ /dev/null
@@ -1,3853 +0,0 @@
-/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.37 2003/11/17 22:20:35 dawes Exp $ */
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "os.h"
-#include "regionstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "input.h"
-#include "resource.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "servermd.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-#include "dixevents.h"
-#include "globals.h"
-
-#ifdef XAPPGROUP
-#include "Xagsrv.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-
-/******
- * Window stuff for server
- *
- * CreateRootWindow, CreateWindow, ChangeWindowAttributes,
- * GetWindowAttributes, DeleteWindow, DestroySubWindows,
- * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows,
- * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow,
- *
- ******/
-
-static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
-static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
-
-int screenIsSaved = SCREEN_SAVER_OFF;
-
-ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
-
-#if 0
-extern void DeleteWindowFromAnyEvents();
-extern Mask EventMaskForClient();
-extern void WindowHasNewCursor();
-extern void RecalculateDeliverableEvents();
-#endif
-
-static Bool TileScreenSaver(
- int /*i*/,
- int /*kind*/
-);
-
-
-#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
- CWDontPropagate | CWOverrideRedirect | CWCursor )
-
-#define BOXES_OVERLAP(b1, b2) \
- (!( ((b1)->x2 <= (b2)->x1) || \
- ( ((b1)->x1 >= (b2)->x2)) || \
- ( ((b1)->y2 <= (b2)->y1)) || \
- ( ((b1)->y1 >= (b2)->y2)) ) )
-
-#define RedirectSend(pWin) \
- ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask)
-
-#define SubSend(pWin) \
- ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask)
-
-#define StrSend(pWin) \
- ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask)
-
-#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
-
-
-int numSaveUndersViewable = 0;
-int deltaSaveUndersViewable = 0;
-
-#ifdef DEBUG
-/******
- * PrintWindowTree
- * For debugging only
- ******/
-
-int
-PrintChildren(p1, indent)
- WindowPtr p1;
- int indent;
-{
- WindowPtr p2;
- int i;
-
- while (p1)
- {
- p2 = p1->firstChild;
- for (i=0; i<indent; i++) ErrorF( " ");
- ErrorF( "%x\n", p1->drawable.id);
- miPrintRegion(&p1->clipList);
- PrintChildren(p2, indent+4);
- p1 = p1->nextSib;
- }
-}
-
-PrintWindowTree()
-{
- int i;
- WindowPtr pWin, p1;
-
- for (i=0; i<screenInfo.numScreens; i++)
- {
- ErrorF( "WINDOW %d\n", i);
- pWin = WindowTable[i];
- miPrintRegion(&pWin->clipList);
- p1 = pWin->firstChild;
- PrintChildren(p1, 4);
- }
-}
-#endif
-
-int
-TraverseTree(pWin, func, data)
- register WindowPtr pWin;
- VisitWindowProcPtr func;
- pointer data;
-{
- register int result;
- register WindowPtr pChild;
-
- if (!(pChild = pWin))
- return(WT_NOMATCH);
- while (1)
- {
- result = (* func)(pChild, data);
- if (result == WT_STOPWALKING)
- return(WT_STOPWALKING);
- if ((result == WT_WALKCHILDREN) && pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
- return(WT_NOMATCH);
-}
-
-/*****
- * WalkTree
- * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on
- * each window. If FUNC returns WT_WALKCHILDREN, traverse the children,
- * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING
- * exit WalkTree. Does depth-first traverse.
- *****/
-
-int
-WalkTree(pScreen, func, data)
- ScreenPtr pScreen;
- VisitWindowProcPtr func;
- pointer data;
-{
- return(TraverseTree(WindowTable[pScreen->myNum], func, data));
-}
-
-/* hack for forcing backing store on all windows */
-int defaultBackingStore = NotUseful;
-/* hack to force no backing store */
-Bool disableBackingStore = FALSE;
-Bool enableBackingStore = FALSE;
-/* hack to force no save unders */
-Bool disableSaveUnders = FALSE;
-
-static void
-SetWindowToDefaults(register WindowPtr pWin)
-{
- pWin->prevSib = NullWindow;
- pWin->firstChild = NullWindow;
- pWin->lastChild = NullWindow;
-
- pWin->valdata = (ValidatePtr)NULL;
- pWin->optional = (WindowOptPtr)NULL;
- pWin->cursorIsNone = TRUE;
-
- pWin->backingStore = NotUseful;
- pWin->DIXsaveUnder = FALSE;
- pWin->backStorage = (pointer) NULL;
-
- pWin->mapped = FALSE; /* off */
- pWin->realized = FALSE; /* off */
- pWin->viewable = FALSE;
- pWin->visibility = VisibilityNotViewable;
- pWin->overrideRedirect = FALSE;
- pWin->saveUnder = FALSE;
-
- pWin->bitGravity = ForgetGravity;
- pWin->winGravity = NorthWestGravity;
-
- pWin->eventMask = 0;
- pWin->deliverableEvents = 0;
- pWin->dontPropagate = 0;
- pWin->forcedBS = FALSE;
-#ifdef NEED_DBE_BUF_BITS
- pWin->srcBuffer = DBE_FRONT_BUFFER;
- pWin->dstBuffer = DBE_FRONT_BUFFER;
-#endif
-}
-
-static void
-MakeRootTile(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- GCPtr pGC;
- unsigned char back[128];
- int len = BitmapBytePad(sizeof(long));
- register unsigned char *from, *to;
- register int i, j;
-
- pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
- pScreen->rootDepth);
-
- pWin->backgroundState = BackgroundPixmap;
- pGC = GetScratchGC(pScreen->rootDepth, pScreen);
- if (!pWin->background.pixmap || !pGC)
- FatalError("could not create root tile");
-
- {
- CARD32 attributes[2];
-
- attributes[0] = pScreen->whitePixel;
- attributes[1] = pScreen->blackPixel;
-
- (void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
- }
-
- ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
-
- from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb;
- to = back;
-
- for (i = 4; i > 0; i--, from++)
- for (j = len; j > 0; j--)
- *to++ = *from;
-
- if (blackRoot)
- bzero(back, sizeof(back));
-
- (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1,
- 0, 0, len, 4, 0, XYBitmap, (char *)back);
-
- FreeScratchGC(pGC);
-
-}
-
-WindowPtr
-AllocateWindow(pScreen)
- ScreenPtr pScreen;
-{
- WindowPtr pWin;
- register char *ptr;
- register DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- pWin = (WindowPtr)xalloc(pScreen->totalWindowSize);
- if (pWin)
- {
- ppriv = (DevUnion *)(pWin + 1);
- pWin->devPrivates = ppriv;
- sizes = pScreen->WindowPrivateSizes;
- ptr = (char *)(ppriv + pScreen->WindowPrivateLen);
- for (i = pScreen->WindowPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- }
- return pWin;
-}
-
-/*****
- * CreateRootWindow
- * Makes a window at initialization time for specified screen
- *****/
-
-Bool
-CreateRootWindow(pScreen)
- ScreenPtr pScreen;
-{
- WindowPtr pWin;
- BoxRec box;
- PixmapFormatRec *format;
-
- pWin = AllocateWindow(pScreen);
- if (!pWin)
- return FALSE;
-
- savedScreenInfo[pScreen->myNum].pWindow = NULL;
- savedScreenInfo[pScreen->myNum].wid = FakeClientID(0);
- savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
- screenIsSaved = SCREEN_SAVER_OFF;
-
- WindowTable[pScreen->myNum] = pWin;
-
- pWin->drawable.pScreen = pScreen;
- pWin->drawable.type = DRAWABLE_WINDOW;
-
- pWin->drawable.depth = pScreen->rootDepth;
- for (format = screenInfo.formats;
- format->depth != pScreen->rootDepth;
- format++)
- ;
- pWin->drawable.bitsPerPixel = format->bitsPerPixel;
-
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- pWin->parent = NullWindow;
- SetWindowToDefaults(pWin);
-
- pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec));
- if (!pWin->optional)
- return FALSE;
-
- pWin->optional->dontPropagateMask = 0;
- pWin->optional->otherEventMasks = 0;
- pWin->optional->otherClients = NULL;
- pWin->optional->passiveGrabs = NULL;
- pWin->optional->userProps = NULL;
- pWin->optional->backingBitPlanes = ~0L;
- pWin->optional->backingPixel = 0;
-#ifdef SHAPE
- pWin->optional->boundingShape = NULL;
- pWin->optional->clipShape = NULL;
-#endif
-#ifdef XINPUT
- pWin->optional->inputMasks = NULL;
-#endif
- pWin->optional->colormap = pScreen->defColormap;
- pWin->optional->visual = pScreen->rootVisual;
-
- pWin->nextSib = NullWindow;
-
- pWin->drawable.id = FakeClientID(0);
-
- pWin->origin.x = pWin->origin.y = 0;
- pWin->drawable.height = pScreen->height;
- pWin->drawable.width = pScreen->width;
- pWin->drawable.x = pWin->drawable.y = 0;
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT(pScreen, &pWin->clipList, &box, 1);
- REGION_INIT(pScreen, &pWin->winSize, &box, 1);
- REGION_INIT(pScreen, &pWin->borderSize, &box, 1);
- REGION_INIT(pScreen, &pWin->borderClip, &box, 1);
-
- pWin->drawable.class = InputOutput;
- pWin->optional->visual = pScreen->rootVisual;
-
- pWin->backgroundState = BackgroundPixel;
- pWin->background.pixel = pScreen->whitePixel;
-
- pWin->borderIsPixel = TRUE;
- pWin->border.pixel = pScreen->blackPixel;
- pWin->borderWidth = 0;
-
- if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin))
- return FALSE;
-
- if (disableBackingStore)
- pScreen->backingStoreSupport = NotUseful;
- if (enableBackingStore)
- pScreen->backingStoreSupport = Always;
-
-#ifdef DO_SAVE_UNDERS
- if ((pScreen->backingStoreSupport != NotUseful) &&
- (pScreen->saveUnderSupport == NotUseful))
- {
- /*
- * If the screen has backing-store but no save-unders, let the
- * clients know we can support save-unders using backing-store.
- */
- pScreen->saveUnderSupport = USE_DIX_SAVE_UNDERS;
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (disableSaveUnders)
- pScreen->saveUnderSupport = NotUseful;
-
- return TRUE;
-}
-
-void
-InitRootWindow(pWin)
- WindowPtr pWin;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (!(*pScreen->CreateWindow)(pWin))
- return; /* XXX */
- (*pScreen->PositionWindow)(pWin, 0, 0);
-
- pWin->cursorIsNone = FALSE;
- pWin->optional->cursor = rootCursor;
- rootCursor->refcnt++;
- MakeRootTile(pWin);
- pWin->backingStore = defaultBackingStore;
- pWin->forcedBS = (defaultBackingStore != NotUseful);
- /* We SHOULD check for an error value here XXX */
- (*pScreen->ChangeWindowAttributes)(pWin,
- CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore);
-
- MapWindow(pWin, serverClient);
-}
-
-/* Set the region to the intersection of the rectangle and the
- * window's winSize. The window is typically the parent of the
- * window from which the region came.
- */
-
-void
-ClippedRegionFromBox(pWin, Rgn, x, y, w, h)
- register WindowPtr pWin;
- RegionPtr Rgn;
- register int x, y;
- int w, h;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- BoxRec box;
-
- box = *(REGION_EXTENTS(pScreen, &pWin->winSize));
- /* we do these calculations to avoid overflows */
- if (x > box.x1)
- box.x1 = x;
- if (y > box.y1)
- box.y1 = y;
- x += w;
- if (x < box.x2)
- box.x2 = x;
- y += h;
- if (y < box.y2)
- box.y2 = y;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- REGION_RESET(pScreen, Rgn, &box);
- REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize);
-}
-
-WindowPtr
-RealChildHead(pWin)
- register WindowPtr pWin;
-{
- if (!pWin->parent &&
- (screenIsSaved == SCREEN_SAVER_ON) &&
- (HasSaverWindow (pWin->drawable.pScreen->myNum)))
- return (pWin->firstChild);
- else
- return (NullWindow);
-}
-
-/*****
- * CreateWindow
- * Makes a window in response to client request
- *****/
-
-WindowPtr
-CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist,
- depth, client, visual, error)
- Window wid;
- register WindowPtr pParent;
- int x,y;
- unsigned int w, h, bw;
- unsigned int class;
- register Mask vmask;
- XID *vlist;
- int depth;
- ClientPtr client;
- VisualID visual;
- int *error;
-{
- register WindowPtr pWin;
- WindowPtr pHead;
- register ScreenPtr pScreen;
- xEvent event;
- int idepth, ivisual;
- Bool fOK;
- DepthPtr pDepth;
- PixmapFormatRec *format;
- register WindowOptPtr ancwopt;
-
- if (class == CopyFromParent)
- class = pParent->drawable.class;
-
- if ((class != InputOutput) && (class != InputOnly))
- {
- *error = BadValue;
- client->errorValue = class;
- return NullWindow;
- }
-
- if ((class != InputOnly) && (pParent->drawable.class == InputOnly))
- {
- *error = BadMatch;
- return NullWindow;
- }
-
- if ((class == InputOnly) && ((bw != 0) || (depth != 0)))
- {
- *error = BadMatch;
- return NullWindow;
- }
-
- pScreen = pParent->drawable.pScreen;
- if ((class == InputOutput) && (depth == 0))
- depth = pParent->drawable.depth;
- ancwopt = pParent->optional;
- if (!ancwopt)
- ancwopt = FindWindowWithOptional(pParent)->optional;
- if (visual == CopyFromParent) {
-#ifdef XAPPGROUP
- VisualID ag_visual;
-
- if (client->appgroup && !pParent->parent &&
- (ag_visual = XagRootVisual (client)))
- visual = ag_visual;
- else
-#endif
- visual = ancwopt->visual;
- }
-
- /* Find out if the depth and visual are acceptable for this Screen */
- if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth))
- {
- fOK = FALSE;
- for(idepth = 0; idepth < pScreen->numDepths; idepth++)
- {
- pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
- if ((depth == pDepth->depth) || (depth == 0))
- {
- for (ivisual = 0; ivisual < pDepth->numVids; ivisual++)
- {
- if (visual == pDepth->vids[ivisual])
- {
- fOK = TRUE;
- break;
- }
- }
- }
- }
- if (fOK == FALSE)
- {
- *error = BadMatch;
- return NullWindow;
- }
- }
-
- if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
- (class != InputOnly) &&
- (depth != pParent->drawable.depth))
- {
- *error = BadMatch;
- return NullWindow;
- }
-
- if (((vmask & CWColormap) == 0) &&
- (class != InputOnly) &&
- ((visual != ancwopt->visual) || (ancwopt->colormap == None)))
- {
- *error = BadMatch;
- return NullWindow;
- }
-
- pWin = AllocateWindow(pScreen);
- if (!pWin)
- {
- *error = BadAlloc;
- return NullWindow;
- }
- pWin->drawable = pParent->drawable;
- pWin->drawable.depth = depth;
- if (depth == pParent->drawable.depth)
- pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel;
- else
- {
- for (format = screenInfo.formats; format->depth != depth; format++)
- ;
- pWin->drawable.bitsPerPixel = format->bitsPerPixel;
- }
- if (class == InputOnly)
- pWin->drawable.type = (short) UNDRAWABLE_WINDOW;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- pWin->drawable.id = wid;
- pWin->drawable.class = class;
-
- pWin->parent = pParent;
- SetWindowToDefaults(pWin);
-
- if (visual != ancwopt->visual)
- {
- if (!MakeWindowOptional (pWin))
- {
- xfree (pWin);
- *error = BadAlloc;
- return NullWindow;
- }
- pWin->optional->visual = visual;
- pWin->optional->colormap = None;
- }
-
- pWin->borderWidth = bw;
-#ifdef XCSECURITY
- /* can't let untrusted clients have background None windows;
- * they make it too easy to steal window contents
- */
- if (client->trustLevel != XSecurityClientTrusted)
- {
- pWin->backgroundState = BackgroundPixel;
- pWin->background.pixel = 0;
- }
- else
-#endif
- pWin->backgroundState = None;
-
- pWin->borderIsPixel = pParent->borderIsPixel;
- pWin->border = pParent->border;
- if (pWin->borderIsPixel == FALSE)
- pWin->border.pixmap->refcnt++;
-
- pWin->origin.x = x + (int)bw;
- pWin->origin.y = y + (int)bw;
- pWin->drawable.width = w;
- pWin->drawable.height = h;
- pWin->drawable.x = pParent->drawable.x + x + (int)bw;
- pWin->drawable.y = pParent->drawable.y + y + (int)bw;
-
- /* set up clip list correctly for unobscured WindowPtr */
- REGION_NULL(pScreen, &pWin->clipList);
- REGION_NULL(pScreen, &pWin->borderClip);
- REGION_NULL(pScreen, &pWin->winSize);
- REGION_NULL(pScreen, &pWin->borderSize);
-
- pHead = RealChildHead(pParent);
- if (pHead)
- {
- pWin->nextSib = pHead->nextSib;
- if (pHead->nextSib)
- pHead->nextSib->prevSib = pWin;
- else
- pParent->lastChild = pWin;
- pHead->nextSib = pWin;
- pWin->prevSib = pHead;
- }
- else
- {
- pWin->nextSib = pParent->firstChild;
- if (pParent->firstChild)
- pParent->firstChild->prevSib = pWin;
- else
- pParent->lastChild = pWin;
- pParent->firstChild = pWin;
- }
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- /* We SHOULD check for an error value here XXX */
- if (!(*pScreen->CreateWindow)(pWin))
- {
- *error = BadAlloc;
- DeleteWindow(pWin, None);
- return NullWindow;
- }
- /* We SHOULD check for an error value here XXX */
- (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y);
-
- if (!(vmask & CWEventMask))
- RecalculateDeliverableEvents(pWin);
-
- if (vmask)
- *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient (pWin));
- else
- *error = Success;
-
- if (*error != Success)
- {
- DeleteWindow(pWin, None);
- return NullWindow;
- }
- if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful))
- {
- XID value = defaultBackingStore;
- (void)ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient (pWin));
- pWin->forcedBS = TRUE;
- }
-
- if (SubSend(pParent))
- {
- event.u.u.type = CreateNotify;
- event.u.createNotify.window = wid;
- event.u.createNotify.parent = pParent->drawable.id;
- event.u.createNotify.x = x;
- event.u.createNotify.y = y;
- event.u.createNotify.width = w;
- event.u.createNotify.height = h;
- event.u.createNotify.borderWidth = bw;
- event.u.createNotify.override = pWin->overrideRedirect;
- DeliverEvents(pParent, &event, 1, NullWindow);
- }
- return pWin;
-}
-
-static void
-FreeWindowResources(register WindowPtr pWin)
-{
- register ScreenPtr pScreen = pWin->drawable.pScreen;
-
- DeleteWindowFromAnySaveSet(pWin);
- DeleteWindowFromAnySelections(pWin);
- DeleteWindowFromAnyEvents(pWin, TRUE);
- REGION_UNINIT(pScreen, &pWin->clipList);
- REGION_UNINIT(pScreen, &pWin->winSize);
- REGION_UNINIT(pScreen, &pWin->borderClip);
- REGION_UNINIT(pScreen, &pWin->borderSize);
-#ifdef SHAPE
- if (wBoundingShape (pWin))
- REGION_DESTROY(pScreen, wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_DESTROY(pScreen, wClipShape (pWin));
-#endif
- if (pWin->borderIsPixel == FALSE)
- (*pScreen->DestroyPixmap)(pWin->border.pixmap);
- if (pWin->backgroundState == BackgroundPixmap)
- (*pScreen->DestroyPixmap)(pWin->background.pixmap);
-
- DeleteAllWindowProperties(pWin);
- /* We SHOULD check for an error value here XXX */
- (*pScreen->DestroyWindow)(pWin);
- DisposeWindowOptional (pWin);
-}
-
-static void
-CrushTree(WindowPtr pWin)
-{
- register WindowPtr pChild, pSib, pParent;
- UnrealizeWindowProcPtr UnrealizeWindow;
- xEvent event;
-
- if (!(pChild = pWin->firstChild))
- return;
- UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow;
- while (1)
- {
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (1)
- {
- pParent = pChild->parent;
- if (SubStrSend(pChild, pParent))
- {
- event.u.u.type = DestroyNotify;
- event.u.destroyNotify.window = pChild->drawable.id;
- DeliverEvents(pChild, &event, 1, NullWindow);
- }
- FreeResource(pChild->drawable.id, RT_WINDOW);
- pSib = pChild->nextSib;
-#ifdef DO_SAVE_UNDERS
- if (pChild->saveUnder && pChild->viewable)
- deltaSaveUndersViewable--;
-#endif
- pChild->viewable = FALSE;
- if (pChild->realized)
- {
- pChild->realized = FALSE;
- (*UnrealizeWindow)(pChild);
- }
- FreeWindowResources(pChild);
- xfree(pChild);
- if ( (pChild = pSib) )
- break;
- pChild = pParent;
- pChild->firstChild = NullWindow;
- pChild->lastChild = NullWindow;
- if (pChild == pWin)
- return;
- }
- }
-}
-
-/*****
- * DeleteWindow
- * Deletes child of window then window itself
- * If wid is None, don't send any events
- *****/
-
-/*ARGSUSED*/
-int
-DeleteWindow(value, wid)
- pointer value;
- XID wid;
- {
- register WindowPtr pParent;
- register WindowPtr pWin = (WindowPtr)value;
- xEvent event;
-
- UnmapWindow(pWin, FALSE);
-
- CrushTree(pWin);
-
- pParent = pWin->parent;
- if (wid && pParent && SubStrSend(pWin, pParent))
- {
- event.u.u.type = DestroyNotify;
- event.u.destroyNotify.window = pWin->drawable.id;
- DeliverEvents(pWin, &event, 1, NullWindow);
- }
-
- FreeWindowResources(pWin);
- if (pParent)
- {
- if (pParent->firstChild == pWin)
- pParent->firstChild = pWin->nextSib;
- if (pParent->lastChild == pWin)
- pParent->lastChild = pWin->prevSib;
- if (pWin->nextSib)
- pWin->nextSib->prevSib = pWin->prevSib;
- if (pWin->prevSib)
- pWin->prevSib->nextSib = pWin->nextSib;
- }
- xfree(pWin);
- return Success;
-}
-
-/*ARGSUSED*/
-void
-DestroySubwindows(pWin, client)
- register WindowPtr pWin;
- ClientPtr client;
-{
- /* XXX
- * The protocol is quite clear that each window should be
- * destroyed in turn, however, unmapping all of the first
- * eliminates most of the calls to ValidateTree. So,
- * this implementation is incorrect in that all of the
- * UnmapNotifies occur before all of the DestroyNotifies.
- * If you care, simply delete the call to UnmapSubwindows.
- */
- UnmapSubwindows(pWin);
- while (pWin->lastChild)
- FreeResource(pWin->lastChild->drawable.id, RT_NONE);
-}
-
-#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
- ButtonReleaseMask | PointerMotionMask)
-
-/*****
- * ChangeWindowAttributes
- *
- * The value-mask specifies which attributes are to be changed; the
- * value-list contains one value for each one bit in the mask, from least
- * to most significant bit in the mask.
- *****/
-
-int
-ChangeWindowAttributes(pWin, vmask, vlist, client)
- register WindowPtr pWin;
- Mask vmask;
- XID *vlist;
- ClientPtr client;
-{
- register Mask index2;
- register XID *pVlist;
- PixmapPtr pPixmap;
- Pixmap pixID;
- CursorPtr pCursor, pOldCursor;
- Cursor cursorID;
- WindowPtr pChild;
- Colormap cmap;
- ColormapPtr pCmap;
- xEvent xE;
- int result;
- register ScreenPtr pScreen;
- Mask vmaskCopy = 0;
- register Mask tmask;
- unsigned int val;
- int error;
- Bool checkOptional = FALSE;
- Bool borderRelative = FALSE;
- WindowPtr pLayerWin;
-
- if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK)))
- return BadMatch;
-
- error = Success;
- pScreen = pWin->drawable.pScreen;
- pVlist = vlist;
- tmask = vmask;
- while (tmask)
- {
- index2 = (Mask) lowbit (tmask);
- tmask &= ~index2;
- switch (index2)
- {
- case CWBackPixmap:
- pixID = (Pixmap )*pVlist;
- pVlist++;
- if (pWin->backgroundState == ParentRelative)
- borderRelative = TRUE;
- if (pixID == None)
- {
-#ifdef XCSECURITY
- /* can't let untrusted clients have background None windows */
- if (client->trustLevel == XSecurityClientTrusted)
- {
-#endif
- if (pWin->backgroundState == BackgroundPixmap)
- (*pScreen->DestroyPixmap)(pWin->background.pixmap);
- if (!pWin->parent)
- MakeRootTile(pWin);
- else
- pWin->backgroundState = None;
-#ifdef XCSECURITY
- }
- else
- { /* didn't change the background to None, so don't tell ddx */
- index2 = 0;
- }
-#endif
- }
- else if (pixID == ParentRelative)
- {
- if (pWin->parent &&
- pWin->drawable.depth != pWin->parent->drawable.depth)
- {
- error = BadMatch;
- goto PatchUp;
- }
- if (pWin->backgroundState == BackgroundPixmap)
- (*pScreen->DestroyPixmap)(pWin->background.pixmap);
- if (!pWin->parent)
- MakeRootTile(pWin);
- else
- pWin->backgroundState = ParentRelative;
- borderRelative = TRUE;
- /* Note that the parent's backgroundTile's refcnt is NOT
- * incremented. */
- }
- else
- {
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
- RT_PIXMAP, SecurityReadAccess);
- if (pPixmap != (PixmapPtr) NULL)
- {
- if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- error = BadMatch;
- goto PatchUp;
- }
- if (pWin->backgroundState == BackgroundPixmap)
- (*pScreen->DestroyPixmap)(pWin->background.pixmap);
- pWin->backgroundState = BackgroundPixmap;
- pWin->background.pixmap = pPixmap;
- pPixmap->refcnt++;
- }
- else
- {
- error = BadPixmap;
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBackPixel:
- if (pWin->backgroundState == ParentRelative)
- borderRelative = TRUE;
- if (pWin->backgroundState == BackgroundPixmap)
- (*pScreen->DestroyPixmap)(pWin->background.pixmap);
- pWin->backgroundState = BackgroundPixel;
- pWin->background.pixel = (CARD32 ) *pVlist;
- /* background pixel overrides background pixmap,
- so don't let the ddx layer see both bits */
- vmaskCopy &= ~CWBackPixmap;
- pVlist++;
- break;
- case CWBorderPixmap:
- pixID = (Pixmap ) *pVlist;
- pVlist++;
- if (pixID == CopyFromParent)
- {
- if (!pWin->parent ||
- (pWin->drawable.depth != pWin->parent->drawable.depth))
- {
- error = BadMatch;
- goto PatchUp;
- }
- if (pWin->borderIsPixel == FALSE)
- (*pScreen->DestroyPixmap)(pWin->border.pixmap);
- pWin->border = pWin->parent->border;
- if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE)
- {
- index2 = CWBorderPixel;
- }
- else
- {
- pWin->parent->border.pixmap->refcnt++;
- }
- }
- else
- {
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID,
- RT_PIXMAP, SecurityReadAccess);
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- error = BadMatch;
- goto PatchUp;
- }
- if (pWin->borderIsPixel == FALSE)
- (*pScreen->DestroyPixmap)(pWin->border.pixmap);
- pWin->borderIsPixel = FALSE;
- pWin->border.pixmap = pPixmap;
- pPixmap->refcnt++;
- }
- else
- {
- error = BadPixmap;
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBorderPixel:
- if (pWin->borderIsPixel == FALSE)
- (*pScreen->DestroyPixmap)(pWin->border.pixmap);
- pWin->borderIsPixel = TRUE;
- pWin->border.pixel = (CARD32) *pVlist;
- /* border pixel overrides border pixmap,
- so don't let the ddx layer see both bits */
- vmaskCopy &= ~CWBorderPixmap;
- pVlist++;
- break;
- case CWBitGravity:
- val = (CARD8 )*pVlist;
- pVlist++;
- if (val > StaticGravity)
- {
- error = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- pWin->bitGravity = val;
- break;
- case CWWinGravity:
- val = (CARD8 )*pVlist;
- pVlist++;
- if (val > StaticGravity)
- {
- error = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- pWin->winGravity = val;
- break;
- case CWBackingStore:
- val = (CARD8 )*pVlist;
- pVlist++;
- if ((val != NotUseful) && (val != WhenMapped) && (val != Always))
- {
- error = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- pWin->backingStore = val;
- pWin->forcedBS = FALSE;
- break;
- case CWBackingPlanes:
- if (pWin->optional || ((CARD32)*pVlist != (CARD32)~0L)) {
- if (!pWin->optional && !MakeWindowOptional (pWin))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- pWin->optional->backingBitPlanes = (CARD32) *pVlist;
- if ((CARD32)*pVlist == (CARD32)~0L)
- checkOptional = TRUE;
- }
- pVlist++;
- break;
- case CWBackingPixel:
- if (pWin->optional || (CARD32) *pVlist) {
- if (!pWin->optional && !MakeWindowOptional (pWin))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- pWin->optional->backingPixel = (CARD32) *pVlist;
- if (!*pVlist)
- checkOptional = TRUE;
- }
- pVlist++;
- break;
- case CWSaveUnder:
- val = (BOOL) *pVlist;
- pVlist++;
- if ((val != xTrue) && (val != xFalse))
- {
- error = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
-#ifdef DO_SAVE_UNDERS
- if (pWin->parent && (pWin->saveUnder != val) && (pWin->viewable) &&
- DO_SAVE_UNDERS(pWin))
- {
- /*
- * Re-check all siblings and inferiors for obscurity or
- * exposition (hee hee).
- */
- if (pWin->saveUnder)
- deltaSaveUndersViewable--;
- else
- deltaSaveUndersViewable++;
- pWin->saveUnder = val;
-
- if (pWin->firstChild)
- {
- pLayerWin = (*pScreen->GetLayerWindow)(pWin);
- if ((*pScreen->ChangeSaveUnder)(pLayerWin->parent, pWin->nextSib))
- (*pScreen->PostChangeSaveUnder)(pLayerWin->parent,
- pWin->nextSib);
- }
- else
- {
- if ((*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib))
- (*pScreen->PostChangeSaveUnder)(pWin,
- pWin->nextSib);
- }
- }
- else
- {
- /* If we're changing the saveUnder attribute of the root
- * window, all we do is set pWin->saveUnder so that
- * GetWindowAttributes returns the right value. We don't
- * do the "normal" save-under processing (as above).
- * Hope that doesn't cause any problems.
- */
- pWin->saveUnder = val;
- }
-#else
- pWin->saveUnder = val;
-#endif /* DO_SAVE_UNDERS */
- break;
- case CWEventMask:
- result = EventSelectForWindow(pWin, client, (Mask )*pVlist);
- if (result)
- {
- error = result;
- goto PatchUp;
- }
- pVlist++;
- break;
- case CWDontPropagate:
- result = EventSuppressForWindow(pWin, client, (Mask )*pVlist,
- &checkOptional);
- if (result)
- {
- error = result;
- goto PatchUp;
- }
- pVlist++;
- break;
- case CWOverrideRedirect:
- val = (BOOL ) *pVlist;
- pVlist++;
- if ((val != xTrue) && (val != xFalse))
- {
- error = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- pWin->overrideRedirect = val;
- break;
- case CWColormap:
- cmap = (Colormap) *pVlist;
- pVlist++;
- if (cmap == CopyFromParent)
- {
-#ifdef XAPPGROUP
- Colormap ag_colormap;
- ClientPtr win_owner;
-
- /*
- * win_owner == client for CreateWindow, other clients
- * can ChangeWindowAttributes
- */
- win_owner = clients[CLIENT_ID(pWin->drawable.id)];
-
- if ( win_owner && win_owner->appgroup &&
- !pWin->parent->parent &&
- (ag_colormap = XagDefaultColormap (win_owner)))
- cmap = ag_colormap;
- else
-#endif
- if (pWin->parent &&
- (!pWin->optional ||
- pWin->optional->visual == wVisual (pWin->parent)))
- {
- cmap = wColormap (pWin->parent);
- }
- else
- cmap = None;
- }
- if (cmap == None)
- {
- error = BadMatch;
- goto PatchUp;
- }
- pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap,
- RT_COLORMAP, SecurityReadAccess);
- if (!pCmap)
- {
- error = BadColor;
- client->errorValue = cmap;
- goto PatchUp;
- }
- if (pCmap->pVisual->vid != wVisual (pWin) ||
- pCmap->pScreen != pScreen)
- {
- error = BadMatch;
- goto PatchUp;
- }
- if (cmap != wColormap (pWin))
- {
- if (!pWin->optional)
- {
- if (!MakeWindowOptional (pWin))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- }
- else if (pWin->parent && cmap == wColormap (pWin->parent))
- checkOptional = TRUE;
-
- /*
- * propagate the original colormap to any children
- * inheriting it
- */
-
- for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib)
- {
- if (!pChild->optional && !MakeWindowOptional (pChild))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- }
-
- pWin->optional->colormap = cmap;
-
- /*
- * check on any children now matching the new colormap
- */
-
- for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib)
- {
- if (pChild->optional->colormap == cmap)
- CheckWindowOptionalNeed (pChild);
- }
-
- xE.u.u.type = ColormapNotify;
- xE.u.colormap.window = pWin->drawable.id;
- xE.u.colormap.colormap = cmap;
- xE.u.colormap.new = xTrue;
- xE.u.colormap.state = IsMapInstalled(cmap, pWin);
- DeliverEvents(pWin, &xE, 1, NullWindow);
- }
- break;
- case CWCursor:
- cursorID = (Cursor ) *pVlist;
- pVlist++;
- /*
- * install the new
- */
- if ( cursorID == None)
- {
- if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
- pCursor = rootCursor;
- else
- pCursor = (CursorPtr) None;
- }
- else
- {
- pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID,
- RT_CURSOR, SecurityReadAccess);
- if (!pCursor)
- {
- error = BadCursor;
- client->errorValue = cursorID;
- goto PatchUp;
- }
- }
-
- if (pCursor != wCursor (pWin))
- {
- /*
- * patch up child windows so they don't lose cursors.
- */
-
- for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib)
- {
- if (!pChild->optional && !pChild->cursorIsNone &&
- !MakeWindowOptional (pChild))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- }
-
- pOldCursor = 0;
- if (pCursor == (CursorPtr) None)
- {
- pWin->cursorIsNone = TRUE;
- if (pWin->optional)
- {
- pOldCursor = pWin->optional->cursor;
- pWin->optional->cursor = (CursorPtr) None;
- checkOptional = TRUE;
- }
- } else {
- if (!pWin->optional)
- {
- if (!MakeWindowOptional (pWin))
- {
- error = BadAlloc;
- goto PatchUp;
- }
- }
- else if (pWin->parent && pCursor == wCursor (pWin->parent))
- checkOptional = TRUE;
- pOldCursor = pWin->optional->cursor;
- pWin->optional->cursor = pCursor;
- pCursor->refcnt++;
- pWin->cursorIsNone = FALSE;
- /*
- * check on any children now matching the new cursor
- */
-
- for (pChild=pWin->firstChild; pChild; pChild=pChild->nextSib)
- {
- if (pChild->optional &&
- (pChild->optional->cursor == pCursor))
- CheckWindowOptionalNeed (pChild);
- }
- }
-
- if (pWin->realized)
- WindowHasNewCursor( pWin);
-
- /* Can't free cursor until here - old cursor
- * is needed in WindowHasNewCursor
- */
- if (pOldCursor)
- FreeCursor (pOldCursor, (Cursor)0);
- }
- break;
- default:
- error = BadValue;
- client->errorValue = vmask;
- goto PatchUp;
- }
- vmaskCopy |= index2;
- }
-PatchUp:
- if (checkOptional)
- CheckWindowOptionalNeed (pWin);
-
- /* We SHOULD check for an error value here XXX */
- (*pScreen->ChangeWindowAttributes)(pWin, vmaskCopy);
-
- /*
- If the border contents have changed, redraw the border.
- Note that this has to be done AFTER pScreen->ChangeWindowAttributes
- for the tile to be rotated, and the correct function selected.
- */
- if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative)
- && pWin->viewable && HasBorder (pWin))
- {
- RegionRec exposed;
-
- REGION_NULL(pScreen, &exposed);
- REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize);
- (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER);
- REGION_UNINIT(pScreen, &exposed);
- }
- return error;
-}
-
-
-/*****
- * GetWindowAttributes
- * Notice that this is different than ChangeWindowAttributes
- *****/
-
-void
-GetWindowAttributes(pWin, client, wa)
- register WindowPtr pWin;
- ClientPtr client;
- xGetWindowAttributesReply *wa;
-{
- wa->type = X_Reply;
- wa->bitGravity = pWin->bitGravity;
- wa->winGravity = pWin->winGravity;
- if (pWin->forcedBS && pWin->backingStore != Always)
- wa->backingStore = NotUseful;
- else
- wa->backingStore = pWin->backingStore;
- wa->length = (sizeof(xGetWindowAttributesReply) -
- sizeof(xGenericReply)) >> 2;
- wa->sequenceNumber = client->sequence;
- wa->backingBitPlanes = wBackingBitPlanes (pWin);
- wa->backingPixel = wBackingPixel (pWin);
- wa->saveUnder = (BOOL)pWin->saveUnder;
- wa->override = pWin->overrideRedirect;
- if (!pWin->mapped)
- wa->mapState = IsUnmapped;
- else if (pWin->realized)
- wa->mapState = IsViewable;
- else
- wa->mapState = IsUnviewable;
-
- wa->colormap = wColormap (pWin);
- wa->mapInstalled = (wa->colormap == None) ? xFalse
- : IsMapInstalled(wa->colormap, pWin);
-
- wa->yourEventMask = EventMaskForClient(pWin, client);
- wa->allEventMasks = pWin->eventMask | wOtherEventMasks (pWin);
- wa->doNotPropagateMask = wDontPropagateMask (pWin);
- wa->class = pWin->drawable.class;
- wa->visualID = wVisual (pWin);
-}
-
-
-WindowPtr
-MoveWindowInStack(pWin, pNextSib)
- register WindowPtr pWin, pNextSib;
-{
- register WindowPtr pParent = pWin->parent;
- WindowPtr pFirstChange = pWin; /* highest window where list changes */
-
- if (pWin->nextSib != pNextSib)
- {
- WindowPtr pOldNextSib = pWin->nextSib;
-
- if (!pNextSib) /* move to bottom */
- {
- if (pParent->firstChild == pWin)
- pParent->firstChild = pWin->nextSib;
- /* if (pWin->nextSib) */ /* is always True: pNextSib == NULL
- * and pWin->nextSib != pNextSib
- * therefore pWin->nextSib != NULL */
- pFirstChange = pWin->nextSib;
- pWin->nextSib->prevSib = pWin->prevSib;
- if (pWin->prevSib)
- pWin->prevSib->nextSib = pWin->nextSib;
- pParent->lastChild->nextSib = pWin;
- pWin->prevSib = pParent->lastChild;
- pWin->nextSib = NullWindow;
- pParent->lastChild = pWin;
- }
- else if (pParent->firstChild == pNextSib) /* move to top */
- {
- pFirstChange = pWin;
- if (pParent->lastChild == pWin)
- pParent->lastChild = pWin->prevSib;
- if (pWin->nextSib)
- pWin->nextSib->prevSib = pWin->prevSib;
- if (pWin->prevSib)
- pWin->prevSib->nextSib = pWin->nextSib;
- pWin->nextSib = pParent->firstChild;
- pWin->prevSib = (WindowPtr ) NULL;
- pNextSib->prevSib = pWin;
- pParent->firstChild = pWin;
- }
- else /* move in middle of list */
- {
- WindowPtr pOldNext = pWin->nextSib;
-
- pFirstChange = NullWindow;
- if (pParent->firstChild == pWin)
- pFirstChange = pParent->firstChild = pWin->nextSib;
- if (pParent->lastChild == pWin) {
- pFirstChange = pWin;
- pParent->lastChild = pWin->prevSib;
- }
- if (pWin->nextSib)
- pWin->nextSib->prevSib = pWin->prevSib;
- if (pWin->prevSib)
- pWin->prevSib->nextSib = pWin->nextSib;
- pWin->nextSib = pNextSib;
- pWin->prevSib = pNextSib->prevSib;
- if (pNextSib->prevSib)
- pNextSib->prevSib->nextSib = pWin;
- pNextSib->prevSib = pWin;
- if (!pFirstChange) { /* do we know it yet? */
- pFirstChange = pParent->firstChild; /* no, search from top */
- while ((pFirstChange != pWin) && (pFirstChange != pOldNext))
- pFirstChange = pFirstChange->nextSib;
- }
- }
- if(pWin->drawable.pScreen->RestackWindow)
- (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib);
- }
-
-#ifdef ROOTLESS
- /*
- * In rootless mode we can't optimize away window restacks.
- * There may be non-X windows around, so even if the window
- * is in the correct position from X's point of view,
- * the underlying window system may want to reorder it.
- */
- else if (pWin->drawable.pScreen->RestackWindow)
- (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib);
-#endif
-
- return( pFirstChange );
-}
-
-RegionPtr
-CreateUnclippedWinSize (pWin)
- register WindowPtr pWin;
-{
- RegionPtr pRgn;
- BoxRec box;
-
- box.x1 = pWin->drawable.x;
- box.y1 = pWin->drawable.y;
- box.x2 = pWin->drawable.x + (int) pWin->drawable.width;
- box.y2 = pWin->drawable.y + (int) pWin->drawable.height;
- pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
-#ifdef SHAPE
- if (wBoundingShape (pWin) || wClipShape (pWin)) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x,
- - pWin->drawable.y);
- if (wBoundingShape (pWin))
- REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin));
- REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y);
- }
-#endif
- return pRgn;
-}
-
-void
-SetWinSize (pWin)
- register WindowPtr pWin;
-{
- ClippedRegionFromBox(pWin->parent, &pWin->winSize,
- pWin->drawable.x, pWin->drawable.y,
- (int)pWin->drawable.width,
- (int)pWin->drawable.height);
-#ifdef SHAPE
- if (wBoundingShape (pWin) || wClipShape (pWin)) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x,
- - pWin->drawable.y);
- if (wBoundingShape (pWin))
- REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize,
- wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize,
- wClipShape (pWin));
- REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x,
- pWin->drawable.y);
- }
-#endif
-}
-
-void
-SetBorderSize (pWin)
- register WindowPtr pWin;
-{
- int bw;
-
- if (HasBorder (pWin)) {
- bw = wBorderWidth (pWin);
- ClippedRegionFromBox(pWin->parent, &pWin->borderSize,
- pWin->drawable.x - bw, pWin->drawable.y - bw,
- (int)(pWin->drawable.width + (bw<<1)),
- (int)(pWin->drawable.height + (bw<<1)));
-#ifdef SHAPE
- if (wBoundingShape (pWin)) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x,
- - pWin->drawable.y);
- REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize,
- wBoundingShape (pWin));
- REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x,
- pWin->drawable.y);
- REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize,
- &pWin->winSize);
- }
-#endif
- } else {
- REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize,
- &pWin->winSize);
- }
-}
-
-void
-GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty)
- register int x, y; /* new window position */
- int oldx, oldy; /* old window position */
- int dw, dh;
- unsigned gravity;
- register int *destx, *desty; /* position relative to gravity */
-{
- switch (gravity) {
- case NorthGravity:
- *destx = x + dw / 2;
- *desty = y;
- break;
- case NorthEastGravity:
- *destx = x + dw;
- *desty = y;
- break;
- case WestGravity:
- *destx = x;
- *desty = y + dh / 2;
- break;
- case CenterGravity:
- *destx = x + dw / 2;
- *desty = y + dh / 2;
- break;
- case EastGravity:
- *destx = x + dw;
- *desty = y + dh / 2;
- break;
- case SouthWestGravity:
- *destx = x;
- *desty = y + dh;
- break;
- case SouthGravity:
- *destx = x + dw / 2;
- *desty = y + dh;
- break;
- case SouthEastGravity:
- *destx = x + dw;
- *desty = y + dh;
- break;
- case StaticGravity:
- *destx = oldx;
- *desty = oldy;
- break;
- default:
- *destx = x;
- *desty = y;
- break;
- }
-}
-
-/* XXX need to retile border on each window with ParentRelative origin */
-void
-ResizeChildrenWinSize(pWin, dx, dy, dw, dh)
- register WindowPtr pWin;
- int dx, dy, dw, dh;
-{
- register ScreenPtr pScreen;
- register WindowPtr pSib, pChild;
- Bool resized = (dw || dh);
-
- pScreen = pWin->drawable.pScreen;
-
- for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib)
- {
- if (resized && (pSib->winGravity > NorthWestGravity))
- {
- int cwsx, cwsy;
-
- cwsx = pSib->origin.x;
- cwsy = pSib->origin.y;
- GravityTranslate (cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh,
- pSib->winGravity, &cwsx, &cwsy);
- if (cwsx != pSib->origin.x || cwsy != pSib->origin.y)
- {
- xEvent event;
-
- event.u.u.type = GravityNotify;
- event.u.gravity.window = pSib->drawable.id;
- event.u.gravity.x = cwsx - wBorderWidth (pSib);
- event.u.gravity.y = cwsy - wBorderWidth (pSib);
- DeliverEvents (pSib, &event, 1, NullWindow);
- pSib->origin.x = cwsx;
- pSib->origin.y = cwsy;
- }
- }
- pSib->drawable.x = pWin->drawable.x + pSib->origin.x;
- pSib->drawable.y = pWin->drawable.y + pSib->origin.y;
- SetWinSize (pSib);
- SetBorderSize (pSib);
- (*pScreen->PositionWindow)(pSib, pSib->drawable.x, pSib->drawable.y);
-
- if ( (pChild = pSib->firstChild) )
- {
- while (1)
- {
- pChild->drawable.x = pChild->parent->drawable.x +
- pChild->origin.x;
- pChild->drawable.y = pChild->parent->drawable.y +
- pChild->origin.y;
- SetWinSize (pChild);
- SetBorderSize (pChild);
- (*pScreen->PositionWindow)(pChild,
- pChild->drawable.x, pChild->drawable.y);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (!pChild->nextSib && (pChild != pSib))
- pChild = pChild->parent;
- if (pChild == pSib)
- break;
- pChild = pChild->nextSib;
- }
- }
- }
-}
-
-#define GET_INT16(m, f) \
- if (m & mask) \
- { \
- f = (INT16) *pVlist;\
- pVlist++; \
- }
-#define GET_CARD16(m, f) \
- if (m & mask) \
- { \
- f = (CARD16) *pVlist;\
- pVlist++;\
- }
-
-#define GET_CARD8(m, f) \
- if (m & mask) \
- { \
- f = (CARD8) *pVlist;\
- pVlist++;\
- }
-
-#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight))
-
-#define IllegalInputOnlyConfigureMask (CWBorderWidth)
-
-/*
- * IsSiblingAboveMe
- * returns Above if pSib above pMe in stack or Below otherwise
- */
-
-static int
-IsSiblingAboveMe(
- register WindowPtr pMe,
- register WindowPtr pSib)
-{
- register WindowPtr pWin;
-
- pWin = pMe->parent->firstChild;
- while (pWin)
- {
- if (pWin == pSib)
- return(Above);
- else if (pWin == pMe)
- return(Below);
- pWin = pWin->nextSib;
- }
- return(Below);
-}
-
-static BoxPtr
-WindowExtents(
- register WindowPtr pWin,
- register BoxPtr pBox)
-{
- pBox->x1 = pWin->drawable.x - wBorderWidth (pWin);
- pBox->y1 = pWin->drawable.y - wBorderWidth (pWin);
- pBox->x2 = pWin->drawable.x + (int)pWin->drawable.width
- + wBorderWidth (pWin);
- pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height
- + wBorderWidth (pWin);
- return(pBox);
-}
-
-#ifdef SHAPE
-#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL)
-
-static RegionPtr
-MakeBoundingRegion (
- register WindowPtr pWin,
- BoxPtr pBox)
-{
- RegionPtr pRgn;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- pRgn = REGION_CREATE(pScreen, pBox, 1);
- if (wBoundingShape (pWin)) {
- REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x,
- -pWin->origin.y);
- REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin));
- REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x,
- pWin->origin.y);
- }
- return pRgn;
-}
-
-static Bool
-ShapeOverlap (
- WindowPtr pWin,
- BoxPtr pWinBox,
- WindowPtr pSib,
- BoxPtr pSibBox)
-{
- RegionPtr pWinRgn, pSibRgn;
- register ScreenPtr pScreen;
- Bool ret;
-
- if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib))
- return TRUE;
- pScreen = pWin->drawable.pScreen;
- pWinRgn = MakeBoundingRegion (pWin, pWinBox);
- pSibRgn = MakeBoundingRegion (pSib, pSibBox);
- REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn);
- ret = REGION_NOTEMPTY(pScreen, pWinRgn);
- REGION_DESTROY(pScreen, pWinRgn);
- REGION_DESTROY(pScreen, pSibRgn);
- return ret;
-}
-#endif
-
-static Bool
-AnyWindowOverlapsMe(
- WindowPtr pWin,
- WindowPtr pHead,
- register BoxPtr box)
-{
- register WindowPtr pSib;
- BoxRec sboxrec;
- register BoxPtr sbox;
-
- for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib)
- {
- if (pSib->mapped)
- {
- sbox = WindowExtents(pSib, &sboxrec);
- if (BOXES_OVERLAP(sbox, box)
-#ifdef SHAPE
- && ShapeOverlap (pWin, box, pSib, sbox)
-#endif
- )
- return(TRUE);
- }
- }
- return(FALSE);
-}
-
-static Bool
-IOverlapAnyWindow(
- WindowPtr pWin,
- register BoxPtr box)
-{
- register WindowPtr pSib;
- BoxRec sboxrec;
- register BoxPtr sbox;
-
- for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib)
- {
- if (pSib->mapped)
- {
- sbox = WindowExtents(pSib, &sboxrec);
- if (BOXES_OVERLAP(sbox, box)
-#ifdef SHAPE
- && ShapeOverlap (pWin, box, pSib, sbox)
-#endif
- )
- return(TRUE);
- }
- }
- return(FALSE);
-}
-
-/*
- * WhereDoIGoInTheStack()
- * Given pWin and pSib and the relationshipe smode, return
- * the window that pWin should go ABOVE.
- * If a pSib is specified:
- * Above: pWin is placed just above pSib
- * Below: pWin is placed just below pSib
- * TopIf: if pSib occludes pWin, then pWin is placed
- * at the top of the stack
- * BottomIf: if pWin occludes pSib, then pWin is
- * placed at the bottom of the stack
- * Opposite: if pSib occludes pWin, then pWin is placed at the
- * top of the stack, else if pWin occludes pSib, then
- * pWin is placed at the bottom of the stack
- *
- * If pSib is NULL:
- * Above: pWin is placed at the top of the stack
- * Below: pWin is placed at the bottom of the stack
- * TopIf: if any sibling occludes pWin, then pWin is placed at
- * the top of the stack
- * BottomIf: if pWin occludes any sibline, then pWin is placed at
- * the bottom of the stack
- * Opposite: if any sibling occludes pWin, then pWin is placed at
- * the top of the stack, else if pWin occludes any
- * sibling, then pWin is placed at the bottom of the stack
- *
- */
-
-static WindowPtr
-WhereDoIGoInTheStack(
- register WindowPtr pWin,
- register WindowPtr pSib,
- short x,
- short y,
- unsigned short w,
- unsigned short h,
- int smode)
-{
- BoxRec box;
- register ScreenPtr pScreen;
- WindowPtr pHead, pFirst;
-
- if ((pWin == pWin->parent->firstChild) &&
- (pWin == pWin->parent->lastChild))
- return((WindowPtr ) NULL);
- pHead = RealChildHead(pWin->parent);
- pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild;
- pScreen = pWin->drawable.pScreen;
- box.x1 = x;
- box.y1 = y;
- box.x2 = x + (int)w;
- box.y2 = y + (int)h;
- switch (smode)
- {
- case Above:
- if (pSib)
- return(pSib);
- else if (pWin == pFirst)
- return(pWin->nextSib);
- else
- return(pFirst);
- case Below:
- if (pSib)
- if (pSib->nextSib != pWin)
- return(pSib->nextSib);
- else
- return(pWin->nextSib);
- else
- return NullWindow;
- case TopIf:
- if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs)
- return(pWin->nextSib);
- else if (pSib)
- {
- if ((IsSiblingAboveMe(pWin, pSib) == Above) &&
- (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT))
- return(pFirst);
- else
- return(pWin->nextSib);
- }
- else if (AnyWindowOverlapsMe(pWin, pHead, &box))
- return(pFirst);
- else
- return(pWin->nextSib);
- case BottomIf:
- if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs)
- return(pWin->nextSib);
- else if (pSib)
- {
- if ((IsSiblingAboveMe(pWin, pSib) == Below) &&
- (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT))
- return NullWindow;
- else
- return(pWin->nextSib);
- }
- else if (IOverlapAnyWindow(pWin, &box))
- return NullWindow;
- else
- return(pWin->nextSib);
- case Opposite:
- if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs)
- return(pWin->nextSib);
- else if (pSib)
- {
- if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)
- {
- if (IsSiblingAboveMe(pWin, pSib) == Above)
- return(pFirst);
- else
- return NullWindow;
- }
- else
- return(pWin->nextSib);
- }
- else if (AnyWindowOverlapsMe(pWin, pHead, &box))
- {
- /* If I'm occluded, I can't possibly be the first child
- * if (pWin == pWin->parent->firstChild)
- * return pWin->nextSib;
- */
- return(pFirst);
- }
- else if (IOverlapAnyWindow(pWin, &box))
- return NullWindow;
- else
- return pWin->nextSib;
- default:
- {
- ErrorF("Internal error in ConfigureWindow, smode == %d\n",smode );
- return pWin->nextSib;
- }
- }
-}
-
-static void
-ReflectStackChange(
- register WindowPtr pWin,
- register WindowPtr pSib,
- VTKind kind)
-{
-/* Note that pSib might be NULL */
-
- Bool WasViewable = (Bool)pWin->viewable;
- Bool anyMarked;
- WindowPtr pFirstChange;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- /* if this is a root window, can't be restacked */
- if (!pWin->parent)
- return;
-
- pFirstChange = MoveWindowInStack(pWin, pSib);
-
- if (WasViewable)
- {
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange,
- &pLayerWin);
- if (pLayerWin != pWin) pFirstChange = pLayerWin;
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange);
- }
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked)
- {
- (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, kind);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pWin->drawable.pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, kind);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-/*****
- * ConfigureWindow
- *****/
-
-int
-ConfigureWindow(pWin, mask, vlist, client)
- register WindowPtr pWin;
- register Mask mask;
- XID *vlist;
- ClientPtr client;
-{
-#define RESTACK_WIN 0
-#define MOVE_WIN 1
-#define RESIZE_WIN 2
-#define REBORDER_WIN 3
- register WindowPtr pSib = NullWindow;
- register WindowPtr pParent = pWin->parent;
- Window sibwid = 0;
- Mask index2, tmask;
- register XID *pVlist;
- short x, y, beforeX, beforeY;
- unsigned short w = pWin->drawable.width,
- h = pWin->drawable.height,
- bw = pWin->borderWidth;
- int action, smode = Above;
-#ifdef XAPPGROUP
- ClientPtr win_owner;
- ClientPtr ag_leader = NULL;
-#endif
- xEvent event;
-
- if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask))
- return(BadMatch);
-
- if ((mask & CWSibling) && !(mask & CWStackMode))
- return(BadMatch);
-
- pVlist = vlist;
-
- if (pParent)
- {
- x = pWin->drawable.x - pParent->drawable.x - (int)bw;
- y = pWin->drawable.y - pParent->drawable.y - (int)bw;
- }
- else
- {
- x = pWin->drawable.x;
- y = pWin->drawable.y;
- }
- beforeX = x;
- beforeY = y;
- action = RESTACK_WIN;
- if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth))))
- {
- GET_INT16(CWX, x);
- GET_INT16(CWY, y);
- action = MOVE_WIN;
- }
- /* or should be resized */
- else if (mask & (CWX | CWY | CWWidth | CWHeight))
- {
- GET_INT16(CWX, x);
- GET_INT16(CWY, y);
- GET_CARD16(CWWidth, w);
- GET_CARD16 (CWHeight, h);
- if (!w || !h)
- {
- client->errorValue = 0;
- return BadValue;
- }
- action = RESIZE_WIN;
- }
- tmask = mask & ~ChangeMask;
- while (tmask)
- {
- index2 = (Mask)lowbit (tmask);
- tmask &= ~index2;
- switch (index2)
- {
- case CWBorderWidth:
- GET_CARD16(CWBorderWidth, bw);
- break;
- case CWSibling:
- sibwid = (Window ) *pVlist;
- pVlist++;
- pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid,
- RT_WINDOW, SecurityReadAccess);
- if (!pSib)
- {
- client->errorValue = sibwid;
- return(BadWindow);
- }
- if (pSib->parent != pParent)
- return(BadMatch);
- if (pSib == pWin)
- return(BadMatch);
- break;
- case CWStackMode:
- GET_CARD8(CWStackMode, smode);
- if ((smode != TopIf) && (smode != BottomIf) &&
- (smode != Opposite) && (smode != Above) && (smode != Below))
- {
- client->errorValue = smode;
- return(BadValue);
- }
- break;
- default:
- client->errorValue = mask;
- return(BadValue);
- }
- }
- /* root really can't be reconfigured, so just return */
- if (!pParent)
- return Success;
-
- /* Figure out if the window should be moved. Doesnt
- make the changes to the window if event sent */
-
- if (mask & CWStackMode)
- pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x,
- pParent->drawable.y + y,
- w + (bw << 1), h + (bw << 1), smode);
- else
- pSib = pWin->nextSib;
-
-#ifdef XAPPGROUP
- win_owner = clients[CLIENT_ID(pWin->drawable.id)];
- ag_leader = XagLeader (win_owner);
-#endif
-
- if ((!pWin->overrideRedirect) &&
- (RedirectSend(pParent)
-#ifdef XAPPGROUP
- || (win_owner->appgroup && ag_leader &&
- XagIsControlledRoot (client, pParent))
-#endif
- ))
- {
- event.u.u.type = ConfigureRequest;
- event.u.configureRequest.window = pWin->drawable.id;
- if (mask & CWSibling)
- event.u.configureRequest.sibling = sibwid;
- else
- event.u.configureRequest.sibling = None;
- if (mask & CWStackMode)
- event.u.u.detail = smode;
- else
- event.u.u.detail = Above;
- event.u.configureRequest.x = x;
- event.u.configureRequest.y = y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
- event.u.configureRequest.x += panoramiXdataPtr[0].x;
- event.u.configureRequest.y += panoramiXdataPtr[0].y;
- }
-#endif
- event.u.configureRequest.width = w;
- event.u.configureRequest.height = h;
- event.u.configureRequest.borderWidth = bw;
- event.u.configureRequest.valueMask = mask;
-#ifdef XAPPGROUP
- /* make sure if the ag_leader maps the window it goes to the wm */
- if (ag_leader && ag_leader != client &&
- XagIsControlledRoot (client, pParent)) {
- event.u.configureRequest.parent = XagId (win_owner);
- (void) TryClientEvents (ag_leader, &event, 1,
- NoEventMask, NoEventMask, NullGrab);
- return Success;
- }
-#endif
- event.u.configureRequest.parent = pParent->drawable.id;
- if (MaybeDeliverEventsToClient(pParent, &event, 1,
- SubstructureRedirectMask, client) == 1)
- return(Success);
- }
- if (action == RESIZE_WIN)
- {
- Bool size_change = (w != pWin->drawable.width)
- || (h != pWin->drawable.height);
- if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask))
- {
- xEvent eventT;
- eventT.u.u.type = ResizeRequest;
- eventT.u.resizeRequest.window = pWin->drawable.id;
- eventT.u.resizeRequest.width = w;
- eventT.u.resizeRequest.height = h;
- if (MaybeDeliverEventsToClient(pWin, &eventT, 1,
- ResizeRedirectMask, client) == 1)
- {
- /* if event is delivered, leave the actual size alone. */
- w = pWin->drawable.width;
- h = pWin->drawable.height;
- size_change = FALSE;
- }
- }
- if (!size_change)
- {
- if (mask & (CWX | CWY))
- action = MOVE_WIN;
- else if (mask & (CWStackMode | CWBorderWidth))
- action = RESTACK_WIN;
- else /* really nothing to do */
- return(Success) ;
- }
- }
-
- if (action == RESIZE_WIN)
- /* we've already checked whether there's really a size change */
- goto ActuallyDoSomething;
- if ((mask & CWX) && (x != beforeX))
- goto ActuallyDoSomething;
- if ((mask & CWY) && (y != beforeY))
- goto ActuallyDoSomething;
- if ((mask & CWBorderWidth) && (bw != wBorderWidth (pWin)))
- goto ActuallyDoSomething;
- if (mask & CWStackMode)
- {
-#ifndef ROOTLESS
- /* See above for why we always reorder in rootless mode. */
- if (pWin->nextSib != pSib)
-#endif
- goto ActuallyDoSomething;
- }
- return(Success);
-
-ActuallyDoSomething:
- if (SubStrSend(pWin, pParent))
- {
- event.u.u.type = ConfigureNotify;
- event.u.configureNotify.window = pWin->drawable.id;
- if (pSib)
- event.u.configureNotify.aboveSibling = pSib->drawable.id;
- else
- event.u.configureNotify.aboveSibling = None;
- event.u.configureNotify.x = x;
- event.u.configureNotify.y = y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && (!pParent || !pParent->parent)) {
- event.u.configureNotify.x += panoramiXdataPtr[0].x;
- event.u.configureNotify.y += panoramiXdataPtr[0].y;
- }
-#endif
- event.u.configureNotify.width = w;
- event.u.configureNotify.height = h;
- event.u.configureNotify.borderWidth = bw;
- event.u.configureNotify.override = pWin->overrideRedirect;
- DeliverEvents(pWin, &event, 1, NullWindow);
- }
- if (mask & CWBorderWidth)
- {
- if (action == RESTACK_WIN)
- {
- action = MOVE_WIN;
- pWin->borderWidth = bw;
- }
- else if ((action == MOVE_WIN) &&
- (beforeX + wBorderWidth (pWin) == x + (int)bw) &&
- (beforeY + wBorderWidth (pWin) == y + (int)bw))
- {
- action = REBORDER_WIN;
- (*pWin->drawable.pScreen->ChangeBorderWidth)(pWin, bw);
- }
- else
- pWin->borderWidth = bw;
- }
- if (action == MOVE_WIN)
- (*pWin->drawable.pScreen->MoveWindow)(pWin, x, y, pSib,
- (mask & CWBorderWidth) ? VTOther : VTMove);
- else if (action == RESIZE_WIN)
- (*pWin->drawable.pScreen->ResizeWindow)(pWin, x, y, w, h, pSib);
- else if (mask & CWStackMode)
- ReflectStackChange(pWin, pSib, VTOther);
-
- if (action != RESTACK_WIN)
- CheckCursorConfinement(pWin);
- return(Success);
-#undef RESTACK_WIN
-#undef MOVE_WIN
-#undef RESIZE_WIN
-#undef REBORDER_WIN
-}
-
-
-/******
- *
- * CirculateWindow
- * For RaiseLowest, raises the lowest mapped child (if any) that is
- * obscured by another child to the top of the stack. For LowerHighest,
- * lowers the highest mapped child (if any) that is obscuring another
- * child to the bottom of the stack. Exposure processing is performed
- *
- ******/
-
-int
-CirculateWindow(pParent, direction, client)
- WindowPtr pParent;
- int direction;
- ClientPtr client;
-{
- register WindowPtr pWin, pHead, pFirst;
- xEvent event;
- BoxRec box;
-
- pHead = RealChildHead(pParent);
- pFirst = pHead ? pHead->nextSib : pParent->firstChild;
- if (direction == RaiseLowest)
- {
- for (pWin = pParent->lastChild;
- (pWin != pHead) &&
- !(pWin->mapped &&
- AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box)));
- pWin = pWin->prevSib) ;
- if (pWin == pHead)
- return Success;
- }
- else
- {
- for (pWin = pFirst;
- pWin &&
- !(pWin->mapped &&
- IOverlapAnyWindow(pWin, WindowExtents(pWin, &box)));
- pWin = pWin->nextSib) ;
- if (!pWin)
- return Success;
- }
-
- event.u.circulate.window = pWin->drawable.id;
- event.u.circulate.parent = pParent->drawable.id;
- event.u.circulate.event = pParent->drawable.id;
- if (direction == RaiseLowest)
- event.u.circulate.place = PlaceOnTop;
- else
- event.u.circulate.place = PlaceOnBottom;
-
- if (RedirectSend(pParent))
- {
- event.u.u.type = CirculateRequest;
- if (MaybeDeliverEventsToClient(pParent, &event, 1,
- SubstructureRedirectMask, client) == 1)
- return(Success);
- }
-
- event.u.u.type = CirculateNotify;
- DeliverEvents(pWin, &event, 1, NullWindow);
- ReflectStackChange(pWin,
- (direction == RaiseLowest) ? pFirst : NullWindow,
- VTStack);
-
- return(Success);
-}
-
-static int
-CompareWIDs(
- WindowPtr pWin,
- pointer value) /* must conform to VisitWindowProcPtr */
-{
- Window *wid = (Window *)value;
-
- if (pWin->drawable.id == *wid)
- return(WT_STOPWALKING);
- else
- return(WT_WALKCHILDREN);
-}
-
-/*****
- * ReparentWindow
- *****/
-
-int
-ReparentWindow(pWin, pParent, x, y, client)
- register WindowPtr pWin, pParent;
- int x,y;
- ClientPtr client;
-{
- WindowPtr pPrev, pPriorParent;
- Bool WasMapped = (Bool)(pWin->mapped);
- xEvent event;
- int bw = wBorderWidth (pWin);
- register ScreenPtr pScreen;
-
- pScreen = pWin->drawable.pScreen;
- if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING)
- return(BadMatch);
- if (!MakeWindowOptional(pWin))
- return(BadAlloc);
-
- if (WasMapped)
- UnmapWindow(pWin, FALSE);
-
- event.u.u.type = ReparentNotify;
- event.u.reparent.window = pWin->drawable.id;
- event.u.reparent.parent = pParent->drawable.id;
- event.u.reparent.x = x;
- event.u.reparent.y = y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && !pParent->parent) {
- event.u.reparent.x += panoramiXdataPtr[0].x;
- event.u.reparent.y += panoramiXdataPtr[0].y;
- }
-#endif
- event.u.reparent.override = pWin->overrideRedirect;
- DeliverEvents(pWin, &event, 1, pParent);
-
- /* take out of sibling chain */
-
- pPriorParent = pPrev = pWin->parent;
- if (pPrev->firstChild == pWin)
- pPrev->firstChild = pWin->nextSib;
- if (pPrev->lastChild == pWin)
- pPrev->lastChild = pWin->prevSib;
-
- if (pWin->nextSib)
- pWin->nextSib->prevSib = pWin->prevSib;
- if (pWin->prevSib)
- pWin->prevSib->nextSib = pWin->nextSib;
-
- /* insert at begining of pParent */
- pWin->parent = pParent;
- pPrev = RealChildHead(pParent);
- if (pPrev)
- {
- pWin->nextSib = pPrev->nextSib;
- if (pPrev->nextSib)
- pPrev->nextSib->prevSib = pWin;
- else
- pParent->lastChild = pWin;
- pPrev->nextSib = pWin;
- pWin->prevSib = pPrev;
- }
- else
- {
- pWin->nextSib = pParent->firstChild;
- pWin->prevSib = NullWindow;
- if (pParent->firstChild)
- pParent->firstChild->prevSib = pWin;
- else
- pParent->lastChild = pWin;
- pParent->firstChild = pWin;
- }
-
- pWin->origin.x = x + bw;
- pWin->origin.y = y + bw;
- pWin->drawable.x = x + bw + pParent->drawable.x;
- pWin->drawable.y = y + bw + pParent->drawable.y;
-
- /* clip to parent */
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- if (pScreen->ReparentWindow)
- (*pScreen->ReparentWindow)(pWin, pPriorParent);
- (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y);
- ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
-
- CheckWindowOptionalNeed(pWin);
-
- if (WasMapped)
- MapWindow(pWin, client);
- RecalculateDeliverableEvents(pWin);
- return(Success);
-}
-
-static void
-RealizeTree(WindowPtr pWin)
-{
- register WindowPtr pChild;
- RealizeWindowProcPtr Realize;
-
- Realize = pWin->drawable.pScreen->RealizeWindow;
- pChild = pWin;
- while (1)
- {
- if (pChild->mapped)
- {
- pChild->realized = TRUE;
-#ifdef DO_SAVE_UNDERS
- if (pChild->saveUnder)
- deltaSaveUndersViewable++;
-#endif
- pChild->viewable = (pChild->drawable.class == InputOutput);
- (* Realize)(pChild);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- return;
- pChild = pChild->nextSib;
- }
-}
-
-/*****
- * MapWindow
- * If some other client has selected SubStructureReDirect on the parent
- * and override-redirect is xFalse, then a MapRequest event is generated,
- * but the window remains unmapped. Otherwise, the window is mapped and a
- * MapNotify event is generated.
- *****/
-
-int
-MapWindow(pWin, client)
- register WindowPtr pWin;
- ClientPtr client;
-{
- register ScreenPtr pScreen;
-
- register WindowPtr pParent;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- if (pWin->mapped)
- return(Success);
-
-#ifdef XCSECURITY
- /* don't let an untrusted client map a child-of-trusted-window, InputOnly
- * window; too easy to steal device input
- */
- if ( (client->trustLevel != XSecurityClientTrusted) &&
- (pWin->drawable.class == InputOnly) &&
- (wClient(pWin->parent)->trustLevel == XSecurityClientTrusted) )
- return Success;
-#endif
-
- pScreen = pWin->drawable.pScreen;
- if ( (pParent = pWin->parent) )
- {
- xEvent event;
- Bool anyMarked;
-#ifdef XAPPGROUP
- ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)];
- ClientPtr ag_leader = XagLeader (win_owner);
-#endif
-
- if ((!pWin->overrideRedirect) &&
- (RedirectSend(pParent)
-#ifdef XAPPGROUP
- || (win_owner->appgroup && ag_leader &&
- XagIsControlledRoot (client, pParent))
-#endif
- ))
- {
- event.u.u.type = MapRequest;
- event.u.mapRequest.window = pWin->drawable.id;
-#ifdef XAPPGROUP
- /* make sure if the ag_leader maps the window it goes to the wm */
- if (ag_leader && ag_leader != client &&
- XagIsControlledRoot (client, pParent)) {
- event.u.mapRequest.parent = XagId (win_owner);
- (void) TryClientEvents (ag_leader, &event, 1,
- NoEventMask, NoEventMask, NullGrab);
- return Success;
- }
-#endif
- event.u.mapRequest.parent = pParent->drawable.id;
-
- if (MaybeDeliverEventsToClient(pParent, &event, 1,
- SubstructureRedirectMask, client) == 1)
- return(Success);
- }
-
- pWin->mapped = TRUE;
- if (SubStrSend(pWin, pParent))
- {
- event.u.u.type = MapNotify;
- event.u.mapNotify.window = pWin->drawable.id;
- event.u.mapNotify.override = pWin->overrideRedirect;
- DeliverEvents(pWin, &event, 1, NullWindow);
- }
-
- if (!pParent->realized)
- return(Success);
- RealizeTree(pWin);
- if (pWin->viewable)
- {
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- &pLayerWin);
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib);
- }
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked)
- {
- (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTMap);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTMap);
- }
- WindowsRestructured ();
- }
- else
- {
- RegionRec temp;
-
- pWin->mapped = TRUE;
- pWin->realized = TRUE; /* for roots */
- pWin->viewable = pWin->drawable.class == InputOutput;
- /* We SHOULD check for an error value here XXX */
- (*pScreen->RealizeWindow)(pWin);
- if (pScreen->ClipNotify)
- (*pScreen->ClipNotify) (pWin, 0, 0);
- if (pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
- REGION_NULL(pScreen, &temp);
- REGION_COPY(pScreen, &temp, &pWin->clipList);
- (*pScreen->WindowExposures) (pWin, &temp, NullRegion);
- REGION_UNINIT(pScreen, &temp);
- }
-
- return(Success);
-}
-
-
-/*****
- * MapSubwindows
- * Performs a MapWindow all unmapped children of the window, in top
- * to bottom stacking order.
- *****/
-
-void
-MapSubwindows(pParent, client)
- register WindowPtr pParent;
- ClientPtr client;
-{
- register WindowPtr pWin;
- WindowPtr pFirstMapped = NullWindow;
-#ifdef DO_SAVE_UNDERS
- WindowPtr pFirstSaveUndered = NullWindow;
-#endif
- register ScreenPtr pScreen;
- register Mask parentRedirect;
- register Mask parentNotify;
- xEvent event;
- Bool anyMarked;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- pScreen = pParent->drawable.pScreen;
- parentRedirect = RedirectSend(pParent);
- parentNotify = SubSend(pParent);
- anyMarked = FALSE;
- for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib)
- {
- if (!pWin->mapped)
- {
- if (parentRedirect && !pWin->overrideRedirect)
- {
- event.u.u.type = MapRequest;
- event.u.mapRequest.window = pWin->drawable.id;
- event.u.mapRequest.parent = pParent->drawable.id;
-
- if (MaybeDeliverEventsToClient(pParent, &event, 1,
- SubstructureRedirectMask, client) == 1)
- continue;
- }
-
- pWin->mapped = TRUE;
- if (parentNotify || StrSend(pWin))
- {
- event.u.u.type = MapNotify;
- event.u.mapNotify.window = pWin->drawable.id;
- event.u.mapNotify.override = pWin->overrideRedirect;
- DeliverEvents(pWin, &event, 1, NullWindow);
- }
-
- if (!pFirstMapped)
- pFirstMapped = pWin;
- if (pParent->realized)
- {
- RealizeTree(pWin);
- if (pWin->viewable)
- {
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- (WindowPtr *)NULL);
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = TRUE;
- }
-#endif /* DO_SAVE_UNDERS */
- }
- }
- }
- }
-
- if (pFirstMapped)
- {
- pLayerWin = (*pScreen->GetLayerWindow)(pParent);
- if (pLayerWin->parent != pParent) {
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pLayerWin,
- pLayerWin,
- (WindowPtr *)NULL);
- pFirstMapped = pLayerWin;
- }
- if (anyMarked)
- {
-#ifdef DO_SAVE_UNDERS
- if (pLayerWin->parent != pParent)
- {
- if (dosave || (DO_SAVE_UNDERS(pLayerWin)))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin,
- pLayerWin);
- }
- }
- else if (dosave)
- {
- dosave = FALSE;
- for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib)
- {
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave |= (*pScreen->ChangeSaveUnder)(pWin,
- pWin->nextSib);
- if (dosave && !pFirstSaveUndered)
- pFirstSaveUndered = pWin;
- }
- }
- }
-#endif /* DO_SAVE_UNDERS */
- (*pScreen->ValidateTree)(pLayerWin->parent, pFirstMapped, VTMap);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin,
- pFirstSaveUndered->nextSib);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstMapped,
- VTMap);
- WindowsRestructured ();
- }
-}
-
-static void
-UnrealizeTree(
- WindowPtr pWin,
- Bool fromConfigure)
-{
- register WindowPtr pChild;
- UnrealizeWindowProcPtr Unrealize;
- MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
-
- Unrealize = pWin->drawable.pScreen->UnrealizeWindow;
- MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow;
- pChild = pWin;
- while (1)
- {
- if (pChild->realized)
- {
- pChild->realized = FALSE;
- pChild->visibility = VisibilityNotViewable;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) {
- PanoramiXRes *win;
- win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id,
- XRT_WINDOW);
- if(win)
- win->u.win.visibility = VisibilityNotViewable;
- }
-#endif
- (* Unrealize)(pChild);
- DeleteWindowFromAnyEvents(pChild, FALSE);
- if (pChild->viewable)
- {
-#ifdef DO_SAVE_UNDERS
- if (pChild->saveUnder)
- deltaSaveUndersViewable--;
-#endif
- pChild->viewable = FALSE;
- if (pChild->backStorage)
- (*pChild->drawable.pScreen->SaveDoomedAreas)(
- pChild, &pChild->clipList, 0, 0);
- (* MarkUnrealizedWindow)(pChild, pWin, fromConfigure);
- pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- return;
- pChild = pChild->nextSib;
- }
-}
-
-/*****
- * UnmapWindow
- * If the window is already unmapped, this request has no effect.
- * Otherwise, the window is unmapped and an UnMapNotify event is
- * generated. Cannot unmap a root window.
- *****/
-
-int
-UnmapWindow(pWin, fromConfigure)
- register WindowPtr pWin;
- Bool fromConfigure;
-{
- register WindowPtr pParent;
- xEvent event;
- Bool wasRealized = (Bool)pWin->realized;
- Bool wasViewable = (Bool)pWin->viewable;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr pLayerWin = pWin;
-
- if ((!pWin->mapped) || (!(pParent = pWin->parent)))
- return(Success);
- if (SubStrSend(pWin, pParent))
- {
- event.u.u.type = UnmapNotify;
- event.u.unmapNotify.window = pWin->drawable.id;
- event.u.unmapNotify.fromConfigure = fromConfigure;
- DeliverEvents(pWin, &event, 1, NullWindow);
- }
- if (wasViewable && !fromConfigure)
- {
- pWin->valdata = UnmapValData;
- (*pScreen->MarkOverlappedWindows)(pWin, pWin->nextSib, &pLayerWin);
- (*pScreen->MarkWindow)(pLayerWin->parent);
- }
- pWin->mapped = FALSE;
- if (wasRealized)
- UnrealizeTree(pWin, fromConfigure);
- if (wasViewable)
- {
- if (!fromConfigure)
- {
- (*pScreen->ValidateTree)(pLayerWin->parent, pWin, VTUnmap);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib) )
- {
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib);
- }
- }
- pWin->DIXsaveUnder = FALSE;
-#endif /* DO_SAVE_UNDERS */
- if (!fromConfigure && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pWin, VTUnmap);
- }
- if (wasRealized && !fromConfigure)
- WindowsRestructured ();
- return(Success);
-}
-
-/*****
- * UnmapSubwindows
- * Performs an UnmapWindow request with the specified mode on all mapped
- * children of the window, in bottom to top stacking order.
- *****/
-
-void
-UnmapSubwindows(pWin)
- register WindowPtr pWin;
-{
- register WindowPtr pChild, pHead;
- xEvent event;
- Bool wasRealized = (Bool)pWin->realized;
- Bool wasViewable = (Bool)pWin->viewable;
- Bool anyMarked = FALSE;
- Mask parentNotify;
- WindowPtr pLayerWin = NULL;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (!pWin->firstChild)
- return;
- parentNotify = SubSend(pWin);
- pHead = RealChildHead(pWin);
-
- if (wasViewable)
- pLayerWin = (*pScreen->GetLayerWindow)(pWin);
-
- for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
- {
- if (pChild->mapped)
- {
- if (parentNotify || StrSend(pChild))
- {
- event.u.u.type = UnmapNotify;
- event.u.unmapNotify.window = pChild->drawable.id;
- event.u.unmapNotify.fromConfigure = xFalse;
- DeliverEvents(pChild, &event, 1, NullWindow);
- }
- if (pChild->viewable)
- {
- pChild->valdata = UnmapValData;
- anyMarked = TRUE;
- }
- pChild->mapped = FALSE;
- if (pChild->realized)
- UnrealizeTree(pChild, FALSE);
- if (wasViewable)
- {
-#ifdef DO_SAVE_UNDERS
- pChild->DIXsaveUnder = FALSE;
-#endif /* DO_SAVE_UNDERS */
- if (pChild->backStorage)
- (*pScreen->SaveDoomedAreas)(
- pChild, &pChild->clipList, 0, 0);
- }
- }
- }
- if (wasViewable)
- {
- if (anyMarked)
- {
- if (pLayerWin->parent == pWin)
- (*pScreen->MarkWindow)(pWin);
- else
- {
- WindowPtr ptmp;
- (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin,
- (WindowPtr *)NULL);
- (*pScreen->MarkWindow)(pLayerWin->parent);
-
- /* Windows between pWin and pLayerWin may not have been marked */
- ptmp = pWin;
-
- while (ptmp != pLayerWin->parent)
- {
- (*pScreen->MarkWindow)(ptmp);
- ptmp = ptmp->parent;
- }
- pHead = pWin->firstChild;
- }
- (*pScreen->ValidateTree)(pLayerWin->parent, pHead, VTUnmap);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin))
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
- }
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pHead, VTUnmap);
- }
- if (wasRealized)
- WindowsRestructured ();
-}
-
-
-void
-HandleSaveSet(client)
- register ClientPtr client;
-{
- register WindowPtr pParent, pWin;
- register int j;
-
- for (j=0; j<client->numSaved; j++)
- {
- pWin = (WindowPtr)client->saveSet[j];
- pParent = pWin->parent;
- while (pParent && (wClient (pParent) == client))
- pParent = pParent->parent;
- if (pParent)
- {
- if (pParent != pWin->parent)
- {
- ReparentWindow(pWin, pParent,
- pWin->drawable.x - wBorderWidth (pWin) - pParent->drawable.x,
- pWin->drawable.y - wBorderWidth (pWin) - pParent->drawable.y,
- client);
- if(!pWin->realized && pWin->mapped)
- pWin->mapped = FALSE;
- }
- MapWindow(pWin, client);
- }
- }
- xfree(client->saveSet);
- client->numSaved = 0;
- client->saveSet = (pointer *)NULL;
-}
-
-Bool
-VisibleBoundingBoxFromPoint(pWin, x, y, box)
- register WindowPtr pWin;
- int x, y; /* in root */
- BoxPtr box; /* "return" value */
-{
- if (!pWin->realized)
- return (FALSE);
- if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box))
- return(TRUE);
- return(FALSE);
-}
-
-Bool
-PointInWindowIsVisible(pWin, x, y)
- register WindowPtr pWin;
- int x, y; /* in root */
-{
- BoxRec box;
-
- if (!pWin->realized)
- return (FALSE);
- if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip,
- x, y, &box))
- return(TRUE);
- return(FALSE);
-}
-
-
-RegionPtr
-NotClippedByChildren(pWin)
- register WindowPtr pWin;
-{
- register ScreenPtr pScreen;
- RegionPtr pReg;
-
- pScreen = pWin->drawable.pScreen;
- pReg = REGION_CREATE(pScreen, NullBox, 1);
- if (pWin->parent ||
- screenIsSaved != SCREEN_SAVER_ON ||
- !HasSaverWindow (pWin->drawable.pScreen->myNum))
- {
- REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize);
- }
- return(pReg);
-}
-
-void
-SendVisibilityNotify(pWin)
- WindowPtr pWin;
-{
- xEvent event;
- unsigned int visibility = pWin->visibility;
-
-#ifdef PANORAMIX
- /* This is not quite correct yet, but it's close */
- if(!noPanoramiXExtension) {
- PanoramiXRes *win;
- WindowPtr pWin2;
- int i, Scrnum;
-
- Scrnum = pWin->drawable.pScreen->myNum;
-
- win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum);
-
- if(!win || (win->u.win.visibility == visibility))
- return;
-
- switch(visibility) {
- case VisibilityUnobscured:
- for(i = 0; i < PanoramiXNumScreens; i++) {
- if(i == Scrnum) continue;
-
- pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW);
-
- if (pWin2) {
- if(pWin2->visibility == VisibilityPartiallyObscured)
- return;
-
- if(!i) pWin = pWin2;
- }
- }
- break;
- case VisibilityPartiallyObscured:
- if(Scrnum) {
- pWin2 = (WindowPtr)LookupIDByType(win->info[0].id, RT_WINDOW);
- if (pWin2) pWin = pWin2;
- }
- break;
- case VisibilityFullyObscured:
- for(i = 0; i < PanoramiXNumScreens; i++) {
- if(i == Scrnum) continue;
-
- pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW);
-
- if (pWin2) {
- if(pWin2->visibility != VisibilityFullyObscured)
- return;
-
- if(!i) pWin = pWin2;
- }
- }
- break;
- }
-
- win->u.win.visibility = visibility;
- }
-#endif
-
- event.u.u.type = VisibilityNotify;
- event.u.visibility.window = pWin->drawable.id;
- event.u.visibility.state = visibility;
- DeliverEvents(pWin, &event, 1, NullWindow);
-}
-
-
-#define RANDOM_WIDTH 32
-
-#ifndef NOLOGOHACK
-static void DrawLogo(
- WindowPtr /*pWin*/
-);
-#endif
-
-void
-SaveScreens(on, mode)
- int on;
- int mode;
-{
- int i;
- int what;
- int type;
-
- if (on == SCREEN_SAVER_FORCER)
- {
- UpdateCurrentTimeIf();
- lastDeviceEventTime = currentTime;
- if (mode == ScreenSaverReset)
- what = SCREEN_SAVER_OFF;
- else
- what = SCREEN_SAVER_ON;
- type = what;
- }
- else
- {
- what = on;
- type = what;
- if (what == screenIsSaved)
- type = SCREEN_SAVER_CYCLE;
- }
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- if (on == SCREEN_SAVER_FORCER)
- (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on);
- if (savedScreenInfo[i].ExternalScreenSaver)
- {
- if ((*savedScreenInfo[i].ExternalScreenSaver)
- (screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER))
- continue;
- }
- if (type == screenIsSaved)
- continue;
- switch (type) {
- case SCREEN_SAVER_OFF:
- if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED)
- {
- (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i],
- what);
- }
- else if (HasSaverWindow (i))
- {
- savedScreenInfo[i].pWindow = NullWindow;
- FreeResource(savedScreenInfo[i].wid, RT_NONE);
- }
- break;
- case SCREEN_SAVER_CYCLE:
- if (savedScreenInfo[i].blanked == SCREEN_IS_TILED)
- {
- WindowPtr pWin = savedScreenInfo[i].pWindow;
- /* make it look like screen saver is off, so that
- * NotClippedByChildren will compute a clip list
- * for the root window, so miPaintWindow works
- */
- screenIsSaved = SCREEN_SAVER_OFF;
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE);
-#endif
- (*pWin->drawable.pScreen->MoveWindow)(pWin,
- (short)(-(rand() % RANDOM_WIDTH)),
- (short)(-(rand() % RANDOM_WIDTH)),
- pWin->nextSib, VTMove);
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- DrawLogo(pWin);
-#endif
- screenIsSaved = SCREEN_SAVER_ON;
- }
- /*
- * Call the DDX saver in case it wants to do something
- * at cycle time
- */
- else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED)
- {
- (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i],
- type);
- }
- break;
- case SCREEN_SAVER_ON:
- if (ScreenSaverBlanking != DontPreferBlanking)
- {
- if ((* screenInfo.screens[i]->SaveScreen)
- (screenInfo.screens[i], what))
- {
- savedScreenInfo[i].blanked = SCREEN_IS_BLANKED;
- continue;
- }
- if ((ScreenSaverAllowExposures != DontAllowExposures) &&
- TileScreenSaver(i, SCREEN_IS_BLACK))
- {
- savedScreenInfo[i].blanked = SCREEN_IS_BLACK;
- continue;
- }
- }
- if ((ScreenSaverAllowExposures != DontAllowExposures) &&
- TileScreenSaver(i, SCREEN_IS_TILED))
- {
- savedScreenInfo[i].blanked = SCREEN_IS_TILED;
- }
- else
- savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED;
- break;
- }
- }
- screenIsSaved = what;
- if (mode == ScreenSaverReset)
- SetScreenSaverTimer();
-}
-
-static Bool
-TileScreenSaver(int i, int kind)
-{
- int j;
- int result;
- XID attributes[3];
- Mask mask;
- WindowPtr pWin;
- CursorMetricRec cm;
- unsigned char *srcbits, *mskbits;
- CursorPtr cursor;
- XID cursorID = 0;
- int attri;
-
- mask = 0;
- attri = 0;
- switch (kind) {
- case SCREEN_IS_TILED:
- switch (WindowTable[i]->backgroundState) {
- case BackgroundPixel:
- attributes[attri++] = WindowTable[i]->background.pixel;
- mask |= CWBackPixel;
- break;
- case BackgroundPixmap:
- attributes[attri++] = None;
- mask |= CWBackPixmap;
- break;
- default:
- break;
- }
- break;
- case SCREEN_IS_BLACK:
- attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel;
- mask |= CWBackPixel;
- break;
- }
- mask |= CWOverrideRedirect;
- attributes[attri++] = xTrue;
-
- /*
- * create a blank cursor
- */
-
- cm.width=16;
- cm.height=16;
- cm.xhot=8;
- cm.yhot=8;
- srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
- mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
- if (!srcbits || !mskbits)
- {
- xfree(srcbits);
- xfree(mskbits);
- cursor = 0;
- }
- else
- {
- for (j=0; j<BitmapBytePad(32)*16; j++)
- srcbits[j] = mskbits[j] = 0x0;
- cursor = AllocCursor(srcbits, mskbits, &cm, 0, 0, 0, 0, 0, 0);
- if (cursor)
- {
- cursorID = FakeClientID(0);
- if (AddResource (cursorID, RT_CURSOR, (pointer) cursor))
- {
- attributes[attri] = cursorID;
- mask |= CWCursor;
- }
- else
- cursor = 0;
- }
- else
- {
- xfree (srcbits);
- xfree (mskbits);
- }
- }
-
- pWin = savedScreenInfo[i].pWindow =
- CreateWindow(savedScreenInfo[i].wid,
- WindowTable[i],
- -RANDOM_WIDTH, -RANDOM_WIDTH,
- (unsigned short)screenInfo.screens[i]->width + RANDOM_WIDTH,
- (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH,
- 0, InputOutput, mask, attributes, 0, serverClient,
- wVisual (WindowTable[i]), &result);
-
- if (cursor)
- FreeResource (cursorID, RT_NONE);
-
- if (!pWin)
- return FALSE;
-
- if (!AddResource(pWin->drawable.id, RT_WINDOW,
- (pointer)savedScreenInfo[i].pWindow))
- return FALSE;
-
- if (mask & CWBackPixmap)
- {
- MakeRootTile (pWin);
- (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap);
- }
- MapWindow(pWin, serverClient);
-#ifndef NOLOGOHACK
- if (kind == SCREEN_IS_TILED && logoScreenSaver)
- DrawLogo(pWin);
-#endif
- return TRUE;
-}
-
-/*
- * FindWindowWithOptional
- *
- * search ancestors of the given window for an entry containing
- * a WindowOpt structure. Assumptions: some parent will
- * contain the structure.
- */
-
-WindowPtr
-FindWindowWithOptional (w)
- register WindowPtr w;
-{
- do
- w = w->parent;
- while (!w->optional);
- return w;
-}
-
-/*
- * CheckWindowOptionalNeed
- *
- * check each optional entry in the given window to see if
- * the value is satisfied by the default rules. If so,
- * release the optional record
- */
-
-void
-CheckWindowOptionalNeed (w)
- register WindowPtr w;
-{
- register WindowOptPtr optional;
- register WindowOptPtr parentOptional;
-
- if (!w->parent)
- return;
- optional = w->optional;
- if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate])
- return;
- if (optional->otherEventMasks != 0)
- return;
- if (optional->otherClients != NULL)
- return;
- if (optional->passiveGrabs != NULL)
- return;
- if (optional->userProps != NULL)
- return;
- if (optional->backingBitPlanes != ~0L)
- return;
- if (optional->backingPixel != 0)
- return;
-#ifdef SHAPE
- if (optional->boundingShape != NULL)
- return;
- if (optional->clipShape != NULL)
- return;
-#endif
-#ifdef XINPUT
- if (optional->inputMasks != NULL)
- return;
-#endif
- parentOptional = FindWindowWithOptional(w)->optional;
- if (optional->visual != parentOptional->visual)
- return;
- if (optional->cursor != None &&
- (optional->cursor != parentOptional->cursor ||
- w->parent->cursorIsNone))
- return;
- if (optional->colormap != parentOptional->colormap)
- return;
- DisposeWindowOptional (w);
-}
-
-/*
- * MakeWindowOptional
- *
- * create an optional record and initialize it with the default
- * values.
- */
-
-Bool
-MakeWindowOptional (pWin)
- register WindowPtr pWin;
-{
- register WindowOptPtr optional;
- register WindowOptPtr parentOptional;
-
- if (pWin->optional)
- return TRUE;
- optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec));
- if (!optional)
- return FALSE;
- optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate];
- optional->otherEventMasks = 0;
- optional->otherClients = NULL;
- optional->passiveGrabs = NULL;
- optional->userProps = NULL;
- optional->backingBitPlanes = ~0L;
- optional->backingPixel = 0;
-#ifdef SHAPE
- optional->boundingShape = NULL;
- optional->clipShape = NULL;
-#endif
-#ifdef XINPUT
- optional->inputMasks = NULL;
-#endif
- parentOptional = FindWindowWithOptional(pWin)->optional;
- optional->visual = parentOptional->visual;
- if (!pWin->cursorIsNone)
- {
- optional->cursor = parentOptional->cursor;
- optional->cursor->refcnt++;
- }
- else
- {
- optional->cursor = None;
- }
- optional->colormap = parentOptional->colormap;
- pWin->optional = optional;
- return TRUE;
-}
-
-void
-DisposeWindowOptional (pWin)
- register WindowPtr pWin;
-{
- if (!pWin->optional)
- return;
- /*
- * everything is peachy. Delete the optional record
- * and clean up
- */
- /*
- * TOG changed this code to:
- *
- * if (pWin->cursorIsNone == FALSE)
- * FreeCursor (pWin->optional->cursor, (Cursor)0);
- * pWin->cursorIsNone = TRUE;
- *
- * This is blatently wrong; windows without optionals can have
- * two different cursor values, either None or sharing their
- * parents cursor. This difference is controlled by the
- * cursorIsNone value; when TRUE, the window has no cursor,
- * when false, it shares its cursor with its parent; TOG
- * made it impossible for a window to have a cursor without
- * an optional record.
- */
- if (pWin->optional->cursor)
- {
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->cursorIsNone = FALSE;
- }
- else
- pWin->cursorIsNone = TRUE;
- xfree (pWin->optional);
- pWin->optional = NULL;
-}
-
-#ifndef NOLOGOHACK
-static void
-DrawLogo(WindowPtr pWin)
-{
- DrawablePtr pDraw;
- ScreenPtr pScreen;
- int x, y;
- unsigned int width, height, size;
- GC *pGC;
- int thin, gap, d31;
- DDXPointRec poly[4];
- ChangeGCVal fore[2], back[2];
- xrgb rgb[2];
- BITS32 fmask, bmask;
- ColormapPtr cmap;
-
- pDraw = (DrawablePtr)pWin;
- pScreen = pDraw->pScreen;
- x = -pWin->origin.x;
- y = -pWin->origin.y;
- width = pScreen->width;
- height = pScreen->height;
- pGC = GetScratchGC(pScreen->rootDepth, pScreen);
- if (!pGC)
- return;
-
- if ((rand() % 100) <= 17) /* make the probability for white fairly low */
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- if ((pWin->backgroundState == BackgroundPixel) &&
- (cmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP))) {
- Pixel querypixels[2];
-
- querypixels[0] = fore[0].val;
- querypixels[1] = pWin->background.pixel;
- QueryColors(cmap, 2, querypixels, rgb);
- if ((rgb[0].red == rgb[1].red) &&
- (rgb[0].green == rgb[1].green) &&
- (rgb[0].blue == rgb[1].blue)) {
- if (fore[0].val == pScreen->blackPixel)
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- }
- }
- fore[1].val = FillSolid;
- fmask = GCForeground|GCFillStyle;
- if (pWin->backgroundState == BackgroundPixel) {
- back[0].val = pWin->background.pixel;
- back[1].val = FillSolid;
- bmask = GCForeground|GCFillStyle;
- } else {
- back[0].val = 0;
- back[1].val = 0;
- dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin,
- NULL, back);
- back[0].val = FillTiled;
- back[1].ptr = pWin->background.pixmap;
- bmask = GCFillStyle|GCTile;
- }
-
- /* should be the same as the reference function XmuDrawLogo() */
-
- size = width;
- if (height < width)
- size = height;
- size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH);
- size &= ~1;
- x += rand() % (width - size);
- y += rand() % (height - size);
-
-/*
- * Draw what will be the thin strokes.
- *
- * -----
- * / /
- * / /
- * / /
- * / /
- * /____/
- * d
- *
- * Point d is 9/44 (~1/5) of the way across.
- */
-
- thin = (size / 11);
- if (thin < 1) thin = 1;
- gap = (thin+3) / 4;
- d31 = thin + thin + gap;
- poly[0].x = x + size; poly[0].y = y;
- poly[1].x = x + size-d31; poly[1].y = y;
- poly[2].x = x + 0; poly[2].y = y + size;
- poly[3].x = x + d31; poly[3].y = y + size;
- dixChangeGC(NullClient, pGC, fmask, NULL, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for lower thin stroke.
- *
- * ------
- * / /
- * / __ /
- * / / /
- * / / /
- * /__/__/
- */
-
- poly[0].x = x + d31/2; poly[0].y = y + size;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + d31; poly[3].y = y + size;
- dixChangeGC(NullClient, pGC, bmask, NULL, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for upper thin stroke.
- *
- * ------
- * / / /
- * /--/ /
- * / /
- * / /
- * /_____/
- */
-
- poly[0].x = x + size - d31/2; poly[0].y = y;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + size - d31; poly[3].y = y;
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Draw thick stroke.
- * Point b is 1/4 of the way across.
- *
- * b
- * -----
- * \ \
- * \ \
- * \ \
- * \ \
- * \____\
- */
-
- poly[0].x = x; poly[0].y = y;
- poly[1].x = x + size/4; poly[1].y = y;
- poly[2].x = x + size; poly[2].y = y + size;
- poly[3].x = x + size - size/4; poly[3].y = y + size;
- dixChangeGC(NullClient, pGC, fmask, NULL, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase to create gap.
- *
- * /
- * /
- * /
- * /
- * /
- */
-
- poly[0].x = x + size- thin; poly[0].y = y;
- poly[1].x = x + size-( thin+gap); poly[1].y = y;
- poly[2].x = x + thin; poly[2].y = y + size;
- poly[3].x = x + thin + gap; poly[3].y = y + size;
- dixChangeGC(NullClient, pGC, bmask, NULL, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
- FreeScratchGC(pGC);
-}
-
-#endif
diff --git a/dix/xpstubs.c b/dix/xpstubs.c
deleted file mode 100644
index a48a81402..000000000
--- a/dix/xpstubs.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dix/xpstubs.c,v 1.4 2001/12/20 19:41:00 tsi Exp $ */
-/*
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-
-/* $Xorg: xpstubs.c,v 1.5 2001/03/08 17:52:08 pookie Exp $ */
-
-#include "misc.h"
-#include "font.h"
-
-Bool
-XpClientIsBitmapClient(client)
- ClientPtr client;
-{
- return TRUE;
-}
-
-Bool
-XpClientIsPrintClient(client, fpe)
- ClientPtr client;
- FontPathElementPtr fpe;
-{
- return FALSE;
-}
-int
-XprintOptions(argc, argv, i)
- int argc;
- char **argv;
- int i;
-{
- return i;
-}
diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre
deleted file mode 100644
index 972280ba0..000000000
--- a/doc/Xserver.man.pre
+++ /dev/null
@@ -1,759 +0,0 @@
-.\" $Xorg: Xserver.man,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $
-.\" Copyright 1984 - 1991, 1993, 1994, 1998 The Open Group
-.\"
-.\" Permission to use, copy, modify, distribute, and sell this software and its
-.\" documentation for any purpose is hereby granted without fee, provided that
-.\" the above copyright notice appear in all copies and that both that
-.\" copyright notice and this permission notice appear in supporting
-.\" documentation.
-.\"
-.\" The above copyright notice and this permission notice shall be included
-.\" in all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-.\" OTHER DEALINGS IN THE SOFTWARE.
-.\"
-.\" Except as contained in this notice, the name of The Open Group shall
-.\" not be used in advertising or otherwise to promote the sale, use or
-.\" other dealings in this Software without prior written authorization
-.\" from The Open Group.
-.\" $XFree86: xc/programs/Xserver/Xserver.man,v 3.29 2003/09/08 14:25:26 eich Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH XSERVER 1 __xorgversion__
-.SH NAME
-Xserver \- X Window System display server
-.SH SYNOPSIS
-.B X
-[option ...]
-.SH DESCRIPTION
-.I X
-is the generic name for the X Window System display server. It is
-frequently a link or a copy of the appropriate server binary for
-driving the most frequently used server on a given machine.
-.SH "STARTING THE SERVER"
-The X server is usually started from the X Display Manager program \fIxdm\fP(1).
-This utility is run from the system boot files and takes care of keeping
-the server running, prompting for usernames and passwords, and starting up
-the user sessions.
-.PP
-Installations that run more than one window system may need to use the
-\fIxinit\fP(1) utility instead of \fIxdm\fP. However, \fIxinit\fP is
-to be considered a tool for building startup scripts and is not
-intended for use by end users. Site administrators are \fBstrongly\fP
-urged to use \fIxdm\fP, or build other interfaces for novice users.
-.PP
-The X server may also be started directly by the user, though this
-method is usually reserved for testing and is not recommended for
-normal operation. On some platforms, the user must have special
-permission to start the X server, often because access to certain
-devices (e.g. \fI/dev/mouse\fP) is restricted.
-.PP
-When the X server starts up, it typically takes over the display. If
-you are running on a workstation whose console is the display, you may
-not be able to log into the console while the server is running.
-.SH OPTIONS
-Many X servers have device-specific command line options. See the manual
-pages for the individual servers for more details; a list of
-server-specific manual pages is provided in the SEE ALSO section below.
-.PP
-All of the X servers accept the command line options described below.
-Some X servers may have alternative ways of providing the parameters
-described here, but the values provided via the command line options
-should override values specified via other mechanisms.
-.TP 8
-.B :\fIdisplaynumber\fP
-The X server runs as the given \fIdisplaynumber\fP, which by default is 0.
-If multiple X servers are to run simultaneously on a host, each must have
-a unique display number. See the DISPLAY
-NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to
-specify which display number clients should try to use.
-.TP 8
-.B \-a \fInumber\fP
-sets pointer acceleration (i.e. the ratio of how much is reported to how much
-the user actually moved the pointer).
-.TP 8
-.B \-ac
-disables host-based access control mechanisms. Enables access by any host,
-and permits any host to modify the access control list.
-Use with extreme caution.
-This option exists primarily for running test suites remotely.
-.TP 8
-.B \-audit \fIlevel\fP
-sets the audit trail level. The default level is 1, meaning only connection
-rejections are reported. Level 2 additionally reports all successful
-connections and disconnects. Level 4 enables messages from the
-SECURITY extension, if present, including generation and revocation of
-authorizations and violations of the security policy.
-Level 0 turns off the audit trail.
-Audit lines are sent as standard error output.
-.TP 8
-.B \-auth \fIauthorization-file\fP
-specifies a file which contains a collection of authorization records used
-to authenticate access. See also the \fIxdm\fP and \fIXsecurity\fP manual
-pages.
-.TP 8
-.B bc
-disables certain kinds of error checking, for bug compatibility with
-previous releases (e.g., to work around bugs in R2 and R3 xterms and toolkits).
-Deprecated.
-.TP 8
-.B \-bs
-disables backing store support on all screens.
-.TP 8
-.B \-br
-sets the default root window to solid black instead of the standard root weave
-pattern.
-.TP 8
-.B \-c
-turns off key-click.
-.TP 8
-.B c \fIvolume\fP
-sets key-click volume (allowable range: 0-100).
-.TP 8
-.B \-cc \fIclass\fP
-sets the visual class for the root window of color screens.
-The class numbers are as specified in the X protocol.
-Not obeyed by all servers.
-.TP 8
-.B \-co \fIfilename\fP
-sets name of RGB color database. The default is
-.IR __projectroot__/lib/X11/rgb .
-.ig
-.TP 8
-.B \-config \fIfilename\fP
-reads more options from the given file. Options in the file may be separated
-by newlines if desired. If a '#' character appears on a line, all characters
-between it and the next newline are ignored, providing a simple commenting
-facility. The \fB\-config\fP option itself may appear in the file.
-.BR NOTE :
-This option is disabled when the Xserver is run with an effective uid
-different from the user's real uid.
-..
-.TP 8
-.B \-core
-causes the server to generate a core dump on fatal errors.
-.TP 8
-.B \-dpi \fIresolution\fP
-sets the resolution for all screens, in dots per inch.
-To be used when the server cannot determine the screen size(s) from the
-hardware.
-.TP 8
-.B \-deferglyphs \fIwhichfonts\fP
-specifies the types of fonts for which the server should attempt to use
-deferred glyph loading. \fIwhichfonts\fP can be all (all fonts),
-none (no fonts), or 16 (16 bit fonts only).
-.TP 8
-.B \-f \fIvolume\fP
-sets feep (bell) volume (allowable range: 0-100).
-.TP 8
-.B \-fc \fIcursorFont\fP
-sets default cursor font.
-.TP 8
-.B \-fn \fIfont\fP
-sets the default font.
-.TP 8
-.B \-fp \fIfontPath\fP
-sets the search path for fonts. This path is a comma separated list
-of directories which the X server searches for font databases.
-.TP 8
-.B \-help
-prints a usage message.
-.TP 8
-.B \-I
-causes all remaining command line arguments to be ignored.
-.TP 8
-.B \-nolisten \fItrans-type\fP
-disables a transport type. For example, TCP/IP connections can be disabled
-with
-.BR "\-nolisten tcp" .
-This option may be issued multiple times to disable listening to different
-transport types.
-.TP 8
-.B \-noreset
-prevents a server reset when the last client connection is closed. This
-overrides a previous
-.B \-terminate
-command line option.
-.TP 8
-.B \-p \fIminutes\fP
-sets screen-saver pattern cycle time in minutes.
-.TP 8
-.B \-pn
-permits the server to continue running if it fails to establish all of
-its well-known sockets (connection points for clients), but
-establishes at least one.
-.TP 8
-.B \-r
-turns off auto-repeat.
-.TP 8
-.B r
-turns on auto-repeat.
-.TP 8
-.B \-s \fIminutes\fP
-sets screen-saver timeout time in minutes.
-.TP 8
-.B \-su
-disables save under support on all screens.
-.TP 8
-.B \-t \fInumber\fP
-sets pointer acceleration threshold in pixels (i.e. after how many pixels
-pointer acceleration should take effect).
-.TP 8
-.B \-terminate
-causes the server to terminate at server reset, instead of continuing to run.
-This overrides a previous
-.B \-noreset
-command line option.
-.TP 8
-.B \-to \fIseconds\fP
-sets default connection timeout in seconds.
-.TP 8
-.B \-tst
-disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1, RECORD).
-.TP 8
-.B tty\fIxx\fP
-ignored, for servers started the ancient way (from init).
-.TP 8
-.B v
-sets video-off screen-saver preference.
-.TP 8
-.B \-v
-sets video-on screen-saver preference.
-.TP 8
-.B \-wm
-forces the default backing-store of all windows to be WhenMapped. This
-is a backdoor way of getting backing-store to apply to all windows.
-Although all mapped windows will have backing store, the backing store
-attribute value reported by the server for a window will be the last
-value established by a client. If it has never been set by a client,
-the server will report the default value, NotUseful. This behavior is
-required by the X protocol, which allows the server to exceed the
-client's backing store expectations but does not provide a way to tell
-the client that it is doing so.
-.TP 8
-.B \-x \fIextension\fP
-loads the specified extension at init.
-This is a no-op for most implementations.
-.TP 8
-.B [+-]xinerama
-enables(+) or disables(-) the XINERAMA extension. The default state is
-disabled.
-.SH SERVER DEPENDENT OPTIONS
-Some X servers accept the following options:
-.TP 8
-.B \-ld \fIkilobytes\fP
-sets the data space limit of the server to the specified number of kilobytes.
-A value of zero makes the data size as large as possible. The default value
-of \-1 leaves the data space limit unchanged.
-.TP 8
-.B \-lf \fIfiles\fP
-sets the number-of-open-files limit of the server to the specified number.
-A value of zero makes the limit as large as possible. The default value
-of \-1 leaves the limit unchanged.
-.TP 8
-.B \-ls \fIkilobytes\fP
-sets the stack space limit of the server to the specified number of kilobytes.
-A value of zero makes the stack size as large as possible. The default value
-of \-1 leaves the stack space limit unchanged.
-.TP 8
-.B \-logo
-turns on the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
-.B nologo
-turns off the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
-.B \-render
-.BR default | mono | gray | color
-sets the color allocation policy that will be used by the render extension.
-.RS 8
-.TP 8
-.I default
-selects the default policy defined for the display depth of the X
-server.
-.TP 8
-.I mono
-don't use any color cell.
-.TP 8
-.I gray
-use a gray map of 13 color cells for the X render extension.
-.TP 8
-.I color
-use a color cube of at most 4*4*4 colors (that is 64 color cells).
-.RE
-.SH XDMCP OPTIONS
-X servers that support XDMCP have the following options.
-See the \fIX Display Manager Control Protocol\fP specification for more
-information.
-.TP 8
-.B \-query \fIhostname\fP
-enables XDMCP and sends Query packets to the specified
-.IR hostname .
-.TP 8
-.B \-broadcast
-enable XDMCP and broadcasts BroadcastQuery packets to the network. The
-first responding display manager will be chosen for the session.
-.B \-multicast [\fIaddress\fP [\fIhop count\fP]]
-Enable XDMCP and multicast BroadcastQuery packets to the network.
-The first responding display manager is chosen for the session. If an
-address is specified, the multicast is sent to that address. If no
-address is specified, the multicast is sent to the default XDMCP IPv6
-multicast group. If a hop count is specified, it is used as the maximum
-hop count for the multicast. If no hop count is specified, the multicast
-is set to a maximum of 1 hop, to prevent the multicast from being routed
-beyond the local network.
-.TP 8
-.B \-indirect \fIhostname\fP
-enables XDMCP and send IndirectQuery packets to the specified
-.IR hostname .
-.TP 8
-.B \-port \fIport-number\fP
-uses the specified \fIport-number\fP for XDMCP packets, instead of the
-default. This option must be specified before any \-query, \-broadcast or
-\-indirect options.
-.TP 8
-.B \-from \fIlocal-address\fP
-specifies the local address to connect from (useful if the connecting host
-has multiple network interfaces). The \fIlocal-address\fP may be expressed
-in any form acceptable to the host platform's \fIgethostbyname\fP(3)
-implementation.
-.TP 8
-.B \-once
-causes the server to terminate (rather than reset) when the XDMCP session
-ends.
-.TP 8
-.B \-class \fIdisplay-class\fP
-XDMCP has an additional display qualifier used in resource lookup for
-display-specific options. This option sets that value, by default it
-is "MIT-Unspecified" (not a very useful value).
-.TP 8
-.B \-cookie \fIxdm-auth-bits\fP
-When testing XDM-AUTHENTICATION-1, a private key is shared between the
-server and the manager. This option sets the value of that private
-data (not that it is very private, being on the command line!).
-.TP 8
-.B \-displayID \fIdisplay-id\fP
-Yet another XDMCP specific value, this one allows the display manager to
-identify each display so that it can locate the shared key.
-.SH XKEYBOARD OPTIONS
-X servers that support the XKEYBOARD (a.k.a. \*qXKB\*q) extension accept the
-following options:
-.TP 8
-.B [+-]kb
-enables(+) or disables(-) the XKEYBOARD extension.
-.TP 8
-.BR [+-]accessx " [ \fItimeout\fP [ \fItimeout_mask\fP [ \fIfeedback\fP [ \fIoptions_mask\fP ] ] ] ]"
-enables(+) or disables(-) AccessX key sequences.
-.TP 8
-.B \-xkbdir \fIdirectory\fP
-base directory for keyboard layout files. This option is not available
-for setuid X servers (i.e., when the X server's real and effective uids
-are different).
-.TP 8
-.B \-ar1 \fImilliseconds\fP
-sets the autorepeat delay (length of time in milliseconds that a key must
-be depressed before autorepeat starts).
-.TP 8
-.B \-ar2 \fImilliseconds\fP
-sets the autorepeat interval (length of time in milliseconds that should
-elapse between autorepeat-generated keystrokes).
-.TP 8
-.B \-noloadxkb
-disables loading of an XKB keymap description on server startup.
-.TP 8
-.B \-xkbdb \fIfilename\fP
-uses \fIfilename\fP for default keyboard keymaps.
-.TP 8
-.B \-xkbmap \fIfilename\fP
-loads keyboard description in \fIfilename\fP on server startup.
-.SH SECURITY EXTENSION OPTIONS
-X servers that support the SECURITY extension accept the following option:
-.TP 8
-.B \-sp \fIfilename\fP
-causes the server to attempt to read and interpret filename as a security
-policy file with the format described below. The file is read at server
-startup and reread at each server reset.
-.PP
-The syntax of the security policy file is as follows.
-Notation: "*" means zero or more occurrences of the preceding element,
-and "+" means one or more occurrences. To interpret <foo/bar>, ignore
-the text after the /; it is used to distinguish between instances of
-<foo> in the next section.
-.PP
-.nf
-<policy file> ::= <version line> <other line>*
-
-<version line> ::= <string/v> '\en'
-
-<other line > ::= <comment> | <access rule> | <site policy> | <blank line>
-
-<comment> ::= # <not newline>* '\en'
-
-<blank line> ::= <space> '\en'
-
-<site policy> ::= sitepolicy <string/sp> '\en'
-
-<access rule> ::= property <property/ar> <window> <perms> '\en'
-
-<property> ::= <string>
-
-<window> ::= any | root | <required property>
-
-<required property> ::= <property/rp> | <property with value>
-
-<property with value> ::= <property/rpv> = <string/rv>
-
-<perms> ::= [ <operation> | <action> | <space> ]*
-
-<operation> ::= r | w | d
-
-<action> ::= a | i | e
-
-<string> ::= <dbl quoted string> | <single quoted string> | <unqouted string>
-
-<dbl quoted string> ::= <space> " <not dqoute>* " <space>
-
-<single quoted string> ::= <space> ' <not squote>* ' <space>
-
-<unquoted string> ::= <space> <not space>+ <space>
-
-<space> ::= [ ' ' | '\et' ]*
-
-Character sets:
-
-<not newline> ::= any character except '\en'
-<not dqoute> ::= any character except "
-<not squote> ::= any character except '
-<not space> ::= any character except those in <space>
-.fi
-.PP
-The semantics associated with the above syntax are as follows.
-.PP
-<version line>, the first line in the file, specifies the file format
-version. If the server does not recognize the version <string/v>, it
-ignores the rest of the file. The version string for the file format
-described here is "version-1" .
-.PP
-Once past the <version line>, lines that do not match the above syntax
-are ignored.
-.PP
-<comment> lines are ignored.
-.PP
-<sitepolicy> lines are currently ignored. They are intended to
-specify the site policies used by the XC-QUERY-SECURITY-1
-authorization method.
-.PP
-<access rule> lines specify how the server should react to untrusted
-client requests that affect the X Window property named <property/ar>.
-The rest of this section describes the interpretation of an
-<access rule>.
-.PP
-For an <access rule> to apply to a given instance of <property/ar>,
-<property/ar> must be on a window that is in the set of windows
-specified by <window>. If <window> is any, the rule applies to
-<property/ar> on any window. If <window> is root, the rule applies to
-<property/ar> only on root windows.
-.PP
-If <window> is <required property>, the following apply. If <required
-property> is a <property/rp>, the rule applies when the window also
-has that <property/rp>, regardless of its value. If <required
-property> is a <property with value>, <property/rpv> must also have
-the value specified by <string/rv>. In this case, the property must
-have type STRING and format 8, and should contain one or more
-null-terminated strings. If any of the strings match <string/rv>, the
-rule applies.
-.PP
-The definition of string matching is simple case-sensitive string
-comparison with one elaboration: the occurrence of the character '*' in
-<string/rv> is a wildcard meaning "any string." A <string/rv> can
-contain multiple wildcards anywhere in the string. For example, "x*"
-matches strings that begin with x, "*x" matches strings that end with
-x, "*x*" matches strings containing x, and "x*y*" matches strings that
-start with x and subsequently contain y.
-.PP
-There may be multiple <access rule> lines for a given <property/ar>.
-The rules are tested in the order that they appear in the file. The
-first rule that applies is used.
-.PP
-<perms> specify operations that untrusted clients may attempt, and
-the actions that the server should take in response to those operations.
-.PP
-<operation> can be r (read), w (write), or d (delete). The following
-table shows how X Protocol property requests map to these operations
-in The Open Group server implementation.
-.PP
-.nf
-GetProperty r, or r and d if delete = True
-ChangeProperty w
-RotateProperties r and w
-DeleteProperty d
-ListProperties none, untrusted clients can always list all properties
-.fi
-.PP
-<action> can be a (allow), i (ignore), or e (error). Allow means
-execute the request as if it had been issued by a trusted client.
-Ignore means treat the request as a no-op. In the case of
-GetProperty, ignore means return an empty property value if the
-property exists, regardless of its actual value. Error means do not
-execute the request and return a BadAtom error with the atom set to
-the property name. Error is the default action for all properties,
-including those not listed in the security policy file.
-.PP
-An <action> applies to all <operation>s that follow it, until the next
-<action> is encountered. Thus, irwad means ignore read and write,
-allow delete.
-.PP
-GetProperty and RotateProperties may do multiple operations (r and d,
-or r and w). If different actions apply to the operations, the most
-severe action is applied to the whole request; there is no partial
-request execution. The severity ordering is: allow < ignore < error.
-Thus, if the <perms> for a property are ired (ignore read, error
-delete), and an untrusted client attempts GetProperty on that property
-with delete = True, an error is returned, but the property value is
-not. Similarly, if any of the properties in a RotateProperties do not
-allow both read and write, an error is returned without changing any
-property values.
-.PP
-Here is an example security policy file.
-.PP
-.ta 3i 4i
-.nf
-version-1
-
-XCOMM Allow reading of application resources, but not writing.
-property RESOURCE_MANAGER root ar iw
-property SCREEN_RESOURCES root ar iw
-
-XCOMM Ignore attempts to use cut buffers. Giving errors causes apps to crash,
-XCOMM and allowing access may give away too much information.
-property CUT_BUFFER0 root irw
-property CUT_BUFFER1 root irw
-property CUT_BUFFER2 root irw
-property CUT_BUFFER3 root irw
-property CUT_BUFFER4 root irw
-property CUT_BUFFER5 root irw
-property CUT_BUFFER6 root irw
-property CUT_BUFFER7 root irw
-
-XCOMM If you are using Motif, you probably want these.
-property _MOTIF_DEFAULT_BINDINGS root ar iw
-property _MOTIF_DRAG_WINDOW root ar iw
-property _MOTIF_DRAG_TARGETS any ar iw
-property _MOTIF_DRAG_ATOMS any ar iw
-property _MOTIF_DRAG_ATOM_PAIRS any ar iw
-
-XCOMM The next two rules let xwininfo -tree work when untrusted.
-property WM_NAME any ar
-
-XCOMM Allow read of WM_CLASS, but only for windows with WM_NAME.
-XCOMM This might be more restrictive than necessary, but demonstrates
-XCOMM the <required property> facility, and is also an attempt to
-XCOMM say "top level windows only."
-property WM_CLASS WM_NAME ar
-
-XCOMM These next three let xlsclients work untrusted. Think carefully
-XCOMM before including these; giving away the client machine name and command
-XCOMM may be exposing too much.
-property WM_STATE WM_NAME ar
-property WM_CLIENT_MACHINE WM_NAME ar
-property WM_COMMAND WM_NAME ar
-
-XCOMM To let untrusted clients use the standard colormaps created by
-XCOMM xstdcmap, include these lines.
-property RGB_DEFAULT_MAP root ar
-property RGB_BEST_MAP root ar
-property RGB_RED_MAP root ar
-property RGB_GREEN_MAP root ar
-property RGB_BLUE_MAP root ar
-property RGB_GRAY_MAP root ar
-
-XCOMM To let untrusted clients use the color management database created
-XCOMM by xcmsdb, include these lines.
-property XDCCC_LINEAR_RGB_CORRECTION root ar
-property XDCCC_LINEAR_RGB_MATRICES root ar
-property XDCCC_GRAY_SCREENWHITEPOINT root ar
-property XDCCC_GRAY_CORRECTION root ar
-
-XCOMM To let untrusted clients use the overlay visuals that many vendors
-XCOMM support, include this line.
-property SERVER_OVERLAY_VISUALS root ar
-
-XCOMM Dumb examples to show other capabilities.
-
-XCOMM oddball property names and explicit specification of error conditions
-property "property with spaces" 'property with "' aw er ed
-
-XCOMM Allow deletion of Woo-Hoo if window also has property OhBoy with value
-XCOMM ending in "son". Reads and writes will cause an error.
-property Woo-Hoo OhBoy = "*son" ad
-
-.fi
-.SH "NETWORK CONNECTIONS"
-The X server supports client connections via a platform-dependent subset of
-the following transport types: TCP\/IP, Unix Domain sockets, DECnet,
-and several varieties of SVR4 local connections. See the DISPLAY
-NAMES section of the \fIX(__miscmansuffix__)\fP manual page to learn how to
-specify which transport type clients should try to use.
-.SH GRANTING ACCESS
-The X server implements a platform-dependent subset of the following
-authorization protocols: MIT-MAGIC-COOKIE-1, XDM-AUTHORIZATION-1,
-SUN-DES-1, and MIT-KERBEROS-5. See the \fIXsecurity\fP(__miscmansuffix__)
-manual page for information on the operation of these protocols.
-.PP
-Authorization data required by the above protocols is passed to the
-server in a private file named with the \fB\-auth\fP command line
-option. Each time the server is about to accept the first connection
-after a reset (or when the server is starting), it reads this file.
-If this file contains any authorization records, the local host is not
-automatically allowed access to the server, and only clients which
-send one of the authorization records contained in the file in the
-connection setup information will be allowed access. See the
-\fIXau\fP manual page for a description of the binary format of this
-file. See \fIxauth\fP(1) for maintenance of this file, and distribution
-of its contents to remote hosts.
-.PP
-The X server also uses a host-based access control list for deciding
-whether or not to accept connections from clients on a particular machine.
-If no other authorization mechanism is being used,
-this list initially consists of the host on which the server is running as
-well as any machines listed in the file \fI/etc/X\fBn\fI.hosts\fR, where
-\fBn\fP is the display number of the server. Each line of the file should
-contain either an Internet hostname (e.g. expo.lcs.mit.edu) or a DECnet
-hostname in double colon format (e.g. hydra::). There should be no leading
-or trailing spaces on any lines. For example:
-.sp
-.in +8
-.nf
-joesworkstation
-corporate.company.com
-star::
-bigcpu::
-.fi
-.in -8
-.PP
-Users can add or remove hosts from this list and enable or disable access
-control using the \fIxhost\fP command from the same machine as the server.
-.PP
-If the X FireWall Proxy (\fIxfwp\fP) is being used without a sitepolicy,
-host-based authorization must be turned on for clients to be able to
-connect to the X server via the \fIxfwp\fP. If \fIxfwp\fP is run without
-a configuration file and thus no sitepolicy is defined, if \fIxfwp\fP
-is using an X server where xhost + has been run to turn off host-based
-authorization checks, when a client tries to connect to this X server
-via \fIxfwp\fP, the X server will deny the connection. See \fIxfwp\fP(1)
-for more information about this proxy.
-.PP
-The X protocol intrinsically does not have any notion of window operation
-permissions or place any restrictions on what a client can do; if a program can
-connect to a display, it has full run of the screen.
-X servers that support the SECURITY extension fare better because clients
-can be designated untrusted via the authorization they use to connect; see
-the \fIxauth\fP(1) manual page for details. Restrictions are imposed
-on untrusted clients that curtail the mischief they can do. See the SECURITY
-extension specification for a complete list of these restrictions.
-.PP
-Sites that have better
-authentication and authorization systems might wish to make
-use of the hooks in the libraries and the server to provide additional
-security models.
-.SH SIGNALS
-The X server attaches special meaning to the following signals:
-.TP 8
-.I SIGHUP
-This signal causes the server to close all existing connections, free all
-resources, and restore all defaults. It is sent by the display manager
-whenever the main user's main application (usually an \fIxterm\fP or window
-manager) exits to force the server to clean up and prepare for the next
-user.
-.TP 8
-.I SIGTERM
-This signal causes the server to exit cleanly.
-.TP 8
-.I SIGUSR1
-This signal is used quite differently from either of the above. When the
-server starts, it checks to see if it has inherited SIGUSR1 as SIG_IGN
-instead of the usual SIG_DFL. In this case, the server sends a SIGUSR1 to
-its parent process after it has set up the various connection schemes.
-\fIXdm\fP uses this feature to recognize when connecting to the server
-is possible.
-.SH FONTS
-The X server
-can obtain fonts from directories and/or from font servers.
-The list of directories and font servers
-the X server uses when trying to open a font is controlled
-by the \fIfont path\fP.
-.LP
-The default font path is
-__projectroot__/lib/X11/fonts/misc/,
-__projectroot__/lib/X11/fonts/Speedo/,
-__projectroot__/lib/X11/fonts/Type1/,
-__projectroot__/lib/X11/fonts/75dpi/,
-__projectroot__/lib/X11/fonts/100dpi/" .
-.LP
-The font path can be set with the \fB\-fp\fP option or by \fIxset\fP(1)
-after the server has started.
-.SH FILES
-.TP 30
-.I /etc/X\fBn\fP.hosts
-Initial access control list for display number \fBn\fP
-.TP 30
-.IR __projectroot__/lib/X11/fonts/misc , __projectroot__/lib/X11/fonts/75dpi , __projectroot__/lib/X11/fonts/100dpi
-Bitmap font directories
-.TP 30
-.IR __projectroot__/lib/X11/fonts/Speedo , __projectroot__/lib/X11/fonts/Type1
-Outline font directories
-.TP 30
-.I __projectroot__/lib/X11/rgb.txt
-Color database
-.TP 30
-.I /tmp/.X11-unix/X\fBn\fP
-Unix domain socket for display number \fBn\fP
-.TP 30
-.IR /tmp/rcX\fBn\fP
-Kerberos 5 replay cache for display number \fBn\fP
-.TP 30
-.I /usr/adm/X\fBn\fPmsgs
-Error log file for display number \fBn\fP if run from \fIinit\fP(8)
-.TP 30
-.I __projectroot__/lib/X11/xdm/xdm-errors
-Default error log file if the server is run from \fIxdm\fP(1)
-.SH "SEE ALSO"
-General information: \fIX\fP(__miscmansuffix__)
-.PP
-Protocols:
-.I "X Window System Protocol,"
-.I "The X Font Service Protocol,"
-.I "X Display Manager Control Protocol"
-.PP
-Fonts: \fIbdftopcf\fP(1), \fImkfontdir\fP(1), \fIxfs\fP(1),
-\fIxlsfonts\fP(1), \fIxfontsel\fP(1), \fIxfd\fP(1),
-.I "X Logical Font Description Conventions"
-.PP
-Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1),
-\fIxdm\fP(1), \fIxhost\fP(1), \fIxfwp\fP(1)
-.I "Security Extension Specification"
-.PP
-Starting the server: \fIxdm(1)\fP, \fIxinit\fP(1)
-.PP
-Controlling the server once started: \fIxset\fP(1), \fIxsetroot\fP(1),
-\fIxhost\fP(1)
-.PP
-Server-specific man pages:
-\fIXdec\fP(1), \fIXmacII\fP(1), \fIXsun\fP(1), \fIXnest\fP(1),
-\fIXvfb\fP(1), \fIXFree86\fP(1), \fIXDarwin\fP(1).
-.PP
-Server internal documentation:
-.I "Definition of the Porting Layer for the X v11 Sample Server"
-.SH AUTHORS
-The sample server was originally written by Susan Angebranndt, Raymond
-Drewry, Philip Karlton, and Todd Newman, from Digital Equipment
-Corporation, with support from a large cast. It has since been
-extensively rewritten by Keith Packard and Bob Scheifler, from MIT.
-Dave Wiggins took over post-R5 and made substantial improvements.
diff --git a/doc/smartsched b/doc/smartsched
deleted file mode 100644
index 3d5a84b9b..000000000
--- a/doc/smartsched
+++ /dev/null
@@ -1,204 +0,0 @@
- Client Scheduling in X
- Keith Packard
- SuSE
- 10/28/99
-
-History:
-
-Since the original X server was written at Digital in 1987, the OS and DIX
-layers shared responsibility for scheduling the order to service
-client requests. The original design was simplistic; under the maximum
-first make it work, then make it work well, this was a good idea. Now
-that we have a bit more experience with X applications, it's time to
-rethink the design.
-
-The basic dispatch loop in DIX looks like:
-
- for (;;)
- {
- nready = WaitForSomething (...);
- while (nready--)
- {
- isItTimeToYield = FALSE;
- while (!isItTimeToYield)
- {
- if (!ReadRequestFromClient (...))
- break;
- (execute request);
- }
- }
- }
-
-WaitForSomething looks like:
-
- for (;;)
- if (ANYSET (ClientsWithInput))
- return popcount (ClientsWithInput);
- select (...)
- compute clientsReadable from select result;
- return popcount (clientsReadable)
- }
-
-ReadRequestFromClient looks like:
-
- if (!fullRequestQueued)
- {
- read ();
- if (!fullRequestQueued)
- {
- remove from ClientsWithInput;
- timesThisConnection = 0;
- return 0;
- }
- }
- if (twoFullRequestsQueued)
- add to ClientsWithInput;
-
- if (++timesThisConnection >= 10)
- {
- isItTimeToYield = TRUE;
- timesThisConnection = 0;
- }
- return 1;
-
-Here's what happens in this code:
-
-With a single client executing a stream of requests:
-
- A client sends a packet of requests to the server.
-
- WaitForSomething wakes up from select and returns that client
- to Dispatch
-
- Dispatch calls ReadRequestFromClient which reads a buffer (4K)
- full of requests from the client
-
- The server executes requests from this buffer until it emptys,
- in two stages -- 10 requests at a time are executed in the
- inner Dispatch loop, a buffer full of requests are executed
- because WaitForSomething immediately returns if any clients
- have complete requests pending in their input queues.
-
- When the buffer finally emptys, the next call to ReadRequest
- FromClient will return zero and Dispatch will go back to
- WaitForSomething; now that the client has no requests pending,
- WaitForSomething will block in select again. If the client
- is active, this select will immediately return that client
- as ready to read.
-
-With multiple clients sending streams of requests, the sequence
-of operations is similar, except that ReadRequestFromClient will
-set isItTimeToYield after each 10 requests executed causing the
-server to round-robin among the clients with available requests.
-
-It's important to realize here that any complete requests which have been
-read from clients will be executed before the server will use select again
-to discover input from other clients. A single busy client can easily
-monopolize the X server.
-
-So, the X server doesn't share well with clients which are more interactive
-in nature.
-
-The X server executes at most a buffer full of requests before again heading
-into select; ReadRequestFromClient causes the server to yield when the
-client request buffer doesn't contain a complete request. When
-that buffer is executed quickly, the server spends a lot of time
-in select discovering that the same client again has input ready. Thus
-the server also runs busy clients less efficiently than is would be
-possible.
-
-What to do.
-
-There are several things evident from the above discussion:
-
- 1 The server has a poor metric for deciding how much work it
- should do at one time on behalf of a particular client.
-
- 2 The server doesn't call select often enough to detect less
- aggressive clients in the face of busy clients, especially
- when those clients are executing slow requests.
-
- 3 The server calls select too often when executing fast requests.
-
- 4 Some priority scheme is needed to keep interactive clients
- responding to the user.
-
-And, there are some assumptions about how X applications work:
-
- 1 Each X request is executed relatively quickly; a request-granularity
- is good enough for interactive response almost all of the time.
-
- 2 X applications receiving mouse/keyboard events are likely to
- warrant additional attention from the X server.
-
-Instead of a request-count metric for work, a time-based metric should be
-used. The server should select a reasonable time slice for each client
-and execute requests for the entire timeslice before yielding to
-another client.
-
-Instead of returning immediately from WaitForSomething if clients have
-complete requests queued, the server should go through select each
-time and gather as many ready clients as possible. This involves
-polling instead of blocking and adding the ClientsWithInput to
-clientsReadable after the select returns.
-
-Instead of yielding when the request buffer is empty for a particular
-client, leave the yielding to the upper level scheduling and allow
-the server to try and read again from the socket. If the client
-is busy, another buffer full of requests will already be waiting
-to be delivered thus avoiding the call through select and the
-additional overhead in WaitForSomething.
-
-Finally, the dispatch loop should not simply execute requests from the
-first available client, instead each client should be prioritized with
-busy clients penalized and clients receiving user events praised.
-
-How it's done:
-
-Polling the current time of day from the OS is too expensive to
-be done at each request boundary, so instead an interval timer is
-set allowing the server to track time changes by counting invocations
-of the related signal handler. Instead of using the wall time for
-this purpose, the process CPU time is used instead. This serves
-two purposes -- first, it allows the server to consume no CPU cycles
-when idle, second it avoids conflicts with SIGALRM usage in other
-parts of the server code. It's not without problems though; other
-CPU intensive processes on the same machine can reduce interactive
-response time within the X server. The dispatch loop can now
-calculate an approximate time value using the number of signals
-received. The granularity of the timer sets the scheduling jitter,
-at 20ms it's only occasionally noticeable.
-
-The changes to WaitForSomething and ReadRequestFromClient are
-straightforward, adjusting when select is called and avoiding
-setting isItTimeToYield too often.
-
-The dispatch loop changes are more extensive, now instead of
-executing requests from all available clients, a single client
-is chosen after each call to WaitForSomething, requests are
-executed for that client and WaitForSomething is called again.
-
-Each client is assigned a priority, the dispatch loop chooses the
-client with the highest priority to execute. Priorities are
-updated in three ways:
-
- 1. Clients which consume their entire slice are penalized
- by having their priority reduced by one until they
- reach some minimum value.
-
- 2. Clients which have executed no requests for some time
- are praised by having their priority raised until they
- return to normal priority.
-
- 3. Clients which receive user input are praised by having
- their priority rased until they reach some maximal
- value, above normal priority.
-
-The effect of these changes is to both improve interactive application
-response and benchmark numbers at the same time.
-
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/smartsched,v 1.2 1999/11/19 14:59:16 hohndel Exp $
diff --git a/fb/fb.h b/fb/fb.h
deleted file mode 100644
index c9633d248..000000000
--- a/fb/fb.h
+++ /dev/null
@@ -1,2019 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.37 2003/11/03 05:11:00 tsi Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _FB_H_
-#define _FB_H_
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmap.h"
-#include "pixmapstr.h"
-#include "region.h"
-#include "gcstruct.h"
-#include "colormap.h"
-#include "miscstruct.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "migc.h"
-#include "mibstore.h"
-#ifdef RENDER
-#include "picturestr.h"
-#else
-#include "picture.h"
-#endif
-
-/*
- * This single define controls the basic size of data manipulated
- * by this software; it must be log2(sizeof (FbBits) * 8)
- */
-
-#ifndef FB_SHIFT
-#define FB_SHIFT LOG2_BITMAP_PAD
-#endif
-
-#if FB_SHIFT < LOG2_BITMAP_PAD
- error FB_SHIFT must be >= LOG2_BITMAP_PAD
-#endif
-
-#define FB_UNIT (1 << FB_SHIFT)
-#define FB_HALFUNIT (1 << (FB_SHIFT-1))
-#define FB_MASK (FB_UNIT - 1)
-#define FB_ALLONES ((FbBits) -1)
-
-#if GLYPHPADBYTES != 4
-#error "GLYPHPADBYTES must be 4"
-#endif
-#if GETLEFTBITS_ALIGNMENT != 1
-#error "GETLEFTBITS_ALIGNMENT must be 1"
-#endif
-/* whether to bother to include 24bpp support */
-#ifndef FBNO24BIT
-#define FB_24BIT
-#endif
-
-/*
- * Unless otherwise instructed, fb includes code to advertise 24bpp
- * windows with 32bpp image format for application compatibility
- */
-
-#ifdef FB_24BIT
-#ifndef FBNO24_32
-#define FB_24_32BIT
-#endif
-#endif
-
-#define FB_STIP_SHIFT LOG2_BITMAP_PAD
-#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
-#define FB_STIP_MASK (FB_STIP_UNIT - 1)
-#define FB_STIP_ALLONES ((FbStip) -1)
-
-#define FB_STIP_ODDSTRIDE(s) (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0)
-#define FB_STIP_ODDPTR(p) ((((long) (p)) & (FB_MASK >> 3)) != 0)
-
-#define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
-#define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
-
-#define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
-
-#if FB_SHIFT == 6
-# ifdef WIN32
-typedef unsigned __int64 FbBits;
-# else
-# if defined(__alpha__) || defined(__alpha) || \
- defined(ia64) || defined(__ia64__) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(AMD64) || defined (__AMD64__) || \
- (defined(sgi) && (_MIPS_SZLONG == 64))
-typedef unsigned long FbBits;
-# else
-typedef unsigned long long FbBits;
-# endif
-# endif
-#endif
-
-#if FB_SHIFT == 5
-typedef CARD32 FbBits;
-#endif
-
-#if FB_SHIFT == 4
-typedef CARD16 FbBits;
-#endif
-
-#if LOG2_BITMAP_PAD == FB_SHIFT
-typedef FbBits FbStip;
-#else
-# if LOG2_BITMAP_PAD == 5
-typedef CARD32 FbStip;
-# endif
-#endif
-
-typedef int FbStride;
-
-
-#ifdef FB_DEBUG
-extern void fbValidateDrawable(DrawablePtr d);
-extern void fbInitializeDrawable(DrawablePtr d);
-extern void fbSetBits (FbStip *bits, int stride, FbStip data);
-#define FB_HEAD_BITS (FbStip) (0xbaadf00d)
-#define FB_TAIL_BITS (FbStip) (0xbaddf0ad)
-#else
-#define fbValidateDrawable(d)
-#define fdInitializeDrawable(d)
-#endif
-
-#include "fbrop.h"
-
-#if BITMAP_BIT_ORDER == LSBFirst
-#define FbScrLeft(x,n) ((x) >> (n))
-#define FbScrRight(x,n) ((x) << (n))
-/* #define FbLeftBits(x,n) ((x) & ((((FbBits) 1) << (n)) - 1)) */
-#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
-#define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n)))
-#define FbPatternOffsetBits 0
-#else
-#define FbScrLeft(x,n) ((x) << (n))
-#define FbScrRight(x,n) ((x) >> (n))
-/* #define FbLeftBits(x,n) ((x) >> (FB_UNIT - (n))) */
-#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
-#define FbStipMoveLsb(x,s,n) (x)
-#define FbPatternOffsetBits (sizeof (FbBits) - 1)
-#endif
-
-#include "micoord.h"
-
-#define FbStipLeft(x,n) FbScrLeft(x,n)
-#define FbStipRight(x,n) FbScrRight(x,n)
-
-#define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
-#define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0)
-
-#define FbRotStipLeft(x,n) FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0)
-#define FbRotStipRight(x,n) FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0)
-
-#define FbLeftMask(x) ( ((x) & FB_MASK) ? \
- FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
-#define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
- FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
-
-#define FbLeftStipMask(x) ( ((x) & FB_STIP_MASK) ? \
- FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0)
-#define FbRightStipMask(x) ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \
- FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0)
-
-#define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \
- FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK))
-
-#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
- FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
-
-
-#define FbMaskBits(x,w,l,n,r) { \
- n = (w); \
- r = FbRightMask((x)+n); \
- l = FbLeftMask(x); \
- if (l) { \
- n -= FB_UNIT - ((x) & FB_MASK); \
- if (n < 0) { \
- n = 0; \
- l &= r; \
- r = 0; \
- } \
- } \
- n >>= FB_SHIFT; \
-}
-
-#ifdef FBNOPIXADDR
-#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) FbMaskBits(x,w,l,n,r)
-#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
- *dst = FbDoMaskRRop(*dst,and,xor,l); \
-}
-#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
- *dst = FbDoMaskRRop(*dst,and,xor,r); \
-}
-#else
-
-#define FbByteMaskInvalid 0x10
-
-#define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
-
-#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
-#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
-#define FbStorePart(dst,off,t,xor) (*FbPtrOffset(dst,off,t) = \
- FbSelectPart(xor,off,t))
-#ifndef FbSelectPart
-#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
-#endif
-
-#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \
- n = (w); \
- lb = 0; \
- rb = 0; \
- r = FbRightMask((x)+n); \
- if (r) { \
- /* compute right byte length */ \
- if ((copy) && (((x) + n) & 7) == 0) { \
- rb = (((x) + n) & FB_MASK) >> 3; \
- } else { \
- rb = FbByteMaskInvalid; \
- } \
- } \
- l = FbLeftMask(x); \
- if (l) { \
- /* compute left byte length */ \
- if ((copy) && ((x) & 7) == 0) { \
- lb = ((x) & FB_MASK) >> 3; \
- } else { \
- lb = FbByteMaskInvalid; \
- } \
- /* subtract out the portion painted by leftMask */ \
- n -= FB_UNIT - ((x) & FB_MASK); \
- if (n < 0) { \
- if (lb != FbByteMaskInvalid) { \
- if (rb == FbByteMaskInvalid) { \
- lb = FbByteMaskInvalid; \
- } else if (rb) { \
- lb |= (rb - lb) << (FB_SHIFT - 3); \
- rb = 0; \
- } \
- } \
- n = 0; \
- l &= r; \
- r = 0; \
- }\
- } \
- n >>= FB_SHIFT; \
-}
-
-#if FB_SHIFT == 6
-#define FbDoLeftMaskByteRRop6Cases(dst,xor) \
- case (sizeof (FbBits) - 7) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 7) | (2 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 7) | (3 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 7) | (4 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 7) | (5 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 7) | (6 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 7): \
- FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
- break; \
- case (sizeof (FbBits) - 6) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 6) | (2 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 6) | (3 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 6) | (4 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 6) | (5 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 6): \
- FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
- break; \
- case (sizeof (FbBits) - 5) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 5) | (2 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 5) | (3 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 5) | (4 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 5): \
- FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
- break; \
- case (sizeof (FbBits) - 4) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 4) | (2 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- break; \
- case (sizeof (FbBits) - 4) | (3 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 4): \
- FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
- break;
-
-#define FbDoRightMaskByteRRop6Cases(dst,xor) \
- case 4: \
- FbStorePart(dst,0,CARD32,xor); \
- break; \
- case 5: \
- FbStorePart(dst,0,CARD32,xor); \
- FbStorePart(dst,4,CARD8,xor); \
- break; \
- case 6: \
- FbStorePart(dst,0,CARD32,xor); \
- FbStorePart(dst,4,CARD16,xor); \
- break; \
- case 7: \
- FbStorePart(dst,0,CARD32,xor); \
- FbStorePart(dst,4,CARD16,xor); \
- FbStorePart(dst,6,CARD8,xor); \
- break;
-#else
-#define FbDoLeftMaskByteRRop6Cases(dst,xor)
-#define FbDoRightMaskByteRRop6Cases(dst,xor)
-#endif
-
-#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
- switch (lb) { \
- FbDoLeftMaskByteRRop6Cases(dst,xor) \
- case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
- break; \
- case sizeof (FbBits) - 3: \
- FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
- case sizeof (FbBits) - 2: \
- FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
- break; \
- case sizeof (FbBits) - 1: \
- FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
- break; \
- default: \
- *dst = FbDoMaskRRop(*dst, and, xor, l); \
- break; \
- } \
-}
-
-
-#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
- switch (rb) { \
- case 1: \
- FbStorePart(dst,0,CARD8,xor); \
- break; \
- case 2: \
- FbStorePart(dst,0,CARD16,xor); \
- break; \
- case 3: \
- FbStorePart(dst,0,CARD16,xor); \
- FbStorePart(dst,2,CARD8,xor); \
- break; \
- FbDoRightMaskByteRRop6Cases(dst,xor) \
- default: \
- *dst = FbDoMaskRRop (*dst, and, xor, r); \
- } \
-}
-#endif
-
-#define FbMaskStip(x,w,l,n,r) { \
- n = (w); \
- r = FbRightStipMask((x)+n); \
- l = FbLeftStipMask(x); \
- if (l) { \
- n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \
- if (n < 0) { \
- n = 0; \
- l &= r; \
- r = 0; \
- } \
- } \
- n >>= FB_STIP_SHIFT; \
-}
-
-/*
- * These macros are used to transparently stipple
- * in copy mode; the expected usage is with 'n' constant
- * so all of the conditional parts collapse into a minimal
- * sequence of partial word writes
- *
- * 'n' is the bytemask of which bytes to store, 'a' is the address
- * of the FbBits base unit, 'o' is the offset within that unit
- *
- * The term "lane" comes from the hardware term "byte-lane" which
- */
-
-#define FbLaneCase1(n,a,o) ((n) == 0x01 ? \
- (*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \
- fgxor) : 0)
-#define FbLaneCase2(n,a,o) ((n) == 0x03 ? \
- (*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \
- fgxor) : \
- ((void)FbLaneCase1((n)&1,a,o), \
- FbLaneCase1((n)>>1,a,(o)+1)))
-#define FbLaneCase4(n,a,o) ((n) == 0x0f ? \
- (*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \
- fgxor) : \
- ((void)FbLaneCase2((n)&3,a,o), \
- FbLaneCase2((n)>>2,a,(o)+2)))
-#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (*(FbBits *) ((a)+(o)) = fgxor) : \
- ((void)FbLaneCase4((n)&15,a,o), \
- FbLaneCase4((n)>>4,a,(o)+4)))
-
-#if FB_SHIFT == 6
-#define FbLaneCase(n,a) FbLaneCase8(n,(CARD8 *) (a),0)
-#endif
-
-#if FB_SHIFT == 5
-#define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)
-#endif
-
-/* Rotate a filled pixel value to the specified alignement */
-#define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b)))
-#define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b)))
-
-/* step a filled pixel value to the next/previous FB_UNIT alignment */
-#define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24)))
-#define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24))
-#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))
-#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))
-
-/* step a rotation value to the next/previous rotation value */
-#if FB_UNIT == 64
-#define FbNext24Rot(r) ((r) == 16 ? 0 : (r) + 8)
-#define FbPrev24Rot(r) ((r) == 0 ? 16 : (r) - 8)
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define FbFirst24Rot(x) (((x) + 8) % 24)
-#else
-#define FbFirst24Rot(x) ((x) % 24)
-#endif
-
-#endif
-
-#if FB_UNIT == 32
-#define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8)
-#define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8)
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define FbFirst24Rot(x) (((x) + 16) % 24)
-#else
-#define FbFirst24Rot(x) ((x) % 24)
-#endif
-#endif
-
-#define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)
-#define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)
-
-/* Whether 24-bit specific code is needed for this filled pixel value */
-#define FbCheck24Pix(p) ((p) == FbNext24Pix(p))
-
-/* Macros for dealing with dashing */
-
-#define FbDashDeclare \
- unsigned char *__dash, *__firstDash, *__lastDash
-
-#define FbDashInit(pGC,pPriv,dashOffset,dashlen,even) { \
- (even) = TRUE; \
- __firstDash = (pGC)->dash; \
- __lastDash = __firstDash + (pGC)->numInDashList; \
- (dashOffset) %= (pPriv)->dashLength; \
- \
- __dash = __firstDash; \
- while ((dashOffset) >= ((dashlen) = *__dash)) \
- { \
- (dashOffset) -= (dashlen); \
- (even) = 1-(even); \
- if (++__dash == __lastDash) \
- __dash = __firstDash; \
- } \
- (dashlen) -= (dashOffset); \
-}
-
-#define FbDashNext(dashlen) { \
- if (++__dash == __lastDash) \
- __dash = __firstDash; \
- (dashlen) = *__dash; \
-}
-
-/* as numInDashList is always even, this case can skip a test */
-
-#define FbDashNextEven(dashlen) { \
- (dashlen) = *++__dash; \
-}
-
-#define FbDashNextOdd(dashlen) FbDashNext(dashlen)
-
-#define FbDashStep(dashlen,even) { \
- if (!--(dashlen)) { \
- FbDashNext(dashlen); \
- (even) = 1-(even); \
- } \
-}
-
-extern int fbGCPrivateIndex;
-#ifndef FB_NO_WINDOW_PIXMAPS
-extern int fbWinPrivateIndex;
-#endif
-extern const GCOps fbGCOps;
-extern const GCFuncs fbGCFuncs;
-
-#ifdef TEKX11
-#define FB_OLD_GC
-#define FB_OLD_SCREEN
-#endif
-
-#ifdef FB_OLD_SCREEN
-extern WindowPtr *WindowTable;
-#endif
-
-#ifdef FB_24_32BIT
-#define FB_SCREEN_PRIVATE
-#endif
-
-#ifdef FB_SCREEN_PRIVATE
-extern int fbScreenPrivateIndex;
-
-/* private field of a screen */
-typedef struct {
- unsigned char win32bpp; /* window bpp for 32-bpp images */
- unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
-} FbScreenPrivRec, *FbScreenPrivPtr;
-
-#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
- (pScreen)->devPrivates[fbScreenPrivateIndex].ptr)
-#endif
-
-/* private field of GC */
-typedef struct {
-#ifdef FB_OLD_GC
- unsigned char pad1;
- unsigned char pad2;
- unsigned char pad3;
- unsigned fExpose:1;
- unsigned freeCompClip:1;
- PixmapPtr pRotatedPixmap;
- RegionPtr pCompositeClip;
-#endif
- FbBits and, xor; /* reduced rop values */
- FbBits bgand, bgxor; /* for stipples */
- FbBits fg, bg, pm; /* expanded and filled */
- unsigned int dashLength; /* total of all dash elements */
- unsigned char oneRect; /* clip list is single rectangle */
- unsigned char evenStipple; /* stipple is even */
- unsigned char bpp; /* current drawable bpp */
-} FbGCPrivRec, *FbGCPrivPtr;
-
-#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
- (pGC)->devPrivates[fbGCPrivateIndex].ptr)
-
-#ifdef FB_OLD_GC
-#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
-#define fbGetExpose(pGC) (fbGetGCPrivate(pGC)->fExpose)
-#define fbGetFreeCompClip(pGC) (fbGetGCPrivate(pGC)->freeCompClip)
-#define fbGetRotatedPixmap(pGC) (fbGetGCPrivate(pGC)->pRotatedPixmap)
-#else
-#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
-#define fbGetExpose(pGC) ((pGC)->fExpose)
-#define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip)
-#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
-#endif
-
-#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
-#ifdef FB_NO_WINDOW_PIXMAPS
-#define fbGetWindowPixmap(d) fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
-#else
-#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
- ((WindowPtr) (pWin))->devPrivates[fbWinPrivateIndex].ptr)
-#endif
-
-#ifdef __DARWIN__
-#define __fbPixOriginX(pPix) ((pPix)->drawable.x)
-#define __fbPixOriginY(pPix) ((pPix)->drawable.y)
-#else
-#define __fbPixOriginX(pPix) 0
-#define __fbPixOriginY(pPix) 0
-#endif
-
-#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) \
- _pPix = fbGetWindowPixmap(pDrawable); \
- else \
- _pPix = (PixmapPtr) (pDrawable); \
- (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
- (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
- (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
- (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \
- (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \
-}
-
-#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) \
- _pPix = fbGetWindowPixmap(pDrawable); \
- else \
- _pPix = (PixmapPtr) (pDrawable); \
- (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
- (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
- (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
- (xoff) = __fbPixOriginX(_pPix); (void)(xoff); \
- (yoff) = __fbPixOriginY(_pPix); (void)(yoff); \
-}
-
-/*
- * XFree86 empties the root BorderClip when the VT is inactive,
- * here's a macro which uses that to disable GetImage and GetSpans
- */
-
-#define fbWindowEnabled(pWin) \
- REGION_NOTEMPTY((pWin)->drawable.pScreen, \
- &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
-
-#define fbDrawableEnabled(pDrawable) \
- ((pDrawable)->type == DRAWABLE_PIXMAP ? \
- TRUE : fbWindowEnabled((WindowPtr) pDrawable))
-
-#ifdef FB_OLD_SCREEN
-#define BitsPerPixel(d) (\
- ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
- (PixmapWidthPaddingInfo[d].padRoundUp+1)))
-#endif
-
-#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
-/*
- * Accelerated tiles are power of 2 width <= FB_UNIT
- */
-#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
-/*
- * Accelerated stipples are power of 2 width and <= FB_UNIT/dstBpp
- * with dstBpp a power of 2 as well
- */
-#define FbEvenStip(w,bpp) ((w) * (bpp) <= FB_UNIT && FbPowerOfTwo(w) && FbPowerOfTwo(bpp))
-
-/*
- * fb24_32.c
- */
-void
-fb24_32GetSpans(DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart);
-
-void
-fb24_32SetSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- char *src,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted);
-
-void
-fb24_32PutZImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- int alu,
- FbBits pm,
- int x,
- int y,
- int width,
- int height,
- CARD8 *src,
- FbStride srcStride);
-
-void
-fb24_32GetImage (DrawablePtr pDrawable,
- int x,
- int y,
- int w,
- int h,
- unsigned int format,
- unsigned long planeMask,
- char *d);
-
-void
-fb24_32CopyMtoN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-PixmapPtr
-fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel);
-
-Bool
-fb24_32CreateScreenResources(ScreenPtr pScreen);
-
-Bool
-fb24_32ModifyPixmapHeader (PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData);
-
-/*
- * fballpriv.c
- */
-Bool
-fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex);
-
-/*
- * fbarc.c
- */
-
-void
-fbPolyArc (DrawablePtr pDrawable,
- GCPtr pGC,
- int narcs,
- xArc *parcs);
-
-/*
- * fbbits.c
- */
-
-void
-fbBresSolid8(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbBresDash8 (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbDots8 (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor);
-
-void
-fbArc8 (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int dx,
- int dy,
- FbBits and,
- FbBits xor);
-
-void
-fbGlyph8 (FbBits *dstLine,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int height,
- int shift);
-
-void
-fbPolyline8 (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ptsOrig);
-
-void
-fbPolySegment8 (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg);
-
-void
-fbBresSolid16(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbBresDash16(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbDots16(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor);
-
-void
-fbArc16(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int dx,
- int dy,
- FbBits and,
- FbBits xor);
-
-void
-fbGlyph16(FbBits *dstLine,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int height,
- int shift);
-
-void
-fbPolyline16 (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ptsOrig);
-
-void
-fbPolySegment16 (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg);
-
-
-void
-fbBresSolid24(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbBresDash24(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbDots24(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor);
-
-void
-fbArc24(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int dx,
- int dy,
- FbBits and,
- FbBits xor);
-
-void
-fbGlyph24(FbBits *dstLine,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int height,
- int shift);
-
-void
-fbPolyline24 (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ptsOrig);
-
-void
-fbPolySegment24 (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg);
-
-
-void
-fbBresSolid32(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbBresDash32(DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbDots32(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor);
-
-void
-fbArc32(FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int dx,
- int dy,
- FbBits and,
- FbBits xor);
-
-void
-fbGlyph32(FbBits *dstLine,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int height,
- int shift);
-void
-fbPolyline32 (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ptsOrig);
-
-void
-fbPolySegment32 (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg);
-
-/*
- * fbblt.c
- */
-void
-fbBlt (FbBits *src,
- FbStride srcStride,
- int srcX,
-
- FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp,
-
- Bool reverse,
- Bool upsidedown);
-
-void
-fbBlt24 (FbBits *srcLine,
- FbStride srcStride,
- int srcX,
-
- FbBits *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
-
- Bool reverse,
- Bool upsidedown);
-
-void
-fbBltStip (FbStip *src,
- FbStride srcStride, /* in FbStip units, not FbBits units */
- int srcX,
-
- FbStip *dst,
- FbStride dstStride, /* in FbStip units, not FbBits units */
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp);
-
-/*
- * fbbltone.c
- */
-void
-fbBltOne (FbStip *src,
- FbStride srcStride,
- int srcX,
- FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbBits fgand,
- FbBits fbxor,
- FbBits bgand,
- FbBits bgxor);
-
-#ifdef FB_24BIT
-void
-fbBltOne24 (FbStip *src,
- FbStride srcStride, /* FbStip units per scanline */
- int srcX, /* bit position of source */
- FbBits *dst,
- FbStride dstStride, /* FbBits units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- FbBits fgand, /* rrop values */
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor);
-#endif
-
-void
-fbBltPlane (FbBits *src,
- FbStride srcStride,
- int srcX,
- int srcBpp,
-
- FbStip *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbStip fgand,
- FbStip fgxor,
- FbStip bgand,
- FbStip bgxor,
- Pixel planeMask);
-
-/*
- * fbbstore.c
- */
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-/*
- * fbcmap.c
- */
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
-
-void
-fbInstallColormap(ColormapPtr pmap);
-
-void
-fbUninstallColormap(ColormapPtr pmap);
-
-void
-fbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual);
-
-Bool
-fbInitializeColormap(ColormapPtr pmap);
-
-int
-fbExpandDirectColors (ColormapPtr pmap,
- int ndef,
- xColorItem *indefs,
- xColorItem *outdefs);
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen);
-
-void
-fbClearVisualTypes(void);
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
-
-Bool
-fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
- Pixel redMask, Pixel greenMask, Pixel blueMask);
-
-Bool
-fbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB);
-
-/*
- * fbcopy.c
- */
-
-typedef void (*fbCopyProc) (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pDstBox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbCopyNtoN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbCopy1toN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbCopyNto1 (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbCopyRegion (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- RegionPtr pDstRegion,
- int dx,
- int dy,
- fbCopyProc copyProc,
- Pixel bitPlane,
- void *closure);
-
-RegionPtr
-fbDoCopy (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut,
- fbCopyProc copyProc,
- Pixel bitplane,
- void *closure);
-
-RegionPtr
-fbCopyArea (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut);
-
-RegionPtr
-fbCopyPlane (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut,
- unsigned long bitplane);
-
-/*
- * fbfill.c
- */
-void
-fbFill (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int width,
- int height);
-
-void
-fbSolidBoxClipped (DrawablePtr pDrawable,
- RegionPtr pClip,
- int xa,
- int ya,
- int xb,
- int yb,
- FbBits and,
- FbBits xor);
-
-/*
- * fbfillrect.c
- */
-void
-fbPolyFillRect(DrawablePtr pDrawable,
- GCPtr pGC,
- int nrectInit,
- xRectangle *prectInit);
-
-#define fbPolyFillArc miPolyFillArc
-
-#define fbFillPolygon miFillPolygon
-
-/*
- * fbfillsp.c
- */
-void
-fbFillSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted);
-
-
-/*
- * fbgc.c
- */
-
-Bool
-fbCreateGC(GCPtr pGC);
-
-void
-fbPadPixmap (PixmapPtr pPixmap);
-
-void
-fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
-
-/*
- * fbgetsp.c
- */
-void
-fbGetSpans(DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart);
-
-/*
- * fbglyph.c
- */
-
-Bool
-fbGlyphIn (RegionPtr pRegion,
- int x,
- int y,
- int width,
- int height);
-
-void
-fbPolyGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase);
-
-void
-fbImageGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase);
-
-/*
- * fbimage.c
- */
-
-void
-fbPutImage (DrawablePtr pDrawable,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage);
-
-void
-fbPutZImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- int alu,
- FbBits pm,
- int x,
- int y,
- int width,
- int height,
- FbStip *src,
- FbStride srcStride);
-
-void
-fbPutXYImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- FbBits fg,
- FbBits bg,
- FbBits pm,
- int alu,
- Bool opaque,
-
- int x,
- int y,
- int width,
- int height,
-
- FbStip *src,
- FbStride srcStride,
- int srcX);
-
-void
-fbGetImage (DrawablePtr pDrawable,
- int x,
- int y,
- int w,
- int h,
- unsigned int format,
- unsigned long planeMask,
- char *d);
-/*
- * fbline.c
- */
-
-void
-fbZeroLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt);
-
-void
-fbZeroSegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSegs);
-
-void
-fbPolyLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt);
-
-void
-fbFixCoordModePrevious (int npt,
- DDXPointPtr ppt);
-
-void
-fbPolySegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg);
-
-#define fbPolyRectangle miPolyRectangle
-
-/*
- * fbpict.c
- */
-
-Bool
-fbPictureInit (ScreenPtr pScreen,
- PictFormatPtr formats,
- int nformats);
-
-/*
- * fbpixmap.c
- */
-
-PixmapPtr
-fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp);
-
-PixmapPtr
-fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth);
-
-Bool
-fbDestroyPixmap (PixmapPtr pPixmap);
-
-RegionPtr
-fbPixmapToRegion(PixmapPtr pPix);
-
-/*
- * fbpoint.c
- */
-
-void
-fbDots (FbBits *dstOrig,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits andOrig,
- FbBits xorOrig);
-
-void
-fbPolyPoint (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit);
-
-/*
- * fbpush.c
- */
-void
-fbPushPattern (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
-
- int width,
- int height);
-
-void
-fbPushFill (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
- int width,
- int height);
-
-void
-fbPush1toN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbPushImage (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
- int width,
- int height);
-
-void
-fbPushPixels (GCPtr pGC,
- PixmapPtr pBitmap,
- DrawablePtr pDrawable,
- int dx,
- int dy,
- int xOrg,
- int yOrg);
-
-
-/*
- * fbscreen.c
- */
-
-Bool
-fbCloseScreen (int indx, ScreenPtr pScreen);
-
-Bool
-fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
-
-Bool
-fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
-
-void
-fbQueryBestSize (int class,
- unsigned short *width, unsigned short *height,
- ScreenPtr pScreen);
-
-#ifndef FB_OLD_SCREEN
-PixmapPtr
-_fbGetWindowPixmap (WindowPtr pWindow);
-
-void
-_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap);
-#endif
-
-Bool
-fbSetupScreen(ScreenPtr pScreen,
- pointer pbits, /* pointer to screen bitmap */
- int xsize, /* in pixels */
- int ysize,
- int dpix, /* dots per inch */
- int dpiy,
- int width, /* pixel width of frame buffer */
- int bpp); /* bits per pixel of frame buffer */
-
-Bool
-fbFinishScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp);
-
-Bool
-fbScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp);
-
-void
-fbInitializeBackingStore (ScreenPtr pScreen);
-
-/*
- * fbseg.c
- */
-typedef void FbBres (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-FbBres fbBresSolid, fbBresDash, fbBresFill, fbBresFillDash;
-/*
- * fbsetsp.c
- */
-
-void
-fbSetSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- char *src,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted);
-
-FbBres *
-fbSelectBres (DrawablePtr pDrawable,
- GCPtr pGC);
-
-void
-fbBres (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x,
- int y,
- int e,
- int e1,
- int e3,
- int len);
-
-void
-fbSegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int xa,
- int ya,
- int xb,
- int yb,
- Bool drawLast,
- int *dashOffset);
-
-
-/*
- * fbsolid.c
- */
-
-void
-fbSolid (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int bpp,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor);
-
-#ifdef FB_24BIT
-void
-fbSolid24 (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor);
-#endif
-
-/*
- * fbstipple.c
- */
-
-void
-fbTransparentSpan (FbBits *dst,
- FbBits stip,
- FbBits fgxor,
- int n);
-
-void
-fbEvenStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipHeight,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot);
-
-void
-fbOddStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipWidth,
- int stipHeight,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot);
-
-void
-fbStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipWidth,
- int stipHeight,
- Bool even,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot);
-
-/*
- * fbtile.c
- */
-
-void
-fbEvenTile (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int xRot,
- int yRot);
-
-void
-fbOddTile (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- FbStride tileStride,
- int tileWidth,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int bpp,
-
- int xRot,
- int yRot);
-
-void
-fbTile (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- FbStride tileStride,
- int tileWidth,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int bpp,
-
- int xRot,
- int yRot);
-
-/*
- * fbutil.c
- */
-FbBits
-fbReplicatePixel (Pixel p, int bpp);
-
-void
-fbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp);
-
-/*
- * fbwindow.c
- */
-
-Bool
-fbCreateWindow(WindowPtr pWin);
-
-Bool
-fbDestroyWindow(WindowPtr pWin);
-
-Bool
-fbMapWindow(WindowPtr pWindow);
-
-Bool
-fbPositionWindow(WindowPtr pWin, int x, int y);
-
-Bool
-fbUnmapWindow(WindowPtr pWindow);
-
-void
-fbCopyWindowProc (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure);
-
-void
-fbCopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-
-Bool
-fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
-
-void
-fbFillRegionSolid (DrawablePtr pDrawable,
- RegionPtr pRegion,
- FbBits and,
- FbBits xor);
-
-void
-fbFillRegionTiled (DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile);
-
-void
-fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
-
-#endif /* _FB_H_ */
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
deleted file mode 100644
index 1f9e843cf..000000000
--- a/fb/fb24_32.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fb24_32.c,v 1.5 2001/05/29 04:54:08 keithp Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#endif
-
-#include "fb.h"
-
-/* X apps don't like 24bpp images, this code exposes 32bpp images */
-
-/*
- * These two functions do a full CopyArea while reformatting
- * the data between 24 and 32bpp. They try to go a bit faster
- * by reading/writing aligned CARD32s where it's easy
- */
-
-#define Get8(a) ((CARD32) *(a))
-
-#if BITMAP_BIT_ORDER == MSBFirst
-#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2))
-#define Put24(a,p) (((a)[0] = (CARD8) ((p) >> 16)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) (p)))
-#else
-#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16))
-#define Put24(a,p) (((a)[0] = (CARD8) (p)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) ((p) >> 16)))
-#endif
-
-typedef void (*fb24_32BltFunc) (CARD8 *srcLine,
- FbStride srcStride,
- int srcX,
-
- CARD8 *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm);
-
-static void
-fb24_32BltDown (CARD8 *srcLine,
- FbStride srcStride,
- int srcX,
-
- CARD8 *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm)
-{
- CARD32 *src;
- CARD8 *dst;
- int w;
- Bool destInvarient;
- CARD32 pixel, dpixel;
- FbDeclareMergeRop ();
-
- srcLine += srcX * 4;
- dstLine += dstX * 3;
-
- FbInitializeMergeRop(alu, (pm | ~(FbBits) 0xffffff));
- destInvarient = FbDestInvarientMergeRop();
-
- while (height--)
- {
- src = (CARD32 *) srcLine;
- dst = dstLine;
- srcLine += srcStride;
- dstLine += dstStride;
- w = width;
- if (destInvarient)
- {
- while (((long) dst & 3) && w)
- {
- w--;
- pixel = *src++;
- pixel = FbDoDestInvarientMergeRop(pixel);
- Put24 (dst, pixel);
- dst += 3;
- }
- /* Do four aligned pixels at a time */
- while (w >= 4)
- {
- CARD32 s0, s1;
- s0 = *src++;
- s0 = FbDoDestInvarientMergeRop(s0);
- s1 = *src++;
- s1 = FbDoDestInvarientMergeRop(s1);
-#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst) = (s0 & 0xffffff) | (s1 << 24);
-#else
- *(CARD32 *)(dst) = (s0 << 8) | ((s1 & 0xffffff) >> 16);
-#endif
- s0 = *src++;
- s0 = FbDoDestInvarientMergeRop(s0);
-#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+4) = ((s1 & 0xffffff) >> 8) | (s0 << 16);
-#else
- *(CARD32 *)(dst+4) = (s1 << 16) | ((s0 & 0xffffff) >> 8);
-#endif
- s1 = *src++;
- s1 = FbDoDestInvarientMergeRop(s1);
-#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+8) = ((s0 & 0xffffff) >> 16) | (s1 << 8);
-#else
- *(CARD32 *)(dst+8) = (s0 << 24) | (s1 & 0xffffff);
-#endif
- dst += 12;
- w -= 4;
- }
- while (w--)
- {
- pixel = *src++;
- pixel = FbDoDestInvarientMergeRop(pixel);
- Put24 (dst, pixel);
- dst += 3;
- }
- }
- else
- {
- while (w--)
- {
- pixel = *src++;
- dpixel = Get24 (dst);
- pixel = FbDoMergeRop(pixel, dpixel);
- Put24 (dst, pixel);
- dst += 3;
- }
- }
- }
-}
-
-static void
-fb24_32BltUp (CARD8 *srcLine,
- FbStride srcStride,
- int srcX,
-
- CARD8 *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm)
-{
- CARD8 *src;
- CARD32 *dst;
- int w;
- Bool destInvarient;
- CARD32 pixel;
- FbDeclareMergeRop ();
-
- FbInitializeMergeRop(alu, (pm | (~(FbBits) 0xffffff)));
- destInvarient = FbDestInvarientMergeRop();
-
- srcLine += srcX * 3;
- dstLine += dstX * 4;
-
- while (height--)
- {
- w = width;
- src = srcLine;
- dst = (CARD32 *) dstLine;
- srcLine += srcStride;
- dstLine += dstStride;
- if (destInvarient)
- {
- while (((long) src & 3) && w)
- {
- w--;
- pixel = Get24(src);
- src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- }
- /* Do four aligned pixels at a time */
- while (w >= 4)
- {
- CARD32 s0, s1;
-
- s0 = *(CARD32 *)(src);
-#if BITMAP_BIT_ORDER == LSBFirst
- pixel = s0 & 0xffffff;
-#else
- pixel = s0 >> 8;
-#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s1 = *(CARD32 *)(src+4);
-#if BITMAP_BIT_ORDER == LSBFirst
- pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff);
-#else
- pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16);
-#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s0 = *(CARD32 *)(src+8);
-#if BITMAP_BIT_ORDER == LSBFirst
- pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff);
-#else
- pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24);
-#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
-#if BITMAP_BIT_ORDER == LSBFirst
- pixel = s0 >> 8;
-#else
- pixel = s0 & 0xffffff;
-#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- src += 12;
- w -= 4;
- }
- while (w)
- {
- w--;
- pixel = Get24(src);
- src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- }
- }
- else
- {
- while (w--)
- {
- pixel = Get24(src);
- src += 3;
- *dst = FbDoMergeRop(pixel, *dst);
- dst++;
- }
- }
- }
-}
-
-/*
- * Spans functions; probably unused.
- */
-void
-fb24_32GetSpans(DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart)
-{
- FbBits *srcBits;
- CARD8 *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- CARD8 *dst;
-
- fbGetDrawable (pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
- src = (CARD8 *) srcBits;
- srcStride *= sizeof (FbBits);
-
- while (nspans--)
- {
- dst = (CARD8 *) pchardstStart;
- fb24_32BltUp (src + (ppt->y + srcYoff) * srcStride, srcStride,
- ppt->x + srcXoff,
-
- dst,
- 1,
- 0,
-
- *pwidth,
- 1,
-
- GXcopy,
- FB_ALLONES);
-
- pchardstStart += PixmapBytePad(*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
-}
-
-void
-fb24_32SetSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- char *src,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- RegionPtr pClip = fbGetCompositeClip(pGC);
- FbBits *dstBits;
- CARD8 *dst, *d, *s;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- BoxPtr pbox;
- int n;
- int x1, x2;
-
- fbGetDrawable (pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
- dst = (CARD8 *) dstBits;
- dstStride *= sizeof (FbBits);
- while (nspans--)
- {
- d = dst + (ppt->y + dstYoff) * dstStride;
- s = (CARD8 *) src;
- n = REGION_NUM_RECTS(pClip);
- pbox = REGION_RECTS (pClip);
- while (n--)
- {
- if (pbox->y1 > ppt->y)
- break;
- if (pbox->y2 > ppt->y)
- {
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- if (pbox->x1 > x1)
- x1 = pbox->x1;
- if (pbox->x2 < x2)
- x2 = pbox->x2;
- if (x1 < x2)
- fb24_32BltDown (s,
- 0,
- (x1 - ppt->x),
- d,
- dstStride,
- x1 + dstXoff,
-
- (x2 - x1),
- 1,
- pGC->alu,
- pPriv->pm);
- }
- }
- src += PixmapBytePad (*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
-}
-
-/*
- * Clip and put 32bpp Z-format images to a 24bpp drawable
- */
-void
-fb24_32PutZImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- int alu,
- FbBits pm,
- int x,
- int y,
- int width,
- int height,
- CARD8 *src,
- FbStride srcStride)
-{
- FbBits *dstBits;
- CARD8 *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- int nbox;
- BoxPtr pbox;
- int x1, y1, x2, y2;
-
- fbGetDrawable (pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
- dstStride *= sizeof(FbBits);
- dst = (CARD8 *) dstBits;
-
- for (nbox = REGION_NUM_RECTS (pClip),
- pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- x1 = x;
- y1 = y;
- x2 = x + width;
- y2 = y + height;
- if (x1 < pbox->x1)
- x1 = pbox->x1;
- if (y1 < pbox->y1)
- y1 = pbox->y1;
- if (x2 > pbox->x2)
- x2 = pbox->x2;
- if (y2 > pbox->y2)
- y2 = pbox->y2;
- if (x1 >= x2 || y1 >= y2)
- continue;
- fb24_32BltDown (src + (y1 - y) * srcStride,
- srcStride,
- (x1 - x),
-
- dst + (y1 + dstYoff) * dstStride,
- dstStride,
- x1 + dstXoff,
-
- (x2 - x1),
- (y2 - y1),
-
- alu,
- pm);
- }
-}
-
-void
-fb24_32GetImage (DrawablePtr pDrawable,
- int x,
- int y,
- int w,
- int h,
- unsigned int format,
- unsigned long planeMask,
- char *d)
-{
- FbBits *srcBits;
- CARD8 *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbStride dstStride;
- FbBits pm;
-
- fbGetDrawable (pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
- src = (CARD8 *) srcBits;
- srcStride *= sizeof (FbBits);
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- pm = fbReplicatePixel (planeMask, 32);
- dstStride = PixmapBytePad(w, pDrawable->depth);
- if (pm != FB_ALLONES)
- memset (d, 0, dstStride * h);
- fb24_32BltUp (src + (y + srcYoff) * srcStride, srcStride, x + srcXoff,
- (CARD8 *) d, dstStride, 0,
- w, h, GXcopy, pm);
-}
-
-void
-fb24_32CopyMtoN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- FbBits *srcBits;
- CARD8 *src;
- FbStride srcStride;
- int srcBpp;
- FbBits *dstBits;
- CARD8 *dst;
- FbStride dstStride;
- int dstBpp;
- fb24_32BltFunc blt;
- int srcXoff, srcYoff;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
- src = (CARD8 *) srcBits;
- srcStride *= sizeof (FbBits);
- fbGetDrawable (pDstDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
- dst = (CARD8 *) dstBits;
- dstStride *= sizeof (FbBits);
- if (srcBpp == 24)
- blt = fb24_32BltUp;
- else
- blt = fb24_32BltDown;
-
- while (nbox--)
- {
- (*blt) (src + (pbox->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff),
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff),
-
- (pbox->x2 - pbox->x1),
- (pbox->y2 - pbox->y1),
-
- pGC->alu,
- pPriv->pm);
- pbox++;
- }
-}
-
-PixmapPtr
-fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
-{
- ScreenPtr pScreen = pOldTile->drawable.pScreen;
- PixmapPtr pNewTile;
- FbBits *old, *new;
- FbStride oldStride, newStride;
- int oldBpp, newBpp;
- fb24_32BltFunc blt;
- int oldXoff, oldYoff;
- int newXoff, newYoff;
-
- pNewTile = fbCreatePixmapBpp (pScreen,
- pOldTile->drawable.width,
- pOldTile->drawable.height,
- pOldTile->drawable.depth,
- bitsPerPixel);
- if (!pNewTile)
- return 0;
- fbGetDrawable (&pOldTile->drawable,
- old, oldStride, oldBpp, oldXoff, oldYoff);
- fbGetDrawable (&pNewTile->drawable,
- new, newStride, newBpp, newXoff, newYoff);
- if (oldBpp == 24)
- blt = fb24_32BltUp;
- else
- blt = fb24_32BltDown;
-
- (*blt) ((CARD8 *) old,
- oldStride * sizeof (FbBits),
- 0,
-
- (CARD8 *) new,
- newStride * sizeof (FbBits),
- 0,
-
- pOldTile->drawable.width,
- pOldTile->drawable.height,
-
- GXcopy,
- FB_ALLONES);
-
- return pNewTile;
-}
-
-typedef struct {
- pointer pbits;
- int width;
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
-
-Bool
-fb24_32CreateScreenResources(ScreenPtr pScreen)
-{
- miScreenInitParmsPtr pScrInitParms;
- int pitch;
- Bool retval;
-
- /* get the pitch before mi destroys it */
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
- pitch = BitmapBytePad(pScrInitParms->width * 24);
-
- if((retval = miCreateScreenResources(pScreen))) {
- /* fix the screen pixmap */
- PixmapPtr pPix = (PixmapPtr)pScreen->devPrivate;
- pPix->drawable.bitsPerPixel = 24;
- pPix->devKind = pitch;
- }
-
- return retval;
-}
-
-Bool
-fb24_32ModifyPixmapHeader (PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData)
-{
- int bpp, w;
-
- if (!pPixmap)
- return FALSE;
- bpp = bitsPerPixel;
- if (bpp <= 0)
- bpp = pPixmap->drawable.bitsPerPixel;
- if (bpp == 24)
- {
- if (devKind < 0)
- {
- w = width;
- if (w <= 0)
- w = pPixmap->drawable.width;
- devKind = BitmapBytePad(w * 24);
- }
- }
- return miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel,
- devKind, pPixData);
-}
diff --git a/fb/fb24_32.h b/fb/fb24_32.h
deleted file mode 100644
index d0a0acb97..000000000
--- a/fb/fb24_32.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fb24_32.h,v 1.1 2000/04/04 19:24:49 dawes Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _FB24_32_H_
-#define _FB24_32_H_
-
-Bool
-fb24_32FinishScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp);
-
-Bool
-fb24_32ScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp);
-
-#endif
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
deleted file mode 100644
index 687de493a..000000000
--- a/fb/fballpriv.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Id: fballpriv.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fballpriv.c,v 1.4 2000/05/06 21:09:31 keithp Exp $ */
-
-#include "fb.h"
-
-#ifdef FB_SCREEN_PRIVATE
-int fbScreenPrivateIndex;
-#endif
-int fbGCPrivateIndex;
-#ifndef FB_NO_WINDOW_PIXMAPS
-int fbWinPrivateIndex;
-#endif
-int fbGeneration;
-
-#ifdef FB_OLD_SCREEN
-#define miAllocateGCPrivateIndex() AllocateGCPrivateIndex()
-#endif
-
-Bool
-fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
-{
- if (fbGeneration != serverGeneration)
- {
- fbGCPrivateIndex = miAllocateGCPrivateIndex ();
-#ifndef FB_NO_WINDOW_PIXMAPS
- fbWinPrivateIndex = AllocateWindowPrivateIndex();
-#endif
-#ifdef FB_SCREEN_PRIVATE
- fbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (fbScreenPrivateIndex == -1)
- return FALSE;
-#endif
-
- fbGeneration = serverGeneration;
- }
- if (pGCIndex)
- *pGCIndex = fbGCPrivateIndex;
- if (!AllocateGCPrivate(pScreen, fbGCPrivateIndex, sizeof(FbGCPrivRec)))
- return FALSE;
-#ifndef FB_NO_WINDOW_PIXMAPS
- if (!AllocateWindowPrivate(pScreen, fbWinPrivateIndex, 0))
- return FALSE;
-#endif
-#ifdef FB_SCREEN_PRIVATE
- {
- FbScreenPrivPtr pScreenPriv;
-
- pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
- if (!pScreenPriv)
- return FALSE;
- pScreen->devPrivates[fbScreenPrivateIndex].ptr = (pointer) pScreenPriv;
- }
-#endif
- return TRUE;
-}
diff --git a/fb/fbarc.c b/fb/fbarc.c
deleted file mode 100644
index 9713ffb09..000000000
--- a/fb/fbarc.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Id: fbarc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbarc.c,v 1.8 2002/11/09 04:59:29 tsi Exp $ */
-
-#include "fb.h"
-#include "mizerarc.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#endif
-
-typedef void (*FbArc) (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int dx,
- int dy,
- FbBits and,
- FbBits xor);
-
-void
-fbPolyArc (DrawablePtr pDrawable,
- GCPtr pGC,
- int narcs,
- xArc *parcs)
-{
- FbArc arc;
-
- if (pGC->lineWidth == 0)
- {
-#ifndef FBNOPIXADDR
- arc = 0;
- if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid)
- {
- switch (pDrawable->bitsPerPixel)
- {
- case 8: arc = fbArc8; break;
- case 16: arc = fbArc16; break;
-#ifdef FB_24BIT
- case 24: arc = fbArc24; break;
-#endif
- case 32: arc = fbArc32; break;
- }
- }
- if (arc)
- {
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- BoxRec box;
- int x2, y2;
- RegionPtr cclip;
-
- cclip = fbGetCompositeClip (pGC);
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- while (narcs--)
- {
- if (miCanZeroArc (parcs))
- {
- box.x1 = parcs->x + pDrawable->x;
- box.y1 = parcs->y + pDrawable->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)parcs->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)parcs->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) )
- (*arc) (dst, dstStride, dstBpp,
- parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff,
- pPriv->and, pPriv->xor);
- else
- miZeroPolyArc(pDrawable, pGC, 1, parcs);
- }
- else
- miPolyArc(pDrawable, pGC, 1, parcs);
- parcs++;
- }
- }
- else
-#endif
- miZeroPolyArc (pDrawable, pGC, narcs, parcs);
- }
- else
- miPolyArc (pDrawable, pGC, narcs, parcs);
-}
diff --git a/fb/fbbits.c b/fb/fbbits.c
deleted file mode 100644
index b1c123d21..000000000
--- a/fb/fbbits.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Id: fbbits.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbbits.c,v 1.6 2000/02/23 20:29:41 dawes Exp $ */
-
-#include "fb.h"
-#include "miline.h"
-#include "mizerarc.h"
-
-#undef BRESSOLID
-#undef BRESDASH
-#undef DOTS
-#undef ARC
-#undef GLYPH
-#undef BITS
-#undef BITS2
-#undef BITS4
-
-#define BRESSOLID fbBresSolid8
-#define BRESDASH fbBresDash8
-#define DOTS fbDots8
-#define ARC fbArc8
-#define GLYPH fbGlyph8
-#define POLYLINE fbPolyline8
-#define POLYSEGMENT fbPolySegment8
-#define BITS BYTE
-#define BITS2 CARD16
-#define BITS4 CARD32
-
-#include "fbbits.h"
-
-#undef BRESSOLID
-#undef BRESDASH
-#undef DOTS
-#undef ARC
-#undef GLYPH
-#undef POLYLINE
-#undef POLYSEGMENT
-#undef BITS
-#undef BITS2
-#undef BITS4
-
-#define BRESSOLID fbBresSolid16
-#define BRESDASH fbBresDash16
-#define DOTS fbDots16
-#define ARC fbArc16
-#define GLYPH fbGlyph16
-#define POLYLINE fbPolyline16
-#define POLYSEGMENT fbPolySegment16
-#define BITS CARD16
-#define BITS2 CARD32
-#if FB_SHIFT == 6
-#define BITS4 FbBits
-#endif
-
-#include "fbbits.h"
-
-#undef BRESSOLID
-#undef BRESDASH
-#undef DOTS
-#undef ARC
-#undef GLYPH
-#undef POLYLINE
-#undef POLYSEGMENT
-#undef BITS
-#undef BITS2
-#if FB_SHIFT == 6
-#undef BITS4
-#endif
-
-#ifdef FB_24BIT
-#define BRESSOLID fbBresSolid24
-#define BRESDASH fbBresDash24
-#define DOTS fbDots24
-#define ARC fbArc24
-#define POLYLINE fbPolyline24
-#define POLYSEGMENT fbPolySegment24
-
-#define BITS CARD32
-#define BITSUNIT BYTE
-#define BITSMUL 3
-
-#define FbDoTypeStore(b,t,x,s) (*((t *) (b)) = (x) >> (s))
-#define FbDoTypeRRop(b,t,a,x,s) (*((t *) (b)) = FbDoRRop(*((t *) (b)),\
- (a) >> (s), \
- (x) >> (s)))
-#define FbDoTypeMaskRRop(b,t,a,x,m,s) (*((t *) (b)) = FbDoMaskRRop(*((t *) (b)),\
- (a) >> (s), \
- (x) >> (s), \
- (m) >> (s))
-#if BITMAP_BIT_ORDER == LSBFirst
-#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
- (FbDoTypeStore (b, CARD8, x, 0), \
- FbDoTypeStore ((b) + 1, CARD16, x, 8)) : \
- (FbDoTypeStore (b, CARD16, x, 0), \
- FbDoTypeStore ((b) + 2, CARD8, x, 16)))
-#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \
- (FbDoTypeRRop(b,CARD8,a,x,0), \
- FbDoTypeRRop((b)+1,CARD16,a,x,8)) : \
- (FbDoTypeRRop(b,CARD16,a,x,0), \
- FbDoTypeRRop((b)+2,CARD8,a,x,16)))
-#else
-#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
- (FbDoTypeStore (b, CARD8, x, 16), \
- FbDoTypeStore ((b) + 1, CARD16, x, 0)) : \
- (FbDoTypeStore (b, CARD16, x, 8), \
- FbDoTypeStore ((b) + 2, CARD8, x, 0)))
-#define BITSRROP(b,a,x) ((unsigned long) (b) & 1 ? \
- (FbDoTypeRRop (b, CARD8, a, x, 16), \
- FbDoTypeRRop ((b) + 1, CARD16, a, x, 0)) : \
- (FbDoTypeRRop (b, CARD16, a, x, 8), \
- FbDoTypeRRop ((b) + 2, CARD8, a, x, 0)))
-#endif
-
-#include "fbbits.h"
-
-#undef BITSSTORE
-#undef BITSRROP
-#undef BITSMUL
-#undef BITSUNIT
-#undef BITS
-
-#undef BRESSOLID
-#undef BRESDASH
-#undef DOTS
-#undef ARC
-#undef POLYLINE
-#undef POLYSEGMENT
-#endif /* FB_24BIT */
-
-#define BRESSOLID fbBresSolid32
-#define BRESDASH fbBresDash32
-#define DOTS fbDots32
-#define ARC fbArc32
-#define GLYPH fbGlyph32
-#define POLYLINE fbPolyline32
-#define POLYSEGMENT fbPolySegment32
-#define BITS CARD32
-#if FB_SHIFT == 6
-#define BITS2 FbBits
-#endif
-
-#include "fbbits.h"
-
-#undef BRESSOLID
-#undef BRESDASH
-#undef DOTS
-#undef ARC
-#undef GLYPH
-#undef POLYLINE
-#undef POLYSEGMENT
-#undef BITS
-#if FB_SHIFT == 6
-#undef BITS2
-#endif
diff --git a/fb/fbbits.h b/fb/fbbits.h
deleted file mode 100644
index 80fbc4010..000000000
--- a/fb/fbbits.h
+++ /dev/null
@@ -1,956 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbbits.h,v 1.14 2003/11/03 05:11:00 tsi Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * This file defines functions for drawing some primitives using
- * underlying datatypes instead of masks
- */
-
-#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & 0x80008000)
-
-#ifdef BITSMUL
-#define MUL BITSMUL
-#else
-#define MUL 1
-#endif
-
-#ifdef BITSSTORE
-#define STORE(b,x) BITSSTORE(b,x)
-#else
-#define STORE(b,x) (*(b) = (x))
-#endif
-
-#ifdef BITSRROP
-#define RROP(b,a,x) BITSRROP(b,a,x)
-#else
-#define RROP(b,a,x) (*(b) = FbDoRRop (*(b), (a), (x)))
-#endif
-
-#ifdef BITSUNIT
-#define UNIT BITSUNIT
-#define USE_SOLID
-#else
-#define UNIT BITS
-#endif
-
-/*
- * Define the following before including this file:
- *
- * BRESSOLID name of function for drawing a solid segment
- * BRESDASH name of function for drawing a dashed segment
- * DOTS name of function for drawing dots
- * ARC name of function for drawing a solid arc
- * BITS type of underlying unit
- */
-
-#ifdef BRESSOLID
-void
-BRESSOLID (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- UNIT *bits;
- FbStride bitsStride;
- FbStride majorStep, minorStep;
- BITS xor = (BITS) pPriv->xor;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- bits = ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL;
- bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- if (signdy < 0)
- bitsStride = -bitsStride;
- if (axis == X_AXIS)
- {
- majorStep = signdx * MUL;
- minorStep = bitsStride;
- }
- else
- {
- majorStep = bitsStride;
- minorStep = signdx * MUL;
- }
- while (len--)
- {
- STORE(bits,xor);
- bits += majorStep;
- e += e1;
- if (e >= 0)
- {
- bits += minorStep;
- e += e3;
- }
- }
-}
-#endif
-
-#ifdef BRESDASH
-void
-BRESDASH (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- UNIT *bits;
- FbStride bitsStride;
- FbStride majorStep, minorStep;
- BITS xorfg, xorbg;
- FbDashDeclare;
- int dashlen;
- Bool even;
- Bool doOdd;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- doOdd = pGC->lineStyle == LineDoubleDash;
- xorfg = (BITS) pPriv->xor;
- xorbg = (BITS) pPriv->bgxor;
-
- FbDashInit (pGC, pPriv, dashOffset, dashlen, even);
-
- bits = ((UNIT *) (dst + ((y1 + dstYoff) * dstStride))) + (x1 + dstXoff) * MUL;
- bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- if (signdy < 0)
- bitsStride = -bitsStride;
- if (axis == X_AXIS)
- {
- majorStep = signdx * MUL;
- minorStep = bitsStride;
- }
- else
- {
- majorStep = bitsStride;
- minorStep = signdx * MUL;
- }
- if (dashlen >= len)
- dashlen = len;
- if (doOdd)
- {
- if (!even)
- goto doubleOdd;
- for (;;)
- {
- len -= dashlen;
- while (dashlen--)
- {
- STORE(bits,xorfg);
- bits += majorStep;
- if ((e += e1) >= 0)
- {
- e += e3;
- bits += minorStep;
- }
- }
- if (!len)
- break;
-
- FbDashNextEven(dashlen);
-
- if (dashlen >= len)
- dashlen = len;
-doubleOdd:
- len -= dashlen;
- while (dashlen--)
- {
- STORE(bits,xorbg);
- bits += majorStep;
- if ((e += e1) >= 0)
- {
- e += e3;
- bits += minorStep;
- }
- }
- if (!len)
- break;
-
- FbDashNextOdd(dashlen);
-
- if (dashlen >= len)
- dashlen = len;
- }
- }
- else
- {
- if (!even)
- goto onOffOdd;
- for (;;)
- {
- len -= dashlen;
- while (dashlen--)
- {
- STORE(bits,xorfg);
- bits += majorStep;
- if ((e += e1) >= 0)
- {
- e += e3;
- bits += minorStep;
- }
- }
- if (!len)
- break;
-
- FbDashNextEven (dashlen);
-
- if (dashlen >= len)
- dashlen = len;
-onOffOdd:
- len -= dashlen;
- while (dashlen--)
- {
- bits += majorStep;
- if ((e += e1) >= 0)
- {
- e += e3;
- bits += minorStep;
- }
- }
- if (!len)
- break;
-
- FbDashNextOdd (dashlen);
-
- if (dashlen >= len)
- dashlen = len;
- }
- }
-}
-#endif
-
-#ifdef DOTS
-void
-DOTS (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *ptsOrig,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor)
-{
- INT32 *pts = (INT32 *) ptsOrig;
- UNIT *bits = (UNIT *) dst;
- UNIT *point;
- BITS bxor = (BITS) xor;
- BITS band = (BITS) and;
- FbStride bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- INT32 ul, lr;
- INT32 pt;
-
- ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff);
- lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1);
-
- bits += bitsStride * yoff + xoff * MUL;
-
- if (and == 0)
- {
- while (npt--)
- {
- pt = *pts++;
- if (!isClipped(pt,ul,lr))
- {
- point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL;
- STORE(point,bxor);
- }
- }
- }
- else
- {
- while (npt--)
- {
- pt = *pts++;
- if (!isClipped(pt,ul,lr))
- {
- point = bits + intToY(pt) * bitsStride + intToX(pt) * MUL;
- RROP(point,band,bxor);
- }
- }
- }
-}
-#endif
-
-#ifdef ARC
-
-#define ARCCOPY(d) STORE(d,xorBits)
-#define ARCRROP(d) RROP(d,andBits,xorBits)
-
-void
-ARC (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- xArc *arc,
- int drawX,
- int drawY,
- FbBits and,
- FbBits xor)
-{
- UNIT *bits;
- FbStride bitsStride;
- miZeroArcRec info;
- Bool do360;
- int x;
- UNIT *yorgp, *yorgop;
- BITS andBits, xorBits;
- int yoffset, dyoffset;
- int y, a, b, d, mask;
- int k1, k3, dx, dy;
-
- bits = (UNIT *) dst;
- bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- andBits = (BITS) and;
- xorBits = (BITS) xor;
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgp = bits + ((info.yorg + drawY) * bitsStride);
- yorgop = bits + ((info.yorgo + drawY) * bitsStride);
- info.xorg = (info.xorg + drawX) * MUL;
- info.xorgo = (info.xorgo + drawX) * MUL;
- MIARCSETUP();
- yoffset = y ? bitsStride : 0;
- dyoffset = 0;
- mask = info.initialMask;
-
- if (!(arc->width & 1))
- {
- if (andBits == 0)
- {
- if (mask & 2)
- ARCCOPY(yorgp + info.xorgo);
- if (mask & 8)
- ARCCOPY(yorgop + info.xorgo);
- }
- else
- {
- if (mask & 2)
- ARCRROP(yorgp + info.xorgo);
- if (mask & 8)
- ARCRROP(yorgop + info.xorgo);
- }
- }
- if (!info.end.x || !info.end.y)
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1))
- {
- int xoffset = bitsStride;
- UNIT *yorghb = yorgp + (info.h * bitsStride) + info.xorg;
- UNIT *yorgohb = yorghb - info.h * MUL;
-
- yorgp += info.xorg;
- yorgop += info.xorg;
- yorghb += info.h * MUL;
- while (1)
- {
- if (andBits == 0)
- {
- ARCCOPY(yorgp + yoffset + x * MUL);
- ARCCOPY(yorgp + yoffset - x * MUL);
- ARCCOPY(yorgop - yoffset - x * MUL);
- ARCCOPY(yorgop - yoffset + x * MUL);
- }
- else
- {
- ARCRROP(yorgp + yoffset + x * MUL);
- ARCRROP(yorgp + yoffset - x * MUL);
- ARCRROP(yorgop - yoffset - x * MUL);
- ARCRROP(yorgop - yoffset + x * MUL);
- }
- if (a < 0)
- break;
- if (andBits == 0)
- {
- ARCCOPY(yorghb - xoffset - y * MUL);
- ARCCOPY(yorgohb - xoffset + y * MUL);
- ARCCOPY(yorgohb + xoffset + y * MUL);
- ARCCOPY(yorghb + xoffset - y * MUL);
- }
- else
- {
- ARCRROP(yorghb - xoffset - y * MUL);
- ARCRROP(yorgohb - xoffset + y * MUL);
- ARCRROP(yorgohb + xoffset + y * MUL);
- ARCRROP(yorghb + xoffset - y * MUL);
- }
- xoffset += bitsStride;
- MIARCCIRCLESTEP(yoffset += bitsStride;);
- }
- yorgp -= info.xorg;
- yorgop -= info.xorg;
- x = info.w;
- yoffset = info.h * bitsStride;
- }
- else if (do360)
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = bitsStride;);
- if (andBits == 0)
- {
- ARCCOPY(yorgp + yoffset + info.xorg + x * MUL);
- ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL);
- ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL);
- ARCCOPY(yorgop - yoffset + info.xorg + x * MUL);
- }
- else
- {
- ARCRROP(yorgp + yoffset + info.xorg + x * MUL);
- ARCRROP(yorgp + yoffset + info.xorgo - x * MUL);
- ARCRROP(yorgop - yoffset + info.xorgo - x * MUL);
- ARCRROP(yorgop - yoffset + info.xorg + x * MUL);
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += bitsStride;);
- }
- }
- else
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = bitsStride;);
- if ((x == info.start.x) || (y == info.start.y))
- {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- if (andBits == 0)
- {
- if (mask & 1)
- ARCCOPY(yorgp + yoffset + info.xorg + x * MUL);
- if (mask & 2)
- ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL);
- if (mask & 4)
- ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL);
- if (mask & 8)
- ARCCOPY(yorgop - yoffset + info.xorg + x * MUL);
- }
- else
- {
- if (mask & 1)
- ARCRROP(yorgp + yoffset + info.xorg + x * MUL);
- if (mask & 2)
- ARCRROP(yorgp + yoffset + info.xorgo - x * MUL);
- if (mask & 4)
- ARCRROP(yorgop - yoffset + info.xorgo - x * MUL);
- if (mask & 8)
- ARCRROP(yorgop - yoffset + info.xorg + x * MUL);
- }
- if ((x == info.end.x) || (y == info.end.y))
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += bitsStride;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- if (andBits == 0)
- {
- if (mask & 1)
- ARCCOPY(yorgp + yoffset + info.xorg + x * MUL);
- if (mask & 4)
- ARCCOPY(yorgop - yoffset + info.xorgo - x * MUL);
- if (arc->height & 1)
- {
- if (mask & 2)
- ARCCOPY(yorgp + yoffset + info.xorgo - x * MUL);
- if (mask & 8)
- ARCCOPY(yorgop - yoffset + info.xorg + x * MUL);
- }
- }
- else
- {
- if (mask & 1)
- ARCRROP(yorgp + yoffset + info.xorg + x * MUL);
- if (mask & 4)
- ARCRROP(yorgop - yoffset + info.xorgo - x * MUL);
- if (arc->height & 1)
- {
- if (mask & 2)
- ARCRROP(yorgp + yoffset + info.xorgo - x * MUL);
- if (mask & 8)
- ARCRROP(yorgop - yoffset + info.xorg + x * MUL);
- }
- }
-}
-#undef ARCCOPY
-#undef ARCRROP
-#endif
-
-#ifdef GLYPH
-#if BITMAP_BIT_ORDER == LSBFirst
-# define WRITE_ADDR1(n) (n)
-# define WRITE_ADDR2(n) (n)
-# define WRITE_ADDR4(n) (n)
-#else
-# define WRITE_ADDR1(n) ((n) ^ 3)
-# define WRITE_ADDR2(n) ((n) ^ 2)
-# define WRITE_ADDR4(n) ((n))
-#endif
-
-#define WRITE1(d,n,fg) ((d)[WRITE_ADDR1(n)] = (BITS) (fg))
-
-#ifdef BITS2
-# define WRITE2(d,n,fg) (*((BITS2 *) &((d)[WRITE_ADDR2(n)])) = (BITS2) (fg))
-#else
-# define WRITE2(d,n,fg) WRITE1(d,(n)+1,WRITE1(d,n,fg))
-#endif
-
-#ifdef BITS4
-# define WRITE4(d,n,fg) (*((BITS4 *) &((d)[WRITE_ADDR4(n)])) = (BITS4) (fg))
-#else
-# define WRITE4(d,n,fg) WRITE2(d,(n)+2,WRITE2(d,n,fg))
-#endif
-
-void
-GLYPH (FbBits *dstBits,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int x,
- int height)
-{
- int lshift;
- FbStip bits;
- BITS *dstLine;
- BITS *dst;
- int n;
- int shift;
-
- dstLine = (BITS *) dstBits;
- dstLine += x & ~3;
- dstStride *= (sizeof (FbBits) / sizeof (BITS));
- shift = x & 3;
- lshift = 4 - shift;
- while (height--)
- {
- bits = *stipple++;
- dst = (BITS *) dstLine;
- n = lshift;
- while (bits)
- {
- switch (FbStipMoveLsb (FbLeftStipBits (bits, n), 4, n)) {
- case 0:
- break;
- case 1:
- WRITE1(dst,0,fg);
- break;
- case 2:
- WRITE1(dst,1,fg);
- break;
- case 3:
- WRITE2(dst,0,fg);
- break;
- case 4:
- WRITE1(dst,2,fg);
- break;
- case 5:
- WRITE1(dst,0,fg);
- WRITE1(dst,2,fg);
- break;
- case 6:
- WRITE1(dst,1,fg);
- WRITE1(dst,2,fg);
- break;
- case 7:
- WRITE2(dst,0,fg);
- WRITE1(dst,2,fg);
- break;
- case 8:
- WRITE1(dst,3,fg);
- break;
- case 9:
- WRITE1(dst,0,fg);
- WRITE1(dst,3,fg);
- break;
- case 10:
- WRITE1(dst,1,fg);
- WRITE1(dst,3,fg);
- break;
- case 11:
- WRITE2(dst,0,fg);
- WRITE1(dst,3,fg);
- break;
- case 12:
- WRITE2(dst,2,fg);
- break;
- case 13:
- WRITE1(dst,0,fg);
- WRITE2(dst,2,fg);
- break;
- case 14:
- WRITE1(dst,1,fg);
- WRITE2(dst,2,fg);
- break;
- case 15:
- WRITE4(dst,0,fg);
- break;
- }
- bits = FbStipLeft (bits, n);
- n = 4;
- dst += 4;
- }
- dstLine += dstStride;
- }
-}
-#undef WRITE_ADDR1
-#undef WRITE_ADDR2
-#undef WRITE_ADDR4
-#undef WRITE1
-#undef WRITE2
-#undef WRITE4
-
-#endif
-
-#ifdef POLYLINE
-void
-POLYLINE (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ptsOrig)
-{
- INT32 *pts = (INT32 *) ptsOrig;
- int xoff = pDrawable->x;
- int yoff = pDrawable->y;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC));
-
- FbBits *dst;
- int dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- UNIT *bits, *bitsBase;
- FbStride bitsStride;
- BITS xor = fbGetGCPrivate(pGC)->xor;
- BITS and = fbGetGCPrivate(pGC)->and;
- int dashoffset = 0;
-
- INT32 ul, lr;
- INT32 pt1, pt2;
-
- int e, e1, e3, len;
- int stepmajor, stepminor;
- int octant;
-
- if (mode == CoordModePrevious)
- fbFixCoordModePrevious (npt, ptsOrig);
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- bitsBase = ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL;
- ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff);
- lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1);
-
- pt1 = *pts++;
- npt--;
- pt2 = *pts++;
- npt--;
- for (;;)
- {
- if (isClipped (pt1, ul, lr) | isClipped (pt2, ul, lr))
- {
- fbSegment (pDrawable, pGC,
- intToX(pt1) + xoff, intToY(pt1) + yoff,
- intToX(pt2) + xoff, intToY(pt2) + yoff,
- npt == 0 && pGC->capStyle != CapNotLast,
- &dashoffset);
- if (!npt)
- return;
- pt1 = pt2;
- pt2 = *pts++;
- npt--;
- }
- else
- {
- bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL;
- for (;;)
- {
- CalcLineDeltas (intToX(pt1), intToY(pt1),
- intToX(pt2), intToY(pt2),
- len, e1, stepmajor, stepminor, 1, bitsStride,
- octant);
- stepmajor *= MUL;
- if (len < e1)
- {
- e3 = len;
- len = e1;
- e1 = e3;
-
- e3 = stepminor;
- stepminor = stepmajor;
- stepmajor = e3;
- SetYMajorOctant(octant);
- }
- e = -len;
- e1 <<= 1;
- e3 = e << 1;
- FIXUP_ERROR (e, octant, bias);
- if (and == 0)
- {
- while (len--)
- {
- STORE(bits,xor);
- bits += stepmajor;
- e += e1;
- if (e >= 0)
- {
- bits += stepminor;
- e += e3;
- }
- }
- }
- else
- {
- while (len--)
- {
- RROP(bits,and,xor);
- bits += stepmajor;
- e += e1;
- if (e >= 0)
- {
- bits += stepminor;
- e += e3;
- }
- }
- }
- if (!npt)
- {
- if (pGC->capStyle != CapNotLast &&
- pt2 != *((INT32 *) ptsOrig))
- {
- RROP(bits,and,xor);
- }
- return;
- }
- pt1 = pt2;
- pt2 = *pts++;
- --npt;
- if (isClipped (pt2, ul, lr))
- break;
- }
- }
- }
-}
-#endif
-
-#ifdef POLYSEGMENT
-void
-POLYSEGMENT (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg)
-{
- INT32 *pts = (INT32 *) pseg;
- int xoff = pDrawable->x;
- int yoff = pDrawable->y;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC));
-
- FbBits *dst;
- int dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- UNIT *bits, *bitsBase;
- FbStride bitsStride;
- FbBits xorBits = fbGetGCPrivate(pGC)->xor;
- FbBits andBits = fbGetGCPrivate(pGC)->and;
- BITS xor = xorBits;
- BITS and = andBits;
- int dashoffset = 0;
-
- INT32 ul, lr;
- INT32 pt1, pt2;
-
- int e, e1, e3, len;
- int stepmajor, stepminor;
- int octant;
- Bool capNotLast;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- bitsStride = dstStride * (sizeof (FbBits) / sizeof (UNIT));
- bitsBase = ((UNIT *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff) * MUL;
- ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff);
- lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1);
-
- capNotLast = pGC->capStyle == CapNotLast;
-
- while (nseg--)
- {
- pt1 = *pts++;
- pt2 = *pts++;
- if (isClipped (pt1, ul, lr) | isClipped (pt2, ul, lr))
- {
- fbSegment (pDrawable, pGC,
- intToX(pt1) + xoff, intToY(pt1) + yoff,
- intToX(pt2) + xoff, intToY(pt2) + yoff,
- !capNotLast, &dashoffset);
- }
- else
- {
- CalcLineDeltas (intToX(pt1), intToY(pt1),
- intToX(pt2), intToY(pt2),
- len, e1, stepmajor, stepminor, 1, bitsStride,
- octant);
- if (e1 == 0 && len > 3
-#if MUL != 1
- && FbCheck24Pix(and) && FbCheck24Pix(xor)
-#endif
- )
- {
- int x1, x2;
- FbBits *dstLine;
- int dstX, width;
- FbBits startmask, endmask;
- int nmiddle;
-
- if (stepmajor < 0)
- {
- x1 = intToX(pt2);
- x2 = intToX(pt1) + 1;
- if (capNotLast)
- x1++;
- }
- else
- {
- x1 = intToX(pt1);
- x2 = intToX(pt2);
- if (!capNotLast)
- x2++;
- }
- dstX = (x1 + xoff + dstXoff) * (sizeof (UNIT) * 8 * MUL);
- width = (x2 - x1) * (sizeof (UNIT) * 8 * MUL);
-
- dstLine = dst + (intToY(pt1) + yoff + dstYoff) * dstStride;
- dstLine += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- FbMaskBits (dstX, width, startmask, nmiddle, endmask);
- if (startmask)
- {
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, startmask);
- dstLine++;
- }
- if (!andBits)
- while (nmiddle--)
- *dstLine++ = xorBits;
- else
- while (nmiddle--)
- {
- *dstLine = FbDoRRop (*dstLine, andBits, xorBits);
- dstLine++;
- }
- if (endmask)
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, endmask);
- }
- else
- {
- stepmajor *= MUL;
- bits = bitsBase + intToY(pt1) * bitsStride + intToX(pt1) * MUL;
- if (len < e1)
- {
- e3 = len;
- len = e1;
- e1 = e3;
-
- e3 = stepminor;
- stepminor = stepmajor;
- stepmajor = e3;
- SetYMajorOctant(octant);
- }
- e = -len;
- e1 <<= 1;
- e3 = e << 1;
- FIXUP_ERROR (e, octant, bias);
- if (!capNotLast)
- len++;
- if (and == 0)
- {
- while (len--)
- {
- STORE(bits,xor);
- bits += stepmajor;
- e += e1;
- if (e >= 0)
- {
- bits += stepminor;
- e += e3;
- }
- }
- }
- else
- {
- while (len--)
- {
- RROP(bits,and,xor);
- bits += stepmajor;
- e += e1;
- if (e >= 0)
- {
- bits += stepminor;
- e += e3;
- }
- }
- }
- }
- }
- }
-}
-#endif
-
-#undef MUL
-#undef STORE
-#undef RROP
-#undef UNIT
-#undef USE_SOLID
-
-#undef isClipped
diff --git a/fb/fbblt.c b/fb/fbblt.c
deleted file mode 100644
index b1fd5f5b0..000000000
--- a/fb/fbblt.c
+++ /dev/null
@@ -1,926 +0,0 @@
-/*
- * Id: fbblt.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbblt.c,v 1.8 2000/09/28 00:47:22 keithp Exp $ */
-
-#include "fb.h"
-
-#define InitializeShifts(sx,dx,ls,rs) { \
- if (sx != dx) { \
- if (sx > dx) { \
- ls = sx - dx; \
- rs = FB_UNIT - ls; \
- } else { \
- rs = dx - sx; \
- ls = FB_UNIT - rs; \
- } \
- } \
-}
-
-void
-fbBlt (FbBits *srcLine,
- FbStride srcStride,
- int srcX,
-
- FbBits *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp,
-
- Bool reverse,
- Bool upsidedown)
-{
- FbBits *src, *dst;
- int leftShift, rightShift;
- FbBits startmask, endmask;
- FbBits bits, bits1;
- int n, nmiddle;
- Bool destInvarient;
- int startbyte, endbyte;
- FbDeclareMergeRop ();
-
-#ifdef FB_24BIT
- if (bpp == 24 && !FbCheck24Pix (pm))
- {
- fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX,
- width, height, alu, pm, reverse, upsidedown);
- return;
- }
-#endif
- FbInitializeMergeRop(alu, pm);
- destInvarient = FbDestInvarientMergeRop();
- if (upsidedown)
- {
- srcLine += (height - 1) * (srcStride);
- dstLine += (height - 1) * (dstStride);
- srcStride = -srcStride;
- dstStride = -dstStride;
- }
- FbMaskBitsBytes (dstX, width, destInvarient, startmask, startbyte,
- nmiddle, endmask, endbyte);
- if (reverse)
- {
- srcLine += ((srcX + width - 1) >> FB_SHIFT) + 1;
- dstLine += ((dstX + width - 1) >> FB_SHIFT) + 1;
- srcX = (srcX + width - 1) & FB_MASK;
- dstX = (dstX + width - 1) & FB_MASK;
- }
- else
- {
- srcLine += srcX >> FB_SHIFT;
- dstLine += dstX >> FB_SHIFT;
- srcX &= FB_MASK;
- dstX &= FB_MASK;
- }
- if (srcX == dstX)
- {
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
- if (reverse)
- {
- if (endmask)
- {
- bits = *--src;
- --dst;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- *--dst = FbDoDestInvarientMergeRop(*--src);
- }
- else
- {
- while (n--)
- {
- bits = *--src;
- --dst;
- *dst = FbDoMergeRop (bits, *dst);
- }
- }
- if (startmask)
- {
- bits = *--src;
- --dst;
- FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (startmask)
- {
- bits = *src++;
- FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
-#if 0
- /*
- * This provides some speedup on screen->screen blts
- * over the PCI bus, usually about 10%. But fb
- * isn't usually used for this operation...
- */
- if (_ca2 + 1 == 0 && _cx2 == 0)
- {
- FbBits t1, t2, t3, t4;
- while (n >= 4)
- {
- t1 = *src++;
- t2 = *src++;
- t3 = *src++;
- t4 = *src++;
- *dst++ = t1;
- *dst++ = t2;
- *dst++ = t3;
- *dst++ = t4;
- n -= 4;
- }
- }
-#endif
- while (n--)
- *dst++ = FbDoDestInvarientMergeRop(*src++);
- }
- else
- {
- while (n--)
- {
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = *src;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- }
- }
- }
- else
- {
- if (srcX > dstX)
- {
- leftShift = srcX - dstX;
- rightShift = FB_UNIT - leftShift;
- }
- else
- {
- rightShift = dstX - srcX;
- leftShift = FB_UNIT - rightShift;
- }
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
-
- bits1 = 0;
- if (reverse)
- {
- if (srcX < dstX)
- bits1 = *--src;
- if (endmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(endmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- --dst;
- *dst = FbDoDestInvarientMergeRop(bits);
- }
- }
- else
- {
- while (n--)
- {
- bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- --dst;
- *dst = FbDoMergeRop(bits, *dst);
- }
- }
- if (startmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(startmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (srcX > dstX)
- bits1 = *src++;
- if (startmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMergeRop(bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- if (FbScrLeft(endmask, rightShift))
- {
- bits1 = *src;
- bits |= FbScrRight(bits1, rightShift);
- }
- FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
- }
- }
- }
- }
-}
-
-#ifdef FB_24BIT
-
-#undef DEBUG_BLT24
-#ifdef DEBUG_BLT24
-
-static unsigned long
-getPixel (char *src, int x)
-{
- unsigned long l;
-
- l = 0;
- memcpy (&l, src + x * 3, 3);
- return l;
-}
-#endif
-
-static void
-fbBlt24Line (FbBits *src,
- int srcX,
-
- FbBits *dst,
- int dstX,
-
- int width,
-
- int alu,
- FbBits pm,
-
- Bool reverse)
-{
-#ifdef DEBUG_BLT24
- char *origDst = (char *) dst;
- FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1);
- int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3;
- int origX = dstX / 24;
-#endif
-
- int leftShift, rightShift;
- FbBits startmask, endmask;
- int n;
-
- FbBits bits, bits1;
- FbBits mask;
-
- int rot;
- FbDeclareMergeRop ();
-
- FbInitializeMergeRop (alu, FB_ALLONES);
- FbMaskBits(dstX, width, startmask, n, endmask);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX %d width %d reverse %d\n", dstX, width, reverse);
-#endif
- if (reverse)
- {
- src += ((srcX + width - 1) >> FB_SHIFT) + 1;
- dst += ((dstX + width - 1) >> FB_SHIFT) + 1;
- rot = FbFirst24Rot (((dstX + width - 8) & FB_MASK));
- rot = FbPrev24Rot(rot);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK, rot);
-#endif
- srcX = (srcX + width - 1) & FB_MASK;
- dstX = (dstX + width - 1) & FB_MASK;
- }
- else
- {
- src += srcX >> FB_SHIFT;
- dst += dstX >> FB_SHIFT;
- srcX &= FB_MASK;
- dstX &= FB_MASK;
- rot = FbFirst24Rot (dstX);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX: %d rot: %d\n", dstX, rot);
-#endif
- }
- mask = FbRot24(pm,rot);
-#ifdef DEBUG_BLT24
- ErrorF ("pm 0x%x mask 0x%x\n", pm, mask);
-#endif
- if (srcX == dstX)
- {
- if (reverse)
- {
- if (endmask)
- {
- bits = *--src;
- --dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
- mask = FbPrev24Pix (mask);
- }
- while (n--)
- {
- bits = *--src;
- --dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
- mask = FbPrev24Pix (mask);
- }
- if (startmask)
- {
- bits = *--src;
- --dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & startmask);
- }
- }
- else
- {
- if (startmask)
- {
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
- dst++;
- mask = FbNext24Pix(mask);
- }
- while (n--)
- {
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
- dst++;
- mask = FbNext24Pix(mask);
- }
- if (endmask)
- {
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & endmask);
- }
- }
- }
- else
- {
- if (srcX > dstX)
- {
- leftShift = srcX - dstX;
- rightShift = FB_UNIT - leftShift;
- }
- else
- {
- rightShift = dstX - srcX;
- leftShift = FB_UNIT - rightShift;
- }
-
- bits1 = 0;
- if (reverse)
- {
- if (srcX < dstX)
- bits1 = *--src;
- if (endmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(endmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
- mask = FbPrev24Pix(mask);
- }
- while (n--)
- {
- bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- --dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
- mask = FbPrev24Pix(mask);
- }
- if (startmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(startmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
- }
- }
- else
- {
- if (srcX > dstX)
- bits1 = *src++;
- if (startmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
- dst++;
- mask = FbNext24Pix(mask);
- }
- while (n--)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
- dst++;
- mask = FbNext24Pix(mask);
- }
- if (endmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- if (FbScrLeft(endmask, rightShift))
- {
- bits1 = *src;
- bits |= FbScrRight(bits1, rightShift);
- }
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
- }
- }
- }
-#ifdef DEBUG_BLT24
- {
- int firstx, lastx, x;
-
- firstx = origX;
- if (firstx)
- firstx--;
- lastx = origX + width/24 + 1;
- for (x = firstx; x <= lastx; x++)
- ErrorF ("%06x ", getPixel (origDst, x));
- ErrorF ("\n");
- while (origNlw--)
- ErrorF ("%08x ", *origLine++);
- ErrorF ("\n");
- }
-#endif
-}
-
-void
-fbBlt24 (FbBits *srcLine,
- FbStride srcStride,
- int srcX,
-
- FbBits *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
-
- Bool reverse,
- Bool upsidedown)
-{
- if (upsidedown)
- {
- srcLine += (height-1) * srcStride;
- dstLine += (height-1) * dstStride;
- srcStride = -srcStride;
- dstStride = -dstStride;
- }
- while (height--)
- {
- fbBlt24Line (srcLine, srcX, dstLine, dstX, width, alu, pm, reverse);
- srcLine += srcStride;
- dstLine += dstStride;
- }
-#ifdef DEBUG_BLT24
- ErrorF ("\n");
-#endif
-}
-#endif /* FB_24BIT */
-
-#if FB_SHIFT == FB_STIP_SHIFT + 1
-
-/*
- * Could be generalized to FB_SHIFT > FB_STIP_SHIFT + 1 by
- * creating an ring of values stepped through for each line
- */
-
-void
-fbBltOdd (FbBits *srcLine,
- FbStride srcStrideEven,
- FbStride srcStrideOdd,
- int srcXEven,
- int srcXOdd,
-
- FbBits *dstLine,
- FbStride dstStrideEven,
- FbStride dstStrideOdd,
- int dstXEven,
- int dstXOdd,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp)
-{
- FbBits *src;
- int leftShiftEven, rightShiftEven;
- FbBits startmaskEven, endmaskEven;
- int nmiddleEven;
-
- FbBits *dst;
- int leftShiftOdd, rightShiftOdd;
- FbBits startmaskOdd, endmaskOdd;
- int nmiddleOdd;
-
- int leftShift, rightShift;
- FbBits startmask, endmask;
- int nmiddle;
-
- int srcX, dstX;
-
- FbBits bits, bits1;
- int n;
-
- Bool destInvarient;
- Bool even;
- FbDeclareMergeRop ();
-
- FbInitializeMergeRop (alu, pm);
- destInvarient = FbDestInvarientMergeRop();
-
- srcLine += srcXEven >> FB_SHIFT;
- dstLine += dstXEven >> FB_SHIFT;
- srcXEven &= FB_MASK;
- dstXEven &= FB_MASK;
- srcXOdd &= FB_MASK;
- dstXOdd &= FB_MASK;
-
- FbMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven);
- FbMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd);
-
- even = TRUE;
- InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven);
- InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd);
- while (height--)
- {
- src = srcLine;
- dst = dstLine;
- if (even)
- {
- srcX = srcXEven;
- dstX = dstXEven;
- startmask = startmaskEven;
- endmask = endmaskEven;
- nmiddle = nmiddleEven;
- leftShift = leftShiftEven;
- rightShift = rightShiftEven;
- srcLine += srcStrideEven;
- dstLine += dstStrideEven;
- even = FALSE;
- }
- else
- {
- srcX = srcXOdd;
- dstX = dstXOdd;
- startmask = startmaskOdd;
- endmask = endmaskOdd;
- nmiddle = nmiddleOdd;
- leftShift = leftShiftOdd;
- rightShift = rightShiftOdd;
- srcLine += srcStrideOdd;
- dstLine += dstStrideOdd;
- even = TRUE;
- }
- if (srcX == dstX)
- {
- if (startmask)
- {
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = *src++;
- *dst = FbDoDestInvarientMergeRop(bits);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, endmask);
- }
- }
- else
- {
- bits = 0;
- if (srcX > dstX)
- bits = *src++;
- if (startmask)
- {
- bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMaskMergeRop (bits1, *dst, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits1);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMergeRop(bits1, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits1 = FbScrLeft(bits, leftShift);
- if (FbScrLeft(endmask, rightShift))
- {
- bits = *src;
- bits1 |= FbScrRight(bits, rightShift);
- }
- *dst = FbDoMaskMergeRop (bits1, *dst, endmask);
- }
- }
- }
-}
-
-#ifdef FB_24BIT
-void
-fbBltOdd24 (FbBits *srcLine,
- FbStride srcStrideEven,
- FbStride srcStrideOdd,
- int srcXEven,
- int srcXOdd,
-
- FbBits *dstLine,
- FbStride dstStrideEven,
- FbStride dstStrideOdd,
- int dstXEven,
- int dstXOdd,
-
- int width,
- int height,
-
- int alu,
- FbBits pm)
-{
- Bool even = TRUE;
-
- while (height--)
- {
- if (even)
- {
- fbBlt24Line (srcLine, srcXEven, dstLine, dstXEven,
- width, alu, pm, FALSE);
- srcLine += srcStrideEven;
- dstLine += dstStrideEven;
- even = FALSE;
- }
- else
- {
- fbBlt24Line (srcLine, srcXOdd, dstLine, dstXOdd,
- width, alu, pm, FALSE);
- srcLine += srcStrideOdd;
- dstLine += dstStrideOdd;
- even = TRUE;
- }
- }
-#if 0
- fprintf (stderr, "\n");
-#endif
-}
-#endif
-
-#endif
-
-#if FB_STIP_SHIFT != FB_SHIFT
-void
-fbSetBltOdd (FbStip *stip,
- FbStride stipStride,
- int srcX,
- FbBits **bits,
- FbStride *strideEven,
- FbStride *strideOdd,
- int *srcXEven,
- int *srcXOdd)
-{
- int srcAdjust;
- int strideAdjust;
-
- /*
- * bytes needed to align source
- */
- srcAdjust = (((int) stip) & (FB_MASK >> 3));
- /*
- * FbStip units needed to align stride
- */
- strideAdjust = stipStride & (FB_MASK >> FB_STIP_SHIFT);
-
- *bits = (FbBits *) ((char *) stip - srcAdjust);
- if (srcAdjust)
- {
- *strideEven = FbStipStrideToBitsStride (stipStride + 1);
- *strideOdd = FbStipStrideToBitsStride (stipStride);
-
- *srcXEven = srcX + (srcAdjust << 3);
- *srcXOdd = srcX + (srcAdjust << 3) - (strideAdjust << FB_STIP_SHIFT);
- }
- else
- {
- *strideEven = FbStipStrideToBitsStride (stipStride);
- *strideOdd = FbStipStrideToBitsStride (stipStride + 1);
-
- *srcXEven = srcX;
- *srcXOdd = srcX + (strideAdjust << FB_STIP_SHIFT);
- }
-}
-#endif
-
-void
-fbBltStip (FbStip *src,
- FbStride srcStride, /* in FbStip units, not FbBits units */
- int srcX,
-
- FbStip *dst,
- FbStride dstStride, /* in FbStip units, not FbBits units */
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp)
-{
-#if FB_STIP_SHIFT != FB_SHIFT
- if (FB_STIP_ODDSTRIDE(srcStride) || FB_STIP_ODDPTR(src) ||
- FB_STIP_ODDSTRIDE(dstStride) || FB_STIP_ODDPTR(dst))
- {
- FbStride srcStrideEven, srcStrideOdd;
- FbStride dstStrideEven, dstStrideOdd;
- int srcXEven, srcXOdd;
- int dstXEven, dstXOdd;
- FbBits *s, *d;
- int sx, dx;
-
- src += srcX >> FB_STIP_SHIFT;
- srcX &= FB_STIP_MASK;
- dst += dstX >> FB_STIP_SHIFT;
- dstX &= FB_STIP_MASK;
-
- fbSetBltOdd (src, srcStride, srcX,
- &s,
- &srcStrideEven, &srcStrideOdd,
- &srcXEven, &srcXOdd);
-
- fbSetBltOdd (dst, dstStride, dstX,
- &d,
- &dstStrideEven, &dstStrideOdd,
- &dstXEven, &dstXOdd);
-
-#ifdef FB_24BIT
- if (bpp == 24 && !FbCheck24Pix (pm))
- {
- fbBltOdd24 (s, srcStrideEven, srcStrideOdd,
- srcXEven, srcXOdd,
-
- d, dstStrideEven, dstStrideOdd,
- dstXEven, dstXOdd,
-
- width, height, alu, pm);
- }
- else
-#endif
- {
- fbBltOdd (s, srcStrideEven, srcStrideOdd,
- srcXEven, srcXOdd,
-
- d, dstStrideEven, dstStrideOdd,
- dstXEven, dstXOdd,
-
- width, height, alu, pm, bpp);
- }
- }
- else
-#endif
- {
- fbBlt ((FbBits *) src, FbStipStrideToBitsStride (srcStride),
- srcX,
- (FbBits *) dst, FbStipStrideToBitsStride (dstStride),
- dstX,
- width, height,
- alu, pm, bpp, FALSE, FALSE);
- }
-}
diff --git a/fb/fbbltone.c b/fb/fbbltone.c
deleted file mode 100644
index e758794b8..000000000
--- a/fb/fbbltone.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/*
- * Id: fbbltone.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbbltone.c,v 1.13 2002/02/23 00:42:07 keithp Exp $ */
-
-#include "fb.h"
-
-/*
- * Example: srcX = 13 dstX = 8 (FB unit 32 dstBpp 8)
- *
- * **** **** **** **** **** **** **** ****
- * ^
- * ******** ******** ******** ********
- * ^
- * leftShift = 12
- * rightShift = 20
- *
- * Example: srcX = 0 dstX = 8 (FB unit 32 dstBpp 8)
- *
- * **** **** **** **** **** **** **** ****
- * ^
- * ******** ******** ******** ********
- * ^
- *
- * leftShift = 24
- * rightShift = 8
- */
-
-#define LoadBits {\
- if (leftShift) { \
- bitsRight = *src++; \
- bits = (FbStipLeft (bitsLeft, leftShift) | \
- FbStipRight(bitsRight, rightShift)); \
- bitsLeft = bitsRight; \
- } else \
- bits = *src++; \
-}
-
-#ifndef FBNOPIXADDR
-
-#define LaneCases1(n,a) case n: (void)FbLaneCase(n,a); break
-#define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a)
-#define LaneCases4(n,a) LaneCases2(n,a); LaneCases2(n+2,a)
-#define LaneCases8(n,a) LaneCases4(n,a); LaneCases4(n+4,a)
-#define LaneCases16(n,a) LaneCases8(n,a); LaneCases8(n+8,a)
-#define LaneCases32(n,a) LaneCases16(n,a); LaneCases16(n+16,a)
-#define LaneCases64(n,a) LaneCases32(n,a); LaneCases32(n+32,a)
-#define LaneCases128(n,a) LaneCases64(n,a); LaneCases64(n+64,a)
-#define LaneCases256(n,a) LaneCases128(n,a); LaneCases128(n+128,a)
-
-#if FB_SHIFT == 6
-#define LaneCases(a) LaneCases256(0,a)
-#endif
-
-#if FB_SHIFT == 5
-#define LaneCases(a) LaneCases16(0,a)
-#endif
-
-#if FB_SHIFT == 6
-CARD8 fb8Lane[256] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
-60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
-79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
-98, 99, 100, 101, 102,103,104,105,106,107,108,109,110,111,112,113,114,115,
-116, 117, 118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,
-134, 135, 136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,
-152, 153, 154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,
-170, 171, 172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,
-188, 189, 190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,
-206, 207, 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
-224, 225, 226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,
-242, 243, 244,245,246,247,248,249,250,251,252,253,254,255,
-};
-
-CARD8 fb16Lane[256] = {
- 0x00, 0x03, 0x0c, 0x0f,
- 0x30, 0x33, 0x3c, 0x3f,
- 0xc0, 0xc3, 0xcc, 0xcf,
- 0xf0, 0xf3, 0xfc, 0xff,
-};
-
-CARD8 fb32Lane[16] = {
- 0x00, 0x0f, 0xf0, 0xff,
-};
-#endif
-
-#if FB_SHIFT == 5
-CARD8 fb8Lane[16] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-};
-
-CARD8 fb16Lane[16] = {
- 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-CARD8 fb32Lane[16] = {
- 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-#endif
-
-CARD8 *fbLaneTable[33] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- fb8Lane, 0, 0, 0, 0, 0, 0, 0,
- fb16Lane, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- fb32Lane
-};
-#endif
-
-void
-fbBltOne (FbStip *src,
- FbStride srcStride, /* FbStip units per scanline */
- int srcX, /* bit position of source */
- FbBits *dst,
- FbStride dstStride, /* FbBits units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- FbBits fgand, /* rrop values */
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor)
-{
- const FbBits *fbBits;
- int pixelsPerDst; /* dst pixels per FbBits */
- int unitsPerSrc; /* src patterns per FbStip */
- int leftShift, rightShift; /* align source with dest */
- FbBits startmask, endmask; /* dest scanline masks */
- FbStip bits=0, bitsLeft, bitsRight;/* source bits */
- FbStip left;
- FbBits mask;
- int nDst; /* dest longwords (w.o. end) */
- int w;
- int n, nmiddle;
- int dstS; /* stipple-relative dst X coordinate */
- Bool copy; /* accelerate dest-invariant */
- Bool transparent; /* accelerate 0 nop */
- int srcinc; /* source units consumed */
- Bool endNeedsLoad = FALSE; /* need load for endmask */
-#ifndef FBNOPIXADDR
- CARD8 *fbLane;
-#endif
- int startbyte, endbyte;
-
-#ifdef FB_24BIT
- if (dstBpp == 24)
- {
- fbBltOne24 (src, srcStride, srcX,
- dst, dstStride, dstX, dstBpp,
- width, height,
- fgand, fgxor, bgand, bgxor);
- return;
- }
-#endif
-
- /*
- * Number of destination units in FbBits == number of stipple pixels
- * used each time
- */
- pixelsPerDst = FB_UNIT / dstBpp;
-
- /*
- * Number of source stipple patterns in FbStip
- */
- unitsPerSrc = FB_STIP_UNIT / pixelsPerDst;
-
- copy = FALSE;
- transparent = FALSE;
- if (bgand == 0 && fgand == 0)
- copy = TRUE;
- else if (bgand == FB_ALLONES && bgxor == 0)
- transparent = TRUE;
-
- /*
- * Adjust source and dest to nearest FbBits boundary
- */
- src += srcX >> FB_STIP_SHIFT;
- dst += dstX >> FB_SHIFT;
- srcX &= FB_STIP_MASK;
- dstX &= FB_MASK;
-
- FbMaskBitsBytes(dstX, width, copy,
- startmask, startbyte, nmiddle, endmask, endbyte);
-
- /*
- * Compute effective dest alignment requirement for
- * source -- must align source to dest unit boundary
- */
- dstS = dstX / dstBpp;
- /*
- * Compute shift constants for effective alignement
- */
- if (srcX >= dstS)
- {
- leftShift = srcX - dstS;
- rightShift = FB_STIP_UNIT - leftShift;
- }
- else
- {
- rightShift = dstS - srcX;
- leftShift = FB_STIP_UNIT - rightShift;
- }
- /*
- * Get pointer to stipple mask array for this depth
- */
- fbBits = 0; /* unused */
- if (pixelsPerDst <= 8)
- fbBits = fbStippleTable[pixelsPerDst];
-#ifndef FBNOPIXADDR
- fbLane = 0;
- if (transparent && fgand == 0 && dstBpp >= 8)
- fbLane = fbLaneTable[dstBpp];
-#endif
-
- /*
- * Compute total number of destination words written, but
- * don't count endmask
- */
- nDst = nmiddle;
- if (startmask)
- nDst++;
-
- dstStride -= nDst;
-
- /*
- * Compute total number of source words consumed
- */
-
- srcinc = (nDst + unitsPerSrc - 1) / unitsPerSrc;
-
- if (srcX > dstS)
- srcinc++;
- if (endmask)
- {
- endNeedsLoad = nDst % unitsPerSrc == 0;
- if (endNeedsLoad)
- srcinc++;
- }
-
- srcStride -= srcinc;
-
- /*
- * Copy rectangle
- */
- while (height--)
- {
- w = nDst; /* total units across scanline */
- n = unitsPerSrc; /* units avail in single stipple */
- if (n > w)
- n = w;
-
- bitsLeft = 0;
- if (srcX > dstS)
- bitsLeft = *src++;
- if (n)
- {
- /*
- * Load first set of stipple bits
- */
- LoadBits;
-
- /*
- * Consume stipple bits for startmask
- */
- if (startmask)
- {
-#if FB_UNIT > 32
- if (pixelsPerDst == 16)
- mask = FbStipple16Bits(FbLeftStipBits(bits,16));
- else
-#endif
- mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
-#ifndef FBNOPIXADDR
- if (fbLane)
- {
- fbTransparentSpan (dst, mask & startmask, fgxor, 1);
- }
- else
-#endif
- {
- if (mask || !transparent)
- FbDoLeftMaskByteStippleRRop (dst, mask,
- fgand, fgxor, bgand, bgxor,
- startbyte, startmask);
- }
- bits = FbStipLeft (bits, pixelsPerDst);
- dst++;
- n--;
- w--;
- }
- /*
- * Consume stipple bits across scanline
- */
- for (;;)
- {
- w -= n;
- if (copy)
- {
- while (n--)
- {
-#if FB_UNIT > 32
- if (pixelsPerDst == 16)
- mask = FbStipple16Bits(FbLeftStipBits(bits,16));
- else
-#endif
- mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
- *dst = FbOpaqueStipple (mask, fgxor, bgxor);
- dst++;
- bits = FbStipLeft(bits, pixelsPerDst);
- }
- }
- else
- {
-#ifndef FBNOPIXADDR
- if (fbLane)
- {
- while (bits && n)
- {
- switch (fbLane[FbLeftStipBits(bits,pixelsPerDst)]) {
- LaneCases((CARD8 *) dst);
- }
- bits = FbStipLeft(bits,pixelsPerDst);
- dst++;
- n--;
- }
- dst += n;
- }
- else
-#endif
- {
- while (n--)
- {
- left = FbLeftStipBits(bits,pixelsPerDst);
- if (left || !transparent)
- {
- mask = fbBits[left];
- *dst = FbStippleRRop (*dst, mask,
- fgand, fgxor, bgand, bgxor);
- }
- dst++;
- bits = FbStipLeft(bits, pixelsPerDst);
- }
- }
- }
- if (!w)
- break;
- /*
- * Load another set and reset number of available units
- */
- LoadBits;
- n = unitsPerSrc;
- if (n > w)
- n = w;
- }
- }
- /*
- * Consume stipple bits for endmask
- */
- if (endmask)
- {
- if (endNeedsLoad)
- {
- LoadBits;
- }
-#if FB_UNIT > 32
- if (pixelsPerDst == 16)
- mask = FbStipple16Bits(FbLeftStipBits(bits,16));
- else
-#endif
- mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
-#ifndef FBNOPIXADDR
- if (fbLane)
- {
- fbTransparentSpan (dst, mask & endmask, fgxor, 1);
- }
- else
-#endif
- {
- if (mask || !transparent)
- FbDoRightMaskByteStippleRRop (dst, mask,
- fgand, fgxor, bgand, bgxor,
- endbyte, endmask);
- }
- }
- dst += dstStride;
- src += srcStride;
- }
-}
-
-#ifdef FB_24BIT
-
-/*
- * Crufty macros to initialize the mask array, most of this
- * is to avoid compile-time warnings about shift overflow
- */
-
-#if BITMAP_BIT_ORDER == MSBFirst
-#define Mask24Pos(x,r) ((x)*24-(r))
-#else
-#define Mask24Pos(x,r) ((x)*24-((r) ? 24 - (r) : 0))
-#endif
-
-#define Mask24Neg(x,r) (Mask24Pos(x,r) < 0 ? -Mask24Pos(x,r) : 0)
-#define Mask24Check(x,r) (Mask24Pos(x,r) < 0 ? 0 : \
- Mask24Pos(x,r) >= FB_UNIT ? 0 : Mask24Pos(x,r))
-
-#define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \
- (Mask24Pos(x,r) < 0 ? \
- 0xffffff >> Mask24Neg (x,r) : \
- 0xffffff << Mask24Check(x,r)) : 0)
-
-#define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r))
-
-/*
- * Untested for MSBFirst or FB_UNIT == 32
- */
-
-#if FB_UNIT == 64
-#define C4_24(b,r) \
- (SelMask24(b,0,r) | \
- SelMask24(b,1,r) | \
- SelMask24(b,2,r) | \
- SelMask24(b,3,r))
-
-#define FbStip24New(rot) (2 + (rot != 0))
-#define FbStip24Len 4
-
-const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
- /* rotate 0 */
- {
- C4_24( 0, 0), C4_24( 1, 0), C4_24( 2, 0), C4_24( 3, 0),
- C4_24( 4, 0), C4_24( 5, 0), C4_24( 6, 0), C4_24( 7, 0),
- C4_24( 8, 0), C4_24( 9, 0), C4_24(10, 0), C4_24(11, 0),
- C4_24(12, 0), C4_24(13, 0), C4_24(14, 0), C4_24(15, 0),
- },
- /* rotate 8 */
- {
- C4_24( 0, 8), C4_24( 1, 8), C4_24( 2, 8), C4_24( 3, 8),
- C4_24( 4, 8), C4_24( 5, 8), C4_24( 6, 8), C4_24( 7, 8),
- C4_24( 8, 8), C4_24( 9, 8), C4_24(10, 8), C4_24(11, 8),
- C4_24(12, 8), C4_24(13, 8), C4_24(14, 8), C4_24(15, 8),
- },
- /* rotate 16 */
- {
- C4_24( 0,16), C4_24( 1,16), C4_24( 2,16), C4_24( 3,16),
- C4_24( 4,16), C4_24( 5,16), C4_24( 6,16), C4_24( 7,16),
- C4_24( 8,16), C4_24( 9,16), C4_24(10,16), C4_24(11,16),
- C4_24(12,16), C4_24(13,16), C4_24(14,16), C4_24(15,16),
- }
-};
-
-#endif
-
-#if FB_UNIT == 32
-#define C2_24(b,r) \
- (SelMask24(b,0,r) | \
- SelMask24(b,1,r))
-
-#define FbStip24Len 2
-#if BITMAP_BIT_ORDER == MSBFirst
-#define FbStip24New(rot) (1 + (rot == 0))
-#else
-#define FbStip24New(rot) (1 + (rot == 8))
-#endif
-
-const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
- /* rotate 0 */
- {
- C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0),
- },
- /* rotate 8 */
- {
- C2_24( 0, 8), C2_24 ( 1, 8), C2_24 ( 2, 8), C2_24 ( 3, 8),
- },
- /* rotate 16 */
- {
- C2_24( 0,16), C2_24 ( 1,16), C2_24 ( 2,16), C2_24 ( 3,16),
- }
-};
-#endif
-
-#if BITMAP_BIT_ORDER == LSBFirst
-
-#define FbMergeStip24Bits(left, right, new) \
- (FbStipLeft (left, new) | FbStipRight ((right), (FbStip24Len - (new))))
-
-#define FbMergePartStip24Bits(left, right, llen, rlen) \
- (left | FbStipRight(right, llen))
-
-#else
-
-#define FbMergeStip24Bits(left, right, new) \
- ((FbStipLeft (left, new) & ((1 << FbStip24Len) - 1)) | right)
-
-#define FbMergePartStip24Bits(left, right, llen, rlen) \
- (FbStipLeft(left, rlen) | right)
-
-#endif
-
-#define fbFirstStipBits(len,stip) {\
- int __len = (len); \
- if (len <= remain) { \
- stip = FbLeftStipBits(bits, len); \
- } else { \
- stip = FbLeftStipBits(bits, remain); \
- bits = *src++; \
- __len = (len) - remain; \
- stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \
- remain, __len); \
- remain = FB_STIP_UNIT; \
- } \
- bits = FbStipLeft (bits, __len); \
- remain -= __len; \
-}
-
-#define fbInitStipBits(offset,len,stip) {\
- bits = FbStipLeft (*src++,offset); \
- remain = FB_STIP_UNIT - offset; \
- fbFirstStipBits(len,stip); \
- stip = FbMergeStip24Bits (0, stip, len); \
-}
-
-#define fbNextStipBits(rot,stip) {\
- int __new = FbStip24New(rot); \
- FbStip __right; \
- fbFirstStipBits(__new, __right); \
- stip = FbMergeStip24Bits (stip, __right, __new); \
- rot = FbNext24Rot (rot); \
-}
-
-/*
- * Use deep mask tables that incorporate rotation, pull
- * a variable number of bits out of the stipple and
- * reuse the right bits as needed for the next write
- *
- * Yes, this is probably too much code, but most 24-bpp screens
- * have no acceleration so this code is used for stipples, copyplane
- * and text
- */
-void
-fbBltOne24 (FbStip *srcLine,
- FbStride srcStride, /* FbStip units per scanline */
- int srcX, /* bit position of source */
- FbBits *dst,
- FbStride dstStride, /* FbBits units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- FbBits fgand, /* rrop values */
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor)
-{
- FbStip *src;
- FbBits leftMask, rightMask, mask;
- int nlMiddle, nl;
- FbStip stip, bits;
- int remain;
- int dstS;
- int firstlen;
- int rot0, rot;
- int nDst;
-
- srcLine += srcX >> FB_STIP_SHIFT;
- dst += dstX >> FB_SHIFT;
- srcX &= FB_STIP_MASK;
- dstX &= FB_MASK;
- rot0 = FbFirst24Rot (dstX);
-
- FbMaskBits (dstX, width, leftMask, nlMiddle, rightMask);
-
- dstS = (dstX + 23) / 24;
- firstlen = FbStip24Len - dstS;
-
- nDst = nlMiddle;
- if (leftMask)
- nDst++;
- dstStride -= nDst;
-
- /* opaque copy */
- if (bgand == 0 && fgand == 0)
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- fbInitStipBits (srcX,firstlen, stip);
- if (leftMask)
- {
- mask = fbStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~leftMask) | (FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot))
- & leftMask);
- dst++;
- fbNextStipBits(rot,stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- mask = fbStipple24Bits[rot>>3][stip];
- *dst = FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot));
- dst++;
- fbNextStipBits(rot,stip);
- }
- if (rightMask)
- {
- mask = fbStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~rightMask) | (FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot))
- & rightMask);
- }
- dst += dstStride;
- src += srcStride;
- }
- }
- /* transparent copy */
- else if (bgand == FB_ALLONES && bgxor == 0 && fgand == 0)
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- fbInitStipBits (srcX, firstlen, stip);
- if (leftMask)
- {
- if (stip)
- {
- mask = fbStipple24Bits[rot >> 3][stip] & leftMask;
- *dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask);
- }
- dst++;
- fbNextStipBits (rot, stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- if (stip)
- {
- mask = fbStipple24Bits[rot>>3][stip];
- *dst = (*dst & ~mask) | (FbRot24(fgxor,rot) & mask);
- }
- dst++;
- fbNextStipBits (rot, stip);
- }
- if (rightMask)
- {
- if (stip)
- {
- mask = fbStipple24Bits[rot >> 3][stip] & rightMask;
- *dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask);
- }
- }
- dst += dstStride;
- }
- }
- else
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- fbInitStipBits (srcX, firstlen, stip);
- if (leftMask)
- {
- mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRopMask (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot),
- leftMask);
- dst++;
- fbNextStipBits(rot,stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRop (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot));
- dst++;
- fbNextStipBits(rot,stip);
- }
- if (rightMask)
- {
- mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRopMask (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot),
- rightMask);
- }
- dst += dstStride;
- }
- }
-}
-#endif
-
-/*
- * Not very efficient, but simple -- copy a single plane
- * from an N bit image to a 1 bit image
- */
-
-void
-fbBltPlane (FbBits *src,
- FbStride srcStride,
- int srcX,
- int srcBpp,
-
- FbStip *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbStip fgand,
- FbStip fgxor,
- FbStip bgand,
- FbStip bgxor,
- Pixel planeMask)
-{
- FbBits *s;
- FbBits pm;
- FbBits srcMask;
- FbBits srcMaskFirst;
- FbBits srcMask0 = 0;
- FbBits srcBits;
-
- FbStip dstBits;
- FbStip *d;
- FbStip dstMask;
- FbStip dstMaskFirst;
- FbStip dstUnion;
- int w;
- int wt;
- int rot0;
-
- if (!width)
- return;
-
- src += srcX >> FB_SHIFT;
- srcX &= FB_MASK;
-
- dst += dstX >> FB_STIP_SHIFT;
- dstX &= FB_STIP_MASK;
-
- w = width / srcBpp;
-
- pm = fbReplicatePixel (planeMask, srcBpp);
-#ifdef FB_24BIT
- if (srcBpp == 24)
- {
- int w = 24;
-
- rot0 = FbFirst24Rot (srcX);
- if (srcX + w > FB_UNIT)
- w = FB_UNIT - srcX;
- srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,w);
- }
- else
-#endif
- {
- rot0 = 0;
- srcMaskFirst = pm & FbBitsMask(srcX, srcBpp);
- srcMask0 = pm & FbBitsMask(0, srcBpp);
- }
-
- dstMaskFirst = FbStipMask(dstX,1);
- while (height--)
- {
- d = dst;
- dst += dstStride;
- s = src;
- src += srcStride;
-
- srcMask = srcMaskFirst;
-#ifdef FB_24BIT
- if (srcBpp == 24)
- srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp);
-#endif
- srcBits = *s++;
-
- dstMask = dstMaskFirst;
- dstUnion = 0;
- dstBits = 0;
-
- wt = w;
-
- while (wt--)
- {
- if (!srcMask)
- {
- srcBits = *s++;
-#ifdef FB_24BIT
- if (srcBpp == 24)
- srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24);
-#endif
- srcMask = srcMask0;
- }
- if (!dstMask)
- {
- *d = FbStippleRRopMask(*d, dstBits,
- fgand, fgxor, bgand, bgxor,
- dstUnion);
- d++;
- dstMask = FbStipMask(0,1);
- dstUnion = 0;
- dstBits = 0;
- }
- if (srcBits & srcMask)
- dstBits |= dstMask;
- dstUnion |= dstMask;
- if (srcBpp == FB_UNIT)
- srcMask = 0;
- else
- srcMask = FbScrRight(srcMask,srcBpp);
- dstMask = FbStipRight(dstMask,1);
- }
- if (dstUnion)
- *d = FbStippleRRopMask(*d,dstBits,
- fgand, fgxor, bgand, bgxor,
- dstUnion);
- }
-}
-
diff --git a/fb/fbbstore.c b/fb/fbbstore.c
deleted file mode 100644
index 07a6400a8..000000000
--- a/fb/fbbstore.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Id: fbbstore.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbbstore.c,v 1.2 2000/02/23 20:29:42 dawes Exp $ */
-
-#include "fb.h"
-
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pWin->drawable,
- &pPixmap->drawable,
- 0,
- REGION_RECTS(prgnSave),
- REGION_NUM_RECTS(prgnSave),
- xorg, yorg,
- FALSE,
- FALSE,
- 0,0);
-}
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pPixmap->drawable,
- &pWin->drawable,
- 0,
- REGION_RECTS(prgnRestore),
- REGION_NUM_RECTS(prgnRestore),
- -xorg, -yorg,
- FALSE,
- FALSE,
- 0,0);
-}
diff --git a/fb/fbcmap.c b/fb/fbcmap.c
deleted file mode 100644
index aeb53b1fb..000000000
--- a/fb/fbcmap.c
+++ /dev/null
@@ -1,668 +0,0 @@
-/* $XConsortium: fbcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */
-/* $XFree86: xc/programs/Xserver/fb/fbcmap.c,v 1.6 2001/10/28 03:33:08 tsi Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "fb.h"
-
-#ifndef XFree86Server
-ColormapPtr FbInstalledMaps[MAXSCREENS];
-
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
- *pmaps = FbInstalledMaps[pScreen->myNum]->mid;
- return (1);
-}
-
-
-void
-fbInstallColormap(ColormapPtr pmap)
-{
- int index = pmap->pScreen->myNum;
- ColormapPtr oldpmap = FbInstalledMaps[index];
-
- if(pmap != oldpmap)
- {
- /* Uninstall pInstalledMap. No hardware changes required, just
- * notify all interested parties. */
- if(oldpmap != (ColormapPtr)None)
- WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- /* Install pmap */
- FbInstalledMaps[index] = pmap;
- WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
- }
-}
-
-void
-fbUninstallColormap(ColormapPtr pmap)
-{
- int index = pmap->pScreen->myNum;
- ColormapPtr curpmap = FbInstalledMaps[index];
-
- if(pmap == curpmap)
- {
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pmap->pScreen->InstallColormap)(curpmap);
- }
- }
-}
-
-void
-fbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
- int shift = 16 - pVisual->bitsPerRGBValue;
- unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1;
-
- if ((pVisual->class | DynamicClass) == GrayScale)
- {
- /* rescale to gray then rgb bits */
- *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
- *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
- }
- else
- {
- /* rescale to rgb bits */
- *pred = ((*pred >> shift) * 65535) / lim;
- *pgreen = ((*pgreen >> shift) * 65535) / lim;
- *pblue = ((*pblue >> shift) * 65535) / lim;
- }
-}
-
-Bool
-fbInitializeColormap(ColormapPtr pmap)
-{
- register unsigned i;
- register VisualPtr pVisual;
- unsigned lim, maxent, shift;
-
- pVisual = pmap->pVisual;
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
- shift = 16 - pVisual->bitsPerRGBValue;
- maxent = pVisual->ColormapEntries - 1;
- if (pVisual->class == TrueColor)
- {
- unsigned limr, limg, limb;
-
- limr = pVisual->redMask >> pVisual->offsetRed;
- limg = pVisual->greenMask >> pVisual->offsetGreen;
- limb = pVisual->blueMask >> pVisual->offsetBlue;
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red =
- ((((i * 65535) / limr) >> shift) * 65535) / lim;
- pmap->green[i].co.local.green =
- ((((i * 65535) / limg) >> shift) * 65535) / lim;
- pmap->blue[i].co.local.blue =
- ((((i * 65535) / limb) >> shift) * 65535) / lim;
- }
- }
- else if (pVisual->class == StaticColor)
- {
- unsigned n;
- unsigned r, g, b;
- unsigned red, green, blue;
-
- for (n = 0; n*n*n < pVisual->ColormapEntries; n++)
- ;
- n--;
- i = 0;
- for (r = 0; r < n; r++)
- {
- red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
- for (g = 0; g < n; g++)
- {
- green = (((g * 65535 / (n - 1)) >> shift) * 65535) / lim;
- for (b = 0; b < n; b++)
- {
- blue = (((b * 65535 / (n - 1)) >> shift) * 65535) / lim;
- pmap->red[i].co.local.red = red;
- pmap->red[i].co.local.green = green;
- pmap->red[i].co.local.blue = blue;
- i++;
- }
- }
- }
- n = pVisual->ColormapEntries - i;
- for (r = 0; r < n; r++)
- {
- red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
- pmap->red[i].co.local.red = red;
- pmap->red[i].co.local.green = red;
- pmap->red[i].co.local.blue = red;
- i++;
- }
- }
- else if (pVisual->class == StaticGray)
- {
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift)
- * 65535) / lim;
- pmap->red[i].co.local.green = pmap->red[i].co.local.red;
- pmap->red[i].co.local.blue = pmap->red[i].co.local.red;
- }
- }
- return TRUE;
-}
-
-/* When simulating DirectColor on PseudoColor hardware, multiple
- entries of the colormap must be updated
- */
-
-#define AddElement(mask) { \
- pixel = red | green | blue; \
- for (i = 0; i < nresult; i++) \
- if (outdefs[i].pixel == pixel) \
- break; \
- if (i == nresult) \
- { \
- nresult++; \
- outdefs[i].pixel = pixel; \
- outdefs[i].flags = 0; \
- } \
- outdefs[i].flags |= (mask); \
- outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
- outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
- outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
-}
-
-int
-fbExpandDirectColors (ColormapPtr pmap,
- int ndef,
- xColorItem *indefs,
- xColorItem *outdefs)
-{
- register int red, green, blue;
- int maxred, maxgreen, maxblue;
- int stepred, stepgreen, stepblue;
- VisualPtr pVisual;
- register int pixel;
- register int nresult;
- register int i;
-
- pVisual = pmap->pVisual;
-
- stepred = 1 << pVisual->offsetRed;
- stepgreen = 1 << pVisual->offsetGreen;
- stepblue = 1 << pVisual->offsetBlue;
- maxred = pVisual->redMask;
- maxgreen = pVisual->greenMask;
- maxblue = pVisual->blueMask;
- nresult = 0;
- for (;ndef--; indefs++)
- {
- if (indefs->flags & DoRed)
- {
- red = indefs->pixel & pVisual->redMask;
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoRed)
- }
- }
- }
- if (indefs->flags & DoGreen)
- {
- green = indefs->pixel & pVisual->greenMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoGreen)
- }
- }
- }
- if (indefs->flags & DoBlue)
- {
- blue = indefs->pixel & pVisual->blueMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- AddElement (DoBlue)
- }
- }
- }
- }
- return nresult;
-}
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen)
-{
- unsigned short zero = 0, ones = 0xFFFF;
- VisualPtr pVisual;
- ColormapPtr cmap;
- Pixel wp, bp;
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
-
- if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
- 0)
- != Success)
- return FALSE;
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
- if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
- Success) ||
- (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
- Success))
- return FALSE;
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
- (*pScreen->InstallColormap)(cmap);
- return TRUE;
-}
-
-extern int defaultColorVisualClass;
-
-#define _RZ(d) ((d + 2) / 3)
-#define _RS(d) 0
-#define _RM(d) ((1 << _RZ(d)) - 1)
-#define _GZ(d) ((d - _RZ(d) + 1) / 2)
-#define _GS(d) _RZ(d)
-#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
-#define _BZ(d) (d - _RZ(d) - _GZ(d))
-#define _BS(d) (_RZ(d) + _GZ(d))
-#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
-#define _CE(d) (1 << _RZ(d))
-
-#define MAX_PSEUDO_DEPTH 10 /* largest DAC size I know */
-
-#define StaticGrayMask (1 << StaticGray)
-#define GrayScaleMask (1 << GrayScale)
-#define StaticColorMask (1 << StaticColor)
-#define PseudoColorMask (1 << PseudoColor)
-#define TrueColorMask (1 << TrueColor)
-#define DirectColorMask (1 << DirectColor)
-
-#define ALL_VISUALS (StaticGrayMask|\
- GrayScaleMask|\
- StaticColorMask|\
- PseudoColorMask|\
- TrueColorMask|\
- DirectColorMask)
-
-#define LARGE_VISUALS (TrueColorMask|\
- DirectColorMask)
-
-typedef struct _fbVisuals {
- struct _fbVisuals *next;
- int depth;
- int bitsPerRGB;
- int visuals;
- int count;
- Pixel redMask, greenMask, blueMask;
-} fbVisualsRec, *fbVisualsPtr;
-
-static const int fbVisualPriority[] = {
- PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray
-};
-
-#define NUM_PRIORITY 6
-
-static fbVisualsPtr fbVisuals;
-
-static int
-popCount (int i)
-{
- int count;
-
- count = (i >> 1) & 033333333333;
- count = i - count - ((count >> 1) & 033333333333);
- count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */
- return count;
-}
-
-/*
- * Distance to least significant one bit
- */
-static int
-maskShift (Pixel p)
-{
- int s;
-
- if (!p) return 0;
- s = 0;
- while (!(p & 1))
- {
- s++;
- p >>= 1;
- }
- return s;
-}
-
-Bool
-fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
- Pixel redMask, Pixel greenMask, Pixel blueMask)
-{
- fbVisualsPtr new, *prev, v;
-
- new = (fbVisualsPtr) xalloc (sizeof *new);
- if (!new)
- return FALSE;
- if (!redMask || !greenMask || !blueMask)
- {
- redMask = _RM(depth);
- greenMask = _GM(depth);
- blueMask = _BM(depth);
- }
- new->next = 0;
- new->depth = depth;
- new->visuals = visuals;
- new->bitsPerRGB = bitsPerRGB;
- new->redMask = redMask;
- new->greenMask = greenMask;
- new->blueMask = blueMask;
- new->count = popCount (visuals);
- for (prev = &fbVisuals; (v = *prev); prev = &v->next);
- *prev = new;
- return TRUE;
-}
-
-Bool
-fbHasVisualTypes (int depth)
-{
- fbVisualsPtr v;
-
- for (v = fbVisuals; v; v = v->next)
- if (v->depth == depth)
- return TRUE;
- return FALSE;
-}
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
- return fbSetVisualTypesAndMasks (depth, visuals, bitsPerRGB,
- _RM(depth), _GM(depth), _BM(depth));
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of fb.
- */
-
-Bool
-fbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB)
-{
- int i, j = 0, k;
- VisualPtr visual;
- DepthPtr depth;
- VisualID *vid;
- int d, b;
- int f;
- int ndepth, nvisual;
- int nvtype;
- int vtype;
- fbVisualsPtr visuals, nextVisuals;
-
- /* none specified, we'll guess from pixmap formats */
- if (!fbVisuals)
- {
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- d = screenInfo.formats[f].depth;
- b = screenInfo.formats[f].bitsPerPixel;
- if (sizes & (1 << (b - 1)))
- {
- if (d > MAX_PSEUDO_DEPTH)
- vtype = LARGE_VISUALS;
- else if (d == 1)
- vtype = StaticGrayMask;
- else
- vtype = ALL_VISUALS;
- }
- else
- vtype = 0;
- if (!fbSetVisualTypes (d, vtype, bitsPerRGB))
- return FALSE;
- }
- }
- nvisual = 0;
- ndepth = 0;
- for (visuals = fbVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- ndepth++;
- nvisual += visuals->count;
- }
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
- if (!depth || !visual)
- {
- xfree (depth);
- xfree (visual);
- return FALSE;
- }
- *depthp = depth;
- *visualp = visual;
- *ndepthp = ndepth;
- *nvisualp = nvisual;
- for (visuals = fbVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- d = visuals->depth;
- vtype = visuals->visuals;
- nvtype = visuals->count;
- vid = NULL;
- if (nvtype)
- {
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
- if (!vid)
- return FALSE;
- }
- depth->depth = d;
- depth->numVids = nvtype;
- depth->vids = vid;
- depth++;
- for (i = 0; i < NUM_PRIORITY; i++) {
- if (! (vtype & (1 << fbVisualPriority[i])))
- continue;
- visual->class = fbVisualPriority[i];
- visual->bitsPerRGBValue = visuals->bitsPerRGB;
- visual->ColormapEntries = 1 << d;
- visual->nplanes = d;
- visual->vid = *vid = FakeClientID (0);
- switch (visual->class) {
- case PseudoColor:
- case GrayScale:
- case StaticGray:
- case StaticColor:
- visual->redMask = 0;
- visual->greenMask = 0;
- visual->blueMask = 0;
- visual->offsetRed = 0;
- visual->offsetGreen = 0;
- visual->offsetBlue = 0;
- break;
- case DirectColor:
- case TrueColor:
- visual->ColormapEntries = _CE(d);
- visual->redMask = visuals->redMask;
- visual->greenMask = visuals->greenMask;
- visual->blueMask = visuals->blueMask;
- visual->offsetRed = maskShift (visuals->redMask);
- visual->offsetGreen = maskShift (visuals->greenMask);
- visual->offsetBlue = maskShift (visuals->blueMask);
- }
- vid++;
- visual++;
- }
- xfree (visuals);
- }
- fbVisuals = NULL;
- visual = *visualp;
- depth = *depthp;
- for (i = 0; i < ndepth; i++)
- {
- if (*rootDepthp && *rootDepthp != depth[i].depth)
- continue;
- for (j = 0; j < depth[i].numVids; j++)
- {
- for (k = 0; k < nvisual; k++)
- if (visual[k].vid == depth[i].vids[j])
- break;
- if (k == nvisual)
- continue;
- if (defaultColorVisualClass < 0 ||
- visual[k].class == defaultColorVisualClass)
- break;
- }
- if (j != depth[i].numVids)
- break;
- }
- if (i == ndepth) {
- for (i = 0; i < ndepth; i++)
- {
- if (depth[i].numVids)
- break;
- }
- if (i == ndepth)
- return FALSE;
- j = 0;
- }
- *rootDepthp = depth[i].depth;
- *defaultVisp = depth[i].vids[j];
- return TRUE;
-}
-#else
-
-#include "micmap.h"
-
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-void
-fbInstallColormap(ColormapPtr pmap)
-{
- miInstallColormap(pmap);
-}
-
-void
-fbUninstallColormap(ColormapPtr pmap)
-{
- miUninstallColormap(pmap);
-}
-
-void
-fbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-fbInitializeColormap(ColormapPtr pmap)
-{
- return miInitializeColormap(pmap);
-}
-
-int
-fbExpandDirectColors (ColormapPtr pmap,
- int ndef,
- xColorItem *indefs,
- xColorItem *outdefs)
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen)
-{
- return miCreateDefColormap(pScreen);
-}
-
-void
-fbClearVisualTypes(void)
-{
- miClearVisualTypes();
-}
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of fb.
- */
-
-Bool
-fbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB)
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
-#endif
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
deleted file mode 100644
index dd030d927..000000000
--- a/fb/fbcompose.c
+++ /dev/null
@@ -1,2864 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.17 2003/11/03 05:11:00 tsi Exp $
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "fb.h"
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-
-/*
- * General purpose compositing code optimized for minimal memory
- * references
- *
- * All work is done on canonical ARGB values, functions for fetching
- * and storing these exist for each format.
- */
-
-/*
- * Combine src and mask using IN
- */
-
-CARD32
-fbCombineMaskU (FbCompositeOperand *src,
- FbCompositeOperand *msk)
-{
- CARD32 x;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetch) (msk) >> 24;
- if (!a)
- return 0;
-
- x = (*src->fetch) (src);
- if (a == 0xff)
- return x;
-
- m = FbInU(x,0,a,t);
- n = FbInU(x,8,a,t);
- o = FbInU(x,16,a,t);
- p = FbInU(x,24,a,t);
- return m|n|o|p;
-}
-
-FbCompSrc
-fbCombineMaskC (FbCompositeOperand *src,
- FbCompositeOperand *msk)
-{
- FbCompSrc s;
- CARD32 x;
- CARD32 a;
- CARD16 xa;
- CARD16 t;
- CARD32 m,n,o,p;
-
- if (!msk)
- {
- x = (*src->fetch) (src);
- s.value = x;
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- s.alpha = x;
- return s;
- }
-
- a = (*msk->fetcha) (msk);
- if (!a)
- {
- s.value = 0;
- s.alpha = 0;
- return s;
- }
-
- x = (*src->fetch) (src);
- if (a == 0xffffffff)
- {
- s.value = x;
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- s.alpha = x;
- return s;
- }
-
- m = FbInC(x,0,a,t);
- n = FbInC(x,8,a,t);
- o = FbInC(x,16,a,t);
- p = FbInC(x,24,a,t);
- s.value = m|n|o|p;
- xa = x >> 24;
- m = FbInU(a,0,xa,t);
- n = FbInU(a,8,xa,t);
- o = FbInU(a,16,xa,t);
- p = FbInU(a,24,xa,t);
- s.alpha = m|n|o|p;
- return s;
-}
-
-CARD32
-fbCombineMaskValueC (FbCompositeOperand *src,
- FbCompositeOperand *msk)
-{
- CARD32 x;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- if (!msk)
- {
- return (*src->fetch) (src);
- }
-
- a = (*msk->fetcha) (msk);
- if (!a)
- return a;
-
- x = (*src->fetch) (src);
- if (a == 0xffffffff)
- return x;
-
- m = FbInC(x,0,a,t);
- n = FbInC(x,8,a,t);
- o = FbInC(x,16,a,t);
- p = FbInC(x,24,a,t);
- return m|n|o|p;
-}
-
-/*
- * Combine src and mask using IN, generating only the alpha component
- */
-CARD32
-fbCombineMaskAlphaU (FbCompositeOperand *src,
- FbCompositeOperand *msk)
-{
- CARD32 x;
- CARD16 a;
- CARD16 t;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetch) (msk) >> 24;
- if (!a)
- return 0;
-
- x = (*src->fetch) (src);
- if (a == 0xff)
- return x;
-
- return FbInU(x,24,a,t);
-}
-
-CARD32
-fbCombineMaskAlphaC (FbCompositeOperand *src,
- FbCompositeOperand *msk)
-{
- CARD32 x;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetcha) (msk);
- if (!a)
- return 0;
-
- x = (*src->fetcha) (src);
- if (a == 0xffffffff)
- return x;
-
- m = FbInC(x,0,a,t);
- n = FbInC(x,8,a,t);
- o = FbInC(x,16,a,t);
- p = FbInC(x,24,a,t);
- return m|n|o|p;
-}
-
-/*
- * All of the composing functions
- */
-void
-fbCombineClear (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- (*dst->store) (dst, 0);
-}
-
-void
-fbCombineSrcU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- (*dst->store) (dst, fbCombineMaskU (src, msk));
-}
-
-void
-fbCombineSrcC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- (*dst->store) (dst, fbCombineMaskValueC (src, msk));
-}
-
-void
-fbCombineDst (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- /* noop */
-}
-
-void
-fbCombineOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- a = ~s >> 24;
- if (a != 0xff)
- {
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbOverU(s,d,0,a,t);
- n = FbOverU(s,d,8,a,t);
- o = FbOverU(s,d,16,a,t);
- p = FbOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-void
-fbCombineOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- FbCompSrc cs;
- CARD32 s, d;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- cs = fbCombineMaskC (src, msk);
- s = cs.value;
- a = ~cs.alpha;
- if (a != 0xffffffff)
- {
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbOverC(s,d,0,a,t);
- n = FbOverC(s,d,8,a,t);
- o = FbOverC(s,d,16,a,t);
- p = FbOverC(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-void
-fbCombineOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- if (a)
- {
- s = fbCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = FbOverU(d,s,0,a,t);
- n = FbOverU(d,s,8,a,t);
- o = FbOverU(d,s,16,a,t);
- p = FbOverU(d,s,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-void
-fbCombineOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- if (a)
- {
- s = fbCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = FbOverU(d,s,0,a,t);
- n = FbOverU(d,s,8,a,t);
- o = FbOverU(d,s,16,a,t);
- p = FbOverU(d,s,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-void
-fbCombineInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = d >> 24;
- s = 0;
- if (a)
- {
- s = fbCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = FbInU(s,0,a,t);
- n = FbInU(s,8,a,t);
- o = FbInU(s,16,a,t);
- p = FbInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = d >> 24;
- s = 0;
- if (a)
- {
- s = fbCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = FbInU(s,0,a,t);
- n = FbInU(s,8,a,t);
- o = FbInU(s,16,a,t);
- p = FbInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskAlphaU (src, msk);
- a = s >> 24;
- if (a != 0xff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbInU(d,0,a,t);
- n = FbInU(d,8,a,t);
- o = FbInU(d,16,a,t);
- p = FbInU(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-void
-fbCombineInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskAlphaC (src, msk);
- a = s;
- if (a != 0xffffffff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbInC(d,0,a,t);
- n = FbInC(d,8,a,t);
- o = FbInC(d,16,a,t);
- p = FbInC(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-void
-fbCombineOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- s = 0;
- if (a)
- {
- s = fbCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = FbInU(s,0,a,t);
- n = FbInU(s,8,a,t);
- o = FbInU(s,16,a,t);
- p = FbInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- s = 0;
- if (a)
- {
- s = fbCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = FbInU(s,0,a,t);
- n = FbInU(s,8,a,t);
- o = FbInU(s,16,a,t);
- p = FbInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskAlphaU (src, msk);
- a = ~s >> 24;
- if (a != 0xff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbInU(d,0,a,t);
- n = FbInU(d,8,a,t);
- o = FbInU(d,16,a,t);
- p = FbInU(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-void
-fbCombineOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD32 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskAlphaC (src, msk);
- a = ~s;
- if (a != 0xffffffff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = FbInC(d,0,a,t);
- n = FbInC(d,8,a,t);
- o = FbInC(d,16,a,t);
- p = FbInC(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-void
-fbCombineAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 ad, as;
- CARD16 t,u,v;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = ~s >> 24;
- as = d >> 24;
- m = FbGen(s,d,0,as,ad,t,u,v);
- n = FbGen(s,d,8,as,ad,t,u,v);
- o = FbGen(s,d,16,as,ad,t,u,v);
- p = FbGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- FbCompSrc cs;
- CARD32 s, d;
- CARD32 ad;
- CARD16 as;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- cs = fbCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = cs.alpha;
- as = d >> 24;
- m = FbGen(s,d,0,as,FbGet8(ad,0),t,u,v);
- n = FbGen(s,d,8,as,FbGet8(ad,8),t,u,v);
- o = FbGen(s,d,16,as,FbGet8(ad,16),t,u,v);
- p = FbGen(s,d,24,as,FbGet8(ad,24),t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 ad, as;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = s >> 24;
- as = ~d >> 24;
- m = FbGen(s,d,0,as,ad,t,u,v);
- n = FbGen(s,d,8,as,ad,t,u,v);
- o = FbGen(s,d,16,as,ad,t,u,v);
- p = FbGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- FbCompSrc cs;
- CARD32 s, d, ad;
- CARD16 as;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- cs = fbCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = cs.alpha;
- as = ~d >> 24;
- m = FbGen(s,d,0,as,FbGet8(ad,0),t,u,v);
- n = FbGen(s,d,8,as,FbGet8(ad,8),t,u,v);
- o = FbGen(s,d,16,as,FbGet8(ad,16),t,u,v);
- p = FbGen(s,d,24,as,FbGet8(ad,24),t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 ad, as;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = ~s >> 24;
- as = ~d >> 24;
- m = FbGen(s,d,0,as,ad,t,u,v);
- n = FbGen(s,d,8,as,ad,t,u,v);
- o = FbGen(s,d,16,as,ad,t,u,v);
- p = FbGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- FbCompSrc cs;
- CARD32 s, d, ad;
- CARD16 as;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- cs = fbCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = ~cs.alpha;
- as = ~d >> 24;
- m = FbGen(s,d,0,as,ad,t,u,v);
- n = FbGen(s,d,8,as,ad,t,u,v);
- o = FbGen(s,d,16,as,ad,t,u,v);
- p = FbGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-void
-fbCombineAddU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- if (s == ~0)
- (*dst->store) (dst, s);
- else
- {
- d = (*dst->fetch) (dst);
- if (s && d != ~0)
- {
- m = FbAdd(s,d,0,t);
- n = FbAdd(s,d,8,t);
- o = FbAdd(s,d,16,t);
- p = FbAdd(s,d,24,t);
- (*dst->store) (dst, m|n|o|p);
- }
- }
-}
-
-void
-fbCombineAddC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskValueC (src, msk);
- if (s == ~0)
- (*dst->store) (dst, s);
- else
- {
- d = (*dst->fetch) (dst);
- if (s && d != ~0)
- {
- m = FbAdd(s,d,0,t);
- n = FbAdd(s,d,8,t);
- o = FbAdd(s,d,16,t);
- p = FbAdd(s,d,24,t);
- (*dst->store) (dst, m|n|o|p);
- }
- }
-}
-
-void
-fbCombineSaturateU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s = fbCombineMaskU (src, msk), d;
-#if 0
- CARD16 sa, da;
- CARD16 ad, as;
- CARD16 t;
- CARD32 m,n,o,p;
-
- d = (*dst->fetch) (dst);
- sa = s >> 24;
- da = ~d >> 24;
- if (sa <= da)
- {
- m = FbAdd(s,d,0,t);
- n = FbAdd(s,d,8,t);
- o = FbAdd(s,d,16,t);
- p = FbAdd(s,d,24,t);
- }
- else
- {
- as = (da << 8) / sa;
- ad = 0xff;
- m = FbGen(s,d,0,as,ad,t,u,v);
- n = FbGen(s,d,8,as,ad,t,u,v);
- o = FbGen(s,d,16,as,ad,t,u,v);
- p = FbGen(s,d,24,as,ad,t,u,v);
- }
- (*dst->store) (dst, m|n|o|p);
-#else
- if ((s >> 24) == 0xff)
- (*dst->store) (dst, s);
- else
- {
- d = (*dst->fetch) (dst);
- if ((s >> 24) > (d >> 24))
- (*dst->store) (dst, s);
- }
-#endif
-}
-
-void
-fbCombineSaturateC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- FbCompSrc cs;
- CARD32 s, d;
- CARD16 sa, sr, sg, sb, da;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- cs = fbCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- sa = (cs.alpha >> 24) & 0xff;
- sr = (cs.alpha >> 16) & 0xff;
- sg = (cs.alpha >> 8) & 0xff;
- sb = (cs.alpha ) & 0xff;
- da = ~d >> 24;
-
- if (sb <= da)
- m = FbAdd(s,d,0,t);
- else
- m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v);
-
- if (sg <= da)
- n = FbAdd(s,d,8,t);
- else
- n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v);
-
- if (sr < da)
- o = FbAdd(s,d,16,t);
- else
- o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v);
-
- if (sa <= da)
- p = FbAdd(s,d,24,t);
- else
- p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v);
-
- (*dst->store) (dst, m|n|o|p);
-}
-
-/*
- * All of the disjoint composing functions
-
- The four entries in the first column indicate what source contributions
- come from each of the four areas of the picture -- areas covered by neither
- A nor B, areas covered only by A, areas covered only by B and finally
- areas covered by both A and B.
-
- Disjoint Conjoint
- Fa Fb Fa Fb
-(0,0,0,0) 0 0 0 0
-(0,A,0,A) 1 0 1 0
-(0,0,B,B) 0 1 0 1
-(0,A,B,A) 1 min((1-a)/b,1) 1 max(1-a/b,0)
-(0,A,B,B) min((1-b)/a,1) 1 max(1-b/a,0) 1
-(0,0,0,A) max(1-(1-b)/a,0) 0 min(1,b/a) 0
-(0,0,0,B) 0 max(1-(1-a)/b,0) 0 min(a/b,1)
-(0,A,0,0) min(1,(1-b)/a) 0 max(1-b/a,0) 0
-(0,0,B,0) 0 min(1,(1-a)/b) 0 max(1-a/b,0)
-(0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0)
-(0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b)
-(0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0)
-
- */
-
-#define CombineAOut 1
-#define CombineAIn 2
-#define CombineBOut 4
-#define CombineBIn 8
-
-#define CombineClear 0
-#define CombineA (CombineAOut|CombineAIn)
-#define CombineB (CombineBOut|CombineBIn)
-#define CombineAOver (CombineAOut|CombineBOut|CombineAIn)
-#define CombineBOver (CombineAOut|CombineBOut|CombineBIn)
-#define CombineAAtop (CombineBOut|CombineAIn)
-#define CombineBAtop (CombineAOut|CombineBIn)
-#define CombineXor (CombineAOut|CombineBOut)
-
-/* portion covered by a but not b */
-CARD8
-fbCombineDisjointOutPart (CARD8 a, CARD8 b)
-{
- /* min (1, (1-b) / a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* (1-b) / a */
-}
-
-/* portion covered by both a and b */
-CARD8
-fbCombineDisjointInPart (CARD8 a, CARD8 b)
-{
- /* max (1-(1-b)/a,0) */
- /* = - min ((1-b)/a - 1, 0) */
- /* = 1 - min (1, (1-b)/a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0; /* 1 - 1 */
- return ~FbIntDiv(b,a); /* 1 - (1-b) / a */
-}
-
-void
-fbCombineDisjointGeneralU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine)
-{
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD16 Fa, Fb, t, u, v;
- CARD8 sa, da;
-
- s = fbCombineMaskU (src, msk);
- sa = s >> 24;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = fbCombineDisjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = fbCombineDisjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineDisjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineDisjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,Fa,Fb,t,u,v);
- n = FbGen (s,d,8,Fa,Fb,t,u,v);
- o = FbGen (s,d,16,Fa,Fb,t,u,v);
- p = FbGen (s,d,24,Fa,Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineDisjointGeneralC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine)
-{
- FbCompSrc cs;
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD32 Fa;
- CARD16 Fb, t, u, v;
- CARD32 sa;
- CARD8 da;
-
- cs = fbCombineMaskC (src, msk);
- s = cs.value;
- sa = cs.alpha;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = fbCombineDisjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineDisjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineDisjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineDisjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = fbCombineDisjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineDisjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineDisjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineDisjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineDisjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineDisjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,FbGet8(Fa,0),Fb,t,u,v);
- n = FbGen (s,d,8,FbGet8(Fa,8),Fb,t,u,v);
- o = FbGen (s,d,16,FbGet8(Fa,16),Fb,t,u,v);
- p = FbGen (s,d,24,FbGet8(Fa,24),Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineDisjointOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- a = s >> 24;
- if (a != 0x00)
- {
- if (a != 0xff)
- {
- d = (*dst->fetch) (dst);
- a = fbCombineDisjointOutPart (d >> 24, a);
- m = FbOverU(s,d,0,a,t);
- n = FbOverU(s,d,8,a,t);
- o = FbOverU(s,d,16,a,t);
- p = FbOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-void
-fbCombineDisjointOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineAOver);
-}
-
-void
-fbCombineDisjointOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineBOver);
-}
-
-void
-fbCombineDisjointOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineBOver);
-}
-
-void
-fbCombineDisjointInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineAIn);
-}
-
-void
-fbCombineDisjointInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineAIn);
-}
-
-void
-fbCombineDisjointInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineBIn);
-}
-
-void
-fbCombineDisjointInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineBIn);
-}
-
-void
-fbCombineDisjointOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineAOut);
-}
-
-void
-fbCombineDisjointOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineAOut);
-}
-
-void
-fbCombineDisjointOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineBOut);
-}
-
-void
-fbCombineDisjointOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineBOut);
-}
-
-void
-fbCombineDisjointAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineAAtop);
-}
-
-void
-fbCombineDisjointAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineAAtop);
-}
-
-void
-fbCombineDisjointAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineBAtop);
-}
-
-void
-fbCombineDisjointAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineBAtop);
-}
-
-void
-fbCombineDisjointXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralU (src, msk, dst, CombineXor);
-}
-
-void
-fbCombineDisjointXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineDisjointGeneralC (src, msk, dst, CombineXor);
-}
-
-/* portion covered by a but not b */
-CARD8
-fbCombineConjointOutPart (CARD8 a, CARD8 b)
-{
- /* max (1-b/a,0) */
- /* = 1-min(b/a,1) */
-
- /* min (1, (1-b) / a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0x00; /* 0 */
- return ~FbIntDiv(b,a); /* 1 - b/a */
-}
-
-/* portion covered by both a and b */
-CARD8
-fbCombineConjointInPart (CARD8 a, CARD8 b)
-{
- /* min (1,b/a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* b/a */
-}
-
-void
-fbCombineConjointGeneralU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine)
-{
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD16 Fa, Fb, t, u, v;
- CARD8 sa, da;
-
- s = fbCombineMaskU (src, msk);
- sa = s >> 24;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = fbCombineConjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = fbCombineConjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineConjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineConjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,Fa,Fb,t,u,v);
- n = FbGen (s,d,8,Fa,Fb,t,u,v);
- o = FbGen (s,d,16,Fa,Fb,t,u,v);
- p = FbGen (s,d,24,Fa,Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineConjointGeneralC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine)
-{
- FbCompSrc cs;
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD32 Fa;
- CARD16 Fb, t, u, v;
- CARD32 sa;
- CARD8 da;
-
- cs = fbCombineMaskC (src, msk);
- s = cs.value;
- sa = cs.alpha;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = fbCombineConjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineConjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineConjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineConjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = fbCombineConjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineConjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineConjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineConjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineConjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineConjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,FbGet8(Fa,0),Fb,t,u,v);
- n = FbGen (s,d,8,FbGet8(Fa,8),Fb,t,u,v);
- o = FbGen (s,d,16,FbGet8(Fa,16),Fb,t,u,v);
- p = FbGen (s,d,24,FbGet8(Fa,24),Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-void
-fbCombineConjointOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineAOver);
-/*
- CARD32 s, d;
- CARD16 a;
- CARD16 t;
- CARD32 m,n,o,p;
-
- s = fbCombineMaskU (src, msk);
- a = s >> 24;
- if (a != 0x00)
- {
- if (a != 0xff)
- {
- d = (*dst->fetch) (dst);
- a = fbCombineConjointOutPart (d >> 24, a);
- m = FbOverU(s,d,0,a,t);
- n = FbOverU(s,d,8,a,t);
- o = FbOverU(s,d,16,a,t);
- p = FbOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
- */
-}
-
-void
-fbCombineConjointOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineAOver);
-}
-
-void
-fbCombineConjointOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineBOver);
-}
-
-void
-fbCombineConjointOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineBOver);
-}
-
-void
-fbCombineConjointInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineAIn);
-}
-
-void
-fbCombineConjointInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineAIn);
-}
-
-void
-fbCombineConjointInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineBIn);
-}
-
-void
-fbCombineConjointInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineBIn);
-}
-
-void
-fbCombineConjointOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineAOut);
-}
-
-void
-fbCombineConjointOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineAOut);
-}
-
-void
-fbCombineConjointOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineBOut);
-}
-
-void
-fbCombineConjointOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineBOut);
-}
-
-void
-fbCombineConjointAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineAAtop);
-}
-
-void
-fbCombineConjointAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineAAtop);
-}
-
-void
-fbCombineConjointAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineBAtop);
-}
-
-void
-fbCombineConjointAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineBAtop);
-}
-
-void
-fbCombineConjointXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralU (src, msk, dst, CombineXor);
-}
-
-void
-fbCombineConjointXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst)
-{
- fbCombineConjointGeneralC (src, msk, dst, CombineXor);
-}
-
-FbCombineFunc fbCombineFuncU[] = {
- fbCombineClear,
- fbCombineSrcU,
- fbCombineDst,
- fbCombineOverU,
- fbCombineOverReverseU,
- fbCombineInU,
- fbCombineInReverseU,
- fbCombineOutU,
- fbCombineOutReverseU,
- fbCombineAtopU,
- fbCombineAtopReverseU,
- fbCombineXorU,
- fbCombineAddU,
- fbCombineDisjointOverU, /* Saturate */
- 0,
- 0,
- fbCombineClear,
- fbCombineSrcU,
- fbCombineDst,
- fbCombineDisjointOverU,
- fbCombineDisjointOverReverseU,
- fbCombineDisjointInU,
- fbCombineDisjointInReverseU,
- fbCombineDisjointOutU,
- fbCombineDisjointOutReverseU,
- fbCombineDisjointAtopU,
- fbCombineDisjointAtopReverseU,
- fbCombineDisjointXorU,
- 0,
- 0,
- 0,
- 0,
- fbCombineClear,
- fbCombineSrcU,
- fbCombineDst,
- fbCombineConjointOverU,
- fbCombineConjointOverReverseU,
- fbCombineConjointInU,
- fbCombineConjointInReverseU,
- fbCombineConjointOutU,
- fbCombineConjointOutReverseU,
- fbCombineConjointAtopU,
- fbCombineConjointAtopReverseU,
- fbCombineConjointXorU,
-};
-
-FbCombineFunc fbCombineFuncC[] = {
- fbCombineClear,
- fbCombineSrcC,
- fbCombineDst,
- fbCombineOverC,
- fbCombineOverReverseC,
- fbCombineInC,
- fbCombineInReverseC,
- fbCombineOutC,
- fbCombineOutReverseC,
- fbCombineAtopC,
- fbCombineAtopReverseC,
- fbCombineXorC,
- fbCombineAddC,
- fbCombineDisjointOverC, /* Saturate */
- 0,
- 0,
- fbCombineClear, /* 0x10 */
- fbCombineSrcC,
- fbCombineDst,
- fbCombineDisjointOverC,
- fbCombineDisjointOverReverseC,
- fbCombineDisjointInC,
- fbCombineDisjointInReverseC,
- fbCombineDisjointOutC,
- fbCombineDisjointOutReverseC,
- fbCombineDisjointAtopC,
- fbCombineDisjointAtopReverseC,
- fbCombineDisjointXorC, /* 0x1b */
- 0,
- 0,
- 0,
- 0,
- fbCombineClear,
- fbCombineSrcC,
- fbCombineDst,
- fbCombineConjointOverC,
- fbCombineConjointOverReverseC,
- fbCombineConjointInC,
- fbCombineConjointInReverseC,
- fbCombineConjointOutC,
- fbCombineConjointOutReverseC,
- fbCombineConjointAtopC,
- fbCombineConjointAtopReverseC,
- fbCombineConjointXorC,
-};
-
-/*
- * All of the fetch functions
- */
-
-CARD32
-fbFetch_a8r8g8b8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- return ((CARD32 *)line)[offset >> 5];
-}
-
-CARD32
-fbFetch_x8r8g8b8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- return ((CARD32 *)line)[offset >> 5] | 0xff000000;
-}
-
-CARD32
-fbFetch_a8b8g8r8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD32 *)line)[offset >> 5];
-
- return ((pixel & 0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-CARD32
-fbFetch_x8b8g8r8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD32 *)line)[offset >> 5];
-
- return ((0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-CARD32
-fbFetch_r8g8b8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#else
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#endif
-}
-
-CARD32
-fbFetch_b8g8r8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#else
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#endif
-}
-
-CARD32
-fbFetch_r5g6b5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_b5g6r5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a1r5g5b5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 a,r,g,b;
-
- a = (CARD32) ((CARD8) (0 - ((pixel & 0x8000) >> 15))) << 24;
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (a | r | g | b);
-}
-
-CARD32
-fbFetch_x1r5g5b5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a1b5g5r5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 a,r,g,b;
-
- a = (CARD32) ((CARD8) (0 - ((pixel & 0x8000) >> 15))) << 24;
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (a | r | g | b);
-}
-
-CARD32
-fbFetch_x1b5g5r5 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a4r4g4b4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-CARD32
-fbFetch_x4r4g4b4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a4b4g4r4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-CARD32
-fbFetch_x4b4g4r4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD16 *) line)[offset >> 4];
- CARD32 r,g,b;
-
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
-
- return pixel << 24;
-}
-
-CARD32
-fbFetcha_a8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
-
- pixel |= pixel << 8;
- pixel |= pixel << 16;
- return pixel;
-}
-
-CARD32
-fbFetch_r3g3b2 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
- CARD32 r,g,b;
-
- r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16;
- g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8;
- b = (((pixel & 0x03) ) |
- ((pixel & 0x03) << 2) |
- ((pixel & 0x03) << 4) |
- ((pixel & 0x03) << 6));
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_b2g3r3 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
- CARD32 r,g,b;
-
- b = (((pixel & 0xc0) ) |
- ((pixel & 0xc0) >> 2) |
- ((pixel & 0xc0) >> 4) |
- ((pixel & 0xc0) >> 6));
- g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8;
- r = (((pixel & 0x07) ) |
- ((pixel & 0x07) << 3) |
- ((pixel & 0x06) << 6)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-CARD32
-fbFetch_a2r2g2b2 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- r = ((pixel & 0x30) * 0x55) << 12;
- g = ((pixel & 0x0c) * 0x55) << 6;
- b = ((pixel & 0x03) * 0x55);
- return a|r|g|b;
-}
-
-CARD32
-fbFetch_a2b2g2r2 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- b = ((pixel & 0x30) * 0x55) >> 6;
- g = ((pixel & 0x0c) * 0x55) << 6;
- r = ((pixel & 0x03) * 0x55) << 16;
- return a|r|g|b;
-}
-
-CARD32
-fbFetch_c8 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD8 *) line)[offset>>3];
-
- return op->indexed->rgba[pixel];
-}
-
-#define Fetch8(l,o) (((CARD8 *) (l))[(o) >> 3])
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
-#else
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf)
-#endif
-
-CARD32
-fbFetch_a4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
-
- pixel |= pixel << 4;
- return pixel << 24;
-}
-
-CARD32
-fbFetcha_a4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
-
- pixel |= pixel << 4;
- pixel |= pixel << 8;
- pixel |= pixel << 16;
- return pixel;
-}
-
-CARD32
-fbFetch_r1g2b1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
- CARD32 r,g,b;
-
- r = ((pixel & 0x8) * 0xff) << 13;
- g = ((pixel & 0x6) * 0x55) << 7;
- b = ((pixel & 0x1) * 0xff);
- return 0xff000000|r|g|b;
-}
-
-CARD32
-fbFetch_b1g2r1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
- CARD32 r,g,b;
-
- b = ((pixel & 0x8) * 0xff) >> 3;
- g = ((pixel & 0x6) * 0x55) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
- return 0xff000000|r|g|b;
-}
-
-CARD32
-fbFetch_a1r1g1b1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
- CARD32 a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) << 14;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff);
- return a|r|g|b;
-}
-
-CARD32
-fbFetch_a1b1g1r1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
- CARD32 a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) >> 3;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff) << 16;
- return a|r|g|b;
-}
-
-CARD32
-fbFetch_c4 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = Fetch4(line, offset);
-
- return op->indexed->rgba[pixel];
-}
-
-CARD32
-fbFetcha_a1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD32 *)line)[offset >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- a |= a << 8;
- a |= a << 16;
- return a;
-}
-
-CARD32
-fbFetch_a1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD32 *)line)[offset >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- return a << 24;
-}
-
-CARD32
-fbFetch_g1 (FbCompositeOperand *op)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel = ((CARD32 *)line)[offset >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- return op->indexed->rgba[a];
-}
-
-/*
- * All the store functions
- */
-
-#define Splita(v) CARD32 a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-#define Split(v) CARD32 r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-
-void
-fbStore_a8r8g8b8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- ((CARD32 *)line)[offset >> 5] = value;
-}
-
-void
-fbStore_x8r8g8b8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- ((CARD32 *)line)[offset >> 5] = value & 0xffffff;
-}
-
-void
-fbStore_a8b8g8r8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- Splita(value);
- ((CARD32 *)line)[offset >> 5] = a << 24 | b << 16 | g << 8 | r;
-}
-
-void
-fbStore_x8b8g8r8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- Split(value);
- ((CARD32 *)line)[offset >> 5] = b << 16 | g << 8 | r;
-}
-
-void
-fbStore_r8g8b8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- Split(value);
-#if IMAGE_BYTE_ORDER == MSBFirst
- pixel[0] = r;
- pixel[1] = g;
- pixel[2] = b;
-#else
- pixel[0] = b;
- pixel[1] = g;
- pixel[2] = r;
-#endif
-}
-
-void
-fbStore_b8g8r8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- Split(value);
-#if IMAGE_BYTE_ORDER == MSBFirst
- pixel[0] = b;
- pixel[1] = g;
- pixel[2] = r;
-#else
- pixel[0] = r;
- pixel[1] = g;
- pixel[2] = b;
-#endif
-}
-
-void
-fbStore_r5g6b5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((b >> 3) ));
-}
-
-void
-fbStore_b5g6r5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((r >> 3) ));
-}
-
-void
-fbStore_a1r5g5b5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0x8000) |
- ((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
-}
-
-void
-fbStore_x1r5g5b5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
-}
-
-void
-fbStore_a1b5g5r5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0x8000) |
- ((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
-}
-
-void
-fbStore_x1b5g5r5 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
-}
-
-void
-fbStore_a4r4g4b4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0xf000) |
- ((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
-}
-
-void
-fbStore_x4r4g4b4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
-}
-
-void
-fbStore_a4b4g4r4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0xf000) |
- ((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
-}
-
-void
-fbStore_x4b4g4r4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD16 *pixel = ((CARD16 *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
-}
-
-void
-fbStore_a8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- *pixel = value >> 24;
-}
-
-void
-fbStore_r3g3b2 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- Split(value);
- *pixel = (((r ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((b >> 6) ));
-}
-
-void
-fbStore_b2g3r3 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- Split(value);
- *pixel = (((b ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((r >> 6) ));
-}
-
-void
-fbStore_a2r2g2b2 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- Splita(value);
- *pixel = (((a ) & 0xc0) |
- ((r >> 2) & 0x30) |
- ((g >> 4) & 0x0c) |
- ((b >> 6) ));
-}
-
-void
-fbStore_c8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- *pixel = miIndexToEnt24(op->indexed,value);
-}
-
-void
-fbStore_g8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD8 *pixel = ((CARD8 *) line) + (offset >> 3);
- *pixel = miIndexToEntY24(op->indexed,value);
-}
-
-#define Store8(l,o,v) (((CARD8 *) l)[(o) >> 3] = (v))
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0xf0) | (v) : \
- (Fetch8(l,o) & 0x0f) | ((v) << 4)))
-#else
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0x0f) | ((v) << 4) : \
- (Fetch8(l,o) & 0xf0) | (v)))
-#endif
-
-void
-fbStore_a4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- Store4(line,offset,value>>28);
-}
-
-void
-fbStore_r1g2b1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
-
- Split(value);
- pixel = (((r >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((b >> 7) ));
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_b1g2r1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
-
- Split(value);
- pixel = (((b >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((r >> 7) ));
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_a1r1g1b1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
- Splita(value);
- pixel = (((a >> 4) & 0x8) |
- ((r >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((b >> 7) ));
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_a1b1g1r1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
- Splita(value);
- pixel = (((a >> 4) & 0x8) |
- ((b >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((r >> 7) ));
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_c4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
-
- pixel = miIndexToEnt24(op->indexed,value);
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_g4 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 pixel;
-
- pixel = miIndexToEntY24(op->indexed,value);
- Store4(line,offset,pixel);
-}
-
-void
-fbStore_a1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 *pixel = ((CARD32 *) line) + (offset >> 5);
- CARD32 mask = FbStipMask(offset & 0x1f, 1);
-
- value = value & 0x80000000 ? mask : 0;
- *pixel = (*pixel & ~mask) | value;
-}
-
-void
-fbStore_g1 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- CARD32 *pixel = ((CARD32 *) line) + (offset >> 5);
- CARD32 mask = FbStipMask(offset & 0x1f, 1);
-
- value = miIndexToEntY24(op->indexed,value) ? mask : 0;
- *pixel = (*pixel & ~mask) | value;
-}
-
-CARD32
-fbFetch_external (FbCompositeOperand *op)
-{
- CARD32 rgb = (*op[1].fetch) (&op[1]);
- CARD32 a = (*op[2].fetch) (&op[2]);
-
- return (rgb & 0xffffff) | (a & 0xff000000);
-}
-
-
-CARD32
-fbFetcha_external (FbCompositeOperand *op)
-{
- return (*op[2].fetch) (&op[2]);
-}
-
-void
-fbStore_external (FbCompositeOperand *op, CARD32 value)
-{
- (*op[1].store) (&op[1], value | 0xff000000);
- (*op[2].store) (&op[2], value & 0xff000000);
-}
-
-CARD32
-fbFetch_transform (FbCompositeOperand *op)
-{
- PictVector v;
- int x, y;
- int minx, maxx, miny, maxy;
- int n;
- BoxRec box;
- CARD32 rtot, gtot, btot, atot;
- CARD32 xerr, yerr;
- CARD32 bits;
-
- v.vector[0] = IntToxFixed(op->u.transform.x);
- v.vector[1] = IntToxFixed(op->u.transform.y);
- v.vector[2] = xFixed1;
- if (!PictureTransformPoint (op->u.transform.transform, &v))
- return 0;
- switch (op->u.transform.filter) {
- case PictFilterNearest:
- y = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- x = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- if (POINT_IN_REGION (0, op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetch) (&op[1]);
- }
- else
- bits = 0;
- break;
- case PictFilterBilinear:
- rtot = gtot = btot = atot = 0;
- miny = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- maxy = xFixedToInt (xFixedCeil (v.vector[1])) + op->u.transform.top_y;
-
- minx = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- maxx = xFixedToInt (xFixedCeil (v.vector[0])) + op->u.transform.left_x;
-
- yerr = xFixed1 - xFixedFrac (v.vector[1]);
- for (y = miny; y <= maxy; y++)
- {
- CARD32 lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
-
- xerr = xFixed1 - xFixedFrac (v.vector[0]);
- for (x = minx; x <= maxx; x++)
- {
- if (POINT_IN_REGION (0, op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetch) (&op[1]);
- {
- Splita(bits);
- lrtot += r * xerr;
- lgtot += g * xerr;
- lbtot += b * xerr;
- latot += a * xerr;
- n++;
- }
- }
- xerr = xFixed1 - xerr;
- }
- rtot += (lrtot >> 10) * yerr;
- gtot += (lgtot >> 10) * yerr;
- btot += (lbtot >> 10) * yerr;
- atot += (latot >> 10) * yerr;
- yerr = xFixed1 - yerr;
- }
- if ((atot >>= 22) > 0xff) atot = 0xff;
- if ((rtot >>= 22) > 0xff) rtot = 0xff;
- if ((gtot >>= 22) > 0xff) gtot = 0xff;
- if ((btot >>= 22) > 0xff) btot = 0xff;
- bits = ((atot << 24) |
- (rtot << 16) |
- (gtot << 8) |
- (btot ));
- break;
- default:
- bits = 0;
- break;
- }
- return bits;
-}
-
-CARD32
-fbFetcha_transform (FbCompositeOperand *op)
-{
- PictVector v;
- int x, y;
- int minx, maxx, miny, maxy;
- int n;
- BoxRec box;
- CARD32 rtot, gtot, btot, atot;
- CARD32 xerr, yerr;
- CARD32 bits;
-
- v.vector[0] = IntToxFixed(op->u.transform.x);
- v.vector[1] = IntToxFixed(op->u.transform.y);
- v.vector[2] = xFixed1;
- if (!PictureTransformPoint (op->u.transform.transform, &v))
- return 0;
- switch (op->u.transform.filter) {
- case PictFilterNearest:
- y = xFixedToInt (v.vector[1]) + op->u.transform.left_x;
- x = xFixedToInt (v.vector[0]) + op->u.transform.top_y;
- if (POINT_IN_REGION (0, op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetcha) (&op[1]);
- }
- else
- bits = 0;
- break;
- case PictFilterBilinear:
- rtot = gtot = btot = atot = 0;
-
- miny = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- maxy = xFixedToInt (xFixedCeil (v.vector[1])) + op->u.transform.top_y;
-
- minx = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- maxx = xFixedToInt (xFixedCeil (v.vector[0])) + op->u.transform.left_x;
-
- yerr = xFixed1 - xFixedFrac (v.vector[1]);
- for (y = miny; y <= maxy; y++)
- {
- CARD32 lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
- xerr = xFixed1 - xFixedFrac (v.vector[0]);
- for (x = minx; x <= maxx; x++)
- {
- if (POINT_IN_REGION (0, op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetcha) (&op[1]);
- {
- Splita(bits);
- lrtot += r * xerr;
- lgtot += g * xerr;
- lbtot += b * xerr;
- latot += a * xerr;
- n++;
- }
- }
- x++;
- xerr = xFixed1 - xerr;
- }
- rtot += (lrtot >> 10) * yerr;
- gtot += (lgtot >> 10) * yerr;
- btot += (lbtot >> 10) * yerr;
- atot += (latot >> 10) * yerr;
- y++;
- yerr = xFixed1 - yerr;
- }
- if ((atot >>= 22) > 0xff) atot = 0xff;
- if ((rtot >>= 22) > 0xff) rtot = 0xff;
- if ((gtot >>= 22) > 0xff) gtot = 0xff;
- if ((btot >>= 22) > 0xff) btot = 0xff;
- bits = ((atot << 24) |
- (rtot << 16) |
- (gtot << 8) |
- (btot ));
- break;
- default:
- bits = 0;
- break;
- }
- return bits;
-}
-
-FbAccessMap fbAccessMap[] = {
- /* 32bpp formats */
- { PICT_a8r8g8b8, fbFetch_a8r8g8b8, fbFetch_a8r8g8b8, fbStore_a8r8g8b8 },
- { PICT_x8r8g8b8, fbFetch_x8r8g8b8, fbFetch_x8r8g8b8, fbStore_x8r8g8b8 },
- { PICT_a8b8g8r8, fbFetch_a8b8g8r8, fbFetch_a8b8g8r8, fbStore_a8b8g8r8 },
- { PICT_x8b8g8r8, fbFetch_x8b8g8r8, fbFetch_x8b8g8r8, fbStore_x8b8g8r8 },
-
- /* 24bpp formats */
- { PICT_r8g8b8, fbFetch_r8g8b8, fbFetch_r8g8b8, fbStore_r8g8b8 },
- { PICT_b8g8r8, fbFetch_b8g8r8, fbFetch_b8g8r8, fbStore_b8g8r8 },
-
- /* 16bpp formats */
- { PICT_r5g6b5, fbFetch_r5g6b5, fbFetch_r5g6b5, fbStore_r5g6b5 },
- { PICT_b5g6r5, fbFetch_b5g6r5, fbFetch_b5g6r5, fbStore_b5g6r5 },
-
- { PICT_a1r5g5b5, fbFetch_a1r5g5b5, fbFetch_a1r5g5b5, fbStore_a1r5g5b5 },
- { PICT_x1r5g5b5, fbFetch_x1r5g5b5, fbFetch_x1r5g5b5, fbStore_x1r5g5b5 },
- { PICT_a1b5g5r5, fbFetch_a1b5g5r5, fbFetch_a1b5g5r5, fbStore_a1b5g5r5 },
- { PICT_x1b5g5r5, fbFetch_x1b5g5r5, fbFetch_x1b5g5r5, fbStore_x1b5g5r5 },
- { PICT_a4r4g4b4, fbFetch_a4r4g4b4, fbFetch_a4r4g4b4, fbStore_a4r4g4b4 },
- { PICT_x4r4g4b4, fbFetch_x4r4g4b4, fbFetch_x4r4g4b4, fbStore_x4r4g4b4 },
- { PICT_a4b4g4r4, fbFetch_a4b4g4r4, fbFetch_a4b4g4r4, fbStore_a4b4g4r4 },
- { PICT_x4b4g4r4, fbFetch_x4b4g4r4, fbFetch_x4b4g4r4, fbStore_x4b4g4r4 },
-
- /* 8bpp formats */
- { PICT_a8, fbFetch_a8, fbFetcha_a8, fbStore_a8 },
- { PICT_r3g3b2, fbFetch_r3g3b2, fbFetch_r3g3b2, fbStore_r3g3b2 },
- { PICT_b2g3r3, fbFetch_b2g3r3, fbFetch_b2g3r3, fbStore_b2g3r3 },
- { PICT_a2r2g2b2, fbFetch_a2r2g2b2, fbFetch_a2r2g2b2, fbStore_a2r2g2b2 },
- { PICT_c8, fbFetch_c8, fbFetch_c8, fbStore_c8 },
- { PICT_g8, fbFetch_c8, fbFetch_c8, fbStore_g8 },
-
- /* 4bpp formats */
- { PICT_a4, fbFetch_a4, fbFetcha_a4, fbStore_a4 },
- { PICT_r1g2b1, fbFetch_r1g2b1, fbFetch_r1g2b1, fbStore_r1g2b1 },
- { PICT_b1g2r1, fbFetch_b1g2r1, fbFetch_b1g2r1, fbStore_b1g2r1 },
- { PICT_a1r1g1b1, fbFetch_a1r1g1b1, fbFetch_a1r1g1b1, fbStore_a1r1g1b1 },
- { PICT_a1b1g1r1, fbFetch_a1b1g1r1, fbFetch_a1b1g1r1, fbStore_a1b1g1r1 },
- { PICT_c4, fbFetch_c4, fbFetch_c4, fbStore_c4 },
- { PICT_g4, fbFetch_c4, fbFetch_c4, fbStore_g4 },
-
- /* 1bpp formats */
- { PICT_a1, fbFetch_a1, fbFetcha_a1, fbStore_a1 },
- { PICT_g1, fbFetch_g1, fbFetch_g1, fbStore_g1 },
-};
-#define NumAccessMap (sizeof fbAccessMap / sizeof fbAccessMap[0])
-
-static void
-fbStepOver (FbCompositeOperand *op)
-{
- op->u.drawable.offset += op->u.drawable.bpp;
-}
-
-static void
-fbStepDown (FbCompositeOperand *op)
-{
- op->u.drawable.line += op->u.drawable.stride;
- op->u.drawable.offset = op->u.drawable.start_offset;
-}
-
-static void
-fbSet (FbCompositeOperand *op, int x, int y)
-{
- op->u.drawable.line = op->u.drawable.top_line + y * op->u.drawable.stride;
- op->u.drawable.offset = op->u.drawable.left_offset + x * op->u.drawable.bpp;
-}
-
-static void
-fbStepOver_external (FbCompositeOperand *op)
-{
- (*op[1].over) (&op[1]);
- (*op[2].over) (&op[2]);
-}
-
-static void
-fbStepDown_external (FbCompositeOperand *op)
-{
- (*op[1].down) (&op[1]);
- (*op[2].down) (&op[2]);
-}
-
-static void
-fbSet_external (FbCompositeOperand *op, int x, int y)
-{
- (*op[1].set) (&op[1], x, y);
- (*op[2].set) (&op[2],
- x - op->u.external.alpha_dx,
- y - op->u.external.alpha_dy);
-}
-
-static void
-fbStepOver_transform (FbCompositeOperand *op)
-{
- op->u.transform.x++;
-}
-
-static void
-fbStepDown_transform (FbCompositeOperand *op)
-{
- op->u.transform.y++;
- op->u.transform.x = op->u.transform.start_x;
-}
-
-static void
-fbSet_transform (FbCompositeOperand *op, int x, int y)
-{
- op->u.transform.x = x - op->u.transform.left_x;
- op->u.transform.y = y - op->u.transform.top_y;
-}
-
-
-Bool
-fbBuildCompositeOperand (PicturePtr pPict,
- FbCompositeOperand op[4],
- INT16 x,
- INT16 y,
- Bool transform,
- Bool alpha)
-{
- /* Check for transform */
- if (transform && pPict->transform)
- {
- if (!fbBuildCompositeOperand (pPict, &op[1], 0, 0, FALSE, alpha))
- return FALSE;
-
- op->u.transform.top_y = pPict->pDrawable->y;
- op->u.transform.left_x = pPict->pDrawable->x;
-
- op->u.transform.start_x = x - op->u.transform.left_x;
- op->u.transform.x = op->u.transform.start_x;
- op->u.transform.y = y - op->u.transform.top_y;
- op->u.transform.transform = pPict->transform;
- op->u.transform.filter = pPict->filter;
-
- op->fetch = fbFetch_transform;
- op->fetcha = fbFetcha_transform;
- op->store = 0;
- op->over = fbStepOver_transform;
- op->down = fbStepDown_transform;
- op->set = fbSet_transform;
- op->indexed = (miIndexedPtr) pPict->pFormat->index.devPrivate;
- op->clip = op[1].clip;
-
- return TRUE;
- }
- /* Check for external alpha */
- else if (alpha && pPict->alphaMap)
- {
- if (!fbBuildCompositeOperand (pPict, &op[1], x, y, FALSE, FALSE))
- return FALSE;
- if (!fbBuildCompositeOperand (pPict->alphaMap, &op[2],
- x - pPict->alphaOrigin.x,
- y - pPict->alphaOrigin.y,
- FALSE, FALSE))
- return FALSE;
- op->u.external.alpha_dx = pPict->alphaOrigin.x;
- op->u.external.alpha_dy = pPict->alphaOrigin.y;
-
- op->fetch = fbFetch_external;
- op->fetcha = fbFetcha_external;
- op->store = fbStore_external;
- op->over = fbStepOver_external;
- op->down = fbStepDown_external;
- op->set = fbSet_external;
- op->indexed = (miIndexedPtr) pPict->pFormat->index.devPrivate;
- /* XXX doesn't handle external alpha clips yet */
- op->clip = op[1].clip;
-
- return TRUE;
- }
- /* Build simple operand */
- else
- {
- int i;
- int xoff, yoff;
-
- for (i = 0; i < NumAccessMap; i++)
- if (fbAccessMap[i].format == pPict->format)
- {
- FbBits *bits;
- FbStride stride;
- int bpp;
-
- op->fetch = fbAccessMap[i].fetch;
- op->fetcha = fbAccessMap[i].fetcha;
- op->store = fbAccessMap[i].store;
- op->over = fbStepOver;
- op->down = fbStepDown;
- op->set = fbSet;
- op->indexed = (miIndexedPtr) pPict->pFormat->index.devPrivate;
- op->clip = pPict->pCompositeClip;
-
- fbGetDrawable (pPict->pDrawable, bits, stride, bpp,
- xoff, yoff);
- if (pPict->repeat && pPict->pDrawable->width == 1 &&
- pPict->pDrawable->height == 1)
- {
- bpp = 0;
- stride = 0;
- }
- /*
- * Coordinates of upper left corner of drawable
- */
- op->u.drawable.top_line = bits + yoff * stride;
- op->u.drawable.left_offset = xoff * bpp;
-
- /*
- * Starting position within drawable
- */
- op->u.drawable.start_offset = op->u.drawable.left_offset + x * bpp;
- op->u.drawable.line = op->u.drawable.top_line + y * stride;
- op->u.drawable.offset = op->u.drawable.start_offset;
-
- op->u.drawable.stride = stride;
- op->u.drawable.bpp = bpp;
- return TRUE;
- }
- return FALSE;
- }
-}
-
-void
-fbCompositeGeneral (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbCompositeOperand src[4],msk[4],dst[4],*pmsk;
- FbCombineFunc f;
- int w;
-
- if (!fbBuildCompositeOperand (pSrc, src, xSrc, ySrc, TRUE, TRUE))
- return;
- if (!fbBuildCompositeOperand (pDst, dst, xDst, yDst, FALSE, TRUE))
- return;
- f = fbCombineFuncU[op];
- if (pMask)
- {
- if (!fbBuildCompositeOperand (pMask, msk, xMask, yMask, TRUE, TRUE))
- return;
- pmsk = msk;
- if (pMask->componentAlpha)
- f = fbCombineFuncC[op];
- }
- else
- pmsk = 0;
- while (height--)
- {
- w = width;
-
- while (w--)
- {
- (*f) (src, pmsk, dst);
- (*src->over) (src);
- (*dst->over) (dst);
- if (pmsk)
- (*pmsk->over) (pmsk);
- }
- (*src->down) (src);
- (*dst->down) (dst);
- if (pmsk)
- (*pmsk->down) (pmsk);
- }
-}
diff --git a/fb/fbcopy.c b/fb/fbcopy.c
deleted file mode 100644
index 74d07a1bf..000000000
--- a/fb/fbcopy.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
- * Id: fbcopy.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.13 2003/11/10 18:21:47 tsi Exp $ */
-
-#include "fb.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#endif
-
-void
-fbCopyNtoN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- CARD8 alu = pGC ? pGC->alu : GXcopy;
- FbBits pm = pGC ? fbGetGCPrivate(pGC)->pm : FB_ALLONES;
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- while (nbox--)
- {
- fbBlt (src + (pbox->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
-
- (pbox->x2 - pbox->x1) * dstBpp,
- (pbox->y2 - pbox->y1),
-
- alu,
- pm,
- dstBpp,
-
- reverse,
- upsidedown);
- pbox++;
- }
-}
-
-void
-fbCopy1toN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- while (nbox--)
- {
- if (dstBpp == 1)
- {
- fbBlt (src + (pbox->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
-
- (pbox->x2 - pbox->x1) * dstBpp,
- (pbox->y2 - pbox->y1),
-
- FbOpaqueStipple1Rop(pGC->alu,
- pGC->fgPixel,pGC->bgPixel),
- pPriv->pm,
- dstBpp,
-
- reverse,
- upsidedown);
- }
- else
- {
- fbBltOne ((FbStip *) (src + (pbox->y1 + dy + srcYoff) * srcStride),
- srcStride*(FB_UNIT/FB_STIP_UNIT),
- (pbox->x1 + dx + srcXoff),
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- dstBpp,
-
- (pbox->x2 - pbox->x1) * dstBpp,
- (pbox->y2 - pbox->y1),
-
- pPriv->and, pPriv->xor,
- pPriv->bgand, pPriv->bgxor);
- }
- pbox++;
- }
-}
-
-void
-fbCopyNto1 (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
-
- while (nbox--)
- {
- if (pDstDrawable->bitsPerPixel == 1)
- {
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
-
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetStipDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbBltPlane (src + (pbox->y1+ dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
- srcBpp,
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
-
- (pbox->x2 - pbox->x1) * srcBpp,
- (pbox->y2 - pbox->y1),
-
- (FbStip) pPriv->and, (FbStip) pPriv->xor,
- (FbStip) pPriv->bgand, (FbStip) pPriv->bgxor,
- bitplane);
- }
- else
- {
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
-
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- FbStip *tmp;
- FbStride tmpStride;
- int width, height;
-
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT);
- tmp = xalloc (tmpStride * height * sizeof (FbStip));
- if (!tmp)
- return;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- fbBltPlane (src + (pbox->y1+ dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
- srcBpp,
-
- tmp,
- tmpStride,
- 0,
-
- width * srcBpp,
- height,
-
- fbAndStip(GXcopy,FB_ALLONES,FB_ALLONES),
- fbXorStip(GXcopy,FB_ALLONES,FB_ALLONES),
- fbAndStip(GXcopy,0,FB_ALLONES),
- fbXorStip(GXcopy,0,FB_ALLONES),
- bitplane);
- fbBltOne (tmp,
- tmpStride,
- 0,
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- dstBpp,
-
- width * dstBpp,
- height,
-
- pPriv->and, pPriv->xor,
- pPriv->bgand, pPriv->bgxor);
- xfree (tmp);
- }
- pbox++;
- }
-}
-
-void
-fbCopyRegion (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- RegionPtr pDstRegion,
- int dx,
- int dy,
- fbCopyProc copyProc,
- Pixel bitPlane,
- void *closure)
-{
- int careful;
- Bool reverse;
- Bool upsidedown;
- BoxPtr pbox;
- int nbox;
- BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp;
-
- pbox = REGION_RECTS(pDstRegion);
- nbox = REGION_NUM_RECTS(pDstRegion);
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrcDrawable == pDstDrawable) ||
- ((pSrcDrawable->type == DRAWABLE_WINDOW) &&
- (pDstDrawable->type == DRAWABLE_WINDOW)));
-
- pboxNew1 = NULL;
- pboxNew2 = NULL;
- if (careful && dy < 0)
- {
- upsidedown = TRUE;
-
- if (nbox > 1)
- {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox)
- {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- while (pboxTmp <= pboxBase)
- {
- *pboxNew1++ = *pboxTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- }
- }
- else
- {
- /* walk source top to bottom */
- upsidedown = FALSE;
- }
-
- if (careful && dx < 0)
- {
- /* walk source right to left */
- if (dy <= 0)
- reverse = TRUE;
- else
- reverse = FALSE;
-
- if (nbox > 1)
- {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew2)
- {
- if (pboxNew1)
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- while (pboxTmp != pboxBase)
- {
- *pboxNew2++ = *--pboxTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- }
- }
- else
- {
- /* walk source left to right */
- reverse = FALSE;
- }
-
- (*copyProc) (pSrcDrawable,
- pDstDrawable,
- pGC,
- pbox,
- nbox,
- dx, dy,
- reverse, upsidedown, bitPlane, closure);
-
- if (pboxNew1)
- DEALLOCATE_LOCAL (pboxNew1);
- if (pboxNew2)
- DEALLOCATE_LOCAL (pboxNew2);
-}
-
-RegionPtr
-fbDoCopy (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut,
- fbCopyProc copyProc,
- Pixel bitPlane,
- void *closure)
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
- RegionPtr prgnExposed = NULL;
- RegionRec rgnDst;
- int dx;
- int dy;
- int numRects;
- BoxRec box;
- Bool fastSrc = FALSE; /* for fast clipping with pixmap source */
- Bool fastDst = FALSE; /* for fast clipping with one rect dest */
- Bool fastExpose = FALSE; /* for fast exposures with pixmap source */
-
- /* Short cut for unmapped windows */
-
- if (pDstDrawable->type == DRAWABLE_WINDOW &&
- !((WindowPtr)pDstDrawable)->realized)
- {
- return NULL;
- }
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc);
- }
-
- /* Compute source clip region */
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = fbGetCompositeClip(pGC);
- else
- fastSrc = TRUE;
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- /*
- * XFree86 DDX empties the border clip when the
- * VT is inactive, make sure the region isn't empty
- */
- if (!((WindowPtr) pSrcDrawable)->parent &&
- REGION_NOTEMPTY (pSrcDrawable->pScreen,
- &((WindowPtr) pSrcDrawable)->borderClip))
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastSrc = TRUE;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = fbGetCompositeClip(pGC);
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- xIn += pSrcDrawable->x;
- yIn += pSrcDrawable->y;
-
- xOut += pDstDrawable->x;
- yOut += pDstDrawable->y;
-
- box.x1 = xIn;
- box.y1 = yIn;
- box.x2 = xIn + widthSrc;
- box.y2 = yIn + heightSrc;
-
- dx = xIn - xOut;
- dy = yIn - yOut;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastSrc)
- {
- RegionPtr cclip;
-
- fastExpose = TRUE;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (box.x1 < pSrcDrawable->x)
- {
- box.x1 = pSrcDrawable->x;
- fastExpose = FALSE;
- }
- if (box.y1 < pSrcDrawable->y)
- {
- box.y1 = pSrcDrawable->y;
- fastExpose = FALSE;
- }
- if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = FALSE;
- }
- if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = FALSE;
- }
-
- /* Translate and clip the dst to the destination composite clip */
- box.x1 -= dx;
- box.x2 -= dx;
- box.y1 -= dy;
- box.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
-
- cclip = fbGetCompositeClip(pGC);
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (box.x1 < pBox->x1) box.x1 = pBox->x1;
- if (box.x2 > pBox->x2) box.x2 = pBox->x2;
- if (box.y1 < pBox->y1) box.y1 = pBox->y1;
- if (box.y2 > pBox->y2) box.y2 = pBox->y2;
- fastDst = TRUE;
- }
- }
-
- /* Check to see if the region is empty */
- if (box.x1 >= box.x2 || box.y1 >= box.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &box, 1);
- }
-
- /* Clip against complex source if needed */
- if (!fastSrc)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- /* Clip against complex dest if needed */
- if (!fastDst)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
- fbGetCompositeClip(pGC));
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && widthSrc && heightSrc)
- fbCopyRegion (pSrcDrawable, pDstDrawable, pGC,
- &rgnDst, dx, dy, copyProc, bitPlane, closure);
-
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose && pGC->fExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- xIn - pSrcDrawable->x,
- yIn - pSrcDrawable->y,
- widthSrc, heightSrc,
- xOut - pDstDrawable->x,
- yOut - pDstDrawable->y,
- (unsigned long) bitPlane);
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- fbValidateDrawable (pDstDrawable);
- return prgnExposed;
-}
-
-RegionPtr
-fbCopyArea (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut)
-{
- fbCopyProc copy;
-
-#ifdef FB_24_32BIT
- if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
- copy = fb24_32CopyMtoN;
- else
-#endif
- copy = fbCopyNtoN;
- return fbDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
- widthSrc, heightSrc, xOut, yOut, copy, 0, 0);
-}
-
-RegionPtr
-fbCopyPlane (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut,
- unsigned long bitplane)
-{
- if (pSrcDrawable->bitsPerPixel > 1)
- return fbDoCopy (pSrcDrawable, pDstDrawable, pGC,
- xIn, yIn, widthSrc, heightSrc,
- xOut, yOut, fbCopyNto1, (Pixel) bitplane, 0);
- else if (bitplane & 1)
- return fbDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
- widthSrc, heightSrc, xOut, yOut, fbCopy1toN,
- (Pixel) bitplane, 0);
- else
- return miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- xIn, yIn,
- widthSrc,
- heightSrc,
- xOut, yOut, bitplane);
-}
diff --git a/fb/fbfill.c b/fb/fbfill.c
deleted file mode 100644
index 8ecb3cde6..000000000
--- a/fb/fbfill.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Id: fbfill.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbfill.c,v 1.6 2003/01/31 00:01:45 torrey Exp $ */
-
-#include "fb.h"
-
-void
-fbFill (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int width,
- int height)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- switch (pGC->fillStyle) {
- case FillSolid:
- fbSolid (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- dstBpp,
- width * dstBpp, height,
- pPriv->and, pPriv->xor);
- break;
- case FillStippled:
- case FillOpaqueStippled: {
- PixmapPtr pStip = pGC->stipple;
- int stipWidth = pStip->drawable.width;
- int stipHeight = pStip->drawable.height;
-
- if (dstBpp == 1)
- {
- int alu;
- FbBits *stip;
- FbStride stipStride;
- int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
-
- if (pGC->fillStyle == FillStippled)
- alu = FbStipple1Rop(pGC->alu,pGC->fgPixel);
- else
- alu = FbOpaqueStipple1Rop(pGC->alu,pGC->fgPixel,pGC->bgPixel);
- fbGetDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
- fbTile (dst + (y + dstYoff) * dstStride,
- dstStride,
- x + dstXoff,
- width, height,
- stip,
- stipStride,
- stipWidth,
- stipHeight,
- alu,
- pPriv->pm,
- dstBpp,
-
- (pGC->patOrg.x + pDrawable->x + dstXoff),
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- }
- else
- {
- FbStip *stip;
- FbStride stipStride;
- int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
- FbBits fgand, fgxor, bgand, bgxor;
-
- fgand = pPriv->and;
- fgxor = pPriv->xor;
- if (pGC->fillStyle == FillStippled)
- {
- bgand = fbAnd(GXnoop,(FbBits) 0,FB_ALLONES);
- bgxor = fbXor(GXnoop,(FbBits) 0,FB_ALLONES);
- }
- else
- {
- bgand = pPriv->bgand;
- bgxor = pPriv->bgxor;
- }
-
- fbGetStipDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
- fbStipple (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- dstBpp,
- width * dstBpp, height,
- stip,
- stipStride,
- stipWidth,
- stipHeight,
- pPriv->evenStipple,
- fgand, fgxor,
- bgand, bgxor,
- pGC->patOrg.x + pDrawable->x + dstXoff,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- }
- break;
- }
- case FillTiled: {
- PixmapPtr pTile = pGC->tile.pixmap;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileWidth;
- int tileHeight;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
-
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- fbTile (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- width * dstBpp, height,
- tile,
- tileStride,
- tileWidth * tileBpp,
- tileHeight,
- pGC->alu,
- pPriv->pm,
- dstBpp,
- (pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- break;
- }
- }
- fbValidateDrawable (pDrawable);
-}
-
-void
-fbSolidBoxClipped (DrawablePtr pDrawable,
- RegionPtr pClip,
- int x1,
- int y1,
- int x2,
- int y2,
- FbBits and,
- FbBits xor)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- BoxPtr pbox;
- int nbox;
- int partX1, partX2, partY1, partY2;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- partX1 = pbox->x1;
- if (partX1 < x1)
- partX1 = x1;
-
- partX2 = pbox->x2;
- if (partX2 > x2)
- partX2 = x2;
-
- if (partX2 <= partX1)
- continue;
-
- partY1 = pbox->y1;
- if (partY1 < y1)
- partY1 = y1;
-
- partY2 = pbox->y2;
- if (partY2 > y2)
- partY2 = y2;
-
- if (partY2 <= partY1)
- continue;
-
- fbSolid (dst + (partY1 + dstYoff) * dstStride,
- dstStride,
- (partX1 + dstXoff) * dstBpp,
- dstBpp,
-
- (partX2 - partX1) * dstBpp,
- (partY2 - partY1),
- and, xor);
- }
-}
diff --git a/fb/fbfillrect.c b/fb/fbfillrect.c
deleted file mode 100644
index d0468e041..000000000
--- a/fb/fbfillrect.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Id: fbfillrect.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbfillrect.c,v 1.2 2000/02/23 20:29:43 dawes Exp $ */
-
-#include "fb.h"
-
-void
-fbPolyFillRect(DrawablePtr pDrawable,
- GCPtr pGC,
- int nrect,
- xRectangle *prect)
-{
- RegionPtr pClip = fbGetCompositeClip(pGC);
- register BoxPtr pbox;
- BoxPtr pextent;
- int extentX1, extentX2, extentY1, extentY2;
- int fullX1, fullX2, fullY1, fullY2;
- int partX1, partX2, partY1, partY2;
- int xorg, yorg;
- int n;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
- extentX1 = pextent->x1;
- extentY1 = pextent->y1;
- extentX2 = pextent->x2;
- extentY2 = pextent->y2;
- while (nrect--)
- {
- fullX1 = prect->x + xorg;
- fullY1 = prect->y + yorg;
- fullX2 = fullX1 + (int) prect->width;
- fullY2 = fullY1 + (int) prect->height;
- prect++;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
-
- if (fullY1 < extentY1)
- fullY1 = extentY1;
-
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullY2 > extentY2)
- fullY2 = extentY2;
-
- if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
- continue;
- n = REGION_NUM_RECTS (pClip);
- if (n == 1)
- {
- fbFill (pDrawable,
- pGC,
- fullX1, fullY1, fullX2-fullX1, fullY2-fullY1);
- }
- else
- {
- pbox = REGION_RECTS(pClip);
- /*
- * clip the rectangle to each box in the clip region
- * this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- partX1 = pbox->x1;
- if (partX1 < fullX1)
- partX1 = fullX1;
- partY1 = pbox->y1;
- if (partY1 < fullY1)
- partY1 = fullY1;
- partX2 = pbox->x2;
- if (partX2 > fullX2)
- partX2 = fullX2;
- partY2 = pbox->y2;
- if (partY2 > fullY2)
- partY2 = fullY2;
-
- pbox++;
-
- if (partX1 < partX2 && partY1 < partY2)
- fbFill (pDrawable, pGC,
- partX1, partY1,
- partX2 - partX1, partY2 - partY1);
- }
- }
- }
-}
diff --git a/fb/fbfillsp.c b/fb/fbfillsp.c
deleted file mode 100644
index 29c3a36b0..000000000
--- a/fb/fbfillsp.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Id: fbfillsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbfillsp.c,v 1.2 2000/02/23 20:29:43 dawes Exp $ */
-
-#include "fb.h"
-
-void
-fbFillSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted)
-{
- RegionPtr pClip = fbGetCompositeClip(pGC);
- BoxPtr pextent, pbox;
- int nbox;
- int extentX1, extentX2, extentY1, extentY2;
- int fullX1, fullX2, fullY1;
- int partX1, partX2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
- extentX1 = pextent->x1;
- extentY1 = pextent->y1;
- extentX2 = pextent->x2;
- extentY2 = pextent->y2;
- while (n--)
- {
- fullX1 = ppt->x;
- fullY1 = ppt->y;
- fullX2 = fullX1 + (int) *pwidth;
- ppt++;
- pwidth++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
-
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- nbox = REGION_NUM_RECTS (pClip);
- if (nbox == 1)
- {
- fbFill (pDrawable,
- pGC,
- fullX1, fullY1, fullX2-fullX1, 1);
- }
- else
- {
- pbox = REGION_RECTS(pClip);
- while(nbox--)
- {
- if (pbox->y1 <= fullY1 && fullY1 < pbox->y2)
- {
- partX1 = pbox->x1;
- if (partX1 < fullX1)
- partX1 = fullX1;
- partX2 = pbox->x2;
- if (partX2 > fullX2)
- partX2 = fullX2;
- if (partX2 > partX1)
- {
- fbFill (pDrawable, pGC,
- partX1, fullY1,
- partX2 - partX1, 1);
- }
- }
- pbox++;
- }
- }
- }
-}
diff --git a/fb/fbgc.c b/fb/fbgc.c
deleted file mode 100644
index 28c58a673..000000000
--- a/fb/fbgc.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Id: fbgc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.12 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#endif
-
-const GCFuncs fbGCFuncs = {
- fbValidateGC,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-
-const GCOps fbGCOps = {
- fbFillSpans,
- fbSetSpans,
- fbPutImage,
- fbCopyArea,
- fbCopyPlane,
- fbPolyPoint,
- fbPolyLine,
- fbPolySegment,
- fbPolyRectangle,
- fbPolyArc,
- miFillPolygon,
- fbPolyFillRect,
- fbPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- fbImageGlyphBlt,
- fbPolyGlyphBlt,
- fbPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-Bool
-fbCreateGC(GCPtr pGC)
-{
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- pGC->ops = (GCOps *) &fbGCOps;
- pGC->funcs = (GCFuncs *) &fbGCFuncs;
-
- /* fb wants to translate before scan conversion */
- pGC->miTranslate = 1;
-
- fbGetRotatedPixmap(pGC) = 0;
- fbGetExpose(pGC) = 1;
- fbGetFreeCompClip(pGC) = 0;
- fbGetCompositeClip(pGC) = 0;
- fbGetGCPrivate(pGC)->bpp = BitsPerPixel (pGC->depth);
- return TRUE;
-}
-
-/*
- * Pad pixmap to FB_UNIT bits wide
- */
-void
-fbPadPixmap (PixmapPtr pPixmap)
-{
- int width;
- FbBits *bits;
- FbBits b;
- FbBits mask;
- int height;
- int w;
-
- width = pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel;
- bits = pPixmap->devPrivate.ptr;
- height = pPixmap->drawable.height;
- mask = FbBitsMask (0, width);
- while (height--)
- {
- b = *bits & mask;
- w = width;
- while (w < FB_UNIT)
- {
- b = b | FbScrRight(b, w);
- w <<= 1;
- }
- *bits++ = b;
- }
-}
-
-/*
- * Verify that 'bits' repeats every 'len' bits
- */
-static Bool
-fbBitsRepeat (FbBits bits, int len, int width)
-{
- FbBits mask = FbBitsMask(0, len);
- FbBits orig = bits & mask;
- int i;
-
- if (width > FB_UNIT)
- width = FB_UNIT;
- for (i = 0; i < width / len; i++)
- {
- if ((bits & mask) != orig)
- return FALSE;
- bits = FbScrLeft(bits,len);
- }
- return TRUE;
-}
-
-/*
- * Check whether an entire bitmap line is a repetition of
- * the first 'len' bits
- */
-static Bool
-fbLineRepeat (FbBits *bits, int len, int width)
-{
- FbBits first = bits[0];
-
- if (!fbBitsRepeat (first, len, width))
- return FALSE;
- width = (width + FB_UNIT-1) >> FB_SHIFT;
- bits++;
- while (--width)
- if (*bits != first)
- return FALSE;
- return TRUE;
-}
-
-/*
- * The even stipple code wants the first FB_UNIT/bpp bits on
- * each scanline to represent the entire stipple
- */
-static Bool
-fbCanEvenStipple (PixmapPtr pStipple, int bpp)
-{
- int len = FB_UNIT / bpp;
- FbBits *bits;
- int stride;
- int stip_bpp;
- int stipXoff, stipYoff;
- int h;
-
- /* can't even stipple 24bpp drawables */
- if ((bpp & (bpp-1)) != 0)
- return FALSE;
- /* make sure the stipple width is a multiple of the even stipple width */
- if (pStipple->drawable.width % len != 0)
- return FALSE;
- fbGetDrawable (&pStipple->drawable, bits, stride, stip_bpp, stipXoff, stipYoff);
- h = pStipple->drawable.height;
- /* check to see that the stipple repeats horizontally */
- while (h--)
- {
- if (!fbLineRepeat (bits, len, pStipple->drawable.width))
- return FALSE;
- bits += stride;
- }
- return TRUE;
-}
-
-void
-fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- FbBits mask;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
-
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- miComputeCompositeClip (pGC, pDrawable);
- pPriv->oneRect = REGION_NUM_RECTS(fbGetCompositeClip(pGC)) == 1;
- }
-
-#ifdef FB_24_32BIT
- if (pPriv->bpp != pDrawable->bitsPerPixel)
- {
- changes |= GCStipple|GCForeground|GCBackground|GCPlaneMask;
- pPriv->bpp = pDrawable->bitsPerPixel;
- }
- if ((changes & GCTile) && fbGetRotatedPixmap(pGC))
- {
- (*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC));
- fbGetRotatedPixmap(pGC) = 0;
- }
-
- if (pGC->fillStyle == FillTiled)
- {
- PixmapPtr pOldTile, pNewTile;
-
- pOldTile = pGC->tile.pixmap;
- if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel)
- {
- pNewTile = fbGetRotatedPixmap(pGC);
- if (!pNewTile || pNewTile ->drawable.bitsPerPixel != pDrawable->bitsPerPixel)
- {
- if (pNewTile)
- (*pGC->pScreen->DestroyPixmap) (pNewTile);
- pNewTile = fb24_32ReformatTile (pOldTile, pDrawable->bitsPerPixel);
- }
- if (pNewTile)
- {
- fbGetRotatedPixmap(pGC) = pOldTile;
- pGC->tile.pixmap = pNewTile;
- changes |= GCTile;
- }
- }
- }
-#endif
- if (changes & GCTile)
- {
- if (!pGC->tileIsPixel &&
- FbEvenTile (pGC->tile.pixmap->drawable.width *
- pDrawable->bitsPerPixel))
- fbPadPixmap (pGC->tile.pixmap);
- }
- if (changes & GCStipple)
- {
- if (pGC->stipple &&
- (FbEvenStip (pGC->stipple->drawable.width,
- pDrawable->bitsPerPixel) ||
- fbCanEvenStipple (pGC->stipple, pDrawable->bitsPerPixel)))
- {
- pPriv->evenStipple = TRUE;
- if (pGC->stipple->drawable.width * pDrawable->bitsPerPixel < FB_UNIT)
- fbPadPixmap (pGC->stipple);
- }
- else
- pPriv->evenStipple = FALSE;
- }
- /*
- * Recompute reduced rop values
- */
- if (changes & (GCForeground|GCBackground|GCPlaneMask|GCFunction))
- {
- int s;
- FbBits depthMask;
-
- mask = FbFullMask(pDrawable->bitsPerPixel);
- depthMask = FbFullMask(pDrawable->depth);
-
- pPriv->fg = pGC->fgPixel & mask;
- pPriv->bg = pGC->bgPixel & mask;
-
- if ((pGC->planemask & depthMask) == depthMask)
- pPriv->pm = mask;
- else
- pPriv->pm = pGC->planemask & mask;
-
- s = pDrawable->bitsPerPixel;
- while (s < FB_UNIT)
- {
- pPriv->fg |= pPriv->fg << s;
- pPriv->bg |= pPriv->bg << s;
- pPriv->pm |= pPriv->pm << s;
- s <<= 1;
- }
- pPriv->and = fbAnd(pGC->alu, pPriv->fg, pPriv->pm);
- pPriv->xor = fbXor(pGC->alu, pPriv->fg, pPriv->pm);
- pPriv->bgand = fbAnd(pGC->alu, pPriv->bg, pPriv->pm);
- pPriv->bgxor = fbXor(pGC->alu, pPriv->bg, pPriv->pm);
- }
- if (changes & GCDashList)
- {
- unsigned short n = pGC->numInDashList;
- unsigned char *dash = pGC->dash;
- unsigned int dashLength = 0;
-
- while (n--)
- dashLength += (unsigned int ) *dash++;
- pPriv->dashLength = dashLength;
- }
-}
diff --git a/fb/fbgetsp.c b/fb/fbgetsp.c
deleted file mode 100644
index db35f6d5c..000000000
--- a/fb/fbgetsp.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Id: fbgetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbgetsp.c,v 1.6 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-
-void
-fbGetSpans(DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart)
-{
- FbBits *src, *dst;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- int xoff;
-
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!fbDrawableEnabled(pDrawable))
- return;
-
-#ifdef FB_24_32BIT
- if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
- {
- fb24_32GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pchardstStart);
- return;
- }
-#endif
-
- fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
-
- while (nspans--)
- {
- xoff = (int) (((long) pchardstStart) & (FB_MASK >> 3));
- dst = (FbBits *) (pchardstStart - xoff);
- xoff <<= 3;
- fbBlt (src + (ppt->y + srcYoff) * srcStride, srcStride,
- (ppt->x + srcXoff) * srcBpp,
-
- dst,
- 1,
- xoff,
-
- *pwidth * srcBpp,
- 1,
-
- GXcopy,
- FB_ALLONES,
- srcBpp,
-
- FALSE,
- FALSE);
- pchardstStart += PixmapBytePad(*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
-}
diff --git a/fb/fbglyph.c b/fb/fbglyph.c
deleted file mode 100644
index f8f2179d5..000000000
--- a/fb/fbglyph.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.12 2001/09/07 15:16:00 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "fb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-
-Bool
-fbGlyphIn (RegionPtr pRegion,
- int x,
- int y,
- int width,
- int height)
-{
- BoxRec box;
- BoxPtr pExtents = REGION_EXTENTS (0, pRegion);
-
- /*
- * Check extents by hand to avoid 16 bit overflows
- */
- if (x < (int) pExtents->x1)
- return FALSE;
- if ((int) pExtents->x2 < x + width)
- return FALSE;
- if (y < (int) pExtents->y1)
- return FALSE;
- if ((int) pExtents->y2 < y + height)
- return FALSE;
- box.x1 = x;
- box.x2 = x + width;
- box.y1 = y;
- box.y2 = y + height;
- return RECT_IN_REGION (0, pRegion, &box) == rgnIN;
-}
-
-#ifdef FB_24BIT
-#ifndef FBNOPIXADDR
-
-#define WRITE1(d,n,fg) ((d)[n] = (CARD8) fg)
-#define WRITE2(d,n,fg) (*(CARD16 *) &(d[n]) = (CARD16) fg)
-#define WRITE4(d,n,fg) (*(CARD32 *) &(d[n]) = (CARD32) fg)
-#if FB_UNIT == 6 && IMAGE_BYTE_ORDER == LSBFirst
-#define WRITE8(d) (*(FbBits *) &(d[0]) = fg)
-#else
-#define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB)
-#endif
-
-/*
- * This is a bit tricky, but it's brief. Write 12 bytes worth
- * of dest, which is four pixels, at a time. This gives constant
- * code for each pattern as they're always aligned the same
- *
- * a b c d a b c d a b c d bytes
- * A B C A B C A B C A B C pixels
- *
- * f0 f1 f2
- * A B C A B C A B C A B C pixels LSB
- * C A B C A B C A B C A B pixels MSB
- *
- * LSB MSB
- * A f0 f1
- * B f1 f2
- * C f2 f0
- * A B f0 f2
- * B C f1 f0
- * C A f2 f1
- * A B C A f0 f1
- * B C A B f1 f2
- * C A B C f2 f0
- */
-
-#undef _A
-#undef _B
-#undef _C
-#undef _AB
-#undef _BC
-#undef _CA
-#undef _ABCA
-#undef _BCAB
-#undef _CABC
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define _A f1
-#define _B f2
-#define _C f0
-#define _AB f2
-#define _BC f0
-#define _CA f1
-#define _ABCA f1
-#define _BCAB f2
-#define _CABC f0
-#define CASE(a,b,c,d) ((a << 3) | (b << 2) | (c << 1) | d)
-#else
-#define _A f0
-#define _B f1
-#define _C f2
-#define _AB f0
-#define _BC f1
-#define _CA f2
-#define _ABCA f0
-#define _BCAB f1
-#define _CABC f2
-#define CASE(a,b,c,d) (a | (b << 1) | (c << 2) | (d << 3))
-#endif
-
-void
-fbGlyph24 (FbBits *dstBits,
- FbStride dstStride,
- int dstBpp,
- FbStip *stipple,
- FbBits fg,
- int x,
- int height)
-{
- int lshift;
- FbStip bits;
- CARD8 *dstLine;
- CARD8 *dst;
- FbStip f0, f1, f2;
- int n;
- int shift;
-
- f0 = fg;
- f1 = FbRot24(f0,16);
- f2 = FbRot24(f0,8);
-
- dstLine = (CARD8 *) dstBits;
- dstLine += (x & ~3) * 3;
- dstStride *= (sizeof (FbBits) / sizeof (CARD8));
- shift = x & 3;
- lshift = 4 - shift;
- while (height--)
- {
- bits = *stipple++;
- n = lshift;
- dst = dstLine;
- while (bits)
- {
- switch (FbStipMoveLsb (FbLeftStipBits (bits, n), 4, n)) {
- case CASE(0,0,0,0):
- break;
- case CASE(1,0,0,0):
- WRITE2(dst,0,_AB);
- WRITE1(dst,2,_C);
- break;
- case CASE(0,1,0,0):
- WRITE1(dst,3,_A);
- WRITE2(dst,4,_BC);
- break;
- case CASE(1,1,0,0):
- WRITE4(dst,0,_ABCA);
- WRITE2(dst,4,_BC);
- break;
- case CASE(0,0,1,0):
- WRITE2(dst,6,_AB);
- WRITE1(dst,8,_C);
- break;
- case CASE(1,0,1,0):
- WRITE2(dst,0,_AB);
- WRITE1(dst,2,_C);
-
- WRITE2(dst,6,_AB);
- WRITE1(dst,8,_C);
- break;
- case CASE(0,1,1,0):
- WRITE1(dst,3,_A);
- WRITE4(dst,4,_BCAB);
- WRITE1(dst,8,_C);
- break;
- case CASE(1,1,1,0):
- WRITE8(dst);
- WRITE1(dst,8,_C);
- break;
- case CASE(0,0,0,1):
- WRITE1(dst,9,_A);
- WRITE2(dst,10,_BC);
- break;
- case CASE(1,0,0,1):
- WRITE2(dst,0,_AB);
- WRITE1(dst,2,_C);
-
- WRITE1(dst,9,_A);
- WRITE2(dst,10,_BC);
- break;
- case CASE(0,1,0,1):
- WRITE1(dst,3,_A);
- WRITE2(dst,4,_BC);
-
- WRITE1(dst,9,_A);
- WRITE2(dst,10,_BC);
- break;
- case CASE(1,1,0,1):
- WRITE4(dst,0,_ABCA);
- WRITE2(dst,4,_BC);
-
- WRITE1(dst,9,_A);
- WRITE2(dst,10,_BC);
- break;
- case CASE(0,0,1,1):
- WRITE2(dst,6,_AB);
- WRITE4(dst,8,_CABC);
- break;
- case CASE(1,0,1,1):
- WRITE2(dst,0,_AB);
- WRITE1(dst,2,_C);
-
- WRITE2(dst,6,_AB);
- WRITE4(dst,8,_CABC);
- break;
- case CASE(0,1,1,1):
- WRITE1(dst,3,_A);
- WRITE4(dst,4,_BCAB);
- WRITE4(dst,8,_CABC);
- break;
- case CASE(1,1,1,1):
- WRITE8(dst);
- WRITE4(dst,8,_CABC);
- break;
- }
- bits = FbStipLeft (bits, n);
- n = 4;
- dst += 12;
- }
- dstLine += dstStride;
- }
-}
-#endif
-#endif
-
-void
-fbPolyGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- CharInfoPtr pci;
- unsigned char *pglyph; /* pointer bits in glyph */
- int gx, gy;
- int gWidth, gHeight; /* width and height of glyph */
- FbStride gStride; /* stride of glyph */
-#ifndef FBNOPIXADDR
- void (*glyph) (FbBits *,
- FbStride,
- int,
- FbStip *,
- FbBits,
- int,
- int);
- FbBits *dst = 0;
- FbStride dstStride = 0;
- int dstBpp = 0;
- int dstXoff = 0, dstYoff = 0;
-
- glyph = 0;
- if (pGC->fillStyle == FillSolid && pPriv->and == 0)
- {
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- switch (dstBpp) {
- case 8: glyph = fbGlyph8; break;
- case 16: glyph = fbGlyph16; break;
-#ifdef FB_24BIT
- case 24: glyph = fbGlyph24; break;
-#endif
- case 32: glyph = fbGlyph32; break;
- }
- }
-#endif
- x += pDrawable->x;
- y += pDrawable->y;
-
- while (nglyph--)
- {
- pci = *ppci++;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- gWidth = GLYPHWIDTHPIXELS(pci);
- gHeight = GLYPHHEIGHTPIXELS(pci);
- if (gWidth && gHeight)
- {
- gx = x + pci->metrics.leftSideBearing;
- gy = y - pci->metrics.ascent;
-#ifndef FBNOPIXADDR
- if (glyph && gWidth <= sizeof (FbStip) * 8 &&
- fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
- {
- (*glyph) (dst + (gy + dstYoff) * dstStride,
- dstStride,
- dstBpp,
- (FbStip *) pglyph,
- pPriv->xor,
- gx + dstXoff,
- gHeight);
- }
- else
-#endif
- {
- gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
- fbPushImage (pDrawable,
- pGC,
-
- (FbStip *) pglyph,
- gStride,
- 0,
-
- gx,
- gy,
- gWidth, gHeight);
- }
- }
- x += pci->metrics.characterWidth;
- }
-}
-
-
-void
-fbImageGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppciInit,
- pointer pglyphBase)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- CharInfoPtr *ppci;
- CharInfoPtr pci;
- unsigned char *pglyph; /* pointer bits in glyph */
- int gWidth, gHeight; /* width and height of glyph */
- FbStride gStride; /* stride of glyph */
- Bool opaque;
- int n;
- int gx, gy;
-#ifndef FBNOPIXADDR
- void (*glyph) (FbBits *,
- FbStride,
- int,
- FbStip *,
- FbBits,
- int,
- int);
- FbBits *dst = 0;
- FbStride dstStride = 0;
- int dstBpp = 0;
- int dstXoff = 0, dstYoff = 0;
-
- glyph = 0;
- if (pPriv->and == 0)
- {
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- switch (dstBpp) {
- case 8: glyph = fbGlyph8; break;
- case 16: glyph = fbGlyph16; break;
-#ifdef FB_24BIT
- case 24: glyph = fbGlyph24; break;
-#endif
- case 32: glyph = fbGlyph32; break;
- }
- }
-#endif
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- if (TERMINALFONT (pGC->font)
-#ifndef FBNOPIXADDR
- && !glyph
-#endif
- )
- {
- opaque = TRUE;
- }
- else
- {
- int xBack, widthBack;
- int yBack, heightBack;
-
- ppci = ppciInit;
- n = nglyph;
- widthBack = 0;
- while (n--)
- widthBack += (*ppci++)->metrics.characterWidth;
-
- xBack = x;
- if (widthBack < 0)
- {
- xBack += widthBack;
- widthBack = -widthBack;
- }
- yBack = y - FONTASCENT(pGC->font);
- heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
- fbSolidBoxClipped (pDrawable,
- fbGetCompositeClip(pGC),
- xBack,
- yBack,
- xBack + widthBack,
- yBack + heightBack,
- fbAnd(GXcopy,pPriv->bg,pPriv->pm),
- fbXor(GXcopy,pPriv->bg,pPriv->pm));
- opaque = FALSE;
- }
-
- ppci = ppciInit;
- while (nglyph--)
- {
- pci = *ppci++;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- gWidth = GLYPHWIDTHPIXELS(pci);
- gHeight = GLYPHHEIGHTPIXELS(pci);
- if (gWidth && gHeight)
- {
- gx = x + pci->metrics.leftSideBearing;
- gy = y - pci->metrics.ascent;
-#ifndef FBNOPIXADDR
- if (glyph && gWidth <= sizeof (FbStip) * 8 &&
- fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
- {
- (*glyph) (dst + (gy + dstYoff) * dstStride,
- dstStride,
- dstBpp,
- (FbStip *) pglyph,
- pPriv->fg,
- gx + dstXoff,
- gHeight);
- }
- else
-#endif
- {
- gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
- fbPutXYImage (pDrawable,
- fbGetCompositeClip(pGC),
- pPriv->fg,
- pPriv->bg,
- pPriv->pm,
- GXcopy,
- opaque,
-
- gx,
- gy,
- gWidth, gHeight,
-
- (FbStip *) pglyph,
- gStride,
- 0);
- }
- }
- x += pci->metrics.characterWidth;
- }
-}
diff --git a/fb/fbimage.c b/fb/fbimage.c
deleted file mode 100644
index 7d0284c38..000000000
--- a/fb/fbimage.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Id: fbimage.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbimage.c,v 1.8 2001/09/07 15:15:31 keithp Exp $ */
-
-#include "fb.h"
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#endif
-
-
-void
-fbPutImage (DrawablePtr pDrawable,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- unsigned long i;
- FbStride srcStride;
- FbStip *src = (FbStip *) pImage;
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- switch (format)
- {
- case XYBitmap:
- srcStride = BitmapBytePad(w + leftPad) / sizeof (FbStip);
- fbPutXYImage (pDrawable,
- fbGetCompositeClip(pGC),
- pPriv->fg,
- pPriv->bg,
- pPriv->pm,
- pGC->alu,
- TRUE,
- x, y, w, h,
- src,
- srcStride,
- leftPad);
- break;
- case XYPixmap:
- srcStride = BitmapBytePad(w + leftPad) / sizeof (FbStip);
- for (i = 1 << (pDrawable->depth - 1); i; i >>= 1)
- {
- if (i & pGC->planemask)
- {
- fbPutXYImage (pDrawable,
- fbGetCompositeClip(pGC),
- FB_ALLONES,
- 0,
- fbReplicatePixel (i, pDrawable->bitsPerPixel),
- pGC->alu,
- TRUE,
- x, y, w, h,
- src,
- srcStride,
- leftPad);
- src += srcStride * h;
- }
- }
- break;
- case ZPixmap:
-#ifdef FB_24_32BIT
- if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
- {
- srcStride = PixmapBytePad(w, pDrawable->depth);
- fb24_32PutZImage (pDrawable,
- fbGetCompositeClip(pGC),
- pGC->alu,
- (FbBits) pGC->planemask,
- x, y, w, h,
- (CARD8 *) pImage,
- srcStride);
- }
- else
-#endif
- {
- srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof (FbStip);
- fbPutZImage (pDrawable,
- fbGetCompositeClip(pGC),
- pGC->alu,
- pPriv->pm,
- x, y, w, h,
- src, srcStride);
- }
- }
-}
-
-void
-fbPutZImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- int alu,
- FbBits pm,
- int x,
- int y,
- int width,
- int height,
- FbStip *src,
- FbStride srcStride)
-{
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- int nbox;
- BoxPtr pbox;
- int x1, y1, x2, y2;
-
- fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- for (nbox = REGION_NUM_RECTS (pClip),
- pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- x1 = x;
- y1 = y;
- x2 = x + width;
- y2 = y + height;
- if (x1 < pbox->x1)
- x1 = pbox->x1;
- if (y1 < pbox->y1)
- y1 = pbox->y1;
- if (x2 > pbox->x2)
- x2 = pbox->x2;
- if (y2 > pbox->y2)
- y2 = pbox->y2;
- if (x1 >= x2 || y1 >= y2)
- continue;
- fbBltStip (src + (y1 - y) * srcStride,
- srcStride,
- (x1 - x) * dstBpp,
-
- dst + (y1 + dstYoff) * dstStride,
- dstStride,
- (x1 + dstXoff) * dstBpp,
-
- (x2 - x1) * dstBpp,
- (y2 - y1),
-
- alu,
- pm,
- dstBpp);
- }
-}
-
-void
-fbPutXYImage (DrawablePtr pDrawable,
- RegionPtr pClip,
- FbBits fg,
- FbBits bg,
- FbBits pm,
- int alu,
- Bool opaque,
-
- int x,
- int y,
- int width,
- int height,
-
- FbStip *src,
- FbStride srcStride,
- int srcX)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- int nbox;
- BoxPtr pbox;
- int x1, y1, x2, y2;
- FbBits fgand = 0, fgxor = 0, bgand = 0, bgxor = 0;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- if (dstBpp == 1)
- {
- if (opaque)
- alu = FbOpaqueStipple1Rop(alu,fg,bg);
- else
- alu = FbStipple1Rop(alu,fg);
- }
- else
- {
- fgand = fbAnd(alu,fg,pm);
- fgxor = fbXor(alu,fg,pm);
- if (opaque)
- {
- bgand = fbAnd(alu,bg,pm);
- bgxor = fbXor(alu,bg,pm);
- }
- else
- {
- bgand = fbAnd(GXnoop,(FbBits)0,FB_ALLONES);
- bgxor = fbXor(GXnoop,(FbBits)0,FB_ALLONES);
- }
- }
-
- for (nbox = REGION_NUM_RECTS (pClip),
- pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- x1 = x;
- y1 = y;
- x2 = x + width;
- y2 = y + height;
- if (x1 < pbox->x1)
- x1 = pbox->x1;
- if (y1 < pbox->y1)
- y1 = pbox->y1;
- if (x2 > pbox->x2)
- x2 = pbox->x2;
- if (y2 > pbox->y2)
- y2 = pbox->y2;
- if (x1 >= x2 || y1 >= y2)
- continue;
- if (dstBpp == 1)
- {
- fbBltStip (src + (y1 - y) * srcStride,
- srcStride,
- (x1 - x) + srcX,
-
- (FbStip *) (dst + (y1 + dstYoff) * dstStride),
- FbBitsStrideToStipStride(dstStride),
- (x1 + dstXoff) * dstBpp,
-
- (x2 - x1) * dstBpp,
- (y2 - y1),
-
- alu,
- pm,
- dstBpp);
- }
- else
- {
- fbBltOne (src + (y1 - y) * srcStride,
- srcStride,
- (x1 - x) + srcX,
-
- dst + (y1 + dstYoff) * dstStride,
- dstStride,
- (x1 + dstXoff) * dstBpp,
- dstBpp,
-
- (x2 - x1) * dstBpp,
- (y2 - y1),
-
- fgand, fgxor, bgand, bgxor);
- }
- }
-}
-
-void
-fbGetImage (DrawablePtr pDrawable,
- int x,
- int y,
- int w,
- int h,
- unsigned int format,
- unsigned long planeMask,
- char *d)
-{
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbStip *dst;
- FbStride dstStride;
-
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!fbDrawableEnabled(pDrawable))
- return;
-
-#ifdef FB_24_32BIT
- if (format == ZPixmap &&
- pDrawable->bitsPerPixel != BitsPerPixel (pDrawable->depth))
- {
- fb24_32GetImage (pDrawable, x, y, w, h, format, planeMask, d);
- return;
- }
-#endif
-
- fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- dst = (FbStip *) d;
- if (format == ZPixmap || srcBpp == 1)
- {
- FbBits pm;
-
- pm = fbReplicatePixel (planeMask, srcBpp);
- dstStride = PixmapBytePad(w, pDrawable->depth);
- if (pm != FB_ALLONES)
- memset (d, 0, dstStride * h);
- dstStride /= sizeof (FbStip);
- fbBltStip ((FbStip *) (src + (y + srcYoff) * srcStride),
- FbBitsStrideToStipStride(srcStride),
- (x + srcXoff) * srcBpp,
-
- dst,
- dstStride,
- 0,
-
- w * srcBpp, h,
-
- GXcopy,
- pm,
- srcBpp);
- }
- else
- {
- dstStride = BitmapBytePad(w) / sizeof (FbStip);
- fbBltPlane (src + (y + srcYoff) * srcStride,
- srcStride,
- (x + srcXoff) * srcBpp,
- srcBpp,
-
- dst,
- dstStride,
- 0,
-
- w * srcBpp, h,
-
- fbAndStip(GXcopy,FB_STIP_ALLONES,FB_STIP_ALLONES),
- fbXorStip(GXcopy,FB_STIP_ALLONES,FB_STIP_ALLONES),
- fbAndStip(GXcopy,0,FB_STIP_ALLONES),
- fbXorStip(GXcopy,0,FB_STIP_ALLONES),
- planeMask);
- }
-}
diff --git a/fb/fbline.c b/fb/fbline.c
deleted file mode 100644
index 957222492..000000000
--- a/fb/fbline.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbline.c,v 1.8 2003/11/03 05:11:00 tsi Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "fb.h"
-
-void
-fbZeroLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt)
-{
- int x1, y1, x2, y2;
- int x, y;
- int dashOffset;
-
- x = pDrawable->x;
- y = pDrawable->y;
- x1 = ppt->x;
- y1 = ppt->y;
- dashOffset = pGC->dashOffset;
- while (--npt)
- {
- ++ppt;
- x2 = ppt->x;
- y2 = ppt->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- fbSegment (pDrawable, pGC, x1 + x, y1 + y,
- x2 + x, y2 + y,
- npt == 1 && pGC->capStyle != CapNotLast,
- &dashOffset);
- x1 = x2;
- y1 = y2;
- }
-}
-
-void
-fbZeroSegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSegs)
-{
- int dashOffset;
- int x, y;
- Bool drawLast = pGC->capStyle != CapNotLast;
-
- x = pDrawable->x;
- y = pDrawable->y;
- while (nseg--)
- {
- dashOffset = pGC->dashOffset;
- fbSegment (pDrawable, pGC,
- pSegs->x1 + x, pSegs->y1 + y,
- pSegs->x2 + x, pSegs->y2 + y,
- drawLast,
- &dashOffset);
- pSegs++;
- }
-}
-
-void
-fbFixCoordModePrevious (int npt,
- DDXPointPtr ppt)
-{
- int x, y;
-
- x = ppt->x;
- y = ppt->y;
- npt--;
- while (npt--)
- {
- ppt++;
- x = (ppt->x += x);
- y = (ppt->y += y);
- }
-}
-
-void
-fbPolyLine (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt)
-{
- void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr ppt);
-
- if (pGC->lineWidth == 0)
- {
- line = fbZeroLine;
-#ifndef FBNOPIXADDR
- if (pGC->fillStyle == FillSolid &&
- pGC->lineStyle == LineSolid &&
- REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1)
- {
- switch (pDrawable->bitsPerPixel) {
- case 8: line = fbPolyline8; break;
- case 16: line = fbPolyline16; break;
-#ifdef FB_24BIT
- case 24: line = fbPolyline24; break;
-#endif
- case 32: line = fbPolyline32; break;
- }
- }
-#endif
- }
- else
- {
- if (pGC->lineStyle != LineSolid)
- line = miWideDash;
- else
- line = miWideLine;
- }
- (*line) (pDrawable, pGC, mode, npt, ppt);
-}
-
-void
-fbPolySegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pseg)
-{
- void (*seg) (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pseg);
-
- if (pGC->lineWidth == 0)
- {
- seg = fbZeroSegment;
-#ifndef FBNOPIXADDR
- if (pGC->fillStyle == FillSolid &&
- pGC->lineStyle == LineSolid &&
- REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1)
- {
- switch (pDrawable->bitsPerPixel) {
- case 8: seg = fbPolySegment8; break;
- case 16: seg = fbPolySegment16; break;
-#ifdef FB_24BIT
- case 24: seg = fbPolySegment24; break;
-#endif
- case 32: seg = fbPolySegment32; break;
- }
- }
-#endif
- }
- else
- {
- seg = miPolySegment;
- }
- (*seg) (pDrawable, pGC, nseg, pseg);
-}
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
deleted file mode 100644
index 00521eef2..000000000
--- a/fb/fboverlay.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.7 2003/11/10 18:21:47 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "fb.h"
-#include "fboverlay.h"
-
-int fbOverlayGeneration;
-int fbOverlayScreenPrivateIndex = -1;
-
-/*
- * Replace this if you want something supporting
- * multiple overlays with the same depth
- */
-Bool
-fbOverlayCreateWindow(WindowPtr pWin)
-{
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen);
- int i;
- PixmapPtr pPixmap;
-
- if (pWin->drawable.class != InputOutput)
- return TRUE;
-
-#ifdef FB_SCREEN_PRIVATE
- if (pWin->drawable.bitsPerPixel == 32)
- pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
-#endif
-
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- pPixmap = pScrPriv->layer[i].u.run.pixmap;
- if (pWin->drawable.depth == pPixmap->drawable.depth)
- {
- pWin->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap;
- /*
- * Make sure layer keys are written correctly by
- * having non-root layers set to full while the
- * root layer is set to empty. This will cause
- * all of the layers to get painted when the root
- * is mapped
- */
- if (!pWin->parent)
- {
- REGION_EMPTY (pWin->drawable.pScreen,
- &pScrPriv->layer[i].u.run.region);
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-Bool
-fbOverlayCloseScreen (int iScreen, ScreenPtr pScreen)
-{
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
- int i;
-
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- (*pScreen->DestroyPixmap)(pScrPriv->layer[i].u.run.pixmap);
- REGION_UNINIT (pScreen, &pScrPriv->layer[i].u.run.region);
- }
- return TRUE;
-}
-
-/*
- * Return layer containing this window
- */
-int
-fbOverlayWindowLayer(WindowPtr pWin)
-{
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen);
- int i;
-
- for (i = 0; i < pScrPriv->nlayers; i++)
- if (pWin->devPrivates[fbWinPrivateIndex].ptr ==
- (pointer) pScrPriv->layer[i].u.run.pixmap)
- return i;
- return 0;
-}
-
-Bool
-fbOverlayCreateScreenResources(ScreenPtr pScreen)
-{
- int i;
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
- PixmapPtr pPixmap;
- pointer pbits;
- int width;
- int depth;
- BoxRec box;
-
- if (!miCreateScreenResources(pScreen))
- return FALSE;
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- pbits = pScrPriv->layer[i].u.init.pbits;
- width = pScrPriv->layer[i].u.init.width;
- depth = pScrPriv->layer[i].u.init.depth;
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
- if (!pPixmap)
- return FALSE;
- if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
- pScreen->height, depth,
- BitsPerPixel(depth),
- PixmapBytePad(width, depth),
- pbits))
- return FALSE;
- pScrPriv->layer[i].u.run.pixmap = pPixmap;
- REGION_INIT(pScreen, &pScrPriv->layer[i].u.run.region, &box, 0);
- }
- pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap;
- return TRUE;
-}
-
-void
-fbOverlayPaintKey (DrawablePtr pDrawable,
- RegionPtr pRegion,
- CARD32 pixel,
- int layer)
-{
- fbFillRegionSolid (pDrawable, pRegion, 0,
- fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
-}
-
-/*
- * Track visible region for each layer
- */
-void
-fbOverlayUpdateLayerRegion (ScreenPtr pScreen,
- int layer,
- RegionPtr prgn)
-{
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
- int i;
- RegionRec rgnNew;
-
- if (!prgn || !REGION_NOTEMPTY(pScreen, prgn))
- return;
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- if (i == layer)
- {
- /* add new piece to this fb */
- REGION_UNION (pScreen,
- &pScrPriv->layer[i].u.run.region,
- &pScrPriv->layer[i].u.run.region,
- prgn);
- }
- else if (REGION_NOTEMPTY (pScreen,
- &pScrPriv->layer[i].u.run.region))
- {
- /* paint new piece with chroma key */
- REGION_NULL (pScreen, &rgnNew);
- REGION_INTERSECT (pScreen,
- &rgnNew,
- prgn,
- &pScrPriv->layer[i].u.run.region);
- (*pScrPriv->PaintKey) (&pScrPriv->layer[i].u.run.pixmap->drawable,
- &rgnNew,
- pScrPriv->layer[i].key,
- i);
- REGION_UNINIT(pScreen, &rgnNew);
- /* remove piece from other fbs */
- REGION_SUBTRACT (pScreen,
- &pScrPriv->layer[i].u.run.region,
- &pScrPriv->layer[i].u.run.region,
- prgn);
- }
- }
-}
-
-/*
- * Copy only areas in each layer containing real bits
- */
-void
-fbOverlayCopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pWin->drawable.pScreen);
- RegionRec rgnDst;
- int dx, dy;
- int i;
- RegionRec layerRgn[FB_OVERLAY_MAX];
- PixmapPtr pPixmap;
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
-
- /*
- * Clip to existing bits
- */
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_NULL (pScreen, &rgnDst);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
- REGION_TRANSLATE(pScreen, &rgnDst, dx, dy);
- /*
- * Compute the portion of each fb affected by this copy
- */
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- REGION_NULL (pScreen, &layerRgn[i]);
- REGION_INTERSECT(pScreen, &layerRgn[i], &rgnDst,
- &pScrPriv->layer[i].u.run.region);
- if (REGION_NOTEMPTY (pScreen, &layerRgn[i]))
- {
- REGION_TRANSLATE(pScreen, &layerRgn[i], -dx, -dy);
- pPixmap = pScrPriv->layer[i].u.run.pixmap;
- fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
- 0,
- &layerRgn[i], dx, dy, pScrPriv->CopyWindow, 0,
- (void *)(long) i);
- }
- }
- /*
- * Update regions
- */
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- if (REGION_NOTEMPTY (pScreen, &layerRgn[i]))
- fbOverlayUpdateLayerRegion (pScreen, i, &layerRgn[i]);
-
- REGION_UNINIT(pScreen, &layerRgn[i]);
- }
- REGION_UNINIT(pScreen, &rgnDst);
-}
-
-void
-fbOverlayWindowExposures (WindowPtr pWin,
- RegionPtr prgn,
- RegionPtr other_exposed)
-{
- fbOverlayUpdateLayerRegion (pWin->drawable.pScreen,
- fbOverlayWindowLayer (pWin),
- prgn);
- miWindowExposures(pWin, prgn, other_exposed);
-}
-
-void
-fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- if (what == PW_BORDER)
- fbOverlayUpdateLayerRegion (pWin->drawable.pScreen,
- fbOverlayWindowLayer (pWin),
- pRegion);
- fbPaintWindow (pWin, pRegion, what);
-}
-
-Bool
-fbOverlaySetupScreen(ScreenPtr pScreen,
- pointer pbits1,
- pointer pbits2,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width1,
- int width2,
- int bpp1,
- int bpp2)
-{
- return fbSetupScreen (pScreen,
- pbits1,
- xsize,
- ysize,
- dpix,
- dpiy,
- width1,
- bpp1);
-}
-
-static Bool
-fb24_32OverlayCreateScreenResources(ScreenPtr pScreen)
-{
- FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
- int pitch;
- Bool retval;
- int i;
-
- if((retval = fbOverlayCreateScreenResources(pScreen))) {
- for (i = 0; i < pScrPriv->nlayers; i++)
- {
- /* fix the screen pixmap */
- PixmapPtr pPix = (PixmapPtr) pScrPriv->layer[i].u.run.pixmap;
- if (pPix->drawable.bitsPerPixel == 32) {
- pPix->drawable.bitsPerPixel = 24;
- pitch = BitmapBytePad(pPix->drawable.width * 24);
- pPix->devKind = pitch;
- }
- }
- }
-
- return retval;
-}
-
-Bool
-fbOverlayFinishScreenInit(ScreenPtr pScreen,
- pointer pbits1,
- pointer pbits2,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width1,
- int width2,
- int bpp1,
- int bpp2,
- int depth1,
- int depth2)
-{
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int bpp = 0, imagebpp = 32;
- VisualID defaultVisual;
- FbOverlayScrPrivPtr pScrPriv;
-
- if (fbOverlayGeneration != serverGeneration)
- {
- fbOverlayScreenPrivateIndex = AllocateScreenPrivateIndex ();
- fbOverlayGeneration = serverGeneration;
- }
-
- pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec));
- if (!pScrPriv)
- return FALSE;
-
-#ifdef FB_24_32BIT
- if (bpp1 == 32 || bpp2 == 32)
- bpp = 32;
- else if (bpp1 == 24 || bpp2 == 24)
- bpp = 24;
-
- if (bpp == 24)
- {
- int f;
-
- imagebpp = 32;
- /*
- * Check to see if we're advertising a 24bpp image format,
- * in which case windows will use it in preference to a 32 bit
- * format.
- */
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- if (screenInfo.formats[f].bitsPerPixel == 24)
- {
- imagebpp = 24;
- break;
- }
- }
- }
-#endif
-#ifdef FB_SCREEN_PRIVATE
- if (imagebpp == 32)
- {
- fbGetScreenPrivate(pScreen)->win32bpp = bpp;
- fbGetScreenPrivate(pScreen)->pix32bpp = bpp;
- }
- else
- {
- fbGetScreenPrivate(pScreen)->win32bpp = 32;
- fbGetScreenPrivate(pScreen)->pix32bpp = 32;
- }
-#endif
-
- if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1,
- &defaultVisual, ((unsigned long)1<<(bpp1-1)) |
- ((unsigned long)1<<(bpp2-1)), 8))
- return FALSE;
- if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
- depth1, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_SCREEN
- , (miBSFuncPtr) 0
-#endif
- ))
- return FALSE;
- /* MI thinks there's no frame buffer */
-#ifdef MITSHM
- ShmRegisterFbFuncs(pScreen);
-#endif
- pScreen->minInstalledCmaps = 1;
- pScreen->maxInstalledCmaps = 2;
-
- pScrPriv->nlayers = 2;
- pScrPriv->PaintKey = fbOverlayPaintKey;
- pScrPriv->CopyWindow = fbCopyWindowProc;
- pScrPriv->layer[0].u.init.pbits = pbits1;
- pScrPriv->layer[0].u.init.width = width1;
- pScrPriv->layer[0].u.init.depth = depth1;
-
- pScrPriv->layer[1].u.init.pbits = pbits2;
- pScrPriv->layer[1].u.init.width = width2;
- pScrPriv->layer[1].u.init.depth = depth2;
-
- pScreen->devPrivates[fbOverlayScreenPrivateIndex].ptr = (pointer) pScrPriv;
-
- /* overwrite miCloseScreen with our own */
- pScreen->CloseScreen = fbOverlayCloseScreen;
- pScreen->CreateScreenResources = fbOverlayCreateScreenResources;
- pScreen->CreateWindow = fbOverlayCreateWindow;
- pScreen->WindowExposures = fbOverlayWindowExposures;
- pScreen->CopyWindow = fbOverlayCopyWindow;
- pScreen->PaintWindowBorder = fbOverlayPaintWindow;
-#ifdef FB_24_32BIT
- if (bpp == 24 && imagebpp == 32)
- {
- pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader;
- pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources;
- }
-#endif
-
- return TRUE;
-}
diff --git a/fb/fboverlay.h b/fb/fboverlay.h
deleted file mode 100644
index 3dca8a3a4..000000000
--- a/fb/fboverlay.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fboverlay.h,v 1.5 2002/09/19 13:22:00 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _FBOVERLAY_H_
-#define _FBOVERLAY_H_
-
-extern int fbOverlayGeneration;
-extern int fbOverlayScreenPrivateIndex;
-
-#ifndef FB_OVERLAY_MAX
-#define FB_OVERLAY_MAX 2
-#endif
-
-typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int);
-
-typedef struct _fbOverlayLayer {
- union {
- struct {
- pointer pbits;
- int width;
- int depth;
- } init;
- struct {
- PixmapPtr pixmap;
- RegionRec region;
- } run;
- } u;
- CARD32 key; /* special pixel value */
-} FbOverlayLayer;
-
-typedef struct _fbOverlayScrPriv {
- int nlayers;
- fbOverlayPaintKeyProc PaintKey;
- fbCopyProc CopyWindow;
- FbOverlayLayer layer[FB_OVERLAY_MAX];
-} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
-
-#define fbOverlayGetScrPriv(s) \
- ((fbOverlayScreenPrivateIndex != -1) ? \
- (s)->devPrivates[fbOverlayScreenPrivateIndex].ptr : NULL)
-Bool
-fbOverlayCreateWindow(WindowPtr pWin);
-
-Bool
-fbOverlayCloseScreen (int iScreen, ScreenPtr pScreen);
-
-int
-fbOverlayWindowLayer(WindowPtr pWin);
-
-Bool
-fbOverlayCreateScreenResources(ScreenPtr pScreen);
-
-void
-fbOverlayPaintKey (DrawablePtr pDrawable,
- RegionPtr pRegion,
- CARD32 pixel,
- int layer);
-void
-fbOverlayUpdateLayerRegion (ScreenPtr pScreen,
- int layer,
- RegionPtr prgn);
-
-
-void
-fbOverlayCopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-
-void
-fbOverlayWindowExposures (WindowPtr pWin,
- RegionPtr prgn,
- RegionPtr other_exposed);
-
-void
-fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
-
-Bool
-fbOverlaySetupScreen(ScreenPtr pScreen,
- pointer pbits1,
- pointer pbits2,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width1,
- int width2,
- int bpp1,
- int bpp2);
-
-Bool
-fbOverlayFinishScreenInit(ScreenPtr pScreen,
- pointer pbits1,
- pointer pbits2,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width1,
- int width2,
- int bpp1,
- int bpp2,
- int depth1,
- int depth2);
-
-#endif /* _FBOVERLAY_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
deleted file mode 100644
index 894d5cd62..000000000
--- a/fb/fbpict.c
+++ /dev/null
@@ -1,1167 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbpict.c,v 1.16 2002/12/14 01:46:02 dawes Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "fb.h"
-
-#ifdef RENDER
-
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-
-#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 5) & 0x07e0) | \
- (((s) >> 8) & 0xf800))
-#define cvt0565to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
- ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
- ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a) << 16) | *((CARD16 *) ((a)+1))) : \
- ((*((CARD16 *) (a)) << 8) | *((a)+2)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) ((v) >> 16)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) (v))) : \
- ((*((CARD16 *) (a)) = (CARD16) ((v) >> 8)), \
- (*((a)+2) = (CARD8) (v))))
-#else
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a)) | (*((CARD16 *) ((a)+1)) << 8)) : \
- ((*((CARD16 *) (a))) | (*((a)+2) << 16)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) (v)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) ((v) >> 8))) : \
- ((*((CARD16 *) (a)) = (CARD16) (v)),\
- (*((a)+2) = (CARD8) ((v) >> 16))))
-#endif
-
-CARD32
-fbOver (CARD32 x, CARD32 y)
-{
- CARD16 a = ~x >> 24;
- CARD16 t;
- CARD32 m,n,o,p;
-
- m = FbOverU(x,y,0,a,t);
- n = FbOverU(x,y,8,a,t);
- o = FbOverU(x,y,16,a,t);
- p = FbOverU(x,y,24,a,t);
- return m|n|o|p;
-}
-
-CARD32
-fbOver24 (CARD32 x, CARD32 y)
-{
- CARD16 a = ~x >> 24;
- CARD16 t;
- CARD32 m,n,o;
-
- m = FbOverU(x,y,0,a,t);
- n = FbOverU(x,y,8,a,t);
- o = FbOverU(x,y,16,a,t);
- return m|n|o;
-}
-
-CARD32
-fbIn (CARD32 x, CARD8 y)
-{
- CARD16 a = y;
- CARD16 t;
- CARD32 m,n,o,p;
-
- m = FbInU(x,0,a,t);
- n = FbInU(x,8,a,t);
- o = FbInU(x,16,a,t);
- p = FbInU(x,24,a,t);
- return m|n|o|p;
-}
-
-#define fbComposeGetSolid(pict, bits) { \
- FbBits *__bits__; \
- FbStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- switch (__bpp__) { \
- case 32: \
- (bits) = *(CARD32 *) __bits__; \
- break; \
- case 24: \
- (bits) = Fetch24 ((CARD8 *) __bits__); \
- break; \
- case 16: \
- (bits) = *(CARD16 *) __bits__; \
- (bits) = cvt0565to8888(bits); \
- break; \
- default: \
- return; \
- } \
- /* manage missing src alpha */ \
- if ((pict)->pFormat->direct.alphaMask == 0) \
- (bits) |= 0xff000000; \
-}
-
-#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\
- FbBits *__bits__; \
- FbStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \
- (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + (mul) * ((x) - __xoff__); \
-}
-
-/*
- * Naming convention:
- *
- * opSRCxMASKxDST
- */
-
-void
-fbCompositeSolidMask_nx8x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (m)
- {
- d = fbIn (src, m);
- *dst = fbOver (d, *dst) & dstMask;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8888x8888C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD32 *maskLine, *mask, ma;
- FbStride dstStride, maskStride;
- CARD16 w;
- CARD32 m, n, o, p;
-
- fbComposeGetSolid(pSrc, src);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (ma)
- {
- d = *dst;
-#define FbInOverC(src,srca,msk,dst,i,result) { \
- CARD16 __a = FbGet8(msk,i); \
- CARD32 __t, __ta; \
- CARD32 __i; \
- __t = FbIntMult (FbGet8(src,i), __a,__i); \
- __ta = (CARD8) ~FbIntMult (srca, __a,__i); \
- __t = __t + FbIntMult(FbGet8(dst,i),__ta,__i); \
- __t = (CARD32) (CARD8) (__t | (-(__t >> 8))); \
- result = __t << (i); \
-}
- FbInOverC (src, srca, ma, d, 0, m);
- FbInOverC (src, srca, ma, d, 8, n);
- FbInOverC (src, srca, ma, d, 16, o);
- FbInOverC (src, srca, ma, d, 24, p);
- *dst = m|n|o|p;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD8 *dstLine, *dst;
- CARD32 d;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 3);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = Fetch24(dst);
- d = fbOver24 (src, d);
- }
- Store24(dst,d);
- }
- else if (m)
- {
- d = fbOver24 (fbIn(src,m), Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = *dst;
- d = fbOver24 (src, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- else if (m)
- {
- d = *dst;
- d = fbOver24 (fbIn(src,m), cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8888x0565C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 src16;
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD32 *maskLine, *mask, ma;
- FbStride dstStride, maskStride;
- CARD16 w;
- CARD32 m, n, o;
-
- fbComposeGetSolid(pSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- src16 = cvt8888to0565(src);
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- {
- *dst = src16;
- }
- else
- {
- d = *dst;
- d = fbOver24 (src, cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- }
- else if (ma)
- {
- d = *dst;
- d = cvt0565to8888(d);
- FbInOverC (src, srca, ma, d, 0, m);
- FbInOverC (src, srca, ma, d, 8, n);
- FbInOverC (src, srca, ma, d, 16, o);
- d = m|n|o;
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst, dstMask;
- CARD32 *srcLine, *src, s;
- FbStride dstStride, srcStride;
- CARD8 a;
- CARD16 w;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a == 0xff)
- *dst = s & dstMask;
- else if (a)
- *dst = fbOver (s, *dst) & dstMask;
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD8 *dstLine, *dst;
- CARD32 d;
- CARD32 *srcLine, *src, s;
- CARD8 a;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 3);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- d = fbOver24 (s, Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD32 *srcLine, *src, s;
- CARD8 a;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- {
- d = *dst;
- d = fbOver24 (s, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_0565x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD16 *dstLine, *dst;
- CARD16 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD16, srcStride, srcLine, 1);
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- *dst++ = *src++;
- }
-}
-
-void
-fbCompositeSrcAdd_8000x8000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD8 *dstLine, *dst;
- CARD8 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD8 s, d;
- CARD16 t;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD8, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s)
- {
- if (s != 0xff)
- {
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- }
- *dst = s;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrcAdd_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD32 s, d;
- CARD16 t;
- CARD32 m,n,o,p;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s)
- {
- if (s != 0xffffffff)
- {
- d = *dst;
- if (d)
- {
- m = FbAdd(s,d,0,t);
- n = FbAdd(s,d,8,t);
- o = FbAdd(s,d,16,t);
- p = FbAdd(s,d,24,t);
- s = m|n|o|p;
- }
- }
- *dst = s;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrcAdd_1000x1000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbBits *dstBits, *srcBits;
- FbStride dstStride, srcStride;
- int dstBpp, srcBpp;
- int dstXoff, dstYoff;
- int srcXoff, srcYoff;
-
- fbGetDrawable(pSrc->pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
-
- fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- fbBlt (srcBits + srcStride * (ySrc + srcYoff),
- srcStride,
- xSrc + srcXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- xDst + dstXoff,
-
- width,
- height,
-
- GXor,
- FB_ALLONES,
- srcBpp,
-
- FALSE,
- FALSE);
-}
-
-void
-fbCompositeSolidMask_nx1xn (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbBits *dstBits;
- FbStip *maskBits;
- FbStride dstStride, maskStride;
- int dstBpp, maskBpp;
- int dstXoff, dstYoff;
- int maskXoff, maskYoff;
- FbBits src;
-
- fbComposeGetSolid(pSrc, src);
-
- if ((src & 0xff000000) != 0xff000000)
- {
- fbCompositeGeneral (op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
- return;
- }
- fbGetStipDrawable (pMask->pDrawable, maskBits, maskStride, maskBpp, maskXoff, maskYoff);
- fbGetDrawable (pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- switch (dstBpp) {
- case 32:
- break;
- case 24:
- break;
- case 16:
- src = cvt8888to0565(src);
- break;
- }
-
- src = fbReplicatePixel (src, dstBpp);
-
- fbBltOne (maskBits + maskStride * (yMask + maskYoff),
- maskStride,
- xMask + maskXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- (xDst + dstXoff) * dstBpp,
- dstBpp,
-
- width * dstBpp,
- height,
-
- 0x0,
- src,
- FB_ALLONES,
- 0x0);
-}
-
-# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-void
-fbComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- CompositeFunc func;
- Bool srcRepeat = pSrc->repeat;
- Bool maskRepeat = FALSE;
- Bool srcAlphaMap = pSrc->alphaMap != 0;
- Bool maskAlphaMap = FALSE;
- Bool dstAlphaMap = pDst->alphaMap != 0;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
- int w, h, w_this, h_this;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
- if (pMask)
- {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
- maskRepeat = pMask->repeat;
- maskAlphaMap = pMask->alphaMap != 0;
- }
-
- if (!miComputeCompositeRegion (&region,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
- return;
-
- func = fbCompositeGeneral;
- if (!pSrc->transform && !(pMask && pMask->transform))
- if (!maskAlphaMap && !srcAlphaMap && !dstAlphaMap)
- switch (op) {
- case PictOpOver:
- if (pMask)
- {
- if (srcRepeat &&
- pSrc->pDrawable->width == 1 &&
- pSrc->pDrawable->height == 1)
- {
- srcRepeat = FALSE;
- if (PICT_FORMAT_COLOR(pSrc->format)) {
- switch (pMask->format) {
- case PICT_a8:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- func = fbCompositeSolidMask_nx8x0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- func = fbCompositeSolidMask_nx8x0888;
- break;
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx8x8888;
- break;
- }
- break;
- case PICT_a8r8g8b8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a8b8g8r8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx1xn;
- break;
- }
- }
- }
- }
- }
- else
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_r8g8b8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_b8g8r8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_r5g6b5:
- switch (pDst->format) {
- case PICT_r5g6b5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- case PICT_b5g6r5:
- switch (pDst->format) {
- case PICT_b5g6r5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- }
- }
- break;
- case PictOpAdd:
- if (pMask == 0)
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8:
- switch (pDst->format) {
- case PICT_a8:
- func = fbCompositeSrcAdd_8000x8000;
- break;
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_a1:
- func = fbCompositeSrcAdd_1000x1000;
- break;
- }
- break;
- }
- }
- break;
- }
- n = REGION_NUM_RECTS (&region);
- pbox = REGION_RECTS (&region);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = mod (y_msk, pMask->pDrawable->height);
- if (h_this > pMask->pDrawable->height - y_msk)
- h_this = pMask->pDrawable->height - y_msk;
- }
- if (srcRepeat)
- {
- y_src = mod (y_src, pSrc->pDrawable->height);
- if (h_this > pSrc->pDrawable->height - y_src)
- h_this = pSrc->pDrawable->height - y_src;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = mod (x_msk, pMask->pDrawable->width);
- if (w_this > pMask->pDrawable->width - x_msk)
- w_this = pMask->pDrawable->width - x_msk;
- }
- if (srcRepeat)
- {
- x_src = mod (x_src, pSrc->pDrawable->width);
- if (w_this > pSrc->pDrawable->width - x_src)
- w_this = pSrc->pDrawable->width - x_src;
- }
- (*func) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- REGION_UNINIT (pDst->pDrawable->pScreen, &region);
-}
-
-#endif /* RENDER */
-
-Bool
-fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
-{
-
-#ifdef RENDER
-
- PictureScreenPtr ps;
-
- if (!miPictureInit (pScreen, formats, nformats))
- return FALSE;
- ps = GetPictureScreen(pScreen);
- ps->Composite = fbComposite;
- ps->Glyphs = miGlyphs;
- ps->CompositeRects = miCompositeRects;
- ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
-
-#endif /* RENDER */
-
- return TRUE;
-}
diff --git a/fb/fbpict.h b/fb/fbpict.h
deleted file mode 100644
index fd911b078..000000000
--- a/fb/fbpict.h
+++ /dev/null
@@ -1,976 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbpict.h,v 1.11 2002/09/26 02:56:48 keithp Exp $
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _FBPICT_H_
-#define _FBPICT_H_
-
-#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
-#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b))
-
-#define FbGet8(v,i) ((CARD16) (CARD8) ((v) >> i))
-
-/*
- * There are two ways of handling alpha -- either as a single unified value or
- * a separate value for each component, hence each macro must have two
- * versions. The unified alpha version has a 'U' at the end of the name,
- * the component version has a 'C'. Similarly, functions which deal with
- * this difference will have two versions using the same convention.
- */
-
-#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\
- (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
-
-#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\
- (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
-
-#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
-
-#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
-
-#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \
- FbIntMult(FbGet8(x,i),ax,(v))),\
- (CARD32) ((CARD8) ((t) | \
- (0 - ((t) >> 8)))) << (i))
-
-#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \
- (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
-
-
-typedef void (*CompositeFunc) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-typedef struct _FbCompositeOperand FbCompositeOperand;
-
-typedef CARD32 (*FbCompositeFetch)(FbCompositeOperand *op);
-typedef void (*FbCompositeStore) (FbCompositeOperand *op, CARD32 value);
-
-typedef void (*FbCompositeStep) (FbCompositeOperand *op);
-typedef void (*FbCompositeSet) (FbCompositeOperand *op, int x, int y);
-
-struct _FbCompositeOperand {
- union {
- struct {
- FbBits *top_line;
- int left_offset;
-
- int start_offset;
- FbBits *line;
- CARD32 offset;
- FbStride stride;
- int bpp;
- } drawable;
- struct {
- int alpha_dx;
- int alpha_dy;
- } external;
- struct {
- int top_y;
- int left_x;
- int start_x;
- int x;
- int y;
- PictTransformPtr transform;
- int filter;
- } transform;
- } u;
- FbCompositeFetch fetch;
- FbCompositeFetch fetcha;
- FbCompositeStore store;
- FbCompositeStep over;
- FbCompositeStep down;
- FbCompositeSet set;
- miIndexedPtr indexed;
- RegionPtr clip;
-};
-
-typedef void (*FbCombineFunc) (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-/*
- * indexed by op
- */
-extern FbCombineFunc fbCombineFunc[];
-
-typedef struct _FbAccessMap {
- CARD32 format;
- FbCompositeFetch fetch;
- FbCompositeFetch fetcha;
- FbCompositeStore store;
-} FbAccessMap;
-
-/*
- * search on format
- */
-extern FbAccessMap fbAccessMap[];
-
-/* fbcompose.c */
-
-typedef struct _fbCompSrc {
- CARD32 value;
- CARD32 alpha;
-} FbCompSrc;
-
-/*
- * All compositing operators *
- */
-
-CARD32
-fbCombineMaskU (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-
-FbCompSrc
-fbCombineMaskC (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-
-CARD32
-fbCombineMaskValueC (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-
-CARD32
-fbCombineMaskAlphaU (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-
-CARD32
-fbCombineMaskAlphaC (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-
-
-#if 0
-CARD32
-FbCombineMask (FbCompositeOperand *src,
- FbCompositeOperand *msk);
-#endif
-
-void
-fbCombineClear (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineSrcU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineSrcC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDst (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-
-void
-fbCombineAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-
-void
-fbCombineAddU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineAddC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineSaturateU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineSaturateC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-CARD8
-fbCombineDisjointOutPart (CARD8 a, CARD8 b);
-
-CARD8
-fbCombineDisjointInPart (CARD8 a, CARD8 b);
-
-void
-fbCombineDisjointGeneralU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine);
-
-void
-fbCombineDisjointGeneralC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine);
-
-void
-fbCombineDisjointOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-void
-fbCombineDisjointOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineDisjointXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-CARD8
-fbCombineConjointOutPart (CARD8 a, CARD8 b);
-
-CARD8
-fbCombineConjointInPart (CARD8 a, CARD8 b);
-
-
-void
-fbCombineConjointGeneralU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine);
-
-void
-fbCombineConjointGeneralC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst,
- CARD8 combine);
-
-void
-fbCombineConjointOverU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOverC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-void
-fbCombineConjointOverReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOverReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointInU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointInC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointInReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-
-void
-fbCombineConjointInReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOutU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOutC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOutReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointOutReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointAtopU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointAtopC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointAtopReverseU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-void
-fbCombineConjointAtopReverseC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointXorU (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-void
-fbCombineConjointXorC (FbCompositeOperand *src,
- FbCompositeOperand *msk,
- FbCompositeOperand *dst);
-
-/*
- * All fetch functions
- */
-
-CARD32
-fbFetch_a8r8g8b8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x8r8g8b8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a8b8g8r8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x8b8g8r8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_r8g8b8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_b8g8r8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_r5g6b5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_b5g6r5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a1r5g5b5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x1r5g5b5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a1b5g5r5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x1b5g5r5 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a4r4g4b4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x4r4g4b4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a4b4g4r4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_x4b4g4r4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a8 (FbCompositeOperand *op);
-
-CARD32
-fbFetcha_a8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_r3g3b2 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_b2g3r3 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a2r2g2b2 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a2b2g2r2 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_c8 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a4 (FbCompositeOperand *op);
-
-CARD32
-fbFetcha_a4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_r1g2b1 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_b1g2r1 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a1r1g1b1 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a1b1g1r1 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_c4 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_a1 (FbCompositeOperand *op);
-
-CARD32
-fbFetcha_a1 (FbCompositeOperand *op);
-
-CARD32
-fbFetch_g1 (FbCompositeOperand *op);
-
-void
-fbStore_a8r8g8b8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x8r8g8b8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a8b8g8r8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x8b8g8r8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_r8g8b8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_b8g8r8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_r5g6b5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_b5g6r5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a1r5g5b5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x1r5g5b5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a1b5g5r5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x1b5g5r5 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a4r4g4b4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x4r4g4b4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a4b4g4r4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_x4b4g4r4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_r3g3b2 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_b2g3r3 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a2r2g2b2 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_c8 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_g8 (FbCompositeOperand *op, CARD32 value);
-
-
-void
-fbStore_a4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_r1g2b1 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_b1g2r1 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a1r1g1b1 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a1b1g1r1 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_c4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_g4 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_a1 (FbCompositeOperand *op, CARD32 value);
-
-void
-fbStore_g1 (FbCompositeOperand *op, CARD32 value);
-
-CARD32
-fbFetch_external (FbCompositeOperand *op);
-
-CARD32
-fbFetch_transform (FbCompositeOperand *op);
-
-CARD32
-fbFetcha_transform (FbCompositeOperand *op);
-
-CARD32
-fbFetcha_external (FbCompositeOperand *op);
-
-void
-fbStore_external (FbCompositeOperand *op, CARD32 value);
-
-Bool
-fbBuildOneCompositeOperand (PicturePtr pPict,
- FbCompositeOperand *op,
- INT16 x,
- INT16 y);
-
-Bool
-fbBuildCompositeOperand (PicturePtr pPict,
- FbCompositeOperand *op,
- INT16 x,
- INT16 y,
- Bool transform,
- Bool alpha);
-void
-fbCompositeGeneral (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-
-/* fbpict.c */
-CARD32
-fbOver (CARD32 x, CARD32 y);
-
-CARD32
-fbOver24 (CARD32 x, CARD32 y);
-
-CARD32
-fbIn (CARD32 x, CARD8 y);
-
-void
-fbCompositeSolidMask_nx8x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8888x8888C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8888x0565C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_0565x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_8000x8000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_1000x1000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx1xn (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-/* fbtrap.c */
-void
-fbRasterizeTrapezoid (PicturePtr alpha,
- xTrapezoid *trap,
- int x_off,
- int y_off);
-
-#endif /* _FBPICT_H_ */
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
deleted file mode 100644
index 757406c21..000000000
--- a/fb/fbpixmap.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Id: fbpixmap.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbpixmap.c,v 1.11 2002/09/16 18:05:34 eich Exp $ */
-
-#include "fb.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#endif
-
-PixmapPtr
-fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
- int adjust;
- int base;
-
- paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits);
- datasize = height * paddedWidth;
-#ifdef PIXPRIV
- base = pScreen->totalPixmapSize;
-#else
- base = sizeof (PixmapRec);
-#endif
- adjust = 0;
- if (base & 7)
- adjust = 8 - (base & 7);
- datasize += adjust;
-#ifdef FB_DEBUG
- datasize += 2 * paddedWidth;
-#endif
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = bpp;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
- pPixmap->devPrivate.ptr = (pointer) ((char *)pPixmap + base + adjust);
-#ifdef FB_DEBUG
- pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap->devPrivate.ptr + paddedWidth);
- fbInitializeDrawable (&pPixmap->drawable);
-#endif
-
- return pPixmap;
-}
-
-PixmapPtr
-fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
-{
- int bpp;
- bpp = BitsPerPixel (depth);
-#ifdef FB_SCREEN_PRIVATE
- if (bpp == 32 && depth <= 24)
- bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
-#endif
- return fbCreatePixmapBpp (pScreen, width, height, depth, bpp);
-}
-
-Bool
-fbDestroyPixmap (PixmapPtr pPixmap)
-{
- if(--pPixmap->refcnt)
- return TRUE;
- xfree(pPixmap);
- return TRUE;
-}
-
-#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
-if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
- (!((reg)->data->numRects && \
- ((r-1)->y1 == (ry1)) && \
- ((r-1)->y2 == (ry2)) && \
- ((r-1)->x1 <= (rx1)) && \
- ((r-1)->x2 >= (rx2))))) \
-{ \
- if ((reg)->data->numRects == (reg)->data->size) \
- { \
- miRectAlloc(reg, 1); \
- fr = REGION_BOXPTR(reg); \
- r = fr + (reg)->data->numRects; \
- } \
- r->x1 = (rx1); \
- r->y1 = (ry1); \
- r->x2 = (rx2); \
- r->y2 = (ry2); \
- (reg)->data->numRects++; \
- if(r->x1 < (reg)->extents.x1) \
- (reg)->extents.x1 = r->x1; \
- if(r->x2 > (reg)->extents.x2) \
- (reg)->extents.x2 = r->x2; \
- r++; \
-}
-
-/* Convert bitmap clip mask into clipping region.
- * First, goes through each line and makes boxes by noting the transitions
- * from 0 to 1 and 1 to 0.
- * Then it coalesces the current line with the previous if they have boxes
- * at the same X coordinates.
- */
-RegionPtr
-fbPixmapToRegion(PixmapPtr pPix)
-{
- register RegionPtr pReg;
- FbBits *pw, w;
- register int ib;
- int width, h, base, rx1 = 0, crects;
- FbBits *pwLineEnd;
- int irectPrevStart, irectLineStart;
- register BoxPtr prectO, prectN;
- BoxPtr FirstRect, rects, prectLineStart;
- Bool fInBox, fSame;
- register FbBits mask0 = FB_ALLONES & ~FbScrRight(FB_ALLONES, 1);
- FbBits *pwLine;
- int nWidth;
-
- pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1);
- if(!pReg)
- return NullRegion;
- FirstRect = REGION_BOXPTR(pReg);
- rects = FirstRect;
-
- pwLine = (FbBits *) pPix->devPrivate.ptr;
- nWidth = pPix->devKind >> (FB_SHIFT-3);
-
- width = pPix->drawable.width;
- pReg->extents.x1 = width - 1;
- pReg->extents.x2 = 0;
- irectPrevStart = -1;
- for(h = 0; h < pPix->drawable.height; h++)
- {
- pw = pwLine;
- pwLine += nWidth;
- irectLineStart = rects - FirstRect;
- /* If the Screen left most bit of the word is set, we're starting in
- * a box */
- if(*pw & mask0)
- {
- fInBox = TRUE;
- rx1 = 0;
- }
- else
- fInBox = FALSE;
- /* Process all words which are fully in the pixmap */
- pwLineEnd = pw + (width >> FB_SHIFT);
- for (base = 0; pw < pwLineEnd; base += FB_UNIT)
- {
- w = *pw++;
- if (fInBox)
- {
- if (!~w)
- continue;
- }
- else
- {
- if (!w)
- continue;
- }
- for(ib = 0; ib < FB_UNIT; ib++)
- {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0)
- {
- if(!fInBox)
- {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = FbScrLeft(w, 1);
- }
- }
- if(width & FB_MASK)
- {
- /* Process final partial word on line */
- w = *pw++;
- for(ib = 0; ib < (width & FB_MASK); ib++)
- {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0)
- {
- if(!fInBox)
- {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = FbScrLeft(w, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox)
- {
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + (width & FB_MASK), h + 1);
- }
- /* if all rectangles on this line have the same x-coords as
- * those on the previous line, then add 1 to all the previous y2s and
- * throw away all the rectangles from this line
- */
- fSame = FALSE;
- if(irectPrevStart != -1)
- {
- crects = irectLineStart - irectPrevStart;
- if(crects == ((rects - FirstRect) - irectLineStart))
- {
- prectO = FirstRect + irectPrevStart;
- prectN = prectLineStart = FirstRect + irectLineStart;
- fSame = TRUE;
- while(prectO < prectLineStart)
- {
- if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2))
- {
- fSame = FALSE;
- break;
- }
- prectO++;
- prectN++;
- }
- if (fSame)
- {
- prectO = FirstRect + irectPrevStart;
- while(prectO < prectLineStart)
- {
- prectO->y2 += 1;
- prectO++;
- }
- rects -= crects;
- pReg->data->numRects -= crects;
- }
- }
- }
- if(!fSame)
- irectPrevStart = irectLineStart;
- }
- if (!pReg->data->numRects)
- pReg->extents.x1 = pReg->extents.x2 = 0;
- else
- {
- pReg->extents.y1 = REGION_BOXPTR(pReg)->y1;
- pReg->extents.y2 = REGION_END(pReg)->y2;
- if (pReg->data->numRects == 1)
- {
- xfree(pReg->data);
- pReg->data = (RegDataPtr)NULL;
- }
- }
-#ifdef DEBUG
- if (!miValidRegion(pReg))
- FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
-#endif
- return(pReg);
-}
-
-#ifdef FB_DEBUG
-
-#ifndef WIN32
-#include <stdio.h>
-#else
-#include <dbg.h>
-#endif
-
-static Bool
-fbValidateBits (FbStip *bits, int stride, FbStip data)
-{
- while (stride--)
- {
- if (*bits != data)
- {
-#ifdef WIN32
- NCD_DEBUG ((DEBUG_FAILURE, "fdValidateBits failed at 0x%x (is 0x%x want 0x%x)",
- bits, *bits, data));
-#else
- fprintf (stderr, "fbValidateBits failed\n");
-#endif
- return FALSE;
- }
- bits++;
- }
-}
-
-void
-fbValidateDrawable (DrawablePtr pDrawable)
-{
- FbStip *bits, *first, *last;
- int stride, bpp;
- int xoff, yoff;
- int height;
- Bool failed;
-
- if (pDrawable->type != DRAWABLE_PIXMAP)
- pDrawable = (DrawablePtr) fbGetWindowPixmap(pDrawable);
- fbGetStipDrawable(pDrawable, bits, stride, bpp, xoff, yoff);
- first = bits - stride;
- last = bits + stride * pDrawable->height;
- if (!fbValidateBits (first, stride, FB_HEAD_BITS) ||
- !fbValidateBits (last, stride, FB_TAIL_BITS))
- fbInitializeDrawable(pDrawable);
-}
-
-void
-fbSetBits (FbStip *bits, int stride, FbStip data)
-{
- while (stride--)
- *bits++ = data;
-}
-
-void
-fbInitializeDrawable (DrawablePtr pDrawable)
-{
- FbStip *bits, *first, *last;
- int stride, bpp;
- int xoff, yoff;
-
- fbGetStipDrawable(pDrawable, bits, stride, bpp, xoff, yoff);
- first = bits - stride;
- last = bits + stride * pDrawable->height;
- fbSetBits (first, stride, FB_HEAD_BITS);
- fbSetBits (last, stride, FB_TAIL_BITS);
-}
-#endif /* FB_DEBUG */
diff --git a/fb/fbpoint.c b/fb/fbpoint.c
deleted file mode 100644
index 20426a9f1..000000000
--- a/fb/fbpoint.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Id: fbpoint.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbpoint.c,v 1.8 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-
-typedef void (*FbDots) (FbBits *dst,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits and,
- FbBits xor);
-
-void
-fbDots (FbBits *dstOrig,
- FbStride dstStride,
- int dstBpp,
- BoxPtr pBox,
- xPoint *pts,
- int npt,
- int xoff,
- int yoff,
- FbBits andOrig,
- FbBits xorOrig)
-{
- FbStip *dst = (FbStip *) dstOrig;
- int x1, y1, x2, y2;
- int x, y;
- FbStip *d;
- FbStip and = andOrig;
- FbStip xor = xorOrig;
-
- dstStride = FbBitsStrideToStipStride (dstStride);
- x1 = pBox->x1;
- y1 = pBox->y1;
- x2 = pBox->x2;
- y2 = pBox->y2;
- while (npt--)
- {
- x = pts->x + xoff;
- y = pts->y + yoff;
- pts++;
- if (x1 <= x && x < x2 && y1 <= y && y < y2)
- {
- x *= dstBpp;
- d = dst + (y * dstStride) + (x >> FB_STIP_SHIFT);
- x &= FB_STIP_MASK;
-#ifdef FB_24BIT
- if (dstBpp == 24)
- {
- FbStip leftMask, rightMask;
- int n, rot;
- FbStip andT, xorT;
-
- rot = FbFirst24Rot (x);
- andT = FbRot24Stip(and,rot);
- xorT = FbRot24Stip(xor,rot);
- FbMaskStip (x, 24, leftMask, n, rightMask);
- if (leftMask)
- {
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
- andT = FbNext24Stip(andT);
- xorT = FbNext24Stip(xorT);
- d++;
- }
- if (rightMask)
- *d = FbDoMaskRRop(*d, andT, xorT, rightMask);
- }
- else
-#endif
- {
- FbStip mask;
- mask = FbStipMask(x, dstBpp);
- *d = FbDoMaskRRop (*d, and, xor, mask);
- }
- }
- }
-}
-
-void
-fbPolyPoint (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nptInit,
- xPoint *pptInit)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- RegionPtr pClip = fbGetCompositeClip(pGC);
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbDots dots;
- FbBits and, xor;
- xPoint *ppt;
- int npt;
- BoxPtr pBox;
- int nBox;
-
- /* make pointlist origin relative */
- ppt = pptInit;
- npt = nptInit;
- if (mode == CoordModePrevious)
- {
- npt--;
- while(npt--)
- {
- ppt++;
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- }
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- and = pPriv->and;
- xor = pPriv->xor;
- dots = fbDots;
-#ifndef FBNOPIXADDR
- switch (dstBpp) {
- case 8: dots = fbDots8; break;
- case 16: dots = fbDots16; break;
-#ifdef FB_24BIT
- case 24: dots = fbDots24; break;
-#endif
- case 32: dots = fbDots32; break;
- }
-#endif
- for (nBox = REGION_NUM_RECTS (pClip), pBox = REGION_RECTS (pClip);
- nBox--; pBox++)
- (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit,
- pDrawable->x + dstXoff, pDrawable->y + dstYoff, and, xor);
-}
diff --git a/fb/fbpush.c b/fb/fbpush.c
deleted file mode 100644
index 4ae60764c..000000000
--- a/fb/fbpush.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Id: fbpush.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbpush.c,v 1.5 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-
-void
-fbPushPattern (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
-
- int width,
- int height)
-{
- FbStip *s, bitsMask, bitsMask0, bits;
- int xspan;
- int w;
- int lenspan;
-
- src += srcX >> FB_STIP_SHIFT;
- srcX &= FB_STIP_MASK;
-
- bitsMask0 = FbStipMask (srcX, 1);
-
- while (height--)
- {
- bitsMask = bitsMask0;
- w = width;
- s = src;
- src += srcStride;
- bits = *s++;
- xspan = x;
- while (w)
- {
- if (bits & bitsMask)
- {
- lenspan = 0;
- do
- {
- lenspan++;
- if (lenspan == w)
- break;
- bitsMask = FbStipRight (bitsMask, 1);
- if (!bitsMask)
- {
- bits = *s++;
- bitsMask = FbBitsMask(0,1);
- }
- } while (bits & bitsMask);
- fbFill (pDrawable, pGC, xspan, y, lenspan, 1);
- xspan += lenspan;
- w -= lenspan;
- }
- else
- {
- do
- {
- w--;
- xspan++;
- if (!w)
- break;
- bitsMask = FbStipRight (bitsMask, 1);
- if (!bitsMask)
- {
- bits = *s++;
- bitsMask = FbBitsMask(0,1);
- }
- } while (!(bits & bitsMask));
- }
- }
- y++;
- }
-}
-
-void
-fbPushFill (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
- int width,
- int height)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
-
- if (pGC->fillStyle == FillSolid)
- {
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- int dstX;
- int dstWidth;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- dst = dst + (y + dstYoff) * dstStride;
- dstX = (x + dstXoff) * dstBpp;
- dstWidth = width * dstBpp;
- if (dstBpp == 1)
- {
- fbBltStip (src,
- srcStride,
- srcX,
-
- (FbStip *) dst,
- FbBitsStrideToStipStride (dstStride),
- dstX,
-
- dstWidth,
- height,
-
- FbStipple1Rop(pGC->alu,pGC->fgPixel),
- pPriv->pm,
- dstBpp);
- }
- else
- {
- fbBltOne (src,
- srcStride,
- srcX,
-
- dst,
- dstStride,
- dstX,
- dstBpp,
-
- dstWidth,
- height,
-
- pPriv->and, pPriv->xor,
- fbAnd(GXnoop,(FbBits) 0,FB_ALLONES),
- fbXor(GXnoop,(FbBits) 0,FB_ALLONES));
- }
- }
- else
- {
- fbPushPattern (pDrawable, pGC, src, srcStride, srcX,
- x, y, width, height);
- }
-}
-
-void
-fbPushImage (DrawablePtr pDrawable,
- GCPtr pGC,
-
- FbStip *src,
- FbStride srcStride,
- int srcX,
-
- int x,
- int y,
- int width,
- int height)
-{
- RegionPtr pClip = fbGetCompositeClip (pGC);
- int nbox;
- BoxPtr pbox;
- int x1, y1, x2, y2;
-
- for (nbox = REGION_NUM_RECTS (pClip),
- pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- x1 = x;
- y1 = y;
- x2 = x + width;
- y2 = y + height;
- if (x1 < pbox->x1)
- x1 = pbox->x1;
- if (y1 < pbox->y1)
- y1 = pbox->y1;
- if (x2 > pbox->x2)
- x2 = pbox->x2;
- if (y2 > pbox->y2)
- y2 = pbox->y2;
- if (x1 >= x2 || y1 >= y2)
- continue;
- fbPushFill (pDrawable,
- pGC,
-
- src + (y1 - y) * srcStride,
- srcStride,
- srcX + (x1 - x),
-
- x1,
- y1,
- x2 - x1,
- y2 - y1);
- }
-}
-
-void
-fbPushPixels (GCPtr pGC,
- PixmapPtr pBitmap,
- DrawablePtr pDrawable,
- int dx,
- int dy,
- int xOrg,
- int yOrg)
-{
- FbStip *stip;
- FbStride stipStride;
- int stipBpp;
- int stipXoff, stipYoff; /* Assumed to be zero */
-
- fbGetStipDrawable (&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
-
- fbPushImage (pDrawable, pGC,
- stip, stipStride, 0,
- xOrg, yOrg, dx, dy);
-}
diff --git a/fb/fbrop.h b/fb/fbrop.h
deleted file mode 100644
index 9481be680..000000000
--- a/fb/fbrop.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Id: fbrop.h,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbrop.h,v 1.4 2000/02/23 20:29:46 dawes Exp $ */
-
-#ifndef _FBROP_H_
-#define _FBROP_H_
-
-typedef struct _mergeRopBits {
- FbBits ca1, cx1, ca2, cx2;
-} FbMergeRopRec, *FbMergeRopPtr;
-
-extern const FbMergeRopRec FbMergeRopBits[16];
-
-#define FbDeclareMergeRop() FbBits _ca1, _cx1, _ca2, _cx2;
-#define FbDeclarePrebuiltMergeRop() FbBits _cca, _ccx;
-
-#define FbInitializeMergeRop(alu,pm) {\
- const FbMergeRopRec *_bits; \
- _bits = &FbMergeRopBits[alu]; \
- _ca1 = _bits->ca1 & pm; \
- _cx1 = _bits->cx1 | ~pm; \
- _ca2 = _bits->ca2 & pm; \
- _cx2 = _bits->cx2 & pm; \
-}
-
-#define FbDestInvarientRop(alu,pm) ((pm) == FB_ALLONES && \
- (((alu) >> 1 & 5) == ((alu) & 5)))
-
-#define FbDestInvarientMergeRop() (_ca1 == 0 && _cx1 == 0)
-
-/* AND has higher precedence than XOR */
-
-#define FbDoMergeRop(src, dst) \
- (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
-
-#define FbDoDestInvarientMergeRop(src) (((src) & _ca2) ^ _cx2)
-
-#define FbDoMaskMergeRop(src, dst, mask) \
- (((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
-
-#define FbDoLeftMaskByteMergeRop(dst, src, lb, l) { \
- FbBits __xor = ((src) & _ca2) ^ _cx2; \
- FbDoLeftMaskByteRRop(dst,lb,l,((src) & _ca1) ^ _cx1,__xor); \
-}
-
-#define FbDoRightMaskByteMergeRop(dst, src, rb, r) { \
- FbBits __xor = ((src) & _ca2) ^ _cx2; \
- FbDoRightMaskByteRRop(dst,rb,r,((src) & _ca1) ^ _cx1,__xor); \
-}
-
-#define FbDoRRop(dst, and, xor) (((dst) & (and)) ^ (xor))
-
-#define FbDoMaskRRop(dst, and, xor, mask) \
- (((dst) & ((and) | ~(mask))) ^ (xor & mask))
-
-/*
- * Take a single bit (0 or 1) and generate a full mask
- */
-#define fbFillFromBit(b,t) (~((t) ((b) & 1)-1))
-
-#define fbXorT(rop,fg,pm,t) ((((fg) & fbFillFromBit((rop) >> 1,t)) | \
- (~(fg) & fbFillFromBit((rop) >> 3,t))) & (pm))
-
-#define fbAndT(rop,fg,pm,t) ((((fg) & fbFillFromBit (rop ^ (rop>>1),t)) | \
- (~(fg) & fbFillFromBit((rop>>2) ^ (rop>>3),t))) | \
- ~(pm))
-
-#define fbXor(rop,fg,pm) fbXorT(rop,fg,pm,FbBits)
-
-#define fbAnd(rop,fg,pm) fbAndT(rop,fg,pm,FbBits)
-
-#define fbXorStip(rop,fg,pm) fbXorT(rop,fg,pm,FbStip)
-
-#define fbAndStip(rop,fg,pm) fbAndT(rop,fg,pm,FbStip)
-
-/*
- * Stippling operations;
- */
-
-extern const FbBits fbStipple16Bits[256]; /* half of table */
-#define FbStipple16Bits(b) \
- (fbStipple16Bits[(b)&0xff] | fbStipple16Bits[(b) >> 8] << FB_HALFUNIT)
-extern const FbBits fbStipple8Bits[256];
-extern const FbBits fbStipple4Bits[16];
-extern const FbBits fbStipple2Bits[4];
-extern const FbBits fbStipple1Bits[2];
-extern const FbBits *const fbStippleTable[];
-
-#define FbStippleRRop(dst, b, fa, fx, ba, bx) \
- (FbDoRRop(dst, fa, fx) & b) | (FbDoRRop(dst, ba, bx) & ~b)
-
-#define FbStippleRRopMask(dst, b, fa, fx, ba, bx, m) \
- (FbDoMaskRRop(dst, fa, fx, m) & (b)) | (FbDoMaskRRop(dst, ba, bx, m) & ~(b))
-
-#define FbDoLeftMaskByteStippleRRop(dst, b, fa, fx, ba, bx, lb, l) { \
- FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
- FbDoLeftMaskByteRRop(dst, lb, l, ((fa) & (b)) | ((ba) & ~(b)), __xor); \
-}
-
-#define FbDoRightMaskByteStippleRRop(dst, b, fa, fx, ba, bx, rb, r) { \
- FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
- FbDoRightMaskByteRRop(dst, rb, r, ((fa) & (b)) | ((ba) & ~(b)), __xor); \
-}
-
-#define FbOpaqueStipple(b, fg, bg) (((fg) & (b)) | ((bg) & ~(b)))
-
-/*
- * Compute rop for using tile code for 1-bit dest stipples; modifies
- * existing rop to flip depending on pixel values
- */
-#define FbStipple1RopPick(alu,b) (((alu) >> (2 - (((b) & 1) << 1))) & 3)
-
-#define FbOpaqueStipple1Rop(alu,fg,bg) (FbStipple1RopPick(alu,fg) | \
- (FbStipple1RopPick(alu,bg) << 2))
-
-#define FbStipple1Rop(alu,fg) (FbStipple1RopPick(alu,fg) | 4)
-
-#endif
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
deleted file mode 100644
index bdcc9d139..000000000
--- a/fb/fbscreen.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Id: fbscreen.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbscreen.c,v 1.13 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-
-Bool
-fbCloseScreen (int index, ScreenPtr pScreen)
-{
- int d;
- DepthPtr depths = pScreen->allowedDepths;
-
- for (d = 0; d < pScreen->numDepths; d++)
- xfree (depths[d].vids);
- xfree (depths);
- xfree (pScreen->visuals);
- xfree (pScreen->devPrivate);
-#ifdef FB_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
-#endif
- return TRUE;
-}
-
-Bool
-fbRealizeFont(ScreenPtr pScreen, FontPtr pFont)
-{
- return (TRUE);
-}
-
-Bool
-fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
-{
- return (TRUE);
-}
-
-void
-fbQueryBestSize (int class,
- unsigned short *width, unsigned short *height,
- ScreenPtr pScreen)
-{
- unsigned short w;
-
- switch (class) {
- case CursorShape:
- if (*width > pScreen->width)
- *width = pScreen->width;
- if (*height > pScreen->height)
- *height = pScreen->height;
- break;
- case TileShape:
- case StippleShape:
- w = *width;
- if ((w & (w - 1)) && w < FB_UNIT)
- {
- for (w = 1; w < *width; w <<= 1)
- ;
- *width = w;
- }
- }
-}
-
-#ifndef FB_OLD_SCREEN
-PixmapPtr
-_fbGetWindowPixmap (WindowPtr pWindow)
-{
- return fbGetWindowPixmap (pWindow);
-}
-
-void
-_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
-{
-#ifdef FB_NO_WINDOW_PIXMAPS
- FatalError ("Attempted to set window pixmap without fb support\n");
-#else
- pWindow->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap;
-#endif
-}
-#endif
-
-Bool
-fbSetupScreen(ScreenPtr pScreen,
- pointer pbits, /* pointer to screen bitmap */
- int xsize, /* in pixels */
- int ysize,
- int dpix, /* dots per inch */
- int dpiy,
- int width, /* pixel width of frame buffer */
- int bpp) /* bits per pixel for screen */
-{
- if (!fbAllocatePrivates(pScreen, (int *) 0))
- return FALSE;
- pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = fbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = fbGetImage;
- pScreen->GetSpans = fbGetSpans;
- pScreen->CreateWindow = fbCreateWindow;
- pScreen->DestroyWindow = fbDestroyWindow;
- pScreen->PositionWindow = fbPositionWindow;
- pScreen->ChangeWindowAttributes = fbChangeWindowAttributes;
- pScreen->RealizeWindow = fbMapWindow;
- pScreen->UnrealizeWindow = fbUnmapWindow;
- pScreen->PaintWindowBackground = fbPaintWindow;
- pScreen->PaintWindowBorder = fbPaintWindow;
- pScreen->CopyWindow = fbCopyWindow;
- pScreen->CreatePixmap = fbCreatePixmap;
- pScreen->DestroyPixmap = fbDestroyPixmap;
- pScreen->RealizeFont = fbRealizeFont;
- pScreen->UnrealizeFont = fbUnrealizeFont;
- pScreen->CreateGC = fbCreateGC;
- pScreen->CreateColormap = fbInitializeColormap;
- pScreen->DestroyColormap = (void (*)(ColormapPtr))NoopDDA;
- pScreen->InstallColormap = fbInstallColormap;
- pScreen->UninstallColormap = fbUninstallColormap;
- pScreen->ListInstalledColormaps = fbListInstalledColormaps;
- pScreen->StoreColors = (void (*)(ColormapPtr, int, xColorItem *))NoopDDA;
- pScreen->ResolveColor = fbResolveColor;
- pScreen->BitmapToRegion = fbPixmapToRegion;
-
-#ifndef FB_OLD_SCREEN
- pScreen->GetWindowPixmap = _fbGetWindowPixmap;
- pScreen->SetWindowPixmap = _fbSetWindowPixmap;
-
- pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas;
- pScreen->BackingStoreFuncs.SetClipmaskRgn = 0;
- pScreen->BackingStoreFuncs.GetImagePixmap = 0;
- pScreen->BackingStoreFuncs.GetSpansPixmap = 0;
-#endif
-
- return TRUE;
-}
-
-Bool
-fbFinishScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp)
-{
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
- int imagebpp = bpp;
-
-#ifdef FB_DEBUG
- int stride;
-
- ysize -= 2;
- stride = (width * bpp) / 8;
- fbSetBits ((FbStip *) pbits,
- stride / sizeof (FbStip), FB_HEAD_BITS);
- pbits = (void *) ((char *) pbits + stride);
- fbSetBits ((FbStip *) ((char *) pbits + stride * ysize),
- stride / sizeof (FbStip), FB_TAIL_BITS);
-#endif
- /*
- * By default, a 24bpp screen will use 32bpp images, this avoids
- * problems with many applications which just can't handle packed
- * pixels. If you want real 24bit images, include a 24bpp
- * format in the pixmap formats
- */
-#ifdef FB_24_32BIT
- if (bpp == 24)
- {
- int f;
-
- imagebpp = 32;
- /*
- * Check to see if we're advertising a 24bpp image format,
- * in which case windows will use it in preference to a 32 bit
- * format.
- */
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- if (screenInfo.formats[f].bitsPerPixel == 24)
- {
- imagebpp = 24;
- break;
- }
- }
- }
-#endif
-#ifdef FB_SCREEN_PRIVATE
- if (imagebpp == 32)
- {
- fbGetScreenPrivate(pScreen)->win32bpp = bpp;
- fbGetScreenPrivate(pScreen)->pix32bpp = bpp;
- }
- else
- {
- fbGetScreenPrivate(pScreen)->win32bpp = 32;
- fbGetScreenPrivate(pScreen)->pix32bpp = 32;
- }
-#endif
- rootdepth = 0;
- if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
- return FALSE;
- if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_SCREEN
- , (miBSFuncPtr) 0
-#endif
- ))
- return FALSE;
- /* overwrite miCloseScreen with our own */
- pScreen->CloseScreen = fbCloseScreen;
-#ifdef FB_24_32BIT
- if (bpp == 24 && imagebpp == 32)
- {
- pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader;
- pScreen->CreateScreenResources = fb24_32CreateScreenResources;
- }
-#endif
-#if 0
- /* leave backing store initialization to the enclosing code so
- * it can choose the correct order of wrappers
- */
- /* init backing store here so we can overwrite CloseScreen without stepping
- * on the backing store wrapped version */
- fbInitializeBackingStore (pScreen);
-#endif
- return TRUE;
-}
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-fbScreenInit(ScreenPtr pScreen,
- pointer pbits,
- int xsize,
- int ysize,
- int dpix,
- int dpiy,
- int width,
- int bpp)
-{
- if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp))
- return FALSE;
- if (!fbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy,
- width, bpp))
- return FALSE;
- return TRUE;
-}
-
-
-#ifdef FB_OLD_SCREEN
-const miBSFuncRec fbBSFuncRec = {
- fbSaveAreas,
- fbRestoreAreas,
- (void (*)(GCPtr, RegionPtr)) 0,
- (PixmapPtr (*)(void)) 0,
- (PixmapPtr (*)(void)) 0,
-};
-#endif
-
-#if 0
-void
-fbInitializeBackingStore (ScreenPtr pScreen)
-{
-#ifdef FB_OLD_SCREEN
- miInitializeBackingStore (pScreen, (miBSFuncRec *) &fbBSFuncRec);
-#else
- miInitializeBackingStore (pScreen);
-#endif
-}
-#endif
diff --git a/fb/fbseg.c b/fb/fbseg.c
deleted file mode 100644
index 284f11fa9..000000000
--- a/fb/fbseg.c
+++ /dev/null
@@ -1,723 +0,0 @@
-/*
- * Id: fbseg.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbseg.c,v 1.8 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-#include "miline.h"
-
-#define fbBresShiftMask(mask,dir,bpp) ((bpp == FB_STIP_UNIT) ? 0 : \
- ((dir < 0) ? FbStipLeft(mask,bpp) : \
- FbStipRight(mask,bpp)))
-
-void
-fbBresSolid (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbStip and = (FbStip) pPriv->and;
- FbStip xor = (FbStip) pPriv->xor;
- FbStip mask, mask0;
- FbStip bits;
-
- fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- dst += ((y1 + dstYoff) * dstStride);
- x1 = (x1 + dstXoff) * dstBpp;
- dst += x1 >> FB_STIP_SHIFT;
- x1 &= FB_STIP_MASK;
- mask0 = FbStipMask(0, dstBpp);
- mask = FbStipRight (mask0, x1);
- if (signdx < 0)
- mask0 = FbStipRight (mask0, FB_STIP_UNIT - dstBpp);
- if (signdy < 0)
- dstStride = -dstStride;
- if (axis == X_AXIS)
- {
- bits = 0;
- while (len--)
- {
- bits |= mask;
- mask = fbBresShiftMask(mask,signdx,dstBpp);
- if (!mask)
- {
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
- bits = 0;
- dst += signdx;
- mask = mask0;
- }
- e += e1;
- if (e >= 0)
- {
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
- bits = 0;
- dst += dstStride;
- e += e3;
- }
- }
- if (bits)
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
- }
- else
- {
- while (len--)
- {
- *dst = FbDoMaskRRop (*dst, and, xor, mask);
- dst += dstStride;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- mask = fbBresShiftMask(mask,signdx,dstBpp);
- if (!mask)
- {
- dst += signdx;
- mask = mask0;
- }
- }
- }
- }
-}
-
-void
-fbBresDash (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbStip and = (FbStip) pPriv->and;
- FbStip xor = (FbStip) pPriv->xor;
- FbStip bgand = (FbStip) pPriv->bgand;
- FbStip bgxor = (FbStip) pPriv->bgxor;
- FbStip mask, mask0;
- FbDashDeclare;
- int dashlen;
- Bool even;
- Bool doOdd;
-
- fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- doOdd = pGC->lineStyle == LineDoubleDash;
-
- FbDashInit (pGC, pPriv, dashOffset, dashlen, even);
-
- dst += ((y1 + dstYoff) * dstStride);
- x1 = (x1 + dstXoff) * dstBpp;
- dst += x1 >> FB_STIP_SHIFT;
- x1 &= FB_STIP_MASK;
- mask0 = FbStipMask(0, dstBpp);
- mask = FbStipRight (mask0, x1);
- if (signdx < 0)
- mask0 = FbStipRight (mask0, FB_STIP_UNIT - dstBpp);
- if (signdy < 0)
- dstStride = -dstStride;
- while (len--)
- {
- if (even)
- *dst = FbDoMaskRRop (*dst, and, xor, mask);
- else if (doOdd)
- *dst = FbDoMaskRRop (*dst, bgand, bgxor, mask);
- if (axis == X_AXIS)
- {
- mask = fbBresShiftMask(mask,signdx,dstBpp);
- if (!mask)
- {
- dst += signdx;
- mask = mask0;
- }
- e += e1;
- if (e >= 0)
- {
- dst += dstStride;
- e += e3;
- }
- }
- else
- {
- dst += dstStride;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- mask = fbBresShiftMask(mask,signdx,dstBpp);
- if (!mask)
- {
- dst += signdx;
- mask = mask0;
- }
- }
- }
- FbDashStep (dashlen, even);
- }
-}
-
-void
-fbBresFill (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- while (len--)
- {
- fbFill (pDrawable, pGC, x1, y1, 1, 1);
- if (axis == X_AXIS)
- {
- x1 += signdx;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- y1 += signdy;
- }
- }
- else
- {
- y1 += signdy;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- x1 += signdx;
- }
- }
- }
-}
-
-static void
-fbSetFg (DrawablePtr pDrawable,
- GCPtr pGC,
- Pixel fg)
-{
- if (fg != pGC->fgPixel)
- {
- DoChangeGC (pGC, GCForeground, (XID *) &fg, FALSE);
- ValidateGC (pDrawable, pGC);
- }
-}
-
-void
-fbBresFillDash (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbDashDeclare;
- int dashlen;
- Bool even;
- Bool doOdd;
- Bool doBg;
- Pixel fg, bg;
-
- fg = pGC->fgPixel;
- bg = pGC->bgPixel;
-
- /* whether to fill the odd dashes */
- doOdd = pGC->lineStyle == LineDoubleDash;
- /* whether to switch fg to bg when filling odd dashes */
- doBg = doOdd && (pGC->fillStyle == FillSolid ||
- pGC->fillStyle == FillStippled);
-
- /* compute current dash position */
- FbDashInit (pGC, pPriv, dashOffset, dashlen, even);
-
- while (len--)
- {
- if (even || doOdd)
- {
- if (doBg)
- {
- if (even)
- fbSetFg (pDrawable, pGC, fg);
- else
- fbSetFg (pDrawable, pGC, bg);
- }
- fbFill (pDrawable, pGC, x1, y1, 1, 1);
- }
- if (axis == X_AXIS)
- {
- x1 += signdx;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- y1 += signdy;
- }
- }
- else
- {
- y1 += signdy;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- x1 += signdx;
- }
- }
- FbDashStep (dashlen, even);
- }
- if (doBg)
- fbSetFg (pDrawable, pGC, fg);
-}
-
-#ifdef FB_24BIT
-static void
-fbBresSolid24RRop (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbStip and = pPriv->and;
- FbStip xor = pPriv->xor;
- FbStip leftMask, rightMask;
- int nl;
- FbStip *d;
- int x;
- int rot;
- FbStip andT, xorT;
-
- fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- dst += ((y1 + dstYoff) * dstStride);
- x1 = (x1 + dstXoff) * 24;
- if (signdy < 0)
- dstStride = -dstStride;
- signdx *= 24;
- while (len--)
- {
- d = dst + (x1 >> FB_STIP_SHIFT);
- x = x1 & FB_STIP_MASK;
- rot = FbFirst24Rot (x);
- andT = FbRot24Stip(and,rot);
- xorT = FbRot24Stip(xor,rot);
- FbMaskStip (x, 24, leftMask, nl, rightMask);
- if (leftMask)
- {
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
- d++;
- andT = FbNext24Stip (andT);
- xorT = FbNext24Stip (xorT);
- }
- if (rightMask)
- *d = FbDoMaskRRop (*d, andT, xorT, rightMask);
- if (axis == X_AXIS)
- {
- x1 += signdx;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- dst += dstStride;
- }
- }
- else
- {
- dst += dstStride;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- x1 += signdx;
- }
- }
- }
-}
-
-static void
-fbBresDash24RRop (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- FbStip *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- FbStip andT, xorT;
- FbStip fgand = pPriv->and;
- FbStip fgxor = pPriv->xor;
- FbStip bgand = pPriv->bgand;
- FbStip bgxor = pPriv->bgxor;
- FbStip leftMask, rightMask;
- int nl;
- FbStip *d;
- int x;
- int rot;
- FbDashDeclare;
- int dashlen;
- Bool even;
- Bool doOdd;
-
- fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- doOdd = pGC->lineStyle == LineDoubleDash;
-
- /* compute current dash position */
- FbDashInit(pGC, pPriv, dashOffset, dashlen, even);
-
- dst += ((y1 + dstYoff) * dstStride);
- x1 = (x1 + dstXoff) * 24;
- if (signdy < 0)
- dstStride = -dstStride;
- signdx *= 24;
- while (len--)
- {
- if (even || doOdd)
- {
- if (even)
- {
- andT = fgand;
- xorT = fgxor;
- }
- else
- {
- andT = bgand;
- xorT = bgxor;
- }
- d = dst + (x1 >> FB_STIP_SHIFT);
- x = x1 & FB_STIP_MASK;
- rot = FbFirst24Rot (x);
- andT = FbRot24Stip (andT, rot);
- xorT = FbRot24Stip (xorT, rot);
- FbMaskStip (x, 24, leftMask, nl, rightMask);
- if (leftMask)
- {
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
- d++;
- andT = FbNext24Stip (andT);
- xorT = FbNext24Stip (xorT);
- }
- if (rightMask)
- *d = FbDoMaskRRop (*d, andT, xorT, rightMask);
- }
- if (axis == X_AXIS)
- {
- x1 += signdx;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- dst += dstStride;
- }
- }
- else
- {
- dst += dstStride;
- e += e1;
- if (e >= 0)
- {
- e += e3;
- x1 += signdx;
- }
- }
- FbDashStep (dashlen, even);
- }
-}
-#endif
-
-/*
- * For drivers that want to bail drawing some lines, this
- * function takes care of selecting the appropriate rasterizer
- * based on the contents of the specified GC.
- */
-
-FbBres *
-fbSelectBres (DrawablePtr pDrawable,
- GCPtr pGC)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- int dstBpp = pDrawable->bitsPerPixel;
- FbBres * bres;
-
- if (pGC->lineStyle == LineSolid)
- {
- bres = fbBresFill;
- if (pGC->fillStyle == FillSolid)
- {
- bres = fbBresSolid;
-#ifdef FB_24BIT
- if (dstBpp == 24)
- bres = fbBresSolid24RRop;
-#endif
-#ifndef FBNOPIXADDR
- if (pPriv->and == 0)
- {
- switch (dstBpp) {
- case 8: bres = fbBresSolid8; break;
- case 16: bres = fbBresSolid16; break;
-#ifdef FB_24BIT
- case 24: bres = fbBresSolid24; break;
-#endif
- case 32: bres = fbBresSolid32; break;
- }
- }
-#endif
- }
- }
- else
- {
- bres = fbBresFillDash;
- if (pGC->fillStyle == FillSolid)
- {
- bres = fbBresDash;
-#ifdef FB_24BIT
- if (dstBpp == 24)
- bres = fbBresDash24RRop;
-#endif
-#ifndef FBNOPIXADDR
- if (pPriv->and == 0 &&
- (pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0))
- {
- switch (dstBpp) {
- case 8: bres = fbBresDash8; break;
- case 16: bres = fbBresDash16; break;
-#ifdef FB_24BIT
- case 24: bres = fbBresDash24; break;
-#endif
- case 32: bres = fbBresDash32; break;
- }
- }
-#endif
- }
- }
- return bres;
-}
-
-void
-fbBres (DrawablePtr pDrawable,
- GCPtr pGC,
- int dashOffset,
- int signdx,
- int signdy,
- int axis,
- int x1,
- int y1,
- int e,
- int e1,
- int e3,
- int len)
-{
- (*fbSelectBres (pDrawable, pGC)) (pDrawable, pGC, dashOffset,
- signdx, signdy, axis, x1, y1,
- e, e1, e3, len);
-}
-
-void
-fbSegment (DrawablePtr pDrawable,
- GCPtr pGC,
- int x1,
- int y1,
- int x2,
- int y2,
- Bool drawLast,
- int *dashOffset)
-{
- FbBres * bres;
- RegionPtr pClip = fbGetCompositeClip(pGC);
- BoxPtr pBox;
- int nBox;
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2, e3; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- int dashoff;
- int doff;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- nBox = REGION_NUM_RECTS (pClip);
- pBox = REGION_RECTS (pClip);
-
- bres = fbSelectBres (pDrawable, pGC);
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- len = adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- len = ady;
- }
-
- FIXUP_ERROR (e, octant, bias);
-
- /*
- * Adjust error terms to compare against zero
- */
- e3 = e2 - e1;
- e = e - e1;
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- if (drawLast)
- len++;
- dashoff = *dashOffset;
- *dashOffset = dashoff + len;
- while(nBox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pBox);
- OUTCODES(oc2, x2, y2, pBox);
- if ((oc1 | oc2) == 0)
- {
- (*bres) (pDrawable, pGC, dashoff,
- signdx, signdy, axis, x1, y1,
- e, e1, e3, len);
- break;
- }
- else if (oc1 & oc2)
- {
- pBox++;
- }
- else
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pBox->x1, pBox->y1, pBox->x2-1,
- pBox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pBox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
- if (clip2 != 0 || drawLast)
- len++;
- if (len)
- {
- /* unwind bresenham error term to first point */
- doff = dashoff;
- err = e;
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- {
- doff += clipdx;
- err += e3 * clipdy + e1 * clipdx;
- }
- else
- {
- doff += clipdy;
- err += e3 * clipdx + e1 * clipdy;
- }
- }
- (*bres) (pDrawable, pGC, doff,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e3, len);
- }
- pBox++;
- }
- } /* while (nBox--) */
-}
diff --git a/fb/fbsetsp.c b/fb/fbsetsp.c
deleted file mode 100644
index e207760c6..000000000
--- a/fb/fbsetsp.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Id: fbsetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbsetsp.c,v 1.5 2001/05/29 04:54:09 keithp Exp $ */
-
-#include "fb.h"
-
-void
-fbSetSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- char *src,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate (pGC);
- RegionPtr pClip = fbGetCompositeClip(pGC);
- FbBits *dst, *d, *s;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- BoxPtr pbox;
- int n;
- int xoff;
- int x1, x2;
-
-#ifdef FB_24_32BIT
- if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
- {
- fb24_32SetSpans (pDrawable, pGC, src, ppt, pwidth, nspans, fSorted);
- return;
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- while (nspans--)
- {
- d = dst + (ppt->y + dstYoff) * dstStride;
- xoff = (int) (((long) src) & (FB_MASK >> 3));
- s = (FbBits *) (src - xoff);
- xoff <<= 3;
- n = REGION_NUM_RECTS(pClip);
- pbox = REGION_RECTS (pClip);
- while (n--)
- {
- if (pbox->y1 > ppt->y)
- break;
- if (pbox->y2 > ppt->y)
- {
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- if (pbox->x1 > x1)
- x1 = pbox->x1;
- if (pbox->x2 < x2)
- x2 = pbox->x2;
- if (x1 < x2)
- fbBlt ((FbBits *) s,
- 0,
- (x1 - ppt->x) * dstBpp + xoff,
- d,
- dstStride,
- (x1 + dstXoff) * dstBpp,
-
- (x2 - x1) * dstBpp,
- 1,
- pGC->alu,
- pPriv->pm,
- dstBpp,
-
- FALSE,
- FALSE);
- }
- }
- src += PixmapBytePad (*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
- fbValidateDrawable (pDrawable);
-}
-
diff --git a/fb/fbsolid.c b/fb/fbsolid.c
deleted file mode 100644
index 17b5bffe0..000000000
--- a/fb/fbsolid.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbsolid.c,v 1.8 2001/10/28 03:33:08 tsi Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FbSelectPart(xor,o,t) xor
-
-#include "fb.h"
-
-void
-fbSolid (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int bpp,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor)
-{
- FbBits startmask, endmask;
- int n, nmiddle;
- int startbyte, endbyte;
-
-#ifdef FB_24BIT
- if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor)))
- {
- fbSolid24 (dst, dstStride, dstX, width, height, and, xor);
- return;
- }
-#endif
-
- dst += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte,
- nmiddle, endmask, endbyte);
- if (startmask)
- dstStride--;
- dstStride -= nmiddle;
- while (height--)
- {
- if (startmask)
- {
- FbDoLeftMaskByteRRop(dst,startbyte,startmask,and,xor);
- dst++;
- }
- n = nmiddle;
- if (!and)
- while (n--)
- *dst++ = xor;
- else
- while (n--)
- {
- *dst = FbDoRRop (*dst, and, xor);
- dst++;
- }
- if (endmask)
- FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
- dst += dstStride;
- }
-}
-
-#ifdef FB_24BIT
-void
-fbSolid24 (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor)
-{
- FbBits startmask, endmask;
- FbBits xor0 = 0, xor1 = 0, xor2 = 0;
- FbBits and0 = 0, and1 = 0, and2 = 0;
- FbBits xorS = 0, andS = 0, xorE = 0, andE = 0;
- int n, nmiddle;
- int rotS, rot;
-
- dst += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- /*
- * Rotate pixel values this far across the word to align on
- * screen pixel boundaries
- */
- rot = FbFirst24Rot (dstX);
- FbMaskBits (dstX, width, startmask, nmiddle, endmask);
- if (startmask)
- dstStride--;
- dstStride -= nmiddle;
-
- /*
- * Precompute rotated versions of the rasterop values
- */
- rotS = rot;
- xor = FbRot24(xor,rotS);
- and = FbRot24(and,rotS);
- if (startmask)
- {
- xorS = xor;
- andS = and;
- xor = FbNext24Pix(xor);
- and = FbNext24Pix(and);
- }
-
- if (nmiddle)
- {
- xor0 = xor;
- and0 = and;
- xor1 = FbNext24Pix(xor0);
- and1 = FbNext24Pix(and0);
- xor2 = FbNext24Pix(xor1);
- and2 = FbNext24Pix(and1);
- }
-
- if (endmask)
- {
- switch (nmiddle % 3) {
- case 0:
- xorE = xor;
- andE = and;
- break;
- case 1:
- xorE = xor1;
- andE = and1;
- break;
- case 2:
- xorE = xor2;
- andE = and2;
- break;
- }
- }
-
- while (height--)
- {
- if (startmask)
- {
- *dst = FbDoMaskRRop(*dst, andS, xorS, startmask);
- dst++;
- }
- n = nmiddle;
- if (!and0)
- {
- while (n >= 3)
- {
- *dst++ = xor0;
- *dst++ = xor1;
- *dst++ = xor2;
- n -= 3;
- }
- if (n)
- {
- *dst++ = xor0;
- n--;
- if (n)
- {
- *dst++ = xor1;
- }
- }
- }
- else
- {
- while (n >= 3)
- {
- *dst = FbDoRRop (*dst, and0, xor0);
- dst++;
- *dst = FbDoRRop (*dst, and1, xor1);
- dst++;
- *dst = FbDoRRop (*dst, and2, xor2);
- dst++;
- n -= 3;
- }
- if (n)
- {
- *dst = FbDoRRop (*dst, and0, xor0);
- dst++;
- n--;
- if (n)
- {
- *dst = FbDoRRop (*dst, and1, xor1);
- dst++;
- }
- }
- }
- if (endmask)
- *dst = FbDoMaskRRop (*dst, andE, xorE, endmask);
- dst += dstStride;
- }
-}
-#endif
diff --git a/fb/fbstipple.c b/fb/fbstipple.c
deleted file mode 100644
index 88f694bb8..000000000
--- a/fb/fbstipple.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Id: fbstipple.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbstipple.c,v 1.7 2001/10/28 03:33:08 tsi Exp $ */
-
-#include "fb.h"
-
-#ifndef FBNOPIXADDR
-/*
- * This is a slight abuse of the preprocessor to generate repetitive
- * code, the idea is to generate code for each case of a copy-mode
- * transparent stipple
- */
-#define LaneCases1(c,a) case c: \
- while (n--) { (void)FbLaneCase(c,a); a++; } \
- break
-#define LaneCases2(c,a) LaneCases1(c,a); LaneCases1(c+1,a)
-#define LaneCases4(c,a) LaneCases2(c,a); LaneCases2(c+2,a)
-#define LaneCases8(c,a) LaneCases4(c,a); LaneCases4(c+4,a)
-#define LaneCases16(c,a) LaneCases8(c,a); LaneCases8(c+8,a)
-#define LaneCases32(c,a) LaneCases16(c,a); LaneCases16(c+16,a)
-#define LaneCases64(c,a) LaneCases32(c,a); LaneCases32(c+32,a)
-#define LaneCases128(c,a) LaneCases64(c,a); LaneCases64(c+64,a)
-#define LaneCases256(c,a) LaneCases128(c,a); LaneCases128(c+128,a)
-
-#if FB_SHIFT == 6
-#define LaneCases(a) LaneCases256(0,a)
-#endif
-
-#if FB_SHIFT == 5
-#define LaneCases(a) LaneCases16(0,a)
-#endif
-
-/*
- * Repeat a transparent stipple across a scanline n times
- */
-
-void
-fbTransparentSpan (FbBits *dst,
- FbBits stip,
- FbBits fgxor,
- int n)
-{
- FbStip s;
-
- s = ((FbStip) (stip ) & 0x01);
- s |= ((FbStip) (stip >> 8) & 0x02);
- s |= ((FbStip) (stip >> 16) & 0x04);
- s |= ((FbStip) (stip >> 24) & 0x08);
-#if FB_SHIFT > 5
- s |= ((FbStip) (stip >> 32) & 0x10);
- s |= ((FbStip) (stip >> 40) & 0x20);
- s |= ((FbStip) (stip >> 48) & 0x40);
- s |= ((FbStip) (stip >> 56) & 0x80);
-#endif
- switch (s) {
- LaneCases(dst);
- }
-}
-#endif
-
-void
-fbEvenStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipHeight,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot)
-{
- FbBits startmask, endmask;
- FbBits mask, and, xor;
- int nmiddle, n;
- FbStip *s, *stipEnd, bits;
- int rot, stipX, stipY;
- int pixelsPerDst;
- const FbBits *fbBits;
- Bool transparent;
- int startbyte, endbyte;
-
- /*
- * Check for a transparent stipple (stencil)
- */
- transparent = FALSE;
- if (dstBpp >= 8 &&
- fgand == 0 && bgand == FB_ALLONES && bgxor == 0)
- transparent = TRUE;
-
- pixelsPerDst = FB_UNIT / dstBpp;
- /*
- * Adjust dest pointers
- */
- dst += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- FbMaskBitsBytes (dstX, width, fgand == 0 && bgand == 0,
- startmask, startbyte, nmiddle, endmask, endbyte);
-
- if (startmask)
- dstStride--;
- dstStride -= nmiddle;
-
- xRot *= dstBpp;
- /*
- * Compute stip start scanline and rotation parameters
- */
- stipEnd = stip + stipStride * stipHeight;
- modulus (- yRot, stipHeight, stipY);
- s = stip + stipStride * stipY;
- modulus (- xRot, FB_UNIT, stipX);
- rot = stipX;
-
- /*
- * Get pointer to stipple mask array for this depth
- */
- fbBits = 0; /* unused */
- if (pixelsPerDst <= 8)
- fbBits = fbStippleTable[pixelsPerDst];
-
- while (height--)
- {
- /*
- * Extract stipple bits for this scanline;
- */
- bits = *s;
- s += stipStride;
- if (s == stipEnd)
- s = stip;
-#if FB_UNIT > 32
- if (pixelsPerDst == 16)
- mask = FbStipple16Bits(FbLeftStipBits(bits,16));
- else
-#endif
- mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
- /*
- * Rotate into position and compute reduced rop values
- */
- mask = FbRotLeft(mask, rot);
- and = (fgand & mask) | (bgand & ~mask);
- xor = (fgxor & mask) | (bgxor & ~mask);
-
-#ifndef FBNOPIXADDR
- if (transparent)
- {
- if (startmask)
- {
- fbTransparentSpan(dst, mask&startmask, fgxor, 1);
- dst++;
- }
- fbTransparentSpan (dst, mask, fgxor, nmiddle);
- dst += nmiddle;
- if (endmask)
- fbTransparentSpan(dst, mask&endmask, fgxor, 1);
- }
- else
-#endif
- {
- /*
- * Fill scanline
- */
- if (startmask)
- {
- FbDoLeftMaskByteRRop (dst, startbyte, startmask, and, xor);
- dst++;
- }
- n = nmiddle;
- if (!and)
- while (n--)
- *dst++ = xor;
- else
- {
- while (n--)
- {
- *dst = FbDoRRop (*dst, and, xor);
- dst++;
- }
- }
- if (endmask)
- FbDoRightMaskByteRRop(dst, endbyte, endmask, and, xor);
- }
- dst += dstStride;
- }
-}
-
-void
-fbOddStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipWidth,
- int stipHeight,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot)
-{
- int stipX, stipY, sx;
- int widthTmp;
- int h, w;
- int x, y;
-
- modulus (- yRot, stipHeight, stipY);
- modulus (dstX / dstBpp - xRot, stipWidth, stipX);
- y = 0;
- while (height)
- {
- h = stipHeight - stipY;
- if (h > height)
- h = height;
- height -= h;
- widthTmp = width;
- x = dstX;
- sx = stipX;
- while (widthTmp)
- {
- w = (stipWidth - sx) * dstBpp;
- if (w > widthTmp)
- w = widthTmp;
- widthTmp -= w;
- fbBltOne (stip + stipY * stipStride,
- stipStride,
- sx,
-
- dst + y * dstStride,
- dstStride,
- x,
- dstBpp,
-
- w, h,
-
- fgand, fgxor, bgand, bgxor);
- x += w;
- sx = 0;
- }
- y += h;
- stipY = 0;
- }
-}
-
-void
-fbStipple (FbBits *dst,
- FbStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- FbStip *stip,
- FbStride stipStride,
- int stipWidth,
- int stipHeight,
- Bool even,
-
- FbBits fgand,
- FbBits fgxor,
- FbBits bgand,
- FbBits bgxor,
-
- int xRot,
- int yRot)
-{
- if (even)
- fbEvenStipple (dst, dstStride, dstX, dstBpp, width, height,
- stip, stipStride, stipHeight,
- fgand, fgxor, bgand, bgxor, xRot, yRot);
- else
- fbOddStipple (dst, dstStride, dstX, dstBpp, width, height,
- stip, stipStride, stipWidth, stipHeight,
- fgand, fgxor, bgand, bgxor, xRot, yRot);
-}
diff --git a/fb/fbtile.c b/fb/fbtile.c
deleted file mode 100644
index ed447f8d3..000000000
--- a/fb/fbtile.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Id: fbtile.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbtile.c,v 1.4 2000/02/23 20:29:48 dawes Exp $ */
-
-#include "fb.h"
-
-/*
- * Accelerated tile fill -- tile width is a power of two not greater
- * than FB_UNIT
- */
-
-void
-fbEvenTile (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int xRot,
- int yRot)
-{
- FbBits *t, *tileEnd, bits;
- FbBits startmask, endmask;
- FbBits and, xor;
- int n, nmiddle;
- int tileX, tileY;
- int rot;
- int startbyte, endbyte;
-
- dst += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- FbMaskBitsBytes(dstX, width, FbDestInvarientRop(alu, pm),
- startmask, startbyte, nmiddle, endmask, endbyte);
- if (startmask)
- dstStride--;
- dstStride -= nmiddle;
-
- /*
- * Compute tile start scanline and rotation parameters
- */
- tileEnd = tile + tileHeight;
- modulus (- yRot, tileHeight, tileY);
- t = tile + tileY;
- modulus (- xRot, FB_UNIT, tileX);
- rot = tileX;
-
- while (height--)
- {
-
- /*
- * Pick up bits for this scanline
- */
- bits = *t++;
- if (t == tileEnd) t = tile;
- bits = FbRotLeft(bits,rot);
- and = fbAnd(alu,bits,pm);
- xor = fbXor(alu,bits,pm);
-
- if (startmask)
- {
- FbDoLeftMaskByteRRop(dst, startbyte, startmask, and, xor);
- dst++;
- }
- n = nmiddle;
- if (!and)
- while (n--)
- *dst++ = xor;
- else
- while (n--)
- {
- *dst = FbDoRRop (*dst, and, xor);
- dst++;
- }
- if (endmask)
- FbDoRightMaskByteRRop(dst, endbyte, endmask, and, xor);
- dst += dstStride;
- }
-}
-
-void
-fbOddTile(FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- FbStride tileStride,
- int tileWidth,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int bpp,
-
- int xRot,
- int yRot)
-{
- int tileX, tileY;
- int widthTmp;
- int h, w;
- int x, y;
-
- modulus (- yRot, tileHeight, tileY);
- y = 0;
- while (height)
- {
- h = tileHeight - tileY;
- if (h > height)
- h = height;
- height -= h;
- widthTmp = width;
- x = dstX;
- modulus (dstX - xRot, tileWidth, tileX);
- while (widthTmp)
- {
- w = tileWidth - tileX;
- if (w > widthTmp)
- w = widthTmp;
- widthTmp -= w;
- fbBlt (tile + tileY * tileStride,
- tileStride,
- tileX,
-
- dst + y * dstStride,
- dstStride,
- x,
-
- w, h,
- alu,
- pm,
- bpp,
-
- FALSE,
- FALSE);
- x += w;
- tileX = 0;
- }
- y += h;
- tileY = 0;
- }
-}
-
-void
-fbTile (FbBits *dst,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- FbBits *tile,
- FbStride tileStride,
- int tileWidth,
- int tileHeight,
-
- int alu,
- FbBits pm,
- int bpp,
-
- int xRot,
- int yRot)
-{
- if (FbEvenTile (tileWidth))
- fbEvenTile (dst, dstStride, dstX, width, height,
- tile, tileHeight,
- alu, pm, xRot, yRot);
- else
- fbOddTile (dst, dstStride, dstX, width, height,
- tile, tileStride, tileWidth, tileHeight,
- alu, pm, bpp, xRot, yRot);
-}
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
deleted file mode 100644
index 3a44d53ef..000000000
--- a/fb/fbtrap.c
+++ /dev/null
@@ -1,1382 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/fb/fbtrap.c,v 1.10 2002/09/27 00:31:24 keithp Exp $
- *
- * Copyright © 2000 University of Southern California
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of University
- * of Southern California not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. University of Southern California makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * University of Southern California DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Carl Worth, USC, Information Sciences Institute */
-
-#include "fb.h"
-
-#ifdef RENDER
-
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-
-#ifdef DEBUG
-#include <stdio.h>
-#include <assert.h>
-
-#define ASSERT(e) assert(e)
-
-#endif
-
-#ifndef ASSERT
-#define ASSERT(e)
-#endif
-
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-#define MAX_AREA 0x80000000
-
-/*
- * A RationalPoint is an exact position along one of the trapezoid
- * edges represented by an approximate position (x,y) and two error
- * terms (ex_dy, ey_dx). The error in X is multiplied by the Y
- * dimension of the line while the error in Y is multiplied by the
- * X dimension of the line, allowing an exact measurement of the
- * distance from (x,y) to the line.
- *
- * Generally, while walking an edge, one of ex_dy/ey_dx will be zero
- * indicating that the position error is held in the other.
- */
-typedef struct {
- xFixed x;
- xFixed ex_dy;
- xFixed y;
- xFixed ey_dx;
-} RationalPoint;
-
-/*
- * Edges are walked both horizontally and vertically
- * They are walked vertically to get to a particular row
- * of pixels, and then walked horizontally within that row
- * to compute pixel coverage.
- *
- * Edges are always walked from top to bottom and from
- * left to right. This means that for lines moving leftwards
- * from top to bottom, the left to right walking actually moves
- * backwards along the line with respect to the top to bottom
- * walking.
- */
-
-/*
- * A RationalRow represents the two positions where
- * an edge intersects a row of pixels. This is used
- * to walk an edge vertically
- */
-
-typedef struct {
- RationalPoint top; /* intersection at top of row */
- RationalPoint bottom; /* intersection at bottom of row */
- RationalPoint pixel_top; /* intersection at top of pixel */
-} RationalRow;
-
-/*
- * A RationalCol represents the two positions where
- * an edge intersects a column of pixels
- */
-
-typedef struct {
- RationalPoint left; /* intersection at left of column */
- RationalPoint right; /* intersection at right of column */
-} RationalCol;
-
-/*
- Here are some thoughts on line walking:
-
- Conditions: c2.x - c1.x = 1
- r2.y - r1.y = 1
-
- A B C D E F G H
- c1\ c1 c2 /c2
-r1 r1 |\ \ r1 r1 / r1/| r1 r1
-\-+---+ \-+---+ +-\-+ +\--+ +--/+ +-/-+ +---+-/ +---+-/
- \| | `.c1 | |r1\| | \ | | / | |/ | | .' | |/
-c1\ | |`-.|c2 | \c2 | | | | | | c1/ | c1|,_/|c2 | /c2
- |\ | | `. | |\ | \ | | / | /| | ./ | | /|
- +-\-+ +---+-\ +---+-\ +--\+ +/--+ /-+---+ /-+---+ +-/-+
- r2\| r2 r2 r2\ /r2 r2 r2 |/r2
- \c2 c2 c1 c1/
-
- Bottom Right Right Bottom Top Top Right Right
-
-State transitions:
-
-A -> C, D E -> E, F
-B -> A, B F -> G, H
-C -> A, B G -> G, H
-D -> C, D H -> E, F
-
-*/
-
-/*
- * Values for PixelWalk.depart. Top and Bottom can have the same value
- * as only one mode is possible given a line of either positive or
- * negative slope. These mark the departure edge while walking
- * rightwards across columns.
- */
-
-typedef enum _departure {
- DepartTop = 0, /* edge exits top of pixel */
- DepartBottom = 0, /* edge exits bottom of pixel */
- DepartRight = 1 /* edge exits right edge of pixel */
-} Departure;
-
-/*
- * PixelWalk
- *
- * This structure holds state to walk a single edge down the trapezoid.
- *
- * The edge is walked twice -- once by rows and once by columns.
- * The two intersections of the pixel by the edge are then set
- * from either the row or column position, depending on which edge
- * is intersected.
- *
- * Note that for lines moving left, walking by rows moves down the
- * line (increasing y) while walking by columns moves up the line
- * (decreasing y).
- */
-typedef struct {
- xFixed dx;
- xFixed ey_thresh;
- xFixed dy;
- xFixed ex_thresh;
-
- Departure depart;
-
- /* slope */
- xFixed m;
- xFixed em_dx;
- xFixed y_correct;
- xFixed ey_correct;
-
- /* Inverse slope. Does this have a standard symbol? */
- xFixed p;
- xFixed ep_dy;
- xFixed x_correct;
- xFixed ex_correct;
-
- /* Trapezoid bottom, used to limit walking to the last row */
- xFixed bottom;
-
- /*
- * Current edge positions along pixel rows and columns
- */
- RationalRow row;
- RationalCol col;
-
- /*
- * The three pixel intersection points, copied from the appropriate
- * row or column position above
- */
- RationalPoint p_pixel_top;
- RationalPoint p_trap_top;
- RationalPoint p_trap_bottom;
-} PixelWalk;
-
-#if 0
-#ifdef GCC
-#define INLINE inline
-#endif
-#endif
-
-#ifndef INLINE
-#define INLINE
-#endif
-
-/*
- * Step 'pt' vertically to 'newy'.
- */
-static INLINE void
-pixelWalkMovePointToRow (PixelWalk *pw, RationalPoint *pt, xFixed newy)
-{
- xFixed_32_32 oex;
- xFixed xoff;
-
- /* X error of old X position and new Y position */
- oex = (xFixed_32_32) pw->dx * (newy - pt->y) - pt->ey_dx + pt->ex_dy;
-
- /* amount to step X by */
- xoff = oex / pw->dy;
-
- /* step X */
- pt->x = pt->x + xoff;
-
- /* set new X error value for new X position and new Y positition */
- pt->ex_dy = oex - (xFixed_32_32) pw->dy * xoff;
-
- /* set new Y position, set Y error to zero */
- pt->y = newy;
- pt->ey_dx = 0;
-}
-
-/*
- * Step 'pt' horizontally to 'newx'
- */
-static INLINE void
-pixelWalkMovePointToCol (PixelWalk *pw, RationalPoint *pt, xFixed newx)
-{
- xFixed_32_32 oey;
- xFixed yoff;
-
- /* Special case vertical lines to arbitrary y */
- if (pw->dx == 0)
- {
- pt->x = newx;
- pt->ex_dy = 0;
- pt->y = 0;
- pt->ey_dx = 0;
- }
- else
- {
- /* Y error of old Y position and new X position */
- oey = (xFixed_32_32) pw->dy * (newx - pt->x) - pt->ex_dy + pt->ey_dx;
-
- /* amount to step Y by */
- yoff = oey / pw->dx;
-
- /* step Y */
- pt->y = pt->y + yoff;
-
- /* set new Y error value for new Y position and new X position */
- pt->ey_dx = oey - (xFixed_32_32) pw->dx * yoff;
-
- /* set new X position, set X error to zero */
- pt->x = newx;
- pt->ex_dy = 0;
- }
-}
-
-/*
- * Step the 'row' element of 'pw' vertically
- * (increasing y) by one whole pixel
- */
-static INLINE void
-pixelWalkStepRow (PixelWalk *pw)
-{
- xFixed y_next = xFixedFloor (pw->row.bottom.y) + xFixed1;
-
- if (y_next > pw->bottom)
- y_next = pw->bottom;
-
- /* pw.row.top.y < pw.row.bottom.y */
- pw->row.top = pw->row.bottom;
-
- if (y_next - pw->row.bottom.y == xFixed1)
- {
- pw->row.pixel_top = pw->row.bottom;
- pw->row.bottom.y += xFixed1;
- pw->row.bottom.x += pw->p;
- pw->row.bottom.ex_dy += pw->ep_dy;
- if (abs (pw->row.bottom.ex_dy) > pw->ex_thresh)
- {
- pw->row.bottom.x += pw->x_correct;
- pw->row.bottom.ex_dy += pw->ex_correct;
- }
- }
- else
- {
- pixelWalkMovePointToRow (pw, &pw->row.pixel_top,
- xFixedCeil (y_next) - xFixed1);
- pixelWalkMovePointToRow (pw, &pw->row.bottom, y_next);
- }
-}
-
-/*
- * Step the 'col' element of 'pw' horizontally
- * (increasing x) by one whole pixel
- */
-static INLINE void
-pixelWalkStepCol (PixelWalk *pw)
-{
- /* pw.col.p1.x < pw.col.p2.x */
- /*
- * Copy the current right point into the left point
- */
- pw->col.left = pw->col.right;
-
- /*
- * Now incrementally walk across the pixel
- */
- pw->col.right.x += xFixed1;
- pw->col.right.y += pw->m;
- pw->col.right.ey_dx += pw->em_dx;
- if (pw->col.right.ey_dx > pw->ey_thresh)
- {
- pw->col.right.y += pw->y_correct;
- pw->col.right.ey_dx += pw->ey_correct;
- }
-}
-/*
- * Walk to the nearest edge of the next pixel, filling in both p1 and
- * p2 as necessary from either the row or col intersections.
- *
- * The "next" pixel is defined to be the next pixel intersected by the
- * line with pixels visited in raster scan order, (for the benefit of
- * cache performance). For lines with positive slope it is easy to
- * achieve raster scan order by simply calling StepCol for each pixel
- * in a given scanline, then calling StepRow once at the end of each
- * scanline.
- *
- * However, for lines of negative slope where the magnitude of dx is
- * greater than dy, a little more work needs to be done. The pixels of
- * a particular scanline will be visited by succesive calls to StepCol
- * as before. This will effectively step "up" the line as we scan from
- * left to right. But, the call to StepRow at the end of the scan line
- * will step "down" the line and the column information will be
- * invalid at that point.
- *
- * For now, I fix up the column of all negative slope lines by calling
- * MovePointToCol at the end of each scanline. However, this is an
- * extremely expensive operation since it involves a 64-bit multiply
- * and a 64-bit divide. It would be much better, (at least as long as
- * abs(dx) is not much greater than dy), to instead step the col
- * backwards as many times as necessary. Or even better, we could
- * simply restore col to the position it began at when we started the
- * scanline, then simply step it backwards once. That would give a
- * performance benefit for lines with slope of any magnitude.
- */
-
-static INLINE void
-pixelWalkNextPixel (PixelWalk *pw)
-{
- if (pw->dx < 0)
- {
- /*
- * left moving lines
- *
- * Check which pixel edge we're departing from
- *
- * Remember that in this case (dx < 0), the 'row' element of 'pw'
- * walks down the line while 'col' walks up
- */
- if (pw->depart == DepartTop)
- {
- /*
- * The edge departs the row at this pixel, the
- * next time it gets used will be for the next row
- *
- * Step down one row and then recompute the
- * column values to start the next row of
- * pixels
- */
- pixelWalkStepRow(pw);
- /*
- * Set column exit pixel
- */
- pixelWalkMovePointToCol(pw, &pw->col.right, xFixedFloor(pw->row.bottom.x));
- /*
- * This moves the exit pixel to the entry pixel
- * and computes the next exit pixel
- */
- pixelWalkStepCol(pw);
- /*
- * The first pixel on the next row will always
- * be entered from below, set the lower
- * intersection of this edge with that pixel
- */
- pw->p_trap_bottom = pw->row.bottom;
- }
- else /* pw->depart == DepartRight */
- {
- /*
- * easy case -- just move right one pixel
- */
- pixelWalkStepCol(pw);
- /*
- * Set the lower intersection of the edge with the
- * pixel -- that's just where the edge entered
- * the pixel from the left
- */
- pw->p_trap_bottom = pw->col.left;
- }
- /*
- * Now compute which edge the pixel
- * is departing from
- */
- if (pw->row.top.x <= pw->col.right.x)
- {
- /*
- * row intersection is left of column intersection,
- * that means the edge hits the top of the pixel
- * before it hits the right edge
- */
- pw->p_trap_top = pw->row.top;
- pw->depart = DepartTop;
- /*
- * Further check to see whether the edge
- * leaves the right or top edge of the
- * whole pixel
- */
- if (pw->row.pixel_top.x <= pw->col.right.x)
- pw->p_pixel_top = pw->row.pixel_top;
- else
- pw->p_pixel_top = pw->col.right;
- }
- else
- {
- /*
- * Row intersection is right of colum intersection,
- * that means the edge hits the right edge of the
- * pixel first
- */
- pw->p_trap_top = pw->col.right;
- pw->p_pixel_top = pw->col.right;
- pw->depart = DepartRight;
- }
- }
- else
- {
- /*
- * right moving lines
- *
- * Check which edge we're departing from
- *
- * In the dx >= 0 case, the row and col elements both
- * walk downwards
- */
- if (pw->depart == DepartBottom)
- {
- /*
- * The edge departs the row at this pixel,
- * the next time it gets used will be for the
- * next row
- *
- * Step down one row and (maybe) over one
- * column to prepare for the next row
- */
- if (pw->row.bottom.x == pw->col.right.x)
- {
- /*
- * right through the corner of the pixel,
- * adjust the column
- */
- pixelWalkStepCol(pw);
- }
- pixelWalkStepRow(pw);
- /*
- * Set the upper intersection of the edge with
- * the pixel, the first pixel on the next
- * row is always entered from the top
- */
- pw->p_trap_top = pw->row.top;
- pw->p_pixel_top = pw->row.pixel_top;
- }
- else /* pw->depart == DepartRight */
- {
- /*
- * Easy case -- move right one
- * pixel
- */
- pixelWalkStepCol(pw);
- /*
- * Set the upper intersection of the edge
- * with the pixel, that's along the left
- * edge of the pixel
- */
- pw->p_trap_top = pw->col.left;
- pw->p_pixel_top = pw->col.left;
- }
- /*
- * Now compute the exit edge and the
- * lower intersection of the edge with the pixel
- */
- if (pw->row.bottom.x <= pw->col.right.x)
- {
- /*
- * Hit the place where the edge leaves
- * the pixel, the lower intersection is
- * where the edge hits the bottom
- */
- pw->p_trap_bottom = pw->row.bottom;
- pw->depart = DepartBottom;
- }
- else
- {
- /*
- * The edge goes through the
- * next pixel on the row,
- * the lower intersection is where the
- * edge hits the right side of the pixel
- */
- pw->p_trap_bottom = pw->col.right;
- pw->depart = DepartRight;
- }
- }
-}
-
-/*
- * Compute the first pixel intersection points
- * and the departure type from that pixel
- */
-static void
-pixelWalkFirstPixel (PixelWalk *pw)
-{
- if (pw->dx < 0)
- {
- if (pw->row.top.x <= pw->col.right.x)
- {
- /*
- * leaving through the top.
- * upper position is the upper point of
- * the 'row' element
- */
- pw->depart = DepartTop;
- pw->p_trap_top = pw->row.top;
- /*
- * further check for pixel top
- */
- if (pw->row.pixel_top.x <= pw->col.right.x)
- pw->p_pixel_top = pw->row.pixel_top;
- else
- pw->p_pixel_top = pw->col.right;
- }
- else
- {
- /*
- * leaving through the right side
- * upper position is the right point of
- * the 'col' element
- */
- pw->depart = DepartRight;
- pw->p_trap_top = pw->col.right;
- pw->p_pixel_top = pw->col.right;
- }
- /*
- * Now find the lower pixel intersection point
- */
- if (pw->row.bottom.x >= pw->col.left.x)
- /*
- * entering through bottom,
- * lower position is the bottom point of
- * the 'row' element
- */
- pw->p_trap_bottom = pw->row.bottom;
- else
- /*
- * entering through left side,
- * lower position is the left point of
- * the 'col' element
- */
- pw->p_trap_bottom = pw->col.left;
- }
- else
- {
- if (pw->row.bottom.x <= pw->col.right.x)
- {
- /*
- * leaving through the bottom (or corner).
- * lower position is the lower point of
- * the 'row' element
- */
- pw->depart = DepartBottom;
- pw->p_trap_bottom = pw->row.bottom;
- }
- else
- {
- /*
- * leaving through the right side
- * lower position is the right point of
- * the 'col' element
- */
- pw->depart = DepartRight;
- pw->p_trap_bottom = pw->col.right;
- }
- /*
- * Now find the upper pixel intersection point
- */
- if (pw->row.top.x >= pw->col.left.x)
- {
- /*
- * entering through the top (or corner),
- * upper position is the top point
- * of the 'row' element
- */
- pw->p_trap_top = pw->row.top;
- /*
- * further check for pixel entry
- */
- if (pw->row.pixel_top.x >= pw->col.left.x)
- pw->p_pixel_top = pw->row.pixel_top;
- else
- pw->p_pixel_top = pw->col.left;
- }
- else
- {
- /*
- * entering through the left side,
- * upper position is the left point of
- * the 'col' element
- */
- pw->p_trap_top = pw->col.left;
- pw->p_pixel_top = pw->col.left;
- }
- }
-}
-
-static void
-pixelWalkInit (PixelWalk *pw, xLineFixed *line, xFixed top_y, xFixed bottom_y)
-{
- xFixed_32_32 dy_inc, dx_inc;
- xFixed next_y;
- xFixed left_x;
- xPointFixed *top, *bot;
-
- next_y = xFixedFloor (top_y) + xFixed1;
- if (next_y > bottom_y)
- next_y = bottom_y;
-
- /*
- * Orient lines top down
- */
- if (line->p1.y < line->p2.y)
- {
- top = &line->p1;
- bot = &line->p2;
- }
- else
- {
- top = &line->p2;
- bot = &line->p1;
- }
-
- pw->dx = bot->x - top->x;
- pw->ey_thresh = abs(pw->dx >> 1);
- pw->dy = bot->y - top->y;
- pw->ex_thresh = pw->dy >> 1;
-
- /*
- * Set step values for walking lines
- */
- if (pw->dx < 0)
- {
- pw->x_correct = -1;
- pw->ex_correct = pw->dy;
- pw->y_correct = -1;
- pw->ey_correct = pw->dx;
- }
- else
- {
- pw->x_correct = 1;
- pw->ex_correct = -pw->dy;
- pw->y_correct = 1;
- pw->ey_correct = -pw->dx;
- }
-
- pw->bottom = bottom_y;
-
- /*
- * Compute Bresenham values for walking edges incrementally
- */
- dy_inc = (xFixed_32_32) xFixed1 * pw->dy; /* > 0 */
- if (pw->dx != 0)
- {
- pw->m = dy_inc / pw->dx; /* sign(dx) */
- pw->em_dx = dy_inc - (xFixed_32_32) pw->m * pw->dx; /* > 0 */
- }
- else
- {
- /* Vertical line. Setting these to zero prevents us from
- having to put any conditions in pixelWalkStepCol. */
- pw->m = 0;
- pw->em_dx = 0;
- }
-
- dx_inc = (xFixed_32_32) xFixed1 * (xFixed_32_32) pw->dx; /* sign(dx) */
- pw->p = dx_inc / pw->dy; /* sign(dx) */
- pw->ep_dy = dx_inc - (xFixed_32_32) pw->p * pw->dy; /* sign(dx) */
-
- /*
- * Initialize 'row' for walking down rows
- */
- pw->row.bottom.x = top->x;
- pw->row.bottom.ex_dy = 0;
- pw->row.bottom.y = top->y;
- pw->row.bottom.ey_dx = 0;
-
- /*
- * Initialize 'pixel_top' to be on the line for
- * the first step
- */
- pw->row.pixel_top = pw->row.bottom;
- /*
- * Move to the pixel above the 'top_y' coordinate,
- * first setting 'bottom' and then using StepRow
- * which moves that to 'top' and computes the next 'bottom'
- */
- pixelWalkMovePointToRow(pw, &pw->row.bottom, top_y);
- pixelWalkStepRow(pw);
-
- /*
- * Initialize 'col' for walking across columns
- */
- pw->col.right.x = top->x;
- pw->col.right.ex_dy = 0;
- pw->col.right.y = top->y;
- pw->col.right.ey_dx = 0;
-
- /*
- * First set the column to the left most
- * pixel hit by the row
- */
- if (pw->dx < 0)
- left_x = pw->row.bottom.x;
- else
- left_x = pw->row.top.x;
-
- pixelWalkMovePointToCol(pw, &pw->col.right, xFixedFloor (left_x));
- pixelWalkStepCol(pw);
-
- /*
- * Compute first pixel intersections and the
- * first departure state
- */
- pixelWalkFirstPixel (pw);
-}
-
-#define RoundShift(a,b) (((a) + (1 << ((b) - 1))) >> (b))
-#define MaxAlpha(depth) ((1 << (depth)) - 1)
-
-#define AreaAlpha(area, depth) (RoundShift (RoundShift (area, depth) * \
- MaxAlpha (depth), \
- (31 - depth)))
-
-/*
- Pixel coverage from the upper-left corner bounded by one horizontal
- bottom line (bottom) and one line defined by two points, (x1,y1) and
- (x2,y2), which intersect the pixel. y1 must be less than y2. There
- are 8 cases yielding the following area calculations:
-
- A B C D E F G H
-+---+ +---+ +-1-+ +1--+ +--1+ +-1-+ +---+ +---+
-| | 1 | | \| | \ | | / | |/ | | 1 | |
-1 | |`-.| | 2 | | | | | | 2 | |,_/| | 1
-|\ | | 2 | | | \ | | / | | | 2 | | /|
-+-2-+ +---+ +---+ +--2+ +2--+ +---+ +---+ +-2-+
-
-A: (1/2 * x2 * (y2 - y1))
-B: (1/2 * x2 * (y2 - y1)) + (bottom - y2) * x2
-C: (1/2 * (x1 + x2) * y2 ) + (bottom - y2) * x2
-D: (1/2 * (x1 + x2) * y2 )
-E: (1/2 * (x1 + x2) * y2 )
-F: (1/2 * x1 * y2 )
-G: (1/2 * x1 * (y2 - y1)) + x1 * y1
-H: (1/2 * (x1 + x2) * (y2 - y1)) + x1 * y1
-
-The union of these calculations is valid for all cases. Namely:
-
- (1/2 * (x1 + x2) * (y2 - y1)) + (bottom - y2) * x2 + x1 * y1
-
-An exercise for later would perhaps be to optimize the calculations
-for some of the cases above. Specifically, it's possible to eliminate
-multiplications by zero in several cases, leaving a maximum of two
-multiplies per pixel calculation. (This is even more promising now
-that the higher level code actually computes the exact same 8 cases
-as part of its pixel walking).
-
-But, for now, I just want to get something working correctly even if
-slower. So, we'll use the non-optimized general equation.
-
-*/
-
-/* 1.16 * 1.16 -> 1.31 */
-#define AREA_MULT(w, h) ( (xFixed_1_31) (((((xFixed_1_16)w)*((xFixed_1_16)h) + 1) >> 1) | (((xFixed_1_16)w)&((xFixed_1_16)h)&0x10000) << 15))
-
-/* (1.16 + 1.16) / 2 -> 1.16 */
-#define WIDTH_AVG(x1,x2) (((x1) + (x2) + 1) >> 1)
-
-#define SubPixelArea(x1, y1, x2, y2, bottom) \
-(xFixed_1_31) ( \
- AREA_MULT((x1), (y1)) \
- + AREA_MULT(WIDTH_AVG((x1), (x2)), (y2) - (y1))\
- + AREA_MULT((x2), (bottom) - (y2)) \
-)
-
-/*
-static xFixed_1_31
-SubPixelArea (xFixed_1_16 x1,
- xFixed_1_16 y1,
- xFixed_1_16 x2,
- xFixed_1_16 y2,
- xFixed_1_16 bottom)
-{
- xFixed_1_16 x_trap;
- xFixed_1_16 h_top, h_trap, h_bot;
- xFixed_1_31 area;
-
- x_trap = WIDTH_AVG(x1,x2);
- h_top = y1;
- h_trap = (y2 - y1);
- h_bot = (bottom - y2);
-
- area = AREA_MULT(x1, h_top) +
- AREA_MULT(x_trap, h_trap) +
- AREA_MULT(x2, h_bot);
-
- return area;
-}
-*/
-
-#define SubPixelAlpha(x1, y1, x2, y2, bottom, depth) \
-( \
- AreaAlpha( \
- SubPixelArea((x1), (y1), (x2), (y2), (bottom)), \
- (depth) \
- ) \
-)
-
-/*
-static int
-SubPixelAlpha (xFixed_1_16 x1,
- xFixed_1_16 y1,
- xFixed_1_16 x2,
- xFixed_1_16 y2,
- xFixed_1_16 bottom,
- int depth)
-{
- xFixed_1_31 area;
-
- area = SubPixelArea(x1, y1, x2, y2, bottom);
-
- return AreaAlpha(area, depth);
-}
-*/
-
-/* Alpha of a pixel above a given horizontal line */
-#define AlphaAbove(pixel_y, line_y, depth) \
-( \
- AreaAlpha(AREA_MULT((line_y) - (pixel_y), xFixed1), depth) \
-)
-
-static int
-RectAlpha(xFixed pixel_y, xFixed top, xFixed bottom, int depth)
-{
- if (depth == 1)
- return top == pixel_y ? 1 : 0;
- else
- return (AlphaAbove (pixel_y, bottom, depth) -
- AlphaAbove (pixel_y, top, depth));
-}
-
-
-/*
- * Pixel coverage from the left edge bounded by one horizontal lines,
- * (top and bottom), as well as one PixelWalk line.
- */
-static int
-AlphaAboveLeft(RationalPoint *upper,
- RationalPoint *lower,
- xFixed bottom,
- xFixed pixel_x,
- xFixed pixel_y,
- int depth)
-{
- return SubPixelAlpha(upper->x - pixel_x,
- upper->y - pixel_y,
- lower->x - pixel_x,
- lower->y - pixel_y,
- bottom - pixel_y,
- depth);
-}
-
-/*
- Pixel coverage from the left edge bounded by two horizontal lines,
- (top and bottom), as well as one line two points, p1 and p2, which
- intersect the pixel. The following condition must be true:
-
- p2.y > p1.y
-*/
-
-/*
- lr
- |\
- +--|-\-------+
- | a| b\ |
- =======|===\========== top
- | c| d \ |
- =======|=====\======== bot
- | | \ |
- +--|-------\-+
-
- alpha(d) = alpha(cd) - alpha(c) = alpha(abcd) - alpha(ab) - (alpha(ac) - alpha(c))
-
- alpha(d) = pixelalpha(top, bot, right) - pixelalpha(top, bot, left)
-
- pixelalpha(top, bot, line) = subpixelalpha(bot, line) - subpixelalpha(top, line)
-*/
-
-static int
-PixelAlpha(xFixed pixel_x,
- xFixed pixel_y,
- xFixed top,
- xFixed bottom,
- PixelWalk *pw,
- int depth)
-{
- int alpha;
-
-#ifdef DEBUG
- fprintf(stderr, "alpha (%f, %f) - (%f, %f) = ",
- (double) pw->p1.x / (1 << 16),
- (double) pw->p1.y / (1 << 16),
- (double) pw->p2.x / (1 << 16),
- (double) pw->p2.y / (1 << 16));
- fflush(stderr);
-#endif
-
- /*
- * Sharp polygons are different, alpha is 1 if the
- * area includes the pixel origin, else zero, in
- * the above figure, only 'a' has alpha 1
- */
- if (depth == 1)
- {
- alpha = 0;
- if (top == pixel_y && pw->p_pixel_top.x != pixel_x)
- alpha = 1;
- }
- else
- {
- alpha = (AlphaAboveLeft(&pw->p_pixel_top, &pw->p_trap_bottom,
- bottom, pixel_x, pixel_y, depth)
- - AlphaAboveLeft(&pw->p_pixel_top, &pw->p_trap_top,
- top, pixel_x, pixel_y, depth));
- }
-
-#ifdef DEBUG
- fprintf(stderr, "0x%x => %f\n",
- alpha,
- (double) alpha / ((1 << depth) -1 ));
- fflush(stderr);
-#endif
-
- return alpha;
-}
-
-#define INCREMENT_X_AND_PIXEL \
-{ \
- pixel_x += xFixed1; \
- (*mask.over) (&mask); \
-}
-
-/* XXX: What do we really want this prototype to look like? Do we want
- separate versions for 1, 4, 8, and 16-bit alpha? */
-
-#define saturateAdd(t, a, b) (((t) = (a) + (b)), \
- ((CARD8) ((t) | (0 - ((t) >> 8)))))
-
-#define addAlpha(mask, depth, alpha, temp) (\
- (*(mask)->store) ((mask), (alpha == (1 << depth) - 1) ? \
- 0xff000000 : \
- (saturateAdd (temp, \
- alpha << (8 - depth), \
- (*(mask)->fetch) (mask) >> 24) << 24)) \
-)
-
-void
-fbRasterizeTrapezoid (PicturePtr pMask,
- xTrapezoid *pTrap,
- int x_off,
- int y_off)
-{
- xTrapezoid trap = *pTrap;
- int alpha, temp;
-
- FbCompositeOperand mask;
-
- int depth = pMask->pDrawable->depth;
- int max_alpha = (1 << depth) - 1;
- int buf_width = pMask->pDrawable->width;
-
- xFixed x_off_fixed = IntToxFixed(x_off);
- xFixed y_off_fixed = IntToxFixed(y_off);
- xFixed buf_width_fixed = IntToxFixed(buf_width);
-
- PixelWalk left, right;
- xFixed pixel_x, pixel_y;
- xFixed first_right_x;
- xFixed y, y_next;
-
- /* trap.left and trap.right must be non-horizontal */
- if (trap.left.p1.y == trap.left.p2.y
- || trap.right.p1.y == trap.right.p2.y) {
- return;
- }
-
- trap.top += y_off_fixed;
- trap.bottom += y_off_fixed;
- trap.left.p1.x += x_off_fixed;
- trap.left.p1.y += y_off_fixed;
- trap.left.p2.x += x_off_fixed;
- trap.left.p2.y += y_off_fixed;
- trap.right.p1.x += x_off_fixed;
- trap.right.p1.y += y_off_fixed;
- trap.right.p2.x += x_off_fixed;
- trap.right.p2.y += y_off_fixed;
-
-#ifdef DEBUG
- fprintf(stderr, "(top, bottom) = (%f, %f)\n",
- (double) trap.top / (1 << 16),
- (double) trap.bottom / (1 << 16));
-#endif
-
- pixelWalkInit(&left, &trap.left, trap.top, trap.bottom);
- pixelWalkInit(&right, &trap.right, trap.top, trap.bottom);
-
- /* XXX: I'd still like to optimize this loop for top and
- bottom. Only the first row intersects top and only the last
- row, (which could also be the first row), intersects bottom. So
- we could eliminate some unnecessary calculations from all other
- rows. Unfortunately, I haven't found an easy way to do it
- without bloating the text, (eg. unrolling a couple iterations
- of the loop). So, for sake of maintenance, I'm putting off this
- optimization at least until this code is more stable.. */
-
- if (!fbBuildCompositeOperand (pMask, &mask, 0, xFixedToInt (trap.top), FALSE, FALSE))
- return;
-
- for (y = trap.top; y < trap.bottom; y = y_next)
- {
- pixel_y = xFixedFloor (y);
- y_next = pixel_y + xFixed1;
- if (y_next > trap.bottom)
- y_next = trap.bottom;
-
- ASSERT (left.row.top.y == y);
- ASSERT (left.row.bottom.y == y_next);
- ASSERT (right.row.top.y == y);
- ASSERT (right.row.bottom.y == y_next);
-
- pixel_x = xFixedFloor(left.col.left.x);
-
- /*
- * Walk pixels on this row that are left of the
- * first possibly lit pixel
- *
- * pixelWalkNextPixel will change .row.top.y
- * when the last pixel covered by the edge
- * is passed
- */
-
- first_right_x = xFixedFloor(right.col.left.x);
- while (right.row.top.y == y && first_right_x < pixel_x)
- {
- /* these are empty */
- pixelWalkNextPixel (&right);
- /* step over */
- first_right_x += xFixed1;
- }
-
- (*mask.set) (&mask, xFixedToInt (pixel_x), xFixedToInt (y));
-
- /*
- * Walk pixels on this row intersected by only trap.left
- *
- */
- while (left.row.top.y == y && pixel_x < first_right_x)
- {
- alpha = (RectAlpha (pixel_y, y, y_next, depth)
- - PixelAlpha(pixel_x, pixel_y, y, y_next, &left, depth));
-
- if (alpha > 0)
- {
- if (0 <= pixel_x && pixel_x < buf_width_fixed)
- addAlpha (&mask, depth, alpha, temp);
- }
-
- /*
- * Step right
- */
- pixelWalkNextPixel(&left);
- INCREMENT_X_AND_PIXEL;
- }
-
- /*
- * Either pixels are covered by both edges or
- * there are fully covered pixels on this row
- */
- if (pixel_x == first_right_x)
- {
- /*
- * Now walk the pixels on this row intersected
- * by both edges
- */
- while (left.row.top.y == y && right.row.top.y == y)
- {
- alpha = (PixelAlpha(pixel_x, pixel_y, y, y_next, &right, depth)
- - PixelAlpha(pixel_x, pixel_y, y, y_next, &left, depth));
- if (alpha > 0)
- {
- ASSERT (0 <= alpha && alpha <= max_alpha);
- if (0 <= pixel_x && pixel_x < buf_width_fixed)
- addAlpha (&mask, depth, alpha, temp);
- }
- pixelWalkNextPixel(&left);
- pixelWalkNextPixel(&right);
- INCREMENT_X_AND_PIXEL;
- }
- /*
- * If the right edge is now left of the left edge,
- * the left edge will end up only partially walked,
- * walk it the rest of the way
- */
- while (left.row.top.y == y)
- pixelWalkNextPixel(&left);
- }
- else
- {
- /*
- * Fully covered pixels simply saturate
- */
- alpha = RectAlpha (pixel_y, y, y_next, depth);
- if (alpha == max_alpha)
- {
- while (pixel_x < first_right_x)
- {
- if (0 <= pixel_x && pixel_x < buf_width_fixed)
- (*mask.store) (&mask, 0xff000000);
- INCREMENT_X_AND_PIXEL;
- }
- }
- else
- {
- while (pixel_x < first_right_x)
- {
- ASSERT (0 <= alpha && alpha <= max_alpha);
- if (0 <= pixel_x && pixel_x < buf_width_fixed)
- addAlpha (&mask, depth, alpha, temp);
- INCREMENT_X_AND_PIXEL;
- }
- }
- }
-
- /*
- * Finally, pixels intersected only by trap.right
- */
- while (right.row.top.y == y)
- {
- alpha = PixelAlpha(pixel_x, pixel_y, y, y_next, &right, depth);
- if (alpha > 0)
- {
- if (0 <= pixel_x && pixel_x < buf_width_fixed)
- addAlpha (&mask, depth, alpha, temp);
- }
- pixelWalkNextPixel(&right);
- INCREMENT_X_AND_PIXEL;
- }
- }
-}
-
-/* Some notes on walking while keeping track of errors in both dimensions:
-
-That's really pretty easy. Your bresenham should be walking sub-pixel
-coordinates rather than pixel coordinates. Now you can calculate the
-sub-pixel Y coordinate for any arbitrary sub-pixel X coordinate (or vice
-versa).
-
- ey: y error term (distance from current Y sub-pixel to line) * dx
- ex: x error term (distance from current X sub-pixel to line) * dy
- dx: difference of X coordinates for line endpoints
- dy: difference of Y coordinates for line endpoints
- x: current fixed-point X coordinate
- y: current fixed-point Y coordinate
-
-One of ey or ex will always be zero, depending on whether the distance to
-the line was measured horizontally or vertically.
-
-In moving from x, y to x1, y1:
-
- (x1 + e1x/dy) - (x + ex/dy) dx
- --------------------------- = --
- (y1 + e1y/dx) - (y + ey/dx) dy
-
- (x1dy + e1x) - (xdy + ex) = (y1dx + e1y) - (ydx + ey)
-
- dy(x1 - x) + (e1x - ex) = dx(y1-y) + (e1y - ey)
-
-So, if you know y1 and want to know x1:
-
- Set e1y to zero and compute the error from x:
-
- oex = dx(y1 - y) - ey + ex
-
- Compute the number of whole pixels to get close to the line:
-
- wx = oex / dy
-
- Set x1:
-
- Now compute the e1x:
-
- e1x = oex - wx * dy
-
-A similar operation moves to a known y1. Note that this computation (in
-general) requires 64 bit arithmetic. I suggest just using the available
-64 bit datatype for now, we can optimize the common cases with a few
-conditionals. There's some cpp code in fb/fb.h that selects a 64 bit type
-for machines that XFree86 builds on; there aren't any machines missing a
-64 bit datatype that I know of.
-*/
-
-/* Here's a large-step Bresenham for jogging my memory.
-
-void large_bresenham_x_major(x1, y1, x2, y2, x_inc)
-{
- int x, y, dx, dy, m;
- int em_dx, ey_dx;
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- m = (x_inc * dy) / dx;
- em_dx = (x_inc * dy) - m * dx;
-
- x = x1;
- y = y1;
- ey = 0;
-
- set(x,y);
-
- while (x < x2) {
- x += x_inc;
- y += m;
- ey_dx += em_dx;
- if (ey_dx > dx_2) {
- y++;
- ey_dx -= dx;
- }
- set(x,y);
- }
-}
-
-*/
-
-/* Here are the latest, simplified equations for computing trapezoid
- coverage of a pixel:
-
- alpha_from_area(A) = round(2**depth-1 * A)
-
- alpha(o) = 2**depth-1
-
- alpha(a) = alpha_from_area(area(a))
-
- alpha(ab) = alpha_from_area(area(ab))
-
- alpha(b) = alpha(ab) - alpha (a)
-
- alpha(abc) = alpha_from_area(area(abc))
-
- alpha(c) = alpha(abc) - alpha(ab)
-
- alpha(ad) = alpha_from_area(area(ad))
-
- alpha (d) = alpha(ad) - alpha (a)
-
- alpha (abde) = alpha_from_area(area(abde))
-
- alpha (de) = alpha (abde) - alpha (ab)
-
- alpha (e) = alpha (de) - alpha (d)
-
- alpha (abcdef) = alpha_from_area(area(abcdef))
-
- alpha (def) = alpha (abcdef) - alpha (abc)
-
- alpha (f) = alpha (def) - alpha (de)
-
- alpha (adg) = alpha_from_area(area(adg))
-
- alpha (g) = alpha (adg) - alpha (ad)
-
- alpha (abdegh) = alpha_from_area(area(abdegh))
-
- alpha (gh) = alpha (abdegh) - alpha (abde)
-
- alpha (h) = alpha (gh) - alpha (g)
-
- alpha (abcdefghi) = alpha_from_area(area(abcdefghi)) =
- alpha_from_area(area(o)) = alpha_from_area(1) = alpha(o)
-
- alpha (ghi) = alpha (abcdefghi) - alpha (abcdef)
-
- alpha (i) = alpha (ghi) - alpha (gh)
-*/
-
-/* Latest thoughts from Keith on implementing area/alpha computations:
-
-*** 1.16 * 1.16 -> 1.31 ***
-#define AREA_MULT(w,h) ((w)&(h) == 0x10000 ? 0x80000000 : (((w)*(h) + 1) >> 1)
-
-*** (1.16 + 1.16) / 2 -> 1.16 ***
-#define WIDTH_AVG(x1,x2) (((x1) + (x2) + 1) >> 1)
-
-xFixed_1_31
-SubpixelArea (xFixed_1_16 x1,
- xFixed_1_16 x2,
- xFixed_1_16 y1,
- xFixed_1_16 y2,
- xFixed_1_16 bottom)
- {
- xFixed_1_16 x_trap;
- xFixed_1_16 h_top, h_trap, h_bot;
- xFixed_1_31 area;
-
- x_trap = WIDTH_AVG(x1,x2);
- h_top = y1;
- h_trap = (y2 - y1);
- h_bot = (bottom - y2);
-
- area = AREA_MULT(x1, h_top) +
- AREA_MULT(x_trap, h_trap) +
- AREA_MULT(x2, h_bot);
-
- return area;
- }
-
-To convert this xFixed_1_31 value to alpha using 32 bit arithmetic:
-
-int
-AreaAlpha (xFixed_1_31 area, int depth)
- {
- return ((area >> bits) * ((1 << depth) - 1)) >> (31 - depth);
- }
-
-Avoiding the branch bubble in the AREA_MULT could be done with either:
-
-area = (w * h + 1) >> 1;
-area |= ((area - 1) & 0x80000000);
-
-or
- #define AREA_MULT(w,h) ((((w)*(h) + 1) >> 1) | ((w)&(h)&0x10000) << 15)
-
-depending on your preference, the first takes one less operation but
-can't be expressed as a macro; the second takes a large constant which may
-require an additional instruction on some processors. The differences
-will be swamped by the cost of the multiply.
-
-*/
-
-#endif /* RENDER */
diff --git a/fb/fbutil.c b/fb/fbutil.c
deleted file mode 100644
index 54b88ad7e..000000000
--- a/fb/fbutil.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Id: fbutil.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbutil.c,v 1.5 2001/03/28 14:37:03 alanh Exp $ */
-
-#include "fb.h"
-
-FbBits
-fbReplicatePixel (Pixel p, int bpp)
-{
- FbBits b = p;
-
- b &= FbFullMask (bpp);
- while (bpp < FB_UNIT)
- {
- b |= b << bpp;
- bpp <<= 1;
- }
- return b;
-}
-
-void
-fbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp)
-{
- FbBits and, xor;
-
- switch (rop)
- {
- default:
- case GXclear: /* 0 0 0 0 */
- and = 0;
- xor = 0;
- break;
- case GXand: /* 0 0 0 1 */
- and = fg;
- xor = 0;
- break;
- case GXandReverse: /* 0 0 1 0 */
- and = fg;
- xor = fg;
- break;
- case GXcopy: /* 0 0 1 1 */
- and = 0;
- xor = fg;
- break;
- case GXandInverted: /* 0 1 0 0 */
- and = ~fg;
- xor = 0;
- break;
- case GXnoop: /* 0 1 0 1 */
- and = FB_ALLONES;
- xor = 0;
- break;
- case GXxor: /* 0 1 1 0 */
- and = FB_ALLONES;
- xor = fg;
- break;
- case GXor: /* 0 1 1 1 */
- and = ~fg;
- xor = fg;
- break;
- case GXnor: /* 1 0 0 0 */
- and = ~fg;
- xor = ~fg;
- break;
- case GXequiv: /* 1 0 0 1 */
- and = FB_ALLONES;
- xor = ~fg;
- break;
- case GXinvert: /* 1 0 1 0 */
- and = FB_ALLONES;
- xor = FB_ALLONES;
- break;
- case GXorReverse: /* 1 0 1 1 */
- and = ~fg;
- xor = FB_ALLONES;
- break;
- case GXcopyInverted: /* 1 1 0 0 */
- and = 0;
- xor = ~fg;
- break;
- case GXorInverted: /* 1 1 0 1 */
- and = fg;
- xor = ~fg;
- break;
- case GXnand: /* 1 1 1 0 */
- and = fg;
- xor = FB_ALLONES;
- break;
- case GXset: /* 1 1 1 1 */
- and = 0;
- xor = FB_ALLONES;
- break;
- }
- and |= ~pm;
- xor &= pm;
- *andp = and;
- *xorp = xor;
-}
-
-#define O 0
-#define I FB_ALLONES
-
-const FbMergeRopRec FbMergeRopBits[16] = {
- { O,O,O,O }, /* clear 0x0 0 */
- { I,O,O,O }, /* and 0x1 src AND dst */
- { I,O,I,O }, /* andReverse 0x2 src AND NOT dst */
- { O,O,I,O }, /* copy 0x3 src */
- { I,I,O,O }, /* andInverted 0x4 NOT src AND dst */
- { O,I,O,O }, /* noop 0x5 dst */
- { O,I,I,O }, /* xor 0x6 src XOR dst */
- { I,I,I,O }, /* or 0x7 src OR dst */
- { I,I,I,I }, /* nor 0x8 NOT src AND NOT dst */
- { O,I,I,I }, /* equiv 0x9 NOT src XOR dst */
- { O,I,O,I }, /* invert 0xa NOT dst */
- { I,I,O,I }, /* orReverse 0xb src OR NOT dst */
- { O,O,I,I }, /* copyInverted 0xc NOT src */
- { I,O,I,I }, /* orInverted 0xd NOT src OR dst */
- { I,O,O,I }, /* nand 0xe NOT src OR NOT dst */
- { O,O,O,I }, /* set 0xf 1 */
-};
-
-/*
- * Stipple masks are independent of bit/byte order as long
- * as bitorder == byteorder. FB doesn't handle the case
- * where these differ
- */
-#define BitsMask(x,w) ((FB_ALLONES << ((x) & FB_MASK)) & \
- (FB_ALLONES >> ((FB_UNIT - ((x) + (w))) & FB_MASK)))
-
-#define Mask(x,w) BitsMask((x)*(w),(w))
-
-
-#define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w))
-
-#define C1(b,w) \
- (SelMask(b,0,w))
-
-#define C2(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w))
-
-#define C4(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w) | \
- SelMask(b,2,w) | \
- SelMask(b,3,w))
-
-#define C8(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w) | \
- SelMask(b,2,w) | \
- SelMask(b,3,w) | \
- SelMask(b,4,w) | \
- SelMask(b,5,w) | \
- SelMask(b,6,w) | \
- SelMask(b,7,w))
-
-#if FB_UNIT == 16
-#define fbStipple16Bits 0
-#define fbStipple8Bits 0
-const FbBits fbStipple4Bits[16] = {
- C4( 0,4), C4( 1,4), C4( 2,4), C4( 3,4), C4( 4,4), C4( 5,4),
- C4( 6,4), C4( 7,4), C4( 8,4), C4( 9,4), C4( 10,4), C4( 11,4),
- C4( 12,4), C4( 13,4), C4( 14,4), C4( 15,4),};
-const FbBits fbStipple2Bits[4] = {
- C2( 0,8), C2( 1,8), C2( 2,8), C2( 3,8),
-};
-const FbBits fbStipple1Bits[2] = {
- C1( 0,16), C1( 1,16),
-};
-#endif
-#if FB_UNIT == 32
-#define fbStipple16Bits 0
-const FbBits fbStipple8Bits[256] = {
- C8( 0,4), C8( 1,4), C8( 2,4), C8( 3,4), C8( 4,4), C8( 5,4),
- C8( 6,4), C8( 7,4), C8( 8,4), C8( 9,4), C8( 10,4), C8( 11,4),
- C8( 12,4), C8( 13,4), C8( 14,4), C8( 15,4), C8( 16,4), C8( 17,4),
- C8( 18,4), C8( 19,4), C8( 20,4), C8( 21,4), C8( 22,4), C8( 23,4),
- C8( 24,4), C8( 25,4), C8( 26,4), C8( 27,4), C8( 28,4), C8( 29,4),
- C8( 30,4), C8( 31,4), C8( 32,4), C8( 33,4), C8( 34,4), C8( 35,4),
- C8( 36,4), C8( 37,4), C8( 38,4), C8( 39,4), C8( 40,4), C8( 41,4),
- C8( 42,4), C8( 43,4), C8( 44,4), C8( 45,4), C8( 46,4), C8( 47,4),
- C8( 48,4), C8( 49,4), C8( 50,4), C8( 51,4), C8( 52,4), C8( 53,4),
- C8( 54,4), C8( 55,4), C8( 56,4), C8( 57,4), C8( 58,4), C8( 59,4),
- C8( 60,4), C8( 61,4), C8( 62,4), C8( 63,4), C8( 64,4), C8( 65,4),
- C8( 66,4), C8( 67,4), C8( 68,4), C8( 69,4), C8( 70,4), C8( 71,4),
- C8( 72,4), C8( 73,4), C8( 74,4), C8( 75,4), C8( 76,4), C8( 77,4),
- C8( 78,4), C8( 79,4), C8( 80,4), C8( 81,4), C8( 82,4), C8( 83,4),
- C8( 84,4), C8( 85,4), C8( 86,4), C8( 87,4), C8( 88,4), C8( 89,4),
- C8( 90,4), C8( 91,4), C8( 92,4), C8( 93,4), C8( 94,4), C8( 95,4),
- C8( 96,4), C8( 97,4), C8( 98,4), C8( 99,4), C8(100,4), C8(101,4),
- C8(102,4), C8(103,4), C8(104,4), C8(105,4), C8(106,4), C8(107,4),
- C8(108,4), C8(109,4), C8(110,4), C8(111,4), C8(112,4), C8(113,4),
- C8(114,4), C8(115,4), C8(116,4), C8(117,4), C8(118,4), C8(119,4),
- C8(120,4), C8(121,4), C8(122,4), C8(123,4), C8(124,4), C8(125,4),
- C8(126,4), C8(127,4), C8(128,4), C8(129,4), C8(130,4), C8(131,4),
- C8(132,4), C8(133,4), C8(134,4), C8(135,4), C8(136,4), C8(137,4),
- C8(138,4), C8(139,4), C8(140,4), C8(141,4), C8(142,4), C8(143,4),
- C8(144,4), C8(145,4), C8(146,4), C8(147,4), C8(148,4), C8(149,4),
- C8(150,4), C8(151,4), C8(152,4), C8(153,4), C8(154,4), C8(155,4),
- C8(156,4), C8(157,4), C8(158,4), C8(159,4), C8(160,4), C8(161,4),
- C8(162,4), C8(163,4), C8(164,4), C8(165,4), C8(166,4), C8(167,4),
- C8(168,4), C8(169,4), C8(170,4), C8(171,4), C8(172,4), C8(173,4),
- C8(174,4), C8(175,4), C8(176,4), C8(177,4), C8(178,4), C8(179,4),
- C8(180,4), C8(181,4), C8(182,4), C8(183,4), C8(184,4), C8(185,4),
- C8(186,4), C8(187,4), C8(188,4), C8(189,4), C8(190,4), C8(191,4),
- C8(192,4), C8(193,4), C8(194,4), C8(195,4), C8(196,4), C8(197,4),
- C8(198,4), C8(199,4), C8(200,4), C8(201,4), C8(202,4), C8(203,4),
- C8(204,4), C8(205,4), C8(206,4), C8(207,4), C8(208,4), C8(209,4),
- C8(210,4), C8(211,4), C8(212,4), C8(213,4), C8(214,4), C8(215,4),
- C8(216,4), C8(217,4), C8(218,4), C8(219,4), C8(220,4), C8(221,4),
- C8(222,4), C8(223,4), C8(224,4), C8(225,4), C8(226,4), C8(227,4),
- C8(228,4), C8(229,4), C8(230,4), C8(231,4), C8(232,4), C8(233,4),
- C8(234,4), C8(235,4), C8(236,4), C8(237,4), C8(238,4), C8(239,4),
- C8(240,4), C8(241,4), C8(242,4), C8(243,4), C8(244,4), C8(245,4),
- C8(246,4), C8(247,4), C8(248,4), C8(249,4), C8(250,4), C8(251,4),
- C8(252,4), C8(253,4), C8(254,4), C8(255,4),
-};
-const FbBits fbStipple4Bits[16] = {
- C4( 0,8), C4( 1,8), C4( 2,8), C4( 3,8), C4( 4,8), C4( 5,8),
- C4( 6,8), C4( 7,8), C4( 8,8), C4( 9,8), C4( 10,8), C4( 11,8),
- C4( 12,8), C4( 13,8), C4( 14,8), C4( 15,8),};
-const FbBits fbStipple2Bits[4] = {
- C2( 0,16), C2( 1,16), C2( 2,16), C2( 3,16),
-};
-const FbBits fbStipple1Bits[2] = {
- C1( 0,32), C1( 1,32),
-};
-#endif
-#if FB_UNIT == 64
-const FbBits fbStipple16Bits[256] = {
- C8( 0,4), C8( 1,4), C8( 2,4), C8( 3,4), C8( 4,4), C8( 5,4),
- C8( 6,4), C8( 7,4), C8( 8,4), C8( 9,4), C8( 10,4), C8( 11,4),
- C8( 12,4), C8( 13,4), C8( 14,4), C8( 15,4), C8( 16,4), C8( 17,4),
- C8( 18,4), C8( 19,4), C8( 20,4), C8( 21,4), C8( 22,4), C8( 23,4),
- C8( 24,4), C8( 25,4), C8( 26,4), C8( 27,4), C8( 28,4), C8( 29,4),
- C8( 30,4), C8( 31,4), C8( 32,4), C8( 33,4), C8( 34,4), C8( 35,4),
- C8( 36,4), C8( 37,4), C8( 38,4), C8( 39,4), C8( 40,4), C8( 41,4),
- C8( 42,4), C8( 43,4), C8( 44,4), C8( 45,4), C8( 46,4), C8( 47,4),
- C8( 48,4), C8( 49,4), C8( 50,4), C8( 51,4), C8( 52,4), C8( 53,4),
- C8( 54,4), C8( 55,4), C8( 56,4), C8( 57,4), C8( 58,4), C8( 59,4),
- C8( 60,4), C8( 61,4), C8( 62,4), C8( 63,4), C8( 64,4), C8( 65,4),
- C8( 66,4), C8( 67,4), C8( 68,4), C8( 69,4), C8( 70,4), C8( 71,4),
- C8( 72,4), C8( 73,4), C8( 74,4), C8( 75,4), C8( 76,4), C8( 77,4),
- C8( 78,4), C8( 79,4), C8( 80,4), C8( 81,4), C8( 82,4), C8( 83,4),
- C8( 84,4), C8( 85,4), C8( 86,4), C8( 87,4), C8( 88,4), C8( 89,4),
- C8( 90,4), C8( 91,4), C8( 92,4), C8( 93,4), C8( 94,4), C8( 95,4),
- C8( 96,4), C8( 97,4), C8( 98,4), C8( 99,4), C8(100,4), C8(101,4),
- C8(102,4), C8(103,4), C8(104,4), C8(105,4), C8(106,4), C8(107,4),
- C8(108,4), C8(109,4), C8(110,4), C8(111,4), C8(112,4), C8(113,4),
- C8(114,4), C8(115,4), C8(116,4), C8(117,4), C8(118,4), C8(119,4),
- C8(120,4), C8(121,4), C8(122,4), C8(123,4), C8(124,4), C8(125,4),
- C8(126,4), C8(127,4), C8(128,4), C8(129,4), C8(130,4), C8(131,4),
- C8(132,4), C8(133,4), C8(134,4), C8(135,4), C8(136,4), C8(137,4),
- C8(138,4), C8(139,4), C8(140,4), C8(141,4), C8(142,4), C8(143,4),
- C8(144,4), C8(145,4), C8(146,4), C8(147,4), C8(148,4), C8(149,4),
- C8(150,4), C8(151,4), C8(152,4), C8(153,4), C8(154,4), C8(155,4),
- C8(156,4), C8(157,4), C8(158,4), C8(159,4), C8(160,4), C8(161,4),
- C8(162,4), C8(163,4), C8(164,4), C8(165,4), C8(166,4), C8(167,4),
- C8(168,4), C8(169,4), C8(170,4), C8(171,4), C8(172,4), C8(173,4),
- C8(174,4), C8(175,4), C8(176,4), C8(177,4), C8(178,4), C8(179,4),
- C8(180,4), C8(181,4), C8(182,4), C8(183,4), C8(184,4), C8(185,4),
- C8(186,4), C8(187,4), C8(188,4), C8(189,4), C8(190,4), C8(191,4),
- C8(192,4), C8(193,4), C8(194,4), C8(195,4), C8(196,4), C8(197,4),
- C8(198,4), C8(199,4), C8(200,4), C8(201,4), C8(202,4), C8(203,4),
- C8(204,4), C8(205,4), C8(206,4), C8(207,4), C8(208,4), C8(209,4),
- C8(210,4), C8(211,4), C8(212,4), C8(213,4), C8(214,4), C8(215,4),
- C8(216,4), C8(217,4), C8(218,4), C8(219,4), C8(220,4), C8(221,4),
- C8(222,4), C8(223,4), C8(224,4), C8(225,4), C8(226,4), C8(227,4),
- C8(228,4), C8(229,4), C8(230,4), C8(231,4), C8(232,4), C8(233,4),
- C8(234,4), C8(235,4), C8(236,4), C8(237,4), C8(238,4), C8(239,4),
- C8(240,4), C8(241,4), C8(242,4), C8(243,4), C8(244,4), C8(245,4),
- C8(246,4), C8(247,4), C8(248,4), C8(249,4), C8(250,4), C8(251,4),
- C8(252,4), C8(253,4), C8(254,4), C8(255,4),
-};
-const FbBits fbStipple8Bits[256] = {
- C8( 0,8), C8( 1,8), C8( 2,8), C8( 3,8), C8( 4,8), C8( 5,8),
- C8( 6,8), C8( 7,8), C8( 8,8), C8( 9,8), C8( 10,8), C8( 11,8),
- C8( 12,8), C8( 13,8), C8( 14,8), C8( 15,8), C8( 16,8), C8( 17,8),
- C8( 18,8), C8( 19,8), C8( 20,8), C8( 21,8), C8( 22,8), C8( 23,8),
- C8( 24,8), C8( 25,8), C8( 26,8), C8( 27,8), C8( 28,8), C8( 29,8),
- C8( 30,8), C8( 31,8), C8( 32,8), C8( 33,8), C8( 34,8), C8( 35,8),
- C8( 36,8), C8( 37,8), C8( 38,8), C8( 39,8), C8( 40,8), C8( 41,8),
- C8( 42,8), C8( 43,8), C8( 44,8), C8( 45,8), C8( 46,8), C8( 47,8),
- C8( 48,8), C8( 49,8), C8( 50,8), C8( 51,8), C8( 52,8), C8( 53,8),
- C8( 54,8), C8( 55,8), C8( 56,8), C8( 57,8), C8( 58,8), C8( 59,8),
- C8( 60,8), C8( 61,8), C8( 62,8), C8( 63,8), C8( 64,8), C8( 65,8),
- C8( 66,8), C8( 67,8), C8( 68,8), C8( 69,8), C8( 70,8), C8( 71,8),
- C8( 72,8), C8( 73,8), C8( 74,8), C8( 75,8), C8( 76,8), C8( 77,8),
- C8( 78,8), C8( 79,8), C8( 80,8), C8( 81,8), C8( 82,8), C8( 83,8),
- C8( 84,8), C8( 85,8), C8( 86,8), C8( 87,8), C8( 88,8), C8( 89,8),
- C8( 90,8), C8( 91,8), C8( 92,8), C8( 93,8), C8( 94,8), C8( 95,8),
- C8( 96,8), C8( 97,8), C8( 98,8), C8( 99,8), C8(100,8), C8(101,8),
- C8(102,8), C8(103,8), C8(104,8), C8(105,8), C8(106,8), C8(107,8),
- C8(108,8), C8(109,8), C8(110,8), C8(111,8), C8(112,8), C8(113,8),
- C8(114,8), C8(115,8), C8(116,8), C8(117,8), C8(118,8), C8(119,8),
- C8(120,8), C8(121,8), C8(122,8), C8(123,8), C8(124,8), C8(125,8),
- C8(126,8), C8(127,8), C8(128,8), C8(129,8), C8(130,8), C8(131,8),
- C8(132,8), C8(133,8), C8(134,8), C8(135,8), C8(136,8), C8(137,8),
- C8(138,8), C8(139,8), C8(140,8), C8(141,8), C8(142,8), C8(143,8),
- C8(144,8), C8(145,8), C8(146,8), C8(147,8), C8(148,8), C8(149,8),
- C8(150,8), C8(151,8), C8(152,8), C8(153,8), C8(154,8), C8(155,8),
- C8(156,8), C8(157,8), C8(158,8), C8(159,8), C8(160,8), C8(161,8),
- C8(162,8), C8(163,8), C8(164,8), C8(165,8), C8(166,8), C8(167,8),
- C8(168,8), C8(169,8), C8(170,8), C8(171,8), C8(172,8), C8(173,8),
- C8(174,8), C8(175,8), C8(176,8), C8(177,8), C8(178,8), C8(179,8),
- C8(180,8), C8(181,8), C8(182,8), C8(183,8), C8(184,8), C8(185,8),
- C8(186,8), C8(187,8), C8(188,8), C8(189,8), C8(190,8), C8(191,8),
- C8(192,8), C8(193,8), C8(194,8), C8(195,8), C8(196,8), C8(197,8),
- C8(198,8), C8(199,8), C8(200,8), C8(201,8), C8(202,8), C8(203,8),
- C8(204,8), C8(205,8), C8(206,8), C8(207,8), C8(208,8), C8(209,8),
- C8(210,8), C8(211,8), C8(212,8), C8(213,8), C8(214,8), C8(215,8),
- C8(216,8), C8(217,8), C8(218,8), C8(219,8), C8(220,8), C8(221,8),
- C8(222,8), C8(223,8), C8(224,8), C8(225,8), C8(226,8), C8(227,8),
- C8(228,8), C8(229,8), C8(230,8), C8(231,8), C8(232,8), C8(233,8),
- C8(234,8), C8(235,8), C8(236,8), C8(237,8), C8(238,8), C8(239,8),
- C8(240,8), C8(241,8), C8(242,8), C8(243,8), C8(244,8), C8(245,8),
- C8(246,8), C8(247,8), C8(248,8), C8(249,8), C8(250,8), C8(251,8),
- C8(252,8), C8(253,8), C8(254,8), C8(255,8),
-};
-const FbBits fbStipple4Bits[16] = {
- C4( 0,16), C4( 1,16), C4( 2,16), C4( 3,16), C4( 4,16), C4( 5,16),
- C4( 6,16), C4( 7,16), C4( 8,16), C4( 9,16), C4( 10,16), C4( 11,16),
- C4( 12,16), C4( 13,16), C4( 14,16), C4( 15,16),};
-const FbBits fbStipple2Bits[4] = {
- C2( 0,32), C2( 1,32), C2( 2,32), C2( 3,32),
-};
-#define fbStipple1Bits 0
-#endif
-const FbBits * const fbStippleTable[] = {
- 0,
- fbStipple1Bits,
- fbStipple2Bits,
- 0,
- fbStipple4Bits,
- 0,
- 0,
- 0,
- fbStipple8Bits,
-};
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
deleted file mode 100644
index 262716543..000000000
--- a/fb/fbwindow.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.11 2003/11/10 18:21:47 tsi Exp $ */
-
-#include "fb.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#endif
-
-Bool
-fbCreateWindow(WindowPtr pWin)
-{
-#ifndef FB_NO_WINDOW_PIXMAPS
- pWin->devPrivates[fbWinPrivateIndex].ptr =
- (pointer) fbGetScreenPixmap(pWin->drawable.pScreen);
-#endif
-#ifdef FB_SCREEN_PRIVATE
- if (pWin->drawable.bitsPerPixel == 32)
- pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
-#endif
- return TRUE;
-}
-
-Bool
-fbDestroyWindow(WindowPtr pWin)
-{
- return TRUE;
-}
-
-Bool
-fbMapWindow(WindowPtr pWindow)
-{
- return TRUE;
-}
-
-Bool
-fbPositionWindow(WindowPtr pWin, int x, int y)
-{
- return TRUE;
-}
-
-Bool
-fbUnmapWindow(WindowPtr pWindow)
-{
- return TRUE;
-}
-
-void
-fbCopyWindowProc (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- while (nbox--)
- {
- fbBlt (src + (pbox->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
-
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
-
- (pbox->x2 - pbox->x1) * dstBpp,
- (pbox->y2 - pbox->y1),
-
- GXcopy,
- FB_ALLONES,
- dstBpp,
-
- reverse,
- upsidedown);
- pbox++;
- }
-}
-
-void
-fbCopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- RegionRec rgnDst;
- int dx, dy;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
-
- REGION_NULL (pWin->drawable.pScreen, &rgnDst);
-
- REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- fbCopyRegion ((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- 0,
- &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
-
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- fbValidateDrawable (&pWin->drawable);
-}
-
-Bool
-fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
- PixmapPtr pPixmap;
-
- if (mask & CWBackPixmap)
- {
- if (pWin->backgroundState == BackgroundPixmap)
- {
- pPixmap = pWin->background.pixmap;
-#ifdef FB_24_32BIT
- if (pPixmap->drawable.bitsPerPixel != pWin->drawable.bitsPerPixel)
- {
- pPixmap = fb24_32ReformatTile (pPixmap,
- pWin->drawable.bitsPerPixel);
- if (pPixmap)
- {
- (*pWin->drawable.pScreen->DestroyPixmap) (pWin->background.pixmap);
- pWin->background.pixmap = pPixmap;
- }
- }
-#endif
- if (FbEvenTile (pPixmap->drawable.width *
- pPixmap->drawable.bitsPerPixel))
- fbPadPixmap (pPixmap);
- }
- }
- if (mask & CWBorderPixmap)
- {
- if (pWin->borderIsPixel == FALSE)
- {
- pPixmap = pWin->border.pixmap;
-#ifdef FB_24_32BIT
- if (pPixmap->drawable.bitsPerPixel !=
- pWin->drawable.bitsPerPixel)
- {
- pPixmap = fb24_32ReformatTile (pPixmap,
- pWin->drawable.bitsPerPixel);
- if (pPixmap)
- {
- (*pWin->drawable.pScreen->DestroyPixmap) (pWin->border.pixmap);
- pWin->border.pixmap = pPixmap;
- }
- }
-#endif
- if (FbEvenTile (pPixmap->drawable.width *
- pPixmap->drawable.bitsPerPixel))
- fbPadPixmap (pPixmap);
- }
- }
- return TRUE;
-}
-
-void
-fbFillRegionSolid (DrawablePtr pDrawable,
- RegionPtr pRegion,
- FbBits and,
- FbBits xor)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- while (n--)
- {
- fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- and, xor);
- fbValidateDrawable (pDrawable);
- pbox++;
- }
-}
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-void
-fbFillRegionTiled (DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
- int tileWidth, tileHeight;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
- int xRot = pDrawable->x;
- int yRot = pDrawable->y;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- {
- int index = pDrawable->pScreen->myNum;
- if(&WindowTable[index]->drawable == pDrawable)
- {
- xRot -= panoramiXdataPtr[index].x;
- yRot -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- xRot += dstXoff;
- yRot += dstYoff;
-
- while (n--)
- {
- fbTile (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- tile,
- tileStride,
- tileWidth * dstBpp,
- tileHeight,
- GXcopy,
- FB_ALLONES,
- dstBpp,
- xRot * dstBpp,
- yRot - pbox->y1);
- pbox++;
- }
-}
-
-void
-fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- WindowPtr pBgWin;
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- fbFillRegionTiled (&pWin->drawable,
- pRegion,
- pWin->background.pixmap);
- break;
- case BackgroundPixel:
- fbFillRegionSolid (&pWin->drawable,
- pRegion,
- 0,
- fbReplicatePixel (pWin->background.pixel,
- pWin->drawable.bitsPerPixel));
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- fbFillRegionSolid (&pWin->drawable,
- pRegion,
- 0,
- fbReplicatePixel (pWin->border.pixel,
- pWin->drawable.bitsPerPixel));
- }
- else
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- fbFillRegionTiled (&pBgWin->drawable,
- pRegion,
- pWin->border.pixmap);
- }
- break;
- }
- fbValidateDrawable (&pWin->drawable);
-}
diff --git a/hw/darwin/XDarwin.man b/hw/darwin/XDarwin.man
deleted file mode 100644
index a718e41ce..000000000
--- a/hw/darwin/XDarwin.man
+++ /dev/null
@@ -1,205 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.4 2002/01/09 18:01:58 torrey Exp $
-.\"
-.TH XDARWIN 1 __vendorversion__
-.SH NAME
-XDarwin \- X window system server for Darwin operating system
-.SH SYNOPSIS
-.B XDarwin
-[ options ] ...
-.SH DESCRIPTION
-#ifdef DARWIN_WITH_QUARTZ
-.I XDarwin
-is the X window server for Mac OS X and the Darwin operating system
-provided by the XFree86 Project.
-.I XDarwin
-can run in three different modes. On Mac OS X,
-.I XDarwin
-runs in parallel with Aqua in full screen or rootless modes. These modes
-are called Quartz modes, named after the Quartz 2D compositing engine used
-by Aqua. XDarwin can also be run from the Darwin text console in IOKit mode.
-.PP
-When running from the console,
-.I XDarwin
-acts as the window server and uses IOKit services to access the display
-framebuffer, mouse and keyboard and to provide a layer of hardware
-abstraction. In console mode,
-.I XDarwin
-will normally be started by the \fIxdm(1)\fP display manager or by a script
-that runs the program \fIxinit(1)\fP.
-.PP
-When running with the Mac OS X Aqua GUI,
-.I XDarwin
-will normally be started by launching from the Finder, but it may also be
-started from the command line with the \fB\-quartz\fP, \fB\-fullscreen\fP, or
-\fB\-rootless\fP options. Note that the defaults for various command line
-options are set by the
-.I XDarwin
-application preferences in the Quartz modes.
-.PP
-In full screen Quartz mode, when the X Window System is active, it takes over
-the entire screen. CoreGraphics is used to capture and draw to the screen. The
-.I XDarwin
-application allows easy switching between the Mac OS X and X window
-desktops. More information is available in the Help menu of the
-.I XDarwin
-application.
-.PP
-In rootless mode, the X window system and Aqua share your display. The root
-window of the X11 display is the size of the screen and contains all the
-other windows. The X11 root window is not displayed in rootless mode as Aqua
-handles the desktop background.
-#else
-.I XDarwin
-is the X window server for Mac OS X and the Darwin operating system
-provided by the XFree86 Project. This version of
-.I XDarwin
-can only be started from the Darwin text console. The Mac OS X Aqua GUI, if
-present, must be shut down.
-.I XDarwin
-uses IOKit services to access the display
-framebuffer, mouse and keyboard and to provide a layer of hardware
-abstraction.
-.I XDarwin
-will normally be started by the \fIxdm(1)\fP display manager or by a script
-that runs the program \fIxinit(1)\fP.
-#endif
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXDarwin\fP accepts the following command line switches:
-.TP 8
-.B \-fakebuttons
-Emulates a 3 button mouse using modifier keys. By default, the Command modifier
-is used to emulate button 2 and Option is used for button 3. Thus, clicking the
-first mouse button while holding down Command will act like clicking
-button 2. Holding down Option will simulate button 3.
-.TP 8
-.B \-nofakebuttons
-Do not emulate a 3 button mouse. This is the default.
-.TP 8
-.B "\-fakemouse2 \fImodifiers\fP"
-Change the modifier keys used to emulate the second mouse button. By default,
-Command is used to emulate the second button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse2 """Option,Shift""
-will set holding Option, Shift and clicking on button one as equivalent to
-clicking the second mouse button.
-.TP 8
-.B "\-fakemouse3 \fImodifiers\fP"
-Change the modifier keys used to emulate the third mouse button. By default,
-Option is used to emulate the third button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse3 """Control,Shift""
-will set holding Control, Shift and clicking on button one as equivalent to
-clicking the third mouse button.
-.TP 8
-.B "\-keymap \fIfile\fP"
-On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
-The default is to read this keymapping from USA.keymapping. With this option
-the keymapping will be read from \fIfile\fP instead. If the file's path is
-not specified, it will be searched for in Library/Keyboards/ underneath the
-following directories (in order): ~, /, /Network, /System.
-.TP 8
-.B \-nokeymap
-On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
-With this option XDarwin queries the kernel for the current keymapping
-instead of reading it from a file. This will often fail on newer kernels.
-#ifdef DARWIN_WITH_QUARTZ
-.TP 8
-.B "\-size \fIwidth\fP \fIheight\fP"
-Sets the screen resolution for the X server to use.
-Ignored in rootless mode.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
-per pixel are supported.
-Ignored in rootless mode.
-.TP 8
-.B "\-refresh \fIrate\fP"
-Gives the refresh rate to use in Hz. For LCD displays this should be 0.
-Ignored in rootless mode.
-.TP 8
-.B \-fullscreen
-Run full screen in parallel with Mac OS X Aqua GUI.
-.TP 8
-.B \-rootless
-Run rootless inside Mac OS X Aqua GUI.
-.TP 8
-.B \-quartz
-Run in parallel with the Mac OS X Aqua GUI using the default mode.
-#else
-.TP 8
-.B "\-size \fIwidth\fP \fIheight\fP"
-Sets the screen resolution for the X server to use.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
-per pixel are supported.
-.TP 8
-.B "\-refresh \fIrate\fP"
-Gives the refresh rate to use in Hz. For LCD displays this should be 0.
-#endif
-.TP 8
-.B \-showconfig
-Print out the server version and patchlevel.
-.TP 8
-.B \-version
-Same as \fB\-showconfig\fP.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), XFree86(1), Xserver(1), xdm(1), xinit(1)
-.SH BUGS
-.I XDarwin
-and this man page still have many limitations. Some of the more obvious
-ones are:
-.br
-- The display mode cannot be changed once the X server has started.
-.br
-- A screen saver is not supported.
-.PP
-.SH AUTHORS
-XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
-Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
-Torrey T. Lyons improved and integrated this code into the XFree86
-Project's mainline for the 4.0.2 release.
-.PP
-The following members of the XonX Team contributed to the following
-releases (in alphabetical order):
-.TP 4
-XFree86 4.1.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - Cocoa version of XDarwin front end
-.br
-Gregory Robert Parker - Original Quartz implementation
-.br
-Christoph Pfisterer - Dynamic shared X libraries
-.br
-Toshimitsu Tanaka - Japanese localization
-.TP 4
-XFree86 4.2.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Pablo Di Noto - Spanish localization
-.br
-Paul Edens - Dutch localization
-.br
-Kyunghwan Kim - Korean localization
-.br
-Mario Klebsch - Non-US keyboard support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - German localization
-.br
-Patrik Montgomery - Swedish localization
-.br
-Greg Parker - Rootless support
-.br
-Toshimitsu Tanaka - Japanese localization
-.br
-Olivier Verdier - French localization
diff --git a/hw/darwin/bundle/Dutch.lproj/Credits.rtf b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
deleted file mode 100644
index 3cd250116..000000000
--- a/hw/darwin/bundle/Dutch.lproj/Credits.rtf
+++ /dev/null
@@ -1,124 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
deleted file mode 100644
index 6abd91072..000000000
--- a/hw/darwin/bundle/Dutch.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 034396156..000000000
--- a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index e7ca52c2c..000000000
--- a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/19 01:21:32 torrey Exp $ --> #include "xf86Version.h" #ifndef PRE_RELEASE #define PRE_RELEASE XF86_VERSION_SNAP #endif <html> <head> <title>XFree86 voor Mac OS X</title> </head> <body> <center> <h1>XFree86 voor Darwin en Mac OS X</h1> XFree86 XF86_VERSION<br> Release Date: XF86_REL_DATE </center> <h2>Inhoud</h2> <ol> <li><A HREF="#notice">Belangrijke Informatie</A></li> <li><A HREF="#usage">Gebruik</A></li> <li><A HREF="#path">Instellen van het Path</A></li> <li><A HREF="#prefs">Voorkeursinstellingen</A></li> <li><A HREF="#license">Licentie</A></li> </ol> <center> <h2><a NAME="notice">Belangrijke Informatie</a></h2> </center> <blockquote> #if PRE_RELEASE Dit is een pre-release van XFree86, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of in de <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>. #else Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. #endif </blockquote> <blockquote> Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote> <h2><a NAME="usage">Gebruik</a></h2> <p>XFree86 is een open-source uitvoering van het <a HREF="http://www.x.org/">X Window Systeem</a>, verzorgd door <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>, die vrij verspreid mag worden. De X window server voor Darwin en Mac OS X verzorgd door XFree86 heet XDarwin. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p> <p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p> <p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p> <h3>Meerknopsmuis emulatie</h3> <p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p> <h2><a NAME="path">Instellen van het Path</a></h2> <p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p> <p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p> <p>Het kan handig zijn de man pages voor XFree86 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p> <h2><a NAME="prefs">Voorkeursinstellingen</a></h2> <p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p> <h3>Algemeen</h3> <ul> <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li> <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li> <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li> </ul> <h3>Start</h3> <ul> <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li> <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li> <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li> <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li> <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li> <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li> </ul> <h3>Schermvullend</h3> <ul> <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li> <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li> <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li> <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li> </ul> <h2><a NAME="license">Licentie</a></h2> The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>. <H3><A NAME="3"></A>X Consortium License</H3> <p>Copyright (C) 1996 X Consortium</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> <p>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</p> <p>X Window System is a trademark of X Consortium, Inc.</p> </body> </html> \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/Credits.rtf b/hw/darwin/bundle/English.lproj/Credits.rtf
deleted file mode 100644
index 4e2fad42c..000000000
--- a/hw/darwin/bundle/English.lproj/Credits.rtf
+++ /dev/null
@@ -1,138 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2.99.x:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f1\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index 99211244e..000000000
--- a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* English versions of the Info.plist keys; used by most localizations. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.4 2003/01/15 02:34:04 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2003 XFree86 Project, Inc.__quote__;
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
deleted file mode 100644
index 241d1585b..000000000
--- a/hw/darwin/bundle/English.lproj/Localizable.strings
+++ /dev/null
@@ -1,23 +0,0 @@
-/* English localized versions of strings used by the Mac OS X front end. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.4 2003/11/04 22:48:14 torrey Exp $ */
-
-/* Title of alert panel */
-"Quit X server?" = "Quit X server?";
-
-/* Text of alert panel */
-"Quitting the X server will terminate any running X Window System programs." = "Quitting the X server will terminate any running X Window System programs.";
-
-/* Quit */
-"Quit" = "Quit";
-
-/* Cancel */
-"Cancel" = "Cancel";
-
-/* Default keymapping file */
-"USA.keymapping" = "USA.keymapping";
-
-/* Default switch string */
-"Cmd-Opt-a" = "Cmd-Opt-a";
-
-/* Button title when changing switch key */
-"Press key" = "Press key";
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 5aa102278..000000000
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index fc11e26d3..000000000
--- a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<title>XFree86 for Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 on Darwin and Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Release Date: XF86_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-
-<h2><a NAME="usage">Usage</a></h2>
-<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
-="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
-<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
-<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
-
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
-<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
-<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
-
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<h3>General</h3>
-<ul>
- <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
- <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
- <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
-</ul>
-<h3>Start Up</h3>
-<ul>
- <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
- <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
- <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
- <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
- <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
- <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
-</ul>
-<h3>Full Screen</h3>
-<ul>
- <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
- <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
-</ul>
-
-<h2><a NAME="license">License</a></h2>
-The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
-License page</A>.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/French.lproj/Credits.rtf b/hw/darwin/bundle/French.lproj/Credits.rtf
deleted file mode 100644
index 5e52d1177..000000000
--- a/hw/darwin/bundle/French.lproj/Credits.rtf
+++ /dev/null
@@ -1,123 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 Participants \'88 XonX pour XFree86 4.2 :
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Version pour Darwin x86
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Traduction en espagnol
-\f1\i0 \
-Paul Edens\
-
-\f2\i Traduction en allemand
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Traduction en cor\'8een
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Claviers non-US
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Direction du projet
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Traduction en allemand
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Traduction en su\'8edois
-\f1\i0 \
-Greg Parker\
-
-\f2\i Version \'c7 rootless \'c8
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Traduction en japonais
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i Traduction en fran\'8dais
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Remerciements :
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman et Zero G Software, Inc.\
-
-\f2\i Installeur
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Participants \'88 XonX pour XFree86 4.2 :
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Version pour Darwin x86
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Direction du projet
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Version Cocoa de l'interface de XDarwin
-\f1\i0 \
-Greg Parker\
-
-\f2\i Impl\'8ementation initiale sur Quartz
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Librairies partag\'8ees dynamiquement
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Traduction en japonais
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Remerciements :
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
- Ic\'99ne
-\f2\i XDarwin
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Historique :
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i Adaptation de Free86 4.0 pour Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
deleted file mode 100644
index 21c4a99c1..000000000
--- a/hw/darwin/bundle/French.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index ef15f00f1..000000000
--- a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 0fdfb01fb..000000000
--- a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/20 06:42:20 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
-<title>XFree86 pour Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 pour Darwin et Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Date : XF86_REL_DATE
-</center>
-<h2>Sommaire</h2>
-<ol>
- <li><A HREF="#notice">Avertissement</A></li>
- <li><A HREF="#usage">Utilisation</A></li>
- <li><A HREF="#path">Chemins d'accès</A></li>
- <li><A HREF="#prefs">Préférences</A></li>
- <li><A HREF="#license">Licence</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Avertissement</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Ceci est une pré-version de XFree86 et ne fait par conséquent l'objet d'aucun support client. Les bogues peuvent être signalés et des patches peuvent être soumis sur la
-<A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge. Veuillez prendre connaissance de la dernière version sur <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ou sur le <A HREF="http://www.XFree86.Org/cvs">répertoire CVS de XFree86</A> avant de signaler un bogue d'une pré-version.
-#else
-Si le serveur date de plus de 6-12 mois ou si votre matériel est plus récent que la date indiquée ci-dessus, veuillez vous procurer une version plus récente avant de signaler toute anomalie. Les bogues peuvent être signalés et des patches peuvent être soumis sur la <A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Ce logiciel est distribué sous la
-<A HREF="#license">Licence du Consortium X/X11 du MIT</A> et est fourni TEL QUEL, sans garanties. Veuillez prendre connaissance de la <A HREF="#license">Licence</A> avant toute utilisation.</blockquote>
-
-<h2><a NAME="usage">Utilisation</a></h2>
-<p>XFree86 est une implémentation libre et distribuable sans contrainte du <a HREF
-="http://www.x.org/">X Window System</a> produit par <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> Le serveur X window pour Darwin et Mac OS X fourni par XFree86 se nomme XDarwin. XDarwin fonctionne sous Mac OS X en mode « rootless » ou plein écran.</p>
-<p>Lorsque le système X window est actif en mode plein écran, il prend en charge la totalité de l'écran. Il est possible de revenir sur le bureau de Mac OS X en appuyant sur Commande-Option-A. Cette combinaison de touches peut être modifiée dans les préférences. Pour revenir dans X window, cliquer sur l'icône de XDarwin dans le Dock de Mac OS X. (Un réglage des préférences permet d'effectuer cette opération en cliquant dans une fenêtre flottante au lieu de l'icône du Dock)</p>
-<p>En mode « rootless », X window system et Aqua utilisent le même affichage. La fenêtre-mère de l'affichage X11 est de la taille de l'écran et contient toutes les autre fenêtres. En mode « rootless » cette fenêtre-mère n'est pas affichée car Aqua gère le fond d'écran.</p>
-<h3>Émulation de souris à plusieurs boutons</h3>
-<p>Le fonctionnement de la plupart des applications X11 repose sur l'utilisation d'une souris à 3 boutons. Il est possible d'émuler une souris à 3 boutons avec un seul bouton en appuyant sur des touches de modification. Ceci est réglé dans la section "Émulation de souris à plusieurs boutons" de l'onglet "Général" des préférences. L'émulation est activée par défaut. Dans ce cas, cliquer en appuyant simultanément sur la touche "commande" simulera le bouton du milieu. Cliquer en appuyant simultanément sur la touche "option" simulera le bouton de droite. Les préférences permettent de régler n'importe quelle combinaison de touches de modification pour émuler les boutons du milieu et de droite. Notez que même si les touches de modifications sont mises en correspondance avec d'autres touches par xmodmap, ce sont les touches originelles spécifiées dans les préférences qui assureront l'émulation d'une souris à plusieurs boutons.
-
-<h2><a NAME="path">Réglage du chemin d'accès</a></h2>
-<p>Le chemin d'accès est une liste de répertoires utilisés pour la recherche d'exécutables. Les commandes X11 sont situées dans <code>/usr/X11R6/bin</code>, qui doit être ajouté à votre chemin d'accès. XDarwin fait cela par défaut, et peut également ajouter d'autres répertoires dans lesquels vous auriez installé d'autre commandes unix.</p>
-<p>Les utilisateurs plus expérimentés auront déjà réglé leur chemin d'accès correctement par le biais des fichiers d'initialisation de leur shell. Dans ce cas, il est possible de demander à XDarwin de ne pas modifier le chemin d'accès initial. XDarwin lance les premiers clients X11 dans le shell d'ouverture de session par défaut. (Un shell de remplacement peut être spécifié dans les préférences.) La façon de régler le chemin d'accès dépend du shell utilisé. Ceci est documenté dans les pages "man" du shell.</p>
-<p>De plus, il est possible d'ajouter les pages "man" de XFree86 à la liste des pages recherchées pour la documentation "man". Les pages "man" X11 se trouvent dans <code>/usr/X11R6/man</code> et la variable d'environnement <code>MANPATH</code> contient la liste des répertoires dans lesquels chercher.</p>
-
-
-<h2><a NAME="prefs">Préférences</a></h2>
-<p>Un certain nombre d'options peuvent être réglées dans les préférences. On accède aux préférences en choisissant "Préférences..." dans le menu "XDarwin". Les options décrites comme options de démarrage ne prendront pas effet avant le redémarrage de XDarwin. Les autres options prennent immédiatement effet. Les différentes options sont détaillées ci-après :</p>
-<h3>Général</h3>
-<ul>
- <li><b>Utiliser le bip d'alerte Système dans X11 :</b> Cocher cette option pour que le son d'alerte standard de Mac OS X soit utilisé à la place du son d'alerte de X11. L'option n'est pas cochée ar défaut. Dans ce cas, un simple signal sonore est utilisé.</li>
- <li><b>Autoriser X11 à changer la vitesse de la souris :</b> Dans une implémentation classique du sytème X window, le gestionnaire de fenêtres peut modifier la vitesse de la souris. Cela peut s'avérer déroutant puisque le réglage de la vitesse de la souris peut être différent dans les préférences de Mac OS X et dans le gestionnaire X window. Par défaut, X11 n'est pas autorisé à changer la vitesse de la souris.</li>
- <li><b>Émulation de souris à plusieurs boutons :</b> Ceci est décrit ci-dessus à la rubrique <a HREF="#usage">Usage</a>. Lorsque l'émulation est activée, il suffit d'appuyer simultanément sur les touches modificatrices sélectionnées et sur le bouton de la souris afin d'émuler les boutons du milieu et de droite.</li>
-</ul>
-<h3>Démarrage</h3>
-<ul>
- <li><b>Mode par défaut :</b> Le mode spécifié à cet endroit sera utilisé si l'utilisateur ne l'indique pas au démarrage.</li>
- <li><b>Choix du mode d'affichage au démarrage</b> Par défaut, une fenêtre de dialogue est affichée au démarrage de XDarwin pour permettre à l'utilisateur de choisir entre le mode plein écran et le mode « rootless ». Si cette option est désactivée, le mode par défaut sera automatiquement utilisé.</li>
- <li><b>Numéro d'affichage (Display)</b> X11 offre la possibilité de plusieurs serveurs X sur un ordinateur. L'utilisateur doit spécifier ici le numéro d'affichage utilisé par XDarwin dans le cas où plusieurs serveurs X seraient en service simultanément.</li>
- <li><b>Autoriser la prise en charge Xinerama de plusieurs moniteurs :</b> XDarwin peut être utilisé avec plusieurs moniteur avec Xinerama, qui considère les différents moniteurs comme des parties d'un écran rectugulaire plus grand. Cette option permet de désactiver Xinerama mais XDarwin ne prend alors pour l'instant pas correctement en charge l'affichage sur plusieurs écrans. Si il n'y a qu'un seul moniteur, Xinerama est automatiquement désactivé.</li>
- <li><b>Fichier clavier :</b> Un fichier de correspondance de clavier est lu au démarrage puis transformé en un fihcier de correspondance clavier pour X11. Les fichiers de correspondance clavier, disponibles pour de nombreuses langues, se trouvent dans <code>/System/Library/Keyboards</code>.</li>
- <li><b>Démarrage des premiers clients X11 :</b> Lorsque XDarwin est démarré à partir du Finder, il lance <code>xinit</code> qui lance à son tour le gestionnaire X window ainsi que d'autres clients X. (Voir "<code>man xinit</code>" pour plus d'informations.) Avant de lancer <code>xinit</code>, XDarwin ajoute les répertoires ainsi spécifiés au chemin d'accès de l'utilisateur. Par défaut, seul <code>/usr/X11R6/bin</code> est ajouté. Il est possible d'ajouter d'autres répertoires en les séparants à l'aide de deux points (<code>:</code>). Les clients X sont démarrés à partir du shell par défaut de l'utilisateur. Ainsi, le fichier d'initialisation de shell de l'utilisateur est lu. Un autre shell peut éventuellement être spécifié.</li>
-</ul>
-<h3>Plein écran</h3>
-<ul>
- <li><b>Combinaison de touches :</b> Appuyer sur ce bouton, puis appuyer sur une ou plusieurs touches modificatrices suivies d'une touche ordinaire. Cette combinaison de touche servira à commuter entre Aqua et X11.</li>
- <li><b>Basculer dans X11 en cliquant sur l'icône du Dock :</b> Cette option permet de passer dans X11 en cliquant dans l'icône de XDarwin dans le Dock. Sur certaines versions de Mac OS X, la commutation en utilisant le Dock peut faire disparaître le curseur lors du retour dans Aqua.</li>
- <li><b>Afficher l'aide du mode plein écran au démarrage :</b> Permet l'affichage d'une fenêtre d'introduction lorsque XDarwin est démarré en mode plein écran.</li>
- <li><b>Profondeur de couleur :</b> En mode plein écran, l'affichage X11 peut utiliser une autre profondeur de couleur que celle employée par Aqua. Si "Actuelle" est choisi, XDarwin utilisera la même profondeur de couleur qu'Aqua. Les autres choix sont 8 (256 couleurs), 15 (milliers de couleurs) et 24 bits (millions de couleurs). </li>
-</ul>
-
-<h2><a NAME="license">Licence</a></h2>
-The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
-License page</A>.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
-
diff --git a/hw/darwin/bundle/German.lproj/Credits.rtf b/hw/darwin/bundle/German.lproj/Credits.rtf
deleted file mode 100644
index 3cd250116..000000000
--- a/hw/darwin/bundle/German.lproj/Credits.rtf
+++ /dev/null
@@ -1,124 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
deleted file mode 100644
index 5db6306ec..000000000
--- a/hw/darwin/bundle/German.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index d3e7c5d57..000000000
--- a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 6b1b91f5c..000000000
--- a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp,v 1.1 2001/11/03 00:25:34 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<title>XFree86 for Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 on Darwin and Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Release Date: XF86_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-<h2><a NAME="usage">Usage</a></h2>
-<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
-="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> XFree86 runs on Mac OS X in full screen mode. When the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, just click on the XDarwin icon in the floating switch window to switch back to the X window system. You can change this behavior in the user preferences so that clicking on the XDarwin icon in the Dock switches as well.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p>
-<p>Notes:</p>
-<ul>
- <li>With most keyboards the left and right command and option keys are not differentiated so either will work.
- <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation.
- <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button.
-</ul>
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. The following directions are for tcsh, which is the default shell on Darwin and Mac OS X.</p>
-<p>You can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to the file ~/Library/init/tcsh/path: (You may need to create this file and directory path if it does not exist already.)</p>
-<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote>
-<p>Note that if you have created a .cshrc or .tcshrc file, these files will override your settings in ~/Library/init/tcsh/ and you will need to change one of these files instead. These changes will not take effect until you open a new Terminal window. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p>
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed under Startup Options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<ul>
- <li>Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li>Use System beep for X11: When enabled the standard Mac OS X alert sound is used as X11 bell. When disabled (default) a simple tone is used.</li>
- <li>Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li>Show help on startup: This will show the introductory splash screen when XDarwin is launched.</li>
- <li>Display number: This sets what X display number XDarwin should assign to the display. Note that XDarwin always takes over the main display when showing X11.</li>
- <li>Keymapping: By default, XDarwin loads the keymapping from the Darwin kernel on startup. On portables, this keymapping is sometimes empty so that the keyboard will appear to be dead in X11. If "Load from file" is selected, XDarwin will load the keymapping from the specified file instead.</li>
-</ul>
-<h2><a NAME="license">License</a></h2>
-The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
-License page</A>.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
deleted file mode 100644
index 6b1f82d8a..000000000
--- a/hw/darwin/bundle/Japanese.lproj/Credits.rtf
+++ /dev/null
@@ -1,135 +0,0 @@
-{\rtf1\mac\ansicpg10001\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-\f3\fnil\fcharset78 HiraKakuPro-W3;}
-{\colortbl;\red255\green255\blue255;}
-\vieww13980\viewh11160\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
- Darwin x86
-\f2\i
-\f3\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Pablo Di Noto\
-
-\f2\i
-\f3\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Paul Edens\
-
-\f2\i
-\f3\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Kyunghwan Kim\
-
-\f2\i
-\f3\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Mario Klebsch\
-
-\f3 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Torrey T. Lyons\
-
-\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
-\f1 \
-Andreas Monitzer\
-
-\f3 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Patrik Montgomery\
-
-\f2\i
-\f3\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Greg Parker\
-
-\f3 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-
-\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
-\f1 \
-
-\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Olivier Verdier\
-
-\f2\i
-\f3\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i
-\f3\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
- Darwin x86
-\f3 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Torrey T. Lyons\
-
-\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
-\f1 \
-Andreas Monitzer\
- Cocoa
-\f3 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68
-\f1 \
-Greg Parker\
-
-\f3 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67
-\f1 \
-Christoph Pfisterer\
-
-\f3 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a
-\f1 \
-
-\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
-\f1 \
-
-\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
- XDarwin
-\f3 \'83\'41\'83\'43\'83\'52\'83\'93
-\f1 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f3 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41
-\f1 \
-Dave Zarzycki\
- XFree86 4.0
-\f3 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41
-\f1 \
-Torrey T. Lyons\
- XFree86 4.0.2
-\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
deleted file mode 100644
index c5c26d61a..000000000
--- a/hw/darwin/bundle/Japanese.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index fbfb4dd42..000000000
--- a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 2065d43d4..000000000
--- a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.5 2002/05/04 01:25:40 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
-<title>
-XFree86 for Mac OS X</title></head>
-<body>
-<center>
- <h1>XFree86 on Darwin and Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Release Date: XF86_REL_DATE
-</center>
-<h2>Ìܼ¡</h2>
-<ol>
- <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li>
- <li><A HREF="#usage">»ÈÍÑË¡</A></li>
- <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li>
- <li><A HREF="#prefs">´Ä¶­ÀßÄê</A></li>
- <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
-¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
-#else
-¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-#endif
-</blockquote>
-<blockquote>
-ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
-¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆɤ߲¼¤µ¤¤¡£
-</blockquote>
-
-<h2><a NAME="usage">»ÈÍÑË¡</a></h2>
-<p>XFree86 ¤Ï¡¤<a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¼ÂÁõ¤Ç¤¹¡£
-XFree86 ¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë Darwin ¤È Mac OS X ¤Î¤¿¤á¤Î X Window ¥µ¡¼¥Ð¡¼¤ò XDarwin ¤È¸Æ¤Ó¤Þ¤¹¡£
-XDarwin ¤Ï¡¤Mac OS X ¾å¤Ç¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£</p>
-
-<p>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
-Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é X Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
-¡Ê´Ä¶­ÀßÄê¤Ç¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë</p>
-
-<p>¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤È Aqua ¤Ï²èÌ̤ò¶¦Í­¤·¤Þ¤¹¡£
-X11 ¤¬É½¼¨¤¹¤ë¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï²èÌ̤Υµ¥¤¥º¤Ç¤¢¤ê¡¤Â¾¤ÎÁ´¤Æ¤Î¥¦¥£¥ó¥É¥¦¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-Aqua ¤¬¥Ç¥¹¥¯¥È¥Ã¥×¤ÎÇطʤòÀ©¸æ¤¹¤ë¤Î¤Ç¡¤X11 ¤Î¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£</p>
-
-<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3>
-<p>¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ÈƱ»þ¤Ë¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¤°ì¤Ä¤Î¥Ü¥¿¥ó¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¤´Ä¶­ÀßÄê¤Î¡Ö°ìÈÌÀßÄê¡×¤Î¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤ÇÀßÄꤷ¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ÏÍ­¸ú¤Ç¡¤¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
-¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¡¤´Ä¶­ÀßÄê¤Ç¥Ü¥¿¥ó 2 ¤È 3 ¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë½¤¾þ¥­¡¼¤ÎÁȹ礻¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-Ãí¡§½¤¾þ¥­¡¼¤ò xmodmap ¤Ç¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£</p>
-
-<h2><a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a></h2>
-<p>¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
-X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤<code>/usr/X11R6/bin</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-XDarwin ¤Ï¡¤¤³¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¹Ô¤¤¤Þ¤¹¡£¤Þ¤¿¡¤¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ÄɲäΥǥ£¥ì¥¯¥È¥ê¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</p>
-
-<p>·Ð¸³Ë­¤«¤Ê¥æ¡¼¥¶¡¼¤Ï¡¤¤¹¤Ç¤Ë¼«¤é¤Î¥·¥§¥ë¤Î¤¿¤á¤Ë½é´ü²½¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ¥Ñ¥¹¤òÀßÄꤷ¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¡£
-¤³¤Î¾ì¹ç¡¤¤¢¤Ê¤¿¤Ï´Ä¶­ÀßÄê¤Ç XDarwin ¤¬¤¢¤Ê¤¿¤Î¥Ñ¥¹¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-XDarwin ¤Ï¡¤¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤ÇºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤·¤Þ¤¹¡£
-¡Ê´Ä¶­ÀßÄê¤ÇÂå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë
-¥Ñ¥¹¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¤¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¤¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-<p>¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï <code>/usr/X11R6/man</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ <code>MANPATH</code> ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£</p>
-
-<h2><a NAME="prefs">´Ä¶­ÀßÄê</a></h2>
-<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë´Ä¶­ÀßÄê¥Ñ¥Í¥ë¤Ç¡¤¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
-¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
-°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p>
-
-<h3>°ìÈÌÀßÄê</h3>
-<ul>
- <li><b>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
- <li><b>X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë:</b> ɸ½àŪ¤Ê X Window System ¤Î¼ÂÁõ¤Ç¤Ï¡¤¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤Ï¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
- ¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤Ë Mac OS X ¤Î¥·¥¹¥Æ¥à´Ä¶­ÀßÄê¤È X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤¬°Û¤Ê¤ëÃͤòÀßÄꤷ¤¿¾ì¹ç¡¤¤³¤ì¤Ïº®Íð¤ò¾·¤­¤Þ¤¹¡£
- ¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤È¤·¤Þ¤»¤ó¡£</li>
- <li><b>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó:</b> <a HREF="#usage">»ÈÍÑË¡</a>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¥ª¥ó¤Î¾ì¹ç¡¤¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Âè 2 ¤Þ¤¿¤ÏÂè 3 ¤Î¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë»þ¤Ë¡¤ÁªÂò¤·¤¿½¤¾þ¥­¡¼¤òƱ»þ¤Ë²¡¤·¤Þ¤¹¡£</li>
-</ul>
-
-<h3>µ¯Æ°¥ª¥×¥·¥ç¥ó</h3>
-<ul>
- <li><b>²èÌ̥⡼¥É:</b> ¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
- <li><b>µ¯Æ°»þ¤Ë¥â¡¼¥ÉÁªÂò¥Ñ¥Í¥ë¤òɽ¼¨¤¹¤ë:</b> ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Îµ¯Æ°»þ¤Ë¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤òÁªÂò¤¹¤ë¥Ñ¥Í¥ë¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥ª¥Õ¤Î¾ì¹ç¡¤²èÌ̥⡼¥É¤Ç»ØÄꤷ¤¿¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£</li>
- <li><b>X11 ¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ:</b> X11¤Ï¡¤°ì¤Ä¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤ÇÊÌ¡¹¤Î X ¥µ¡¼¥Ð¡¼¤¬´ÉÍý¤¹¤ëÊ£¿ô¤Î¥Ç¥£¥¹¥×¥ì¥¤¤¬Â¸ºß¤¹¤ë¤³¤È¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î X ¥µ¡¼¥Ð¡¼¤¬Æ±»þ¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»þ¡¤XDarwin ¤¬»ÈÍѤ¹¤ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
- <li><b>Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë:</b> XDarwin ¤Ï¡¤Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤½¤ì¤ÏÁ´¤Æ¤Î¥â¥Ë¥¿¤ò°ì¤Ä¤ÎÂ礭¤Ê²èÌ̤ΰìÉô¤È¤ß¤Ê¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç Xinerama ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¤¸½ºß XDarwin ¤Ï¤½¤ì̵¤·¤ÇÀµ¤·¤¯Ê£¿ô¤Î¥â¥Ë¥¿¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤â¤·¡¤¤¢¤Ê¤¿¤¬°ì¤Ä¤Î¥â¥Ë¥¿¤ò»È¤¦¤À¤±¤Ê¤é¤Ð¡¤Xinerama ¤Ï¼«Æ°Åª¤Ë̵¸ú¤È¤Ê¤ê¤Þ¤¹¡£</li>
- <li><b>¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë:</b> ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ïµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¡¤X11 ¥­¡¼¥Þ¥Ã¥×¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Â¾¸À¸ì¤ËÂбþ¤·¤¿¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ï <code>/System/Library/Keyboards</code> ¤Ë¤¢¤ê¤Þ¤¹¡£¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤°ìÉô¤Î¥­¡¼¤¬¸ú¤«¤Ê¤¤Åù¤ÎÉÔ¶ñ¹ç¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li>
- <li><b>ºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°:</b> XDarwin ¤¬ Finder¤«¤éµ¯Æ°¤¹¤ë»þ¡¤X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤È X ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¡Ê¾ÜºÙ¤Ï "<code>man xinit</code>" ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¡ËXDarwin ¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¤ËÄɲä·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï <code>/usr/X11R6/bin</code> ¤À¤±¤òÄɲä·¤Þ¤¹¡£Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï¡¤¥³¥í¥ó¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£¥æ¡¼¥¶¡¼¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤¿¤á¤Ë¡¤X ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥í¥°¥¤¥ó¥·¥§¥ë¤Çµ¯Æ°¤µ¤ì¤Þ¤¹¡£É¬ÍפǤ¢¤ì¤Ð¡¤Âå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
-</ul>
-
-<h3>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó</h3>
-<ul>
- <li><b>¥­¡¼ÀßÄê¥Ü¥¿¥ó:</b> X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ü¥¿¥ó¤ÎÁȤ߹ç¤ï¤»¤ò»ØÄꤷ¤Þ¤¹¡£
- ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤Ç¤°Õ¤Î¿ô¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£</li>
- <li><b>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀڤ괹¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£Mac OS X ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç Aqua ¤ËÌá¤Ã¤¿»þ¡¤¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li>
- <li><b>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë:</b> XDarwin ¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë»þ¡¤¥¹¥×¥é¥Ã¥·¥å¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li>
- <li><b>¿§¿¼ÅÙ:</b> ¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X11 ¥Ç¥£¥¹¥×¥ì¥¤¤¬ Aqua ¤È°Û¤Ê¤ë¿§¿¼ÅÙ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡ÖÊѹ¹¤Ê¤·¡×¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤XDarwin ¤Ï Aqua ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¿§¿¼ÅÙ¤ò»È¤¤¤Þ¤¹¡£¤³¤ì°Ê³°¤Ë 8¡¤15 ¤Þ¤¿¤Ï24 ¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
-</ul>
-
-<h2>
-<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
-</h2>
-XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£
-»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£
-¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
-¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-<H3>
-<A NAME="3"></A>
-X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
deleted file mode 100644
index cbf13779f..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
+++ /dev/null
@@ -1,139 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5340\viewh4520\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 Contribuidores do XonX ao XFree86 4.2.99.x:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro
-\f0\b \
-
-\f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\i0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Contribuidores do XonX ao XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Suporte para o Darwin x86\
-
-\f1\i0 Pablo Di Noto\
-
-\f2\i Localiza\'8d\'8bo para o Espanhol
-\f1\i0 \
-Paul Edens\
-
-\f2\i Localiza\'8d\'8bo para o Holand\'90s
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Localiza\'8d\'8bo para o Coreano
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Suporte para teclados Non-US
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i L\'92der de Projeto
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Localiza\'8d\'8bo para o Alem\'8bo
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Localiza\'8d\'8bo para o Sueco
-\f1\i0 \
-Greg Parker\
-
-\f2\i Suporte ao modo Compartilhado (Rootless)
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Localiza\'8d\'8bo para o Japon\'90s
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Agradecimentos Especiais:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Instalador
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Membros do Time XonX\
-Contribuindo com o XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Suporte ao Darwin x86\
-
-\f1\i0 Torrey T. Lyons\
-
-\f2\i L\'92der de Projeto
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Vers\'8bo Cocoa da interface XDarwin
-\f1\i0 \
-Greg Parker\
-
-\f2\i Implementa\'8d\'8bo Original
-\f1\i0
-\f2\i ao Quartz \
-
-\f1\i0 Christoph Pfisterer\
-
-\f2\i Bibliotecas Din\'89micas Compartilhadas
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Localiza\'8d\'8bo para o Japon\'90s
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Agradecimento Especial:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i \'eacone do XDarwin
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Hist\'97rico:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Suporte Original do XFree86 no Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i Suporte ao
-\f1\i0
-\f2\i XFree86 4.0 no Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
deleted file mode 100644
index c79b282f6..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 4b7736a12..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 37502eac6..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp,v 1.1 2002/01/25 06:46:46 torrey Exp $ --><html><body>
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-
-<head>
-<title>XFree86 para Mac OS X</title>
-</head>
-
-<center>
-
- <h1>XFree86 para Darwin e Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Release Date: XF86_REL_DATE
-</center>
-<h2>&Iacute;ndice</h2>
-<ol>
- <li><A HREF="#notice">Notas importantes</A></li>
- <li><A HREF="#usage">Uso</A></li>
- <li><A HREF="#path">Ajustando seu Path</A></li>
-
- <li><A HREF="#prefs">Prefer&ecirc;ncias do usu&aacute;rio</A></li>
- <li><A HREF="#license">Licen&ccedil;a</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Notas importantes</a></h2>
-</center>
-<blockquote> #if PRE_RELEASE Essa &eacute; uma vers&atilde;o pr&eacute;-lancamento
- do XFree86, e ela n&atilde;o &eacute; suportada de nenhuma forma. Bugs podem
- ser reportados e corre&ccedil;&otilde;es podem ser enviadas para <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina
- do projeto XonX</A> no SourceForge. Antes de informar bugs em vers&otilde;es
- pr&eacute;-lancamento, por favor verifique a þltima vers&atilde;o em <A HREF="http://sourceforge.net/projects/xonx/">XonX</A>
- or no <A HREF="http://www.XFree86.Org/cvs">Reposit&oacute;rio CVS do XFree86</A>.
- #else Se o servidor &eacute; mais velho que 6-12 semanas, ou seu hardware &eacute;
- mais novo que a data acima, procure por uma nova vers&atilde;o antes de informar
- problemas. Bugs podem ser reportados e corre&ccedil;&otilde;es podem ser enviadas
- para a <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina do projeto
- XonX</A> na SourceForge. #endif </blockquote>
-<blockquote> Este software &eacute; distribu&iacute;do sob os termos da <a href="#license">licen&ccedil;a
- MIT X11 / X Consortium</a> e &eacute; provido, sem nenhuma garantia. Por favor
- leia a <a href="#license">Licen&ccedil;a</a> antes de come&ccedil;ar a usar
- o programa.</blockquote>
-
-<h2><a NAME="usage">Uso</a></h2>
-<p>O XFree86 &eacute; uma aplica&ccedil;&atilde;o &quot;open-source&quot; livremente
- redistribu&iacute;da do <a HREF
-="http://www.x.org/">Sistema X Window</a> produzido pelo <a HREF="http://www.XFree86.Org/">XFree86
- Project, Inc.</a> O servidor X window para o Darwin e Mac OS X provido pelo
- XFree86 &eacute; chamado XDarwin. XDarwin roda sobre Mac OS X no modo Tela Cheia
- ou no modo Compartilhado.</p>
-<p>No modo Tela Cheia, quando o sistema X window est&aacute; ativo, ele ocupa
- a tela toda. Voc&ecirc; pode voltar ao desktop do Mac OS X clicando Command-Option-A.
- Essa combina&ccedil;&atilde;o de teclas pode ser mudada nas prefer&ecirc;ncias.
- Pelo desktop Mac OS X, clique no &iacute;cone XDarwin no Dock para voltar ao
- sistema X window. (Voc&ecirc; pode mudar esse comportamento nas prefer&ecirc;ncias
- da&iacute; voc&ecirc; dever&aacute; clicar no &iacute;cone XDarwin na janela
- flutuante que aparecer&aacute;.)</p>
-<p>No modo Compartilhado, o sistema X window e Aqua dividem a mesma tela. A janela
- raiz da tela X11 est&aacute; do tamanho da tela (monitor) e cont&eacute;m todas
- as outras janelas. A janela raiz do X11 no modo compartilhado n&atilde;o &eacute;
- mostrada pois o Aqua controla o fundo de tela.</p>
-<h3>Emula&ccedil;&atilde;o de Mouse Multi-Bot&otilde;es</h3>
-<p>Muitas aplica&ccedil;&otilde;es X11 insistem em usar um mouse de 3 bot&otilde;es.
- Voc&ecirc; pode emular um mouse de 3 bot&otilde;es com um simples bot&atilde;o,
- mantendo pressionando teclas modificadoras enquanto voc&ecirc; clica no bot&atilde;o
- do mouse. Isto &eacute; controlado pela configura&ccedil;&atilde;o da &quot;Emula&ccedil;&atilde;o
- de Mouse Multi-Bot&otilde;es&quot; da prefer&ecirc;ncia &quot;Geral&quot;. Por
- padr&atilde;o, a emula&ccedil;&atilde;o est&aacute; habilitada e mantendo pressionada
- a tecla Command e clicando no bot&atilde;o do mouse ele simular&aacute; o clique
- no segundo bot&atilde;o do mouse. Mantendo pressionada a tecla Option e clicando
- no bot&atilde;o do mouse ele simular&aacute; o terceiro bot&atilde;o. Voc&ecirc;
- pode mudar a combina&ccedil;&atilde;o de teclas modificadoras para emular os
- bot&otilde;es dois e tr&ecirc;s nas prefer&ecirc;ncias. Nota, se a tecla modificadora
- foi mapeada para alguma outra tecla no xmodmap, voc&ecirc; ainda ter&aacute;
- que usar a tecla atual especificada nas prefer&ecirc;ncias para a emula&ccedil;&atilde;o
- do mouse multi-bot&otilde;es.</p>
-<h2><a NAME="path">Ajustando seu Path</a></h2>
-<p>Seu path &eacute; a lista de diret&oacute;rios a serem procurados por arquivos
- execut&aacute;veis. O comando X11 est&aacute; localizado em <code>/usr/X11R6/bin</code>,
- que precisa ser adicionado ao seu path. XDarwin faz isso para voc&ecirc; por
- padr&atilde;o e pode-se tamb&eacute;m adicionar diret&oacute;rios onde voc&ecirc;
- instalou aplica&ccedil;&otilde;es de linha de comando.</p>
-<p>Usu&aacute;rios experientes j&aacute; ter&atilde;o configurado corretamente
- seu path usando arquivos de inicializa&ccedil;&atilde;o de seu shell. Neste
- caso, voc&ecirc; pode informar o XDarwin para n&atilde;o modificar seu path
- nas prefer&ecirc;ncias. O XDarwin inicia o cliente inicial X11 no shell padr&atilde;o
- do usu&aacute;rio corrente. (Um shell alternativo pode ser tamb&eacute;m expecificado
- nas prefer&ecirc;ncias.) O modo para ajustar o path depende do shell que voc&ecirc;
- est&aacute; usando. Isto &eacute; descrito na man page do seu shell.</p>
-<p>Voc&ecirc; pode tamb&eacute;m querer adicionar as man pages do XFree86 para
- a lista de p&aacute;ginas a serem procuradas quando voc&ecirc; est&aacute; procurando
- por documenta&ccedil;&atilde;o. As man pages do X11 est&atilde;o localizadas
- em <code>/usr/X11R6/man</code> e a vari&aacute;vel de ambiente <code>MANPATH</code>
- cont&eacute;m a lista de diret&oacute;rios a buscar.</p>
-<h2><a NAME="prefs">Prefer&ecirc;ncias do Usu&aacute;rio</a></h2>
-<p>V&aacute;rias op&ccedil;&otilde;es podem ser ajustadas nas prefer&ecirc;ncias
- do usu&aacute;rio, acess&iacute;vel pelo item &quot;Prefer&ecirc;ncias...&quot;
- no menu &quot;XDarwin&quot;. As op&ccedil;&otilde;es listadas como op&ccedil;&otilde;es
- de inicializa&ccedil;&atilde;o, n&atilde;o ter&atilde;o efeito at&eacute; voc&ecirc;
- reiniciar o XDarwin. Todas as outras op&ccedil;&otilde;es ter&atilde;o efeito
- imediatamente. V&aacute;rias das op&ccedil;&otilde;es est&atilde;o descritas
- abaixo:</p>
-<h3>Geral</h3>
-<ul>
- <li><b>Usar o Beep do Sistema para o X11: </b>Quando habilitado som de alerta
- padr&atilde;o do Mac OS X ser&aacute; usado como alerta no X11. Quando desabilitado
- (padr&atilde;o) um tom simples ser&aacute; usado.</li>
- <li><b>Permitir o X11 mudar a acelera&ccedil;&atilde;o do mouse: </b>Por implementa&ccedil;&atilde;o
- padr&atilde;o no sistema X window, o gerenciador de janelas pode mudar a acelera&ccedil;&atilde;o
- do mouse. Isso pode gerar uma confus&atilde;o pois a acelera&ccedil;&atilde;o
- do mouse pode ser ajustada diferentemente nas prefer&ecirc;ncias do Mac OS
- X e nas prefer&ecirc;ncias do X window. Por padr&atilde;o, o X11 n&atilde;o
- est&aacute; habilitado a mudar a acelera&ccedil;&atilde;o do mouse para evitar
- este problema.</li>
- <li><b>Emula&ccedil;&atilde;o de Mouse de Multi-Bot&otilde;es: </b>Esta op&ccedil;&atilde;o
- est&aacute; escrita acima em <a href="#usage">Uso</a>. Quando a emula&ccedil;&atilde;o
- est&aacute; habilitada as teclas modificadoras selecionadas tem que estar
- pressionadas quando o bot&atilde;o do mouse for pressionado, para emular o
- segundo e terceiro bot&otilde;es.</li>
-</ul>
-<h3>Inicial</h3>
-<ul>
- <li><b>Modo Padr&atilde;o: </b>Se o usu&aacute;rio n&atilde;o indicar qual modo
- de exibi&ccedil;&atilde;o quer usar (Tela Cheia ou Compartilhado) o modo especificado
- aqui ser&aacute; usado .</li>
- <li><b>Mostrar o painel de escolha na inicializa&ccedil;&atilde;o: </b> Por
- padr&atilde;o, uma painel &eacute; mostrado quando o XDarwin &eacute;
- iniciado para permitir que o usu&aacute;rio escolha ente o modo tela cheia
- ou modo compartilhado. Se esta op&ccedil;&atilde;o estiver desligada, o modo
- padr&atilde;o ser&aacute; inicializado automaticamente.</li>
- <li><b>N&uacute;mero do Monitor X11: </b>O X11 permite ser administrado em multiplos
- monitores por servidores X separados num mesmo computador. O usu&aacute;rio
- pode indicar o n&uacute;mero do monitor para o XDarwin usar se mais de um
- servidor X se estiver rodando simultaneamente.</li>
- <li><b>Habilitar suporte a m&uacute;ltiplos monitores pelo Xinerama: </b>o XDarwin
- suporta m&uacute;ltiplos monitores com o Xinerama, que trata todos os monitores
- como parte de uma grande e retangular tela. Voc&ecirc; pode desabilitar o
- Xinerama com est&aacute; op&ccedil;&atilde;o, mas normalmente o XDarwin n&atilde;o
- controla m&uacute;ltiplos monitores corretamente sem est&aacute; op&ccedil;&atilde;o.
- Se voc&ecirc; s&oacute; tiver um monotor, Xinerama &eacute; automaticamente
- desabilitado. </li>
- <li><b>Arquivo de Mapa de Teclado: </b> O mapa de teclado &eacute; lido na inicializa&ccedil;&atilde;o
- e traduzido para um mapa de teclado X11. Arquivos de mapa de teclado, est&atilde;o
- dispon&iacute;veis numa grande variedade de l&iacute;nguas e s&atilde;o encontradas
- em <code>/System/Library/Keyboards</code>.</li>
- <li><b>Iniciando Clientes X11 primeiro: </b>Quando o XDrawin &eacute; inicializado
- pelo Finder, ele ir&aacute; rodar o <code>xinit</code> para abrir o controlador
- X window e outros clientes X. (Veja o manual "<code>man xinit</code>" para
- mais informa&ccedil;&otilde;es.) Antes do XDarwin rodar o <code>xinit</code>
- ele ir&aacute; adicionar espec&iacute;ficos diret&oacute;rios a seu path.
- Por padr&atilde;o somente o <code>/usr/X11R6/bin</code> &eacute; adicionado.
- separado por um ponto-e-v&iacute;rgula. Os clientes X s&atilde;o inicializados
- no shell padr&atilde;o do usu&aacute;rio e os arquivos de inicializa&ccedil;&atilde;o
- do shell ser&atilde;o lidos. Se desejado, um shell alternativo pode ser especificado.</li>
-</ul>
-<h3>Tela Cheia</h3>
-<ul>
- <li><b>Bot&atilde;o de Combina&ccedil;&atilde;o de Teclas: </b> Clique no bot&atilde;o
- e pressione qualquer quantidade de teclas modificadoras seguidas por uma tecla
- padr&atilde;o para modificar a combina&ccedil;&atilde;o quando se quer mudar
- entre o Aqua e X11.</li>
- <li><b>Clique no &Iacute;cone no Dock para mudar para o X11: </b>Habilitando
- esta op&ccedil;&atilde;o voc&ecirc; ir&aacute; ativar a mudan&ccedil;a para
- o X11 clicando no &iacute;cone do XDarwin no Dock. Em algumas vers&otilde;es
- do Mac OS X, mudando pelo clique no Dock pode causar o desaparecimento do
- cursor quando retornar ao Aqua.</li>
- <li><b>Mostrar a Ajuda na inicializa&ccedil;&atilde;o: </b>Isto ir&aacute; mostrar
- uma tela introdut&oacute;ria quando o XDarwin for inicializado no modo Tela
- Cheia. </li>
- <li><b>Profundidade de Cores em bits: </b> No modo Tela Cheia, a tela do X11
- pode usar uma profundiadde de cor diferente da usada no Aqua. Se a op&ccedil;&atilde;o
- &quot;Atual&quot; est&aacute; especificada, a profundidade usada pelo Aqua
- quando o XDarwin iniciar ser&aacute; a mesma. Al&eacute;m das op&ccedil;&otilde;es
- 8, 15 ou 24 bits que podem ser especificadas.</li>
-</ul>
-
-<h2><a NAME="license">Licen&ccedil;a</a></h2>
-<p>O projeto XFree86 &eacute; designado a prover e a ser livremente redistribu&iacute;do
- as vers&otilde;es bin&aacute;rias e souce (c&oacute;digo-fonte). A licen&ccedil;a
- principal n&oacute;s usamos uma baseada na licen&ccedil;a tradicional MIT X11
- / X Consortium, que n&atilde;o imp&otilde;e nenhuma condi&ccedil;&atilde;o sobre
- modifica&ccedil;&otilde;es ou redistribui&ccedil;&atilde;o do c&oacute;digo-fonte
- ou dos bin&aacute;rios desde que o copyright/licen&ccedil;a sejam mantidos intactos.
- Para mais informa&ccedil;&otilde;es e not&iacute;cias adicionais de copyright/licensing
- em algumas se&ccedil;&atilde;o do c&oacute;digo, por favor visite a <a href="http://www.xfree86.org/legal/licence.html">p&aacute;gina
- de licen&ccedil;as do XFree86</a>.</p>
-<H3><A NAME="3"></A>Licen&ccedil;a do X Consortium</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permiss&otilde;es s&atilde;o em virtude garantidas, livre de mudan&ccedil;as,
- para qualquer pessoa que possua uma c&oacute;pia deste software e aos arquivos
- de documenta&ccedil;&atilde;o associada (o &quot;Software&quot;), para lidar
- com o software sem restri&ccedil;&otilde;es, incluindo limita&ccedil;&otilde;es
- dos direitos de uso, c&oacute;pia, modifica&ccedil;&atilde;o, inclus&atilde;o,
- publica&ccedil;&atilde;o, distribui&ccedil;&atilde;o, sub licen&ccedil;a, e/ou
- venda de c&oacute;pias deste Software, e permitir pessoas to whom o Software
- &eacute; fornecido para ser desta forma, verifique as seguintes condi&ccedil;&otilde;es:</p>
-<p>O nota de copyright abaixo e a permiss&atilde;o dever&atilde;o ser inclu&iacute;das
- em todas as c&oacute;pias ou substanciais por&ccedil;&otilde;es do Software.</p>
-<p>O SOFTWARE 'E PROVIDO &quot;COMO TAL&quot;, SEM GARANTIAS DE NENHUM TIPO, EXPLICITA
- OU IMPLICITA, INCLUINDO MAS N&Atilde;O LIMITADO NOS AVISOS DE COM&Eacute;RCIO,
- TAMANHO OU PARA PROPOSTAS PARTICULARES E N&Atilde;O INFRA&Ccedil;&Atilde;O.
- EM NENHUM ACONTECIMENTO O X CONSORTIUM SER&Aacute; RESPONSAV&Eacute;L POR NENHUMA
- RECLAMA&Ccedil;&Atilde;O, DANOS OU OUTRAS RESPONSABILIDADES, SE NUMA A&Ccedil;&Atilde;O
- DE CONTRATO, OU OUTRA COISA, SURGINDO DE, FORA DE OU EM CONEX&Atilde;O COM O
- SOFTWARE OU O USO OU OUTRO MODO DE LIDAR COM O SOFTWARE.</p>
-<p>Exceto o contido nesta nota, o nome do X Consortium n&atilde;o pode ser usado
- em propagandas ou outra forma de promo&ccedil;&atilde;o de vendas, uso ou outro
- modo de lidar com este Software sem ter recebido uma autoriza&ccedil;&atilde;o
- escrita pelo X Consortium.</p>
-<p>O Sistema X Window &eacute; marca registrada do X Consortium, Inc.</p>
-</body>
-</html>
-
diff --git a/hw/darwin/bundle/Spanish.lproj/Credits.rtf b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
deleted file mode 100644
index 3cd250116..000000000
--- a/hw/darwin/bundle/Spanish.lproj/Credits.rtf
+++ /dev/null
@@ -1,124 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
deleted file mode 100644
index 5bf813f1f..000000000
--- a/hw/darwin/bundle/Spanish.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 83647d675..000000000
--- a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 3e0710a2c..000000000
--- a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/30 03:52:27 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<title>XFree86 para Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 en Darwin y Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Fecha de release: XF86_REL_DATE
-</center>
-<h2>Contenido</h2>
-<ol>
- <li><A HREF="#notice">Aviso Importante</A></li>
- <li><A HREF="#usage">Modo de uso</A></li>
- <li><A HREF="#path">Configurando su Path</A></li>
- <li><A HREF="#prefs">Preferencias del Usuario</A></li>
- <li><A HREF="#license">Licencia</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Aviso Importante</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Esta es una versi&oacuten pre-release de XFree86, y no tiene ning&uacuten soporte. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge. Antes de reportar errores en versiones pre-release, por favor verifique la ultima versi&oacuten en <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> o bien en el <A HREF="http://www.XFree86.Org/cvs">repositorio CVS de XFree86</A>.
-#else
-Si el server el m&aacutes antiguo que 6 a 12 meses, o si su hardware es posterior a la fecha indicada m&aacutes arriba, por favor verifique la &uacuteltima versi&oacuten antes de reportar problemas. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Este software es distribuido bajo los t&eacuterminos de la <A HREF="#license">Licencia MIT X11 / X Consortium</A> y es provisto sin garant&iacutea alguna y en el estado en que se encuentra. Por favor lea la <A HREF="#license">Licencia</A> antes de utilizarlo.</blockquote>
-
-<h2><a NAME="usage">Modo de uso</a></h2>
-<p>XFree86 es una implementaci&oacuten open-source de distribuci&oacuten libre del <a HREF
-="http://www.x.org/">X Window System</a> producido por <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> El window server para Darwin y Mac OS X provisto por XFree86 se llama XDarwin. XDarwin funciona en Mac OS X en modo pantalla completa o en modo rootless (integrado al escritorio).</p>
-<p>En modo pantalla completa, el X window system toma control total de la pantalla mientras esta activo. Presionando Command-Option-A puede regresar al Escritorio de Mac OS X. Esta combinaci&oacuten de teclas puede cambiarse en las Preferencias de Usuario. Desde el Escritorio de Mac OS X, haga click en &iacutecono de XDarwin en el Dock para volver al X window system. (Puede cambiar esta comportamiento en las Preferencias de Usuario y configurar que XDarwin vuelva al X window system haciendo click en la ventana flotante con el logo X.)</p>
-<p>En modo rootless, el X window system comparte la pantalla con Aqua. La ventana root de X11 es del tama&ntildeo de la pantalla y contiene a todas las dem&aacutes ventanas. La ventana root de X11 no se muestra en este modo, ya que Aqua maneja el fondo de pantalla.</p>
-<h3>Emulaci&oacuten de mouse multi-bot&oacuten</h3>
-<p>Muchas aplicaciones X11 requieren del uso de un mouse de 3 botones. Es posible emular un mouse de 3 botones con un mouse de solo un bot&oacuten presionando teclas modificadoras mientras hace click. Esto es controlado en de la seccion "Emulaci&oacuten mouse" dentro de la secci&oacuten "General" de las Preferencias del Usuario. Por defecto, la emulaci&oacuten est&aacute activa y utiliza la tecla Command para simular el 2do bot&oacuten y la tecla Option para simlar el 3er bot&oacuten. La conbinaci&oacuten para simular el 2do y 3er bot&oacuten pueden ser modificada por cualquier combinaci&oacuten de teclas modificadoras dentro de las Preferencias del Usuario. Tenga en cuenta que aunque las teclas modificadoras hayan sido mapeadas a otras teclas con xmodmap, las teclas configuradas en las Preferencias del Usuario seguir&aacuten siendo las utilizadas por la emulaci&oacuten de mouse multi-bot&oacuten.</p>
-
-<h2><a NAME="path">Configurando su Path</a></h2>
-<p>El path es la lista de directorios donde se buscar&aacuten los comandos ejecutables. Los comandos de X11 se encuentran en <code>/usr/X11R6/bin</code>, y &eacuteste necesita estar dentro de su path. XDarwin hace &eacutesto autom&aacuteticamente por defecto, y puede adem&aacutes agregar directorios adicionales donde tenga otros comandos de l&iacutenea.</p>
-<p>Usuarios experimentados pueden tener su path correctamente configurado mediante los archivos de inicio de su interprete de comandos. En este caso, puede informarle a XDarwin en las Preferencias de Usuario para que no modifique su path. XDarwin arrancar&aacute los clientes X11 iniciales usando el int&eacuterprete de comandos del usuario, seg&uacuten su configuraci&oacuten de login. Un int&eacuterprete de comandos alternativo puede ser especificado en las Preferencias del Usuario. La manera de configurar el path de su int&eacuterprete de comandos depende de cual est&aacute usando, y es generalmente descripta en las p&aacuteginas man del mismo.</p>
-<p>Adem&aacutes, Ud. puede agregar las p&aacuteginas man de XFree86 a la lista de p&aacuteginas que son consultadas. Estas est&aacuten ubicadas en <code>/usr/X11R6/man</code> y <code>MANPATH</code> es la variable de entorno que contiene los directorios que son consultados.</p>
-
-<h2><a NAME="prefs">Preferencias del Usuario</a></h2>
-<p>Ciertas opciones pueden definirse dentro de "Preferencias...", en el men&uacute de XDarwin. Las opciones dentro de de "Inicio" no surtir&aacuten efecto hasta que la aplicaci&oacuten se reinicie. Las restantes opciones surten efecto inmediatamente. Las diferentes opciones se describen a continuaci&oacuten:</p>
-<h3>General</h3>
-<ul>
- <li><b>Usar beep del sistema en X11:</b> Cuando esta opci&oacuten est&aacute activa, el sonido de alerta est&aacutendar de Mac OS X se usar&aacute como alerta de X11. Cuando est&aacute desactivada, un simple tono es utilizado (esta es la opci&oacuten por defecto).</li>
- <li><b>Permitir que X11 cambie la aceleraci&oacuten del mouse:</b> En una implementaci&oacuten est&aacutendard de X11, el window manager puede cambiar la aceleraci&oacuten del mouse. Esto puede llevar a una gran confusi&oacuten si la aceleraci&oacuten es diferente en XDarwin y en Mac OS X. Por defecto, no se le permite a X11 alterar la aceleraci&oacuten para evitar este inconveniente.</li>
- <li><b>Emulaci&oacuten de mouse multi-bot&oacuten:</b> Esta opci&oacuten es descripta m&aacutes arriba bajo <a HREF="#usage">Modo de Uso</a>. Cuando esta emulaci&oacuten est&aacute activa los modificadores seleccionados deben ser presionados cuando se hace click para emular el bot&oacuten 2 o el bot&oacuten 3.</li>
-</ul>
-<h3>Inicio</h3>
-<ul>
- <li><b>Modo inicial:</b> Si el usuario no indica si desea utilizar la Pantalla Completa o el modo Rootless, el modo especificado aqu&iacute ser&aacute el usado.</li>
- <li><b>Mostrar panel de selecci&oacuten al inicio:</b> Por defecto, un di&aacutelogo permite al usuario elegir entre Pantalla Completa o Rootless al inicio. Si esta opci&oacuten esta desactivada, XDarwin arrancar&aacute utilizando el modo por defecto sin consultar al usuario.</li>
- <li><b>N&uacutemero de display X11:</b> X11 permite que existan m&uacuteltiples pantallas manejadas por servidores X11 separados funcionando en una misma computadora. El usuario puede especificar aqui un n&uacutemero entero para indicar el n&uacutemero de pantalla (display) que XDarwin utilizar&aacute si m&aacutes de un servidor X funciona en forma simult&aacutenea.</li>
- <li><b>Habilitar soporte Xinerama para m&uacuteltipes monitores:</b> XDarwin suporta m&uacuteltiple monitores con Xinerama, que maneja todos los monitores como si fueran parte de una gran pantalla rectangular. Puede deshabilitar Xinerama con esta opci&oacuten, pero XDarwin no maneja m&uacuteltiples monitores en forma correcta sin esta opci&oacuten habilitada. Si tiene solo un monitor, Xinerama es autom&aacuteticamente deshabilitado.</li>
- <li><b>Archivo de mapa de teclado:</b> Un archivo de mapa de teclas es le&iacutedo al inicio y es traducido a un keymap X11 (un archivo est&aacutendard de X11 para especificar la funci&oacuten de cada tecla). Estos archivos, disponibles para una amplia variedad de lenguajes, pueden encontrarse en <code>/System/Library/Keyboards</code>.</li>
- <li><b>Al iniciar clientes X11:</b> Cuando XDarwin arranca desde el Finder, &eacuteste ejecutar&aacute <code>xinit</code> para a su vez arrancar el window manager y otros clientes. (Vea en "<code>man xinit</code>" para mayor informaci&oacuten). Antes de ejecutar <code>xinit</code> XDarwin agregar&aacute los directorios especificados al path del usuario. Por defecto, solo <code>/usr/X11R6/bin</code> es agregado. Otros directorios adicionales puede agregarse separados por dos puntos (:). Los clientes X son ejecutados con el int&eacuterprete de comandos del usuario, por lo que los archivos de inicio de &eacuteste son le&iacutedos. Si se desea, un int&eacuterprete de comandos diferente puede ser especificado.</li>
-</ul>
-<h3>Pantalla Completa</h3>
-<ul>
- <li><b>Bot&oacuten para definir combinaci&oacuten de teclas:</b> Haga click en este bot&oacuten y luego presione cualquier combinaci&oacuten de modificadores seguidos de una tecla convencional para definir que combinaci&oacuten usar&aacute para intercambiar entre X11 y Aqua.</li>
- <li><b>Click en el &iacutecono del Dock cambia a X11:</b> Habilite esta opci&oacuten para volver a X11 al hacer click en &iacutecono de XDarwin en el Dock. En algunas versiones de Mac OS X, al volver haciendo click en el Dock puede causar al desaparci&oacuten del cursor al volver a Aqua.</li>
- <li><b>Mostrar ayuda al inicio:</b> Esta opci&oacuten habilitada har&aacute que una pantalla inicial de introducci&oacuten aparezca cuando XDarwin es arrancado en modo Pantalla Completa.</li>
- <li><b>Profundidad de color (bits):</b> En modo Pantalla Completa, el display X11 puede utilizar una profundidad de color diferente de la utilizada por Aqua. Si se especifica "Actual", la misma profundidad de color que Aqua utiliza ser&aacute adoptada por X11. Al contrario, puede especificar 8, 15, o 24 bits.</li>
-</ul>
-
-<h2><a NAME="license">Licencia</a></h2>
-El XFree86 Project esta comprometido en proveer versiones binarias y en c&oacutedigo fuente de distribuci&oacuten libre. La licencia principal que utilizamos es una basada en la Licencia MIT X11 tradicional, que no impone condiciones a la modificaci&oacuten o redistribuci&oacuten del c&oacutedigo fuente o de archivos binarios m&aacutes all&aacute de requerir que los mensajes de Licencia y Copyright se mantengan intactos. Para mayor informaci&oacuten y para mensajes adicionales de Licencia y Copyright que cubren algunas secciones del c&oacutedigo fuente, por favor consulte la <A HREF="http://www.xfree86.org/legal/licence.html">P&aacutegina de Licencia de XFree86</A>.
-<H3><A NAME="3"></A>Licencia del X Consortium</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Se otorga aqui permiso, libre de costo, a toda persona que obtenga una copia de este Software y los archivos de documentaci&oacuten asociados (el "Software"),
-para utilizar el Software sin restricciones, incluyendo sin l&iacutemites los derechos de usar, copiar, modificar, integrar con otros productos, publicar, distribuir, sub-licenciar y/o comercializar copias del Software, y de permitir a las personas que lo reciben para hacer lo propio, sujeto a las siguientes condiciones:</p>
-<p>El mensaje de Copyright indicado m&aacutes arriba y este permiso ser&aacute inclu&iacutedo en todas las copias o porciones sustanciales del Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Excepto lo indicado en este mensaje, el nombre del X Consortium no ser&aacute utilizado en propaganda o como medio de promoci&oacuten para la venta, utilizaci&oacuten u otros manejos de este Software sin previa autorizaci&oacuten escrita del X Consortium.</p>
-<p>X Window System es una marca registrada de X Consortium, Inc.</p>
-<H3><A NAME="3"></A>X Consortium License (English)</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Swedish.lproj/Credits.rtf b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
deleted file mode 100644
index 3cd250116..000000000
--- a/hw/darwin/bundle/Swedish.lproj/Credits.rtf
+++ /dev/null
@@ -1,124 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
deleted file mode 100644
index 9709e5469..000000000
--- a/hw/darwin/bundle/Swedish.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 230436b31..000000000
--- a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index ee099d1a0..000000000
--- a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/07 22:43:27 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<title>XFree86 f&ouml;r Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 f&ouml;r Darwin och Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- F&auml;rdigst&auml;llt: XF86_REL_DATE
-</center>
-<h2>Inneh&aring;ll</h2>
-<ol>
- <li><A HREF="#notice">Viktigt!</A></li>
- <li><A HREF="#usage">Anv&auml;ndande</A></li>
- <li><A HREF="#path">Att st&auml;lla in sin s&ouml;kv&auml;g</A></li>
- <li><A HREF="#prefs">Inst&auml;llningar</A></li>
- <li><A HREF="#license">Licens</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Viktigt!</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Detta &auml;r en testversion av XFree86, och du kan inte garranteras n&aring;gon som helst support f&ouml;r den. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge. Innan du rapporterar buggar i testversioner, var god pr&ouml;va den senaste versionen fr&aring;n <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> eller i <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS-arkiv</A>.
-#else
-Om servern &auml;r &auml;ldre &auml;n 6-12 m&aring;nader, eller om din h&aring;rdvara &auml;r nyare &auml;n datumet ovan, leta efter en nyare version innan du rapporterar fel. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Denna programvara distrubueras i enlighet med <A HREF="#license">MIT X11 / X Consortium License</A> och tilhandh&aring;lls som den &auml;r, helt utan garantier. Var god l&auml;s igenom <A HREF="#license">licensdokumentet (engelska)</A> innan du anv&auml;nder programmet.</blockquote>
-
-<h2><a NAME="usage">Anv&auml;ndande</a></h2>
-<p>XFree86 &auml;r en fritt spridd implemenation av <a HREF
-="http://www.x.org/">X Window-systemet</a> producerad av <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc</a>, med &ouml;ppen k&auml;llkod. Den X Window-server f&ouml;r Darwin och Mac OS X som tillhandah&aring;lls av XFree86 kallas XDarwin. XDarwin kan k&ouml;ras p&aring; Mac OS X i fullsk&auml;rmsl&auml;ge eller rotl&ouml;st l&auml;ge.</p>
-<p>I fullsk&auml;rmsl&auml;ge kommer X window-systemet att ta &ouml;ver hela sk&auml;rmen n&auml;r det &auml;r aktivt. Du kan byta tillbaka till Mac OS Xs skrivbord genom att trycka Kommando-Alt-A. Denna tangentkombination kan &auml;ndra i inst&auml;llningarna. N&auml;r du &auml;r p&aring; Mac OS Xs skrivbord kan du klicka p&aring; XDarwin-ikonen i dockan f&ouml;r att byta tillbaka till X Window-systemet. (Du kan f&ouml;r&auml;ndra detta beteende i inst&auml;llningarna s&aring; att du ist&auml;llet m&aring;ste klicka i det fltande bytesf&ouml;nstret ist&auml;llet.)</p>
-<p>I rotl&ouml;stl&auml;ge delar X11 och Aqua p&aring; din sk&auml;rm. Rotf&ouml;nstret p&aring; X11-sk&auml;rmen &auml;r av samma storlek som hela sk&auml;rmen och inneh&aring;ller alla andra f&ouml;nster - det fungerar som bakgrund. I rotl&ouml;stl&auml;ge visas inte detta rotf&ouml;nster, eftersom Aqua hanterar skrvbordbakgrunden.</p>
-
-<h3>Emulering av flerknapparsmus</h3>
-<p>M&aring;nga X11-program utnyttjar en treknapparsmus. Du kan emulera en treknapparsmus med en knapp genom att h&aring;lla ner olika knappar p&aring; tangentbordet medan du klickar med musens enda knapp. Denna funktion styrs av inst&auml;llningarna i "Emulera flerknapparsmus" under fliken "Diverse" i inst&auml;llningarna. Grundinst&auml;llningen &auml;r att emulationen &auml;r aktiv och att ett kommando-klick (H&aring;ll ner kommando och klicka) simulerar den andra musknappen. Den tredje musknappen f&aring;s genom att h&aring;lla ner alt och klicka. Du kan &auml;ndra detta till n&aring;gon annan kombination av de fem tangenterna kommando, alt, kontrol, skift och fn (Powerbook/iBook). Notera att om dessa knappar har flyttats med hj&auml;lp av kommandot xmodmap kommer denna f&ouml;r&auml;ndring inte att p&aring;verka vilka knappar som anv&auml;nds vid flerknappsemulationen.</p>
-
-<h2><a NAME="path">Att st&auml;lla in sin s&ouml;kv&auml;g</a></h2>
-<p>Din s&ouml;kv&auml;g &auml;r en lista av kataloger som s&ouml;ks igenom n&auml;r terminalen letar efter kommandon att exekvera. Kommandon som h&ouml;r till X11 ligger i <code>/usr/X11R6/bin</code>, en katalog som inte ligger i din s&ouml;kv&auml;g fr&aring;n b&ouml;rjan. XDarwin l&auml;gger till denna katalog &aring;t dig, och du kan ocks&aring; l&auml;gga till ytterligare kataloger i vilka du lagt program som skall k&ouml;ras fr&aring;n kommandoraden.</p>
-<p>Mer erfarna anv&auml;ndare har antagligen redan st&auml;llt in sin s&ouml;kv&auml;g i skalets inst&auml;llningsfiler. Om detta g&auml;ller dig kan st&auml;lla in XDarwin s&aring; att din s&ouml;kv&auml;g inte modifieras. XDarwin startar de f&ouml;rsta X11-klienterna i anv&auml;ndarens inloggningsskal (Vill du anv&auml;nda ett alternativt skall, kan du specificera detta i inst&auml;llningarna). Hur du st&auml;ller in din s&ouml;kv&auml;g beror p&aring; vilket skal du anv&auml;nder. Exakt hur beskrivs i skalets man-sidor.</p>
-
-<p>Ut&ouml;ver detta kan du ocks&aring; vilja l&auml;gga till XFree86s man-sidor (dokumentation) till listan &auml;ver sidor som som skall s&ouml;kas n&auml;r du vill l&auml;sa efter dokumentationen. X11s man-sidor ligger i <code>/usr/X11R6/man</code> och listan &auml;ver kataloger att s&ouml;ka best&auml;mms av variabeln<code>MANPATH</code>.</p>
-
-<h2><a NAME="prefs">Inst&auml;llningar</a></h2>
-<p>I inst&auml;llningarna finns ett antal alternativ d&auml;r du kan p&aring;verka hur XDarwin beter sig i vissa fall. Inst&auml;llningarna kommer du till genom att v&auml;lja "Inst&auml;llningar..." i menyn "XDarwin". De alternativ som finns under fliken "Starta" tr&auml;der inte i kraft f&ouml;rr&auml;n du startat om programmet. Alla andra alternativ tr&auml;der i kraft omedelbart. De olika alternativen beskrivs nedan:</p>
-<h3>Diverse</h3>
-<ul>
- <li><b>Anv&auml;nd Mac OS varningsljud i X11:</b> N&auml;r detta alternativ &auml;r valt anv&auml;nds Mac OS vanliga varningsljud &auml;r X11s varningsljud (bell). N&auml;r detta alternativ inte &auml;r valt (f&ouml;rvalt) anv&auml;nds en vanlig ton.</li>
- <li><b>Till&aring;t X11 att &auml;ndra musens acceleration:</b> I ett vanligt X11-system kan f&ouml;nsterhanteraren &auml;ndra musens acceleration. Detta kan vara f&ouml;rvirrande eftersom musens acceleration kan vara olika i Mac OS Xs System Preferences och i f&ouml;nsterhanteraren i X11. F&ouml;rvalet &auml;r att X11 inte kan &auml;ndra musens acceleration f&ouml;r att p&aring; detta s&auml;tt undvika detta problem.</li>
- <li><b>Emulera flerknapparsmus:</b> Detta beskrivs ovan under <a HREF="#usage">Anv&auml;ndande</a>. N&auml;r emulationen &auml;r aktiv m&aring;ste du h&aring;lla ner de valda knapparna f&ouml;r att emulera en andra eller tredje musknapp.</li>
-</ul>
-<h3>Starta</h3>
-<ul>
- <li><b>F&ouml;rvalt l&auml;ge:</b> Om anv&auml;ndaren inte p&aring; annat s&auml;tt v&auml;ljer vilket l&auml;ge som skall anv&auml;ndas kommer alternativet h&auml;r att anv&auml;ndas.</li>
- <li><b>Visa val av sk&auml;rml&auml;ge vid start:</b> F&ouml;rvalet &auml;r att visa ett f&ouml;nster n&auml;r XDarwin startar som l&aring;ter anv&auml;ndaren v&auml;lja mellan fullsk&auml;rmsl&auml;ge och rotl&ouml;st l&auml;ge. Om detta alternativ inte &auml;r aktivt kommer XDarwin automatiskt att startas i det l&auml;ge som valts ovan.</li>
- <li><b>Sk&auml;rmnummer i X11:</b> X11 till&aring;ter att det finns flera sk&auml;rmar styrda av varsin X-server p&aring; en och samma dator. Anv&auml;ndaren kan ange vilket nummer XDarwin skall anv&auml;nda om mer &auml;n en X-server skall anv&auml;ndas samtidigt.</li>
- <li><b>Aktivera Xinerama (st&ouml;d f&ouml;r flera sk&auml;rmar):</b> XDarwin st&ouml;djer flera sk&auml;rmar genom Xinerama, vilket hanterar alla skr&auml;mar som delar av en enda stor rektangul&auml;r sk&auml;rm. Du kan anv&auml;nda detta alternativ f&ouml;r att st&auml;nga av Xinerama, men f&ouml;r n&auml;rvarande kan inte XDarwin hantera flera sk&auml;rmar utan det. Om du bara har en sk&auml;rm kommer Xinerama automatiskt att deaktiveras.</li>
- <li><b>Fil med tangentbordsupps&auml;ttning:</b> En fil som anger tangentbordsupps&auml;ttning l&auml;ses vid start och &ouml;vers&auml;tts till en tangentborsupps&auml;ttningsfil f&ouml;r X11. Filer med tangentbordsupps&auml;ttningar f&ouml;r ett stort antal spr&aring;k finns i <code>/System/Library/Keyboards</code>.</li>
- <li><b>Startar f&ouml;rsta X11-klienterna:</b> N&auml;r X11 startas fr&aring;n Finder kommer det att exekvera filen <code>xinit</code> f&ouml;r att starta f&ouml;nsterhanteraren i X11 och andra program. (Se "<code>man xinit</code>" f&ouml;r mer information.) Innan XDarwin k&ouml;r xinit kommer det att l&auml;gga till katalogern h&auml;r till anv&auml;ndarens s&ouml;kv&auml;g. F&ouml;rvalet &auml;r att endast l&auml;gga till katalogen <code>/usr/X11R6/bin</code>. Ytterligare kataloger kan l&auml;ggas till - separera dem med kolon. X11-klienterna startas i anv&auml;ndarens inloggningsskal s&aring; att anv&auml;ndarens inst&auml;llningsfiler i skalet l&auml;ses. Om s&aring; &ouml;nskas kan de startas i ett annat skal.</li>
-</ul>
-<h3>Fullsk&auml;rm</h3>
-<ul>
- <li><b>Tangentkombinationsknappen:</b> Tryck p&aring; denna knapp och en tangentkombination f&ouml;r att &auml;ndra den tangentkombination som anv&auml;nds f&ouml;r att byta mellan X11 och Aqua.</li>
- <li><b>Klick p&aring; ikonen i dockan byter till X11:</b> Aktivera detta alternativ f&ouml;r att byta till X11 genom att klicka p&aring; ikonen i dockan. I vissa versioner av Mac OS X kommer ett bte p&aring; detta s&auml;tt att g&ouml;mma pekaren n&auml;r du &aring;terv&auml;nder till Aqua.</li>
- <li><b>Visa fullsk&auml;rmshj&auml;lp vid start:</b> Detta kommer att visa en informationsruta n&auml;r XDarwin startas i fullsk&auml;rmsl&auml;ge.</li>
- <li><b>F&auml;rgdjup:</b> I fullsk&auml;rmsl&auml;ge kan X11 anv&auml;nda ett annat f&auml;rgdjup &auml;n Aquas. Om du v&auml;jer "Nuvarande" kommer X11 att anv&auml;nda det f&auml;rgdjup som Aqua har just d&aring;. Annars kan du v&auml;lja 8, 15, eller 24 bitare f&auml;rg.</li>
-</ul>
-
-<h2><a NAME="license">Licens (svenska)</a></h2>
-<p>XFree86-projektet &aring;tar sig att tillhandah&aring;lla programvara och k&auml;llkod i format som fritt kan spridas vidare. Den huvudsakliga licens vi anv&auml;nder oss av &auml;r baserad p&aring; den traditionella MIT X11 / XConsortium-licensen, vilken inte p&aring; n&aring;got s&auml;tt begr&auml;nsar f&ouml;r&auml;ndringar eller vidarespridning av vare sig k&auml;llkod eller kompilerad programvara annat &auml;n genom att kr&auml;va att delarna som r&ouml;r copyright och licensiering l&auml;mnas intakta. F&ouml;r mer information och ytterligare copyright/licensieringsinfromation r&ouml;rande vissa speciella delar av koden, se <A HREF="http://www.xfree86.org/legal/licence.html">XFree86-licenssida</A> (engelska).</p>
-
-<h3>Licence (english)</h3>
-<p>The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>.</p>
-
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/XDarwin.icns b/hw/darwin/bundle/XDarwin.icns
deleted file mode 100644
index 31dc1bdf9..000000000
--- a/hw/darwin/bundle/XDarwin.icns
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Credits.rtf b/hw/darwin/bundle/ko.lproj/Credits.rtf
deleted file mode 100644
index 3cd250116..000000000
--- a/hw/darwin/bundle/ko.lproj/Credits.rtf
+++ /dev/null
@@ -1,124 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f1\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f1\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f1\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f1\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f1\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f1\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f1\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f1\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f1\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f1\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f1\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f0\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f1\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f1\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
deleted file mode 100644
index fb8c77e0d..000000000
--- a/hw/darwin/bundle/ko.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index ba1e3a206..000000000
--- a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- closeHelpAndShow = id;
- showAction = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index e35148d76..000000000
--- a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 4c83fe278..000000000
--- a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp,v 1.1 2001/12/04 03:36:39 torrey Exp $ -->
-
-#include "xf86Version.h"
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-<html>
-<head>
-<title>XFree86 for Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 on Darwin and Mac OS X</h1>
- XFree86 XF86_VERSION<br>
- Release Date: XF86_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-
-<h2><a NAME="usage">Usage</a></h2>
-<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
-="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
-<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
-<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
-
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
-<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
-<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
-
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<h3>General</h3>
-<ul>
- <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
- <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
- <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
-</ul>
-<h3>Start Up</h3>
-<ul>
- <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
- <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
- <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
- <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
- <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
- <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
-</ul>
-<h3>Full Screen</h3>
-<ul>
- <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
- <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
-</ul>
-
-<h2><a NAME="license">License</a></h2>
-The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
-License page</A>.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/startXClients.cpp b/hw/darwin/bundle/startXClients.cpp
deleted file mode 100644
index b27ad46fe..000000000
--- a/hw/darwin/bundle/startXClients.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-XCOMM!/bin/sh
-
-XCOMM This script is used by XDarwin to start X clients when XDarwin is
-XCOMM launched from the Finder.
-XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/startXClients.cpp,v 1.1 2001/10/18 05:03:42 torrey Exp $
-
-userclientrc=$HOME/.xinitrc
-sysclientrc=XINITDIR/xinitrc
-clientargs=""
-
-if [ -f $userclientrc ]; then
- clientargs=$userclientrc
-else if [ -f $sysclientrc ]; then
- clientargs=$sysclientrc
-fi
-fi
-
-if [ "x$2" != "x" ]; then
- PATH="$PATH:$2"
- export PATH
-fi
-
-exec xinit $clientargs -- XBINDIR/XDarwinStartup "$1" -idle
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
deleted file mode 100644
index a7a0d839c..000000000
--- a/hw/darwin/darwin.c
+++ /dev/null
@@ -1,1019 +0,0 @@
-/**************************************************************
- *
- * Shared code for the Darwin X Server
- * running with Quartz or IOKit display mode
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "os.h"
-#include "servermd.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "mibstore.h" // mi backing store implementation
-#include "mipointer.h" // mi software cursor
-#include "micmap.h" // mi colormap code
-#include "fb.h" // fb framebuffer code
-#include "site.h"
-#include "globals.h"
-#include "xf86Version.h"
-#include "xf86Date.h"
-#include "dix.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/syslimits.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#define NO_CFPLUGIN
-#include <IOKit/IOKitLib.h>
-#include <IOKit/hidsystem/IOHIDLib.h>
-#include <IOKit/hidsystem/ev_keymap.h>
-
-#include "darwin.h"
-#include "darwinClut8.h"
-
-/*
- * X server shared global variables
- */
-int darwinScreensFound = 0;
-int darwinScreenIndex = 0;
-io_connect_t darwinParamConnect = 0;
-int darwinEventReadFD = -1;
-int darwinEventWriteFD = -1;
-int darwinMouseAccelChange = 1;
-int darwinFakeButtons = 0;
-
-// location of X11's (0,0) point in global screen coordinates
-int darwinMainScreenX = 0;
-int darwinMainScreenY = 0;
-
-// parameters read from the command line or user preferences
-unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0;
-int darwinDesiredDepth = -1;
-int darwinDesiredRefresh = -1;
-char *darwinKeymapFile = "USA.keymapping";
-
-// modifier masks for faking mouse buttons
-int darwinFakeMouse2Mask = NX_COMMANDMASK;
-int darwinFakeMouse3Mask = NX_ALTERNATEMASK;
-
-static DeviceIntPtr darwinPointer;
-static DeviceIntPtr darwinKeyboard;
-
-// Common pixmap formats
-static PixmapFormatRec formats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD },
- { 4, 8, BITMAP_SCANLINE_PAD },
- { 8, 8, BITMAP_SCANLINE_PAD },
- { 15, 16, BITMAP_SCANLINE_PAD },
- { 16, 16, BITMAP_SCANLINE_PAD },
- { 24, 32, BITMAP_SCANLINE_PAD },
- { 32, 32, BITMAP_SCANLINE_PAD }
-};
-const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
-
-#ifndef OSNAME
-#define OSNAME " Darwin"
-#endif
-#ifndef OSVENDOR
-#define OSVENDOR ""
-#endif
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-void
-DarwinPrintBanner()
-{
-#if PRE_RELEASE
- ErrorF("\n"
- "This is a pre-release version of XFree86, and is not supported in any\n"
- "way. Bugs may be reported to XFree86@XFree86.Org and patches submitted\n"
- "to fixes@XFree86.Org. Before reporting bugs in pre-release versions,\n"
- "please check the latest version in the XFree86 CVS repository\n"
- "(http://www.XFree86.Org/cvs)\n");
-#endif
- ErrorF("\nXFree86 Version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
- XF86_VERSION_PATCH);
-#if XF86_VERSION_SNAP > 0
- ErrorF(".%d", XF86_VERSION_SNAP);
-#endif
-
-#if XF86_VERSION_SNAP >= 900
- ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1,
- XF86_VERSION_SNAP - 900);
-#endif
-
-#ifdef XF86_CUSTOM_VERSION
- ErrorF(" (%s)", XF86_CUSTOM_VERSION);
-#endif
- ErrorF(" / X Window System\n");
- ErrorF("(protocol Version %d, revision %d, vendor release %d)\n",
- X_PROTOCOL, X_PROTOCOL_REVISION, VENDOR_RELEASE );
- ErrorF("Release Date: %s\n", XF86_DATE);
- ErrorF("\tIf the server is older than 6-12 months, or if your hardware is\n"
- "\tnewer than the above date, look for a newer version before\n"
- "\treporting problems. (See http://www.XFree86.Org/FAQ)\n");
- ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR);
-#if defined(BUILDERSTRING)
- ErrorF("%s \n",BUILDERSTRING);
-#endif
-}
-
-
-/*
- * DarwinSaveScreen
- * X screensaver support. Not implemented.
- */
-static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
-{
- // FIXME
- if (on == SCREEN_SAVER_FORCER) {
- } else if (on == SCREEN_SAVER_ON) {
- } else {
- }
- return TRUE;
-}
-
-
-/*
- * DarwinAddScreen
- * This is a callback from dix during AddScreen() from InitOutput().
- * Initialize the screen and communicate information about it back to dix.
- */
-static Bool DarwinAddScreen(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv )
-{
- int bitsPerRGB, i, dpi;
- static int foundIndex = 0;
- Bool ret;
- VisualPtr visual;
- ColormapPtr pmap;
- DarwinFramebufferPtr dfb;
-
- // reset index of found screens for each server generation
- if (index == 0) foundIndex = 0;
-
- // allocate space for private per screen storage
- dfb = xalloc(sizeof(DarwinFramebufferRec));
- SCREEN_PRIV(pScreen) = dfb;
-
- // setup hardware/mode specific details
- ret = DarwinModeAddScreen(foundIndex, pScreen);
- foundIndex++;
- if (! ret)
- return FALSE;
-
- bitsPerRGB = dfb->bitsPerComponent;
-
- // reset the visual list
- miClearVisualTypes();
-
- // setup a single visual appropriate for our pixel type
- if (dfb->colorType == TrueColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask,
- bitsPerRGB, TrueColor )) {
- return FALSE;
- }
- } else if (dfb->colorType == PseudoColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask,
- bitsPerRGB, PseudoColor )) {
- return FALSE;
- }
- } else if (dfb->colorType == StaticColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask,
- bitsPerRGB, StaticColor )) {
- return FALSE;
- }
- } else {
- return FALSE;
- }
-
- miSetPixmapDepths();
-
- // machine independent screen init
- // setup _Screen structure in pScreen
- if (monitorResolution)
- dpi = monitorResolution;
- else
- dpi = 75;
-
- // initialize fb
- if (! fbScreenInit(pScreen,
- dfb->framebuffer, // pointer to screen bitmap
- dfb->width, dfb->height, // screen size in pixels
- dpi, dpi, // dots per inch
- dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer
- dfb->bitsPerPixel)) // bits per pixel for screen
- {
- return FALSE;
- }
-
- // set the RGB order correctly for TrueColor
- if (dfb->bitsPerPixel > 8) {
- for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
- i < pScreen->numVisuals; i++, visual++) {
- if (visual->class == TrueColor) {
- visual->offsetRed = bitsPerRGB * 2;
- visual->offsetGreen = bitsPerRGB;
- visual->offsetBlue = 0;
- visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
- visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
- visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
- }
- }
- }
-
-#ifdef RENDER
- if (! fbPictureInit(pScreen, 0, 0)) {
- return FALSE;
- }
-#endif
-
-#ifdef MITSHM
- ShmRegisterFbFuncs(pScreen);
-#endif
-
- // this must be initialized (why doesn't X have a default?)
- pScreen->SaveScreen = DarwinSaveScreen;
-
- // finish mode dependent screen setup including cursor support
- if (!DarwinModeSetupScreen(index, pScreen)) {
- return FALSE;
- }
-
- // create and install the default colormap and
- // set pScreen->blackPixel / pScreen->white
- if (!miCreateDefColormap( pScreen )) {
- return FALSE;
- }
-
- /* Set the colormap to the statically defined one if we're in 8 bit
- * mode and we're using a fixed color map. Essentially this translates
- * to Darwin/x86 in 8-bit mode.
- */
- if( (dfb->colorBitsPerPixel == 8) &&
- (dfb->colorType == StaticColor) )
- {
- pmap = miInstalledMaps[pScreen->myNum];
- visual = pmap->pVisual;
- for( i = 0; i < visual->ColormapEntries; i++ ) {
- pmap->red[i].co.local.red = darwinClut8[i].red;
- pmap->red[i].co.local.green = darwinClut8[i].green;
- pmap->red[i].co.local.blue = darwinClut8[i].blue;
- }
- }
-
- dixScreenOrigins[index].x = dfb->x;
- dixScreenOrigins[index].y = dfb->y;
-
- ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
- index, dfb->width, dfb->height, dfb->x, dfb->y);
-
- return TRUE;
-}
-
-/*
- =============================================================================
-
- mouse and keyboard callbacks
-
- =============================================================================
-*/
-
-/*
- * DarwinChangePointerControl
- * Set mouse acceleration and thresholding
- * FIXME: We currently ignore the threshold in ctrl->threshold.
- */
-static void DarwinChangePointerControl(
- DeviceIntPtr device,
- PtrCtrl *ctrl )
-{
- kern_return_t kr;
- double acceleration;
-
- if (!darwinMouseAccelChange)
- return;
-
- acceleration = ctrl->num / ctrl->den;
- kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration );
- if (kr != KERN_SUCCESS)
- ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr );
-}
-
-
-/*
- * DarwinMouseProc
- * Handle the initialization, etc. of a mouse
- */
-static int DarwinMouseProc(
- DeviceIntPtr pPointer,
- int what )
-{
- char map[6];
-
- switch (what) {
-
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- // Set button map.
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- map[4] = 4;
- map[5] = 5;
- InitPointerDeviceStruct( (DevicePtr)pPointer,
- map,
- 5, // numbuttons (4 & 5 are scroll wheel)
- miPointerGetMotionEvents,
- DarwinChangePointerControl,
- 0 );
- break;
-
- case DEVICE_ON:
- pPointer->public.on = TRUE;
- AddEnabledDevice( darwinEventReadFD );
- return Success;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pPointer->public.on = FALSE;
- RemoveEnabledDevice( darwinEventReadFD );
- return Success;
- }
-
- return Success;
-}
-
-
-/*
- * DarwinKeybdProc
- * Callback from X
- */
-static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
-{
- switch ( onoff ) {
- case DEVICE_INIT:
- DarwinKeyboardInit( pDev );
- break;
- case DEVICE_ON:
- pDev->public.on = TRUE;
- AddEnabledDevice( darwinEventReadFD );
- break;
- case DEVICE_OFF:
- pDev->public.on = FALSE;
- RemoveEnabledDevice( darwinEventReadFD );
- break;
- case DEVICE_CLOSE:
- break;
- }
-
- return Success;
-}
-
-/*
-===========================================================================
-
- Utility routines
-
-===========================================================================
-*/
-
-/*
- * DarwinFindLibraryFile
- * Search for a file in the standard Library paths, which are (in order):
- *
- * ~/Library/ user specific
- * /Library/ host specific
- * /Network/Library/ LAN specific
- * /System/Library/ OS specific
- *
- * A sub-path can be specified to search in below the various Library
- * directories. Returns a new character string (owned by the caller)
- * containing the full path to the first file found.
- */
-static char * DarwinFindLibraryFile(
- const char *file,
- const char *pathext )
-{
- // Library search paths
- char *pathList[] = {
- "",
- "/Network",
- "/System",
- NULL
- };
- char *home;
- char *fullPath;
- int i = 0;
-
- // Return the file name as is if it is already a fully qualified path.
- if (!access(file, F_OK)) {
- fullPath = xalloc(strlen(file)+1);
- strcpy(fullPath, file);
- return fullPath;
- }
-
- fullPath = xalloc(PATH_MAX);
-
- home = getenv("HOME");
- if (home) {
- snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file);
- if (!access(fullPath, F_OK))
- return fullPath;
- }
-
- while (pathList[i]) {
- snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++],
- pathext, file);
- if (!access(fullPath, F_OK))
- return fullPath;
- }
-
- xfree(fullPath);
- return NULL;
-}
-
-
-/*
- * DarwinParseModifierList
- * Parse a list of modifier names and return a corresponding modifier mask
- */
-static int DarwinParseModifierList(
- const char *constmodifiers) // string containing list of modifier names
-{
- int result = 0;
-
- if (constmodifiers) {
- char *modifiers = strdup(constmodifiers);
- char *modifier;
- int nxkey;
- char *p = modifiers;
-
- while (p) {
- modifier = strsep(&p, " ,+&|/"); // allow lots of separators
- nxkey = DarwinModifierStringToNXKey(modifier);
- if (nxkey != -1)
- result |= DarwinModifierNXKeyToNXMask(nxkey);
- else
- ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
- }
- free(modifiers);
- }
- return result;
-}
-
-/*
-===========================================================================
-
- Functions needed to link against device independent X
-
-===========================================================================
-*/
-
-/*
- * InitInput
- * Register the keyboard and mouse devices
- */
-void InitInput( int argc, char **argv )
-{
- darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
- RegisterPointerDevice( darwinPointer );
-
- darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
- RegisterKeyboardDevice( darwinKeyboard );
-
- if (serverGeneration == 1) {
- DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
- }
-
- DarwinModeInitInput(argc, argv);
-}
-
-
-/*
- * DarwinAdjustScreenOrigins
- * Shift all screens so the X11 (0, 0) coordinate is at the top
- * left of the global screen coordinates.
- *
- * Screens can be arranged so the top left isn't on any screen, so
- * instead use the top left of the leftmost screen as (0,0). This
- * may mean some screen space is in -y, but it's better that (0,0)
- * be onscreen, or else default xterms disappear. It's better that
- * -y be used than -x, because when popup menus are forced
- * "onscreen" by dumb window managers like twm, they'll shift the
- * menus down instead of left, which still looks funny but is an
- * easier target to hit.
- */
-void
-DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
-{
- int i, left, top;
-
- left = dixScreenOrigins[0].x;
- top = dixScreenOrigins[0].y;
-
- /* Find leftmost screen. If there's a tie, take the topmost of the two. */
- for (i = 1; i < pScreenInfo->numScreens; i++) {
- if (dixScreenOrigins[i].x < left ||
- (dixScreenOrigins[i].x == left &&
- dixScreenOrigins[i].y < top))
- {
- left = dixScreenOrigins[i].x;
- top = dixScreenOrigins[i].y;
- }
- }
-
- darwinMainScreenX = left;
- darwinMainScreenY = top;
-
- /* Shift all screens so that there is a screen whose top left
- is at X11 (0,0) and at global screen coordinate
- (darwinMainScreenX, darwinMainScreenY). */
-
- if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
- for (i = 0; i < pScreenInfo->numScreens; i++) {
- dixScreenOrigins[i].x -= darwinMainScreenX;
- dixScreenOrigins[i].y -= darwinMainScreenY;
- ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
- i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
- }
- }
-}
-
-
-/*
- * InitOutput
- * Initialize screenInfo for all actually accessible framebuffers.
- *
- * The display mode dependent code gets called three times. The mode
- * specific InitOutput routines are expected to discover the number
- * of potentially useful screens and cache routes to them internally.
- * Inside DarwinAddScreen are two other mode specific calls.
- * A mode specific AddScreen routine is called for each screen to
- * actually initialize the screen with the ScreenPtr structure.
- * After other screen setup has been done, a mode specific
- * SetupScreen function can be called to finalize screen setup.
- */
-void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
-{
- int i;
- static unsigned long generation = 0;
-
- pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
-
- // List how we want common pixmap formats to be padded
- pScreenInfo->numPixmapFormats = NUMFORMATS;
- for (i = 0; i < NUMFORMATS; i++)
- pScreenInfo->formats[i] = formats[i];
-
- // Allocate private storage for each screen's Darwin specific info
- if (generation != serverGeneration) {
- darwinScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- // Discover screens and do mode specific initialization
- DarwinModeInitOutput(argc, argv);
-
- // Add screens
- for (i = 0; i < darwinScreensFound; i++) {
- AddScreen( DarwinAddScreen, argc, argv );
- }
-
- DarwinAdjustScreenOrigins(pScreenInfo);
-}
-
-
-/*
- * OsVendorFataError
- */
-void OsVendorFatalError( void )
-{
- ErrorF( " OsVendorFatalError\n" );
-}
-
-
-/*
- * OsVendorInit
- * Initialization of Darwin OS support.
- */
-void OsVendorInit(void)
-{
- if (serverGeneration == 1) {
- DarwinPrintBanner();
- }
-
- // Find the full path to the keymapping file.
- if ( darwinKeymapFile ) {
- char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards");
- if ( !tempStr ) {
- ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile);
- } else {
- ErrorF("Using keymapping provided in %s.\n", tempStr);
- }
- darwinKeymapFile = tempStr;
- }
-
- if ( !darwinKeymapFile ) {
- ErrorF("Reading keymap from the system.\n");
- }
-}
-
-
-/*
- * ddxProcessArgument --
- * Process device-dependent command line args. Returns 0 if argument is
- * not device dependent, otherwise Count of number of elements of argv
- * that are part of a device dependent commandline option.
- */
-int ddxProcessArgument( int argc, char *argv[], int i )
-{
- int numDone;
-
- if ((numDone = DarwinModeProcessArgument( argc, argv, i )))
- return numDone;
-
- if ( !strcmp( argv[i], "-fakebuttons" ) ) {
- darwinFakeButtons = TRUE;
- ErrorF( "Faking a three button mouse\n" );
- return 1;
- }
-
- if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
- darwinFakeButtons = FALSE;
- ErrorF( "Not faking a three button mouse\n" );
- return 1;
- }
-
- if (!strcmp( argv[i], "-fakemouse2" ) ) {
- if ( i == argc-1 ) {
- FatalError( "-fakemouse2 must be followed by a modifer list\n" );
- }
- if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
- darwinFakeMouse2Mask = 0;
- else
- darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]);
- ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
- darwinFakeMouse2Mask);
- return 2;
- }
-
- if (!strcmp( argv[i], "-fakemouse3" ) ) {
- if ( i == argc-1 ) {
- FatalError( "-fakemouse3 must be followed by a modifer list\n" );
- }
- if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
- darwinFakeMouse3Mask = 0;
- else
- darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]);
- ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
- darwinFakeMouse3Mask);
- return 2;
- }
-
- if ( !strcmp( argv[i], "-keymap" ) ) {
- if ( i == argc-1 ) {
- FatalError( "-keymap must be followed by a filename\n" );
- }
- darwinKeymapFile = argv[i+1];
- return 2;
- }
-
- if ( !strcmp( argv[i], "-nokeymap" ) ) {
- darwinKeymapFile = NULL;
- return 1;
- }
-
- if ( !strcmp( argv[i], "-size" ) ) {
- if ( i >= argc-2 ) {
- FatalError( "-size must be followed by two numbers\n" );
- }
-#ifdef OLD_POWERBOOK_G3
- ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" );
-#else
- darwinDesiredWidth = atoi( argv[i+1] );
- darwinDesiredHeight = atoi( argv[i+2] );
- ErrorF( "Attempting to use width x height = %i x %i\n",
- darwinDesiredWidth, darwinDesiredHeight );
-#endif
- return 3;
- }
-
- if ( !strcmp( argv[i], "-depth" ) ) {
- int bitDepth;
-
- if ( i == argc-1 ) {
- FatalError( "-depth must be followed by a number\n" );
- }
-#ifdef OLD_POWERBOOK_G3
- ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
-#else
- bitDepth = atoi( argv[i+1] );
- if (bitDepth == 8)
- darwinDesiredDepth = 0;
- else if (bitDepth == 15)
- darwinDesiredDepth = 1;
- else if (bitDepth == 24)
- darwinDesiredDepth = 2;
- else
- FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
- ErrorF( "Attempting to use pixel depth of %i\n", bitDepth );
-#endif
- return 2;
- }
-
- if ( !strcmp( argv[i], "-refresh" ) ) {
- if ( i == argc-1 ) {
- FatalError( "-refresh must be followed by a number\n" );
- }
-#ifdef OLD_POWERBOOK_G3
- ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n");
-#else
- darwinDesiredRefresh = atoi( argv[i+1] );
- ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh );
-#endif
- return 2;
- }
-
- if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
- DarwinPrintBanner();
- exit(0);
- }
-
- // XDarwinStartup uses this argument to indicate the IOKit X server
- // should be started. Ignore it here.
- if ( !strcmp( argv[i], "-iokit" ) ) {
- return 1;
- }
-
- return 0;
-}
-
-
-/*
- * ddxUseMsg --
- * Print out correct use of device dependent commandline options.
- * Maybe the user now knows what really to do ...
- */
-void ddxUseMsg( void )
-{
- ErrorF("\n");
- ErrorF("\n");
- ErrorF("Device Dependent Usage:\n");
- ErrorF("\n");
- ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
- ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
- ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
- ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
- ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
- ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
- ErrorF("-version : show the server version.\n");
- ErrorF("\n");
-#ifdef DARWIN_WITH_QUARTZ
- ErrorF("Quartz modes:\n");
- ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n");
- ErrorF("-rootless : run rootless inside Mac OS X window server.\n");
- ErrorF("-quartz : use default Mac OS X window server mode\n");
- ErrorF("\n");
- ErrorF("Options ignored in rootless mode:\n");
-#endif
- ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
- ErrorF("-depth <8,15,24> : use this bit depth.\n");
- ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
- ErrorF("\n");
-}
-
-
-/*
- * ddxGiveUp --
- * Device dependent cleanup. Called by dix before normal server death.
- */
-void ddxGiveUp( void )
-{
- ErrorF( "Quitting XDarwin...\n" );
-
- DarwinModeGiveUp();
-}
-
-
-/*
- * AbortDDX --
- * DDX - specific abort routine. Called by AbortServer(). The attempt is
- * made to restore all original setting of the displays. Also all devices
- * are closed.
- */
-void AbortDDX( void )
-{
- ErrorF( " AbortDDX\n" );
- /*
- * This is needed for a abnormal server exit, since the normal exit stuff
- * MUST also be performed (i.e. the vt must be left in a defined state)
- */
- ddxGiveUp();
-}
-
-
-#ifdef DPMSExtension
-/*
- * DPMS extension stubs
- */
-Bool DPMSSupported(void)
-{
- return FALSE;
-}
-
-void DPMSSet(int level)
-{
-}
-
-int DPMSGet(int *level)
-{
- return -1;
-}
-#endif
-
-
-#include "mivalidate.h" // for union _Validate used by windowstr.h
-#include "windowstr.h" // for struct _Window
-#include "scrnintstr.h" // for struct _Screen
-
-// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
-// Quartz mode uses this when switching in and out of Quartz.
-// Quartz or IOKit can use this when waking from sleep.
-// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
-
-/*
- * xf86SetRootClip --
- * Enable or disable rendering to the screen by
- * setting the root clip list and revalidating
- * all of the windows
- */
-
-void
-xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
-{
- WindowPtr pWin = WindowTable[pScreen->myNum];
- WindowPtr pChild;
- Bool WasViewable = (Bool)(pWin->viewable);
- Bool anyMarked = TRUE;
- RegionPtr pOldClip = NULL, bsExposed;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
- BoxRec box;
-
- if (WasViewable)
- {
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
- {
- (void) (*pScreen->MarkOverlappedWindows)(pChild,
- pChild,
- &pLayerWin);
- }
- (*pScreen->MarkWindow) (pWin);
- anyMarked = TRUE;
- if (pWin->valdata)
- {
- if (HasBorder (pWin))
- {
- RegionPtr borderVisible;
-
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- }
- pWin->valdata->before.resized = TRUE;
- }
- }
-
- /*
- * Use REGION_BREAK to avoid optimizations in ValidateTree
- * that assume the root borderClip can't change well, normally
- * it doesn't...)
- */
- if (enable)
- {
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_RESET(pScreen, &pWin->borderClip, &box);
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
- }
- else
- {
- REGION_EMPTY(pScreen, &pWin->borderClip);
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
- }
-
- ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
-
- if (WasViewable)
- {
- if (pWin->backStorage)
- {
- pOldClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, pOldClip, &pWin->clipList);
- }
-
- if (pWin->firstChild)
- {
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
- pWin->firstChild,
- (WindowPtr *)NULL);
- }
- else
- {
- (*pScreen->MarkWindow) (pWin);
- anyMarked = TRUE;
- }
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
- }
-
- if (pWin->backStorage &&
- ((pWin->backingStore == Always) || WasViewable))
- {
- if (!WasViewable)
- pOldClip = &pWin->clipList; /* a convenient empty region */
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, pOldClip,
- pWin->drawable.x, pWin->drawable.y);
- if (WasViewable)
- REGION_DESTROY(pScreen, pOldClip);
- if (bsExposed)
- {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- }
- if (WasViewable)
- {
- if (anyMarked)
- (*pScreen->HandleExposures)(pWin);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
- FlushAllOutput ();
-}
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
deleted file mode 100644
index 79fa00ffc..000000000
--- a/hw/darwin/darwin.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */
-
-#ifndef _DARWIN_H
-#define _DARWIN_H
-
-#include <IOKit/IOTypes.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "extensions/XKB.h"
-
-typedef struct {
- void *framebuffer;
- int x;
- int y;
- int width;
- int height;
- int pitch;
- int colorType;
- int bitsPerPixel;
- int colorBitsPerPixel;
- int bitsPerComponent;
-} DarwinFramebufferRec, *DarwinFramebufferPtr;
-
-
-// From darwin.c
-void DarwinPrintBanner();
-void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
-void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
-
-// From darwinEvents.c
-Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
-void DarwinEQEnqueue(const xEvent *e);
-void DarwinEQPointerPost(xEvent *e);
-void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
-
-// From darwinKeyboard.c
-int DarwinModifierNXKeyToNXKeycode(int key, int side);
-void DarwinKeyboardInit(DeviceIntPtr pDev);
-int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
-int DarwinModifierNXKeyToNXMask(int key);
-int DarwinModifierNXMaskToNXKey(int mask);
-int DarwinModifierStringToNXKey(const char *string);
-
-// Mode specific functions
-Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
-Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
-void DarwinModeInitOutput(int argc,char **argv);
-void DarwinModeInitInput(int argc, char **argv);
-int DarwinModeProcessArgument(int argc, char *argv[], int i);
-void DarwinModeProcessEvent(xEvent *xe);
-void DarwinModeGiveUp(void);
-void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
-
-
-#undef assert
-#define assert(x) { if ((x) == 0) \
- FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
-#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
- FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
- __LINE__, __FILE__, x); }
-#define SCREEN_PRIV(pScreen) \
- ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
-
-
-#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
-
-
-/*
- * Global variables from darwin.c
- */
-extern int darwinScreenIndex; // index into pScreen.devPrivates
-extern int darwinScreensFound;
-extern io_connect_t darwinParamConnect;
-extern int darwinEventReadFD;
-extern int darwinEventWriteFD;
-
-// User preferences
-extern int darwinMouseAccelChange;
-extern int darwinFakeButtons;
-extern int darwinFakeMouse2Mask;
-extern int darwinFakeMouse3Mask;
-extern char *darwinKeymapFile;
-extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
-extern int darwinDesiredDepth;
-extern int darwinDesiredRefresh;
-
-// location of X11's (0,0) point in global screen coordinates
-extern int darwinMainScreenX;
-extern int darwinMainScreenY;
-
-
-/*
- * Special ddx events understood by the X server
- */
-enum {
- kXDarwinUpdateModifiers // update all modifier keys
- = LASTEvent+1, // (from X.h list of event names)
- kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
- kXDarwinScrollWheel, // scroll wheel event
-
- /*
- * Quartz-specific events -- not used in IOKit mode
- */
- kXDarwinActivate, // restore X drawing and cursor
- kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor
- kXDarwinSetRootClip, // enable or disable drawing to the X screen
- kXDarwinQuit, // kill the X server and release the display
- kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
- kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
- /*
- * AppleWM events
- */
- kXDarwinControllerNotify, // send an AppleWMControllerNotify event
- kXDarwinPasteboardNotify, // notify the WM to copy or paste
- /*
- * Xplugin notification events
- */
- kXDarwinDisplayChanged, // display configuration has changed
- kXDarwinWindowState, // window visibility state has changed
- kXDarwinWindowMoved // window has moved on screen
-};
-
-#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/darwin/darwinClut8.h
deleted file mode 100644
index 68a7ad16f..000000000
--- a/hw/darwin/darwinClut8.h
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Darwin default 8-bit Colormap for StaticColor
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.2 2003/03/04 01:37:59 torrey Exp $ */
-
-#ifndef _DARWIN_CLUT8_
-#define _DARWIN_CLUT8_
-
-#ifdef USE_NEW_CLUT
-
-static xColorItem darwinClut8[] = {
- { 0, 0xffff, 0xffff, 0xffff, 0, 0 },
- { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 },
- { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 },
- { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 },
- { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 },
- { 5, 0xffff, 0xffff, 0x0, 0, 0 },
- { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 },
- { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 },
- { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 },
- { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 },
- { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 },
- { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 },
- { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 },
- { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 },
- { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 },
- { 15, 0x0, 0x0, 0x0, 0, 0 },
- { 16, 0xefef, 0xefef, 0xefef, 0, 0 },
- { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
- { 18, 0xeded, 0xeded, 0xeded, 0, 0 },
- { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 },
- { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 },
- { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 },
- { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 },
- { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 },
- { 24, 0xffff, 0x0, 0xffff, 0, 0 },
- { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 },
- { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 },
- { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 },
- { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 },
- { 29, 0xdede, 0xdede, 0xdede, 0, 0 },
- { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
- { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 },
- { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 },
- { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 },
- { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 },
- { 35, 0xffff, 0x0, 0x0, 0, 0 },
- { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 },
- { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 },
- { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 },
- { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 },
- { 40, 0xa3a3, 0x606, 0x4545, 0, 0 },
- { 41, 0xcece, 0xcece, 0xcece, 0, 0 },
- { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
- { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
- { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 },
- { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 },
- { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 },
- { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 },
- { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 },
- { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 },
- { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 },
- { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 },
- { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 },
- { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 },
- { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 },
- { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 },
- { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 },
- { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 },
- { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 },
- { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 },
- { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 },
- { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 },
- { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 },
- { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 },
- { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 },
- { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 },
- { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 },
- { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 },
- { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 },
- { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 },
- { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 },
- { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 },
- { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 },
- { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 },
- { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 },
- { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 },
- { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 },
- { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 },
- { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 },
- { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 },
- { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 },
- { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 },
- { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 },
- { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 },
- { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 },
- { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 },
- { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 },
- { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 },
- { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 },
- { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 },
- { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 },
- { 91, 0x6060, 0x5353, 0xadad, 0, 0 },
- { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 },
- { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 },
- { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 },
- { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 },
- { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 },
- { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 },
- { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 },
- { 99, 0x4141, 0x4444, 0xbaba, 0, 0 },
- { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 },
- { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 },
- { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 },
- { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 },
- { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 },
- { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 },
- { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 },
- { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 },
- { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 },
- { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 },
- { 110, 0x3434, 0x6565, 0xafaf, 0, 0 },
- { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 },
- { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 },
- { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 },
- { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 },
- { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 },
- { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 },
- { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 },
- { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 },
- { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 },
- { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 },
- { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 },
- { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 },
- { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 },
- { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 },
- { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 },
- { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 },
- { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 },
- { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 },
- { 129, 0x0, 0x5f5f, 0x7979, 0, 0 },
- { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 },
- { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 },
- { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 },
- { 133, 0x2424, 0x8282, 0x8383, 0, 0 },
- { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 },
- { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 },
- { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 },
- { 137, 0xa0a, 0x9393, 0x8585, 0, 0 },
- { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 },
- { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 },
- { 140, 0x404, 0x8181, 0x7272, 0, 0 },
- { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 },
- { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 },
- { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 },
- { 144, 0x202, 0x8c8c, 0x5050, 0, 0 },
- { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 },
- { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 },
- { 147, 0x202, 0x7d7d, 0x3939, 0, 0 },
- { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 },
- { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 },
- { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 },
- { 151, 0x101, 0x8888, 0x2a2a, 0, 0 },
- { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 },
- { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 },
- { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 },
- { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 },
- { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 },
- { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 },
- { 158, 0x0, 0x8e8e, 0x1919, 0, 0 },
- { 159, 0x1010, 0xafaf, 0x2828, 0, 0 },
- { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 },
- { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 },
- { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 },
- { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 },
- { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 },
- { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 },
- { 166, 0x1212, 0xbaba, 0x1717, 0, 0 },
- { 167, 0x101, 0x8a8a, 0x202, 0, 0 },
- { 168, 0x303, 0x9a9a, 0x202, 0, 0 },
- { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 },
- { 170, 0x808, 0xb2b2, 0x505, 0, 0 },
- { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 },
- { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 },
- { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 },
- { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 },
- { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 },
- { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 },
- { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 },
- { 178, 0x2929, 0xa5a5, 0x808, 0, 0 },
- { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 },
- { 180, 0x0, 0xffff, 0xffff, 0, 0 },
- { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 },
- { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 },
- { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 },
- { 184, 0x5555, 0xcccc, 0x1515, 0, 0 },
- { 185, 0x0, 0xffff, 0x0, 0, 0 },
- { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 },
- { 187, 0x4343, 0xa7a7, 0x101, 0, 0 },
- { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 },
- { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 },
- { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 },
- { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 },
- { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 },
- { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 },
- { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 },
- { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 },
- { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 },
- { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 },
- { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 },
- { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 },
- { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 },
- { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 },
- { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 },
- { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 },
- { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 },
- { 205, 0x9898, 0x9696, 0x202, 0, 0 },
- { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 },
- { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 },
- { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 },
- { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 },
- { 210, 0x0, 0x0, 0xffff, 0, 0 },
- { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 },
- { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 },
- { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 },
- { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 },
- { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 },
- { 216, 0xdddd, 0x0, 0x0, 0, 0 },
- { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 },
- { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 },
- { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 },
- { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 },
- { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 },
- { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 },
- { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 },
- { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 },
- { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 },
- { 226, 0xadad, 0x5252, 0xf0f, 0, 0 },
- { 227, 0x0, 0xbbbb, 0x0, 0, 0 },
- { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 },
- { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 },
- { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 },
- { 231, 0xa4a4, 0x3434, 0x303, 0, 0 },
- { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 },
- { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 },
- { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 },
- { 235, 0xa9a9, 0x2222, 0x606, 0, 0 },
- { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 },
- { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 },
- { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 },
- { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 },
- { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 },
- { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 },
- { 242, 0xacac, 0xacac, 0xacac, 0, 0 },
- { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 },
- { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 },
- { 245, 0x9292, 0x9292, 0x9292, 0, 0 },
- { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 },
- { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
- { 248, 0x8181, 0x8181, 0x8181, 0, 0 },
- { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
- { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
- { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
- { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
- { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
- { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 },
- { 255, 0x0, 0x0, 0x0, 0, 0 },
-};
-
-#else /* !USE_NEW_CLUT */
-
-static xColorItem darwinClut8[] = {
- { 0, 0x0000, 0x0000, 0x0000, 0, 0 },
- { 1, 0xffff, 0xffff, 0xcccc, 0, 0 },
- { 2, 0xffff, 0xffff, 0x9999, 0, 0 },
- { 3, 0xffff, 0xffff, 0x6666, 0, 0 },
- { 4, 0xffff, 0xffff, 0x3333, 0, 0 },
- { 5, 0xffff, 0xffff, 0x0000, 0, 0 },
- { 6, 0xffff, 0xcccc, 0xffff, 0, 0 },
- { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 },
- { 8, 0xffff, 0xcccc, 0x9999, 0, 0 },
- { 9, 0xffff, 0xcccc, 0x6666, 0, 0 },
- { 10, 0xffff, 0xcccc, 0x3333, 0, 0 },
- { 11, 0xffff, 0xcccc, 0x0000, 0, 0 },
- { 12, 0xffff, 0x9999, 0xffff, 0, 0 },
- { 13, 0xffff, 0x9999, 0xcccc, 0, 0 },
- { 14, 0xffff, 0x9999, 0x9999, 0, 0 },
- { 15, 0xffff, 0x9999, 0x6666, 0, 0 },
- { 16, 0xffff, 0x9999, 0x3333, 0, 0 },
- { 17, 0xffff, 0x9999, 0x0000, 0, 0 },
- { 18, 0xffff, 0x6666, 0xffff, 0, 0 },
- { 19, 0xffff, 0x6666, 0xcccc, 0, 0 },
- { 20, 0xffff, 0x6666, 0x9999, 0, 0 },
- { 21, 0xffff, 0x6666, 0x6666, 0, 0 },
- { 22, 0xffff, 0x6666, 0x3333, 0, 0 },
- { 23, 0xffff, 0x6666, 0x0000, 0, 0 },
- { 24, 0xffff, 0x3333, 0xffff, 0, 0 },
- { 25, 0xffff, 0x3333, 0xcccc, 0, 0 },
- { 26, 0xffff, 0x3333, 0x9999, 0, 0 },
- { 27, 0xffff, 0x3333, 0x6666, 0, 0 },
- { 28, 0xffff, 0x3333, 0x3333, 0, 0 },
- { 29, 0xffff, 0x3333, 0x0000, 0, 0 },
- { 30, 0xffff, 0x0000, 0xffff, 0, 0 },
- { 31, 0xffff, 0x0000, 0xcccc, 0, 0 },
- { 32, 0xffff, 0x0000, 0x9999, 0, 0 },
- { 33, 0xffff, 0x0000, 0x6666, 0, 0 },
- { 34, 0xffff, 0x0000, 0x3333, 0, 0 },
- { 35, 0xffff, 0x0000, 0x0000, 0, 0 },
- { 36, 0xcccc, 0xffff, 0xffff, 0, 0 },
- { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 },
- { 38, 0xcccc, 0xffff, 0x9999, 0, 0 },
- { 39, 0xcccc, 0xffff, 0x6666, 0, 0 },
- { 40, 0xcccc, 0xffff, 0x3333, 0, 0 },
- { 41, 0xcccc, 0xffff, 0x0000, 0, 0 },
- { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
- { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
- { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 },
- { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 },
- { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 },
- { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 },
- { 48, 0xcccc, 0x9999, 0xffff, 0, 0 },
- { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 },
- { 50, 0xcccc, 0x9999, 0x9999, 0, 0 },
- { 51, 0xcccc, 0x9999, 0x6666, 0, 0 },
- { 52, 0xcccc, 0x9999, 0x3333, 0, 0 },
- { 53, 0xcccc, 0x9999, 0x0000, 0, 0 },
- { 54, 0xcccc, 0x6666, 0xffff, 0, 0 },
- { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 },
- { 56, 0xcccc, 0x6666, 0x9999, 0, 0 },
- { 57, 0xcccc, 0x6666, 0x6666, 0, 0 },
- { 58, 0xcccc, 0x6666, 0x3333, 0, 0 },
- { 59, 0xcccc, 0x6666, 0x0000, 0, 0 },
- { 60, 0xcccc, 0x3333, 0xffff, 0, 0 },
- { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 },
- { 62, 0xcccc, 0x3333, 0x9999, 0, 0 },
- { 63, 0xcccc, 0x3333, 0x6666, 0, 0 },
- { 64, 0xcccc, 0x3333, 0x3333, 0, 0 },
- { 65, 0xcccc, 0x3333, 0x0000, 0, 0 },
- { 66, 0xcccc, 0x0000, 0xffff, 0, 0 },
- { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 },
- { 68, 0xcccc, 0x0000, 0x9999, 0, 0 },
- { 69, 0xcccc, 0x0000, 0x6666, 0, 0 },
- { 70, 0xcccc, 0x0000, 0x3333, 0, 0 },
- { 71, 0xcccc, 0x0000, 0x0000, 0, 0 },
- { 72, 0x9999, 0xffff, 0xffff, 0, 0 },
- { 73, 0x9999, 0xffff, 0xcccc, 0, 0 },
- { 74, 0x9999, 0xffff, 0x9999, 0, 0 },
- { 75, 0x9999, 0xffff, 0x6666, 0, 0 },
- { 76, 0x9999, 0xffff, 0x3333, 0, 0 },
- { 77, 0x9999, 0xffff, 0x0000, 0, 0 },
- { 78, 0x9999, 0xcccc, 0xffff, 0, 0 },
- { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 },
- { 80, 0x9999, 0xcccc, 0x9999, 0, 0 },
- { 81, 0x9999, 0xcccc, 0x6666, 0, 0 },
- { 82, 0x9999, 0xcccc, 0x3333, 0, 0 },
- { 83, 0x9999, 0xcccc, 0x0000, 0, 0 },
- { 84, 0x9999, 0x9999, 0xffff, 0, 0 },
- { 85, 0x9999, 0x9999, 0xcccc, 0, 0 },
- { 86, 0x9999, 0x9999, 0x9999, 0, 0 },
- { 87, 0x9999, 0x9999, 0x6666, 0, 0 },
- { 88, 0x9999, 0x9999, 0x3333, 0, 0 },
- { 89, 0x9999, 0x9999, 0x0000, 0, 0 },
- { 90, 0x9999, 0x6666, 0xffff, 0, 0 },
- { 91, 0x9999, 0x6666, 0xcccc, 0, 0 },
- { 92, 0x9999, 0x6666, 0x9999, 0, 0 },
- { 93, 0x9999, 0x6666, 0x6666, 0, 0 },
- { 94, 0x9999, 0x6666, 0x3333, 0, 0 },
- { 95, 0x9999, 0x6666, 0x0000, 0, 0 },
- { 96, 0x9999, 0x3333, 0xffff, 0, 0 },
- { 97, 0x9999, 0x3333, 0xcccc, 0, 0 },
- { 98, 0x9999, 0x3333, 0x9999, 0, 0 },
- { 99, 0x9999, 0x3333, 0x6666, 0, 0 },
- { 100, 0x9999, 0x3333, 0x3333, 0, 0 },
- { 101, 0x9999, 0x3333, 0x0000, 0, 0 },
- { 102, 0x9999, 0x0000, 0xffff, 0, 0 },
- { 103, 0x9999, 0x0000, 0xcccc, 0, 0 },
- { 104, 0x9999, 0x0000, 0x9999, 0, 0 },
- { 105, 0x9999, 0x0000, 0x6666, 0, 0 },
- { 106, 0x9999, 0x0000, 0x3333, 0, 0 },
- { 107, 0x9999, 0x0000, 0x0000, 0, 0 },
- { 108, 0x6666, 0xffff, 0xffff, 0, 0 },
- { 109, 0x6666, 0xffff, 0xcccc, 0, 0 },
- { 110, 0x6666, 0xffff, 0x9999, 0, 0 },
- { 111, 0x6666, 0xffff, 0x6666, 0, 0 },
- { 112, 0x6666, 0xffff, 0x3333, 0, 0 },
- { 113, 0x6666, 0xffff, 0x0000, 0, 0 },
- { 114, 0x6666, 0xcccc, 0xffff, 0, 0 },
- { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 },
- { 116, 0x6666, 0xcccc, 0x9999, 0, 0 },
- { 117, 0x6666, 0xcccc, 0x6666, 0, 0 },
- { 118, 0x6666, 0xcccc, 0x3333, 0, 0 },
- { 119, 0x6666, 0xcccc, 0x0000, 0, 0 },
- { 120, 0x6666, 0x9999, 0xffff, 0, 0 },
- { 121, 0x6666, 0x9999, 0xcccc, 0, 0 },
- { 122, 0x6666, 0x9999, 0x9999, 0, 0 },
- { 123, 0x6666, 0x9999, 0x6666, 0, 0 },
- { 124, 0x6666, 0x9999, 0x3333, 0, 0 },
- { 125, 0x6666, 0x9999, 0x0000, 0, 0 },
- { 126, 0x6666, 0x6666, 0xffff, 0, 0 },
- { 127, 0x6666, 0x6666, 0xcccc, 0, 0 },
- { 128, 0x6666, 0x6666, 0x9999, 0, 0 },
- { 129, 0x6666, 0x6666, 0x6666, 0, 0 },
- { 130, 0x6666, 0x6666, 0x3333, 0, 0 },
- { 131, 0x6666, 0x6666, 0x0000, 0, 0 },
- { 132, 0x6666, 0x3333, 0xffff, 0, 0 },
- { 133, 0x6666, 0x3333, 0xcccc, 0, 0 },
- { 134, 0x6666, 0x3333, 0x9999, 0, 0 },
- { 135, 0x6666, 0x3333, 0x6666, 0, 0 },
- { 136, 0x6666, 0x3333, 0x3333, 0, 0 },
- { 137, 0x6666, 0x3333, 0x0000, 0, 0 },
- { 138, 0x6666, 0x0000, 0xffff, 0, 0 },
- { 139, 0x6666, 0x0000, 0xcccc, 0, 0 },
- { 140, 0x6666, 0x0000, 0x9999, 0, 0 },
- { 141, 0x6666, 0x0000, 0x6666, 0, 0 },
- { 142, 0x6666, 0x0000, 0x3333, 0, 0 },
- { 143, 0x6666, 0x0000, 0x0000, 0, 0 },
- { 144, 0x3333, 0xffff, 0xffff, 0, 0 },
- { 145, 0x3333, 0xffff, 0xcccc, 0, 0 },
- { 146, 0x3333, 0xffff, 0x9999, 0, 0 },
- { 147, 0x3333, 0xffff, 0x6666, 0, 0 },
- { 148, 0x3333, 0xffff, 0x3333, 0, 0 },
- { 149, 0x3333, 0xffff, 0x0000, 0, 0 },
- { 150, 0x3333, 0xcccc, 0xffff, 0, 0 },
- { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 },
- { 152, 0x3333, 0xcccc, 0x9999, 0, 0 },
- { 153, 0x3333, 0xcccc, 0x6666, 0, 0 },
- { 154, 0x3333, 0xcccc, 0x3333, 0, 0 },
- { 155, 0x3333, 0xcccc, 0x0000, 0, 0 },
- { 156, 0x3333, 0x9999, 0xffff, 0, 0 },
- { 157, 0x3333, 0x9999, 0xcccc, 0, 0 },
- { 158, 0x3333, 0x9999, 0x9999, 0, 0 },
- { 159, 0x3333, 0x9999, 0x6666, 0, 0 },
- { 160, 0x3333, 0x9999, 0x3333, 0, 0 },
- { 161, 0x3333, 0x9999, 0x0000, 0, 0 },
- { 162, 0x3333, 0x6666, 0xffff, 0, 0 },
- { 163, 0x3333, 0x6666, 0xcccc, 0, 0 },
- { 164, 0x3333, 0x6666, 0x9999, 0, 0 },
- { 165, 0x3333, 0x6666, 0x6666, 0, 0 },
- { 166, 0x3333, 0x6666, 0x3333, 0, 0 },
- { 167, 0x3333, 0x6666, 0x0000, 0, 0 },
- { 168, 0x3333, 0x3333, 0xffff, 0, 0 },
- { 169, 0x3333, 0x3333, 0xcccc, 0, 0 },
- { 170, 0x3333, 0x3333, 0x9999, 0, 0 },
- { 171, 0x3333, 0x3333, 0x6666, 0, 0 },
- { 172, 0x3333, 0x3333, 0x3333, 0, 0 },
- { 173, 0x3333, 0x3333, 0x0000, 0, 0 },
- { 174, 0x3333, 0x0000, 0xffff, 0, 0 },
- { 175, 0x3333, 0x0000, 0xcccc, 0, 0 },
- { 176, 0x3333, 0x0000, 0x9999, 0, 0 },
- { 177, 0x3333, 0x0000, 0x6666, 0, 0 },
- { 178, 0x3333, 0x0000, 0x3333, 0, 0 },
- { 179, 0x3333, 0x0000, 0x0000, 0, 0 },
- { 180, 0x0000, 0xffff, 0xffff, 0, 0 },
- { 181, 0x0000, 0xffff, 0xcccc, 0, 0 },
- { 182, 0x0000, 0xffff, 0x9999, 0, 0 },
- { 183, 0x0000, 0xffff, 0x6666, 0, 0 },
- { 184, 0x0000, 0xffff, 0x3333, 0, 0 },
- { 185, 0x0000, 0xffff, 0x0000, 0, 0 },
- { 186, 0x0000, 0xcccc, 0xffff, 0, 0 },
- { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 },
- { 188, 0x0000, 0xcccc, 0x9999, 0, 0 },
- { 189, 0x0000, 0xcccc, 0x6666, 0, 0 },
- { 190, 0x0000, 0xcccc, 0x3333, 0, 0 },
- { 191, 0x0000, 0xcccc, 0x0000, 0, 0 },
- { 192, 0x0000, 0x9999, 0xffff, 0, 0 },
- { 193, 0x0000, 0x9999, 0xcccc, 0, 0 },
- { 194, 0x0000, 0x9999, 0x9999, 0, 0 },
- { 195, 0x0000, 0x9999, 0x6666, 0, 0 },
- { 196, 0x0000, 0x9999, 0x3333, 0, 0 },
- { 197, 0x0000, 0x9999, 0x0000, 0, 0 },
- { 198, 0x0000, 0x6666, 0xffff, 0, 0 },
- { 199, 0x0000, 0x6666, 0xcccc, 0, 0 },
- { 200, 0x0000, 0x6666, 0x9999, 0, 0 },
- { 201, 0x0000, 0x6666, 0x6666, 0, 0 },
- { 202, 0x0000, 0x6666, 0x3333, 0, 0 },
- { 203, 0x0000, 0x6666, 0x0000, 0, 0 },
- { 204, 0x0000, 0x3333, 0xffff, 0, 0 },
- { 205, 0x0000, 0x3333, 0xcccc, 0, 0 },
- { 206, 0x0000, 0x3333, 0x9999, 0, 0 },
- { 207, 0x0000, 0x3333, 0x6666, 0, 0 },
- { 208, 0x0000, 0x3333, 0x3333, 0, 0 },
- { 209, 0x0000, 0x3333, 0x0000, 0, 0 },
- { 210, 0x0000, 0x0000, 0xffff, 0, 0 },
- { 211, 0x0000, 0x0000, 0xcccc, 0, 0 },
- { 212, 0x0000, 0x0000, 0x9999, 0, 0 },
- { 213, 0x0000, 0x0000, 0x6666, 0, 0 },
- { 214, 0x0000, 0x0000, 0x3333, 0, 0 },
- { 215, 0xeeee, 0x0000, 0x0000, 0, 0 },
- { 216, 0xdddd, 0x0000, 0x0000, 0, 0 },
- { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 },
- { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 },
- { 219, 0x8888, 0x0000, 0x0000, 0, 0 },
- { 220, 0x7777, 0x0000, 0x0000, 0, 0 },
- { 221, 0x5555, 0x0000, 0x0000, 0, 0 },
- { 222, 0x4444, 0x0000, 0x0000, 0, 0 },
- { 223, 0x2222, 0x0000, 0x0000, 0, 0 },
- { 224, 0x1111, 0x0000, 0x0000, 0, 0 },
- { 225, 0x0000, 0xeeee, 0x0000, 0, 0 },
- { 226, 0x0000, 0xdddd, 0x0000, 0, 0 },
- { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 },
- { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 },
- { 229, 0x0000, 0x8888, 0x0000, 0, 0 },
- { 230, 0x0000, 0x7777, 0x0000, 0, 0 },
- { 231, 0x0000, 0x5555, 0x0000, 0, 0 },
- { 232, 0x0000, 0x4444, 0x0000, 0, 0 },
- { 233, 0x0000, 0x2222, 0x0000, 0, 0 },
- { 234, 0x0000, 0x1111, 0x0000, 0, 0 },
- { 235, 0x0000, 0x0000, 0xeeee, 0, 0 },
- { 236, 0x0000, 0x0000, 0xdddd, 0, 0 },
- { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 },
- { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 },
- { 239, 0x0000, 0x0000, 0x8888, 0, 0 },
- { 240, 0x0000, 0x0000, 0x7777, 0, 0 },
- { 241, 0x0000, 0x0000, 0x5555, 0, 0 },
- { 242, 0x0000, 0x0000, 0x4444, 0, 0 },
- { 243, 0x0000, 0x0000, 0x2222, 0, 0 },
- { 244, 0x0000, 0x0000, 0x1111, 0, 0 },
- { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
- { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
- { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
- { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 },
- { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
- { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
- { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
- { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
- { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
- { 254, 0x1111, 0x1111, 0x1111, 0, 0 },
- { 255, 0xffff, 0xffff, 0xffff, 0, 0 }
-};
-#endif /* USE_NEW_CLUT */
-
-#endif /* _DARWIN_CLUT8_ */
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
deleted file mode 100644
index ba1ec8fc2..000000000
--- a/hw/darwin/darwinEvents.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Darwin event queue and event handling
- */
-/*
-Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved.
-
-This file is based on mieq.c by Keith Packard,
-which contains the following copyright:
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.5 2003/11/03 05:36:30 tsi Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "inputstr.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "mipointer.h"
-
-#include "darwin.h"
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <IOKit/hidsystem/IOLLEvent.h>
-
-/* Fake button press/release for scroll wheel move. */
-#define SCROLLWHEELUPFAKE 4
-#define SCROLLWHEELDOWNFAKE 5
-
-#define QUEUE_SIZE 256
-
-typedef struct _Event {
- xEvent event;
- ScreenPtr pScreen;
-} EventRec, *EventPtr;
-
-typedef struct _EventQueue {
- HWEventQueueType head, tail; /* long for SetInputCheck */
- CARD32 lastEventTime; /* to avoid time running backwards */
- Bool lastMotion;
- EventRec events[QUEUE_SIZE]; /* static allocation for signals */
- DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
- ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
- ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
-} EventQueueRec, *EventQueuePtr;
-
-static EventQueueRec darwinEventQueue;
-
-
-/*
- * DarwinPressModifierMask
- * Press or release the given modifier key, specified by its mask.
- */
-static void DarwinPressModifierMask(
- xEvent *xe, // must already have type, time and mouse location
- int mask) // one of NX_*MASK constants
-{
- int key = DarwinModifierNXMaskToNXKey(mask);
-
- if (key != -1) {
- int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
- if (keycode != 0) {
- xe->u.u.detail = keycode + MIN_KEYCODE;
- (*darwinEventQueue.pKbd->processInputProc)(xe,
- (DeviceIntPtr)darwinEventQueue.pKbd, 1);
- }
- }
-}
-
-
-/*
- * DarwinUpdateModifiers
- * Send events to update the modifier state.
- */
-static void DarwinUpdateModifiers(
- xEvent *xe, // event template with time and mouse position set
- int pressed, // KeyPress or KeyRelease
- int flags ) // modifier flags that have changed
-{
- xe->u.u.type = pressed;
- if (flags & NX_ALPHASHIFTMASK) {
- DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
- }
- if (flags & NX_COMMANDMASK) {
- DarwinPressModifierMask(xe, NX_COMMANDMASK);
- }
- if (flags & NX_CONTROLMASK) {
- DarwinPressModifierMask(xe, NX_CONTROLMASK);
- }
- if (flags & NX_ALTERNATEMASK) {
- DarwinPressModifierMask(xe, NX_ALTERNATEMASK);
- }
- if (flags & NX_SHIFTMASK) {
- DarwinPressModifierMask(xe, NX_SHIFTMASK);
- }
- if (flags & NX_SECONDARYFNMASK) {
- DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
- }
-}
-
-
-/*
- * DarwinSimulateMouseClick
- * Send a mouse click to X when multiple mouse buttons are simulated
- * with modifier-clicks, such as command-click for button 2. The dix
- * layer is told that the previously pressed modifier key(s) are
- * released, the simulated click event is sent. After the mouse button
- * is released, the modifier keys are reverted to their actual state,
- * which may or may not be pressed at that point. This is usually
- * closest to what the user wants. Ie. the user typically wants to
- * simulate a button 2 press instead of Command-button 2.
- */
-static void DarwinSimulateMouseClick(
- xEvent *xe, // event template with time and
- // mouse position filled in
- int whichButton, // mouse button to be pressed
- int modifierMask) // modifiers used for the fake click
-{
- // first fool X into forgetting about the keys
- DarwinUpdateModifiers(xe, KeyRelease, modifierMask);
-
- // push the mouse button
- xe->u.u.type = ButtonPress;
- xe->u.u.detail = whichButton;
- (*darwinEventQueue.pPtr->processInputProc)
- (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-}
-
-
-Bool
-DarwinEQInit(
- DevicePtr pKbd,
- DevicePtr pPtr)
-{
- darwinEventQueue.head = darwinEventQueue.tail = 0;
- darwinEventQueue.lastEventTime = GetTimeInMillis ();
- darwinEventQueue.pKbd = pKbd;
- darwinEventQueue.pPtr = pPtr;
- darwinEventQueue.pEnqueueScreen = screenInfo.screens[0];
- darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen;
- SetInputCheck (&darwinEventQueue.head, &darwinEventQueue.tail);
- return TRUE;
-}
-
-
-/*
- * DarwinEQEnqueue
- * Must be thread safe with ProcessInputEvents.
- * DarwinEQEnqueue - called from event gathering thread
- * ProcessInputEvents - called from X server thread
- * DarwinEQEnqueue should never be called from more than one thread.
- */
-void
-DarwinEQEnqueue(
- const xEvent *e)
-{
- HWEventQueueType oldtail, newtail;
- char byte = 0;
-
- oldtail = darwinEventQueue.tail;
-
- // mieqEnqueue() collapses successive motion events into one event.
- // This is difficult to do in a thread-safe way and rarely useful.
-
- newtail = oldtail + 1;
- if (newtail == QUEUE_SIZE)
- newtail = 0;
- /* Toss events which come in late */
- if (newtail == darwinEventQueue.head)
- return;
-
- darwinEventQueue.events[oldtail].event = *e;
- /*
- * Make sure that event times don't go backwards - this
- * is "unnecessary", but very useful
- */
- if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime &&
- darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
- {
- darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time =
- darwinEventQueue.lastEventTime;
- }
- darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen;
-
- // Update the tail after the event is prepared
- darwinEventQueue.tail = newtail;
-
- // Signal there is an event ready to handle
- write(darwinEventWriteFD, &byte, 1);
-}
-
-
-/*
- * DarwinEQPointerPost
- * Post a pointer event. Used by the mipointer.c routines.
- */
-void
-DarwinEQPointerPost(
- xEvent *e)
-{
- (*darwinEventQueue.pPtr->processInputProc)
- (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-}
-
-
-void
-DarwinEQSwitchScreen(
- ScreenPtr pScreen,
- Bool fromDIX)
-{
- darwinEventQueue.pEnqueueScreen = pScreen;
- if (fromDIX)
- darwinEventQueue.pDequeueScreen = pScreen;
-}
-
-
-/*
- * ProcessInputEvents
- * Read and process events from the event queue until it is empty.
- */
-void ProcessInputEvents(void)
-{
- EventRec *e;
- int x, y;
- xEvent xe;
- static int old_flags = 0; // last known modifier state
- // button number and modifier mask of currently pressed fake button
- static int darwinFakeMouseButtonDown = 0;
- static int darwinFakeMouseButtonMask = 0;
-
- // Empty the signaling pipe
- x = sizeof(xe);
- while (x == sizeof(xe)) {
- x = read(darwinEventReadFD, &xe, sizeof(xe));
- }
-
- while (darwinEventQueue.head != darwinEventQueue.tail)
- {
- if (screenIsSaved == SCREEN_SAVER_ON)
- SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
-
- e = &darwinEventQueue.events[darwinEventQueue.head];
- xe = e->event;
-
- // Shift from global screen coordinates to coordinates relative to
- // the origin of the current screen.
- xe.u.keyButtonPointer.rootX -= darwinMainScreenX +
- dixScreenOrigins[miPointerCurrentScreen()->myNum].x;
- xe.u.keyButtonPointer.rootY -= darwinMainScreenY +
- dixScreenOrigins[miPointerCurrentScreen()->myNum].y;
-
- /*
- * Assumption - screen switching can only occur on motion events
- */
- if (e->pScreen != darwinEventQueue.pDequeueScreen)
- {
- darwinEventQueue.pDequeueScreen = e->pScreen;
- x = xe.u.keyButtonPointer.rootX;
- y = xe.u.keyButtonPointer.rootY;
- if (darwinEventQueue.head == QUEUE_SIZE - 1)
- darwinEventQueue.head = 0;
- else
- ++darwinEventQueue.head;
- NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y);
- }
- else
- {
- if (darwinEventQueue.head == QUEUE_SIZE - 1)
- darwinEventQueue.head = 0;
- else
- ++darwinEventQueue.head;
- switch (xe.u.u.type)
- {
- case KeyPress:
- case KeyRelease:
- xe.u.u.detail += MIN_KEYCODE;
- (*darwinEventQueue.pKbd->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1);
- break;
-
- case ButtonPress:
- miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
- xe.u.keyButtonPointer.rootY,
- xe.u.keyButtonPointer.time);
- if (darwinFakeButtons && xe.u.u.detail == 1) {
- // Mimic multi-button mouse with modifier-clicks
- // If both sets of modifiers are pressed,
- // button 2 is clicked.
- if ((old_flags & darwinFakeMouse2Mask) ==
- darwinFakeMouse2Mask)
- {
- DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask);
- darwinFakeMouseButtonDown = 2;
- darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
- break;
- }
- else if ((old_flags & darwinFakeMouse3Mask) ==
- darwinFakeMouse3Mask)
- {
- DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask);
- darwinFakeMouseButtonDown = 3;
- darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
- break;
- }
- }
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- break;
-
- case ButtonRelease:
- miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
- xe.u.keyButtonPointer.rootY,
- xe.u.keyButtonPointer.time);
- if (darwinFakeButtons && xe.u.u.detail == 1 &&
- darwinFakeMouseButtonDown)
- {
- // If last mousedown was a fake click, don't check for
- // mouse modifiers here. The user may have released the
- // modifiers before the mouse button.
- xe.u.u.detail = darwinFakeMouseButtonDown;
- darwinFakeMouseButtonDown = 0;
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-
- // Bring modifiers back up to date
- DarwinUpdateModifiers(&xe, KeyPress,
- darwinFakeMouseButtonMask & old_flags);
- darwinFakeMouseButtonMask = 0;
- } else {
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- }
- break;
-
- case MotionNotify:
- miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
- xe.u.keyButtonPointer.rootY,
- xe.u.keyButtonPointer.time);
- break;
-
- case kXDarwinUpdateModifiers:
- {
- // Update modifier state.
- // Any amount of modifiers may have changed.
- int flags = xe.u.clientMessage.u.l.longs0;
- DarwinUpdateModifiers(&xe, KeyRelease,
- old_flags & ~flags);
- DarwinUpdateModifiers(&xe, KeyPress,
- ~old_flags & flags);
- old_flags = flags;
- break;
- }
-
- case kXDarwinUpdateButtons:
- {
- long hwDelta = xe.u.clientMessage.u.l.longs0;
- long hwButtons = xe.u.clientMessage.u.l.longs1;
- int i;
-
- for (i = 1; i < 5; i++) {
- if (hwDelta & (1 << i)) {
- // IOKit and X have different numbering for the
- // middle and right mouse buttons.
- if (i == 1) {
- xe.u.u.detail = 3;
- } else if (i == 2) {
- xe.u.u.detail = 2;
- } else {
- xe.u.u.detail = i + 1;
- }
- if (hwButtons & (1 << i)) {
- xe.u.u.type = ButtonPress;
- } else {
- xe.u.u.type = ButtonRelease;
- }
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- }
- }
- break;
- }
-
- case kXDarwinScrollWheel:
- {
- short count = xe.u.clientMessage.u.s.shorts0;
-
- if (count > 0) {
- xe.u.u.detail = SCROLLWHEELUPFAKE;
- } else {
- xe.u.u.detail = SCROLLWHEELDOWNFAKE;
- count = -count;
- }
-
- for (; count; --count) {
- xe.u.u.type = ButtonPress;
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- xe.u.u.type = ButtonRelease;
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- }
- break;
- }
-
- default:
- // Check for mode specific event
- DarwinModeProcessEvent(&xe);
- }
- }
- }
-
- miPointerUpdate();
-}
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
deleted file mode 100644
index 57bf5fa3d..000000000
--- a/hw/darwin/darwinKeyboard.c
+++ /dev/null
@@ -1,900 +0,0 @@
-//=============================================================================
-//
-// Keyboard support for the Darwin X Server
-//
-// Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
-// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
-//
-// The code to parse the Darwin keymap is derived from dumpkeymap.c
-// by Eric Sunshine, which includes the following copyright:
-//
-// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-// All rights reserved.
-//
-//-----------------------------------------------------------------------------
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the author may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-//=============================================================================
-
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.19 2003/11/01 08:13:08 torrey Exp $ */
-
-/*
-===========================================================================
-
- An X keyCode must be in the range XkbMinLegalKeyCode (8) to
- XkbMaxLegalKeyCode(255).
-
- The keyCodes we get from the kernel range from 0 to 127, so we need to
- offset the range before passing the keyCode to X.
-
- An X KeySym is an extended ascii code that is device independent.
-
- The modifier map is accessed by the keyCode, but the normal map is
- accessed by keyCode - MIN_KEYCODE. Sigh.
-
-===========================================================================
-*/
-
-// Define this to get a diagnostic output to stderr which is helpful
-// in determining how the X server is interpreting the Darwin keymap.
-#undef DUMP_DARWIN_KEYMAP
-
-/* Define this to use Alt for Mode_switch. */
-#define ALT_IS_MODE_SWITCH 1
-
-#include <drivers/event_status_driver.h>
-#include <IOKit/hidsystem/ev_keymap.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <architecture/byte_order.h> // For the NXSwap*
-#include "darwin.h"
-#include "darwinKeyboard.h"
-
-#define AltMask Mod1Mask
-#define MetaMask Mod2Mask
-#define FunctionMask Mod3Mask
-
-// FIXME: It would be nice to support some of the extra keys in XF86keysym.h,
-// at least the volume controls that now ship on every Apple keyboard.
-
-#define UK(a) NoSymbol // unknown symbol
-
-static KeySym const next_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
-// 128
- NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex,
- XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
-// 144
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave,
- XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute,
- XK_THORN, XK_mu, XK_multiply, XK_division,
-// 160
- XK_copyright, XK_exclamdown, XK_cent, XK_sterling,
- UK(fraction), XK_yen, UK(fhook), XK_section,
- XK_currency, XK_rightsinglequotemark,
- XK_leftdoublequotemark,
- XK_guillemotleft,
- XK_leftanglebracket,
- XK_rightanglebracket,
- UK(filigature), UK(flligature),
-// 176
- XK_registered, XK_endash, XK_dagger, XK_doubledagger,
- XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet),
- XK_singlelowquotemark,
- XK_doublelowquotemark,
- XK_rightdoublequotemark,
- XK_guillemotright,
- XK_ellipsis, UK(permille), XK_notsign, XK_questiondown,
-// 192
- XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex,
- XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot,
- XK_dead_diaeresis,
- XK_twosuperior, XK_dead_abovering,
- XK_dead_cedilla,
- XK_threesuperior,
- XK_dead_doubleacute,
- XK_dead_ogonek, XK_dead_caron,
-// 208
- XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf,
- XK_threequarters,
- XK_agrave, XK_aacute, XK_acircumflex,
- XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
-// 224
- XK_igrave, XK_AE, XK_iacute, XK_ordfeminine,
- XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde,
- XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine,
- XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde,
-// 240
- XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute,
- XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave,
- XK_lstroke, XK_ooblique, XK_oe, XK_ssharp,
- XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol,
- };
-
-#define MIN_SYMBOL 0xAC
-static KeySym const symbol_to_x[] = {
- XK_Left, XK_Up, XK_Right, XK_Down
- };
-int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
-
-#define MIN_FUNCKEY 0x20
-static KeySym const funckey_to_x[] = {
- XK_F1, XK_F2, XK_F3, XK_F4,
- XK_F5, XK_F6, XK_F7, XK_F8,
- XK_F9, XK_F10, XK_F11, XK_F12,
- XK_Insert, XK_Delete, XK_Home, XK_End,
- XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
- XK_F15
- };
-int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
-
-typedef struct {
- KeySym normalSym;
- KeySym keypadSym;
-} darwinKeyPad_t;
-
-static darwinKeyPad_t const normal_to_keypad[] = {
- { XK_0, XK_KP_0 },
- { XK_1, XK_KP_1 },
- { XK_2, XK_KP_2 },
- { XK_3, XK_KP_3 },
- { XK_4, XK_KP_4 },
- { XK_5, XK_KP_5 },
- { XK_6, XK_KP_6 },
- { XK_7, XK_KP_7 },
- { XK_8, XK_KP_8 },
- { XK_9, XK_KP_9 },
- { XK_equal, XK_KP_Equal },
- { XK_asterisk, XK_KP_Multiply },
- { XK_plus, XK_KP_Add },
- { XK_comma, XK_KP_Separator },
- { XK_minus, XK_KP_Subtract },
- { XK_period, XK_KP_Decimal },
- { XK_slash, XK_KP_Divide }
-};
-int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
-
-static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
-{
- // keyclick, bell volume / pitch, autorepead, LED's
-}
-
-static darwinKeyboardInfo keyInfo;
-static FILE *fref = NULL;
-static char *inBuffer = NULL;
-
-//-----------------------------------------------------------------------------
-// Data Stream Object
-// Can be configured to treat embedded "numbers" as being composed of
-// either 1, 2, or 4 bytes, apiece.
-//-----------------------------------------------------------------------------
-typedef struct _DataStream
-{
- unsigned char const *data;
- unsigned char const *data_end;
- short number_size; // Size in bytes of a "number" in the stream.
-} DataStream;
-
-static DataStream* new_data_stream( unsigned char const* data, int size )
-{
- DataStream* s = (DataStream*)xalloc( sizeof(DataStream) );
- s->data = data;
- s->data_end = data + size;
- s->number_size = 1; // Default to byte-sized numbers.
- return s;
-}
-
-static void destroy_data_stream( DataStream* s )
-{
- xfree(s);
-}
-
-static unsigned char get_byte( DataStream* s )
-{
- assert(s->data + 1 <= s->data_end);
- return *s->data++;
-}
-
-static short get_word( DataStream* s )
-{
- short hi, lo;
- assert(s->data + 2 <= s->data_end);
- hi = *s->data++;
- lo = *s->data++;
- return ((hi << 8) | lo);
-}
-
-static int get_dword( DataStream* s )
-{
- int b1, b2, b3, b4;
- assert(s->data + 4 <= s->data_end);
- b4 = *s->data++;
- b3 = *s->data++;
- b2 = *s->data++;
- b1 = *s->data++;
- return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
-}
-
-static int get_number( DataStream* s )
-{
- switch (s->number_size) {
- case 4: return get_dword(s);
- case 2: return get_word(s);
- default: return get_byte(s);
- }
-}
-
-//-----------------------------------------------------------------------------
-// Utility functions to help parse Darwin keymap
-//-----------------------------------------------------------------------------
-
-/*
- * bits_set
- * Calculate number of bits set in the modifier mask.
- */
-static short bits_set( short mask )
-{
- short n = 0;
-
- for ( ; mask != 0; mask >>= 1)
- if ((mask & 0x01) != 0)
- n++;
- return n;
-}
-
-/*
- * parse_next_char_code
- * Read the next character code from the Darwin keymapping
- * and write it to the X keymap.
- */
-static void parse_next_char_code(
- DataStream *s,
- KeySym *k )
-{
- const short charSet = get_number(s);
- const short charCode = get_number(s);
-
- if (charSet == 0) { // ascii character
- if (charCode >= 0 && charCode < 256)
- *k = next_to_x[charCode];
- } else if (charSet == 0x01) { // symbol character
- if (charCode >= MIN_SYMBOL &&
- charCode <= MIN_SYMBOL + NUM_SYMBOL)
- *k = symbol_to_x[charCode - MIN_SYMBOL];
- } else if (charSet == 0xFE) { // function key
- if (charCode >= MIN_FUNCKEY &&
- charCode <= MIN_FUNCKEY + NUM_FUNCKEY)
- *k = funckey_to_x[charCode - MIN_FUNCKEY];
- }
-}
-
-
-/*
- * DarwinReadKeymapFile
- * Read the appropriate keymapping from a keymapping file.
- */
-Bool DarwinReadKeymapFile(
- NXKeyMapping *keyMap)
-{
- struct stat st;
- NXEventSystemDevice info[20];
- int interface = 0, handler_id = 0;
- int map_interface, map_handler_id, map_size = 0;
- unsigned int i, size;
- int *bufferEnd;
- union km_tag {
- int *intP;
- char *charP;
- } km;
-
- fref = fopen( darwinKeymapFile, "rb" );
- if (fref == NULL) {
- ErrorF("Unable to open keymapping file '%s' (errno %d).\n",
- darwinKeymapFile, errno);
- return FALSE;
- }
- if (fstat(fileno(fref), &st) == -1) {
- ErrorF("Could not stat keymapping file '%s' (errno %d).\n",
- darwinKeymapFile, errno);
- return FALSE;
- }
-
- // check to make sure we don't crash later
- if (st.st_size <= 16*sizeof(int)) {
- ErrorF("Keymapping file '%s' is invalid (too small).\n",
- darwinKeymapFile);
- return FALSE;
- }
-
- inBuffer = (char*) xalloc( st.st_size );
- bufferEnd = (int *) (inBuffer + st.st_size);
- if (fread(inBuffer, st.st_size, 1, fref) != 1) {
- ErrorF("Could not read %qd bytes from keymapping file '%s' (errno %d).\n",
- st.st_size, darwinKeymapFile, errno);
- return FALSE;
- }
-
- if (strncmp( inBuffer, "KYM1", 4 ) == 0) {
- // Magic number OK.
- } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) {
- ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile);
- return FALSE;
- } else {
- ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile);
- return FALSE;
- }
-
- // find the keyboard interface and handler id
- size = sizeof( info ) / sizeof( int );
- if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO,
- (NXEventSystemInfoType) info, &size )) {
- ErrorF("Error reading event status driver info.\n");
- return FALSE;
- }
-
- size = size * sizeof( int ) / sizeof( info[0] );
- for( i = 0; i < size; i++) {
- if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) {
- Bool hasInterface = FALSE;
- Bool hasMatch = FALSE;
-
- interface = info[i].interface;
- handler_id = info[i].id;
-
- // Find an appropriate keymapping:
- // The first time we try to match both interface and handler_id.
- // If we can't match both, we take the first match for interface.
-
- do {
- km.charP = inBuffer;
- km.intP++;
- while (km.intP+3 < bufferEnd) {
- map_interface = NXSwapBigIntToHost(*(km.intP++));
- map_handler_id = NXSwapBigIntToHost(*(km.intP++));
- map_size = NXSwapBigIntToHost(*(km.intP++));
- if (map_interface == interface) {
- if (map_handler_id == handler_id || hasInterface) {
- hasMatch = TRUE;
- break;
- } else {
- hasInterface = TRUE;
- }
- }
- km.charP += map_size;
- }
- } while (hasInterface && !hasMatch);
-
- if (hasMatch) {
- // fill in NXKeyMapping structure
- keyMap->size = map_size;
- keyMap->mapping = (char*) xalloc(map_size);
- memcpy(keyMap->mapping, km.charP, map_size);
- return TRUE;
- }
- } // if dev_id == keyboard device
- } // foreach info struct
-
- // The keymapping file didn't match any of the info structs
- // returned by NXEventSystemInfo.
- ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile);
- return FALSE;
-}
-
-
-/*
- * DarwinParseNXKeyMapping
- */
-Bool DarwinParseNXKeyMapping(
- darwinKeyboardInfo *info)
-{
- KeySym *k;
- int i;
- short numMods, numKeys, numPadKeys = 0;
- Bool haveKeymap = FALSE;
- NXKeyMapping keyMap;
- DataStream *keyMapStream;
- unsigned char const *numPadStart = 0;
-
- if (darwinKeymapFile) {
- haveKeymap = DarwinReadKeymapFile(&keyMap);
- if (fref)
- fclose(fref);
- if (inBuffer)
- xfree(inBuffer);
- if (!haveKeymap) {
- ErrorF("Reverting to kernel keymapping.\n");
- }
- }
-
- if (!haveKeymap) {
- // get the Darwin keyboard map
- keyMap.size = NXKeyMappingLength( darwinParamConnect );
- keyMap.mapping = (char*) xalloc( keyMap.size );
- if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) {
- return FALSE;
- }
- }
-
- keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping,
- keyMap.size );
-
- // check the type of map
- if (get_word(keyMapStream)) {
- keyMapStream->number_size = 2;
- ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n");
- }
-
- // Insert X modifier KeySyms into the keyboard map.
- numMods = get_number(keyMapStream);
- while (numMods-- > 0) {
- int left = 1; // first keycode is left
- short const charCode = get_number(keyMapStream);
- short numKeyCodes = get_number(keyMapStream);
-
- // This is just a marker, not a real modifier.
- // Store numeric keypad keys for later.
- if (charCode == NX_MODIFIERKEY_NUMERICPAD) {
- numPadStart = keyMapStream->data;
- numPadKeys = numKeyCodes;
- }
-
- while (numKeyCodes-- > 0) {
- const short keyCode = get_number(keyMapStream);
- if (charCode != NX_MODIFIERKEY_NUMERICPAD) {
- switch (charCode) {
- case NX_MODIFIERKEY_ALPHALOCK:
- info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
- break;
- case NX_MODIFIERKEY_SHIFT:
- info->keyMap[keyCode * GLYPHS_PER_KEY] =
- (left ? XK_Shift_L : XK_Shift_R);
- break;
- case NX_MODIFIERKEY_CONTROL:
- info->keyMap[keyCode * GLYPHS_PER_KEY] =
- (left ? XK_Control_L : XK_Control_R);
- break;
- case NX_MODIFIERKEY_ALTERNATE:
- info->keyMap[keyCode * GLYPHS_PER_KEY] =
- (left ? XK_Mode_switch : XK_Alt_R);
- break;
- case NX_MODIFIERKEY_COMMAND:
- info->keyMap[keyCode * GLYPHS_PER_KEY] =
- (left ? XK_Meta_L : XK_Meta_R);
- break;
- case NX_MODIFIERKEY_SECONDARYFN:
- info->keyMap[keyCode * GLYPHS_PER_KEY] =
- (left ? XK_Control_L : XK_Control_R);
- break;
- case NX_MODIFIERKEY_HELP:
- // Help is not an X11 modifier; treat as normal key
- info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help;
- break;
- }
- }
- left = 0;
- }
- }
-
- // Convert the Darwin keyboard mapping to an X keyboard map.
- // A key can have a different character code for each combination of
- // modifiers. We currently ignore all modifier combinations except
- // those with Shift, AlphaLock, and Alt.
- numKeys = get_number(keyMapStream);
- for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) {
- short const charGenMask = get_number(keyMapStream);
- if (charGenMask != 0xFF) { // is key bound?
- short numKeyCodes = 1 << bits_set(charGenMask);
-
- // Record unmodified case
- parse_next_char_code( keyMapStream, k );
- numKeyCodes--;
-
- // If AlphaLock and Shift modifiers produce different codes,
- // we record the Shift case since X handles AlphaLock.
- if (charGenMask & 0x01) { // AlphaLock
- parse_next_char_code( keyMapStream, k+1 );
- numKeyCodes--;
- }
-
- if (charGenMask & 0x02) { // Shift
- parse_next_char_code( keyMapStream, k+1 );
- numKeyCodes--;
-
- if (charGenMask & 0x01) { // Shift-AlphaLock
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
- }
- }
-
- // Skip the Control cases
- if (charGenMask & 0x04) { // Control
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
-
- if (charGenMask & 0x01) { // Control-AlphaLock
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
- }
-
- if (charGenMask & 0x02) { // Control-Shift
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
-
- if (charGenMask & 0x01) { // Shift-Control-AlphaLock
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
- }
- }
- }
-
- // Process Alt cases
- if (charGenMask & 0x08) { // Alt
- parse_next_char_code( keyMapStream, k+2 );
- numKeyCodes--;
-
- if (charGenMask & 0x01) { // Alt-AlphaLock
- parse_next_char_code( keyMapStream, k+3 );
- numKeyCodes--;
- }
-
- if (charGenMask & 0x02) { // Alt-Shift
- parse_next_char_code( keyMapStream, k+3 );
- numKeyCodes--;
-
- if (charGenMask & 0x01) { // Alt-Shift-AlphaLock
- get_number(keyMapStream); get_number(keyMapStream);
- numKeyCodes--;
- }
- }
- }
-
- while (numKeyCodes-- > 0) {
- get_number(keyMapStream); get_number(keyMapStream);
- }
-
- if (k[3] == k[2]) k[3] = NoSymbol;
- if (k[2] == k[1]) k[2] = NoSymbol;
- if (k[1] == k[0]) k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
- }
- }
-
- // Now we have to go back through the list of keycodes that are on the
- // numeric keypad and update the X keymap.
- keyMapStream->data = numPadStart;
- while(numPadKeys-- > 0) {
- const short keyCode = get_number(keyMapStream);
- k = &info->keyMap[keyCode * GLYPHS_PER_KEY];
- for (i = 0; i < NUM_KEYPAD; i++) {
- if (*k == normal_to_keypad[i].normalSym) {
- k[0] = normal_to_keypad[i].keypadSym;
- break;
- }
- }
- }
-
- // free Darwin keyboard map
- destroy_data_stream( keyMapStream );
- xfree( keyMap.mapping );
-
-#ifdef DUMP_DARWIN_KEYMAP
- ErrorF("Darwin -> X converted keyboard map\n");
- for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES;
- i++, k += GLYPHS_PER_KEY)
- {
- int j;
- ErrorF("0x%02x:", i);
- for (j = 0; j < GLYPHS_PER_KEY; j++) {
- if (k[j] == NoSymbol) {
- ErrorF("\tNoSym");
- } else {
- ErrorF("\t0x%x", k[j]);
- }
- }
- ErrorF("\n");
- }
-#endif
-
- return TRUE;
-}
-
-
-/*
- * DarwinBuildModifierMaps
- * Use the keyMap field of keyboard info structure to populate
- * the modMap and modifierKeycodes fields.
- */
-static void
-DarwinBuildModifierMaps(
- darwinKeyboardInfo *info)
-{
- int i;
- KeySym *k;
- int darwinSwapAltMeta = 0;
-
- memset(info->modMap, NoSymbol, sizeof(info->modMap));
- memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes));
-
- for (i = 0; i < NUM_KEYCODES; i++)
- {
- k = info->keyMap + i * GLYPHS_PER_KEY;
-
- switch (k[0]) {
- case XK_Shift_L:
- info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
- info->modMap[MIN_KEYCODE + i] = ShiftMask;
- break;
-
- case XK_Shift_R:
- info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][1] = i;
- info->modMap[MIN_KEYCODE + i] = ShiftMask;
- break;
-
- case XK_Control_L:
- info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i;
- info->modMap[MIN_KEYCODE + i] = ControlMask;
- break;
-
- case XK_Control_R:
- info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][1] = i;
- info->modMap[MIN_KEYCODE + i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i;
- info->modMap[MIN_KEYCODE + i] = LockMask;
- break;
-
- case XK_Alt_L:
- info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
- info->modMap[MIN_KEYCODE + i] = Mod1Mask;
- break;
-
- case XK_Alt_R:
- info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][1] = i;
- info->modMap[MIN_KEYCODE + i] = Mod1Mask;
- break;
-
- case XK_Mode_switch:
- info->modMap[MIN_KEYCODE + i] = Mod1Mask;
- break;
-
- case XK_Meta_L:
- info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i;
- info->modMap[MIN_KEYCODE + i] = Mod2Mask;
- break;
-
- case XK_Meta_R:
- info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][1] = i;
- info->modMap[MIN_KEYCODE + i] = Mod2Mask;
- break;
-
- case XK_Num_Lock:
- info->modMap[MIN_KEYCODE + i] = Mod3Mask;
- break;
- }
-
- if (darwinSwapAltMeta)
- {
- switch (k[0])
- {
- case XK_Alt_L:
- k[0] = XK_Meta_L;
- break;
- case XK_Alt_R:
- k[0] = XK_Meta_R;
- break;
- case XK_Meta_L:
- k[0] = XK_Alt_L;
- break;
- case XK_Meta_R:
- k[0] = XK_Alt_R;
- break;
- }
- }
-
-#if ALT_IS_MODE_SWITCH
- if (k[0] == XK_Alt_L || k[0] == XK_Alt_R)
- k[0] = XK_Mode_switch;
-#endif
- }
-}
-
-
-/*
- * DarwinKeyboardInit
- * Get the Darwin keyboard map and compute an equivalent
- * X keyboard map and modifier map. Set the new keyboard
- * device structure.
- */
-void DarwinKeyboardInit(
- DeviceIntPtr pDev )
-{
- KeySymsRec keySyms;
-
- memset( keyInfo.keyMap, 0, sizeof( keyInfo.keyMap ) );
-
- // Open a shared connection to the HID System.
- // Note that the Event Status Driver is really just a wrapper
- // for a kIOHIDParamConnectType connection.
- assert( darwinParamConnect = NXOpenEventStatus() );
-
- if (!DarwinParseNXKeyMapping(&keyInfo)) {
- if (!DarwinModeReadSystemKeymap(&keyInfo)) {
- FatalError("Could not build a valid keymap.");
- }
- }
-
- DarwinBuildModifierMaps(&keyInfo);
-
- keySyms.map = keyInfo.keyMap;
- keySyms.mapWidth = GLYPHS_PER_KEY;
- keySyms.minKeyCode = MIN_KEYCODE;
- keySyms.maxKeyCode = MAX_KEYCODE;
-
- assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
- keyInfo.modMap, DarwinModeBell,
- DarwinChangeKeyboardControl ));
-}
-
-//-----------------------------------------------------------------------------
-// Modifier translation functions
-//
-// There are three different ways to specify a Mac modifier key:
-// keycode - specifies hardware key, read from keymapping
-// key - NX_MODIFIERKEY_*, really an index
-// mask - NX_*MASK, mask for modifier flags in event record
-// Left and right side have different keycodes but the same key and mask.
-//-----------------------------------------------------------------------------
-
-/*
- * DarwinModifierNXKeyToNXKeycode
- * Return the keycode for an NX_MODIFIERKEY_* modifier.
- * side = 0 for left or 1 for right.
- * Returns 0 if key+side is not a known modifier.
- */
-int DarwinModifierNXKeyToNXKeycode(int key, int side)
-{
- return keyInfo.modifierKeycodes[key][side];
-}
-
-/*
- * DarwinModifierNXKeycodeToNXKey
- * Returns -1 if keycode+side is not a modifier key
- * outSide may be NULL, else it gets 0 for left and 1 for right.
- */
-int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
-{
- int key, side;
-
- keycode += MIN_KEYCODE;
- // search modifierKeycodes for this keycode+side
- for (key = 0; key < NX_NUMMODIFIERS; key++) {
- for (side = 0; side <= 1; side++) {
- if (keyInfo.modifierKeycodes[key][side] == keycode) break;
- }
- }
- if (key == NX_NUMMODIFIERS) return -1;
- if (outSide) *outSide = side;
- return key;
-}
-
-/*
- * DarwinModifierNXMaskToNXKey
- * Returns -1 if mask is not a known modifier mask.
- */
-int DarwinModifierNXMaskToNXKey(int mask)
-{
- switch (mask) {
- case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
- case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
- case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
- case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
- case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
- case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
- case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
- case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
- }
- return -1;
-}
-
-/*
- * DarwinModifierNXKeyToNXMask
- * Returns 0 if key is not a known modifier key.
- */
-int DarwinModifierNXKeyToNXMask(int key)
-{
- switch (key) {
- case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
- case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
- case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK;
- case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK;
- case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK;
- case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK;
- case NX_MODIFIERKEY_HELP: return NX_HELPMASK;
- case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK;
- }
- return 0;
-}
-
-/*
- * DarwinModifierStringToNXKey
- * Returns -1 if string is not a known modifier.
- */
-int DarwinModifierStringToNXKey(const char *str)
-{
- if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT;
- else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL;
- else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE;
- else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND;
- else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN;
- else return -1;
-}
-
-/*
- * LegalModifier
- * This allows the ddx layer to prevent some keys from being remapped
- * as modifier keys.
- */
-Bool LegalModifier(unsigned int key, DevicePtr pDev)
-{
- return 1;
-}
diff --git a/hw/darwin/darwinKeyboard.h b/hw/darwin/darwinKeyboard.h
deleted file mode 100644
index c71888990..000000000
--- a/hw/darwin/darwinKeyboard.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.h,v 1.1 2003/11/01 08:13:08 torrey Exp $ */
-
-#ifndef DARWIN_KEYBOARD_H
-#define DARWIN_KEYBOARD_H 1
-
-#define XK_TECHNICAL // needed to get XK_Escape
-#define XK_PUBLISHING
-#include "keysym.h"
-#include "inputstr.h"
-
-// Each key can generate 4 glyphs. They are, in order:
-// unshifted, shifted, modeswitch unshifted, modeswitch shifted
-#define GLYPHS_PER_KEY 4
-#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
-#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
-
-typedef struct darwinKeyboardInfo_struct {
- CARD8 modMap[MAP_LENGTH];
- KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY];
- unsigned char modifierKeycodes[32][2];
-} darwinKeyboardInfo;
-
-Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info);
-
-#endif /* DARWIN_KEYBOARD_H */
diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c
deleted file mode 100644
index 6b4bd75c2..000000000
--- a/hw/darwin/iokit/xfIOKit.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/**************************************************************
- *
- * IOKit support for the Darwin X Server
- *
- * HISTORY:
- * Original port to Mac OS X Server by John Carmack
- * Port to Darwin 1.0 by Dave Zarzycki
- * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.2 2003/10/16 23:50:09 torrey Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "os.h"
-#include "servermd.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "mipointer.h"
-#include "micmap.h"
-#include "shadow.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pthread.h>
-
-#include <mach/mach_interface.h>
-
-#define NO_CFPLUGIN
-#include <IOKit/IOKitLib.h>
-#include <IOKit/hidsystem/IOHIDShared.h>
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <drivers/event_status_driver.h>
-
-// Define this to work around bugs in the display drivers for
-// older PowerBook G3's. If the X server starts without this
-// #define, you don't need it.
-#undef OLD_POWERBOOK_G3
-
-#include "darwin.h"
-#include "xfIOKit.h"
-
-// Globals
-int xfIOKitScreenIndex = 0;
-io_connect_t xfIOKitInputConnect = 0;
-
-static pthread_t inputThread;
-static EvGlobals * evg;
-static mach_port_t masterPort;
-static mach_port_t notificationPort;
-static IONotificationPortRef NotificationPortRef;
-static mach_port_t pmNotificationPort;
-static io_iterator_t fbIter;
-
-
-/*
- * XFIOKitStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor.
- */
-static void XFIOKitStoreColors(
- ColormapPtr pmap,
- int numEntries,
- xColorItem *pdefs)
-{
- kern_return_t kr;
- int i;
- IOColorEntry *newColors;
- ScreenPtr pScreen = pmap->pScreen;
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
-
- assert( newColors = (IOColorEntry *)
- xalloc( numEntries*sizeof(IOColorEntry) ));
-
- // Convert xColorItem values to IOColorEntry
- // assume the colormap is PsuedoColor
- // as we do not support DirectColor
- for (i = 0; i < numEntries; i++) {
- newColors[i].index = pdefs[i].pixel;
- newColors[i].red = pdefs[i].red;
- newColors[i].green = pdefs[i].green;
- newColors[i].blue = pdefs[i].blue;
- }
-
- kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries,
- kSetCLUTByValue, newColors );
- kern_assert( kr );
-
- xfree( newColors );
-}
-
-
-/*
- * DarwinModeBell
- * FIXME
- */
-void DarwinModeBell(
- int loud,
- DeviceIntPtr pDevice,
- pointer ctrl,
- int fbclass)
-{
-}
-
-
-/*
- * DarwinModeGiveUp
- * Closes the connections to IOKit services
- */
-void DarwinModeGiveUp( void )
-{
- int i;
-
- // we must close the HID System first
- // because it is a client of the framebuffer
- NXCloseEventStatus( darwinParamConnect );
- IOServiceClose( xfIOKitInputConnect );
- for (i = 0; i < screenInfo.numScreens; i++) {
- XFIOKitScreenPtr iokitScreen =
- XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]);
- IOServiceClose( iokitScreen->fbService );
- }
-}
-
-
-/*
- * ClearEvent
- * Clear an event from the HID System event queue
- */
-static void ClearEvent(NXEvent * ep)
-{
- static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 };
-
- *ep = nullEvent;
- ep->data.compound.subType = ep->data.compound.misc.L[0] =
- ep->data.compound.misc.L[1] = 0;
-}
-
-
-/*
- * XFIOKitHIDThread
- * Read the HID System event queue, translate it to an X event,
- * and queue it for processing.
- */
-static void *XFIOKitHIDThread(void *unused)
-{
- for (;;) {
- NXEQElement *oldHead;
- mach_msg_return_t kr;
- mach_msg_empty_rcv_t msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), notificationPort, 0, MACH_PORT_NULL);
- kern_assert(kr);
-
- while (evg->LLEHead != evg->LLETail) {
- NXEvent ev;
- xEvent xe;
-
- // Extract the next event from the kernel queue
- oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead];
- ev_lock(&oldHead->sema);
- ev = oldHead->event;
- ClearEvent(&oldHead->event);
- evg->LLEHead = oldHead->next;
- ev_unlock(&oldHead->sema);
-
- memset(&xe, 0, sizeof(xe));
-
- // These fields should be filled in for every event
- xe.u.keyButtonPointer.rootX = ev.location.x;
- xe.u.keyButtonPointer.rootY = ev.location.y;
- xe.u.keyButtonPointer.time = GetTimeInMillis();
-
- switch( ev.type ) {
- case NX_MOUSEMOVED:
- xe.u.u.type = MotionNotify;
- break;
-
- case NX_LMOUSEDOWN:
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 1;
- break;
-
- case NX_LMOUSEUP:
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 1;
- break;
-
- // A newer kernel generates multi-button events with
- // NX_SYSDEFINED. Button 2 isn't handled correctly by
- // older kernels anyway. Just let NX_SYSDEFINED events
- // handle these.
-#if 0
- case NX_RMOUSEDOWN:
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 2;
- break;
-
- case NX_RMOUSEUP:
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 2;
- break;
-#endif
-
- case NX_KEYDOWN:
- xe.u.u.type = KeyPress;
- xe.u.u.detail = ev.data.key.keyCode;
- break;
-
- case NX_KEYUP:
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = ev.data.key.keyCode;
- break;
-
- case NX_FLAGSCHANGED:
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = ev.flags;
- break;
-
- case NX_SYSDEFINED:
- if (ev.data.compound.subType == 7) {
- xe.u.u.type = kXDarwinUpdateButtons;
- xe.u.clientMessage.u.l.longs0 =
- ev.data.compound.misc.L[0];
- xe.u.clientMessage.u.l.longs1 =
- ev.data.compound.misc.L[1];
- } else {
- continue;
- }
- break;
-
- case NX_SCROLLWHEELMOVED:
- xe.u.u.type = kXDarwinScrollWheel;
- xe.u.clientMessage.u.s.shorts0 =
- ev.data.scrollWheel.deltaAxis1;
- break;
-
- default:
- continue;
- }
-
- DarwinEQEnqueue(&xe);
- }
- }
-
- return NULL;
-}
-
-
-/*
- * XFIOKitPMThread
- * Handle power state notifications
- */
-static void *XFIOKitPMThread(void *arg)
-{
- ScreenPtr pScreen = (ScreenPtr)arg;
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
-
- for (;;) {
- mach_msg_return_t kr;
- mach_msg_empty_rcv_t msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL);
- kern_assert(kr);
-
- // display is powering down
- if (msg.header.msgh_id == 0) {
- IOFBAcknowledgePM( iokitScreen->fbService );
- xf86SetRootClip(pScreen, FALSE);
- }
- // display just woke up
- else if (msg.header.msgh_id == 1) {
- xf86SetRootClip(pScreen, TRUE);
- }
- }
- return NULL;
-}
-
-
-/*
- * SetupFBandHID
- * Setup an IOFramebuffer service and connect the HID system to it.
- */
-static Bool SetupFBandHID(
- int index,
- DarwinFramebufferPtr dfb,
- XFIOKitScreenPtr iokitScreen)
-{
- kern_return_t kr;
- io_service_t service;
- io_connect_t fbService;
- vm_address_t vram;
- vm_size_t shmemSize;
- int i;
- UInt32 numModes;
- IODisplayModeInformation modeInfo;
- IODisplayModeID displayMode, *allModes;
- IOIndex displayDepth;
- IOFramebufferInformation fbInfo;
- IOPixelInformation pixelInfo;
- StdFBShmem_t *cshmem;
-
- // find and open the IOFrameBuffer service
- service = IOIteratorNext(fbIter);
- if (service == 0)
- return FALSE;
-
- kr = IOServiceOpen( service, mach_task_self(),
- kIOFBServerConnectType, &iokitScreen->fbService );
- IOObjectRelease( service );
- if (kr != KERN_SUCCESS) {
- ErrorF("Failed to connect as window server to screen %i.\n", index);
- return FALSE;
- }
- fbService = iokitScreen->fbService;
-
- // create the slice of shared memory containing cursor state data
- kr = IOFBCreateSharedCursor( fbService,
- kIOFBCurrentShmemVersion,
- 32, 32 );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // Register for power management events for the framebuffer's device
- kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort);
- kern_assert(kr);
- kr = IOConnectSetNotificationPort( fbService, 0,
- pmNotificationPort, 0 );
- if (kr != KERN_SUCCESS) {
- ErrorF("Power management registration failed.\n");
- }
-
- // SET THE SCREEN PARAMETERS
- // get the current screen resolution, refresh rate and depth
- kr = IOFBGetCurrentDisplayModeAndDepth( fbService,
- &displayMode,
- &displayDepth );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // use the current screen resolution if the user
- // only wants to change the refresh rate
- if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) {
- kr = IOFBGetDisplayModeInformation( fbService,
- displayMode,
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
- darwinDesiredWidth = modeInfo.nominalWidth;
- darwinDesiredHeight = modeInfo.nominalHeight;
- }
-
- // use the current resolution and refresh rate
- // if the user doesn't have a preference
- if (darwinDesiredWidth == 0) {
-
- // change the pixel depth if desired
- if (darwinDesiredDepth != -1) {
- kr = IOFBGetDisplayModeInformation( fbService,
- displayMode,
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
- if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Current screen resolution does not support desired pixel depth.\n");
- return FALSE;
- }
-
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth( fbService, displayMode,
- displayDepth );
- if (kr != KERN_SUCCESS)
- return FALSE;
- }
-
- // look for display mode with correct resolution and refresh rate
- } else {
-
- // get an array of all supported display modes
- kr = IOFBGetDisplayModeCount( fbService, &numModes );
- if (kr != KERN_SUCCESS)
- return FALSE;
- assert(allModes = (IODisplayModeID *)
- xalloc( numModes * sizeof(IODisplayModeID) ));
- kr = IOFBGetDisplayModes( fbService, numModes, allModes );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- for (i = 0; i < numModes; i++) {
- kr = IOFBGetDisplayModeInformation( fbService, allModes[i],
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- if (modeInfo.flags & kDisplayModeValidFlag &&
- modeInfo.nominalWidth == darwinDesiredWidth &&
- modeInfo.nominalHeight == darwinDesiredHeight) {
-
- if (darwinDesiredDepth == -1)
- darwinDesiredDepth = modeInfo.maxDepthIndex;
- if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Desired screen resolution does not support desired pixel depth.\n");
- return FALSE;
- }
-
- if ((darwinDesiredRefresh == -1 ||
- (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) {
- displayMode = allModes[i];
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth(fbService,
- displayMode,
- displayDepth);
- if (kr != KERN_SUCCESS)
- return FALSE;
- break;
- }
- }
- }
-
- xfree( allModes );
- if (i >= numModes) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Desired screen resolution or refresh rate is not supported.\n");
- return FALSE;
- }
- }
-
- kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth,
- kIOFBSystemAperture, &pixelInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
-#ifdef __i386__
- /* x86 in 8bit mode currently needs fixed color map... */
- if( pixelInfo.bitsPerComponent == 8 ) {
- pixelInfo.pixelType = kIOFixedCLUTPixels;
- }
-#endif
-
-#ifdef OLD_POWERBOOK_G3
- if (pixelInfo.pixelType == kIOCLUTPixels)
- pixelInfo.pixelType = kIOFixedCLUTPixels;
-#endif
-
- kr = IOFBGetFramebufferInformationForAperture( fbService,
- kIOFBSystemAperture,
- &fbInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video
- // outputs without a monitor connected to them. Since IOKit Xinerama
- // does not really work, this often causes problems on PowerBooks.
- // For now we explicitly check and ignore these screens.
- if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Invalid width or height.\n");
- return FALSE;
- }
-
- kr = IOConnectMapMemory( fbService, kIOFBCursorMemory,
- mach_task_self(), (vm_address_t *) &cshmem,
- &shmemSize, kIOMapAnywhere );
- if (kr != KERN_SUCCESS)
- return FALSE;
- iokitScreen->cursorShmem = cshmem;
-
- kr = IOConnectMapMemory( fbService, kIOFBSystemAperture,
- mach_task_self(), &vram, &shmemSize,
- kIOMapAnywhere );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- iokitScreen->framebuffer = (void*)vram;
- dfb->x = cshmem->screenBounds.minx;
- dfb->y = cshmem->screenBounds.miny;
- dfb->width = fbInfo.activeWidth;
- dfb->height = fbInfo.activeHeight;
- dfb->pitch = fbInfo.bytesPerRow;
- dfb->bitsPerPixel = fbInfo.bitsPerPixel;
- dfb->colorBitsPerPixel = pixelInfo.componentCount *
- pixelInfo.bitsPerComponent;
- dfb->bitsPerComponent = pixelInfo.bitsPerComponent;
-
- // allocate shadow framebuffer
- iokitScreen->shadowPtr = shadowAlloc(dfb->width, dfb->height,
- dfb->bitsPerPixel);
- dfb->framebuffer = iokitScreen->shadowPtr;
-
- // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor
- if (pixelInfo.pixelType == kIORGBDirectPixels) {
- dfb->colorType = TrueColor;
- } else if (pixelInfo.pixelType == kIOCLUTPixels) {
- dfb->colorType = PseudoColor;
- } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) {
- dfb->colorType = StaticColor;
- }
-
- // Inform the HID system that the framebuffer is also connected to it.
- kr = IOConnectAddClient( xfIOKitInputConnect, fbService );
- kern_assert( kr );
-
- // We have to have added at least one screen
- // before we can enable the cursor.
- kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE);
- kern_assert( kr );
-
- return TRUE;
-}
-
-
-/*
- * DarwinModeAddScreen
- * IOKit specific initialization for each screen.
- */
-Bool DarwinModeAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen;
-
- // allocate space for private per screen storage
- iokitScreen = xalloc(sizeof(XFIOKitScreenRec));
- XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen;
-
- // setup hardware framebuffer
- iokitScreen->fbService = 0;
- if (! SetupFBandHID(index, dfb, iokitScreen)) {
- if (iokitScreen->fbService) {
- IOServiceClose(iokitScreen->fbService);
- }
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * XFIOKitShadowUpdate
- * Update the damaged regions of the shadow framebuffer on the screen.
- */
-static void XFIOKitShadowUpdate(ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- RegionPtr damage = &pBuf->damage;
- int numBox = REGION_NUM_RECTS(damage);
- BoxPtr pBox = REGION_RECTS(damage);
- int pitch = dfb->pitch;
- int bpp = dfb->bitsPerPixel/8;
-
- // Loop through all the damaged boxes
- while (numBox--) {
- int width, height, offset;
- unsigned char *src, *dst;
-
- width = (pBox->x2 - pBox->x1) * bpp;
- height = pBox->y2 - pBox->y1;
- offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
- src = iokitScreen->shadowPtr + offset;
- dst = iokitScreen->framebuffer + offset;
-
- while (height--) {
- memcpy(dst, src, width);
- dst += pitch;
- src += pitch;
- }
-
- // Get the next box
- pBox++;
- }
-}
-
-
-/*
- * DarwinModeSetupScreen
- * Finalize IOKit specific initialization of each screen.
- */
-Bool DarwinModeSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- pthread_t pmThread;
-
- // initalize cursor support
- if (! XFIOKitInitCursor(pScreen)) {
- return FALSE;
- }
-
- // initialize shadow framebuffer support
- if (! shadowInit(pScreen, XFIOKitShadowUpdate, NULL)) {
- ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
- index);
- return FALSE;
- }
-
- // initialize colormap handling as needed
- if (dfb->colorType == PseudoColor) {
- pScreen->StoreColors = XFIOKitStoreColors;
- }
-
- // initialize power manager handling
- pthread_create( &pmThread, NULL, XFIOKitPMThread,
- (void *) pScreen );
-
- return TRUE;
-}
-
-
-/*
- * DarwinModeInitOutput
- * One-time initialization of IOKit output support.
- */
-void DarwinModeInitOutput(
- int argc,
- char **argv)
-{
- static unsigned long generation = 0;
- kern_return_t kr;
- io_iterator_t iter;
- io_service_t service;
- vm_address_t shmem;
- vm_size_t shmemSize;
-
- ErrorF("Display mode: IOKit\n");
-
- // Allocate private storage for each screen's IOKit specific info
- if (generation != serverGeneration) {
- xfIOKitScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- kr = IOMasterPort(bootstrap_port, &masterPort);
- kern_assert( kr );
-
- // Find and open the HID System Service
- // Do this now to be sure the Mac OS X window server is not running.
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( kIOHIDSystemClass ),
- &iter );
- kern_assert( kr );
-
- assert( service = IOIteratorNext( iter ) );
-
- kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType,
- &xfIOKitInputConnect );
- if (kr != KERN_SUCCESS) {
- ErrorF("Failed to connect to the HID System as the window server!\n");
-#ifdef DARWIN_WITH_QUARTZ
- FatalError("Quit the Mac OS X window server or use the -quartz option.\n");
-#else
- FatalError("Make sure you have quit the Mac OS X window server.\n");
-#endif
- }
-
- IOObjectRelease( service );
- IOObjectRelease( iter );
-
- // Setup the event queue in memory shared by the kernel and X server
- kr = IOHIDCreateSharedMemory( xfIOKitInputConnect,
- kIOHIDCurrentShmemVersion );
- kern_assert( kr );
-
- kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory,
- mach_task_self(), &shmem, &shmemSize,
- kIOMapAnywhere );
- kern_assert( kr );
-
- evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset);
-
- assert(sizeof(EvGlobals) == evg->structSize);
-
- NotificationPortRef = IONotificationPortCreate( masterPort );
-
- notificationPort = IONotificationPortGetMachPort(NotificationPortRef);
-
- kr = IOConnectSetNotificationPort( xfIOKitInputConnect,
- kIOHIDEventNotification,
- notificationPort, 0 );
- kern_assert( kr );
-
- evg->movedMask |= NX_MOUSEMOVEDMASK;
-
- // find number of framebuffers
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ),
- &fbIter );
- kern_assert( kr );
-
- darwinScreensFound = 0;
- while ((service = IOIteratorNext(fbIter))) {
- IOObjectRelease( service );
- darwinScreensFound++;
- }
- IOIteratorReset(fbIter);
-}
-
-
-/*
- * DarwinModeInitInput
- * One-time initialization of IOKit input support.
- */
-void DarwinModeInitInput(
- int argc,
- char **argv)
-{
- kern_return_t kr;
- int fd[2];
-
- kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE);
- kern_assert( kr );
-
- // Start event passing thread
- assert( pipe(fd) == 0 );
- darwinEventReadFD = fd[0];
- darwinEventWriteFD = fd[1];
- fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
- pthread_create(&inputThread, NULL,
- XFIOKitHIDThread, NULL);
-
-}
-
-
-/*
- * DarwinModeProcessEvent
- * Process IOKit specific events.
- */
-void DarwinModeProcessEvent(
- xEvent *xe)
-{
- // No mode specific events
- ErrorF("Unknown X event caught: %d\n", xe->u.u.type);
-}
diff --git a/hw/darwin/iokit/xfIOKit.h b/hw/darwin/iokit/xfIOKit.h
deleted file mode 100644
index 413dfd7e8..000000000
--- a/hw/darwin/iokit/xfIOKit.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- xfIOKit.h
-
- IOKit specific functions and definitions
-*/
-/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.h,v 1.1 2003/05/14 05:27:56 torrey Exp $ */
-
-#ifndef _XFIOKIT_H
-#define _XFIOKIT_H
-
-#include <pthread.h>
-#include <IOKit/graphics/IOFramebufferShared.h>
-#include "X11/Xproto.h"
-#include "screenint.h"
-#include "darwin.h"
-
-typedef struct {
- io_connect_t fbService;
- StdFBShmem_t *cursorShmem;
- unsigned char *framebuffer;
- unsigned char *shadowPtr;
-} XFIOKitScreenRec, *XFIOKitScreenPtr;
-
-#define XFIOKIT_SCREEN_PRIV(pScreen) \
- ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr)
-
-extern int xfIOKitScreenIndex; // index into pScreen.devPrivates
-extern io_connect_t xfIOKitInputConnect;
-
-Bool XFIOKitInitCursor(ScreenPtr pScreen);
-
-#endif /* _XFIOKIT_H */
diff --git a/hw/darwin/iokit/xfIOKitCursor.c b/hw/darwin/iokit/xfIOKitCursor.c
deleted file mode 100644
index f3c80145f..000000000
--- a/hw/darwin/iokit/xfIOKitCursor.c
+++ /dev/null
@@ -1,735 +0,0 @@
-/**************************************************************
- *
- * Cursor support for Darwin X Server
- *
- * Three different cursor modes are possible:
- * X (0) - tracking via Darwin kernel,
- * display via X machine independent
- * Kernel (1) - tracking and display via Darwin kernel
- * (not currently supported)
- * Hardware (2) - tracking and display via hardware
- *
- * The X software cursor uses the Darwin software cursor
- * routines in IOFramebuffer.cpp to track the cursor, but
- * displays the cursor image using the X machine
- * independent display cursor routines in midispcur.c.
- *
- * The kernel cursor uses IOFramebuffer.cpp routines to
- * track and display the cursor. This gives better
- * performance as the display calls don't have to cross
- * the kernel boundary. Unfortunately, this mode has
- * synchronization issues with the user land X server
- * and isn't currently used.
- *
- * Hardware cursor support lets the hardware handle these
- * details.
- *
- * Kernel and hardware cursor mode only work for cursors
- * up to a certain size, currently 16x16 pixels. If a
- * bigger cursor is set, we fallback to X cursor mode.
- *
- * HISTORY:
- * 1.0 by Torrey T. Lyons, October 30, 2000
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKitCursor.c,v 1.1 2003/05/14 05:27:56 torrey Exp $ */
-
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "micmap.h"
-#define NO_CFPLUGIN
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <IOKit/hidsystem/IOHIDLib.h>
-#include "darwin.h"
-#include "xfIOKit.h"
-
-#define DUMP_DARWIN_CURSOR FALSE
-
-#define CURSOR_PRIV(pScreen) \
- ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-// The cursors format are documented in IOFramebufferShared.h.
-#define RGBto34WithGamma(red, green, blue) \
- ( 0x000F \
- | (((red) & 0xF) << 12) \
- | (((green) & 0xF) << 8) \
- | (((blue) & 0xF) << 4) )
-#define RGBto38WithGamma(red, green, blue) \
- ( 0xFF << 24 \
- | (((red) & 0xFF) << 16) \
- | (((green) & 0xFF) << 8) \
- | (((blue) & 0xFF)) )
-#define HighBitOf32 0x80000000
-
-typedef struct {
- Bool canHWCursor;
- short cursorMode;
- RecolorCursorProcPtr RecolorCursor;
- InstallColormapProcPtr InstallColormap;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
- ColormapPtr pInstalledMap;
-} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- Realizing the Darwin hardware cursor (ie. converting from the
- X representation to the IOKit representation) is complicated
- by the fact that we have three different potential cursor
- formats to go to, one for each bit depth (8, 15, or 24).
- The IOKit formats are documented in IOFramebufferShared.h.
- X cursors are represented as two pieces, a source and a mask.
- The mask is a bitmap indicating which parts of the cursor are
- transparent and which parts are drawn. The source is a bitmap
- indicating which parts of the non-transparent portion of the the
- cursor should be painted in the foreground color and which should
- be painted in the background color. The bitmaps are given in
- 32-bit format with least significant byte and bit first.
- (This is opposite PowerPC Darwin.)
-*/
-
-typedef struct {
- unsigned char image[CURSORWIDTH*CURSORHEIGHT];
- unsigned char mask[CURSORWIDTH*CURSORHEIGHT];
-} cursorPrivRec, *cursorPrivPtr;
-
-/*
- * XFIOKitRealizeCursor8
- * Convert the X cursor representation to an 8-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-XFIOKitRealizeCursor8(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- cursorPrivPtr newCursor;
- unsigned char *newSourceP, *newMaskP;
- CARD32 *oldSourceP, *oldMaskP;
- xColorItem fgColor, bgColor;
- int index, x, y, rowPad;
- int cursorWidth, cursorHeight;
- ColormapPtr pmap;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // get cursor colors in colormap
- index = pScreen->myNum;
- pmap = miInstalledMaps[index];
- if (!pmap) return FALSE;
-
- fgColor.red = pCursor->foreRed;
- fgColor.green = pCursor->foreGreen;
- fgColor.blue = pCursor->foreBlue;
- FakeAllocColor(pmap, &fgColor);
- bgColor.red = pCursor->backRed;
- bgColor.green = pCursor->backGreen;
- bgColor.blue = pCursor->backBlue;
- FakeAllocColor(pmap, &bgColor);
- FakeFreeColor(pmap, fgColor.pixel);
- FakeFreeColor(pmap, bgColor.pixel);
-
- // allocate memory for new cursor image
- newCursor = xalloc( sizeof(cursorPrivRec) );
- if (!newCursor)
- return FALSE;
- memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT );
- memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT );
-
- // convert to 8-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor->image;
- newMaskP = newCursor->mask;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgColor.pixel;
- else
- *newSourceP = bgColor.pixel;
- if (*oldMaskP & (HighBitOf32 >> x))
- *newMaskP = 255;
- else
- *newSourceP = pScreen->blackPixel;
- newSourceP++; newMaskP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad; newMaskP += rowPad;
- }
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor15
- * Convert the X cursor representation to an 15-bit depth
- * format for Darwin.
- */
-static Bool
-XFIOKitRealizeCursor15(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned short *newCursor;
- unsigned short fgPixel, bgPixel;
- unsigned short *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
-
- // calculate pixel values
- fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 15-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor24
- * Convert the X cursor representation to an 24-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-XFIOKitRealizeCursor24(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned int *newCursor;
- unsigned int fgPixel, bgPixel;
- unsigned int *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
-
- // calculate pixel values
- fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 24-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor
- *
- */
-static Bool
-XFIOKitRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor);
- } else if (dfb->bitsPerPixel == 8) {
- result = XFIOKitRealizeCursor8(pScreen, pCursor);
- } else if (dfb->bitsPerPixel == 16) {
- result = XFIOKitRealizeCursor15(pScreen, pCursor);
- } else {
- result = XFIOKitRealizeCursor24(pScreen, pCursor);
- }
-
- return result;
-}
-
-
-/*
- * XFIOKitUnrealizeCursor
- *
- */
-static Bool
-XFIOKitUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor);
- } else {
- xfree( pCursor->devPriv[pScreen->myNum] );
- result = TRUE;
- }
-
- return result;
-}
-
-
-/*
- * XFIOKitSetCursor
- * Set the cursor sprite and position
- * Use hardware cursor if possible
- */
-static void
-XFIOKitSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- kern_return_t kr;
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- StdFBShmem_t *cshmem = iokitScreen->cursorShmem;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // are we supposed to remove the cursor?
- if (!pCursor) {
- if (ScreenPriv->cursorMode == 0)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- else {
- if (!cshmem->cursorShow) {
- cshmem->cursorShow++;
- if (cshmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- kern_assert( kr );
- }
- }
- }
- return;
- }
-
- // can we use the kernel or hardware cursor?
- if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) &&
- // FIXME: condition not needed when kernel cursor works
- ScreenPriv->canHWCursor) {
-
- if (ScreenPriv->cursorMode == 0) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->cursorMode = 1; // kernel cursor
-
- // change the cursor image in shared memory
- if (dfb->bitsPerPixel == 8) {
- cursorPrivPtr newCursor =
- (cursorPrivPtr) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.bw8.image[0], newCursor->image,
- CURSORWIDTH*CURSORHEIGHT);
- memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask,
- CURSORWIDTH*CURSORHEIGHT);
- } else if (dfb->bitsPerPixel == 16) {
- unsigned short *newCursor =
- (unsigned short *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb.image[0], newCursor,
- 2*CURSORWIDTH*CURSORHEIGHT);
- } else {
- unsigned int *newCursor =
- (unsigned int *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb24.image[0], newCursor,
- 4*CURSORWIDTH*CURSORHEIGHT);
- }
-
- // FIXME: We always use a full size cursor, even if the image
- // is smaller because I couldn't get the padding to come out
- // right otherwise.
- cshmem->cursorSize[0].width = CURSORWIDTH;
- cshmem->cursorSize[0].height = CURSORHEIGHT;
- cshmem->hotSpot[0].x = pCursor->bits->xhot;
- cshmem->hotSpot[0].y = pCursor->bits->yhot;
-
- // try to use a hardware cursor
- if (ScreenPriv->canHWCursor) {
- kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
-#endif
- }
-
- // make the new cursor visible
- if (cshmem->cursorShow)
- cshmem->cursorShow--;
-
- if (!cshmem->cursorShow && ScreenPriv->canHWCursor) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- } else
-#endif
- ScreenPriv->cursorMode = 2; // hardware cursor
- }
-
- return;
- }
-
- // otherwise we use a software cursor
- if (ScreenPriv->cursorMode) {
- /* remove the kernel or hardware cursor */
- XFIOKitSetCursor(pScreen, 0, x, y);
- }
-
- ScreenPriv->cursorMode = 0;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
-}
-
-
-/*
- * XFIOKitMoveCursor
- * Move the cursor. This is a noop for a kernel or hardware cursor.
- */
-static void
-XFIOKitMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->cursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-static miPointerSpriteFuncRec darwinSpriteFuncsRec = {
- XFIOKitRealizeCursor,
- XFIOKitUnrealizeCursor,
- XFIOKitSetCursor,
- XFIOKitMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * XFIOKitCursorOffScreen
- */
-static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{ return FALSE;
-}
-
-
-/*
- * XFIOKitCrossScreen
- */
-static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering)
-{ return;
-}
-
-
-/*
- * XFIOKitWarpCursor
- * Change the cursor position without generating an event or motion history
- */
-static void
-XFIOKitWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- kern_return_t kr;
-
- kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y );
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr);
- }
- miPointerWarpCursor(pScreen, x, y);
-}
-
-static miPointerScreenFuncRec darwinScreenFuncsRec = {
- XFIOKitCursorOffScreen,
- XFIOKitCrossScreen,
- XFIOKitWarpCursor,
- DarwinEQPointerPost,
- DarwinEQSwitchScreen
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * XFIOKitCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-XFIOKitCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
-}
-
-
-/*
- * XFIOKitInitCursor
- * Initialize cursor support
- */
-Bool
-XFIOKitInitCursor(
- ScreenPtr pScreen)
-{
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- XFIOKitCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- kern_return_t kr;
-
- // start with no cursor displayed
- if (!iokitScreen->cursorShmem->cursorShow++) {
- if (iokitScreen->cursorShmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- kern_assert( kr );
- }
- }
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's hardware cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv;
-
- // check if a hardware cursor is supported
- if (!iokitScreen->cursorShmem->hardwareCursorCapable) {
- ScreenPriv->canHWCursor = FALSE;
- ErrorF("Hardware cursor not supported.\n");
- } else {
- // we need to make sure that the hardware cursor really works
- ScreenPriv->canHWCursor = TRUE;
- kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- }
-
- ScreenPriv->cursorMode = 0;
- ScreenPriv->pInstalledMap = NULL;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = XFIOKitCursorQueryBestSize;
-// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor;
-// pScreen->ConstrainCursor = XFIOKitConstrainCursor;
-
- // initialize hardware cursor handling
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &darwinSpriteFuncsRec;
-
- /* Other routines that might be overridden */
-/*
- CursorLimitsProcPtr CursorLimits;
- RecolorCursorProcPtr RecolorCursor;
-*/
-
- return TRUE;
-}
diff --git a/hw/darwin/iokit/xfIOKitStartup.c b/hw/darwin/iokit/xfIOKitStartup.c
deleted file mode 100644
index 9d25c69fe..000000000
--- a/hw/darwin/iokit/xfIOKitStartup.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/**************************************************************
- *
- * Startup code for the IOKit Darwin X Server
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKitStartup.c,v 1.2 2003/11/01 08:13:08 torrey Exp $ */
-
-#include "darwin.h"
-#include "darwinKeyboard.h"
-#include "micmap.h"
-
-void GlxExtensionInit(void);
-void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr);
-
-
-/*
- * DarwinHandleGUI
- * This function is called first from main().
- * It does nothing for the IOKit X server.
- */
-void DarwinHandleGUI(
- int argc,
- char *argv[],
- char *envp[] )
-{
-}
-
-
-/*
- * DarwinGlxExtensionInit
- * Initialize the GLX extension.
- * Mesa is linked into the IOKit mode X server so we just call directly.
- */
-void DarwinGlxExtensionInit(void)
-{
- GlxExtensionInit();
-}
-
-
-/*
- * DarwinGlxWrapInitVisuals
- */
-void DarwinGlxWrapInitVisuals(
- miInitVisualsProcPtr *procPtr)
-{
- GlxWrapInitVisuals(procPtr);
-}
-
-
-/*
- * DarwinModeProcessArgument
- * Process IOKit specific command line arguments.
- */
-int DarwinModeProcessArgument(
- int argc,
- char *argv[],
- int i)
-{
-#ifdef DARWIN_WITH_QUARTZ
- // XDarwinStartup uses these arguments to indicate which X server
- // should be started. Ignore them here.
- if (!strcmp( argv[i], "-fullscreen" ) ||
- !strcmp( argv[i], "-rootless" ) ||
- !strcmp( argv[i], "-quartz" ))
- {
- return 1;
- }
-#else
- if (!strcmp( argv[i], "-fullscreen" ) ||
- !strcmp( argv[i], "-rootless" ) ||
- !strcmp( argv[i], "-quartz" ))
- {
- FatalError("Command line option %s is not available without Quartz "
- "support.\n", argv[i]);
- }
-#endif
-
- return 0;
-}
-
-
-/*
- * DarwinModeReadSystemKeymap
- * IOKit has no alternative to NXKeyMapping API.
- */
-Bool DarwinModeReadSystemKeymap(
- darwinKeyboardInfo *info)
-{
- return FALSE;
-}
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
deleted file mode 100644
index 22a2f1441..000000000
--- a/hw/darwin/quartz/Preferences.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.3 2003/09/16 00:36:12 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-@interface Preferences : NSObject
-{
- IBOutlet NSPanel *window;
- IBOutlet id displayField;
- IBOutlet id dockSwitchButton;
- IBOutlet id fakeButton;
- IBOutlet id button2ModifiersMatrix;
- IBOutlet id button3ModifiersMatrix;
- IBOutlet id switchKeyButton;
- IBOutlet id keymapFileField;
- IBOutlet id modeMatrix;
- IBOutlet id modeWindowButton;
- IBOutlet id startupHelpButton;
- IBOutlet id systemBeepButton;
- IBOutlet id mouseAccelChangeButton;
- IBOutlet id useXineramaButton;
- IBOutlet id addToPathButton;
- IBOutlet id addToPathField;
- IBOutlet id useDefaultShellMatrix;
- IBOutlet id useOtherShellField;
- IBOutlet id depthButton;
-
- BOOL isGettingKeyCode;
- int keyCode;
- int modifiers;
- NSMutableString *switchString;
-}
-
-- (IBAction)close:(id)sender;
-- (IBAction)pickFile:(id)sender;
-- (IBAction)saveChanges:(id)sender;
-- (IBAction)setKey:(id)sender;
-
-- (BOOL)sendEvent:(NSEvent *)anEvent;
-
-- (void)awakeFromNib;
-- (void)windowWillClose:(NSNotification *)aNotification;
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
-+ (void)setKeymapFile:(NSString *)newFile;
-+ (void)setSwitchString:(NSString *)newString;
-+ (void)setKeyCode:(int)newKeyCode;
-+ (void)setModifiers:(int)newModifiers;
-+ (void)setDisplay:(int)newDisplay;
-+ (void)setDockSwitch:(BOOL)newDockSwitch;
-+ (void)setFakeButtons:(BOOL)newFakeButtons;
-+ (void)setButton2Mask:(int)newFakeMask;
-+ (void)setButton3Mask:(int)newFakeMask;
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange;
-+ (void)setUseQDCursor:(int)newUseQDCursor;
-+ (void)setRootless:(BOOL)newRootless;
-+ (void)setUseAGL:(BOOL)newUseAGL;
-+ (void)setModeWindow:(BOOL)newModeWindow;
-+ (void)setStartupHelp:(BOOL)newStartupHelp;
-+ (void)setSystemBeep:(BOOL)newSystemBeep;
-+ (void)setXinerama:(BOOL)newXinerama;
-+ (void)setAddToPath:(BOOL)newAddToPath;
-+ (void)setAddToPathString:(NSString *)newAddToPathString;
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
-+ (void)setShellString:(NSString *)newShellString;
-+ (void)setDepth:(int)newDepth;
-+ (void)setDisplayModeBundles:(NSArray *)newBundles;
-+ (void)saveToDisk;
-
-+ (BOOL)useKeymapFile;
-+ (NSString *)keymapFile;
-+ (NSString *)switchString;
-+ (unsigned int)keyCode;
-+ (unsigned int)modifiers;
-+ (int)display;
-+ (BOOL)dockSwitch;
-+ (BOOL)fakeButtons;
-+ (int)button2Mask;
-+ (int)button3Mask;
-+ (BOOL)mouseAccelChange;
-+ (int)useQDCursor;
-+ (BOOL)rootless;
-+ (BOOL)useAGL;
-+ (BOOL)modeWindow;
-+ (BOOL)startupHelp;
-+ (BOOL)systemBeep;
-+ (BOOL)xinerama;
-+ (BOOL)addToPath;
-+ (NSString *)addToPathString;
-+ (BOOL)useDefaultShell;
-+ (NSString *)shellString;
-+ (int)depth;
-+ (NSArray *)displayModeBundles;
-
-@end
-
-// Possible settings for useQDCursor
-enum {
- qdCursor_Never, // never use QuickDraw cursor
- qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth
- qdCursor_Always // always try to use QuickDraw cursor
-};
-
-// Possible settings for depth
-enum {
- depth_Current,
- depth_8Bit,
- depth_15Bit,
- depth_24Bit
-};
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
deleted file mode 100644
index 4120b6360..000000000
--- a/hw/darwin/quartz/Preferences.m
+++ /dev/null
@@ -1,580 +0,0 @@
-//
-// Preferences.m
-//
-// This class keeps track of the user preferences.
-//
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.4 2003/09/16 00:36:12 torrey Exp $ */
-
-#import "quartzCommon.h"
-
-#define BOOL xBOOL
-#include "darwin.h"
-#undef BOOL
-
-#import "Preferences.h"
-
-#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s)
-
-
-@implementation Preferences
-
-+ (void)initialize
-{
- // Provide user defaults if needed
- NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:0], @"Display",
- @"YES", @"FakeButtons",
- [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask",
- [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask",
- NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile",
- @"YES", @"UseKeymappingFile",
- NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString",
- @"YES", @"UseRootlessMode",
- @"YES", @"UseAGLforGLX",
- @"YES", @"ShowModePickWindow",
- @"YES", @"ShowStartupHelp",
- [NSNumber numberWithInt:0], @"SwitchKeyCode",
- [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
- @"SwitchModifiers", @"NO", @"UseSystemBeep",
- @"YES", @"DockSwitch",
- @"NO", @"AllowMouseAccelChange",
- [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
- @"YES", @"Xinerama",
- @"YES", @"AddToPath",
- [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
- @"YES", @"UseDefaultShell",
- @"/bin/tcsh", @"Shell",
- [NSNumber numberWithInt:depth_Current], @"Depth",
-#ifdef BUILD_XPR
- [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil],
-#else
- [NSArray arrayWithObjects:@"cr.bundle", nil],
-#endif
- @"DisplayModeBundles", nil];
-
- [super initialize];
- [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-}
-
-// Initialize internal state info of switch key button
-- (void)initSwitchKey
-{
- keyCode = [Preferences keyCode];
- modifiers = [Preferences modifiers];
- [switchString setString:[Preferences switchString]];
-}
-
-- (id)init
-{
- self = [super init];
-
- isGettingKeyCode=NO;
- switchString=[[NSMutableString alloc] init];
- [self initSwitchKey];
-
- return self;
-}
-
-// Set a modifiers checkbox matrix to match a modifier mask
-- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask
-{
- [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0];
- [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0];
- [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0];
- [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0];
- [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0];
-}
-
-// Generate a modifiers mask from a modifiers checkbox matrix
-- (int)getMaskFromMatrix:(NSMatrix *)aMatrix
-{
- int theMask = 0;
-
- if ([[aMatrix cellAtRow:0 column:0] state])
- theMask |= NX_SHIFTMASK;
- if ([[aMatrix cellAtRow:1 column:0] state])
- theMask |= NX_CONTROLMASK;
- if ([[aMatrix cellAtRow:2 column:0] state])
- theMask |= NX_COMMANDMASK;
- if ([[aMatrix cellAtRow:3 column:0] state])
- theMask |= NX_ALTERNATEMASK;
- if ([[aMatrix cellAtRow:4 column:0] state])
- theMask |= NX_SECONDARYFNMASK;
-
- return theMask;
-}
-
-// Set the window controls to the state in user defaults
-- (void)resetWindow
-{
- if ([Preferences keymapFile] == nil)
- [keymapFileField setStringValue:@" "];
- else
- [keymapFileField setStringValue:[Preferences keymapFile]];
-
- if ([Preferences switchString] == nil)
- [switchKeyButton setTitle:@"--"];
- else
- [switchKeyButton setTitle:[Preferences switchString]];
-
- [displayField setIntValue:[Preferences display]];
- [dockSwitchButton setIntValue:[Preferences dockSwitch]];
- [fakeButton setIntValue:[Preferences fakeButtons]];
- [self resetMatrix:button2ModifiersMatrix
- withMask:[Preferences button2Mask]];
- [self resetMatrix:button3ModifiersMatrix
- withMask:[Preferences button3Mask]];
- [modeMatrix setState:[Preferences rootless] atRow:0 column:1];
- [startupHelpButton setIntValue:[Preferences startupHelp]];
- [modeWindowButton setIntValue:[Preferences modeWindow]];
- [systemBeepButton setIntValue:[Preferences systemBeep]];
- [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]];
- [useXineramaButton setIntValue:[Preferences xinerama]];
- [addToPathButton setIntValue:[Preferences addToPath]];
- [addToPathField setStringValue:[Preferences addToPathString]];
- [useDefaultShellMatrix setState:![Preferences useDefaultShell]
- atRow:1 column:0];
- [useOtherShellField setStringValue:[Preferences shellString]];
- [depthButton selectItemAtIndex:[Preferences depth]];
-}
-
-- (void)awakeFromNib
-{
- [self resetWindow];
-}
-
-// Preference window delegate
-- (void)windowWillClose:(NSNotification *)aNotification
-{
- [self resetWindow];
- [self initSwitchKey];
-}
-
-// User cancelled the changes
-- (IBAction)close:(id)sender
-{
- [window orderOut:nil];
- [self resetWindow]; // reset window controls
- [self initSwitchKey]; // reset switch key state
-}
-
-// Pick keymapping file
-- (IBAction)pickFile:(id)sender
-{
- int result;
- NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"];
- NSOpenPanel *oPanel = [NSOpenPanel openPanel];
-
- [oPanel setAllowsMultipleSelection:NO];
- result = [oPanel runModalForDirectory:@"/System/Library/Keyboards"
- file:nil types:fileTypes];
- if (result == NSOKButton) {
- [keymapFileField setStringValue:[oPanel filename]];
- }
-}
-
-// User saved changes
-- (IBAction)saveChanges:(id)sender
-{
- [Preferences setKeyCode:keyCode];
- [Preferences setModifiers:modifiers];
- [Preferences setSwitchString:switchString];
- [Preferences setKeymapFile:[keymapFileField stringValue]];
- [Preferences setUseKeymapFile:YES];
- [Preferences setDisplay:[displayField intValue]];
- [Preferences setDockSwitch:[dockSwitchButton intValue]];
- [Preferences setFakeButtons:[fakeButton intValue]];
- [Preferences setButton2Mask:
- [self getMaskFromMatrix:button2ModifiersMatrix]];
- [Preferences setButton3Mask:
- [self getMaskFromMatrix:button3ModifiersMatrix]];
- [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]];
- [Preferences setModeWindow:[modeWindowButton intValue]];
- [Preferences setStartupHelp:[startupHelpButton intValue]];
- [Preferences setSystemBeep:[systemBeepButton intValue]];
- [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]];
- [Preferences setXinerama:[useXineramaButton intValue]];
- [Preferences setAddToPath:[addToPathButton intValue]];
- [Preferences setAddToPathString:[addToPathField stringValue]];
- [Preferences setUseDefaultShell:
- [[useDefaultShellMatrix cellAtRow:0 column:0] state]];
- [Preferences setShellString:[useOtherShellField stringValue]];
- [Preferences setDepth:[depthButton indexOfSelectedItem]];
- [Preferences saveToDisk];
-
- [window orderOut:nil];
-}
-
-- (IBAction)setKey:(id)sender
-{
- [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")];
- isGettingKeyCode=YES;
- [switchString setString:@""];
-}
-
-- (BOOL)sendEvent:(NSEvent *)anEvent
-{
- if(isGettingKeyCode) {
- if([anEvent type]==NSKeyDown) // wait for keyup
- return YES;
- if([anEvent type]!=NSKeyUp)
- return NO;
-
- if([anEvent modifierFlags] & NSCommandKeyMask)
- [switchString appendString:@"Cmd-"];
- if([anEvent modifierFlags] & NSControlKeyMask)
- [switchString appendString:@"Ctrl-"];
- if([anEvent modifierFlags] & NSAlternateKeyMask)
- [switchString appendString:@"Opt-"];
- if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work
- [switchString appendString:@"Num-"];
- if([anEvent modifierFlags] & NSHelpKeyMask)
- [switchString appendString:@"Help-"];
- if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only
- [switchString appendString:@"Fn-"];
-
- [switchString appendString:[anEvent charactersIgnoringModifiers]];
- [switchKeyButton setTitle:switchString];
-
- keyCode = [anEvent keyCode];
- modifiers = [anEvent modifierFlags];
- isGettingKeyCode=NO;
-
- return YES;
- }
- return NO;
-}
-
-+ (void)setKeymapFile:(NSString *)newFile
-{
- [[NSUserDefaults standardUserDefaults] setObject:newFile
- forKey:@"KeymappingFile"];
-}
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile
- forKey:@"UseKeymappingFile"];
-}
-
-+ (void)setSwitchString:(NSString *)newString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newString
- forKey:@"SwitchString"];
-}
-
-+ (void)setKeyCode:(int)newKeyCode
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode
- forKey:@"SwitchKeyCode"];
-}
-
-+ (void)setModifiers:(int)newModifiers
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newModifiers
- forKey:@"SwitchModifiers"];
-}
-
-+ (void)setDisplay:(int)newDisplay
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDisplay
- forKey:@"Display"];
-}
-
-+ (void)setDockSwitch:(BOOL)newDockSwitch
-{
- [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch
- forKey:@"DockSwitch"];
-}
-
-+ (void)setFakeButtons:(BOOL)newFakeButtons
-{
- [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons
- forKey:@"FakeButtons"];
- // Update the setting used by the X server thread
- darwinFakeButtons = newFakeButtons;
-}
-
-+ (void)setButton2Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button2Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse2Mask = newFakeMask;
-}
-
-+ (void)setButton3Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button3Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse3Mask = newFakeMask;
-}
-
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange
-{
- [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
- forKey:@"AllowMouseAccelChange"];
- // Update the setting used by the X server thread
- darwinMouseAccelChange = newMouseAccelChange;
-}
-
-+ (void)setUseQDCursor:(int)newUseQDCursor
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor
- forKey:@"UseQDCursor"];
-}
-
-+ (void)setModeWindow:(BOOL)newModeWindow
-{
- [[NSUserDefaults standardUserDefaults] setBool:newModeWindow
- forKey:@"ShowModePickWindow"];
-}
-
-+ (void)setRootless:(BOOL)newRootless
-{
- [[NSUserDefaults standardUserDefaults] setBool:newRootless
- forKey:@"UseRootlessMode"];
-}
-
-+ (void)setUseAGL:(BOOL)newUseAGL
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseAGL
- forKey:@"UseAGLforGLX"];
-}
-
-+ (void)setStartupHelp:(BOOL)newStartupHelp
-{
- [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp
- forKey:@"ShowStartupHelp"];
-}
-
-+ (void)setSystemBeep:(BOOL)newSystemBeep
-{
- [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep
- forKey:@"UseSystemBeep"];
- // Update the setting used by the X server thread
- quartzUseSysBeep = newSystemBeep;
-}
-
-+ (void)setXinerama:(BOOL)newXinerama
-{
- [[NSUserDefaults standardUserDefaults] setBool:newXinerama
- forKey:@"Xinerama"];
-}
-
-+ (void)setAddToPath:(BOOL)newAddToPath
-{
- [[NSUserDefaults standardUserDefaults] setBool:newAddToPath
- forKey:@"AddToPath"];
-}
-
-+ (void)setAddToPathString:(NSString *)newAddToPathString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
- forKey:@"AddToPathString"];
-}
-
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell
- forKey:@"UseDefaultShell"];
-}
-
-+ (void)setShellString:(NSString *)newShellString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newShellString
- forKey:@"Shell"];
-}
-
-+ (void)setDepth:(int)newDepth
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDepth
- forKey:@"Depth"];
-}
-
-+ (void)setDisplayModeBundles:(NSArray *)newBundles
-{
- [[NSUserDefaults standardUserDefaults] setObject:newBundles
- forKey:@"DisplayModeBundles"];
-}
-
-+ (void)saveToDisk
-{
- [[NSUserDefaults standardUserDefaults] synchronize];
-}
-
-+ (BOOL)useKeymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseKeymappingFile"];
-}
-
-+ (NSString *)keymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"KeymappingFile"];
-}
-
-+ (NSString *)switchString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"SwitchString"];
-}
-
-+ (unsigned int)keyCode
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchKeyCode"];
-}
-
-+ (unsigned int)modifiers
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchModifiers"];
-}
-
-+ (int)display
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Display"];
-}
-
-+ (BOOL)dockSwitch
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
-}
-
-+ (BOOL)fakeButtons
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
-}
-
-+ (int)button2Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button2Mask"];
-}
-
-+ (int)button3Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button3Mask"];
-}
-
-+ (BOOL)mouseAccelChange
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"AllowMouseAccelChange"];
-}
-
-+ (int)useQDCursor
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"UseQDCursor"];
-}
-
-+ (BOOL)rootless
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseRootlessMode"];
-}
-
-+ (BOOL)useAGL
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseAGLforGLX"];
-}
-
-+ (BOOL)modeWindow
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowModePickWindow"];
-}
-
-+ (BOOL)startupHelp
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowStartupHelp"];
-}
-
-+ (BOOL)systemBeep
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
-}
-
-+ (BOOL)xinerama
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
-}
-
-+ (BOOL)addToPath
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
-}
-
-+ (NSString *)addToPathString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"AddToPathString"];
-}
-
-+ (BOOL)useDefaultShell
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseDefaultShell"];
-}
-
-+ (NSString *)shellString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"Shell"];
-}
-
-+ (int)depth
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Depth"];
-}
-
-+ (NSArray *)displayModeBundles
-{
- return [[NSUserDefaults standardUserDefaults]
- objectForKey:@"DisplayModeBundles"];
-}
-
-@end
diff --git a/hw/darwin/quartz/XApplication.h b/hw/darwin/quartz/XApplication.h
deleted file mode 100644
index 3d3e96dab..000000000
--- a/hw/darwin/quartz/XApplication.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// XApplication.h
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.h,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-#import "XServer.h"
-#import "Preferences.h"
-
-@interface XApplication : NSApplication {
- IBOutlet XServer *xserver;
- IBOutlet Preferences *preferences;
-}
-
-- (void)sendEvent:(NSEvent *)anEvent;
-
-@end
diff --git a/hw/darwin/quartz/XApplication.m b/hw/darwin/quartz/XApplication.m
deleted file mode 100644
index 9b81bbee0..000000000
--- a/hw/darwin/quartz/XApplication.m
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// XApplication.m
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.m,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
-
-#import "XApplication.h"
-
-
-@implementation XApplication
-
-- (void)sendEvent:(NSEvent *)anEvent {
- if (![xserver translateEvent:anEvent]) {
- if (![preferences sendEvent:anEvent])
- [super sendEvent:anEvent];
- }
-}
-
-@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
deleted file mode 100644
index 3afc9177b..000000000
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ /dev/null
@@ -1,2145 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 38;
- objects = {
- 01279092000747AA0A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XServer.m;
- refType = 4;
- };
- 0127909600074AF60A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XApplication.m;
- refType = 4;
- };
- 0127909800074B1A0A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XApplication.h;
- refType = 4;
- };
- 015698ED003DF345CE6F79C2 = {
- isa = PBXFileReference;
- path = XDarwin.icns;
- refType = 4;
- };
- 0157A37D002CF6D7CE6F79C2 = {
- children = (
- F533214601A4B45401000001,
- 0157A37E002CF6D7CE6F79C2,
- F58D65DF018F79B101000001,
- F533213D0193CBE001000001,
- 43B962E200617B93416877C2,
- F5ACD263C5BE031F01000001,
- F51BF62E02026E3501000001,
- F5ACD25CC5B5E96601000001,
- F587E16401924C6901000001,
- );
- isa = PBXVariantGroup;
- name = Credits.rtf;
- path = "";
- refType = 4;
- };
- 0157A37E002CF6D7CE6F79C2 = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/Credits.rtf;
- refType = 4;
- };
- 015EDCEA004203A8CE6F79C2 = {
- isa = PBXFrameworkReference;
- name = IOKit.framework;
- path = /System/Library/Frameworks/IOKit.framework;
- refType = 0;
- };
- 018F40F2003E1902CE6F79C2 = {
- children = (
- 018F40F3003E1916CE6F79C2,
- 021D6BA9003E1BACCE6F79C2,
- 3E74E03600863F047F000001,
- F5A94EF10314BAC70100011B,
- 018F40F6003E1974CE6F79C2,
- 6E5F5F0005537A1A008FEAD7,
- );
- isa = PBXGroup;
- name = "X Server";
- path = ..;
- refType = 4;
- };
- 018F40F3003E1916CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwin.c;
- refType = 4;
- };
- 018F40F6003E1974CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwinKeyboard.c;
- refType = 4;
- };
- 018F40F8003E1979CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartz.c;
- refType = 4;
- };
- 018F40FA003E197ECE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartz.h;
- refType = 4;
- };
- 018F40FC003E1983CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = xfIOKit.c;
- refType = 4;
- };
- 018F40FE003E1988CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = xfIOKit.h;
- refType = 4;
- };
- 018F4100003E19E4CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = xfIOKitCursor.c;
- refType = 4;
- };
-//010
-//011
-//012
-//013
-//014
-//020
-//021
-//022
-//023
-//024
- 021D6BA9003E1BACCE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwin.h;
- refType = 4;
- };
- 02A1FEA6006D34BE416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = xfIOKitStartup.c;
- refType = 4;
- };
- 02A1FEA8006D38F0416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzStartup.c;
- refType = 4;
- };
- 02E03CA000348209CE6F79C2 = {
- children = (
- F533214701A4B48301000001,
- 02E03CA100348209CE6F79C2,
- F58D65E0018F79C001000001,
- F533213E0193CBF401000001,
- 43B962E300617B93416877C2,
- F5ACD268C5BE046401000001,
- F51BF62F02026E5C01000001,
- F5ACD261C5B5EA2001000001,
- F587E16501924C7401000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html;
- path = "";
- refType = 4;
- };
- 02E03CA100348209CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = English;
- path = English.lproj/XDarwinHelp.html;
- refType = 4;
- };
-//020
-//021
-//022
-//023
-//024
-//030
-//031
-//032
-//033
-//034
- 0338412F0083BFE57F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzCursor.h;
- refType = 4;
- };
-//030
-//031
-//032
-//033
-//034
-//040
-//041
-//042
-//043
-//044
- 04329610000763920A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = Preferences.m;
- refType = 4;
- };
- 04329611000763920A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = Preferences.h;
- refType = 4;
- };
-//040
-//041
-//042
-//043
-//044
-//080
-//081
-//082
-//083
-//084
- 080E96DDFE201D6D7F000001 = {
- children = (
- 04329610000763920A000002,
- 04329611000763920A000002,
- 0127909600074AF60A000002,
- 0127909800074B1A0A000002,
- 01279092000747AA0A000002,
- 1C4A3109004D8F24CE6F79C2,
- );
- isa = PBXGroup;
- name = Classes;
- refType = 4;
- };
- 089C165CFE840E0CC02AAC07 = {
- children = (
- F533214301A4B3F001000001,
- 089C165DFE840E0CC02AAC07,
- F58D65DD018F798F01000001,
- F533213A0193CBA201000001,
- 43B962E100617B49416877C2,
- F5ACD269C5BE049301000001,
- F51BF62B02026DDA01000001,
- F5ACD262C5B5EA4D01000001,
- F587E16101924C2F01000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings;
- refType = 4;
- };
- 089C165DFE840E0CC02AAC07 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = English;
- path = English.lproj/InfoPlist.strings;
- refType = 4;
- };
-//080
-//081
-//082
-//083
-//084
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
- 0A79E19E004499A1CE6F79C2 = {
- isa = PBXApplicationReference;
- path = XDarwin.app;
- refType = 3;
- };
- 0A79E19F004499A1CE6F79C2 = {
- buildPhases = (
- 0A79E1A0004499A1CE6F79C2,
- 0A79E1A1004499A1CE6F79C2,
- 0A79E1A2004499A1CE6F79C2,
- 0A79E1A3004499A1CE6F79C2,
- 0A79E1A4004499A1CE6F79C2,
- );
- buildSettings = {
- INSTALL_PATH = /;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = XDarwin;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = app;
- };
- dependencies = (
- 6EF065C903D4F0CA006877C2,
- 6EF065C703D4EE19006877C2,
- 6E11A986048BDFFB006877C2,
- 6E7904110500F33B00EEC080,
- );
- isa = PBXApplicationTarget;
- name = XDarwin;
- productInstallPath = /;
- productName = XDarwin;
- productReference = 0A79E19E004499A1CE6F79C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>x11app</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>X11 Application</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>****</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>tool</string>
- <string>*</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>UNIX Application</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>****</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- </array>
- <key>CFBundleExecutable</key>
- <string>XDarwin</string>
- <key>CFBundleGetInfoString</key>
- <string>XDarwin 1.3b4, ©2001-2003 XFree86 Project, Inc.</string>
- <key>CFBundleIconFile</key>
- <string>XDarwin.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.xfree86.XDarwin</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>XDarwin</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>XDarwin 1.3b4</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string></string>
- <key>NSHelpFile</key>
- <string>XDarwinHelp.html</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>XApplication</string>
-</dict>
-</plist>
-";
- };
- 0A79E1A0004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A1004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- 0A79E1A600449EB2CE6F79C2,
- 0A79E1A700449EB2CE6F79C2,
- 0A79E1A800449EB2CE6F79C2,
- 0A79E1A900449EB2CE6F79C2,
- 0A79E1AA00449EB2CE6F79C2,
- 1220774500712D2D416877C2,
- F54BF6ED017D506E01000001,
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A2004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A3004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A4004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A600449EB2CE6F79C2 = {
- fileRef = 29B97318FDCFA39411CA2CEA;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A700449EB2CE6F79C2 = {
- fileRef = 089C165CFE840E0CC02AAC07;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A800449EB2CE6F79C2 = {
- fileRef = 0157A37D002CF6D7CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A900449EB2CE6F79C2 = {
- fileRef = 02E03CA000348209CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1AA00449EB2CE6F79C2 = {
- fileRef = 015698ED003DF345CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
-//100
-//101
-//102
-//103
-//104
- 1058C7A0FEA54F0111CA2CBB = {
- children = (
- F53321400193CCF001000001,
- 1BE4F84D0006C9890A000002,
- 1058C7A1FEA54F0111CA2CBB,
- F53321410193CCF001000001,
- 015EDCEA004203A8CE6F79C2,
- );
- isa = PBXGroup;
- name = "Linked Frameworks";
- refType = 4;
- };
- 1058C7A1FEA54F0111CA2CBB = {
- isa = PBXFrameworkReference;
- name = Cocoa.framework;
- path = /System/Library/Frameworks/Cocoa.framework;
- refType = 0;
- };
- 1058C7A2FEA54F0111CA2CBB = {
- children = (
- 29B97325FDCFA39411CA2CEA,
- 29B97324FDCFA39411CA2CEA,
- );
- isa = PBXGroup;
- name = "Other Frameworks";
- refType = 4;
- };
-//100
-//101
-//102
-//103
-//104
-//120
-//121
-//122
-//123
-//124
- 1220774300712D2D416877C2 = {
- children = (
- F533214501A4B42501000001,
- 1220774400712D2D416877C2,
- F58D65DE018F79A001000001,
- F533213C0193CBC901000001,
- 1220774600712D75416877C2,
- F5ACD266C5BE03C501000001,
- F51BF62D02026E1C01000001,
- F5ACD25FC5B5E9AA01000001,
- F587E16301924C5E01000001,
- );
- isa = PBXVariantGroup;
- name = Localizable.strings;
- path = "";
- refType = 4;
- };
- 1220774400712D2D416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = English;
- path = English.lproj/Localizable.strings;
- refType = 4;
- };
- 1220774500712D2D416877C2 = {
- fileRef = 1220774300712D2D416877C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 1220774600712D75416877C2 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/Localizable.strings;
- refType = 4;
- };
-//120
-//121
-//122
-//123
-//124
-//170
-//171
-//172
-//173
-//174
- 170DFAFF00729A35416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XDarwinStartup.c;
- refType = 4;
- };
- 170DFB0000729C86416877C2 = {
- children = (
- 018F40FC003E1983CE6F79C2,
- 018F40FE003E1988CE6F79C2,
- 018F4100003E19E4CE6F79C2,
- 02A1FEA6006D34BE416877C2,
- );
- isa = PBXGroup;
- name = IOKit;
- path = ../iokit;
- refType = 4;
- };
-//170
-//171
-//172
-//173
-//174
-//190
-//191
-//192
-//193
-//194
- 19C28FACFE9D520D11CA2CBB = {
- children = (
- 0A79E19E004499A1CE6F79C2,
- 6EF7C58703D3BC6D00000104,
- 6EF065C603D4EE19006877C2,
- 6E11A985048BDFEE006877C2,
- 6E7904100500F05600EEC080,
- );
- isa = PBXGroup;
- name = Products;
- refType = 4;
- };
-//190
-//191
-//192
-//193
-//194
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
- 1BD8DE4200B8A3567F000001 = {
- children = (
- F533214401A4B40F01000001,
- 1BD8DE4300B8A3567F000001,
- F58D65DC018F794D01000001,
- F533213B0193CBB401000001,
- 1BD8DE4700B8A3C77F000001,
- F5ACD264C5BE035B01000001,
- F51BF62C02026E0601000001,
- F5ACD25DC5B5E97701000001,
- F587E16201924C5301000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings.cpp;
- path = "";
- refType = 4;
- };
- 1BD8DE4300B8A3567F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = English;
- path = English.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- 1BD8DE4400B8A38E7F000001 = {
- children = (
- F533214801A4B4D701000001,
- 1BD8DE4500B8A38E7F000001,
- F58D65E1018F79E001000001,
- F533213F0193CC2501000001,
- 1BD8DE4800B8A4167F000001,
- F5ACD267C5BE03FC01000001,
- F51BF63002026E8D01000001,
- F5ACD260C5B5E9DF01000001,
- F587E16601924C9D01000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html.cpp;
- path = "";
- refType = 4;
- };
- 1BD8DE4500B8A38E7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = English;
- path = English.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- 1BD8DE4700B8A3C77F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- 1BD8DE4800B8A4167F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- 1BE4F84D0006C9890A000002 = {
- isa = PBXFrameworkReference;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- };
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
- 1C4A3109004D8F24CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XServer.h;
- refType = 4;
- };
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
-//230
-//231
-//232
-//233
-//234
- 237A34C10076E37E7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzAudio.c;
- refType = 4;
- };
- 237A34C20076E37E7F000001 = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- OPTIMIZATION_CFLAGS = "-O0";
- };
- isa = PBXBuildStyle;
- name = Development;
- };
- 237A34C30076E37E7F000001 = {
- buildRules = (
- );
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- };
- isa = PBXBuildStyle;
- name = Deployment;
- };
- 237A34C40076F4F07F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzAudio.h;
- refType = 4;
- };
-//230
-//231
-//232
-//233
-//234
-//290
-//291
-//292
-//293
-//294
- 29B97313FDCFA39411CA2CEA = {
- buildStyles = (
- 237A34C20076E37E7F000001,
- 237A34C30076E37E7F000001,
- );
- hasScannedForEncodings = 1;
- isa = PBXProject;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- Swedish,
- Dutch,
- Spanish,
- ko,
- Portuguese,
- );
- mainGroup = 29B97314FDCFA39411CA2CEA;
- projectDirPath = "";
- targets = (
- 0A79E19F004499A1CE6F79C2,
- 6EF7C58603D3BC6D00000104,
- 6E11A984048BDFEE006877C2,
- 6EF065C503D4EE19006877C2,
- 6E79040F0500F05600EEC080,
- );
- };
- 29B97314FDCFA39411CA2CEA = {
- children = (
- 080E96DDFE201D6D7F000001,
- 018F40F2003E1902CE6F79C2,
- 170DFB0000729C86416877C2,
- 43B962CE00617089416877C2,
- F5614B3D025112D901000114,
- 6EC4A64C042A9597006877C2,
- 32FEE13C00E07C3E7F000001,
- 6EE1214104968658006877C2,
- 6EC4A66D042A97FC006877C2,
- 29B97315FDCFA39411CA2CEA,
- 29B97317FDCFA39411CA2CEA,
- 29B97323FDCFA39411CA2CEA,
- 19C28FACFE9D520D11CA2CBB,
- );
- isa = PBXGroup;
- name = "Xmaster-Cocoa";
- path = "";
- refType = 4;
- };
- 29B97315FDCFA39411CA2CEA = {
- children = (
- 170DFAFF00729A35416877C2,
- );
- isa = PBXGroup;
- name = "Other Sources";
- path = "";
- refType = 2;
- };
- 29B97317FDCFA39411CA2CEA = {
- children = (
- 29B97318FDCFA39411CA2CEA,
- 089C165CFE840E0CC02AAC07,
- 1BD8DE4200B8A3567F000001,
- 1220774300712D2D416877C2,
- 0157A37D002CF6D7CE6F79C2,
- 02E03CA000348209CE6F79C2,
- 1BD8DE4400B8A38E7F000001,
- 015698ED003DF345CE6F79C2,
- F54BF6EA017D500901000001,
- F54BF6EC017D506E01000001,
- );
- isa = PBXGroup;
- name = Resources;
- path = ../bundle;
- refType = 4;
- };
- 29B97318FDCFA39411CA2CEA = {
- children = (
- F533214201A4B3CE01000001,
- 29B97319FDCFA39411CA2CEA,
- F58D65DB018F793801000001,
- F53321390193CB6A01000001,
- 43B962E000617B49416877C2,
- F5ACD265C5BE038601000001,
- F51BF62A02026DAF01000001,
- F5ACD25EC5B5E98D01000001,
- F587E16001924C1D01000001,
- );
- isa = PBXVariantGroup;
- name = MainMenu.nib;
- path = "";
- refType = 4;
- };
- 29B97319FDCFA39411CA2CEA = {
- isa = PBXFileReference;
- name = English;
- path = English.lproj/MainMenu.nib;
- refType = 4;
- };
- 29B97323FDCFA39411CA2CEA = {
- children = (
- 1058C7A0FEA54F0111CA2CBB,
- 1058C7A2FEA54F0111CA2CBB,
- );
- isa = PBXGroup;
- name = Frameworks;
- path = "";
- refType = 4;
- };
- 29B97324FDCFA39411CA2CEA = {
- isa = PBXFrameworkReference;
- name = AppKit.framework;
- path = /System/Library/Frameworks/AppKit.framework;
- refType = 0;
- };
- 29B97325FDCFA39411CA2CEA = {
- isa = PBXFrameworkReference;
- name = Foundation.framework;
- path = /System/Library/Frameworks/Foundation.framework;
- refType = 0;
- };
-//290
-//291
-//292
-//293
-//294
-//320
-//321
-//322
-//323
-//324
- 32FEE13C00E07C3E7F000001 = {
- children = (
- F5269C2D01D5BC3501000001,
- F5269C2E01D5BC3501000001,
- );
- isa = PBXGroup;
- name = "Old Cocoa Imp";
- path = "";
- refType = 4;
- };
-//320
-//321
-//322
-//323
-//324
-//350
-//351
-//352
-//353
-//354
- 3576829A0077B8F17F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzCursor.c;
- refType = 4;
- };
-//350
-//351
-//352
-//353
-//354
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
- 3E74E03600863F047F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwinClut8.h;
- refType = 4;
- };
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
-//430
-//431
-//432
-//433
-//434
- 43B962CE00617089416877C2 = {
- children = (
- 6EE9B21604E859C200CA7FEA,
- 6E97A0F505079F9100B8294C,
- 6E5F5F030553815A008FEAD7,
- 6E5F5F040553815A008FEAD7,
- 018F40F8003E1979CE6F79C2,
- 018F40FA003E197ECE6F79C2,
- 237A34C10076E37E7F000001,
- 237A34C40076F4F07F000001,
- 43B962CF00617089416877C2,
- F5582948015DAD3B01000001,
- 6E5F5F0105537A5F008FEAD7,
- 43B962D000617089416877C2,
- 43B962D100617089416877C2,
- 02A1FEA8006D38F0416877C2,
- );
- isa = PBXGroup;
- name = Quartz;
- path = "";
- refType = 4;
- };
- 43B962CF00617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzCocoa.m;
- refType = 4;
- };
- 43B962D000617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzPasteboard.c;
- refType = 4;
- };
- 43B962D100617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzPasteboard.h;
- refType = 4;
- };
- 43B962E000617B49416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/MainMenu.nib;
- refType = 4;
- };
- 43B962E100617B49416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings;
- refType = 4;
- };
- 43B962E200617B93416877C2 = {
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/Credits.rtf;
- refType = 4;
- };
- 43B962E300617B93416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html;
- refType = 4;
- };
-//430
-//431
-//432
-//433
-//434
-//6E0
-//6E1
-//6E2
-//6E3
-//6E4
- 6E11A97F048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A980048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A981048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A982048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A983048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A984048BDFEE006877C2 = {
- buildPhases = (
- 6E11A97F048BDFEE006877C2,
- 6E11A980048BDFEE006877C2,
- 6E11A981048BDFEE006877C2,
- 6E11A982048BDFEE006877C2,
- 6E11A983048BDFEE006877C2,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxCGL;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxCGL;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = glxCGL;
- productReference = 6E11A985048BDFEE006877C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxCGL</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle using Apple's OpenGL</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6E11A985048BDFEE006877C2 = {
- isa = PBXBundleReference;
- path = glxCGL.bundle;
- refType = 3;
- };
- 6E11A986048BDFFB006877C2 = {
- isa = PBXTargetDependency;
- target = 6E11A984048BDFEE006877C2;
- };
- 6E5F5F0005537A1A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwinKeyboard.h;
- refType = 4;
- };
- 6E5F5F0105537A5F008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzKeyboard.c;
- refType = 4;
- };
- 6E5F5F030553815A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = keysym2ucs.c;
- refType = 4;
- };
- 6E5F5F040553815A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = keysym2ucs.h;
- refType = 4;
- };
- 6E6656EC048832CF006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-hook.c";
- refType = 4;
- };
- 6E6656ED048832CF006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-hook.h";
- refType = 4;
- };
- 6E6656F0048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = dri.c;
- refType = 4;
- };
- 6E6656F1048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = dri.h;
- refType = 4;
- };
- 6E6656F2048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = dristruct.h;
- refType = 4;
- };
- 6E6656F3048832F9006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = appledri.c;
- refType = 4;
- };
- 6E79040104FD5ED900EEC080 = {
- children = (
- 6E79040204FD5EDA00EEC080,
- 6E79040304FD5EDA00EEC080,
- 6E79040404FD5EDA00EEC080,
- );
- isa = PBXGroup;
- name = "Safe Alpha";
- path = safeAlpha;
- refType = 4;
- };
- 6E79040204FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = safeAlpha.h;
- refType = 4;
- };
- 6E79040304FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = safeAlphaPicture.c;
- refType = 4;
- };
- 6E79040404FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = safeAlphaWindow.c;
- refType = 4;
- };
- 6E79040A0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040B0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040C0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040D0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040E0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040F0500F05600EEC080 = {
- buildPhases = (
- 6E79040A0500F05600EEC080,
- 6E79040B0500F05600EEC080,
- 6E79040C0500F05600EEC080,
- 6E79040D0500F05600EEC080,
- 6E79040E0500F05600EEC080,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = xpr;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = xpr;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = xpr;
- productReference = 6E7904100500F05600EEC080;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>xpr</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>Xplugin rootless implementation</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6E7904100500F05600EEC080 = {
- isa = PBXBundleReference;
- path = xpr.bundle;
- refType = 3;
- };
- 6E7904110500F33B00EEC080 = {
- isa = PBXTargetDependency;
- target = 6E79040F0500F05600EEC080;
- };
- 6E97A0F2050798B100B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = xprAppleWM.c;
- refType = 4;
- };
- 6E97A0F305079B6500B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = crAppleWM.m;
- refType = 4;
- };
- 6E97A0F505079F9100B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = applewmExt.h;
- refType = 4;
- };
- 6EA0B3AF0544A9CC006877C2 = {
- children = (
- 6EA0B3B00544A9CC006877C2,
- 6EA0B3B10544A9CC006877C2,
- 6EA0B3B20544A9CC006877C2,
- 6EA0B3B30544A9CC006877C2,
- 6EA0B3B40544A9CC006877C2,
- 6EA0B3B50544A9CC006877C2,
- 6EA0B3B60544A9CC006877C2,
- 6EA0B3B70544A9CC006877C2,
- );
- isa = PBXGroup;
- name = Acceleration;
- path = accel;
- refType = 4;
- };
- 6EA0B3B00544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlAccel.h;
- refType = 4;
- };
- 6EA0B3B10544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlBlt.c;
- refType = 4;
- };
- 6EA0B3B20544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlCopy.c;
- refType = 4;
- };
- 6EA0B3B30544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlFill.c;
- refType = 4;
- };
- 6EA0B3B40544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlFillRect.c;
- refType = 4;
- };
- 6EA0B3B50544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlFillSpans.c;
- refType = 4;
- };
- 6EA0B3B60544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlGlyph.c;
- refType = 4;
- };
- 6EA0B3B70544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rlSolid.c;
- refType = 4;
- };
- 6EA8EEC80445E25C006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessConfig.h;
- refType = 4;
- };
- 6EC4A64C042A9597006877C2 = {
- children = (
- 6EC4A65D042A9654006877C2,
- 6EC4A65E042A9654006877C2,
- 6EC4A65F042A9654006877C2,
- 6EA8EEC80445E25C006877C2,
- 6EC4A661042A9654006877C2,
- 6EC4A662042A9654006877C2,
- 6EC4A660042A9654006877C2,
- 6EC4A663042A9654006877C2,
- 6EC4A664042A9654006877C2,
- 6EA0B3AF0544A9CC006877C2,
- 6E79040104FD5ED900EEC080,
- );
- isa = PBXGroup;
- name = Rootless;
- path = ../../../miext/rootless;
- refType = 2;
- };
- 6EC4A65D042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootless.h;
- refType = 4;
- };
- 6EC4A65E042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessCommon.c;
- refType = 4;
- };
- 6EC4A65F042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessCommon.h;
- refType = 4;
- };
- 6EC4A660042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessWindow.h;
- refType = 4;
- };
- 6EC4A661042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessScreen.c;
- refType = 4;
- };
- 6EC4A662042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessWindow.c;
- refType = 4;
- };
- 6EC4A663042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessGC.c;
- refType = 4;
- };
- 6EC4A664042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessValTree.c;
- refType = 4;
- };
- 6EC4A66D042A97FC006877C2 = {
- children = (
- 6EF471A004478DE0006877C2,
- 6E6656F3048832F9006877C2,
- 6E6656F0048832EC006877C2,
- 6E6656F1048832EC006877C2,
- 6E6656F2048832EC006877C2,
- 6ECF218404589E4D006877C2,
- 6E97A0F2050798B100B8294C,
- 6ECF218604589F40006877C2,
- 6EF4719E04478B08006877C2,
- 6EDDB2DF04508B2C006877C2,
- 6EF471A204479263006877C2,
- 6EF471A404479263006877C2,
- 6E6656EC048832CF006877C2,
- 6E6656ED048832CF006877C2,
- 6EF471A504479263006877C2,
- 6EF471A304479263006877C2,
- );
- isa = PBXGroup;
- path = xpr;
- refType = 4;
- };
- 6ECF218404589E4D006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = xpr.h;
- refType = 4;
- };
- 6ECF218604589F40006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = xprCursor.c;
- refType = 4;
- };
- 6EDDB2DF04508B2C006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = xprScreen.c;
- refType = 4;
- };
- 6EE1214104968658006877C2 = {
- children = (
- 6EE1214304968692006877C2,
- 6EE1214404968692006877C2,
- 6EE1214204968692006877C2,
- 6E97A0F305079B6500B8294C,
- 6EE1214504968692006877C2,
- 6EE1214604968692006877C2,
- );
- isa = PBXGroup;
- path = cr;
- refType = 4;
- };
- 6EE1214204968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = cr.h;
- refType = 4;
- };
- 6EE1214304968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XView.m;
- refType = 4;
- };
- 6EE1214404968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XView.h;
- refType = 4;
- };
- 6EE1214504968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = crFrame.m;
- refType = 4;
- };
- 6EE1214604968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = crScreen.m;
- refType = 4;
- };
- 6EE9B21604E859C200CA7FEA = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = applewm.c;
- refType = 4;
- };
- 6EF065C003D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C103D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C203D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C303D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C403D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C503D4EE19006877C2 = {
- buildPhases = (
- 6EF065C003D4EE19006877C2,
- 6EF065C103D4EE19006877C2,
- 6EF065C203D4EE19006877C2,
- 6EF065C303D4EE19006877C2,
- 6EF065C403D4EE19006877C2,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxMesa;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxMesa;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = glxMesa;
- productReference = 6EF065C603D4EE19006877C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxMesa</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle with Mesa</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6EF065C603D4EE19006877C2 = {
- isa = PBXBundleReference;
- path = glxMesa.bundle;
- refType = 3;
- };
- 6EF065C703D4EE19006877C2 = {
- isa = PBXTargetDependency;
- target = 6EF065C503D4EE19006877C2;
- };
- 6EF065C903D4F0CA006877C2 = {
- isa = PBXTargetDependency;
- target = 6EF7C58603D3BC6D00000104;
- };
- 6EF4719E04478B08006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- path = xprFrame.c;
- refType = 4;
- };
- 6EF471A004478DE0006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = Xplugin.h;
- refType = 4;
- };
- 6EF471A204479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-hash.c";
- refType = 4;
- };
- 6EF471A304479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-list.h";
- refType = 4;
- };
- 6EF471A404479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-hash.h";
- refType = 4;
- };
- 6EF471A504479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = "x-list.c";
- refType = 4;
- };
- 6EF7C58103D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58203D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58303D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58403D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58503D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58603D3BC6D00000104 = {
- buildPhases = (
- 6EF7C58103D3BC6D00000104,
- 6EF7C58203D3BC6D00000104,
- 6EF7C58303D3BC6D00000104,
- 6EF7C58403D3BC6D00000104,
- 6EF7C58503D3BC6D00000104,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxAGL;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxAGL;
- productName = glxAGL;
- productReference = 6EF7C58703D3BC6D00000104;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxAGL</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle using AGL framework</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6EF7C58703D3BC6D00000104 = {
- isa = PBXBundleReference;
- path = glxAGL.bundle;
- refType = 3;
- };
-//6E0
-//6E1
-//6E2
-//6E3
-//6E4
-//F50
-//F51
-//F52
-//F53
-//F54
- F51BF62A02026DAF01000001 = {
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/MainMenu.nib;
- refType = 4;
- };
- F51BF62B02026DDA01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/InfoPlist.strings;
- refType = 4;
- };
- F51BF62C02026E0601000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F51BF62D02026E1C01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/Localizable.strings;
- refType = 4;
- };
- F51BF62E02026E3501000001 = {
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/Credits.rtf;
- refType = 4;
- };
- F51BF62F02026E5C01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F51BF63002026E8D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Portuguese;
- path = Portuguese.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5269C2D01D5BC3501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = pseudoramiX.c;
- refType = 4;
- };
- F5269C2E01D5BC3501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = pseudoramiX.h;
- refType = 4;
- };
- F53321390193CB6A01000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/MainMenu.nib;
- refType = 4;
- };
- F533213A0193CBA201000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = German;
- path = German.lproj/InfoPlist.strings;
- refType = 4;
- };
- F533213B0193CBB401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = German;
- path = German.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F533213C0193CBC901000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = German;
- path = German.lproj/Localizable.strings;
- refType = 4;
- };
- F533213D0193CBE001000001 = {
- isa = PBXFileReference;
- name = German;
- path = German.lproj/Credits.rtf;
- refType = 4;
- };
- F533213E0193CBF401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = German;
- path = German.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F533213F0193CC2501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = German;
- path = German.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F53321400193CCF001000001 = {
- isa = PBXFrameworkReference;
- name = ApplicationServices.framework;
- path = /System/Library/Frameworks/ApplicationServices.framework;
- refType = 0;
- };
- F53321410193CCF001000001 = {
- isa = PBXFrameworkReference;
- name = CoreAudio.framework;
- path = /System/Library/Frameworks/CoreAudio.framework;
- refType = 0;
- };
- F533214201A4B3CE01000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/MainMenu.nib;
- refType = 4;
- };
- F533214301A4B3F001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings;
- refType = 4;
- };
- F533214401A4B40F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F533214501A4B42501000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/Localizable.strings;
- refType = 4;
- };
- F533214601A4B45401000001 = {
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/Credits.rtf;
- refType = 4;
- };
- F533214701A4B48301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F533214801A4B4D701000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F54BF6EA017D500901000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = startXClients.cpp;
- refType = 4;
- };
- F54BF6EC017D506E01000001 = {
- isa = PBXFileReference;
- path = startXClients;
- refType = 4;
- };
- F54BF6ED017D506E01000001 = {
- fileRef = F54BF6EC017D506E01000001;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5582948015DAD3B01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzCommon.h;
- refType = 4;
- };
- F5614B3B0251124C01000114 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = fullscreen.c;
- refType = 4;
- };
- F5614B3D025112D901000114 = {
- children = (
- F5614B3B0251124C01000114,
- 3576829A0077B8F17F000001,
- 0338412F0083BFE57F000001,
- );
- isa = PBXGroup;
- path = fullscreen;
- refType = 4;
- };
- F587E16001924C1D01000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/MainMenu.nib;
- refType = 4;
- };
- F587E16101924C2F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings;
- refType = 4;
- };
- F587E16201924C5301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F587E16301924C5E01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/Localizable.strings;
- refType = 4;
- };
- F587E16401924C6901000001 = {
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/Credits.rtf;
- refType = 4;
- };
- F587E16501924C7401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F587E16601924C9D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F58D65DB018F793801000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/MainMenu.nib;
- refType = 4;
- };
- F58D65DC018F794D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = French;
- path = French.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F58D65DD018F798F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = French;
- path = French.lproj/InfoPlist.strings;
- refType = 4;
- };
- F58D65DE018F79A001000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = French;
- path = French.lproj/Localizable.strings;
- refType = 4;
- };
- F58D65DF018F79B101000001 = {
- isa = PBXFileReference;
- name = French;
- path = French.lproj/Credits.rtf;
- refType = 4;
- };
- F58D65E0018F79C001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = French;
- path = French.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F58D65E1018F79E001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = French;
- path = French.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5A94EF10314BAC70100011B = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = darwinEvents.c;
- refType = 4;
- };
- F5ACD25CC5B5E96601000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/Credits.rtf;
- refType = 4;
- };
- F5ACD25DC5B5E97701000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F5ACD25EC5B5E98D01000001 = {
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/MainMenu.nib;
- refType = 4;
- };
- F5ACD25FC5B5E9AA01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/Localizable.strings;
- refType = 4;
- };
- F5ACD260C5B5E9DF01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5ACD261C5B5EA2001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F5ACD262C5B5EA4D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings;
- refType = 4;
- };
- F5ACD263C5BE031F01000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/Credits.rtf;
- refType = 4;
- };
- F5ACD264C5BE035B01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/InfoPlist.strings.cpp;
- refType = 4;
- };
- F5ACD265C5BE038601000001 = {
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/MainMenu.nib;
- refType = 4;
- };
- F5ACD266C5BE03C501000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/Localizable.strings;
- refType = 4;
- };
- F5ACD267C5BE03FC01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- };
- F5ACD268C5BE046401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/XDarwinHelp.html;
- refType = 4;
- };
- F5ACD269C5BE049301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = ko;
- path = ko.lproj/InfoPlist.strings;
- refType = 4;
- };
- };
- rootObject = 29B97313FDCFA39411CA2CEA;
-}
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
deleted file mode 100644
index 7b2c89f38..000000000
--- a/hw/darwin/quartz/XDarwinStartup.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/**************************************************************
- *
- * Startup program for Darwin X servers
- *
- * This program selects the appropriate X server to launch:
- * XDarwin IOKit X server (default)
- * XDarwinQuartz A soft link to the Quartz X server
- * executable (-quartz etc. option)
- *
- * If told to idle, the program will simply pause and not
- * launch any X server. This is to support startx being
- * run by XDarwin.app.
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Torrey T. Lyons shall not
- * be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Torrey T. Lyons.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.2 2003/05/14 05:15:56 torrey Exp $ */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/syslimits.h>
-#include <ApplicationServices/ApplicationServices.h>
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s) "/"
-#define XPATH(file) XSTRPATH(XBINDIR) STR(file)
-
-int main(
- int argc,
- char *argv[] )
-{
- int i, j, quartzMode = -1;
- char **newargv;
-
- // Check if we are going to run in Quartz mode or idle
- // to support startx from the Quartz server. The last
- // parameter in the list is the one used.
- for (i = argc-1; i; i--) {
- if (!strcmp(argv[i], "-idle")) {
- pause();
- return 0;
-
- } else if (!strcmp(argv[i], "-quartz") ||
- !strcmp(argv[i], "-rootless") ||
- !strcmp(argv[i], "-fullscreen"))
- {
- quartzMode = 1;
- break;
-
- } else if (!strcmp(argv[i], "-iokit")) {
- quartzMode = 0;
- break;
- }
- }
-
- if (quartzMode == -1) {
-#ifdef HAS_CG_MACH_PORT
- // Check if the CoreGraphics window server is running.
- // Mike Paquette says this is the fastest way to determine if it is running.
- CFMachPortRef cgMachPortRef = CGWindowServerCFMachPort();
- if (cgMachPortRef == NULL)
- quartzMode = 0;
- else
- quartzMode = 1;
-#else
- // On older systems we assume IOKit mode.
- quartzMode = 0;
-#endif
- }
-
- if (quartzMode) {
- // Launch the X server for the quartz modes
-
- char quartzPath[PATH_MAX+1];
- int pathLength;
- OSStatus theStatus;
- CFURLRef appURL;
- CFStringRef appPath;
- Boolean success;
-
- // Build the new argument list
- newargv = (char **) malloc((argc+2) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[argc] = "-nostartx";
- newargv[argc+1] = NULL;
-
- // Use the XDarwinQuartz soft link if it is valid
- pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX);
- if (pathLength != -1) {
- quartzPath[pathLength] = '\0';
- newargv[0] = quartzPath;
- execv(newargv[0], newargv);
- }
-
- // Otherwise query LaunchServices for the location of the XDarwin application
- theStatus = LSFindApplicationForInfo(kLSUnknownCreator,
- CFSTR("org.xfree86.XDarwin"),
- NULL, NULL, &appURL);
- if (theStatus) {
- fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus);
- fprintf(stderr, "Launch XDarwin once from the Finder.\n");
- return theStatus;
- }
-
- appPath = CFURLCopyFileSystemPath (appURL, kCFURLPOSIXPathStyle);
- success = CFStringGetCString(appPath, quartzPath, PATH_MAX, CFStringGetSystemEncoding());
- if (! success) {
- fprintf(stderr, "Could not find path to XDarwin application.\n");
- return success;
- }
-
- // Launch the XDarwin application
- strncat(quartzPath, "/Contents/MacOS/XDarwin", PATH_MAX);
- newargv[0] = quartzPath;
- execv(newargv[0], newargv);
- fprintf(stderr, "Could not start XDarwin application at %s.\n", newargv[0]);
- return errno;
-
- } else {
-
- // Build the new argument list
- newargv = (char **) malloc((argc+1) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[0] = "XDarwin";
- newargv[argc] = NULL;
-
- // Launch the IOKit X server
- execvp(newargv[0], newargv);
- fprintf(stderr, "Could not start XDarwin IOKit X server.\n");
- return errno;
- }
-}
diff --git a/hw/darwin/quartz/XDarwinStartup.man b/hw/darwin/quartz/XDarwinStartup.man
deleted file mode 100644
index 312f4b88b..000000000
--- a/hw/darwin/quartz/XDarwinStartup.man
+++ /dev/null
@@ -1,75 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man,v 1.1 2002/03/28 02:21:18 torrey Exp $
-.TH XDarwinStartup 1
-.SH NAME
-XDarwinStartup - Startup program for the XDarwin X window server
-.SH SYNOPSIS
-.B XDarwinStartup
-[\fI-iokit\fP]
-[\fI-fullscreen\fP]
-[\fI-rootless\fP]
-[\fI-quartz\fP]
-[\fI-idle\fP]
-[\fIoptions\fP]
-.SH DESCRIPTION
-The \fIXDarwin(1)\fP X window server can be run in a variety of different
-modes and is actually two different executables. The IOKit X server,
-XDarwin, is used when running from the console. It is most commonly
-located in __XBinDir__. The Quartz X server, for running in parallel with
-Aqua, is a full-fledged Mac OS X application that can be started from
-the Finder. Its application bundle is XDarwin.app, which is typically
-located in /Applications.
-.I XDarwinStartup
-allows easy switching between these X servers and auto-detection of the
-appropriate one to use when launching from the command line.
-When run without any arguments,
-.I XDarwinStartup
-will start the Quartz X server if the Core Graphics window server
-is currently running. Otherwise it will start the IOKit X server.
-.PP
-To locate the Quartz X server,
-.I XDarwinStartup
-will try to read the soft link at __XBinDir__/XDarwinQuartz.
-This is typically a soft link to the executable of the XDarwin.app
-application. If this fails,
-.I XDarwinStartup
-will call Launch Services to locate XDarwin.app.
-.PP
-To start the IOKit X server,
-.I XDarwinStartup
-will run the XDarwin execuatable, which should be present in the
-user's path.
-.SH OPTIONS
-.I XDarwinStartup
-accepts and passes on all options to the X server it
-launches. In addition the following options have specific effects:
-.TP 8
-.B \-iokit
-Launch the IOKit X server.
-.TP 8
-.B \-fullscreen
-Launch the Quartz X server to run in full screen mode.
-.TP 8
-.B \-rootless
-Launch the Quartz X server to run in rootless mode.
-.TP 8
-.B \-quartz
-Launch the Quartz X server.
-.TP 8
-.B \-idle
-Pause and do nothing. This option is used by XDarwin.app when it is
-started from the Finder.
-.SH FILES
-.TP 30
-__XBinDir__/XDarwin
-IOKit mode X server
-.TP 30
-/Applications/XDarwin.app
-Quartz mode X server
-.TP 30
-__XBinDir__/XDarwinQuartz
-Soft link to Quartz mode X server executable
-.SH SEE ALSO
-XDarwin(1)
-.SH BUGS
-The path to XDarwinQuartz should not be hard coded.
-
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
deleted file mode 100644
index 58c7ff748..000000000
--- a/hw/darwin/quartz/XServer.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// XServer.h
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.15 2003/11/14 20:27:58 torrey Exp $ */
-
-#define BOOL xBOOL
-#include "Xproto.h"
-#undef BOOL
-
-#import <Cocoa/Cocoa.h>
-
-@interface XServer : NSObject {
- // server state
- int serverState;
- NSRecursiveLock *serverLock;
- NSMutableArray *pendingClients;
- BOOL serverVisible;
- BOOL rootlessMenuBarVisible;
- BOOL queueShowServer;
- BOOL quitWithoutQuery;
- UInt32 mouseState;
- BOOL sendServerEvents;
- BOOL x11Active;
-
- // Aqua interface
- IBOutlet NSWindow *modeWindow;
- IBOutlet NSButton *startupModeButton;
- IBOutlet NSButton *startFullScreenButton;
- IBOutlet NSButton *startRootlessButton;
- IBOutlet NSWindow *helpWindow;
- IBOutlet NSButton *startupHelpButton;
- IBOutlet NSPanel *switchWindow;
-
- // Menu elements setable by Apple-WM extension
- IBOutlet NSMenu *windowMenu;
- IBOutlet NSMenuItem *windowSeparator;
- IBOutlet NSMenu *dockMenu;
- int checkedWindowItem;
-}
-
-- (id)init;
-
-- (BOOL)translateEvent:(NSEvent *)anEvent;
-- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
-
-+ (void)append:(NSString *)value toEnv:(NSString *)name;
-
-- (BOOL)loadDisplayBundle;
-- (void)startX;
-- (void)finishStartX;
-- (BOOL)startXClients;
-- (void)runClient:(NSString *)filename;
-- (void)run;
-- (void)toggle;
-- (void)showServer:(BOOL)show;
-- (void)forceShowServer:(BOOL)show;
-- (void)setRootClip:(BOOL)enable;
-- (void)readPasteboard;
-- (void)writePasteboard;
-- (void)quitServer;
-- (void)sendXEvent:(xEvent *)xe;
-- (void)sendShowHide:(BOOL)show;
-- (void)clientProcessDone:(int)clientStatus;
-- (void)activateX11:(BOOL)state;
-- (void)windowBecameKey:(NSWindow *)window;
-- (void)setX11WindowList:(NSArray *)list;
-- (void)setX11WindowCheck:(NSNumber *)nn;
-
-// Aqua interface actions
-- (IBAction)startFullScreen:(id)sender;
-- (IBAction)startRootless:(id)sender;
-- (IBAction)closeHelpAndShow:(id)sender;
-- (IBAction)showSwitchPanel:(id)sender;
-- (IBAction)showAction:(id)sender;
-- (IBAction)itemSelected:(id)sender;
-- (IBAction)nextWindow:(id)sender;
-- (IBAction)previousWindow:(id)sender;
-- (IBAction)performClose:(id)sender;
-- (IBAction)performMiniaturize:(id)sender;
-- (IBAction)performZoom:(id)sender;
-- (IBAction)bringAllToFront:(id)sender;
-- (IBAction)copy:(id)sender;
-
-// NSApplication delegate
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
-- (void)applicationWillTerminate:(NSNotification *)aNotification;
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
-- (void)applicationDidHide:(NSNotification *)aNotification;
-- (void)applicationDidUnhide:(NSNotification *)aNotification;
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
-- (void)applicationWillResignActive:(NSNotification *)aNotification;
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
-
-// NSPort delegate
-- (void)handlePortMessage:(NSPortMessage *)portMessage;
-
-@end
-
-// X server states
-enum {
- server_NotStarted,
- server_Starting,
- server_Running,
- server_Quitting,
- server_Done
-};
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
deleted file mode 100644
index 1be22f82c..000000000
--- a/hw/darwin/quartz/XServer.m
+++ /dev/null
@@ -1,1486 +0,0 @@
-//
-// XServer.m
-//
-// This class handles the interaction between the Cocoa front-end
-// and the Darwin X server thread.
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the
- * sale, use or other dealings in this Software without prior written
- * authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.17 2003/11/14 20:27:58 torrey Exp $ */
-
-#include "quartzCommon.h"
-
-#define BOOL xBOOL
-#include "X.h"
-#include "Xproto.h"
-#include "os.h"
-#include "opaque.h"
-#include "darwin.h"
-#include "quartz.h"
-#define _APPLEWM_SERVER_
-#include "applewm.h"
-#include "applewmExt.h"
-#undef BOOL
-
-#import "XServer.h"
-#import "Preferences.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/syslimits.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <pwd.h>
-#include <signal.h>
-#include <fcntl.h>
-
-// For power management notifications
-#import <mach/mach_port.h>
-#import <mach/mach_interface.h>
-#import <mach/mach_init.h>
-#import <IOKit/pwr_mgt/IOPMLib.h>
-#import <IOKit/IOMessage.h>
-
-// Types of shells
-enum {
- shell_Unknown,
- shell_Bourne,
- shell_C
-};
-
-typedef struct {
- char *name;
- int type;
-} shellList_t;
-
-static shellList_t const shellList[] = {
- { "csh", shell_C }, // standard C shell
- { "tcsh", shell_C }, // ... needs no introduction
- { "sh", shell_Bourne }, // standard Bourne shell
- { "zsh", shell_Bourne }, // Z shell
- { "bash", shell_Bourne }, // GNU Bourne again shell
- { NULL, shell_Unknown }
-};
-
-extern int argcGlobal;
-extern char **argvGlobal;
-extern char **envpGlobal;
-extern int main(int argc, char *argv[], char *envp[]);
-extern void HideMenuBar(void);
-extern void ShowMenuBar(void);
-static void childDone(int sig);
-static void powerDidChange(void *x, io_service_t y, natural_t messageType,
- void *messageArgument);
-
-static NSPort *signalPort;
-static NSPort *returnPort;
-static NSPortMessage *signalMessage;
-static pid_t clientPID;
-static XServer *oneXServer;
-static NSRect aquaMenuBarBox;
-static io_connect_t root_port;
-
-
-@implementation XServer
-
-- (id)init
-{
- self = [super init];
- oneXServer = self;
-
- serverState = server_NotStarted;
- serverLock = [[NSRecursiveLock alloc] init];
- pendingClients = nil;
- clientPID = 0;
- sendServerEvents = NO;
- x11Active = YES;
- serverVisible = NO;
- rootlessMenuBarVisible = YES;
- queueShowServer = YES;
- quartzServerQuitting = NO;
- mouseState = 0;
-
- // set up a port to safely send messages to main thread from server thread
- signalPort = [[NSPort port] retain];
- returnPort = [[NSPort port] retain];
- signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort
- receivePort:returnPort components:nil];
-
- // set up receiving end
- [signalPort setDelegate:self];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSDefaultRunLoopMode];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSModalPanelRunLoopMode];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(windowBecameKey:)
- name:NSWindowDidBecomeKeyNotification
- object:nil];
-
- return self;
-}
-
-- (NSApplicationTerminateReply)
- applicationShouldTerminate:(NSApplication *)sender
-{
- // Quit if the X server is not running
- if ([serverLock tryLock]) {
- quartzServerQuitting = YES;
- serverState = server_Done;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
- return NSTerminateNow;
- }
-
- // Hide the X server and stop sending it events
- [self showServer:NO];
- sendServerEvents = NO;
-
- if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) {
- int but;
-
- but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
- NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""),
- NSLocalizedString(@"Quit",@""),
- NSLocalizedString(@"Cancel",@""),
- nil);
-
- switch (but) {
- case NSAlertDefaultReturn: // quit
- break;
- case NSAlertAlternateReturn: // cancel
- if (serverState == server_Running)
- sendServerEvents = YES;
- return NSTerminateCancel;
- }
- }
-
- quartzServerQuitting = YES;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
-
- // At this point the X server is either running or starting.
- if (serverState == server_Starting) {
- // Quit will be queued later when server is running
- return NSTerminateLater;
- } else if (serverState == server_Running) {
- [self quitServer];
- }
-
- return NSTerminateNow;
-}
-
-// Ensure that everything has quit cleanly
-- (void)applicationWillTerminate:(NSNotification *)aNotification
-{
- // Make sure the client process has finished
- if (clientPID != 0) {
- NSLog(@"Waiting on client process...");
- sleep(2);
-
- // If the client process hasn't finished yet, kill it off
- if (clientPID != 0) {
- int clientStatus;
- NSLog(@"Killing client process...");
- killpg(clientPID, SIGKILL);
- waitpid(clientPID, &clientStatus, 0);
- }
- }
-
- // Wait until the X server thread quits
- [serverLock lock];
-}
-
-// returns YES when event was handled
-- (BOOL)translateEvent:(NSEvent *)anEvent
-{
- xEvent xe;
- static BOOL mouse1Pressed = NO;
- NSEventType type;
- unsigned int flags;
-
- if (!sendServerEvents) {
- return NO;
- }
-
- type = [anEvent type];
- flags = [anEvent modifierFlags];
-
- if (!quartzRootless) {
- // Check for switch keypress
- if ((type == NSKeyDown) && (![anEvent isARepeat]) &&
- ([anEvent keyCode] == [Preferences keyCode]))
- {
- unsigned int switchFlags = [Preferences modifiers];
-
- // Switch if all the switch modifiers are pressed, while none are
- // pressed that should not be, except for caps lock.
- if (((flags & switchFlags) == switchFlags) &&
- ((flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0))
- {
- [self toggle];
- return YES;
- }
- }
-
- if (!serverVisible)
- return NO;
- }
-
- memset(&xe, 0, sizeof(xe));
-
- switch (type) {
- case NSLeftMouseUp:
- [self getMousePosition:&xe fromEvent:anEvent];
- if (quartzRootless && !mouse1Pressed) {
- // MouseUp after MouseDown in menu - ignore
- return NO;
- }
- mouse1Pressed = NO;
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 1;
- break;
- case NSLeftMouseDown:
- [self getMousePosition:&xe fromEvent:anEvent];
- if (quartzRootless) {
- // Check that event is in X11 window
- if (!quartzProcs->IsX11Window([anEvent window],
- [anEvent windowNumber]))
- {
- if (x11Active)
- [self activateX11:NO];
- return NO;
- } else {
- if (!x11Active)
- [self activateX11:YES];
- }
- }
- mouse1Pressed = YES;
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 1;
- break;
- case NSMouseMoved:
- case NSLeftMouseDragged:
- case NSRightMouseDragged:
- case NSOtherMouseDragged:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = MotionNotify;
- break;
- case NSSystemDefined:
- {
- long hwButtons = [anEvent data2];
-
- if (![anEvent subtype]==7)
- return NO; // we only use multibutton mouse events
- if (mouseState == hwButtons)
- return NO; // ignore double events
- mouseState = hwButtons;
-
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = kXDarwinUpdateButtons;
- xe.u.clientMessage.u.l.longs0 = [anEvent data1];
- xe.u.clientMessage.u.l.longs1 =[anEvent data2];
- break;
- }
- case NSScrollWheel:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = kXDarwinScrollWheel;
- xe.u.clientMessage.u.s.shorts0 = [anEvent deltaY];
- break;
- case NSKeyDown:
- case NSKeyUp:
- if (!x11Active)
- return NO;
- // If the mouse is not on the valid X display area,
- // we don't send the X server key events.
- if (![self getMousePosition:&xe fromEvent:nil])
- return NO;
- if (type == NSKeyDown)
- xe.u.u.type = KeyPress;
- else
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = [anEvent keyCode];
- break;
- case NSFlagsChanged:
- if (!x11Active)
- return NO;
- [self getMousePosition:&xe fromEvent:nil];
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = flags;
- break;
- case NSOtherMouseDown: // undocumented MouseDown
- case NSOtherMouseUp: // undocumented MouseUp
- // Hide these from AppKit to avoid its log messages
- return YES;
- default:
- return NO;
- }
-
- [self sendXEvent:&xe];
-
- // Rootless: Send first NSLeftMouseDown to Cocoa windows and views so
- // window ordering can be suppressed.
- // Don't pass further events - they (incorrectly?) bring the window
- // forward no matter what.
- if (quartzRootless &&
- (type == NSLeftMouseDown || type == NSLeftMouseUp) &&
- [anEvent clickCount] == 1 && [anEvent window])
- {
- return NO;
- }
-
- return YES;
-}
-
-// Return mouse coordinates, inverting y coordinate.
-// The coordinates are extracted from an event or the current mouse position.
-// For rootless mode, the menu bar is treated as not part of the usable
-// X display area and the cursor position is adjusted accordingly.
-// Returns YES if the cursor is not in the menu bar.
-- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent
-{
- NSPoint pt;
-
- if (anEvent) {
- NSWindow *eventWindow = [anEvent window];
-
- if (eventWindow) {
- pt = [anEvent locationInWindow];
- pt.x += [eventWindow frame].origin.x;
- pt.y += [eventWindow frame].origin.y;
- } else {
- pt = [NSEvent mouseLocation];
- }
- } else {
- pt = [NSEvent mouseLocation];
- }
-
- xe->u.keyButtonPointer.rootX = (int)(pt.x);
-
- if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) {
- // mouse in menu bar - tell X11 that it's just below instead
- xe->u.keyButtonPointer.rootY = aquaMenuBarHeight;
- return NO;
- } else {
- xe->u.keyButtonPointer.rootY =
- NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y);
- return YES;
- }
-}
-
-// Append a string to the given enviroment variable
-+ (void)append:(NSString*)value toEnv:(NSString*)name
-{
- setenv([name cString],
- [[[NSString stringWithCString:getenv([name cString])]
- stringByAppendingString:value] cString],1);
-}
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
- // Block SIGPIPE
- // SIGPIPE repeatably killed the (rootless) server when closing a
- // dozen xterms in rapid succession. Those SIGPIPEs should have been
- // sent to the X server thread, which ignores them, but somehow they
- // ended up in this thread instead.
- {
- sigset_t set;
- sigemptyset(&set);
- sigaddset(&set, SIGPIPE);
- // pthread_sigmask not implemented yet
- // pthread_sigmask(SIG_BLOCK, &set, NULL);
- sigprocmask(SIG_BLOCK, &set, NULL);
- }
-
- if (quartzRootless == -1) {
- // The display mode was not set from the command line.
- // Show mode pick panel?
- if ([Preferences modeWindow]) {
- if ([Preferences rootless])
- [startRootlessButton setKeyEquivalent:@"\r"];
- else
- [startFullScreenButton setKeyEquivalent:@"\r"];
- [modeWindow makeKeyAndOrderFront:nil];
- } else {
- // Otherwise use default mode
- quartzRootless = [Preferences rootless];
- [self startX];
- }
- } else {
- [self startX];
- }
-}
-
-
-// Load the appropriate display mode bundle
-- (BOOL)loadDisplayBundle
-{
- if (quartzRootless) {
- NSEnumerator *enumerator = [[Preferences displayModeBundles]
- objectEnumerator];
- NSString *bundleName;
-
- while ((bundleName = [enumerator nextObject])) {
- if (QuartzLoadDisplayBundle([bundleName cString]))
- return YES;
- }
-
- return NO;
- } else {
- return QuartzLoadDisplayBundle("fullscreen.bundle");
- }
-}
-
-
-// Start the X server thread and the client process
-- (void)startX
-{
- NSDictionary *appDictionary;
- NSString *appVersion;
-
- [modeWindow close];
-
- // Calculate the height of the menu bar so rootless mode can avoid it
- if (quartzRootless) {
- aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
- NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1;
- aquaMenuBarBox =
- NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1,
- NSWidth([[NSScreen mainScreen] frame]),
- aquaMenuBarHeight);
- }
-
- // Write the XDarwin version to the console log
- appDictionary = [[NSBundle mainBundle] infoDictionary];
- appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"];
- if (appVersion)
- NSLog(@"\n%@", appVersion);
- else
- NSLog(@"No version");
-
- if (![self loadDisplayBundle])
- [NSApp terminate:nil];
-
- // Start the X server thread
- serverState = server_Starting;
- [NSThread detachNewThreadSelector:@selector(run) toTarget:self
- withObject:nil];
-
- // Start the X clients if started from GUI
- if (quartzStartClients) {
- [self startXClients];
- }
-
- if (quartzRootless) {
- // There is no help window for rootless; just start
- [helpWindow close];
- helpWindow = nil;
- } else {
- IONotificationPortRef notify;
- io_object_t anIterator;
-
- // Register for system power notifications
- root_port = IORegisterForSystemPower(0, &notify, powerDidChange,
- &anIterator);
- if (root_port) {
- CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop],
- IONotificationPortGetRunLoopSource(notify),
- kCFRunLoopDefaultMode);
- } else {
- NSLog(@"Failed to register for system power notifications.");
- }
-
- // Show the X switch window if not using dock icon switching
- if (![Preferences dockSwitch])
- [switchWindow orderFront:nil];
-
- if ([Preferences startupHelp]) {
- // display the full screen mode help
- [helpWindow makeKeyAndOrderFront:nil];
- queueShowServer = NO;
- } else {
- // start running full screen and make sure X is visible
- ShowMenuBar();
- [self closeHelpAndShow:nil];
- }
- }
-}
-
-// Finish starting the X server thread
-// This includes anything that must be done after the X server is
-// ready to process events.
-- (void)finishStartX
-{
- sendServerEvents = YES;
- serverState = server_Running;
-
- if (quartzRootless) {
- [self forceShowServer:[NSApp isActive]];
- } else {
- [self forceShowServer:queueShowServer];
- }
-
- if (quartzServerQuitting) {
- [self quitServer];
- [NSApp replyToApplicationShouldTerminate:YES];
- return;
- }
-
- if (pendingClients) {
- NSEnumerator *enumerator = [pendingClients objectEnumerator];
- NSString *filename;
-
- while ((filename = [enumerator nextObject])) {
- [self runClient:filename];
- }
-
- [pendingClients release];
- pendingClients = nil;
- }
-}
-
-// Start the first X clients in a separate process
-- (BOOL)startXClients
-{
- struct passwd *passwdUser;
- NSString *shellPath, *dashShellName, *commandStr, *startXPath;
- NSMutableString *safeStartXPath;
- NSRange aRange;
- NSBundle *thisBundle;
- const char *shellPathStr, *newargv[3], *shellNameStr;
- int fd[2], outFD, length, shellType, i;
-
- // Register to catch the signal when the client processs finishes
- signal(SIGCHLD, childDone);
-
- // Get user's password database entry
- passwdUser = getpwuid(getuid());
-
- // Find the shell to use
- if ([Preferences useDefaultShell])
- shellPath = [NSString stringWithCString:passwdUser->pw_shell];
- else
- shellPath = [Preferences shellString];
-
- dashShellName = [NSString stringWithFormat:@"-%@",
- [shellPath lastPathComponent]];
- shellPathStr = [shellPath cString];
- shellNameStr = [[shellPath lastPathComponent] cString];
-
- if (access(shellPathStr, X_OK)) {
- NSLog(@"Shell %s is not valid!", shellPathStr);
- return NO;
- }
-
- // Find the type of shell
- for (i = 0; shellList[i].name; i++) {
- if (!strcmp(shellNameStr, shellList[i].name))
- break;
- }
- shellType = shellList[i].type;
-
- newargv[0] = [dashShellName cString];
- if (shellType == shell_Bourne) {
- // Bourne shells need to be told they are interactive to make
- // sure they read all their initialization files.
- newargv[1] = "-i";
- newargv[2] = NULL;
- } else {
- newargv[1] = NULL;
- }
-
- // Create a pipe to communicate with the X client process
- NSAssert(pipe(fd) == 0, @"Could not create new pipe.");
-
- // Open a file descriptor for writing to stdout and stderr
- outFD = open("/dev/console", O_WRONLY, 0);
- if (outFD == -1) {
- outFD = open("/dev/null", O_WRONLY, 0);
- NSAssert(outFD != -1, @"Could not open shell output.");
- }
-
- // Fork process to start X clients in user's default shell
- // Sadly we can't use NSTask because we need to start a login shell.
- // Login shells are started by passing "-" as the first character of
- // argument 0. NSTask forces argument 0 to be the shell's name.
- clientPID = vfork();
- if (clientPID == 0) {
-
- // Inside the new process:
- if (fd[0] != STDIN_FILENO) {
- dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
- close(fd[0]);
- }
- close(fd[1]); // Close write end of pipe
- if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
- dup2(outFD, STDERR_FILENO);
- } else if (outFD == STDERR_FILENO) {
- dup2(outFD, STDOUT_FILENO);
- } else {
- dup2(outFD, STDERR_FILENO);
- dup2(outFD, STDOUT_FILENO);
- close(outFD);
- }
-
- // Setup environment
- setenv("HOME", passwdUser->pw_dir, 1);
- setenv("SHELL", shellPathStr, 1);
- setenv("LOGNAME", passwdUser->pw_name, 1);
- setenv("USER", passwdUser->pw_name, 1);
- setenv("TERM", "unknown", 1);
- if (chdir(passwdUser->pw_dir)) // Change to user's home dir
- NSLog(@"Could not change to user's home directory.");
-
- execv(shellPathStr, (char * const *)newargv); // Start user's shell
-
- NSLog(@"Could not start X client process with errno = %i.", errno);
- _exit(127);
- }
-
- // In parent process:
- close(fd[0]); // Close read end of pipe
- close(outFD); // Close output file descriptor
-
- thisBundle = [NSBundle bundleForClass:[self class]];
- startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil];
- if (!startXPath) {
- NSLog(@"Could not find startXClients in application bundle!");
- return NO;
- }
-
- // We will run the startXClients script with the path in single quotes
- // in case there are problematic characters in the path. We still have
- // to worry about there being single quotes in the path. So, replace
- // all instances of the ' character in startXPath with '\''.
- safeStartXPath = [NSMutableString stringWithString:startXPath];
- aRange = NSMakeRange(0, [safeStartXPath length]);
- while (aRange.length) {
- aRange = [safeStartXPath rangeOfString:@"'" options:0 range:aRange];
- if (!aRange.length)
- break;
- [safeStartXPath replaceCharactersInRange:aRange
- withString:@"\'\\'\'"];
- aRange.location += 4;
- aRange.length = [safeStartXPath length] - aRange.location;
- }
-
- if ([Preferences addToPath]) {
- commandStr = [NSString stringWithFormat:@"'%@' :%d %@\n",
- safeStartXPath, [Preferences display],
- [Preferences addToPathString]];
- } else {
- commandStr = [NSString stringWithFormat:@"'%@' :%d\n",
- safeStartXPath, [Preferences display]];
- }
-
- length = [commandStr cStringLength];
- if (write(fd[1], [commandStr cString], length) != length) {
- NSLog(@"Write to X client process failed.");
- return NO;
- }
-
- // Close the pipe so that shell will terminate when xinit quits
- close(fd[1]);
-
- return YES;
-}
-
-// Start the specified client in its own task
-// FIXME: This should be unified with startXClients
-- (void)runClient:(NSString *)filename
-{
- const char *command = [filename UTF8String];
- const char *shell;
- const char *argv[5];
- int child1, child2 = 0;
- int status;
-
- shell = getenv("SHELL");
- if (shell == NULL)
- shell = "/bin/bash";
-
- /* At least [ba]sh, [t]csh and zsh all work with this syntax. We
- need to use an interactive shell to force it to load the user's
- environment. */
-
- argv[0] = shell;
- argv[1] = "-i";
- argv[2] = "-c";
- argv[3] = command;
- argv[4] = NULL;
-
- /* Do the fork-twice trick to avoid having to reap zombies */
-
- child1 = fork();
-
- switch (child1) {
- case -1: /* error */
- break;
-
- case 0: /* child1 */
- child2 = fork();
-
- switch (child2) {
- int max_files, i;
- char buf[1024], *tem;
-
- case -1: /* error */
- _exit(1);
-
- case 0: /* child2 */
- /* close all open files except for standard streams */
- max_files = sysconf(_SC_OPEN_MAX);
- for (i = 3; i < max_files; i++)
- close(i);
-
- /* ensure stdin is on /dev/null */
- close(0);
- open("/dev/null", O_RDONLY);
-
- /* cd $HOME */
- tem = getenv("HOME");
- if (tem != NULL)
- chdir(tem);
-
- /* Setup environment */
- snprintf(buf, sizeof(buf), ":%s", display);
- setenv("DISPLAY", buf, TRUE);
- tem = getenv("PATH");
- if (tem != NULL && tem[0] != NULL)
- snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem);
- else
- snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin");
- setenv("PATH", buf, TRUE);
-
- execvp(argv[0], (char **const) argv);
-
- _exit(2);
-
- default: /* parent (child1) */
- _exit(0);
- }
- break;
-
- default: /* parent */
- waitpid(child1, &status, 0);
- }
-}
-
-// Run the X server thread
-- (void)run
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [serverLock lock];
- main(argcGlobal, argvGlobal, envpGlobal);
- serverVisible = NO;
- [pool release];
- [serverLock unlock];
- QuartzMessageMainThread(kQuartzServerDied, nil, 0);
-}
-
-// Full screen mode was picked in the mode pick panel
-- (IBAction)startFullScreen:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = FALSE;
- [self startX];
-}
-
-// Rootless mode was picked in the mode pick panel
-- (IBAction)startRootless:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = TRUE;
- [self startX];
-}
-
-// Close the help splash screen and show the X server
-- (IBAction)closeHelpAndShow:(id)sender
-{
- if (sender) {
- int helpVal = [startupHelpButton intValue];
- [Preferences setStartupHelp:helpVal];
- [Preferences saveToDisk];
- }
- [helpWindow close];
- helpWindow = nil;
-
- [self forceShowServer:YES];
- [NSApp activateIgnoringOtherApps:YES];
-}
-
-// Show the Aqua-X11 switch panel useful for fullscreen mode
-- (IBAction)showSwitchPanel:(id)sender
-{
- [switchWindow orderFront:nil];
-}
-
-// Show the X server when sent message from GUI
-- (IBAction)showAction:(id)sender
-{
- [self forceShowServer:YES];
-}
-
-// Show or hide the X server or menu bar in rootless mode
-- (void)toggle
-{
- if (quartzRootless) {
-#if 0
- // FIXME: Remove or add option to not dodge menubar
- if (rootlessMenuBarVisible)
- HideMenuBar();
- else
- ShowMenuBar();
- rootlessMenuBarVisible = !rootlessMenuBarVisible;
-#endif
- } else {
- [self showServer:!serverVisible];
- }
-}
-
-// Show or hide the X server on screen
-- (void)showServer:(BOOL)show
-{
- // Do not show or hide multiple times in a row
- if (serverVisible == show)
- return;
-
- if (sendServerEvents) {
- [self sendShowHide:show];
- } else if (serverState == server_Starting) {
- queueShowServer = show;
- }
-}
-
-// Show or hide the X server irregardless of the current state
-- (void)forceShowServer:(BOOL)show
-{
- serverVisible = !show;
- [self showServer:show];
-}
-
-// Tell the X server to show or hide itself.
-// This ignores the current X server visible state.
-//
-// In full screen mode, the order we do things is important and must be
-// preserved between the threads. X drawing operations have to be performed
-// in the X server thread. It appears that we have the additional
-// constraint that we must hide and show the menu bar in the main thread.
-//
-// To show the X server:
-// 1. Capture the displays. (Main thread)
-// 2. Hide the menu bar. (Must be in main thread)
-// 3. Send event to X server thread to redraw X screen.
-// 4. Redraw the X screen. (Must be in X server thread)
-//
-// To hide the X server:
-// 1. Send event to X server thread to stop drawing.
-// 2. Stop drawing to the X screen. (Must be in X server thread)
-// 3. Message main thread that drawing is stopped.
-// 4. If main thread still wants X server hidden:
-// a. Release the displays. (Main thread)
-// b. Unhide the menu bar. (Must be in main thread)
-// Otherwise we have already queued an event to start drawing again.
-//
-- (void)sendShowHide:(BOOL)show
-{
- xEvent xe;
-
- [self getMousePosition:&xe fromEvent:nil];
-
- if (show) {
- if (!quartzRootless) {
- quartzProcs->CaptureScreens();
- HideMenuBar();
- }
- [self activateX11:YES];
-
- // the mouse location will have moved; track it
- xe.u.u.type = MotionNotify;
- [self sendXEvent:&xe];
-
- // inform the X server of the current modifier state
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
- [self sendXEvent:&xe];
-
- // If there is no AppleWM-aware cut and paste manager, do what we can.
- if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
- // put the pasteboard into the X cut buffer
- [self readPasteboard];
- }
- } else {
- // If there is no AppleWM-aware cut and paste manager, do what we can.
- if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
- // put the X cut buffer on the pasteboard
- [self writePasteboard];
- }
-
- [self activateX11:NO];
- }
-
- serverVisible = show;
-}
-
-// Enable or disable rendering to the X screen
-- (void)setRootClip:(BOOL)enable
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinSetRootClip;
- xe.u.clientMessage.u.l.longs0 = enable;
- [self sendXEvent:&xe];
-}
-
-// Tell the X server to read from the pasteboard into the X cut buffer
-- (void)readPasteboard
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinReadPasteboard;
- [self sendXEvent:&xe];
-}
-
-// Tell the X server to write the X cut buffer into the pasteboard
-- (void)writePasteboard
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinWritePasteboard;
- [self sendXEvent:&xe];
-}
-
-- (void)quitServer
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinQuit;
- [self sendXEvent:&xe];
-
- // Revert to the Mac OS X arrow cursor. The main thread sets the cursor
- // and it won't be responding to future requests to change it.
- [[NSCursor arrowCursor] set];
-
- serverState = server_Quitting;
-}
-
-- (void)sendXEvent:(xEvent *)xe
-{
- // This field should be filled in for every event
- xe->u.keyButtonPointer.time = GetTimeInMillis();
-
-#if 0
- // FIXME: Really?
- if (quartzRootless &&
- (ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp ||
- (ev->type == NSSystemDefined && ev->data.compound.subType == 7)))
- {
- // mouse button event - send mouseMoved to this position too
- // X gets confused if it gets a click that isn't at the last
- // reported mouse position.
- xEvent moveEvent = *ev;
- xe.u.u.type = NSMouseMoved;
- [self sendXEvent:&moveEvent];
- }
-#endif
-
- DarwinEQEnqueue(xe);
-}
-
-// Handle messages from the X server thread
-- (void)handlePortMessage:(NSPortMessage *)portMessage
-{
- unsigned msg = [portMessage msgid];
-
- switch (msg) {
- case kQuartzServerHidden:
- // Make sure the X server wasn't queued to be shown again while
- // the hide was pending.
- if (!quartzRootless && !serverVisible) {
- quartzProcs->ReleaseScreens();
- ShowMenuBar();
- }
- break;
-
- case kQuartzServerStarted:
- [self finishStartX];
- break;
-
- case kQuartzServerDied:
- sendServerEvents = NO;
- serverState = server_Done;
- if (!quartzServerQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
- break;
-
- case kQuartzCursorUpdate:
- if (quartzProcs->CursorUpdate)
- quartzProcs->CursorUpdate();
- break;
-
- case kQuartzPostEvent:
- {
- const xEvent *xe = [[[portMessage components] lastObject] bytes];
- DarwinEQEnqueue(xe);
- break;
- }
-
- case kQuartzSetWindowMenu:
- {
- NSArray *list;
- [[[portMessage components] lastObject] getBytes:&list];
- [self setX11WindowList:list];
- [list release];
- break;
- }
-
- case kQuartzSetWindowMenuCheck:
- {
- int n;
- [[[portMessage components] lastObject] getBytes:&n];
- [self setX11WindowCheck:[NSNumber numberWithInt:n]];
- break;
- }
-
- case kQuartzSetFrontProcess:
- [NSApp activateIgnoringOtherApps:YES];
- break;
-
- case kQuartzSetCanQuit:
- {
- int n;
- [[[portMessage components] lastObject] getBytes:&n];
- quitWithoutQuery = (BOOL) n;
- break;
- }
-
- default:
- NSLog(@"Unknown message from server thread.");
- }
-}
-
-// Quit the X server when the X client process finishes
-- (void)clientProcessDone:(int)clientStatus
-{
- if (WIFEXITED(clientStatus)) {
- int exitStatus = WEXITSTATUS(clientStatus);
- if (exitStatus != 0)
- NSLog(@"X client process terminated with status %i.", exitStatus);
- } else {
- NSLog(@"X client process terminated abnormally.");
- }
-
- if (!quartzServerQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
-}
-
-// User selected an X11 window from a menu
-- (IBAction)itemSelected:(id)sender
-{
- xEvent xe;
-
- [NSApp activateIgnoringOtherApps:YES];
-
- // Notify the client of the change through the X server thread
- xe.u.u.type = kXDarwinControllerNotify;
- xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem;
- xe.u.clientMessage.u.l.longs1 = [sender tag];
- [self sendXEvent:&xe];
-}
-
-// User selected Next from window menu
-- (IBAction)nextWindow:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMNextWindow);
-}
-
-// User selected Previous from window menu
-- (IBAction)previousWindow:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMPreviousWindow);
-}
-
-/*
- * The XPR implementation handles close, minimize, and zoom actions for X11
- * windows here, while CR handles these in the NSWindow class.
- */
-
-// Handle Close from window menu for X11 window in XPR implementation
-- (IBAction)performClose:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMCloseWindow);
-}
-
-// Handle Minimize from window menu for X11 window in XPR implementation
-- (IBAction)performMiniaturize:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMMinimizeWindow);
-}
-
-// Handle Zoom from window menu for X11 window in XPR implementation
-- (IBAction)performZoom:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMZoomWindow);
-}
-
-// Handle "Bring All to Front" from window menu
-- (IBAction)bringAllToFront:(id)sender
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMBringAllToFront);
- } else {
- [NSApp arrangeInFront:nil];
- }
-}
-
-// This ends up at the end of the responder chain.
-- (IBAction)copy:(id)sender
-{
- QuartzMessageServerThread(kXDarwinPasteboardNotify, 1,
- AppleWMCopyToPasteboard);
-}
-
-// Set whether or not X11 is active and should receive all key events
-- (void)activateX11:(BOOL)state
-{
- if (state) {
- QuartzMessageServerThread(kXDarwinActivate, 0);
- }
- else {
- QuartzMessageServerThread(kXDarwinDeactivate, 0);
- }
-
- x11Active = state;
-}
-
-// Some NSWindow became the key window
-- (void)windowBecameKey:(NSWindow *)window
-{
- if (quartzProcs->IsX11Window(window, [window windowNumber])) {
- if (!x11Active)
- [self activateX11:YES];
- } else {
- if (x11Active)
- [self activateX11:NO];
- }
-}
-
-// Set the Apple-WM specifiable part of the window menu
-- (void)setX11WindowList:(NSArray *)list
-{
- NSMenuItem *item;
- int first, count, i;
- xEvent xe;
-
- /* Work backwards so we don't mess up the indices */
- first = [windowMenu indexOfItem:windowSeparator] + 1;
- if (first > 0) {
- count = [windowMenu numberOfItems];
- for (i = count - 1; i >= first; i--)
- [windowMenu removeItemAtIndex:i];
- } else {
- windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@""
- action:nil
- keyEquivalent:@""];
- }
-
- count = [dockMenu numberOfItems];
- for (i = 0; i < count; i++)
- [dockMenu removeItemAtIndex:0];
-
- count = [list count];
-
- for (i = 0; i < count; i++)
- {
- NSString *name, *shortcut;
-
- name = [[list objectAtIndex:i] objectAtIndex:0];
- shortcut = [[list objectAtIndex:i] objectAtIndex:1];
-
- item = (NSMenuItem *)[windowMenu addItemWithTitle:name
- action:@selector(itemSelected:)
- keyEquivalent:shortcut];
- [item setTarget:self];
- [item setTag:i];
- [item setEnabled:YES];
-
- item = (NSMenuItem *)[dockMenu insertItemWithTitle:name
- action:@selector(itemSelected:)
- keyEquivalent:shortcut atIndex:i];
- [item setTarget:self];
- [item setTag:i];
- [item setEnabled:YES];
- }
-
- if (checkedWindowItem >= 0 && checkedWindowItem < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
- [item setState:NSOnState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
- [item setState:NSOnState];
- }
-
- // Notify the client of the change through the X server thread
- xe.u.u.type = kXDarwinControllerNotify;
- xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify;
- [self sendXEvent:&xe];
-}
-
-// Set the checked item on the Apple-WM specifiable window menu
-- (void)setX11WindowCheck:(NSNumber *)nn
-{
- NSMenuItem *item;
- int first, count;
- int n = [nn intValue];
-
- first = [windowMenu indexOfItem:windowSeparator] + 1;
- count = [windowMenu numberOfItems] - first;
-
- if (checkedWindowItem >= 0 && checkedWindowItem < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
- [item setState:NSOffState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
- [item setState:NSOffState];
- }
- if (n >= 0 && n < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + n];
- [item setState:NSOnState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:n];
- [item setState:NSOnState];
- }
- checkedWindowItem = n;
-}
-
-// Return whether or not a menu item should be enabled
-- (BOOL)validateMenuItem:(NSMenuItem *)item
-{
- NSMenu *menu = [item menu];
-
- if (menu == windowMenu && [item tag] == 30) {
- // Mode switch panel is for fullscreen only
- return !quartzRootless;
- }
- else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) {
- // The special window and dock menu items should not be active unless
- // there is an AppleWM-aware window manager running.
- return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0;
- }
- else {
- return TRUE;
- }
-}
-
-/*
- * Application Delegate Methods
- */
-
-- (void)applicationDidHide:(NSNotification *)aNotification
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMHideAll);
- } else {
- // FIXME: We need to hide Xplugin windows here
- }
-}
-
-- (void)applicationDidUnhide:(NSNotification *)aNotification
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMShowAll);
- } else {
- [NSApp arrangeInFront:nil];
- }
-}
-
-// Called when the user clicks the application icon,
-// but not when Cmd-Tab is used.
-// Rootless: Don't switch until applicationWillBecomeActive.
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
- hasVisibleWindows:(BOOL)flag
-{
- if ([Preferences dockSwitch] && !quartzRootless) {
- [self showServer:YES];
- }
- return NO;
-}
-
-- (void)applicationWillResignActive:(NSNotification *)aNotification
-{
- [self showServer:NO];
-}
-
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification
-{
- if (quartzRootless) {
- [self showServer:YES];
-
- // If there is no AppleWM-aware window manager, we can't allow
- // interleaving of Aqua and X11 windows.
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) {
- [NSApp arrangeInFront:nil];
- }
- }
-}
-
-// Called when the user opens a document type that we claim (ie. an X11 executable).
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-{
- if (serverState == server_Running) {
- [self runClient:filename];
- return YES;
- }
- else if (serverState == server_NotStarted || serverState == server_Starting) {
- if ([filename UTF8String][0] != ':') { // Ignore display names
- if (!pendingClients) {
- pendingClients = [[NSMutableArray alloc] initWithCapacity:1];
- }
- [pendingClients addObject:filename];
- return YES; // Assume it will launch successfully
- }
- return NO;
- }
-
- // If the server is quitting or done,
- // its too late to launch new clients this time.
- return NO;
-}
-
-@end
-
-
-// Send a message to the main thread, which calls handlePortMessage in
-// response. Must only be called from the X server thread because
-// NSPort is not thread safe.
-void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
-{
- if (length > 0) {
- NSData *eventData = [NSData dataWithBytes:data length:length];
- NSArray *eventArray = [NSArray arrayWithObject:eventData];
- NSPortMessage *newMessage =
- [[NSPortMessage alloc]
- initWithSendPort:signalPort
- receivePort:returnPort components:eventArray];
- [newMessage setMsgid:msg];
- [newMessage sendBeforeDate:[NSDate distantPast]];
- [newMessage release];
- } else {
- [signalMessage setMsgid:msg];
- [signalMessage sendBeforeDate:[NSDate distantPast]];
- }
-}
-
-void
-QuartzSetWindowMenu(int nitems, const char **items,
- const char *shortcuts)
-{
- NSMutableArray *array;
- int i;
-
- array = [[NSMutableArray alloc] initWithCapacity:nitems];
-
- for (i = 0; i < nitems; i++) {
- NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2];
- NSString *string = [NSString stringWithUTF8String:items[i]];
-
- [subarray addObject:string];
-
- if (shortcuts[i] != 0) {
- NSString *number = [NSString stringWithFormat:@"%d",
- shortcuts[i]];
- [subarray addObject:number];
- } else
- [subarray addObject:@""];
-
- [array addObject:subarray];
- }
-
- /* Send the array of strings over to the main thread. */
- /* Will be released in main thread. */
- QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *));
-}
-
-// Handle SIGCHLD signals
-static void childDone(int sig)
-{
- int clientStatus;
-
- if (clientPID == 0)
- return;
-
- // Make sure it was the client task that finished
- if (waitpid(clientPID, &clientStatus, WNOHANG) == clientPID) {
- if (WIFSTOPPED(clientStatus))
- return;
- clientPID = 0;
- [oneXServer clientProcessDone:clientStatus];
- }
-}
-
-static void powerDidChange(
- void *x,
- io_service_t y,
- natural_t messageType,
- void *messageArgument)
-{
- switch (messageType) {
- case kIOMessageSystemWillSleep:
- if (!quartzRootless) {
- [oneXServer setRootClip:FALSE];
- }
- IOAllowPowerChange(root_port, (long)messageArgument);
- break;
- case kIOMessageCanSystemSleep:
- IOAllowPowerChange(root_port, (long)messageArgument);
- break;
- case kIOMessageSystemHasPoweredOn:
- if (!quartzRootless) {
- [oneXServer setRootClip:TRUE];
- }
- break;
- }
-
-}
diff --git a/hw/darwin/quartz/applewm.c b/hw/darwin/quartz/applewm.c
deleted file mode 100644
index d3e302727..000000000
--- a/hw/darwin/quartz/applewm.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.3 2003/11/11 23:48:41 torrey Exp $ */
-/**************************************************************************
-
-Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
-Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#include "quartzCommon.h"
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "misc.h"
-#include "dixstruct.h"
-#include "globals.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-#include "swaprep.h"
-#include "Xatom.h"
-#include "darwin.h"
-#define _APPLEWM_SERVER_
-#include "applewmstr.h"
-#include "applewmExt.h"
-
-#define DEFINE_ATOM_HELPER(func,atom_name) \
-static Atom func (void) { \
- static int generation; \
- static Atom atom; \
- if (generation != serverGeneration) { \
- generation = serverGeneration; \
- atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
- } \
- return atom; \
-}
-
-DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
-
-static AppleWMProcsPtr appleWMProcs;
-
-static int WMErrorBase;
-
-static DISPATCH_PROC(ProcAppleWMDispatch);
-static DISPATCH_PROC(SProcAppleWMDispatch);
-
-static void AppleWMResetProc(ExtensionEntry* extEntry);
-
-static unsigned char WMReqCode = 0;
-static int WMEventBase = 0;
-
-static RESTYPE ClientType, EventType; /* resource types for event masks */
-static XID eventResource;
-
-/* Currently selected events */
-static unsigned int eventMask = 0;
-
-static int WMFreeClient (pointer data, XID id);
-static int WMFreeEvents (pointer data, XID id);
-static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to);
-
-typedef struct _WMEvent *WMEventPtr;
-typedef struct _WMEvent {
- WMEventPtr next;
- ClientPtr client;
- XID clientResource;
- unsigned int mask;
-} WMEventRec;
-
-static inline BoxRec
-make_box (int x, int y, int w, int h)
-{
- BoxRec r;
- r.x1 = x;
- r.y1 = y;
- r.x2 = x + w;
- r.y2 = y + h;
- return r;
-}
-
-void
-AppleWMExtensionInit(
- AppleWMProcsPtr procsPtr)
-{
- ExtensionEntry* extEntry;
-
- ClientType = CreateNewResourceType(WMFreeClient);
- EventType = CreateNewResourceType(WMFreeEvents);
- eventResource = FakeClientID(0);
-
- if (ClientType && EventType &&
- (extEntry = AddExtension(APPLEWMNAME,
- AppleWMNumberEvents,
- AppleWMNumberErrors,
- ProcAppleWMDispatch,
- SProcAppleWMDispatch,
- AppleWMResetProc,
- StandardMinorOpcode)))
- {
- WMReqCode = (unsigned char)extEntry->base;
- WMErrorBase = extEntry->errorBase;
- WMEventBase = extEntry->eventBase;
- EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
- appleWMProcs = procsPtr;
- }
-}
-
-/*ARGSUSED*/
-static void
-AppleWMResetProc (
- ExtensionEntry* extEntry
-)
-{
-}
-
-/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
-void
-AppleWMSetScreenOrigin(
- WindowPtr pWin
-)
-{
- long data[2];
-
- data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
- + darwinMainScreenX);
- data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
- + darwinMainScreenY);
-
- ChangeWindowProperty(pWin, xa_native_screen_origin(), XA_INTEGER,
- 32, PropModeReplace, 2, data, TRUE);
-}
-
-static int
-ProcAppleWMQueryVersion(
- register ClientPtr client
-)
-{
- xAppleWMQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = APPLE_WM_MAJOR_VERSION;
- rep.minorVersion = APPLE_WM_MINOR_VERSION;
- rep.patchVersion = APPLE_WM_PATCH_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-
-/* events */
-
-static inline void
-updateEventMask (WMEventPtr *pHead)
-{
- WMEventPtr pCur;
-
- eventMask = 0;
- for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
- eventMask |= pCur->mask;
-}
-
-/*ARGSUSED*/
-static int
-WMFreeClient (data, id)
- pointer data;
- XID id;
-{
- WMEventPtr pEvent;
- WMEventPtr *pHead, pCur, pPrev;
-
- pEvent = (WMEventPtr) data;
- pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
- if (pHead) {
- pPrev = 0;
- for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
- pPrev = pCur;
- if (pCur) {
- if (pPrev)
- pPrev->next = pEvent->next;
- else
- *pHead = pEvent->next;
- }
- updateEventMask (pHead);
- }
- xfree ((pointer) pEvent);
- return 1;
-}
-
-/*ARGSUSED*/
-static int
-WMFreeEvents (data, id)
- pointer data;
- XID id;
-{
- WMEventPtr *pHead, pCur, pNext;
-
- pHead = (WMEventPtr *) data;
- for (pCur = *pHead; pCur; pCur = pNext) {
- pNext = pCur->next;
- FreeResource (pCur->clientResource, ClientType);
- xfree ((pointer) pCur);
- }
- xfree ((pointer) pHead);
- eventMask = 0;
- return 1;
-}
-
-static int
-ProcAppleWMSelectInput (client)
- register ClientPtr client;
-{
- REQUEST(xAppleWMSelectInputReq);
- WMEventPtr pEvent, pNewEvent, *pHead;
- XID clientResource;
-
- REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
- pHead = (WMEventPtr *)SecurityLookupIDByType(client,
- eventResource, EventType, SecurityWriteAccess);
- if (stuff->mask != 0) {
- if (pHead) {
- /* check for existing entry. */
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
- {
- if (pEvent->client == client)
- {
- pEvent->mask = stuff->mask;
- updateEventMask (pHead);
- return Success;
- }
- }
- }
-
- /* build the entry */
- pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec));
- if (!pNewEvent)
- return BadAlloc;
- pNewEvent->next = 0;
- pNewEvent->client = client;
- pNewEvent->mask = stuff->mask;
- /*
- * add a resource that will be deleted when
- * the client goes away
- */
- clientResource = FakeClientID (client->index);
- pNewEvent->clientResource = clientResource;
- if (!AddResource (clientResource, ClientType, (pointer)pNewEvent))
- return BadAlloc;
- /*
- * create a resource to contain a pointer to the list
- * of clients selecting input. This must be indirect as
- * the list may be arbitrarily rearranged which cannot be
- * done through the resource database.
- */
- if (!pHead)
- {
- pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr));
- if (!pHead ||
- !AddResource (eventResource, EventType, (pointer)pHead))
- {
- FreeResource (clientResource, RT_NONE);
- return BadAlloc;
- }
- *pHead = 0;
- }
- pNewEvent->next = *pHead;
- *pHead = pNewEvent;
- updateEventMask (pHead);
- } else if (stuff->mask == 0) {
- /* delete the interest */
- if (pHead) {
- pNewEvent = 0;
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
- if (pEvent->client == client)
- break;
- pNewEvent = pEvent;
- }
- if (pEvent) {
- FreeResource (pEvent->clientResource, ClientType);
- if (pNewEvent)
- pNewEvent->next = pEvent->next;
- else
- *pHead = pEvent->next;
- xfree (pEvent);
- updateEventMask (pHead);
- }
- }
- } else {
- client->errorValue = stuff->mask;
- return BadValue;
- }
- return Success;
-}
-
-/*
- * deliver the event
- */
-
-void
-AppleWMSendEvent (type, mask, which, arg)
- int type, which, arg;
- unsigned int mask;
-{
- WMEventPtr *pHead, pEvent;
- ClientPtr client;
- xAppleWMNotifyEvent se;
-
- pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
- if (!pHead)
- return;
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
- client = pEvent->client;
- if ((pEvent->mask & mask) == 0
- || client == serverClient || client->clientGone)
- {
- continue;
- }
- se.type = type + WMEventBase;
- se.kind = which;
- se.arg = arg;
- se.sequenceNumber = client->sequence;
- se.time = currentTime.milliseconds;
- WriteEventsToClient (client, 1, (xEvent *) &se);
- }
-}
-
-/* Safe to call from any thread. */
-unsigned int
-AppleWMSelectedEvents (void)
-{
- return eventMask;
-}
-
-
-/* general utility functions */
-
-static int
-ProcAppleWMDisableUpdate(
- register ClientPtr client
-)
-{
- REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq);
-
- appleWMProcs->DisableUpdate();
-
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMReenableUpdate(
- register ClientPtr client
-)
-{
- REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq);
-
- appleWMProcs->EnableUpdate();
-
- return (client->noClientException);
-}
-
-
-/* window functions */
-
-static int
-ProcAppleWMSetWindowMenu(
- register ClientPtr client
-)
-{
- const char *bytes, **items;
- char *shortcuts;
- int max_len, nitems, i, j;
- REQUEST(xAppleWMSetWindowMenuReq);
-
- REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);
-
- nitems = stuff->nitems;
- items = xalloc (sizeof (char *) * nitems);
- shortcuts = xalloc (sizeof (char) * nitems);
-
- max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
- bytes = (char *) &stuff[1];
-
- for (i = j = 0; i < max_len && j < nitems;)
- {
- shortcuts[j] = bytes[i++];
- items[j++] = bytes + i;
-
- while (i < max_len)
- {
- if (bytes[i++] == 0)
- break;
- }
- }
-
- QuartzSetWindowMenu (nitems, items, shortcuts);
-
- free(items);
- free(shortcuts);
-
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMSetWindowMenuCheck(
- register ClientPtr client
-)
-{
- REQUEST(xAppleWMSetWindowMenuCheckReq);
-
- REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
-
- QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index,
- sizeof(stuff->index));
-
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMSetFrontProcess(
- register ClientPtr client
-)
-{
- REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
-
- QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0);
-
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMSetWindowLevel(
- register ClientPtr client
-)
-{
- REQUEST(xAppleWMSetWindowLevelReq);
- WindowPtr pWin;
- int errno;
-
- REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
-
- if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
- client, SecurityReadAccess)))
- {
- return BadValue;
- }
-
- if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) {
- return BadValue;
- }
-
- errno = appleWMProcs->SetWindowLevel(pWin, stuff->level);
- if (errno != Success) {
- return errno;
- }
-
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMSetCanQuit(
- register ClientPtr client
-)
-{
- REQUEST(xAppleWMSetCanQuitReq);
-
- REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
-
- QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state,
- sizeof(stuff->state));
-
- return (client->noClientException);
-}
-
-
-/* frame functions */
-
-static int
-ProcAppleWMFrameGetRect(
- register ClientPtr client
-)
-{
- xAppleWMFrameGetRectReply rep;
- BoxRec ir, or, rr;
- REQUEST(xAppleWMFrameGetRectReq);
-
- REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
- or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
-
- if (appleWMProcs->FrameGetRect(stuff->frame_rect,
- stuff->frame_class,
- &or, &ir, &rr) != Success)
- {
- return BadValue;
- }
-
- rep.x = rr.x1;
- rep.y = rr.y1;
- rep.w = rr.x2 - rr.x1;
- rep.h = rr.y2 - rr.y1;
-
- WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMFrameHitTest(
- register ClientPtr client
-)
-{
- xAppleWMFrameHitTestReply rep;
- BoxRec ir, or;
- int ret;
- REQUEST(xAppleWMFrameHitTestReq);
-
- REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
- or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
-
- if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px,
- stuff->py, &or, &ir, &ret) != Success)
- {
- return BadValue;
- }
-
- rep.ret = ret;
-
- WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcAppleWMFrameDraw(
- register ClientPtr client
-)
-{
- BoxRec ir, or;
- unsigned int title_length, title_max;
- unsigned char *title_bytes;
- REQUEST(xAppleWMFrameDrawReq);
- WindowPtr pWin;
-
- REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
-
- if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
- client, SecurityReadAccess)))
- {
- return BadValue;
- }
-
- ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
- or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
-
- title_length = stuff->title_length;
- title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq);
-
- if (title_max < title_length)
- return BadValue;
-
- title_bytes = (unsigned char *) &stuff[1];
-
- errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class,
- stuff->frame_attr, &or, &ir,
- title_length, title_bytes);
- if (errno != Success) {
- return errno;
- }
-
- return (client->noClientException);
-}
-
-
-/* dispatch */
-
-static int
-ProcAppleWMDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_AppleWMQueryVersion:
- return ProcAppleWMQueryVersion(client);
- }
-
- if (!LocalClient(client))
- return WMErrorBase + AppleWMClientNotLocal;
-
- switch (stuff->data)
- {
- case X_AppleWMSelectInput:
- return ProcAppleWMSelectInput(client);
- case X_AppleWMDisableUpdate:
- return ProcAppleWMDisableUpdate(client);
- case X_AppleWMReenableUpdate:
- return ProcAppleWMReenableUpdate(client);
- case X_AppleWMSetWindowMenu:
- return ProcAppleWMSetWindowMenu(client);
- case X_AppleWMSetWindowMenuCheck:
- return ProcAppleWMSetWindowMenuCheck(client);
- case X_AppleWMSetFrontProcess:
- return ProcAppleWMSetFrontProcess(client);
- case X_AppleWMSetWindowLevel:
- return ProcAppleWMSetWindowLevel(client);
- case X_AppleWMSetCanQuit:
- return ProcAppleWMSetCanQuit(client);
- case X_AppleWMFrameGetRect:
- return ProcAppleWMFrameGetRect(client);
- case X_AppleWMFrameHitTest:
- return ProcAppleWMFrameHitTest(client);
- case X_AppleWMFrameDraw:
- return ProcAppleWMFrameDraw(client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SNotifyEvent(from, to)
- xAppleWMNotifyEvent *from, *to;
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->time, to->time);
- cpswapl (from->arg, to->arg);
-}
-
-static int
-SProcAppleWMQueryVersion(
- register ClientPtr client
-)
-{
- register int n;
- REQUEST(xAppleWMQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcAppleWMQueryVersion(client);
-}
-
-static int
-SProcAppleWMDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return WMErrorBase + AppleWMClientNotLocal;
-
- /* only local clients are allowed WM access */
- switch (stuff->data)
- {
- case X_AppleWMQueryVersion:
- return SProcAppleWMQueryVersion(client);
- default:
- return BadRequest;
- }
-}
diff --git a/hw/darwin/quartz/applewmExt.h b/hw/darwin/quartz/applewmExt.h
deleted file mode 100644
index 650173941..000000000
--- a/hw/darwin/quartz/applewmExt.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * External interface for the server's AppleWM support
- */
-/**************************************************************************
-
-Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
-Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h,v 1.3 2003/11/17 22:20:35 dawes Exp $ */
-
-#ifndef _APPLEWMEXT_H_
-#define _APPLEWMEXT_H_
-
-#include "window.h"
-
-typedef int (*DisableUpdateProc)(void);
-typedef int (*EnableUpdateProc)(void);
-typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
-typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer,
- const BoxRec *inner, BoxRec *ret);
-typedef int (*FrameHitTestProc)(int class, int x, int y,
- const BoxRec *outer,
- const BoxRec *inner, int *ret);
-typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr,
- const BoxRec *outer, const BoxRec *inner,
- unsigned int title_len,
- const unsigned char *title_bytes);
-
-/*
- * AppleWM implementation function list
- */
-typedef struct _AppleWMProcs {
- DisableUpdateProc DisableUpdate;
- EnableUpdateProc EnableUpdate;
- SetWindowLevelProc SetWindowLevel;
- FrameGetRectProc FrameGetRect;
- FrameHitTestProc FrameHitTest;
- FrameDrawProc FrameDraw;
-} AppleWMProcsRec, *AppleWMProcsPtr;
-
-extern AppleWMProcsPtr appleWMProcs;
-
-void AppleWMExtensionInit(
- AppleWMProcsPtr procsPtr
-);
-
-void AppleWMSetScreenOrigin(
- WindowPtr pWin
-);
-
-void AppleWMSendEvent(
- int /* type */,
- unsigned int /* mask */,
- int /* which */,
- int /* arg */
-);
-
-unsigned int AppleWMSelectedEvents(
- void
-);
-
-#endif /* _APPLEWMEXT_H_ */
diff --git a/hw/darwin/quartz/cr/XView.h b/hw/darwin/quartz/cr/XView.h
deleted file mode 100644
index 666061dc1..000000000
--- a/hw/darwin/quartz/cr/XView.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * NSView subclass for Mac OS X rootless X server
- *
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.h,v 1.1 2003/06/07 05:49:07 torrey Exp $ */
-
-#import <Cocoa/Cocoa.h>
-
-@interface XView : NSQuickDrawView
-
-- (BOOL)isFlipped;
-- (BOOL)isOpaque;
-- (BOOL)acceptsFirstResponder;
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
-
-- (void)mouseDown:(NSEvent *)anEvent;
-
-@end
diff --git a/hw/darwin/quartz/cr/XView.m b/hw/darwin/quartz/cr/XView.m
deleted file mode 100644
index 2bf689ede..000000000
--- a/hw/darwin/quartz/cr/XView.m
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * NSView subclass for Mac OS X rootless X server
- *
- * Each rootless window contains an instance of this class.
- * This class handles events while drawing is handled by Carbon
- * code in the rootless Aqua implementation.
- *
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.2 2003/10/16 23:50:16 torrey Exp $ */
-
-#import "XView.h"
-
-
-@implementation XView
-
-- (BOOL)isFlipped
-{
- return NO;
-}
-
-- (BOOL)isOpaque
-{
- return YES;
-}
-
-- (BOOL)acceptsFirstResponder
-{
- return YES;
-}
-
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
-{
- return YES;
-}
-
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent
-{
- return YES;
-}
-
-- (void)mouseDown:(NSEvent *)anEvent
-{
- // Only X is allowed to restack windows.
- [NSApp preventWindowOrdering];
- if (! [NSApp isActive]) {
- [NSApp activateIgnoringOtherApps:YES];
- }
- [[self nextResponder] mouseDown:anEvent];
-}
-
-@end
diff --git a/hw/darwin/quartz/cr/cr.h b/hw/darwin/quartz/cr/cr.h
deleted file mode 100644
index 74752f768..000000000
--- a/hw/darwin/quartz/cr/cr.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Internal definitions of the Cocoa rootless implementation
- */
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/cr.h,v 1.3 2003/11/03 05:36:31 tsi Exp $ */
-
-#ifndef _CR_H
-#define _CR_H
-
-#ifdef __OBJC__
-#import <Cocoa/Cocoa.h>
-#import "XView.h"
-#else
-typedef struct OpaqueNSWindow NSWindow;
-typedef struct OpaqueXView XView;
-#endif
-
-#undef BOOL
-#define BOOL xBOOL
-#include "screenint.h"
-#include "window.h"
-#undef BOOL
-
-// Predefined style for the window which is about to be framed
-extern WindowPtr nextWindowToFrame;
-extern unsigned int nextWindowStyle;
-
-typedef struct {
- NSWindow *window;
- XView *view;
- GrafPtr port;
- CGContextRef context;
-} CRWindowRec, *CRWindowPtr;
-
-Bool CRInit(ScreenPtr pScreen);
-void CRAppleWMInit(void);
-
-#endif /* _CR_H */
diff --git a/hw/darwin/quartz/cr/crAppleWM.m b/hw/darwin/quartz/cr/crAppleWM.m
deleted file mode 100644
index 66e832b66..000000000
--- a/hw/darwin/quartz/cr/crAppleWM.m
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Cocoa rootless implementation functions for AppleWM extension
- */
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m,v 1.1 2003/09/16 00:36:14 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "rootless.h"
-#include "X.h"
-#define _APPLEWM_SERVER_
-#include "applewm.h"
-#include "applewmExt.h"
-#undef BOOL
-
-#define StdDocumentStyleMask (NSTitledWindowMask | \
- NSClosableWindowMask | \
- NSMiniaturizableWindowMask | \
- NSResizableWindowMask)
-
-static int
-CRDisableUpdate(void)
-{
- return Success;
-}
-
-
-static int
-CREnableUpdate(void)
-{
- return Success;
-}
-
-
-static int CRSetWindowLevel(
- WindowPtr pWin,
- int level)
-{
- CRWindowPtr crWinPtr;
-
- crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
- if (crWinPtr == 0)
- return BadWindow;
-
- RootlessStopDrawing(pWin, FALSE);
-
- [crWinPtr->window setLevel:level];
-
- return Success;
-}
-
-
-static int CRFrameGetRect(
- int type,
- int class,
- const BoxRec *outer,
- const BoxRec *inner,
- BoxRec *ret)
-{
- return Success;
-}
-
-
-static int CRFrameHitTest(
- int class,
- int x,
- int y,
- const BoxRec *outer,
- const BoxRec *inner,
- int *ret)
-{
- return 0;
-}
-
-
-static int CRFrameDraw(
- WindowPtr pWin,
- int class,
- unsigned int attr,
- const BoxRec *outer,
- const BoxRec *inner,
- unsigned int title_len,
- const unsigned char *title_bytes)
-{
- CRWindowPtr crWinPtr;
- NSWindow *window;
- Bool hasResizeIndicator;
-
- /* We assume the window has not yet been framed so
- RootlessFrameForWindow() will cause it to be. Record the window
- style so that the appropriate one will be used when it is framed.
- If the window is already framed, we can't change the window
- style and the following will have no effect. */
-
- nextWindowToFrame = pWin;
- if (class == AppleWMFrameClassDocument)
- nextWindowStyle = StdDocumentStyleMask;
- else
- nextWindowStyle = NSBorderlessWindowMask;
-
- crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
- if (crWinPtr == 0)
- return BadWindow;
-
- window = crWinPtr->window;
-
- [window setTitle:[NSString stringWithCString:title_bytes
- length:title_len]];
-
- hasResizeIndicator = (attr & AppleWMFrameGrowBox) ? YES : NO;
- [window setShowsResizeIndicator:hasResizeIndicator];
-
- return Success;
-}
-
-
-static AppleWMProcsRec crAppleWMProcs = {
- CRDisableUpdate,
- CREnableUpdate,
- CRSetWindowLevel,
- CRFrameGetRect,
- CRFrameHitTest,
- CRFrameDraw
-};
-
-
-void CRAppleWMInit(void)
-{
- AppleWMExtensionInit(&crAppleWMProcs);
-}
diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m
deleted file mode 100644
index e3e83ebc4..000000000
--- a/hw/darwin/quartz/cr/crFrame.m
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Cocoa rootless implementation frame functions
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.5 2003/11/13 20:26:31 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "rootless.h"
-#undef BOOL
-
-WindowPtr nextWindowToFrame = NULL;
-unsigned int nextWindowStyle = 0;
-
-static void CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape);
-
-
-/*
- * CRCreateFrame
- * Create a new physical window.
- * Rootless windows must not autodisplay! Autodisplay can cause a deadlock.
- * Event thread - autodisplay: locks view hierarchy, then window
- * X Server thread - window resize: locks window, then view hierarchy
- * Deadlock occurs if each thread gets one lock and waits for the other.
- */
-static Bool
-CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
- int newX, int newY, RegionPtr pShape)
-{
- CRWindowPtr crWinPtr;
- NSRect bounds;
- NSWindow *theWindow;
- XView *theView;
- unsigned int theStyleMask = NSBorderlessWindowMask;
-
- crWinPtr = (CRWindowPtr) xalloc(sizeof(CRWindowRec));
-
- bounds = NSMakeRect(newX,
- NSHeight([[NSScreen mainScreen] frame]) -
- newY - pFrame->height,
- pFrame->width, pFrame->height);
-
- // Check if AppleWM has specified a style for this window
- if (pFrame->win == nextWindowToFrame) {
- theStyleMask = nextWindowStyle;
- }
- nextWindowToFrame = NULL;
-
- // Create an NSWindow for the new X11 window
- theWindow = [[NSWindow alloc] initWithContentRect:bounds
- styleMask:theStyleMask
- backing:NSBackingStoreBuffered
- defer:NO];
- if (!theWindow) return FALSE;
-
- [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent
- [theWindow setAlphaValue:1.0]; // draw opaque
- [theWindow setOpaque:YES]; // changed when window is shaped
-
- [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views
- [theWindow setAutodisplay:NO]; // See comment above
- [theWindow disableFlushWindow]; // We do all the flushing manually
- [theWindow setHasShadow:YES]; // All windows have shadows
- [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure
-
- theView = [[XView alloc] initWithFrame:bounds];
- [theWindow setContentView:theView];
- [theWindow setInitialFirstResponder:theView];
-
- [theWindow setAcceptsMouseMovedEvents:YES];
-
- crWinPtr->window = theWindow;
- crWinPtr->view = theView;
-
- [theView lockFocus];
- // Fill the window with white to make sure alpha channel is set
- NSEraseRect(bounds);
- crWinPtr->port = [theView qdPort];
- crWinPtr->context = [[NSGraphicsContext currentContext] graphicsPort];
- // CreateCGContextForPort(crWinPtr->port, &crWinPtr->context);
- [theView unlockFocus];
-
- // Store the implementation private frame ID
- pFrame->wid = (RootlessFrameID) crWinPtr;
-
- // Reshape the frame if it was created shaped.
- if (pShape != NULL)
- CRReshapeFrame(pFrame->wid, pShape);
-
- return TRUE;
-}
-
-
-/*
- * CRDestroyFrame
- * Destroy a frame.
- */
-static void
-CRDestroyFrame(RootlessFrameID wid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- [crWinPtr->window orderOut:nil];
- [crWinPtr->window close];
- [crWinPtr->view release];
- free(crWinPtr);
-}
-
-
-/*
- * CRMoveFrame
- * Move a frame on screen.
- */
-static void
-CRMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSPoint topLeft;
-
- topLeft = NSMakePoint(newX,
- NSHeight([[NSScreen mainScreen] frame]) - newY);
-
- [crWinPtr->window setFrameTopLeftPoint:topLeft];
-}
-
-
-/*
- * CRResizeFrame
- * Move and resize a frame.
- */
-static void
-CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
- int newX, int newY, unsigned int newW, unsigned int newH,
- unsigned int gravity)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) -
- newY - newH, newW, newH);
-
- [crWinPtr->window setFrame:bounds display:NO];
-}
-
-
-/*
- * CRRestackFrame
- * Change the frame order. Put the frame behind nextWid or on top if
- * it is NULL. Unmapped frames are mapped by restacking them.
- */
-static void
-CRRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- CRWindowPtr crNextWinPtr = (CRWindowPtr) nextWid;
-
- if (crNextWinPtr) {
- int upperNum = [crNextWinPtr->window windowNumber];
-
- [crWinPtr->window orderWindow:NSWindowBelow relativeTo:upperNum];
- } else {
- [crWinPtr->window makeKeyAndOrderFront:nil];
- }
-}
-
-
-/*
- * CRReshapeFrame
- * Set the shape of a frame.
- */
-static void
-CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSRect bounds = [crWinPtr->view frame];
- int winHeight = NSHeight(bounds);
- BoxRec localBox = {0, 0, NSWidth(bounds), winHeight};
-
- [crWinPtr->view lockFocus];
-
- if (pShape != NULL) {
- // Calculate the region outside the new shape.
- REGION_INVERSE(NULL, pShape, pShape, &localBox);
- }
-
- // If window is currently shaped we need to undo the previous shape.
- if (![crWinPtr->window isOpaque]) {
- [[NSColor whiteColor] set];
- NSRectFillUsingOperation(bounds, NSCompositeDestinationAtop);
- }
-
- if (pShape != NULL) {
- int count = REGION_NUM_RECTS(pShape);
- BoxRec *extRects = REGION_RECTS(pShape);
- BoxRec *rects, *end;
-
- // Make transparent if window is now shaped.
- [crWinPtr->window setOpaque:NO];
-
- // Clear the areas outside the window shape
- [[NSColor clearColor] set];
- for (rects = extRects, end = extRects+count; rects < end; rects++) {
- int rectHeight = rects->y2 - rects->y1;
- NSRectFill( NSMakeRect(rects->x1,
- winHeight - rects->y1 - rectHeight,
- rects->x2 - rects->x1, rectHeight) );
- }
- [[NSGraphicsContext currentContext] flushGraphics];
-
- // force update of window shadow
- [crWinPtr->window setHasShadow:NO];
- [crWinPtr->window setHasShadow:YES];
-
- } else {
- [crWinPtr->window setOpaque:YES];
- [[NSGraphicsContext currentContext] flushGraphics];
- }
-
- [crWinPtr->view unlockFocus];
-}
-
-
-/*
- * CRUnmapFrame
- * Unmap a frame.
- */
-static void
-CRUnmapFrame(RootlessFrameID wid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- [crWinPtr->window orderOut:nil];
-}
-
-
-/*
- * CRStartDrawing
- * When a window's buffer is not being drawn to, the CoreGraphics
- * window server may compress or move it. Call this routine
- * to lock down the buffer during direct drawing. It returns
- * a pointer to the backing buffer.
- */
-static void
-CRStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- PixMapHandle pix;
-
- [crWinPtr->view lockFocus];
- crWinPtr->port = [crWinPtr->view qdPort];
- LockPortBits(crWinPtr->port);
- [crWinPtr->view unlockFocus];
- pix = GetPortPixMap(crWinPtr->port);
-
- *pixelData = GetPixBaseAddr(pix);
- *bytesPerRow = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed?
-}
-
-
-/*
- * CRStopDrawing
- * When direct access to a window's buffer is no longer needed, this
- * routine should be called to allow CoreGraphics to compress or
- * move it.
- */
-static void
-CRStopDrawing(RootlessFrameID wid, Bool flush)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- UnlockPortBits(crWinPtr->port);
-
- if (flush) {
- QDFlushPortBuffer(crWinPtr->port, NULL);
- }
-}
-
-
-/*
- * CRUpdateRegion
- * Flush a region from a window's backing buffer to the screen.
- */
-static void
-CRUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- int count = REGION_NUM_RECTS(pDamage);
- BoxRec *rects = REGION_RECTS(pDamage);
- BoxRec *end;
-
- static RgnHandle rgn = NULL;
- static RgnHandle box = NULL;
-
- if (!rgn) rgn = NewRgn();
- if (!box) box = NewRgn();
-
- for (end = rects+count; rects < end; rects++) {
- Rect qdRect;
- qdRect.left = rects->x1;
- qdRect.top = rects->y1;
- qdRect.right = rects->x2;
- qdRect.bottom = rects->y2;
-
- RectRgn(box, &qdRect);
- UnionRgn(rgn, box, rgn);
- }
-
- QDFlushPortBuffer(crWinPtr->port, rgn);
-
- SetEmptyRgn(rgn);
- SetEmptyRgn(box);
-
-#else /* !ROOTLESS_TRACK_DAMAGE */
- QDFlushPortBuffer(crWinPtr->port, NULL);
-#endif
-}
-
-
-/*
- * CRDamageRects
- * Mark damaged rectangles as requiring redisplay to screen.
- */
-static void
-CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects,
- int shift_x, int shift_y)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- const BoxRec *end;
-
- for (end = rects + count; rects < end; rects++) {
- Rect qdRect;
- qdRect.left = rects->x1 + shift_x;
- qdRect.top = rects->y1 + shift_y;
- qdRect.right = rects->x2 + shift_x;
- qdRect.bottom = rects->y2 + shift_y;
-
- QDAddRectToDirtyRegion(crWinPtr->port, &qdRect);
- }
-}
-
-
-static RootlessFrameProcsRec CRRootlessProcs = {
- CRCreateFrame,
- CRDestroyFrame,
- CRMoveFrame,
- CRResizeFrame,
- CRRestackFrame,
- CRReshapeFrame,
- CRUnmapFrame,
- CRStartDrawing,
- CRStopDrawing,
- CRUpdateRegion,
- CRDamageRects,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-
-/*
- * Initialize CR implementation
- */
-Bool
-CRInit(ScreenPtr pScreen)
-{
- RootlessInit(pScreen, &CRRootlessProcs);
-
- rootless_CopyBytes_threshold = 0;
- rootless_FillBytes_threshold = 0;
- rootless_CompositePixels_threshold = 0;
- rootless_CopyWindow_threshold = 0;
-
- return TRUE;
-}
diff --git a/hw/darwin/quartz/cr/crScreen.m b/hw/darwin/quartz/cr/crScreen.m
deleted file mode 100644
index d259d0bac..000000000
--- a/hw/darwin/quartz/cr/crScreen.m
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Cocoa rootless implementation initialization
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "darwin.h"
-#include "quartz.h"
-#include "quartzCursor.h"
-#include "rootless.h"
-#include "safeAlpha.h"
-#include "pseudoramiX.h"
-#include "applewmExt.h"
-
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "picturestr.h"
-#include "globals.h"
-#undef BOOL
-
-// Name of GLX bundle using AGL framework
-static const char *crOpenGLBundle = "glxAGL.bundle";
-
-static Class classXView = nil;
-
-
-/*
- * CRDisplayInit
- * Find all screens.
- *
- * Multihead note: When rootless mode uses PseudoramiX, the
- * X server only sees one screen; only PseudoramiX itself knows
- * about all of the screens.
- */
-static void
-CRDisplayInit(void)
-{
- ErrorF("Display mode: Rootless Quartz -- Cocoa implementation\n");
-
- if (noPseudoramiXExtension) {
- darwinScreensFound = [[NSScreen screens] count];
- } else {
- darwinScreensFound = 1; // only PseudoramiX knows about the rest
- }
-
- CRAppleWMInit();
-}
-
-
-/*
- * CRScreenParams
- * Set the basic screen parameters.
- */
-static void
-CRScreenParams(int index, DarwinFramebufferPtr dfb)
-{
- dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
- dfb->colorBitsPerPixel = 3 * dfb->bitsPerComponent;
-
- if (noPseudoramiXExtension) {
- NSScreen *screen = [[NSScreen screens] objectAtIndex:index];
- NSRect frame = [screen frame];
-
- // set x, y so (0,0) is top left of main screen
- dfb->x = NSMinX(frame);
- dfb->y = NSHeight([[NSScreen mainScreen] frame]) -
- NSHeight(frame) - NSMinY(frame);
-
- dfb->width = NSWidth(frame);
- dfb->height = NSHeight(frame);
- dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
-
- // Shift the usable part of main screen down to avoid the menu bar.
- if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) {
- dfb->y += aquaMenuBarHeight;
- dfb->height -= aquaMenuBarHeight;
- }
-
- } else {
- int i;
- NSRect unionRect = NSMakeRect(0, 0, 0, 0);
- NSArray *screens = [NSScreen screens];
-
- // Get the union of all screens (minus the menu bar on main screen)
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
- unionRect = NSUnionRect(unionRect, frame);
- }
-
- // Use unionRect as the screen size for the X server.
- dfb->x = unionRect.origin.x;
- dfb->y = unionRect.origin.y;
- dfb->width = unionRect.size.width;
- dfb->height = unionRect.size.height;
- dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
-
- // Tell PseudoramiX about the real screens.
- // InitOutput() will move the big screen to (0,0),
- // so compensate for that here.
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- int j;
-
- // Skip this screen if it's a mirrored copy of an earlier screen.
- for (j = 0; j < i; j++) {
- if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
- ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
- i, j);
- break;
- }
- }
- if (j < i) continue; // this screen is a mirrored copy
-
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
-
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
-
- ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
- (int)frame.size.width, (int)frame.size.height,
- (int)frame.origin.x, (int)frame.origin.y);
-
- frame.origin.x -= unionRect.origin.x;
- frame.origin.y -= unionRect.origin.y;
-
- ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
- i, (int)frame.origin.x, (int)frame.origin.y);
-
- PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
- frame.size.width, frame.size.height);
- }
- }
-}
-
-
-/*
- * CRAddScreen
- * Init the framebuffer and record pixmap parameters for the screen.
- */
-static Bool
-CRAddScreen(int index, ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGRect cgRect;
- CGDisplayCount numDisplays;
- CGDisplayCount allocatedDisplays = 0;
- CGDirectDisplayID *displays = NULL;
- CGDisplayErr cgErr;
-
- CRScreenParams(index, dfb);
-
- dfb->colorType = TrueColor;
-
- // No frame buffer - it's all in window pixmaps.
- dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height);
-
- // Get all CoreGraphics displays covered by this X11 display.
- cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height);
- do {
- cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays);
- if (cgErr) break;
- allocatedDisplays = numDisplays;
- displays = xrealloc(displays,
- numDisplays * sizeof(CGDirectDisplayID));
- cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays,
- &numDisplays);
- if (cgErr != CGDisplayNoErr) break;
- } while (numDisplays > allocatedDisplays);
-
- if (cgErr != CGDisplayNoErr || numDisplays == 0) {
- ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n",
- index, dfb->width, dfb->height, dfb->x, dfb->y);
- return FALSE;
- }
-
- // This X11 screen covers all CoreGraphics displays we just found.
- // If there's more than one CG display, then video mirroring is on
- // or PseudoramiX is on.
- displayInfo->displayCount = allocatedDisplays;
- displayInfo->displayIDs = displays;
-
- return TRUE;
-}
-
-
-/*
- * CRSetupScreen
- * Setup the screen for rootless access.
- */
-static Bool
-CRSetupScreen(int index, ScreenPtr pScreen)
-{
- // Add alpha protecting replacements for fb screen functions
- pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
- pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
-
-#ifdef RENDER
- {
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- ps->Composite = SafeAlphaComposite;
- }
-#endif /* RENDER */
-
- // Initialize generic rootless code
- return CRInit(pScreen);
-}
-
-
-/*
- * CRInitInput
- * Finalize CR specific setup.
- */
-static void
-CRInitInput(int argc, char **argv)
-{
- int i;
-
- rootlessGlobalOffsetX = darwinMainScreenX;
- rootlessGlobalOffsetY = darwinMainScreenY;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- AppleWMSetScreenOrigin(WindowTable[i]);
-}
-
-
-/*
- * CRIsX11Window
- * Returns TRUE if cr is displaying this window.
- */
-static Bool
-CRIsX11Window(void *nsWindow, int windowNumber)
-{
- NSWindow *theWindow = nsWindow;
-
- if (!theWindow)
- return FALSE;
-
- if ([[theWindow contentView] isKindOfClass:classXView])
- return TRUE;
- else
- return FALSE;
-}
-
-
-/*
- * Quartz display mode function list.
- */
-static QuartzModeProcsRec crModeProcs = {
- CRDisplayInit,
- CRAddScreen,
- CRSetupScreen,
- CRInitInput,
- QuartzInitCursor,
- QuartzReallySetCursor,
- QuartzSuspendXCursor,
- QuartzResumeXCursor,
- NULL, // No capture or release in rootless mode
- NULL,
- CRIsX11Window,
- RootlessFrameForWindow,
- TopLevelParent,
- NULL, // No support for DRI surfaces
- NULL
-};
-
-
-/*
- * QuartzModeBundleInit
- * Initialize the display mode bundle after loading.
- */
-Bool
-QuartzModeBundleInit(void)
-{
- quartzProcs = &crModeProcs;
- quartzOpenGLBundle = crOpenGLBundle;
- classXView = [XView class];
- return TRUE;
-}
diff --git a/hw/darwin/quartz/fullscreen/fullscreen.c b/hw/darwin/quartz/fullscreen/fullscreen.c
deleted file mode 100644
index fc390e87f..000000000
--- a/hw/darwin/quartz/fullscreen/fullscreen.c
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Screen routines for full screen Quartz mode
- *
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.2 2003/11/12 20:21:52 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "darwin.h"
-#include "quartz.h"
-#include "quartzCursor.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "micmap.h"
-#include "shadow.h"
-
-// Full screen specific per screen storage structure
-typedef struct {
- CGDirectDisplayID displayID;
- CFDictionaryRef xDisplayMode;
- CFDictionaryRef aquaDisplayMode;
- CGDirectPaletteRef xPalette;
- CGDirectPaletteRef aquaPalette;
- unsigned char *framebuffer;
- unsigned char *shadowPtr;
-} FSScreenRec, *FSScreenPtr;
-
-#define FULLSCREEN_PRIV(pScreen) \
- ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr)
-
-static int fsScreenIndex;
-static CGDirectDisplayID *quartzDisplayList = NULL;
-static int quartzNumScreens = 0;
-static FSScreenPtr quartzScreens[MAXSCREENS];
-
-static int darwinCmapPrivateIndex = -1;
-static unsigned long darwinCmapGeneration = 0;
-
-#define CMAP_PRIV(pCmap) \
- ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr)
-
-/*
- =============================================================================
-
- Colormap handling
-
- =============================================================================
-*/
-
-/*
- * FSInitCmapPrivates
- * Colormap privates may be allocated after the default colormap has
- * already been created for some screens. This initialization procedure
- * is called for each default colormap that is found.
- */
-static Bool
-FSInitCmapPrivates(
- ColormapPtr pCmap)
-{
- return TRUE;
-}
-
-
-/*
- * FSCreateColormap
- * This is a callback from X after a new colormap is created.
- * We allocate a new CoreGraphics pallete for each colormap.
- */
-static Bool
-FSCreateColormap(
- ColormapPtr pCmap)
-{
- CGDirectPaletteRef pallete;
-
- // Allocate private storage for the hardware dependent colormap info.
- if (darwinCmapGeneration != serverGeneration) {
- if ((darwinCmapPrivateIndex =
- AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0)
- {
- return FALSE;
- }
- darwinCmapGeneration = serverGeneration;
- }
-
- pallete = CGPaletteCreateDefaultColorPalette();
- if (!pallete) return FALSE;
-
- CMAP_PRIV(pCmap) = pallete;
- return TRUE;
-}
-
-
-/*
- * FSDestroyColormap
- * This is called by DIX FreeColormap after it has uninstalled a colormap
- * and notified all interested parties. We deallocated the corresponding
- * CoreGraphics pallete.
- */
-static void
-FSDestroyColormap(
- ColormapPtr pCmap)
-{
- CGPaletteRelease( CMAP_PRIV(pCmap) );
-}
-
-
-/*
- * FSInstallColormap
- * Set the current CoreGraphics pallete to the pallete corresponding
- * to the provided colormap.
- */
-static void
-FSInstallColormap(
- ColormapPtr pCmap)
-{
- CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
- ScreenPtr pScreen = pCmap->pScreen;
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
-
- // Inform all interested parties that the map is being changed.
- miInstallColormap(pCmap);
-
- if (quartzServerVisible)
- CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
-
- fsDisplayInfo->xPalette = palette;
-}
-
-
-/*
- * FSStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor in full screen mode.
- */
-static void
-FSStoreColors(
- ColormapPtr pCmap,
- int numEntries,
- xColorItem *pdefs)
-{
- CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
- ScreenPtr pScreen = pCmap->pScreen;
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDeviceColor color;
- int i;
-
- if (! palette)
- return;
-
- for (i = 0; i < numEntries; i++) {
- color.red = pdefs[i].red / 65535.0;
- color.green = pdefs[i].green / 65535.0;
- color.blue = pdefs[i].blue / 65535.0;
- CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel);
- }
-
- // Update hardware colormap
- if (quartzServerVisible)
- CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
-}
-
-
-/*
- =============================================================================
-
- Switching between Aqua and X
-
- =============================================================================
-*/
-
-/*
- * FSCapture
- * Capture the screen so we can draw. Called directly from the main thread
- * to synchronize with hiding the menubar.
- */
-static void FSCapture(void)
-{
- int i;
-
- if (quartzRootless) return;
-
- for (i = 0; i < quartzNumScreens; i++) {
- FSScreenPtr fsDisplayInfo = quartzScreens[i];
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (!CGDisplayIsCaptured(cgID)) {
- CGDisplayCapture(cgID);
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- if (fsDisplayInfo->xPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette);
- }
- }
-}
-
-
-/*
- * FSRelease
- * Release the screen so others can draw.
- */
-static void FSRelease(void)
-{
- int i;
-
- if (quartzRootless) return;
-
- for (i = 0; i < quartzNumScreens; i++) {
- FSScreenPtr fsDisplayInfo = quartzScreens[i];
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (CGDisplayIsCaptured(cgID)) {
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode);
- if (fsDisplayInfo->aquaPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette);
- CGDisplayRelease(cgID);
- }
- }
-}
-
-
-/*
- * FSSuspendScreen
- * Suspend X11 cursor and drawing to the screen.
- */
-static void FSSuspendScreen(
- ScreenPtr pScreen)
-{
- QuartzSuspendXCursor(pScreen);
- xf86SetRootClip(pScreen, FALSE);
-}
-
-
-/*
- * FSResumeScreen
- * Resume X11 cursor and drawing to the screen.
- */
-static void FSResumeScreen(
- ScreenPtr pScreen,
- int x, // cursor location
- int y )
-{
- QuartzResumeXCursor(pScreen, x, y);
- xf86SetRootClip(pScreen, TRUE);
-}
-
-
-/*
- =============================================================================
-
- Screen initialization
-
- =============================================================================
-*/
-
-/*
- * FSDisplayInit
- * Full screen specific initialization called from InitOutput.
- */
-static void FSDisplayInit(void)
-{
- static unsigned long generation = 0;
- CGDisplayCount quartzDisplayCount = 0;
-
- ErrorF("Display mode: Full screen Quartz -- Direct Display\n");
-
- // Allocate private storage for each screen's mode specific info
- if (generation != serverGeneration) {
- fsScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- // Find all the CoreGraphics displays
- CGGetActiveDisplayList(0, NULL, &quartzDisplayCount);
- quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID));
- CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList,
- &quartzDisplayCount);
-
- darwinScreensFound = quartzDisplayCount;
- atexit(FSRelease);
-}
-
-
-/*
- * FSFindDisplayMode
- * Find the appropriate display mode to use in full screen mode.
- * If display mode is not the same as the current Aqua mode, switch
- * to the new mode.
- */
-static Bool FSFindDisplayMode(
- FSScreenPtr fsDisplayInfo)
-{
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
- size_t height, width, bpp;
- boolean_t exactMatch;
-
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
-
- // If no user options, use current display mode
- if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 &&
- darwinDesiredRefresh == -1)
- {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return TRUE;
- }
-
- // If the user has no choice for size, use current
- if (darwinDesiredWidth == 0) {
- width = CGDisplayPixelsWide(cgID);
- height = CGDisplayPixelsHigh(cgID);
- } else {
- width = darwinDesiredWidth;
- height = darwinDesiredHeight;
- }
-
- switch (darwinDesiredDepth) {
- case 0:
- bpp = 8;
- break;
- case 1:
- bpp = 16;
- break;
- case 2:
- bpp = 32;
- break;
- default:
- bpp = CGDisplayBitsPerPixel(cgID);
- }
-
- if (darwinDesiredRefresh == -1) {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParameters(cgID, bpp, width, height,
- &exactMatch);
- } else {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp,
- width, height, darwinDesiredRefresh, &exactMatch);
- }
- if (!exactMatch) {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return FALSE;
- }
-
- // Switch to the new display mode
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- return TRUE;
-}
-
-
-/*
- * FSAddScreen
- * Do initialization of each screen for Quartz in full screen mode.
- */
-static Bool FSAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGDirectDisplayID cgID = quartzDisplayList[index];
- CGRect bounds;
- FSScreenPtr fsDisplayInfo;
-
- // Allocate space for private per screen fullscreen specific storage.
- fsDisplayInfo = xalloc(sizeof(FSScreenRec));
- FULLSCREEN_PRIV(pScreen) = fsDisplayInfo;
-
- displayInfo->displayCount = 1;
- displayInfo->displayIDs = xrealloc(displayInfo->displayIDs,
- 1 * sizeof(CGDirectDisplayID));
- displayInfo->displayIDs[0] = cgID;
-
- fsDisplayInfo->displayID = cgID;
- fsDisplayInfo->xDisplayMode = 0;
- fsDisplayInfo->aquaDisplayMode = 0;
- fsDisplayInfo->xPalette = 0;
- fsDisplayInfo->aquaPalette = 0;
-
- // Capture full screen because X doesn't like read-only framebuffer.
- // We need to do this before we (potentially) switch the display mode.
- CGDisplayCapture(cgID);
-
- if (! FSFindDisplayMode(fsDisplayInfo)) {
- ErrorF("Could not support specified display mode on screen %i.\n",
- index);
- xfree(fsDisplayInfo);
- return FALSE;
- }
-
- // Don't need to flip y-coordinate as CoreGraphics treats (0, 0)
- // as the top left of main screen.
- bounds = CGDisplayBounds(cgID);
- dfb->x = bounds.origin.x;
- dfb->y = bounds.origin.y;
- dfb->width = bounds.size.width;
- dfb->height = bounds.size.height;
- dfb->pitch = CGDisplayBytesPerRow(cgID);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID);
-
- if (dfb->bitsPerPixel == 8) {
- if (CGDisplayCanSetPalette(cgID)) {
- dfb->colorType = PseudoColor;
- } else {
- dfb->colorType = StaticColor;
- }
- dfb->bitsPerComponent = 8;
- dfb->colorBitsPerPixel = 8;
- } else {
- dfb->colorType = TrueColor;
- dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID);
- dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) *
- dfb->bitsPerComponent;
- }
-
- fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID);
-
- // allocate shadow framebuffer
- fsDisplayInfo->shadowPtr = xalloc(dfb->pitch * dfb->height);
- dfb->framebuffer = fsDisplayInfo->shadowPtr;
-
- return TRUE;
-}
-
-
-/*
- * FSShadowUpdate
- * Update the damaged regions of the shadow framebuffer on the display.
- */
-static void FSShadowUpdate(
- ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- RegionPtr damage = &pBuf->damage;
- int numBox = REGION_NUM_RECTS(damage);
- BoxPtr pBox = REGION_RECTS(damage);
- int pitch = dfb->pitch;
- int bpp = dfb->bitsPerPixel/8;
-
-ErrorF("FSShadowUpdate: %i\n", quartzServerVisible);
-
- // Don't update if the X server is not visible
- if (!quartzServerVisible)
- return;
-
- // Loop through all the damaged boxes
- while (numBox--) {
- int width, height, offset;
- unsigned char *src, *dst;
-
- width = (pBox->x2 - pBox->x1) * bpp;
- height = pBox->y2 - pBox->y1;
- offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
- src = fsDisplayInfo->shadowPtr + offset;
- dst = fsDisplayInfo->framebuffer + offset;
-
- while (height--) {
- memcpy(dst, src, width);
- dst += pitch;
- src += pitch;
- }
-
- // Get the next box
- pBox++;
- }
-}
-
-
-/*
- * FSSetupScreen
- * Finalize full screen specific setup of each screen.
- */
-static Bool FSSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
-ErrorF("FSSetupScreen\n");
- // Initialize shadow framebuffer support
- if (! shadowInit(pScreen, FSShadowUpdate, NULL)) {
- ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
- index);
- return FALSE;
- }
-
- if (dfb->colorType == PseudoColor) {
- // Initialize colormap handling
- size_t aquaBpp;
-
- // If Aqua is using 8 bits we need to keep track of its pallete.
- CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode,
- kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp);
- if (aquaBpp <= 8)
- fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID);
-
- pScreen->CreateColormap = FSCreateColormap;
- pScreen->DestroyColormap = FSDestroyColormap;
- pScreen->InstallColormap = FSInstallColormap;
- pScreen->StoreColors = FSStoreColors;
-
- }
-
- quartzScreens[quartzNumScreens++] = fsDisplayInfo;
- return TRUE;
-}
-
-
-/*
- * Quartz display mode function list.
- */
-static QuartzModeProcsRec fsModeProcs = {
- FSDisplayInit,
- FSAddScreen,
- FSSetupScreen,
- NULL, // Not needed
- QuartzInitCursor,
- QuartzReallySetCursor,
- FSSuspendScreen,
- FSResumeScreen,
- FSCapture,
- FSRelease,
- NULL, // No rootless code in fullscreen
- NULL,
- NULL,
- NULL, // No support for DRI surfaces
- NULL
-};
-
-
-/*
- * QuartzModeBundleInit
- * Initialize the display mode bundle after loading.
- */
-Bool
-QuartzModeBundleInit(void)
-{
- quartzProcs = &fsModeProcs;
- quartzOpenGLBundle = NULL; // Only Mesa support for now
- return TRUE;
-}
diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.c b/hw/darwin/quartz/fullscreen/quartzCursor.c
deleted file mode 100644
index 72ad5ed8e..000000000
--- a/hw/darwin/quartz/fullscreen/quartzCursor.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/**************************************************************
- *
- * Support for using the Quartz Window Manager cursor
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartzCursor.h"
-#include "darwin.h"
-
-#include <pthread.h>
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "globals.h"
-
-// Size of the QuickDraw cursor
-#define CURSORWIDTH 16
-#define CURSORHEIGHT 16
-
-typedef struct {
- int qdCursorMode;
- int qdCursorVisible;
- int useQDCursor;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
-} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-static CursorPtr quartzLatentCursor = NULL;
-static QD_Cursor gQDArrow; // QuickDraw arrow cursor
-
-// Cursor for the main thread to set (NULL = arrow cursor).
-static CCrsrHandle currentCursor = NULL;
-static pthread_mutex_t cursorMutex;
-static pthread_cond_t cursorCondition;
-
-#define CURSOR_PRIV(pScreen) \
- ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-#define HIDE_QD_CURSOR(pScreen, visible) \
- if (visible) { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = FALSE; \
- } ((void)0)
-
-#define SHOW_QD_CURSOR(pScreen, visible) \
- { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = TRUE; \
- } ((void)0)
-
-#define CHANGE_QD_CURSOR(cursorH) \
- if (!quartzServerQuitting) { \
- /* Acquire lock and tell the main thread to change cursor */ \
- pthread_mutex_lock(&cursorMutex); \
- currentCursor = (CCrsrHandle) (cursorH); \
- QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
- \
- /* Wait for the main thread to change the cursor */ \
- pthread_cond_wait(&cursorCondition, &cursorMutex); \
- pthread_mutex_unlock(&cursorMutex); \
- } ((void)0)
-
-
-/*
- * MakeQDCursor helpers: CTAB_ENTER, interleave
- */
-
-// Add a color entry to a ctab
-#define CTAB_ENTER(ctab, index, r, g, b) \
- ctab->ctTable[index].value = index; \
- ctab->ctTable[index].rgb.red = r; \
- ctab->ctTable[index].rgb.green = g; \
- ctab->ctTable[index].rgb.blue = b
-
-// Make an unsigned short by interleaving the bits of bytes c1 and c2.
-// High bit of c1 is first; low bit of c2 is last.
-// Interleave is a built-in INTERCAL operator.
-static unsigned short
-interleave(
- unsigned char c1,
- unsigned char c2 )
-{
- return
- ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) |
- ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) |
- ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) |
- ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) |
- ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) |
- ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) |
- ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) |
- ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ;
-}
-
-/*
- * MakeQDCursor
- * Make a QuickDraw color cursor from the given X11 cursor.
- * Warning: This code is nasty. Color cursors were meant to be read
- * from resources; constructing the structures programmatically is messy.
- */
-/*
- QuickDraw cursor representation:
- Our color cursor is a 2 bit per pixel pixmap.
- Each pixel's bits are (source<<1 | mask) from the original X cursor pixel.
- The cursor's color table maps the colors like this:
- (2-bit value | X result | colortable | Mac result)
- 00 | transparent | white | transparent (white outside mask)
- 01 | back color | back color | back color
- 10 | undefined | black | invert background (just for fun)
- 11 | fore color | fore color | fore color
-*/
-static CCrsrHandle
-MakeQDCursor(
- CursorPtr pCursor )
-{
- CCrsrHandle result;
- CCrsrPtr curs;
- int i, w, h;
- unsigned short rowMask;
- PixMap *pix;
- ColorTable *ctab;
- unsigned short *image;
-
- result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr));
- if (!result) return NULL;
- HLock((Handle)result);
- curs = *result;
-
- // Initialize CCrsr
- curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color
- curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap));
- if (!curs->crsrMap) goto pixAllocFailed;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- curs->crsrData = NULL; // raw cursor image data (set below)
- curs->crsrXData = NULL; // QD's processed data
- curs->crsrXValid = 0; // zero means QD must re-process cursor data
- curs->crsrXHandle = NULL; // reserved
- memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data
- memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask
- curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot
- curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot
- curs->crsrXTable = 0; // reserved
- curs->crsrID = GetCTSeed(); // unique ID from Color Manager
-
- // Set the b&w data and mask
- w = min(pCursor->bits->width, CURSORWIDTH);
- h = min(pCursor->bits->height, CURSORHEIGHT);
- rowMask = ~((1 << (CURSORWIDTH - w)) - 1);
- for (i = 0; i < h; i++) {
- curs->crsr1Data[i] = rowMask &
- ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]);
- curs->crsrMask[i] = rowMask &
- ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]);
- }
-
- // Set the color data and mask
- // crsrMap: defines bit depth and size and colortable only
- pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap
- SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020
- pix->pixelSize = 2;
- pix->cmpCount = 1;
- pix->cmpSize = 2;
- // pix->pmTable set below
-
- // crsrData is the pixel data. crsrMap's baseAddr is not used.
- curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8);
- if (!curs->crsrData) goto imageAllocFailed;
- HLock((Handle)curs->crsrData);
- image = (unsigned short *) *curs->crsrData;
- // Pixel data is just 1-bit data and mask interleaved (see above)
- for (i = 0; i < h; i++) {
- unsigned char s, m;
- s = pCursor->bits->source[i*4] & (rowMask >> 8);
- m = pCursor->bits->mask[i*4] & (rowMask >> 8);
- image[2*i] = interleave(s, m);
- s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff);
- m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff);
- image[2*i+1] = interleave(s, m);
- }
-
- // Build the color table (entries described above)
- // NewPixMap allocates a color table handle.
- pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3
- * sizeof(ColorSpec));
- if (!pix->pmTable) goto ctabAllocFailed;
- HLock((Handle)pix->pmTable);
- ctab = *pix->pmTable;
- ctab->ctSeed = GetCTSeed();
- ctab->ctFlags = 0;
- ctab->ctSize = 3; // color count - 1
- CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff);
- CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue);
- CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000);
- CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue);
-
- HUnlock((Handle)pix->pmTable); // ctab
- HUnlock((Handle)curs->crsrData); // image data
- HUnlock((Handle)curs->crsrMap); // pix
- HUnlock((Handle)result); // cursor
-
- return result;
-
- // "What we have here is a failure to allocate"
-ctabAllocFailed:
- HUnlock((Handle)curs->crsrData);
- DisposeHandle((Handle)curs->crsrData);
-imageAllocFailed:
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
-pixAllocFailed:
- HUnlock((Handle)result);
- DisposeHandle((Handle)result);
- return NULL;
-}
-
-
-/*
- * FreeQDCursor
- * Destroy a QuickDraw color cursor created with MakeQDCursor().
- * The cursor must not currently be on screen.
- */
-static void FreeQDCursor(CCrsrHandle cursHandle)
-{
- CCrsrPtr curs;
- PixMap *pix;
-
- HLock((Handle)cursHandle);
- curs = *cursHandle;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- DisposeHandle((Handle)pix->pmTable);
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrData);
- HUnlock((Handle)cursHandle);
- DisposeHandle((Handle)cursHandle);
-}
-
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- * QuartzRealizeCursor
- * Convert the X cursor representation to QuickDraw format if possible.
- */
-Bool
-QuartzRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- CCrsrHandle qdCursor;
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if(!pCursor || !pCursor->bits)
- return FALSE;
-
- // if the cursor is too big we use a software cursor
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- // rootless can't use a software cursor
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->RealizeCursor)
- (pScreen, pCursor);
- }
- }
-
- // make new cursor image
- qdCursor = MakeQDCursor(pCursor);
- if (!qdCursor) return FALSE;
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor;
-
- return TRUE;
-}
-
-
-/*
- * QuartzUnrealizeCursor
- * Free the storage space associated with a realized cursor.
- */
-Bool
-QuartzUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->UnrealizeCursor)
- (pScreen, pCursor);
- }
- } else {
- CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
-
- if (currentCursor != oldCursor) {
- // This should only fail when quitting, in which case we just leak.
- FreeQDCursor(oldCursor);
- }
- pCursor->devPriv[pScreen->myNum] = NULL;
- return TRUE;
- }
-}
-
-
-/*
- * QuartzSetCursor
- * Set the cursor sprite and position.
- * Use QuickDraw cursor if possible.
- */
-static void
-QuartzSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- quartzLatentCursor = pCursor;
-
- // Don't touch Mac OS cursor if X is hidden!
- if (!quartzServerVisible)
- return;
-
- if (!pCursor) {
- // Remove the cursor completely.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- if (! ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- }
- else if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor)
- {
- // Cursor is small enough to use QuickDraw directly.
- if (! ScreenPriv->qdCursorMode) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->qdCursorMode = TRUE;
-
- CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else if (quartzRootless) {
- // Rootless can't use a software cursor, so we just use Mac OS arrow.
- CHANGE_QD_CURSOR(NULL);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else {
- // Cursor is too big for QuickDraw. Use X software cursor.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- ScreenPriv->qdCursorMode = FALSE;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
- }
-}
-
-
-/*
- * QuartzReallySetCursor
- * Set the QuickDraw cursor. Called from the main thread since changing the
- * cursor with QuickDraw is not thread safe on dual processor machines.
- */
-void
-QuartzReallySetCursor()
-{
- pthread_mutex_lock(&cursorMutex);
-
- if (currentCursor) {
- SetCCursor(currentCursor);
- } else {
- SetCursor(&gQDArrow);
- }
-
- pthread_cond_signal(&cursorCondition);
- pthread_mutex_unlock(&cursorMutex);
-}
-
-
-/*
- * QuartzMoveCursor
- * Move the cursor. This is a noop for QuickDraw.
- */
-static void
-QuartzMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
- QuartzRealizeCursor,
- QuartzUnrealizeCursor,
- QuartzSetCursor,
- QuartzMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorOffScreen
- */
-static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-
-/*
- * QuartzCrossScreen
- */
-static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
-{
- return;
-}
-
-
-/*
- * QuartzWarpCursor
- * Change the cursor position without generating an event or motion history.
- * The input coordinates (x,y) are in pScreen-local X11 coordinates.
- *
- */
-static void
-QuartzWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- static int neverMoved = TRUE;
-
- if (neverMoved) {
- // Don't move the cursor the first time. This is the jump-to-center
- // initialization, and it's annoying because we may still be in MacOS.
- neverMoved = FALSE;
- return;
- }
-
- if (quartzServerVisible) {
- CGDisplayErr cgErr;
- CGPoint cgPoint;
- // Only need to do this for one display. Any display will do.
- CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0];
- CGRect cgRect = CGDisplayBounds(cgID);
-
- // Convert (x,y) to CoreGraphics screen-local CG coordinates.
- // This is necessary because the X11 screen and CG screen may not
- // coincide. (e.g. X11 screen may be moved to dodge the menu bar)
-
- // Make point in X11 global coordinates
- cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x,
- y + dixScreenOrigins[pScreen->myNum].y);
- // Shift to CoreGraphics global screen coordinates
- cgPoint.x += darwinMainScreenX;
- cgPoint.y += darwinMainScreenY;
- // Shift to CoreGraphics screen-local coordinates
- cgPoint.x -= cgRect.origin.x;
- cgPoint.y -= cgRect.origin.y;
-
- cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint);
- if (cgErr != CGDisplayNoErr) {
- ErrorF("Could not set cursor position with error code 0x%x.\n",
- cgErr);
- }
- }
-
- miPointerWarpCursor(pScreen, x, y);
- miPointerUpdate();
-}
-
-
-static miPointerScreenFuncRec quartzScreenFuncsRec = {
- QuartzCursorOffScreen,
- QuartzCrossScreen,
- QuartzWarpCursor,
- DarwinEQPointerPost,
- DarwinEQSwitchScreen
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-QuartzCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else {
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
- }
-}
-
-
-/*
- * QuartzInitCursor
- * Initialize cursor support
- */
-Bool
-QuartzInitCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's QuickDraw cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- CURSOR_PRIV(pScreen) = ScreenPriv;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = QuartzCursorQueryBestSize;
-
- // initialize QuickDraw cursor handling
- GetQDGlobalsArrow(&gQDArrow);
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
-
- if (!quartzRootless)
- ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel);
- else
- ScreenPriv->useQDCursor = TRUE;
- ScreenPriv->qdCursorMode = TRUE;
- ScreenPriv->qdCursorVisible = TRUE;
-
- // initialize cursor mutex lock
- pthread_mutex_init(&cursorMutex, NULL);
-
- // initialize condition for waiting
- pthread_cond_init(&cursorCondition, NULL);
-
- return TRUE;
-}
-
-
-// X server is hiding. Restore the Aqua cursor.
-void QuartzSuspendXCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- CHANGE_QD_CURSOR(NULL);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
-}
-
-
-// X server is showing. Restore the X cursor.
-void QuartzResumeXCursor(
- ScreenPtr pScreen,
- int x,
- int y )
-{
- QuartzSetCursor(pScreen, quartzLatentCursor, x, y);
-}
diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.h b/hw/darwin/quartz/fullscreen/quartzCursor.h
deleted file mode 100644
index d822c3e86..000000000
--- a/hw/darwin/quartz/fullscreen/quartzCursor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * quartzCursor.h
- *
- * External interface for Quartz hardware cursor
- */
-/*
- * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/quartzCursor.h,v 1.1 2003/09/16 00:36:15 torrey Exp $ */
-
-#ifndef QUARTZCURSOR_H
-#define QUARTZCURSOR_H
-
-#include "screenint.h"
-
-Bool QuartzInitCursor(ScreenPtr pScreen);
-void QuartzReallySetCursor(void);
-void QuartzSuspendXCursor(ScreenPtr pScreen);
-void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
-
-#endif
diff --git a/hw/darwin/quartz/keysym2ucs.c b/hw/darwin/quartz/keysym2ucs.c
deleted file mode 100644
index 420830965..000000000
--- a/hw/darwin/quartz/keysym2ucs.c
+++ /dev/null
@@ -1,909 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c,v 1.1 2003/11/01 08:13:08 torrey Exp $
- *
- * This module converts keysym values into the corresponding ISO 10646
- * (UCS, Unicode) values.
- *
- * The array keysymtab[] contains pairs of X11 keysym values for graphical
- * characters and the corresponding Unicode value. The function
- * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
- * therefore keysymtab[] must remain SORTED by keysym value.
- *
- * The keysym -> UTF-8 conversion will hopefully one day be provided
- * by Xlib via XmbLookupString() and should ideally not have to be
- * done in X applications. But we are not there yet.
- *
- * We allow to represent any UCS character in the range U-00000000 to
- * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
- * This admittedly does not cover the entire 31-bit space of UCS, but
- * it does cover all of the characters up to U-10FFFF, which can be
- * represented by UTF-16, and more, and it is very unlikely that higher
- * UCS codes will ever be assigned by ISO. So to get Unicode character
- * U+ABCD you can directly use keysym 0x0100abcd.
- *
- * NOTE: The comments in the table below contain the actual character
- * encoded in UTF-8, so for viewing and editing best use an editor in
- * UTF-8 mode.
- *
- * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
- *
- * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
- * an initial draft of the mapping table.
- *
- * This software is in the public domain. Share and enjoy!
- *
- * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
- */
-
-#include "keysym2ucs.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-struct codepair {
- unsigned short keysym;
- unsigned short ucs;
-};
-
-const static struct codepair keysymtab[] = {
- { 0x01a1, 0x0104 },
- { 0x01a2, 0x02d8 },
- { 0x01a3, 0x0141 },
- { 0x01a5, 0x013d },
- { 0x01a6, 0x015a },
- { 0x01a9, 0x0160 },
- { 0x01aa, 0x015e },
- { 0x01ab, 0x0164 },
- { 0x01ac, 0x0179 },
- { 0x01ae, 0x017d },
- { 0x01af, 0x017b },
- { 0x01b1, 0x0105 },
- { 0x01b2, 0x02db },
- { 0x01b3, 0x0142 },
- { 0x01b5, 0x013e },
- { 0x01b6, 0x015b },
- { 0x01b7, 0x02c7 },
- { 0x01b9, 0x0161 },
- { 0x01ba, 0x015f },
- { 0x01bb, 0x0165 },
- { 0x01bc, 0x017a },
- { 0x01bd, 0x02dd },
- { 0x01be, 0x017e },
- { 0x01bf, 0x017c },
- { 0x01c0, 0x0154 },
- { 0x01c3, 0x0102 },
- { 0x01c5, 0x0139 },
- { 0x01c6, 0x0106 },
- { 0x01c8, 0x010c },
- { 0x01ca, 0x0118 },
- { 0x01cc, 0x011a },
- { 0x01cf, 0x010e },
- { 0x01d0, 0x0110 },
- { 0x01d1, 0x0143 },
- { 0x01d2, 0x0147 },
- { 0x01d5, 0x0150 },
- { 0x01d8, 0x0158 },
- { 0x01d9, 0x016e },
- { 0x01db, 0x0170 },
- { 0x01de, 0x0162 },
- { 0x01e0, 0x0155 },
- { 0x01e3, 0x0103 },
- { 0x01e5, 0x013a },
- { 0x01e6, 0x0107 },
- { 0x01e8, 0x010d },
- { 0x01ea, 0x0119 },
- { 0x01ec, 0x011b },
- { 0x01ef, 0x010f },
- { 0x01f0, 0x0111 },
- { 0x01f1, 0x0144 },
- { 0x01f2, 0x0148 },
- { 0x01f5, 0x0151 },
- { 0x01f8, 0x0159 },
- { 0x01f9, 0x016f },
- { 0x01fb, 0x0171 },
- { 0x01fe, 0x0163 },
- { 0x01ff, 0x02d9 },
- { 0x02a1, 0x0126 },
- { 0x02a6, 0x0124 },
- { 0x02a9, 0x0130 },
- { 0x02ab, 0x011e },
- { 0x02ac, 0x0134 },
- { 0x02b1, 0x0127 },
- { 0x02b6, 0x0125 },
- { 0x02b9, 0x0131 },
- { 0x02bb, 0x011f },
- { 0x02bc, 0x0135 },
- { 0x02c5, 0x010a },
- { 0x02c6, 0x0108 },
- { 0x02d5, 0x0120 },
- { 0x02d8, 0x011c },
- { 0x02dd, 0x016c },
- { 0x02de, 0x015c },
- { 0x02e5, 0x010b },
- { 0x02e6, 0x0109 },
- { 0x02f5, 0x0121 },
- { 0x02f8, 0x011d },
- { 0x02fd, 0x016d },
- { 0x02fe, 0x015d },
- { 0x03a2, 0x0138 },
- { 0x03a3, 0x0156 },
- { 0x03a5, 0x0128 },
- { 0x03a6, 0x013b },
- { 0x03aa, 0x0112 },
- { 0x03ab, 0x0122 },
- { 0x03ac, 0x0166 },
- { 0x03b3, 0x0157 },
- { 0x03b5, 0x0129 },
- { 0x03b6, 0x013c },
- { 0x03ba, 0x0113 },
- { 0x03bb, 0x0123 },
- { 0x03bc, 0x0167 },
- { 0x03bd, 0x014a },
- { 0x03bf, 0x014b },
- { 0x03c0, 0x0100 },
- { 0x03c7, 0x012e },
- { 0x03cc, 0x0116 },
- { 0x03cf, 0x012a },
- { 0x03d1, 0x0145 },
- { 0x03d2, 0x014c },
- { 0x03d3, 0x0136 },
- { 0x03d9, 0x0172 },
- { 0x03dd, 0x0168 },
- { 0x03de, 0x016a },
- { 0x03e0, 0x0101 },
- { 0x03e7, 0x012f },
- { 0x03ec, 0x0117 },
- { 0x03ef, 0x012b },
- { 0x03f1, 0x0146 },
- { 0x03f2, 0x014d },
- { 0x03f3, 0x0137 },
- { 0x03f9, 0x0173 },
- { 0x03fd, 0x0169 },
- { 0x03fe, 0x016b },
- { 0x047e, 0x203e },
- { 0x04a1, 0x3002 },
- { 0x04a2, 0x300c },
- { 0x04a3, 0x300d },
- { 0x04a4, 0x3001 },
- { 0x04a5, 0x30fb },
- { 0x04a6, 0x30f2 },
- { 0x04a7, 0x30a1 },
- { 0x04a8, 0x30a3 },
- { 0x04a9, 0x30a5 },
- { 0x04aa, 0x30a7 },
- { 0x04ab, 0x30a9 },
- { 0x04ac, 0x30e3 },
- { 0x04ad, 0x30e5 },
- { 0x04ae, 0x30e7 },
- { 0x04af, 0x30c3 },
- { 0x04b0, 0x30fc },
- { 0x04b1, 0x30a2 },
- { 0x04b2, 0x30a4 },
- { 0x04b3, 0x30a6 },
- { 0x04b4, 0x30a8 },
- { 0x04b5, 0x30aa },
- { 0x04b6, 0x30ab },
- { 0x04b7, 0x30ad },
- { 0x04b8, 0x30af },
- { 0x04b9, 0x30b1 },
- { 0x04ba, 0x30b3 },
- { 0x04bb, 0x30b5 },
- { 0x04bc, 0x30b7 },
- { 0x04bd, 0x30b9 },
- { 0x04be, 0x30bb },
- { 0x04bf, 0x30bd },
- { 0x04c0, 0x30bf },
- { 0x04c1, 0x30c1 },
- { 0x04c2, 0x30c4 },
- { 0x04c3, 0x30c6 },
- { 0x04c4, 0x30c8 },
- { 0x04c5, 0x30ca },
- { 0x04c6, 0x30cb },
- { 0x04c7, 0x30cc },
- { 0x04c8, 0x30cd },
- { 0x04c9, 0x30ce },
- { 0x04ca, 0x30cf },
- { 0x04cb, 0x30d2 },
- { 0x04cc, 0x30d5 },
- { 0x04cd, 0x30d8 },
- { 0x04ce, 0x30db },
- { 0x04cf, 0x30de },
- { 0x04d0, 0x30df },
- { 0x04d1, 0x30e0 },
- { 0x04d2, 0x30e1 },
- { 0x04d3, 0x30e2 },
- { 0x04d4, 0x30e4 },
- { 0x04d5, 0x30e6 },
- { 0x04d6, 0x30e8 },
- { 0x04d7, 0x30e9 },
- { 0x04d8, 0x30ea },
- { 0x04d9, 0x30eb },
- { 0x04da, 0x30ec },
- { 0x04db, 0x30ed },
- { 0x04dc, 0x30ef },
- { 0x04dd, 0x30f3 },
- { 0x04de, 0x309b },
- { 0x04df, 0x309c },
- { 0x05ac, 0x060c },
- { 0x05bb, 0x061b },
- { 0x05bf, 0x061f },
- { 0x05c1, 0x0621 },
- { 0x05c2, 0x0622 },
- { 0x05c3, 0x0623 },
- { 0x05c4, 0x0624 },
- { 0x05c5, 0x0625 },
- { 0x05c6, 0x0626 },
- { 0x05c7, 0x0627 },
- { 0x05c8, 0x0628 },
- { 0x05c9, 0x0629 },
- { 0x05ca, 0x062a },
- { 0x05cb, 0x062b },
- { 0x05cc, 0x062c },
- { 0x05cd, 0x062d },
- { 0x05ce, 0x062e },
- { 0x05cf, 0x062f },
- { 0x05d0, 0x0630 },
- { 0x05d1, 0x0631 },
- { 0x05d2, 0x0632 },
- { 0x05d3, 0x0633 },
- { 0x05d4, 0x0634 },
- { 0x05d5, 0x0635 },
- { 0x05d6, 0x0636 },
- { 0x05d7, 0x0637 },
- { 0x05d8, 0x0638 },
- { 0x05d9, 0x0639 },
- { 0x05da, 0x063a },
- { 0x05e0, 0x0640 },
- { 0x05e1, 0x0641 },
- { 0x05e2, 0x0642 },
- { 0x05e3, 0x0643 },
- { 0x05e4, 0x0644 },
- { 0x05e5, 0x0645 },
- { 0x05e6, 0x0646 },
- { 0x05e7, 0x0647 },
- { 0x05e8, 0x0648 },
- { 0x05e9, 0x0649 },
- { 0x05ea, 0x064a },
- { 0x05eb, 0x064b },
- { 0x05ec, 0x064c },
- { 0x05ed, 0x064d },
- { 0x05ee, 0x064e },
- { 0x05ef, 0x064f },
- { 0x05f0, 0x0650 },
- { 0x05f1, 0x0651 },
- { 0x05f2, 0x0652 },
- { 0x06a1, 0x0452 },
- { 0x06a2, 0x0453 },
- { 0x06a3, 0x0451 },
- { 0x06a4, 0x0454 },
- { 0x06a5, 0x0455 },
- { 0x06a6, 0x0456 },
- { 0x06a7, 0x0457 },
- { 0x06a8, 0x0458 },
- { 0x06a9, 0x0459 },
- { 0x06aa, 0x045a },
- { 0x06ab, 0x045b },
- { 0x06ac, 0x045c },
- { 0x06ae, 0x045e },
- { 0x06af, 0x045f },
- { 0x06b0, 0x2116 },
- { 0x06b1, 0x0402 },
- { 0x06b2, 0x0403 },
- { 0x06b3, 0x0401 },
- { 0x06b4, 0x0404 },
- { 0x06b5, 0x0405 },
- { 0x06b6, 0x0406 },
- { 0x06b7, 0x0407 },
- { 0x06b8, 0x0408 },
- { 0x06b9, 0x0409 },
- { 0x06ba, 0x040a },
- { 0x06bb, 0x040b },
- { 0x06bc, 0x040c },
- { 0x06be, 0x040e },
- { 0x06bf, 0x040f },
- { 0x06c0, 0x044e },
- { 0x06c1, 0x0430 },
- { 0x06c2, 0x0431 },
- { 0x06c3, 0x0446 },
- { 0x06c4, 0x0434 },
- { 0x06c5, 0x0435 },
- { 0x06c6, 0x0444 },
- { 0x06c7, 0x0433 },
- { 0x06c8, 0x0445 },
- { 0x06c9, 0x0438 },
- { 0x06ca, 0x0439 },
- { 0x06cb, 0x043a },
- { 0x06cc, 0x043b },
- { 0x06cd, 0x043c },
- { 0x06ce, 0x043d },
- { 0x06cf, 0x043e },
- { 0x06d0, 0x043f },
- { 0x06d1, 0x044f },
- { 0x06d2, 0x0440 },
- { 0x06d3, 0x0441 },
- { 0x06d4, 0x0442 },
- { 0x06d5, 0x0443 },
- { 0x06d6, 0x0436 },
- { 0x06d7, 0x0432 },
- { 0x06d8, 0x044c },
- { 0x06d9, 0x044b },
- { 0x06da, 0x0437 },
- { 0x06db, 0x0448 },
- { 0x06dc, 0x044d },
- { 0x06dd, 0x0449 },
- { 0x06de, 0x0447 },
- { 0x06df, 0x044a },
- { 0x06e0, 0x042e },
- { 0x06e1, 0x0410 },
- { 0x06e2, 0x0411 },
- { 0x06e3, 0x0426 },
- { 0x06e4, 0x0414 },
- { 0x06e5, 0x0415 },
- { 0x06e6, 0x0424 },
- { 0x06e7, 0x0413 },
- { 0x06e8, 0x0425 },
- { 0x06e9, 0x0418 },
- { 0x06ea, 0x0419 },
- { 0x06eb, 0x041a },
- { 0x06ec, 0x041b },
- { 0x06ed, 0x041c },
- { 0x06ee, 0x041d },
- { 0x06ef, 0x041e },
- { 0x06f0, 0x041f },
- { 0x06f1, 0x042f },
- { 0x06f2, 0x0420 },
- { 0x06f3, 0x0421 },
- { 0x06f4, 0x0422 },
- { 0x06f5, 0x0423 },
- { 0x06f6, 0x0416 },
- { 0x06f7, 0x0412 },
- { 0x06f8, 0x042c },
- { 0x06f9, 0x042b },
- { 0x06fa, 0x0417 },
- { 0x06fb, 0x0428 },
- { 0x06fc, 0x042d },
- { 0x06fd, 0x0429 },
- { 0x06fe, 0x0427 },
- { 0x06ff, 0x042a },
- { 0x07a1, 0x0386 },
- { 0x07a2, 0x0388 },
- { 0x07a3, 0x0389 },
- { 0x07a4, 0x038a },
- { 0x07a5, 0x03aa },
- { 0x07a7, 0x038c },
- { 0x07a8, 0x038e },
- { 0x07a9, 0x03ab },
- { 0x07ab, 0x038f },
- { 0x07ae, 0x0385 },
- { 0x07af, 0x2015 },
- { 0x07b1, 0x03ac },
- { 0x07b2, 0x03ad },
- { 0x07b3, 0x03ae },
- { 0x07b4, 0x03af },
- { 0x07b5, 0x03ca },
- { 0x07b6, 0x0390 },
- { 0x07b7, 0x03cc },
- { 0x07b8, 0x03cd },
- { 0x07b9, 0x03cb },
- { 0x07ba, 0x03b0 },
- { 0x07bb, 0x03ce },
- { 0x07c1, 0x0391 },
- { 0x07c2, 0x0392 },
- { 0x07c3, 0x0393 },
- { 0x07c4, 0x0394 },
- { 0x07c5, 0x0395 },
- { 0x07c6, 0x0396 },
- { 0x07c7, 0x0397 },
- { 0x07c8, 0x0398 },
- { 0x07c9, 0x0399 },
- { 0x07ca, 0x039a },
- { 0x07cb, 0x039b },
- { 0x07cc, 0x039c },
- { 0x07cd, 0x039d },
- { 0x07ce, 0x039e },
- { 0x07cf, 0x039f },
- { 0x07d0, 0x03a0 },
- { 0x07d1, 0x03a1 },
- { 0x07d2, 0x03a3 },
- { 0x07d4, 0x03a4 },
- { 0x07d5, 0x03a5 },
- { 0x07d6, 0x03a6 },
- { 0x07d7, 0x03a7 },
- { 0x07d8, 0x03a8 },
- { 0x07d9, 0x03a9 },
- { 0x07e1, 0x03b1 },
- { 0x07e2, 0x03b2 },
- { 0x07e3, 0x03b3 },
- { 0x07e4, 0x03b4 },
- { 0x07e5, 0x03b5 },
- { 0x07e6, 0x03b6 },
- { 0x07e7, 0x03b7 },
- { 0x07e8, 0x03b8 },
- { 0x07e9, 0x03b9 },
- { 0x07ea, 0x03ba },
- { 0x07eb, 0x03bb },
- { 0x07ec, 0x03bc },
- { 0x07ed, 0x03bd },
- { 0x07ee, 0x03be },
- { 0x07ef, 0x03bf },
- { 0x07f0, 0x03c0 },
- { 0x07f1, 0x03c1 },
- { 0x07f2, 0x03c3 },
- { 0x07f3, 0x03c2 },
- { 0x07f4, 0x03c4 },
- { 0x07f5, 0x03c5 },
- { 0x07f6, 0x03c6 },
- { 0x07f7, 0x03c7 },
- { 0x07f8, 0x03c8 },
- { 0x07f9, 0x03c9 },
- { 0x08a1, 0x23b7 },
- { 0x08a2, 0x250c },
- { 0x08a3, 0x2500 },
- { 0x08a4, 0x2320 },
- { 0x08a5, 0x2321 },
- { 0x08a6, 0x2502 },
- { 0x08a7, 0x23a1 },
- { 0x08a8, 0x23a3 },
- { 0x08a9, 0x23a4 },
- { 0x08aa, 0x23a6 },
- { 0x08ab, 0x239b },
- { 0x08ac, 0x239d },
- { 0x08ad, 0x239e },
- { 0x08ae, 0x23a0 },
- { 0x08af, 0x23a8 },
- { 0x08b0, 0x23ac },
- { 0x08bc, 0x2264 },
- { 0x08bd, 0x2260 },
- { 0x08be, 0x2265 },
- { 0x08bf, 0x222b },
- { 0x08c0, 0x2234 },
- { 0x08c1, 0x221d },
- { 0x08c2, 0x221e },
- { 0x08c5, 0x2207 },
- { 0x08c8, 0x223c },
- { 0x08c9, 0x2243 },
- { 0x08cd, 0x21d4 },
- { 0x08ce, 0x21d2 },
- { 0x08cf, 0x2261 },
- { 0x08d6, 0x221a },
- { 0x08da, 0x2282 },
- { 0x08db, 0x2283 },
- { 0x08dc, 0x2229 },
- { 0x08dd, 0x222a },
- { 0x08de, 0x2227 },
- { 0x08df, 0x2228 },
- { 0x08ef, 0x2202 },
- { 0x08f6, 0x0192 },
- { 0x08fb, 0x2190 },
- { 0x08fc, 0x2191 },
- { 0x08fd, 0x2192 },
- { 0x08fe, 0x2193 },
- { 0x09e0, 0x25c6 },
- { 0x09e1, 0x2592 },
- { 0x09e2, 0x2409 },
- { 0x09e3, 0x240c },
- { 0x09e4, 0x240d },
- { 0x09e5, 0x240a },
- { 0x09e8, 0x2424 },
- { 0x09e9, 0x240b },
- { 0x09ea, 0x2518 },
- { 0x09eb, 0x2510 },
- { 0x09ec, 0x250c },
- { 0x09ed, 0x2514 },
- { 0x09ee, 0x253c },
- { 0x09ef, 0x23ba },
- { 0x09f0, 0x23bb },
- { 0x09f1, 0x2500 },
- { 0x09f2, 0x23bc },
- { 0x09f3, 0x23bd },
- { 0x09f4, 0x251c },
- { 0x09f5, 0x2524 },
- { 0x09f6, 0x2534 },
- { 0x09f7, 0x252c },
- { 0x09f8, 0x2502 },
- { 0x0aa1, 0x2003 },
- { 0x0aa2, 0x2002 },
- { 0x0aa3, 0x2004 },
- { 0x0aa4, 0x2005 },
- { 0x0aa5, 0x2007 },
- { 0x0aa6, 0x2008 },
- { 0x0aa7, 0x2009 },
- { 0x0aa8, 0x200a },
- { 0x0aa9, 0x2014 },
- { 0x0aaa, 0x2013 },
- { 0x0aae, 0x2026 },
- { 0x0aaf, 0x2025 },
- { 0x0ab0, 0x2153 },
- { 0x0ab1, 0x2154 },
- { 0x0ab2, 0x2155 },
- { 0x0ab3, 0x2156 },
- { 0x0ab4, 0x2157 },
- { 0x0ab5, 0x2158 },
- { 0x0ab6, 0x2159 },
- { 0x0ab7, 0x215a },
- { 0x0ab8, 0x2105 },
- { 0x0abb, 0x2012 },
- { 0x0abc, 0x2329 },
- { 0x0abe, 0x232a },
- { 0x0ac3, 0x215b },
- { 0x0ac4, 0x215c },
- { 0x0ac5, 0x215d },
- { 0x0ac6, 0x215e },
- { 0x0ac9, 0x2122 },
- { 0x0aca, 0x2613 },
- { 0x0acc, 0x25c1 },
- { 0x0acd, 0x25b7 },
- { 0x0ace, 0x25cb },
- { 0x0acf, 0x25af },
- { 0x0ad0, 0x2018 },
- { 0x0ad1, 0x2019 },
- { 0x0ad2, 0x201c },
- { 0x0ad3, 0x201d },
- { 0x0ad4, 0x211e },
- { 0x0ad6, 0x2032 },
- { 0x0ad7, 0x2033 },
- { 0x0ad9, 0x271d },
- { 0x0adb, 0x25ac },
- { 0x0adc, 0x25c0 },
- { 0x0add, 0x25b6 },
- { 0x0ade, 0x25cf },
- { 0x0adf, 0x25ae },
- { 0x0ae0, 0x25e6 },
- { 0x0ae1, 0x25ab },
- { 0x0ae2, 0x25ad },
- { 0x0ae3, 0x25b3 },
- { 0x0ae4, 0x25bd },
- { 0x0ae5, 0x2606 },
- { 0x0ae6, 0x2022 },
- { 0x0ae7, 0x25aa },
- { 0x0ae8, 0x25b2 },
- { 0x0ae9, 0x25bc },
- { 0x0aea, 0x261c },
- { 0x0aeb, 0x261e },
- { 0x0aec, 0x2663 },
- { 0x0aed, 0x2666 },
- { 0x0aee, 0x2665 },
- { 0x0af0, 0x2720 },
- { 0x0af1, 0x2020 },
- { 0x0af2, 0x2021 },
- { 0x0af3, 0x2713 },
- { 0x0af4, 0x2717 },
- { 0x0af5, 0x266f },
- { 0x0af6, 0x266d },
- { 0x0af7, 0x2642 },
- { 0x0af8, 0x2640 },
- { 0x0af9, 0x260e },
- { 0x0afa, 0x2315 },
- { 0x0afb, 0x2117 },
- { 0x0afc, 0x2038 },
- { 0x0afd, 0x201a },
- { 0x0afe, 0x201e },
- { 0x0ba3, 0x003c },
- { 0x0ba6, 0x003e },
- { 0x0ba8, 0x2228 },
- { 0x0ba9, 0x2227 },
- { 0x0bc0, 0x00af },
- { 0x0bc2, 0x22a5 },
- { 0x0bc3, 0x2229 },
- { 0x0bc4, 0x230a },
- { 0x0bc6, 0x005f },
- { 0x0bca, 0x2218 },
- { 0x0bcc, 0x2395 },
- { 0x0bce, 0x22a4 },
- { 0x0bcf, 0x25cb },
- { 0x0bd3, 0x2308 },
- { 0x0bd6, 0x222a },
- { 0x0bd8, 0x2283 },
- { 0x0bda, 0x2282 },
- { 0x0bdc, 0x22a2 },
- { 0x0bfc, 0x22a3 },
- { 0x0cdf, 0x2017 },
- { 0x0ce0, 0x05d0 },
- { 0x0ce1, 0x05d1 },
- { 0x0ce2, 0x05d2 },
- { 0x0ce3, 0x05d3 },
- { 0x0ce4, 0x05d4 },
- { 0x0ce5, 0x05d5 },
- { 0x0ce6, 0x05d6 },
- { 0x0ce7, 0x05d7 },
- { 0x0ce8, 0x05d8 },
- { 0x0ce9, 0x05d9 },
- { 0x0cea, 0x05da },
- { 0x0ceb, 0x05db },
- { 0x0cec, 0x05dc },
- { 0x0ced, 0x05dd },
- { 0x0cee, 0x05de },
- { 0x0cef, 0x05df },
- { 0x0cf0, 0x05e0 },
- { 0x0cf1, 0x05e1 },
- { 0x0cf2, 0x05e2 },
- { 0x0cf3, 0x05e3 },
- { 0x0cf4, 0x05e4 },
- { 0x0cf5, 0x05e5 },
- { 0x0cf6, 0x05e6 },
- { 0x0cf7, 0x05e7 },
- { 0x0cf8, 0x05e8 },
- { 0x0cf9, 0x05e9 },
- { 0x0cfa, 0x05ea },
- { 0x0da1, 0x0e01 },
- { 0x0da2, 0x0e02 },
- { 0x0da3, 0x0e03 },
- { 0x0da4, 0x0e04 },
- { 0x0da5, 0x0e05 },
- { 0x0da6, 0x0e06 },
- { 0x0da7, 0x0e07 },
- { 0x0da8, 0x0e08 },
- { 0x0da9, 0x0e09 },
- { 0x0daa, 0x0e0a },
- { 0x0dab, 0x0e0b },
- { 0x0dac, 0x0e0c },
- { 0x0dad, 0x0e0d },
- { 0x0dae, 0x0e0e },
- { 0x0daf, 0x0e0f },
- { 0x0db0, 0x0e10 },
- { 0x0db1, 0x0e11 },
- { 0x0db2, 0x0e12 },
- { 0x0db3, 0x0e13 },
- { 0x0db4, 0x0e14 },
- { 0x0db5, 0x0e15 },
- { 0x0db6, 0x0e16 },
- { 0x0db7, 0x0e17 },
- { 0x0db8, 0x0e18 },
- { 0x0db9, 0x0e19 },
- { 0x0dba, 0x0e1a },
- { 0x0dbb, 0x0e1b },
- { 0x0dbc, 0x0e1c },
- { 0x0dbd, 0x0e1d },
- { 0x0dbe, 0x0e1e },
- { 0x0dbf, 0x0e1f },
- { 0x0dc0, 0x0e20 },
- { 0x0dc1, 0x0e21 },
- { 0x0dc2, 0x0e22 },
- { 0x0dc3, 0x0e23 },
- { 0x0dc4, 0x0e24 },
- { 0x0dc5, 0x0e25 },
- { 0x0dc6, 0x0e26 },
- { 0x0dc7, 0x0e27 },
- { 0x0dc8, 0x0e28 },
- { 0x0dc9, 0x0e29 },
- { 0x0dca, 0x0e2a },
- { 0x0dcb, 0x0e2b },
- { 0x0dcc, 0x0e2c },
- { 0x0dcd, 0x0e2d },
- { 0x0dce, 0x0e2e },
- { 0x0dcf, 0x0e2f },
- { 0x0dd0, 0x0e30 },
- { 0x0dd1, 0x0e31 },
- { 0x0dd2, 0x0e32 },
- { 0x0dd3, 0x0e33 },
- { 0x0dd4, 0x0e34 },
- { 0x0dd5, 0x0e35 },
- { 0x0dd6, 0x0e36 },
- { 0x0dd7, 0x0e37 },
- { 0x0dd8, 0x0e38 },
- { 0x0dd9, 0x0e39 },
- { 0x0dda, 0x0e3a },
- { 0x0ddf, 0x0e3f },
- { 0x0de0, 0x0e40 },
- { 0x0de1, 0x0e41 },
- { 0x0de2, 0x0e42 },
- { 0x0de3, 0x0e43 },
- { 0x0de4, 0x0e44 },
- { 0x0de5, 0x0e45 },
- { 0x0de6, 0x0e46 },
- { 0x0de7, 0x0e47 },
- { 0x0de8, 0x0e48 },
- { 0x0de9, 0x0e49 },
- { 0x0dea, 0x0e4a },
- { 0x0deb, 0x0e4b },
- { 0x0dec, 0x0e4c },
- { 0x0ded, 0x0e4d },
- { 0x0df0, 0x0e50 },
- { 0x0df1, 0x0e51 },
- { 0x0df2, 0x0e52 },
- { 0x0df3, 0x0e53 },
- { 0x0df4, 0x0e54 },
- { 0x0df5, 0x0e55 },
- { 0x0df6, 0x0e56 },
- { 0x0df7, 0x0e57 },
- { 0x0df8, 0x0e58 },
- { 0x0df9, 0x0e59 },
- { 0x0ea1, 0x3131 },
- { 0x0ea2, 0x3132 },
- { 0x0ea3, 0x3133 },
- { 0x0ea4, 0x3134 },
- { 0x0ea5, 0x3135 },
- { 0x0ea6, 0x3136 },
- { 0x0ea7, 0x3137 },
- { 0x0ea8, 0x3138 },
- { 0x0ea9, 0x3139 },
- { 0x0eaa, 0x313a },
- { 0x0eab, 0x313b },
- { 0x0eac, 0x313c },
- { 0x0ead, 0x313d },
- { 0x0eae, 0x313e },
- { 0x0eaf, 0x313f },
- { 0x0eb0, 0x3140 },
- { 0x0eb1, 0x3141 },
- { 0x0eb2, 0x3142 },
- { 0x0eb3, 0x3143 },
- { 0x0eb4, 0x3144 },
- { 0x0eb5, 0x3145 },
- { 0x0eb6, 0x3146 },
- { 0x0eb7, 0x3147 },
- { 0x0eb8, 0x3148 },
- { 0x0eb9, 0x3149 },
- { 0x0eba, 0x314a },
- { 0x0ebb, 0x314b },
- { 0x0ebc, 0x314c },
- { 0x0ebd, 0x314d },
- { 0x0ebe, 0x314e },
- { 0x0ebf, 0x314f },
- { 0x0ec0, 0x3150 },
- { 0x0ec1, 0x3151 },
- { 0x0ec2, 0x3152 },
- { 0x0ec3, 0x3153 },
- { 0x0ec4, 0x3154 },
- { 0x0ec5, 0x3155 },
- { 0x0ec6, 0x3156 },
- { 0x0ec7, 0x3157 },
- { 0x0ec8, 0x3158 },
- { 0x0ec9, 0x3159 },
- { 0x0eca, 0x315a },
- { 0x0ecb, 0x315b },
- { 0x0ecc, 0x315c },
- { 0x0ecd, 0x315d },
- { 0x0ece, 0x315e },
- { 0x0ecf, 0x315f },
- { 0x0ed0, 0x3160 },
- { 0x0ed1, 0x3161 },
- { 0x0ed2, 0x3162 },
- { 0x0ed3, 0x3163 },
- { 0x0ed4, 0x11a8 },
- { 0x0ed5, 0x11a9 },
- { 0x0ed6, 0x11aa },
- { 0x0ed7, 0x11ab },
- { 0x0ed8, 0x11ac },
- { 0x0ed9, 0x11ad },
- { 0x0eda, 0x11ae },
- { 0x0edb, 0x11af },
- { 0x0edc, 0x11b0 },
- { 0x0edd, 0x11b1 },
- { 0x0ede, 0x11b2 },
- { 0x0edf, 0x11b3 },
- { 0x0ee0, 0x11b4 },
- { 0x0ee1, 0x11b5 },
- { 0x0ee2, 0x11b6 },
- { 0x0ee3, 0x11b7 },
- { 0x0ee4, 0x11b8 },
- { 0x0ee5, 0x11b9 },
- { 0x0ee6, 0x11ba },
- { 0x0ee7, 0x11bb },
- { 0x0ee8, 0x11bc },
- { 0x0ee9, 0x11bd },
- { 0x0eea, 0x11be },
- { 0x0eeb, 0x11bf },
- { 0x0eec, 0x11c0 },
- { 0x0eed, 0x11c1 },
- { 0x0eee, 0x11c2 },
- { 0x0eef, 0x316d },
- { 0x0ef0, 0x3171 },
- { 0x0ef1, 0x3178 },
- { 0x0ef2, 0x317f },
- { 0x0ef3, 0x3181 },
- { 0x0ef4, 0x3184 },
- { 0x0ef5, 0x3186 },
- { 0x0ef6, 0x318d },
- { 0x0ef7, 0x318e },
- { 0x0ef8, 0x11eb },
- { 0x0ef9, 0x11f0 },
- { 0x0efa, 0x11f9 },
- { 0x0eff, 0x20a9 },
-#if 0
- /* FIXME: there is no keysym 0x13a4? But 0x20ac is EuroSign in both
- keysym and Unicode */
- { 0x13a4, 0x20ac },
-#endif
- { 0x13bc, 0x0152 },
- { 0x13bd, 0x0153 },
- { 0x13be, 0x0178 },
- { 0x20ac, 0x20ac },
-
- /* Special function keys. */
-
- { 0xff08, 0x0008 }, /* XK_BackSpace */
- { 0xff09, 0x0009 }, /* XK_Tab */
- { 0xff0a, 0x000a }, /* XK_Linefeed */
- { 0xff0d, 0x000d }, /* XK_Return */
- { 0xff13, 0x0013 }, /* XK_Pause */
- { 0xff1b, 0x001b }, /* XK_Escape */
- { 0xff50, 0x0001 }, /* XK_Home */
- { 0xff51, 0x001c }, /* XK_Left */
- { 0xff52, 0x001e }, /* XK_Up */
- { 0xff53, 0x001d }, /* XK_Right */
- { 0xff54, 0x001f }, /* XK_Down */
- { 0xff55, 0x000b }, /* XK_Prior */
- { 0xff56, 0x000c }, /* XK_Next */
- { 0xff57, 0x0004 }, /* XK_End */
- { 0xff6a, 0x0005 }, /* XK_Help */
- { 0xffff, 0x007f }, /* XK_Delete */
-};
-
-long keysym2ucs(int keysym)
-{
- int min = 0;
- int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
- int mid;
-
- /* first check for Latin-1 characters (1:1 mapping) */
- if ((keysym >= 0x0020 && keysym <= 0x007e) ||
- (keysym >= 0x00a0 && keysym <= 0x00ff))
- return keysym;
-
- /* also check for directly encoded 24-bit UCS characters */
- if ((keysym & 0xff000000) == 0x01000000)
- return keysym & 0x00ffffff;
-
- /* binary search in table */
- while (max >= min) {
- mid = (min + max) / 2;
- if (keysymtab[mid].keysym < keysym)
- min = mid + 1;
- else if (keysymtab[mid].keysym > keysym)
- max = mid - 1;
- else {
- /* found it */
- return keysymtab[mid].ucs;
- }
- }
-
- /* no matching Unicode value found */
- return -1;
-}
-
-static int reverse_compare (const void *a, const void *b)
-{
- const struct codepair *ca = a, *cb = b;
-
- return ca->ucs - cb->ucs;
-}
-
-int ucs2keysym(long ucs)
-{
- static struct codepair *reverse_keysymtab;
-
- int min = 0;
- int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
- int mid;
-
- if (reverse_keysymtab == NULL)
- {
- reverse_keysymtab = malloc (sizeof (keysymtab));
- memcpy (reverse_keysymtab, keysymtab, sizeof (keysymtab));
-
- qsort (reverse_keysymtab,
- sizeof (keysymtab) / sizeof (struct codepair),
- sizeof (struct codepair),
- reverse_compare);
- }
-
- /* first check for Latin-1 characters (1:1 mapping) */
- if ((ucs >= 0x0020 && ucs <= 0x007e) ||
- (ucs >= 0x00a0 && ucs <= 0x00ff))
- return ucs;
-
- /* binary search in table */
- while (max >= min) {
- mid = (min + max) / 2;
- if (reverse_keysymtab[mid].ucs < ucs)
- min = mid + 1;
- else if (reverse_keysymtab[mid].ucs > ucs)
- max = mid - 1;
- else {
- /* found it */
- return reverse_keysymtab[mid].keysym;
- }
- }
-
- /* finally, assume a directly encoded 24-bit UCS character */
- return ucs | 0x01000000;
-}
diff --git a/hw/darwin/quartz/keysym2ucs.h b/hw/darwin/quartz/keysym2ucs.h
deleted file mode 100644
index 1d9183448..000000000
--- a/hw/darwin/quartz/keysym2ucs.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h,v 1.1 2003/11/01 08:13:08 torrey Exp $
- *
- * This module converts keysym values into the corresponding ISO 10646
- * (UCS, Unicode) values.
- *
- * The array keysymtab[] contains pairs of X11 keysym values for graphical
- * characters and the corresponding Unicode value. The function
- * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
- * therefore keysymtab[] must remain SORTED by keysym value.
- *
- * The keysym -> UTF-8 conversion will hopefully one day be provided
- * by Xlib via XmbLookupString() and should ideally not have to be
- * done in X applications. But we are not there yet.
- *
- * We allow to represent any UCS character in the range U-00000000 to
- * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
- * This admittedly does not cover the entire 31-bit space of UCS, but
- * it does cover all of the characters up to U-10FFFF, which can be
- * represented by UTF-16, and more, and it is very unlikely that higher
- * UCS codes will ever be assigned by ISO. So to get Unicode character
- * U+ABCD you can directly use keysym 0x0100abcd.
- *
- * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
- *
- * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
- * an initial draft of the mapping table.
- *
- * This software is in the public domain. Share and enjoy!
- */
-
-#ifndef KEYSYM2UCS_H
-#define KEYSYM2UCS_H 1
-
-extern long keysym2ucs(int keysym);
-extern int ucs2keysym(long ucs);
-
-#endif /* KEYSYM2UCS_H */
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
deleted file mode 100644
index 2dd7c3ae5..000000000
--- a/hw/darwin/quartz/pseudoramiX.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- *
- * This is used in rootless mode where the underlying window server
- * already provides an abstracted view of multiple screens as one
- * large screen area.
- *
- * This code is largely based on panoramiX.c, which contains the
- * following copyright notice:
- */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.3 2003/04/30 23:15:39 torrey Exp $ */
-
-#include "pseudoramiX.h"
-
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "window.h"
-#include "panoramiXproto.h"
-#include "globals.h"
-
-extern int ProcPanoramiXQueryVersion (ClientPtr client);
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry);
-
-static int ProcPseudoramiXQueryVersion(ClientPtr client);
-static int ProcPseudoramiXGetState(ClientPtr client);
-static int ProcPseudoramiXGetScreenCount(ClientPtr client);
-static int ProcPseudoramiXGetScreenSize(ClientPtr client);
-static int ProcPseudoramiXIsActive(ClientPtr client);
-static int ProcPseudoramiXQueryScreens(ClientPtr client);
-static int ProcPseudoramiXDispatch(ClientPtr client);
-
-static int SProcPseudoramiXQueryVersion(ClientPtr client);
-static int SProcPseudoramiXGetState(ClientPtr client);
-static int SProcPseudoramiXGetScreenCount(ClientPtr client);
-static int SProcPseudoramiXGetScreenSize(ClientPtr client);
-static int SProcPseudoramiXIsActive(ClientPtr client);
-static int SProcPseudoramiXQueryScreens(ClientPtr client);
-static int SProcPseudoramiXDispatch(ClientPtr client);
-
-
-typedef struct {
- int x;
- int y;
- int w;
- int h;
-} PseudoramiXScreenRec;
-
-static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
-static int pseudoramiXScreensAllocated = 0;
-static int pseudoramiXNumScreens = 0;
-static unsigned long pseudoramiXGeneration = 0;
-
-
-// Add a PseudoramiX screen.
-// The rest of the X server will know nothing about this screen.
-// Can be called before or after extension init.
-// Screens must be re-added once per generation.
-void
-PseudoramiXAddScreen(int x, int y, int w, int h)
-{
- PseudoramiXScreenRec *s;
-
- if (noPseudoramiXExtension) return;
-
- if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
- pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
- pseudoramiXScreens = xrealloc(pseudoramiXScreens,
- pseudoramiXScreensAllocated *
- sizeof(PseudoramiXScreenRec));
- }
-
- s = &pseudoramiXScreens[pseudoramiXNumScreens++];
- s->x = x;
- s->y = y;
- s->w = w;
- s->h = h;
-}
-
-
-// Initialize PseudoramiX.
-// Copied from PanoramiXExtensionInit
-void PseudoramiXExtensionInit(int argc, char *argv[])
-{
- Bool success = FALSE;
- ExtensionEntry *extEntry;
-
- if (noPseudoramiXExtension) return;
-
- if (pseudoramiXNumScreens == 1) {
- // Only one screen - disable Xinerama extension.
- noPseudoramiXExtension = TRUE;
- return;
- }
-
- // The server must not run the PanoramiX operations.
- noPanoramiXExtension = TRUE;
-
- if (pseudoramiXGeneration != serverGeneration) {
- extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
- ProcPseudoramiXDispatch,
- SProcPseudoramiXDispatch,
- PseudoramiXResetProc,
- StandardMinorOpcode);
- if (!extEntry) {
- ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
- } else {
- pseudoramiXGeneration = serverGeneration;
- success = TRUE;
- }
- }
-
- if (!success) {
- ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
- PANORAMIX_PROTOCOL_NAME);
- return;
- }
-}
-
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry)
-{
- pseudoramiXNumScreens = 0;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXQueryVersion(ClientPtr client)
-{
- return ProcPanoramiXQueryVersion(client);
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.state, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = pseudoramiXNumScreens;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.ScreenCount, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin;
- xPanoramiXGetScreenSizeReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- pWin = LookupWindow (stuff->window, client);
- if (!pWin)
- return BadWindow;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- /* screen dimensions */
- rep.width = pseudoramiXScreens[stuff->screen].w;
- // was panoramiXdataPtr[stuff->screen].width;
- rep.height = pseudoramiXScreens[stuff->screen].h;
- // was panoramiXdataPtr[stuff->screen].height;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.width, n);
- swaps (&rep.height, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
- return client->noClientException;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXIsActive(ClientPtr client)
-{
- /* REQUEST(xXineramaIsActiveReq); */
- xXineramaIsActiveReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.state, n);
- }
- WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
- return client->noClientException;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXQueryScreens(ClientPtr client)
-{
- /* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
- rep.length = rep.number * sz_XineramaScreenInfo >> 2;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.number, n);
- }
- WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
-
- if (!noPseudoramiXExtension) {
- xXineramaScreenInfo scratch;
- int i;
-
- for(i = 0; i < pseudoramiXNumScreens; i++) {
- scratch.x_org = pseudoramiXScreens[i].x;
- scratch.y_org = pseudoramiXScreens[i].y;
- scratch.width = pseudoramiXScreens[i].w;
- scratch.height = pseudoramiXScreens[i].h;
-
- if(client->swapped) {
- register int n;
- swaps (&scratch.x_org, n);
- swaps (&scratch.y_org, n);
- swaps (&scratch.width, n);
- swaps (&scratch.height, n);
- }
- WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
- }
- }
-
- return client->noClientException;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return ProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return ProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
-
-
-
-static int
-SProcPseudoramiXQueryVersion (ClientPtr client)
-{
- REQUEST(xPanoramiXQueryVersionReq);
- register int n;
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcPseudoramiXQueryVersion(client);
-}
-
-static int
-SProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- return ProcPseudoramiXGetState(client);
-}
-
-static int
-SProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- return ProcPseudoramiXGetScreenCount(client);
-}
-
-static int
-SProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- return ProcPseudoramiXGetScreenSize(client);
-}
-
-
-static int
-SProcPseudoramiXIsActive(ClientPtr client)
-{
- REQUEST(xXineramaIsActiveReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcPseudoramiXIsActive(client);
-}
-
-
-static int
-SProcPseudoramiXQueryScreens(ClientPtr client)
-{
- REQUEST(xXineramaQueryScreensReq);
- register int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcPseudoramiXQueryScreens(client);
-}
-
-
-static int
-SProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return SProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return SProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/darwin/quartz/pseudoramiX.h
deleted file mode 100644
index 23738cfb3..000000000
--- a/hw/darwin/quartz/pseudoramiX.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.2 2003/04/30 23:15:39 torrey Exp $ */
-
-extern int noPseudoramiXExtension;
-
-void PseudoramiXAddScreen(int x, int y, int w, int h);
-void PseudoramiXExtensionInit(int argc, char *argv[]);
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
deleted file mode 100644
index 4643886f3..000000000
--- a/hw/darwin/quartz/quartz.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/**************************************************************
- *
- * Quartz-specific support for the Darwin X Server
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.13 2003/11/12 20:21:51 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartz.h"
-#include "darwin.h"
-#include "quartzAudio.h"
-#include "pseudoramiX.h"
-#define _APPLEWM_SERVER_
-#include "applewm.h"
-#include "applewmExt.h"
-
-// X headers
-#include "scrnintstr.h"
-#include "colormapst.h"
-
-// System headers
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <IOKit/pwr_mgt/IOPMLib.h>
-
-// Shared global variables for Quartz modes
-int quartzEventWriteFD = -1;
-int quartzStartClients = 1;
-int quartzRootless = -1;
-int quartzUseSysBeep = 0;
-int quartzUseAGL = 1;
-int quartzServerVisible = TRUE;
-int quartzServerQuitting = FALSE;
-int quartzScreenIndex = 0;
-int aquaMenuBarHeight = 0;
-int noPseudoramiXExtension = TRUE;
-QuartzModeProcsPtr quartzProcs = NULL;
-const char *quartzOpenGLBundle = NULL;
-
-/*
-===========================================================================
-
- Screen functions
-
-===========================================================================
-*/
-
-/*
- * DarwinModeAddScreen
- * Do mode dependent initialization of each screen for Quartz.
- */
-Bool DarwinModeAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- // allocate space for private per screen Quartz specific storage
- QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
- QUARTZ_PRIV(pScreen) = displayInfo;
-
- // do Quartz mode specific initialization
- return quartzProcs->AddScreen(index, pScreen);
-}
-
-
-/*
- * DarwinModeSetupScreen
- * Finalize mode specific setup of each screen.
- */
-Bool DarwinModeSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- // do Quartz mode specific setup
- if (! quartzProcs->SetupScreen(index, pScreen))
- return FALSE;
-
- // setup cursor support
- if (! quartzProcs->InitCursor(pScreen))
- return FALSE;
-
- return TRUE;
-}
-
-
-/*
- * DarwinModeInitOutput
- * Quartz display initialization.
- */
-void DarwinModeInitOutput(
- int argc,
- char **argv )
-{
- static unsigned long generation = 0;
-
- // Allocate private storage for each screen's Quartz specific info
- if (generation != serverGeneration) {
- quartzScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- if (serverGeneration == 0) {
- QuartzAudioInit();
- }
-
- if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler,
- QuartzWakeupHandler,
- NULL))
- {
- FatalError("Could not register block and wakeup handlers.");
- }
-
- // Do display mode specific initialization
- quartzProcs->DisplayInit();
-
- // Init PseudoramiX implementation of Xinerama.
- // This should be in InitExtensions, but that causes link errors
- // for servers that don't link in pseudoramiX.c.
- if (!noPseudoramiXExtension) {
- PseudoramiXExtensionInit(argc, argv);
- }
-}
-
-
-/*
- * DarwinModeInitInput
- * Inform the main thread the X server is ready to handle events.
- */
-void DarwinModeInitInput(
- int argc,
- char **argv )
-{
- if (serverGeneration == 1) {
- QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
- }
-
- // Do final display mode specific initialization before handling events
- if (quartzProcs->InitInput)
- quartzProcs->InitInput(argc, argv);
-}
-
-
-/*
- * QuartzShow
- * Show the X server on screen. Does nothing if already shown.
- * Calls mode specific screen resume to restore the X clip regions
- * (if needed) and the X server cursor state.
- */
-static void QuartzShow(
- int x, // cursor location
- int y )
-{
- int i;
-
- if (!quartzServerVisible) {
- quartzServerVisible = TRUE;
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
- }
- }
- }
-}
-
-
-/*
- * QuartzHide
- * Remove the X server display from the screen. Does nothing if already
- * hidden. Calls mode specific screen suspend to set X clip regions to
- * prevent drawing (if needed) and restore the Aqua cursor.
- */
-static void QuartzHide(void)
-{
- int i;
-
- if (quartzServerVisible) {
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- quartzProcs->SuspendScreen(screenInfo.screens[i]);
- }
- }
- }
- quartzServerVisible = FALSE;
- QuartzMessageMainThread(kQuartzServerHidden, NULL, 0);
-}
-
-
-/*
- * QuartzSetRootClip
- * Enable or disable rendering to the X screen.
- */
-static void QuartzSetRootClip(
- BOOL enable)
-{
- int i;
-
- if (!quartzServerVisible)
- return;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- xf86SetRootClip(screenInfo.screens[i], enable);
- }
- }
-}
-
-
-/*
- * QuartzMessageServerThread
- * Send the X server thread a message by placing it on the event queue.
- */
-void
-QuartzMessageServerThread(
- int type,
- int argc, ...)
-{
- xEvent xe;
- INT32 *argv;
- int i, max_args;
- va_list args;
-
- memset(&xe, 0, sizeof(xe));
- xe.u.u.type = type;
- xe.u.clientMessage.u.l.type = type;
-
- argv = &xe.u.clientMessage.u.l.longs0;
- max_args = 4;
-
- if (argc > 0 && argc <= max_args) {
- va_start (args, argc);
- for (i = 0; i < argc; i++)
- argv[i] = (int) va_arg (args, int);
- va_end (args);
- }
-
- DarwinEQEnqueue(&xe);
-}
-
-
-/*
- * DarwinModeProcessEvent
- * Process Quartz specific events.
- */
-void DarwinModeProcessEvent(
- xEvent *xe)
-{
- switch (xe->u.u.type) {
-
- case kXDarwinActivate:
- QuartzShow(xe->u.keyButtonPointer.rootX,
- xe->u.keyButtonPointer.rootY);
- AppleWMSendEvent(AppleWMActivationNotify,
- AppleWMActivationNotifyMask,
- AppleWMIsActive, 0);
- break;
-
- case kXDarwinDeactivate:
- AppleWMSendEvent(AppleWMActivationNotify,
- AppleWMActivationNotifyMask,
- AppleWMIsInactive, 0);
- QuartzHide();
- break;
-
- case kXDarwinSetRootClip:
- QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0);
- break;
-
- case kXDarwinQuit:
- GiveUp(0);
- break;
-
- case kXDarwinReadPasteboard:
- QuartzReadPasteboard();
- break;
-
- case kXDarwinWritePasteboard:
- QuartzWritePasteboard();
- break;
-
- /*
- * AppleWM events
- */
- case kXDarwinControllerNotify:
- AppleWMSendEvent(AppleWMControllerNotify,
- AppleWMControllerNotifyMask,
- xe->u.clientMessage.u.l.longs0,
- xe->u.clientMessage.u.l.longs1);
- break;
-
- case kXDarwinPasteboardNotify:
- AppleWMSendEvent(AppleWMPasteboardNotify,
- AppleWMPasteboardNotifyMask,
- xe->u.clientMessage.u.l.longs0,
- xe->u.clientMessage.u.l.longs1);
- break;
-
- case kXDarwinDisplayChanged:
- case kXDarwinWindowState:
- case kXDarwinWindowMoved:
- // FIXME: Not implemented yet
- break;
-
- default:
- ErrorF("Unknown application defined event type %d.\n",
- xe->u.u.type);
- }
-}
-
-
-/*
- * DarwinModeGiveUp
- * Cleanup before X server shutdown
- * Release the screen and restore the Aqua cursor.
- */
-void DarwinModeGiveUp(void)
-{
-#if 0
-// Trying to switch cursors when quitting causes deadlock
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- }
- }
-#endif
-
- if (!quartzRootless)
- quartzProcs->ReleaseScreens();
-}
diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h
deleted file mode 100644
index 849e10cef..000000000
--- a/hw/darwin/quartz/quartz.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * quartz.h
- *
- * External interface of the Quartz display modes seen by the generic, mode
- * independent parts of the Darwin X server.
- */
-/*
- * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 torrey Exp $ */
-
-#ifndef _QUARTZ_H
-#define _QUARTZ_H
-
-#include "quartzPasteboard.h"
-
-#include "screenint.h"
-#include "window.h"
-
-/*------------------------------------------
- Quartz display mode function types
- ------------------------------------------*/
-
-/*
- * Display mode initialization
- */
-typedef void (*DisplayInitProc)(void);
-typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
-typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
-typedef void (*InitInputProc)(int argc, char **argv);
-
-/*
- * Cursor functions
- */
-typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
-typedef void (*CursorUpdateProc)(void);
-
-/*
- * Suspend and resume X11 activity
- */
-typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
-typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
-typedef void (*CaptureScreensProc)(void);
-typedef void (*ReleaseScreensProc)(void);
-
-/*
- * Rootless helper functions
- */
-typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
-
-/*
- * Rootless functions for optional export to GLX layer
- */
-typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
-typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
-typedef Bool (*CreateSurfaceProc)
- (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
- unsigned int client_id, unsigned int *surface_id,
- unsigned int key[2], void (*notify) (void *arg, void *data),
- void *notify_data);
-typedef Bool (*DestroySurfaceProc)
- (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
- void (*notify) (void *arg, void *data), void *notify_data);
-
-/*
- * Quartz display mode function list
- */
-typedef struct _QuartzModeProcs {
- DisplayInitProc DisplayInit;
- AddScreenProc AddScreen;
- SetupScreenProc SetupScreen;
- InitInputProc InitInput;
-
- InitCursorProc InitCursor;
- CursorUpdateProc CursorUpdate; // Not used if NULL
-
- SuspendScreenProc SuspendScreen;
- ResumeScreenProc ResumeScreen;
- CaptureScreensProc CaptureScreens; // Only called in fullscreen
- ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
-
- IsX11WindowProc IsX11Window;
-
- FrameForWindowProc FrameForWindow;
- TopLevelParentProc TopLevelParent;
- CreateSurfaceProc CreateSurface;
- DestroySurfaceProc DestroySurface;
-} QuartzModeProcsRec, *QuartzModeProcsPtr;
-
-extern QuartzModeProcsPtr quartzProcs;
-
-Bool QuartzLoadDisplayBundle(const char *dpyBundleName);
-
-#endif
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/darwin/quartz/quartzAudio.c
deleted file mode 100644
index a3e6af127..000000000
--- a/hw/darwin/quartz/quartzAudio.c
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// QuartzAudio.m
-//
-// X Window bell support using CoreAudio or AppKit.
-// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
-//
-// Info about sine wave sound playback:
-// CoreAudio code derived from macosx-dev posting by Tim Wood
-// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html
-// Smoothing transitions between sounds
-// http://www.wam.umd.edu/~mphoenix/dss/dss.html
-//
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.2 2003/05/14 05:27:56 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartzAudio.h"
-
-#include <CoreAudio/CoreAudio.h>
-#include <pthread.h>
-
-#include "inputstr.h"
-#include "extensions/XI.h"
-
-void NSBeep();
-
-typedef struct QuartzAudioRec {
- double frequency;
- double amplitude;
-
- UInt32 curFrame;
- UInt32 remainingFrames;
- UInt32 totalFrames;
- UInt32 bytesPerFrame;
- double sampleRate;
- UInt32 fadeLength;
-
- UInt32 bufferByteCount;
- Boolean playing;
- pthread_mutex_t lock;
-
- // used to fade out interrupted sound and avoid 'pop'
- double prevFrequency;
- double prevAmplitude;
- UInt32 prevFrame;
-} QuartzAudioRec;
-
-static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown;
-static QuartzAudioRec data;
-
-
-/*
- * QuartzAudioEnvelope
- * Fade sound in and out to avoid pop.
- * Sounds with shorter duration will never reach full amplitude. Deal.
- */
-static double QuartzAudioEnvelope(
- UInt32 curFrame,
- UInt32 totalFrames,
- UInt32 fadeLength )
-{
- double fadeFrames = min(fadeLength, totalFrames / 2);
- if (fadeFrames < 1) return 0;
-
- if (curFrame < fadeFrames) {
- return curFrame / fadeFrames;
- } else if (curFrame > totalFrames - fadeFrames) {
- return (totalFrames-curFrame) / fadeFrames;
- } else {
- return 1.0;
- }
-}
-
-
-/*
- * QuartzFillBuffer
- * Fill this buffer with data and update the data position.
- * FIXME: this is ugly
- */
-static void QuartzFillBuffer(
- AudioBuffer *audiobuffer,
- QuartzAudioRec *data )
-{
- float *buffer, *b;
- unsigned int frame, frameCount;
- unsigned int bufferFrameCount;
- float multiplier, v;
- int i;
-
- buffer = (float *)audiobuffer->mData;
- bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
-
- frameCount = min(bufferFrameCount, data->remainingFrames);
-
- // Fade out previous sine wave, if any.
- b = buffer;
- if (data->prevFrame) {
- multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate);
- for (frame = 0; frame < data->fadeLength; frame++) {
- v = data->prevAmplitude *
- QuartzAudioEnvelope(frame+data->fadeLength,
- 2*data->fadeLength,
- data->fadeLength) *
- sin(multiplier * (data->prevFrame+frame));
- for (i = 0; i < audiobuffer->mNumberChannels; i++) {
- *b++ = v;
- }
- }
- // no more prev fade
- data->prevFrame = 0;
-
- // adjust for space eaten by prev fade
- buffer += audiobuffer->mNumberChannels*frame;
- bufferFrameCount -= frame;
- frameCount = min(bufferFrameCount, data->remainingFrames);
- }
-
- // Write a sine wave with the specified frequency and amplitude
- multiplier = 2*M_PI*(data->frequency/data->sampleRate);
- for (frame = 0; frame < frameCount; frame++) {
- v = data->amplitude *
- QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames,
- data->fadeLength) *
- sin(multiplier * (data->curFrame+frame));
- for (i = 0; i < audiobuffer->mNumberChannels; i++) {
- *b++ = v;
- }
- }
-
- // Zero out the rest of the buffer, if any
- memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels *
- (bufferFrameCount-frame));
-
- data->curFrame += frameCount;
- data->remainingFrames -= frameCount;
- if (data->remainingFrames == 0) {
- data->playing = FALSE;
- data->curFrame = 0;
- }
-}
-
-
-/*
- * QuartzAudioIOProc
- * Callback function for audio playback.
- * FIXME: use inOutputTime to correct for skipping
- */
-static OSStatus
-QuartzAudioIOProc(
- AudioDeviceID inDevice,
- const AudioTimeStamp *inNow,
- const AudioBufferList *inInputData,
- const AudioTimeStamp *inInputTime,
- AudioBufferList *outOutputData,
- const AudioTimeStamp *inOutputTime,
- void *inClientData )
-{
- QuartzAudioRec *data = (QuartzAudioRec *)inClientData;
- int i;
- Boolean wasPlaying;
-
- pthread_mutex_lock(&data->lock);
- wasPlaying = data->playing;
- for (i = 0; i < outOutputData->mNumberBuffers; i++) {
- if (data->playing) {
- QuartzFillBuffer(outOutputData->mBuffers+i, data);
- }
- else {
- memset(outOutputData->mBuffers[i].mData, 0,
- outOutputData->mBuffers[i].mDataByteSize);
- }
- }
- if (wasPlaying && !data->playing) {
- OSStatus err;
- err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
- }
- pthread_mutex_unlock(&data->lock);
- return 0;
-}
-
-
-/*
- * QuartzCoreAudioBell
- * Play a tone using the CoreAudio API
- */
-static void QuartzCoreAudioBell(
- int volume, // volume is % of max
- int pitch, // pitch is Hz
- int duration ) // duration is milliseconds
-{
- if (quartzAudioDevice == kAudioDeviceUnknown) return;
-
- pthread_mutex_lock(&data.lock);
-
- // fade previous sound, if any
- data.prevFrequency = data.frequency;
- data.prevAmplitude = data.amplitude;
- data.prevFrame = data.curFrame;
-
- // set new sound
- data.frequency = pitch;
- data.amplitude = volume / 100.0;
- data.curFrame = 0;
- data.totalFrames = (int)(data.sampleRate * duration / 1000.0);
- data.remainingFrames = data.totalFrames;
-
- if (! data.playing) {
- OSStatus status;
- status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc);
- if (status) {
- ErrorF("QuartzAudioBell: AudioDeviceStart returned %d\n", status);
- } else {
- data.playing = TRUE;
- }
- }
- pthread_mutex_unlock(&data.lock);
-}
-
-
-/*
- * DarwinModeBell
- * Ring the bell
- */
-void DarwinModeBell(
- int volume, // volume in percent of max
- DeviceIntPtr pDevice,
- pointer ctrl,
- int class )
-{
- int pitch; // pitch in Hz
- int duration; // duration in milliseconds
-
- if (class == BellFeedbackClass) {
- pitch = ((BellCtrl*)ctrl)->pitch;
- duration = ((BellCtrl*)ctrl)->duration;
- } else if (class == KbdFeedbackClass) {
- pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
- duration = ((KeybdCtrl*)ctrl)->bell_duration;
- } else {
- ErrorF("QuartzBell: bad bell class %d\n", class);
- return;
- }
-
- if (quartzUseSysBeep) {
- if (volume)
- NSBeep();
- } else {
- QuartzCoreAudioBell(volume, pitch, duration);
- }
-}
-
-
-/*
- * QuartzAudioInit
- * Prepare to play the bell with the CoreAudio API
- */
-void QuartzAudioInit(void)
-{
- UInt32 propertySize;
- OSStatus status;
- AudioDeviceID outputDevice;
- AudioStreamBasicDescription outputStreamDescription;
- double sampleRate;
-
- // Get the default output device
- propertySize = sizeof(outputDevice);
- status = AudioHardwareGetProperty(
- kAudioHardwarePropertyDefaultOutputDevice,
- &propertySize, &outputDevice);
- if (status) {
- ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %d\n",
- status);
- return;
- }
- if (outputDevice == kAudioDeviceUnknown) {
- ErrorF("QuartzAudioInit: No audio output devices available.\n");
- return;
- }
-
- // Get the basic device description
- propertySize = sizeof(outputStreamDescription);
- status = AudioDeviceGetProperty(outputDevice, 0, FALSE,
- kAudioDevicePropertyStreamFormat,
- &propertySize, &outputStreamDescription);
- if (status) {
- ErrorF("QuartzAudioInit: GetProperty(stream format) returned %d\n",
- status);
- return;
- }
- sampleRate = outputStreamDescription.mSampleRate;
-
- // Fill in the playback data
- data.frequency = 0;
- data.amplitude = 0;
- data.curFrame = 0;
- data.remainingFrames = 0;
- data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
- data.sampleRate = sampleRate;
- // data.bufferByteCount = bufferByteCount;
- data.playing = FALSE;
- data.prevAmplitude = 0;
- data.prevFrame = 0;
- data.prevFrequency = 0;
- data.fadeLength = data.sampleRate / 200;
- pthread_mutex_init(&data.lock, NULL); // fixme error check
-
- // fixme assert fadeLength<framesPerBuffer
-
- // Prepare for playback
- status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
- if (status) {
- ErrorF("QuartzAudioInit: AddIOProc returned %d\n", status);
- return;
- }
-
- // success!
- quartzAudioDevice = outputDevice;
-}
diff --git a/hw/darwin/quartz/quartzAudio.h b/hw/darwin/quartz/quartzAudio.h
deleted file mode 100644
index 1d213e36a..000000000
--- a/hw/darwin/quartz/quartzAudio.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// QuartzAudio.h
-//
-// X Window bell support using CoreAudio or AppKit.
-// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
-
-#ifndef _QUARTZAUDIO_H
-#define _QUARTZAUDIO_H
-
-#include "input.h"
-
-void QuartzAudioInit(void);
-void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
-
-#endif
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
deleted file mode 100644
index bba71c041..000000000
--- a/hw/darwin/quartz/quartzCocoa.m
+++ /dev/null
@@ -1,203 +0,0 @@
-/**************************************************************
- *
- * Quartz-specific support for the Darwin X Server
- * that requires Cocoa and Objective-C.
- *
- * This file is separate from the parts of Quartz support
- * that use X include files to avoid symbol collisions.
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.4 2003/05/14 05:27:56 torrey Exp $ */
-
-#include "quartzCommon.h"
-
-#define BOOL xBOOL
-#include "darwin.h"
-#undef BOOL
-
-#include <Cocoa/Cocoa.h>
-
-#import "Preferences.h"
-#include "pseudoramiX.h"
-
-extern void FatalError(const char *, ...);
-extern char *display;
-extern int noPanoramiXExtension;
-
-
-/*
- * QuartzReadPreferences
- * Read the user preferences from the Cocoa front end.
- */
-void QuartzReadPreferences(void)
-{
- char *fileString;
-
- darwinFakeButtons = [Preferences fakeButtons];
- darwinFakeMouse2Mask = [Preferences button2Mask];
- darwinFakeMouse3Mask = [Preferences button3Mask];
- darwinMouseAccelChange = [Preferences mouseAccelChange];
- quartzUseSysBeep = [Preferences systemBeep];
-
- // quartzRootless has already been set
- if (quartzRootless) {
- // Use PseudoramiX instead of Xinerama
- noPanoramiXExtension = TRUE;
- noPseudoramiXExtension = ![Preferences xinerama];
-
- quartzUseAGL = [Preferences useAGL];
- } else {
- noPanoramiXExtension = ![Preferences xinerama];
- noPseudoramiXExtension = TRUE;
-
- // Full screen can't use AGL for GLX
- quartzUseAGL = FALSE;
- }
-
- if ([Preferences useKeymapFile]) {
- fileString = (char *) [[Preferences keymapFile] lossyCString];
- darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
- if (! darwinKeymapFile)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- strcpy(darwinKeymapFile, fileString);
- }
-
- display = (char *) malloc(8);
- if (! display)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- snprintf(display, 8, "%i", [Preferences display]);
-
- darwinDesiredDepth = [Preferences depth] - 1;
-}
-
-
-/*
- * QuartzWriteCocoaPasteboard
- * Write text to the Mac OS X pasteboard.
- */
-void QuartzWriteCocoaPasteboard(
- char *text)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *string;
-
- if (! text) return;
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return;
- string = [NSString stringWithCString:text];
- if (! string) return;
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
-
- // nil owner because we don't provide type translations
- [pasteboard declareTypes:pasteboardTypes owner:nil];
- [pasteboard setString:string forType:NSStringPboardType];
-}
-
-
-/*
- * QuartzReadCocoaPasteboard
- * Read text from the Mac OS X pasteboard and return it as a heap string.
- * The caller must free the string.
- */
-char *QuartzReadCocoaPasteboard(void)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *existingType;
- char *text = NULL;
-
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return NULL;
-
- existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
- if (existingType) {
- NSString *string = [pasteboard stringForType:existingType];
- char *buffer;
-
- if (! string) return NULL;
- buffer = (char *) [string lossyCString];
- text = (char *) malloc(strlen(buffer)+1);
- if (text)
- strcpy(text, buffer);
- }
-
- return text;
-}
-
-
-/*
- * QuartzFSUseQDCursor
- * Return whether the screen should use a QuickDraw cursor.
- */
-int QuartzFSUseQDCursor(
- int depth) // screen depth
-{
- switch ([Preferences useQDCursor]) {
- case qdCursor_Always:
- return TRUE;
- case qdCursor_Never:
- return FALSE;
- case qdCursor_Not8Bit:
- if (depth > 8)
- return TRUE;
- else
- return FALSE;
- }
- return TRUE;
-}
-
-
-/*
- * QuartzBlockHandler
- * Clean out any autoreleased objects.
- */
-void QuartzBlockHandler(
- void *blockData,
- void *pTimeout,
- void *pReadmask)
-{
- static NSAutoreleasePool *aPool = nil;
-
- [aPool release];
- aPool = [[NSAutoreleasePool alloc] init];
-}
-
-
-/*
- * QuartzWakeupHandler
- */
-void QuartzWakeupHandler(
- void *blockData,
- int result,
- void *pReadmask)
-{
- // nothing here
-}
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/darwin/quartz/quartzCommon.h
deleted file mode 100644
index e3ae4b850..000000000
--- a/hw/darwin/quartz/quartzCommon.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * quartzCommon.h
- *
- * Common definitions used internally by all Quartz modes
- *
- * This file should be included before any X11 or IOKit headers
- * so that it can avoid symbol conflicts.
- *
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.14 2003/11/12 20:21:51 torrey Exp $ */
-
-#ifndef _QUARTZCOMMON_H
-#define _QUARTZCOMMON_H
-
-// QuickDraw in ApplicationServices has the following conflicts with
-// the basic X server headers. Use QD_<name> to use the QuickDraw
-// definition of any of these symbols, or the normal name for the
-// X11 definition.
-#define Cursor QD_Cursor
-#define WindowPtr QD_WindowPtr
-#define Picture QD_Picture
-#include <ApplicationServices/ApplicationServices.h>
-#undef Cursor
-#undef WindowPtr
-#undef Picture
-
-// Quartz specific per screen storage structure
-typedef struct {
- // List of CoreGraphics displays that this X11 screen covers.
- // This is more than one CG display for video mirroring and
- // rootless PseudoramiX mode.
- // No CG display will be covered by more than one X11 screen.
- int displayCount;
- CGDirectDisplayID *displayIDs;
-} QuartzScreenRec, *QuartzScreenPtr;
-
-#define QUARTZ_PRIV(pScreen) \
- ((QuartzScreenPtr)pScreen->devPrivates[quartzScreenIndex].ptr)
-
-// Data stored at startup for Cocoa front end
-extern int quartzEventWriteFD;
-extern int quartzStartClients;
-
-// User preferences used by Quartz modes
-extern int quartzRootless;
-extern int quartzUseSysBeep;
-extern int quartzUseAGL;
-
-// Other shared data
-extern int quartzServerVisible;
-extern int quartzServerQuitting;
-extern int quartzScreenIndex;
-extern int aquaMenuBarHeight;
-
-// Name of GLX bundle for native OpenGL
-extern const char *quartzOpenGLBundle;
-
-void QuartzReadPreferences(void);
-void QuartzMessageMainThread(unsigned msg, void *data, unsigned length);
-void QuartzMessageServerThread(int type, int argc, ...);
-void QuartzSetWindowMenu(int nitems, const char **items,
- const char *shortcuts);
-void QuartzFSCapture(void);
-void QuartzFSRelease(void);
-int QuartzFSUseQDCursor(int depth);
-void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask);
-void QuartzWakeupHandler(void *blockData, int result, void *pReadmask);
-
-// Messages that can be sent to the main thread.
-enum {
- kQuartzServerHidden,
- kQuartzServerStarted,
- kQuartzServerDied,
- kQuartzCursorUpdate,
- kQuartzPostEvent,
- kQuartzSetWindowMenu,
- kQuartzSetWindowMenuCheck,
- kQuartzSetFrontProcess,
- kQuartzSetCanQuit
-};
-
-#endif /* _QUARTZCOMMON_H */
diff --git a/hw/darwin/quartz/quartzCursor.c b/hw/darwin/quartz/quartzCursor.c
deleted file mode 100644
index 8abce2318..000000000
--- a/hw/darwin/quartz/quartzCursor.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/**************************************************************
- *
- * Support for using the Quartz Window Manager cursor
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.c,v 1.5 2003/01/23 00:34:26 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartzCursor.h"
-#include "darwin.h"
-
-#include <pthread.h>
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "globals.h"
-
-// Size of the QuickDraw cursor
-#define CURSORWIDTH 16
-#define CURSORHEIGHT 16
-
-typedef struct {
- int qdCursorMode;
- int qdCursorVisible;
- int useQDCursor;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
-} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-static CursorPtr quartzLatentCursor = NULL;
-static QD_Cursor gQDArrow; // QuickDraw arrow cursor
-
-// Cursor for the main thread to set (NULL = arrow cursor).
-static CCrsrHandle currentCursor = NULL;
-static pthread_mutex_t cursorMutex;
-static pthread_cond_t cursorCondition;
-
-#define CURSOR_PRIV(pScreen) \
- ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-#define HIDE_QD_CURSOR(pScreen, visible) \
- if (visible) { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = FALSE; \
- } ((void)0)
-
-#define SHOW_QD_CURSOR(pScreen, visible) \
- { \
- int ix; \
- for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
- CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
- } \
- visible = TRUE; \
- } ((void)0)
-
-#define CHANGE_QD_CURSOR(cursorH) \
- if (!quartzServerQuitting) { \
- /* Acquire lock and tell the main thread to change cursor */ \
- pthread_mutex_lock(&cursorMutex); \
- currentCursor = (CCrsrHandle) (cursorH); \
- QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
- \
- /* Wait for the main thread to change the cursor */ \
- pthread_cond_wait(&cursorCondition, &cursorMutex); \
- pthread_mutex_unlock(&cursorMutex); \
- } ((void)0)
-
-
-/*
- * MakeQDCursor helpers: CTAB_ENTER, interleave
- */
-
-// Add a color entry to a ctab
-#define CTAB_ENTER(ctab, index, r, g, b) \
- ctab->ctTable[index].value = index; \
- ctab->ctTable[index].rgb.red = r; \
- ctab->ctTable[index].rgb.green = g; \
- ctab->ctTable[index].rgb.blue = b
-
-// Make an unsigned short by interleaving the bits of bytes c1 and c2.
-// High bit of c1 is first; low bit of c2 is last.
-// Interleave is a built-in INTERCAL operator.
-static unsigned short
-interleave(
- unsigned char c1,
- unsigned char c2 )
-{
- return
- ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) |
- ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) |
- ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) |
- ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) |
- ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) |
- ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) |
- ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) |
- ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ;
-}
-
-/*
- * MakeQDCursor
- * Make a QuickDraw color cursor from the given X11 cursor.
- * Warning: This code is nasty. Color cursors were meant to be read
- * from resources; constructing the structures programmatically is messy.
- */
-/*
- QuickDraw cursor representation:
- Our color cursor is a 2 bit per pixel pixmap.
- Each pixel's bits are (source<<1 | mask) from the original X cursor pixel.
- The cursor's color table maps the colors like this:
- (2-bit value | X result | colortable | Mac result)
- 00 | transparent | white | transparent (white outside mask)
- 01 | back color | back color | back color
- 10 | undefined | black | invert background (just for fun)
- 11 | fore color | fore color | fore color
-*/
-static CCrsrHandle
-MakeQDCursor(
- CursorPtr pCursor )
-{
- CCrsrHandle result;
- CCrsrPtr curs;
- int i, w, h;
- unsigned short rowMask;
- PixMap *pix;
- ColorTable *ctab;
- unsigned short *image;
-
- result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr));
- if (!result) return NULL;
- HLock((Handle)result);
- curs = *result;
-
- // Initialize CCrsr
- curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color
- curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap));
- if (!curs->crsrMap) goto pixAllocFailed;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- curs->crsrData = NULL; // raw cursor image data (set below)
- curs->crsrXData = NULL; // QD's processed data
- curs->crsrXValid = 0; // zero means QD must re-process cursor data
- curs->crsrXHandle = NULL; // reserved
- memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data
- memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask
- curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot
- curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot
- curs->crsrXTable = 0; // reserved
- curs->crsrID = GetCTSeed(); // unique ID from Color Manager
-
- // Set the b&w data and mask
- w = min(pCursor->bits->width, CURSORWIDTH);
- h = min(pCursor->bits->height, CURSORHEIGHT);
- rowMask = ~((1 << (CURSORWIDTH - w)) - 1);
- for (i = 0; i < h; i++) {
- curs->crsr1Data[i] = rowMask &
- ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]);
- curs->crsrMask[i] = rowMask &
- ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]);
- }
-
- // Set the color data and mask
- // crsrMap: defines bit depth and size and colortable only
- pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap
- SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020
- pix->pixelSize = 2;
- pix->cmpCount = 1;
- pix->cmpSize = 2;
- // pix->pmTable set below
-
- // crsrData is the pixel data. crsrMap's baseAddr is not used.
- curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8);
- if (!curs->crsrData) goto imageAllocFailed;
- HLock((Handle)curs->crsrData);
- image = (unsigned short *) *curs->crsrData;
- // Pixel data is just 1-bit data and mask interleaved (see above)
- for (i = 0; i < h; i++) {
- unsigned char s, m;
- s = pCursor->bits->source[i*4] & (rowMask >> 8);
- m = pCursor->bits->mask[i*4] & (rowMask >> 8);
- image[2*i] = interleave(s, m);
- s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff);
- m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff);
- image[2*i+1] = interleave(s, m);
- }
-
- // Build the color table (entries described above)
- // NewPixMap allocates a color table handle.
- pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3
- * sizeof(ColorSpec));
- if (!pix->pmTable) goto ctabAllocFailed;
- HLock((Handle)pix->pmTable);
- ctab = *pix->pmTable;
- ctab->ctSeed = GetCTSeed();
- ctab->ctFlags = 0;
- ctab->ctSize = 3; // color count - 1
- CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff);
- CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue);
- CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000);
- CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue);
-
- HUnlock((Handle)pix->pmTable); // ctab
- HUnlock((Handle)curs->crsrData); // image data
- HUnlock((Handle)curs->crsrMap); // pix
- HUnlock((Handle)result); // cursor
-
- return result;
-
- // "What we have here is a failure to allocate"
-ctabAllocFailed:
- HUnlock((Handle)curs->crsrData);
- DisposeHandle((Handle)curs->crsrData);
-imageAllocFailed:
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
-pixAllocFailed:
- HUnlock((Handle)result);
- DisposeHandle((Handle)result);
- return NULL;
-}
-
-
-/*
- * FreeQDCursor
- * Destroy a QuickDraw color cursor created with MakeQDCursor().
- * The cursor must not currently be on screen.
- */
-static void FreeQDCursor(CCrsrHandle cursHandle)
-{
- CCrsrPtr curs;
- PixMap *pix;
-
- HLock((Handle)cursHandle);
- curs = *cursHandle;
- HLock((Handle)curs->crsrMap);
- pix = *curs->crsrMap;
- DisposeHandle((Handle)pix->pmTable);
- HUnlock((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrMap);
- DisposeHandle((Handle)curs->crsrData);
- HUnlock((Handle)cursHandle);
- DisposeHandle((Handle)cursHandle);
-}
-
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- * QuartzRealizeCursor
- * Convert the X cursor representation to QuickDraw format if possible.
- */
-Bool
-QuartzRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- CCrsrHandle qdCursor;
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if(!pCursor || !pCursor->bits)
- return FALSE;
-
- // if the cursor is too big we use a software cursor
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- // rootless can't use a software cursor
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->RealizeCursor)
- (pScreen, pCursor);
- }
- }
-
- // make new cursor image
- qdCursor = MakeQDCursor(pCursor);
- if (!qdCursor) return FALSE;
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor;
-
- return TRUE;
-}
-
-
-/*
- * QuartzUnrealizeCursor
- * Free the storage space associated with a realized cursor.
- */
-Bool
-QuartzUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
- {
- if (quartzRootless) {
- return TRUE;
- } else {
- return (*ScreenPriv->spriteFuncs->UnrealizeCursor)
- (pScreen, pCursor);
- }
- } else {
- CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
-
- if (currentCursor != oldCursor) {
- // This should only fail when quitting, in which case we just leak.
- FreeQDCursor(oldCursor);
- }
- pCursor->devPriv[pScreen->myNum] = NULL;
- return TRUE;
- }
-}
-
-
-/*
- * QuartzSetCursor
- * Set the cursor sprite and position.
- * Use QuickDraw cursor if possible.
- */
-static void
-QuartzSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- quartzLatentCursor = pCursor;
-
- // Don't touch Mac OS cursor if X is hidden!
- if (!quartzServerVisible)
- return;
-
- if (!pCursor) {
- // Remove the cursor completely.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- if (! ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- }
- else if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor)
- {
- // Cursor is small enough to use QuickDraw directly.
- if (! ScreenPriv->qdCursorMode) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->qdCursorMode = TRUE;
-
- CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else if (quartzRootless) {
- // Rootless can't use a software cursor, so we just use Mac OS arrow.
- CHANGE_QD_CURSOR(NULL);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- }
- else {
- // Cursor is too big for QuickDraw. Use X software cursor.
- HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
- ScreenPriv->qdCursorMode = FALSE;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
- }
-}
-
-
-/*
- * QuartzReallySetCursor
- * Set the QuickDraw cursor. Called from the main thread since changing the
- * cursor with QuickDraw is not thread safe on dual processor machines.
- */
-void
-QuartzReallySetCursor()
-{
- pthread_mutex_lock(&cursorMutex);
-
- if (currentCursor) {
- SetCCursor(currentCursor);
- } else {
- SetCursor(&gQDArrow);
- }
-
- pthread_cond_signal(&cursorCondition);
- pthread_mutex_unlock(&cursorMutex);
-}
-
-
-/*
- * QuartzMoveCursor
- * Move the cursor. This is a noop for QuickDraw.
- */
-static void
-QuartzMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->qdCursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
- QuartzRealizeCursor,
- QuartzUnrealizeCursor,
- QuartzSetCursor,
- QuartzMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorOffScreen
- */
-static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-
-/*
- * QuartzCrossScreen
- */
-static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
-{
- return;
-}
-
-
-/*
- * QuartzWarpCursor
- * Change the cursor position without generating an event or motion history.
- * The input coordinates (x,y) are in pScreen-local X11 coordinates.
- *
- */
-static void
-QuartzWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- static int neverMoved = TRUE;
-
- if (neverMoved) {
- // Don't move the cursor the first time. This is the jump-to-center
- // initialization, and it's annoying because we may still be in MacOS.
- neverMoved = FALSE;
- return;
- }
-
- if (quartzServerVisible) {
- CGDisplayErr cgErr;
- CGPoint cgPoint;
- // Only need to do this for one display. Any display will do.
- CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0];
- CGRect cgRect = CGDisplayBounds(cgID);
-
- // Convert (x,y) to CoreGraphics screen-local CG coordinates.
- // This is necessary because the X11 screen and CG screen may not
- // coincide. (e.g. X11 screen may be moved to dodge the menu bar)
-
- // Make point in X11 global coordinates
- cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x,
- y + dixScreenOrigins[pScreen->myNum].y);
- // Shift to CoreGraphics global screen coordinates
- cgPoint.x += darwinMainScreenX;
- cgPoint.y += darwinMainScreenY;
- // Shift to CoreGraphics screen-local coordinates
- cgPoint.x -= cgRect.origin.x;
- cgPoint.y -= cgRect.origin.y;
-
- cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint);
- if (cgErr != CGDisplayNoErr) {
- ErrorF("Could not set cursor position with error code 0x%x.\n",
- cgErr);
- }
- }
-
- miPointerWarpCursor(pScreen, x, y);
- miPointerUpdate();
-}
-
-
-static miPointerScreenFuncRec quartzScreenFuncsRec = {
- QuartzCursorOffScreen,
- QuartzCrossScreen,
- QuartzWarpCursor,
- DarwinEQPointerPost,
- DarwinEQSwitchScreen
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-QuartzCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else {
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
- }
-}
-
-
-/*
- * QuartzInitCursor
- * Initialize cursor support
- */
-Bool
-QuartzInitCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's QuickDraw cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- CURSOR_PRIV(pScreen) = ScreenPriv;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = QuartzCursorQueryBestSize;
-
- // initialize QuickDraw cursor handling
- GetQDGlobalsArrow(&gQDArrow);
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
-
- if (!quartzRootless)
- ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel);
- else
- ScreenPriv->useQDCursor = TRUE;
- ScreenPriv->qdCursorMode = TRUE;
- ScreenPriv->qdCursorVisible = TRUE;
-
- // initialize cursor mutex lock
- pthread_mutex_init(&cursorMutex, NULL);
-
- // initialize condition for waiting
- pthread_cond_init(&cursorCondition, NULL);
-
- return TRUE;
-}
-
-
-// X server is hiding. Restore the Aqua cursor.
-void QuartzSuspendXCursor(
- ScreenPtr pScreen )
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- CHANGE_QD_CURSOR(NULL);
- SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
-}
-
-
-// X server is showing. Restore the X cursor.
-void QuartzResumeXCursor(
- ScreenPtr pScreen,
- int x,
- int y )
-{
- QuartzSetCursor(pScreen, quartzLatentCursor, x, y);
-}
diff --git a/hw/darwin/quartz/quartzCursor.h b/hw/darwin/quartz/quartzCursor.h
deleted file mode 100644
index 9710d4be2..000000000
--- a/hw/darwin/quartz/quartzCursor.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * quartzCursor.h
- *
- * External interface for Quartz hardware cursor
- */
-/*
- * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
-
-#ifndef QUARTZCURSOR_H
-#define QUARTZCURSOR_H
-
-#include "screenint.h"
-
-Bool QuartzInitCursor(ScreenPtr pScreen);
-void QuartzSuspendXCursor(ScreenPtr pScreen);
-void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
-
-#endif
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c
deleted file mode 100644
index 8d580830b..000000000
--- a/hw/darwin/quartz/quartzKeyboard.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- quartzKeyboard.c
- $Id$
-
- Code to build a keymap using the Carbon Keyboard Layout API,
- which is supported on Mac OS X 10.2 and newer.
-
- Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization.
-*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c,v 1.1 2003/11/01 08:13:08 torrey Exp $ */
-
-#ifdef HAS_KL_API
-
-#include "quartzCommon.h"
-
-#include <CoreServices/CoreServices.h>
-#include <Carbon/Carbon.h>
-
-#include "darwinKeyboard.h"
-#include "keysym.h"
-#include "keysym2ucs.h"
-
-#define HACK_MISSING 1
-#define HACK_KEYPAD 1
-
-enum {
- MOD_COMMAND = 256,
- MOD_SHIFT = 512,
- MOD_OPTION = 2048,
- MOD_CONTROL = 4096,
-};
-
-#define UKEYSYM(u) ((u) | 0x01000000)
-
-/* Table of keycode->keysym mappings we use to fallback on for important
- keys that are often not in the Unicode mapping. */
-
-const static struct {
- unsigned short keycode;
- KeySym keysym;
-} known_keys[] = {
- {55, XK_Meta_L},
- {56, XK_Shift_L},
- {57, XK_Caps_Lock},
- {58, XK_Alt_L},
- {59, XK_Control_L},
- {60, XK_Shift_R},
- {61, XK_Alt_R},
- {62, XK_Control_R},
-
- {122, XK_F1},
- {120, XK_F2},
- {99, XK_F3},
- {118, XK_F4},
- {96, XK_F5},
- {97, XK_F6},
- {98, XK_F7},
- {100, XK_F8},
- {101, XK_F9},
- {109, XK_F10},
- {103, XK_F11},
- {111, XK_F12},
- {105, XK_F13},
- {107, XK_F14},
- {113, XK_F15},
-};
-
-/* Table of keycode->old,new-keysym mappings we use to fixup the numeric
- keypad entries. */
-
-const static struct {
- unsigned short keycode;
- KeySym normal, keypad;
-} known_numeric_keys[] = {
- {65, XK_period, XK_KP_Decimal},
- {67, XK_asterisk, XK_KP_Multiply},
- {69, XK_plus, XK_KP_Add},
- {75, XK_slash, XK_KP_Divide},
- {76, 0x01000003, XK_KP_Enter},
- {78, XK_minus, XK_KP_Subtract},
- {81, XK_equal, XK_KP_Equal},
- {82, XK_0, XK_KP_0},
- {83, XK_1, XK_KP_1},
- {84, XK_2, XK_KP_2},
- {85, XK_3, XK_KP_3},
- {86, XK_4, XK_KP_4},
- {87, XK_5, XK_KP_5},
- {88, XK_6, XK_KP_6},
- {89, XK_7, XK_KP_7},
- {91, XK_8, XK_KP_8},
- {92, XK_9, XK_KP_9},
-};
-
-/* Table mapping normal keysyms to their dead equivalents.
- FIXME: all the unicode keysyms (apart from circumflex) were guessed. */
-
-const static struct {
- KeySym normal, dead;
-} dead_keys[] = {
- {XK_grave, XK_dead_grave},
- {XK_acute, XK_dead_acute},
- {XK_asciicircum, XK_dead_circumflex},
- {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
- {XK_asciitilde, XK_dead_tilde},
- {UKEYSYM (0x2dc), XK_dead_tilde}, /* SMALL TILDE */
- {XK_macron, XK_dead_macron},
- {XK_breve, XK_dead_breve},
- {XK_abovedot, XK_dead_abovedot},
- {XK_diaeresis, XK_dead_diaeresis},
- {UKEYSYM (0x2da), XK_dead_abovering}, /* DOT ABOVE */
- {XK_doubleacute, XK_dead_doubleacute},
- {XK_caron, XK_dead_caron},
- {XK_cedilla, XK_dead_cedilla},
- {XK_ogonek, XK_dead_ogonek},
- {UKEYSYM (0x269), XK_dead_iota}, /* LATIN SMALL LETTER IOTA */
- {UKEYSYM (0x2ec), XK_dead_voiced_sound}, /* MODIFIER LETTER VOICING */
-/* {XK_semivoiced_sound, XK_dead_semivoiced_sound}, */
- {UKEYSYM (0x323), XK_dead_belowdot}, /* COMBINING DOT BELOW */
- {UKEYSYM (0x309), XK_dead_hook}, /* COMBINING HOOK ABOVE */
- {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */
-};
-
-unsigned int
-DarwinSystemKeymapSeed (void)
-{
- static unsigned int seed;
-
- static KeyboardLayoutRef last_key_layout;
- KeyboardLayoutRef key_layout;
-
- KLGetCurrentKeyboardLayout (&key_layout);
-
- if (key_layout != last_key_layout)
- seed++;
-
- last_key_layout = key_layout;
-
- return seed;
-}
-
-static inline UniChar
-macroman2ucs (unsigned char c)
-{
- /* Precalculated table mapping MacRoman-128 to Unicode. Generated
- by creating single element CFStringRefs then extracting the
- first character. */
-
- static const unsigned short table[128] = {
- 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1,
- 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8,
- 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3,
- 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc,
- 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf,
- 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8,
- 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211,
- 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8,
- 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab,
- 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153,
- 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca,
- 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02,
- 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1,
- 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4,
- 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc,
- 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7,
- };
-
- if (c < 128)
- return c;
- else
- return table[c - 128];
-}
-
-static KeySym
-make_dead_key (KeySym in)
-{
- int i;
-
- for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++)
- {
- if (dead_keys[i].normal == in)
- return dead_keys[i].dead;
- }
-
- return in;
-}
-
-Bool
-DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
-{
- KeyboardLayoutRef key_layout;
- const void *chr_data;
- int num_keycodes = NUM_KEYCODES;
- UInt32 keyboard_type = 0;
- int is_uchr, i, j;
- OSStatus err;
- KeySym *k;
-
- KLGetCurrentKeyboardLayout (&key_layout);
- KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
-
- if (chr_data != NULL)
- {
- is_uchr = 1;
- keyboard_type = LMGetKbdType ();
- }
- else
- {
- KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
-
- if (chr_data == NULL)
- {
- ErrorF ( "Couldn't get uchr or kchr resource\n");
- return FALSE;
- }
-
- is_uchr = 0;
- num_keycodes = 128;
- }
-
-
- /* Scan the keycode range for the Unicode character that each
- key produces in the four shift states. Then convert that to
- an X11 keysym (which may just the bit that says "this is
- Unicode" if it can't find the real symbol.) */
-
- for (i = 0; i < num_keycodes; i++)
- {
- static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION,
- MOD_OPTION | MOD_SHIFT};
-
- k = info->keyMap + i * GLYPHS_PER_KEY;
-
- for (j = 0; j < 4; j++)
- {
- if (is_uchr)
- {
- UniChar s[8];
- UniCharCount len;
- UInt32 dead_key_state, extra_dead;
-
- dead_key_state = 0;
- err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
- mods[j] >> 8, keyboard_type, 0,
- &dead_key_state, 8, &len, s);
- if (err != noErr)
- continue;
-
- if (len == 0 && dead_key_state != 0)
- {
- /* Found a dead key. Work out which one it is, but
- remembering that it's dead. */
-
- extra_dead = 0;
- err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
- mods[j] >> 8, keyboard_type,
- kUCKeyTranslateNoDeadKeysMask,
- &extra_dead, 8, &len, s);
- if (err != noErr)
- continue;
- }
-
- if (len > 0 && s[0] != 0x0010)
- {
- k[j] = ucs2keysym (s[0]);
-
- if (dead_key_state != 0)
- k[j] = make_dead_key (k[j]);
- }
- }
- else
- {
- UInt32 c, state = 0;
- UInt16 code;
-
- code = i | mods[j];
- c = KeyTranslate (chr_data, code, &state);
-
- /* Dead keys are only processed on key-down, so ask
- to translate those events. When we find a dead key,
- translating the matching key up event will give
- us the actual dead character. */
-
- if (state != 0)
- {
- UInt32 state2 = 0;
- c = KeyTranslate (chr_data, code | 128, &state2);
- }
-
- /* Characters seem to be in MacRoman encoding. */
-
- if (c != 0 && c != 0x0010)
- {
- k[j] = ucs2keysym (macroman2ucs (c & 255));
-
- if (state != 0)
- k[j] = make_dead_key (k[j]);
- }
- }
- }
-
- if (k[3] == k[2])
- k[3] = NoSymbol;
- if (k[2] == k[1])
- k[2] = NoSymbol;
- if (k[1] == k[0])
- k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3])
- k[2] = k[3] = NoSymbol;
- }
-
- /* Fix up some things that are normally missing.. */
-
- if (HACK_MISSING)
- {
- for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++)
- {
- k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY;
-
- if (k[0] == NoSymbol && k[1] == NoSymbol
- && k[2] == NoSymbol && k[3] == NoSymbol)
- {
- k[0] = known_keys[i].keysym;
- }
- }
- }
-
- /* And some more things. We find the right symbols for the numeric
- keypad, but not the KP_ keysyms. So try to convert known keycodes. */
-
- if (HACK_KEYPAD)
- {
- for (i = 0; i < sizeof (known_numeric_keys)
- / sizeof (known_numeric_keys[0]); i++)
- {
- k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
-
- if (k[0] == known_numeric_keys[i].normal)
- {
- k[0] = known_numeric_keys[i].keypad;
- }
- }
- }
-
- return TRUE;
-}
-
-#else /* !HAS_KL_API */
-
-Bool
-DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
-{
- return FALSE;
-}
-
-#endif /* HAS_KL_API */
diff --git a/hw/darwin/quartz/quartzPasteboard.c b/hw/darwin/quartz/quartzPasteboard.c
deleted file mode 100644
index 658832aa1..000000000
--- a/hw/darwin/quartz/quartzPasteboard.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/**************************************************************
- * quartzPasteboard.c
- *
- * Aqua pasteboard <-> X cut buffer
- * Greg Parker gparker@cs.stanford.edu March 8, 2001
- **************************************************************/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
-
-#include "quartzPasteboard.h"
-
-#include "Xatom.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "globals.h"
-
-extern Selection *CurrentSelections;
-extern int NumCurrentSelections;
-
-
-// Helper function to read the X11 cut buffer
-// FIXME: What about multiple screens? Currently, this reads the first
-// CUT_BUFFER0 from the first screen where the buffer content is a string.
-// Returns a string on the heap that the caller must free.
-// Returns NULL if there is no cut text or there is not enough memory.
-static char * QuartzReadCutBuffer(void)
-{
- int i;
- char *text = NULL;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- PropertyPtr pProp;
-
- pProp = wUserProps (WindowTable[pScreen->myNum]);
- while (pProp && pProp->propertyName != XA_CUT_BUFFER0) {
- pProp = pProp->next;
- }
- if (! pProp) continue;
- if (pProp->type != XA_STRING) continue;
- if (pProp->format != 8) continue;
-
- text = xalloc(1 + pProp->size);
- if (! text) continue;
- memcpy(text, pProp->data, pProp->size);
- text[pProp->size] = '\0';
- return text;
- }
-
- // didn't find any text
- return NULL;
-}
-
-// Write X cut buffer to Mac OS X pasteboard
-// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzWritePasteboard(void)
-{
- char *text;
- text = QuartzReadCutBuffer();
- if (text) {
- QuartzWriteCocoaPasteboard(text);
- free(text);
- }
-}
-
-#define strequal(a, b) (0 == strcmp((a), (b)))
-
-// Read Mac OS X pasteboard into X cut buffer
-// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzReadPasteboard(void)
-{
- char *oldText = QuartzReadCutBuffer();
- char *text = QuartzReadCocoaPasteboard();
-
- // Compare text with current cut buffer contents.
- // Change the buffer if both exist and are different
- // OR if there is new text but no old text.
- // Otherwise, don't clear the selection unnecessarily.
-
- if ((text && oldText && !strequal(text, oldText)) ||
- (text && !oldText)) {
- int scrn, sel;
-
- for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
- ScreenPtr pScreen = screenInfo.screens[scrn];
- // Set the cut buffers on each screen
- // fixme really on each screen?
- ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0,
- XA_STRING, 8, PropModeReplace,
- strlen(text), (pointer)text, TRUE);
- }
-
- // Undo any current X selection (similar to code in dispatch.c)
- // FIXME: what about secondary selection?
- // FIXME: only touch first XA_PRIMARY selection?
- sel = 0;
- while ((sel < NumCurrentSelections) &&
- CurrentSelections[sel].selection != XA_PRIMARY)
- sel++;
- if (sel < NumCurrentSelections) {
- // Notify client if necessary
- if (CurrentSelections[sel].client) {
- xEvent event;
-
- event.u.u.type = SelectionClear;
- event.u.selectionClear.time = GetTimeInMillis();
- event.u.selectionClear.window = CurrentSelections[sel].window;
- event.u.selectionClear.atom = CurrentSelections[sel].selection;
- TryClientEvents(CurrentSelections[sel].client, &event, 1,
- NoEventMask, NoEventMask /*CantBeFiltered*/,
- NullGrab);
- }
-
- // Erase it
- // FIXME: need to erase .selection too? dispatch.c doesn't
- CurrentSelections[sel].pWin = NullWindow;
- CurrentSelections[sel].window = None;
- CurrentSelections[sel].client = NullClient;
- }
- }
-
- if (text) free(text);
- if (oldText) free(oldText);
-}
diff --git a/hw/darwin/quartz/quartzPasteboard.h b/hw/darwin/quartz/quartzPasteboard.h
deleted file mode 100644
index fef375493..000000000
--- a/hw/darwin/quartz/quartzPasteboard.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- QuartzPasteboard.h
-
- Mac OS X pasteboard <-> X cut buffer
- Greg Parker gparker@cs.stanford.edu March 8, 2001
-*/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
-
-#ifndef _QUARTZPASTEBOARD_H
-#define _QUARTZPASTEBOARD_H
-
-// Aqua->X
-void QuartzReadPasteboard();
-char * QuartzReadCocoaPasteboard(void); // caller must free string
-
-// X->Aqua
-void QuartzWritePasteboard();
-void QuartzWriteCocoaPasteboard(char *text);
-
-#endif /* _QUARTZPASTEBOARD_H */ \ No newline at end of file
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
deleted file mode 100644
index bb7c7d214..000000000
--- a/hw/darwin/quartz/quartzStartup.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/**************************************************************
- *
- * Startup code for the Quartz Darwin X Server
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.9 2003/11/15 00:07:09 torrey Exp $ */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include "quartzCommon.h"
-#include "darwin.h"
-#include "quartz.h"
-#include "opaque.h"
-#include "micmap.h"
-
-int NSApplicationMain(int argc, char *argv[]);
-
-char **envpGlobal; // argcGlobal and argvGlobal
- // are from dix/globals.c
-
-// GLX bundle function pointers
-typedef void (*GlxExtensionInitPtr)(void);
-static GlxExtensionInitPtr GlxExtensionInit = NULL;
-
-typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
-static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
-
-typedef Bool (*QuartzModeBundleInitPtr)(void);
-
-
-/*
- * DarwinHandleGUI
- * This function is called first from main(). The first time
- * it is called we start the Mac OS X front end. The front end
- * will call main() again from another thread to run the X
- * server. On the second call this function loads the user
- * preferences set by the Mac OS X front end.
- */
-void DarwinHandleGUI(
- int argc,
- char *argv[],
- char *envp[] )
-{
- static Bool been_here = FALSE;
- int main_exit, i;
- int fd[2];
-
- if (been_here) {
- QuartzReadPreferences();
- return;
- }
- been_here = TRUE;
-
- // Make a pipe to pass events
- assert( pipe(fd) == 0 );
- darwinEventReadFD = fd[0];
- darwinEventWriteFD = fd[1];
- fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
-
- // Store command line arguments to pass back to main()
- argcGlobal = argc;
- argvGlobal = argv;
- envpGlobal = envp;
-
- quartzStartClients = 1;
- for (i = 1; i < argc; i++) {
- // Display version info without starting Mac OS X UI if requested
- if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
- DarwinPrintBanner();
- exit(0);
- }
-
- // Determine if we need to start X clients
- // and what display mode to use
- if (!strcmp(argv[i], "-nostartx")) {
- quartzStartClients = 0;
- } else if (!strcmp( argv[i], "-fullscreen")) {
- quartzRootless = 0;
- } else if (!strcmp( argv[i], "-rootless")) {
- quartzRootless = 1;
- }
- }
-
- main_exit = NSApplicationMain(argc, argv);
- exit(main_exit);
-}
-
-
-/*
- * QuartzLoadDisplayBundle
- * Try to load the appropriate bundle containing the back end display code.
- */
-Bool QuartzLoadDisplayBundle(
- const char *dpyBundleName)
-{
- CFBundleRef mainBundle;
- CFStringRef bundleName;
- CFURLRef bundleURL;
- CFBundleRef dpyBundle;
- QuartzModeBundleInitPtr bundleInit;
-
- // Get the main bundle for the application
- mainBundle = CFBundleGetMainBundle();
-
- // Make CFString from bundle name
- bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
- dpyBundleName,
- kCFStringEncodingASCII,
- kCFAllocatorNull);
-
- // Look for the appropriate bundle in the main bundle
- bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
- NULL, NULL);
- if (!bundleURL) {
- ErrorF("Could not find display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Make a bundle instance using the URLRef
- dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
-
- if (!CFBundleLoadExecutable(dpyBundle)) {
- ErrorF("Could not load display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Lookup the bundle initialization function
- bundleInit = (void *)
- CFBundleGetFunctionPointerForName(dpyBundle,
- CFSTR("QuartzModeBundleInit"));
- if (!bundleInit) {
- ErrorF("Could not initialize display mode bundle %s.\n",
- dpyBundleName);
- return FALSE;
- }
- if (!bundleInit())
- return FALSE;
-
- // Release the CF objects
- CFRelease(bundleName);
- CFRelease(bundleURL);
-
- return TRUE;
-}
-
-
-/*
- * LoadGlxBundle
- * The Quartz mode X server needs to dynamically load the appropriate
- * bundle before initializing GLX.
- */
-static void LoadGlxBundle(void)
-{
- CFBundleRef mainBundle;
- CFStringRef bundleName;
- CFURLRef bundleURL;
- CFBundleRef glxBundle;
-
- // Get the main bundle for the application
- mainBundle = CFBundleGetMainBundle();
-
- // Choose the bundle to load
- ErrorF("Loading GLX bundle ");
- if (quartzUseAGL) {
- bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
- quartzOpenGLBundle,
- kCFStringEncodingASCII,
- kCFAllocatorNull);
- ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle);
- } else {
- bundleName = CFSTR("glxMesa.bundle");
- CFRetain(bundleName); // so we can release later
- ErrorF("glxMesa.bundle (using Mesa)\n");
- }
-
- // Look for the appropriate GLX bundle in the main bundle by name
- bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
- NULL, NULL);
- if (!bundleURL) {
- FatalError("Could not find GLX bundle.");
- }
-
- // Make a bundle instance using the URLRef
- glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
-
- if (!CFBundleLoadExecutable(glxBundle)) {
- FatalError("Could not load GLX bundle.");
- }
-
- // Find the GLX init functions
- GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxExtensionInit"));
-
- GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxWrapInitVisuals"));
-
- if (!GlxExtensionInit || !GlxWrapInitVisuals) {
- FatalError("Could not initialize GLX bundle.");
- }
-
- // Release the CF objects
- CFRelease(bundleName);
- CFRelease(bundleURL);
-}
-
-
-/*
- * DarwinGlxExtensionInit
- * Initialize the GLX extension.
- */
-void DarwinGlxExtensionInit(void)
-{
- if (!GlxExtensionInit)
- LoadGlxBundle();
-
- GlxExtensionInit();
-}
-
-
-/*
- * DarwinGlxWrapInitVisuals
- */
-void DarwinGlxWrapInitVisuals(
- miInitVisualsProcPtr *procPtr)
-{
- if (!GlxWrapInitVisuals)
- LoadGlxBundle();
-
- GlxWrapInitVisuals(procPtr);
-}
-
-
-int DarwinModeProcessArgument( int argc, char *argv[], int i )
-{
- // fullscreen: CoreGraphics full-screen mode
- // rootless: Cocoa rootless mode
- // quartz: Default, either fullscreen or rootless
-
- if ( !strcmp( argv[i], "-fullscreen" ) ) {
- ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- if ( !strcmp( argv[i], "-rootless" ) ) {
- ErrorF( "Running rootless inside Mac OS X window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- if ( !strcmp( argv[i], "-quartz" ) ) {
- ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
-#ifdef QUARTZ_SAFETY_DELAY
- ErrorF( "Quitting in %d seconds if no controller is found.\n",
- QUARTZ_SAFETY_DELAY );
-#endif
- return 1;
- }
-
- // The Mac OS X front end uses this argument, which we just ignore here.
- if ( !strcmp( argv[i], "-nostartx" ) ) {
- return 1;
- }
-
- // This command line arg is passed when launched from the Aqua GUI.
- if ( !strncmp( argv[i], "-psn_", 5 ) ) {
- return 1;
- }
-
- return 0;
-} \ No newline at end of file
diff --git a/hw/darwin/quartz/xpr/Xplugin.h b/hw/darwin/quartz/xpr/Xplugin.h
deleted file mode 100644
index 8985f7b11..000000000
--- a/hw/darwin/quartz/xpr/Xplugin.h
+++ /dev/null
@@ -1,591 +0,0 @@
-/* Xplugin.h -- windowing API for rootless X11 server
- $Id$
-
- Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization.
-
- Note that these interfaces are provided solely for the use of the
- X11 server. Any other uses are unsupported and strongly discouraged. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.3 2003/06/27 20:21:42 torrey Exp $ */
-
-#ifndef XPLUGIN_H
-#define XPLUGIN_H 1
-
-#include <stdint.h>
-
-/* By default we use the X server definition of BoxRec to define xp_box,
- so that the compiler can silently convert between the two. But if
- XP_NO_X_HEADERS is defined, we'll define it ourselves. */
-
-#ifndef XP_NO_X_HEADERS
-# include "miscstruct.h"
- typedef BoxRec xp_box;
-#else
- struct xp_box_struct {
- short x1, y1, x2, y2;
- };
- typedef struct xp_box_struct xp_box;
-#endif
-
-typedef unsigned int xp_resource_id;
-typedef xp_resource_id xp_window_id;
-typedef xp_resource_id xp_surface_id;
-typedef unsigned int xp_client_id;
-typedef unsigned int xp_request_type;
-typedef int xp_error;
-typedef int xp_bool;
-
-
-/* Error codes that the functions declared here may return. They all
- numerically match their X equivalents, i.e. the XP_ can be dropped
- if <X11/X.h> has been included. */
-
-enum xp_error_enum {
- XP_Success = 0,
- XP_BadRequest = 1,
- XP_BadValue = 2,
- XP_BadWindow = 3,
- XP_BadMatch = 8,
- XP_BadAccess = 10,
- XP_BadImplementation = 17,
-};
-
-
-/* Event types generated by the plugin. */
-
-enum xp_event_type_enum {
- /* The global display configuration changed somehow. */
- XP_EVENT_DISPLAY_CHANGED = 1 << 0,
-
- /* A window changed state. Argument is xp_window_state_event */
- XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1,
-
- /* An async request encountered an error. Argument is of type
- xp_async_error_event */
- XP_EVENT_ASYNC_ERROR = 1 << 2,
-
- /* Sent when a surface is destroyed as a side effect of destroying
- a window. Arg is of type xp_surface_id. */
- XP_EVENT_SURFACE_DESTROYED = 1 << 3,
-
- /* Sent when any GL contexts pointing at the given surface need to
- call xp_update_gl_context () to refresh their state (because the
- window moved or was resized. Arg is of type xp_surface_id. */
- XP_EVENT_SURFACE_CHANGED = 1 << 4,
-
- /* Sent when a window has been moved. Arg is of type xp_window_id. */
- XP_EVENT_WINDOW_MOVED = 1 << 5,
-};
-
-/* Function type used to receive events. */
-
-typedef void (xp_event_fun) (unsigned int type, const void *arg,
- unsigned int arg_size, void *user_data);
-
-
-/* Operation types. Used when reporting errors asynchronously. */
-
-enum xp_request_type_enum {
- XP_REQUEST_NIL = 0,
- XP_REQUEST_DESTROY_WINDOW = 1,
- XP_REQUEST_CONFIGURE_WINDOW = 2,
- XP_REQUEST_FLUSH_WINDOW = 3,
- XP_REQUEST_COPY_WINDOW = 4,
- XP_REQUEST_UNLOCK_WINDOW = 5,
- XP_REQUEST_DISABLE_UPDATE = 6,
- XP_REQUEST_REENABLE_UPDATE = 7,
- XP_REQUEST_HIDE_CURSOR = 8,
- XP_REQUEST_SHOW_CURSOR = 9,
- XP_REQUEST_FRAME_DRAW = 10,
-};
-
-/* Structure used to report an error asynchronously. Passed as the "arg"
- of an XP_EVENT_ASYNC_ERROR event. */
-
-struct xp_async_error_event_struct {
- xp_request_type request_type;
- xp_resource_id id;
- xp_error error;
-};
-
-typedef struct xp_async_error_event_struct xp_async_error_event;
-
-
-/* Possible window states. */
-
-enum xp_window_state_enum {
- /* The window is not in the global list of possibly-visible windows. */
- XP_WINDOW_STATE_OFFSCREEN = 1 << 0,
-
- /* Parts of the window may be obscured by other windows. */
- XP_WINDOW_STATE_OBSCURED = 1 << 1,
-};
-
-/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */
-
-struct xp_window_state_event_struct {
- xp_window_id id;
- unsigned int state;
-};
-
-typedef struct xp_window_state_event_struct xp_window_state_event;
-
-
-/* Function type used to supply a colormap for indexed drawables. */
-
-typedef xp_error (xp_colormap_fun) (void *data, int first_color,
- int n_colors, uint32_t *colors);
-
-
-/* Window attributes structure. Used when creating and configuring windows.
- Also used when configuring surfaces attached to windows. Functions that
- take one of these structures also take a bit mask defining which
- fields are set to meaningful values. */
-
-enum xp_window_changes_enum {
- XP_ORIGIN = 1 << 0,
- XP_SIZE = 1 << 1,
- XP_BOUNDS = XP_ORIGIN | XP_SIZE,
- XP_SHAPE = 1 << 2,
- XP_STACKING = 1 << 3,
- XP_DEPTH = 1 << 4,
- XP_COLORMAP = 1 << 5,
- XP_WINDOW_LEVEL = 1 << 6,
-};
-
-struct xp_window_changes_struct {
- /* XP_ORIGIN */
- int x, y;
-
- /* XP_SIZE */
- unsigned int width, height;
- int bit_gravity; /* how to resize the backing store */
-
- /* XP_SHAPE */
- int shape_nrects; /* -1 = remove shape */
- xp_box *shape_rects;
- int shape_tx, shape_ty; /* translation for shape */
-
- /* XP_STACKING */
- int stack_mode;
- xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes
- it may specify a relative window */
- /* XP_DEPTH, window-only */
- unsigned int depth;
-
- /* XP_COLORMAP, window-only */
- xp_colormap_fun *colormap;
- void *colormap_data;
-
- /* XP_WINDOW_LEVEL, window-only */
- int window_level;
-};
-
-typedef struct xp_window_changes_struct xp_window_changes;
-
-/* Values for bit_gravity field */
-
-enum xp_bit_gravity_enum {
- XP_GRAVITY_NONE = 0, /* no gravity, fill everything */
- XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
- XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
- XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
- XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
-};
-
-/* Values for stack_mode field */
-
-enum xp_window_stack_mode_enum {
- XP_UNMAPPED = 0, /* remove the window */
- XP_MAPPED_ABOVE = 1, /* display the window on top */
- XP_MAPPED_BELOW = 2, /* display the window at bottom */
-};
-
-/* Data formats for depth field and composite functions */
-
-enum xp_depth_enum {
- XP_DEPTH_NIL = 0, /* null source when compositing */
- XP_DEPTH_ARGB8888,
- XP_DEPTH_RGB555,
- XP_DEPTH_A8, /* for masks when compositing */
- XP_DEPTH_INDEX8,
-};
-
-/* Options that may be passed to the xp_init () function. */
-
-enum xp_init_options_enum {
- /* Don't mark that this process can be in the foreground. */
- XP_IN_BACKGROUND = 1 << 0,
-
- /* Deliver background pointer events to this process. */
- XP_BACKGROUND_EVENTS = 1 << 1,
-};
-
-
-
-/* Miscellaneous functions */
-
-/* Initialize the plugin library. Only the copy/fill/composite functions
- may be called without having previously called xp_init () */
-
-extern xp_error xp_init (unsigned int options);
-
-/* Sets the current set of requested notifications to MASK. When any of
- these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that
- calling this function cancels any previously requested notifications
- that aren't set in MASK. */
-
-extern xp_error xp_select_events (unsigned int mask,
- xp_event_fun *callback,
- void *callback_data);
-
-/* Waits for all initiated operations to complete. */
-
-extern xp_error xp_synchronize (void);
-
-/* Causes any display update initiated through the plugin libary to be
- queued until update is reenabled. Note that calls to these functions
- nest. */
-
-extern xp_error xp_disable_update (void);
-extern xp_error xp_reenable_update (void);
-
-
-
-/* Cursor functions. */
-
-/* Installs the specified cursor. ARGB-DATA should point to 32-bit
- premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters
- specify the offset to the cursor's hot spot from its top-left
- corner. */
-
-extern xp_error xp_set_cursor (unsigned int width, unsigned int height,
- unsigned int hot_x, unsigned int hot_y,
- const uint32_t *argb_data,
- unsigned int rowbytes);
-
-/* Hide and show the cursor if it's owned by the current process. Calls
- to these functions nest. */
-
-extern xp_error xp_hide_cursor (void);
-extern xp_error xp_show_cursor (void);
-
-
-
-/* Window functions. */
-
-/* Create a new window as defined by MASK and VALUES. MASK must contain
- XP_BOUNDS or an error is raised. The id of the newly created window
- is stored in *RET-ID if this function returns XP_Success. */
-
-extern xp_error xp_create_window (unsigned int mask,
- const xp_window_changes *values,
- xp_window_id *ret_id);
-
-/* Destroys the window identified by ID. */
-
-extern xp_error xp_destroy_window (xp_window_id id);
-
-/* Reconfigures the given window according to MASK and VALUES. */
-
-extern xp_error xp_configure_window (xp_window_id id, unsigned int mask,
- const xp_window_changes *values);
-
-
-/* Returns true if NATIVE-ID is a window created by the plugin library.
- If so and RET-ID is non-null, stores the id of the window in *RET-ID. */
-
-extern xp_bool xp_lookup_native_window (unsigned int native_id,
- xp_window_id *ret_id);
-
-/* If ID names a window created by the plugin library, stores it's native
- window id in *RET-NATIVE-ID. */
-
-extern xp_error xp_get_native_window (xp_window_id id,
- unsigned int *ret_native_id);
-
-
-/* Locks the rectangle IN-RECT (or, if null, the entire window) of the
- given window's backing store. Any other non-null parameters are filled
- in as follows:
-
- DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888
- or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is
- always stored in native byte order.
-
- BITS[0] = pointer to top-left pixel of locked color data
- BITS[1] = pointer to top-left of locked alpha data, or null if window
- has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0].
-
- ROWBYTES[0,1] = size in bytes of each row of color,alpha data
-
- OUT-RECT = rectangle specifying the current position and size of the
- locked region relative to the window origin.
-
- Note that an error is raised when trying to lock an already locked
- window. While the window is locked, the only operations that may
- be performed on it are to modify, access or flush its marked region. */
-
-extern xp_error xp_lock_window (xp_window_id id,
- const xp_box *in_rect,
- unsigned int *depth,
- void *bits[2],
- unsigned int rowbytes[2],
- xp_box *out_rect);
-
-/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS,
- SHAPE-TX, and SHAPE-TY in the specified window has been updated, and
- will need to subsequently be redisplayed. */
-
-extern xp_error xp_mark_window (xp_window_id id, int shape_nrects,
- const xp_box *shape_rects,
- int shape_tx, int shape_ty);
-
-/* Unlocks the specified window. If FLUSH is true, then any marked
- regions are immediately redisplayed. Note that it's an error to
- unlock an already unlocked window. */
-
-extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush);
-
-/* If anything is marked in the given window for redisplay, do it now. */
-
-extern xp_error xp_flush_window (xp_window_id id);
-
-/* Moves the contents of the region DX,DY pixels away from that specified
- by DST_RECTS and DST_NRECTS in the window with SRC-ID to the
- destination region in the window DST-ID. Note that currently source
- and destination windows must be the same. */
-
-extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id,
- int dst_nrects, const xp_box *dst_rects,
- int dx, int dy);
-
-/* Returns true if the given window has any regions marked for
- redisplay. */
-
-extern xp_bool xp_is_window_marked (xp_window_id id);
-
-/* If successful returns a superset of the region marked for update in
- the given window. Use xp_free_region () to release the returned data. */
-
-extern xp_error xp_get_marked_shape (xp_window_id id,
- int *ret_nrects, xp_box **ret_rects);
-
-extern void xp_free_shape (int nrects, xp_box *rects);
-
-/* Searches for the first window below ABOVE-ID containing the point X,Y,
- and returns it's window id in *RET-ID. If no window is found, *RET-ID
- is set to zero. If ABOVE-ID is zero, finds the topmost window
- containing the given point. */
-
-extern xp_error xp_find_window (int x, int y, xp_window_id above_id,
- xp_window_id *ret_id);
-
-/* Returns the current origin and size of the window ID in *BOUNDS-RET if
- successful. */
-extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret);
-
-
-
-/* Window surface functions. */
-
-/* Create a new VRAM surface on the specified window. If successful,
- returns the identifier of the new surface in *RET-SID. */
-
-extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid);
-
-/* Destroys the specified surface. */
-
-extern xp_error xp_destroy_surface (xp_surface_id sid);
-
-/* Reconfigures the specified surface as defined by MASK and VALUES.
- Note that specifying XP_DEPTH is an error. */
-
-extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask,
- const xp_window_changes *values);
-
-/* If successful, places the client identifier of the current process
- in *RET-CLIENT. */
-
-extern xp_error xp_get_client_id (xp_client_id *ret_client);
-
-/* Given a valid window,surface combination created by the current
- process, attempts to allow the specified external client access
- to that surface. If successful, returns two integers in RET-KEY
- which the client can use to import the surface into their process. */
-
-extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid,
- xp_client_id client,
- unsigned int ret_key[2]);
-
-/* Given a two integer key returned from xp_export_surface (), tries
- to import the surface into the current process. If successful the
- local surface identifier is stored in *SID-RET. */
-
-extern xp_error xp_import_surface (const unsigned int key[2],
- xp_surface_id *sid_ret);
-
-/* If successful, stores the number of surfaces attached to the
- specified window in *RET. */
-
-extern xp_error xp_get_window_surface_count (xp_window_id id,
- unsigned int *ret);
-
-/* Attaches the CGLContextObj CGL-CTX to the specified surface. */
-
-extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid);
-
-/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to
- the surface it's attached to. */
-
-extern xp_error xp_update_gl_context (void *cgl_ctx);
-
-
-
-/* Window frame functions. */
-
-/* Possible arguments to xp_frame_get_rect (). */
-
-enum xp_frame_rect_enum {
- XP_FRAME_RECT_TITLEBAR = 1,
- XP_FRAME_RECT_TRACKING = 2,
- XP_FRAME_RECT_GROWBOX = 3,
-};
-
-/* Classes of window frame. */
-
-enum xp_frame_class_enum {
- XP_FRAME_CLASS_DOCUMENT = 1 << 0,
- XP_FRAME_CLASS_DIALOG = 1 << 1,
- XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2,
- XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3,
- XP_FRAME_CLASS_UTILITY = 1 << 4,
- XP_FRAME_CLASS_TOOLBAR = 1 << 5,
- XP_FRAME_CLASS_MENU = 1 << 6,
- XP_FRAME_CLASS_SPLASH = 1 << 7,
- XP_FRAME_CLASS_BORDERLESS = 1 << 8,
-};
-
-/* Attributes of window frames. */
-
-enum xp_frame_attr_enum {
- XP_FRAME_ACTIVE = 0x0001,
- XP_FRAME_URGENT = 0x0002,
- XP_FRAME_TITLE = 0x0004,
- XP_FRAME_PRELIGHT = 0x0008,
- XP_FRAME_SHADED = 0x0010,
- XP_FRAME_CLOSE_BOX = 0x0100,
- XP_FRAME_COLLAPSE = 0x0200,
- XP_FRAME_ZOOM = 0x0400,
- XP_FRAME_ANY_BUTTON = 0x0700,
- XP_FRAME_CLOSE_BOX_CLICKED = 0x0800,
- XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000,
- XP_FRAME_ZOOM_BOX_CLICKED = 0x2000,
- XP_FRAME_ANY_CLICKED = 0x3800,
- XP_FRAME_GROW_BOX = 0x4000,
-};
-
-#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b))
-#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3))
-#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3))
-#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3))
-
-#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \
- | XP_FRAME_ANY_BUTTON \
- | XP_FRAME_ANY_CLICKED)
-
-extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer,
- const xp_box *inner, xp_box *ret);
-extern xp_error xp_frame_hit_test (int class, int x, int y,
- const xp_box *outer,
- const xp_box *inner, int *ret);
-extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr,
- const xp_box *outer, const xp_box *inner,
- unsigned int title_len,
- const unsigned char *title_bytes);
-
-
-
-/* Memory manipulation functions. */
-
-enum xp_composite_op_enum {
- XP_COMPOSITE_SRC = 0,
- XP_COMPOSITE_OVER,
-};
-
-#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
- (((op) << 24) | ((src_depth) << 16) \
- | ((mask_depth) << 8) | ((dest_depth) << 0))
-
-#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255)
-#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255)
-#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255)
-#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255)
-
-/* Composite WIDTH by HEIGHT pixels from source and mask to destination
- using a specified function (if source and destination overlap,
- undefined behavior results).
-
- For SRC and DEST, the first element of the array is the color data. If
- the second element is non-null it implies that there is alpha data
- (which may be meshed or planar). Data without alpha is assumed to be
- opaque.
-
- Passing a null SRC-ROWBYTES pointer implies that the data SRC points
- to is a single element.
-
- Operations that are not supported will return XP_BadImplementation. */
-
-extern xp_error xp_composite_pixels (unsigned int width, unsigned int height,
- unsigned int function,
- void *src[2], unsigned int src_rowbytes[2],
- void *mask, unsigned int mask_rowbytes,
- void *dest[2], unsigned int dest_rowbytes[2]);
-
-/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH
- bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES
- wide in total. */
-
-extern void xp_fill_bytes (unsigned int width,
- unsigned int height, uint32_t value,
- void *dst, unsigned int dst_rowbytes);
-
-/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH
- bytes copied. SRC and DST may overlap, and the right thing will happen. */
-
-extern void xp_copy_bytes (unsigned int width, unsigned int height,
- const void *src, unsigned int src_rowbytes,
- void *dst, unsigned int dst_rowbytes);
-
-/* Suggestions for the minimum number of bytes or pixels for which it
- makes sense to use some of the xp_ functions */
-
-extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold,
- xp_composite_area_threshold, xp_scroll_area_threshold;
-
-
-#endif /* XPLUGIN_H */
diff --git a/hw/darwin/quartz/xpr/appledri.c b/hw/darwin/quartz/xpr/appledri.c
deleted file mode 100644
index 3062d964a..000000000
--- a/hw/darwin/quartz/xpr/appledri.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright (c) 2002 Apple Computer, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@valinux.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _APPLEDRI_SERVER_
-#include "appledristr.h"
-#include "swaprep.h"
-#include "dri.h"
-#include "dristruct.h"
-
-static int DRIErrorBase = 0;
-
-static DISPATCH_PROC(ProcAppleDRIDispatch);
-static DISPATCH_PROC(SProcAppleDRIDispatch);
-
-static void AppleDRIResetProc(ExtensionEntry* extEntry);
-
-static unsigned char DRIReqCode = 0;
-static int DRIEventBase = 0;
-
-static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to);
-
-typedef struct _DRIEvent *DRIEventPtr;
-typedef struct _DRIEvent {
- DRIEventPtr next;
- ClientPtr client;
- XID clientResource;
- unsigned int mask;
-} DRIEventRec;
-
-
-void
-AppleDRIExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
- if (DRIExtensionInit() &&
- (extEntry = AddExtension(APPLEDRINAME,
- AppleDRINumberEvents,
- AppleDRINumberErrors,
- ProcAppleDRIDispatch,
- SProcAppleDRIDispatch,
- AppleDRIResetProc,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- DRIEventBase = extEntry->eventBase;
- EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
- }
-}
-
-/*ARGSUSED*/
-static void
-AppleDRIResetProc (
- ExtensionEntry* extEntry
-)
-{
- DRIReset();
-}
-
-static int
-ProcAppleDRIQueryVersion(
- register ClientPtr client
-)
-{
- xAppleDRIQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = APPLE_DRI_MAJOR_VERSION;
- rep.minorVersion = APPLE_DRI_MINOR_VERSION;
- rep.patchVersion = APPLE_DRI_PATCH_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-
-/* surfaces */
-
-static int
-ProcAppleDRIQueryDirectRenderingCapable(
- register ClientPtr client
-)
-{
- xAppleDRIQueryDirectRenderingCapableReply rep;
- Bool isCapable;
-
- REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
- REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
- &isCapable)) {
- return BadValue;
- }
- rep.isCapable = isCapable;
-
- if (!LocalClient(client))
- rep.isCapable = 0;
-
- WriteToClient(client,
- sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcAppleDRIAuthConnection(
- register ClientPtr client
-)
-{
- xAppleDRIAuthConnectionReply rep;
-
- REQUEST(xAppleDRIAuthConnectionReq);
- REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.authenticated = 1;
-
- if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
- ErrorF("Failed to authenticate %u\n", stuff->magic);
- rep.authenticated = 0;
- }
- WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static void surface_notify(
- void *_arg,
- void *data
-)
-{
- DRISurfaceNotifyArg *arg = _arg;
- int client_index = (int) data;
- ClientPtr client;
- xAppleDRINotifyEvent se;
-
- if (client_index < 0 || client_index >= currentMaxClients)
- return;
-
- client = clients[client_index];
- if (client == NULL || client == serverClient || client->clientGone)
- return;
-
- se.type = DRIEventBase + AppleDRISurfaceNotify;
- se.kind = arg->kind;
- se.arg = arg->id;
- se.sequenceNumber = client->sequence;
- se.time = currentTime.milliseconds;
- WriteEventsToClient (client, 1, (xEvent *) &se);
-}
-
-static int
-ProcAppleDRICreateSurface(
- ClientPtr client
-)
-{
- xAppleDRICreateSurfaceReply rep;
- DrawablePtr pDrawable;
- xp_surface_id sid;
- unsigned int key[2];
-
- REQUEST(xAppleDRICreateSurfaceReq);
- REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
- (Drawable)stuff->drawable,
- client,
- SecurityReadAccess))) {
- return BadValue;
- }
-
- rep.key_0 = rep.key_1 = rep.uid = 0;
-
- if (!DRICreateSurface( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable, pDrawable,
- stuff->client_id, &sid, key,
- surface_notify, (void *) client->index)) {
- return BadValue;
- }
-
- rep.key_0 = key[0];
- rep.key_1 = key[1];
- rep.uid = sid;
-
- WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcAppleDRIDestroySurface(
- register ClientPtr client
-)
-{
- REQUEST(xAppleDRIDestroySurfaceReq);
- DrawablePtr pDrawable;
- REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
-
- if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
- (Drawable)stuff->drawable,
- client,
- SecurityReadAccess))) {
- return BadValue;
- }
-
- if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable,
- pDrawable, NULL, NULL)) {
- return BadValue;
- }
-
- return (client->noClientException);
-}
-
-
-/* dispatch */
-
-static int
-ProcAppleDRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_AppleDRIQueryVersion:
- return ProcAppleDRIQueryVersion(client);
- case X_AppleDRIQueryDirectRenderingCapable:
- return ProcAppleDRIQueryDirectRenderingCapable(client);
- }
-
- if (!LocalClient(client))
- return DRIErrorBase + AppleDRIClientNotLocal;
-
- switch (stuff->data)
- {
- case X_AppleDRIAuthConnection:
- return ProcAppleDRIAuthConnection(client);
- case X_AppleDRICreateSurface:
- return ProcAppleDRICreateSurface(client);
- case X_AppleDRIDestroySurface:
- return ProcAppleDRIDestroySurface(client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SNotifyEvent(
- xAppleDRINotifyEvent *from,
- xAppleDRINotifyEvent *to
-)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->time, to->time);
- cpswapl (from->arg, to->arg);
-}
-
-static int
-SProcAppleDRIQueryVersion(
- register ClientPtr client
-)
-{
- register int n;
- REQUEST(xAppleDRIQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcAppleDRIQueryVersion(client);
-}
-
-static int
-SProcAppleDRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return DRIErrorBase + AppleDRIClientNotLocal;
-
- /* only local clients are allowed DRI access */
- switch (stuff->data)
- {
- case X_AppleDRIQueryVersion:
- return SProcAppleDRIQueryVersion(client);
- default:
- return BadRequest;
- }
-}
diff --git a/hw/darwin/quartz/xpr/dri.c b/hw/darwin/quartz/xpr/dri.c
deleted file mode 100644
index aa595af85..000000000
--- a/hw/darwin/quartz/xpr/dri.c
+++ /dev/null
@@ -1,690 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright (c) 2002 Apple Computer, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@valinux.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#else
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-#define _APPLEDRI_SERVER_
-#include "appledristr.h"
-#include "swaprep.h"
-#include "dri.h"
-#include "dristruct.h"
-#include "mi.h"
-#include "mipointer.h"
-#include "rootless.h"
-#include "x-hash.h"
-#include "x-hook.h"
-
-static int DRIScreenPrivIndex = -1;
-static int DRIWindowPrivIndex = -1;
-
-static RESTYPE DRIDrawablePrivResType;
-
-static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */
-
-/* FIXME: don't hardcode this? */
-#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist"
-
-/* Corresponds to SU Jaguar Green */
-#define CG_REQUIRED_MAJOR 1
-#define CG_REQUIRED_MINOR 157
-#define CG_REQUIRED_MICRO 11
-
-/* Returns version as major.minor.micro in 10.10.10 fixed form */
-static unsigned int
-get_cg_version (void)
-{
- static unsigned int version;
-
- FILE *fh;
- char *ptr;
-
- if (version != 0)
- return version;
-
- /* I tried CFBundleGetVersion, but it returns zero, so.. */
-
- fh = fopen (CG_INFO_FILE, "r");
- if (fh != NULL)
- {
- char buf[256];
-
- while (fgets (buf, sizeof (buf), fh) != NULL)
- {
- unsigned char c;
-
- if (!strstr (buf, "<key>CFBundleShortVersionString</key>")
- || fgets (buf, sizeof (buf), fh) == NULL)
- {
- continue;
- }
-
- ptr = strstr (buf, "<string>");
- if (ptr == NULL)
- continue;
-
- ptr += strlen ("<string>");
-
- /* Now PTR points to "MAJOR.MINOR.MICRO". */
-
- version = 0;
-
- again:
- switch ((c = *ptr++))
- {
- case '.':
- version = version * 1024;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- version = ((version & ~0x3ff)
- + (version & 0x3ff) * 10 + (c - '0'));
- goto again;
- }
- break;
- }
-
- fclose (fh);
- }
-
- return version;
-}
-
-static Bool
-test_cg_version (unsigned int major, unsigned int minor, unsigned int micro)
-{
- unsigned int cg_ver = get_cg_version ();
-
- unsigned int cg_major = (cg_ver >> 20) & 0x3ff;
- unsigned int cg_minor = (cg_ver >> 10) & 0x3ff;
- unsigned int cg_micro = cg_ver & 0x3ff;
-
- if (cg_major > major)
- return TRUE;
- else if (cg_major < major)
- return FALSE;
-
- /* cg_major == major */
-
- if (cg_minor > minor)
- return TRUE;
- else if (cg_minor < minor)
- return FALSE;
-
- /* cg_minor == minor */
-
- if (cg_micro < micro)
- return FALSE;
-
- return TRUE;
-}
-
-Bool
-DRIScreenInit(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv;
- int i;
-
- pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
- if (!pDRIPriv) {
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- return FALSE;
- }
-
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv;
- pDRIPriv->directRenderingSupport = TRUE;
- pDRIPriv->nrWindows = 0;
-
- /* Need recent cg for window access update */
- if (!test_cg_version (CG_REQUIRED_MAJOR,
- CG_REQUIRED_MINOR,
- CG_REQUIRED_MICRO))
- {
- ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n",
- CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO);
-
- pDRIPriv->directRenderingSupport = FALSE;
-
- /* Note we don't nuke the dri private, since we need it for
- managing indirect surfaces. */
- }
-
- /* Initialize drawable tables */
- for (i = 0; i < DRI_MAX_DRAWABLES; i++) {
- pDRIPriv->DRIDrawables[i] = NULL;
- }
-
- return TRUE;
-}
-
-Bool
-DRIFinishScreenInit(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- /* Allocate zero sized private area for each window. Should a window
- * become a DRI window, we'll hang a DRIWindowPrivateRec off of this
- * private index.
- */
- if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0))
- return FALSE;
-
- /* Wrap DRI support */
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = DRIValidateTree;
-
- pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = DRIPostValidateTree;
-
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = DRIWindowExposures;
-
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = DRICopyWindow;
-
- pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
- pScreen->ClipNotify = DRIClipNotify;
-
- ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
-
- return TRUE;
-}
-
-void
-DRICloseScreen(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv && pDRIPriv->directRenderingSupport) {
- xfree(pDRIPriv);
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- }
-}
-
-Bool
-DRIExtensionInit(void)
-{
- static unsigned long DRIGeneration = 0;
-
- if (DRIGeneration != serverGeneration) {
- if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- DRIGeneration = serverGeneration;
- }
-
- /* Allocate a window private index with a zero sized private area for
- * each window, then should a window become a DRI window, we'll hang
- * a DRIWindowPrivateRec off of this private index.
- */
- if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
- return FALSE;
-
- DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
-
- return TRUE;
-}
-
-void
-DRIReset(void)
-{
- /*
- * This stub routine is called when the X Server recycles, resources
- * allocated by DRIExtensionInit need to be managed here.
- *
- * Currently this routine is a stub because all the interesting resources
- * are managed via the screen init process.
- */
-}
-
-Bool
-DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv)
- *isCapable = pDRIPriv->directRenderingSupport;
- else
- *isCapable = FALSE;
-
- return TRUE;
-}
-
-Bool
-DRIAuthConnection(ScreenPtr pScreen, unsigned int magic)
-{
-#if 0
- /* FIXME: something? */
-
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
-#endif
- return TRUE;
-}
-
-static void
-DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, WindowPtr pWin)
-{
- WindowPtr pTopWin;
- xp_window_changes wc;
-
- if (pDRIDrawablePriv->sid == 0)
- return;
-
- pTopWin = TopLevelParent(pWin);
-
- wc.x = pWin->drawable.x - (pTopWin->drawable.x - pTopWin->borderWidth);
- wc.y = pWin->drawable.y - (pTopWin->drawable.y - pTopWin->borderWidth);
- wc.width = pWin->drawable.width + 2 * pWin->borderWidth;
- wc.height = pWin->drawable.height + 2 * pWin->borderWidth;
- wc.bit_gravity = XP_GRAVITY_NONE;
-
- wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList);
- wc.shape_rects = REGION_RECTS(&pWin->clipList);
- wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth);
- wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth);
-
- xp_configure_surface(pDRIDrawablePriv->sid, XP_BOUNDS | XP_SHAPE, &wc);
-}
-
-Bool
-DRICreateSurface (ScreenPtr pScreen, Drawable id,
- DrawablePtr pDrawable, xp_client_id client_id,
- xp_surface_id *surface_id, unsigned int ret_key[2],
- void (*notify) (void *arg, void *data), void *notify_data)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
- pDRIDrawablePriv->refCount++;
- }
- else {
- xp_window_id wid;
- xp_surface_id sid;
- xp_error err;
- unsigned int key[2];
- xp_window_changes wc;
-
- /* allocate a DRI Window Private record */
- if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
- return FALSE;
- }
-
- /* find the physical window */
- wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE);
- if (wid == 0) {
- xfree (pDRIDrawablePriv);
- return FALSE;
- }
-
- /* allocate the physical surface */
- err = xp_create_surface (wid, &sid);
- if (err != Success) {
- xfree (pDRIDrawablePriv);
- return FALSE;
- }
-
- /* try to give the client access to the surface */
- if (client_id != 0)
- {
- err = xp_export_surface (wid, sid, client_id, key);
- if (err != Success) {
- xp_destroy_surface (sid);
- xfree (pDRIDrawablePriv);
- return FALSE;
- }
- }
-
- /* Make it visible */
- wc.stack_mode = XP_MAPPED_ABOVE;
- wc.sibling = 0;
- err = xp_configure_surface (sid, XP_STACKING, &wc);
- if (err != Success)
- {
- xp_destroy_surface (sid);
- xfree (pDRIDrawablePriv);
- return FALSE;
- }
-
- /* add it to the list of DRI drawables for this screen */
- pDRIDrawablePriv->sid = sid;
- pDRIDrawablePriv->pDraw = pDrawable;
- pDRIDrawablePriv->pScreen = pScreen;
- pDRIDrawablePriv->refCount = 1;
- pDRIDrawablePriv->drawableIndex = -1;
- pDRIDrawablePriv->key[0] = key[0];
- pDRIDrawablePriv->key[1] = key[1];
- pDRIDrawablePriv->notifiers = NULL;
-
- /* save private off of preallocated index */
- pWin->devPrivates[DRIWindowPrivIndex].ptr =
- (pointer)pDRIDrawablePriv;
-
- ++pDRIPriv->nrWindows;
-
- /* and stash it by surface id */
- if (surface_hash == NULL)
- surface_hash = x_hash_table_new (NULL, NULL, NULL, NULL);
- x_hash_table_insert (surface_hash, (void *) sid, pDRIDrawablePriv);
-
- /* track this in case this window is destroyed */
- AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
-
- /* Initialize shape */
- DRIUpdateSurface (pDRIDrawablePriv, pWin);
- }
-
- if (notify != NULL) {
- pDRIDrawablePriv->notifiers
- = x_hook_add (pDRIDrawablePriv->notifiers,
- notify, notify_data);
- }
-
- *surface_id = pDRIDrawablePriv->sid;
-
- if (ret_key != NULL)
- {
- ret_key[0] = pDRIDrawablePriv->key[0];
- ret_key[1] = pDRIDrawablePriv->key[1];
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
- void (*notify) (void *, void *), void *notify_data)
-{
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
- if (pDRIDrawablePriv != NULL) {
- if (notify != NULL)
- {
- pDRIDrawablePriv->notifiers
- = x_hook_remove (pDRIDrawablePriv->notifiers,
- notify, notify_data);
- }
- if (--pDRIDrawablePriv->refCount <= 0) {
- /* This calls back to DRIDrawablePrivDelete
- which frees the private area */
- FreeResourceByType(id, DRIDrawablePrivResType, FALSE);
- }
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIDrawablePrivDelete(pointer pResource, XID id)
-{
- DrawablePtr pDrawable = (DrawablePtr)pResource;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
-
- if (pDRIDrawablePriv->drawableIndex != -1) {
- /* release drawable table entry */
- pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
- }
-
- if (pDRIDrawablePriv->sid != 0) {
- xp_destroy_surface (pDRIDrawablePriv->sid);
- x_hash_table_remove (surface_hash, (void *) pDRIDrawablePriv->sid);
- }
-
- if (pDRIDrawablePriv->notifiers != NULL)
- x_hook_free (pDRIDrawablePriv->notifiers);
-
- xfree(pDRIDrawablePriv);
- pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL;
-
- --pDRIPriv->nrWindows;
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-void
-DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
-
- if(pDRIDrawablePriv) {
- /* FIXME: something? */
- }
-
- pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
-
- (*pScreen->WindowExposures)(pWin, prgn, bsreg);
-
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = DRIWindowExposures;
-
-}
-
-void
-DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
-
- if (pDRIPriv->nrWindows > 0) {
- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW (pWin);
- if (pDRIDrawablePriv != NULL) {
- DRIUpdateSurface (pDRIDrawablePriv, pWin);
- }
- }
-
- /* unwrap */
- pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
-
- /* call lower layers */
- (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
-
- /* rewrap */
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = DRICopyWindow;
-}
-
-int
-DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- ScreenPtr pScreen = pParent->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- int returnValue;
-
- /* unwrap */
- pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
-
- /* call lower layers */
- returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
-
- /* rewrap */
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = DRIValidateTree;
-
- return returnValue;
-}
-
-void
-DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- ScreenPtr pScreen;
- DRIScreenPrivPtr pDRIPriv;
-
- if (pParent) {
- pScreen = pParent->drawable.pScreen;
- } else {
- pScreen = pChild->drawable.pScreen;
- }
- pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv->wrap.PostValidateTree) {
- /* unwrap */
- pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
-
- /* call lower layers */
- (*pScreen->PostValidateTree)(pParent, pChild, kind);
-
- /* rewrap */
- pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = DRIPostValidateTree;
- }
-}
-
-void
-DRIClipNotify(WindowPtr pWin, int dx, int dy)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
-
- if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
- DRIUpdateSurface (pDRIDrawablePriv, pWin);
- }
-
- if(pDRIPriv->wrap.ClipNotify) {
- pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
-
- (*pScreen->ClipNotify)(pWin, dx, dy);
-
- pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
- pScreen->ClipNotify = DRIClipNotify;
- }
-}
-
-/* This lets us get at the unwrapped functions so that they can correctly
- * call the lower level functions, and choose whether they will be
- * called at every level of recursion (eg in validatetree).
- */
-DRIWrappedFuncsRec *
-DRIGetWrappedFuncs(ScreenPtr pScreen)
-{
- return &(DRI_SCREEN_PRIV(pScreen)->wrap);
-}
-
-void
-DRIQueryVersion(int *majorVersion,
- int *minorVersion,
- int *patchVersion)
-{
- *majorVersion = APPLE_DRI_MAJOR_VERSION;
- *minorVersion = APPLE_DRI_MINOR_VERSION;
- *patchVersion = APPLE_DRI_PATCH_VERSION;
-}
-
-void
-DRISurfaceNotify (xp_surface_id id, int kind)
-{
- DRIDrawablePrivPtr pDRIDrawablePriv = NULL;
- DRISurfaceNotifyArg arg;
-
- arg.id = id;
- arg.kind = kind;
-
- if (surface_hash != NULL)
- {
- pDRIDrawablePriv = x_hash_table_lookup (surface_hash,
- (void *) id, NULL);
- }
-
- if (pDRIDrawablePriv == NULL)
- return;
-
- if (kind == AppleDRISurfaceNotifyDestroyed)
- {
- pDRIDrawablePriv->sid = 0;
- x_hash_table_remove (surface_hash, (void *) id);
- }
-
- x_hook_run (pDRIDrawablePriv->notifiers, &arg);
-
- if (kind == AppleDRISurfaceNotifyDestroyed)
- {
- /* Kill off the handle. */
-
- FreeResourceByType (pDRIDrawablePriv->pDraw->id,
- DRIDrawablePrivResType, FALSE);
- }
-}
diff --git a/hw/darwin/quartz/xpr/dri.h b/hw/darwin/quartz/xpr/dri.h
deleted file mode 100644
index 350f61b56..000000000
--- a/hw/darwin/quartz/xpr/dri.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright (c) 2002 Apple Computer, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@precisioninsight.com>
- *
- */
-
-/* Prototypes for AppleDRI functions */
-
-#ifndef _DRI_H_
-
-#include "Xdefs.h"
-#include "scrnintstr.h"
-#define _APPLEDRI_SERVER_
-#include "appledri.h"
-#include "Xplugin.h"
-
-typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
-
-
-/*
- * These functions can be wrapped by the DRI. Each of these have
- * generic default funcs (initialized in DRICreateInfoRec) and can be
- * overridden by the driver in its [driver]DRIScreenInit function.
- */
-typedef struct {
- WindowExposuresProcPtr WindowExposures;
- CopyWindowProcPtr CopyWindow;
- ValidateTreeProcPtr ValidateTree;
- PostValidateTreeProcPtr PostValidateTree;
- ClipNotifyProcPtr ClipNotify;
-} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
-
-typedef struct {
- xp_surface_id id;
- int kind;
-} DRISurfaceNotifyArg;
-
-extern Bool DRIScreenInit(ScreenPtr pScreen);
-
-extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
-
-extern void DRICloseScreen(ScreenPtr pScreen);
-
-extern Bool DRIExtensionInit(void);
-
-extern void DRIReset(void);
-
-extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
- Bool *isCapable);
-
-extern Bool DRIAuthConnection(ScreenPtr pScreen, unsigned int magic);
-
-extern Bool DRICreateSurface(ScreenPtr pScreen,
- Drawable id,
- DrawablePtr pDrawable,
- xp_client_id client_id,
- xp_surface_id *surface_id,
- unsigned int key[2],
- void (*notify) (void *arg, void *data),
- void *notify_data);
-
-extern Bool DRIDestroySurface(ScreenPtr pScreen,
- Drawable id,
- DrawablePtr pDrawable,
- void (*notify) (void *arg, void *data),
- void *notify_data);
-
-extern Bool DRIDrawablePrivDelete(pointer pResource,
- XID id);
-
-extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
-
-extern void DRICopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-
-extern int DRIValidateTree(WindowPtr pParent,
- WindowPtr pChild,
- VTKind kind);
-
-extern void DRIPostValidateTree(WindowPtr pParent,
- WindowPtr pChild,
- VTKind kind);
-
-extern void DRIClipNotify(WindowPtr pWin,
- int dx,
- int dy);
-
-extern void DRIWindowExposures(WindowPtr pWin,
- RegionPtr prgn,
- RegionPtr bsreg);
-
-extern void DRISurfaceNotify (xp_surface_id id, int kind);
-
-extern void DRIQueryVersion(int *majorVersion,
- int *minorVersion,
- int *patchVersion);
-
-#define _DRI_H_
-
-#endif
diff --git a/hw/darwin/quartz/xpr/dristruct.h b/hw/darwin/quartz/xpr/dristruct.h
deleted file mode 100644
index 1a2949b18..000000000
--- a/hw/darwin/quartz/xpr/dristruct.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright (c) 2002 Apple Computer, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@precisioninsight.com>
- *
- */
-
-#ifndef DRI_STRUCT_H
-#define DRI_STRUCT_H
-
-#include "dri.h"
-#include "x-list.h"
-
-#define DRI_MAX_DRAWABLES 256
-
-#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
- ((DRIWindowPrivIndex < 0) ? \
- NULL : \
- ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
-
-#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
- ((DRIPixmapPrivIndex < 0) ? \
- NULL : \
- ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
-
-typedef struct _DRIDrawablePrivRec
-{
- xp_surface_id sid;
- int drawableIndex;
- DrawablePtr pDraw;
- ScreenPtr pScreen;
- int refCount;
- unsigned int key[2];
- x_list *notifiers; /* list of (FUN . DATA) */
-} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
-
-#define DRI_SCREEN_PRIV(pScreen) \
- ((DRIScreenPrivIndex < 0) ? \
- NULL : \
- ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
-
-#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
- (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
-
-
-typedef struct _DRIScreenPrivRec
-{
- Bool directRenderingSupport;
- int nrWindows;
- DRIWrappedFuncsRec wrap;
- DrawablePtr DRIDrawables[DRI_MAX_DRAWABLES];
-} DRIScreenPrivRec, *DRIScreenPrivPtr;
-
-#endif /* DRI_STRUCT_H */
diff --git a/hw/darwin/quartz/xpr/x-hash.c b/hw/darwin/quartz/xpr/x-hash.c
deleted file mode 100644
index ad36204c5..000000000
--- a/hw/darwin/quartz/xpr/x-hash.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/* x-hash.c - basic hash tables
- $Id$
-
- Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#include "x-hash.h"
-#include "x-list.h"
-#include <stdlib.h>
-#include <assert.h>
-
-struct x_hash_table_struct {
- int bucket_index;
- int total_keys;
- x_list **buckets;
-
- x_hash_fun *hash_key;
- x_compare_fun *compare_keys;
- x_destroy_fun *destroy_key;
- x_destroy_fun *destroy_value;
-};
-
-#define ITEM_NEW(k, v) X_PFX (list_prepend) ((x_list *) (k), v)
-#define ITEM_FREE(i) X_PFX (list_free_1) (i)
-#define ITEM_KEY(i) ((void *) (i)->next)
-#define ITEM_VALUE(i) ((i)->data)
-
-#define SPLIT_THRESHOLD_FACTOR 2
-
-/* http://planetmath.org/?op=getobj&from=objects&name=GoodHashTablePrimes */
-static const unsigned int bucket_sizes[] = {
- 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157,
- 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917,
- 25165843, 50331653, 100663319, 201326611, 402653189, 805306457,
- 1610612741
-};
-
-#define N_BUCKET_SIZES (sizeof (bucket_sizes) / sizeof (bucket_sizes[0]))
-
-static inline unsigned int
-hash_table_total_buckets (x_hash_table *h)
-{
- return bucket_sizes[h->bucket_index];
-}
-
-static inline void
-hash_table_destroy_item (x_hash_table *h, void *k, void *v)
-{
- if (h->destroy_key != 0)
- (*h->destroy_key) (k);
-
- if (h->destroy_value != 0)
- (*h->destroy_value) (v);
-}
-
-static inline unsigned int
-hash_table_hash_key (x_hash_table *h, void *k)
-{
- if (h->hash_key != 0)
- return (*h->hash_key) (k);
- else
- return (unsigned int) k;
-}
-
-static inline int
-hash_table_compare_keys (x_hash_table *h, void *k1, void *k2)
-{
- if (h->compare_keys == 0)
- return k1 == k2;
- else
- return (*h->compare_keys) (k1, k2) == 0;
-}
-
-static void
-hash_table_split (x_hash_table *h)
-{
- x_list **new, **old;
- x_list *node, *item, *next;
- int new_size, old_size;
- unsigned int b;
- int i;
-
- if (h->bucket_index == N_BUCKET_SIZES - 1)
- return;
-
- old_size = hash_table_total_buckets (h);
- old = h->buckets;
-
- h->bucket_index++;
-
- new_size = hash_table_total_buckets (h);
- new = calloc (new_size, sizeof (x_list *));
-
- if (new == 0)
- {
- h->bucket_index--;
- return;
- }
-
- for (i = 0; i < old_size; i++)
- {
- for (node = old[i]; node != 0; node = next)
- {
- next = node->next;
- item = node->data;
-
- b = hash_table_hash_key (h, ITEM_KEY (item)) % new_size;
-
- node->next = new[b];
- new[b] = node;
- }
- }
-
- h->buckets = new;
- free (old);
-}
-
-X_EXTERN x_hash_table *
-X_PFX (hash_table_new) (x_hash_fun *hash,
- x_compare_fun *compare,
- x_destroy_fun *key_destroy,
- x_destroy_fun *value_destroy)
-{
- x_hash_table *h;
-
- h = calloc (1, sizeof (x_hash_table));
- if (h == 0)
- return 0;
-
- h->bucket_index = 0;
- h->buckets = calloc (hash_table_total_buckets (h), sizeof (x_list *));
-
- if (h->buckets == 0)
- {
- free (h);
- return 0;
- }
-
- h->hash_key = hash;
- h->compare_keys = compare;
- h->destroy_key = key_destroy;
- h->destroy_value = value_destroy;
-
- return h;
-}
-
-X_EXTERN void
-X_PFX (hash_table_free) (x_hash_table *h)
-{
- int n, i;
- x_list *node, *item;
-
- assert (h != NULL);
-
- n = hash_table_total_buckets (h);
-
- for (i = 0; i < n; i++)
- {
- for (node = h->buckets[i]; node != 0; node = node->next)
- {
- item = node->data;
- hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
- ITEM_FREE (item);
- }
- X_PFX (list_free) (h->buckets[i]);
- }
-
- free (h->buckets);
- free (h);
-}
-
-X_EXTERN unsigned int
-X_PFX (hash_table_size) (x_hash_table *h)
-{
- assert (h != NULL);
-
- return h->total_keys;
-}
-
-static void
-hash_table_modify (x_hash_table *h, void *k, void *v, int replace)
-{
- unsigned int hash_value;
- x_list *node, *item;
-
- assert (h != NULL);
-
- hash_value = hash_table_hash_key (h, k);
-
- for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
- node != 0; node = node->next)
- {
- item = node->data;
-
- if (hash_table_compare_keys (h, ITEM_KEY (item), k))
- {
- if (replace)
- {
- hash_table_destroy_item (h, ITEM_KEY (item),
- ITEM_VALUE (item));
- ITEM_KEY (item) = k;
- ITEM_VALUE (item) = v;
- }
- else
- {
- hash_table_destroy_item (h, k, ITEM_VALUE (item));
- ITEM_VALUE (item) = v;
- }
- return;
- }
- }
-
- /* Key isn't already in the table. Insert it. */
-
- if (h->total_keys + 1
- > hash_table_total_buckets (h) * SPLIT_THRESHOLD_FACTOR)
- {
- hash_table_split (h);
- }
-
- hash_value = hash_value % hash_table_total_buckets (h);
- h->buckets[hash_value] = X_PFX (list_prepend) (h->buckets[hash_value],
- ITEM_NEW (k, v));
- h->total_keys++;
-}
-
-X_EXTERN void
-X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v)
-{
- hash_table_modify (h, k, v, 0);
-}
-
-X_EXTERN void
-X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v)
-{
- hash_table_modify (h, k, v, 1);
-}
-
-X_EXTERN void
-X_PFX (hash_table_remove) (x_hash_table *h, void *k)
-{
- unsigned int hash_value;
- x_list **ptr, *item;
-
- assert (h != NULL);
-
- hash_value = hash_table_hash_key (h, k);
-
- for (ptr = &h->buckets[hash_value % hash_table_total_buckets (h)];
- *ptr != 0; ptr = &((*ptr)->next))
- {
- item = (*ptr)->data;
-
- if (hash_table_compare_keys (h, ITEM_KEY (item), k))
- {
- hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
- ITEM_FREE (item);
- item = *ptr;
- *ptr = item->next;
- X_PFX (list_free_1) (item);
- h->total_keys--;
- return;
- }
- }
-}
-
-X_EXTERN void *
-X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret)
-{
- unsigned int hash_value;
- x_list *node, *item;
-
- assert (h != NULL);
-
- hash_value = hash_table_hash_key (h, k);
-
- for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
- node != 0; node = node->next)
- {
- item = node->data;
-
- if (hash_table_compare_keys (h, ITEM_KEY (item), k))
- {
- if (k_ret != 0)
- *k_ret = ITEM_KEY (item);
-
- return ITEM_VALUE (item);
- }
- }
-
- if (k_ret != 0)
- *k_ret = 0;
-
- return 0;
-}
-
-X_EXTERN void
-X_PFX (hash_table_foreach) (x_hash_table *h,
- x_hash_foreach_fun *fun, void *data)
-{
- int i, n;
- x_list *node, *item;
-
- assert (h != NULL);
-
- n = hash_table_total_buckets (h);
-
- for (i = 0; i < n; i++)
- {
- for (node = h->buckets[i]; node != 0; node = node->next)
- {
- item = node->data;
- (*fun) (ITEM_KEY (item), ITEM_VALUE (item), data);
- }
- }
-}
diff --git a/hw/darwin/quartz/xpr/x-hash.h b/hw/darwin/quartz/xpr/x-hash.h
deleted file mode 100644
index 2abb08cd7..000000000
--- a/hw/darwin/quartz/xpr/x-hash.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* x-hash.h -- basic hash table class
- $Id$
-
- Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#ifndef X_HASH_H
-#define X_HASH_H 1
-
-typedef struct x_hash_table_struct x_hash_table;
-
-typedef int (x_compare_fun) (const void *a, const void *b);
-typedef unsigned int (x_hash_fun) (const void *k);
-typedef void (x_destroy_fun) (void *x);
-typedef void (x_hash_foreach_fun) (void *k, void *v, void *data);
-
-/* for X_PFX and X_EXTERN */
-#include "x-list.h"
-
-X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash,
- x_compare_fun *compare,
- x_destroy_fun *key_destroy,
- x_destroy_fun *value_destroy);
-X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h);
-
-X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h);
-
-X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v);
-X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v);
-X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k);
-X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h,
- void *k, void **k_ret);
-X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h,
- x_hash_foreach_fun *fun,
- void *data);
-
-#endif /* X_HASH_H */
diff --git a/hw/darwin/quartz/xpr/x-hook.c b/hw/darwin/quartz/xpr/x-hook.c
deleted file mode 100644
index 3414e1543..000000000
--- a/hw/darwin/quartz/xpr/x-hook.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* x-hook.c
- $Id$
-
- Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-
-#include "x-hook.h"
-#include <stdlib.h>
-#include <assert.h>
-
-#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d))
-#define CELL_FREE(c) X_PFX (list_free_1) (c)
-#define CELL_FUN(c) ((x_hook_function *) ((c)->next))
-#define CELL_DATA(c) ((c)->data)
-
-X_EXTERN x_list *
-X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data)
-{
- return X_PFX (list_prepend) (lst, CELL_NEW (fun, data));
-}
-
-X_EXTERN x_list *
-X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
-{
- x_list *node, *cell;
- x_list *to_delete = NULL;
-
- for (node = lst; node != NULL; node = node->next)
- {
- cell = node->data;
- if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data)
- to_delete = X_PFX (list_prepend) (to_delete, cell);
- }
-
- for (node = to_delete; node != NULL; node = node->next)
- {
- cell = node->data;
- lst = X_PFX (list_remove) (lst, cell);
- CELL_FREE (cell);
- }
-
- X_PFX (list_free) (to_delete);
-}
-
-X_EXTERN void
-X_PFX (hook_run) (x_list *lst, void *arg)
-{
- x_list *node, *cell;
- x_hook_function **fun;
- void **data;
- int length, i;
-
- length = X_PFX (list_length) (lst);
- fun = alloca (sizeof (x_hook_function *) * length);
- data = alloca (sizeof (void *) * length);
-
- for (i = 0, node = lst; node != NULL; node = node->next, i++)
- {
- cell = node->data;
- fun[i] = CELL_FUN (cell);
- data[i] = CELL_DATA (cell);
- }
-
- for (i = 0; i < length; i++)
- {
- (*fun[i]) (arg, data[i]);
- }
-}
-
-X_EXTERN void
-X_PFX (hook_free) (x_list *lst)
-{
- x_list *node;
-
- for (node = lst; node != NULL; node = node->next)
- {
- CELL_FREE (node->data);
- }
-
- X_PFX (list_free) (lst);
-}
diff --git a/hw/darwin/quartz/xpr/x-hook.h b/hw/darwin/quartz/xpr/x-hook.h
deleted file mode 100644
index 14e8ca1f5..000000000
--- a/hw/darwin/quartz/xpr/x-hook.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* x-hook.h -- lists of function,data pairs to call.
- $Id$
-
- Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
-
-#ifndef X_HOOK_H
-#define X_HOOK_H 1
-
-#include "x-list.h"
-
-typedef void x_hook_function (void *arg, void *data);
-
-X_EXTERN x_list *X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data);
-X_EXTERN x_list *X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data);
-X_EXTERN void X_PFX (hook_run) (x_list *lst, void *arg);
-X_EXTERN void X_PFX (hook_free) (x_list *lst);
-
-#endif /* X_HOOK_H */
diff --git a/hw/darwin/quartz/xpr/x-list.c b/hw/darwin/quartz/xpr/x-list.c
deleted file mode 100644
index 859a5163d..000000000
--- a/hw/darwin/quartz/xpr/x-list.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/* x-list.c
- $Id$
-
- Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#include "x-list.h"
-#include <stdlib.h>
-#include <assert.h>
-#include <pthread.h>
-
-/* Allocate in ~4k blocks */
-#define NODES_PER_BLOCK 508
-
-typedef struct x_list_block_struct x_list_block;
-
-struct x_list_block_struct {
- x_list l[NODES_PER_BLOCK];
-};
-
-static x_list *freelist;
-
-static pthread_mutex_t freelist_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static inline void
-list_free_1 (x_list *node)
-{
- node->next = freelist;
- freelist = node;
-}
-
-X_EXTERN void
-X_PFX (list_free_1) (x_list *node)
-{
- assert (node != NULL);
-
- pthread_mutex_lock (&freelist_lock);
-
- list_free_1 (node);
-
- pthread_mutex_unlock (&freelist_lock);
-}
-
-X_EXTERN void
-X_PFX (list_free) (x_list *lst)
-{
- x_list *next;
-
- pthread_mutex_lock (&freelist_lock);
-
- for (; lst != NULL; lst = next)
- {
- next = lst->next;
- list_free_1 (lst);
- }
-
- pthread_mutex_unlock (&freelist_lock);
-}
-
-X_EXTERN x_list *
-X_PFX (list_prepend) (x_list *lst, void *data)
-{
- x_list *node;
-
- pthread_mutex_lock (&freelist_lock);
-
- if (freelist == NULL)
- {
- x_list_block *b;
- int i;
-
- b = malloc (sizeof (x_list_block));
-
- for (i = 0; i < NODES_PER_BLOCK - 1; i++)
- b->l[i].next = &(b->l[i+1]);
- b->l[i].next = NULL;
-
- freelist = b->l;
- }
-
- node = freelist;
- freelist = node->next;
-
- pthread_mutex_unlock (&freelist_lock);
-
- node->next = lst;
- node->data = data;
-
- return node;
-}
-
-X_EXTERN x_list *
-X_PFX (list_append) (x_list *lst, void *data)
-{
- x_list *head = lst;
-
- if (lst == NULL)
- return X_PFX (list_prepend) (NULL, data);
-
- while (lst->next != NULL)
- lst = lst->next;
-
- lst->next = X_PFX (list_prepend) (NULL, data);
-
- return head;
-}
-
-X_EXTERN x_list *
-X_PFX (list_reverse) (x_list *lst)
-{
- x_list *head = NULL, *next;
-
- while (lst != NULL)
- {
- next = lst->next;
- lst->next = head;
- head = lst;
- lst = next;
- }
-
- return head;
-}
-
-X_EXTERN x_list *
-X_PFX (list_find) (x_list *lst, void *data)
-{
- for (; lst != NULL; lst = lst->next)
- {
- if (lst->data == data)
- return lst;
- }
-
- return NULL;
-}
-
-X_EXTERN x_list *
-X_PFX (list_nth) (x_list *lst, int n)
-{
- while (n-- > 0 && lst != NULL)
- lst = lst->next;
-
- return lst;
-}
-
-X_EXTERN x_list *
-X_PFX (list_filter) (x_list *lst,
- int (*pred) (void *item, void *data), void *data)
-{
- x_list *ret = NULL, *node;
-
- for (node = lst; node != NULL; node = node->next)
- {
- if ((*pred) (node->data, data))
- ret = X_PFX (list_prepend) (ret, node->data);
- }
-
- return X_PFX (list_reverse) (ret);
-}
-
-X_EXTERN x_list *
-X_PFX (list_map) (x_list *lst,
- void *(*fun) (void *item, void *data), void *data)
-{
- x_list *ret = NULL, *node;
-
- for (node = lst; node != NULL; node = node->next)
- {
- X_PFX (list_prepend) (ret, fun (node->data, data));
- }
-
- return X_PFX (list_reverse) (ret);
-}
-
-X_EXTERN x_list *
-X_PFX (list_copy) (x_list *lst)
-{
- x_list *copy = NULL;
-
- for (; lst != NULL; lst = lst->next)
- {
- copy = X_PFX (list_prepend) (copy, lst->data);
- }
-
- return X_PFX (list_reverse) (copy);
-}
-
-X_EXTERN x_list *
-X_PFX (list_remove) (x_list *lst, void *data)
-{
- x_list **ptr, *node;
-
- for (ptr = &lst; *ptr != NULL;)
- {
- node = *ptr;
-
- if (node->data == data)
- {
- *ptr = node->next;
- X_PFX (list_free_1) (node);
- }
- else
- ptr = &((*ptr)->next);
- }
-
- return lst;
-}
-
-X_EXTERN unsigned int
-X_PFX (list_length) (x_list *lst)
-{
- unsigned int n;
-
- n = 0;
- for (; lst != NULL; lst = lst->next)
- n++;
-
- return n;
-}
-
-X_EXTERN void
-X_PFX (list_foreach) (x_list *lst,
- void (*fun) (void *data, void *user_data),
- void *user_data)
-{
- for (; lst != NULL; lst = lst->next)
- {
- (*fun) (lst->data, user_data);
- }
-}
-
-static x_list *
-list_sort_1 (x_list *lst, int length,
- int (*less) (const void *, const void *))
-{
- x_list *mid, *ptr;
- x_list *out_head, *out;
- int mid_point, i;
-
- /* This is a standard (stable) list merge sort */
-
- if (length < 2)
- return lst;
-
- /* Calculate the halfway point. Split the list into two sub-lists. */
-
- mid_point = length / 2;
- ptr = lst;
- for (i = mid_point - 1; i > 0; i--)
- ptr = ptr->next;
- mid = ptr->next;
- ptr->next = NULL;
-
- /* Sort each sub-list. */
-
- lst = list_sort_1 (lst, mid_point, less);
- mid = list_sort_1 (mid, length - mid_point, less);
-
- /* Then merge them back together. */
-
- assert (lst != NULL && mid != NULL);
-
- if ((*less) (mid->data, lst->data))
- out = out_head = mid, mid = mid->next;
- else
- out = out_head = lst, lst = lst->next;
-
- while (lst != NULL && mid != NULL)
- {
- if ((*less) (mid->data, lst->data))
- out = out->next = mid, mid = mid->next;
- else
- out = out->next = lst, lst = lst->next;
- }
-
- if (lst != NULL)
- out->next = lst;
- else
- out->next = mid;
-
- return out_head;
-}
-
-X_EXTERN x_list *
-X_PFX (list_sort) (x_list *lst, int (*less) (const void *, const void *))
-{
- int length;
-
- length = X_PFX (list_length) (lst);
-
- return list_sort_1 (lst, length, less);
-}
diff --git a/hw/darwin/quartz/xpr/x-list.h b/hw/darwin/quartz/xpr/x-list.h
deleted file mode 100644
index a65cfcb7c..000000000
--- a/hw/darwin/quartz/xpr/x-list.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* x-list.h -- simple list type
- $Id$
-
- Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name(s) of the above
- copyright holders shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Software without
- prior written authorization. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#ifndef X_LIST_H
-#define X_LIST_H 1
-
-/* This is just a cons. */
-
-typedef struct x_list_struct x_list;
-
-struct x_list_struct {
- void *data;
- x_list *next;
-};
-
-#ifndef X_PFX
-# define X_PFX(x) x_ ## x
-#endif
-
-#ifndef X_EXTERN
-# define X_EXTERN __private_extern__
-#endif
-
-X_EXTERN void X_PFX (list_free_1) (x_list *node);
-X_EXTERN x_list *X_PFX (list_prepend) (x_list *lst, void *data);
-
-X_EXTERN x_list *X_PFX (list_append) (x_list *lst, void *data);
-X_EXTERN x_list *X_PFX (list_remove) (x_list *lst, void *data);
-X_EXTERN void X_PFX (list_free) (x_list *lst);
-
-X_EXTERN x_list *X_PFX (list_copy) (x_list *lst);
-X_EXTERN x_list *X_PFX (list_reverse) (x_list *lst);
-X_EXTERN x_list *X_PFX (list_find) (x_list *lst, void *data);
-X_EXTERN x_list *X_PFX (list_nth) (x_list *lst, int n);
-X_EXTERN x_list *X_PFX (list_filter) (x_list *src,
- int (*pred) (void *item, void *data),
- void *data);
-X_EXTERN x_list *X_PFX (list_map) (x_list *src,
- void *(*fun) (void *item, void *data),
- void *data);
-
-X_EXTERN unsigned int X_PFX (list_length) (x_list *lst);
-X_EXTERN void X_PFX (list_foreach) (x_list *lst, void (*fun)
- (void *data, void *user_data),
- void *user_data);
-
-X_EXTERN x_list *X_PFX (list_sort) (x_list *lst, int (*less) (const void *,
- const void *));
-
-#endif /* X_LIST_H */
diff --git a/hw/darwin/quartz/xpr/xpr.h b/hw/darwin/quartz/xpr/xpr.h
deleted file mode 100644
index 3d447b226..000000000
--- a/hw/darwin/quartz/xpr/xpr.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Xplugin rootless implementation
- */
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
-
-#ifndef XPR_H
-#define XPR_H
-
-#include "screenint.h"
-
-extern Bool QuartzModeBundleInit(void);
-
-void AppleDRIExtensionInit(void);
-void xprAppleWMInit(void);
-Bool xprInit(ScreenPtr pScreen);
-Bool xprIsX11Window(void *nsWindow, int windowNumber);
-
-Bool QuartzInitCursor(ScreenPtr pScreen);
-void QuartzSuspendXCursor(ScreenPtr pScreen);
-void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
-
-#endif /* XPR_H */
diff --git a/hw/darwin/quartz/xpr/xprAppleWM.c b/hw/darwin/quartz/xpr/xprAppleWM.c
deleted file mode 100644
index eca0de334..000000000
--- a/hw/darwin/quartz/xpr/xprAppleWM.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Xplugin rootless implementation functions for AppleWM extension
- */
-/*
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */
-
-#include "xpr.h"
-#include "applewmExt.h"
-#include "rootless.h"
-#include "Xplugin.h"
-#include "X.h"
-
-
-static int xprSetWindowLevel(
- WindowPtr pWin,
- int level)
-{
- xp_window_id wid;
- xp_window_changes wc;
-
- wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE);
- if (wid == 0)
- return BadWindow;
-
- RootlessStopDrawing (pWin, FALSE);
-
- wc.window_level = level;
- if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) {
- return BadValue;
- }
-
- return Success;
-}
-
-
-static int xprFrameDraw(
- WindowPtr pWin,
- int class,
- unsigned int attr,
- const BoxRec *outer,
- const BoxRec *inner,
- unsigned int title_len,
- const unsigned char *title_bytes)
-{
- xp_window_id wid;
-
- wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE);
- if (wid == 0)
- return BadWindow;
-
- if (xp_frame_draw (wid, class, attr, outer, inner,
- title_len, title_bytes) != Success)
- {
- return BadValue;
- }
-
- return Success;
-}
-
-
-static AppleWMProcsRec xprAppleWMProcs = {
- xp_disable_update,
- xp_reenable_update,
- xprSetWindowLevel,
- xp_frame_get_rect,
- xp_frame_hit_test,
- xprFrameDraw
-};
-
-
-void xprAppleWMInit(void)
-{
- AppleWMExtensionInit(&xprAppleWMProcs);
-}
diff --git a/hw/darwin/quartz/xpr/xprCursor.c b/hw/darwin/quartz/xpr/xprCursor.c
deleted file mode 100644
index a3dea69e2..000000000
--- a/hw/darwin/quartz/xpr/xprCursor.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/**************************************************************
- *
- * Xplugin cursor support
- *
- **************************************************************/
-/*
- * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
- * Copyright (c) 2002 Apple Computer, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprCursor.c,v 1.2 2003/09/16 00:36:15 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "xpr.h"
-#include "darwin.h"
-#include "Xplugin.h"
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "windowstr.h"
-#include "globals.h"
-#include "servermd.h"
-#include "dixevents.h"
-
-typedef struct {
- int cursorVisible;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
-} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-
-#define CURSOR_PRIV(pScreen) \
- ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-
-static Bool
-load_cursor(CursorPtr src, int screen)
-{
- uint32_t *data;
- uint32_t rowbytes;
- int width, height;
- int hot_x, hot_y;
-
- uint32_t fg_color, bg_color;
- uint8_t *srow, *sptr;
- uint8_t *mrow, *mptr;
- uint32_t *drow, *dptr;
- unsigned xcount, ycount;
-
- xp_error err;
-
- width = src->bits->width;
- height = src->bits->height;
- hot_x = src->bits->xhot;
- hot_y = src->bits->yhot;
-
-#ifdef ARGB_CURSOR
- if (src->bits->argb != NULL)
- {
- rowbytes = src->bits->width * sizeof(CARD32);
- data = (uint32_t *) src->bits->argb;
- }
- else
-#endif
- {
- fg_color = 0xFF00 | (src->foreRed >> 8);
- fg_color <<= 16;
- fg_color |= src->foreGreen & 0xFF00;
- fg_color |= src->foreBlue >> 8;
-
- bg_color = 0xFF00 | (src->backRed >> 8);
- bg_color <<= 16;
- bg_color |= src->backGreen & 0xFF00;
- bg_color |= src->backBlue >> 8;
-
- fg_color = htonl(fg_color);
- bg_color = htonl(bg_color);
-
- /* round up to 8 pixel boundary so we can convert whole bytes */
- rowbytes = ((src->bits->width * 4) + 31) & ~31;
- data = alloca(rowbytes * src->bits->height);
-
- if (!src->bits->emptyMask)
- {
- ycount = src->bits->height;
- srow = src->bits->source; mrow = src->bits->mask;
- drow = data;
-
- while (ycount-- > 0)
- {
- xcount = (src->bits->width + 7) / 8;
- sptr = srow; mptr = mrow;
- dptr = drow;
-
- while (xcount-- > 0)
- {
- uint8_t s, m;
- int i;
-
- s = *sptr++; m = *mptr++;
- for (i = 0; i < 8; i++)
- {
-#if BITMAP_BIT_ORDER == MSBFirst
- if (m & 128)
- *dptr++ = (s & 128) ? fg_color : bg_color;
- else
- *dptr++ = 0;
- s <<= 1; m <<= 1;
-#else
- if (m & 1)
- *dptr++ = (s & 1) ? fg_color : bg_color;
- else
- *dptr++ = 0;
- s >>= 1; m >>= 1;
-#endif
- }
- }
-
- srow += BitmapBytePad(src->bits->width);
- mrow += BitmapBytePad(src->bits->width);
- drow = (uint32_t *) ((char *) drow + rowbytes);
- }
- }
- else
- {
- memset(data, 0, src->bits->height * rowbytes);
- }
- }
-
- err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
- return err == Success;
-}
-
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- * QuartzRealizeCursor
- * Convert the X cursor representation to native format if possible.
- */
-static Bool
-QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- if(pCursor == NULL || pCursor->bits == NULL)
- return FALSE;
-
- /* FIXME: cache ARGB8888 representation? */
-
- return TRUE;
-}
-
-
-/*
- * QuartzUnrealizeCursor
- * Free the storage space associated with a realized cursor.
- */
-static Bool
-QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- return TRUE;
-}
-
-
-/*
- * QuartzSetCursor
- * Set the cursor sprite and position.
- */
-static void
-QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (!quartzServerVisible)
- return;
-
- if (pCursor == NULL)
- {
- if (ScreenPriv->cursorVisible)
- {
- xp_hide_cursor();
- ScreenPriv->cursorVisible = FALSE;
- }
- }
- else
- {
- load_cursor(pCursor, pScreen->myNum);
-
- if (!ScreenPriv->cursorVisible)
- {
- xp_show_cursor();
- ScreenPriv->cursorVisible = TRUE;
- }
- }
-}
-
-
-/*
- * QuartzMoveCursor
- * Move the cursor. This is a noop for us.
- */
-static void
-QuartzMoveCursor(ScreenPtr pScreen, int x, int y)
-{
-}
-
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
- QuartzRealizeCursor,
- QuartzUnrealizeCursor,
- QuartzSetCursor,
- QuartzMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorOffScreen
- */
-static Bool
-QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-
-/*
- * QuartzCrossScreen
- */
-static void
-QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
-{
- return;
-}
-
-
-/*
- * QuartzWarpCursor
- * Change the cursor position without generating an event or motion history.
- * The input coordinates (x,y) are in pScreen-local X11 coordinates.
- *
- */
-static void
-QuartzWarpCursor(ScreenPtr pScreen, int x, int y)
-{
- static Bool neverMoved = TRUE;
-
- if (neverMoved)
- {
- /* Don't move the cursor the first time. This is the
- jump-to-center initialization, and it's annoying. */
- neverMoved = FALSE;
- return;
- }
-
- if (quartzServerVisible)
- {
- int sx, sy;
-
- sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
- sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
- CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y));
- }
-
- miPointerWarpCursor(pScreen, x, y);
- miPointerUpdate();
-}
-
-
-static miPointerScreenFuncRec quartzScreenFuncsRec = {
- QuartzCursorOffScreen,
- QuartzCrossScreen,
- QuartzWarpCursor,
- DarwinEQPointerPost,
- DarwinEQSwitchScreen
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * QuartzCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-QuartzCursorQueryBestSize(int class, unsigned short *width,
- unsigned short *height, ScreenPtr pScreen)
-{
- QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape)
- {
- /* FIXME: query window server? */
- *width = 32;
- *height = 32;
- }
- else
- {
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
- }
-}
-
-/*
- * QuartzInitCursor
- * Initialize cursor support
- */
-Bool
-QuartzInitCursor(ScreenPtr pScreen)
-{
- QuartzCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
-
- /* initialize software cursor handling (always needed as backup) */
- if (!miDCInitialize(pScreen, &quartzScreenFuncsRec))
- return FALSE;
-
- /* allocate private storage for this screen's QuickDraw cursor info */
- if (darwinCursorGeneration != serverGeneration)
- {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
-
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec));
- if (ScreenPriv == NULL)
- return FALSE;
-
- CURSOR_PRIV(pScreen) = ScreenPriv;
-
- /* override some screen procedures */
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = QuartzCursorQueryBestSize;
-
- PointPriv = (miPointerScreenPtr) pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
-
- ScreenPriv->cursorVisible = TRUE;
- return TRUE;
-}
-
-
-/*
- * QuartzSuspendXCursor
- * X server is hiding. Restore the Aqua cursor.
- */
-void
-QuartzSuspendXCursor(ScreenPtr pScreen)
-{
-}
-
-
-/*
- * QuartzResumeXCursor
- * X server is showing. Restore the X cursor.
- */
-void
-QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
-{
- WindowPtr pWin;
- CursorPtr pCursor;
-
- pWin = GetSpriteWindow();
- if (pWin->drawable.pScreen != pScreen)
- return;
-
- pCursor = GetSpriteCursor();
- if (pCursor == NULL)
- return;
-
- QuartzSetCursor(pScreen, pCursor, x, y);
-}
diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/darwin/quartz/xpr/xprFrame.c
deleted file mode 100644
index ae24bc42a..000000000
--- a/hw/darwin/quartz/xpr/xprFrame.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Xplugin rootless implementation frame functions
- */
-/*
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
-
-#include "xpr.h"
-#include "rootless.h"
-#include "Xplugin.h"
-#include "x-hash.h"
-#include "x-list.h"
-
-#include "propertyst.h"
-#include "dix.h"
-#include "Xatom.h"
-#include "windowstr.h"
-
-#include <pthread.h>
-
-#define DEFINE_ATOM_HELPER(func,atom_name) \
-static Atom func (void) { \
- static int generation; \
- static Atom atom; \
- if (generation != serverGeneration) { \
- generation = serverGeneration; \
- atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
- } \
- return atom; \
-}
-
-DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
-
-/* Maps xp_window_id -> RootlessWindowRec */
-static x_hash_table *window_hash;
-static pthread_mutex_t window_hash_mutex;
-
-static Bool no_configure_window;
-
-
-static inline xp_error
-xprConfigureWindow(xp_window_id id, unsigned int mask,
- const xp_window_changes *values)
-{
- if (!no_configure_window)
- return xp_configure_window(id, mask, values);
- else
- return XP_Success;
-}
-
-
-static void
-xprSetNativeProperty(RootlessWindowPtr pFrame)
-{
- xp_error err;
- unsigned int native_id;
- long data;
-
- err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id);
- if (err == Success)
- {
- /* FIXME: move this to AppleWM extension */
-
- data = native_id;
- ChangeWindowProperty(pFrame->win, xa_native_window_id(),
- XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE);
- }
-}
-
-
-/*
- * Create and display a new frame.
- */
-Bool
-xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
- int newX, int newY, RegionPtr pShape)
-{
- WindowPtr pWin = pFrame->win;
- xp_window_changes wc;
- unsigned int mask = 0;
- xp_error err;
-
- wc.x = newX;
- wc.y = newY;
- wc.width = pFrame->width;
- wc.height = pFrame->height;
- wc.bit_gravity = XP_GRAVITY_NONE;
- mask |= XP_BOUNDS;
-
- if (pWin->drawable.depth == 8)
- {
- wc.depth = XP_DEPTH_INDEX8;
-#if 0
- wc.colormap = xprColormapCallback;
- wc.colormap_data = pScreen;
- mask |= XP_COLORMAP;
-#endif
- }
- else if (pWin->drawable.depth == 15)
- wc.depth = XP_DEPTH_RGB555;
- else if (pWin->drawable.depth == 24)
- wc.depth = XP_DEPTH_ARGB8888;
- else
- wc.depth = XP_DEPTH_NIL;
- mask |= XP_DEPTH;
-
- if (pShape != NULL)
- {
- wc.shape_nrects = REGION_NUM_RECTS(pShape);
- wc.shape_rects = REGION_RECTS(pShape);
- wc.shape_tx = wc.shape_ty = 0;
- mask |= XP_SHAPE;
- }
-
- err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid);
-
- if (err != Success)
- {
- return FALSE;
- }
-
- if (window_hash == NULL)
- {
- window_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
- pthread_mutex_init(&window_hash_mutex, NULL);
- }
-
- pthread_mutex_lock(&window_hash_mutex);
- x_hash_table_insert(window_hash, pFrame->wid, pFrame);
- pthread_mutex_unlock(&window_hash_mutex);
-
- xprSetNativeProperty(pFrame);
-
- return TRUE;
-}
-
-
-/*
- * Destroy a frame.
- */
-void
-xprDestroyFrame(RootlessFrameID wid)
-{
- pthread_mutex_lock(&window_hash_mutex);
- x_hash_table_remove(window_hash, wid);
- pthread_mutex_unlock(&window_hash_mutex);
-
- xp_destroy_window((xp_window_id) wid);
-}
-
-
-/*
- * Move a frame on screen.
- */
-void
-xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
-{
- xp_window_changes wc;
-
- wc.x = newX;
- wc.y = newY;
-
- xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
-}
-
-
-/*
- * Resize and move a frame.
- */
-void
-xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
- int newX, int newY, unsigned int newW, unsigned int newH,
- unsigned int gravity)
-{
- xp_window_changes wc;
-
- wc.x = newX;
- wc.y = newY;
- wc.width = newW;
- wc.height = newH;
- wc.bit_gravity = gravity;
-
- /* It's unlikely that being async will save us anything here.
- But it can't hurt. */
-
- xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc);
-}
-
-
-/*
- * Change frame stacking.
- */
-void
-xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
-{
- xp_window_changes wc;
-
- /* Stack frame below nextWid it if it exists, or raise
- frame above everything otherwise. */
-
- if (nextWid == NULL)
- {
- wc.stack_mode = XP_MAPPED_ABOVE;
- wc.sibling = 0;
- }
- else
- {
- wc.stack_mode = XP_MAPPED_BELOW;
- wc.sibling = (xp_window_id) nextWid;
- }
-
- xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
-}
-
-
-/*
- * Change the frame's shape.
- */
-void
-xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
-{
- xp_window_changes wc;
-
- if (pShape != NULL)
- {
- wc.shape_nrects = REGION_NUM_RECTS(pShape);
- wc.shape_rects = REGION_RECTS(pShape);
- }
- else
- {
- wc.shape_nrects = -1;
- wc.shape_rects = NULL;
- }
-
- wc.shape_tx = wc.shape_ty = 0;
-
- xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc);
-}
-
-
-/*
- * Unmap a frame.
- */
-void
-xprUnmapFrame(RootlessFrameID wid)
-{
- xp_window_changes wc;
-
- wc.stack_mode = XP_UNMAPPED;
- wc.sibling = 0;
-
- xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
-}
-
-
-/*
- * Start drawing to a frame.
- * Prepare for direct access to its backing buffer.
- */
-void
-xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
-{
- void *data[2];
- unsigned int rowbytes[2];
- xp_error err;
-
- err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL);
- if (err != Success)
- FatalError("Could not lock window %i for drawing.", (int) wid);
-
- *pixelData = data[0];
- *bytesPerRow = rowbytes[0];
-}
-
-
-/*
- * Stop drawing to a frame.
- */
-void
-xprStopDrawing(RootlessFrameID wid, Bool flush)
-{
- xp_unlock_window((xp_window_id) wid, flush);
-}
-
-
-/*
- * Flush drawing updates to the screen.
- */
-void
-xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
-{
- xp_flush_window((xp_window_id) wid);
-}
-
-
-/*
- * Mark damaged rectangles as requiring redisplay to screen.
- */
-void
-xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
- int shift_x, int shift_y)
-{
- xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y);
-}
-
-
-/*
- * Called after the window associated with a frame has been switched
- * to a new top-level parent.
- */
-void
-xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
-{
- DeleteProperty(oldWin, xa_native_window_id());
-
- xprSetNativeProperty(pFrame);
-}
-
-
-/*
- * Copy area in frame to another part of frame.
- * Used to accelerate scrolling.
- */
-void
-xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
- int dx, int dy)
-{
- xp_copy_window((xp_window_id) wid, (xp_window_id) wid,
- dstNrects, dstRects, dx, dy);
-}
-
-
-static RootlessFrameProcsRec xprRootlessProcs = {
- xprCreateFrame,
- xprDestroyFrame,
- xprMoveFrame,
- xprResizeFrame,
- xprRestackFrame,
- xprReshapeFrame,
- xprUnmapFrame,
- xprStartDrawing,
- xprStopDrawing,
- xprUpdateRegion,
- xprDamageRects,
- xprSwitchWindow,
- xp_copy_bytes,
- xp_fill_bytes,
- xp_composite_pixels,
- xprCopyWindow
-};
-
-
-/*
- * Initialize XPR implementation
- */
-Bool
-xprInit(ScreenPtr pScreen)
-{
- RootlessInit(pScreen, &xprRootlessProcs);
-
- rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
- rootless_FillBytes_threshold = xp_fill_bytes_threshold;
- rootless_CompositePixels_threshold = xp_composite_area_threshold;
- rootless_CopyWindow_threshold = xp_scroll_area_threshold;
-
- no_configure_window = FALSE;
-
- return TRUE;
-}
-
-
-/*
- * Given the id of a physical window, try to find the top-level (or root)
- * X window that it represents.
- */
-static WindowPtr
-xprGetXWindow(xp_window_id wid)
-{
- RootlessWindowRec *winRec;
-
- if (window_hash == NULL)
- return NULL;
-
- winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
-
- return winRec != NULL ? winRec->win : NULL;
-}
-
-
-/*
- * The windowNumber is an AppKit window number. Returns TRUE if xpr is
- * displaying a window with that number.
- */
-Bool
-xprIsX11Window(void *nsWindow, int windowNumber)
-{
- Bool ret;
- xp_window_id wid;
-
- if (window_hash == NULL)
- return FALSE;
-
- /* need to lock, since this function can be called by any thread */
-
- pthread_mutex_lock(&window_hash_mutex);
-
- if (xp_lookup_native_window(windowNumber, &wid))
- ret = xprGetXWindow(wid) != NULL;
- else
- ret = FALSE;
-
- pthread_mutex_unlock(&window_hash_mutex);
-
- return ret;
-}
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c
deleted file mode 100644
index 8090a27b1..000000000
--- a/hw/darwin/quartz/xpr/xprScreen.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Xplugin rootless implementation screen functions
- */
-/*
- * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.8 2003/11/12 20:21:52 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "quartz.h"
-#include "xpr.h"
-#include "pseudoramiX.h"
-#include "darwin.h"
-#include "rootless.h"
-#include "safeAlpha.h"
-#include "dri.h"
-#include "globals.h"
-#include "Xplugin.h"
-#include "applewmExt.h"
-
-// Name of GLX bundle for native OpenGL
-static const char *xprOpenGLBundle = "glxCGL.bundle";
-
-
-/*
- * eventHandler
- * Callback handler for Xplugin events.
- */
-static void
-eventHandler(unsigned int type, const void *arg,
- unsigned int arg_size, void *data)
-{
- switch (type)
- {
- case XP_EVENT_DISPLAY_CHANGED:
- QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
- break;
-
- case XP_EVENT_WINDOW_STATE_CHANGED:
- if (arg_size >= sizeof(xp_window_state_event))
- {
- const xp_window_state_event *ws_arg = arg;
- QuartzMessageServerThread(kXDarwinWindowState, 2,
- ws_arg->id, ws_arg->state);
- }
- break;
-
- case XP_EVENT_WINDOW_MOVED:
- if (arg_size == sizeof(xp_window_id))
- {
- xp_window_id id = * (xp_window_id *) arg;
-
- QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
- }
- break;
-
- case XP_EVENT_SURFACE_DESTROYED:
- case XP_EVENT_SURFACE_CHANGED:
- if (arg_size == sizeof(xp_surface_id))
- {
- int kind;
-
- if (type == XP_EVENT_SURFACE_DESTROYED)
- kind = AppleDRISurfaceNotifyDestroyed;
- else
- kind = AppleDRISurfaceNotifyChanged;
-
- DRISurfaceNotify(*(xp_surface_id *) arg, kind);
- }
- break;
- }
-}
-
-
-/*
- * displayScreenBounds
- * Return the display ID for a particular display index.
- */
-static CGDirectDisplayID
-displayAtIndex(int index)
-{
- CGError err;
- CGDisplayCount cnt;
- CGDirectDisplayID dpy[index+1];
-
- err = CGGetActiveDisplayList(index + 1, dpy, &cnt);
- if (err == kCGErrorSuccess && cnt == index + 1)
- return dpy[index];
- else
- return kCGNullDirectDisplay;
-}
-
-
-/*
- * displayScreenBounds
- * Return the bounds of a particular display.
- */
-static CGRect
-displayScreenBounds(CGDirectDisplayID id)
-{
- CGRect frame;
-
- frame = CGDisplayBounds(id);
-
- /* Remove menubar to help standard X11 window managers. */
-
- if (frame.origin.x == 0 && frame.origin.y == 0)
- {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
-
- return frame;
-}
-
-
-/*
- * addPseudoramiXScreens
- * Add a physical screen with PseudoramiX.
- */
-static void
-addPseudoramiXScreens(int *x, int *y, int *width, int *height)
-{
- CGDisplayCount i, displayCount;
- CGDirectDisplayID *displayList = NULL;
- CGRect unionRect = CGRectNull, frame;
-
- // Find all the CoreGraphics displays
- CGGetActiveDisplayList(0, NULL, &displayCount);
- displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
- CGGetActiveDisplayList(displayCount, displayList, &displayCount);
-
- /* Get the union of all screens */
- for (i = 0; i < displayCount; i++)
- {
- CGDirectDisplayID dpy = displayList[i];
- frame = displayScreenBounds(dpy);
- unionRect = CGRectUnion(unionRect, frame);
- }
-
- /* Use unionRect as the screen size for the X server. */
- *x = unionRect.origin.x;
- *y = unionRect.origin.y;
- *width = unionRect.size.width;
- *height = unionRect.size.height;
-
- /* Tell PseudoramiX about the real screens. */
- for (i = 0; i < displayCount; i++)
- {
- CGDirectDisplayID dpy = displayList[i];
-
- frame = displayScreenBounds(dpy);
-
- ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
- (int)frame.size.width, (int)frame.size.height,
- (int)frame.origin.x, (int)frame.origin.y);
-
- frame.origin.x -= unionRect.origin.x;
- frame.origin.y -= unionRect.origin.y;
-
- ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
- i, (int)frame.origin.x, (int)frame.origin.y);
-
- PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
- frame.size.width, frame.size.height);
- }
-
- xfree(displayList);
-}
-
-
-/*
- * xprDisplayInit
- * Find number of CoreGraphics displays and initialize Xplugin.
- */
-static void
-xprDisplayInit(void)
-{
- CGDisplayCount displayCount;
-
- ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n");
-
- CGGetActiveDisplayList(0, NULL, &displayCount);
-
- /* With PseudoramiX, the X server only sees one screen; only PseudoramiX
- itself knows about all of the screens. */
-
- if (noPseudoramiXExtension)
- darwinScreensFound = displayCount;
- else
- darwinScreensFound = 1;
-
- if (xp_init(XP_IN_BACKGROUND) != Success)
- {
- FatalError("Could not initialize the Xplugin library.");
- }
-
- xp_select_events(XP_EVENT_DISPLAY_CHANGED
- | XP_EVENT_WINDOW_STATE_CHANGED
- | XP_EVENT_WINDOW_MOVED
- | XP_EVENT_SURFACE_CHANGED
- | XP_EVENT_SURFACE_DESTROYED,
- eventHandler, NULL);
-
- AppleDRIExtensionInit();
- xprAppleWMInit();
-}
-
-
-/*
- * xprAddScreen
- * Init the framebuffer and record pixmap parameters for the screen.
- */
-static Bool
-xprAddScreen(int index, ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- /* If no specific depth chosen, look for the depth of the main display.
- Else if 16bpp specified, use that. Else use 32bpp. */
-
- dfb->colorType = TrueColor;
- dfb->bitsPerComponent = 8;
- dfb->bitsPerPixel = 32;
- dfb->colorBitsPerPixel = 24;
-
- if (darwinDesiredDepth == -1)
- {
- dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
- dfb->colorBitsPerPixel =
- CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
- dfb->bitsPerComponent;
- }
- else if (darwinDesiredDepth == 15)
- {
- dfb->bitsPerComponent = 5;
- dfb->bitsPerPixel = 16;
- dfb->colorBitsPerPixel = 15;
- }
- else if (darwinDesiredDepth == 8)
- {
- dfb->colorType = PseudoColor;
- dfb->bitsPerComponent = 8;
- dfb->bitsPerPixel = 8;
- dfb->colorBitsPerPixel = 8;
- }
-
- if (noPseudoramiXExtension)
- {
- CGDirectDisplayID dpy;
- CGRect frame;
-
- dpy = displayAtIndex(index);
-
- frame = displayScreenBounds(dpy);
-
- dfb->x = frame.origin.x;
- dfb->y = frame.origin.y;
- dfb->width = frame.size.width;
- dfb->height = frame.size.height;
- }
- else
- {
- addPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
- }
-
- /* Passing zero width (pitch) makes miCreateScreenResources set the
- screen pixmap to the framebuffer pointer, i.e. NULL. The generic
- rootless code takes care of making this work. */
- dfb->pitch = 0;
- dfb->framebuffer = NULL;
-
- DRIScreenInit(pScreen);
-
- return TRUE;
-}
-
-
-/*
- * xprSetupScreen
- * Setup the screen for rootless access.
- */
-static Bool
-xprSetupScreen(int index, ScreenPtr pScreen)
-{
- // Add alpha protecting replacements for fb screen functions
- pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
- pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
-
-#ifdef RENDER
- {
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- ps->Composite = SafeAlphaComposite;
- }
-#endif /* RENDER */
-
- // Initialize generic rootless code
- if (!xprInit(pScreen))
- return FALSE;
-
- return DRIFinishScreenInit(pScreen);
-}
-
-
-/*
- * xprInitInput
- * Finalize xpr specific setup.
- */
-static void
-xprInitInput(int argc, char **argv)
-{
- int i;
-
- rootlessGlobalOffsetX = darwinMainScreenX;
- rootlessGlobalOffsetY = darwinMainScreenY;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- AppleWMSetScreenOrigin(WindowTable[i]);
-}
-
-
-/*
- * Quartz display mode function list.
- */
-static QuartzModeProcsRec xprModeProcs = {
- xprDisplayInit,
- xprAddScreen,
- xprSetupScreen,
- xprInitInput,
- QuartzInitCursor,
- NULL, // No need to update cursor
- QuartzSuspendXCursor,
- QuartzResumeXCursor,
- NULL, // No capture or release in rootless mode
- NULL,
- xprIsX11Window,
- RootlessFrameForWindow,
- TopLevelParent,
- DRICreateSurface,
- DRIDestroySurface
-};
-
-
-/*
- * QuartzModeBundleInit
- * Initialize the display mode bundle after loading.
- */
-Bool
-QuartzModeBundleInit(void)
-{
- quartzProcs = &xprModeProcs;
- quartzOpenGLBundle = xprOpenGLBundle;
- return TRUE;
-}
diff --git a/hw/darwin/utils/README.txt b/hw/darwin/utils/README.txt
deleted file mode 100644
index 94d61b1f0..000000000
--- a/hw/darwin/utils/README.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-dumpkeymap - Diagnostic dump and detailed description of .keymapping files
-Version 4
-
-Copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-Eric Sunshine, 1 December 2000
-
-OVERVIEW
-========
-This package contains the diagnostic utility dumpkeymap, as well as highly
-detailed documentation describing the internal layout of the Apple/NeXT
-.keymapping file.
-
-The dumpkeymap utility displays detailed information about each .keymapping
-file mentioned on the command-line. On Apple and NeXT platforms, if no
-.keymapping files are mentioned on the command-line, then it will instead
-dissect the key mapping currently in use by the WindowServer and AppKit.
-
-Documentation includes a thorough and detailed description of the internal
-layout of the .keymapping file, as well as an explanation of how to interpret
-the output of dumpkeymap.
-
-The complete set of documentation is available for perusal via dumpkeymap's
-manual page (dumpkeymap.1), as well as via the command-line options described
-below.
-
- --help
- Usage summary.
- --help-keymapping
- Detailed discussion of the internal format of a .keymapping file.
- --help-output
- Explanation of dumpkeymap's output.
- --help-files
- List of key mapping-related files and directories.
- --help-diagnostics
- Explanation of diagnostic messages.
-
-Once the manual page is been installed, documentation can also be accessed
-with the Unix `man' command:
-
- % man dumpkeymap
-
-
-COMPILATION
-===========
-MacOS/X, Darwin
-
- cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
-
-MacOS/X DP4 (Developer Preview 4)
-
- cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
-
-MacOS/X Server, OpenStep, NextStep
-
- cc -Wall -o dumpkeymap dumpkeymap.c
-
-By default, dumpkeymap is configured to interface with the HID driver (Apple)
-or event-status driver (NeXT), thus allowing it to dump the key mapping which
-is currently in use by the WindowServer and AppKit. However, these facilities
-are specific to Apple/NeXT. In order to build dumpkeymap for non-Apple/NeXT
-platforms, you must define the DUMPKEYMAP_FILE_ONLY flag when compiling the
-program. This flag inhibits use of the HID and event-status drivers and
-configures dumpkeymap to work strictly with raw key mapping files.
-
-For example, to compile for Linux:
-
- gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
-
-
-INSTALLATION
-============
-Install the dumpkeymap executable image in a location mentioned in the PATH
-environment variable. Typicall locations for executable files are:
-
- /usr/local/bin
- $(HOME)/bin
-
-Install the manual page, dumpkeymap.1, in the `man1' subdirectory one of the
-standard manual page locations or in any other location mentioned by the
-MANPATH environment variable.
-
-Typical locations for manual pages on most Unix platforms are:
-
- /usr/local/man/man1
-
-Typical locations for manual pages on MacOS/X, Darwin, and MacOS/X Server are:
-
- /usr/local/man/man1
- /Local/Documentation/ManPages/man1
- /Network/Documentation/ManPages/man1
-
-Typical locations for manual pages on OpenStep and NextStep are:
-
- /usr/local/man/man1
- /LocalLibrary/Documentation/ManPages/man1
- /LocalDeveloper/Documentation/ManPages/man1
-
-
-CONCLUSION
-==========
-This program and its accompanying documentation were written by Eric Sunshine
-and are copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>.
-
-The implementation of dumpkeymap is based upon information gathered on
-September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and Paul S.
-McCarthy <zarnuk@zarnuk.com> during an effort to reverse engineer the format
-of the NeXT .keymapping file.
-
-
-
-$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.2 2000/12/05 21:18:34 dawes Exp $
diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c
deleted file mode 100644
index a264cbc10..000000000
--- a/hw/darwin/utils/dumpkeymap.c
+++ /dev/null
@@ -1,1454 +0,0 @@
-// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.4 2003/04/13 14:52:51 herrb Exp $
-//=============================================================================
-//
-// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the author may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-//=============================================================================
-//-----------------------------------------------------------------------------
-// dumpkeymap.c
-//
-// Prints a textual representation of each Apple/NeXT .keymapping file
-// mentioned on the command-line. If no files are mentioned and if the
-// local machine is an Apple or NeXT installation, then the key mapping
-// currently in use by the WindowServer and the AppKit is printed
-// instead.
-//
-// Invoke dumpkeymap with one of the options listed below in order to
-// view detailed documentation about .keymapping files and the use of
-// this program.
-//
-// --help: Usage summary.
-// --help-keymapping: Detailed discussion of the internal format of a
-// .keymapping file.
-// --help-output: Explanation of dumpkeymap's output.
-// --help-files: List of key mapping-related files and directories.
-// --help-diagnostics: Explanation of diagnostic messages.
-//
-// COMPILATION INSTRUCTIONS
-//
-// MacOS/X, Darwin
-// cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
-//
-// MacOS/X DP4 (Developer Preview 4)
-// cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
-//
-// MacOS/X Server, OpenStep, NextStep
-// cc -Wall -o dumpkeymap dumpkeymap.c
-//
-// By default, dumpkeymap is configured to interface with the HID driver
-// (Apple) or event-status driver (NeXT), thus allowing it to dump the
-// key mapping which is currently in use by the WindowServer and AppKit.
-// However, these facilities are specific to Apple/NeXT. In order to
-// build dumpkeymap for non-Apple/NeXT platforms, you must define the
-// DUMPKEYMAP_FILE_ONLY flag when compiling the program. This flag
-// inhibits use of the HID and event-status drivers and configures
-// dumpkeymap to work strictly with raw key mapping files.
-//
-// For example, to compile for Linux:
-// gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
-//
-// CONCLUSION
-//
-// This program and its accompanying documentation were written by Eric
-// Sunshine and are copyright (C)1999,2000 by Eric Sunshine
-// <sunshine@sunshineco.com>.
-//
-// The implementation of dumpkeymap is based upon information gathered
-// on September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and
-// Paul S. McCarthy <zarnuk@zarnuk.com> during an effort to reverse
-// engineer the format of the NeXT .keymapping file.
-//
-// HISTORY
-//
-// v4 2000/12/01 Eric Sunshine <sunshine@sunshineco.com>
-// Updated manual page to work with `rman', the `man' to `HTML'
-// translator. Unfortunately, however, rman is missing important
-// roff features such as diversions, indentation, and tab stops,
-// and is also hideously buggy, so getting the manual to work with
-// rman required quite a few work-arounds.
-// The manual page has now been tested with nroff (plain text), troff
-// (PostScript, etc.), groff (PostScript), and rman (HTML, etc.)
-//
-// v3 2000/11/28 Eric Sunshine <sunshine@sunshineco.com>
-// Considerably expanded the documentation.
-// Augmented the existing description of .keymapping internals.
-// Added these new documentation topics:
-// - Output: Very important section describing how to interpret
-// the output of dumpkeymap.
-// - Files: Lists files and directories related to key mappings.
-// - Diagnostics: Explains diagnostic messages issued by
-// dumpkeymap.
-// Created a manual page (dumpkeymap.1) which contains the complete
-// set of documentation for key mapping files and dumpkeymap.
-// Added command-line options (--help, --help-keymapping,
-// --help-output, --help-files, --help-diagnostics) which allow
-// access to all key mapping documentation. Previously the
-// description of the internal layout of a .keymapping file was
-// only available as source code comments.
-// Added --version option.
-// Ported to non-Apple/NeXT platforms. Defining the pre-processor
-// flag DUMPKEYMAP_FILE_ONLY at compilation time inhibits use of
-// Apple/NeXT-specific API.
-// Added a README file.
-//
-// v2 2000/11/13 Eric Sunshine <sunshine@sunshineco.com>
-// Converted from C++ to plain-C.
-// Now parses and takes into account the "number-size" flag stored
-// with each key map. This flag indicates the size, in bytes, of
-// all remaining numeric values in the mapping. Updated all code
-// to respect this flag. (Previously, the purpose of this field
-// was unknown, and it was thus denoted as
-// `KeyMapping::fill[2]'.)
-// Updated all documentation; especially the "KEY MAPPING
-// DESCRIPTION" section. Added discussion of the "number-size"
-// flag and revamped all structure definitions to use the generic
-// data type `number' instead of `uchar' or 'byte'. Clarified
-// several sections of the documentation and added missing
-// discussions about type definitions and the relationship of
-// `interface' and `handler_id' to .keymapping and .keyboard
-// files.
-// Updated compilation instructions to include directions for all
-// platforms on which this program might be built.
-// Now published under the formal BSD license rather than a
-// home-grown license.
-//
-// v1 1999/09/08 Eric Sunshine <sunshine@sunshineco.com>
-// Created.
-//-----------------------------------------------------------------------------
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#if !defined(DUMPKEYMAP_FILE_ONLY)
-#include <drivers/event_status_driver.h>
-#endif
-
-#define PROG_NAME "dumpkeymap"
-#define PROG_VERSION "4"
-#define AUTHOR_NAME "Eric Sunshine"
-#define AUTHOR_EMAIL "sunshine@sunshineco.com"
-#define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">"
-#define COPYRIGHT "Copyright (C) 1999,2000 by " AUTHOR_INFO
-
-typedef unsigned char byte;
-typedef unsigned short word;
-typedef unsigned int natural;
-typedef unsigned long dword;
-typedef dword number;
-
-#define ASCII_SET 0x00
-#define BIND_FUNCTION 0xfe
-#define BIND_SPECIAL 0xff
-
-#define OPT_SWITCH(X) { char const* switched_str__=(X); if (0) {
-#define OPT_CASE(X,Y) } else if (strcmp(switched_str__,(#X)) == 0 || \
- strcmp(switched_str__,(#Y)) == 0) {
-#define OPT_DEFAULT } else {
-#define OPT_SWITCH_END }}
-
-//-----------------------------------------------------------------------------
-// Translation Tables
-//-----------------------------------------------------------------------------
-static char const* const SPECIAL_CODE[] =
- {
- "sound-up",
- "sound-down",
- "brightness-up",
- "brightness-down",
- "alpha-lock",
- "help",
- "power",
- "secondary-up-arrow",
- "secondary-down-arrow"
- };
-#define N_SPECIAL_CODE (sizeof(SPECIAL_CODE) / sizeof(SPECIAL_CODE[0]))
-
-static char const* const MODIFIER_CODE[] =
- {
- "alpha-lock",
- "shift",
- "control",
- "alternate",
- "command",
- "keypad",
- "help"
- };
-#define N_MODIFIER_CODE (sizeof(MODIFIER_CODE) / sizeof(MODIFIER_CODE[0]))
-
-static char const* const MODIFIER_MASK[] =
- {
- "-----", // R = carriage-return
- "----L", // A = alternate
- "---S-", // C = control
- "---SL", // S = shift
- "--C--", // L = alpha-lock
- "--C-L",
- "--CS-",
- "--CSL",
- "-A---",
- "-A--L",
- "-A-S-",
- "-A-SL",
- "-AC--",
- "-AC-L",
- "-ACS-",
- "-ACSL",
- "R----",
- "R---L",
- "R--S-",
- "R--SL",
- "R-C--",
- "R-C-L",
- "R-CS-",
- "R-CSL",
- "RA---",
- "RA--L",
- "RA-S-",
- "RA-SL",
- "RAC--",
- "RAC-L",
- "RACS-",
- "RACSL",
- };
-#define N_MODIFIER_MASK (sizeof(MODIFIER_MASK) / sizeof(MODIFIER_MASK[0]))
-
-#define FUNCTION_KEY_FIRST 0x20
-static char const* const FUNCTION_KEY[] =
- {
- "F1", // 0x20
- "F2", // 0x21
- "F3", // 0x22
- "F4", // 0x23
- "F5", // 0x24
- "F6", // 0x25
- "F7", // 0x26
- "F8", // 0x27
- "F9", // 0x28
- "F10", // 0x29
- "F11", // 0x2a
- "F12", // 0x2b
- "insert", // 0x2c
- "delete", // 0x2d
- "home", // 0x2e
- "end", // 0x2f
- "page up", // 0x30
- "page down", // 0x31
- "print screen", // 0x32
- "scroll lock", // 0x33
- "pause", // 0x34
- "sys-request", // 0x35
- "break", // 0x36
- "reset (HIL)", // 0x37
- "stop (HIL)", // 0x38
- "menu (HIL)", // 0x39
- "user (HIL)", // 0x3a
- "system (HIL)", // 0x3b
- "print (HIL)", // 0x3c
- "clear line (HIL)", // 0x3d
- "clear display (HIL)", // 0x3e
- "insert line (HIL)", // 0x3f
- "delete line (HIL)", // 0x40
- "insert char (HIL)", // 0x41
- "delete char (HIL)", // 0x42
- "prev (HIL)", // 0x43
- "next (HIL)", // 0x44
- "select (HIL)", // 0x45
- };
-#define N_FUNCTION_KEY (sizeof(FUNCTION_KEY) / sizeof(FUNCTION_KEY[0]))
-
-
-//-----------------------------------------------------------------------------
-// Data Stream Object
-// Can be configured to treat embedded "numbers" as being composed of
-// either 1, 2, or 4 bytes, apiece.
-//-----------------------------------------------------------------------------
-typedef struct _DataStream
- {
- byte const* data;
- byte const* data_end;
- natural number_size; // Size in bytes of a "number" in the stream.
- } DataStream;
-
-static DataStream* new_data_stream( byte const* data, int size )
- {
- DataStream* s = (DataStream*)malloc( sizeof(DataStream) );
- s->data = data;
- s->data_end = data + size;
- s->number_size = 1; // Default to byte-sized numbers.
- return s;
- }
-
-static void destroy_data_stream( DataStream* s )
- {
- free(s);
- }
-
-static int end_of_stream( DataStream* s )
- {
- return (s->data >= s->data_end);
- }
-
-static void expect_nbytes( DataStream* s, int nbytes )
- {
- if (s->data + nbytes > s->data_end)
- {
- fputs( "Insufficient data in keymapping data stream.\n", stderr );
- exit(-1);
- }
- }
-
-static byte get_byte( DataStream* s )
- {
- expect_nbytes( s, 1 );
- return *s->data++;
- }
-
-static word get_word( DataStream* s )
- {
- word hi, lo;
- expect_nbytes( s, 2 );
- hi = *s->data++;
- lo = *s->data++;
- return ((hi << 8) | lo);
- }
-
-static dword get_dword( DataStream* s )
- {
- dword b1, b2, b3, b4;
- expect_nbytes( s, 4 );
- b4 = *s->data++;
- b3 = *s->data++;
- b2 = *s->data++;
- b1 = *s->data++;
- return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
- }
-
-static number get_number( DataStream* s )
- {
- switch (s->number_size)
- {
- case 4: return get_dword(s);
- case 2: return get_word(s);
- default: return get_byte(s);
- }
- }
-
-
-//-----------------------------------------------------------------------------
-// Translation Utility Functions
-//-----------------------------------------------------------------------------
-static char const* special_code_desc( number n )
- {
- if (n < N_SPECIAL_CODE)
- return SPECIAL_CODE[n];
- else
- return "invalid";
- }
-
-static char const* modifier_code_desc( number n )
- {
- if (n < N_MODIFIER_CODE)
- return MODIFIER_CODE[n];
- else
- return "invalid";
- }
-
-static char const* modifier_mask_desc( number n )
- {
- if (n < N_MODIFIER_MASK)
- return MODIFIER_MASK[n];
- else
- return "?????";
- }
-
-static char const* function_key_desc( number n )
- {
- if (n >= FUNCTION_KEY_FIRST && n < N_FUNCTION_KEY + FUNCTION_KEY_FIRST)
- return FUNCTION_KEY[ n - FUNCTION_KEY_FIRST ];
- else
- return "unknown";
- }
-
-static number bits_set( number mask )
- {
- number n = 0;
- for ( ; mask != 0; mask >>= 1)
- if ((mask & 0x01) != 0)
- n++;
- return n;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of Modifier records.
-//-----------------------------------------------------------------------------
-static void unparse_modifiers( DataStream* s )
- {
- number nmod = get_number(s); // Modifier count
- printf( "MODIFIERS [%lu]\n", nmod );
- while (nmod-- > 0)
- {
- number nscan;
- number const code = get_number(s);
- printf( "%s:", modifier_code_desc(code) );
- nscan = get_number(s);
- while (nscan-- > 0)
- printf( " 0x%02x", (natural)get_number(s) );
- putchar( '\n' );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of Character records.
-//-----------------------------------------------------------------------------
-typedef void (*UnparseSpecialFunc)( number code );
-
-static void unparse_char_codes(
- DataStream* s, number ncodes, UnparseSpecialFunc unparse_special )
- {
- if (ncodes != 0)
- {
- while (ncodes-- > 0)
- {
- number const char_set = get_number(s);
- number const code = get_number(s);
- putchar(' ');
- switch (char_set)
- {
- case ASCII_SET:
- {
- int const c = (int)code;
- if (isprint(c))
- printf( "\"%c\"", c );
- else if (code < ' ')
- printf( "\"^%c\"", c + '@' );
- else
- printf( "%02x", c );
- break;
- }
- case BIND_FUNCTION:
- printf( "[%s]", function_key_desc(code) );
- break;
- case BIND_SPECIAL:
- unparse_special( code );
- break;
- default:
- printf( "%02x/%02x", (natural)char_set, (natural)code );
- break;
- }
- }
- }
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of scan code bindings.
-//-----------------------------------------------------------------------------
-static void unparse_key_special( number code )
- {
- printf( "{seq#%lu}", code );
- }
-
-static void unparse_characters( DataStream* s )
- {
- number const NOT_BOUND = 0xff;
- number const nscans = get_number(s);
- number scan;
- printf( "CHARACTERS [%lu]\n", nscans );
- for (scan = 0; scan < nscans; scan++)
- {
- number const mask = get_number(s);
- printf( "scan 0x%02x: ", (natural)scan );
- if (mask == NOT_BOUND)
- fputs( "not-bound\n", stdout );
- else
- {
- number const bits = bits_set( mask );
- number const codes = 1 << bits;
- printf( "%s ", modifier_mask_desc(mask) );
- unparse_char_codes( s, codes, unparse_key_special );
- putchar( '\n' );
- }
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of key sequences.
-//-----------------------------------------------------------------------------
-static void unparse_sequence_special( number code )
- {
- printf( "{%s}", (code == 0 ? "unmodify" : modifier_code_desc(code)) );
- }
-
-static void unparse_sequences( DataStream* s )
- {
- number const nseqs = get_number(s);
- number seq;
- printf( "SEQUENCES [%lu]\n", nseqs );
- for (seq = 0; seq < nseqs; seq++)
- {
- number const nchars = get_number(s);
- printf( "sequence %lu:", seq );
- unparse_char_codes( s, nchars, unparse_sequence_special );
- putchar( '\n' );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of special keys.
-//-----------------------------------------------------------------------------
-static void unparse_specials( DataStream* s )
- {
- number nspecials = get_number(s);
- printf( "SPECIALS [%lu]\n", nspecials );
- while (nspecials-- > 0)
- {
- number const special = get_number(s);
- number const scan = get_number(s);
- printf( "%s: 0x%02x\n", special_code_desc(special), (natural)scan );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse the number-size flag.
-//-----------------------------------------------------------------------------
-static void unparse_numeric_size( DataStream* s )
- {
- word const numbers_are_shorts = get_word(s);
- s->number_size = numbers_are_shorts ? 2 : 1;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse an entire key map.
-//-----------------------------------------------------------------------------
-static void unparse_keymap_data( DataStream* s )
- {
- unparse_numeric_size(s);
- unparse_modifiers(s);
- unparse_characters(s);
- unparse_sequences(s);
- unparse_specials(s);
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse the active key map.
-//-----------------------------------------------------------------------------
-#if !defined(DUMPKEYMAP_FILE_ONLY)
-static int unparse_active_keymap( void )
- {
- int rc = 1;
- NXEventHandle const h = NXOpenEventStatus();
- if (h == 0)
- fputs( "Unable to open event status driver.\n", stderr );
- else
- {
- NXKeyMapping km;
- km.size = NXKeyMappingLength(h);
- if (km.size <= 0)
- fprintf( stderr, "Bad key mapping length (%d).\n", km.size );
- else
- {
- km.mapping = (char*)malloc( km.size );
- if (NXGetKeyMapping( h, &km ) == 0)
- fputs( "Unable to get current key mapping.\n", stderr );
- else
- {
- DataStream* stream =
- new_data_stream( (byte const*)km.mapping, km.size );
- fputs( "=============\nACTIVE KEYMAP\n=============\n\n",
- stdout);
- unparse_keymap_data( stream );
- destroy_data_stream( stream );
- rc = 0;
- }
- free( km.mapping );
- }
- NXCloseEventStatus(h);
- }
- return rc;
- }
-#endif
-
-
-//-----------------------------------------------------------------------------
-// Unparse one key map from a keymapping file.
-//-----------------------------------------------------------------------------
-static void unparse_keymap( DataStream* s )
- {
- dword const interface = get_dword(s);
- dword const handler_id = get_dword(s);
- dword const map_size = get_dword(s);
- printf( "interface: 0x%02lx\nhandler_id: 0x%02lx\nmap_size: %lu bytes\n\n",
- interface, handler_id, map_size );
- unparse_keymap_data(s);
- }
-
-
-//-----------------------------------------------------------------------------
-// Check the magic number of a keymapping file.
-//-----------------------------------------------------------------------------
-static int check_magic_number( DataStream* s )
- {
- return (get_byte(s) == 'K' &&
- get_byte(s) == 'Y' &&
- get_byte(s) == 'M' &&
- get_byte(s) == '1');
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse all key maps within a keymapping file.
-//-----------------------------------------------------------------------------
-static int unparse_keymaps( DataStream* s )
- {
- int rc = 0;
- if (check_magic_number(s))
- {
- int n = 1;
- while (!end_of_stream(s))
- {
- printf( "---------\nKEYMAP #%d\n---------\n", n++ );
- unparse_keymap(s);
- }
- }
- else
- {
- fputs( "Bad magic number.\n", stderr );
- rc = 1;
- }
- return rc;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a keymapping file.
-//-----------------------------------------------------------------------------
-static int unparse_keymap_file( char const* const path )
- {
- int rc = 1;
- FILE* file;
- printf( "===========\nKEYMAP FILE\n===========\n%s\n\n", path );
- file = fopen( path, "rb" );
- if (file == 0)
- perror( "Unable to open key mapping file" );
- else
- {
- struct stat st;
- if (fstat( fileno(file), &st ) != 0)
- perror( "Unable to determine key mapping file size" );
- else
- {
- byte* buffer = (byte*)malloc( st.st_size );
- if (fread( buffer, st.st_size, 1, file ) != 1)
- perror( "Unable to read key mapping file" );
- else
- {
- DataStream* stream = new_data_stream(buffer, (int)st.st_size);
- fclose( file ); file = 0;
- rc = unparse_keymaps( stream );
- destroy_data_stream( stream );
- }
- free( buffer );
- }
- if (file != 0)
- fclose( file );
- }
- return rc;
- }
-
-
-//-----------------------------------------------------------------------------
-// Handle the case when no documents are mentioned on the command-line. For
-// Apple/NeXT platforms, dump the currently active key mapping; else display
-// an error message.
-//-----------------------------------------------------------------------------
-static int handle_empty_document_list( void )
- {
-#if !defined(DUMPKEYMAP_FILE_ONLY)
- return unparse_active_keymap();
-#else
- fputs( "ERROR: Must specify at least one .keymapping file.\n\n", stderr );
- return 1;
-#endif
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a detailed description of the internal layout of a key mapping.
-//-----------------------------------------------------------------------------
-static void print_internal_layout_info( FILE* f )
- {
- fputs(
-"What follows is a detailed descriptions of the internal layout of an\n"
-"Apple/NeXT .keymapping file.\n"
-"\n"
-"Types and Data\n"
-"--------------\n"
-"The following type definitions are employed throughout this discussion:\n"
-"\n"
-" typedef unsigned char byte;\n"
-" typedef unsigned short word;\n"
-" typedef unsigned long dword;\n"
-"\n"
-"Additionally, the type definition `number' is used generically to indicate\n"
-"a numeric value. The actual size of the `number' type may be one or two\n"
-"bytes depending upon how the data is stored in the key map. Although most\n"
-"key maps use byte-sized numeric values, word-sized values are also allowed.\n"
-"\n"
-"Multi-byte values in a key mapping file are stored in big-endian byte\n"
-"order.\n"
-"\n"
-"Key Mapping File and Device Mapping\n"
-"-----------------------------------\n"
-"A key mapping file begins with a magic-number and continues with a variable\n"
-"number of device-specific key mappings.\n"
-"\n"
-" struct KeyMappingFile {\n"
-" char magic_number[4]; // `KYM1'\n"
-" DeviceMapping maps[...]; // Variable number of maps\n"
-" };\n"
-"\n"
-" struct DeviceMapping {\n"
-" dword interface; // Interface type\n"
-" dword handler_id; // Interface subtype\n"
-" dword map_size; // Byte count of `map' (below)\n"
-" KeyMapping map;\n"
-" };\n"
-"\n"
-"The value of `interface' represents a family of keyboard device types\n"
-"(such as Intel PC, ADB, NeXT, Sun Type5, etc.), and is generally\n"
-"specified as one of the constant values NX_EVS_DEVICE_INTERFACE_ADB,\n"
-"NX_EVS_DEVICE_INTERFACE_ACE, etc., which are are defined in IOHIDTypes.h on\n"
-"MacOS/X and Darwin, and in ev_types.h on MacOS/X Server, OpenStep, and\n"
-"NextStep.\n"
-"\n"
-"The value of `handler_id' represents a specific keyboard layout within the\n"
-"much broader `interface' family. For instance, for a 101-key Intel PC\n"
-"keyboard (of type NX_EVS_DEVICE_INTERFACE_ACE) the `handler_id' is '0',\n"
-"whereas for a 102-key keyboard it is `1'.\n"
-"\n"
-"Together, `interface' and `handler_id' identify the exact keyboard hardware\n"
-"to which this mapping applies. Programs which display a visual\n"
-"representation of a keyboard layout, match `interface' and `handler_id'\n"
-"from the .keymapping file against the `interface' and `handler_id' values\n"
-"found in each .keyboard file.\n"
-"\n"
-"Key Mapping\n"
-"-----------\n"
-"A key mapping completely defines the relationship of all scan codes with\n"
-"their associated functionality. A KeyMapping structure is embedded within\n"
-"the DeviceMapping structure in a KeyMappingFile. The key mapping currently\n"
-"in use by the WindowServer and AppKit is also represented by a KeyMapping\n"
-"structure, and can be referred to directly by calling NXGetKeyMapping() and\n"
-"accessing the `mapping' data member of the returned NXKeyMapping structure.\n"
-"\n"
-" struct KeyMapping {\n"
-" word number_size; // 0=1 byte, non-zero=2 bytes\n"
-" number num_modifier_groups; // Modifier groups\n"
-" ModifierGroup modifier_groups[...];\n"
-" number num_scan_codes; // Scan groups\n"
-" ScanGroup scan_table[...];\n"
-" number num_sequence_lists; // Sequence lists\n"
-" Sequence sequence_lists[...];\n"
-" number num_special_keys; // Special keys\n"
-" SpecialKey special_key[...];\n"
-" };\n"
-"\n"
-"The `number_size' flag determines the size, in bytes, of all remaining\n"
-"numeric values (denoted by the type definition `number') within the key\n"
-"mapping. If its value is zero, then numbers are represented by a single\n"
-"byte. If it is non-zero, then numbers are represented by a word (two\n"
-"bytes).\n"
-"\n"
-"Modifier Group\n"
-"--------------\n"
-"A modifier group defines all scan codes which map to a particular type of\n"
-"modifier, such as `shift', `control', etc.\n"
-"\n"
-" enum Modifier {\n"
-" ALPHALOCK = 0,\n"
-" SHIFT,\n"
-" CONTROL,\n"
-" ALTERNATE,\n"
-" COMMAND,\n"
-" KEYPAD,\n"
-" HELP\n"
-" };\n"
-"\n"
-" struct ModifierGroup {\n"
-" number modifier; // A Modifier constant\n"
-" number num_scan_codes;\n"
-" number scan_codes[...]; // Variable number of scan codes\n"
-" };\n"
-"\n"
-"The scan_codes[] array contains a list of all scan codes which map to the\n"
-"specified modifier. The `shift', `command', and `alternate' modifiers are\n"
-"frequently mapped to two different scan codes, apiece, since these\n"
-"modifiers often appear on both the left and right sides of the keyboard.\n"
-"\n"
-"Scan Group\n"
-"----------\n"
-"There is one ScanGroup for each scan code generated by the given keyboard.\n"
-"This number is given by KeyMapping::num_scan_codes. The first scan group\n"
-"represents hardware scan code 0, the second represents scan code 1, etc.\n"
-"\n"
-" enum ModifierMask {\n"
-" ALPHALOCK_MASK = 1 << 0,\n"
-" SHIFT_MASK = 1 << 1,\n"
-" CONTROL_MASK = 1 << 2,\n"
-" ALTERNATE_MASK = 1 << 3,\n"
-" CARRIAGE_RETURN_MASK = 1 << 4\n"
-" };\n"
-" #define NOT_BOUND 0xff\n"
-"\n"
-" struct ScanGroup {\n"
-" number mask;\n"
-" Character characters[...];\n"
-" };\n"
-"\n"
-"For each scan code, `mask' defines which modifier combinations generate\n"
-"characters. If `mask' is NOT_BOUND (0xff) then then this scan code does\n"
-"not generate any characters ever, and its characters[] array is zero\n"
-"length. Otherwise, the characters[] array contains one Character record\n"
-"for each modifier combination.\n"
-"\n"
-"The number of records in characters[] is determined by computing (1 <<\n"
-"bits_set_in_mask). In other words, if mask is zero, then zero bits are\n"
-"set, so characters[] contains only one record. If `mask' is (SHIFT_MASK |\n"
-"CONTROL_MASK), then two bits are set, so characters[] contains four\n"
-"records.\n"
-"\n"
-"The first record always represents the character which is generated by that\n"
-"key when no modifiers are active. The remaining records represent\n"
-"characters generated by the various modifier combinations. Using the\n"
-"example with the `shift' and `control' masks set, record two would\n"
-"represent the character with the `shift' modifier active; record three, the\n"
-"`control' modifier active; and record four, both the `shift' and `control'\n"
-"modifiers active.\n"
-"\n"
-"As a special case, ALPHALOCK_MASK implies SHIFT_MASK, though only\n"
-"ALPHALOCK_MASK appears in `mask'. In this case the same character is\n"
-"generated for both the `shift' and `alpha-lock' modifiers, but only needs\n"
-"to appear once in the characters[] array.\n"
-"\n"
-"CARRIAGE_RETURN_MASK does not actually refer to a modifier key. Instead,\n"
-"it is used to distinguish the scan code which is given the special\n"
-"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
-"solo in a ScanGroup record and only the two Character records for control-M\n"
-"and control-C follow. This flag may be a throwback to an earlier time or\n"
-"may be specially interpreted by the low-level keyboard driver, but its\n"
-"purpose is otherwise enigmatic.\n"
-"Character\n"
-"---------\n"
-"Each Character record indicates the character generated when this key is\n"
-"pressed, as well as the character set which contains the character. Well\n"
-"known character sets are `ASCII' and `Symbol'. The character set can also\n"
-"be one of the meta values FUNCTION_KEY or KEY_SEQUENCE. If it is\n"
-"FUNCTION_KEY then `char_code' represents a generally well-known function\n"
-"key such as those enumerated by FunctionKey. If the character set is\n"
-"KEY_SEQUENCE then `char_code' represents a zero-base index into\n"
-"KeyMapping::sequence_lists[].\n"
-"\n"
-" enum CharacterSet {\n"
-" ASCII = 0x00,\n"
-" SYMBOL = 0x01,\n"
-" ...\n"
-" FUNCTION_KEY = 0xfe,\n"
-" KEY_SEQUENCE = 0xff\n"
-" };\n"
-"\n"
-" struct Character {\n"
-" number set; // CharacterSet of generated character\n"
-" number char_code; // Actual character generated\n"
-" };\n"
-"\n"
-" enum FunctionKey {\n"
-" F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,\n"
-" INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,\n"
-" SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU, USER,\n"
-" SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,\n"
-" DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT\n"
-" };\n"
-"\n"
-"Sequence\n"
-"--------\n"
-"When Character::set contains the meta value KEY_SEQUENCE, the scan code is\n"
-"bound to a sequence of keys rather than a single character. A sequence is\n"
-"a series of modifiers and characters which are automatically generated when\n"
-"the associated key is depressed.\n"
-"\n"
-" #define MODIFIER_KEY 0xff\n"
-"\n"
-" struct Sequence {\n"
-" number num_chars;\n"
-" Character characters[...];\n"
-" };\n"
-"\n"
-"Each generated Character is represented as previously described, with the\n"
-"exception that MODIFIER_KEY may appear in place of KEY_SEQUENCE. When the\n"
-"value of Character::set is MODIFIER_KEY then Character::char_code\n"
-"represents a modifier key rather than an actual character. If the modifier\n"
-"represented by `char_code' is non-zero, then it indicates that the\n"
-"associated modifier key has been depressed. In this case, the value is one\n"
-"of the constants enumerated by Modifier (SHIFT, CONTROL, ALTERNATE, etc.).\n"
-"If the value is zero then it means that the modifier keys have been\n"
-"released.\n"
-"\n"
-"Special Key\n"
-"-----------\n"
-"A special key is one which is scanned directly by the Mach kernel rather\n"
-"than by the WindowServer. In general, events are not generated for special\n"
-"keys.\n"
-"\n"
-" enum SpecialKeyType {\n"
-" VOLUME_UP = 0,\n"
-" VOLUME_DOWN,\n"
-" BRIGHTNESS_UP,\n"
-" BRIGHTNESS_DOWN,\n"
-" ALPHA_LOCK,\n"
-" HELP,\n"
-" POWER,\n"
-" SECONDARY_ARROW_UP,\n"
-" SECONDARY_ARROW_DOWN\n"
-" };\n"
-"\n"
-" struct SpecialKey {\n"
-" number type; // A SpecialKeyType constant\n"
-" number scan_code; // Actual scan code\n"
-" };\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print an explanation of the output generated by this program.
-//-----------------------------------------------------------------------------
-static void print_output_info( FILE* f )
- {
- fputs(
-"What follows is an explanation and description of the various pieces of\n"
-"information emitted by dumpkeymap.\n"
-"\n"
-"For a more thorough discussion of any particular piece of information\n"
-"described here, refer to the detailed description of the internal layout of\n"
-"a key mapping given by the --help-layout option.\n"
-"\n"
-"Conventions\n"
-"-----------\n"
-"Depending upon context, some numeric values are displayed in decimal\n"
-"notation, whereas others are displayed in hexadecimal notation.\n"
-"Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),\n"
-"except when explicitly noted otherwise.\n"
-"\n"
-"Key Mapping Source\n"
-"------------------\n"
-"The first piece of information presented about a particular key mapping is\n"
-"the source from which the data was gleaned. For a .keymapping file, the\n"
-"title `KEYMAP FILE' is emitted along with the path and name of the file in\n"
-"question. For the key mapping currently in use by the WindowServer and\n"
-"AppKit, the title `ACTIVE KEYMAP' is emitted instead.\n"
-"\n"
-"Device Information\n"
-"------------------\n"
-"Each .keymapping file may contain one or more raw key mappings. For\n"
-"example, a file which maps keys to a Dvorak-style layout might contain raw\n"
-"mappings for Intel PC, ADB, NeXT, and Sun Type5 keyboards.\n"
-"\n"
-"For each raw mapping, the following information is emitted:\n"
-"\n"
-" o The title `KEYMAP' along with the mapping's relative position in the\n"
-" .keymapping file.\n"
-" o The `interface' identifier.\n"
-" o The `handler_id' sub-identifier.\n"
-" o The size of the raw mapping resource counted in bytes.\n"
-"\n"
-"The `interface' and `handler_id' values, taken together, define a specific\n"
-"keyboard device. A .keyboard file, which describes the visual layout of a\n"
-"keyboard, also contains `interface' and `handler_id' identifiers. The\n"
-".keyboard file corresponding to a particular key mapping can be found by\n"
-"matching the `interface' and `handler_id' values from each resource.\n"
-"\n"
-"Modifiers\n"
-"---------\n"
-"Each mapping may contain zero or more modifier records which associate\n"
-"hardware scan codes with modifier descriptions such as `shift', `control',\n"
-"`alternate', etc. The title `MODIFIERS' is printed along with the count of\n"
-"modifier records which follow. For each modifier record, the modifier's\n"
-"name is printed along with a list of scan codes, in hexadecimal format,\n"
-"which generate that modifier value. For example:\n"
-"\n"
-" MODIFIERS [4]\n"
-" alternate: 0x1d 0x60\n"
-" control: 0x3a\n"
-" keypad: 0x52 0x53 ... 0x63 0x62\n"
-" shift: 0x2a 0x36\n"
-"\n"
-"Characters\n"
-"----------\n"
-"Each mapping may contain zero or more character records which associate\n"
-"hardware scan codes with the actual characters generated by those scan\n"
-"codes in the presence or absence of various modifier combinations. The\n"
-"title `CHARACTERS' is printed along with the count of character records\n"
-"which follow. Here is a highly abbreviated example:\n"
-"\n"
-" CHARACTERS [9]\n"
-" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
-" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
-" scan 0x0a: ---S- \"<\" \">\"\n"
-" scan 0x13: -ACS- \"2\" \"@\" \"^@\" \"^@\" b2 b3 \"^@\" \"^@\"\n"
-" scan 0x24: R---- \"^M\" \"^C\"\n"
-" scan 0x3e: ----- [F4]\n"
-" scan 0x4a: ----- [page up]\n"
-" scan 0x60: ----- {seq#3}\n"
-" scan 0x68: not-bound\n"
-"\n"
-"For each record, the hexadecimal value of the hardware scan code is\n"
-"printed, followed by a list of modifier flag combinations and the actual\n"
-"characters generated by this scan code with and without modifiers applied.\n"
-"\n"
-"The modifier flags field is composed of a combination of single letter\n"
-"representations of the various modifier types. The letters stand for:\n"
-"\n"
-" L - alpha-lock\n"
-" S - shift\n"
-" C - control\n"
-" A - alternate\n"
-" R - carriage-return\n"
-"\n"
-"As a special case, the `alpha-lock' flag also implies the `shift' flag, so\n"
-"these two flags never appear together in the same record.\n"
-"\n"
-"The combination of modifier flags determines the meaning and number of\n"
-"fields which follow. The first field after the modifier flags always\n"
-"represents the character that will be generated if no modifier keys are\n"
-"depressed. The remaining fields represent characters generated by the\n"
-"various modifier combinations. The order of the fields follows this\n"
-"general pattern:\n"
-"\n"
-" o The character generated by this scan code when no modifiers are in\n"
-" effect is listed first.\n"
-"\n"
-" o If the `L' or `S' flag is active, then the shifted character\n"
-" generated by this scan code is listed next.\n"
-"\n"
-" o If the `C' flag is active, then the control-character generated by\n"
-" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
-" is also active, then the shifted control-character is listed after\n"
-" that.\n"
-"\n"
-" o If the `A' flag is active, then the alternate-character generated by\n"
-" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
-" is active, then the shifted alternate-character is listed after that.\n"
-" If the `C' flag is also active, then the alternate-control-character\n"
-" is listed next. Finally, if the `C' and `L' or `C' and `S' flags are\n"
-" also active, then the shifted alternate-control-character is listed.\n"
-"\n"
-"The `R' flag does not actually refer to a modifier key. Instead, it is\n"
-"used to distinguish the scan code which is given the special\n"
-"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
-"solo and only the two fields for control-M and control-C follow. This flag\n"
-"may be a throwback to an earlier time or may be specially interpreted by\n"
-"the low-level keyboard driver, but its purpose is otherwise enigmatic.\n"
-"\n"
-"Recalling the example from above, the following fields can be identified:\n"
-"\n"
-" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
-"\n"
-" o Lower-case `a' is generated when no modifiers are active.\n"
-" o Upper-case `A' is generated when `shift' or `alpha-lock' are active.\n"
-" o Control-A is generated when `control' is active.\n"
-" o Control-A is generated when `control' and `shift' are active.\n"
-" o The character represented by the hexadecimal code 0xca is generated\n"
-" when `alternate' is active.\n"
-" o The character represented by 0xc7 is generated when `alternate' and\n"
-" `shift' (or `alpha-lock') are active.\n"
-" o Control-A is generated when `alternate' and `control' are active.\n"
-" o Control-A is generated when `alternate', `control' and `shift' (or\n"
-" `alpha-lock') are active.\n"
-"\n"
-"The notation used to represent a particular generated character varies.\n"
-"\n"
-" o Printable ASCII characters are quoted, as in \"x\" or \"X\".\n"
-"\n"
-" o Control-characters are quoted and prefixed with `^', as in \"^X\".\n"
-"\n"
-" o Characters with values greater than 127 (0x7f) are displayed as\n"
-" hexadecimal values without the `0x' prefix.\n"
-"\n"
-" o Characters in a non-ASCII character set (such as `Symbol') are\n"
-" displayed as two hexadecimal numbers separated by a slash, as in\n"
-" `01/4a'. The first number is the character set's identification code\n"
-" (such as `01' for the `Symbol' set), and the second number is the\n"
-" value of the generated character.\n"
-"\n"
-" o Non-printing special function characters are displayed with the\n"
-" function's common name enclosed in brackets, as in `[page up]' or\n"
-" `[F4]'.\n"
-"\n"
-" o If the binding represents a key sequence rather than a single\n"
-" character, then the sequence's identification number is enclosed in\n"
-" braces, as in `{seq#3}'.\n"
-"\n"
-"Recalling a few examples from above, the following interpretations can be\n"
-"made:\n"
-"\n"
-" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
-" scan 0x3e: ----- [F4]\n"
-" scan 0x4a: ----- [page up]\n"
-" scan 0x60: ----- {seq#3}\n"
-"\n"
-" o \"x\" and \"X\" are printable ASCII characters.\n"
-" o \"^X\" is a control-character.\n"
-" o `01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in\n"
-" the `Symbol' character set.\n"
-" o Scan code 0x3e generates function-key `F4', and scan code 0x4a\n"
-" generates function-key `page up'.\n"
-" o Scan code 0x60 is bound to key sequence #3.\n"
-"\n"
-"Finally, if a scan code is not bound to any characters, then it is\n"
-"annotated with the label `not-bound', as with example scan code 0x68 from\n"
-"above.\n"
-"\n"
-"Sequences\n"
-"---------\n"
-"A scan code (modified and unmodified) can be bound to a key sequence rather\n"
-"than generating a single character or acting as a modifier. When it is\n"
-"bound to a key sequence, a series of character invocations and modifier\n"
-"actions are automatically generated rather than a single keystroke.\n"
-"\n"
-"Each mapping may contain zero or more key sequence records. The title\n"
-"`SEQUENCES' is printed along with the count of sequence records which\n"
-"follow. For example:\n"
-"\n"
-" SEQUENCES [3]\n"
-" sequence 0: \"f\" \"o\" \"o\"\n"
-" sequence 1: {alternate} \"b\" \"a\" \"r\" {unmodify}\n"
-" sequence 2: [home] \"b\" \"a\" \"z\"\n"
-"\n"
-"The notation used to represent the sequence of generated characters is\n"
-"identical to the notation already described in the `Characters' section\n"
-"above, with the exception that modifier actions may be interposed between\n"
-"generated characters. Such modifier actions are represented by the\n"
-"modifier's name enclosed in braces. The special name `{unmodify}'\n"
-"indicates the release of the modifier keys.\n"
-"\n"
-"Thus, the sequences in the above example can be interpreted as follows:\n"
-"\n"
-" o Sequence #0 generates `foo'.\n"
-" o Sequence #1 invokes the `alternate' modifier, generates `bar', and\n"
-" then releases `alternate'.\n"
-" o Sequence #2 invokes the `home' key and then generates `baz'. In a\n"
-" text editor, this would probably result in `baz' being prepended to\n"
-" the line of text on which the cursor resides.\n"
-"\n"
-"Special Keys\n"
-"------------\n"
-"Certain keyboards feature keys which perform some type of special purpose\n"
-"function rather than generating a character or acting as a modifier. For\n"
-"instance, Apple keyboards often contain a `power' key, and NeXT keyboards\n"
-"have historically featured screen brightness and volume control keys.\n"
-"\n"
-"Each mapping may contain zero or more special-key records which associate\n"
-"hardware scan codes with such special purpose functions. The title\n"
-"`SPECIALS' is printed along with the count of records which follow. For\n"
-"each record, the special function's name is printed along with a list of\n"
-"scan codes, in hexadecimal format, which are bound to that function. For\n"
-"example:\n"
-"\n"
-" SPECIALS [6]\n"
-" alpha-lock: 0x39\n"
-" brightness-down: 0x79\n"
-" brightness-up: 0x74\n"
-" power: 0x7f\n"
-" sound-down: 0x77\n"
-" sound-up: 0x73\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a summary of the various files and directories which are related to
-// key mappings.
-//-----------------------------------------------------------------------------
-static void print_files_info( FILE* f )
- {
- fputs(
-"This is a summary of the various files and directories which are related to\n"
-"key mappings.\n"
-"\n"
-"*.keymapping\n"
-" A key mapping file which precisely defines the relationship of all\n"
-" hardware-specific keyboard scan-codes with their associated\n"
-" functionality.\n"
-"\n"
-"*.keyboard\n"
-" A file describing the physical layout of keys on a particular type of\n"
-" keyboard. Each `key' token in this file defines the position and shape\n"
-" of the key on the keyboard, as well as the associated scan code which\n"
-" that key generates. A .keymapping file, on the other hand, defines the\n"
-" characters which are generated by a particular scan code depending upon\n"
-" the state of the various modifier keys (such as shift, control, etc.).\n"
-" The `interface' and `handler_id' values from a .keymapping file are\n"
-" matched against those in each .keyboard file in order to associate a\n"
-" particular .keyboard file with a key mapping. Various GUI programs use\n"
-" the .keyboard file to display a visual representation of a keyboard for\n"
-" the user. Since these files are just plain text, they can be easily\n"
-" viewed and interpreted without the aid of a specialized program, thus\n"
-" dumpkeymap leaves these files alone.\n"
-"\n"
-"/System/Library/Keyboards\n"
-"/Network/Library/Keyboards\n"
-"/Local/Library/Keyboards\n"
-"/Library/Keyboards\n"
-" Repositories for .keymapping and .keyboard files for MacOS/X, Darwin,\n"
-" and MacOS/X Server.\n"
-"\n"
-"/NextLibrary/Keyboards\n"
-"/LocalLibrary/Keyboards\n"
-" Repositories for .keymapping and .keyboard files for OpenStep and\n"
-" NextStep.\n"
-"\n"
-"$(HOME)/Library/Keyboards\n"
-" Repository for personal .keymapping and .keyboard files.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a list of the various diagnostic messages which may be emitted.
-//-----------------------------------------------------------------------------
-static void print_diagnostics_info( FILE* f )
- {
- fputs(
-"The following diagnostic messages may be issued to the standard error\n"
-"stream.\n"
-"\n"
-"Unrecognized option.\n"
-" An unrecognized option was specified on the command-line. Invoke\n"
-" dumpkeymap with the --help option to view a list of valid options.\n"
-"\n"
-"Insufficient data in keymapping data stream.\n"
-" The key mapping file or data stream is corrupt. Either the file has\n"
-" been incorrectly truncated or a field, such as those which indicates\n"
-" the number of variable records which follow, contains a corrupt value.\n"
-"\n"
-"The following diagnostic messages have significance only when trying to\n"
-"print .keymapping files mentioned on the command-line.\n"
-"\n"
-"Bad magic number.\n"
-" The mentioned file is not a .keymapping file. The file's content does\n"
-" not start with the string `KYM1'.\n"
-"\n"
-"Unable to open key mapping file.\n"
-" The call to fopen() failed; probably because the specified path is\n"
-" invalid or dumpkeymap does not have permission to read the file.\n"
-"\n"
-"Unable to determine key mapping file size.\n"
-" The call to fstat() failed, thus memory can not be allocated for\n"
-" loading the file.\n"
-"\n"
-"Unable to read key mapping file.\n"
-" The call to fread() failed.\n"
-"\n"
-"The following diagnostic messages have significance only when trying to\n"
-"print the currently active key mapping when no .keymapping files have been\n"
-"mentioned on the command-line.\n"
-"\n"
-"Unable to open event status driver.\n"
-" The call to NXOpenEventStatus() failed.\n"
-"\n"
-"Bad key mapping length.\n"
-" The call to NXKeyMappingLength() returned a bogus value.\n"
-"\n"
-"Unable to get current key mapping.\n"
-" The call to NXGetKeyMapping() failed.\n"
-"\n"
-"The following diagnostic messages have significance only when using\n"
-"dumpkeymap on a non-Apple/NeXT platform.\n"
-"\n"
-"Must specify at least one .keymapping file.\n"
-" No .keymapping files were mentioned on the command-line. On\n"
-" non-Apple/NeXT platforms, there is no concept of a currently active\n"
-" .keymapping file, so at least one file must be mentioned on the\n"
-" command-line.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print warranty.
-//-----------------------------------------------------------------------------
-static void print_warranty( FILE* f )
- {
- fputs(
-"This software is provided by the author `AS IS' and any express or implied\n"
-"WARRANTIES, including, but not limited to, the implied warranties of\n"
-"MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE are DISCLAIMED. In NO\n"
-"EVENT shall the author be LIABLE for any DIRECT, INDIRECT, INCIDENTAL,\n"
-"SPECIAL, EXEMPLARY, or CONSEQUENTIAL damages (including, but not limited\n"
-"to, procurement of substitute goods or services; loss of use, data, or\n"
-"profits; or business interruption) however caused and on any theory of\n"
-"liability, whether in contract, strict liability, or tort (including\n"
-"negligence or otherwise) arising in any way out of the use of this\n"
-"software, even if advised of the possibility of such damage.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print this program's version number.
-//-----------------------------------------------------------------------------
-static void print_version( FILE* f )
- {
- fputs( "Version " PROG_VERSION " (built " __DATE__ ")\n\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a usage summary.
-//-----------------------------------------------------------------------------
-static void print_usage( FILE* f )
- {
- fputs(
-"Usage: dumpkeymap [options] [-] [file ...]\n"
-"\n"
-"Prints a textual representation of each Apple/NeXT .keymapping file\n"
-"mentioned on the command-line. If no files are mentioned and if the local\n"
-"machine is an Apple or NeXT installation, then the key mapping currently in\n"
-"use by the WindowServer and the AppKit is printed instead.\n"
-"\n"
-"Options:\n"
-" -h --help\n"
-" Display general program instructions and option summary.\n"
-"\n"
-" -k --help-keymapping\n"
-" Display a detailed description of the internal layout of a\n"
-" .keymapping file.\n"
-"\n"
-" -o --help-output\n"
-" Display an explanation of the output generated by dumpkeymap when\n"
-" dissecting a .keymapping file.\n"
-"\n"
-" -f --help-files\n"
-" Display a summary of the various files and directories which are\n"
-" related to key mappings.\n"
-"\n"
-" -d --help-diagnostics\n"
-" Display a list of the various diagnostic messages which may be\n"
-" emitted by dumpkeymap.\n"
-"\n"
-" -v --version\n"
-" Display the dumpkeymap version number and warranty information.\n"
-"\n"
-" - --\n"
-" Inhibit processing of options at this point in the argument list.\n"
-" An occurrence of `-' or `--' in the argument list causes all\n"
-" following arguments to be treated as file names even if an argument\n"
-" begins with a `-' character.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print an informational banner.
-//-----------------------------------------------------------------------------
-static void print_banner( FILE* f )
- {
- fputs( "\n" PROG_NAME " v" PROG_VERSION " by " AUTHOR_INFO "\n"
- COPYRIGHT "\n\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Process command-line arguments. Examine options first; collecting files
-// along the way. If all is well, process collected file list.
-//-----------------------------------------------------------------------------
-int main( int const argc, char const* const argv[] )
- {
- int rc = 0, i, nfiles = 0, more_options = 1, process_files = 1;
- int* files = (int*)calloc( argc - 1, sizeof(int) );
- print_banner( stdout );
-
- for (i = 1; i < argc; i++)
- {
- char const* const s = argv[i];
- if (!more_options || *s != '-')
- files[ nfiles++ ] = i;
- else
- {
- OPT_SWITCH(s)
- OPT_CASE(-,--)
- more_options = 0;
- OPT_CASE(-h,--help)
- print_usage( stdout );
- process_files = 0;
- OPT_CASE(-k,--help-keymapping)
- print_internal_layout_info( stdout );
- process_files = 0;
- OPT_CASE(-o,--help-output)
- print_output_info( stdout );
- process_files = 0;
- OPT_CASE(-f,--help-files)
- print_files_info( stdout );
- process_files = 0;
- OPT_CASE(-d,--help-diagnostics)
- print_diagnostics_info( stdout );
- process_files = 0;
- OPT_CASE(-v,--version)
- print_version( stdout );
- print_warranty( stdout );
- process_files = 0;
- OPT_DEFAULT
- fprintf( stderr, "ERROR: Unrecognized option: %s\n\n", s );
- process_files = 0;
- rc = 1;
- OPT_SWITCH_END
- }
- }
-
- if (process_files)
- {
- if (nfiles == 0)
- rc = handle_empty_document_list();
- else
- for (i = 0; i < nfiles; i++)
- rc |= unparse_keymap_file( argv[files[i]] );
- }
-
- free( files );
- return rc;
- }
diff --git a/hw/darwin/utils/dumpkeymap.man b/hw/darwin/utils/dumpkeymap.man
deleted file mode 100644
index 2ad6d54d2..000000000
--- a/hw/darwin/utils/dumpkeymap.man
+++ /dev/null
@@ -1,1004 +0,0 @@
-.ig
-//=============================================================================
-//
-// Manual page for `dumpkeymap'.
-//
-// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the author may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-//=============================================================================
-//
-// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.2 2000/12/05 21:18:34 dawes Exp $
-//
-..
-.ig
-//-----------------------------------------------------------------------------
-// Local identification information.
-//-----------------------------------------------------------------------------
-..
-.nr VE 4 \" Version number
-.TH DUMPKEYMAP 1 "v\n(VE \-\- 1 December 2000" "Version \n(VE"
-.de UP
-1 December 2000
-..
-.ig
-//-----------------------------------------------------------------------------
-// Annotation Macros
-// -----------------
-// Facilitate creation of annotated, non-filled blocks of text. An
-// annotated block is initiated with the `AS' macro. Each annotated,
-// non-filled line within the block must be introduced with the `AN' macro
-// which takes three arguments. The first argument is the detail text to
-// be annotated. The second is a string of spaces used to align the
-// annotations by certain (broken) roff interpreters which fail to
-// implement the proper set of roff commands (such as diversions,
-// indentation, and tab stops). It is assumed that the spaces will be
-// used with fixed-point font. The third argument is the annotation
-// itself. The block should be terminated with the `AE' macro. For all
-// roff interpreters which properly implement diversions, indentation, and
-// tab stops, all anotations within the block are automatically aligned at
-// the same horizontal position. This position is guaranteed to be just
-// to the right of the widest `AN' detail line. For broken roff
-// interpreters, such as `rman', the string of spaces from the second
-// argument are used to align the annotations. Finally, the `AZ' macro,
-// which takes a single argument, can be used to to insert a non-annotated
-// line into the block which does not play a part in the calculation of
-// the horizontal annotation alignment.
-//
-// Implementation Notes
-// --------------------
-// *1* These macros utilize a diversion (named `AD'). Since the prevailing
-// indentation is stored along with the diverted text, we must muck with
-// the indentation level in order to prevent the indentation from being
-// applied to the text a second time when `AD' is finally emitted.
-//
-// *2* Unfortunately, `.if' strips leading whitespace from following text, so
-// `AN' uses \& to preserve the whitespace.
-//
-// *3* This manual page has been tested for proper formatting with troff,
-// groff, nroff and rman (the `man' to `HTML' converter). Unfortunately,
-// rman fails to implement many useful features such as diversions,
-// indentation, and tab stops, and is also hideously buggy. Furthermore
-// it identifies itself as nroff and fails to provide any further
-// identification, so there is no way to create macros which specifically
-// work around its limitations. Following is a list of several bugs in
-// rman which the implementation of these macros must avoid:
-// o Fails with multi-line conditionals within macros.
-// o Fails on macro definition within multi-line conditionals.
-// o Fails when macro arguments are not delimited by exactly 1 space.
-// o String definition `.ds' ignores the value; uses empty "" instead.
-// As a consequence of these problems, the following macros are written
-// using a series of ugly single-line `.if' conditionals rather than the
-// more natural multi-line `.if' and `.ie' conditionals. Also, rman fails
-// to understand the common idiom of `.\"' to introduce a comment, which
-// is why all comments in this file are wrapped in ignore `.ig' blocks.
-//-----------------------------------------------------------------------------
-..
-.de AS
-.if t .nr AW 0
-.if t .nr AI \\n(.i
-.if t .in -\\n(AI
-.nf
-..
-.de AN
-.if t .if \w'\\$1'>\\n(AW .nr AW \w'\\$1'
-.if t .da AD
-.if t \\&\\$1\\t\\$3
-.if t .da
-.if n \\&\\$1 \\$2\\$3
-..
-.de AZ
-.if t .da AD
-\\$1
-.if t .da
-..
-.de AE
-.if t .in +\\n(AIu
-.if t .if \\n(AW .ta \\n(AWu+\w'\\(em'u
-.if t .AD
-.if t .DT
-.if t .rm AD
-.if t .rm AW
-.fi
-..
-.ig
-//-----------------------------------------------------------------------------
-// Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits
-// bulleted entries; `BE' ends a bulleted list.
-//-----------------------------------------------------------------------------
-..
-.de BG
-.PP
-.RS
-..
-.de BU
-.HP
-\\(bu\\ \\c
-..
-.de BE
-.RE
-.PP
-..
-.ig
-//-----------------------------------------------------------------------------
-// Indented paragraph with stylized hanging tag macro. `TG' takes a single
-// argument and treats it as the hanging tag of the indented paragraph.
-// The tag is italicized in troff but not in nroff.
-//-----------------------------------------------------------------------------
-..
-.de TG
-.TP
-.ie t .I "\\$1"
-.el \\$1
-..
-.ig
-//-----------------------------------------------------------------------------
-// Manual page for `dumpkeymap'.
-//-----------------------------------------------------------------------------
-..
-.SH NAME
-dumpkeymap \- Dianostic dump of a .keymapping file
-.SH SYNOPSIS
-.B dumpkeymap
-.RI [ options "] [-] [" file "...]"
-.SH DESCRIPTION
-.I dumpkeymap
-prints a textual representation of each Apple/\c
-.SM NeXT
-.I .keymapping
-file mentioned on the command-line. If no files are mentioned and if the
-local machine is an Apple or
-.SM NeXT
-installation, then the key mapping currently in use by the WindowServer and the
-AppKit is printed instead.
-.SH OPTIONS
-.TP
-.B "\-h \-\^\-help"
-Display general program instructions and option summary.
-.TP
-.B "\-k \-\^\-help\-keymapping"
-Display a detailed description of the internal layout of a
-.I .keymapping
-file. This is the same information as that presented in the
-.I "Key Mapping Description"
-section of this document.
-.TP
-.B "\-o \-\^\-help\-output"
-Display an explanation of the output generated by
-.I dumpkeymap
-when dissecting a
-.I .keymapping
-file. This is the same information as that presented in the
-.I "Output Description"
-section of this document.
-.TP
-.B "\-f \-\^\-help\-files"
-Display a summary of the various files and directories which are related to
-key mappings. This is the same information as that presented in the
-.I "Files"
-section of this document.
-.TP
-.B "\-d \-\^\-help\-diagnostics"
-Display a list of the various diagnostic messages which may be emitted by
-.I dumpkeymap.
-This is the same information as that presented in the
-.I "Diagnostics"
-section of this document.
-.TP
-.B "\-v \-\^\-version"
-Display the
-.I dumpkeymap
-version number and warranty information.
-.TP
-.B "\- \-\^\-"
-Inhibit processing of options at this point in the argument list. An
-occurrence of `\-' or `\-\^\-' in the argument list causes all following
-arguments to be treated as file names even if an argument begins with a `\-'
-character.
-.SH "KEY MAPPING DESCRIPTION"
-The following sections describe, in complete detail, the format of a raw key
-mapping resource, as well as the format of the
-.I .keymapping
-file which encapsulates one or more raw mappings.
-.SH "Types and Data"
-The following type definitions are employed throughout this discussion:
-.PP
-.RS
-.AS
-.AZ "typedef unsigned char byte;"
-.AZ "typedef unsigned short word;"
-.AZ "typedef unsigned long dword;"
-.AE
-.RE
-.PP
-Additionally, the type definition
-.RI ` number '
-is used generically to
-indicate a numeric value. The actual size of the
-.RI ` number '
-type may be one or two bytes depending upon how the data is stored in the key
-map. Although most key maps use byte-sized numeric values, word-sized values
-are also allowed.
-.PP
-Multi-byte values in a key mapping file are stored in big-endian byte order.
-.SH "Key Mapping File and Device Mapping"
-A key mapping file begins with a magic-number and continues with a
-variable number of device-specific key mappings.
-.PP
-.RS
-.AS
-.AZ "struct KeyMappingFile {"
-.AN " char magic_number[4];" " " "// `KYM1'"
-.AN " DeviceMapping maps[...];" "" "// Variable number of maps"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct DeviceMapping {"
-.AN " dword interface;" " " "// Interface type"
-.AN " dword handler_id;" "" "// Interface subtype"
-.AN " dword map_size;" " " "// Byte count of `map' (below)"
-.AN " KeyMapping map;"
-.AZ };
-.AE
-.RE
-.PP
-The value of `interface' represents a family of keyboard device types
-(such as Intel
-.SM "PC, ADB, NeXT,"
-Sun Type5, etc.), and is generally specified as one of the constant values
-.SM "NX_EVS_DEVICE_INTERFACE_ADB, NX_EVS_DEVICE_INTERFACE_ACE,"
-etc., which are are defined in IOHIDTypes.h on MacOS/X and Darwin, and in
-ev_types.h on MacOS/X Server, OpenStep, and NextStep.
-.PP
-The value of `handler_id' represents a specific keyboard layout within the
-much broader `interface' family. For instance, for a 101-key Intel
-.SM PC
-keyboard (of type
-.SM NX_EVS_DEVICE_INTERFACE_ACE\c
-) the `handler_id' is '0', whereas for a 102-key keyboard it is `1'.
-.PP
-Together, `interface' and `handler_id' identify the exact keyboard hardware to
-which this mapping applies. Programs which display a visual representation of
-a keyboard layout, match `interface' and `handler_id' from the
-.I .keymapping
-file against the `interface' and `handler_id' values found in each
-.I .keyboard
-file.
-.SH "Key Mapping"
-A key mapping completely defines the relationship of all scan codes with their
-associated functionality. A
-.I KeyMapping
-structure is embedded within the
-.I DeviceMapping
-structure in a
-.IR KeyMappingFile .
-The key mapping currently in use by the WindowServer and AppKit is also
-represented by a
-.I KeyMapping
-structure, and can be referred to directly by calling NXGetKeyMapping() and
-accessing the `mapping' data member of the returned
-.I NXKeyMapping
-structure.
-.PP
-.RS
-.AS
-.AZ "struct KeyMapping {"
-.AN " word number_size;" " " "// 0=1 byte, non-zero=2 bytes"
-.AN " number num_modifier_groups;" "" "// Modifier groups"
-.AZ " ModifierGroup modifier_groups[...];"
-.AN " number num_scan_codes;" " " "// Scan groups"
-.AN " ScanGroup scan_table[...];"
-.AN " number num_sequence_lists;" " " "// Sequence lists"
-.AN " Sequence sequence_lists[...];"
-.AN " number num_special_keys;" " " "// Special keys"
-.AN " SpecialKey special_key[...];"
-.AZ };
-.AE
-.RE
-.PP
-The `number_size' flag determines the size, in bytes, of all remaining numeric
-values (denoted by the type definition
-.RI ` number ')
-within the
-key mapping. If its value is zero, then numbers are represented by a single
-byte. If it is non-zero, then numbers are represented by a word (two bytes).
-.SH "Modifier Group"
-A modifier group defines all scan codes which map to a particular type of
-modifier, such as
-.IR shift ,
-.IR control ,
-etc.
-.PP
-.RS
-.AS
-.AZ "enum Modifier {"
-.AZ " ALPHALOCK = 0,"
-.AZ " SHIFT,"
-.AZ " CONTROL,"
-.AZ " ALTERNATE,"
-.AZ " COMMAND,"
-.AZ " KEYPAD,"
-.AZ " HELP"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct ModifierGroup {"
-.AN " number modifier;" " " "// A Modifier constant"
-.AN " number num_scan_codes;"
-.AN " number scan_codes[...];" "" "// Variable number of scan codes"
-.AZ };
-.AE
-.RE
-.PP
-The scan_codes[] array contains a list of all scan codes which map to the
-specified modifier. The
-.IR shift ", " command ", and " alternate
-modifiers are frequently mapped to two different scan codes, apiece,
-since these modifiers often appear on both the left and right sides of
-the keyboard.
-.SH "Scan Group"
-There is one
-.I ScanGroup
-for each scan code generated by the given keyboard. This number is given by
-KeyMapping::num_scan_codes. The first scan group represents hardware scan
-code 0, the second represents scan code 1, etc.
-.PP
-.RS
-.AS
-.AZ "enum ModifierMask {"
-.AN " ALPHALOCK_MASK" " " "= 1 << 0,"
-.AN " SHIFT_MASK" " " "= 1 << 1,"
-.AN " CONTROL_MASK" " " "= 1 << 2,"
-.AN " ALTERNATE_MASK" " " "= 1 << 3,"
-.AN " CARRIAGE_RETURN_MASK" "" "= 1 << 4"
-.AZ };
-.AZ "#define NOT_BOUND 0xff"
-.AE
-.PP
-.AS
-.AZ "struct ScanGroup {"
-.AN " number mask;"
-.AN " Character characters[...];"
-.AZ };
-.AE
-.RE
-.PP
-For each scan code, `mask' defines which modifier combinations generate
-characters. If `mask' is
-.SM NOT_BOUND
-(0xff) then then this scan code does not generate any characters ever, and its
-characters[] array is zero length. Otherwise, the characters[] array contains
-one
-.I Character
-record for each modifier combination.
-.PP
-The number of records in characters[] is determined by computing (1 <<
-bits_set_in_mask). In other words, if mask is zero, then zero bits are set,
-so characters[] contains only one record. If `mask' is
-.SM "(SHIFT_MASK | CONTROL_MASK),"
-then two bits are set, so characters[] contains four records.
-.PP
-The first record always represents the character which is generated by that
-key when no modifiers are active. The remaining records represent characters
-generated by the various modifier combinations. Using the example with the
-.I shift
-and
-.I control
-masks set, record two would represent the character with the
-.I shift
-modifier active; record three, the
-.I control
-modifier active; and record four, both the
-.I shift
-and
-.I control
-modifiers active.
-.PP
-As a special case,
-.SM ALPHALOCK_MASK
-implies
-.SM SHIFT_MASK,
-though only
-.SM ALPHALOCK_MASK
-appears in `mask'. In this case the same character is generated for both the
-.I shift
-and
-.I alpha-lock
-modifiers, but only needs to appear once in the characters[] array.
-.PP
-.SM CARRIAGE_RETURN_MASK
-does not actually refer to a modifier key. Instead, it is used to
-distinguish the scan code which is given the special pseudo-designation of
-.I "carriage return"
-key. Typically, this mask appears solo in a
-.I ScanGroup
-record and only the two
-.I Character
-records for control-M and control-C follow. This flag may be a throwback to
-an earlier time or may be specially interpreted by the low-level keyboard
-driver, but its purpose is otherwise enigmatic.
-.SH Character
-Each
-.I Character
-record indicates the character generated when this key is pressed, as well as
-the character set which contains the character. Well known character sets are
-.SM `ASCII'
-and `Symbol'. The character set can also be one of the meta values
-.SM FUNCTION_KEY
-or
-.SM KEY_SEQUENCE.
-If it is
-.SM FUNCTION_KEY
-then `char_code' represents a generally well-known function key such as those
-enumerated by
-.I FunctionKey.
-If the character set is
-.SM KEY_SEQUENCE
-then `char_code' represents is a zero-base index into
-KeyMapping::sequence_lists[].
-.PP
-.RS
-.AS
-.AZ "enum CharacterSet {"
-.AN " ASCII" " " "= 0x00,"
-.AN " SYMBOL" " " "= 0x01,"
-.AN " ..."
-.AN " FUNCTION_KEY" "" "= 0xfe,"
-.AN " KEY_SEQUENCE" "" "= 0xff"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct Character {"
-.AN " number set;" " " "// CharacterSet of generated character"
-.AN " number char_code;" "" "// Actual character generated"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "enum FunctionKey {"
-.AZ " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,"
-.AZ " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,"
-.AZ " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU,"
-.AZ " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,"
-.AZ " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT"
-.AZ };
-.AE
-.RE
-.SH Sequence
-When Character::set contains the meta value
-.SM KEY_SEQUENCE,
-the scan code is bound to a sequence of keys rather than a single character.
-A sequence is a series of modifiers and characters which are automatically
-generated when the associated key is depressed.
-.PP
-.RS
-.AS
-.AZ "#define MODIFIER_KEY 0xff"
-.AE
-.PP
-.AS
-.AZ "struct Sequence {"
-.AN " number num_chars;"
-.AN " Character characters[...];"
-.AZ };
-.AE
-.RE
-.PP
-Each generated
-.I Character
-is represented as previously described, with the exception that
-.SM MODIFIER_KEY
-may appear in place of
-.SM KEY_SEQUENCE.
-When the value of Character::set is
-.SM MODIFIER_KEY
-then Character::char_code represents a modifier key rather than an actual
-character. If the modifier represented by `char_code' is non-zero, then it
-indicates that the associated modifier key has been depressed. In this case,
-the value is one of the constants enumerated by
-.I Modifier
-(\c
-.SM "SHIFT, CONTROL, ALTERNATE,"
-etc.). If the value is zero then it means that the modifier keys have been
-released.
-.SH "Special Key"
-A special key is one which is scanned directly by the Mach kernel rather than
-by the WindowServer. In general, events are not generated for special keys.
-.PP
-.RS
-.AS
-.AZ "enum SpecialKeyType {"
-.AZ " VOLUME_UP = 0,"
-.AZ " VOLUME_DOWN,"
-.AZ " BRIGHTNESS_UP,"
-.AZ " BRIGHTNESS_DOWN,"
-.AZ " ALPHA_LOCK,"
-.AZ " HELP,"
-.AZ " POWER,"
-.AZ " SECONDARY_ARROW_UP,"
-.AZ " SECONDARY_ARROW_DOWN"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct SpecialKey {"
-.AN " number type;" " " "// A SpecialKeyType constant"
-.AN " number scan_code;" "" "// Actual scan code"
-.AZ };
-.AE
-.RE
-.SH OUTPUT
-What follows is an explanation and description of the various pieces of
-information emitted by
-.I dumpkeymap.
-.PP
-For a more thorough discussion of any particular piece of information described
-here, refer to the detailed description of the internal layout of a key mapping
-provided by the
-.I "Key Mapping Description"
-section above.
-.SH Conventions
-Depending upon context, some numeric values are displayed in decimal
-notation, whereas others are displayed in hexadecimal notation.
-Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),
-except when explicitly noted otherwise.
-.SH "Key Mapping Source"
-The first piece of information presented about a particular key mapping is the
-source from which the data was gleaned. For a
-.I .keymapping
-file, the title
-.SM "`KEYMAP FILE'"
-is emitted along with the path and name of the file in question. For the key
-mapping currently in use by the WindowServer and AppKit, the title
-.SM "`ACTIVE KEYMAP'"
-is emitted instead.
-.SH "Device Information"
-Each
-.I .keymapping
-file may contain one or more raw key mappings. For example, a file which maps
-keys to a Dvorak-style layout might contain raw mappings for Intel
-.SM "PC, ADB, NeXT,"
-and Sun Type5 keyboards.
-.PP
-For each raw mapping, the following information is emitted:
-.BG
-.BU
-The title
-.SM `KEYMAP'
-along with the mapping's relative position in the
-.I .keymapping
-file.
-.BU
-The `interface' identifier.
-.BU
-The `handler_id' sub-identifier.
-.BU
-The size of the raw mapping resource counted in bytes.
-.BE
-The `interface' and `handler_id' values, taken together, define a specific
-keyboard device. A
-.I .keyboard
-file, which describes the visual layout of a keyboard, also contains
-`interface' and `handler_id' identifiers. The
-.I .keyboard
-file corresponding to a particular key mapping can be found by matching the
-`interface' and `handler_id' values from each resource.
-.SH Modifiers
-Each mapping may contain zero or more modifier records which associate hardware
-scan codes with modifier descriptions such as
-.I "shift, control, alternate,"
-etc. The title
-.SM `MODIFIERS'
-is printed along with the count of modifier records which follow. For each
-modifier record, the modifier's name is printed along with a list of scan
-codes, in hexadecimal format, which generate that modifier value. For example:
-.PP
-.RS
-.nf
-MODIFIERS [4]
-alternate: 0x1d 0x60
-control: 0x3a
-keypad: 0x52 0x53 ... 0x63 0x62
-shift: 0x2a 0x36
-.fi
-.RE
-.SH Characters
-Each mapping may contain zero or more character records which associate
-hardware scan codes with the actual characters generated by those scan
-codes in the presence or absence of various modifier combinations. The
-title
-.SM `CHARACTERS'
-is printed along with the count of character records which follow. Here is a
-highly abbreviated example:
-.PP
-.RS
-.nf
-CHARACTERS [9]
-scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
-scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
-scan 0x0a: ---S- "<" ">"
-scan 0x13: -ACS- "2" "@" "^@" "^@" b2 b3 "^@" "^@"
-scan 0x24: R---- "^M" "^C"
-scan 0x3e: ----- [F4]
-scan 0x4a: ----- [page up]
-scan 0x60: ----- {seq#3}
-scan 0x68: not-bound
-.fi
-.RE
-.PP
-For each record, the hexadecimal value of the hardware scan code is printed,
-followed by a list of modifier flag combinations and the actual characters
-generated by this scan code with and without modifiers applied.
-.PP
-The modifier flags field is composed of a combination of single letter
-representations of the various modifier types. The letters stand for:
-.PP
-.RS
-.nf
-L \- alpha-lock
-S \- shift
-C \- control
-A \- alternate
-R \- carriage-return
-.fi
-.RE
-.PP
-As a special case, the
-.I alpha-lock
-flag also implies the
-.I shift
-flag, so these two flags never appear together in the same record.
-.PP
-The combination of modifier flags determines the meaning and number of fields
-which follow. The first field after the modifier flags always represents the
-character that will be generated if no modifier keys are depressed. The
-remaining fields represent characters generated by the various modifier
-combinations. The order of the fields follows this general pattern:
-.BG
-.BU
-The character generated by this scan code when no modifiers are in effect is
-listed first.
-.BU
-If the `L' or `S' flag is active, then the shifted character generated by this
-scan code is listed next.
-.BU
-If the `C' flag is active, then the control-character generated by this scan
-code is listed next. Furthermore, if the `L' or `S' flag is also active, then
-the shifted control-character is listed after that.
-.BU
-If the `A' flag is active, then the alternate-character generated by this scan
-code is listed next. Furthermore, if the `L' or `S' flag is active, then the
-shifted alternate-character is listed after that. If the `C' flag is also
-active, then the alternate-control-character is listed next. Finally, if the
-`C' and `L' or `C' and `S' flags are also active, then the shifted
-alternate-control-character is listed.
-.BE
-The `R' flag does not actually refer to a modifier key. Instead, it is used to
-distinguish the scan code which is given the special pseudo-designation of
-.I "carriage return"
-key. Typically, this mask appears solo and only the two fields for control-M
-and control-C follow. This flag may be a throwback to an earlier time or may
-be specially interpreted by the low-level keyboard driver, but its purpose is
-otherwise enigmatic.
-.PP
-Recalling the example from above, the following fields can be identified:
-.PP
-.RS
-.nf
-scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
-.fi
-.RE
-.BG
-.BU
-Lower-case `a' is generated when no modifiers are active.
-.BU
-Upper-case `A' is generated when
-.IR shift " or " alpha-lock
-are active.
-.BU
-Control-A is generated when
-.I control
-is active.
-.BU
-Control-A is generated when
-.IR control " and " shift
-are active.
-.BU
-The character represented by the hexadecimal code 0xca is generated when
-.I alternate
-is active.
-.BU
-The character represented by 0xc7 is generated when
-.IR alternate " and " shift " (or " alpha-lock ") are active."
-.BU
-Control-A is generated when
-.IR alternate " and " control
-are active.
-.BU
-Control-A is generated when
-.IR "alternate, control" " and " shift " (or " alpha-lock ") are active."
-.BE
-The notation used to represent a particular generated character varies.
-.BG
-.BU
-Printable
-.SM ASCII
-characters are quoted, as in "x" or "X".
-.BU
-Control-characters are quoted and prefixed with `^', as in "^X".
-.BU
-Characters with values greater than 127 (0x7f) are displayed as hexadecimal
-values without the `0x' prefix.
-.BU
-Characters in a non-\c
-.SM ASCII
-character set (such as `Symbol') are displayed as two hexadecimal numbers
-separated by a slash, as in `01/4a'. The first number is the character set's
-identification code (such as `01' for the `Symbol' set), and the second number
-is the value of the generated character.
-.BU
-Non-printing special function characters are displayed with the function's
-common name enclosed in brackets, as in `[page up]' or `[F4]'.
-.BU
-If the binding represents a key sequence rather than a single character, then
-the sequence's identification number is enclosed in braces, as in `{seq#3}'.
-.BE
-Recalling a few examples from above, the following interpretations can be made:
-.PP
-.RS
-.nf
-scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
-scan 0x3e: ----- [F4]
-scan 0x4a: ----- [page up]
-scan 0x60: ----- {seq#3}
-.fi
-.RE
-.BG
-.BU
-"x" and "X" are printable
-.SM ASCII
-characters.
-.BU
-"^X" is a control-character.
-.BU
-`01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in the `Symbol'
-character set.
-.BU
-Scan code 0x3e generates function-key `F4', and scan code 0x4a generates
-function-key `page up'.
-.BU
-Scan code 0x60 is bound to key sequence #3.
-.BE
-Finally, if a scan code is not bound to any characters, then it is annotated
-with the label `not-bound', as with example scan code 0x68 from above.
-.SH Sequences
-A scan code (modified and unmodified) can be bound to a key sequence rather
-than generating a single character or acting as a modifier. When it is bound
-to a key sequence, a series of character invocations and modifier actions are
-automatically generated rather than a single keystroke.
-.PP
-Each mapping may contain zero or more key sequence records. The title
-.SM `SEQUENCES'
-is printed along with the count of sequence records which follow. For example:
-.PP
-.RS
-.nf
-SEQUENCES [3]
-sequence 0: "f" "o" "o"
-sequence 1: {alternate} "b" "a" "r" {unmodify}
-sequence 2: [home] "b" "a" "z"
-.fi
-.RE
-.PP
-The notation used to represent the sequence of generated characters is
-identical to the notation already described in the
-.I Characters
-section above, with the exception that modifier actions may be interposed
-between generated characters. Such modifier actions are represented by the
-modifier's name enclosed in braces. The special name `{unmodify}' indicates
-the release of the modifier keys.
-.PP
-Thus, the sequences in the above example can be interpreted as follows:
-.BG
-.BU
-Sequence\ #0 generates `foo'.
-.BU
-Sequence\ #1 invokes the
-.I alternate
-modifier, generates `bar', and then releases
-.I alternate.
-.BU
-Sequence\ #2 invokes the
-.I home
-key and then generates `baz'. In a text editor, this would probably result in
-`baz' being prepended to the line of text on which the cursor resides.
-.BE
-.SH Special Keys
-Certain keyboards feature keys which perform some type of special purpose
-function rather than generating a character or acting as a modifier. For
-instance, Apple keyboards often contain a
-.I power
-key, and
-.SM NeXT
-keyboards have historically featured screen brightness and volume control keys.
-.PP
-Each mapping may contain zero or more special-key records which associate
-hardware scan codes with such special purpose functions. The title
-.SM `SPECIALS'
-is printed along with the count of records which follow. For each record, the
-special function's name is printed along with a list of scan codes, in
-hexadecimal format, which are bound to that function. For example:
-.PP
-.RS
-.nf
-SPECIALS [6]
-alpha-lock: 0x39
-brightness-down: 0x79
-brightness-up: 0x74
-power: 0x7f
-sound-down: 0x77
-sound-up: 0x73
-.fi
-.RE
-.SH FILES
-.IP *.keymapping
-A key mapping file which precisely defines the relationship of all
-hardware-specific keyboard scan-codes with their associated functionality.
-.IP *.keyboard
-A file describing the physical layout of keys on a particular type of
-keyboard. Each `key' token in this file defines the position and shape of the
-key on the keyboard, as well as the associated scan code which that key
-generates. A
-.I .keymapping
-file, on the other hand, defines the characters which are generated by a
-particular scan code depending upon the state of the various modifier keys
-(such as
-.I shift,
-.I control,
-etc.). The `interface' and `handler_id' values from a
-.I .keymapping
-file are matched against those in each
-.I .keyboard
-file in order to associate a particular
-.I .keyboard
-file with a key mapping. Various
-.SM GUI
-programs use the
-.I .keyboard
-file to display a visual representation of a keyboard for the user. Since
-these files are just plain text, they can be easily viewed and interpreted
-without the aid of a specialized program, thus
-.I dumpkeymap
-leaves these files alone.
-.PP
-/System/Library/Keyboards
-.br
-/Network/Library/Keyboards
-.br
-/Local/Library/Keyboards
-.br
-/Library/Keyboards
-.RS
-Repositories for
-.I .keymapping
-and
-.I .keyboard
-files for MacOS/X, Darwin, and MacOS/X Server.
-.RE
-.PP
-/NextLibrary/Keyboards
-.br
-/LocalLibrary/Keyboards
-.RS
-Repositories for
-.I .keymapping
-and
-.I .keyboard
-files for OpenStep and NextStep.
-.RE
-.IP $(HOME)/Library/Keyboards
-Repository for personal
-.I .keymapping
-and
-.I .keyboard
-files.
-.SH DIGANOSTICS
-The following diagnostic messages may be issued to the standard error stream.
-.TG "Unrecognized option."
-An unrecognized option was specified on the command-line. Invoke
-.I dumpkeymap
-with the
-.B "\-\^\-help"
-option to view a list of valid options.
-.TG "Insufficient data in keymapping data stream."
-The key mapping file or data stream is corrupt. Either the file has been
-incorrectly truncated or a field, such as those which indicates the number of
-variable records which follow, contains a corrupt value.
-.PP
-The following diagnostic messages have significance only when trying to print
-.I .keymapping
-files mentioned on the command-line.
-.TG "Bad magic number."
-The mentioned file is not a
-.I .keymapping
-file. The file's content does not start with the string `KYM1'.
-.TG "Unable to open key mapping file."
-The call to fopen() failed; probably because the specified path is invalid or
-.I dumpkeymap
-does not have permission to read the file.
-.TG "Unable to determine key mapping file size."
-The call to fstat() failed, thus memory can not be allocated for loading the
-file.
-.TG "Unable to read key mapping file."
-The call to fread() failed.
-.PP
-The following diagnostic messages have significance only when trying to print
-the currently active key mapping when no
-.I .keymapping
-files have been mentioned on the command-line.
-.TG "Unable to open event status driver."
-The call to NXOpenEventStatus() failed.
-.TG "Bad key mapping length."
-The call to NXKeyMappingLength() returned a bogus value.
-.TG "Unable to get current key mapping."
-The call to NXGetKeyMapping() failed.
-.PP
-The following diagnostic messages have significance only when using
-.I dumpkeymap
-on a non-Apple/\c
-.SM NeXT
-platform.
-.TG "Must specify at least one .keymapping file."
-No
-.I .keymapping
-files were mentioned on the command-line. On non-Apple/\c
-.SM NeXT
-platforms, there is no concept of a currently active
-.I .keymapping
-file, so at least one file must be mentioned on the command-line.
-.SH AUTHOR
-Eric Sunshine <sunshine@sunshineco.com> wrote
-.I dumpkeymap
-and this document, the
-.I "dumpkeymap user's manual."
-Both
-.I dumpkeymap
-and this document are copyright \(co1999,2000 by Eric Sunshine
-<sunshine@sunshineco.com>. All rights reserved.
-.PP
-The implementation of
-.I dumpkeymap
-is based upon information gathered on September 3, 1997 by Eric Sunshine
-<sunshine@sunshineco.com> and Paul S. McCarthy <zarnuk@zarnuk.com> during an
-effort to reverse engineer the format of the
-.SM NeXT
-.I .keymapping
-file.
-.if n .PP
-.if n Version \n(VE \-\-
-.if n .UP
diff --git a/hw/kdrive/ati/Makefile.am b/hw/kdrive/ati/Makefile.am
index e694d018c..b7cb8896a 100644
--- a/hw/kdrive/ati/Makefile.am
+++ b/hw/kdrive/ati/Makefile.am
@@ -1,3 +1,17 @@
+if DRI
+DRI_INCLUDES = -I$(top_srcdir)/dri \
+ -I$(top_srcdir)/drm
+DRI_LIBS = $(top_builddir)/dri/libdri.a \
+ $(top_builddir)/drm/libdrm.a
+DRI_SOURCES = ati_dri.c \
+ ati_dri.h \
+ ati_dripriv.h \
+ r128_common.h \
+ r128_sarea.h \
+ radeon_common.h \
+ radeon_sarea.h
+endif
+
if KDRIVEFBDEV
FBDEV_INCLUDES =-I$(top_srcdir)/hw/kdrive/fbdev
FBDEV_LIBS = $(top_builddir)/hw/kdrive/fbdev/libfbdev.a
@@ -8,9 +22,9 @@ VESA_INCLUDES = -I$(top_srcdir)/hw/kdrive/vesa
VESA_LIBS = $(top_builddir)/hw/kdrive/vesa/libvesa.a
endif
-
INCLUDES = \
@KDRIVE_INCS@ \
+ $(DRI_INCLUDES) \
$(FBDEV_INCLUDES) \
$(VESA_INCLUDES) \
@XSERVER_CFLAGS@
@@ -25,15 +39,19 @@ noinst_LIBRARIES = libati.a
libati_a_SOURCES = \
ati_draw.c \
+ ati_draw.h \
+ ati_drawtmp.h \
ati.c \
ati.h \
- ati_reg.h
+ ati_reg.h \
+ $(DRI_SOURCES)
Xati_SOURCES = \
ati_stub.c
Xati_LDADD = \
libati.a \
+ $(DRI_LIBS) \
$(FBDEV_LIBS) \
$(VESA_LIBS) \
@KDRIVE_LIBS@ \
diff --git a/hw/kdrive/ati/ati.c b/hw/kdrive/ati/ati.c
index 67137dff6..bdd3c4941 100644
--- a/hw/kdrive/ati/ati.c
+++ b/hw/kdrive/ati/ati.c
@@ -27,130 +27,140 @@
#include <config.h>
#endif
#include "ati.h"
-
-struct pci_id_list radeon_id_list[] = {
- {0x1002, 0x4136, "ATI Radeon RS100"},
- {0x1002, 0x4137, "ATI Radeon RS200"},
- {0x1002, 0x4237, "ATI Radeon RS250"},
- {0x1002, 0x4144, "ATI Radeon R300 AD"},
- {0x1002, 0x4145, "ATI Radeon R300 AE"},
- {0x1002, 0x4146, "ATI Radeon R300 AF"},
- {0x1002, 0x4147, "ATI Radeon R300 AG"},
- {0x1002, 0x4148, "ATI Radeon R350 AH"},
- {0x1002, 0x4149, "ATI Radeon R350 AI"},
- {0x1002, 0x414a, "ATI Radeon R350 AJ"},
- {0x1002, 0x414b, "ATI Radeon R350 AK"},
- {0x1002, 0x4150, "ATI Radeon RV350 AP"},
- {0x1002, 0x4151, "ATI Radeon RV350 AQ"},
- {0x1002, 0x4152, "ATI Radeon RV350 AR"},
- {0x1002, 0x4153, "ATI Radeon RV350 AS"},
- {0x1002, 0x4154, "ATI Radeon RV350 AT"},
- {0x1002, 0x4156, "ATI Radeon RV350 AV"},
- {0x1002, 0x4242, "ATI Radeon R200 BB"},
- {0x1002, 0x4243, "ATI Radeon R200 BC"},
- {0x1002, 0x4336, "ATI Radeon RS100"},
- {0x1002, 0x4337, "ATI Radeon RS200"},
- {0x1002, 0x4437, "ATI Radeon RS250"},
- {0x1002, 0x4964, "ATI Radeon RV250 Id"},
- {0x1002, 0x4965, "ATI Radeon RV250 Ie"},
- {0x1002, 0x4966, "ATI Radeon RV250 If"},
- {0x1002, 0x4967, "ATI Radeon RV250 Ig"},
- {0x1002, 0x4c57, "ATI Radeon RV200 LW"},
- {0x1002, 0x4c58, "ATI Radeon RV200 LX"},
- {0x1002, 0x4c59, "ATI Radeon Mobility M6 LY"},
- {0x1002, 0x4c5a, "ATI Radeon Mobility LZ"},
- {0x1002, 0x4c64, "ATI Radeon RV250 Ld"},
- {0x1002, 0x4c65, "ATI Radeon RV250 Le"},
- {0x1002, 0x4c66, "ATI Radeon Mobility M9 RV250 Lf"},
- {0x1002, 0x4c67, "ATI Radeon RV250 Lg"},
- {0x1002, 0x4e44, "ATI Radeon R300 ND"},
- {0x1002, 0x4e45, "ATI Radeon R300 NE"},
- {0x1002, 0x4e46, "ATI Radeon R300 NF"},
- {0x1002, 0x4e47, "ATI Radeon R300 NG"},
- {0x1002, 0x4e48, "ATI Radeon R350 NH"},
- {0x1002, 0x4e49, "ATI Radeon R350 NI"},
- {0x1002, 0x4e4a, "ATI Radeon R350 NJ"},
- {0x1002, 0x4e4b, "ATI Radeon R350 NK"},
- {0x1002, 0x4e50, "ATI Radeon Mobility RV350 NP"},
- {0x1002, 0x4e51, "ATI Radeon Mobility RV350 NQ"},
- {0x1002, 0x4e52, "ATI Radeon Mobility RV350 NR"},
- {0x1002, 0x4e53, "ATI Radeon Mobility RV350 NS"},
- {0x1002, 0x4e54, "ATI Radeon Mobility RV350 NT"},
- {0x1002, 0x4e56, "ATI Radeon Mobility RV350 NV"},
- {0x1002, 0x5144, "ATI Radeon R100 QD"},
- {0x1002, 0x5145, "ATI Radeon R100 QE"},
- {0x1002, 0x5146, "ATI Radeon R100 QF"},
- {0x1002, 0x5147, "ATI Radeon R100 QG"},
- {0x1002, 0x5148, "ATI Radeon R200 QH"},
- {0x1002, 0x514c, "ATI Radeon R200 QL"},
- {0x1002, 0x514d, "ATI Radeon R200 QM"},
- {0x1002, 0x5157, "ATI Radeon RV200 QW"},
- {0x1002, 0x5158, "ATI Radeon RV200 QX"},
- {0x1002, 0x5159, "ATI Radeon RV100 QY"},
- {0x1002, 0x515a, "ATI Radeon RV100 QZ"},
- {0x1002, 0x5834, "ATI Radeon RS300"},
- {0x1002, 0x5835, "ATI Radeon Mobility RS300"},
- {0x1002, 0x5941, "ATI Radeon RV280 (9200)"},
- {0x1002, 0x5961, "ATI Radeon RV280 (9200 SE)"},
- {0x1002, 0x5964, "ATI Radeon RV280 (9200 SE)"},
- {0x1002, 0x5c60, "ATI Radeon RV280"},
- {0x1002, 0x5c61, "ATI Mobility Radeon RV280"},
- {0x1002, 0x5c62, "ATI Radeon RV280"},
- {0x1002, 0x5c63, "ATI Mobility Radeon RV280"},
- {0x1002, 0x5c64, "ATI Radeon RV280"},
- {0, 0, NULL}
+#include "ati_reg.h"
+
+struct pci_id_entry ati_pci_ids[] = {
+ {0x1002, 0x4136, 0x1, "ATI Radeon RS100"},
+ {0x1002, 0x4137, 0x3, "ATI Radeon RS200"},
+ {0x1002, 0x4237, 0x3, "ATI Radeon RS250"},
+ {0x1002, 0x4144, 0x5, "ATI Radeon R300 AD"},
+ {0x1002, 0x4145, 0x5, "ATI Radeon R300 AE"},
+ {0x1002, 0x4146, 0x5, "ATI Radeon R300 AF"},
+ {0x1002, 0x4147, 0x5, "ATI Radeon R300 AG"},
+ {0x1002, 0x4148, 0x5, "ATI Radeon R350 AH"},
+ {0x1002, 0x4149, 0x5, "ATI Radeon R350 AI"},
+ {0x1002, 0x414a, 0x5, "ATI Radeon R350 AJ"},
+ {0x1002, 0x414b, 0x5, "ATI Radeon R350 AK"},
+ {0x1002, 0x4150, 0x5, "ATI Radeon RV350 AP"},
+ {0x1002, 0x4151, 0x5, "ATI Radeon RV350 AQ"},
+ {0x1002, 0x4152, 0x5, "ATI Radeon RV350 AR"},
+ {0x1002, 0x4153, 0x5, "ATI Radeon RV350 AS"},
+ {0x1002, 0x4154, 0x5, "ATI Radeon RV350 AT"},
+ {0x1002, 0x4156, 0x5, "ATI Radeon RV350 AV"},
+ {0x1002, 0x4242, 0x3, "ATI Radeon R200 BB"},
+ {0x1002, 0x4243, 0x3, "ATI Radeon R200 BC"},
+ {0x1002, 0x4336, 0x1, "ATI Radeon RS100"},
+ {0x1002, 0x4337, 0x3, "ATI Radeon RS200"},
+ {0x1002, 0x4437, 0x3, "ATI Radeon RS250"},
+ {0x1002, 0x4964, 0x3, "ATI Radeon RV250 Id"},
+ {0x1002, 0x4965, 0x3, "ATI Radeon RV250 Ie"},
+ {0x1002, 0x4966, 0x3, "ATI Radeon RV250 If"},
+ {0x1002, 0x4967, 0x3, "ATI Radeon RV250 Ig"},
+ {0x1002, 0x4c45, 0x0, "ATI Rage 128 LE"},
+ {0x1002, 0x4c46, 0x0, "ATI Rage 128 LF"},
+ {0x1002, 0x4c57, 0x3, "ATI Radeon RV200 LW"},
+ {0x1002, 0x4c58, 0x3, "ATI Radeon RV200 LX"},
+ {0x1002, 0x4c59, 0x3, "ATI Radeon Mobility M6 LY"},
+ {0x1002, 0x4c5a, 0x3, "ATI Radeon Mobility LZ"},
+ {0x1002, 0x4c64, 0x3, "ATI Radeon RV250 Ld"},
+ {0x1002, 0x4c65, 0x3, "ATI Radeon RV250 Le"},
+ {0x1002, 0x4c66, 0x3, "ATI Radeon Mobility M9 RV250 Lf"},
+ {0x1002, 0x4c67, 0x3, "ATI Radeon RV250 Lg"},
+ {0x1002, 0x4d46, 0x0, "ATI Rage 128 MF"},
+ {0x1002, 0x4d46, 0x0, "ATI Rage 128 ML"},
+ {0x1002, 0x4e44, 0x5, "ATI Radeon R300 ND"},
+ {0x1002, 0x4e45, 0x5, "ATI Radeon R300 NE"},
+ {0x1002, 0x4e46, 0x5, "ATI Radeon R300 NF"},
+ {0x1002, 0x4e47, 0x5, "ATI Radeon R300 NG"},
+ {0x1002, 0x4e48, 0x5, "ATI Radeon R350 NH"},
+ {0x1002, 0x4e49, 0x5, "ATI Radeon R350 NI"},
+ {0x1002, 0x4e4a, 0x5, "ATI Radeon R350 NJ"},
+ {0x1002, 0x4e4b, 0x5, "ATI Radeon R350 NK"},
+ {0x1002, 0x4e50, 0x5, "ATI Radeon Mobility RV350 NP"},
+ {0x1002, 0x4e51, 0x5, "ATI Radeon Mobility RV350 NQ"},
+ {0x1002, 0x4e52, 0x5, "ATI Radeon Mobility RV350 NR"},
+ {0x1002, 0x4e53, 0x5, "ATI Radeon Mobility RV350 NS"},
+ {0x1002, 0x4e54, 0x5, "ATI Radeon Mobility RV350 NT"},
+ {0x1002, 0x4e56, 0x5, "ATI Radeon Mobility RV350 NV"},
+ {0x1002, 0x5041, 0x0, "ATI Rage 128 PA"},
+ {0x1002, 0x5042, 0x0, "ATI Rage 128 PB"},
+ {0x1002, 0x5043, 0x0, "ATI Rage 128 PC"},
+ {0x1002, 0x5044, 0x0, "ATI Rage 128 PD"},
+ {0x1002, 0x5045, 0x0, "ATI Rage 128 PE"},
+ {0x1002, 0x5046, 0x0, "ATI Rage 128 PF"},
+ {0x1002, 0x5047, 0x0, "ATI Rage 128 PG"},
+ {0x1002, 0x5048, 0x0, "ATI Rage 128 PH"},
+ {0x1002, 0x5049, 0x0, "ATI Rage 128 PI"},
+ {0x1002, 0x504a, 0x0, "ATI Rage 128 PJ"},
+ {0x1002, 0x504b, 0x0, "ATI Rage 128 PK"},
+ {0x1002, 0x504c, 0x0, "ATI Rage 128 PL"},
+ {0x1002, 0x504d, 0x0, "ATI Rage 128 PM"},
+ {0x1002, 0x504e, 0x0, "ATI Rage 128 PN"},
+ {0x1002, 0x504f, 0x0, "ATI Rage 128 PO"},
+ {0x1002, 0x5050, 0x0, "ATI Rage 128 PP"},
+ {0x1002, 0x5051, 0x0, "ATI Rage 128 PQ"},
+ {0x1002, 0x5052, 0x0, "ATI Rage 128 PR"},
+ {0x1002, 0x5053, 0x0, "ATI Rage 128 PS"},
+ {0x1002, 0x5054, 0x0, "ATI Rage 128 PT"},
+ {0x1002, 0x5055, 0x0, "ATI Rage 128 PU"},
+ {0x1002, 0x5056, 0x0, "ATI Rage 128 PV"},
+ {0x1002, 0x5057, 0x0, "ATI Rage 128 PW"},
+ {0x1002, 0x5058, 0x0, "ATI Rage 128 PX"},
+ {0x1002, 0x5144, 0x1, "ATI Radeon R100 QD"},
+ {0x1002, 0x5145, 0x1, "ATI Radeon R100 QE"},
+ {0x1002, 0x5146, 0x1, "ATI Radeon R100 QF"},
+ {0x1002, 0x5147, 0x1, "ATI Radeon R100 QG"},
+ {0x1002, 0x5148, 0x1, "ATI Radeon R200 QH"},
+ {0x1002, 0x514c, 0x1, "ATI Radeon R200 QL"},
+ {0x1002, 0x514d, 0x1, "ATI Radeon R200 QM"},
+ {0x1002, 0x5157, 0x1, "ATI Radeon RV200 QW"},
+ {0x1002, 0x5158, 0x1, "ATI Radeon RV200 QX"},
+ {0x1002, 0x5159, 0x1, "ATI Radeon RV100 QY"},
+ {0x1002, 0x515a, 0x1, "ATI Radeon RV100 QZ"},
+ {0x1002, 0x5245, 0x0, "ATI Rage 128 RE"},
+ {0x1002, 0x5246, 0x0, "ATI Rage 128 RF"},
+ {0x1002, 0x5247, 0x0, "ATI Rage 128 RG"},
+ {0x1002, 0x524b, 0x0, "ATI Rage 128 RK"},
+ {0x1002, 0x524c, 0x0, "ATI Rage 128 RL"},
+ {0x1002, 0x5345, 0x0, "ATI Rage 128 SE"},
+ {0x1002, 0x5346, 0x0, "ATI Rage 128 SF"},
+ {0x1002, 0x5347, 0x0, "ATI Rage 128 SG"},
+ {0x1002, 0x5348, 0x0, "ATI Rage 128 SH"},
+ {0x1002, 0x534b, 0x0, "ATI Rage 128 SK"},
+ {0x1002, 0x534c, 0x0, "ATI Rage 128 SL"},
+ {0x1002, 0x534d, 0x0, "ATI Rage 128 SM"},
+ {0x1002, 0x534e, 0x0, "ATI Rage 128 SN"},
+ {0x1002, 0x5446, 0x0, "ATI Rage 128 TF"},
+ {0x1002, 0x544c, 0x0, "ATI Rage 128 TL"},
+ {0x1002, 0x5452, 0x0, "ATI Rage 128 TR"},
+ {0x1002, 0x5453, 0x0, "ATI Rage 128 TS"},
+ {0x1002, 0x5454, 0x0, "ATI Rage 128 TT"},
+ {0x1002, 0x5455, 0x0, "ATI Rage 128 TU"},
+ {0x1002, 0x5834, 0x5, "ATI Radeon RS300"},
+ {0x1002, 0x5835, 0x5, "ATI Radeon RS300 Mobility"},
+ {0x1002, 0x5941, 0x3, "ATI Radeon RV280 (9200)"},
+ {0x1002, 0x5961, 0x3, "ATI Radeon RV280 (9200 SE)"},
+ {0x1002, 0x5964, 0x3, "ATI Radeon RV280 (9200 SE)"},
+ {0x1002, 0x5c60, 0x3, "ATI Radeon RV280"},
+ {0x1002, 0x5c61, 0x3, "ATI Radeon RV280 Mobility"},
+ {0x1002, 0x5c62, 0x3, "ATI Radeon RV280"},
+ {0x1002, 0x5c63, 0x3, "ATI Radeon RV280 Mobility"},
+ {0x1002, 0x5c64, 0x3, "ATI Radeon RV280"},
+ {0, 0, 0, NULL}
};
-struct pci_id_list r128_id_list[] = {
- {0x1002, 0x4c45, "ATI Rage 128 LE"},
- {0x1002, 0x4c46, "ATI Rage 128 LF"},
- {0x1002, 0x4d46, "ATI Rage 128 MF"},
- {0x1002, 0x4d46, "ATI Rage 128 ML"},
- {0x1002, 0x5041, "ATI Rage 128 PA"},
- {0x1002, 0x5042, "ATI Rage 128 PB"},
- {0x1002, 0x5043, "ATI Rage 128 PC"},
- {0x1002, 0x5044, "ATI Rage 128 PD"},
- {0x1002, 0x5045, "ATI Rage 128 PE"},
- {0x1002, 0x5046, "ATI Rage 128 PF"},
- {0x1002, 0x5047, "ATI Rage 128 PG"},
- {0x1002, 0x5048, "ATI Rage 128 PH"},
- {0x1002, 0x5049, "ATI Rage 128 PI"},
- {0x1002, 0x504a, "ATI Rage 128 PJ"},
- {0x1002, 0x504b, "ATI Rage 128 PK"},
- {0x1002, 0x504c, "ATI Rage 128 PL"},
- {0x1002, 0x504d, "ATI Rage 128 PM"},
- {0x1002, 0x504e, "ATI Rage 128 PN"},
- {0x1002, 0x504f, "ATI Rage 128 PO"},
- {0x1002, 0x5050, "ATI Rage 128 PP"},
- {0x1002, 0x5051, "ATI Rage 128 PQ"},
- {0x1002, 0x5052, "ATI Rage 128 PR"},
- {0x1002, 0x5053, "ATI Rage 128 PS"},
- {0x1002, 0x5054, "ATI Rage 128 PT"},
- {0x1002, 0x5055, "ATI Rage 128 PU"},
- {0x1002, 0x5056, "ATI Rage 128 PV"},
- {0x1002, 0x5057, "ATI Rage 128 PW"},
- {0x1002, 0x5058, "ATI Rage 128 PX"},
- {0x1002, 0x5245, "ATI Rage 128 RE"},
- {0x1002, 0x5246, "ATI Rage 128 RF"},
- {0x1002, 0x5247, "ATI Rage 128 RG"},
- {0x1002, 0x524b, "ATI Rage 128 RK"},
- {0x1002, 0x524c, "ATI Rage 128 RL"},
- {0x1002, 0x5345, "ATI Rage 128 SE"},
- {0x1002, 0x5346, "ATI Rage 128 SF"},
- {0x1002, 0x5347, "ATI Rage 128 SG"},
- {0x1002, 0x5348, "ATI Rage 128 SH"},
- {0x1002, 0x534b, "ATI Rage 128 SK"},
- {0x1002, 0x534c, "ATI Rage 128 SL"},
- {0x1002, 0x534d, "ATI Rage 128 SM"},
- {0x1002, 0x534e, "ATI Rage 128 SN"},
- {0x1002, 0x5446, "ATI Rage 128 TF"},
- {0x1002, 0x544c, "ATI Rage 128 TL"},
- {0x1002, 0x5452, "ATI Rage 128 TR"},
- {0x1002, 0x5453, "ATI Rage 128 TS"},
- {0x1002, 0x5454, "ATI Rage 128 TT"},
- {0x1002, 0x5455, "ATI Rage 128 TU"},
- {0, 0, NULL}
-};
+static char *
+make_busid(KdCardAttr *attr)
+{
+ char *busid;
+
+ busid = xalloc(20);
+ if (busid == NULL)
+ return NULL;
+ snprintf(busid, 20, "pci:%04x:%02x:%02x.%d", attr->domain, attr->bus,
+ attr->slot, attr->func);
+ return busid;
+}
static Bool
ATICardInit(KdCardInfo *card)
@@ -205,11 +215,28 @@ ATICardInit(KdCardInfo *card)
return FALSE;
}
+ atic->busid = make_busid(&card->attr);
+ if (atic->busid == NULL)
+ return FALSE;
+
+#ifdef USE_DRI
+ /* We demand identification by busid, not driver name */
+ atic->drmFd = drmOpen(NULL, atic->busid);
+ if (atic->drmFd < 0)
+ ErrorF("Failed to open DRM. DMA won't be used.\n");
+#endif /* USE_DRI */
+
card->driver = atic;
- for (i = 0; radeon_id_list[i].name != NULL; i++) {
- if (radeon_id_list[i].device == card->attr.deviceID)
- atic->is_radeon = TRUE;
+ for (i = 0; ati_pci_ids[i].name != NULL; i++) {
+ struct pci_id_entry *id = &ati_pci_ids[i];
+ if (id->device == card->attr.deviceID) {
+ if (id->caps & CAP_RADEON) {
+ if (id->caps & CAP_R200)
+ atic->is_r200 = TRUE;
+ atic->is_radeon = TRUE;
+ }
+ }
}
return TRUE;
}
@@ -227,15 +254,14 @@ static Bool
ATIScreenInit(KdScreenInfo *screen)
{
ATIScreenInfo *atis;
- ATICardInfo *atic = screen->card->driver;
+ ATICardInfo(screen);
int success = FALSE;
atis = xcalloc(sizeof(ATIScreenInfo), 1);
if (atis == NULL)
return FALSE;
- if (screen->fb[0].depth == 0)
- screen->fb[0].depth = 16;
+ atis->atic = atic;
screen->driver = atis;
diff --git a/hw/kdrive/ati/ati.h b/hw/kdrive/ati/ati.h
index f713d8027..44e83a5ac 100644
--- a/hw/kdrive/ati/ati.h
+++ b/hw/kdrive/ati/ati.h
@@ -35,8 +35,14 @@
#include <vesa.h>
#endif
+#ifdef XF86DRI
+#define USE_DRI
+#include "libdrm.h"
+#include "dri.h"
+#endif
+
#define RADEON_REG_BASE(c) ((c)->attr.address[1])
-#define RADEON_REG_SIZE(c) (0x10000)
+#define RADEON_REG_SIZE(c) (0x4000)
#ifdef __powerpc__
@@ -75,9 +81,14 @@ typedef volatile CARD8 VOL8;
typedef volatile CARD16 VOL16;
typedef volatile CARD32 VOL32;
-struct pci_id_list {
+#define CAP_RADEON 0x1 /* Whether it's a Radeon vs R128 */
+#define CAP_R200 0x2 /* If CAP_RADEON, whether it's an R200 */
+#define CAP_NODRM 0x4 /* Set if no initialization for the DRM yet. */
+
+struct pci_id_entry {
CARD16 vendor;
CARD16 device;
+ CARD8 caps;
char *name;
};
@@ -107,8 +118,14 @@ typedef struct _ATICardInfo {
} backend_priv;
struct backend_funcs backend_funcs;
+ struct pci_id_entry *pci_id;
CARD8 *reg_base;
Bool is_radeon;
+ Bool is_r200;
+ char *busid;
+#ifdef USE_DRI
+ int drmFd;
+#endif /* USE_DRI */
Bool use_fbdev, use_vesa;
} ATICardInfo;
@@ -124,9 +141,96 @@ typedef struct _ATIScreenInfo {
VesaScreenPrivRec vesa;
#endif
} backend_priv;
+ KaaScreenInfoRec kaa;
+ ATICardInfo *atic;
+
+ Bool using_dri;
+ Bool using_dma;
+ /* If is_24bpp is set, then we are using the accelerator in 8-bit mode due
+ * to it being broken for 24bpp, so coordinates have to be multiplied by 3.
+ */
+ Bool is_24bpp;
int datatype;
int dp_gui_master_cntl;
+
+#ifdef USE_DRI
+ drmSize registerSize;
+ drmHandle registerHandle;
+ drmHandle fbHandle;
+
+ int IsAGP;
+ drmSize gartSize;
+ drmHandle agpMemHandle; /* Handle from drmAgpAlloc */
+ unsigned long gartOffset;
+ unsigned char *AGP; /* Map */
+ int agpMode;
+ drmSize pciSize;
+ drmHandle pciMemHandle;
+
+ /* ring buffer data */
+ unsigned long ringStart; /* Offset into AGP space */
+ drmHandle ringHandle; /* Handle from drmAddMap */
+ drmSize ringMapSize; /* Size of map */
+ int ringSize; /* Size of ring (MB) */
+ unsigned char *ring; /* Map */
+
+ unsigned long ringReadOffset; /* Offset into AGP space */
+ drmHandle ringReadPtrHandle; /* Handle from drmAddMap */
+ drmSize ringReadMapSize; /* Size of map */
+ unsigned char *ringReadPtr; /* Map */
+
+ /* vertex/indirect buffer data */
+ unsigned long bufStart; /* Offset into AGP space */
+ drmHandle bufHandle; /* Handle from drmAddMap */
+ drmSize bufMapSize; /* Size of map */
+ int bufSize; /* Size of buffers (MB) */
+ unsigned char *buf; /* Map */
+ int bufNumBufs; /* Number of buffers */
+ drmBufMapPtr buffers; /* Buffer map */
+
+ /* AGP Texture data */
+ unsigned long gartTexStart; /* Offset into AGP space */
+ drmHandle gartTexHandle; /* Handle from drmAddMap */
+ drmSize gartTexMapSize; /* Size of map */
+ int gartTexSize; /* Size of AGP tex space (MB) */
+ unsigned char *gartTex; /* Map */
+ int log2GARTTexGran;
+
+ int CCEMode; /* CCE mode that server/clients use */
+ int CPMode; /* CP mode that server/clients use */
+ int CCEFifoSize; /* Size of the CCE command FIFO */
+ int DMAusecTimeout; /* CCE timeout in usecs */
+
+ /* DMA 2D accleration */
+ drmBufPtr indirectBuffer;
+ int indirectStart;
+
+ /* DRI screen private data */
+ int fbX;
+ int fbY;
+ int backX;
+ int backY;
+ int depthX;
+ int depthY;
+
+ int frontOffset;
+ int frontPitch;
+ int backOffset;
+ int backPitch;
+ int depthOffset;
+ int depthPitch;
+ int spanOffset;
+ int textureOffset;
+ int textureSize;
+ int log2TexGran;
+
+ int irqEnabled;
+
+ int serverContext;
+
+ DRIInfoPtr pDRIInfo;
+#endif /* USE_DRI */
} ATIScreenInfo;
#define getATIScreenInfo(kd) ((ATIScreenInfo *) ((kd)->screen->driver))
@@ -156,6 +260,14 @@ ATIDrawDisable(ScreenPtr pScreen);
void
ATIDrawFini(ScreenPtr pScreen);
+#ifdef USE_DRI
+Bool
+ATIDRIScreenInit(ScreenPtr pScreen);
+
+void
+ATIDRICloseScreen(ScreenPtr pScreen);
+#endif /* USE_DRI */
+
extern KdCardFuncs ATIFuncs;
#endif /* _ATI_H_ */
diff --git a/hw/kdrive/ati/ati_draw.c b/hw/kdrive/ati/ati_draw.c
index c1da03cbe..de9e01e36 100644
--- a/hw/kdrive/ati/ati_draw.c
+++ b/hw/kdrive/ati/ati_draw.c
@@ -28,6 +28,12 @@
#endif
#include "ati.h"
#include "ati_reg.h"
+#include "ati_draw.h"
+#ifdef USE_DRI
+#include "radeon_common.h"
+#include "r128_common.h"
+#include "ati_sarea.h"
+#endif /* USE_DRI */
CARD8 ATISolidRop[16] = {
/* GXclear */ 0x00, /* 0 */
@@ -68,23 +74,20 @@ CARD8 ATIBltRop[16] = {
};
int copydx, copydy;
-Bool is_radeon;
-/* If is_24bpp is set, then we are using the accelerator in 8-bit mode due
- * to it being broken for 24bpp, so coordinates have to be multiplied by 3.
- */
-Bool is_24bpp;
int fifo_size;
-char *mmio;
-CARD32 bltCmd;
+ATIScreenInfo *accel_atis;
static void
-ATIWaitAvail(int n)
+ATIWaitAvailMMIO(int n)
{
+ ATICardInfo *atic = accel_atis->atic;
+ char *mmio = atic->reg_base;
+
if (fifo_size >= n) {
fifo_size -= n;
return;
}
- if (is_radeon) {
+ if (atic->is_radeon) {
do {
fifo_size = MMIO_IN32(mmio, RADEON_REG_RBBM_STATUS) &
RADEON_RBBM_FIFOCNT_MASK;
@@ -100,9 +103,25 @@ ATIWaitAvail(int n)
static void
RadeonWaitIdle(void)
{
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ char *mmio = atic->reg_base;
CARD32 temp;
+
+#ifdef USE_DRI
+ if (atis->using_dma) {
+ int ret;
+
+ do {
+ ret = drmCommandNone(atic->drmFd, DRM_RADEON_CP_IDLE);
+ } while (ret == -EBUSY);
+ if (ret != 0)
+ ErrorF("Failed to idle DMA, returned %d\n", ret);
+ }
+#endif /* USE_DRI */
+
/* Wait for the engine to go idle */
- ATIWaitAvail(64);
+ ATIWaitAvailMMIO(64);
while ((MMIO_IN32(mmio, RADEON_REG_RBBM_STATUS) &
RADEON_RBBM_ACTIVE) != 0)
@@ -121,10 +140,25 @@ RadeonWaitIdle(void)
static void
R128WaitIdle(void)
{
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ char *mmio = atic->reg_base;
CARD32 temp;
int tries;
- ATIWaitAvail(64);
+#ifdef USE_DRI
+ if (atis->using_dma) {
+ int ret;
+
+ do {
+ ret = drmCommandNone(atic->drmFd, DRM_R128_CCE_IDLE);
+ } while (ret == -EBUSY);
+ if (ret != 0)
+ ErrorF("Failed to idle DMA, returned %d\n", ret);
+ }
+#endif /* USE_DRI */
+
+ ATIWaitAvailMMIO(64);
tries = 1000000;
while (tries--) {
@@ -146,170 +180,151 @@ R128WaitIdle(void)
static void
ATIWaitIdle(void)
{
- if (is_radeon)
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+
+#ifdef USE_DRI
+ /* Dispatch any accumulated commands first. */
+ if (atis->using_dma && atis->indirectBuffer != NULL)
+ ATIDMAFlushIndirect(0);
+#endif /* USE_DRI */
+
+ if (atic->is_radeon)
RadeonWaitIdle();
else
R128WaitIdle();
}
-static Bool
-ATISetup(PixmapPtr pDst, PixmapPtr pSrc)
+#ifdef USE_DRI
+void ATIDMAStart(ScreenPtr pScreen)
{
- KdScreenPriv(pDst->drawable.pScreen);
+ KdScreenPriv(pScreen);
ATICardInfo(pScreenPriv);
- int dst_offset, dst_pitch, src_offset = 0, src_pitch = 0;
- int bpp = pScreenPriv->screen->fb[0].bitsPerPixel;
-
- mmio = atic->reg_base;
-
- /* No acceleration for other formats (yet) */
- if (pDst->drawable.bitsPerPixel != bpp)
- return FALSE;
-
- dst_pitch = pDst->devKind;
- dst_offset = ((CARD8 *)pDst->devPrivate.ptr -
- pScreenPriv->screen->memory_base);
- if (pSrc != NULL) {
- src_pitch = pSrc->devKind;
- src_offset = ((CARD8 *)pSrc->devPrivate.ptr -
- pScreenPriv->screen->memory_base);
- }
+ ATIScreenInfo(pScreenPriv);
+ int ret;
- ATIWaitAvail((pSrc != NULL) ? 3 : 2);
- if (is_radeon) {
- MMIO_OUT32(mmio, RADEON_REG_DST_PITCH_OFFSET,
- ((dst_pitch >> 6) << 22) | (dst_offset >> 10));
- if (pSrc != NULL) {
- MMIO_OUT32(mmio, RADEON_REG_SRC_PITCH_OFFSET,
- ((src_pitch >> 6) << 22) | (src_offset >> 10));
- }
- } else {
- if (is_24bpp) {
- dst_pitch *= 3;
- src_pitch *= 3;
- }
- /* R128 pitch is in units of 8 pixels, offset in 32 bytes */
- MMIO_OUT32(mmio, RADEON_REG_DST_PITCH_OFFSET,
- ((dst_pitch/bpp) << 21) | (dst_offset >> 5));
- if (pSrc != NULL) {
- MMIO_OUT32(mmio, RADEON_REG_SRC_PITCH_OFFSET,
- ((src_pitch/bpp) << 21) | (src_offset >> 5));
- }
- }
- MMIO_OUT32(mmio, RADEON_REG_DEFAULT_SC_BOTTOM_RIGHT,
- (RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX));
+ if (atic->is_radeon)
+ ret = drmCommandNone(atic->drmFd, DRM_RADEON_CP_START);
+ else
+ ret = drmCommandNone(atic->drmFd, DRM_R128_CCE_START);
- return TRUE;
+ if (ret == 0)
+ atis->using_dma = TRUE;
+ else
+ ErrorF("%s: DMA start returned %d\n", __FUNCTION__, ret);
}
-static Bool
-ATIPrepareSolid(PixmapPtr pPixmap, int alu, Pixel pm, Pixel fg)
+/* Attempts to idle the DMA engine, and stops it. Note that the ioctl is the
+ * same for both R128 and Radeon, so we can just use the name of one of them.
+ */
+void ATIDMAStop(ScreenPtr pScreen)
{
- KdScreenPriv(pPixmap->drawable.pScreen);
+ KdScreenPriv(pScreen);
+ ATICardInfo(pScreenPriv);
ATIScreenInfo(pScreenPriv);
+ drmRadeonCPStop stop;
+ int ret;
- if (is_24bpp) {
- if (pm != 0xffffffff)
- return FALSE;
- /* Solid fills in fake-24bpp mode only work if the pixel color
- * is all the same byte.
- */
- if ((fg & 0xffffff) != (((fg & 0xff) << 16) | ((fg >> 8) &
- 0xffff)))
- return FALSE;
- }
+ stop.flush = 1;
+ stop.idle = 1;
+ ret = drmCommandWrite(atic->drmFd, DRM_RADEON_CP_STOP, &stop,
+ sizeof(drmRadeonCPStop));
- if (!ATISetup(pPixmap, NULL))
- return FALSE;
+ if (ret != 0 && errno == EBUSY) {
+ ErrorF("Failed to idle the DMA engine\n");
- ATIWaitAvail(4);
- MMIO_OUT32(mmio, RADEON_REG_DP_GUI_MASTER_CNTL,
- atis->dp_gui_master_cntl |
- RADEON_GMC_BRUSH_SOLID_COLOR |
- RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- (ATISolidRop[alu] << 16));
- MMIO_OUT32(mmio, RADEON_REG_DP_BRUSH_FRGD_CLR, fg);
- MMIO_OUT32(mmio, RADEON_REG_DP_WRITE_MASK, pm);
- MMIO_OUT32(mmio, RADEON_REG_DP_CNTL, RADEON_DST_X_LEFT_TO_RIGHT |
- RADEON_DST_Y_TOP_TO_BOTTOM);
-
- return TRUE;
-}
-
-static void
-ATISolid(int x1, int y1, int x2, int y2)
-{
- if (is_24bpp) {
- x1 *= 3;
- x2 *= 3;
+ stop.idle = 0;
+ ret = drmCommandWrite(atic->drmFd, DRM_RADEON_CP_STOP, &stop,
+ sizeof(drmRadeonCPStop));
}
- ATIWaitAvail(2);
- MMIO_OUT32(mmio, RADEON_REG_DST_Y_X, (y1 << 16) | x1);
- MMIO_OUT32(mmio, RADEON_REG_DST_WIDTH_HEIGHT, ((x2 - x1) << 16) |
- (y2 - y1));
+ atis->using_dma = FALSE;
}
-static void
-ATIDoneSolid(void)
+/* The R128 and Radeon Indirect ioctls differ only in the ioctl number */
+void ATIDMADispatchIndirect(Bool discard)
{
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ drmBufPtr buffer = atis->indirectBuffer;
+ drmR128Indirect indirect;
+ int cmd;
+
+ indirect.idx = buffer->idx;
+ indirect.start = atis->indirectStart;
+ indirect.end = buffer->used;
+ indirect.discard = discard;
+ cmd = atic->is_radeon ? DRM_RADEON_INDIRECT : DRM_R128_INDIRECT;
+ drmCommandWriteRead(atic->drmFd, cmd, &indirect,
+ sizeof(drmR128Indirect));
}
-static Bool
-ATIPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu, Pixel pm)
+/* Flush the indirect buffer to the kernel for submission to the card */
+void ATIDMAFlushIndirect(Bool discard)
{
- KdScreenPriv(pDst->drawable.pScreen);
- ATIScreenInfo(pScreenPriv);
-
- copydx = dx;
- copydy = dy;
-
- if (is_24bpp && pm != 0xffffffff)
- return FALSE;
+ ATIScreenInfo *atis = accel_atis;
+ drmBufPtr buffer = atis->indirectBuffer;
- if (!ATISetup(pDst, pSrc))
- return FALSE;
+ if (buffer == NULL)
+ return;
+ if ((atis->indirectStart == buffer->used) && !discard)
+ return;
- ATIWaitAvail(3);
- MMIO_OUT32(mmio, RADEON_REG_DP_GUI_MASTER_CNTL,
- atis->dp_gui_master_cntl |
- RADEON_GMC_BRUSH_SOLID_COLOR |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- (ATIBltRop[alu] << 16) |
- RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
- RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_DP_SRC_SOURCE_MEMORY);
- MMIO_OUT32(mmio, RADEON_REG_DP_WRITE_MASK, pm);
- MMIO_OUT32(mmio, RADEON_REG_DP_CNTL,
- (dx >= 0 ? RADEON_DST_X_LEFT_TO_RIGHT : 0) |
- (dy >= 0 ? RADEON_DST_Y_TOP_TO_BOTTOM : 0));
+ ATIDMADispatchIndirect(discard);
- return TRUE;
+ if (discard) {
+ atis->indirectBuffer = ATIDMAGetBuffer();
+ atis->indirectStart = 0;
+ } else {
+ /* Start on a double word boundary */
+ atis->indirectStart = buffer->used = (buffer->used + 7) & ~7;
+ }
}
-static void
-ATICopy(int srcX, int srcY, int dstX, int dstY, int w, int h)
+/* Get an indirect buffer for the DMA 2D acceleration commands */
+drmBufPtr ATIDMAGetBuffer()
{
- if (is_24bpp) {
- srcX *= 3;
- dstX *= 3;
- w *= 3;
- }
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ drmDMAReq dma;
+ drmBufPtr buf = NULL;
+ int indx = 0;
+ int size = 0;
+ int ret;
+
+ dma.context = atis->serverContext;
+ dma.send_count = 0;
+ dma.send_list = NULL;
+ dma.send_sizes = NULL;
+ dma.flags = 0;
+ dma.request_count = 1;
+ if (atis->atic->is_radeon)
+ dma.request_size = RADEON_BUFFER_SIZE;
+ else
+ dma.request_size = R128_BUFFER_SIZE;
+ dma.request_list = &indx;
+ dma.request_sizes = &size;
+ dma.granted_count = 0;
+
+ do {
+ ret = drmDMA(atic->drmFd, &dma);
+ } while (ret != 0);
+
+ buf = &atis->buffers->list[indx];
+ buf->used = 0;
+ return buf;
+}
- if (copydx < 0) {
- srcX += w - 1;
- dstX += w - 1;
- }
+#define USE_DMA
+#include "ati_drawtmp.h"
- if (copydy < 0) {
- srcY += h - 1;
- dstY += h - 1;
- }
+#endif /* USE_DRI */
+
+#undef USE_DMA
+#include "ati_drawtmp.h"
- ATIWaitAvail(3);
- MMIO_OUT32(mmio, RADEON_REG_SRC_Y_X, (srcY << 16) | srcX);
- MMIO_OUT32(mmio, RADEON_REG_DST_Y_X, (dstY << 16) | dstX);
- MMIO_OUT32(mmio, RADEON_REG_DST_HEIGHT_WIDTH, (h << 16) | w);
+static void
+ATIDoneSolid(void)
+{
}
static void
@@ -317,20 +332,6 @@ ATIDoneCopy(void)
{
}
-static KaaScreenInfoRec ATIKaa = {
- ATIPrepareSolid,
- ATISolid,
- ATIDoneSolid,
-
- ATIPrepareCopy,
- ATICopy,
- ATIDoneCopy,
-
- 0, /* offscreenByteAlign */
- 0, /* offscreenPitch */
- KAA_OFFSCREEN_PIXMAPS, /* flags */
-};
-
Bool
ATIDrawInit(ScreenPtr pScreen)
{
@@ -338,9 +339,6 @@ ATIDrawInit(ScreenPtr pScreen)
ATIScreenInfo(pScreenPriv);
ATICardInfo(pScreenPriv);
- is_radeon = atic->is_radeon;
- is_24bpp = FALSE;
-
switch (pScreenPriv->screen->fb[0].depth)
{
case 8:
@@ -354,7 +352,7 @@ ATIDrawInit(ScreenPtr pScreen)
break;
case 24:
if (pScreenPriv->screen->fb[0].bitsPerPixel == 24) {
- is_24bpp = TRUE;
+ atis->is_24bpp = TRUE;
atis->datatype = 2;
} else {
atis->datatype = 6;
@@ -366,22 +364,52 @@ ATIDrawInit(ScreenPtr pScreen)
return FALSE;
}
+ ErrorF("Screen: %d/%d depth/bpp\n", pScreenPriv->screen->fb[0].depth,
+ pScreenPriv->screen->fb[0].bitsPerPixel);
+#ifdef USE_DRI
+ if (atis->using_dri)
+ ATIDMAStart(pScreen);
+ else {
+ if (ATIDRIScreenInit(pScreen))
+ atis->using_dri = TRUE;
+ }
+#endif /* USE_DRI */
+
atis->dp_gui_master_cntl = (atis->datatype << 8) |
RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_AUX_CLIP_DIS;
- if (is_radeon) {
- ATIKaa.offscreenByteAlign = 1024;
- ATIKaa.offscreenPitch = 1024;
+ memset(&atis->kaa, 0, sizeof(KaaScreenInfoRec));
+#ifdef USE_DRI
+ if (atis->using_dma) {
+ atis->kaa.PrepareSolid = ATIPrepareSolidDMA;
+ atis->kaa.Solid = ATISolidDMA;
+ atis->kaa.PrepareCopy = ATIPrepareCopyDMA;
+ atis->kaa.Copy = ATICopyDMA;
} else {
- ATIKaa.offscreenByteAlign = 8;
+#else
+ {
+#endif /* USE_DRI */
+ atis->kaa.PrepareSolid = ATIPrepareSolidMMIO;
+ atis->kaa.Solid = ATISolidMMIO;
+ atis->kaa.PrepareCopy = ATIPrepareCopyMMIO;
+ atis->kaa.Copy = ATICopyMMIO;
+ }
+ atis->kaa.DoneSolid = ATIDoneSolid;
+ atis->kaa.DoneCopy = ATIDoneCopy;
+ atis->kaa.flags = KAA_OFFSCREEN_PIXMAPS;
+ if (atic->is_radeon) {
+ atis->kaa.offscreenByteAlign = 1024;
+ atis->kaa.offscreenPitch = 1024;
+ } else {
+ atis->kaa.offscreenByteAlign = 8;
/* Workaround for corrupation at 8 and 24bpp. Why? */
if (atis->datatype == 2)
- ATIKaa.offscreenPitch = 16;
+ atis->kaa.offscreenPitch = 16;
else
- ATIKaa.offscreenPitch =
+ atis->kaa.offscreenPitch =
pScreenPriv->screen->fb[0].bitsPerPixel;
}
- if (!kaaDrawInit(pScreen, &ATIKaa))
+ if (!kaaDrawInit(pScreen, &atis->kaa))
return FALSE;
return TRUE;
@@ -401,15 +429,25 @@ ATIDrawDisable(ScreenPtr pScreen)
void
ATIDrawFini(ScreenPtr pScreen)
{
+#ifdef USE_DRI
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+
+ if (atis->using_dma)
+ ATIDMAStop(pScreen);
+
+ if (atis->using_dri)
+ ATIDRICloseScreen(pScreen);
+#endif /* USE_DRI */
}
void
ATIDrawSync(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
- ATICardInfo(pScreenPriv);
+ ATIScreenInfo(pScreenPriv);
- mmio = atic->reg_base;
+ accel_atis = atis;
ATIWaitIdle();
}
diff --git a/hw/kdrive/ati/ati_draw.h b/hw/kdrive/ati/ati_draw.h
new file mode 100644
index 000000000..95b3b875c
--- /dev/null
+++ b/hw/kdrive/ati/ati_draw.h
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
+ * Copyright © 2003 Eric Anholt
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Eric Anholt not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Eric Anholt makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $Header$ */
+
+#ifndef _ATI_DRAW_H_
+#define _ATI_DRAW_H_
+
+#ifdef USE_DRI
+
+#define DMA_PACKET0( reg, n ) \
+ (RADEON_CP_PACKET0 | ((n) << 16) | ((reg) >> 2))
+
+#define RING_LOCALS CARD32 *__head; int __count;
+
+#define BEGIN_RING( n ) \
+do { \
+ if (atis->indirectBuffer == NULL) { \
+ atis->indirectBuffer = ATIDMAGetBuffer(); \
+ atis->indirectStart = 0; \
+ } else if ((atis->indirectBuffer->used + 4*(n)) > \
+ atis->indirectBuffer->total) { \
+ ATIDMAFlushIndirect(1); \
+ } \
+ __head = (pointer)((char *)atis->indirectBuffer->address + \
+ atis->indirectBuffer->used); \
+ __count = 0; \
+} while (0)
+
+#define ADVANCE_RING() do { \
+ atis->indirectBuffer->used += __count * (int)sizeof(CARD32); \
+} while (0)
+
+#define OUT_RING(x) do { \
+ MMIO_OUT32(&__head[__count++], 0, (x)); \
+} while (0)
+
+#define OUT_RING_REG(reg, val) \
+do { \
+ OUT_RING(DMA_PACKET0(reg, 0)); \
+ OUT_RING(val); \
+} while (0)
+
+drmBufPtr ATIDMAGetBuffer(void);
+void ATIDMAFlushIndirect(Bool discard);
+void ATIDMADispatchIndirect(Bool discard);
+void ATIDMAStart(ScreenPtr pScreen);
+void ATIDMAStop(ScreenPtr pScreen);
+
+#endif /* USE_DRI */
+
+#endif /* _ATI_DRAW_H_ */
diff --git a/hw/kdrive/ati/ati_drawtmp.h b/hw/kdrive/ati/ati_drawtmp.h
new file mode 100644
index 000000000..890800d2a
--- /dev/null
+++ b/hw/kdrive/ati/ati_drawtmp.h
@@ -0,0 +1,217 @@
+/*
+ * $Id$
+ *
+ * Copyright © 2003 Eric Anholt
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Eric Anholt not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Eric Anholt makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $Header$ */
+
+#ifdef USE_DMA
+#define TAG(x) x##DMA
+#define LOCALS RING_LOCALS
+#define BEGIN(x) BEGIN_RING(x * 2)
+#define OUT_REG(reg, val) OUT_RING_REG(reg, val)
+#define END() ADVANCE_RING()
+#else
+#define TAG(x) x##MMIO
+#define LOCALS char *mmio = atic->reg_base
+#define BEGIN(x) ATIWaitAvailMMIO(x)
+#define OUT_REG(reg, val) MMIO_OUT32((mmio), (reg), (val))
+#define END()
+#endif
+
+static Bool
+TAG(ATISetup)(PixmapPtr pDst, PixmapPtr pSrc)
+{
+ KdScreenPriv(pDst->drawable.pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ int dst_offset, dst_pitch, src_offset = 0, src_pitch = 0;
+ int bpp = pScreenPriv->screen->fb[0].bitsPerPixel;
+ LOCALS;
+
+ accel_atis = atis;
+
+ /* No acceleration for other formats (yet) */
+ if (pDst->drawable.bitsPerPixel != bpp)
+ return FALSE;
+
+ dst_pitch = pDst->devKind;
+ dst_offset = ((CARD8 *)pDst->devPrivate.ptr -
+ pScreenPriv->screen->memory_base);
+ if (pSrc != NULL) {
+ src_pitch = pSrc->devKind;
+ src_offset = ((CARD8 *)pSrc->devPrivate.ptr -
+ pScreenPriv->screen->memory_base);
+ }
+
+ BEGIN((pSrc != NULL) ? 3 : 2);
+ if (atic->is_radeon) {
+ OUT_REG(RADEON_REG_DST_PITCH_OFFSET,
+ ((dst_pitch >> 6) << 22) | (dst_offset >> 10));
+ if (pSrc != NULL) {
+ OUT_REG(RADEON_REG_SRC_PITCH_OFFSET,
+ ((src_pitch >> 6) << 22) | (src_offset >> 10));
+ }
+ } else {
+ if (atis->is_24bpp) {
+ dst_pitch *= 3;
+ src_pitch *= 3;
+ }
+ /* R128 pitch is in units of 8 pixels, offset in 32 bytes */
+ OUT_REG(RADEON_REG_DST_PITCH_OFFSET,
+ ((dst_pitch/bpp) << 21) | (dst_offset >> 5));
+ if (pSrc != NULL) {
+ OUT_REG(RADEON_REG_SRC_PITCH_OFFSET,
+ ((src_pitch/bpp) << 21) | (src_offset >> 5));
+ }
+ }
+ OUT_REG(RADEON_REG_DEFAULT_SC_BOTTOM_RIGHT,
+ (RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX));
+ END();
+
+ return TRUE;
+}
+
+static Bool
+TAG(ATIPrepareSolid)(PixmapPtr pPixmap, int alu, Pixel pm, Pixel fg)
+{
+ KdScreenPriv(pPixmap->drawable.pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ LOCALS;
+
+ if (atis->is_24bpp) {
+ if (pm != 0xffffffff)
+ return FALSE;
+ /* Solid fills in fake-24bpp mode only work if the pixel color
+ * is all the same byte.
+ */
+ if ((fg & 0xffffff) != (((fg & 0xff) << 16) | ((fg >> 8) &
+ 0xffff)))
+ return FALSE;
+ }
+
+ if (!TAG(ATISetup)(pPixmap, NULL))
+ return FALSE;
+
+ BEGIN(4);
+ OUT_REG(RADEON_REG_DP_GUI_MASTER_CNTL,
+ atis->dp_gui_master_cntl |
+ RADEON_GMC_BRUSH_SOLID_COLOR |
+ RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ (ATISolidRop[alu] << 16));
+ OUT_REG(RADEON_REG_DP_BRUSH_FRGD_CLR, fg);
+ OUT_REG(RADEON_REG_DP_WRITE_MASK, pm);
+ OUT_REG(RADEON_REG_DP_CNTL, RADEON_DST_X_LEFT_TO_RIGHT |
+ RADEON_DST_Y_TOP_TO_BOTTOM);
+ END();
+
+ return TRUE;
+}
+
+static void
+TAG(ATISolid)(int x1, int y1, int x2, int y2)
+{
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ LOCALS;
+
+ if (atis->is_24bpp) {
+ x1 *= 3;
+ x2 *= 3;
+ }
+ BEGIN(2);
+ OUT_REG(RADEON_REG_DST_Y_X, (y1 << 16) | x1);
+ OUT_REG(RADEON_REG_DST_WIDTH_HEIGHT, ((x2 - x1) << 16) | (y2 - y1));
+ END();
+}
+
+static Bool
+TAG(ATIPrepareCopy)(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu, Pixel pm)
+{
+ KdScreenPriv(pDst->drawable.pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ LOCALS;
+
+ copydx = dx;
+ copydy = dy;
+
+ if (atis->is_24bpp && pm != 0xffffffff)
+ return FALSE;
+
+ if (!TAG(ATISetup)(pDst, pSrc))
+ return FALSE;
+
+ BEGIN(3);
+ OUT_REG(RADEON_REG_DP_GUI_MASTER_CNTL,
+ atis->dp_gui_master_cntl |
+ RADEON_GMC_BRUSH_SOLID_COLOR |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ (ATIBltRop[alu] << 16) |
+ RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
+ RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_DP_SRC_SOURCE_MEMORY);
+ OUT_REG(RADEON_REG_DP_WRITE_MASK, pm);
+ OUT_REG(RADEON_REG_DP_CNTL,
+ (dx >= 0 ? RADEON_DST_X_LEFT_TO_RIGHT : 0) |
+ (dy >= 0 ? RADEON_DST_Y_TOP_TO_BOTTOM : 0));
+ END();
+
+ return TRUE;
+}
+
+static void
+TAG(ATICopy)(int srcX, int srcY, int dstX, int dstY, int w, int h)
+{
+ ATIScreenInfo *atis = accel_atis;
+ ATICardInfo *atic = atis->atic;
+ LOCALS;
+
+ if (atis->is_24bpp) {
+ srcX *= 3;
+ dstX *= 3;
+ w *= 3;
+ }
+
+ if (copydx < 0) {
+ srcX += w - 1;
+ dstX += w - 1;
+ }
+
+ if (copydy < 0) {
+ srcY += h - 1;
+ dstY += h - 1;
+ }
+
+ BEGIN(3);
+ OUT_REG(RADEON_REG_SRC_Y_X, (srcY << 16) | srcX);
+ OUT_REG(RADEON_REG_DST_Y_X, (dstY << 16) | dstX);
+ OUT_REG(RADEON_REG_DST_HEIGHT_WIDTH, (h << 16) | w);
+ END();
+}
+
+#undef TAG
+#undef LOCALS
+#undef BEGIN
+#undef OUT_REG
+#undef END
diff --git a/hw/kdrive/ati/ati_dri.c b/hw/kdrive/ati/ati_dri.c
new file mode 100644
index 000000000..e289573f8
--- /dev/null
+++ b/hw/kdrive/ati/ati_dri.c
@@ -0,0 +1,929 @@
+/*
+ * $Id$
+ *
+ * Copyright © 2003 Eric Anholt
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Eric Anholt not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Eric Anholt makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $Header$ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "ati.h"
+#include "ati_reg.h"
+#include "ati_dri.h"
+#include "ati_dripriv.h"
+#include "sarea.h"
+#include "ati_sarea.h"
+#include "ati_draw.h"
+#include "r128_common.h"
+#include "radeon_common.h"
+
+/* ?? HACK - for now, put this here... */
+/* ?? Alpha - this may need to be a variable to handle UP1x00 vs TITAN */
+#if defined(__alpha__)
+# define DRM_PAGE_SIZE 8192
+#elif defined(__ia64__)
+# define DRM_PAGE_SIZE getpagesize()
+#else
+# define DRM_PAGE_SIZE 4096
+#endif
+
+void XFree86DRIExtensionInit(void);
+
+static Bool ATIDRIFinishScreenInit(ScreenPtr pScreen);
+
+/* Compute log base 2 of val. */
+static int
+ATILog2(int val)
+{
+ int bits;
+
+ if (!val)
+ return 1;
+ for (bits = 0; val != 0; val >>= 1, ++bits)
+ ;
+ return bits;
+}
+
+static void
+ATIDRIInitGARTValues(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ int s, l;
+
+ atis->gartOffset = 0;
+
+ /* Initialize the ring buffer data */
+ atis->ringStart = atis->gartOffset;
+ atis->ringMapSize = atis->ringSize*1024*1024 + DRM_PAGE_SIZE;
+
+ atis->ringReadOffset = atis->ringStart + atis->ringMapSize;
+ atis->ringReadMapSize = DRM_PAGE_SIZE;
+
+ /* Reserve space for vertex/indirect buffers */
+ atis->bufStart = atis->ringReadOffset + atis->ringReadMapSize;
+ atis->bufMapSize = atis->bufSize*1024*1024;
+
+ /* Reserve the rest for GART textures */
+ atis->gartTexStart = atis->bufStart + atis->bufMapSize;
+ s = (atis->gartSize*1024*1024 - atis->gartTexStart);
+ l = ATILog2((s-1) / ATI_NR_TEX_REGIONS);
+ if (l < ATI_LOG_TEX_GRANULARITY) l = ATI_LOG_TEX_GRANULARITY;
+ atis->gartTexMapSize = (s >> l) << l;
+ atis->log2GARTTexGran = l;
+}
+
+static int
+ATIDRIAddAndMap(int fd, drmHandle offset, drmSize size,
+ drmMapType type, drmMapFlags flags, drmHandlePtr handle,
+ drmAddressPtr address, char *desc)
+{
+ char *name;
+
+ name = (type == DRM_AGP) ? "agp" : "pci";
+
+ if (drmAddMap(fd, offset, size, type, flags, handle) < 0) {
+ ErrorF("[%s] Could not add %s mapping\n", name, desc);
+ return FALSE;
+ }
+ ErrorF("[%s] %s handle = 0x%08lx\n", name, desc, *handle);
+
+ if (drmMap(fd, *handle, size, address) < 0) {
+ ErrorF("[agp] Could not map %s\n", name, desc);
+ return FALSE;
+ }
+ ErrorF("[%s] %s mapped at 0x%08lx\n", name, desc, address);
+
+ return TRUE;
+}
+
+/* Initialize the AGP state. Request memory for use in AGP space, and
+ initialize the Rage 128 registers to point to that memory. */
+static Bool
+ATIDRIAgpInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ unsigned char *mmio = atic->reg_base;
+ unsigned long mode;
+ int ret;
+ unsigned long agpBase;
+ CARD32 cntl, chunk;
+
+ if (drmAgpAcquire(atic->drmFd) < 0) {
+ ErrorF("[agp] AGP not available\n");
+ return FALSE;
+ }
+
+ ATIDRIInitGARTValues(pScreen);
+
+ /* Modify the mode if the default mode is not appropriate for this
+ * particular combination of graphics card and AGP chipset.
+ */
+
+ /* XXX: Disable fast writes? */
+
+ mode = drmAgpGetMode(atic->drmFd);
+ if (mode > 4)
+ mode = 4;
+ /* Set all mode bits below the chosen one so fallback can happen */
+ mode = (mode * 2) - 1;
+
+ if (drmAgpEnable(atic->drmFd, mode) < 0) {
+ ErrorF("[agp] AGP not enabled\n");
+ drmAgpRelease(atic->drmFd);
+ return FALSE;
+ }
+
+ /* Workaround for some hardware bugs */
+ /* XXX: Magic numbers */
+ if (!atic->is_r200) {
+ cntl = MMIO_IN32(mmio, RADEON_REG_AGP_CNTL) | 0x000e0000;
+ MMIO_OUT32(mmio, RADEON_REG_AGP_CNTL, cntl);
+ }
+
+ if ((ret = drmAgpAlloc(atic->drmFd, atis->gartSize*1024*1024, 0, NULL,
+ &atis->agpMemHandle)) < 0) {
+ ErrorF("[agp] Out of memory (%d)\n", ret);
+ drmAgpRelease(atic->drmFd);
+ return FALSE;
+ }
+ ErrorF("[agp] %d kB allocated with handle 0x%08lx\n",
+ atis->gartSize*1024, (long)atis->agpMemHandle);
+
+ if (drmAgpBind(atic->drmFd, atis->agpMemHandle, atis->gartOffset) < 0) {
+ ErrorF("[agp] Could not bind\n");
+ drmAgpFree(atic->drmFd, atis->agpMemHandle);
+ drmAgpRelease(atic->drmFd);
+ return FALSE;
+ }
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->ringStart, atis->ringMapSize,
+ DRM_AGP, DRM_READ_ONLY, &atis->ringHandle,
+ (drmAddressPtr)&atis->ring, "ring"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->ringReadOffset,
+ atis->ringReadMapSize, DRM_AGP, DRM_READ_ONLY,
+ &atis->ringReadPtrHandle, (drmAddressPtr)&atis->ringReadPtr,
+ "ring read ptr"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->bufStart, atis->bufMapSize,
+ DRM_AGP, 0, &atis->bufHandle, (drmAddressPtr)&atis->buf,
+ "vertex/indirect buffers"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->gartTexStart,
+ atis->gartTexMapSize, DRM_AGP, 0, &atis->gartTexHandle,
+ (drmAddressPtr)&atis->gartTex, "AGP texture map"))
+ return FALSE;
+
+ /* Initialize radeon/r128 AGP registers */
+ cntl = MMIO_IN32(mmio, RADEON_REG_AGP_CNTL);
+ cntl &= ~RADEON_AGP_APER_SIZE_MASK;
+ switch (atis->gartSize) {
+ case 256: cntl |= RADEON_AGP_APER_SIZE_256MB; break;
+ case 128: cntl |= RADEON_AGP_APER_SIZE_128MB; break;
+ case 64: cntl |= RADEON_AGP_APER_SIZE_64MB; break;
+ case 32: cntl |= RADEON_AGP_APER_SIZE_32MB; break;
+ case 16: cntl |= RADEON_AGP_APER_SIZE_16MB; break;
+ case 8: cntl |= RADEON_AGP_APER_SIZE_8MB; break;
+ case 4: cntl |= RADEON_AGP_APER_SIZE_4MB; break;
+ default:
+ ErrorF("[agp] Illegal aperture size %d kB\n", atis->gartSize*1024);
+ return FALSE;
+ }
+ agpBase = drmAgpBase(atic->drmFd);
+ MMIO_OUT32(mmio, RADEON_REG_AGP_BASE, agpBase);
+ MMIO_OUT32(mmio, RADEON_REG_AGP_CNTL, cntl);
+
+ if (!atic->is_radeon) {
+ /* Disable Rage 128 PCIGART registers */
+ chunk = MMIO_IN32(mmio, R128_REG_BM_CHUNK_0_VAL);
+ chunk &= ~(R128_BM_PTR_FORCE_TO_PCI |
+ R128_BM_PM4_RD_FORCE_TO_PCI |
+ R128_BM_GLOBAL_FORCE_TO_PCI);
+ MMIO_OUT32(mmio, R128_REG_BM_CHUNK_0_VAL, chunk);
+
+ /* Ensure AGP GART is used (for now) */
+ MMIO_OUT32(mmio, R128_REG_PCI_GART_PAGE, 1);
+ }
+
+ return TRUE;
+}
+
+static Bool
+ATIDRIPciInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ unsigned char *mmio = atic->reg_base;
+ CARD32 chunk;
+ int ret;
+
+ ATIDRIInitGARTValues(pScreen);
+
+ ret = drmScatterGatherAlloc(atic->drmFd, atis->gartSize*1024*1024,
+ &atis->pciMemHandle);
+ if (ret < 0) {
+ ErrorF("[pci] Out of memory (%d)\n", ret);
+ return FALSE;
+ }
+ ErrorF("[pci] %d kB allocated with handle 0x%08lx\n",
+ atis->gartSize*1024, (long)atis->pciMemHandle);
+
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->ringStart, atis->ringMapSize,
+ DRM_SCATTER_GATHER, DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL,
+ &atis->ringHandle, (drmAddressPtr)&atis->ring, "ring"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->ringReadOffset,
+ atis->ringReadMapSize, DRM_SCATTER_GATHER,
+ DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL,
+ &atis->ringReadPtrHandle, (drmAddressPtr)&atis->ringReadPtr,
+ "ring read ptr"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->bufStart, atis->bufMapSize,
+ DRM_SCATTER_GATHER, 0, &atis->bufHandle, (drmAddressPtr)&atis->buf,
+ "vertex/indirect buffers"))
+ return FALSE;
+
+ if (!ATIDRIAddAndMap(atic->drmFd, atis->gartTexStart,
+ atis->gartTexMapSize, DRM_SCATTER_GATHER, 0, &atis->gartTexHandle,
+ (drmAddressPtr)&atis->gartTex, "PCI texture map"))
+ return FALSE;
+
+ if (!atic->is_radeon) {
+ /* Force PCI GART mode */
+ chunk = MMIO_IN32(mmio, R128_REG_BM_CHUNK_0_VAL);
+ chunk |= (R128_BM_PTR_FORCE_TO_PCI |
+ R128_BM_PM4_RD_FORCE_TO_PCI | R128_BM_GLOBAL_FORCE_TO_PCI);
+ MMIO_OUT32(mmio, R128_REG_BM_CHUNK_0_VAL, chunk);
+ MMIO_OUT32(mmio, R128_REG_PCI_GART_PAGE, 0); /* Ensure PCI GART is used */
+ }
+ return TRUE;
+}
+
+
+/* Initialize the kernel data structures. */
+static int
+R128DRIKernelInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ drmR128Init drmInfo;
+
+ memset(&drmInfo, 0, sizeof(drmR128Init) );
+
+ drmInfo.func = DRM_R128_INIT_CCE;
+ drmInfo.sarea_priv_offset = sizeof(XF86DRISAREARec);
+ drmInfo.is_pci = !atis->IsAGP;
+ drmInfo.cce_mode = atis->CCEMode;
+ drmInfo.cce_secure = TRUE;
+ drmInfo.ring_size = atis->ringSize*1024*1024;
+ drmInfo.usec_timeout = atis->DMAusecTimeout;
+
+ drmInfo.fb_bpp = pScreenPriv->screen->fb[0].depth;
+ drmInfo.depth_bpp = pScreenPriv->screen->fb[0].depth;
+
+ /* XXX: pitches are in pixels on r128. */
+ drmInfo.front_offset = atis->frontOffset;
+ drmInfo.front_pitch = atis->frontPitch;
+
+ drmInfo.back_offset = atis->backOffset;
+ drmInfo.back_pitch = atis->backPitch;
+
+ drmInfo.depth_offset = atis->depthOffset;
+ drmInfo.depth_pitch = atis->depthPitch;
+ drmInfo.span_offset = atis->spanOffset;
+
+ drmInfo.fb_offset = atis->fbHandle;
+ drmInfo.mmio_offset = atis->registerHandle;
+ drmInfo.ring_offset = atis->ringHandle;
+ drmInfo.ring_rptr_offset = atis->ringReadPtrHandle;
+ drmInfo.buffers_offset = atis->bufHandle;
+ drmInfo.agp_textures_offset = atis->gartTexHandle;
+
+ if (drmCommandWrite(atic->drmFd, DRM_R128_INIT, &drmInfo,
+ sizeof(drmR128Init)) < 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Initialize the kernel data structures */
+static int
+RadeonDRIKernelInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ drmRadeonInit drmInfo;
+
+ memset(&drmInfo, 0, sizeof(drmRadeonInit));
+
+ if (atic->is_r200)
+ drmInfo.func = DRM_RADEON_INIT_R200_CP;
+ else
+ drmInfo.func = DRM_RADEON_INIT_CP;
+
+ drmInfo.sarea_priv_offset = sizeof(XF86DRISAREARec);
+ drmInfo.is_pci = !atis->IsAGP;
+ drmInfo.cp_mode = atis->CPMode;
+ drmInfo.gart_size = atis->gartSize*1024*1024;
+ drmInfo.ring_size = atis->ringSize*1024*1024;
+ drmInfo.usec_timeout = atis->DMAusecTimeout;
+
+ drmInfo.fb_bpp = pScreenPriv->screen->fb[0].depth;
+ drmInfo.depth_bpp = pScreenPriv->screen->fb[0].depth;
+
+ drmInfo.front_offset = atis->frontOffset;
+ drmInfo.front_pitch = atis->frontPitch;
+ drmInfo.back_offset = atis->backOffset;
+ drmInfo.back_pitch = atis->backPitch;
+ drmInfo.depth_offset = atis->depthOffset;
+ drmInfo.depth_pitch = atis->depthPitch;
+
+ drmInfo.fb_offset = atis->fbHandle;
+ drmInfo.mmio_offset = atis->registerHandle;
+ drmInfo.ring_offset = atis->ringHandle;
+ drmInfo.ring_rptr_offset = atis->ringReadPtrHandle;
+ drmInfo.buffers_offset = atis->bufHandle;
+ drmInfo.gart_textures_offset = atis->gartTexHandle;
+
+ if (drmCommandWrite(atic->drmFd, DRM_RADEON_CP_INIT,
+ &drmInfo, sizeof(drmRadeonInit)) < 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Add a map for the vertex buffers that will be accessed by any
+ DRI-based clients. */
+static Bool
+ATIDRIBufInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ int type, size;
+
+ if (atic->is_radeon)
+ size = RADEON_BUFFER_SIZE;
+ else
+ size = R128_BUFFER_SIZE;
+
+ if (atis->IsAGP)
+ type = DRM_AGP_BUFFER;
+ else
+ type = DRM_SG_BUFFER;
+
+ /* Initialize vertex buffers */
+ atis->bufNumBufs = drmAddBufs(atic->drmFd, atis->bufMapSize / size,
+ size, type, atis->bufStart);
+
+ if (atis->bufNumBufs <= 0) {
+ ErrorF("[drm] Could not create vertex/indirect buffers list\n");
+ return FALSE;
+ }
+ ErrorF("[drm] Added %d %d byte vertex/indirect buffers\n",
+ atis->bufNumBufs, size);
+
+ atis->buffers = drmMapBufs(atic->drmFd);
+ if (atis->buffers == NULL) {
+ ErrorF("[drm] Failed to map vertex/indirect buffers list\n");
+ return FALSE;
+ }
+ ErrorF("[drm] Mapped %d vertex/indirect buffers\n",
+ atis->buffers->count);
+
+ return TRUE;
+}
+
+static int
+ATIDRIIrqInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+
+ if (atis->irqEnabled)
+ return FALSE;
+
+ atis->irqEnabled = drmCtlInstHandler(atic->drmFd, 0);
+
+ if (!atis->irqEnabled)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void ATIDRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
+ DRIContextType oldContextType, void *oldContext,
+ DRIContextType newContextType, void *newContext)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ if ((syncType==DRI_3D_SYNC) && (oldContextType==DRI_2D_CONTEXT) &&
+ (newContextType==DRI_2D_CONTEXT)) {
+ /* Entering from Wakeup */
+ /* XXX: XFree86 sets NeedToSync */
+
+ }
+ if ((syncType==DRI_2D_SYNC) && (oldContextType==DRI_NO_CONTEXT) &&
+ (newContextType==DRI_2D_CONTEXT)) {
+ /* Exiting from Block Handler */
+ if (atis->using_dma)
+ ATIDMAFlushIndirect(1);
+ }
+}
+
+/* Initialize the screen-specific data structures for the DRI and the
+ Rage 128. This is the main entry point to the device-specific
+ initialization code. It calls device-independent DRI functions to
+ create the DRI data structures and initialize the DRI state. */
+Bool
+ATIDRIScreenInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ void *scratch_ptr;
+ int scratch_int;
+ DRIInfoPtr pDRIInfo;
+ int devSareaSize;
+ drmSetVersion sv;
+
+ /* XXX: Disable DRI clients for unsupported depths */
+
+ if (atic->is_radeon) {
+ atis->CPMode = RADEON_CSQ_PRIBM_INDBM;
+ }
+ else {
+ atis->CCEMode = R128_PM4_64BM_64VCBM_64INDBM;
+ atis->CCEFifoSize = 64;
+ }
+
+ atis->IsAGP = FALSE; /* XXX */
+ atis->agpMode = 1;
+ atis->gartSize = 8;
+ atis->ringSize = 1;
+ atis->bufSize = 2;
+ atis->gartTexSize = 1;
+ atis->DMAusecTimeout = 10000;
+
+ atis->frontOffset = 0;
+ atis->frontPitch = pScreenPriv->screen->fb[0].byteStride;
+ atis->backOffset = 0; /* XXX */
+ atis->backPitch = pScreenPriv->screen->fb[0].byteStride;
+ atis->depthOffset = 0; /* XXX */
+ atis->depthPitch = 0; /* XXX */
+ atis->spanOffset = 0; /* XXX */
+
+ if (atic->drmFd < 0)
+ return FALSE;
+
+ sv.drm_di_major = -1;
+ sv.drm_dd_major = -1;
+ drmSetInterfaceVersion(atic->drmFd, &sv);
+ if (atic->is_radeon) {
+ if (sv.drm_dd_major != 1 || sv.drm_dd_minor < 6) {
+ ErrorF("[dri] radeon kernel module version is %d.%d "
+ "but version 1.6 or greater is needed.\n",
+ sv.drm_dd_major, sv.drm_dd_minor);
+ return FALSE;
+ }
+ } else {
+ if (sv.drm_dd_major != 2 || sv.drm_dd_minor < 2) {
+ ErrorF("[dri] r128 kernel module version is %d.%d "
+ "but version 2.2 or greater is needed.\n",
+ sv.drm_dd_major, sv.drm_dd_minor);
+ return FALSE;
+ }
+ }
+
+ /* Create the DRI data structure, and fill it in before calling the
+ * DRIScreenInit().
+ */
+ pDRIInfo = DRICreateInfoRec();
+ if (!pDRIInfo)
+ return FALSE;
+
+ atis->pDRIInfo = pDRIInfo;
+ pDRIInfo->busIdString = atic->busid;
+ if (atic->is_radeon) {
+ pDRIInfo->drmDriverName = "radeon";
+ if (atic->is_r200)
+ pDRIInfo->clientDriverName = "radeon";
+ else
+ pDRIInfo->clientDriverName = "r200";
+ } else {
+ pDRIInfo->drmDriverName = "r128";
+ pDRIInfo->clientDriverName = "r128";
+ }
+ pDRIInfo->ddxDriverMajorVersion = 4;
+ pDRIInfo->ddxDriverMinorVersion = 0;
+ pDRIInfo->ddxDriverPatchVersion = 0;
+ pDRIInfo->frameBufferPhysicalAddress =
+ (unsigned long)pScreenPriv->screen->memory_base;
+ pDRIInfo->frameBufferSize = pScreenPriv->screen->memory_size;
+ pDRIInfo->frameBufferStride = pScreenPriv->screen->fb[0].byteStride;
+ pDRIInfo->ddxDrawableTableEntry = SAREA_MAX_DRAWABLES;
+ pDRIInfo->maxDrawableTableEntry = SAREA_MAX_DRAWABLES;
+
+ /* For now the mapping works by using a fixed size defined
+ * in the SAREA header
+ */
+ pDRIInfo->SAREASize = SAREA_MAX;
+
+ if (atic->is_radeon) {
+ pDRIInfo->devPrivateSize = sizeof(R128DRIRec);
+ devSareaSize = sizeof(R128SAREAPriv);
+ } else {
+ pDRIInfo->devPrivateSize = sizeof(RADEONDRIRec);
+ devSareaSize = sizeof(RADEONSAREAPriv);
+ }
+
+ if (sizeof(XF86DRISAREARec) + devSareaSize > SAREA_MAX) {
+ ErrorF("[dri] Data does not fit in SAREA. Disabling DRI.\n");
+ return FALSE;
+ }
+
+ pDRIInfo->devPrivate = xcalloc(pDRIInfo->devPrivateSize, 1);
+ if (pDRIInfo->devPrivate == NULL) {
+ DRIDestroyInfoRec(atis->pDRIInfo);
+ atis->pDRIInfo = NULL;
+ return FALSE;
+ }
+
+ pDRIInfo->contextSize = sizeof(ATIDRIContextRec);
+
+ pDRIInfo->SwapContext = ATIDRISwapContext;
+ /*pDRIInfo->InitBuffers = R128DRIInitBuffers;*/ /* XXX Appears unnecessary */
+ /*pDRIInfo->MoveBuffers = R128DRIMoveBuffers;*/ /* XXX Badness */
+ pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
+ /*pDRIInfo->TransitionTo2d = R128DRITransitionTo2d;
+ pDRIInfo->TransitionTo3d = R128DRITransitionTo3d;
+ pDRIInfo->TransitionSingleToMulti3D = R128DRITransitionSingleToMulti3d;
+ pDRIInfo->TransitionMultiToSingle3D = R128DRITransitionMultiToSingle3d;*/
+
+ pDRIInfo->createDummyCtx = TRUE;
+ pDRIInfo->createDummyCtxPriv = FALSE;
+
+ if (!DRIScreenInit(pScreen, pDRIInfo, &atic->drmFd)) {
+ ErrorF("[dri] DRIScreenInit failed. Disabling DRI.\n");
+ xfree(pDRIInfo->devPrivate);
+ pDRIInfo->devPrivate = NULL;
+ DRIDestroyInfoRec(pDRIInfo);
+ pDRIInfo = NULL;
+ return FALSE;
+ }
+
+ /* Add a map for the MMIO registers that will be accessed by any
+ * DRI-based clients.
+ */
+ atis->registerSize = RADEON_REG_SIZE(atic);
+ if (drmAddMap(atic->drmFd, RADEON_REG_BASE(pScreenPriv->screen->card),
+ atis->registerSize, DRM_REGISTERS, DRM_READ_ONLY,
+ &atis->registerHandle) < 0) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+ ErrorF("[drm] register handle = 0x%08lx\n", atis->registerHandle);
+
+ /* DRIScreenInit adds the frame buffer map, but we need it as well */
+ DRIGetDeviceInfo(pScreen, &atis->fbHandle, &scratch_int, &scratch_int,
+ &scratch_int, &scratch_int, &scratch_ptr);
+
+ /* Initialize AGP */
+ if (atis->IsAGP && !ATIDRIAgpInit(pScreen)) {
+ atis->IsAGP = FALSE;
+ ErrorF("[agp] AGP failed to initialize; falling back to PCI mode.\n");
+ ErrorF("[agp] Make sure your kernel's AGP support is loaded and functioning.");
+ }
+
+ /* Initialize PCIGART */
+ if (!atis->IsAGP && !ATIDRIPciInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+#ifdef GLXEXT
+ if (!R128InitVisualConfigs(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+ ErrorF("[dri] Visual configs initialized\n");
+#endif
+
+ atis->serverContext = DRIGetContext(pScreen);
+
+ return ATIDRIFinishScreenInit(pScreen);
+}
+
+/* Finish initializing the device-dependent DRI state, and call
+ DRIFinishScreenInit() to complete the device-independent DRI
+ initialization. */
+static Bool
+R128DRIFinishScreenInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ R128SAREAPrivPtr pSAREAPriv;
+ R128DRIPtr pR128DRI;
+
+ /* Initialize the kernel data structures */
+ if (!R128DRIKernelInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Initialize the vertex buffers list */
+ if (!ATIDRIBufInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Initialize IRQ */
+ ATIDRIIrqInit(pScreen);
+
+ /* Initialize and start the CCE if required */
+ ATIDMAStart(pScreen);
+
+ pSAREAPriv = (R128SAREAPrivPtr)DRIGetSAREAPrivate(pScreen);
+ memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
+
+ pR128DRI = (R128DRIPtr)atis->pDRIInfo->devPrivate;
+
+ pR128DRI->deviceID = pScreenPriv->screen->card->attr.deviceID;
+ pR128DRI->width = pScreenPriv->screen->width;
+ pR128DRI->height = pScreenPriv->screen->height;
+ pR128DRI->depth = pScreenPriv->screen->fb[0].depth;
+ pR128DRI->bpp = pScreenPriv->screen->fb[0].bitsPerPixel;
+
+ pR128DRI->IsPCI = !atis->IsAGP;
+ pR128DRI->AGPMode = atis->agpMode;
+
+ pR128DRI->frontOffset = atis->frontOffset;
+ pR128DRI->frontPitch = atis->frontPitch;
+ pR128DRI->backOffset = atis->backOffset;
+ pR128DRI->backPitch = atis->backPitch;
+ pR128DRI->depthOffset = atis->depthOffset;
+ pR128DRI->depthPitch = atis->depthPitch;
+ pR128DRI->spanOffset = atis->spanOffset;
+ pR128DRI->textureOffset = atis->textureOffset;
+ pR128DRI->textureSize = atis->textureSize;
+ pR128DRI->log2TexGran = atis->log2TexGran;
+
+ pR128DRI->registerHandle = atis->registerHandle;
+ pR128DRI->registerSize = atis->registerSize;
+
+ pR128DRI->gartTexHandle = atis->gartTexHandle;
+ pR128DRI->gartTexMapSize = atis->gartTexMapSize;
+ pR128DRI->log2AGPTexGran = atis->log2GARTTexGran;
+ pR128DRI->gartTexOffset = atis->gartTexStart;
+ pR128DRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
+
+ return TRUE;
+}
+
+/* Finish initializing the device-dependent DRI state, and call
+ * DRIFinishScreenInit() to complete the device-independent DRI
+ * initialization.
+ */
+static Bool
+RadeonDRIFinishScreenInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo(pScreenPriv);
+ RADEONSAREAPrivPtr pSAREAPriv;
+ RADEONDRIPtr pRADEONDRI;
+ drmRadeonMemInitHeap drmHeap;
+
+ /* Initialize the kernel data structures */
+ if (!RadeonDRIKernelInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Initialize the vertex buffers list */
+ if (!ATIDRIBufInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Initialize IRQ */
+ ATIDRIIrqInit(pScreen);
+
+ drmHeap.region = RADEON_MEM_REGION_GART;
+ drmHeap.start = 0;
+ drmHeap.size = atis->gartTexMapSize;
+
+ if (drmCommandWrite(atic->drmFd, DRM_RADEON_INIT_HEAP, &drmHeap,
+ sizeof(drmHeap))) {
+ ErrorF("[drm] Failed to initialize GART heap manager\n");
+ }
+
+ ATIDMAStart(pScreen);
+
+ /* Initialize the SAREA private data structure */
+ pSAREAPriv = (RADEONSAREAPrivPtr)DRIGetSAREAPrivate(pScreen);
+ memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
+
+ pRADEONDRI = (RADEONDRIPtr)atis->pDRIInfo->devPrivate;
+
+ pRADEONDRI->deviceID = pScreenPriv->screen->card->attr.deviceID;
+ pRADEONDRI->width = pScreenPriv->screen->width;
+ pRADEONDRI->height = pScreenPriv->screen->height;
+ pRADEONDRI->depth = pScreenPriv->screen->fb[0].depth;
+ pRADEONDRI->bpp = pScreenPriv->screen->fb[0].bitsPerPixel;
+
+ pRADEONDRI->IsPCI = !atis->IsAGP;
+ pRADEONDRI->AGPMode = atis->agpMode;
+
+ pRADEONDRI->frontOffset = atis->frontOffset;
+ pRADEONDRI->frontPitch = atis->frontPitch;
+ pRADEONDRI->backOffset = atis->backOffset;
+ pRADEONDRI->backPitch = atis->backPitch;
+ pRADEONDRI->depthOffset = atis->depthOffset;
+ pRADEONDRI->depthPitch = atis->depthPitch;
+ pRADEONDRI->textureOffset = atis->textureOffset;
+ pRADEONDRI->textureSize = atis->textureSize;
+ pRADEONDRI->log2TexGran = atis->log2TexGran;
+
+ pRADEONDRI->registerHandle = atis->registerHandle;
+ pRADEONDRI->registerSize = atis->registerSize;
+
+ pRADEONDRI->statusHandle = atis->ringReadPtrHandle;
+ pRADEONDRI->statusSize = atis->ringReadMapSize;
+
+ pRADEONDRI->gartTexHandle = atis->gartTexHandle;
+ pRADEONDRI->gartTexMapSize = atis->gartTexMapSize;
+ pRADEONDRI->log2GARTTexGran = atis->log2GARTTexGran;
+ pRADEONDRI->gartTexOffset = atis->gartTexStart;
+
+ pRADEONDRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
+
+ return TRUE;
+}
+
+static Bool
+ATIDRIFinishScreenInit(ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ ATIScreenInfo(pScreenPriv);
+ ATICardInfo (pScreenPriv);
+
+ atis->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT;
+
+ /* NOTE: DRIFinishScreenInit must be called before *DRIKernelInit
+ * because *DRIKernelInit requires that the hardware lock is held by
+ * the X server, and the first time the hardware lock is grabbed is
+ * in DRIFinishScreenInit.
+ */
+ if (!DRIFinishScreenInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+
+ if (atic->is_radeon) {
+ if (!RadeonDRIFinishScreenInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+ } else {
+ if (!R128DRIFinishScreenInit(pScreen)) {
+ ATIDRICloseScreen(pScreen);
+ return FALSE;
+ }
+ }
+
+ XFree86DRIExtensionInit();
+
+ atis->using_dri = TRUE;
+
+ return TRUE;
+}
+
+/* The screen is being closed, so clean up any state and free any
+ resources used by the DRI. */
+void
+ATIDRICloseScreen(ScreenPtr pScreen)
+{
+ KdScreenPriv (pScreen);
+ ATIScreenInfo (pScreenPriv);
+ ATICardInfo (pScreenPriv);
+ drmR128Init drmR128Info;
+ drmRadeonInit drmRadeonInfo;
+
+ if (atis->indirectBuffer != NULL) {
+ ATIDMADispatchIndirect(1);
+ atis->indirectBuffer = NULL;
+ atis->indirectStart = 0;
+ }
+ ATIDMAStop(pScreen);
+
+ if (atis->irqEnabled) {
+ drmCtlUninstHandler(atic->drmFd);
+ atis->irqEnabled = FALSE;
+ }
+
+ /* De-allocate vertex buffers */
+ if (atis->buffers) {
+ drmUnmapBufs(atis->buffers);
+ atis->buffers = NULL;
+ }
+
+ /* De-allocate all kernel resources */
+ if (atic->is_radeon) {
+ memset(&drmR128Info, 0, sizeof(drmR128Init));
+ drmR128Info.func = DRM_R128_CLEANUP_CCE;
+ drmCommandWrite(atic->drmFd, DRM_R128_INIT, &drmR128Info,
+ sizeof(drmR128Init));
+ } else {
+ memset(&drmRadeonInfo, 0, sizeof(drmRadeonInfo));
+ drmRadeonInfo.func = DRM_RADEON_CLEANUP_CP;
+ drmCommandWrite(atic->drmFd, DRM_RADEON_CP_INIT, &drmRadeonInfo,
+ sizeof(drmR128Init));
+ }
+
+ /* De-allocate all AGP resources */
+ if (atis->gartTex) {
+ drmUnmap(atis->gartTex, atis->gartTexMapSize);
+ atis->gartTex = NULL;
+ }
+ if (atis->buf) {
+ drmUnmap(atis->buf, atis->bufMapSize);
+ atis->buf = NULL;
+ }
+ if (atis->ringReadPtr) {
+ drmUnmap(atis->ringReadPtr, atis->ringReadMapSize);
+ atis->ringReadPtr = NULL;
+ }
+ if (atis->ring) {
+ drmUnmap(atis->ring, atis->ringMapSize);
+ atis->ring = NULL;
+ }
+ if (atis->agpMemHandle != DRM_AGP_NO_HANDLE) {
+ drmAgpUnbind(atic->drmFd, atis->agpMemHandle);
+ drmAgpFree(atic->drmFd, atis->agpMemHandle);
+ atis->agpMemHandle = DRM_AGP_NO_HANDLE;
+ drmAgpRelease(atic->drmFd);
+ }
+ if (atis->pciMemHandle) {
+ drmScatterGatherFree(atic->drmFd, atis->pciMemHandle);
+ atis->pciMemHandle = 0;
+ }
+
+ /* De-allocate all DRI resources */
+ DRICloseScreen(pScreen);
+
+ /* De-allocate all DRI data structures */
+ if (atis->pDRIInfo) {
+ if (atis->pDRIInfo->devPrivate) {
+ xfree(atis->pDRIInfo->devPrivate);
+ atis->pDRIInfo->devPrivate = NULL;
+ }
+ DRIDestroyInfoRec(atis->pDRIInfo);
+ atis->pDRIInfo = NULL;
+ }
+ atis->using_dri = FALSE;
+#ifdef GLXEXT
+ if (atis->pVisualConfigs) {
+ xfree(atis->pVisualConfigs);
+ atis->pVisualConfigs = NULL;
+ }
+ if (atis->pVisualConfigsPriv) {
+ xfree(atis->pVisualConfigsPriv);
+ atis->pVisualConfigsPriv = NULL;
+ }
+#endif /* GLXEXT */
+ atic->drmFd = -1;
+}
diff --git a/hw/kdrive/ati/ati_dri.h b/hw/kdrive/ati/ati_dri.h
new file mode 100644
index 000000000..2e2b9501b
--- /dev/null
+++ b/hw/kdrive/ati/ati_dri.h
@@ -0,0 +1,100 @@
+/*
+ * $Id$
+ *
+ * Copyright © 2003 Eric Anholt
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Eric Anholt not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Eric Anholt makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $Header$ */
+
+#ifndef _ATI_DRI_H_
+#define _ATI_DRI_H_
+
+typedef struct {
+ /* DRI screen private data */
+ int deviceID; /* PCI device ID */
+ int width; /* Width in pixels of display */
+ int height; /* Height in scanlines of display */
+ int depth; /* Depth of display (8, 15, 16, 24) */
+ int bpp; /* Bit depth of display (8, 16, 24, 32) */
+
+ int IsPCI; /* Current card is a PCI card */
+ int AGPMode;
+
+ int frontOffset; /* Start of front buffer */
+ int frontPitch;
+ int backOffset; /* Start of shared back buffer */
+ int backPitch;
+ int depthOffset; /* Start of shared depth buffer */
+ int depthPitch;
+ int spanOffset; /* Start of scratch spanline */
+ int textureOffset; /* Start of texture data in frame buffer */
+ int textureSize;
+ int log2TexGran;
+
+ /* MMIO register data */
+ drmHandle registerHandle;
+ drmSize registerSize;
+
+ /* CCE AGP Texture data */
+ drmHandle gartTexHandle;
+ drmSize gartTexMapSize;
+ int log2AGPTexGran;
+ int gartTexOffset;
+ unsigned int sarea_priv_offset;
+} R128DRIRec, *R128DRIPtr;
+
+typedef struct {
+ /* DRI screen private data */
+ int deviceID; /* PCI device ID */
+ int width; /* Width in pixels of display */
+ int height; /* Height in scanlines of display */
+ int depth; /* Depth of display (8, 15, 16, 24) */
+ int bpp; /* Bit depth of display (8, 16, 24, 32) */
+
+ int IsPCI; /* Current card is a PCI card */
+ int AGPMode;
+
+ int frontOffset; /* Start of front buffer */
+ int frontPitch;
+ int backOffset; /* Start of shared back buffer */
+ int backPitch;
+ int depthOffset; /* Start of shared depth buffer */
+ int depthPitch;
+ int textureOffset; /* Start of texture data in frame buffer */
+ int textureSize;
+ int log2TexGran;
+
+ /* MMIO register data */
+ drmHandle registerHandle;
+ drmSize registerSize;
+
+ /* CP in-memory status information */
+ drmHandle statusHandle;
+ drmSize statusSize;
+
+ /* CP GART Texture data */
+ drmHandle gartTexHandle;
+ drmSize gartTexMapSize;
+ int log2GARTTexGran;
+ int gartTexOffset;
+ unsigned int sarea_priv_offset;
+} RADEONDRIRec, *RADEONDRIPtr;
+
+#endif /* _ATI_DRI_H_ */
diff --git a/hw/kdrive/ati/ati_dripriv.h b/hw/kdrive/ati/ati_dripriv.h
new file mode 100644
index 000000000..1343f07f5
--- /dev/null
+++ b/hw/kdrive/ati/ati_dripriv.h
@@ -0,0 +1,58 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dripriv.h,v 1.3 2000/11/18 19:37:11 tsi Exp $ */
+/*
+ * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
+ * Precision Insight, Inc., Cedar Park, Texas, and
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, PRECISION INSIGHT, VA LINUX
+ * SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. Faith <faith@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ *
+ */
+
+#ifndef _ATI_DRIPRIV_H_
+#define _ATI_DRIPRIV_H_
+
+#ifdef GLXEXT
+#include "GL/glxint.h"
+
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **configprivs);
+#endif
+
+typedef struct {
+ /* Nothing here yet */
+ int dummy;
+} ATIConfigPrivRec, *ATIConfigPrivPtr;
+
+typedef struct {
+ /* Nothing here yet */
+ int dummy;
+} ATIDRIContextRec, *ATIDRIContextPtr;
+
+#endif
diff --git a/hw/kdrive/ati/ati_reg.h b/hw/kdrive/ati/ati_reg.h
index ac5221fe4..776c5ed33 100644
--- a/hw/kdrive/ati/ati_reg.h
+++ b/hw/kdrive/ati/ati_reg.h
@@ -24,9 +24,24 @@
/* $Header$ */
/* The Radeon register definitions are almost all the same for r128 */
+#define RADEON_REG_BUS_CNTL 0x0030
+# define RADEON_BUS_MASTER_DIS (1 << 6)
+#define RADEON_GEN_INT_CNTL 0x0040
+#define RADEON_REG_AGP_BASE 0x0170
+#define RADEON_REG_AGP_CNTL 0x0174
+# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0)
+# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0)
+# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0)
+# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0)
+# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0)
+# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0)
+# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0)
+# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0)
#define RADEON_REG_RBBM_STATUS 0x0e40
# define RADEON_RBBM_FIFOCNT_MASK 0x007f
# define RADEON_RBBM_ACTIVE (1 << 31)
+#define RADEON_REG_CP_CSQ_CNTL 0x0740
+# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
#define RADEON_REG_SRC_PITCH_OFFSET 0x1428
#define RADEON_REG_DST_PITCH_OFFSET 0x142c
#define RADEON_REG_SRC_Y_X 0x1434
@@ -61,7 +76,28 @@
# define RADEON_RB2D_DC_FLUSH_ALL 0xf
# define RADEON_RB2D_DC_BUSY (1 << 31)
+#define RADEON_CP_PACKET0 0x00000000
+#define RADEON_CP_PACKET1 0x40000000
+#define RADEON_CP_PACKET2 0x80000000
+
#define R128_REG_PC_NGUI_CTLSTAT 0x0184
# define R128_PC_BUSY (1 << 31)
#define R128_REG_GUI_STAT 0x1740
# define R128_GUI_ACTIVE (1 << 31)
+#define R128_REG_PCI_GART_PAGE 0x017c
+#define R128_REG_PC_NGUI_CTLSTAT 0x0184
+#define R128_REG_BM_CHUNK_0_VAL 0x0a18
+# define R128_BM_PTR_FORCE_TO_PCI (1 << 21)
+# define R128_BM_PM4_RD_FORCE_TO_PCI (1 << 22)
+# define R128_BM_GLOBAL_FORCE_TO_PCI (1 << 23)
+
+# define R128_PM4_NONPM4 (0 << 28)
+# define R128_PM4_192PIO (1 << 28)
+# define R128_PM4_192BM (2 << 28)
+# define R128_PM4_128PIO_64INDBM (3 << 28)
+# define R128_PM4_128BM_64INDBM (4 << 28)
+# define R128_PM4_64PIO_128INDBM (5 << 28)
+# define R128_PM4_64BM_128INDBM (6 << 28)
+# define R128_PM4_64PIO_64VCBM_64INDBM (7 << 28)
+# define R128_PM4_64BM_64VCBM_64INDBM (8 << 28)
+# define R128_PM4_64PIO_64VCPIO_64INDPIO (15 << 28)
diff --git a/miext/shadow/shrot16pack.c b/hw/kdrive/ati/ati_sarea.h
index a1ff273de..67da24aca 100644
--- a/miext/shadow/shrot16pack.c
+++ b/hw/kdrive/ati/ati_sarea.h
@@ -1,28 +1,42 @@
+
/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot16pack.c,v 1.1 2000/09/08 21:46:45 keithp Exp $
+ * $Id$
*
- * Copyright © 2000 Keith Packard
+ * Copyright © 2003 Eric Anholt
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
+ * documentation, and that the name of Eric Anholt not be used in
* advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
+ * specific, written prior permission. Eric Anholt makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/* $Header$ */
+
+#ifndef _ATI_SAREA_H_
+#define _ATI_SAREA_H_
+
+/* There are 2 heaps (local/AGP). Each region within a heap is a
+ * minimum of 64k, and there are at most 64 of them per heap.
+ */
+#define ATI_CARD_HEAP 0
+#define ATI_GART_HEAP 1
+#define ATI_NR_TEX_HEAPS 2
+#define ATI_NR_TEX_REGIONS 64
+#define ATI_LOG_TEX_GRANULARITY 16
-#define FUNC shadowUpdateRotate16
-#define Data CARD16
+#include "r128_sarea.h"
+#include "radeon_sarea.h"
-#include "shrotpack.h"
+#endif /* _ATI_SAREA_H_ */
diff --git a/hw/kdrive/ati/ati_stub.c b/hw/kdrive/ati/ati_stub.c
index 2cb9e0092..0162362bf 100644
--- a/hw/kdrive/ati/ati_stub.c
+++ b/hw/kdrive/ati/ati_stub.c
@@ -29,30 +29,17 @@
#include "ati.h"
#include "klinux.h"
-extern struct pci_id_list radeon_id_list[];
-extern struct pci_id_list r128_id_list[];
+extern struct pci_id_entry ati_pci_ids[];
void
InitCard(char *name)
{
+ struct pci_id_entry *id;
KdCardAttr attr;
- int i, j;
- for (i = 0; radeon_id_list[i].name != NULL; i++) {
- CARD16 vendor = radeon_id_list[i].vendor;
- CARD16 device = radeon_id_list[i].device;
-
- j = 0;
- while (LinuxFindPci(vendor, device, j++, &attr))
- KdCardInfoAdd(&ATIFuncs, &attr, 0);
- }
-
- for (i = 0; r128_id_list[i].name != NULL; i++) {
- CARD16 vendor = r128_id_list[i].vendor;
- CARD16 device = r128_id_list[i].device;
-
- j = 0;
- while (LinuxFindPci(vendor, device, j++, &attr))
+ for (id = ati_pci_ids; id->name != NULL; id++) {
+ int j = 0;
+ while (LinuxFindPci(id->vendor, id->device, j++, &attr))
KdCardInfoAdd(&ATIFuncs, &attr, 0);
}
}
diff --git a/hw/kdrive/ati/r128_common.h b/hw/kdrive/ati/r128_common.h
new file mode 100644
index 000000000..506f97c68
--- /dev/null
+++ b/hw/kdrive/ati/r128_common.h
@@ -0,0 +1,171 @@
+/* r128_common.h -- common header definitions for R128 2D/3D/DRM suite
+ * Created: Sun Apr 9 18:16:28 2000 by kevin@precisioninsight.com
+ *
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author:
+ * Gareth Hughes <gareth@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ *
+ * Converted to common header format:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_common.h,v 1.2 2002/12/16 16:19:10 dawes Exp $
+ *
+ */
+
+#ifndef _R128_COMMON_H_
+#define _R128_COMMON_H_
+
+#include "X11/Xmd.h"
+
+/*
+ * WARNING: If you change any of these defines, make sure to change
+ * the kernel include file as well (r128_drm.h)
+ */
+
+/* Driver specific DRM command indices
+ * NOTE: these are not OS specific, but they are driver specific
+ */
+#define DRM_R128_INIT 0x00
+#define DRM_R128_CCE_START 0x01
+#define DRM_R128_CCE_STOP 0x02
+#define DRM_R128_CCE_RESET 0x03
+#define DRM_R128_CCE_IDLE 0x04
+#define DRM_R128_UNDEFINED1 0x05
+#define DRM_R128_RESET 0x06
+#define DRM_R128_SWAP 0x07
+#define DRM_R128_CLEAR 0x08
+#define DRM_R128_VERTEX 0x09
+#define DRM_R128_INDICES 0x0a
+#define DRM_R128_BLIT 0x0b
+#define DRM_R128_DEPTH 0x0c
+#define DRM_R128_STIPPLE 0x0d
+#define DRM_R128_UNDEFINED2 0x0e
+#define DRM_R128_INDIRECT 0x0f
+#define DRM_R128_FULLSCREEN 0x10
+#define DRM_R128_CLEAR2 0x11
+#define DRM_R128_GETPARAM 0x12
+#define DRM_R128_FLIP 0x13
+
+#define DRM_R128_FRONT_BUFFER 0x1
+#define DRM_R128_BACK_BUFFER 0x2
+#define DRM_R128_DEPTH_BUFFER 0x4
+
+typedef struct {
+ enum {
+ DRM_R128_INIT_CCE = 0x01,
+ DRM_R128_CLEANUP_CCE = 0x02
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
+ int cce_mode;
+ int cce_secure; /* FIXME: Deprecated, we should remove this */
+ int ring_size;
+ int usec_timeout;
+
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+ unsigned int span_offset;
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long ring_offset;
+ unsigned long ring_rptr_offset;
+ unsigned long buffers_offset;
+ unsigned long agp_textures_offset;
+} drmR128Init;
+
+typedef struct {
+ int flush;
+ int idle;
+} drmR128CCEStop;
+
+typedef struct {
+ int idx;
+ int start;
+ int end;
+ int discard;
+} drmR128Indirect;
+
+typedef struct {
+ int idx;
+ int pitch;
+ int offset;
+ int format;
+ unsigned short x, y;
+ unsigned short width, height;
+} drmR128Blit;
+
+typedef struct {
+ enum {
+ DRM_R128_WRITE_SPAN = 0x01,
+ DRM_R128_WRITE_PIXELS = 0x02,
+ DRM_R128_READ_SPAN = 0x03,
+ DRM_R128_READ_PIXELS = 0x04
+ } func;
+ int n;
+ int *x;
+ int *y;
+ unsigned int *buffer;
+ unsigned char *mask;
+} drmR128Depth;
+
+typedef struct {
+ int prim;
+ int idx; /* Index of vertex buffer */
+ int count; /* Number of vertices in buffer */
+ int discard; /* Client finished with buffer? */
+} drmR128Vertex;
+
+typedef struct {
+ unsigned int *mask;
+} drmR128Stipple;
+
+typedef struct {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask;
+} drmR128Clear;
+
+typedef struct {
+ enum {
+ DRM_R128_INIT_FULLSCREEN = 0x01,
+ DRM_R128_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drmR128Fullscreen;
+
+typedef struct drm_r128_getparam {
+ int param;
+ int *value;
+} drmR128GetParam;
+
+#define R128_PARAM_IRQ_NR 1
+
+#endif
diff --git a/hw/kdrive/ati/r128_sarea.h b/hw/kdrive/ati/r128_sarea.h
new file mode 100644
index 000000000..b73797ae6
--- /dev/null
+++ b/hw/kdrive/ati/r128_sarea.h
@@ -0,0 +1,186 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.7 2002/02/16 21:26:35 herrb Exp $ */
+/*
+ * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
+ * Precision Insight, Inc., Cedar Park, Texas, and
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, PRECISION INSIGHT, VA LINUX
+ * SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Gareth Hughes <gareth@valinux.com>
+ *
+ */
+
+#ifndef _R128_SAREA_H_
+#define _R128_SAREA_H_
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the kernel file (r128_drm.h)
+ */
+#ifndef __R128_SAREA_DEFINES__
+#define __R128_SAREA_DEFINES__
+
+/* What needs to be changed for the current vertex buffer?
+ */
+#define R128_UPLOAD_CONTEXT 0x001
+#define R128_UPLOAD_SETUP 0x002
+#define R128_UPLOAD_TEX0 0x004
+#define R128_UPLOAD_TEX1 0x008
+#define R128_UPLOAD_TEX0IMAGES 0x010
+#define R128_UPLOAD_TEX1IMAGES 0x020
+#define R128_UPLOAD_CORE 0x040
+#define R128_UPLOAD_MASKS 0x080
+#define R128_UPLOAD_WINDOW 0x100
+#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
+#define R128_REQUIRE_QUIESCENCE 0x400
+#define R128_UPLOAD_ALL 0x7ff
+
+#define R128_FRONT 0x1
+#define R128_BACK 0x2
+#define R128_DEPTH 0x4
+
+/* Primitive types
+ */
+#define R128_POINTS 0x1
+#define R128_LINES 0x2
+#define R128_LINE_STRIP 0x3
+#define R128_TRIANGLES 0x4
+#define R128_TRIANGLE_FAN 0x5
+#define R128_TRIANGLE_STRIP 0x6
+
+/* Vertex/indirect buffer size
+ */
+#define R128_BUFFER_SIZE 16384
+
+/* Byte offsets for indirect buffer data
+ */
+#define R128_INDEX_PRIM_OFFSET 20
+#define R128_HOSTDATA_BLIT_OFFSET 32
+
+/* Keep these small for testing
+ */
+#define R128_NR_SAREA_CLIPRECTS 12
+
+#define R128_NR_CONTEXT_REGS 12
+
+#define R128_MAX_TEXTURE_LEVELS 11
+#define R128_MAX_TEXTURE_UNITS 2
+
+#endif /* __R128_SAREA_DEFINES__ */
+
+typedef struct {
+ /* Context state - can be written in one large chunk */
+ unsigned int dst_pitch_offset_c;
+ unsigned int dp_gui_master_cntl_c;
+ unsigned int sc_top_left_c;
+ unsigned int sc_bottom_right_c;
+ unsigned int z_offset_c;
+ unsigned int z_pitch_c;
+ unsigned int z_sten_cntl_c;
+ unsigned int tex_cntl_c;
+ unsigned int misc_3d_state_cntl_reg;
+ unsigned int texture_clr_cmp_clr_c;
+ unsigned int texture_clr_cmp_msk_c;
+ unsigned int fog_color_c;
+
+ /* Texture state */
+ unsigned int tex_size_pitch_c;
+ unsigned int constant_color_c;
+
+ /* Setup state */
+ unsigned int pm4_vc_fpu_setup;
+ unsigned int setup_cntl;
+
+ /* Mask state */
+ unsigned int dp_write_mask;
+ unsigned int sten_ref_mask_c;
+ unsigned int plane_3d_mask_c;
+
+ /* Window state */
+ unsigned int window_xy_offset;
+
+ /* Core state */
+ unsigned int scale_3d_cntl;
+} r128_context_regs_t;
+
+/* Setup registers for each texture unit
+ */
+typedef struct {
+ unsigned int tex_cntl;
+ unsigned int tex_combine_cntl;
+ unsigned int tex_size_pitch;
+ unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
+ unsigned int tex_border_color;
+} r128_texture_regs_t;
+
+typedef struct {
+ /* The channel for communication of state information to the kernel
+ * on firing a vertex buffer.
+ */
+ r128_context_regs_t ContextState;
+ r128_texture_regs_t TexState[R128_MAX_TEXTURE_UNITS];
+ unsigned int dirty;
+ unsigned int vertsize;
+ unsigned int vc_format;
+
+#ifdef XF86DRI
+ /* The current cliprects, or a subset thereof.
+ */
+ XF86DRIClipRectRec boxes[R128_NR_SAREA_CLIPRECTS];
+ unsigned int nbox;
+#endif
+
+ /* Counters for throttling of rendering clients.
+ */
+ unsigned int last_frame;
+ unsigned int last_dispatch;
+
+ /* Maintain an LRU of contiguous regions of texture space. If you
+ * think you own a region of texture memory, and it has an age
+ * different to the one you set, then you are mistaken and it has
+ * been stolen by another client. If global texAge hasn't changed,
+ * there is no need to walk the list.
+ *
+ * These regions can be used as a proxy for the fine-grained texture
+ * information of other clients - by maintaining them in the same
+ * lru which is used to age their own textures, clients have an
+ * approximate lru for the whole of global texture space, and can
+ * make informed decisions as to which areas to kick out. There is
+ * no need to choose whether to kick out your own texture or someone
+ * else's - simply eject them all in LRU order.
+ */
+ /* Last elt is sentinal */
+ drmTextureRegion texList[ATI_NR_TEX_HEAPS][ATI_NR_TEX_REGIONS+1];
+ /* last time texture was uploaded */
+ unsigned int texAge[ATI_NR_TEX_HEAPS];
+
+ int ctxOwner; /* last context to upload state */
+ int pfAllowPageFlip; /* set by the 2d driver, read by the client */
+ int pfCurrentPage; /* set by kernel, read by others */
+} R128SAREAPriv, *R128SAREAPrivPtr;
+
+#endif
diff --git a/hw/kdrive/ati/radeon_common.h b/hw/kdrive/ati/radeon_common.h
new file mode 100644
index 000000000..2539ba68f
--- /dev/null
+++ b/hw/kdrive/ati/radeon_common.h
@@ -0,0 +1,461 @@
+/* radeon_common.h -- common header definitions for Radeon 2D/3D/DRM suite
+ *
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author:
+ * Gareth Hughes <gareth@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ * Converted to common header format:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.2 2003/04/07 01:22:09 martin Exp $
+ *
+ */
+
+#ifndef _RADEON_COMMON_H_
+#define _RADEON_COMMON_H_
+
+#include <inttypes.h>
+
+/* WARNING: If you change any of these defines, make sure to change
+ * the kernel include file as well (radeon_drm.h)
+ */
+
+/* Driver specific DRM command indices
+ * NOTE: these are not OS specific, but they are driver specific
+ */
+#define DRM_RADEON_CP_INIT 0x00
+#define DRM_RADEON_CP_START 0x01
+#define DRM_RADEON_CP_STOP 0x02
+#define DRM_RADEON_CP_RESET 0x03
+#define DRM_RADEON_CP_IDLE 0x04
+#define DRM_RADEON_RESET 0x05
+#define DRM_RADEON_FULLSCREEN 0x06
+#define DRM_RADEON_SWAP 0x07
+#define DRM_RADEON_CLEAR 0x08
+#define DRM_RADEON_VERTEX 0x09
+#define DRM_RADEON_INDICES 0x0a
+#define DRM_RADEON_STIPPLE 0x0c
+#define DRM_RADEON_INDIRECT 0x0d
+#define DRM_RADEON_TEXTURE 0x0e
+#define DRM_RADEON_VERTEX2 0x0f
+#define DRM_RADEON_CMDBUF 0x10
+#define DRM_RADEON_GETPARAM 0x11
+#define DRM_RADEON_FLIP 0x12
+#define DRM_RADEON_ALLOC 0x13
+#define DRM_RADEON_FREE 0x14
+#define DRM_RADEON_INIT_HEAP 0x15
+#define DRM_RADEON_IRQ_EMIT 0x16
+#define DRM_RADEON_IRQ_WAIT 0x17
+#define DRM_RADEON_CP_RESUME 0x18
+#define DRM_RADEON_SETPARAM 0x19
+#define DRM_RADEON_MAX_DRM_COMMAND_INDEX 0x39
+
+
+#define RADEON_FRONT 0x1
+#define RADEON_BACK 0x2
+#define RADEON_DEPTH 0x4
+#define RADEON_STENCIL 0x8
+
+#define RADEON_CLEAR_X1 0
+#define RADEON_CLEAR_Y1 1
+#define RADEON_CLEAR_X2 2
+#define RADEON_CLEAR_Y2 3
+#define RADEON_CLEAR_DEPTH 4
+
+
+typedef struct {
+ enum {
+ DRM_RADEON_INIT_CP = 0x01,
+ DRM_RADEON_CLEANUP_CP = 0x02,
+ DRM_RADEON_INIT_R200_CP = 0x03
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
+ int cp_mode;
+ int gart_size;
+ int ring_size;
+ int usec_timeout;
+
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long ring_offset;
+ unsigned long ring_rptr_offset;
+ unsigned long buffers_offset;
+ unsigned long gart_textures_offset;
+} drmRadeonInit;
+
+typedef struct {
+ int flush;
+ int idle;
+} drmRadeonCPStop;
+
+typedef struct {
+ int idx;
+ int start;
+ int end;
+ int discard;
+} drmRadeonIndirect;
+
+typedef union drmRadeonClearR {
+ float f[5];
+ unsigned int ui[5];
+} drmRadeonClearRect;
+
+typedef struct drmRadeonClearT {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask; /* misnamed field: should be stencil */
+ drmRadeonClearRect *depth_boxes;
+} drmRadeonClearType;
+
+typedef struct drmRadeonFullscreenT {
+ enum {
+ RADEON_INIT_FULLSCREEN = 0x01,
+ RADEON_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drmRadeonFullscreenType;
+
+typedef struct {
+ unsigned int *mask;
+} drmRadeonStipple;
+
+typedef struct {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ const void *data;
+} drmRadeonTexImage;
+
+typedef struct {
+ unsigned int offset;
+ int pitch;
+ int format;
+ int width; /* Texture image coordinates */
+ int height;
+ drmRadeonTexImage *image;
+} drmRadeonTexture;
+
+
+#define RADEON_MAX_TEXTURE_UNITS 3
+
+/* Layout matches drm_radeon_state_t in linux drm_radeon.h.
+ */
+typedef struct {
+ struct {
+ unsigned int pp_misc; /* 0x1c14 */
+ unsigned int pp_fog_color;
+ unsigned int re_solid_color;
+ unsigned int rb3d_blendcntl;
+ unsigned int rb3d_depthoffset;
+ unsigned int rb3d_depthpitch;
+ unsigned int rb3d_zstencilcntl;
+ unsigned int pp_cntl; /* 0x1c38 */
+ unsigned int rb3d_cntl;
+ unsigned int rb3d_coloroffset;
+ unsigned int re_width_height;
+ unsigned int rb3d_colorpitch;
+ } context;
+ struct {
+ unsigned int se_cntl;
+ } setup1;
+ struct {
+ unsigned int se_coord_fmt; /* 0x1c50 */
+ } vertex;
+ struct {
+ unsigned int re_line_pattern; /* 0x1cd0 */
+ unsigned int re_line_state;
+ unsigned int se_line_width; /* 0x1db8 */
+ } line;
+ struct {
+ unsigned int pp_lum_matrix; /* 0x1d00 */
+ unsigned int pp_rot_matrix_0; /* 0x1d58 */
+ unsigned int pp_rot_matrix_1;
+ } bumpmap;
+ struct {
+ unsigned int rb3d_stencilrefmask; /* 0x1d7c */
+ unsigned int rb3d_ropcntl;
+ unsigned int rb3d_planemask;
+ } mask;
+ struct {
+ unsigned int se_vport_xscale; /* 0x1d98 */
+ unsigned int se_vport_xoffset;
+ unsigned int se_vport_yscale;
+ unsigned int se_vport_yoffset;
+ unsigned int se_vport_zscale;
+ unsigned int se_vport_zoffset;
+ } viewport;
+ struct {
+ unsigned int se_cntl_status; /* 0x2140 */
+ } setup2;
+ struct {
+ unsigned int re_top_left; /*ignored*/ /* 0x26c0 */
+ unsigned int re_misc;
+ } misc;
+ struct {
+ unsigned int pp_txfilter;
+ unsigned int pp_txformat;
+ unsigned int pp_txoffset;
+ unsigned int pp_txcblend;
+ unsigned int pp_txablend;
+ unsigned int pp_tfactor;
+ unsigned int pp_border_color;
+ } texture[RADEON_MAX_TEXTURE_UNITS];
+ struct {
+ unsigned int se_zbias_factor;
+ unsigned int se_zbias_constant;
+ } zbias;
+ unsigned int dirty;
+} drmRadeonState;
+
+/* 1.1 vertex ioctl. Used in compatibility modes.
+ */
+typedef struct {
+ int prim;
+ int idx; /* Index of vertex buffer */
+ int count; /* Number of vertices in buffer */
+ int discard; /* Client finished with buffer? */
+} drmRadeonVertex;
+
+typedef struct {
+ unsigned int start;
+ unsigned int finish;
+ unsigned int prim:8;
+ unsigned int stateidx:8;
+ unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
+ unsigned int vc_format;
+} drmRadeonPrim;
+
+typedef struct {
+ int idx; /* Index of vertex buffer */
+ int discard; /* Client finished with buffer? */
+ int nr_states;
+ drmRadeonState *state;
+ int nr_prims;
+ drmRadeonPrim *prim;
+} drmRadeonVertex2;
+
+#define RADEON_MAX_STATES 16
+#define RADEON_MAX_PRIMS 64
+
+/* Command buffer. Replace with true dma stream?
+ */
+typedef struct {
+ int bufsz;
+ char *buf;
+ int nbox;
+ drmClipRect *boxes;
+} drmRadeonCmdBuffer;
+
+/* New style per-packet identifiers for use in cmd_buffer ioctl with
+ * the RADEON_EMIT_PACKET command. Comments relate new packets to old
+ * state bits and the packet size:
+ */
+#define RADEON_EMIT_PP_MISC 0 /* context/7 */
+#define RADEON_EMIT_PP_CNTL 1 /* context/3 */
+#define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
+#define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
+#define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
+#define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
+#define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
+#define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
+#define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
+#define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
+#define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
+#define RADEON_EMIT_RE_MISC 11 /* misc/1 */
+#define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
+#define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
+#define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
+#define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
+#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
+#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
+#define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
+#define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
+#define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
+#define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
+#define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
+#define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
+#define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
+#define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
+#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/6 */
+#define R200_EMIT_TFACTOR_0 30 /* tf/6 */
+#define R200_EMIT_VTX_FMT_0 31 /* vtx/4 */
+#define R200_EMIT_VAP_CTL 32 /* vap/1 */
+#define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
+#define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
+#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
+#define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
+#define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
+#define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
+#define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
+#define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
+#define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
+#define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
+#define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
+#define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
+#define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
+#define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
+#define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
+#define R200_EMIT_VTE_CNTL 48 /* vte/1 */
+#define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
+#define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
+#define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
+#define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
+#define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
+#define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
+#define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
+#define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
+#define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
+#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
+#define R200_EMIT_PP_CUBIC_FACES_0 61
+#define R200_EMIT_PP_CUBIC_OFFSETS_0 62
+#define R200_EMIT_PP_CUBIC_FACES_1 63
+#define R200_EMIT_PP_CUBIC_OFFSETS_1 64
+#define R200_EMIT_PP_CUBIC_FACES_2 65
+#define R200_EMIT_PP_CUBIC_OFFSETS_2 66
+#define R200_EMIT_PP_CUBIC_FACES_3 67
+#define R200_EMIT_PP_CUBIC_OFFSETS_3 68
+#define R200_EMIT_PP_CUBIC_FACES_4 69
+#define R200_EMIT_PP_CUBIC_OFFSETS_4 70
+#define R200_EMIT_PP_CUBIC_FACES_5 71
+#define R200_EMIT_PP_CUBIC_OFFSETS_5 72
+#define RADEON_EMIT_PP_TEX_SIZE_0 73
+#define RADEON_EMIT_PP_TEX_SIZE_1 74
+#define RADEON_EMIT_PP_TEX_SIZE_2 75
+#define RADEON_MAX_STATE_PACKETS 76
+
+
+/* Commands understood by cmd_buffer ioctl. More can be added but
+ * obviously these can't be removed or changed:
+ */
+#define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
+#define RADEON_CMD_SCALARS 2 /* emit scalar data */
+#define RADEON_CMD_VECTORS 3 /* emit vector data */
+#define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
+#define RADEON_CMD_PACKET3 5 /* emit hw packet */
+#define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
+#define RADEON_CMD_SCALARS2 7 /* R200 stopgap */
+#define RADEON_CMD_WAIT 8 /* synchronization */
+
+typedef union {
+ int i;
+ struct {
+ unsigned char cmd_type, pad0, pad1, pad2;
+ } header;
+ struct {
+ unsigned char cmd_type, packet_id, pad0, pad1;
+ } packet;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } scalars;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } vectors;
+ struct {
+ unsigned char cmd_type, buf_idx, pad0, pad1;
+ } dma;
+ struct {
+ unsigned char cmd_type, flags, pad0, pad1;
+ } wait;
+} drmRadeonCmdHeader;
+
+
+#define RADEON_WAIT_2D 0x1
+#define RADEON_WAIT_3D 0x2
+
+
+typedef struct drm_radeon_getparam {
+ int param;
+ int *value;
+} drmRadeonGetParam;
+
+#define RADEON_PARAM_GART_BUFFER_OFFSET 1
+#define RADEON_PARAM_LAST_FRAME 2
+#define RADEON_PARAM_LAST_DISPATCH 3
+#define RADEON_PARAM_LAST_CLEAR 4
+#define RADEON_PARAM_IRQ_NR 5
+#define RADEON_PARAM_GART_BASE 6
+
+
+#define RADEON_MEM_REGION_GART 1
+#define RADEON_MEM_REGION_FB 2
+
+typedef struct drm_radeon_mem_alloc {
+ int region;
+ int alignment;
+ int size;
+ int *region_offset; /* offset from start of fb or GART */
+} drmRadeonMemAlloc;
+
+typedef struct drm_radeon_mem_free {
+ int region;
+ int region_offset;
+} drmRadeonMemFree;
+
+typedef struct drm_radeon_mem_init_heap {
+ int region;
+ int size;
+ int start;
+} drmRadeonMemInitHeap;
+
+/* 1.6: Userspace can request & wait on irq's:
+ */
+typedef struct drm_radeon_irq_emit {
+ int *irq_seq;
+} drmRadeonIrqEmit;
+
+typedef struct drm_radeon_irq_wait {
+ int irq_seq;
+} drmRadeonIrqWait;
+
+
+/* 1.10: Clients tell the DRM where they think the framebuffer is located in
+ * the card's address space, via a new generic ioctl to set parameters
+ */
+
+typedef struct drm_radeon_set_param {
+ unsigned int param;
+ int64_t value;
+} drmRadeonSetParam;
+
+#define RADEON_SETPARAM_FB_LOCATION 1
+
+
+#endif
diff --git a/hw/kdrive/ati/radeon_sarea.h b/hw/kdrive/ati/radeon_sarea.h
new file mode 100644
index 000000000..82a72ed19
--- /dev/null
+++ b/hw/kdrive/ati/radeon_sarea.h
@@ -0,0 +1,222 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_sarea.h,v 1.5 2002/10/30 12:52:14 alanh Exp $ */
+/*
+ * Copyright 2000 ATI Technologies Inc., Markham, Ontario,
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
+ * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@xfree86.org>
+ * Gareth Hughes <gareth@valinux.com>
+ *
+ */
+
+#ifndef _RADEON_SAREA_H_
+#define _RADEON_SAREA_H_
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the kernel file (radeon_drm.h)
+ */
+#ifndef __RADEON_SAREA_DEFINES__
+#define __RADEON_SAREA_DEFINES__
+
+/* What needs to be changed for the current vertex buffer? */
+#define RADEON_UPLOAD_CONTEXT 0x00000001
+#define RADEON_UPLOAD_VERTFMT 0x00000002
+#define RADEON_UPLOAD_LINE 0x00000004
+#define RADEON_UPLOAD_BUMPMAP 0x00000008
+#define RADEON_UPLOAD_MASKS 0x00000010
+#define RADEON_UPLOAD_VIEWPORT 0x00000020
+#define RADEON_UPLOAD_SETUP 0x00000040
+#define RADEON_UPLOAD_TCL 0x00000080
+#define RADEON_UPLOAD_MISC 0x00000100
+#define RADEON_UPLOAD_TEX0 0x00000200
+#define RADEON_UPLOAD_TEX1 0x00000400
+#define RADEON_UPLOAD_TEX2 0x00000800
+#define RADEON_UPLOAD_TEX0IMAGES 0x00001000
+#define RADEON_UPLOAD_TEX1IMAGES 0x00002000
+#define RADEON_UPLOAD_TEX2IMAGES 0x00004000
+#define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */
+#define RADEON_REQUIRE_QUIESCENCE 0x00010000
+#define RADEON_UPLOAD_ZBIAS 0x00020000
+#define RADEON_UPLOAD_ALL 0x0002ffff
+#define RADEON_UPLOAD_CONTEXT_ALL 0x000201ff
+
+#define RADEON_FRONT 0x1
+#define RADEON_BACK 0x2
+#define RADEON_DEPTH 0x4
+#define RADEON_STENCIL 0x8
+
+/* Primitive types */
+#define RADEON_POINTS 0x1
+#define RADEON_LINES 0x2
+#define RADEON_LINE_STRIP 0x3
+#define RADEON_TRIANGLES 0x4
+#define RADEON_TRIANGLE_FAN 0x5
+#define RADEON_TRIANGLE_STRIP 0x6
+#define RADEON_3VTX_POINTS 0x9
+#define RADEON_3VTX_LINES 0xa
+
+/* Vertex/indirect buffer size */
+#define RADEON_BUFFER_SIZE 65536
+
+/* Byte offsets for indirect buffer data */
+#define RADEON_INDEX_PRIM_OFFSET 20
+#define RADEON_HOSTDATA_BLIT_OFFSET 32
+
+#define RADEON_SCRATCH_REG_OFFSET 32
+
+/* Keep these small for testing */
+#define RADEON_NR_SAREA_CLIPRECTS 12
+
+#define RADEON_MAX_TEXTURE_LEVELS 12
+#define RADEON_MAX_TEXTURE_UNITS 3
+
+/* Blits have strict offset rules. All blit offset must be aligned on
+ * a 1K-byte boundary.
+ */
+#define RADEON_OFFSET_SHIFT 10
+#define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT)
+#define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1)
+
+#endif /* __RADEON_SAREA_DEFINES__ */
+
+typedef struct {
+ unsigned int red;
+ unsigned int green;
+ unsigned int blue;
+ unsigned int alpha;
+} radeon_color_regs_t;
+
+typedef struct {
+ /* Context state */
+ unsigned int pp_misc;
+ unsigned int pp_fog_color;
+ unsigned int re_solid_color;
+ unsigned int rb3d_blendcntl;
+ unsigned int rb3d_depthoffset;
+ unsigned int rb3d_depthpitch;
+ unsigned int rb3d_zstencilcntl;
+
+ unsigned int pp_cntl;
+ unsigned int rb3d_cntl;
+ unsigned int rb3d_coloroffset;
+ unsigned int re_width_height;
+ unsigned int rb3d_colorpitch;
+ unsigned int se_cntl;
+
+ /* Vertex format state */
+ unsigned int se_coord_fmt;
+
+ /* Line state */
+ unsigned int re_line_pattern;
+ unsigned int re_line_state;
+
+ unsigned int se_line_width;
+
+ /* Bumpmap state */
+ unsigned int pp_lum_matrix;
+
+ unsigned int pp_rot_matrix_0;
+ unsigned int pp_rot_matrix_1;
+
+ /* Mask state */
+ unsigned int rb3d_stencilrefmask;
+ unsigned int rb3d_ropcntl;
+ unsigned int rb3d_planemask;
+
+ /* Viewport state */
+ unsigned int se_vport_xscale;
+ unsigned int se_vport_xoffset;
+ unsigned int se_vport_yscale;
+ unsigned int se_vport_yoffset;
+ unsigned int se_vport_zscale;
+ unsigned int se_vport_zoffset;
+
+ /* Setup state */
+ unsigned int se_cntl_status;
+
+ /* Misc state */
+ unsigned int re_top_left;
+ unsigned int re_misc;
+} radeon_context_regs_t;
+
+/* Setup registers for each texture unit */
+typedef struct {
+ unsigned int pp_txfilter;
+ unsigned int pp_txformat;
+ unsigned int pp_txoffset;
+ unsigned int pp_txcblend;
+ unsigned int pp_txablend;
+ unsigned int pp_tfactor;
+ unsigned int pp_border_color;
+} radeon_texture_regs_t;
+
+typedef struct {
+ /* The channel for communication of state information to the kernel
+ * on firing a vertex buffer.
+ */
+ radeon_context_regs_t ContextState;
+ radeon_texture_regs_t TexState[RADEON_MAX_TEXTURE_UNITS];
+ unsigned int dirty;
+ unsigned int vertsize;
+ unsigned int vc_format;
+
+ /* The current cliprects, or a subset thereof */
+ XF86DRIClipRectRec boxes[RADEON_NR_SAREA_CLIPRECTS];
+ unsigned int nbox;
+
+ /* Counters for throttling of rendering clients */
+ unsigned int last_frame;
+ unsigned int last_dispatch;
+ unsigned int last_clear;
+
+ /* Maintain an LRU of contiguous regions of texture space. If you
+ * think you own a region of texture memory, and it has an age
+ * different to the one you set, then you are mistaken and it has
+ * been stolen by another client. If global texAge hasn't changed,
+ * there is no need to walk the list.
+ *
+ * These regions can be used as a proxy for the fine-grained texture
+ * information of other clients - by maintaining them in the same
+ * lru which is used to age their own textures, clients have an
+ * approximate lru for the whole of global texture space, and can
+ * make informed decisions as to which areas to kick out. There is
+ * no need to choose whether to kick out your own texture or someone
+ * else's - simply eject them all in LRU order.
+ */
+ /* Last elt is sentinal */
+ drmTextureRegion texList[ATI_NR_TEX_HEAPS][ATI_NR_TEX_REGIONS+1];
+ /* last time texture was uploaded */
+ unsigned int texAge[ATI_NR_TEX_HEAPS];
+
+ int ctxOwner; /* last context to upload state */
+ int pfAllowPageFlip; /* set by the 2d driver, read by the client */
+ int pfCurrentPage; /* set by kernel, read by others */
+ int crtc2_base; /* for pageflipping with CloneMode */
+} RADEONSAREAPriv, *RADEONSAREAPrivPtr;
+
+#endif
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
deleted file mode 100644
index 345526d19..000000000
--- a/hw/vfb/InitInput.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/* $Xorg: InitInput.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.10 2003/11/16 03:16:59 dawes Exp $ */
-
-#include "X11/X.h"
-#define NEED_EVENTS
-#include "mi.h"
-#include "X11/Xproto.h"
-#include "scrnintstr.h"
-#include "inputstr.h"
-#include "X11/Xos.h"
-#include "mibstore.h"
-#include "mipointer.h"
-#include "lk201kbd.h"
-#include "keysym.h"
-
-Bool
-LegalModifier(unsigned int key, DevicePtr pDev)
-{
- return TRUE;
-}
-
-void
-ProcessInputEvents()
-{
- mieqProcessInputEvents();
- miPointerUpdate();
-}
-
-#define VFB_MIN_KEY 8
-#define VFB_MAX_KEY 255
-KeySym map[MAP_LENGTH * LK201_GLYPHS_PER_KEY];
-
-/* The only reason for using the LK201 mappings here was that they were
- * easy to lift.
- */
-static Bool
-GetLK201Mappings(KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
-#define INDEX(in) ((in - VFB_MIN_KEY) * LK201_GLYPHS_PER_KEY)
- int i;
-
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
- pModMap[ KEY_LOCK ] = LockMask;
- pModMap[ KEY_SHIFT ] = ShiftMask;
- pModMap[ KEY_CTRL ] = ControlMask;
- pModMap[ KEY_COMPOSE ] = Mod1Mask;
-
- pKeySyms->minKeyCode = VFB_MIN_KEY;
- pKeySyms->maxKeyCode = VFB_MAX_KEY;
- pKeySyms->mapWidth = LK201_GLYPHS_PER_KEY;
- pKeySyms->map = map;
-
- for (i = 0; i < (MAP_LENGTH * LK201_GLYPHS_PER_KEY); i++)
- map[i] = NoSymbol; /* make sure it is restored */
-
- map[INDEX(KEY_F1)] = XK_F1;
- map[INDEX(KEY_F2)] = XK_F2;
- map[INDEX(KEY_F3)] = XK_F3;
- map[INDEX(KEY_F4)] = XK_F4;
- map[INDEX(KEY_F5)] = XK_F5;
- map[INDEX(KEY_F6)] = XK_F6;
- map[INDEX(KEY_F7)] = XK_F7;
- map[INDEX(KEY_F8)] = XK_F8;
- map[INDEX(KEY_F9)] = XK_F9;
- map[INDEX(KEY_F10)] = XK_F10;
- map[INDEX(KEY_F11)] = XK_F11;
- map[INDEX(KEY_F12)] = XK_F12;
- map[INDEX(KEY_F13)] = XK_F13;
- map[INDEX(KEY_F14)] = XK_F14;
-
- map[INDEX(KEY_HELP)] = XK_Help;
- map[INDEX(KEY_MENU)] = XK_Menu;
-
- map[INDEX(KEY_F17)] = XK_F17;
- map[INDEX(KEY_F18)] = XK_F18;
- map[INDEX(KEY_F19)] = XK_F19;
- map[INDEX(KEY_F20)] = XK_F20;
-
- map[INDEX(KEY_FIND)] = XK_Find;
- map[INDEX(KEY_INSERT_HERE)] = XK_Insert;
- map[INDEX(KEY_REMOVE)] = XK_Delete;
- map[INDEX(KEY_SELECT)] = XK_Select;
- map[INDEX(KEY_PREV_SCREEN)] = XK_Prior;
- map[INDEX(KEY_NEXT_SCREEN)] = XK_Next;
-
- map[INDEX(KEY_KP_0)] = XK_KP_0;
- map[INDEX(KEY_KP_PERIOD)] = XK_KP_Decimal;
- map[INDEX(KEY_KP_ENTER)] = XK_KP_Enter;
- map[INDEX(KEY_KP_1)] = XK_KP_1;
- map[INDEX(KEY_KP_2)] = XK_KP_2;
- map[INDEX(KEY_KP_3)] = XK_KP_3;
- map[INDEX(KEY_KP_4)] = XK_KP_4;
- map[INDEX(KEY_KP_5)] = XK_KP_5;
- map[INDEX(KEY_KP_6)] = XK_KP_6;
- map[INDEX(KEY_KP_COMMA)] = XK_KP_Separator;
- map[INDEX(KEY_KP_7)] = XK_KP_7;
- map[INDEX(KEY_KP_8)] = XK_KP_8;
- map[INDEX(KEY_KP_9)] = XK_KP_9;
- map[INDEX(KEY_KP_HYPHEN)] = XK_KP_Subtract;
- map[INDEX(KEY_KP_PF1)] = XK_KP_F1;
- map[INDEX(KEY_KP_PF2)] = XK_KP_F2;
- map[INDEX(KEY_KP_PF3)] = XK_KP_F3;
- map[INDEX(KEY_KP_PF4)] = XK_KP_F4;
-
- map[INDEX(KEY_LEFT)] = XK_Left;
- map[INDEX(KEY_RIGHT)] = XK_Right;
- map[INDEX(KEY_DOWN)] = XK_Down;
- map[INDEX(KEY_UP)] = XK_Up;
-
- map[INDEX(KEY_SHIFT)] = XK_Shift_L;
- map[INDEX(KEY_CTRL)] = XK_Control_L;
- map[INDEX(KEY_LOCK)] = XK_Caps_Lock;
- map[INDEX(KEY_COMPOSE)] = XK_Multi_key;
- map[INDEX(KEY_COMPOSE)+1] = XK_Meta_L;
- map[INDEX(KEY_DELETE)] = XK_Delete;
- map[INDEX(KEY_RETURN)] = XK_Return;
- map[INDEX(KEY_TAB)] = XK_Tab;
-
- map[INDEX(KEY_TILDE)] = XK_quoteleft;
- map[INDEX(KEY_TILDE)+1] = XK_asciitilde;
-
- map[INDEX(KEY_TR_1)] = XK_1;
- map[INDEX(KEY_TR_1)+1] = XK_exclam;
- map[INDEX(KEY_Q)] = XK_Q;
- map[INDEX(KEY_A)] = XK_A;
- map[INDEX(KEY_Z)] = XK_Z;
-
- map[INDEX(KEY_TR_2)] = XK_2;
- map[INDEX(KEY_TR_2)+1] = XK_at;
-
- map[INDEX(KEY_W)] = XK_W;
- map[INDEX(KEY_S)] = XK_S;
- map[INDEX(KEY_X)] = XK_X;
-
- map[INDEX(KEY_LANGLE_RANGLE)] = XK_less;
- map[INDEX(KEY_LANGLE_RANGLE)+1] = XK_greater;
-
- map[INDEX(KEY_TR_3)] = XK_3;
- map[INDEX(KEY_TR_3)+1] = XK_numbersign;
-
- map[INDEX(KEY_E)] = XK_E;
- map[INDEX(KEY_D)] = XK_D;
- map[INDEX(KEY_C)] = XK_C;
-
- map[INDEX(KEY_TR_4)] = XK_4;
- map[INDEX(KEY_TR_4)+1] = XK_dollar;
-
- map[INDEX(KEY_R)] = XK_R;
- map[INDEX(KEY_F)] = XK_F;
- map[INDEX(KEY_V)] = XK_V;
- map[INDEX(KEY_SPACE)] = XK_space;
-
- map[INDEX(KEY_TR_5)] = XK_5;
- map[INDEX(KEY_TR_5)+1] = XK_percent;
-
- map[INDEX(KEY_T)] = XK_T;
- map[INDEX(KEY_G)] = XK_G;
- map[INDEX(KEY_B)] = XK_B;
-
- map[INDEX(KEY_TR_6)] = XK_6;
- map[INDEX(KEY_TR_6)+1] = XK_asciicircum;
-
- map[INDEX(KEY_Y)] = XK_Y;
- map[INDEX(KEY_H)] = XK_H;
- map[INDEX(KEY_N)] = XK_N;
-
- map[INDEX(KEY_TR_7)] = XK_7;
- map[INDEX(KEY_TR_7)+1] = XK_ampersand;
-
- map[INDEX(KEY_U)] = XK_U;
- map[INDEX(KEY_J)] = XK_J;
- map[INDEX(KEY_M)] = XK_M;
-
- map[INDEX(KEY_TR_8)] = XK_8;
- map[INDEX(KEY_TR_8)+1] = XK_asterisk;
-
- map[INDEX(KEY_I)] = XK_I;
- map[INDEX(KEY_K)] = XK_K;
-
- map[INDEX(KEY_COMMA)] = XK_comma;
- map[INDEX(KEY_COMMA)+1] = XK_less;
-
- map[INDEX(KEY_TR_9)] = XK_9;
- map[INDEX(KEY_TR_9)+1] = XK_parenleft;
-
- map[INDEX(KEY_O)] = XK_O;
- map[INDEX(KEY_L)] = XK_L;
-
- map[INDEX(KEY_PERIOD)] = XK_period;
- map[INDEX(KEY_PERIOD)+1] = XK_greater;
-
- map[INDEX(KEY_TR_0)] = XK_0;
- map[INDEX(KEY_TR_0)+1] = XK_parenright;
-
- map[INDEX(KEY_P)] = XK_P;
-
- map[INDEX(KEY_SEMICOLON)] = XK_semicolon;
- map[INDEX(KEY_SEMICOLON)+1] = XK_colon;
-
- map[INDEX(KEY_QMARK)] = XK_slash;
- map[INDEX(KEY_QMARK)+1] = XK_question;
-
- map[INDEX(KEY_PLUS)] = XK_equal;
- map[INDEX(KEY_PLUS)+1] = XK_plus;
-
- map[INDEX(KEY_RBRACE)] = XK_bracketright;
- map[INDEX(KEY_RBRACE)+1] = XK_braceright;
-
- map[INDEX(KEY_VBAR)] = XK_backslash;
- map[INDEX(KEY_VBAR)+1] = XK_bar;
-
- map[INDEX(KEY_UBAR)] = XK_minus;
- map[INDEX(KEY_UBAR)+1] = XK_underscore;
-
- map[INDEX(KEY_LBRACE)] = XK_bracketleft;
- map[INDEX(KEY_LBRACE)+1] = XK_braceleft;
-
- map[INDEX(KEY_QUOTE)] = XK_quoteright;
- map[INDEX(KEY_QUOTE)+1] = XK_quotedbl;
-
- map[INDEX(KEY_F11)] = XK_Escape;
-
- return TRUE;
-#undef INDEX
-}
-
-static int
-vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
-{
- KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
- DevicePtr pDev = (DevicePtr)pDevice;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- GetLK201Mappings(&keySyms, modMap);
- InitKeyboardDeviceStruct(pDev, &keySyms, modMap,
- (BellProcPtr)NoopDDA, (KbdCtrlProcPtr)NoopDDA);
- break;
- case DEVICE_ON:
- pDev->on = TRUE;
- break;
- case DEVICE_OFF:
- pDev->on = FALSE;
- break;
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
-
-static int
-vfbMouseProc(DeviceIntPtr pDevice, int onoff)
-{
- BYTE map[4];
- DevicePtr pDev = (DevicePtr)pDevice;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents,
- (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize());
- break;
-
- case DEVICE_ON:
- pDev->on = TRUE;
- break;
-
- case DEVICE_OFF:
- pDev->on = FALSE;
- break;
-
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
-
-void
-InitInput(int argc, char *argv[])
-{
- DeviceIntPtr p, k;
- p = AddInputDevice(vfbMouseProc, TRUE);
- k = AddInputDevice(vfbKeybdProc, TRUE);
- RegisterPointerDevice(p);
- RegisterKeyboardDevice(k);
- miRegisterPointerDevice(screenInfo.screens[0], p);
- (void)mieqInit ((DevicePtr) k, (DevicePtr) p);
-}
-
-#ifdef XTESTEXT1
-void
-XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
- int mousey)
-{
-}
-
-void
-XTestGetPointerPos(short *fmousex, short *fmousey)
-{
-}
-
-void
-XTestJumpPointer(int jx, int jy, int dev_type)
-{
-}
-#endif
-
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
deleted file mode 100644
index 25f426232..000000000
--- a/hw/vfb/InitOutput.c
+++ /dev/null
@@ -1,1042 +0,0 @@
-/* $Xorg: InitOutput.c,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.26 2003/11/16 03:16:59 dawes Exp $ */
-
-#if defined(WIN32)
-#include <X11/Xwinsock.h>
-#endif
-#include <stdio.h>
-#include "X11/X.h"
-#define NEED_EVENTS
-#include "X11/Xproto.h"
-#include "X11/Xos.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define PSZ 8
-#include "fb.h"
-#include "mibstore.h"
-#include "colormapst.h"
-#include "gcstruct.h"
-#include "input.h"
-#include "mipointer.h"
-#include <sys/types.h>
-#ifdef HAS_MMAP
-#include <sys/mman.h>
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-#endif /* HAS_MMAP */
-#include <sys/stat.h>
-#include <errno.h>
-#ifndef WIN32
-#include <sys/param.h>
-#endif
-#include <X11/XWDFile.h>
-#ifdef HAS_SHM
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#endif /* HAS_SHM */
-#include "dix.h"
-#include "miline.h"
-#include "mfb.h"
-
-#define VFB_DEFAULT_WIDTH 1280
-#define VFB_DEFAULT_HEIGHT 1024
-#define VFB_DEFAULT_DEPTH 8
-#define VFB_DEFAULT_WHITEPIXEL 0
-#define VFB_DEFAULT_BLACKPIXEL 1
-#define VFB_DEFAULT_LINEBIAS 0
-#define XWD_WINDOW_NAME_LEN 60
-
-typedef struct
-{
- int scrnum;
- int width;
- int paddedBytesWidth;
- int paddedWidth;
- int height;
- int depth;
- int bitsPerPixel;
- int sizeInBytes;
- int ncolors;
- char *pfbMemory;
- XWDColor *pXWDCmap;
- XWDFileHeader *pXWDHeader;
- Pixel blackPixel;
- Pixel whitePixel;
- unsigned int lineBias;
- CloseScreenProcPtr closeScreen;
-
-#ifdef HAS_MMAP
- int mmap_fd;
- char mmap_file[MAXPATHLEN];
-#endif
-
-#ifdef HAS_SHM
- int shmid;
-#endif
-} vfbScreenInfo, *vfbScreenInfoPtr;
-
-static int vfbNumScreens;
-static vfbScreenInfo vfbScreens[MAXSCREENS];
-static Bool vfbPixmapDepths[33];
-#ifdef HAS_MMAP
-static char *pfbdir = NULL;
-#endif
-typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType;
-static fbMemType fbmemtype = NORMAL_MEMORY_FB;
-static char needswap = 0;
-static int lastScreen = -1;
-static Bool Render = TRUE;
-
-#define swapcopy16(_dst, _src) \
- if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \
- else _dst = _src;
-
-#define swapcopy32(_dst, _src) \
- if (needswap) { CARD32 _s = _src; cpswapl(_s, _dst); } \
- else _dst = _src;
-
-
-static void
-vfbInitializePixmapDepths(void)
-{
- int i;
- vfbPixmapDepths[1] = TRUE; /* always need bitmaps */
- for (i = 2; i <= 32; i++)
- vfbPixmapDepths[i] = FALSE;
-}
-
-static void
-vfbInitializeDefaultScreens(void)
-{
- int i;
-
- for (i = 0; i < MAXSCREENS; i++)
- {
- vfbScreens[i].scrnum = i;
- vfbScreens[i].width = VFB_DEFAULT_WIDTH;
- vfbScreens[i].height = VFB_DEFAULT_HEIGHT;
- vfbScreens[i].depth = VFB_DEFAULT_DEPTH;
- vfbScreens[i].blackPixel = VFB_DEFAULT_BLACKPIXEL;
- vfbScreens[i].whitePixel = VFB_DEFAULT_WHITEPIXEL;
- vfbScreens[i].lineBias = VFB_DEFAULT_LINEBIAS;
- vfbScreens[i].pfbMemory = NULL;
- }
- vfbNumScreens = 1;
-}
-
-static int
-vfbBitsPerPixel(int depth)
-{
- if (depth == 1) return 1;
- else if (depth <= 8) return 8;
- else if (depth <= 16) return 16;
- else return 32;
-}
-
-void
-ddxGiveUp()
-{
- int i;
-
- /* clean up the framebuffers */
-
- switch (fbmemtype)
- {
-#ifdef HAS_MMAP
- case MMAPPED_FILE_FB:
- for (i = 0; i < vfbNumScreens; i++)
- {
- if (-1 == unlink(vfbScreens[i].mmap_file))
- {
- perror("unlink");
- ErrorF("unlink %s failed, errno %d",
- vfbScreens[i].mmap_file, errno);
- }
- }
- break;
-#else /* HAS_MMAP */
- case MMAPPED_FILE_FB:
- break;
-#endif /* HAS_MMAP */
-
-#ifdef HAS_SHM
- case SHARED_MEMORY_FB:
- for (i = 0; i < vfbNumScreens; i++)
- {
- if (-1 == shmdt((char *)vfbScreens[i].pXWDHeader))
- {
- perror("shmdt");
- ErrorF("shmdt failed, errno %d", errno);
- }
- }
- break;
-#else /* HAS_SHM */
- case SHARED_MEMORY_FB:
- break;
-#endif /* HAS_SHM */
-
- case NORMAL_MEMORY_FB:
- for (i = 0; i < vfbNumScreens; i++)
- {
- Xfree(vfbScreens[i].pXWDHeader);
- }
- break;
- }
-}
-
-void
-AbortDDX()
-{
- ddxGiveUp();
-}
-
-#ifdef __DARWIN__
-void
-DarwinHandleGUI(int argc, char *argv[])
-{
-}
-
-void GlxExtensionInit();
-void GlxWrapInitVisuals(void *procPtr);
-
-void
-DarwinGlxExtensionInit()
-{
- GlxExtensionInit();
-}
-
-void
-DarwinGlxWrapInitVisuals(
- void *procPtr)
-{
- GlxWrapInitVisuals(procPtr);
-}
-#endif
-
-void
-OsVendorInit()
-{
-}
-
-void
-OsVendorFatalError()
-{
-}
-
-void
-ddxUseMsg()
-{
- ErrorF("-screen scrn WxHxD set screen's width, height, depth\n");
- ErrorF("-pixdepths list-of-int support given pixmap depths\n");
-#ifdef RENDER
- ErrorF("+/-render turn on/of RENDER extension support"
- "(default on)\n");
-#endif
- ErrorF("-linebias n adjust thin line pixelization\n");
- ErrorF("-blackpixel n pixel value for black\n");
- ErrorF("-whitepixel n pixel value for white\n");
-
-#ifdef HAS_MMAP
- ErrorF("-fbdir directory put framebuffers in mmap'ed files in directory\n");
-#endif
-
-#ifdef HAS_SHM
- ErrorF("-shmem put framebuffers in shared memory\n");
-#endif
-}
-
-int
-ddxProcessArgument(int argc, char *argv[], int i)
-{
- static Bool firstTime = TRUE;
-
- if (firstTime)
- {
- vfbInitializeDefaultScreens();
- vfbInitializePixmapDepths();
- firstTime = FALSE;
- }
-
- if (strcmp (argv[i], "-screen") == 0) /* -screen n WxHxD */
- {
- int screenNum;
- if (i + 2 >= argc) UseMsg();
- screenNum = atoi(argv[i+1]);
- if (screenNum < 0 || screenNum >= MAXSCREENS)
- {
- ErrorF("Invalid screen number %d\n", screenNum);
- UseMsg();
- }
- if (3 != sscanf(argv[i+2], "%dx%dx%d",
- &vfbScreens[screenNum].width,
- &vfbScreens[screenNum].height,
- &vfbScreens[screenNum].depth))
- {
- ErrorF("Invalid screen configuration %s\n", argv[i+2]);
- UseMsg();
- }
-
- if (screenNum >= vfbNumScreens)
- vfbNumScreens = screenNum + 1;
- lastScreen = screenNum;
- return 3;
- }
-
- if (strcmp (argv[i], "-pixdepths") == 0) /* -pixdepths list-of-depth */
- {
- int depth, ret = 1;
-
- if (++i >= argc) UseMsg();
- while ((i < argc) && (depth = atoi(argv[i++])) != 0)
- {
- if (depth < 0 || depth > 32)
- {
- ErrorF("Invalid pixmap depth %d\n", depth);
- UseMsg();
- }
- vfbPixmapDepths[depth] = TRUE;
- ret++;
- }
- return ret;
- }
-
- if (strcmp (argv[i], "+render") == 0) /* +render */
- {
- Render = TRUE;
- return 1;
- }
-
- if (strcmp (argv[i], "-render") == 0) /* -render */
- {
- Render = FALSE;
- return 1;
- }
-
- if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */
- {
- Pixel pix;
- if (++i >= argc) UseMsg();
- pix = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- vfbScreens[i].blackPixel = pix;
- }
- }
- else
- {
- vfbScreens[lastScreen].blackPixel = pix;
- }
- return 2;
- }
-
- if (strcmp (argv[i], "-whitepixel") == 0) /* -whitepixel n */
- {
- Pixel pix;
- if (++i >= argc) UseMsg();
- pix = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- vfbScreens[i].whitePixel = pix;
- }
- }
- else
- {
- vfbScreens[lastScreen].whitePixel = pix;
- }
- return 2;
- }
-
- if (strcmp (argv[i], "-linebias") == 0) /* -linebias n */
- {
- unsigned int linebias;
- if (++i >= argc) UseMsg();
- linebias = atoi(argv[i]);
- if (-1 == lastScreen)
- {
- int i;
- for (i = 0; i < MAXSCREENS; i++)
- {
- vfbScreens[i].lineBias = linebias;
- }
- }
- else
- {
- vfbScreens[lastScreen].lineBias = linebias;
- }
- return 2;
- }
-
-#ifdef HAS_MMAP
- if (strcmp (argv[i], "-fbdir") == 0) /* -fbdir directory */
- {
- if (++i >= argc) UseMsg();
- pfbdir = argv[i];
- fbmemtype = MMAPPED_FILE_FB;
- return 2;
- }
-#endif /* HAS_MMAP */
-
-#ifdef HAS_SHM
- if (strcmp (argv[i], "-shmem") == 0) /* -shmem */
- {
- fbmemtype = SHARED_MEMORY_FB;
- return 1;
- }
-#endif
-
- return 0;
-}
-
-#ifdef DDXTIME /* from ServerOSDefines */
-CARD32
-GetTimeInMillis()
-{
- struct timeval tp;
-
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
-}
-#endif
-
-
-static Bool
-vfbMultiDepthCreateGC(GCPtr pGC)
-{
- switch (vfbBitsPerPixel(pGC->depth))
- {
- case 1: return mfbCreateGC (pGC);
- case 8:
- case 16:
- case 32: return fbCreateGC (pGC);
- default: return FALSE;
- }
-}
-
-static void
-vfbMultiDepthGetSpans(
- DrawablePtr pDrawable, /* drawable from which to get bits */
- int wMax, /* largest value of all *pwidths */
- register DDXPointPtr ppt, /* points to start copying from */
- int *pwidth, /* list of number of bits to copy */
- int nspans, /* number of scanlines to copy */
- char *pdstStart) /* where to put the bits */
-{
- switch (pDrawable->bitsPerPixel) {
- case 1:
- mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- case 8:
- case 16:
- case 32:
- fbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- break;
- }
- return;
-}
-
-static void
-vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pdstLine)
-{
- switch (pDrawable->bitsPerPixel)
- {
- case 1:
- mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- case 8:
- case 16:
- case 32:
- fbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- break;
- }
-}
-
-static ColormapPtr InstalledMaps[MAXSCREENS];
-
-static int
-vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
- *pmaps = InstalledMaps[pScreen->myNum]->mid;
- return (1);
-}
-
-
-static void
-vfbInstallColormap(ColormapPtr pmap)
-{
- int index = pmap->pScreen->myNum;
- ColormapPtr oldpmap = InstalledMaps[index];
-
- if (pmap != oldpmap)
- {
- int entries;
- XWDFileHeader *pXWDHeader;
- XWDColor *pXWDCmap;
- VisualPtr pVisual;
- Pixel * ppix;
- xrgb * prgb;
- xColorItem *defs;
- int i;
-
- if(oldpmap != (ColormapPtr)None)
- WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- /* Install pmap */
- InstalledMaps[index] = pmap;
- WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
-
- entries = pmap->pVisual->ColormapEntries;
- pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader;
- pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
- pVisual = pmap->pVisual;
-
- swapcopy32(pXWDHeader->visual_class, pVisual->class);
- swapcopy32(pXWDHeader->red_mask, pVisual->redMask);
- swapcopy32(pXWDHeader->green_mask, pVisual->greenMask);
- swapcopy32(pXWDHeader->blue_mask, pVisual->blueMask);
- swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
- swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
-
- ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
- prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
- defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
-
- for (i = 0; i < entries; i++) ppix[i] = i;
- /* XXX truecolor */
- QueryColors(pmap, entries, ppix, prgb);
-
- for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
- defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
- defs[i].red = prgb[i].red;
- defs[i].green = prgb[i].green;
- defs[i].blue = prgb[i].blue;
- defs[i].flags = DoRed|DoGreen|DoBlue;
- }
- (*pmap->pScreen->StoreColors)(pmap, entries, defs);
-
- DEALLOCATE_LOCAL(ppix);
- DEALLOCATE_LOCAL(prgb);
- DEALLOCATE_LOCAL(defs);
- }
-}
-
-static void
-vfbUninstallColormap(ColormapPtr pmap)
-{
- ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
-
- if(pmap == curpmap)
- {
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pmap->pScreen->InstallColormap)(curpmap);
- }
- }
-}
-
-static void
-vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs)
-{
- XWDColor *pXWDCmap;
- int i;
-
- if (pmap != InstalledMaps[pmap->pScreen->myNum])
- {
- return;
- }
-
- pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
-
- if ((pmap->pVisual->class | DynamicClass) == DirectColor)
- {
- return;
- }
-
- for (i = 0; i < ndef; i++)
- {
- if (pdefs[i].flags & DoRed)
- {
- swapcopy16(pXWDCmap[pdefs[i].pixel].red, pdefs[i].red);
- }
- if (pdefs[i].flags & DoGreen)
- {
- swapcopy16(pXWDCmap[pdefs[i].pixel].green, pdefs[i].green);
- }
- if (pdefs[i].flags & DoBlue)
- {
- swapcopy16(pXWDCmap[pdefs[i].pixel].blue, pdefs[i].blue);
- }
- }
-}
-
-static Bool
-vfbSaveScreen(ScreenPtr pScreen, int on)
-{
- return TRUE;
-}
-
-#ifdef HAS_MMAP
-
-/* this flushes any changes to the screens out to the mmapped file */
-static void
-vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
-{
- int i;
-
- for (i = 0; i < vfbNumScreens; i++)
- {
-#ifdef MS_ASYNC
- if (-1 == msync((caddr_t)vfbScreens[i].pXWDHeader,
- (size_t)vfbScreens[i].sizeInBytes, MS_ASYNC))
-#else
- /* silly NetBSD and who else? */
- if (-1 == msync((caddr_t)vfbScreens[i].pXWDHeader,
- (size_t)vfbScreens[i].sizeInBytes))
-#endif
- {
- perror("msync");
- ErrorF("msync failed, errno %d", errno);
- }
- }
-}
-
-
-static void
-vfbWakeupHandler(pointer blockData, int result, pointer pReadmask)
-{
-}
-
-
-static void
-vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
-{
-#define DUMMY_BUFFER_SIZE 65536
- char dummyBuffer[DUMMY_BUFFER_SIZE];
- int currentFileSize, writeThisTime;
-
- sprintf(pvfb->mmap_file, "%s/Xvfb_screen%d", pfbdir, pvfb->scrnum);
- if (-1 == (pvfb->mmap_fd = open(pvfb->mmap_file, O_CREAT|O_RDWR, 0666)))
- {
- perror("open");
- ErrorF("open %s failed, errno %d", pvfb->mmap_file, errno);
- return;
- }
-
- /* Extend the file to be the proper size */
-
- bzero(dummyBuffer, DUMMY_BUFFER_SIZE);
- for (currentFileSize = 0;
- currentFileSize < pvfb->sizeInBytes;
- currentFileSize += writeThisTime)
- {
- writeThisTime = min(DUMMY_BUFFER_SIZE,
- pvfb->sizeInBytes - currentFileSize);
- if (-1 == write(pvfb->mmap_fd, dummyBuffer, writeThisTime))
- {
- perror("write");
- ErrorF("write %s failed, errno %d", pvfb->mmap_file, errno);
- return;
- }
- }
-
- /* try to mmap the file */
-
- pvfb->pXWDHeader = (XWDFileHeader *)mmap((caddr_t)NULL, pvfb->sizeInBytes,
- PROT_READ|PROT_WRITE,
- MAP_FILE|MAP_SHARED,
- pvfb->mmap_fd, 0);
- if (-1 == (long)pvfb->pXWDHeader)
- {
- perror("mmap");
- ErrorF("mmap %s failed, errno %d", pvfb->mmap_file, errno);
- pvfb->pXWDHeader = NULL;
- return;
- }
-
- if (!RegisterBlockAndWakeupHandlers(vfbBlockHandler, vfbWakeupHandler,
- NULL))
- {
- pvfb->pXWDHeader = NULL;
- }
-}
-#endif /* HAS_MMAP */
-
-
-#ifdef HAS_SHM
-static void
-vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
-{
- /* create the shared memory segment */
-
- pvfb->shmid = shmget(IPC_PRIVATE, pvfb->sizeInBytes, IPC_CREAT|0777);
- if (pvfb->shmid < 0)
- {
- perror("shmget");
- ErrorF("shmget %d bytes failed, errno %d", pvfb->sizeInBytes, errno);
- return;
- }
-
- /* try to attach it */
-
- pvfb->pXWDHeader = (XWDFileHeader *)shmat(pvfb->shmid, 0, 0);
- if (-1 == (long)pvfb->pXWDHeader)
- {
- perror("shmat");
- ErrorF("shmat failed, errno %d", errno);
- pvfb->pXWDHeader = NULL;
- return;
- }
-
- ErrorF("screen %d shmid %d\n", pvfb->scrnum, pvfb->shmid);
-}
-#endif /* HAS_SHM */
-
-static char *
-vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
-{
- if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */
-
- pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height;
-
- /* Calculate how many entries in colormap. This is rather bogus, because
- * the visuals haven't even been set up yet, but we need to know because we
- * have to allocate space in the file for the colormap. The number 10
- * below comes from the MAX_PSEUDO_DEPTH define in cfbcmap.c.
- */
-
- if (pvfb->depth <= 10)
- { /* single index colormaps */
- pvfb->ncolors = 1 << pvfb->depth;
- }
- else
- { /* decomposed colormaps */
- int nplanes_per_color_component = pvfb->depth / 3;
- if (pvfb->depth % 3) nplanes_per_color_component++;
- pvfb->ncolors = 1 << nplanes_per_color_component;
- }
-
- /* add extra bytes for XWDFileHeader, window name, and colormap */
-
- pvfb->sizeInBytes += SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN +
- pvfb->ncolors * SIZEOF(XWDColor);
-
- pvfb->pXWDHeader = NULL;
- switch (fbmemtype)
- {
-#ifdef HAS_MMAP
- case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break;
-#else
- case MMAPPED_FILE_FB: break;
-#endif
-
-#ifdef HAS_SHM
- case SHARED_MEMORY_FB: vfbAllocateSharedMemoryFramebuffer(pvfb); break;
-#else
- case SHARED_MEMORY_FB: break;
-#endif
-
- case NORMAL_MEMORY_FB:
- pvfb->pXWDHeader = (XWDFileHeader *)Xalloc(pvfb->sizeInBytes);
- break;
- }
-
- if (pvfb->pXWDHeader)
- {
- pvfb->pXWDCmap = (XWDColor *)((char *)pvfb->pXWDHeader
- + SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN);
- pvfb->pfbMemory = (char *)(pvfb->pXWDCmap + pvfb->ncolors);
-
- return pvfb->pfbMemory;
- }
- else
- return NULL;
-}
-
-
-static void
-vfbWriteXWDFileHeader(ScreenPtr pScreen)
-{
- vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
- XWDFileHeader *pXWDHeader = pvfb->pXWDHeader;
- char hostname[XWD_WINDOW_NAME_LEN];
- unsigned long swaptest = 1;
- int i;
-
- needswap = *(char *) &swaptest;
-
- pXWDHeader->header_size = (char *)pvfb->pXWDCmap - (char *)pvfb->pXWDHeader;
- pXWDHeader->file_version = XWD_FILE_VERSION;
-
- pXWDHeader->pixmap_format = ZPixmap;
- pXWDHeader->pixmap_depth = pvfb->depth;
- pXWDHeader->pixmap_height = pXWDHeader->window_height = pvfb->height;
- pXWDHeader->xoffset = 0;
- pXWDHeader->byte_order = IMAGE_BYTE_ORDER;
- pXWDHeader->bitmap_bit_order = BITMAP_BIT_ORDER;
-#ifndef INTERNAL_VS_EXTERNAL_PADDING
- pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->width;
- pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT;
- pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD;
-#else
- pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->paddedWidth;
- pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT_PROTO;
- pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO;
-#endif
- pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel;
- pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth;
- pXWDHeader->ncolors = pvfb->ncolors;
-
- /* visual related fields are written when colormap is installed */
-
- pXWDHeader->window_x = pXWDHeader->window_y = 0;
- pXWDHeader->window_bdrwidth = 0;
-
- /* write xwd "window" name: Xvfb hostname:server.screen */
-
- if (-1 == gethostname(hostname, sizeof(hostname)))
- hostname[0] = 0;
- else
- hostname[XWD_WINDOW_NAME_LEN-1] = 0;
- sprintf((char *)(pXWDHeader+1), "Xvfb %s:%s.%d", hostname, display,
- pScreen->myNum);
-
- /* write colormap pixel slot values */
-
- for (i = 0; i < pvfb->ncolors; i++)
- {
- pvfb->pXWDCmap[i].pixel = i;
- }
-
- /* byte swap to most significant byte first */
-
- if (needswap)
- {
- SwapLongs((CARD32 *)pXWDHeader, SIZEOF(XWDheader)/4);
- for (i = 0; i < pvfb->ncolors; i++)
- {
- register char n;
- swapl(&pvfb->pXWDCmap[i].pixel, n);
- }
- }
-}
-
-
-static Bool
-vfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-static void
-vfbCrossScreen (ScreenPtr pScreen, Bool entering)
-{
-}
-
-static miPointerScreenFuncRec vfbPointerCursorFuncs =
-{
- vfbCursorOffScreen,
- vfbCrossScreen,
- miPointerWarpCursor
-};
-
-static Bool
-vfbCloseScreen(int index, ScreenPtr pScreen)
-{
- vfbScreenInfoPtr pvfb = &vfbScreens[index];
- int i;
-
- pScreen->CloseScreen = pvfb->closeScreen;
-
- /*
- * XXX probably lots of stuff to clean. For now,
- * clear InstalledMaps[] so that server reset works correctly.
- */
- for (i = 0; i < MAXSCREENS; i++)
- InstalledMaps[i] = NULL;
-
- return pScreen->CloseScreen(index, pScreen);
-}
-
-static Bool
-vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
-{
- vfbScreenInfoPtr pvfb = &vfbScreens[index];
- int dpix = 100, dpiy = 100;
- int ret;
- char *pbits;
-
- pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth);
- pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth);
- if (pvfb->bitsPerPixel >= 8 )
- pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8);
- else
- pvfb->paddedWidth = pvfb->paddedBytesWidth * 8;
- pbits = vfbAllocateFramebufferMemory(pvfb);
- if (!pbits) return FALSE;
-
- /* miSetPixmapDepths ();*/
-
- switch (pvfb->bitsPerPixel)
- {
- case 1:
- ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth);
- break;
- case 8:
- case 16:
- case 32:
- ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel);
-#ifdef RENDER
- if (ret && Render)
- fbPictureInit (pScreen, 0, 0);
-#endif
- break;
- default:
- return FALSE;
- }
-
- if (!ret) return FALSE;
-
- miInitializeBackingStore(pScreen);
-
- /*
- * Circumvent the backing store that was just initialised. This amounts
- * to a truely bizarre way of initialising SaveDoomedAreas and friends.
- */
- pScreen->CreateGC = vfbMultiDepthCreateGC;
- pScreen->GetImage = vfbMultiDepthGetImage;
- pScreen->GetSpans = vfbMultiDepthGetSpans;
-
- pScreen->InstallColormap = vfbInstallColormap;
- pScreen->UninstallColormap = vfbUninstallColormap;
- pScreen->ListInstalledColormaps = vfbListInstalledColormaps;
-
- pScreen->SaveScreen = vfbSaveScreen;
- pScreen->StoreColors = vfbStoreColors;
-
- miDCInitialize(pScreen, &vfbPointerCursorFuncs);
-
- vfbWriteXWDFileHeader(pScreen);
-
- pScreen->blackPixel = pvfb->blackPixel;
- pScreen->whitePixel = pvfb->whitePixel;
-
- if (pvfb->bitsPerPixel == 1)
- {
- ret = mfbCreateDefColormap(pScreen);
- }
- else
- {
- ret = fbCreateDefColormap(pScreen);
- }
-
- miSetZeroLineBias(pScreen, pvfb->lineBias);
-
- pvfb->closeScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = vfbCloseScreen;
-
- return ret;
-
-} /* end vfbScreenInit */
-
-
-void
-InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
-{
- int i;
- int NumFormats = 0;
-
- /* initialize pixmap formats */
-
- /* must have a pixmap depth to match every screen depth */
- for (i = 0; i < vfbNumScreens; i++)
- {
- vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
- }
-
- /* RENDER needs a good set of pixmaps. */
- if (Render) {
- vfbPixmapDepths[1] = TRUE;
- vfbPixmapDepths[4] = TRUE;
- vfbPixmapDepths[8] = TRUE;
- vfbPixmapDepths[15] = TRUE;
- vfbPixmapDepths[16] = TRUE;
- vfbPixmapDepths[24] = TRUE;
- vfbPixmapDepths[32] = TRUE;
- }
-
- for (i = 1; i <= 32; i++)
- {
- if (vfbPixmapDepths[i])
- {
- if (NumFormats >= MAXFORMATS)
- FatalError ("MAXFORMATS is too small for this server\n");
- screenInfo->formats[NumFormats].depth = i;
- screenInfo->formats[NumFormats].bitsPerPixel = vfbBitsPerPixel(i);
- screenInfo->formats[NumFormats].scanlinePad = BITMAP_SCANLINE_PAD;
- NumFormats++;
- }
- }
-
- screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
- screenInfo->numPixmapFormats = NumFormats;
-
- /* initialize screens */
-
- for (i = 0; i < vfbNumScreens; i++)
- {
- if (-1 == AddScreen(vfbScreenInit, argc, argv))
- {
- FatalError("Couldn't add screen %d", i);
- }
- }
-
-} /* end InitOutput */
-
-/* this is just to get the server to link on AIX */
-#ifdef AIXV3
-int SelectWaitTime = 10000; /* usec */
-#endif
-
diff --git a/hw/vfb/Xvfb.man.pre b/hw/vfb/Xvfb.man.pre
deleted file mode 100644
index e3e255298..000000000
--- a/hw/vfb/Xvfb.man.pre
+++ /dev/null
@@ -1,131 +0,0 @@
-.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
-.\" Copyright 1993, 1998 The Open Group
-.\"
-.\" Permission to use, copy, modify, distribute, and sell this software and its
-.\" documentation for any purpose is hereby granted without fee, provided that
-.\" the above copyright notice appear in all copies and that both that
-.\" copyright notice and this permission notice appear in supporting
-.\" documentation.
-.\"
-.\" The above copyright notice and this permission notice shall be included
-.\" in all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-.\" OTHER DEALINGS IN THE SOFTWARE.
-.\"
-.\" Except as contained in this notice, the name of The Open Group shall
-.\" not be used in advertising or otherwise to promote the sale, use or
-.\" other dealings in this Software without prior written authorization
-.\" from The Open Group.
-.\"
-.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.9 2001/12/14 19:59:45 dawes Exp $
-.\"
-.TH XVFB 1 __xorgversion__
-.SH NAME
-Xvfb \- virtual framebuffer X server for X Version 11
-.SH SYNOPSIS
-.B Xvfb
-[ option ] ...
-.SH DESCRIPTION
-.I Xvfb
-is an X server that can run on machines with no display hardware
-and no physical input devices. It emulates a dumb framebuffer using
-virtual memory.
-.PP
-The primary use of this server was intended to be server testing. The
-mfb or cfb code for any depth can be exercised with this server
-without the need for real hardware that supports the desired depths.
-The X community has found many other novel uses for \fIXvfb\fP,
-including testing clients against unusual depths and screen
-configurations, doing batch processing with \fIXvfb\fP as a background
-rendering engine, load testing, as an aid to porting the X server to a
-new platform, and providing an unobtrusive way to run applications
-that don't really need an X server but insist on having one anyway.
-.SH BUILDING
-To build \fIXvfb\fP, put the following in your host.def and remake.
-.PP
-\&#define BuildServer YES /* if you aren't already building other servers */
-.br
-\&#define XVirtualFramebufferServer YES
-
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXvfb\fP accepts the following command line switches:
-.TP 4
-.B "\-screen \fIscreennum\fP \fIWxHxD\fP"
-This option creates screen \fIscreennum\fP and sets its width, height,
-and depth to W, H, and D respectively. By default, only screen 0 exists
-and has the dimensions 1280x1024x8.
-.TP 4
-.B "\-pixdepths \fIlist-of-depths\fP"
-This option specifies a list of pixmap depths that the server should
-support in addition to the depths implied by the supported screens.
-\fIlist-of-depths\fP is a space-separated list of integers that can
-have values from 1 to 32.
-.TP 4
-.B "\-fbdir \fIframebuffer-directory\fP"
-This option specifies the directory in which the memory mapped files
-containing the framebuffer memory should be created.
-See FILES.
-This option only exists on machines that have the mmap and msync system
-calls.
-.TP 4
-.B "\-shmem"
-This option specifies that the framebuffer should be put in shared memory.
-The shared memory ID for each screen will be printed by the server.
-The shared memory is in xwd format.
-This option only exists on machines that support the System V shared memory
-interface.
-.PP
-If neither \fB\-shmem\fP nor \fB\-fbdir\fP is specified,
-the framebuffer memory will be allocated with malloc().
-.TP 4
-.B "\-linebias \fIn\fP"
-This option specifies how to adjust the pixelization of thin lines.
-The value \fIn\fP is a bitmask of octants in which to prefer an axial
-step when the Bresenham error term is exactly zero. See the file
-Xserver/mi/miline.h for more information. This option is probably only useful
-to server developers to experiment with the range of line pixelization
-possible with the cfb and mfb code.
-.TP 4
-.B "\-blackpixel \fIpixel-value\fP, \-whitepixel \fIpixel-value\fP"
-These options specify the black and white pixel values the server should use.
-.SH FILES
-The following files are created if the \-fbdir option is given.
-.TP 4
-\fIframebuffer-directory\fP/Xvfb_screen<n>
-Memory mapped file containing screen n's framebuffer memory, one file
-per screen. The file is in xwd format. Thus, taking a full-screen
-snapshot can be done with a file copy command, and the resulting
-snapshot will even contain the cursor image.
-.SH EXAMPLES
-.TP 8
-Xvfb :1 -screen 0 1600x1200x32
-The server will listen for connections as server number 1, and screen 0
-will be depth 32 1600x1200.
-.TP 8
-Xvfb :1 -screen 1 1600x1200x16
-The server will listen for connections as server number 1, will have the
-default screen configuration (one screen, 1280x1024x8), and screen 1
-will be depth 16 1600x1200.
-.TP 8
-Xvfb -pixdepths 3 27 -fbdir /usr/tmp
-The server will listen for connections as server number 0, will have the
-default screen configuration (one screen, 1280x1024x8),
-will also support pixmap
-depths of 3 and 27,
-and will use memory mapped files in /usr/tmp for the framebuffer.
-.TP 8
-xwud -in /usr/tmp/Xvfb_screen0
-Displays screen 0 of the server started by the preceding example.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), Xserver(1), xwd(1), xwud(1), XWDFile.h
-.SH AUTHORS
-David P. Wiggins, The Open Group, Inc.
diff --git a/hw/vfb/lk201kbd.h b/hw/vfb/lk201kbd.h
deleted file mode 100644
index 9b4090ed0..000000000
--- a/hw/vfb/lk201kbd.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: lk201kbd.h,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ */
-
-#define MIN_LK201_KEY 86
-#define MAX_LK201_KEY 251
-#define LK201_GLYPHS_PER_KEY 2
-
-#define KEY_F1 86
-#define KEY_F2 87
-#define KEY_F3 88
-#define KEY_F4 89
-#define KEY_F5 90
-#define KEY_F6 100
-#define KEY_F7 101
-#define KEY_F8 102
-#define KEY_F9 103
-#define KEY_F10 104
-#define KEY_F11 113
-#define KEY_F12 114
-#define KEY_F13 115
-#define KEY_F14 116
-#define KEY_HELP 124
-#define KEY_MENU 125
-#define KEY_F17 128
-#define KEY_F18 129
-#define KEY_F19 130
-#define KEY_F20 131
-#define KEY_FIND 138
-#define KEY_INSERT_HERE 139
-#define KEY_REMOVE 140
-#define KEY_SELECT 141
-#define KEY_PREV_SCREEN 142
-#define KEY_NEXT_SCREEN 143
-#define KEY_KP_0 146 /* key pad */
-#define KEY_KP_PERIOD 148 /* key pad */
-#define KEY_KP_ENTER 149 /* key pad */
-#define KEY_KP_1 150 /* key pad */
-#define KEY_KP_2 151 /* key pad */
-#define KEY_KP_3 152 /* key pad */
-#define KEY_KP_4 153 /* key pad */
-#define KEY_KP_5 154 /* key pad */
-#define KEY_KP_6 155 /* key pad */
-#define KEY_KP_COMMA 156 /* key pad */
-#define KEY_KP_7 157 /* key pad */
-#define KEY_KP_8 158 /* key pad */
-#define KEY_KP_9 159 /* key pad */
-#define KEY_KP_HYPHEN 160
-#define KEY_KP_PF1 161
-#define KEY_KP_PF2 162
-#define KEY_KP_PF3 163
-#define KEY_KP_PF4 164
-#define KEY_LEFT 167
-#define KEY_RIGHT 168
-#define KEY_DOWN 169
-#define KEY_UP 170
-#define KEY_SHIFT 174
-#define KEY_CTRL 175
-#define KEY_LOCK 176
-#define KEY_COMPOSE 177
-#define KEY_APPLE 177
-#define KEY_META 177
-#define KEY_DELETE 188
-#define KEY_RETURN 189
-#define KEY_TAB 190
-#define KEY_TILDE 191
-#define KEY_TR_1 192 /* Top Row */
-#define KEY_Q 193
-#define KEY_A 194
-#define KEY_Z 195
-#define KEY_TR_2 197
-#define KEY_W 198
-#define KEY_S 199
-#define KEY_X 200
-#define KEY_LANGLE_RANGLE 201 /* xxx */
-#define KEY_TR_3 203
-#define KEY_E 204
-#define KEY_D 205
-#define KEY_C 206
-#define KEY_TR_4 208
-#define KEY_R 209
-#define KEY_F 210
-#define KEY_V 211
-#define KEY_SPACE 212
-#define KEY_TR_5 214
-#define KEY_T 215
-#define KEY_G 216
-#define KEY_B 217
-#define KEY_TR_6 219
-#define KEY_Y 220
-#define KEY_H 221
-#define KEY_N 222
-#define KEY_TR_7 224
-#define KEY_U 225
-#define KEY_J 226
-#define KEY_M 227
-#define KEY_TR_8 229
-#define KEY_I 230
-#define KEY_K 231
-#define KEY_COMMA 232 /* xxx */
-#define KEY_TR_9 234
-#define KEY_O 235
-#define KEY_L 236
-#define KEY_PERIOD 237 /* xxx */
-#define KEY_TR_0 239
-#define KEY_P 240
-#define KEY_SEMICOLON 242 /* xxx */
-#define KEY_QMARK 243
-#define KEY_PLUS 245 /* xxx */
-#define KEY_RBRACE 246
-#define KEY_VBAR 247 /* xxx */
-#define KEY_UBAR 249 /* xxx */
-#define KEY_LBRACE 250
-#define KEY_QUOTE 251
diff --git a/hw/xfree86/Options b/hw/xfree86/Options
deleted file mode 100644
index c963cd3ce..000000000
--- a/hw/xfree86/Options
+++ /dev/null
@@ -1,409 +0,0 @@
-!!
-!! Copyright (c) 2001 by The XFree86 Project, Inc.
-!!
-!! Permission is hereby granted, free of charge, to any person obtaining a
-!! copy of this software and associated documentation files (the "Software"),
-!! to deal in the Software without restriction, including without limitation
-!! the rights to use, copy, modify, merge, publish, distribute, sublicense,
-!! and/or sell copies of the Software, and to permit persons to whom the
-!! Software is furnished to do so, subject to the following conditions:
-!!
-!! The above copyright notice and this permission notice shall be included in
-!! all copies or substantial portions of the Software.
-!!
-!! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-!! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-!! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-!! THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-!! WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-!! OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-!! SOFTWARE.
-!!
-!! Except as contained in this notice, the name of the XFree86 Project shall
-!! not be used in advertising or otherwise to promote the sale, use or other
-!! dealings in this Software without prior written authorization from the
-!! XFree86 Project.
-!!
-!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.10 2003/02/15 06:46:30 paulo Exp $
-
-!! XAA options
-xaa.XaaNoCPUToScreenColorExpandFill:\
-Disables accelerated rectangular expansion blits from source patterns \
-stored in system memory (using a memory-mapped aperture).
-
-xaa.XaaNoColor8x8PatternFillRect:\
-Disables accelerated fills of a rectangular region with a full-color pattern.
-
-xaa.XaaNoColor8x8PatternFillTrap:\
-Disables accelerated fills of a trapezoidal region with a full-color pattern.
-
-xaa.XaaNoDashedBresenhamLine:\
-Disables accelerated dashed Bresenham line draws.
-
-xaa.XaaNoDashedTwoPointLine:\
-Disables accelerated dashed line draws between two arbitrary points.
-
-xaa.XaaNoImageWriteRect:\
-Disables acclerated transfers of full-color rectangular patterns from \
-system memory to video memory (using a memory-mapped aperture).
-
-xaa.XaaNoMono8x8PatternFillRect:\
-Disables accelerated fills of a rectangular region with a monochrome pattern.
-
-xaa.XaaNoMono8x8PatternFillTrap:\
-Disables accelerated fills of a trapezoidal region with a monochrome pattern.
-
-xaa.XaaNoOffscreenPixmaps:\
-Disables accelerated draws into pixmaps stored in offscreen video memory.
-
-xaa.XaaNoPixmapCache:\
-Disables caching of patterns in offscreen video memory.
-
-xaa.XaaNoScanlineCPUToScreenColorExpandFill:\
-Disables accelerated rectangular expansion blits from source patterns \
-stored in system memory (one scan line at a time).
-
-xaa.XaaNoScanlineImageWriteRect:\
-Disables accelerated transfers of full-color rectangular patterns from \
-system memory to video memory (one scan line at a time).
-
-xaa.XaaNoScreenToScreenColorExpandFill:\
-Disables accelerated rectangular expansion blits from source patterns \
-stored in off-screen video memory.
-
-xaa.XaaNoScreenToScreenCopy:\
-Disables accelerated copies of rectangular regions from one part of video \
-memory to another part of video memory.
-
-xaa.XaaNoSolidBresenhamLine:\
-Disables accelerated solid Bresenham line draws.
-
-xaa.XaaNoSolidFillRect:\
-Disables accelerated solid-color fills of rectangles.
-
-xaa.XaaNoSolidFillTrap:\
-Disables accelerated solid-color fills of Bresenham trapezoids.
-
-xaa.XaaNoSolidHorVertLine:\
-Disables accelerated solid horizontal and vertical line draws.
-
-xaa.XaaNoSolidTwoPointLine:\
-Disables accelerated solid line draws between two arbitrary points.
-
-
-!! DDC Options
-ddc.NoDDC:\
-Disables DDC (Display Data Channel) so that the Xserver doesn't try to talk to\
-the Monitor. \
-Default: off, implies DDC is used.
-
-ddc.NoDDC1:\
-Disables use of DDC version 1 (DDC using vertical refresh). \
-Default: off, implies DDC1 is used.
-
-ddc.NoDDC2:\
-Disables use of DDC version 2 (DDC using I2C - usually over vga connector). \
-Default: off, implies DDC2 is used.
-
-
-!! FBDev options
-fbdev.fbdev:\
-The framebuffer device to use. \
-Default: /dev/fb0.
-
-fbdev.ShadowFB:\
-Enable or disable use of the shadow framebuffer layer. \
-Default: on.
-
-fbdev.Rotate:\
-Enable rotation of the display. The supported values are "CW" (clockwise, \
-90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise, \
-270 degrees). Implies use of the shadow framebuffer layer. \
-Default: off.
-
-
-!! MGA options
-mga.ColorKey:\
-Set the colormap index used for the transparency key for the depth 8 plane \
-when operating in 8+24 overlay mode. The value must be in the range 2-255. \
-Default: 255.
-
-!mga.HWcursor:\
-!Enable or disable the HW cursor. Default: on.
-
-mga.MGASDRAM:\
-Specify whether G100, G200 or G400 cards have SDRAM. The driver attempts to \
-auto-detect this based on the card's PCI subsystem ID. This option may be \
-used to override that auto-detection. The mga driver is not able to \
-auto-detect the presence of of SDRAM on secondary heads in multihead \
-configurations so this option will often need to be specified in multihead \
-configurations. Default: auto-detected.
-
-mga.NoAccel:\
-Disable or enable 2D hardware acceleration. Default: acceleration is enabled.
-
-mga.OverclockMem:\
-Set clocks to values used by some commercial X-Servers (G100, G200 and \
-G400 only). Default: off.
-
-mga.Overlay:\
-Enable 8+24 overlay mode. Only appropriate for depth 24. (Note: the G100 is \
-unaccelerated in the 8+24 overlay mode due to a missing hardware feature). \
-Default: off.
-
-mga.PciRetry:\
-Enable or disable PCI retries. Default: off.
-
-mga.Rotate:\
-Rotate the display clockwise or counterclockwise. This mode is unaccelerated. \
-Default: no rotation.
-
-mga.ShadowFB:\
-Enable or disable use of the shadow framebuffer layer. Default: off. \
-
-mga.SyncOnGreen:\
-Enable or disable combining the sync signals with the green signal. \
-Default: off.
-
-mga.UseFBDev:\
-Enable or disable use of on OS-specific fb interface (and is not supported \
-on all OSs). See fbdevhw(4) for further information. Default: off.
-
-mga.VideoKey:\
-This sets the default pixel value for the YUV video overlay key. \
-Default: undefined.
-
-mga.TexturedVideo:\
-This has XvImage support use the texture engine rather than the video \
-overlay. This option is only supported by the G200 and G400, and only in \
-16 and 32 bits per pixel. Default: off.
-
-mga.NoHal:\
-Matrox provides a "Hardware Abstraction Layer", \
-a separate binary which enables extra hardware features from G400 onwards. \
-Default: HAL is used.
-
-!mga.DigitalScreen:\
-! Option Ignored. Drivers auto-detect Digital output if they support it at all.
-!Default: Auto-detected.
-
-! mga.TV:\
-! Option Ignored. Drivers auto-detect TV if they support TV out at all.
-!Default: Auto-detected.
-
-mga.TVStandard:\
-(HAL only) Picture standard for TV out. Use "PAL" for 50Hz PAL. \
-Default: 60Hz NTSC.
-
-mga.CableType:\
-(HAL only) Set the cable type for TV out. Options are "SCART_RGB", \
-"SCART_COMPOSITE", or "SCART_TYPE2". Any other string enables the default. \
-Default: YC_COMPOSITE.
-
-mga.SwappedHead:\
-(HAL only) For Dual Head cards, reverse relationship between CRTC picture \
-generators and video output sockets. \
-Especially useful with TV or digital outputs. \
-Default: CRTC1 generates output for socket 1 and CRTC2 generates output for socket 2.
-
-mga.Crtc2Half:\
-In dual head mode, allow CRTC2 to use half of the video memory. \
-Default: CRTC2 uses min{8MB, half video RAM}, but see also Crtc2Ram.
-
-mga.Crtc2Ram:\
-In dual head mode, CRTC2 will use this many KB of video memory. \
-Overrrides Crtc2Half. \
-Default: CRTC2 uses min{8MB, half video RAM}, but see also Crtc2Half.
-
-mga.ShowCache:\
-An option for hackers. The pixmap cache lives in off-screen video memory. \
-This option extends the virtual desktop to show this part of video memory. \
-Default: Off.
-
-mga.AGPMode:\
-AGP bus speed multiplier, used by DRI. \
-Default: x1 (slowest but most stable).
-
-
-!! R128 options
-
-!r128.SWcursor: \
-!Selects software cursor. \
-!Default: off.
-
-r128.NoAccel:\
-Enables or disables all hardware acceleration. \
-Default: on.
-
-r128.Dac6Bit:\
-Enables or disables the use of 6 bits per color component when in 8 bpp \
-mode (emulates VGA mode). \
-Default: off.
-
-r128.VideoKey:\
-This overrides the default pixel value for the YUV video overlay key. \
-Default: undefined.
-
-r128.Display:\
-Select display mode for devices which support flat panels. Supported\
-modes are "FP", "CRT", "Mirror", "BIOS". \
-Default: "FP".
-
-r128.ProgramFPRegs:\
-Enable or disable programming of the flat panel registers.\
-Beware that this may damage your panel, so use at your own risk. \
-Default: device dependant.
-
-r128.PanelWidth:\
-Override flat panel width in pixels. \
-Default: determined using BIOS.
-
-r128.PanelHeight:\
-Override flat panel height in pixels. \
-Default: determined using BIOS.
-
-r128.UseFBDev:\
-Enable or disable use of on OS-specific fb interface (and is not supported \
-on all OSs). See fbdevhw(4) for further information. Default: off.
-
-r128.DMAForXv:\
-Try or don't try to use DMA for Xv image transfers. This will reduce CPU \
-usage when playing big videos like DVDs, but may cause instabilities. \
-Default: off.
-
-
-!! Radeon options
-
-radeon.SWcursor:\
-Selects software cursor. Default: off.
-
-radeon.NoAccel:\
-Disables all hardware acceleration. Default: off.
-
-radeon.Dac6Bit:\
-Enables or disables the use of 6 bits per color component when in 8 bpp \
-mode (emulates VGA mode). Default: off.
-
-radeon.VideoKey:\
-This overrides the default pixel value for the YUV video overlay key. \
-Default: undefined.
-
-radeon.UseFBDev:\
-Enable or disable use of an OS-specific framebuffer device interface \
-(which is not supported on all OSs). Default: off.
-
-radeon.AGPMode:\
-Set AGP data transfer rate. (used only when DRI is enabled) \
-Valid choices: 1 (default), 2 and 4
-
-radeon.AGPFastWrite:\
-Enable AGP fast write. (used only when DRI is enabled) \
-Default: off.
-
-radeon.ForcePCIMode:\
-Force to use PCI GART for DRI acceleration. (used only when DRI is enabled) \
-Default: off.
-
-radeon.DDCMode:\
-Force to use the modes queried from the connected monitor. Default: off.
-
-radeon.CloneDisplay:\
-This option is only used for dual-head cards with only single screen section \
-specified in the configuration file. Valid choices: \
-0 - disable (one CRTC used for both heads) \
-1 - auto-detect (default) \
-2 - force on \
-3 - auto-detect + 2nd head overlay \
-4 - force on + 2nd head overlay \
-
-radeon.CloneMode:\
-Set the first mode for the secondary head. It can be different from the modes \
-used for the primary head. If you don't have this line while clone is on, the \
-modes specified for the primary head will be used for the secondary head.
-
-radeon.CloneHSync:\
-Set the horizontal sync range for the secondary monitor. It is not required if \
-a DDC capable monitor is connected. Default: undefined.
-
-radeon.CloneVRefresh:\
-Set the vertical refresh range for the secondary monitor. It is not required \
-if a DDC capable monitor is connected. Default: undefined.
-
-radeon.PanelOff:\
-Disable panel output. Only used when clone is enabled. Default: off.
-
-radeon.EnablePageFlip:\
-Enable page flipping for 3D acceleration. This will increase performance but \
-not work correctly in some rare cases. Default: off.
-
-
-!! NeoMagic options
-
-neo.StrangeLockups:\
-Before XFree86 version 4.2.0 many NeoMagic systems experienced \
-strange lockups unless they used the options \
-"XaaNoScanlineImageWriteRect" and "XaaNoScanlineCPUToScreenColorExpandFill". \
-Setting this to "No" is faster but will lock some machines. \
-Default: Yes.
-
-!! Vesa options
-vesa.ShadowFB:\
-Enable or disable use of the shadow framebuffer layer. See shadowfb(4)\
-for further information. Default: on.
-
-
-!! SiS Options
-sis.NoAccel:\
-Disable or enable acceleration. \
-Default: acceleration is enabled.
-
-!sis.HWcursor:\
-!Enable or disable the HW cursor. \
-!Default: on.
-
-!sis.SWcursor:\
-!The opposite of HWCursor. \
-!Default: on.
-
-sis.NoXVideo:\
-Disable XV (XVideo) extension support. \
-Default: off.
-
-sis.SetMClk:\
-Set the memory clock in MHz. \
-Default: autodetect.
-
-sis.PciRetry:\
-Enable or disable PCI retries. \
-Default: on.
-
-sis.TurboQueue:\
-Enable or disable TurboQueue mode. \
-Default: off for SIS530, on for the others.
-
-sis.FastVram:\
-Enable or disable FastVram mode. \
-Default: on.
-
-sis.Rotate:\
-Rotate the display clockwise (CW) or counterclockwise (CCW). \
-This mode is unaccelerated, and uses the Shadow Frame Buffer layer \
-Default: no rotation.
-
-sis.ForceCRT2Type:\
-Force display type to one of: TV, LCD or VGA. \
-Default: autodetect.
-
-sis.ShadowFB:\
-Enable or disable use of the shadow framebuffer layer. See shadowfb(4) for \
-further information. Default: off.
-
-!! Generic driver options, apply to many drivers
-
-*.SWcursor:\
-See also HWcursor.\
-Default: Usually Off.
-
-*.HWcursor:\
-Use the hardware cursor. See also SWcursor. \
-Default: usually HWcursor, but some drivers may default to software.
diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h
deleted file mode 100644
index 17bb21f4d..000000000
--- a/hw/xfree86/common/atKeynames.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.21 2003/10/09 11:43:59 pascal Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */
-
-#ifndef _ATKEYNAMES_H
-#define _ATKEYNAMES_H
-
-#define XK_TECHNICAL
-#define XK_KATAKANA
-#include "keysym.h"
-#include "XF86keysym.h"
-
-#define GLYPHS_PER_KEY 4
-#define NUM_KEYCODES 248
-#define MIN_KEYCODE 8
-#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1)
-
-#define AltMask Mod1Mask
-#define NumLockMask Mod2Mask
-#define AltLangMask Mod3Mask
-#define KanaMask Mod4Mask
-#define ScrollLockMask Mod5Mask
-
-#define KeyPressed(k) (keyc->down[k >> 3] & (1 << (k & 7)))
-#define ModifierDown(k) ((keyc->state & (k)) == (k))
-
-/*
- * NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three)
- * sets of scancodes. Set3 can only be generated by a MF keyboard.
- * Set2 sends a makecode for keypress, and the same code prefixed by a
- * F0 for keyrelease. This is a little bit ugly to handle. Thus we use
- * here for X386 the PC/XT compatible Set1. This set uses 8bit scancodes.
- * Bit 7 ist set if the key is released. The code E0 switches to a
- * different meaning to add the new MF cursorkeys, while not breaking old
- * applications. E1 is another special prefix. Since I assume that there
- * will be further versions of PC/XT scancode compatible keyboards, we
- * may be in trouble one day.
- *
- * IDEA: 1) Use Set2 on AT84 keyboards and translate it to MF Set3.
- * 2) Use the keyboards native set and translate it to common keysyms.
- */
-
-/*
- * definition of the AT84/MF101/MF102 Keyboard:
- * ============================================================
- * Defined Key Cap Glyphs Pressed value
- * Key Name Main Also (hex) (dec)
- * ---------------- ---------- ------- ------ ------
- */
-
-#define KEY_Escape /* Escape 0x01 */ 1
-#define KEY_1 /* 1 ! 0x02 */ 2
-#define KEY_2 /* 2 @ 0x03 */ 3
-#define KEY_3 /* 3 # 0x04 */ 4
-#define KEY_4 /* 4 $ 0x05 */ 5
-#define KEY_5 /* 5 % 0x06 */ 6
-#define KEY_6 /* 6 ^ 0x07 */ 7
-#define KEY_7 /* 7 & 0x08 */ 8
-#define KEY_8 /* 8 * 0x09 */ 9
-#define KEY_9 /* 9 ( 0x0a */ 10
-#define KEY_0 /* 0 ) 0x0b */ 11
-#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12
-#define KEY_Equal /* = (Equal) + 0x0d */ 13
-#define KEY_BackSpace /* Back Space 0x0e */ 14
-#define KEY_Tab /* Tab 0x0f */ 15
-#define KEY_Q /* Q 0x10 */ 16
-#define KEY_W /* W 0x11 */ 17
-#define KEY_E /* E 0x12 */ 18
-#define KEY_R /* R 0x13 */ 19
-#define KEY_T /* T 0x14 */ 20
-#define KEY_Y /* Y 0x15 */ 21
-#define KEY_U /* U 0x16 */ 22
-#define KEY_I /* I 0x17 */ 23
-#define KEY_O /* O 0x18 */ 24
-#define KEY_P /* P 0x19 */ 25
-#define KEY_LBrace /* [ { 0x1a */ 26
-#define KEY_RBrace /* ] } 0x1b */ 27
-#define KEY_Enter /* Enter 0x1c */ 28
-#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29
-#define KEY_A /* A 0x1e */ 30
-#define KEY_S /* S 0x1f */ 31
-#define KEY_D /* D 0x20 */ 32
-#define KEY_F /* F 0x21 */ 33
-#define KEY_G /* G 0x22 */ 34
-#define KEY_H /* H 0x23 */ 35
-#define KEY_J /* J 0x24 */ 36
-#define KEY_K /* K 0x25 */ 37
-#define KEY_L /* L 0x26 */ 38
-#define KEY_SemiColon /* ;(SemiColon) :(Colon) 0x27 */ 39
-#define KEY_Quote /* ' (Apostr) " (Quote) 0x28 */ 40
-#define KEY_Tilde /* ` (Accent) ~ (Tilde) 0x29 */ 41
-#define KEY_ShiftL /* Shift(left) 0x2a */ 42
-#define KEY_BSlash /* \(BckSlash) |(VertBar)0x2b */ 43
-#define KEY_Z /* Z 0x2c */ 44
-#define KEY_X /* X 0x2d */ 45
-#define KEY_C /* C 0x2e */ 46
-#define KEY_V /* V 0x2f */ 47
-#define KEY_B /* B 0x30 */ 48
-#define KEY_N /* N 0x31 */ 49
-#define KEY_M /* M 0x32 */ 50
-#define KEY_Comma /* , (Comma) < (Less) 0x33 */ 51
-#define KEY_Period /* . (Period) >(Greater)0x34 */ 52
-#define KEY_Slash /* / (Slash) ? 0x35 */ 53
-#define KEY_ShiftR /* Shift(right) 0x36 */ 54
-#define KEY_KP_Multiply /* * 0x37 */ 55
-#define KEY_Alt /* Alt(left) 0x38 */ 56
-#define KEY_Space /* (SpaceBar) 0x39 */ 57
-#define KEY_CapsLock /* CapsLock 0x3a */ 58
-#define KEY_F1 /* F1 0x3b */ 59
-#define KEY_F2 /* F2 0x3c */ 60
-#define KEY_F3 /* F3 0x3d */ 61
-#define KEY_F4 /* F4 0x3e */ 62
-#define KEY_F5 /* F5 0x3f */ 63
-#define KEY_F6 /* F6 0x40 */ 64
-#define KEY_F7 /* F7 0x41 */ 65
-#define KEY_F8 /* F8 0x42 */ 66
-#define KEY_F9 /* F9 0x43 */ 67
-#define KEY_F10 /* F10 0x44 */ 68
-#define KEY_NumLock /* NumLock 0x45 */ 69
-#define KEY_ScrollLock /* ScrollLock 0x46 */ 70
-#define KEY_KP_7 /* 7 Home 0x47 */ 71
-#define KEY_KP_8 /* 8 Up 0x48 */ 72
-#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
-#define KEY_KP_Minus /* - (Minus) 0x4a */ 74
-#define KEY_KP_4 /* 4 Left 0x4b */ 75
-#define KEY_KP_5 /* 5 0x4c */ 76
-#define KEY_KP_6 /* 6 Right 0x4d */ 77
-#define KEY_KP_Plus /* + (Plus) 0x4e */ 78
-#define KEY_KP_1 /* 1 End 0x4f */ 79
-#define KEY_KP_2 /* 2 Down 0x50 */ 80
-#define KEY_KP_3 /* 3 PgDown 0x51 */ 81
-#define KEY_KP_0 /* 0 Insert 0x52 */ 82
-#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
-#define KEY_SysReqest /* SysReqest 0x54 */ 84
- /* NOTUSED 0x55 */
-#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
-#define KEY_F11 /* F11 0x57 */ 87
-#define KEY_F12 /* F12 0x58 */ 88
-
-#define KEY_Prefix0 /* special 0x60 */ 96
-#define KEY_Prefix1 /* specail 0x61 */ 97
-
-/*
- * The 'scancodes' below are generated by the server, because the MF101/102
- * keyboard sends them as sequence of other scancodes
- */
-#define KEY_Home /* Home 0x59 */ 89
-#define KEY_Up /* Up 0x5a */ 90
-#define KEY_PgUp /* PgUp 0x5b */ 91
-#define KEY_Left /* Left 0x5c */ 92
-#define KEY_Begin /* Begin 0x5d */ 93
-#define KEY_Right /* Right 0x5e */ 94
-#define KEY_End /* End 0x5f */ 95
-#define KEY_Down /* Down 0x60 */ 96
-#define KEY_PgDown /* PgDown 0x61 */ 97
-#define KEY_Insert /* Insert 0x62 */ 98
-#define KEY_Delete /* Delete 0x63 */ 99
-#define KEY_KP_Enter /* Enter 0x64 */ 100
-#define KEY_RCtrl /* Ctrl(right) 0x65 */ 101
-#define KEY_Pause /* Pause 0x66 */ 102
-#define KEY_Print /* Print 0x67 */ 103
-#define KEY_KP_Divide /* Divide 0x68 */ 104
-#define KEY_AltLang /* AtlLang(right) 0x69 */ 105
-#define KEY_Break /* Break 0x6a */ 106
-#define KEY_LMeta /* Left Meta 0x6b */ 107
-#define KEY_RMeta /* Right Meta 0x6c */ 108
-#define KEY_Menu /* Menu 0x6d */ 109
-#define KEY_F13 /* F13 0x6e */ 110
-#define KEY_F14 /* F14 0x6f */ 111
-#define KEY_F15 /* F15 0x70 */ 112
-#define KEY_HKTG /* Hirugana/Katakana tog 0x70 */ 112
-#define KEY_F16 /* F16 0x71 */ 113
-#define KEY_F17 /* F17 0x72 */ 114
-#define KEY_KP_DEC /* KP_DEC 0x73 */ 115
-#define KEY_BSlash2 /* \ _ 0x73 */ 115
-#define KEY_KP_Equal /* Equal (Keypad) 0x76 */ 118
-#define KEY_XFER /* Kanji Transfer 0x79 */ 121
-#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
-#define KEY_Yen /* Yen 0x7d */ 125
-
-#define KEY_Power /* Power Key 0x84 */ 132
-#define KEY_Mute /* Audio Mute 0x85 */ 133
-#define KEY_AudioLower /* Audio Lower 0x86 */ 134
-#define KEY_AudioRaise /* Audio Raise 0x87 */ 135
-#define KEY_Help /* Help 0x88 */ 136
-#define KEY_L1 /* Stop 0x89 */ 137
-#define KEY_L2 /* Again 0x8a */ 138
-#define KEY_L3 /* Props 0x8b */ 139
-#define KEY_L4 /* Undo 0x8c */ 140
-#define KEY_L5 /* Front 0x8d */ 141
-#define KEY_L6 /* Copy 0x8e */ 142
-#define KEY_L7 /* Open 0x8f */ 143
-#define KEY_L8 /* Paste 0x90 */ 144
-#define KEY_L9 /* Find 0x91 */ 145
-#define KEY_L10 /* Cut 0x92 */ 146
-
-/*
- * Fake 'scancodes' in the following ranges are generated for 2-byte
- * codes not handled elsewhere. These correspond to most extended keys
- * on so-called "Internet" keyboards:
- *
- * 0x79-0x93
- * 0x96-0xa1
- * 0xa3-0xac
- * 0xb1-0xb4
- * 0xba-0xbd
- * 0xc2
- * 0xcc-0xd2
- * 0xd6-0xf7
- */
-
-/*
- * Remapped 'scancodes' are generated for single-byte codes in the range
- * 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards.
- */
-
-#define KEY_0x59 0x95
-#define KEY_0x5A 0xA2
-#define KEY_0x5B 0xAD
-#define KEY_0x5C KEY_KP_EQUAL
-#define KEY_0x5D 0xAE
-#define KEY_0x5E 0xAF
-#define KEY_0x5F 0xB0
-#define KEY_0x62 0xB5
-#define KEY_0x63 0xB6
-#define KEY_0x64 0xB7
-#define KEY_0x65 0xB8
-#define KEY_0x66 0xB9
-#define KEY_0x67 0xBE
-#define KEY_0x68 0xBF
-#define KEY_0x69 0xC0
-#define KEY_0x6A 0xC1
-#define KEY_0x6B 0xC3
-#define KEY_0x6C 0xC4
-#define KEY_0x6D 0xC5
-#define KEY_0x6E 0xC6
-#define KEY_0x6F 0xC7
-#define KEY_0x70 0xC8
-#define KEY_0x71 0xC9
-#define KEY_0x72 0xCA
-#define KEY_0x73 0xCB
-#define KEY_0x74 0xD3
-#define KEY_0x75 0xD4
-#define KEY_0x76 0xD5
-
-/* These are for "notused" and "unknown" entries in translation maps. */
-#define KEY_NOTUSED 0
-#define KEY_UNKNOWN 255
-
-#endif /* _ATKEYNAMES_H */
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
deleted file mode 100644
index bf9fbeee2..000000000
--- a/hw/xfree86/common/compiler.h
+++ /dev/null
@@ -1,1786 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.104 2003/11/03 05:11:01 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */
-
-#ifndef _COMPILER_H
-
-# if !defined(_XF86_ANSIC_H) && defined(XFree86Module)
-# error missing #include "xf86_ansic.h" before #include "compiler.h"
-# endif
-
-# define _COMPILER_H
-
-/* Allow drivers to use the GCC-supported __inline__ and/or __inline. */
-# ifndef __inline__
-# if defined(__GNUC__)
- /* gcc has __inline__ */
-# elif defined(__HIGHC__)
-# define __inline__ _Inline
-# else
-# define __inline__ /**/
-# endif
-# endif /* __inline__ */
-# ifndef __inline
-# if defined(__GNUC__)
- /* gcc has __inline */
-# elif defined(__HIGHC__)
-# define __inline _Inline
-# else
-# define __inline /**/
-# endif
-# endif /* __inline */
-
-# if defined(IODEBUG) && defined(__GNUC__)
-# define outb RealOutb
-# define outw RealOutw
-# define outl RealOutl
-# define inb RealInb
-# define inw RealInw
-# define inl RealInl
-# endif
-
-# if defined(QNX4) /* Do this for now to keep Watcom happy */
-# define outb outp
-# define outw outpw
-# define outl outpd
-# define inb inp
-# define inw inpw
-# define inl inpd
-
-/* Define the ffs function for inlining */
-extern int ffs(unsigned long);
-# pragma aux ffs_ = \
- "bsf edx, eax" \
- "jnz bits_set" \
- "xor eax, eax" \
- "jmp exit1" \
- "bits_set:" \
- "mov eax, edx" \
- "inc eax" \
- "exit1:" \
- __parm [eax] \
- __modify [eax edx] \
- __value [eax] \
- ;
-# endif
-
-# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
-
-# if !defined(__sparc__) && !defined(__arm32__) \
- && !(defined(__alpha__) && defined(linux))
-
-extern void outb(unsigned short, unsigned char);
-extern void outw(unsigned short, unsigned short);
-extern void outl(unsigned short, unsigned int);
-extern unsigned int inb(unsigned short);
-extern unsigned int inw(unsigned short);
-extern unsigned int inl(unsigned short);
-
-# else /* __sparc__, __arm32__, __alpha__*/
-
-extern void outb(unsigned long, unsigned char);
-extern void outw(unsigned long, unsigned short);
-extern void outl(unsigned long, unsigned int);
-extern unsigned int inb(unsigned long);
-extern unsigned int inw(unsigned long);
-extern unsigned int inl(unsigned long);
-
-# endif /* __sparc__, __arm32__, __alpha__ */
-
-extern unsigned long ldq_u(unsigned long *);
-extern unsigned long ldl_u(unsigned int *);
-extern unsigned long ldw_u(unsigned short *);
-extern void stq_u(unsigned long, unsigned long *);
-extern void stl_u(unsigned long, unsigned int *);
-extern void stw_u(unsigned long, unsigned short *);
-extern void mem_barrier(void);
-extern void write_mem_barrier(void);
-extern void stl_brx(unsigned long, volatile unsigned char *, int);
-extern void stw_brx(unsigned short, volatile unsigned char *, int);
-extern unsigned long ldl_brx(volatile unsigned char *, int);
-extern unsigned short ldw_brx(volatile unsigned char *, int);
-
-# endif
-
-# ifndef NO_INLINE
-# ifdef __GNUC__
-# if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
-
-# ifdef linux
-/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
-/* note that the appropriate setup via "ioperm" needs to be done */
-/* *before* any inx/outx is done. */
-
-extern void (*_alpha_outb)(char val, unsigned long port);
-static __inline__ void
-outb(unsigned long port, unsigned char val)
-{
- _alpha_outb(val, port);
-}
-
-extern void (*_alpha_outw)(short val, unsigned long port);
-static __inline__ void
-outw(unsigned long port, unsigned short val)
-{
- _alpha_outw(val, port);
-}
-
-extern void (*_alpha_outl)(int val, unsigned long port);
-static __inline__ void
-outl(unsigned long port, unsigned int val)
-{
- _alpha_outl(val, port);
-}
-
-extern unsigned int (*_alpha_inb)(unsigned long port);
-static __inline__ unsigned int
-inb(unsigned long port)
-{
- return _alpha_inb(port);
-}
-
-extern unsigned int (*_alpha_inw)(unsigned long port);
-static __inline__ unsigned int
-inw(unsigned long port)
-{
- return _alpha_inw(port);
-}
-
-extern unsigned int (*_alpha_inl)(unsigned long port);
-static __inline__ unsigned int
-inl(unsigned long port)
-{
- return _alpha_inl(port);
-}
-
-# endif /* linux */
-
-# if (defined(__FreeBSD__) || defined(__OpenBSD__)) \
- && !defined(DO_PROTOTYPES)
-
-/* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */
-/* inx/outx routines */
-/* note that the appropriate setup via "ioperm" needs to be done */
-/* *before* any inx/outx is done. */
-
-extern void outb(unsigned int port, unsigned char val);
-extern void outw(unsigned int port, unsigned short val);
-extern void outl(unsigned int port, unsigned int val);
-extern unsigned char inb(unsigned int port);
-extern unsigned short inw(unsigned int port);
-extern unsigned int inl(unsigned int port);
-
-# endif /* (__FreeBSD__ || __OpenBSD__ ) && !DO_PROTOTYPES */
-
-
-#if defined(__NetBSD__)
-#include <machine/pio.h>
-#endif /* __NetBSD__ */
-
-/*
- * inline functions to do unaligned accesses
- * from linux/include/asm-alpha/unaligned.h
- */
-
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads. Define some
- * packed structures to talk about such things with.
- */
-
-struct __una_u64 { unsigned long x __attribute__((packed)); };
-struct __una_u32 { unsigned int x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-
-/*
- * Elemental unaligned loads
- */
-/* let's try making these things static */
-
-static __inline__ unsigned long ldq_u(unsigned long * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
- return ptr->x;
-# else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extql %0,%2,%0\n\t"
- "extqh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(7+(char *) r11)));
- return r1 | r2;
-# endif
-}
-
-static __inline__ unsigned long ldl_u(unsigned int * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
- return ptr->x;
-# else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extll %0,%2,%0\n\t"
- "extlh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(3+(char *) r11)));
- return r1 | r2;
-# endif
-}
-
-static __inline__ unsigned long ldw_u(unsigned short * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
- return ptr->x;
-# else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extwl %0,%2,%0\n\t"
- "extwh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(1+(char *) r11)));
- return r1 | r2;
-# endif
-}
-
-/*
- * Elemental unaligned stores
- */
-
-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u64 *ptr = (struct __una_u64 *) r11;
- ptr->x = r5;
-# else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "insqh %6,%7,%5\n\t"
- "insql %6,%7,%4\n\t"
- "mskqh %3,%7,%3\n\t"
- "mskql %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(7+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-# endif
-}
-
-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u32 *ptr = (struct __una_u32 *) r11;
- ptr->x = r5;
-# else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inslh %6,%7,%5\n\t"
- "insll %6,%7,%4\n\t"
- "msklh %3,%7,%3\n\t"
- "mskll %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(3+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-# endif
-}
-
-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u16 *ptr = (struct __una_u16 *) r11;
- ptr->x = r5;
-# else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inswh %6,%7,%5\n\t"
- "inswl %6,%7,%4\n\t"
- "mskwh %3,%7,%3\n\t"
- "mskwl %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(1+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-# endif
-}
-
-/* to flush the I-cache before jumping to code which just got loaded */
-# define PAL_imb 134
-# define istream_mem_barrier() \
- __asm__ __volatile__("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
-# define mem_barrier() __asm__ __volatile__("mb" : : : "memory")
-# ifdef __ELF__
-# define write_mem_barrier() __asm__ __volatile__("wmb" : : : "memory")
-# else /* ECOFF gas 2.6 doesn't know "wmb" :-( */
-# define write_mem_barrier() mem_barrier()
-# endif
-
-
-# elif defined(linux) && defined(__ia64__)
-
-# include <inttypes.h>
-
-# include <sys/io.h>
-
-struct __una_u64 { uint64_t x __attribute__((packed)); };
-struct __una_u32 { uint32_t x __attribute__((packed)); };
-struct __una_u16 { uint16_t x __attribute__((packed)); };
-
-static __inline__ unsigned long
-__uldq (const unsigned long * r11)
-{
- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
- return ptr->x;
-}
-
-static __inline__ unsigned long
-__uldl (const unsigned int * r11)
-{
- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
- return ptr->x;
-}
-
-static __inline__ unsigned long
-__uldw (const unsigned short * r11)
-{
- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
- return ptr->x;
-}
-
-static __inline__ void
-__ustq (unsigned long r5, unsigned long * r11)
-{
- struct __una_u64 *ptr = (struct __una_u64 *) r11;
- ptr->x = r5;
-}
-
-static __inline__ void
-__ustl (unsigned long r5, unsigned int * r11)
-{
- struct __una_u32 *ptr = (struct __una_u32 *) r11;
- ptr->x = r5;
-}
-
-static __inline__ void
-__ustw (unsigned long r5, unsigned short * r11)
-{
- struct __una_u16 *ptr = (struct __una_u16 *) r11;
- ptr->x = r5;
-}
-
-# define ldq_u(p) __uldq(p)
-# define ldl_u(p) __uldl(p)
-# define ldw_u(p) __uldw(p)
-# define stq_u(v,p) __ustq(v,p)
-# define stl_u(v,p) __ustl(v,p)
-# define stw_u(v,p) __ustw(v,p)
-
-# ifndef __INTEL_COMPILER
-# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
-# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
-# else
-# include "ia64intrin.h"
-# define mem_barrier() __mf()
-# define write_mem_barrier() __mf()
-# endif
-
-/*
- * This is overkill, but for different reasons depending on where it is used.
- * This is thus general enough to be used everywhere cache flushes are needed.
- * It doesn't handle memory access serialisation by other processors, though.
- */
-# ifndef __INTEL_COMPILER
-# define ia64_flush_cache(Addr) \
- __asm__ __volatile__ ( \
- "fc %0;;;" \
- "sync.i;;;" \
- "mf;;;" \
- "srlz.i;;;" \
- :: "r"(Addr) : "memory")
-# else
-# define ia64_flush_cache(Addr) { \
- __fc(Addr);\
- __synci();\
- __mf();\
- __isrlz();\
- }
-# endif
-# undef outb
-# undef outw
-# undef outl
-
-# define outb(a,b) _outb(b,a)
-# define outw(a,b) _outw(b,a)
-# define outl(a,b) _outl(b,a)
-
-# elif defined(linux) && defined(__AMD64__)
-
-# include <inttypes.h>
-
-# define ldq_u(p) (*((unsigned long *)(p)))
-# define ldl_u(p) (*((unsigned int *)(p)))
-# define ldw_u(p) (*((unsigned short *)(p)))
-# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
-# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
-# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
-
-# define mem_barrier() \
- __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
-# define write_mem_barrier() \
- __asm__ __volatile__ ("": : :"memory")
-
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
- __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
-}
-
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
- __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
- __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- unsigned char ret;
- __asm__ __volatile__("inb %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- unsigned short ret;
- __asm__ __volatile__("inw %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- unsigned int ret;
- __asm__ __volatile__("inl %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__)
-
-# if !defined(Lynx)
-# ifndef ASI_PL
-# define ASI_PL 0x88
-# endif
-
-# define barrier() __asm__ __volatile__(".word 0x8143e00a": : :"memory")
-
-static __inline__ void
-outb(unsigned long port, unsigned char val)
-{
- __asm__ __volatile__("stba %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (port), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ void
-outw(unsigned long port, unsigned short val)
-{
- __asm__ __volatile__("stha %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (port), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ void
-outl(unsigned long port, unsigned int val)
-{
- __asm__ __volatile__("sta %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (port), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ unsigned int
-inb(unsigned long port)
-{
- unsigned int ret;
- __asm__ __volatile__("lduba [%1] %2, %0"
- : "=r" (ret)
- : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned long port)
-{
- unsigned int ret;
- __asm__ __volatile__("lduha [%1] %2, %0"
- : "=r" (ret)
- : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned long port)
-{
- unsigned int ret;
- __asm__ __volatile__("lda [%1] %2, %0"
- : "=r" (ret)
- : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned char
-xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned char ret;
-
- __asm__ __volatile__("lduba [%1] %2, %0"
- : "=r" (ret)
- : "r" (addr), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned short
-xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned short ret;
-
- __asm__ __volatile__("lduh [%1], %0"
- : "=r" (ret)
- : "r" (addr));
- return ret;
-}
-
-static __inline__ unsigned short
-xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned short ret;
-
- __asm__ __volatile__("lduha [%1] %2, %0"
- : "=r" (ret)
- : "r" (addr), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned int
-xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned int ret;
-
- __asm__ __volatile__("ld [%1], %0"
- : "=r" (ret)
- : "r" (addr));
- return ret;
-}
-
-static __inline__ unsigned int
-xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned int ret;
-
- __asm__ __volatile__("lda [%1] %2, %0"
- : "=r" (ret)
- : "r" (addr), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ void
-xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("stba %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ void
-xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("sth %0, [%1]"
- : /* No outputs */
- : "r" (val), "r" (addr));
- barrier();
-}
-
-static __inline__ void
-xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("stha %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ void
-xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("st %0, [%1]"
- : /* No outputs */
- : "r" (val), "r" (addr));
- barrier();
-}
-
-static __inline__ void
-xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("sta %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
- barrier();
-}
-
-static __inline__ void
-xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("stba %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
-}
-
-static __inline__ void
-xf86WriteMmio16BeNB(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("sth %0, [%1]"
- : /* No outputs */
- : "r" (val), "r" (addr));
-}
-
-static __inline__ void
-xf86WriteMmio16LeNB(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("stha %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
-}
-
-static __inline__ void
-xf86WriteMmio32BeNB(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("st %0, [%1]"
- : /* No outputs */
- : "r" (val), "r" (addr));
-}
-
-static __inline__ void
-xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("sta %0, [%1] %2"
- : /* No outputs */
- : "r" (val), "r" (addr), "i" (ASI_PL));
-}
-
-# endif /* !Lynx */
-
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads. Define some
- * packed structures to talk about such things with.
- */
-
-# if defined(__arch64__) || defined(__sparcv9)
-struct __una_u64 { unsigned long x __attribute__((packed)); };
-# endif
-struct __una_u32 { unsigned int x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-
-static __inline__ unsigned long ldq_u(unsigned long *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
-# if defined(__arch64__) || defined(__sparcv9)
- const struct __una_u64 *ptr = (const struct __una_u64 *) p;
-# else
- const struct __una_u32 *ptr = (const struct __una_u32 *) p;
-# endif
- return ptr->x;
-# else
- unsigned long ret;
- memmove(&ret, p, sizeof(*p));
- return ret;
-# endif
-}
-
-static __inline__ unsigned long ldl_u(unsigned int *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u32 *ptr = (const struct __una_u32 *) p;
- return ptr->x;
-# else
- unsigned int ret;
- memmove(&ret, p, sizeof(*p));
- return ret;
-# endif
-}
-
-static __inline__ unsigned long ldw_u(unsigned short *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u16 *ptr = (const struct __una_u16 *) p;
- return ptr->x;
-# else
- unsigned short ret;
- memmove(&ret, p, sizeof(*p));
- return ret;
-# endif
-}
-
-static __inline__ void stq_u(unsigned long val, unsigned long *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
-# if defined(__arch64__) || defined(__sparcv9)
- struct __una_u64 *ptr = (struct __una_u64 *) p;
-# else
- struct __una_u32 *ptr = (struct __una_u32 *) p;
-# endif
- ptr->x = val;
-# else
- unsigned long tmp = val;
- memmove(p, &tmp, sizeof(*p));
-# endif
-}
-
-static __inline__ void stl_u(unsigned long val, unsigned int *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u32 *ptr = (struct __una_u32 *) p;
- ptr->x = val;
-# else
- unsigned int tmp = val;
- memmove(p, &tmp, sizeof(*p));
-# endif
-}
-
-static __inline__ void stw_u(unsigned long val, unsigned short *p)
-{
-# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u16 *ptr = (struct __una_u16 *) p;
- ptr->x = val;
-# else
- unsigned short tmp = val;
- memmove(p, &tmp, sizeof(*p));
-# endif
-}
-
-# define mem_barrier() /* XXX: nop for now */
-# define write_mem_barrier() /* XXX: nop for now */
-
-# elif defined(__mips__) || defined(__arm32__)
-#ifdef __arm32__
-#define PORT_SIZE long
-#else
-#define PORT_SIZE short
-#endif
-
-unsigned int IOPortBase; /* Memory mapped I/O port area */
-
-static __inline__ void
-outb(unsigned PORT_SIZE port, unsigned char val)
-{
- *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val;
-}
-
-static __inline__ void
-outw(unsigned PORT_SIZE port, unsigned short val)
-{
- *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val;
-}
-
-static __inline__ void
-outl(unsigned PORT_SIZE port, unsigned int val)
-{
- *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val;
-}
-
-static __inline__ unsigned int
-inb(unsigned PORT_SIZE port)
-{
- return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase);
-}
-
-static __inline__ unsigned int
-inw(unsigned PORT_SIZE port)
-{
- return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase);
-}
-
-static __inline__ unsigned int
-inl(unsigned PORT_SIZE port)
-{
- return *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase);
-}
-
-
-# if defined(__mips__)
-static __inline__ unsigned long ldq_u(unsigned long * r11)
-{
- unsigned long r1;
- __asm__("lwr %0,%2\n\t"
- "lwl %0,%3\n\t"
- :"=&r" (r1)
- :"r" (r11),
- "m" (*r11),
- "m" (*(unsigned long *)(3+(char *) r11)));
- return r1;
-}
-
-static __inline__ unsigned long ldl_u(unsigned int * r11)
-{
- unsigned long r1;
- __asm__("lwr %0,%2\n\t"
- "lwl %0,%3\n\t"
- :"=&r" (r1)
- :"r" (r11),
- "m" (*r11),
- "m" (*(unsigned long *)(3+(char *) r11)));
- return r1;
-}
-
-static __inline__ unsigned long ldw_u(unsigned short * r11)
-{
- unsigned long r1;
- __asm__("lwr %0,%2\n\t"
- "lwl %0,%3\n\t"
- :"=&r" (r1)
- :"r" (r11),
- "m" (*r11),
- "m" (*(unsigned long *)(1+(char *) r11)));
- return r1;
-}
-
-# ifdef linux /* don't mess with other OSs */
-
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads (and we don't support older
- * versions anyway. Define some packed structures to talk about such things
- * with.
- */
-
-struct __una_u32 { unsigned int x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-
-static __inline__ void stw_u(unsigned long val, unsigned short *p)
-{
- struct __una_u16 *ptr = (struct __una_u16 *) p;
- ptr->x = val;
-}
-
-static __inline__ void stl_u(unsigned long val, unsigned int *p)
-{
- struct __una_u32 *ptr = (struct __una_u32 *) p;
- ptr->x = val;
-}
-
-# if X_BYTE_ORDER == X_BIG_ENDIAN
-static __inline__ unsigned int
-xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
-{
- unsigned long addr = ((unsigned long)base) + offset;
- unsigned int ret;
-
- __asm__ __volatile__("lw %0, 0(%1)"
- : "=r" (ret)
- : "r" (addr));
- return ret;
-}
-
-static __inline__ void
-xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- unsigned long addr = ((unsigned long)base) + offset;
-
- __asm__ __volatile__("sw %0, 0(%1)"
- : /* No outputs */
- : "r" (val), "r" (addr));
-}
-# endif
-
-# define mem_barrier() \
- __asm__ __volatile__( \
- "# prevent instructions being moved around\n\t" \
- ".set\tnoreorder\n\t" \
- "# 8 nops to fool the R4400 pipeline\n\t" \
- "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
- ".set\treorder" \
- : /* no output */ \
- : /* no input */ \
- : "memory")
-# define write_mem_barrier() mem_barrier()
-
-# else /* !linux */
-
-# define stq_u(v,p) stl_u(v,p)
-# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
- (*(unsigned char *)(p)+1) = ((v) >> 8); \
- (*(unsigned char *)(p)+2) = ((v) >> 16); \
- (*(unsigned char *)(p)+3) = ((v) >> 24)
-
-# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
- (*(unsigned char *)(p)+1) = ((v) >> 8)
-
-# define mem_barrier() /* NOP */
-# endif /* !linux */
-# endif /* __mips__ */
-
-# if defined(__arm32__)
-# define ldq_u(p) (*((unsigned long *)(p)))
-# define ldl_u(p) (*((unsigned int *)(p)))
-# define ldw_u(p) (*((unsigned short *)(p)))
-# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
-# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
-# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-# endif /* __arm32__ */
-
-# elif (defined(Lynx) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__)) && defined(__powerpc__)
-
-# ifndef MAP_FAILED
-# define MAP_FAILED ((void *)-1)
-# endif
-
-extern volatile unsigned char *ioBase;
-
-# define eieio() __asm__ __volatile__ ("eieio" ::: "memory")
-
-static __inline__ unsigned char
-xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
-{
- register unsigned char val;
- __asm__ __volatile__(
- "lbzx %0,%1,%2\n\t"
- "eieio"
- : "=r" (val)
- : "b" (base), "r" (offset),
- "m" (*((volatile unsigned char *)base+offset)));
- return val;
-}
-
-static __inline__ unsigned short
-xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
-{
- register unsigned short val;
- __asm__ __volatile__(
- "lhzx %0,%1,%2\n\t"
- "eieio"
- : "=r" (val)
- : "b" (base), "r" (offset),
- "m" (*((volatile unsigned char *)base+offset)));
- return val;
-}
-
-static __inline__ unsigned short
-xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
-{
- register unsigned short val;
- __asm__ __volatile__(
- "lhbrx %0,%1,%2\n\t"
- "eieio"
- : "=r" (val)
- : "b" (base), "r" (offset),
- "m" (*((volatile unsigned char *)base+offset)));
- return val;
-}
-
-static __inline__ unsigned int
-xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
-{
- register unsigned int val;
- __asm__ __volatile__(
- "lwzx %0,%1,%2\n\t"
- "eieio"
- : "=r" (val)
- : "b" (base), "r" (offset),
- "m" (*((volatile unsigned char *)base+offset)));
- return val;
-}
-
-static __inline__ unsigned int
-xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
-{
- register unsigned int val;
- __asm__ __volatile__(
- "lwbrx %0,%1,%2\n\t"
- "eieio"
- : "=r" (val)
- : "b" (base), "r" (offset),
- "m" (*((volatile unsigned char *)base+offset)));
- return val;
-}
-
-static __inline__ void
-xf86WriteMmioNB8(__volatile__ void *base, const unsigned long offset,
- const unsigned char val)
-{
- __asm__ __volatile__(
- "stbx %1,%2,%3\n\t"
- : "=m" (*((volatile unsigned char *)base+offset))
- : "r" (val), "b" (base), "r" (offset));
-}
-
-static __inline__ void
-xf86WriteMmioNB16Le(__volatile__ void *base, const unsigned long offset,
- const unsigned short val)
-{
- __asm__ __volatile__(
- "sthbrx %1,%2,%3\n\t"
- : "=m" (*((volatile unsigned char *)base+offset))
- : "r" (val), "b" (base), "r" (offset));
-}
-
-static __inline__ void
-xf86WriteMmioNB16Be(__volatile__ void *base, const unsigned long offset,
- const unsigned short val)
-{
- __asm__ __volatile__(
- "sthx %1,%2,%3\n\t"
- : "=m" (*((volatile unsigned char *)base+offset))
- : "r" (val), "b" (base), "r" (offset));
-}
-
-static __inline__ void
-xf86WriteMmioNB32Le(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- __asm__ __volatile__(
- "stwbrx %1,%2,%3\n\t"
- : "=m" (*((volatile unsigned char *)base+offset))
- : "r" (val), "b" (base), "r" (offset));
-}
-
-static __inline__ void
-xf86WriteMmioNB32Be(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- __asm__ __volatile__(
- "stwx %1,%2,%3\n\t"
- : "=m" (*((volatile unsigned char *)base+offset))
- : "r" (val), "b" (base), "r" (offset));
-}
-
-static __inline__ void
-xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
- const unsigned char val)
-{
- xf86WriteMmioNB8(base, offset, val);
- eieio();
-}
-
-static __inline__ void
-xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
- const unsigned short val)
-{
- xf86WriteMmioNB16Le(base, offset, val);
- eieio();
-}
-
-static __inline__ void
-xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
- const unsigned short val)
-{
- xf86WriteMmioNB16Be(base, offset, val);
- eieio();
-}
-
-static __inline__ void
-xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- xf86WriteMmioNB32Le(base, offset, val);
- eieio();
-}
-
-static __inline__ void
-xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
- const unsigned int val)
-{
- xf86WriteMmioNB32Be(base, offset, val);
- eieio();
-}
-
-
-static __inline__ void
-outb(unsigned short port, unsigned char value)
-{
- if(ioBase == MAP_FAILED) return;
- xf86WriteMmio8((void *)ioBase, port, value);
-}
-
-static __inline__ void
-outw(unsigned short port, unsigned short value)
-{
- if(ioBase == MAP_FAILED) return;
- xf86WriteMmio16Le((void *)ioBase, port, value);
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int value)
-{
- if(ioBase == MAP_FAILED) return;
- xf86WriteMmio32Le((void *)ioBase, port, value);
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- if(ioBase == MAP_FAILED) return 0;
- return xf86ReadMmio8((void *)ioBase, port);
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- if(ioBase == MAP_FAILED) return 0;
- return xf86ReadMmio16Le((void *)ioBase, port);
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- if(ioBase == MAP_FAILED) return 0;
- return xf86ReadMmio32Le((void *)ioBase, port);
-}
-
-# define ldq_u(p) ldl_u(p)
-# define ldl_u(p) ((*(unsigned char *)(p)) | \
- (*((unsigned char *)(p)+1)<<8) | \
- (*((unsigned char *)(p)+2)<<16) | \
- (*((unsigned char *)(p)+3)<<24))
-# define ldw_u(p) ((*(unsigned char *)(p)) | \
- (*((unsigned char *)(p)+1)<<8))
-
-# define stq_u(v,p) stl_u(v,p)
-# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
- (*((unsigned char *)(p)+1)) = ((v) >> 8); \
- (*((unsigned char *)(p)+2)) = ((v) >> 16); \
- (*((unsigned char *)(p)+3)) = ((v) >> 24)
-# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
- (*((unsigned char *)(p)+1)) = ((v) >> 8)
-
-# define mem_barrier() eieio()
-# define write_mem_barrier() eieio()
-
-# else /* ix86 */
-
-# define ldq_u(p) (*((unsigned long *)(p)))
-# define ldl_u(p) (*((unsigned int *)(p)))
-# define ldw_u(p) (*((unsigned short *)(p)))
-# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
-# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
-# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-
-# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)
-# ifdef GCCUSESGAS
-
-/*
- * If gcc uses gas rather than the native assembler, the syntax of these
- * inlines has to be different. DHD
- */
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
- __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
-}
-
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
- __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
- __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- unsigned char ret;
- __asm__ __volatile__("inb %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- unsigned short ret;
- __asm__ __volatile__("inw %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- unsigned int ret;
- __asm__ __volatile__("inl %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-# else /* GCCUSESGAS */
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
- __asm__ __volatile__("out%B0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
- __asm__ __volatile__("out%W0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
- __asm__ __volatile__("out%L0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- unsigned char ret;
- __asm__ __volatile__("in%B0 (%1)" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- unsigned short ret;
- __asm__ __volatile__("in%W0 (%1)" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- unsigned int ret;
- __asm__ __volatile__("in%L0 (%1)" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-# endif /* GCCUSESGAS */
-
-# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)*/
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
-}
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- return 0;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- return 0;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- return 0;
-}
-
-# endif /* FAKEIT */
-
-# endif /* ix86 */
-
-# elif defined(__powerpc__) /* && !__GNUC__ */
-/*
- * NON-GCC PowerPC - Presumed to be PowerMAX OS for now
- */
-# ifndef PowerMAX_OS
-# error - Non-gcc PowerPC and !PowerMAXOS ???
-# endif
-
-# define PPCIO_DEBUG 0
-# define PPCIO_INLINE 1
-# define USE_ABS_MACRO 1
-/*
- * Use compiler intrinsics to access certain PPC machine instructions
- */
-# define eieio() __inst_eieio()
-# define stw_brx(val,base,ndx) __inst_sthbrx(val,base,ndx)
-# define stl_brx(val,base,ndx) __inst_stwbrx(val,base,ndx)
-# define ldw_brx(base,ndx) __inst_lhbrx(base,ndx)
-# define ldl_brx(base,ndx) __inst_lwbrx(base,ndx)
-
-# define ldq_u(p) (*((unsigned long long *)(p)))
-# define ldl_u(p) (*((unsigned long *)(p)))
-# define ldw_u(p) (*((unsigned short *)(p)))
-# define stq_u(v,p) (*(unsigned long long *)(p)) = (v)
-# define stl_u(v,p) (*(unsigned long *)(p)) = (v)
-# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
-# define mem_barrier() eieio()
-# define write_mem_barrier() eieio()
-
-extern volatile unsigned char *ioBase;
-
-# if !defined(abs) && defined(USE_ABS_MACRO)
-# define abs(x) ((x) >= 0 ? (x) : -(x))
-# endif
-
-# undef inb
-# undef inw
-# undef inl
-# undef outb
-# undef outw
-# undef outl
-
-# if PPCIO_DEBUG
-
-extern void debug_outb(unsigned int a, unsigned char b, int line, char *file);
-extern void debug_outw(unsigned int a, unsigned short w, int line, char *file);
-extern void debug_outl(unsigned int a, unsigned int l, int line, char *file);
-extern unsigned char debug_inb(unsigned int a, int line, char *file);
-extern unsigned short debug_inw(unsigned int a, int line, char *file);
-extern unsigned int debug_inl(unsigned int a, int line, char *file);
-
-# define outb(a,b) debug_outb(a,b, __LINE__, __FILE__)
-# define outw(a,w) debug_outw(a,w, __LINE__, __FILE__)
-# define outl(a,l) debug_outl(a,l, __LINE__, __FILE__)
-# define inb(a) debug_inb(a, __LINE__, __FILE__)
-# define inw(a) debug_inw(a, __LINE__, __FILE__)
-# define inl(a) debug_inl(a, __LINE__, __FILE__)
-
-# else /* !PPCIO_DEBUG */
-
-extern unsigned char inb(unsigned int a);
-extern unsigned short inw(unsigned int a);
-extern unsigned int inl(unsigned int a);
-
-# if PPCIO_INLINE
-
-# define outb(a,b) \
- (*((volatile unsigned char *)(ioBase + (a))) = (b), eieio())
-# define outw(a,w) (stw_brx((w),ioBase,(a)), eieio())
-# define outl(a,l) (stl_brx((l),ioBase,(a)), eieio())
-
-# else /* !PPCIO_INLINE */
-
-extern void outb(unsigned int a, unsigned char b);
-extern void outw(unsigned int a, unsigned short w);
-extern void outl(unsigned int a, unsigned int l);
-
-# endif /* PPCIO_INLINE */
-
-# endif /* !PPCIO_DEBUG */
-
-# else /* !GNUC && !PPC */
-# if !defined(QNX4)
-# if defined(__STDC__) && (__STDC__ == 1)
-# ifndef asm
-# define asm __asm
-# endif
-# endif
-# ifdef SVR4
-#if 0
-# include <sys/types.h>
-#endif
-# ifndef __HIGHC__
-# ifndef __USLC__
-# define __USLC__
-# endif
-# endif
-# endif
-# ifndef SCO325
-# if defined(USL)
-# if defined(IN_MODULE)
-# /* avoid including <sys/types.h> for <sys/inline.h> on UnixWare */
-# define ushort unsigned short
-# define ushort_t unsigned short
-# define ulong unsigned long
-# define ulong_t unsigned long
-# define uint_t unsigned int
-# define uchar_t unsigned char
-# else
-# include <sys/types.h>
-# endif /* IN_MODULE */
-# endif /* USL */
-# ifndef sgi
-# include <sys/inline.h>
-# endif
-# else
-# include "scoasm.h"
-# endif
-# if !defined(__HIGHC__) && !defined(SCO325) && !defined(sgi)
-# pragma asm partial_optimization outl
-# pragma asm partial_optimization outw
-# pragma asm partial_optimization outb
-# pragma asm partial_optimization inl
-# pragma asm partial_optimization inw
-# pragma asm partial_optimization inb
-# endif
-# endif
-# define ldq_u(p) (*((unsigned long *)(p)))
-# define ldl_u(p) (*((unsigned int *)(p)))
-# define ldw_u(p) (*((unsigned short *)(p)))
-# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
-# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
-# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-# endif /* __GNUC__ */
-
-# if defined(QNX4)
-# include <sys/types.h>
-extern unsigned inb(unsigned port);
-extern unsigned inw(unsigned port);
-extern unsigned inl(unsigned port);
-extern void outb(unsigned port, unsigned val);
-extern void outw(unsigned port, unsigned val);
-extern void outl(unsigned port, unsigned val);
-# endif /* QNX4 */
-
-# if defined(IODEBUG) && defined(__GNUC__)
-# undef inb
-# undef inw
-# undef inl
-# undef outb
-# undef outw
-# undef outl
-# define inb(a) __extension__ ({unsigned char __c=RealInb(a); ErrorF("inb(0x%03x) = 0x%02x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-# define inw(a) __extension__ ({unsigned short __c=RealInw(a); ErrorF("inw(0x%03x) = 0x%04x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-# define inl(a) __extension__ ({unsigned int __c=RealInl(a); ErrorF("inl(0x%03x) = 0x%08x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-
-# define outb(a,b) (ErrorF("outb(0x%03x, 0x%02x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutb(a,b))
-# define outw(a,b) (ErrorF("outw(0x%03x, 0x%04x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutw(a,b))
-# define outl(a,b) (ErrorF("outl(0x%03x, 0x%08x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutl(a,b))
-# endif
-
-# endif /* NO_INLINE */
-
-# ifdef __alpha__
-/* entry points for Mmio memory access routines */
-extern int (*xf86ReadMmio8)(void *, unsigned long);
-extern int (*xf86ReadMmio16)(void *, unsigned long);
-extern int (*xf86ReadMmio32)(void *, unsigned long);
-extern void (*xf86WriteMmio8)(int, void *, unsigned long);
-extern void (*xf86WriteMmio16)(int, void *, unsigned long);
-extern void (*xf86WriteMmio32)(int, void *, unsigned long);
-extern void (*xf86WriteMmioNB8)(int, void *, unsigned long);
-extern void (*xf86WriteMmioNB16)(int, void *, unsigned long);
-extern void (*xf86WriteMmioNB32)(int, void *, unsigned long);
-extern void xf86JensenMemToBus(char *, long, long, int);
-extern void xf86JensenBusToMem(char *, char *, unsigned long, int);
-extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
-extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
-
-/* Some macros to hide the system dependencies for MMIO accesses */
-/* Changed to kill noise generated by gcc's -Wcast-align */
-# define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset)
-# define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset)
-# define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset)
-
-# if defined (JENSEN_SUPPORT)
-# define MMIO_OUT32(base, offset, val) \
- (*xf86WriteMmio32)((CARD32)(val), base, offset)
-# define MMIO_ONB32(base, offset, val) \
- (*xf86WriteMmioNB32)((CARD32)(val), base, offset)
-# else
-# define MMIO_OUT32(base, offset, val) \
- do { \
- write_mem_barrier(); \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \
- } while (0)
-# define MMIO_ONB32(base, offset, val) \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
-# endif
-
-# define MMIO_OUT8(base, offset, val) \
- (*xf86WriteMmio8)((CARD8)(val), base, offset)
-# define MMIO_OUT16(base, offset, val) \
- (*xf86WriteMmio16)((CARD16)(val), base, offset)
-# define MMIO_ONB8(base, offset, val) \
- (*xf86WriteMmioNB8)((CARD8)(val), base, offset)
-# define MMIO_ONB16(base, offset, val) \
- (*xf86WriteMmioNB16)((CARD16)(val), base, offset)
-# define MMIO_MOVE32(base, offset, val) \
- MMIO_OUT32(base, offset, val)
-
-# elif defined(__powerpc__)
- /*
- * we provide byteswapping and no byteswapping functions here
- * with byteswapping as default,
- * drivers that don't need byteswapping should define PPC_MMIO_IS_BE
- */
-# define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset)
-# define MMIO_OUT8(base, offset, val) \
- xf86WriteMmio8(base, offset, (CARD8)(val))
-# define MMIO_ONB8(base, offset, val) \
- xf86WriteMmioNB8(base, offset, (CARD8)(val))
-
-# if defined(PPC_MMIO_IS_BE) /* No byteswapping */
-# define MMIO_IN16(base, offset) xf86ReadMmio16Be(base, offset)
-# define MMIO_IN32(base, offset) xf86ReadMmio32Be(base, offset)
-# define MMIO_OUT16(base, offset, val) \
- xf86WriteMmio16Be(base, offset, (CARD16)(val))
-# define MMIO_OUT32(base, offset, val) \
- xf86WriteMmio32Be(base, offset, (CARD32)(val))
-# define MMIO_ONB16(base, offset, val) \
- xf86WriteMmioNB16Be(base, offset, (CARD16)(val))
-# define MMIO_ONB32(base, offset, val) \
- xf86WriteMmioNB32Be(base, offset, (CARD32)(val))
-# else /* byteswapping is the default */
-# define MMIO_IN16(base, offset) xf86ReadMmio16Le(base, offset)
-# define MMIO_IN32(base, offset) xf86ReadMmio32Le(base, offset)
-# define MMIO_OUT16(base, offset, val) \
- xf86WriteMmio16Le(base, offset, (CARD16)(val))
-# define MMIO_OUT32(base, offset, val) \
- xf86WriteMmio32Le(base, offset, (CARD32)(val))
-# define MMIO_ONB16(base, offset, val) \
- xf86WriteMmioNB16Le(base, offset, (CARD16)(val))
-# define MMIO_ONB32(base, offset, val) \
- xf86WriteMmioNB32Le(base, offset, (CARD32)(val))
-# endif
-
-# define MMIO_MOVE32(base, offset, val) \
- xf86WriteMmio32Be(base, offset, (CARD32)(val))
-
-static __inline__ void ppc_flush_icache(char *addr)
-{
- __asm__ volatile (
- "dcbf 0,%0;"
- "sync;"
- "icbi 0,%0;"
- "sync;"
- "isync;"
- : : "r"(addr) : "memory");
-}
-
-# elif defined(__sparc__)
- /*
- * Like powerpc, we provide byteswapping and no byteswapping functions
- * here with byteswapping as default, drivers that don't need byteswapping
- * should define SPARC_MMIO_IS_BE (perhaps create a generic macro so that we
- * do not need to use PPC_MMIO_IS_BE and the sparc one in all the same places
- * of drivers?).
- */
-# define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset)
-# define MMIO_OUT8(base, offset, val) \
- xf86WriteMmio8(base, offset, (CARD8)(val))
-# define MMIO_ONB8(base, offset, val) \
- xf86WriteMmio8NB(base, offset, (CARD8)(val))
-
-# if defined(SPARC_MMIO_IS_BE) /* No byteswapping */
-# define MMIO_IN16(base, offset) xf86ReadMmio16Be(base, offset)
-# define MMIO_IN32(base, offset) xf86ReadMmio32Be(base, offset)
-# define MMIO_OUT16(base, offset, val) \
- xf86WriteMmio16Be(base, offset, (CARD16)(val))
-# define MMIO_OUT32(base, offset, val) \
- xf86WriteMmio32Be(base, offset, (CARD32)(val))
-# define MMIO_ONB16(base, offset, val) \
- xf86WriteMmio16BeNB(base, offset, (CARD16)(val))
-# define MMIO_ONB32(base, offset, val) \
- xf86WriteMmio32BeNB(base, offset, (CARD32)(val))
-# else /* byteswapping is the default */
-# define MMIO_IN16(base, offset) xf86ReadMmio16Le(base, offset)
-# define MMIO_IN32(base, offset) xf86ReadMmio32Le(base, offset)
-# define MMIO_OUT16(base, offset, val) \
- xf86WriteMmio16Le(base, offset, (CARD16)(val))
-# define MMIO_OUT32(base, offset, val) \
- xf86WriteMmio32Le(base, offset, (CARD32)(val))
-# define MMIO_ONB16(base, offset, val) \
- xf86WriteMmio16LeNB(base, offset, (CARD16)(val))
-# define MMIO_ONB32(base, offset, val) \
- xf86WriteMmio32LeNB(base, offset, (CARD32)(val))
-# endif
-
-# define MMIO_MOVE32(base, offset, val) \
- xf86WriteMmio32Be(base, offset, (CARD32)(val))
-
-# else /* !__alpha__ && !__powerpc__ && !__sparc__ */
-
-# define MMIO_IN8(base, offset) \
- *(volatile CARD8 *)(((CARD8*)(base)) + (offset))
-# define MMIO_IN16(base, offset) \
- *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset))
-# define MMIO_IN32(base, offset) \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
-# define MMIO_OUT8(base, offset, val) \
- *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) = (val)
-# define MMIO_OUT16(base, offset, val) \
- *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
-# define MMIO_OUT32(base, offset, val) \
- *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
-# define MMIO_ONB8(base, offset, val) MMIO_OUT8(base, offset, val)
-# define MMIO_ONB16(base, offset, val) MMIO_OUT16(base, offset, val)
-# define MMIO_ONB32(base, offset, val) MMIO_OUT32(base, offset, val)
-
-# define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
-
-# endif /* __alpha__ */
-
-/*
- * With Intel, the version in os-support/misc/SlowBcopy.s is used.
- * This avoids port I/O during the copy (which causes problems with
- * some hardware).
- */
-# ifdef __alpha__
-# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
-# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
-# else /* __alpha__ */
-# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
-# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
-# endif /* __alpha__ */
-
-#endif /* _COMPILER_H */
diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes
deleted file mode 100644
index f7dc01216..000000000
--- a/hw/xfree86/common/extramodes
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Extra modes to include as default modes in the X server.
-//
-// $XFree86: xc/programs/Xserver/hw/xfree86/etc/extramodes,v 1.6 2002/11/11 04:21:46 dawes Exp $
-//
-
-# 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz
-ModeLine "832x624" 57.284 832 864 928 1152 624 625 628 667 -Hsync -Vsync
-
-# 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz
-ModeLine "1152x768" 64.995 1152 1178 1314 1472 768 771 777 806 +hsync +vsync
-
-# 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz
-ModeLine "1400x1050" 122.0 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync
-
-# 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz
-ModeLine "1400x1050" 155.8 1400 1464 1784 1912 1050 1052 1064 1090 +hsync +vsync
-
-# 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz
-Modeline "1600x1024" 106.910 1600 1620 1640 1670 1024 1027 1030 1067 -hsync -vsync
-
-# 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz
-Modeline "1920x1440" 341.35 1920 2072 2288 2656 1440 1441 1444 1512 -hsync +vsync
-
-# 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz
-Modeline "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -hsync +vsync
-
-# 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz
-Modeline "2048x1536" 340.48 2048 2216 2440 2832 1536 1537 1540 1603 -hsync +vsync
-
-# 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz
-Modeline "2048x1536" 388.04 2048 2216 2440 2832 1536 1537 1540 1612 -hsync +vsync
-
diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h
deleted file mode 100644
index e60aa4e83..000000000
--- a/hw/xfree86/common/fourcc.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.5 2003/08/24 17:36:48 dawes Exp $ */
-
-/*
- * Copyright (c) 2000-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- This header file contains listings of STANDARD guids for video formats.
- Please do not place non-registered, or incomplete entries in this file.
- A list of some popular fourcc's are at: http://www.webartz.com/fourcc/
- For an explanation of fourcc <-> guid mappings see RFC2361.
-*/
-
-#ifndef _XF86_FOURCC_H_
-#define _XF86_FOURCC_H_ 1
-
-#define FOURCC_YUY2 0x32595559
-#define XVIMAGE_YUY2 \
- { \
- FOURCC_YUY2, \
- XvYUV, \
- LSBFirst, \
- {'Y','U','Y','2', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 16, \
- XvPacked, \
- 1, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 2, 2, \
- 1, 1, 1, \
- {'Y','U','Y','V', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_YV12 0x32315659
-#define XVIMAGE_YV12 \
- { \
- FOURCC_YV12, \
- XvYUV, \
- LSBFirst, \
- {'Y','V','1','2', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 12, \
- XvPlanar, \
- 3, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 2, 2, \
- 1, 2, 2, \
- {'Y','V','U', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_I420 0x30323449
-#define XVIMAGE_I420 \
- { \
- FOURCC_I420, \
- XvYUV, \
- LSBFirst, \
- {'I','4','2','0', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 12, \
- XvPlanar, \
- 3, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 2, 2, \
- 1, 2, 2, \
- {'Y','U','V', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-
-#define FOURCC_UYVY 0x59565955
-#define XVIMAGE_UYVY \
- { \
- FOURCC_UYVY, \
- XvYUV, \
- LSBFirst, \
- {'U','Y','V','Y', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 16, \
- XvPacked, \
- 1, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 2, 2, \
- 1, 1, 1, \
- {'U','Y','V','Y', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_IA44 0x34344149
-#define XVIMAGE_IA44 \
- { \
- FOURCC_IA44, \
- XvYUV, \
- LSBFirst, \
- {'I','A','4','4', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 8, \
- XvPacked, \
- 1, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 1, 1, \
- 1, 1, 1, \
- {'A','I', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_AI44 0x34344941
-#define XVIMAGE_AI44 \
- { \
- FOURCC_AI44, \
- XvYUV, \
- LSBFirst, \
- {'A','I','4','4', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 8, \
- XvPacked, \
- 1, \
- 0, 0, 0, 0, \
- 8, 8, 8, \
- 1, 1, 1, \
- 1, 1, 1, \
- {'I','A', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#endif /* _XF86_FOURCC_H_ */
diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl
deleted file mode 100644
index e31fe28e1..000000000
--- a/hw/xfree86/common/modeline2c.pl
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/perl
-
-# automatically generate the xf86DefModeSet.c file from a normal
-# XF86Config style file of Modelines
-#
-# run as
-#
-# perl /modeline2c.pl < [modesfile] > xf86DefModes.c
-#
-# hackish perl - author Dirk Hohndel
-#
-# Copyright 1999-2003 by The XFree86 Project, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the copyright holder(s)
-# and author(s) shall not be used in advertising or otherwise to promote
-# the sale, use or other dealings in this Software without prior written
-# authorization from the copyright holder(s) and author(s).
-#
-# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.11 2003/11/03 05:11:01 tsi Exp $
-
-#my %flagshash;
-$flagshash{""} = "0";
-# $flagshash{"Interlace"} = "V_INTERLACE";
-# $flagshash{"+hsync"} = "V_PHSYNC";
-# $flagshash{"-hsync"} = "V_NHSYNC";
-# $flagshash{"+vsync"} = "V_PVSYNC";
-# $flagshash{"-vsync"} = "V_NVSYNC";
-# XXX I'm definitely not a perl guru... -- tsi
-$flagshash{"+hsync +vsync"} = "V_PHSYNC | V_PVSYNC";
-$flagshash{"+hsync -vsync"} = "V_PHSYNC | V_NVSYNC";
-$flagshash{"-hsync +vsync"} = "V_NHSYNC | V_PVSYNC";
-$flagshash{"-hsync -vsync"} = "V_NHSYNC | V_NVSYNC";
-$flagshash{"+hsync +vsync interlace"} = "V_PHSYNC | V_PVSYNC | V_INTERLACE";
-$flagshash{"+hsync -vsync interlace"} = "V_PHSYNC | V_NVSYNC | V_INTERLACE";
-$flagshash{"-hsync +vsync interlace"} = "V_NHSYNC | V_PVSYNC | V_INTERLACE";
-$flagshash{"-hsync -vsync interlace"} = "V_NHSYNC | V_NVSYNC | V_INTERLACE";
-
-# stop CVS from expanding the XFree86 Id here...
-
-$proj = "XFree86";
-printf("/* \$$proj\$ */
-
-/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
- * modeline2c.pl */
-
-/*
- * Copyright 1999-2003 by The XFree86 Project, Inc.
- *
- * Author: Dirk Hohndel <hohndel\@XFree86.Org>
- */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-#include \"xf86.h\"
-#include \"xf86Config.h\"
-#include \"xf86Priv.h\"
-#include \"xf86_OSlib.h\"
-
-#include \"globals.h\"
-
-#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT
-#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
-
-DisplayModeRec xf86DefaultModes [] = {
-");
-while (<>) {
- if (/^\#/) {
- s/^\#//;
- chop;
- print "/*" . $_ . " */\n";
- }
- if (/^ModeLine\s+(\S+)\s+([\d.\s]+)(.*)/i) {
- $name = $1;
- $values = $2;
- $flags = $3;
- $flags =~ y/A-Z/a-z/;
- $values =~ /([\d.]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/;
- printf("\t{MODEPREFIX(%s),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s, MODESUFFIX},\n",
- $name,$1*1000,$2,$3,$4,$5,$6,$7,$8,$9,$flagshash{$flags});
-# Also generate half-width doublescanned modes
- printf("\t{MODEPREFIX(\"%dx%d\"),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s | V_DBLSCAN, MODESUFFIX},\n",
- $2/2,$6/2,$1*500,$2/2,$3/2,$4/2,$5/2,$6/2,$7/2,$8/2,$9/2,$flagshash{$flags});
- }
-
-
-}
-printf("\t{MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}\n};\n");
diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h
deleted file mode 100644
index dbf8c8f86..000000000
--- a/hw/xfree86/common/scoasm.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.1 2003/08/24 17:36:49 dawes Exp $ */
-
-/*
- * Copyright (c) 1996 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * scoasm.h - used to define inline versions of certain functions which
- * do NOT appear in sys/inline.h.
- */
-#ifdef SCO325
-#ifndef _SCOASM_HDR_INC
-#define _SCOASM_HDR_INC
-
-asm void outl(port,val)
-{
-%reg port,val;
- movl port, %edx
- movl val, %eax
- outl (%dx)
-%reg port; mem val;
- movl port, %edx
- movl val, %eax
- outl (%dx)
-%mem port; reg val;
- movw port, %dx
- movl val, %eax
- outl (%dx)
-%mem port,val;
- movw port, %dx
- movl val, %eax
- outl (%dx)
-}
-
-asm void outw(port,val)
-{
-%reg port,val;
- movl port, %edx
- movl val, %eax
- data16
- outl (%dx)
-%reg port; mem val;
- movl port, %edx
- movw val, %ax
- data16
- outl (%dx)
-%mem port; reg val;
- movw port, %dx
- movl val, %eax
- data16
- outl (%dx)
-%mem port,val;
- movw port, %dx
- movw val, %ax
- data16
- outl (%dx)
-}
-
-asm void outb(port,val)
-{
-%reg port,val;
- movl port, %edx
- movl val, %eax
- outb (%dx)
-%reg port; mem val;
- movl port, %edx
- movb val, %al
- outb (%dx)
-%mem port; reg val;
- movw port, %dx
- movl val, %eax
- outb (%dx)
-%mem port,val;
- movw port, %dx
- movb val, %al
- outb (%dx)
-}
-
-asm int inl(port)
-{
-%reg port;
- movl port, %edx
- inl (%dx)
-%mem port;
- movw port, %dx
- inl (%dx)
-}
-
-asm int inw(port)
-{
-%reg port;
- subl %eax, %eax
- movl port, %edx
- data16
- inl (%dx)
-%mem port;
- subl %eax, %eax
- movw port, %dx
- data16
- inl (%dx)
-}
-
-asm int inb(port)
-{
-%reg port;
- subl %eax, %eax
- movl port, %edx
- inb (%dx)
-%mem port;
- subl %eax, %eax
- movw port, %dx
- inb (%dx)
-}
-
-#endif /* _SCOASM_HDR_INC */
-#endif /* SCO325 */
diff --git a/hw/xfree86/common/vesamodes b/hw/xfree86/common/vesamodes
deleted file mode 100644
index d2df5931a..000000000
--- a/hw/xfree86/common/vesamodes
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// Default modes distilled from
-// "VESA and Industry Standards and Guide for Computer Display Monitor
-// Timing", version 1.0, revision 0.8, adopted September 17, 1998.
-//
-// $XFree86: xc/programs/Xserver/hw/xfree86/etc/vesamodes,v 1.4 1999/11/18 16:52:17 tsi Exp $
-
-
-# 640x350 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "640x350" 31.5 640 672 736 832 350 382 385 445 +hsync -vsync
-
-# 640x400 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "640x400" 31.5 640 672 736 832 400 401 404 445 -hsync +vsync
-
-# 720x400 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "720x400" 35.5 720 756 828 936 400 401 404 446 -hsync +vsync
-
-# 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
-ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
-
-# 640x480 @ 72Hz (VESA) hsync: 37.9kHz
-ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
-
-# 640x480 @ 75Hz (VESA) hsync: 37.5kHz
-ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
-
-# 640x480 @ 85Hz (VESA) hsync: 43.3kHz
-ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
-
-# 800x600 @ 56Hz (VESA) hsync: 35.2kHz
-ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
-
-# 800x600 @ 60Hz (VESA) hsync: 37.9kHz
-ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
-
-# 800x600 @ 72Hz (VESA) hsync: 48.1kHz
-ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
-
-# 800x600 @ 75Hz (VESA) hsync: 46.9kHz
-ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
-
-# 800x600 @ 85Hz (VESA) hsync: 53.7kHz
-ModeLine "800x600" 56.3 800 832 896 1048 600 601 604 631 +hsync +vsync
-
-# 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz
-ModeLine "1024x768" 44.9 1024 1032 1208 1264 768 768 776 817 +hsync +vsync Interlace
-
-# 1024x768 @ 60Hz (VESA) hsync: 48.4kHz
-ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
-
-# 1024x768 @ 70Hz (VESA) hsync: 56.5kHz
-ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
-
-# 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
-ModeLine "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
-
-# 1024x768 @ 85Hz (VESA) hsync: 68.7kHz
-ModeLine "1024x768" 94.5 1024 1072 1168 1376 768 769 772 808 +hsync +vsync
-
-# 1152x864 @ 75Hz (VESA) hsync: 67.5kHz
-ModeLine "1152x864" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync
-
-# 1280x960 @ 60Hz (VESA) hsync: 60.0kHz
-ModeLine "1280x960" 108.0 1280 1376 1488 1800 960 961 964 1000 +hsync +vsync
-
-# 1280x960 @ 85Hz (VESA) hsync: 85.9kHz
-ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +hsync +vsync
-
-# 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz
-ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
-
-# 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz
-ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync
-
-# 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz
-ModeLine "1280x1024" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +hsync +vsync
-
-# 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz
-ModeLine "1600x1200" 162.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz
-ModeLine "1600x1200" 175.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz
-ModeLine "1600x1200" 189.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz
-ModeLine "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz
-ModeLine "1600x1200" 229.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
-
-# 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz
-ModeLine "1792x1344" 204.8 1792 1920 2120 2448 1344 1345 1348 1394 -hsync +vsync
-
-# 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz
-ModeLine "1792x1344" 261.0 1792 1888 2104 2456 1344 1345 1348 1417 -hsync +vsync
-
-# 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz
-ModeLine "1856x1392" 218.3 1856 1952 2176 2528 1392 1393 1396 1439 -hsync +vsync
-
-# 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz
-ModeLine "1856x1392" 288.0 1856 1984 2208 2560 1392 1393 1396 1500 -hsync +vsync
-
-# 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz
-ModeLine "1920x1440" 234.0 1920 2048 2256 2600 1440 1441 1444 1500 -hsync +vsync
-
-# 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz
-ModeLine "1920x1440" 297.0 1920 2064 2288 2640 1440 1441 1444 1500 -hsync +vsync
-
-
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
deleted file mode 100644
index e189e81d2..000000000
--- a/hw/xfree86/common/xf86.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.172 2003/09/24 02:43:16 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains declarations for public XFree86 functions and variables,
- * and definitions of public macros.
- *
- * "public" means available to video drivers.
- */
-
-#ifndef _XF86_H
-#define _XF86_H
-
-#include "xf86str.h"
-#include "xf86Opt.h"
-#include <X11/Xfuncproto.h>
-#ifndef IN_MODULE
-#include <stdarg.h>
-#else
-#include "xf86_ansic.h"
-#endif
-
-#include "propertyst.h"
-
-/* General parameters */
-extern int xf86DoConfigure;
-extern Bool xf86DoConfigurePass1;
-extern int xf86ScreenIndex; /* Index into pScreen.devPrivates */
-extern int xf86CreateRootWindowIndex; /* Index into pScreen.devPrivates */
-extern int xf86PixmapIndex;
-extern Bool xf86ResAccessEnter;
-extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
-extern const unsigned char byte_reversed[256];
-extern PropertyPtr *xf86RegisteredPropertiesTable;
-extern ScrnInfoPtr xf86CurrentScreen;
-extern Bool pciSlotClaimed;
-extern Bool isaSlotClaimed;
-extern Bool fbSlotClaimed;
-#ifdef __sparc__
-extern Bool sbusSlotClaimed;
-#endif
-extern confDRIRec xf86ConfigDRI;
-extern Bool xf86inSuspend;
-
-#define XF86SCRNINFO(p) ((ScrnInfoPtr)((p)->devPrivates[xf86ScreenIndex].ptr))
-
-#define XF86FLIP_PIXELS() \
- do { \
- if (xf86GetFlipPixels()) { \
- pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
- pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
- } \
- while (0)
-
-#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
-
-#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
- (((p) == Pix24Use32) ? 32 : 0))
-
-/* variables for debugging */
-#ifdef BUILDDEBUG
-extern char* xf86p8bit[];
-extern CARD32 xf86DummyVar1;
-extern CARD32 xf86DummyVar2;
-extern CARD32 xf86DummyVar3;
-#endif
-
-/* Function Prototypes */
-#ifndef _NO_XF86_PROTOTYPES
-
-/* xf86Bus.c */
-
-Bool xf86CheckPciSlot(int bus, int device, int func);
-int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
- int chipset, GDevPtr dev, Bool active);
-Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
- int *func);
-Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
-void xf86FormatPciBusNumber(int busnum, char *buffer);
-pciVideoPtr *xf86GetPciVideoInfo(void);
-pciConfigPtr *xf86GetPciConfigInfo(void);
-void xf86SetPciVideo(pciVideoPtr, resType);
-void xf86PrintResList(int verb, resPtr list);
-resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
-int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
-int xf86GetIsaInfoForScreen(int scrnIndex);
-int xf86GetFbInfoForScreen(int scrnIndex);
-Bool xf86ParseIsaBusString(const char *busID);
-int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
-int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
-void xf86EnableAccess(ScrnInfoPtr pScrn);
-void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
-Bool xf86IsPrimaryPci(pciVideoPtr pPci);
-Bool xf86IsPrimaryIsa(void);
-int xf86CheckPciGAType(pciVideoPtr pPci);
-/* new RAC */
-resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
-resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
-resPtr xf86DupResList(const resPtr rlist);
-void xf86FreeResList(resPtr rlist);
-void xf86ClaimFixedResources(resList list, int entityIndex);
-Bool xf86DriverHasEntities(DriverPtr drvp);
-void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
-void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
- int instance);
-int xf86GetNumEntityInstances(int entityIndex);
-GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
-void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
-EntityInfoPtr xf86GetEntityInfo(int entityIndex);
-pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
-int xf86GetPciEntity(int bus, int dev, int func);
-Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
- EntityProc enter, EntityProc leave, pointer);
-void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
-resPtr xf86RegisterResources(int entityIndex, resList list,
- unsigned long Access);
-Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base);
-void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
- xf86SetAccessFuncPtr oldFuncs);
-Bool xf86IsEntityPrimary(int entityIndex);
-Bool xf86FixPciResource(int entityIndex, int prt, memType alignment,
- unsigned long type);
-resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
-resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
-void xf86EnterServerState(xf86State state);
-resRange xf86GetBlock(unsigned long type, memType size,
- memType window_start, memType window_end,
- memType align_mask, resPtr avoid);
-resRange xf86GetSparse(unsigned long type, memType fixed_bits,
- memType decode_mask, memType address_mask,
- resPtr avoid);
-memType xf86ChkConflict(resRange *rgp, int entityIndex);
-Bool xf86IsPciDevPresent(int bus, int dev, int func);
-ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
-Bool xf86NoSharedResources(int screenIndex, resType res);
-resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
-pciVideoPtr xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
- char n, pciVideoPtr pvp_exclude);
-pciVideoPtr xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
- char n, pciVideoPtr pvp_exclude);
-#ifdef INCLUDE_DEPRECATED
-void xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable);
-#endif
-void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
-Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
-#ifdef async
-Bool xf86QueueAsyncEvent(void (*func)(pointer),pointer arg);
-#endif
-
-int xf86GetLastScrnFlag(int entityIndex);
-void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
-Bool xf86IsEntityShared(int entityIndex);
-void xf86SetEntityShared(int entityIndex);
-Bool xf86IsEntitySharable(int entityIndex);
-void xf86SetEntitySharable(int entityIndex);
-Bool xf86IsPrimInitDone(int entityIndex);
-void xf86SetPrimInitDone(int entityIndex);
-void xf86ClearPrimInitDone(int entityIndex);
-int xf86AllocateEntityPrivateIndex(void);
-DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
-
-/* xf86Configure.c */
-GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
- void *busData, int chipset);
-GDevPtr xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo,
- int chipset);
-
-/* xf86Cursor.c */
-
-void xf86LockZoom(ScreenPtr pScreen, int lock);
-void xf86InitViewport(ScrnInfoPtr pScr);
-void xf86SetViewport(ScreenPtr pScreen, int x, int y);
-void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
-Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
-void *xf86GetPointerScreenFuncs(void);
-void xf86InitOrigins(void);
-void xf86ReconfigureLayout(void);
-
-/* xf86DPMS.c */
-
-Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
-
-/* xf86DGA.c */
-
-Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
- int num);
-xf86SetDGAModeProc xf86SetDGAMode;
-
-/* xf86Events.c */
-
-void SetTimeSinceLastInputEvent(void);
-pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
-int xf86RemoveInputHandler(pointer handler);
-void xf86DisableInputHandler(pointer handler);
-void xf86EnableInputHandler(pointer handler);
-void xf86InterceptSignals(int *signo);
-Bool xf86EnableVTSwitch(Bool new);
-Bool xf86CommonSpecialKey(int key, Bool down, int modifiers);
-void xf86ProcessActionEvent(ActionEvent action, void *arg);
-
-/* xf86Helper.c */
-
-#ifdef printf
-#define printf_defined
-#undef printf
-#endif
-
-void xf86AddDriver(DriverPtr driver, pointer module, int flags);
-void xf86DeleteDriver(int drvIndex);
-ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
-void xf86DeleteScreen(int scrnIndex, int flags);
-int xf86AllocateScrnInfoPrivateIndex(void);
-Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
-Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
- int depth24flags);
-void xf86PrintDepthBpp(ScrnInfoPtr scrp);
-Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
-Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
-Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
-void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
-void xf86SetBlackWhitePixels(ScreenPtr pScreen);
-void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
-void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
- const char *format, va_list args);
-void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
- const char *format, ...) _printf_attribute(4,5);
-void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
- _printf_attribute(3,4);
-void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
- _printf_attribute(3,4);
-void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
-void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
-void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
-const char *xf86TokenToString(SymTabPtr table, int token);
-int xf86StringToToken(SymTabPtr table, const char *string);
-void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
-void xf86PrintChipsets(const char *drvname, const char *drvmsg,
- SymTabPtr chips);
-int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
-int xf86MatchPciInstances(const char *driverName, int vendorID,
- SymTabPtr chipsets, PciChipsets *PCIchipsets,
- GDevPtr *devList, int numDevs, DriverPtr drvp,
- int **foundEntities);
-int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
- IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList,
- int numDevs, int **foundEntities);
-void xf86GetClocks(ScrnInfoPtr pScrn, int num,
- Bool (*ClockFunc)(ScrnInfoPtr, int),
- void (*ProtectRegs)(ScrnInfoPtr, Bool),
- void (*BlankScreen)(ScrnInfoPtr, Bool),
- IOADDRESS vertsyncreg, int maskval,
- int knownclkindex, int knownclkvalue);
-void xf86SetPriority(Bool up);
-const char *xf86GetVisualName(int visual);
-int xf86GetVerbosity(void);
-Pix24Flags xf86GetPix24(void);
-int xf86GetDepth(void);
-rgb xf86GetWeight(void);
-Gamma xf86GetGamma(void);
-Bool xf86GetFlipPixels(void);
-const char *xf86GetServerName(void);
-Bool xf86ServerIsExiting(void);
-Bool xf86ServerIsResetting(void);
-Bool xf86ServerIsInitialising(void);
-Bool xf86ServerIsOnlyDetecting(void);
-Bool xf86ServerIsOnlyProbing(void);
-Bool xf86CaughtSignal(void);
-Bool xf86GetVidModeAllowNonLocal(void);
-Bool xf86GetVidModeEnabled(void);
-Bool xf86GetModInDevAllowNonLocal(void);
-Bool xf86GetModInDevEnabled(void);
-Bool xf86GetAllowMouseOpenFail(void);
-Bool xf86IsPc98(void);
-void xf86DisableRandR(void);
-CARD32 xf86GetVersion(void);
-CARD32 xf86GetModuleVersion(pointer module);
-pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
-pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
-pointer xf86LoadOneModule(char *name, pointer optlist);
-void xf86UnloadSubModule(pointer mod);
-Bool xf86LoaderCheckSymbol(const char *name);
-void xf86LoaderReqSymLists(const char **, ...);
-void xf86LoaderReqSymbols(const char *, ...);
-void xf86LoaderRefSymLists(const char **, ...);
-void xf86LoaderRefSymbols(const char *, ...);
-void xf86SetBackingStore(ScreenPtr pScreen);
-void xf86SetSilkenMouse(ScreenPtr pScreen);
-int xf86NewSerialNumber(WindowPtr p, pointer unused);
-pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
- char **adaptor_name, pointer *adaptor_options);
-void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
-ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
- int entityIndex,PciChipsets *p_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
- int entityIndex, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
- int entityIndex, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-/* Obsolete! don't use */
-Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
- int entityIndex,PciChipsets *p_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-/* Obsolete! don't use */
-Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
- int entityIndex, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
- resList res, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
- EntityProc enter, EntityProc leave,
- pointer private);
-Bool xf86IsScreenPrimary(int scrnIndex);
-int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
- int format, unsigned long len,
- pointer value);
-Bool xf86IsUnblank(int mode);
-
-#ifdef XFree86LOADER
-void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
-void xf86DeleteModuleInfo(int idx);
-#endif
-
-#ifdef printf_defined
-#define printf xf86printf
-#undef printf_defined
-#endif
-
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
- void xf86Break1(void);
-void xf86Break2(void);
-void xf86Break3(void);
-CARD8 xf86PeekFb8(CARD8 *p);
-CARD16 xf86PeekFb16(CARD16 *p);
-CARD32 xf86PeekFb32(CARD32 *p);
-void xf86PokeFb8(CARD8 *p, CARD8 v);
-void xf86PokeFb16(CARD16 *p, CARD16 v);
-void xf86PokeFb32(CARD16 *p, CARD32 v);
-CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
-CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
-CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
-void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
-void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
-void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
-extern void xf86SPTimestamp(xf86TsPtr* timestamp, char* string);
-extern void xf86STimestamp(xf86TsPtr* timestamp);
-#endif
-
-/* xf86Init.c */
-
-PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
-int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
-
-/* xf86Mode.c */
-
-int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
- int DivFactor, int MulFactor, int *divider);
-const char *xf86ModeStatusToString(ModeStatus status);
-ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
- ClockRangePtr clockRanges, LookupModeFlags strategy);
-ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
-ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
- ClockRangePtr clockRanges,
- LookupModeFlags strategy,
- int maxPitch, int virtualX,
- int virtualY);
-ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
- int flags);
-int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
- char **modeNames, ClockRangePtr clockRanges,
- int *linePitches, int minPitch, int maxPitch,
- int minHeight, int maxHeight, int pitchInc,
- int virtualX, int virtualY, int apertureSize,
- LookupModeFlags strategy);
-void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
-void xf86PruneDriverModes(ScrnInfoPtr scrp);
-void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
-void xf86PrintModes(ScrnInfoPtr scrp);
-void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
-
-/* xf86Option.c */
-
-void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
-
-
-/* xf86RandR.c */
-#ifdef RANDR
-Bool xf86RandRInit (ScreenPtr pScreen);
-void xf86RandRSetInitialMode (ScreenPtr pScreen);
-#endif
-
-/* xf86VidModeExtentionInit.c */
-
-Bool VidModeExtensionInit(ScreenPtr pScreen);
-
-/* xf86Versions.c */
-CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
-Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
- CARD32 version, int flags);
-
-
-#endif /* _NO_XF86_PROTOTYPES */
-
-#endif /* _XF86_H */
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
deleted file mode 100644
index 7c773fee6..000000000
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/* $DHD: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.15 2003/09/24 19:39:36 dawes Exp $ */
-
-/*
- * Copyright 2003 by David H. Dawes.
- * Copyright 2003 by X-Oz Technologies.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- *
- * Author: David Dawes <dawes@XFree86.Org>.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.2 2003/11/03 05:11:01 tsi Exp $ */
-
-#include "xf86.h"
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "xf86Config.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * Sections for the default built-in configuration.
- */
-
-#define BUILTIN_MODULE_SECTION \
- "Section \"Module\"\n" \
- "\tLoad\t\"extmod\"\n" \
- "\tLoad\t\"dbe\"\n" \
- "\tLoad\t\"glx\"\n" \
- "\tLoad\t\"freetype\"\n" \
- "EndSection\n\n"
-
-#define BUILTIN_DEVICE_NAME \
- "\"Builtin Default %s Device %d\""
-
-#define BUILTIN_DEVICE_SECTION_PRE \
- "Section \"Device\"\n" \
- "\tIdentifier\t" BUILTIN_DEVICE_NAME "\n" \
- "\tDriver\t\"%s\"\n"
-
-#define BUILTIN_DEVICE_SECTION_POST \
- "EndSection\n\n"
-
-#define BUILTIN_DEVICE_SECTION \
- BUILTIN_DEVICE_SECTION_PRE \
- BUILTIN_DEVICE_SECTION_POST
-
-#define BUILTIN_MONITOR_NAME \
- "\"Builtin Default Monitor\""
-
-#define BUILTIN_MONITOR_SECTION \
- "Section \"Monitor\"\n" \
- "\tIdentifier\t" BUILTIN_MONITOR_NAME "\n" \
- "\tOption\t\"TargetRefresh\"\t\"75.0\"\n" \
- "EndSection\n\n"
-
-#define BUILTIN_SCREEN_NAME \
- "\"Builtin Default %s Screen %d\""
-
-#define BUILTIN_SCREEN_SECTION \
- "Section \"Screen\"\n" \
- "\tIdentifier\t" BUILTIN_SCREEN_NAME "\n" \
- "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
- "\tMonitor\t" BUILTIN_MONITOR_NAME "\n" \
- "EndSection\n\n"
-
-#define BUILTIN_LAYOUT_SECTION_PRE \
- "Section \"ServerLayout\"\n" \
- "\tIdentifier\t\"Builtin Default Layout\"\n"
-
-#define BUILTIN_LAYOUT_SCREEN_LINE \
- "\tScreen\t" BUILTIN_SCREEN_NAME "\n"
-
-#define BUILTIN_LAYOUT_SECTION_POST \
- "EndSection\n\n"
-
-
-#ifndef GET_CONFIG_CMD
-#define GET_CONFIG_CMD "getconfig"
-#endif
-
-#ifndef GETCONFIG_DIR
-#define GETCONFIG_DIR PROJECTROOT "/lib/X11/getconfig"
-#endif
-
-#define GETCONFIG_WHITESPACE " \t\n"
-
-static const char **builtinConfig = NULL;
-static int builtinLines = 0;
-static const char *deviceList[] = {
- "fbdev",
- "vesa",
- "vga",
- NULL
-};
-
-/*
- * A built-in config file is stored as an array of strings, with each string
- * representing a single line. AppendToConfig() breaks up the string "s"
- * into lines, and appends those lines it to builtinConfig.
- */
-
-static void
-AppendToList(const char *s, const char ***list, int *lines)
-{
- char *str, *newstr, *p;
-
- str = xnfstrdup(s);
- for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
- (*lines)++;
- *list = xnfrealloc(*list, (*lines + 1) * sizeof(**list));
- newstr = xnfalloc(strlen(p) + 2);
- strcpy(newstr, p);
- strcat(newstr, "\n");
- (*list)[*lines - 1] = newstr;
- (*list)[*lines] = NULL;
- }
- xfree(str);
-}
-
-static void
-FreeList(const char ***list, int *lines)
-{
- int i;
-
- for (i = 0; i < *lines; i++) {
- if ((*list)[i])
- xfree((*list)[i]);
- }
- xfree(*list);
- *list = NULL;
- *lines = 0;
-}
-
-static void
-FreeConfig(void)
-{
- FreeList(&builtinConfig, &builtinLines);
-}
-
-static void
-AppendToConfig(const char *s)
-{
- AppendToList(s, &builtinConfig, &builtinLines);
-}
-
-Bool
-xf86AutoConfig(void)
-{
- const char **p;
- char buf[1024];
- pciVideoPtr *pciptr, info = NULL;
- char *driver = NULL;
- FILE *gp = NULL;
- ConfigStatus ret;
-
- /* Find the primary device, and get some information about it. */
- if (xf86PciVideoInfo) {
- for (pciptr = xf86PciVideoInfo; (info = *pciptr); pciptr++) {
- if (xf86IsPrimaryPci(info)) {
- break;
- }
- }
- if (!info) {
- ErrorF("Primary device is not PCI\n");
- }
- } else {
- ErrorF("xf86PciVideoInfo is not set\n");
- }
-
- if (info) {
- char *tmp;
- char *path = NULL, *a, *b;
- char *searchPath = NULL;
-
- /*
- * Look for the getconfig program first in the xf86ModulePath
- * directories, then in BINDIR. If it isn't found in any of those
- * locations, just use the normal search path.
- */
-
- if (xf86ModulePath) {
- a = xnfstrdup(xf86ModulePath);
- b = strtok(a, ",");
- while (b) {
- path = xnfrealloc(path,
- strlen(b) + 1 + strlen(GET_CONFIG_CMD) + 1);
- sprintf(path, "%s/%s", b, GET_CONFIG_CMD);
- if (access(path, X_OK) == 0)
- break;
- b = strtok(NULL, ",");
- }
- if (!b) {
- xfree(path);
- path = NULL;
- }
- xfree(a);
- }
-
-#ifdef BINDIR
- if (!path) {
- path = xnfstrdup(BINDIR "/" GET_CONFIG_CMD);
- if (access(path, X_OK) != 0) {
- xfree(path);
- path = NULL;
- }
- }
-#endif
-
- if (!path)
- path = xnfstrdup(GET_CONFIG_CMD);
-
- /*
- * Build up the config file directory search path:
- *
- * /etc/X11
- * PROJECTROOT/etc/X11
- * xf86ModulePath
- * PROJECTROOT/lib/X11/getconfig (GETCONFIG_DIR)
- */
-
- searchPath = xnfalloc(strlen("/etc/X11") + 1 +
- strlen(PROJECTROOT "/etc/X11") + 1 +
- (xf86ModulePath ? strlen(xf86ModulePath) : 0)
- + 1 +
- strlen(GETCONFIG_DIR) + 1);
- strcpy(searchPath, "/etc/X11," PROJECTROOT "/etc/X11,");
- if (xf86ModulePath && *xf86ModulePath) {
- strcat(searchPath, xf86ModulePath);
- strcat(searchPath, ",");
- }
- strcat(searchPath, GETCONFIG_DIR);
-
- ErrorF("xf86AutoConfig: Primary PCI is %d:%d:%d\n",
- info->bus, info->device, info->func);
-
- snprintf(buf, sizeof(buf), "%s"
-#ifdef DEBUG
- " -D"
-#endif
- " -X %d"
- " -I %s"
- " -v 0x%04x -d 0x%04x -r 0x%02x -s 0x%04x"
- " -b 0x%04x -c 0x%04x",
- path,
- (unsigned int)xf86GetVersion(),
- searchPath,
- info->vendor, info->chipType, info->chipRev,
- info->subsysVendor, info->subsysCard,
- info->class << 8 | info->subclass);
- ErrorF("Running \"%s\"\n", buf);
- gp = Popen(buf, "r");
- if (gp) {
- if (fgets(buf, sizeof(buf) - 1, gp)) {
- buf[strlen(buf) - 1] = '\0';
- tmp = strtok(buf, GETCONFIG_WHITESPACE);
- if (tmp)
- driver = xnfstrdup(tmp);
- }
- }
- xfree(path);
- xfree(searchPath);
- }
-
- AppendToConfig(BUILTIN_MODULE_SECTION);
- AppendToConfig(BUILTIN_MONITOR_SECTION);
-
- if (driver) {
- snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION_PRE,
- driver, 0, driver);
- AppendToConfig(buf);
- ErrorF("New driver is \"%s\"\n", driver);
- buf[0] = '\t';
- while (fgets(buf + 1, sizeof(buf) - 2, gp)) {
- AppendToConfig(buf);
- ErrorF("Extra line: %s", buf);
- }
- AppendToConfig(BUILTIN_DEVICE_SECTION_POST);
- snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION,
- driver, 0, driver, 0);
- AppendToConfig(buf);
- }
-
- if (gp)
- Pclose(gp);
-
- for (p = deviceList; *p; p++) {
- snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p);
- AppendToConfig(buf);
- snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
- AppendToConfig(buf);
- }
-
- AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE);
- if (driver) {
- snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, driver, 0);
- AppendToConfig(buf);
- }
- for (p = deviceList; *p; p++) {
- snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0);
- AppendToConfig(buf);
- }
- AppendToConfig(BUILTIN_LAYOUT_SECTION_POST);
-
-#ifdef BUILTIN_EXTRA
- AppendToConfig(BUILTIN_EXTRA);
-#endif
-
- if (driver)
- xfree(driver);
-
- xf86MsgVerb(X_DEFAULT, 0,
- "Using default built-in configuration (%d lines)\n",
- builtinLines);
-
- xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n");
- for (p = builtinConfig; *p; p++)
- xf86ErrorFVerb(3, "\t%s", *p);
- xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n");
-
- xf86setBuiltinConfig(builtinConfig);
- ret = xf86HandleConfigFile(TRUE);
- FreeConfig();
- switch(ret) {
- case CONFIG_OK:
- return TRUE;
- default:
- xf86Msg(X_ERROR, "Error parsing the built-in default configuration.\n");
- return FALSE;
- }
-}
-
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
deleted file mode 100644
index 2ffbfa964..000000000
--- a/hw/xfree86/common/xf86Bus.c
+++ /dev/null
@@ -1,3227 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.79 2003/11/03 05:11:01 tsi Exp $ */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#define REDUCER
-/*
- * This file contains the interfaces to the bus-specific code
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-/* Bus-specific headers */
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-/* Entity data */
-EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */
-int xf86NumEntities = 0;
-static int xf86EntityPrivateCount = 0;
-BusAccPtr xf86BusAccInfo = NULL;
-
-xf86AccessRec AccessNULL = {NULL,NULL,NULL};
-
-xf86CurrentAccessRec xf86CurrentAccess = {NULL,NULL};
-
-BusRec primaryBus = { BUS_NONE, {{0}}};
-
-Bool xf86ResAccessEnter = FALSE;
-
-#ifdef REDUCER
-/* Resources that temporarily conflict with estimated resources */
-static resPtr AccReducers = NULL;
-#endif
-
-/* resource lists */
-resPtr Acc = NULL;
-resPtr osRes = NULL;
-
-/* allocatable ranges */
-resPtr ResRange = NULL;
-
-/* predefined special resources */
-resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
-resRange resVgaShared[] = {_VGA_SHARED, _END};
-resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END};
-resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END};
-resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END};
-resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END};
-resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END};
-resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END};
-resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END};
-resRange res8514Shared[] = {_8514_SHARED, _END};
-
-/* Flag: do we need RAC ? */
-static Bool needRAC = FALSE;
-static Bool doFramebufferMode = FALSE;
-
-/* state change notification callback list */
-static StateChangeNotificationPtr StateChangeNotificationList;
-static void notifyStateChange(xf86NotifyState state);
-
-#undef MIN
-#define MIN(x,y) ((x<y)?x:y)
-
-
-/*
- * Call the bus probes relevant to the architecture.
- *
- * The only one available so far is for PCI and SBUS.
- */
-
-void
-xf86BusProbe(void)
-{
- xf86PciProbe();
-#if defined(__sparc__) && !defined(__OpenBSD__)
- xf86SbusProbe();
-#endif
-}
-
-/*
- * Determine what bus type the busID string represents. The start of the
- * bus-dependent part of the string is returned as retID.
- */
-
-BusType
-StringToBusType(const char* busID, const char **retID)
-{
- char *p, *s;
- BusType ret = BUS_NONE;
-
- /* If no type field, Default to PCI */
- if (isdigit(busID[0])) {
- if (retID)
- *retID = busID;
- return BUS_PCI;
- }
-
- s = xstrdup(busID);
- p = strtok(s, ":");
- if (p == NULL || *p == 0) {
- xfree(s);
- return BUS_NONE;
- }
- if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp"))
- ret = BUS_PCI;
- if (!xf86NameCmp(p, "isa"))
- ret = BUS_ISA;
- if (!xf86NameCmp(p, "sbus"))
- ret = BUS_SBUS;
- if (ret != BUS_NONE)
- if (retID)
- *retID = busID + strlen(p) + 1;
- xfree(s);
- return ret;
-}
-
-/*
- * Entity related code.
- */
-
-void
-xf86EntityInit(void)
-{
- int i;
- resPtr *pprev_next;
- resPtr res;
- xf86AccessPtr pacc;
-
- for (i = 0; i < xf86NumEntities; i++)
- if (xf86Entities[i]->entityInit) {
- if (xf86Entities[i]->access->busAcc)
- ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
- (xf86Entities[i]->access->busAcc);
- pacc = xf86Entities[i]->access->fallback;
- if (pacc->AccessEnable)
- pacc->AccessEnable(pacc->arg);
- xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
- if (pacc->AccessDisable)
- pacc->AccessDisable(pacc->arg);
- /* remove init resources after init is processed */
- pprev_next = &Acc;
- res = Acc;
- while (res) {
- if (res->res_type & ResInit && (res->entityIndex == i)) {
- (*pprev_next) = res->next;
- xfree(res);
- } else
- pprev_next = &(res->next);
- res = (*pprev_next);
- }
- }
-}
-
-int
-xf86AllocateEntity(void)
-{
- xf86NumEntities++;
- xf86Entities = xnfrealloc(xf86Entities,
- sizeof(EntityPtr) * xf86NumEntities);
- xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec));
- xf86Entities[xf86NumEntities - 1]->entityPrivates =
- xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1);
- return (xf86NumEntities - 1);
-}
-
-static void
-EntityEnter(void)
-{
- int i;
- xf86AccessPtr pacc;
-
- for (i = 0; i < xf86NumEntities; i++)
- if (xf86Entities[i]->entityEnter) {
- if (xf86Entities[i]->access->busAcc)
- ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
- (xf86Entities[i]->access->busAcc);
- pacc = xf86Entities[i]->access->fallback;
- if (pacc->AccessEnable)
- pacc->AccessEnable(pacc->arg);
- xf86Entities[i]->entityEnter(i,xf86Entities[i]->private);
- if (pacc->AccessDisable)
- pacc->AccessDisable(pacc->arg);
- }
-}
-
-static void
-EntityLeave(void)
-{
- int i;
- xf86AccessPtr pacc;
-
- for (i = 0; i < xf86NumEntities; i++)
- if (xf86Entities[i]->entityLeave) {
- if (xf86Entities[i]->access->busAcc)
- ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
- (xf86Entities[i]->access->busAcc);
- pacc = xf86Entities[i]->access->fallback;
- if (pacc->AccessEnable)
- pacc->AccessEnable(pacc->arg);
- xf86Entities[i]->entityLeave(i,xf86Entities[i]->private);
- if (pacc->AccessDisable)
- pacc->AccessDisable(pacc->arg);
- }
-}
-
-Bool
-xf86IsEntityPrimary(int entityIndex)
-{
- EntityPtr pEnt = xf86Entities[entityIndex];
-
- if (primaryBus.type != pEnt->busType) return FALSE;
-
- switch (pEnt->busType) {
- case BUS_PCI:
- return (pEnt->pciBusId.bus == primaryBus.id.pci.bus &&
- pEnt->pciBusId.device == primaryBus.id.pci.device &&
- pEnt->pciBusId.func == primaryBus.id.pci.func);
- case BUS_ISA:
- return TRUE;
- case BUS_SBUS:
- return (pEnt->sbusBusId.fbNum == primaryBus.id.sbus.fbNum);
- default:
- return FALSE;
- }
-}
-
-Bool
-xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter,
- EntityProc leave, pointer private)
-{
- if (entityIndex >= xf86NumEntities)
- return FALSE;
- xf86Entities[entityIndex]->entityInit = init;
- xf86Entities[entityIndex]->entityEnter = enter;
- xf86Entities[entityIndex]->entityLeave = leave;
- xf86Entities[entityIndex]->private = private;
- return TRUE;
-}
-
-Bool
-xf86DriverHasEntities(DriverPtr drvp)
-{
- int i;
- for (i = 0; i < xf86NumEntities; i++) {
- if (xf86Entities[i]->driver == drvp)
- return TRUE;
- }
- return FALSE;
-}
-
-void
-xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
-{
- if (entityIndex == -1)
- return;
- if (xf86Entities[entityIndex]->inUse &&
- !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL))
- FatalError("Requested Entity already in use!\n");
-
- pScrn->numEntities++;
- pScrn->entityList = xnfrealloc(pScrn->entityList,
- pScrn->numEntities * sizeof(int));
- pScrn->entityList[pScrn->numEntities - 1] = entityIndex;
- xf86Entities[entityIndex]->access->next = pScrn->access;
- pScrn->access = xf86Entities[entityIndex]->access;
- xf86Entities[entityIndex]->inUse = TRUE;
- pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList,
- pScrn->numEntities * sizeof(int));
- pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
- pScrn->domainIOBase = xf86Entities[entityIndex]->domainIO;
-}
-
-void
-xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance)
-{
- int i;
-
- if (entityIndex == -1 || entityIndex >= xf86NumEntities)
- return;
-
- for (i = 0; i < pScrn->numEntities; i++) {
- if (pScrn->entityList[i] == entityIndex) {
- pScrn->entityInstanceList[i] = instance;
- break;
- }
- }
-}
-
-/*
- * XXX This needs to be updated for the case where a single entity may have
- * instances associated with more than one screen.
- */
-ScrnInfoPtr
-xf86FindScreenForEntity(int entityIndex)
-{
- int i,j;
-
- if (entityIndex == -1) return NULL;
-
- if (xf86Screens) {
- for (i = 0; i < xf86NumScreens; i++) {
- for (j = 0; j < xf86Screens[i]->numEntities; j++) {
- if ( xf86Screens[i]->entityList[j] == entityIndex )
- return (xf86Screens[i]);
- }
- }
- }
- return NULL;
-}
-
-void
-xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)
-{
- int i;
- EntityAccessPtr *ptr = (EntityAccessPtr *)&pScrn->access;
- EntityAccessPtr peacc;
-
- for (i = 0; i < pScrn->numEntities; i++) {
- if (pScrn->entityList[i] == entityIndex) {
- peacc = xf86Entities[pScrn->entityList[i]]->access;
- (*ptr) = peacc->next;
- /* disable entity: call disable func */
- if (peacc->pAccess && peacc->pAccess->AccessDisable)
- peacc->pAccess->AccessDisable(peacc->pAccess->arg);
- /* also disable fallback - just in case */
- if (peacc->fallback && peacc->fallback->AccessDisable)
- peacc->fallback->AccessDisable(peacc->fallback->arg);
- for (i++; i < pScrn->numEntities; i++)
- pScrn->entityList[i-1] = pScrn->entityList[i];
- pScrn->numEntities--;
- xf86Entities[entityIndex]->inUse = FALSE;
- break;
- }
- ptr = &(xf86Entities[pScrn->entityList[i]]->access->next);
- }
-}
-
-/*
- * xf86ClearEntitiesForScreen() - called when a screen is deleted
- * to mark it's entities unused. Called by xf86DeleteScreen().
- */
-void
-xf86ClearEntityListForScreen(int scrnIndex)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- EntityAccessPtr peacc;
- int i, entityIndex;
-
- if (pScrn->entityList == NULL || pScrn->numEntities == 0) return;
-
- for (i = 0; i < pScrn->numEntities; i++) {
- entityIndex = pScrn->entityList[i];
- xf86Entities[entityIndex]->inUse = FALSE;
- /* disable resource: call the disable function */
- peacc = xf86Entities[entityIndex]->access;
- if (peacc->pAccess && peacc->pAccess->AccessDisable)
- peacc->pAccess->AccessDisable(peacc->pAccess->arg);
- /* and the fallback function */
- if (peacc->fallback && peacc->fallback->AccessDisable)
- peacc->fallback->AccessDisable(peacc->fallback->arg);
- /* shared resources are only needed when entity is active: remove */
- xf86DeallocateResourcesForEntity(entityIndex, ResShared);
- }
- xfree(pScrn->entityList);
- xfree(pScrn->entityInstanceList);
- if (pScrn->CurrentAccess->pIoAccess == (EntityAccessPtr)pScrn->access)
- pScrn->CurrentAccess->pIoAccess = NULL;
- if (pScrn->CurrentAccess->pMemAccess == (EntityAccessPtr)pScrn->access)
- pScrn->CurrentAccess->pMemAccess = NULL;
- pScrn->entityList = NULL;
- pScrn->entityInstanceList = NULL;
-}
-
-void
-xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type)
-{
- resPtr *pprev_next = &Acc;
- resPtr res = Acc;
-
- while (res) {
- if (res->entityIndex == entityIndex &&
- (type & ResAccMask & res->res_type))
- {
- (*pprev_next) = res->next;
- xfree(res);
- } else
- pprev_next = &(res->next);
- res = (*pprev_next);
- }
-}
-
-/*
- * Add an extra device section (GDevPtr) to an entity.
- */
-
-void
-xf86AddDevToEntity(int entityIndex, GDevPtr dev)
-{
- EntityPtr pEnt;
-
- if (entityIndex >= xf86NumEntities)
- return;
-
- pEnt = xf86Entities[entityIndex];
- pEnt->numInstances++;
- pEnt->devices = xnfrealloc(pEnt->devices,
- pEnt->numInstances * sizeof(GDevPtr));
- pEnt->devices[pEnt->numInstances - 1] = dev;
- dev->claimed = TRUE;
-}
-
-/*
- * xf86GetEntityInfo() -- This function hands information from the
- * EntityRec struct to the drivers. The EntityRec structure itself
- * remains invisible to the driver.
- */
-EntityInfoPtr
-xf86GetEntityInfo(int entityIndex)
-{
- EntityInfoPtr pEnt;
- int i;
-
- if (entityIndex >= xf86NumEntities)
- return NULL;
-
- pEnt = xnfcalloc(1,sizeof(EntityInfoRec));
- pEnt->index = entityIndex;
- pEnt->location = xf86Entities[entityIndex]->bus;
- pEnt->active = xf86Entities[entityIndex]->active;
- pEnt->chipset = xf86Entities[entityIndex]->chipset;
- pEnt->resources = xf86Entities[entityIndex]->resources;
- pEnt->driver = xf86Entities[entityIndex]->driver;
- if ( (xf86Entities[entityIndex]->devices) &&
- (xf86Entities[entityIndex]->devices[0]) ) {
- for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
- if (xf86Entities[entityIndex]->devices[i]->screen == 0)
- break;
- pEnt->device = xf86Entities[entityIndex]->devices[i];
- } else
- pEnt->device = NULL;
-
- return pEnt;
-}
-
-int
-xf86GetNumEntityInstances(int entityIndex)
-{
- if (entityIndex >= xf86NumEntities)
- return -1;
-
- return xf86Entities[entityIndex]->numInstances;
-}
-
-GDevPtr
-xf86GetDevFromEntity(int entityIndex, int instance)
-{
- int i;
-
- /* We might not use AddDevtoEntity */
- if ( (!xf86Entities[entityIndex]->devices) ||
- (!xf86Entities[entityIndex]->devices[0]) )
- return NULL;
-
- if (entityIndex >= xf86NumEntities ||
- instance >= xf86Entities[entityIndex]->numInstances)
- return NULL;
-
- for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
- if (xf86Entities[entityIndex]->devices[i]->screen == instance)
- break;
- return xf86Entities[entityIndex]->devices[i];
-}
-
-/*
- * general generic disable function.
- */
-static void
-disableAccess(void)
-{
- int i;
- xf86AccessPtr pacc;
- EntityAccessPtr peacc;
-
- /* call disable funcs and reset current access pointer */
- /* the entity specific access funcs are in an enabled */
- /* state - driver must restore their state explicitely */
- for (i = 0; i < xf86NumScreens; i++) {
- peacc = xf86Screens[i]->CurrentAccess->pIoAccess;
- while (peacc) {
- if (peacc->pAccess->AccessDisable)
- peacc->pAccess->AccessDisable(peacc->pAccess->arg);
- peacc = peacc->next;
- }
- xf86Screens[i]->CurrentAccess->pIoAccess = NULL;
- peacc = xf86Screens[i]->CurrentAccess->pMemAccess;
- while (peacc) {
- if (peacc->pAccess->AccessDisable)
- peacc->pAccess->AccessDisable(peacc->pAccess->arg);
- peacc = peacc->next;
- }
- xf86Screens[i]->CurrentAccess->pMemAccess = NULL;
- }
- /* then call the generic entity disable funcs */
- for (i = 0; i < xf86NumEntities; i++) {
- pacc = xf86Entities[i]->access->fallback;
- if (pacc->AccessDisable)
- pacc->AccessDisable(pacc->arg);
- }
-}
-
-static void
-clearAccess(void)
-{
- int i;
-
- /* call disable funcs and reset current access pointer */
- /* the entity specific access funcs are in an enabled */
- /* state - driver must restore their state explicitely */
- for (i = 0; i < xf86NumScreens; i++) {
- xf86Screens[i]->CurrentAccess->pIoAccess = NULL;
- xf86Screens[i]->CurrentAccess->pMemAccess = NULL;
- }
-
-}
-
-/*
- * Generic interface to bus specific code - add other buses here
- */
-
-/*
- * xf86AccessInit() - set up everything needed for access control
- * called only once on first server generation.
- */
-void
-xf86AccessInit(void)
-{
- initPciState();
- initPciBusState();
- DisablePciBusAccess();
- DisablePciAccess();
-
- xf86ResAccessEnter = TRUE;
-}
-
-/*
- * xf86AccessEnter() -- gets called to save the text mode VGA IO
- * resources when reentering the server after a VT switch.
- */
-void
-xf86AccessEnter(void)
-{
- if (xf86ResAccessEnter)
- return;
-
- /*
- * on enter we simply disable routing of special resources
- * to any bus and let the RAC code to "open" the right bridges.
- */
- PciBusStateEnter();
- DisablePciBusAccess();
- PciStateEnter();
- disableAccess();
- EntityEnter();
- notifyStateChange(NOTIFY_ENTER);
- xf86EnterServerState(SETUP);
- xf86ResAccessEnter = TRUE;
-}
-
-/*
- * xf86AccessLeave() -- prepares access for and calls the
- * entityLeave() functions.
- * xf86AccessLeaveState() --- gets called to restore the
- * access to the VGA IO resources when switching VT or on
- * server exit.
- * This was split to call xf86AccessLeaveState() from
- * ddxGiveUp().
- */
-void
-xf86AccessLeave(void)
-{
- if (!xf86ResAccessEnter)
- return;
- notifyStateChange(NOTIFY_LEAVE);
- disableAccess();
- DisablePciBusAccess();
- EntityLeave();
-}
-
-void
-xf86AccessLeaveState(void)
-{
- if (!xf86ResAccessEnter)
- return;
- xf86ResAccessEnter = FALSE;
- PciStateLeave();
- PciBusStateLeave();
-}
-
-/*
- * xf86AccessRestoreState() - Restore the access registers to the
- * state before X was started. This is handy for framebuffers.
- */
-static void
-xf86AccessRestoreState(void)
-{
- if (!xf86ResAccessEnter)
- return;
- PciStateLeave();
- PciBusStateLeave();
-}
-
-/*
- * xf86EnableAccess() -- enable access to controlled resources.
- * To reduce latency when switching access the ScrnInfoRec has
- * a linked list of the EntityAccPtr of all screen entities.
- */
-/*
- * switching access needs to be done in te following oder:
- * disable
- * 1. disable old entity
- * 2. reroute bus
- * 3. enable new entity
- * Otherwise resources needed for access control might be shadowed
- * by other resources!
- */
-#ifdef async
-
-static AsyncQPtr *AsyncQ = NULL;
-ScrnInfoPtr xf86CurrentScreen = NULL;
-
-#define SETUP_Q org = AsyncQ; \
- AsyncQ = &new;
-
-#define PROCESS_Q xf86CurrentScreen = pScrn;
- if (!new) AsyncQ = org; \
- else { \
- AsyncQPtr tmp_Q; \
- while (1) {\
- new->func(new->arg);\
- if (!(new->next)) {\
- AsyncQ = org; xfree(new); break; \
- } \
- tmp_Q = new->next; \
- xfree(new); \
- new = tmp_Q; \
- } \
- }
-#else
-#define SETUP_Q
-#define PROCESS_Q
-#endif
-
-void
-xf86EnableAccess(ScrnInfoPtr pScrn)
-{
- register EntityAccessPtr peAcc = (EntityAccessPtr) pScrn->access;
- register EntityAccessPtr pceAcc;
- register xf86AccessPtr pAcc;
- EntityAccessPtr tmp;
-#ifdef async
- AsyncQPtr *org, new = NULL;
-#endif
-
-#ifdef DEBUG
- ErrorF("Enable access %i\n",pScrn->scrnIndex);
-#endif
-
- /* Entity is not under access control or currently enabled */
- if (!pScrn->access) {
- if (pScrn->busAccess) {
- SETUP_Q;
- ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
- PROCESS_Q;
- }
- return;
- }
-
- switch (pScrn->resourceType) {
- case IO:
- pceAcc = pScrn->CurrentAccess->pIoAccess;
- if (peAcc == pceAcc) {
- return;
- }
- SETUP_Q;
- if (pScrn->CurrentAccess->pMemAccess == pceAcc)
- pScrn->CurrentAccess->pMemAccess = NULL;
- while (pceAcc) {
- pAcc = pceAcc->pAccess;
- if ( pAcc && pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pceAcc = pceAcc->next;
- }
- if (pScrn->busAccess)
- ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
- while (peAcc) {
- pAcc = peAcc->pAccess;
- if (pAcc && pAcc->AccessEnable)
- (*pAcc->AccessEnable)(pAcc->arg);
- peAcc = peAcc->next;
- }
- pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access;
- PROCESS_Q;
- return;
-
- case MEM_IO:
- pceAcc = pScrn->CurrentAccess->pIoAccess;
- if (peAcc != pceAcc) { /* current Io != pAccess */
- SETUP_Q;
- tmp = pceAcc;
- while (pceAcc) {
- pAcc = pceAcc->pAccess;
- if (pAcc && pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pceAcc = pceAcc->next;
- }
- pceAcc = pScrn->CurrentAccess->pMemAccess;
- if (peAcc != pceAcc /* current Mem != pAccess */
- && tmp !=pceAcc) {
- while (pceAcc) {
- pAcc = pceAcc->pAccess;
- if (pAcc && pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pceAcc = pceAcc->next;
- }
- }
- } else { /* current Io == pAccess */
- pceAcc = pScrn->CurrentAccess->pMemAccess;
- if (pceAcc == peAcc) { /* current Mem == pAccess */
- return;
- }
- SETUP_Q;
- while (pceAcc) { /* current Mem != pAccess */
- pAcc = pceAcc->pAccess;
- if (pAcc && pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pceAcc = pceAcc->next;
- }
- }
- if (pScrn->busAccess)
- ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
- while (peAcc) {
- pAcc = peAcc->pAccess;
- if (pAcc && pAcc->AccessEnable)
- (*pAcc->AccessEnable)(pAcc->arg);
- peAcc = peAcc->next;
- }
- pScrn->CurrentAccess->pMemAccess =
- pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access;
- PROCESS_Q;
- return;
-
- case MEM:
- pceAcc = pScrn->CurrentAccess->pMemAccess;
- if (peAcc == pceAcc) {
- return;
- }
- SETUP_Q;
- if (pScrn->CurrentAccess->pIoAccess == pceAcc)
- pScrn->CurrentAccess->pIoAccess = NULL;
- while (pceAcc) {
- pAcc = pceAcc->pAccess;
- if ( pAcc && pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pceAcc = pceAcc->next;
- }
- if (pScrn->busAccess)
- ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
- while (peAcc) {
- pAcc = peAcc->pAccess;
- if (pAcc && pAcc->AccessEnable)
- (*pAcc->AccessEnable)(pAcc->arg);
- peAcc = peAcc->next;
- }
- pScrn->CurrentAccess->pMemAccess = (EntityAccessPtr) pScrn->access;
- PROCESS_Q;
- return;
-
- case NONE:
- if (pScrn->busAccess) {
- SETUP_Q;
- ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
- PROCESS_Q;
- }
- return;
- }
-}
-
-void
-xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn)
-{
- EntityAccessPtr pceAcc2 = NULL;
- register EntityAccessPtr pceAcc = NULL;
- register xf86AccessPtr pAcc;
-
-
- switch(pScrn->resourceType) {
- case IO:
- pceAcc = pScrn->CurrentAccess->pIoAccess;
- break;
- case MEM:
- pceAcc = pScrn->CurrentAccess->pMemAccess;
- break;
- case MEM_IO:
- pceAcc = pScrn->CurrentAccess->pMemAccess;
- pceAcc2 = pScrn->CurrentAccess->pIoAccess;
- break;
- default:
- break;
- }
-
- while (pceAcc) {
- pAcc = pceAcc->pAccess;
- if ( pAcc) {
- if (!Enable) {
- if (pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- } else {
- if (pAcc->AccessEnable)
- (*pAcc->AccessEnable)(pAcc->arg);
- }
- }
- pceAcc = pceAcc->next;
- if (!pceAcc) {
- pceAcc = pceAcc2;
- pceAcc2 = NULL;
- }
- }
-}
-
-void
-xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
- xf86SetAccessFuncPtr oldFuncs)
-{
- AccessFuncPtr rac;
-
- if (!xf86Entities[pEnt->index]->rac)
- xf86Entities[pEnt->index]->rac = xnfcalloc(1,sizeof(AccessFuncRec));
-
- rac = xf86Entities[pEnt->index]->rac;
-
- if (funcs->mem == funcs->io_mem && funcs->mem && funcs->io)
- xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_MEM_FROM_IO;
- if (funcs->io == funcs->io_mem && funcs->mem && funcs->io)
- xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_IO_FROM_MEM;
-
- rac->mem_new = funcs->mem;
- rac->io_new = funcs->io;
- rac->io_mem_new = funcs->io_mem;
-
- rac->old = oldFuncs;
-}
-
-/*
- * Conflict checking
- */
-
-static memType
-getMask(memType val)
-{
- memType mask = 0;
- memType tmp = 0;
-
- mask=~mask;
- tmp = ~((~tmp) >> 1);
-
- while (!(val & tmp)) {
- mask = mask >> 1;
- val = val << 1;
- }
- return mask;
-}
-
-/*
- * checkConflictBlock() -- check for conflicts of a block resource range.
- * If conflict is found return end of conflicting range. Else return 0.
- */
-static memType
-checkConflictBlock(resRange *range, resPtr pRes)
-{
- memType val,tmp,prev;
- int i;
-
- switch (pRes->res_type & ResExtMask) {
- case ResBlock:
- if (range->rBegin < pRes->block_end &&
- range->rEnd > pRes->block_begin) {
-#ifdef DEBUG
- ErrorF("b-b conflict w: %lx %lx\n",
- pRes->block_begin,pRes->block_end);
-#endif
- return pRes->block_end < range->rEnd ?
- pRes->block_end : range->rEnd;
- }
- return 0;
- case ResSparse:
- if (pRes->sparse_base > range->rEnd) return 0;
-
- val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd);
-#ifdef DEBUG
- ErrorF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ,"
- "val = 0x%lx\n",
- pRes->sparse_base, pRes->sparse_mask, range->rBegin,
- range->rEnd, val);
-#endif
- i = sizeof(memType) * 8;
- tmp = prev = pRes->sparse_base;
-
- while (i) {
- tmp |= 1<< (--i) & val;
- if (tmp > range->rEnd)
- tmp = prev;
- else
- prev = tmp;
- }
- if (tmp >= range->rBegin) {
-#ifdef DEBUG
- ErrorF("conflict found at: 0x%lx\n",tmp);
- ErrorF("b-d conflict w: %lx %lx\n",
- pRes->sparse_base,pRes->sparse_mask);
-#endif
- return tmp;
- }
- else
- return 0;
- }
- return 0;
-}
-
-/*
- * checkConflictSparse() -- check for conflicts of a sparse resource range.
- * If conflict is found return base of conflicting region. Else return 0.
- */
-#define mt_max ~(memType)0
-#define length sizeof(memType) * 8
-static memType
-checkConflictSparse(resRange *range, resPtr pRes)
-{
- memType val, tmp, prev;
- int i;
-
- switch (pRes->res_type & ResExtMask) {
- case ResSparse:
- tmp = pRes->sparse_mask & range->rMask;
- if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) {
-#ifdef DEBUG
- ErrorF("s-b conflict w: %lx %lx\n",
- pRes->sparse_base,pRes->sparse_mask);
-#endif
- return pRes->sparse_mask;
- }
- return 0;
-
- case ResBlock:
- if (pRes->block_end < range->rBase) return 0;
-
- val = (~range->rMask | range->rBase) & getMask(pRes->block_end);
- i = length;
- tmp = prev = range->rBase;
-
- while (i) {
-#ifdef DEBUG
- ErrorF("tmp = 0x%lx\n",tmp);
-#endif
- tmp |= 1<< (--i) & val;
- if (tmp > pRes->block_end)
- tmp = prev;
- else
- prev = tmp;
- }
- if (tmp < pRes->block_begin)
- return 0;
- else {
- /*
- * now we subdivide the block region in sparse regions
- * with base values = 2^n and find the smallest mask.
- * This might be done in a simpler way....
- */
- memType mask, m_mask = 0, base = pRes->block_begin;
- int i;
- while (base < pRes->block_end) {
- for (i = 1; i < length; i++)
- if ( base != (base & (mt_max << i))) break;
- mask = mt_max >> (length - i);
- do mask >>= 1;
- while ((mask + base + 1) > pRes->block_end);
- /* m_mask and are _inverted_ sparse masks */
- m_mask = mask > m_mask ? mask : m_mask;
- base = base + mask + 1;
- }
-#ifdef DEBUG
- ErrorF("conflict found at: 0x%lx\n",tmp);
- ErrorF("b-b conflict w: %lx %lx\n",
- pRes->block_begin,pRes->block_end);
-#endif
- return ~m_mask;
- }
- }
- return 0;
-}
-#undef mt_max
-#undef length
-
-/*
- * needCheck() -- this function decides whether to check for conflicts
- * depending on the types of the resource ranges and their locations
- */
-static Bool
-needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
-{
- /* the same entity shouldn't conflict with itself */
- ScrnInfoPtr pScrn;
- int i;
- BusType loc = BUS_NONE;
- BusType r_loc = BUS_NONE;
-
- /* Ignore overlapped ranges that have been nullified */
- if ((pRes->res_type & ResOverlap) && (pRes->block_begin > pRes->block_end))
- return FALSE;
-
- if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask))
- return FALSE;
-
- /*
- * Resources set by BIOS (ResBios) are allowed to conflict
- * with resources marked (ResBios).
- */
- if (pRes->res_type & type & ResBios)
- return FALSE;
-
- /*If requested, skip over estimated resources */
- if (pRes->res_type & type & ResEstimated)
- return FALSE;
-
- if (type & pRes->res_type & ResUnused)
- return FALSE;
-
- if (state == OPERATING) {
- if (type & ResDisableOpr || pRes->res_type & ResDisableOpr)
- return FALSE;
- if (type & pRes->res_type & ResUnusedOpr) return FALSE;
- /*
- * Maybe we should have ResUnused set The resUnusedOpr
- * bit, too. This way we could avoid this confusion
- */
- if ((type & ResUnusedOpr && pRes->res_type & ResUnused) ||
- (type & ResUnused && pRes->res_type & ResUnusedOpr))
- return FALSE;
- }
-
- if (entityIndex > -1)
- loc = xf86Entities[entityIndex]->busType;
- if (pRes->entityIndex > -1)
- r_loc = xf86Entities[pRes->entityIndex]->busType;
-
- switch (type & ResAccMask) {
- case ResExclusive:
- switch (pRes->res_type & ResAccMask) {
- case ResExclusive:
- break;
- case ResShared:
- /* ISA buses are only locally exclusive on a PCI system */
- if (loc == BUS_ISA && r_loc == BUS_PCI)
- return FALSE;
- break;
- }
- break;
- case ResShared:
- switch (pRes->res_type & ResAccMask) {
- case ResExclusive:
- /* ISA buses are only locally exclusive on a PCI system */
- if (loc == BUS_PCI && r_loc == BUS_ISA)
- return FALSE;
- break;
- case ResShared:
- return FALSE;
- }
- break;
- case ResAny:
- break;
- }
-
- if (pRes->entityIndex == entityIndex) return FALSE;
-
- if (pRes->entityIndex > -1 &&
- (pScrn = xf86FindScreenForEntity(entityIndex))) {
- for (i = 0; i < pScrn->numEntities; i++)
- if (pScrn->entityList[i] == pRes->entityIndex) return FALSE;
- }
- return TRUE;
-}
-
-/*
- * checkConflict() - main conflict checking function which all other
- * function call.
- */
-static memType
-checkConflict(resRange *rgp, resPtr pRes, int entityIndex,
- xf86State state, Bool ignoreIdentical)
-{
- memType ret;
-
- while(pRes) {
- if (!needCheck(pRes,rgp->type, entityIndex ,state)) {
- pRes = pRes->next;
- continue;
- }
- switch (rgp->type & ResExtMask) {
- case ResBlock:
- if (rgp->rEnd < rgp->rBegin) {
- xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n",
- rgp->rEnd,rgp->rBegin);
- return 0;
- }
- if ((ret = checkConflictBlock(rgp, pRes))) {
- if (!ignoreIdentical || (rgp->rBegin != pRes->block_begin)
- || (rgp->rEnd != pRes->block_end))
- return ret;
- }
- break;
- case ResSparse:
- if ((rgp->rBase & rgp->rMask) != rgp->rBase) {
- xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)"
- "doesn't satisfy (base & mask = mask)\n",
- rgp->rBase, rgp->rMask);
- return 0;
- }
- if ((ret = checkConflictSparse(rgp, pRes))) {
- if (!ignoreIdentical || (rgp->rBase != pRes->sparse_base)
- || (rgp->rMask != pRes->sparse_mask))
- return ret;
- }
- break;
- }
- pRes = pRes->next;
- }
- return 0;
-}
-
-/*
- * ChkConflict() -- used within xxxBus ; find conflict with any location.
- */
-memType
-ChkConflict(resRange *rgp, resPtr res, xf86State state)
-{
- return checkConflict(rgp, res, -2, state,FALSE);
-}
-
-/*
- * xf86ChkConflict() - This function is the low level interface to
- * the resource broker that gets exported. Tests all resources ie.
- * performs test with SETUP flag.
- */
-memType
-xf86ChkConflict(resRange *rgp, int entityIndex)
-{
- return checkConflict(rgp, Acc, entityIndex, SETUP,FALSE);
-}
-
-/*
- * Resources List handling
- */
-
-resPtr
-xf86JoinResLists(resPtr rlist1, resPtr rlist2)
-{
- resPtr pRes;
-
- if (!rlist1)
- return rlist2;
-
- if (!rlist2)
- return rlist1;
-
- for (pRes = rlist1; pRes->next; pRes = pRes->next)
- ;
- pRes->next = rlist2;
- return rlist1;
-}
-
-resPtr
-xf86AddResToList(resPtr rlist, resRange *range, int entityIndex)
-{
- resPtr new;
-
- switch (range->type & ResExtMask) {
- case ResBlock:
- if (range->rEnd < range->rBegin) {
- xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n",
- range->rEnd,range->rBegin);
- return rlist;
- }
- break;
- case ResSparse:
- if ((range->rBase & range->rMask) != range->rBase) {
- xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)"
- "doesn't satisfy (base & mask = mask)\n",
- range->rBase, range->rMask);
- return rlist;
- }
- break;
- }
-
- new = xnfalloc(sizeof(resRec));
- /*
- * Only background resources may be registered with ResBios
- * and ResEstimated set. Other resources only set it for
- * testing.
- */
- if (entityIndex != (-1))
- range->type &= ~(ResBios | ResEstimated);
- new->val = *range;
- new->entityIndex = entityIndex;
- new->next = rlist;
- return new;
-}
-
-void
-xf86FreeResList(resPtr rlist)
-{
- resPtr pRes;
-
- if (!rlist)
- return;
-
- for (pRes = rlist->next; pRes; rlist = pRes, pRes = pRes->next)
- xfree(rlist);
- xfree(rlist);
-}
-
-resPtr
-xf86DupResList(const resPtr rlist)
-{
- resPtr pRes, ret, prev, new;
-
- if (!rlist)
- return NULL;
-
- ret = xnfalloc(sizeof(resRec));
- *ret = *rlist;
- prev = ret;
- for (pRes = rlist->next; pRes; pRes = pRes->next) {
- new = xnfalloc(sizeof(resRec));
- *new = *pRes;
- prev->next = new;
- prev = new;
- }
- return ret;
-}
-
-void
-xf86PrintResList(int verb, resPtr list)
-{
- int i = 0;
- const char *s, *r;
- resPtr tmp = list;
- unsigned long type;
-
- if (!list)
- return;
-
- type = ResMem;
- r = "M";
- while (1) {
- while (list) {
- if ((list->res_type & ResPhysMask) == type) {
- switch (list->res_type & ResExtMask) {
- case ResBlock:
- xf86ErrorFVerb(verb,
- "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx (0x%lx)",
- i, list->entityIndex,
- (list->res_type & ResDomain) >> 24,
- list->block_begin, list->block_end,
- list->block_end - list->block_begin + 1);
- break;
- case ResSparse:
- xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ",
- i, list->entityIndex,
- (list->res_type & ResDomain) >> 24,
- list->sparse_base,list->sparse_mask);
- break;
- default:
- list = list->next;
- continue;
- }
- xf86ErrorFVerb(verb, " %s", r);
- switch (list->res_type & ResAccMask) {
- case ResExclusive:
- if (list->res_type & ResUnused)
- s = "x";
- else
- s = "X";
- break;
- case ResShared:
- if (list->res_type & ResUnused)
- s = "s";
- else
- s = "S";
- break;
- default:
- s = "?";
- }
- xf86ErrorFVerb(verb, "%s", s);
- switch (list->res_type & ResExtMask) {
- case ResBlock:
- s = "[B]";
- break;
- case ResSparse:
- s = "[S]";
- break;
- default:
- s = "[?]";
- }
- xf86ErrorFVerb(verb, "%s", s);
- if (list->res_type & ResEstimated)
- xf86ErrorFVerb(verb, "E");
- if (list->res_type & ResOverlap)
- xf86ErrorFVerb(verb, "O");
- if (list->res_type & ResInit)
- xf86ErrorFVerb(verb, "t");
- if (list->res_type & ResBios)
- xf86ErrorFVerb(verb, "(B)");
- if (list->res_type & ResBus)
- xf86ErrorFVerb(verb, "(b)");
- if (list->res_type & ResOprMask) {
- switch (list->res_type & ResOprMask) {
- case ResUnusedOpr:
- s = "(OprU)";
- break;
- case ResDisableOpr:
- s = "(OprD)";
- break;
- default:
- s = "(Opr?)";
- break;
- }
- xf86ErrorFVerb(verb, "%s", s);
- }
- xf86ErrorFVerb(verb, "\n");
- i++;
- }
- list = list->next;
- }
- if (type == ResIo) break;
- type = ResIo;
- r = "I";
- list = tmp;
- }
-}
-
-resPtr
-xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex)
-{
- while(pRange && pRange->type != ResEnd) {
- list = xf86AddResToList(list,pRange,entityIndex);
- pRange++;
- }
- return list;
-}
-
-void
-xf86ResourceBrokerInit(void)
-{
- resPtr resPci;
-
- osRes = NULL;
-
- /* Get the addressable ranges */
- ResRange = xf86BusAccWindowsFromOS();
- xf86MsgVerb(X_INFO, 3, "Addressable bus resource ranges are\n");
- xf86PrintResList(3, ResRange);
-
- /* Get the ranges used exclusively by the system */
- osRes = xf86AccResFromOS(osRes);
- xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges:\n");
- xf86PrintResList(3, osRes);
-
- /* Bus dep initialization */
- resPci = ResourceBrokerInitPci(&osRes);
- Acc = xf86JoinResLists(xf86DupResList(osRes), resPci);
-
- xf86MsgVerb(X_INFO, 3, "All system resource ranges:\n");
- xf86PrintResList(3, Acc);
-
-}
-
-#define MEM_ALIGN (1024 * 1024)
-
-/*
- * RemoveOverlaps() -- remove overlaps between resources of the
- * same kind.
- * Beware: This function doesn't check for access attributes.
- * At resource broker initialization this is no problem as this
- * only deals with exclusive resources.
- */
-void
-RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated)
-{
- resPtr pRes;
- memType size, newsize, adjust;
-
- for (pRes = list; pRes; pRes = pRes->next) {
- if (pRes != target
- && ((pRes->res_type & ResTypeMask) ==
- (target->res_type & ResTypeMask))
- && pRes->block_begin <= target->block_end
- && pRes->block_end >= target->block_begin) {
- /* Possibly ignore estimated resources */
- if (!useEstimated && (pRes->res_type & ResEstimated)) continue;
- /*
- * Target should be a larger region than pRes. If pRes fully
- * contains target, don't do anything unless target can overlap.
- */
- if (pRes->block_begin <= target->block_begin &&
- pRes->block_end >= target->block_end) {
- if (target->res_type & ResOverlap) {
- /* Nullify range but keep its ResOverlap bit on */
- target->block_end = target->block_begin - 1;
- return;
- }
- continue;
- }
- /*
- * In cases where the target and pRes have the same starting
- * address, reduce the size of the target (given it's an estimate).
- */
- if (pRes->block_begin == target->block_begin) {
- if (target->res_type & ResOverlap)
- target->block_end = target->block_begin - 1;
- else
- target->block_end = pRes->block_end;
- }
- /* Otherwise, trim target to remove the overlap */
- else if (pRes->block_begin <= target->block_end) {
- target->block_end = pRes->block_begin - 1;
- } else if (!pow2Alignment &&
- pRes->block_end >= target->block_begin) {
- target->block_begin = pRes->block_end + 1;
- }
- if (pow2Alignment) {
- /*
- * Align to a power of two. This requires finding the
- * largest power of two that is smaller than the adjusted
- * size.
- */
- size = target->block_end - target->block_begin + 1;
- newsize = 1UL << (sizeof(memType) * 8 - 1);
- while (!(newsize & size))
- newsize >>= 1;
- target->block_end = target->block_begin + newsize - 1;
- } else if (target->block_end > MEM_ALIGN) {
- /* Align the end to MEM_ALIGN */
- if ((adjust = (target->block_end + 1) % MEM_ALIGN))
- target->block_end -= adjust;
- }
- }
- }
-}
-
-/*
- * Resource request code
- */
-
-#define ALIGN(x,a) ((x) + a) &~(a)
-
-resRange
-xf86GetBlock(unsigned long type, memType size,
- memType window_start, memType window_end,
- memType align_mask, resPtr avoid)
-{
- memType min, max, tmp;
- resRange r = {ResEnd,0,0};
- resPtr res_range = ResRange;
-
- if (!size) return r;
- if (window_end < window_start || (window_end - window_start) < (size - 1)) {
- ErrorF("Requesting insufficient memory window!:"
- " start: 0x%lx end: 0x%lx size 0x%lx\n",
- window_start,window_end,size);
- return r;
- }
- type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResBlock;
-
- while (res_range) {
- if ((type & ResTypeMask) == (res_range->res_type & ResTypeMask)) {
- if (res_range->block_begin > window_start)
- min = res_range->block_begin;
- else
- min = window_start;
- if (res_range->block_end < window_end)
- max = res_range->block_end;
- else
- max = window_end;
- min = ALIGN(min,align_mask);
- /* do not produce an overflow! */
- while (min < max && (max - min) >= (size - 1)) {
- RANGE(r,min,min + size - 1,type);
- tmp = ChkConflict(&r,Acc,SETUP);
- if (!tmp) {
- tmp = ChkConflict(&r,avoid,SETUP);
- if (!tmp) {
- return r;
- }
- }
- min = ALIGN(tmp,align_mask);
- }
- }
- res_range = res_range->next;
- }
- RANGE(r,0,0,ResEnd);
- return r;
-}
-
-#define mt_max ~(memType)0
-#define length sizeof(memType) * 8
-/*
- * make_base() -- assign the lowest bits to the bits set in mask.
- * example: mask 011010 val 0000110 -> 011000
- */
-static memType
-make_base(memType val, memType mask)
-{
- int i,j = 0;
- memType ret = 0
- ;
- for (i = 0;i<length;i++) {
- if ((1 << i) & mask) {
- ret |= (((val >> j) & 1) << i);
- j++;
- }
- }
- return ret;
-}
-
-/*
- * make_base() -- assign the bits set in mask to the lowest bits.
- * example: mask 011010 , val 010010 -> 000011
- */
-static memType
-unmake_base(memType val, memType mask)
-{
- int i,j = 0;
- memType ret = 0;
-
- for (i = 0;i<length;i++) {
- if ((1 << i) & mask) {
- ret |= (((val >> i) & 1) << j);
- j++;
- }
- }
- return ret;
-}
-
-static memType
-fix_counter(memType val, memType old_mask, memType mask)
-{
- mask = old_mask & mask;
-
- val = make_base(val,old_mask);
- return unmake_base(val,mask);
-}
-
-resRange
-xf86GetSparse(unsigned long type, memType fixed_bits,
- memType decode_mask, memType address_mask, resPtr avoid)
-{
- resRange r = {ResEnd,0,0};
- memType new_mask;
- memType mask1;
- memType base;
- memType counter = 0;
- memType counter1;
- memType max_counter = ~(memType)0;
- memType max_counter1;
- memType conflict = 0;
-
- /* for sanity */
- type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse;
-
- /*
- * a sparse address consists of 3 parts:
- * fixed_bits: F bits which hard decoded by the hardware
- * decode_bits: D bits which are used to decode address
- * but which may be set by software
- * address_bits: A bits which are used to address the
- * sparse range.
- * the decode_mask marks all decode bits while the address_mask
- * masks out all address_bits:
- * F D A
- * decode_mask: 0 1 0
- * address_mask: 1 1 0
- */
- decode_mask &= address_mask;
- new_mask = decode_mask;
-
- /*
- * We start by setting the decode_mask bits to different values
- * when a conflict is found the address_mask of the conflicting
- * resource is returned. We remove those bits from decode_mask
- * that are also set in the returned address_mask as they always
- * conflict with resources which use them as address masks.
- * The resoulting mask is stored in new_mask.
- * We continue until no conflict is found or until we have
- * tried all possible settings of new_mask.
- */
- while (1) {
- base = make_base(counter,new_mask) | fixed_bits;
- RANGE(r,base,address_mask,type);
- conflict = ChkConflict(&r,Acc,SETUP);
- if (!conflict) {
- conflict = ChkConflict(&r,avoid,SETUP);
- if (!conflict) {
- return r;
- }
- }
- counter = fix_counter(counter,new_mask,conflict);
- max_counter = fix_counter(max_counter,new_mask,conflict);
- new_mask &= conflict;
- counter ++;
- if (counter > max_counter) break;
- }
- if (!new_mask && (new_mask == decode_mask)) {
- RANGE(r,0,0,ResEnd);
- return r;
- }
- /*
- * if we haven't been successful we also try to modify those
- * bits in decode_mask that are not at the same time set in
- * new mask. These bits overlap with address_bits of some
- * resources. If a conflict with a resource of this kind is
- * found (ie. returned_mask & mask1 != mask1) with
- * mask1 = decode_mask & ~new_mask we cannot
- * use our choice of bits in the new_mask part. We try
- * another choice.
- */
- max_counter = fix_counter(mt_max,mt_max,new_mask);
- mask1 = decode_mask & ~new_mask;
- max_counter1 = fix_counter(mt_max,mt_max,mask1);
- counter = 0;
-
- while (1) {
- counter1 = 0;
- while (1) {
- base = make_base(counter1,mask1);
- RANGE(r,base,address_mask,type);
- conflict = ChkConflict(&r,Acc,SETUP);
- if (!conflict) {
- conflict = ChkConflict(&r,avoid,SETUP);
- if (!conflict) {
- return r;
- }
- }
- counter1 ++;
- if ((mask1 & conflict) != mask1 || counter1 > max_counter1)
- break;
- }
- counter ++;
- if (counter > max_counter) break;
- }
- RANGE(r,0,0,ResEnd);
- return r;
-}
-
-#undef length
-#undef mt_max
-
-/*
- * Resource registrarion
- */
-
-static resList
-xf86GetResourcesImplicitly(int entityIndex)
-{
- if (entityIndex >= xf86NumEntities) return NULL;
-
- switch (xf86Entities[entityIndex]->bus.type) {
- case BUS_ISA:
- case BUS_NONE:
- case BUS_SBUS:
- return NULL;
- case BUS_PCI:
- return GetImplicitPciResources(entityIndex);
- case BUS_last:
- return NULL;
- }
- return NULL;
-}
-
-static void
-convertRange2Host(int entityIndex, resRange *pRange)
-{
- if (pRange->type & ResBus) {
- switch (xf86Entities[entityIndex]->busType) {
- case BUS_PCI:
- pciConvertRange2Host(entityIndex,pRange);
- break;
- case BUS_ISA:
- isaConvertRange2Host(pRange);
- break;
- default:
- break;
- }
-
- pRange->type &= ~ResBus;
- }
-}
-
-/*
- * xf86RegisterResources() -- attempts to register listed resources.
- * If list is NULL it tries to obtain resources implicitly. Function
- * returns a resPtr listing all resources not successfully registered.
- */
-
-resPtr
-xf86RegisterResources(int entityIndex, resList list, unsigned long access)
-{
- resPtr res = NULL;
- resRange range;
- resList list_f = NULL;
-
- if (!list) {
- list = xf86GetResourcesImplicitly(entityIndex);
- /* these resources have to be in host address space already */
- if (!list) return NULL;
- list_f = list;
- }
-
- while(list->type != ResEnd) {
- range = *list;
-
- convertRange2Host(entityIndex,&range);
-
- if ((access != ResNone) && (access & ResAccMask)) {
- range.type = (range.type & ~ResAccMask) | (access & ResAccMask);
- }
- range.type &= ~ResEstimated; /* Not allowed for drivers */
-#if !(defined(__alpha__) && defined(linux))
- /* On Alpha Linux, do not check for conflicts, trust the kernel. */
- if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE))
- res = xf86AddResToList(res,&range,entityIndex);
- else
-#endif
- {
- Acc = xf86AddResToList(Acc,&range,entityIndex);
- }
- list++;
- }
- if (list_f)
- xfree(list_f);
-
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n");
- xf86PrintResList(3, Acc);
- if (res) xf86MsgVerb(X_INFO, 3,
- "Failed Resources after driver initialization "
- "for Entity: %i\n",entityIndex);
- xf86PrintResList(3, res);
-#endif
- return res;
-
-}
-
-static void
-busTypeSpecific(EntityPtr pEnt, xf86State state, xf86AccessPtr *acc_mem,
- xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io)
-{
- pciAccPtr *ppaccp;
-
- switch (pEnt->bus.type) {
- case BUS_ISA:
- case BUS_SBUS:
- *acc_mem = *acc_io = *acc_mem_io = &AccessNULL;
- break;
- break;
- case BUS_PCI:
- ppaccp = xf86PciAccInfo;
- while (*ppaccp) {
- if ((*ppaccp)->busnum == pEnt->pciBusId.bus
- && (*ppaccp)->devnum == pEnt->pciBusId.device
- && (*ppaccp)->funcnum == pEnt->pciBusId.func) {
- *acc_io = &(*ppaccp)->ioAccess;
- *acc_mem = &(*ppaccp)->memAccess;
- *acc_mem_io = &(*ppaccp)->io_memAccess;
- break;
- }
- ppaccp++;
- }
- break;
- default:
- *acc_mem = *acc_io = *acc_mem_io = NULL;
- break;
- }
- return;
-}
-
-static void
-setAccess(EntityPtr pEnt, xf86State state)
-{
-
- xf86AccessPtr acc_mem, acc_io, acc_mem_io;
- xf86AccessPtr org_mem = NULL, org_io = NULL, org_mem_io = NULL;
- int prop;
-
- busTypeSpecific(pEnt,state,&acc_mem,&acc_io,&acc_mem_io);
-
- /* The replacement function needs to handle _all_ shared resources */
- /* unless they are handeled locally and disabled otherwise */
- if (pEnt->rac) {
- if (pEnt->rac->io_new) {
- org_io = acc_io;
- acc_io = pEnt->rac->io_new;
- }
- if (pEnt->rac->mem_new) {
- org_mem = acc_mem;
- acc_mem = pEnt->rac->mem_new;
- }
- if (pEnt->rac->io_mem_new) {
- org_mem_io = acc_mem_io;
- acc_mem_io = pEnt->rac->io_mem_new;
- }
- }
-
- if (state == OPERATING) {
- prop = pEnt->entityProp;
- switch(pEnt->entityProp & NEED_SHARED) {
- case NEED_SHARED:
- pEnt->access->rt = MEM_IO;
- break;
- case NEED_IO_SHARED:
- pEnt->access->rt = IO;
- break;
- case NEED_MEM_SHARED:
- pEnt->access->rt = MEM;
- break;
- default:
- pEnt->access->rt = NONE;
- }
- } else {
- prop = NEED_SHARED | NEED_MEM | NEED_IO;
- pEnt->access->rt = MEM_IO;
- }
-
- switch(pEnt->access->rt) {
- case IO:
- pEnt->access->pAccess = acc_io;
- break;
- case MEM:
- pEnt->access->pAccess = acc_mem;
- break;
- case MEM_IO:
- pEnt->access->pAccess = acc_mem_io;
- break;
- default: /* no conflicts at all */
- pEnt->access->pAccess = NULL; /* remove from RAC */
- break;
- }
-
- if (org_io) {
- /* does the driver want the old access func? */
- if (pEnt->rac->old) {
- /* give it to the driver, leave state disabled */
- pEnt->rac->old->io = org_io;
- } else if (org_io->AccessEnable) {
- /* driver doesn't want it - enable generic access */
- org_io->AccessEnable(org_io->arg);
- }
- }
-
- if (org_mem_io) {
- /* does the driver want the old access func? */
- if (pEnt->rac->old) {
- /* give it to the driver, leave state disabled */
- pEnt->rac->old->io_mem = org_mem_io;
- } else if (org_mem_io->AccessEnable) {
- /* driver doesn't want it - enable generic access */
- org_mem_io->AccessEnable(org_mem_io->arg);
- }
- }
-
- if (org_mem) {
- /* does the driver want the old access func? */
- if (pEnt->rac->old) {
- /* give it to the driver, leave state disabled */
- pEnt->rac->old->mem = org_mem;
- } else if (org_mem->AccessEnable) {
- /* driver doesn't want it - enable generic access */
- org_mem->AccessEnable(org_mem->arg);
- }
- }
-
- if (!(prop & NEED_MEM_SHARED)){
- if (prop & NEED_MEM) {
- if (acc_mem && acc_mem->AccessEnable)
- acc_mem->AccessEnable(acc_mem->arg);
- } else {
- if (acc_mem && acc_mem->AccessDisable)
- acc_mem->AccessDisable(acc_mem->arg);
- }
- }
-
- if (!(prop & NEED_IO_SHARED)) {
- if (prop & NEED_IO) {
- if (acc_io && acc_io->AccessEnable)
- acc_io->AccessEnable(acc_io->arg);
- } else {
- if (acc_io && acc_io->AccessDisable)
- acc_io->AccessDisable(acc_io->arg);
- }
- }
-
- /* disable shared resources */
- if (pEnt->access->pAccess
- && pEnt->access->pAccess->AccessDisable)
- pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg);
-
- /*
- * If device is not under access control it is enabled.
- * If it needs bus routing do it here as it isn't bus
- * type specific. Any conflicts should be checked at this
- * stage
- */
- if (!pEnt->access->pAccess
- && (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP :
- NEED_VGA_ROUTED)))
- ((BusAccPtr)pEnt->busAcc)->set_f(pEnt->busAcc);
-}
-
-
-/*
- * xf86EnterServerState() -- set state the server is in.
- */
-
-typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState;
-
-static void
-SetSIGIOForState(xf86State state)
-{
- static int sigio_state;
- static TriState sigio_blocked = TRI_UNSET;
-
- if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) {
- sigio_state = xf86BlockSIGIO();
- sigio_blocked = TRI_TRUE;
- } else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) {
- xf86UnblockSIGIO(sigio_state);
- sigio_blocked = TRI_FALSE;
- }
-}
-
-void
-xf86EnterServerState(xf86State state)
-{
- EntityPtr pEnt;
- ScrnInfoPtr pScrn;
- int i,j;
- int needVGA = 0;
- resType rt;
- /*
- * This is a good place to block SIGIO during SETUP state.
- * SIGIO should be blocked in SETUP state otherwise (u)sleep()
- * might get interrupted early.
- * We take care not to call xf86BlockSIGIO() twice.
- */
- SetSIGIOForState(state);
-#ifdef DEBUG
- if (state == SETUP)
- ErrorF("Entering SETUP state\n");
- else
- ErrorF("Entering OPERATING state\n");
-#endif
-
- /* When servicing a dumb framebuffer we don't need to do anything */
- if (doFramebufferMode) return;
-
- for (i=0; i<xf86NumScreens; i++) {
- pScrn = xf86Screens[i];
- j = pScrn->entityList[pScrn->numEntities - 1];
- pScrn->access = xf86Entities[j]->access;
-
- for (j = 0; j<xf86Screens[i]->numEntities; j++) {
- pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
- if (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP
- : NEED_VGA_ROUTED))
- xf86Screens[i]->busAccess = pEnt->busAcc;
- }
- if (xf86Screens[i]->busAccess)
- needVGA ++;
- }
-
- /*
- * if we just have one screen we don't have RAC.
- * Therefore just enable the screen and return.
- */
- if (!needRAC) {
- xf86EnableAccess(xf86Screens[0]);
- notifyStateChange(NOTIFY_ENABLE);
- return;
- }
-
- if (state == SETUP)
- notifyStateChange(NOTIFY_SETUP_TRANSITION);
- else
- notifyStateChange(NOTIFY_OPERATING_TRANSITION);
-
- clearAccess();
- for (i=0; i<xf86NumScreens;i++) {
-
- rt = NONE;
-
- for (j = 0; j<xf86Screens[i]->numEntities; j++) {
- pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
- setAccess(pEnt,state);
-
- if (pEnt->access->rt != NONE) {
- if (rt != NONE && rt != pEnt->access->rt)
- rt = MEM_IO;
- else
- rt = pEnt->access->rt;
- }
- }
- xf86Screens[i]->resourceType = rt;
- if (rt == NONE) {
- xf86Screens[i]->access = NULL;
- if (needVGA < 2)
- xf86Screens[i]->busAccess = NULL;
- }
-
-#ifdef DEBUG
- if (xf86Screens[i]->busAccess)
- ErrorF("Screen %i setting vga route\n",i);
-#endif
- switch (rt) {
- case MEM_IO:
- xf86MsgVerb(X_INFO, 3, "Screen %i shares mem & io resources\n",i);
- break;
- case IO:
- xf86MsgVerb(X_INFO, 3, "Screen %i shares io resources\n",i);
- break;
- case MEM:
- xf86MsgVerb(X_INFO, 3, "Screen %i shares mem resources\n",i);
- break;
- default:
- xf86MsgVerb(X_INFO, 3, "Entity %i shares no resources\n",i);
- break;
- }
- }
- if (state == SETUP)
- notifyStateChange(NOTIFY_SETUP);
- else
- notifyStateChange(NOTIFY_OPERATING);
-}
-
-/*
- * xf86SetOperatingState() -- Set ResOperMask for resources listed.
- */
-resPtr
-xf86SetOperatingState(resList list, int entityIndex, int mask)
-{
- resPtr acc;
- resPtr r_fail = NULL;
- resRange range;
-
- while (list->type != ResEnd) {
- range = *list;
- convertRange2Host(entityIndex,&range);
-
- acc = Acc;
- while (acc) {
-#define MASK (ResTypeMask | ResExtMask)
- if ((acc->entityIndex == entityIndex)
- && (acc->val.a == range.a) && (acc->val.b == range.b)
- && ((acc->val.type & MASK) == (range.type & MASK)))
- break;
-#undef MASK
- acc = acc->next;
- }
- if (acc)
- acc->val.type = (acc->val.type & ~ResOprMask)
- | (mask & ResOprMask);
- else {
- r_fail = xf86AddResToList(r_fail,&range,entityIndex);
- }
- list ++;
- }
-
- return r_fail;
-}
-
-/*
- * Stage specific code
- */
- /*
- * ProcessEstimatedConflicts() -- Do something about driver-registered
- * resources that conflict with estimated resources. For now, just register
- * them with a logged warning.
- */
-#ifdef REDUCER
-static void
-ProcessEstimatedConflicts(void)
-{
- if (!AccReducers)
- return;
-
- /* Temporary */
- xf86MsgVerb(X_WARNING, 3,
- "Registering the following despite conflicts with estimated"
- " resources:\n");
- xf86PrintResList(3, AccReducers);
- Acc = xf86JoinResLists(Acc, AccReducers);
- AccReducers = NULL;
-}
-#endif
-
-/*
- * xf86ClaimFixedResources() -- This function gets called from the
- * driver Probe() function to claim fixed resources.
- */
-static void
-resError(resList list)
-{
- FatalError("A driver tried to allocate the %s %sresource at \n"
- "0x%lx:0x%lx which conflicted with another resource. Send the\n"
- "output of the server to %s. Please \n"
- "specify your computer hardware as closely as possible.\n",
- ResIsBlock(list)?"Block":"Sparse",
- ResIsMem(list)?"Mem":"Io",
- ResIsBlock(list)?list->rBegin:list->rBase,
- ResIsBlock(list)?list->rEnd:list->rMask,BUILDERADDR);
-}
-
-/*
- * xf86ClaimFixedResources() is used to allocate non-relocatable resources.
- * This should only be done by a driver's Probe() function.
- */
-void
-xf86ClaimFixedResources(resList list, int entityIndex)
-{
- resPtr ptr = NULL;
- resRange range;
-
- if (!list) return;
-
- while (list->type !=ResEnd) {
- range = *list;
-
- convertRange2Host(entityIndex,&range);
-
- range.type &= ~ResEstimated; /* Not allowed for drivers */
- switch (range.type & ResAccMask) {
- case ResExclusive:
- if (!xf86ChkConflict(&range, entityIndex)) {
- Acc = xf86AddResToList(Acc, &range, entityIndex);
-#ifdef REDUCER
- } else {
- range.type |= ResEstimated;
- if (!xf86ChkConflict(&range, entityIndex) &&
- !checkConflict(&range, AccReducers, entityIndex,
- SETUP, FALSE)) {
- range.type &= ~(ResEstimated | ResBios);
- AccReducers =
- xf86AddResToList(AccReducers, &range, entityIndex);
-#endif
- } else resError(&range); /* no return */
-#ifdef REDUCER
- }
-#endif
- break;
- case ResShared:
- /* at this stage the resources are just added to the
- * EntityRec. After the Probe() phase this list is checked by
- * xf86PostProbe(). All resources which don't
- * conflict with already allocated ones are allocated
- * and removed from the EntityRec. Thus a non-empty resource
- * list in the EntityRec indicates resource conflicts the
- * driver should either handle or fail.
- */
- if (xf86Entities[entityIndex]->active)
- ptr = xf86AddResToList(ptr,&range,entityIndex);
- break;
- }
- list++;
- }
- xf86Entities[entityIndex]->resources =
- xf86JoinResLists(xf86Entities[entityIndex]->resources,ptr);
- xf86MsgVerb(X_INFO, 3,
- "resource ranges after xf86ClaimFixedResources() call:\n");
- xf86PrintResList(3,Acc);
-#ifdef REDUCER
- ProcessEstimatedConflicts();
-#endif
-#ifdef DEBUG
- if (ptr) {
- xf86MsgVerb(X_INFO, 3, "to be registered later:\n");
- xf86PrintResList(3,ptr);
- }
-#endif
-}
-
-static void
-checkRoutingForScreens(xf86State state)
-{
- resList list = resVgaUnusedExclusive;
- resPtr pResVGA = NULL;
- resPtr pResVGAHost;
- pointer vga = NULL;
- int i,j;
- int entityIndex;
- EntityPtr pEnt;
- resPtr pAcc;
- resRange range;
-
- /*
- * find devices that need VGA routed: ie the ones that have
- * registered VGA resources without ResUnused. ResUnused
- * doesn't conflict with itself therefore use it here.
- */
- while (list->type != ResEnd) { /* create resPtr from resList for VGA */
- range = *list;
- range.type &= ~(ResBios | ResEstimated); /* if set remove them */
- pResVGA = xf86AddResToList(pResVGA, &range, -1);
- list++;
- }
-
- for (i = 0; i < xf86NumScreens; i++) {
- for (j = 0; j < xf86Screens[i]->numEntities; j++) {
- entityIndex = xf86Screens[i]->entityList[j];
- pEnt = xf86Entities[entityIndex];
- pAcc = Acc;
- vga = NULL;
- pResVGAHost = xf86DupResList(pResVGA);
- xf86ConvertListToHost(entityIndex,pResVGAHost);
- while (pAcc) {
- if (pAcc->entityIndex == entityIndex)
- if (checkConflict(&pAcc->val, pResVGAHost,
- entityIndex, state, FALSE)) {
- if (vga && vga != pEnt->busAcc) {
- xf86Msg(X_ERROR, "Screen %i needs vga routed to"
- "different buses - deleting\n",i);
- xf86DeleteScreen(i--,0);
- }
-#ifdef DEBUG
- {
- resPtr rlist = xf86AddResToList(NULL,&pAcc->val,
- pAcc->entityIndex);
- xf86MsgVerb(X_INFO,3,"====== %s\n",
- state == OPERATING ? "OPERATING"
- : "SETUP");
- xf86MsgVerb(X_INFO,3,"%s Resource:\n",
- (pAcc->val.type) & ResMem ? "Mem" :"Io");
- xf86PrintResList(3,rlist);
- xf86FreeResList(rlist);
- xf86MsgVerb(X_INFO,3,"Conflicts with:\n");
- xf86PrintResList(3,pResVGAHost);
- xf86MsgVerb(X_INFO,3,"=====\n");
- }
-#endif
- vga = pEnt->busAcc;
- pEnt->entityProp |= (state == SETUP
- ? NEED_VGA_ROUTED_SETUP : NEED_VGA_ROUTED);
- if (state == OPERATING) {
- if (pAcc->val.type & ResMem)
- pEnt->entityProp |= NEED_VGA_MEM;
- else
- pEnt->entityProp |= NEED_VGA_IO;
- }
- }
- pAcc = pAcc->next;
- }
- if (vga)
- xf86MsgVerb(X_INFO, 3,"Setting vga for screen %i.\n",i);
- xf86FreeResList(pResVGAHost);
- }
- }
- xf86FreeResList(pResVGA);
-}
-
-/*
- * xf86PostProbe() -- Allocate all non conflicting resources
- * This function gets called by xf86Init().
- */
-void
-xf86PostProbe(void)
-{
- memType val;
- int i,j;
- resPtr resp, acc, tmp, resp_x, *pprev_next;
-
- if (fbSlotClaimed) {
- if (pciSlotClaimed || isaSlotClaimed
-#if defined(__sparc__) && !defined(__OpenBSD__)
- || sbusSlotClaimed
-#endif
- ) {
- FatalError("Cannot run in framebuffer mode. Please specify busIDs "
- " for all framebuffer devices\n");
- return;
- } else {
- xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
- xf86AccessRestoreState();
- notifyStateChange(NOTIFY_ENABLE);
- doFramebufferMode = TRUE;
-
- return;
- }
- }
- /* don't compare against ResInit - remove it from clone.*/
- acc = tmp = xf86DupResList(Acc);
- pprev_next = &acc;
- while (tmp) {
- if (tmp->res_type & ResInit) {
- (*pprev_next) = tmp->next;
- xfree(tmp);
- } else
- pprev_next = &(tmp->next);
- tmp = (*pprev_next);
- }
-
- for (i=0; i<xf86NumEntities; i++) {
- resp = xf86Entities[i]->resources;
- xf86Entities[i]->resources = NULL;
- resp_x = NULL;
- while (resp) {
- if (! (val = checkConflict(&resp->val,acc,i,SETUP,FALSE))) {
- resp->res_type &= ~(ResBios); /* just used for chkConflict() */
- tmp = resp_x;
- resp_x = resp;
- resp = resp->next;
- resp_x->next = tmp;
-#ifdef REDUCER
- } else {
- resp->res_type |= ResEstimated;
- if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) {
- resp->res_type &= ~(ResEstimated | ResBios);
- tmp = AccReducers;
- AccReducers = resp;
- resp = resp->next;
- AccReducers->next = tmp;
-#endif
- } else {
- xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n",val);
- resp->res_type &= ~ResEstimated;
- tmp = xf86Entities[i]->resources;
- xf86Entities[i]->resources = resp;
- resp = resp->next;
- xf86Entities[i]->resources->next = tmp;
- }
-#ifdef REDUCER
- }
-#endif
- }
- xf86JoinResLists(Acc,resp_x);
-#ifdef REDUCER
- ProcessEstimatedConflicts();
-#endif
- }
- xf86FreeResList(acc);
-
-#if !(defined(__alpha__) && defined(linux)) && \
- !(defined(__sparc64__) && defined(__OpenBSD__))
- /*
- * No need to validate on Alpha Linux or OpenBSD/sparc64,
- * trust the kernel.
- */
- ValidatePci();
-#endif
-
- xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n");
- xf86PrintResList(3, Acc);
- checkRoutingForScreens(SETUP);
-
- for (i = 0; i < xf86NumScreens; i++) {
- for (j = 0; j<xf86Screens[i]->numEntities; j++) {
- EntityPtr pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
- if ((pEnt->entityProp & NEED_VGA_ROUTED_SETUP) &&
- ((xf86Screens[i]->busAccess = pEnt->busAcc)))
- break;
- }
- }
-}
-
-static void
-checkRequiredResources(int entityIndex)
-{
- resRange range;
- resPtr pAcc = Acc;
- const EntityPtr pEnt = xf86Entities[entityIndex];
- while (pAcc) {
- if (pAcc->entityIndex == entityIndex) {
- range = pAcc->val;
- /* ResAny to find conflicts with anything. */
- range.type = (range.type & ~ResAccMask) | ResAny | ResBios;
- if (checkConflict(&range,Acc,entityIndex,OPERATING,FALSE))
- switch (pAcc->res_type & ResPhysMask) {
- case ResMem:
- pEnt->entityProp |= NEED_MEM_SHARED;
- break;
- case ResIo:
- pEnt->entityProp |= NEED_IO_SHARED;
- break;
- }
- if (!(pAcc->res_type & ResOprMask)) {
- switch (pAcc->res_type & ResPhysMask) {
- case ResMem:
- pEnt->entityProp |= NEED_MEM;
- break;
- case ResIo:
- pEnt->entityProp |= NEED_IO;
- break;
- }
- }
- }
- pAcc = pAcc->next;
- }
-
- /* check if we can separately enable mem/io resources */
- /* XXX we still need to find out how to set this yet */
- if ( ((pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)
- && (pEnt->entityProp & NEED_MEM_SHARED))
- || ((pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)
- && (pEnt->entityProp & NEED_IO_SHARED)) )
- pEnt->entityProp |= NEED_SHARED;
- /*
- * After we have checked all resources of an entity agains any
- * other resource we know if the entity need this resource type
- * (ie. mem/io) at all. if not we can disable this type completely,
- * so no need to share it either.
- */
- if ((pEnt->entityProp & NEED_MEM_SHARED)
- && (!(pEnt->entityProp & NEED_MEM))
- && (!(pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)))
- pEnt->entityProp &= ~(unsigned long)NEED_MEM_SHARED;
-
- if ((pEnt->entityProp & NEED_IO_SHARED)
- && (!(pEnt->entityProp & NEED_IO))
- && (!(pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)))
- pEnt->entityProp &= ~(unsigned long)NEED_IO_SHARED;
-}
-
-void
-xf86PostPreInit()
-{
- if (doFramebufferMode) return;
-
- if (xf86NumScreens > 1)
- needRAC = TRUE;
-
-#ifdef XFree86LOADER
- xf86MsgVerb(X_INFO, 3, "do I need RAC?");
-
- if (needRAC) {
- xf86ErrorFVerb(3, " Yes, I do.\n");
-
- if (!xf86LoadOneModule("rac",NULL))
- FatalError("Cannot load RAC module\n");
- } else
- xf86ErrorFVerb(3, " No, I don't.\n");
-#endif
-
- xf86MsgVerb(X_INFO, 3, "resource ranges after preInit:\n");
- xf86PrintResList(3, Acc);
-}
-
-void
-xf86PostScreenInit(void)
-{
- int i,j;
- ScreenPtr pScreen;
- unsigned int flags;
- int nummem = 0, numio = 0;
-#ifdef XFree86LOADER
- pointer xf86RACInit = NULL;
-#endif
-
- if (doFramebufferMode) {
- SetSIGIOForState(OPERATING);
- return;
- }
-
-#ifdef XFree86LOADER
- if (needRAC) {
- xf86RACInit = LoaderSymbol("xf86RACInit");
- if (!xf86RACInit)
- FatalError("Cannot resolve symbol \"xf86RACInit\"\n");
- }
-#endif
-#ifdef DEBUG
- ErrorF("PostScreenInit generation: %i\n",serverGeneration);
-#endif
- if (serverGeneration == 1) {
- checkRoutingForScreens(OPERATING);
- for (i=0; i<xf86NumEntities; i++) {
- checkRequiredResources(i);
- }
-
- /*
- * after removing NEED_XXX_SHARED from entities that
- * don't need need XXX resources at all we might have
- * a single entity left that has NEED_XXX_SHARED set.
- * In this case we can delete that, too.
- */
- for (i = 0; i < xf86NumEntities; i++) {
- if (xf86Entities[i]->entityProp & NEED_MEM_SHARED)
- nummem++;
- if (xf86Entities[i]->entityProp & NEED_IO_SHARED)
- numio++;
- }
- for (i = 0; i < xf86NumEntities; i++) {
- if (nummem < 2)
- xf86Entities[i]->entityProp &= ~NEED_MEM_SHARED;
- if (numio < 2)
- xf86Entities[i]->entityProp &= ~NEED_IO_SHARED;
- }
- }
-
- if (xf86Screens && needRAC) {
- int needRACforVga = 0;
-
- for (i = 0; i < xf86NumScreens; i++) {
- for (j = 0; j < xf86Screens[i]->numEntities; j++) {
- if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
- & NEED_VGA_ROUTED) {
- needRACforVga ++;
- break; /* only count each screen once */
- }
- }
- }
-
- for (i = 0; i < xf86NumScreens; i++) {
- Bool needRACforMem = FALSE, needRACforIo = FALSE;
-
- for (j = 0; j < xf86Screens[i]->numEntities; j++) {
- if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
- & NEED_MEM_SHARED)
- needRACforMem = TRUE;
- if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
- & NEED_IO_SHARED)
- needRACforIo = TRUE;
- /*
- * We may need RAC although we don't share any resources
- * as we need to route VGA to the correct bus. This can
- * only be done simultaniously for MEM and IO.
- */
- if (needRACforVga > 1) {
- if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
- & NEED_VGA_MEM)
- needRACforMem = TRUE;
- if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
- & NEED_VGA_IO)
- needRACforIo = TRUE;
- }
- }
-
- pScreen = xf86Screens[i]->pScreen;
- flags = 0;
- if (needRACforMem) {
- flags |= xf86Screens[i]->racMemFlags;
- xf86ErrorFVerb(3, "Screen %d is using RAC for mem\n", i);
- }
- if (needRACforIo) {
- flags |= xf86Screens[i]->racIoFlags;
- xf86ErrorFVerb(3, "Screen %d is using RAC for io\n", i);
- }
-
-#ifdef XFree86LOADER
- ((Bool(*)(ScreenPtr,unsigned int))xf86RACInit)
- (pScreen,flags);
-#else
- xf86RACInit(pScreen,flags);
-#endif
- }
- }
-
- xf86EnterServerState(OPERATING);
-
-}
-
-/*
- * Sets
- */
-
-
-static resPtr
-decomposeSparse(resRange range)
-{
- resRange new;
- resPtr ret = NULL;
- memType val = range.rBegin;
- int i = 0;
-
- new.type = (range.type & ~ResExtMask) | ResSparse;
-
- while (1) {
- if (val & 0x01) {
- new.rBase = (val << i);
- new.rMask = ~((1 << i) - 1);
- ret = xf86AddResToList(ret,&new,-1);
- val ++;
- }
- i++;
- val >>= 1;
- if ((((val + 1) << i) - 1) > range.rEnd)
- break;
- }
- i--;
- val <<= 1;
-
- while (1) {
- if((((val + 1) << i) - 1)> range.rEnd) {
- if (--i < 0) break;
- val <<= 1;
- } else {
- new.rBase = (val << i);
- new.rMask = ~((1 << i) - 1);
- val++;
- ret = xf86AddResToList(ret,&new,-1);
- }
- }
- return ret;
-}
-
-static Bool
-x_isSubsetOf(resRange range, resPtr list1, resPtr list2)
-{
- resRange range1, range2;
- memType m1_A_m2;
- Bool ret;
- resPtr list;
-
- if (list1) {
- list = list1;
- if ((range.type & ResTypeMask) == (list->res_type & ResTypeMask)) {
- switch (range.type & ResExtMask) {
- case ResBlock:
- if ((list->res_type & ResExtMask) == ResBlock) {
- if (range.rBegin >= list->block_begin
- && range.rEnd <= list->block_end)
- return TRUE;
- else if (range.rBegin < list->block_begin
- && range.rEnd > list->block_end) {
- RANGE(range1, range.rBegin, list->block_begin - 1,
- range.type);
- RANGE(range2, list->block_end + 1, range.rEnd,
- range.type);
- return (x_isSubsetOf(range1,list->next,list2) &&
- x_isSubsetOf(range2,list->next,list2));
- }
- else if (range.rBegin >= list->block_begin
- && range.rBegin <= list->block_end) {
- RANGE(range1, list->block_end + 1, range.rEnd,
- range.type);
- return (x_isSubsetOf(range1,list->next,list2));
- } else if (range.rEnd >= list->block_begin
- && range.rEnd <= list->block_end) {
- RANGE(range1,range.rBegin, list->block_begin - 1,
- range.type);
- return (x_isSubsetOf(range1,list->next,list2));
- }
- }
- break;
- case ResSparse:
- if ((list->res_type & ResExtMask) == ResSparse) {
- memType test;
- int i;
-
- m1_A_m2 = range.rMask & list->sparse_mask;
- if ((range.rBase ^ list->sparse_base) & m1_A_m2)
- break;
- /*
- * We use the following system:
- * let 0 ^= mask:1 base:0, 1 ^= mask:1 base:1,
- * X mask:0 ; S: set TSS: test set for subset
- * NTSS: new test set after test
- * S: 1 0 1 0 X X 0 1 X
- * TSS: 1 0 0 1 1 0 X X X
- * T: 0 0 1 1 0 0 0 0 0
- * NTSS: 1 0 0/X 1/X 1 0 1 0 X
- * R: 0 0 0 0 0 0 1 1 0
- * If R != 0 TSS and S are disjunct
- * If R == 0 TSS is subset of S
- * If R != 0 NTSS contains elements from TSS
- * which are not also members of S.
- * If a T is set one of the correspondig bits
- * in NTSS must be set to the specified value
- * all other are X
- */
- test = list->sparse_mask & ~range.rMask;
- if (test == 0)
- return TRUE;
- for (i = 0; i < sizeof(memType); i++) {
- if ((test >> i) & 0x1) {
- RANGE(range1, ((range.rBase & list->sparse_base)
- | (range.rBase & ~list->sparse_mask)
- | ((~list->sparse_base & list->sparse_mask)
- & ~range.rMask)) & range1.rMask,
- ((range.rMask | list->sparse_mask) & ~test)
- | (1 << i), range.type);
- return (x_isSubsetOf(range1,list->next,list2));
- }
- }
- }
- break;
- }
- }
- return (x_isSubsetOf(range,list->next,list2));
- } else if (list2) {
- resPtr tmpList = NULL;
- switch (range.type & ResExtMask) {
- case ResBlock:
- tmpList = decomposeSparse(range);
- while (tmpList) {
- if (!x_isSubsetOf(tmpList->val,list2,NULL)) {
- xf86FreeResList(tmpList);
- return FALSE;
- }
- tmpList = tmpList->next;
- }
- xf86FreeResList(tmpList);
- return TRUE;
- break;
- case ResSparse:
- while (list2) {
- tmpList = xf86JoinResLists(tmpList,decomposeSparse(list2->val));
- list2 = list2->next;
- }
- ret = x_isSubsetOf(range,tmpList,NULL);
- xf86FreeResList(tmpList);
- return ret;
- break;
- }
- } else
- return FALSE;
-
- return FALSE;
-}
-
-Bool
-xf86IsSubsetOf(resRange range, resPtr list)
-{
- resPtr dup = xf86DupResList(list);
- resPtr r_sp = NULL, r = NULL, tmp = NULL;
- Bool ret = FALSE;
-
- while (dup) {
- tmp = dup;
- dup = dup->next;
- switch (tmp->res_type & ResExtMask) {
- case ResBlock:
- tmp->next = r;
- r = tmp;
- break;
- case ResSparse:
- tmp->next = r_sp;
- r_sp = tmp;
- break;
- }
- }
-
- switch (range.type & ResExtMask) {
- case ResBlock:
- ret = x_isSubsetOf(range,r,r_sp);
- break;
- case ResSparse:
- ret = x_isSubsetOf(range,r_sp,r);
- break;
- }
- xf86FreeResList(r);
- xf86FreeResList(r_sp);
-
- return ret;
-}
-
-Bool
-xf86IsListSubsetOf(resPtr list, resPtr BaseList)
-{
- while (list) {
- if (! xf86IsSubsetOf(list->val,BaseList))
- return FALSE;
- list = list->next;
- }
- return TRUE;
-}
-
-resPtr
-findIntersect(resRange Range, resPtr list)
-{
- resRange range;
- resPtr new = NULL;
-
- while (list) {
- if ((Range.type & ResTypeMask) == (list->res_type & ResTypeMask)) {
- switch (Range.type & ResExtMask) {
- case ResBlock:
- switch (list->res_type & ResExtMask) {
- case ResBlock:
- if (Range.rBegin >= list->block_begin)
- range.rBegin = Range.rBegin;
- else
- range.rBegin = list->block_begin;
- if (Range.rEnd <= list->block_end)
- range.rEnd = Range.rEnd;
- else
- range.rEnd = list->block_end;
- if (range.rEnd > range.rBegin) {
- range.type = Range.type;
- new = xf86AddResToList(new,&range,-1);
- }
- break;
- case ResSparse:
- new = xf86JoinResLists(new,xf86FindIntersectOfLists(new,decomposeSparse(list->val)));
- break;
- }
- break;
- case ResSparse:
- switch (list->res_type & ResExtMask) {
- case ResSparse:
- if (!((~(range.rBase ^ list->sparse_base)
- & (range.rMask & list->sparse_mask)))) {
- RANGE(range, (range.rBase & list->sparse_base)
- | (~range.rMask & list->sparse_base)
- | (~list->sparse_mask & range.rBase),
- range.rMask | list->sparse_mask,
- Range.type);
- new = xf86AddResToList(new,&range,-1);
- }
- break;
- case ResBlock:
- new = xf86JoinResLists(new,xf86FindIntersectOfLists(
- decomposeSparse(range),list));
- break;
- }
- }
- }
- list = list->next;
- }
- return new;
-}
-
-resPtr
-xf86FindIntersectOfLists(resPtr l1, resPtr l2)
-{
- resPtr ret = NULL;
-
- while (l1) {
- ret = xf86JoinResLists(ret,findIntersect(l1->val,l2));
- l1 = l1->next;
- }
- return ret;
-}
-
-#if 0 /* Not used */
-static resPtr
-xf86FindComplement(resRange Range)
-{
- resRange range;
- memType tmp;
- resPtr new = NULL;
- int i;
-
- switch (Range.type & ResExtMask) {
- case ResBlock:
- if (Range.rBegin > 0) {
- RANGE(range, 0, Range.rBegin - 1, Range.type);
- new = xf86AddResToList(new,&range,-1);
- }
- if (Range.rEnd < (memType)~0) {
- RANGE(range,Range.rEnd + 1, (memType)~0, Range.type);
- new = xf86AddResToList(new,&range,-1);
- }
- break;
- case ResSparse:
- tmp = Range.rMask;
- for (i = 0; i < sizeof(memType); i++) {
- if (tmp & 0x1) {
- RANGE(range,(~Range.rMask & range.rMask),(1 << i), Range.type);
- new = xf86AddResToList(new,&range,-1);
- }
- }
- break;
- default:
- break;
- }
- return new;
-}
-#endif
-
-resPtr
-xf86ExtractTypeFromList(resPtr list, unsigned long type)
-{
- resPtr ret = NULL;
-
- while (list) {
- if ((list->res_type & ResTypeMask) == type)
- ret = xf86AddResToList(ret,&(list->val),list->entityIndex);
- list = list->next;
- }
- return ret;
-}
-
-/*------------------------------------------------------------*/
-static void CheckGenericGA(void);
-
-/*
- * xf86FindPrimaryDevice() - Find the display device which
- * was active when the server was started.
- */
-void
-xf86FindPrimaryDevice()
-{
- /* if no VGA device is found check for primary PCI device */
- if (primaryBus.type == BUS_NONE)
- CheckGenericGA();
- if (primaryBus.type != BUS_NONE) {
- char *bus;
- char *loc = xnfcalloc(1,9);
- if (loc == NULL) return;
-
- switch (primaryBus.type) {
- case BUS_PCI:
- bus = "PCI";
- sprintf(loc," %2.2x:%2.2x:%1.1x",primaryBus.id.pci.bus,
- primaryBus.id.pci.device,primaryBus.id.pci.func);
- break;
- case BUS_ISA:
- bus = "ISA";
- loc[0] = '\0';
- break;
- case BUS_SBUS:
- bus = "SBUS";
- sprintf(loc," %2.2x",primaryBus.id.sbus.fbNum);
- break;
- default:
- bus = "";
- loc[0] = '\0';
- }
-
- xf86MsgVerb(X_INFO, 2, "Primary Device is: %s%s\n",bus,loc);
- xfree(loc);
- }
-
-}
-
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
-#include "vgaHW.h"
-#include "compiler.h"
-#endif
-
-/*
- * CheckGenericGA() - Check for presence of a VGA device.
- */
-static void
-CheckGenericGA()
-{
-/* This needs to be changed for multiple domains */
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
- IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
- CARD8 CurrentValue, TestValue;
-
- /* VGA CRTC registers are not used here, so don't bother unlocking them */
-
- /* VGA has one more read/write attribute register than EGA */
- (void) inb(GenericIOBase + VGA_IN_STAT_1_OFFSET); /* Reset flip-flop */
- outb(VGA_ATTR_INDEX, 0x14 | 0x20);
- CurrentValue = inb(VGA_ATTR_DATA_R);
- outb(VGA_ATTR_DATA_W, CurrentValue ^ 0x0F);
- outb(VGA_ATTR_INDEX, 0x14 | 0x20);
- TestValue = inb(VGA_ATTR_DATA_R);
- outb(VGA_ATTR_DATA_W, CurrentValue);
-
- if ((CurrentValue ^ 0x0F) == TestValue) {
- primaryBus.type = BUS_ISA;
- }
-#endif
-}
-
-Bool
-xf86NoSharedResources(int screenIndex,resType res)
-{
- int j;
-
- if (screenIndex > xf86NumScreens)
- return TRUE;
-
- for (j = 0; j < xf86Screens[screenIndex]->numEntities; j++) {
- switch (res) {
- case IO:
- if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
- & NEED_IO_SHARED)
- return FALSE;
- break;
- case MEM:
- if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
- & NEED_MEM_SHARED)
- return FALSE;
- break;
- case MEM_IO:
- if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
- & NEED_SHARED)
- return FALSE;
- break;
- case NONE:
- break;
- }
- }
- return TRUE;
-}
-
-void
-xf86ConvertListToHost(int entityIndex, resPtr list)
-{
- while (list) {
- convertRange2Host(entityIndex, &list->val);
- list = list->next;
- }
-}
-
-void
-xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
-{
- StateChangeNotificationPtr ptr =
- (StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
-
- ptr->func = func;
- ptr->arg = arg;
- ptr->next = StateChangeNotificationList;
- StateChangeNotificationList = ptr;
-}
-
-Bool
-xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func)
-{
- StateChangeNotificationPtr *ptr = &StateChangeNotificationList;
- StateChangeNotificationPtr tmp;
-
- while (*ptr) {
- if ((*ptr)->func == func) {
- tmp = (*ptr);
- (*ptr) = (*ptr)->next;
- xfree(tmp);
- return TRUE;
- }
- ptr = &((*ptr)->next);
- }
- return FALSE;
-}
-
-static void
-notifyStateChange(xf86NotifyState state)
-{
- StateChangeNotificationPtr ptr = StateChangeNotificationList;
- while (ptr) {
- ptr->func(state,ptr->arg);
- ptr = ptr->next;
- }
-}
-
-#ifdef async
-Bool
-xf86QueueAsyncEvent(void (*func)(pointer),pointer arg)
-{
- AsyncQPtr new;
-
- if (!AsyncQ) return FALSE;
-
- new = (AsyncQPtr)xfnalloc(sizeof(AsyncQRec));
- new->func = func;
- new->arg = arg;
- (*AsyncQPtr)->next = new;
- AsyncQPtr = &new;
- return TRUE;
-}
-#endif
-
-/* Multihead accel sharing accessor functions and entity Private handling */
-
-int
-xf86GetLastScrnFlag(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- return(xf86Entities[entityIndex]->lastScrnFlag);
- } else {
- return -1;
- }
-}
-
-void
-xf86SetLastScrnFlag(int entityIndex, int scrnIndex)
-{
- if(entityIndex < xf86NumEntities) {
- xf86Entities[entityIndex]->lastScrnFlag = scrnIndex;
- }
-}
-
-Bool
-xf86IsEntityShared(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- if(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void
-xf86SetEntityShared(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL;
- }
-}
-
-Bool
-xf86IsEntitySharable(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- if(xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void
-xf86SetEntitySharable(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE;
- }
-}
-
-Bool
-xf86IsPrimInitDone(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- if(xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void
-xf86SetPrimInitDone(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE;
- }
-}
-
-void
-xf86ClearPrimInitDone(int entityIndex)
-{
- if(entityIndex < xf86NumEntities) {
- xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE;
- }
-}
-
-
-/*
- * Allocate a private in the entities.
- */
-
-int
-xf86AllocateEntityPrivateIndex(void)
-{
- int idx, i;
- EntityPtr pEnt;
- DevUnion *nprivs;
-
- idx = xf86EntityPrivateCount++;
- for (i = 0; i < xf86NumEntities; i++) {
- pEnt = xf86Entities[i];
- nprivs = xnfrealloc(pEnt->entityPrivates,
- xf86EntityPrivateCount * sizeof(DevUnion));
- /* Zero the new private */
- bzero(&nprivs[idx], sizeof(DevUnion));
- pEnt->entityPrivates = nprivs;
- }
- return idx;
-}
-
-DevUnion *
-xf86GetEntityPrivate(int entityIndex, int privIndex)
-{
- if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount)
- return NULL;
-
- return &(xf86Entities[entityIndex]->entityPrivates[privIndex]);
-}
-
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
deleted file mode 100644
index fbeca7f9c..000000000
--- a/hw/xfree86/common/xf86Bus.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.23 2003/08/24 17:36:50 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains definitions of the bus-related data structures/types.
- * Everything contained here is private to xf86Bus.c. In particular the
- * video drivers must not include this file.
- */
-
-#ifndef _XF86_BUS_H
-#define _XF86_BUS_H
-
-#include "xf86pciBus.h"
-#ifdef __sparc__
-#include "xf86sbusBus.h"
-#endif
-
-typedef struct racInfo {
- xf86AccessPtr mem_new;
- xf86AccessPtr io_new;
- xf86AccessPtr io_mem_new;
- xf86SetAccessFuncPtr old;
-} AccessFuncRec, *AccessFuncPtr;
-
-
-typedef struct {
- DriverPtr driver;
- int chipset;
- int entityProp;
- EntityProc entityInit;
- EntityProc entityEnter;
- EntityProc entityLeave;
- pointer private;
- resPtr resources;
- Bool active;
- Bool inUse;
- BusRec bus;
- EntityAccessPtr access;
- AccessFuncPtr rac;
- pointer busAcc;
- int lastScrnFlag;
- DevUnion * entityPrivates;
- int numInstances;
- GDevPtr * devices;
- IOADDRESS domainIO;
-} EntityRec, *EntityPtr;
-
-/* asynchronous event handling */
-#ifdef async
-typedef struct _AsyncQRec {
- void (*func)(pointer);
- pointer arg;
- struct _AsyncQRec *next;
-} AsyncQRec, *AsyncQPtr;
-#endif
-
-#define NO_SEPARATE_IO_FROM_MEM 0x0001
-#define NO_SEPARATE_MEM_FROM_IO 0x0002
-#define NEED_VGA_ROUTED 0x0004
-#define NEED_VGA_ROUTED_SETUP 0x0008
-#define NEED_MEM 0x0010
-#define NEED_IO 0x0020
-#define NEED_MEM_SHARED 0x0040
-#define NEED_IO_SHARED 0x0080
-#define ACCEL_IS_SHARABLE 0x0100
-#define IS_SHARED_ACCEL 0x0200
-#define SA_PRIM_INIT_DONE 0x0400
-#define NEED_VGA_MEM 0x1000
-#define NEED_VGA_IO 0x2000
-
-#define NEED_SHARED (NEED_MEM_SHARED | NEED_IO_SHARED)
-
-#define busType bus.type
-#define pciBusId bus.id.pci
-#define isaBusId bus.id.isa
-#define sbusBusId bus.id.sbus
-
-struct x_BusAccRec;
-typedef void (*BusAccProcPtr)(struct x_BusAccRec *ptr);
-
-typedef struct x_BusAccRec {
- BusAccProcPtr set_f;
- BusAccProcPtr enable_f;
- BusAccProcPtr disable_f;
- BusAccProcPtr save_f;
- BusAccProcPtr restore_f;
- struct x_BusAccRec *current; /* pointer to bridge open on this bus */
- struct x_BusAccRec *primary; /* pointer to the bus connecting to this */
- struct x_BusAccRec *next; /* this links the different buses together */
- BusType type;
- BusType busdep_type;
- /* Bus-specific fields */
- union {
- struct {
- int bus;
- int primary_bus;
- PCITAG acc;
- pciBridgesSave save;
- } pci;
- } busdep;
-} BusAccRec, *BusAccPtr;
-
-/* state change notification callback */
-typedef struct _stateChange {
- xf86StateChangeNotificationCallbackFunc func;
- pointer arg;
- struct _stateChange *next;
-} StateChangeNotificationRec, *StateChangeNotificationPtr;
-
-
-extern EntityPtr *xf86Entities;
-extern int xf86NumEntities;
-extern xf86AccessRec AccessNULL;
-extern BusRec primaryBus;
-extern resPtr Acc;
-extern resPtr osRes;
-extern resPtr ResRange;
-extern BusAccPtr xf86BusAccInfo;
-
-int xf86AllocateEntity(void);
-BusType StringToBusType(const char* busID, const char **retID);
-memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
-Bool xf86IsSubsetOf(resRange range, resPtr list);
-Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
-resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
-resPtr findIntersect(resRange Range, resPtr list);
-resPtr xf86FindIntersect(resRange Range, resPtr list);
-void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
- Bool useEstimated);
-void xf86ConvertListToHost(int entityIndex, resPtr list);
-
-#endif /* _XF86_BUS_H */
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
deleted file mode 100644
index 8f6dd2803..000000000
--- a/hw/xfree86/common/xf86Config.c
+++ /dev/null
@@ -1,2599 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.277 2003/10/15 22:51:48 dawes Exp $ */
-
-
-/*
- * Loosely based on code bearing the following copyright:
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- */
-
-/*
- * Copyright 1992-2003 by The XFree86 Project, Inc.
- * Copyright 1997 by Metro Link, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- *
- * Authors:
- * Dirk Hohndel <hohndel@XFree86.Org>
- * David Dawes <dawes@XFree86.Org>
- * Marc La France <tsi@XFree86.Org>
- * Egbert Eich <eich@XFree86.Org>
- * ... and others
- */
-
-#ifdef XF86DRI
-#include <sys/types.h>
-#include <grp.h>
-#endif
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include "xf86.h"
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "xf86Config.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include "globals.h"
-
-#ifdef XINPUT
-#include "xf86Xinput.h"
-extern DeviceAssocRec mouse_assoc;
-#endif
-
-#ifdef XKB
-#define XKB_IN_SERVER
-#include "XKBsrv.h"
-#endif
-
-#ifdef RENDER
-#include "picture.h"
-#endif
-
-#if (defined(i386) || defined(__i386__)) && \
- (defined(__FreeBSD__) || defined(__NetBSD__) || defined(linux) || \
- (defined(SVR4) && !defined(sun)) || defined(__GNU__))
-#define SUPPORT_PC98
-#endif
-
-/*
- * These paths define the way the config file search is done. The escape
- * sequences are documented in parser/scan.c.
- */
-#ifndef ROOT_CONFIGPATH
-#define ROOT_CONFIGPATH "%A," "%R," \
- "/etc/X11/%R," "%P/etc/X11/%R," \
- "%E," "%F," \
- "/etc/X11/%F," "%P/etc/X11/%F," \
- "%D/%X," \
- "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#endif
-#ifndef USER_CONFIGPATH
-#define USER_CONFIGPATH "/etc/X11/%S," "%P/etc/X11/%S," \
- "/etc/X11/%G," "%P/etc/X11/%G," \
- "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#endif
-#ifndef PROJECTROOT
-#define PROJECTROOT "/usr/X11R6"
-#endif
-
-static char *fontPath = NULL;
-
-/* Forward declarations */
-static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen,
- int scrnum, MessageType from);
-static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor);
-static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device,
- Bool active);
-static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
- MessageType from);
-static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
-static Bool addDefaultModes(MonPtr monitorp);
-#ifdef XF86DRI
-static Bool configDRI(XF86ConfDRIPtr drip);
-#endif
-
-/*
- * xf86GetPathElem --
- * Extract a single element from the font path string starting at
- * pnt. The font path element will be returned, and pnt will be
- * updated to point to the start of the next element, or set to
- * NULL if there are no more.
- */
-static char *
-xf86GetPathElem(char **pnt)
-{
- char *p1;
-
- p1 = *pnt;
- *pnt = index(*pnt, ',');
- if (*pnt != NULL) {
- **pnt = '\0';
- *pnt += 1;
- }
- return(p1);
-}
-
-/*
- * xf86ValidateFontPath --
- * Validates the user-specified font path. Each element that
- * begins with a '/' is checked to make sure the directory exists.
- * If the directory exists, the existence of a file named 'fonts.dir'
- * is checked. If either check fails, an error is printed and the
- * element is removed from the font path.
- */
-
-#define DIR_FILE "/fonts.dir"
-static char *
-xf86ValidateFontPath(char *path)
-{
- char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem;
- struct stat stat_buf;
- int flag;
- int dirlen;
-
- tmp_path = xcalloc(1,strlen(path)+1);
- out_pnt = tmp_path;
- path_elem = NULL;
- next = path;
- while (next != NULL) {
- path_elem = xf86GetPathElem(&next);
- if (*path_elem == '/') {
-#ifndef __UNIXOS2__
- dir_elem = xnfcalloc(1, strlen(path_elem) + 1);
- if ((p1 = strchr(path_elem, ':')) != 0)
-#else
- /* OS/2 must prepend X11ROOT */
- path_elem = (char*)__XOS2RedirRoot(path_elem);
- dir_elem = xnfcalloc(1, strlen(path_elem) + 1);
- if (p1 = strchr(path_elem+2, ':'))
-#endif
- dirlen = p1 - path_elem;
- else
- dirlen = strlen(path_elem);
- strncpy(dir_elem, path_elem, dirlen);
- dir_elem[dirlen] = '\0';
- flag = stat(dir_elem, &stat_buf);
- if (flag == 0)
- if (!S_ISDIR(stat_buf.st_mode))
- flag = -1;
- if (flag != 0) {
- xf86Msg(X_WARNING, "The directory \"%s\" does not exist.\n", dir_elem);
- xf86ErrorF("\tEntry deleted from font path.\n");
- xfree(dir_elem);
- continue;
- }
- else {
- p1 = xnfalloc(strlen(dir_elem)+strlen(DIR_FILE)+1);
- strcpy(p1, dir_elem);
- strcat(p1, DIR_FILE);
- flag = stat(p1, &stat_buf);
- if (flag == 0)
- if (!S_ISREG(stat_buf.st_mode))
- flag = -1;
-#ifndef __UNIXOS2__
- xfree(p1);
-#endif
- if (flag != 0) {
- xf86Msg(X_WARNING,
- "`fonts.dir' not found (or not valid) in \"%s\".\n",
- dir_elem);
- xf86ErrorF("\tEntry deleted from font path.\n");
- xf86ErrorF("\t(Run 'mkfontdir' on \"%s\").\n", dir_elem);
- xfree(dir_elem);
- continue;
- }
- }
- xfree(dir_elem);
- }
-
- /*
- * Either an OK directory, or a font server name. So add it to
- * the path.
- */
- if (out_pnt != tmp_path)
- *out_pnt++ = ',';
- strcat(out_pnt, path_elem);
- out_pnt += strlen(path_elem);
- }
- return(tmp_path);
-}
-
-
-/*
- * use the datastructure that the parser provides and pick out the parts
- * that we need at this point
- */
-char **
-xf86ModulelistFromConfig(pointer **optlist)
-{
- int count = 0;
- char **modulearray;
- pointer *optarray;
- XF86LoadPtr modp;
-
- /*
- * make sure the config file has been parsed and that we have a
- * ModulePath set; if no ModulePath was given, use the default
- * ModulePath
- */
- if (xf86configptr == NULL) {
- xf86Msg(X_ERROR, "Cannot access global config data structure\n");
- return NULL;
- }
-
- if (xf86configptr->conf_modules) {
- /*
- * Walk the list of modules in the "Module" section to determine how
- * many we have.
- */
- modp = xf86configptr->conf_modules->mod_load_lst;
- while (modp) {
- count++;
- modp = (XF86LoadPtr) modp->list.next;
- }
- }
- if (count == 0)
- return NULL;
-
- /*
- * allocate the memory and walk the list again to fill in the pointers
- */
- modulearray = xnfalloc((count + 1) * sizeof(char*));
- optarray = xnfalloc((count + 1) * sizeof(pointer));
- count = 0;
- if (xf86configptr->conf_modules) {
- modp = xf86configptr->conf_modules->mod_load_lst;
- while (modp) {
- modulearray[count] = modp->load_name;
- optarray[count] = modp->load_opt;
- count++;
- modp = (XF86LoadPtr) modp->list.next;
- }
- }
- modulearray[count] = NULL;
- optarray[count] = NULL;
- if (optlist)
- *optlist = optarray;
- else
- xfree(optarray);
- return modulearray;
-}
-
-
-char **
-xf86DriverlistFromConfig()
-{
- int count = 0;
- int j;
- char **modulearray;
- screenLayoutPtr slp;
-
- /*
- * make sure the config file has been parsed and that we have a
- * ModulePath set; if no ModulePath was given, use the default
- * ModulePath
- */
- if (xf86configptr == NULL) {
- xf86Msg(X_ERROR, "Cannot access global config data structure\n");
- return NULL;
- }
-
- /*
- * Walk the list of driver lines in active "Device" sections to
- * determine now many implicitly loaded modules there are.
- *
- */
- if (xf86ConfigLayout.screens) {
- slp = xf86ConfigLayout.screens;
- while ((slp++)->screen) {
- count++;
- }
- }
-
- /*
- * Handle the set of inactive "Device" sections.
- */
- j = 0;
- while (xf86ConfigLayout.inactives[j++].identifier)
- count++;
-
- if (count == 0)
- return NULL;
-
- /*
- * allocate the memory and walk the list again to fill in the pointers
- */
- modulearray = xnfalloc((count + 1) * sizeof(char*));
- count = 0;
- slp = xf86ConfigLayout.screens;
- while (slp->screen) {
- modulearray[count] = slp->screen->device->driver;
- count++;
- slp++;
- }
-
- j = 0;
-
- while (xf86ConfigLayout.inactives[j].identifier)
- modulearray[count++] = xf86ConfigLayout.inactives[j++].driver;
-
- modulearray[count] = NULL;
-
- /* Remove duplicates */
- for (count = 0; modulearray[count] != NULL; count++) {
- int i;
-
- for (i = 0; i < count; i++)
- if (xf86NameCmp(modulearray[i], modulearray[count]) == 0) {
- modulearray[count] = "";
- break;
- }
- }
- return modulearray;
-}
-
-
-Bool
-xf86BuiltinInputDriver(const char *name)
-{
- if (xf86NameCmp(name, "keyboard") == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-
-char **
-xf86InputDriverlistFromConfig()
-{
- int count = 0;
- char **modulearray;
- IDevPtr idp;
-
- /*
- * make sure the config file has been parsed and that we have a
- * ModulePath set; if no ModulePath was given, use the default
- * ModulePath
- */
- if (xf86configptr == NULL) {
- xf86Msg(X_ERROR, "Cannot access global config data structure\n");
- return NULL;
- }
-
- /*
- * Walk the list of driver lines in active "InputDevice" sections to
- * determine now many implicitly loaded modules there are.
- */
- if (xf86ConfigLayout.inputs) {
- idp = xf86ConfigLayout.inputs;
- while (idp->identifier) {
- if (!xf86BuiltinInputDriver(idp->driver))
- count++;
- idp++;
- }
- }
-
- if (count == 0)
- return NULL;
-
- /*
- * allocate the memory and walk the list again to fill in the pointers
- */
- modulearray = xnfalloc((count + 1) * sizeof(char*));
- count = 0;
- idp = xf86ConfigLayout.inputs;
- while (idp->identifier) {
- if (!xf86BuiltinInputDriver(idp->driver)) {
- modulearray[count] = idp->driver;
- count++;
- }
- idp++;
- }
- modulearray[count] = NULL;
-
- /* Remove duplicates */
- for (count = 0; modulearray[count] != NULL; count++) {
- int i;
-
- for (i = 0; i < count; i++)
- if (xf86NameCmp(modulearray[i], modulearray[count]) == 0) {
- modulearray[count] = "";
- break;
- }
- }
- return modulearray;
-}
-
-
-/*
- * Generate a compiled-in list of driver names. This is used to produce a
- * consistent probe order. For the loader server, we also look for vendor-
- * provided modules, pre-pending them to our own list.
- */
-static char **
-GenerateDriverlist(char * dirname, char * drivernames)
-{
- char *cp, **driverlist;
- int count;
-
- /* Count the number needed */
- count = 0;
- cp = drivernames;
- while (*cp) {
- while (*cp && isspace(*cp)) cp++;
- if (!*cp) break;
- count++;
- while (*cp && !isspace(*cp)) cp++;
- }
-
- if (!count)
- return NULL;
-
- /* Now allocate the array of pointers to 0-terminated driver names */
- driverlist = (char **)xnfalloc((count + 1) * sizeof(char *));
- count = 0;
- cp = drivernames;
- while (*cp) {
- while (*cp && isspace(*cp)) cp++;
- if (!*cp) break;
- driverlist[count++] = cp;
- while (*cp && !isspace(*cp)) cp++;
- if (!*cp) break;
- *cp++ = 0;
- }
- driverlist[count] = NULL;
-
-#ifdef XFree86LOADER
- {
- const char *subdirs[] = {NULL, NULL};
- static const char *patlist[] = {"(.*)_drv\\.so", "(.*)_drv\\.o", NULL};
- char **dlist, **clist, **dcp, **ccp;
- int size;
-
- subdirs[0] = dirname;
-
- /* Get module list */
- dlist = LoaderListDirs(subdirs, patlist);
- if (!dlist) {
- xfree(driverlist);
- return NULL; /* No modules, no list */
- }
-
- clist = driverlist;
-
- /* The resulting list cannot be longer than the module list */
- for (dcp = dlist, count = 0; *dcp++; count++);
- driverlist = (char **)xnfalloc((size = count + 1) * sizeof(char *));
-
- /* First, add modules not in compiled-in list */
- for (count = 0, dcp = dlist; *dcp; dcp++) {
- for (ccp = clist; ; ccp++) {
- if (!*ccp) {
- driverlist[count++] = *dcp;
- if (count >= size)
- driverlist = (char**)
- xnfrealloc(driverlist, ++size * sizeof(char*));
- break;
- }
- if (!strcmp(*ccp, *dcp))
- break;
- }
- }
-
- /* Next, add compiled-in names that are also modules */
- for (ccp = clist; *ccp; ccp++) {
- for (dcp = dlist; *dcp; dcp++) {
- if (!strcmp(*ccp, *dcp)) {
- driverlist[count++] = *ccp;
- if (count >= size)
- driverlist = (char**)
- xnfrealloc(driverlist, ++size * sizeof(char*));
- break;
- }
- }
- }
-
- driverlist[count] = NULL;
- xfree(clist);
- xfree(dlist);
- }
-#endif /* XFree86LOADER */
-
- return driverlist;
-}
-
-
-char **
-xf86DriverlistFromCompile(void)
-{
- static char **driverlist = NULL;
- static Bool generated = FALSE;
-
- /* This string is modified in-place */
- static char drivernames[] = DRIVERS;
-
- if (!generated) {
- generated = TRUE;
- driverlist = GenerateDriverlist("drivers", drivernames);
- }
-
- return driverlist;
-}
-
-
-char **
-xf86InputDriverlistFromCompile(void)
-{
- static char **driverlist = NULL;
- static Bool generated = FALSE;
-
- /* This string is modified in-place */
- static char drivernames[] = IDRIVERS;
-
- if (!generated) {
- generated = TRUE;
- driverlist = GenerateDriverlist("input", drivernames);
- }
-
- return driverlist;
-}
-
-
-/*
- * xf86ConfigError --
- * Print a READABLE ErrorMessage!!! All information that is
- * available is printed.
- */
-static void
-xf86ConfigError(char *msg, ...)
-{
- va_list ap;
-
- ErrorF("\nConfig Error:\n");
- va_start(ap, msg);
- VErrorF(msg, ap);
- va_end(ap);
- ErrorF("\n");
- return;
-}
-
-static Bool
-configFiles(XF86ConfFilesPtr fileconf)
-{
- MessageType pathFrom = X_DEFAULT;
-
- /* FontPath */
-
- /* Try XF86Config FontPath first */
- if (!xf86fpFlag) {
- if (fileconf) {
- if (fileconf->file_fontpath) {
- char *f = xf86ValidateFontPath(fileconf->file_fontpath);
- pathFrom = X_CONFIG;
- if (*f)
- defaultFontPath = f;
- else {
- xf86Msg(X_WARNING,
- "FontPath is completely invalid. Using compiled-in default.\n");
- fontPath = NULL;
- pathFrom = X_DEFAULT;
- }
- }
- } else {
- xf86Msg(X_WARNING,
- "No FontPath specified. Using compiled-in default.\n");
- pathFrom = X_DEFAULT;
- }
- } else {
- /* Use fontpath specified with '-fp' */
- if (fontPath)
- {
- fontPath = NULL;
- }
- pathFrom = X_CMDLINE;
- }
- if (!fileconf) {
- /* xf86ValidateFontPath will write into it's arg, but defaultFontPath
- could be static, so we make a copy. */
- char *f = xnfalloc(strlen(defaultFontPath) + 1);
- f[0] = '\0';
- strcpy (f, defaultFontPath);
- defaultFontPath = xf86ValidateFontPath(f);
- xfree(f);
- } else {
- if (fileconf) {
- if (!fileconf->file_fontpath) {
- /* xf86ValidateFontPath will write into it's arg, but defaultFontPath
- could be static, so we make a copy. */
- char *f = xnfalloc(strlen(defaultFontPath) + 1);
- f[0] = '\0';
- strcpy (f, defaultFontPath);
- defaultFontPath = xf86ValidateFontPath(f);
- xfree(f);
- }
- }
- }
-
- /* If defaultFontPath is still empty, exit here */
-
- if (! *defaultFontPath)
- FatalError("No valid FontPath could be found.");
-
- xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath);
-
- /* RgbPath */
-
- pathFrom = X_DEFAULT;
-
- if (xf86coFlag)
- pathFrom = X_CMDLINE;
- else if (fileconf) {
- if (fileconf->file_rgbpath) {
- rgbPath = fileconf->file_rgbpath;
- pathFrom = X_CONFIG;
- }
- }
-
- xf86Msg(pathFrom, "RgbPath set to \"%s\"\n", rgbPath);
-
- if (fileconf && fileconf->file_inputdevs) {
- xf86InputDeviceList = fileconf->file_inputdevs;
- xf86Msg(X_CONFIG, "Input device list set to \"%s\"\n",
- xf86InputDeviceList);
- }
-
-
-#ifdef XFree86LOADER
- /* ModulePath */
-
- if (fileconf) {
- if (xf86ModPathFrom != X_CMDLINE && fileconf->file_modulepath) {
- xf86ModulePath = fileconf->file_modulepath;
- xf86ModPathFrom = X_CONFIG;
- }
- }
-
- xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath);
-#endif
-
-#if 0
- /* LogFile */
- /*
- * XXX The problem with this is that the log file is already open.
- * One option might be to copy the exiting contents to the new location.
- * and re-open it. The down side is that the default location would
- * already have been overwritten. Another option would be to start with
- * unique temporary location, then copy it once the correct name is known.
- * A problem with this is what happens if the server exits before that
- * happens.
- */
- if (xf86LogFileFrom == X_DEFAULT && fileconf->file_logfile) {
- xf86LogFile = fileconf->file_logfile;
- xf86LogFileFrom = X_CONFIG;
- }
-#endif
-
- return TRUE;
-}
-
-typedef enum {
- FLAG_NOTRAPSIGNALS,
- FLAG_DONTVTSWITCH,
- FLAG_DONTZAP,
- FLAG_DONTZOOM,
- FLAG_DISABLEVIDMODE,
- FLAG_ALLOWNONLOCAL,
- FLAG_DISABLEMODINDEV,
- FLAG_MODINDEVALLOWNONLOCAL,
- FLAG_ALLOWMOUSEOPENFAIL,
- FLAG_VTINIT,
- FLAG_VTSYSREQ,
- FLAG_XKBDISABLE,
- FLAG_PCIPROBE1,
- FLAG_PCIPROBE2,
- FLAG_PCIFORCECONFIG1,
- FLAG_PCIFORCECONFIG2,
- FLAG_PCIFORCENONE,
- FLAG_PCIOSCONFIG,
- FLAG_SAVER_BLANKTIME,
- FLAG_DPMS_STANDBYTIME,
- FLAG_DPMS_SUSPENDTIME,
- FLAG_DPMS_OFFTIME,
- FLAG_PIXMAP,
- FLAG_PC98,
- FLAG_ESTIMATE_SIZES_AGGRESSIVELY,
- FLAG_NOPM,
- FLAG_XINERAMA,
- FLAG_ALLOW_DEACTIVATE_GRABS,
- FLAG_ALLOW_CLOSEDOWN_GRABS,
- FLAG_LOG,
- FLAG_RENDER_COLORMAP_MODE,
- FLAG_HANDLE_SPECIAL_KEYS,
- FLAG_RANDR
-} FlagValues;
-
-static OptionInfoRec FlagOptions[] = {
- { FLAG_NOTRAPSIGNALS, "NoTrapSignals", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_DONTVTSWITCH, "DontVTSwitch", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_DISABLEVIDMODE, "DisableVidModeExtension", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_ALLOWNONLOCAL, "AllowNonLocalXvidtune", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_DISABLEMODINDEV, "DisableModInDev", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_MODINDEVALLOWNONLOCAL, "AllowNonLocalModInDev", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_VTINIT, "VTInit", OPTV_STRING,
- {0}, FALSE },
- { FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIPROBE1, "PciProbe1" , OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIPROBE2, "PciProbe2", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIFORCECONFIG1, "PciForceConfig1", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIFORCECONFIG2, "PciForceConfig2", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIFORCENONE, "PciForceNone", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_PCIOSCONFIG, "PciOsConfig", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_DPMS_SUSPENDTIME, "SuspendTime", OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_DPMS_OFFTIME, "OffTime", OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_PIXMAP, "Pixmap", OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_PC98, "PC98", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_ESTIMATE_SIZES_AGGRESSIVELY,"EstimateSizesAggressively",OPTV_INTEGER,
- {0}, FALSE },
- { FLAG_NOPM, "NoPM", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_ALLOW_DEACTIVATE_GRABS,"AllowDeactivateGrabs", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_ALLOW_CLOSEDOWN_GRABS, "AllowClosedownGrabs", OPTV_BOOLEAN,
- {0}, FALSE },
- { FLAG_LOG, "Log", OPTV_STRING,
- {0}, FALSE },
- { FLAG_RENDER_COLORMAP_MODE, "RenderColormapMode", OPTV_STRING,
- {0}, FALSE },
- { FLAG_HANDLE_SPECIAL_KEYS, "HandleSpecialKeys", OPTV_STRING,
- {0}, FALSE },
- { FLAG_RANDR, "RandR", OPTV_BOOLEAN,
- {0}, FALSE },
- { -1, NULL, OPTV_NONE,
- {0}, FALSE },
-};
-
-#if defined(i386) || defined(__i386__)
-static Bool
-detectPC98(void)
-{
-#ifdef SUPPORT_PC98
- unsigned char buf[2];
-
- if (xf86ReadBIOS(0xf8000, 0xe80, buf, 2) != 2)
- return FALSE;
- if ((buf[0] == 0x98) && (buf[1] == 0x21))
- return TRUE;
- else
- return FALSE;
-#else
- return FALSE;
-#endif
-}
-#endif /* __i386__ */
-
-static Bool
-configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
-{
- XF86OptionPtr optp, tmp;
- int i;
- Pix24Flags pix24 = Pix24DontCare;
- Bool value;
- MessageType from;
-
- /*
- * Merge the ServerLayout and ServerFlags options. The former have
- * precedence over the latter.
- */
- optp = NULL;
- if (flagsconf && flagsconf->flg_option_lst)
- optp = xf86optionListDup(flagsconf->flg_option_lst);
- if (layoutopts) {
- tmp = xf86optionListDup(layoutopts);
- if (optp)
- optp = xf86optionListMerge(optp, tmp);
- else
- optp = tmp;
- }
-
- xf86ProcessOptions(-1, optp, FlagOptions);
-
- xf86GetOptValBool(FlagOptions, FLAG_NOTRAPSIGNALS, &xf86Info.notrapSignals);
- xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
- xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap);
- xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);
-
- xf86GetOptValBool(FlagOptions, FLAG_ALLOW_DEACTIVATE_GRABS,
- &(xf86Info.grabInfo.allowDeactivate));
- xf86GetOptValBool(FlagOptions, FLAG_ALLOW_CLOSEDOWN_GRABS,
- &(xf86Info.grabInfo.allowClosedown));
-
- /*
- * Set things up based on the config file information. Some of these
- * settings may be overridden later when the command line options are
- * checked.
- */
-#ifdef XF86VIDMODE
- if (xf86GetOptValBool(FlagOptions, FLAG_DISABLEVIDMODE, &value))
- xf86Info.vidModeEnabled = !value;
- if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWNONLOCAL, &value))
- xf86Info.vidModeAllowNonLocal = value;
-#endif
-
-#ifdef XF86MISC
- if (xf86GetOptValBool(FlagOptions, FLAG_DISABLEMODINDEV, &value))
- xf86Info.miscModInDevEnabled = !value;
- if (xf86GetOptValBool(FlagOptions, FLAG_MODINDEVALLOWNONLOCAL, &value))
- xf86Info.miscModInDevAllowNonLocal = value;
-#endif
-
- if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value))
- xf86Info.allowMouseOpenFail = value;
-
- if (xf86GetOptValBool(FlagOptions, FLAG_VTSYSREQ, &value)) {
-#ifdef USE_VT_SYSREQ
- xf86Info.vtSysreq = value;
- xf86Msg(X_CONFIG, "VTSysReq %s\n", value ? "enabled" : "disabled");
-#else
- if (value)
- xf86Msg(X_WARNING, "VTSysReq is not supported on this OS\n");
-#endif
- }
-
- if (xf86GetOptValBool(FlagOptions, FLAG_XKBDISABLE, &value)) {
-#ifdef XKB
- noXkbExtension = value;
- xf86Msg(X_CONFIG, "Xkb %s\n", value ? "disabled" : "enabled");
-#else
- if (!value)
- xf86Msg(X_WARNING, "Xserver doesn't support XKB\n");
-#endif
- }
-
- xf86Info.vtinit = xf86GetOptValString(FlagOptions, FLAG_VTINIT);
-
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE1))
- xf86Info.pciFlags = PCIProbe1;
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE2))
- xf86Info.pciFlags = PCIProbe2;
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCECONFIG1))
- xf86Info.pciFlags = PCIForceConfig1;
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCECONFIG2))
- xf86Info.pciFlags = PCIForceConfig2;
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIOSCONFIG))
- xf86Info.pciFlags = PCIOsConfig;
- if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCENONE))
- xf86Info.pciFlags = PCIForceNone;
-
- xf86Info.pmFlag = TRUE;
- if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value))
- xf86Info.pmFlag = !value;
- {
- const char *s;
- if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
- if (!xf86NameCmp(s,"flush")) {
- xf86Msg(X_CONFIG, "Flushing logfile enabled\n");
- xf86Info.log = LogFlush;
- LogSetParameter(XLOG_FLUSH, TRUE);
- } else if (!xf86NameCmp(s,"sync")) {
- xf86Msg(X_CONFIG, "Syncing logfile enabled\n");
- xf86Info.log = LogSync;
- LogSetParameter(XLOG_SYNC, TRUE);
- } else {
- xf86Msg(X_WARNING,"Unknown Log option\n");
- }
- }
- }
-
-#ifdef RENDER
- {
- const char *s;
-
- if ((s = xf86GetOptValString(FlagOptions, FLAG_RENDER_COLORMAP_MODE))){
- int policy = PictureParseCmapPolicy (s);
- if (policy == PictureCmapPolicyInvalid)
- xf86Msg(X_WARNING, "Unknown colormap policy \"%s\"\n", s);
- else
- {
- xf86Msg(X_CONFIG, "Render colormap policy set to %s\n", s);
- PictureCmapPolicy = policy;
- }
- }
- }
-#endif
- {
- const char *s;
- if ((s = xf86GetOptValString(FlagOptions, FLAG_HANDLE_SPECIAL_KEYS))) {
- if (!xf86NameCmp(s,"always")) {
- xf86Msg(X_CONFIG, "Always handling special keys in DDX\n");
- xf86Info.ddxSpecialKeys = SKAlways;
- } else if (!xf86NameCmp(s,"whenneeded")) {
- xf86Msg(X_CONFIG, "Special keys handled in DDX only if needed\n");
- xf86Info.ddxSpecialKeys = SKWhenNeeded;
- } else if (!xf86NameCmp(s,"never")) {
- xf86Msg(X_CONFIG, "Never handling special keys in DDX\n");
- xf86Info.ddxSpecialKeys = SKNever;
- } else {
- xf86Msg(X_WARNING,"Unknown HandleSpecialKeys option\n");
- }
- }
- }
-#ifdef RANDR
- xf86Info.disableRandR = FALSE;
- xf86Info.randRFrom = X_DEFAULT;
- if (xf86GetOptValBool(FlagOptions, FLAG_RANDR, &value)) {
- xf86Info.disableRandR = !value;
- xf86Info.randRFrom = X_CONFIG;
- }
-#endif
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_ESTIMATE_SIZES_AGGRESSIVELY, &i);
- if (i >= 0)
- xf86Info.estimateSizesAggressively = i;
- else
- xf86Info.estimateSizesAggressively = 0;
-
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_SAVER_BLANKTIME, &i);
- if (i >= 0)
- ScreenSaverTime = defaultScreenSaverTime = i * MILLI_PER_MIN;
-
-#ifdef DPMSExtension
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_DPMS_STANDBYTIME, &i);
- if (i >= 0)
- DPMSStandbyTime = defaultDPMSStandbyTime = i * MILLI_PER_MIN;
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_DPMS_SUSPENDTIME, &i);
- if (i >= 0)
- DPMSSuspendTime = defaultDPMSSuspendTime = i * MILLI_PER_MIN;
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_DPMS_OFFTIME, &i);
- if (i >= 0)
- DPMSOffTime = defaultDPMSOffTime = i * MILLI_PER_MIN;
-#endif
-
- i = -1;
- xf86GetOptValInteger(FlagOptions, FLAG_PIXMAP, &i);
- switch (i) {
- case 24:
- pix24 = Pix24Use24;
- break;
- case 32:
- pix24 = Pix24Use32;
- break;
- case -1:
- break;
- default:
- xf86ConfigError("Pixmap option's value (%d) must be 24 or 32\n", i);
- return FALSE;
- }
- if (xf86Pix24 != Pix24DontCare) {
- xf86Info.pixmap24 = xf86Pix24;
- xf86Info.pix24From = X_CMDLINE;
- } else if (pix24 != Pix24DontCare) {
- xf86Info.pixmap24 = pix24;
- xf86Info.pix24From = X_CONFIG;
- } else {
- xf86Info.pixmap24 = Pix24DontCare;
- xf86Info.pix24From = X_DEFAULT;
- }
-#if defined(i386) || defined(__i386__)
- if (xf86GetOptValBool(FlagOptions, FLAG_PC98, &value)) {
- xf86Info.pc98 = value;
- if (value) {
- xf86Msg(X_CONFIG, "Japanese PC98 architecture\n");
- }
- } else
- if (detectPC98()) {
- xf86Info.pc98 = TRUE;
- xf86Msg(X_PROBED, "Japanese PC98 architecture\n");
- }
-#endif
-
-#ifdef PANORAMIX
- from = X_DEFAULT;
- if (!noPanoramiXExtension)
- from = X_CMDLINE;
- else if (xf86GetOptValBool(FlagOptions, FLAG_XINERAMA, &value)) {
- noPanoramiXExtension = !value;
- from = X_CONFIG;
- }
- if (!noPanoramiXExtension)
- xf86Msg(from, "Xinerama: enabled\n");
-#endif
-
- return TRUE;
-}
-
-/*
- * XXX This function is temporary, and will be removed when the keyboard
- * driver is converted into a regular input driver.
- */
-static Bool
-configInputKbd(IDevPtr inputp)
-{
- char *s;
- MessageType from = X_DEFAULT;
- Bool customKeycodesDefault = FALSE;
- int verb = 0;
-
- /* Initialize defaults */
- xf86Info.xleds = 0L;
- xf86Info.kbdDelay = 500;
- xf86Info.kbdRate = 30;
-
- xf86Info.kbdProc = NULL;
- xf86Info.vtinit = NULL;
- xf86Info.vtSysreq = VT_SYSREQ_DEFAULT;
-#if defined(SVR4) && defined(i386)
- xf86Info.panix106 = FALSE;
-#endif
- xf86Info.kbdCustomKeycodes = FALSE;
-#ifdef WSCONS_SUPPORT
- xf86Info.kbdFd = -1;
-#endif
-#ifdef XKB
- if (!xf86IsPc98()) {
- xf86Info.xkbrules = "xfree86";
- xf86Info.xkbmodel = "pc105";
- xf86Info.xkblayout = "us";
- xf86Info.xkbvariant = NULL;
- xf86Info.xkboptions = NULL;
- } else {
- xf86Info.xkbrules = "xfree98";
- xf86Info.xkbmodel = "pc98";
- xf86Info.xkblayout = "nec/jp";
- xf86Info.xkbvariant = NULL;
- xf86Info.xkboptions = NULL;
- }
- xf86Info.xkbcomponents_specified = FALSE;
- /* Should discourage the use of these. */
- xf86Info.xkbkeymap = NULL;
- xf86Info.xkbtypes = NULL;
- xf86Info.xkbcompat = NULL;
- xf86Info.xkbkeycodes = NULL;
- xf86Info.xkbsymbols = NULL;
- xf86Info.xkbgeometry = NULL;
-#endif
-
- s = xf86SetStrOption(inputp->commonOptions, "Protocol", "standard");
- if (xf86NameCmp(s, "standard") == 0) {
- xf86Info.kbdProc = xf86KbdProc;
- xf86Info.kbdEvents = xf86KbdEvents;
- xfree(s);
- } else if (xf86NameCmp(s, "xqueue") == 0) {
-#ifdef XQUEUE
- xf86Info.kbdProc = xf86XqueKbdProc;
- xf86Info.kbdEvents = xf86XqueEvents;
- xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n");
-#endif
- xfree(s);
-#ifdef WSCONS_SUPPORT
- } else if (xf86NameCmp(s, "wskbd") == 0) {
- xf86Info.kbdProc = xf86KbdProc;
- xf86Info.kbdEvents = xf86WSKbdEvents;
- xfree(s);
- s = xf86SetStrOption(inputp->commonOptions, "Device", NULL);
- xf86Msg(X_CONFIG, "Keyboard: Protocol: wskbd\n");
- if (s == NULL) {
- xf86ConfigError("A \"device\" option is required with"
- " the \"wskbd\" keyboard protocol");
- return FALSE;
- }
- xf86Info.kbdFd = open(s, O_RDWR | O_NONBLOCK | O_EXCL);
- if (xf86Info.kbdFd == -1) {
- xf86ConfigError("cannot open \"%s\"", s);
- xfree(s);
- return FALSE;
- }
- xfree(s);
- /* Find out keyboard type */
- if (ioctl(xf86Info.kbdFd, WSKBDIO_GTYPE, &xf86Info.wsKbdType) == -1) {
- xf86ConfigError("cannot get keyboard type");
- close(xf86Info.kbdFd);
- return FALSE;
- }
- switch (xf86Info.wsKbdType) {
- case WSKBD_TYPE_PC_XT:
- xf86Msg(X_PROBED, "Keyboard type: XT\n");
- break;
- case WSKBD_TYPE_PC_AT:
- xf86Msg(X_PROBED, "Keyboard type: AT\n");
- break;
- case WSKBD_TYPE_USB:
- xf86Msg(X_PROBED, "Keyboard type: USB\n");
- break;
-#ifdef WSKBD_TYPE_ADB
- case WSKBD_TYPE_ADB:
- xf86Msg(X_PROBED, "Keyboard type: ADB\n");
- break;
-#endif
-#ifdef WSKBD_TYPE_SUN
- case WSKBD_TYPE_SUN:
- xf86Msg(X_PROBED, "Keyboard type: Sun\n");
- break;
-#endif
-#ifdef WSKBD_TYPE_SUN5
- case WSKBD_TYPE_SUN5:
- xf86Msg(X_PROBED, "Keyboard type: Sun5\n");
- break;
-#endif
- default:
- xf86ConfigError("Unsupported wskbd type \"%d\"",
- xf86Info.wsKbdType);
- close(xf86Info.kbdFd);
- return FALSE;
- }
-#endif
- } else {
- xf86ConfigError("\"%s\" is not a valid keyboard protocol name", s);
- xfree(s);
- return FALSE;
- }
-
- s = xf86SetStrOption(inputp->commonOptions, "AutoRepeat", NULL);
- if (s) {
- if (sscanf(s, "%d %d", &xf86Info.kbdDelay, &xf86Info.kbdRate) != 2) {
- xf86ConfigError("\"%s\" is not a valid AutoRepeat value", s);
- xfree(s);
- return FALSE;
- }
- xfree(s);
- }
-
- s = xf86SetStrOption(inputp->commonOptions, "XLeds", NULL);
- if (s) {
- char *l, *end;
- unsigned int i;
- l = strtok(s, " \t\n");
- while (l) {
- i = strtoul(l, &end, 0);
- if (*end == '\0')
- xf86Info.xleds |= 1L << (i - 1);
- else {
- xf86ConfigError("\"%s\" is not a valid XLeds value", l);
- xfree(s);
- return FALSE;
- }
- l = strtok(NULL, " \t\n");
- }
- xfree(s);
- }
-
-#ifdef XKB
- from = X_DEFAULT;
- if (noXkbExtension)
- from = X_CMDLINE;
- else if (xf86FindOption(inputp->commonOptions, "XkbDisable")) {
- xf86Msg(X_WARNING, "KEYBOARD: XKB should be disabled in the "
- "ServerFlags section instead\n"
- "\tof in the \"keyboard\" InputDevice section.\n");
- noXkbExtension =
- xf86SetBoolOption(inputp->commonOptions, "XkbDisable", FALSE);
- from = X_CONFIG;
- }
- if (noXkbExtension)
- xf86Msg(from, "XKB: disabled\n");
-
-#define NULL_IF_EMPTY(s) (s[0] ? s : (xfree(s), (char *)NULL))
-
- if (!noXkbExtension && !XkbInitialMap) {
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbKeymap", NULL))) {
- xf86Info.xkbkeymap = NULL_IF_EMPTY(s);
- xf86Msg(X_CONFIG, "XKB: keymap: \"%s\" "
- "(overrides other XKB settings)\n", xf86Info.xkbkeymap);
- } else {
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbCompat", NULL))) {
- xf86Info.xkbcompat = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: compat: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbTypes", NULL))) {
- xf86Info.xkbtypes = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: types: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbKeycodes", NULL))) {
- xf86Info.xkbkeycodes = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: keycodes: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbGeometry", NULL))) {
- xf86Info.xkbgeometry = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: geometry: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbSymbols", NULL))) {
- xf86Info.xkbsymbols = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: symbols: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbRules", NULL))) {
- xf86Info.xkbrules = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: rules: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbModel", NULL))) {
- xf86Info.xkbmodel = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: model: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbLayout", NULL))) {
- xf86Info.xkblayout = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: layout: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbVariant", NULL))) {
- xf86Info.xkbvariant = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: variant: \"%s\"\n", s);
- }
-
- if ((s = xf86SetStrOption(inputp->commonOptions, "XkbOptions", NULL))) {
- xf86Info.xkboptions = NULL_IF_EMPTY(s);
- xf86Info.xkbcomponents_specified = TRUE;
- xf86Msg(X_CONFIG, "XKB: options: \"%s\"\n", s);
- }
- }
- }
-#undef NULL_IF_EMPTY
-#endif
-#if defined(SVR4) && defined(i386)
- if ((xf86Info.panix106 =
- xf86SetBoolOption(inputp->commonOptions, "Panix106", FALSE))) {
- xf86Msg(X_CONFIG, "PANIX106: enabled\n");
- }
-#endif
-
- /*
- * This was once a compile time option (ASSUME_CUSTOM_KEYCODES)
- * defaulting to 1 on Linux/PPC. It is no longer necessary, but for
- * backwards compatibility we provide 'Option "CustomKeycodes"'
- * and try to autoprobe on Linux/PPC.
- */
- from = X_DEFAULT;
- verb = 2;
-#if defined(__linux__) && defined(__powerpc__)
- {
- FILE *f;
-
- f = fopen("/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes","r");
- if (f) {
- if (fgetc(f) == '0') {
- customKeycodesDefault = TRUE;
- from = X_PROBED;
- verb = 1;
- }
- fclose(f);
- }
- }
-#endif
- if (xf86FindOption(inputp->commonOptions, "CustomKeycodes")) {
- from = X_CONFIG;
- verb = 1;
- }
- xf86Info.kbdCustomKeycodes =
- xf86SetBoolOption(inputp->commonOptions, "CustomKeycodes",
- customKeycodesDefault);
- xf86MsgVerb(from, verb, "Keyboard: CustomKeycode %s\n",
- xf86Info.kbdCustomKeycodes ? "enabled" : "disabled");
-
- return TRUE;
-}
-
-/*
- * Locate the core input devices. These can be specified/located in
- * the following ways, in order of priority:
- *
- * 1. The InputDevices named by the -pointer and -keyboard command line
- * options.
- * 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by
- * the active ServerLayout.
- * 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard".
- * 4. The first InputDevices that use the 'mouse' and 'keyboard' or 'kbd'
- * drivers.
- * 5. Default devices with an empty (default) configuration. These defaults
- * will reference the 'mouse' and 'keyboard' drivers.
- */
-
-static Bool
-checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
-{
- IDevPtr corePointer = NULL, coreKeyboard = NULL;
- Bool foundPointer = FALSE, foundKeyboard = FALSE;
- const char *pointerMsg = NULL, *keyboardMsg = NULL;
- IDevPtr indp;
- IDevRec Pointer, Keyboard;
- XF86ConfInputPtr confInput;
- XF86ConfInputRec defPtr, defKbd;
- int count = 0;
- MessageType from = X_DEFAULT;
-
- /*
- * First check if a core pointer or core keyboard have been specified
- * in the active ServerLayout. If more than one is specified for either,
- * remove the core attribute from the later ones.
- */
- for (indp = servlayoutp->inputs; indp->identifier; indp++) {
- pointer opt1 = NULL, opt2 = NULL;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
- if (!corePointer) {
- corePointer = indp;
- } else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CorePointer", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CorePointer", FALSE);
- xf86Msg(X_WARNING, "Duplicate core pointer devices. "
- "Removing core pointer attribute from \"%s\"\n",
- indp->identifier);
- }
- }
- opt1 = opt2 = NULL;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
- if (!coreKeyboard) {
- coreKeyboard = indp;
- } else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE);
- xf86Msg(X_WARNING, "Duplicate core keyboard devices. "
- "Removing core keyboard attribute from \"%s\"\n",
- indp->identifier);
- }
- }
- count++;
- }
-
- confInput = NULL;
-
- /* 1. Check for the -pointer command line option. */
- if (xf86PointerName) {
- confInput = xf86findInput(xf86PointerName,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
- xf86PointerName);
- return FALSE;
- }
- from = X_CMDLINE;
- /*
- * If one was already specified in the ServerLayout, it needs to be
- * removed.
- */
- if (corePointer) {
- for (indp = servlayoutp->inputs; indp->identifier; indp++)
- if (indp == corePointer)
- break;
- for (; indp->identifier; indp++)
- indp[0] = indp[1];
- count--;
- }
- corePointer = NULL;
- foundPointer = TRUE;
- }
-
- /* 2. ServerLayout-specified core pointer. */
- if (corePointer) {
- foundPointer = TRUE;
- from = X_CONFIG;
- }
-
- /* 3. First core pointer device. */
- if (!foundPointer) {
- XF86ConfInputPtr p;
-
- for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
- if (p->inp_option_lst &&
- xf86CheckBoolOption(p->inp_option_lst, "CorePointer", FALSE)) {
- confInput = p;
- foundPointer = TRUE;
- from = X_DEFAULT;
- pointerMsg = "first core pointer device";
- break;
- }
- }
- }
-
- /* 4. First pointer with 'mouse' as the driver. */
- if (!foundPointer) {
- confInput = xf86findInput(CONF_IMPLICIT_POINTER,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- confInput = xf86findInputByDriver("mouse",
- xf86configptr->conf_input_lst);
- }
- if (confInput) {
- foundPointer = TRUE;
- from = X_DEFAULT;
- pointerMsg = "first mouse device";
- }
- }
-
- /* 5. Built-in default. */
- if (!foundPointer) {
- bzero(&defPtr, sizeof(defPtr));
- defPtr.inp_identifier = "<default pointer>";
- defPtr.inp_driver = "mouse";
- confInput = &defPtr;
- foundPointer = TRUE;
- from = X_DEFAULT;
- pointerMsg = "default mouse configuration";
- }
-
- /* Add the core pointer device to the layout, and set it to Core. */
- if (foundPointer && confInput) {
- foundPointer = configInput(&Pointer, confInput, from);
- if (foundPointer) {
- count++;
- indp = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevRec));
- indp[count - 1] = Pointer;
- indp[count - 1].extraOptions =
- xf86addNewOption(NULL, "CorePointer", NULL);
- indp[count].identifier = NULL;
- servlayoutp->inputs = indp;
- }
- }
-
- if (!foundPointer) {
- /* This shouldn't happen. */
- xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
- return FALSE;
- }
-
- confInput = NULL;
-
- /* 1. Check for the -keyboard command line option. */
- if (xf86KeyboardName) {
- confInput = xf86findInput(xf86KeyboardName,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
- xf86KeyboardName);
- return FALSE;
- }
- from = X_CMDLINE;
- /*
- * If one was already specified in the ServerLayout, it needs to be
- * removed.
- */
- if (coreKeyboard) {
- for (indp = servlayoutp->inputs; indp->identifier; indp++)
- if (indp == coreKeyboard)
- break;
- for (; indp->identifier; indp++)
- indp[0] = indp[1];
- count--;
- }
- coreKeyboard = NULL;
- foundKeyboard = TRUE;
- }
-
- /* 2. ServerLayout-specified core keyboard. */
- if (coreKeyboard) {
- foundKeyboard = TRUE;
- from = X_CONFIG;
- }
-
- /* 3. First core keyboard device. */
- if (!foundKeyboard) {
- XF86ConfInputPtr p;
-
- for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
- if (p->inp_option_lst &&
- xf86CheckBoolOption(p->inp_option_lst, "CoreKeyboard", FALSE)) {
- confInput = p;
- foundKeyboard = TRUE;
- from = X_DEFAULT;
- keyboardMsg = "first core keyboard device";
- break;
- }
- }
- }
-
- /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
- if (!foundKeyboard) {
- confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- confInput = xf86findInputByDriver("keyboard",
- xf86configptr->conf_input_lst);
- }
- if (!confInput) {
- confInput = xf86findInputByDriver("kbd",
- xf86configptr->conf_input_lst);
- }
- if (confInput) {
- foundKeyboard = TRUE;
- from = X_DEFAULT;
- pointerMsg = "first keyboard device";
- }
- }
-
- /* 5. Built-in default. */
- if (!foundKeyboard) {
- bzero(&defKbd, sizeof(defKbd));
- defKbd.inp_identifier = "<default keyboard>";
- defKbd.inp_driver = "keyboard";
- confInput = &defKbd;
- foundKeyboard = TRUE;
- keyboardMsg = "default keyboard configuration";
- from = X_DEFAULT;
- }
-
- /* Add the core keyboard device to the layout, and set it to Core. */
- if (foundKeyboard && confInput) {
- foundKeyboard = configInput(&Keyboard, confInput, from);
- if (foundKeyboard) {
- count++;
- indp = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevRec));
- indp[count - 1] = Keyboard;
- indp[count - 1].extraOptions =
- xf86addNewOption(NULL, "CoreKeyboard", NULL);
- indp[count].identifier = NULL;
- servlayoutp->inputs = indp;
- }
- }
-
- if (!foundKeyboard) {
- /* This shouldn't happen. */
- xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
- return FALSE;
- }
-
- if (pointerMsg) {
- xf86Msg(X_WARNING, "The core pointer device wasn't specified "
- "explicitly in the layout.\n"
- "\tUsing the %s.\n", pointerMsg);
- }
-
- if (keyboardMsg) {
- xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
- "explicitly in the layout.\n"
- "\tUsing the %s.\n", keyboardMsg);
- }
-
- return TRUE;
-}
-
-/*
- * figure out which layout is active, which screens are used in that layout,
- * which drivers and monitors are used in these screens
- */
-static Bool
-configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
- char *default_layout)
-{
- XF86ConfAdjacencyPtr adjp;
- XF86ConfInactivePtr idp;
- XF86ConfInputrefPtr irp;
- int count = 0;
- int scrnum;
- XF86ConfLayoutPtr l;
- MessageType from;
- screenLayoutPtr slp;
- GDevPtr gdp;
- IDevPtr indp;
- int i = 0, j;
-
- if (!servlayoutp)
- return FALSE;
-
- /*
- * which layout section is the active one?
- *
- * If there is a -layout command line option, use that one, otherwise
- * pick the first one.
- */
- from = X_DEFAULT;
- if (xf86LayoutName != NULL)
- from = X_CMDLINE;
- else if (default_layout) {
- xf86LayoutName = default_layout;
- from = X_CONFIG;
- }
- if (xf86LayoutName != NULL) {
- if ((l = xf86findLayout(xf86LayoutName, conf_layout)) == NULL) {
- xf86Msg(X_ERROR, "No ServerLayout section called \"%s\"\n",
- xf86LayoutName);
- return FALSE;
- }
- conf_layout = l;
- }
- xf86Msg(from, "ServerLayout \"%s\"\n", conf_layout->lay_identifier);
- adjp = conf_layout->lay_adjacency_lst;
-
- /*
- * we know that each screen is referenced exactly once on the left side
- * of a layout statement in the Layout section. So to allocate the right
- * size for the array we do a quick walk of the list to figure out how
- * many sections we have
- */
- while (adjp) {
- count++;
- adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
- }
-#ifdef DEBUG
- ErrorF("Found %d screens in the layout section %s",
- count, conf_layout->lay_identifier);
-#endif
- slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec));
- slp[count].screen = NULL;
- /*
- * now that we have storage, loop over the list again and fill in our
- * data structure; at this point we do not fill in the adjacency
- * information as it is not clear if we need it at all
- */
- adjp = conf_layout->lay_adjacency_lst;
- count = 0;
- while (adjp) {
- slp[count].screen = xnfcalloc(1, sizeof(confScreenRec));
- if (adjp->adj_scrnum < 0)
- scrnum = count;
- else
- scrnum = adjp->adj_scrnum;
- if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum,
- X_CONFIG))
- return FALSE;
- slp[count].x = adjp->adj_x;
- slp[count].y = adjp->adj_y;
- slp[count].refname = adjp->adj_refscreen;
- switch (adjp->adj_where) {
- case CONF_ADJ_OBSOLETE:
- slp[count].where = PosObsolete;
- slp[count].topname = adjp->adj_top_str;
- slp[count].bottomname = adjp->adj_bottom_str;
- slp[count].leftname = adjp->adj_left_str;
- slp[count].rightname = adjp->adj_right_str;
- break;
- case CONF_ADJ_ABSOLUTE:
- slp[count].where = PosAbsolute;
- break;
- case CONF_ADJ_RIGHTOF:
- slp[count].where = PosRightOf;
- break;
- case CONF_ADJ_LEFTOF:
- slp[count].where = PosLeftOf;
- break;
- case CONF_ADJ_ABOVE:
- slp[count].where = PosAbove;
- break;
- case CONF_ADJ_BELOW:
- slp[count].where = PosBelow;
- break;
- case CONF_ADJ_RELATIVE:
- slp[count].where = PosRelative;
- break;
- }
- count++;
- adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
- }
-
- /* XXX Need to tie down the upper left screen. */
-
- /* Fill in the refscreen and top/bottom/left/right values */
- for (i = 0; i < count; i++) {
- for (j = 0; j < count; j++) {
- if (slp[i].refname &&
- strcmp(slp[i].refname, slp[j].screen->id) == 0) {
- slp[i].refscreen = slp[j].screen;
- }
- if (slp[i].topname &&
- strcmp(slp[i].topname, slp[j].screen->id) == 0) {
- slp[i].top = slp[j].screen;
- }
- if (slp[i].bottomname &&
- strcmp(slp[i].bottomname, slp[j].screen->id) == 0) {
- slp[i].bottom = slp[j].screen;
- }
- if (slp[i].leftname &&
- strcmp(slp[i].leftname, slp[j].screen->id) == 0) {
- slp[i].left = slp[j].screen;
- }
- if (slp[i].rightname &&
- strcmp(slp[i].rightname, slp[j].screen->id) == 0) {
- slp[i].right = slp[j].screen;
- }
- }
- if (slp[i].where != PosObsolete
- && slp[i].where != PosAbsolute
- && !slp[i].refscreen) {
- xf86Msg(X_ERROR,"Screen %s doesn't exist: deleting placement\n",
- slp[i].refname);
- slp[i].where = PosAbsolute;
- slp[i].x = 0;
- slp[i].y = 0;
- }
- }
-
-#ifdef LAYOUT_DEBUG
- ErrorF("Layout \"%s\"\n", conf_layout->lay_identifier);
- for (i = 0; i < count; i++) {
- ErrorF("Screen: \"%s\" (%d):\n", slp[i].screen->id,
- slp[i].screen->screennum);
- switch (slp[i].where) {
- case PosObsolete:
- ErrorF("\tObsolete format: \"%s\" \"%s\" \"%s\" \"%s\"\n",
- slp[i].top, slp[i].bottom, slp[i].left, slp[i].right);
- break;
- case PosAbsolute:
- if (slp[i].x == -1)
- if (slp[i].screen->screennum == 0)
- ErrorF("\tImplicitly left-most\n");
- else
- ErrorF("\tImplicitly right of screen %d\n",
- slp[i].screen->screennum - 1);
- else
- ErrorF("\t%d %d\n", slp[i].x, slp[i].y);
- break;
- case PosRightOf:
- ErrorF("\tRight of \"%s\"\n", slp[i].refscreen->id);
- break;
- case PosLeftOf:
- ErrorF("\tLeft of \"%s\"\n", slp[i].refscreen->id);
- break;
- case PosAbove:
- ErrorF("\tAbove \"%s\"\n", slp[i].refscreen->id);
- break;
- case PosBelow:
- ErrorF("\tBelow \"%s\"\n", slp[i].refscreen->id);
- break;
- case PosRelative:
- ErrorF("\t%d %d relative to \"%s\"\n", slp[i].x, slp[i].y,
- slp[i].refscreen->id);
- break;
- }
- }
-#endif
- /*
- * Count the number of inactive devices.
- */
- count = 0;
- idp = conf_layout->lay_inactive_lst;
- while (idp) {
- count++;
- idp = (XF86ConfInactivePtr)idp->list.next;
- }
-#ifdef DEBUG
- ErrorF("Found %d inactive devices in the layout section %s",
- count, conf_layout->lay_identifier);
-#endif
- gdp = xnfalloc((count + 1) * sizeof(GDevRec));
- gdp[count].identifier = NULL;
- idp = conf_layout->lay_inactive_lst;
- count = 0;
- while (idp) {
- if (!configDevice(&gdp[count], idp->inactive_device, FALSE))
- return FALSE;
- count++;
- idp = (XF86ConfInactivePtr)idp->list.next;
- }
- /*
- * Count the number of input devices.
- */
- count = 0;
- irp = conf_layout->lay_input_lst;
- while (irp) {
- count++;
- irp = (XF86ConfInputrefPtr)irp->list.next;
- }
-#ifdef DEBUG
- ErrorF("Found %d input devices in the layout section %s",
- count, conf_layout->lay_identifier);
-#endif
- indp = xnfalloc((count + 1) * sizeof(IDevRec));
- indp[count].identifier = NULL;
- irp = conf_layout->lay_input_lst;
- count = 0;
- while (irp) {
- if (!configInput(&indp[count], irp->iref_inputdev, X_CONFIG))
- return FALSE;
- indp[count].extraOptions = irp->iref_option_lst;
- count++;
- irp = (XF86ConfInputrefPtr)irp->list.next;
- }
- servlayoutp->id = conf_layout->lay_identifier;
- servlayoutp->screens = slp;
- servlayoutp->inactives = gdp;
- servlayoutp->inputs = indp;
- servlayoutp->options = conf_layout->lay_option_lst;
- from = X_DEFAULT;
-
- if (!checkCoreInputDevices(servlayoutp, FALSE))
- return FALSE;
- return TRUE;
-}
-
-/*
- * No layout section, so find the first Screen section and set that up as
- * the only active screen.
- */
-static Bool
-configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
-{
- MessageType from;
- XF86ConfScreenPtr s;
- screenLayoutPtr slp;
- IDevPtr indp;
-
- if (!servlayoutp)
- return FALSE;
-
- if (conf_screen == NULL) {
- xf86ConfigError("No Screen sections present\n");
- return FALSE;
- }
-
- /*
- * which screen section is the active one?
- *
- * If there is a -screen option, use that one, otherwise use the first
- * one.
- */
-
- from = X_CONFIG;
- if (xf86ScreenName != NULL) {
- if ((s = xf86findScreen(xf86ScreenName, conf_screen)) == NULL) {
- xf86Msg(X_ERROR, "No Screen section called \"%s\"\n",
- xf86ScreenName);
- return FALSE;
- }
- conf_screen = s;
- from = X_CMDLINE;
- }
-
- /* We have exactly one screen */
-
- slp = xnfcalloc(1, 2 * sizeof(screenLayoutRec));
- slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
- slp[1].screen = NULL;
- if (!configScreen(slp[0].screen, conf_screen, 0, from))
- return FALSE;
- servlayoutp->id = "(implicit)";
- servlayoutp->screens = slp;
- servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec));
- servlayoutp->options = NULL;
- /* Set up an empty input device list, then look for some core devices. */
- indp = xnfalloc(sizeof(IDevRec));
- indp->identifier = NULL;
- servlayoutp->inputs = indp;
- if (!checkCoreInputDevices(servlayoutp, TRUE))
- return FALSE;
-
- return TRUE;
-}
-
-static Bool
-configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor)
-{
- int count = 0;
- XF86ConfVideoPortPtr conf_port;
-
- xf86Msg(X_CONFIG, "| |-->VideoAdaptor \"%s\"\n",
- conf_adaptor->va_identifier);
- adaptor->identifier = conf_adaptor->va_identifier;
- adaptor->options = conf_adaptor->va_option_lst;
- if (conf_adaptor->va_busid || conf_adaptor->va_driver) {
- xf86Msg(X_CONFIG, "| | Unsupported device type, skipping entry\n");
- return FALSE;
- }
-
- /*
- * figure out how many videoport subsections there are and fill them in
- */
- conf_port = conf_adaptor->va_port_lst;
- while(conf_port) {
- count++;
- conf_port = (XF86ConfVideoPortPtr)conf_port->list.next;
- }
- adaptor->ports = xnfalloc((count) * sizeof(confXvPortRec));
- adaptor->numports = count;
- count = 0;
- conf_port = conf_adaptor->va_port_lst;
- while(conf_port) {
- adaptor->ports[count].identifier = conf_port->vp_identifier;
- adaptor->ports[count].options = conf_port->vp_option_lst;
- count++;
- conf_port = (XF86ConfVideoPortPtr)conf_port->list.next;
- }
-
- return TRUE;
-}
-
-static Bool
-configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
- MessageType from)
-{
- int count = 0;
- XF86ConfDisplayPtr dispptr;
- XF86ConfAdaptorLinkPtr conf_adaptor;
- Bool defaultMonitor = FALSE;
-
- xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
- scrnum);
- /*
- * now we fill in the elements of the screen
- */
- screenp->id = conf_screen->scrn_identifier;
- screenp->screennum = scrnum;
- screenp->defaultdepth = conf_screen->scrn_defaultdepth;
- screenp->defaultbpp = conf_screen->scrn_defaultbpp;
- screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp;
- screenp->monitor = xnfcalloc(1, sizeof(MonRec));
- /* If no monitor is specified, create a default one. */
- if (!conf_screen->scrn_monitor) {
- XF86ConfMonitorRec defMon;
-
- bzero(&defMon, sizeof(defMon));
- defMon.mon_identifier = "<default monitor>";
- /*
- * TARGET_REFRESH_RATE may be defined to effectively limit the
- * default resolution to the largest that has a "good" refresh
- * rate.
- */
-#ifdef TARGET_REFRESH_RATE
- defMon.mon_option_lst = xf86ReplaceRealOption(defMon.mon_option_lst,
- "TargetRefresh",
- TARGET_REFRESH_RATE);
-#endif
- if (!configMonitor(screenp->monitor, &defMon))
- return FALSE;
- defaultMonitor = TRUE;
- } else {
- if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
- return FALSE;
- }
- screenp->device = xnfcalloc(1, sizeof(GDevRec));
- configDevice(screenp->device,conf_screen->scrn_device, TRUE);
- screenp->device->myScreenSection = screenp;
- screenp->options = conf_screen->scrn_option_lst;
-
- /*
- * figure out how many display subsections there are and fill them in
- */
- dispptr = conf_screen->scrn_display_lst;
- while(dispptr) {
- count++;
- dispptr = (XF86ConfDisplayPtr)dispptr->list.next;
- }
- screenp->displays = xnfalloc((count) * sizeof(DispRec));
- screenp->numdisplays = count;
- count = 0;
- dispptr = conf_screen->scrn_display_lst;
- while(dispptr) {
- configDisplay(&(screenp->displays[count]),dispptr);
- count++;
- dispptr = (XF86ConfDisplayPtr)dispptr->list.next;
- }
-
- /*
- * figure out how many videoadaptor references there are and fill them in
- */
- conf_adaptor = conf_screen->scrn_adaptor_lst;
- while(conf_adaptor) {
- count++;
- conf_adaptor = (XF86ConfAdaptorLinkPtr)conf_adaptor->list.next;
- }
- screenp->xvadaptors = xnfalloc((count) * sizeof(confXvAdaptorRec));
- screenp->numxvadaptors = 0;
- conf_adaptor = conf_screen->scrn_adaptor_lst;
- while(conf_adaptor) {
- if (configXvAdaptor(&(screenp->xvadaptors[screenp->numxvadaptors]),
- conf_adaptor->al_adaptor))
- screenp->numxvadaptors++;
- conf_adaptor = (XF86ConfAdaptorLinkPtr)conf_adaptor->list.next;
- }
-
- if (defaultMonitor) {
- xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
- "\tUsing a default monitor configuration.\n", screenp->id);
- }
- return TRUE;
-}
-
-static Bool
-configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor)
-{
- int count;
- DisplayModePtr mode,last = NULL;
- XF86ConfModeLinePtr cmodep;
- XF86ConfModesPtr modes;
- XF86ConfModesLinkPtr modeslnk = conf_monitor->mon_modes_sect_lst;
- Gamma zeros = {0.0, 0.0, 0.0};
- float badgamma = 0.0;
-
- xf86Msg(X_CONFIG, "| |-->Monitor \"%s\"\n",
- conf_monitor->mon_identifier);
- monitorp->id = conf_monitor->mon_identifier;
- monitorp->vendor = conf_monitor->mon_vendor;
- monitorp->model = conf_monitor->mon_modelname;
- monitorp->Modes = NULL;
- monitorp->Last = NULL;
- monitorp->gamma = zeros;
- monitorp->widthmm = conf_monitor->mon_width;
- monitorp->heightmm = conf_monitor->mon_height;
- monitorp->options = conf_monitor->mon_option_lst;
-
- /*
- * fill in the monitor structure
- */
- for( count = 0 ; count < conf_monitor->mon_n_hsync; count++) {
- monitorp->hsync[count].hi = conf_monitor->mon_hsync[count].hi;
- monitorp->hsync[count].lo = conf_monitor->mon_hsync[count].lo;
- }
- monitorp->nHsync = conf_monitor->mon_n_hsync;
- for( count = 0 ; count < conf_monitor->mon_n_vrefresh; count++) {
- monitorp->vrefresh[count].hi = conf_monitor->mon_vrefresh[count].hi;
- monitorp->vrefresh[count].lo = conf_monitor->mon_vrefresh[count].lo;
- }
- monitorp->nVrefresh = conf_monitor->mon_n_vrefresh;
-
- /*
- * first we collect the mode lines from the UseModes directive
- */
- while(modeslnk)
- {
- modes = xf86findModes (modeslnk->ml_modes_str,
- xf86configptr->conf_modes_lst);
- modeslnk->ml_modes = modes;
-
-
- /* now add the modes found in the modes
- section to the list of modes for this
- monitor unless it has been added before
- because we are reusing the same section
- for another screen */
- if (xf86itemNotSublist(
- (GenericListPtr)conf_monitor->mon_modeline_lst,
- (GenericListPtr)modes->mon_modeline_lst)) {
- conf_monitor->mon_modeline_lst = (XF86ConfModeLinePtr)
- xf86addListItem(
- (GenericListPtr)conf_monitor->mon_modeline_lst,
- (GenericListPtr)modes->mon_modeline_lst);
- }
- modeslnk = modeslnk->list.next;
- }
-
- /*
- * we need to hook in the mode lines now
- * here both data structures use lists, only our internal one
- * is double linked
- */
- cmodep = conf_monitor->mon_modeline_lst;
- while( cmodep ) {
- mode = xnfalloc(sizeof(DisplayModeRec));
- memset(mode,'\0',sizeof(DisplayModeRec));
- mode->type = 0;
- mode->Clock = cmodep->ml_clock;
- mode->HDisplay = cmodep->ml_hdisplay;
- mode->HSyncStart = cmodep->ml_hsyncstart;
- mode->HSyncEnd = cmodep->ml_hsyncend;
- mode->HTotal = cmodep->ml_htotal;
- mode->VDisplay = cmodep->ml_vdisplay;
- mode->VSyncStart = cmodep->ml_vsyncstart;
- mode->VSyncEnd = cmodep->ml_vsyncend;
- mode->VTotal = cmodep->ml_vtotal;
- mode->Flags = cmodep->ml_flags;
- mode->HSkew = cmodep->ml_hskew;
- mode->VScan = cmodep->ml_vscan;
- mode->name = xnfstrdup(cmodep->ml_identifier);
- if( last ) {
- mode->prev = last;
- last->next = mode;
- }
- else {
- /*
- * this is the first mode
- */
- monitorp->Modes = mode;
- mode->prev = NULL;
- }
- last = mode;
- cmodep = (XF86ConfModeLinePtr)cmodep->list.next;
- }
- if(last){
- last->next = NULL;
- }
- monitorp->Last = last;
-
- /* add the (VESA) default modes */
- if (! addDefaultModes(monitorp) )
- return FALSE;
-
- if (conf_monitor->mon_gamma_red > GAMMA_ZERO)
- monitorp->gamma.red = conf_monitor->mon_gamma_red;
- if (conf_monitor->mon_gamma_green > GAMMA_ZERO)
- monitorp->gamma.green = conf_monitor->mon_gamma_green;
- if (conf_monitor->mon_gamma_blue > GAMMA_ZERO)
- monitorp->gamma.blue = conf_monitor->mon_gamma_blue;
-
- /* Check that the gamma values are within range */
- if (monitorp->gamma.red > GAMMA_ZERO &&
- (monitorp->gamma.red < GAMMA_MIN ||
- monitorp->gamma.red > GAMMA_MAX)) {
- badgamma = monitorp->gamma.red;
- } else if (monitorp->gamma.green > GAMMA_ZERO &&
- (monitorp->gamma.green < GAMMA_MIN ||
- monitorp->gamma.green > GAMMA_MAX)) {
- badgamma = monitorp->gamma.green;
- } else if (monitorp->gamma.blue > GAMMA_ZERO &&
- (monitorp->gamma.blue < GAMMA_MIN ||
- monitorp->gamma.blue > GAMMA_MAX)) {
- badgamma = monitorp->gamma.blue;
- }
- if (badgamma > GAMMA_ZERO) {
- xf86ConfigError("Gamma value %.f is out of range (%.2f - %.1f)\n",
- badgamma, GAMMA_MIN, GAMMA_MAX);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static int
-lookupVisual(const char *visname)
-{
- int i;
-
- if (!visname || !*visname)
- return -1;
-
- for (i = 0; i <= DirectColor; i++) {
- if (!xf86nameCompare(visname, xf86VisualNames[i]))
- break;
- }
-
- if (i <= DirectColor)
- return i;
-
- return -1;
-}
-
-
-static Bool
-configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display)
-{
- int count = 0;
- XF86ModePtr modep;
-
- displayp->frameX0 = conf_display->disp_frameX0;
- displayp->frameY0 = conf_display->disp_frameY0;
- displayp->virtualX = conf_display->disp_virtualX;
- displayp->virtualY = conf_display->disp_virtualY;
- displayp->depth = conf_display->disp_depth;
- displayp->fbbpp = conf_display->disp_bpp;
- displayp->weight.red = conf_display->disp_weight.red;
- displayp->weight.green = conf_display->disp_weight.green;
- displayp->weight.blue = conf_display->disp_weight.blue;
- displayp->blackColour.red = conf_display->disp_black.red;
- displayp->blackColour.green = conf_display->disp_black.green;
- displayp->blackColour.blue = conf_display->disp_black.blue;
- displayp->whiteColour.red = conf_display->disp_white.red;
- displayp->whiteColour.green = conf_display->disp_white.green;
- displayp->whiteColour.blue = conf_display->disp_white.blue;
- displayp->options = conf_display->disp_option_lst;
- if (conf_display->disp_visual) {
- displayp->defaultVisual = lookupVisual(conf_display->disp_visual);
- if (displayp->defaultVisual == -1) {
- xf86ConfigError("Invalid visual name: \"%s\"",
- conf_display->disp_visual);
- return FALSE;
- }
- } else {
- displayp->defaultVisual = -1;
- }
-
- /*
- * now hook in the modes
- */
- modep = conf_display->disp_mode_lst;
- while(modep) {
- count++;
- modep = (XF86ModePtr)modep->list.next;
- }
- displayp->modes = xnfalloc((count+1) * sizeof(char*));
- modep = conf_display->disp_mode_lst;
- count = 0;
- while(modep) {
- displayp->modes[count] = modep->mode_name;
- count++;
- modep = (XF86ModePtr)modep->list.next;
- }
- displayp->modes[count] = NULL;
-
- return TRUE;
-}
-
-static Bool
-configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
-{
- int i;
-
- if (active)
- xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n",
- conf_device->dev_identifier);
- else
- xf86Msg(X_CONFIG, "|-->Inactive Device \"%s\"\n",
- conf_device->dev_identifier);
-
- devicep->identifier = conf_device->dev_identifier;
- devicep->vendor = conf_device->dev_vendor;
- devicep->board = conf_device->dev_board;
- devicep->chipset = conf_device->dev_chipset;
- devicep->ramdac = conf_device->dev_ramdac;
- devicep->driver = conf_device->dev_driver;
- devicep->active = active;
- devicep->videoRam = conf_device->dev_videoram;
- devicep->BiosBase = conf_device->dev_bios_base;
- devicep->MemBase = conf_device->dev_mem_base;
- devicep->IOBase = conf_device->dev_io_base;
- devicep->clockchip = conf_device->dev_clockchip;
- devicep->busID = conf_device->dev_busid;
- devicep->textClockFreq = conf_device->dev_textclockfreq;
- devicep->chipID = conf_device->dev_chipid;
- devicep->chipRev = conf_device->dev_chiprev;
- devicep->options = conf_device->dev_option_lst;
- devicep->irq = conf_device->dev_irq;
- devicep->screen = conf_device->dev_screen;
-
- for (i = 0; i < MAXDACSPEEDS; i++) {
- if (i < CONF_MAXDACSPEEDS)
- devicep->dacSpeeds[i] = conf_device->dev_dacSpeeds[i];
- else
- devicep->dacSpeeds[i] = 0;
- }
- devicep->numclocks = conf_device->dev_clocks;
- if (devicep->numclocks > MAXCLOCKS)
- devicep->numclocks = MAXCLOCKS;
- for (i = 0; i < devicep->numclocks; i++) {
- devicep->clock[i] = conf_device->dev_clock[i];
- }
- devicep->claimed = FALSE;
-
- return TRUE;
-}
-
-#ifdef XF86DRI
-static Bool
-configDRI(XF86ConfDRIPtr drip)
-{
- int count = 0;
- XF86ConfBuffersPtr bufs;
- int i;
- struct group *grp;
-
- xf86ConfigDRI.group = -1;
- xf86ConfigDRI.mode = 0;
- xf86ConfigDRI.bufs_count = 0;
- xf86ConfigDRI.bufs = NULL;
-
- if (drip) {
- if (drip->dri_group_name) {
- if ((grp = getgrnam(drip->dri_group_name)))
- xf86ConfigDRI.group = grp->gr_gid;
- } else {
- if (drip->dri_group >= 0)
- xf86ConfigDRI.group = drip->dri_group;
- }
- xf86ConfigDRI.mode = drip->dri_mode;
- for (bufs = drip->dri_buffers_lst; bufs; bufs = bufs->list.next)
- ++count;
-
- xf86ConfigDRI.bufs_count = count;
- xf86ConfigDRI.bufs = xnfalloc(count * sizeof(*xf86ConfigDRI.bufs));
-
- for (i = 0, bufs = drip->dri_buffers_lst;
- i < count;
- i++, bufs = bufs->list.next) {
-
- xf86ConfigDRI.bufs[i].count = bufs->buf_count;
- xf86ConfigDRI.bufs[i].size = bufs->buf_size;
- /* FIXME: Flags not implemented. These
- could be used, for example, to specify a
- contiguous block and/or write-combining
- cache policy. */
- xf86ConfigDRI.bufs[i].flags = 0;
- }
- }
-
- return TRUE;
-}
-#endif
-
-static Bool
-configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
-{
- xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
- inputp->identifier = conf_input->inp_identifier;
- inputp->driver = conf_input->inp_driver;
- inputp->commonOptions = conf_input->inp_option_lst;
- inputp->extraOptions = NULL;
-
- /* XXX This is required until the keyboard driver is converted */
- if (!xf86NameCmp(inputp->driver, "keyboard"))
- return configInputKbd(inputp);
-
- return TRUE;
-}
-
-static Bool
-modeIsPresent(char * modename,MonPtr monitorp)
-{
- DisplayModePtr knownmodes = monitorp->Modes;
-
- /* all I can think of is a linear search... */
- while(knownmodes != NULL)
- {
- if(!strcmp(modename,knownmodes->name) &&
- !(knownmodes->type & M_T_DEFAULT))
- return TRUE;
- knownmodes = knownmodes->next;
- }
- return FALSE;
-}
-
-static Bool
-addDefaultModes(MonPtr monitorp)
-{
- DisplayModePtr mode;
- DisplayModePtr last = monitorp->Last;
- int i = 0;
-
- while (xf86DefaultModes[i].name != NULL)
- {
- if ( ! modeIsPresent(xf86DefaultModes[i].name,monitorp) )
- do
- {
- mode = xnfalloc(sizeof(DisplayModeRec));
- memcpy(mode,&xf86DefaultModes[i],sizeof(DisplayModeRec));
- if (xf86DefaultModes[i].name)
- mode->name = xnfstrdup(xf86DefaultModes[i].name);
- if( last ) {
- mode->prev = last;
- last->next = mode;
- }
- else {
- /* this is the first mode */
- monitorp->Modes = mode;
- mode->prev = NULL;
- }
- last = mode;
- i++;
- }
- while((xf86DefaultModes[i].name != NULL) &&
- (!strcmp(xf86DefaultModes[i].name,xf86DefaultModes[i-1].name)));
- else
- i++;
- }
- monitorp->Last = last;
-
- return TRUE;
-}
-
-/*
- * load the config file and fill the global data structure
- */
-ConfigStatus
-xf86HandleConfigFile(Bool autoconfig)
-{
- const char *filename;
- char *searchpath;
- MessageType from = X_DEFAULT;
-
- if (!autoconfig) {
- if (getuid() == 0)
- searchpath = ROOT_CONFIGPATH;
- else
- searchpath = USER_CONFIGPATH;
-
- if (xf86ConfigFile)
- from = X_CMDLINE;
-
- filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
- if (filename) {
- xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
- xf86ConfigFile = xnfstrdup(filename);
- } else {
- xf86Msg(X_ERROR, "Unable to locate/open config file");
- if (xf86ConfigFile)
- xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
- xf86ErrorFVerb(0, "\n");
- return CONFIG_NOFILE;
- }
- }
-
- if ((xf86configptr = xf86readConfigFile ()) == NULL) {
- xf86Msg(X_ERROR, "Problem parsing the config file\n");
- return CONFIG_PARSE_ERROR;
- }
- xf86closeConfigFile ();
-
- /* Initialise a few things. */
-
- /*
- * now we convert part of the information contained in the parser
- * structures into our own structures.
- * The important part here is to figure out which Screen Sections
- * in the XF86Config file are active so that we can piece together
- * the modes that we need later down the road.
- * And while we are at it, we'll decode the rest of the stuff as well
- */
-
- /* First check if a layout section is present, and if it is valid. */
-
- if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
- if (xf86ScreenName == NULL) {
- xf86Msg(X_WARNING,
- "No Layout section. Using the first Screen section.\n");
- }
- if (!configImpliedLayout(&xf86ConfigLayout,
- xf86configptr->conf_screen_lst)) {
- xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return CONFIG_PARSE_ERROR;
- }
- } else {
- if (xf86configptr->conf_flags != NULL) {
- char *dfltlayout = NULL;
- pointer optlist = xf86configptr->conf_flags->flg_option_lst;
-
- if (optlist && xf86FindOption(optlist, "defaultserverlayout"))
- dfltlayout = xf86SetStrOption(optlist, "defaultserverlayout", NULL);
- if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
- dfltlayout)) {
- xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return CONFIG_PARSE_ERROR;
- }
- } else {
- if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
- NULL)) {
- xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return CONFIG_PARSE_ERROR;
- }
- }
- }
-
- /* Now process everything else */
-
- if (!configFiles(xf86configptr->conf_files) ||
- !configServerFlags(xf86configptr->conf_flags,
- xf86ConfigLayout.options)
-#ifdef XF86DRI
- || !configDRI(xf86configptr->conf_dri)
-#endif
- ) {
- ErrorF ("Problem when converting the config data structures\n");
- return CONFIG_PARSE_ERROR;
- }
-
- /*
- * Handle some command line options that can override some of the
- * ServerFlags settings.
- */
-#ifdef XF86VIDMODE
- if (xf86VidModeDisabled)
- xf86Info.vidModeEnabled = FALSE;
- if (xf86VidModeAllowNonLocal)
- xf86Info.vidModeAllowNonLocal = TRUE;
-#endif
-
-#ifdef XF86MISC
- if (xf86MiscModInDevDisabled)
- xf86Info.miscModInDevEnabled = FALSE;
- if (xf86MiscModInDevAllowNonLocal)
- xf86Info.miscModInDevAllowNonLocal = TRUE;
-#endif
-
- if (xf86AllowMouseOpenFail)
- xf86Info.allowMouseOpenFail = TRUE;
-
- return CONFIG_OK;
-}
-
-
-/* These make the equivalent parser functions visible to the common layer. */
-Bool
-xf86PathIsAbsolute(const char *path)
-{
- return (xf86pathIsAbsolute(path) != 0);
-}
-
-Bool
-xf86PathIsSafe(const char *path)
-{
- return (xf86pathIsSafe(path) != 0);
-}
-
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
deleted file mode 100644
index e54da3d09..000000000
--- a/hw/xfree86/common/xf86Config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.7 2003/10/08 14:58:27 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _xf86_config_h
-#define _xf86_config_h
-
-#ifdef HAVE_PARSER_DECLS
-/*
- * global structure that holds the result of parsing the config file
- */
-extern XF86ConfigPtr xf86configptr;
-#endif
-
-typedef enum _ConfigStatus {
- CONFIG_OK = 0,
- CONFIG_PARSE_ERROR,
- CONFIG_NOFILE
-} ConfigStatus;
-
-/*
- * prototypes
- */
-char ** xf86ModulelistFromConfig(pointer **);
-char ** xf86DriverlistFromConfig(void);
-char ** xf86DriverlistFromCompile(void);
-char ** xf86InputDriverlistFromConfig(void);
-char ** xf86InputDriverlistFromCompile(void);
-Bool xf86BuiltinInputDriver(const char *);
-ConfigStatus xf86HandleConfigFile(Bool);
-
-Bool xf86AutoConfig(void);
-
-#endif /* _xf86_config_h */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
deleted file mode 100644
index 3dde4ba7d..000000000
--- a/hw/xfree86/common/xf86Configure.c
+++ /dev/null
@@ -1,999 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.81 2003/10/29 04:17:21 dawes Exp $ */
-/*
- * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Alan Hourihane, alanh@fairlite.demon.co.uk
- *
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "X.h"
-#include "Xmd.h"
-#include "os.h"
-#ifdef XFree86LOADER
-#include "loaderProcs.h"
-#endif
-#include "xf86.h"
-#include "xf86Config.h"
-#include "xf86Priv.h"
-#include "xf86PciData.h"
-#define IN_XSERVER
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-#include "vbe.h"
-#include "xf86DDC.h"
-#if defined(__sparc__) && !defined(__OpenBSD__)
-#include "xf86Bus.h"
-#include "xf86Sbus.h"
-#endif
-#include "globals.h"
-
-typedef struct _DevToConfig {
- GDevRec GDev;
- pciVideoPtr pVideo;
-#if defined(__sparc__) && !defined(__OpenBSD__)
- sbusDevicePtr sVideo;
-#endif
- int iDriver;
-} DevToConfigRec, *DevToConfigPtr;
-
-static DevToConfigPtr DevToConfig = NULL;
-static int nDevToConfig = 0, CurrentDriver;
-
-xf86MonPtr ConfiguredMonitor;
-Bool xf86DoConfigurePass1 = TRUE;
-Bool foundMouse = FALSE;
-
-#if defined(__UNIXOS2__)
-#define DFLT_MOUSE_DEV "mouse$"
-#define DFLT_MOUSE_PROTO "OS2Mouse"
-#elif defined(SCO)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-#elif defined(QNX4)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-static char *DFLT_MOUSE_DEV = "/dev/mouse";
-#elif defined(__QNXNTO__)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-static char *DFLT_MOUSE_DEV = "/dev/devi/mouse0";
-#elif defined(__FreeBSD__)
-static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
-static char *DFLT_MOUSE_PROTO = "auto";
-#else
-static char *DFLT_MOUSE_DEV = "/dev/mouse";
-static char *DFLT_MOUSE_PROTO = "auto";
-#endif
-
-/*
- * This is called by the driver, either through xf86Match???Instances() or
- * directly. We allocate a GDevRec and fill it in as much as we can, letting
- * the caller fill in the rest and/or change it as it sees fit.
- */
-GDevPtr
-xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset)
-{
- int i, j;
- pciVideoPtr pVideo = NULL;
- Bool isPrimary = FALSE;
-
- if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1)
- return NULL;
-
- /* Check for duplicates */
- switch (bus) {
- case BUS_PCI:
- pVideo = (pciVideoPtr) busData;
- for (i = 0; i < nDevToConfig; i++)
- if (DevToConfig[i].pVideo &&
- (DevToConfig[i].pVideo->bus == pVideo->bus) &&
- (DevToConfig[i].pVideo->device == pVideo->device) &&
- (DevToConfig[i].pVideo->func == pVideo->func))
- return NULL;
- isPrimary = xf86IsPrimaryPci(pVideo);
- break;
- case BUS_ISA:
- /*
- * This needs to be revisited as it doesn't allow for non-PCI
- * multihead.
- */
- if (!xf86IsPrimaryIsa())
- return NULL;
- isPrimary = TRUE;
- for (i = 0; i < nDevToConfig; i++)
- if (!DevToConfig[i].pVideo)
- return NULL;
- break;
-#if defined(__sparc__) && !defined(__OpenBSD__)
- case BUS_SBUS:
- for (i = 0; i < nDevToConfig; i++)
- if (DevToConfig[i].sVideo &&
- DevToConfig[i].sVideo->fbNum == ((sbusDevicePtr) busData)->fbNum)
- return NULL;
- break;
-#endif
- default:
- return NULL;
- }
-
- /* Allocate new structure occurrence */
- i = nDevToConfig++;
- DevToConfig =
- xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec));
-#if 1 /* Doesn't work when a driver detects more than one adapter */
- if ((i > 0) && isPrimary) {
- memmove(DevToConfig + 1,DevToConfig,
- (nDevToConfig - 1) * sizeof(DevToConfigRec));
- i = 0;
- }
-#endif
- memset(DevToConfig + i, 0, sizeof(DevToConfigRec));
-
-# define NewDevice DevToConfig[i]
-
- NewDevice.GDev.chipID = NewDevice.GDev.chipRev = NewDevice.GDev.irq = -1;
-
- NewDevice.iDriver = CurrentDriver;
-
- /* Fill in what we know, converting the driver name to lower case */
- NewDevice.GDev.driver = xnfalloc(strlen(driver) + 1);
- for (j = 0; (NewDevice.GDev.driver[j] = tolower(driver[j])); j++);
-
- switch (bus) {
- case BUS_PCI: {
- const char *VendorName;
- const char *CardName;
- char busnum[8];
-
- NewDevice.pVideo = pVideo;
- xf86FindPciNamesByDevice(pVideo->vendor, pVideo->chipType,
- NOVENDOR, NOSUBSYS,
- &VendorName, &CardName, NULL, NULL);
-
- if (!VendorName) {
- VendorName = xnfalloc(15);
- sprintf((char*)VendorName, "Unknown Vendor");
- }
-
- if (!CardName) {
- CardName = xnfalloc(14);
- sprintf((char*)CardName, "Unknown Board");
- }
-
- NewDevice.GDev.identifier =
- xnfalloc(strlen(VendorName) + strlen(CardName) + 2);
- sprintf(NewDevice.GDev.identifier, "%s %s", VendorName, CardName);
-
- NewDevice.GDev.vendor = (char *)VendorName;
- NewDevice.GDev.board = (char *)CardName;
-
- NewDevice.GDev.busID = xnfalloc(16);
- xf86FormatPciBusNumber(pVideo->bus, busnum);
- sprintf(NewDevice.GDev.busID, "PCI:%s:%d:%d",
- busnum, pVideo->device, pVideo->func);
-
- NewDevice.GDev.chipID = pVideo->chipType;
- NewDevice.GDev.chipRev = pVideo->chipRev;
-
- if (chipset < 0)
- chipset = (pVideo->vendor << 16) | pVideo->chipType;
- }
- break;
- case BUS_ISA:
- NewDevice.GDev.identifier = "ISA Adapter";
- NewDevice.GDev.busID = "ISA";
- break;
-#if defined(__sparc__) && !defined(__OpenBSD__)
- case BUS_SBUS: {
- char *promPath = NULL;
- NewDevice.sVideo = (sbusDevicePtr) busData;
- NewDevice.GDev.identifier = NewDevice.sVideo->descr;
- if (sparcPromInit() >= 0) {
- promPath = sparcPromNode2Pathname(&NewDevice.sVideo->node);
- sparcPromClose();
- }
- if (promPath) {
- NewDevice.GDev.busID = xnfalloc(strlen(promPath) + 6);
- sprintf(NewDevice.GDev.busID, "SBUS:%s", promPath);
- xfree(promPath);
- } else {
- NewDevice.GDev.busID = xnfalloc(12);
- sprintf(NewDevice.GDev.busID, "SBUS:fb%d", NewDevice.sVideo->fbNum);
- }
- }
- break;
-#endif
- default:
- break;
- }
-
- /* Get driver's available options */
- if (xf86DriverList[CurrentDriver]->AvailableOptions)
- NewDevice.GDev.options = (OptionInfoPtr)
- (*xf86DriverList[CurrentDriver]->AvailableOptions)(chipset,
- bus);
-
- return &NewDevice.GDev;
-
-# undef NewDevice
-}
-
-/*
- * Backwards compatibility
- */
-GDevPtr
-xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo, int chipset)
-{
- return xf86AddBusDeviceToConfigure(driver, pVideo ? BUS_PCI : BUS_ISA,
- pVideo, chipset);
-}
-
-static XF86ConfInputPtr
-configureInputSection (void)
-{
- XF86ConfInputPtr mouse = NULL;
- parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
-
- ptr->inp_identifier = "Keyboard0";
- ptr->inp_driver = "keyboard";
- ptr->list.next = NULL;
-
- /* Crude mechanism to auto-detect mouse (os dependent) */
- {
- int fd;
-#if 0 && defined linux
- /* Our autodetection code can do a better job */
- int len;
- char path[32];
-
- if ((len = readlink(DFLT_MOUSE_DEV, path, sizeof(path) - 1)) > 0) {
- path[len] = '\0';
- if (strstr(path, "psaux") != NULL)
- DFLT_MOUSE_PROTO = "PS/2";
- }
-#endif
-#ifdef WSCONS_SUPPORT
- fd = open("/dev/wsmouse", 0);
- if (fd > 0) {
- DFLT_MOUSE_DEV = "/dev/wsmouse";
- DFLT_MOUSE_PROTO = "wsmouse";
- close(fd);
- } else {
- ErrorF("cannot open /dev/wsmouse\n");
- }
-#endif
-
-#ifndef SCO
- fd = open(DFLT_MOUSE_DEV, 0);
- if (fd != -1) {
- foundMouse = TRUE;
- close(fd);
- }
-#else
- foundMouse = TRUE;
-#endif
- }
-
- mouse = xf86confmalloc(sizeof(XF86ConfInputRec));
- memset((XF86ConfInputPtr)mouse,0,sizeof(XF86ConfInputRec));
- mouse->inp_identifier = "Mouse0";
- mouse->inp_driver = "mouse";
- mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO);
-#ifndef SCO
- mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV);
-#endif
- ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
- return ptr;
-}
-
-static XF86ConfDRIPtr
-configureDRISection (void)
-{
-#ifdef NOTYET
- parsePrologue (XF86ConfDRIPtr, XF86ConfDRIRec)
-
- return ptr;
-#else
- return NULL;
-#endif
-}
-
-static XF86ConfVendorPtr
-configureVendorSection (void)
-{
- parsePrologue (XF86ConfVendorPtr, XF86ConfVendorRec)
-
- return NULL;
-#if 0
- return ptr;
-#endif
-}
-
-static XF86ConfScreenPtr
-configureScreenSection (int screennum)
-{
- int i;
- int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ };
- parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
-
- ptr->scrn_identifier = xf86confmalloc(18);
- sprintf(ptr->scrn_identifier, "Screen%d", screennum);
- ptr->scrn_monitor_str = xf86confmalloc(19);
- sprintf(ptr->scrn_monitor_str, "Monitor%d", screennum);
- ptr->scrn_device_str = xf86confmalloc(16);
- sprintf(ptr->scrn_device_str, "Card%d", screennum);
-
- for (i=0; i<sizeof(depths)/sizeof(depths[0]); i++)
- {
- XF86ConfDisplayPtr display;
-
- display = xf86confmalloc(sizeof(XF86ConfDisplayRec));
- memset((XF86ConfDisplayPtr)display,0,sizeof(XF86ConfDisplayRec));
- display->disp_depth = depths[i];
- display->disp_black.red = display->disp_white.red = -1;
- display->disp_black.green = display->disp_white.green = -1;
- display->disp_black.blue = display->disp_white.blue = -1;
- ptr->scrn_display_lst = (XF86ConfDisplayPtr)xf86addListItem(
- (glp)ptr->scrn_display_lst, (glp)display);
- }
-
- return ptr;
-}
-
-static const char*
-optionTypeToSting(OptionValueType type)
-{
- switch (type) {
- case OPTV_NONE:
- return "";
- case OPTV_INTEGER:
- return "<i>";
- case OPTV_STRING:
- return "<str>";
- case OPTV_ANYSTR:
- return "[<str>]";
- case OPTV_REAL:
- return "<f>";
- case OPTV_BOOLEAN:
- return "[<bool>]";
- case OPTV_FREQ:
- return "<freq>";
- default:
- return "";
- }
-}
-
-static XF86ConfDevicePtr
-configureDeviceSection (int screennum)
-{
- char identifier[16];
- OptionInfoPtr p;
- int i = 0;
-#ifdef DO_FBDEV_PROBE
- Bool foundFBDEV = FALSE;
-#endif
- parsePrologue (XF86ConfDevicePtr, XF86ConfDeviceRec)
-
- /* Move device info to parser structure */
- sprintf(identifier, "Card%d", screennum);
- ptr->dev_identifier = strdup(identifier);
-/* ptr->dev_identifier = DevToConfig[screennum].GDev.identifier;*/
- ptr->dev_vendor = DevToConfig[screennum].GDev.vendor;
- ptr->dev_board = DevToConfig[screennum].GDev.board;
- ptr->dev_chipset = DevToConfig[screennum].GDev.chipset;
- ptr->dev_busid = DevToConfig[screennum].GDev.busID;
- ptr->dev_driver = DevToConfig[screennum].GDev.driver;
- ptr->dev_ramdac = DevToConfig[screennum].GDev.ramdac;
- for (i = 0; (i < MAXDACSPEEDS) && (i < CONF_MAXDACSPEEDS); i++)
- ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i];
- ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam;
- ptr->dev_textclockfreq = DevToConfig[screennum].GDev.textClockFreq;
- ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase;
- ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase;
- ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase;
- ptr->dev_clockchip = DevToConfig[screennum].GDev.clockchip;
- for (i = 0; (i < MAXCLOCKS) && (i < DevToConfig[screennum].GDev.numclocks); i++)
- ptr->dev_clock[i] = DevToConfig[screennum].GDev.clock[i];
- ptr->dev_clocks = i;
- ptr->dev_chipid = DevToConfig[screennum].GDev.chipID;
- ptr->dev_chiprev = DevToConfig[screennum].GDev.chipRev;
- ptr->dev_irq = DevToConfig[screennum].GDev.irq;
-
- /* Make sure older drivers don't segv */
- if (DevToConfig[screennum].GDev.options) {
- /* Fill in the available driver options for people to use */
- const char *descrip =
- " ### Available Driver options are:-\n"
- " ### Values: <i>: integer, <f>: float, "
- "<bool>: \"True\"/\"False\",\n"
- " ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\"\n"
- " ### [arg]: arg optional\n";
- ptr->dev_comment = xstrdup(descrip);
- if (ptr->dev_comment) {
- for (p = DevToConfig[screennum].GDev.options;
- p->name != NULL; p++) {
- char *p_e;
- const char *prefix = " #Option ";
- const char *middle = " \t# ";
- const char *suffix = "\n";
- const char *opttype = optionTypeToSting(p->type);
- char *optname;
- int len = strlen(ptr->dev_comment) + strlen(prefix) +
- strlen(middle) + strlen(suffix) + 1;
-
- optname = xalloc(strlen(p->name) + 2 + 1);
- if (!optname)
- break;
- sprintf(optname, "\"%s\"", p->name);
-
- len += max(20, strlen(optname));
- len += strlen(opttype);
-
- ptr->dev_comment = xrealloc(ptr->dev_comment, len);
- if (!ptr->dev_comment)
- break;
- p_e = ptr->dev_comment + strlen(ptr->dev_comment);
- sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle,
- opttype, suffix);
- xfree(optname);
- }
- }
- }
-
-#ifdef DO_FBDEV_PROBE
- /* Crude mechanism to auto-detect fbdev (os dependent) */
- /* Skip it for now. Options list it anyway, and we can't
- * determine which screen/driver this belongs too anyway. */
- {
- int fd;
-
- fd = open("/dev/fb0", 0);
- if (fd != -1) {
- foundFBDEV = TRUE;
- close(fd);
- }
- }
-
- if (foundFBDEV) {
- XF86OptionPtr fbdev;
-
- fbdev = xf86confmalloc(sizeof(XF86OptionRec));
- memset((XF86OptionPtr)fbdev,0,sizeof(XF86OptionRec));
- fbdev->opt_name = "UseFBDev";
- fbdev->opt_val = "ON";
- ptr->dev_option_lst = (XF86OptionPtr)xf86addListItem(
- (glp)ptr->dev_option_lst, (glp)fbdev);
- }
-#endif
-
- return ptr;
-}
-
-static XF86ConfLayoutPtr
-configureLayoutSection (void)
-{
- int scrnum = 0;
- parsePrologue (XF86ConfLayoutPtr, XF86ConfLayoutRec)
-
- ptr->lay_identifier = "XFree86 Configured";
-
- {
- XF86ConfInputrefPtr iptr;
-
- iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
- iptr->list.next = NULL;
- iptr->iref_option_lst = NULL;
- iptr->iref_inputdev_str = "Mouse0";
- iptr->iref_option_lst =
- xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL);
- ptr->lay_input_lst = (XF86ConfInputrefPtr)
- xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
- }
-
- {
- XF86ConfInputrefPtr iptr;
-
- iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
- iptr->list.next = NULL;
- iptr->iref_option_lst = NULL;
- iptr->iref_inputdev_str = "Keyboard0";
- iptr->iref_option_lst =
- xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL);
- ptr->lay_input_lst = (XF86ConfInputrefPtr)
- xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
- }
-
- for (scrnum = 0; scrnum < nDevToConfig; scrnum++) {
- XF86ConfAdjacencyPtr aptr;
-
- aptr = xf86confmalloc (sizeof (XF86ConfAdjacencyRec));
- aptr->list.next = NULL;
- aptr->adj_x = 0;
- aptr->adj_y = 0;
- aptr->adj_scrnum = scrnum;
- aptr->adj_screen_str = xnfalloc(18);
- sprintf(aptr->adj_screen_str, "Screen%d", scrnum);
- if (scrnum == 0) {
- aptr->adj_where = CONF_ADJ_ABSOLUTE;
- aptr->adj_refscreen = NULL;
- }
- else {
- aptr->adj_where = CONF_ADJ_RIGHTOF;
- aptr->adj_refscreen = xnfalloc(18);
- sprintf(aptr->adj_refscreen, "Screen%d", scrnum - 1);
- }
- ptr->lay_adjacency_lst =
- (XF86ConfAdjacencyPtr)xf86addListItem((glp)ptr->lay_adjacency_lst,
- (glp)aptr);
- }
-
- return ptr;
-}
-
-static XF86ConfModesPtr
-configureModesSection (void)
-{
-#ifdef NOTYET
- parsePrologue (XF86ConfModesPtr, XF86ConfModesRec)
-
- return ptr;
-#else
- return NULL;
-#endif
-}
-
-static XF86ConfVideoAdaptorPtr
-configureVideoAdaptorSection (void)
-{
- parsePrologue (XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec)
-
- return NULL;
-#if 0
- return ptr;
-#endif
-}
-
-static XF86ConfFlagsPtr
-configureFlagsSection (void)
-{
- parsePrologue (XF86ConfFlagsPtr, XF86ConfFlagsRec)
-
- return ptr;
-}
-
-static XF86ConfModulePtr
-configureModuleSection (void)
-{
-#ifdef XFree86LOADER
- char **elist, **el;
- /* Find the list of extension modules. */
- const char *esubdirs[] = {
- "extensions",
- NULL
- };
- const char *fsubdirs[] = {
- "fonts",
- NULL
- };
-#endif
- parsePrologue (XF86ConfModulePtr, XF86ConfModuleRec)
-
-#ifdef XFree86LOADER
- elist = LoaderListDirs(esubdirs, NULL);
- if (elist) {
- for (el = elist; *el; el++) {
- XF86LoadPtr module;
-
- module = xf86confmalloc(sizeof(XF86LoadRec));
- memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec));
- module->load_name = *el;
- /* HACK, remove GLcore, glx, loads it as a submodule */
- if (strcmp(*el, "GLcore"))
- ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
- (glp)ptr->mod_load_lst, (glp)module);
- }
- xfree(elist);
- }
-
- /* Process list of font backends separately to include only required ones */
- elist = LoaderListDirs(fsubdirs, NULL);
- if (elist) {
- for (el = elist; *el; el++) {
- XF86LoadPtr module;
-
- module = xf86confmalloc(sizeof(XF86LoadRec));
- memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec));
- module->load_name = *el;
-
- /* Add only those font backends which are referenced by fontpath */
- /* 'strstr(dFP,"/dir")' is meant as 'dFP =~ m(/dir\W)' */
- if (defaultFontPath && (
- (strcmp(*el, "xtt") == 0 &&
- strstr(defaultFontPath, "/TrueType")) ||
- (strcmp(*el, "type1") == 0 &&
- strstr(defaultFontPath, "/Type1")) ||
- (strcmp(*el, "speedo") == 0 &&
- strstr(defaultFontPath, "/Speedo"))))
- ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
- (glp)ptr->mod_load_lst, (glp)module);
- }
- xfree(elist);
- }
-#endif
-
- return ptr;
-}
-
-static XF86ConfFilesPtr
-configureFilesSection (void)
-{
- parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec)
-
-#ifdef XFree86LOADER
- if (xf86ModulePath)
- ptr->file_modulepath = strdup(xf86ModulePath);
-#endif
- if (defaultFontPath)
- ptr->file_fontpath = strdup(defaultFontPath);
- if (rgbPath)
- ptr->file_rgbpath = strdup(rgbPath);
-
- return ptr;
-}
-
-static XF86ConfMonitorPtr
-configureMonitorSection (int screennum)
-{
- parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
- ptr->mon_identifier = xf86confmalloc(19);
- sprintf(ptr->mon_identifier, "Monitor%d", screennum);
- ptr->mon_vendor = strdup("Monitor Vendor");
- ptr->mon_modelname = strdup("Monitor Model");
-
- return ptr;
-}
-
-static XF86ConfMonitorPtr
-configureDDCMonitorSection (int screennum)
-{
- int i = 0;
- int len, mon_width, mon_height;
-#define displaySizeMaxLen 80
- char displaySize_string[displaySizeMaxLen];
- int displaySizeLen;
-
- parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
- ptr->mon_identifier = xf86confmalloc(19);
- sprintf(ptr->mon_identifier, "Monitor%d", screennum);
- ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
- ptr->mon_modelname = xf86confmalloc(12);
- sprintf(ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
-
- /* features in centimetres, we want millimetres */
- mon_width = 10 * ConfiguredMonitor->features.hsize ;
- mon_height = 10 * ConfiguredMonitor->features.vsize ;
-
-#ifdef CONFIGURE_DISPLAYSIZE
- ptr->mon_width = mon_width;
- ptr->mon_height = mon_height;
-#else
- if (mon_width && mon_height) {
- /* when values available add DisplaySize option AS A COMMENT */
-
- displaySizeLen = snprintf(displaySize_string, displaySizeMaxLen,
- "\t#DisplaySize\t%5d %5d\t# mm\n",
- mon_width, mon_height);
-
- if (displaySizeLen>0 && displaySizeLen<displaySizeMaxLen) {
- if (ptr->mon_comment) {
- len = strlen(ptr->mon_comment);
- } else {
- len = 0;
- }
- if ((ptr->mon_comment =
- xf86confrealloc(ptr->mon_comment,
- len+strlen(displaySize_string)))) {
- strcpy(ptr->mon_comment + len, displaySize_string);
- }
- }
- }
-#endif /* def CONFIGURE_DISPLAYSIZE */
-
- for (i=0;i<4;i++) {
- switch (ConfiguredMonitor->det_mon[i].type) {
- case DT:
- case DS_STD_TIMINGS:
- case DS_WHITE_P:
- break;
- case DS_NAME:
- ptr->mon_modelname = xf86confrealloc(ptr->mon_modelname,
- strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
- + 1);
- strcpy(ptr->mon_modelname,
- (char*)(ConfiguredMonitor->det_mon[i].section.name));
- break;
- case DS_ASCII_STR:
- case DS_SERIAL:
- case DS_RANGES:
- default:
- break;
- }
- }
-
- if (ConfiguredMonitor->features.dpms) {
- ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, "DPMS", NULL);
- }
-
- return ptr;
-}
-
-void
-DoConfigure()
-{
- int i,j, screennum = -1;
- char *home = NULL;
- char *filename = NULL;
- XF86ConfigPtr xf86config = NULL;
- char **vlist, **vl;
- int *dev2screen;
-
- vlist = xf86DriverlistFromCompile();
-
- if (!vlist) {
- ErrorF("Missing output drivers. Configuration failed.\n");
- goto bail;
- }
-
- ErrorF("List of video drivers:\n");
- for (vl = vlist; *vl; vl++)
- ErrorF("\t%s\n", *vl);
-
-#ifdef XFree86LOADER
- /* Load all the drivers that were found. */
- xf86LoadModules(vlist, NULL);
-#endif /* XFree86LOADER */
-
- xfree(vlist);
-
- /* Disable PCI devices */
- xf86ResourceBrokerInit();
- xf86AccessInit();
- xf86FindPrimaryDevice();
-
- /* Create XF86Config file structure */
- xf86config = malloc(sizeof(XF86ConfigRec));
- memset ((XF86ConfigPtr)xf86config, 0, sizeof(XF86ConfigRec));
- xf86config->conf_device_lst = NULL;
- xf86config->conf_screen_lst = NULL;
- xf86config->conf_monitor_lst = NULL;
-
- /* Call all of the probe functions, reporting the results. */
- for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) {
-
- if (xf86DriverList[CurrentDriver]->Probe == NULL) continue;
-
- if ((*xf86DriverList[CurrentDriver]->Probe)(
- xf86DriverList[CurrentDriver], PROBE_DETECT) &&
- xf86DriverList[CurrentDriver]->Identify)
- (*xf86DriverList[CurrentDriver]->Identify)(0);
- }
-
- if (nDevToConfig <= 0) {
- ErrorF("No devices to configure. Configuration failed.\n");
- goto bail;
- }
-
- /* Add device, monitor and screen sections for detected devices */
- for (screennum = 0; screennum < nDevToConfig; screennum++) {
- XF86ConfDevicePtr DevicePtr;
- XF86ConfMonitorPtr MonitorPtr;
- XF86ConfScreenPtr ScreenPtr;
-
- DevicePtr = configureDeviceSection(screennum);
- xf86config->conf_device_lst = (XF86ConfDevicePtr)xf86addListItem(
- (glp)xf86config->conf_device_lst, (glp)DevicePtr);
- MonitorPtr = configureMonitorSection(screennum);
- xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
- (glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
- ScreenPtr = configureScreenSection(screennum);
- xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
- (glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
- }
-
- xf86config->conf_files = configureFilesSection();
- xf86config->conf_modules = configureModuleSection();
- xf86config->conf_flags = configureFlagsSection();
- xf86config->conf_videoadaptor_lst = configureVideoAdaptorSection();
- xf86config->conf_modes_lst = configureModesSection();
- xf86config->conf_vendor_lst = configureVendorSection();
- xf86config->conf_dri = configureDRISection();
- xf86config->conf_input_lst = configureInputSection();
- xf86config->conf_layout_lst = configureLayoutSection();
-
- if (!(home = getenv("HOME")))
- home = "/";
- {
-#ifdef __UNIXOS2__
-#define PATH_MAX 2048
-#endif
-#if defined(SCO) || defined(SCO325)
-#define PATH_MAX 1024
-#endif
- const char* configfile = XF86CONFIGFILE".new";
- char homebuf[PATH_MAX];
- /* getenv might return R/O memory, as with OS/2 */
- strncpy(homebuf,home,PATH_MAX-1);
- homebuf[PATH_MAX-1] = '\0';
- home = homebuf;
- if (!(filename =
- (char *)ALLOCATE_LOCAL(strlen(home) +
- strlen(configfile) + 3)))
-
- if (home[0] == '/' && home[1] == '\0')
- home[0] = '\0';
-#ifndef QNX4
- sprintf(filename, "%s/%s", home,configfile);
-#else
- sprintf(filename, "//%d%s/%s", getnid(),home,configfile);
-#endif
-
- }
-
- xf86writeConfigFile(filename, xf86config);
-
- xf86DoConfigurePass1 = FALSE;
- /* Try to get DDC information filled in */
- xf86ConfigFile = filename;
- if (xf86HandleConfigFile(FALSE) != CONFIG_OK) {
- goto bail;
- }
-
- xf86DoConfigurePass1 = FALSE;
-
- dev2screen = xnfcalloc(1,xf86NumDrivers*sizeof(int));
-
- {
- Bool *driverProbed = xnfcalloc(1,xf86NumDrivers*sizeof(Bool));
- for (screennum = 0; screennum < nDevToConfig; screennum++) {
- int k,l,n,oldNumScreens;
-
- i = DevToConfig[screennum].iDriver;
-
- if (driverProbed[i]) continue;
- driverProbed[i] = TRUE;
-
- oldNumScreens = xf86NumScreens;
-
- (*xf86DriverList[i]->Probe)(xf86DriverList[i], 0);
-
- /* reorder */
- k = screennum > 0 ? screennum : 1;
- for (l = oldNumScreens; l < xf86NumScreens; l++) {
- /* is screen primary? */
- Bool primary = FALSE;
- for (n = 0; n<xf86Screens[l]->numEntities; n++) {
- if (xf86IsEntityPrimary(xf86Screens[l]->entityList[n])) {
- dev2screen[0] = l;
- primary = TRUE;
- break;
- }
- }
- if (primary) continue;
- /* not primary: assign it to next device of same driver */
- /*
- * NOTE: we assume that devices in DevToConfig
- * and xf86Screens[] have the same order except
- * for the primary device which always comes first.
- */
- for (; k < nDevToConfig; k++) {
- if (DevToConfig[k].iDriver == i) {
- dev2screen[k++] = l;
- break;
- }
- }
- }
- xf86SetPciVideo(NULL,NONE);
- }
- xfree(driverProbed);
- }
-
-
- if (nDevToConfig != xf86NumScreens) {
- ErrorF("Number of created screens does not match number of detected"
- " devices.\n Configuration failed.\n");
- goto bail;
- }
-
- xf86PostProbe();
- xf86EntityInit();
-
- for (j = 0; j < xf86NumScreens; j++) {
- xf86Screens[j]->scrnIndex = j;
- }
-
- xf86freeMonitorList(xf86config->conf_monitor_lst);
- xf86config->conf_monitor_lst = NULL;
- xf86freeScreenList(xf86config->conf_screen_lst);
- xf86config->conf_screen_lst = NULL;
- for (j = 0; j < xf86NumScreens; j++) {
- XF86ConfMonitorPtr MonitorPtr;
- XF86ConfScreenPtr ScreenPtr;
-
- ConfiguredMonitor = NULL;
-
- xf86EnableAccess(xf86Screens[dev2screen[j]]);
- if ((*xf86Screens[dev2screen[j]]->PreInit)(xf86Screens[dev2screen[j]],
- PROBE_DETECT) &&
- ConfiguredMonitor) {
- MonitorPtr = configureDDCMonitorSection(j);
- } else {
- MonitorPtr = configureMonitorSection(j);
- }
- ScreenPtr = configureScreenSection(j);
- xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
- (glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
- xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
- (glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
- }
-
- xf86writeConfigFile(filename, xf86config);
-
- ErrorF("\n");
-
-#ifdef SCO
- ErrorF("\nXFree86 is using the kernel event driver to access the mouse.\n"
- "If you wish to use the internal XFree86 mouse drivers, please\n"
- "edit the file and correct the Device.\n");
-#else /* !SCO */
- if (!foundMouse) {
- ErrorF("\nXFree86 is not able to detect your mouse.\n"
- "Edit the file and correct the Device.\n");
- } else {
-#ifndef __UNIXOS2__ /* OS/2 definitely has a mouse */
- ErrorF("\nXFree86 detected your mouse at device %s.\n"
- "Please check your config if the mouse is still not\n"
- "operational, as by default XFree86 tries to autodetect\n"
- "the protocol.\n",DFLT_MOUSE_DEV);
-#endif
- }
-#endif /* !SCO */
-
- if (xf86NumScreens > 1) {
- ErrorF("\nXFree86 has configured a multihead system, please check your config.\n");
- }
-
- ErrorF("\nYour XF86Config file is %s\n\n", filename);
- ErrorF("To test the server, run 'XFree86 -xf86config %s'\n\n", filename);
-
-bail:
- OsCleanup(TRUE);
- AbortDDX();
- fflush(stderr);
- exit(0);
-}
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
deleted file mode 100644
index 22b7b00e6..000000000
--- a/hw/xfree86/common/xf86Cursor.c
+++ /dev/null
@@ -1,784 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.37 2003/11/07 22:20:17 dawes Exp $ */
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "cursor.h"
-#include "mipointer.h"
-#include "scrnintstr.h"
-#include "globals.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSproc.h"
-
-#ifdef XINPUT
-#include "XIproto.h"
-#include "xf86Xinput.h"
-#endif
-
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-typedef struct _xf86EdgeRec {
- short screen;
- short start;
- short end;
- DDXPointRec offset;
- struct _xf86EdgeRec *next;
-} xf86EdgeRec, *xf86EdgePtr;
-
-typedef struct {
- xf86EdgePtr left, right, up, down;
-} xf86ScreenLayoutRec, *xf86ScreenLayoutPtr;
-
-static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y);
-static void xf86CrossScreen(ScreenPtr pScreen, Bool entering);
-static void xf86WarpCursor(ScreenPtr pScreen, int x, int y);
-
-static void xf86PointerMoved(int scrnIndex, int x, int y);
-
-static miPointerScreenFuncRec xf86PointerScreenFuncs = {
- xf86CursorOffScreen,
- xf86CrossScreen,
- xf86WarpCursor,
-#ifdef XINPUT
- xf86eqEnqueue,
- xf86eqSwitchScreen
-#else
- /* let miPointerInitialize take care of these */
- NULL,
- NULL
-#endif
-};
-
-static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS];
-
-static Bool HardEdges;
-
-/*
- * xf86InitViewport --
- * Initialize paning & zooming parameters, so that a driver must only
- * check what resolutions are possible and whether the virtual area
- * is valid if specified.
- */
-
-void
-xf86InitViewport(ScrnInfoPtr pScr)
-{
-
- pScr->PointerMoved = xf86PointerMoved;
-
- /*
- * Compute the initial Viewport if necessary
- */
- if (pScr->display) {
- if (pScr->display->frameX0 < 0) {
- pScr->frameX0 = (pScr->virtualX - pScr->modes->HDisplay) / 2;
- pScr->frameY0 = (pScr->virtualY - pScr->modes->VDisplay) / 2;
- } else {
- pScr->frameX0 = pScr->display->frameX0;
- pScr->frameY0 = pScr->display->frameY0;
- }
- }
-
- pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1;
- pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1;
-
- /*
- * Now adjust the initial Viewport, so it lies within the virtual area
- */
- if (pScr->frameX1 >= pScr->virtualX)
- {
- pScr->frameX0 = pScr->virtualX - pScr->modes->HDisplay;
- pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1;
- }
-
- if (pScr->frameY1 >= pScr->virtualY)
- {
- pScr->frameY0 = pScr->virtualY - pScr->modes->VDisplay;
- pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1;
- }
-}
-
-
-/*
- * xf86SetViewport --
- * Scroll the visual part of the screen so the pointer is visible.
- */
-
-void
-xf86SetViewport(ScreenPtr pScreen, int x, int y)
-{
- ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
-
- (*pScr->PointerMoved)(pScreen->myNum, x, y);
-}
-
-
-static void
-xf86PointerMoved(int scrnIndex, int x, int y)
-{
- Bool frameChanged = FALSE;
- ScrnInfoPtr pScr = xf86Screens[scrnIndex];
-
- /*
- * check wether (x,y) belongs to the visual part of the screen
- * if not, change the base of the displayed frame accoring
- */
- if ( pScr->frameX0 > x) {
- pScr->frameX0 = x;
- pScr->frameX1 = x + pScr->currentMode->HDisplay - 1;
- frameChanged = TRUE ;
- }
-
- if ( pScr->frameX1 < x) {
- pScr->frameX1 = x + 1;
- pScr->frameX0 = x - pScr->currentMode->HDisplay + 1;
- frameChanged = TRUE ;
- }
-
- if ( pScr->frameY0 > y) {
- pScr->frameY0 = y;
- pScr->frameY1 = y + pScr->currentMode->VDisplay - 1;
- frameChanged = TRUE;
- }
-
- if ( pScr->frameY1 < y) {
- pScr->frameY1 = y;
- pScr->frameY0 = y - pScr->currentMode->VDisplay + 1;
- frameChanged = TRUE;
- }
-
- if (frameChanged && pScr->AdjustFrame != NULL)
- pScr->AdjustFrame(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
-}
-
-/*
- * xf86LockZoom --
- * Enable/disable ZoomViewport
- */
-
-void
-xf86LockZoom(ScreenPtr pScreen, Bool lock)
-{
- XF86SCRNINFO(pScreen)->zoomLocked = lock;
-}
-
-/*
- * xf86SwitchMode --
- * This is called by both keyboard processing and the VidMode extension to
- * set a new mode.
- */
-
-Bool
-xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
-{
- ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
- ScreenPtr pCursorScreen;
- Bool Switched;
- int px, py;
-
- if (!pScr->vtSema || !mode || !pScr->SwitchMode)
- return FALSE;
-
-#ifdef XFreeXDGA
- if (DGAActive(pScr->scrnIndex))
- return FALSE;
-#endif
-
- if (mode == pScr->currentMode)
- return TRUE;
-
- if (mode->HDisplay > pScreen->width || mode->VDisplay > pScreen->height)
- return FALSE;
-
- pCursorScreen = miPointerCurrentScreen();
- if (pScreen == pCursorScreen)
- miPointerPosition(&px, &py);
-
- xf86EnterServerState(SETUP);
- Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0);
- xf86EnterServerState(OPERATING);
- if (Switched) {
- pScr->currentMode = mode;
-
- /*
- * Adjust frame for new display size.
- */
- if (pScreen == pCursorScreen)
- pScr->frameX0 = px - (mode->HDisplay / 2) + 1;
- else
- pScr->frameX0 = (pScr->frameX0 + pScr->frameX1 + 1 - mode->HDisplay) / 2;
-
- if (pScr->frameX0 < 0)
- pScr->frameX0 = 0;
-
- pScr->frameX1 = pScr->frameX0 + mode->HDisplay - 1;
- if (pScr->frameX1 >= pScr->virtualX) {
- pScr->frameX0 = pScr->virtualX - mode->HDisplay;
- pScr->frameX1 = pScr->virtualX - 1;
- }
-
- if (pScreen == pCursorScreen)
- pScr->frameY0 = py - (mode->VDisplay / 2) + 1;
- else
- pScr->frameY0 = (pScr->frameY0 + pScr->frameY1 + 1 - mode->VDisplay) / 2;
-
- if (pScr->frameY0 < 0)
- pScr->frameY0 = 0;
-
- pScr->frameY1 = pScr->frameY0 + mode->VDisplay - 1;
- if (pScr->frameY1 >= pScr->virtualY) {
- pScr->frameY0 = pScr->virtualY - mode->VDisplay;
- pScr->frameY1 = pScr->virtualY - 1;
- }
- }
-
- if (pScr->AdjustFrame)
- (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
-
- if (pScreen == pCursorScreen)
- xf86WarpCursor(pScreen, px, py);
-
- return Switched;
-}
-
-/*
- * xf86ZoomViewport --
- * Reinitialize the visual part of the screen for another mode.
- */
-
-void
-xf86ZoomViewport(ScreenPtr pScreen, int zoom)
-{
- ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
- DisplayModePtr mode;
-
- if (pScr->zoomLocked || !(mode = pScr->currentMode))
- return;
-
- do {
- if (zoom > 0)
- mode = mode->next;
- else
- mode = mode->prev;
- } while (mode != pScr->currentMode && !(mode->type & M_T_USERDEF));
-
- (void)xf86SwitchMode(pScreen, mode);
-}
-
-
-static xf86EdgePtr
-FindEdge(xf86EdgePtr edge, int val)
-{
- while(edge && (edge->end <= val))
- edge = edge->next;
-
- if(edge && (edge->start <= val))
- return edge;
-
- return NULL;
-}
-
-/*
- * xf86CursorOffScreen --
- * Check whether it is necessary to switch to another screen
- */
-
-static Bool
-xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{
- xf86EdgePtr edge;
- int tmp;
-
- if(screenInfo.numScreens == 1)
- return FALSE;
-
- if(*x < 0) {
- tmp = *y;
- if(tmp < 0) tmp = 0;
- if(tmp >= (*pScreen)->height) tmp = (*pScreen)->height - 1;
-
- if((edge = xf86ScreenLayout[(*pScreen)->myNum].left))
- edge = FindEdge(edge, tmp);
-
- if(!edge) *x = 0;
- else {
- *x += edge->offset.x;
- *y += edge->offset.y;
- *pScreen = xf86Screens[edge->screen]->pScreen;
- }
- }
-
- if(*x >= (*pScreen)->width) {
- tmp = *y;
- if(tmp < 0) tmp = 0;
- if(tmp >= (*pScreen)->height) tmp = (*pScreen)->height - 1;
-
- if((edge = xf86ScreenLayout[(*pScreen)->myNum].right))
- edge = FindEdge(edge, tmp);
-
- if(!edge) *x = (*pScreen)->width - 1;
- else {
- *x += edge->offset.x;
- *y += edge->offset.y;
- *pScreen = xf86Screens[edge->screen]->pScreen;
- }
- }
-
- if(*y < 0) {
- tmp = *x;
- if(tmp < 0) tmp = 0;
- if(tmp >= (*pScreen)->width) tmp = (*pScreen)->width - 1;
-
- if((edge = xf86ScreenLayout[(*pScreen)->myNum].up))
- edge = FindEdge(edge, tmp);
-
- if(!edge) *y = 0;
- else {
- *x += edge->offset.x;
- *y += edge->offset.y;
- *pScreen = xf86Screens[edge->screen]->pScreen;
- }
- }
-
- if(*y >= (*pScreen)->height) {
- tmp = *x;
- if(tmp < 0) tmp = 0;
- if(tmp >= (*pScreen)->width) tmp = (*pScreen)->width - 1;
-
- if((edge = xf86ScreenLayout[(*pScreen)->myNum].down))
- edge = FindEdge(edge, tmp);
-
- if(!edge) *y = (*pScreen)->height - 1;
- else {
- *x += edge->offset.x;
- *y += edge->offset.y;
- (*pScreen) = xf86Screens[edge->screen]->pScreen;
- }
- }
-
-
-#if 0
- /* This presents problems for overlapping screens when
- HardEdges is used. Have to think about the logic more */
- if((*x < 0) || (*x >= (*pScreen)->width) ||
- (*y < 0) || (*y >= (*pScreen)->height)) {
- /* We may have crossed more than one screen */
- xf86CursorOffScreen(pScreen, x, y);
- }
-#endif
-
- return TRUE;
-}
-
-
-
-/*
- * xf86CrossScreen --
- * Switch to another screen
- */
-
-/* NEED TO CHECK THIS */
-/* ARGSUSED */
-static void
-xf86CrossScreen (ScreenPtr pScreen, Bool entering)
-{
-#if 0
- if (xf86Info.sharedMonitor)
- (XF86SCRNINFO(pScreen)->EnterLeaveMonitor)(entering);
- (XF86SCRNINFO(pScreen)->EnterLeaveCursor)(entering);
-#endif
-}
-
-
-/*
- * xf86WarpCursor --
- * Warp possible to another screen
- */
-
-/* ARGSUSED */
-static void
-xf86WarpCursor (ScreenPtr pScreen, int x, int y)
-{
- int sigstate;
- sigstate = xf86BlockSIGIO ();
- miPointerWarpCursor(pScreen,x,y);
-
- xf86Info.currentScreen = pScreen;
- xf86UnblockSIGIO (sigstate);
-}
-
-
-void *
-xf86GetPointerScreenFuncs(void)
-{
- return (void *)&xf86PointerScreenFuncs;
-}
-
-
-static xf86EdgePtr
-AddEdge(
- xf86EdgePtr edge,
- short min,
- short max,
- short dx,
- short dy,
- short screen
-){
- xf86EdgePtr pEdge = edge, pPrev = NULL, pNew;
-
- while(1) {
- while(pEdge && (min >= pEdge->end)) {
- pPrev = pEdge;
- pEdge = pEdge->next;
- }
-
- if(!pEdge) {
- if(!(pNew = xalloc(sizeof(xf86EdgeRec))))
- break;
-
- pNew->screen = screen;
- pNew->start = min;
- pNew->end = max;
- pNew->offset.x = dx;
- pNew->offset.y = dy;
- pNew->next = NULL;
-
- if(pPrev)
- pPrev->next = pNew;
- else
- edge = pNew;
-
- break;
- } else if (min < pEdge->start) {
- if(!(pNew = xalloc(sizeof(xf86EdgeRec))))
- break;
-
- pNew->screen = screen;
- pNew->start = min;
- pNew->offset.x = dx;
- pNew->offset.y = dy;
- pNew->next = pEdge;
-
- if(pPrev) pPrev->next = pNew;
- else edge = pNew;
-
- if(max <= pEdge->start) {
- pNew->end = max;
- break;
- } else {
- pNew->end = pEdge->start;
- min = pEdge->end;
- }
- } else
- min = pEdge->end;
-
- pPrev = pEdge;
- pEdge = pEdge->next;
-
- if(max <= min) break;
- }
-
- return edge;
-}
-
-static void
-FillOutEdge(xf86EdgePtr pEdge, int limit)
-{
- xf86EdgePtr pNext;
- int diff;
-
- if(pEdge->start > 0) pEdge->start = 0;
-
- while((pNext = pEdge->next)) {
- diff = pNext->start - pEdge->end;
- if(diff > 0) {
- pEdge->end += diff >> 1;
- pNext->start -= diff - (diff >> 1);
- }
- pEdge = pNext;
- }
-
- if(pEdge->end < limit)
- pEdge->end = limit;
-}
-
-/*
- * xf86InitOrigins() can deal with a maximum of 32 screens
- * on 32 bit architectures, 64 on 64 bit architectures.
- */
-
-void
-xf86InitOrigins(void)
-{
- unsigned long screensLeft, prevScreensLeft, mask;
- screenLayoutPtr screen;
- ScreenPtr pScreen;
- int x1, x2, y1, y2, left, right, top, bottom;
- int i, j, ref, minX, minY, min, max;
- xf86ScreenLayoutPtr pLayout;
- Bool OldStyleConfig = FALSE;
-
- /* need to have this set up with a config file option */
- HardEdges = FALSE;
-
- bzero(xf86ScreenLayout, MAXSCREENS * sizeof(xf86ScreenLayoutRec));
-
- screensLeft = prevScreensLeft = (1 << xf86NumScreens) - 1;
-
- while(1) {
- for(mask = screensLeft, i = 0; mask; mask >>= 1, i++) {
- if(!(mask & 1L)) continue;
-
- screen = &xf86ConfigLayout.screens[i];
-
- switch(screen->where) {
- case PosObsolete:
- OldStyleConfig = TRUE;
- pLayout = &xf86ScreenLayout[i];
- /* force edge lists */
- if(screen->left) {
- ref = screen->left->screennum;
- pLayout->left = AddEdge(pLayout->left,
- 0, xf86Screens[i]->pScreen->height,
- xf86Screens[ref]->pScreen->width, 0, ref);
- }
- if(screen->right) {
- ref = screen->right->screennum;
- pScreen = xf86Screens[i]->pScreen;
- pLayout->right = AddEdge(pLayout->right,
- 0, pScreen->height, -pScreen->width, 0, ref);
- }
- if(screen->top) {
- ref = screen->top->screennum;
- pLayout->up = AddEdge(pLayout->up,
- 0, xf86Screens[i]->pScreen->width,
- 0, xf86Screens[ref]->pScreen->height, ref);
- }
- if(screen->bottom) {
- ref = screen->bottom->screennum;
- pScreen = xf86Screens[i]->pScreen;
- pLayout->down = AddEdge(pLayout->down,
- 0, pScreen->width, 0, -pScreen->height, ref);
- }
- /* we could also try to place it based on those
- relative locations if we wanted to */
- screen->x = screen->y = 0;
- /* FALLTHROUGH */
- case PosAbsolute:
- dixScreenOrigins[i].x = screen->x;
- dixScreenOrigins[i].y = screen->y;
- screensLeft &= ~(1 << i);
- break;
- case PosRelative:
- ref = screen->refscreen->screennum;
- if(screensLeft & (1 << ref)) break;
- dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->x;
- dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->y;
- screensLeft &= ~(1 << i);
- break;
- case PosRightOf:
- ref = screen->refscreen->screennum;
- if(screensLeft & (1 << ref)) break;
- pScreen = xf86Screens[ref]->pScreen;
- dixScreenOrigins[i].x =
- dixScreenOrigins[ref].x + pScreen->width;
- dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
- screensLeft &= ~(1 << i);
- break;
- case PosLeftOf:
- ref = screen->refscreen->screennum;
- if(screensLeft & (1 << ref)) break;
- pScreen = xf86Screens[i]->pScreen;
- dixScreenOrigins[i].x =
- dixScreenOrigins[ref].x - pScreen->width;
- dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
- screensLeft &= ~(1 << i);
- break;
- case PosBelow:
- ref = screen->refscreen->screennum;
- if(screensLeft & (1 << ref)) break;
- pScreen = xf86Screens[ref]->pScreen;
- dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
- dixScreenOrigins[i].y =
- dixScreenOrigins[ref].y + pScreen->height;
- screensLeft &= ~(1 << i);
- break;
- case PosAbove:
- ref = screen->refscreen->screennum;
- if(screensLeft & (1 << ref)) break;
- pScreen = xf86Screens[i]->pScreen;
- dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
- dixScreenOrigins[i].y =
- dixScreenOrigins[ref].y - pScreen->height;
- screensLeft &= ~(1 << i);
- break;
- default:
- ErrorF("Illegal placement keyword in Layout!\n");
- break;
- }
-
- }
-
- if(!screensLeft) break;
-
- if(screensLeft == prevScreensLeft) {
- /* All the remaining screens are referencing each other.
- Assign a value to one of them and go through again */
- i = 0;
- while(!((1 << i) & screensLeft)){ i++; }
-
- ref = xf86ConfigLayout.screens[i].refscreen->screennum;
- dixScreenOrigins[ref].x = dixScreenOrigins[ref].y = 0;
- screensLeft &= ~(1 << ref);
- }
-
- prevScreensLeft = screensLeft;
- }
-
- /* justify the topmost and leftmost to (0,0) */
- minX = dixScreenOrigins[0].x;
- minY = dixScreenOrigins[0].y;
-
- for(i = 1; i < xf86NumScreens; i++) {
- if(dixScreenOrigins[i].x < minX)
- minX = dixScreenOrigins[i].x;
- if(dixScreenOrigins[i].y < minY)
- minY = dixScreenOrigins[i].y;
- }
-
- if (minX || minY) {
- for(i = 0; i < xf86NumScreens; i++) {
- dixScreenOrigins[i].x -= minX;
- dixScreenOrigins[i].y -= minY;
- }
- }
-
-
- /* Create the edge lists */
-
- if(!OldStyleConfig) {
- for(i = 0; i < xf86NumScreens; i++) {
- pLayout = &xf86ScreenLayout[i];
-
- pScreen = xf86Screens[i]->pScreen;
-
- left = dixScreenOrigins[i].x;
- right = left + pScreen->width;
- top = dixScreenOrigins[i].y;
- bottom = top + pScreen->height;
-
- for(j = 0; j < xf86NumScreens; j++) {
- if(i == j) continue;
-
- x1 = dixScreenOrigins[j].x;
- x2 = x1 + xf86Screens[j]->pScreen->width;
- y1 = dixScreenOrigins[j].y;
- y2 = y1 + xf86Screens[j]->pScreen->height;
-
- if((bottom > y1) && (top < y2)) {
- min = y1 - top;
- if(min < 0) min = 0;
- max = pScreen->height - (bottom - y2);
- if(max > pScreen->height) max = pScreen->height;
-
- if(((left - 1) >= x1) && ((left - 1) < x2))
- pLayout->left = AddEdge(pLayout->left, min, max,
- dixScreenOrigins[i].x - dixScreenOrigins[j].x,
- dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
-
- if((right >= x1) && (right < x2))
- pLayout->right = AddEdge(pLayout->right, min, max,
- dixScreenOrigins[i].x - dixScreenOrigins[j].x,
- dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
- }
-
-
- if((left < x2) && (right > x1)) {
- min = x1 - left;
- if(min < 0) min = 0;
- max = pScreen->width - (right - x2);
- if(max > pScreen->width) max = pScreen->width;
-
- if(((top - 1) >= y1) && ((top - 1) < y2))
- pLayout->up = AddEdge(pLayout->up, min, max,
- dixScreenOrigins[i].x - dixScreenOrigins[j].x,
- dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
-
- if((bottom >= y1) && (bottom < y2))
- pLayout->down = AddEdge(pLayout->down, min, max,
- dixScreenOrigins[i].x - dixScreenOrigins[j].x,
- dixScreenOrigins[i].y - dixScreenOrigins[j].y, j);
- }
- }
- }
- }
-
- if(!HardEdges && !OldStyleConfig) {
- for(i = 0; i < xf86NumScreens; i++) {
- pLayout = &xf86ScreenLayout[i];
- pScreen = xf86Screens[i]->pScreen;
- if(pLayout->left)
- FillOutEdge(pLayout->left, pScreen->height);
- if(pLayout->right)
- FillOutEdge(pLayout->right, pScreen->height);
- if(pLayout->up)
- FillOutEdge(pLayout->up, pScreen->width);
- if(pLayout->down)
- FillOutEdge(pLayout->down, pScreen->width);
- }
- }
-}
-
-void
-xf86ReconfigureLayout(void)
-{
- int i;
-
- for (i = 0; i < MAXSCREENS; i++) {
- xf86ScreenLayoutPtr sl = &xf86ScreenLayout[i];
- /* we don't have to zero these, xf86InitOrigins() takes care of that */
- if (sl->left) xfree(sl->left);
- if (sl->right) xfree(sl->right);
- if (sl->up) xfree(sl->up);
- if (sl->down) xfree(sl->down);
- }
-
- xf86InitOrigins();
-}
-
-
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
deleted file mode 100644
index 5e4bc29b6..000000000
--- a/hw/xfree86/common/xf86DGA.c
+++ /dev/null
@@ -1,1204 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.47 2003/08/24 17:36:51 dawes Exp $ */
-/*
- * Copyright (c) 1998-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- *
- * Written by Mark Vojkovich
- */
-
-#include "xf86.h"
-#include "xf86str.h"
-#include "xf86Priv.h"
-#include "dgaproc.h"
-#include "xf86dgastr.h"
-#include "colormapst.h"
-#include "pixmapstr.h"
-#include "inputstr.h"
-#include "globals.h"
-#include "servermd.h"
-#include "micmap.h"
-#ifdef XKB
-#include "XKBsrv.h"
-#endif
-#include "xf86Xinput.h"
-
-static unsigned long DGAGeneration = 0;
-static int DGAScreenIndex = -1;
-
-static Bool DGACloseScreen(int i, ScreenPtr pScreen);
-static void DGADestroyColormap(ColormapPtr pmap);
-static void DGAInstallColormap(ColormapPtr pmap);
-static void DGAUninstallColormap(ColormapPtr pmap);
-
-static void
-DGACopyModeInfo(
- DGAModePtr mode,
- XDGAModePtr xmode
-);
-
-#if defined(XFree86LOADER) || !defined(XFreeXDGA)
-int *XDGAEventBase = NULL;
-#else
-int *XDGAEventBase = &DGAEventBase;
-#endif
-
-#define DGA_GET_SCREEN_PRIV(pScreen) \
- ((DGAScreenPtr)((pScreen)->devPrivates[DGAScreenIndex].ptr))
-
-
-typedef struct _FakedVisualList{
- Bool free;
- VisualPtr pVisual;
- struct _FakedVisualList *next;
-} FakedVisualList;
-
-
-typedef struct {
- ScrnInfoPtr pScrn;
- int numModes;
- DGAModePtr modes;
- CloseScreenProcPtr CloseScreen;
- DestroyColormapProcPtr DestroyColormap;
- InstallColormapProcPtr InstallColormap;
- UninstallColormapProcPtr UninstallColormap;
- DGADevicePtr current;
- DGAFunctionPtr funcs;
- int input;
- ClientPtr client;
- int pixmapMode;
- FakedVisualList *fakedVisuals;
- ColormapPtr dgaColormap;
- ColormapPtr savedColormap;
- Bool grabMouse;
- Bool grabKeyboard;
-} DGAScreenRec, *DGAScreenPtr;
-
-
-Bool
-DGAInit(
- ScreenPtr pScreen,
- DGAFunctionPtr funcs,
- DGAModePtr modes,
- int num
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- DGAScreenPtr pScreenPriv;
- int i;
-
- if(!funcs || !funcs->SetMode || !funcs->OpenFramebuffer)
- return FALSE;
-
- if(!modes || num <= 0)
- return FALSE;
-
- if(DGAGeneration != serverGeneration) {
- if((DGAScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- DGAGeneration = serverGeneration;
- }
-
- if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
- return FALSE;
-
- pScreenPriv->pScrn = pScrn;
- pScreenPriv->numModes = num;
- pScreenPriv->modes = modes;
- pScreenPriv->current = NULL;
-
- pScreenPriv->funcs = funcs;
- pScreenPriv->input = 0;
- pScreenPriv->client = NULL;
- pScreenPriv->fakedVisuals = NULL;
- pScreenPriv->dgaColormap = NULL;
- pScreenPriv->savedColormap = NULL;
- pScreenPriv->grabMouse = FALSE;
- pScreenPriv->grabKeyboard = FALSE;
-
- for(i = 0; i < num; i++)
- modes[i].num = i + 1;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- for(i = 0; i < num; i++)
- modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
-#endif
-
-
- pScreen->devPrivates[DGAScreenIndex].ptr = (pointer)pScreenPriv;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = DGACloseScreen;
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
- pScreen->DestroyColormap = DGADestroyColormap;
- pScreenPriv->InstallColormap = pScreen->InstallColormap;
- pScreen->InstallColormap = DGAInstallColormap;
- pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
- pScreen->UninstallColormap = DGAUninstallColormap;
-
- /*
- * This is now set in InitOutput().
- *
- pScrn->SetDGAMode = xf86SetDGAMode;
- */
-
- return TRUE;
-}
-
-
-static void
-FreeMarkedVisuals(ScreenPtr pScreen)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
- FakedVisualList *prev, *curr, *tmp;
-
- if(!pScreenPriv->fakedVisuals)
- return;
-
- prev = NULL;
- curr = pScreenPriv->fakedVisuals;
-
- while(curr) {
- if(curr->free) {
- tmp = curr;
- curr = curr->next;
- if(prev)
- prev->next = curr;
- else
- pScreenPriv->fakedVisuals = curr;
- xfree(tmp->pVisual);
- xfree(tmp);
- } else {
- prev = curr;
- curr = curr->next;
- }
- }
-}
-
-
-static Bool
-DGACloseScreen(int i, ScreenPtr pScreen)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- FreeMarkedVisuals(pScreen);
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
- pScreen->InstallColormap = pScreenPriv->InstallColormap;
- pScreen->UninstallColormap = pScreenPriv->UninstallColormap;
-
- /* DGAShutdown() should have ensured that no DGA
- screen were active by here */
-
- xfree(pScreenPriv);
-
- return((*pScreen->CloseScreen)(i, pScreen));
-}
-
-
-static void
-DGADestroyColormap(ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
- VisualPtr pVisual = pmap->pVisual;
-
- if(pScreenPriv->fakedVisuals) {
- FakedVisualList *curr = pScreenPriv->fakedVisuals;
-
- while(curr) {
- if(curr->pVisual == pVisual) {
- /* We can't get rid of them yet since FreeColormap
- still needs the pVisual during the cleanup */
- curr->free = TRUE;
- break;
- }
- curr = curr->next;
- }
- }
-
- if(pScreenPriv->DestroyColormap) {
- pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
- (*pScreen->DestroyColormap)(pmap);
- pScreen->DestroyColormap = DGADestroyColormap;
- }
-}
-
-
-static void
-DGAInstallColormap(ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- if(pScreenPriv->current && pScreenPriv->dgaColormap) {
- if (pmap != pScreenPriv->dgaColormap) {
- pScreenPriv->savedColormap = pmap;
- pmap = pScreenPriv->dgaColormap;
- }
- }
-
- pScreen->InstallColormap = pScreenPriv->InstallColormap;
- (*pScreen->InstallColormap)(pmap);
- pScreen->InstallColormap = DGAInstallColormap;
-}
-
-static void
-DGAUninstallColormap(ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- if(pScreenPriv->current && pScreenPriv->dgaColormap) {
- if (pmap == pScreenPriv->dgaColormap) {
- pScreenPriv->dgaColormap = NULL;
- }
- }
-
- pScreen->UninstallColormap = pScreenPriv->UninstallColormap;
- (*pScreen->UninstallColormap)(pmap);
- pScreen->UninstallColormap = DGAUninstallColormap;
-}
-
-int
-xf86SetDGAMode(
- int index,
- int num,
- DGADevicePtr devRet
-){
- ScreenPtr pScreen = screenInfo.screens[index];
- DGAScreenPtr pScreenPriv;
- ScrnInfoPtr pScrn;
- DGADevicePtr device;
- PixmapPtr pPix = NULL;
- DGAModePtr pMode = NULL;
-
- /* First check if DGAInit was successful on this screen */
- if (DGAScreenIndex < 0)
- return BadValue;
- pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
- if (!pScreenPriv)
- return BadValue;
- pScrn = pScreenPriv->pScrn;
-
- if(!num) {
- if(pScreenPriv->current) {
- PixmapPtr oldPix = pScreenPriv->current->pPix;
- if(oldPix) {
- if(oldPix->drawable.id)
- FreeResource(oldPix->drawable.id, RT_NONE);
- else
- (*pScreen->DestroyPixmap)(oldPix);
- }
- xfree(pScreenPriv->current);
- pScreenPriv->current = NULL;
- pScrn->vtSema = TRUE;
- (*pScreenPriv->funcs->SetMode)(pScrn, NULL);
- if(pScreenPriv->savedColormap) {
- (*pScreen->InstallColormap)(pScreenPriv->savedColormap);
- pScreenPriv->savedColormap = NULL;
- }
- pScreenPriv->dgaColormap = NULL;
- (*pScrn->EnableDisableFBAccess)(index, TRUE);
-
- FreeMarkedVisuals(pScreen);
- }
-
- pScreenPriv->grabMouse = FALSE;
- pScreenPriv->grabKeyboard = FALSE;
-
- return Success;
- }
-
- if(!pScrn->vtSema && !pScreenPriv->current) /* Really switched away */
- return BadAlloc;
-
- if((num > 0) && (num <= pScreenPriv->numModes))
- pMode = &(pScreenPriv->modes[num - 1]);
- else
- return BadValue;
-
- if(!(device = (DGADevicePtr)xalloc(sizeof(DGADeviceRec))))
- return BadAlloc;
-
- if(!pScreenPriv->current) {
- Bool oldVTSema = pScrn->vtSema;
-
- pScrn->vtSema = FALSE; /* kludge until we rewrite VT switching */
- (*pScrn->EnableDisableFBAccess)(index, FALSE);
- pScrn->vtSema = oldVTSema;
- }
-
- if(!(*pScreenPriv->funcs->SetMode)(pScrn, pMode)) {
- xfree(device);
- return BadAlloc;
- }
-
- pScrn->currentMode = pMode->mode;
-
- if(!pScreenPriv->current && !pScreenPriv->input) {
- /* if it's multihead we need to warp the cursor off of
- our screen so it doesn't get trapped */
- }
-
- pScrn->vtSema = FALSE;
-
- if(pScreenPriv->current) {
- PixmapPtr oldPix = pScreenPriv->current->pPix;
- if(oldPix) {
- if(oldPix->drawable.id)
- FreeResource(oldPix->drawable.id, RT_NONE);
- else
- (*pScreen->DestroyPixmap)(oldPix);
- }
- xfree(pScreenPriv->current);
- pScreenPriv->current = NULL;
- }
-
- if(pMode->flags & DGA_PIXMAP_AVAILABLE) {
- if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth))) {
- (*pScreen->ModifyPixmapHeader)(pPix,
- pMode->pixmapWidth, pMode->pixmapHeight,
- pMode->depth, pMode->bitsPerPixel,
- pMode->bytesPerScanline,
- (pointer)(pMode->address));
- }
- }
-
- devRet->mode = device->mode = pMode;
- devRet->pPix = device->pPix = pPix;
- pScreenPriv->current = device;
- pScreenPriv->pixmapMode = FALSE;
- pScreenPriv->grabMouse = TRUE;
- pScreenPriv->grabKeyboard = TRUE;
-
- return Success;
-}
-
-
-
-/*********** exported ones ***************/
-
-void
-DGASetInputMode(int index, Bool keyboard, Bool mouse)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- if (pScreenPriv)
- {
- pScreenPriv->grabMouse = mouse;
- pScreenPriv->grabKeyboard = keyboard;
- }
-}
-
-Bool
-DGAChangePixmapMode(int index, int *x, int *y, int mode)
-{
- DGAScreenPtr pScreenPriv;
- DGADevicePtr pDev;
- DGAModePtr pMode;
- PixmapPtr pPix;
-
- if(DGAScreenIndex < 0)
- return FALSE;
-
- pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- if(!pScreenPriv || !pScreenPriv->current || !pScreenPriv->current->pPix)
- return FALSE;
-
- pDev = pScreenPriv->current;
- pPix = pDev->pPix;
- pMode = pDev->mode;
-
- if(mode) {
- int shift = 2;
-
- if(*x > (pMode->pixmapWidth - pMode->viewportWidth))
- *x = pMode->pixmapWidth - pMode->viewportWidth;
- if(*y > (pMode->pixmapHeight - pMode->viewportHeight))
- *y = pMode->pixmapHeight - pMode->viewportHeight;
-
- switch(xf86Screens[index]->bitsPerPixel) {
- case 16: shift = 1; break;
- case 32: shift = 0; break;
- default: break;
- }
-
- if(BITMAP_SCANLINE_PAD == 64)
- shift++;
-
- *x = (*x >> shift) << shift;
-
- pPix->drawable.x = *x;
- pPix->drawable.y = *y;
- pPix->drawable.width = pMode->viewportWidth;
- pPix->drawable.height = pMode->viewportHeight;
- } else {
- pPix->drawable.x = 0;
- pPix->drawable.y = 0;
- pPix->drawable.width = pMode->pixmapWidth;
- pPix->drawable.height = pMode->pixmapHeight;
- }
- pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pScreenPriv->pixmapMode = mode;
-
- return TRUE;
-}
-
-Bool
-DGAAvailable(int index)
-{
- if(DGAScreenIndex < 0)
- return FALSE;
-
- if (!xf86NoSharedResources(((ScrnInfoPtr)screenInfo.screens[index]->
- devPrivates[xf86ScreenIndex].ptr)->scrnIndex,MEM))
- return FALSE;
-
- if(DGA_GET_SCREEN_PRIV(screenInfo.screens[index]))
- return TRUE;
-
- return FALSE;
-}
-
-Bool
-DGAActive(int index)
-{
- DGAScreenPtr pScreenPriv;
-
- if(DGAScreenIndex < 0)
- return FALSE;
-
- pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- if(pScreenPriv && pScreenPriv->current)
- return TRUE;
-
- return FALSE;
-}
-
-
-
-/* Called by the event code in case the server is abruptly terminated */
-
-void
-DGAShutdown()
-{
- ScrnInfoPtr pScrn;
- int i;
-
- if(DGAScreenIndex < 0)
- return;
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScrn = xf86Screens[i];
-
- (void)(*pScrn->SetDGAMode)(pScrn->scrnIndex, 0, NULL);
- }
-}
-
-/* Called by the extension to initialize a mode */
-
-int
-DGASetMode(
- int index,
- int num,
- XDGAModePtr mode,
- PixmapPtr *pPix
-){
- ScrnInfoPtr pScrn = xf86Screens[index];
- DGADeviceRec device;
- int ret;
-
- /* We rely on the extension to check that DGA is available */
-
- ret = (*pScrn->SetDGAMode)(index, num, &device);
- if((ret == Success) && num) {
- DGACopyModeInfo(device.mode, mode);
- *pPix = device.pPix;
- }
-
- return ret;
-}
-
-/* Called from the extension to let the DDX know which events are requested */
-
-void
-DGASelectInput(
- int index,
- ClientPtr client,
- long mask
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is available */
- pScreenPriv->client = client;
- pScreenPriv->input = mask;
-}
-
-int
-DGAGetViewportStatus(int index)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is active */
-
- if (!pScreenPriv->funcs->GetViewport)
- return 0;
-
- return (*pScreenPriv->funcs->GetViewport)(pScreenPriv->pScrn);
-}
-
-int
-DGASetViewport(
- int index,
- int x, int y,
- int mode
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- if (pScreenPriv->funcs->SetViewport)
- (*pScreenPriv->funcs->SetViewport)(pScreenPriv->pScrn, x, y, mode);
- return Success;
-}
-
-
-static int
-BitsClear(CARD32 data)
-{
- int bits = 0;
- CARD32 mask;
-
- for(mask = 1; mask; mask <<= 1) {
- if(!(data & mask)) bits++;
- else break;
- }
-
- return bits;
-}
-
-int
-DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
- FakedVisualList *fvlp;
- VisualPtr pVisual;
- DGAModePtr pMode;
- ColormapPtr pmap;
-
- if(!mode || (mode > pScreenPriv->numModes))
- return BadValue;
-
- if((alloc != AllocNone) && (alloc != AllocAll))
- return BadValue;
-
- pMode = &(pScreenPriv->modes[mode - 1]);
-
- if(!(pVisual = xalloc(sizeof(VisualRec))))
- return BadAlloc;
-
- pVisual->vid = FakeClientID(0);
- pVisual->class = pMode->visualClass;
- pVisual->nplanes = pMode->depth;
- pVisual->ColormapEntries = 1 << pMode->depth;
- pVisual->bitsPerRGBValue = (pMode->depth + 2) / 3;
-
- switch (pVisual->class) {
- case PseudoColor:
- case GrayScale:
- case StaticGray:
- pVisual->bitsPerRGBValue = 8; /* not quite */
- pVisual->redMask = 0;
- pVisual->greenMask = 0;
- pVisual->blueMask = 0;
- pVisual->offsetRed = 0;
- pVisual->offsetGreen = 0;
- pVisual->offsetBlue = 0;
- break;
- case DirectColor:
- case TrueColor:
- pVisual->ColormapEntries = 1 << pVisual->bitsPerRGBValue;
- /* fall through */
- case StaticColor:
- pVisual->redMask = pMode->red_mask;
- pVisual->greenMask = pMode->green_mask;
- pVisual->blueMask = pMode->blue_mask;
- pVisual->offsetRed = BitsClear(pVisual->redMask);
- pVisual->offsetGreen = BitsClear(pVisual->greenMask);
- pVisual->offsetBlue = BitsClear(pVisual->blueMask);
- }
-
- if(!(fvlp = xalloc(sizeof(FakedVisualList)))) {
- xfree(pVisual);
- return BadAlloc;
- }
-
- fvlp->free = FALSE;
- fvlp->pVisual = pVisual;
- fvlp->next = pScreenPriv->fakedVisuals;
- pScreenPriv->fakedVisuals = fvlp;
-
- LEGAL_NEW_RESOURCE(id, client);
-
- return CreateColormap(id, pScreen, pVisual, &pmap, alloc, client->index);
-}
-
-/* Called by the extension to install a colormap on DGA active screens */
-
-void
-DGAInstallCmap(ColormapPtr cmap)
-{
- ScreenPtr pScreen = cmap->pScreen;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- /* We rely on the extension to check that DGA is active */
-
- if(!pScreenPriv->dgaColormap)
- pScreenPriv->savedColormap = miInstalledMaps[pScreen->myNum];
-
- pScreenPriv->dgaColormap = cmap;
-
- (*pScreen->InstallColormap)(cmap);
-}
-
-int
-DGASync(int index)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is active */
-
- if (pScreenPriv->funcs->Sync)
- (*pScreenPriv->funcs->Sync)(pScreenPriv->pScrn);
-
- return Success;
-}
-
-int
-DGAFillRect(
- int index,
- int x, int y, int w, int h,
- unsigned long color
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is active */
-
- if(pScreenPriv->funcs->FillRect &&
- (pScreenPriv->current->mode->flags & DGA_FILL_RECT)) {
-
- (*pScreenPriv->funcs->FillRect)(pScreenPriv->pScrn, x, y, w, h, color);
- return Success;
- }
- return BadMatch;
-}
-
-int
-DGABlitRect(
- int index,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is active */
-
- if(pScreenPriv->funcs->BlitRect &&
- (pScreenPriv->current->mode->flags & DGA_BLIT_RECT)) {
-
- (*pScreenPriv->funcs->BlitRect)(pScreenPriv->pScrn,
- srcx, srcy, w, h, dstx, dsty);
- return Success;
- }
- return BadMatch;
-}
-
-int
-DGABlitTransRect(
- int index,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty,
- unsigned long color
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is active */
-
- if(pScreenPriv->funcs->BlitTransRect &&
- (pScreenPriv->current->mode->flags & DGA_BLIT_RECT_TRANS)) {
-
- (*pScreenPriv->funcs->BlitTransRect)(pScreenPriv->pScrn,
- srcx, srcy, w, h, dstx, dsty, color);
- return Success;
- }
- return BadMatch;
-}
-
-
-int
-DGAGetModes(int index)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
- /* We rely on the extension to check that DGA is available */
-
- return pScreenPriv->numModes;
-}
-
-
-int
-DGAGetModeInfo(
- int index,
- XDGAModePtr mode,
- int num
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
- /* We rely on the extension to check that DGA is available */
-
- if((num <= 0) || (num > pScreenPriv->numModes))
- return BadValue;
-
- DGACopyModeInfo(&(pScreenPriv->modes[num - 1]), mode);
-
- return Success;
-}
-
-
-static void
-DGACopyModeInfo(
- DGAModePtr mode,
- XDGAModePtr xmode
-){
- DisplayModePtr dmode = mode->mode;
-
- xmode->num = mode->num;
- xmode->name = dmode->name;
- xmode->VSync_num = (int)(dmode->VRefresh * 1000.0);
- xmode->VSync_den = 1000;
- xmode->flags = mode->flags;
- xmode->imageWidth = mode->imageWidth;
- xmode->imageHeight = mode->imageHeight;
- xmode->pixmapWidth = mode->pixmapWidth;
- xmode->pixmapHeight = mode->pixmapHeight;
- xmode->bytesPerScanline = mode->bytesPerScanline;
- xmode->byteOrder = mode->byteOrder;
- xmode->depth = mode->depth;
- xmode->bitsPerPixel = mode->bitsPerPixel;
- xmode->red_mask = mode->red_mask;
- xmode->green_mask = mode->green_mask;
- xmode->blue_mask = mode->blue_mask;
- xmode->visualClass = mode->visualClass;
- xmode->viewportWidth = mode->viewportWidth;
- xmode->viewportHeight = mode->viewportHeight;
- xmode->xViewportStep = mode->xViewportStep;
- xmode->yViewportStep = mode->yViewportStep;
- xmode->maxViewportX = mode->maxViewportX;
- xmode->maxViewportY = mode->maxViewportY;
- xmode->viewportFlags = mode->viewportFlags;
- xmode->reserved1 = mode->reserved1;
- xmode->reserved2 = mode->reserved2;
- xmode->offset = mode->offset;
-
- if(dmode->Flags & V_INTERLACE) xmode->flags |= DGA_INTERLACED;
- if(dmode->Flags & V_DBLSCAN) xmode->flags |= DGA_DOUBLESCAN;
-}
-
-
-Bool
-DGAVTSwitch(void)
-{
- ScreenPtr pScreen;
- int i;
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
-
- /* Alternatively, this could send events to DGA clients */
-
- if(DGAScreenIndex >= 0) {
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- if(pScreenPriv && pScreenPriv->current)
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-
-/* We have the power to steal or modify events that are about to get queued */
-
-Bool
-DGAStealKeyEvent(int index, xEvent *e)
-{
- DGAScreenPtr pScreenPriv;
- dgaEvent de;
-
- if(DGAScreenIndex < 0) /* no DGA */
- return FALSE;
-
- pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
- return FALSE;
-
- de.u.u.type = e->u.u.type + *XDGAEventBase;
- de.u.u.detail = e->u.u.detail;
- de.u.event.time = e->u.keyButtonPointer.time;
- xf86eqEnqueue ((xEvent *) &de);
- return TRUE;
-}
-
-static int DGAMouseX, DGAMouseY;
-
-Bool
-DGAStealMouseEvent(int index, xEvent *e, int dx, int dy)
-{
- DGAScreenPtr pScreenPriv;
- dgaEvent de;
-
- if(DGAScreenIndex < 0) /* no DGA */
- return FALSE;
-
- pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
- return FALSE;
-
- DGAMouseX += dx;
- if (DGAMouseX < 0)
- DGAMouseX = 0;
- else if (DGAMouseX > screenInfo.screens[index]->width)
- DGAMouseX = screenInfo.screens[index]->width;
- DGAMouseY += dy;
- if (DGAMouseY < 0)
- DGAMouseY = 0;
- else if (DGAMouseY > screenInfo.screens[index]->height)
- DGAMouseY = screenInfo.screens[index]->height;
- de.u.u.type = e->u.u.type + *XDGAEventBase;
- de.u.u.detail = e->u.u.detail;
- de.u.event.time = e->u.keyButtonPointer.time;
- de.u.event.dx = dx;
- de.u.event.dy = dy;
- de.u.event.pad1 = DGAMouseX;
- de.u.event.pad2 = DGAMouseY;
- xf86eqEnqueue ((xEvent *) &de);
- return TRUE;
-}
-
-Bool
-DGAIsDgaEvent (xEvent *e)
-{
- int coreEquiv;
- if (DGAScreenIndex < 0 || XDGAEventBase == 0)
- return FALSE;
- coreEquiv = e->u.u.type - *XDGAEventBase;
- if (KeyPress <= coreEquiv && coreEquiv <= MotionNotify)
- return TRUE;
- return FALSE;
-}
-
-#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */
-static Mask filters[] =
-{
- NoSuchEvent, /* 0 */
- NoSuchEvent, /* 1 */
- KeyPressMask, /* KeyPress */
- KeyReleaseMask, /* KeyRelease */
- ButtonPressMask, /* ButtonPress */
- ButtonReleaseMask, /* ButtonRelease */
- PointerMotionMask, /* MotionNotify (initial state) */
-};
-
-static void
-DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd)
-{
- int key, bit;
- register BYTE *kptr;
- register int i;
- register CARD8 modifiers;
- register CARD16 mask;
- int coreEquiv;
- xEvent core;
- KeyClassPtr keyc = keybd->key;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- coreEquiv = de->u.u.type - *XDGAEventBase;
-
- /*
- * Fill in remaining event state
- */
- de->u.event.dx = 0;
- de->u.event.dy = 0;
- de->u.event.screen = pScreen->myNum;
- de->u.event.state = keyc->state | (inputInfo.pointer)->button->state;
-
- /*
- * Keep the core state in sync by duplicating what
- * CoreProcessKeyboardEvent does
- */
- key = de->u.u.detail;
- kptr = &keyc->down[key >> 3];
- bit = 1 << (key & 7);
- modifiers = keyc->modifierMap[key];
- switch (coreEquiv)
- {
- case KeyPress:
- inputInfo.pointer->valuator->motionHintWindow = NullWindow;
- *kptr |= bit;
- keyc->prev_state = keyc->state;
- if (noXkbExtension) {
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers)
- {
- /* This key affects modifier "i" */
- keyc->modifierKeyCount[i]++;
- keyc->state |= mask;
- modifiers &= ~mask;
- }
- }
- }
- break;
- case KeyRelease:
- inputInfo.pointer->valuator->motionHintWindow = NullWindow;
- *kptr &= ~bit;
- keyc->prev_state = keyc->state;
- if (noXkbExtension) {
- for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
- {
- if (mask & modifiers) {
- /* This key affects modifier "i" */
- if (--keyc->modifierKeyCount[i] <= 0) {
- keyc->state &= ~mask;
- keyc->modifierKeyCount[i] = 0;
- }
- modifiers &= ~mask;
- }
- }
- }
- break;
- }
- /*
- * Deliver the DGA event
- */
- if (pScreenPriv->client)
- {
- /* If the DGA client has selected input, then deliver based on the usual filter */
- TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
- filters[coreEquiv], pScreenPriv->input, 0);
- }
- else
- {
- /* If the keyboard is actively grabbed, deliver a grabbed core event */
- if (keybd->grab && !keybd->fromPassiveGrab)
- {
- core.u.u.type = coreEquiv;
- core.u.u.detail = de->u.u.detail;
- core.u.keyButtonPointer.time = de->u.event.time;
- core.u.keyButtonPointer.eventX = de->u.event.dx;
- core.u.keyButtonPointer.eventY = de->u.event.dy;
- core.u.keyButtonPointer.rootX = de->u.event.dx;
- core.u.keyButtonPointer.rootY = de->u.event.dy;
- core.u.keyButtonPointer.state = de->u.event.state;
- DeliverGrabbedEvent (&core, keybd, FALSE, 1);
- }
- }
-}
-
-static void
-DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
-{
- ButtonClassPtr butc = mouse->button;
- int coreEquiv;
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
- xEvent core;
-
- coreEquiv = de->u.u.type - *XDGAEventBase;
- /*
- * Fill in remaining event state
- */
- de->u.event.screen = pScreen->myNum;
- de->u.event.state = butc->state | inputInfo.keyboard->key->state;
- /*
- * Keep the core state in sync by duplicating what
- * CoreProcessPointerEvent does
- */
- if (coreEquiv != MotionNotify)
- {
- register int key;
- register BYTE *kptr;
- int bit;
-
- key = de->u.u.detail;
- kptr = &butc->down[key >> 3];
- bit = 1 << (key & 7);
- switch (coreEquiv)
- {
- case ButtonPress:
- mouse->valuator->motionHintWindow = NullWindow;
- if (!(*kptr & bit))
- butc->buttonsDown++;
- butc->motionMask = ButtonMotionMask;
- *kptr |= bit;
- if (key <= 5)
- butc->state |= (Button1Mask >> 1) << key;
- break;
- case ButtonRelease:
- mouse->valuator->motionHintWindow = NullWindow;
- if (*kptr & bit)
- --butc->buttonsDown;
- if (!butc->buttonsDown)
- butc->motionMask = 0;
- *kptr &= ~bit;
- if (key == 0)
- return;
- if (key <= 5)
- butc->state &= ~((Button1Mask >> 1) << key);
- break;
- }
- }
- /*
- * Deliver the DGA event
- */
- if (pScreenPriv->client)
- {
- /* If the DGA client has selected input, then deliver based on the usual filter */
- TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
- filters[coreEquiv], pScreenPriv->input, 0);
- }
- else
- {
- /* If the pointer is actively grabbed, deliver a grabbed core event */
- if (mouse->grab && !mouse->fromPassiveGrab)
- {
- core.u.u.type = coreEquiv;
- core.u.u.detail = de->u.u.detail;
- core.u.keyButtonPointer.time = de->u.event.time;
- core.u.keyButtonPointer.eventX = de->u.event.dx;
- core.u.keyButtonPointer.eventY = de->u.event.dy;
- core.u.keyButtonPointer.rootX = de->u.event.dx;
- core.u.keyButtonPointer.rootY = de->u.event.dy;
- core.u.keyButtonPointer.state = de->u.event.state;
- DeliverGrabbedEvent (&core, mouse, FALSE, 1);
- }
- }
-}
-
-Bool
-DGADeliverEvent (ScreenPtr pScreen, xEvent *e)
-{
- dgaEvent *de = (dgaEvent *) e;
- DGAScreenPtr pScreenPriv;
- int coreEquiv;
-
- /* no DGA */
- if (DGAScreenIndex < 0 || XDGAEventBase == 0)
- return FALSE;
- pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- /* DGA not initialized on this screen */
- if (!pScreenPriv)
- return FALSE;
-
- coreEquiv = de->u.u.type - *XDGAEventBase;
- /* Not a DGA event */
- if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
- return FALSE;
-
- switch (coreEquiv) {
- case KeyPress:
- case KeyRelease:
- DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
- break;
- default:
- DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
- break;
- }
- return TRUE;
-}
-
-Bool
-DGAOpenFramebuffer(
- int index,
- char **name,
- unsigned char **mem,
- int *size,
- int *offset,
- int *flags
-){
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is available */
-
- return (*pScreenPriv->funcs->OpenFramebuffer)(pScreenPriv->pScrn,
- name, mem, size, offset, flags);
-}
-
-void
-DGACloseFramebuffer(int index)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-
- /* We rely on the extension to check that DGA is available */
- if(pScreenPriv->funcs->CloseFramebuffer)
- (*pScreenPriv->funcs->CloseFramebuffer)(pScreenPriv->pScrn);
-}
-
-/* For DGA 1.0 backwards compatibility only */
-
-int
-DGAGetOldDGAMode(int index)
-{
- DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
- ScrnInfoPtr pScrn = pScreenPriv->pScrn;
- DGAModePtr mode;
- int i, w, h, p;
-
- /* We rely on the extension to check that DGA is available */
-
- w = pScrn->currentMode->HDisplay;
- h = pScrn->currentMode->VDisplay;
- p = ((pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) + 3) & ~3L;
-
- for(i = 0; i < pScreenPriv->numModes; i++) {
- mode = &(pScreenPriv->modes[i]);
-
- if((mode->viewportWidth == w) && (mode->viewportHeight == h) &&
- (mode->bytesPerScanline == p) &&
- (mode->bitsPerPixel == pScrn->bitsPerPixel) &&
- (mode->depth == pScrn->depth)) {
-
- return mode->num;
- }
- }
-
- return 0;
-}
-
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
deleted file mode 100644
index df968797c..000000000
--- a/hw/xfree86/common/xf86DPMS.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.11 2003/11/11 21:02:28 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the DPMS functions required by the extension.
- */
-
-#include "X.h"
-#include "os.h"
-#include "globals.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#ifdef DPMSExtension
-#define DPMS_SERVER
-#include "extensions/dpms.h"
-#include "dpmsproc.h"
-#endif
-
-
-#ifdef DPMSExtension
-static int DPMSGeneration = 0;
-static int DPMSIndex = -1;
-static Bool DPMSClose(int i, ScreenPtr pScreen);
-static int DPMSCount = 0;
-#endif
-
-
-Bool
-xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
-{
-#ifdef DPMSExtension
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- DPMSPtr pDPMS;
- pointer DPMSOpt;
-
- if (serverGeneration != DPMSGeneration) {
- if ((DPMSIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- DPMSGeneration = serverGeneration;
- }
-
- if (DPMSDisabledSwitch)
- DPMSEnabled = FALSE;
- if (!(pScreen->devPrivates[DPMSIndex].ptr = xcalloc(sizeof(DPMSRec), 1)))
- return FALSE;
-
- pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
- pScrn->DPMSSet = set;
- pDPMS->Flags = flags;
- DPMSOpt = xf86FindOption(pScrn->options, "dpms");
- if (DPMSOpt) {
- if ((pDPMS->Enabled
- = xf86SetBoolOption(pScrn->options, "dpms", FALSE))
- && !DPMSDisabledSwitch)
- DPMSEnabled = TRUE;
- xf86MarkOptionUsed(DPMSOpt);
- xf86DrvMsg(pScreen->myNum, X_CONFIG, "DPMS enabled\n");
- } else if (DPMSEnabledSwitch) {
- if (!DPMSDisabledSwitch)
- DPMSEnabled = TRUE;
- pDPMS->Enabled = TRUE;
- }
- else {
- pDPMS->Enabled = FALSE;
- }
- pDPMS->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = DPMSClose;
- DPMSCount++;
- return TRUE;
-#else
- return FALSE;
-#endif
-}
-
-
-#ifdef DPMSExtension
-
-static Bool
-DPMSClose(int i, ScreenPtr pScreen)
-{
- DPMSPtr pDPMS;
-
- /* This shouldn't happen */
- if (DPMSIndex < 0)
- return FALSE;
-
- pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
-
- /* This shouldn't happen */
- if (!pDPMS)
- return FALSE;
-
- pScreen->CloseScreen = pDPMS->CloseScreen;
-
- xfree((pointer)pDPMS);
- pScreen->devPrivates[DPMSIndex].ptr = NULL;
- if (--DPMSCount == 0)
- DPMSIndex = -1;
- return pScreen->CloseScreen(i, pScreen);
-}
-
-
-/*
- * DPMSSet --
- * Device dependent DPMS mode setting hook. This is called whenever
- * the DPMS mode is to be changed.
- */
-void
-DPMSSet(int level)
-{
- int i;
- DPMSPtr pDPMS;
- ScrnInfoPtr pScrn;
-
- DPMSPowerLevel = level;
-
- if (DPMSIndex < 0)
- return;
-
- if (level != DPMSModeOn)
- SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverActive);
-
- /* For each screen, set the DPMS level */
- for (i = 0; i < xf86NumScreens; i++) {
- pScrn = xf86Screens[i];
- pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
- if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
- xf86EnableAccess(pScrn);
- pScrn->DPMSSet(pScrn, level, 0);
- }
- }
-}
-
-
-/*
- * DPMSSupported --
- * Return TRUE if any screen supports DPMS.
- */
-Bool
-DPMSSupported(void)
-{
- int i;
- DPMSPtr pDPMS;
- ScrnInfoPtr pScrn;
-
- if (DPMSIndex < 0) {
- return FALSE;
- }
-
- /* For each screen, check if DPMS is supported */
- for (i = 0; i < xf86NumScreens; i++) {
- pScrn = xf86Screens[i];
- pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
- if (pDPMS && pScrn->DPMSSet)
- return TRUE;
- }
- return FALSE;
-}
-
-
-/*
- * DPMSGet --
- * Device dependent DPMS mode getting hook. This returns the current
- * DPMS mode, or -1 if DPMS is not supported.
- *
- * This should hook in to the appropriate driver-level function, which
- * will be added to the ScrnInfoRec.
- *
- * NOTES:
- * 1. the calling interface should be changed to specify which
- * screen to check.
- * 2. It isn't clear that this function is ever used or what it should
- * return.
- */
-int
-DPMSGet(int *level)
-{
- return DPMSPowerLevel;
-}
-
-#endif /* DPMSExtension */
diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h
deleted file mode 100644
index 754e20d18..000000000
--- a/hw/xfree86/common/xf86Date.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.52 2003/11/21 06:01:44 dawes Exp $ */
-/*
- * Copyright (c) 2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef XF86_DATE
-
-#define XF86_DATE "20 November 2003"
-
-#endif
diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c
deleted file mode 100644
index 3bf21689f..000000000
--- a/hw/xfree86/common/xf86Debug.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.7 2003/09/24 02:43:17 dawes Exp $ */
-
-/*
- * Copyright (c) 2000-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include <sys/time.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "compiler.h"
-
-void xf86Break1(void)
-{
-}
-
-void xf86Break2(void)
-{
-}
-
-void xf86Break3(void)
-{
-}
-
-char *xf86p8bit[] = { "00000000", "00000001", "00000010", "00000011",
- "00000100", "00000101", "00000110", "00000111",
- "00001000", "00001001", "00001010", "00001011",
- "00001100", "00001101", "00001110", "00001111",
- "00010000", "00010001", "00010010", "00010011",
- "00010100", "00010101", "00010110", "00010111",
- "00011000", "00011001", "00011010", "00011011",
- "00011100", "00011101", "00011110", "00011111",
- "00100000", "00100001", "00100010", "00100011",
- "00100100", "00100101", "00100110", "00100111",
- "00101000", "00101001", "00101010", "00101011",
- "00101100", "00101101", "00101110", "00101111",
- "00110000", "00110001", "00110010", "00110011",
- "00110100", "00110101", "00110110", "00110111",
- "00111000", "00111001", "00111010", "00111011",
- "00111100", "00111101", "00111110", "00111111",
- "01000000", "01000001", "01000010", "01000011",
- "01000100", "01000101", "01000110", "01000111",
- "01001000", "01001001", "01001010", "01001011",
- "01001100", "01001101", "01001110", "01001111",
- "01010000", "01010001", "01010010", "01010011",
- "01010100", "01010101", "01010110", "01010111",
- "01011000", "01011001", "01011010", "01011011",
- "01011100", "01011101", "01011110", "01011111",
- "01100000", "01100001", "01100010", "01100011",
- "01100100", "01100101", "01100110", "01100111",
- "01101000", "01101001", "01101010", "01101011",
- "01101100", "01101101", "01101110", "01101111",
- "01110000", "01110001", "01110010", "01110011",
- "01110100", "01110101", "01110110", "01110111",
- "01111000", "01111001", "01111010", "01111011",
- "01111100", "01111101", "01111110", "01111111",
- "10000000", "10000001", "10000010", "10000011",
- "10000100", "10000101", "10000110", "10000111",
- "10001000", "10001001", "10001010", "10001011",
- "10001100", "10001101", "10001110", "10001111",
- "10010000", "10010001", "10010010", "10010011",
- "10010100", "10010101", "10010110", "10010111",
- "10011000", "10011001", "10011010", "10011011",
- "10011100", "10011101", "10011110", "10011111",
- "10100000", "10100001", "10100010", "10100011",
- "10100100", "10100101", "10100110", "10100111",
- "10101000", "10101001", "10101010", "10101011",
- "10101100", "10101101", "10101110", "10101111",
- "10110000", "10110001", "10110010", "10110011",
- "10110100", "10110101", "10110110", "10110111",
- "10111000", "10111001", "10111010", "10111011",
- "10111100", "10111101", "10111110", "10111111",
- "11000000", "11000001", "11000010", "11000011",
- "11000100", "11000101", "11000110", "11000111",
- "11001000", "11001001", "11001010", "11001011",
- "11001100", "11001101", "11001110", "11001111",
- "11010000", "11010001", "11010010", "11010011",
- "11010100", "11010101", "11010110", "11010111",
- "11011000", "11011001", "11011010", "11011011",
- "11011100", "11011101", "11011110", "11011111",
- "11100000", "11100001", "11100010", "11100011",
- "11100100", "11100101", "11100110", "11100111",
- "11101000", "11101001", "11101010", "11101011",
- "11101100", "11101101", "11101110", "11101111",
- "11110000", "11110001", "11110010", "11110011",
- "11110100", "11110101", "11110110", "11110111",
- "11111000", "11111001", "11111010", "11111011",
- "11111100", "11111101", "11111110", "11111111"
-};
-
-CARD32 xf86DummyVar1;
-CARD32 xf86DummyVar2;
-CARD32 xf86DummyVar3;
-
-CARD8 xf86PeekFb8(CARD8 *p) { return *p; }
-CARD16 xf86PeekFb16(CARD16 *p) { return *p; }
-CARD32 xf86PeekFb32(CARD32 *p) { return *p; }
-void xf86PokeFb8(CARD8 *p, CARD8 v) { *p = v; }
-void xf86PokeFb16(CARD16 *p, CARD16 v) { *p = v; }
-void xf86PokeFb32(CARD16 *p, CARD32 v) { *p = v; }
-
-CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset)
-{
- return MMIO_IN8(Base,Offset);
-}
-
-CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset)
-{
- return MMIO_IN16(Base,Offset);
-}
-
-CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset)
-{
- return MMIO_IN32(Base,Offset);
-}
-
-void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v)
-{
- MMIO_OUT8(Base,Offset,v);
-}
-
-void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v)
-{
- MMIO_OUT16(Base,Offset,v);
-}
-
-void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v)
-{
- MMIO_OUT32(Base,Offset,v);
-}
-
-
-void
-xf86STimestamp(xf86TsPtr* timestamp)
-{
- if (*timestamp) {
- gettimeofday((struct timeval*)*timestamp,NULL);
- } else {
- *timestamp = xnfalloc(sizeof(xf86TsRec));
- gettimeofday((struct timeval*)*timestamp,NULL);
- }
-}
-
-void
-xf86SPTimestamp(xf86TsPtr* timestamp, char *str)
-{
- if (*timestamp) {
- long diff;
- struct timeval ts;
- ts = **(struct timeval**)timestamp;
- gettimeofday((struct timeval*)*timestamp,NULL);
- if (ts.tv_usec > (*timestamp)->usec)
- diff = ((*timestamp)->sec - ts.tv_sec - 1) * 1000
- + (ts.tv_usec - (*timestamp)->usec) / 1000;
- else
- diff = ((*timestamp)->sec - ts.tv_sec) * 1000
- +(- ts.tv_usec + (*timestamp)->usec) / 1000;
- ErrorF("%s Elapsed: %li\n",str,diff);
- } else {
- *timestamp = xnfalloc(sizeof(xf86TsRec));
- gettimeofday((struct timeval*)*timestamp,NULL);
- }
-}
diff --git a/hw/xfree86/common/xf86DefModes.c b/hw/xfree86/common/xf86DefModes.c
deleted file mode 100644
index 7257b204b..000000000
--- a/hw/xfree86/common/xf86DefModes.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.10 2003/11/03 05:11:02 tsi Exp $ */
-
-/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
- * modeline2c.pl */
-
-/*
- * Copyright 1999-2003 by The XFree86 Project, Inc.
- *
- * Author: Dirk Hohndel <hohndel@XFree86.Org>
- */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-#include "xf86.h"
-#include "xf86Config.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include "globals.h"
-
-#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT
-#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
-
-DisplayModeRec xf86DefaultModes [] = {
-/* 640x350 @ 85Hz (VESA) hsync: 37.9kHz */
- {MODEPREFIX("640x350"),31500, 640,672,736,832,0, 350,382,385,445,0, V_PHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("320x175"),15750, 320,336,368,416,0, 175,191,192,222,0, V_PHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 640x400 @ 85Hz (VESA) hsync: 37.9kHz */
- {MODEPREFIX("640x400"),31500, 640,672,736,832,0, 400,401,404,445,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("320x200"),15750, 320,336,368,416,0, 200,200,202,222,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 720x400 @ 85Hz (VESA) hsync: 37.9kHz */
- {MODEPREFIX("720x400"),35500, 720,756,828,936,0, 400,401,404,446,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("360x200"),17750, 360,378,414,468,0, 200,200,202,223,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz */
- {MODEPREFIX("640x480"),25200, 640,656,752,800,0, 480,490,492,525,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("320x240"),12600, 320,328,376,400,0, 240,245,246,262,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 640x480 @ 72Hz (VESA) hsync: 37.9kHz */
- {MODEPREFIX("640x480"),31500, 640,664,704,832,0, 480,489,491,520,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("320x240"),15750, 320,332,352,416,0, 240,244,245,260,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 640x480 @ 75Hz (VESA) hsync: 37.5kHz */
- {MODEPREFIX("640x480"),31500, 640,656,720,840,0, 480,481,484,500,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("320x240"),15750, 320,328,360,420,0, 240,240,242,250,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 640x480 @ 85Hz (VESA) hsync: 43.3kHz */
- {MODEPREFIX("640x480"),36000, 640,696,752,832,0, 480,481,484,509,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("320x240"),18000, 320,348,376,416,0, 240,240,242,254,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 800x600 @ 56Hz (VESA) hsync: 35.2kHz */
- {MODEPREFIX("800x600"),36000, 800,824,896,1024,0, 600,601,603,625,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("400x300"),18000, 400,412,448,512,0, 300,300,301,312,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 800x600 @ 60Hz (VESA) hsync: 37.9kHz */
- {MODEPREFIX("800x600"),40000, 800,840,968,1056,0, 600,601,605,628,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("400x300"),20000, 400,420,484,528,0, 300,300,302,314,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 800x600 @ 72Hz (VESA) hsync: 48.1kHz */
- {MODEPREFIX("800x600"),50000, 800,856,976,1040,0, 600,637,643,666,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("400x300"),25000, 400,428,488,520,0, 300,318,321,333,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 800x600 @ 75Hz (VESA) hsync: 46.9kHz */
- {MODEPREFIX("800x600"),49500, 800,816,896,1056,0, 600,601,604,625,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("400x300"),24750, 400,408,448,528,0, 300,300,302,312,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 800x600 @ 85Hz (VESA) hsync: 53.7kHz */
- {MODEPREFIX("800x600"),56300, 800,832,896,1048,0, 600,601,604,631,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("400x300"),28150, 400,416,448,524,0, 300,300,302,315,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz */
- {MODEPREFIX("1024x768"),44900, 1024,1032,1208,1264,0, 768,768,776,817,0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX},
- {MODEPREFIX("512x384"),22450, 512,516,604,632,0, 384,384,388,408,0, V_PHSYNC | V_PVSYNC | V_INTERLACE | V_DBLSCAN, MODESUFFIX},
-/* 1024x768 @ 60Hz (VESA) hsync: 48.4kHz */
- {MODEPREFIX("1024x768"),65000, 1024,1048,1184,1344,0, 768,771,777,806,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("512x384"),32500, 512,524,592,672,0, 384,385,388,403,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1024x768 @ 70Hz (VESA) hsync: 56.5kHz */
- {MODEPREFIX("1024x768"),75000, 1024,1048,1184,1328,0, 768,771,777,806,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("512x384"),37500, 512,524,592,664,0, 384,385,388,403,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1024x768 @ 75Hz (VESA) hsync: 60.0kHz */
- {MODEPREFIX("1024x768"),78800, 1024,1040,1136,1312,0, 768,769,772,800,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("512x384"),39400, 512,520,568,656,0, 384,384,386,400,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1024x768 @ 85Hz (VESA) hsync: 68.7kHz */
- {MODEPREFIX("1024x768"),94500, 1024,1072,1168,1376,0, 768,769,772,808,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("512x384"),47250, 512,536,584,688,0, 384,384,386,404,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1152x864 @ 75Hz (VESA) hsync: 67.5kHz */
- {MODEPREFIX("1152x864"),108000, 1152,1216,1344,1600,0, 864,865,868,900,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("576x432"),54000, 576,608,672,800,0, 432,432,434,450,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1280x960 @ 60Hz (VESA) hsync: 60.0kHz */
- {MODEPREFIX("1280x960"),108000, 1280,1376,1488,1800,0, 960,961,964,1000,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("640x480"),54000, 640,688,744,900,0, 480,480,482,500,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1280x960 @ 85Hz (VESA) hsync: 85.9kHz */
- {MODEPREFIX("1280x960"),148500, 1280,1344,1504,1728,0, 960,961,964,1011,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("640x480"),74250, 640,672,752,864,0, 480,480,482,505,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz */
- {MODEPREFIX("1280x1024"),108000, 1280,1328,1440,1688,0, 1024,1025,1028,1066,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("640x512"),54000, 640,664,720,844,0, 512,512,514,533,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz */
- {MODEPREFIX("1280x1024"),135000, 1280,1296,1440,1688,0, 1024,1025,1028,1066,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("640x512"),67500, 640,648,720,844,0, 512,512,514,533,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz */
- {MODEPREFIX("1280x1024"),157500, 1280,1344,1504,1728,0, 1024,1025,1028,1072,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("640x512"),78750, 640,672,752,864,0, 512,512,514,536,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz */
- {MODEPREFIX("1600x1200"),162000, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("800x600"),81000, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz */
- {MODEPREFIX("1600x1200"),175500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("800x600"),87750, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz */
- {MODEPREFIX("1600x1200"),189000, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("800x600"),94500, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz */
- {MODEPREFIX("1600x1200"),202500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("800x600"),101250, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz */
- {MODEPREFIX("1600x1200"),229500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("800x600"),114750, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz */
- {MODEPREFIX("1792x1344"),204800, 1792,1920,2120,2448,0, 1344,1345,1348,1394,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("896x672"),102400, 896,960,1060,1224,0, 672,672,674,697,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz */
- {MODEPREFIX("1792x1344"),261000, 1792,1888,2104,2456,0, 1344,1345,1348,1417,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("896x672"),130500, 896,944,1052,1228,0, 672,672,674,708,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz */
- {MODEPREFIX("1856x1392"),218300, 1856,1952,2176,2528,0, 1392,1393,1396,1439,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("928x696"),109150, 928,976,1088,1264,0, 696,696,698,719,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz */
- {MODEPREFIX("1856x1392"),288000, 1856,1984,2208,2560,0, 1392,1393,1396,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("928x696"),144000, 928,992,1104,1280,0, 696,696,698,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz */
- {MODEPREFIX("1920x1440"),234000, 1920,2048,2256,2600,0, 1440,1441,1444,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("960x720"),117000, 960,1024,1128,1300,0, 720,720,722,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz */
- {MODEPREFIX("1920x1440"),297000, 1920,2064,2288,2640,0, 1440,1441,1444,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("960x720"),148500, 960,1032,1144,1320,0, 720,720,722,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz */
- {MODEPREFIX("832x624"),57284, 832,864,928,1152,0, 624,625,628,667,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("416x312"),28642, 416,432,464,576,0, 312,312,314,333,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz */
- {MODEPREFIX("1152x768"),64995, 1152,1178,1314,1472,0, 768,771,777,806,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("576x384"),32497, 576,589,657,736,0, 384,385,388,403,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz */
- {MODEPREFIX("1400x1050"),122000, 1400,1488,1640,1880,0, 1050,1052,1064,1082,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("700x525"),61000, 700,744,820,940,0, 525,526,532,541,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz */
- {MODEPREFIX("1400x1050"),155800, 1400,1464,1784,1912,0, 1050,1052,1064,1090,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("700x525"),77900, 700,732,892,956,0, 525,526,532,545,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz */
- {MODEPREFIX("1600x1024"),106910, 1600,1620,1640,1670,0, 1024,1027,1030,1067,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
- {MODEPREFIX("800x512"),53455, 800,810,820,835,0, 512,513,515,533,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz */
- {MODEPREFIX("1920x1440"),341350, 1920,2072,2288,2656,0, 1440,1441,1444,1512,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("960x720"),170675, 960,1036,1144,1328,0, 720,720,722,756,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz */
- {MODEPREFIX("2048x1536"),266950, 2048,2200,2424,2800,0, 1536,1537,1540,1589,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("1024x768"),133475, 1024,1100,1212,1400,0, 768,768,770,794,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz */
- {MODEPREFIX("2048x1536"),340480, 2048,2216,2440,2832,0, 1536,1537,1540,1603,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("1024x768"),170240, 1024,1108,1220,1416,0, 768,768,770,801,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
-/* 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz */
- {MODEPREFIX("2048x1536"),388040, 2048,2216,2440,2832,0, 1536,1537,1540,1612,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
- {MODEPREFIX("1024x768"),194020, 1024,1108,1220,1416,0, 768,768,770,806,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
- {MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}
-};
diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c
deleted file mode 100644
index eece97719..000000000
--- a/hw/xfree86/common/xf86DoProbe.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.14 2003/10/29 04:17:21 dawes Exp $ */
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * finish setting up the server
- * Load the driver modules and call their probe functions.
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include "X.h"
-#include "Xmd.h"
-#include "os.h"
-#ifdef XFree86LOADER
-#include "loaderProcs.h"
-#include "xf86Config.h"
-#endif /* XFree86LOADER */
-#include "xf86.h"
-#include "xf86Priv.h"
-
-void
-DoProbeArgs(int argc, char **argv, int i)
-{
-}
-
-void
-DoProbe()
-{
- int i;
- Bool probeResult;
-
-#ifdef XFree86LOADER
- /* Find the list of video driver modules. */
- char **list = xf86DriverlistFromCompile();
- char **l;
-
- if (list) {
- ErrorF("List of video driver modules:\n");
- for (l = list; *l; l++)
- ErrorF("\t%s\n", *l);
- } else {
- ErrorF("No video driver modules found\n");
- }
-
- /* Load all the drivers that were found. */
- xf86LoadModules(list, NULL);
-#endif /* XFree86LOADER */
-
- /* Disable PCI devices */
- xf86AccessInit();
-
- /* Call all of the probe functions, reporting the results. */
- for (i = 0; i < xf86NumDrivers; i++) {
- if (xf86DriverList[i]->Probe == NULL) continue;
-
- xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n",
- xf86DriverList[i]->driverName);
- probeResult =
- (*xf86DriverList[i]->Probe)(xf86DriverList[i], PROBE_DETECT);
- if (!probeResult) {
- xf86ErrorF("Probe in driver `%s' returns FALSE\n",
- xf86DriverList[i]->driverName);
- } else {
- xf86ErrorF("Probe in driver `%s' returns TRUE\n",
- xf86DriverList[i]->driverName);
-
- /* If we have a result, then call driver's Identify function */
- if (xf86DriverList[i]->Identify != NULL) {
- int verbose = xf86SetVerbosity(1);
- (*xf86DriverList[i]->Identify)(0);
- xf86SetVerbosity(verbose);
- }
- }
- }
-
- OsCleanup(TRUE);
- AbortDDX();
- fflush(stderr);
- exit(0);
-}
diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c
deleted file mode 100644
index 8938c1d96..000000000
--- a/hw/xfree86/common/xf86DoScanPci.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.15 2003/09/23 06:43:46 dawes Exp $ */
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Finish setting up the server.
- * Call the functions from the scanpci module.
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include "X.h"
-#include "Xmd.h"
-#include "os.h"
-#ifdef XFree86LOADER
-#include "loaderProcs.h"
-#endif
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Pci.h"
-#include "xf86ScanPci.h"
-
-
-void DoScanPci(int argc, char **argv, int i)
-{
- int j,skip,globalVerbose,scanpciVerbose;
- ScanPciSetupProcPtr PciSetup;
- ScanPciDisplayCardInfoProcPtr DisplayPCICardInfo;
-#ifdef XFree86LOADER
- int errmaj, errmin;
-#endif
-
- /*
- * first we need to finish setup of the OS so that we can call other
- * functions in the server
- */
- OsInit();
-
- /*
- * The old verbosity processing that was here isn't useful anymore, but
- * for compatibility purposes, ignore verbosity changes after the -scanpci
- * flag.
- */
- globalVerbose = xf86Verbose;
-
- /*
- * next we process the arguments that are remaining on the command line,
- * so that things like the module path can be set there
- */
- for ( j = i+1; j < argc; j++ ) {
- if ((skip = ddxProcessArgument(argc, argv, j)))
- j += (skip - 1);
- }
-
- /*
- * Was the verbosity level increased? If so, set it back.
- */
- if (xf86Verbose > globalVerbose)
- xf86SetVerbosity(globalVerbose);
-
- /*
- * Setting scanpciVerbose to 0 will ensure that the output will go to
- * stderr for all reasonable default stderr verbosity levels.
- */
- scanpciVerbose = 0;
-
- /*
- * now get the loader set up and load the scanpci module
- */
-#ifdef XFree86LOADER
- /* Initialise the loader */
- LoaderInit();
- /* Tell the loader the default module search path */
- LoaderSetPath(xf86ModulePath);
-
- if (!LoadModule("scanpci", NULL, NULL, NULL, NULL, NULL,
- &errmaj, &errmin)) {
- LoaderErrorMsg(NULL, "scanpci", errmaj, errmin);
- exit(1);
- }
- if (LoaderCheckUnresolved(LD_RESOLV_IFDONE)) {
- /* For now, just a warning */
- xf86Msg(X_WARNING, "Some symbols could not be resolved!\n");
- }
- PciSetup = (ScanPciSetupProcPtr)LoaderSymbol("ScanPciSetupPciIds");
- DisplayPCICardInfo =
- (ScanPciDisplayCardInfoProcPtr)LoaderSymbol("ScanPciDisplayPCICardInfo");
-#else
- PciSetup = ScanPciSetupPciIds;
- DisplayPCICardInfo = ScanPciDisplayPCICardInfo;
-#endif
-
- if (!(*PciSetup)())
- FatalError("ScanPciSetupPciIds() failed\n");
- (*DisplayPCICardInfo)(scanpciVerbose);
-
- /*
- * That's it; we really should clean things up, but a simple
- * exit seems to be all we need.
- */
- exit(0);
-}
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
deleted file mode 100644
index 1c3f3a34f..000000000
--- a/hw/xfree86/common/xf86Events.c
+++ /dev/null
@@ -1,1627 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.158 2003/11/03 05:11:02 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
-
-/* [JCH-96/01/21] Extended std reverse map to four buttons. */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include "X.h"
-#include "Xpoll.h"
-#include "Xproto.h"
-#include "misc.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-
-
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#else
-#include "inputstr.h"
-#endif
-#include "xf86Xinput.h"
-
-#include "mi.h"
-#include "mipointer.h"
-
-#ifdef XF86BIGFONT
-#define _XF86BIGFONT_SERVER_
-#include "xf86bigfont.h"
-#endif
-
-#ifdef XKB
-extern Bool noXkbExtension;
-#endif
-
-#define XE_POINTER 1
-#define XE_KEYBOARD 2
-
-#ifdef XINPUT
-#define __EqEnqueue(ev) xf86eqEnqueue(ev)
-#else
-#define __EqEnqueue(ev) mieqEnqueue(ev)
-#endif
-
-#define EqEnqueue(ev) { \
- int __sigstate = xf86BlockSIGIO (); \
- __EqEnqueue (ev); \
- xf86UnblockSIGIO(__sigstate); \
-}
-
-#ifdef XTESTEXT1
-
-#define XTestSERVER_SIDE
-#include "xtestext1.h"
-extern short xtest_mousex;
-extern short xtest_mousey;
-extern int on_steal_input;
-extern Bool XTestStealKeyData();
-extern void XTestStealMotionData();
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- if (!on_steal_input || \
- XTestStealKeyData((ev)->u.u.detail, (ev)->u.u.type, dev_type, \
- xtest_mousex, xtest_mousey)) \
- EqEnqueue((ev))
-#else /* ! XTESTEXT1 */
-
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- EqEnqueue((ev))
-
-#endif
-
-/*
- * The first of many hacks to get VT switching to work under
- * Solaris 2.1 for x86. The basic problem is that Solaris is supposed
- * to be SVR4. It is for the most part, except where the video interface
- * is concerned. These hacks work around those problems.
- * See the comments for Linux, and SCO.
- *
- * This is a toggling variable:
- * FALSE = No VT switching keys have been pressed last time around
- * TRUE = Possible VT switch Pending
- * (DWH - 12/2/93)
- *
- * This has been generalised to work with Linux and *BSD+syscons (DHD)
- */
-
-#ifdef USE_VT_SYSREQ
-Bool VTSysreqToggle = FALSE;
-#endif /* !USE_VT_SYSREQ */
-Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
- *BSD and for avoiding VT
- switches when using the DRI
- automatic full screen mode.*/
-
-extern fd_set EnabledDevices;
-
-#if defined(XQUEUE)
-extern void xf86XqueRequest(void);
-#endif
-extern void (*xf86OSPMClose)(void);
-
-static void xf86VTSwitch(void);
-
-/*
- * Allow arbitrary drivers or other XFree86 code to register with our main
- * Wakeup handler.
- */
-typedef struct x_IHRec {
- int fd;
- InputHandlerProc ihproc;
- pointer data;
- Bool enabled;
- struct x_IHRec * next;
-} IHRec, *IHPtr;
-
-static IHPtr InputHandlers = NULL;
-
-
-/*
- * TimeSinceLastInputEvent --
- * Function used for screensaver purposes by the os module. Returns the
- * time in milliseconds since there last was any input.
- */
-
-int
-TimeSinceLastInputEvent()
-{
- if (xf86Info.lastEventTime == 0) {
- xf86Info.lastEventTime = GetTimeInMillis();
- }
- return GetTimeInMillis() - xf86Info.lastEventTime;
-}
-
-
-
-/*
- * SetTimeSinceLastInputEvent --
- * Set the lastEventTime to now.
- */
-
-void
-SetTimeSinceLastInputEvent()
-{
- xf86Info.lastEventTime = GetTimeInMillis();
-}
-
-
-
-/*
- * ProcessInputEvents --
- * Retrieve all waiting input events and pass them to DIX in their
- * correct chronological order. Only reads from the system pointer
- * and keyboard.
- */
-
-void
-ProcessInputEvents ()
-{
- int x, y;
-#ifdef INHERIT_LOCK_STATE
- static int generation = 0;
-#endif
-
- /*
- * With INHERIT_LOCK_STATE defined, the initial state of CapsLock, NumLock
- * and ScrollLock will be set to match that of the VT the server is
- * running on.
- */
-#ifdef INHERIT_LOCK_STATE
- if (generation != serverGeneration) {
- xEvent kevent;
- DevicePtr pKeyboard = xf86Info.pKeyboard;
- extern unsigned int xf86InitialCaps, xf86InitialNum, xf86InitialScroll;
-
- generation = serverGeneration;
- kevent.u.keyButtonPointer.time = GetTimeInMillis();
- kevent.u.keyButtonPointer.rootX = 0;
- kevent.u.keyButtonPointer.rootY = 0;
- kevent.u.u.type = KeyPress;
-
-
- if (xf86InitialCaps) {
- kevent.u.u.detail = xf86InitialCaps;
- (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1);
- xf86InitialCaps = 0;
- }
- if (xf86InitialNum) {
- kevent.u.u.detail = xf86InitialNum;
- (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1);
- xf86InitialNum = 0;
- }
- if (xf86InitialScroll) {
- kevent.u.u.detail = xf86InitialScroll;
- (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1);
- xf86InitialScroll = 0;
- }
- }
-#endif
-
- xf86Info.inputPending = FALSE;
-
-#ifdef XINPUT
- xf86eqProcessInputEvents();
-#else
- mieqProcessInputEvents();
-#endif
- miPointerUpdate();
-
- miPointerPosition(&x, &y);
- xf86SetViewport(xf86Info.currentScreen, x, y);
-}
-
-void
-xf86GrabServerCallback(CallbackListPtr *callbacks, pointer data, pointer args)
-{
- ServerGrabInfoRec *grab = (ServerGrabInfoRec*)args;
-
- xf86Info.grabInfo.server.client = grab->client;
- xf86Info.grabInfo.server.grabstate = grab->grabstate;
-}
-
-/*
- * Handle keyboard events that cause some kind of "action"
- * (i.e., server termination, video mode changes, VT switches, etc.)
- */
-void
-xf86ProcessActionEvent(ActionEvent action, void *arg)
-{
-#ifdef DEBUG
- ErrorF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
-#endif
- switch (action) {
- case ACTION_TERMINATE:
- if (!xf86Info.dontZap) {
-#ifdef XFreeXDGA
- DGAShutdown();
-#endif
- GiveUp(0);
- }
- break;
- case ACTION_NEXT_MODE:
- if (!xf86Info.dontZoom)
- xf86ZoomViewport(xf86Info.currentScreen, 1);
- break;
- case ACTION_PREV_MODE:
- if (!xf86Info.dontZoom)
- xf86ZoomViewport(xf86Info.currentScreen, -1);
- break;
- case ACTION_DISABLEGRAB:
- if (!xf86Info.grabInfo.disabled && xf86Info.grabInfo.allowDeactivate) {
- if (inputInfo.pointer && inputInfo.pointer->grab != NULL &&
- inputInfo.pointer->DeactivateGrab)
- inputInfo.pointer->DeactivateGrab(inputInfo.pointer);
- if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL &&
- inputInfo.keyboard->DeactivateGrab)
- inputInfo.keyboard->DeactivateGrab(inputInfo.keyboard);
- }
- break;
- case ACTION_CLOSECLIENT:
- if (!xf86Info.grabInfo.disabled && xf86Info.grabInfo.allowClosedown) {
- ClientPtr pointer, keyboard, server;
-
- pointer = keyboard = server = NULL;
- if (inputInfo.pointer && inputInfo.pointer->grab != NULL)
- pointer = clients[CLIENT_ID(inputInfo.pointer->grab->resource)];
- if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL) {
- keyboard = clients[CLIENT_ID(inputInfo.keyboard->grab->resource)];
- if (keyboard == pointer)
- keyboard = NULL;
- }
- if ((xf86Info.grabInfo.server.grabstate == SERVER_GRABBED) &&
- (((server = xf86Info.grabInfo.server.client) == pointer) ||
- (server == keyboard)))
- server = NULL;
-
- if (pointer)
- CloseDownClient(pointer);
- if (keyboard)
- CloseDownClient(keyboard);
- if (server)
- CloseDownClient(server);
- }
- break;
-#if !defined(__SOL8__) && !defined(__UNIXOS2__) && !defined(sgi) && \
- (!defined(sun) || defined(i386))
- case ACTION_SWITCHSCREEN:
- if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
- int vtno = *((int *) arg);
-#ifdef SCO
- vtno--;
-#endif
-#if defined(QNX4)
- xf86Info.vtRequestsPending = vtno;
-#else
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0)
- ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
-#endif
- }
- break;
- case ACTION_SWITCHSCREEN_NEXT:
- if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
-#if defined(SCO) /* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
-#else
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0)
-#endif
-#if defined (SCO) || (defined(sun) && defined (i386) && defined (SVR4))
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0)
-#else
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0)
-#endif
- ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
- }
- break;
- case ACTION_SWITCHSCREEN_PREV:
- if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0)
- ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
- }
- break;
-#endif
- case ACTION_MESSAGE:
- {
- char *retstr, *message = (char *) arg;
- ScrnInfoPtr pScr = XF86SCRNINFO(xf86Info.currentScreen);
-
-#ifdef DEBUG
- ErrorF("ActionMessage: '%s'\n", message);
-#endif
- /* Okay the message made it to the ddx. The common layer */
- /* can check for relevant messages here and react to any */
- /* that have a global effect. For example: */
- /* */
- /* if (!strcmp(message, "foo") { */
- /* do_foo(); break */
- /* } */
- /* */
- /* otherwise fallback to sending a key event message to */
- /* the current screen's driver: */
- if (*pScr->HandleMessage) {
- (void) (*pScr->HandleMessage)(pScr->scrnIndex,
- "KeyEventMessage", message, &retstr);
- }
- }
- break;
- default:
- break;
- }
-}
-
-/*
- * xf86PostKbdEvent --
- * Translate the raw hardware KbdEvent into an XEvent, and tell DIX
- * about it. Scancode preprocessing and so on is done ...
- *
- * OS/2 specific xf86PostKbdEvent(key) has been moved to os-support/os2/os2_kbd.c
- * as some things differ, and I did not want to scatter this routine with
- * ifdefs further (hv).
- */
-
-#ifdef __linux__
-extern u_char SpecialServerMap[];
-#endif
-
-#if !defined(__UNIXOS2__) && \
- !defined(__SOL8__) && \
- (!defined(sun) || defined(i386))
-void
-xf86PostKbdEvent(unsigned key)
-{
- int scanCode = (key & 0x7f);
- int specialkey = 0;
- Bool down = (key & 0x80 ? FALSE : TRUE);
- KeyClassRec *keyc = ((DeviceIntPtr)xf86Info.pKeyboard)->key;
- Bool updateLeds = FALSE;
- Bool UsePrefix = FALSE;
- Bool Direction = FALSE;
- xEvent kevent;
- KeySym *keysym;
- int keycode;
- static int lockkeys = 0;
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
- static Bool first_time = TRUE;
-#endif
-#if defined(__sparc__) && defined(__linux__)
- static int kbdSun = -1;
-#endif
- /* Disable any keyboard processing while in suspend */
- if (xf86inSuspend)
- return;
-
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
- if (first_time)
- {
- first_time = FALSE;
- VTSwitchEnabled = (xf86Info.consType == SYSCONS)
- || (xf86Info.consType == PCVT);
- }
-#endif
-
-#if defined (__sparc__) && defined(__linux__)
- if (kbdSun == -1) {
- if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun"))
- || (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun")))
- kbdSun = 1;
- else
- kbdSun = 0;
- }
- if (kbdSun)
- goto special;
-#endif /* __sparc__ && __linux__ */
-
-#ifdef __linux__
- if (xf86Info.kbdCustomKeycodes) {
- specialkey = SpecialServerMap[scanCode];
- goto customkeycodes;
- }
-#endif
-
- /*
- * First do some special scancode remapping ...
- */
- if (xf86Info.scanPrefix == 0) {
-
- switch (scanCode) {
- case KEY_Prefix0:
- case KEY_Prefix1:
-#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
- if (xf86Info.consType == PCCONS || xf86Info.consType == SYSCONS
- || xf86Info.consType == PCVT
-#ifdef WSCONS_SUPPORT
- || (xf86Info.consType == WSCONS && xf86Info.kbdEvents != xf86WSKbdEvents)
-#endif
- ) {
-#endif
- xf86Info.scanPrefix = scanCode; /* special prefixes */
- return;
-#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
- }
- break;
-#endif
- }
-#if defined (i386) && defined (SVR4)
- /*
- * PANIX returns DICOP standards based keycodes in using 106jp
- * keyboard. We need to remap some keys.
- */
- if(xf86Info.panix106 == TRUE){
- switch (scanCode) {
- case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
- case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
- case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
- case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
- case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
- case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
- case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
- case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
- }
- } else
-#endif /* i386 && SVR4 */
- {
- switch (scanCode) {
- case 0x59: scanCode = KEY_0x59; break;
- case 0x5a: scanCode = KEY_0x5A; break;
- case 0x5b: scanCode = KEY_0x5B; break;
- case 0x5c: scanCode = KEY_KP_Equal; break; /* Keypad Equal */
- case 0x5d: scanCode = KEY_0x5D; break;
- case 0x5e: scanCode = KEY_0x5E; break;
- case 0x5f: scanCode = KEY_0x5F; break;
- case 0x62: scanCode = KEY_0x62; break;
- case 0x63: scanCode = KEY_0x63; break;
- case 0x64: scanCode = KEY_0x64; break;
- case 0x65: scanCode = KEY_0x65; break;
- case 0x66: scanCode = KEY_0x66; break;
- case 0x67: scanCode = KEY_0x67; break;
- case 0x68: scanCode = KEY_0x68; break;
- case 0x69: scanCode = KEY_0x69; break;
- case 0x6a: scanCode = KEY_0x6A; break;
- case 0x6b: scanCode = KEY_0x6B; break;
- case 0x6c: scanCode = KEY_0x6C; break;
- case 0x6d: scanCode = KEY_0x6D; break;
- case 0x6e: scanCode = KEY_0x6E; break;
- case 0x6f: scanCode = KEY_0x6F; break;
- case 0x70: scanCode = KEY_0x70; break;
- case 0x71: scanCode = KEY_0x71; break;
- case 0x72: scanCode = KEY_0x72; break;
- case 0x73: scanCode = KEY_0x73; break;
- case 0x74: scanCode = KEY_0x74; break;
- case 0x75: scanCode = KEY_0x75; break;
- case 0x76: scanCode = KEY_0x76; break;
- }
- }
- }
-
- else if (
-#ifdef CSRG_BASED
- (xf86Info.consType == PCCONS || xf86Info.consType == SYSCONS
- || xf86Info.consType == PCVT
-#ifdef WSCONS_SUPPORT
- || (xf86Info.consType == WSCONS && xf86Info.kbdEvents !=
- xf86WSKbdEvents)
-#endif
- ) &&
-#endif
- (xf86Info.scanPrefix == KEY_Prefix0)) {
- xf86Info.scanPrefix = 0;
-
- switch (scanCode) {
- case KEY_KP_7: scanCode = KEY_Home; break; /* curs home */
- case KEY_KP_8: scanCode = KEY_Up; break; /* curs up */
- case KEY_KP_9: scanCode = KEY_PgUp; break; /* curs pgup */
- case KEY_KP_4: scanCode = KEY_Left; break; /* curs left */
- case KEY_KP_5: scanCode = KEY_Begin; break; /* curs begin */
- case KEY_KP_6: scanCode = KEY_Right; break; /* curs right */
- case KEY_KP_1: scanCode = KEY_End; break; /* curs end */
- case KEY_KP_2: scanCode = KEY_Down; break; /* curs down */
- case KEY_KP_3: scanCode = KEY_PgDown; break; /* curs pgdown */
- case KEY_KP_0: scanCode = KEY_Insert; break; /* curs insert */
- case KEY_KP_Decimal: scanCode = KEY_Delete; break; /* curs delete */
- case KEY_Enter: scanCode = KEY_KP_Enter; break; /* keypad enter */
- case KEY_LCtrl: scanCode = KEY_RCtrl; break; /* right ctrl */
- case KEY_KP_Multiply: scanCode = KEY_Print; break; /* print */
- case KEY_Slash: scanCode = KEY_KP_Divide; break; /* keyp divide */
- case KEY_Alt: scanCode = KEY_AltLang; break; /* right alt */
- case KEY_ScrollLock: scanCode = KEY_Break; break; /* curs break */
- case 0x5b: scanCode = KEY_LMeta; break;
- case 0x5c: scanCode = KEY_RMeta; break;
- case 0x5d: scanCode = KEY_Menu; break;
- case KEY_F3: scanCode = KEY_F13; break;
- case KEY_F4: scanCode = KEY_F14; break;
- case KEY_F5: scanCode = KEY_F15; break;
- case KEY_F6: scanCode = KEY_F16; break;
- case KEY_F7: scanCode = KEY_F17; break;
- case KEY_KP_Plus: scanCode = KEY_KP_DEC; break;
- /*
- * Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6)
- */
- case 0x2A:
- case 0x36:
- return;
- default:
- xf86MsgVerb(X_INFO, 4, "Unreported Prefix0 scancode: 0x%02x\n",
- scanCode);
- /*
- * "Internet" keyboards are generating lots of new codes. Let them
- * pass. There is little consistency between them, so don't bother
- * with symbolic names at this level.
- */
- scanCode += 0x78;
- }
- }
-
- else if (xf86Info.scanPrefix == KEY_Prefix1)
- {
- xf86Info.scanPrefix = (scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
- return;
- }
-
- else if (xf86Info.scanPrefix == KEY_LCtrl)
- {
- xf86Info.scanPrefix = 0;
- if (scanCode != KEY_NumLock) return;
- scanCode = KEY_Pause; /* pause */
- }
-
-#ifndef __sparc64__
- /*
- * PC keyboards generate separate key codes for
- * Alt+Print and Control+Pause but in the X keyboard model
- * they need to get the same key code as the base key on the same
- * physical keyboard key.
- */
- if (scanCode == KEY_SysReqest)
- scanCode = KEY_Print;
- else if (scanCode == KEY_Break)
- scanCode = KEY_Pause;
-#endif
-
- /*
- * and now get some special keysequences
- */
-
- specialkey = scanCode;
-
-#ifdef __linux__
-customkeycodes:
-#endif
-#if defined(i386) || defined(__i386__)
- if (xf86IsPc98()) {
- switch (scanCode) {
- case 0x0e: specialkey = 0x0e; break; /* KEY_BackSpace */
- case 0x40: specialkey = 0x4a; break; /* KEY_KP_Minus */
- case 0x49: specialkey = 0x4e; break; /* KEY_KP_Plus */
-
- /* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
-
- case 0x62: specialkey = 0x3b; break; /* KEY_F1 */
- case 0x63: specialkey = 0x3c; break; /* KEY_F2 */
- case 0x64: specialkey = 0x3d; break; /* KEY_F3 */
- case 0x65: specialkey = 0x3e; break; /* KEY_F4 */
- case 0x66: specialkey = 0x3f; break; /* KEY_F5 */
- case 0x67: specialkey = 0x40; break; /* KEY_F6 */
- case 0x68: specialkey = 0x41; break; /* KEY_F7 */
- case 0x69: specialkey = 0x42; break; /* KEY_F8 */
- case 0x6a: specialkey = 0x43; break; /* KEY_F9 */
- case 0x6b: specialkey = 0x44; break; /* KEY_F10 */
- /* case 0x73: specialkey = 0x38; break; KEY_Alt */
- /* case 0x74: specialkey = 0x1d; break; KEY_LCtrl */
- default: specialkey = 0x00; break;
- }
- }
-#endif
-#if defined (__sparc__) && defined(__linux__)
-special:
- if (kbdSun) {
- switch (scanCode) {
- case 0x2b: specialkey = KEY_BackSpace; break;
- case 0x47: specialkey = KEY_KP_Minus; break;
- case 0x7d: specialkey = KEY_KP_Plus; break;
-
- /* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
-
- case 0x05: specialkey = KEY_F1; break;
- case 0x06: specialkey = KEY_F2; break;
- case 0x08: specialkey = KEY_F3; break;
- case 0x0a: specialkey = KEY_F4; break;
- case 0x0c: specialkey = KEY_F5; break;
- case 0x0e: specialkey = KEY_F6; break;
- case 0x10: specialkey = KEY_F7; break;
- case 0x11: specialkey = KEY_F8; break;
- case 0x12: specialkey = KEY_F9; break;
- case 0x07: specialkey = KEY_F10; break;
- case 0x09: specialkey = KEY_F11; break;
- case 0x0b: specialkey = KEY_F12; break;
- default: specialkey = 0; break;
- }
- /*
- * XXX XXX XXX:
- *
- * I really don't know what's wrong here, but passing the real
- * scanCode offsets by one from XKB's point of view.
- *
- * (ecd@skynet.be, 980405)
- */
- scanCode--;
- }
-#endif /* defined (__sparc__) && defined(__linux__) */
-
-#ifdef XKB
- if ((xf86Info.ddxSpecialKeys == SKWhenNeeded &&
- !xf86Info.ActionKeyBindingsSet) ||
- noXkbExtension || xf86Info.ddxSpecialKeys == SKAlways) {
-#endif
- if (!(ModifierDown(ShiftMask)) &&
- ((ModifierDown(ControlMask | AltMask)) ||
- (ModifierDown(ControlMask | AltLangMask))))
- {
- switch (specialkey) {
-
- case KEY_BackSpace:
- xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
- break;
-
- /*
- * Check grabs
- */
- case KEY_KP_Divide:
- xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
- break;
- case KEY_KP_Multiply:
- xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
- break;
-
- /*
- * Video mode switches
- */
- case KEY_KP_Minus: /* Keypad - */
- if (down) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
- if (!xf86Info.dontZoom) return;
- break;
-
- case KEY_KP_Plus: /* Keypad + */
- if (down) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
- if (!xf86Info.dontZoom) return;
- break;
-
- /* Under QNX4, we set the vtPending flag for VT switching and
- * let the VT switch function do the rest...
- * This is a little different from the other OS'es.
- */
-#if defined(QNX4)
- case KEY_1:
- case KEY_2:
- case KEY_3:
- case KEY_4:
- case KEY_5:
- case KEY_6:
- case KEY_7:
- case KEY_8:
- case KEY_9:
- if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
- if (down) {
- int vtno = specialkey - KEY_1 + 1;
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
- }
- return;
- }
- break;
-#endif
-
-#if defined(linux) || (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT))) || defined(SCO)
- /*
- * Under Linux, the raw keycodes are consumed before the kernel
- * does any processing on them, so we must emulate the vt switching
- * we want ourselves.
- */
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- case KEY_F11:
- case KEY_F12:
- if ((VTSwitchEnabled && !xf86Info.vtSysreq && !xf86Info.dontVTSwitch)
-#if (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)))
- && (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
-#endif
- ) {
- int vtno = specialkey - KEY_F1 + 1;
- if (specialkey == KEY_F11 || specialkey == KEY_F12)
- vtno = specialkey - KEY_F11 + 11;
- if (down)
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
- return;
- }
- break;
-#endif /* linux || BSD with VTs */
-
- /* just worth mentioning here: any 386bsd keyboard driver
- * (pccons.c or co_kbd.c) catches CTRL-ALT-DEL and CTRL-ALT-ESC
- * before any application (e.g. XF86) will see it
- * OBS: syscons does not, nor does pcvt !
- */
- }
- }
-
- /*
- * Start of actual Solaris VT switching code.
- * This should pretty much emulate standard SVR4 switching keys.
- *
- * DWH 12/2/93
- */
-
-#ifdef USE_VT_SYSREQ
- if (VTSwitchEnabled && xf86Info.vtSysreq && !xf86Info.dontVTSwitch)
- {
- switch (specialkey)
- {
- /*
- * syscons on *BSD doesn't have a VT #0 -- don't think Linux does
- * either
- */
-#if defined (sun) && defined (i386) && defined (SVR4)
- case KEY_H:
- if (VTSysreqToggle && down)
- {
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN, NULL);
- VTSysreqToggle = 0;
- return;
- }
- break;
-
- /*
- * Yah, I know the N, and P keys seem backwards, however that's
- * how they work under Solaris
- * XXXX N means go to next active VT not necessarily vtno+1 (or vtno-1)
- */
-
- case KEY_N:
- if (VTSysreqToggle && down)
- {
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
- VTSysreqToggle = FALSE;
- return;
- }
- break;
-
- case KEY_P:
- if (VTSysreqToggle && down)
- {
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
- VTSysreqToggle = FALSE;
- return;
- }
- break;
-#endif
-
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- case KEY_F11:
- case KEY_F12:
- if (VTSysreqToggle && down)
- { int vtno = specialkey - KEY_F1 + 1;
- if (specialkey == KEY_F11 || specialkey == KEY_F12)
- vtno = specialkey - KEY_F11 + 11;
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
- VTSysreqToggle = FALSE;
- return;
- }
- break;
-
- /* Ignore these keys -- ie don't let them cancel an alt-sysreq */
- case KEY_Alt:
- case KEY_AltLang:
- break;
-
- case KEY_SysReqest:
- if (down && (ModifierDown(AltMask) || ModifierDown(AltLangMask)))
- VTSysreqToggle = TRUE;
- break;
-
- default:
- if (VTSysreqToggle)
- {
- /*
- * We only land here when Alt-SysReq is followed by a
- * non-switching key.
- */
- VTSysreqToggle = FALSE;
-
- }
- }
- }
-
-#endif /* USE_VT_SYSREQ */
-
-#ifdef SCO
- /*
- * With the console in raw mode, SCO will not switch consoles,
- * you get around this by activating the next console along, if
- * this fails then go back to console 0, if there is only one
- * then it doesn't matter, switching to yourself is a nop as far
- * as the console driver is concerned.
- * We could do something similar to linux here but SCO ODT uses
- * Ctrl-PrintScrn, so why change?
- */
- if (specialkey == KEY_Print && ModifierDown(ControlMask)) {
- if (down)
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL);
- return;
- }
-#endif /* SCO */
-#ifdef XKB
- }
-#endif
-
- /*
- * Now map the scancodes to real X-keycodes ...
- */
- keycode = scanCode + MIN_KEYCODE;
- keysym = (keyc->curKeySyms.map +
- keyc->curKeySyms.mapWidth *
- (keycode - keyc->curKeySyms.minKeyCode));
-#ifdef XKB
- if (noXkbExtension) {
-#endif
- /*
- * Filter autorepeated caps/num/scroll lock keycodes.
- */
-#define CAPSFLAG 0x01
-#define NUMFLAG 0x02
-#define SCROLLFLAG 0x04
-#define MODEFLAG 0x08
- if( down ) {
- switch( keysym[0] ) {
- case XK_Caps_Lock :
- if (lockkeys & CAPSFLAG)
- return;
- else
- lockkeys |= CAPSFLAG;
- break;
-
- case XK_Num_Lock :
- if (lockkeys & NUMFLAG)
- return;
- else
- lockkeys |= NUMFLAG;
- break;
-
- case XK_Scroll_Lock :
- if (lockkeys & SCROLLFLAG)
- return;
- else
- lockkeys |= SCROLLFLAG;
- break;
- }
- if (keysym[1] == XF86XK_ModeLock)
- {
- if (lockkeys & MODEFLAG)
- return;
- else
- lockkeys |= MODEFLAG;
- }
-
- }
- else {
- switch( keysym[0] ) {
- case XK_Caps_Lock :
- lockkeys &= ~CAPSFLAG;
- break;
-
- case XK_Num_Lock :
- lockkeys &= ~NUMFLAG;
- break;
-
- case XK_Scroll_Lock :
- lockkeys &= ~SCROLLFLAG;
- break;
- }
- if (keysym[1] == XF86XK_ModeLock)
- lockkeys &= ~MODEFLAG;
- }
-
- /*
- * LockKey special handling:
- * ignore releases, toggle on & off on presses.
- * Don't deal with the Caps_Lock keysym directly, but check the lock modifier
- */
- if (keyc->modifierMap[keycode] & LockMask ||
- keysym[0] == XK_Scroll_Lock ||
- keysym[1] == XF86XK_ModeLock ||
- keysym[0] == XK_Num_Lock)
- {
- Bool flag;
-
- if (!down) return;
- if (KeyPressed(keycode)) {
- down = !down;
- flag = FALSE;
- }
- else
- flag = TRUE;
-
- if (keyc->modifierMap[keycode] & LockMask) xf86Info.capsLock = flag;
- if (keysym[0] == XK_Num_Lock) xf86Info.numLock = flag;
- if (keysym[0] == XK_Scroll_Lock) xf86Info.scrollLock = flag;
- if (keysym[1] == XF86XK_ModeLock) xf86Info.modeSwitchLock = flag;
- updateLeds = TRUE;
- }
-
- if (!xf86Info.kbdCustomKeycodes) {
- /*
- * normal, non-keypad keys
- */
- if (scanCode < KEY_KP_7 || scanCode > KEY_KP_Decimal) {
-#if !defined(CSRG_BASED) && \
- !defined(__GNU__) && \
- defined(KB_84)
- /*
- * magic ALT_L key on AT84 keyboards for multilingual support
- */
- if (xf86Info.kbdType == KB_84 &&
- ModifierDown(AltMask) &&
- keysym[2] != NoSymbol)
- {
- UsePrefix = TRUE;
- Direction = TRUE;
- }
-#endif /* !CSRG_BASED && ... */
- }
- }
- if (updateLeds) xf86UpdateKbdLeds();
-#ifdef XKB
- }
-#endif
-
- /*
- * check for an autorepeat-event
- */
- if (down && KeyPressed(keycode)) {
- KbdFeedbackClassRec *kbdfeed = ((DeviceIntPtr)xf86Info.pKeyboard)->kbdfeed;
- if ((xf86Info.autoRepeat != AutoRepeatModeOn) ||
- keyc->modifierMap[keycode] ||
- (kbdfeed && !(kbdfeed->ctrl.autoRepeats[keycode>>3] & ( 1<<(keycode&7) ))))
- return;
- }
-
-
- xf86Info.lastEventTime = kevent.u.keyButtonPointer.time = GetTimeInMillis();
- /*
- * And now send these prefixes ...
- * NOTE: There cannot be multiple Mode_Switch keys !!!!
- */
- if (UsePrefix)
- {
- ENQUEUE(&kevent,
- keyc->modifierKeyMap[keyc->maxKeysPerModifier*7],
- (Direction ? KeyPress : KeyRelease),
- XE_KEYBOARD);
- ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
- ENQUEUE(&kevent,
- keyc->modifierKeyMap[keyc->maxKeysPerModifier*7],
- (Direction ? KeyRelease : KeyPress),
- XE_KEYBOARD);
- }
- else
- {
- ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
- }
-}
-#endif /* !__UNIXOS2__ */
-
-#define ModifierIsSet(k) ((modifiers & (k)) == (k))
-
-Bool
-xf86CommonSpecialKey(int key, Bool down, int modifiers)
-{
- if ((ModifierIsSet(ControlMask | AltMask)) ||
- (ModifierIsSet(ControlMask | AltLangMask))) {
- switch (key) {
-
- case KEY_BackSpace:
- xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
- break;
-
- /*
- * Check grabs
- */
- case KEY_KP_Divide:
- xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
- break;
- case KEY_KP_Multiply:
- xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
- break;
-
- /*
- * The idea here is to pass the scancode down to a list of
- * registered routines. There should be some standard conventions
- * for processing certain keys.
- */
- case KEY_KP_Minus: /* Keypad - */
- if (down) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
- if (!xf86Info.dontZoom) return TRUE;
- break;
-
- case KEY_KP_Plus: /* Keypad + */
- if (down) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
- if (!xf86Info.dontZoom) return TRUE;
- break;
- }
- }
- return FALSE;
-}
-
-/*
- * xf86Wakeup --
- * Os wakeup handler.
- */
-
-/* ARGSUSED */
-void
-xf86Wakeup(pointer blockData, int err, pointer pReadmask)
-{
-#if !defined(__UNIXOS2__) && !defined(__QNX__)
- fd_set* LastSelectMask = (fd_set*)pReadmask;
- fd_set devicesWithInput;
- InputInfoPtr pInfo;
-
- if (err >= 0) {
-
- XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices);
- if (XFD_ANYSET(&devicesWithInput)) {
- if (xf86Info.kbdEvents)
- (xf86Info.kbdEvents)();
- pInfo = xf86InputDevs;
- while (pInfo) {
- if (pInfo->read_input && pInfo->fd >= 0 &&
- (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
- int sigstate = xf86BlockSIGIO();
-
- pInfo->read_input(pInfo);
- xf86UnblockSIGIO(sigstate);
- /*
- * Remove the descriptior from the set because more than one
- * device may share the same file descriptor.
- */
- FD_CLR(pInfo->fd, &devicesWithInput);
- }
- pInfo = pInfo->next;
- }
- }
- }
-#else /* __UNIXOS2__ and __QNX__ */
-
- InputInfoPtr pInfo;
-
- (xf86Info.kbdEvents)(); /* Under OS/2 and QNX, always call */
-
- pInfo = xf86InputDevs;
- while (pInfo) {
- if (pInfo->read_input && pInfo->fd >= 0) {
- int sigstate = xf86BlockSIGIO();
-
- pInfo->read_input(pInfo);
- xf86UnblockSIGIO(sigstate);
- /*
- * Must break here because more than one device may share
- * the same file descriptor.
- */
- break;
- }
- pInfo = pInfo->next;
- }
-
-#endif /* __UNIXOS2__ and __QNX__ */
-
- if (err >= 0) { /* we don't want the handlers called if select() */
- IHPtr ih; /* returned with an error condition, do we? */
-
- for (ih = InputHandlers; ih; ih = ih->next) {
- if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
- (FD_ISSET(ih->fd, ((fd_set *)pReadmask)) != 0)) {
- ih->ihproc(ih->fd, ih->data);
- }
- }
- }
-
- if (xf86VTSwitchPending()) xf86VTSwitch();
-
- if (xf86Info.inputPending) ProcessInputEvents();
-}
-
-
-/*
- * xf86SigioReadInput --
- * signal handler for the SIGIO signal.
- */
-static void
-xf86SigioReadInput(int fd,
- void *closure)
-{
- int sigstate = xf86BlockSIGIO();
- InputInfoPtr pInfo = (InputInfoPtr) closure;
-
- pInfo->read_input(pInfo);
-
- xf86UnblockSIGIO(sigstate);
-}
-
-/*
- * xf86AddEnabledDevice --
- *
- */
-void
-xf86AddEnabledDevice(InputInfoPtr pInfo)
-{
- if (!xf86InstallSIGIOHandler (pInfo->fd, xf86SigioReadInput, pInfo)) {
- AddEnabledDevice(pInfo->fd);
- }
-}
-
-/*
- * xf86RemoveEnabledDevice --
- *
- */
-void
-xf86RemoveEnabledDevice(InputInfoPtr pInfo)
-{
- if (!xf86RemoveSIGIOHandler (pInfo->fd)) {
- RemoveEnabledDevice(pInfo->fd);
- }
-}
-
-static int *xf86SignalIntercept = NULL;
-
-void
-xf86InterceptSignals(int *signo)
-{
- if ((xf86SignalIntercept = signo))
- *signo = -1;
-}
-
-/*
- * xf86SigHandler --
- * Catch unexpected signals and exit or continue cleanly.
- */
-void
-xf86SigHandler(int signo)
-{
- if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
- /* Re-arm handler just in case */
- (void) signal(signo, xf86SigHandler);
- *xf86SignalIntercept = signo;
- return;
- }
-
- signal(signo,SIG_IGN);
- xf86Info.caughtSignal = TRUE;
-#ifdef XF86BIGFONT
- XF86BigfontCleanup();
-#endif
-#if defined(XFree86LOADER)
- if (xf86Initialising)
- LoaderCheckUnresolved(LD_RESOLV_IFDONE);
- ErrorF("\n"
- " *** If unresolved symbols were reported above, they might not\n"
- " *** be the reason for the server aborting.\n");
-#endif
- FatalError("Caught signal %d. Server aborting\n", signo);
-}
-
-#ifdef MEMDEBUG
-void
-xf86SigMemDebug(int signo)
-{
- CheckMemory();
- (void) signal(signo, xf86SigMemDebug);
- return;
-}
-#endif
-
-/*
- * xf86VTSwitch --
- * Handle requests for switching the vt.
- */
-static void
-xf86VTSwitch()
-{
- int i, prevSIGIO;
- InputInfoPtr pInfo;
- IHPtr ih;
-
-#ifdef DEBUG
- ErrorF("xf86VTSwitch()\n");
-#endif
-
-#ifdef XFreeXDGA
- if(!DGAVTSwitch())
- return;
-#endif
-
- /*
- * Since all screens are currently all in the same state it is sufficient
- * check the first. This might change in future.
- */
- if (xf86Screens[0]->vtSema) {
-
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
- BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
-#endif
- for (i = 0; i < xf86NumScreens; i++) {
- if (!(dispatchException & DE_TERMINATE))
- if (xf86Screens[i]->EnableDisableFBAccess)
- (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
- }
-#if !defined(__UNIXOS2__)
-
- /*
- * Keep the order: Disable Device > LeaveVT
- * EnterVT > EnableDevice
- */
- DisableDevice((DeviceIntPtr)xf86Info.pKeyboard);
- pInfo = xf86InputDevs;
- while (pInfo) {
- DisableDevice(pInfo->dev);
- pInfo = pInfo->next;
- }
-#endif /* !__UNIXOS2__ */
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86Screens[i]->LeaveVT(i, 0);
- }
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86DisableInputHandler(ih);
- xf86AccessLeave(); /* We need this here, otherwise */
- xf86AccessLeaveState(); /* console won't be restored */
-
- if (!xf86VTSwitchAway()) {
- /*
- * switch failed
- */
-
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Leave failed\n");
-#endif
- prevSIGIO = xf86BlockSIGIO();
- xf86AccessEnter();
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- if (!xf86Screens[i]->EnterVT(i, 0))
- FatalError("EnterVT failed for screen %d\n", i);
- }
- xf86EnterServerState(OPERATING);
- if (!(dispatchException & DE_TERMINATE)) {
- for (i = 0; i < xf86NumScreens; i++) {
- if (xf86Screens[i]->EnableDisableFBAccess)
- (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
- }
- }
- SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
-
-#if !defined(__UNIXOS2__)
- EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
- pInfo = xf86InputDevs;
- while (pInfo) {
- EnableDevice(pInfo->dev);
- pInfo = pInfo->next;
- }
-#endif /* !__UNIXOS2__ */
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
-
- xf86UnblockSIGIO(prevSIGIO);
-
- } else {
- if (xf86OSPMClose)
- xf86OSPMClose();
- xf86OSPMClose = NULL;
-
- for (i = 0; i < xf86NumScreens; i++) {
- /*
- * zero all access functions to
- * trap calls when switched away.
- */
- xf86Screens[i]->vtSema = FALSE;
- xf86Screens[i]->access = NULL;
- xf86Screens[i]->busAccess = NULL;
- }
- xf86DisableIO();
- }
- } else {
-
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Entering\n");
-#endif
- if (!xf86VTSwitchTo()) return;
-
- prevSIGIO = xf86BlockSIGIO();
- xf86OSPMClose = xf86OSPMOpen();
-
- xf86EnableIO();
- xf86AccessEnter();
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86Screens[i]->vtSema = TRUE;
- if (!xf86Screens[i]->EnterVT(i, 0))
- FatalError("EnterVT failed for screen %d\n", i);
- }
- xf86EnterServerState(OPERATING);
- for (i = 0; i < xf86NumScreens; i++) {
- if (xf86Screens[i]->EnableDisableFBAccess)
- (*xf86Screens[i]->EnableDisableFBAccess)(i, TRUE);
- }
-
- /* Turn screen saver off when switching back */
- SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverReset);
-
-#if !defined(__UNIXOS2__)
- EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
- pInfo = xf86InputDevs;
- while (pInfo) {
- EnableDevice(pInfo->dev);
- pInfo = pInfo->next;
- }
-#endif /* !__UNIXOS2__ */
-
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
-
- xf86UnblockSIGIO(prevSIGIO);
- }
-}
-
-
-/* Input handler registration */
-
-pointer
-xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data)
-{
- IHPtr ih;
-
- if (fd < 0 || !proc)
- return NULL;
-
- ih = xcalloc(sizeof(*ih), 1);
- if (!ih)
- return NULL;
-
- ih->fd = fd;
- ih->ihproc = proc;
- ih->data = data;
- ih->enabled = TRUE;
-
- ih->next = InputHandlers;
- InputHandlers = ih;
-
- AddEnabledDevice(fd);
-
- return ih;
-}
-
-int
-xf86RemoveInputHandler(pointer handler)
-{
- IHPtr ih, p;
- int fd;
-
- if (!handler)
- return -1;
-
- ih = handler;
- fd = ih->fd;
-
- if (ih->fd >= 0)
- RemoveEnabledDevice(ih->fd);
-
- if (ih == InputHandlers)
- InputHandlers = ih->next;
- else {
- p = InputHandlers;
- while (p && p->next != ih)
- p = p->next;
- if (ih)
- p->next = ih->next;
- }
- xfree(ih);
- return fd;
-}
-
-void
-xf86DisableInputHandler(pointer handler)
-{
- IHPtr ih;
-
- if (!handler)
- return;
-
- ih = handler;
- ih->enabled = FALSE;
- if (ih->fd >= 0)
- RemoveEnabledDevice(ih->fd);
-}
-
-void
-xf86EnableInputHandler(pointer handler)
-{
- IHPtr ih;
-
- if (!handler)
- return;
-
- ih = handler;
- ih->enabled = TRUE;
- if (ih->fd >= 0)
- AddEnabledDevice(ih->fd);
-}
-
-/*
- * As used currently by the DRI, the return value is ignored.
- */
-Bool
-xf86EnableVTSwitch(Bool new)
-{
- static Bool def = TRUE;
- Bool old;
-
- old = VTSwitchEnabled;
- if (!new) {
- /* Disable VT switching */
- def = VTSwitchEnabled;
- VTSwitchEnabled = FALSE;
- } else {
- /* Restore VT switching to default */
- VTSwitchEnabled = def;
- }
- return old;
-}
-
-#ifdef XTESTEXT1
-
-void
-XTestGetPointerPos(short *fmousex, short *fmousey)
-{
- int x,y;
-
- miPointerPosition(&x, &y);
- *fmousex = x;
- *fmousey = y;
-}
-
-
-
-void
-XTestJumpPointer(int jx, int jy, int dev_type)
-{
- miPointerAbsoluteCursor(jx, jy, GetTimeInMillis() );
-}
-
-void
-XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
- int mousey)
-{
- xEvent tevent;
-
- tevent.u.u.type = (dev_type == XE_POINTER) ?
- (keystate == XTestKEY_UP) ? ButtonRelease : ButtonPress :
- (keystate == XTestKEY_UP) ? KeyRelease : KeyPress;
- tevent.u.u.detail = keycode;
- tevent.u.keyButtonPointer.rootX = mousex;
- tevent.u.keyButtonPointer.rootY = mousey;
- tevent.u.keyButtonPointer.time = xf86Info.lastEventTime = GetTimeInMillis();
-#ifdef XINPUT
- xf86eqEnqueue(&tevent);
-#else
- mieqEnqueue(&tevent);
-#endif
- xf86Info.inputPending = TRUE; /* virtual event */
-}
-
-#endif /* XTESTEXT1 */
-
-#ifdef WSCONS_SUPPORT
-
-/* XXX Currently XKB is mandatory. */
-
-extern int WSKbdToKeycode(int);
-
-void
-xf86PostWSKbdEvent(struct wscons_event *event)
-{
- int type = event->type;
- int value = event->value;
- unsigned int keycode;
- int blocked;
-
- if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
- Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
-
- /* map the scancodes to standard XFree86 scancode */
- keycode = WSKbdToKeycode(value);
- if (!down) keycode |= 0x80;
- /* It seems better to block SIGIO there */
- blocked = xf86BlockSIGIO();
- xf86PostKbdEvent(keycode);
- xf86UnblockSIGIO(blocked);
- }
-}
-#endif /* WSCONS_SUPPORT */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
deleted file mode 100644
index c6dee3731..000000000
--- a/hw/xfree86/common/xf86Globals.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.41 2003/08/24 17:36:52 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains all the XFree86 global variables.
- */
-
-#include "X.h"
-#include "os.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Parser.h"
-#include "xf86Xinput.h"
-#include "xf86InPriv.h"
-
-/* Globals that video drivers may access */
-
-int xf86ScreenIndex = -1; /* Index of ScrnInfo in pScreen.devPrivates */
-int xf86CreateRootWindowIndex = -1; /* Index into pScreen.devPrivates */
-ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */
-int xf86PixmapIndex = 0;
-const unsigned char byte_reversed[256] =
-{
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
- 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
- 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
- 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
- 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
- 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
- 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
- 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
- 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
- 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
- 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
- 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
- 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
- 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
- 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
- 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
-};
-
-/* Globals that input drivers may access */
-InputInfoPtr xf86InputDevs = NULL;
-
-
-/* Globals that video drivers may not access */
-
-xf86InfoRec xf86Info = {
- NULL, /* pKeyboard */
- NULL, /* kbdProc */
- NULL, /* kbdEvents */
- -1, /* consoleFd */
- -1, /* kbdFd */
- -1, /* vtno */
- -1, /* kbdType */
- -1, /* kbdRate */
- -1, /* kbdDelay */
- -1, /* bell_pitch */
- -1, /* bell_duration */
- TRUE, /* autoRepeat */
- 0, /* leds */
- 0, /* xleds */
- NULL, /* vtinit */
- 0, /* scanPrefix */
- FALSE, /* capsLock */
- FALSE, /* numLock */
- FALSE, /* scrollLock */
- FALSE, /* modeSwitchLock */
- FALSE, /* composeLock */
- FALSE, /* vtSysreq */
- SKWhenNeeded, /* ddxSpecialKeys */
- FALSE, /* ActionKeyBindingsSet */
-#if defined(SVR4) && defined(i386)
- FALSE, /* panix106 */
-#endif
-#if defined(__OpenBSD__) || defined(__NetBSD__)
- 0, /* wskbdType */
-#endif
- NULL, /* pMouse */
-#ifdef XINPUT
- NULL, /* mouseLocal */
-#endif
- -1, /* lastEventTime */
- FALSE, /* vtRequestsPending */
- FALSE, /* inputPending */
- FALSE, /* dontVTSwitch */
- FALSE, /* dontZap */
- FALSE, /* dontZoom */
- FALSE, /* notrapSignals */
- FALSE, /* caughtSignal */
- FALSE, /* sharedMonitor */
- NULL, /* currentScreen */
-#ifdef CSRG_BASED
- -1, /* screenFd */
- -1, /* consType */
-#endif
-#ifdef XKB
- NULL, /* xkbkeymap */
- NULL, /* xkbkeycodes */
- NULL, /* xkbtypes */
- NULL, /* xkbcompat */
- NULL, /* xkbsymbols */
- NULL, /* xkbgeometry */
- FALSE, /* xkbcomponents_specified */
- NULL, /* xkbrules */
- NULL, /* xkbmodel */
- NULL, /* xkblayout */
- NULL, /* xkbvariant */
- NULL, /* xkboptions */
-#endif
- FALSE, /* allowMouseOpenFail */
- TRUE, /* vidModeEnabled */
- FALSE, /* vidModeAllowNonLocal */
- TRUE, /* miscModInDevEnabled */
- FALSE, /* miscModInDevAllowNonLocal */
- PCIProbe1, /* pciFlags */
- Pix24DontCare, /* pixmap24 */
- X_DEFAULT, /* pix24From */
-#if defined(i386) || defined(__i386__)
- FALSE, /* pc98 */
-#endif
- TRUE, /* pmFlag */
- LogNone, /* syncLog */
- 0, /* estimateSizesAggressively */
- FALSE, /* kbdCustomKeycodes */
- FALSE, /* disableRandR */
- X_DEFAULT /* randRFrom */
-};
-const char *xf86ConfigFile = NULL;
-const char *xf86InputDeviceList = NULL;
-const char *xf86ModulePath = DEFAULT_MODULE_PATH;
-MessageType xf86ModPathFrom = X_DEFAULT;
-const char *xf86LogFile = DEFAULT_LOGPREFIX;
-MessageType xf86LogFileFrom = X_DEFAULT;
-Bool xf86LogFileWasOpened = FALSE;
-serverLayoutRec xf86ConfigLayout = {NULL, };
-confDRIRec xf86ConfigDRI = {0, };
-XF86ConfigPtr xf86configptr = NULL;
-Bool xf86Resetting = FALSE;
-Bool xf86Initialising = FALSE;
-Bool xf86ProbeFailed = FALSE;
-Bool xf86DoProbe = FALSE;
-Bool xf86DoConfigure = FALSE;
-#ifdef XFree86LOADER
-DriverPtr *xf86DriverList = NULL;
-int xf86NumDrivers = 0;
-InputDriverPtr *xf86InputDriverList = NULL;
-int xf86NumInputDrivers = 0;
-ModuleInfoPtr *xf86ModuleInfoList = NULL;
-int xf86NumModuleInfos = 0;
-#endif
-int xf86NumScreens = 0;
-
-const char *xf86VisualNames[] = {
- "StaticGray",
- "GrayScale",
- "StaticColor",
- "PseudoColor",
- "TrueColor",
- "DirectColor"
-};
-
-/* Parameters set only from the command line */
-char *xf86ServerName = "no-name";
-Bool xf86fpFlag = FALSE;
-Bool xf86coFlag = FALSE;
-Bool xf86sFlag = FALSE;
-Bool xf86bsEnableFlag = FALSE;
-Bool xf86bsDisableFlag = FALSE;
-Bool xf86silkenMouseDisableFlag = FALSE;
-char *xf86LayoutName = NULL;
-char *xf86ScreenName = NULL;
-char *xf86PointerName = NULL;
-char *xf86KeyboardName = NULL;
-Bool xf86ProbeOnly = FALSE;
-int xf86Verbose = DEFAULT_VERBOSE;
-int xf86LogVerbose = DEFAULT_LOG_VERBOSE;
-int xf86FbBpp = -1;
-Pix24Flags xf86Pix24 = Pix24DontCare;
-int xf86Depth = -1;
-rgb xf86Weight = {0, 0, 0};
-Bool xf86FlipPixels = FALSE;
-Gamma xf86Gamma = {0.0, 0.0, 0.0};
-Bool xf86ShowUnresolved = DEFAULT_UNRESOLVED;
-Bool xf86BestRefresh = DEFAULT_BEST_REFRESH;
-Bool xf86AllowMouseOpenFail = FALSE;
-#ifdef XF86VIDMODE
-Bool xf86VidModeDisabled = FALSE;
-Bool xf86VidModeAllowNonLocal = FALSE;
-#endif
-#ifdef XF86MISC
-Bool xf86MiscModInDevDisabled = FALSE;
-Bool xf86MiscModInDevAllowNonLocal = FALSE;
-#endif
-PropertyPtr *xf86RegisteredPropertiesTable = NULL;
-Bool xf86inSuspend = FALSE;
-
-#ifdef DLOPEN_HACK
-/*
- * This stuff is a hack to allow dlopen() modules to work. It is intended
- * only to be used when using dlopen() modules for debugging purposes.
- */
-#endif
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
deleted file mode 100644
index 713e7861a..000000000
--- a/hw/xfree86/common/xf86Helper.c
+++ /dev/null
@@ -1,2973 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.135 2003/10/08 14:58:27 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Authors: Dirk Hohndel <hohndel@XFree86.Org>
- * David Dawes <dawes@XFree86.Org>
- * ... and others
- *
- * This file includes the helper functions that the server provides for
- * different drivers.
- */
-
-#include "X.h"
-#include "os.h"
-#include "servermd.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "gcstruct.h"
-#include "loaderProcs.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "micmap.h"
-#include "xf86PciInfo.h"
-#include "xf86DDC.h"
-#include "xf86Xinput.h"
-#include "xf86InPriv.h"
-#include "mivalidate.h"
-#include "xf86RAC.h"
-#include "xf86Bus.h"
-#include "xf86Version.h"
-
-/* For xf86GetClocks */
-#if defined(CSRG_BASED) || defined(__GNU__)
-#define HAS_SETPRIORITY
-#include <sys/resource.h>
-#endif
-
-static int xf86ScrnInfoPrivateCount = 0;
-
-
-#ifdef XFree86LOADER
-/* Add a pointer to a new DriverRec to xf86DriverList */
-
-void
-xf86AddDriver(DriverPtr driver, pointer module, int flags)
-{
- /* Don't add null entries */
- if (!driver)
- return;
-
- if (xf86DriverList == NULL)
- xf86NumDrivers = 0;
-
- xf86NumDrivers++;
- xf86DriverList = xnfrealloc(xf86DriverList,
- xf86NumDrivers * sizeof(DriverPtr));
- xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
- *xf86DriverList[xf86NumDrivers - 1] = *driver;
- xf86DriverList[xf86NumDrivers - 1]->module = module;
- xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
-}
-
-void
-xf86DeleteDriver(int drvIndex)
-{
- if (xf86DriverList[drvIndex]
- && (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) {
- if (xf86DriverList[drvIndex]->module)
- UnloadModule(xf86DriverList[drvIndex]->module);
- xfree(xf86DriverList[drvIndex]);
- xf86DriverList[drvIndex] = NULL;
- }
-}
-
-/* Add a pointer to a new InputDriverRec to xf86InputDriverList */
-
-void
-xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags)
-{
- /* Don't add null entries */
- if (!driver)
- return;
-
- if (xf86InputDriverList == NULL)
- xf86NumInputDrivers = 0;
-
- xf86NumInputDrivers++;
- xf86InputDriverList = xnfrealloc(xf86InputDriverList,
- xf86NumInputDrivers * sizeof(InputDriverPtr));
- xf86InputDriverList[xf86NumInputDrivers - 1] =
- xnfalloc(sizeof(InputDriverRec));
- *xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
- xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
- xf86InputDriverList[xf86NumInputDrivers - 1]->refCount = 0;
-}
-
-void
-xf86DeleteInputDriver(int drvIndex)
-{
- if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module)
- UnloadModule(xf86InputDriverList[drvIndex]->module);
- xfree(xf86InputDriverList[drvIndex]);
- xf86InputDriverList[drvIndex] = NULL;
-}
-
-void
-xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
-{
- /* Don't add null entries */
- if (!module)
- return;
-
- if (xf86ModuleInfoList == NULL)
- xf86NumModuleInfos = 0;
-
- xf86NumModuleInfos++;
- xf86ModuleInfoList = xnfrealloc(xf86ModuleInfoList,
- xf86NumModuleInfos * sizeof(ModuleInfoPtr));
- xf86ModuleInfoList[xf86NumModuleInfos - 1] = xnfalloc(sizeof(ModuleInfoRec));
- *xf86ModuleInfoList[xf86NumModuleInfos - 1] = *info;
- xf86ModuleInfoList[xf86NumModuleInfos - 1]->module = module;
- xf86ModuleInfoList[xf86NumModuleInfos - 1]->refCount = 0;
-}
-
-void
-xf86DeleteModuleInfo(int idx)
-{
- if (xf86ModuleInfoList[idx]) {
- if (xf86ModuleInfoList[idx]->module)
- UnloadModule(xf86ModuleInfoList[idx]->module);
- xfree(xf86ModuleInfoList[idx]);
- xf86ModuleInfoList[idx] = NULL;
- }
-}
-#endif
-
-
-/* Allocate a new ScrnInfoRec in xf86Screens */
-
-ScrnInfoPtr
-xf86AllocateScreen(DriverPtr drv, int flags)
-{
- int i;
-
- if (xf86Screens == NULL)
- xf86NumScreens = 0;
-
- i = xf86NumScreens++;
- xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
- xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
- xf86Screens[i]->scrnIndex = i; /* Changes when a screen is removed */
- xf86Screens[i]->origIndex = i; /* This never changes */
- xf86Screens[i]->privates = xnfcalloc(sizeof(DevUnion),
- xf86ScrnInfoPrivateCount);
- /*
- * EnableDisableFBAccess now gets initialized in InitOutput()
- * xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
- */
-
- xf86Screens[i]->drv = drv;
- drv->refCount++;
-#ifdef XFree86LOADER
- xf86Screens[i]->module = DuplicateModule(drv->module, NULL);
-#else
- xf86Screens[i]->module = NULL;
-#endif
- /*
- * set the initial access state. This will be modified after PreInit.
- * XXX Or should we do it some other place?
- */
- xf86Screens[i]->CurrentAccess = &xf86CurrentAccess;
- xf86Screens[i]->resourceType = MEM_IO;
-
-#ifdef DEBUG
- /* OOps -- What's this ? */
- ErrorF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
- i, xf86Screens[i]->pScreen );
- if ( NULL != xf86Screens[i]->pScreen ) {
- ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
- i, xf86Screens[i]->pScreen->CreateWindow );
- }
-#endif
-
- return xf86Screens[i];
-}
-
-
-/*
- * Remove an entry from xf86Screens. Ideally it should free all allocated
- * data. To do this properly may require a driver hook.
- */
-
-void
-xf86DeleteScreen(int scrnIndex, int flags)
-{
- ScrnInfoPtr pScrn;
- int i;
-
- /* First check if the screen is valid */
- if (xf86NumScreens == 0 || xf86Screens == NULL)
- return;
-
- if (scrnIndex > xf86NumScreens - 1)
- return;
-
- if (!(pScrn = xf86Screens[scrnIndex]))
- return;
-
- /* If a FreeScreen function is defined, call it here */
- if (pScrn->FreeScreen != NULL)
- pScrn->FreeScreen(scrnIndex, 0);
-
- while (pScrn->modes)
- xf86DeleteMode(&pScrn->modes, pScrn->modes);
-
- while (pScrn->modePool)
- xf86DeleteMode(&pScrn->modePool, pScrn->modePool);
-
- xf86OptionListFree(pScrn->options);
-
-#ifdef XFree86LOADER
- if (pScrn->module)
- UnloadModule(pScrn->module);
-#endif
-
- if (pScrn->drv)
- pScrn->drv->refCount--;
-
- if (pScrn->privates);
- xfree(pScrn->privates);
-
- xf86ClearEntityListForScreen(scrnIndex);
-
- xfree(pScrn);
-
- /* Move the other entries down, updating their scrnIndex fields */
-
- xf86NumScreens--;
-
- for (i = scrnIndex; i < xf86NumScreens; i++) {
- xf86Screens[i] = xf86Screens[i + 1];
- xf86Screens[i]->scrnIndex = i;
- /* Also need to take care of the screen layout settings */
- }
-}
-
-/*
- * Allocate a private in ScrnInfoRec.
- */
-
-int
-xf86AllocateScrnInfoPrivateIndex(void)
-{
- int idx, i;
- ScrnInfoPtr pScr;
- DevUnion *nprivs;
-
- idx = xf86ScrnInfoPrivateCount++;
- for (i = 0; i < xf86NumScreens; i++) {
- pScr = xf86Screens[i];
- nprivs = xnfrealloc(pScr->privates,
- xf86ScrnInfoPrivateCount * sizeof(DevUnion));
- /* Zero the new private */
- bzero(&nprivs[idx], sizeof(DevUnion));
- pScr->privates = nprivs;
- }
- return idx;
-}
-
-/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
-
-InputInfoPtr
-xf86AllocateInput(InputDriverPtr drv, int flags)
-{
- InputInfoPtr new;
-
- if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
- return NULL;
-
- new->drv = drv;
- drv->refCount++;
-#ifdef XFree86LOADER
- new->module = DuplicateModule(drv->module, NULL);
-#else
- new->module = NULL;
-#endif
- new->next = xf86InputDevs;
- xf86InputDevs = new;
- return new;
-}
-
-
-/*
- * Remove an entry from xf86InputDevs. Ideally it should free all allocated
- * data. To do this properly may require a driver hook.
- */
-
-void
-xf86DeleteInput(InputInfoPtr pInp, int flags)
-{
- InputInfoPtr p;
-
- /* First check if the inputdev is valid. */
- if (pInp == NULL)
- return;
-
-#if 0
- /* If a free function is defined, call it here. */
- if (pInp->free)
- pInp->free(pInp, 0);
-#endif
-
-#ifdef XFree86LOADER
- if (pInp->module)
- UnloadModule(pInp->module);
-#endif
-
- if (pInp->drv)
- pInp->drv->refCount--;
-
- if (pInp->private);
- xfree(pInp->private);
-
- /* Remove the entry from the list. */
- if (pInp == xf86InputDevs)
- xf86InputDevs = pInp->next;
- else {
- p = xf86InputDevs;
- while (p && p->next != pInp)
- p = p->next;
- if (p)
- p->next = pInp->next;
- /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
- }
- xfree(pInp);
-}
-
-Bool
-xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
-{
- int i;
-
- if (pScrn->numFormats >= MAXFORMATS)
- return FALSE;
-
- if (bpp <= 0) {
- if (depth == 1)
- bpp = 1;
- else if (depth <= 8)
- bpp = 8;
- else if (depth <= 16)
- bpp = 16;
- else if (depth <= 32)
- bpp = 32;
- else
- return FALSE;
- }
- if (pad <= 0)
- pad = BITMAP_SCANLINE_PAD;
-
- i = pScrn->numFormats++;
- pScrn->formats[i].depth = depth;
- pScrn->formats[i].bitsPerPixel = bpp;
- pScrn->formats[i].scanlinePad = pad;
- return TRUE;
-}
-
-/*
- * Set the depth we are using based on (in the following order of preference):
- * - values given on the command line
- * - values given in the config file
- * - values provided by the driver
- * - an overall default when nothing else is given
- *
- * Also find a Display subsection matching the depth/bpp found.
- *
- * Sets the following ScrnInfoRec fields:
- * bitsPerPixel, pixmap24, depth, display, imageByteOrder,
- * bitmapScanlinePad, bitmapScanlineUnit, bitmapBitOrder, numFormats,
- * formats, fbFormat.
- */
-
-/* Can the screen handle 24 bpp pixmaps */
-#define DO_PIX24(f) ((f & Support24bppFb) || \
- ((f & Support32bppFb) && (f & SupportConvert24to32)))
-
-/* Can the screen handle 32 bpp pixmaps */
-#define DO_PIX32(f) ((f & Support32bppFb) || \
- ((f & Support24bppFb) && (f & SupportConvert32to24)))
-
-/* Does the screen prefer 32bpp fb for 24bpp pixmaps */
-#define CHOOSE32FOR24(f) ((f & Support32bppFb) && (f & SupportConvert24to32) \
- && (f & PreferConvert24to32))
-
-/* Does the screen prefer 24bpp fb for 32bpp pixmaps */
-#define CHOOSE24FOR32(f) ((f & Support24bppFb) && (f & SupportConvert32to24) \
- && (f & PreferConvert32to24))
-
-/* Can the screen handle 32bpp pixmaps for 24bpp fb */
-#define DO_PIX32FOR24(f) ((f & Support24bppFb) && (f & SupportConvert32to24))
-
-/* Can the screen handle 24bpp pixmaps for 32bpp fb */
-#define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32))
-
-#ifndef GLOBAL_DEFAULT_DEPTH
-#define GLOBAL_DEFAULT_DEPTH 16
-#endif
-
-#ifndef GLOBAL_DEFAULT_FBBPP
-#define GLOBAL_DEFAULT_FBBPP 16
-#endif
-
-Bool
-xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
- int depth24flags)
-{
- int i;
- DispPtr disp;
- Pix24Flags pix24 = xf86Info.pixmap24;
- Bool nomatch = FALSE;
-
- scrp->bitsPerPixel = -1;
- scrp->depth = -1;
- scrp->pixmap24 = Pix24DontCare;
- scrp->bitsPerPixelFrom = X_DEFAULT;
- scrp->depthFrom = X_DEFAULT;
-
-#if BITMAP_SCANLINE_UNIT == 64
- /*
- * For platforms with 64-bit scanlines, modify the driver's depth24flags
- * to remove preferences for packed 24bpp modes, which are not currently
- * supported on these platforms.
- */
- depth24flags &= ~(SupportConvert32to24 | SupportConvert32to24 |
- PreferConvert24to32 | PreferConvert32to24);
-#endif
-
- if (xf86FbBpp > 0) {
- scrp->bitsPerPixel = xf86FbBpp;
- scrp->bitsPerPixelFrom = X_CMDLINE;
- }
-
- if (xf86Depth > 0) {
- scrp->depth = xf86Depth;
- scrp->depthFrom = X_CMDLINE;
- }
-
- if (xf86FbBpp < 0 && xf86Depth < 0) {
- if (scrp->confScreen->defaultfbbpp > 0) {
- scrp->bitsPerPixel = scrp->confScreen->defaultfbbpp;
- scrp->bitsPerPixelFrom = X_CONFIG;
- }
- if (scrp->confScreen->defaultdepth > 0) {
- scrp->depth = scrp->confScreen->defaultdepth;
- scrp->depthFrom = X_CONFIG;
- }
-
- if (scrp->confScreen->defaultfbbpp <= 0 &&
- scrp->confScreen->defaultdepth <= 0) {
- /*
- * Check for DefaultDepth and DefaultFbBpp options in the
- * Device sections.
- */
- int i;
- GDevPtr device;
- Bool found = FALSE;
-
- for (i = 0; i < scrp->numEntities; i++) {
- device = xf86GetDevFromEntity(scrp->entityList[i],
- scrp->entityInstanceList[i]);
- if (device && device->options) {
- if (xf86FindOption(device->options, "DefaultDepth")) {
- scrp->depth = xf86SetIntOption(device->options,
- "DefaultDepth", -1);
- scrp->depthFrom = X_CONFIG;
- found = TRUE;
- }
- if (xf86FindOption(device->options, "DefaultFbBpp")) {
- scrp->bitsPerPixel = xf86SetIntOption(device->options,
- "DefaultFbBpp",
- -1);
- scrp->bitsPerPixelFrom = X_CONFIG;
- found = TRUE;
- }
- }
- if (found)
- break;
- }
- }
- }
-
- /* If none of these is set, pick a default */
- if (scrp->bitsPerPixel < 0 && scrp->depth < 0) {
- if (fbbpp > 0 || depth > 0) {
- if (fbbpp > 0)
- scrp->bitsPerPixel = fbbpp;
- if (depth > 0)
- scrp->depth = depth;
- } else {
- scrp->bitsPerPixel = GLOBAL_DEFAULT_FBBPP;
- scrp->depth = GLOBAL_DEFAULT_DEPTH;
- }
- }
-
- /* If any are not given, determine a default for the others */
-
- if (scrp->bitsPerPixel < 0) {
- /* The depth must be set */
- if (scrp->depth > -1) {
- if (scrp->depth == 1)
- scrp->bitsPerPixel = 1;
- else if (scrp->depth <= 4)
- scrp->bitsPerPixel = 4;
- else if (scrp->depth <= 8)
- scrp->bitsPerPixel = 8;
- else if (scrp->depth <= 16)
- scrp->bitsPerPixel = 16;
- else if (scrp->depth <= 24) {
- /*
- * Figure out if a choice is possible based on the depth24
- * and pix24 flags.
- */
- /* Check pix24 first */
- if (pix24 != Pix24DontCare) {
- if (pix24 == Pix24Use32) {
- if (DO_PIX32(depth24flags)) {
- if (CHOOSE24FOR32(depth24flags))
- scrp->bitsPerPixel = 24;
- else
- scrp->bitsPerPixel = 32;
- } else {
- nomatch = TRUE;
- }
- } else if (pix24 == Pix24Use24) {
- if (DO_PIX24(depth24flags)) {
- if (CHOOSE32FOR24(depth24flags))
- scrp->bitsPerPixel = 32;
- else
- scrp->bitsPerPixel = 24;
- } else {
- nomatch = TRUE;
- }
- }
- } else {
- if (DO_PIX32(depth24flags)) {
- if (CHOOSE24FOR32(depth24flags))
- scrp->bitsPerPixel = 24;
- else
- scrp->bitsPerPixel = 32;
- } else if (DO_PIX24(depth24flags)) {
- if (CHOOSE32FOR24(depth24flags))
- scrp->bitsPerPixel = 32;
- else
- scrp->bitsPerPixel = 24;
- }
- }
- } else if (scrp->depth <= 32)
- scrp->bitsPerPixel = 32;
- else {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Specified depth (%d) is greater than 32\n",
- scrp->depth);
- return FALSE;
- }
- } else {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "xf86SetDepthBpp: internal error: depth and fbbpp"
- " are both not set\n");
- return FALSE;
- }
- if (scrp->bitsPerPixel < 0) {
- if (nomatch)
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Driver can't support depth 24 pixmap format (%d)\n",
- PIX24TOBPP(pix24));
- else if ((depth24flags & (Support24bppFb | Support32bppFb)) ==
- NoDepth24Support)
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Driver can't support depth 24\n");
- else
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Can't find fbbpp for depth 24\n");
- return FALSE;
- }
- scrp->bitsPerPixelFrom = X_PROBED;
- }
-
- if (scrp->depth <= 0) {
- /* bitsPerPixel is already set */
- switch (scrp->bitsPerPixel) {
- case 32:
- scrp->depth = 24;
- break;
- default:
- /* 1, 4, 8, 16 and 24 */
- scrp->depth = scrp->bitsPerPixel;
- break;
- }
- scrp->depthFrom = X_PROBED;
- }
-
- /* Sanity checks */
- if (scrp->depth < 1 || scrp->depth > 32) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Specified depth (%d) is not in the range 1-32\n",
- scrp->depth);
- return FALSE;
- }
- switch (scrp->bitsPerPixel) {
- case 1:
- case 4:
- case 8:
- case 16:
- case 24:
- case 32:
- break;
- default:
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Specified fbbpp (%d) is not a permitted value\n",
- scrp->bitsPerPixel);
- return FALSE;
- }
- if (scrp->depth > scrp->bitsPerPixel) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Specified depth (%d) is greater than the fbbpp (%d)\n",
- scrp->depth, scrp->bitsPerPixel);
- return FALSE;
- }
-
- /* set scrp->pixmap24 if the driver isn't flexible */
- if (scrp->bitsPerPixel == 24 && !DO_PIX32FOR24(depth24flags)) {
- scrp->pixmap24 = Pix24Use24;
- }
- if (scrp->bitsPerPixel == 32 && !DO_PIX24FOR32(depth24flags)) {
- scrp->pixmap24 = Pix24Use32;
- }
-
- /*
- * Find the Display subsection matching the depth/fbbpp and initialise
- * scrp->display with it.
- */
- for (i = 0, disp = scrp->confScreen->displays;
- i < scrp->confScreen->numdisplays; i++, disp++) {
- if ((disp->depth == scrp->depth && disp->fbbpp == scrp->bitsPerPixel)
- || (disp->depth == scrp->depth && disp->fbbpp <= 0)
- || (disp->fbbpp == scrp->bitsPerPixel && disp->depth <= 0)) {
- scrp->display = disp;
- break;
- }
- }
-
- /*
- * If an exact match can't be found, see if there is one with no
- * depth or fbbpp specified.
- */
- if (i == scrp->confScreen->numdisplays) {
- for (i = 0, disp = scrp->confScreen->displays;
- i < scrp->confScreen->numdisplays; i++, disp++) {
- if (disp->depth <= 0 && disp->fbbpp <= 0) {
- scrp->display = disp;
- break;
- }
- }
- }
-
- /*
- * If all else fails, create a default one.
- */
- if (i == scrp->confScreen->numdisplays) {
- scrp->confScreen->numdisplays++;
- scrp->confScreen->displays =
- xnfrealloc(scrp->confScreen->displays,
- scrp->confScreen->numdisplays * sizeof(DispRec));
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Creating default Display subsection in Screen section\n"
- "\t\"%s\" for depth/fbbpp %d/%d\n",
- scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel);
- memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec));
- scrp->confScreen->displays[i].blackColour.red = -1;
- scrp->confScreen->displays[i].blackColour.green = -1;
- scrp->confScreen->displays[i].blackColour.blue = -1;
- scrp->confScreen->displays[i].whiteColour.red = -1;
- scrp->confScreen->displays[i].whiteColour.green = -1;
- scrp->confScreen->displays[i].whiteColour.blue = -1;
- scrp->confScreen->displays[i].defaultVisual = -1;
- scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *));
- scrp->confScreen->displays[i].modes[0] = NULL;
- scrp->confScreen->displays[i].depth = depth;
- scrp->confScreen->displays[i].fbbpp = fbbpp;
- scrp->display = &scrp->confScreen->displays[i];
- }
-
- /*
- * Setup defaults for the display-wide attributes the framebuffer will
- * need. These defaults should eventually be set globally, and not
- * dependent on the screens.
- */
- scrp->imageByteOrder = IMAGE_BYTE_ORDER;
- scrp->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- if (scrp->depth < 8) {
- /* Planar modes need these settings */
- scrp->bitmapScanlineUnit = 8;
- scrp->bitmapBitOrder = MSBFirst;
- } else {
- scrp->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- scrp->bitmapBitOrder = BITMAP_BIT_ORDER;
- }
-
- /*
- * If an unusual depth is required, add it to scrp->formats. The formats
- * for the common depths are handled globally in InitOutput
- */
- switch (scrp->depth) {
- case 1:
- case 4:
- case 8:
- case 15:
- case 16:
- case 24:
- /* Common depths. Nothing to do for them */
- break;
- default:
- if (!xf86AddPixFormat(scrp, scrp->depth, 0, 0)) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Can't add pixmap format for depth %d\n", scrp->depth);
- return FALSE;
- }
- }
-
- /* Initialise the framebuffer format for this screen */
- scrp->fbFormat.depth = scrp->depth;
- scrp->fbFormat.bitsPerPixel = scrp->bitsPerPixel;
- scrp->fbFormat.scanlinePad = BITMAP_SCANLINE_PAD;
-
- return TRUE;
-}
-
-/*
- * Print out the selected depth and bpp.
- */
-void
-xf86PrintDepthBpp(ScrnInfoPtr scrp)
-{
- xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth);
- xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel);
-}
-
-/*
- * xf86SetWeight sets scrp->weight, scrp->mask, scrp->offset, and for depths
- * greater than MAX_PSEUDO_DEPTH also scrp->rgbBits.
- */
-Bool
-xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
-{
- MessageType weightFrom = X_DEFAULT;
-
- scrp->weight.red = 0;
- scrp->weight.green = 0;
- scrp->weight.blue = 0;
-
- if (xf86Weight.red > 0 && xf86Weight.green > 0 && xf86Weight.blue > 0) {
- scrp->weight = xf86Weight;
- weightFrom = X_CMDLINE;
- } else if (scrp->display->weight.red > 0 && scrp->display->weight.green > 0
- && scrp->display->weight.blue > 0) {
- scrp->weight = scrp->display->weight;
- weightFrom = X_CONFIG;
- } else if (weight.red > 0 && weight.green > 0 && weight.blue > 0) {
- scrp->weight = weight;
- } else {
- switch (scrp->depth) {
- case 1:
- case 4:
- case 8:
- scrp->weight.red = scrp->weight.green =
- scrp->weight.blue = scrp->rgbBits;
- break;
- case 15:
- scrp->weight.red = scrp->weight.green = scrp->weight.blue = 5;
- break;
- case 16:
- scrp->weight.red = scrp->weight.blue = 5;
- scrp->weight.green = 6;
- break;
- case 24:
- scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8;
- break;
- case 30:
- scrp->weight.red = scrp->weight.green = scrp->weight.blue = 10;
- break;
- }
- }
-
- if (scrp->weight.red)
- xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n",
- (int)scrp->weight.red, (int)scrp->weight.green,
- (int)scrp->weight.blue);
-
- if (scrp->depth > MAX_PSEUDO_DEPTH &&
- (scrp->depth != scrp->weight.red + scrp->weight.green +
- scrp->weight.blue)) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Weight given (%d%d%d) is inconsistent with the "
- "depth (%d)\n",
- (int)scrp->weight.red, (int)scrp->weight.green,
- (int)scrp->weight.blue, scrp->depth);
- return FALSE;
- }
- if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) {
- /*
- * XXX Does this even mean anything for TrueColor visuals?
- * If not, we shouldn't even be setting it here. However, this
- * matches the behaviour of 3.x versions of XFree86.
- */
- scrp->rgbBits = scrp->weight.red;
- if (scrp->weight.green > scrp->rgbBits)
- scrp->rgbBits = scrp->weight.green;
- if (scrp->weight.blue > scrp->rgbBits)
- scrp->rgbBits = scrp->weight.blue;
- }
-
- /* Set the mask and offsets */
- if (mask.red == 0 || mask.green == 0 || mask.blue == 0) {
- /* Default to a setting common to PC hardware */
- scrp->offset.red = scrp->weight.green + scrp->weight.blue;
- scrp->offset.green = scrp->weight.blue;
- scrp->offset.blue = 0;
- scrp->mask.red = ((1 << scrp->weight.red) - 1) << scrp->offset.red;
- scrp->mask.green = ((1 << scrp->weight.green) - 1)
- << scrp->offset.green;
- scrp->mask.blue = (1 << scrp->weight.blue) - 1;
- } else {
- /* Initialise to the values passed */
- scrp->mask.red = mask.red;
- scrp->mask.green = mask.green;
- scrp->mask.blue = mask.blue;
- scrp->offset.red = ffs(mask.red);
- scrp->offset.green = ffs(mask.green);
- scrp->offset.blue = ffs(mask.blue);
- }
- return TRUE;
-}
-
-Bool
-xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
-{
- MessageType visualFrom = X_DEFAULT;
- Bool bad = FALSE;
-
- if (defaultColorVisualClass >= 0) {
- scrp->defaultVisual = defaultColorVisualClass;
- visualFrom = X_CMDLINE;
- } else if (scrp->display->defaultVisual >= 0) {
- scrp->defaultVisual = scrp->display->defaultVisual;
- visualFrom = X_CONFIG;
- } else if (visual >= 0) {
- scrp->defaultVisual = visual;
- } else {
- if (scrp->depth == 1)
- scrp->defaultVisual = StaticGray;
- else if (scrp->depth == 4)
- scrp->defaultVisual = StaticColor;
- else if (scrp->depth <= MAX_PSEUDO_DEPTH)
- scrp->defaultVisual = PseudoColor;
- else
- scrp->defaultVisual = TrueColor;
- }
- switch (scrp->defaultVisual) {
- case StaticGray:
- case GrayScale:
- case StaticColor:
- case PseudoColor:
- case TrueColor:
- case DirectColor:
- xf86DrvMsg(scrp->scrnIndex, visualFrom, "Default visual is %s\n",
- xf86VisualNames[scrp->defaultVisual]);
- /* Check if the visual is valid for the depth */
- if (scrp->depth == 1 && scrp->defaultVisual != StaticGray)
- bad = TRUE;
-#if 0
- else if (scrp->depth == 4 &&
- (scrp->defaultVisual == TrueColor ||
- scrp->defaultVisual == DirectColor))
- bad = TRUE;
-#endif
- else if (scrp->depth > MAX_PSEUDO_DEPTH &&
- scrp->defaultVisual != TrueColor &&
- scrp->defaultVisual != DirectColor)
- bad = TRUE;
- if (bad) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Selected default "
- "visual (%s) is not valid for depth %d\n",
- xf86VisualNames[scrp->defaultVisual], scrp->depth);
- return FALSE;
- } else
- return TRUE;
- default:
-
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Invalid default visual class (%d)\n", scrp->defaultVisual);
- return FALSE;
- }
-}
-
-#define TEST_GAMMA(g) \
- (g).red > GAMMA_ZERO || (g).green > GAMMA_ZERO || (g).blue > GAMMA_ZERO
-
-#define SET_GAMMA(g) \
- (g) > GAMMA_ZERO ? (g) : 1.0
-
-Bool
-xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
-{
- MessageType from = X_DEFAULT;
-#if 0
- xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
-#endif
- if (TEST_GAMMA(xf86Gamma)) {
- from = X_CMDLINE;
- scrp->gamma.red = SET_GAMMA(xf86Gamma.red);
- scrp->gamma.green = SET_GAMMA(xf86Gamma.green);
- scrp->gamma.blue = SET_GAMMA(xf86Gamma.blue);
- } else if (TEST_GAMMA(scrp->monitor->gamma)) {
- from = X_CONFIG;
- scrp->gamma.red = SET_GAMMA(scrp->monitor->gamma.red);
- scrp->gamma.green = SET_GAMMA(scrp->monitor->gamma.green);
- scrp->gamma.blue = SET_GAMMA(scrp->monitor->gamma.blue);
-#if 0
- } else if ( DDC && DDC->features.gamma > GAMMA_ZERO ) {
- from = X_PROBED;
- scrp->gamma.red = SET_GAMMA(DDC->features.gamma);
- scrp->gamma.green = SET_GAMMA(DDC->features.gamma);
- scrp->gamma.blue = SET_GAMMA(DDC->features.gamma);
- /* EDID structure version 2 gives optional seperate red, green & blue gamma values
- * in bytes 0x57-0x59 */
-#endif
- } else if (TEST_GAMMA(gamma)) {
- scrp->gamma.red = SET_GAMMA(gamma.red);
- scrp->gamma.green = SET_GAMMA(gamma.green);
- scrp->gamma.blue = SET_GAMMA(gamma.blue);
- } else {
- scrp->gamma.red = 1.0;
- scrp->gamma.green = 1.0;
- scrp->gamma.blue = 1.0;
- }
- xf86DrvMsg(scrp->scrnIndex, from,
- "Using gamma correction (%.1f, %.1f, %.1f)\n",
- scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue);
-
- return TRUE;
-}
-
-#undef TEST_GAMMA
-#undef SET_GAMMA
-
-
-/*
- * Set the DPI from the command line option. XXX should allow it to be
- * calculated from the widthmm/heightmm values.
- */
-
-#undef MMPERINCH
-#define MMPERINCH 25.4
-
-void
-xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
-{
- MessageType from = X_DEFAULT;
- xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC);
- int ddcWidthmm, ddcHeightmm;
- int widthErr, heightErr;
-
- /* XXX Maybe there is no need for widthmm/heightmm in ScrnInfoRec */
- pScrn->widthmm = pScrn->monitor->widthmm;
- pScrn->heightmm = pScrn->monitor->heightmm;
-
- if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0) ) {
- /* DDC gives display size in mm for individual modes,
- * but cm for monitor
- */
- ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */
- ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
- } else {
- ddcWidthmm = ddcHeightmm = 0;
- }
-
- if (monitorResolution > 0) {
- pScrn->xDpi = monitorResolution;
- pScrn->yDpi = monitorResolution;
- from = X_CMDLINE;
- } else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) {
- from = X_CONFIG;
- if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
- }
- if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
- }
- if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
- pScrn->yDpi = pScrn->xDpi;
- if (pScrn->yDpi > 0 && pScrn->xDpi <= 0)
- pScrn->xDpi = pScrn->yDpi;
- xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
- pScrn->widthmm, pScrn->heightmm);
-
- /* Warn if config and probe disagree about display size */
- if ( ddcWidthmm && ddcHeightmm ) {
- if (pScrn->widthmm > 0) {
- widthErr = abs(ddcWidthmm - pScrn->widthmm);
- } else {
- widthErr = 0;
- }
- if (pScrn->heightmm > 0) {
- heightErr = abs(ddcHeightmm - pScrn->heightmm);
- } else {
- heightErr = 0;
- }
- if (widthErr>10 || heightErr>10) {
- /* Should include config file name for monitor here */
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n",
- ddcWidthmm,ddcHeightmm, pScrn->widthmm,pScrn->heightmm);
- }
- }
- } else if ( ddcWidthmm && ddcHeightmm ) {
- from = X_PROBED;
- xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
- ddcWidthmm, ddcHeightmm );
- pScrn->widthmm = ddcWidthmm;
- pScrn->heightmm = ddcHeightmm;
- if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
- }
- if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
- }
- if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
- pScrn->yDpi = pScrn->xDpi;
- if (pScrn->yDpi > 0 && pScrn->xDpi <= 0)
- pScrn->xDpi = pScrn->yDpi;
- } else {
- if (x > 0)
- pScrn->xDpi = x;
- else
- pScrn->xDpi = DEFAULT_DPI;
- if (y > 0)
- pScrn->yDpi = y;
- else
- pScrn->yDpi = DEFAULT_DPI;
- }
- xf86DrvMsg(pScrn->scrnIndex, from, "DPI set to (%d, %d)\n",
- pScrn->xDpi, pScrn->yDpi);
-}
-
-#undef MMPERINCH
-
-
-void
-xf86SetBlackWhitePixels(ScreenPtr pScreen)
-{
- if (xf86FlipPixels) {
- pScreen->whitePixel = 0;
- pScreen->blackPixel = 1;
- } else {
- pScreen->whitePixel = 1;
- pScreen->blackPixel = 0;
- }
-}
-
-/*
- * xf86SetRootClip --
- * Enable or disable rendering to the screen by
- * setting the root clip list and revalidating
- * all of the windows
- */
-
-static void
-xf86SetRootClip (ScreenPtr pScreen, Bool enable)
-{
- WindowPtr pWin = WindowTable[pScreen->myNum];
- WindowPtr pChild;
- Bool WasViewable = (Bool)(pWin->viewable);
- Bool anyMarked = FALSE;
- RegionPtr pOldClip = NULL, bsExposed;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
- BoxRec box;
-
- if (WasViewable)
- {
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
- {
- (void) (*pScreen->MarkOverlappedWindows)(pChild,
- pChild,
- &pLayerWin);
- }
- (*pScreen->MarkWindow) (pWin);
- anyMarked = TRUE;
- if (pWin->valdata)
- {
- if (HasBorder (pWin))
- {
- RegionPtr borderVisible;
-
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- }
- pWin->valdata->before.resized = TRUE;
- }
- }
-
- /*
- * Use REGION_BREAK to avoid optimizations in ValidateTree
- * that assume the root borderClip can't change well, normally
- * it doesn't...)
- */
- if (enable)
- {
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT (pScreen, &pWin->winSize, &box, 1);
- REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
- if (WasViewable)
- REGION_RESET(pScreen, &pWin->borderClip, &box);
- pWin->drawable.width = pScreen->width;
- pWin->drawable.height = pScreen->height;
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
- }
- else
- {
- REGION_EMPTY(pScreen, &pWin->borderClip);
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
- }
-
- ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
-
- if (WasViewable)
- {
- if (pWin->backStorage)
- {
- pOldClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, pOldClip, &pWin->clipList);
- }
-
- if (pWin->firstChild)
- {
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
- pWin->firstChild,
- (WindowPtr *)NULL);
- }
- else
- {
- (*pScreen->MarkWindow) (pWin);
- anyMarked = TRUE;
- }
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
- }
-
- if (pWin->backStorage &&
- ((pWin->backingStore == Always) || WasViewable))
- {
- if (!WasViewable)
- pOldClip = &pWin->clipList; /* a convenient empty region */
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, pOldClip,
- pWin->drawable.x, pWin->drawable.y);
- if (WasViewable)
- REGION_DESTROY(pScreen, pOldClip);
- if (bsExposed)
- {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- }
- if (WasViewable)
- {
- if (anyMarked)
- (*pScreen->HandleExposures)(pWin);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
- FlushAllOutput ();
-}
-
-/*
- * Function to enable/disable access to the frame buffer
- *
- * This is used when VT switching and when entering/leaving DGA direct mode.
- *
- * This has been rewritten again to eliminate the saved pixmap. The
- * devPrivate field in the screen pixmap is set to NULL to catch code
- * accidentally referencing the frame buffer while the X server is not
- * supposed to touch it.
- *
- * Here, we exchange the pixmap private data, rather than the pixmaps
- * themselves to avoid having to find and change any references to the screen
- * pixmap such as GC's, window privates etc. This also means that this code
- * does not need to know exactly how the pixmap pixels are accessed. Further,
- * this exchange is >not< done through the screen's ModifyPixmapHeader()
- * vector. This means the called frame buffer code layers can determine
- * whether they are switched in or out by keeping track of the root pixmap's
- * private data, and therefore don't need to access pScrnInfo->vtSema.
- */
-void
-xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
-{
- ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex];
- ScreenPtr pScreen = pScrnInfo->pScreen;
- PixmapPtr pspix;
-
- pspix = (*pScreen->GetScreenPixmap) (pScreen);
- if (enable)
- {
- /*
- * Restore the screen pixmap devPrivate field
- */
- pspix->devPrivate = pScrnInfo->pixmapPrivate;
- /*
- * Restore all of the clip lists on the screen
- */
- if (!xf86Resetting)
- xf86SetRootClip (pScreen, TRUE);
-
- }
- else
- {
- /*
- * Empty all of the clip lists on the screen
- */
- xf86SetRootClip (pScreen, FALSE);
- /*
- * save the screen pixmap devPrivate field and
- * replace it with NULL so accidental references
- * to the frame buffer are caught
- */
- pScrnInfo->pixmapPrivate = pspix->devPrivate;
- pspix->devPrivate.ptr = NULL;
- }
-}
-
-/* Print driver messages in the standard format */
-
-#undef PREFIX_SIZE
-#define PREFIX_SIZE 14
-
-void
-xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
- va_list args)
-{
- char *tmpFormat;
-
- /* Prefix the scrnIndex name to the format string. */
- if (scrnIndex >= 0 && scrnIndex < xf86NumScreens &&
- xf86Screens[scrnIndex]->name) {
- tmpFormat = xalloc(strlen(format) +
- strlen(xf86Screens[scrnIndex]->name) +
- PREFIX_SIZE + 1);
- if (!tmpFormat)
- return;
-
- snprintf(tmpFormat, PREFIX_SIZE + 1, "%s(%d): ",
- xf86Screens[scrnIndex]->name, scrnIndex);
-
- strcat(tmpFormat, format);
- LogVMessageVerb(type, verb, tmpFormat, args);
- xfree(tmpFormat);
- } else
- LogVMessageVerb(type, verb, format, args);
-}
-#undef PREFIX_SIZE
-
-/* Print driver messages, with verbose level specified directly */
-void
-xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
- ...)
-{
- va_list ap;
-
- va_start(ap, format);
- xf86VDrvMsgVerb(scrnIndex, type, verb, format, ap);
- va_end(ap);
-}
-
-/* Print driver messages, with verbose level of 1 (default) */
-void
-xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- xf86VDrvMsgVerb(scrnIndex, type, 1, format, ap);
- va_end(ap);
-}
-
-/* Print non-driver messages with verbose level specified directly */
-void
-xf86MsgVerb(MessageType type, int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- xf86VDrvMsgVerb(-1, type, verb, format, ap);
- va_end(ap);
-}
-
-/* Print non-driver messages with verbose level of 1 (default) */
-void
-xf86Msg(MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- xf86VDrvMsgVerb(-1, type, 1, format, ap);
- va_end(ap);
-}
-
-/* Just like ErrorF, but with the verbose level checked */
-void
-xf86ErrorFVerb(int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- if (xf86Verbose >= verb || xf86LogVerbose >= verb)
- LogVWrite(verb, format, ap);
- va_end(ap);
-}
-
-/* Like xf86ErrorFVerb, but with an implied verbose level of 1 */
-void
-xf86ErrorF(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- if (xf86Verbose >= 1 || xf86LogVerbose >= 1)
- LogVWrite(1, format, ap);
- va_end(ap);
-}
-
-
-void
-xf86LogInit()
-{
- char *lf;
-
-#define LOGSUFFIX ".log"
-#define LOGOLDSUFFIX ".old"
-
- /* Get the log file name */
- if (xf86LogFileFrom == X_DEFAULT) {
- /* Append the display number and ".log" */
- lf = malloc(strlen(xf86LogFile) + strlen("%s") +
- strlen(LOGSUFFIX) + 1);
- if (!lf)
- FatalError("Cannot allocate space for the log file name\n");
- sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile);
- xf86LogFile = lf;
- }
-
- xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX);
- xf86LogFileWasOpened = TRUE;
-
- xf86SetVerbosity(xf86Verbose);
- xf86SetLogVerbosity(xf86LogVerbose);
-
-#undef LOGSUFFIX
-#undef LOGOLDSUFFIX
-}
-
-void
-xf86CloseLog()
-{
- LogClose();
-}
-
-
-/*
- * Drivers can use these for using their own SymTabRecs.
- */
-
-const char *
-xf86TokenToString(SymTabPtr table, int token)
-{
- int i;
-
- for (i = 0; table[i].token >= 0 && table[i].token != token; i++)
- ;
-
- if (table[i].token < 0)
- return NULL;
- else
- return(table[i].name);
-}
-
-int
-xf86StringToToken(SymTabPtr table, const char *string)
-{
- int i;
-
- if (string == NULL)
- return -1;
-
- for (i = 0; table[i].token >= 0 && xf86NameCmp(string, table[i].name); i++)
- ;
-
- return(table[i].token);
-}
-
-/*
- * helper to display the clocks found on a card
- */
-void
-xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)
-{
- int j;
-
- xf86DrvMsg(scrp->scrnIndex, from, "Pixel clocks available:");
- for (j=0; j < scrp->numClocks; j++) {
- if ((j % 4) == 0) {
- xf86ErrorF("\n");
- xf86DrvMsg(scrp->scrnIndex, from, "pixel clocks:");
- }
- xf86ErrorF(" %7.3f", (double)scrp->clock[j] / 1000.0);
- }
- xf86ErrorF("\n");
-}
-
-
-/*
- * This prints out the driver identify message, including the names of
- * the supported chipsets.
- *
- * XXX This makes assumptions about the line width, etc. Maybe we could
- * use a more general "pretty print" function for messages.
- */
-void
-xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips)
-{
- int len, i;
-
- len = 6 + strlen(drvname) + 2 + strlen(drvmsg) + 2;
- xf86Msg(X_INFO, "%s: %s:", drvname, drvmsg);
- for (i = 0; chips[i].name != NULL; i++) {
- if (i != 0) {
- xf86ErrorF(",");
- len++;
- }
- if (len + 2 + strlen(chips[i].name) < 78) {
- xf86ErrorF(" ");
- len++;
- } else {
- xf86ErrorF("\n\t");
- len = 8;
- }
- xf86ErrorF("%s", chips[i].name);
- len += strlen(chips[i].name);
- }
- xf86ErrorF("\n");
-}
-
-
-#define MAXDRIVERS 64 /* A >hack<, to be sure ... */
-
-
-int
-xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
-{
- GDevPtr gdp, *pgdp = NULL;
- confScreenPtr screensecptr;
- int i,j;
-
- if (sectlist)
- *sectlist = NULL;
-
- if (xf86DoProbe) return 1;
-
- if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
-
- /*
- * This is a very important function that matches the device sections
- * as they show up in the config file with the drivers that the server
- * loads at run time.
- *
- * ChipProbe can call
- * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist)
- * with its driver name. The function allocates an array of GDevPtr and
- * returns this via sectlist and returns the number of elements in
- * this list as return value. 0 means none found, -1 means fatal error.
- *
- * It can figure out which of the Device sections to use for which card
- * (using things like the Card statement, etc). For single headed servers
- * there will of course be just one such Device section.
- */
- i = 0;
-
- /*
- * first we need to loop over all the Screens sections to get to all
- * 'active' device sections
- */
- for (j=0; xf86ConfigLayout.screens[j].screen != NULL; j++) {
- screensecptr = xf86ConfigLayout.screens[j].screen;
- if ((screensecptr->device->driver != NULL)
- && (xf86NameCmp( screensecptr->device->driver,drivername) == 0)
- && (! screensecptr->device->claimed)) {
- /*
- * we have a matching driver that wasn't claimed, yet
- */
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
- pgdp[i++] = screensecptr->device;
- }
- }
-
- /* Then handle the inactive devices */
- j = 0;
- while (xf86ConfigLayout.inactives[j].identifier) {
- gdp = &xf86ConfigLayout.inactives[j];
- if (gdp->driver && !gdp->claimed &&
- !xf86NameCmp(gdp->driver,drivername)) {
- /* we have a matching driver that wasn't claimed yet */
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
- pgdp[i++] = gdp;
- }
- j++;
- }
-
- /*
- * make the array NULL terminated and return its address
- */
- if (i)
- pgdp[i] = NULL;
-
- if (sectlist)
- *sectlist = pgdp;
- else
- xfree(pgdp);
- return i;
-}
-
-struct Inst {
- pciVideoPtr pci;
- GDevPtr dev;
- Bool foundHW; /* PCIid in list of supported chipsets */
- Bool claimed; /* BusID matches with a device section */
- int chip;
- int screen;
-};
-
-int
-xf86MatchPciInstances(const char *driverName, int vendorID,
- SymTabPtr chipsets, PciChipsets *PCIchipsets,
- GDevPtr *devList, int numDevs, DriverPtr drvp,
- int **foundEntities)
-{
- int i,j;
- MessageType from;
- pciVideoPtr pPci, *ppPci;
- struct Inst {
- pciVideoPtr pci;
- GDevPtr dev;
- Bool foundHW; /* PCIid in list of supported chipsets */
- Bool claimed; /* BusID matches with a device section */
- int chip;
- int screen;
- } *instances = NULL;
- int numClaimedInstances = 0;
- int allocatedInstances = 0;
- int numFound = 0;
- SymTabRec *c;
- PciChipsets *id;
- GDevPtr devBus = NULL;
- GDevPtr dev = NULL;
- int *retEntities = NULL;
-
- *foundEntities = NULL;
-
- if (vendorID == 0) {
- for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
- Bool foundVendor = FALSE;
- for (id = PCIchipsets; id->PCIid != -1; id++) {
- if ( (((id->PCIid & 0xFFFF0000) >> 16) == (*ppPci)->vendor)) {
- if (!foundVendor) {
- ++allocatedInstances;
- instances = xnfrealloc(instances,
- allocatedInstances * sizeof(struct Inst));
- instances[allocatedInstances - 1].pci = *ppPci;
- instances[allocatedInstances - 1].dev = NULL;
- instances[allocatedInstances - 1].claimed = FALSE;
- instances[allocatedInstances - 1].foundHW = FALSE;
- instances[allocatedInstances - 1].screen = 0;
- foundVendor = TRUE;
- }
- if ((id->PCIid & 0x0000FFFF) == (*ppPci)->chipType) {
- instances[allocatedInstances - 1].foundHW = TRUE;
- instances[allocatedInstances - 1].chip = id->numChipset;
- numFound++;
- }
- }
- }
- }
- } else if (vendorID == PCI_VENDOR_GENERIC) {
- for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
- for (id = PCIchipsets; id->PCIid != -1; id++) {
- if (id->PCIid == xf86CheckPciGAType(*ppPci)) {
- ++allocatedInstances;
- instances = xnfrealloc(instances,
- allocatedInstances * sizeof(struct Inst));
- instances[allocatedInstances - 1].pci = *ppPci;
- instances[allocatedInstances - 1].dev = NULL;
- instances[allocatedInstances - 1].claimed = FALSE;
- instances[allocatedInstances - 1].foundHW = TRUE;
- instances[allocatedInstances - 1].chip = id->numChipset;
- instances[allocatedInstances - 1].screen = 0;
- numFound++;
- }
- }
- }
- } else {
- /* Find PCI devices that match the given vendor ID */
- for (ppPci = xf86PciVideoInfo; (ppPci != NULL)
- && (*ppPci != NULL); ppPci++) {
- if ((*ppPci)->vendor == vendorID) {
- ++allocatedInstances;
- instances = xnfrealloc(instances,
- allocatedInstances * sizeof(struct Inst));
- instances[allocatedInstances - 1].pci = *ppPci;
- instances[allocatedInstances - 1].dev = NULL;
- instances[allocatedInstances - 1].claimed = FALSE;
- instances[allocatedInstances - 1].foundHW = FALSE;
- instances[allocatedInstances - 1].screen = 0;
-
- /* Check if the chip type is listed in the chipsets table */
- for (id = PCIchipsets; id->PCIid != -1; id++) {
- if (id->PCIid == (*ppPci)->chipType) {
- instances[allocatedInstances - 1].chip
- = id->numChipset;
- instances[allocatedInstances - 1].foundHW = TRUE;
- numFound++;
- break;
- }
- }
- }
- }
- }
-
- /*
- * This may be debatable, but if no PCI devices with a matching vendor
- * type is found, return zero now. It is probably not desirable to
- * allow the config file to override this.
- */
- if (allocatedInstances <= 0) {
- xfree(instances);
- return 0;
- }
-
- if (xf86DoProbe) {
- xfree(instances);
- return numFound;
- }
-
- if (xf86DoConfigure && xf86DoConfigurePass1) {
- GDevPtr pGDev;
- int actualcards = 0;
- for (i = 0; i < allocatedInstances; i++) {
- pPci = instances[i].pci;
- if (instances[i].foundHW) {
- if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
- continue;
- actualcards++;
- pGDev = xf86AddDeviceToConfigure(drvp->driverName,
- instances[i].pci, -1);
- if (pGDev) {
- /*
- * XF86Match???Instances() treat chipID and chipRev as
- * overrides, so clobber them here.
- */
- pGDev->chipID = pGDev->chipRev = -1;
- }
- }
- }
- xfree(instances);
- return actualcards;
- }
-
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
-#endif
-
- /*
- * Check for devices that need duplicated instances. This is required
- * when there is more than one screen per entity.
- *
- * XXX This currently doesn't work for cases where the BusID isn't
- * specified explicitly in the config file.
- */
-
- for (j = 0; j < numDevs; j++) {
- if (devList[j]->screen > 0 && devList[j]->busID
- && *devList[j]->busID) {
- for (i = 0; i < allocatedInstances; i++) {
- pPci = instances[i].pci;
- if (xf86ComparePciBusString(devList[j]->busID, pPci->bus,
- pPci->device,
- pPci->func)) {
- allocatedInstances++;
- instances = xnfrealloc(instances,
- allocatedInstances *
- sizeof(struct Inst));
- instances[allocatedInstances - 1] = instances[i];
- instances[allocatedInstances - 1].screen =
- devList[j]->screen;
- numFound++;
- break;
- }
- }
- }
- }
-
- for (i = 0; i < allocatedInstances; i++) {
- pPci = instances[i].pci;
- devBus = NULL;
- dev = NULL;
- for (j = 0; j < numDevs; j++) {
- if (devList[j]->busID && *devList[j]->busID) {
- if (xf86ComparePciBusString(devList[j]->busID, pPci->bus,
- pPci->device,
- pPci->func) &&
- devList[j]->screen == instances[i].screen) {
-
- if (devBus)
- xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching Device section for "
- "instances\n\t(BusID: %s) found: %s\n",
- driverName, devList[j]->busID,
- devList[j]->identifier);
- else
- devBus = devList[j];
- }
- } else {
- /*
- * if device section without BusID is found
- * only assign to it to the primary device.
- */
- if (xf86IsPrimaryPci(pPci)) {
- xf86Msg(X_PROBED, "Assigning device section with no busID"
- " to primary device\n");
- if (dev || devBus)
- xf86MsgVerb(X_WARNING, 0,
- "%s: More than one matching Device section "
- "found: %s\n", driverName, devList[j]->identifier);
- else
- dev = devList[j];
- }
- }
- }
- if (devBus) dev = devBus; /* busID preferred */
- if (!dev) {
- if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) {
- xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
- "for instance (BusID PCI:%i:%i:%i) found\n",
- driverName, pPci->bus, pPci->device, pPci->func);
- }
- } else {
- numClaimedInstances++;
- instances[i].claimed = TRUE;
- instances[i].dev = dev;
- }
- }
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
-#endif
- /*
- * Now check that a chipset or chipID override in the device section
- * is valid. Chipset has precedence over chipID.
- * If chipset is not valid ignore BusSlot completely.
- */
- for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
- if (!instances[i].claimed) {
- continue;
- }
- from = X_PROBED;
- if (instances[i].dev->chipset) {
- for (c = chipsets; c->token >= 0; c++) {
- if (xf86NameCmp(c->name, instances[i].dev->chipset) == 0)
- break;
- }
- if (c->token == -1) {
- instances[i].claimed = FALSE;
- numClaimedInstances--;
- xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
- "section \"%s\" isn't valid for this driver\n",
- driverName, instances[i].dev->chipset,
- instances[i].dev->identifier);
- } else {
- instances[i].chip = c->token;
-
- for (id = PCIchipsets; id->numChipset >= 0; id++) {
- if (id->numChipset == instances[i].chip)
- break;
- }
- if(id->numChipset >=0){
- xf86Msg(X_CONFIG,"Chipset override: %s\n",
- instances[i].dev->chipset);
- from = X_CONFIG;
- } else {
- instances[i].claimed = FALSE;
- numClaimedInstances--;
- xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
- "section \"%s\" isn't a valid PCI chipset\n",
- driverName, instances[i].dev->chipset,
- instances[i].dev->identifier);
- }
- }
- } else if (instances[i].dev->chipID > 0) {
- for (id = PCIchipsets; id->numChipset >= 0; id++) {
- if (id->PCIid == instances[i].dev->chipID)
- break;
- }
- if (id->numChipset == -1) {
- instances[i].claimed = FALSE;
- numClaimedInstances--;
- xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
- "section \"%s\" isn't valid for this driver\n",
- driverName, instances[i].dev->chipID,
- instances[i].dev->identifier);
- } else {
- instances[i].chip = id->numChipset;
-
- xf86Msg( X_CONFIG,"ChipID override: 0x%04X\n",
- instances[i].dev->chipID);
- from = X_CONFIG;
- }
- } else if (!instances[i].foundHW) {
- /*
- * This means that there was no override and the PCI chipType
- * doesn't match one that is supported
- */
- instances[i].claimed = FALSE;
- numClaimedInstances--;
- }
- if (instances[i].claimed == TRUE){
- for (c = chipsets; c->token >= 0; c++) {
- if (c->token == instances[i].chip)
- break;
- }
- xf86Msg(from,"Chipset %s found\n",
- c->name);
- }
- }
-
- /*
- * Of the claimed instances, check that another driver hasn't already
- * claimed its slot.
- */
- numFound = 0;
- for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
-
- if (!instances[i].claimed)
- continue;
- pPci = instances[i].pci;
-
-
- /*
- * Allow the same entity to be used more than once for devices with
- * multiple screens per entity. This assumes implicitly that there
- * will be a screen == 0 instance.
- *
- * XXX Need to make sure that two different drivers don't claim
- * the same screen > 0 instance.
- */
- if (instances[i].screen == 0 &&
- !xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
- continue;
-
-#ifdef DEBUG
- ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
- driverName, pPci->bus, pPci->device, pPci->func);
-#endif
-
- /* Allocate an entry in the lists to be returned */
- numFound++;
- retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
- retEntities[numFound - 1]
- = xf86ClaimPciSlot(pPci->bus, pPci->device,
- pPci->func,drvp, instances[i].chip,
- instances[i].dev,instances[i].dev->active ?
- TRUE : FALSE);
- if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) {
- for (j = 0; j < xf86NumEntities; j++) {
- EntityPtr pEnt = xf86Entities[j];
- if (pEnt->busType != BUS_PCI)
- continue;
- if (pEnt->pciBusId.bus == pPci->bus &&
- pEnt->pciBusId.device == pPci->device &&
- pEnt->pciBusId.func == pPci->func) {
- retEntities[numFound - 1] = j;
- xf86AddDevToEntity(j, instances[i].dev);
- break;
- }
- }
- }
- }
- xfree(instances);
- if (numFound > 0) {
- *foundEntities = retEntities;
- }
-
- return numFound;
-}
-
-int
-xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
- IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList,
- int numDevs, int **foundEntities)
-{
- SymTabRec *c;
- IsaChipsets *Chips;
- int i;
- int numFound = 0;
- int foundChip = -1;
- int *retEntities = NULL;
-
- *foundEntities = NULL;
-
-#if defined(__sparc__) || defined(__powerpc__)
- FindIsaDevice = NULL; /* Temporary */
-#endif
-
- if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) {
- if (FindIsaDevice &&
- ((foundChip = (*FindIsaDevice)(NULL)) != -1)) {
- xf86AddDeviceToConfigure(drvp->driverName, NULL, foundChip);
- return 1;
- }
- return 0;
- }
-
- for (i = 0; i < numDevs; i++) {
- MessageType from = X_CONFIG;
- GDevPtr dev = NULL;
- GDevPtr devBus = NULL;
-
- if (devList[i]->busID && *devList[i]->busID) {
- if (xf86ParseIsaBusString(devList[i]->busID)) {
- if (devBus) xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching Device "
- "section for ISA-Bus found: %s\n",
- driverName,devList[i]->identifier);
- else devBus = devList[i];
- }
- } else {
- if (xf86IsPrimaryIsa()) {
- if (dev) xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching "
- "Device section found: %s\n",
- driverName,devList[i]->identifier);
- else dev = devList[i];
- }
- }
- if (devBus) dev = devBus;
- if (dev) {
- if (dev->chipset) {
- for (c = chipsets; c->token >= 0; c++) {
- if (xf86NameCmp(c->name, dev->chipset) == 0)
- break;
- }
- if (c->token == -1) {
- xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
- "section \"%s\" isn't valid for this driver\n",
- driverName, dev->chipset,
- dev->identifier);
- } else
- foundChip = c->token;
- } else {
- if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev);
- /* Probe it */
- from = X_PROBED;
- }
- }
-
- /* Check if the chip type is listed in the chipset table - for sanity*/
-
- if (foundChip >= 0){
- for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) {
- if (Chips->numChipset == foundChip)
- break;
- }
- if (Chips->numChipset == -1){
- foundChip = -1;
- xf86MsgVerb(X_WARNING,0,
- "%s: Driver detected unknown ISA-Bus Chipset\n",
- driverName);
- }
- }
- if (foundChip != -1) {
- numFound++;
- retEntities = xnfrealloc(retEntities,numFound * sizeof(int));
- retEntities[numFound - 1] =
- xf86ClaimIsaSlot(drvp,foundChip,dev, dev->active ? TRUE : FALSE);
- for (c = chipsets; c->token >= 0; c++) {
- if (c->token == foundChip)
- break;
- }
- xf86Msg(from, "Chipset %s found\n", c->name);
- }
- }
- *foundEntities = retEntities;
-
- return numFound;
-}
-
-/*
- * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
- */
-void
-xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
- void (*ProtectRegs)(ScrnInfoPtr, Bool),
- void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
- int maskval, int knownclkindex, int knownclkvalue)
-{
- register int status = vertsyncreg;
- unsigned long i, cnt, rcnt, sync;
-
- /* First save registers that get written on */
- (*ClockFunc)(pScrn, CLK_REG_SAVE);
-
- xf86SetPriority(TRUE);
-
- if (num > MAXCLOCKS)
- num = MAXCLOCKS;
-
- for (i = 0; i < num; i++)
- {
- if (ProtectRegs)
- (*ProtectRegs)(pScrn, TRUE);
- if (!(*ClockFunc)(pScrn, i))
- {
- pScrn->clock[i] = -1;
- continue;
- }
- if (ProtectRegs)
- (*ProtectRegs)(pScrn, FALSE);
- if (BlankScreen)
- (*BlankScreen)(pScrn, FALSE);
-
- usleep(50000); /* let VCO stabilise */
-
- cnt = 0;
- sync = 200000;
-
- /* XXX How critical is this? */
- if (!xf86DisableInterrupts())
- {
- (*ClockFunc)(pScrn, CLK_REG_RESTORE);
- ErrorF("Failed to disable interrupts during clock probe. If\n");
- ErrorF("your OS does not support disabling interrupts, then you\n");
- FatalError("must specify a Clocks line in the XF86Config file.\n");
- }
- while ((inb(status) & maskval) == 0x00)
- if (sync-- == 0) goto finish;
- /* Something appears to be happening, so reset sync count */
- sync = 200000;
- while ((inb(status) & maskval) == maskval)
- if (sync-- == 0) goto finish;
- /* Something appears to be happening, so reset sync count */
- sync = 200000;
- while ((inb(status) & maskval) == 0x00)
- if (sync-- == 0) goto finish;
-
- for (rcnt = 0; rcnt < 5; rcnt++)
- {
- while (!(inb(status) & maskval))
- cnt++;
- while ((inb(status) & maskval))
- cnt++;
- }
-
-finish:
- xf86EnableInterrupts();
-
- pScrn->clock[i] = cnt ? cnt : -1;
- if (BlankScreen)
- (*BlankScreen)(pScrn, TRUE);
- }
-
- xf86SetPriority(FALSE);
-
- for (i = 0; i < num; i++)
- {
- if (i != knownclkindex)
- {
- if (pScrn->clock[i] == -1)
- {
- pScrn->clock[i] = 0;
- }
- else
- {
- pScrn->clock[i] = (int)(0.5 +
- (((float)knownclkvalue) * pScrn->clock[knownclkindex]) /
- (pScrn->clock[i]));
- /* Round to nearest 10KHz */
- pScrn->clock[i] += 5;
- pScrn->clock[i] /= 10;
- pScrn->clock[i] *= 10;
- }
- }
- }
-
- pScrn->clock[knownclkindex] = knownclkvalue;
- pScrn->numClocks = num;
-
- /* Restore registers that were written on */
- (*ClockFunc)(pScrn, CLK_REG_RESTORE);
-}
-
-void
-xf86SetPriority(Bool up)
-{
- static int saved_nice;
-
- if (up) {
-#ifdef HAS_SETPRIORITY
- saved_nice = getpriority(PRIO_PROCESS, 0);
- setpriority(PRIO_PROCESS, 0, -20);
-#endif
-#if defined(SYSV) || defined(SVR4) || defined(linux)
- saved_nice = nice(0);
- nice(-20 - saved_nice);
-#endif
- } else {
-#ifdef HAS_SETPRIORITY
- setpriority(PRIO_PROCESS, 0, saved_nice);
-#endif
-#if defined(SYSV) || defined(SVR4) || defined(linux)
- nice(20 + saved_nice);
-#endif
- }
-}
-
-const char *
-xf86GetVisualName(int visual)
-{
- if (visual < 0 || visual > DirectColor)
- return NULL;
-
- return xf86VisualNames[visual];
-}
-
-
-int
-xf86GetVerbosity()
-{
- return max(xf86Verbose, xf86LogVerbose);
-}
-
-Pix24Flags
-xf86GetPix24()
-{
- return xf86Info.pixmap24;
-}
-
-
-int
-xf86GetDepth()
-{
- return xf86Depth;
-}
-
-
-rgb
-xf86GetWeight()
-{
- return xf86Weight;
-}
-
-
-Gamma
-xf86GetGamma()
-{
- return xf86Gamma;
-}
-
-
-Bool
-xf86GetFlipPixels()
-{
- return xf86FlipPixels;
-}
-
-
-const char *
-xf86GetServerName()
-{
- return xf86ServerName;
-}
-
-
-Bool
-xf86ServerIsExiting()
-{
- return (dispatchException & DE_TERMINATE) == DE_TERMINATE;
-}
-
-
-Bool
-xf86ServerIsResetting()
-{
- return xf86Resetting;
-}
-
-
-Bool
-xf86ServerIsInitialising()
-{
- return xf86Initialising;
-}
-
-
-Bool
-xf86ServerIsOnlyDetecting(void)
-{
- return xf86DoProbe || xf86DoConfigure;
-}
-
-
-Bool
-xf86ServerIsOnlyProbing(void)
-{
- return xf86ProbeOnly;
-}
-
-
-Bool
-xf86CaughtSignal()
-{
- return xf86Info.caughtSignal;
-}
-
-
-Bool
-xf86GetVidModeAllowNonLocal()
-{
- return xf86Info.vidModeAllowNonLocal;
-}
-
-
-Bool
-xf86GetVidModeEnabled()
-{
- return xf86Info.vidModeEnabled;
-}
-
-Bool
-xf86GetModInDevAllowNonLocal()
-{
- return xf86Info.miscModInDevAllowNonLocal;
-}
-
-
-Bool
-xf86GetModInDevEnabled()
-{
- return xf86Info.miscModInDevEnabled;
-}
-
-
-Bool
-xf86GetAllowMouseOpenFail()
-{
- return xf86Info.allowMouseOpenFail;
-}
-
-
-Bool
-xf86IsPc98()
-{
-#if defined(i386) || defined(__i386__)
- return xf86Info.pc98;
-#else
- return FALSE;
-#endif
-}
-
-void
-xf86DisableRandR()
-{
- xf86Info.disableRandR = TRUE;
- xf86Info.randRFrom = X_PROBED;
-}
-
-CARD32
-xf86GetVersion()
-{
- return XF86_VERSION_CURRENT;
-}
-
-CARD32
-xf86GetModuleVersion(pointer module)
-{
-#ifdef XFree86LOADER
- return (CARD32)LoaderGetModuleVersion(module);
-#else
- return 0;
-#endif
-}
-
-pointer
-xf86LoadDrvSubModule(DriverPtr drv, const char *name)
-{
-#ifdef XFree86LOADER
- pointer ret;
- int errmaj = 0, errmin = 0;
-
- ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL,
- &errmaj, &errmin);
- if (!ret)
- LoaderErrorMsg(NULL, name, errmaj, errmin);
- return ret;
-#else
- return (pointer)1;
-#endif
-}
-
-pointer
-xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
-{
-#ifdef XFree86LOADER
- pointer ret;
- int errmaj = 0, errmin = 0;
-
- ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL,
- &errmaj, &errmin);
- if (!ret)
- LoaderErrorMsg(pScrn->name, name, errmaj, errmin);
- return ret;
-#else
- return (pointer)1;
-#endif
-}
-
-/*
- * xf86LoadOneModule loads a single module.
- */
-pointer
-xf86LoadOneModule(char *name, pointer opt)
-{
-#ifdef XFree86LOADER
- int errmaj, errmin;
-#endif
- char *Name;
- pointer mod;
-
- if (!name)
- return NULL;
-
-#ifndef NORMALISE_MODULE_NAME
- Name = xstrdup(name);
-#else
- /* Normalise the module name */
- Name = xf86NormalizeName(name);
-#endif
-
- /* Skip empty names */
- if (Name == NULL)
- return NULL;
- if (*Name == '\0') {
- xfree(Name);
- return NULL;
- }
-
-#ifdef XFree86LOADER
- mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin);
- if (!mod)
- LoaderErrorMsg(NULL, Name, errmaj, errmin);
-#else
- mod = (pointer)1;
-#endif
- xfree(Name);
- return mod;
-}
-
-void
-xf86UnloadSubModule(pointer mod)
-{
- /*
- * This is disabled for now. The loader isn't smart enough yet to undo
- * relocations.
- */
-#if defined(XFree86LOADER) && 0
- UnloadSubModule(mod);
-#endif
-}
-
-Bool
-xf86LoaderCheckSymbol(const char *name)
-{
-#ifdef XFree86LOADER
- return LoaderSymbol(name) != NULL;
-#else
- return TRUE;
-#endif
-}
-
-void
-xf86LoaderReqSymLists(const char **list0, ...)
-{
-#ifdef XFree86LOADER
- va_list ap;
-
- va_start(ap, list0);
- LoaderVReqSymLists(list0, ap);
- va_end(ap);
-#endif
-}
-
-void
-xf86LoaderReqSymbols(const char *sym0, ...)
-{
-#ifdef XFree86LOADER
- va_list ap;
-
- va_start(ap, sym0);
- LoaderVReqSymbols(sym0, ap);
- va_end(ap);
-#endif
-}
-
-void
-xf86LoaderRefSymLists(const char **list0, ...)
-{
-#ifdef XFree86LOADER
- va_list ap;
-
- va_start(ap, list0);
- LoaderVRefSymLists(list0, ap);
- va_end(ap);
-#endif
-}
-
-void
-xf86LoaderRefSymbols(const char *sym0, ...)
-{
-#ifdef XFree86LOADER
- va_list ap;
-
- va_start(ap, sym0);
- LoaderVRefSymbols(sym0, ap);
- va_end(ap);
-#endif
-}
-
-
-typedef enum {
- OPTION_BACKING_STORE
-} BSOpts;
-
-static const OptionInfoRec BSOptions[] = {
- { OPTION_BACKING_STORE, "BackingStore", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
-};
-
-void
-xf86SetBackingStore(ScreenPtr pScreen)
-{
- Bool useBS = FALSE;
- MessageType from = X_DEFAULT;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- OptionInfoPtr options;
-
- options = xnfalloc(sizeof(BSOptions));
- (void)memcpy(options, BSOptions, sizeof(BSOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- /* check for commandline option here */
- if (xf86bsEnableFlag) {
- from = X_CMDLINE;
- useBS = TRUE;
- } else if (xf86bsDisableFlag) {
- from = X_CMDLINE;
- useBS = FALSE;
- } else {
- if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS))
- from = X_CONFIG;
- }
- xfree(options);
- pScreen->backingStoreSupport = useBS ? Always : NotUseful;
- if (serverGeneration == 1)
- xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n",
- useBS ? "enabled" : "disabled");
-}
-
-
-typedef enum {
- OPTION_SILKEN_MOUSE
-} SMOpts;
-
-static const OptionInfoRec SMOptions[] = {
- { OPTION_SILKEN_MOUSE, "SilkenMouse", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
-};
-
-void
-xf86SetSilkenMouse (ScreenPtr pScreen)
-{
- Bool useSM = TRUE;
- MessageType from = X_DEFAULT;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- OptionInfoPtr options;
-
- options = xnfalloc(sizeof(SMOptions));
- (void)memcpy(options, SMOptions, sizeof(SMOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- /* check for commandline option here */
- /* disable if screen shares resources */
- if (((pScrn->racMemFlags & RAC_CURSOR) &&
- !xf86NoSharedResources(pScrn->scrnIndex,MEM)) ||
- ((pScrn->racIoFlags & RAC_CURSOR) &&
- !xf86NoSharedResources(pScrn->scrnIndex,IO))) {
- useSM = FALSE;
- from = X_PROBED;
- } else if (xf86silkenMouseDisableFlag) {
- from = X_CMDLINE;
- useSM = FALSE;
- } else {
- if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM))
- from = X_CONFIG;
- }
- xfree(options);
- /*
- * XXX quick hack to report correctly for OSs that can't do SilkenMouse
- * yet. Should handle this differently so that alternate async methods
- * like Xqueue work correctly with this too.
- */
- pScrn->silkenMouse = useSM && xf86SIGIOSupported();
- if (serverGeneration == 1)
- xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n",
- pScrn->silkenMouse ? "enabled" : "disabled");
-}
-
-/* Wrote this function for the PM2 Xv driver, preliminary. */
-
-pointer
-xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
- char **adaptor_name, pointer *adaptor_options)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- confXvAdaptorPtr adaptor;
- int i;
-
- if (adaptor_index >= pScrn->confScreen->numxvadaptors) {
- if (adaptor_name) *adaptor_name = NULL;
- if (adaptor_options) *adaptor_options = NULL;
- return NULL;
- }
-
- adaptor = &pScrn->confScreen->xvadaptors[adaptor_index];
- if (adaptor_name) *adaptor_name = adaptor->identifier;
- if (adaptor_options) *adaptor_options = adaptor->options;
-
- for (i = 0; i < adaptor->numports; i++)
- if (!xf86NameCmp(adaptor->ports[i].identifier, port_name))
- return adaptor->ports[i].options;
-
- return NULL;
-}
-
-/* Rather than duplicate loader's get OS function, just include it directly */
-#define LoaderGetOS xf86GetOS
-#include "loader/os.c"
-
-/* new RAC */
-/*
- * xf86ConfigIsa/PciEntity() -- These helper functions assign an
- * active entity to a screen, registers its fixed resources, assign
- * special enter/leave functions and their private scratch area to
- * this entity, take the dog for a walk...
- */
-ScrnInfoPtr
-xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
- IsaChipsets *i_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return pScrn;
-
- if (!(pEnt->location.type == BUS_ISA)) {
- xfree(pEnt);
- return pScrn;
- }
-
- if (!pEnt->active) {
- xf86ConfigIsaEntityInactive(pEnt, i_chip, res, init, enter,
- leave, private);
- return pScrn;
- }
-
- if (!pScrn)
- pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,entityIndex);
- }
- xfree(pEnt);
- xf86ClaimFixedResources(res,entityIndex);
- xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
-
- return pScrn;
-}
-
-ScrnInfoPtr
-xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
- PciChipsets *p_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- PciChipsets *p_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return pScrn;
-
- if (!(pEnt->location.type == BUS_PCI)
- || !xf86GetPciInfoForEntity(entityIndex)) {
- xfree(pEnt);
- return pScrn;
- }
- if (!pEnt->active) {
- xf86ConfigPciEntityInactive(pEnt, p_chip, res, init, enter,
- leave, private);
- return pScrn;
- }
-
- if (!pScrn)
- pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
- if (xf86IsEntitySharable(entityIndex)) {
- xf86SetEntityShared(entityIndex);
- }
- xf86AddEntityToScreen(pScrn,entityIndex);
- if (xf86IsEntityShared(entityIndex)) {
- return pScrn;
- }
- if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,entityIndex);
- }
- xfree(pEnt);
-
- xf86ClaimFixedResources(res,entityIndex);
- xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
-
- return pScrn;
-}
-
-ScrnInfoPtr
-xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
- EntityProc init, EntityProc enter, EntityProc leave,
- pointer private)
-{
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return pScrn;
-
- if (!(pEnt->location.type == BUS_NONE)) {
- xfree(pEnt);
- return pScrn;
- }
-
- if (!pEnt->active) {
- xf86ConfigFbEntityInactive(pEnt, init, enter, leave, private);
- return pScrn;
- }
-
- if (!pScrn)
- pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
-
- return pScrn;
-}
-
-/*
- *
- * OBSOLETE ! xf86ConfigActiveIsaEntity() and xf86ConfigActivePciEntity()
- * are obsolete functions. They the are likely to be removed
- * Don't use!
- */
-Bool
-xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
- IsaChipsets *i_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return FALSE;
-
- if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) {
- xfree(pEnt);
- return FALSE;
- }
-
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,entityIndex);
- }
- xfree(pEnt);
- xf86ClaimFixedResources(res,entityIndex);
- if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
- return FALSE;
-
- return TRUE;
-}
-
-Bool
-xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
- PciChipsets *p_chip, resList res, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- PciChipsets *p_id;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- if (!pEnt) return FALSE;
-
- if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) {
- xfree(pEnt);
- return FALSE;
- }
- xf86AddEntityToScreen(pScrn,entityIndex);
-
- if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,entityIndex);
- }
- xfree(pEnt);
-
- xf86ClaimFixedResources(res,entityIndex);
- if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * xf86ConfigPci/IsaEntityInactive() -- These functions can be used
- * to configure an inactive entity as well as to reconfigure an
- * previously active entity inactive. If the entity has been
- * assigned to a screen before it will be removed. If p_pci(p_isa) is
- * non-NULL all static resources listed there will be registered.
- */
-void
-xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
- resList res, EntityProc init, EntityProc enter,
- EntityProc leave, pointer private)
-{
- PciChipsets *p_id;
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- else if (p_chip) {
- for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
- if (pEnt->chipset == p_id->numChipset) break;
- }
- xf86ClaimFixedResources(p_id->resList,pEnt->index);
- }
- xf86ClaimFixedResources(res,pEnt->index);
- /* shared resources are only needed when entity is active: remove */
- xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
-void
-xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
- resList res, EntityProc init, EntityProc enter,
- EntityProc leave, pointer private)
-{
- IsaChipsets *i_id;
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- else if (i_chip) {
- for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
- if (pEnt->chipset == i_id->numChipset) break;
- }
- xf86ClaimFixedResources(i_id->resList,pEnt->index);
- }
- xf86ClaimFixedResources(res,pEnt->index);
- /* shared resources are only needed when entity is active: remove */
- xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
-void
-xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
- EntityProc enter, EntityProc leave, pointer private)
-{
- ScrnInfoPtr pScrn;
-
- if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
- xf86RemoveEntityFromScreen(pScrn,pEnt->index);
- xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
-}
-
-Bool
-xf86IsScreenPrimary(int scrnIndex)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- int i;
-
- for (i=0 ; i < pScrn->numEntities; i++) {
- if (xf86IsEntityPrimary(i))
- return TRUE;
- }
- return FALSE;
-}
-
-int
-xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
- int format, unsigned long len, pointer value )
-{
- PropertyPtr pNewProp, pRegProp;
- int i;
-
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty(%d, %d, %d, %d, %d, %p)\n",
- ScrnIndex, property, type, format, len, value);
-#endif
-
- if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
- return(BadMatch);
- }
-
- if ( (pNewProp = (PropertyPtr)xalloc(sizeof(PropertyRec)))==NULL ) {
- return(BadAlloc);
- }
-
- pNewProp->propertyName = property;
- pNewProp->type = type;
- pNewProp->format = format;
- pNewProp->size = len;
- pNewProp->data = value;
- /* We will put this property at the end of the list so that
- * the changes are made in the order they were requested.
- */
- pNewProp->next = NULL;
-
-#ifdef DEBUG
- ErrorF("new property filled\n");
-#endif
-
- if (NULL==xf86RegisteredPropertiesTable) {
-#ifdef DEBUG
- ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n",
- xf86NumScreens);
-#endif
- if ( NULL==(xf86RegisteredPropertiesTable=(PropertyPtr*)xnfcalloc(sizeof(PropertyPtr),xf86NumScreens) )) {
- return(BadAlloc);
- }
- for (i=0; i<xf86NumScreens; i++) {
- xf86RegisteredPropertiesTable[i] = NULL;
- }
- }
-
-#ifdef DEBUG
- ErrorF("xf86RegisteredPropertiesTable %p\n",
- xf86RegisteredPropertiesTable);
- ErrorF("xf86RegisteredPropertiesTable[%d] %p\n",
- ScrnIndex, xf86RegisteredPropertiesTable[ScrnIndex]);
-#endif
-
- if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
- xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp;
- } else {
- pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
- while (pRegProp->next != NULL) {
-#ifdef DEBUG
- ErrorF("- next %p\n", pRegProp);
-#endif
- pRegProp = pRegProp->next;
- }
- pRegProp->next = pNewProp;
- }
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty succeeded\n");
-#endif
- return(Success);
-}
-
-Bool
-xf86IsUnblank(int mode)
-{
- switch(mode) {
- case SCREEN_SAVER_OFF:
- case SCREEN_SAVER_FORCER:
- return TRUE;
- case SCREEN_SAVER_ON:
- case SCREEN_SAVER_CYCLE:
- return FALSE;
- default:
- xf86MsgVerb(X_WARNING, 0, "Unexpected save screen mode: %d\n", mode);
- return TRUE;
- }
-}
diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h
deleted file mode 100644
index 32e3c8e1d..000000000
--- a/hw/xfree86/common/xf86InPriv.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.5 2003/08/24 17:36:52 dawes Exp $ */
-
-/*
- * Copyright (c) 1999 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _xf86InPriv_h
-#define _xf86InPriv_h
-
-/* xf86Globals.c */
-#ifdef XFree86LOADER
-extern InputDriverPtr *xf86InputDriverList;
-#else
-extern InputDriverPtr xf86InputDriverList[];
-#endif
-extern int xf86NumInputDrivers;
-
-/* xf86Xinput.c */
-void xf86ActivateDevice(InputInfoPtr pInfo);
-
-#endif /* _xf86InPriv_h */
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
deleted file mode 100644
index ce8817096..000000000
--- a/hw/xfree86/common/xf86Init.c
+++ /dev/null
@@ -1,1922 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.211 2003/11/01 00:47:01 dawes Exp $ */
-
-/*
- * Loosely based on code bearing the following copyright:
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- */
-/*
- * Copyright (c) 1992-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include <stdlib.h>
-
-#undef HAS_UTSNAME
-#if !defined(WIN32) && !defined(__UNIXOS2__)
-#define HAS_UTSNAME 1
-#include <sys/utsname.h>
-#endif
-
-#define NEED_EVENTS
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "Xatom.h"
-#include "input.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "site.h"
-#include "mi.h"
-
-#include "compiler.h"
-
-#ifdef XFree86LOADER
-#include "loaderProcs.h"
-#endif
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-#define XF86_OS_PRIVS
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Config.h"
-#include "xf86_OSlib.h"
-#include "xf86Version.h"
-#include "xf86Date.h"
-#include "xf86Build.h"
-#include "mipointer.h"
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#else
-#include "inputstr.h"
-#endif
-#include "xf86DDC.h"
-#include "xf86Xinput.h"
-#include "xf86InPriv.h"
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-#include "globals.h"
-
-#ifdef XTESTEXT1
-#include "atKeynames.h"
-extern int xtest_command_key;
-#endif /* XTESTEXT1 */
-
-
-/* forward declarations */
-
-static void xf86PrintBanner(void);
-static void xf86PrintMarkers(void);
-static void xf86RunVtInit(void);
-
-#ifdef DO_CHECK_BETA
-static int extraDays = 0;
-static char *expKey = NULL;
-#endif
-
-#ifdef __UNIXOS2__
-extern void os2ServerVideoAccess();
-#endif
-
-void (*xf86OSPMClose)(void) = NULL;
-
-#ifdef XFree86LOADER
-static char *baseModules[] = {
- "bitmap",
- "pcidata",
- NULL
-};
-#endif
-
-/* Common pixmap formats */
-
-static PixmapFormatRec formats[MAXFORMATS] = {
- { 1, 1, BITMAP_SCANLINE_PAD },
- { 4, 8, BITMAP_SCANLINE_PAD },
- { 8, 8, BITMAP_SCANLINE_PAD },
- { 15, 16, BITMAP_SCANLINE_PAD },
- { 16, 16, BITMAP_SCANLINE_PAD },
- { 24, 32, BITMAP_SCANLINE_PAD },
-#ifdef RENDER
- { 32, 32, BITMAP_SCANLINE_PAD },
-#endif
-};
-#ifdef RENDER
-static int numFormats = 7;
-#else
-static int numFormats = 6;
-#endif
-static Bool formatsDone = FALSE;
-
-InputDriverRec xf86KEYBOARD = {
- 1,
- "keyboard",
- NULL,
- NULL,
- NULL,
- NULL,
- 0
-};
-
-static Bool
-xf86CreateRootWindow(WindowPtr pWin)
-{
- int ret = TRUE;
- int err = Success;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- PropertyPtr pRegProp, pOldRegProp;
- CreateWindowProcPtr CreateWindow =
- (CreateWindowProcPtr)(pScreen->devPrivates[xf86CreateRootWindowIndex].ptr);
-
-#ifdef DEBUG
- ErrorF("xf86CreateRootWindow(%p)\n", pWin);
-#endif
-
- if ( pScreen->CreateWindow != xf86CreateRootWindow ) {
- /* Can't find hook we are hung on */
- xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */,
- "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n",
- (void *)xf86CreateRootWindow,
- (void *)pScreen->CreateWindow );
- }
-
- /* Unhook this function ... */
- pScreen->CreateWindow = CreateWindow;
- pScreen->devPrivates[xf86CreateRootWindowIndex].ptr = NULL;
-
- /* ... and call the previous CreateWindow fuction, if any */
- if (NULL!=pScreen->CreateWindow) {
- ret = (*pScreen->CreateWindow)(pWin);
- }
-
- /* Now do our stuff */
-
- if (xf86RegisteredPropertiesTable != NULL) {
- if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) {
- for (pRegProp = xf86RegisteredPropertiesTable[pScreen->myNum];
- pRegProp != NULL && err==Success;
- pRegProp = pRegProp->next )
- {
- Atom oldNameAtom = pRegProp->propertyName;
- char *nameString;
- /* propertyName was created before the screen existed,
- * so the atom does not belong to any screen;
- * we need to create a new atom with the same name.
- */
- nameString = NameForAtom(oldNameAtom);
- pRegProp->propertyName = MakeAtom(nameString, strlen(nameString), TRUE);
- err = ChangeWindowProperty(pWin,
- pRegProp->propertyName, pRegProp->type,
- pRegProp->format, PropModeReplace,
- pRegProp->size, pRegProp->data,
- FALSE
- );
- }
-
- /* Look at err */
- ret &= (err==Success);
-
- /* free memory */
- pOldRegProp = xf86RegisteredPropertiesTable[pScreen->myNum];
- while (pOldRegProp!=NULL) {
- pRegProp = pOldRegProp->next;
- xfree(pOldRegProp);
- pOldRegProp = pRegProp;
- }
- xf86RegisteredPropertiesTable[pScreen->myNum] = NULL;
- } else {
- xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with "
- "non-root window %p (parent %p)\n",
- (void *)pWin, (void *)pWin->parent);
- ret = FALSE;
- }
- }
-
-#ifdef DEBUG
- ErrorF("xf86CreateRootWindow() returns %d\n", ret);
-#endif
- return (ret);
-}
-
-
-/*
- * InitOutput --
- * Initialize screenInfo for all actually accessible framebuffers.
- * That includes vt-manager setup, querying all possible devices and
- * collecting the pixmap formats.
- */
-
-static void
-PostConfigInit(void)
-{
- /*
- * Install signal handler for unexpected signals
- */
- xf86Info.caughtSignal=FALSE;
- if (!xf86Info.notrapSignals) {
- signal(SIGSEGV,xf86SigHandler);
- signal(SIGILL,xf86SigHandler);
-#ifdef SIGEMT
- signal(SIGEMT,xf86SigHandler);
-#endif
- signal(SIGFPE,xf86SigHandler);
-#ifdef SIGBUS
- signal(SIGBUS,xf86SigHandler);
-#endif
-#ifdef SIGSYS
- signal(SIGSYS,xf86SigHandler);
-#endif
-#ifdef SIGXCPU
- signal(SIGXCPU,xf86SigHandler);
-#endif
-#ifdef SIGXFSZ
- signal(SIGXFSZ,xf86SigHandler);
-#endif
-#ifdef MEMDEBUG
- signal(SIGUSR2,xf86SigMemDebug);
-#endif
- }
-
- xf86OSPMClose = xf86OSPMOpen();
-
- /* Run an external VT Init program if specified in the config file */
- xf86RunVtInit();
-
- /* Do this after XF86Config is read (it's normally in OsInit()) */
- OsInitColors();
-}
-
-void
-InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
-{
- int i, j, k, scr_index;
- static unsigned long generation = 0;
-#ifdef XFree86LOADER
- char **modulelist;
- pointer *optionlist;
-#endif
- screenLayoutPtr layout;
- Pix24Flags screenpix24, pix24;
- MessageType pix24From = X_DEFAULT;
- Bool pix24Fail = FALSE;
- Bool autoconfig = FALSE;
-
-#ifdef __UNIXOS2__
- os2ServerVideoAccess(); /* See if we have access to the screen before doing anything */
-#endif
-
- xf86Initialising = TRUE;
-
- /* Do this early? */
- if (generation != serverGeneration) {
- xf86ScreenIndex = AllocateScreenPrivateIndex();
- xf86CreateRootWindowIndex = AllocateScreenPrivateIndex();
- xf86PixmapIndex = AllocatePixmapPrivateIndex();
- xf86RegisteredPropertiesTable=NULL;
- generation = serverGeneration;
- }
-
- if (serverGeneration == 1) {
-
- pScreenInfo->numScreens = 0;
-
- if ((xf86ServerName = strrchr(argv[0], '/')) != 0)
- xf86ServerName++;
- else
- xf86ServerName = argv[0];
-
-#ifdef DO_CHECK_BETA
- xf86CheckBeta(extraDays, expKey);
-#endif
-
- xf86PrintBanner();
- xf86PrintMarkers();
- if (xf86LogFile) {
- time_t t;
- const char *ct;
- t = time(NULL);
- ct = ctime(&t);
- xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
- xf86LogFile, ct);
- }
-
- /* Read and parse the config file */
- if (!xf86DoProbe && !xf86DoConfigure) {
- switch (xf86HandleConfigFile(FALSE)) {
- case CONFIG_OK:
- break;
- case CONFIG_PARSE_ERROR:
- xf86Msg(X_ERROR, "Error parsing the config file\n");
- return;
- case CONFIG_NOFILE:
- autoconfig = TRUE;
- break;
- }
- }
-
- if (!autoconfig)
- PostConfigInit();
-
-#ifdef XFree86LOADER
- /* Initialise the loader */
- LoaderInit();
-
- /* Tell the loader the default module search path */
- LoaderSetPath(xf86ModulePath);
-
-#ifdef TESTING
- {
- char **list, **l;
- const char *subdirs[] = {
- "drivers",
- NULL
- };
- const char *patlist[] = {
- "(.*)_drv\\.so",
- "(.*)_drv\\.o",
- NULL
- };
- ErrorF("Getting module listing...\n");
- list = LoaderListDirs(NULL, NULL);
- if (list)
- for (l = list; *l; l++)
- ErrorF("module: %s\n", *l);
- LoaderFreeDirList(list);
- ErrorF("Getting video driver listing...\n");
- list = LoaderListDirs(subdirs, NULL);
- if (list)
- for (l = list; *l; l++)
- ErrorF("video driver: %s\n", *l);
- LoaderFreeDirList(list);
- ErrorF("Getting driver listing...\n");
- list = LoaderListDirs(NULL, patlist);
- if (list)
- for (l = list; *l; l++)
- ErrorF("video driver: %s\n", *l);
- LoaderFreeDirList(list);
- }
-#endif
-
- /* Force load mandatory base modules */
- if (!xf86LoadModules(baseModules, NULL))
- FatalError("Unable to load required base modules, Exiting...\n");
-
-#endif
-
- xf86OpenConsole();
-
- /* Enable full I/O access */
- xf86EnableIO();
-
- /* Do a general bus probe. This will be a PCI probe for x86 platforms */
- xf86BusProbe();
-
- if (xf86DoProbe)
- DoProbe();
-
- if (xf86DoConfigure)
- DoConfigure();
-
- if (autoconfig) {
- if (!xf86AutoConfig()) {
- xf86Msg(X_ERROR, "Auto configuration failed\n");
- return;
- }
- PostConfigInit();
- }
-
- /* Initialise the resource broker */
- xf86ResourceBrokerInit();
-
-#ifdef XFree86LOADER
- /* Load all modules specified explicitly in the config file */
- if ((modulelist = xf86ModulelistFromConfig(&optionlist))) {
- xf86LoadModules(modulelist, optionlist);
- xfree(modulelist);
- xfree(optionlist);
- }
-
- /* Load all driver modules specified in the config file */
- if ((modulelist = xf86DriverlistFromConfig())) {
- xf86LoadModules(modulelist, NULL);
- xfree(modulelist);
- }
-
- /* Setup the builtin input drivers */
- xf86AddInputDriver(&xf86KEYBOARD, NULL, 0);
- /* Load all input driver modules specified in the config file. */
- if ((modulelist = xf86InputDriverlistFromConfig())) {
- xf86LoadModules(modulelist, NULL);
- xfree(modulelist);
- }
-
- /*
- * It is expected that xf86AddDriver()/xf86AddInputDriver will be
- * called for each driver as it is loaded. Those functions save the
- * module pointers for drivers.
- * XXX Nothing keeps track of them for other modules.
- */
- /* XXX What do we do if not all of these could be loaded? */
-#endif
-
- /*
- * At this point, xf86DriverList[] is all filled in with entries for
- * each of the drivers to try and xf86NumDrivers has the number of
- * drivers. If there are none, return now.
- */
-
- if (xf86NumDrivers == 0) {
- xf86Msg(X_ERROR, "No drivers available.\n");
- return;
- }
-
- /*
- * Call each of the Identify functions. The Identify functions print
- * out some identifying information, and anything else that might be
- * needed at this early stage.
- */
-
- for (i = 0; i < xf86NumDrivers; i++)
- /* The Identify function is mandatory, but if it isn't there continue */
- if (xf86DriverList[i]->Identify != NULL)
- xf86DriverList[i]->Identify(0);
- else {
- xf86Msg(X_WARNING, "Driver `%s' has no Identify function\n",
- xf86DriverList[i]->driverName ? xf86DriverList[i]->driverName
- : "noname");
- }
-
- /*
- * Locate bus slot that had register IO enabled at server startup
- */
-
- xf86AccessInit();
- xf86FindPrimaryDevice();
-
- /*
- * Now call each of the Probe functions. Each successful probe will
- * result in an extra entry added to the xf86Screens[] list for each
- * instance of the hardware found.
- */
-
- for (i = 0; i < xf86NumDrivers; i++) {
- if (xf86DriverList[i]->Probe != NULL)
- xf86DriverList[i]->Probe(xf86DriverList[i], PROBE_DEFAULT);
- else {
- xf86MsgVerb(X_WARNING, 0,
- "Driver `%s' has no Probe function (ignoring)\n",
- xf86DriverList[i]->driverName ? xf86DriverList[i]->driverName
- : "noname");
- }
- xf86SetPciVideo(NULL,NONE);
- }
-
- /*
- * If nothing was detected, return now.
- */
-
- if (xf86NumScreens == 0) {
- xf86Msg(X_ERROR, "No devices detected.\n");
- return;
- }
-
- /*
- * Match up the screens found by the probes against those specified
- * in the config file. Remove the ones that won't be used. Sort
- * them in the order specified.
- */
-
- /*
- * What is the best way to do this?
- *
- * For now, go through the screens allocated by the probes, and
- * look for screen config entry which refers to the same device
- * section as picked out by the probe.
- *
- */
-
- for (i = 0; i < xf86NumScreens; i++) {
- for (layout = xf86ConfigLayout.screens; layout->screen != NULL;
- layout++) {
- Bool found = FALSE;
- for (j = 0; j < xf86Screens[i]->numEntities; j++) {
-
- GDevPtr dev =
- xf86GetDevFromEntity(xf86Screens[i]->entityList[j],
- xf86Screens[i]->entityInstanceList[j]);
-
- if (dev == layout->screen->device) {
- /* A match has been found */
- xf86Screens[i]->confScreen = layout->screen;
- found = TRUE;
- break;
- }
- }
- if (found) break;
- }
- if (layout->screen == NULL) {
- /* No match found */
- xf86Msg(X_ERROR,
- "Screen %d deleted because of no matching config section.\n", i);
- xf86DeleteScreen(i--, 0);
- }
- }
-
- /*
- * If no screens left, return now.
- */
-
- if (xf86NumScreens == 0) {
- xf86Msg(X_ERROR,
- "Device(s) detected, but none match those in the config file.\n");
- return;
- }
-
- xf86PostProbe();
- xf86EntityInit();
-
- /*
- * Sort the drivers to match the requested ording. Using a slow
- * bubble sort.
- */
- for (j = 0; j < xf86NumScreens - 1; j++) {
- for (i = 0; i < xf86NumScreens - j - 1; i++) {
- if (xf86Screens[i + 1]->confScreen->screennum <
- xf86Screens[i]->confScreen->screennum) {
- ScrnInfoPtr tmpScrn = xf86Screens[i + 1];
- xf86Screens[i + 1] = xf86Screens[i];
- xf86Screens[i] = tmpScrn;
- }
- }
- }
- /* Fix up the indexes */
- for (i = 0; i < xf86NumScreens; i++) {
- xf86Screens[i]->scrnIndex = i;
- }
-
- /*
- * Call the driver's PreInit()'s to complete initialisation for the first
- * generation.
- */
-
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->PreInit &&
- xf86Screens[i]->PreInit(xf86Screens[i], 0))
- xf86Screens[i]->configured = TRUE;
- }
- for (i = 0; i < xf86NumScreens; i++)
- if (!xf86Screens[i]->configured)
- xf86DeleteScreen(i--, 0);
-
- /*
- * If no screens left, return now.
- */
-
- if (xf86NumScreens == 0) {
- xf86Msg(X_ERROR,
- "Screen(s) found, but none have a usable configuration.\n");
- return;
- }
-
- /* This could be moved into a separate function */
-
- /*
- * Check that all screens have initialised the mandatory function
- * entry points. Delete those which have not.
- */
-
-#define WARN_SCREEN(func) \
- xf86Msg(X_ERROR, "Driver `%s' has no %s function, deleting.\n", \
- xf86Screens[i]->name, (warned++, func))
-
- for (i = 0; i < xf86NumScreens; i++) {
- int warned = 0;
- if (xf86Screens[i]->name == NULL) {
- xf86Screens[i]->name = xnfalloc(strlen("screen") + 1 + 1);
- if (i < 10)
- sprintf(xf86Screens[i]->name, "screen%c", i + '0');
- else
- sprintf(xf86Screens[i]->name, "screen%c", i - 10 + 'A');
- xf86MsgVerb(X_WARNING, 0,
- "Screen driver %d has no name set, using `%s'.\n",
- i, xf86Screens[i]->name);
- }
- if (xf86Screens[i]->ScreenInit == NULL)
- WARN_SCREEN("ScreenInit");
- if (xf86Screens[i]->EnterVT == NULL)
- WARN_SCREEN("EnterVT");
- if (xf86Screens[i]->LeaveVT == NULL)
- WARN_SCREEN("LeaveVT");
- if (warned)
- xf86DeleteScreen(i--, 0);
- }
-
- /*
- * If no screens left, return now.
- */
-
- if (xf86NumScreens == 0) {
- xf86Msg(X_ERROR, "Screen(s) found, but drivers were unusable.\n");
- return;
- }
-
- /* XXX Should this be before or after loading dependent modules? */
- if (xf86ProbeOnly)
- {
- OsCleanup(TRUE);
- AbortDDX();
- fflush(stderr);
- exit(0);
- }
-
-#ifdef XFree86LOADER
- /* Remove (unload) drivers that are not required */
- for (i = 0; i < xf86NumDrivers; i++)
- if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0)
- xf86DeleteDriver(i);
-#endif
-
- /*
- * At this stage we know how many screens there are.
- */
-
- for (i = 0; i < xf86NumScreens; i++)
- xf86InitViewport(xf86Screens[i]);
-
- /*
- * Collect all pixmap formats and check for conflicts at the display
- * level. Should we die here? Or just delete the offending screens?
- * Also, should this be done for -probeonly?
- */
- screenpix24 = Pix24DontCare;
- for (i = 0; i < xf86NumScreens; i++) {
- if (xf86Screens[i]->imageByteOrder !=
- xf86Screens[0]->imageByteOrder)
- FatalError("Inconsistent display bitmapBitOrder. Exiting\n");
- if (xf86Screens[i]->bitmapScanlinePad !=
- xf86Screens[0]->bitmapScanlinePad)
- FatalError("Inconsistent display bitmapScanlinePad. Exiting\n");
- if (xf86Screens[i]->bitmapScanlineUnit !=
- xf86Screens[0]->bitmapScanlineUnit)
- FatalError("Inconsistent display bitmapScanlineUnit. Exiting\n");
- if (xf86Screens[i]->bitmapBitOrder !=
- xf86Screens[0]->bitmapBitOrder)
- FatalError("Inconsistent display bitmapBitOrder. Exiting\n");
-
- /* Determine the depth 24 pixmap format the screens would like */
- if (xf86Screens[i]->pixmap24 != Pix24DontCare) {
- if (screenpix24 == Pix24DontCare)
- screenpix24 = xf86Screens[i]->pixmap24;
- else if (screenpix24 != xf86Screens[i]->pixmap24)
- FatalError("Inconsistent depth 24 pixmap format. Exiting\n");
- }
- }
- /* check if screenpix24 is consistent with the config/cmdline */
- if (xf86Info.pixmap24 != Pix24DontCare) {
- pix24 = xf86Info.pixmap24;
- pix24From = xf86Info.pix24From;
- if (screenpix24 != Pix24DontCare && screenpix24 != xf86Info.pixmap24)
- pix24Fail = TRUE;
- } else if (screenpix24 != Pix24DontCare) {
- pix24 = screenpix24;
- pix24From = X_PROBED;
- } else
- pix24 = Pix24Use32;
-
- if (pix24Fail)
- FatalError("Screen(s) can't use the required depth 24 pixmap format"
- " (%d). Exiting\n", PIX24TOBPP(pix24));
-
- /* Initialise the depth 24 format */
- for (j = 0; j < numFormats && formats[j].depth != 24; j++)
- ;
- formats[j].bitsPerPixel = PIX24TOBPP(pix24);
-
- /* Collect additional formats */
- for (i = 0; i < xf86NumScreens; i++) {
- for (j = 0; j < xf86Screens[i]->numFormats; j++) {
- for (k = 0; ; k++) {
- if (k >= numFormats) {
- if (k >= MAXFORMATS)
- FatalError("Too many pixmap formats! Exiting\n");
- formats[k] = xf86Screens[i]->formats[j];
- numFormats++;
- break;
- }
- if (formats[k].depth == xf86Screens[i]->formats[j].depth) {
- if ((formats[k].bitsPerPixel ==
- xf86Screens[i]->formats[j].bitsPerPixel) &&
- (formats[k].scanlinePad ==
- xf86Screens[i]->formats[j].scanlinePad))
- break;
- FatalError("Inconsistent pixmap format for depth %d."
- " Exiting\n", formats[k].depth);
- }
- }
- }
- }
- formatsDone = TRUE;
-
- /* If a screen uses depth 24, show what the pixmap format is */
- for (i = 0; i < xf86NumScreens; i++) {
- if (xf86Screens[i]->depth == 24) {
- xf86Msg(pix24From, "Depth 24 pixmap format is %d bpp\n",
- PIX24TOBPP(pix24));
- break;
- }
- }
-
-#if BITMAP_SCANLINE_UNIT == 64
- /*
- * cfb24 doesn't currently work on architectures with a 64 bit
- * BITMAP_SCANLINE_UNIT, so check for 24 bit pixel size for pixmaps
- * or framebuffers.
- */
- {
- Bool usesCfb24 = FALSE;
-
- if (PIX24TOBPP(pix24) == 24)
- usesCfb24 = TRUE;
- for (i = 0; i < xf86NumScreens; i++)
- if (xf86Screens[i]->bitsPerPixel == 24)
- usesCfb24 = TRUE;
- if (usesCfb24) {
- FatalError("24-bit pixel size is not supported on systems with"
- " 64-bit scanlines.\n");
- }
- }
-#endif
-
-#ifdef XKB
- xf86InitXkb();
-#endif
- /* set up the proper access funcs */
- xf86PostPreInit();
-
- AddCallback(&ServerGrabCallback, xf86GrabServerCallback, NULL);
-
- } else {
- /*
- * serverGeneration != 1; some OSs have to do things here, too.
- */
- xf86OpenConsole();
-
- /*
- should we reopen it here? We need to deal with an already opened
- device. We could leave this to the OS layer. For now we simply
- close it here
- */
- if (xf86OSPMClose)
- xf86OSPMClose();
- if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
- xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
-
- /* Make sure full I/O access is enabled */
- xf86EnableIO();
- }
-
-#if 0
- /*
- * Install signal handler for unexpected signals
- */
- xf86Info.caughtSignal=FALSE;
- if (!xf86Info.notrapSignals)
- {
- signal(SIGSEGV,xf86SigHandler);
- signal(SIGILL,xf86SigHandler);
-#ifdef SIGEMT
- signal(SIGEMT,xf86SigHandler);
-#endif
- signal(SIGFPE,xf86SigHandler);
-#ifdef SIGBUS
- signal(SIGBUS,xf86SigHandler);
-#endif
-#ifdef SIGSYS
- signal(SIGSYS,xf86SigHandler);
-#endif
-#ifdef SIGXCPU
- signal(SIGXCPU,xf86SigHandler);
-#endif
-#ifdef SIGXFSZ
- signal(SIGXFSZ,xf86SigHandler);
-#endif
- }
-#endif
-
- /*
- * Use the previously collected parts to setup pScreenInfo
- */
-
- pScreenInfo->imageByteOrder = xf86Screens[0]->imageByteOrder;
- pScreenInfo->bitmapScanlinePad = xf86Screens[0]->bitmapScanlinePad;
- pScreenInfo->bitmapScanlineUnit = xf86Screens[0]->bitmapScanlineUnit;
- pScreenInfo->bitmapBitOrder = xf86Screens[0]->bitmapBitOrder;
- pScreenInfo->numPixmapFormats = numFormats;
- for (i = 0; i < numFormats; i++)
- pScreenInfo->formats[i] = formats[i];
-
- /* Make sure the server's VT is active */
-
- if (serverGeneration != 1) {
- xf86Resetting = TRUE;
- /* All screens are in the same state, so just check the first */
- if (!xf86Screens[0]->vtSema) {
-#ifdef HAS_USL_VTS
- ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
-#endif
- xf86AccessEnter();
- xf86EnterServerState(SETUP);
- }
- }
-#ifdef SCO
- else {
- /*
- * Under SCO we must ack that we got the console at startup,
- * I think this is the safest way to assure it.
- */
- static int once = 1;
- if (once) {
- once = 0;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
- xf86Msg(X_WARNING, "VT_ACKACQ failed");
- }
- }
-#endif /* SCO */
-
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- /*
- * Almost everything uses these defaults, and many of those that
- * don't, will wrap them.
- */
- xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
- xf86Screens[i]->SetDGAMode = xf86SetDGAMode;
- xf86Screens[i]->DPMSSet = NULL;
- xf86Screens[i]->LoadPalette = NULL;
- xf86Screens[i]->SetOverscan = NULL;
- scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv);
- if (scr_index == i) {
- /*
- * Hook in our ScrnInfoRec, and initialise some other pScreen
- * fields.
- */
- screenInfo.screens[scr_index]->devPrivates[xf86ScreenIndex].ptr
- = (pointer)xf86Screens[i];
- xf86Screens[i]->pScreen = screenInfo.screens[scr_index];
- /* The driver should set this, but make sure it is set anyway */
- xf86Screens[i]->vtSema = TRUE;
- } else {
- /* This shouldn't normally happen */
- FatalError("AddScreen/ScreenInit failed for driver %d\n", i);
- }
-
-#ifdef DEBUG
- ErrorF("InitOutput - xf86Screens[%d]->pScreen = %p\n",
- i, xf86Screens[i]->pScreen );
- ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
- i, xf86Screens[i]->pScreen->CreateWindow );
-#endif
-
- screenInfo.screens[scr_index]->devPrivates[xf86CreateRootWindowIndex].ptr
- = (void*)(xf86Screens[i]->pScreen->CreateWindow);
- xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow;
-
-#ifdef RENDER
- if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown)
- {
- xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC);
- PictureSetSubpixelOrder (xf86Screens[i]->pScreen,
- DDC ?
- (DDC->features.input_type ?
- SubPixelHorizontalRGB : SubPixelNone) :
- SubPixelUnknown);
- }
-#endif
-#ifdef RANDR
- if (!xf86Info.disableRandR)
- xf86RandRInit (screenInfo.screens[scr_index]);
- xf86Msg(xf86Info.randRFrom, "RandR %s\n",
- xf86Info.disableRandR ? "disabled" : "enabled");
-#endif
-#ifdef NOT_USED
- /*
- * Here we have to let the driver getting access of the VT. Note that
- * this doesn't mean that the graphics board may access automatically
- * the monitor. If the monitor is shared this is done in xf86CrossScreen!
- */
- if (!xf86Info.sharedMonitor) (xf86Screens[i]->EnterLeaveMonitor)(ENTER);
-#endif
- }
-
-#ifdef XFree86LOADER
- if ((serverGeneration == 1) && LoaderCheckUnresolved(LD_RESOLV_IFDONE)) {
- /* For now, just a warning */
- xf86Msg(X_WARNING, "Some symbols could not be resolved!\n");
- }
-#endif
-
- xf86PostScreenInit();
-
- xf86InitOrigins();
-
- xf86Resetting = FALSE;
- xf86Initialising = FALSE;
-
- RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, xf86Wakeup,
- NULL);
-}
-
-
-static InputDriverPtr
-MatchInput(IDevPtr pDev)
-{
- int i;
-
- for (i = 0; i < xf86NumInputDrivers; i++) {
- if (xf86InputDriverList[i] && xf86InputDriverList[i]->driverName &&
- xf86NameCmp(pDev->driver, xf86InputDriverList[i]->driverName) == 0)
- return xf86InputDriverList[i];
- }
- return NULL;
-}
-
-
-/*
- * InitInput --
- * Initialize all supported input devices.
- */
-
-void
-InitInput(argc, argv)
- int argc;
- char **argv;
-{
- IDevPtr pDev;
- InputDriverPtr pDrv;
- InputInfoPtr pInfo;
- static InputInfoPtr coreKeyboard = NULL, corePointer = NULL;
-
- xf86Info.vtRequestsPending = FALSE;
- xf86Info.inputPending = FALSE;
-#ifdef XTESTEXT1
- xtest_command_key = KEY_Begin + MIN_KEYCODE;
-#endif /* XTESTEXT1 */
-
- if (serverGeneration == 1) {
- /* Call the PreInit function for each input device instance. */
- for (pDev = xf86ConfigLayout.inputs; pDev && pDev->identifier; pDev++) {
- /* XXX The keyboard driver is a special case for now. */
- if (!xf86NameCmp(pDev->driver, "keyboard")) {
- xf86Msg(X_INFO, "Keyboard \"%s\" handled by legacy driver\n",
- pDev->identifier);
- continue;
- }
- if ((pDrv = MatchInput(pDev)) == NULL) {
- xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver);
- /* XXX For now, just continue. */
- continue;
- }
- if (!pDrv->PreInit) {
- xf86MsgVerb(X_WARNING, 0,
- "Input driver `%s' has no PreInit function (ignoring)\n",
- pDrv->driverName);
- continue;
- }
- pInfo = pDrv->PreInit(pDrv, pDev, 0);
- if (!pInfo) {
- xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n",
- pDev->identifier);
- continue;
- } else if (!(pInfo->flags & XI86_CONFIGURED)) {
- xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
- pDev->identifier);
- xf86DeleteInput(pInfo, 0);
- continue;
- }
- if (pInfo->flags & XI86_CORE_KEYBOARD) {
- if (coreKeyboard) {
- xf86Msg(X_ERROR,
- "Attempt to register more than one core keyboard (%s)\n",
- pInfo->name);
- pInfo->flags &= ~XI86_CORE_KEYBOARD;
- } else {
- if (!(pInfo->flags & XI86_KEYBOARD_CAPABLE)) {
- /* XXX just a warning for now */
- xf86Msg(X_WARNING,
- "%s: does not have core keyboard capabilities\n",
- pInfo->name);
- }
- coreKeyboard = pInfo;
- }
- }
- if (pInfo->flags & XI86_CORE_POINTER) {
- if (corePointer) {
- xf86Msg(X_ERROR,
- "Attempt to register more than one core pointer (%s)\n",
- pInfo->name);
- pInfo->flags &= ~XI86_CORE_POINTER;
- } else {
- if (!(pInfo->flags & XI86_POINTER_CAPABLE)) {
- /* XXX just a warning for now */
- xf86Msg(X_WARNING,
- "%s: does not have core pointer capabilities\n",
- pInfo->name);
- }
- corePointer = pInfo;
- }
- }
- }
- if (!corePointer) {
- xf86Msg(X_WARNING, "No core pointer registered\n");
- /* XXX register a dummy core pointer */
- }
-#ifdef NEW_KBD
- if (!coreKeyboard) {
- xf86Msg(X_WARNING, "No core keyboard registered\n");
- /* XXX register a dummy core keyboard */
- }
-#endif
- }
-
- /* Initialise all input devices. */
- pInfo = xf86InputDevs;
- while (pInfo) {
- xf86ActivateDevice(pInfo);
- pInfo = pInfo->next;
- }
-
- if (coreKeyboard) {
- xf86Info.pKeyboard = coreKeyboard->dev;
- xf86Info.kbdEvents = NULL; /* to prevent the internal keybord driver usage*/
- }
- else {
- xf86Info.pKeyboard = AddInputDevice(xf86Info.kbdProc, TRUE);
- }
- if (corePointer)
- xf86Info.pMouse = corePointer->dev;
- RegisterKeyboardDevice(xf86Info.pKeyboard);
-
- miRegisterPointerDevice(screenInfo.screens[0], xf86Info.pMouse);
-#ifdef XINPUT
- xf86eqInit ((DevicePtr)xf86Info.pKeyboard, (DevicePtr)xf86Info.pMouse);
-#else
- mieqInit ((DevicePtr)xf86Info.pKeyboard, (DevicePtr)xf86Info.pMouse);
-#endif
-}
-
-#ifndef SET_STDERR_NONBLOCKING
-#define SET_STDERR_NONBLOCKING 1
-#endif
-
-/*
- * OsVendorInit --
- * OS/Vendor-specific initialisations. Called from OsInit(), which
- * is called by dix before establishing the well known sockets.
- */
-
-void
-OsVendorInit()
-{
- static Bool beenHere = FALSE;
-
- /* xf86WrapperInit() is called directly from OsInit() */
-#ifdef SIGCHLD
- signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
-#endif
- OsDelayInitColors = TRUE;
-#ifdef XFree86LOADER
- loadableFonts = TRUE;
-#endif
-
- if (!beenHere)
- xf86LogInit();
-
-#if SET_STDERR_NONBLOCKING
- /* Set stderr to non-blocking. */
-#ifndef O_NONBLOCK
-#if defined(FNDELAY)
-#define O_NONBLOCK FNDELAY
-#elif defined(O_NDELAY)
-#define O_NONBLOCK O_NDELAY
-#endif
-#endif
-
-#ifdef O_NONBLOCK
- if (!beenHere) {
-#if !defined(__EMX__)
- if (geteuid() == 0 && getuid() != geteuid())
-#endif
- {
- int status;
-
- status = fcntl(fileno(stderr), F_GETFL, 0);
- if (status != -1) {
- fcntl(fileno(stderr), F_SETFL, status | O_NONBLOCK);
- }
- }
- }
-#endif
-#endif
-
- beenHere = TRUE;
-}
-
-/*
- * ddxGiveUp --
- * Device dependent cleanup. Called by by dix before normal server death.
- * For SYSV386 we must switch the terminal back to normal mode. No error-
- * checking here, since there should be restored as much as possible.
- */
-
-void
-ddxGiveUp()
-{
- int i;
-
- if (xf86OSPMClose)
- xf86OSPMClose();
- xf86OSPMClose = NULL;
-
- xf86AccessLeaveState();
-
- for (i = 0; i < xf86NumScreens; i++) {
- /*
- * zero all access functions to
- * trap calls when switched away.
- */
- xf86Screens[i]->vtSema = FALSE;
- xf86Screens[i]->access = NULL;
- xf86Screens[i]->busAccess = NULL;
- }
-
-#ifdef USE_XF86_SERVERLOCK
- xf86UnlockServer();
-#endif
-#ifdef XFreeXDGA
- DGAShutdown();
-#endif
-
- xf86CloseConsole();
-
- xf86CloseLog();
-
- /* If an unexpected signal was caught, dump a core for debugging */
- if (xf86Info.caughtSignal)
- abort();
-}
-
-
-
-/*
- * AbortDDX --
- * DDX - specific abort routine. Called by AbortServer(). The attempt is
- * made to restore all original setting of the displays. Also all devices
- * are closed.
- */
-
-void
-AbortDDX()
-{
- int i;
-
- /*
- * try to deinitialize all input devices
- */
- if (xf86Info.pKeyboard)
- (xf86Info.kbdProc)(xf86Info.pKeyboard, DEVICE_CLOSE);
-
- /*
- * try to restore the original video state
- */
-#ifdef HAS_USL_VTS
- /* Need the sleep when starting X from within another X session */
- sleep(1);
-#endif
- if (xf86Screens) {
- if (xf86Screens[0]->vtSema)
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++)
- if (xf86Screens[i]->vtSema) {
- /*
- * if we are aborting before ScreenInit() has finished
- * we might not have been wrapped yet. Therefore enable
- * screen explicitely.
- */
- xf86EnableAccess(xf86Screens[i]);
- (xf86Screens[i]->LeaveVT)(i, 0);
- }
- }
-
- xf86AccessLeave();
-
- /*
- * This is needed for an abnormal server exit, since the normal exit stuff
- * MUST also be performed (i.e. the vt must be left in a defined state)
- */
- ddxGiveUp();
-}
-
-void
-OsVendorFatalError()
-{
- ErrorF("\nWhen reporting a problem related to a server crash, please send\n"
- "the full server output, not just the last messages.\n");
- if (xf86LogFile && xf86LogFileWasOpened)
- ErrorF("This can be found in the log file \"%s\".\n", xf86LogFile);
- ErrorF("Please report problems to %s.\n", BUILDERADDR);
- ErrorF("\n");
-}
-
-int
-xf86SetVerbosity(int verb)
-{
- int save = xf86Verbose;
-
- xf86Verbose = verb;
- LogSetParameter(XLOG_VERBOSITY, verb);
- return save;
-}
-
-int
-xf86SetLogVerbosity(int verb)
-{
- int save = xf86LogVerbose;
-
- xf86LogVerbose = verb;
- LogSetParameter(XLOG_FILE_VERBOSITY, verb);
- return save;
-}
-
-/*
- * ddxProcessArgument --
- * Process device-dependent command line args. Returns 0 if argument is
- * not device dependent, otherwise Count of number of elements of argv
- * that are part of a device dependent commandline option.
- *
- */
-
-
-
-/* ARGSUSED */
-int
-ddxProcessArgument(int argc, char **argv, int i)
-{
- /*
- * Note: can't use xalloc/xfree here because OsInit() hasn't been called
- * yet. Use malloc/free instead.
- */
-
- /* First the options that are only allowed for root */
- if (getuid() == 0)
- {
- if (!strcmp(argv[i], "-modulepath"))
- {
- char *mp;
- if (!argv[i + 1])
- return 0;
- mp = malloc(strlen(argv[i + 1]) + 1);
- if (!mp)
- FatalError("Can't allocate memory for ModulePath\n");
- strcpy(mp, argv[i + 1]);
- xf86ModulePath = mp;
- xf86ModPathFrom = X_CMDLINE;
- return 2;
- }
- else if (!strcmp(argv[i], "-logfile"))
- {
- char *lf;
- if (!argv[i + 1])
- return 0;
- lf = malloc(strlen(argv[i + 1]) + 1);
- if (!lf)
- FatalError("Can't allocate memory for LogFile\n");
- strcpy(lf, argv[i + 1]);
- xf86LogFile = lf;
- xf86LogFileFrom = X_CMDLINE;
- return 2;
- }
- }
- if (!strcmp(argv[i], "-xf86config"))
- {
- if (!argv[i + 1])
- return 0;
- if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) {
- FatalError("\nInvalid argument for -xf86config\n"
- "\tFor non-root users, the file specified with -xf86config must be\n"
- "\ta relative path and must not contain any \"..\" elements.\n"
- "\tUsing default XF86Config search path.\n\n");
- }
- xf86ConfigFile = argv[i + 1];
- return 2;
- }
- if (!strcmp(argv[i],"-showunresolved"))
- {
- xf86ShowUnresolved = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-probeonly"))
- {
- xf86ProbeOnly = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-flipPixels"))
- {
- xf86FlipPixels = TRUE;
- return 1;
- }
-#ifdef XF86VIDMODE
- if (!strcmp(argv[i],"-disableVidMode"))
- {
- xf86VidModeDisabled = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-allowNonLocalXvidtune"))
- {
- xf86VidModeAllowNonLocal = TRUE;
- return 1;
- }
-#endif
-#ifdef XF86MISC
- if (!strcmp(argv[i],"-disableModInDev"))
- {
- xf86MiscModInDevDisabled = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-allowNonLocalModInDev"))
- {
- xf86MiscModInDevAllowNonLocal = TRUE;
- return 1;
- }
-#endif
- if (!strcmp(argv[i],"-allowMouseOpenFail"))
- {
- xf86AllowMouseOpenFail = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-bestRefresh"))
- {
- xf86BestRefresh = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-ignoreABI"))
- {
-#ifdef XFree86LOADER
- LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL);
-#endif
- return 1;
- }
-#ifdef DO_CHECK_BETA
- if (!strcmp(argv[i],"-extendExpiry"))
- {
- extraDays = atoi(argv[i + 1]);
- expKey = argv[i + 2];
- return 3;
- }
-#endif
- if (!strcmp(argv[i],"-verbose"))
- {
- if (++i < argc && argv[i])
- {
- char *end;
- long val;
- val = strtol(argv[i], &end, 0);
- if (*end == '\0')
- {
- xf86SetVerbosity(val);
- return 2;
- }
- }
- xf86SetVerbosity(++xf86Verbose);
- return 1;
- }
- if (!strcmp(argv[i],"-logverbose"))
- {
- if (++i < argc && argv[i])
- {
- char *end;
- long val;
- val = strtol(argv[i], &end, 0);
- if (*end == '\0')
- {
- xf86SetLogVerbosity(val);
- return 2;
- }
- }
- xf86SetLogVerbosity(++xf86LogVerbose);
- return 1;
- }
- if (!strcmp(argv[i],"-quiet"))
- {
- xf86SetVerbosity(0);
- return 1;
- }
- if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version"))
- {
- xf86PrintBanner();
- exit(0);
- }
- /* Notice the -fp flag, but allow it to pass to the dix layer */
- if (!strcmp(argv[i], "-fp"))
- {
- xf86fpFlag = TRUE;
- return 0;
- }
- /* Notice the -co flag, but allow it to pass to the dix layer */
- if (!strcmp(argv[i], "-co"))
- {
- xf86coFlag = TRUE;
- return 0;
- }
- /* Notice the -bs flag, but allow it to pass to the dix layer */
- if (!strcmp(argv[i], "-bs"))
- {
- xf86bsDisableFlag = TRUE;
- return 0;
- }
- /* Notice the +bs flag, but allow it to pass to the dix layer */
- if (!strcmp(argv[i], "+bs"))
- {
- xf86bsEnableFlag = TRUE;
- return 0;
- }
- /* Notice the -s flag, but allow it to pass to the dix layer */
- if (!strcmp(argv[i], "-s"))
- {
- xf86sFlag = TRUE;
- return 0;
- }
- if (!strcmp(argv[i], "-bpp"))
- {
- if (++i >= argc)
- return 0;
- ErrorF("The -bpp option is no longer supported.\n"
- "\tUse -depth to set the color depth, and use -fbbpp if you really\n"
- "\tneed to force a non-default framebuffer (hardware) pixel format.\n");
- return 2;
- }
- if (!strcmp(argv[i], "-pixmap24"))
- {
- xf86Pix24 = Pix24Use24;
- return 1;
- }
- if (!strcmp(argv[i], "-pixmap32"))
- {
- xf86Pix24 = Pix24Use32;
- return 1;
- }
- if (!strcmp(argv[i], "-fbbpp"))
- {
- int bpp;
- if (++i >= argc)
- return 0;
- if (sscanf(argv[i], "%d", &bpp) == 1)
- {
- xf86FbBpp = bpp;
- return 2;
- }
- else
- {
- ErrorF("Invalid fbbpp\n");
- return 0;
- }
- }
- if (!strcmp(argv[i], "-depth"))
- {
- int depth;
- if (++i >= argc)
- return 0;
- if (sscanf(argv[i], "%d", &depth) == 1)
- {
- xf86Depth = depth;
- return 2;
- }
- else
- {
- ErrorF("Invalid depth\n");
- return 0;
- }
- }
- if (!strcmp(argv[i], "-weight"))
- {
- int red, green, blue;
- if (++i >= argc)
- return 0;
- if (sscanf(argv[i], "%1d%1d%1d", &red, &green, &blue) == 3)
- {
- xf86Weight.red = red;
- xf86Weight.green = green;
- xf86Weight.blue = blue;
- return 2;
- }
- else
- {
- ErrorF("Invalid weighting\n");
- return 0;
- }
- }
- if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") ||
- !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma"))
- {
- double gamma;
- if (++i >= argc)
- return 0;
- if (sscanf(argv[i], "%lf", &gamma) == 1) {
- if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) {
- ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f"
- " is valid\n", GAMMA_MIN, GAMMA_MAX);
- return 0;
- }
- if (!strcmp(argv[i-1], "-gamma"))
- xf86Gamma.red = xf86Gamma.green = xf86Gamma.blue = gamma;
- else if (!strcmp(argv[i-1], "-rgamma")) xf86Gamma.red = gamma;
- else if (!strcmp(argv[i-1], "-ggamma")) xf86Gamma.green = gamma;
- else if (!strcmp(argv[i-1], "-bgamma")) xf86Gamma.blue = gamma;
- return 2;
- }
- }
- if (!strcmp(argv[i], "-layout"))
- {
- if (++i >= argc)
- return 0;
- xf86LayoutName = argv[i];
- return 2;
- }
- if (!strcmp(argv[i], "-screen"))
- {
- if (++i >= argc)
- return 0;
- xf86ScreenName = argv[i];
- return 2;
- }
- if (!strcmp(argv[i], "-pointer"))
- {
- if (++i >= argc)
- return 0;
- xf86PointerName = argv[i];
- return 2;
- }
- if (!strcmp(argv[i], "-keyboard"))
- {
- if (++i >= argc)
- return 0;
- xf86KeyboardName = argv[i];
- return 2;
- }
- if (!strcmp(argv[i], "-nosilk"))
- {
- xf86silkenMouseDisableFlag = TRUE;
- return 1;
- }
- if (!strcmp(argv[i], "-scanpci"))
- {
- DoScanPci(argc, argv, i);
- }
- if (!strcmp(argv[i], "-probe"))
- {
- xf86DoProbe = TRUE;
-#if 0
- DoProbe(argc, argv, i);
-#endif
- return 1;
- }
- if (!strcmp(argv[i], "-configure"))
- {
- if (getuid() != 0) {
- ErrorF("The '-configure' option can only be used by root.\n");
- exit(1);
- }
- xf86DoConfigure = TRUE;
- xf86AllowMouseOpenFail = TRUE;
- return 1;
- }
- /* OS-specific processing */
- return xf86ProcessArgument(argc, argv, i);
-}
-
-/*
- * ddxUseMsg --
- * Print out correct use of device dependent commandline options.
- * Maybe the user now knows what really to do ...
- */
-
-void
-ddxUseMsg()
-{
- ErrorF("\n");
- ErrorF("\n");
- ErrorF("Device Dependent Usage\n");
- if (getuid() == 0)
- {
- ErrorF("-xf86config file specify a configuration file\n");
- ErrorF("-modulepath paths specify the module search path\n");
- ErrorF("-logfile file specify a log file name\n");
- ErrorF("-configure probe for devices and write an XF86Config\n");
- }
- else
- {
- ErrorF("-xf86config file specify a configuration file, relative to the\n");
- ErrorF(" XF86Config search path, only root can use absolute\n");
- }
- ErrorF("-probeonly probe for devices, then exit\n");
- ErrorF("-scanpci execute the scanpci module and exit\n");
- ErrorF("-verbose [n] verbose startup messages\n");
- ErrorF("-logverbose [n] verbose log messages\n");
- ErrorF("-quiet minimal startup messages\n");
- ErrorF("-pixmap24 use 24bpp pixmaps for depth 24\n");
- ErrorF("-pixmap32 use 32bpp pixmaps for depth 24\n");
- ErrorF("-fbbpp n set bpp for the framebuffer. Default: 8\n");
- ErrorF("-depth n set colour depth. Default: 8\n");
- ErrorF("-gamma f set gamma value (0.1 < f < 10.0) Default: 1.0\n");
- ErrorF("-rgamma f set gamma value for red phase\n");
- ErrorF("-ggamma f set gamma value for green phase\n");
- ErrorF("-bgamma f set gamma value for blue phase\n");
- ErrorF("-weight nnn set RGB weighting at 16 bpp. Default: 565\n");
- ErrorF("-layout name specify the ServerLayout section name\n");
- ErrorF("-screen name specify the Screen section name\n");
- ErrorF("-keyboard name specify the core keyboard InputDevice name\n");
- ErrorF("-pointer name specify the core pointer InputDevice name\n");
- ErrorF("-nosilk disable Silken Mouse\n");
- ErrorF("-flipPixels swap default black/white Pixel values\n");
-#ifdef XF86VIDMODE
- ErrorF("-disableVidMode disable mode adjustments with xvidtune\n");
- ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n");
-#endif
-#ifdef XF86MISC
- ErrorF("-disableModInDev disable dynamic modification of input device settings\n");
- ErrorF("-allowNonLocalModInDev allow changes to keyboard and mouse settings\n");
- ErrorF(" from non-local clients\n");
- ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n");
-#endif
- ErrorF("-bestRefresh choose modes with the best refresh rate\n");
- ErrorF("-ignoreABI make module ABI mismatches non-fatal\n");
- ErrorF("-version show the server version\n");
- /* OS-specific usage */
- xf86UseMsg();
- ErrorF("\n");
-}
-
-
-#ifndef OSNAME
-#define OSNAME " unknown"
-#endif
-#ifndef OSVENDOR
-#define OSVENDOR ""
-#endif
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XF86_VERSION_SNAP
-#endif
-
-static void
-xf86PrintBanner()
-{
-#if PRE_RELEASE
- ErrorF("\n"
- "This is a pre-release version of XFree86, and is not supported in any\n"
- "way. Bugs may be reported to XFree86@XFree86.Org and patches submitted\n"
- "to fixes@XFree86.Org. Before reporting bugs in pre-release versions,\n"
- "please check the latest version in the XFree86 CVS repository\n"
- "(http://www.XFree86.Org/cvs).\n");
-#endif
- ErrorF("\nXFree86 Version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
- XF86_VERSION_PATCH);
-#if XF86_VERSION_SNAP > 0
- ErrorF(".%d", XF86_VERSION_SNAP);
-#endif
-
-#if XF86_VERSION_SNAP >= 900
- ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1,
- XF86_VERSION_SNAP - 900);
-#endif
-
-#ifdef XF86_CUSTOM_VERSION
- ErrorF(" (%s)", XF86_CUSTOM_VERSION);
-#endif
- ErrorF("\nRelease Date: %s\n", XF86_DATE);
- ErrorF("X Protocol Version %d, Revision %d, %s\n",
- X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
- ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
-#ifdef HAS_UTSNAME
- {
- struct utsname name;
-
- if (uname(&name) == 0) {
- ErrorF("Current Operating System: %s %s %s %s %s\n",
- name.sysname, name.nodename, name.release, name.version, name.machine);
- }
- }
-#endif
-#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
- {
- struct tm t;
- char buf[100];
-
- bzero(&t, sizeof(t));
- bzero(buf, sizeof(buf));
- t.tm_mday = BUILD_DATE % 100;
- t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
- t.tm_year = BUILD_DATE / 10000 - 1900;
- if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
- ErrorF("Build Date: %s\n", buf);
- }
-#endif
-#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
- {
- struct tm t;
- char buf[100];
-
- bzero(&t, sizeof(t));
- bzero(buf, sizeof(buf));
- t.tm_mday = CLOG_DATE % 100;
- t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
- t.tm_year = CLOG_DATE / 10000 - 1900;
- if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
- ErrorF("Changelog Date: %s\n", buf);
- }
-#endif
-#if defined(BUILDERSTRING)
- ErrorF("%s \n",BUILDERSTRING);
-#endif
- ErrorF("\tBefore reporting problems, check http://www.XFree86.Org/\n"
- "\tto make sure that you have the latest version.\n");
-#ifdef XFree86LOADER
- ErrorF("Module Loader present\n");
-#endif
-}
-
-static void
-xf86PrintMarkers()
-{
- LogPrintMarkers();
-}
-
-static void
-xf86RunVtInit(void)
-{
- int i;
-
- /*
- * If VTInit was set, run that program with consoleFd as stdin and stdout
- */
-
- if (xf86Info.vtinit) {
- switch(fork()) {
- case -1:
- FatalError("xf86RunVtInit: fork failed (%s)\n", strerror(errno));
- break;
- case 0: /* child */
- setuid(getuid());
- /* set stdin, stdout to the consoleFd */
- for (i = 0; i < 2; i++) {
- if (xf86Info.consoleFd != i) {
- close(i);
- dup(xf86Info.consoleFd);
- }
- }
- execl("/bin/sh", "sh", "-c", xf86Info.vtinit, (void *)NULL);
- xf86Msg(X_WARNING, "exec of /bin/sh failed for VTInit (%s)\n",
- strerror(errno));
- exit(255);
- break;
- default: /* parent */
- wait(NULL);
- }
- }
-}
-
-#ifdef XFree86LOADER
-/*
- * xf86LoadModules iterates over a list that is being passed in.
- */
-Bool
-xf86LoadModules(char **list, pointer *optlist)
-{
- int errmaj, errmin;
- pointer opt;
- int i;
- char *name;
- Bool failed = FALSE;
-
- if (!list)
- return TRUE;
-
- for (i = 0; list[i] != NULL; i++) {
-
-#ifndef NORMALISE_MODULE_NAME
- name = xstrdup(list[i]);
-#else
- /* Normalise the module name */
- name = xf86NormalizeName(list[i]);
-#endif
-
- /* Skip empty names */
- if (name == NULL || *name == '\0')
- continue;
-
- if (optlist)
- opt = optlist[i];
- else
- opt = NULL;
-
- if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
- LoaderErrorMsg(NULL, name, errmaj, errmin);
- failed = TRUE;
- }
- xfree(name);
- }
- return !failed;
-}
-
-#endif
-
-/* Pixmap format stuff */
-
-PixmapFormatPtr
-xf86GetPixFormat(ScrnInfoPtr pScrn, int depth)
-{
- int i;
- static PixmapFormatRec format; /* XXX not reentrant */
-
- /*
- * When the formats[] list initialisation isn't complete, check the
- * depth 24 pixmap config/cmdline options and screen-specified formats.
- */
-
- if (!formatsDone) {
- if (depth == 24) {
- Pix24Flags pix24 = Pix24DontCare;
-
- format.depth = 24;
- format.scanlinePad = BITMAP_SCANLINE_PAD;
- if (xf86Info.pixmap24 != Pix24DontCare)
- pix24 = xf86Info.pixmap24;
- else if (pScrn->pixmap24 != Pix24DontCare)
- pix24 = pScrn->pixmap24;
- if (pix24 == Pix24Use24)
- format.bitsPerPixel = 24;
- else
- format.bitsPerPixel = 32;
- return &format;
- }
- }
-
- for (i = 0; i < numFormats; i++)
- if (formats[i].depth == depth)
- break;
- if (i != numFormats)
- return &formats[i];
- else if (!formatsDone) {
- /* Check for screen-specified formats */
- for (i = 0; i < pScrn->numFormats; i++)
- if (pScrn->formats[i].depth == depth)
- break;
- if (i != pScrn->numFormats)
- return &pScrn->formats[i];
- }
- return NULL;
-}
-
-int
-xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth)
-{
- PixmapFormatPtr format;
-
-
- format = xf86GetPixFormat(pScrn, depth);
- if (format)
- return format->bitsPerPixel;
- else
- return 0;
-}
-
diff --git a/hw/xfree86/common/xf86Io.c b/hw/xfree86/common/xf86Io.c
deleted file mode 100644
index bd44bdeb5..000000000
--- a/hw/xfree86/common/xf86Io.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.56 2003/11/03 05:11:02 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1992-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86Io.c /main/27 1996/10/19 17:58:55 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-#include "mipointer.h"
-
-#ifdef XINPUT
-#include "xf86Xinput.h"
-#include "XIproto.h"
-#include "exevents.h"
-#endif
-
-#ifdef XKB
-#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBstr.h>
-#include <X11/extensions/XKBsrv.h>
-#endif
-
-unsigned int xf86InitialCaps = 0;
-unsigned int xf86InitialNum = 0;
-unsigned int xf86InitialScroll = 0;
-
-#include "atKeynames.h"
-
-/*
- * xf86KbdBell --
- * Ring the terminal/keyboard bell for an amount of time proportional to
- * "loudness".
- */
-
-void
-xf86KbdBell(percent, pKeyboard, ctrl, unused)
- int percent; /* Percentage of full volume */
- DeviceIntPtr pKeyboard; /* Keyboard to ring */
- pointer ctrl;
- int unused;
-{
- xf86SoundKbdBell(percent, xf86Info.bell_pitch, xf86Info.bell_duration);
-}
-
-void
-xf86UpdateKbdLeds()
-{
- int leds = 0;
- if (xf86Info.capsLock) leds |= XLED1;
- if (xf86Info.numLock) leds |= XLED2;
- if (xf86Info.scrollLock || xf86Info.modeSwitchLock) leds |= XLED3;
- if (xf86Info.composeLock) leds |= XLED4;
- xf86Info.leds = (xf86Info.leds & xf86Info.xleds) | (leds & ~xf86Info.xleds);
- xf86KbdLeds();
-}
-
-void
-xf86KbdLeds ()
-{
- int leds, real_leds = 0;
-
-#if defined (__sparc__) && defined(__linux__)
- static int kbdSun = -1;
- if (kbdSun == -1) {
- if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun")) ||
- (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun")))
- kbdSun = 1;
- else
- kbdSun = 0;
- }
- if (kbdSun) {
- if (xf86Info.leds & 0x08) real_leds |= XLED1;
- if (xf86Info.leds & 0x04) real_leds |= XLED3;
- if (xf86Info.leds & 0x02) real_leds |= XLED4;
- if (xf86Info.leds & 0x01) real_leds |= XLED2;
- leds = real_leds;
- real_leds = 0;
- } else {
- leds = xf86Info.leds;
- }
-#else
- leds = xf86Info.leds;
-#endif /* defined (__sparc__) */
-
-#ifdef LED_CAP
- if (leds & XLED1) real_leds |= LED_CAP;
- if (leds & XLED2) real_leds |= LED_NUM;
- if (leds & XLED3) real_leds |= LED_SCR;
-#ifdef LED_COMP
- if (leds & XLED4) real_leds |= LED_COMP;
-#else
- if (leds & XLED4) real_leds |= LED_SCR;
-#endif
-#endif
- xf86SetKbdLeds(real_leds);
- (void)leds;
-}
-
-/*
- * xf86KbdCtrl --
- * Alter some of the keyboard control parameters. All special protocol
- * values are handled by dix (ProgChangeKeyboardControl)
- */
-
-void
-xf86KbdCtrl (pKeyboard, ctrl)
- DevicePtr pKeyboard; /* Keyboard to alter */
- KeybdCtrl *ctrl;
-{
- int leds;
- xf86Info.bell_pitch = ctrl->bell_pitch;
- xf86Info.bell_duration = ctrl->bell_duration;
- xf86Info.autoRepeat = ctrl->autoRepeat;
-
- xf86Info.composeLock = (ctrl->leds & XCOMP) ? TRUE : FALSE;
-
- leds = (ctrl->leds & ~(XCAPS | XNUM | XSCR));
-#ifdef XKB
- if (noXkbExtension) {
-#endif
- xf86Info.leds = (leds & xf86Info.xleds)|(xf86Info.leds & ~xf86Info.xleds);
-#ifdef XKB
- } else {
- xf86Info.leds = leds;
- }
-#endif
-
- xf86KbdLeds();
-}
-
-/*
- * xf86InitKBD --
- * Reinitialize the keyboard. Only set Lockkeys according to ours leds.
- * Depress all other keys.
- */
-
-void
-xf86InitKBD(init)
-Bool init;
-{
- char leds = 0, rad;
- unsigned int i;
- xEvent kevent;
- DeviceIntPtr pKeyboard = xf86Info.pKeyboard;
- KeyClassRec *keyc = xf86Info.pKeyboard->key;
- KeySym *map = keyc->curKeySyms.map;
-
- kevent.u.keyButtonPointer.time = GetTimeInMillis();
- kevent.u.keyButtonPointer.rootX = 0;
- kevent.u.keyButtonPointer.rootY = 0;
-
- /*
- * Hmm... here is the biggest hack of every time !
- * It may be possible that a switch-vt procedure has finished BEFORE
- * you released all keys neccessary to do this. That peculiar behavior
- * can fool the X-server pretty much, cause it assumes that some keys
- * were not released. TWM may stuck alsmost completly....
- * OK, what we are doing here is after returning from the vt-switch
- * exeplicitely unrelease all keyboard keys before the input-devices
- * are reenabled.
- */
- for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
- i < keyc->curKeySyms.maxKeyCode;
- i++, map += keyc->curKeySyms.mapWidth)
- if (KeyPressed(i))
- {
- switch (*map) {
- /* Don't release the lock keys */
- case XK_Caps_Lock:
- case XK_Shift_Lock:
- case XK_Num_Lock:
- case XK_Scroll_Lock:
- case XK_Kana_Lock:
- break;
- default:
- kevent.u.u.detail = i;
- kevent.u.u.type = KeyRelease;
- (* pKeyboard->public.processInputProc)(&kevent, pKeyboard, 1);
- }
- }
-
- xf86Info.scanPrefix = 0;
-
- if (init)
- {
- /*
- * we must deal here with the fact, that on some cases the numlock or
- * capslock key are enabled BEFORE the server is started up. So look
- * here at the state on the according LEDS to determine whether a
- * lock-key is already set.
- */
-
- xf86Info.capsLock = FALSE;
- xf86Info.numLock = FALSE;
- xf86Info.scrollLock = FALSE;
- xf86Info.modeSwitchLock = FALSE;
- xf86Info.composeLock = FALSE;
-
-#ifdef LED_CAP
-#ifdef INHERIT_LOCK_STATE
- leds = xf86Info.leds;
-
- for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
- i < keyc->curKeySyms.maxKeyCode;
- i++, map += keyc->curKeySyms.mapWidth)
-
- switch(*map) {
-
- case XK_Caps_Lock:
- case XK_Shift_Lock:
- if (leds & LED_CAP)
- {
- xf86InitialCaps = i;
- xf86Info.capsLock = TRUE;
- }
- break;
-
- case XK_Num_Lock:
- if (leds & LED_NUM)
- {
- xf86InitialNum = i;
- xf86Info.numLock = TRUE;
- }
- break;
-
- case XK_Scroll_Lock:
- case XK_Kana_Lock:
- if (leds & LED_SCR)
- {
- xf86InitialScroll = i;
- xf86Info.scrollLock = TRUE;
- }
- break;
- }
-#endif /* INHERIT_LOCK_STATE */
- xf86SetKbdLeds(leds);
-#endif /* LED_CAP */
- (void)leds;
-
- if (xf86Info.kbdDelay <= 375) rad = 0x00;
- else if (xf86Info.kbdDelay <= 625) rad = 0x20;
- else if (xf86Info.kbdDelay <= 875) rad = 0x40;
- else rad = 0x60;
-
- if (xf86Info.kbdRate <= 2) rad |= 0x1F;
- else if (xf86Info.kbdRate >= 30) rad |= 0x00;
- else rad |= ((58 / xf86Info.kbdRate) - 2);
-
- xf86SetKbdRepeat(rad);
- }
-}
-
-/*
- * xf86KbdProc --
- * Handle the initialization, etc. of a keyboard.
- */
-
-int
-xf86KbdProc (pKeyboard, what)
- DeviceIntPtr pKeyboard; /* Keyboard to manipulate */
- int what; /* What to do to it */
-{
- KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
- int kbdFd;
-
- switch (what) {
-
- case DEVICE_INIT:
- /*
- * First open and find the current state of the keyboard.
- */
-
- xf86KbdInit();
-
- xf86KbdGetMapping(&keySyms, modMap);
-
-
-#ifndef XKB
- defaultKeyboardControl.leds = xf86GetKbdLeds();
-#else
- defaultKeyboardControl.leds = 0;
-#endif
-
- /*
- * Perform final initialization of the system private keyboard
- * structure and fill in various slots in the device record
- * itself which couldn't be filled in before.
- */
-
- pKeyboard->public.on = FALSE;
-
-#ifdef XKB
- if (noXkbExtension) {
-#endif
- InitKeyboardDeviceStruct((DevicePtr)xf86Info.pKeyboard,
- &keySyms,
- modMap,
- xf86KbdBell,
- (KbdCtrlProcPtr)xf86KbdCtrl);
-#ifdef XKB
- } else {
- XkbComponentNamesRec names;
- XkbDescPtr desc;
- Bool foundTerminate = FALSE;
- int keyc;
- if (XkbInitialMap) {
- if ((xf86Info.xkbkeymap = strchr(XkbInitialMap, '/')) != NULL)
- xf86Info.xkbkeymap++;
- else
- xf86Info.xkbkeymap = XkbInitialMap;
- }
- if (xf86Info.xkbkeymap) {
- names.keymap = xf86Info.xkbkeymap;
- names.keycodes = NULL;
- names.types = NULL;
- names.compat = NULL;
- names.symbols = NULL;
- names.geometry = NULL;
- } else {
- names.keymap = NULL;
- names.keycodes = xf86Info.xkbkeycodes;
- names.types = xf86Info.xkbtypes;
- names.compat = xf86Info.xkbcompat;
- names.symbols = xf86Info.xkbsymbols;
- names.geometry = xf86Info.xkbgeometry;
- }
- if ((xf86Info.xkbkeymap || xf86Info.xkbcomponents_specified)
- && (xf86Info.xkbmodel == NULL || xf86Info.xkblayout == NULL)) {
- xf86Info.xkbrules = NULL;
- }
- XkbSetRulesDflts(xf86Info.xkbrules, xf86Info.xkbmodel,
- xf86Info.xkblayout, xf86Info.xkbvariant,
- xf86Info.xkboptions);
-
- XkbInitKeyboardDeviceStruct(pKeyboard,
- &names,
- &keySyms,
- modMap,
- xf86KbdBell,
- (KbdCtrlProcPtr)xf86KbdCtrl);
-
- /* Search keymap for Terminate action */
- desc = pKeyboard->key->xkbInfo->desc;
- for (keyc = desc->min_key_code; keyc <= desc->max_key_code; keyc++) {
- int i;
- for (i = 1; i <= XkbKeyNumActions(desc, keyc); i++) {
- if (XkbKeyAction(desc, keyc, i)
- && XkbKeyAction(desc, keyc, i)->type == XkbSA_Terminate) {
- foundTerminate = TRUE;
- goto searchdone;
- }
- }
- }
-searchdone:
- xf86Info.ActionKeyBindingsSet = foundTerminate;
- if (!foundTerminate)
- xf86Msg(X_INFO, "Server_Terminate keybinding not found\n");
- }
-#endif
-
- xf86InitKBD(TRUE);
- break;
-
- case DEVICE_ON:
- /*
- * Set the keyboard into "direct" mode and turn on
- * event translation.
- */
-
- kbdFd = xf86KbdOn();
- /*
- * Discard any pending input after a VT switch to prevent the server
- * passing on parts of the VT switch sequence.
- */
- sleep(1);
-#if defined(WSCONS_SUPPORT)
- if (xf86Info.consType != WSCONS) {
-#endif
- if (kbdFd != -1) {
- char buf[16];
- read(kbdFd, buf, 16);
- }
-#if defined(WSCONS_SUPPORT)
- }
-#endif
-
-#if !defined(__UNIXOS2__) /* Under EMX, keyboard cannot be select()'ed */
- if (kbdFd != -1)
- AddEnabledDevice(kbdFd);
-#endif /* __UNIXOS2__ */
-
- pKeyboard->public.on = TRUE;
- xf86InitKBD(FALSE);
- break;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- /*
- * Restore original keyboard directness and translation.
- */
-
- kbdFd = xf86KbdOff();
-
- if (kbdFd != -1)
- RemoveEnabledDevice(kbdFd);
-
- pKeyboard->public.on = FALSE;
- break;
-
- }
- return (Success);
-}
-
-#if defined(DDXTIME) && !defined(QNX4)
-/*
- * These are getting tossed in here until I can think of where
- * they really belong
- */
-#define HALFMONTH ((unsigned long) 1<<31)
-CARD32
-GetTimeInMillis()
-{
- struct timeval tp;
- register CARD32 val;
- register INT32 diff;
- static CARD32 oldval = 0;
- static CARD32 time = 0;
-
- gettimeofday(&tp, 0);
- val = (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
- if (oldval) {
- diff = val - oldval;
- if (diff > 0)
- time += diff;
- }
- oldval = val;
-
- return time;
-}
-#endif /* DDXTIME && !QNX4 */
-
diff --git a/hw/xfree86/common/xf86Kbd.c b/hw/xfree86/common/xf86Kbd.c
deleted file mode 100644
index 3c7ed7a69..000000000
--- a/hw/xfree86/common/xf86Kbd.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.26 2003/08/24 17:36:53 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1992-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86Kbd.c /main/10 1996/02/21 17:38:32 kaleb $ */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-#include "xf86Config.h"
-
-#include "xf86Keymap.h"
-
-#if defined(KDGKBTYPE) && \
- !defined(Lynx) && \
- !defined(__UNIXOS2__) && !defined(__mips__) && \
- !defined(__arm32__) && !defined(__GNU__) && !defined(__QNX__)
-#define HAS_GETKBTYPE
-#endif
-#if defined(GIO_KEYMAP) && \
- !defined(Lynx) && \
- !defined(__UNIXOS2__) && !defined(__mips__) && \
- !defined(__arm32__) && !defined(__GNU__) && !defined(DGUX) && \
- !defined(__QNX__)
-#define HAS_GETKEYMAP
-
-#define KD_GET_ENTRY(i,n) \
- eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
-
-/*
- * NOTE: Not all possible remappable symbols are remapped. There are two main
- * reasons:
- * a) The mapping between scancode and SYSV/386 - symboltable
- * is inconsistent between different versions and has some
- * BIG mistakes.
- * b) In X-Windows there is a difference between numpad-keys
- * and normal keys. SYSV/386 uses for both kinds of keys
- * the same symbol.
- *
- * Thus only the alpha keypad and the function keys are translated.
- * Also CapsLock, NumLock, ScrollLock, Shift, Control & Alt.
- */
-
-static unsigned char remap[128] = {
- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
- 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
-};
-
-static KeySym eascii_to_x[512] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
- XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
- XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
- XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
- XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
- XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
- XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
- XK_sterling, XK_yen, XK_paragraph, XK_section,
- XK_aacute, XK_iacute, XK_oacute, XK_uacute,
- XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
- XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
- XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
- XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
- XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
- XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
- XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
- XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
- XK_degree, NoSymbol, NoSymbol, XK_radical,
- XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
-
- /*
- * special marked entries (256 + x)
- */
-
- NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
- XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
- NoSymbol, XK_Control_L, XK_Alt_L, XK_Alt_R,
- XK_Control_L, XK_Control_R, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_F1,
- XK_F2, XK_F3, XK_F4, XK_F5,
- XK_F6, XK_F7, XK_F8, XK_F9,
- XK_F10, XK_F11, XK_F12, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- };
-
-#endif /* HAS_GETKEYMAP */
-
-/*
- * LegalModifier --
- * determine whether a key is a legal modifier key, i.e send a
- * press/release sequence.
- */
-
-/*ARGSUSED*/
-Bool
-LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
-{
- return (TRUE);
-}
-
-
-
-/*
- * xf86KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-void
-xf86KbdGetMapping (pKeySyms, pModMap)
- KeySymsPtr pKeySyms;
- CARD8 *pModMap;
-{
- KeySym *k;
-#ifdef HAS_GETKEYMAP
- keymap_t keymap;
-#endif
- int i;
- KeySym *pMap;
-
-#ifdef HAS_GETKBTYPE
- char type;
-
- xf86Info.kbdType =
- ioctl(xf86Info.consoleFd, KDGKBTYPE, &type) != -1 ? type : KB_101;
- if (xf86Info.kbdType == KB_84)
- pMap = map84;
- else
- pMap = map;
-#else
-/* OS/2 sets the keyboard type during xf86OpenKbd */
-#ifndef __UNIXOS2__
- xf86Info.kbdType = 0;
-#endif
- pMap = map;
-#endif
-
-#ifdef HAS_GETKEYMAP
- /*
- * use the keymap, which can be gotten from our oringinal vt??.
- * ( ttymap(1) !!!! )
- */
- if (ioctl(xf86Info.consoleFd, GIO_KEYMAP, &keymap) != -1) {
- for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
-
- if (remap[i]) {
-
- k = pMap + (remap[i] << 2);
-
- k[0] = KD_GET_ENTRY(i,0); /* non-shifed */
- k[1] = KD_GET_ENTRY(i,1); /* shifted */
- k[2] = KD_GET_ENTRY(i,4); /* alt */
- k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */
-
- if (k[3] == k[2]) k[3] = NoSymbol;
- if (k[2] == k[1]) k[2] = NoSymbol;
- if (k[1] == k[0]) k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
- }
- }
-#endif
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = pMap, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- pKeySyms->map = pMap;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
diff --git a/hw/xfree86/common/xf86KbdBSD.c b/hw/xfree86/common/xf86KbdBSD.c
deleted file mode 100644
index 2621e2a81..000000000
--- a/hw/xfree86/common/xf86KbdBSD.c
+++ /dev/null
@@ -1,1262 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.22 2003/10/07 22:00:52 herrb Exp $ */
-/*
- * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
- * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- * and from xf86KbdCODrv.c by Holger Veit
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1994-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86KbdBSD.c /main/6 1996/10/23 13:12:27 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-#include "xf86Keymap.h"
-
-#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP)
-#define KD_GET_ENTRY(i,n) \
- eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
-
-static unsigned char remap[NUM_KEYCODES] = {
- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
- 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
-};
-
-/* This table assumes the ibm code page 437 coding for characters
- * > 0x80. They are returned in this form by PCVT */
-static KeySym eascii_to_x[512] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
- XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
- XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
- XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
- XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
- XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
- XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
- XK_sterling, XK_yen, XK_paragraph, XK_section,
- XK_aacute, XK_iacute, XK_oacute, XK_uacute,
- XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
- XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
- XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
- XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
- XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
- XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
- XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
- XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
- XK_degree, NoSymbol, NoSymbol, XK_radical,
- XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
-
- /*
- * special marked entries (256 + x)
- */
-
-#if 1
- /* This has been checked against what syscons actually does */
- NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
- XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
- XK_ISO_Left_Tab,XK_Control_L, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_F1,
- XK_F2, XK_F3, XK_F4, XK_F5,
- XK_F6, XK_F7, XK_F8, XK_F9,
- XK_F10, XK_F11, XK_F12, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Control_R, XK_Alt_R, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol
-#else
- /* The old table, supposedly for pcvt. */
- NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
- XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
- NoSymbol, XK_Control_L, XK_Alt_L, XK_Alt_R,
- XK_Control_L, XK_Control_R, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_F1,
- XK_F2, XK_F3, XK_F4, XK_F5,
- XK_F6, XK_F7, XK_F8, XK_F9,
- XK_F10, XK_F11, XK_F12, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol
-#endif
- };
-
-#ifdef __OpenBSD__
-/* don't mark AltR and CtrlR for remapping, since they
- * cannot be remapped by pccons */
-static unsigned char pccons_remap[128] = {
- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x77 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
-};
-
-/* This table assumes an iso8859_1 encoding for the characters
- * > 80, as returned by pccons */
-static KeySym latin1_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
- };
-#endif
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
-/*
- * LegalModifier --
- * determine whether a key is a legal modifier key, i.e send a
- * press/release sequence.
- */
-
-/*ARGSUSED*/
-Bool
-LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
-{
- return (TRUE);
-}
-
-/*
- * xf86KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-void
-xf86KbdGetMapping (pKeySyms, pModMap)
- KeySymsPtr pKeySyms;
- CARD8 *pModMap;
-{
- KeySym *k;
- int i;
-
-#ifndef __bsdi__
- switch (xf86Info.consType) {
-
-#ifdef PCCONS_SUPPORT
- case PCCONS:
-#if defined(__OpenBSD__)
- /*
- * on OpenBSD, the pccons keymap is programmable, too
- */
- {
- pccons_keymap_t keymap[KB_NUM_KEYS];
- if (ioctl(xf86Info.consoleFd, CONSOLE_GET_KEYMAP, &keymap) != -1) {
- for (i = 0; i < KB_NUM_KEYS; i++)
- if (pccons_remap[i]) {
- k = map + (pccons_remap[i] << 2);
- switch (keymap[i].type) {
- case KB_ASCII:
- /* For ASCII keys, there is only one char in the keymap */
- k[0] = latin1_to_x[(unsigned char)keymap[i].unshift[0]];
- k[1] = latin1_to_x[(unsigned char)keymap[i].shift[0]];
- k[2] = latin1_to_x[(unsigned char)keymap[i].altgr[0]];
- k[3] = latin1_to_x[(unsigned char)keymap[i].shift_altgr[0]];
- break;
- case KB_SCROLL:
- k[0] = XK_Scroll_Lock;
- goto special;
- case KB_NUM:
- k[0] = XK_Num_Lock;
- goto special;
- case KB_CAPS:
- k[0] = XK_Caps_Lock;
- goto special;
- case KB_SHIFT:
- switch (keymap[i].unshift[0]) {
- case 1:
- /* left shift */
- k[0] = XK_Shift_L;
- break;
- case 2:
- /* right shift */
- k[0] = XK_Shift_R;
- break;
- default:
- k[0] = NoSymbol;
- }
- goto special;
- case KB_CTL:
- k[0] = XK_Control_L;
- goto special;
- case KB_ALT:
- k[0] = XK_Alt_L;
- goto special;
- case KB_FUNC:
- switch (keymap[i].unshift[2]) {
- case 'M':
- k[0] = XK_F1;
- break;
- case 'N':
- k[0] = XK_F2;
- break;
- case 'O':
- k[0] = XK_F3;
- break;
- case 'P':
- k[0] = XK_F4;
- break;
- case 'Q':
- k[0] = XK_F5;
- break;
- case 'R':
- k[0] = XK_F6;
- break;
- case 'S':
- k[0] = XK_F7;
- break;
- case 'T':
- k[0] = XK_F8;
- break;
- case 'U':
- k[0] = XK_F9;
- break;
- case 'V':
- k[0] = XK_F10;
- break;
- case 'W':
- k[0] = XK_F11;
- break;
- case 'X':
- k[0] = XK_F12;
- break;
- default:
- k[0] = NoSymbol;
- break;
- }
- goto special;
- default:
- k[0] = NoSymbol;
- special:
- k[1] = k[2] = k[3] = NoSymbol;
- }
- }
- } else {
- ErrorF("Can't read pccons keymap\n");
- }
- }
-#endif /* __OpenBSD__ */
- break;
-#endif
-
-/*
- * XXX wscons has no GIO_KEYMAP
- */
-#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP)
- case SYSCONS:
- case PCVT:
- {
- keymap_t keymap;
-
- if (ioctl(xf86Info.consoleFd, GIO_KEYMAP, &keymap) != -1) {
- for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
- if (remap[i]) {
- k = map + (remap[i] << 2);
- k[0] = KD_GET_ENTRY(i,0); /* non-shifed */
- k[1] = KD_GET_ENTRY(i,1); /* shifted */
- k[2] = KD_GET_ENTRY(i,4); /* alt */
- k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */
- if (k[3] == k[2]) k[3] = NoSymbol;
- if (k[2] == k[1]) k[2] = NoSymbol;
- if (k[1] == k[0]) k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3])
- k[2] = k[3] = NoSymbol;
- }
- }
- }
- break;
-#endif /* SYSCONS || PCVT */
-
- }
-#endif /* !bsdi */
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- xf86Info.kbdType = 0;
-
- pKeySyms->map = map;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-
-}
-
-#ifdef WSCONS_SUPPORT
-#include "atKeynames.h"
-
-static CARD8 wsUsbMap[] = {
- /* 0 */ KEY_NOTUSED,
- /* 1 */ KEY_NOTUSED,
- /* 2 */ KEY_NOTUSED,
- /* 3 */ KEY_NOTUSED,
- /* 4 */ KEY_A,
- /* 5 */ KEY_B,
- /* 6 */ KEY_C,
- /* 7 */ KEY_D,
- /* 8 */ KEY_E,
- /* 9 */ KEY_F,
- /* 10 */ KEY_G,
- /* 11 */ KEY_H,
- /* 12 */ KEY_I,
- /* 13 */ KEY_J,
- /* 14 */ KEY_K,
- /* 15 */ KEY_L,
- /* 16 */ KEY_M,
- /* 17 */ KEY_N,
- /* 18 */ KEY_O,
- /* 19 */ KEY_P,
- /* 20 */ KEY_Q,
- /* 21 */ KEY_R,
- /* 22 */ KEY_S,
- /* 23 */ KEY_T,
- /* 24 */ KEY_U,
- /* 25 */ KEY_V,
- /* 26 */ KEY_W,
- /* 27 */ KEY_X,
- /* 28 */ KEY_Y,
- /* 29 */ KEY_Z,
- /* 30 */ KEY_1, /* 1 !*/
- /* 31 */ KEY_2, /* 2 @ */
- /* 32 */ KEY_3, /* 3 # */
- /* 33 */ KEY_4, /* 4 $ */
- /* 34 */ KEY_5, /* 5 % */
- /* 35 */ KEY_6, /* 6 ^ */
- /* 36 */ KEY_7, /* 7 & */
- /* 37 */ KEY_8, /* 8 * */
- /* 38 */ KEY_9, /* 9 ( */
- /* 39 */ KEY_0, /* 0 ) */
- /* 40 */ KEY_Enter, /* Return */
- /* 41 */ KEY_Escape, /* Escape */
- /* 42 */ KEY_BackSpace, /* Backspace Delete */
- /* 43 */ KEY_Tab, /* Tab */
- /* 44 */ KEY_Space, /* Space */
- /* 45 */ KEY_Minus, /* - _ */
- /* 46 */ KEY_Equal, /* = + */
- /* 47 */ KEY_LBrace, /* [ { */
- /* 48 */ KEY_RBrace, /* ] } */
- /* 49 */ KEY_BSlash, /* \ | */
- /* 50 */ KEY_BSlash2, /* \ _ # ~ on some keyboards */
- /* 51 */ KEY_SemiColon, /* ; : */
- /* 52 */ KEY_Quote, /* ' " */
- /* 53 */ KEY_Tilde, /* ` ~ */
- /* 54 */ KEY_Comma, /* , < */
- /* 55 */ KEY_Period, /* . > */
- /* 56 */ KEY_Slash, /* / ? */
- /* 57 */ KEY_CapsLock, /* Caps Lock */
- /* 58 */ KEY_F1, /* F1 */
- /* 59 */ KEY_F2, /* F2 */
- /* 60 */ KEY_F3, /* F3 */
- /* 61 */ KEY_F4, /* F4 */
- /* 62 */ KEY_F5, /* F5 */
- /* 63 */ KEY_F6, /* F6 */
- /* 64 */ KEY_F7, /* F7 */
- /* 65 */ KEY_F8, /* F8 */
- /* 66 */ KEY_F9, /* F9 */
- /* 67 */ KEY_F10, /* F10 */
- /* 68 */ KEY_F11, /* F11 */
- /* 69 */ KEY_F12, /* F12 */
- /* 70 */ KEY_Print, /* PrintScrn SysReq */
- /* 71 */ KEY_ScrollLock, /* Scroll Lock */
- /* 72 */ KEY_Pause, /* Pause Break */
- /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */
- /* 74 */ KEY_Home, /* Home */
- /* 75 */ KEY_PgUp, /* Page Up */
- /* 76 */ KEY_Delete, /* Delete */
- /* 77 */ KEY_End, /* End */
- /* 78 */ KEY_PgDown, /* Page Down */
- /* 79 */ KEY_Right, /* Right Arrow */
- /* 80 */ KEY_Left, /* Left Arrow */
- /* 81 */ KEY_Down, /* Down Arrow */
- /* 82 */ KEY_Up, /* Up Arrow */
- /* 83 */ KEY_NumLock, /* Num Lock */
- /* 84 */ KEY_KP_Divide, /* Keypad / */
- /* 85 */ KEY_KP_Multiply, /* Keypad * */
- /* 86 */ KEY_KP_Minus, /* Keypad - */
- /* 87 */ KEY_KP_Plus, /* Keypad + */
- /* 88 */ KEY_KP_Enter, /* Keypad Enter */
- /* 89 */ KEY_KP_1, /* Keypad 1 End */
- /* 90 */ KEY_KP_2, /* Keypad 2 Down */
- /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */
- /* 92 */ KEY_KP_4, /* Keypad 4 Left */
- /* 93 */ KEY_KP_5, /* Keypad 5 */
- /* 94 */ KEY_KP_6, /* Keypad 6 */
- /* 95 */ KEY_KP_7, /* Keypad 7 Home */
- /* 96 */ KEY_KP_8, /* Keypad 8 Up */
- /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */
- /* 98 */ KEY_KP_0, /* Keypad 0 Ins */
- /* 99 */ KEY_KP_Decimal, /* Keypad . Del */
- /* 100 */ KEY_Less, /* < > on some keyboards */
- /* 101 */ KEY_Menu, /* Menu */
- /* 102 */ KEY_NOTUSED,
- /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
- /* 104 */ KEY_NOTUSED,
- /* 105 */ KEY_NOTUSED,
- /* 106 */ KEY_NOTUSED,
- /* 107 */ KEY_NOTUSED,
- /* 108 */ KEY_NOTUSED,
- /* 109 */ KEY_NOTUSED,
- /* 110 */ KEY_NOTUSED,
- /* 111 */ KEY_NOTUSED,
- /* 112 */ KEY_NOTUSED,
- /* 113 */ KEY_NOTUSED,
- /* 114 */ KEY_NOTUSED,
- /* 115 */ KEY_NOTUSED,
- /* 116 */ KEY_NOTUSED,
- /* 117 */ KEY_NOTUSED,
- /* 118 */ KEY_NOTUSED,
- /* 119 */ KEY_NOTUSED,
- /* 120 */ KEY_NOTUSED,
- /* 121 */ KEY_NOTUSED,
- /* 122 */ KEY_NOTUSED,
- /* 123 */ KEY_NOTUSED,
- /* 124 */ KEY_NOTUSED,
- /* 125 */ KEY_NOTUSED,
- /* 126 */ KEY_NOTUSED,
- /* 127 */ KEY_NOTUSED,
- /* 128 */ KEY_NOTUSED,
- /* 129 */ KEY_NOTUSED,
- /* 130 */ KEY_NOTUSED,
- /* 131 */ KEY_NOTUSED,
- /* 132 */ KEY_NOTUSED,
- /* 133 */ KEY_NOTUSED,
- /* 134 */ KEY_NOTUSED,
- /* 135 */ KEY_NOTUSED,
- /* 136 */ KEY_NOTUSED,
- /* 137 */ KEY_NOTUSED,
- /* 138 */ KEY_NOTUSED,
- /* 139 */ KEY_NOTUSED,
- /* 140 */ KEY_NOTUSED,
- /* 141 */ KEY_NOTUSED,
- /* 142 */ KEY_NOTUSED,
- /* 143 */ KEY_NOTUSED,
- /* 144 */ KEY_NOTUSED,
- /* 145 */ KEY_NOTUSED,
- /* 146 */ KEY_NOTUSED,
- /* 147 */ KEY_NOTUSED,
- /* 148 */ KEY_NOTUSED,
- /* 149 */ KEY_NOTUSED,
- /* 150 */ KEY_NOTUSED,
- /* 151 */ KEY_NOTUSED,
- /* 152 */ KEY_NOTUSED,
- /* 153 */ KEY_NOTUSED,
- /* 154 */ KEY_NOTUSED,
- /* 155 */ KEY_NOTUSED,
- /* 156 */ KEY_NOTUSED,
- /* 157 */ KEY_NOTUSED,
- /* 158 */ KEY_NOTUSED,
- /* 159 */ KEY_NOTUSED,
- /* 160 */ KEY_NOTUSED,
- /* 161 */ KEY_NOTUSED,
- /* 162 */ KEY_NOTUSED,
- /* 163 */ KEY_NOTUSED,
- /* 164 */ KEY_NOTUSED,
- /* 165 */ KEY_NOTUSED,
- /* 166 */ KEY_NOTUSED,
- /* 167 */ KEY_NOTUSED,
- /* 168 */ KEY_NOTUSED,
- /* 169 */ KEY_NOTUSED,
- /* 170 */ KEY_NOTUSED,
- /* 171 */ KEY_NOTUSED,
- /* 172 */ KEY_NOTUSED,
- /* 173 */ KEY_NOTUSED,
- /* 174 */ KEY_NOTUSED,
- /* 175 */ KEY_NOTUSED,
- /* 176 */ KEY_NOTUSED,
- /* 177 */ KEY_NOTUSED,
- /* 178 */ KEY_NOTUSED,
- /* 179 */ KEY_NOTUSED,
- /* 180 */ KEY_NOTUSED,
- /* 181 */ KEY_NOTUSED,
- /* 182 */ KEY_NOTUSED,
- /* 183 */ KEY_NOTUSED,
- /* 184 */ KEY_NOTUSED,
- /* 185 */ KEY_NOTUSED,
- /* 186 */ KEY_NOTUSED,
- /* 187 */ KEY_NOTUSED,
- /* 188 */ KEY_NOTUSED,
- /* 189 */ KEY_NOTUSED,
- /* 190 */ KEY_NOTUSED,
- /* 191 */ KEY_NOTUSED,
- /* 192 */ KEY_NOTUSED,
- /* 193 */ KEY_NOTUSED,
- /* 194 */ KEY_NOTUSED,
- /* 195 */ KEY_NOTUSED,
- /* 196 */ KEY_NOTUSED,
- /* 197 */ KEY_NOTUSED,
- /* 198 */ KEY_NOTUSED,
- /* 199 */ KEY_NOTUSED,
- /* 200 */ KEY_NOTUSED,
- /* 201 */ KEY_NOTUSED,
- /* 202 */ KEY_NOTUSED,
- /* 203 */ KEY_NOTUSED,
- /* 204 */ KEY_NOTUSED,
- /* 205 */ KEY_NOTUSED,
- /* 206 */ KEY_NOTUSED,
- /* 207 */ KEY_NOTUSED,
- /* 208 */ KEY_NOTUSED,
- /* 209 */ KEY_NOTUSED,
- /* 210 */ KEY_NOTUSED,
- /* 211 */ KEY_NOTUSED,
- /* 212 */ KEY_NOTUSED,
- /* 213 */ KEY_NOTUSED,
- /* 214 */ KEY_NOTUSED,
- /* 215 */ KEY_NOTUSED,
- /* 216 */ KEY_NOTUSED,
- /* 217 */ KEY_NOTUSED,
- /* 218 */ KEY_NOTUSED,
- /* 219 */ KEY_NOTUSED,
- /* 220 */ KEY_NOTUSED,
- /* 221 */ KEY_NOTUSED,
- /* 222 */ KEY_NOTUSED,
- /* 223 */ KEY_NOTUSED,
- /* 224 */ KEY_LCtrl, /* Left Control */
- /* 225 */ KEY_ShiftL, /* Left Shift */
- /* 226 */ KEY_Alt, /* Left Alt */
- /* 227 */ KEY_LMeta, /* Left Meta */
- /* 228 */ KEY_RCtrl, /* Right Control */
- /* 229 */ KEY_ShiftR, /* Right Shift */
- /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */
- /* 231 */ KEY_LMeta, /* Right Meta XXX */
-};
-
-#define WS_USB_MAP_SIZE (sizeof(wsUsbMap)/sizeof(unsigned char))
-
-/* Map for adb keyboards */
-static CARD8 wsAdbMap[] = {
- /* 0 */ KEY_A,
- /* 1 */ KEY_S,
- /* 2 */ KEY_D,
- /* 3 */ KEY_F,
- /* 4 */ KEY_H,
- /* 5 */ KEY_G,
- /* 6 */ KEY_Z,
- /* 7 */ KEY_X,
- /* 8 */ KEY_C,
- /* 9 */ KEY_V,
- /* 10 */ KEY_UNKNOWN, /* @ # on french keyboards */
- /* 11 */ KEY_B,
- /* 12 */ KEY_Q,
- /* 13 */ KEY_W,
- /* 14 */ KEY_E,
- /* 15 */ KEY_R,
- /* 16 */ KEY_Y,
- /* 17 */ KEY_T,
- /* 18 */ KEY_1,
- /* 19 */ KEY_2,
- /* 20 */ KEY_3,
- /* 21 */ KEY_4,
- /* 22 */ KEY_6,
- /* 23 */ KEY_5,
- /* 24 */ KEY_Equal,
- /* 25 */ KEY_9,
- /* 26 */ KEY_7,
- /* 27 */ KEY_Minus,
- /* 28 */ KEY_8,
- /* 29 */ KEY_0,
- /* 30 */ KEY_RBrace,
- /* 31 */ KEY_O,
- /* 32 */ KEY_U,
- /* 33 */ KEY_LBrace,
- /* 34 */ KEY_I,
- /* 35 */ KEY_P,
- /* 36 */ KEY_Enter,
- /* 37 */ KEY_L,
- /* 38 */ KEY_J,
- /* 39 */ KEY_Quote,
- /* 40 */ KEY_K,
- /* 41 */ KEY_SemiColon,
- /* 42 */ KEY_BSlash,
- /* 43 */ KEY_Comma,
- /* 44 */ KEY_Slash,
- /* 45 */ KEY_N,
- /* 46 */ KEY_M,
- /* 47 */ KEY_Period,
- /* 48 */ KEY_Tab,
- /* 49 */ KEY_Space,
- /* 50 */ KEY_Tilde,
- /* 51 */ KEY_Delete,
- /* 52 */ KEY_AltLang,
- /* 53 */ KEY_Escape,
- /* 54 */ KEY_LCtrl,
- /* 55 */ KEY_Alt,
- /* 56 */ KEY_ShiftL,
- /* 57 */ KEY_CapsLock,
- /* 58 */ KEY_LMeta,
- /* 59 */ KEY_Left,
- /* 60 */ KEY_Right,
- /* 61 */ KEY_Down,
- /* 62 */ KEY_Up,
- /* 63 */ KEY_UNKNOWN, /* Fn */
- /* 64 */ KEY_NOTUSED,
- /* 65 */ KEY_KP_Decimal,
- /* 66 */ KEY_NOTUSED,
- /* 67 */ KEY_KP_Multiply,
- /* 68 */ KEY_NOTUSED,
- /* 69 */ KEY_KP_Plus,
- /* 70 */ KEY_NOTUSED,
- /* 71 */ KEY_UNKNOWN, /* Clear */
- /* 72 */ KEY_NOTUSED,
- /* 73 */ KEY_NOTUSED,
- /* 74 */ KEY_NOTUSED,
- /* 75 */ KEY_KP_Divide,
- /* 76 */ KEY_KP_Enter,
- /* 77 */ KEY_NOTUSED,
- /* 78 */ KEY_KP_Minus,
- /* 79 */ KEY_NOTUSED,
- /* 80 */ KEY_NOTUSED,
- /* 81 */ KEY_KP_Equal, /* Keypad = */
- /* 82 */ KEY_KP_0,
- /* 83 */ KEY_KP_1,
- /* 84 */ KEY_KP_2,
- /* 85 */ KEY_KP_3,
- /* 86 */ KEY_KP_4,
- /* 87 */ KEY_KP_5,
- /* 88 */ KEY_KP_6,
- /* 89 */ KEY_KP_7,
- /* 90 */ KEY_NOTUSED,
- /* 91 */ KEY_KP_8,
- /* 92 */ KEY_KP_9,
- /* 93 */ KEY_NOTUSED,
- /* 94 */ KEY_NOTUSED,
- /* 95 */ KEY_UNKNOWN, /* Keypad , */
- /* 96 */ KEY_F5,
- /* 97 */ KEY_F6,
- /* 98 */ KEY_F7,
- /* 99 */ KEY_F3,
- /* 100 */ KEY_F8,
- /* 101 */ KEY_F9,
- /* 102 */ KEY_NOTUSED,
- /* 103 */ KEY_F11,
- /* 104 */ KEY_NOTUSED,
- /* 105 */ KEY_NOTUSED,
- /* 106 */ KEY_KP_Enter,
- /* 107 */ KEY_NOTUSED,
- /* 108 */ KEY_NOTUSED,
- /* 109 */ KEY_F10,
- /* 110 */ KEY_NOTUSED,
- /* 111 */ KEY_F12,
- /* 112 */ KEY_NOTUSED,
- /* 113 */ KEY_NOTUSED,
- /* 114 */ KEY_NOTUSED,
- /* 115 */ KEY_Home,
- /* 116 */ KEY_PgUp,
- /* 117 */ KEY_NOTUSED,
- /* 118 */ KEY_F4,
- /* 119 */ KEY_End,
- /* 120 */ KEY_F2,
- /* 121 */ KEY_PgDown,
- /* 122 */ KEY_F1,
- /* 123 */ KEY_NOTUSED,
- /* 124 */ KEY_NOTUSED,
- /* 125 */ KEY_NOTUSED,
- /* 126 */ KEY_NOTUSED,
- /* 127 */ KEY_NOTUSED,
- /* 128 */ KEY_NOTUSED,
- /* 129 */ KEY_NOTUSED,
- /* 130 */ KEY_NOTUSED,
- /* 131 */ KEY_NOTUSED,
- /* 132 */ KEY_NOTUSED,
- /* 133 */ KEY_NOTUSED,
- /* 134 */ KEY_NOTUSED,
- /* 135 */ KEY_NOTUSED,
- /* 136 */ KEY_NOTUSED,
- /* 137 */ KEY_NOTUSED,
- /* 138 */ KEY_NOTUSED,
- /* 139 */ KEY_NOTUSED,
- /* 140 */ KEY_NOTUSED,
- /* 141 */ KEY_NOTUSED,
- /* 142 */ KEY_NOTUSED,
- /* 143 */ KEY_NOTUSED,
- /* 144 */ KEY_NOTUSED,
- /* 145 */ KEY_NOTUSED,
- /* 146 */ KEY_NOTUSED,
- /* 147 */ KEY_NOTUSED,
- /* 148 */ KEY_NOTUSED,
- /* 149 */ KEY_NOTUSED,
- /* 150 */ KEY_NOTUSED,
- /* 151 */ KEY_NOTUSED,
- /* 152 */ KEY_NOTUSED,
- /* 153 */ KEY_NOTUSED,
- /* 154 */ KEY_NOTUSED,
- /* 155 */ KEY_NOTUSED,
- /* 156 */ KEY_NOTUSED,
- /* 157 */ KEY_NOTUSED,
- /* 158 */ KEY_NOTUSED,
- /* 159 */ KEY_NOTUSED,
- /* 160 */ KEY_NOTUSED,
- /* 161 */ KEY_NOTUSED,
- /* 162 */ KEY_NOTUSED,
- /* 163 */ KEY_NOTUSED,
- /* 164 */ KEY_NOTUSED,
- /* 165 */ KEY_NOTUSED,
- /* 166 */ KEY_NOTUSED,
- /* 167 */ KEY_NOTUSED,
- /* 168 */ KEY_NOTUSED,
- /* 169 */ KEY_NOTUSED,
- /* 170 */ KEY_NOTUSED,
- /* 171 */ KEY_NOTUSED,
- /* 172 */ KEY_NOTUSED,
- /* 173 */ KEY_NOTUSED,
- /* 174 */ KEY_NOTUSED,
- /* 175 */ KEY_NOTUSED,
- /* 176 */ KEY_NOTUSED,
- /* 177 */ KEY_NOTUSED,
- /* 178 */ KEY_NOTUSED,
- /* 179 */ KEY_NOTUSED,
- /* 180 */ KEY_NOTUSED,
- /* 181 */ KEY_NOTUSED,
- /* 182 */ KEY_NOTUSED,
- /* 183 */ KEY_NOTUSED,
- /* 184 */ KEY_NOTUSED,
- /* 185 */ KEY_NOTUSED,
- /* 186 */ KEY_NOTUSED,
- /* 187 */ KEY_NOTUSED,
- /* 188 */ KEY_NOTUSED,
- /* 189 */ KEY_NOTUSED,
- /* 190 */ KEY_NOTUSED,
- /* 191 */ KEY_NOTUSED,
- /* 192 */ KEY_NOTUSED,
- /* 193 */ KEY_NOTUSED,
- /* 194 */ KEY_NOTUSED,
- /* 195 */ KEY_NOTUSED,
- /* 196 */ KEY_NOTUSED,
- /* 197 */ KEY_NOTUSED,
- /* 198 */ KEY_NOTUSED,
- /* 199 */ KEY_NOTUSED,
- /* 200 */ KEY_NOTUSED,
- /* 201 */ KEY_NOTUSED,
- /* 202 */ KEY_NOTUSED,
- /* 203 */ KEY_NOTUSED,
- /* 204 */ KEY_NOTUSED,
- /* 205 */ KEY_NOTUSED,
- /* 206 */ KEY_NOTUSED,
- /* 207 */ KEY_NOTUSED,
- /* 208 */ KEY_NOTUSED,
- /* 209 */ KEY_NOTUSED,
- /* 210 */ KEY_NOTUSED,
- /* 211 */ KEY_NOTUSED,
- /* 212 */ KEY_NOTUSED,
- /* 213 */ KEY_NOTUSED,
- /* 214 */ KEY_NOTUSED,
- /* 215 */ KEY_NOTUSED,
- /* 216 */ KEY_NOTUSED,
- /* 217 */ KEY_NOTUSED,
- /* 218 */ KEY_NOTUSED,
- /* 219 */ KEY_NOTUSED,
- /* 220 */ KEY_NOTUSED,
- /* 221 */ KEY_NOTUSED,
- /* 222 */ KEY_NOTUSED,
- /* 223 */ KEY_NOTUSED,
-};
-
-#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
-
-static CARD8 wsSunMap[] = {
- /* 0x00 */ KEY_NOTUSED,
- /* 0x01 */ KEY_NOTUSED, /* stop */
- /* 0x02 */ KEY_NOTUSED, /* BrightnessDown / S-VolumeDown */
- /* 0x03 */ KEY_NOTUSED, /* again */
- /* 0x04 */ KEY_NOTUSED, /* BridgtnessUp / S-VolumeUp */
- /* 0x05 */ KEY_F1,
- /* 0x06 */ KEY_F2,
- /* 0x07 */ KEY_F10,
- /* 0x08 */ KEY_F3,
- /* 0x09 */ KEY_F11,
- /* 0x0a */ KEY_F4,
- /* 0x0b */ KEY_F12,
- /* 0x0c */ KEY_F5,
- /* 0x0d */ KEY_AltLang,
- /* 0x0e */ KEY_F6,
- /* 0x0f */ KEY_NOTUSED,
- /* 0x10 */ KEY_F7,
- /* 0x11 */ KEY_F8,
- /* 0x12 */ KEY_F9,
- /* 0x13 */ KEY_Alt,
- /* 0x14 */ KEY_Up,
- /* 0x15 */ KEY_Pause,
- /* 0x16 */ KEY_Print,
- /* 0x17 */ KEY_NOTUSED, /* props */
- /* 0x18 */ KEY_Left,
- /* 0x19 */ KEY_ScrollLock,
- /* 0x1a */ KEY_NOTUSED, /* undo */
- /* 0x1b */ KEY_Down,
- /* 0x1c */ KEY_Right,
- /* 0x1d */ KEY_Escape,
- /* 0x1e */ KEY_1,
- /* 0x1f */ KEY_2,
- /* 0x20 */ KEY_3,
- /* 0x21 */ KEY_4,
- /* 0x22 */ KEY_5,
- /* 0x23 */ KEY_6,
- /* 0x24 */ KEY_7,
- /* 0x25 */ KEY_8,
- /* 0x26 */ KEY_9,
- /* 0x27 */ KEY_0,
- /* 0x28 */ KEY_Minus,
- /* 0x29 */ KEY_Equal,
- /* 0x2a */ KEY_Tilde,
- /* 0x2b */ KEY_BackSpace,
- /* 0x2c */ KEY_Insert,
- /* 0x2d */ KEY_KP_Equal,
- /* 0x2e */ KEY_KP_Divide,
- /* 0x2f */ KEY_KP_Multiply,
- /* 0x30 */ KEY_NOTUSED,
- /* 0x31 */ KEY_NOTUSED, /* front */
- /* 0x32 */ KEY_KP_Decimal,
- /* 0x33 */ KEY_NOTUSED, /* copy */
- /* 0x34 */ KEY_Home,
- /* 0x35 */ KEY_Tab,
- /* 0x36 */ KEY_Q,
- /* 0x37 */ KEY_W,
- /* 0x38 */ KEY_E,
- /* 0x39 */ KEY_R,
- /* 0x3a */ KEY_T,
- /* 0x3b */ KEY_Y,
- /* 0x3c */ KEY_U,
- /* 0x3d */ KEY_I,
- /* 0x3e */ KEY_O,
- /* 0x3f */ KEY_P,
- /* 0x40 */ KEY_LBrace,
- /* 0x41 */ KEY_RBrace,
- /* 0x42 */ KEY_Delete,
- /* 0x43 */ KEY_NOTUSED, /* compose */
- /* 0x44 */ KEY_KP_7,
- /* 0x45 */ KEY_KP_8,
- /* 0x46 */ KEY_KP_9,
- /* 0x47 */ KEY_KP_Minus,
- /* 0x48 */ KEY_NOTUSED, /* open */
- /* 0x49 */ KEY_NOTUSED, /* paste */
- /* 0x4a */ KEY_End,
- /* 0x4b */ KEY_NOTUSED,
- /* 0x4c */ KEY_LCtrl,
- /* 0x4d */ KEY_A,
- /* 0x4e */ KEY_S,
- /* 0x4f */ KEY_D,
- /* 0x50 */ KEY_F,
- /* 0x51 */ KEY_G,
- /* 0x52 */ KEY_H,
- /* 0x53 */ KEY_J,
- /* 0x54 */ KEY_K,
- /* 0x55 */ KEY_L,
- /* 0x56 */ KEY_SemiColon,
- /* 0x57 */ KEY_Quote,
- /* 0x58 */ KEY_BSlash,
- /* 0x59 */ KEY_Enter,
- /* 0x5a */ KEY_KP_Enter,
- /* 0x5b */ KEY_KP_4,
- /* 0x5c */ KEY_KP_5,
- /* 0x5d */ KEY_KP_6,
- /* 0x5e */ KEY_KP_0,
- /* 0x5f */ KEY_NOTUSED, /* find */
- /* 0x60 */ KEY_PgUp,
- /* 0x61 */ KEY_NOTUSED, /* cut */
- /* 0x62 */ KEY_NumLock,
- /* 0x63 */ KEY_ShiftL,
- /* 0x64 */ KEY_Z,
- /* 0x65 */ KEY_X,
- /* 0x66 */ KEY_C,
- /* 0x67 */ KEY_V,
- /* 0x68 */ KEY_B,
- /* 0x69 */ KEY_N,
- /* 0x6a */ KEY_M,
- /* 0x6b */ KEY_Comma,
- /* 0x6c */ KEY_Period,
- /* 0x6d */ KEY_Slash,
- /* 0x6e */ KEY_ShiftR,
- /* 0x6f */ KEY_NOTUSED, /* linefeed */
- /* 0x70 */ KEY_KP_1,
- /* 0x71 */ KEY_KP_2,
- /* 0x72 */ KEY_KP_3,
- /* 0x73 */ KEY_NOTUSED,
- /* 0x74 */ KEY_NOTUSED,
- /* 0x75 */ KEY_NOTUSED,
- /* 0x76 */ KEY_NOTUSED, /* help */
- /* 0x77 */ KEY_CapsLock,
- /* 0x78 */ KEY_LMeta,
- /* 0x79 */ KEY_Space,
- /* 0x7a */ KEY_RMeta,
- /* 0x7b */ KEY_PgDown,
- /* 0x7c */ KEY_NOTUSED,
- /* 0x7d */ KEY_KP_Plus,
- /* 0x7e */ KEY_NOTUSED,
- /* 0x7f */ KEY_NOTUSED
-};
-
-#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char))
-
-/*
- * Translate raw wskbd keyboard event values to XFree86 standard keycodes
- * (based on the AT keyboard scan codes using the tables above
- */
-int
-WSKbdToKeycode(int keycode)
-{
- switch (xf86Info.wsKbdType) {
- case WSKBD_TYPE_PC_XT:
- case WSKBD_TYPE_PC_AT:
- /* No translation needed */
- return keycode;
- case WSKBD_TYPE_USB:
- if (keycode < 0 || keycode >= WS_USB_MAP_SIZE)
- return KEY_UNKNOWN;
- else
- return wsUsbMap[keycode];
-#ifdef WSKBD_TYPE_ADB
- case WSKBD_TYPE_ADB:
- if (keycode < 0 || keycode >= WS_ADB_MAP_SIZE)
- return KEY_UNKNOWN;
- else
- return wsAdbMap[keycode];
-#endif
-#ifdef WSKBD_TYPE_SUN
- case WSKBD_TYPE_SUN:
-#ifdef WSKBD_TYPE_SUN5
- case WSKBD_TYPE_SUN5:
-#endif
- if (keycode < 0 || keycode >= WS_SUN_MAP_SIZE)
- return KEY_UNKNOWN;
- else
- return wsSunMap[keycode];
-#endif
- default:
- ErrorF("Unknown wskbd type %d\n", xf86Info.wsKbdType);
- return KEY_UNKNOWN;
- }
-}
-
-#endif /* WSCONS_SUPPORT */
diff --git a/hw/xfree86/common/xf86KbdLnx.c b/hw/xfree86/common/xf86KbdLnx.c
deleted file mode 100644
index b023acfbd..000000000
--- a/hw/xfree86/common/xf86KbdLnx.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.17 2003/08/24 17:36:53 dawes Exp $ */
-/*
- * Linux version of keymapping setup. The kernel (since 0.99.14) has support
- * for fully remapping the keyboard, but there are some differences between
- * the Linux map and the SVR4 map (esp. in the extended keycodes). We also
- * remove the restriction on what keycodes can be remapped.
- * Orest Zborowski.
- */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1994-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: xf86KbdLnx.c /main/7 1996/10/19 17:59:00 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-
-#include "xf86Keymap.h"
-#include "DECkeysym.h"
-
-/*
- * LegalModifier --
- * determine whether a key is a legal modifier key, i.e send a
- * press/release sequence.
- */
-
-/*ARGSUSED*/
-Bool
-LegalModifier(unsigned int key, DevicePtr pDev)
-{
- return (TRUE);
-}
-
-/*
- * xf86KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-static void readKernelMapping(KeySymsPtr pKeySyms, CARD8 *pModMap);
-
-void
-xf86KbdGetMapping (KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- KeySym *k;
- char type;
- int i;
-
- readKernelMapping(pKeySyms, pModMap);
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- xf86Info.kbdType =
- ioctl(xf86Info.consoleFd, KDGKBTYPE, &type) != -1 ? type : KB_101;
-
- pKeySyms->map = map;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-#include <linux/keyboard.h>
-
-static KeySym linux_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
-};
-
-/*
- * Maps the AT keycodes to Linux keycodes
- */
-static unsigned char at2lnx[NUM_KEYCODES] =
-{
- 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
- 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
- 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
- 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
- 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
- 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
- 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
- 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
- 0x11, /* KEY_W */ 0x12, /* KEY_E */
- 0x13, /* KEY_R */ 0x14, /* KEY_T */
- 0x15, /* KEY_Y */ 0x16, /* KEY_U */
- 0x17, /* KEY_I */ 0x18, /* KEY_O */
- 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
- 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
- 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
- 0x1f, /* KEY_S */ 0x20, /* KEY_D */
- 0x21, /* KEY_F */ 0x22, /* KEY_G */
- 0x23, /* KEY_H */ 0x24, /* KEY_J */
- 0x25, /* KEY_K */ 0x26, /* KEY_L */
- 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
- 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
- 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
- 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
- 0x2f, /* KEY_V */ 0x30, /* KEY_B */
- 0x31, /* KEY_N */ 0x32, /* KEY_M */
- 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
- 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
- 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
- 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
- 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
- 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
- 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
- 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
- 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
- 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
- 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
- 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
- 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
- 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
- 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
- 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
- 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
- 0x00, /* 0x55 */ 0x56, /* KEY_Less */
- 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
- 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
- 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
- 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
- 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
- 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
- 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
- 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
- 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
- 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
- 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
- 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
- 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
- 0x00, /* 0x71 */ 0x00, /* 0x72 */
- 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
- 0x00, /* 0x75 */ 0x00, /* 0x76 */
- 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
- 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
- 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
- 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
- 0x00, /* 0x7f */
-};
-#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
-
-#define NUM_CUSTOMKEYS NR_KEYS
-
-u_char SpecialServerMap[NUM_CUSTOMKEYS];
-
-static void
-readKernelMapping(KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- KeySym *k;
- int i;
- int maxkey;
- static unsigned char tbl[GLYPHS_PER_KEY] =
- {
- 0, /* unshifted */
- 1, /* shifted */
- 0, /* modeswitch unshifted */
- 0 /* modeswitch shifted */
- };
-
- /*
- * Read the mapping from the kernel.
- * Since we're still using the XFree86 scancode->AT keycode mapping
- * routines, we need to convert the AT keycodes to Linux keycodes,
- * then translate the Linux keysyms into X keysyms.
- *
- * First, figure out which tables to use for the modeswitch columns
- * above, from the XF86Config fields.
- */
- tbl[2] = 8; /* alt */
- tbl[3] = tbl[2] | 1;
-
- if (xf86Info.kbdCustomKeycodes) {
- k = map;
- maxkey = NUM_CUSTOMKEYS;
- }
- else {
- k = map+GLYPHS_PER_KEY;
- maxkey = NUM_AT2LNX;
- }
-
- for (i = 0; i < maxkey; ++i)
- {
- struct kbentry kbe;
- int j;
-
- if (xf86Info.kbdCustomKeycodes)
- kbe.kb_index = i;
- else
- kbe.kb_index = at2lnx[i];
-
- for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k)
- {
- unsigned short kval;
-
- *k = NoSymbol;
-
- kbe.kb_table = tbl[j];
- if (
- (!xf86Info.kbdCustomKeycodes && kbe.kb_index == 0) ||
- ioctl(xf86Info.consoleFd, KDGKBENT, &kbe))
- continue;
-
- kval = KVAL(kbe.kb_value);
- switch (KTYP(kbe.kb_value))
- {
- case KT_LATIN:
- case KT_LETTER:
- *k = linux_to_x[kval];
- break;
-
- case KT_FN:
- if (kval <= 19)
- *k = XK_F1 + kval;
- else switch (kbe.kb_value)
- {
- case K_FIND:
- *k = XK_Home; /* or XK_Find */
- break;
- case K_INSERT:
- *k = XK_Insert;
- break;
- case K_REMOVE:
- *k = XK_Delete;
- break;
- case K_SELECT:
- *k = XK_End; /* or XK_Select */
- break;
- case K_PGUP:
- *k = XK_Prior;
- break;
- case K_PGDN:
- *k = XK_Next;
- break;
- case K_HELP:
- *k = XK_Help;
- break;
- case K_DO:
- *k = XK_Execute;
- break;
- case K_PAUSE:
- *k = XK_Pause;
- break;
- case K_MACRO:
- *k = XK_Menu;
- break;
- default:
- break;
- }
- break;
-
- case KT_SPEC:
- switch (kbe.kb_value)
- {
- case K_ENTER:
- *k = XK_Return;
- break;
- case K_BREAK:
- *k = XK_Break;
- break;
- case K_CAPS:
- *k = XK_Caps_Lock;
- break;
- case K_NUM:
- *k = XK_Num_Lock;
- break;
- case K_HOLD:
- *k = XK_Scroll_Lock;
- break;
- case K_COMPOSE:
- *k = XK_Multi_key;
- break;
- default:
- break;
- }
- break;
-
- case KT_PAD:
- switch (kbe.kb_value)
- {
- case K_PPLUS:
- *k = XK_KP_Add;
- break;
- case K_PMINUS:
- *k = XK_KP_Subtract;
- break;
- case K_PSTAR:
- *k = XK_KP_Multiply;
- break;
- case K_PSLASH:
- *k = XK_KP_Divide;
- break;
- case K_PENTER:
- *k = XK_KP_Enter;
- break;
- case K_PCOMMA:
- *k = XK_KP_Separator;
- break;
- case K_PDOT:
- *k = XK_KP_Decimal;
- break;
- case K_PPLUSMINUS:
- *k = XK_KP_Subtract;
- break;
- default:
- if (kval <= 9)
- *k = XK_KP_0 + kval;
- break;
- }
- break;
-
- /*
- * KT_DEAD keys are for accelerated diacritical creation.
- */
- case KT_DEAD:
- switch (kbe.kb_value)
- {
- case K_DGRAVE:
- *k = XK_dead_grave;
- break;
- case K_DACUTE:
- *k = XK_dead_acute;
- break;
- case K_DCIRCM:
- *k = XK_dead_circumflex;
- break;
- case K_DTILDE:
- *k = XK_dead_tilde;
- break;
- case K_DDIERE:
- *k = XK_dead_diaeresis;
- break;
- }
- break;
-
- case KT_CUR:
- switch (kbe.kb_value)
- {
- case K_DOWN:
- *k = XK_Down;
- break;
- case K_LEFT:
- *k = XK_Left;
- break;
- case K_RIGHT:
- *k = XK_Right;
- break;
- case K_UP:
- *k = XK_Up;
- break;
- }
- break;
-
- case KT_SHIFT:
- switch (kbe.kb_value)
- {
- case K_ALTGR:
- *k = XK_Alt_R;
- break;
- case K_ALT:
- *k = (kbe.kb_index == 0x64 ?
- XK_Alt_R : XK_Alt_L);
- break;
- case K_CTRL:
- *k = (kbe.kb_index == 0x61 ?
- XK_Control_R : XK_Control_L);
- break;
- case K_CTRLL:
- *k = XK_Control_L;
- break;
- case K_CTRLR:
- *k = XK_Control_R;
- break;
- case K_SHIFT:
- *k = (kbe.kb_index == 0x36 ?
- XK_Shift_R : XK_Shift_L);
- break;
- case K_SHIFTL:
- *k = XK_Shift_L;
- break;
- case K_SHIFTR:
- *k = XK_Shift_R;
- break;
- default:
- break;
- }
- break;
-
- /*
- * KT_ASCII keys accumulate a 3 digit decimal number that gets
- * emitted when the shift state changes. We can't emulate that.
- */
- case KT_ASCII:
- break;
-
- case KT_LOCK:
- if (kbe.kb_value == K_SHIFTLOCK)
- *k = XK_Shift_Lock;
- break;
-
- default:
- break;
- }
- }
-
- if (k[-1] == k[-2]) k[-1] = NoSymbol;
- if (k[-2] == k[-3]) k[-2] = NoSymbol;
- if (k[-3] == k[-4]) k[-3] = NoSymbol;
- if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
- if (k[-1] == k[-4] && k[-2] == k[-3] && k[-2] == NoSymbol) k[-1] =NoSymbol;
- }
-
- if (!xf86Info.kbdCustomKeycodes)
- return;
-
- /*
- * Find the Mapping for the special server functions
- */
- for (i = 0; i < NUM_CUSTOMKEYS; ++i) {
- struct kbentry kbe;
- int special = 0;
-
- kbe.kb_index = i;
- kbe.kb_table = 0; /* Plain map */
- if (!ioctl(xf86Info.consoleFd, KDGKBENT, &kbe))
- switch (kbe.kb_value) {
- case K(KT_LATIN,0x7f): /* This catches DEL too... But who cares? */
- special = KEY_BackSpace;
- break;
- case K_PMINUS:
- special = KEY_KP_Minus;
- break;
- case K_PPLUS:
- special = KEY_KP_Plus;
- break;
- case K_F1:
- special = KEY_F1;
- break;
- case K_F2:
- special = KEY_F2;
- break;
- case K_F3:
- special = KEY_F3;
- break;
- case K_F4:
- special = KEY_F4;
- break;
- case K_F5:
- special = KEY_F5;
- break;
- case K_F6:
- special = KEY_F6;
- break;
- case K_F7:
- special = KEY_F7;
- break;
- case K_F8:
- special = KEY_F8;
- break;
- case K_F9:
- special = KEY_F9;
- break;
- case K_F10:
- special = KEY_F10;
- break;
- case K_F11:
- special = KEY_F11;
- break;
- case K_F12:
- special = KEY_F12;
- break;
- case K_ALT:
- special = KEY_Alt;
- break;
- case K_ALTGR:
- special = KEY_AltLang;
- break;
- case K_CONS:
- special = KEY_SysReqest;
- break;
- }
- SpecialServerMap[i] = special;
- }
-}
diff --git a/hw/xfree86/common/xf86KbdMach.c b/hw/xfree86/common/xf86KbdMach.c
deleted file mode 100644
index fbbafd8af..000000000
--- a/hw/xfree86/common/xf86KbdMach.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c,v 3.8 1998/07/25 16:55:09 dawes Exp $ */
-/*
- *****************************************************************************
- * HISTORY
- * Log: xf86KbdMach.c,v
- * Revision 2.1.2.1 92/06/25 10:32:08 moore
- * Incorporate the Elliot Dresselhaus's, Ernest Hua's and local changes
- * to run Thomas Roell's I386 color X11R5. Original code only worked
- * with SCO Unix. New code works with 2.5 and 3.0 Mach
- * [92/06/24 rvb]
- *
- * EndLog
- *
- *****************************************************************************
- */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: xf86KbdMach.c /main/9 1996/02/21 17:38:43 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-#include "xf86Config.h"
-
-#include "xf86Keymap.h"
-
-static KeySym ascii_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
- XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
- XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
- XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
- XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
- XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
- XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
- XK_sterling, XK_yen, XK_paragraph, XK_section,
- XK_aacute, XK_iacute, XK_oacute, XK_uacute,
- XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
- XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
- XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
- XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
- XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
- XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
- XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
- XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
- XK_degree, NoSymbol, NoSymbol, XK_radical,
- XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
- };
-
-/*
- * LegalModifier --
- * determine whether a key is a legal modifier key, i.e send a
- * press/release sequence.
- */
-
-/*ARGSUSED*/
-Bool
-LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
-{
- return (TRUE);
-}
-
-
-
-/*
- * xf86KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-void
-xf86KbdGetMapping (pKeySyms, pModMap)
- KeySymsPtr pKeySyms;
- CARD8 *pModMap;
-{
- KeySym *k;
- struct kbentry kbe;
- char type;
- int i, j;
-
- for (i = 0; i < NUMKEYS; i++)
- {
- static int states[] = { NORM_STATE, SHIFT_STATE, ALT_STATE, SHIFT_ALT };
- int j;
-
- k = &map[i*4];
- kbe.kb_index = i;
-
- for (j = 0; j < 4; j++)
- {
- kbe.kb_state = states[j];
-
- if (ioctl (xf86Info.consoleFd, KDGKBENT, &kbe) != -1)
- continue;
-
- if (kbe.kb_value [0] == K_SCAN)
- {
- int keycode = -1;
- switch (kbe.kb_value [1])
- {
- case K_CTLSC: keycode = XK_Control_L; break;
- case K_LSHSC: keycode = XK_Shift_L; break;
- case K_RSHSC: keycode = XK_Shift_R; break;
- case K_ALTSC: keycode = XK_Alt_L; break;
- case K_CLCKSC: keycode = XK_Caps_Lock; break;
- case K_NLCKSC: keycode = XK_Num_Lock; break;
- default: break;
- }
- if (keycode > 0)
- k[j] = keycode;
- }
- else if (kbe.kb_value[1] != NC)
- {
- /* How to handle multiple characters?
- Ignore them for now. */
- }
- else
- {
- k[j] = ascii_to_x[kbe.kb_value[0]];
- }
- }
- }
-
- /*
- * Apply the special key mapping specified in XF86Config
- */
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4) {
- switch (k[0]) {
- case XK_Alt_L:
- j = K_INDEX_LEFTALT;
- break;
- case XK_Alt_R:
- j = K_INDEX_RIGHTALT;
- break;
- case XK_Scroll_Lock:
- j = K_INDEX_SCROLLLOCK;
- break;
- case XK_Control_R:
- j = K_INDEX_RIGHTCTL;
- break;
- default:
- j = -1;
- }
- if (j >= 0)
- switch (xf86Info.specialKeyMap[j]) {
- case KM_META:
- if (k[0] == XK_Alt_R)
- k[1] = XK_Meta_R;
- else {
- k[0] = XK_Alt_L;
- k[1] = XK_Meta_L;
- }
- break;
- case KM_COMPOSE:
- k[0] = XK_Multi_key;
- break;
- case KM_MODESHIFT:
- k[0] = XK_Mode_switch;
- k[1] = NoSymbol;
- break;
- case KM_MODELOCK:
- k[0] = XK_Mode_switch;
- k[1] = XF86XK_ModeLock;
- break;
- case KM_SCROLLLOCK:
- k[0] = XK_Scroll_Lock;
- break;
- case KM_CONTROL:
- k[0] = XK_Control_R;
- break;
- }
- }
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- if (!xf86Info.serverNumLock) pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- xf86Info.kbdType =
- ioctl(xf86Info.kbdFd, KDGKBDTYPE, &type) != -1 ? type : KB_VANILLAKB;
-
- pKeySyms->map = map;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- if (xf86Info.serverNumLock)
- pKeySyms->maxKeyCode = MAX_KEYCODE;
- else
- pKeySyms->maxKeyCode = MAX_STD_KEYCODE;
-
-}
diff --git a/hw/xfree86/common/xf86Keymap.h b/hw/xfree86/common/xf86Keymap.h
deleted file mode 100644
index 82ea52eef..000000000
--- a/hw/xfree86/common/xf86Keymap.h
+++ /dev/null
@@ -1,451 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.20 2003/08/24 17:36:53 dawes Exp $ */
-
-/*
- * Copyright (c) 1994-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- *
- * For Scancodes see notes in atKeynames.h !!!!
- *
- */
-/* $XConsortium: xf86Keymap.h /main/14 1996/02/21 17:38:47 kaleb $ */
-
-static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
-
-#if !defined(__SOL8__) && (!defined(sun) || defined(i386))
-
- /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
- /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
- /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
- /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
- /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
- /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
- /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
- /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
- /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
- /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
- /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
- /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
- /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
- /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol,
- /* 0x10 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
- /* 0x11 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
- /* 0x12 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
- /* 0x13 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x14 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
- /* 0x15 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
- /* 0x16 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
- /* 0x17 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
- /* 0x18 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
- /* 0x19 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
- /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
- /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1e */ XK_A, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1f */ XK_S, NoSymbol, NoSymbol, NoSymbol,
- /* 0x20 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
- /* 0x21 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
- /* 0x22 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
- /* 0x23 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
- /* 0x24 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
- /* 0x25 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
- /* 0x26 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
- /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
- /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
- /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0x2c */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2d */ XK_X, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2e */ XK_C, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2f */ XK_V, NoSymbol, NoSymbol, NoSymbol,
- /* 0x30 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
- /* 0x31 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
- /* 0x32 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
- /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol,
- /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol,
- /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol,
- /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
- /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
- /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
- /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
- /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
- /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
- /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
- /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol,
- /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
- /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
- /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
- /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
- /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
- /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
- /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol,
- /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol,
- /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
- /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
- /* 0x59 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5a */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5b */ XK_Prior, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5c */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5e */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5f */ XK_End, NoSymbol, NoSymbol, NoSymbol,
- /* 0x60 */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x61 */ XK_Next, NoSymbol, NoSymbol, NoSymbol,
- /* 0x62 */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
- /* 0x63 */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
- /* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
- /* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
- /* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
- /* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
- /* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6e */ XK_F13, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6f */ XK_F14, NoSymbol, NoSymbol, NoSymbol,
- /* 0x70 */ XK_F15, NoSymbol, NoSymbol, NoSymbol,
- /* 0x71 */ XK_F16, NoSymbol, NoSymbol, NoSymbol,
- /* 0x72 */ XK_F17, NoSymbol, NoSymbol, NoSymbol,
- /* 0x73 */ XK_backslash, XK_underscore, NoSymbol, NoSymbol,
- /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x79 */ XK_Henkan, XK_Mode_switch, NoSymbol, NoSymbol,
- /* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7b */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7d */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
-#else /* SunOS */
-
-/* Assumes a US English keyboard as default - sorry 'bout that
- *
- * Hopefully it'll be enough someone can have a sorta working
- * keyboard, if they're not using XKB
- *
- * DWH 9/12/99
- */
-
- /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x01 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
- /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
- /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
- /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
- /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
- /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
- /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
- /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
- /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
- /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
- /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
- /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
- /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
- /* 0x0e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0f */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10 */ XK_Tab, NoSymbol, NoSymbol, NoSymbol,
- /* 0x11 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
- /* 0x12 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
- /* 0x13 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
- /* 0x14 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x15 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
- /* 0x16 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
- /* 0x17 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
- /* 0x18 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
- /* 0x19 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1a */ XK_P, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1b */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
- /* 0x1c */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
- /* 0x1d */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0x1e */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1f */ XK_A, NoSymbol, NoSymbol, NoSymbol,
- /* 0x20 */ XK_S, NoSymbol, NoSymbol, NoSymbol,
- /* 0x21 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
- /* 0x22 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
- /* 0x23 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
- /* 0x24 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
- /* 0x25 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
- /* 0x26 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
- /* 0x27 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x28 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
- /* 0x29 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
- /* 0x2a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2b */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2c */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2e */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2f */ XK_X, NoSymbol, NoSymbol, NoSymbol,
- /* 0x30 */ XK_C, NoSymbol, NoSymbol, NoSymbol,
- /* 0x31 */ XK_V, NoSymbol, NoSymbol, NoSymbol,
- /* 0x32 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
- /* 0x33 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
- /* 0x34 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
- /* 0x35 */ XK_comma, XK_less, NoSymbol, NoSymbol,
- /* 0x36 */ XK_period, XK_greater, NoSymbol, NoSymbol,
- /* 0x37 */ XK_slash, XK_question, NoSymbol, NoSymbol,
- /* 0x38 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x39 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3a */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3c */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
- /* 0x3d */ XK_space, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3e */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
- /* 0x3f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x40 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x41 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x42 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x43 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x44 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x45 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x46 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x47 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x48 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x49 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4b */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4c */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4f */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
- /* 0x50 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
- /* 0x51 */ XK_End, NoSymbol, NoSymbol, NoSymbol,
- /* 0x52 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x53 */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x54 */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x55 */ XK_Prior, NoSymbol, NoSymbol, NoSymbol,
- /* 0x56 */ XK_Next, NoSymbol, NoSymbol, NoSymbol,
- /* 0x57 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x58 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x59 */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5a */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5b */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
- /* 0x5c */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
- /* 0x5d */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
- /* 0x5e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5f */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
- /* 0x60 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
- /* 0x61 */ NoSymbol, XK_KP_5, NoSymbol, NoSymbol,
- /* 0x62 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
- /* 0x63 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
- /* 0x64 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
- /* 0x65 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
- /* 0x66 */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
- /* 0x67 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
- /* 0x68 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
- /* 0x69 */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6a */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6c */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6e */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x70 */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x71 */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x72 */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x73 */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x74 */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x75 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x76 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x77 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x78 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x79 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7a */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7b */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7c */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7d */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7e */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
-#endif /* SunOS */
-
-};
-
-#if !defined(Lynx) && \
- !defined(__UNIXOS2__) && \
- !defined(__mips__) && \
- !defined(linux) && \
- !defined(CSRG_BASED) && \
- !defined(__CYGWIN__) && \
- !defined(__SOL8__) && \
- (!defined(sun) || defined(i386))
-
-static KeySym map84[NUM_KEYCODES * GLYPHS_PER_KEY] = {
- /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
- /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
- /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
- /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
- /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
- /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
- /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
- /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
- /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
- /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
- /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
- /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
- /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
- /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0f */ XK_Tab, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
- /* 0x11 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
- /* 0x12 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
- /* 0x13 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x14 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
- /* 0x15 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
- /* 0x16 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
- /* 0x17 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
- /* 0x18 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
- /* 0x19 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
- /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
- /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1e */ XK_A, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1f */ XK_S, NoSymbol, NoSymbol, NoSymbol,
- /* 0x20 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
- /* 0x21 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
- /* 0x22 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
- /* 0x23 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
- /* 0x24 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
- /* 0x25 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
- /* 0x26 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
- /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
- /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
- /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0x2c */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2d */ XK_X, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2e */ XK_C, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2f */ XK_V, NoSymbol, NoSymbol, NoSymbol,
- /* 0x30 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
- /* 0x31 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
- /* 0x32 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
- /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol,
- /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol,
- /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol,
- /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
- /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
- /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
- /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
- /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
- /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
- /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
- /* 0x4c */ NoSymbol, XK_KP_5, NoSymbol, NoSymbol,
- /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
- /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
- /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
- /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
- /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
- /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
- /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol,
- /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol,
- /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
- /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
- /* 0x59 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x60 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x61 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x62 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x63 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
- /* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
- /* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
- /* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
- /* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x70 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x71 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x72 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x73 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x79 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-};
-#endif
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
deleted file mode 100644
index a36ca52f2..000000000
--- a/hw/xfree86/common/xf86MiscExt.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.16 2003/11/03 05:11:02 tsi Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the Pointer/Keyboard functions needed by the
- * XFree86-Misc extension.
- */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#ifdef XF86MISC
-#define _XF86MISC_SERVER_
-#include "xf86misc.h"
-#include "xf86miscproc.h"
-#endif
-
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#include "xf86Xinput.h"
-#else
-#include "inputstr.h"
-#endif
-
-#include "xf86OSmouse.h"
-#include "../input/mouse/mouse.h"
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-#ifdef XF86MISC
-
-typedef struct {
- int type;
- int baudrate;
- int samplerate;
- int resolution;
- int buttons;
- Bool em3buttons;
- int em3timeout;
- Bool chordmiddle;
- int flags;
- char* device;
- pointer private;
-} mseParamsRec, *mseParamsPtr;
-
-typedef struct {
- int type;
- int rate;
- int delay;
- int serverNumLock; /* obsolete */
-} kbdParamsRec, *kbdParamsPtr;
-
-/*
- Sigh...
-
- The extension should probably be changed to use protocol
- names instead of ID numbers
-*/
-static struct mouse_map {
- int mtype;
- MouseProtocolID proto;
-} m_map[] =
-{
- { MTYPE_MICROSOFT, PROT_MS },
- { MTYPE_MOUSESYS, PROT_MSC },
- { MTYPE_MMSERIES, PROT_MM },
- { MTYPE_LOGITECH, PROT_LOGI },
- { MTYPE_LOGIMAN, PROT_LOGIMAN },
- { MTYPE_MMHIT, PROT_MMHIT },
- { MTYPE_GLIDEPOINT, PROT_GLIDE },
- { MTYPE_IMSERIAL, PROT_IMSERIAL },
- { MTYPE_THINKING, PROT_THINKING },
- { MTYPE_ACECAD, PROT_ACECAD },
- { MTYPE_PS_2, PROT_PS2 },
- { MTYPE_IMPS2, PROT_IMPS2 },
- { MTYPE_EXPPS2, PROT_EXPPS2 },
- { MTYPE_THINKINGPS2, PROT_THINKPS2 },
- { MTYPE_MMANPLUSPS2, PROT_MMPS2 },
- { MTYPE_GLIDEPOINTPS2, PROT_GLIDEPS2 },
- { MTYPE_NETPS2, PROT_NETPS2 },
- { MTYPE_NETSCROLLPS2, PROT_NETSCPS2 },
- { MTYPE_BUSMOUSE, PROT_BM },
- { MTYPE_AUTOMOUSE, PROT_AUTO },
- { MTYPE_SYSMOUSE, PROT_SYSMOUSE },
- { MTYPE_UNKNOWN, PROT_UNKNOWN }
-};
-
-static int
-MapMseProtoToMisc(MouseProtocolID proto)
-{
- int i;
-
- for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++)
- if (proto == m_map[i].proto)
- return m_map[i].mtype;
-
- return MTYPE_UNKNOWN;
-}
-
-static MouseProtocolID
-MapMseMiscToProto(int proto)
-{
- int i;
-
- for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++)
- if (proto == m_map[i].mtype)
- return m_map[i].proto;
-
- return PROT_UNKNOWN;
-}
-
-Bool
-MiscExtGetMouseSettings(pointer *mouse, char **devname)
-{
- mseParamsPtr mseptr;
-
- DEBUG_P("MiscExtGetMouseSettings");
-
- mseptr = MiscExtCreateStruct(MISC_POINTER);
- if (!mseptr)
- return FALSE;
-
- {
- InputInfoPtr pInfo = mseptr->private;
- MouseDevPtr pMse;
-
- *devname = xf86FindOptionValue(pInfo->options, "Device");
- pMse = pInfo->private;
-
- mseptr->type = MapMseProtoToMisc(pMse->protocolID);
- mseptr->baudrate = pMse->baudRate;
- mseptr->samplerate = pMse->sampleRate;
- mseptr->resolution = pMse->resolution;
- mseptr->buttons = pMse->buttons;
- mseptr->em3buttons = pMse->emulate3Buttons;
- mseptr->em3timeout = pMse->emulate3Timeout;
- mseptr->chordmiddle = pMse->chordMiddle;
- mseptr->flags = pMse->mouseFlags;
- }
- *mouse = mseptr;
- return TRUE;
-}
-
-int
-MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype)
-{
- mseParamsPtr mse = mouse;
-
- DEBUG_P("MiscExtGetMouseValue");
-
- switch (valtype) {
- case MISC_MSE_PROTO: return mse->type;
- case MISC_MSE_BAUDRATE: return mse->baudrate;
- case MISC_MSE_SAMPLERATE: return mse->samplerate;
- case MISC_MSE_RESOLUTION: return mse->resolution;
- case MISC_MSE_BUTTONS: return mse->buttons;
- case MISC_MSE_EM3BUTTONS: return mse->em3buttons;
- case MISC_MSE_EM3TIMEOUT: return mse->em3timeout;
- case MISC_MSE_CHORDMIDDLE: return mse->chordmiddle;
- case MISC_MSE_FLAGS: return mse->flags;
- }
- return 0;
-}
-
-Bool
-MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value)
-{
- mseParamsPtr mse = mouse;
-
- DEBUG_P("MiscExtSetMouseValue");
-
- switch (valtype) {
- case MISC_MSE_PROTO:
- mse->type = value;
- return TRUE;
- case MISC_MSE_BAUDRATE:
- mse->baudrate = value;
- return TRUE;
- case MISC_MSE_SAMPLERATE:
- mse->samplerate = value;
- return TRUE;
- case MISC_MSE_RESOLUTION:
- mse->resolution = value;
- return TRUE;
- case MISC_MSE_BUTTONS:
- mse->buttons = value;
- return TRUE;
- case MISC_MSE_EM3BUTTONS:
- mse->em3buttons = value;
- return TRUE;
- case MISC_MSE_EM3TIMEOUT:
- mse->em3timeout = value;
- return TRUE;
- case MISC_MSE_CHORDMIDDLE:
- mse->chordmiddle = value;
- return TRUE;
- case MISC_MSE_FLAGS:
- mse->flags = value;
- return TRUE;
- }
- return FALSE;
-}
-
-Bool
-MiscExtSetMouseDevice(pointer mouse, char* device)
-{
- mseParamsPtr mse = mouse;
-
- mse->device = device;
-
- return TRUE;
-}
-
-Bool
-MiscExtGetKbdSettings(pointer *kbd)
-{
- kbdParamsPtr kbdptr;
-
- DEBUG_P("MiscExtGetKbdSettings");
-
- kbdptr = MiscExtCreateStruct(MISC_KEYBOARD);
- if (!kbdptr)
- return FALSE;
- kbdptr->type = xf86Info.kbdType;
- kbdptr->rate = xf86Info.kbdRate;
- kbdptr->delay = xf86Info.kbdDelay;
- *kbd = kbdptr;
- return TRUE;
-}
-
-int
-MiscExtGetKbdValue(pointer keyboard, MiscExtKbdValType valtype)
-{
- kbdParamsPtr kbd = keyboard;
-
- DEBUG_P("MiscExtGetKbdValue");
- switch (valtype) {
- case MISC_KBD_TYPE: return kbd->type;
- case MISC_KBD_RATE: return kbd->rate;
- case MISC_KBD_DELAY: return kbd->delay;
- case MISC_KBD_SERVNUMLOCK: return 0;
- }
- return 0;
-}
-
-Bool
-MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value)
-{
- kbdParamsPtr kbd = keyboard;
-
- DEBUG_P("MiscExtSetKbdValue");
- switch (valtype) {
- case MISC_KBD_TYPE:
- kbd->type = value;
- return TRUE;
- case MISC_KBD_RATE:
- kbd->rate = value;
- return TRUE;
- case MISC_KBD_DELAY:
- kbd->delay = value;
- return TRUE;
- case MISC_KBD_SERVNUMLOCK:
- return TRUE;
- }
- return FALSE;
-}
-
-static void
-MiscExtClientStateCallback(CallbackListPtr *callbacks,
- pointer data, pointer args)
-{
- NewClientInfoRec *clientinfo = (NewClientInfoRec*)args;
-
- if (clientinfo->client == xf86Info.grabInfo.override &&
- clientinfo->client->clientState == ClientStateGone) {
- xf86Info.grabInfo.override = NULL;
- xf86Info.grabInfo.disabled = 0;
- DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL);
- }
-}
-
-#define MiscExtGrabStateSuccess 0 /* No errors */
-#define MiscExtGrabStateLocked 1 /* A client already requested that
- * grabs cannot be removed/killed */
-#define MiscExtGrabStateAlready 2 /* Request for enabling/disabling
- * grab removeal/kill already done */
-int
-MiscExtSetGrabKeysState(ClientPtr client, int state)
-{
- DEBUG_P("MiscExtSetGrabKeysState");
-
- if (xf86Info.grabInfo.override == NULL ||
- xf86Info.grabInfo.override == client) {
- if (state == 0 && xf86Info.grabInfo.disabled == 0) {
- xf86Info.grabInfo.disabled = 1;
- AddCallback(&ClientStateCallback,
- MiscExtClientStateCallback, NULL);
- xf86Info.grabInfo.override = client;
- }
- else if (state == 1 && xf86Info.grabInfo.disabled == 1) {
- xf86Info.grabInfo.disabled = 0;
- DeleteCallback(&ClientStateCallback,
- MiscExtClientStateCallback, NULL);
- xf86Info.grabInfo.override = NULL;
- }
- else
- return MiscExtGrabStateAlready;
-
- return MiscExtGrabStateSuccess;
- }
-
- return MiscExtGrabStateLocked;
-}
-
-pointer
-MiscExtCreateStruct(MiscExtStructType mse_or_kbd)
-{
- DEBUG_P("MiscExtCreateStruct");
-
- switch (mse_or_kbd) {
- case MISC_POINTER:
- {
- mseParamsPtr mseptr;
- InputInfoPtr pInfo = xf86InputDevs;
-
- while (pInfo) {
- if (xf86IsCorePointer(pInfo->dev))
- break;
- pInfo = pInfo->next;
- }
- if (!pInfo)
- return NULL;
-
- mseptr = xcalloc(sizeof(mseParamsRec),1);
- if (mseptr)
- mseptr->private = pInfo;
- return mseptr;
- }
- case MISC_KEYBOARD:
- return xcalloc(sizeof(kbdParamsRec),1);
- }
- return 0;
-}
-
-void
-MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd)
-{
- DEBUG_P("MiscExtDestroyStruct");
-
- switch (mse_or_kbd) {
- case MISC_POINTER:
- case MISC_KEYBOARD:
- xfree(structure);
- }
-}
-
-static Bool
-MiscExtAuthorizeDevice(InputInfoPtr pInfo, char *device)
-{
- Bool authorized = FALSE;
- char *elem;
- struct stat dev, dev_list;
- const char *olddev = xf86FindOptionValue(pInfo->options, "Device");
-
- if (stat(device,&dev))
- return FALSE;
-
- if (!S_ISCHR(dev.st_mode))
- return FALSE;
-
- if (!stat(olddev,&dev_list)) {
- if (dev_list.st_dev == dev.st_dev
- && dev_list.st_ino == dev.st_ino) {
- authorized = TRUE;
- }
- }
-
- if (!authorized) {
- char *path;
-
- if (!xf86InputDeviceList
- || (path = strdup(xf86InputDeviceList)) == NULL)
- return FALSE;
-
- elem = strtok(path,",");
-
- while (elem) {
-
- if (!stat(elem,&dev_list)) {
- if (dev_list.st_dev == dev.st_dev
- && dev_list.st_ino == dev.st_ino) {
- authorized = TRUE;
- break;
-
- }
- }
- elem = strtok(NULL,",");
- }
- xfree(path);
- }
-#if 0
- ErrorF("AUTHORIZED: %s\n",authorized?"Yes":"No");
-#endif
- return (authorized);
-}
-
-MiscExtReturn
-MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
-{
- DEBUG_P("MiscExtApply");
-
- if (mse_or_kbd == MISC_POINTER) {
- Bool protoChanged = FALSE;
- int oldflags;
- Bool reopen = FALSE;
- MouseProtocolID newProtocol;
- mseParamsPtr mse = structure;
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
-#ifdef XFree86LOADER
- pointer xf86MouseProtocolIDToName
- = LoaderSymbol("xf86MouseProtocolIDToName");
- if (!xf86MouseProtocolIDToName)
- return MISC_RET_NOMODULE;
-#endif
- if (mse->type < MTYPE_MICROSOFT
- || ( mse->type > MTYPE_EXPPS2
- && (mse->type!=MTYPE_OSMOUSE && mse->type!=MTYPE_XQUEUE)))
- return MISC_RET_BADMSEPROTO;
-#ifdef OSMOUSE_ONLY
- if (mse->type != MTYPE_OSMOUSE)
- return MISC_RET_BADMSEPROTO;
-#else
- if (mse->type == MTYPE_XQUEUE)
- return MISC_RET_BADMSEPROTO;
- if (mse->type == MTYPE_OSMOUSE)
- return MISC_RET_BADMSEPROTO;
-#endif /* OSMOUSE_ONLY */
-
- if (mse->em3timeout < 0)
- return MISC_RET_BADVAL;
-
- if (mse->type == MTYPE_LOGIMAN
- && !(mse->baudrate == 0
- || mse->baudrate == 1200
- || mse->baudrate == 9600))
- return MISC_RET_BADBAUDRATE;
- if (mse->type == MTYPE_LOGIMAN && mse->samplerate)
- return MISC_RET_BADCOMBO;
-
- if (mse->flags & MF_REOPEN) {
- reopen = TRUE;
- mse->flags &= ~MF_REOPEN;
- }
- if (mse->type != MTYPE_OSMOUSE
- && mse->type != MTYPE_XQUEUE
- && mse->type != MTYPE_PS_2
- && mse->type != MTYPE_BUSMOUSE
- && mse->type != MTYPE_IMPS2
- && mse->type != MTYPE_THINKINGPS2
- && mse->type != MTYPE_MMANPLUSPS2
- && mse->type != MTYPE_GLIDEPOINTPS2
- && mse->type != MTYPE_NETPS2
- && mse->type != MTYPE_NETSCROLLPS2
- && mse->type != MTYPE_SYSMOUSE)
- {
- if (mse->baudrate % 1200 != 0
- || (mse->baudrate != 0 && mse->baudrate < 1200)
- || mse->baudrate > 9600)
- return MISC_RET_BADBAUDRATE;
- }
- if ((mse->flags & (MF_CLEAR_DTR|MF_CLEAR_RTS))
- && (mse->type != MTYPE_MOUSESYS))
- return MISC_RET_BADFLAGS;
-
- if (mse->type != MTYPE_OSMOUSE
- && mse->type != MTYPE_XQUEUE
- && mse->type != MTYPE_BUSMOUSE)
- {
- if (mse->samplerate < 0)
- return MISC_RET_BADVAL;
- }
-
- if (mse->resolution < 0)
- return MISC_RET_BADVAL;
- if (mse->chordmiddle)
- {
- if (mse->em3buttons || !(mse->type == MTYPE_MICROSOFT
- || mse->type == MTYPE_LOGIMAN) )
- return MISC_RET_BADCOMBO;
- }
-
- /* XXX - This still needs work */
-
- pInfo = mse->private;
- pMse = pInfo->private;
- oldflags = pMse->mouseFlags;
-
- newProtocol = MapMseMiscToProto(mse->type);
- protoChanged = pMse->protocolID != newProtocol;
- if (protoChanged
- || pMse->baudRate != mse->baudrate
- || pMse->sampleRate != mse->samplerate
- || pMse->resolution != mse->resolution
- || pMse->mouseFlags != mse->flags)
- reopen = TRUE;
-
- if (mse->device)
- reopen = TRUE;
-
- if (reopen)
- (pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE);
-
- pMse->protocolID = newProtocol;
- pMse->baudRate = mse->baudrate;
- pMse->sampleRate = mse->samplerate;
- pMse->resolution = mse->resolution;
- pMse->buttons = mse->buttons;
- pMse->emulate3Buttons = mse->em3buttons;
- pMse->emulate3Timeout = mse->em3timeout;
- pMse->chordMiddle = mse->chordmiddle;
- pMse->mouseFlags = mse->flags;
-
-#ifdef XFree86LOADER
- pMse->protocol = ((const char *(*)(MouseProtocolID))
- xf86MouseProtocolIDToName)(pMse->protocolID);
-#else
- pMse->protocol = xf86MouseProtocolIDToName(pMse->protocolID);
-#endif
-
- if (mse->device) {
- if (MiscExtAuthorizeDevice(pInfo, mse->device)) {
- xf86ReplaceStrOption(pInfo->options, "Device", mse->device);
- } else {
- return MISC_RET_BADVAL;
- }
- }
-
- if (reopen) {
- /* Only if protocol is changed explicitely disable auto detect */
- if (protoChanged)
- pMse->autoProbe = FALSE;
- (pMse->device->deviceProc)(pMse->device, DEVICE_ON);
- }
- /* Set pInfo->options too */
-
- if ((oldflags & MF_CLEAR_DTR) != (pMse->mouseFlags & MF_CLEAR_DTR))
- xf86ReplaceBoolOption(pInfo->options, "ClearDTR",
- pMse->mouseFlags | MF_CLEAR_DTR);
- if ((oldflags & MF_CLEAR_RTS) != (pMse->mouseFlags & MF_CLEAR_RTS))
- xf86ReplaceBoolOption(pInfo->options, "ClearRTS",
- pMse->mouseFlags | MF_CLEAR_RTS);
- }
- if (mse_or_kbd == MISC_KEYBOARD) {
- kbdParamsPtr kbd = structure;
-
- if (kbd->rate < 0)
- return MISC_RET_BADVAL;
- if (kbd->delay < 0)
- return MISC_RET_BADVAL;
- if (kbd->type < KTYPE_UNKNOWN || kbd->type > KTYPE_XQUEUE)
- return MISC_RET_BADKBDTYPE;
-
- if (xf86Info.kbdRate!=kbd->rate || xf86Info.kbdDelay!=kbd->delay) {
- char rad;
-
- xf86Info.kbdRate = kbd->rate;
- xf86Info.kbdDelay = kbd->delay;
- if (xf86Info.kbdDelay <= 375) rad = 0x00;
- else if (xf86Info.kbdDelay <= 625) rad = 0x20;
- else if (xf86Info.kbdDelay <= 875) rad = 0x40;
- else rad = 0x60;
-
- if (xf86Info.kbdRate <= 2) rad |= 0x1F;
- else if (xf86Info.kbdRate >= 30) rad |= 0x00;
- else rad |= ((58/xf86Info.kbdRate)-2);
-
- xf86SetKbdRepeat(rad);
- }
-#if 0 /* Not done yet */
- xf86Info.kbdType = kbd->kbdtype;
-#endif
- }
- return MISC_RET_SUCCESS;
-}
-
-Bool
-MiscExtGetFilePaths(const char **configfile, const char **modulepath,
- const char **logfile)
-{
- DEBUG_P("MiscExtGetFilePaths");
-
- *configfile = xf86ConfigFile;
- *modulepath = xf86ModulePath;
- *logfile = xf86LogFile;
-
- return TRUE;
-}
-
-int
-MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval,
- char **retstr)
-{
- ScrnInfoPtr pScr = xf86Screens[scrnIndex];
-
- DEBUG_P("MiscExtPassMessage");
-
- if (*pScr->HandleMessage == NULL)
- return BadImplementation;
- return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);
-}
-
-#endif /* XF86MISC */
-
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
deleted file mode 100644
index fd2ff4a22..000000000
--- a/hw/xfree86/common/xf86Mode.c
+++ /dev/null
@@ -1,2176 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Authors: Dirk Hohndel <hohndel@XFree86.Org>
- * David Dawes <dawes@XFree86.Org>
- * Marc La France <tsi@XFree86.Org>
- * ... and others
- *
- * This file includes helper functions for mode related things.
- */
-
-#include "X.h"
-#include "os.h"
-#include "servermd.h"
-#include "mibank.h"
-#include "globals.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86DDC.h"
-
-/*
- * xf86GetNearestClock --
- * Find closest clock to given frequency (in kHz). This assumes the
- * number of clocks is greater than zero.
- */
-int
-xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
- int DivFactor, int MulFactor, int *divider)
-{
- int nearestClock = 0, nearestDiv = 1;
- int minimumGap = abs(freq - scrp->clock[0]);
- int i, j, k, gap;
-
- if (allowDiv2)
- k = 2;
- else
- k = 1;
-
- /* Must set this here in case the best match is scrp->clock[0] */
- if (divider != NULL)
- *divider = 0;
-
- for (i = 0; i < scrp->numClocks; i++) {
- for (j = 1; j <= k; j++) {
- gap = abs((freq * j) - ((scrp->clock[i] * DivFactor) / MulFactor));
- if ((gap < minimumGap) ||
- ((gap == minimumGap) && (j < nearestDiv))) {
- minimumGap = gap;
- nearestClock = i;
- nearestDiv = j;
- if (divider != NULL)
- *divider = (j - 1) * V_CLKDIV2;
- }
- }
- }
- return nearestClock;
-}
-
-/*
- * xf86ModeStatusToString
- *
- * Convert a ModeStatus value to a printable message
- */
-
-const char *
-xf86ModeStatusToString(ModeStatus status)
-{
- switch (status) {
- case MODE_OK:
- return "Mode OK";
- case MODE_HSYNC:
- return "hsync out of range";
- case MODE_VSYNC:
- return "vrefresh out of range";
- case MODE_H_ILLEGAL:
- return "illegal horizontal timings";
- case MODE_V_ILLEGAL:
- return "illegal vertical timings";
- case MODE_BAD_WIDTH:
- return "width requires unsupported line pitch";
- case MODE_NOMODE:
- return "no mode of this name";
- case MODE_NO_INTERLACE:
- return "interlace mode not supported";
- case MODE_NO_DBLESCAN:
- return "doublescan mode not supported";
- case MODE_NO_VSCAN:
- return "multiscan mode not supported";
- case MODE_MEM:
- return "insufficient memory for mode";
- case MODE_VIRTUAL_X:
- return "width too large for virtual size";
- case MODE_VIRTUAL_Y:
- return "height too large for virtual size";
- case MODE_MEM_VIRT:
- return "insufficient memory given virtual size";
- case MODE_NOCLOCK:
- return "no clock available for mode";
- case MODE_CLOCK_HIGH:
- return "mode clock too high";
- case MODE_CLOCK_LOW:
- return "mode clock too low";
- case MODE_CLOCK_RANGE:
- return "bad mode clock/interlace/doublescan";
- case MODE_BAD_HVALUE:
- return "horizontal timing out of range";
- case MODE_BAD_VVALUE:
- return "vertical timing out of range";
- case MODE_BAD_VSCAN:
- return "VScan value out of range";
- case MODE_HSYNC_NARROW:
- return "horizontal sync too narrow";
- case MODE_HSYNC_WIDE:
- return "horizontal sync too wide";
- case MODE_HBLANK_NARROW:
- return "horizontal blanking too narrow";
- case MODE_HBLANK_WIDE:
- return "horizontal blanking too wide";
- case MODE_VSYNC_NARROW:
- return "vertical sync too narrow";
- case MODE_VSYNC_WIDE:
- return "vertical sync too wide";
- case MODE_VBLANK_NARROW:
- return "vertical blanking too narrow";
- case MODE_VBLANK_WIDE:
- return "vertical blanking too wide";
- case MODE_PANEL:
- return "exceeds panel dimensions";
- case MODE_INTERLACE_WIDTH:
- return "width too large for interlaced mode";
- case MODE_ONE_WIDTH:
- return "all modes must have the same width";
- case MODE_ONE_HEIGHT:
- return "all modes must have the same height";
- case MODE_ONE_SIZE:
- return "all modes must have the same resolution";
- case MODE_BAD:
- return "unknown reason";
- case MODE_ERROR:
- return "internal error";
- default:
- return "unknown";
- }
-}
-
-/*
- * xf86ShowClockRanges() -- Print the clock ranges allowed
- * and the clock values scaled by ClockMulFactor and ClockDivFactor
- */
-void
-xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges)
-{
- ClockRangePtr cp;
- int MulFactor = 1;
- int DivFactor = 1;
- int i, j;
- int scaledClock;
-
- for (cp = clockRanges; cp != NULL; cp = cp->next) {
- DivFactor = max(1, cp->ClockDivFactor);
- MulFactor = max(1, cp->ClockMulFactor);
- if (scrp->progClock) {
- if (cp->minClock) {
- if (cp->maxClock) {
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Clock range: %6.2f to %6.2f MHz\n",
- (double)cp->minClock / 1000.0,
- (double)cp->maxClock / 1000.0);
- } else {
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Minimum clock: %6.2f MHz\n",
- (double)cp->minClock / 1000.0);
- }
- } else {
- if (cp->maxClock) {
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Maximum clock: %6.2f MHz\n",
- (double)cp->maxClock / 1000.0);
- }
- }
- } else if (DivFactor > 1 || MulFactor > 1) {
- j = 0;
- for (i = 0; i < scrp->numClocks; i++) {
- scaledClock = (scrp->clock[i] * DivFactor) / MulFactor;
- if (scaledClock >= cp->minClock && scaledClock <= cp->maxClock) {
- if ((j % 8) == 0) {
- if (j > 0)
- xf86ErrorF("\n");
- xf86DrvMsg(scrp->scrnIndex, X_INFO, "scaled clocks:");
- }
- xf86ErrorF(" %6.2f", (double)scaledClock / 1000.0);
- j++;
- }
- }
- xf86ErrorF("\n");
- }
- }
-}
-
-
-/*
- * xf86FindClockRangeForMode() [... like the name says ...]
- */
-static ClockRangePtr
-xf86FindClockRangeForMode(ClockRangePtr clockRanges, DisplayModePtr p)
-{
- ClockRangePtr cp;
-
- for (cp = clockRanges; ; cp = cp->next)
- if (!cp ||
- ((p->Clock >= cp->minClock) &&
- (p->Clock <= cp->maxClock) &&
- (cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((p->VScan <= 1) && !(p->Flags & V_DBLSCAN)))))
- return cp;
-}
-
-
-/*
- * xf86HandleBuiltinMode() - handles built-in modes
- */
-static ModeStatus
-xf86HandleBuiltinMode(ScrnInfoPtr scrp,
- DisplayModePtr p,
- DisplayModePtr modep,
- ClockRangePtr clockRanges,
- Bool allowDiv2)
-{
- ClockRangePtr cp;
- int extraFlags = 0;
- int MulFactor = 1;
- int DivFactor = 1;
- int clockIndex;
-
- /* Reject previously rejected modes */
- if (p->status != MODE_OK)
- return p->status;
-
- /* Reject previously considered modes */
- if (p->prev)
- return MODE_NOMODE;
-
- if ((p->type & M_T_CLOCK_C) == M_T_CLOCK_C) {
- /* Check clock is in range */
- cp = xf86FindClockRangeForMode(clockRanges, p);
- if (cp == NULL){
- modep->type = p->type;
- p->status = MODE_CLOCK_RANGE;
- return MODE_CLOCK_RANGE;
- }
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- if (!scrp->progClock) {
- clockIndex = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
- cp->ClockDivFactor,
- cp->ClockMulFactor, &extraFlags);
- modep->Clock = (scrp->clock[clockIndex] * DivFactor)
- / MulFactor;
- modep->ClockIndex = clockIndex;
- modep->SynthClock = scrp->clock[clockIndex];
- if (extraFlags & V_CLKDIV2) {
- modep->Clock /= 2;
- modep->SynthClock /= 2;
- }
- } else {
- modep->Clock = p->Clock;
- modep->ClockIndex = -1;
- modep->SynthClock = (modep->Clock * MulFactor)
- / DivFactor;
- }
- modep->PrivFlags = cp->PrivFlags;
- } else {
- if(!scrp->progClock) {
- modep->Clock = p->Clock;
- modep->ClockIndex = p->ClockIndex;
- modep->SynthClock = p->SynthClock;
- } else {
- modep->Clock = p->Clock;
- modep->ClockIndex = -1;
- modep->SynthClock = p->SynthClock;
- }
- modep->PrivFlags = p->PrivFlags;
- }
- modep->type = p->type;
- modep->HDisplay = p->HDisplay;
- modep->HSyncStart = p->HSyncStart;
- modep->HSyncEnd = p->HSyncEnd;
- modep->HTotal = p->HTotal;
- modep->HSkew = p->HSkew;
- modep->VDisplay = p->VDisplay;
- modep->VSyncStart = p->VSyncStart;
- modep->VSyncEnd = p->VSyncEnd;
- modep->VTotal = p->VTotal;
- modep->VScan = p->VScan;
- modep->Flags = p->Flags | extraFlags;
- modep->CrtcHDisplay = p->CrtcHDisplay;
- modep->CrtcHBlankStart = p->CrtcHBlankStart;
- modep->CrtcHSyncStart = p->CrtcHSyncStart;
- modep->CrtcHSyncEnd = p->CrtcHSyncEnd;
- modep->CrtcHBlankEnd = p->CrtcHBlankEnd;
- modep->CrtcHTotal = p->CrtcHTotal;
- modep->CrtcHSkew = p->CrtcHSkew;
- modep->CrtcVDisplay = p->CrtcVDisplay;
- modep->CrtcVBlankStart = p->CrtcVBlankStart;
- modep->CrtcVSyncStart = p->CrtcVSyncStart;
- modep->CrtcVSyncEnd = p->CrtcVSyncEnd;
- modep->CrtcVBlankEnd = p->CrtcVBlankEnd;
- modep->CrtcVTotal = p->CrtcVTotal;
- modep->CrtcHAdjusted = p->CrtcHAdjusted;
- modep->CrtcVAdjusted = p->CrtcVAdjusted;
- modep->HSync = p->HSync;
- modep->VRefresh = p->VRefresh;
- modep->Private = p->Private;
- modep->PrivSize = p->PrivSize;
-
- p->prev = modep;
-
- return MODE_OK;
-}
-
-static double
-ModeVRefresh(DisplayModePtr mode)
-{
- double refresh = 0.0;
-
- if (mode->VRefresh > 0.0)
- refresh = mode->VRefresh;
- else if (mode->HTotal > 0 && mode->VTotal > 0) {
- refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal;
- if (mode->Flags & V_INTERLACE)
- refresh *= 2.0;
- if (mode->Flags & V_DBLSCAN)
- refresh /= 2.0;
- if (mode->VScan > 1)
- refresh /= mode->VScan;
- }
- return refresh;
-}
-
-/*
- * xf86LookupMode
- *
- * This function returns a mode from the given list which matches the
- * given name. When multiple modes with the same name are available,
- * the method of picking the matching mode is determined by the
- * strategy selected.
- *
- * This function takes the following parameters:
- * scrp ScrnInfoPtr
- * modep pointer to the returned mode, which must have the name
- * field filled in.
- * clockRanges a list of clock ranges. This is optional when all the
- * modes are built-in modes.
- * strategy how to decide which mode to use from multiple modes with
- * the same name
- *
- * In addition, the following fields from the ScrnInfoRec are used:
- * modePool the list of monitor modes compatible with the driver
- * clocks a list of discrete clocks
- * numClocks number of discrete clocks
- * progClock clock is programmable
- *
- * If a mode was found, its values are filled in to the area pointed to
- * by modep, If a mode was not found the return value indicates the
- * reason.
- */
-
-ModeStatus
-xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
- ClockRangePtr clockRanges, LookupModeFlags strategy)
-{
- DisplayModePtr p, bestMode = NULL;
- ClockRangePtr cp;
- int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1;
- double refresh, bestRefresh = 0.0;
- Bool found = FALSE;
- int extraFlags = 0;
- int clockIndex = -1;
- int MulFactor = 1;
- int DivFactor = 1;
- int ModePrivFlags = 0;
- ModeStatus status = MODE_NOMODE;
- Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0;
- Bool haveBuiltin;
-
- strategy &= ~(LOOKUP_CLKDIV2 | LOOKUP_OPTIONAL_TOLERANCES);
-
- /* Some sanity checking */
- if (scrp == NULL || scrp->modePool == NULL ||
- (!scrp->progClock && scrp->numClocks == 0)) {
- ErrorF("xf86LookupMode: called with invalid scrnInfoRec\n");
- return MODE_ERROR;
- }
- if (modep == NULL || modep->name == NULL) {
- ErrorF("xf86LookupMode: called with invalid modep\n");
- return MODE_ERROR;
- }
- for (cp = clockRanges; cp != NULL; cp = cp->next) {
- /* DivFactor and MulFactor must be > 0 */
- cp->ClockDivFactor = max(1, cp->ClockDivFactor);
- cp->ClockMulFactor = max(1, cp->ClockMulFactor);
- }
-
- haveBuiltin = FALSE;
- /* Scan the mode pool for matching names */
- for (p = scrp->modePool; p != NULL; p = p->next) {
- if (strcmp(p->name, modep->name) == 0) {
- /*
- * Requested mode is a built-in mode. Don't let the user
- * override it.
- * Since built-in modes always come before user specified
- * modes it will always be found first.
- */
- if (p->type & M_T_BUILTIN) {
- haveBuiltin = TRUE;
- }
-
- if (haveBuiltin && !(p->type & M_T_BUILTIN))
- continue;
-
- /* Skip over previously rejected modes */
- if (p->status != MODE_OK) {
- if (!found)
- status = p->status;
- continue;
- }
-
- /* Skip over previously considered modes */
- if (p->prev)
- continue;
-
- if (p->type & M_T_BUILTIN) {
- return xf86HandleBuiltinMode(scrp, p,modep, clockRanges,
- allowDiv2);
- }
-
- /* Check clock is in range */
- cp = xf86FindClockRangeForMode(clockRanges, p);
- if (cp == NULL) {
- /*
- * XXX Could do more here to provide a more detailed
- * reason for not finding a mode.
- */
- p->status = MODE_CLOCK_RANGE;
- if (!found)
- status = MODE_CLOCK_RANGE;
- continue;
- }
-
- /*
- * If programmable clock and strategy is not LOOKUP_BEST_REFRESH,
- * the required mode has been found, otherwise record the refresh
- * and continue looking.
- */
- if (scrp->progClock) {
- found = TRUE;
- if (strategy != LOOKUP_BEST_REFRESH) {
- bestMode = p;
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- break;
- }
- refresh = ModeVRefresh(p);
- if (p->Flags & V_INTERLACE)
- refresh /= INTERLACE_REFRESH_WEIGHT;
- if (refresh > bestRefresh) {
- bestMode = p;
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- bestRefresh = refresh;
- }
- continue;
- }
-
- /*
- * Clock is in range, so if it is not a programmable clock, find
- * a matching clock.
- */
-
- i = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
- cp->ClockDivFactor, cp->ClockMulFactor, &k);
- /*
- * If the clock is too far from the requested clock, this
- * mode is no good.
- */
- if (k & V_CLKDIV2)
- gap = abs((p->Clock * 2) -
- ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor));
- else
- gap = abs(p->Clock -
- ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor));
- if (gap > minimumGap) {
- p->status = MODE_NOCLOCK;
- if (!found)
- status = MODE_NOCLOCK;
- continue;
- }
- found = TRUE;
-
- if (strategy == LOOKUP_BEST_REFRESH) {
- refresh = ModeVRefresh(p);
- if (p->Flags & V_INTERLACE)
- refresh /= INTERLACE_REFRESH_WEIGHT;
- if (refresh > bestRefresh) {
- bestMode = p;
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- extraFlags = k;
- clockIndex = i;
- bestRefresh = refresh;
- }
- continue;
- }
- if (strategy == LOOKUP_CLOSEST_CLOCK) {
- if (gap < minimumGap) {
- bestMode = p;
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- extraFlags = k;
- clockIndex = i;
- minimumGap = gap;
- }
- continue;
- }
- /*
- * If strategy is neither LOOKUP_BEST_REFRESH or
- * LOOKUP_CLOSEST_CLOCK the required mode has been found.
- */
- bestMode = p;
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- extraFlags = k;
- clockIndex = i;
- break;
- }
- }
- if (!found || bestMode == NULL)
- return status;
-
- /* Fill in the mode parameters */
- if (scrp->progClock) {
- modep->Clock = bestMode->Clock;
- modep->ClockIndex = -1;
- modep->SynthClock = (modep->Clock * MulFactor) / DivFactor;
- } else {
- modep->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
- modep->ClockIndex = clockIndex;
- modep->SynthClock = scrp->clock[clockIndex];
- if (extraFlags & V_CLKDIV2) {
- modep->Clock /= 2;
- modep->SynthClock /= 2;
- }
- }
- modep->type = bestMode->type;
- modep->PrivFlags = ModePrivFlags;
- modep->HDisplay = bestMode->HDisplay;
- modep->HSyncStart = bestMode->HSyncStart;
- modep->HSyncEnd = bestMode->HSyncEnd;
- modep->HTotal = bestMode->HTotal;
- modep->HSkew = bestMode->HSkew;
- modep->VDisplay = bestMode->VDisplay;
- modep->VSyncStart = bestMode->VSyncStart;
- modep->VSyncEnd = bestMode->VSyncEnd;
- modep->VTotal = bestMode->VTotal;
- modep->VScan = bestMode->VScan;
- modep->Flags = bestMode->Flags | extraFlags;
- modep->CrtcHDisplay = bestMode->CrtcHDisplay;
- modep->CrtcHBlankStart = bestMode->CrtcHBlankStart;
- modep->CrtcHSyncStart = bestMode->CrtcHSyncStart;
- modep->CrtcHSyncEnd = bestMode->CrtcHSyncEnd;
- modep->CrtcHBlankEnd = bestMode->CrtcHBlankEnd;
- modep->CrtcHTotal = bestMode->CrtcHTotal;
- modep->CrtcHSkew = bestMode->CrtcHSkew;
- modep->CrtcVDisplay = bestMode->CrtcVDisplay;
- modep->CrtcVBlankStart = bestMode->CrtcVBlankStart;
- modep->CrtcVSyncStart = bestMode->CrtcVSyncStart;
- modep->CrtcVSyncEnd = bestMode->CrtcVSyncEnd;
- modep->CrtcVBlankEnd = bestMode->CrtcVBlankEnd;
- modep->CrtcVTotal = bestMode->CrtcVTotal;
- modep->CrtcHAdjusted = bestMode->CrtcHAdjusted;
- modep->CrtcVAdjusted = bestMode->CrtcVAdjusted;
- modep->HSync = bestMode->HSync;
- modep->VRefresh = bestMode->VRefresh;
- modep->Private = bestMode->Private;
- modep->PrivSize = bestMode->PrivSize;
-
- bestMode->prev = modep;
-
- return MODE_OK;
-}
-
-
-/*
- * xf86SetModeCrtc
- *
- * Initialises the Crtc parameters for a mode. The initialisation includes
- * adjustments for interlaced and double scan modes.
- */
-static void
-xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
-{
- if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN))
- return;
-
- p->CrtcHDisplay = p->HDisplay;
- p->CrtcHSyncStart = p->HSyncStart;
- p->CrtcHSyncEnd = p->HSyncEnd;
- p->CrtcHTotal = p->HTotal;
- p->CrtcHSkew = p->HSkew;
- p->CrtcVDisplay = p->VDisplay;
- p->CrtcVSyncStart = p->VSyncStart;
- p->CrtcVSyncEnd = p->VSyncEnd;
- p->CrtcVTotal = p->VTotal;
- if ((p->Flags & V_INTERLACE) && (adjustFlags & INTERLACE_HALVE_V))
- {
- p->CrtcVDisplay /= 2;
- p->CrtcVSyncStart /= 2;
- p->CrtcVSyncEnd /= 2;
- p->CrtcVTotal /= 2;
- }
- if (p->Flags & V_DBLSCAN) {
- p->CrtcVDisplay *= 2;
- p->CrtcVSyncStart *= 2;
- p->CrtcVSyncEnd *= 2;
- p->CrtcVTotal *= 2;
- }
- if (p->VScan > 1) {
- p->CrtcVDisplay *= p->VScan;
- p->CrtcVSyncStart *= p->VScan;
- p->CrtcVSyncEnd *= p->VScan;
- p->CrtcVTotal *= p->VScan;
- }
- p->CrtcHAdjusted = FALSE;
- p->CrtcVAdjusted = FALSE;
-
- /*
- * XXX
- *
- * The following is taken from VGA, but applies to other cores as well.
- */
- p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
- p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
- if ((p->CrtcVBlankEnd - p->CrtcVBlankStart) >= 127) {
- /*
- * V Blanking size must be < 127.
- * Moving blank start forward is safer than moving blank end
- * back, since monitors clamp just AFTER the sync pulse (or in
- * the sync pulse), but never before.
- */
- p->CrtcVBlankStart = p->CrtcVBlankEnd - 127;
- }
- p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
- p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
- if ((p->CrtcHBlankEnd - p->CrtcHBlankStart) >= 63 * 8) {
- /*
- * H Blanking size must be < 63*8. Same remark as above.
- */
- p->CrtcHBlankStart = p->CrtcHBlankEnd - 63 * 8;
- }
-}
-
-/*
- * xf86CheckModeForMonitor
- *
- * This function takes a mode and monitor description, and determines
- * if the mode is valid for the monitor.
- */
-ModeStatus
-xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor)
-{
- int i;
- float hsync, vrefresh;
-
- /* Sanity checks */
- if (mode == NULL || monitor == NULL) {
- ErrorF("xf86CheckModeForMonitor: called with invalid parameters\n");
- return MODE_ERROR;
- }
-
-#ifdef DEBUG
- ErrorF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
- mode, mode->name, monitor, monitor->id);
-#endif
-
- if (monitor->DDC) {
- xf86MonPtr DDC = (xf86MonPtr)(monitor->DDC);
- struct detailed_monitor_section* detMon;
- struct monitor_ranges *mon_range;
- int i;
-
- mon_range = NULL;
- for (i = 0; i < 4; i++) {
- detMon = &DDC->det_mon[i];
- if(detMon->type == DS_RANGES) {
- mon_range = &detMon->section.ranges;
- }
- }
- if (mon_range) {
- /* mode->Clock in kHz, DDC in MHz */
- if (mon_range->max_clock < 2550 &&
- mode->Clock / 1000.0 > mon_range->max_clock) {
- xf86Msg(X_WARNING,
- "(%s,%s) mode clock %gMHz exceeds DDC maximum %dMHz\n",
- mode->name, monitor->id,
- mode->Clock/1000.0, mon_range->max_clock);
- }
- }
- }
-
- /* Some basic mode validity checks */
- if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
- mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal)
- return MODE_H_ILLEGAL;
-
- if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart ||
- mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal)
- return MODE_V_ILLEGAL;
-
- if (monitor->nHsync > 0) {
- /* Check hsync against the allowed ranges */
- hsync = (float)mode->Clock / (float)mode->HTotal;
- for (i = 0; i < monitor->nHsync; i++)
- if ((hsync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) &&
- (hsync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE)))
- break;
-
- /* Now see whether we ran out of sync ranges without finding a match */
- if (i == monitor->nHsync)
- return MODE_HSYNC;
- }
-
- if (monitor->nVrefresh > 0) {
- /* Check vrefresh against the allowed ranges */
- vrefresh = mode->Clock * 1000.0 / (mode->HTotal * mode->VTotal);
- if (mode->Flags & V_INTERLACE)
- vrefresh *= 2.0;
- if (mode->Flags & V_DBLSCAN)
- vrefresh /= 2.0;
- if (mode->VScan > 1)
- vrefresh /= (float)(mode->VScan);
- for (i = 0; i < monitor->nVrefresh; i++)
- if ((vrefresh > monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) &&
- (vrefresh < monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE)))
- break;
-
- /* Now see whether we ran out of refresh ranges without finding a match */
- if (i == monitor->nVrefresh)
- return MODE_VSYNC;
- }
-
- /* Force interlaced modes to have an odd VTotal */
- if (mode->Flags & V_INTERLACE)
- mode->CrtcVTotal = mode->VTotal |= 1;
-
- return MODE_OK;
-}
-
-/*
- * xf86CheckModeSize
- *
- * An internal routine to check if a mode fits in video memory. This tries to
- * avoid overflows that would otherwise occur when video memory size is greater
- * than 256MB.
- */
-static Bool
-xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
-{
- int bpp = scrp->fbFormat.bitsPerPixel,
- pad = scrp->fbFormat.scanlinePad;
- int lineWidth, lastWidth;
-
- if (scrp->depth == 4)
- pad *= 4; /* 4 planes */
-
- /* Sanity check */
- if ((w < 0) || (x < 0) || (y <= 0))
- return FALSE;
-
- lineWidth = (((w * bpp) + pad - 1) / pad) * pad;
- lastWidth = x * bpp;
-
- /*
- * At this point, we need to compare
- *
- * (lineWidth * (y - 1)) + lastWidth
- *
- * against
- *
- * scrp->videoRam * (1024 * 8)
- *
- * These are bit quantities. To avoid overflows, do the comparison in
- * terms of BITMAP_SCANLINE_PAD units. This assumes BITMAP_SCANLINE_PAD
- * is a power of 2. We currently use 32, which limits us to a video
- * memory size of 8GB.
- */
-
- lineWidth = (lineWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
- lastWidth = (lastWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
-
- if ((lineWidth * (y - 1) + lastWidth) >
- (scrp->videoRam * ((1024 * 8) / BITMAP_SCANLINE_PAD)))
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * xf86InitialCheckModeForDriver
- *
- * This function checks if a mode satisfies a driver's initial requirements:
- * - mode size fits within the available pixel area (memory)
- * - width lies within the range of supported line pitches
- * - mode size fits within virtual size (if fixed)
- * - horizontal timings are in range
- *
- * This function takes the following parameters:
- * scrp ScrnInfoPtr
- * mode mode to check
- * maxPitch (optional) maximum line pitch
- * virtualX (optional) virtual width requested
- * virtualY (optional) virtual height requested
- *
- * In addition, the following fields from the ScrnInfoRec are used:
- * monitor pointer to structure for monitor section
- * fbFormat pixel format for the framebuffer
- * videoRam video memory size (in kB)
- * maxHValue maximum horizontal timing value
- * maxVValue maximum vertical timing value
- */
-
-ModeStatus
-xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
- ClockRangePtr clockRanges,
- LookupModeFlags strategy,
- int maxPitch, int virtualX, int virtualY)
-{
- MonPtr monitor;
- ClockRangePtr cp;
- ModeStatus status;
- Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0;
- int i, needDiv2;
-
- /* Sanity checks */
- if (!scrp || !mode || !clockRanges) {
- ErrorF("xf86InitialCheckModeForDriver: "
- "called with invalid parameters\n");
- return MODE_ERROR;
- }
-
-#ifdef DEBUG
- ErrorF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
- scrp, mode, mode->name , clockRanges, strategy, maxPitch, virtualX, virtualY);
-#endif
-
- /* Some basic mode validity checks */
- if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
- mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal)
- return MODE_H_ILLEGAL;
-
- if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart ||
- mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal)
- return MODE_V_ILLEGAL;
-
- if (!xf86CheckModeSize(scrp, mode->HDisplay, mode->HDisplay,
- mode->VDisplay))
- return MODE_MEM;
-
- if (maxPitch > 0 && mode->HDisplay > maxPitch)
- return MODE_BAD_WIDTH;
-
- if (virtualX > 0 && mode->HDisplay > virtualX)
- return MODE_VIRTUAL_X;
-
- if (virtualY > 0 && mode->VDisplay > virtualY)
- return MODE_VIRTUAL_Y;
-
- if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue)
- return MODE_BAD_HVALUE;
-
- if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue)
- return MODE_BAD_VVALUE;
-
- /*
- * The use of the DisplayModeRec's Crtc* and SynthClock elements below is
- * provisional, in that they are later reused by the driver at mode-set
- * time. Here, they are temporarily enlisted to contain the mode timings
- * as seen by the CRT or panel (rather than the CRTC). The driver's
- * ValidMode() is allowed to modify these so it can deal with such things
- * as mode stretching and/or centering. The driver should >NOT< modify the
- * user-supplied values as these are reported back when mode validation is
- * said and done.
- */
- xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
-
- cp = xf86FindClockRangeForMode(clockRanges, mode);
- if (!cp)
- return MODE_CLOCK_RANGE;
-
- if (cp->ClockMulFactor < 1)
- cp->ClockMulFactor = 1;
- if (cp->ClockDivFactor < 1)
- cp->ClockDivFactor = 1;
-
- /*
- * XXX The effect of clock dividers and multipliers on the monitor's
- * pixel clock needs to be verified.
- */
- if (scrp->progClock) {
- mode->SynthClock = mode->Clock;
- } else {
- i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2,
- cp->ClockDivFactor, cp->ClockMulFactor,
- &needDiv2);
- mode->SynthClock = (scrp->clock[i] * cp->ClockDivFactor) /
- cp->ClockMulFactor;
- if (needDiv2 & V_CLKDIV2)
- mode->SynthClock /= 2;
- }
-
- if (scrp->ValidMode) {
- status = (*scrp->ValidMode)(scrp->scrnIndex, mode, FALSE,
- MODECHECK_INITIAL);
- if (status != MODE_OK)
- return status;
- }
-
- if (!(monitor = scrp->monitor)) {
- ErrorF("xf86InitialCheckModeForDriver: "
- "called with invalid monitor\n");
- return MODE_ERROR;
- }
-
- if (mode->HSync <= 0.0)
- mode->HSync = (float)mode->SynthClock / (float)mode->CrtcHTotal;
- if (monitor->nHsync > 0) {
- /* Check hsync against the allowed ranges */
- for (i = 0; i < monitor->nHsync; i++)
- if ((mode->HSync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) &&
- (mode->HSync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE)))
- break;
-
- /* Now see whether we ran out of sync ranges without finding a match */
- if (i == monitor->nHsync)
- return MODE_HSYNC;
- }
-
- if (mode->VRefresh <= 0.0)
- mode->VRefresh = (mode->SynthClock * 1000.0) /
- (mode->CrtcHTotal * mode->CrtcVTotal);
- if (monitor->nVrefresh > 0) {
- /* Check vrefresh against the allowed ranges */
- for (i = 0; i < monitor->nVrefresh; i++)
- if ((mode->VRefresh >
- monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) &&
- (mode->VRefresh <
- monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE)))
- break;
-
- /* Now see whether we ran out of refresh ranges without finding a match */
- if (i == monitor->nVrefresh)
- return MODE_VSYNC;
- }
-
- /* Force interlaced modes to have an odd VTotal */
- if (mode->Flags & V_INTERLACE)
- mode->CrtcVTotal |= 1;
-
- /* Assume it is OK */
- return MODE_OK;
-}
-
-/*
- * xf86CheckModeForDriver
- *
- * This function is for checking modes while the server is running (for
- * use mainly by the VidMode extension).
- *
- * This function checks if a mode satisfies a driver's requirements:
- * - width lies within the line pitch
- * - mode size fits within virtual size
- * - horizontal/vertical timings are in range
- *
- * This function takes the following parameters:
- * scrp ScrnInfoPtr
- * mode mode to check
- * flags not (currently) used
- *
- * In addition, the following fields from the ScrnInfoRec are used:
- * maxHValue maximum horizontal timing value
- * maxVValue maximum vertical timing value
- * virtualX virtual width
- * virtualY virtual height
- * clockRanges allowable clock ranges
- */
-
-ModeStatus
-xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
-{
- ClockRangesPtr cp;
- int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1;
- int extraFlags = 0;
- int clockIndex = -1;
- int MulFactor = 1;
- int DivFactor = 1;
- int ModePrivFlags = 0;
- Bool allowDiv2;
- ModeStatus status = MODE_NOMODE;
-
- /* Some sanity checking */
- if (scrp == NULL || (!scrp->progClock && scrp->numClocks == 0)) {
- ErrorF("xf86CheckModeForDriver: called with invalid scrnInfoRec\n");
- return MODE_ERROR;
- }
- if (mode == NULL) {
- ErrorF("xf86CheckModeForDriver: called with invalid modep\n");
- return MODE_ERROR;
- }
-
- /* Check the mode size */
- if (mode->HDisplay > scrp->virtualX)
- return MODE_VIRTUAL_X;
-
- if (mode->VDisplay > scrp->virtualY)
- return MODE_VIRTUAL_Y;
-
- if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue)
- return MODE_BAD_HVALUE;
-
- if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue)
- return MODE_BAD_VVALUE;
-
- for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
- /* DivFactor and MulFactor must be > 0 */
- cp->ClockDivFactor = max(1, cp->ClockDivFactor);
- cp->ClockMulFactor = max(1, cp->ClockMulFactor);
- }
-
- if (scrp->progClock) {
- /* Check clock is in range */
- for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
- if ((cp->minClock <= mode->Clock) &&
- (cp->maxClock >= mode->Clock) &&
- (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1))))
- break;
- }
- if (cp == NULL) {
- return MODE_CLOCK_RANGE;
- }
- /*
- * If programmable clock the required mode has been found
- */
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- } else {
- status = MODE_CLOCK_RANGE;
- /* Check clock is in range */
- for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
- if ((cp->minClock <= mode->Clock) &&
- (cp->maxClock >= mode->Clock) &&
- (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1)))) {
-
- /*
- * Clock is in range, so if it is not a programmable clock,
- * find a matching clock.
- */
-
- allowDiv2 = (cp->strategy & LOOKUP_CLKDIV2) != 0;
- i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2,
- cp->ClockDivFactor, cp->ClockMulFactor, &k);
- /*
- * If the clock is too far from the requested clock, this
- * mode is no good.
- */
- if (k & V_CLKDIV2)
- gap = abs((mode->Clock * 2) -
- ((scrp->clock[i] * cp->ClockDivFactor) /
- cp->ClockMulFactor));
- else
- gap = abs(mode->Clock -
- ((scrp->clock[i] * cp->ClockDivFactor) /
- cp->ClockMulFactor));
- if (gap > minimumGap) {
- status = MODE_NOCLOCK;
- continue;
- }
-
- DivFactor = cp->ClockDivFactor;
- MulFactor = cp->ClockMulFactor;
- ModePrivFlags = cp->PrivFlags;
- extraFlags = k;
- clockIndex = i;
- break;
- }
- }
- if (cp == NULL)
- return status;
- }
-
- /* Fill in the mode parameters */
- if (scrp->progClock) {
- mode->ClockIndex = -1;
- mode->SynthClock = (mode->Clock * MulFactor) / DivFactor;
- } else {
- mode->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
- mode->ClockIndex = clockIndex;
- mode->SynthClock = scrp->clock[clockIndex];
- if (extraFlags & V_CLKDIV2) {
- mode->Clock /= 2;
- mode->SynthClock /= 2;
- }
- }
- mode->PrivFlags = ModePrivFlags;
-
- return MODE_OK;
-}
-
-/*
- * xf86ValidateModes
- *
- * This function takes a set of mode names, modes and limiting conditions,
- * and selects a set of modes and parameters based on those conditions.
- *
- * This function takes the following parameters:
- * scrp ScrnInfoPtr
- * availModes the list of modes available for the monitor
- * modeNames (optional) list of mode names that the screen is requesting
- * clockRanges a list of clock ranges
- * linePitches (optional) a list of line pitches
- * minPitch (optional) minimum line pitch (in pixels)
- * maxPitch (optional) maximum line pitch (in pixels)
- * pitchInc (mandatory) pitch increment (in bits)
- * minHeight (optional) minimum virtual height (in pixels)
- * maxHeight (optional) maximum virtual height (in pixels)
- * virtualX (optional) virtual width requested (in pixels)
- * virtualY (optional) virtual height requested (in pixels)
- * apertureSize size of video aperture (in bytes)
- * strategy how to decide which mode to use from multiple modes with
- * the same name
- *
- * In addition, the following fields from the ScrnInfoRec are used:
- * clocks a list of discrete clocks
- * numClocks number of discrete clocks
- * progClock clock is programmable
- * monitor pointer to structure for monitor section
- * fbFormat format of the framebuffer
- * videoRam video memory size
- * maxHValue maximum horizontal timing value
- * maxVValue maximum vertical timing value
- * xInc horizontal timing increment (defaults to 8 pixels)
- *
- * The function fills in the following ScrnInfoRec fields:
- * modePool A subset of the modes available to the monitor which
- * are compatible with the driver.
- * modes one mode entry for each of the requested modes, with the
- * status field filled in to indicate if the mode has been
- * accepted or not.
- * virtualX the resulting virtual width
- * virtualY the resulting virtual height
- * displayWidth the resulting line pitch
- *
- * The function's return value is the number of matching modes found, or -1
- * if an unrecoverable error was encountered.
- */
-
-int
-xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
- char **modeNames, ClockRangePtr clockRanges,
- int *linePitches, int minPitch, int maxPitch, int pitchInc,
- int minHeight, int maxHeight, int virtualX, int virtualY,
- int apertureSize, LookupModeFlags strategy)
-{
- DisplayModePtr p, q, r, new, last, *endp;
- int i, numModes = 0;
- ModeStatus status;
- int linePitch = -1, virtX = 0, virtY = 0;
- int newLinePitch, newVirtX, newVirtY;
- int modeSize; /* in pixels */
- Bool validateAllDefaultModes = FALSE;
- Bool userModes = FALSE;
- int saveType;
- PixmapFormatRec *BankFormat;
- ClockRangePtr cp;
- ClockRangesPtr storeClockRanges;
- struct monitor_ranges *mon_range = NULL;
- double targetRefresh = 0.0;
- int numTimings = 0;
- range hsync[MAX_HSYNC];
- range vrefresh[MAX_VREFRESH];
-
-#ifdef DEBUG
- ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
- scrp, availModes, modeNames, clockRanges,
- linePitches, minPitch, maxPitch, pitchInc,
- minHeight, maxHeight, virtualX, virtualY,
- apertureSize, strategy
- );
-#endif
-
- /* Some sanity checking */
- if (scrp == NULL || scrp->name == NULL || !scrp->monitor ||
- (!scrp->progClock && scrp->numClocks == 0)) {
- ErrorF("xf86ValidateModes: called with invalid scrnInfoRec\n");
- return -1;
- }
- if (linePitches != NULL && linePitches[0] <= 0) {
- ErrorF("xf86ValidateModes: called with invalid linePitches\n");
- return -1;
- }
- if (pitchInc <= 0) {
- ErrorF("xf86ValidateModes: called with invalid pitchInc\n");
- return -1;
- }
- if ((virtualX > 0) != (virtualY > 0)) {
- ErrorF("xf86ValidateModes: called with invalid virtual resolution\n");
- return -1;
- }
-
- /*
- * Probe monitor so that we can enforce/warn about its limits.
- * If one or more DS_RANGES descriptions are present, use the parameters
- * that they provide. Otherwise, deduce limits based on the modes that
- * are shown as supported via standard and detailed timings.
- *
- * XXX The full potential of the DDC/EDID data still isn't being tapped.
- */
- if (scrp->monitor->DDC) {
- MonPtr monitor = scrp->monitor;
- xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
- int i, j;
- float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
- float h;
- struct std_timings *t;
- struct detailed_timings *dt;
-
- numTimings = 0;
- for (i = 0; i < DET_TIMINGS; i++) {
- switch (DDC->det_mon[i].type) {
- case DS_RANGES:
- mon_range = &DDC->det_mon[i].section.ranges;
- hsync[numTimings].lo = mon_range->min_h;
- hsync[numTimings].hi = mon_range->max_h;
- vrefresh[numTimings].lo = mon_range->min_v;
- vrefresh[numTimings].hi = mon_range->max_v;
- numTimings++;
- break;
-
- case DS_STD_TIMINGS:
- t = DDC->det_mon[i].section.std_t;
- for (j = 0; j < 5; j++) {
- if (t[j].hsize > 256) { /* sanity check */
- if (t[j].refresh < vmin)
- vmin = t[i].refresh;
- if (t[j].refresh > vmax)
- vmax = t[i].refresh;
- /*
- * For typical modes this is a reasonable estimate
- * of the horizontal sync rate.
- */
- h = t[j].refresh * 1.07 * t[j].vsize / 1000.0;
- if (h < hmin)
- hmin = h;
- if (h > hmax)
- hmax = h;
- }
- }
- break;
-
- case DT:
- dt = &DDC->det_mon[i].section.d_timings;
- if (dt->clock > 15000000) { /* sanity check */
- float v;
- h = (float)dt->clock / (dt->h_active + dt->h_blanking);
- v = h / (dt->v_active + dt->v_blanking);
- h /= 1000.0;
- if (dt->interlaced)
- v /= 2.0;
-
- if (v < vmin)
- vmin = v;
- if (v > vmax)
- vmax = v;
- if (h < hmin)
- hmin = h;
- if (h > hmax)
- hmax = h;
- }
- break;
- }
-
- if (numTimings > MAX_HSYNC)
- break;
- }
-
- if (numTimings == 0) {
- t = DDC->timings2;
- for (i = 0; i < STD_TIMINGS; i++) {
- if (t[i].hsize > 256) { /* sanity check */
- if (t[i].refresh < vmin)
- vmin = t[i].refresh;
- if (t[i].refresh > vmax)
- vmax = t[i].refresh;
- /*
- * For typical modes this is a reasonable estimate
- * of the horizontal sync rate.
- */
- h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
- if (h < hmin)
- hmin = h;
- if (h > hmax)
- hmax = h;
- }
- }
-
- if (hmax > 0.0) {
- hsync[numTimings].lo = hmin;
- hsync[numTimings].hi = hmax;
- vrefresh[numTimings].lo = vmin;
- vrefresh[numTimings].hi = vmax;
- numTimings++;
- }
- }
-
- if (numTimings > 0) {
-
-#ifdef DEBUG
- for (i = 0; i < numTimings; i++) {
- ErrorF("DDC - Hsync %.1f-%.1f kHz - Vrefresh %.1f-%.1f Hz\n",
- hsync[i].lo, hsync[i].hi,
- vrefresh[i].lo, vrefresh[i].hi);
- }
-#endif
-
-#define DDC_SYNC_TOLERANCE SYNC_TOLERANCE
- if (monitor->nHsync > 0) {
- for (i = 0; i < monitor->nHsync; i++) {
- Bool good = FALSE;
- for (j = 0; j < numTimings; j++) {
- if ((1.0 - DDC_SYNC_TOLERANCE) * hsync[j].lo <=
- monitor->hsync[i].lo &&
- (1.0 + DDC_SYNC_TOLERANCE) * hsync[j].hi >=
- monitor->hsync[i].hi) {
- good = TRUE;
- break;
- }
- }
- if (!good) {
- xf86DrvMsg(scrp->scrnIndex, X_WARNING,
- "config file hsync range %g-%gkHz not within DDC "
- "hsync ranges.\n",
- monitor->hsync[i].lo, monitor->hsync[i].hi);
- }
- }
- }
-
- if (monitor->nVrefresh > 0) {
- for (i = 0; i < monitor->nVrefresh; i++) {
- Bool good = FALSE;
- for (j = 0; j < numTimings; j++) {
- if ((1.0 - DDC_SYNC_TOLERANCE) * vrefresh[j].lo <=
- monitor->vrefresh[0].lo &&
- (1.0 + DDC_SYNC_TOLERANCE) * vrefresh[j].hi >=
- monitor->vrefresh[0].hi) {
- good = TRUE;
- break;
- }
- }
- if (!good) {
- xf86DrvMsg(scrp->scrnIndex, X_WARNING,
- "config file vrefresh range %g-%gHz not within DDC "
- "vrefresh ranges.\n",
- monitor->vrefresh[i].lo, monitor->vrefresh[i].hi);
- }
- }
- }
- }
- }
-
- /*
- * If requested by the driver, allow missing hsync and/or vrefresh ranges
- * in the monitor section.
- */
- if (strategy & LOOKUP_OPTIONAL_TOLERANCES) {
- strategy &= ~LOOKUP_OPTIONAL_TOLERANCES;
- } else {
- const char *type = "";
-
- if (scrp->monitor->nHsync <= 0) {
- if (numTimings > 0) {
- scrp->monitor->nHsync = numTimings;
- for (i = 0; i < numTimings; i++) {
- scrp->monitor->hsync[i].lo = hsync[i].lo;
- scrp->monitor->hsync[i].hi = hsync[i].hi;
- }
- } else {
- scrp->monitor->hsync[0].lo = 28;
- scrp->monitor->hsync[0].hi = 33;
- scrp->monitor->nHsync = 1;
- }
- type = "default ";
- }
- for (i = 0; i < scrp->monitor->nHsync; i++) {
- if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using %shsync value of %.2f kHz\n",
- scrp->monitor->id, type,
- scrp->monitor->hsync[i].lo);
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using %shsync range of %.2f-%.2f kHz\n",
- scrp->monitor->id, type,
- scrp->monitor->hsync[i].lo,
- scrp->monitor->hsync[i].hi);
- }
-
- type = "";
- if (scrp->monitor->nVrefresh <= 0) {
- if (numTimings > 0) {
- scrp->monitor->nVrefresh = numTimings;
- for (i = 0; i < numTimings; i++) {
- scrp->monitor->vrefresh[i].lo = vrefresh[i].lo;
- scrp->monitor->vrefresh[i].hi = vrefresh[i].hi;
- }
- } else {
- scrp->monitor->vrefresh[0].lo = 43;
- scrp->monitor->vrefresh[0].hi = 72;
- scrp->monitor->nVrefresh = 1;
- }
- type = "default ";
- }
- for (i = 0; i < scrp->monitor->nVrefresh; i++) {
- if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using %svrefresh value of %.2f Hz\n",
- scrp->monitor->id, type,
- scrp->monitor->vrefresh[i].lo);
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using %svrefresh range of %.2f-%.2f Hz\n",
- scrp->monitor->id, type,
- scrp->monitor->vrefresh[i].lo,
- scrp->monitor->vrefresh[i].hi);
- }
- }
-
- /*
- * Store the clockRanges for later use by the VidMode extension. Must
- * also store the strategy, since ClockDiv2 flag is stored there.
- */
- storeClockRanges = scrp->clockRanges;
- while (storeClockRanges != NULL) {
- storeClockRanges = storeClockRanges->next;
- }
- for (cp = clockRanges; cp != NULL; cp = cp->next,
- storeClockRanges = storeClockRanges->next) {
- storeClockRanges = xnfalloc(sizeof(ClockRanges));
- if (scrp->clockRanges == NULL)
- scrp->clockRanges = storeClockRanges;
- memcpy(storeClockRanges, cp, sizeof(ClockRange));
- storeClockRanges->strategy = strategy;
- }
-
- /* Determine which pixmap format to pass to miScanLineWidth() */
- if (scrp->depth > 4)
- BankFormat = &scrp->fbFormat;
- else
- BankFormat = xf86GetPixFormat(scrp, 1); /* >not< scrp->depth! */
-
- if (scrp->xInc <= 0)
- scrp->xInc = 8; /* Suitable for VGA and others */
-
-#define _VIRTUALX(x) ((((x) + scrp->xInc - 1) / scrp->xInc) * scrp->xInc)
-
- /*
- * Determine maxPitch if it wasn't given explicitly. Note linePitches
- * always takes precedence if is non-NULL. In that case the minPitch and
- * maxPitch values passed are ignored.
- */
- if (linePitches) {
- minPitch = maxPitch = linePitches[0];
- for (i = 1; linePitches[i] > 0; i++) {
- if (linePitches[i] > maxPitch)
- maxPitch = linePitches[i];
- if (linePitches[i] < minPitch)
- minPitch = linePitches[i];
- }
- }
-
- /* Initial check of virtual size against other constraints */
- scrp->virtualFrom = X_PROBED;
- /*
- * Initialise virtX and virtY if the values are fixed.
- */
- if (virtualY > 0) {
- if (maxHeight > 0 && virtualY > maxHeight) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Virtual height (%d) is too large for the hardware "
- "(max %d)\n", virtualY, maxHeight);
- return -1;
- }
-
- if (minHeight > 0 && virtualY < minHeight) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Virtual height (%d) is too small for the hardware "
- "(min %d)\n", virtualY, minHeight);
- return -1;
- }
-
- virtualX = _VIRTUALX(virtualX);
- if (linePitches != NULL) {
- for (i = 0; linePitches[i] != 0; i++) {
- if ((linePitches[i] >= virtualX) &&
- (linePitches[i] ==
- miScanLineWidth(virtualX, virtualY, linePitches[i],
- apertureSize, BankFormat, pitchInc))) {
- linePitch = linePitches[i];
- break;
- }
- }
- } else {
- linePitch = miScanLineWidth(virtualX, virtualY, minPitch,
- apertureSize, BankFormat, pitchInc);
- }
-
- if ((linePitch < minPitch) || (linePitch > maxPitch)) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Virtual width (%d) is too large for the hardware "
- "(max %d)\n", virtualX, maxPitch);
- return -1;
- }
-
- if (!xf86CheckModeSize(scrp, linePitch, virtualX, virtualY)) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Virtual size (%dx%d) (pitch %d) exceeds video memory\n",
- virtualX, virtualY, linePitch);
- return -1;
- }
-
- virtX = virtualX;
- virtY = virtualY;
- scrp->virtualFrom = X_CONFIG;
- }
-
- /* Print clock ranges and scaled clocks */
- xf86ShowClockRanges(scrp, clockRanges);
-
- /*
- * If scrp->modePool hasn't been setup yet, set it up now. This allows the
- * modes that the driver definitely can't use to be weeded out early. Note
- * that a modePool mode's prev field is used to hold a pointer to the
- * member of the scrp->modes list for which a match was considered.
- */
- if (scrp->modePool == NULL) {
- q = NULL;
- for (p = availModes; p != NULL; p = p->next) {
- status = xf86InitialCheckModeForDriver(scrp, p, clockRanges,
- strategy, maxPitch,
- virtualX, virtualY);
-
- if (status == MODE_OK)
- status = xf86CheckModeForMonitor(p, scrp->monitor);
-
- if (status == MODE_OK) {
- new = xnfalloc(sizeof(DisplayModeRec));
- *new = *p;
- new->next = NULL;
- if (!q) {
- scrp->modePool = new;
- } else {
- q->next = new;
- }
- new->prev = NULL;
- q = new;
- q->name = xnfstrdup(p->name);
- q->status = MODE_OK;
- } else {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- }
- }
-
- if (scrp->modePool == NULL) {
- xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Mode pool is empty\n");
- return 0;
- }
- } else {
- for (p = scrp->modePool; p != NULL; p = p->next) {
- p->prev = NULL;
- p->status = MODE_OK;
- }
- }
-
- /*
- * Go through the mode pool and see if any modes match the target
- * refresh rate, (if specified). If no modes match, abandon the target.
- */
- targetRefresh = xf86SetRealOption(scrp->options,
- "TargetRefresh", 0.0);
- if (targetRefresh > 0.0) {
- for (p = scrp->modePool; p != NULL; p = p->next) {
- if (ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE))
- break;
- }
- if (!p)
- targetRefresh = 0.0;
- }
-
- if (targetRefresh > 0.0) {
- xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
- "Target refresh rate is %.1f Hz\n", targetRefresh);
- }
-
- /*
- * Allocate one entry in scrp->modes for each named mode.
- */
- while (scrp->modes)
- xf86DeleteMode(&scrp->modes, scrp->modes);
- endp = &scrp->modes;
- last = NULL;
- if (modeNames != NULL) {
- for (i = 0; modeNames[i] != NULL; i++) {
- userModes = TRUE;
- new = xnfcalloc(1, sizeof(DisplayModeRec));
- new->prev = last;
- new->type = M_T_USERDEF;
- new->name = xnfalloc(strlen(modeNames[i]) + 1);
- strcpy(new->name, modeNames[i]);
- if (new->prev)
- new->prev->next = new;
- *endp = last = new;
- endp = &new->next;
- }
- }
-
- /* Lookup each mode */
-#ifdef RANDR
- if (!xf86Info.disableRandR
-#ifdef PANORAMIX
- && noPanoramiXExtension
-#endif
- )
- validateAllDefaultModes = TRUE;
-#endif
-
- for (p = scrp->modes; ; p = p->next) {
- Bool repeat;
-
- /*
- * If the supplied mode names don't produce a valid mode, scan through
- * unconsidered modePool members until one survives validation. This
- * is done in decreasing order by mode pixel area.
- */
-
- if (p == NULL) {
- if ((numModes > 0) && !validateAllDefaultModes)
- break;
-
- validateAllDefaultModes = TRUE;
- r = NULL;
- modeSize = 0;
- for (q = scrp->modePool; q != NULL; q = q->next) {
- if ((q->prev == NULL) && (q->status == MODE_OK)) {
- /*
- * Deal with the case where this mode wasn't considered
- * because of a builtin mode of the same name.
- */
- for (p = scrp->modes; p != NULL; p = p->next) {
- if ((p->status != MODE_OK) &&
- !strcmp(p->name, q->name))
- break;
- }
-
- if (p != NULL)
- q->prev = p;
- else {
- /*
- * A quick check to not allow default modes with
- * horizontal timing parameters that CRTs may have
- * problems with.
- */
- if ((q->type & M_T_DEFAULT) &&
- ((double)q->HTotal / (double)q->HDisplay) < 1.15)
- continue;
-
- /*
- * If there is a target refresh rate, skip modes that
- * don't match up.
- */
- if (ModeVRefresh(q) <
- (1.0 - SYNC_TOLERANCE) * targetRefresh)
- continue;
-
- if (modeSize < (q->HDisplay * q->VDisplay)) {
- r = q;
- modeSize = q->HDisplay * q->VDisplay;
- }
- }
- }
- }
-
- if (r == NULL)
- break;
-
- p = xnfcalloc(1, sizeof(DisplayModeRec));
- p->prev = last;
- p->name = xnfalloc(strlen(r->name) + 1);
- if (!userModes)
- p->type = M_T_USERDEF;
- strcpy(p->name, r->name);
- if (p->prev)
- p->prev->next = p;
- *endp = last = p;
- endp = &p->next;
- }
-
- repeat = FALSE;
- lookupNext:
- if (repeat && ((status = p->status) != MODE_OK)) {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- }
- saveType = p->type;
- status = xf86LookupMode(scrp, p, clockRanges, strategy);
- if (repeat && status == MODE_NOMODE) {
- continue;
- }
- if (status != MODE_OK) {
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n",
- p->name, xf86ModeStatusToString(status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(status));
- }
- if (status == MODE_ERROR) {
- ErrorF("xf86ValidateModes: "
- "unexpected result from xf86LookupMode()\n");
- return -1;
- }
- if (status != MODE_OK) {
- if (p->status == MODE_OK)
- p->status = status;
- continue;
- }
- p->type |= saveType;
- repeat = TRUE;
-
- newLinePitch = linePitch;
- newVirtX = virtX;
- newVirtY = virtY;
-
- /*
- * Don't let non-user defined modes increase the virtual size
- */
- if (!(p->type & M_T_USERDEF) && (numModes > 0)) {
- if (p->HDisplay > virtX) {
- p->status = MODE_VIRTUAL_X;
- goto lookupNext;
- }
- if (p->VDisplay > virtY) {
- p->status = MODE_VIRTUAL_Y;
- goto lookupNext;
- }
- }
- /*
- * Adjust virtual width and height if the mode is too large for the
- * current values and if they are not fixed.
- */
- if (virtualX <= 0 && p->HDisplay > newVirtX)
- newVirtX = _VIRTUALX(p->HDisplay);
- if (virtualY <= 0 && p->VDisplay > newVirtY) {
- if (maxHeight > 0 && p->VDisplay > maxHeight) {
- p->status = MODE_VIRTUAL_Y; /* ? */
- goto lookupNext;
- }
- newVirtY = p->VDisplay;
- }
-
- /*
- * If virtual resolution is to be increased, revalidate it.
- */
- if ((virtX != newVirtX) || (virtY != newVirtY)) {
- if (linePitches != NULL) {
- newLinePitch = -1;
- for (i = 0; linePitches[i] != 0; i++) {
- if ((linePitches[i] >= newVirtX) &&
- (linePitches[i] >= linePitch) &&
- (linePitches[i] ==
- miScanLineWidth(newVirtX, newVirtY, linePitches[i],
- apertureSize, BankFormat, pitchInc))) {
- newLinePitch = linePitches[i];
- break;
- }
- }
- } else {
- if (linePitch < minPitch)
- linePitch = minPitch;
- newLinePitch = miScanLineWidth(newVirtX, newVirtY, linePitch,
- apertureSize, BankFormat,
- pitchInc);
- }
- if ((newLinePitch < minPitch) || (newLinePitch > maxPitch)) {
- p->status = MODE_BAD_WIDTH;
- goto lookupNext;
- }
-
- /*
- * Check that the pixel area required by the new virtual height
- * and line pitch isn't too large.
- */
- if (!xf86CheckModeSize(scrp, newLinePitch, newVirtX, newVirtY)) {
- p->status = MODE_MEM_VIRT;
- goto lookupNext;
- }
- }
-
- if (scrp->ValidMode) {
- /*
- * Give the driver a final say, passing it the proposed virtual
- * geometry.
- */
- scrp->virtualX = newVirtX;
- scrp->virtualY = newVirtY;
- scrp->displayWidth = newLinePitch;
- p->status = (scrp->ValidMode)(scrp->scrnIndex, p, FALSE,
- MODECHECK_FINAL);
-
- if (p->status != MODE_OK) {
- goto lookupNext;
- }
- }
-
- /* Mode has passed all the tests */
- virtX = newVirtX;
- virtY = newVirtY;
- linePitch = newLinePitch;
- p->status = MODE_OK;
- numModes++;
- }
-
-#undef _VIRTUALX
-
- /* Update the ScrnInfoRec parameters */
-
- scrp->virtualX = virtX;
- scrp->virtualY = virtY;
- scrp->displayWidth = linePitch;
-
- if (numModes <= 0)
- return 0;
-
- /* Make the mode list into a circular list by joining up the ends */
- p = scrp->modes;
- while (p->next != NULL)
- p = p->next;
- /* p is now the last mode on the list */
- p->next = scrp->modes;
- scrp->modes->prev = p;
-
- if (minHeight > 0 && virtY < minHeight) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR,
- "Virtual height (%d) is too small for the hardware "
- "(min %d)\n", virtY, minHeight);
- return -1;
- }
-
- return numModes;
-}
-
-/*
- * xf86DeleteMode
- *
- * This function removes a mode from a list of modes.
- *
- * There are different types of mode lists:
- *
- * - singly linked linear lists, ending in NULL
- * - doubly linked linear lists, starting and ending in NULL
- * - doubly linked circular lists
- *
- */
-
-void
-xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode)
-{
- /* Catch the easy/insane cases */
- if (modeList == NULL || *modeList == NULL || mode == NULL)
- return;
-
- /* If the mode is at the start of the list, move the start of the list */
- if (*modeList == mode)
- *modeList = mode->next;
-
- /* If mode is the only one on the list, set the list to NULL */
- if ((mode == mode->prev) && (mode == mode->next)) {
- *modeList = NULL;
- } else {
- if ((mode->prev != NULL) && (mode->prev->next == mode))
- mode->prev->next = mode->next;
- if ((mode->next != NULL) && (mode->next->prev == mode))
- mode->next->prev = mode->prev;
- }
-
- xfree(mode->name);
- xfree(mode);
-}
-
-/*
- * xf86PruneDriverModes
- *
- * Remove modes from the driver's mode list which have been marked as
- * invalid.
- */
-
-void
-xf86PruneDriverModes(ScrnInfoPtr scrp)
-{
- DisplayModePtr first, p, n;
-
- p = scrp->modes;
- if (p == NULL)
- return;
-
- do {
- if (!(first = scrp->modes))
- return;
- n = p->next;
- if (p->status != MODE_OK) {
-#if 0
- if (p->type & M_T_BUILTIN)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using built-in mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
- else if (p->type & M_T_DEFAULT)
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using default mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
- else
- xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "Not using mode \"%s\" (%s)\n", p->name,
- xf86ModeStatusToString(p->status));
-#endif
- xf86DeleteMode(&(scrp->modes), p);
- }
- p = n;
- } while (p != NULL && p != first);
-
- /* modePool is no longer needed, turf it */
- while (scrp->modePool) {
- /*
- * A modePool mode's prev field is used to hold a pointer to the
- * member of the scrp->modes list for which a match was considered.
- * Clear that pointer first, otherwise xf86DeleteMode might get
- * confused
- */
- scrp->modePool->prev = NULL;
- xf86DeleteMode(&scrp->modePool, scrp->modePool);
- }
-}
-
-
-/*
- * xf86SetCrtcForModes
- *
- * Goes through the screen's mode list, and initialises the Crtc
- * parameters for each mode. The initialisation includes adjustments
- * for interlaced and double scan modes.
- */
-void
-xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)
-{
- DisplayModePtr p;
-
- /*
- * Store adjustFlags for use with the VidMode extension. There is an
- * implicit assumption here that SetCrtcForModes is called once.
- */
- scrp->adjustFlags = adjustFlags;
-
- p = scrp->modes;
- if (p == NULL)
- return;
-
- do {
- xf86SetModeCrtc(p, adjustFlags);
-#ifdef DEBUG
- ErrorF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
- (p->type & M_T_DEFAULT) ? "Default " : "",
- p->name, p->CrtcHDisplay, p->CrtcHBlankStart,
- p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd,
- p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart,
- p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd,
- p->CrtcVTotal);
-#endif
- p = p->next;
- } while (p != NULL && p != scrp->modes);
-}
-
-
-static void
-add(char **p, char *new)
-{
- *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
- strcat(*p, " ");
- strcat(*p, new);
-}
-
-static void
-PrintModeline(int scrnIndex,DisplayModePtr mode)
-{
- char tmp[256];
- char *flags = xnfcalloc(1, 1);
-
- if (mode->HSkew) {
- snprintf(tmp, 256, "hskew %i", mode->HSkew);
- add(&flags, tmp);
- }
- if (mode->VScan) {
- snprintf(tmp, 256, "vscan %i", mode->VScan);
- add(&flags, tmp);
- }
- if (mode->Flags & V_INTERLACE) add(&flags, "interlace");
- if (mode->Flags & V_CSYNC) add(&flags, "composite");
- if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan");
- if (mode->Flags & V_BCAST) add(&flags, "bcast");
- if (mode->Flags & V_PHSYNC) add(&flags, "+hsync");
- if (mode->Flags & V_NHSYNC) add(&flags, "-hsync");
- if (mode->Flags & V_PVSYNC) add(&flags, "+vsync");
- if (mode->Flags & V_NVSYNC) add(&flags, "-vsync");
- if (mode->Flags & V_PCSYNC) add(&flags, "+csync");
- if (mode->Flags & V_NCSYNC) add(&flags, "-csync");
-#if 0
- if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
-#endif
- xf86DrvMsgVerb(scrnIndex, X_INFO, 3,
- "Modeline \"%s\" %6.2f %i %i %i %i %i %i %i %i%s\n",
- mode->name, mode->Clock/1000., mode->HDisplay,
- mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
- mode->VDisplay, mode->VSyncStart, mode->VSyncEnd,
- mode->VTotal, flags);
- xfree(flags);
-}
-
-void
-xf86PrintModes(ScrnInfoPtr scrp)
-{
- DisplayModePtr p;
- float hsync, refresh = 0;
- char *desc, *desc2, *prefix, *uprefix;
-
- if (scrp == NULL)
- return;
-
- xf86DrvMsg(scrp->scrnIndex, scrp->virtualFrom, "Virtual size is %dx%d "
- "(pitch %d)\n", scrp->virtualX, scrp->virtualY,
- scrp->displayWidth);
-
- p = scrp->modes;
- if (p == NULL)
- return;
-
- do {
- desc = desc2 = "";
- if (p->HSync > 0.0)
- hsync = p->HSync;
- else if (p->HTotal > 0)
- hsync = (float)p->Clock / (float)p->HTotal;
- else
- hsync = 0.0;
- refresh = ModeVRefresh(p);
- if (p->Flags & V_INTERLACE) {
- desc = " (I)";
- }
- if (p->Flags & V_DBLSCAN) {
- desc = " (D)";
- }
- if (p->VScan > 1) {
- desc2 = " (VScan)";
- }
- if (p->type & M_T_BUILTIN)
- prefix = "Built-in mode";
- else if (p->type & M_T_DEFAULT)
- prefix = "Default mode";
- else
- prefix = "Mode";
- if (p->type & M_T_USERDEF)
- uprefix = "*";
- else
- uprefix = " ";
- if (hsync == 0 || refresh == 0) {
- if (p->name)
- xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
- "%s%s \"%s\"\n", uprefix, prefix, p->name);
- else
- xf86DrvMsg(scrp->scrnIndex, X_PROBED,
- "%s%s %dx%d (unnamed)\n",
- uprefix, prefix, p->HDisplay, p->VDisplay);
- } else if (p->Clock == p->SynthClock) {
- xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
- "%s%s \"%s\": %.1f MHz, %.1f kHz, %.1f Hz%s%s\n",
- uprefix, prefix, p->name, p->Clock / 1000.0,
- hsync, refresh, desc, desc2);
- } else {
- xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
- "%s%s \"%s\": %.1f MHz (scaled from %.1f MHz), "
- "%.1f kHz, %.1f Hz%s%s\n",
- uprefix, prefix, p->name, p->Clock / 1000.0,
- p->SynthClock / 1000.0, hsync, refresh, desc, desc2);
- }
- if (hsync != 0 && refresh != 0)
- PrintModeline(scrp->scrnIndex,p);
- p = p->next;
- } while (p != NULL && p != scrp->modes);
-}
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
deleted file mode 100644
index bd18e895f..000000000
--- a/hw/xfree86/common/xf86Module.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.37 2003/08/24 17:36:54 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the parts of the loader interface that are visible
- * to modules. This is the only loader-related header that modules should
- * include.
- *
- * It should include a bare minimum of other headers.
- *
- * Longer term, the module/loader code should probably live directly under
- * Xserver/.
- *
- * XXX This file arguably belongs in xfree86/loader/.
- */
-
-#ifndef _XF86MODULE_H
-#define _XF86MODULE_H
-
-#include "misc.h"
-#include "xf86Version.h"
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-typedef enum {
- LD_RESOLV_IFDONE = 0, /* only check if no more
- delays pending */
- LD_RESOLV_NOW = 1, /* finish one delay step */
- LD_RESOLV_FORCE = 2 /* force checking... */
-} LoaderResolveOptions;
-
-#define DEFAULT_LIST ((char *)-1)
-
-/* This indicates a special module that doesn't have the usual entry point */
-#define EXTERN_MODULE ((pointer)-1)
-
-/* Built-in ABI classes. These definitions must not be changed. */
-#define ABI_CLASS_NONE NULL
-#define ABI_CLASS_ANSIC "XFree86 ANSI C Emulation"
-#define ABI_CLASS_VIDEODRV "XFree86 Video Driver"
-#define ABI_CLASS_XINPUT "XFree86 XInput driver"
-#define ABI_CLASS_EXTENSION "XFree86 Server Extension"
-#define ABI_CLASS_FONT "XFree86 Font Renderer"
-
-#define ABI_MINOR_MASK 0x0000FFFF
-#define ABI_MAJOR_MASK 0xFFFF0000
-#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
-#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
-#define SET_ABI_VERSION(maj, min) \
- ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
-
-/*
- * ABI versions. Each version has a major and minor revision. Modules
- * using lower minor revisions must work with servers of a higher minor
- * revision. There is no compatibility between different major revisions.
- * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
- * changed. The minor revision mask is 0x0000FFFF and the major revision
- * mask is 0xFFFF0000.
- */
-#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 2)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 7)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 2)
-#define ABI_FONT_VERSION SET_ABI_VERSION(0, 4)
-
-#define MODINFOSTRING1 0xef23fdc5
-#define MODINFOSTRING2 0x10dc023a
-
-#ifndef MODULEVENDORSTRING
-#ifndef __OS2ELF__
-#define MODULEVENDORSTRING "The XFree86 Project"
-#else
-#define MODULEVENDORSTRING "The XFree86 Project - XFree86/OS2"
-#endif
-#endif
-
-/* Error return codes for errmaj. New codes must only be added at the end. */
-typedef enum {
- LDR_NOERROR = 0,
- LDR_NOMEM, /* memory allocation failed */
- LDR_NOENT, /* Module file does not exist */
- LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
- LDR_NOSPACE, /* internal module array full */
- LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
- LDR_UNKTYPE, /* file is not a recognized module type */
- LDR_NOLOAD, /* type specific loader failed */
- LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
- LDR_NOPORTOPEN, /* could not open port (check errmin) */
- LDR_NOHARDWARE, /* could not query/initialize the hardware device */
- LDR_MISMATCH, /* the module didn't match the spec'd requirments */
- LDR_BADUSAGE, /* LoadModule is called with bad arguments */
- LDR_INVALID, /* The module doesn't have a valid ModuleData object */
- LDR_BADOS, /* The module doesn't support the OS */
- LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
-} LoaderErrorCode;
-
-/*
- * Some common module classes. The moduleclass can be used to identify
- * that modules loaded are of the correct type. This is a finer
- * classification than the ABI classes even though the default set of
- * classes have the same names. For example, not all modules that require
- * the video driver ABI are themselves video drivers.
- */
-#define MOD_CLASS_NONE NULL
-#define MOD_CLASS_VIDEODRV "XFree86 Video Driver"
-#define MOD_CLASS_XINPUT "XFree86 XInput Driver"
-#define MOD_CLASS_FONT "XFree86 Font Renderer"
-#define MOD_CLASS_EXTENSION "XFree86 Server Extension"
-
-/* This structure is expected to be returned by the initfunc */
-typedef struct {
- const char * modname; /* name of module, e.g. "foo" */
- const char * vendor; /* vendor specific string */
- CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
- CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
- CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
- CARD8 majorversion; /* module-specific major version */
- CARD8 minorversion; /* module-specific minor version */
- CARD16 patchlevel; /* module-specific patch level */
- const char * abiclass; /* ABI class that the module uses */
- CARD32 abiversion; /* ABI version */
- const char * moduleclass; /* module class description */
- CARD32 checksum[4]; /* contains a digital signature of the */
- /* version info structure */
-} XF86ModuleVersionInfo;
-
-/*
- * This structure can be used to callers of LoadModule and LoadSubModule to
- * specify version and/or ABI requirements.
- */
-typedef struct {
- CARD8 majorversion; /* module-specific major version */
- CARD8 minorversion; /* moudle-specific minor version */
- CARD16 patchlevel; /* module-specific patch level */
- const char * abiclass; /* ABI class that the module uses */
- CARD32 abiversion; /* ABI version */
- const char * moduleclass; /* module class */
-} XF86ModReqInfo;
-
-/* values to indicate unspecified fields in XF86ModReqInfo. */
-#define MAJOR_UNSPEC 0xFF
-#define MINOR_UNSPEC 0xFF
-#define PATCH_UNSPEC 0xFFFF
-#define ABI_VERS_UNSPEC 0xFFFFFFFF
-
-#define MODULE_VERSION_NUMERIC(maj, min, patch) \
- ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
-#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
-#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
-#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
-
-#define INITARGS void
-
-typedef void (*InitExtension)(INITARGS);
-
-typedef struct {
- InitExtension initFunc;
- const char * name;
- Bool *disablePtr;
- InitExtension setupFunc;
- const char ** initDependencies;
-} ExtensionModule;
-
-extern ExtensionModule *ExtensionModuleList;
-
-/* Prototypes for Loader functions that are exported to modules */
-#ifndef IN_LOADER
-/* Prototypes with opaque pointers for use by modules */
-pointer LoadSubModule(pointer, const char *, const char **,
- const char **, pointer, const XF86ModReqInfo *,
- int *, int *);
-void UnloadSubModule(pointer);
-void LoadFont(pointer);
-void UnloadModule (pointer);
-#endif
-pointer LoaderSymbol(const char *);
-char **LoaderListDirs(const char **, const char **);
-void LoaderFreeDirList(char **);
-void LoaderErrorMsg(const char *, const char *, int, int);
-void LoadExtension(ExtensionModule *, Bool);
-void LoaderRefSymLists(const char **, ...);
-void LoaderRefSymbols(const char *, ...);
-void LoaderReqSymLists(const char **, ...);
-void LoaderReqSymbols(const char *, ...);
-int LoaderCheckUnresolved(int);
-void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
-
-typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
-typedef void (*ModuleTearDownProc)(pointer);
-#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
-#define MODULETEARDOWNPROTO(func) void func(pointer)
-
-typedef struct {
- XF86ModuleVersionInfo * vers;
- ModuleSetupProc setup;
- ModuleTearDownProc teardown;
-} XF86ModuleData;
-
-#endif /* _XF86STR_H */
diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h
deleted file mode 100644
index 718732353..000000000
--- a/hw/xfree86/common/xf86Opt.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.15 2003/10/08 14:30:38 dawes Exp $ */
-
-/*
- * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Option handling things that ModuleSetup procs can use */
-
-#ifndef _XF86_OPT_H_
-#define _XF86_OPT_H_
-
-typedef struct {
- double freq;
- int units;
-} OptFrequency;
-
-typedef union {
- unsigned long num;
- char * str;
- double realnum;
- Bool bool;
- OptFrequency freq;
-} ValueUnion;
-
-typedef enum {
- OPTV_NONE = 0,
- OPTV_INTEGER,
- OPTV_STRING, /* a non-empty string */
- OPTV_ANYSTR, /* Any string, including an empty one */
- OPTV_REAL,
- OPTV_BOOLEAN,
- OPTV_FREQ
-} OptionValueType;
-
-typedef enum {
- OPTUNITS_HZ = 1,
- OPTUNITS_KHZ,
- OPTUNITS_MHZ
-} OptFreqUnits;
-
-typedef struct {
- int token;
- const char* name;
- OptionValueType type;
- ValueUnion value;
- Bool found;
-} OptionInfoRec, *OptionInfoPtr;
-
-int xf86SetIntOption(pointer optlist, const char *name, int deflt);
-double xf86SetRealOption(pointer optlist, const char *name, double deflt);
-char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
-int xf86SetBoolOption(pointer list, const char *name, int deflt );
-int xf86CheckIntOption(pointer optlist, const char *name, int deflt);
-double xf86CheckRealOption(pointer optlist, const char *name, double deflt);
-char *xf86CheckStrOption(pointer optlist, const char *name, char *deflt);
-int xf86CheckBoolOption(pointer list, const char *name, int deflt );
-pointer xf86AddNewOption(pointer head, const char *name, const char *val );
-pointer xf86NewOption(char *name, char *value );
-pointer xf86NextOption(pointer list );
-pointer xf86OptionListCreate(const char **options, int count, int used);
-pointer xf86OptionListMerge(pointer head, pointer tail);
-void xf86OptionListFree(pointer opt);
-char *xf86OptionName(pointer opt);
-char *xf86OptionValue(pointer opt);
-void xf86OptionListReport(pointer parm);
-pointer xf86FindOption(pointer options, const char *name);
-char *xf86FindOptionValue(pointer options, const char *name);
-void xf86MarkOptionUsed(pointer option);
-void xf86MarkOptionUsedByName(pointer options, const char *name);
-Bool xf86CheckIfOptionUsed(pointer option);
-Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
-void xf86ShowUnusedOptions(int scrnIndex, pointer options);
-void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
-OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
-const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
-Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
-char *xf86GetOptValString(const OptionInfoRec *table, int token);
-Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
-Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
-Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
-Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
- OptFreqUnits expectedUnits, double *value);
-Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
-Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
-int xf86NameCmp(const char *s1, const char *s2);
-char *xf86NormalizeName(const char *s);
-pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val);
-pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val);
-pointer xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val);
-pointer xf86ReplaceStrOption(pointer optlist, const char *name, const char* val);
-#endif
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
deleted file mode 100644
index 0ba09b507..000000000
--- a/hw/xfree86/common/xf86Option.c
+++ /dev/null
@@ -1,880 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.29 2003/10/18 12:34:19 dawes Exp $ */
-/*
- * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Author: David Dawes <dawes@xfree86.org>
- *
- * This file includes public option handling functions.
- */
-
-#include <stdlib.h>
-#include <ctype.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86Optrec.h"
-
-static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
- Bool markUsed);
-
-/*
- * xf86CollectOptions collects the options from each of the config file
- * sections used by the screen and puts the combined list in pScrn->options.
- * This function requires that the following have been initialised:
- *
- * pScrn->confScreen
- * pScrn->Entities[i]->device
- * pScrn->display
- * pScrn->monitor
- *
- * The extraOpts parameter may optionally contain a list of additional options
- * to include.
- *
- * The order of precedence for options is:
- *
- * extraOpts, display, confScreen, monitor, device
- */
-
-void
-xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)
-{
- XF86OptionPtr tmp;
- XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
- GDevPtr device;
-
- int i;
-
- pScrn->options = NULL;
-
- for (i=pScrn->numEntities - 1; i >= 0; i--) {
- device = xf86GetDevFromEntity(pScrn->entityList[i],
- pScrn->entityInstanceList[i]);
- if (device && device->options) {
- tmp = xf86optionListDup(device->options);
- if (pScrn->options)
- xf86optionListMerge(pScrn->options,tmp);
- else
- pScrn->options = tmp;
- }
- }
- if (pScrn->monitor->options) {
- tmp = xf86optionListDup(pScrn->monitor->options);
- if (pScrn->options)
- pScrn->options = xf86optionListMerge(pScrn->options, tmp);
- else
- pScrn->options = tmp;
- }
- if (pScrn->confScreen->options) {
- tmp = xf86optionListDup(pScrn->confScreen->options);
- if (pScrn->options)
- pScrn->options = xf86optionListMerge(pScrn->options, tmp);
- else
- pScrn->options = tmp;
- }
- if (pScrn->display->options) {
- tmp = xf86optionListDup(pScrn->display->options);
- if (pScrn->options)
- pScrn->options = xf86optionListMerge(pScrn->options, tmp);
- else
- pScrn->options = tmp;
- }
- if (extras) {
- tmp = xf86optionListDup(extras);
- if (pScrn->options)
- pScrn->options = xf86optionListMerge(pScrn->options, tmp);
- else
- pScrn->options = tmp;
- }
-}
-
-/*
- * xf86CollectInputOptions collects the options for an InputDevice.
- * This function requires that the following has been initialised:
- *
- * pInfo->conf_idev
- *
- * The extraOpts parameter may optionally contain a list of additional options
- * to include.
- *
- * The order of precedence for options is:
- *
- * extraOpts, pInfo->conf_idev->extraOptions,
- * pInfo->conf_idev->commonOptions, defaultOpts
- */
-
-void
-xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts)
-{
- XF86OptionPtr tmp;
- XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
-
- pInfo->options = NULL;
- if (defaultOpts) {
- pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
- }
- if (pInfo->conf_idev->commonOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (pInfo->conf_idev->extraOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (extras) {
- tmp = xf86optionListDup(extras);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
-}
-
-/* Created for new XInput stuff -- essentially extensions to the parser */
-
-static int
-LookupIntOption(pointer optlist, const char *name, int deflt, Bool markUsed)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_INTEGER;
- if (ParseOptionValue(-1, optlist, &o, markUsed))
- deflt = o.value.num;
- return deflt;
-}
-
-
-static double
-LookupRealOption(pointer optlist, const char *name, double deflt,
- Bool markUsed)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_REAL;
- if (ParseOptionValue(-1, optlist, &o, markUsed))
- deflt = o.value.realnum;
- return deflt;
-}
-
-
-static char *
-LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_STRING;
- if (ParseOptionValue(-1, optlist, &o, markUsed))
- deflt = o.value.str;
- if (deflt)
- return xstrdup(deflt);
- else
- return NULL;
-}
-
-
-static int
-LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_BOOLEAN;
- if (ParseOptionValue(-1, optlist, &o, markUsed))
- deflt = o.value.bool;
- return deflt;
-}
-
-/* These xf86Set* functions are intended for use by non-screen specific code */
-
-int
-xf86SetIntOption(pointer optlist, const char *name, int deflt)
-{
- return LookupIntOption(optlist, name, deflt, TRUE);
-}
-
-
-double
-xf86SetRealOption(pointer optlist, const char *name, double deflt)
-{
- return LookupRealOption(optlist, name, deflt, TRUE);
-}
-
-
-char *
-xf86SetStrOption(pointer optlist, const char *name, char *deflt)
-{
- return LookupStrOption(optlist, name, deflt, TRUE);
-}
-
-
-int
-xf86SetBoolOption(pointer optlist, const char *name, int deflt)
-{
- return LookupBoolOption(optlist, name, deflt, TRUE);
-}
-
-/*
- * These are like the Set*Option functions, but they don't mark the options
- * as used.
- */
-int
-xf86CheckIntOption(pointer optlist, const char *name, int deflt)
-{
- return LookupIntOption(optlist, name, deflt, FALSE);
-}
-
-
-double
-xf86CheckRealOption(pointer optlist, const char *name, double deflt)
-{
- return LookupRealOption(optlist, name, deflt, FALSE);
-}
-
-
-char *
-xf86CheckStrOption(pointer optlist, const char *name, char *deflt)
-{
- return LookupStrOption(optlist, name, deflt, FALSE);
-}
-
-
-int
-xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
-{
- return LookupBoolOption(optlist, name, deflt, FALSE);
-}
-
-/*
- * addNewOption() has the required property of replacing the option value
- * if the option is already present.
- */
-pointer
-xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
-{
- char *tmp = xnfalloc(16);
- sprintf(tmp,"%i",val);
- return xf86AddNewOption(optlist,name,tmp);
-}
-
-pointer
-xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
-{
- char *tmp = xnfalloc(32);
- snprintf(tmp,32,"%f",val);
- return xf86AddNewOption(optlist,name,tmp);
-}
-
-pointer
-xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val)
-{
- return xf86AddNewOption(optlist,name,val?"True":"False");
-}
-
-pointer
-xf86ReplaceStrOption(pointer optlist, const char *name, const char* val)
-{
- return xf86AddNewOption(optlist,name,val);
-}
-
-pointer
-xf86AddNewOption(pointer head, const char *name, const char *val)
-{
- /* XXX These should actually be allocated in the parser library. */
- char *tmp = strdup(val);
- char *tmp_name = strdup(name);
-
- return xf86addNewOption(head, tmp_name, tmp);
-}
-
-
-pointer
-xf86NewOption(char *name, char *value)
-{
- return xf86newOption(name, value);
-}
-
-
-pointer
-xf86NextOption(pointer list)
-{
- return xf86nextOption(list);
-}
-
-pointer
-xf86OptionListCreate(const char **options, int count, int used)
-{
- return xf86optionListCreate(options, count, used);
-}
-
-pointer
-xf86OptionListMerge(pointer head, pointer tail)
-{
- return xf86optionListMerge(head, tail);
-}
-
-void
-xf86OptionListFree(pointer opt)
-{
- xf86optionListFree(opt);
-}
-
-char *
-xf86OptionName(pointer opt)
-{
- return xf86optionName(opt);
-}
-
-char *
-xf86OptionValue(pointer opt)
-{
- return xf86optionValue(opt);
-}
-
-void
-xf86OptionListReport(pointer parm)
-{
- XF86OptionPtr opts = parm;
-
- while(opts) {
- if (xf86optionValue(opts))
- xf86ErrorFVerb(5, "\tOption \"%s\" \"%s\"\n",
- xf86optionName(opts), xf86optionValue(opts));
- else
- xf86ErrorFVerb( 5, "\tOption \"%s\"\n", xf86optionName(opts));
- opts = xf86nextOption(opts);
- }
-}
-
-/* End of XInput-caused section */
-
-pointer
-xf86FindOption(pointer options, const char *name)
-{
- return xf86findOption(options, name);
-}
-
-
-char *
-xf86FindOptionValue(pointer options, const char *name)
-{
- return xf86findOptionValue(options, name);
-}
-
-
-void
-xf86MarkOptionUsed(pointer option)
-{
- if (option != NULL)
- ((XF86OptionPtr)option)->opt_used = TRUE;
-}
-
-
-void
-xf86MarkOptionUsedByName(pointer options, const char *name)
-{
- XF86OptionPtr opt;
-
- opt = xf86findOption(options, name);
- if (opt != NULL)
- opt->opt_used = TRUE;
-}
-
-Bool
-xf86CheckIfOptionUsed(pointer option)
-{
- if (option != NULL)
- return ((XF86OptionPtr)option)->opt_used;
- else
- return FALSE;
-}
-
-Bool
-xf86CheckIfOptionUsedByName(pointer options, const char *name)
-{
- XF86OptionPtr opt;
-
- opt = xf86findOption(options, name);
- if (opt != NULL)
- return opt->opt_used;
- else
- return FALSE;
-}
-
-void
-xf86ShowUnusedOptions(int scrnIndex, pointer options)
-{
- XF86OptionPtr opt = options;
-
- while (opt) {
- if (opt->opt_name && !opt->opt_used) {
- xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" is not used\n",
- opt->opt_name);
- }
- opt = opt->list.next;
- }
-}
-
-
-static Bool
-GetBoolValue(OptionInfoPtr p, const char *s)
-{
- if (*s == '\0') {
- p->value.bool = TRUE;
- } else {
- if (xf86NameCmp(s, "1") == 0)
- p->value.bool = TRUE;
- else if (xf86NameCmp(s, "on") == 0)
- p->value.bool = TRUE;
- else if (xf86NameCmp(s, "true") == 0)
- p->value.bool = TRUE;
- else if (xf86NameCmp(s, "yes") == 0)
- p->value.bool = TRUE;
- else if (xf86NameCmp(s, "0") == 0)
- p->value.bool = FALSE;
- else if (xf86NameCmp(s, "off") == 0)
- p->value.bool = FALSE;
- else if (xf86NameCmp(s, "false") == 0)
- p->value.bool = FALSE;
- else if (xf86NameCmp(s, "no") == 0)
- p->value.bool = FALSE;
- else
- return FALSE;
- }
- return TRUE;
-}
-
-static Bool
-ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
- Bool markUsed)
-{
- char *s, *end;
- Bool wasUsed = FALSE;
-
- if ((s = xf86findOptionValue(options, p->name)) != NULL) {
- if (markUsed) {
- wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
- xf86MarkOptionUsedByName(options, p->name);
- }
- switch (p->type) {
- case OPTV_INTEGER:
- if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
- p->found = FALSE;
- } else {
- p->value.num = strtoul(s, &end, 0);
- if (*end == '\0') {
- p->found = TRUE;
- } else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
- p->found = FALSE;
- }
- }
- break;
- case OPTV_STRING:
- if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an string value\n",
- p->name);
- p->found = FALSE;
- } else {
- p->value.str = s;
- p->found = TRUE;
- }
- break;
- case OPTV_ANYSTR:
- p->value.str = s;
- p->found = TRUE;
- break;
- case OPTV_REAL:
- if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
- p->found = FALSE;
- } else {
- p->value.realnum = strtod(s, &end);
- if (*end == '\0') {
- p->found = TRUE;
- } else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
- p->found = FALSE;
- }
- }
- break;
- case OPTV_BOOLEAN:
- if (GetBoolValue(p, s)) {
- p->found = TRUE;
- } else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", p->name);
- p->found = FALSE;
- }
- break;
- case OPTV_FREQ:
- if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- } else {
- double freq = strtod(s, &end);
- int units = 0;
-
- if (end != s) {
- p->found = TRUE;
- if (!xf86NameCmp(end, "Hz"))
- units = 1;
- else if (!xf86NameCmp(end, "kHz") ||
- !xf86NameCmp(end, "k"))
- units = 1000;
- else if (!xf86NameCmp(end, "MHz") ||
- !xf86NameCmp(end, "M"))
- units = 1000000;
- else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- }
- if (p->found)
- freq *= (double)units;
- } else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- }
- if (p->found) {
- p->value.freq.freq = freq;
- p->value.freq.units = units;
- }
- }
- break;
- case OPTV_NONE:
- /* Should never get here */
- p->found = FALSE;
- break;
- }
- if (p->found && markUsed) {
- int verb = 2;
- if (wasUsed)
- verb = 4;
- xf86DrvMsgVerb(scrnIndex, X_CONFIG, verb, "Option \"%s\"", p->name);
- if (!(p->type == OPTV_BOOLEAN && *s == 0)) {
- xf86ErrorFVerb(verb, " \"%s\"", s);
- }
- xf86ErrorFVerb(verb, "\n");
- }
- } else if (p->type == OPTV_BOOLEAN) {
- /* Look for matches with options with or without a "No" prefix. */
- char *n, *newn;
- OptionInfoRec opt;
-
- n = xf86NormalizeName(p->name);
- if (!n) {
- p->found = FALSE;
- return FALSE;
- }
- if (strncmp(n, "no", 2) == 0) {
- newn = n + 2;
- } else {
- xfree(n);
- n = xalloc(strlen(p->name) + 2 + 1);
- if (!n) {
- p->found = FALSE;
- return FALSE;
- }
- strcpy(n, "No");
- strcat(n, p->name);
- newn = n;
- }
- if ((s = xf86findOptionValue(options, newn)) != NULL) {
- if (markUsed)
- xf86MarkOptionUsedByName(options, newn);
- if (GetBoolValue(&opt, s)) {
- p->value.bool = !opt.value.bool;
- p->found = TRUE;
- } else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", newn);
- p->found = FALSE;
- }
- } else {
- p->found = FALSE;
- }
- if (p->found && markUsed) {
- xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
- if (*s != 0) {
- xf86ErrorFVerb(2, " \"%s\"", s);
- }
- xf86ErrorFVerb(2, "\n");
- }
- xfree(n);
- } else {
- p->found = FALSE;
- }
- return p->found;
-}
-
-
-void
-xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
-{
- OptionInfoPtr p;
-
- for (p = optinfo; p->name != NULL; p++) {
- ParseOptionValue(scrnIndex, options, p, TRUE);
- }
-}
-
-
-OptionInfoPtr
-xf86TokenToOptinfo(const OptionInfoRec *table, int token)
-{
- const OptionInfoRec *p, *match = NULL, *set = NULL;
-
- if (!table) {
- ErrorF("xf86TokenToOptinfo: table is NULL\n");
- return NULL;
- }
-
- for (p = table; p->token >= 0; p++) {
- if (p->token == token) {
- match = p;
- if (p->found)
- set = p;
- }
- }
-
- if (set)
- return (OptionInfoPtr)set;
- else if (match)
- return (OptionInfoPtr)match;
- else
- return NULL;
-}
-
-
-const char *
-xf86TokenToOptName(const OptionInfoRec *table, int token)
-{
- const OptionInfoRec *p;
-
- p = xf86TokenToOptinfo(table, token);
- return p->name;
-}
-
-
-Bool
-xf86IsOptionSet(const OptionInfoRec *table, int token)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- return (p && p->found);
-}
-
-
-char *
-xf86GetOptValString(const OptionInfoRec *table, int token)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found)
- return p->value.str;
- else
- return NULL;
-}
-
-
-Bool
-xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- *value = p->value.num;
- return TRUE;
- } else
- return FALSE;
-}
-
-
-Bool
-xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- *value = p->value.num;
- return TRUE;
- } else
- return FALSE;
-}
-
-
-Bool
-xf86GetOptValReal(const OptionInfoRec *table, int token, double *value)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- *value = p->value.realnum;
- return TRUE;
- } else
- return FALSE;
-}
-
-
-Bool
-xf86GetOptValFreq(const OptionInfoRec *table, int token,
- OptFreqUnits expectedUnits, double *value)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- if (p->value.freq.units > 0) {
- /* Units give, so the scaling is known. */
- switch (expectedUnits) {
- case OPTUNITS_HZ:
- *value = p->value.freq.freq;
- break;
- case OPTUNITS_KHZ:
- *value = p->value.freq.freq / 1000.0;
- break;
- case OPTUNITS_MHZ:
- *value = p->value.freq.freq / 1000000.0;
- break;
- }
- } else {
- /* No units given, so try to guess the scaling. */
- switch (expectedUnits) {
- case OPTUNITS_HZ:
- *value = p->value.freq.freq;
- break;
- case OPTUNITS_KHZ:
- if (p->value.freq.freq > 1000.0)
- *value = p->value.freq.freq / 1000.0;
- else
- *value = p->value.freq.freq;
- break;
- case OPTUNITS_MHZ:
- if (p->value.freq.freq > 1000000.0)
- *value = p->value.freq.freq / 1000000.0;
- else if (p->value.freq.freq > 1000.0)
- *value = p->value.freq.freq / 1000.0;
- else
- *value = p->value.freq.freq;
- }
- }
- return TRUE;
- } else
- return FALSE;
-}
-
-
-Bool
-xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- *value = p->value.bool;
- return TRUE;
- } else
- return FALSE;
-}
-
-
-Bool
-xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)
-{
- OptionInfoPtr p;
-
- p = xf86TokenToOptinfo(table, token);
- if (p && p->found) {
- return p->value.bool;
- } else
- return def;
-}
-
-
-int
-xf86NameCmp(const char *s1, const char *s2)
-{
- return xf86nameCompare(s1, s2);
-}
-
-char *
-xf86NormalizeName(const char *s)
-{
- char *ret, *q;
- const char *p;
-
- if (s == NULL)
- return NULL;
-
- ret = xalloc(strlen(s) + 1);
- for (p = s, q = ret; *p != 0; p++) {
- switch (*p) {
- case '_':
- case ' ':
- case '\t':
- continue;
- default:
- if (isupper(*p))
- *q++ = tolower(*p);
- else
- *q++ = *p;
- }
- }
- *q = '\0';
- return ret;
-}
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
deleted file mode 100644
index eb56fb614..000000000
--- a/hw/xfree86/common/xf86PM.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.9 2003/08/24 17:36:54 dawes Exp $ */
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Xinput.h"
-
-int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num) = NULL;
-pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event) = NULL;
-
-static Bool suspended = FALSE;
-
-static char *
-eventName(pmEvent event)
-{
- switch(event) {
- case XF86_APM_SYS_STANDBY: return ("System Standby Request");
- case XF86_APM_SYS_SUSPEND: return ("System Suspend Request");
- case XF86_APM_CRITICAL_SUSPEND: return ("Critical Suspend");
- case XF86_APM_USER_STANDBY: return ("User System Standby Request");
- case XF86_APM_USER_SUSPEND: return ("User System Suspend Request");
- case XF86_APM_STANDBY_RESUME: return ("System Standby Resume");
- case XF86_APM_NORMAL_RESUME: return ("Normal Resume System");
- case XF86_APM_CRITICAL_RESUME: return ("Critical Resume System");
- case XF86_APM_LOW_BATTERY: return ("Battery Low");
- case XF86_APM_POWER_STATUS_CHANGE: return ("Power Status Change");
- case XF86_APM_UPDATE_TIME: return ("Update Time");
- case XF86_APM_CAPABILITY_CHANGED: return ("Capability Changed");
- case XF86_APM_STANDBY_FAILED: return ("Standby Request Failed");
- case XF86_APM_SUSPEND_FAILED: return ("Suspend Request Failed");
- default: return ("Unknown Event");
- }
-}
-
-static void
-suspend (pmEvent event, Bool undo)
-{
- int i;
- InputInfoPtr pInfo;
-
- xf86inSuspend = TRUE;
-
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->EnableDisableFBAccess)
- (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
- }
-#if !defined(__EMX__)
- pInfo = xf86InputDevs;
- while (pInfo) {
- DisableDevice(pInfo->dev);
- pInfo = pInfo->next;
- }
-#endif
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->PMEvent)
- xf86Screens[i]->PMEvent(i,event,undo);
- else {
- xf86Screens[i]->LeaveVT(i, 0);
- xf86Screens[i]->vtSema = FALSE;
- }
- }
- xf86AccessLeave();
- xf86AccessLeaveState();
-}
-
-static void
-resume(pmEvent event, Bool undo)
-{
- int i;
- InputInfoPtr pInfo;
-
- xf86AccessEnter();
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->PMEvent)
- xf86Screens[i]->PMEvent(i,event,undo);
- else {
- xf86Screens[i]->vtSema = TRUE;
- xf86Screens[i]->EnterVT(i, 0);
- }
- }
- xf86EnterServerState(OPERATING);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->EnableDisableFBAccess)
- (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
- }
- SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
-#if !defined(__EMX__)
- pInfo = xf86InputDevs;
- while (pInfo) {
- EnableDevice(pInfo->dev);
- pInfo = pInfo->next;
- }
-#endif
- xf86inSuspend = FALSE;
-}
-
-static void
-DoApmEvent(pmEvent event, Bool undo)
-{
- /*
- * we leave that as a global function for now. I don't know if
- * this might cause problems in the future. It is a global server
- * variable therefore it needs to be in a server info structure
- */
- int i;
-
- switch(event) {
- case XF86_APM_SYS_STANDBY:
- case XF86_APM_SYS_SUSPEND:
- case XF86_APM_CRITICAL_SUSPEND: /*do we want to delay a critical suspend?*/
- case XF86_APM_USER_STANDBY:
- case XF86_APM_USER_SUSPEND:
- /* should we do this ? */
- if (!undo && !suspended) {
- suspend(event,undo);
- suspended = TRUE;
- } else if (undo && suspended) {
- resume(event,undo);
- suspended = FALSE;
- }
- break;
- case XF86_APM_STANDBY_RESUME:
- case XF86_APM_NORMAL_RESUME:
- case XF86_APM_CRITICAL_RESUME:
- if (suspended) {
- resume(event,undo);
- suspended = FALSE;
- }
- break;
- default:
- xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
- xf86EnableAccess(xf86Screens[i]);
- if (xf86Screens[i]->PMEvent)
- xf86Screens[i]->PMEvent(i,event,undo);
- }
- xf86EnterServerState(OPERATING);
- break;
- }
-}
-
-#define MAX_NO_EVENTS 8
-
-void
-xf86HandlePMEvents(int fd, pointer data)
-{
- pmEvent events[MAX_NO_EVENTS];
- int i,n;
- Bool wait = FALSE;
-
- if (!xf86PMGetEventFromOs)
- return;
-
- if ((n = xf86PMGetEventFromOs(fd,events,MAX_NO_EVENTS))) {
- do {
- for (i = 0; i < n; i++) {
- xf86MsgVerb(X_INFO,3,"PM Event received: %s\n",
- eventName(events[i]));
- DoApmEvent(events[i],FALSE);
- switch (xf86PMConfirmEventToOs(fd,events[i])) {
- case PM_WAIT:
- wait = TRUE;
- break;
- case PM_CONTINUE:
- wait = FALSE;
- break;
- case PM_FAILED:
- DoApmEvent(events[i],TRUE);
- wait = FALSE;
- break;
- default:
- break;
- }
- }
- if (wait)
- n = xf86PMGetEventFromOs(fd,events,MAX_NO_EVENTS);
- else
- break;
- } while (1);
- }
-}
diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h
deleted file mode 100644
index 19cc009dd..000000000
--- a/hw/xfree86/common/xf86PciInfo.h
+++ /dev/null
@@ -1,624 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.156 2003/10/30 15:26:33 tsi Exp $ */
-
-/*
- * Copyright (c) 1995-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains macros for the PCI Vendor and Device IDs for video
- * cards plus a few other things that are needed in drivers or elsewhere.
- * This information is used in several ways:
- * 1. It is used by drivers and/or other code.
- * 2. It is used by the pciid2c.pl script to determine what vendor data to
- * include in the pcidata module that the X server loads.
- * 3. A side-effect of 2. affects how config-generation works for
- * otherwise "unknown" cards.
- *
- * Don't add entries here for vendors that don't make video cards,
- * or for non-video devices unless they're needed by a driver or elsewhere.
- * A comprehensive set of PCI vendor, device and subsystem data is
- * auto-generated from the ../etc/pci.ids file using the pciids2c.pl script,
- * and is used in both the scanpci module and the scanpci utility. Don't
- * modify the pci.ids file. If new/corrected entries are required, add them
- * to ../etc/extrapci.ids.
- */
-
-
-#ifndef _XF86_PCIINFO_H
-#define _XF86_PCIINFO_H
-
-/* PCI Pseudo Vendor */
-#define PCI_VENDOR_GENERIC 0x00FF
-
-#define PCI_VENDOR_REAL3D 0x003D
-#define PCI_VENDOR_COMPAQ 0x0E11
-#define PCI_VENDOR_ATI 0x1002
-#define PCI_VENDOR_AVANCE 0x1005
-#define PCI_VENDOR_TSENG 0x100C
-#define PCI_VENDOR_NS 0x100B
-#define PCI_VENDOR_WEITEK 0x100E
-#define PCI_VENDOR_VIDEOLOGIC 0x1010
-#define PCI_VENDOR_DIGITAL 0x1011
-#define PCI_VENDOR_CIRRUS 0x1013
-#define PCI_VENDOR_AMD 0x1022
-#define PCI_VENDOR_TRIDENT 0x1023
-#define PCI_VENDOR_ALI 0x1025
-#define PCI_VENDOR_DELL 0x1028
-#define PCI_VENDOR_MATROX 0x102B
-#define PCI_VENDOR_CHIPSTECH 0x102C
-#define PCI_VENDOR_MIRO 0x1031
-#define PCI_VENDOR_NEC 0x1033
-#define PCI_VENDOR_SIS 0x1039
-#define PCI_VENDOR_HP 0x103C
-#define PCI_VENDOR_SGS 0x104A
-#define PCI_VENDOR_TI 0x104C
-#define PCI_VENDOR_SONY 0x104D
-#define PCI_VENDOR_OAK 0x104E
-#define PCI_VENDOR_MOTOROLA 0x1057
-#define PCI_VENDOR_NUMNINE 0x105D
-#define PCI_VENDOR_CYRIX 0x1078
-#define PCI_VENDOR_SUN 0x108E
-#define PCI_VENDOR_DIAMOND 0x1092
-#define PCI_VENDOR_BROOKTREE 0x109E
-#define PCI_VENDOR_NEOMAGIC 0x10C8
-#define PCI_VENDOR_NVIDIA 0x10DE
-#define PCI_VENDOR_IMS 0x10E0
-#define PCI_VENDOR_INTEGRAPHICS 0x10EA
-#define PCI_VENDOR_ALLIANCE 0x1142
-#define PCI_VENDOR_RENDITION 0x1163
-#define PCI_VENDOR_3DFX 0x121A
-#define PCI_VENDOR_SMI 0x126F
-#define PCI_VENDOR_TRITECH 0x1292
-#define PCI_VENDOR_NVIDIA_SGS 0x12D2
-#define PCI_VENDOR_VMWARE 0x15AD
-#define PCI_VENDOR_3DLABS 0x3D3D
-#define PCI_VENDOR_AVANCE_2 0x4005
-#define PCI_VENDOR_HERCULES 0x4843
-#define PCI_VENDOR_S3 0x5333
-#define PCI_VENDOR_INTEL 0x8086
-#define PCI_VENDOR_ARK 0xEDD8
-
-
-/* Generic */
-#define PCI_CHIP_VGA 0x0000
-#define PCI_CHIP_8514 0x0001
-
-/* Real 3D */
-#define PCI_CHIP_I740_PCI 0x00D1
-
-/* Compaq */
-#define PCI_CHIP_QV1280 0x3033
-
-/* ATI */
-#define PCI_CHIP_RS100_4136 0x4136
-#define PCI_CHIP_RS200_4137 0x4137
-#define PCI_CHIP_R300_AD 0x4144
-#define PCI_CHIP_R300_AE 0x4145
-#define PCI_CHIP_R300_AF 0x4146
-#define PCI_CHIP_R300_AG 0x4147
-#define PCI_CHIP_R350_AH 0x4148
-#define PCI_CHIP_R350_AI 0x4149
-#define PCI_CHIP_R350_AJ 0x414A
-#define PCI_CHIP_R350_AK 0x414B
-#define PCI_CHIP_RV350_AP 0x4150
-#define PCI_CHIP_RV350_AQ 0x4151
-#define PCI_CHIP_RV360_AR 0x4152
-#define PCI_CHIP_RV350_AS 0x4153
-#define PCI_CHIP_RV350_AT 0x4154
-#define PCI_CHIP_RV350_AV 0x4156
-#define PCI_CHIP_MACH32 0x4158
-#define PCI_CHIP_RS250_4237 0x4237
-#define PCI_CHIP_R200_BB 0x4242
-#define PCI_CHIP_R200_BC 0x4243
-#define PCI_CHIP_RS100_4336 0x4336
-#define PCI_CHIP_RS200_4337 0x4337
-#define PCI_CHIP_MACH64CT 0x4354
-#define PCI_CHIP_MACH64CX 0x4358
-#define PCI_CHIP_RS250_4437 0x4437
-#define PCI_CHIP_MACH64ET 0x4554
-#define PCI_CHIP_MACH64GB 0x4742
-#define PCI_CHIP_MACH64GD 0x4744
-#define PCI_CHIP_MACH64GI 0x4749
-#define PCI_CHIP_MACH64GL 0x474C
-#define PCI_CHIP_MACH64GM 0x474D
-#define PCI_CHIP_MACH64GN 0x474E
-#define PCI_CHIP_MACH64GO 0x474F
-#define PCI_CHIP_MACH64GP 0x4750
-#define PCI_CHIP_MACH64GQ 0x4751
-#define PCI_CHIP_MACH64GR 0x4752
-#define PCI_CHIP_MACH64GS 0x4753
-#define PCI_CHIP_MACH64GT 0x4754
-#define PCI_CHIP_MACH64GU 0x4755
-#define PCI_CHIP_MACH64GV 0x4756
-#define PCI_CHIP_MACH64GW 0x4757
-#define PCI_CHIP_MACH64GX 0x4758
-#define PCI_CHIP_MACH64GY 0x4759
-#define PCI_CHIP_MACH64GZ 0x475A
-#define PCI_CHIP_RV250_Id 0x4964
-#define PCI_CHIP_RV250_Ie 0x4965
-#define PCI_CHIP_RV250_If 0x4966
-#define PCI_CHIP_RV250_Ig 0x4967
-#define PCI_CHIP_MACH64LB 0x4C42
-#define PCI_CHIP_MACH64LD 0x4C44
-#define PCI_CHIP_RAGE128LE 0x4C45
-#define PCI_CHIP_RAGE128LF 0x4C46
-#define PCI_CHIP_MACH64LG 0x4C47
-#define PCI_CHIP_MACH64LI 0x4C49
-#define PCI_CHIP_MACH64LM 0x4C4D
-#define PCI_CHIP_MACH64LN 0x4C4E
-#define PCI_CHIP_MACH64LP 0x4C50
-#define PCI_CHIP_MACH64LQ 0x4C51
-#define PCI_CHIP_MACH64LR 0x4C52
-#define PCI_CHIP_MACH64LS 0x4C53
-#define PCI_CHIP_RADEON_LW 0x4C57
-#define PCI_CHIP_RADEON_LX 0x4C58
-#define PCI_CHIP_RADEON_LY 0x4C59
-#define PCI_CHIP_RADEON_LZ 0x4C5A
-#define PCI_CHIP_RV250_Ld 0x4C64
-#define PCI_CHIP_RV250_Le 0x4C65
-#define PCI_CHIP_RV250_Lf 0x4C66
-#define PCI_CHIP_RV250_Lg 0x4C67
-#define PCI_CHIP_RV250_Ln 0x4C6E
-#define PCI_CHIP_RAGE128MF 0x4D46
-#define PCI_CHIP_RAGE128ML 0x4D4C
-#define PCI_CHIP_R300_ND 0x4E44
-#define PCI_CHIP_R300_NE 0x4E45
-#define PCI_CHIP_R300_NF 0x4E46
-#define PCI_CHIP_R300_NG 0x4E47
-#define PCI_CHIP_R350_NH 0x4E48
-#define PCI_CHIP_R350_NI 0x4E49
-#define PCI_CHIP_R360_NJ 0x4E4A
-#define PCI_CHIP_R350_NK 0x4E4B
-#define PCI_CHIP_RV350_NP 0x4E50
-#define PCI_CHIP_RV350_NQ 0x4E51
-#define PCI_CHIP_RV350_NR 0x4E52
-#define PCI_CHIP_RV350_NS 0x4E53
-#define PCI_CHIP_RV350_NT 0x4E54
-#define PCI_CHIP_RV350_NV 0x4E56
-#define PCI_CHIP_RAGE128PA 0x5041
-#define PCI_CHIP_RAGE128PB 0x5042
-#define PCI_CHIP_RAGE128PC 0x5043
-#define PCI_CHIP_RAGE128PD 0x5044
-#define PCI_CHIP_RAGE128PE 0x5045
-#define PCI_CHIP_RAGE128PF 0x5046
-#define PCI_CHIP_RAGE128PG 0x5047
-#define PCI_CHIP_RAGE128PH 0x5048
-#define PCI_CHIP_RAGE128PI 0x5049
-#define PCI_CHIP_RAGE128PJ 0x504A
-#define PCI_CHIP_RAGE128PK 0x504B
-#define PCI_CHIP_RAGE128PL 0x504C
-#define PCI_CHIP_RAGE128PM 0x504D
-#define PCI_CHIP_RAGE128PN 0x504E
-#define PCI_CHIP_RAGE128PO 0x504F
-#define PCI_CHIP_RAGE128PP 0x5050
-#define PCI_CHIP_RAGE128PQ 0x5051
-#define PCI_CHIP_RAGE128PR 0x5052
-#define PCI_CHIP_RAGE128PS 0x5053
-#define PCI_CHIP_RAGE128PT 0x5054
-#define PCI_CHIP_RAGE128PU 0x5055
-#define PCI_CHIP_RAGE128PV 0x5056
-#define PCI_CHIP_RAGE128PW 0x5057
-#define PCI_CHIP_RAGE128PX 0x5058
-#define PCI_CHIP_RADEON_QD 0x5144
-#define PCI_CHIP_RADEON_QE 0x5145
-#define PCI_CHIP_RADEON_QF 0x5146
-#define PCI_CHIP_RADEON_QG 0x5147
-#define PCI_CHIP_R200_QH 0x5148
-#define PCI_CHIP_R200_QI 0x5149
-#define PCI_CHIP_R200_QJ 0x514A
-#define PCI_CHIP_R200_QK 0x514B
-#define PCI_CHIP_R200_QL 0x514C
-#define PCI_CHIP_R200_QM 0x514D
-#define PCI_CHIP_R200_QN 0x514E
-#define PCI_CHIP_R200_QO 0x514F
-#define PCI_CHIP_RV200_QW 0x5157
-#define PCI_CHIP_RV200_QX 0x5158
-#define PCI_CHIP_RV100_QY 0x5159
-#define PCI_CHIP_RV100_QZ 0x515A
-#define PCI_CHIP_RAGE128RE 0x5245
-#define PCI_CHIP_RAGE128RF 0x5246
-#define PCI_CHIP_RAGE128RG 0x5247
-#define PCI_CHIP_RAGE128RK 0x524B
-#define PCI_CHIP_RAGE128RL 0x524C
-#define PCI_CHIP_RAGE128SE 0x5345
-#define PCI_CHIP_RAGE128SF 0x5346
-#define PCI_CHIP_RAGE128SG 0x5347
-#define PCI_CHIP_RAGE128SH 0x5348
-#define PCI_CHIP_RAGE128SK 0x534B
-#define PCI_CHIP_RAGE128SL 0x534C
-#define PCI_CHIP_RAGE128SM 0x534D
-#define PCI_CHIP_RAGE128SN 0x534E
-#define PCI_CHIP_RAGE128TF 0x5446
-#define PCI_CHIP_RAGE128TL 0x544C
-#define PCI_CHIP_RAGE128TR 0x5452
-#define PCI_CHIP_RAGE128TS 0x5453
-#define PCI_CHIP_RAGE128TT 0x5454
-#define PCI_CHIP_RAGE128TU 0x5455
-#define PCI_CHIP_MACH64VT 0x5654
-#define PCI_CHIP_MACH64VU 0x5655
-#define PCI_CHIP_MACH64VV 0x5656
-#define PCI_CHIP_RS300_5834 0x5834
-#define PCI_CHIP_RS300_5835 0x5835
-#define PCI_CHIP_RS300_5836 0x5836
-#define PCI_CHIP_RS300_5837 0x5837
-#define PCI_CHIP_RV280_5960 0x5960
-#define PCI_CHIP_RV280_5961 0x5961
-#define PCI_CHIP_RV280_5962 0x5962
-#define PCI_CHIP_RV280_5964 0x5964
-#define PCI_CHIP_RV280_5C61 0x5C61
-#define PCI_CHIP_RV280_5C63 0x5C63
-
-/* Avance Logic */
-#define PCI_CHIP_ALG2064 0x2064
-#define PCI_CHIP_ALG2301 0x2301
-#define PCI_CHIP_ALG2501 0x2501
-
-/* Tseng */
-#define PCI_CHIP_ET4000_W32P_A 0x3202
-#define PCI_CHIP_ET4000_W32P_B 0x3205
-#define PCI_CHIP_ET4000_W32P_D 0x3206
-#define PCI_CHIP_ET4000_W32P_C 0x3207
-#define PCI_CHIP_ET6000 0x3208
-#define PCI_CHIP_ET6300 0x4702
-
-/* Weitek */
-#define PCI_CHIP_P9000 0x9001
-#define PCI_CHIP_P9100 0x9100
-
-/* Digital */
-#define PCI_CHIP_DC21050 0x0001
-#define PCI_CHIP_DEC21030 0x0004
-#define PCI_CHIP_TGA2 0x000D
-
-/* Cirrus Logic */
-#define PCI_CHIP_GD7548 0x0038
-#define PCI_CHIP_GD7555 0x0040
-#define PCI_CHIP_GD5430 0x00A0
-#define PCI_CHIP_GD5434_4 0x00A4
-#define PCI_CHIP_GD5434_8 0x00A8
-#define PCI_CHIP_GD5436 0x00AC
-#define PCI_CHIP_GD5446 0x00B8
-#define PCI_CHIP_GD5480 0x00BC
-#define PCI_CHIP_GD5462 0x00D0
-#define PCI_CHIP_GD5464 0x00D4
-#define PCI_CHIP_GD5464BD 0x00D5
-#define PCI_CHIP_GD5465 0x00D6
-#define PCI_CHIP_6729 0x1100
-#define PCI_CHIP_6832 0x1110
-#define PCI_CHIP_GD7542 0x1200
-#define PCI_CHIP_GD7543 0x1202
-#define PCI_CHIP_GD7541 0x1204
-
-/* AMD */
-#define PCI_CHIP_AMD761 0x700E
-
-/* Trident */
-#define PCI_CHIP_2100 0x2100
-#define PCI_CHIP_8400 0x8400
-#define PCI_CHIP_8420 0x8420
-#define PCI_CHIP_8500 0x8500
-#define PCI_CHIP_8520 0x8520
-#define PCI_CHIP_8600 0x8600
-#define PCI_CHIP_8620 0x8620
-#define PCI_CHIP_8820 0x8820
-#define PCI_CHIP_9320 0x9320
-#define PCI_CHIP_9388 0x9388
-#define PCI_CHIP_9397 0x9397
-#define PCI_CHIP_939A 0x939A
-#define PCI_CHIP_9420 0x9420
-#define PCI_CHIP_9440 0x9440
-#define PCI_CHIP_9520 0x9520
-#define PCI_CHIP_9525 0x9525
-#define PCI_CHIP_9540 0x9540
-#define PCI_CHIP_9660 0x9660
-#define PCI_CHIP_9750 0x9750
-#define PCI_CHIP_9850 0x9850
-#define PCI_CHIP_9880 0x9880
-#define PCI_CHIP_9910 0x9910
-
-/* ALI */
-#define PCI_CHIP_M1435 0x1435
-
-/* Matrox */
-#define PCI_CHIP_MGA2085 0x0518
-#define PCI_CHIP_MGA2064 0x0519
-#define PCI_CHIP_MGA1064 0x051A
-#define PCI_CHIP_MGA2164 0x051B
-#define PCI_CHIP_MGA2164_AGP 0x051F
-#define PCI_CHIP_MGAG200_PCI 0x0520
-#define PCI_CHIP_MGAG200 0x0521
-#define PCI_CHIP_MGAG400 0x0525
-#define PCI_CHIP_MGAG550 0x2527
-#define PCI_CHIP_IMPRESSION 0x0D10
-#define PCI_CHIP_MGAG100_PCI 0x1000
-#define PCI_CHIP_MGAG100 0x1001
-
-#define PCI_CARD_G400_TH 0x2179
-#define PCI_CARD_MILL_G200_SD 0xFF00
-#define PCI_CARD_PROD_G100_SD 0xFF01
-#define PCI_CARD_MYST_G200_SD 0xFF02
-#define PCI_CARD_MILL_G200_SG 0xFF03
-#define PCI_CARD_MARV_G200_SD 0xFF04
-
-/* Chips & Tech */
-#define PCI_CHIP_65545 0x00D8
-#define PCI_CHIP_65548 0x00DC
-#define PCI_CHIP_65550 0x00E0
-#define PCI_CHIP_65554 0x00E4
-#define PCI_CHIP_65555 0x00E5
-#define PCI_CHIP_68554 0x00F4
-#define PCI_CHIP_69000 0x00C0
-#define PCI_CHIP_69030 0x0C30
-
-/* Miro */
-#define PCI_CHIP_ZR36050 0x5601
-
-/* NEC */
-#define PCI_CHIP_POWER_VR 0x0046
-
-/* SiS */
-#define PCI_CHIP_SG86C201 0x0001
-#define PCI_CHIP_SG86C202 0x0002
-#define PCI_CHIP_SG85C503 0x0008
-#define PCI_CHIP_SIS5597 0x0200
-/* Agregado por Carlos Duclos & Manuel Jander */
-#define PCI_CHIP_SIS82C204 0x0204
-#define PCI_CHIP_SG86C205 0x0205
-#define PCI_CHIP_SG86C215 0x0215
-#define PCI_CHIP_SG86C225 0x0225
-#define PCI_CHIP_85C501 0x0406
-#define PCI_CHIP_85C496 0x0496
-#define PCI_CHIP_85C601 0x0601
-#define PCI_CHIP_85C5107 0x5107
-#define PCI_CHIP_85C5511 0x5511
-#define PCI_CHIP_85C5513 0x5513
-#define PCI_CHIP_SIS5571 0x5571
-#define PCI_CHIP_SIS5597_2 0x5597
-#define PCI_CHIP_SIS530 0x6306
-#define PCI_CHIP_SIS6326 0x6326
-#define PCI_CHIP_SIS7001 0x7001
-#define PCI_CHIP_SIS300 0x0300
-#define PCI_CHIP_SIS315H 0x0310
-#define PCI_CHIP_SIS315PRO 0x0325
-#define PCI_CHIP_SIS330 0x0330
-#define PCI_CHIP_SIS630 0x6300
-#define PCI_CHIP_SIS540 0x5300
-#define PCI_CHIP_SIS550 0x5315
-#define PCI_CHIP_SIS650 0x6325
-#define PCI_CHIP_SIS730 0x7300
-
-/* Hewlett-Packard */
-#define PCI_CHIP_ELROY 0x1054
-#define PCI_CHIP_ZX1_SBA 0x1229
-#define PCI_CHIP_ZX1_IOC 0x122A
-#define PCI_CHIP_ZX1_LBA 0x122E /* a.k.a. Mercury */
-#define PCI_CHIP_ZX1_AGP8 0x12B4 /* a.k.a. QuickSilver */
-
-/* SGS */
-#define PCI_CHIP_STG2000 0x0008
-#define PCI_CHIP_STG1764 0x0009
-#define PCI_CHIP_KYROII 0x0010
-
-/* Texas Instruments */
-#define PCI_CHIP_TI_PERMEDIA 0x3D04
-#define PCI_CHIP_TI_PERMEDIA2 0x3D07
-
-/* Oak */
-#define PCI_CHIP_OTI107 0x0107
-
-/* Number Nine */
-#define PCI_CHIP_I128 0x2309
-#define PCI_CHIP_I128_2 0x2339
-#define PCI_CHIP_I128_T2R 0x493D
-#define PCI_CHIP_I128_T2R4 0x5348
-
-/* Sun */
-#define PCI_CHIP_EBUS 0x1000
-#define PCI_CHIP_HAPPY_MEAL 0x1001
-#define PCI_CHIP_SIMBA 0x5000
-#define PCI_CHIP_PSYCHO 0x8000
-#define PCI_CHIP_SCHIZO 0x8001
-#define PCI_CHIP_SABRE 0xA000
-#define PCI_CHIP_HUMMINGBIRD 0xA001
-
-/* BrookTree */
-#define PCI_CHIP_BT848 0x0350
-#define PCI_CHIP_BT849 0x0351
-
-/* NVIDIA */
-#define PCI_CHIP_NV1 0x0008
-#define PCI_CHIP_DAC64 0x0009
-#define PCI_CHIP_TNT 0x0020
-#define PCI_CHIP_TNT2 0x0028
-#define PCI_CHIP_UTNT2 0x0029
-#define PCI_CHIP_VTNT2 0x002C
-#define PCI_CHIP_UVTNT2 0x002D
-#define PCI_CHIP_ITNT2 0x00A0
-#define PCI_CHIP_GEFORCE_256 0x0100
-#define PCI_CHIP_GEFORCE_DDR 0x0101
-#define PCI_CHIP_QUADRO 0x0103
-#define PCI_CHIP_GEFORCE2_MX 0x0110
-#define PCI_CHIP_GEFORCE2_MX_100 0x0111
-#define PCI_CHIP_GEFORCE2_GO 0x0112
-#define PCI_CHIP_QUADRO2_MXR 0x0113
-#define PCI_CHIP_GEFORCE2_GTS 0x0150
-#define PCI_CHIP_GEFORCE2_TI 0x0151
-#define PCI_CHIP_GEFORCE2_ULTRA 0x0152
-#define PCI_CHIP_QUADRO2_PRO 0x0153
-#define PCI_CHIP_GEFORCE4_MX_460 0x0170
-#define PCI_CHIP_GEFORCE4_MX_440 0x0171
-#define PCI_CHIP_GEFORCE4_MX_420 0x0172
-#define PCI_CHIP_GEFORCE4_440_GO 0x0174
-#define PCI_CHIP_GEFORCE4_420_GO 0x0175
-#define PCI_CHIP_GEFORCE4_420_GO_M32 0x0176
-#define PCI_CHIP_QUADRO4_500XGL 0x0178
-#define PCI_CHIP_GEFORCE4_440_GO_M64 0x0179
-#define PCI_CHIP_QUADRO4_200 0x017A
-#define PCI_CHIP_QUADRO4_550XGL 0x017B
-#define PCI_CHIP_QUADRO4_500_GOGL 0x017C
-#define PCI_CHIP_IGEFORCE2 0x01A0
-#define PCI_CHIP_GEFORCE3 0x0200
-#define PCI_CHIP_GEFORCE3_TI_200 0x0201
-#define PCI_CHIP_GEFORCE3_TI_500 0x0202
-#define PCI_CHIP_QUADRO_DCC 0x0203
-#define PCI_CHIP_GEFORCE4_TI_4600 0x0250
-#define PCI_CHIP_GEFORCE4_TI_4400 0x0251
-#define PCI_CHIP_GEFORCE4_TI_4200 0x0253
-#define PCI_CHIP_QUADRO4_900XGL 0x0258
-#define PCI_CHIP_QUADRO4_750XGL 0x0259
-#define PCI_CHIP_QUADRO4_700XGL 0x025B
-
-/* NVIDIA & SGS */
-#define PCI_CHIP_RIVA128 0x0018
-
-/* IMS */
-#define PCI_CHIP_IMSTT128 0x9128
-#define PCI_CHIP_IMSTT3D 0x9135
-
-/* Alliance Semiconductor */
-#define PCI_CHIP_AP6410 0x3210
-#define PCI_CHIP_AP6422 0x6422
-#define PCI_CHIP_AT24 0x6424
-#define PCI_CHIP_AT3D 0x643D
-
-/* 3dfx Interactive */
-#define PCI_CHIP_VOODOO_GRAPHICS 0x0001
-#define PCI_CHIP_VOODOO2 0x0002
-#define PCI_CHIP_BANSHEE 0x0003
-#define PCI_CHIP_VOODOO3 0x0005
-#define PCI_CHIP_VOODOO5 0x0009
-
-#define PCI_CARD_VOODOO3_2000 0x0036
-#define PCI_CARD_VOODOO3_3000 0x003A
-
-/* Rendition */
-#define PCI_CHIP_V1000 0x0001
-#define PCI_CHIP_V2x00 0x2000
-
-/* 3Dlabs */
-#define PCI_CHIP_300SX 0x0001
-#define PCI_CHIP_500TX 0x0002
-#define PCI_CHIP_DELTA 0x0003
-#define PCI_CHIP_PERMEDIA 0x0004
-#define PCI_CHIP_MX 0x0006
-#define PCI_CHIP_PERMEDIA2 0x0007
-#define PCI_CHIP_GAMMA 0x0008
-#define PCI_CHIP_PERMEDIA2V 0x0009
-#define PCI_CHIP_PERMEDIA3 0x000A
-#define PCI_CHIP_PERMEDIA4 0x000C
-#define PCI_CHIP_R4 0x000D
-#define PCI_CHIP_GAMMA2 0x000E
-#define PCI_CHIP_R4ALT 0x0011
-
-/* S3 */
-#define PCI_CHIP_PLATO 0x0551
-#define PCI_CHIP_VIRGE 0x5631
-#define PCI_CHIP_TRIO 0x8811
-#define PCI_CHIP_AURORA64VP 0x8812
-#define PCI_CHIP_TRIO64UVP 0x8814
-#define PCI_CHIP_VIRGE_VX 0x883D
-#define PCI_CHIP_868 0x8880
-#define PCI_CHIP_928 0x88B0
-#define PCI_CHIP_864_0 0x88C0
-#define PCI_CHIP_864_1 0x88C1
-#define PCI_CHIP_964_0 0x88D0
-#define PCI_CHIP_964_1 0x88D1
-#define PCI_CHIP_968 0x88F0
-#define PCI_CHIP_TRIO64V2_DXGX 0x8901
-#define PCI_CHIP_PLATO_PX 0x8902
-#define PCI_CHIP_Trio3D 0x8904
-#define PCI_CHIP_Trio3D_2X 0x8A13
-#define PCI_CHIP_VIRGE_DXGX 0x8A01
-#define PCI_CHIP_VIRGE_GX2 0x8A10
-#define PCI_CHIP_SAVAGE3D 0x8A20
-#define PCI_CHIP_SAVAGE3D_MV 0x8A21
-#define PCI_CHIP_SAVAGE4 0x8A22
-#define PCI_CHIP_VIRGE_MX 0x8C01
-#define PCI_CHIP_VIRGE_MXPLUS 0x8C01
-#define PCI_CHIP_VIRGE_MXP 0x8C03
-#define PCI_CHIP_PROSAVAGE_PM 0x8A25
-#define PCI_CHIP_PROSAVAGE_KM 0x8A26
-#define PCI_CHIP_SAVAGE_MX_MV 0x8C10
-#define PCI_CHIP_SAVAGE_MX 0x8C11
-#define PCI_CHIP_SAVAGE_IX_MV 0x8C12
-#define PCI_CHIP_SAVAGE_IX 0x8C13
-#define PCI_CHIP_SAVAGE2000 0x9102
-
-/* ARK Logic */
-#define PCI_CHIP_1000PV 0xA091
-#define PCI_CHIP_2000PV 0xA099
-#define PCI_CHIP_2000MT 0xA0A1
-#define PCI_CHIP_2000MI 0xA0A9
-
-/* Tritech Microelectronics */
-#define PCI_CHIP_TR25202 0xFC02
-
-/* Neomagic */
-#define PCI_CHIP_NM2070 0x0001
-#define PCI_CHIP_NM2090 0x0002
-#define PCI_CHIP_NM2093 0x0003
-#define PCI_CHIP_NM2097 0x0083
-#define PCI_CHIP_NM2160 0x0004
-#define PCI_CHIP_NM2200 0x0005
-#define PCI_CHIP_NM2230 0x0025
-#define PCI_CHIP_NM2360 0x0006
-#define PCI_CHIP_NM2380 0x0016
-
-/* Intel */
-#define PCI_CHIP_I815_BRIDGE 0x1130
-#define PCI_CHIP_I815 0x1132
-#define PCI_CHIP_82801_P2P 0x244E
-#define PCI_CHIP_845_G_BRIDGE 0x2560
-#define PCI_CHIP_845_G 0x2562
-#define PCI_CHIP_I830_M_BRIDGE 0x3575
-#define PCI_CHIP_I830_M 0x3577
-#define PCI_CHIP_I810_BRIDGE 0x7120
-#define PCI_CHIP_I810 0x7121
-#define PCI_CHIP_I810_DC100_BRIDGE 0x7122
-#define PCI_CHIP_I810_DC100 0x7123
-#define PCI_CHIP_I810_E_BRIDGE 0x7124
-#define PCI_CHIP_I810_E 0x7125
-#define PCI_CHIP_I740_AGP 0x7800
-#define PCI_CHIP_460GX_PXB 0x84CB
-#define PCI_CHIP_460GX_SAC 0x84E0
-#define PCI_CHIP_460GX_GXB_2 0x84E2 /* PCI function 2 */
-#define PCI_CHIP_460GX_WXB 0x84E6
-#define PCI_CHIP_460GX_GXB_1 0x84EA /* PCI function 1 */
-
-/* Silicon Motion Inc. */
-#define PCI_CHIP_SMI910 0x0910
-#define PCI_CHIP_SMI810 0x0810
-#define PCI_CHIP_SMI820 0x0820
-#define PCI_CHIP_SMI710 0x0710
-#define PCI_CHIP_SMI712 0x0712
-#define PCI_CHIP_SMI720 0x0720
-#define PCI_CHIP_SMI731 0x0730
-
-/* VMware */
-#define PCI_CHIP_VMWARE0405 0x0405
-#define PCI_CHIP_VMWARE0710 0x0710
-
-#endif /* _XF86_PCIINFO_H */
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
deleted file mode 100644
index a46bfc39b..000000000
--- a/hw/xfree86/common/xf86Priv.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.82 2003/09/09 03:20:36 dawes Exp $ */
-
-/*
- * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains declarations for private XFree86 functions and variables,
- * and definitions of private macros.
- *
- * "private" means not available to video drivers.
- */
-
-#ifndef _XF86PRIV_H
-#define _XF86PRIV_H
-
-#include "xf86Privstr.h"
-#include "propertyst.h"
-
-/*
- * Parameters set ONLY from the command line options
- * The global state of these things is held in xf86InfoRec (when appropriate).
- */
-extern const char *xf86ConfigFile;
-extern Bool xf86AllowMouseOpenFail;
-#ifdef XF86VIDMODE
-extern Bool xf86VidModeDisabled;
-extern Bool xf86VidModeAllowNonLocal;
-#endif
-#ifdef XF86MISC
-extern Bool xf86MiscModInDevDisabled;
-extern Bool xf86MiscModInDevAllowNonLocal;
-#endif
-extern Bool xf86fpFlag;
-extern Bool xf86coFlag;
-extern Bool xf86sFlag;
-extern Bool xf86bsEnableFlag;
-extern Bool xf86bsDisableFlag;
-extern Bool xf86silkenMouseDisableFlag;
-extern char *xf86LayoutName;
-extern char *xf86ScreenName;
-extern char *xf86PointerName;
-extern char *xf86KeyboardName;
-#ifdef KEEPBPP
-extern int xf86Bpp;
-#endif
-extern int xf86FbBpp;
-extern int xf86Depth;
-extern Pix24Flags xf86Pix24;
-extern rgb xf86Weight;
-extern Bool xf86FlipPixels;
-extern Bool xf86BestRefresh;
-extern Gamma xf86Gamma;
-extern char *xf86ServerName;
-extern Bool xf86ShowUnresolved;
-
-/* Other parameters */
-
-extern xf86InfoRec xf86Info;
-extern const char *xf86InputDeviceList;
-extern const char *xf86ModulePath;
-extern MessageType xf86ModPathFrom;
-extern const char *xf86LogFile;
-extern MessageType xf86LogFileFrom;
-extern Bool xf86LogFileWasOpened;
-extern serverLayoutRec xf86ConfigLayout;
-extern Pix24Flags xf86ConfigPix24;
-
-extern unsigned short xf86MouseCflags[];
-extern Bool xf86SupportedMouseTypes[];
-extern int xf86NumMouseTypes;
-
-#ifdef XFree86LOADER
-extern DriverPtr *xf86DriverList;
-extern ModuleInfoPtr *xf86ModuleInfoList;
-extern int xf86NumModuleInfos;
-#else
-extern DriverPtr xf86DriverList[];
-#endif
-extern int xf86NumDrivers;
-extern Bool xf86Resetting;
-extern Bool xf86Initialising;
-extern Bool xf86ProbeFailed;
-extern int xf86NumScreens;
-extern pciVideoPtr *xf86PciVideoInfo;
-extern xf86CurrentAccessRec xf86CurrentAccess;
-extern const char *xf86VisualNames[];
-extern int xf86Verbose; /* verbosity level */
-extern int xf86LogVerbose; /* log file verbosity level */
-extern Bool xf86ProbeOnly;
-extern Bool xf86DoProbe;
-
-#ifndef DEFAULT_VERBOSE
-#define DEFAULT_VERBOSE 0
-#endif
-#ifndef DEFAULT_LOG_VERBOSE
-#define DEFAULT_LOG_VERBOSE 3
-#endif
-#ifndef DEFAULT_DPI
-#define DEFAULT_DPI 75
-#endif
-
-#define DEFAULT_UNRESOLVED TRUE
-#define DEFAULT_BEST_REFRESH FALSE
-
-/* Function Prototypes */
-#ifndef _NO_XF86_PROTOTYPES
-
-/* xf86Beta.c */
-extern void xf86CheckBeta(int extraDays, char *key);
-
-/* xf86Bus.c */
-
-void xf86BusProbe(void);
-void xf86ChangeBusIndex(int oldIndex, int newIndex);
-void xf86AccessInit(void);
-void xf86AccessEnter(void);
-void xf86AccessLeave(void);
-void xf86EntityInit(void);
-void xf86EntityEnter(void);
-void xf86EntityLeave(void);
-void xf86AccessLeaveState(void);
-
-void xf86FindPrimaryDevice(void);
-/* new RAC */
-void xf86ResourceBrokerInit(void);
-void xf86PostProbe(void);
-void xf86ClearEntityListForScreen(int scrnIndex);
-void xf86AddDevToEntity(int entityIndex, GDevPtr dev);
-extern void xf86PostPreInit(void);
-extern void xf86PostScreenInit(void);
-extern memType getValidBIOSBase(PCITAG tag, int num);
-extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag);
-
-/* xf86Config.c */
-
-Bool xf86PathIsAbsolute(const char *path);
-Bool xf86PathIsSafe(const char *path);
-
-/* xf86DefaultModes */
-
-extern DisplayModeRec xf86DefaultModes [];
-
-/* xf86DoScanPci.c */
-
-void DoScanPci(int argc, char **argv, int i);
-
-/* xf86DoProbe.c */
-void DoProbeArgs(int argc, char **argv, int i);
-void DoProbe(void);
-void DoConfigure(void);
-
-/* xf86Events.c */
-
-void xf86PostKbdEvent(unsigned key);
-void xf86PostMseEvent(DeviceIntPtr device, int buttons, int dx, int dy);
-void xf86Wakeup(pointer blockData, int err, pointer pReadmask);
-void xf86SigHandler(int signo);
-#ifdef MEMDEBUG
-void xf86SigMemDebug(int signo);
-#endif
-void xf86HandlePMEvents(int fd, pointer data);
-extern int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num);
-extern pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event);
-void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer);
-
-/* xf86Helper.c */
-void xf86LogInit(void);
-void xf86CloseLog(void);
-
-/* xf86Init.c */
-Bool xf86LoadModules(char **list, pointer *optlist);
-int xf86SetVerbosity(int verb);
-int xf86SetLogVerbosity(int verb);
-
-/* xf86Io.c */
-
-void xf86KbdBell(int percent, DeviceIntPtr pKeyboard, pointer ctrl,
- int unused);
-void xf86KbdLeds(void);
-void xf86UpdateKbdLeds(void);
-void xf86KbdCtrl(DevicePtr pKeyboard, KeybdCtrl *ctrl);
-void xf86InitKBD(Bool init);
-int xf86KbdProc(DeviceIntPtr pKeyboard, int what);
-
-/* xf86Kbd.c */
-
-void xf86KbdGetMapping(KeySymsPtr pKeySyms, CARD8 *pModMap);
-
-/* xf86Lock.c */
-
-#ifdef USE_XF86_SERVERLOCK
-void xf86UnlockServer(void);
-#endif
-
-/* xf86XKB.c */
-
-void xf86InitXkb(void);
-
-#endif /* _NO_XF86_PROTOTYPES */
-
-
-#endif /* _XF86PRIV_H */
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
deleted file mode 100644
index 8b0a0f4ce..000000000
--- a/hw/xfree86/common/xf86Privstr.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.40 2003/10/17 20:02:12 alanh Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains definitions of the private XFree86 data structures/types.
- * None of the data structures here should be used by video drivers.
- */
-
-#ifndef _XF86PRIVSTR_H
-#define _XF86PRIVSTR_H
-
-#include "xf86Pci.h"
-#include "xf86str.h"
-
-/* PCI probe flags */
-
-typedef enum {
- PCIProbe1 = 0,
- PCIProbe2,
- PCIForceConfig1,
- PCIForceConfig2,
- PCIForceNone,
- PCIOsConfig
-} PciProbeType;
-
-typedef enum {
- LogNone,
- LogFlush,
- LogSync
-} Log;
-
-typedef enum {
- SKNever,
- SKWhenNeeded,
- SKAlways
-} SpecialKeysInDDX;
-
-/*
- * xf86InfoRec contains global parameters which the video drivers never
- * need to access. Global parameters which the video drivers do need
- * should be individual globals.
- */
-
-typedef struct {
-
- /* keyboard part */
- DeviceIntPtr pKeyboard;
- DeviceProc kbdProc; /* procedure for initializing */
- void (* kbdEvents)(void); /* proc for processing events */
- int consoleFd;
- int kbdFd;
- int vtno;
- int kbdType; /* AT84 / AT101 */
- int kbdRate;
- int kbdDelay;
- int bell_pitch;
- int bell_duration;
- Bool autoRepeat;
- unsigned long leds;
- unsigned long xleds;
- char * vtinit;
- int scanPrefix; /* scancode-state */
- Bool capsLock;
- Bool numLock;
- Bool scrollLock;
- Bool modeSwitchLock;
- Bool composeLock;
- Bool vtSysreq;
- SpecialKeysInDDX ddxSpecialKeys;
- Bool ActionKeyBindingsSet;
-#if defined(SVR4) && defined(i386)
- Bool panix106;
-#endif /* SVR4 && i386 */
-#if defined(__OpenBSD__) || defined(__NetBSD__)
- int wsKbdType;
-#endif
-
- /* mouse part */
- DeviceIntPtr pMouse;
-#ifdef XINPUT
- pointer mouseLocal;
-#endif
-
- /* event handler part */
- int lastEventTime;
- Bool vtRequestsPending;
- Bool inputPending;
- Bool dontVTSwitch;
- Bool dontZap;
- Bool dontZoom;
- Bool notrapSignals; /* don't exit cleanly - die at fault */
- Bool caughtSignal;
-
- /* graphics part */
- Bool sharedMonitor;
- ScreenPtr currentScreen;
-#ifdef CSRG_BASED
- int screenFd; /* fd for memory mapped access to
- * vga card */
- int consType; /* Which console driver? */
-#endif
-
-#ifdef XKB
- /*
- * would like to use an XkbComponentNamesRec here but can't without
- * pulling in a bunch of header files. :-(
- */
- char * xkbkeymap;
- char * xkbkeycodes;
- char * xkbtypes;
- char * xkbcompat;
- char * xkbsymbols;
- char * xkbgeometry;
- Bool xkbcomponents_specified;
- char * xkbrules;
- char * xkbmodel;
- char * xkblayout;
- char * xkbvariant;
- char * xkboptions;
-#endif
-
- /* Other things */
- Bool allowMouseOpenFail;
- Bool vidModeEnabled; /* VidMode extension enabled */
- Bool vidModeAllowNonLocal; /* allow non-local VidMode
- * connections */
- Bool miscModInDevEnabled; /* Allow input devices to be
- * changed */
- Bool miscModInDevAllowNonLocal;
- PciProbeType pciFlags;
- Pix24Flags pixmap24;
- MessageType pix24From;
-#if defined(i386) || defined(__i386__)
- Bool pc98;
-#endif
- Bool pmFlag;
- Log log;
- int estimateSizesAggressively;
- Bool kbdCustomKeycodes;
- Bool disableRandR;
- MessageType randRFrom;
- struct {
- Bool disabled; /* enable/disable deactivating
- * grabs or closing the
- * connection to the grabbing
- * client */
- ClientPtr override; /* client that disabled
- * grab deactivation.
- */
- Bool allowDeactivate;
- Bool allowClosedown;
- ServerGrabInfoRec server;
- } grabInfo;
-} xf86InfoRec, *xf86InfoPtr;
-
-#ifdef DPMSExtension
-/* Private info for DPMS */
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- Bool Enabled;
- int Flags;
-} DPMSRec, *DPMSPtr;
-#endif
-
-#ifdef XF86VIDMODE
-/* Private info for Video Mode Extentsion */
-typedef struct {
- DisplayModePtr First;
- DisplayModePtr Next;
- int Flags;
- CloseScreenProcPtr CloseScreen;
-} VidModeRec, *VidModePtr;
-#endif
-
-/* private resource types */
-#define ResNoAvoid ResBios
-
-/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
-#define XLED1 ((unsigned long) 0x00000001)
-#define XLED2 ((unsigned long) 0x00000002)
-#define XLED3 ((unsigned long) 0x00000004)
-#define XLED4 ((unsigned long) 0x00000008)
-#define XCAPS ((unsigned long) 0x20000000)
-#define XNUM ((unsigned long) 0x40000000)
-#define XSCR ((unsigned long) 0x80000000)
-#define XCOMP ((unsigned long) 0x00008000)
-
-/* BSD console driver types (consType) */
-#ifdef CSRG_BASED
-#define PCCONS 0
-#define CODRV011 1
-#define CODRV01X 2
-#define SYSCONS 8
-#define PCVT 16
-#define WSCONS 32
-#endif
-
-#endif /* _XF86PRIVSTR_H */
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
deleted file mode 100644
index 546c909ff..000000000
--- a/hw/xfree86/common/xf86RandR.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.8 2003/11/10 16:42:13 tsi Exp $
- *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "X.h"
-#include "os.h"
-#include "mibank.h"
-#include "globals.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86DDC.h"
-#include "mipointer.h"
-#include <randrstr.h>
-
-typedef struct _xf86RandRInfo {
- CreateScreenResourcesProcPtr CreateScreenResources;
- CloseScreenProcPtr CloseScreen;
- int virtualX;
- int virtualY;
-} XF86RandRInfoRec, *XF86RandRInfoPtr;
-
-static int xf86RandRIndex;
-static int xf86RandRGeneration;
-
-#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandRIndex].ptr)
-
-static int
-xf86RandRModeRefresh (DisplayModePtr mode)
-{
- if (mode->VRefresh)
- return (int) (mode->VRefresh + 0.5);
- else
- return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
-}
-
-static Bool
-xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
-{
- RRScreenSizePtr pSize;
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
- XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
- DisplayModePtr mode;
- int refresh0 = 60;
-
- *rotations = RR_Rotate_0;
-
- for (mode = scrp->modes; ; mode = mode->next)
- {
- int refresh = xf86RandRModeRefresh (mode);
- if (mode == scrp->modes)
- refresh0 = refresh;
- pSize = RRRegisterSize (pScreen,
- mode->HDisplay, mode->VDisplay,
- pScreen->mmWidth, pScreen->mmHeight);
- if (!pSize)
- return FALSE;
- RRRegisterRate (pScreen, pSize, refresh);
- if (mode == scrp->currentMode &&
- mode->HDisplay == pScreen->width && mode->VDisplay == pScreen->height)
- RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh, pSize);
- if (mode->next == scrp->modes)
- break;
- }
- if (scrp->currentMode->HDisplay != randrp->virtualX ||
- scrp->currentMode->VDisplay != randrp->virtualY)
- {
- mode = scrp->modes;
- pSize = RRRegisterSize (pScreen,
- randrp->virtualX, randrp->virtualY,
- pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay,
- pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay);
- if (!pSize)
- return FALSE;
- RRRegisterRate (pScreen, pSize, refresh0);
- if (pScreen->width == randrp->virtualX &&
- pScreen->height == randrp->virtualY)
- {
- RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh0, pSize);
- }
- }
- return TRUE;
-}
-
-static Bool
-xf86RandRSetMode (ScreenPtr pScreen,
- DisplayModePtr mode,
- Bool useVirtual)
-{
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
- XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
- int oldWidth = pScreen->width;
- int oldHeight = pScreen->height;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
-
- if (pRoot)
- xf86EnableDisableFBAccess (pScreen->myNum, FALSE);
- if (useVirtual)
- {
- scrp->virtualX = randrp->virtualX;
- scrp->virtualY = randrp->virtualY;
- }
- else
- {
- scrp->virtualX = mode->HDisplay;
- scrp->virtualY = mode->VDisplay;
- }
- pScreen->width = scrp->virtualX;
- pScreen->height = scrp->virtualY;
- if (!xf86SwitchMode (pScreen, mode))
- {
- scrp->virtualX = pScreen->width = oldWidth;
- scrp->virtualY = pScreen->height = oldHeight;
- return FALSE;
- }
- /*
- * Make sure the layout is correct
- */
- xf86ReconfigureLayout();
-
- /*
- * Make sure the whole screen is visible
- */
- xf86SetViewport (pScreen, pScreen->width, pScreen->height);
- xf86SetViewport (pScreen, 0, 0);
- if (pRoot)
- xf86EnableDisableFBAccess (pScreen->myNum, TRUE);
- return TRUE;
-}
-
-static Bool
-xf86RandRSetConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize)
-{
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
- XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
- DisplayModePtr mode;
- int px, py;
- Bool useVirtual = FALSE;
-
- miPointerPosition (&px, &py);
- for (mode = scrp->modes; ; mode = mode->next)
- {
- if (mode->HDisplay == pSize->width &&
- mode->VDisplay == pSize->height &&
- (rate == 0 || xf86RandRModeRefresh (mode) == rate))
- break;
- if (mode->next == scrp->modes)
- {
- if (pSize->width == randrp->virtualX &&
- pSize->height == randrp->virtualY)
- {
- mode = scrp->modes;
- useVirtual = TRUE;
- break;
- }
- return FALSE;
- }
- }
- if (!xf86RandRSetMode (pScreen, mode, useVirtual))
- return FALSE;
- /*
- * Move the cursor back where it belongs; SwitchMode repositions it
- */
- if (pScreen == miPointerCurrentScreen ())
- {
- if (px < pSize->width && py < pSize->height)
- (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE);
- }
- return TRUE;
-}
-
-/*
- * Wait until the screen is initialized before whacking the
- * sizes around; otherwise the screen pixmap will be allocated
- * at the current mode size rather than the maximum size
- */
-static Bool
-xf86RandRCreateScreenResources (ScreenPtr pScreen)
-{
- XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
-#if 0
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
- DisplayModePtr mode;
-#endif
-
- pScreen->CreateScreenResources = randrp->CreateScreenResources;
- if (!(*pScreen->CreateScreenResources) (pScreen))
- return FALSE;
-
-#if 0
- mode = scrp->currentMode;
- if (mode)
- xf86RandRSetMode (pScreen, mode, TRUE);
-#endif
-
- return TRUE;
-}
-
-/*
- * Reset size back to original
- */
-static Bool
-xf86RandRCloseScreen (int index, ScreenPtr pScreen)
-{
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
- XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
-
- scrp->virtualX = pScreen->width = randrp->virtualX;
- scrp->virtualY = pScreen->height = randrp->virtualY;
- scrp->currentMode = scrp->modes;
- pScreen->CloseScreen = randrp->CloseScreen;
- xfree (randrp);
- pScreen->devPrivates[xf86RandRIndex].ptr = 0;
- return (*pScreen->CloseScreen) (index, pScreen);
-}
-
-Bool
-xf86RandRInit (ScreenPtr pScreen)
-{
- rrScrPrivPtr rp;
- XF86RandRInfoPtr randrp;
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
-
-#ifdef PANORAMIX
- /* XXX disable RandR when using Xinerama */
- if (!noPanoramiXExtension)
- return TRUE;
-#endif
- if (xf86RandRGeneration != serverGeneration)
- {
- xf86RandRIndex = AllocateScreenPrivateIndex();
- xf86RandRGeneration = serverGeneration;
- }
-
- randrp = xalloc (sizeof (XF86RandRInfoRec));
- if (!randrp)
- return FALSE;
-
- if (!RRScreenInit (pScreen))
- {
- xfree (randrp);
- return FALSE;
- }
- rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = xf86RandRGetInfo;
- rp->rrSetConfig = xf86RandRSetConfig;
-
- randrp->virtualX = scrp->virtualX;
- randrp->virtualY = scrp->virtualY;
-
- randrp->CreateScreenResources = pScreen->CreateScreenResources;
- pScreen->CreateScreenResources = xf86RandRCreateScreenResources;
-
- randrp->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = xf86RandRCloseScreen;
-
- pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
- return TRUE;
-}
diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h
deleted file mode 100644
index ce2c62bb3..000000000
--- a/hw/xfree86/common/xf86Resources.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.15 2003/08/24 17:36:55 dawes Exp $ */
-
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86_RESOURCES_H
-
-#define _XF86_RESOURCES_H
-
-#include "xf86str.h"
-
-#define _END {ResEnd,0,0}
-
-#define _VGA_EXCLUSIVE \
- {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResExcIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
- {ResExcIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
-
-#define _VGA_SHARED \
- {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
- {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
-
-#define _VGA_SHARED_MEM \
- {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}
-
-#define _VGA_SHARED_IO \
- {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
- {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
-
-/*
- * Exclusive unused VGA: resources unneeded but cannot be disabled.
- * Like old Millennium.
- */
-#define _VGA_EXCLUSIVE_UNUSED \
- {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResExcUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
- {ResExcUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
-
-/*
- * Shared unused VGA: resources unneeded but cannot be disabled
- * independently. This is used to determine if a device needs RAC.
- */
-#define _VGA_SHARED_UNUSED \
- {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResShrUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
- {ResShrUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
-
-/*
- * Sparse versions of the above for those adapters that respond to all ISA
- * aliases of VGA ports.
- */
-#define _VGA_EXCLUSIVE_SPARSE \
- {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResExcIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\
- {ResExcIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\
- {ResExcIoSparse | ResBios | ResBus, 0x03C0, 0x03E0}
-
-#define _VGA_SHARED_SPARSE \
- {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
- {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
- {ResShrIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\
- {ResShrIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\
- {ResShrIoSparse | ResBios | ResBus, 0x03C0, 0x03E0}
-
-#define _8514_EXCLUSIVE \
- {ResExcIoSparse | ResBios | ResBus, 0x02E8, 0x03F8}
-
-#define _8514_SHARED \
- {ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8}
-
-/* Predefined resources */
-extern resRange resVgaExclusive[];
-extern resRange resVgaShared[];
-extern resRange resVgaIoShared[];
-extern resRange resVgaMemShared[];
-extern resRange resVgaUnusedExclusive[];
-extern resRange resVgaUnusedShared[];
-extern resRange resVgaSparseExclusive[];
-extern resRange resVgaSparseShared[];
-extern resRange res8514Exclusive[];
-extern resRange res8514Shared[];
-
-/* Less misleading aliases for xf86SetOperatingState() */
-#define resVgaMem resVgaMemShared
-#define resVgaIo resVgaIoShared
-#define resVga resVgaShared
-
-/* Old style names */
-#define RES_EXCLUSIVE_VGA resVgaExclusive
-#define RES_SHARED_VGA resVgaShared
-#define RES_EXCLUSIVE_8514 res8514Exclusive
-#define RES_SHARED_8514 res8514Shared
-
-#define _PCI_AVOID_PC_STYLE \
- {ResExcIoSparse | ResBus, 0x0100, 0x0300},\
- {ResExcIoSparse | ResBus, 0x0200, 0x0200},\
- {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF}
-
-extern resRange PciAvoid[];
-
-#define RES_UNDEFINED NULL
-#endif
diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h
deleted file mode 100644
index 07253bace..000000000
--- a/hw/xfree86/common/xf86Version.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.563 2003/11/21 06:01:44 dawes Exp $ */
-
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef XF86_VERSION_CURRENT
-
-#define XF86_VERSION_MAJOR 4
-#define XF86_VERSION_MINOR 3
-#define XF86_VERSION_PATCH 99
-#define XF86_VERSION_SNAP 16
-
-/* This has five arguments for compatibilty reasons */
-#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \
- (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap)
-
-#define XF86_GET_MAJOR_VERSION(vers) ((vers) / 10000000)
-#define XF86_GET_MINOR_VERSION(vers) (((vers) % 10000000) / 100000)
-#define XF86_GET_PATCH_VERSION(vers) (((vers) % 100000) / 1000)
-#define XF86_GET_SNAP_VERSION(vers) ((vers) % 1000)
-
-/* Define these for compatibility. They'll be removed at some point. */
-#define XF86_VERSION_SUBMINOR XF86_VERSION_PATCH
-#define XF86_VERSION_BETA 0
-#define XF86_VERSION_ALPHA XF86_VERSION_SNAP
-
-#define XF86_VERSION_CURRENT \
- XF86_VERSION_NUMERIC(XF86_VERSION_MAJOR, \
- XF86_VERSION_MINOR, \
- XF86_VERSION_PATCH, \
- XF86_VERSION_SNAP, \
- 0)
-
-#endif
-
-/* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */
diff --git a/hw/xfree86/common/xf86Versions.c b/hw/xfree86/common/xf86Versions.c
deleted file mode 100644
index 7b20ef9ab..000000000
--- a/hw/xfree86/common/xf86Versions.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Versions.c,v 1.2 2003/08/24 20:01:19 dawes Exp $ */
-/*
- * Copyright (c) 2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "xf86.h"
-#include "xf86OSmouse.h"
-#include "xf86OSKbd.h"
-
-static CARD32 registeredVersions[NUM_BUILTIN_IFS];
-
-CARD32
-xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flags)
-{
- if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
- xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: Unexpected interface"
- "query: %d\n", iface);
- return 0;
- }
-
- if (registeredVersions[iface])
- return registeredVersions[iface];
-
- /* Most built-in interfaces are handled this way. */
- switch (iface) {
- case BUILTIN_IF_OSMOUSE:
- return OS_MOUSE_VERSION_CURRENT;
- case BUILTIN_IF_OSKBD:
- return OS_KBD_VERSION_CURRENT;
- default:
- xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: internal error: "
- "interface %d not handled\n", iface);
- return 0;
- }
-}
-
-Bool
-xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, CARD32 version,
- int flags)
-{
- if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
- xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
- "unexpected interface number: %d\n", iface);
- return FALSE;
- }
- if (version == 0) {
- xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
- "versions must be greater than zero\n");
- return FALSE;
- }
- registeredVersions[iface] = version;
- return TRUE;
-}
-
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
deleted file mode 100644
index 467270e10..000000000
--- a/hw/xfree86/common/xf86VidMode.c
+++ /dev/null
@@ -1,718 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.17 2003/08/24 17:36:55 dawes Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the VidMode functions required by the extension.
- * These have been added to avoid the need for the higher level extension
- * code to access the private XFree86 data structures directly. Wherever
- * possible this code uses the functions in xf86Mode.c to do the work,
- * so that two version of code that do similar things don't have to be
- * maintained.
- */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#ifdef XF86VIDMODE
-#include "vidmodeproc.h"
-#include "xf86cmap.h"
-
-static int VidModeGeneration = 0;
-static int VidModeIndex = -1;
-static int VidModeCount = 0;
-static Bool VidModeClose(int i, ScreenPtr pScreen);
-
-#define VMPTR(p) ((VidModePtr)(p)->devPrivates[VidModeIndex].ptr)
-
-#endif
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-Bool
-VidModeExtensionInit(ScreenPtr pScreen)
-{
-#ifdef XF86VIDMODE
- VidModePtr pVidMode;
-
- DEBUG_P("VidModeExtensionInit");
-
- if (!xf86GetVidModeEnabled()) {
- DEBUG_P("!xf86GetVidModeEnabled()");
- return FALSE;
- }
-
- if (serverGeneration != VidModeGeneration) {
- if ((VidModeIndex = AllocateScreenPrivateIndex()) < 0) {
- DEBUG_P("AllocateScreenPrivateIndex() failed");
- return FALSE;
- }
- VidModeGeneration = serverGeneration;
- }
-
- if (!(pScreen->devPrivates[VidModeIndex].ptr = xcalloc(sizeof(VidModeRec), 1))) {
- DEBUG_P("xcalloc failed");
- return FALSE;
- }
-
- pVidMode = VMPTR(pScreen);
- pVidMode->Flags = 0;
- pVidMode->Next = NULL;
- pVidMode->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = VidModeClose;
- VidModeCount++;
- return TRUE;
-#else
- DEBUG_P("no vidmode extension");
- return FALSE;
-#endif
-}
-
-
-#ifdef XF86VIDMODE
-
-static Bool
-VidModeClose(int i, ScreenPtr pScreen)
-{
- VidModePtr pVidMode = VMPTR(pScreen);
-
- DEBUG_P("VidModeClose");
-
- /* This shouldn't happen */
- if (!pVidMode)
- return FALSE;
-
- pScreen->CloseScreen = pVidMode->CloseScreen;
-
- if (--VidModeCount == 0) {
- if (pScreen->devPrivates[VidModeIndex].ptr)
- xfree(pScreen->devPrivates[VidModeIndex].ptr);
- pScreen->devPrivates[VidModeIndex].ptr = NULL;
- VidModeIndex = -1;
- }
- return pScreen->CloseScreen(i, pScreen);
-}
-
-Bool
-VidModeAvailable(int scrnIndex)
-{
- ScrnInfoPtr pScrn;
- VidModePtr pVidMode;
-
- DEBUG_P("VidModeAvailable");
-
- if (VidModeIndex < 0) {
- DEBUG_P("VidModeIndex < 0");
- return FALSE;
- }
-
- pScrn = xf86Screens[scrnIndex];
- if (pScrn == NULL) {
- DEBUG_P("pScrn == NULL");
- return FALSE;
- }
-
- pVidMode = VMPTR(pScrn->pScreen);
- if (pVidMode)
- return TRUE;
- else {
- DEBUG_P("pVidMode == NULL");
- return FALSE;
- }
-}
-
-Bool
-VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetCurrentModeline");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- *mode = (pointer)(pScrn->currentMode);
- *dotClock = pScrn->currentMode->Clock;
-
- return TRUE;
-}
-
-int
-VidModeGetDotClock(int scrnIndex, int Clock)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetDotClock");
-
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- pScrn = xf86Screens[scrnIndex];
- if ((pScrn->progClock) || (Clock > MAXCLOCKS))
- return Clock;
- else
- return pScrn->clock[Clock];
-}
-
-int
-VidModeGetNumOfClocks(int scrnIndex, Bool *progClock)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetNumOfClocks");
-
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- pScrn = xf86Screens[scrnIndex];
- if (pScrn->progClock){
- *progClock = TRUE;
- return 0;
- } else {
- *progClock = FALSE;
- return pScrn->numClocks;
- }
-}
-
-Bool
-VidModeGetClocks(int scrnIndex, int *Clocks)
-{
- ScrnInfoPtr pScrn;
- int i;
-
- DEBUG_P("VidModeGetClocks");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
-
- if (pScrn->progClock)
- return FALSE;
-
- for (i = 0; i < pScrn->numClocks; i++)
- *Clocks++ = pScrn->clock[i];
-
- return TRUE;
-}
-
-
-Bool
-VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
-{
- ScrnInfoPtr pScrn;
- VidModePtr pVidMode;
-
- DEBUG_P("VidModeGetFirstModeline");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- pVidMode = VMPTR(pScrn->pScreen);
- pVidMode->First = pScrn->modes;
- pVidMode->Next = pVidMode->First->next;
-
- if (pVidMode->First->status == MODE_OK) {
- *mode = (pointer)(pVidMode->First);
- *dotClock = VidModeGetDotClock(scrnIndex, pVidMode->First->Clock);
- return TRUE;
- }
-
- return VidModeGetNextModeline(scrnIndex, mode, dotClock);
-}
-
-Bool
-VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock)
-{
- ScrnInfoPtr pScrn;
- VidModePtr pVidMode;
- DisplayModePtr p;
-
- DEBUG_P("VidModeGetNextModeline");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- pVidMode = VMPTR(pScrn->pScreen);
-
- for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) {
- if (p->status == MODE_OK) {
- pVidMode->Next = p->next;
- *mode = (pointer)p;
- *dotClock = VidModeGetDotClock(scrnIndex, p->Clock);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-Bool
-VidModeDeleteModeline(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeDeleteModeline");
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86DeleteMode(&(pScrn->modes), (DisplayModePtr)mode);
- return TRUE;
-}
-
-Bool
-VidModeZoomViewport(int scrnIndex, int zoom)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeZoomViewPort");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86ZoomViewport(pScrn->pScreen, zoom);
- return TRUE;
-}
-
-Bool
-VidModeSetViewPort(int scrnIndex, int x, int y)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeSetViewPort");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- pScrn->frameX0 = min( max(x, 0),
- pScrn->virtualX - pScrn->currentMode->HDisplay );
- pScrn->frameX1 = pScrn->frameX0 + pScrn->currentMode->HDisplay - 1;
- pScrn->frameY0 = min( max(y, 0),
- pScrn->virtualY - pScrn->currentMode->VDisplay );
- pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1;
- if (pScrn->AdjustFrame != NULL)
- (pScrn->AdjustFrame)(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-
- return TRUE;
-}
-
-Bool
-VidModeGetViewPort(int scrnIndex, int *x, int *y)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetViewPort");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- *x = pScrn->frameX0;
- *y = pScrn->frameY0;
- return TRUE;
-}
-
-Bool
-VidModeSwitchMode(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
- DisplayModePtr pTmpMode;
- Bool retval;
-
- DEBUG_P("VidModeSwitchMode");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- /* save in case we fail */
- pTmpMode = pScrn->currentMode;
- /* Force a mode switch */
- pScrn->currentMode = NULL;
- retval = xf86SwitchMode(pScrn->pScreen, mode);
- /* we failed: restore it */
- if (retval == FALSE)
- pScrn->currentMode = pTmpMode;
- return retval;
-}
-
-Bool
-VidModeLockZoom(int scrnIndex, Bool lock)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeLockZoom");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
-
- if (xf86Info.dontZoom)
- return FALSE;
-
- xf86LockZoom(pScrn->pScreen, lock);
- return TRUE;
-}
-
-Bool
-VidModeGetMonitor(int scrnIndex, pointer *monitor)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetMonitor");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- *monitor = (pointer)(pScrn->monitor);
-
- return TRUE;
-}
-
-ModeStatus
-VidModeCheckModeForMonitor(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeCheckModeForMonitor");
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
- return MODE_ERROR;
-
- pScrn = xf86Screens[scrnIndex];
-
- return xf86CheckModeForMonitor((DisplayModePtr)mode, pScrn->monitor);
-}
-
-ModeStatus
-VidModeCheckModeForDriver(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeCheckModeForDriver");
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
- return MODE_ERROR;
-
- pScrn = xf86Screens[scrnIndex];
-
- return xf86CheckModeForDriver(pScrn, (DisplayModePtr)mode, 0);
-}
-
-void
-VidModeSetCrtcForMode(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
- DisplayModePtr ScreenModes;
-
- DEBUG_P("VidModeSetCrtcForMode");
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
- return;
-
- /* Ugly hack so that the xf86Mode.c function can be used without change */
- pScrn = xf86Screens[scrnIndex];
- ScreenModes = pScrn->modes;
- pScrn->modes = (DisplayModePtr)mode;
-
- xf86SetCrtcForModes(pScrn, pScrn->adjustFlags);
- pScrn->modes = ScreenModes;
- return;
-}
-
-Bool
-VidModeAddModeline(int scrnIndex, pointer mode)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeAddModeline");
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
-
- ((DisplayModePtr)mode)->name = strdup(""); /* freed by deletemode */
- ((DisplayModePtr)mode)->status = MODE_OK;
- ((DisplayModePtr)mode)->next = pScrn->modes->next;
- ((DisplayModePtr)mode)->prev = pScrn->modes;
- pScrn->modes->next = (DisplayModePtr)mode;
- if( ((DisplayModePtr)mode)->next != NULL )
- ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
-
- return TRUE;
-}
-
-int
-VidModeGetNumOfModes(int scrnIndex)
-{
- pointer mode = NULL;
- int dotClock= 0, nummodes = 0;
-
- DEBUG_P("VidModeGetNumOfModes");
-
- if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock))
- return nummodes;
-
- do {
- nummodes++;
- if (!VidModeGetNextModeline(scrnIndex, &mode, &dotClock))
- return nummodes;
- } while (TRUE);
-}
-
-Bool
-VidModeSetGamma(int scrnIndex, float red, float green, float blue)
-{
- ScrnInfoPtr pScrn;
- Gamma gamma;
-
- DEBUG_P("VidModeSetGamma");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- gamma.red = red;
- gamma.green = green;
- gamma.blue = blue;
- if (xf86ChangeGamma(pScrn->pScreen, gamma) != Success)
- return FALSE;
- else
- return TRUE;
-}
-
-Bool
-VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue)
-{
- ScrnInfoPtr pScrn;
-
- DEBUG_P("VidModeGetGamma");
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- *red = pScrn->gamma.red;
- *green = pScrn->gamma.green;
- *blue = pScrn->gamma.blue;
- return TRUE;
-}
-
-Bool
-VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
-{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b);
- return TRUE;
-}
-
-Bool
-VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
-{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86GetGammaRamp(pScrn->pScreen, size, r, g, b);
- return TRUE;
-}
-
-int
-VidModeGetGammaRampSize(int scrnIndex)
-{
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen);
-}
-
-pointer
-VidModeCreateMode(void)
-{
- DisplayModePtr mode;
-
- mode = xalloc(sizeof(DisplayModeRec));
- if (mode != NULL) {
- mode->name = "";
- mode->VScan = 1; /* divides refresh rate. default = 1 */
- mode->Private = NULL;
- mode->next = mode;
- mode->prev = mode;
- }
- return mode;
-}
-
-void
-VidModeCopyMode(pointer modefrom, pointer modeto)
-{
- memcpy(modeto, modefrom, sizeof(DisplayModeRec));
-}
-
-
-int
-VidModeGetModeValue(pointer mode, int valtyp)
-{
- int ret = 0;
-
- switch (valtyp) {
- case VIDMODE_H_DISPLAY:
- ret = ((DisplayModePtr) mode)->HDisplay;
- break;
- case VIDMODE_H_SYNCSTART:
- ret = ((DisplayModePtr)mode)->HSyncStart;
- break;
- case VIDMODE_H_SYNCEND:
- ret = ((DisplayModePtr)mode)->HSyncEnd;
- break;
- case VIDMODE_H_TOTAL:
- ret = ((DisplayModePtr)mode)->HTotal;
- break;
- case VIDMODE_H_SKEW:
- ret = ((DisplayModePtr)mode)->HSkew;
- break;
- case VIDMODE_V_DISPLAY:
- ret = ((DisplayModePtr)mode)->VDisplay;
- break;
- case VIDMODE_V_SYNCSTART:
- ret = ((DisplayModePtr)mode)->VSyncStart;
- break;
- case VIDMODE_V_SYNCEND:
- ret = ((DisplayModePtr)mode)->VSyncEnd;
- break;
- case VIDMODE_V_TOTAL:
- ret = ((DisplayModePtr)mode)->VTotal;
- break;
- case VIDMODE_FLAGS:
- ret = ((DisplayModePtr)mode)->Flags;
- break;
- case VIDMODE_CLOCK:
- ret = ((DisplayModePtr)mode)->Clock;
- break;
- }
- return ret;
-}
-
-void
-VidModeSetModeValue(pointer mode, int valtyp, int val)
-{
- switch (valtyp) {
- case VIDMODE_H_DISPLAY:
- ((DisplayModePtr)mode)->HDisplay = val;
- break;
- case VIDMODE_H_SYNCSTART:
- ((DisplayModePtr)mode)->HSyncStart = val;
- break;
- case VIDMODE_H_SYNCEND:
- ((DisplayModePtr)mode)->HSyncEnd = val;
- break;
- case VIDMODE_H_TOTAL:
- ((DisplayModePtr)mode)->HTotal = val;
- break;
- case VIDMODE_H_SKEW:
- ((DisplayModePtr)mode)->HSkew = val;
- break;
- case VIDMODE_V_DISPLAY:
- ((DisplayModePtr)mode)->VDisplay = val;
- break;
- case VIDMODE_V_SYNCSTART:
- ((DisplayModePtr)mode)->VSyncStart = val;
- break;
- case VIDMODE_V_SYNCEND:
- ((DisplayModePtr)mode)->VSyncEnd = val;
- break;
- case VIDMODE_V_TOTAL:
- ((DisplayModePtr)mode)->VTotal = val;
- break;
- case VIDMODE_FLAGS:
- ((DisplayModePtr)mode)->Flags = val;
- break;
- case VIDMODE_CLOCK:
- ((DisplayModePtr)mode)->Clock = val;
- break;
- }
- return;
-}
-
-vidMonitorValue
-VidModeGetMonitorValue(pointer monitor, int valtyp, int indx)
-{
- vidMonitorValue ret;
-
- switch (valtyp) {
- case VIDMODE_MON_VENDOR:
- ret.ptr = (((MonPtr)monitor)->vendor);
- break;
- case VIDMODE_MON_MODEL:
- ret.ptr = (((MonPtr)monitor)->model);
- break;
- case VIDMODE_MON_NHSYNC:
- ret.i = ((MonPtr)monitor)->nHsync;
- break;
- case VIDMODE_MON_NVREFRESH:
- ret.i = ((MonPtr)monitor)->nVrefresh;
- break;
- case VIDMODE_MON_HSYNC_LO:
- ret.f = (100.0 * ((MonPtr)monitor)->hsync[indx].lo);
- break;
- case VIDMODE_MON_HSYNC_HI:
- ret.f = (100.0 * ((MonPtr)monitor)->hsync[indx].hi);
- break;
- case VIDMODE_MON_VREFRESH_LO:
- ret.f = (100.0 * ((MonPtr)monitor)->vrefresh[indx].lo);
- break;
- case VIDMODE_MON_VREFRESH_HI:
- ret.f = (100.0 * ((MonPtr)monitor)->vrefresh[indx].hi);
- break;
- }
- return ret;
-}
-
-
-#endif /* XF86VIDMODE */
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
deleted file mode 100644
index e1755de1e..000000000
--- a/hw/xfree86/common/xf86XKB.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XConsortium: xf86XKB.c /main/4 1996/02/04 09:28:04 kaleb $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/*
- * Copyright (c) 1994-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.12 2003/08/24 17:36:55 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XI.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-
-#include "XKBsrv.h"
-
-void
-xf86InitXkb(void)
-{
-}
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
deleted file mode 100644
index eb871a40d..000000000
--- a/hw/xfree86/common/xf86Xinput.c
+++ /dev/null
@@ -1,1503 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.70 2003/11/03 05:11:02 tsi Exp $ */
-/*
- * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Frederic Lepied not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */
-
-#include "Xfuncproto.h"
-#include "Xmd.h"
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#endif
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Xinput.h"
-#ifdef XINPUT
-#include "XIstubs.h"
-#endif
-#include "mipointer.h"
-#include "xf86InPriv.h"
-
-#ifdef DPMSExtension
-#define DPMS_SERVER
-#include "extensions/dpms.h"
-#include "dpmsproc.h"
-#endif
-
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-#include "exevents.h" /* AddInputDevice */
-#include "exglobals.h"
-
-#define EXTENSION_PROC_ARGS void *
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
-
-#include "windowstr.h" /* screenIsSaved */
-
-#include <stdarg.h>
-
-#include "osdep.h" /* EnabledDevices */
-#include "Xpoll.h"
-#include "xf86_OSproc.h" /* sigio stuff */
-
-/******************************************************************************
- * debugging macro
- *****************************************************************************/
-#ifdef DBG
-#undef DBG
-#endif
-#ifdef DEBUG
-#undef DEBUG
-#endif
-
-#define DEBUG 0
-
-#if DEBUG
-static int debug_level = 0;
-
-#define DBG(lvl, f) {if ((lvl) <= debug_level) f;}
-#else
-#define DBG(lvl, f)
-#endif
-
-/******************************************************************************
- * macros
- *****************************************************************************/
-#define ENQUEUE(e) xf86eqEnqueue((e))
-
-/***********************************************************************
- *
- * xf86AlwaysCoreControl --
- *
- * Control proc for the integer feedback that controls the always
- * core feature.
- *
- ***********************************************************************
- */
-static void
-xf86AlwaysCoreControl(DeviceIntPtr device,
- IntegerCtrl *control)
-{
-}
-
-/***********************************************************************
- *
- * Core devices functions --
- *
- * Test if device is the core device by checking the
- * value of always core feedback and the inputInfo struct.
- *
- ***********************************************************************
- */
-int
-xf86IsCorePointer(DeviceIntPtr device)
-{
- return(device == inputInfo.pointer);
-}
-
-static int
-xf86ShareCorePointer(DeviceIntPtr device)
-{
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
-
- return((local->always_core_feedback &&
- local->always_core_feedback->ctrl.integer_displayed));
-}
-
-static Bool
-xf86SendDragEvents(DeviceIntPtr device)
-{
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
-
- if (inputInfo.pointer->button->buttonsDown > 0)
- return (local->flags & XI86_SEND_DRAG_EVENTS);
- else
- return (TRUE);
-}
-
-int
-xf86IsCoreKeyboard(DeviceIntPtr device)
-{
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
-
- return((local->flags & XI86_ALWAYS_CORE) ||
- (device == inputInfo.keyboard));
-}
-
-void
-xf86XInputSetSendCoreEvents(LocalDevicePtr local, Bool always)
-{
- if (always) {
- local->flags |= XI86_ALWAYS_CORE;
- } else {
- local->flags &= ~XI86_ALWAYS_CORE;
- }
-}
-
-static int xf86CoreButtonState;
-
-/***********************************************************************
- *
- * xf86CheckButton --
- *
- * Test if the core pointer button state is coherent with
- * the button event to send.
- *
- ***********************************************************************
- */
-Bool
-xf86CheckButton(int button,
- int down)
-{
- int check;
- int bit = (1 << (button - 1));
-
- check = xf86CoreButtonState & bit;
-
- DBG(5, ErrorF("xf86CheckButton "
- "button=%d down=%d state=%d check=%d returns ",
- button, down, state, check));
- if ((check && down) || (!check && !down)) {
- DBG(5, ErrorF("FALSE\n"));
- return FALSE;
- }
- xf86CoreButtonState ^= bit;
-
- DBG(5, ErrorF("TRUE\n"));
- return TRUE;
-}
-
-/***********************************************************************
- *
- * xf86ProcessCommonOptions --
- *
- * Process global options.
- *
- ***********************************************************************
- */
-void
-xf86ProcessCommonOptions(LocalDevicePtr local,
- pointer list)
-{
- if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
- xf86SetBoolOption(list, "SendCoreEvents", 0)) {
- local->flags |= XI86_ALWAYS_CORE;
- xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
- }
-
- if (xf86SetBoolOption(list, "CorePointer", 0)) {
- local->flags |= XI86_CORE_POINTER;
- xf86Msg(X_CONFIG, "%s: Core Pointer\n", local->name);
- }
-
- if (xf86SetBoolOption(list, "CoreKeyboard", 0)) {
- local->flags |= XI86_CORE_KEYBOARD;
- xf86Msg(X_CONFIG, "%s: Core Keyboard\n", local->name);
- }
-
- if (xf86SetBoolOption(list, "SendDragEvents", 1)) {
- local->flags |= XI86_SEND_DRAG_EVENTS;
- } else {
- xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
- }
-
- local->history_size = xf86SetIntOption(list, "HistorySize", 0);
-
- if (local->history_size > 0) {
- xf86Msg(X_CONFIG, "%s: has a history of %d motions\n", local->name,
- local->history_size);
- }
-}
-
-/***********************************************************************
- *
- * xf86XinputFinalizeInit --
- *
- * Create and initialize an integer feedback to control the always
- * core feature.
- *
- ***********************************************************************
- */
-void
-xf86XinputFinalizeInit(DeviceIntPtr dev)
-{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
-
- local->dxremaind = 0.0;
- local->dyremaind = 0.0;
-
- if (InitIntegerFeedbackClassDeviceStruct(dev, xf86AlwaysCoreControl) == FALSE) {
- ErrorF("Unable to init integer feedback for always core feature\n");
- } else {
- local->always_core_feedback = dev->intfeed;
- dev->intfeed->ctrl.integer_displayed = (local->flags & XI86_ALWAYS_CORE) ? 1 : 0;
- }
-}
-
-/***********************************************************************
- *
- * xf86ActivateDevice --
- *
- * Initialize an input device.
- *
- ***********************************************************************
- */
-void
-xf86ActivateDevice(LocalDevicePtr local)
-{
- DeviceIntPtr dev;
-
- if (local->flags & XI86_CONFIGURED) {
- int open_on_init;
-
- open_on_init = local->flags &
- (XI86_OPEN_ON_INIT |
- XI86_ALWAYS_CORE | XI86_CORE_POINTER | XI86_CORE_KEYBOARD);
-
- dev = AddInputDevice(local->device_control,
- open_on_init);
- if (dev == NULL)
- FatalError("Too many input devices");
-
- local->atom = MakeAtom(local->name,
- strlen(local->name),
- TRUE);
- AssignTypeAndName (dev, local->atom, local->name);
- dev->public.devicePrivate = (pointer) local;
- local->dev = dev;
-
- xf86XinputFinalizeInit(dev);
-
- /*
- * XXX Can a single device instance be both core keyboard and
- * core pointer? If so, this should be changed.
- */
- if (local->flags & XI86_CORE_POINTER)
- RegisterPointerDevice(dev);
- else if (local->flags & XI86_CORE_KEYBOARD)
- RegisterKeyboardDevice(dev);
-#ifdef XINPUT
- else
- RegisterOtherDevice(dev);
-#endif
-
- if (serverGeneration == 1)
- xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
- local->name, local->type_name);
- }
-}
-
-
-#ifdef XINPUT
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- ***********************************************************************
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev,
- ClientPtr client,
- int *status)
-{
- if (!dev->inited) {
- *status = BadDevice;
- } else {
- if (!dev->public.on) {
- if (!EnableDevice(dev)) {
- *status = BadDevice;
- } else {
- /* to prevent ProcXOpenDevice to call EnableDevice again */
- dev->startup = FALSE;
- }
- }
- }
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXChangeKeyboardDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the keyboard device.
- *
- * The X keyboard device has a FocusRec. If the device that has been
- * made into the new X keyboard did not have a FocusRec,
- * ProcXChangeKeyboardDevice will allocate one for it.
- *
- * If you do not want clients to be able to focus the old X keyboard
- * device, call DeleteFocusClassDeviceStruct to free the FocusRec.
- *
- * If you support input devices with keys that you do not want to be
- * used as the X keyboard, you need to check for them here and return
- * a BadDevice error.
- *
- * The default implementation is to do nothing (assume you do want
- * clients to be able to focus the old X keyboard). The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- ***********************************************************************
- */
-
-int
-ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev)
-{
- /**********************************************************************
- * DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
- **********************************************************************/
- return !Success;
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXChangePointerDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the pointer device.
- *
- * The X pointer device does not have a FocusRec. If the device that
- * has been made into the new X pointer had a FocusRec,
- * ProcXChangePointerDevice will free it.
- *
- * If you want clients to be able to focus the old pointer device that
- * has now become accessible through the input extension, you need to
- * add a FocusRec to it here.
- *
- * The XChangePointerDevice protocol request also allows the client
- * to choose which axes of the new pointer device are used to move
- * the X cursor in the X- and Y- directions. If the axes are different
- * than the default ones, you need to keep track of that here.
- *
- * If you support input devices with valuators that you do not want to be
- * used as the X pointer, you need to check for them here and return a
- * BadDevice error.
- *
- * The default implementation is to do nothing (assume you don't want
- * clients to be able to focus the old X pointer). The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- ***********************************************************************
- */
-
-int
-ChangePointerDevice (
- DeviceIntPtr old_dev,
- DeviceIntPtr new_dev,
- unsigned char x,
- unsigned char y)
-{
- /************************************************************************
- InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr*
-
- x_axis = x; * keep track of new x-axis*
- y_axis = y; * keep track of new y-axis*
- if (x_axis != 0 || y_axis != 1)
- axes_changed = TRUE; * remember axes have changed*
- else
- axes_changed = FALSE;
- *************************************************************************/
-
- /*
- * We don't allow axis swap or other exotic features.
- */
- if (x == 0 && y == 1) {
- LocalDevicePtr old_local = (LocalDevicePtr)old_dev->public.devicePrivate;
- LocalDevicePtr new_local = (LocalDevicePtr)new_dev->public.devicePrivate;
-
- InitFocusClassDeviceStruct(old_dev);
-
- /* Restore Extended motion history information */
- old_dev->valuator->GetMotionProc = old_local->motion_history_proc;
- old_dev->valuator->numMotionEvents = old_local->history_size;
-
- /* Save Extended motion history information */
- new_local->motion_history_proc = new_dev->valuator->GetMotionProc;
- new_local->history_size = new_dev->valuator->numMotionEvents;
-
- /* Set Core motion history information */
- new_dev->valuator->GetMotionProc = miPointerGetMotionEvents;
- new_dev->valuator->numMotionEvents = miPointerGetMotionBufferSize();
-
- return Success;
- }
- else
- return !Success;
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXCloseDevice
- *
- * Take care of implementation-dependent details of closing a device.
- * Some implementations may actually close the device, others may just
- * remove this clients interest in that device.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- *
- ***********************************************************************
- */
-
-void
-CloseInputDevice (DeviceIntPtr d, ClientPtr client)
-{
- ErrorF("ProcXCloseDevice to close or not ?\n");
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- ***********************************************************************
- */
-
-void
-AddOtherInputDevices ()
-{
-}
-
-
-/****************************************************************************
- *
- * Caller: ProcXSetDeviceMode
- *
- * Change the mode of an extension device.
- * This function is used to change the mode of a device from reporting
- * relative motion to reporting absolute positional information, and
- * vice versa.
- * The default implementation below is that no such devices are supported.
- *
- ***********************************************************************
- */
-
-int
-SetDeviceMode (ClientPtr client, DeviceIntPtr dev, int mode)
-{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
-
- if (local->switch_mode) {
- return (*local->switch_mode)(client, dev, mode);
- }
- else
- return BadMatch;
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXSetDeviceValuators
- *
- * Set the value of valuators on an extension input device.
- * This function is used to set the initial value of valuators on
- * those input devices that are capable of reporting either relative
- * motion or an absolute position, and allow an initial position to be set.
- * The default implementation below is that no such devices are supported.
- *
- ***********************************************************************
- */
-
-int
-SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators,
- int first_valuator, int num_valuators)
-{
- return BadMatch;
-}
-
-
-/***********************************************************************
- *
- * Caller: ProcXChangeDeviceControl
- *
- * Change the specified device controls on an extension input device.
- *
- ***********************************************************************
- */
-
-int
-ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control)
-{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
-
- if (!local->control_proc) {
- return (BadMatch);
- }
- else {
- return (*local->control_proc)(local, control);
- }
-}
-#endif
-
-/*
- * adapted from mieq.c to support extended events
- *
- */
-#define QUEUE_SIZE 256
-
-typedef struct _Event {
- xEvent event;
-#ifdef XINPUT
- deviceValuator val;
-#endif
- ScreenPtr pScreen;
-} EventRec, *EventPtr;
-
-typedef struct _EventQueue {
- HWEventQueueType head, tail;
- CARD32 lastEventTime; /* to avoid time running backwards */
- Bool lastMotion;
- EventRec events[QUEUE_SIZE]; /* static allocation for signals */
- DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
- ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
- ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
-} EventQueueRec, *EventQueuePtr;
-
-static EventQueueRec xf86EventQueue;
-
-Bool
-xf86eqInit (DevicePtr pKbd, DevicePtr pPtr)
-{
- xf86EventQueue.head = xf86EventQueue.tail = 0;
- xf86EventQueue.lastEventTime = GetTimeInMillis ();
- xf86EventQueue.pKbd = pKbd;
- xf86EventQueue.pPtr = pPtr;
- xf86EventQueue.lastMotion = FALSE;
- xf86EventQueue.pEnqueueScreen = screenInfo.screens[0];
- xf86EventQueue.pDequeueScreen = xf86EventQueue.pEnqueueScreen;
- SetInputCheck (&xf86EventQueue.head, &xf86EventQueue.tail);
- return TRUE;
-}
-
-/*
- * Must be reentrant with ProcessInputEvents. Assumption: xf86eqEnqueue
- * will never be interrupted. If this is called from both signal
- * handlers and regular code, make sure the signal is suspended when
- * called from regular code.
- */
-
-void
-xf86eqEnqueue (xEvent *e)
-{
- int oldtail, newtail;
- Bool isMotion;
-#ifdef XINPUT
- int count;
-
- xf86AssertBlockedSIGIO ("xf86eqEnqueue");
- switch (e->u.u.type) {
- case KeyPress:
- case KeyRelease:
-#ifdef XFreeXDGA
- /* we do this here, because nobody seems to be calling
- xf86PostKeyEvent(). We can't steal MotionNotify events here
- because the motion-relative information has been lost already. */
- if(DGAStealKeyEvent(xf86EventQueue.pEnqueueScreen->myNum, e))
- return;
-#endif
- /* fall through */
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- count = 1;
- break;
- default:
-#ifdef XFreeXDGA
- if (DGAIsDgaEvent (e))
- {
- count = 1;
- break;
- }
-#endif
- if (!((deviceKeyButtonPointer *) e)->deviceid & MORE_EVENTS) {
- count = 1;
- }
- else {
- count = 2;
- }
- break;
- }
-#endif
-
- oldtail = xf86EventQueue.tail;
- isMotion = e->u.u.type == MotionNotify;
- if (isMotion && xf86EventQueue.lastMotion && oldtail != xf86EventQueue.head) {
- if (oldtail == 0)
- oldtail = QUEUE_SIZE;
- oldtail = oldtail - 1;
- }
- else {
- newtail = oldtail + 1;
- if (newtail == QUEUE_SIZE)
- newtail = 0;
- /* Toss events which come in late */
- if (newtail == xf86EventQueue.head)
- return;
- xf86EventQueue.tail = newtail;
- }
-
- xf86EventQueue.lastMotion = isMotion;
- xf86EventQueue.events[oldtail].event = *e;
-#ifdef XINPUT
- if (count == 2) {
- xf86EventQueue.events[oldtail].val = *((deviceValuator *) (((deviceKeyButtonPointer *) e)+1));
- }
-#endif
- /*
- * Make sure that event times don't go backwards - this
- * is "unnecessary", but very useful
- */
- if (e->u.keyButtonPointer.time < xf86EventQueue.lastEventTime &&
- xf86EventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000) {
-
- xf86EventQueue.events[oldtail].event.u.keyButtonPointer.time =
- xf86EventQueue.lastEventTime;
- }
- xf86EventQueue.events[oldtail].pScreen = xf86EventQueue.pEnqueueScreen;
-}
-
-/*
- * Call this from ProcessInputEvents()
- */
-void
-xf86eqProcessInputEvents ()
-{
- EventRec *e;
- int x, y;
- struct {
- xEvent event;
-#ifdef XINPUT
- deviceValuator val;
-#endif
- } xe;
-#ifdef XINPUT
- DeviceIntPtr dev;
- int id, count;
- deviceKeyButtonPointer *dev_xe;
-#endif
-
- while (xf86EventQueue.head != xf86EventQueue.tail) {
- if (screenIsSaved == SCREEN_SAVER_ON)
- SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
-#ifdef DPMSExtension
- if (DPMSPowerLevel != DPMSModeOn)
- DPMSSet(DPMSModeOn);
-#endif
-
- e = &xf86EventQueue.events[xf86EventQueue.head];
- /*
- * Assumption - screen switching can only occur on motion events
- */
- if (e->pScreen != xf86EventQueue.pDequeueScreen) {
- xf86EventQueue.pDequeueScreen = e->pScreen;
- x = e->event.u.keyButtonPointer.rootX;
- y = e->event.u.keyButtonPointer.rootY;
- if (xf86EventQueue.head == QUEUE_SIZE - 1)
- xf86EventQueue.head = 0;
- else
- ++xf86EventQueue.head;
- NewCurrentScreen (xf86EventQueue.pDequeueScreen, x, y);
- }
- else {
- xe.event = e->event;
- xe.val = e->val;
- if (xf86EventQueue.head == QUEUE_SIZE - 1)
- xf86EventQueue.head = 0;
- else
- ++xf86EventQueue.head;
- switch (xe.event.u.u.type) {
- case KeyPress:
- case KeyRelease:
- (*xf86EventQueue.pKbd->processInputProc)
- (&xe.event, (DeviceIntPtr)xf86EventQueue.pKbd, 1);
- break;
-#ifdef XINPUT
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- (*(inputInfo.pointer->public.processInputProc))
- (&xe.event, (DeviceIntPtr)inputInfo.pointer, 1);
- break;
-
- default:
-#ifdef XFreeXDGA
- if (DGADeliverEvent (xf86EventQueue.pDequeueScreen, &xe.event))
- break;
-#endif
- dev_xe = (deviceKeyButtonPointer *) &xe.event;
- id = dev_xe->deviceid & DEVICE_BITS;
- if (!(dev_xe->deviceid & MORE_EVENTS)) {
- count = 1;
- }
- else {
- count = 2;
- }
- dev = LookupDeviceIntRec(id);
- if (dev == NULL) {
- ErrorF("LookupDeviceIntRec id=0x%x not found\n", id);
-/* FatalError("xf86eqProcessInputEvents : device not found.\n");
- */
- break;
- }
- if (!dev->public.processInputProc) {
- FatalError("xf86eqProcessInputEvents : device has no input proc.\n");
- break;
- }
- (*dev->public.processInputProc)(&xe.event, dev, count);
-#else
- default:
- (*xf86EventQueue.pPtr->processInputProc)
- (&xe.event, (DeviceIntPtr)xf86EventQueue.pPtr, 1);
-#endif
- break;
- }
- }
- }
-}
-
-void
-xf86eqSwitchScreen(ScreenPtr pScreen,
- Bool fromDIX)
-{
- xf86EventQueue.pEnqueueScreen = pScreen;
-
- if (fromDIX)
- xf86EventQueue.pDequeueScreen = pScreen;
-}
-
-/*
- * convenient functions to post events
- */
-
-void
-xf86PostMotionEvent(DeviceIntPtr device,
- int is_absolute,
- int first_valuator,
- int num_valuators,
- ...)
-{
- va_list var;
- int loop;
- xEvent xE[2];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer*) xE;
- deviceValuator *xv = (deviceValuator*) xev+1;
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
- char *buff = 0;
- Time current;
- Bool is_core = xf86IsCorePointer(device);
- Bool is_shared = xf86ShareCorePointer(device);
- Bool drag = xf86SendDragEvents(device);
- ValuatorClassPtr val = device->valuator;
- int valuator[6];
- int oldaxis[6];
- int *axisvals;
- int dx = 0, dy = 0;
- float mult;
- int x, y;
- int loop_start;
- int i;
- int num;
-
- DBG(5, ErrorF("xf86PostMotionEvent BEGIN 0x%x(%s) is_core=%s is_shared=%s is_absolute=%s\n",
- device, device->name,
- is_core ? "True" : "False",
- is_shared ? "True" : "False",
- is_absolute ? "True" : "False"));
-
- xf86Info.lastEventTime = xev->time = current = GetTimeInMillis();
-
- if (!is_core) {
- if (HAS_MOTION_HISTORY(local)) {
- buff = ((char *)local->motion_history +
- (sizeof(INT32) * local->dev->valuator->numAxes + sizeof(Time)) * local->last);
- }
- }
-
- if (num_valuators && (!val || (first_valuator + num_valuators > val->numAxes))) {
- ErrorF("Bad valuators reported for device \"%s\"\n", device->name);
- return;
- }
-
- axisvals = val->axisVal;
-
- va_start(var, num_valuators);
-
- loop_start = first_valuator;
- for(loop=0; loop<num_valuators; loop++) {
-
- valuator[loop%6] = va_arg(var,int);
-
- if (loop % 6 == 5 || loop == num_valuators - 1) {
- num = loop % 6 + 1;
- /*
- * Adjust first two relative valuators
- */
- if (!is_absolute && num_valuators >= 2 && loop_start == 0) {
-
- dx = valuator[0];
- dy = valuator[1];
-
- /*
- * Accelerate
- */
- if (device->ptrfeed && device->ptrfeed->ctrl.num) {
- /* modeled from xf86Events.c */
- if (device->ptrfeed->ctrl.threshold) {
- if ((abs(dx) + abs(dy)) >= device->ptrfeed->ctrl.threshold) {
- valuator[0] = (dx * device->ptrfeed->ctrl.num) /
- device->ptrfeed->ctrl.den;
- valuator[1] = (dy * device->ptrfeed->ctrl.num) /
- device->ptrfeed->ctrl.den;
- }
- }
- else if (dx || dy) {
- mult = pow((float)(dx*dx+dy*dy),
- ((float)(device->ptrfeed->ctrl.num) /
- (float)(device->ptrfeed->ctrl.den) - 1.0) /
- 2.0) / 2.0;
- if (dx) {
- local->dxremaind = mult * (float)dx + local->dxremaind;
- valuator[0] = (int)local->dxremaind;
- local->dxremaind = local->dxremaind - (float)valuator[0];
- }
- if (dy) {
- local->dyremaind = mult * (float)dy + local->dyremaind;
- valuator[1] = (int)local->dyremaind;
- local->dyremaind = local->dyremaind - (float)valuator[1];
- }
- }
- DBG(6, ErrorF("xf86PostMotionEvent acceleration v0=%d v1=%d\n",
- valuator[0], valuator[1]));
- }
-
- /*
- * Map current position back to device space in case
- * the cursor was warped
- */
- if (is_core || is_shared)
- {
- miPointerPosition (&x, &y);
- if (local->reverse_conversion_proc)
- (*local->reverse_conversion_proc)(local, x, y, axisvals);
- else
- {
- axisvals[0] = x;
- axisvals[1] = y;
- }
- }
- }
-
- /*
- * Update axes
- */
- for (i = 0; i < num; i++)
- {
- oldaxis[i] = axisvals[loop_start + i];
- if (is_absolute)
- axisvals[loop_start + i] = valuator[i];
- else
- axisvals[loop_start + i] += valuator[i];
- }
-
- /*
- * Deliver extension event
- */
- if (!is_core) {
- xev->type = DeviceMotionNotify;
- xev->detail = 0;
- xev->deviceid = device->id | MORE_EVENTS;
-
- xv->type = DeviceValuator;
- xv->deviceid = device->id;
-
- xv->device_state = 0;
- xv->num_valuators = num;
- xv->first_valuator = loop_start;
- memcpy (&xv->valuator0, &axisvals[loop_start],
- sizeof(INT32)*xv->num_valuators);
-
- if (HAS_MOTION_HISTORY(local)) {
- *(Time*)buff = current;
- memcpy(buff+sizeof(Time)+sizeof(INT32)*xv->first_valuator,
- &axisvals[loop_start],
- sizeof(INT32)*xv->num_valuators);
- }
- ENQUEUE(xE);
- }
-
- /*
- * Deliver core event
- */
- if (is_core ||
- (is_shared && num_valuators >= 2 && loop_start == 0)) {
-#ifdef XFreeXDGA
- /*
- * Let DGA peek at the event and steal it
- */
- xev->type = MotionNotify;
- xev->detail = 0;
- if (is_absolute)
- {
- dx = axisvals[0] - oldaxis[0];
- dy = axisvals[1] - oldaxis[1];
- }
- if (DGAStealMouseEvent(xf86EventQueue.pEnqueueScreen->myNum,
- xE, dx, dy))
- continue;
-#endif
- if (!(*local->conversion_proc)(local, loop_start, num,
- axisvals[0], axisvals[1],
- axisvals[2], axisvals[3],
- axisvals[4], axisvals[5],
- &x, &y))
- continue;
-
- if (drag)
- miPointerAbsoluteCursor (x, y, current);
- /*
- * Retrieve the position
- */
- miPointerPosition (&x, &y);
- if (local->reverse_conversion_proc)
- (*local->reverse_conversion_proc)(local, x, y, axisvals);
- else
- {
- axisvals[0] = x;
- axisvals[1] = y;
- }
- }
- loop_start += 6;
- }
- }
- va_end(var);
- if (HAS_MOTION_HISTORY(local)) {
- local->last = (local->last + 1) % device->valuator->numMotionEvents;
- if (local->last == local->first)
- local->first = (local->first + 1) % device->valuator->numMotionEvents;
- }
- DBG(5, ErrorF("xf86PostMotionEvent END 0x%x(%s) is_core=%s is_shared=%s\n",
- device, device->name,
- is_core ? "True" : "False",
- is_shared ? "True" : "False"));
-}
-
-void
-xf86PostProximityEvent(DeviceIntPtr device,
- int is_in,
- int first_valuator,
- int num_valuators,
- ...)
-{
- va_list var;
- int loop;
- xEvent xE[2];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer*) xE;
- deviceValuator *xv = (deviceValuator*) xev+1;
- ValuatorClassPtr val = device->valuator;
- Bool is_core = xf86IsCorePointer(device);
- Bool is_absolute = val && ((val->mode & 1) == Relative);
-
- DBG(5, ErrorF("xf86PostProximityEvent BEGIN 0x%x(%s) prox=%s is_core=%s is_absolute=%s\n",
- device, device->name, is_in ? "true" : "false",
- is_core ? "True" : "False",
- is_absolute ? "True" : "False"));
-
- if (is_core) {
- return;
- }
-
- if (num_valuators && (!val || (first_valuator + num_valuators > val->numAxes))) {
- ErrorF("Bad valuators reported for device \"%s\"\n", device->name);
- return;
- }
-
- xev->type = is_in ? ProximityIn : ProximityOut;
- xev->detail = 0;
- xev->deviceid = device->id | MORE_EVENTS;
-
- xv->type = DeviceValuator;
- xv->deviceid = device->id;
- xv->device_state = 0;
-
- if ((device->valuator->mode & 1) == Relative) {
- num_valuators = 0;
- }
-
- if (num_valuators != 0) {
- int *axisvals = val->axisVal;
-
- va_start(var, num_valuators);
-
- for(loop=0; loop<num_valuators; loop++) {
- switch (loop % 6) {
- case 0:
- xv->valuator0 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 1:
- xv->valuator1 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 2:
- xv->valuator2 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 3:
- xv->valuator3 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 4:
- xv->valuator4 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 5:
- xv->valuator5 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- }
- if ((loop % 6 == 5) || (loop == num_valuators - 1)) {
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
-
- xv->num_valuators = (loop % 6) + 1;
- xv->first_valuator = first_valuator + (loop / 6) * 6;
- ENQUEUE(xE);
- }
- }
- va_end(var);
- }
- else {
- /* no valuator */
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
-
- xv->num_valuators = 0;
- xv->first_valuator = 0;
- ENQUEUE(xE);
- }
- DBG(5, ErrorF("xf86PostProximityEvent END 0x%x(%s) prox=%s is_core=%s is_absolute=%s\n",
- device, device->name, is_in ? "true" : "false",
- is_core ? "True" : "False",
- is_absolute ? "True" : "False"));
-
-}
-
-void
-xf86PostButtonEvent(DeviceIntPtr device,
- int is_absolute,
- int button,
- int is_down,
- int first_valuator,
- int num_valuators,
- ...)
-{
- va_list var;
- int loop;
- xEvent xE[2];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer*) xE;
- deviceValuator *xv = (deviceValuator*) xev+1;
- ValuatorClassPtr val = device->valuator;
- Bool is_core = xf86IsCorePointer(device);
- Bool is_shared = xf86ShareCorePointer(device);
-
- DBG(5, ErrorF("xf86PostButtonEvent BEGIN 0x%x(%s) button=%d down=%s is_core=%s is_shared=%s is_absolute=%s\n",
- device, device->name, button,
- is_down ? "True" : "False",
- is_core ? "True" : "False",
- is_shared ? "True" : "False",
- is_absolute ? "True" : "False"));
-
- /* Check the core pointer button state not to send an inconsistent
- * event. This can happen with the AlwaysCore feature.
- */
- if ((is_core || is_shared) &&
- !xf86CheckButton(device->button->map[button], is_down))
- {
- return;
- }
-
- if (num_valuators && (!val || (first_valuator + num_valuators > val->numAxes))) {
- ErrorF("Bad valuators reported for device \"%s\"\n", device->name);
- return;
- }
-
- if (!is_core) {
- xev->type = is_down ? DeviceButtonPress : DeviceButtonRelease;
- xev->detail = button;
- xev->deviceid = device->id | MORE_EVENTS;
-
- xv->type = DeviceValuator;
- xv->deviceid = device->id;
- xv->device_state = 0;
-
- if (num_valuators != 0) {
- int *axisvals = val->axisVal;
-
- va_start(var, num_valuators);
-
- for(loop=0; loop<num_valuators; loop++) {
- switch (loop % 6) {
- case 0:
- xv->valuator0 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 1:
- xv->valuator1 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 2:
- xv->valuator2 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 3:
- xv->valuator3 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 4:
- xv->valuator4 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- case 5:
- xv->valuator5 = is_absolute ? va_arg(var, int) : axisvals[loop];
- break;
- }
- if ((loop % 6 == 5) || (loop == num_valuators - 1)) {
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
- xv->num_valuators = (loop % 6) + 1;
- xv->first_valuator = first_valuator + (loop / 6) * 6;
- ENQUEUE(xE);
-
- }
- }
- va_end(var);
- }
- else {
- /* no valuator */
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
- xv->num_valuators = 0;
- xv->first_valuator = 0;
- ENQUEUE(xE);
- }
- }
-
- /* removed rootX/rootY as DIX sets these fields */
- if (is_core || is_shared) {
- xE->u.u.type = is_down ? ButtonPress : ButtonRelease;
- xE->u.u.detail = device->button->map[button];
- xf86Info.lastEventTime = xE->u.keyButtonPointer.time = GetTimeInMillis();
-
-#ifdef XFreeXDGA
- if (!DGAStealMouseEvent(xf86EventQueue.pEnqueueScreen->myNum, xE, 0, 0))
-#endif
- ENQUEUE(xE);
- }
- DBG(5, ErrorF("xf86PostButtonEvent END\n"));
-}
-
-void
-xf86PostKeyEvent(DeviceIntPtr device,
- unsigned int key_code,
- int is_down,
- int is_absolute,
- int first_valuator,
- int num_valuators,
- ...)
-{
- va_list var;
- int loop;
- xEvent xE[2];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer*) xE;
- deviceValuator *xv = (deviceValuator*) xev+1;
-
- va_start(var, num_valuators);
-
- for(loop=0; loop<num_valuators; loop++) {
- switch (loop % 6) {
- case 0:
- xv->valuator0 = va_arg(var, int);
- break;
- case 1:
- xv->valuator1 = va_arg(var, int);
- break;
- case 2:
- xv->valuator2 = va_arg(var, int);
- break;
- case 3:
- xv->valuator3 = va_arg(var, int);
- break;
- case 4:
- xv->valuator4 = va_arg(var, int);
- break;
- case 5:
- xv->valuator5 = va_arg(var, int);
- break;
- }
- if (((loop % 6 == 5) || (loop == num_valuators - 1))) {
- xev->type = is_down ? DeviceKeyPress : DeviceKeyRelease;
- xev->detail = key_code;
-
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
- xev->deviceid = device->id | MORE_EVENTS;
-
- xv->type = DeviceValuator;
- xv->deviceid = device->id;
- xv->device_state = 0;
- /* if the device is in the relative mode we don't have to send valuators */
- xv->num_valuators = is_absolute ? (loop % 6) + 1 : 0;
- xv->first_valuator = first_valuator + (loop / 6) * 6;
-
- ENQUEUE(xE);
- /* if the device is in the relative mode only one event is needed */
- if (!is_absolute) break;
- }
- }
- va_end(var);
-}
-
-void
-xf86PostKeyboardEvent(DeviceIntPtr device,
- unsigned int key_code,
- int is_down)
-{
- xEvent xE[2];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer*) xE;
-
- if (xf86IsCoreKeyboard(device)) {
- xev->type = is_down ? KeyPress : KeyRelease;
- } else {
- xev->type = is_down ? DeviceKeyPress : DeviceKeyRelease;
- }
- xev->detail = key_code;
- xf86Info.lastEventTime = xev->time = GetTimeInMillis();
-
-#ifdef XFreeXDGA
- /* if(!DGAStealKeyEvent(xf86EventQueue.pEnqueueScreen->myNum, xE)) */
-#endif
- ENQUEUE(xE);
-}
-
-/*
- * Motion history management.
- */
-
-void
-xf86MotionHistoryAllocate(LocalDevicePtr local)
-{
- ValuatorClassPtr valuator = local->dev->valuator;
-
- if (!HAS_MOTION_HISTORY(local))
- return;
- if (local->motion_history) xfree(local->motion_history);
- local->motion_history = xalloc((sizeof(INT32) * valuator->numAxes + sizeof(Time))
- * valuator->numMotionEvents);
- local->first = 0;
- local->last = 0;
-}
-
-int
-xf86GetMotionEvents(DeviceIntPtr dev,
- xTimecoord *buff,
- unsigned long start,
- unsigned long stop,
- ScreenPtr pScreen)
-{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
- ValuatorClassPtr valuator = dev->valuator;
- int num = 0;
- int loop = local->first;
- int size;
- Time current;
-
- if (!HAS_MOTION_HISTORY(local))
- return 0;
-
- size = (sizeof(INT32) * valuator->numAxes + sizeof(Time));
-
- while (loop != local->last) {
- current = *(Time*)(((char *)local->motion_history)+loop*size);
- if (current > stop)
- return num;
- if (current >= start) {
- memcpy(((char *)buff)+size*num,
- ((char *)local->motion_history)+loop*size, size);
- num++;
- }
- loop = (loop + 1) % valuator->numMotionEvents;
- }
- return num;
-}
-
-LocalDevicePtr
-xf86FirstLocalDevice()
-{
- return xf86InputDevs;
-}
-
-/*
- * Cx - raw data from touch screen
- * Sxhigh - scaled highest dimension
- * (remember, this is of rows - 1 because of 0 origin)
- * Sxlow - scaled lowest dimension
- * Rxhigh - highest raw value from touch screen calibration
- * Rxlow - lowest raw value from touch screen calibration
- *
- * This function is the same for X or Y coordinates.
- * You may have to reverse the high and low values to compensate for
- * different orgins on the touch screen vs X.
- */
-
-int
-xf86ScaleAxis(int Cx,
- int Sxhigh,
- int Sxlow,
- int Rxhigh,
- int Rxlow )
-{
- int X;
- int dSx = Sxhigh - Sxlow;
- int dRx = Rxhigh - Rxlow;
-
- dSx = Sxhigh - Sxlow;
- if (dRx) {
- X = ((dSx * (Cx - Rxlow)) / dRx) + Sxlow;
- }
- else {
- X = 0;
- ErrorF ("Divide by Zero in xf86ScaleAxis");
- }
-
- if (X > Sxlow)
- X = Sxlow;
- if (X < Sxhigh)
- X = Sxhigh;
-
- return (X);
-}
-
-/*
- * This function checks the given screen against the current screen and
- * makes changes if appropriate. It should be called from an XInput driver's
- * ReadInput function before any events are posted, if the device is screen
- * specific like a touch screen.
- */
-void
-xf86XInputSetScreen(LocalDevicePtr local,
- int screen_number,
- int x,
- int y)
-{
- if ((xf86IsCorePointer(local->dev) || xf86ShareCorePointer(local->dev)) &&
- (miPointerCurrentScreen() != screenInfo.screens[screen_number])) {
- miPointerSetNewScreen (screen_number, x, y);
- }
-}
-
-
-void
-xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
- int resolution, int min_res, int max_res)
-{
-#ifdef XINPUT
- if (maxval == -1) {
- if (axnum == 0)
- maxval = screenInfo.screens[0]->width - 1;
- else if (axnum == 1)
- maxval = screenInfo.screens[0]->height - 1;
- /* else? */
- }
- InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution, min_res,
- max_res);
-#endif
-}
-
-/*
- * Set the valuator values to be in synch with dix/event.c
- * DefineInitialRootWindow().
- */
-void
-xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum)
-{
-#ifdef XINPUT
- if (axnum == 0)
- dev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2;
- else if (axnum == 1)
- dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
-#endif
-}
-
-/* end of xf86Xinput.c */
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
deleted file mode 100644
index 9a0393447..000000000
--- a/hw/xfree86/common/xf86Xinput.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/* $XConsortium: xf86Xinput.h /main/11 1996/10/27 11:05:29 kaleb $ */
-/*
- * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Frederic Lepied not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.36 2003/08/24 17:36:55 dawes Exp $ */
-
-#ifndef _xf86Xinput_h
-#define _xf86Xinput_h
-
-#ifndef NEED_EVENTS
-#define NEED_EVENTS
-#endif
-#include "xf86str.h"
-#include "inputstr.h"
-#ifdef XINPUT
-#include "extensions/XI.h"
-#include "extensions/XIproto.h"
-#include "XIstubs.h"
-#endif
-
-/* Input device flags */
-#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
-#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
-/* the device sends Xinput and core pointer events */
-#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
-/* if the device is the core pointer or is sending core events, and
- * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
- * (mouse drag action) are sent. This is mainly to allow a touch screen to be
- * used with netscape and other browsers which do strange things if the mouse
- * moves between button down and button up. With a touch screen, this motion
- * is common due to the user's finger moving slightly.
- */
-#define XI86_SEND_DRAG_EVENTS 0x08
-#define XI86_CORE_POINTER 0x10 /* device is the core pointer */
-#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
-#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
-#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
-
-#define XI_PRIVATE(dev) \
- (((LocalDevicePtr)((dev)->public.devicePrivate))->private)
-
-#ifdef DBG
-#undef DBG
-#endif
-#define DBG(lvl, f) {if ((lvl) <= xf86GetVerbosity()) f;}
-
-#ifdef HAS_MOTION_HISTORY
-#undef HAS_MOTION_HISTORY
-#endif
-#define HAS_MOTION_HISTORY(local) ((local)->dev->valuator && (local)->dev->valuator->numMotionEvents)
-
-#ifdef XINPUT
-/* This holds the input driver entry and module information. */
-typedef struct _InputDriverRec {
- int driverVersion;
- char * driverName;
- void (*Identify)(int flags);
- struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
- IDevPtr dev, int flags);
- void (*UnInit)(struct _InputDriverRec *drv,
- struct _LocalDeviceRec *pInfo,
- int flags);
- pointer module;
- int refCount;
-} InputDriverRec, *InputDriverPtr;
-#endif
-
-/* This is to input devices what the ScrnInfoRec is to screens. */
-
-typedef struct _LocalDeviceRec {
- struct _LocalDeviceRec *next;
- char * name;
- int flags;
-
- Bool (*device_control)(DeviceIntPtr device, int what);
- void (*read_input)(struct _LocalDeviceRec *local);
- int (*control_proc)(struct _LocalDeviceRec *local,
- xDeviceCtl *control);
- void (*close_proc)(struct _LocalDeviceRec *local);
- int (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
- int mode);
- Bool (*conversion_proc)(struct _LocalDeviceRec *local,
- int first, int num, int v0,
- int v1, int v2, int v3, int v4,
- int v5, int *x, int *y);
- Bool (*reverse_conversion_proc)(
- struct _LocalDeviceRec *local,
- int x, int y, int *valuators);
-
- int fd;
- Atom atom;
- DeviceIntPtr dev;
- pointer private;
- int private_flags;
- pointer motion_history;
- ValuatorMotionProcPtr motion_history_proc;
- unsigned int history_size; /* only for configuration purpose */
- unsigned int first;
- unsigned int last;
- int old_x;
- int old_y;
- float dxremaind;
- float dyremaind;
- char * type_name;
- IntegerFeedbackPtr always_core_feedback;
- IDevPtr conf_idev;
- InputDriverPtr drv;
- pointer module;
- pointer options;
-} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
-
-typedef struct _DeviceAssocRec
-{
- char * config_section_name;
- LocalDevicePtr (*device_allocate)(void);
-} DeviceAssocRec, *DeviceAssocPtr;
-
-/* xf86Globals.c */
-extern InputInfoPtr xf86InputDevs;
-
-/* xf86Xinput.c */
-int xf86IsCorePointer(DeviceIntPtr dev);
-int xf86IsCoreKeyboard(DeviceIntPtr dev);
-void xf86XInputSetSendCoreEvents(LocalDevicePtr local, Bool always);
-#define xf86AlwaysCore(a,b) xf86XInputSetSendCoreEvents(a,b)
-
-void InitExtInput(void);
-Bool xf86eqInit(DevicePtr pKbd, DevicePtr pPtr);
-void xf86eqEnqueue(struct _xEvent *event);
-void xf86eqProcessInputEvents (void);
-void xf86eqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
-void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, ...);
-void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
- int first_valuator, int num_valuators, ...);
-void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
- int is_down, int first_valuator, int num_valuators,
- ...);
-void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
- int is_absolute, int first_valuator, int num_valuators,
- ...);
-void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
- int is_down);
-void xf86MotionHistoryAllocate(LocalDevicePtr local);
-int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff,
- unsigned long start, unsigned long stop,
- ScreenPtr pScreen);
-void xf86XinputFinalizeInit(DeviceIntPtr dev);
-Bool xf86CheckButton(int button, int down);
-void xf86SwitchCoreDevice(LocalDevicePtr device, DeviceIntPtr core);
-LocalDevicePtr xf86FirstLocalDevice(void);
-int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
-void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
-void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
-void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval,
- int maxval, int resolution, int min_res,
- int max_res);
-void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
-void xf86AddEnabledDevice(InputInfoPtr pInfo);
-void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
-
-/* xf86Helper.c */
-void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
-void xf86DeleteInputDriver(int drvIndex);
-InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
-void xf86DeleteInput(InputInfoPtr pInp, int flags);
-
-/* xf86Option.c */
-void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts);
-
-#endif /* _xf86Xinput_h */
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
deleted file mode 100644
index f7cb065a4..000000000
--- a/hw/xfree86/common/xf86cmap.c
+++ /dev/null
@@ -1,1108 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */
-/*
- * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
-#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for pow on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-
-#include "X.h"
-#include "misc.h"
-#include "Xproto.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-
-#include "resource.h"
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86str.h"
-#include "micmap.h"
-
-#ifdef XFreeXDGA
-#define _XF86DGA_SERVER_
-#include "extensions/xf86dgastr.h"
-#include "dgaproc.h"
-#endif
-
-#include "xf86cmap.h"
-
-#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
- ((CMapScreenPtr) (pScreen)->devPrivates[CMapScreenIndex].ptr)->field)
-#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
-
-#define LOAD_PALETTE(pmap, index) \
- ((pmap == miInstalledMaps[index]) && \
- ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \
- xf86Screens[index]->vtSema || pScreenPriv->isDGAmode))
-
-
-typedef struct _CMapLink {
- ColormapPtr cmap;
- struct _CMapLink *next;
-} CMapLink, *CMapLinkPtr;
-
-typedef struct {
- ScrnInfoPtr pScrn;
- CloseScreenProcPtr CloseScreen;
- CreateColormapProcPtr CreateColormap;
- DestroyColormapProcPtr DestroyColormap;
- InstallColormapProcPtr InstallColormap;
- StoreColorsProcPtr StoreColors;
- Bool (*EnterVT)(int, int);
- Bool (*SwitchMode)(int, DisplayModePtr, int);
- int (*SetDGAMode)(int, int, DGADevicePtr);
- int maxColors;
- int sigRGBbits;
- int gammaElements;
- LOCO *gamma;
- int *PreAllocIndices;
- CMapLinkPtr maps;
- unsigned int flags;
- Bool isDGAmode;
-} CMapScreenRec, *CMapScreenPtr;
-
-typedef struct {
- int numColors;
- LOCO *colors;
- Bool recalculate;
- int overscan;
-} CMapColormapRec, *CMapColormapPtr;
-
-static unsigned long CMapGeneration = 0;
-static int CMapScreenIndex = -1;
-static int CMapColormapIndex = -1;
-
-static void CMapInstallColormap(ColormapPtr);
-static void CMapStoreColors(ColormapPtr, int, xColorItem *);
-static Bool CMapCloseScreen (int, ScreenPtr);
-static Bool CMapCreateColormap (ColormapPtr);
-static void CMapDestroyColormap (ColormapPtr);
-
-static Bool CMapEnterVT(int, int);
-static Bool CMapSwitchMode(int, DisplayModePtr, int);
-static int CMapSetDGAMode(int, int, DGADevicePtr);
-static int CMapChangeGamma(int, Gamma);
-
-static void ComputeGamma(CMapScreenPtr);
-static Bool CMapAllocateColormapPrivate(ColormapPtr);
-static Bool CMapInitDefMap(ColormapPtr);
-static void CMapRefreshColors(ColormapPtr, int, int*);
-static void CMapSetOverscan(ColormapPtr, int, int *);
-static void CMapReinstallMap(ColormapPtr);
-static void CMapUnwrapScreen(ScreenPtr pScreen);
-
-
-
-Bool xf86HandleColormaps(
- ScreenPtr pScreen,
- int maxColors,
- int sigRGBbits,
- xf86LoadPaletteProc *loadPalette,
- xf86SetOverscanProc *setOverscan,
- unsigned int flags
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- ColormapPtr pDefMap = NULL;
- CMapScreenPtr pScreenPriv;
- LOCO *gamma;
- int *indices;
- int elements;
-
- if(!maxColors || !sigRGBbits || !loadPalette)
- return FALSE;
-
- if(CMapGeneration != serverGeneration) {
- if(((CMapScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((CMapColormapIndex = AllocateColormapPrivateIndex(
- CMapInitDefMap)) < 0))
- return FALSE;
- CMapGeneration = serverGeneration;
- }
-
- elements = 1 << sigRGBbits;
-
- if(!(gamma = xalloc(elements * sizeof(LOCO))))
- return FALSE;
-
- if(!(indices = xalloc(maxColors * sizeof(int)))) {
- xfree(gamma);
- return FALSE;
- }
-
- if(!(pScreenPriv = xalloc(sizeof(CMapScreenRec)))) {
- xfree(gamma);
- xfree(indices);
- return FALSE;
- }
-
- pScreen->devPrivates[CMapScreenIndex].ptr = (pointer)pScreenPriv;
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreenPriv->CreateColormap = pScreen->CreateColormap;
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
- pScreenPriv->InstallColormap = pScreen->InstallColormap;
- pScreenPriv->StoreColors = pScreen->StoreColors;
- pScreen->CloseScreen = CMapCloseScreen;
- pScreen->CreateColormap = CMapCreateColormap;
- pScreen->DestroyColormap = CMapDestroyColormap;
- pScreen->InstallColormap = CMapInstallColormap;
- pScreen->StoreColors = CMapStoreColors;
-
- pScreenPriv->pScrn = pScrn;
- pScrn->LoadPalette = loadPalette;
- pScrn->SetOverscan = setOverscan;
- pScreenPriv->maxColors = maxColors;
- pScreenPriv->sigRGBbits = sigRGBbits;
- pScreenPriv->gammaElements = elements;
- pScreenPriv->gamma = gamma;
- pScreenPriv->PreAllocIndices = indices;
- pScreenPriv->maps = NULL;
- pScreenPriv->flags = flags;
- pScreenPriv->isDGAmode = FALSE;
-
- pScreenPriv->EnterVT = pScrn->EnterVT;
- pScreenPriv->SwitchMode = pScrn->SwitchMode;
- pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
-
- if (!(flags & CMAP_LOAD_EVEN_IF_OFFSCREEN)) {
- pScrn->EnterVT = CMapEnterVT;
- if ((flags & CMAP_RELOAD_ON_MODE_SWITCH) && pScrn->SwitchMode)
- pScrn->SwitchMode = CMapSwitchMode;
- }
-#ifdef XFreeXDGA
- pScrn->SetDGAMode = CMapSetDGAMode;
-#endif
- pScrn->ChangeGamma = CMapChangeGamma;
-
- ComputeGamma(pScreenPriv);
-
- /* get the default map */
-
- pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
-
- if(!CMapAllocateColormapPrivate(pDefMap)) {
- CMapUnwrapScreen(pScreen);
- return FALSE;
- }
-
- /* Force the initial map to be loaded */
- miInstalledMaps[pScreen->myNum] = NULL;
- CMapInstallColormap(pDefMap);
- return TRUE;
-}
-
-static Bool
-CMapInitDefMap(ColormapPtr cmap)
-{
- return TRUE;
-}
-
-
-/**** Screen functions ****/
-
-
-static Bool
-CMapCloseScreen (int i, ScreenPtr pScreen)
-{
- CMapUnwrapScreen(pScreen);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static Bool
-CMapAllocateColormapPrivate(ColormapPtr pmap)
-{
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
- CMapColormapPtr pColPriv;
- CMapLinkPtr pLink;
- int numColors;
- LOCO *colors;
-
- if((1 << pmap->pVisual->nplanes) > pScreenPriv->maxColors)
- numColors = pmap->pVisual->ColormapEntries;
- else
- numColors = 1 << pmap->pVisual->nplanes;
-
- if(!(colors = xalloc(numColors * sizeof(LOCO))))
- return FALSE;
-
- if(!(pColPriv = xalloc(sizeof(CMapColormapRec)))) {
- xfree(colors);
- return FALSE;
- }
-
- pmap->devPrivates[CMapColormapIndex].ptr = (pointer)pColPriv;
-
- pColPriv->numColors = numColors;
- pColPriv->colors = colors;
- pColPriv->recalculate = TRUE;
- pColPriv->overscan = -1;
-
- /* add map to list */
- pLink = xalloc(sizeof(CMapLink));
- if(pLink) {
- pLink->cmap = pmap;
- pLink->next = pScreenPriv->maps;
- pScreenPriv->maps = pLink;
- }
-
- return TRUE;
-}
-
-static Bool
-CMapCreateColormap (ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
- Bool ret = FALSE;
-
- pScreen->CreateColormap = pScreenPriv->CreateColormap;
- if((*pScreen->CreateColormap)(pmap)) {
- if(CMapAllocateColormapPrivate(pmap))
- ret = TRUE;
- }
- pScreen->CreateColormap = CMapCreateColormap;
-
- return ret;
-}
-
-static void
-CMapDestroyColormap (ColormapPtr cmap)
-{
- ScreenPtr pScreen = cmap->pScreen;
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
- CMapColormapPtr pColPriv =
- (CMapColormapPtr) cmap->devPrivates[CMapColormapIndex].ptr;
- CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps;
-
- if(pColPriv) {
- if(pColPriv->colors) xfree(pColPriv->colors);
- xfree(pColPriv);
- }
-
- /* remove map from list */
- while(pLink) {
- if(pLink->cmap == cmap) {
- if(prevLink)
- prevLink->next = pLink->next;
- else
- pScreenPriv->maps = pLink->next;
- xfree(pLink);
- break;
- }
- prevLink = pLink;
- pLink = pLink->next;
- }
-
- if(pScreenPriv->DestroyColormap) {
- pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
- (*pScreen->DestroyColormap)(cmap);
- pScreen->DestroyColormap = CMapDestroyColormap;
- }
-}
-
-
-
-static void
-CMapStoreColors(
- ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs
-){
- ScreenPtr pScreen = pmap->pScreen;
- VisualPtr pVisual = pmap->pVisual;
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
- int *indices = pScreenPriv->PreAllocIndices;
- int num = ndef;
-
- /* At the moment this isn't necessary since there's nobody below us */
- pScreen->StoreColors = pScreenPriv->StoreColors;
- (*pScreen->StoreColors)(pmap, ndef, pdefs);
- pScreen->StoreColors = CMapStoreColors;
-
- /* should never get here for these */
- if( (pVisual->class == TrueColor) ||
- (pVisual->class == StaticColor) ||
- (pVisual->class == StaticGray))
- return;
-
- if(pVisual->class == DirectColor) {
- CMapColormapPtr pColPriv =
- (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
- int i;
-
- if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
- int index;
-
- num = 0;
- while(ndef--) {
- if(pdefs[ndef].flags & DoRed) {
- index = (pdefs[ndef].pixel & pVisual->redMask) >>
- pVisual->offsetRed;
- i = num;
- while(i--)
- if(indices[i] == index) break;
- if(i == -1)
- indices[num++] = index;
- }
- if(pdefs[ndef].flags & DoGreen) {
- index = (pdefs[ndef].pixel & pVisual->greenMask) >>
- pVisual->offsetGreen;
- i = num;
- while(i--)
- if(indices[i] == index) break;
- if(i == -1)
- indices[num++] = index;
- }
- if(pdefs[ndef].flags & DoBlue) {
- index = (pdefs[ndef].pixel & pVisual->blueMask) >>
- pVisual->offsetBlue;
- i = num;
- while(i--)
- if(indices[i] == index) break;
- if(i == -1)
- indices[num++] = index;
- }
- }
-
- } else {
- /* not really as overkill as it seems */
- num = pColPriv->numColors;
- for(i = 0; i < pColPriv->numColors; i++)
- indices[i] = i;
- }
- } else {
- while(ndef--)
- indices[ndef] = pdefs[ndef].pixel;
- }
-
- CMapRefreshColors(pmap, num, indices);
-}
-
-
-static void
-CMapInstallColormap(ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- int index = pScreen->myNum;
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
-
- if (pmap == miInstalledMaps[index])
- return;
-
- pScreen->InstallColormap = pScreenPriv->InstallColormap;
- (*pScreen->InstallColormap)(pmap);
- pScreen->InstallColormap = CMapInstallColormap;
-
- /* Important. We let the lower layers, namely DGA,
- overwrite the choice of Colormap to install */
- pmap = miInstalledMaps[index];
-
- if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
- (pmap->pVisual->class == TrueColor) &&
- ((1 << pmap->pVisual->nplanes) > pScreenPriv->maxColors))
- return;
-
- if(LOAD_PALETTE(pmap, index))
- CMapReinstallMap(pmap);
-}
-
-
-/**** ScrnInfoRec functions ****/
-
-static Bool
-CMapEnterVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
-
- if((*pScreenPriv->EnterVT)(index, flags)) {
- if(miInstalledMaps[index])
- CMapReinstallMap(miInstalledMaps[index]);
- return TRUE;
- }
- return FALSE;
-}
-
-
-static Bool
-CMapSwitchMode(int index, DisplayModePtr mode, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
-
- if((*pScreenPriv->SwitchMode)(index, mode, flags)) {
- if(miInstalledMaps[index])
- CMapReinstallMap(miInstalledMaps[index]);
- return TRUE;
- }
- return FALSE;
-}
-
-#ifdef XFreeXDGA
-static int
-CMapSetDGAMode(int index, int num, DGADevicePtr dev)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
- int ret;
-
- ret = (*pScreenPriv->SetDGAMode)(index, num, dev);
-
- pScreenPriv->isDGAmode = DGAActive(index);
-
- if(!pScreenPriv->isDGAmode && miInstalledMaps[index]
- && xf86Screens[pScreen->myNum]->vtSema)
- CMapReinstallMap(miInstalledMaps[index]);
-
- return ret;
-}
-#endif
-
-
-/**** Utilities ****/
-
-static void
-CMapReinstallMap(ColormapPtr pmap)
-{
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
- CMapColormapPtr cmapPriv =
- (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
- ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
- int i = cmapPriv->numColors;
- int *indices = pScreenPriv->PreAllocIndices;
-
- while(i--)
- indices[i] = i;
-
- if(cmapPriv->recalculate)
- CMapRefreshColors(pmap, cmapPriv->numColors, indices);
- else {
- (*pScrn->LoadPalette)(pScrn, cmapPriv->numColors,
- indices, cmapPriv->colors, pmap->pVisual);
- if (pScrn->SetOverscan) {
-#ifdef DEBUGOVERSCAN
- ErrorF("SetOverscan() called from CMapReinstallMap\n");
-#endif
- pScrn->SetOverscan(pScrn, cmapPriv->overscan);
- }
- }
-
- cmapPriv->recalculate = FALSE;
-}
-
-
-static void
-CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
-{
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
- CMapColormapPtr pColPriv =
- (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
- VisualPtr pVisual = pmap->pVisual;
- ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
- int numColors, i;
- LOCO *gamma, *colors;
- EntryPtr entry;
- int reds, greens, blues, maxValue, index, shift;
-
- numColors = pColPriv->numColors;
- shift = 16 - pScreenPriv->sigRGBbits;
- maxValue = (1 << pScreenPriv->sigRGBbits) - 1;
- gamma = pScreenPriv->gamma;
- colors = pColPriv->colors;
-
- reds = pVisual->redMask >> pVisual->offsetRed;
- greens = pVisual->greenMask >> pVisual->offsetGreen;
- blues = pVisual->blueMask >> pVisual->offsetBlue;
-
- switch(pVisual->class) {
- case StaticGray:
- for(i = 0; i <= numColors - 1; i++) {
- index = i * maxValue / numColors;
- colors[i].red = gamma[index].red;
- colors[i].green = gamma[index].green;
- colors[i].blue = gamma[index].blue;
- }
- break;
- case TrueColor:
- if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
- for(i = 0; i <= reds; i++)
- colors[i].red = gamma[i * maxValue / reds].red;
- for(i = 0; i <= greens; i++)
- colors[i].green = gamma[i * maxValue / greens].green;
- for(i = 0; i <= blues; i++)
- colors[i].blue = gamma[i * maxValue / blues].blue;
- break;
- }
- for(i = 0; i < numColors; i++) {
- colors[i].red = gamma[((i >> pVisual->offsetRed) & reds) *
- maxValue / reds].red;
- colors[i].green = gamma[((i >> pVisual->offsetGreen) & greens) *
- maxValue / greens].green;
- colors[i].blue = gamma[((i >> pVisual->offsetBlue) & blues) *
- maxValue / blues].blue;
- }
- break;
- case StaticColor:
- case PseudoColor:
- case GrayScale:
- for(i = 0; i < defs; i++) {
- index = indices[i];
- entry = (EntryPtr)&pmap->red[index];
-
- if(entry->fShared) {
- colors[index].red =
- gamma[entry->co.shco.red->color >> shift].red;
- colors[index].green =
- gamma[entry->co.shco.green->color >> shift].green;
- colors[index].blue =
- gamma[entry->co.shco.blue->color >> shift].blue;
- } else {
- colors[index].red =
- gamma[entry->co.local.red >> shift].red;
- colors[index].green =
- gamma[entry->co.local.green >> shift].green;
- colors[index].blue =
- gamma[entry->co.local.blue >> shift].blue;
- }
- }
- break;
- case DirectColor:
- if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
- for(i = 0; i < defs; i++) {
- index = indices[i];
- if(index <= reds)
- colors[index].red =
- gamma[pmap->red[index].co.local.red >> shift].red;
- if(index <= greens)
- colors[index].green =
- gamma[pmap->green[index].co.local.green >> shift].green;
- if(index <= blues)
- colors[index].blue =
- gamma[pmap->blue[index].co.local.blue >> shift].blue;
-
- }
- break;
- }
- for(i = 0; i < defs; i++) {
- index = indices[i];
-
- colors[index].red = gamma[pmap->red[
- (index >> pVisual->offsetRed) & reds
- ].co.local.red >> shift].red;
- colors[index].green = gamma[pmap->green[
- (index >> pVisual->offsetGreen) & greens
- ].co.local.green >> shift].green;
- colors[index].blue = gamma[pmap->blue[
- (index >> pVisual->offsetBlue) & blues
- ].co.local.blue >> shift].blue;
- }
- break;
- }
-
-
- if(LOAD_PALETTE(pmap, pmap->pScreen->myNum))
- (*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices,
- colors, pmap->pVisual);
-
- if (pScrn->SetOverscan)
- CMapSetOverscan(pmap, defs, indices);
-
-}
-
-static Bool
-CMapCompareColors(LOCO *color1, LOCO *color2)
-{
- /* return TRUE if the color1 is "closer" to black than color2 */
-#ifdef DEBUGOVERSCAN
- ErrorF("#%02x%02x%02x vs #%02x%02x%02x (%d vs %d)\n",
- color1->red, color1->green, color1->blue,
- color2->red, color2->green, color2->blue,
- color1->red + color1->green + color1->blue,
- color2->red + color2->green + color2->blue);
-#endif
- return (color1->red + color1->green + color1->blue <
- color2->red + color2->green + color2->blue);
-}
-
-static void
-CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
-{
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
- CMapColormapPtr pColPriv =
- (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
- ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
- VisualPtr pVisual = pmap->pVisual;
- int i;
- LOCO *colors;
- int index;
- Bool newOverscan = FALSE;
- int overscan, tmpOverscan;
-
- colors = pColPriv->colors;
- overscan = pColPriv->overscan;
-
- /*
- * Search for a new overscan index in the following cases:
- *
- * - The index hasn't yet been initialised.  In this case search
- * for an index that is black or a close match to black.
- *
- * - The colour of the old index is changed. In this case search
- * all indices for a black or close match to black.
- *
- * - The colour of the old index wasn't black. In this case only
- * search the indices that were changed for a better match to black.
- */
-
- switch (pVisual->class) {
- case StaticGray:
- case TrueColor:
- /* Should only come here once. Initialise the overscan index to 0 */
- overscan = 0;
- newOverscan = TRUE;
- break;
- case StaticColor:
- /*
- * Only come here once, but search for the overscan in the same way
- * as for the other cases.
- */
- case DirectColor:
- case PseudoColor:
- case GrayScale:
- if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) {
- /* Uninitialised */
- newOverscan = TRUE;
- } else {
- /* Check if the overscan was changed */
- for (i = 0; i < defs; i++) {
- index = indices[i];
- if (index == overscan) {
- newOverscan = TRUE;
- break;
- }
- }
- }
- if (newOverscan) {
- /* The overscan is either uninitialised or it has been changed */
-
- if (overscan < 0 || overscan > pScreenPriv->maxColors - 1)
- tmpOverscan = pScreenPriv->maxColors - 1;
- else
- tmpOverscan = overscan;
-
- /* search all entries for a close match to black */
- for (i = pScreenPriv->maxColors - 1; i >= 0; i--) {
- if (colors[i].red == 0 && colors[i].green == 0 &&
- colors[i].blue == 0) {
- overscan = i;
-#ifdef DEBUGOVERSCAN
- ErrorF("Black found at index 0x%02x\n", i);
-#endif
- break;
- } else {
-#ifdef DEBUGOVERSCAN
- ErrorF("0x%02x: ", i);
-#endif
- if (CMapCompareColors(&colors[i], &colors[tmpOverscan])) {
- tmpOverscan = i;
-#ifdef DEBUGOVERSCAN
- ErrorF("possible \"Black\" at index 0x%02x\n", i);
-#endif
- }
- }
- }
- if (i < 0)
- overscan = tmpOverscan;
- } else {
- /* Check of the old overscan wasn't black */
- if (colors[overscan].red != 0 || colors[overscan].green != 0 ||
- colors[overscan].blue != 0) {
- int oldOverscan = tmpOverscan = overscan;
- /* See of there is now a better match */
- for (i = 0; i < defs; i++) {
- index = indices[i];
- if (colors[index].red == 0 && colors[index].green == 0 &&
- colors[index].blue == 0) {
- overscan = index;
-#ifdef DEBUGOVERSCAN
- ErrorF("Black found at index 0x%02x\n", index);
-#endif
- break;
- } else {
-#ifdef DEBUGOVERSCAN
- ErrorF("0x%02x: ", index);
-#endif
- if (CMapCompareColors(&colors[index],
- &colors[tmpOverscan])) {
- tmpOverscan = index;
-#ifdef DEBUGOVERSCAN
- ErrorF("possible \"Black\" at index 0x%02x\n",
- index);
-#endif
- }
- }
- }
- if (i == defs)
- overscan = tmpOverscan;
- if (overscan != oldOverscan)
- newOverscan = TRUE;
- }
- }
- break;
- }
- if (newOverscan) {
- pColPriv->overscan = overscan;
- if (LOAD_PALETTE(pmap, pmap->pScreen->myNum)) {
-#ifdef DEBUGOVERSCAN
- ErrorF("SetOverscan() called from CmapSetOverscan\n");
-#endif
- pScrn->SetOverscan(pScreenPriv->pScrn, overscan);
- }
- }
-}
-
-static void
-CMapUnwrapScreen(ScreenPtr pScreen)
-{
- CMapScreenPtr pScreenPriv =
- (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->CreateColormap = pScreenPriv->CreateColormap;
- pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
- pScreen->InstallColormap = pScreenPriv->InstallColormap;
- pScreen->StoreColors = pScreenPriv->StoreColors;
-
- pScrn->EnterVT = pScreenPriv->EnterVT;
- pScrn->SwitchMode = pScreenPriv->SwitchMode;
- pScrn->SetDGAMode = pScreenPriv->SetDGAMode;
-
- xfree(pScreenPriv->gamma);
- xfree(pScreenPriv->PreAllocIndices);
- xfree(pScreenPriv);
-}
-
-
-static void
-ComputeGamma(CMapScreenPtr priv)
-{
- int elements = priv->gammaElements - 1;
- double RedGamma, GreenGamma, BlueGamma;
- int i;
-
-#ifndef DONT_CHECK_GAMMA
- /* This check is to catch drivers that are not initialising pScrn->gamma */
- if (priv->pScrn->gamma.red < GAMMA_MIN ||
- priv->pScrn->gamma.red > GAMMA_MAX ||
- priv->pScrn->gamma.green < GAMMA_MIN ||
- priv->pScrn->gamma.green > GAMMA_MAX ||
- priv->pScrn->gamma.blue < GAMMA_MIN ||
- priv->pScrn->gamma.blue > GAMMA_MAX) {
-
- xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
- "The %s driver didn't call xf86SetGamma() to initialise\n"
- "\tthe gamma values.\n", priv->pScrn->driverName);
- xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
- "PLEASE FIX THE `%s' DRIVER!\n", priv->pScrn->driverName);
- priv->pScrn->gamma.red = 1.0;
- priv->pScrn->gamma.green = 1.0;
- priv->pScrn->gamma.blue = 1.0;
- }
-#endif
-
- RedGamma = 1.0 / (double)priv->pScrn->gamma.red;
- GreenGamma = 1.0 / (double)priv->pScrn->gamma.green;
- BlueGamma = 1.0 / (double)priv->pScrn->gamma.blue;
-
- for(i = 0; i <= elements; i++) {
- if(RedGamma == 1.0)
- priv->gamma[i].red = i;
- else
- priv->gamma[i].red = (CARD16)(pow((double)i/(double)elements,
- RedGamma) * (double)elements + 0.5);
-
- if(GreenGamma == 1.0)
- priv->gamma[i].green = i;
- else
- priv->gamma[i].green = (CARD16)(pow((double)i/(double)elements,
- GreenGamma) * (double)elements + 0.5);
-
- if(BlueGamma == 1.0)
- priv->gamma[i].blue = i;
- else
- priv->gamma[i].blue = (CARD16)(pow((double)i/(double)elements,
- BlueGamma) * (double)elements + 0.5);
- }
-}
-
-
-int
-CMapChangeGamma(
- int index,
- Gamma gamma
-){
- ScrnInfoPtr pScrn = xf86Screens[index];
- ScreenPtr pScreen = pScrn->pScreen;
- CMapColormapPtr pColPriv;
- CMapScreenPtr pScreenPriv;
- CMapLinkPtr pLink;
-
- /* Is this sufficient checking ? */
- if(CMapScreenIndex == -1)
- return BadImplementation;
-
- pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
- if(!pScreenPriv)
- return BadImplementation;
-
- if (gamma.red < GAMMA_MIN || gamma.red > GAMMA_MAX ||
- gamma.green < GAMMA_MIN || gamma.green > GAMMA_MAX ||
- gamma.blue < GAMMA_MIN || gamma.blue > GAMMA_MAX)
- return BadValue;
-
- pScrn->gamma.red = gamma.red;
- pScrn->gamma.green = gamma.green;
- pScrn->gamma.blue = gamma.blue;
-
- ComputeGamma(pScreenPriv);
-
- /* mark all colormaps on this screen */
- pLink = pScreenPriv->maps;
- while(pLink) {
- pColPriv =
- (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr;
- pColPriv->recalculate = TRUE;
- pLink = pLink->next;
- }
-
- if(miInstalledMaps[pScreen->myNum] &&
- ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
- pScrn->vtSema || pScreenPriv->isDGAmode)) {
- ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
-
- if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
- (pMap->pVisual->class == TrueColor) &&
- ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) {
-
- /* if the current map doesn't have a palette look
- for another map to change the gamma on. */
-
- pLink = pScreenPriv->maps;
- while(pLink) {
- if(pLink->cmap->pVisual->class == PseudoColor)
- break;
- pLink = pLink->next;
- }
-
- if(pLink) {
- /* need to trick CMapRefreshColors() into thinking
- this is the currently installed map */
- miInstalledMaps[pScreen->myNum] = pLink->cmap;
- CMapReinstallMap(pLink->cmap);
- miInstalledMaps[pScreen->myNum] = pMap;
- }
- } else
- CMapReinstallMap(pMap);
- }
-
- return Success;
-}
-
-
-static void
-ComputeGammaRamp (
- CMapScreenPtr priv,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-){
- int elements = priv->gammaElements;
- LOCO *entry = priv->gamma;
- int shift = 16 - priv->sigRGBbits;
-
- while(elements--) {
- entry->red = *(red++) >> shift;
- entry->green = *(green++) >> shift;
- entry->blue = *(blue++) >> shift;
- entry++;
- }
-}
-
-int
-xf86ChangeGammaRamp(
- ScreenPtr pScreen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- CMapColormapPtr pColPriv;
- CMapScreenPtr pScreenPriv;
- CMapLinkPtr pLink;
-
- if(CMapScreenIndex == -1)
- return BadImplementation;
-
- pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
- if(!pScreenPriv)
- return BadImplementation;
-
- if(pScreenPriv->gammaElements != size)
- return BadValue;
-
- ComputeGammaRamp(pScreenPriv, red, green, blue);
-
- /* mark all colormaps on this screen */
- pLink = pScreenPriv->maps;
- while(pLink) {
- pColPriv =
- (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr;
- pColPriv->recalculate = TRUE;
- pLink = pLink->next;
- }
-
- if(miInstalledMaps[pScreen->myNum] &&
- ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
- pScrn->vtSema || pScreenPriv->isDGAmode)) {
- ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
-
- if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
- (pMap->pVisual->class == TrueColor) &&
- ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) {
-
- /* if the current map doesn't have a palette look
- for another map to change the gamma on. */
-
- pLink = pScreenPriv->maps;
- while(pLink) {
- if(pLink->cmap->pVisual->class == PseudoColor)
- break;
- pLink = pLink->next;
- }
-
- if(pLink) {
- /* need to trick CMapRefreshColors() into thinking
- this is the currently installed map */
- miInstalledMaps[pScreen->myNum] = pLink->cmap;
- CMapReinstallMap(pLink->cmap);
- miInstalledMaps[pScreen->myNum] = pMap;
- }
- } else
- CMapReinstallMap(pMap);
- }
-
- return Success;
-}
-
-int
-xf86GetGammaRampSize(ScreenPtr pScreen)
-{
- CMapScreenPtr pScreenPriv;
-
- if(CMapScreenIndex == -1) return 0;
-
- pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
- if(!pScreenPriv) return 0;
-
- return pScreenPriv->gammaElements;
-}
-
-int
-xf86GetGammaRamp(
- ScreenPtr pScreen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-){
- CMapScreenPtr pScreenPriv;
- LOCO *entry;
- int shift, sigbits;
-
- if(CMapScreenIndex == -1)
- return BadImplementation;
-
- pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
- if(!pScreenPriv)
- return BadImplementation;
-
- if(size > pScreenPriv->gammaElements)
- return BadValue;
-
- entry = pScreenPriv->gamma;
- sigbits = pScreenPriv->sigRGBbits;
-
- while(size--) {
- *red = entry->red << (16 - sigbits);
- *green = entry->green << (16 - sigbits);
- *blue = entry->blue << (16 - sigbits);
- shift = sigbits;
- while(shift < 16) {
- *red |= *red >> shift;
- *green |= *green >> shift;
- *blue |= *blue >> shift;
- shift += sigbits;
- }
- red++; green++; blue++;
- entry++;
- }
-
- return Success;
-}
-
-int
-xf86ChangeGamma(
- ScreenPtr pScreen,
- Gamma gamma
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- if(pScrn->ChangeGamma)
- return (*pScrn->ChangeGamma)(pScreen->myNum, gamma);
-
- return Success; /* Success? */
-}
diff --git a/hw/xfree86/common/xf86cmap.h b/hw/xfree86/common/xf86cmap.h
deleted file mode 100644
index 4291b971a..000000000
--- a/hw/xfree86/common/xf86cmap.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.9 2003/10/17 20:02:12 alanh Exp $ */
-
-/*
- * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86CMAP_H
-#define _XF86CMAP_H
-
-#include "xf86str.h"
-#include "colormapst.h"
-
-#define CMAP_PALETTED_TRUECOLOR 0x0000001
-#define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002
-#define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004
-
-Bool xf86HandleColormaps(
- ScreenPtr pScreen,
- int maxCol,
- int sigRGBbits,
- xf86LoadPaletteProc *loadPalette,
- xf86SetOverscanProc *setOverscan,
- unsigned int flags
-);
-
-int
-xf86ChangeGamma(
- ScreenPtr pScreen,
- Gamma newGamma
-);
-
-int
-xf86ChangeGammaRamp(
- ScreenPtr pScreen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-);
-
-int xf86GetGammaRampSize(ScreenPtr pScreen);
-
-int
-xf86GetGammaRamp(
- ScreenPtr pScreen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-);
-
-#endif /* _XF86CMAP_H */
-
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
deleted file mode 100644
index 8a807624f..000000000
--- a/hw/xfree86/common/xf86fbBus.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.3 2003/08/24 17:36:55 dawes Exp $ */
-
-/*
- * Copyright (c) 2000-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the interfaces to the bus-specific code
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-Bool fbSlotClaimed = FALSE;
-
-int
-xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
-{
- EntityPtr p;
- int num;
-
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = 0;
- p->busType = BUS_NONE;
- p->active = active;
- p->inUse = FALSE;
- xf86AddDevToEntity(num, dev);
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- p->busAcc = NULL;
-
- fbSlotClaimed = TRUE;
- return num;
-}
-
-/*
- * Get the list of FB "slots" claimed by a screen
- */
-int
-xf86GetFbInfoForScreen(int scrnIndex)
-{
- int num = 0;
- int i;
- EntityPtr p;
-
- for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
- p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
- if (p->busType == BUS_NONE) {
- num++;
- }
- }
- return num;
-}
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
deleted file mode 100644
index b7c4afa1c..000000000
--- a/hw/xfree86/common/xf86fbman.c
+++ /dev/null
@@ -1,1443 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.28 2003/11/03 05:11:03 tsi Exp $ */
-
-/*
- * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "misc.h"
-#include "xf86.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "xf86fbman.h"
-
-/*
-#define DEBUG
-*/
-
-static int xf86FBMangerIndex = -1;
-static unsigned long xf86ManagerGeneration = 0;
-
-Bool xf86RegisterOffscreenManager(
- ScreenPtr pScreen,
- FBManagerFuncsPtr funcs
-){
-
- if(xf86ManagerGeneration != serverGeneration) {
- if((xf86FBMangerIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- xf86ManagerGeneration = serverGeneration;
- }
-
- pScreen->devPrivates[xf86FBMangerIndex].ptr = (pointer)funcs;
-
- return TRUE;
-}
-
-
-Bool
-xf86FBManagerRunning(ScreenPtr pScreen)
-{
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!pScreen->devPrivates[xf86FBMangerIndex].ptr)
- return FALSE;
-
- return TRUE;
-}
-
-Bool
-xf86RegisterFreeBoxCallback(
- ScreenPtr pScreen,
- FreeBoxCallbackProcPtr FreeBoxCallback,
- pointer devPriv
-){
- FBManagerFuncsPtr funcs;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->RegisterFreeBoxCallback)(pScreen, FreeBoxCallback, devPriv);
-}
-
-
-FBAreaPtr
-xf86AllocateOffscreenArea(
- ScreenPtr pScreen,
- int w, int h,
- int gran,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-){
- FBManagerFuncsPtr funcs;
-
- if(xf86FBMangerIndex < 0)
- return NULL;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return NULL;
-
- return (*funcs->AllocateOffscreenArea)(
- pScreen, w, h, gran, moveCB, removeCB, privData);
-}
-
-
-FBLinearPtr
-xf86AllocateOffscreenLinear(
- ScreenPtr pScreen,
- int length,
- int gran,
- MoveLinearCallbackProcPtr moveCB,
- RemoveLinearCallbackProcPtr removeCB,
- pointer privData
-){
- FBManagerFuncsPtr funcs;
-
- if(xf86FBMangerIndex < 0)
- return NULL;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return NULL;
-
- return (*funcs->AllocateOffscreenLinear)(
- pScreen, length, gran, moveCB, removeCB, privData);
-}
-
-
-void
-xf86FreeOffscreenArea(FBAreaPtr area)
-{
- FBManagerFuncsPtr funcs;
-
- if(!area) return;
-
- if(xf86FBMangerIndex < 0)
- return;
- if(!(funcs =
- (FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return;
-
- (*funcs->FreeOffscreenArea)(area);
-
- return;
-}
-
-
-void
-xf86FreeOffscreenLinear(FBLinearPtr linear)
-{
- FBManagerFuncsPtr funcs;
-
- if(!linear) return;
-
- if(xf86FBMangerIndex < 0)
- return;
- if(!(funcs =
- (FBManagerFuncsPtr)linear->pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return;
-
- (*funcs->FreeOffscreenLinear)(linear);
-
- return;
-}
-
-
-Bool
-xf86ResizeOffscreenArea(
- FBAreaPtr resize,
- int w, int h
-){
- FBManagerFuncsPtr funcs;
-
- if(!resize) return FALSE;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs =
- (FBManagerFuncsPtr)resize->pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->ResizeOffscreenArea)(resize, w, h);
-}
-
-Bool
-xf86ResizeOffscreenLinear(
- FBLinearPtr resize,
- int size
-){
- FBManagerFuncsPtr funcs;
-
- if(!resize) return FALSE;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs =
- (FBManagerFuncsPtr)resize->pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->ResizeOffscreenLinear)(resize, size);
-}
-
-
-Bool
-xf86QueryLargestOffscreenArea(
- ScreenPtr pScreen,
- int *w, int *h,
- int gran,
- int preferences,
- int severity
-){
- FBManagerFuncsPtr funcs;
-
- *w = 0;
- *h = 0;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->QueryLargestOffscreenArea)(
- pScreen, w, h, gran, preferences, severity);
-}
-
-Bool
-xf86QueryLargestOffscreenLinear(
- ScreenPtr pScreen,
- int *size,
- int gran,
- int severity
-){
- FBManagerFuncsPtr funcs;
-
- *size = 0;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->QueryLargestOffscreenLinear)(
- pScreen, size, gran, severity);
-}
-
-
-Bool
-xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
-{
- FBManagerFuncsPtr funcs;
-
- if(xf86FBMangerIndex < 0)
- return FALSE;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return FALSE;
-
- return (*funcs->PurgeOffscreenAreas)(pScreen);
-}
-
-/************************************************************\
-
- Below is a specific implementation of an offscreen manager.
-
-\************************************************************/
-
-static unsigned long xf86FBGeneration = 0;
-static int xf86FBScreenIndex = -1;
-
-typedef struct _FBLink {
- FBArea area;
- struct _FBLink *next;
-} FBLink, *FBLinkPtr;
-
-typedef struct _FBLinearLink {
- FBLinear linear;
- int free; /* need to add free here as FBLinear is publicly accessible */
- FBAreaPtr area; /* only used if allocation came from XY area */
- struct _FBLinearLink *next;
-} FBLinearLink, *FBLinearLinkPtr;
-
-
-typedef struct {
- ScreenPtr pScreen;
- RegionPtr InitialBoxes;
- RegionPtr FreeBoxes;
- FBLinkPtr UsedAreas;
- int NumUsedAreas;
- FBLinearLinkPtr LinearAreas;
- CloseScreenProcPtr CloseScreen;
- int NumCallbacks;
- FreeBoxCallbackProcPtr *FreeBoxesUpdateCallback;
- DevUnion *devPrivates;
-} FBManager, *FBManagerPtr;
-
-
-static void
-SendCallFreeBoxCallbacks(FBManagerPtr offman)
-{
- int i = offman->NumCallbacks;
-
- while(i--) {
- (*offman->FreeBoxesUpdateCallback[i])(
- offman->pScreen, offman->FreeBoxes, offman->devPrivates[i].ptr);
- }
-}
-
-static Bool
-localRegisterFreeBoxCallback(
- ScreenPtr pScreen,
- FreeBoxCallbackProcPtr FreeBoxCallback,
- pointer devPriv
-){
- FBManagerPtr offman;
- FreeBoxCallbackProcPtr *newCallbacks;
- DevUnion *newPrivates;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- newCallbacks = xrealloc( offman->FreeBoxesUpdateCallback,
- sizeof(FreeBoxCallbackProcPtr) * (offman->NumCallbacks + 1));
-
- newPrivates = xrealloc(offman->devPrivates,
- sizeof(DevUnion) * (offman->NumCallbacks + 1));
-
- if(!newCallbacks || !newPrivates)
- return FALSE;
-
- offman->FreeBoxesUpdateCallback = newCallbacks;
- offman->devPrivates = newPrivates;
-
- offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
- offman->devPrivates[offman->NumCallbacks].ptr = devPriv;
- offman->NumCallbacks++;
-
- SendCallFreeBoxCallbacks(offman);
-
- return TRUE;
-}
-
-
-static FBAreaPtr
-AllocateArea(
- FBManagerPtr offman,
- int w, int h,
- int granularity,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-){
- ScreenPtr pScreen = offman->pScreen;
- FBLinkPtr link = NULL;
- FBAreaPtr area = NULL;
- RegionRec NewReg;
- int i, x = 0, num;
- BoxPtr boxp;
-
- if(granularity <= 1) granularity = 0;
-
- boxp = REGION_RECTS(offman->FreeBoxes);
- num = REGION_NUM_RECTS(offman->FreeBoxes);
-
- /* look through the free boxes */
- for(i = 0; i < num; i++, boxp++) {
- x = boxp->x1;
- if(granularity) {
- int tmp = x % granularity;
- if(tmp) x += (granularity - tmp);
- }
-
- if(((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w))
- continue;
-
- link = xalloc(sizeof(FBLink));
- if(!link) return NULL;
-
- area = &(link->area);
- link->next = offman->UsedAreas;
- offman->UsedAreas = link;
- offman->NumUsedAreas++;
- break;
- }
-
- /* try to boot a removeable one out if we are not expendable ourselves */
- if(!area && !removeCB) {
- link = offman->UsedAreas;
-
- while(link) {
- if(!link->area.RemoveAreaCallback) {
- link = link->next;
- continue;
- }
-
- boxp = &(link->area.box);
- x = boxp->x1;
- if(granularity) {
- int tmp = x % granularity;
- if(tmp) x += (granularity - tmp);
- }
-
- if(((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w)) {
- link = link->next;
- continue;
- }
-
- /* bye, bye */
- (*link->area.RemoveAreaCallback)(&link->area);
- REGION_INIT(pScreen, &NewReg, &(link->area.box), 1);
- REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
- REGION_UNINIT(pScreen, &NewReg);
-
- area = &(link->area);
- break;
- }
- }
-
- if(area) {
- area->pScreen = pScreen;
- area->granularity = granularity;
- area->box.x1 = x;
- area->box.x2 = x + w;
- area->box.y1 = boxp->y1;
- area->box.y2 = boxp->y1 + h;
- area->MoveAreaCallback = moveCB;
- area->RemoveAreaCallback = removeCB;
- area->devPrivate.ptr = privData;
-
- REGION_INIT(pScreen, &NewReg, &(area->box), 1);
- REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
- REGION_UNINIT(pScreen, &NewReg);
- }
-
- return area;
-}
-
-static FBAreaPtr
-localAllocateOffscreenArea(
- ScreenPtr pScreen,
- int w, int h,
- int gran,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-){
- FBManagerPtr offman;
- FBAreaPtr area = NULL;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- if((area = AllocateArea(offman, w, h, gran, moveCB, removeCB, privData)))
- SendCallFreeBoxCallbacks(offman);
-
- return area;
-}
-
-
-static void
-localFreeOffscreenArea(FBAreaPtr area)
-{
- FBManagerPtr offman;
- FBLinkPtr pLink, pLinkPrev = NULL;
- RegionRec FreedRegion;
- ScreenPtr pScreen;
-
- pScreen = area->pScreen;
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- pLink = offman->UsedAreas;
- if(!pLink) return;
-
- while(&(pLink->area) != area) {
- pLinkPrev = pLink;
- pLink = pLink->next;
- if(!pLink) return;
- }
-
- /* put the area back into the pool */
- REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
- REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
- REGION_UNINIT(pScreen, &FreedRegion);
-
- if(pLinkPrev)
- pLinkPrev->next = pLink->next;
- else offman->UsedAreas = pLink->next;
-
- xfree(pLink);
- offman->NumUsedAreas--;
-
- SendCallFreeBoxCallbacks(offman);
-}
-
-
-
-static Bool
-localResizeOffscreenArea(
- FBAreaPtr resize,
- int w, int h
-){
- FBManagerPtr offman;
- ScreenPtr pScreen;
- BoxRec OrigArea;
- RegionRec FreedReg;
- FBAreaPtr area = NULL;
- FBLinkPtr pLink, newLink, pLinkPrev = NULL;
-
- pScreen = resize->pScreen;
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- /* find this link */
- if(!(pLink = offman->UsedAreas))
- return FALSE;
-
- while(&(pLink->area) != resize) {
- pLinkPrev = pLink;
- pLink = pLink->next;
- if(!pLink) return FALSE;
- }
-
- OrigArea.x1 = resize->box.x1;
- OrigArea.x2 = resize->box.x2;
- OrigArea.y1 = resize->box.y1;
- OrigArea.y2 = resize->box.y2;
-
- /* if it's smaller, this is easy */
-
- if((w <= (resize->box.x2 - resize->box.x1)) &&
- (h <= (resize->box.y2 - resize->box.y1))) {
- RegionRec NewReg;
-
- resize->box.x2 = resize->box.x1 + w;
- resize->box.y2 = resize->box.y1 + h;
-
- if((resize->box.y2 == OrigArea.y2) &&
- (resize->box.x2 == OrigArea.x2))
- return TRUE;
-
- REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
- REGION_INIT(pScreen, &NewReg, &(resize->box), 1);
- REGION_SUBTRACT(pScreen, &FreedReg, &FreedReg, &NewReg);
- REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
- REGION_UNINIT(pScreen, &FreedReg);
- REGION_UNINIT(pScreen, &NewReg);
-
- SendCallFreeBoxCallbacks(offman);
-
- return TRUE;
- }
-
-
- /* otherwise we remove the old region */
-
- REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
- REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
-
- /* remove the old link */
- if(pLinkPrev)
- pLinkPrev->next = pLink->next;
- else offman->UsedAreas = pLink->next;
-
- /* and try to add a new one */
-
- if((area = AllocateArea(offman, w, h, resize->granularity,
- resize->MoveAreaCallback, resize->RemoveAreaCallback,
- resize->devPrivate.ptr))) {
-
- /* copy data over to our link and replace the new with old */
- memcpy(resize, area, sizeof(FBArea));
-
- pLinkPrev = NULL;
- newLink = offman->UsedAreas;
-
- while(&(newLink->area) != area) {
- pLinkPrev = newLink;
- newLink = newLink->next;
- }
-
- if(pLinkPrev)
- pLinkPrev->next = newLink->next;
- else offman->UsedAreas = newLink->next;
-
- pLink->next = offman->UsedAreas;
- offman->UsedAreas = pLink;
-
- xfree(newLink);
-
- /* AllocateArea added one but we really only exchanged one */
- offman->NumUsedAreas--;
- } else {
- /* reinstate the old region */
- REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
- REGION_UNINIT(pScreen, &FreedReg);
-
- pLink->next = offman->UsedAreas;
- offman->UsedAreas = pLink;
- return FALSE;
- }
-
-
- REGION_UNINIT(pScreen, &FreedReg);
-
- SendCallFreeBoxCallbacks(offman);
-
- return TRUE;
-}
-
-static Bool
-localQueryLargestOffscreenArea(
- ScreenPtr pScreen,
- int *width, int *height,
- int granularity,
- int preferences,
- int severity
-){
- FBManagerPtr offman;
- RegionPtr newRegion = NULL;
- BoxPtr pbox;
- int nbox;
- int x, w, h, area, oldArea;
-
- *width = *height = oldArea = 0;
-
- if(granularity <= 1) granularity = 0;
-
- if((preferences < 0) || (preferences > 3))
- return FALSE;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- if(severity < 0) severity = 0;
- if(severity > 2) severity = 2;
-
- switch(severity) {
- case 2:
- if(offman->NumUsedAreas) {
- FBLinkPtr pLink;
- RegionRec tmpRegion;
- newRegion = REGION_CREATE(pScreen, NULL, 1);
- REGION_COPY(pScreen, newRegion, offman->InitialBoxes);
- pLink = offman->UsedAreas;
-
- while(pLink) {
- if(!pLink->area.RemoveAreaCallback) {
- REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
- REGION_SUBTRACT(pScreen, newRegion, newRegion, &tmpRegion);
- REGION_UNINIT(pScreen, &tmpRegion);
- }
- pLink = pLink->next;
- }
-
- nbox = REGION_NUM_RECTS(newRegion);
- pbox = REGION_RECTS(newRegion);
- break;
- }
- case 1:
- if(offman->NumUsedAreas) {
- FBLinkPtr pLink;
- RegionRec tmpRegion;
- newRegion = REGION_CREATE(pScreen, NULL, 1);
- REGION_COPY(pScreen, newRegion, offman->FreeBoxes);
- pLink = offman->UsedAreas;
-
- while(pLink) {
- if(pLink->area.RemoveAreaCallback) {
- REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
- REGION_APPEND(pScreen, newRegion, &tmpRegion);
- REGION_UNINIT(pScreen, &tmpRegion);
- }
- pLink = pLink->next;
- }
-
- nbox = REGION_NUM_RECTS(newRegion);
- pbox = REGION_RECTS(newRegion);
- break;
- }
- default:
- nbox = REGION_NUM_RECTS(offman->FreeBoxes);
- pbox = REGION_RECTS(offman->FreeBoxes);
- break;
- }
-
- while(nbox--) {
- x = pbox->x1;
- if(granularity) {
- int tmp = x % granularity;
- if(tmp) x += (granularity - tmp);
- }
-
- w = pbox->x2 - x;
- h = pbox->y2 - pbox->y1;
- area = w * h;
-
- if(w > 0) {
- Bool gotIt = FALSE;
- switch(preferences) {
- case FAVOR_AREA_THEN_WIDTH:
- if((area > oldArea) || ((area == oldArea) && (w > *width)))
- gotIt = TRUE;
- break;
- case FAVOR_AREA_THEN_HEIGHT:
- if((area > oldArea) || ((area == oldArea) && (h > *height)))
- gotIt = TRUE;
- break;
- case FAVOR_WIDTH_THEN_AREA:
- if((w > *width) || ((w == *width) && (area > oldArea)))
- gotIt = TRUE;
- break;
- case FAVOR_HEIGHT_THEN_AREA:
- if((h > *height) || ((h == *height) && (area > oldArea)))
- gotIt = TRUE;
- break;
- }
- if(gotIt) {
- *width = w;
- *height = h;
- oldArea = area;
- }
- }
- pbox++;
- }
-
- if(newRegion)
- REGION_DESTROY(pScreen, newRegion);
-
- return TRUE;
-}
-
-static Bool
-localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
-{
- FBManagerPtr offman;
- FBLinkPtr pLink, tmp, pPrev = NULL;
- RegionRec FreedRegion;
- Bool anyUsed = FALSE;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- pLink = offman->UsedAreas;
- if(!pLink) return TRUE;
-
- while(pLink) {
- if(pLink->area.RemoveAreaCallback) {
- (*pLink->area.RemoveAreaCallback)(&pLink->area);
-
- REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
- REGION_APPEND(pScreen, offman->FreeBoxes, &FreedRegion);
- REGION_UNINIT(pScreen, &FreedRegion);
-
- if(pPrev)
- pPrev->next = pLink->next;
- else offman->UsedAreas = pLink->next;
-
- tmp = pLink;
- pLink = pLink->next;
- xfree(tmp);
- offman->NumUsedAreas--;
- anyUsed = TRUE;
- } else {
- pPrev = pLink;
- pLink = pLink->next;
- }
- }
-
- if(anyUsed) {
- REGION_VALIDATE(pScreen, offman->FreeBoxes, &anyUsed);
- SendCallFreeBoxCallbacks(offman);
- }
-
- return TRUE;
-}
-
-static void
-LinearMoveCBWrapper(FBAreaPtr from, FBAreaPtr to)
-{
- /* this will never get called */
-}
-
-static void
-LinearRemoveCBWrapper(FBAreaPtr area)
-{
- FBManagerPtr offman;
- FBLinearLinkPtr pLink, pLinkPrev = NULL;
- ScreenPtr pScreen = area->pScreen;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- pLink = offman->LinearAreas;
- if(!pLink) return;
-
- while(pLink->area != area) {
- pLinkPrev = pLink;
- pLink = pLink->next;
- if(!pLink) return;
- }
-
- /* give the user the callback it is expecting */
- (*pLink->linear.RemoveLinearCallback)(&(pLink->linear));
-
- if(pLinkPrev)
- pLinkPrev->next = pLink->next;
- else offman->LinearAreas = pLink->next;
-
- xfree(pLink);
-}
-
-#ifdef DEBUG
-static void
-Dump(FBLinearLinkPtr pLink)
-{
- if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n");
-
- while (pLink) {
- ErrorF(" Offset:%08x, Size:%08x, %s,%s\n",
- pLink->linear.offset,
- pLink->linear.size,
- pLink->free ? "Free" : "Used",
- pLink->area ? "Area" : "Linear");
-
- pLink = pLink->next;
- }
-}
-#endif
-
-static FBLinearPtr
-AllocateLinear(
- FBManagerPtr offman,
- int size,
- int granularity,
- pointer privData
-){
- ScreenPtr pScreen = offman->pScreen;
- FBLinearLinkPtr linear = NULL;
- FBLinearLinkPtr newlink = NULL;
- int offset, end;
-
- if(size <= 0) return NULL;
-
- if (!offman->LinearAreas) return NULL;
-
- linear = offman->LinearAreas;
- while (linear) {
- /* Make sure we get a free area that's not an XY fallback case */
- if (!linear->area && linear->free) {
- offset = (linear->linear.offset + granularity) & ~granularity;
- end = offset+size;
- if (end <= (linear->linear.offset + linear->linear.size))
- break;
- }
- linear = linear->next;
- }
- if (!linear)
- return NULL;
-
- /* break left */
- if (offset > linear->linear.offset) {
- newlink = xalloc(sizeof(FBLinearLink));
- if (!newlink)
- return NULL;
- newlink->area = NULL;
- newlink->linear.offset = offset;
- newlink->linear.size = linear->linear.size - (offset - linear->linear.offset);
- newlink->free = 1;
- newlink->next = linear->next;
- linear->linear.size -= newlink->linear.size;
- linear->next = newlink;
- linear = newlink;
- }
-
- /* break right */
- if (size < linear->linear.size) {
- newlink = xalloc(sizeof(FBLinearLink));
- if (!newlink)
- return NULL;
- newlink->area = NULL;
- newlink->linear.offset = offset + size;
- newlink->linear.size = linear->linear.size - size;
- newlink->free = 1;
- newlink->next = linear->next;
- linear->linear.size = size;
- linear->next = newlink;
- }
-
- /* p = middle block */
- linear->linear.granularity = granularity;
- linear->free = 0;
- linear->linear.pScreen = pScreen;
- linear->linear.MoveLinearCallback = NULL;
- linear->linear.RemoveLinearCallback = NULL;
- linear->linear.devPrivate.ptr = NULL;
-
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
-
- return &(linear->linear);
-}
-
-static FBLinearPtr
-localAllocateOffscreenLinear(
- ScreenPtr pScreen,
- int length,
- int gran,
- MoveLinearCallbackProcPtr moveCB,
- RemoveLinearCallbackProcPtr removeCB,
- pointer privData
-){
- FBManagerPtr offman;
- FBLinearLinkPtr link;
- FBAreaPtr area;
- FBLinearPtr linear = NULL;
- BoxPtr extents;
- int w, h, pitch;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- /* Try to allocate from linear memory first...... */
-#ifdef DEBUG
- ErrorF("ALLOCATING LINEAR\n");
-#endif
- if ((linear = AllocateLinear(offman, length, gran, privData)))
- return linear;
-
-#ifdef DEBUG
- ErrorF("NOPE, ALLOCATING AREA\n");
-#endif
-
- if(!(link = xalloc(sizeof(FBLinearLink))))
- return NULL;
-
- /* No linear available, so try and pinch some from the XY areas */
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- pitch = extents->x2 - extents->x1;
-
- if(gran && ((gran > pitch) || (pitch % gran))) {
- /* we can't match the specified alignment with XY allocations */
- xfree(link);
- return NULL;
- }
-
- if(length < pitch) { /* special case */
- w = length;
- h = 1;
- } else {
- w = pitch;
- h = (length + pitch - 1) / pitch;
- }
-
- if((area = localAllocateOffscreenArea(pScreen, w, h, gran,
- moveCB ? LinearMoveCBWrapper : NULL,
- removeCB ? LinearRemoveCBWrapper : NULL,
- privData)))
- {
- link->area = area;
- link->free = 0;
- link->next = offman->LinearAreas;
- offman->LinearAreas = link;
- linear = &(link->linear);
- linear->pScreen = pScreen;
- linear->size = h * w;
- linear->offset = (pitch * area->box.y1) + area->box.x1;
- linear->granularity = gran;
- linear->MoveLinearCallback = moveCB;
- linear->RemoveLinearCallback = removeCB;
- linear->devPrivate.ptr = privData;
- } else
- xfree(link);
-
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
-
- return linear;
-}
-
-
-static void
-localFreeOffscreenLinear(FBLinearPtr linear)
-{
- FBManagerPtr offman;
- FBLinearLinkPtr pLink, pLinkPrev = NULL;
- ScreenPtr pScreen = linear->pScreen;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- pLink = offman->LinearAreas;
- if(!pLink) return;
-
- while(&(pLink->linear) != linear) {
- pLinkPrev = pLink;
- pLink = pLink->next;
- if(!pLink) return;
- }
-
- if(pLink->area) { /* really an XY area */
-#ifdef DEBUG
- ErrorF("FREEING AREA\n");
-#endif
- localFreeOffscreenArea(pLink->area);
- if(pLinkPrev)
- pLinkPrev->next = pLink->next;
- else offman->LinearAreas = pLink->next;
- xfree(pLink);
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
- return;
- }
-
- pLink->free = 1;
-
- if (pLink->next && pLink->next->free) {
- FBLinearLinkPtr p = pLink->next;
- pLink->linear.size += p->linear.size;
- pLink->next = p->next;
- free(p);
- }
-
- if(pLinkPrev) {
- if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) {
- FBLinearLinkPtr p = pLinkPrev->next;
- pLinkPrev->linear.size += p->linear.size;
- pLinkPrev->next = p->next;
- free(p);
- }
- }
-
-#ifdef DEBUG
- ErrorF("FREEING LINEAR\n");
- Dump(offman->LinearAreas);
-#endif
-}
-
-
-static Bool
-localResizeOffscreenLinear(FBLinearPtr resize, int length)
-{
- FBManagerPtr offman;
- FBLinearLinkPtr pLink;
- ScreenPtr pScreen = resize->pScreen;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- pLink = offman->LinearAreas;
- if(!pLink) return FALSE;
-
- while(&(pLink->linear) != resize) {
- pLink = pLink->next;
- if(!pLink) return FALSE;
- }
-
- /* This could actually be alot smarter and try to move allocations
- from XY to linear when available. For now if it was XY, we keep
- it XY */
-
- if(pLink->area) { /* really an XY area */
- BoxPtr extents;
- int pitch, w, h;
-
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- pitch = extents->x2 - extents->x1;
-
- if(length < pitch) { /* special case */
- w = length;
- h = 1;
- } else {
- w = pitch;
- h = (length + pitch - 1) / pitch;
- }
-
- if(localResizeOffscreenArea(pLink->area, w, h)) {
- resize->size = h * w;
- resize->offset = (pitch * pLink->area->box.y1) + pLink->area->box.x1;
- return TRUE;
- }
- } else {
- /* TODO!!!! resize the linear area */
- }
-
- return FALSE;
-}
-
-
-static Bool
-localQueryLargestOffscreenLinear(
- ScreenPtr pScreen,
- int *size,
- int gran,
- int priority
-)
-{
- FBManagerPtr offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
- FBLinearLinkPtr pLink;
- FBLinearLinkPtr pLinkRet;
-
- *size = 0;
-
- if (!offman->LinearAreas) return FALSE;
-
- pLink = offman->LinearAreas;
- pLinkRet = pLink;
-
- if (!pLink->area) {
- while (pLink) {
- if (pLink->free) {
- if (pLink->linear.size > pLinkRet->linear.size)
- pLinkRet = pLink;
- }
- pLink = pLink->next;
- }
-
- if (pLinkRet->free) {
- *size = pLinkRet->linear.size;
- return TRUE;
- }
- } else {
- int w, h;
-
- if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran,
- FAVOR_WIDTH_THEN_AREA, priority))
- {
- FBManagerPtr offman;
- BoxPtr extents;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- if((extents->x2 - extents->x1) == w)
- *size = w * h;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-
-
-static FBManagerFuncs xf86FBManFuncs = {
- localAllocateOffscreenArea,
- localFreeOffscreenArea,
- localResizeOffscreenArea,
- localQueryLargestOffscreenArea,
- localRegisterFreeBoxCallback,
- localAllocateOffscreenLinear,
- localFreeOffscreenLinear,
- localResizeOffscreenLinear,
- localQueryLargestOffscreenLinear,
- localPurgeUnlockedOffscreenAreas
- };
-
-
-static Bool
-xf86FBCloseScreen (int i, ScreenPtr pScreen)
-{
- FBLinkPtr pLink, tmp;
- FBLinearLinkPtr pLinearLink, tmp2;
- FBManagerPtr offman =
- (FBManagerPtr) pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
-
- pScreen->CloseScreen = offman->CloseScreen;
-
- pLink = offman->UsedAreas;
- while(pLink) {
- tmp = pLink;
- pLink = pLink->next;
- xfree(tmp);
- }
-
- pLinearLink = offman->LinearAreas;
- while(pLinearLink) {
- tmp2 = pLinearLink;
- pLinearLink = pLinearLink->next;
- xfree(tmp2);
- }
-
- REGION_DESTROY(pScreen, offman->InitialBoxes);
- REGION_DESTROY(pScreen, offman->FreeBoxes);
-
- xfree(offman->FreeBoxesUpdateCallback);
- xfree(offman->devPrivates);
- xfree(offman);
- pScreen->devPrivates[xf86FBScreenIndex].ptr = NULL;
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-Bool
-xf86InitFBManager(
- ScreenPtr pScreen,
- BoxPtr FullBox
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RegionRec ScreenRegion;
- RegionRec FullRegion;
- BoxRec ScreenBox;
- Bool ret;
-
- ScreenBox.x1 = 0;
- ScreenBox.y1 = 0;
- ScreenBox.x2 = pScrn->virtualX;
- ScreenBox.y2 = pScrn->virtualY;
-
- if((FullBox->x1 > ScreenBox.x1) || (FullBox->y1 > ScreenBox.y1) ||
- (FullBox->x2 < ScreenBox.x2) || (FullBox->y2 < ScreenBox.y2)) {
- return FALSE;
- }
-
- if (FullBox->y2 < FullBox->y1) return FALSE;
- if (FullBox->x2 < FullBox->x2) return FALSE;
-
- REGION_INIT(pScreen, &ScreenRegion, &ScreenBox, 1);
- REGION_INIT(pScreen, &FullRegion, FullBox, 1);
-
- REGION_SUBTRACT(pScreen, &FullRegion, &FullRegion, &ScreenRegion);
-
- ret = xf86InitFBManagerRegion(pScreen, &FullRegion);
-
- REGION_UNINIT(pScreen, &ScreenRegion);
- REGION_UNINIT(pScreen, &FullRegion);
-
- return ret;
-}
-
-Bool
-xf86InitFBManagerArea(
- ScreenPtr pScreen,
- int PixelArea,
- int Verbosity
-)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- xRectangle Rect[3];
- RegionPtr pRegion, pScreenRegion;
- int nRect;
- Bool ret = FALSE;
-
- if (PixelArea < (pScrn->displayWidth * pScrn->virtualY))
- return FALSE;
-
- Rect[0].x = Rect[0].y = 0;
- Rect[0].width = pScrn->displayWidth;
- Rect[0].height = PixelArea / pScrn->displayWidth;
- nRect = 1;
-
- /* Add a possible partial scanline */
- if ((Rect[1].height = Rect[1].width = PixelArea % pScrn->displayWidth)) {
- Rect[1].x = 0;
- Rect[1].y = Rect[0].height;
- Rect[1].height = 1;
- nRect++;
- }
-
- /* Factor out virtual resolution */
- pRegion = RECTS_TO_REGION(pScreen, nRect, Rect, 0);
- if (pRegion) {
- if (!REGION_NAR(pRegion)) {
- Rect[2].x = Rect[2].y = 0;
- Rect[2].width = pScrn->virtualX;
- Rect[2].height = pScrn->virtualY;
-
- pScreenRegion = RECTS_TO_REGION(pScreen, 1, &Rect[2], 0);
- if (pScreenRegion) {
- if (!REGION_NAR(pScreenRegion)) {
- REGION_SUBTRACT(pScreen, pRegion, pRegion, pScreenRegion);
-
- ret = xf86InitFBManagerRegion(pScreen, pRegion);
-
- if (ret && xf86GetVerbosity() >= Verbosity) {
- int scrnIndex = pScrn->scrnIndex;
-
- xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
- "Largest offscreen areas (with overlaps):\n");
-
- if (Rect[2].width < Rect[0].width) {
- xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
- "\t%d x %d rectangle at %d,0\n",
- Rect[0].width - Rect[2].width,
- Rect[0].height,
- Rect[2].width);
- }
- if (Rect[2].width < Rect[1].width) {
- xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
- "\t%d x %d rectangle at %d,0\n",
- Rect[1].width - Rect[2].width,
- Rect[0].height + Rect[1].height,
- Rect[2].width);
- }
- if (Rect[2].height < Rect[0].height) {
- xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
- "\t%d x %d rectangle at 0,%d\n",
- Rect[0].width,
- Rect[0].height - Rect[2].height,
- Rect[2].height);
- }
- if (Rect[1].height) {
- xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
- "\t%d x %d rectangle at 0,%d\n",
- Rect[1].width,
- Rect[0].height - Rect[2].height +
- Rect[1].height,
- Rect[2].height);
- }
- }
- }
-
- REGION_DESTROY(pScreen, pScreenRegion);
- }
- }
-
- REGION_DESTROY(pScreen, pRegion);
- }
-
- return ret;
-}
-
-Bool
-xf86InitFBManagerRegion(
- ScreenPtr pScreen,
- RegionPtr FullRegion
-){
- FBManagerPtr offman;
-
- if(REGION_NIL(FullRegion))
- return FALSE;
-
- if(xf86FBGeneration != serverGeneration) {
- if((xf86FBScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- xf86FBGeneration = serverGeneration;
- }
-
- if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs))
- return FALSE;
-
- offman = xalloc(sizeof(FBManager));
- if(!offman) return FALSE;
-
- pScreen->devPrivates[xf86FBScreenIndex].ptr = (pointer)offman;
-
- offman->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = xf86FBCloseScreen;
-
- offman->InitialBoxes = REGION_CREATE(pScreen, NULL, 1);
- offman->FreeBoxes = REGION_CREATE(pScreen, NULL, 1);
-
- REGION_COPY(pScreen, offman->InitialBoxes, FullRegion);
- REGION_COPY(pScreen, offman->FreeBoxes, FullRegion);
-
- offman->pScreen = pScreen;
- offman->UsedAreas = NULL;
- offman->LinearAreas = NULL;
- offman->NumUsedAreas = 0;
- offman->NumCallbacks = 0;
- offman->FreeBoxesUpdateCallback = NULL;
- offman->devPrivates = NULL;
-
- return TRUE;
-}
-
-Bool
-xf86InitFBManagerLinear(
- ScreenPtr pScreen,
- int offset,
- int size
-){
- FBManagerPtr offman;
- FBLinearLinkPtr link;
- FBLinearPtr linear;
-
- if (size <= 0)
- return FALSE;
-
- /* we expect people to have called the Area setup first for pixmap cache */
- if (!pScreen->devPrivates[xf86FBScreenIndex].ptr)
- return FALSE;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- offman->LinearAreas = xalloc(sizeof(FBLinearLink));
- if (!offman->LinearAreas)
- return FALSE;
-
- link = offman->LinearAreas;
- link->area = NULL;
- link->next = NULL;
- link->free = 1;
- linear = &(link->linear);
- linear->pScreen = pScreen;
- linear->size = size;
- linear->offset = offset;
- linear->granularity = 0;
- linear->MoveLinearCallback = NULL;
- linear->RemoveLinearCallback = NULL;
- linear->devPrivate.ptr = NULL;
-
- return TRUE;
-}
-
-
-/* This is an implementation specific function and should
- disappear after the next release. People should use the
- real linear functions instead */
-
-FBAreaPtr
-xf86AllocateLinearOffscreenArea (
- ScreenPtr pScreen,
- int length,
- int gran,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-){
- FBManagerFuncsPtr funcs;
- FBManagerPtr offman;
- BoxPtr extents;
- int w, h;
-
- if(xf86FBMangerIndex < 0)
- return NULL;
- if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
- return NULL;
-
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- w = extents->x2 - extents->x1;
-
- if(gran && ((gran > w) || (w % gran))) {
- /* we can't match the specified alignment with XY allocations */
- return NULL;
- }
-
- if(length <= w) { /* special case */
- h = 1;
- w = length;
- } else {
- h = (length + w - 1) / w;
- }
-
- return (*funcs->AllocateOffscreenArea)(
- pScreen, w, h, gran, moveCB, removeCB, privData);
-}
diff --git a/hw/xfree86/common/xf86fbman.h b/hw/xfree86/common/xf86fbman.h
deleted file mode 100644
index adb26a1f1..000000000
--- a/hw/xfree86/common/xf86fbman.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.14 2003/10/09 12:40:54 alanh Exp $ */
-
-/*
- * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86FBMAN_H
-#define _XF86FBMAN_H
-
-
-#include "scrnintstr.h"
-#include "regionstr.h"
-
-
-#define FAVOR_AREA_THEN_WIDTH 0
-#define FAVOR_AREA_THEN_HEIGHT 1
-#define FAVOR_WIDTH_THEN_AREA 2
-#define FAVOR_HEIGHT_THEN_AREA 3
-
-#define PRIORITY_LOW 0
-#define PRIORITY_NORMAL 1
-#define PRIORITY_EXTREME 2
-
-
-typedef struct _FBArea {
- ScreenPtr pScreen;
- BoxRec box;
- int granularity;
- void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*);
- void (*RemoveAreaCallback)(struct _FBArea*);
- DevUnion devPrivate;
-} FBArea, *FBAreaPtr;
-
-typedef struct _FBLinear {
- ScreenPtr pScreen;
- int size;
- int offset;
- int granularity;
- void (*MoveLinearCallback)(struct _FBLinear*, struct _FBLinear*);
- void (*RemoveLinearCallback)(struct _FBLinear*);
- DevUnion devPrivate;
-} FBLinear, *FBLinearPtr;
-
-typedef void (*FreeBoxCallbackProcPtr)(ScreenPtr, RegionPtr, pointer);
-typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr, FBAreaPtr);
-typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr);
-
-typedef void (*MoveLinearCallbackProcPtr)(FBLinearPtr, FBLinearPtr);
-typedef void (*RemoveLinearCallbackProcPtr)(FBLinearPtr);
-
-
-typedef struct {
- FBAreaPtr (*AllocateOffscreenArea)(
- ScreenPtr pScreen,
- int w, int h,
- int granularity,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData);
- void (*FreeOffscreenArea)(FBAreaPtr area);
- Bool (*ResizeOffscreenArea)(FBAreaPtr area, int w, int h);
- Bool (*QueryLargestOffscreenArea)(
- ScreenPtr pScreen,
- int *width, int *height,
- int granularity,
- int preferences,
- int priority);
- Bool (*RegisterFreeBoxCallback)(
- ScreenPtr pScreen,
- FreeBoxCallbackProcPtr FreeBoxCallback,
- pointer devPriv);
-/* linear functions */
- FBLinearPtr (*AllocateOffscreenLinear)(
- ScreenPtr pScreen,
- int size,
- int granularity,
- MoveLinearCallbackProcPtr moveCB,
- RemoveLinearCallbackProcPtr removeCB,
- pointer privData);
- void (*FreeOffscreenLinear)(FBLinearPtr area);
- Bool (*ResizeOffscreenLinear)(FBLinearPtr area, int size);
- Bool (*QueryLargestOffscreenLinear)(
- ScreenPtr pScreen,
- int *size,
- int granularity,
- int priority);
- Bool (*PurgeOffscreenAreas) (ScreenPtr);
-} FBManagerFuncs, *FBManagerFuncsPtr;
-
-
-Bool xf86RegisterOffscreenManager(
- ScreenPtr pScreen,
- FBManagerFuncsPtr funcs
-);
-
-Bool
-xf86InitFBManagerRegion(
- ScreenPtr pScreen,
- RegionPtr ScreenRegion
-);
-
-Bool
-xf86InitFBManagerArea(
- ScreenPtr pScreen,
- int PixalArea,
- int Verbosity
-);
-
-Bool
-xf86InitFBManager(
- ScreenPtr pScreen,
- BoxPtr FullBox
-);
-
-Bool
-xf86InitFBManagerLinear(
- ScreenPtr pScreen,
- int offset,
- int size
-);
-
-Bool
-xf86FBManagerRunning(
- ScreenPtr pScreen
-);
-
-FBAreaPtr
-xf86AllocateOffscreenArea (
- ScreenPtr pScreen,
- int w, int h,
- int granularity,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-);
-
-FBAreaPtr
-xf86AllocateLinearOffscreenArea (
- ScreenPtr pScreen,
- int length,
- int granularity,
- MoveAreaCallbackProcPtr moveCB,
- RemoveAreaCallbackProcPtr removeCB,
- pointer privData
-);
-
-FBLinearPtr
-xf86AllocateOffscreenLinear (
- ScreenPtr pScreen,
- int length,
- int granularity,
- MoveLinearCallbackProcPtr moveCB,
- RemoveLinearCallbackProcPtr removeCB,
- pointer privData
-);
-
-void xf86FreeOffscreenArea(FBAreaPtr area);
-void xf86FreeOffscreenLinear(FBLinearPtr area);
-
-Bool
-xf86ResizeOffscreenArea(
- FBAreaPtr resize,
- int w, int h
-);
-
-Bool
-xf86ResizeOffscreenLinear(
- FBLinearPtr resize,
- int size
-);
-
-
-Bool
-xf86RegisterFreeBoxCallback(
- ScreenPtr pScreen,
- FreeBoxCallbackProcPtr FreeBoxCallback,
- pointer devPriv
-);
-
-Bool
-xf86PurgeUnlockedOffscreenAreas(
- ScreenPtr pScreen
-);
-
-
-Bool
-xf86QueryLargestOffscreenArea(
- ScreenPtr pScreen,
- int *width, int *height,
- int granularity,
- int preferences,
- int priority
-);
-
-Bool
-xf86QueryLargestOffscreenLinear(
- ScreenPtr pScreen,
- int *size,
- int granularity,
- int priority
-);
-
-
-#endif /* _XF86FBMAN_H */
diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c
deleted file mode 100644
index 1b9890d5e..000000000
--- a/hw/xfree86/common/xf86isaBus.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.6 2003/08/24 17:36:55 dawes Exp $ */
-/*
- * Copyright (c) 1997-2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * This file contains the interfaces to the bus-specific code
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-Bool isaSlotClaimed = FALSE;
-
-/*
- * If the slot requested is already in use, return FALSE.
- * Otherwise, claim the slot for the screen requesting it.
- */
-
-int
-xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
-{
- EntityPtr p;
- BusAccPtr pbap = xf86BusAccInfo;
- int num;
-
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = chipset;
- p->busType = BUS_ISA;
- p->active = active;
- p->inUse = FALSE;
- xf86AddDevToEntity(num, dev);
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- p->busAcc = NULL;
- while (pbap) {
- if (pbap->type == BUS_ISA)
- p->busAcc = pbap;
- pbap = pbap->next;
- }
- isaSlotClaimed = TRUE;
- return num;
-}
-
-/*
- * Get the list of ISA "slots" claimed by a screen
- *
- * Note: The ISA implementation here assumes that only one ISA "slot" type
- * can be claimed by any one screen. That means a return value other than
- * 0 or 1 isn't useful.
- */
-int
-xf86GetIsaInfoForScreen(int scrnIndex)
-{
- int num = 0;
- int i;
- EntityPtr p;
-
- for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
- p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
- if (p->busType == BUS_ISA) {
- num++;
- }
- }
- return num;
-}
-
-/*
- * Parse a BUS ID string, and return True if it is a ISA bus id.
- */
-
-Bool
-xf86ParseIsaBusString(const char *busID)
-{
- /*
- * The format assumed to be "isa" or "isa:"
- */
- return (StringToBusType(busID,NULL) == BUS_ISA);
-}
-
-
-/*
- * xf86IsPrimaryIsa() -- return TRUE if primary device
- * is ISA.
- */
-
-Bool
-xf86IsPrimaryIsa(void)
-{
- return ( primaryBus.type == BUS_ISA );
-}
-
-void
-isaConvertRange2Host(resRange *pRange)
-{
- return;
-}
diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c
deleted file mode 100644
index 2d79ab476..000000000
--- a/hw/xfree86/common/xf86noBus.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.2 2003/08/24 17:36:55 dawes Exp $ */
-
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the interfaces to the bus-specific code
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-int
-xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
-{
- EntityPtr p;
- int num;
-
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = 0;
- p->busType = BUS_NONE;
- p->active = active;
- p->inUse = FALSE;
- xf86AddDevToEntity(num, dev);
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- p->busAcc = NULL;
-
- return num;
-}
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
deleted file mode 100644
index 641d1c919..000000000
--- a/hw/xfree86/common/xf86pciBus.c
+++ /dev/null
@@ -1,3552 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.77 2003/11/03 05:11:03 tsi Exp $ */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains the interfaces to the bus-specific code
- */
-#define INCLUDE_DEPRECATED 1
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "Pci.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Resources.h"
-
-/* Bus-specific headers */
-#include "xf86PciData.h"
-
-#include "xf86Bus.h"
-
-#define XF86_OS_PRIVS
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSproc.h"
-
-#include "xf86RAC.h"
-
-/* Bus-specific globals */
-Bool pciSlotClaimed = FALSE;
-pciConfigPtr *xf86PciInfo = NULL; /* Full PCI probe info */
-pciVideoPtr *xf86PciVideoInfo = NULL; /* PCI probe for video hw */
-pciAccPtr * xf86PciAccInfo = NULL; /* PCI access related */
-
-/* pcidata globals */
-ScanPciSetupProcPtr xf86SetupPciIds = NULL;
-ScanPciCloseProcPtr xf86ClosePciIds = NULL;
-ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice = NULL;
-ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys = NULL;
-ScanPciFindClassBySubsysProcPtr xf86FindPciClassBySubsys = NULL;
-ScanPciFindClassByDeviceProcPtr xf86FindPciClassByDevice = NULL;
-
-static resPtr pciAvoidRes = NULL;
-
-/* PCI buses */
-static PciBusPtr xf86PciBus = NULL;
-/* Bus-specific probe/sorting functions */
-
-/* PCI classes that get included in xf86PciVideoInfo */
-#define PCIINFOCLASSES(b,s) \
- (((b) == PCI_CLASS_PREHISTORIC) || \
- ((b) == PCI_CLASS_DISPLAY) || \
- ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO) || \
- ((b) == PCI_CLASS_PROCESSOR && (s) == PCI_SUBCLASS_PROCESSOR_COPROC))
-
-/*
- * PCI classes that have messages printed always. The others are only
- * have a message printed when the vendor/dev IDs are recognised.
- */
-#define PCIALWAYSPRINTCLASSES(b,s) \
- (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
- ((b) == PCI_CLASS_DISPLAY) || \
- ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO))
-
-/*
- * PCI classes for which potentially destructive checking of the map sizes
- * may be done. Any classes where this may be unsafe should be omitted
- * from this list.
- */
-#define PCINONSYSTEMCLASSES(b,s) PCIALWAYSPRINTCLASSES(b,s)
-
-/*
- * PCI classes that use RAC
- */
-#define PCISHAREDIOCLASSES(b,s) \
- (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
- ((b) == PCI_CLASS_DISPLAY && (s) == PCI_SUBCLASS_DISPLAY_VGA))
-
-#define PCI_MEM32_LENGTH_MAX 0xFFFFFFFF
-
-#undef MIN
-#define MIN(x,y) ((x<y)?x:y)
-
-#define B2M(tag,base) pciBusAddrToHostAddr(tag,PCI_MEM,base)
-#define B2I(tag,base) (base)
-#define B2H(tag,base,type) (((type & ResPhysMask) == ResMem) ? \
- B2M(tag, base) : B2I(tag, base))
-#define M2B(tag,base) pciHostAddrToBusAddr(tag,PCI_IO,base)
-#define I2B(tag,base) (base)
-#define H2B(tag,base,type) (((type & ResPhysMask) == ResMem) ? \
- M2B(tag, base) : I2B(tag, base))
-#define TAG(pvp) (pciTag(pvp->bus,pvp->device,pvp->func))
-#define SIZE(size) ((1 << size) - 1)
-#define PCI_SIZE(type,tag,size) (((type & ResPhysMask) == ResMem) \
- ? pciBusAddrToHostAddr(tag,PCI_MEM_SIZE,size) \
- : pciBusAddrToHostAddr(tag,PCI_IO_SIZE,size))
-#define PCI_M_RANGE(range,tag,begin,end,type) \
- { \
- RANGE(range, B2M(tag, begin), B2M(tag, end), \
- RANGE_TYPE(type, xf86GetPciDomain(tag))); \
- }
-#define PCI_I_RANGE(range,tag,begin,end,type) \
- { \
- RANGE(range, B2I(tag, begin), B2I(tag, end), \
- RANGE_TYPE(type, xf86GetPciDomain(tag))); \
- }
-#define PCI_X_RANGE(range,tag,begin,end,type) \
-{ if ((type & ResPhysMask) == ResMem) PCI_M_RANGE(range,tag,begin,end,type); \
- else PCI_I_RANGE(range,tag,begin,end,type); }
-#define P_M_RANGE(range,tag,begin,size,type) \
- PCI_M_RANGE(range,tag,begin,(begin + SIZE(size)),type)
-#define P_I_RANGE(range,tag,begin,size,type) \
- PCI_I_RANGE(range,tag,begin,(begin + SIZE(size)),type)
-#define P_X_RANGE(range,tag,begin,size,type) \
-{ if ((type & ResPhysMask) == ResMem) P_M_RANGE(range,tag,begin,size,type); \
- else P_I_RANGE(range,tag,begin,size,type); }
-#define PV_M_RANGE(range,pvp,i,type) \
- P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],type)
-#define PV_B_RANGE(range,pvp,type) \
- P_M_RANGE(range,TAG(pvp),pvp->biosBase,pvp->biosSize,type)
-#define PV_I_RANGE(range,pvp,i,type) \
- P_I_RANGE(range,TAG(pvp),pvp->ioBase[i],pvp->size[i],type)
-
-static void getPciClassFlags(pciConfigPtr *pcrpp);
-static void pciConvertListToHost(int bus, int dev, int func, resPtr list);
-static PciBusPtr xf86GetPciBridgeInfo(void);
-
-void
-xf86FormatPciBusNumber(int busnum, char *buffer)
-{
- /* 'buffer' should be at least 8 characters long */
- if (busnum < 256)
- sprintf(buffer, "%d", busnum);
- else
- sprintf(buffer, "%d@%d", busnum & 0x00ff, busnum >> 8);
-}
-
-static Bool
-IsBaseUnassigned(CARD32 base)
-{
- CARD32 mask;
-
- if (base & PCI_MAP_IO)
- mask = ~PCI_MAP_IO_ATTR_MASK;
- else
- mask = ~PCI_MAP_MEMORY_ATTR_MASK;
-
- base &= mask;
- return (!base || (base == mask));
-}
-
-static void
-FindPCIVideoInfo(void)
-{
- pciConfigPtr pcrp, *pcrpp;
- int i = 0, j, k;
- int num = 0;
- pciVideoPtr info;
- Bool mem64 = FALSE;
-
- pcrpp = xf86PciInfo = xf86scanpci(0);
- getPciClassFlags(pcrpp);
-
- if (pcrpp == NULL) {
- xf86PciVideoInfo = NULL;
- return;
- }
- xf86PciBus = xf86GetPciBridgeInfo();
-
- while ((pcrp = pcrpp[i])) {
- int baseclass;
- int subclass;
-
- if (pcrp->listed_class & 0xffff) {
- baseclass = (pcrp->listed_class >> 8) & 0xff;
- subclass = pcrp->listed_class & 0xff;
- } else {
- baseclass = pcrp->pci_base_class;
- subclass = pcrp->pci_sub_class;
- }
-
- if (PCIINFOCLASSES(baseclass, subclass)) {
- num++;
- xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
- sizeof(pciVideoPtr) * (num + 1));
- xf86PciVideoInfo[num] = NULL;
- info = xf86PciVideoInfo[num - 1] = xnfalloc(sizeof(pciVideoRec));
- info->validSize = FALSE;
- info->vendor = pcrp->pci_vendor;
- info->chipType = pcrp->pci_device;
- info->chipRev = pcrp->pci_rev_id;
- info->subsysVendor = pcrp->pci_subsys_vendor;
- info->subsysCard = pcrp->pci_subsys_card;
- info->bus = pcrp->busnum;
- info->device = pcrp->devnum;
- info->func = pcrp->funcnum;
- info->class = baseclass;
- info->subclass = pcrp->pci_sub_class;
- info->interface = pcrp->pci_prog_if;
- info->biosBase = PCIGETROM(pcrp->pci_baserom);
- info->biosSize = pciGetBaseSize(pcrp->tag, 6, TRUE, NULL);
- info->thisCard = pcrp;
- info->validate = FALSE;
-#ifdef INCLUDE_XF86_NO_DOMAIN
- if ((PCISHAREDIOCLASSES(baseclass, subclass))
- && (pcrp->pci_command & PCI_CMD_IO_ENABLE) &&
- (pcrp->pci_prog_if == 0)) {
-
- /*
- * Attempt to ensure that VGA is actually routed to this
- * adapter on entry. This needs to be fixed when we finally
- * grok host bridges (and multiple bus trees).
- */
- j = info->bus;
- while (TRUE) {
- PciBusPtr pBus = xf86PciBus;
- while (pBus && j != pBus->secondary)
- pBus = pBus->next;
- if (!pBus || !(pBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN))
- break;
- if (j == pBus->primary) {
- if (primaryBus.type == BUS_NONE) {
- /* assumption: primary adapter is always VGA */
- primaryBus.type = BUS_PCI;
- primaryBus.id.pci.bus = pcrp->busnum;
- primaryBus.id.pci.device = pcrp->devnum;
- primaryBus.id.pci.func = pcrp->funcnum;
- } else if (primaryBus.type < BUS_last) {
- xf86Msg(X_NOTICE,
- "More than one primary device found\n");
- primaryBus.type ^= (BusType)(-1);
- }
- break;
- }
- j = pBus->primary;
- }
- }
-#endif
-
- for (j = 0; j < 6; j++) {
- info->memBase[j] = 0;
- info->ioBase[j] = 0;
- if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
- info->size[j] =
- pciGetBaseSize(pcrp->tag, j, TRUE, &info->validSize);
- pcrp->minBasesize = info->validSize;
- } else {
- info->size[j] = pcrp->basesize[j];
- info->validSize = pcrp->minBasesize;
- }
- info->type[j] = 0;
- }
-
- if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
- if (info->size[0] && IsBaseUnassigned(pcrp->pci_base0))
- pcrp->pci_base0 = pciCheckForBrokenBase(pcrp->tag, 0);
- if (info->size[1] && IsBaseUnassigned(pcrp->pci_base1))
- pcrp->pci_base1 = pciCheckForBrokenBase(pcrp->tag, 1);
- if (info->size[2] && IsBaseUnassigned(pcrp->pci_base2))
- pcrp->pci_base2 = pciCheckForBrokenBase(pcrp->tag, 2);
- if (info->size[3] && IsBaseUnassigned(pcrp->pci_base3))
- pcrp->pci_base3 = pciCheckForBrokenBase(pcrp->tag, 3);
- if (info->size[4] && IsBaseUnassigned(pcrp->pci_base4))
- pcrp->pci_base4 = pciCheckForBrokenBase(pcrp->tag, 4);
- if (info->size[5] && IsBaseUnassigned(pcrp->pci_base5))
- pcrp->pci_base5 = pciCheckForBrokenBase(pcrp->tag, 5);
- }
-
- /*
- * 64-bit base addresses are checked for and avoided on 32-bit
- * platforms.
- */
- if (pcrp->pci_base0) {
- if (pcrp->pci_base0 & PCI_MAP_IO) {
- info->ioBase[0] = (memType)PCIGETIO(pcrp->pci_base0);
- info->type[0] = pcrp->pci_base0 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[0] = pcrp->pci_base0 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[0] = (memType)PCIGETMEMORY(pcrp->pci_base0);
- if (PCI_MAP_IS64BITMEM(pcrp->pci_base0)) {
- mem64 = TRUE;
-#if defined(LONG64) || defined(WORD64)
- info->memBase[0] |=
- (memType)PCIGETMEMORY64HIGH(pcrp->pci_base1) << 32;
-#else
- if (pcrp->pci_base1)
- info->memBase[0] = 0;
-#endif
- }
- }
- }
-
- if (pcrp->pci_base1 && !mem64) {
- if (pcrp->pci_base1 & PCI_MAP_IO) {
- info->ioBase[1] = (memType)PCIGETIO(pcrp->pci_base1);
- info->type[1] = pcrp->pci_base1 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[1] = pcrp->pci_base1 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[1] = (memType)PCIGETMEMORY(pcrp->pci_base1);
- if (PCI_MAP_IS64BITMEM(pcrp->pci_base1)) {
- mem64 = TRUE;
-#if defined(LONG64) || defined(WORD64)
- info->memBase[1] |=
- (memType)PCIGETMEMORY64HIGH(pcrp->pci_base2) << 32;
-#else
- if (pcrp->pci_base2)
- info->memBase[1] = 0;
-#endif
- }
- }
- } else
- mem64 = FALSE;
-
- if (pcrp->pci_base2 && !mem64) {
- if (pcrp->pci_base2 & PCI_MAP_IO) {
- info->ioBase[2] = (memType)PCIGETIO(pcrp->pci_base2);
- info->type[2] = pcrp->pci_base2 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[2] = pcrp->pci_base2 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[2] = (memType)PCIGETMEMORY(pcrp->pci_base2);
- if (PCI_MAP_IS64BITMEM(pcrp->pci_base2)) {
- mem64 = TRUE;
-#if defined(LONG64) || defined(WORD64)
- info->memBase[2] |=
- (memType)PCIGETMEMORY64HIGH(pcrp->pci_base3) << 32;
-#else
- if (pcrp->pci_base3)
- info->memBase[2] = 0;
-#endif
- }
- }
- } else
- mem64 = FALSE;
-
- if (pcrp->pci_base3 && !mem64) {
- if (pcrp->pci_base3 & PCI_MAP_IO) {
- info->ioBase[3] = (memType)PCIGETIO(pcrp->pci_base3);
- info->type[3] = pcrp->pci_base3 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[3] = pcrp->pci_base3 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[3] = (memType)PCIGETMEMORY(pcrp->pci_base3);
- if (PCI_MAP_IS64BITMEM(pcrp->pci_base3)) {
- mem64 = TRUE;
-#if defined(LONG64) || defined(WORD64)
- info->memBase[3] |=
- (memType)PCIGETMEMORY64HIGH(pcrp->pci_base4) << 32;
-#else
- if (pcrp->pci_base4)
- info->memBase[3] = 0;
-#endif
- }
- }
- } else
- mem64 = FALSE;
-
- if (pcrp->pci_base4 && !mem64) {
- if (pcrp->pci_base4 & PCI_MAP_IO) {
- info->ioBase[4] = (memType)PCIGETIO(pcrp->pci_base4);
- info->type[4] = pcrp->pci_base4 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[4] = pcrp->pci_base4 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[4] = (memType)PCIGETMEMORY(pcrp->pci_base4);
- if (PCI_MAP_IS64BITMEM(pcrp->pci_base4)) {
- mem64 = TRUE;
-#if defined(LONG64) || defined(WORD64)
- info->memBase[4] |=
- (memType)PCIGETMEMORY64HIGH(pcrp->pci_base5) << 32;
-#else
- if (pcrp->pci_base5)
- info->memBase[4] = 0;
-#endif
- }
- }
- } else
- mem64 = FALSE;
-
- if (pcrp->pci_base5 && !mem64) {
- if (pcrp->pci_base5 & PCI_MAP_IO) {
- info->ioBase[5] = (memType)PCIGETIO(pcrp->pci_base5);
- info->type[5] = pcrp->pci_base5 & PCI_MAP_IO_ATTR_MASK;
- } else {
- info->type[5] = pcrp->pci_base5 & PCI_MAP_MEMORY_ATTR_MASK;
- info->memBase[5] = (memType)PCIGETMEMORY(pcrp->pci_base5);
- }
- } else
- mem64 = FALSE;
- info->listed_class = pcrp->listed_class;
- }
- i++;
- }
-
- /* If we haven't found a primary device try a different heuristic */
- if (primaryBus.type == BUS_NONE && num) {
- for (i = 0; i < num; i++) {
- info = xf86PciVideoInfo[i];
- pcrp = info->thisCard;
-
- if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
- (num == 1 ||
- ((info->class == PCI_CLASS_DISPLAY) &&
- (info->subclass == PCI_SUBCLASS_DISPLAY_MISC)))) {
- if (primaryBus.type == BUS_NONE) {
- primaryBus.type = BUS_PCI;
- primaryBus.id.pci.bus = pcrp->busnum;
- primaryBus.id.pci.device = pcrp->devnum;
- primaryBus.id.pci.func = pcrp->funcnum;
- } else {
- xf86Msg(X_NOTICE,
- "More than one possible primary device found\n");
- primaryBus.type ^= (BusType)(-1);
- }
- }
- }
- }
-
- /* Print a summary of the video devices found */
- for (k = 0; k < num; k++) {
- const char *vendorname = NULL, *chipname = NULL;
- const char *prim = " ";
- char busnum[8];
- Bool memdone = FALSE, iodone = FALSE;
-
- i = 0;
- info = xf86PciVideoInfo[k];
- xf86FormatPciBusNumber(info->bus, busnum);
- xf86FindPciNamesByDevice(info->vendor, info->chipType,
- NOVENDOR, NOSUBSYS,
- &vendorname, &chipname, NULL, NULL);
- if ((!vendorname || !chipname) &&
- !PCIALWAYSPRINTCLASSES(info->class, info->subclass))
- continue;
- if (xf86IsPrimaryPci(info))
- prim = "*";
-
- xf86Msg(X_PROBED, "PCI:%s(%s:%d:%d) ", prim, busnum, info->device,
- info->func);
- if (vendorname)
- xf86ErrorF("%s ", vendorname);
- else
- xf86ErrorF("unknown vendor (0x%04x) ", info->vendor);
- if (chipname)
- xf86ErrorF("%s ", chipname);
- else
- xf86ErrorF("unknown chipset (0x%04x) ", info->chipType);
- xf86ErrorF("rev %d", info->chipRev);
- for (i = 0; i < 6; i++) {
- if (info->memBase[i] &&
- (info->memBase[i] < (memType)(-1 << info->size[i]))) {
- if (!memdone) {
- xf86ErrorF(", Mem @ ");
- memdone = TRUE;
- } else
- xf86ErrorF(", ");
- xf86ErrorF("0x%08lx/%d", info->memBase[i], info->size[i]);
- }
- }
- for (i = 0; i < 6; i++) {
- if (info->ioBase[i] &&
- (info->ioBase[i] < (memType)(-1 << info->size[i]))) {
- if (!iodone) {
- xf86ErrorF(", I/O @ ");
- iodone = TRUE;
- } else
- xf86ErrorF(", ");
- xf86ErrorF("0x%04lx/%d", info->ioBase[i], info->size[i]);
- }
- }
- if (info->biosBase &&
- (info->biosBase < (memType)(-1 << info->biosSize)))
- xf86ErrorF(", BIOS @ 0x%08lx/%d", info->biosBase, info->biosSize);
- xf86ErrorF("\n");
- }
-}
-
-/*
- * fixPciSizeInfo() -- fix pci size info by testing it destructively
- * (if not already done), fix pciVideoInfo and entry in the resource
- * list.
- */
-/*
- * Note: once we have OS support to read the sizes GetBaseSize() will
- * have to be wrapped by the OS layer. fixPciSizeInfo() should also
- * be wrapped by the OS layer to do nothing if the size is always
- * returned correctly by GetBaseSize(). It should however set validate
- * in pciVideoRec if validation is required. ValidatePci() also needs
- * to be wrapped by the OS layer. This may do nothing if the OS has
- * already taken care of validation. fixPciResource() may be moved to
- * OS layer with minimal changes. Once the wrapping layer is in place
- * the common level and drivers should not reference these functions
- * directly but thru the OS layer.
- */
-
-static void
-fixPciSizeInfo(int entityIndex)
-{
- pciVideoPtr pvp;
- resPtr pAcc;
- PCITAG tag;
- int j;
-
- if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return;
- if (pvp->validSize) return;
-
- tag = pciTag(pvp->bus,pvp->device,pvp->func);
-
- for (j = 0; j < 6; j++) {
- pAcc = Acc;
- if (pvp->memBase[j])
- while (pAcc) {
- if (((pAcc->res_type & (ResPhysMask | ResBlock))
- == (ResMem | ResBlock))
- && (pAcc->block_begin == B2M(TAG(pvp),pvp->memBase[j]))
- && (pAcc->block_end == B2M(TAG(pvp),pvp->memBase[j]
- + SIZE(pvp->size[j])))) break;
- pAcc = pAcc->next;
- }
- else if (pvp->ioBase[j])
- while (pAcc) {
- if (((pAcc->res_type & (ResPhysMask | ResBlock)) ==
- (ResIo | ResBlock))
- && (pAcc->block_begin == B2I(TAG(pvp),pvp->ioBase[j]))
- && (pAcc->block_end == B2I(TAG(pvp),pvp->ioBase[j]
- + SIZE(pvp->size[j])))) break;
- pAcc = pAcc->next;
- }
- else continue;
- pvp->size[j] = pciGetBaseSize(tag, j, TRUE, &pvp->validSize);
- if (pAcc) {
- pAcc->block_end = pvp->memBase[j] ?
- B2M(TAG(pvp),pvp->memBase[j] + SIZE(pvp->size[j]))
- : B2I(TAG(pvp),pvp->ioBase[j] + SIZE(pvp->size[j]));
- pAcc->res_type &= ~ResEstimated;
- pAcc->res_type |= ResBios;
- }
- }
- if (pvp->biosBase) {
- pAcc = Acc;
- while (pAcc) {
- if (((pAcc->res_type & (ResPhysMask | ResBlock)) ==
- (ResMem | ResBlock))
- && (pAcc->block_begin == B2M(TAG(pvp),pvp->biosBase))
- && (pAcc->block_end == B2M(TAG(pvp),pvp->biosBase
- + SIZE(pvp->biosSize)))) break;
- pAcc = pAcc->next;
- }
- pvp->biosSize = pciGetBaseSize(tag, 6, TRUE, &pvp->validSize);
- if (pAcc) {
- pAcc->block_end = B2M(TAG(pvp),pvp->biosBase+SIZE(pvp->biosSize));
- pAcc->res_type &= ~ResEstimated;
- pAcc->res_type |= ResBios;
- }
- }
-}
-
-/*
- * IO enable/disable related routines for PCI
- */
-#define pArg ((pciArg*)arg)
-#define SETBITS PCI_CMD_IO_ENABLE
-static void
-pciIoAccessEnable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-
-static void
-pciIoAccessDisable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl &= ~SETBITS;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-
-#undef SETBITS
-#define SETBITS (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)
-static void
-pciIo_MemAccessEnable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-
-static void
-pciIo_MemAccessDisable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl &= ~SETBITS;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-
-#undef SETBITS
-#define SETBITS (PCI_CMD_MEM_ENABLE)
-static void
-pciMemAccessEnable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-
-static void
-pciMemAccessDisable(void* arg)
-{
-#ifdef DEBUG
- ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
-#endif
- pArg->ctrl &= ~SETBITS;
- pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
-}
-#undef SETBITS
-#undef pArg
-
-
-/* move to OS layer */
-#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
-static void
-pciBusAccessEnable(BusAccPtr ptr)
-{
- PCITAG tag = ptr->busdep.pci.acc;
- CARD16 ctrl;
-
-#ifdef DEBUG
- ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus);
-#endif
- ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
- if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) {
- ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) &
- ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET);
- pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
- }
-}
-
-/* move to OS layer */
-static void
-pciBusAccessDisable(BusAccPtr ptr)
-{
- PCITAG tag = ptr->busdep.pci.acc;
- CARD16 ctrl;
-
-#ifdef DEBUG
- ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus);
-#endif
- ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
- if (ctrl & MASKBITS) {
- ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
- pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
- }
-}
-#undef MASKBITS
-
-/* move to OS layer */
-static void
-pciDrvBusAccessEnable(BusAccPtr ptr)
-{
- int bus = ptr->busdep.pci.bus;
-
-#ifdef DEBUG
- ErrorF("pciDrvBusAccessEnable: bus=%d\n", bus);
-#endif
- (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
- PCI_PCI_BRIDGE_VGA_EN,
- PCI_PCI_BRIDGE_VGA_EN);
-}
-
-/* move to OS layer */
-static void
-pciDrvBusAccessDisable(BusAccPtr ptr)
-{
- int bus = ptr->busdep.pci.bus;
-
-#ifdef DEBUG
- ErrorF("pciDrvBusAccessDisable: bus=%d\n", bus);
-#endif
- (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
- PCI_PCI_BRIDGE_VGA_EN, 0);
-}
-
-
-static void
-pciSetBusAccess(BusAccPtr ptr)
-{
-#ifdef DEBUG
- ErrorF("pciSetBusAccess: route VGA to bus %d\n", ptr->busdep.pci.bus);
-#endif
-
- if (!ptr->primary && !ptr->current)
- return;
-
- if (ptr->current && ptr->current->disable_f)
- (*ptr->current->disable_f)(ptr->current);
- ptr->current = NULL;
-
- /* walk down */
- while (ptr->primary) { /* No enable for root bus */
- if (ptr != ptr->primary->current) {
- if (ptr->primary->current && ptr->primary->current->disable_f)
- (*ptr->primary->current->disable_f)(ptr->primary->current);
- if (ptr->enable_f)
- (*ptr->enable_f)(ptr);
- ptr->primary->current = ptr;
- }
- ptr = ptr->primary;
- }
-}
-
-/* move to OS layer */
-static void
-savePciState(PCITAG tag, pciSavePtr ptr)
-{
- int i;
-
- ptr->command = pciReadLong(tag, PCI_CMD_STAT_REG);
- for (i=0; i < 6; i++)
- ptr->base[i] = pciReadLong(tag, PCI_CMD_BASE_REG + i*4);
- ptr->biosBase = pciReadLong(tag, PCI_CMD_BIOS_REG);
-}
-
-/* move to OS layer */
-static void
-restorePciState(PCITAG tag, pciSavePtr ptr)
-{
- int i;
-
- /* disable card before setting anything */
- pciSetBitsLong(tag, PCI_CMD_STAT_REG,
- PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE , 0);
- pciWriteLong(tag,PCI_CMD_BIOS_REG, ptr->biosBase);
- for (i=0; i<6; i++)
- pciWriteLong(tag, PCI_CMD_BASE_REG + i*4, ptr->base[i]);
- pciWriteLong(tag, PCI_CMD_STAT_REG, ptr->command);
-}
-
-/* move to OS layer */
-static void
-savePciBusState(BusAccPtr ptr)
-{
- PCITAG tag = ptr->busdep.pci.acc;
-
- ptr->busdep.pci.save.control =
- pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG) &
- ~PCI_PCI_BRIDGE_SECONDARY_RESET;
- /* Allow master aborts to complete normally on non-root buses */
- if (ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
- pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG,
- ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
-}
-
-/* move to OS layer */
-#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
-static void
-restorePciBusState(BusAccPtr ptr)
-{
- PCITAG tag = ptr->busdep.pci.acc;
- CARD16 ctrl;
-
- /* Only restore the bits we've changed (and don't cause resets) */
- ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
- if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) {
- ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
- ctrl |= ptr->busdep.pci.save.control & MASKBITS;
- pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
- }
-}
-#undef MASKBITS
-
-/* move to OS layer */
-static void
-savePciDrvBusState(BusAccPtr ptr)
-{
- int bus = ptr->busdep.pci.bus;
-
- ptr->busdep.pci.save.control =
- (*pciBusInfo[bus]->funcs->pciControlBridge)(bus, 0, 0);
- /* Allow master aborts to complete normally on this bus */
- (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
- PCI_PCI_BRIDGE_MASTER_ABORT_EN,
- 0);
-}
-
-/* move to OS layer */
-static void
-restorePciDrvBusState(BusAccPtr ptr)
-{
- int bus = ptr->busdep.pci.bus;
-
- (*pciBusInfo[bus]->funcs->pciControlBridge)(bus, (CARD16)(-1),
- ptr->busdep.pci.save.control);
-}
-
-
-static void
-disablePciBios(PCITAG tag)
-{
- pciSetBitsLong(tag, PCI_CMD_BIOS_REG, PCI_CMD_BIOS_ENABLE, 0);
-}
-
-/* ????? */
-static void
-correctPciSize(memType base, memType oldsize, memType newsize,
- unsigned long type)
-{
- pciConfigPtr pcrp, *pcrpp;
- pciVideoPtr pvp, *pvpp;
- CARD32 *basep;
- int i;
- int old_bits = 0, new_bits = 0;
-
- if (oldsize + 1) while (oldsize & 1) {
- old_bits ++;
- oldsize >>= 1;
- }
- if (newsize + 1) while (newsize & 1) {
- new_bits ++;
- newsize >>= 1;
- }
-
- for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
-
- /* Only process devices with type 0 headers */
- if ((pcrp->pci_header_type & 0x7f) != 0)
- continue;
-
- basep = &pcrp->pci_base0;
- for (i = 0; i < 6; i++) {
- if (basep[i] && (pcrp->basesize[i] == old_bits)) {
- if ((((type & ResPhysMask) == ResIo) &&
- PCI_MAP_IS_IO(basep[i]) &&
- B2I(pcrp->tag,PCIGETIO(basep[i]) == base)) ||
- (((type & ResPhysMask) == ResMem) &&
- PCI_MAP_IS_MEM(basep[i]) &&
- (((!PCI_MAP_IS64BITMEM(basep[i])) &&
- (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base))
-#if defined(LONG64) || defined(WORD64)
- ||
- (B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base)
-#else
- ||
- (!basep[i+1]
- && (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base))
-#endif
- ))) {
- pcrp->basesize[i] = new_bits;
- break; /* to next device */
- }
- }
- if (PCI_MAP_IS64BITMEM(basep[i])) i++;
- }
- }
-
- if (xf86PciVideoInfo) {
- for (pvpp = xf86PciVideoInfo, pvp = *pvpp; pvp; pvp = *(++pvpp)) {
-
- for (i = 0; i < 6; i++) {
- if (pvp->size[i] == old_bits) {
- if ((((type & ResPhysMask) == ResIo) && pvp->ioBase[i]
- && (B2I(TAG(pvp),pvp->ioBase[i]) == base)) ||
- (((type & ResPhysMask) == ResMem) && pvp->memBase[i]
- && (B2M(TAG(pvp),pvp->memBase[i]) == base))) {
- pvp->size[i] = new_bits;
- break; /* to next device */
- }
- }
- }
- }
- }
-}
-
-/* ????? */
-static void
-removeOverlapsWithBridges(int busIndex, resPtr target)
-{
- PciBusPtr pbp;
- resPtr tmp,bridgeRes = NULL;
- resRange range = target->val;
-
- if (!ResCanOverlap(&target->val))
- return;
-
- for (pbp=xf86PciBus; pbp; pbp = pbp->next) {
- if (pbp->primary == busIndex) {
- tmp = xf86DupResList(pbp->preferred_io);
- bridgeRes = xf86JoinResLists(tmp,bridgeRes);
- tmp = xf86DupResList(pbp->preferred_mem);
- bridgeRes = xf86JoinResLists(tmp,bridgeRes);
- tmp = xf86DupResList(pbp->preferred_pmem);
- bridgeRes = xf86JoinResLists(tmp,bridgeRes);
- }
- }
-
- RemoveOverlaps(target, bridgeRes, TRUE, TRUE);
- if (range.rEnd > target->block_end) {
- correctPciSize(range.rBegin, range.rEnd - range.rBegin,
- target->block_end - target->block_begin,
- target->res_type);
- xf86MsgVerb(X_INFO, 3,
- "PCI %s resource overlap reduced 0x%08lx from 0x%08lx to 0x%08lx\n",
- ((target->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O",
- range.rBegin, range.rEnd, target->block_end);
- }
- xf86FreeResList(bridgeRes);
-}
-
-/* ????? */
-static void
-xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
-{
- pciConfigPtr pcrp, *pcrpp;
- pciVideoPtr pvp, *pvpp;
- CARD32 *basep;
- int i;
- resPtr pRes, tmp;
- resRange range;
- long resMisc;
-
- if (activeRes)
- *activeRes = NULL;
- if (inactiveRes)
- *inactiveRes = NULL;
-
- if (!activeRes || !inactiveRes || !xf86PciInfo)
- return;
-
- if (xf86PciVideoInfo)
- for (pvpp = xf86PciVideoInfo, pvp = *pvpp; pvp; pvp = *(++pvpp)) {
- resPtr *res;
-
- if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass))
- resMisc = ResBios;
- else
- resMisc = 0;
-
- if (((pciConfigPtr)pvp->thisCard)->pci_command
- & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE))
- res = activeRes;
- else
- res = inactiveRes;
-
- if (!pvp->validSize)
- resMisc |= ResEstimated;
-
- for (i = 0; i < 6; i++) {
- if (pvp->ioBase[i] &&
- (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) {
- PV_I_RANGE(range,pvp,i,ResExcIoBlock | resMisc);
- tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pvp->bus,tmp);
- *res = xf86JoinResLists(tmp,*res);
- } else if (pvp->memBase[i] &&
- (pvp->memBase[i] < (memType)(-1 << pvp->size[i]))) {
- PV_M_RANGE(range, pvp,i, ResExcMemBlock | resMisc);
- tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pvp->bus,tmp);
- *res = xf86JoinResLists(tmp,*res);
- }
- }
- /* FIXME!!!: Don't use BIOS resources for overlap
- * checking but reserve them!
- */
- if (pvp->biosBase &&
- (pvp->biosBase < (memType)(-1 << pvp->biosSize))) {
- PV_B_RANGE(range, pvp, ResExcMemBlock | resMisc);
- tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pvp->bus,tmp);
- *res = xf86JoinResLists(tmp,*res);
- }
- }
-
- for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
- resPtr *res;
- CARD8 baseclass, subclass;
-
- if (pcrp->listed_class & 0x0ffff) {
- baseclass = pcrp->listed_class >> 8;
- subclass = pcrp->listed_class;
- } else {
- baseclass = pcrp->pci_base_class;
- subclass = pcrp->pci_sub_class;
- }
-
- if (PCIINFOCLASSES(baseclass, subclass))
- continue;
-
- /* Only process devices with type 0 headers */
- if ((pcrp->pci_header_type & 0x7f) != 0)
- continue;
-
- if (!pcrp->minBasesize)
- resMisc = ResEstimated;
- else
- resMisc = 0;
-
- /*
- * Allow resources allocated to host bridges to overlap. Perhaps, this
- * needs to be specific to AGP-capable chipsets. AGP "memory"
- * sometimes gets allocated within the range routed to the AGP bus.
- */
- if ((baseclass == PCI_CLASS_BRIDGE) &&
- (subclass == PCI_SUBCLASS_BRIDGE_HOST))
- resMisc |= ResOverlap;
-
- basep = &pcrp->pci_base0;
- for (i = 0; i < 6; i++) {
- if (basep[i]) {
- if (PCI_MAP_IS_IO(basep[i])) {
- if (pcrp->pci_command & PCI_CMD_IO_ENABLE)
- res = activeRes;
- else
- res = inactiveRes;
- P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]),
- pcrp->basesize[i], ResExcIoBlock | resMisc)
- } else if (!PCI_MAP_IS64BITMEM(basep[i])) {
- if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
- res = activeRes;
- else
- res = inactiveRes;
- P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]),
- pcrp->basesize[i], ResExcMemBlock | resMisc)
- } else {
- i++;
-#if defined(LONG64) || defined(WORD64)
- P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i - 1]),
- pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
-#else
- if (basep[i])
- continue;
- P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i - 1]),
- pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
-#endif
- if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
- res = activeRes;
- else
- res = inactiveRes;
- }
- if (range.rBegin) { /* catch cases where PCI base is unset */
- tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pcrp->busnum,tmp);
- *res = xf86JoinResLists(tmp,*res);
- }
- }
- }
-
- /* Ignore disabled non-video ROMs */
- if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
- (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) {
- P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom),
- pcrp->basesize[6], ResExcMemBlock | resMisc);
- if (range.rBegin) {
- tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pcrp->busnum, tmp);
- *activeRes = xf86JoinResLists(tmp, *activeRes);
- }
- }
- }
-
- if (*activeRes) {
- xf86MsgVerb(X_INFO, 3, "Active PCI resource ranges:\n");
- xf86PrintResList(3, *activeRes);
- }
- if (*inactiveRes) {
- xf86MsgVerb(X_INFO, 3, "Inactive PCI resource ranges:\n");
- xf86PrintResList(3, *inactiveRes);
- }
-
- /*
- * Adjust ranges based on the assumption that there are no real
- * overlaps in the PCI base allocations. This assumption should be
- * reasonable in most cases. It may be possible to refine the
- * approximated PCI base sizes by considering bus mapping information
- * from PCI-PCI bridges.
- */
-
- if (*activeRes) {
- /* Check for overlaps */
- for (pRes = *activeRes; pRes; pRes = pRes->next) {
- if (ResCanOverlap(&pRes->val)) {
- range = pRes->val;
-
- RemoveOverlaps(pRes, *activeRes, TRUE, TRUE);
- RemoveOverlaps(pRes, *inactiveRes, TRUE,
- (xf86Info.estimateSizesAggressively > 0));
-
- if (range.rEnd > pRes->block_end) {
- correctPciSize(range.rBegin, range.rEnd - range.rBegin,
- pRes->block_end - pRes->block_begin,
- pRes->res_type);
- xf86MsgVerb(X_INFO, 3,
- "PCI %s resource overlap reduced 0x%08lx"
- " from 0x%08lx to 0x%08lx\n",
- ((pRes->res_type & ResPhysMask) == ResMem) ?
- "Memory" : "I/O",
- range.rBegin, range.rEnd, pRes->block_end);
- }
- }
- }
- xf86MsgVerb(X_INFO, 3,
- "Active PCI resource ranges after removing overlaps:\n");
- xf86PrintResList(3, *activeRes);
- }
-
- if (*inactiveRes) {
- /* Check for overlaps */
- for (pRes = *inactiveRes; pRes; pRes = pRes->next) {
- if (ResCanOverlap(&pRes->val)) {
- range = pRes->val;
-
- RemoveOverlaps(pRes, *activeRes, TRUE,
- (xf86Info.estimateSizesAggressively > 1));
- RemoveOverlaps(pRes, *inactiveRes, TRUE,
- (xf86Info.estimateSizesAggressively > 1));
-
- if (range.rEnd > pRes->block_end) {
- correctPciSize(range.rBegin, range.rEnd - range.rBegin,
- pRes->block_end - pRes->block_begin,
- pRes->res_type);
- xf86MsgVerb(X_INFO, 3,
- "PCI %s resource overlap reduced 0x%08lx"
- " from 0x%08lx to 0x%08lx\n",
- ((pRes->res_type & ResPhysMask) == ResMem) ?
- "Memory" : "I/O",
- range.rBegin, range.rEnd, pRes->block_end);
- }
-
- }
- }
- xf86MsgVerb(X_INFO, 3,
- "Inactive PCI resource ranges after removing overlaps:\n");
- xf86PrintResList(3, *inactiveRes);
- }
-}
-
-resPtr
-ResourceBrokerInitPci(resPtr *osRes)
-{
- resPtr activeRes, inactiveRes;
- resPtr tmp;
-
- /* Get bus-specific system resources (PCI) */
- xf86GetPciRes(&activeRes, &inactiveRes);
-
- /*
- * Adjust OS-reported resource ranges based on the assumption that there
- * are no overlaps with the PCI base allocations. This should be a good
- * assumption because writes to PCI address space won't be routed directly
- * to host memory.
- */
-
- for (tmp = *osRes; tmp; tmp = tmp->next)
- RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
-
- xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges after removing"
- " overlaps with PCI:\n");
- xf86PrintResList(3, *osRes);
-
- pciAvoidRes = xf86AddRangesToList(pciAvoidRes,PciAvoid,-1);
- for (tmp = pciAvoidRes; tmp; tmp = tmp->next)
- RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
- tmp = xf86DupResList(*osRes);
- pciAvoidRes = xf86JoinResLists(pciAvoidRes,tmp);
-
- return (xf86JoinResLists(activeRes,inactiveRes));
-}
-
-
-/*
- * PCI Resource modification
- */
-static Bool
-fixPciResource(int prt, memType alignment, pciVideoPtr pvp, unsigned long type)
-{
- int res_n;
- memType *p_base;
- int *p_size;
- unsigned char p_type;
- resPtr AccTmp = NULL;
- resPtr orgAcc = NULL;
- resPtr *pAcc = &AccTmp;
- resPtr avoid = NULL;
- resRange range;
- resPtr resSize = NULL;
- resPtr w_tmp, w = NULL, w_2nd = NULL;
- PCITAG tag;
- PciBusPtr pbp = xf86PciBus;
- pciConfigPtr pcp;
- resPtr tmp;
-
- if (!pvp) return FALSE;
- tag = pciTag(pvp->bus,pvp->device,pvp->func);
- pcp = pvp->thisCard;
-
- type &= ResAccMask;
- if (!type) type = ResShared;
- if (prt < 6) {
- if (pvp->memBase[prt]) {
- type |= ResMem;
- res_n = prt;
- p_base = &(pvp->memBase[res_n]);
- p_size = &(pvp->size[res_n]);
- p_type = pvp->type[res_n];
- if (!PCI_MAP_IS64BITMEM(pvp->type[res_n])) {
- PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock);
- resSize = xf86AddResToList(resSize,&range,-1);
- }
- } else if (pvp->ioBase[prt]){
- type |= ResIo;
- res_n = prt;
- p_base = &(pvp->ioBase[res_n]);
- p_size = &(pvp->size[res_n]);
- p_type = pvp->type[res_n];
- PCI_I_RANGE(range, tag, 0, 0xffffffff, ResExcIoBlock);
- resSize = xf86AddResToList(resSize, &range, -1);
- } else return FALSE;
- } else if (prt == 6) {
- type |= ResMem;
- res_n = 0xff; /* special flag for bios rom */
- p_base = &(pvp->biosBase);
- p_size = &(pvp->biosSize);
- /* XXX This should also include the PCI_MAP_MEMORY_TYPE_MASK part */
- p_type = 0;
- PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock);
- resSize = xf86AddResToList(resSize,&range,-1);
- } else return FALSE;
-
- if (! *p_base) return FALSE;
-
- type |= (range.type & ResDomain) | ResBlock;
-
- /* setup avoid: PciAvoid is bus range: convert later */
- avoid = xf86DupResList(pciAvoidRes);
-
- while (pbp) {
- if (pbp->secondary == pvp->bus) {
- if ((type & ResPhysMask) == ResMem) {
- if (((p_type & PCI_MAP_MEMORY_CACHABLE)
-#if 0 /*EE*/
- || (res_n == 0xff)/* bios should also be prefetchable */
-#endif
- )) {
- if (pbp->preferred_pmem)
- w = xf86FindIntersectOfLists(pbp->preferred_pmem,
- ResRange);
- else if (pbp->pmem)
- w = xf86FindIntersectOfLists(pbp->pmem,ResRange);
-
- if (pbp->preferred_mem)
- w_2nd = xf86FindIntersectOfLists(pbp->preferred_mem,
- ResRange);
- else if (pbp->mem)
- w_2nd = xf86FindIntersectOfLists(pbp->mem,
- ResRange);
- } else {
- if (pbp->preferred_mem)
- w = xf86FindIntersectOfLists(pbp->preferred_mem,
- ResRange);
- else if (pbp->mem)
- w = xf86FindIntersectOfLists(pbp->mem,ResRange);
- }
- } else {
- if (pbp->preferred_io)
- w = xf86FindIntersectOfLists(pbp->preferred_io,ResRange);
- if (pbp->io)
- w = xf86FindIntersectOfLists(pbp->io,ResRange);
- }
- } else if (pbp->primary == pvp->bus) {
- if ((type & ResPhysMask) == ResMem) {
- tmp = xf86DupResList(pbp->preferred_pmem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->preferred_mem);
- avoid = xf86JoinResLists(avoid, tmp);
- } else {
- tmp = xf86DupResList(pbp->preferred_io);
- avoid = xf86JoinResLists(avoid, tmp);
- }
- }
- pbp = pbp->next;
- }
-
- /* convert bus based entries in avoid list to host base */
- pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
-
- if (!w)
- w = xf86DupResList(ResRange);
- xf86MsgVerb(X_INFO, 3, "window:\n");
- xf86PrintResList(3, w);
- xf86MsgVerb(X_INFO, 3, "resSize:\n");
- xf86PrintResList(3, resSize);
-
- if (resSize) {
- w_tmp = w;
- w = xf86FindIntersectOfLists(w,resSize);
- xf86FreeResList(w_tmp);
- if (w_2nd) {
- w_tmp = w_2nd;
- w_2nd = xf86FindIntersectOfLists(w_2nd,resSize);
- xf86FreeResList(w_tmp);
- }
- xf86FreeResList(resSize);
- }
- xf86MsgVerb(X_INFO, 3, "window fixed:\n");
- xf86PrintResList(3, w);
-
- if (!alignment)
- alignment = (1 << (*p_size)) - 1;
-
- /* Access list holds bios resources -- remove this one */
-#ifdef NOTYET
- AccTmp = xf86DupResList(Acc);
- while ((*pAcc)) {
- if ((((*pAcc)->res_type & (type & ~ResAccMask))
- == (type & ~ResAccMask))
- && ((*pAcc)->block_begin == (B2H(tag,(*p_base),type)))
- && ((*pAcc)->block_end == (B2H(tag,
- (*p_base)+SIZE(*p_size),type)))) {
- resPtr acc_tmp = (*pAcc)->next;
- xfree((*pAcc));
- (*pAcc) = acc_tmp;
- break;
- } else
- pAcc = &((*pAcc)->next);
- }
- /* check if we really need to fix anything */
- P_X_RANGE(range,tag,(*p_base),(*p_base) + SIZE((*p_size)),type);
- if (!ChkConflict(&range,avoid,SETUP)
- && !ChkConflict(&range,AccTmp,SETUP)
- && ((B2H(tag,(*p_base),type) & PCI_SIZE(type,tag,alignment)
- == range->block_begin)
- && ((xf86IsSubsetOf(range,w)
- || (w_2nd && xf86IsSubsetOf(range,w_2n))))) {
-#ifdef DEBUG
- ErrorF("nothing to fix\n");
-#endif
- xf86FreeResList(AccTmp);
- xf86FreeResList(w);
- xf86FreeResList(w_2nd);
- xf86FreeResList(avoid);
- return TRUE;
- }
-#ifdef DEBUG
- ErrorF("removing old resource\n");
-#endif
- orgAcc = Acc;
- Acc = AccTmp;
-#else
- orgAcc = xf86DupResList(Acc);
- pAcc = &Acc;
- while (*pAcc) {
- if ((((*pAcc)->res_type & (ResTypeMask|ResExtMask)) ==
- (type & ~ResAccMask))
- && ((*pAcc)->block_begin == B2H(tag,(*p_base),type))
- && ((*pAcc)->block_end == B2H(tag,(*p_base) + SIZE(*p_size),
- type))) {
-#ifdef DEBUG
- ErrorF("removing old resource\n");
-#endif
- tmp = *pAcc;
- *pAcc = (*pAcc)->next;
- tmp->next = NULL;
- xf86FreeResList(tmp);
- break;
- } else
- pAcc = &((*pAcc)->next);
- }
-#endif
-
-#ifdef DEBUG
- ErrorF("base: 0x%lx alignment: 0x%lx host alignment: 0x%lx size[bit]: 0x%x\n",
- (*p_base),alignment,PCI_SIZE(type,tag,alignment),(*p_size));
- xf86MsgVerb(X_INFO, 3, "window:\n");
- xf86PrintResList(3, w);
- if (w_2nd)
- xf86MsgVerb(X_INFO, 3, "2nd window:\n");
- xf86PrintResList(3, w_2nd);
- xf86ErrorFVerb(3,"avoid:\n");
- xf86PrintResList(3,avoid);
-#endif
- w_tmp = w;
- while (w) {
- if ((type & ResTypeMask) == (w->res_type & ResTypeMask)) {
-#ifdef DEBUG
- ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w->block_begin,
- w->block_end);
-#endif
- range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1),
- w->block_begin, w->block_end,
- PCI_SIZE(type,tag,alignment),avoid);
- if (range.type != ResEnd)
- break;
- }
- w = w->next;
- }
- xf86FreeResList(w_tmp);
- /* if unsuccessful and memory prefetchable try non-prefetchable */
- if (range.type == ResEnd && w_2nd) {
- w_tmp = w_2nd;
- while (w_2nd) {
- if ((type & ResTypeMask) == (w_2nd->res_type & ResTypeMask)) {
-#ifdef DEBUG
- ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w_2nd->block_begin,
- w_2nd->block_end);
-#endif
- range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1),
- w_2nd->block_begin, w_2nd->block_end,
- PCI_SIZE(type,tag,alignment),avoid);
- if (range.type != ResEnd)
- break;
- }
- w_2nd = w_2nd->next;
- }
- xf86FreeResList(w_tmp);
- }
- xf86FreeResList(avoid);
-
- if (range.type == ResEnd) {
- xf86MsgVerb(X_ERROR,3,"Cannot find a replacement memory range\n");
- xf86FreeResList(Acc);
- Acc = orgAcc;
- return FALSE;
- }
- xf86FreeResList(orgAcc);
-#ifdef DEBUG
- ErrorF("begin: 0x%lx, end: 0x%lx\n",range.a,range.b);
-#endif
-
- (*p_size) = 0;
- while (alignment >> (*p_size))
- (*p_size)++;
- (*p_base) = H2B(tag,range.rBegin,type);
-#ifdef DEBUG
- ErrorF("New PCI res %i base: 0x%lx, size: 0x%lx, type %s\n",
- res_n,(*p_base),(1 << (*p_size)),
- ((type & ResPhysMask) == ResMem) ? "Mem" : "Io");
-#endif
- if (res_n != 0xff) {
- if ((type & ResPhysMask) == ResMem)
- pvp->memBase[prt] = range.rBegin;
- else
- pvp->ioBase[prt] = range.rBegin;
- ((CARD32 *)(&(pcp->pci_base0)))[res_n] =
- (CARD32)(*p_base) | (CARD32)(p_type);
- pciWriteLong(tag, PCI_CMD_BASE_REG + res_n * sizeof(CARD32),
- ((CARD32 *)(&(pcp->pci_base0)))[res_n]);
- if (PCI_MAP_IS64BITMEM(p_type)) {
-#if defined(LONG64) || defined(WORD64)
- ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] =
- (CARD32)(*p_base >> 32);
- pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32),
- ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1]);
-#else
- ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = 0;
- pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32),
- 0);
-#endif
- }
- } else {
- pvp->biosBase = range.rBegin;
- pcp->pci_baserom = (pciReadLong(tag,PCI_CMD_BIOS_REG) & 0x01) |
- (CARD32)(*p_base);
- pciWriteLong(tag, PCI_CMD_BIOS_REG, pcp->pci_baserom);
- }
- /* @@@ fake BIOS allocated resource */
- range.type |= ResBios;
- Acc = xf86AddResToList(Acc, &range,-1);
-
- return TRUE;
-
-}
-
-Bool
-xf86FixPciResource(int entityIndex, int prt, memType alignment,
- unsigned long type)
-{
- pciVideoPtr pvp = xf86GetPciInfoForEntity(entityIndex);
- return fixPciResource(prt, alignment, pvp, type);
-}
-
-resPtr
-xf86ReallocatePciResources(int entityIndex, resPtr pRes)
-{
- pciVideoPtr pvp = xf86GetPciInfoForEntity(entityIndex);
- resPtr pBad = NULL,pResTmp;
- unsigned int prt = 0;
- int i;
-
- if (!pvp) return pRes;
-
- while (pRes) {
- switch (pRes->res_type & ResPhysMask) {
- case ResMem:
- if (pRes->block_begin == B2M(TAG(pvp),pvp->biosBase) &&
- pRes->block_end == B2M(TAG(pvp),pvp->biosBase
- + SIZE(pvp->biosSize)))
- prt = 6;
- else for (i = 0 ; i < 6; i++)
- if ((pRes->block_begin == B2M(TAG(pvp),pvp->memBase[i]))
- && (pRes->block_end == B2M(TAG(pvp),pvp->memBase[i]
- + SIZE(pvp->size[i])))) {
- prt = i;
- break;
- }
- break;
- case ResIo:
- for (i = 0 ; i < 6; i++)
- if (pRes->block_begin == B2I(TAG(pvp),pvp->ioBase[i])
- && pRes->block_end == B2I(TAG(pvp),pvp->ioBase[i]
- + SIZE(pvp->size[i]))) {
- prt = i;
- break;
- }
- break;
- }
-
- if (!prt) return pRes;
-
- pResTmp = pRes->next;
- if (! fixPciResource(prt, 0, pvp, pRes->res_type)) {
- pRes->next = pBad;
- pBad = pRes;
- } else
- xfree(pRes);
-
- pRes = pResTmp;
- }
- return pBad;
-}
-
-/*
- * BIOS releated
- */
-memType
-getValidBIOSBase(PCITAG tag, int num)
-{
- pciVideoPtr pvp = NULL;
- PciBusPtr pbp;
- resPtr m = NULL;
- resPtr tmp, avoid, mem = NULL;
- resRange range;
- memType ret;
- int n = 0;
- int i;
- CARD32 biosSize, alignment;
-
- if (!xf86PciVideoInfo) return 0;
-
- while ((pvp = xf86PciVideoInfo[n++])) {
- if (pciTag(pvp->bus,pvp->device,pvp->func) == tag)
- break;
- }
- if (!pvp) return 0;
-
- biosSize = pvp->biosSize;
- alignment = (1 << biosSize) - 1;
- if (biosSize > 24)
- biosSize = 24;
-
- switch ((romBaseSource)num) {
- case ROM_BASE_PRESET:
- return 0; /* This should not happen */
- case ROM_BASE_BIOS:
- /* In some cases the BIOS base register contains the size mask */
- if ((memType)(-1 << biosSize) == PCIGETROM(pvp->biosBase))
- return 0;
- /* Make sure we don't conflict with our own mem resources */
- for (i = 0; i < 6; i++) {
- if (!pvp->memBase[i])
- continue;
- P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],
- ResExcMemBlock);
- mem = xf86AddResToList(mem,&range,-1);
- }
- P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock);
- ret = pvp->biosBase;
- break;
- case ROM_BASE_MEM0:
- case ROM_BASE_MEM1:
- case ROM_BASE_MEM2:
- case ROM_BASE_MEM3:
- case ROM_BASE_MEM4:
- case ROM_BASE_MEM5:
- if (!pvp->memBase[num] || (pvp->size[num] < biosSize))
- return 0;
- P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize,
- ResExcMemBlock);
- ret = pvp->memBase[num];
- break;
- case ROM_BASE_FIND:
- ret = 0;
- break;
- default:
- return 0; /* This should not happen */
- }
-
- /* Now find the ranges for validation */
- avoid = xf86DupResList(pciAvoidRes);
- pbp = xf86PciBus;
- while (pbp) {
- if (pbp->secondary == pvp->bus) {
- if (pbp->preferred_pmem)
- tmp = xf86DupResList(pbp->preferred_pmem);
- else
- tmp = xf86DupResList(pbp->pmem);
- m = xf86JoinResLists(m,tmp);
- if (pbp->preferred_mem)
- tmp = xf86DupResList(pbp->preferred_mem);
- else
- tmp = xf86DupResList(pbp->mem);
- m = xf86JoinResLists(m,tmp);
- tmp = m;
- while (tmp) {
- tmp->block_end = MIN(tmp->block_end,PCI_MEM32_LENGTH_MAX);
- tmp = tmp->next;
- }
- } else if ((pbp->primary == pvp->bus) &&
- (pbp->secondary >= 0) &&
- (pbp->primary != pbp->secondary)) {
- tmp = xf86DupResList(pbp->preferred_pmem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->pmem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->preferred_mem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->mem);
- avoid = xf86JoinResLists(avoid, tmp);
- }
- pbp = pbp->next;
- }
- pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
- if (mem)
- pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem);
-
- if (!ret) {
- /* Return a possible window */
- while (m) {
- range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)),
- PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize),
- m->block_begin, m->block_end,
- PCI_SIZE(ResMem, TAG(pvp), alignment),
- avoid);
- if (range.type != ResEnd) {
- ret = M2B(TAG(pvp), range.rBase);
- break;
- }
- m = m->next;
- }
- } else {
- if (!xf86IsSubsetOf(range, m) ||
- ChkConflict(&range, avoid, SETUP)
- || (mem && ChkConflict(&range, mem, SETUP)))
- ret = 0;
- }
-
- xf86FreeResList(avoid);
- xf86FreeResList(m);
- return ret;
-}
-
-/*
- * xf86Bus.c interface
- */
-
-void
-xf86PciProbe(void)
-{
- /*
- * Initialise the pcidata entry points.
- */
-#ifdef XFree86LOADER
- xf86SetupPciIds = (ScanPciSetupProcPtr)LoaderSymbol("ScanPciSetupPciIds");
- xf86ClosePciIds = (ScanPciCloseProcPtr)LoaderSymbol("ScanPciClosePciIds");
- xf86FindPciNamesByDevice =
- (ScanPciFindByDeviceProcPtr)LoaderSymbol("ScanPciFindPciNamesByDevice");
- xf86FindPciNamesBySubsys =
- (ScanPciFindBySubsysProcPtr)LoaderSymbol("ScanPciFindPciNamesBySubsys");
- xf86FindPciClassBySubsys =
- (ScanPciFindClassBySubsysProcPtr)LoaderSymbol("ScanPciFindPciClassBySubsys");
- xf86FindPciClassByDevice =
- (ScanPciFindClassByDeviceProcPtr)LoaderSymbol("ScanPciFindPciClassByDevice");
-#else
- xf86SetupPciIds = ScanPciSetupPciIds;
- xf86ClosePciIds = ScanPciClosePciIds;
- xf86FindPciNamesByDevice = ScanPciFindPciNamesByDevice;
- xf86FindPciNamesBySubsys = ScanPciFindPciNamesBySubsys;
- xf86FindPciClassBySubsys = ScanPciFindPciClassBySubsys;
- xf86FindPciClassByDevice = ScanPciFindPciClassByDevice;
-#endif
-
- if (!xf86SetupPciIds())
- FatalError("xf86SetupPciIds() failed\n");
-
- FindPCIVideoInfo();
-}
-
-static void alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary);
-
-static void
-printBridgeInfo(PciBusPtr PciBus)
-{
- char primary[8], secondary[8], subordinate[8], brbus[8];
-
- xf86FormatPciBusNumber(PciBus->primary, primary);
- xf86FormatPciBusNumber(PciBus->secondary, secondary);
- xf86FormatPciBusNumber(PciBus->subordinate, subordinate);
- xf86FormatPciBusNumber(PciBus->brbus, brbus);
-
- xf86MsgVerb(X_INFO, 3, "Bus %s: bridge is at (%s:%d:%d), (%s,%s,%s),"
- " BCTRL: 0x%04x (VGA_EN is %s)\n",
- secondary, brbus, PciBus->brdev, PciBus->brfunc,
- primary, secondary, subordinate, PciBus->brcontrol,
- (PciBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN) ?
- "set" : "cleared");
- if (PciBus->preferred_io) {
- xf86MsgVerb(X_INFO, 3,
- "Bus %s I/O range:\n", secondary);
- xf86PrintResList(3, PciBus->preferred_io);
- }
- if (PciBus->preferred_mem) {
- xf86MsgVerb(X_INFO, 3,
- "Bus %s non-prefetchable memory range:\n", secondary);
- xf86PrintResList(3, PciBus->preferred_mem);
- }
- if (PciBus->preferred_pmem) {
- xf86MsgVerb(X_INFO, 3,
- "Bus %s prefetchable memory range:\n", secondary);
- xf86PrintResList(3, PciBus->preferred_pmem);
- }
-}
-
-static PciBusPtr
-xf86GetPciBridgeInfo(void)
-{
- const pciConfigPtr *pcrpp;
- pciConfigPtr pcrp;
- pciBusInfo_t *pBusInfo;
- resRange range;
- PciBusPtr PciBus, PciBusBase = NULL;
- PciBusPtr *pnPciBus = &PciBusBase;
- int MaxBus = 0;
- int i, domain;
- int primary, secondary, subordinate;
- memType base, limit;
-
- resPtr pciBusAccWindows = xf86PciBusAccWindowsFromOS();
-
- if (xf86PciInfo == NULL)
- return NULL;
-
- /* Add each bridge */
- for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *(++pcrpp)) {
- if (pcrp->busnum > MaxBus)
- MaxBus = pcrp->busnum;
- if ((pcrp->pci_base_class == PCI_CLASS_BRIDGE) ||
- (((pcrp->listed_class >> 8) & 0xff) == PCI_CLASS_BRIDGE)) {
- int sub_class;
- sub_class = (pcrp->listed_class & 0xffff) ?
- (pcrp->listed_class & 0xff) : pcrp->pci_sub_class;
- domain = xf86GetPciDomain(pcrp->tag);
-
- switch (sub_class) {
- case PCI_SUBCLASS_BRIDGE_PCI:
- /* something fishy about the header? If so: just ignore! */
- if ((pcrp->pci_header_type & 0x7f) != 0x01) {
- xf86MsgVerb(X_WARNING, 3, "PCI-PCI bridge at %x:%x:%x has"
- " unexpected header: 0x%x",
- pcrp->busnum, pcrp->devnum,
- pcrp->funcnum, pcrp->pci_header_type);
- break;
- }
-
- domain = pcrp->busnum & 0x0000FF00;
- primary = pcrp->busnum;
- secondary = domain | pcrp->pci_secondary_bus_number;
- subordinate = domain | pcrp->pci_subordinate_bus_number;
-
- /* Is this the correct bridge? If not, ignore it */
- pBusInfo = pcrp->businfo;
- if (pBusInfo && (pcrp != pBusInfo->bridge)) {
- xf86MsgVerb(X_WARNING, 3, "PCI bridge mismatch for bus %x:"
- " %x:%x:%x and %x:%x:%x\n", secondary,
- pcrp->busnum, pcrp->devnum, pcrp->funcnum,
- pBusInfo->bridge->busnum,
- pBusInfo->bridge->devnum,
- pBusInfo->bridge->funcnum);
- break;
- }
-
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
- (*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
- &primary,
- &secondary,
- &subordinate);
-
- if (!pcrp->fakeDevice && (primary >= secondary)) {
- xf86MsgVerb(X_WARNING, 3, "Misconfigured PCI bridge"
- " %x:%x:%x (%x,%x)\n",
- pcrp->busnum, pcrp->devnum, pcrp->funcnum,
- primary, secondary);
- break;
- }
-
- *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
- pnPciBus = &PciBus->next;
-
- PciBus->primary = primary;
- PciBus->secondary = secondary;
- PciBus->subordinate = subordinate;
-
- PciBus->brbus = pcrp->busnum;
- PciBus->brdev = pcrp->devnum;
- PciBus->brfunc = pcrp->funcnum;
-
- PciBus->subclass = sub_class;
- PciBus->interface = pcrp->pci_prog_if;
-
- if (pBusInfo && pBusInfo->funcs->pciControlBridge)
- PciBus->brcontrol =
- (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
- else
- PciBus->brcontrol = pcrp->pci_bridge_control;
-
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
- (*pBusInfo->funcs->pciGetBridgeResources)(secondary,
- (pointer *)&PciBus->preferred_io,
- (pointer *)&PciBus->preferred_mem,
- (pointer *)&PciBus->preferred_pmem);
- break;
- }
-
- if ((pcrp->pci_command & PCI_CMD_IO_ENABLE) &&
- (pcrp->pci_upper_io_base || pcrp->pci_io_base ||
- pcrp->pci_upper_io_limit || pcrp->pci_io_limit)) {
- base = (pcrp->pci_upper_io_base << 16) |
- ((pcrp->pci_io_base & 0xf0u) << 8);
- limit = (pcrp->pci_upper_io_limit << 16) |
- ((pcrp->pci_io_limit & 0xf0u) << 8) | 0x0fff;
- /*
- * Deal with bridge ISA mode (256 wide ranges spaced 1K
- * apart, but only in the first 64K).
- */
- if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
- while ((base <= (CARD16)(-1)) && (base <= limit)) {
- PCI_I_RANGE(range, pcrp->tag,
- base, base + (CARD8)(-1),
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io,
- &range, -1);
- base += 0x0400;
- }
- }
- if (base <= limit) {
- PCI_I_RANGE(range, pcrp->tag, base, limit,
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io, &range, -1);
- }
- }
- if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
- /*
- * The P2P spec requires these next two, but some bridges
- * don't comply. Err on the side of caution, making the not
- * so bold assumption that no bridge would ever re-route the
- * bottom megabyte.
- */
- if (pcrp->pci_mem_base || pcrp->pci_mem_limit) {
- base = pcrp->pci_mem_base & 0xfff0u;
- limit = pcrp->pci_mem_limit & 0xfff0u;
- if (base <= limit) {
- PCI_M_RANGE(range, pcrp->tag,
- base << 16, (limit << 16) | 0x0fffff,
- ResMem | ResBlock | ResExclusive);
- PciBus->preferred_mem =
- xf86AddResToList(PciBus->preferred_mem, &range, -1);
- }
- }
-
- if (pcrp->pci_prefetch_mem_base ||
- pcrp->pci_prefetch_mem_limit ||
- pcrp->pci_prefetch_upper_mem_base ||
- pcrp->pci_prefetch_upper_mem_limit) {
- base = pcrp->pci_prefetch_mem_base & 0xfff0u;
- limit = pcrp->pci_prefetch_mem_limit & 0xfff0u;
-#if defined(LONG64) || defined(WORD64)
- base |= (memType)pcrp->pci_prefetch_upper_mem_base << 16;
- limit |= (memType)pcrp->pci_prefetch_upper_mem_limit << 16;
-#endif
- if (base <= limit) {
- PCI_M_RANGE(range, pcrp->tag,
- base << 16, (limit << 16) | 0xfffff,
- ResMem | ResBlock | ResExclusive);
- PciBus->preferred_pmem =
- xf86AddResToList(PciBus->preferred_pmem,
- &range, -1);
- }
- }
- }
- break;
-
- case PCI_SUBCLASS_BRIDGE_CARDBUS:
- /* something fishy about the header? If so: just ignore! */
- if ((pcrp->pci_header_type & 0x7f) != 0x02) {
- xf86MsgVerb(X_WARNING, 3, "PCI-CardBus bridge at %x:%x:%x"
- " has unexpected header: 0x%x",
- pcrp->busnum, pcrp->devnum,
- pcrp->funcnum, pcrp->pci_header_type);
- break;
- }
-
- domain = pcrp->busnum & 0x0000FF00;
- primary = pcrp->busnum;
- secondary = domain | pcrp->pci_cb_cardbus_bus_number;
- subordinate = domain | pcrp->pci_subordinate_bus_number;
-
- /* Is this the correct bridge? If not, ignore it */
- pBusInfo = pcrp->businfo;
- if (pBusInfo && (pcrp != pBusInfo->bridge)) {
- xf86MsgVerb(X_WARNING, 3, "CardBus bridge mismatch for bus"
- " %x: %x:%x:%x and %x:%x:%x\n", secondary,
- pcrp->busnum, pcrp->devnum, pcrp->funcnum,
- pBusInfo->bridge->busnum,
- pBusInfo->bridge->devnum,
- pBusInfo->bridge->funcnum);
- break;
- }
-
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
- (*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
- &primary,
- &secondary,
- &subordinate);
-
- if (primary >= secondary) {
- if (pcrp->pci_cb_cardbus_bus_number != 0)
- xf86MsgVerb(X_WARNING, 3, "Misconfigured CardBus"
- " bridge %x:%x:%x (%x,%x)\n",
- pcrp->busnum, pcrp->devnum, pcrp->funcnum,
- primary, secondary);
- break;
- }
-
- *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
- pnPciBus = &PciBus->next;
-
- PciBus->primary = primary;
- PciBus->secondary = secondary;
- PciBus->subordinate = subordinate;
-
- PciBus->brbus = pcrp->busnum;
- PciBus->brdev = pcrp->devnum;
- PciBus->brfunc = pcrp->funcnum;
-
- PciBus->subclass = sub_class;
- PciBus->interface = pcrp->pci_prog_if;
-
- if (pBusInfo && pBusInfo->funcs->pciControlBridge)
- PciBus->brcontrol =
- (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
- else
- PciBus->brcontrol = pcrp->pci_bridge_control;
-
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
- (*pBusInfo->funcs->pciGetBridgeResources)(secondary,
- (pointer *)&PciBus->preferred_io,
- (pointer *)&PciBus->preferred_mem,
- (pointer *)&PciBus->preferred_pmem);
- break;
- }
-
- if (pcrp->pci_command & PCI_CMD_IO_ENABLE) {
- if (pcrp->pci_cb_iobase0) {
- base = PCI_CB_IOBASE(pcrp->pci_cb_iobase0);
- limit = PCI_CB_IOLIMIT(pcrp->pci_cb_iolimit0);
-
- /*
- * Deal with bridge ISA mode (256-wide ranges spaced 1K
- * apart (start to start), but only in the first 64K).
- */
- if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
- while ((base <= (CARD16)(-1)) &&
- (base <= limit)) {
- PCI_I_RANGE(range, pcrp->tag,
- base, base + (CARD8)(-1),
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io,
- &range, -1);
- base += 0x0400;
- }
- }
-
- if (base <= limit) {
- PCI_I_RANGE(range, pcrp->tag, base, limit,
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io,
- &range, -1);
- }
- }
-
- if (pcrp->pci_cb_iobase1) {
- base = PCI_CB_IOBASE(pcrp->pci_cb_iobase1);
- limit = PCI_CB_IOLIMIT(pcrp->pci_cb_iolimit1);
-
- /*
- * Deal with bridge ISA mode (256-wide ranges spaced 1K
- * apart (start to start), but only in the first 64K).
- */
- if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
- while ((base <= (CARD16)(-1)) &&
- (base <= limit)) {
- PCI_I_RANGE(range, pcrp->tag,
- base, base + (CARD8)(-1),
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io,
- &range, -1);
- base += 0x0400;
- }
- }
-
- if (base <= limit) {
- PCI_I_RANGE(range, pcrp->tag, base, limit,
- ResIo | ResBlock | ResExclusive);
- PciBus->preferred_io =
- xf86AddResToList(PciBus->preferred_io,
- &range, -1);
- }
- }
- }
-
- if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
- if ((pcrp->pci_cb_membase0) &&
- (pcrp->pci_cb_membase0 <= pcrp->pci_cb_memlimit0)) {
- PCI_M_RANGE(range, pcrp->tag,
- pcrp->pci_cb_membase0 & ~0x0fff,
- pcrp->pci_cb_memlimit0 | 0x0fff,
- ResMem | ResBlock | ResExclusive);
- if (pcrp->pci_bridge_control &
- PCI_CB_BRIDGE_CTL_PREFETCH_MEM0)
- PciBus->preferred_pmem =
- xf86AddResToList(PciBus->preferred_pmem,
- &range, -1);
- else
- PciBus->preferred_mem =
- xf86AddResToList(PciBus->preferred_mem,
- &range, -1);
- }
- if ((pcrp->pci_cb_membase1) &&
- (pcrp->pci_cb_membase1 <= pcrp->pci_cb_memlimit1)) {
- PCI_M_RANGE(range, pcrp->tag,
- pcrp->pci_cb_membase1 & ~0x0fff,
- pcrp->pci_cb_memlimit1 | 0x0fff,
- ResMem | ResBlock | ResExclusive);
- if (pcrp->pci_bridge_control &
- PCI_CB_BRIDGE_CTL_PREFETCH_MEM1)
- PciBus->preferred_pmem =
- xf86AddResToList(PciBus->preferred_pmem,
- &range, -1);
- else
- PciBus->preferred_mem =
- xf86AddResToList(PciBus->preferred_mem,
- &range, -1);
- }
- }
-
- break;
-
- case PCI_SUBCLASS_BRIDGE_ISA:
- case PCI_SUBCLASS_BRIDGE_EISA:
- case PCI_SUBCLASS_BRIDGE_MC:
- *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
- pnPciBus = &PciBus->next;
- PciBus->primary = pcrp->busnum;
- PciBus->secondary = PciBus->subordinate = -1;
- PciBus->brbus = pcrp->busnum;
- PciBus->brdev = pcrp->devnum;
- PciBus->brfunc = pcrp->funcnum;
- PciBus->subclass = sub_class;
- PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
- break;
-
- case PCI_SUBCLASS_BRIDGE_HOST:
- /* Is this the correct bridge? If not, ignore bus info */
- pBusInfo = pcrp->businfo;
- if (pBusInfo == HOST_NO_BUS)
- break;
-
- secondary = 0;
- if (pBusInfo) {
- /* Find "secondary" bus segment */
- while (pBusInfo != pciBusInfo[secondary])
- secondary++;
- if (pcrp != pBusInfo->bridge) {
- xf86MsgVerb(X_WARNING, 3, "Host bridge mismatch for"
- " bus %x: %x:%x:%x and %x:%x:%x\n",
- pBusInfo->primary_bus,
- pcrp->busnum, pcrp->devnum, pcrp->funcnum,
- pBusInfo->bridge->busnum,
- pBusInfo->bridge->devnum,
- pBusInfo->bridge->funcnum);
- pBusInfo = NULL;
- }
- }
-
- *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
- pnPciBus = &PciBus->next;
-
- PciBus->primary = -1;
- PciBus->secondary = -1; /* to be set below */
- PciBus->subordinate = pciNumBuses - 1;
-
- if (pBusInfo) {
- PciBus->primary = PciBus->secondary = secondary;
- if (pBusInfo->funcs->pciGetBridgeBuses)
- (*pBusInfo->funcs->pciGetBridgeBuses)
- (secondary,
- &PciBus->primary,
- &PciBus->secondary,
- &PciBus->subordinate);
- }
-
- PciBus->brbus = pcrp->busnum;
- PciBus->brdev = pcrp->devnum;
- PciBus->brfunc = pcrp->funcnum;
-
- PciBus->subclass = sub_class;
-
- if (pBusInfo && pBusInfo->funcs->pciControlBridge)
- PciBus->brcontrol =
- (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
- else
- PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
-
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
- (*pBusInfo->funcs->pciGetBridgeResources)
- (secondary,
- (pointer *)&PciBus->preferred_io,
- (pointer *)&PciBus->preferred_mem,
- (pointer *)&PciBus->preferred_pmem);
- break;
- }
-
- PciBus->preferred_io =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResIo, domain));
- PciBus->preferred_mem =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResMem, domain));
- PciBus->preferred_pmem =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResMem, domain));
- break;
-
- default:
- break;
- }
- }
- }
- for (i = 0; i <= MaxBus; i++) { /* find PCI buses not attached to bridge */
- if (!pciBusInfo[i])
- continue;
- for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next)
- if (PciBus->secondary == i) break;
- if (!PciBus) { /* We assume it's behind a HOST-PCI bridge */
- /*
- * Find the 'smallest' free HOST-PCI bridge, where 'small' is in
- * the order of pciTag().
- */
- PCITAG minTag = 0xFFFFFFFF, tag;
- PciBusPtr PciBusFound = NULL;
- for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next)
- if ((PciBus->subclass == PCI_SUBCLASS_BRIDGE_HOST) &&
- (PciBus->secondary == -1) &&
- ((tag = pciTag(PciBus->brbus,PciBus->brdev,PciBus->brfunc))
- < minTag) ) {
- minTag = tag;
- PciBusFound = PciBus;
- }
- if (PciBusFound)
- PciBusFound->secondary = i;
- else { /* if nothing found it may not be visible: create new */
- /* Find a device on this bus */
- domain = 0;
- for (pcrpp = xf86PciInfo; (pcrp = *pcrpp); pcrpp++) {
- if (pcrp->busnum == i) {
- domain = xf86GetPciDomain(pcrp->tag);
- break;
- }
- }
- *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
- pnPciBus = &PciBus->next;
- PciBus->primary = PciBus->secondary = i;
- PciBus->subclass = PCI_SUBCLASS_BRIDGE_HOST;
- PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
- PciBus->preferred_io =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResIo, domain));
- PciBus->preferred_mem =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResMem, domain));
- PciBus->preferred_pmem =
- xf86ExtractTypeFromList(pciBusAccWindows,
- RANGE_TYPE(ResMem, domain));
- }
- }
- }
-
- for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
- if (PciBus->primary == PciBus->secondary) {
- alignBridgeRanges(PciBusBase, PciBus);
- }
- }
-
- for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
- switch (PciBus->subclass) {
- case PCI_SUBCLASS_BRIDGE_PCI:
- if (PciBus->interface == PCI_IF_BRIDGE_PCI_SUBTRACTIVE)
- xf86MsgVerb(X_INFO, 3, "Subtractive PCI-to-PCI bridge:\n");
- else
- xf86MsgVerb(X_INFO, 3, "PCI-to-PCI bridge:\n");
- break;
- case PCI_SUBCLASS_BRIDGE_CARDBUS:
- xf86MsgVerb(X_INFO, 3, "PCI-to-CardBus bridge:\n");
- break;
- case PCI_SUBCLASS_BRIDGE_HOST:
- xf86MsgVerb(X_INFO, 3, "Host-to-PCI bridge:\n");
- break;
- case PCI_SUBCLASS_BRIDGE_ISA:
- xf86MsgVerb(X_INFO, 3, "PCI-to-ISA bridge:\n");
- break;
- case PCI_SUBCLASS_BRIDGE_EISA:
- xf86MsgVerb(X_INFO, 3, "PCI-to-EISA bridge:\n");
- break;
- case PCI_SUBCLASS_BRIDGE_MC:
- xf86MsgVerb(X_INFO, 3, "PCI-to-MCA bridge:\n");
- break;
- default:
- break;
- }
- printBridgeInfo(PciBus);
- }
- xf86FreeResList(pciBusAccWindows);
- return PciBusBase;
-}
-
-static void
-alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary)
-{
- PciBusPtr PciBus;
-
- for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
- if ((PciBus != primary) && (PciBus->primary != -1)
- && (PciBus->primary == primary->secondary)) {
- resPtr tmp;
- tmp = xf86FindIntersectOfLists(primary->preferred_io,
- PciBus->preferred_io);
- xf86FreeResList(PciBus->preferred_io);
- PciBus->preferred_io = tmp;
- tmp = xf86FindIntersectOfLists(primary->preferred_pmem,
- PciBus->preferred_pmem);
- xf86FreeResList(PciBus->preferred_pmem);
- PciBus->preferred_pmem = tmp;
- tmp = xf86FindIntersectOfLists(primary->preferred_mem,
- PciBus->preferred_mem);
- xf86FreeResList(PciBus->preferred_mem);
- PciBus->preferred_mem = tmp;
-
- /* Deal with subtractive decoding */
- switch (PciBus->subclass) {
- case PCI_SUBCLASS_BRIDGE_PCI:
- if (PciBus->interface != PCI_IF_BRIDGE_PCI_SUBTRACTIVE)
- break;
- /* Fall through */
-#if 0 /* Not yet */
- case PCI_SUBCLASS_BRIDGE_ISA:
- case PCI_SUBCLASS_BRIDGE_EISA:
- case PCI_SUBCLASS_BRIDGE_MC:
-#endif
- if (!(PciBus->io = primary->io))
- PciBus->io = primary->preferred_io;
- if (!(PciBus->mem = primary->mem))
- PciBus->mem = primary->preferred_mem;
- if (!(PciBus->pmem = primary->pmem))
- PciBus->pmem = primary->preferred_pmem;
- default:
- break;
- }
-
- alignBridgeRanges(PciBusBase, PciBus);
- }
- }
-}
-
-void
-ValidatePci(void)
-{
- pciVideoPtr pvp, pvp1;
- PciBusPtr pbp;
- pciConfigPtr pcrp, *pcrpp;
- CARD32 *basep;
- resPtr Sys;
- resRange range;
- int n = 0, m, i;
-
- if (!xf86PciVideoInfo) return;
-
- /*
- * Mark all pciInfoRecs that need to be validated. These are
- * the ones which have been assigned to a screen.
- */
- Sys = xf86DupResList(osRes);
- /* Only validate graphics devices in use */
- for (i=0; i<xf86NumScreens; i++) {
- for (m = 0; m < xf86Screens[i]->numEntities; m++)
- if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m])))
- pvp->validate = TRUE;
- }
-
- /*
- * Collect all background PCI resources we need to validate against.
- * These are all resources which don't belong to PCINONSYSTEMCLASSES
- * and which have not been assigned to an entity.
- */
- /* First get the PCIINFOCLASSES */
- m = 0;
- while ((pvp = xf86PciVideoInfo[m++])) {
- /* is it a PCINONSYSTEMCLASS? */
- if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass))
- continue;
- /* has it an Entity assigned to it? */
- for (i=0; i<xf86NumEntities; i++) {
- EntityPtr p = xf86Entities[i];
- if (p->busType != BUS_PCI)
- continue;
- if (p->pciBusId.bus == pvp->bus
- && p->pciBusId.device == pvp->device
- && p->pciBusId.func == pvp->func)
- break;
- }
- if (i != xf86NumEntities) /* found an Entity for this one */
- continue;
-
- for (i = 0; i<6; i++) {
- if (pvp->ioBase[i]) {
- PV_I_RANGE(range,pvp,i,ResExcIoBlock);
- Sys = xf86AddResToList(Sys,&range,-1);
- } else if (pvp->memBase[i]) {
- PV_M_RANGE(range,pvp,i,ResExcMemBlock);
- Sys = xf86AddResToList(Sys,&range,-1);
- }
- }
- }
- for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
-
- /* These were handled above */
- if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class))
- continue;
-
- if ((pcrp->pci_header_type & 0x7f) ||
- !(pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)))
- continue;
-
- basep = &pcrp->pci_base0;
- for (i = 0; i < 6; i++) {
- if (basep[i]) {
- if (PCI_MAP_IS_IO(basep[i])) {
- if (!(pcrp->pci_command & PCI_CMD_IO_ENABLE))
- continue;
- P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]),
- pcrp->basesize[i], ResExcIoBlock)
- } else if (!PCI_MAP_IS64BITMEM(basep[i])) {
- if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
- continue;
- P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]),
- pcrp->basesize[i], ResExcMemBlock)
- } else {
- i++;
- if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
- continue;
-#if defined(LONG64) || defined(WORD64)
- P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]),
- pcrp->basesize[i-1], ResExcMemBlock)
-#else
- if (basep[i])
- continue;
- P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]),
- pcrp->basesize[i-1], ResExcMemBlock)
-#endif
- }
- Sys = xf86AddResToList(Sys, &range, -1);
- }
- }
- if ((pcrp->pci_baserom) &&
- (pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
- (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) {
- P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom),
- pcrp->basesize[6],ResExcMemBlock);
- Sys = xf86AddResToList(Sys, &range, -1);
- }
- }
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3,"Sys:\n");
- xf86PrintResList(3,Sys);
-#endif
-
- /*
- * The order the video devices are listed in is
- * just right: the lower buses come first.
- * This way we attempt to fix a conflict of
- * a lower bus device with a higher bus device
- * where we have more room to find different
- * resources.
- */
- while ((pvp = xf86PciVideoInfo[n++])) {
- resPtr res_mp = NULL, res_m_io = NULL;
- resPtr NonSys;
- resPtr tmp, avoid = NULL;
-
- if (!pvp->validate) continue;
- NonSys = xf86DupResList(Sys);
- m = n;
- while ((pvp1 = xf86PciVideoInfo[m++])) {
- if (!pvp1->validate) continue;
- for (i = 0; i<6; i++) {
- if (pvp1->ioBase[i]) {
- PV_I_RANGE(range,pvp1,i,ResExcIoBlock);
- NonSys = xf86AddResToList(NonSys,&range,-1);
- } else if (pvp1->memBase[i]) {
- PV_M_RANGE(range,pvp1,i,ResExcMemBlock);
- NonSys = xf86AddResToList(NonSys,&range,-1);
- }
- }
- }
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3,"NonSys:\n");
- xf86PrintResList(3,NonSys);
-#endif
- pbp = xf86PciBus;
- while (pbp) {
- if (pbp->secondary == pvp->bus) {
- if (pbp->preferred_pmem) {
- /* keep prefetchable separate */
- res_mp =
- xf86FindIntersectOfLists(pbp->preferred_pmem, ResRange);
- }
- if (pbp->pmem) {
- res_mp = xf86FindIntersectOfLists(pbp->pmem, ResRange);
- }
- if (pbp->preferred_mem) {
- res_m_io =
- xf86FindIntersectOfLists(pbp->preferred_mem, ResRange);
- }
- if (pbp->mem) {
- res_m_io = xf86FindIntersectOfLists(pbp->mem, ResRange);
- }
- if (pbp->preferred_io) {
- res_m_io = xf86JoinResLists(res_m_io,
- xf86FindIntersectOfLists(pbp->preferred_io, ResRange));
- }
- if (pbp->io) {
- res_m_io = xf86JoinResLists(res_m_io,
- xf86FindIntersectOfLists(pbp->preferred_io, ResRange));
- }
- } else if ((pbp->primary == pvp->bus) &&
- (pbp->secondary >= 0) &&
- (pbp->primary != pbp->secondary)) {
- tmp = xf86DupResList(pbp->preferred_pmem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->preferred_mem);
- avoid = xf86JoinResLists(avoid, tmp);
- tmp = xf86DupResList(pbp->preferred_io);
- avoid = xf86JoinResLists(avoid, tmp);
- }
- pbp = pbp->next;
- }
- if (res_m_io == NULL)
- res_m_io = xf86DupResList(ResRange);
-
- pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
-
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3,"avoid:\n");
- xf86PrintResList(3,avoid);
- xf86MsgVerb(X_INFO, 3,"prefetchable Memory:\n");
- xf86PrintResList(3,res_mp);
- xf86MsgVerb(X_INFO, 3,"MEM/IO:\n");
- xf86PrintResList(3,res_m_io);
-#endif
- for (i = 0; i < 6; i++) {
- int j;
- resPtr own = NULL;
- for (j = i+1; j < 6; j++) {
- if (pvp->ioBase[j]) {
- PV_I_RANGE(range,pvp,j,ResExcIoBlock);
- own = xf86AddResToList(own,&range,-1);
- } else if (pvp->memBase[j]) {
- PV_M_RANGE(range,pvp,j,ResExcMemBlock);
- own = xf86AddResToList(own,&range,-1);
- }
- }
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "own:\n");
- xf86PrintResList(3, own);
-#endif
- if (pvp->ioBase[i]) {
- PV_I_RANGE(range,pvp,i,ResExcIoBlock);
- if (xf86IsSubsetOf(range,res_m_io)
- && ! ChkConflict(&range,own,SETUP)
- && ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP)) {
- xf86FreeResList(own);
- continue;
- }
- xf86MsgVerb(X_WARNING, 0,
- "****INVALID IO ALLOCATION**** b: 0x%lx e: 0x%lx "
- "correcting\a\n", range.rBegin,range.rEnd);
-#ifdef DEBUG
- sleep(2);
-#endif
- fixPciResource(i, 0, pvp, range.type);
- } else if (pvp->memBase[i]) {
- PV_M_RANGE(range,pvp,i,ResExcMemBlock);
- if (pvp->type[i] & PCI_MAP_MEMORY_CACHABLE) {
- if (xf86IsSubsetOf(range,res_mp)
- && ! ChkConflict(&range,own,SETUP)
- && ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP)) {
- xf86FreeResList(own);
- continue;
- }
- }
- if (xf86IsSubsetOf(range,res_m_io)
- && ! ChkConflict(&range,own,SETUP)
- && ! ChkConflict(&range,avoid,SETUP)
- && ! ChkConflict(&range,NonSys,SETUP)) {
- xf86FreeResList(own);
- continue;
- }
- xf86MsgVerb(X_WARNING, 0,
- "****INVALID MEM ALLOCATION**** b: 0x%lx e: 0x%lx "
- "correcting\a\n", range.rBegin,range.rEnd);
- if (ChkConflict(&range,own,SETUP)) {
- xf86MsgVerb(X_INFO,3,"own\n");
- xf86PrintResList(3,own);
- }
- if (ChkConflict(&range,avoid,SETUP)) {
- xf86MsgVerb(X_INFO,3,"avoid\n");
- xf86PrintResList(3,avoid);
- }
- if (ChkConflict(&range,NonSys,SETUP)) {
- xf86MsgVerb(X_INFO,3,"NonSys\n");
- xf86PrintResList(3,NonSys);
- }
-
-#ifdef DEBUG
- sleep(2);
-#endif
- fixPciResource(i, 0, pvp, range.type);
- }
- xf86FreeResList(own);
- }
- xf86FreeResList(avoid);
- xf86FreeResList(NonSys);
- xf86FreeResList(res_mp);
- xf86FreeResList(res_m_io);
- }
- xf86FreeResList(Sys);
-}
-
-resList
-GetImplicitPciResources(int entityIndex)
-{
- pciVideoPtr pvp;
- int i;
- resList list = NULL;
- int num = 0;
-
- if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return NULL;
-
- for (i = 0; i < 6; i++) {
- if (pvp->ioBase[i]) {
- list = xnfrealloc(list,sizeof(resRange) * (++num));
- PV_I_RANGE(list[num - 1],pvp,i,ResShrIoBlock | ResBios);
- } else if (pvp->memBase[i]) {
- list = xnfrealloc(list,sizeof(resRange) * (++num));
- PV_M_RANGE(list[num - 1],pvp,i,ResShrMemBlock | ResBios);
- }
- }
-#if 0
- if (pvp->biosBase) {
- list = xnfrealloc(list,sizeof(resRange) * (++num));
- PV_B_RANGE(list[num - 1],pvp,ResShrMemBlock | ResBios);
- }
-#endif
- list = xnfrealloc(list,sizeof(resRange) * (++num));
- list[num - 1].type = ResEnd;
-
- return list;
-}
-
-void
-initPciState(void)
-{
- int i = 0;
- int j = 0;
- pciVideoPtr pvp;
- pciAccPtr pcaccp;
-
- if (xf86PciAccInfo != NULL)
- return;
-
- if (xf86PciVideoInfo == NULL)
- return;
-
- while ((pvp = xf86PciVideoInfo[i]) != NULL) {
- i++;
- j++;
- xf86PciAccInfo = xnfrealloc(xf86PciAccInfo,
- sizeof(pciAccPtr) * (j + 1));
- xf86PciAccInfo[j] = NULL;
- pcaccp = xf86PciAccInfo[j - 1] = xnfalloc(sizeof(pciAccRec));
- pcaccp->busnum = pvp->bus;
- pcaccp->devnum = pvp->device;
- pcaccp->funcnum = pvp->func;
- pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func);
- pcaccp->ioAccess.AccessDisable = pciIoAccessDisable;
- pcaccp->ioAccess.AccessEnable = pciIoAccessEnable;
- pcaccp->ioAccess.arg = &pcaccp->arg;
- pcaccp->io_memAccess.AccessDisable = pciIo_MemAccessDisable;
- pcaccp->io_memAccess.AccessEnable = pciIo_MemAccessEnable;
- pcaccp->io_memAccess.arg = &pcaccp->arg;
- pcaccp->memAccess.AccessDisable = pciMemAccessDisable;
- pcaccp->memAccess.AccessEnable = pciMemAccessEnable;
- pcaccp->memAccess.arg = &pcaccp->arg;
- if (PCISHAREDIOCLASSES(pvp->class, pvp->subclass))
- pcaccp->ctrl = TRUE;
- else
- pcaccp->ctrl = FALSE;
- savePciState(pcaccp->arg.tag, &pcaccp->save);
- pcaccp->arg.ctrl = pcaccp->save.command;
- }
-}
-
-/*
- * initPciBusState() - fill out the BusAccRec for a PCI bus.
- * Theory: each bus is associated with one bridge connecting it
- * to its parent bus. The address of a bridge is therefore stored
- * in the BusAccRec of the bus it connects to. Each bus can
- * have several bridges connecting secondary buses to it. Only one
- * of these bridges can be open. Therefore the status of a bridge
- * associated with a bus is stored in the BusAccRec of the parent
- * the bridge connects to. The first member of the structure is
- * a pointer to a function that open access to this bus. This function
- * receives a pointer to the structure itself as argument. This
- * design should be common to BusAccRecs of any type of buses we
- * support. The remeinder of the structure is bus type specific.
- * In this case it contains a pointer to the structure of the
- * parent bus. Thus enabling access to a specific bus is simple:
- * 1. Close any bridge going to secondary buses.
- * 2. Climb down the ladder and enable any bridge on buses
- * on the path from the CPU to this bus.
- */
-
-void
-initPciBusState(void)
-{
- BusAccPtr pbap, pbap_tmp;
- PciBusPtr pbp = xf86PciBus;
- pciBusInfo_t *pBusInfo;
-
- while (pbp) {
- pbap = xnfcalloc(1,sizeof(BusAccRec));
- pbap->busdep.pci.bus = pbp->secondary;
- pbap->busdep.pci.primary_bus = pbp->primary;
- pbap->busdep_type = BUS_PCI;
- pbap->busdep.pci.acc = PCITAG_SPECIAL;
-
- if ((pbp->secondary >= 0) && (pbp->secondary < pciNumBuses) &&
- (pBusInfo = pciBusInfo[pbp->secondary]) &&
- pBusInfo->funcs->pciControlBridge) {
- pbap->type = BUS_PCI;
- pbap->save_f = savePciDrvBusState;
- pbap->restore_f = restorePciDrvBusState;
- pbap->set_f = pciSetBusAccess;
- pbap->enable_f = pciDrvBusAccessEnable;
- pbap->disable_f = pciDrvBusAccessDisable;
- savePciDrvBusState(pbap);
- } else switch (pbp->subclass) {
- case PCI_SUBCLASS_BRIDGE_HOST:
- pbap->type = BUS_PCI;
- pbap->set_f = pciSetBusAccess;
- break;
- case PCI_SUBCLASS_BRIDGE_PCI:
- case PCI_SUBCLASS_BRIDGE_CARDBUS:
- pbap->type = BUS_PCI;
- pbap->save_f = savePciBusState;
- pbap->restore_f = restorePciBusState;
- pbap->set_f = pciSetBusAccess;
- pbap->enable_f = pciBusAccessEnable;
- pbap->disable_f = pciBusAccessDisable;
- pbap->busdep.pci.acc = pciTag(pbp->brbus,pbp->brdev,pbp->brfunc);
- savePciBusState(pbap);
- break;
- case PCI_SUBCLASS_BRIDGE_ISA:
- case PCI_SUBCLASS_BRIDGE_EISA:
- case PCI_SUBCLASS_BRIDGE_MC:
- pbap->type = BUS_ISA;
- pbap->set_f = pciSetBusAccess;
- break;
- }
- pbap->next = xf86BusAccInfo;
- xf86BusAccInfo = pbap;
- pbp = pbp->next;
- }
-
- pbap = xf86BusAccInfo;
-
- while (pbap) {
- pbap->primary = NULL;
- if (pbap->busdep_type == BUS_PCI
- && pbap->busdep.pci.primary_bus > -1) {
- pbap_tmp = xf86BusAccInfo;
- while (pbap_tmp) {
- if (pbap_tmp->busdep_type == BUS_PCI &&
- pbap_tmp->busdep.pci.bus == pbap->busdep.pci.primary_bus) {
- /* Don't create loops */
- if (pbap == pbap_tmp)
- break;
- pbap->primary = pbap_tmp;
- break;
- }
- pbap_tmp = pbap_tmp->next;
- }
- }
- pbap = pbap->next;
- }
-}
-
-void
-PciStateEnter(void)
-{
- pciAccPtr paccp;
- int i = 0;
-
- if (xf86PciAccInfo == NULL)
- return;
-
- while ((paccp = xf86PciAccInfo[i]) != NULL) {
- i++;
- if (!paccp->ctrl)
- continue;
- savePciState(paccp->arg.tag, &paccp->save);
- restorePciState(paccp->arg.tag, &paccp->restore);
- paccp->arg.ctrl = paccp->restore.command;
- }
-}
-
-void
-PciBusStateEnter(void)
-{
- BusAccPtr pbap = xf86BusAccInfo;
-
- while (pbap) {
- if (pbap->save_f)
- pbap->save_f(pbap);
- pbap = pbap->next;
- }
-}
-
-void
-PciStateLeave(void)
-{
- pciAccPtr paccp;
- int i = 0;
-
- if (xf86PciAccInfo == NULL)
- return;
-
- while ((paccp = xf86PciAccInfo[i]) != NULL) {
- i++;
- if (!paccp->ctrl)
- continue;
- savePciState(paccp->arg.tag, &paccp->restore);
- restorePciState(paccp->arg.tag, &paccp->save);
- }
-}
-
-void
-PciBusStateLeave(void)
-{
- BusAccPtr pbap = xf86BusAccInfo;
-
- while (pbap) {
- if (pbap->restore_f)
- pbap->restore_f(pbap);
- pbap = pbap->next;
- }
-}
-
-void
-DisablePciAccess(void)
-{
- int i = 0;
- pciAccPtr paccp;
- if (xf86PciAccInfo == NULL)
- return;
-
- while ((paccp = xf86PciAccInfo[i]) != NULL) {
- i++;
- if (!paccp->ctrl) /* disable devices that are under control initially*/
- continue;
- pciIo_MemAccessDisable(paccp->io_memAccess.arg);
- }
-}
-
-void
-DisablePciBusAccess(void)
-{
- BusAccPtr pbap = xf86BusAccInfo;
-
- while (pbap) {
- if (pbap->disable_f)
- pbap->disable_f(pbap);
- if (pbap->primary)
- pbap->primary->current = NULL;
- pbap = pbap->next;
- }
-}
-
-/*
- * Public functions
- */
-
-Bool
-xf86IsPciDevPresent(int bus, int dev, int func)
-{
- int i = 0;
- pciConfigPtr pcp;
-
- while ((pcp = xf86PciInfo[i]) != NULL) {
- if ((pcp->busnum == bus)
- && (pcp->devnum == dev)
- && (pcp->funcnum == func))
- return TRUE;
- i++;
- }
- return FALSE;
-}
-
-/*
- * If the slot requested is already in use, return -1.
- * Otherwise, claim the slot for the screen requesting it.
- */
-
-int
-xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
- int chipset, GDevPtr dev, Bool active)
-{
- EntityPtr p = NULL;
- pciAccPtr *ppaccp = xf86PciAccInfo;
- BusAccPtr pbap = xf86BusAccInfo;
-
- int num;
-
- if (xf86CheckPciSlot(bus, device, func)) {
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = chipset;
- p->busType = BUS_PCI;
- p->pciBusId.bus = bus;
- p->pciBusId.device = device;
- p->pciBusId.func = func;
- p->active = active;
- p->inUse = FALSE;
- if (dev)
- xf86AddDevToEntity(num, dev);
- /* Here we initialize the access structure */
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- while (ppaccp && *ppaccp) {
- if ((*ppaccp)->busnum == bus
- && (*ppaccp)->devnum == device
- && (*ppaccp)->funcnum == func) {
- p->access->fallback = &(*ppaccp)->io_memAccess;
- p->access->pAccess = &(*ppaccp)->io_memAccess;
- (*ppaccp)->ctrl = TRUE; /* mark control if not already */
- break;
- }
- ppaccp++;
- }
- if (!ppaccp || !*ppaccp) {
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- }
-
- p->busAcc = NULL;
- while (pbap) {
- if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus)
- p->busAcc = pbap;
- pbap = pbap->next;
- }
- fixPciSizeInfo(num);
-
- /* in case bios is enabled disable it */
- disablePciBios(pciTag(bus,device,func));
- pciSlotClaimed = TRUE;
-
- if (active) {
- /* Map in this domain's I/O space */
- p->domainIO = xf86MapDomainIO(-1, VIDMEM_MMIO,
- pciTag(bus, device, func), 0, 1);
- }
-
- return num;
- } else
- return -1;
-}
-
-/*
- * Get xf86PciVideoInfo for a driver.
- */
-pciVideoPtr *
-xf86GetPciVideoInfo(void)
-{
- return xf86PciVideoInfo;
-}
-
-/* --- Used by ATI driver, but also more generally useful */
-
-/*
- * Get the full xf86scanpci data.
- */
-pciConfigPtr *
-xf86GetPciConfigInfo(void)
-{
- return xf86PciInfo;
-}
-
-/*
- * Enable a device and route VGA to it. This is intended for a driver's
- * Probe(), before creating EntityRec's. Only one device can be thus enabled
- * at any one time, and should be disabled when the driver is done with it.
- *
- * The following special calls are also available:
- *
- * pvp == NULL && rt == NONE disable previously enabled device
- * pvp != NULL && rt == NONE ensure device is disabled
- * pvp == NULL && rt != NONE disable >all< subsequent calls to this function
- * (done from xf86PostProbe())
- * The last combination has been removed! To do this cleanly we have
- * to implement stages and need to test at each stage dependent function
- * if it is allowed to execute.
- *
- * The device represented by pvp may not have been previously claimed.
- */
-void
-xf86SetPciVideo(pciVideoPtr pvp, resType rt)
-{
- static BusAccPtr pbap = NULL;
- static xf86AccessPtr pAcc = NULL;
- static Bool DoneProbes = FALSE;
- pciAccPtr pcaccp;
- int i;
-
- if (DoneProbes)
- return;
-
- /* Disable previous access */
- if (pAcc) {
- if (pAcc->AccessDisable)
- (*pAcc->AccessDisable)(pAcc->arg);
- pAcc = NULL;
- }
- if (pbap) {
- while (pbap->primary) {
- if (pbap->disable_f)
- (*pbap->disable_f)(pbap);
- pbap->primary->current = NULL;
- pbap = pbap->primary;
- }
- pbap = NULL;
- }
-
- /* Check for xf86PostProbe's magic combo */
- if (!pvp) {
- if (rt != NONE)
- DoneProbes = TRUE;
- return;
- }
-
- /* Validate device */
- if (!xf86PciVideoInfo || !xf86PciAccInfo || !xf86BusAccInfo)
- return;
-
- for (i = 0; pvp != xf86PciVideoInfo[i]; i++)
- if (!xf86PciVideoInfo[i])
- return;
-
- /* Ignore request for claimed adapters */
- if (!xf86CheckPciSlot(pvp->bus, pvp->device, pvp->func))
- return;
-
- /* Find pciAccRec structure */
- for (i = 0; ; i++) {
- if (!(pcaccp = xf86PciAccInfo[i]))
- return;
- if ((pvp->bus == pcaccp->busnum) &&
- (pvp->device == pcaccp->devnum) &&
- (pvp->func == pcaccp->funcnum))
- break;
- }
-
- if (rt == NONE) {
- /* This is a call to ensure the adapter is disabled */
- if (pcaccp->io_memAccess.AccessDisable)
- (*pcaccp->io_memAccess.AccessDisable)(pcaccp->io_memAccess.arg);
- return;
- }
-
- /* Find BusAccRec structure */
- for (pbap = xf86BusAccInfo; ; pbap = pbap->next) {
- if (!pbap)
- return;
- if (pvp->bus == pbap->busdep.pci.bus)
- break;
- }
-
- /* Route VGA */
- if (pbap->set_f)
- (*pbap->set_f)(pbap);
-
- /* Enable device */
- switch (rt) {
- case IO:
- pAcc = &pcaccp->ioAccess;
- break;
- case MEM_IO:
- pAcc = &pcaccp->io_memAccess;
- break;
- case MEM:
- pAcc = &pcaccp->memAccess;
- break;
- default: /* no compiler noise */
- break;
- }
-
- if (pAcc && pAcc->AccessEnable)
- (*pAcc->AccessEnable)(pAcc->arg);
-}
-
-/*
- * Parse a BUS ID string, and return the PCI bus parameters if it was
- * in the correct format for a PCI bus id.
- */
-
-Bool
-xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
-{
- /*
- * The format is assumed to be "bus[@domain]:device[:func]", where domain,
- * bus, device and func are decimal integers. domain and func may be
- * omitted and assumed to be zero, although doing this isn't encouraged.
- */
-
- char *p, *s, *d;
- const char *id;
- int i;
-
- if (StringToBusType(busID, &id) != BUS_PCI)
- return FALSE;
-
- s = xstrdup(id);
- p = strtok(s, ":");
- if (p == NULL || *p == 0) {
- xfree(s);
- return FALSE;
- }
- d = strpbrk(p, "@");
- if (d != NULL) {
- *(d++) = 0;
- for (i = 0; d[i] != 0; i++) {
- if (!isdigit(d[i])) {
- xfree(s);
- return FALSE;
- }
- }
- }
- for (i = 0; p[i] != 0; i++) {
- if (!isdigit(p[i])) {
- xfree(s);
- return FALSE;
- }
- }
- *bus = atoi(p);
- if (d != NULL && *d != 0)
- *bus += atoi(d) << 8;
- p = strtok(NULL, ":");
- if (p == NULL || *p == 0) {
- xfree(s);
- return FALSE;
- }
- for (i = 0; p[i] != 0; i++) {
- if (!isdigit(p[i])) {
- xfree(s);
- return FALSE;
- }
- }
- *device = atoi(p);
- *func = 0;
- p = strtok(NULL, ":");
- if (p == NULL || *p == 0) {
- xfree(s);
- return TRUE;
- }
- for (i = 0; p[i] != 0; i++) {
- if (!isdigit(p[i])) {
- xfree(s);
- return FALSE;
- }
- }
- *func = atoi(p);
- xfree(s);
- return TRUE;
-}
-
-/*
- * Compare a BUS ID string with a PCI bus id. Return TRUE if they match.
- */
-
-Bool
-xf86ComparePciBusString(const char *busID, int bus, int device, int func)
-{
- int ibus, idevice, ifunc;
-
- if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) {
- return bus == ibus && device == idevice && func == ifunc;
- } else {
- return FALSE;
- }
-}
-
-/*
- * xf86IsPrimaryPci() -- return TRUE if primary device
- * is PCI and bus, dev and func numbers match.
- */
-
-Bool
-xf86IsPrimaryPci(pciVideoPtr pPci)
-{
- if (primaryBus.type != BUS_PCI) return FALSE;
- return (pPci->bus == primaryBus.id.pci.bus &&
- pPci->device == primaryBus.id.pci.device &&
- pPci->func == primaryBus.id.pci.func);
-}
-
-/*
- * xf86CheckPciGAType() -- return type of PCI graphics adapter.
- */
-int
-xf86CheckPciGAType(pciVideoPtr pPci)
-{
- int i = 0;
- pciConfigPtr pcp;
-
- while ((pcp = xf86PciInfo[i]) != NULL) {
- if (pPci->bus == pcp->busnum && pPci->device == pcp->devnum
- && pPci->func == pcp->funcnum) {
- if (pcp->pci_base_class == PCI_CLASS_PREHISTORIC &&
- pcp->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
- return PCI_CHIP_VGA ;
- if (pcp->pci_base_class == PCI_CLASS_DISPLAY &&
- pcp->pci_sub_class == PCI_SUBCLASS_DISPLAY_VGA) {
- if (pcp->pci_prog_if == 0)
- return PCI_CHIP_VGA ;
- if (pcp->pci_prog_if == 1)
- return PCI_CHIP_8514;
- }
- return -1;
- }
- i++;
- }
- return -1;
-}
-
-/*
- * xf86GetPciInfoForEntity() -- Get the pciVideoRec of entity.
- */
-pciVideoPtr
-xf86GetPciInfoForEntity(int entityIndex)
-{
- pciVideoPtr *ppPci;
- EntityPtr p = xf86Entities[entityIndex];
-
- if (entityIndex >= xf86NumEntities
- || p->busType != BUS_PCI) return NULL;
-
- for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
- if (p->pciBusId.bus == (*ppPci)->bus &&
- p->pciBusId.device == (*ppPci)->device &&
- p->pciBusId.func == (*ppPci)->func)
- return (*ppPci);
- }
- return NULL;
-}
-
-int
-xf86GetPciEntity(int bus, int dev, int func)
-{
- int i;
-
- for (i = 0; i < xf86NumEntities; i++) {
- EntityPtr p = xf86Entities[i];
- if (p->busType != BUS_PCI) continue;
-
- if (p->pciBusId.bus == bus &&
- p->pciBusId.device == dev &&
- p->pciBusId.func == func)
- return i;
- }
- return -1;
-}
-
-/*
- * xf86CheckPciMemBase() checks that the memory base value matches one of the
- * PCI base address register values for the given PCI device.
- */
-Bool
-xf86CheckPciMemBase(pciVideoPtr pPci, memType base)
-{
- int i;
-
- for (i = 0; i < 6; i++)
- if (base == pPci->memBase[i])
- return TRUE;
- return FALSE;
-}
-
-/*
- * Check if the slot requested is free. If it is already in use, return FALSE.
- */
-
-Bool
-xf86CheckPciSlot(int bus, int device, int func)
-{
- int i;
- EntityPtr p;
-
- for (i = 0; i < xf86NumEntities; i++) {
- p = xf86Entities[i];
- /* Check if this PCI slot is taken */
- if (p->busType == BUS_PCI && p->pciBusId.bus == bus &&
- p->pciBusId.device == device && p->pciBusId.func == func)
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * This used to load the scanpci module. The pcidata module is now used
- * (which the server always loads early). The main difference between the
- * two modules is size, and the scanpci module should only ever be loaded
- * when the X server is run with the -scanpci flag.
- *
- * To make sure that the required information is present in the pcidata
- * module, add a PCI_VENDOR_* macro for the relevant vendor to xf86PciInfo.h,
- * and add the class override data to ../etc/extrapci.ids.
- */
-
-static void
-getPciClassFlags(pciConfigPtr *pcrpp)
-{
- pciConfigPtr pcrp;
- int i = 0;
-
- if (!pcrpp)
- return;
- while ((pcrp = pcrpp[i])) {
- if (!(pcrp->listed_class =
- xf86FindPciClassBySubsys(pcrp->pci_subsys_vendor,
- pcrp->pci_subsys_card))) {
- pcrp->listed_class =
- xf86FindPciClassByDevice(pcrp->pci_vendor, pcrp->pci_device);
- }
- i++;
- }
-}
-
-/*
- * xf86FindPciVendorDevice() xf86FindPciClass(): These functions
- * are meant to be used by the pci bios emulation. Some bioses
- * need to see if there are _other_ chips of the same type around
- * so by setting pvp_exclude one pci device can be explicitely
- * _excluded if required.
- */
-pciVideoPtr
-xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
- char n, pciVideoPtr pvp_exclude)
-{
- pciVideoPtr pvp, *ppvp;
- n++;
-
- for (ppvp = xf86PciVideoInfo, pvp =*ppvp; pvp ; pvp = *(++ppvp)) {
- if (pvp == pvp_exclude) continue;
- if ((pvp->vendor == vendorID) && (pvp->chipType == deviceID)) {
- if (!(--n)) break;
- }
- }
- return pvp;
-}
-
-pciVideoPtr
-xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
- char n, pciVideoPtr pvp_exclude)
-{
- pciVideoPtr pvp, *ppvp;
- n++;
-
- for (ppvp = xf86PciVideoInfo, pvp =*ppvp; pvp ; pvp = *(++ppvp)) {
- if (pvp == pvp_exclude) continue;
- if ((pvp->interface == intf) && (pvp->subclass == subClass)
- && (pvp->class == class)) {
- if (!(--n)) break;
- }
- }
- return pvp;
-}
-
-/*
- * This attempts to detect a multi-device card and sets up a list
- * of pci tags of the devices of this card. On some of these
- * cards the BIOS is not visible from all chipsets. We therefore
- * need to use the BIOS from a chipset where it is visible.
- * We do the following heuristics:
- * If we detect only identical pci devices on a bus we assume it's
- * a multi-device card. This assumption isn't true always, however.
- * One might just use identical cards on a bus. We therefore don't
- * detect this situation when we set up the PCI video info. Instead
- * we wait until an attempt to read the BIOS fails.
- */
-int
-pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag)
-{
- pciConfigPtr *ppcrp = xf86PciInfo;
- pciConfigPtr pcrp = NULL;
- int i,j;
- Bool multicard = FALSE;
- Bool multifunc = FALSE;
- char str[256];
- char *str1;
-
- str1 = str;
- if (!pTag)
- return 0;
-
- *pTag = NULL;
-
- for (i=0; i < 8; i++) {
- j = 0;
-
- while (ppcrp[j]) {
- if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i) {
- pcrp = ppcrp[j];
- break;
- }
- j++;
- }
-
- if (!pcrp) return 0;
-
- /*
- * we check all functions here: since multifunc devices need
- * to implement func 0 we catch all devices on the bus when
- * i = 0
- */
- if (pcrp->pci_header_type &0x80)
- multifunc = TRUE;
-
- j = 0;
-
- while (ppcrp[j]) {
- if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i
- && ppcrp[j]->devnum != pcrp->devnum) {
- /* don't test subsys ID here. It might be set by POST
- - however some cards might not have been POSTed */
- if (ppcrp[j]->pci_device_vendor != pcrp->pci_device_vendor
- || ppcrp[j]->pci_header_type != pcrp->pci_header_type )
- return 0;
- else
- multicard = TRUE;
- }
- j++;
- }
- if (!multifunc)
- break;
- }
-
- if (!multicard)
- return 0;
-
- j = 0;
- i = 0;
- while (ppcrp[i]) {
- if (ppcrp[i]->busnum == bus && ppcrp[i]->funcnum == func) {
- str1 += sprintf(str1,"[%x:%x:%x]",ppcrp[i]->busnum,
- ppcrp[i]->devnum,ppcrp[i]->funcnum);
- *pTag = xnfrealloc(*pTag,sizeof(PCITAG) * (j + 1));
- (*pTag)[j++] = pciTag(ppcrp[i]->busnum,
- ppcrp[i]->devnum,ppcrp[i]->funcnum);
- }
- i++;
- }
- xf86MsgVerb(X_INFO,3,"Multi Device Card detected: %s\n",str);
- return j;
-}
-
-static void
-pciTagConvertRange2Host(PCITAG tag, resRange *pRange)
-{
- if (!(pRange->type & ResBus))
- return;
-
- switch(pRange->type & ResPhysMask) {
- case ResMem:
- switch(pRange->type & ResExtMask) {
- case ResBlock:
- pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rBegin);
- pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rEnd);
- break;
- case ResSparse:
- pRange->rBase = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_BASE,
- pRange->rBegin);
- pRange->rMask = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_MASK,
- pRange->rEnd);
- break;
- }
- break;
- case ResIo:
- switch(pRange->type & ResExtMask) {
- case ResBlock:
- pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rBegin);
- pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rEnd);
- break;
- case ResSparse:
- pRange->rBase = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_BASE
- , pRange->rBegin);
- pRange->rMask = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_MASK
- , pRange->rEnd);
- break;
- }
- break;
- }
-
- /* Set domain number */
- pRange->type &= ~(ResDomain | ResBus);
- pRange->type |= xf86GetPciDomain(tag) << 24;
-}
-
-static void
-pciConvertListToHost(int bus, int dev, int func, resPtr list)
-{
- PCITAG tag = pciTag(bus,dev,func);
- while (list) {
- pciTagConvertRange2Host(tag, &list->val);
- list = list->next;
- }
-}
-
-static void
-updateAccessInfoStatusControlInfo(PCITAG tag, CARD32 ctrl)
-{
- int i;
-
- if (!xf86PciAccInfo)
- return;
-
- for (i = 0; xf86PciAccInfo[i] != NULL; i++) {
- if (xf86PciAccInfo[i]->arg.tag == tag)
- xf86PciAccInfo[i]->arg.ctrl = ctrl;
- }
-}
-
-void
-pciConvertRange2Host(int entityIndex, resRange *pRange)
-{
- PCITAG tag;
- pciVideoPtr pvp;
-
- pvp = xf86GetPciInfoForEntity(entityIndex);
- if (!pvp) return;
- tag = TAG(pvp);
- pciTagConvertRange2Host(tag, pRange);
-}
-
-
-#ifdef INCLUDE_DEPRECATED
-void
-xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable)
-{
- CARD32 temp;
- PCITAG tag;
-
- if (!pPci) return;
-
- tag = pciTag(pPci->bus, pPci->device, pPci->func);
- temp = pciReadLong(tag, PCI_CMD_STAT_REG);
- if (enable) {
- updateAccessInfoStatusControlInfo(tag, temp | PCI_CMD_MASTER_ENABLE);
- pciWriteLong(tag, PCI_CMD_STAT_REG, temp | PCI_CMD_MASTER_ENABLE);
- } else {
- updateAccessInfoStatusControlInfo(tag, temp & ~PCI_CMD_MASTER_ENABLE);
- pciWriteLong(tag, PCI_CMD_STAT_REG, temp & ~PCI_CMD_MASTER_ENABLE);
- }
-}
-#endif /* INCLUDE_DEPRECATED */
diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h
deleted file mode 100644
index fbb733ae7..000000000
--- a/hw/xfree86/common/xf86pciBus.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.10 2003/08/24 17:36:56 dawes Exp $ */
-
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86_PCI_BUS_H
-#define _XF86_PCI_BUS_H
-
-#define PCITAG_SPECIAL pciTag(0xFF,0xFF,0xFF)
-
-typedef struct {
- CARD32 command;
- CARD32 base[6];
- CARD32 biosBase;
-} pciSave, *pciSavePtr;
-
-typedef struct {
- PCITAG tag;
- CARD32 ctrl;
-} pciArg;
-
-typedef struct {
- int busnum;
- int devnum;
- int funcnum;
- pciArg arg;
- xf86AccessRec ioAccess;
- xf86AccessRec io_memAccess;
- xf86AccessRec memAccess;
- pciSave save;
- pciSave restore;
- Bool ctrl;
-} pciAccRec, *pciAccPtr;
-
-typedef union {
- CARD16 control;
-} pciBridgesSave, *pciBridgesSavePtr;
-
-typedef struct pciBusRec {
- int brbus, brdev, brfunc; /* ID of the bridge to this bus */
- int primary, secondary, subordinate;
- int subclass; /* bridge type */
- int interface;
- resPtr preferred_io; /* I/O range */
- resPtr preferred_mem; /* non-prefetchable memory range */
- resPtr preferred_pmem; /* prefetchable memory range */
- resPtr io; /* for subtractive PCI-PCI bridges */
- resPtr mem;
- resPtr pmem;
- int brcontrol; /* bridge_control byte */
- struct pciBusRec *next;
-} PciBusRec, *PciBusPtr;
-
-void xf86PciProbe(void);
-void ValidatePci(void);
-resList GetImplicitPciResources(int entityIndex);
-void initPciState(void);
-void initPciBusState(void);
-void DisablePciAccess(void);
-void DisablePciBusAccess(void);
-void PciStateEnter(void);
-void PciBusStateEnter(void);
-void PciStateLeave(void);
-void PciBusStateLeave(void);
-resPtr ResourceBrokerInitPci(resPtr *osRes);
-void pciConvertRange2Host(int entityIndex, resRange *pRange);
-void isaConvertRange2Host(resRange *pRange);
-
-extern pciAccPtr * xf86PciAccInfo;
-
-#endif /* _XF86_PCI_BUS_H */
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
deleted file mode 100644
index 87042cb14..000000000
--- a/hw/xfree86/common/xf86sbusBus.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/*
- * SBUS bus-specific code.
- *
- * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.7 2001/10/28 03:33:19 tsi Exp $ */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <unistd.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Resources.h"
-#include "xf86cmap.h"
-
-#include "xf86Bus.h"
-
-#include "xf86sbusBus.h"
-#include "xf86Sbus.h"
-
-Bool sbusSlotClaimed = FALSE;
-
-static int xf86nSbusInfo;
-
-static void
-CheckSbusDevice(const char *device, int fbNum)
-{
- int fd, i;
- struct fbgattr fbattr;
- sbusDevicePtr psdp;
-
- fd = open(device, O_RDONLY, 0);
- if (fd < 0)
- return;
- memset(&fbattr, 0, sizeof(fbattr));
- if (ioctl(fd, FBIOGATTR, &fbattr) < 0) {
- if (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0) {
- close(fd);
- return;
- }
- }
- close(fd);
- for (i = 0; sbusDeviceTable[i].devId; i++)
- if (sbusDeviceTable[i].fbType == fbattr.fbtype.fb_type)
- break;
- if (! sbusDeviceTable[i].devId)
- return;
- xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (++xf86nSbusInfo + 1));
- xf86SbusInfo[xf86nSbusInfo] = NULL;
- xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(sizeof (sbusDevice), 1);
- psdp->devId = sbusDeviceTable[i].devId;
- psdp->fbNum = fbNum;
- psdp->device = xnfstrdup(device);
- psdp->width = fbattr.fbtype.fb_width;
- psdp->height = fbattr.fbtype.fb_height;
- psdp->fd = -1;
-}
-
-void
-xf86SbusProbe(void)
-{
- int i, useProm = 0;
- char fbDevName[32];
- sbusDevicePtr psdp, *psdpp;
-
- xf86SbusInfo = xalloc(sizeof(psdp));
- *xf86SbusInfo = NULL;
- for (i = 0; i < 32; i++) {
- sprintf(fbDevName, "/dev/fb%d", i);
- CheckSbusDevice(fbDevName, i);
- }
- if (sparcPromInit() >= 0) {
- useProm = 1;
- sparcPromAssignNodes();
- }
- for (psdpp = xf86SbusInfo; (psdp = *psdpp); psdpp++) {
- for (i = 0; sbusDeviceTable[i].devId; i++)
- if (sbusDeviceTable[i].devId == psdp->devId)
- psdp->descr = sbusDeviceTable[i].descr;
- /*
- * If we can use PROM information and found the PROM node for this
- * device, we can tell more about the card.
- */
- if (useProm && psdp->node.node) {
- char *prop, *promPath;
- int len, chiprev, vmsize;
-
- switch (psdp->devId) {
- case SBUS_DEVICE_MGX:
- prop = sparcPromGetProperty(&psdp->node, "fb_size", &len);
- if (prop && len == 4 && *(int *)prop == 0x400000)
- psdp->descr = "Quantum 3D MGXplus with 4M VRAM";
- break;
- case SBUS_DEVICE_CG6:
- chiprev = 0;
- vmsize = 0;
- prop = sparcPromGetProperty(&psdp->node, "chiprev", &len);
- if (prop && len == 4)
- chiprev = *(int *)prop;
- prop = sparcPromGetProperty(&psdp->node, "vmsize", &len);
- if (prop && len == 4)
- vmsize = *(int *)prop;
- switch (chiprev) {
- case 1:
- case 2:
- case 3:
- case 4:
- psdp->descr = "Sun Double width GX"; break;
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- psdp->descr = "Sun Single width GX"; break;
- case 11:
- switch (vmsize) {
- case 2:
- psdp->descr = "Sun Turbo GX with 1M VSIMM"; break;
- case 4:
- psdp->descr = "Sun Turbo GX Plus"; break;
- default:
- psdp->descr = "Sun Turbo GX"; break;
- }
- }
- break;
- case SBUS_DEVICE_CG14:
- prop = sparcPromGetProperty(&psdp->node, "reg", &len);
- vmsize = 0;
- if (prop && !(len % 12) && len > 0)
- vmsize = *(int *)(prop + len - 4);
- switch (vmsize) {
- case 0x400000:
- psdp->descr = "Sun SX with 4M VSIMM"; break;
- case 0x800000:
- psdp->descr = "Sun SX with 8M VSIMM"; break;
- }
- break;
- case SBUS_DEVICE_LEO:
- prop = sparcPromGetProperty(&psdp->node, "model", &len);
- if (prop && len > 0 && !strstr(prop, "501-2503"))
- psdp->descr = "Sun Turbo ZX";
- break;
- case SBUS_DEVICE_TCX:
- if (sparcPromGetBool(&psdp->node, "tcx-8-bit"))
- psdp->descr = "Sun TCX (8bit)";
- else
- psdp->descr = "Sun TCX (S24)";
- break;
- case SBUS_DEVICE_FFB:
- prop = sparcPromGetProperty(&psdp->node, "name", &len);
- chiprev = 0;
- prop = sparcPromGetProperty(&psdp->node, "board_type", &len);
- if (prop && len == 4)
- chiprev = *(int *)prop;
- if (strstr (prop, "afb")) {
- if (chiprev == 3)
- psdp->descr = "Sun|Elite3D-M6 Horizontal";
- } else {
- switch (chiprev) {
- case 0x08:
- psdp->descr = "Sun FFB 67MHz Creator"; break;
- case 0x0b:
- psdp->descr = "Sun FFB 67MHz Creator 3D"; break;
- case 0x1b:
- psdp->descr = "Sun FFB 75MHz Creator 3D"; break;
- case 0x20:
- case 0x28:
- psdp->descr = "Sun FFB2 Vertical Creator"; break;
- case 0x23:
- case 0x2b:
- psdp->descr = "Sun FFB2 Vertical Creator 3D"; break;
- case 0x30:
- psdp->descr = "Sun FFB2+ Vertical Creator"; break;
- case 0x33:
- psdp->descr = "Sun FFB2+ Vertical Creator 3D"; break;
- case 0x40:
- case 0x48:
- psdp->descr = "Sun FFB2 Horizontal Creator"; break;
- case 0x43:
- case 0x4b:
- psdp->descr = "Sun FFB2 Horizontal Creator 3D"; break;
- }
- }
- break;
- }
-
- xf86Msg(X_PROBED, "SBUS:(0x%08x) %s", psdp->node.node, psdp->descr);
- promPath = sparcPromNode2Pathname (&psdp->node);
- if (promPath) {
- xf86ErrorF(" at %s", promPath);
- xfree(promPath);
- }
- } else
- xf86Msg(X_PROBED, "SBUS: %s", psdp->descr);
- xf86ErrorF("\n");
- }
- if (useProm)
- sparcPromClose();
-}
-
-/*
- * Parse a BUS ID string, and return the SBUS bus parameters if it was
- * in the correct format for a SBUS bus id.
- */
-
-Bool
-xf86ParseSbusBusString(const char *busID, int *fbNum)
-{
- /*
- * The format is assumed to be one of:
- * "fbN", e.g. "fb1", which means the device corresponding to /dev/fbN
- * "nameN", e.g. "cgsix0", which means Nth instance of card NAME
- * "/prompath", e.g. "/sbus@0,10001000/cgsix@3,0" which is PROM pathname
- * to the device.
- */
-
- const char *id;
- int i, len;
-
- if (StringToBusType(busID, &id) != BUS_SBUS)
- return FALSE;
-
- if (*id != '/') {
- if (!strncmp (id, "fb", 2)) {
- if (!isdigit(id[2]))
- return FALSE;
- *fbNum = atoi(id + 2);
- return TRUE;
- } else {
- sbusDevicePtr *psdpp;
- int devId;
-
- for (i = 0, len = 0; sbusDeviceTable[i].devId; i++) {
- len = strlen(sbusDeviceTable[i].promName);
- if (!strncmp (sbusDeviceTable[i].promName, id, len)
- && isdigit(id[len]))
- break;
- }
- devId = sbusDeviceTable[i].devId;
- if (!devId) return FALSE;
- i = atoi(id + len);
- for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) {
- if ((*psdpp)->devId != devId)
- continue;
- if (!i) {
- *fbNum = (*psdpp)->fbNum;
- return TRUE;
- }
- i--;
- }
- }
- return FALSE;
- }
-
- if (sparcPromInit() >= 0) {
- i = sparcPromPathname2Node(id);
- sparcPromClose();
- if (i) {
- sbusDevicePtr *psdpp;
- for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) {
- if ((*psdpp)->node.node == i) {
- *fbNum = (*psdpp)->fbNum;
- return TRUE;
- }
- }
- }
- }
- return FALSE;
-}
-
-/*
- * Compare a BUS ID string with a SBUS bus id. Return TRUE if they match.
- */
-
-Bool
-xf86CompareSbusBusString(const char *busID, int fbNum)
-{
- int iFbNum;
-
- if (xf86ParseSbusBusString(busID, &iFbNum)) {
- return fbNum == iFbNum;
- } else {
- return FALSE;
- }
-}
-
-/*
- * Check if the slot requested is free. If it is already in use, return FALSE.
- */
-
-Bool
-xf86CheckSbusSlot(int fbNum)
-{
- int i;
- EntityPtr p;
-
- for (i = 0; i < xf86NumEntities; i++) {
- p = xf86Entities[i];
- /* Check if this SBUS slot is taken */
- if (p->busType == BUS_SBUS && p->sbusBusId.fbNum == fbNum)
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- * If the slot requested is already in use, return -1.
- * Otherwise, claim the slot for the screen requesting it.
- */
-
-int
-xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp,
- GDevPtr dev, Bool active)
-{
- EntityPtr p = NULL;
-
- int num;
-
- if (xf86CheckSbusSlot(psdp->fbNum)) {
- num = xf86AllocateEntity();
- p = xf86Entities[num];
- p->driver = drvp;
- p->chipset = -1;
- p->busType = BUS_SBUS;
- xf86AddDevToEntity(num, dev);
- p->sbusBusId.fbNum = psdp->fbNum;
- p->active = active;
- p->inUse = FALSE;
- /* Here we initialize the access structure */
- p->access = xnfcalloc(1,sizeof(EntityAccessRec));
- p->access->fallback = &AccessNULL;
- p->access->pAccess = &AccessNULL;
- sbusSlotClaimed = TRUE;
- return num;
- } else
- return -1;
-}
-
-int
-xf86MatchSbusInstances(const char *driverName, int sbusDevId,
- GDevPtr *devList, int numDevs, DriverPtr drvp,
- int **foundEntities)
-{
- int i,j;
- sbusDevicePtr psdp, *psdpp;
- int numClaimedInstances = 0;
- int allocatedInstances = 0;
- int numFound = 0;
- GDevPtr devBus = NULL;
- GDevPtr dev = NULL;
- int *retEntities = NULL;
- int useProm = 0;
-
- struct Inst {
- sbusDevicePtr sbus;
- GDevPtr dev;
- Bool claimed; /* BusID matches with a device section */
- } *instances = NULL;
-
- *foundEntities = NULL;
- for (psdpp = xf86SbusInfo, psdp = *psdpp; psdp; psdp = *++psdpp) {
- if (psdp->devId != sbusDevId)
- continue;
- if (psdp->fd == -2)
- continue;
- ++allocatedInstances;
- instances = xnfrealloc(instances,
- allocatedInstances * sizeof(struct Inst));
- instances[allocatedInstances - 1].sbus = psdp;
- instances[allocatedInstances - 1].dev = NULL;
- instances[allocatedInstances - 1].claimed = FALSE;
- numFound++;
- }
-
- /*
- * This may be debatable, but if no SBUS devices with a matching vendor
- * type is found, return zero now. It is probably not desirable to
- * allow the config file to override this.
- */
- if (allocatedInstances <= 0) {
- xfree(instances);
- return 0;
- }
-
- if (xf86DoProbe) {
- xfree(instances);
- return numFound;
- }
-
- if (sparcPromInit() >= 0)
- useProm = 1;
-
- if (xf86DoConfigure && xf86DoConfigurePass1) {
- GDevPtr pGDev;
- int actualcards = 0;
- for (i = 0; i < allocatedInstances; i++) {
- actualcards++;
- pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_SBUS,
- instances[i].sbus, -1);
- if (pGDev) {
- /*
- * XF86Match???Instances() treat chipID and chipRev as
- * overrides, so clobber them here.
- */
- pGDev->chipID = pGDev->chipRev = -1;
- }
- }
- xfree(instances);
- if (useProm)
- sparcPromClose();
- return actualcards;
- }
-
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
-#endif
-
- for (i = 0; i < allocatedInstances; i++) {
- char *promPath = NULL;
-
- psdp = instances[i].sbus;
- devBus = NULL;
- dev = NULL;
- if (useProm && psdp->node.node)
- promPath = sparcPromNode2Pathname(&psdp->node);
-
- for (j = 0; j < numDevs; j++) {
- if (devList[j]->busID && *devList[j]->busID) {
- if (xf86CompareSbusBusString(devList[j]->busID, psdp->fbNum)) {
- if (devBus)
- xf86MsgVerb(X_WARNING,0,
- "%s: More than one matching Device section for "
- "instance (BusID: %s) found: %s\n",
- driverName,devList[j]->identifier,
- devList[j]->busID);
- else
- devBus = devList[j];
- }
- } else {
- if (!dev && !devBus) {
- if (promPath)
- xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:%s\n",
- promPath);
- else
- xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:fb%d\n",
- psdp->fbNum);
- dev = devList[j];
- } else
- xf86MsgVerb(X_WARNING, 0,
- "%s: More than one matching Device section "
- "found: %s\n", driverName, devList[j]->identifier);
- }
- }
- if (devBus) dev = devBus; /* busID preferred */
- if (!dev && psdp->fd != -2) {
- if (promPath) {
- xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
- "for instance (BusID SBUS:%s) found\n",
- driverName, promPath);
- } else
- xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
- "for instance (BusID SBUS:fb%d) found\n",
- driverName, psdp->fbNum);
- } else if (dev) {
- numClaimedInstances++;
- instances[i].claimed = TRUE;
- instances[i].dev = dev;
- }
- if (promPath)
- xfree(promPath);
- }
-
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
-#endif
-
- /*
- * Of the claimed instances, check that another driver hasn't already
- * claimed its slot.
- */
- numFound = 0;
- for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
- if (!instances[i].claimed)
- continue;
- psdp = instances[i].sbus;
- if (!xf86CheckSbusSlot(psdp->fbNum))
- continue;
-
-#ifdef DEBUG
- ErrorF("%s: card at fb%d %08x is claimed by a Device section\n",
- driverName, psdp->fbNum, psdp->node.node);
-#endif
-
- /* Allocate an entry in the lists to be returned */
- numFound++;
- retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
- retEntities[numFound - 1]
- = xf86ClaimSbusSlot(psdp, drvp, instances[i].dev,instances[i].dev->active ?
- TRUE : FALSE);
- }
- xfree(instances);
- if (numFound > 0) {
- *foundEntities = retEntities;
- }
-
- if (useProm)
- sparcPromClose();
-
- return numFound;
-}
-
-/*
- * xf86GetSbusInfoForEntity() -- Get the sbusDevicePtr of entity.
- */
-sbusDevicePtr
-xf86GetSbusInfoForEntity(int entityIndex)
-{
- sbusDevicePtr *psdpp;
- EntityPtr p = xf86Entities[entityIndex];
-
- if (entityIndex >= xf86NumEntities
- || p->busType != BUS_SBUS) return NULL;
-
- for (psdpp = xf86SbusInfo; *psdpp != NULL; psdpp++) {
- if (p->sbusBusId.fbNum == (*psdpp)->fbNum)
- return (*psdpp);
- }
- return NULL;
-}
-
-int
-xf86GetEntityForSbusInfo(sbusDevicePtr psdp)
-{
- int i;
-
- for (i = 0; i < xf86NumEntities; i++) {
- EntityPtr p = xf86Entities[i];
- if (p->busType != BUS_SBUS) continue;
-
- if (p->sbusBusId.fbNum == psdp->fbNum)
- return i;
- }
- return -1;
-}
-
-void
-xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp)
-{
- DisplayModePtr mode;
-
- mode = xnfcalloc(sizeof(DisplayModeRec), 1);
- mode->name = "current";
- mode->next = mode;
- mode->prev = mode;
- mode->type = M_T_BUILTIN;
- mode->Clock = 100000000;
- mode->HDisplay = psdp->width;
- mode->HSyncStart = psdp->width;
- mode->HSyncEnd = psdp->width;
- mode->HTotal = psdp->width;
- mode->VDisplay = psdp->height;
- mode->VSyncStart = psdp->height;
- mode->VSyncEnd = psdp->height;
- mode->VTotal = psdp->height;
- mode->SynthClock = mode->Clock;
- mode->CrtcHDisplay = mode->HDisplay;
- mode->CrtcHSyncStart = mode->HSyncStart;
- mode->CrtcHSyncEnd = mode->HSyncEnd;
- mode->CrtcHTotal = mode->HTotal;
- mode->CrtcVDisplay = mode->VDisplay;
- mode->CrtcVSyncStart = mode->VSyncStart;
- mode->CrtcVSyncEnd = mode->VSyncEnd;
- mode->CrtcVTotal = mode->VTotal;
- mode->CrtcHAdjusted = FALSE;
- mode->CrtcVAdjusted = FALSE;
- pScrn->modes = mode;
- pScrn->virtualX = psdp->width;
- pScrn->virtualY = psdp->height;
-}
-
-static int sbusPaletteIndex = -1;
-static unsigned long sbusPaletteGeneration = 0;
-typedef struct _sbusCmap {
- sbusDevicePtr psdp;
- CloseScreenProcPtr CloseScreen;
- Bool origCmapValid;
- unsigned char origRed[16];
- unsigned char origGreen[16];
- unsigned char origBlue[16];
-} sbusCmapRec, *sbusCmapPtr;
-
-#define SBUSCMAPPTR(pScreen) ((sbusCmapPtr)((pScreen)->devPrivates[sbusPaletteIndex].ptr))
-
-static void
-xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual)
-{
- int i, index;
- sbusCmapPtr cmap;
- struct fbcmap fbcmap;
- unsigned char *data = ALLOCATE_LOCAL(numColors*3);
-
- cmap = SBUSCMAPPTR(pScrn->pScreen);
- if (!cmap) return;
- fbcmap.count = 0;
- fbcmap.index = indices[0];
- fbcmap.red = data;
- fbcmap.green = data + numColors;
- fbcmap.blue = fbcmap.green + numColors;
- for (i = 0; i < numColors; i++) {
- index = indices[i];
- if (fbcmap.count && index != fbcmap.index + fbcmap.count) {
- ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
- fbcmap.count = 0;
- fbcmap.index = index;
- }
- fbcmap.red[fbcmap.count] = colors[index].red;
- fbcmap.green[fbcmap.count] = colors[index].green;
- fbcmap.blue[fbcmap.count++] = colors[index].blue;
- }
- ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
- DEALLOCATE_LOCAL(data);
-}
-
-static Bool
-xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
-{
- sbusCmapPtr cmap;
- struct fbcmap fbcmap;
-
- cmap = SBUSCMAPPTR(pScreen);
- if (cmap->origCmapValid) {
- fbcmap.index = 0;
- fbcmap.count = 16;
- fbcmap.red = cmap->origRed;
- fbcmap.green = cmap->origGreen;
- fbcmap.blue = cmap->origBlue;
- ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
- }
- pScreen->CloseScreen = cmap->CloseScreen;
- xfree (cmap);
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-Bool
-xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
-{
- sbusCmapPtr cmap;
- struct fbcmap fbcmap;
- unsigned char data[2];
-
- if(sbusPaletteGeneration != serverGeneration) {
- if((sbusPaletteIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- sbusPaletteGeneration = serverGeneration;
- }
- cmap = xnfcalloc(1, sizeof(sbusCmapRec));
- pScreen->devPrivates[sbusPaletteIndex].ptr = cmap;
- cmap->psdp = psdp;
- fbcmap.index = 0;
- fbcmap.count = 16;
- fbcmap.red = cmap->origRed;
- fbcmap.green = cmap->origGreen;
- fbcmap.blue = cmap->origBlue;
- if (ioctl (psdp->fd, FBIOGETCMAP, &fbcmap) >= 0)
- cmap->origCmapValid = TRUE;
- fbcmap.index = 0;
- fbcmap.count = 2;
- fbcmap.red = data;
- fbcmap.green = data;
- fbcmap.blue = data;
- if (pScreen->whitePixel == 0) {
- data[0] = 255;
- data[1] = 0;
- } else {
- data[0] = 0;
- data[1] = 255;
- }
- ioctl (psdp->fd, FBIOPUTCMAP, &fbcmap);
- cmap->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = xf86SbusCmapCloseScreen;
- return xf86HandleColormaps(pScreen, 256, 8,
- xf86SbusCmapLoadPalette, NULL, 0);
-}
diff --git a/hw/xfree86/common/xf86sbusBus.h b/hw/xfree86/common/xf86sbusBus.h
deleted file mode 100644
index 0816c63a1..000000000
--- a/hw/xfree86/common/xf86sbusBus.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SBUS bus-specific declarations
- *
- * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h,v 3.5 2002/12/10 02:42:35 tsi Exp $ */
-
-#ifndef _XF86_SBUSBUS_H
-#define _XF86_SBUSBUS_H
-
-#include "xf86str.h"
-
-#define SBUS_DEVICE_BW2 0x0001
-#define SBUS_DEVICE_CG2 0x0002
-#define SBUS_DEVICE_CG3 0x0003
-#define SBUS_DEVICE_CG4 0x0004
-#define SBUS_DEVICE_CG6 0x0005
-#define SBUS_DEVICE_CG8 0x0006
-#define SBUS_DEVICE_CG12 0x0007
-#define SBUS_DEVICE_CG14 0x0008
-#define SBUS_DEVICE_LEO 0x0009
-#define SBUS_DEVICE_TCX 0x000a
-#define SBUS_DEVICE_FFB 0x000b
-#define SBUS_DEVICE_GT 0x000c
-#define SBUS_DEVICE_MGX 0x000d
-
-typedef struct sbus_prom_node {
- int node;
- /* Because of misdesigned openpromio */
- int cookie[2];
-} sbusPromNode, *sbusPromNodePtr;
-
-typedef struct sbus_device {
- int devId;
- int fbNum;
- int fd;
- int width, height;
- sbusPromNode node;
- char *descr;
- char *device;
-} sbusDevice, *sbusDevicePtr;
-
-extern struct sbus_devtable {
- int devId;
- int fbType;
- char *promName;
- char *descr;
-} sbusDeviceTable[];
-
-void xf86SbusProbe(void);
-extern sbusDevicePtr *xf86SbusInfo;
-
-int xf86MatchSbusInstances(const char *driverName, int sbusDevId,
- GDevPtr *devList, int numDevs, DriverPtr drvp,
- int **foundEntities);
-sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
-int xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
-void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
-pointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
- unsigned long size);
-void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
-void xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
-void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
-Bool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
-
-extern int promRootNode;
-
-int promGetSibling(int node);
-int promGetChild(int node);
-char * promGetProperty(const char *prop, int *lenp);
-int promGetBool(const char *prop);
-
-int sparcPromInit(void);
-void sparcPromClose(void);
-char * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
-int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
-void sparcPromAssignNodes(void);
-char * sparcPromNode2Pathname(sbusPromNodePtr pnode);
-int sparcPromPathname2Node(const char *pathName);
-
-#endif /* _XF86_SBUSBUS_H */
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
deleted file mode 100644
index 367cb19a9..000000000
--- a/hw/xfree86/common/xf86str.h
+++ /dev/null
@@ -1,1072 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.97 2003/10/30 17:36:56 tsi Exp $ */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains definitions of the public XFree86 data structures/types.
- * Any data structures that video drivers need to access should go here.
- */
-
-#ifndef _XF86STR_H
-#define _XF86STR_H
-
-#include "misc.h"
-#include "input.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "colormapst.h"
-#include "xf86Module.h"
-#include "xf86Opt.h"
-#include "xf86Pci.h"
-
-/*
- * memType is of the size of the addressable memory (machine size)
- * usually unsigned long.
- */
-typedef unsigned long memType;
-
-/* Video mode flags */
-
-typedef enum {
- V_PHSYNC = 0x0001,
- V_NHSYNC = 0x0002,
- V_PVSYNC = 0x0004,
- V_NVSYNC = 0x0008,
- V_INTERLACE = 0x0010,
- V_DBLSCAN = 0x0020,
- V_CSYNC = 0x0040,
- V_PCSYNC = 0x0080,
- V_NCSYNC = 0x0100,
- V_HSKEW = 0x0200, /* hskew provided */
- V_BCAST = 0x0400,
- V_PIXMUX = 0x1000,
- V_DBLCLK = 0x2000,
- V_CLKDIV2 = 0x4000
-} ModeFlags;
-
-typedef enum {
- INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
-} CrtcAdjustFlags;
-
-/* Flags passed to ChipValidMode() */
-typedef enum {
- MODECHECK_INITIAL = 0,
- MODECHECK_FINAL = 1
-} ModeCheckFlags;
-
-/* These are possible return values for xf86CheckMode() and ValidMode() */
-typedef enum {
- MODE_OK = 0, /* Mode OK */
- MODE_HSYNC, /* hsync out of range */
- MODE_VSYNC, /* vsync out of range */
- MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
- MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
- MODE_BAD_WIDTH, /* requires an unsupported linepitch */
- MODE_NOMODE, /* no mode with a maching name */
- MODE_NO_INTERLACE, /* interlaced mode not supported */
- MODE_NO_DBLESCAN, /* doublescan mode not supported */
- MODE_NO_VSCAN, /* multiscan mode not supported */
- MODE_MEM, /* insufficient video memory */
- MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
- MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
- MODE_MEM_VIRT, /* insufficient video memory given virtual size */
- MODE_NOCLOCK, /* no fixed clock available */
- MODE_CLOCK_HIGH, /* clock required is too high */
- MODE_CLOCK_LOW, /* clock required is too low */
- MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
- MODE_BAD_HVALUE, /* horizontal timing was out of range */
- MODE_BAD_VVALUE, /* vertical timing was out of range */
- MODE_BAD_VSCAN, /* VScan value out of range */
- MODE_HSYNC_NARROW, /* horizontal sync too narrow */
- MODE_HSYNC_WIDE, /* horizontal sync too wide */
- MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
- MODE_HBLANK_WIDE, /* horizontal blanking too wide */
- MODE_VSYNC_NARROW, /* vertical sync too narrow */
- MODE_VSYNC_WIDE, /* vertical sync too wide */
- MODE_VBLANK_NARROW, /* vertical blanking too narrow */
- MODE_VBLANK_WIDE, /* vertical blanking too wide */
- MODE_PANEL, /* exceeds panel dimensions */
- MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
- MODE_ONE_WIDTH, /* only one width is supported */
- MODE_ONE_HEIGHT, /* only one height is supported */
- MODE_ONE_SIZE, /* only one resolution is supported */
- MODE_BAD = -2, /* unspecified reason */
- MODE_ERROR = -1 /* error condition */
-} ModeStatus;
-
-# define M_T_BUILTIN 0x01 /* built-in mode */
-# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
-# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
-# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
- /* built-in mode - configure CRTC and clock */
-# define M_T_DEFAULT 0x10 /* (VESA) default modes */
-# define M_T_USERDEF 0x20 /* One of the modes from the config file */
-
-/* Video mode */
-typedef struct _DisplayModeRec {
- struct _DisplayModeRec * prev;
- struct _DisplayModeRec * next;
- char * name; /* identifier for the mode */
- ModeStatus status;
- int type;
-
- /* These are the values that the user sees/provides */
- int Clock; /* pixel clock freq */
- int HDisplay; /* horizontal timing */
- int HSyncStart;
- int HSyncEnd;
- int HTotal;
- int HSkew;
- int VDisplay; /* vertical timing */
- int VSyncStart;
- int VSyncEnd;
- int VTotal;
- int VScan;
- int Flags;
-
- /* These are the values the hardware uses */
- int ClockIndex;
- int SynthClock; /* Actual clock freq to
- * be programmed */
- int CrtcHDisplay;
- int CrtcHBlankStart;
- int CrtcHSyncStart;
- int CrtcHSyncEnd;
- int CrtcHBlankEnd;
- int CrtcHTotal;
- int CrtcHSkew;
- int CrtcVDisplay;
- int CrtcVBlankStart;
- int CrtcVSyncStart;
- int CrtcVSyncEnd;
- int CrtcVBlankEnd;
- int CrtcVTotal;
- Bool CrtcHAdjusted;
- Bool CrtcVAdjusted;
- int PrivSize;
- INT32 * Private;
- int PrivFlags;
-
- float HSync, VRefresh;
-} DisplayModeRec, *DisplayModePtr;
-
-/* The monitor description */
-
-#define MAX_HSYNC 8
-#define MAX_VREFRESH 8
-
-typedef struct { float hi, lo; } range;
-
-typedef struct { CARD32 red, green, blue; } rgb;
-
-typedef struct { float red, green, blue; } Gamma;
-
-/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
-#define GAMMA_MAX 10.0
-#define GAMMA_MIN (1.0 / GAMMA_MAX)
-#define GAMMA_ZERO (GAMMA_MIN / 100.0)
-
-typedef struct {
- char * id;
- char * vendor;
- char * model;
- int nHsync;
- range hsync[MAX_HSYNC];
- int nVrefresh;
- range vrefresh[MAX_VREFRESH];
- DisplayModePtr Modes; /* Start of the monitor's mode list */
- DisplayModePtr Last; /* End of the monitor's mode list */
- Gamma gamma; /* Gamma of the monitor */
- int widthmm;
- int heightmm;
- pointer options;
- pointer DDC;
-} MonRec, *MonPtr;
-
-/* the list of clock ranges */
-typedef struct x_ClockRange {
- struct x_ClockRange *next;
- int minClock;
- int maxClock;
- int clockIndex; /* -1 for programmable clocks */
- Bool interlaceAllowed;
- Bool doubleScanAllowed;
- int ClockMulFactor;
- int ClockDivFactor;
- int PrivFlags;
-} ClockRange, *ClockRangePtr;
-
-/* Need to store the strategy with clockRange for VidMode extension */
-typedef struct x_ClockRanges {
- struct x_ClockRanges *next;
- int minClock;
- int maxClock;
- int clockIndex; /* -1 for programmable clocks */
- Bool interlaceAllowed;
- Bool doubleScanAllowed;
- int ClockMulFactor;
- int ClockDivFactor;
- int PrivFlags;
- int strategy;
-} ClockRanges, *ClockRangesPtr;
-
-/*
- * The driver list struct. This contains the information required for each
- * driver before a ScrnInfoRec has been allocated.
- */
-typedef struct _DriverRec {
- int driverVersion;
- char * driverName;
- void (*Identify)(int flags);
- Bool (*Probe)(struct _DriverRec *drv, int flags);
- const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
- pointer module;
- int refCount;
-} DriverRec, *DriverPtr;
-
-#ifdef XFree86LOADER
-/*
- * The optional module list struct. This allows modules exporting helping
- * functions to configuration tools, the Xserver, or any other
- * application/module interested in such information.
- */
-typedef struct _ModuleInfoRec {
- int moduleVersion;
- char * moduleName;
- pointer module;
- int refCount;
- const OptionInfoRec * (*AvailableOptions)(void *unused);
- pointer unused[8]; /* leave some space for more fields */
-} ModuleInfoRec, *ModuleInfoPtr;
-#endif
-
-/*
- * These are the private bus types. New types can be added here. Types
- * required for the public interface should be added to xf86str.h, with
- * function prototypes added to xf86.h.
- */
-
-/* Tolerate prior #include <linux/input.h> */
-#if defined(linux) && defined(_INPUT_H)
-#undef BUS_NONE
-#undef BUS_ISA
-#undef BUS_PCI
-#undef BUS_SBUS
-#undef BUS_last
-#endif
-
-typedef enum {
- BUS_NONE,
- BUS_ISA,
- BUS_PCI,
- BUS_SBUS,
- BUS_last /* Keep last */
-} BusType;
-
-typedef struct {
- int bus;
- int device;
- int func;
-} PciBusId;
-
-typedef struct {
- unsigned int dummy;
-} IsaBusId;
-
-typedef struct {
- int fbNum;
-} SbusBusId;
-
-typedef struct _bus {
- BusType type;
- union {
- IsaBusId isa;
- PciBusId pci;
- SbusBusId sbus;
- } id;
-} BusRec, *BusPtr;
-
-#define MAXCLOCKS 128
-typedef enum {
- DAC_BPP8 = 0,
- DAC_BPP16,
- DAC_BPP24,
- DAC_BPP32,
- MAXDACSPEEDS
-} DacSpeedIndex;
-
-typedef struct {
- char * identifier;
- char * vendor;
- char * board;
- char * chipset;
- char * ramdac;
- char * driver;
- struct _confscreenrec * myScreenSection;
- Bool claimed;
- int dacSpeeds[MAXDACSPEEDS];
- int numclocks;
- int clock[MAXCLOCKS];
- char * clockchip;
- char * busID;
- Bool active;
- Bool inUse;
- int videoRam;
- int textClockFreq;
- unsigned long BiosBase; /* Base address of video BIOS */
- unsigned long MemBase; /* Frame buffer base address */
- unsigned long IOBase;
- int chipID;
- int chipRev;
- pointer options;
- int irq;
- int screen; /* For multi-CRTC cards */
-} GDevRec, *GDevPtr;
-
-typedef int (*FindIsaDevProc)(GDevPtr dev);
-
-typedef struct {
- char * identifier;
- char * driver;
- pointer commonOptions;
- pointer extraOptions;
-} IDevRec, *IDevPtr;
-
-typedef struct {
- int vendor;
- int chipType;
- int chipRev;
- int subsysVendor;
- int subsysCard;
- int bus;
- int device;
- int func;
- int class;
- int subclass;
- int interface;
- memType memBase[6];
- memType ioBase[6];
- int size[6];
- unsigned char type[6];
- memType biosBase;
- int biosSize;
- pointer thisCard;
- Bool validSize;
- Bool validate;
- CARD32 listed_class;
-} pciVideoRec, *pciVideoPtr;
-
-typedef struct {
- int frameX0;
- int frameY0;
- int virtualX;
- int virtualY;
- int depth;
- int fbbpp;
- rgb weight;
- rgb blackColour;
- rgb whiteColour;
- int defaultVisual;
- char ** modes;
- pointer options;
-} DispRec, *DispPtr;
-
-typedef struct _confxvportrec {
- char * identifier;
- pointer options;
-} confXvPortRec, *confXvPortPtr;
-
-typedef struct _confxvadaptrec {
- char * identifier;
- int numports;
- confXvPortPtr ports;
- pointer options;
-} confXvAdaptorRec, *confXvAdaptorPtr;
-
-typedef struct _confscreenrec {
- char * id;
- int screennum;
- int defaultdepth;
- int defaultbpp;
- int defaultfbbpp;
- MonPtr monitor;
- GDevPtr device;
- int numdisplays;
- DispPtr displays;
- int numxvadaptors;
- confXvAdaptorPtr xvadaptors;
- pointer options;
-} confScreenRec, *confScreenPtr;
-
-typedef enum {
- PosObsolete = -1,
- PosAbsolute = 0,
- PosRightOf,
- PosLeftOf,
- PosAbove,
- PosBelow,
- PosRelative
-} PositionType;
-
-typedef struct _screenlayoutrec {
- confScreenPtr screen;
- char * topname;
- confScreenPtr top;
- char * bottomname;
- confScreenPtr bottom;
- char * leftname;
- confScreenPtr left;
- char * rightname;
- confScreenPtr right;
- PositionType where;
- int x;
- int y;
- char * refname;
- confScreenPtr refscreen;
-} screenLayoutRec, *screenLayoutPtr;
-
-typedef struct _serverlayoutrec {
- char * id;
- screenLayoutPtr screens;
- GDevPtr inactives;
- IDevPtr inputs;
- pointer options;
-} serverLayoutRec, *serverLayoutPtr;
-
-typedef struct _confdribufferrec {
- int count;
- int size;
- enum {
- XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
- } flags;
-} confDRIBufferRec, *confDRIBufferPtr;
-
-typedef struct _confdrirec {
- int group;
- int mode;
- int bufs_count;
- confDRIBufferRec *bufs;
-} confDRIRec, *confDRIPtr;
-
-/* These values should be adjusted when new fields are added to ScrnInfoRec */
-#define NUM_RESERVED_INTS 16
-#define NUM_RESERVED_POINTERS 15
-#define NUM_RESERVED_FUNCS 12
-
-typedef pointer (*funcPointer)(void);
-
-/* flags for depth 24 pixmap options */
-typedef enum {
- Pix24DontCare = 0,
- Pix24Use24,
- Pix24Use32
-} Pix24Flags;
-
-/* Power management events: so far we only support APM */
-
-typedef enum {
- XF86_APM_UNKNOWN = -1,
- XF86_APM_SYS_STANDBY,
- XF86_APM_SYS_SUSPEND,
- XF86_APM_CRITICAL_SUSPEND,
- XF86_APM_USER_STANDBY,
- XF86_APM_USER_SUSPEND,
- XF86_APM_STANDBY_RESUME,
- XF86_APM_NORMAL_RESUME,
- XF86_APM_CRITICAL_RESUME,
- XF86_APM_LOW_BATTERY,
- XF86_APM_POWER_STATUS_CHANGE,
- XF86_APM_UPDATE_TIME,
- XF86_APM_CAPABILITY_CHANGED,
- XF86_APM_STANDBY_FAILED,
- XF86_APM_SUSPEND_FAILED
-} pmEvent;
-
-typedef enum {
- PM_WAIT,
- PM_CONTINUE,
- PM_FAILED,
- PM_NONE
-} pmWait;
-
-/*
- * The IO access enabler struct. This contains the address for
- * the IOEnable/IODisable funcs for their specific bus along
- * with a pointer to data needed by them
- */
-typedef struct _AccessRec {
- void (*AccessDisable)(void *arg);
- void (*AccessEnable)(void *arg);
- void *arg;
-} xf86AccessRec, *xf86AccessPtr;
-
-typedef struct {
- xf86AccessPtr mem;
- xf86AccessPtr io;
- xf86AccessPtr io_mem;
-} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
-
-/* bus-access-related types */
-typedef enum {
- NONE,
- IO,
- MEM_IO,
- MEM
-} resType;
-
-typedef struct _EntityAccessRec {
- xf86AccessPtr fallback;
- xf86AccessPtr pAccess;
- resType rt;
- pointer busAcc;
- struct _EntityAccessRec *next;
-} EntityAccessRec, *EntityAccessPtr;
-
-typedef struct _CurrAccRec {
- EntityAccessPtr pMemAccess;
- EntityAccessPtr pIoAccess;
-} xf86CurrentAccessRec, *xf86CurrentAccessPtr;
-
-/* new RAC */
-
-/* Resource Type values */
-#define ResNone ((unsigned long)(-1))
-
-#define ResMem 0x0001
-#define ResIo 0x0002
-#define ResIrq 0x0003
-#define ResDma 0x0004
-#define ResPciCfg 0x000e /* PCI Configuration space */
-#define ResPhysMask 0x000F
-
-#define ResExclusive 0x0010
-#define ResShared 0x0020
-#define ResAny 0x0040
-#define ResAccMask 0x0070
-#define ResUnused 0x0080
-
-#define ResUnusedOpr 0x0100
-#define ResDisableOpr 0x0200
-#define ResOprMask 0x0300
-
-#define ResBlock 0x0400
-#define ResSparse 0x0800
-#define ResExtMask 0x0C00
-
-#define ResEstimated 0x001000
-#define ResInit 0x002000
-#define ResBios 0x004000
-#define ResMiscMask 0x00F000
-
-#define ResBus 0x010000
-#define ResOverlap 0x020000
-
-#if defined(__alpha__) && defined(linux)
-# define ResDomain 0x1ff000000ul
-#else
-# define ResDomain 0xff000000ul
-#endif
-#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */
-
-#define ResEnd ResNone
-
-#define ResExcMemBlock (ResMem | ResExclusive | ResBlock)
-#define ResExcIoBlock (ResIo | ResExclusive | ResBlock)
-#define ResShrMemBlock (ResMem | ResShared | ResBlock)
-#define ResShrIoBlock (ResIo | ResShared | ResBlock)
-#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock)
-#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock)
-#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock)
-#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock)
-#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse)
-#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse)
-#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse)
-#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse)
-
-#define ResExcMemSparse (ResMem | ResExclusive | ResSparse)
-#define ResExcIoSparse (ResIo | ResExclusive | ResSparse)
-#define ResShrMemSparse (ResMem | ResShared | ResSparse)
-#define ResShrIoSparse (ResIo | ResShared | ResSparse)
-#define ResUusdMemSparse (ResMem | ResUnused | ResSparse)
-#define ResUusdIoSparse (ResIo | ResUnused | ResSparse)
-
-#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem)
-#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo)
-#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive)
-#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared)
-#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused)
-#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
-#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
-#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
-#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap))
-
-typedef struct {
- unsigned long type; /* shared, exclusive, unused etc. */
- memType a;
- memType b;
-} resRange, *resList;
-
-#define RANGE_TYPE(type, domain) \
- (((unsigned long)(domain) << 24) | ((type) & ~ResBus))
-#define RANGE(r,u,v,t) {\
- (r).a = (u);\
- (r).b = (v);\
- (r).type = (t);\
- }
-
-#define rBase a
-#define rMask b
-#define rBegin a
-#define rEnd b
-
-/* resource record */
-typedef struct _resRec *resPtr;
-typedef struct _resRec {
- resRange val;
- int entityIndex; /* who owns the resource */
- resPtr next;
-} resRec;
-
-#define sparse_base val.rBase
-#define sparse_mask val.rMask
-#define block_begin val.rBegin
-#define block_end val.rEnd
-#define res_type val.type
-
-typedef struct {
- int numChipset;
- resRange *resList;
-} IsaChipsets;
-
-typedef struct {
- int numChipset;
- int PCIid;
- resRange *resList;
-} PciChipsets;
-
-/* Entity properties */
-typedef void (*EntityProc)(int entityIndex,pointer private);
-
-typedef struct _entityInfo {
- int index;
- BusRec location;
- int chipset;
- Bool active;
- resPtr resources;
- GDevPtr device;
- DriverPtr driver;
-} EntityInfoRec, *EntityInfoPtr;
-
-/* server states */
-
-typedef enum {
- SETUP,
- OPERATING
-} xf86State;
-
-typedef enum {
- NOTIFY_SETUP_TRANSITION,
- NOTIFY_SETUP,
- NOTIFY_OPERATING,
- NOTIFY_OPERATING_TRANSITION,
- NOTIFY_ENABLE,
- NOTIFY_ENTER,
- NOTIFY_LEAVE
-} xf86NotifyState;
-
-typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
-
-/* DGA */
-
-typedef struct {
- int num; /* A unique identifier for the mode (num > 0) */
- DisplayModePtr mode;
- int flags; /* DGA_CONCURRENT_ACCESS, etc... */
- int imageWidth; /* linear accessible portion (pixels) */
- int imageHeight;
- int pixmapWidth; /* Xlib accessible portion (pixels) */
- int pixmapHeight; /* both fields ignored if no concurrent access */
- int bytesPerScanline;
- int byteOrder; /* MSBFirst, LSBFirst */
- int depth;
- int bitsPerPixel;
- unsigned long red_mask;
- unsigned long green_mask;
- unsigned long blue_mask;
- short visualClass;
- int viewportWidth;
- int viewportHeight;
- int xViewportStep; /* viewport position granularity */
- int yViewportStep;
- int maxViewportX; /* max viewport origin */
- int maxViewportY;
- int viewportFlags; /* types of page flipping possible */
- int offset; /* offset into physical memory */
- unsigned char *address; /* server's mapped framebuffer */
- int reserved1;
- int reserved2;
-} DGAModeRec, *DGAModePtr;
-
-typedef struct {
- DGAModePtr mode;
- PixmapPtr pPix;
-} DGADeviceRec, *DGADevicePtr;
-
-/*
- * Flags for driver Probe() functions.
- */
-#define PROBE_DEFAULT 0x00
-#define PROBE_DETECT 0x01
-#define PROBE_TRYHARD 0x02
-
-/*
- * Driver entry point types
- */
-typedef struct _ScrnInfoRec *ScrnInfoPtr;
-
-typedef Bool xf86ProbeProc (DriverPtr, int);
-typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
-typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
-typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
-typedef void xf86AdjustFrameProc (int, int, int, int);
-typedef Bool xf86EnterVTProc (int, int);
-typedef void xf86LeaveVTProc (int, int);
-typedef void xf86FreeScreenProc (int, int);
-typedef ModeStatus xf86ValidModeProc (int, DisplayModePtr, Bool, int);
-typedef void xf86EnableDisableFBAccessProc(int, Bool);
-typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
-typedef int xf86ChangeGammaProc (int, Gamma);
-typedef void xf86PointerMovedProc (int, int, int);
-typedef Bool xf86PMEventProc (int, pmEvent, Bool);
-typedef int xf86HandleMessageProc (int, const char*, const char*, char**);
-typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
-typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
-typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
-
-/*
- * ScrnInfoRec
- *
- * There is one of these for each screen, and it holds all the screen-specific
- * information.
- *
- * Note: the size and layout must be kept the same across versions. New
- * fields are to be added in place of the "reserved*" fields. No fields
- * are to be dependent on compile-time defines.
- */
-
-
-typedef struct _ScrnInfoRec {
- int driverVersion;
- char * driverName; /* canonical name used in */
- /* the config file */
- ScreenPtr pScreen; /* Pointer to the ScreenRec */
- int scrnIndex; /* Number of this screen */
- Bool configured; /* Is this screen valid */
- int origIndex; /* initial number assigned to
- * this screen before
- * finalising the number of
- * available screens */
-
- /* Display-wide screenInfo values needed by this screen */
- int imageByteOrder;
- int bitmapScanlineUnit;
- int bitmapScanlinePad;
- int bitmapBitOrder;
- int numFormats;
- PixmapFormatRec formats[MAXFORMATS];
- PixmapFormatRec fbFormat;
-
- int bitsPerPixel; /* fb bpp */
- Pix24Flags pixmap24; /* pixmap pref for depth 24 */
- int depth; /* depth of default visual */
- MessageType depthFrom; /* set from config? */
- MessageType bitsPerPixelFrom; /* set from config? */
- rgb weight; /* r/g/b weights */
- rgb mask; /* rgb masks */
- rgb offset; /* rgb offsets */
- int rgbBits; /* Number of bits in r/g/b */
- Gamma gamma; /* Gamma of the monitor */
- int defaultVisual; /* default visual class */
- int maxHValue; /* max horizontal timing */
- int maxVValue; /* max vertical timing value */
- int virtualX; /* Virtual width */
- int virtualY; /* Virtual height */
- int xInc; /* Horizontal timing increment */
- MessageType virtualFrom; /* set from config? */
- int displayWidth; /* memory pitch */
- int frameX0; /* viewport position */
- int frameY0;
- int frameX1;
- int frameY1;
- int zoomLocked; /* Disallow mode changes */
- DisplayModePtr modePool; /* list of compatible modes */
- DisplayModePtr modes; /* list of actual modes */
- DisplayModePtr currentMode; /* current mode
- * This was previously
- * overloaded with the modes
- * field, which is a pointer
- * into a circular list */
- confScreenPtr confScreen; /* Screen config info */
- MonPtr monitor; /* Monitor information */
- DispPtr display; /* Display information */
- int * entityList; /* List of device entities */
- int numEntities;
- int widthmm; /* physical display dimensions
- * in mm */
- int heightmm;
- int xDpi; /* width DPI */
- int yDpi; /* height DPI */
- char * name; /* Name to prefix messages */
- pointer driverPrivate; /* Driver private area */
- DevUnion * privates; /* Other privates can hook in
- * here */
- DriverPtr drv; /* xf86DriverList[] entry */
- pointer module; /* Pointer to module head */
- int colorKey;
- int overlayFlags;
-
- /* Some of these may be moved out of here into the driver private area */
-
- char * chipset; /* chipset name */
- char * ramdac; /* ramdac name */
- char * clockchip; /* clock name */
- Bool progClock; /* clock is programmable */
- int numClocks; /* number of clocks */
- int clock[MAXCLOCKS]; /* list of clock frequencies */
- int videoRam; /* amount of video ram (kb) */
- unsigned long biosBase; /* Base address of video BIOS */
- unsigned long memPhysBase; /* Physical address of FB */
- unsigned long fbOffset; /* Offset of FB in the above */
- IOADDRESS domainIOBase; /* Domain I/O base address */
- int memClk; /* memory clock */
- int textClockFreq; /* clock of text mode */
- Bool flipPixels; /* swap default black/white */
- pointer options;
-
- int chipID;
- int chipRev;
- int racMemFlags;
- int racIoFlags;
- pointer access;
- xf86CurrentAccessPtr CurrentAccess;
- resType resourceType;
- pointer busAccess;
-
- /* Allow screens to be enabled/disabled individually */
- Bool vtSema;
- DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
-
- /* hw cursor moves at SIGIO time */
- Bool silkenMouse;
-
- /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
- ClockRangesPtr clockRanges;
- int adjustFlags;
-
- /*
- * These can be used when the minor ABI version is incremented.
- * The NUM_* parameters must be reduced appropriately to keep the
- * structure size and alignment unchanged.
- */
- int reservedInt[NUM_RESERVED_INTS];
-
- int * entityInstanceList;
- pointer reservedPtr[NUM_RESERVED_POINTERS];
-
- /*
- * Driver entry points.
- *
- */
-
- xf86ProbeProc *Probe;
- xf86PreInitProc *PreInit;
- xf86ScreenInitProc *ScreenInit;
- xf86SwitchModeProc *SwitchMode;
- xf86AdjustFrameProc *AdjustFrame;
- xf86EnterVTProc *EnterVT;
- xf86LeaveVTProc *LeaveVT;
- xf86FreeScreenProc *FreeScreen;
- xf86ValidModeProc *ValidMode;
- xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
- xf86SetDGAModeProc *SetDGAMode;
- xf86ChangeGammaProc *ChangeGamma;
- xf86PointerMovedProc *PointerMoved;
- xf86PMEventProc *PMEvent;
- xf86HandleMessageProc *HandleMessage;
- xf86DPMSSetProc *DPMSSet;
- xf86LoadPaletteProc *LoadPalette;
- xf86SetOverscanProc *SetOverscan;
-
- /*
- * This can be used when the minor ABI version is incremented.
- * The NUM_* parameter must be reduced appropriately to keep the
- * structure size and alignment unchanged.
- */
- funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
-
-} ScrnInfoRec;
-
-
-typedef struct {
- Bool (*OpenFramebuffer)(
- ScrnInfoPtr pScrn,
- char **name,
- unsigned char **mem,
- int *size,
- int *offset,
- int *extra
- );
- void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
- Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
- void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
- int (*GetViewport)(ScrnInfoPtr pScrn);
- void (*Sync)(ScrnInfoPtr);
- void (*FillRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned long color
- );
- void (*BlitRect)(
- ScrnInfoPtr pScrn,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty
- );
- void (*BlitTransRect)(
- ScrnInfoPtr pScrn,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty,
- unsigned long color
- );
-} DGAFunctionRec, *DGAFunctionPtr;
-
-typedef struct {
- int token; /* id of the token */
- const char * name; /* token name */
-} SymTabRec, *SymTabPtr;
-
-/* flags for xf86LookupMode */
-typedef enum {
- LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
- LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
- LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
- LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
- LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
- LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
-} LookupModeFlags;
-
-#define NoDepth24Support 0x00
-#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
-#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
-#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
-#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
-#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
-#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
-
-
-/* For DPMS */
-typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
-
-/* Input handler proc */
-typedef void (*InputHandlerProc)(int fd, pointer data);
-
-/* These are used by xf86GetClocks */
-#define CLK_REG_SAVE -1
-#define CLK_REG_RESTORE -2
-
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
-typedef struct {
- long sec;
- long usec;
-} xf86TsRec, *xf86TsPtr;
-#endif
-
-/*
- * misc constants
- */
-#define INTERLACE_REFRESH_WEIGHT 1.5
-#define SYNC_TOLERANCE 0.01 /* 1 percent */
-#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
-
-
-#define OVERLAY_8_32_DUALFB 0x00000001
-#define OVERLAY_8_24_DUALFB 0x00000002
-#define OVERLAY_8_16_DUALFB 0x00000004
-#define OVERLAY_8_32_PLANAR 0x00000008
-
-#if 0
-#define LD_RESOLV_IFDONE 0 /* only check if no more
- delays pending */
-#define LD_RESOLV_NOW 1 /* finish one delay step */
-#define LD_RESOLV_FORCE 2 /* force checking... */
-#endif
-
-/* Values of xf86Info.mouseFlags */
-#define MF_CLEAR_DTR 1
-#define MF_CLEAR_RTS 2
-
-/* Action Events */
-typedef enum {
- ACTION_TERMINATE = 0, /* Terminate Server */
- ACTION_NEXT_MODE = 10, /* Switch to next video mode */
- ACTION_PREV_MODE,
- ACTION_DISABLEGRAB = 20, /* Cancel server/pointer/kbd grabs */
- ACTION_CLOSECLIENT, /* Kill client holding grab */
- ACTION_SWITCHSCREEN = 100, /* VT switch */
- ACTION_SWITCHSCREEN_NEXT,
- ACTION_SWITCHSCREEN_PREV,
- ACTION_MESSAGE = 9999 /* Generic message passing */
-} ActionEvent;
-
-/* xf86Versions.c */
-/*
- * Never change existing values, and always assign values explicitly.
- * NUM_BUILTIN_IFS must always be the last entry.
- */
-typedef enum {
- BUILTIN_IF_OSMOUSE = 0,
- BUILTIN_IF_OSKBD = 1,
- NUM_BUILTIN_IFS
-} BuiltinInterface;
-
-/*
- * These are intentionally the same as the module version macros.
- * It is possible to register a module as providing a specific interface,
- * in which case the module's version is used. This feature isn't
- * really ready for use yet though.
- */
-
-#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
- ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
-#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
-#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
-#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF)
-
-#endif /* _XF86STR_H */
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
deleted file mode 100644
index 90289057b..000000000
--- a/hw/xfree86/common/xf86xv.c
+++ /dev/null
@@ -1,2046 +0,0 @@
-/*
- * XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
- */
-/*
- * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.37 2003/11/10 18:22:15 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "mivalidate.h"
-#include "validate.h"
-#include "resource.h"
-#include "gcstruct.h"
-#include "dixstruct.h"
-
-#include "Xv.h"
-#include "Xvproto.h"
-#include "xvdix.h"
-#ifdef XFree86LOADER
-#include "xvmodproc.h"
-#endif
-
-#include "xf86xvpriv.h"
-
-
-/* XvScreenRec fields */
-
-static Bool xf86XVCloseScreen(int, ScreenPtr);
-static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
-
-/* XvAdaptorRec fields */
-
-static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*);
-static int xf86XVFreePort(XvPortPtr);
-static int xf86XVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-static int xf86XVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-static int xf86XVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-static int xf86XVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16);
-static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
-static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
-static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
-static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8,
- CARD16, CARD16,CARD16, CARD16,
- unsigned int*, unsigned int*);
-static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
- INT16, INT16, CARD16, CARD16,
- XvImagePtr, unsigned char*, Bool,
- CARD16, CARD16);
-static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
- CARD16*, CARD16*, int*, int*);
-
-
-/* ScreenRec fields */
-
-static Bool xf86XVDestroyWindow(WindowPtr pWin);
-static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2);
-static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
-
-/* ScrnInfoRec functions */
-
-static Bool xf86XVEnterVT(int, int);
-static void xf86XVLeaveVT(int, int);
-static void xf86XVAdjustFrame(int index, int x, int y, int flags);
-
-/* misc */
-
-static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int);
-
-
-int XF86XVWindowIndex = -1;
-int XF86XvScreenIndex = -1;
-static unsigned long XF86XVGeneration = 0;
-static unsigned long PortResource = 0;
-
-#ifdef XFree86LOADER
-int (*XvGetScreenIndexProc)(void) = NULL;
-unsigned long (*XvGetRTPortProc)(void) = NULL;
-int (*XvScreenInitProc)(ScreenPtr) = NULL;
-#else
-int (*XvGetScreenIndexProc)(void) = XvGetScreenIndex;
-unsigned long (*XvGetRTPortProc)(void) = XvGetRTPort;
-int (*XvScreenInitProc)(ScreenPtr) = XvScreenInit;
-#endif
-
-
-#define GET_XV_SCREEN(pScreen) \
- ((XvScreenPtr)((pScreen)->devPrivates[XF86XvScreenIndex].ptr))
-
-#define GET_XF86XV_SCREEN(pScreen) \
- ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
-
-#define GET_XF86XV_WINDOW(pWin) \
- ((XF86XVWindowPtr)((pWin)->devPrivates[XF86XVWindowIndex].ptr))
-
-static xf86XVInitGenericAdaptorPtr *GenDrivers = NULL;
-static int NumGenDrivers = 0;
-
-int
-xf86XVRegisterGenericAdaptorDriver(
- xf86XVInitGenericAdaptorPtr InitFunc
-){
- xf86XVInitGenericAdaptorPtr *newdrivers;
-
- newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
- (1 + NumGenDrivers));
- if (!newdrivers)
- return 0;
- GenDrivers = newdrivers;
-
- GenDrivers[NumGenDrivers++] = InitFunc;
-
- return 1;
-}
-
-int
-xf86XVListGenericAdaptors(
- ScrnInfoPtr pScrn,
- XF86VideoAdaptorPtr **adaptors
-){
- int i,j,n,num;
- XF86VideoAdaptorPtr *DrivAdap,*new;
-
- num = 0;
- *adaptors = NULL;
- /*
- * The v4l driver registers itself first, but can use surfaces registered
- * by other drivers. So, call the v4l driver last.
- */
- for (i = NumGenDrivers; --i >= 0; ) {
- DrivAdap = NULL;
- n = (*GenDrivers[i])(pScrn, &DrivAdap);
- if (0 == n)
- continue;
- new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n));
- if (NULL == new)
- continue;
- *adaptors = new;
- for (j = 0; j < n; j++, num++)
- (*adaptors)[num] = DrivAdap[j];
- }
- return num;
-}
-
-
-/**************** Offscreen surface stuff *******************/
-
-typedef struct {
- XF86OffscreenImagePtr images;
- int num;
-} OffscreenImageRec;
-
-static OffscreenImageRec OffscreenImages[MAXSCREENS];
-
-Bool
-xf86XVRegisterOffscreenImages(
- ScreenPtr pScreen,
- XF86OffscreenImagePtr images,
- int num
-){
- OffscreenImages[pScreen->myNum].num = num;
- OffscreenImages[pScreen->myNum].images = images;
-
- return TRUE;
-}
-
-XF86OffscreenImagePtr
-xf86XVQueryOffscreenImages(
- ScreenPtr pScreen,
- int *num
-){
- *num = OffscreenImages[pScreen->myNum].num;
- return OffscreenImages[pScreen->myNum].images;
-}
-
-
-XF86VideoAdaptorPtr
-xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn)
-{
- return xcalloc(1, sizeof(XF86VideoAdaptorRec));
-}
-
-void
-xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr)
-{
- xfree(ptr);
-}
-
-
-Bool
-xf86XVScreenInit(
- ScreenPtr pScreen,
- XF86VideoAdaptorPtr *adaptors,
- int num
-){
- ScrnInfoPtr pScrn;
- XF86XVScreenPtr ScreenPriv;
- XvScreenPtr pxvs;
-
- if(num <= 0 ||
- !XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
- return FALSE;
-
- if(XF86XVGeneration != serverGeneration) {
- if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0)
- return FALSE;
- XF86XVGeneration = serverGeneration;
- }
-
- if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,0))
- return FALSE;
-
- if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
-
- XF86XvScreenIndex = (*XvGetScreenIndexProc)();
- PortResource = (*XvGetRTPortProc)();
-
- pxvs = GET_XV_SCREEN(pScreen);
-
- /* Anyone initializing the Xv layer must provide these two.
- The Xv di layer calls them without even checking if they exist! */
-
- pxvs->ddCloseScreen = xf86XVCloseScreen;
- pxvs->ddQueryAdaptors = xf86XVQueryAdaptors;
-
- /* The Xv di layer provides us with a private hook so that we don't
- have to allocate our own screen private. They also provide
- a CloseScreen hook so that we don't have to wrap it. I'm not
- sure that I appreciate that. */
-
- ScreenPriv = xalloc(sizeof(XF86XVScreenRec));
- pxvs->devPriv.ptr = (pointer)ScreenPriv;
-
- if(!ScreenPriv) return FALSE;
-
- pScrn = xf86Screens[pScreen->myNum];
-
- ScreenPriv->videoGC = NULL; /* for the helper */
-
- ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- ScreenPriv->WindowExposures = pScreen->WindowExposures;
- ScreenPriv->ClipNotify = pScreen->ClipNotify;
- ScreenPriv->EnterVT = pScrn->EnterVT;
- ScreenPriv->LeaveVT = pScrn->LeaveVT;
- ScreenPriv->AdjustFrame = pScrn->AdjustFrame;
-
- pScreen->DestroyWindow = xf86XVDestroyWindow;
- pScreen->WindowExposures = xf86XVWindowExposures;
- pScreen->ClipNotify = xf86XVClipNotify;
- pScrn->EnterVT = xf86XVEnterVT;
- pScrn->LeaveVT = xf86XVLeaveVT;
- if(pScrn->AdjustFrame)
- pScrn->AdjustFrame = xf86XVAdjustFrame;
-
- if(!xf86XVInitAdaptors(pScreen, adaptors, num))
- return FALSE;
-
- return TRUE;
-}
-
-static void
-xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
-{
- int i;
-
- xfree(pAdaptor->name);
-
- if(pAdaptor->pEncodings) {
- XvEncodingPtr pEncode = pAdaptor->pEncodings;
-
- for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
- xfree(pEncode->name);
- xfree(pAdaptor->pEncodings);
- }
-
- xfree(pAdaptor->pFormats);
-
- if(pAdaptor->pPorts) {
- XvPortPtr pPort = pAdaptor->pPorts;
- XvPortRecPrivatePtr pPriv;
-
- for(i = 0; i < pAdaptor->nPorts; i++, pPort++) {
- pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
- if(pPriv) {
- if(pPriv->clientClip)
- REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
- REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
- xfree(pPriv);
- }
- }
- xfree(pAdaptor->pPorts);
- }
-
- if(pAdaptor->nAttributes) {
- XvAttributePtr pAttribute = pAdaptor->pAttributes;
-
- for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
- xfree(pAttribute->name);
- xfree(pAdaptor->pAttributes);
- }
-
- xfree(pAdaptor->pImages);
- xfree(pAdaptor->devPriv.ptr);
-}
-
-static Bool
-xf86XVInitAdaptors(
- ScreenPtr pScreen,
- XF86VideoAdaptorPtr *infoPtr,
- int number
-) {
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XF86VideoAdaptorPtr adaptorPtr;
- XvAdaptorPtr pAdaptor, pa;
- XvAdaptorRecPrivatePtr adaptorPriv;
- int na, numAdaptor;
- XvPortRecPrivatePtr portPriv;
- XvPortPtr pPort, pp;
- int numPort;
- XF86AttributePtr attributePtr;
- XvAttributePtr pAttribute, pat;
- XF86VideoFormatPtr formatPtr;
- XvFormatPtr pFormat, pf;
- int numFormat, totFormat;
- XF86VideoEncodingPtr encodingPtr;
- XvEncodingPtr pEncode, pe;
- XF86ImagePtr imagePtr;
- XvImagePtr pImage, pi;
- int numVisuals;
- VisualPtr pVisual;
- int i;
-
- pxvs->nAdaptors = 0;
- pxvs->pAdaptors = NULL;
-
- if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
- return FALSE;
-
- for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
- adaptorPtr = infoPtr[na];
-
- if(!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute ||
- !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize)
- continue;
-
- /* client libs expect at least one encoding */
- if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
- continue;
-
- pa->type = adaptorPtr->type;
-
- if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
- pa->type &= ~XvVideoMask;
-
- if(!adaptorPtr->PutStill && !adaptorPtr->GetStill)
- pa->type &= ~XvStillMask;
-
- if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
- pa->type &= ~XvImageMask;
-
- if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
- !adaptorPtr->PutStill)
- pa->type &= ~XvInputMask;
-
- if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
- pa->type &= ~XvOutputMask;
-
- if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
- continue;
- if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
- continue;
-
- pa->pScreen = pScreen;
- pa->ddAllocatePort = xf86XVAllocatePort;
- pa->ddFreePort = xf86XVFreePort;
- pa->ddPutVideo = xf86XVPutVideo;
- pa->ddPutStill = xf86XVPutStill;
- pa->ddGetVideo = xf86XVGetVideo;
- pa->ddGetStill = xf86XVGetStill;
- pa->ddStopVideo = xf86XVStopVideo;
- pa->ddPutImage = xf86XVPutImage;
- pa->ddSetPortAttribute = xf86XVSetPortAttribute;
- pa->ddGetPortAttribute = xf86XVGetPortAttribute;
- pa->ddQueryBestSize = xf86XVQueryBestSize;
- pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
- if((pa->name = xalloc(strlen(adaptorPtr->name) + 1)))
- strcpy(pa->name, adaptorPtr->name);
-
- if(adaptorPtr->nEncodings &&
- (pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
-
- for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
- i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
- {
- pe->id = encodingPtr->id;
- pe->pScreen = pScreen;
- if((pe->name = xalloc(strlen(encodingPtr->name) + 1)))
- strcpy(pe->name, encodingPtr->name);
- pe->width = encodingPtr->width;
- pe->height = encodingPtr->height;
- pe->rate.numerator = encodingPtr->rate.numerator;
- pe->rate.denominator = encodingPtr->rate.denominator;
- }
- pa->nEncodings = adaptorPtr->nEncodings;
- pa->pEncodings = pEncode;
- }
-
- if(adaptorPtr->nImages &&
- (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
-
- for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
- i < adaptorPtr->nImages; i++, pi++, imagePtr++)
- {
- pi->id = imagePtr->id;
- pi->type = imagePtr->type;
- pi->byte_order = imagePtr->byte_order;
- memcpy(pi->guid, imagePtr->guid, 16);
- pi->bits_per_pixel = imagePtr->bits_per_pixel;
- pi->format = imagePtr->format;
- pi->num_planes = imagePtr->num_planes;
- pi->depth = imagePtr->depth;
- pi->red_mask = imagePtr->red_mask;
- pi->green_mask = imagePtr->green_mask;
- pi->blue_mask = imagePtr->blue_mask;
- pi->y_sample_bits = imagePtr->y_sample_bits;
- pi->u_sample_bits = imagePtr->u_sample_bits;
- pi->v_sample_bits = imagePtr->v_sample_bits;
- pi->horz_y_period = imagePtr->horz_y_period;
- pi->horz_u_period = imagePtr->horz_u_period;
- pi->horz_v_period = imagePtr->horz_v_period;
- pi->vert_y_period = imagePtr->vert_y_period;
- pi->vert_u_period = imagePtr->vert_u_period;
- pi->vert_v_period = imagePtr->vert_v_period;
- memcpy(pi->component_order, imagePtr->component_order, 32);
- pi->scanline_order = imagePtr->scanline_order;
- }
- pa->nImages = adaptorPtr->nImages;
- pa->pImages = pImage;
- }
-
- if(adaptorPtr->nAttributes &&
- (pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
- {
- for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
- i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
- {
- pat->flags = attributePtr->flags;
- pat->min_value = attributePtr->min_value;
- pat->max_value = attributePtr->max_value;
- if((pat->name = xalloc(strlen(attributePtr->name) + 1)))
- strcpy(pat->name, attributePtr->name);
- }
- pa->nAttributes = adaptorPtr->nAttributes;
- pa->pAttributes = pAttribute;
- }
-
-
- totFormat = adaptorPtr->nFormats;
-
- if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
- }
- for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
- i < adaptorPtr->nFormats; i++, formatPtr++)
- {
- numVisuals = pScreen->numVisuals;
- pVisual = pScreen->visuals;
-
- while(numVisuals--) {
- if((pVisual->class == formatPtr->class) &&
- (pVisual->nplanes == formatPtr->depth)) {
-
- if(numFormat >= totFormat) {
- void *moreSpace;
- totFormat *= 2;
- moreSpace = xrealloc(pFormat,
- totFormat * sizeof(XvFormatRec));
- if(!moreSpace) break;
- pFormat = moreSpace;
- pf = pFormat + numFormat;
- }
-
- pf->visual = pVisual->vid;
- pf->depth = formatPtr->depth;
-
- pf++;
- numFormat++;
- }
- pVisual++;
- }
- }
- pa->nFormats = numFormat;
- pa->pFormats = pFormat;
- if(!numFormat) {
- xf86XVFreeAdaptor(pa);
- continue;
- }
-
- if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) {
- xf86XVFreeAdaptor(pa);
- continue;
- }
-
- adaptorPriv->flags = adaptorPtr->flags;
- adaptorPriv->PutVideo = adaptorPtr->PutVideo;
- adaptorPriv->PutStill = adaptorPtr->PutStill;
- adaptorPriv->GetVideo = adaptorPtr->GetVideo;
- adaptorPriv->GetStill = adaptorPtr->GetStill;
- adaptorPriv->StopVideo = adaptorPtr->StopVideo;
- adaptorPriv->SetPortAttribute = adaptorPtr->SetPortAttribute;
- adaptorPriv->GetPortAttribute = adaptorPtr->GetPortAttribute;
- adaptorPriv->QueryBestSize = adaptorPtr->QueryBestSize;
- adaptorPriv->QueryImageAttributes = adaptorPtr->QueryImageAttributes;
- adaptorPriv->PutImage = adaptorPtr->PutImage;
- adaptorPriv->ReputImage = adaptorPtr->ReputImage;
-
- pa->devPriv.ptr = (pointer)adaptorPriv;
-
- if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
- }
- for(pp = pPort, i = 0, numPort = 0;
- i < adaptorPtr->nPorts; i++) {
-
- if(!(pp->id = FakeClientID(0)))
- continue;
-
- if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
- continue;
-
- if(!AddResource(pp->id, PortResource, pp)) {
- xfree(portPriv);
- continue;
- }
-
- pp->pAdaptor = pa;
- pp->pNotify = (XvPortNotifyPtr)NULL;
- pp->pDraw = (DrawablePtr)NULL;
- pp->client = (ClientPtr)NULL;
- pp->grab.client = (ClientPtr)NULL;
- pp->time = currentTime;
- pp->devPriv.ptr = portPriv;
-
- portPriv->pScrn = pScrn;
- portPriv->AdaptorRec = adaptorPriv;
- portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
-
- pp++;
- numPort++;
- }
- pa->nPorts = numPort;
- pa->pPorts = pPort;
- if(!numPort) {
- xf86XVFreeAdaptor(pa);
- continue;
- }
-
- pa->base_id = pPort->id;
-
- pa++;
- numAdaptor++;
- }
-
- if(numAdaptor) {
- pxvs->nAdaptors = numAdaptor;
- pxvs->pAdaptors = pAdaptor;
- } else {
- xfree(pAdaptor);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* Video should be clipped to the intersection of the window cliplist
- and the client cliplist specified in the GC for which the video was
- initialized. When we need to reclip a window, the GC that started
- the video may not even be around anymore. That's why we save the
- client clip from the GC when the video is initialized. We then
- use xf86XVUpdateCompositeClip to calculate the new composite clip
- when we need it. This is different from what DEC did. They saved
- the GC and used it's clip list when they needed to reclip the window,
- even if the client clip was different from the one the video was
- initialized with. If the original GC was destroyed, they had to stop
- the video. I like the new method better (MArk).
-
- This function only works for windows. Will need to rewrite when
- (if) we support pixmap rendering.
-*/
-
-static void
-xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
-{
- RegionPtr pregWin, pCompositeClip;
- WindowPtr pWin;
- ScreenPtr pScreen;
- Bool freeCompClip = FALSE;
-
- if(portPriv->pCompositeClip)
- return;
-
- pWin = (WindowPtr)portPriv->pDraw;
- pScreen = pWin->drawable.pScreen;
-
- /* get window clip list */
- if(portPriv->subWindowMode == IncludeInferiors) {
- pregWin = NotClippedByChildren(pWin);
- freeCompClip = TRUE;
- } else
- pregWin = &pWin->clipList;
-
- if(!portPriv->clientClip) {
- portPriv->pCompositeClip = pregWin;
- portPriv->FreeCompositeClip = freeCompClip;
- return;
- }
-
- pCompositeClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip);
- REGION_TRANSLATE(pScreen, pCompositeClip,
- portPriv->pDraw->x + portPriv->clipOrg.x,
- portPriv->pDraw->y + portPriv->clipOrg.y);
- REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip);
-
- portPriv->pCompositeClip = pCompositeClip;
- portPriv->FreeCompositeClip = TRUE;
-
- if(freeCompClip) {
- REGION_DESTROY(pScreen, pregWin);
- }
-}
-
-/* Save the current clientClip and update the CompositeClip whenever
- we have a fresh GC */
-
-static void
-xf86XVCopyClip(
- XvPortRecPrivatePtr portPriv,
- GCPtr pGC
-){
- ScreenPtr pScreen = pGC->pScreen;
-
- /* copy the new clip if it exists */
- if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
- if(!portPriv->clientClip)
- portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1);
- /* Note: this is in window coordinates */
- REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip);
- } else if(portPriv->clientClip) { /* free the old clientClip */
- REGION_DESTROY(pScreen, portPriv->clientClip);
- portPriv->clientClip = NULL;
- }
-
- /* get rid of the old clip list */
- if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
- REGION_DESTROY(pScreen, portPriv->pCompositeClip);
- }
-
- portPriv->clipOrg = pGC->clipOrg;
- portPriv->pCompositeClip = pGC->pCompositeClip;
- portPriv->FreeCompositeClip = FALSE;
- portPriv->subWindowMode = pGC->subWindowMode;
-}
-
-static int
-xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
-{
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- ScreenPtr pScreen;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- pScreen = portPriv->pDraw->pScreen;
- xf86XVUpdateCompositeClip(portPriv);
-
- /* translate the video region to the screen */
- WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
- WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
- WinBox.x2 = WinBox.x1 + portPriv->drw_w;
- WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
- /* clip to the window composite clip */
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
-
- /* that's all if it's totally obscured */
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto CLIP_VIDEO_BAILOUT;
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
- portPriv->vid_x, portPriv->vid_y,
- WinBox.x1, WinBox.y1,
- portPriv->vid_w, portPriv->vid_h,
- portPriv->drw_w, portPriv->drw_h,
- &ClipRegion, portPriv->DevPriv.ptr);
-
- if(ret == Success)
- portPriv->isOn = XV_ON;
-
-CLIP_VIDEO_BAILOUT:
-
- if((clippedAway || (ret != Success)) && portPriv->isOn == XV_ON) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- /* This clip was copied and only good for one shot */
- if(!portPriv->FreeCompositeClip)
- portPriv->pCompositeClip = NULL;
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-
-static int
-xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
-{
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- ScreenPtr pScreen;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- pScreen = portPriv->pDraw->pScreen;
-
- xf86XVUpdateCompositeClip(portPriv);
-
- /* translate the video region to the screen */
- WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
- WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
- WinBox.x2 = WinBox.x1 + portPriv->drw_w;
- WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
- /* clip to the window composite clip */
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
-
- /* clip and translate to the viewport */
- if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
- RegionRec VPReg;
- BoxRec VPBox;
-
- VPBox.x1 = portPriv->pScrn->frameX0;
- VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
- VPBox.y2 = portPriv->pScrn->frameY1;
-
- REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
- REGION_UNINIT(pScreen, &VPReg);
- }
-
- /* that's all if it's totally obscured */
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto CLIP_VIDEO_BAILOUT;
- }
-
- /* bailout if we have to clip but the hardware doesn't support it */
- if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
- BoxPtr clipBox = REGION_RECTS(&ClipRegion);
- if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
- {
- clippedAway = TRUE;
- goto CLIP_VIDEO_BAILOUT;
- }
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
- portPriv->vid_x, portPriv->vid_y,
- WinBox.x1, WinBox.y1,
- portPriv->vid_w, portPriv->vid_h,
- portPriv->drw_w, portPriv->drw_h,
- &ClipRegion, portPriv->DevPriv.ptr);
-
- if(ret == Success) portPriv->isOn = XV_ON;
-
-CLIP_VIDEO_BAILOUT:
-
- if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- /* This clip was copied and only good for one shot */
- if(!portPriv->FreeCompositeClip)
- portPriv->pCompositeClip = NULL;
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-static int
-xf86XVReputImage(XvPortRecPrivatePtr portPriv)
-{
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- ScreenPtr pScreen;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- pScreen = portPriv->pDraw->pScreen;
-
- xf86XVUpdateCompositeClip(portPriv);
-
- /* translate the video region to the screen */
- WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
- WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
- WinBox.x2 = WinBox.x1 + portPriv->drw_w;
- WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
- /* clip to the window composite clip */
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
-
- /* clip and translate to the viewport */
- if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
- RegionRec VPReg;
- BoxRec VPBox;
-
- VPBox.x1 = portPriv->pScrn->frameX0;
- VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
- VPBox.y2 = portPriv->pScrn->frameY1;
-
- REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
- REGION_UNINIT(pScreen, &VPReg);
- }
-
- /* that's all if it's totally obscured */
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto CLIP_VIDEO_BAILOUT;
- }
-
- /* bailout if we have to clip but the hardware doesn't support it */
- if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
- BoxPtr clipBox = REGION_RECTS(&ClipRegion);
- if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
- {
- clippedAway = TRUE;
- goto CLIP_VIDEO_BAILOUT;
- }
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
- WinBox.x1, WinBox.y1,
- &ClipRegion, portPriv->DevPriv.ptr);
-
- portPriv->isOn = (ret == Success) ? XV_ON : XV_OFF;
-
-CLIP_VIDEO_BAILOUT:
-
- if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- /* This clip was copied and only good for one shot */
- if(!portPriv->FreeCompositeClip)
- portPriv->pCompositeClip = NULL;
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-
-static int
-xf86XVReputAllVideo(WindowPtr pWin, pointer data)
-{
- XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
-
- while(WinPriv) {
- if(WinPriv->PortRec->type == XvInputMask)
- xf86XVReputVideo(WinPriv->PortRec);
- else
- xf86XVRegetVideo(WinPriv->PortRec);
- WinPriv = WinPriv->next;
- }
-
- return WT_WALKCHILDREN;
-}
-
-static int
-xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
-{
- XF86XVWindowPtr winPriv, PrivRoot;
-
- winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin);
-
- /* Enlist our port in the window private */
- while(winPriv) {
- if(winPriv->PortRec == portPriv) /* we're already listed */
- break;
- winPriv = winPriv->next;
- }
-
- if(!winPriv) {
- winPriv = xalloc(sizeof(XF86XVWindowRec));
- if(!winPriv) return BadAlloc;
- winPriv->PortRec = portPriv;
- winPriv->next = PrivRoot;
- pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
- }
- return Success;
-}
-
-
-static void
-xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
-{
- XF86XVWindowPtr winPriv, prevPriv = NULL;
-
- winPriv = GET_XF86XV_WINDOW(pWin);
-
- while(winPriv) {
- if(winPriv->PortRec == portPriv) {
- if(prevPriv)
- prevPriv->next = winPriv->next;
- else
- pWin->devPrivates[XF86XVWindowIndex].ptr =
- (pointer)winPriv->next;
- xfree(winPriv);
- break;
- }
- prevPriv = winPriv;
- winPriv = winPriv->next;
- }
- portPriv->pDraw = NULL;
-}
-
-/**** ScreenRec fields ****/
-
-static Bool
-xf86XVDestroyWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- XF86XVWindowPtr tmp, WinPriv = GET_XF86XV_WINDOW(pWin);
- int ret;
-
- while(WinPriv) {
- XvPortRecPrivatePtr pPriv = WinPriv->PortRec;
-
- if(pPriv->isOn > XV_OFF) {
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, TRUE);
- pPriv->isOn = XV_OFF;
- }
-
- pPriv->pDraw = NULL;
- tmp = WinPriv;
- WinPriv = WinPriv->next;
- xfree(tmp);
- }
-
- pWin->devPrivates[XF86XVWindowIndex].ptr = NULL;
-
- pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
- ret = (*pScreen->DestroyWindow)(pWin);
- pScreen->DestroyWindow = xf86XVDestroyWindow;
-
- return ret;
-}
-
-
-static void
-xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
- XF86XVWindowPtr pPrev;
- XvPortRecPrivatePtr pPriv;
- Bool AreasExposed;
-
- AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1));
-
- pScreen->WindowExposures = ScreenPriv->WindowExposures;
- (*pScreen->WindowExposures)(pWin, reg1, reg2);
- pScreen->WindowExposures = xf86XVWindowExposures;
-
- /* filter out XClearWindow/Area */
- if (!pWin->valdata) return;
-
- pPrev = NULL;
-
- while(WinPriv) {
- pPriv = WinPriv->PortRec;
-
- /* Reput anyone with a reput function */
-
- switch(pPriv->type) {
- case XvInputMask:
- xf86XVReputVideo(pPriv);
- break;
- case XvOutputMask:
- xf86XVRegetVideo(pPriv);
- break;
- default: /* overlaid still/image*/
- if (pPriv->AdaptorRec->ReputImage)
- xf86XVReputImage(pPriv);
- else if(AreasExposed) {
- XF86XVWindowPtr tmp;
-
- if (pPriv->isOn == XV_ON) {
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
- pPriv->isOn = XV_PENDING;
- }
- pPriv->pDraw = NULL;
-
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
- (pointer)(WinPriv->next);
- else
- pPrev->next = WinPriv->next;
- tmp = WinPriv;
- WinPriv = WinPriv->next;
- xfree(tmp);
- continue;
- }
- break;
- }
- pPrev = WinPriv;
- WinPriv = WinPriv->next;
- }
-}
-
-
-static void
-xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
- XF86XVWindowPtr tmp, pPrev = NULL;
- XvPortRecPrivatePtr pPriv;
- Bool visible = (pWin->visibility == VisibilityUnobscured) ||
- (pWin->visibility == VisibilityPartiallyObscured);
-
- while(WinPriv) {
- pPriv = WinPriv->PortRec;
-
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
- REGION_DESTROY(pScreen, pPriv->pCompositeClip);
-
- pPriv->pCompositeClip = NULL;
-
- /* Stop everything except images, but stop them too if the
- window isn't visible. But we only remove the images. */
-
- if(pPriv->type || !visible) {
- if(pPriv->isOn == XV_ON) {
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
- pPriv->isOn = XV_PENDING;
- }
-
- if(!pPriv->type) { /* overlaid still/image */
- pPriv->pDraw = NULL;
-
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
- (pointer)(WinPriv->next);
- else
- pPrev->next = WinPriv->next;
- tmp = WinPriv;
- WinPriv = WinPriv->next;
- xfree(tmp);
- continue;
- }
- }
-
- pPrev = WinPriv;
- WinPriv = WinPriv->next;
- }
-
- if(ScreenPriv->ClipNotify) {
- pScreen->ClipNotify = ScreenPriv->ClipNotify;
- (*pScreen->ClipNotify)(pWin, dx, dy);
- pScreen->ClipNotify = xf86XVClipNotify;
- }
-}
-
-
-
-/**** Required XvScreenRec fields ****/
-
-static Bool
-xf86XVCloseScreen(int i, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- XvAdaptorPtr pa;
- int c;
-
- /* Clear offscreen images */
- (void)memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0]));
-
- if(!ScreenPriv) return TRUE;
-
- if(ScreenPriv->videoGC) {
- FreeGC(ScreenPriv->videoGC, 0);
- ScreenPriv->videoGC = NULL;
- }
-
- pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
- pScreen->WindowExposures = ScreenPriv->WindowExposures;
- pScreen->ClipNotify = ScreenPriv->ClipNotify;
-
- pScrn->EnterVT = ScreenPriv->EnterVT;
- pScrn->LeaveVT = ScreenPriv->LeaveVT;
- pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
-
- for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
- xf86XVFreeAdaptor(pa);
- }
-
- xfree(pxvs->pAdaptors);
- xfree(ScreenPriv);
- return TRUE;
-}
-
-
-static int
-xf86XVQueryAdaptors(
- ScreenPtr pScreen,
- XvAdaptorPtr *p_pAdaptors,
- int *p_nAdaptors
-){
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
-
- *p_nAdaptors = pxvs->nAdaptors;
- *p_pAdaptors = pxvs->pAdaptors;
-
- return (Success);
-}
-
-
-/**** ScrnInfoRec fields ****/
-
-static Bool
-xf86XVEnterVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- Bool ret;
-
- ret = (*ScreenPriv->EnterVT)(index, flags);
-
- if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
-
- return ret;
-}
-
-static void
-xf86XVLeaveVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- XvAdaptorPtr pAdaptor;
- XvPortPtr pPort;
- XvPortRecPrivatePtr pPriv;
- int i, j;
-
- for(i = 0; i < pxvs->nAdaptors; i++) {
- pAdaptor = &pxvs->pAdaptors[i];
- for(j = 0; j < pAdaptor->nPorts; j++) {
- pPort = &pAdaptor->pPorts[j];
- pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
- if(pPriv->isOn > XV_OFF) {
-
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, TRUE);
- pPriv->isOn = XV_OFF;
-
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
- REGION_DESTROY(pScreen, pPriv->pCompositeClip);
-
- pPriv->pCompositeClip = NULL;
-
- if(!pPriv->type && pPriv->pDraw) { /* still */
- xf86XVRemovePortFromWindow((WindowPtr)pPriv->pDraw, pPriv);
- }
- }
- }
- }
-
- (*ScreenPriv->LeaveVT)(index, flags);
-}
-
-static void
-xf86XVAdjustFrame(int index, int x, int y, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[index];
- ScreenPtr pScreen = pScrn->pScreen;
- XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- WindowPtr pWin;
- XvAdaptorPtr pa;
- int c, i;
-
- if(ScreenPriv->AdjustFrame) {
- pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
- (*pScrn->AdjustFrame)(index, x, y, flags);
- pScrn->AdjustFrame = xf86XVAdjustFrame;
- }
-
- for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
- XvPortPtr pPort = pa->pPorts;
- XvPortRecPrivatePtr pPriv;
-
- for(i = pa->nPorts; i > 0; i--, pPort++) {
- pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
-
- if(!pPriv->type && (pPriv->isOn == XV_ON)) { /* overlaid still/image */
-
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
- REGION_DESTROY(pScreen, pPriv->pCompositeClip);
-
- pPriv->pCompositeClip = NULL;
-
- pWin = (WindowPtr)pPriv->pDraw;
-
- if ((pPriv->AdaptorRec->ReputImage) &&
- ((pWin->visibility == VisibilityUnobscured) ||
- (pWin->visibility == VisibilityPartiallyObscured)))
- {
- xf86XVReputImage(pPriv);
- } else {
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
- xf86XVRemovePortFromWindow(pWin, pPriv);
- pPriv->isOn = XV_PENDING;
- continue;
- }
- }
- }
- }
-}
-
-
-/**** XvAdaptorRec fields ****/
-
-static int
-xf86XVAllocatePort(
- unsigned long port,
- XvPortPtr pPort,
- XvPortPtr *ppPort
-){
- *ppPort = pPort;
- return Success;
-}
-
-
-
-static int
-xf86XVFreePort(XvPortPtr pPort)
-{
- return Success;
-}
-
-
-static int
-xf86XVPutVideo(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- int result;
-
- /* No dumping video to pixmaps... For now anyhow */
- if(pDraw->type != DRAWABLE_WINDOW) {
- pPort->pDraw = (DrawablePtr)NULL;
- return BadAlloc;
- }
-
- /* If we are changing windows, unregister our port in the old window */
- if(portPriv->pDraw && (portPriv->pDraw != pDraw))
- xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
-
- /* Register our port with the new window */
- result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
- if(result != Success) return result;
-
- portPriv->pDraw = pDraw;
- portPriv->type = XvInputMask;
-
- /* save a copy of these parameters */
- portPriv->vid_x = vid_x; portPriv->vid_y = vid_y;
- portPriv->vid_w = vid_w; portPriv->vid_h = vid_h;
- portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
- portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
-
- /* make sure we have the most recent copy of the clientClip */
- xf86XVCopyClip(portPriv, pGC);
-
- /* To indicate to the DI layer that we were successful */
- pPort->pDraw = pDraw;
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- return(xf86XVReputVideo(portPriv));
-}
-
-static int
-xf86XVPutStill(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- ScreenPtr pScreen;
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- if (pDraw->type != DRAWABLE_WINDOW)
- return BadAlloc;
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- pScreen = pDraw->pScreen;
-
- WinBox.x1 = pDraw->x + drw_x;
- WinBox.y1 = pDraw->y + drw_y;
- WinBox.x2 = WinBox.x1 + drw_w;
- WinBox.y2 = WinBox.y1 + drw_h;
-
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
-
- if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
- RegionRec VPReg;
- BoxRec VPBox;
-
- VPBox.x1 = portPriv->pScrn->frameX0;
- VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
- VPBox.y2 = portPriv->pScrn->frameY1;
-
- REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
- REGION_UNINIT(pScreen, &VPReg);
- }
-
- if(portPriv->pDraw) {
- xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
- }
-
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto PUT_STILL_BAILOUT;
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
- BoxPtr clipBox = REGION_RECTS(&ClipRegion);
- if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
- {
- clippedAway = TRUE;
- goto PUT_STILL_BAILOUT;
- }
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
- vid_x, vid_y, WinBox.x1, WinBox.y1,
- vid_w, vid_h, drw_w, drw_h,
- &ClipRegion, portPriv->DevPriv.ptr);
-
- if((ret == Success) &&
- (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_STILLS)) {
-
- xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
- portPriv->isOn = XV_ON;
- portPriv->pDraw = pDraw;
- portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
- portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
- portPriv->type = 0; /* no mask means it's transient and should
- not be reput once it's removed */
- pPort->pDraw = pDraw; /* make sure we can get stop requests */
- }
-
-PUT_STILL_BAILOUT:
-
- if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-static int
-xf86XVGetVideo(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- int result;
-
- /* No pixmaps... For now anyhow */
- if(pDraw->type != DRAWABLE_WINDOW) {
- pPort->pDraw = (DrawablePtr)NULL;
- return BadAlloc;
- }
-
- /* If we are changing windows, unregister our port in the old window */
- if(portPriv->pDraw && (portPriv->pDraw != pDraw))
- xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
-
- /* Register our port with the new window */
- result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
- if(result != Success) return result;
-
- portPriv->pDraw = pDraw;
- portPriv->type = XvOutputMask;
-
- /* save a copy of these parameters */
- portPriv->vid_x = vid_x; portPriv->vid_y = vid_y;
- portPriv->vid_w = vid_w; portPriv->vid_h = vid_h;
- portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
- portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
-
- /* make sure we have the most recent copy of the clientClip */
- xf86XVCopyClip(portPriv, pGC);
-
- /* To indicate to the DI layer that we were successful */
- pPort->pDraw = pDraw;
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- return(xf86XVRegetVideo(portPriv));
-}
-
-static int
-xf86XVGetStill(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- ScreenPtr pScreen;
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- if (pDraw->type != DRAWABLE_WINDOW)
- return BadAlloc;
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- pScreen = pDraw->pScreen;
-
- WinBox.x1 = pDraw->x + drw_x;
- WinBox.y1 = pDraw->y + drw_y;
- WinBox.x2 = WinBox.x1 + drw_w;
- WinBox.y2 = WinBox.y1 + drw_h;
-
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
-
- if(portPriv->pDraw) {
- xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
- }
-
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto GET_STILL_BAILOUT;
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn,
- vid_x, vid_y, WinBox.x1, WinBox.y1,
- vid_w, vid_h, drw_w, drw_h,
- &ClipRegion, portPriv->DevPriv.ptr);
-
-GET_STILL_BAILOUT:
-
- if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-
-
-static int
-xf86XVStopVideo(
- ClientPtr client,
- XvPortPtr pPort,
- DrawablePtr pDraw
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- if(pDraw->type != DRAWABLE_WINDOW)
- return BadAlloc;
-
- xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- /* Must free resources. */
-
- if(portPriv->isOn > XV_OFF) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, TRUE);
- portPriv->isOn = XV_OFF;
- }
-
- return Success;
-}
-
-static int
-xf86XVSetPortAttribute(
- ClientPtr client,
- XvPortPtr pPort,
- Atom attribute,
- INT32 value
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
- attribute, value, portPriv->DevPriv.ptr));
-}
-
-
-static int
-xf86XVGetPortAttribute(
- ClientPtr client,
- XvPortPtr pPort,
- Atom attribute,
- INT32 *p_value
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
- attribute, p_value, portPriv->DevPriv.ptr));
-}
-
-
-
-static int
-xf86XVQueryBestSize(
- ClientPtr client,
- XvPortPtr pPort,
- CARD8 motion,
- CARD16 vid_w, CARD16 vid_h,
- CARD16 drw_w, CARD16 drw_h,
- unsigned int *p_w, unsigned int *p_h
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
- (Bool)motion, vid_w, vid_h, drw_w, drw_h,
- p_w, p_h, portPriv->DevPriv.ptr);
-
- return Success;
-}
-
-
-static int
-xf86XVPutImage(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
- GCPtr pGC,
- INT16 src_x, INT16 src_y,
- CARD16 src_w, CARD16 src_h,
- INT16 drw_x, INT16 drw_y,
- CARD16 drw_w, CARD16 drw_h,
- XvImagePtr format,
- unsigned char* data,
- Bool sync,
- CARD16 width, CARD16 height
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- ScreenPtr pScreen;
- RegionRec WinRegion;
- RegionRec ClipRegion;
- BoxRec WinBox;
- int ret = Success;
- Bool clippedAway = FALSE;
-
- if (pDraw->type != DRAWABLE_WINDOW)
- return BadAlloc;
-
- if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
-
- pScreen = pDraw->pScreen;
-
- WinBox.x1 = pDraw->x + drw_x;
- WinBox.y1 = pDraw->y + drw_y;
- WinBox.x2 = WinBox.x1 + drw_w;
- WinBox.y2 = WinBox.y1 + drw_h;
-
- REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_NULL(pScreen, &ClipRegion);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
-
- if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
- RegionRec VPReg;
- BoxRec VPBox;
-
- VPBox.x1 = portPriv->pScrn->frameX0;
- VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1 + 1;
- VPBox.y2 = portPriv->pScrn->frameY1 + 1;
-
- REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
- REGION_UNINIT(pScreen, &VPReg);
- }
-
- if(portPriv->pDraw) {
- xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
- }
-
- if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
- clippedAway = TRUE;
- goto PUT_IMAGE_BAILOUT;
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
- BoxPtr clipBox = REGION_RECTS(&ClipRegion);
- if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
- {
- clippedAway = TRUE;
- goto PUT_IMAGE_BAILOUT;
- }
- }
-
- if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
- REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
- }
-
- ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
- src_x, src_y, WinBox.x1, WinBox.y1,
- src_w, src_h, drw_w, drw_h, format->id, data, width, height,
- sync, &ClipRegion, portPriv->DevPriv.ptr);
-
- if((ret == Success) &&
- (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
-
- xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
- portPriv->isOn = XV_ON;
- portPriv->pDraw = pDraw;
- portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
- portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
- portPriv->type = 0; /* no mask means it's transient and should
- not be reput once it's removed */
- pPort->pDraw = pDraw; /* make sure we can get stop requests */
- }
-
-PUT_IMAGE_BAILOUT:
-
- if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
- }
-
- REGION_UNINIT(pScreen, &WinRegion);
- REGION_UNINIT(pScreen, &ClipRegion);
-
- return ret;
-}
-
-
-static int
-xf86XVQueryImageAttributes(
- ClientPtr client,
- XvPortPtr pPort,
- XvImagePtr format,
- CARD16 *width,
- CARD16 *height,
- int *pitches,
- int *offsets
-){
- XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
- format->id, width, height, pitches, offsets);
-}
-
-void
-xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
-{
- XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
- DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
- XID pval[2];
- BoxPtr pbox = REGION_RECTS(clipboxes);
- int i, nbox = REGION_NUM_RECTS(clipboxes);
- xRectangle *rects;
-
- if(!xf86Screens[pScreen->myNum]->vtSema) return;
-
- if(!ScreenPriv->videoGC) {
- int status;
- pval[0] = key;
- pval[1] = IncludeInferiors;
- ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
- pval, &status);
- if(!ScreenPriv->videoGC) return;
- ValidateGC(root, ScreenPriv->videoGC);
- } else if (key != ScreenPriv->videoGC->fgPixel){
- pval[0] = key;
- ChangeGC(ScreenPriv->videoGC, GCForeground, pval);
- ValidateGC(root, ScreenPriv->videoGC);
- }
-
- rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
-
- for(i = 0; i < nbox; i++, pbox++) {
- rects[i].x = pbox->x1;
- rects[i].y = pbox->y1;
- rects[i].width = pbox->x2 - pbox->x1;
- rects[i].height = pbox->y2 - pbox->y1;
- }
-
- (*ScreenPriv->videoGC->ops->PolyFillRect)(
- root, ScreenPriv->videoGC, nbox, rects);
-
- DEALLOCATE_LOCAL(rects);
-}
-
-/* xf86XVClipVideoHelper -
-
- Takes the dst box in standard X BoxRec form (top and left
- edges inclusive, bottom and right exclusive). The new dst
- box is returned. The source boundaries are given (x1, y1
- inclusive, x2, y2 exclusive) and returned are the new source
- boundaries in 16.16 fixed point.
-*/
-
-#define DummyScreen screenInfo.screens[0]
-
-Bool
-xf86XVClipVideoHelper(
- BoxPtr dst,
- INT32 *xa,
- INT32 *xb,
- INT32 *ya,
- INT32 *yb,
- RegionPtr reg,
- INT32 width,
- INT32 height
-){
- double xsw, xdw, ysw, ydw;
- INT32 delta;
- BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
- int diff;
-
- xsw = (*xb - *xa) << 16;
- xdw = dst->x2 - dst->x1;
- ysw = (*yb - *ya) << 16;
- ydw = dst->y2 - dst->y1;
-
- *xa <<= 16; *xb <<= 16;
- *ya <<= 16; *yb <<= 16;
-
- diff = extents->x1 - dst->x1;
- if (diff > 0) {
- dst->x1 = extents->x1;
- *xa += (diff * xsw) / xdw;
- }
- diff = dst->x2 - extents->x2;
- if (diff > 0) {
- dst->x2 = extents->x2;
- *xb -= (diff * xsw) / xdw;
- }
- diff = extents->y1 - dst->y1;
- if (diff > 0) {
- dst->y1 = extents->y1;
- *ya += (diff * ysw) / ydw;
- }
- diff = dst->y2 - extents->y2;
- if (diff > 0) {
- dst->y2 = extents->y2;
- *yb -= (diff * ysw) / ydw;
- }
-
- if (*xa < 0) {
- diff = (((-*xa) * xdw) + xsw - 1) / xsw;
- dst->x1 += diff;
- *xa += (diff * xsw) / xdw;
- }
- delta = *xb - (width << 16);
- if (delta > 0) {
- diff = ((delta * xdw) + xsw - 1) / xsw;
- dst->x2 -= diff;
- *xb -= (diff * xsw) / xdw;
- }
- if (*xa >= *xb) return FALSE;
-
- if (*ya < 0) {
- diff = (((-*ya) * ydw) + ysw - 1) / ysw;
- dst->y1 += diff;
- *ya += (diff * ysw) / ydw;
- }
- delta = *yb - (height << 16);
- if (delta > 0) {
- diff = ((delta * ydw) + ysw - 1) / ysw;
- dst->y2 -= diff;
- *yb -= (diff * ysw) / ydw;
- }
- if (*ya >= *yb) return FALSE;
-
- if ((dst->x1 > extents->x1) || (dst->x2 < extents->x2) ||
- (dst->y1 > extents->y1) || (dst->y2 < extents->y2))
- {
- RegionRec clipReg;
- REGION_INIT(DummyScreen, &clipReg, dst, 1);
- REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
- REGION_UNINIT(DummyScreen, &clipReg);
- }
- return TRUE;
-}
-
-void
-xf86XVCopyYUV12ToPacked(
- const void *srcy,
- const void *srcv,
- const void *srcu,
- void *dst,
- int srcPitchy,
- int srcPitchuv,
- int dstPitch,
- int h,
- int w
-){
- CARD32 *Dst;
- const CARD8 *Y, *U, *V;
- int i, j;
-
- w >>= 1;
-
- for (j = 0; j < h; j++) {
- Dst = dst;
- Y = srcy; V = srcv; U = srcu;
- i = w;
- while (i >= 4) {
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
- Dst[1] = Y[2] | (Y[3] << 16) | (U[1] << 8) | (V[1] << 24);
- Dst[2] = Y[4] | (Y[5] << 16) | (U[2] << 8) | (V[2] << 24);
- Dst[3] = Y[6] | (Y[7] << 16) | (U[3] << 8) | (V[3] << 24);
-#else
- /* This assumes a little-endian framebuffer */
- Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
- Dst[1] = (Y[2] << 24) | (Y[3] << 8) | (U[1] << 16) | Y[1];
- Dst[2] = (Y[4] << 24) | (Y[5] << 8) | (U[2] << 16) | Y[2];
- Dst[3] = (Y[6] << 24) | (Y[7] << 8) | (U[3] << 16) | Y[3];
-#endif
- Dst += 4; Y += 8; V += 4; U += 4;
- i -= 4;
- }
-
- while (i--) {
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
-#else
- /* This assumes a little-endian framebuffer */
- Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
-#endif
- Dst++; Y += 2; V++; U++;
- }
-
- dst = (CARD8 *)dst + dstPitch;
- srcy = (const CARD8 *)srcy + srcPitchy;
- if (j & 1) {
- srcu = (const CARD8 *)srcu + srcPitchuv;
- srcv = (const CARD8 *)srcv + srcPitchuv;
- }
- }
-}
-
-void
-xf86XVCopyPacked(
- const void *src,
- void *dst,
- int srcPitch,
- int dstPitch,
- int h,
- int w
-){
- const CARD32 *Src;
- CARD32 *Dst;
- int i;
-
- w >>= 1;
- while (--h >= 0) {
- do {
- Dst = dst; Src = src;
- i = w;
- while (i >= 4) {
- Dst[0] = Src[0];
- Dst[1] = Src[1];
- Dst[2] = Src[2];
- Dst[3] = Src[3];
- Dst += 4; Src += 4; i -= 4;
- }
- if (!i) break;
- Dst[0] = Src[0];
- if (i == 1) break;
- Dst[1] = Src[1];
- if (i == 2) break;
- Dst[2] = Src[2];
- } while (0);
-
- src = (const CARD8 *)src + srcPitch;
- dst = (CARD8 *)dst + dstPitch;
- }
-}
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
deleted file mode 100644
index 316d6c9e5..000000000
--- a/hw/xfree86/common/xf86xv.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.25 2003/08/24 17:36:56 dawes Exp $ */
-
-/*
- * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86XV_H_
-#define _XF86XV_H_
-
-#include "xvdix.h"
-#include "xf86str.h"
-
-#define VIDEO_NO_CLIPPING 0x00000001
-#define VIDEO_INVERT_CLIPLIST 0x00000002
-#define VIDEO_OVERLAID_IMAGES 0x00000004
-#define VIDEO_OVERLAID_STILLS 0x00000008
-#define VIDEO_CLIP_TO_VIEWPORT 0x00000010
-
-typedef struct {
- int id;
- int type;
- int byte_order;
- unsigned char guid[16];
- int bits_per_pixel;
- int format;
- int num_planes;
-
- /* for RGB formats only */
- int depth;
- unsigned int red_mask;
- unsigned int green_mask;
- unsigned int blue_mask;
-
- /* for YUV formats only */
- unsigned int y_sample_bits;
- unsigned int u_sample_bits;
- unsigned int v_sample_bits;
- unsigned int horz_y_period;
- unsigned int horz_u_period;
- unsigned int horz_v_period;
- unsigned int vert_y_period;
- unsigned int vert_u_period;
- unsigned int vert_v_period;
- char component_order[32];
- int scanline_order;
-} XF86ImageRec, *XF86ImagePtr;
-
-
-typedef struct {
- ScrnInfoPtr pScrn;
- int id;
- unsigned short width, height;
- int *pitches; /* bytes */
- int *offsets; /* in bytes from start of framebuffer */
- DevUnion devPrivate;
-} XF86SurfaceRec, *XF86SurfacePtr;
-
-
-typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn,
- short vid_x, short vid_y, short drw_x, short drw_y,
- short vid_w, short vid_h, short drw_w, short drw_h,
- RegionPtr clipBoxes, pointer data );
-typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn,
- short vid_x, short vid_y, short drw_x, short drw_y,
- short vid_w, short vid_h, short drw_w, short drw_h,
- RegionPtr clipBoxes, pointer data );
-typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn,
- short vid_x, short vid_y, short drw_x, short drw_y,
- short vid_w, short vid_h, short drw_w, short drw_h,
- RegionPtr clipBoxes, pointer data );
-typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn,
- short vid_x, short vid_y, short drw_x, short drw_y,
- short vid_w, short vid_h, short drw_w, short drw_h,
- RegionPtr clipBoxes, pointer data );
-typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool Exit);
-typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
- INT32 value, pointer data);
-typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
- INT32 *value, pointer data);
-typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, Bool motion,
- short vid_w, short vid_h, short drw_w, short drw_h,
- unsigned int *p_w, unsigned int *p_h, pointer data);
-typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn,
- short src_x, short src_y, short drw_x, short drw_y,
- short src_w, short src_h, short drw_w, short drw_h,
- int image, unsigned char* buf, short width, short height, Bool Sync,
- RegionPtr clipBoxes, pointer data );
-typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y,
- RegionPtr clipBoxes, pointer data );
-typedef int (*QueryImageAttributesFuncPtr)(ScrnInfoPtr pScrn,
- int image, unsigned short *width, unsigned short *height,
- int *pitches, int *offsets);
-
-typedef enum {
- XV_OFF,
- XV_PENDING,
- XV_ON
-} XvStatus;
-
-/*** this is what the driver needs to fill out ***/
-
-typedef struct {
- int id;
- char *name;
- unsigned short width, height;
- XvRationalRec rate;
-} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
-
-typedef struct {
- char depth;
- short class;
-} XF86VideoFormatRec, *XF86VideoFormatPtr;
-
-typedef struct {
- int flags;
- int min_value;
- int max_value;
- char *name;
-} XF86AttributeRec, *XF86AttributePtr;
-
-typedef struct {
- unsigned int type;
- int flags;
- char *name;
- int nEncodings;
- XF86VideoEncodingPtr pEncodings;
- int nFormats;
- XF86VideoFormatPtr pFormats;
- int nPorts;
- DevUnion *pPortPrivates;
- int nAttributes;
- XF86AttributePtr pAttributes;
- int nImages;
- XF86ImagePtr pImages;
- PutVideoFuncPtr PutVideo;
- PutStillFuncPtr PutStill;
- GetVideoFuncPtr GetVideo;
- GetStillFuncPtr GetStill;
- StopVideoFuncPtr StopVideo;
- SetPortAttributeFuncPtr SetPortAttribute;
- GetPortAttributeFuncPtr GetPortAttribute;
- QueryBestSizeFuncPtr QueryBestSize;
- PutImageFuncPtr PutImage;
- ReputImageFuncPtr ReputImage;
- QueryImageAttributesFuncPtr QueryImageAttributes;
-} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr;
-
-typedef struct {
- XF86ImagePtr image;
- int flags;
- int (*alloc_surface)(ScrnInfoPtr pScrn,
- int id,
- unsigned short width,
- unsigned short height,
- XF86SurfacePtr surface);
- int (*free_surface)(XF86SurfacePtr surface);
- int (*display) (XF86SurfacePtr surface,
- short vid_x, short vid_y,
- short drw_x, short drw_y,
- short vid_w, short vid_h,
- short drw_w, short drw_h,
- RegionPtr clipBoxes);
- int (*stop) (XF86SurfacePtr surface);
- int (*getAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 *value);
- int (*setAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 value);
- int max_width;
- int max_height;
- int num_attributes;
- XF86AttributePtr attributes;
-} XF86OffscreenImageRec, *XF86OffscreenImagePtr;
-
-Bool
-xf86XVScreenInit(
- ScreenPtr pScreen,
- XF86VideoAdaptorPtr *Adaptors,
- int num
-);
-
-typedef int (* xf86XVInitGenericAdaptorPtr)(ScrnInfoPtr pScrn,
- XF86VideoAdaptorPtr **Adaptors);
-
-int
-xf86XVRegisterGenericAdaptorDriver(
- xf86XVInitGenericAdaptorPtr InitFunc
-);
-
-int
-xf86XVListGenericAdaptors(
- ScrnInfoPtr pScrn,
- XF86VideoAdaptorPtr **Adaptors
-);
-
-Bool
-xf86XVRegisterOffscreenImages(
- ScreenPtr pScreen,
- XF86OffscreenImagePtr images,
- int num
-);
-
-XF86OffscreenImagePtr
-xf86XVQueryOffscreenImages(
- ScreenPtr pScreen,
- int *num
-);
-
-XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn);
-
-void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr);
-
-void
-xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes);
-
-Bool
-xf86XVClipVideoHelper(
- BoxPtr dst,
- INT32 *xa,
- INT32 *xb,
- INT32 *ya,
- INT32 *yb,
- RegionPtr reg,
- INT32 width,
- INT32 height
-);
-
-void
-xf86XVCopyYUV12ToPacked(
- const void *srcy,
- const void *srcv,
- const void *srcu,
- void *dst,
- int srcPitchy,
- int srcPitchuv,
- int dstPitch,
- int h,
- int w
-);
-
-void
-xf86XVCopyPacked(
- const void *src,
- void *dst,
- int srcPitch,
- int dstPitch,
- int h,
- int w
-);
-
-#endif /* _XF86XV_H_ */
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
deleted file mode 100644
index 832861ea4..000000000
--- a/hw/xfree86/common/xf86xvmc.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.6 2003/10/08 22:31:59 mvojkovi Exp $ */
-
-/*
- * Copyright (c) 2001-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-
-#ifdef XFree86LOADER
-#include "xvmodproc.h"
-#endif
-
-#include "xf86xvpriv.h"
-#include "xf86xvmc.h"
-
-#ifdef XFree86LOADER
-int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
-#else
-int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = XvMCScreenInit;
-#endif
-
-
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- int num_adaptors;
- XF86MCAdaptorPtr *adaptors;
- XvMCAdaptorPtr dixinfo;
-} xf86XvMCScreenRec, *xf86XvMCScreenPtr;
-
-static unsigned long XF86XvMCGeneration = 0;
-static int XF86XvMCScreenIndex = -1;
-
-#define XF86XVMC_GET_PRIVATE(pScreen) \
- (xf86XvMCScreenPtr)((pScreen)->devPrivates[XF86XvMCScreenIndex].ptr)
-
-
-static int
-xf86XvMCCreateContext (
- XvPortPtr pPort,
- XvMCContextPtr pContext,
- int *num_priv,
- CARD32 **priv
-)
-{
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- pContext->port_priv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateContext)(
- pScrn, pContext, num_priv, priv);
-}
-
-static void
-xf86XvMCDestroyContext ( XvMCContextPtr pContext)
-{
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- (*pScreenPriv->adaptors[pContext->adapt_num]->DestroyContext)(
- pScrn, pContext);
-}
-
-static int
-xf86XvMCCreateSurface (
- XvMCSurfacePtr pSurface,
- int *num_priv,
- CARD32 **priv
-)
-{
- XvMCContextPtr pContext = pSurface->context;
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSurface)(
- pScrn, pSurface, num_priv, priv);
-}
-
-static void
-xf86XvMCDestroySurface (XvMCSurfacePtr pSurface)
-{
- XvMCContextPtr pContext = pSurface->context;
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySurface)(
- pScrn, pSurface);
-}
-
-static int
-xf86XvMCCreateSubpicture (
- XvMCSubpicturePtr pSubpicture,
- int *num_priv,
- CARD32 **priv
-)
-{
- XvMCContextPtr pContext = pSubpicture->context;
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSubpicture)(
- pScrn, pSubpicture, num_priv, priv);
-}
-
-static void
-xf86XvMCDestroySubpicture (XvMCSubpicturePtr pSubpicture)
-{
- XvMCContextPtr pContext = pSubpicture->context;
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
-
- (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySubpicture)(
- pScrn, pSubpicture);
-}
-
-
-static Bool
-xf86XvMCCloseScreen (int i, ScreenPtr pScreen)
-{
- xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen);
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
-
- xfree(pScreenPriv->dixinfo);
- xfree(pScreenPriv);
-
- return (*pScreen->CloseScreen)(i, pScreen);
-}
-
-Bool xf86XvMCScreenInit(
- ScreenPtr pScreen,
- int num_adaptors,
- XF86MCAdaptorPtr *adaptors
-)
-{
- XvMCAdaptorPtr pAdapt;
- xf86XvMCScreenPtr pScreenPriv;
- XvScreenPtr pxvs =
- (XvScreenPtr)(pScreen->devPrivates[XF86XvScreenIndex].ptr);
-
- int i, j;
-
- if(!XvMCScreenInitProc) return FALSE;
-
- if(XF86XvMCGeneration != serverGeneration) {
- if((XF86XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- XF86XvMCGeneration = serverGeneration;
- }
-
- if(!(pAdapt = xalloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
- return FALSE;
-
- if(!(pScreenPriv = xalloc(sizeof(xf86XvMCScreenRec)))) {
- xfree(pAdapt);
- return FALSE;
- }
-
- pScreen->devPrivates[XF86XvMCScreenIndex].ptr = (pointer)pScreenPriv;
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = xf86XvMCCloseScreen;
-
- pScreenPriv->num_adaptors = num_adaptors;
- pScreenPriv->adaptors = adaptors;
- pScreenPriv->dixinfo = pAdapt;
-
- for(i = 0; i < num_adaptors; i++) {
- pAdapt[i].xv_adaptor = NULL;
- for(j = 0; j < pxvs->nAdaptors; j++) {
- if(!strcmp((*adaptors)->name, pxvs->pAdaptors[j].name)) {
- pAdapt[i].xv_adaptor = &(pxvs->pAdaptors[j]);
- break;
- }
- }
- if(!pAdapt[i].xv_adaptor) {
- /* no adaptor by that name */
- xfree(pAdapt);
- return FALSE;
- }
- pAdapt[i].num_surfaces = (*adaptors)->num_surfaces;
- pAdapt[i].surfaces = (XvMCSurfaceInfoPtr*)((*adaptors)->surfaces);
- pAdapt[i].num_subpictures = (*adaptors)->num_subpictures;
- pAdapt[i].subpictures = (XvImagePtr*)((*adaptors)->subpictures);
- pAdapt[i].CreateContext = xf86XvMCCreateContext;
- pAdapt[i].DestroyContext = xf86XvMCDestroyContext;
- pAdapt[i].CreateSurface = xf86XvMCCreateSurface;
- pAdapt[i].DestroySurface = xf86XvMCDestroySurface;
- pAdapt[i].CreateSubpicture = xf86XvMCCreateSubpicture;
- pAdapt[i].DestroySubpicture = xf86XvMCDestroySubpicture;
- adaptors++;
- }
-
- if(Success != (*XvMCScreenInitProc)(pScreen, num_adaptors, pAdapt))
- return FALSE;
-
- return TRUE;
-}
-
-XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void)
-{
- return xcalloc(1, sizeof(XF86MCAdaptorRec));
-}
-
-void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor)
-{
- xfree(adaptor);
-}
diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h
deleted file mode 100644
index 0b073aac8..000000000
--- a/hw/xfree86/common/xf86xvmc.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.7 2003/10/08 22:31:59 mvojkovi Exp $ */
-
-/*
- * Copyright (c) 2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86XVMC_H
-#define _XF86XVMC_H
-
-#include "xvmcext.h"
-#include "xf86xv.h"
-
-typedef struct {
- int num_xvimages;
- int *xvimage_ids; /* reference the subpictures in the XF86MCAdaptorRec */
-} XF86MCImageIDList;
-
-typedef struct {
- int surface_type_id; /* Driver generated. Must be unique on the port */
- int chroma_format;
- int color_description; /* no longer used */
- unsigned short max_width;
- unsigned short max_height;
- unsigned short subpicture_max_width;
- unsigned short subpicture_max_height;
- int mc_type;
- int flags;
- XF86MCImageIDList *compatible_subpictures; /* can be null, if none */
-} XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr;
-
-
-/*
- xf86XvMCCreateContextProc
-
- DIX will fill everything out in the context except the driver_priv.
- The port_priv holds the private data specified for the port when
- Xv was initialized by the driver.
- The driver may store whatever it wants in driver_priv and edit
- the width, height and flags. If the driver wants to return something
- to the client it can allocate space in priv and specify the number
- of 32 bit words in num_priv. This must be dynamically allocated
- space because DIX will free it after it passes it to the client.
-*/
-
-
-typedef int (*xf86XvMCCreateContextProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCContextPtr context,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*xf86XvMCDestroyContextProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCContextPtr context
-);
-
-/*
- xf86XvMCCreateSurfaceProc
-
- DIX will fill everything out in the surface except the driver_priv.
- The driver may store whatever it wants in driver_priv. The driver
- may pass data back to the client in the same manner as the
- xf86XvMCCreateContextProc.
-*/
-
-
-typedef int (*xf86XvMCCreateSurfaceProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCSurfacePtr surface,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*xf86XvMCDestroySurfaceProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCSurfacePtr surface
-);
-
-/*
- xf86XvMCCreateSubpictureProc
-
- DIX will fill everything out in the subpicture except the driver_priv,
- num_palette_entries, entry_bytes and component_order. The driver may
- store whatever it wants in driver_priv and edit the width and height.
- If it is a paletted subpicture the driver needs to fill out the
- num_palette_entries, entry_bytes and component_order. These are
- not communicated to the client until the time the surface is
- created.
-
- The driver may pass data back to the client in the same manner as the
- xf86XvMCCreateContextProc.
-*/
-
-
-typedef int (*xf86XvMCCreateSubpictureProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCSubpicturePtr subpicture,
- int *num_priv,
- CARD32 **priv
-);
-
-typedef void (*xf86XvMCDestroySubpictureProcPtr) (
- ScrnInfoPtr pScrn,
- XvMCSubpicturePtr subpicture
-);
-
-
-typedef struct {
- char *name;
- int num_surfaces;
- XF86MCSurfaceInfoPtr *surfaces;
- int num_subpictures;
- XF86ImagePtr *subpictures;
- xf86XvMCCreateContextProcPtr CreateContext;
- xf86XvMCDestroyContextProcPtr DestroyContext;
- xf86XvMCCreateSurfaceProcPtr CreateSurface;
- xf86XvMCDestroySurfaceProcPtr DestroySurface;
- xf86XvMCCreateSubpictureProcPtr CreateSubpicture;
- xf86XvMCDestroySubpictureProcPtr DestroySubpicture;
-} XF86MCAdaptorRec, *XF86MCAdaptorPtr;
-
-/*
- xf86XvMCScreenInit
-
- Unlike Xv, the adaptor data is not copied from this structure.
- This structure's data is used so it must stick around for the
- life of the server. Note that it's an array of pointers not
- an array of structures.
-*/
-
-Bool xf86XvMCScreenInit(
- ScreenPtr pScreen,
- int num_adaptors,
- XF86MCAdaptorPtr *adaptors
-);
-
-XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void);
-void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
-
-#endif /* _XF86XVMC_H */
diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h
deleted file mode 100644
index 0d1efdafb..000000000
--- a/hw/xfree86/common/xf86xvpriv.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvpriv.h,v 1.2 2003/08/24 17:36:56 dawes Exp $ */
-
-/*
- * Copyright (c) 2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86XVPRIV_H_
-#define _XF86XVPRIV_H_
-
-#include "xf86xv.h"
-
-/*** These are DDX layer privates ***/
-
-extern int XF86XvScreenIndex;
-
-typedef struct {
- DestroyWindowProcPtr DestroyWindow;
- ClipNotifyProcPtr ClipNotify;
- WindowExposuresProcPtr WindowExposures;
- void (*AdjustFrame)(int, int, int, int);
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- GCPtr videoGC;
-} XF86XVScreenRec, *XF86XVScreenPtr;
-
-typedef struct {
- int flags;
- PutVideoFuncPtr PutVideo;
- PutStillFuncPtr PutStill;
- GetVideoFuncPtr GetVideo;
- GetStillFuncPtr GetStill;
- StopVideoFuncPtr StopVideo;
- SetPortAttributeFuncPtr SetPortAttribute;
- GetPortAttributeFuncPtr GetPortAttribute;
- QueryBestSizeFuncPtr QueryBestSize;
- PutImageFuncPtr PutImage;
- ReputImageFuncPtr ReputImage;
- QueryImageAttributesFuncPtr QueryImageAttributes;
-} XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr;
-
-typedef struct {
- ScrnInfoPtr pScrn;
- DrawablePtr pDraw;
- unsigned char type;
- unsigned int subWindowMode;
- DDXPointRec clipOrg;
- RegionPtr clientClip;
- RegionPtr pCompositeClip;
- Bool FreeCompositeClip;
- XvAdaptorRecPrivatePtr AdaptorRec;
- XvStatus isOn;
- Bool moved;
- int vid_x, vid_y, vid_w, vid_h;
- int drw_x, drw_y, drw_w, drw_h;
- DevUnion DevPriv;
-} XvPortRecPrivate, *XvPortRecPrivatePtr;
-
-typedef struct _XF86XVWindowRec{
- XvPortRecPrivatePtr PortRec;
- struct _XF86XVWindowRec *next;
-} XF86XVWindowRec, *XF86XVWindowPtr;
-
-#endif /* _XF86XVPRIV_H_ */
diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c
deleted file mode 100644
index facc27842..000000000
--- a/hw/xfree86/common/xisb.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.6 2003/03/25 04:18:21 dawes Exp $ */
-
-/*
- X Input Serial Buffer routines for use in any XInput driver that accesses
- a serial device.
-*/
-
-
-/*****************************************************************************
- * Standard Headers
- ****************************************************************************/
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-
-#include <misc.h>
-#include <xf86.h>
-#include <xf86Version.h>
-#include <xf86_OSproc.h>
-#include <xf86_OSlib.h>
-#include <xf86Xinput.h>
-#include "xisb.h"
-
-/*****************************************************************************
- * Local Headers
- ****************************************************************************/
-
-/*****************************************************************************
- * Variables without includable headers
- ****************************************************************************/
-
-/*****************************************************************************
- * Local Variables
- ****************************************************************************/
-
-/*****************************************************************************
- * Function Definitions
- ****************************************************************************/
-
-XISBuffer *
-XisbNew (int fd, xf86ssize_t size)
-{
- XISBuffer *b;
-
- b = xalloc (sizeof (XISBuffer));
- if (!b)
- return (NULL);
- b->buf = xalloc ((sizeof (unsigned char) * size));
- if (!b->buf)
- {
- xfree (b);
- return (NULL);
- }
-
- b->fd = fd;
- b->trace = 0;
- b->block_duration = 0;
- b->current = 1; /* force it to be past the end to trigger initial read */
- b->end = 0;
- b->buffer_size = size;
- return (b);
-}
-
-void
-XisbFree (XISBuffer *b)
-{
- xfree (b->buf);
- xfree (b);
-}
-
-int
-XisbRead (XISBuffer *b)
-{
- int ret;
-
- if (b->current >= b->end)
- {
- if (b->block_duration >= 0)
- {
- if (xf86WaitForInput (b->fd, b->block_duration) < 1)
- return (-1);
- }
- else
- {
- /*
- * automatically clear it so if XisbRead is called in a loop
- * the next call will make sure there is data with select and
- * thus prevent a blocking read
- */
- b->block_duration = 0;
- }
-
- ret = xf86ReadSerial (b->fd, b->buf, b->buffer_size);
- switch (ret)
- {
- case 0:
- return (-1); /* timeout */
- case -1:
- return (-2); /* error */
- default:
- b->end = ret;
- b->current = 0;
- break;
- }
- }
- if (b->trace)
- ErrorF ("read 0x%02x (%c)\n", b->buf[b->current],
- isprint(b->buf[b->current])?b->buf[b->current]:'.');
-
- return (b->buf[b->current++]);
-}
-
-/* the only purpose of this function is to provide output tracing */
-xf86ssize_t
-XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len)
-{
- if (b->trace)
- {
- int i = 0;
- for (i = 0; i < len; i++)
- ErrorF ("\t\twrote 0x%02x (%c)\n", msg[i], msg[i]);
- }
- return (xf86WriteSerial (b->fd, msg, len));
-}
-
-/* turn tracing of this buffer on (1) or off (0) */
-void
-XisbTrace (XISBuffer *b, int trace)
-{
- b->trace = trace;
-}
-
-/*
- * specify a block_duration of -1 when you know the buffer's fd is ready to
- * read. After a read, it is automatically set to 0 so that the next read
- * will use check to select for data and prevent a block.
- * It is the caller's responsibility to set the block_duration to -1 if it
- * knows that there is data to read (because the main select loop triggered
- * the read) and want's to avoid the unnecessary overhead of the select call
- *
- * a zero or positive block duration will cause the select to block for the
- * give duration in usecs.
- */
-
-void
-XisbBlockDuration (XISBuffer *b, int block_duration)
-{
- b->block_duration = block_duration;
-}
diff --git a/hw/xfree86/common/xisb.h b/hw/xfree86/common/xisb.h
deleted file mode 100644
index 7b5e26a23..000000000
--- a/hw/xfree86/common/xisb.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.h,v 1.1 1998/12/05 14:40:10 dawes Exp $ */
-
-#ifndef _xisb_H_
-#define _xisb_H_
-
-/******************************************************************************
- * Definitions
- * structs, typedefs, #defines, enums
- *****************************************************************************/
-
-typedef struct _XISBuffer
-{
- int fd;
- int trace;
- int block_duration;
- xf86ssize_t current; /* bytes read */
- xf86ssize_t end;
- xf86ssize_t buffer_size;
- unsigned char *buf;
-} XISBuffer;
-
-/******************************************************************************
- * Declarations
- * variables: use xisb_LOC in front
- * of globals.
- * put locals in the .c file.
- *****************************************************************************/
-XISBuffer * XisbNew (int fd, xf86ssize_t size);
-void XisbFree (XISBuffer *b);
-int XisbRead (XISBuffer *b);
-xf86ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len);
-void XisbTrace (XISBuffer *b, int trace);
-void XisbBlockDuration (XISBuffer *b, int block_duration);
-
-/*
- * DO NOT PUT ANYTHING AFTER THIS ENDIF
- */
-#endif
diff --git a/hw/xfree86/ddc/DDC.HOWTO b/hw/xfree86/ddc/DDC.HOWTO
deleted file mode 100644
index 2f2c95b7f..000000000
--- a/hw/xfree86/ddc/DDC.HOWTO
+++ /dev/null
@@ -1,97 +0,0 @@
- DDC.HOWTO
-
- This file describes how to add DDC support to a chipset driver.
-
-1) DDC INITIALIZATION
-
- When implementing DDC in the driver one has the choice between
- DDC1 and DDC2.
- DDC1 data is contiuously transmitted by a DDC1 capable display
- device. The data is send serially over a data line; the Vsync
- signal serves as clock. Only one EDID 1.x data block can be
- transmitted using DDC1. Since transmission of an EDID1 block
- using a regular Vsync frequency would take up several seconds
- the driver can increase the Vsync frequency to up to 25 kHz as
- soon as it detects DDC1 activety on the data line.
- DDC2 data is transmitted using the I2C protocol. This requires
- an additional clock line. DDC2 is capable of transmitting EDID1
- and EDID2 block as well as a VDIF block on display devices that
- support these.
- Display devices switch into the DDC2 mode as soon as they detect
- activety on the DDC clock line. Once the are in DDC2 mode they
- stop transmitting DDC1 signals until the next power cycle.
-
- Some graphics chipset configurations which are not capable of
- DDC2 might still be able to read DDC1 data. Where available
- DDC2 it is preferrable.
-
- All relevant prototypes and defines are in xf86DDC.h.
- DDC2 additionally requires I2C support. The I2C prototypes
- are in xf86i2c.h.
-
- DDC1 Support:
-
- The driver has to provide a read function which waits for the
- end of the next Vsync signal and reads in and returns the status
- of the DDC line:
-
- unsigned int XXX_ddc1Read(ScrnInfoPtr pScrn)
-
- Additionally a function is required to inclrease the Vsync
- frequency to max. 25 kHz.
-
- void XXX_ddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
-
- If the speed argument is DDC_FAST the function should increase
- the Vsync frequency on DDC_SLOW it should restore the original
- value. For convenience a generic ddc1SetSpeed() function is provided
- in the vga module for VGA-like chipsets.
-
- void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, sf86ddcSpeed speed).
-
- To read out the DDC1 data the driver should call
-
- xf86MonPtr xf86DoEDID_DDC1(int scrnIndex,
- void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
- unsigned int (*DDC1Read)(ScrnInfoPtr))
-
- in PreInit(). DDC1SetSpeed is a pointer to the SetSpeed()
- function, DDC1Read has to point to the DDC1 read function.
- The function will return a pointer to the xf86Monitor structure
- which contains all information retreived by DDC.
- NULL will be returned on failure.
-
- DDC2 Support
-
- To read out DDC2 information I2C has to be initialized first.
- (See documentation for the i2c module).
- The function
-
- xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
-
- is provided to read out and process DDC2 data. A pointer
- to the I2CBusRec of the appropriate I2C Bus has to be passed
- as the second argument.
- The function will return a pointer to the xf86Monitor structure
- which contains all information retreived by DDC.
- NULL will be returned on failure.
-
- Printing monitor parameters
-
- To print out the information contained in the xf86Monitor
- structure the function
-
- xf86MonPtr xf86PrintEDID(xf86MonPtr monitor)
-
- is provided.
-
- Further processing of the xf86Monitor structure is not yet
- implemented. Howerver it is planned to use the information
- about video modes, gamma values etc.
- Therefore it is strongly recommended to read out DDC data
- before any video mode processing is done.
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/ddc/DDC.HOWTO,v 1.3 1999/09/25 14:37:16 dawes Exp $
diff --git a/hw/xfree86/ddc/ddcPriv.h b/hw/xfree86/ddc/ddcPriv.h
deleted file mode 100644
index b5cb9b836..000000000
--- a/hw/xfree86/ddc/ddcPriv.h
+++ /dev/null
@@ -1,9 +0,0 @@
-extern unsigned char *GetEDID_DDC1(
- unsigned int *
-);
-
-extern int DDC_checksum(
- unsigned char *,
- int
-);
-
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
deleted file mode 100644
index 666dfc632..000000000
--- a/hw/xfree86/ddc/ddcProperty.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* ddcProperty.c: Make the DDC monitor information available to clients
- * as properties on the root window
- *
- * Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk>
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.10 2003/11/03 05:11:04 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-/* #include "xf86_ansic.h" */
-/* #include "xf86_OSproc.h" */
-#include "Xatom.h"
-#include "property.h"
-#include "propertyst.h"
-#include "xf86DDC.h"
-
-#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
-#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
-#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
-
-Bool
-xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
-{
- Atom EDID1Atom=-1, EDID2Atom=-1, VDIFAtom=-1;
- CARD8 *EDID1rawdata = NULL;
- CARD8 *EDID2rawdata = NULL;
- int i, ret;
- Bool makeEDID1prop = FALSE;
- Bool makeEDID2prop = FALSE;
-
-#ifdef DEBUG
- ErrorF("xf86SetDDCproperties(%p, %p)\n", pScrnInfo, DDC);
-#endif
-
- if (pScrnInfo==NULL || pScrnInfo->monitor==NULL || DDC==NULL) {
- return FALSE;
- }
-
-#ifdef DEBUG
- ErrorF("pScrnInfo->scrnIndex %d\n", pScrnInfo->scrnIndex);
-
- ErrorF("pScrnInfo->monitor was %p\n", pScrnInfo->monitor);
-#endif
-
- pScrnInfo->monitor->DDC = DDC;
-
- if (DDC->ver.version == 1) {
- makeEDID1prop = TRUE;
- } else if (DDC->ver.version == 2) {
- int checksum1;
- int checksum2;
- makeEDID2prop = TRUE;
-
- /* Some monitors (eg Panasonic PanaSync4)
- * report version==2 because they used EDID v2 spec document,
- * although they use EDID v1 data structure :-(
- *
- * Try using checksum to determine when we have such a monitor.
- */
- checksum2 = 0;
- for (i=0; i<256; i++) { checksum2 += DDC->rawData[i]; }
- if ( (checksum2 % 256) != 0 ) {
- xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "Monitor EDID v2 checksum failed\n");
- xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "XFree86_DDC_EDID2_RAWDATA property may be bad\n");
- checksum1 = 0;
- for (i=0; i<128; i++) { checksum1 += DDC->rawData[i]; }
- if ( (checksum1 % 256) == 0 ) {
- xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "Monitor EDID v1 checksum passed,\n");
- xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "XFree86_DDC_EDID1_RAWDATA property created\n");
- makeEDID1prop = TRUE;
- }
- }
- } else {
- xf86DrvMsg(pScrnInfo->scrnIndex, X_PROBED,
- "unexpected EDID version %d revision %d\n",
- DDC->ver.version, DDC->ver.revision );
- }
-
- if (makeEDID1prop) {
- if ( (EDID1rawdata = xalloc(128*sizeof(CARD8)))==NULL ) {
- return FALSE;
- }
-
- EDID1Atom = MakeAtom(EDID1_ATOM_NAME, sizeof(EDID1_ATOM_NAME), TRUE);
-
-
- for (i=0; i<128; i++) {
- EDID1rawdata[i] = DDC->rawData[i];
- }
-
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
- xf86RegisterRootWindowProperty,
- pScrnInfo->scrnIndex,
- EDID1Atom, XA_INTEGER, 8,
- 128, (unsigned char *)EDID1rawdata );
-#endif
-
- ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
- EDID1Atom, XA_INTEGER, 8,
- 128, (unsigned char *)EDID1rawdata
- );
- if (ret != Success)
- ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
- }
-
- if (makeEDID2prop) {
- if ( (EDID2rawdata = xalloc(256*sizeof(CARD8)))==NULL ) {
- return FALSE;
- }
- for (i=0; i<256; i++) {
- EDID2rawdata[i] = DDC->rawData[i];
- }
-
- EDID2Atom = MakeAtom(EDID2_ATOM_NAME, sizeof(EDID2_ATOM_NAME), TRUE);
-
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
- xf86RegisterRootWindowProperty,
- pScrnInfo->scrnIndex,
- EDID2Atom, XA_INTEGER, 8,
- 256, (unsigned char *)EDID2rawdata );
-#endif
- ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
- EDID2Atom, XA_INTEGER, 8,
- 256, (unsigned char *)EDID2rawdata
- );
- if (ret != Success)
- ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
- }
-
- if (DDC->vdif) {
-#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n"
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
- xf86RegisterRootWindowProperty,
- pScrnInfo->scrnIndex,
- VDIFAtom, XA_STRING, 8,
- strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING
- );
-#endif
-
-
- VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE);
-
- ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
- VDIFAtom, XA_STRING, 8,
- strlen(VDIF_DUMMY_STRING),
- VDIF_DUMMY_STRING
- );
- if (ret != Success)
- ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
- }
-
- return TRUE;
-}
diff --git a/hw/xfree86/ddc/edid.c b/hw/xfree86/ddc/edid.c
deleted file mode 100644
index a61940cfa..000000000
--- a/hw/xfree86/ddc/edid.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/edid.c,v 1.4 2003/02/17 16:08:27 dawes Exp $ */
-
-/* edid.c: retrieve EDID record from raw DDC1 data stream: data
- * is contained in an array of unsigned int each unsigned int
- * contains one bit if bit is 0 unsigned int has to be zero else
- * unsigned int > 0
- *
- * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "xf86DDC.h"
-#include "ddcPriv.h"
-
-static int find_start(unsigned int *);
-static unsigned char * find_header(unsigned char *);
-static unsigned char * resort(unsigned char *);
-
-unsigned char *
-GetEDID_DDC1(unsigned int *s_ptr)
-{
- unsigned char *d_block, *d_pos;
- unsigned int *s_pos, *s_end;
- int s_start;
- int i,j;
- s_start = find_start(s_ptr);
- if (s_start==-1) return NULL;
- s_end = s_ptr + NUM;
- s_pos = s_ptr + s_start;
- d_block=xalloc(EDID1_LEN);
- if (!d_block) return NULL;
- d_pos = d_block;
- for (i=0;i<EDID1_LEN;i++) {
- for (j=0;j<8;j++) {
- *d_pos <<= 1;
- if (*s_pos) {
- *d_pos |= 0x01;
- }
- s_pos++; if (s_pos == s_end) s_pos=s_ptr;
- };
- s_pos++; if (s_pos == s_end) s_pos=s_ptr;
- d_pos++;
- }
- xfree(s_ptr);
- if (d_block && DDC_checksum(d_block,EDID1_LEN)) return NULL;
- return (resort(d_block));
-}
-
-int
-DDC_checksum(unsigned char *block, int len)
-{
- int i, result = 0;
- int not_null = 0;
-
- for (i=0;i<len;i++) {
- not_null |= block[i];
- result += block[i];
- }
-
-#ifdef DEBUG
- if (result & 0xFF) ErrorF("DDC checksum not correct\n");
- if (!not_null) ErrorF("DDC read all Null\n");
-#endif
-
- /* catch the trivial case where all bytes are 0 */
- if (!not_null) return 1;
-
- return (result&0xFF);
-}
-
-static int
-find_start(unsigned int *ptr)
-{
- unsigned int comp[9], test[9];
- int i,j;
-
- for (i=0;i<9;i++){
- comp[i] = *(ptr++);
- test[i] = 1;
- }
- for (i=0;i<127;i++){
- for (j=0;j<9;j++){
- test[j] = test[j] & !(comp[j] ^ *(ptr++));
- }
- }
- for (i=0;i<9;i++)
- if (test[i]) return (i+1);
- return (-1);
-}
-
-static unsigned char *
-find_header(unsigned char *block)
-{
- unsigned char *ptr, *head_ptr, *end;
- unsigned char header[]={0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
-
- ptr = block;
- end = block + EDID1_LEN;
- while (ptr<end) {
- int i;
- head_ptr = ptr;
- for (i=0;i<8;i++){
- if (header[i] != *(head_ptr++)) break;
- if (head_ptr == end) head_ptr = block;
- }
- if (i==8) break;
- ptr++;
- }
- if (ptr == end) return (NULL);
- return (ptr);
-}
-
-static unsigned char *
-resort(unsigned char *s_block)
-{
- unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end;
- unsigned char tmp;
-
- s_end = s_block + EDID1_LEN;
- d_new = xalloc(EDID1_LEN);
- if (!d_new) return NULL;
- d_end = d_new + EDID1_LEN;
-
- s_ptr = find_header(s_block);
- if (!s_ptr) return NULL;
- for (d_ptr=d_new;d_ptr<d_end;d_ptr++){
- tmp = *(s_ptr++);
- *d_ptr = tmp;
- if (s_ptr == s_end) s_ptr = s_block;
- }
- xfree(s_block);
- return (d_new);
-}
-
-
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
deleted file mode 100644
index 7a2f30cb4..000000000
--- a/hw/xfree86/ddc/edid.h
+++ /dev/null
@@ -1,424 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/edid.h,v 1.7 2000/04/20 21:28:26 tsi Exp $ */
-
-/* edid.h: defines to parse an EDID block
- *
- * This file contains all information to interpret a standard EDIC block
- * transmitted by a display device via DDC (Display Data Channel). So far
- * there is no information to deal with optional EDID blocks.
- * DDC is a Trademark of VESA (Video Electronics Standard Association).
- *
- * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-
-#ifndef _EDID_H_
-#define _EDID_H_ 1
-
-#include "vdif.h"
-
-/* read complete EDID record */
-#define EDID1_LEN 128
-#define BITS_PER_BYTE 9
-#define NUM BITS_PER_BYTE*EDID1_LEN
-#define HEADER 6
-
-#define STD_TIMINGS 8
-#define DET_TIMINGS 4
-
-#ifdef _PARSE_EDID_
-
-/* header: 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 */
-#define HEADER_SECTION 0
-#define HEADER_LENGTH 8
-
-/* vendor section */
-#define VENDOR_SECTION (HEADER_SECTION + HEADER_LENGTH)
-#define V_MANUFACTURER 0
-#define V_PROD_ID (V_MANUFACTURER + 2)
-#define V_SERIAL (V_PROD_ID + 2)
-#define V_WEEK (V_SERIAL + 4)
-#define V_YEAR (V_WEEK + 1)
-#define VENDOR_LENGTH (V_YEAR + 1)
-
-/* EDID version */
-#define VERSION_SECTION (VENDOR_SECTION + VENDOR_LENGTH)
-#define V_VERSION 0
-#define V_REVISION (V_VERSION + 1)
-#define VERSION_LENGTH (V_REVISION + 1)
-
-/* display information */
-#define DISPLAY_SECTION (VERSION_SECTION + VERSION_LENGTH)
-#define D_INPUT 0
-#define D_HSIZE (D_INPUT + 1)
-#define D_VSIZE (D_HSIZE + 1)
-#define D_GAMMA (D_VSIZE + 1)
-#define FEAT_S (D_GAMMA + 1)
-#define D_RG_LOW (FEAT_S + 1)
-#define D_BW_LOW (D_RG_LOW + 1)
-#define D_REDX (D_BW_LOW + 1)
-#define D_REDY (D_REDX + 1)
-#define D_GREENX (D_REDY + 1)
-#define D_GREENY (D_GREENX + 1)
-#define D_BLUEX (D_GREENY + 1)
-#define D_BLUEY (D_BLUEX + 1)
-#define D_WHITEX (D_BLUEY + 1)
-#define D_WHITEY (D_WHITEX + 1)
-#define DISPLAY_LENGTH (D_WHITEY + 1)
-
-/* supported VESA and other standard timings */
-#define ESTABLISHED_TIMING_SECTION (DISPLAY_SECTION + DISPLAY_LENGTH)
-#define E_T1 0
-#define E_T2 (E_T1 + 1)
-#define E_TMANU (E_T2 + 1)
-#define E_TIMING_LENGTH (E_TMANU + 1)
-
-/* non predefined standard timings supported by display */
-#define STD_TIMING_SECTION (ESTABLISHED_TIMING_SECTION + E_TIMING_LENGTH)
-#define STD_TIMING_INFO_LEN 2
-#define STD_TIMING_INFO_NUM STD_TIMINGS
-#define STD_TIMING_LENGTH (STD_TIMING_INFO_LEN * STD_TIMING_INFO_NUM)
-
-/* detailed timing info of non standard timings */
-#define DET_TIMING_SECTION (STD_TIMING_SECTION + STD_TIMING_LENGTH)
-#define DET_TIMING_INFO_LEN 18
-#define MONITOR_DESC_LEN DET_TIMING_INFO_LEN
-#define DET_TIMING_INFO_NUM DET_TIMINGS
-#define DET_TIMING_LENGTH (DET_TIMING_INFO_LEN * DET_TIMING_INFO_NUM)
-
-/* number of EDID sections to follow */
-#define NO_EDID (DET_TIMING_SECTION + DET_TIMING_LENGTH)
-/* one byte checksum */
-#define CHECKSUM (NO_EDID + 1)
-
-#if (CHECKSUM != (EDID1_LEN - 1))
-# error "EDID1 length != 128!"
-#endif
-
-
-#define SECTION(x,y) (Uchar *)(x + y)
-#define GET_ARRAY(y) ((Uchar *)(c + y))
-#define GET(y) *(Uchar *)(c + y)
-
-/* extract information from vendor section */
-#define _PROD_ID(x) x[0] + (x[1] << 8);
-#define PROD_ID _PROD_ID(GET_ARRAY(V_PROD_ID))
-#define _SERIAL_NO(x) x[0] + (x[1] << 8) + (x[2] << 16) + (x[3] << 24)
-#define SERIAL_NO _SERIAL_NO(GET_ARRAY(V_SERIAL))
-#define _YEAR(x) (x & 0xFF) + 1990
-#define YEAR _YEAR(GET(V_YEAR))
-#define WEEK GET(V_WEEK) & 0xFF
-#define _L1(x) ((x[0] & 0x7C) >> 2) + '@'
-#define _L2(x) ((x[0] & 0x03) << 3) + ((x[1] & 0xE0) >> 5) + '@'
-#define _L3(x) (x[1] & 0x1F) + '@';
-#define L1 _L1(GET_ARRAY(V_MANUFACTURER))
-#define L2 _L2(GET_ARRAY(V_MANUFACTURER))
-#define L3 _L3(GET_ARRAY(V_MANUFACTURER))
-
-/* extract information from version section */
-#define VERSION GET(V_VERSION)
-#define REVISION GET(V_REVISION)
-
-/* extract information from display section */
-#define _INPUT_TYPE(x) ((x & 0x80) >> 7)
-#define INPUT_TYPE _INPUT_TYPE(GET(D_INPUT))
-#define _INPUT_VOLTAGE(x) ((x & 0x60) >> 5)
-#define INPUT_VOLTAGE _INPUT_VOLTAGE(GET(D_INPUT))
-#define _SETUP(x) ((x & 0x10) >> 4)
-#define SETUP _SETUP(GET(D_INPUT))
-#define _SYNC(x) (x & 0x0F)
-#define SYNC _SYNC(GET(D_INPUT))
-#define _GAMMA(x) ((x + 100.0)/100.0)
-#define GAMMA _GAMMA(GET(D_GAMMA))
-#define HSIZE_MAX GET(D_HSIZE)
-#define VSIZE_MAX GET(D_VSIZE)
-#define _DPMS(x) ((x & 0xE0) >> 5)
-#define DPMS _DPMS(GET(FEAT_S))
-#define _DISPLAY_TYPE(x) ((x & 0x18) >> 3)
-#define DISPLAY_TYPE _DISPLAY_TYPE(GET(FEAT_S))
-#define _MSC(x) (x & 0x7)
-#define MSC _MSC(GET(FEAT_S))
-
-
-/* color characteristics */
-#define CC_L(x,y) ((x & (0x03 << y)) >> y)
-#define CC_H(x) (x << 2)
-#define I_CC(x,y,z) CC_H(y) | CC_L(x,z)
-#define F_CC(x) ((x)/1024.0)
-#define REDX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDX)),6))
-#define REDY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDY)),4))
-#define GREENX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENX)),2))
-#define GREENY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENY)),0))
-#define BLUEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEX)),6))
-#define BLUEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEY)),4))
-#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
-#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
-
-/* extract information from standard timing section */
-#define T1 GET(E_T1)
-#define T2 GET(E_T2)
-#define T_MANU GET(E_TMANU)
-
-/* extract information from estabished timing section */
-#define _HSIZE1(x) ((x[0] + 31) * 8)
-#define HSIZE1 _HSIZE1(c)
-#define RATIO(x) ((x[1] & 0xC0) >> 6)
-#define RATIO1_1 0
-#define RATIO4_3 1
-#define RATIO5_4 2
-#define RATIO16_9 3
-#define _VSIZE1(x,y) switch(RATIO(x)){ \
- case RATIO1_1: y = _HSIZE1(x); break; \
- case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \
- case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \
- case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \
- }
-#define VSIZE1(x) _VSIZE1(c,x)
-#define _REFRESH_R(x) (x[1] & 0x3F) + 60
-#define REFRESH_R _REFRESH_R(c)
-#define _ID_LOW(x) x[0]
-#define ID_LOW _ID_LOW(c)
-#define _ID_HIGH(x) (x[1] << 8)
-#define ID_HIGH _ID_HIGH(c)
-#define STD_TIMING_ID (ID_LOW | ID_HIGH)
-#define _NEXT_STD_TIMING(x) (x = (x + STD_TIMING_INFO_LEN))
-#define NEXT_STD_TIMING _NEXT_STD_TIMING(c)
-
-
-/* EDID Ver. > 1.2 */
-#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0)
-#define IS_MONITOR_DESC _IS_MONITOR_DESC(c)
-#define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000
-#define PIXEL_CLOCK _PIXEL_CLOCK(c)
-#define _H_ACTIVE(x) (x[2] + ((x[4] & 0xF0) << 4))
-#define H_ACTIVE _H_ACTIVE(c)
-#define _H_BLANK(x) (x[3] + ((x[4] & 0x0F) << 8))
-#define H_BLANK _H_BLANK(c)
-#define _V_ACTIVE(x) (x[5] + ((x[7] & 0xF0) << 4))
-#define V_ACTIVE _V_ACTIVE(c)
-#define _V_BLANK(x) (x[6] + ((x[7] & 0x0F) << 8))
-#define V_BLANK _V_BLANK(c)
-#define _H_SYNC_OFF(x) (x[8] + ((x[11] & 0xC0) << 2))
-#define H_SYNC_OFF _H_SYNC_OFF(c)
-#define _H_SYNC_WIDTH(x) (x[9] + ((x[11] & 0x30) << 4))
-#define H_SYNC_WIDTH _H_SYNC_WIDTH(c)
-#define _V_SYNC_OFF(x) ((x[10] >> 4) + ((x[11] & 0x0C) << 2))
-#define V_SYNC_OFF _V_SYNC_OFF(c)
-#define _V_SYNC_WIDTH(x) ((x[10] & 0x0F) + ((x[11] & 0x03) << 4))
-#define V_SYNC_WIDTH _V_SYNC_WIDTH(c)
-#define _H_SIZE(x) (x[12] + ((x[14] & 0xF0) << 4))
-#define H_SIZE _H_SIZE(c)
-#define _V_SIZE(x) (x[13] + ((x[14] & 0x0F) << 8))
-#define V_SIZE _V_SIZE(c)
-#define _H_BORDER(x) (x[15])
-#define H_BORDER _H_BORDER(c)
-#define _V_BORDER(x) (x[16])
-#define V_BORDER _V_BORDER(c)
-#define _INTERLACED(x) ((x[17] & 0x80) >> 7)
-#define INTERLACED _INTERLACED(c)
-#define _STEREO(x) ((x[17] & 0x60) >> 6)
-#define STEREO _STEREO(c)
-#define _SYNC_T(x) ((x[17] & 0x18) >> 4)
-#define SYNC_T _SYNC_T(c)
-#define _MISC(x) ((x[17] & 0x06) >> 2)
-#define MISC _MISC(c)
-
-#define _MONITOR_DESC_TYPE(x) x[3]
-#define MONITOR_DESC_TYPE _MONITOR_DESC_TYPE(c)
-#define SERIAL_NUMBER 0xFF
-#define ASCII_STR 0xFE
-#define MONITOR_RANGES 0xFD
-#define _MIN_V(x) x[5]
-#define MIN_V _MIN_V(c)
-#define _MAX_V(x) x[6]
-#define MAX_V _MAX_V(c)
-#define _MIN_H(x) x[7]
-#define MIN_H _MIN_H(c)
-#define _MAX_H(x) x[8]
-#define MAX_H _MAX_H(c)
-#define _MAX_CLOCK(x) x[9]
-#define MAX_CLOCK _MAX_CLOCK(c)
-#define MONITOR_NAME 0xFC
-#define ADD_COLOR_POINT 0xFB
-#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
-#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
-#define _WHITEX_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 1)),2))
-#define _WHITEY_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 2)),0))
-#define _WHITE_INDEX1(x) x[5]
-#define WHITE_INDEX1 _WHITE_INDEX1(c)
-#define _WHITE_INDEX2(x) x[10]
-#define WHITE_INDEX2 _WHITE_INDEX2(c)
-#define WHITEX1 _WHITEX_ADD(c,6)
-#define WHITEY1 _WHITEY_ADD(c,6)
-#define WHITEX2 _WHITEX_ADD(c,12)
-#define WHITEY2 _WHITEY_ADD(c,12)
-#define _WHITE_GAMMA1(x) _GAMMA(x[9])
-#define WHITE_GAMMA1 _WHITE_GAMMA1(c)
-#define _WHITE_GAMMA2(x) _GAMMA(x[14])
-#define WHITE_GAMMA2 _WHITE_GAMMA2(c)
-#define ADD_STD_TIMINGS 0xFA
-
-#define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
-#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c)
-
-#endif /* _PARSE_EDID_ */
-
-/* input type */
-#define DIGITAL(x) x
-
-/* input voltage level */
-#define V070 0 /* 0.700V/0.300V */
-#define V071 1 /* 0.714V/0.286V */
-#define V100 2 /* 1.000V/0.400V */
-#define V007 3 /* 0.700V/0.000V */
-
-/* Signal level setup */
-#define SIG_SETUP(x) (x)
-
-/* sync characteristics */
-#define SEP_SYNC(x) (x & 0x08)
-#define COMP_SYNC(x) (x & 0x04)
-#define SYNC_O_GREEN(x) (x & 0x02)
-#define SYNC_SERR(x) (x & 0x01)
-
-/* DPMS features */
-#define DPMS_STANDBY(x) (x & 0x04)
-#define DPMS_SUSPEND(x) (x & 0x02)
-#define DPMS_OFF(x) (x & 0x01)
-
-/* display type */
-#define DISP_MONO 0
-#define DISP_RGB 1
-#define DISP_MULTCOLOR 2
-
-/* Msc stuff EDID Ver > 1.1 */
-#define STD_COLOR_SPACE(x) (x & 0x4)
-#define PREFERRED_TIMING_MODE(x) (x & 0x2)
-#define GFT_SUPPORTED(x) (x & 0x1)
-
-/* detailed timing misc */
-#define IS_INTERLACED(x) (x)
-#define IS_STEREO(x) (x)
-#define IS_RIGHT_ON_SYNC(x) (x & 0x01)
-#define IS_LEFT_ON_SYNC(x) (x & 0x02)
-
-typedef unsigned int Uint;
-typedef unsigned char Uchar;
-
-struct vendor {
- char name[4];
- int prod_id;
- Uint serial;
- int week;
- int year;
-};
-
-struct edid_version {
- int version;
- int revision;
-};
-
-struct disp_features {
- unsigned int input_type:1;
- unsigned int input_voltage:2;
- unsigned int input_setup:1;
- unsigned int input_sync:5;
- int hsize;
- int vsize;
- float gamma;
- unsigned int dpms:3;
- unsigned int display_type:2;
- unsigned int msc:3;
- float redx;
- float redy;
- float greenx;
- float greeny;
- float bluex;
- float bluey;
- float whitex;
- float whitey;
-};
-
-struct established_timings {
- Uchar t1;
- Uchar t2;
- Uchar t_manu;
-};
-
-struct std_timings {
- int hsize;
- int vsize;
- int refresh;
- CARD16 id;
-};
-
-struct detailed_timings {
- int clock;
- int h_active;
- int h_blanking;
- int v_active;
- int v_blanking;
- int h_sync_off;
- int h_sync_width;
- int v_sync_off;
- int v_sync_width;
- int h_size;
- int v_size;
- int h_border;
- int v_border;
- unsigned int interlaced:1;
- unsigned int stereo:2;
- unsigned int sync:2;
- unsigned int misc:2;
-};
-
-#define DT 0
-#define DS_SERIAL 0xFF
-#define DS_ASCII_STR 0xFE
-#define DS_NAME 0xFC
-#define DS_RANGES 0xFD
-#define DS_WHITE_P 0xFB
-#define DS_STD_TIMINGS 0xFA
-
-struct monitor_ranges {
- int min_v;
- int max_v;
- int min_h;
- int max_h;
- int max_clock;
-};
-
-struct whitePoints{
- int index;
- float white_x;
- float white_y;
- float white_gamma;
-};
-
-struct detailed_monitor_section {
- int type;
- union {
- struct detailed_timings d_timings;
- Uchar serial[13];
- Uchar ascii_data[13];
- Uchar name[13];
- struct monitor_ranges ranges;
- struct std_timings std_t[5];
- struct whitePoints wp[2];
- } section;
-};
-
-typedef struct {
- int scrnIndex;
- struct vendor vendor;
- struct edid_version ver;
- struct disp_features features;
- struct established_timings timings1;
- struct std_timings timings2[8];
- struct detailed_monitor_section det_mon[4];
- xf86vdifPtr vdif;
- int no_sections;
- Uchar *rawData;
-} xf86Monitor, *xf86MonPtr;
-
-extern xf86MonPtr ConfiguredMonitor;
-
-#endif /* _EDID_H_ */
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
deleted file mode 100644
index c0092aed9..000000000
--- a/hw/xfree86/ddc/interpret_edid.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_edid.c,v 1.8 2000/07/13 21:31:37 tsi Exp $ */
-
-/* interpret_edid.c: interpret a primary EDID block
- *
- * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#define _PARSE_EDID_
-#include "xf86DDC.h"
-
-static void get_vendor_section(Uchar*, struct vendor *);
-static void get_version_section(Uchar*, struct edid_version *);
-static void get_display_section(Uchar*, struct disp_features *);
-static void get_established_timing_section(Uchar*, struct established_timings *);
-static void get_std_timing_section(Uchar*, struct std_timings *);
-static void get_dt_md_section(Uchar *, struct edid_version *,
- struct detailed_monitor_section *det_mon);
-static void copy_string(Uchar *, Uchar *);
-static void get_dst_timing_section(Uchar *, struct std_timings *);
-static void get_monitor_ranges(Uchar *, struct monitor_ranges *);
-static void get_whitepoint_section(Uchar *, struct whitePoints *);
-static void get_detailed_timing_section(Uchar*, struct detailed_timings *);
-
-xf86MonPtr
-xf86InterpretEDID(int scrnIndex, Uchar *block)
-{
- xf86MonPtr m;
-
- if (!block) return NULL;
- if (! (m = xnfcalloc(sizeof(xf86Monitor),1))) return NULL;
- m->scrnIndex = scrnIndex;
- m->rawData = block;
- get_vendor_section(SECTION(VENDOR_SECTION,block),&m->vendor);
- get_version_section(SECTION(VERSION_SECTION,block),&m->ver);
- get_display_section(SECTION(DISPLAY_SECTION,block),&m->features);
- get_established_timing_section(SECTION(ESTABLISHED_TIMING_SECTION,block),
- &m->timings1);
- get_std_timing_section(SECTION(STD_TIMING_SECTION,block),m->timings2);
- get_dt_md_section(SECTION(DET_TIMING_SECTION,block),&m->ver, m->det_mon);
- m->no_sections = (int)*(char *)SECTION(NO_EDID,block);
- return (m);
-}
-
-static void
-get_vendor_section(Uchar *c, struct vendor *r)
-{
- r->name[0] = L1;
- r->name[1] = L2;
- r->name[2] = L3;
- r->name[3] = '\0';
-
- r->prod_id = PROD_ID;
- r->serial = SERIAL_NO;
- r->week = WEEK;
- r->year = YEAR;
-}
-
-static void
-get_version_section(Uchar *c, struct edid_version *r)
-{
- r->version = VERSION;
- r->revision = REVISION;
-}
-
-static void
-get_display_section(Uchar *c, struct disp_features *r)
-{
- r->input_type = INPUT_TYPE;
- r->input_voltage = INPUT_VOLTAGE;
- r->input_setup = SETUP;
- r->input_sync = SYNC;
- r->hsize = HSIZE_MAX;
- r->vsize = VSIZE_MAX;
- r->gamma = GAMMA;
- r->dpms = DPMS;
- r->display_type = DISPLAY_TYPE;
- r->msc = MSC;
- r->redx = REDX;
- r->redy = REDY;
- r->greenx = GREENX;
- r->greeny = GREENY;
- r->bluex = BLUEX;
- r->bluey = BLUEY;
- r->whitex = WHITEX;
- r->whitey = WHITEY;
-}
-
-static void
-get_established_timing_section(Uchar *c, struct established_timings *r)
-{
- r->t1 = T1;
- r->t2 = T2;
- r->t_manu = T_MANU;
-}
-
-static void
-get_std_timing_section(Uchar *c, struct std_timings *r)
-{
- int i;
-
- for (i=0;i<STD_TIMINGS;i++){
- r[i].hsize = HSIZE1;
- VSIZE1(r[i].vsize);
- r[i].refresh = REFRESH_R;
- r[i].id = STD_TIMING_ID;
- NEXT_STD_TIMING;
- }
-}
-
-static void
-get_dt_md_section(Uchar *c, struct edid_version *ver,
- struct detailed_monitor_section *det_mon)
-{
- int i;
-
- for (i=0;i<DET_TIMINGS;i++) {
- if (ver->version == 1 && ver->revision >= 1 && IS_MONITOR_DESC) {
-
- switch (MONITOR_DESC_TYPE) {
- case SERIAL_NUMBER:
- det_mon[i].type = DS_SERIAL;
- copy_string(c,det_mon[i].section.serial);
- break;
- case ASCII_STR:
- det_mon[i].type = DS_ASCII_STR;
- copy_string(c,det_mon[i].section.ascii_data);
- break;
- case MONITOR_RANGES:
- det_mon[i].type = DS_RANGES;
- get_monitor_ranges(c,&det_mon[i].section.ranges);
- break;
- case MONITOR_NAME:
- det_mon[i].type = DS_NAME;
- copy_string(c,det_mon[i].section.name);
- break;
- case ADD_COLOR_POINT:
- det_mon[i].type = DS_WHITE_P;
- get_whitepoint_section(c,det_mon[i].section.wp);
- break;
- case ADD_STD_TIMINGS:
- det_mon[i].type = DS_STD_TIMINGS;
- get_dst_timing_section(c,det_mon[i].section.std_t);
- break;
- }
- } else {
- det_mon[i].type = DT;
- get_detailed_timing_section(c,&det_mon[i].section.d_timings);
- }
- NEXT_DT_MD_SECTION;
- }
-}
-
-static void
-copy_string(Uchar *c, Uchar *s)
-{
- int i;
- c = c + 5;
- for (i = 0; (i < 13 && *c != 0x0A); i++)
- *(s++) = *(c++);
- *s = 0;
- while (i-- && (*--s == 0x20)) *s = 0;
-}
-
-static void
-get_dst_timing_section(Uchar *c, struct std_timings *t)
-{
- int j;
- c = c + 5;
- for (j = 0; j < 5; j++) {
- t[j].hsize = HSIZE1;
- VSIZE1(t[j].vsize);
- t[j].refresh = REFRESH_R;
- t[j].id = STD_TIMING_ID;
- NEXT_STD_TIMING;
- }
-}
-
-static void
-get_monitor_ranges(Uchar *c, struct monitor_ranges *r)
-{
- r->min_v = MIN_V;
- r->max_v = MAX_V;
- r->min_h = MIN_H;
- r->max_h = MAX_H;
- r->max_clock = MAX_CLOCK * 10;
-}
-
-static void
-get_whitepoint_section(Uchar *c, struct whitePoints *wp)
-{
- wp[1].white_x = WHITEX1;
- wp[1].white_y = WHITEY1;
- wp[2].white_x = WHITEX2;
- wp[2].white_y = WHITEY2;
- wp[1].index = WHITE_INDEX1;
- wp[2].index = WHITE_INDEX2;
- wp[1].white_gamma = WHITE_GAMMA1;
- wp[2].white_gamma = WHITE_GAMMA2;
-}
-
-static void
-get_detailed_timing_section(Uchar *c, struct detailed_timings *r)
-{
- r->clock = PIXEL_CLOCK;
- r->h_active = H_ACTIVE;
- r->h_blanking = H_BLANK;
- r->v_active = V_ACTIVE;
- r->v_blanking = V_BLANK;
- r->h_sync_off = H_SYNC_OFF;
- r->h_sync_width = H_SYNC_WIDTH;
- r->v_sync_off = V_SYNC_OFF;
- r->v_sync_width = V_SYNC_WIDTH;
- r->h_size = H_SIZE;
- r->v_size = V_SIZE;
- r->h_border = H_BORDER;
- r->v_border = V_BORDER;
- r->interlaced = INTERLACED;
- r->stereo = STEREO;
- r->sync = SYNC_T;
- r->misc = MISC;
-}
-
-
diff --git a/hw/xfree86/ddc/interpret_vdif.c b/hw/xfree86/ddc/interpret_vdif.c
deleted file mode 100644
index acd931e70..000000000
--- a/hw/xfree86/ddc/interpret_vdif.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c,v 1.6 2000/01/21 02:30:00 dawes Exp $ */
-
-#include "Xarch.h"
-#include "xf86DDC.h"
-#include "vdif.h"
-
-static xf86VdifLimitsPtr* get_limits(CARD8 *c);
-static xf86VdifGammaPtr* get_gamma(CARD8 *c);
-static xf86VdifTimingPtr* get_timings(CARD8 *c);
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32 swap_byte_order(CARD32 c);
-#endif
-
-xf86vdifPtr
-xf86InterpretVdif(CARD8 *c)
-{
- xf86VdifPtr p = (xf86VdifPtr)c;
- xf86vdifPtr vdif;
- int i;
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- int length;
-#endif
- unsigned long l = 0;
-
- if (c == NULL) return NULL;
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- length = swap_byte_order(p->FileLength);
- for (i = 0; i < (length >>2); i++)
- ((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ;
-#endif
- if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I'
- || p->VDIFId[3] != 'F') return NULL;
- for ( i = 12; i < p->FileLength; i++)
- l += c[i];
- if ( l != p->Checksum) return NULL;
- vdif = xalloc(sizeof(xf86vdif));
- vdif->vdif = p;
- vdif->limits = get_limits(c);
- vdif->timings = get_timings(c);
- vdif->gamma = get_gamma(c);
- vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0);
- xfree(c);
- return vdif;
-}
-
-static xf86VdifLimitsPtr*
-get_limits(CARD8 *c)
-{
- int num, i, j;
- xf86VdifLimitsPtr *pp;
- xf86VdifLimitsPtr p;
-
- num = ((xf86VdifPtr)c)->NumberOperationalLimits;
- pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1));
- p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
- j = 0;
- for ( i = 0; i<num; i++) {
- if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
- pp[j++] = p;
- VDIF_NEXT_OPERATIONAL_LIMITS(p);
- }
- pp[j] = NULL;
- return pp;
-}
-
-static xf86VdifGammaPtr*
-get_gamma(CARD8 *c)
-{
- int num, i, j;
- xf86VdifGammaPtr *pp;
- xf86VdifGammaPtr p;
-
- num = ((xf86VdifPtr)c)->NumberOptions;
- pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1));
- p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c));
- j = 0;
- for ( i = 0; i<num; i++)
- {
- if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG)
- pp[j++] = p;
- VDIF_NEXT_OPTIONS(p);
- }
- pp[j] = NULL;
- return pp;
-}
-
-static xf86VdifTimingPtr*
-get_timings(CARD8 *c)
-{
- int num, num_limits;
- int i,j,k;
- xf86VdifLimitsPtr lp;
- xf86VdifTimingPtr *pp;
- xf86VdifTimingPtr p;
-
- num = ((xf86VdifPtr)c)->NumberOperationalLimits;
- lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
- num_limits = 0;
- for (i = 0; i < num; i++) {
- if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
- num_limits += lp->NumberPreadjustedTimings;
- VDIF_NEXT_OPERATIONAL_LIMITS(lp);
- }
- pp = xalloc(sizeof(xf86VdifTimingPtr)
- * (num_limits+1));
- j = 0;
- lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c));
- for (i = 0; i < num; i++) {
- p = VDIF_PREADJUSTED_TIMING(lp);
- for (k = 0; k < lp->NumberPreadjustedTimings; k++) {
- if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG)
- pp[j++] = p;
- VDIF_NEXT_PREADJUSTED_TIMING(p);
- }
- VDIF_NEXT_OPERATIONAL_LIMITS(lp);
- }
- pp[j] = NULL;
- return pp;
-}
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32
-swap_byte_order(CARD32 c)
-{
- return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8)
- | ((c & 0xFF00) << 8) | ((c & 0xFF) << 24);
-}
-
-#endif
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
deleted file mode 100644
index 064533800..000000000
--- a/hw/xfree86/ddc/print_edid.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.16 2003/09/24 02:43:17 dawes Exp $ */
-
-/* print_edid.c: print out all information retrieved from display device
- *
- * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "xf86DDC.h"
-
-static void print_vendor(int scrnIndex, struct vendor *);
-static void print_version(int scrnIndex, struct edid_version *);
-static void print_display(int scrnIndex, struct disp_features *);
-static void print_established_timings(int scrnIndex,
- struct established_timings *);
-static void print_std_timings(int scrnIndex, struct std_timings *);
-static void print_detailed_monitor_section(int scrnIndex,
- struct detailed_monitor_section *);
-static void print_detailed_timings(int scrnIndex, struct detailed_timings *);
-
-static void print_input_features(int scrnIndex, struct disp_features *);
-static void print_dpms_features(int scrnIndex, struct disp_features *);
-static void print_whitepoint(int scrnIndex, struct disp_features *);
-
-xf86MonPtr
-xf86PrintEDID(xf86MonPtr m)
-{
- if (!(m)) return NULL;
- print_vendor(m->scrnIndex,&m->vendor);
- print_version(m->scrnIndex,&m->ver);
- print_display(m->scrnIndex,&m->features);
- print_established_timings(m->scrnIndex,&m->timings1);
- print_std_timings(m->scrnIndex,m->timings2);
- print_detailed_monitor_section(m->scrnIndex,m->det_mon);
- return m;
-}
-
-static void
-print_vendor(int scrnIndex, struct vendor *c)
-{
- xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n",
- (char *)&c->name, c->prod_id, c->serial);
- xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
-}
-
-static void
-print_version(int scrnIndex, struct edid_version *c)
-{
- xf86DrvMsg(scrnIndex,X_INFO,"EDID Version: %u.%u\n",c->version,
- c->revision);
-}
-
-static void
-print_display(int scrnIndex, struct disp_features *disp)
-{
- print_input_features(scrnIndex,disp);
- xf86DrvMsg(scrnIndex,X_INFO,"Max H-Image Size [cm]: ");
- if (disp->hsize)
- xf86ErrorF("horiz.: %i ",disp->hsize);
- else
- xf86ErrorF("H-Size may change, ");
- if (disp->vsize)
- xf86ErrorF("vert.: %i\n",disp->vsize);
- else
- xf86ErrorF("V-Size may change\n");
- xf86DrvMsg(scrnIndex,X_INFO,"Gamma: %.2f\n", disp->gamma);
- print_dpms_features(scrnIndex,disp);
- print_whitepoint(scrnIndex,disp);
-}
-
-static void
-print_input_features(int scrnIndex, struct disp_features *c)
-{
- if (DIGITAL(c->input_type))
- xf86DrvMsg(scrnIndex,X_INFO,"Digital Display Input\n");
- else {
- xf86DrvMsg(scrnIndex,X_INFO,"Analog Display Input, ");
- xf86ErrorF("Input Voltage Level: ");
- switch (c->input_voltage){
- case V070:
- xf86ErrorF("0.700/0.300 V\n");
- break;
- case V071:
- xf86ErrorF("0.714/0.286 V\n");
- break;
- case V100:
- xf86ErrorF("1.000/0.400 V\n");
- break;
- case V007:
- xf86ErrorF("0.700/0.700 V\n");
- break;
- default:
- xf86ErrorF("undefined\n");
- }
- if (SIG_SETUP(c->input_setup))
- xf86DrvMsg(scrnIndex,X_INFO,"Signal levels configurable\n");
- xf86DrvMsg(scrnIndex,X_INFO,"Sync:");
- if (SEP_SYNC(c->input_sync))
- xf86ErrorF(" Separate");
- if (COMP_SYNC(c->input_sync))
- xf86ErrorF(" Composite");
- if (SYNC_O_GREEN(c->input_sync))
- xf86ErrorF(" SyncOnGreen");
- if (SYNC_SERR(c->input_sync))
- xf86ErrorF("Serration on. "
- "V.Sync Pulse req. if CompSync or SyncOnGreen\n");
- else xf86ErrorF("\n");
- }
-}
-
-static void
-print_dpms_features(int scrnIndex, struct disp_features *c)
-{
- if (c->dpms) {
- xf86DrvMsg(scrnIndex,X_INFO,"DPMS capabilities:");
- if (DPMS_STANDBY(c->dpms)) xf86ErrorF(" StandBy");
- if (DPMS_SUSPEND(c->dpms)) xf86ErrorF(" Suspend");
- if (DPMS_OFF(c->dpms)) xf86ErrorF(" Off");
- } else
- xf86DrvMsg(scrnIndex,X_INFO,"No DPMS capabilities specified");
- switch (c->display_type){
- case DISP_MONO:
- xf86ErrorF("; Monochorome/GrayScale Display\n");
- break;
- case DISP_RGB:
- xf86ErrorF("; RGB/Color Display\n");
- break;
- case DISP_MULTCOLOR:
- xf86ErrorF("; Non RGB Multicolor Display\n");
- break;
- default:
- xf86ErrorF("\n");
- break;
- }
- if (STD_COLOR_SPACE(c->msc))
- xf86DrvMsg(scrnIndex,X_INFO,
- "Default color space is primary color space\n");
- if (PREFERRED_TIMING_MODE(c->msc))
- xf86DrvMsg(scrnIndex,X_INFO,
- "First detailed timing is preferred mode\n");
- if (GFT_SUPPORTED(c->msc))
- xf86DrvMsg(scrnIndex,X_INFO,
- "GTF timings supported\n");
-}
-
-static void
-print_whitepoint(int scrnIndex, struct disp_features *disp)
-{
- xf86DrvMsg(scrnIndex,X_INFO,"redX: %.3f redY: %.3f ",
- disp->redx,disp->redy);
- xf86ErrorF("greenX: %.3f greenY: %.3f\n",
- disp->greenx,disp->greeny);
- xf86DrvMsg(scrnIndex,X_INFO,"blueX: %.3f blueY: %.3f ",
- disp->bluex,disp->bluey);
- xf86ErrorF("whiteX: %.3f whiteY: %.3f\n",
- disp->whitex,disp->whitey);
-}
-
-static void
-print_established_timings(int scrnIndex, struct established_timings *t)
-{
- unsigned char c;
-
- if (t->t1 || t->t2 || t->t_manu)
- xf86DrvMsg(scrnIndex,X_INFO,"Supported VESA Video Modes:\n");
- c=t->t1;
- if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"720x400@70Hz\n");
- if (c&0x40) xf86DrvMsg(scrnIndex,X_INFO,"720x400@88Hz\n");
- if (c&0x20) xf86DrvMsg(scrnIndex,X_INFO,"640x480@60Hz\n");
- if (c&0x10) xf86DrvMsg(scrnIndex,X_INFO,"640x480@67Hz\n");
- if (c&0x08) xf86DrvMsg(scrnIndex,X_INFO,"640x480@72Hz\n");
- if (c&0x04) xf86DrvMsg(scrnIndex,X_INFO,"640x480@75Hz\n");
- if (c&0x02) xf86DrvMsg(scrnIndex,X_INFO,"800x600@56Hz\n");
- if (c&0x01) xf86DrvMsg(scrnIndex,X_INFO,"800x600@60Hz\n");
- c=t->t2;
- if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"800x600@72Hz\n");
- if (c&0x40) xf86DrvMsg(scrnIndex,X_INFO,"800x600@75Hz\n");
- if (c&0x20) xf86DrvMsg(scrnIndex,X_INFO,"832x624@75Hz\n");
- if (c&0x10) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@87Hz (interlaced)\n");
- if (c&0x08) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@60Hz\n");
- if (c&0x04) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@70Hz\n");
- if (c&0x02) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@75Hz\n");
- if (c&0x01) xf86DrvMsg(scrnIndex,X_INFO,"1280x1024@75Hz\n");
- c=t->t_manu;
- if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"1152x870@75Hz\n");
- xf86DrvMsg(scrnIndex,X_INFO,"Manufacturer's mask: %X\n",c&0x7F);
-}
-
-static void
-print_std_timings(int scrnIndex, struct std_timings *t)
-{
- int i;
- char done = 0;
- for (i=0;i<STD_TIMINGS;i++) {
- if (t[i].hsize > 256) { /* sanity check */
- if (!done) {
- xf86DrvMsg(scrnIndex,X_INFO,"Supported Future Video Modes:\n");
- done = 1;
- }
- xf86DrvMsg(scrnIndex,X_INFO,
- "#%i: hsize: %i vsize %i refresh: %i vid: %i\n",
- i, t[i].hsize, t[i].vsize, t[i].refresh, t[i].id);
- }
- }
-}
-
-static void
-print_detailed_monitor_section(int scrnIndex,
- struct detailed_monitor_section *m)
-{
- int i,j;
-
- for (i=0;i<DET_TIMINGS;i++) {
- switch (m[i].type) {
- case DT:
- print_detailed_timings(scrnIndex,&m[i].section.d_timings);
- break;
- case DS_SERIAL:
- xf86DrvMsg(scrnIndex,X_INFO,"Serial No: %s\n",m[i].section.serial);
- break;
- case DS_ASCII_STR:
- xf86DrvMsg(scrnIndex,X_INFO," %s\n",m[i].section.ascii_data);
- break;
- case DS_NAME:
- xf86DrvMsg(scrnIndex,X_INFO,"Monitor name: %s\n",m[i].section.name);
- break;
- case DS_RANGES:
- xf86DrvMsg(scrnIndex,X_INFO,
- "Ranges: V min: %i V max: %i Hz, H min: %i H max: %i kHz,",
- m[i].section.ranges.min_v, m[i].section.ranges.max_v,
- m[i].section.ranges.min_h, m[i].section.ranges.max_h);
- if (m[i].section.ranges.max_clock != 0)
- xf86ErrorF(" PixClock max %i MHz\n",m[i].section.ranges.max_clock);
- else
- xf86DrvMsg(scrnIndex,X_INFO,"\n");
- break;
- case DS_STD_TIMINGS:
- for (j = 0; j<5; j++)
- xf86DrvMsg(scrnIndex,X_INFO,"#%i: hsize: %i vsize %i refresh: %i "
- "vid: %i\n",i,m[i].section.std_t[i].hsize,
- m[i].section.std_t[j].vsize,m[i].section.std_t[j].refresh,
- m[i].section.std_t[j].id);
- break;
- case DS_WHITE_P:
- for (j = 0; j<2; j++)
- if (m[i].section.wp[j].index != 0)
- xf86DrvMsg(scrnIndex,X_INFO,
- "White point %i: whiteX: %f, whiteY: %f; gamma: %f\n",
- m[i].section.wp[j].index,m[i].section.wp[j].white_x,
- m[i].section.wp[j].white_y,
- m[i].section.wp[j].white_gamma);
- break;
- }
- }
-}
-
-static void
-print_detailed_timings(int scrnIndex, struct detailed_timings *t)
-{
-
- if (t->clock > 15000000) { /* sanity check */
- xf86DrvMsg(scrnIndex,X_INFO,"Supported additional Video Mode:\n");
- xf86DrvMsg(scrnIndex,X_INFO,"clock: %.1f MHz ",t->clock/1000000.0);
- xf86ErrorF("Image Size: %i x %i mm\n",t->h_size,t->v_size);
- xf86DrvMsg(scrnIndex,X_INFO,
- "h_active: %i h_sync: %i h_sync_end %i h_blank_end %i ",
- t->h_active, t->h_sync_off + t->h_active,
- t->h_sync_off + t->h_sync_width + t->h_active,
- t->h_active + t->h_blanking);
- xf86ErrorF("h_border: %i\n",t->h_border);
- xf86DrvMsg(scrnIndex,X_INFO,
- "v_active: %i v_sync: %i v_sync_end %i v_blanking: %i ",
- t->v_active, t->v_sync_off + t->v_active,
- t->v_sync_off + t->v_sync_width + t->v_active,
- t->v_active + t->v_blanking);
- xf86ErrorF("v_border: %i\n",t->v_border);
- if (IS_STEREO(t->stereo)) {
- xf86DrvMsg(scrnIndex,X_INFO,"Stereo: ");
- if (IS_RIGHT_ON_SYNC(t->stereo))
- xf86ErrorF("right channel on sync\n");
- else xf86ErrorF("right channel on sync\n");
- }
- }
-}
diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c
deleted file mode 100644
index fbb540e1d..000000000
--- a/hw/xfree86/ddc/print_vdif.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
-
-#include "vdif.h"
-#include "misc.h"
-#include "xf86DDC.h"
-
-static void print_vdif(xf86VdifPtr l, char *s);
-static void print_timings(xf86VdifTimingPtr *pt);
-static void print_limits(xf86VdifLimitsPtr *pl);
-static void print_gamma(xf86VdifGammaPtr *pg);
-static void print_type(CARD8 c);
-static void print_polarity(CARD8 c);
-
-void
-xf86print_vdif(xf86vdifPtr v)
-{
- print_vdif(v->vdif,v->strings);
- print_limits(v->limits);
- print_timings(v->timings);
- print_gamma(v->gamma);
-}
-
-static void
-print_vdif(xf86VdifPtr l, char *s)
-{
- ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision);
- ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0],
- l->Date[1],l->Date[2],l->DateManufactured[0],
- l->DateManufactured[1],l->DateManufactured[2]);
- ErrorF("File Revision: %i",l->FileRevision);
- ErrorF("Manufacturer: %s\n",s + l->Manufacturer);
- ErrorF("ModelNumber: %s\n",s + l->ModelNumber);
- ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex);
- ErrorF("Version: %s\n",s + l->Version);
- ErrorF("SerialNumber %s\n",s + l->SerialNumber);
- ErrorF("MonitorType: ");
- switch (l->MonitorType) {
- case VDIF_MONITOR_MONOCHROME:
- ErrorF("Mono\n");
- break;
- case VDIF_MONITOR_COLOR:
- ErrorF("Color\n");
- break;
- }
- ErrorF("CRT Size: %i inches\n",l->CRTSize);
- switch (l->MonitorType) {
- case VDIF_MONITOR_MONOCHROME:
- ErrorF("Border: %i percent\n",
- l->BorderRed);
- ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay);
- if (l->GreenPhosphorDecay !=0)
- ErrorF(" 2: %i,",l->GreenPhosphorDecay);
- if (l->BluePhosphorDecay !=0)
- ErrorF(" 3: %i",l->BluePhosphorDecay);
- ErrorF(" ms\n");
- if (l->RedChromaticity_x)
- ErrorF("Chromaticity: 1: x:%f, y:%f; ",
- l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0);
- if (l->GreenChromaticity_x)
- ErrorF("Chromaticity: 2: x:%f, y:%f; ",
- l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0);
- if (l->BlueChromaticity_x)
- ErrorF("Chromaticity: 3: x:%f, y:%f ",
- l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
- ErrorF("\n");
- ErrorF("Gamma: %f\n",l->RedGamma/1000.0);
- break;
- case VDIF_MONITOR_COLOR:
- ErrorF("Border: Red: %i Green: %i Blue: %i percent\n",
- l->BorderRed,l->BorderGreen,l->BorderBlue);
- ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n",
- l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay);
- ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; "
- "Blue: x:%f, y:%f\n",
- l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0,
- l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0,
- l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
- ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0,
- l->GreenGamma/1000.0,l->BlueGamma/1000.0);
- break;
- }
- ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0,
- l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0);
-}
-
-static void
-print_limits(xf86VdifLimitsPtr *pl)
-{
- int i = 0;
- xf86VdifLimitsPtr l;
-
- while((l = pl[i]) != NULL) {
- ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel,
- l->MaxVerPixel);
- ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength,
- l->MaxVerActiveHeight);
- ErrorF("Video Type: ");
- print_type(l->VideoType);
- ErrorF("Sync Type: ");
- print_type(l->SyncType);
- ErrorF("Sync Configuration ");
- switch (l->SyncConfiguration) {
- case VDIF_SYNC_SEPARATE:
- ErrorF("separate\n");
- break;
- case VDIF_SYNC_C:
- ErrorF("composite C\n");
- break;
- case VDIF_SYNC_CP:
- ErrorF("composite CP\n");
- break;
- case VDIF_SYNC_G:
- ErrorF("composite G\n");
- break;
- case VDIF_SYNC_GP:
- ErrorF("composite GP\n");
- break;
- case VDIF_SYNC_OTHER:
- ErrorF("other\n");
- break;
- }
- ErrorF("Termination Resistance: %i\n",l->TerminationResistance);
- ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n",
- l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel);
- ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0);
- ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n",
- l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0,
- l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0);
- ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0,
- l->MinVerRetrace/1000.0);
- }
-}
-
-static void
-print_timings(xf86VdifTimingPtr *pt)
-{
- int i = 0;
- xf86VdifTimingPtr t;
-
- while((t = pt[i]) != NULL) {
- ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName);
- ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel);
- ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight);
- ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio);
- ErrorF("Character width: %i",t->CharacterWidth);
- ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0,
- t->HorFrequency/1000.0,t->VerFrequency/1000.0);
- ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0,
- t->VerTotalTime/1000.0);
- ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, "
- "HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0,
- t->HorBlankStart/1000.0,t->HorBlankTime/1000.0,
- t->HorSyncStart/1000.0,t->HorSyncTime/1000.0);
- ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, "
- "VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0,
- t->VerBlankStart/1000.0,t->VerBlankTime/1000.0,
- t->VerSyncStart/1000.0,t->VerSyncTime/1000.0);
- ErrorF("Scan Type: ");
- switch (t->ScanType) {
- case VDIF_SCAN_INTERLACED:
- ErrorF("interlaced ");
- break;
- case VDIF_SCAN_NONINTERLACED:
- ErrorF("non interlaced ");
- break;
- case VDIF_SCAN_OTHER:
- ErrorF("other ");
- break;
- }
- ErrorF("Polarity: H: ");
- print_polarity(t->HorSyncPolarity);
- ErrorF("V: ");
- print_polarity(t->VerSyncPolarity);
- ErrorF("\n");
- }
-}
-
-static void
-print_gamma(xf86VdifGammaPtr *pg)
-{
- int i = 0;
- xf86VdifGammaPtr g;
-
- while((g = pg[i]) != NULL) {
- ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries);
- }
-}
-
-static void
-print_type(CARD8 c)
-{
- switch (c) {
- case VDIF_VIDEO_TTL :
- ErrorF("TTL\n");
- break;
- case VDIF_VIDEO_ANALOG :
- ErrorF("Analog\n");
- break;
- case VDIF_VIDEO_ECL:
- ErrorF("ECL\n");
- break;
- case VDIF_VIDEO_DECL:
- ErrorF("DECL\n");
- break;
- case VDIF_VIDEO_OTHER:
- ErrorF("other\n");
- break;
- }
-}
-
-static void
-print_polarity(CARD8 c)
-{
- switch (c) {
- case VDIF_POLARITY_NEGATIVE:
- ErrorF(" Neg.");
- break;
- case VDIF_POLARITY_POSITIVE:
- ErrorF(" Pos.");
- break;
- }
-}
diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h
deleted file mode 100644
index 8d358613e..000000000
--- a/hw/xfree86/ddc/vdif.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
-
-#ifndef _VDIF_H
-#define _VDIF_H
-
-#define VDIF_MONITOR_MONOCHROME 0
-#define VDIF_MONITOR_COLOR 1
-#define VDIF_VIDEO_TTL 0
-#define VDIF_VIDEO_ANALOG 1
-#define VDIF_VIDEO_ECL 2
-#define VDIF_VIDEO_DECL 3
-#define VDIF_VIDEO_OTHER 4
-#define VDIF_SYNC_SEPARATE 0
-#define VDIF_SYNC_C 1
-#define VDIF_SYNC_CP 2
-#define VDIF_SYNC_G 3
-#define VDIF_SYNC_GP 4
-#define VDIF_SYNC_OTHER 5
-#define VDIF_SCAN_NONINTERLACED 0
-#define VDIF_SCAN_INTERLACED 1
-#define VDIF_SCAN_OTHER 2
-#define VDIF_POLARITY_NEGATIVE 0
-#define VDIF_POLARITY_POSITIVE 1
-
-#include "Xmd.h"
-
-#undef CARD32
-#define CARD32 unsigned int /* ... on all supported platforms */
-
-typedef struct _VDIF { /* Monitor Description: */
- CARD8 VDIFId[4]; /* alway "VDIF" */
- CARD32 FileLength; /* lenght of the whole file */
- CARD32 Checksum; /* sum of all bytes in the file after*/
- /* this field */
- CARD16 VDIFVersion; /* structure version number */
- CARD16 VDIFRevision; /* structure revision number */
- CARD16 Date[3]; /* file date Year/Month/Day */
- CARD16 DateManufactured[3]; /* date Year/Month/Day */
- CARD32 FileRevision; /* file revision string */
- CARD32 Manufacturer; /* ASCII ID of the manufacturer */
- CARD32 ModelNumber; /* ASCII ID of the model */
- CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
- CARD32 Version; /* ASCII ID of the model version */
- CARD32 SerialNumber; /* ASCII ID of the serial number */
- CARD8 MonitorType; /* Monochrome or Color */
- CARD8 CRTSize; /* inches */
- CARD8 BorderRed; /* percent */
- CARD8 BorderGreen; /* percent */
- CARD8 BorderBlue; /* percent */
- CARD8 Reserved1; /* padding */
- CARD16 Reserved2; /* padding */
- CARD32 RedPhosphorDecay; /* microseconds */
- CARD32 GreenPhosphorDecay; /* microseconds */
- CARD32 BluePhosphorDecay; /* microseconds */
- CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
- CARD16 WhitePoint_y;
- CARD16 WhitePoint_Y;
- CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
- CARD16 RedChromaticity_y;
- CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
- CARD16 GreenChromaticity_y;
- CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
- CARD16 BlueChromaticity_y;
- CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
- CARD16 GreenGamma;
- CARD16 BlueGamma;
- CARD32 NumberOperationalLimits;
- CARD32 OffsetOperationalLimits;
- CARD32 NumberOptions; /* optinal sections (gamma table) */
- CARD32 OffsetOptions;
- CARD32 OffsetStringTable;
-} xf86VdifRec, *xf86VdifPtr;
-
-typedef enum { /* Tags for section identification */
- VDIF_OPERATIONAL_LIMITS_TAG = 1,
- VDIF_PREADJUSTED_TIMING_TAG,
- VDIF_GAMMA_TABLE_TAG
-} VDIFScnTag;
-
-typedef struct _VDIFScnHdr { /* Generic Section Header: */
- CARD32 ScnLength; /* lenght of section */
- CARD32 ScnTag; /* tag for section identification */
-} VDIFScnHdrRec, *VDIFScnHdrPtr;
-
-typedef struct _VDIFLimits { /* Operational Limits: */
- VDIFScnHdrRec Header; /* common section info */
- CARD16 MaxHorPixel; /* pixels */
- CARD16 MaxVerPixel; /* lines */
- CARD16 MaxHorActiveLength; /* millimeters */
- CARD16 MaxVerActiveHeight; /* millimeters */
- CARD8 VideoType; /* TTL / Analog / ECL / DECL */
- CARD8 SyncType; /* TTL / Analog / ECL / DECL */
- CARD8 SyncConfiguration; /* separate / composite / other */
- CARD8 Reserved1; /* padding */
- CARD16 Reserved2; /* padding */
- CARD16 TerminationResistance; /* */
- CARD16 WhiteLevel; /* millivolts */
- CARD16 BlackLevel; /* millivolts */
- CARD16 BlankLevel; /* millivolts */
- CARD16 SyncLevel; /* millivolts */
- CARD32 MaxPixelClock; /* kiloHertz */
- CARD32 MinHorFrequency; /* Hertz */
- CARD32 MaxHorFrequency; /* Hertz */
- CARD32 MinVerFrequency; /* milliHertz */
- CARD32 MaxVerFrequency; /* milliHertz */
- CARD16 MinHorRetrace; /* nanoseconds */
- CARD16 MinVerRetrace; /* microseconds */
- CARD32 NumberPreadjustedTimings;
- CARD32 OffsetNextLimits;
-} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
-
-typedef struct _VDIFTiming { /* Preadjusted Timing: */
- VDIFScnHdrRec Header; /* common section info */
- CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
- CARD16 HorPixel; /* pixels */
- CARD16 VerPixel; /* lines */
- CARD16 HorAddrLength; /* millimeters */
- CARD16 VerAddrHeight; /* millimeters */
- CARD8 PixelWidthRatio; /* gives H:V */
- CARD8 PixelHeightRatio;
- CARD8 Reserved1; /* padding */
- CARD8 ScanType; /* noninterlaced / interlaced / other*/
- CARD8 HorSyncPolarity; /* negative / positive */
- CARD8 VerSyncPolarity; /* negative / positive */
- CARD16 CharacterWidth; /* pixels */
- CARD32 PixelClock; /* kiloHertz */
- CARD32 HorFrequency; /* Hertz */
- CARD32 VerFrequency; /* milliHertz */
- CARD32 HorTotalTime; /* nanoseconds */
- CARD32 VerTotalTime; /* microseconds */
- CARD16 HorAddrTime; /* nanoseconds */
- CARD16 HorBlankStart; /* nanoseconds */
- CARD16 HorBlankTime; /* nanoseconds */
- CARD16 HorSyncStart; /* nanoseconds */
- CARD16 HorSyncTime; /* nanoseconds */
- CARD16 VerAddrTime; /* microseconds */
- CARD16 VerBlankStart; /* microseconds */
- CARD16 VerBlankTime; /* microseconds */
- CARD16 VerSyncStart; /* microseconds */
- CARD16 VerSyncTime; /* microseconds */
-} xf86VdifTimingRec, *xf86VdifTimingPtr;
-
-typedef struct _VDIFGamma { /* Gamma Table: */
- VDIFScnHdrRec Header; /* common section info */
- CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
- CARD16 Unused1;
-} xf86VdifGammaRec, *xf86VdifGammaPtr;
-
-/* access macros */
-#define VDIF_OPERATIONAL_LIMITS(vdif) \
-((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
-#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
- ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
-#define VDIF_PREADJUSTED_TIMING(limits) \
-((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
-#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
- ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
-#define VDIF_OPTIONS(vdif) \
- ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
-#define VDIF_NEXT_OPTIONS(options) options = \
- ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
-#define VDIF_STRING(vdif, string) \
- ((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
-
-typedef struct _vdif {
- xf86VdifPtr vdif;
- xf86VdifLimitsPtr *limits;
- xf86VdifTimingPtr *timings;
- xf86VdifGammaPtr *gamma;
- char * strings;
-} xf86vdif, *xf86vdifPtr;
-
-#undef CARD32
-
-#endif
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
deleted file mode 100644
index 496f3573f..000000000
--- a/hw/xfree86/ddc/xf86DDC.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.27 2003/10/30 17:48:19 tsi Exp $ */
-
-/* xf86DDC.c
- *
- * Copyright 1998,1999 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "xf86DDC.h"
-#include "ddcPriv.h"
-
-#ifdef XFree86LOADER
-static const OptionInfoRec *DDCAvailableOptions(void *unused);
-#endif
-
-const char *i2cSymbols[] = {
- "xf86CreateI2CDevRec",
- "xf86I2CDevInit",
- "xf86I2CWriteRead",
- "xf86I2CFindDev",
- "xf86DestroyI2CDevRec",
- NULL
-};
-
-#ifdef XFree86LOADER
-
-static MODULESETUPPROTO(ddcSetup);
-
-static XF86ModuleVersionInfo ddcVersRec =
-{
- "ddc",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL };
-
-ModuleInfoRec DDC = {
- 1,
- "DDC",
- NULL,
- 0,
- DDCAvailableOptions,
-};
-
-static pointer
-ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
-#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
- if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
-#endif
- xf86AddModuleInfo(&DDC, module);
- /*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- LoaderRefSymLists(i2cSymbols, NULL);
-
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
-
-#endif
-
-#define RETRIES 4
-
-static unsigned char *EDIDRead_DDC1(
- ScrnInfoPtr pScrn,
- void (*)(ScrnInfoPtr,xf86ddcSpeed),
- unsigned int (*)(ScrnInfoPtr)
-);
-
-static Bool TestDDC1(
- ScrnInfoPtr pScrn,
- unsigned int (*)(ScrnInfoPtr)
-);
-
-static unsigned int *FetchEDID_DDC1(
- ScrnInfoPtr,
- register unsigned int (*)(ScrnInfoPtr)
-);
-
-static unsigned char* EDID1Read_DDC2(
- int scrnIndex,
- I2CBusPtr pBus
-);
-
-static unsigned char * VDIFRead(
- int scrnIndex,
- I2CBusPtr pBus,
- int start
-);
-
-static unsigned char * DDCRead_DDC2(
- int scrnIndex,
- I2CBusPtr pBus,
- int start,
- int len
-);
-
-typedef enum {
- DDCOPT_NODDC1,
- DDCOPT_NODDC2,
- DDCOPT_NODDC
-} DDCOpts;
-
-static const OptionInfoRec DDCOptions[] = {
- { DDCOPT_NODDC1, "NoDDC1", OPTV_BOOLEAN, {0}, FALSE },
- { DDCOPT_NODDC2, "NoDDC2", OPTV_BOOLEAN, {0}, FALSE },
- { DDCOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-#ifdef XFree86LOADER
-/*ARGSUSED*/
-static const OptionInfoRec *
-DDCAvailableOptions(void *unused)
-{
- return (DDCOptions);
-}
-#endif
-
-xf86MonPtr
-xf86DoEDID_DDC1(
- int scrnIndex, void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
- unsigned int (*DDC1Read)(ScrnInfoPtr)
-)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- unsigned char *EDID_block = NULL;
- xf86MonPtr tmp = NULL;
- int sigio;
- /* Default DDC and DDC1 to enabled. */
- Bool noddc = FALSE, noddc1 = FALSE;
- OptionInfoPtr options;
-
- options = xnfalloc(sizeof(DDCOptions));
- (void)memcpy(options, DDCOptions, sizeof(DDCOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
- xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1);
- xfree(options);
-
- if (noddc || noddc1)
- return NULL;
-
- sigio = xf86BlockSIGIO();
- EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read);
- xf86UnblockSIGIO(sigio);
-
- if (EDID_block){
- tmp = xf86InterpretEDID(scrnIndex,EDID_block);
- }
-#ifdef DEBUG
- else ErrorF("No EDID block returned\n");
- if (!tmp)
- ErrorF("Cannot interpret EDID block\n");
-#endif
- return tmp;
-}
-
-xf86MonPtr
-xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- unsigned char *EDID_block = NULL;
- unsigned char *VDIF_Block = NULL;
- xf86MonPtr tmp = NULL;
- /* Default DDC and DDC2 to enabled. */
- Bool noddc = FALSE, noddc2 = FALSE;
- OptionInfoPtr options;
-
- options = xnfalloc(sizeof(DDCOptions));
- (void)memcpy(options, DDCOptions, sizeof(DDCOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
- xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2);
- xfree(options);
-
- if (noddc || noddc2)
- return NULL;
-
- EDID_block = EDID1Read_DDC2(scrnIndex,pBus);
-
- if (EDID_block){
- tmp = xf86InterpretEDID(scrnIndex,EDID_block);
- } else {
-#ifdef DEBUG
- ErrorF("No EDID block returned\n");
-#endif
- return NULL;
- }
-#ifdef DEBUG
- if (!tmp)
- ErrorF("Cannot interpret EDID block\n");
- ErrorF("Sections to follow: %i\n",tmp->no_sections);
-#endif
- VDIF_Block =
- VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
- tmp->vdif = xf86InterpretVdif(VDIF_Block);
-
- return tmp;
-}
-
-/*
- * read EDID record , pass it to callback function to interpret.
- * callback function will store it for further use by calling
- * function; it will also decide if we need to reread it
- */
-static unsigned char *
-EDIDRead_DDC1(ScrnInfoPtr pScrn, void (*DDCSpeed)(ScrnInfoPtr,xf86ddcSpeed),
- unsigned int (*read_DDC)(ScrnInfoPtr))
-{
- unsigned char *EDID_block = NULL;
- int count = RETRIES;
-
- if (!read_DDC) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "chipset doesn't support DDC1\n");
- return NULL;
- };
-
- if (TestDDC1(pScrn,read_DDC)==-1) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "No DDC signal\n");
- return NULL;
- };
-
- if (DDCSpeed) DDCSpeed(pScrn,DDC_FAST);
- do {
- EDID_block = GetEDID_DDC1(FetchEDID_DDC1(pScrn,read_DDC));
- count --;
- } while (!EDID_block && count);
- if (DDCSpeed) DDCSpeed(pScrn,DDC_SLOW);
-
- return EDID_block;
-}
-
-/* test if DDC1 return 0 if not */
-static Bool
-TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC)(ScrnInfoPtr))
-{
- int old, count;
-
- old = read_DDC(pScrn);
- count = HEADER * BITS_PER_BYTE;
- do {
- /* wait for next retrace */
- if (old != read_DDC(pScrn)) break;
- } while(count--);
- return (count);
-}
-
-/* fetch entire EDID record; DDC bit needs to be masked */
-static unsigned int *
-FetchEDID_DDC1(register ScrnInfoPtr pScrn,
- register unsigned int (*read_DDC)(ScrnInfoPtr))
-{
- int count = NUM;
- unsigned int *ptr, *xp;
-
- ptr=xp=xalloc(sizeof(int)*NUM);
-
- if (!ptr) return NULL;
- do {
- /* wait for next retrace */
- *xp = read_DDC(pScrn);
- xp++;
- } while(--count);
- return (ptr);
-}
-
-static unsigned char*
-EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
-{
- return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN);
-}
-
-static unsigned char*
-VDIFRead(int scrnIndex, I2CBusPtr pBus, int start)
-{
- unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL;
- int i, num = 0;
-
- /* read VDIF length in 64 byte blocks */
- Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
- if (Buffer == NULL)
- return NULL;
-#ifdef DEBUG
- ErrorF("number of 64 bit blocks: %i\n",Buffer[0]);
-#endif
- if ((num = Buffer[0]) > 0)
- v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num);
-
- for (i = 0; i < num; i++) {
- Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
- if (Buffer == NULL) {
- xfree (v_buffer);
- return NULL;
- }
- memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */
- xfree(Buffer);
- v_bufferp += 63;
- }
- return v_buffer;
-}
-
-static unsigned char *
-DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
-{
- I2CDevPtr dev;
- unsigned char W_Buffer[2];
- int w_bytes;
- unsigned char *R_Buffer;
- int i;
-
- xf86LoaderReqSymLists(i2cSymbols, NULL);
-
- if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
- dev = xf86CreateI2CDevRec();
- dev->DevName = "ddc2";
- dev->SlaveAddr = 0xA0;
- dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
- dev->StartTimeout = 550;
- dev->BitTimeout = 40;
- dev->ByteTimeout = 40;
- dev->AcknTimeout = 40;
-
- dev->pI2CBus = pBus;
- if (!xf86I2CDevInit(dev)) {
- xf86DrvMsg(scrnIndex, X_PROBED, "No DDC2 device\n");
- return NULL;
- }
- }
- if (start < 0x100) {
- w_bytes = 1;
- W_Buffer[0] = start;
- } else {
- w_bytes = 2;
- W_Buffer[0] = start & 0xFF;
- W_Buffer[1] = (start & 0xFF00) >> 8;
- }
- R_Buffer = xcalloc(1,sizeof(unsigned char)
- * (len));
- for (i=0; i<RETRIES; i++) {
- if (xf86I2CWriteRead(dev, W_Buffer,w_bytes, R_Buffer,len)) {
- if (!DDC_checksum(R_Buffer,len))
- return R_Buffer;
-
-#ifdef DEBUG
- else ErrorF("Checksum error in EDID block\n");
-#endif
- }
-#ifdef DEBUG
- else ErrorF("Error reading EDID block\n");
-#endif
- }
-
- xf86DestroyI2CDevRec(dev,TRUE);
- xfree(R_Buffer);
- return NULL;
-}
diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h
deleted file mode 100644
index b4252ef6b..000000000
--- a/hw/xfree86/ddc/xf86DDC.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.h,v 1.11 2003/02/17 16:08:27 dawes Exp $ */
-
-/* xf86DDC.h
- *
- * This file contains all information to interpret a standard EDIC block
- * transmitted by a display device via DDC (Display Data Channel). So far
- * there is no information to deal with optional EDID blocks.
- * DDC is a Trademark of VESA (Video Electronics Standard Association).
- *
- * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
- */
-
-
-#ifndef XF86_DDC_H
-# define XF86_DDC_H
-
-#include "edid.h"
-#include "xf86i2c.h"
-#include "xf86str.h"
-
-/* speed up / slow down */
-typedef enum {
- DDC_SLOW,
- DDC_FAST
-} xf86ddcSpeed;
-
-extern xf86MonPtr xf86DoEDID_DDC1(
- int scrnIndex,
- void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
- unsigned int (*DDC1Read)(ScrnInfoPtr)
-);
-
-extern xf86MonPtr xf86DoEDID_DDC2(
- int scrnIndex,
- I2CBusPtr pBus
-);
-
-extern xf86MonPtr xf86PrintEDID(
- xf86MonPtr monPtr
-);
-
-extern xf86MonPtr xf86InterpretEDID(
- int screenIndex, Uchar *block
-);
-
-extern xf86vdifPtr xf86InterpretVdif(
- CARD8 *c
-);
-
-extern Bool xf86SetDDCproperties(
- ScrnInfoPtr pScreen,
- xf86MonPtr DDC
-);
-
-extern void xf86print_vdif(
- xf86vdifPtr v
-);
-
-#endif
-
-
diff --git a/hw/xfree86/dixmods/GLcoremodule.c b/hw/xfree86/dixmods/GLcoremodule.c
deleted file mode 100644
index 9369db1f2..000000000
--- a/hw/xfree86/dixmods/GLcoremodule.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c,v 1.1 2002/02/25 00:45:41 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(GLcoreSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "GLcore",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL };
-
-static pointer
-GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* Need a non-NULL return value to indicate success */
- return (pointer)1;
-}
diff --git a/hw/xfree86/dixmods/afbmodule.c b/hw/xfree86/dixmods/afbmodule.c
deleted file mode 100644
index 19f196ad8..000000000
--- a/hw/xfree86/dixmods/afbmodule.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.1 1999/06/13 13:47:38 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "afb.h"
-
-static XF86ModuleVersionInfo VersRec =
-{
- "afb",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData afbModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/dixmods/bitmapmod.c b/hw/xfree86/dixmods/bitmapmod.c
deleted file mode 100644
index 27fc23d32..000000000
--- a/hw/xfree86/dixmods/bitmapmod.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/font/bitmap/module/bitmapmod.c,v 1.7 1999/01/26 05:53:47 dawes Exp $ */
-
-#include "misc.h"
-
-#include "fontmod.h"
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(bitmapSetup);
-
- /*
- * This is the module data function that is accessed when loading
- * libbitmap as a module.
- */
-
-static XF86ModuleVersionInfo VersRec =
-{
- "bitmap",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_FONT, /* Font module */
- ABI_FONT_VERSION,
- MOD_CLASS_FONT,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData bitmapModuleData = { &VersRec, bitmapSetup, NULL };
-
-extern void BitmapRegisterFontFileFunctions(void);
-
-FontModule bitmapModule = {
- BitmapRegisterFontFileFunctions,
- "Bitmap",
- NULL
-};
-
-static pointer
-bitmapSetup(pointer mod, pointer opts, int *errmaj, int *errmin)
-{
- bitmapModule.module = mod;
- LoadFont(&bitmapModule);
-
- /* Need a non-NULL return */
- return (pointer)1;
-}
diff --git a/hw/xfree86/dixmods/cfb16module.c b/hw/xfree86/dixmods/cfb16module.c
deleted file mode 100644
index c8c79b545..000000000
--- a/hw/xfree86/dixmods/cfb16module.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "cfb.h"
-
-static MODULESETUPPROTO(cfb16Setup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "cfb16",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData cfb16ModuleData = { &VersRec, cfb16Setup, NULL };
-
-static pointer
-cfb16Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* This modules requires cfb, so load it */
- return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin);
-}
-
-#endif
diff --git a/hw/xfree86/dixmods/cfb24module.c b/hw/xfree86/dixmods/cfb24module.c
deleted file mode 100644
index cf363f3c7..000000000
--- a/hw/xfree86/dixmods/cfb24module.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "cfb.h"
-
-static MODULESETUPPROTO(cfb24Setup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "cfb24",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData cfb24ModuleData = { &VersRec, cfb24Setup, NULL };
-
-static pointer
-cfb24Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* This modules requires cfb, so load it */
- return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin);
-}
-
-#endif
diff --git a/hw/xfree86/dixmods/cfb32module.c b/hw/xfree86/dixmods/cfb32module.c
deleted file mode 100644
index 791b64285..000000000
--- a/hw/xfree86/dixmods/cfb32module.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "cfb.h"
-
-static MODULESETUPPROTO(cfb32Setup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "cfb32",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData cfb32ModuleData = { &VersRec, cfb32Setup, NULL };
-
-static pointer
-cfb32Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* This modules requires cfb, so load it */
- return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin);
-}
-
-#endif
diff --git a/hw/xfree86/dixmods/cfbmodule.c b/hw/xfree86/dixmods/cfbmodule.c
deleted file mode 100644
index 87af699db..000000000
--- a/hw/xfree86/dixmods/cfbmodule.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.8 1999/01/26 05:53:48 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "cfb.h"
-
-static MODULESETUPPROTO(cfbSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "cfb",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData cfbModuleData = { &VersRec, cfbSetup, NULL };
-
-static pointer
-cfbSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* This modules requires mfb, so load it */
- return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL,
- errmaj, errmin);
-}
-
-#endif
diff --git a/hw/xfree86/dixmods/dbemodule.c b/hw/xfree86/dixmods/dbemodule.c
deleted file mode 100644
index f9dcc8477..000000000
--- a/hw/xfree86/dixmods/dbemodule.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.7 2000/01/25 18:37:37 dawes Exp $ */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(dbeSetup);
-
-extern void DbeExtensionInit(INITARGS);
-
-ExtensionModule dbeExt = {
- DbeExtensionInit,
- "DOUBLE-BUFFER",
- NULL,
- NULL,
- NULL
-};
-
-static XF86ModuleVersionInfo VersRec =
-{
- "dbe",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_EXTENSION,
- {0,0,0,0}
-};
-
-/*
- * Data for the loader
- */
-XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL };
-
-static pointer
-dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- LoadExtension(&dbeExt, FALSE);
-
- /* Need a non-NULL return value to indicate success */
- return (pointer)1;
-}
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
deleted file mode 100644
index a0108053c..000000000
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.22 2003/07/16 01:38:29 dawes Exp $ */
-
-#ifndef __DGAPROC_H
-#define __DGAPROC_H
-
-#include "Xproto.h"
-#include "pixmap.h"
-
-#define DGA_CONCURRENT_ACCESS 0x00000001
-#define DGA_FILL_RECT 0x00000002
-#define DGA_BLIT_RECT 0x00000004
-#define DGA_BLIT_RECT_TRANS 0x00000008
-#define DGA_PIXMAP_AVAILABLE 0x00000010
-
-#define DGA_INTERLACED 0x00010000
-#define DGA_DOUBLESCAN 0x00020000
-
-#define DGA_FLIP_IMMEDIATE 0x00000001
-#define DGA_FLIP_RETRACE 0x00000002
-
-#define DGA_COMPLETED 0x00000000
-#define DGA_PENDING 0x00000001
-
-#define DGA_NEED_ROOT 0x00000001
-
-typedef struct {
- int num; /* A unique identifier for the mode (num > 0) */
- char *name; /* name of mode given in the XF86Config */
- int VSync_num;
- int VSync_den;
- int flags; /* DGA_CONCURRENT_ACCESS, etc... */
- int imageWidth; /* linear accessible portion (pixels) */
- int imageHeight;
- int pixmapWidth; /* Xlib accessible portion (pixels) */
- int pixmapHeight; /* both fields ignored if no concurrent access */
- int bytesPerScanline;
- int byteOrder; /* MSBFirst, LSBFirst */
- int depth;
- int bitsPerPixel;
- unsigned long red_mask;
- unsigned long green_mask;
- unsigned long blue_mask;
- short visualClass;
- int viewportWidth;
- int viewportHeight;
- int xViewportStep; /* viewport position granularity */
- int yViewportStep;
- int maxViewportX; /* max viewport origin */
- int maxViewportY;
- int viewportFlags; /* types of page flipping possible */
- int offset;
- int reserved1;
- int reserved2;
-} XDGAModeRec, *XDGAModePtr;
-
-/* DDX interface */
-
-int
-DGASetMode(
- int Index,
- int num,
- XDGAModePtr mode,
- PixmapPtr *pPix
-);
-
-void
-DGASetInputMode(
- int Index,
- Bool keyboard,
- Bool mouse
-);
-
-void
-DGASelectInput(
- int Index,
- ClientPtr client,
- long mask
-);
-
-Bool DGAAvailable(int Index);
-Bool DGAActive(int Index);
-void DGAShutdown(void);
-void DGAInstallCmap(ColormapPtr cmap);
-int DGAGetViewportStatus(int Index);
-int DGASync(int Index);
-
-int
-DGAFillRect(
- int Index,
- int x, int y, int w, int h,
- unsigned long color
-);
-
-int
-DGABlitRect(
- int Index,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty
-);
-
-int
-DGABlitTransRect(
- int Index,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty,
- unsigned long color
-);
-
-int
-DGASetViewport(
- int Index,
- int x, int y,
- int mode
-);
-
-int DGAGetModes(int Index);
-int DGAGetOldDGAMode(int Index);
-
-int DGAGetModeInfo(int Index, XDGAModePtr mode, int num);
-
-Bool DGAVTSwitch(void);
-Bool DGAStealMouseEvent(int Index, xEvent *e, int dx, int dy);
-Bool DGAStealKeyEvent(int Index, xEvent *e);
-Bool DGAIsDgaEvent (xEvent *e);
-
-Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e);
-
-Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem,
- int *size, int *offset, int *flags);
-void DGACloseFramebuffer(int Index);
-Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode);
-int DGACreateColormap(int Index, ClientPtr client, int id, int mode,
- int alloc);
-
-extern unsigned char DGAReqCode;
-extern int DGAErrorBase;
-extern int DGAEventBase;
-extern int *XDGAEventBase;
-
-
-
-#endif /* __DGAPROC_H */
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
deleted file mode 100644
index dc76cbf21..000000000
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.17 2003/07/16 01:38:33 dawes Exp $ */
-
-/*
- *
- * Copyright (c) 1997 Matthieu Herrb
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Matthieu Herrb not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Matthieu Herrb makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL MATTHIEU HERRB BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-
-#include "xf86Module.h"
-#include "xf86Opt.h"
-
-#include "Xproto.h"
-
-#include "modinit.h"
-
-static MODULESETUPPROTO(extmodSetup);
-
-/*
- * Array describing extensions to be initialized
- */
-ExtensionModule extensionModules[] = {
-#ifdef SHAPE
- {
- ShapeExtensionInit,
- SHAPENAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef MULTIBUFFER
- {
- MultibufferExtensionInit,
- MULTIBUFFER_PROTOCOL_NAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef MITMISC
- {
- MITMiscExtensionInit,
- MITMISCNAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef notyet
- {
- XTestExtensionInit,
- XTestExtensionName,
- &noTestExtensions,
- NULL,
- NULL
- },
-#endif
-#ifdef BIGREQS
- {
- BigReqExtensionInit,
- XBigReqExtensionName,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XSYNC
- {
- SyncExtensionInit,
- SYNC_NAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef SCREENSAVER
- {
- ScreenSaverExtensionInit,
- ScreenSaverName,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XCMISC
- {
- XCMiscExtensionInit,
- XCMiscExtensionName,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XF86VIDMODE
- {
- XFree86VidModeExtensionInit,
- XF86VIDMODENAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XF86MISC
- {
- XFree86MiscExtensionInit,
- XF86MISCNAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XFreeXDGA
- {
- XFree86DGAExtensionInit,
- XF86DGANAME,
- NULL,
- XFree86DGARegister,
- NULL
- },
-#endif
-#ifdef DPMSExtension
- {
- DPMSExtensionInit,
- DPMSExtensionName,
- NULL,
- NULL
- },
-#endif
-#ifdef FONTCACHE
- {
- FontCacheExtensionInit,
- FONTCACHENAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef TOGCUP
- {
- XcupExtensionInit,
- XCUPNAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef EVI
- {
- EVIExtensionInit,
- EVINAME,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef XV
- {
- XvExtensionInit,
- XvName,
- NULL,
- XvRegister,
- NULL
- },
- {
- XvMCExtensionInit,
- XvMCName,
- NULL,
- NULL,
- NULL
- },
-#endif
-#ifdef RES
- {
- ResExtensionInit,
- XRES_NAME,
- NULL,
- NULL,
- NULL
- },
-#endif
- { /* DON'T delete this entry ! */
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- }
-};
-
-static XF86ModuleVersionInfo VersRec =
-{
- "extmod",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_EXTENSION,
- {0,0,0,0}
-};
-
-/*
- * Data for the loader
- */
-XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL };
-
-static pointer
-extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- int i;
-
- /* XXX the option stuff here is largely a sample/test case */
-
- for (i = 0; extensionModules[i].name != NULL; i++) {
- if (opts) {
- char *s;
- s = (char *)xalloc(strlen(extensionModules[i].name) + 5);
- if (s) {
- pointer o;
- strcpy(s, "omit");
- strcat(s, extensionModules[i].name);
- o = xf86FindOption(opts, s);
- xfree(s);
- if (o) {
- xf86MarkOptionUsed(o);
- continue;
- }
- }
- }
- LoadExtension(&extensionModules[i], FALSE);
- }
- /* Need a non-NULL return */
- return (pointer)1;
-}
-
-#endif /* XFree86LOADER */
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
deleted file mode 100644
index cc717c31b..000000000
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.2 2003/09/13 21:33:04 dawes Exp $ */
-
-#ifndef INITARGS
-#define INITARGS void
-#endif
-
-#ifdef SHAPE
-extern void ShapeExtensionInit(INITARGS);
-#define _SHAPE_SERVER_ /* don't want Xlib structures */
-#include "shapestr.h"
-#endif
-
-#ifdef MULTIBUFFER
-extern void MultibufferExtensionInit(INITARGS);
-#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
-#include "multibufst.h"
-#endif
-
-#ifdef MITMISC
-extern void MITMiscExtensionInit(INITARGS);
-#define _MITMISC_SERVER_
-#include "mitmiscstr.h"
-#endif
-
-#ifdef XTEST
-extern void XTestExtensionInit(INITARGS);
-#define _XTEST_SERVER_
-#include "XTest.h"
-#include "xteststr.h"
-#endif
-
-#if 1
-extern void XTestExtension1Init(INITARGS);
-#endif
-
-#ifdef BIGREQS
-extern void BigReqExtensionInit(INITARGS);
-#include "bigreqstr.h"
-#endif
-
-#ifdef XSYNC
-extern void SyncExtensionInit(INITARGS);
-#define _SYNC_SERVER
-#include "sync.h"
-#include "syncstr.h"
-#endif
-
-#ifdef SCREENSAVER
-extern void ScreenSaverExtensionInit (INITARGS);
-#include "saver.h"
-#endif
-
-#ifdef XCMISC
-extern void XCMiscExtensionInit(INITARGS);
-#include "xcmiscstr.h"
-#endif
-
-#ifdef XF86VIDMODE
-extern void XFree86VidModeExtensionInit(INITARGS);
-#define _XF86VIDMODE_SERVER_
-#include "xf86vmstr.h"
-#endif
-
-#ifdef XF86MISC
-extern void XFree86MiscExtensionInit(INITARGS);
-#define _XF86MISC_SERVER_
-#define _XF86MISC_SAVER_COMPAT_
-#include "xf86mscstr.h"
-#endif
-
-#ifdef XFreeXDGA
-extern void XFree86DGAExtensionInit(INITARGS);
-extern void XFree86DGARegister(INITARGS);
-#define _XF86DGA_SERVER_
-#include "xf86dgastr.h"
-#endif
-
-#ifdef DPMSExtension
-extern void DPMSExtensionInit(INITARGS);
-#include "dpmsstr.h"
-#endif
-
-#ifdef FONTCACHE
-extern void FontCacheExtensionInit(INITARGS);
-#define _FONTCACHE_SERVER_
-#include "fontcacheP.h"
-#include "fontcachstr.h"
-#endif
-
-#ifdef TOGCUP
-extern void XcupExtensionInit(INITARGS);
-#define _XCUP_SERVER_
-#include "Xcupstr.h"
-#endif
-
-#ifdef EVI
-extern void EVIExtensionInit(INITARGS);
-#define _XEVI_SERVER_
-#include "XEVIstr.h"
-#endif
-
-#ifdef XV
-extern void XvExtensionInit(INITARGS);
-extern void XvMCExtensionInit(INITARGS);
-extern void XvRegister(INITARGS);
-#include "Xv.h"
-#include "XvMC.h"
-#endif
-
-#ifdef RES
-extern void ResExtensionInit(INITARGS);
-#include "XResproto.h"
-#endif
-
-#ifdef SHM
-extern void ShmExtensionInit(INITARGS);
-#include "shmstr.h"
-extern void ShmSetPixmapFormat(
- ScreenPtr pScreen,
- int format);
-extern void ShmRegisterFuncs(
- ScreenPtr pScreen,
- ShmFuncsPtr funcs);
-#endif
-
-#if 1
-extern void SecurityExtensionInit(INITARGS);
-#endif
-
-#if 1
-extern void XagExtensionInit(INITARGS);
-#endif
-
-#if 1
-extern void XpExtensionInit(INITARGS);
-#endif
-
-#if 1
-extern void PanoramiXExtensionInit(int argc, char *argv[]);
-#endif
-
-#if 1
-extern void XkbExtensionInit(INITARGS);
-#endif
diff --git a/hw/xfree86/dixmods/extmod/vidmodeproc.h b/hw/xfree86/dixmods/extmod/vidmodeproc.h
deleted file mode 100644
index 57a7872f0..000000000
--- a/hw/xfree86/dixmods/extmod/vidmodeproc.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.5 2001/05/06 00:51:19 mvojkovi Exp $ */
-
-/* Prototypes for DGA functions that the DDX must provide */
-
-#ifndef _VIDMODEPROC_H_
-#define _VIDMODEPROC_H_
-
-
-typedef enum {
- VIDMODE_H_DISPLAY,
- VIDMODE_H_SYNCSTART,
- VIDMODE_H_SYNCEND,
- VIDMODE_H_TOTAL,
- VIDMODE_H_SKEW,
- VIDMODE_V_DISPLAY,
- VIDMODE_V_SYNCSTART,
- VIDMODE_V_SYNCEND,
- VIDMODE_V_TOTAL,
- VIDMODE_FLAGS,
- VIDMODE_CLOCK
-} VidModeSelectMode;
-
-typedef enum {
- VIDMODE_MON_VENDOR,
- VIDMODE_MON_MODEL,
- VIDMODE_MON_NHSYNC,
- VIDMODE_MON_NVREFRESH,
- VIDMODE_MON_HSYNC_LO,
- VIDMODE_MON_HSYNC_HI,
- VIDMODE_MON_VREFRESH_LO,
- VIDMODE_MON_VREFRESH_HI
-} VidModeSelectMonitor;
-
-typedef union {
- pointer ptr;
- int i;
- float f;
-} vidMonitorValue;
-
-void XFree86VidModeExtensionInit(void);
-
-Bool VidModeAvailable(int scrnIndex);
-Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock);
-Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock);
-Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock);
-Bool VidModeDeleteModeline(int scrnIndex, pointer mode);
-Bool VidModeZoomViewport(int scrnIndex, int zoom);
-Bool VidModeGetViewPort(int scrnIndex, int *x, int *y);
-Bool VidModeSetViewPort(int scrnIndex, int x, int y);
-Bool VidModeSwitchMode(int scrnIndex, pointer mode);
-Bool VidModeLockZoom(int scrnIndex, Bool lock);
-Bool VidModeGetMonitor(int scrnIndex, pointer *monitor);
-int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock);
-Bool VidModeGetClocks(int scrnIndex, int *Clocks);
-ModeStatus VidModeCheckModeForMonitor(int scrnIndex, pointer mode);
-ModeStatus VidModeCheckModeForDriver(int scrnIndex, pointer mode);
-void VidModeSetCrtcForMode(int scrnIndex, pointer mode);
-Bool VidModeAddModeline(int scrnIndex, pointer mode);
-int VidModeGetDotClock(int scrnIndex, int Clock);
-int VidModeGetNumOfModes(int scrnIndex);
-Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue);
-Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue);
-pointer VidModeCreateMode(void);
-void VidModeCopyMode(pointer modefrom, pointer modeto);
-int VidModeGetModeValue(pointer mode, int valtyp);
-void VidModeSetModeValue(pointer mode, int valtyp, int val);
-vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx);
-Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
-Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
-int VidModeGetGammaRampSize(int scrnIndex);
-
-#endif
-
-
diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c
deleted file mode 100644
index 973f54e23..000000000
--- a/hw/xfree86/dixmods/extmod/xf86dga.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.22 2003/07/16 01:38:30 dawes Exp $ */
-
-/*
-
-Copyright (c) 1995 Jon Tombs
-Copyright (c) 1995, 1996, 1999 XFree86 Inc
-
-*/
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _XF86DGA_SERVER_
-#include "xf86dga.h"
-#include "xf86dgastr.h"
-#include "swaprep.h"
-#include "dgaproc.h"
-
-#include "xf86dgaext.h"
-
-
-static DISPATCH_PROC(ProcXF86DGADirectVideo);
-static DISPATCH_PROC(ProcXF86DGAGetVidPage);
-static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
-static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
-static DISPATCH_PROC(ProcXF86DGASetVidPage);
-static DISPATCH_PROC(ProcXF86DGASetViewPort);
-static DISPATCH_PROC(ProcXF86DGAInstallColormap);
-static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
-static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
-
-
-static int
-ProcXF86DGAGetVideoLL(ClientPtr client)
-{
- REQUEST(xXF86DGAGetVideoLLReq);
- xXF86DGAGetVideoLLReply rep;
- XDGAModeRec mode;
- int num, offset, flags;
- char *name;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if(!DGAAvailable(stuff->screen))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
-
- if(!(num = DGAGetOldDGAMode(stuff->screen)))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
-
- /* get the parameters for the mode that best matches */
- DGAGetModeInfo(stuff->screen, &mode, num);
-
- if(!DGAOpenFramebuffer(stuff->screen, &name,
- (unsigned char**)(&rep.offset),
- (int*)(&rep.bank_size), &offset, &flags))
- return BadAlloc;
-
- rep.offset += mode.offset;
- rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3);
- rep.ram_size = rep.bank_size >> 10;
-
- WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DGADirectVideo(ClientPtr client)
-{
- int num;
- PixmapPtr pix;
- XDGAModeRec mode;
- REQUEST(xXF86DGADirectVideoReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
-
- if (!DGAAvailable(stuff->screen))
- return DGAErrorBase + XF86DGANoDirectVideoMode;
-
- if (stuff->enable & XF86DGADirectGraphics) {
- if(!(num = DGAGetOldDGAMode(stuff->screen)))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
- } else
- num = 0;
-
- if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
- return (DGAErrorBase + XF86DGAScreenNotActive);
-
- DGASetInputMode (stuff->screen,
- (stuff->enable & XF86DGADirectKeyb) != 0,
- (stuff->enable & XF86DGADirectMouse) != 0);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DGAGetViewPortSize(ClientPtr client)
-{
- int num;
- XDGAModeRec mode;
- REQUEST(xXF86DGAGetViewPortSizeReq);
- xXF86DGAGetViewPortSizeReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DGAAvailable(stuff->screen))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
-
- if(!(num = DGAGetOldDGAMode(stuff->screen)))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
-
- DGAGetModeInfo(stuff->screen, &mode, num);
-
- rep.width = mode.viewportWidth;
- rep.height = mode.viewportHeight;
-
- WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DGASetViewPort(ClientPtr client)
-{
- REQUEST(xXF86DGASetViewPortReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq);
-
- if (!DGAActive(stuff->screen))
- {
- int num;
- PixmapPtr pix;
- XDGAModeRec mode;
-
- if(!(num = DGAGetOldDGAMode(stuff->screen)))
- return (DGAErrorBase + XF86DGANoDirectVideoMode);
- if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
- return (DGAErrorBase + XF86DGAScreenNotActive);
- }
-
- if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE)
- != Success)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DGAGetVidPage(ClientPtr client)
-{
- REQUEST(xXF86DGAGetVidPageReq);
- xXF86DGAGetVidPageReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.vpage = 0; /* silently fail */
-
- WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep);
- return (client->noClientException);
-}
-
-
-static int
-ProcXF86DGASetVidPage(ClientPtr client)
-{
- REQUEST(xXF86DGASetVidPageReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
-
- /* silently fail */
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXF86DGAInstallColormap(ClientPtr client)
-{
- ColormapPtr pcmp;
- REQUEST(xXF86DGAInstallColormapReq);
-
- REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq);
-
- if (!DGAActive(stuff->screen))
- return (DGAErrorBase + XF86DGADirectNotActivated);
-
- pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP);
- if (pcmp) {
- DGAInstallCmap(pcmp);
- return (client->noClientException);
- } else {
- client->errorValue = stuff->id;
- return (BadColor);
- }
-}
-
-static int
-ProcXF86DGAQueryDirectVideo(ClientPtr client)
-{
- REQUEST(xXF86DGAQueryDirectVideoReq);
- xXF86DGAQueryDirectVideoReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.flags = 0;
-
- if (DGAAvailable(stuff->screen))
- rep.flags = XF86DGADirectPresent;
-
- WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DGAViewPortChanged(ClientPtr client)
-{
- REQUEST(xXF86DGAViewPortChangedReq);
- xXF86DGAViewPortChangedReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq);
-
- if (!DGAActive(stuff->screen))
- return (DGAErrorBase + XF86DGADirectNotActivated);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.result = 1;
-
- WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep);
- return (client->noClientException);
-}
-
-int
-ProcXF86DGADispatch(register ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_XF86DGAGetVideoLL:
- return ProcXF86DGAGetVideoLL(client);
- case X_XF86DGADirectVideo:
- return ProcXF86DGADirectVideo(client);
- case X_XF86DGAGetViewPortSize:
- return ProcXF86DGAGetViewPortSize(client);
- case X_XF86DGASetViewPort:
- return ProcXF86DGASetViewPort(client);
- case X_XF86DGAGetVidPage:
- return ProcXF86DGAGetVidPage(client);
- case X_XF86DGASetVidPage:
- return ProcXF86DGASetVidPage(client);
- case X_XF86DGAInstallColormap:
- return ProcXF86DGAInstallColormap(client);
- case X_XF86DGAQueryDirectVideo:
- return ProcXF86DGAQueryDirectVideo(client);
- case X_XF86DGAViewPortChanged:
- return ProcXF86DGAViewPortChanged(client);
- default:
- return BadRequest;
- }
-}
-
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
deleted file mode 100644
index 2556743bb..000000000
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- Copyright (c) 1999 - The XFree86 Project Inc.
-
- Written by Mark Vojkovich
-*/
-/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.18 2003/07/16 01:38:30 dawes Exp $ */
-
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "dixevents.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _XF86DGA_SERVER_
-#include "xf86dga.h"
-#include "xf86dgastr.h"
-#include "swaprep.h"
-#include "dgaproc.h"
-#include "xf86dgaext.h"
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#else
-#include <string.h>
-#endif
-
-#include "modinit.h"
-
-static DISPATCH_PROC(ProcXDGADispatch);
-static DISPATCH_PROC(SProcXDGADispatch);
-static DISPATCH_PROC(ProcXDGAQueryVersion);
-static DISPATCH_PROC(ProcXDGAQueryModes);
-static DISPATCH_PROC(ProcXDGASetMode);
-static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
-static DISPATCH_PROC(ProcXDGACloseFramebuffer);
-static DISPATCH_PROC(ProcXDGASetViewport);
-static DISPATCH_PROC(ProcXDGAInstallColormap);
-static DISPATCH_PROC(ProcXDGASelectInput);
-static DISPATCH_PROC(ProcXDGAFillRectangle);
-static DISPATCH_PROC(ProcXDGACopyArea);
-static DISPATCH_PROC(ProcXDGACopyTransparentArea);
-static DISPATCH_PROC(ProcXDGAGetViewportStatus);
-static DISPATCH_PROC(ProcXDGASync);
-static DISPATCH_PROC(ProcXDGASetClientVersion);
-static DISPATCH_PROC(ProcXDGAChangePixmapMode);
-static DISPATCH_PROC(ProcXDGACreateColormap);
-
-static void XDGAResetProc(ExtensionEntry *extEntry);
-
-static void DGAClientStateChange (CallbackListPtr*, pointer, pointer);
-
-static ClientPtr DGAClients[MAXSCREENS];
-
-unsigned char DGAReqCode = 0;
-int DGAErrorBase;
-int DGAEventBase;
-
-static int DGAGeneration = 0;
-static int DGAClientPrivateIndex;
-static int DGACallbackRefCount = 0;
-
-/* This holds the client's version information */
-typedef struct {
- int major;
- int minor;
-} DGAPrivRec, *DGAPrivPtr;
-
-#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr)
-
-void
-XFree86DGAExtensionInit(INITARGS)
-{
- ExtensionEntry* extEntry;
-
- if ((extEntry = AddExtension(XF86DGANAME,
- XF86DGANumberEvents,
- XF86DGANumberErrors,
- ProcXDGADispatch,
- SProcXDGADispatch,
- XDGAResetProc,
- StandardMinorOpcode))) {
- int i;
-
- for(i = 0; i < MAXSCREENS; i++)
- DGAClients[i] = NULL;
-
- DGAReqCode = (unsigned char)extEntry->base;
- DGAErrorBase = extEntry->errorBase;
- DGAEventBase = extEntry->eventBase;
- for (i = KeyPress; i <= MotionNotify; i++)
- SetCriticalEvent (DGAEventBase + i);
- }
-
- /*
- * Allocate a client private index to hold the client's version
- * information.
- */
- if (DGAGeneration != serverGeneration) {
- DGAClientPrivateIndex = AllocateClientPrivateIndex();
- /*
- * Allocate 0 length, and use the private to hold a pointer to
- * our DGAPrivRec.
- */
- if (!AllocateClientPrivate(DGAClientPrivateIndex, 0)) {
- ErrorF("XFree86DGAExtensionInit: AllocateClientPrivate failed\n");
- return;
- }
- DGAGeneration = serverGeneration;
- }
-}
-
-
-
-static void
-XDGAResetProc (ExtensionEntry *extEntry)
-{
- DeleteCallback (&ClientStateCallback, DGAClientStateChange, NULL);
- DGACallbackRefCount = 0;
-}
-
-
-static int
-ProcXDGAQueryVersion(ClientPtr client)
-{
- xXDGAQueryVersionReply rep;
-
- REQUEST_SIZE_MATCH(xXDGAQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XDGA_MAJOR_VERSION;
- rep.minorVersion = XDGA_MINOR_VERSION;
-
- WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGAOpenFramebuffer(ClientPtr client)
-{
- REQUEST(xXDGAOpenFramebufferReq);
- xXDGAOpenFramebufferReply rep;
- char *deviceName;
- int nameSize;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if (!DGAAvailable(stuff->screen))
- return DGAErrorBase + XF86DGANoDirectVideoMode;
-
- REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if(!DGAOpenFramebuffer(stuff->screen, &deviceName,
- (unsigned char**)(&rep.mem1),
- (int*)&rep.size, (int*)&rep.offset, (int*)&rep.extra))
- {
- return BadAlloc;
- }
-
- nameSize = deviceName ? (strlen(deviceName) + 1) : 0;
- rep.length = (nameSize + 3) >> 2;
-
- WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *)&rep);
- if(rep.length)
- WriteToClient(client, nameSize, deviceName);
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGACloseFramebuffer(ClientPtr client)
-{
- REQUEST(xXDGACloseFramebufferReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if (!DGAAvailable(stuff->screen))
- return DGAErrorBase + XF86DGANoDirectVideoMode;
-
- REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq);
-
- DGACloseFramebuffer(stuff->screen);
-
- return (client->noClientException);
-}
-
-static int
-ProcXDGAQueryModes(ClientPtr client)
-{
- int i, num, size;
- REQUEST(xXDGAQueryModesReq);
- xXDGAQueryModesReply rep;
- xXDGAModeInfo info;
- XDGAModePtr mode;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.number = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DGAAvailable(stuff->screen)) {
- rep.number = 0;
- rep.length = 0;
- WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
- return (client->noClientException);
- }
-
- if(!(num = DGAGetModes(stuff->screen))) {
- WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
- return (client->noClientException);
- }
-
- if(!(mode = (XDGAModePtr)xalloc(num * sizeof(XDGAModeRec))))
- return BadAlloc;
-
- for(i = 0; i < num; i++)
- DGAGetModeInfo(stuff->screen, mode + i, i + 1);
-
- size = num * sz_xXDGAModeInfo;
- for(i = 0; i < num; i++)
- size += (strlen(mode[i].name) + 4) & ~3L; /* plus NULL */
-
- rep.number = num;
- rep.length = size >> 2;
-
- WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
-
- for(i = 0; i < num; i++) {
- size = strlen(mode[i].name) + 1;
-
- info.byte_order = mode[i].byteOrder;
- info.depth = mode[i].depth;
- info.num = mode[i].num;
- info.bpp = mode[i].bitsPerPixel;
- info.name_size = (size + 3) & ~3L;
- info.vsync_num = mode[i].VSync_num;
- info.vsync_den = mode[i].VSync_den;
- info.flags = mode[i].flags;
- info.image_width = mode[i].imageWidth;
- info.image_height = mode[i].imageHeight;
- info.pixmap_width = mode[i].pixmapWidth;
- info.pixmap_height = mode[i].pixmapHeight;
- info.bytes_per_scanline = mode[i].bytesPerScanline;
- info.red_mask = mode[i].red_mask;
- info.green_mask = mode[i].green_mask;
- info.blue_mask = mode[i].blue_mask;
- info.visual_class = mode[i].visualClass;
- info.viewport_width = mode[i].viewportWidth;
- info.viewport_height = mode[i].viewportHeight;
- info.viewport_xstep = mode[i].xViewportStep;
- info.viewport_ystep = mode[i].yViewportStep;
- info.viewport_xmax = mode[i].maxViewportX;
- info.viewport_ymax = mode[i].maxViewportY;
- info.viewport_flags = mode[i].viewportFlags;
- info.reserved1 = mode[i].reserved1;
- info.reserved2 = mode[i].reserved2;
-
- WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
- WriteToClient(client, size, mode[i].name);
- }
-
- xfree(mode);
-
- return (client->noClientException);
-}
-
-
-static void
-DGAClientStateChange (
- CallbackListPtr* pcbl,
- pointer nulldata,
- pointer calldata
-){
- NewClientInfoRec* pci = (NewClientInfoRec*) calldata;
- ClientPtr client = NULL;
- int i;
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- if(DGAClients[i] == pci->client) {
- client = pci->client;
- break;
- }
- }
-
- if(client &&
- ((client->clientState == ClientStateGone) ||
- (client->clientState == ClientStateRetained))) {
- XDGAModeRec mode;
- PixmapPtr pPix;
-
- DGAClients[i] = NULL;
- DGASelectInput(i, NULL, 0);
- DGASetMode(i, 0, &mode, &pPix);
-
- if(--DGACallbackRefCount == 0)
- DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
- }
-}
-
-static int
-ProcXDGASetMode(ClientPtr client)
-{
- REQUEST(xXDGASetModeReq);
- xXDGASetModeReply rep;
- XDGAModeRec mode;
- xXDGAModeInfo info;
- PixmapPtr pPix;
- int size;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXDGASetModeReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.offset = 0;
- rep.flags = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DGAAvailable(stuff->screen))
- return DGAErrorBase + XF86DGANoDirectVideoMode;
-
- if(DGAClients[stuff->screen] &&
- (DGAClients[stuff->screen] != client))
- return DGAErrorBase + XF86DGANoDirectVideoMode;
-
- if(!stuff->mode) {
- if(DGAClients[stuff->screen]) {
- if(--DGACallbackRefCount == 0)
- DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
- }
- DGAClients[stuff->screen] = NULL;
- DGASelectInput(stuff->screen, NULL, 0);
- DGASetMode(stuff->screen, 0, &mode, &pPix);
- WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
- return (client->noClientException);
- }
-
- if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
- return BadValue;
-
- if(!DGAClients[stuff->screen]) {
- if(DGACallbackRefCount++ == 0)
- AddCallback (&ClientStateCallback, DGAClientStateChange, NULL);
- }
-
- DGAClients[stuff->screen] = client;
-
- if(pPix) {
- if(AddResource(stuff->pid, RT_PIXMAP, (pointer)(pPix))) {
- pPix->drawable.id = (int)stuff->pid;
- rep.flags = DGA_PIXMAP_AVAILABLE;
- }
- }
-
- size = strlen(mode.name) + 1;
-
- info.byte_order = mode.byteOrder;
- info.depth = mode.depth;
- info.num = mode.num;
- info.bpp = mode.bitsPerPixel;
- info.name_size = (size + 3) & ~3L;
- info.vsync_num = mode.VSync_num;
- info.vsync_den = mode.VSync_den;
- info.flags = mode.flags;
- info.image_width = mode.imageWidth;
- info.image_height = mode.imageHeight;
- info.pixmap_width = mode.pixmapWidth;
- info.pixmap_height = mode.pixmapHeight;
- info.bytes_per_scanline = mode.bytesPerScanline;
- info.red_mask = mode.red_mask;
- info.green_mask = mode.green_mask;
- info.blue_mask = mode.blue_mask;
- info.visual_class = mode.visualClass;
- info.viewport_width = mode.viewportWidth;
- info.viewport_height = mode.viewportHeight;
- info.viewport_xstep = mode.xViewportStep;
- info.viewport_ystep = mode.yViewportStep;
- info.viewport_xmax = mode.maxViewportX;
- info.viewport_ymax = mode.maxViewportY;
- info.viewport_flags = mode.viewportFlags;
- info.reserved1 = mode.reserved1;
- info.reserved2 = mode.reserved2;
-
- rep.length = (sz_xXDGAModeInfo + info.name_size) >> 2;
-
- WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
- WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
- WriteToClient(client, size, mode.name);
-
- return (client->noClientException);
-}
-
-static int
-ProcXDGASetViewport(ClientPtr client)
-{
- REQUEST(xXDGASetViewportReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGASetViewportReq);
-
- DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
-
- return (client->noClientException);
-}
-
-static int
-ProcXDGAInstallColormap(ClientPtr client)
-{
- ColormapPtr cmap;
- REQUEST(xXDGAInstallColormapReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGAInstallColormapReq);
-
- cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP);
- if (cmap) {
- DGAInstallCmap(cmap);
- return (client->noClientException);
- } else {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGASelectInput(ClientPtr client)
-{
- REQUEST(xXDGASelectInputReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGASelectInputReq);
-
- if(DGAClients[stuff->screen] == client)
- DGASelectInput(stuff->screen, client, stuff->mask);
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGAFillRectangle(ClientPtr client)
-{
- REQUEST(xXDGAFillRectangleReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGAFillRectangleReq);
-
- if(Success != DGAFillRect(stuff->screen, stuff->x, stuff->y,
- stuff->width, stuff->height, stuff->color))
- return BadMatch;
-
- return (client->noClientException);
-}
-
-static int
-ProcXDGACopyArea(ClientPtr client)
-{
- REQUEST(xXDGACopyAreaReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGACopyAreaReq);
-
- if(Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy,
- stuff->width, stuff->height, stuff->dstx, stuff->dsty))
- return BadMatch;
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGACopyTransparentArea(ClientPtr client)
-{
- REQUEST(xXDGACopyTransparentAreaReq);
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq);
-
- if(Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy,
- stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key))
- return BadMatch;
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGAGetViewportStatus(ClientPtr client)
-{
- REQUEST(xXDGAGetViewportStatusReq);
- xXDGAGetViewportStatusReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rep.status = DGAGetViewportStatus(stuff->screen);
-
- WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXDGASync(ClientPtr client)
-{
- REQUEST(xXDGASyncReq);
- xXDGASyncReply rep;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGASyncReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- DGASync(stuff->screen);
-
- WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXDGASetClientVersion(ClientPtr client)
-{
- REQUEST(xXDGASetClientVersionReq);
-
- DGAPrivPtr pPriv;
-
- REQUEST_SIZE_MATCH(xXDGASetClientVersionReq);
- if ((pPriv = DGAPRIV(client)) == NULL) {
- pPriv = xalloc(sizeof(DGAPrivRec));
- /* XXX Need to look into freeing this */
- if (!pPriv)
- return BadAlloc;
- DGAPRIV(client) = pPriv;
- }
- pPriv->major = stuff->major;
- pPriv->minor = stuff->minor;
-
- return (client->noClientException);
-}
-
-static int
-ProcXDGAChangePixmapMode(ClientPtr client)
-{
- REQUEST(xXDGAChangePixmapModeReq);
- xXDGAChangePixmapModeReply rep;
- int x, y;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- x = stuff->x;
- y = stuff->y;
-
- if(!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags))
- return BadMatch;
-
- rep.x = x;
- rep.y = y;
- WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep);
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXDGACreateColormap(ClientPtr client)
-{
- REQUEST(xXDGACreateColormapReq);
- int result;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- if(DGAClients[stuff->screen] != client)
- return DGAErrorBase + XF86DGADirectNotActivated;
-
- REQUEST_SIZE_MATCH(xXDGACreateColormapReq);
-
- if(!stuff->mode)
- return BadValue;
-
- result = DGACreateColormap(stuff->screen, client, stuff->id,
- stuff->mode, stuff->alloc);
- if(result != Success)
- return result;
-
- return (client->noClientException);
-}
-
-
-static int
-SProcXDGADispatch (ClientPtr client)
-{
- return DGAErrorBase + XF86DGAClientNotLocal;
-}
-
-#if 0
-#define DGA_REQ_DEBUG
-#endif
-
-#ifdef DGA_REQ_DEBUG
-static char *dgaMinor[] = {
- "QueryVersion",
- "GetVideoLL",
- "DirectVideo",
- "GetViewPortSize",
- "SetViewPort",
- "GetVidPage",
- "SetVidPage",
- "InstallColormap",
- "QueryDirectVideo",
- "ViewPortChanged",
- "10",
- "11",
- "QueryModes",
- "SetMode",
- "SetViewport",
- "InstallColormap",
- "SelectInput",
- "FillRectangle",
- "CopyArea",
- "CopyTransparentArea",
- "GetViewportStatus",
- "Sync",
- "OpenFramebuffer",
- "CloseFramebuffer",
- "SetClientVersion",
- "ChangePixmapMode",
- "CreateColormap",
-};
-#endif
-
-static int
-ProcXDGADispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if (!LocalClient(client))
- return DGAErrorBase + XF86DGAClientNotLocal;
-
-#ifdef DGA_REQ_DEBUG
- if (stuff->data <= X_XDGACreateColormap)
- fprintf (stderr, " DGA %s\n", dgaMinor[stuff->data]);
-#endif
-
- /* divert old protocol */
-#if 1
- if( (stuff->data <= X_XF86DGAViewPortChanged) &&
- (stuff->data >= X_XF86DGAGetVideoLL))
- return ProcXF86DGADispatch(client);
-#endif
-
- switch (stuff->data){
- case X_XDGAQueryVersion:
- return ProcXDGAQueryVersion(client);
- case X_XDGAQueryModes:
- return ProcXDGAQueryModes(client);
- case X_XDGASetMode:
- return ProcXDGASetMode(client);
- case X_XDGAOpenFramebuffer:
- return ProcXDGAOpenFramebuffer(client);
- case X_XDGACloseFramebuffer:
- return ProcXDGACloseFramebuffer(client);
- case X_XDGASetViewport:
- return ProcXDGASetViewport(client);
- case X_XDGAInstallColormap:
- return ProcXDGAInstallColormap(client);
- case X_XDGASelectInput:
- return ProcXDGASelectInput(client);
- case X_XDGAFillRectangle:
- return ProcXDGAFillRectangle(client);
- case X_XDGACopyArea:
- return ProcXDGACopyArea(client);
- case X_XDGACopyTransparentArea:
- return ProcXDGACopyTransparentArea(client);
- case X_XDGAGetViewportStatus:
- return ProcXDGAGetViewportStatus(client);
- case X_XDGASync:
- return ProcXDGASync(client);
- case X_XDGASetClientVersion:
- return ProcXDGASetClientVersion(client);
- case X_XDGAChangePixmapMode:
- return ProcXDGAChangePixmapMode(client);
- case X_XDGACreateColormap:
- return ProcXDGACreateColormap(client);
- default:
- return BadRequest;
- }
-}
-
-#ifdef EXTMODULE
-void
-XFree86DGARegister(INITARGS)
-{
- XDGAEventBase = &DGAEventBase;
-}
-#endif
diff --git a/hw/xfree86/dixmods/extmod/xf86dgaext.h b/hw/xfree86/dixmods/extmod/xf86dgaext.h
deleted file mode 100644
index 831108399..000000000
--- a/hw/xfree86/dixmods/extmod/xf86dgaext.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86dgaext.h,v 1.1 2003/07/16 01:38:30 dawes Exp $ */
-
-#ifndef _XF86DGAEXT_H_
-#define _XF86DGAEXT_H_
-
-extern DISPATCH_PROC(ProcXF86DGADispatch);
-
-#endif /* _XF86DGAEXT_H_ */
diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
deleted file mode 100644
index 620761742..000000000
--- a/hw/xfree86/dixmods/extmod/xf86misc.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.41 2003/11/17 22:20:27 dawes Exp $ */
-
-/*
- * Copyright (c) 1995, 1996 The XFree86 Project, Inc
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "inputstr.h"
-#include "servermd.h"
-#define _XF86MISC_SERVER_
-#undef _XF86MISC_SAVER_COMPAT_
-#include "xf86mscstr.h"
-#include "swaprep.h"
-#include "xf86.h"
-#include "Xfuncproto.h"
-#include "xf86miscproc.h"
-
-#if 0
-#include <X11/Xtrans.h>
-#include "../os/osdep.h"
-#include <X11/Xauth.h>
-#ifndef USL
-#ifndef Lynx
-#include <sys/socket.h>
-#else
-#include <socket.h>
-#endif
-#endif /* USL */
-#endif
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-static int miscErrorBase;
-static int MiscGeneration = 0;
-static int MiscClientPrivateIndex;
-
-/* This holds the client's version information */
-typedef struct {
- int major;
- int minor;
-} MiscPrivRec, *MiscPrivPtr;
-
-#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr)
-
-static void XF86MiscResetProc(
- ExtensionEntry* /* extEntry */
-);
-
-static void
-ClientVersion(ClientPtr client, int *major, int *minor)
-{
- MiscPrivPtr pPriv;
-
- pPriv = MPRIV(client);
- if (!pPriv) {
- if (major) *major = 0;
- if (minor) *minor = 0;
- return;
- }
-
- if (major) *major = pPriv->major;
- if (minor) *minor = pPriv->minor;
-}
-
-static DISPATCH_PROC(ProcXF86MiscDispatch);
-static DISPATCH_PROC(ProcXF86MiscQueryVersion);
-static DISPATCH_PROC(ProcXF86MiscGetKbdSettings);
-static DISPATCH_PROC(ProcXF86MiscGetMouseSettings);
-static DISPATCH_PROC(ProcXF86MiscSetKbdSettings);
-static DISPATCH_PROC(ProcXF86MiscSetMouseSettings);
-static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState);
-static DISPATCH_PROC(ProcXF86MiscSetClientVersion);
-static DISPATCH_PROC(ProcXF86MiscGetFilePaths);
-static DISPATCH_PROC(ProcXF86MiscPassMessage);
-#ifdef _XF86MISC_SAVER_COMPAT_
-static DISPATCH_PROC(ProcXF86MiscGetSaver);
-static DISPATCH_PROC(ProcXF86MiscSetSaver);
-#endif
-static DISPATCH_PROC(SProcXF86MiscDispatch);
-static DISPATCH_PROC(SProcXF86MiscQueryVersion);
-static DISPATCH_PROC(SProcXF86MiscGetKbdSettings);
-static DISPATCH_PROC(SProcXF86MiscGetMouseSettings);
-static DISPATCH_PROC(SProcXF86MiscSetKbdSettings);
-static DISPATCH_PROC(SProcXF86MiscSetMouseSettings);
-static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState);
-static DISPATCH_PROC(SProcXF86MiscSetClientVersion);
-static DISPATCH_PROC(SProcXF86MiscGetFilePaths);
-static DISPATCH_PROC(SProcXF86MiscPassMessage);
-#ifdef _XF86MISC_SAVER_COMPAT_
-static DISPATCH_PROC(SProcXF86MiscGetSaver);
-static DISPATCH_PROC(SProcXF86MiscSetSaver);
-#endif
-
-#if 0
-static unsigned char XF86MiscReqCode = 0;
-#endif
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-#define MISCERR(x) (miscErrorBase + x)
-
-void
-XFree86MiscExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
- DEBUG_P("XFree86MiscExtensionInit");
-
- if (!xf86GetModInDevEnabled())
- return;
-
- /*
- * Allocate a client private index to hold the client's version
- * information.
- */
- if (MiscGeneration != serverGeneration) {
- MiscClientPrivateIndex = AllocateClientPrivateIndex();
- /*
- * Allocate 0 length, and use the private to hold a pointer to our
- * MiscPrivRec.
- */
- if (!AllocateClientPrivate(MiscClientPrivateIndex, 0)) {
- ErrorF("XFree86MiscExtensionInit: "
- "AllocateClientPrivate failed\n");
- return;
- }
- MiscGeneration = serverGeneration;
- }
-
- if (
- (extEntry = AddExtension(XF86MISCNAME,
- XF86MiscNumberEvents,
- XF86MiscNumberErrors,
- ProcXF86MiscDispatch,
- SProcXF86MiscDispatch,
- XF86MiscResetProc,
- StandardMinorOpcode))) {
-#if 0
- XF86MiscReqCode = (unsigned char)extEntry->base;
-#endif
- miscErrorBase = extEntry->errorBase;
- }
-}
-
-/*ARGSUSED*/
-static void
-XF86MiscResetProc (extEntry)
- ExtensionEntry* extEntry;
-{
-}
-
-static int
-ProcXF86MiscQueryVersion(client)
- register ClientPtr client;
-{
- xXF86MiscQueryVersionReply rep;
- register int n;
-
- DEBUG_P("XF86MiscQueryVersion");
-
- REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XF86MISC_MAJOR_VERSION;
- rep.minorVersion = XF86MISC_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXF86MiscQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-#ifdef _XF86MISC_SAVER_COMPAT_
-/* THESE HAVE NOT BEEN CONVERTED TO THE NEW DESIGN */
-
-/*
- * This will go away, but remains for now for compatibility with older
- * clients.
- */
-static int
-ProcXF86MiscSetSaver(client)
- register ClientPtr client;
-{
- REQUEST(xXF86MiscSetSaverReq);
- ScrnInfoPtr vptr;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
-
- REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
-
- if (stuff->suspendTime < 0)
- return BadValue;
- if (stuff->offTime < 0)
- return BadValue;
-
- return (client->noClientException);
-}
-
-/*
- * This will go away, but remains for now for compatibility with older
- * clients.
- */
-static int
-ProcXF86MiscGetSaver(client)
- register ClientPtr client;
-{
- REQUEST(xXF86MiscGetSaverReq);
- xXF86MiscGetSaverReply rep;
- register int n;
- ScrnInfoPtr vptr;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
-
- REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.suspendTime = 0;
- rep.offTime = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.suspendTime, n);
- swapl(&rep.offTime, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetSaverReply), (char *)&rep);
- return (client->noClientException);
-}
-
-#endif /* _XF86MISC_SAVER_COMPAT_ */
-
-static int
-ProcXF86MiscGetMouseSettings(client)
- register ClientPtr client;
-{
- xXF86MiscGetMouseSettingsReply rep;
- char *devname;
- pointer mouse;
- register int n;
-
- DEBUG_P("XF86MiscGetMouseSettings");
-
- REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
-
- if (!MiscExtGetMouseSettings(&mouse, &devname))
- return BadValue;
-
- rep.mousetype = MiscExtGetMouseValue(mouse, MISC_MSE_PROTO);
- rep.baudrate = MiscExtGetMouseValue(mouse, MISC_MSE_BAUDRATE);
- rep.samplerate = MiscExtGetMouseValue(mouse, MISC_MSE_SAMPLERATE);
- rep.resolution = MiscExtGetMouseValue(mouse, MISC_MSE_RESOLUTION);
- rep.buttons = MiscExtGetMouseValue(mouse, MISC_MSE_BUTTONS);
- rep.emulate3buttons = MiscExtGetMouseValue(mouse, MISC_MSE_EM3BUTTONS);
- rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT);
- rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE);
- rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS);
- rep.devnamelen = (devname? strlen(devname): 0);
- rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) -
- sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.mousetype, n);
- swapl(&rep.baudrate, n);
- swapl(&rep.samplerate, n);
- swapl(&rep.resolution, n);
- swapl(&rep.buttons, n);
- swapl(&rep.emulate3buttons, n);
- swapl(&rep.emulate3timeout, n);
- swapl(&rep.chordmiddle, n);
- swapl(&rep.flags, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep);
- MiscExtDestroyStruct(mouse, MISC_POINTER);
-
- if (rep.devnamelen)
- WriteToClient(client, rep.devnamelen, devname);
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscGetKbdSettings(client)
- register ClientPtr client;
-{
- xXF86MiscGetKbdSettingsReply rep;
- pointer kbd;
- register int n;
-
- DEBUG_P("XF86MiscGetKbdSettings");
-
- REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (!MiscExtGetKbdSettings(&kbd))
- return BadValue;
-
- rep.kbdtype = MiscExtGetKbdValue(kbd, MISC_KBD_TYPE);
- rep.rate = MiscExtGetKbdValue(kbd, MISC_KBD_RATE);
- rep.delay = MiscExtGetKbdValue(kbd, MISC_KBD_DELAY);
- rep.servnumlock = MiscExtGetKbdValue(kbd, MISC_KBD_SERVNUMLOCK);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.kbdtype, n);
- swapl(&rep.rate, n);
- swapl(&rep.delay, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetKbdSettingsReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetMouseSettings(client)
- register ClientPtr client;
-{
- MiscExtReturn ret;
- pointer mouse;
- char *devname = NULL;
- int major, minor;
-
- REQUEST(xXF86MiscSetMouseSettingsReq);
-
- DEBUG_P("XF86MiscSetMouseSettings");
-
- REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq);
-
- ClientVersion(client, &major, &minor);
-
- if (xf86GetVerbosity() > 1) {
- ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
- (int)stuff->mousetype, (int)stuff->baudrate,
- (int)stuff->samplerate, stuff->chordmiddle);
- ErrorF(" em3but: %d em3tim: %d res: %d flags: %ld\n",
- stuff->emulate3buttons, (int)stuff->emulate3timeout,
- (int)stuff->resolution, (unsigned long)stuff->flags);
- }
-
- if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
- return BadAlloc;
-
- MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype);
- MiscExtSetMouseValue(mouse, MISC_MSE_BAUDRATE, stuff->baudrate);
- MiscExtSetMouseValue(mouse, MISC_MSE_SAMPLERATE, stuff->samplerate);
- MiscExtSetMouseValue(mouse, MISC_MSE_RESOLUTION, stuff->resolution);
- MiscExtSetMouseValue(mouse, MISC_MSE_BUTTONS, stuff->buttons);
- MiscExtSetMouseValue(mouse, MISC_MSE_EM3BUTTONS, stuff->emulate3buttons);
- MiscExtSetMouseValue(mouse, MISC_MSE_EM3TIMEOUT, stuff->emulate3timeout);
- MiscExtSetMouseValue(mouse, MISC_MSE_CHORDMIDDLE, stuff->chordmiddle);
- MiscExtSetMouseValue(mouse, MISC_MSE_FLAGS, stuff->flags);
-
- if ((major > 0 || minor > 5) && stuff->devnamelen) {
- int size = sizeof(xXF86MiscSetMouseSettingsReq) + stuff->devnamelen;
- size = (size + 3) >> 2;
- if (client->req_len < size)
- return BadLength;
- if (stuff->devnamelen) {
- if (!(devname = xalloc(stuff->devnamelen)))
- return BadAlloc;
- strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen);
- if (xf86GetVerbosity() > 1)
- ErrorF("SetMouseSettings - device: %s\n",devname);
- MiscExtSetMouseDevice(mouse, devname);
- }
- }
-
- ret = MiscExtApply(mouse, MISC_POINTER);
-
- if (devname)
- xfree(devname);
-
- switch ((ret)) {
- case MISC_RET_SUCCESS: break;
- case MISC_RET_BADVAL: return BadValue;
- case MISC_RET_BADMSEPROTO: return MISCERR(XF86MiscBadMouseProtocol);
- case MISC_RET_BADBAUDRATE: return MISCERR(XF86MiscBadMouseBaudRate);
- case MISC_RET_BADFLAGS: return MISCERR(XF86MiscBadMouseFlags);
- case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo);
- case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule);
- default:
- ErrorF("Unexpected return from MiscExtApply(POINTER) = %d\n", ret);
- return BadImplementation;
- }
-
- if (xf86GetVerbosity() > 1)
- ErrorF("SetMouseSettings - Succeeded\n");
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetKbdSettings(client)
- register ClientPtr client;
-{
- MiscExtReturn ret;
- pointer kbd;
- REQUEST(xXF86MiscSetKbdSettingsReq);
-
- DEBUG_P("XF86MiscSetKbdSettings");
-
- REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
-
- if (xf86GetVerbosity() > 1)
- ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
- (int)stuff->kbdtype, (int)stuff->rate,
- (int)stuff->delay, stuff->servnumlock);
-
- if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
- return BadAlloc;
-
- MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype);
- MiscExtSetKbdValue(kbd, MISC_KBD_RATE, stuff->rate);
- MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, stuff->delay);
- MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, stuff->servnumlock);
-
- switch ((ret = MiscExtApply(kbd, MISC_KEYBOARD))) {
- case MISC_RET_SUCCESS: break;
- case MISC_RET_BADVAL: return BadValue;
- case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType);
- default:
- ErrorF("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
- return BadImplementation;
- }
-
- if (xf86GetVerbosity() > 1)
- ErrorF("SetKbdSettings - Succeeded\n");
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetGrabKeysState(client)
- register ClientPtr client;
-{
- int n, status;
- xXF86MiscSetGrabKeysStateReply rep;
- REQUEST(xXF86MiscSetGrabKeysStateReq);
-
- DEBUG_P("XF86MiscSetGrabKeysState");
-
- REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
-
- if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) {
- if (xf86GetVerbosity() > 1)
- ErrorF("SetGrabKeysState - %s\n",
- stuff->enable ? "enabled" : "disabled");
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.status = status;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscSetGrabKeysStateReply), (char *)&rep);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetClientVersion(ClientPtr client)
-{
- REQUEST(xXF86MiscSetClientVersionReq);
-
- MiscPrivPtr pPriv;
-
- DEBUG_P("XF86MiscSetClientVersion");
-
- REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
-
- if ((pPriv = MPRIV(client)) == NULL) {
- pPriv = xalloc(sizeof(MiscPrivRec));
- if (!pPriv)
- return BadAlloc;
- MPRIV(client) = pPriv;
- }
- ErrorF("SetClientVersion: %i %i\n",stuff->major,stuff->minor);
- pPriv->major = stuff->major;
- pPriv->minor = stuff->minor;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscGetFilePaths(client)
- register ClientPtr client;
-{
- xXF86MiscGetFilePathsReply rep;
- const char *configfile;
- const char *modulepath;
- const char *logfile;
- register int n;
-
- DEBUG_P("XF86MiscGetFilePaths");
-
- REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
-
- if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile))
- return BadValue;
-
- rep.configlen = (configfile? strlen(configfile): 0);
- rep.modulelen = (modulepath? strlen(modulepath): 0);
- rep.loglen = (logfile? strlen(logfile): 0);
- rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) +
- ((rep.configlen + 3) & ~3) +
- ((rep.modulelen + 3) & ~3) +
- ((rep.loglen + 3) & ~3) ) >> 2;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.configlen, n);
- swaps(&rep.modulelen, n);
- swaps(&rep.loglen, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep);
-
- if (rep.configlen)
- WriteToClient(client, rep.configlen, (char *)configfile);
- if (rep.modulelen)
- WriteToClient(client, rep.modulelen, (char *)modulepath);
- if (rep.loglen)
- WriteToClient(client, rep.loglen, (char *)logfile);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscPassMessage(client)
- register ClientPtr client;
-{
- xXF86MiscPassMessageReply rep;
- char *msgtype, *msgval, *retstr;
- int retval, size;
- register int n;
-
- REQUEST(xXF86MiscPassMessageReq);
-
- DEBUG_P("XF86MiscPassMessage");
-
- REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
- size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
- size+= (stuff->typelen + 3) >> 2;
- size+= (stuff->vallen + 3) >> 2;
- if (client->req_len < size)
- return BadLength;
- if (stuff->typelen) {
- if (!(msgtype = xalloc(stuff->typelen)))
- return BadAlloc;
- strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen);
- } else return BadValue;
- if (stuff->vallen) {
- if (!(msgval = xalloc(stuff->vallen)))
- return BadAlloc;
- strncpy(msgval,(char*)(&stuff[1] + ((stuff->typelen + 3) & ~3)),
- stuff->vallen);
- } else return BadValue;
-
- if ((retval= MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0)
- return retval;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.mesglen = (retstr? strlen(retstr): 0);
- rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
- ((rep.mesglen + 3) & ~3)) >> 2;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.mesglen, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
-
- if (rep.mesglen)
- WriteToClient(client, rep.mesglen, (char *)retstr);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86MiscQueryVersion:
- return ProcXF86MiscQueryVersion(client);
-#ifdef _XF86MISC_SAVER_COMPAT_
- case X_XF86MiscGetSaver:
- return ProcXF86MiscGetSaver(client);
- case X_XF86MiscSetSaver:
- return ProcXF86MiscSetSaver(client);
-#endif
- case X_XF86MiscGetMouseSettings:
- return ProcXF86MiscGetMouseSettings(client);
- case X_XF86MiscGetKbdSettings:
- return ProcXF86MiscGetKbdSettings(client);
- case X_XF86MiscSetClientVersion:
- return ProcXF86MiscSetClientVersion(client);
- case X_XF86MiscGetFilePaths:
- return ProcXF86MiscGetFilePaths(client);
- case X_XF86MiscPassMessage:
- return ProcXF86MiscPassMessage(client);
- default:
- if (!xf86GetModInDevEnabled())
- return miscErrorBase + XF86MiscModInDevDisabled;
- if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86MiscSetMouseSettings:
- return ProcXF86MiscSetMouseSettings(client);
- case X_XF86MiscSetKbdSettings:
- return ProcXF86MiscSetKbdSettings(client);
- case X_XF86MiscSetGrabKeysState:
- return ProcXF86MiscSetGrabKeysState(client);
- default:
- return BadRequest;
- }
- } else
- return miscErrorBase + XF86MiscModInDevClientNotLocal;
- }
-}
-
-static int
-SProcXF86MiscQueryVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXF86MiscQueryVersion(client);
-}
-
-#ifdef _XF86MISC_SAVER_COMPAT_
-static int
-SProcXF86MiscGetSaver(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
- swaps(&stuff->screen, n);
- return ProcXF86MiscGetSaver(client);
-}
-
-static int
-SProcXF86MiscSetSaver(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->suspendTime, n);
- swapl(&stuff->offTime, n);
- return ProcXF86MiscSetSaver(client);
-}
-#endif /* _XF86MISC_SAVER_COMPAT_ */
-
-static int
-SProcXF86MiscGetMouseSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetMouseSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
- return ProcXF86MiscGetMouseSettings(client);
-}
-
-static int
-SProcXF86MiscGetKbdSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetKbdSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
- return ProcXF86MiscGetKbdSettings(client);
-}
-
-static int
-SProcXF86MiscSetMouseSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetMouseSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq);
- swapl(&stuff->mousetype, n);
- swapl(&stuff->baudrate, n);
- swapl(&stuff->samplerate, n);
- swapl(&stuff->resolution, n);
- swapl(&stuff->buttons, n);
- swapl(&stuff->emulate3timeout, n);
- swapl(&stuff->flags, n);
- return ProcXF86MiscSetMouseSettings(client);
-}
-
-static int
-SProcXF86MiscSetKbdSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetKbdSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
- swapl(&stuff->kbdtype, n);
- swapl(&stuff->rate, n);
- swapl(&stuff->delay, n);
- return ProcXF86MiscSetKbdSettings(client);
-}
-
-static int
-SProcXF86MiscSetGrabKeysState(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetGrabKeysStateReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
- swaps(&stuff->enable, n);
- return ProcXF86MiscSetGrabKeysState(client);
-}
-
-static int
-SProcXF86MiscSetClientVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86MiscSetClientVersionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
- swaps(&stuff->major, n);
- swaps(&stuff->minor, n);
- return ProcXF86MiscSetClientVersion(client);
-}
-
-static int
-SProcXF86MiscGetFilePaths(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetFilePathsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
- return ProcXF86MiscGetFilePaths(client);
-}
-
-static int
-SProcXF86MiscPassMessage(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscPassMessageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq);
- return ProcXF86MiscPassMessage(client);
-}
-
-static int
-SProcXF86MiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86MiscQueryVersion:
- return SProcXF86MiscQueryVersion(client);
-#ifdef _XF86MISC_SAVER_COMPAT_
- case X_XF86MiscGetSaver:
- return SProcXF86MiscGetSaver(client);
- case X_XF86MiscSetSaver:
- return SProcXF86MiscSetSaver(client);
-#endif
- case X_XF86MiscGetMouseSettings:
- return SProcXF86MiscGetMouseSettings(client);
- case X_XF86MiscGetKbdSettings:
- return SProcXF86MiscGetKbdSettings(client);
- case X_XF86MiscSetClientVersion:
- return SProcXF86MiscSetClientVersion(client);
- case X_XF86MiscGetFilePaths:
- return SProcXF86MiscGetFilePaths(client);
- case X_XF86MiscPassMessage:
- return SProcXF86MiscPassMessage(client);
- default:
- if (!xf86GetModInDevEnabled())
- return miscErrorBase + XF86MiscModInDevDisabled;
- if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86MiscSetMouseSettings:
- return SProcXF86MiscSetMouseSettings(client);
- case X_XF86MiscSetKbdSettings:
- return SProcXF86MiscSetKbdSettings(client);
- case X_XF86MiscSetGrabKeysState:
- return SProcXF86MiscSetGrabKeysState(client);
- default:
- return BadRequest;
- }
- } else
- return miscErrorBase + XF86MiscModInDevClientNotLocal;
- }
-}
-
diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h
deleted file mode 100644
index 208260947..000000000
--- a/hw/xfree86/dixmods/extmod/xf86miscproc.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.6 2003/04/03 16:15:47 dawes Exp $ */
-
-/* Prototypes for Pointer/Keyboard functions that the DDX must provide */
-
-#ifndef _XF86MISCPROC_H_
-#define _XF86MISCPROC_H_
-
-typedef enum {
- MISC_MSE_PROTO,
- MISC_MSE_BAUDRATE,
- MISC_MSE_SAMPLERATE,
- MISC_MSE_RESOLUTION,
- MISC_MSE_BUTTONS,
- MISC_MSE_EM3BUTTONS,
- MISC_MSE_EM3TIMEOUT,
- MISC_MSE_CHORDMIDDLE,
- MISC_MSE_FLAGS
-} MiscExtMseValType;
-
-typedef enum {
- MISC_KBD_TYPE,
- MISC_KBD_RATE,
- MISC_KBD_DELAY,
- MISC_KBD_SERVNUMLOCK
-} MiscExtKbdValType;
-
-typedef enum {
- MISC_RET_SUCCESS,
- MISC_RET_BADVAL,
- MISC_RET_BADMSEPROTO,
- MISC_RET_BADBAUDRATE,
- MISC_RET_BADFLAGS,
- MISC_RET_BADCOMBO,
- MISC_RET_BADKBDTYPE,
- MISC_RET_NOMODULE
-} MiscExtReturn;
-
-typedef enum {
- MISC_POINTER,
- MISC_KEYBOARD
-} MiscExtStructType;
-
-#define MISC_MSEFLAG_CLEARDTR 1
-#define MISC_MSEFLAG_CLEARRTS 2
-#define MISC_MSEFLAG_REOPEN 128
-
-void XFree86MiscExtensionInit(void);
-
-Bool MiscExtGetMouseSettings(pointer *mouse, char **devname);
-int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype);
-Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value);
-Bool MiscExtGetKbdSettings(pointer *kbd);
-int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype);
-Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value);
-int MiscExtSetGrabKeysState(ClientPtr client, int enable);
-pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd);
-void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd);
-MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd);
-Bool MiscExtSetMouseDevice(pointer mouse, char* device);
-Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath,
- const char **logfile);
-int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval,
- char **retstr);
-
-#endif
-
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
deleted file mode 100644
index f4751a1c7..000000000
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ /dev/null
@@ -1,2199 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.59 2003/11/17 22:20:27 dawes Exp $ */
-
-/*
-
-Copyright 1995 Kaleb S. KEITHLEY
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
-OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Kaleb S. KEITHLEY
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-from Kaleb S. KEITHLEY
-
-*/
-/* $Xorg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */
-/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _XF86VIDMODE_SERVER_
-#include "xf86vmstr.h"
-#include "swaprep.h"
-#include "xf86.h"
-#include "vidmodeproc.h"
-
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-static int VidModeErrorBase;
-static int VidModeGeneration = 0;
-static int VidModeClientPrivateIndex;
-
-/* This holds the client's version information */
-typedef struct {
- int major;
- int minor;
-} VidModePrivRec, *VidModePrivPtr;
-
-#define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr)
-
-static void XF86VidModeResetProc(
- ExtensionEntry* /* extEntry */
-);
-
-static DISPATCH_PROC(ProcXF86VidModeDispatch);
-static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(ProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(ProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(ProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(ProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(ProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(ProcXF86VidModeModModeLine);
-static DISPATCH_PROC(ProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(ProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(ProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(ProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(ProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(ProcXF86VidModeSetGamma);
-static DISPATCH_PROC(ProcXF86VidModeGetGamma);
-static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
-static DISPATCH_PROC(SProcXF86VidModeDispatch);
-static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(SProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(SProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(SProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(SProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(SProcXF86VidModeModModeLine);
-static DISPATCH_PROC(SProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(SProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(SProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(SProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(SProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(SProcXF86VidModeSetGamma);
-static DISPATCH_PROC(SProcXF86VidModeGetGamma);
-static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
-
-#if 0
-static unsigned char XF86VidModeReqCode = 0;
-#endif
-
-/* The XF86VIDMODE_EVENTS code is far from complete */
-
-#ifdef XF86VIDMODE_EVENTS
-static int XF86VidModeEventBase = 0;
-
-static void SXF86VidModeNotifyEvent();
- xXF86VidModeNotifyEvent * /* from */,
- xXF86VidModeNotifyEvent * /* to */
-);
-
-extern WindowPtr *WindowTable;
-
-static RESTYPE EventType; /* resource type for event masks */
-
-typedef struct _XF86VidModeEvent *XF86VidModeEventPtr;
-
-typedef struct _XF86VidModeEvent {
- XF86VidModeEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
-} XF86VidModeEventRec;
-
-static int XF86VidModeFreeEvents();
-
-typedef struct _XF86VidModeScreenPrivate {
- XF86VidModeEventPtr events;
- Bool hasWindow;
-} XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr;
-
-static int ScreenPrivateIndex;
-
-#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr)
-#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v);
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
-
-#define New(t) (xalloc (sizeof (t)))
-#endif
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-void
-XFree86VidModeExtensionInit(void)
-{
- ExtensionEntry* extEntry;
- ScreenPtr pScreen;
- int i;
- Bool enabled = FALSE;
-
- DEBUG_P("XFree86VidModeExtensionInit");
-
-#ifdef XF86VIDMODE_EVENTS
- EventType = CreateNewResourceType(XF86VidModeFreeEvents);
- ScreenPrivateIndex = AllocateScreenPrivateIndex ();
-#endif
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if (VidModeExtensionInit(pScreen))
- enabled = TRUE;
-#ifdef XF86VIDMODE_EVENTS
- SetScreenPrivate (pScreen, NULL);
-#endif
- }
- /* This means that the DDX doesn't want the vidmode extension enabled */
- if (!enabled)
- return;
-
- /*
- * Allocate a client private index to hold the client's version
- * information.
- */
- if (VidModeGeneration != serverGeneration) {
- VidModeClientPrivateIndex = AllocateClientPrivateIndex();
- /*
- * Allocate 0 length, and use the private to hold a pointer to our
- * VidModePrivRec.
- */
- if (!AllocateClientPrivate(VidModeClientPrivateIndex, 0)) {
- ErrorF("XFree86VidModeExtensionInit: "
- "AllocateClientPrivate failed\n");
- return;
- }
- VidModeGeneration = serverGeneration;
- }
-
- if (
-#ifdef XF86VIDMODE_EVENTS
- EventType && ScreenPrivateIndex != -1 &&
-#endif
- (extEntry = AddExtension(XF86VIDMODENAME,
- XF86VidModeNumberEvents,
- XF86VidModeNumberErrors,
- ProcXF86VidModeDispatch,
- SProcXF86VidModeDispatch,
- XF86VidModeResetProc,
- StandardMinorOpcode))) {
-#if 0
- XF86VidModeReqCode = (unsigned char)extEntry->base;
-#endif
- VidModeErrorBase = extEntry->errorBase;
-#ifdef XF86VIDMODE_EVENTS
- XF86VidModeEventBase = extEntry->eventBase;
- EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
-#endif
- }
-}
-
-/*ARGSUSED*/
-static void
-XF86VidModeResetProc (extEntry)
- ExtensionEntry* extEntry;
-{
-}
-
-static int
-ClientMajorVersion(ClientPtr client)
-{
- VidModePrivPtr pPriv;
-
- pPriv = VMPRIV(client);
- if (!pPriv)
- return 0;
- else
- return pPriv->major;
-}
-
-#ifdef XF86VIDMODE_EVENTS
-static void
-CheckScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (!pPriv)
- return;
- if (!pPriv->events && !pPriv->hasWindow) {
- xfree (pPriv);
- SetScreenPrivate (pScreen, NULL);
- }
-}
-
-static XF86VidModeScreenPrivatePtr
-MakeScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (pPriv)
- return pPriv;
- pPriv = New (XF86VidModeScreenPrivateRec);
- if (!pPriv)
- return 0;
- pPriv->events = 0;
- pPriv->hasWindow = FALSE;
- SetScreenPrivate (pScreen, pPriv);
- return pPriv;
-}
-
-static unsigned long
-getEventMask (ScreenPtr pScreen, ClientPtr client)
-{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv;
-
- if (!pPriv)
- return 0;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
- return 0;
-}
-
-static Bool
-setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
-{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (getEventMask (pScreen, client) == mask)
- return TRUE;
- if (!pPriv) {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0) {
- *pPrev = pEv->next;
- xfree (pEv);
- CheckScreenPrivate (pScreen);
- } else {
- if (!pEv) {
- pEv = New (ScreenSaverEventRec);
- if (!pEv) {
- CheckScreenPrivate (pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID (client->index);
- }
- pEv->mask = mask;
- }
- return TRUE;
-}
-
-static int
-XF86VidModeFreeEvents(pointer value, XID id)
-{
- XF86VidModeEventPtr pOld = (XF86VidModeEventPtr)value;
- ScreenPtr pScreen = pOld->screen;
- SetupScreen (pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (!pPriv)
- return TRUE;
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
- if (!pEv)
- return TRUE;
- *pPrev = pEv->next;
- xfree (pEv);
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static void
-SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
-{
- XF86VidModeScreenPrivatePtr pPriv;
- XF86VidModeEventPtr pEv;
- unsigned long mask;
- xXF86VidModeNotifyEvent ev;
- ClientPtr client;
- int kind;
-
- UpdateCurrentTimeIf ();
- mask = XF86VidModeNotifyMask;
- pScreen = screenInfo.screens[pScreen->myNum];
- pPriv = GetScreenPrivate(pScreen);
- if (!pPriv)
- return;
- kind = XF86VidModeModeChange;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- {
- client = pEv->client;
- if (client->clientGone)
- continue;
- if (!(pEv->mask & mask))
- continue;
- ev.type = XF86VidModeNotify + XF86VidModeEventBase;
- ev.state = state;
- ev.sequenceNumber = client->sequence;
- ev.timestamp = currentTime.milliseconds;
- ev.root = WindowTable[pScreen->myNum]->drawable.id;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient (client, 1, (xEvent *) &ev);
- }
-}
-
-static void
-SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent *from,
- xXF86VidModeNotifyEvent *to)
-{
- to->type = from->type;
- to->state = from->state;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->root, to->root);
- to->kind = from->kind;
- to->forced = from->forced;
-}
-#endif
-
-static int
-ProcXF86VidModeQueryVersion(ClientPtr client)
-{
- xXF86VidModeQueryVersionReply rep;
- register int n;
-
- DEBUG_P("XF86VidModeQueryVersion");
-
- REQUEST_SIZE_MATCH(xXF86VidModeQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XF86VIDMODE_MAJOR_VERSION;
- rep.minorVersion = XF86VIDMODE_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetModeLineReq);
- xXF86VidModeGetModeLineReply rep;
- xXF86OldVidModeGetModeLineReply oldrep;
- pointer mode;
- register int n;
- int dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeGetModeline");
-
- ver = ClientMajorVersion(client);
- REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
- rep.type = X_Reply;
- if (ver < 2) {
- rep.length = (SIZEOF(xXF86OldVidModeGetModeLineReply) -
- SIZEOF(xGenericReply)) >> 2;
- } else {
- rep.length = (SIZEOF(xXF86VidModeGetModeLineReply) -
- SIZEOF(xGenericReply)) >> 2;
- }
- rep.sequenceNumber = client->sequence;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- rep.dotclock = dotClock;
- rep.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
- rep.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
- rep.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
- rep.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
- rep.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
- rep.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
- rep.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
- rep.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
- rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
- rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
-
- if (xf86GetVerbosity() > 1) {
- ErrorF("GetModeLine - scrn: %d clock: %ld\n",
- stuff->screen, (unsigned long)rep.dotclock);
- ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- rep.hdisplay, rep.hsyncstart,
- rep.hsyncend, rep.htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- rep.vdisplay, rep.vsyncstart, rep.vsyncend,
- rep.vtotal, (unsigned long)rep.flags);
- }
-
- /*
- * Older servers sometimes had server privates that the VidMode
- * extention made available. So to be compatiable pretend that
- * there are no server privates to pass to the client
- */
- rep.privsize = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.dotclock, n);
- swaps(&rep.hdisplay, n);
- swaps(&rep.hsyncstart, n);
- swaps(&rep.hsyncend, n);
- swaps(&rep.htotal, n);
- swaps(&rep.hskew, n);
- swaps(&rep.vdisplay, n);
- swaps(&rep.vsyncstart, n);
- swaps(&rep.vsyncend, n);
- swaps(&rep.vtotal, n);
- swapl(&rep.flags, n);
- swapl(&rep.privsize, n);
- }
- if (ver < 2) {
- oldrep.type = rep.type;
- oldrep.sequenceNumber = rep.sequenceNumber;
- oldrep.length = rep.length;
- oldrep.dotclock = rep.dotclock;
- oldrep.hdisplay = rep.hdisplay;
- oldrep.hsyncstart = rep.hsyncstart;
- oldrep.hsyncend = rep.hsyncend;
- oldrep.htotal = rep.htotal;
- oldrep.vdisplay = rep.vdisplay;
- oldrep.vsyncstart = rep.vsyncstart;
- oldrep.vsyncend = rep.vsyncend;
- oldrep.vtotal = rep.vtotal;
- oldrep.flags = rep.flags;
- oldrep.privsize = rep.privsize;
- WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply),
- (char *)&oldrep);
- } else {
- WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
- (char *)&rep);
- }
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetAllModeLines(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetAllModeLinesReq);
- xXF86VidModeGetAllModeLinesReply rep;
- xXF86VidModeModeInfo mdinf;
- xXF86OldVidModeModeInfo oldmdinf;
- pointer mode;
- int modecount, dotClock;
- register int n;
- int ver;
-
- DEBUG_P("XF86VidModeGetAllModelines");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- ver = ClientMajorVersion(client);
-
- modecount = VidModeGetNumOfModes(stuff->screen);
- if (modecount < 1)
- return (VidModeErrorBase + XF86VidModeExtensionDisabled);
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
- SIZEOF(xGenericReply);
- if (ver < 2)
- rep.length += modecount * sizeof(xXF86OldVidModeModeInfo);
- else
- rep.length += modecount * sizeof(xXF86VidModeModeInfo);
- rep.length >>= 2;
- rep.sequenceNumber = client->sequence;
- rep.modecount = modecount;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.modecount, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep);
-
- do {
- mdinf.dotclock = dotClock;
- mdinf.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
- mdinf.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
- mdinf.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
- mdinf.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
- mdinf.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
- mdinf.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
- mdinf.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
- mdinf.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
- mdinf.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
- mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
- mdinf.privsize = 0;
- if (client->swapped) {
- swapl(&mdinf.dotclock, n);
- swaps(&mdinf.hdisplay, n);
- swaps(&mdinf.hsyncstart, n);
- swaps(&mdinf.hsyncend, n);
- swaps(&mdinf.htotal, n);
- swaps(&mdinf.hskew, n);
- swaps(&mdinf.vdisplay, n);
- swaps(&mdinf.vsyncstart, n);
- swaps(&mdinf.vsyncend, n);
- swaps(&mdinf.vtotal, n);
- swapl(&mdinf.flags, n);
- swapl(&mdinf.privsize, n);
- }
- if (ver < 2) {
- oldmdinf.dotclock = mdinf.dotclock;
- oldmdinf.hdisplay = mdinf.hdisplay;
- oldmdinf.hsyncstart = mdinf.hsyncstart;
- oldmdinf.hsyncend = mdinf.hsyncend;
- oldmdinf.htotal = mdinf.htotal;
- oldmdinf.vdisplay = mdinf.vdisplay;
- oldmdinf.vsyncstart = mdinf.vsyncstart;
- oldmdinf.vsyncend = mdinf.vsyncend;
- oldmdinf.vtotal = mdinf.vtotal;
- oldmdinf.flags = mdinf.flags;
- oldmdinf.privsize = mdinf.privsize;
- WriteToClient(client, sizeof(xXF86OldVidModeModeInfo),
- (char *)&oldmdinf);
- } else {
- WriteToClient(client, sizeof(xXF86VidModeModeInfo), (char *)&mdinf);
- }
-
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return (client->noClientException);
-}
-
-#define MODEMATCH(mode,stuff) \
- (VidModeGetModeValue(mode, VIDMODE_H_DISPLAY) == stuff->hdisplay \
- && VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART) == stuff->hsyncstart \
- && VidModeGetModeValue(mode, VIDMODE_H_SYNCEND) == stuff->hsyncend \
- && VidModeGetModeValue(mode, VIDMODE_H_TOTAL) == stuff->htotal \
- && VidModeGetModeValue(mode, VIDMODE_V_DISPLAY) == stuff->vdisplay \
- && VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART) == stuff->vsyncstart \
- && VidModeGetModeValue(mode, VIDMODE_V_SYNCEND) == stuff->vsyncend \
- && VidModeGetModeValue(mode, VIDMODE_V_TOTAL) == stuff->vtotal \
- && VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags )
-
-static int
-ProcXF86VidModeAddModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeAddModeLineReq);
- xXF86OldVidModeAddModeLineReq *oldstuff =
- (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
- xXF86VidModeAddModeLineReq newstuff;
- pointer mode;
- int len;
- int dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeAddModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- stuff->after_dotclock = oldstuff->after_dotclock;
- stuff->after_hdisplay = oldstuff->after_hdisplay;
- stuff->after_hsyncstart = oldstuff->after_hsyncstart;
- stuff->after_hsyncend = oldstuff->after_hsyncend;
- stuff->after_htotal = oldstuff->after_htotal;
- stuff->after_hskew = 0;
- stuff->after_vdisplay = oldstuff->after_vdisplay;
- stuff->after_vsyncstart = oldstuff->after_vsyncstart;
- stuff->after_vsyncend = oldstuff->after_vsyncend;
- stuff->after_vtotal = oldstuff->after_vtotal;
- stuff->after_flags = oldstuff->after_flags;
- }
- if (xf86GetVerbosity() > 1) {
- ErrorF("AddModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- ErrorF(" after - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->after_dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->after_hdisplay, stuff->after_hsyncstart,
- stuff->after_hsyncend, stuff->after_htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->after_vdisplay, stuff->after_vsyncstart,
- stuff->after_vsyncend, stuff->after_vtotal,
- (unsigned long)stuff->after_flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
- len = client->req_len - (sizeof(xXF86OldVidModeAddModeLineReq) >> 2);
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
- len = client->req_len - (sizeof(xXF86VidModeAddModeLineReq) >> 2);
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- return BadValue;
-
- if (stuff->after_hsyncstart < stuff->after_hdisplay ||
- stuff->after_hsyncend < stuff->after_hsyncstart ||
- stuff->after_htotal < stuff->after_hsyncend ||
- stuff->after_vsyncstart < stuff->after_vdisplay ||
- stuff->after_vsyncend < stuff->after_vsyncstart ||
- stuff->after_vtotal < stuff->after_vsyncend)
- return BadValue;
-
- if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) {
- Bool found = FALSE;
- if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) {
- do {
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock)
- == dotClock) && MODEMATCH(mode, stuff)) {
- found = TRUE;
- break;
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
- }
- if (!found)
- return BadValue;
- }
-
-
- mode = VidModeCreateMode();
- if (mode == NULL)
- return BadValue;
-
- VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
- VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
-
- if (stuff->privsize)
- ErrorF("AddModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, mode)) {
- case MODE_OK:
- break;
- case MODE_HSYNC:
- case MODE_H_ILLEGAL:
- xfree(mode);
- return VidModeErrorBase + XF86VidModeBadHTimings;
- case MODE_VSYNC:
- case MODE_V_ILLEGAL:
- xfree(mode);
- return VidModeErrorBase + XF86VidModeBadVTimings;
- default:
- xfree(mode);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- /* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) {
- xfree(mode);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- VidModeSetCrtcForMode(stuff->screen, mode);
-
- VidModeAddModeline(stuff->screen, mode);
-
- if (xf86GetVerbosity() > 1)
- ErrorF("AddModeLine - Succeeded\n");
- return client->noClientException;
-}
-
-static int
-ProcXF86VidModeDeleteModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeDeleteModeLineReq);
- xXF86OldVidModeDeleteModeLineReq *oldstuff =
- (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
- xXF86VidModeDeleteModeLineReq newstuff;
- pointer mode;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeDeleteModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > 1) {
- ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
- len = client->req_len - (sizeof(xXF86OldVidModeDeleteModeLineReq) >> 2);
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
- len = client->req_len - (sizeof(xXF86VidModeDeleteModeLineReq) >> 2);
- }
- if (len != stuff->privsize) {
- if (xf86GetVerbosity() > 1) {
- ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
- "len = %d, length = %d\n",
- (unsigned long)client->req_len,
- (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2,
- (unsigned long)stuff->privsize, len, stuff->length);
- }
- return BadLength;
- }
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- if (xf86GetVerbosity() > 1) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff))
- return BadValue;
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- do {
- if (xf86GetVerbosity() > 1) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff)) {
- VidModeDeleteModeline(stuff->screen, mode);
- if (xf86GetVerbosity())
- ErrorF("DeleteModeLine - Succeeded\n");
- return(client->noClientException);
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return BadValue;
-}
-
-static int
-ProcXF86VidModeModModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeModModeLineReq);
- xXF86OldVidModeModModeLineReq *oldstuff =
- (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
- xXF86VidModeModModeLineReq newstuff;
- pointer mode, modetmp;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeModModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2 ) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > 1) {
- ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
- (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
- len = client->req_len - (sizeof(xXF86OldVidModeModModeLineReq) >> 2);
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
- len = client->req_len - (sizeof(xXF86VidModeModModeLineReq) >> 2);
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- return BadValue;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- modetmp = VidModeCreateMode();
- VidModeCopyMode(mode, modetmp);
-
- VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
-
- if (stuff->privsize)
- ErrorF("ModModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, modetmp)) {
- case MODE_OK:
- break;
- case MODE_HSYNC:
- case MODE_H_ILLEGAL:
- xfree(modetmp);
- return VidModeErrorBase + XF86VidModeBadHTimings;
- case MODE_VSYNC:
- case MODE_V_ILLEGAL:
- xfree(modetmp);
- return VidModeErrorBase + XF86VidModeBadVTimings;
- default:
- xfree(modetmp);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- /* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
- xfree(modetmp);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
- xfree(modetmp);
-
- VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
-
- VidModeSetCrtcForMode(stuff->screen, mode);
- VidModeSwitchMode(stuff->screen, mode);
-
- if (xf86GetVerbosity() > 1)
- ErrorF("ModModeLine - Succeeded\n");
- return(client->noClientException);
-}
-
-static int
-ProcXF86VidModeValidateModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeValidateModeLineReq);
- xXF86OldVidModeValidateModeLineReq *oldstuff =
- (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
- xXF86VidModeValidateModeLineReq newstuff;
- xXF86VidModeValidateModeLineReply rep;
- pointer mode, modetmp = NULL;
- int len, status, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeValidateModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > 1) {
- ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
- len = client->req_len -
- (sizeof(xXF86OldVidModeValidateModeLineReq) >> 2);
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
- len = client->req_len - (sizeof(xXF86VidModeValidateModeLineReq) >> 2);
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- status = MODE_OK;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- {
- status = MODE_BAD;
- goto status_reply;
- }
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- modetmp = VidModeCreateMode();
- VidModeCopyMode(mode, modetmp);
-
- VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
- if (stuff->privsize)
- ErrorF("ValidateModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- if ((status = VidModeCheckModeForMonitor(stuff->screen, modetmp)) != MODE_OK)
- goto status_reply;
-
- /* Check that the driver is happy with the mode */
- status = VidModeCheckModeForDriver(stuff->screen, modetmp);
-
-status_reply:
- if(modetmp)
- xfree(modetmp);
-
- rep.type = X_Reply;
- rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply)
- - SIZEOF(xGenericReply)) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.status = status;
- if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
- if (xf86GetVerbosity() > 1)
- ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
- return(client->noClientException);
-}
-
-static int
-ProcXF86VidModeSwitchMode(ClientPtr client)
-{
- REQUEST(xXF86VidModeSwitchModeReq);
-
- DEBUG_P("XF86VidModeSwitchMode");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeSwitchToMode(ClientPtr client)
-{
- REQUEST(xXF86VidModeSwitchToModeReq);
- xXF86OldVidModeSwitchToModeReq *oldstuff =
- (xXF86OldVidModeSwitchToModeReq *)client->requestBuffer;
- xXF86VidModeSwitchToModeReq newstuff;
- pointer mode;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeSwitchToMode");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > 1) {
- ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq);
- len = client->req_len - (sizeof(xXF86OldVidModeSwitchToModeReq) >> 2);
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeSwitchToModeReq);
- len = client->req_len - (sizeof(xXF86VidModeSwitchToModeReq) >> 2);
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
- && MODEMATCH(mode, stuff))
- return (client->noClientException);
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- do {
- if (xf86GetVerbosity() > 1) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff)) {
-
- if (!VidModeSwitchMode(stuff->screen, mode))
- return BadValue;
-
- if (xf86GetVerbosity() > 1)
- ErrorF("SwitchToMode - Succeeded\n");
- return(client->noClientException);
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return BadValue;
-}
-
-static int
-ProcXF86VidModeLockModeSwitch(ClientPtr client)
-{
- REQUEST(xXF86VidModeLockModeSwitchReq);
-
- REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
-
- DEBUG_P("XF86VidModeLockModeSwitch");
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
- return VidModeErrorBase + XF86VidModeZoomLocked;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetMonitor(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetMonitorReq);
- xXF86VidModeGetMonitorReply rep;
- register int n;
- CARD32 *hsyncdata, *vsyncdata;
- int i, nHsync, nVrefresh;
- pointer monitor;
-
- DEBUG_P("XF86VidModeGetMonitor");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetMonitor(stuff->screen, &monitor))
- return BadValue;
-
- nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
- nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
-
- rep.type = X_Reply;
- if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
- rep.vendorLength = strlen((char *)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VENDOR, 0)).ptr);
- else
- rep.vendorLength = 0;
- if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr)
- rep.modelLength = strlen((char *)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_MODEL, 0)).ptr);
- else
- rep.modelLength = 0;
- rep.length = (SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) +
- (nHsync + nVrefresh) * sizeof(CARD32) +
- ((rep.vendorLength + 3) & ~3) +
- ((rep.modelLength + 3) & ~3)) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.nhsync = nHsync;
- rep.nvsync = nVrefresh;
- hsyncdata = ALLOCATE_LOCAL(nHsync * sizeof(CARD32));
- if (!hsyncdata) {
- return BadAlloc;
- }
-
- vsyncdata = ALLOCATE_LOCAL(nVrefresh * sizeof(CARD32));
- if (!vsyncdata) {
- DEALLOCATE_LOCAL(hsyncdata);
- return BadAlloc;
- }
-
- for (i = 0; i < nHsync; i++) {
- hsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_HSYNC_LO, i)).f |
- (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_HSYNC_HI, i)).f << 16;
- }
- for (i = 0; i < nVrefresh; i++) {
- vsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VREFRESH_LO, i)).f |
- (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VREFRESH_HI, i)).f << 16;
- }
-
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep);
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, nHsync * sizeof(CARD32),
- hsyncdata);
- WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32),
- vsyncdata);
- if (rep.vendorLength)
- WriteToClient(client, rep.vendorLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
- if (rep.modelLength)
- WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
-
- DEALLOCATE_LOCAL(hsyncdata);
- DEALLOCATE_LOCAL(vsyncdata);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetViewPort(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetViewPortReq);
- xXF86VidModeGetViewPortReply rep;
- int x, y, n;
-
- DEBUG_P("XF86VidModeGetViewPort");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- VidModeGetViewPort(stuff->screen, &x, &y);
- rep.x = x;
- rep.y = y;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.x, n);
- swapl(&rep.y, n);
- }
- WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeSetViewPort(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetViewPortReq);
-
- DEBUG_P("XF86VidModeSetViewPort");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
- return BadValue;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetDotClocks(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetDotClocksReq);
- xXF86VidModeGetDotClocksReply rep;
- register int n;
- int numClocks;
- CARD32 dotclock;
- int *Clocks = NULL;
- Bool ClockProg;
-
- DEBUG_P("XF86VidModeGetDotClocks");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
-
- rep.type = X_Reply;
- rep.length = (SIZEOF(xXF86VidModeGetDotClocksReply)
- - SIZEOF(xGenericReply) + numClocks) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.clocks = numClocks;
- rep.maxclocks = MAXCLOCKS;
- rep.flags = 0;
-
- if (!ClockProg) {
- Clocks = ALLOCATE_LOCAL(numClocks * sizeof(int));
- if (!Clocks)
- return BadValue;
- if (!VidModeGetClocks(stuff->screen, Clocks)) {
- DEALLOCATE_LOCAL(Clocks);
- return BadValue;
- }
- }
-
- if (ClockProg) {
- rep.flags |= CLKFLAG_PROGRAMABLE;
- }
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.clocks, n);
- swapl(&rep.maxclocks, n);
- swapl(&rep.flags, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep);
- if (!ClockProg) {
- for (n = 0; n < numClocks; n++) {
- dotclock = *Clocks++;
- if (client->swapped) {
- WriteSwappedDataToClient(client, 4, (char *)&dotclock);
- } else {
- WriteToClient(client, 4, (char *)&dotclock);
- }
- }
- }
-
- DEALLOCATE_LOCAL(Clocks);
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeSetGamma(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetGammaReq);
-
- DEBUG_P("XF86VidModeSetGamma");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeSetGamma(stuff->screen, ((float)stuff->red)/10000.,
- ((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
- return BadValue;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetGamma(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetGammaReq);
- xXF86VidModeGetGammaReply rep;
- register int n;
- float red, green, blue;
-
- DEBUG_P("XF86VidModeGetGamma");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (!VidModeGetGamma(stuff->screen, &red, &green, &blue))
- return BadValue;
- rep.red = (CARD32)(red * 10000.);
- rep.green = (CARD32)(green * 10000.);
- rep.blue = (CARD32)(blue * 10000.);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.red, n);
- swapl(&rep.green, n);
- swapl(&rep.blue, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeSetGammaRamp(ClientPtr client)
-{
- CARD16 *r, *g, *b;
- int length;
- REQUEST(xXF86VidModeSetGammaRampReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
- return BadValue;
-
- length = (stuff->size + 1) & ~1;
-
- REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6);
-
- r = (CARD16*)&stuff[1];
- g = r + length;
- b = g + length;
-
- if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
- return BadValue;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetGammaRamp(ClientPtr client)
-{
- CARD16 *ramp = NULL;
- int n, length, i;
- xXF86VidModeGetGammaRampReply rep;
- REQUEST(xXF86VidModeGetGammaRampReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
-
- length = (stuff->size + 1) & ~1;
-
- if(stuff->size) {
- if(!(ramp = xalloc(length * 3 * sizeof(CARD16))))
- return BadAlloc;
-
- if (!VidModeGetGammaRamp(stuff->screen, stuff->size,
- ramp, ramp + length, ramp + (length * 2)))
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = (length >> 1) * 3;
- rep.sequenceNumber = client->sequence;
- rep.size = stuff->size;
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.size, n);
- for(i = 0; i < length * 3; i++)
- swaps(&ramp[i],n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
-
- if(stuff->size) {
- WriteToClient(client, rep.length << 2, (char*)ramp);
- xfree(ramp);
- }
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXF86VidModeGetGammaRampSize(ClientPtr client)
-{
- xXF86VidModeGetGammaRampSizeReply rep;
- int n;
- REQUEST(xXF86VidModeGetGammaRampSizeReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.size = VidModeGetGammaRampSize(stuff->screen);
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.size, n);
- }
- WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeGetPermissions(ClientPtr client)
-{
- xXF86VidModeGetPermissionsReply rep;
- int n;
- REQUEST(xXF86VidModeGetPermissionsReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.permissions = XF86VM_READ_PERMISSION;
- if (xf86GetVidModeEnabled() &&
- (xf86GetVidModeAllowNonLocal() || LocalClient (client))) {
- rep.permissions |= XF86VM_WRITE_PERMISSION;
- }
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.permissions, n);
- }
- WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
-
- return (client->noClientException);
-}
-
-
-static int
-ProcXF86VidModeSetClientVersion(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetClientVersionReq);
-
- VidModePrivPtr pPriv;
-
- DEBUG_P("XF86VidModeSetClientVersion");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
-
- if ((pPriv = VMPRIV(client)) == NULL) {
- pPriv = xalloc(sizeof(VidModePrivRec));
- if (!pPriv)
- return BadAlloc;
- VMPRIV(client) = pPriv;
- }
- pPriv->major = stuff->major;
- pPriv->minor = stuff->minor;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86VidModeDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86VidModeQueryVersion:
- return ProcXF86VidModeQueryVersion(client);
- case X_XF86VidModeGetModeLine:
- return ProcXF86VidModeGetModeLine(client);
- case X_XF86VidModeGetMonitor:
- return ProcXF86VidModeGetMonitor(client);
- case X_XF86VidModeGetAllModeLines:
- return ProcXF86VidModeGetAllModeLines(client);
- case X_XF86VidModeValidateModeLine:
- return ProcXF86VidModeValidateModeLine(client);
- case X_XF86VidModeGetViewPort:
- return ProcXF86VidModeGetViewPort(client);
- case X_XF86VidModeGetDotClocks:
- return ProcXF86VidModeGetDotClocks(client);
- case X_XF86VidModeSetClientVersion:
- return ProcXF86VidModeSetClientVersion(client);
- case X_XF86VidModeGetGamma:
- return ProcXF86VidModeGetGamma(client);
- case X_XF86VidModeGetGammaRamp:
- return ProcXF86VidModeGetGammaRamp(client);
- case X_XF86VidModeGetGammaRampSize:
- return ProcXF86VidModeGetGammaRampSize(client);
- case X_XF86VidModeGetPermissions:
- return ProcXF86VidModeGetPermissions(client);
- default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86VidModeAddModeLine:
- return ProcXF86VidModeAddModeLine(client);
- case X_XF86VidModeDeleteModeLine:
- return ProcXF86VidModeDeleteModeLine(client);
- case X_XF86VidModeModModeLine:
- return ProcXF86VidModeModModeLine(client);
- case X_XF86VidModeSwitchMode:
- return ProcXF86VidModeSwitchMode(client);
- case X_XF86VidModeSwitchToMode:
- return ProcXF86VidModeSwitchToMode(client);
- case X_XF86VidModeLockModeSwitch:
- return ProcXF86VidModeLockModeSwitch(client);
- case X_XF86VidModeSetViewPort:
- return ProcXF86VidModeSetViewPort(client);
- case X_XF86VidModeSetGamma:
- return ProcXF86VidModeSetGamma(client);
- case X_XF86VidModeSetGammaRamp:
- return ProcXF86VidModeSetGammaRamp(client);
- default:
- return BadRequest;
- }
- } else
- return VidModeErrorBase + XF86VidModeClientNotLocal;
- }
-}
-
-static int
-SProcXF86VidModeQueryVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXF86VidModeQueryVersion(client);
-}
-
-static int
-SProcXF86VidModeGetModeLine(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetModeLineReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetModeLine(client);
-}
-
-static int
-SProcXF86VidModeGetAllModeLines(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetAllModeLinesReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetAllModeLines(client);
-}
-
-static int
-SProcXF86VidModeAddModeLine(ClientPtr client)
-{
- xXF86OldVidModeAddModeLineReq *oldstuff =
- (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeAddModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeAddModeLine(client);
-}
-
-static int
-SProcXF86VidModeDeleteModeLine(ClientPtr client)
-{
- xXF86OldVidModeDeleteModeLineReq *oldstuff =
- (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeDeleteModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeDeleteModeLine(client);
-}
-
-static int
-SProcXF86VidModeModModeLine(ClientPtr client)
-{
- xXF86OldVidModeModModeLineReq *oldstuff =
- (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeModModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeModModeLine(client);
-}
-
-static int
-SProcXF86VidModeValidateModeLine(ClientPtr client)
-{
- xXF86OldVidModeValidateModeLineReq *oldstuff =
- (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeValidateModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeValidateModeLine(client);
-}
-
-static int
-SProcXF86VidModeSwitchMode(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSwitchModeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
- swaps(&stuff->screen, n);
- swaps(&stuff->zoom, n);
- return ProcXF86VidModeSwitchMode(client);
-}
-
-static int
-SProcXF86VidModeSwitchToMode(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSwitchToModeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeSwitchToMode(client);
-}
-
-static int
-SProcXF86VidModeLockModeSwitch(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeLockModeSwitchReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
- swaps(&stuff->screen, n);
- swaps(&stuff->lock, n);
- return ProcXF86VidModeLockModeSwitch(client);
-}
-
-static int
-SProcXF86VidModeGetMonitor(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetMonitorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetMonitor(client);
-}
-
-static int
-SProcXF86VidModeGetViewPort(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetViewPortReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetViewPort(client);
-}
-
-static int
-SProcXF86VidModeSetViewPort(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetViewPortReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->x, n);
- swapl(&stuff->y, n);
- return ProcXF86VidModeSetViewPort(client);
-}
-
-static int
-SProcXF86VidModeGetDotClocks(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetDotClocksReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetDotClocks(client);
-}
-
-static int
-SProcXF86VidModeSetClientVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetClientVersionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
- swaps(&stuff->major, n);
- swaps(&stuff->minor, n);
- return ProcXF86VidModeSetClientVersion(client);
-}
-
-static int
-SProcXF86VidModeSetGamma(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetGammaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->red, n);
- swapl(&stuff->green, n);
- swapl(&stuff->blue, n);
- return ProcXF86VidModeSetGamma(client);
-}
-
-static int
-SProcXF86VidModeGetGamma(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetGammaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGamma(client);
-}
-
-static int
-SProcXF86VidModeSetGammaRamp(ClientPtr client)
-{
- CARD16 *ramp;
- int length, n;
- REQUEST(xXF86VidModeSetGammaRampReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
- swaps(&stuff->size, n);
- swaps(&stuff->screen, n);
- length = ((stuff->size + 1) & ~1) * 6;
- REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
- ramp = (CARD16*)&stuff[1];
- while(length--) {
- swaps(ramp, n);
- ramp++;
- }
- return ProcXF86VidModeSetGammaRamp(client);
-}
-
-static int
-SProcXF86VidModeGetGammaRamp(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetGammaRampReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
- swaps(&stuff->size, n);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGammaRamp(client);
-}
-
-static int
-SProcXF86VidModeGetGammaRampSize(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetGammaRampSizeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGammaRampSize(client);
-}
-
-static int
-SProcXF86VidModeGetPermissions(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetPermissionsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetPermissions(client);
-}
-
-
-static int
-SProcXF86VidModeDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86VidModeQueryVersion:
- return SProcXF86VidModeQueryVersion(client);
- case X_XF86VidModeGetModeLine:
- return SProcXF86VidModeGetModeLine(client);
- case X_XF86VidModeGetMonitor:
- return SProcXF86VidModeGetMonitor(client);
- case X_XF86VidModeGetAllModeLines:
- return SProcXF86VidModeGetAllModeLines(client);
- case X_XF86VidModeGetViewPort:
- return SProcXF86VidModeGetViewPort(client);
- case X_XF86VidModeValidateModeLine:
- return SProcXF86VidModeValidateModeLine(client);
- case X_XF86VidModeGetDotClocks:
- return SProcXF86VidModeGetDotClocks(client);
- case X_XF86VidModeSetClientVersion:
- return SProcXF86VidModeSetClientVersion(client);
- case X_XF86VidModeGetGamma:
- return SProcXF86VidModeGetGamma(client);
- case X_XF86VidModeGetGammaRamp:
- return SProcXF86VidModeGetGammaRamp(client);
- case X_XF86VidModeGetGammaRampSize:
- return SProcXF86VidModeGetGammaRampSize(client);
- case X_XF86VidModeGetPermissions:
- return SProcXF86VidModeGetPermissions(client);
- default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
- switch (stuff->data) {
- case X_XF86VidModeAddModeLine:
- return SProcXF86VidModeAddModeLine(client);
- case X_XF86VidModeDeleteModeLine:
- return SProcXF86VidModeDeleteModeLine(client);
- case X_XF86VidModeModModeLine:
- return SProcXF86VidModeModModeLine(client);
- case X_XF86VidModeSwitchMode:
- return SProcXF86VidModeSwitchMode(client);
- case X_XF86VidModeSwitchToMode:
- return SProcXF86VidModeSwitchToMode(client);
- case X_XF86VidModeLockModeSwitch:
- return SProcXF86VidModeLockModeSwitch(client);
- case X_XF86VidModeSetViewPort:
- return SProcXF86VidModeSetViewPort(client);
- case X_XF86VidModeSetGamma:
- return SProcXF86VidModeSetGamma(client);
- case X_XF86VidModeSetGammaRamp:
- return SProcXF86VidModeSetGammaRamp(client);
- default:
- return BadRequest;
- }
- } else
- return VidModeErrorBase + XF86VidModeClientNotLocal;
- }
-}
diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c
deleted file mode 100644
index 4a9c461f6..000000000
--- a/hw/xfree86/dixmods/extmod/xvmod.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmod.c,v 1.2 2001/03/05 04:51:55 mvojkovi Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "gc.h"
-#include "Xv.h"
-#include "Xvproto.h"
-#include "xvdix.h"
-#include "xvmodproc.h"
-
-void
-XvRegister()
-{
- XvScreenInitProc = XvScreenInit;
- XvGetScreenIndexProc = XvGetScreenIndex;
- XvGetRTPortProc = XvGetRTPort;
- XvMCScreenInitProc = XvMCScreenInit;
-}
-
diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h
deleted file mode 100644
index 2dcbd472a..000000000
--- a/hw/xfree86/dixmods/extmod/xvmodproc.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmodproc.h,v 1.3 2001/04/08 16:33:22 dawes Exp $ */
-
-#include "xvmcext.h"
-
-extern int (*XvGetScreenIndexProc)(void);
-extern unsigned long (*XvGetRTPortProc)(void);
-extern int (*XvScreenInitProc)(ScreenPtr);
-extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
-
-extern void XvRegister(void);
diff --git a/hw/xfree86/dixmods/fbmodule.c b/hw/xfree86/dixmods/fbmodule.c
deleted file mode 100644
index 2b9c50408..000000000
--- a/hw/xfree86/dixmods/fbmodule.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.3 2000/02/14 19:20:29 dawes Exp $ */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "fb.h"
-
-static XF86ModuleVersionInfo VersRec =
-{
- "fb",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData fbModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c
deleted file mode 100644
index ceb5485c0..000000000
--- a/hw/xfree86/dixmods/ftmodule.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 1998-2002 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.18 2003/11/02 04:30:57 dawes Exp $ */
-
-#include "misc.h"
-
-#include "fontmod.h"
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(freetypeSetup);
-
- /*
- * This is the module data function that is accessed when loading
- * libfreetype as a module.
- */
-
-static XF86ModuleVersionInfo VersRec =
-{
- "freetype",
- MODULEVENDORSTRING " & the After X-TT Project",
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 2, 1, 0,
- ABI_CLASS_FONT, /* Font module */
- ABI_FONT_VERSION,
- MOD_CLASS_FONT,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData freetypeModuleData = { &VersRec, freetypeSetup, NULL };
-
-extern void FreeTypeRegisterFontFileFunctions(void);
-
-FontModule freetypeModule = {
- FreeTypeRegisterFontFileFunctions,
- "FreeType",
- NULL
-};
-
-static pointer
-freetypeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- freetypeModule.module = module;
- LoadFont(&freetypeModule);
-
- /* Need a non-NULL return */
- return (pointer)1;
-}
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
deleted file mode 100644
index f449d55ec..000000000
--- a/hw/xfree86/dixmods/glxmodule.c
+++ /dev/null
@@ -1,1266 +0,0 @@
-
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.12 2003/09/28 20:15:40 alanh Exp $ */
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#include "xf86Module.h"
-#include "colormap.h"
-#include "micmap.h"
-
-static MODULESETUPPROTO(glxSetup);
-
-extern void GlxExtensionInit(INITARGS);
-extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
-extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *));
-
-static const char *initdeps[] = { "DOUBLE-BUFFER", NULL };
-
-ExtensionModule GLXExt =
-{
- GlxExtensionInit,
- "GLX",
- NULL,
- NULL,
- initdeps
-};
-
-static const char *glcoreSymbols[] = {
- "__glCallLists_size",
- "__glColorTableParameterfv_size",
- "__glColorTableParameteriv_size",
- "__glConvolutionParameterfv_size",
- "__glConvolutionParameteriv_size",
- "__glDDXExtensionInfo",
- "__glDDXScreenInfo",
- "__glEvalComputeK",
- "__glFloorLog2",
- "__glFogfv_size",
- "__glFogiv_size",
- "__glGetBooleanv_size",
- "__glGetColorTableParameterfv_size",
- "__glGetColorTableParameteriv_size",
- "__glGetConvolutionParameterfv_size",
- "__glGetConvolutionParameteriv_size",
- "__glGetDoublev_size",
- "__glGetFloatv_size",
- "__glGetHistogramParameterfv_size",
- "__glGetHistogramParameteriv_size",
- "__glGetIntegerv_size",
- "__glGetLightfv_size",
- "__glGetLightiv_size",
- "__glGetMapdv_size",
- "__glGetMapfv_size",
- "__glGetMapiv_size",
- "__glGetMaterialfv_size",
- "__glGetMaterialiv_size",
- "__glGetMinmaxParameterfv_size",
- "__glGetMinmaxParameteriv_size",
- "__glGetPixelMapfv_size",
- "__glGetPixelMapuiv_size",
- "__glGetPixelMapusv_size",
- "__glGetTexEnvfv_size",
- "__glGetTexEnviv_size",
- "__glGetTexGendv_size",
- "__glGetTexGenfv_size",
- "__glGetTexGeniv_size",
- "__glGetTexImage_size",
- "__glGetTexLevelParameterfv_size",
- "__glGetTexLevelParameteriv_size",
- "__glGetTexParameterfv_size",
- "__glGetTexParameteriv_size",
- "__glLightModelfv_size",
- "__glLightModeliv_size",
- "__glLightfv_size",
- "__glLightiv_size",
- "__glMaterialfv_size",
- "__glMaterialiv_size",
- "__glPointParameterfvARB_size",
- "__glReadPixels_size",
- "__glTexEnvfv_size",
- "__glTexEnviv_size",
- "__glTexGendv_size",
- "__glTexGenfv_size",
- "__glTexGeniv_size",
- "__glTexParameterfv_size",
- "__glTexParameteriv_size",
- "__glXActiveScreens",
- "__glXAssociateContext",
- "__glXBadContext",
- "__glXBadContextState",
- "__glXBadContextTag",
- "__glXBadCurrentWindow",
- "__glXBadDrawable",
- "__glXBadLargeRequest",
- "__glXBadPixmap",
- "__glXBadRenderRequest",
- "__glXBitmapReqSize",
- "__glXCacheDrawableSize",
- "__glXCallListsReqSize",
- "__glXClearErrorOccured",
- "__glXClientInfo",
- "__glXClientRes",
- "__glXClients",
- "__glXColorSubTableReqSize",
- "__glXColorTableParameterfvReqSize",
- "__glXColorTableParameterivReqSize",
- "__glXColorTableReqSize",
- "__glXContextRes",
- "__glXConvolutionFilter1DReqSize",
- "__glXConvolutionFilter2DReqSize",
- "__glXConvolutionParameterfvReqSize",
- "__glXConvolutionParameterivReqSize",
- "__glXCopyContext",
- "__glXCoreType",
- "__glXCreateContext",
- "__glXCreateGLXPixmap",
- "__glXDeassociateContext",
- "__glXDestroyContext",
- "__glXDestroyGLXPixmap",
- "__glXDispSwap_Accum",
- "__glXDispSwap_ActiveStencilFaceEXT",
- "__glXDispSwap_ActiveTextureARB",
- "__glXDispSwap_AlphaFunc",
- "__glXDispSwap_AreTexturesResident",
- "__glXDispSwap_AreTexturesResidentEXT",
- "__glXDispSwap_Begin",
- "__glXDispSwap_BindTexture",
- "__glXDispSwap_Bitmap",
- "__glXDispSwap_BlendColor",
- "__glXDispSwap_BlendEquation",
- "__glXDispSwap_BlendFunc",
- "__glXDispSwap_CallList",
- "__glXDispSwap_CallLists",
- "__glXDispSwap_Clear",
- "__glXDispSwap_ClearAccum",
- "__glXDispSwap_ClearColor",
- "__glXDispSwap_ClearDepth",
- "__glXDispSwap_ClearIndex",
- "__glXDispSwap_ClearStencil",
- "__glXDispSwap_ClipPlane",
- "__glXDispSwap_Color3bv",
- "__glXDispSwap_Color3dv",
- "__glXDispSwap_Color3fv",
- "__glXDispSwap_Color3iv",
- "__glXDispSwap_Color3sv",
- "__glXDispSwap_Color3ubv",
- "__glXDispSwap_Color3uiv",
- "__glXDispSwap_Color3usv",
- "__glXDispSwap_Color4bv",
- "__glXDispSwap_Color4dv",
- "__glXDispSwap_Color4fv",
- "__glXDispSwap_Color4iv",
- "__glXDispSwap_Color4sv",
- "__glXDispSwap_Color4ubv",
- "__glXDispSwap_Color4uiv",
- "__glXDispSwap_Color4usv",
- "__glXDispSwap_ColorMask",
- "__glXDispSwap_ColorMaterial",
- "__glXDispSwap_ColorSubTable",
- "__glXDispSwap_ColorTable",
- "__glXDispSwap_ColorTableParameterfv",
- "__glXDispSwap_ColorTableParameteriv",
- "__glXDispSwap_ConvolutionFilter1D",
- "__glXDispSwap_ConvolutionFilter2D",
- "__glXDispSwap_ConvolutionParameterf",
- "__glXDispSwap_ConvolutionParameterfv",
- "__glXDispSwap_ConvolutionParameteri",
- "__glXDispSwap_ConvolutionParameteriv",
- "__glXDispSwap_CopyColorSubTable",
- "__glXDispSwap_CopyColorTable",
- "__glXDispSwap_CopyConvolutionFilter1D",
- "__glXDispSwap_CopyConvolutionFilter2D",
- "__glXDispSwap_CopyPixels",
- "__glXDispSwap_CopyTexImage1D",
- "__glXDispSwap_CopyTexImage2D",
- "__glXDispSwap_CopyTexSubImage1D",
- "__glXDispSwap_CopyTexSubImage2D",
- "__glXDispSwap_CopyTexSubImage3D",
- "__glXDispSwap_CullFace",
- "__glXDispSwap_DeleteLists",
- "__glXDispSwap_DeleteTextures",
- "__glXDispSwap_DeleteTexturesEXT",
- "__glXDispSwap_DepthFunc",
- "__glXDispSwap_DepthMask",
- "__glXDispSwap_DepthRange",
- "__glXDispSwap_Disable",
- "__glXDispSwap_DrawArrays",
- "__glXDispSwap_DrawArraysEXT",
- "__glXDispSwap_DrawBuffer",
- "__glXDispSwap_DrawPixels",
- "__glXDispSwap_EdgeFlagv",
- "__glXDispSwap_Enable",
- "__glXDispSwap_End",
- "__glXDispSwap_EndList",
- "__glXDispSwap_EvalCoord1dv",
- "__glXDispSwap_EvalCoord1fv",
- "__glXDispSwap_EvalCoord2dv",
- "__glXDispSwap_EvalCoord2fv",
- "__glXDispSwap_EvalMesh1",
- "__glXDispSwap_EvalMesh2",
- "__glXDispSwap_EvalPoint1",
- "__glXDispSwap_EvalPoint2",
- "__glXDispSwap_FeedbackBuffer",
- "__glXDispSwap_Finish",
- "__glXDispSwap_Flush",
- "__glXDispSwap_Fogf",
- "__glXDispSwap_Fogfv",
- "__glXDispSwap_Fogi",
- "__glXDispSwap_Fogiv",
- "__glXDispSwap_FrontFace",
- "__glXDispSwap_Frustum",
- "__glXDispSwap_GenLists",
- "__glXDispSwap_GenTextures",
- "__glXDispSwap_GenTexturesEXT",
- "__glXDispSwap_GetBooleanv",
- "__glXDispSwap_GetClipPlane",
- "__glXDispSwap_GetColorTable",
- "__glXDispSwap_GetColorTableParameterfv",
- "__glXDispSwap_GetColorTableParameteriv",
- "__glXDispSwap_GetConvolutionFilter",
- "__glXDispSwap_GetConvolutionParameterfv",
- "__glXDispSwap_GetConvolutionParameteriv",
- "__glXDispSwap_GetDoublev",
- "__glXDispSwap_GetError",
- "__glXDispSwap_GetFloatv",
- "__glXDispSwap_GetHistogram",
- "__glXDispSwap_GetHistogramParameterfv",
- "__glXDispSwap_GetHistogramParameteriv",
- "__glXDispSwap_GetIntegerv",
- "__glXDispSwap_GetLightfv",
- "__glXDispSwap_GetLightiv",
- "__glXDispSwap_GetMapdv",
- "__glXDispSwap_GetMapfv",
- "__glXDispSwap_GetMapiv",
- "__glXDispSwap_GetMaterialfv",
- "__glXDispSwap_GetMaterialiv",
- "__glXDispSwap_GetMinmax",
- "__glXDispSwap_GetMinmaxParameterfv",
- "__glXDispSwap_GetMinmaxParameteriv",
- "__glXDispSwap_GetPixelMapfv",
- "__glXDispSwap_GetPixelMapuiv",
- "__glXDispSwap_GetPixelMapusv",
- "__glXDispSwap_GetPolygonStipple",
- "__glXDispSwap_GetSeparableFilter",
- "__glXDispSwap_GetString",
- "__glXDispSwap_GetTexEnvfv",
- "__glXDispSwap_GetTexEnviv",
- "__glXDispSwap_GetTexGendv",
- "__glXDispSwap_GetTexGenfv",
- "__glXDispSwap_GetTexGeniv",
- "__glXDispSwap_GetTexImage",
- "__glXDispSwap_GetTexLevelParameterfv",
- "__glXDispSwap_GetTexLevelParameteriv",
- "__glXDispSwap_GetTexParameterfv",
- "__glXDispSwap_GetTexParameteriv",
- "__glXDispSwap_Hint",
- "__glXDispSwap_Histogram",
- "__glXDispSwap_IndexMask",
- "__glXDispSwap_Indexdv",
- "__glXDispSwap_Indexfv",
- "__glXDispSwap_Indexiv",
- "__glXDispSwap_Indexsv",
- "__glXDispSwap_Indexubv",
- "__glXDispSwap_InitNames",
- "__glXDispSwap_IsEnabled",
- "__glXDispSwap_IsList",
- "__glXDispSwap_IsTexture",
- "__glXDispSwap_IsTextureEXT",
- "__glXDispSwap_LightModelf",
- "__glXDispSwap_LightModelfv",
- "__glXDispSwap_LightModeli",
- "__glXDispSwap_LightModeliv",
- "__glXDispSwap_Lightf",
- "__glXDispSwap_Lightfv",
- "__glXDispSwap_Lighti",
- "__glXDispSwap_Lightiv",
- "__glXDispSwap_LineStipple",
- "__glXDispSwap_LineWidth",
- "__glXDispSwap_ListBase",
- "__glXDispSwap_LoadIdentity",
- "__glXDispSwap_LoadMatrixd",
- "__glXDispSwap_LoadMatrixf",
- "__glXDispSwap_LoadName",
- "__glXDispSwap_LogicOp",
- "__glXDispSwap_Map1d",
- "__glXDispSwap_Map1f",
- "__glXDispSwap_Map2d",
- "__glXDispSwap_Map2f",
- "__glXDispSwap_MapGrid1d",
- "__glXDispSwap_MapGrid1f",
- "__glXDispSwap_MapGrid2d",
- "__glXDispSwap_MapGrid2f",
- "__glXDispSwap_Materialf",
- "__glXDispSwap_Materialfv",
- "__glXDispSwap_Materiali",
- "__glXDispSwap_Materialiv",
- "__glXDispSwap_MatrixMode",
- "__glXDispSwap_Minmax",
- "__glXDispSwap_MultMatrixd",
- "__glXDispSwap_MultMatrixf",
- "__glXDispSwap_MultiTexCoord1dvARB",
- "__glXDispSwap_MultiTexCoord1fvARB",
- "__glXDispSwap_MultiTexCoord1ivARB",
- "__glXDispSwap_MultiTexCoord1svARB",
- "__glXDispSwap_MultiTexCoord2dvARB",
- "__glXDispSwap_MultiTexCoord2fvARB",
- "__glXDispSwap_MultiTexCoord2ivARB",
- "__glXDispSwap_MultiTexCoord2svARB",
- "__glXDispSwap_MultiTexCoord3dvARB",
- "__glXDispSwap_MultiTexCoord3fvARB",
- "__glXDispSwap_MultiTexCoord3ivARB",
- "__glXDispSwap_MultiTexCoord3svARB",
- "__glXDispSwap_MultiTexCoord4dvARB",
- "__glXDispSwap_MultiTexCoord4fvARB",
- "__glXDispSwap_MultiTexCoord4ivARB",
- "__glXDispSwap_MultiTexCoord4svARB",
- "__glXDispSwap_NewList",
- "__glXDispSwap_Normal3bv",
- "__glXDispSwap_Normal3dv",
- "__glXDispSwap_Normal3fv",
- "__glXDispSwap_Normal3iv",
- "__glXDispSwap_Normal3sv",
- "__glXDispSwap_Ortho",
- "__glXDispSwap_PassThrough",
- "__glXDispSwap_PixelMapfv",
- "__glXDispSwap_PixelMapuiv",
- "__glXDispSwap_PixelMapusv",
- "__glXDispSwap_PixelStoref",
- "__glXDispSwap_PixelStorei",
- "__glXDispSwap_PixelTransferf",
- "__glXDispSwap_PixelTransferi",
- "__glXDispSwap_PixelZoom",
- "__glXDispSwap_PointParameterfARB",
- "__glXDispSwap_PointParameterfvARB",
- "__glXDispSwap_PointSize",
- "__glXDispSwap_PolygonMode",
- "__glXDispSwap_PolygonOffset",
- "__glXDispSwap_PolygonStipple",
- "__glXDispSwap_PopAttrib",
- "__glXDispSwap_PopMatrix",
- "__glXDispSwap_PopName",
- "__glXDispSwap_PrioritizeTextures",
- "__glXDispSwap_PushAttrib",
- "__glXDispSwap_PushMatrix",
- "__glXDispSwap_PushName",
- "__glXDispSwap_RasterPos2dv",
- "__glXDispSwap_RasterPos2fv",
- "__glXDispSwap_RasterPos2iv",
- "__glXDispSwap_RasterPos2sv",
- "__glXDispSwap_RasterPos3dv",
- "__glXDispSwap_RasterPos3fv",
- "__glXDispSwap_RasterPos3iv",
- "__glXDispSwap_RasterPos3sv",
- "__glXDispSwap_RasterPos4dv",
- "__glXDispSwap_RasterPos4fv",
- "__glXDispSwap_RasterPos4iv",
- "__glXDispSwap_RasterPos4sv",
- "__glXDispSwap_ReadBuffer",
- "__glXDispSwap_ReadPixels",
- "__glXDispSwap_Rectdv",
- "__glXDispSwap_Rectfv",
- "__glXDispSwap_Rectiv",
- "__glXDispSwap_Rectsv",
- "__glXDispSwap_RenderMode",
- "__glXDispSwap_ResetHistogram",
- "__glXDispSwap_ResetMinmax",
- "__glXDispSwap_Rotated",
- "__glXDispSwap_Rotatef",
- "__glXDispSwap_Scaled",
- "__glXDispSwap_Scalef",
- "__glXDispSwap_Scissor",
- "__glXDispSwap_SelectBuffer",
- "__glXDispSwap_SeparableFilter2D",
- "__glXDispSwap_ShadeModel",
- "__glXDispSwap_StencilFunc",
- "__glXDispSwap_StencilMask",
- "__glXDispSwap_StencilOp",
- "__glXDispSwap_TexCoord1dv",
- "__glXDispSwap_TexCoord1fv",
- "__glXDispSwap_TexCoord1iv",
- "__glXDispSwap_TexCoord1sv",
- "__glXDispSwap_TexCoord2dv",
- "__glXDispSwap_TexCoord2fv",
- "__glXDispSwap_TexCoord2iv",
- "__glXDispSwap_TexCoord2sv",
- "__glXDispSwap_TexCoord3dv",
- "__glXDispSwap_TexCoord3fv",
- "__glXDispSwap_TexCoord3iv",
- "__glXDispSwap_TexCoord3sv",
- "__glXDispSwap_TexCoord4dv",
- "__glXDispSwap_TexCoord4fv",
- "__glXDispSwap_TexCoord4iv",
- "__glXDispSwap_TexCoord4sv",
- "__glXDispSwap_TexEnvf",
- "__glXDispSwap_TexEnvfv",
- "__glXDispSwap_TexEnvi",
- "__glXDispSwap_TexEnviv",
- "__glXDispSwap_TexGend",
- "__glXDispSwap_TexGendv",
- "__glXDispSwap_TexGenf",
- "__glXDispSwap_TexGenfv",
- "__glXDispSwap_TexGeni",
- "__glXDispSwap_TexGeniv",
- "__glXDispSwap_TexImage1D",
- "__glXDispSwap_TexImage2D",
- "__glXDispSwap_TexImage3D",
- "__glXDispSwap_TexParameterf",
- "__glXDispSwap_TexParameterfv",
- "__glXDispSwap_TexParameteri",
- "__glXDispSwap_TexParameteriv",
- "__glXDispSwap_TexSubImage1D",
- "__glXDispSwap_TexSubImage2D",
- "__glXDispSwap_TexSubImage3D",
- "__glXDispSwap_Translated",
- "__glXDispSwap_Translatef",
- "__glXDispSwap_Vertex2dv",
- "__glXDispSwap_Vertex2fv",
- "__glXDispSwap_Vertex2iv",
- "__glXDispSwap_Vertex2sv",
- "__glXDispSwap_Vertex3dv",
- "__glXDispSwap_Vertex3fv",
- "__glXDispSwap_Vertex3iv",
- "__glXDispSwap_Vertex3sv",
- "__glXDispSwap_Vertex4dv",
- "__glXDispSwap_Vertex4fv",
- "__glXDispSwap_Vertex4iv",
- "__glXDispSwap_Vertex4sv",
- "__glXDispSwap_Viewport",
- "__glXDispSwap_WindowPos3fARB",
- "__glXDisp_Accum",
- "__glXDisp_ActiveStencilFaceEXT",
- "__glXDisp_ActiveTextureARB",
- "__glXDisp_AlphaFunc",
- "__glXDisp_AreTexturesResident",
- "__glXDisp_AreTexturesResidentEXT",
- "__glXDisp_Begin",
- "__glXDisp_BindTexture",
- "__glXDisp_Bitmap",
- "__glXDisp_BlendColor",
- "__glXDisp_BlendEquation",
- "__glXDisp_BlendFunc",
- "__glXDisp_CallList",
- "__glXDisp_CallLists",
- "__glXDisp_Clear",
- "__glXDisp_ClearAccum",
- "__glXDisp_ClearColor",
- "__glXDisp_ClearDepth",
- "__glXDisp_ClearIndex",
- "__glXDisp_ClearStencil",
- "__glXDisp_ClipPlane",
- "__glXDisp_Color3bv",
- "__glXDisp_Color3dv",
- "__glXDisp_Color3fv",
- "__glXDisp_Color3iv",
- "__glXDisp_Color3sv",
- "__glXDisp_Color3ubv",
- "__glXDisp_Color3uiv",
- "__glXDisp_Color3usv",
- "__glXDisp_Color4bv",
- "__glXDisp_Color4dv",
- "__glXDisp_Color4fv",
- "__glXDisp_Color4iv",
- "__glXDisp_Color4sv",
- "__glXDisp_Color4ubv",
- "__glXDisp_Color4uiv",
- "__glXDisp_Color4usv",
- "__glXDisp_ColorMask",
- "__glXDisp_ColorMaterial",
- "__glXDisp_ColorSubTable",
- "__glXDisp_ColorTable",
- "__glXDisp_ColorTableParameterfv",
- "__glXDisp_ColorTableParameteriv",
- "__glXDisp_ConvolutionFilter1D",
- "__glXDisp_ConvolutionFilter2D",
- "__glXDisp_ConvolutionParameterf",
- "__glXDisp_ConvolutionParameterfv",
- "__glXDisp_ConvolutionParameteri",
- "__glXDisp_ConvolutionParameteriv",
- "__glXDisp_CopyColorSubTable",
- "__glXDisp_CopyColorTable",
- "__glXDisp_CopyConvolutionFilter1D",
- "__glXDisp_CopyConvolutionFilter2D",
- "__glXDisp_CopyPixels",
- "__glXDisp_CopyTexImage1D",
- "__glXDisp_CopyTexImage2D",
- "__glXDisp_CopyTexSubImage1D",
- "__glXDisp_CopyTexSubImage2D",
- "__glXDisp_CopyTexSubImage3D",
- "__glXDisp_CullFace",
- "__glXDisp_DeleteLists",
- "__glXDisp_DeleteTextures",
- "__glXDisp_DeleteTexturesEXT",
- "__glXDisp_DepthFunc",
- "__glXDisp_DepthMask",
- "__glXDisp_DepthRange",
- "__glXDisp_Disable",
- "__glXDisp_DrawArrays",
- "__glXDisp_DrawArraysEXT",
- "__glXDisp_DrawBuffer",
- "__glXDisp_DrawPixels",
- "__glXDisp_EdgeFlagv",
- "__glXDisp_Enable",
- "__glXDisp_End",
- "__glXDisp_EndList",
- "__glXDisp_EvalCoord1dv",
- "__glXDisp_EvalCoord1fv",
- "__glXDisp_EvalCoord2dv",
- "__glXDisp_EvalCoord2fv",
- "__glXDisp_EvalMesh1",
- "__glXDisp_EvalMesh2",
- "__glXDisp_EvalPoint1",
- "__glXDisp_EvalPoint2",
- "__glXDisp_FeedbackBuffer",
- "__glXDisp_Finish",
- "__glXDisp_Flush",
- "__glXDisp_Fogf",
- "__glXDisp_Fogfv",
- "__glXDisp_Fogi",
- "__glXDisp_Fogiv",
- "__glXDisp_FrontFace",
- "__glXDisp_Frustum",
- "__glXDisp_GenLists",
- "__glXDisp_GenTextures",
- "__glXDisp_GenTexturesEXT",
- "__glXDisp_GetBooleanv",
- "__glXDisp_GetClipPlane",
- "__glXDisp_GetColorTable",
- "__glXDisp_GetColorTableParameterfv",
- "__glXDisp_GetColorTableParameteriv",
- "__glXDisp_GetConvolutionFilter",
- "__glXDisp_GetConvolutionParameterfv",
- "__glXDisp_GetConvolutionParameteriv",
- "__glXDisp_GetDoublev",
- "__glXDisp_GetError",
- "__glXDisp_GetFloatv",
- "__glXDisp_GetHistogram",
- "__glXDisp_GetHistogramParameterfv",
- "__glXDisp_GetHistogramParameteriv",
- "__glXDisp_GetIntegerv",
- "__glXDisp_GetLightfv",
- "__glXDisp_GetLightiv",
- "__glXDisp_GetMapdv",
- "__glXDisp_GetMapfv",
- "__glXDisp_GetMapiv",
- "__glXDisp_GetMaterialfv",
- "__glXDisp_GetMaterialiv",
- "__glXDisp_GetMinmax",
- "__glXDisp_GetMinmaxParameterfv",
- "__glXDisp_GetMinmaxParameteriv",
- "__glXDisp_GetPixelMapfv",
- "__glXDisp_GetPixelMapuiv",
- "__glXDisp_GetPixelMapusv",
- "__glXDisp_GetPolygonStipple",
- "__glXDisp_GetSeparableFilter",
- "__glXDisp_GetString",
- "__glXDisp_GetTexEnvfv",
- "__glXDisp_GetTexEnviv",
- "__glXDisp_GetTexGendv",
- "__glXDisp_GetTexGenfv",
- "__glXDisp_GetTexGeniv",
- "__glXDisp_GetTexImage",
- "__glXDisp_GetTexLevelParameterfv",
- "__glXDisp_GetTexLevelParameteriv",
- "__glXDisp_GetTexParameterfv",
- "__glXDisp_GetTexParameteriv",
- "__glXDisp_Hint",
- "__glXDisp_Histogram",
- "__glXDisp_IndexMask",
- "__glXDisp_Indexdv",
- "__glXDisp_Indexfv",
- "__glXDisp_Indexiv",
- "__glXDisp_Indexsv",
- "__glXDisp_Indexubv",
- "__glXDisp_InitNames",
- "__glXDisp_IsEnabled",
- "__glXDisp_IsList",
- "__glXDisp_IsTexture",
- "__glXDisp_IsTextureEXT",
- "__glXDisp_LightModelf",
- "__glXDisp_LightModelfv",
- "__glXDisp_LightModeli",
- "__glXDisp_LightModeliv",
- "__glXDisp_Lightf",
- "__glXDisp_Lightfv",
- "__glXDisp_Lighti",
- "__glXDisp_Lightiv",
- "__glXDisp_LineStipple",
- "__glXDisp_LineWidth",
- "__glXDisp_ListBase",
- "__glXDisp_LoadIdentity",
- "__glXDisp_LoadMatrixd",
- "__glXDisp_LoadMatrixf",
- "__glXDisp_LoadName",
- "__glXDisp_LogicOp",
- "__glXDisp_Map1d",
- "__glXDisp_Map1f",
- "__glXDisp_Map2d",
- "__glXDisp_Map2f",
- "__glXDisp_MapGrid1d",
- "__glXDisp_MapGrid1f",
- "__glXDisp_MapGrid2d",
- "__glXDisp_MapGrid2f",
- "__glXDisp_Materialf",
- "__glXDisp_Materialfv",
- "__glXDisp_Materiali",
- "__glXDisp_Materialiv",
- "__glXDisp_MatrixMode",
- "__glXDisp_Minmax",
- "__glXDisp_MultMatrixd",
- "__glXDisp_MultMatrixf",
- "__glXDisp_MultiTexCoord1dvARB",
- "__glXDisp_MultiTexCoord1fvARB",
- "__glXDisp_MultiTexCoord1ivARB",
- "__glXDisp_MultiTexCoord1svARB",
- "__glXDisp_MultiTexCoord2dvARB",
- "__glXDisp_MultiTexCoord2fvARB",
- "__glXDisp_MultiTexCoord2ivARB",
- "__glXDisp_MultiTexCoord2svARB",
- "__glXDisp_MultiTexCoord3dvARB",
- "__glXDisp_MultiTexCoord3fvARB",
- "__glXDisp_MultiTexCoord3ivARB",
- "__glXDisp_MultiTexCoord3svARB",
- "__glXDisp_MultiTexCoord4dvARB",
- "__glXDisp_MultiTexCoord4fvARB",
- "__glXDisp_MultiTexCoord4ivARB",
- "__glXDisp_MultiTexCoord4svARB",
- "__glXDisp_NewList",
- "__glXDisp_Normal3bv",
- "__glXDisp_Normal3dv",
- "__glXDisp_Normal3fv",
- "__glXDisp_Normal3iv",
- "__glXDisp_Normal3sv",
- "__glXDisp_Ortho",
- "__glXDisp_PassThrough",
- "__glXDisp_PixelMapfv",
- "__glXDisp_PixelMapuiv",
- "__glXDisp_PixelMapusv",
- "__glXDisp_PixelStoref",
- "__glXDisp_PixelStorei",
- "__glXDisp_PixelTransferf",
- "__glXDisp_PixelTransferi",
- "__glXDisp_PixelZoom",
- "__glXDisp_PointParameterfARB",
- "__glXDisp_PointParameterfvARB",
- "__glXDisp_PointSize",
- "__glXDisp_PolygonMode",
- "__glXDisp_PolygonOffset",
- "__glXDisp_PolygonStipple",
- "__glXDisp_PopAttrib",
- "__glXDisp_PopMatrix",
- "__glXDisp_PopName",
- "__glXDisp_PrioritizeTextures",
- "__glXDisp_PushAttrib",
- "__glXDisp_PushMatrix",
- "__glXDisp_PushName",
- "__glXDisp_RasterPos2dv",
- "__glXDisp_RasterPos2fv",
- "__glXDisp_RasterPos2iv",
- "__glXDisp_RasterPos2sv",
- "__glXDisp_RasterPos3dv",
- "__glXDisp_RasterPos3fv",
- "__glXDisp_RasterPos3iv",
- "__glXDisp_RasterPos3sv",
- "__glXDisp_RasterPos4dv",
- "__glXDisp_RasterPos4fv",
- "__glXDisp_RasterPos4iv",
- "__glXDisp_RasterPos4sv",
- "__glXDisp_ReadBuffer",
- "__glXDisp_ReadPixels",
- "__glXDisp_Rectdv",
- "__glXDisp_Rectfv",
- "__glXDisp_Rectiv",
- "__glXDisp_Rectsv",
- "__glXDisp_RenderMode",
- "__glXDisp_ResetHistogram",
- "__glXDisp_ResetMinmax",
- "__glXDisp_Rotated",
- "__glXDisp_Rotatef",
- "__glXDisp_Scaled",
- "__glXDisp_Scalef",
- "__glXDisp_Scissor",
- "__glXDisp_SelectBuffer",
- "__glXDisp_SeparableFilter2D",
- "__glXDisp_ShadeModel",
- "__glXDisp_StencilFunc",
- "__glXDisp_StencilMask",
- "__glXDisp_StencilOp",
- "__glXDisp_TexCoord1dv",
- "__glXDisp_TexCoord1fv",
- "__glXDisp_TexCoord1iv",
- "__glXDisp_TexCoord1sv",
- "__glXDisp_TexCoord2dv",
- "__glXDisp_TexCoord2fv",
- "__glXDisp_TexCoord2iv",
- "__glXDisp_TexCoord2sv",
- "__glXDisp_TexCoord3dv",
- "__glXDisp_TexCoord3fv",
- "__glXDisp_TexCoord3iv",
- "__glXDisp_TexCoord3sv",
- "__glXDisp_TexCoord4dv",
- "__glXDisp_TexCoord4fv",
- "__glXDisp_TexCoord4iv",
- "__glXDisp_TexCoord4sv",
- "__glXDisp_TexEnvf",
- "__glXDisp_TexEnvfv",
- "__glXDisp_TexEnvi",
- "__glXDisp_TexEnviv",
- "__glXDisp_TexGend",
- "__glXDisp_TexGendv",
- "__glXDisp_TexGenf",
- "__glXDisp_TexGenfv",
- "__glXDisp_TexGeni",
- "__glXDisp_TexGeniv",
- "__glXDisp_TexImage1D",
- "__glXDisp_TexImage2D",
- "__glXDisp_TexImage3D",
- "__glXDisp_TexParameterf",
- "__glXDisp_TexParameterfv",
- "__glXDisp_TexParameteri",
- "__glXDisp_TexParameteriv",
- "__glXDisp_TexSubImage1D",
- "__glXDisp_TexSubImage2D",
- "__glXDisp_TexSubImage3D",
- "__glXDisp_Translated",
- "__glXDisp_Translatef",
- "__glXDisp_Vertex2dv",
- "__glXDisp_Vertex2fv",
- "__glXDisp_Vertex2iv",
- "__glXDisp_Vertex2sv",
- "__glXDisp_Vertex3dv",
- "__glXDisp_Vertex3fv",
- "__glXDisp_Vertex3iv",
- "__glXDisp_Vertex3sv",
- "__glXDisp_Vertex4dv",
- "__glXDisp_Vertex4fv",
- "__glXDisp_Vertex4iv",
- "__glXDisp_Vertex4sv",
- "__glXDisp_Viewport",
- "__glXDisp_WindowPos3fARB",
- "__glXDrawArraysSize",
- "__glXDrawPixelsReqSize",
- "__glXDrawableRes",
- "__glXErrorOccured",
- "__glXFBInitDrawable",
- "__glXFBMemSwapBuffers",
- "__glXFindDrawablePrivate",
- "__glXFogfvReqSize",
- "__glXFogivReqSize",
- "__glXForceCurrent",
- "__glXFormatGLModes",
- "__glXFree",
- "__glXFreeBuffers",
- "__glXFreeContext",
- "__glXGetDrawablePrivate",
- "__glXGetVisualConfigs",
- "__glXImageSize",
- "__glXImpAtoi",
- "__glXImpCalloc",
- "__glXImpFatal",
- "__glXImpFclose",
- "__glXImpFopen",
- "__glXImpFprintf",
- "__glXImpFree",
- "__glXImpGetDrawablePrivate",
- "__glXImpGetenv",
- "__glXImpMalloc",
- "__glXImpRealloc",
- "__glXImpSprintf",
- "__glXImpWarning",
- "__glXInitFB",
- "__glXInitMem",
- "__glXInitPix",
- "__glXIsDirect",
- "__glXLastContext",
- "__glXLightModelfvReqSize",
- "__glXLightModelivReqSize",
- "__glXLightfvReqSize",
- "__glXLightivReqSize",
- "__glXLookupContextByTag",
- "__glXMakeCurrent",
- "__glXMalloc",
- "__glXMap1dReqSize",
- "__glXMap1fReqSize",
- "__glXMap2dReqSize",
- "__glXMap2fReqSize",
- "__glXMaterialfvReqSize",
- "__glXMaterialivReqSize",
- "__glXNoSuchRenderOpcode",
- "__glXNoSuchSingleOpcode",
- "__glXNop",
- "__glXPixInitDrawable",
- "__glXPixelMapfvReqSize",
- "__glXPixelMapuivReqSize",
- "__glXPixelMapusvReqSize",
- "__glXPixmapRes",
- "__glXPrioritizeTexturesReqSize",
- "__glXQueryContextInfoEXT",
- "__glXQueryExtensionsString",
- "__glXQueryServerString",
- "__glXQueryVersion",
- "__glXRealloc",
- "__glXRender",
- "__glXRenderLarge",
- "__glXRenderSizeTable",
- "__glXRenderSizeTable_EXT",
- "__glXRenderTable",
- "__glXRenderTable_EXT",
- "__glXReply",
- "__glXResetLargeCommandStatus",
- "__glXResizeBuffers",
- "__glXResizeDrawableBuffers",
- "__glXScreenInit",
- "__glXScreenReset",
- "__glXSeparableFilter2DReqSize",
- "__glXSingleTable",
- "__glXSwapBuffers",
- "__glXSwapClientInfo",
- "__glXSwapCopyContext",
- "__glXSwapCreateContext",
- "__glXSwapCreateGLXPixmap",
- "__glXSwapDestroyContext",
- "__glXSwapDestroyGLXPixmap",
- "__glXSwapGetVisualConfigs",
- "__glXSwapIsDirect",
- "__glXSwapIsDirectReply",
- "__glXSwapMakeCurrent",
- "__glXSwapMakeCurrentReply",
- "__glXSwapQueryContextInfoEXTReply",
- "__glXSwapQueryExtensionsString",
- "__glXSwapQueryServerString",
- "__glXSwapQueryVersion",
- "__glXSwapQueryVersionReply",
- "__glXSwapRender",
- "__glXSwapRenderLarge",
- "__glXSwapRenderTable",
- "__glXSwapRenderTable_EXT",
- "__glXSwapSingleTable",
- "__glXSwapSwapBuffers",
- "__glXSwapUseXFont",
- "__glXSwapVendorPrivTable_EXT",
- "__glXSwapVendorPrivate",
- "__glXSwapVendorPrivateWithReply",
- "__glXSwapWaitGL",
- "__glXSwapWaitX",
- "__glXTexEnvfvReqSize",
- "__glXTexEnvivReqSize",
- "__glXTexGendvReqSize",
- "__glXTexGenfvReqSize",
- "__glXTexGenivReqSize",
- "__glXTexImage1DReqSize",
- "__glXTexImage2DReqSize",
- "__glXTexImage3DReqSize",
- "__glXTexParameterfvReqSize",
- "__glXTexParameterivReqSize",
- "__glXTexSubImage1DReqSize",
- "__glXTexSubImage2DReqSize",
- "__glXTexSubImage3DReqSize",
- "__glXTypeSize",
- "__glXUnrefDrawablePrivate",
- "__glXUnsupportedPrivateRequest",
- "__glXUseXFont",
- "__glXVendorPrivTable_EXT",
- "__glXVendorPrivate",
- "__glXVendorPrivateWithReply",
- "__glXWaitGL",
- "__glXWaitX",
- "__glXcombine_strings",
- "glAccum",
- "glActiveStencilFaceEXT",
- "glActiveTextureARB",
- "glAlphaFunc",
- "glAreTexturesResident",
- "glAreTexturesResidentEXT",
- "glBegin",
- "glBindTexture",
- "glBitmap",
- "glBlendColor",
- "glBlendEquation",
- "glBlendFunc",
- "glCallList",
- "glCallLists",
- "glClear",
- "glClearAccum",
- "glClearColor",
- "glClearDepth",
- "glClearIndex",
- "glClearStencil",
- "glClipPlane",
- "glColor3bv",
- "glColor3dv",
- "glColor3fv",
- "glColor3iv",
- "glColor3sv",
- "glColor3ubv",
- "glColor3uiv",
- "glColor3usv",
- "glColor4bv",
- "glColor4dv",
- "glColor4fv",
- "glColor4iv",
- "glColor4sv",
- "glColor4ubv",
- "glColor4uiv",
- "glColor4usv",
- "glColorMask",
- "glColorMaterial",
- "glColorPointer",
- "glColorSubTable",
- "glColorTable",
- "glColorTableParameterfv",
- "glColorTableParameteriv",
- "glConvolutionFilter1D",
- "glConvolutionFilter2D",
- "glConvolutionParameterf",
- "glConvolutionParameterfv",
- "glConvolutionParameteri",
- "glConvolutionParameteriv",
- "glCopyColorSubTable",
- "glCopyColorTable",
- "glCopyConvolutionFilter1D",
- "glCopyConvolutionFilter2D",
- "glCopyPixels",
- "glCopyTexImage1D",
- "glCopyTexImage2D",
- "glCopyTexSubImage1D",
- "glCopyTexSubImage2D",
- "glCopyTexSubImage3D",
- "glCullFace",
- "glDeleteLists",
- "glDeleteTextures",
- "glDeleteTexturesEXT",
- "glDepthFunc",
- "glDepthMask",
- "glDepthRange",
- "glDisable",
- "glDisableClientState",
- "glDrawArrays",
- "glDrawBuffer",
- "glDrawPixels",
- "glEdgeFlagPointer",
- "glEdgeFlagv",
- "glEnable",
- "glEnableClientState",
- "glEnd",
- "glEndList",
- "glEvalCoord1dv",
- "glEvalCoord1fv",
- "glEvalCoord2dv",
- "glEvalCoord2fv",
- "glEvalMesh1",
- "glEvalMesh2",
- "glEvalPoint1",
- "glEvalPoint2",
- "glFeedbackBuffer",
- "glFinish",
- "glFlush",
- "glFogf",
- "glFogfv",
- "glFogi",
- "glFogiv",
- "glFrontFace",
- "glFrustum",
- "glGenLists",
- "glGenTextures",
- "glGenTexturesEXT",
- "glGetBooleanv",
- "glGetClipPlane",
- "glGetColorTable",
- "glGetColorTableParameterfv",
- "glGetColorTableParameteriv",
- "glGetConvolutionFilter",
- "glGetConvolutionParameterfv",
- "glGetConvolutionParameteriv",
- "glGetDoublev",
- "glGetError",
- "glGetFloatv",
- "glGetHistogram",
- "glGetHistogramParameterfv",
- "glGetHistogramParameteriv",
- "glGetIntegerv",
- "glGetLightfv",
- "glGetLightiv",
- "glGetMapdv",
- "glGetMapfv",
- "glGetMapiv",
- "glGetMaterialfv",
- "glGetMaterialiv",
- "glGetMinmax",
- "glGetMinmaxParameterfv",
- "glGetMinmaxParameteriv",
- "glGetPixelMapfv",
- "glGetPixelMapuiv",
- "glGetPixelMapusv",
- "glGetPolygonStipple",
- "glGetSeparableFilter",
- "glGetString",
- "glGetTexEnvfv",
- "glGetTexEnviv",
- "glGetTexGendv",
- "glGetTexGenfv",
- "glGetTexGeniv",
- "glGetTexImage",
- "glGetTexLevelParameterfv",
- "glGetTexLevelParameteriv",
- "glGetTexParameterfv",
- "glGetTexParameteriv",
- "glHint",
- "glHistogram",
- "glIndexMask",
- "glIndexPointer",
- "glIndexdv",
- "glIndexfv",
- "glIndexiv",
- "glIndexsv",
- "glIndexubv",
- "glInitNames",
- "glIsEnabled",
- "glIsList",
- "glIsTexture",
- "glIsTextureEXT",
- "glLightModelf",
- "glLightModelfv",
- "glLightModeli",
- "glLightModeliv",
- "glLightf",
- "glLightfv",
- "glLighti",
- "glLightiv",
- "glLineStipple",
- "glLineWidth",
- "glListBase",
- "glLoadIdentity",
- "glLoadMatrixd",
- "glLoadMatrixf",
- "glLoadName",
- "glLogicOp",
- "glMap1d",
- "glMap1f",
- "glMap2d",
- "glMap2f",
- "glMapGrid1d",
- "glMapGrid1f",
- "glMapGrid2d",
- "glMapGrid2f",
- "glMaterialf",
- "glMaterialfv",
- "glMateriali",
- "glMaterialiv",
- "glMatrixMode",
- "glMinmax",
- "glMultMatrixd",
- "glMultMatrixf",
- "glMultiTexCoord1dvARB",
- "glMultiTexCoord1fvARB",
- "glMultiTexCoord1ivARB",
- "glMultiTexCoord1svARB",
- "glMultiTexCoord2dvARB",
- "glMultiTexCoord2fvARB",
- "glMultiTexCoord2ivARB",
- "glMultiTexCoord2svARB",
- "glMultiTexCoord3dvARB",
- "glMultiTexCoord3fvARB",
- "glMultiTexCoord3ivARB",
- "glMultiTexCoord3svARB",
- "glMultiTexCoord4dvARB",
- "glMultiTexCoord4fvARB",
- "glMultiTexCoord4ivARB",
- "glMultiTexCoord4svARB",
- "glNewList",
- "glNormal3bv",
- "glNormal3dv",
- "glNormal3fv",
- "glNormal3iv",
- "glNormal3sv",
- "glNormalPointer",
- "glOrtho",
- "glPassThrough",
- "glPixelMapfv",
- "glPixelMapuiv",
- "glPixelMapusv",
- "glPixelStoref",
- "glPixelStorei",
- "glPixelTransferf",
- "glPixelTransferi",
- "glPixelZoom",
- "glPointParameterfARB",
- "glPointParameterfvARB",
- "glPointSize",
- "glPolygonMode",
- "glPolygonOffset",
- "glPolygonStipple",
- "glPopAttrib",
- "glPopMatrix",
- "glPopName",
- "glPrioritizeTextures",
- "glPushAttrib",
- "glPushMatrix",
- "glPushName",
- "glRasterPos2dv",
- "glRasterPos2fv",
- "glRasterPos2iv",
- "glRasterPos2sv",
- "glRasterPos3dv",
- "glRasterPos3fv",
- "glRasterPos3iv",
- "glRasterPos3sv",
- "glRasterPos4dv",
- "glRasterPos4fv",
- "glRasterPos4iv",
- "glRasterPos4sv",
- "glReadBuffer",
- "glReadPixels",
- "glRectdv",
- "glRectfv",
- "glRectiv",
- "glRectsv",
- "glRenderMode",
- "glResetHistogram",
- "glResetMinmax",
- "glRotated",
- "glRotatef",
- "glScaled",
- "glScalef",
- "glScissor",
- "glSelectBuffer",
- "glSeparableFilter2D",
- "glShadeModel",
- "glStencilFunc",
- "glStencilMask",
- "glStencilOp",
- "glTexCoord1dv",
- "glTexCoord1fv",
- "glTexCoord1iv",
- "glTexCoord1sv",
- "glTexCoord2dv",
- "glTexCoord2fv",
- "glTexCoord2iv",
- "glTexCoord2sv",
- "glTexCoord3dv",
- "glTexCoord3fv",
- "glTexCoord3iv",
- "glTexCoord3sv",
- "glTexCoord4dv",
- "glTexCoord4fv",
- "glTexCoord4iv",
- "glTexCoord4sv",
- "glTexCoordPointer",
- "glTexEnvf",
- "glTexEnvfv",
- "glTexEnvi",
- "glTexEnviv",
- "glTexGend",
- "glTexGendv",
- "glTexGenf",
- "glTexGenfv",
- "glTexGeni",
- "glTexGeniv",
- "glTexImage1D",
- "glTexImage2D",
- "glTexImage3D",
- "glTexParameterf",
- "glTexParameterfv",
- "glTexParameteri",
- "glTexParameteriv",
- "glTexSubImage1D",
- "glTexSubImage2D",
- "glTexSubImage3D",
- "glTranslated",
- "glTranslatef",
- "glVertex2dv",
- "glVertex2fv",
- "glVertex2iv",
- "glVertex2sv",
- "glVertex3dv",
- "glVertex3fv",
- "glVertex3iv",
- "glVertex3sv",
- "glVertex4dv",
- "glVertex4fv",
- "glVertex4iv",
- "glVertex4sv",
- "glVertexPointer",
- "glViewport",
- "glWindowPos3fARB",
- "glxSwapQueryExtensionsStringReply",
- "glxSwapQueryServerStringReply",
- NULL
-};
-
-static XF86ModuleVersionInfo VersRec =
-{
- "glx",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL };
-
-static pointer
-glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
- pointer GLcore = NULL;
-#ifdef GLX_USE_SGI_SI
- char GLcoreName[] = "GL";
-#else
- char GLcoreName[] = "GLcore";
-#endif
-
- if (!setupDone) {
- setupDone = TRUE;
-
- GLcore = LoadSubModule(module, GLcoreName, NULL, NULL, NULL, NULL,
- errmaj, errmin);
- if (!GLcore) {
- if (errmaj) *errmaj = LDR_NOSUBENT;
- } else {
- LoaderReqSymLists(glcoreSymbols, NULL);
- LoadExtension(&GLXExt, FALSE);
- /* Wrap the init visuals routine in micmap.c */
- GlxWrapInitVisuals(&miInitVisualsProc);
- /* Make sure this gets wrapped each time InitVisualWrap is called */
- miHookInitVisuals(NULL, GlxWrapInitVisuals);
- }
- } else {
- if (errmaj) *errmaj = LDR_ONCEONLY;
- }
- /* Need a non-NULL return value to indicate success */
- return GLcore;
-}
diff --git a/hw/xfree86/dixmods/laymodule.c b/hw/xfree86/dixmods/laymodule.c
deleted file mode 100644
index 60b6bcfa0..000000000
--- a/hw/xfree86/dixmods/laymodule.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/laymodule.c,v 1.1 2002/11/08 22:19:55 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "layer.h"
-
-static XF86ModuleVersionInfo VersRec =
-{
- "layer",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData layerModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/dixmods/mfbmodule.c b/hw/xfree86/dixmods/mfbmodule.c
deleted file mode 100644
index 0617226d0..000000000
--- a/hw/xfree86/dixmods/mfbmodule.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbmodule.c,v 1.7 1999/01/26 05:54:21 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-#include "xf86Module.h"
-
-
-static XF86ModuleVersionInfo VersRec =
-{
- "mfb",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData mfbModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/dixmods/recordmod.c b/hw/xfree86/dixmods/recordmod.c
deleted file mode 100644
index acafc456d..000000000
--- a/hw/xfree86/dixmods/recordmod.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $XFree86: xc/programs/Xserver/record/recordmod.c,v 1.6 2000/01/25 18:37:50 dawes Exp $ */
-
-#include "xf86Module.h"
-
-extern Bool noTestExtensions;
-
-static MODULESETUPPROTO(recordSetup);
-
-extern void RecordExtensionInit(INITARGS);
-
-ExtensionModule recordExt = {
- RecordExtensionInit,
- "RECORD",
- &noTestExtensions,
- NULL,
- NULL
-};
-
-static XF86ModuleVersionInfo VersRec = {
- "record",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 13, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_EXTENSION,
- {0,0,0,0}
-};
-
-XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL };
-
-static pointer
-recordSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- LoadExtension(&recordExt, FALSE);
-
- /* Need a non-NULL return value to indicate success */
- return (pointer)1;
-}
-
diff --git a/hw/xfree86/dixmods/shmodule.c b/hw/xfree86/dixmods/shmodule.c
deleted file mode 100644
index 44aef65ce..000000000
--- a/hw/xfree86/dixmods/shmodule.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shmodule.c,v 1.1 2000/09/03 05:07:24 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-
-static XF86ModuleVersionInfo VersRec =
-{
- "shadow",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData shadowModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c
deleted file mode 100644
index 9c25f4c0b..000000000
--- a/hw/xfree86/dixmods/type1mod.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* $XFree86: xc/lib/font/Type1/module/type1mod.c,v 1.10 2002/12/09 17:29:59 dawes Exp $ */
-
-#include "misc.h"
-
-#include "fontmod.h"
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(type1Setup);
-
- /*
- * This is the module data function that is accessed when loading
- * libtype1 as a module.
- */
-
-static XF86ModuleVersionInfo VersRec =
-{
- "type1",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 2,
- ABI_CLASS_FONT, /* Font module */
- ABI_FONT_VERSION,
- MOD_CLASS_FONT,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL };
-
-extern void Type1RegisterFontFileFunctions(void);
-#ifdef BUILDCID
-extern void CIDRegisterFontFileFunctions(void);
-#endif
-
-FontModule type1Module = {
- Type1RegisterFontFileFunctions,
- "Type1",
- NULL
-};
-
-#ifdef BUILDCID
-FontModule CIDModule = {
- CIDRegisterFontFileFunctions,
- "CID",
- NULL
-};
-#endif
-
-static pointer
-type1Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- type1Module.module = module;
- LoadFont(&type1Module);
-#ifdef BUILDCID
- CIDModule.module = module;
- LoadFont(&CIDModule);
-#endif
-
- /* Need a non-NULL return */
- return (pointer)1;
-}
diff --git a/hw/xfree86/dixmods/xf86XTrapModule.c b/hw/xfree86/dixmods/xf86XTrapModule.c
deleted file mode 100644
index 07283cdb7..000000000
--- a/hw/xfree86/dixmods/xf86XTrapModule.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/XTrap/xf86XTrapModule.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */
-/* This is the xf86 module code for the DEC_XTRAP extension.
- */
-
-#include "xf86Module.h"
-
-#include <X11/extensions/xtrapdi.h>
-
-extern void DEC_XTRAPInit(INITARGS);
-
-#ifdef XFree86LOADER
-
-static MODULESETUPPROTO(xtrapSetup);
-
-ExtensionModule xtrapExt =
-{
- DEC_XTRAPInit,
- XTrapExtName,
- NULL,
- NULL,
- NULL
-};
-
-static XF86ModuleVersionInfo xtrapVersRec =
-{
- "xtrap",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION, /* needs the server extension ABI */
- ABI_EXTENSION_VERSION,
- MOD_CLASS_EXTENSION,
- {0,0,0,0}
-};
-
-XF86ModuleData xtrapModuleData = { &xtrapVersRec, xtrapSetup, NULL };
-
-static pointer
-xtrapSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
- LoadExtension(&xtrapExt, FALSE);
- /* Need a non-NULL return value to indicate success */
- return (pointer)1;
-}
-
-#endif /* XFree86LOADER */
diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI
deleted file mode 100644
index e663f2928..000000000
--- a/hw/xfree86/doc/README.DRI
+++ /dev/null
@@ -1,1257 +0,0 @@
- DRI User Guide
-
- VA Linux Systems, Inc. Professional Services - Graphics.
-
- 15 June 2001
-
-1. Preamble
-
-1.1 Copyright
-
-Copyright © 2000-2001 by VA Linux Systems, Inc. All Rights Reserved.
-
-Permission is granted to make and distribute verbatim copies of this document
-provided the copyright notice and this permission notice are preserved on all
-copies.
-
-1.2 Trademarks
-
-OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics,
-Inc. Unix is a registered trademark of The Open Group. The `X' device and X
-Window System are trademarks of The Open Group. XFree86 is a trademark of
-The XFree86 Project. Linux is a registered trademark of Linus Torvalds.
-Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
-Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
-3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
-active, Incorporated. Matrox is a registered trademark of Matrox Electronic
-Systems Ltd. ATI Rage and Radeon are registered trademarks of ATI Technolo-
-gies, Inc. All other trademarks mentioned are the property of their respec-
-tive owners.
-
-2. Introduction
-
-With XFree86 4.x and the Direct Rendering Interface (DRI), hardware acceler-
-ated 3D graphics can be considered a standard feature on Linux workstations.
-Support for other operating systems, such as FreeBSD, is underway.
-
-This document describes how to use the DRI system and troubleshoot problems
-which may occur. Readers should have a basic understanding of Linux, X and
-OpenGL. See the resources section at the end for more documentation and
-software downloads.
-
-This document does not cover compilation or installation of XFree86 4.x. It
-is assumed that you've already installed a Linux distribution which includes
-XFree86 4.x or that you're an experienced Linux developer who has compiled
-the DRI for himself. DRI download, compilation and installation instructions
-can be found at http://dri.sourceforge.net/DRIcompile.html
-
-Edits, corrections and updates to this document may be mailed to <brian@tung-
-stengrahpics.com>.
-
-3. Supported Architectures & Hardware
-
-3.1 CPU Architectures
-
-The architectures currently supported by the DRI have grown from the initial
-Intel i386 systems to now include the Alpha Processor and the Sun SPARC
-machines.
-
-Intel's SSE (a.k.a. Katmai) instructions are used in optimized vertex trans-
-formation functions in Mesa-based drivers. This requires a recent Linux ker-
-nel both at compile and runtime. See the DRI Compile Guide for compile-time
-requirements. At runtime a check is made to determine if the CPU can execute
-SSE instructions. They're disabled otherwise.
-
-AMD's 3DNow! instructions are also used in optimized vertex transformation
-functions in the Mesa-based DRI drivers. 3DNow! is supported in most ver-
-sions of Linux. Like the SSE optimizations, a runtime check is made to
-determine if the CPU can execute 3DNow! instructions.
-
-Alpha-based systems can use Compaq's optimized math library for improved 3D
-performance. See the DRI Compilation Guide for details.
-
-3.2 Graphics Hardware
-
-XFree86 4.2 (or later versions) includes 3D acceleration for the following
-graphics hardware:
-
- o 3dfx, supported on Intel x86, AMD and Alpha:
-
- o Voodoo5 5500
-
- o Voodoo4 4500
-
- o Voodoo3 3500 TV
-
- o Voodoo3 3000 AGP
-
- o Voodoo3 3000 PCI
-
- o Voodoo3 2000 AGP
-
- o Voodoo3 2000 PCI
-
- o Voodoo Banshee
-
- o Velocity 100/200
-
- There are many configurations of 3dfx cards on the market. Not all have
- been tested.
-
- o Matrox, supported on Intel x86 and AMD:
-
- o Matrox G200
-
- o Matrox G400
-
- o Intel i810/i815/i830 (motherboard chipsets)
-
- o i810
-
- o i810-dc100
-
- o i810e
-
- o i815
-
- o i830
-
- o ATI Rage 128, supported on Intel x86, AMD and Alpha:
-
- o Rage Fury
-
- o Rage Magnum
-
- o XPERT 2000
-
- o XPERT 128
-
- o XPERT 99
-
- o All-in-Wonder 128
-
- o Rage 128 PCI (Alpha-based systems)
-
- Note that both PCI and AGP versions of Rage 128 based cards are sup-
- ported at this time.
-
- o ATI Radeon, supported on Intel x86, AMD and Alpha:
-
- o Radeon SDR AGP
-
- o Radeon DDR AGP
-
- o Radeon 32MB SDR PCI (Alpha-based systems)
-
- o Radeon 7000, M6 (RV100)
-
- o Radeon 7200 (R100)
-
- o Radeon 7500, M7 (RV200)
-
- o Radeon 8500, 9100 (R200)
-
- o Radeon 9000, M9 (RV250)
-
- o 3Dlabs, supported on Intel x86 and AMD:
-
- o Oxygen GMX 2000 (MX/Gamma based). Note: this driver is no longer
- being actively developed.
-
-Support for other hardware is underway. Most of the DRI development work is
-funded by contracts with IHVs. These contracts often prevent us from
-announcing drivers before they're released. Queries about upcoming drivers
-may not be answerable.
-
-4. Prerequisite Software
-
- o The DRI is available in XFree86 4.0 and later.
-
- o Some hardware drivers require specific versions of the Linux kernel for
- AGP support, etc. See section 10 for specifics.
-
- o You DO NOT need to install Mesa separately. The parts of Mesa needed
- for hardware acceleration are already in the XFree86/DRI project.
-
-5. Kernel Modules
-
-3D hardware acceleration requires a DRI kernel module that's specific to your
-graphics hardware.
-
-The DRI kernel module version must exactly match your running kernel version.
-Since there are so many versions of the kernel, it's difficult to provide
-precompiled kernel modules.
-
-While the Linux source tree includes the DRI kernel module sources, the lat-
-est DRI kernel sources will be found in the DRI source tree.
-
-See the DRI Compilation Guide for information on compiling the DRI kernel
-modules.
-
-XFree86 4.0.1 added automatic kernel module loading to the X server. On
-Linux, the X server uses modprobe to load kernel modules. In Linux 2.4.x the
-DRM kernel modules should be kept in /lib/modules/2.4.x/ker-
-nel/drivers/char/drm/ for automatic loading to work.
-
-Optionally, DRM kernel modules can be loaded manually with insmod prior to
-starting the X server.
-
-You can verify that the kernel module was installed with lsmod, checking the
-X server startup log, and checking that /proc/dri/0 exists.
-
-6. XF86Config file
-
-The XFree86 configuration file is usually found in /etc/X11/XF86Config. This
-section describes the parts which must be specially set for the DRI.
-
-First, the XF86Config file must load the GLX and DRI modules:
-
- Section "Module"
- ...
- # This loads the GLX module
- Load "glx"
- # This loads the DRI module
- Load "dri"
- EndSection
-
-Next, the DRI section can be used to restrict access to direct rendering. A
-client can only use direct rendering if it has permission to open the
-/dev/dri/card? file(s). The permissions on these DRI device files is con-
-trolled by the "DRI" section in the XF86Config file.
-
-If you want all of the users on your system to be able to use direct-render-
-ing, then use a simple DRI section like this:
-
- Section "DRI"
- Mode 0666
- EndSection
-
-This section will allow any user with a current connection to the X server to
-use direct rendering.
-
-If you want to restrict the use of direct-rendering to a certain group of
-users, then create a group for those users by editing the /etc/group file on
-your system. For example, you may want to create a group called xf86dri and
-place two users (e.g., fred and jane) in that group. To do that, you might
-add the following line to /etc/group:
-
- xf86dri:x:8000:fred,jane
-
-You have to be careful that the group id (8000 in this example) is unique.
-
-Then you would use the following DRI section:
-
- Section "DRI"
- Group "xf86dri"
- Mode 0660
- EndSection
-
-This would limit access to direct-rendering to those users in the xf86dri
-group (fred and jane in this example). When other users tried to use direct
-rendering, they would fall back to unaccelerated indirect rendering.
-
-[Note that there is a known bug in XFree86 4.0 that prevents some changes to
-the DRI section from taking effect. Until this bug is fixed, if you change
-the DRI section, please also remove the /dev/dri directory with the rm -rf
-/dev/dri command.]
-
-Finally, the XF86Config file needs Device and Screen sections specific to
-your hardware. Look in section 10: Hardware-Specific Information and Trou-
-bleshooting for details.
-
-7. Memory usage
-
-Using the 3D features of a graphics card requires more memory than when it's
-just used as a 2D device. Double buffering, depth buffering, stencil
-buffers, textures, etc. all require extra graphics memory. These features
-may require four times the memory used for a simple 2D display.
-
-If your graphics card doesn't have a lot of memory (less than 16MB, for exam-
-ple), you may have to reduce your screen size and/or color depth in order to
-use 3D features. Reducing the screen resolution will also leave more space
-for texture images, possibly improving 3D performance. If, for example, you
-play Quake3 at 1024x768 but start your display at 1600x1200 you might con-
-sider restarting X at 1024x768 in order to maximize your texture memory
-space.
-
-The documentation included with your card should have information about maxi-
-mum screen size when using 3D.
-
-8. Using 3D Acceleration
-
-This section describes how to link your application with libGL.so and verify
-that you are in fact using 3D acceleration.
-
-8.1 libGL.so
-
-Your OpenGL program must link with the libGL.so.1.2 library provided by
-XFree86. The libGL.so.1.2 library contains a GLX protocol encoder for indi-
-rect/remote rendering and DRI code for accessing hardware drivers. In par-
-ticular, be sure you're not using libGL.so from another source such as Mesa
-or the Utah GLX project.
-
-Unless it was built in a special way, the libGL.so library does not contain
-any 3D hardware driver code. Instead, libGL.so dynamically loads the appro-
-priate 3D driver during initialization.
-
-Most simple OpenGL programs also use the GLUT and GLU libraries. A source
-for these libraries is listed in the Resources section below.
-
-8.2 Compiling and linking an OpenGL program
-
-A simple GLUT/OpenGL program may be compiled and linked as follows:
-
- gcc program.c -I/usr/local/include -L/usr/local/lib -L/usr/X11R6/lib -lglut -lGLU -lGL -o program
-
-The -I option is used to specify where the GL/glut.h (and possibly the
-GL/gl.h and GL/glu.h) header file may be found.
-
-The -L options specify where the libglut.so and the X libraries are located.
-libGL.so and libGLU.so should be in /usr/lib, as specified by the
-Linux/OpenGL ABI standard.
-
-The -lglut -lGLU -lGL arguments specify that the application should link with
-the GLUT, GLU and GL libraries, in that order.
-
-8.3 Running your OpenGL program
-
-Simply typing ./program in your shell should execute the program.
-
-If you get an error message such as
-
- gears: error in loading shared libraries: libGL.so.1: cannot
- open shared object file: No such file or directory
-
-if means that the libGL.so.1 file is not the right location. Proceed to the
-trouble shooting section.
-
-8.4 libOSMesa.so
-
-OSMesa (Off-Screen Mesa) is an interface and driver for rendering 3D images
-into a user-allocated block of memory rather than an on-screen window. It
-was originally developed for Mesa before Mesa became part of the XFree86/DRI
-project. It can now be used with the XFree86/DRI libGL.so as well.
-
-libOSMesa.so implements the OSMesa interface and it must be linked with your
-application if you want to use the OSMesa functions. You must also link with
-libGL.so. For example:
-
- gcc osdemo.c -lOSMesa -lGLU -lGL -o osdemo
-
-In stand-alone Mesa this interface was compiled into the monolithic libGL.so
-(formerly libMesaGL.so) library. In XFree86 4.0.1 and later this interface
-is implemented in a separate library.
-
-8.5 glxinfo
-
-glxinfo is a useful program for checking which version of libGL you're using
-as well as which DRI-based driver. Simply type glxinfo and examine the
-OpenGL vendor, renderer, and version lines. Among the output you should see
-something like this:
-
- OpenGL vendor string: VA Linux Systems, Inc.
- OpenGL renderer string: Mesa DRI Voodoo3 20000224
- OpenGL version string: 1.2 Mesa 3.4
-
-or this:
-
- OpenGL vendor string: VA Linux Systems, Inc.
- OpenGL renderer string: Mesa GLX Indirect
- OpenGL version string: 1.2 Mesa 3.4
-
-The first example indicates that the 3dfx driver is using Voodoo3 hardware.
-The second example indicates that no hardware driver was found and indirect,
-unaccelerated rendering is being used.
-
-If you see that indirect rendering is being used when direct rendering was
-expected, proceed to the troubleshooting section.
-
-glxinfo also lists all of the GLX-enhanced visuals available so you can
-determine which visuals are double-bufferd, have depth (Z) buffers, stencil
-buffers, accumulation buffers, etc.
-
-8.6 Environment Variables
-
-The libGL.so library recognizes three environment variables. Normally, none
-of them need to be defined. If you're using the csh or tcsh shells, type
-setenv VARNAME value to set the variable. Otherwise, if you're using sh or
-bash, type export VARNAME=value.
-
- 1. LIBGL_DEBUG, if defined will cause libGL.so to print error and diagnos-
- tic messages. This can help to solve problems. Setting LIBGL_DEBUG to
- verbose may provide additional information.
-
- 2. LIBGL_ALWAYS_INDIRECT, if defined this will force libGL.so to always
- use indirect rendering instead of hardware acceleration. This can be
- useful to isolate rendering errors.
-
- 3. LIBGL_DRIVERS_PATH can be used to override the default directories
- which are searched for 3D drivers. The value is one or more paths sep-
- arated by colons. In a typical XFree86 installation, the 3D drivers
- should be in /usr/X11R6/lib/modules/dri/ and LIBGL_DRIVERS_PATH need
- not be defined. Note that this feature is disabled for set-uid pro-
- grams. This variable replaces the LIBGL_DRIVERS_DIR env var used in
- XFree86 4.0.
-
- 4. MESA_DEBUG, if defined, will cause Mesa-based 3D drivers to print user
- error messages to stderr. These are errors that you'd otherwise detect
- by calling glGetError.
-
-Mesa-based drivers (this includes most of the drivers listed above) also
-observe many of the existing Mesa environment variables. These include the
-MESA_DEBUG and MESA_INFO variables.
-
-9. General Trouble Shooting
-
-This section contains information to help you diagnose general problems. See
-below for additional information for specific hardware.
-
-9.1 Bus Mastering
-
-DMA-based DRI drivers (that's most DRI drivers) cannot function unless bus
-mastering is enabled for your graphics card. By default, some systems don't
-having bus mastering on. You should enable it in your BIOS.
-
-Alternately, you can check the status of bus mastering and change the setting
-from within Linux. There may be similar procedures for other operating sys-
-tems.
-
-Run lspci (as root) and find the information describing your graphics
-adapter. For example:
-
- 00:00.0 Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 03)
- 00:01.0 PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 03)
- 00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02)
- 00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01)
- 00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01)
- 00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 02)
- 00:11.0 Ethernet controller: Intel Corporation 82557 [Ethernet Pro 100] (rev 08)
- 00:12.0 SCSI storage controller: Symbios Logic Inc. (formerly NCR) 53c895 (rev 02)
- 00:14.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 08)
- 01:00.0 VGA compatible controller: 3Dfx Interactive, Inc.: Unknown device 0009 (rev 01)
-
-The bus, device, and function number comprise the device id, which is conven-
-tionally written in the form bus:dev.func, or in this case 01:00.0.
-
-Use the setpci command to examine bit two of register 4 for your graphics
-card. This will indicate whether or not bus mastering is enabled.
-
- setpci -s 01:00.0 4.w
-
-A hexadecimal value will be printed. Convert the least significant digit to
-binary. For example, if you see 3, that's 0011 in binary (bit two is 0). If
-you see 7, that's 0111 in binary (bit two is 1). In the first example, bus
-mastering is disabled. It's enabled in the second example.
-
-The following shell script will enabled bus mastering for your graphics card
-and host bridge. Run it as root.
-
- #!/bin/bash
- dev=01:00.0 # change as appropriate
- echo Enabling bus mastering on device $dev
- setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
- dev=00:00.0
- echo Enabling bus mastering on host bridge $dev
- setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
-
-You can check if this worked by running the first setpci command again.
-
-9.2 The X Server
-
- 1. Before you start the X server, verify the appropriate 3D kernel module
- is installed. Type lsmod and look for the appropriate kernel module.
- For 3dfx hardware you should see tdfx, for example.
-
- 2. Verify you're running XFree86 4.0 (or newer) and not an older version.
- If you run xdpyinfo and look for the following line near the top:
-
- vendor release number: 4000
-
- 3. Verify that your XF86Config file (usually found at /etc/X11/XF86Config)
- loads the glx and dri modules and has a DRI section.
-
- See the Software Resources section below for sample XF86Config files.
-
- 4. Examine the messages printed during X server startup and check that the
- DRM module loaded. Using the Voodoo3 as an example:
-
- (==) TDFX(0): Write-combining range (0xf0000000,0x2000000)
- (II) TDFX(0): Textures Memory 7.93 MB
- (0): [drm] created "tdfx" driver at busid "PCI:1:0:0"
- (0): [drm] added 4096 byte SAREA at 0xc65dd000
- (0): [drm] mapped SAREA 0xc65dd000 to 0x40013000
- (0): [drm] framebuffer handle = 0xf0000000
- (0): [drm] added 1 reserved context for kernel
- (II) TDFX(0): [drm] Registers = 0xfc000000
- (II) TDFX(0): visual configs initialized
- (II) TDFX(0): Using XFree86 Acceleration Architecture (XAA)
- Screen to screen bit blits
- Solid filled rectangles
- 8x8 mono pattern filled rectangles
- Indirect CPU to Screen color expansion
- Solid Lines
- Dashed Lines
- Offscreen Pixmaps
- Driver provided NonTEGlyphRenderer replacement
- Setting up tile and stipple cache:
- 10 128x128 slots
- (==) TDFX(0): Backing store disabled
- (==) TDFX(0): Silken mouse enabled
- (0): X context handle = 0x00000001
- (0): [drm] installed DRM signal handler
- (0): [DRI] installation complete
- (II) TDFX(0): direct rendering enabled
-
- 5. After the X server has started, verify that the required X server
- extensions are loaded. Run xdpyinfo and look for the following entries
- in the extensions list:
-
- GLX
- SGI-GLX
- XFree86-DRI
-
-9.3 Linking, running and verifying 3D acceleration
-
-After you've verified that the X server and DRI have started correctly it's
-time to verify that the GL library and hardware drivers are working cor-
-rectly.
-
- 1. Verify that you're using the correct libGL.so library with ldd. The
- /usr/lib and /usr/X11R6/lib directories are expected locations for
- libGL.so.
-
- Example:
-
- % ldd /usr/local/bin/glxinfo
- libglut.so.3 => /usr/local/lib/libglut.so.3 (0x40019000)
- libGLU.so.1 => /usr/local/lib/libGLU.so.1 (0x40051000)
- libGL.so.1 => /usr/lib/libGL.so.1 (0x40076000)
- libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x402ee000)
- libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40301000)
- libm.so.6 => /lib/libm.so.6 (0x40309000)
- libc.so.6 => /lib/libc.so.6 (0x40325000)
- libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40419000)
- libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404bd000)
- libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40509000)
- libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40512000)
- libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40529000)
- libvga.so.1 => /usr/lib/libvga.so.1 (0x40537000)
- libpthread.so.0 => /lib/libpthread.so.0 (0x4057d000)
- /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
-
- 2. You may also double check that libGL.so is in fact DRI-capable. Run
- strings libGL.so.1.2 | grep DRI and look for symbols prefixed with
- "XF86DRI", such as "XF86DRIQueryExtension".
-
- 3. To be safe one should run ldconfig after installing libGL.so to be sure
- the runtime loader will find the proper library.
-
- 4. Verify that the appropriate 3D driver is in /usr/X11R6/lib/modules/dri/
- For example, the 3dfx driver will be named tdfx_dri.so.
-
- 5. Set the LIBGL_DEBUG environment variable. This will cause libGL.so to
- print an error message if it fails to load a DRI driver. Any error
- message printed should be self-explanatory.
-
- 6. Run glxinfo. Note the line labeled "OpenGL renderer string". It
- should have a value which starts with "Mesa DRI" followed by the name
- of your hardware.
-
- 7. Older Linux OpenGL applications may have been linked against Mesa's GL
- library and will not automatically use libGL.so. In some cases, making
- symbolic links from the Mesa GL library to libGL.so.1 will solve the
- problem:
-
- ln -s libGL.so.1 libMesaGL.so.3
-
- In other cases, the application will have to be relinked against the
- new XFree86 libGL.so.
-
- It is reported that part of the problem is that running ldconfig will
- silently rewrite symbolic links based on the SONAME field in libraries.
-
-If you're still having trouble, look in the next section for information spe-
-cific to your graphics card.
-
-10. Hardware-Specific Information and Troubleshooting
-
-This section presents hardware-specific information for normal use and trou-
-bleshooting.
-
-10.1 3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
-
-10.1.1 Requirements
-
-The 3dfx DRI driver requires special versions of the 3dfx Glide library.
-Different versions of Glide are needed for Banshee/Voodoo3 than for
-Voodoo4/5. The Glide libraries can be downloaded from the DRI website.
-
-10.1.2 Configuration
-
-Your XF86Config file's device section must specify the tdfx device. For
-example:
-
- Section "Device"
- Identifier "Voodoo3"
- VendorName "3dfx"
- Driver "tdfx"
- EndSection
-
-Or,
-
- Section "Device"
- Identifier "Voodoo5"
- VendorName "3dfx"
- Driver "tdfx"
- EndSection
-
-The Screen section should then reference the Voodoo device:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "Voodoo3"
- Monitor "High Res Monitor"
- DefaultDepth 16
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-Or,
-
- Section "Screen"
- Identifier "Screen 1"
- Device "Voodoo5"
- Monitor "High Res Monitor"
- DefaultDepth 24
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- Subsection "Display"
- Depth 24
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-The kernel module for 3dfx hardware is named tdfx.o and should be installed
-in /lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically
-loaded by the Xserver if needed.
-
-The DRI 3D driver for 3dfx hardware should be in /usr/X11R6/lib/mod-
-ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so.
-
-The Voodoo5 supports 3D rendering in 16 and 32 bpp modes. When running in
-32bpp mode an 8-bit stencil buffer and 24-bit Z (depth) buffer are offered.
-When running in 16bpp mode only a 16-bit Z (depth) buffer is offered and
-stencil is implemented in software.
-
-A software-based accumulation buffer is available in both 16 and 32bpp modes.
-
-10.1.3 Troubleshooting
-
- o If you try to run an OpenGL application and see an error message similar
- to
-
- gd error (glide): gd error (glide): grSstSelect: non-existent SSTgd error (glide): grSstSelect: non-existent SSTS
-
- it means that you have the wrong version of the Glide library for your
- hardware.
-
- o 3D acceleration for Banshee and Voodoo3 is only supported in the 16
- bit/pixel screen mode. Use xdpyinfo to verify that all your visuals are
- depth 16. Edit your XF86Config file if needed.
-
- o The /dev/3dfx device is not used for DRI; it's only for Glide on older
- 3dfx hardware.
-
- o Different versions of Glide are needed for Voodoo3 and Voodoo5. See the
- DRI website's resources page to download the right version of Glide.
-
- o Voodoo4/5 may be run at 24bpp (instead of 32bpp, the default) but 3D
- acceleration is not supported in that mode. 32bpp mode is fully 3D
- accelerated.
-
-10.1.4 Performance and Features
-
- o Normally, buffer swapping in double-buffered applications is synchro-
- nized to your monitor's refresh rate. This may be overridden by setting
- the FX_GLIDE_SWAPINTERVAL environment variable. The value of this vari-
- able indicates the maximum number of swap buffer commands can be
- buffered. Zero allows maximum frame rate.
-
- o On Voodoo4/5, rendering with 16-bits/texel textures is faster than using
- 32-bit per texel textures. The internalFormat parameter to glTexImage2D
- can be used to control texel size. Quake3 and other games let you con-
- trol this as well.
-
- o The glTexEnv mode GL_BLEND is not directly supported by the Voodoo3
- hardware. It can be accomplished with a multipass algorithm but it's
- not implemented at this time. Applications which use that mode, such as
- the Performer Town demo, may become sluggish when falling back to soft-
- ware rendering to render in that mode.
-
- o The Voodoo3/Banshee driver reverts to software rendering under the fol-
- lowing conditions:
-
- o Setting GL_LIGHT_MODEL_COLOR_CONTROL to GL_SEPARATE_SPECULAR_COLOR.
-
- o Enabling line stippling or polygon stippling.
-
- o Enabling point smoothing or polygon smoothing.
-
- o Enabling line smoothing when line width is not 1.0. That is,
- antialiased lines are done in hardware only when the line width is
- 1.0.
-
- o Using 1-D or 3-D texture maps.
-
- o Using the GL_BLEND texture environment.
-
- o Using stencil operations.
-
- o Using the accumulation buffer.
-
- o Using glBlendEquation(GL_LOGIC_OP).
-
- o Using glDrawBuffer(GL_FRONT_AND_BACK).
-
- o Using glPolygonMode(face, GL_POINT) or glPolygonMode(face,
- GL_LINE).
-
- o Using point size attenuation (i.e. GL_DISTANCE_ATTENUATION_EXT).
-
- o Using glColorMask(r, g, b, a) when r!=g or g!=b.
-
- o The Voodoo5 driver reverts to software rendering under the same condi-
- tions Voodoo3 with three exceptions. First, stencil operations are
- implemented in hardware when the screen is configured for 32 bits/pixel.
- Second, the GL_BLEND texture env mode is fully supported in hardware.
- Third, glColorMask is fully supported in hardware when the screen is
- configured for 32 bits/pixel.
-
- o As of January, 2001 the second VSA-100 chip on the Voodoo5 is not yet
- operational. Therefore, the board isn't being used to its full capac-
- ity. The second VSA-100 chip will allow Scan-Line Interleave (SLI) mode
- for full-screen applications and games, potentially doubling the sys-
- tem's fill rate. When the second VSA-100 chip is activated glGet-
- String(GL_RENDERER) will report Voodoo5 instead of Voodoo4.
-
- o The lowest mipmap level is sometimes miscolored in trilinear- sampled
- polygons.
-
- o The GL_EXT_texture_env_combine extension is supported on the Voodoo4 and
- Voodoo5.
-
-10.1.5 Known Problems
-
- o The lowest mipmap level is sometimes miscolored in trilinear- sampled
- polygons (Voodoo3/Banshee).
-
- o Fog doesn't work with orthographic projections.
-
- o The accuracy of blending operations on Voodoo4/5 isn't always very good.
- If you run Glean, you'll find some test failures.
-
- o The Glide library cannot be used directly; it's only meant to be used
- via the tdfx DRI driver.
-
- o SSystem has problems because of poorly set near and far clipping planes.
- The office.unc Performer model also suffers from this problem.
-
-10.2 Intel i810
-
-10.2.1 Requirements
-
-A kernel with AGP GART support (such as Linux 2.4.x) is needed.
-
-10.2.2 Configuration
-
-Your XF86Config file's device section must specify the i810 device, and spec-
-ify a usable amount of video ram to reserve.
-
- Section "Device"
- Identifier "i810"
- VendorName "Intel"
- Driver "i810"
- Option "AGPMode" "1"
- VideoRam 10000
- EndSection
-
-The Screen section should then reference the i810 device:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "i810"
- Monitor "High Res Monitor"
- DefaultDepth 16
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-The kernel module for the i810 is named i810.o and should be installed in
-/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
-by the Xserver if needed.
-
-The DRI 3D driver for the i810 should be in /usr/X11R6/lib/mod-
-ules/dri/i810_dri.so. This will be automatically loaded by libGL.so.
-
-10.2.3 Troubleshooting
-
- o 3D acceleration for the i810 is only available in the 16 bit/pixel
- screen mode at this time. 32bpp acceleration is not supported by this
- hardware. Use xdpyinfo to verify that all your visuals are depth 16.
- Edit your XF86Config file if needed.
-
- o The i810 uses system ram for video and 3d graphics. The X server will
- ordinarily reserve 4mb of ram for graphics, which is too little for an
- effective 3d setup. To tell the driver to use a larger amount, specify
- a VideoRam option in the Device section of your XF86Config file. A num-
- ber between 10000 and 16384 seems adequate for most requirements. If
- too little memory is available for DMA buffers, back and depth buffers
- and textures, direct rendering will be disabled.
-
-10.2.4 Performance and Features
-
-Basically all of the i810 features which can be exposed through OpenGL 1.2
-are implemented. However, the following OpenGL features are implemented in
-software and will be slow:
-
- o Stencil buffer and accumulation buffer operations
-
- o Blend subtract, min/max and logic op blend modes
-
- o glColorMask when any mask is set to false
-
- o GL_SEPARATE_SPECULAR_COLOR lighting mode
-
- o glDrawBuffer(GL_FRONT_AND_BACK)
-
- o Using 1D or 3D textures
-
- o Using texture borders
-
-10.3 Matrox G200 and G400
-
-10.3.1 Requirements
-
-A kernel with AGP GART support (such as Linux 2.4.x) is needed.
-
-10.3.2 Configuration
-
-Your XF86Config file's device section must specify the mga device:
-
- Section "Device"
- Identifier "MGA"
- VendorName "Matrox"
- Driver "mga"
- Option "AGPMode" "1"
- VideoRam 32768
- EndSection
-
-The Screen section should then reference the MGA device:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "MGA"
- Monitor "High Res Monitor"
- DefaultDepth 16
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-To use a 32bpp screen mode, use this Screen section instead:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "MGA"
- Monitor "High Res Monitor"
- DefaultDepth 24
- DefaultFbBpp 32
- Subsection "Display"
- Depth 24
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-The kernel module for the G200/G400 is named mga.o and should be installed in
-/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
-by the Xserver if needed.
-
-The DRI 3D driver for the G200/G400 should be in /usr/X11R6/lib/mod-
-ules/dri/mga_dri.so. This will be automatically loaded by libGL.so.
-
-10.3.3 Performance and Features
-
-Software rendering will be used under any of the following conditions:
-
- o Using glDrawBuffer(GL_FRONT_AND_BACK).
-
- o Using point, line, or triangle smoothing.
-
- o Using glLogicOp.
-
- o Using glPolygonStipple or glLineStipple.
-
- o Using 1D or 3D textures.
-
- o Using texture borders.
-
- o Using glDepthFunc(GL_NEVER).
-
- o Using the accumulation buffer.
-
-The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
-speeds may result in unreliable performance depending on your motherboard.
-
-Compaq has funded the implementation of AGP accelerated ReadPixels and Draw-
-Pixels in this driver. With this implementation, on a G400 drawing directly
-from AGP memory (exported to the client), throughput of up to 1 GB/sec has
-been measured.
-
-Additionally Compaq's funding has produced several new extensions in Mesa,
-including one (packed_depth_stencil_MESA) which enables Read/DrawPixels func-
-tionality to operate directly on the packed 24/8 depth/stencil buffers of
-this hardware.
-
-In order to access this functionality, the application must ensure that all
-pixel processing operations are disabled. There are in addition a fairly
-complex set of rules regarding which packing/unpacking modes must be used,
-and which data formats are supported, and alignment constraints. See the
-files in lib/GL/mesa/src/drv/mga/DOCS for a summary of these. The extension
-definitions are included in the Mesa 3.4 source distribution.
-
-10.3.4 IRQ Assignment
-
-There have been problems in the past with the MGA driver being very sluggish
-when the DRI is enabled (to the point of being unusable.) This is caused by
-the graphics card not having an interrupt assigned to it. The current DRI
-trunk will attempt to detect this condition and bail out gracefully.
-
-The solution to the above problem is to assign an interrupt to your graphics
-card. This is something you must turn on in your system BIOS configuration.
-Please consult your system BIOS manual for instructions on how to enable an
-interrupt for your graphics card.
-
-10.3.5 MGA HAL lib
-
-MGAHALlib.a is a binary library Matrox has provided for use under Linux to
-expose functionality for which they can not provide documentation. (For
-example TV-Out requires MacroVision be enabled on the output.) This binary
-library also sets the pixel/memory clocks to the optimal settings for your
-Matrox card.
-
-Currently the MGAHAL library is required for the G450 to work. You can down-
-load this from the driver section on Matrox's website: www.matrox.com/mga
-
-Here modifications to the DRI build instructions which make the mga ddx
-driver use the MGAHAL library:
-
- 1.Put the following define in your host.def file
- #define UseMatroxHal YES
- 2. Place mgaHALlib.a in the following directory
- xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/
-
-You can use DualHead on the G400/G450 DH cards by creating two device sec-
-tions which both point to the same BusID. For most AGP devices the BusID
-will be "PCI:1:0:0". Configure your screen section as you would normally
-configure XFree86 4.x Multihead. It should be noted that currently the sec-
-ond head does not support direct rendering.
-
-10.3.6 Known Problems
-
-None.
-
-10.4 ATI Rage 128
-
-10.4.1 Requirements
-
-A kernel with AGP GART support (such as Linux 2.4.x) is needed.
-
-10.4.2 Configuration
-
-Your XF86Config file's device section must specify the ati device:
-
- Section "Device"
- Identifier "Rage128"
- VendorName "ATI"
- Driver "ati"
- Option "AGPMode" "1"
- Option "UseCCEFor2D" "false"
- EndSection
-
-The Screen section should then reference the Rage 128 device:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "Rage128"
- Monitor "High Res Monitor"
- DefaultDepth 16
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- Subsection "Display"
- Depth 32
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-The kernel module for the Rage 128 is named r128.o and should be installed in
-/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
-by the Xserver if needed.
-
-The DRI 3D driver for the Rage 128 should be in /usr/X11R6/lib/mod-
-ules/dri/r128_dri.so. This will be automatically loaded by libGL.so.
-
-You may also set your screen depth to 32 for 32bpp mode.
-
-10.4.3 Performance and Features
-
-While PCI Rage 128 based cards are supported, they do not yet support PCI
-GART, so they will not perform as well as their AGP counterparts.
-
-For AGP cards, the AGP mode may be set to 1, 2, or 4. One is used by
-default. Higher AGP speeds may result in unreliable performance depending on
-your motherboard.
-
-Note that even at 32bpp there is no alpha channel.
-
-The following OpenGL features are implemented in software and will be slow:
-
- o accumulation buffer operations
-
- o stencil, when using a 16bpp screen
-
- o Blend subtract, min/max and logic op blend modes
-
- o GL_SEPARATE_SPECULAR_COLOR lighting mode
-
- o glDrawBuffer(GL_FRONT_AND_BACK)
-
- o Using 1D or 3D textures
-
- o Using texture borders
-
-10.4.4 Known Problems
-
-If you experience stability problems you may try setting the UseCCEFor2D
-option to true. This will effectively disable 2D hardware acceleration.
-Performance will be degraded, of course.
-
-10.5 ATI Radeon
-
-10.5.1 Requirements
-
-A kernel with AGP GART support (such as Linux 2.4.x) is needed.
-
-10.5.2 Configuration
-
-Your XF86Config file's device section must specify the ati device:
-
- Section "Device"
- Identifier "Radeon"
- VendorName "ATI"
- Driver "ati"
- Option "AGPMode" "1"
- EndSection
-
-The Screen section should then reference the Radeon device:
-
- Section "Screen"
- Identifier "Screen 1"
- Device "Radeon"
- Monitor "High Res Monitor"
- DefaultDepth 16
- Subsection "Display"
- Depth 16
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- Subsection "Display"
- Depth 32
- Modes "1280x1024" "1024x768" "800x600" "640x480"
- ViewPort 0 0
- EndSubsection
- EndSection
-
-The kernel module for the Radeon is named radeon.o and should be installed in
-/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
-by the Xserver if needed.
-
-The DRI 3D driver for the Radeon should be in /usr/X11R6/lib/mod-
-ules/dri/radeon_dri.so. This will be automatically loaded by libGL.so.
-
-You may also set your screen depth to 32 for 32bpp mode.
-
-10.5.3 Performance and Features
-
-While this driver supports many of the features of ATI Radeon cards, we do
-not yet fully support the card's TCL features. This work is progressing, but
-is not yet ready.
-
-The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
-speeds may result in unreliable performance depending on your motherboard.
-
-The following OpenGL features are implemented in software and will be slow:
-
- o Blend subtract, blend min/max and blend logicops
-
- o Stencil and accumulation operations
-
- o 1D and 3D textures
-
- o Texture borders
-
-The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and GL_EXT_tex-
-ture_env_dot3 extensions are supported (or will be soon supported in the new
-driver based on Mesa 3.5).
-
-We hope to implement support for the following features in the future:
-
- o Vertex transformation, clipping and lighting (TCL)
-
- o Hardware stencil buffer
-
- o Cube map textures
-
- o 3D textures
-
- o Three texture units
-
-10.5.4 Known Problems
-
-Certain (early?) revisions of the AMD Irongate chipset have AGPGART problems
-which effect Radeon, and other graphics cards. The card may work unreliably,
-or not work at all. If the DRM kernel module is not loaded, the 2D Xserver
-may work. There's hope that this can be fixed in the future.
-
-10.6 3DLabs Oxygen GMX 2000
-
-The driver for this hardware was experimental and is no longer being devel-
-oped or supported.
-
-11. General Limitations and Known Bugs
-
-11.1 OpenGL
-
-The following OpenGL features are not supported at this time: overlays,
-stereo, hardware-accelerated indirect rendering.
-
-OpenGL-like functionality is provided with the Mesa library. XFree86 4.1.0
-uses Mesa 3.4.2. Subsequent releases of XFree86 will use newer versions of
-Mesa. When newer versions of Mesa are available, the 3D drivers can be
-updated without reinstalling XFree86 or libGL.so.
-
-11.2 GLX
-
-The GLX 1.3 API is exported but none of the new 1.3 functions are opera-
-tional.
-
-The new glXGetProcAddressARB function is fully supported.
-
-GLXPixmap rendering is only supported for indirect rendering contexts. This
-is a common OpenGL limitation. Attempting to use a direct rendering context
-with a GLXPixmap will result in an X protocol error.
-
-11.3 Debugging
-
-Debugging DRI drivers with gdb can be difficult because of the locking
-involved. When debugging OpenGL applications, you should avoid stepping
-inside the GL functions. If you're trying to debug a DRI driver it's recom-
-mended that you do so remotely, from a second system.
-
-11.4 Scheduling
-
-When you run multiple GL applications at once you may notice poor time slic-
-ing. This is due to an interaction problem with the Linux scheduler which
-will be addressed in the future.
-
-11.5 libGL.so and dlopen()
-
-A number of popular OpenGL applications on Linux (such as Quake3, HereticII,
-Heavy Gear 2, etc) dynamically open the libGL.so library at runtime with
-dlopen(), rather than linking with -lGL at compile/link time.
-
-If dynamic loading of libGL.so is not implemented carefully, there can be a
-number of serious problems. Here are the things to be careful of in your
-application:
-
- o Specify the RTLD_GLOBAL flag to dlopen(). If you don't do this then
- you'll likely see a runtime error message complaining that _glapi_Con-
- text is undefined when libGL.so tries to open a hardware-specific
- driver. Without this flag, nested opening of dynamic libraries does not
- work.
-
- o Do not close the library with dlclose() until after XCloseDisplay() has
- been called. When libGL.so initializes itself it registers several
- callbacks functions with Xlib. When XCloseDisplay() is called those
- callback functions are called. If libGL.so has already been unloaded
- with dlclose() this will cause a segmentation fault.
-
- o Your application should link with -lpthread. On Linux, libGL.so uses
- the pthreads library in order to provide thread safety. There is appar-
- ently a bug in the dlopen()/dlclose() code which causes crashes if the
- library uses pthreads but the parent application doesn't. The only
- known work-around is to link the application with -lpthread.
-
-Some applications don't yet incorporate these procedures and may fail. For
-example, changing the graphics settings in some video games will expose this
-problem. The DRI developers are working with game vendors to prevent this
-problem in the future.
-
-11.6 Bug Database
-
-The DRI bug database which includes bugs related to specific drivers is at
-the SourceForge DRI Bug Database
-
-Please scan both the open and closed bug lists to determine if your problem
-has already been reported and perhaps fixed.
-
-12. Resources
-
-12.1 Software
-
-A collection of useful configuration files, libraries, headers, utilities and
-demo programs is available from http://dri.sourceforge.net/res.phtml
-
-12.2 Documentation
-
- o General OpenGL information is available at the OpenGL Home Page
-
- o XFree86 information is available at the XFree86 Home Page
-
- o Information about the design of the DRI is available from Precision
- Insight, Inc.
-
- o Visit the DRI project on SourceForge.net for the latest development news
- about the DRI and 3D drivers.
-
- o The DRI Compilation Guide explains how to download, compile and install
- the DRI for yourself.
-
-12.3 Support
-
- o The DRI-users mailing list at SourceForge is a forum for people to dis-
- cuss DRI problems.
-
- o In the future there may be IHV and Linux vendor support resources for
- the DRI.
-
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 dawes Exp $
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.22 2003/07/15 02:28:28 dawes Exp $
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
deleted file mode 100644
index 7563c1c56..000000000
--- a/hw/xfree86/doc/README.fonts
+++ /dev/null
@@ -1,1182 +0,0 @@
- Fonts in XFree86
-
- Juliusz Chroboczek, <jch@xfree86.org>
-
- 17 November 2003
-
-1. Introduction
-
-This document describes the support for fonts in XFree86. Installing fonts
-(section 2., page 1) is aimed at the casual user wishing to install fonts in
-XFree86; the rest of the document describes the font support in more detail.
-
-We assume some familiarity with digital fonts. If anything is not clear to
-you, please consult Appendix: Background (section 5., page 1) at the end of
-this document for background information.
-
-1.1 Two font systems
-
-XFree86 includes two font systems: the core X11 fonts system, which is
-present in all implementations of X11, and the Xft fonts system, which is not
-currently distributed with implementations of X11 that are not based on
-XFree86 but will hopefully be included by them in the future
-
-The core X11 fonts system is directly derived from the fonts system included
-with X11R1 in 1987, which could only use monochrome bitmap fonts. Over the
-years, it has been more or less happily coerced into dealing with scalable
-fonts and rotated glyphs.
-
-Xft was designed from the start to provide good support for scalable fonts,
-and do so efficiently. Unlike the core fonts system, it supports features
-such as anti-aliasing and sub-pixel rasterisation. Perhaps more importantly,
-it gives applications full control over the way glyphs are rendered, making
-fine typesetting and WYSIWIG display possible. Finally, it allows applica-
-tions to use fonts that are not installed system-wide for displaying docu-
-ments with embedded fonts.
-
-Xft is not compatible with the core fonts system: usage of Xft requires mak-
-ing fairly extensive changes to toolkits (user-interface libraries). While
-XFree86 will continue to maintain the core fonts system, toolkit authors are
-encouraged to switch to Xft as soon as possible.
-
-2. Installing fonts
-
-This section explains how to configure both Xft and the core fonts system to
-access newly-installed fonts.
-
-2.1 Configuring Xft
-
-Xft has no configuration mechanism itself, rather it relies upon the fontcon-
-fig library to configure and customize fonts. That library is not specific
-to XFree86 or indeed on any particular font output mechanism. This discus-
-sion describes how fontconfig, rather than Xft, works.
-
-2.1.1 Installing fonts in Xft
-
-Fontconfig looks for fonts in a set of well-known directories that include
-all of XFree86's standard font directories (`/usr/X11R6/lib/X11/lib/fonts/*')
-by default) as well as a directory called `.fonts/' in the user's home direc-
-tory. Installing a font for use by Xft applications is as simple as copying
-a font file into one of these directories.
-
- $ cp lucbr.ttf ~/.fonts/
-
-Fontconfig will notice the new font at the next opportunity and rebuild its
-list of fonts. If you want to trigger this update from the command line (for
-example in order to globally update the system-wide Fontconfig information),
-you may run the command `fc-cache'.
-
- $ fc-cache
-
-2.1.2 Fine-tuning Xft
-
-Fontconfig's behaviour is controlled by a set of configuration files: a sys-
-tem-wide configuration file, `/etc/fonts/fonts.conf', and a user-specific
-file called `.fonts.conf' in the user's home directory (this can be overrid-
-den with the `FONTCONFIG_FILE' environment variable).
-
-Every Fontconfig configuration file must start with the following boiler-
-plate:
-
- <?xml version="1.0"?>
- <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
- <fontconfig>
-
-In addition, every Fontconfig configuration file must end with the following
-line:
-
- </fontconfig>
-
-The default Fontconfig configuration file includes the directory `~/.fonts/'
-in the list of directories searched for font files, and this is where user-
-specific font files should be installed. In the unlikely case that a new
-font directory needs to be added, this can be done with the following syntax:
-
- <dir>/usr/local/share/fonts/</dir>
-
-Another useful option is the ability to disable anti-aliasing (font smooth-
-ing) for selected fonts. This can be done with the following syntax:
-
- <match target="font">
- <test qual="any" name="family">
- <string>Lucida Console</string>
- </test>
- <edit name="antialias" mode="assign">
- <bool>false</bool>
- </edit>
- </match>
-
-Anti-aliasing can be disabled for all fonts by the following incantation:
-
- <match target="font">
- <edit name="antialias" mode="assign">
- <bool>false</bool>
- </edit>
- </match>
-
-Xft supports sub-pixel rasterisation on LCD displays. XFree86 should auto-
-matically enable this feature on laptops and when using an LCD monitor con-
-nected with a DVI cable; you can check whether this was done by typing
-
- $ xdpyinfo -ext RENDER | grep sub-pixel
-
-If this doesn't print anything, you will need to configure Render for your
-particular LCD hardware manually; this is done with the following syntax:
-
- <match target="font">
- <edit name="rgba" mode="assign">
- <const>rgb</const>
- </edit>
- </match>
-
-The string `rgb' within the `<const>'...`</const>' specifies the order of
-pixel components on your display, and should be changed to match your hard-
-ware; it can be one of `rgb (normal LCD screen), `bgr' (backwards LCD
-screen), `vrgb' (LCD screen rotated clockwise) or `vbgr' (LCD screen rotated
-counterclockwise).
-
-2.1.3 Configuring applications
-
-Because most current applications use the core fonts system by default, it is
-necessary to explicitly configure them to use Xft. How this is done depends
-on the application.
-
-XTerm can be set to use Xft by using the `-fa' command line option or by set-
-ting the `XTerm*faceName' resource:
-
- XTerm*faceName: Courier
-
-or
-
- $ xterm -fa "Courier"
-
-For applications based on GTK+ 2.0 (including GNOME 2 applications), the
-environment variable `GDK_USE_XFT' should be set to `1':
-
- $ export GDK_USE_XFT=1
-
-GTK+ 2.2 uses Xft by default.
-
-For KDE applications, you should select ``Anti-alias fonts'' in the ``Fonts''
-panel of KDE's ``Control Center''. Note that this option is misnamed: it
-switches KDE to using Xft but doesn't enable anti-aliasing in case it was
-disabled by your Xft configuration file.
-
-(What about Mozilla?)
-
-2.1.4 Troubleshooting
-
-If some Xft-based applications don't seem to notice the changes you are mak-
-ing to your configuration files, they may be linked against the XFree86 4.2
-version of Xft. In order to fix the problem, you should relink them against
-a current version of Xft; on most systems, it is enough to install the cur-
-rent version of the Xft and Fontconfig libraries.
-
-If, for some reason, you cannot upgrade the shared libraries, please check
-the Xft(3) manual page included with XFree86 4.2 for the configuration mecha-
-nisms of the previous version of Xft.
-
-2.2 Configuring the core X11 fonts system
-
-Installing fonts in the core system is a two step process. First, you need
-to create a font directory that contains all the relevant font files as well
-as some index files. You then need to inform the X server of the existence
-of this new directory by including it in the font path.
-
-2.2.1 Installing bitmap fonts
-
-The XFree86 server can use bitmap fonts in both the cross-platform BDF format
-and the somewhat more efficient binary PCF format. (XFree86 also supports
-the obsolete SNF format.)
-
-Bitmap fonts are normally distributed in the BDF format. Before installing
-such fonts, it is desirable (but not absolutely necessary) to convert the
-font files to the PCF format. This is done by using the command `bdftopcf',
-e.g.
-
- $ bdftopcf courier12.bdf
-
-You will then want to compress the resulting PCF font files:
-
- $ gzip courier12.pcf
-
-After the fonts have been converted, you should copy all the font files that
-you wish to make available into a arbitrary directory, say
-`/usr/local/share/fonts/bitmap/'. You should then create the index file
-`fonts.dir' by running the command `mkfontdir' (please see the mkfontdir(1)
-manual page for more information):
-
- $ mkdir /usr/local/share/fonts/bitmap/
- $ cp *.pcf.gz /usr/local/share/fonts/bitmap/
- $ mkfontdir /usr/local/share/fonts/bitmap/
-
-All that remains is to tell the X server about the existence of the new font
-directory; see Setting the server font path (section 2.2.4, page 1) below.
-
-2.2.2 Installing scalable fonts
-
-The XFree86 server supports scalable fonts in four formats: Type 1, Speedo,
-TrueType and CIDFont. This section only applies to the former three; for
-information on CIDFonts, please see Installing CIDFonts (section 2.2.3, page
-1) later in this document.
-
-Installing scalable fonts is very similar to installing bitmap fonts: you
-create a directory with the font files, and run `mkfontdir' to create an
-index file called `fonts.dir'.
-
-There is, however, a big difference: `mkfontdir' cannot automatically recog-
-nise scalable font files. For that reason, you must first index all the font
-files in a file called `fonts.scale'. While this can be done by hand, it is
-best done by using the `mkfontscale' utility.
-
- $ mkfontscale /usr/local/share/fonts/Type1/
- $ mkfontdir /usr/local/share/fonts/Type1/
-
-Under some circumstances, it may be necessary to modify the `fonts.scale'
-file generated by mkfontscale; for more information, please see the mkfont-
-dir(1) and mkfontscale(1) manual pages and Core fonts and internationalisa-
-tion (section 4.1, page 1) later in this document.
-
-2.2.3 Installing CID-keyed fonts
-
-The CID-keyed font format was designed by Adobe Systems for fonts with large
-character sets. A CID-keyed font, or CIDFont for short, contains a collec-
-tion of glyphs indexed by character ID (CID).
-
-In order to map such glyphs to meaningful indices, Adobe provide a set of
-CMap files. The PostScript name of a font generated from a CIDFont consists
-of the name of the CIDFont and the name of the CMap separated by two dashes.
-For example, the font generated from the CIDFont `Munhwa-Regular' using the
-CMap `UniKS-UCS2-H' is called
-
- Munhwa-Regular--UniKS-UCS2-H
-
-The CIDFont code in XFree86 requires a very rigid directory structure. The
-main directory must be called `CID' (its location defaults to
-`/usr/X11R6/lib/X11/fonts/CID' but it may be located anywhere), and it should
-contain a subdirectory for every CID collection. Every subdirectory must
-contain subdirectories called CIDFont (containing the actual CIDFont files),
-CMap (containing all the needed CMaps), AFM (containing the font metric
-files) and CFM (initially empty). For example, in the case of the font
-Munhwa-Regular that uses the CID collection Adobe-Korea1-0, the directory
-structure should be as follows:
-
- CID/Adobe-Korea1/CIDFont/Munhwa-Regular
- CID/Adobe-Korea1/CMap/UniKS-UCS2-H
- CID/Adobe-Korea1/AFM/Munhwa-Regular.afm
- CID/Adobe-Korea1/CFM/
- CID/fonts.dir
- CID/fonts.scale
-
-After creating this directory structure and copying the relevant files, you
-should create a <`tt/fonts.scale/' file. This file has the same format as in
-the case of (non-CID) scalable fonts, except that its first column contains
-PostScript font names with the extension `.cid' appended rather than actual
-filenames:
-
- 1
- Adobe-Korea1/Munhwa-Regular--UniKS-UCS2-H.cid \
- -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-iso10646-1
-
-(both names on the same line). Running `mkfontdir' creates the `fonts.dir'
-file:
-
- $ cd /usr/local/share/fonts/CID
- $ mkfontdir
-
-Finally, you should create the font metrics summary files in the directory
-`CFM' by running the command `mkcfm':
-
- $ mkcfm /usr/local/share/fonts/CID
-
-If no CFM files are available, the server will still be able to use the CID
-fonts but querying them will take a long time. You should run `mkcfm' again
-whenever a change is made to any of the CID-keyed fonts, or when the CID-
-keyed fonts are copied to a machine with a different architecture.
-
-2.2.4 Setting the server's font path
-
-The list of directories where the server looks for fonts is known as the font
-path. Informing the server of the existence of a new font directory consists
-of putting it on the font path.
-
-The font path is an ordered list; if a client's request matches multiple
-fonts, the first one in the font path is the one that gets used. When match-
-ing fonts, the server makes two passes over the font path: during the first
-pass, it searches for an exact match; during the second, it searches for
-fonts suitable for scaling.
-
-For best results, scalable fonts should appear in the font path before the
-bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts
-when an exact match is possible, but will avoid scaling bitmap fonts when a
-scalable font can be used. (The `:unscaled' hack, while still supported,
-should no longer be necessary in XFree86 4.0 and later.)
-
-You may check the font path of the running server by typing the command
-
- $ xset q
-
-2.2.4.1 Temporary modification of the font path
-
-The `xset' utility may be used to modify the font path for the current ses-
-sion. The font path is set with the command xset fp; a new element is added
-to the front with xset +fp, and added to the end with xset fp+. For example,
-
- $ xset +fp /usr/local/fonts/Type1
- $ xset fp+ /usr/local/fonts/bitmap
-
-Conversely, an element may be removed from the front of the font path with
-`xset -fp', and removed from the end with `xset fp-'. You may reset the font
-path to its default value with `xset fp default'.
-
-For more information, please consult the xset(1) manual page.
-
-2.2.4.2 Permanent modification of the font path
-
-The default font path (the one used just after server startup or after `xset
-fp default') is specified in the X server's `XF86Config' file. It is com-
-puted by appending all the directories mentioned in the `FontPath' entries of
-the `Files' section in the order in which they appear.
-
- FontPath "/usr/local/fonts/Type1"
- ...
- FontPath "/usr/local/fonts/bitmap"
-
-For more information, please consult the XF86Config(5) manual page.
-
-2.2.5 Troubleshooting
-
-If you seem to be unable to use some of the fonts you have installed, the
-first thing to check is that the `fonts.dir' files are correct and that they
-are readable by the server (the X server usually runs as root, beware of NFS-
-mounted font directories). If this doesn't help, it is quite possible that
-you are trying to use a font in a format that is not supported by your
-server.
-
-XFree86 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
-CIDFont font formats. However, not all XFree86 servers come with all the
-font backends configured in.
-
-On most platforms, the XFree86 servers are modular: the font backends are
-included in modules that are loaded at runtime. The modules to be loaded are
-specified in the `XF86Config' file using the `Load' directive:
-
- Load "type1"
-
-If you have trouble installing fonts in a specific format, you may want to
-check the server's log file in order to see whether the relevant modules are
-properly loaded. The list of font modules distributed with XFree86 is as
-follows:
-
- o "bitmap": bitmap fonts (`*.bdf', `*.pcf' and `*.snf');
-
- o "freetype": TrueType fonts (`*.ttf' and `*.ttc'), OpenType fonts
- (`*.otf' and `*.otc') and Type 1 fonts (`*.pfa' and `*.pfb');
-
- o "type1": alternate Type 1 backend (`*.pfa' and `*.pfb') and CIDFont
- backend;
-
- o "xtt": alternate TrueType backend (`*.ttf' and `*.ttc');
-
- o "speedo": Bitstream Speedo fonts (`*.spd').
-
-Please note that the argument of the `Load' directive is case-sensitive.
-
-3. Fonts included with XFree86
-
-3.1 Standard bitmap fonts
-
-The Sample Implementation of X11 (SI) comes with a large number of bitmap
-fonts, including the `fixed' family, and bitmap versions of Courier, Times,
-Helvetica and some members of the Lucida family. In the SI, these fonts are
-provided in the ISO 8859-1 encoding (ISO Latin Western-European).
-
-In XFree86, a number of these fonts are provided in Unicode-encoded font
-files instead. At build time, these fonts are split into font files encoded
-according to legacy encodings, a process which allows us to provide the stan-
-dard fonts in a number of regional encodings with no duplication of work.
-
-For example, the font file
-
- /usr/X11R6/lib/X11/fonts/misc/6x13.bdf
-
-with XLFD
-
- -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
-
-is a Unicode-encoded version of the standard `fixed' font with added support
-for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA and other scripts
-plus numerous technical symbols. It contains over 2800 glyphs, covering all
-characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European IBM
-and Microsoft code pages, KOI8, WGL4, and the repertoires of many other char-
-acter sets.
-
-This font is used at build time for generating the font files
-
- 6x13-ISO8859-1.bdf
- 6x13-ISO8859-2.bdf
- ...
- 6x13-ISO8859-15.bdf
- 6x13-KOI8-R.bdf
-
-with respective XLFDs
-
- -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
- ...
- -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15
- -misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r
-
-The standard short name `fixed' is normally an alias for
-
- -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
-
-3.2 The ClearlyU Unicode font family
-
-The ClearlyU family of fonts provides a set of 12 pt, 100 dpi proportional
-fonts with many of the glyphs needed for Unicode text. Together, the fonts
-contain approximately 7500 glyphs.
-
-The main ClearlyU font has the XLFD
-
- -mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1
-
-and resides in the font file
-
- /usr/X11R6/lib/X11/fonts/misc/cu12.pcf.gz
-
-Additional ClearlyU fonts include
-
- -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1
- -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1
- -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0
- -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
-
-The Alternate Glyphs font contains additional glyph shapes that are needed
-for certain languages. A second alternate glyph font will be provided later
-for cases where a character has more than one commonly used alternate shape
-(e.g. the Urdu heh).
-
-The PUA font contains extra glyphs that are useful for certain rendering pur-
-poses.
-
-The Arabic Extra font contains the glyphs necessary for characters that don't
-have all of their possible shapes encoded in ISO 10646. The glyphs are
-roughly ordered according to the order of the characters in the ISO 10646
-standard.
-
-The Ligature font contains ligatures for various scripts that may be useful
-for improved presentation of text.
-
-3.3 Standard scalable fonts
-
-XFree86 includes all the scalable fonts distributed with X11R6.
-
-3.3.1 Standard Type 1 fonts
-
-The IBM Courier set of fonts cover ISO 8859-1 and ISO 8859-2 as well as Adobe
-Standard Encoding. These fonts have XLFD
-
- -adobe-courier-medium-*-*--0-0-0-0-m-0-*-*
-
-and reside in the font files
-
- /usr/X11R6/lib/X11/fonts/Type1/cour*.pfa
-
-The Adobe Utopia set of fonts only cover ISO 8859-1 as well as Adobe Standard
-Encoding. These fonts have XLFD
-
- -adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1
-
-and reside in the font files
-
- /usr/X11R6/lib/X11/fonts/Type1/UT*.pfa
-
-Finally, XFree86 also comes with Type 1 versions of Bitstream Courier and
-Charter. These fonts have XLFD
-
- -bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
- -bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1
-
-and reside in the font files
-
- /usr/X11R6/lib/X11/fonts/Type1/c*bt_.pfb
-
-3.3.2 Standard Speedo fonts
-
-XFree86 includes Speedo versions of the Bitstream Courier and Charter fonts.
-In order to use these fonts, you should ensure that your X server is loading
-the `Speedo' font backend; see Troubleshooting (section 2.2.5, page 1).
-
-These fonts cover all of ISO 8859-1 and almost all of ISO 8859-2. They have
-XLFD name
-
- -bitstream-courier-*-*-normal--0-0-0-0-m-0-*-*
- -bitstream-charter-*-*-normal--0-0-0-0-p-0-*-*
-
-and reside in the font files
-
- /usr/X11R6/lib/X11/fonts/Speedo/font*.spd
-
-3.4 The Bigelow & Holmes Luxi family
-
-XFree86 includes the Luxi family of scalable fonts, in both TrueType and
-Type 1 format. This family consists of the fonts Luxi Serif, with XLFD
-
- -b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
-
-Luxi Sans, with XLFD
-
- -b&h-luxi sans-medium-*-normal--*-*-*-*-p-*-*-*
-
-and Luxi Mono, with XLFD
-
- -b&h-luxi mono-medium-*-normal--*-*-*-*-m-*-*-*
-
-Each of these fonts comes Roman, oblique, bold and bold oblique variants The
-TrueType version have glyphs covering the basic ASCII Unicode range, the
-Latin 1 range, as well as the Extended Latin range and some additional punc-
-tuation characters. In particular, these fonts include all the glyphs needed
-for ISO 8859 parts 1, 2, 3, 4, 9, 13 and 15, as well as all the glyphs in the
-Adobe Standard encoding and the Windows 3.1 character set.
-
-The glyph coverage of the Type 1 versions is somewhat reduced, and only cov-
-ers ISO 8859 parts 1, 2 and 15 as well as the Adobe Standard encoding.
-
-The Luxi fonts are original designs by Kris Holmes and Charles Bigelow. Luxi
-fonts include seriffed, sans serif, and monospaced styles, in roman and
-oblique, and normal and bold weights. The fonts share stem weight, x-height,
-capital height, ascent and descent, for graphical harmony.
-
-The character width metrics of Luxi roman and bold fonts match those of core
-fonts bundled with popular operating and window systems.
-
-The license terms for the Luxi fonts are included in the file `COPYRIGHT.BH',
-as well as in the License document.
-
-Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc. developed the
-Luxi typeface designs in Ikarus digital format.
-
-URW++ Design and Development GmbH converted the Ikarus format fonts to True-
-Type and Type1 font programs and implemented the grid-fitting "hints" and
-kerning tables in the Luxi fonts.
-
-For more information, please contact <design@bigelowandholmes.com> or
-<info@urwpp.de>, or consult the URW++ web site <URL:http://www.urwpp.de>.
-
-An earlier version of the Luxi fonts was made available under the name
-Lucidux. This name should no longer be used due to trademark uncertainties,
-and all traces of the Lucidux name have been removed from XFree86.
-
-4. More about core fonts
-
-This section describes XFree86-specific enhancements to the core X11 fonts
-system.
-
-4.1 Core fonts and internationalisation
-
-The scalable font backends (Type 1, Speedo and TrueType) can automatically
-re-encode fonts to the encoding specified in the XLFD in `fonts.dir'. For
-example, a `fonts.dir' file can contain entries for the Type 1 Courier font
-such as
-
- cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
- cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2
-
-which will lead to the font being recoded to ISO 8859-1 and ISO 8859-2
-respectively.
-
-4.1.1 The fontenc layer
-
-Three of the scalable backends (Type 1, Speedo, and the FreeType TrueType
-backend) use a common fontenc layer for font re-encoding. This allows these
-backends to share their encoding data, and allows simple configuration of new
-locales independently of font type.
-
-Please note: the X-TrueType (X-TT) backend does not use the fontenc layer,
-but instead uses its own method for font reencoding. If you are only inter-
-ested in X-TT you may want to skip to Using Symbol Fonts (section 4.1.5, page
-1), as the intervening information does not apply to X-TT. X-TT itself is
-described in more detail in X-TrueType (section 4.2.2, page 1).
-
-In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
-possibly a number of aliases (alternate names), and an ordered collection of
-mappings. A mapping defines the way the encoding can be mapped into one of
-the target encodings known to fontenc; currently, these consist of Unicode,
-Adobe glyph names, and arbitrary TrueType ``cmap''s.
-
-A number of encodings are hardwired into fontenc, and are therefore always
-available; the hardcoded encodings cannot easily be redefined. These
-include:
-
- o iso10646-1: Unicode;
-
- o iso8859-1: ISO Latin-1 (Western Europe);
-
- o iso8859-2: ISO Latin-2 (Eastern Europe);
-
- o iso8859-3: ISO Latin-3 (Southern Europe);
-
- o iso8859-4: ISO Latin-4 (Northern Europe);
-
- o iso8859-5: ISO Cyrillic;
-
- o iso8859-6: ISO Arabic;
-
- o iso8859-7: ISO Greek;
-
- o iso8859-8: ISO Hebrew;
-
- o iso8859-9: ISO Latin-5 (Turkish);
-
- o iso8859-10: ISO Latin-6 (Nordic);
-
- o iso8859-15: ISO Latin-9, or Latin-0 (Revised Western-European);
-
- o koi8-r: KOI8 Russian;
-
- o koi8-u: KOI8 Ukrainian (see RFC 2319);
-
- o koi8-ru: KOI8 Russian/Ukrainian;
-
- o koi8-uni: KOI8 ``Unified'' (Russian, Ukrainian, and Byelorussian);
-
- o koi8-e: KOI8 ``European,'' ISO-IR-111, or ECMA-Cyrillic;
-
- o microsoft-symbol and apple-roman: these are only likely to be useful
- with TrueType symbol fonts.
-
-Additional encodings can be added by defining encoding files. When a font
-encoding is requested that the fontenc layer doesn't know about, the backend
-checks the directory in which the font file resides (not necessarily the
-directory with fonts.dir!) for a file named `encodings.dir'. If found, this
-file is scanned for the requested encoding, and the relevant encoding defini-
-tion file is read in. The `mkfontdir' utility, when invoked with the `-e'
-option followed by the name of a directory containing encoding files, can be
-used to automatically build `encodings.dir' files. Please see the mkfont-
-dir(1) manual page for more details.
-
-A number of encoding files for common encodings are included with XFree86.
-Information on writing new encoding files can be found in Format of encodings
-directory files (section 4.1.3, page 1) and Format of encoding files (section
-4.1.4, page 1) later in this document.
-
-4.1.2 Backend-specific notes about fontenc
-
-4.1.2.1 The FreeType backend
-
-For TrueType and OpenType fonts, the FreeType backend scans the mappings in
-order. Mappings with a target of PostScript are ignored; mappings with a
-TrueType or Unicode target are checked against all the cmaps in the file.
-The first applicable mapping is used.
-
-For Type 1 fonts, the FreeType backend first searches for a mapping with a
-target of PostScript. If one is found, it is used. Otherwise, the backend
-searches for a mapping with target Unicode, which is then composed with a
-built-in table mapping codes to glyph names. Note that this table only cov-
-ers part of the Unicode code points that have been assigned names by Adobe.
-
-Specifying an encoding value of adobe-fontspecific for a Type 1 font disables
-the encoding mechanism. This is useful with symbol and incorrectly encoded
-fonts (see Incorrectly encoded fonts (section 4.1.6, page 1) below).
-
-If a suitable mapping is not found, the FreeType backend defaults to
-ISO 8859-1.
-
-4.1.2.2 Type 1
-
-The Type 1 backend behaves similarly to the FreeType backend with Type 1
-fonts, except that it limits all encodings to 8-bit codes.
-
-4.1.2.3 Speedo
-
-The Speedo backend searches for a mapping with a target of Unicode, and uses
-it if found. If none is found, the backend defaults to ISO 8859-1.
-
-The Speedo backend limits all encodings to 8-bit codes.
-
-4.1.3 Format of encoding directory files
-
-In order to use a font in an encoding that the font backend does not know
-about, you need to have an `encodings.dir' file either in the same directory
-as the font file used or in a system-wide location
-(`/usr/X11R6/lib/X11/fonts/encodings/' by default).
-
-The `encodings.dir' file has a similar format to `fonts.dir'. Its first line
-specifies the number of encodings, while every successive line has two
-columns, the name of the encoding, and the name of the encoding file; this
-can be relative to the current directory, or absolute. Every encoding name
-should agree with the encoding name defined in the encoding file. For exam-
-ple,
-
- 3
- mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc
- mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc
- mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc
-
-The name of an encoding must be specified in the encoding file's `STARTENCOD-
-ING' or `ALIAS' line. It is not enough to create an `encodings.dir' entry.
-
-If your platform supports it (it probably does), encoding files may be com-
-pressed or gzipped.
-
-The `encoding.dir' files are best maintained by the `mkfontdir' utility.
-Please see the mkfontdir(1) manual page for more information.
-
-4.1.4 Format of encoding files
-
-The encoding files are ``free form,'' i.e. any string of whitespace is equiv-
-alent to a single space. Keywords are parsed in a non-case-sensitive manner,
-meaning that `size', `SIZE', and `SiZE' all parse as the same keyword; on the
-other hand, case is significant in glyph names.
-
-Numbers can be written in decimal, as in `256', in hexadecimal, as in
-`0x100', or in octal, as in `0400'.
-
-Comments are introduced by a hash sign `#'. A `#' may appear at any point in
-a line, and all characters following the `#' are ignored, up to the end of
-the line.
-
-The encoding file starts with the definition of the name of the encoding, and
-possibly its alternate names (aliases):
-
- STARTENCODING mulearabic-0
- ALIAS arabic-0
-
-The name of the encoding and its aliases should be suitable for use in an
-XLFD font name, and therefore contain exactly one dash `-'.
-
-The encoding file may then optionally declare the size of the encoding. For
-a linear encoding (such as ISO 8859-1), the SIZE line specifies the maximum
-code plus one:
-
- SIZE 0x2B
-
-For a matrix encoding, it should specify two numbers. The first is the num-
-ber of the last row plus one, the other, the highest column number plus one.
-In the case of `jisx0208.1990-0' (JIS X 0208(1990), double-byte encoding,
-high bit clear), it should be
-
- SIZE 0x75 0x80
-
-In the case of a matrix encoding, a `FIRSTINDEX' line may be included to
-specify the minimum glyph index in an encoding. The keyword `FIRSTINDEX' is
-followed by two integers, the minimum row number followed by the minimum col-
-umn number:
-
- FIRSTINDEX 0x20 0x20
-
-In the case of a linear encoding, a `FIRSTINDEX' line is not very useful. If
-for some reason however you chose to include on, it should be followed by a
-single integer.
-
-Note that in most font backends inclusion of a `FIRSTINDEX' line has the side
-effect of disabling default glyph generation, and this keyword should there-
-fore be avoided unless absolutely necessary.
-
-Codes outside the region defined by the `SIZE' and `FIRSTINDEX' lines are
-understood to be undefined. Encodings default to linear encoding with a size
-of 256 (0x100). This means that you must declare the size of all 16 bit
-encodings.
-
-What follows is one or more mapping sections. A mapping section starts with
-a `STARTMAPPING' line stating the target of the mapping. The target may be
-one of:
-
- o Unicode (ISO 10646):
-
- STARTMAPPING unicode
-
- o a given TrueType ``cmap'':
-
- STARTMAPPING cmap 3 1
-
- o PostScript glyph names:
-
- STARTMAPPING postscript
-
-Every line in a mapping section maps one from the encoding being defined to
-the target of the mapping. In mappings with a Unicode or TrueType mapping,
-codes are mapped to codes:
-
- 0x21 0x0660
- 0x22 0x0661
- ...
-
-As an abbreviation, it is possible to map a contiguous range of codes in a
-single line. A line consisting of three integers
-
- <it/start/ <it/end/ <it/target/
-
-is an abbreviation for the range of lines
-
- start target
-
- start+1 target+1
-
- ...
-
- end target+end-start
-
-For example, the line
-
- 0x2121 0x215F 0x8140
-
-is an abbreviation for
-
- 0x2121 0x8140
- 0x2122 0x8141
- ...
- 0x215F 0x817E
-
-Codes not listed are assumed to map through the identity (i.e. to the same
-numerical value). In order to override this default mapping, you may specify
-a range of codes to be undefined by using an `UNDEFINE' line:
-
- UNDEFINE 0x00 0x2A
-
-or, for a single code,
-
- UNDEFINE 0x1234
-
-PostScript mappings are different. Every line in a PostScript mapping maps a
-code to a glyph name
-
- 0x41 A
- 0x42 B
- ...
-
-and codes not explicitly listed are undefined.
-
-A mapping section ends with an ENDMAPPING line
-
- ENDMAPPING
-
-After all the mappings have been defined, the file ends with an ENDENCODING
-line
-
- ENDENCODING
-
-In order to make future extensions to the format possible, lines starting
-with an unknown keyword are silently ignored, as are mapping sections with an
-unknown target.
-
-4.1.5 Using symbol fonts
-
-Type 1 symbol fonts should be installed using the adobe-fontspecific encod-
-ing.
-
-In an ideal world, all TrueType symbol fonts would be installed using one of
-the microsoft-symbol and apple-roman encodings. A number of symbol fonts,
-however, are not marked as such; such fonts should be installed using
-microsoft-cp1252, or, for older fonts, microsoft-win3.1.
-
-In order to guarantee consistent results (especially between Type 1 and True-
-Type versions of the same font), it is possible to define a special encoding
-for a given font. This has already been done for the ZapfDingbats font; see
-the file `encodings/adobe-dingbats.enc'.
-
-4.1.6 Hints about using badly encoded fonts
-
-A number of text fonts are incorrectly encoded. Incorrect encoding is some-
-times done by design, in order to make a font for an exotic script appear
-like an ordinary Western text font on systems which are not easily extended
-with new locale data. It is often the result of the font designer's laziness
-or incompetence; for some reason, most people seem to find it easier to
-invent idiosyncratic glyph names rather than follow the Adobe glyph list.
-
-There are two ways of dealing with such fonts: using them with the encoding
-they were designed for, and creating an ad hoc encoding file.
-
-4.1.6.1 Using fonts with the designer's encoding
-
-In the case of Type 1 fonts, the font designer can specify a default encod-
-ing; this encoding is requested by using the `adobe-fontspecific' encoding in
-the XLFD name. Sometimes, the font designer omitted to specify a reasonable
-default encoding, in which case you should experiment with `adobe-standard',
-`iso8859-1', `microsoft-cp1252', and `microsoft-win3.1'. (The encoding
-`microsoft-symbol' doesn't make sense for Type 1 fonts).
-
-TrueType fonts do not have a default encoding. However, most TrueType fonts
-are designed with either Microsoft or Apple platforms in mind, so one of
-`microsoft-symbol', `microsoft-cp1252', `microsoft-win3.1', or `apple-roman'
-should yield reasonable results.
-
-4.1.6.2 Specifying an ad hoc encoding file
-
-It is always possible to define an encoding file to put the glyphs in a font
-in any desired order. Again, see the `encodings/adobe-dingbats.enc' file to
-see how this is done.
-
-4.1.6.3 Specifying font aliases
-
-By following the directions above, you will find yourself with a number of
-fonts with unusual names --- with encodings such as `adobe-fontspecific',
-`microsoft-win3.1' etc. In order to use these fonts with standard applica-
-tions, it may be useful to remap them to their proper names.
-
-This is done by writing a `fonts.alias' file. The format of this file is very
-simple: it consists of a series of lines each mapping an alias name to a font
-name. A `fonts.alias' file might look as follows:
-
- "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \
- "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific"
-
-(both XLFD names on a single line). The syntax of the `fonts.alias' file is
-more precisely described in the mkfontdir(1) manual page.
-
-4.2 Additional notes about scalable core fonts
-
-The FreeType (libfreetype-xtt2) backend (module `freetype', formerly known as
-xfsft) is able to deal with both TrueType and Type 1 fonts. This puts it in
-conflict with the X-TT and Type 1 backends respectively.
-
-If both the FreeType and the Type 1 backends are loaded, the FreeType backend
-will be used for Type 1 fonts. If both the FreeType and X-TT backends are
-loaded, X-TT will be used for TrueType fonts.
-
-4.2.1 About the FreeType backend
-
-The FreeType (libfreetype-xtt2) backend (formerly xfsft) is a backend based
-on version 2 of the FreeType library (see the FreeType web site
-<URL:http://www.freetype.org/>) and has the X-TT functionalities for CJKV
-support provided by the After X-TT Project (see the After X-TT Project web
-site <URL:http://x-tt.sourceforge.jp/>). The FreeType module has support for
-the ``fontenc'' style of internationalisation (see The fontenc layer (section
-4.1.1, page 1)). This backend supports TrueType font files (`*.ttf'), Open-
-Type font files (`*.otf'), TrueType Collections (`*.ttc'), OpenType Collec-
-tions (`*.otc') and Type 1 font files (`*.pfa' and `*.pfb').
-
-In order to access the faces in a TrueType Collection file, the face number
-must be specified in the fonts.dir file before the filename, within a pair of
-colons, or by setting the 'fn' TTCap option. For example,
-
- :1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
-
-refers to face 1 in the `mincho.ttc' TrueType Collection file.
-
-The new FreeType backend supports the extended `fonts.dir' syntax introduced
-by X-TrueType with a number of options, collectively known as `TTCap'. A
-`TTCap' entry follows the general syntax
-
- option=value:
-
-and should be specified before the filename. The new FreeType almost per-
-fectly supports TTCap options that are compatible with X-TT 1.4. The Auto-
-matic Italic (`ai'), Double Strike (`ds') and Bounding box Width (`bw')
-options are indispensable in CJKV. For example,
-
- mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
- ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0
- ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0
- ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0
- bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
- bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0
- bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0
- bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
-
-setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
-only. More information on the TTCap syntax is found on the After X-TT
-Project page <URL:http://x-tt.sourceforge.jp/>.
-
-The FreeType backend uses the fontenc layer in order to support recoding of
-fonts; this was described in The fontenc layer (section 4.1.1, page 1) and
-especially FreeType-specific notes about fontenc (section 4.1.2.1, page 1)
-earlier in this document.
-
-4.2.2 About the X-TrueType TrueType backend
-
-The `X-TrueType' backend is a backend based on version 1 of the FreeType
-library. X-TrueType doesn't use the `fontenc' layer for managing font encod-
-ings, but instead uses its own database of encodings. Since the functionali-
-ties for CJKV support introduced by X-TT have been merged into the new
-FreeType backend, the X-TT backend will be removed from XFree86's tree near
-the future. Therefore, the use of FreeType backend is preferred over the X-
-TT backend. General information on X-TrueType may be found at ."
-
-4.2.3 Delayed glyph rasterisation
-
-When loading a large character set, the old FreeType delayed glyph rasterisa-
-tion until the time at which the glyph was first used. The new FreeType
-(libfreetype-xtt2) has an improved `very lazy' metric calculation method to
-speed up the process when loading TrueType or OpenType fonts. Although the
-X-TT module also has this method, the "vl=y" TTCap option must be set if you
-want to use it. This is the default method for FreeType when it loads multi-
-byte fonts. Even if you use a unicode font which has tens of thousands of
-glyphs, this delay will not be worrisome as long as you use the new FreeType
-backend -- its `very lazy' method is super-fast.
-
-The maximum error of bitmap position using `very lazy' method is 1 pixel, and
-is the same as that of a character-cell spacing. When the X-TT backend is
-used with the `vl=y' option, a chipped bitmap is displayed with certain
-fonts. However, the new FreeType backend has minimal problem with this,
-since it corrects left- and right-side bearings using `italicAngle' in the
-TrueType/OpenType post table, and does automatic correction of bitmap posi-
-tions when rasterisation so that chipped bitmaps are not displayed. Never-
-theless if you don't want to use the `very lazy' method when using multi-
-bytes fonts, set `vl=n' in the TTCap option to disable it:
-
- vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
-
-Of course, both backends also support an optimisation for character-cell
-fonts (fonts with all glyph metrics equal, or terminal fonts). A font with
-an XLFD specifying a character-cell spacing `c', as in
-
- -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
-
-or
-
- fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
-
-will not compute the metric for each glyph, but instead trust the font to be
-a character-cell font. You are encouraged to make use of this optimisation
-when useful, but be warned that not all monospaced fonts are character-cell
-fonts.
-
-5. Appendix: background and terminology
-
-5.1 Characters and glyphs
-
-A computer text-processing system inputs keystrokes and outputs glyphs, small
-pictures that are assembled on paper or on a computer screen. Keystrokes and
-glyphs do not, in general, coincide: for example, if the system does generate
-ligatures, then to the sequence of two keystrokes <f><i> will typically cor-
-respond a single glyph. Similarly, if the system shapes Arabic glyphs in a
-vaguely reasonable manner, then multiple different glyphs may correspond to a
-single keystroke.
-
-The complex transformation rules from keystrokes to glyphs are usually fac-
-tored into two simpler transformations, from keystrokes to characters and
-from characters to glyphs. You may want to think of characters as the basic
-unit of text that is stored e.g. in the buffer of your text editor. While
-the definition of a character is intrinsically application-specific, a number
-of standardised collections of characters have been defined.
-
-A coded character set is a set of characters together with a mapping from
-integer codes --- known as codepoints --- to characters. Examples of coded
-character sets include US-ASCII, ISO 8859-1, KOI8-R, and JIS X 0208(1990).
-
-A coded character set need not use 8 bit integers to index characters. Many
-early systems used 6 bit character sets, while 16 bit (or more) character
-sets are necessary for ideographic writing systems.
-
-5.2 Font files, fonts, and XLFD
-
-Traditionally, typographers speak about typefaces and founts. A typeface is
-a particular style or design, such as Times Italic, while a fount is a
-molten-lead incarnation of a given typeface at a given size.
-
-Digital fonts come in font files. A font file contains the information nec-
-essary for generating glyphs of a given typeface, and applications using font
-files may access glyph information in an arbitrary order.
-
-Digital fonts may consist of bitmap data, in which case they are said to be
-bitmap fonts. They may also consist of a mathematical description of glyph
-shapes, in which case they are said to be scalable fonts. Common formats for
-scalable font files are Type 1 (sometimes incorrectly called ATM fonts or
-PostScript fonts), TrueType and Speedo.
-
-The glyph data in a digital font needs to be indexed somehow. How this is
-done depends on the font file format. In the case of Type 1 fonts, glyphs
-are identified by glyph names. In the case of TrueType fonts, glyphs are
-indexed by integers corresponding to one of a number of indexing schemes
-(usually Unicode --- see below).
-
-The X11 core fonts system uses the data in a font file to generate font
-instances, which are collections of glyphs at a given size indexed according
-to a given encoding.
-
-X11 core font instances are usually specified using a notation known as the X
-Logical Font Description (XLFD). An XLFD starts with a dash `-', and con-
-sists of fourteen fields separated by dashes, for example:
-
- -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
-
-Or particular interest are the last two fields `iso8859-1', which specify the
-font instance's encoding.
-
-A scalable font is specified by an XLFD which contains zeroes instead of some
-fields:
-
- -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
-
-X11 font instances may also be specified by short name. Unlike an XLFD, a
-short name has no structure and is simply a conventional name for a font
-instance. Two short names are of particular interest, as the server will not
-start if font instances with these names cannot be opened. These are
-`fixed', which specifies the fallback font to use when the requested font
-cannot be opened, and `cursor', which specifies the set of glyphs to be used
-by the mouse pointer.
-
-Short names are usually implemented as aliases to XLFDs; the standard `fixed'
-and `cursor' aliases are defined in
-
- /usr/X11R6/lib/X11/font/misc/fonts.alias
-
-5.3 Unicode
-
-Unicode (<URL:http://www.unicode.org>) is a coded character set with the goal
-of uniquely identifying all characters for all scripts, current and histori-
-cal. While Unicode was explicitly not designed as a glyph encoding scheme,
-it is often possible to use it as such.
-
-Unicode is an open character set, meaning that codepoint assignments may be
-added to Unicode at any time (once specified, though, an assignment can never
-be changed). For this reason, a Unicode font will be sparse, meaning that it
-only defines glyphs for a subset of the character registry of Unicode.
-
-The Unicode standard is defined in parallel with the international standard
-ISO 10646. Assignments in the two standards are always equivalent, and we
-often use the terms Unicode and ISO 10646 interchangeably.
-
-When used in the X11 core fonts system, Unicode-encoded fonts should have the
-last two fields of their XLFD set to `iso10646-1'.
-
-6. References
-
-XFree86 comes with extensive documentation in the form of manual pages and
-typeset documents. Before installing fonts, you really should read the font-
-config(3) and mkfontdir(1) manual pages; other manual pages of interest
-include X(7), Xserver(1), xset(1), Xft(3), xlsfonts(1) and showfont(1). In
-addition, you may want to read the X Logical Font Description document, by
-Jim Flowers, which is provided in the file `xc/doc/xlfd.PS.Z'.
-
-The latest released version of the XFree86 documentation (including this doc-
-ument and all manual pages) is available as current XFree86 documentation
-<URL:http://www.xfree86.org/current/>.
-
-The comp.fonts FAQ <URL:http://www.netmeg.net/faq/computers/fonts/>, which is
-unfortunately no longer being maintained, contains a wealth of information
-about digital fonts.
-
-Xft and Fontconfig are described on Keith Packard's Fontconfig site
-<URL:http://www.fontconfig.org>.
-
-The xfsft home page <URL:http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/>
-has been superseded by this document, and is now obsolete; you may however
-still find some of the information that it contains useful. Joerg Pommnitz'
-xfsft page <URL:http://www.joerg-pommnitz.de/TrueType/xfsft.html> is the
-canonical source for the `ttmkfdir' utility, which is the ancestor of
-mkfontscale.
-
-The author's software pages <URL:http://www.pps.jussieu.fr/~jch/software/>
-might or might not contain related scribbles and development versions of
-software.
-
-The documentation of X-TrueType is available from the After X-TT Project page
-<URL:http://x-tt.sourceforge.jp/>.
-
-A number of East-Asian CIDFonts are available from O'Reilly's FTP site
-<URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/>.
-
-While the Unicode consortium site <URL:http://www.unicode.org> may be of
-interest, you are more likely to find what you need in Markus Kuhn's UTF-8
-and Unicode FAQ <URL:http://www.cl.cam.ac.uk/~mgk25/unicode.html>.
-
-The IANA RFC documents, available from a number of sites throughout the
-world, often provide interesting information about character set issues; see
-for example RFC 373.
-
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.22 dawes Exp $
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.26 2003/11/19 01:44:58 dawes Exp $
diff --git a/hw/xfree86/doc/README.rapidaccess b/hw/xfree86/doc/README.rapidaccess
deleted file mode 100644
index a78dfb9bc..000000000
--- a/hw/xfree86/doc/README.rapidaccess
+++ /dev/null
@@ -1,48 +0,0 @@
-The IBM Rapid Access keyboard have some extra buttons
-on it to launch programs, control a cd-player and so on.
-
-These buttons is not functional when the computer is turned
-on but have to be activated by sending the codes 0xea 0x71
-to it.
-
-I've written the following hack to send codes to the keyboard:
-
---------------------------------------------------------------
-/* gcc -O2 -s -Wall -osend_to_keyboard send_to_keyboard.c */
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/io.h>
-
-int main( int argc, char *argv[] )
-{
- int i;
-
- ioperm( 0x60, 3, 1 );
-
- for( i = 1; i < argc; i++ ) {
- int x = strtol( argv[i], 0, 16 );
-
- usleep( 300 );
- outb( x, 0x60 );
- }
-
- return 0;
-}
---------------------------------------------------------------
-
-As root you can then call this program (in your boot scripts)
-as "send_to_keyboard ea 71" to turn on the extra buttons.
-
-It's not a good idea to run several instances of this program
-at the same time. It is a hack but it works. If you try to
-send other codes to the keyboard it probably will lock up.
-For other codes see:
-
-http://www.win.tue.nl/~aeb/linux/kbd/scancodes-2.html#ss2.22
-
---
-Dennis Björklund <db@zigo.dhs.org>
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess,v 1.1 2001/05/18 23:35:32 dawes Exp $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG b/hw/xfree86/doc/changelogs/CHANGELOG
deleted file mode 100644
index 78f7f2e84..000000000
--- a/hw/xfree86/doc/changelogs/CHANGELOG
+++ /dev/null
@@ -1,18238 +0,0 @@
-XFree86 4.3.99.17 (xx November 2003)
-
-XFree86 4.3.99.16 (20 November 2003)
- 609. Fix 'constype' for modern framebuffers on Solaris (Bugzilla #890,
- Alan Coopersmith).
- 608. Fix a thread deadlock problem in libXp (Bugzilla #887, Roland Mainz).
- 607. Fix event buffer overrun in the wacom driver (Bugzilla #882, David Dawes,
- reported by Jonathan Hough).
- 606. Add unmapping code to DGAUnmapPhysical() for most systems that use
- mmap(). Without this lots of map/unmap calls would result in running
- out of address space and/or file handles (Bugzilla #880, David Dawes,
- reported by Eckhard Neber).
- 605. Restore the Windows keycodes in the 'xfree86' XKB keycodes map,
- and add the Solaris-compatible tokens as aliases (reported by
- Panagiotis Papadakos).
- 604. Fix some problems building against external installations of
- freetype2 (David Dawes).
- 603. Add font bounds checking to the X server side of the font server
- interface (Chisato Yamauchi, David Dawes).
- 602. Fix ForcePCIMode option to work as advertised in Radeon driver
- (Bugzilla #850, Kevin Martin).
- 601. Update the fonts document for the FreeType backend changes
- (Chisato Yamauchi, Reiko Nakajima, After X-TT Project).
- 600. Don't allow the lack of "SUPERSCRIPT TWO" to prevent Adobe Standard
- Cyrillic encoded fonts from being accepted as "koi8" capable
- (Michail Vidiassov).
- 599. Xvfb didn't have enough pixmap formats for Render (David Dawes).
- 598. Fix the processing of xdm/config/Xres.cpp, which is broken with
- gcc 3.3.2 (reported by Chisato Yamauchi).
- 597. Fix two problems with Xvfb:
- - Too much memory was allocated because of a confusion between
- bytes and pixels.
- - The XWD header was corrupted at server reset.
- (David Dawes).
- 596. Fix several problems xwud has displaying TrueColor dumps (extreme
- slowness displaying on TrueColor visuals, and incorrectness displaying
- on DirectColor visuals) (David Dawes).
- 595. Rank TrueColor above DirectColor in xwud. This avoids colourmap flashing
- by default when running on a server with both visuals available
- (David Dawes).
- 594. Build with Xplugin support by default on Panther (Torrey T. Lyons).
- 593. On Mac OS X, allow "X -version" to work without connecting to
- CoreGraphics (Torrey T. Lyons, reported by Benjamin Reed).
- 592. Don't optimize away window restacks in rootless mode (John Harper).
- 591. Fix problems preventing mesa-based GLX from working with Xnest, even
- though it is linked in and advertised (David Dawes).
- 590. Fix typing in XDarwin Preference panel going to X11 (Torrey T. Lyons).
- 589. Fix rootless build after REGION_* macro rework (Torrey T. Lyons).
- 588. Fix broken GLX indirect rendering (David Dawes).
- 587. Fix the XKB definitions for the "Hiragana_Katakana" key, and fix
- some incorrect definitions in symbols/jp (Chisato Yamauchi).
- 586. Change the mkfontdir wrapper script to invoke mkfontscale via its full
- path name (Chisato Yamauchi).
- 585. Modify xf86config and xf86cfg to enable loading the "freetype" module
- (Chisato Yamauchi).
- 584. Wrap ucs2any with ProgramTargetName in dependencies, as needed for
- OS/2, and note that OS/2 doesn't have basename(3) (Bugzilla #871,
- Frank Giessler).
- 583. Fix atimisc's decoding of the mode on input for large panels
- (Marc La France).
- 582. Fix SEGV when ATIPreinit() fails (Marc La France).
- 581. In rootless XDarwin, don't send ButtonPress events when clicking in
- non-X11 windows (Torrey T. Lyons, John Harper).
- 580. AppleWM compatibility fixes:
- - Disable XDarwin handling cut and paste if AppleWM-aware cut and
- paste manager is available.
- - Set _NATIVE_SCREEN_ORIGIN property on root window.
- (John Harper, Torrey T. Lyons).
- 579. Change ProjectRoot from /XFree86 to /usr/X11R6 on OS/2 (Bugzilla #865,
- Frank Giessler).
- 578. Fix building of new Mesa on OS/2 (Bugzilla #865, Frank Giessler).
- 577. Change the way how libraries with long file names are handed on
- OS/2 (Bugzilla #865, Frank Giessler).
- 576. Force screen blanking when entering DPMS states (Bugzilla #866,
- David Dawes, reported by Ed Fardos).
- 575. XDarwin fixes/cleanups:
- - Handle X11 executables opened from the Finder.
- - Use xcodebuild instead of pbxbuild on Panther.
- - Clean up Darwin specific imake #defines.
- - Fix compiler warnings on Panther.
- (Torrey T. Lyons).
- 574. A workaround for platforms (like *BSD) where IPv6 sockets don't accept
- IPv4 connections: disable IPv6 XDMCP code by default. This allows IPv4
- XDMCP to work on such platforms (David Dawes).
- 573. Rework REGION_* macros to eliminate NEED_SCREEN_REGIONS build failures
- (Marc La France).
- 572. Fix an old bug in the X server and xfs related to usage of
- c->savedName (Bugzilla #818, Owen Taylor).
- 571. Fix FontFileListOneFontWithInfo() so that it handles aliases in the
- same was as FontFileOpenFont() (Bugzilla #818, Owen Taylor).
- 570. Respect USE_SSE_ASM for the .S files in the r200 and radeon 3D drivers.
- This should fix the reported OpenBSD build problem (David Dawes).
- 569. Some missing FreeBSD AMD64/Sparc64 patches (Bugzilla #786, Eric Anholt).
- 568. The call to xf86RandRSetMode() from xf86RandRCreateScreenResources()
- doesn't appear to be necessary. Removing it restores the documented
- ViewPort behaviour when RandR is enabled (David Dawes).
- 567. Make the vesa driver blank the screen during initialisation for
- cosmetic reasons (David Dawes).
- 566. Make the cirrus driver blank the screen during initialisation for
- cosmetic reaons (most other drivers do this) (Bugzilla #781,
- Nicholas Miell).
- 565. The vesa driver wasn't setting the viewport correctly either at
- ScreenInit or EnterVT (David Dawes).
- 564. Fix the viewport initialisation. The ViewPort parameters from the
- XF86Config file were being ignored, and the default was a 0,0 viewport
- rather than centred on the virtual screen as documented. When RandR
- is enabled, it undoes all of this though... (David Dawes).
- 563. Fix an off-by-one bug in libXcursor that can result in segfaulting
- applications (David Dawes, reported by Agustin Gianni).
- 562. Fix RandR initialization problem when default screen resolution is
- different from the virtual resolution. (Bugzilla #853, Bob Paauwe).
- 561. Fix an Xv problem with the via driver where updating a portion of the
- overlay causes excessive CPU usage (Bugzilla #821, Neil Terry).
- 560. Fix an Xnest hang on OS/2 (Bugzilla #852, Frank Giessler).
- 559. OS/2 update for the recent move to building most libraries shared,
- and add some functions to the export lists for freetype and Xt for
- compatibility with older applications (Bugzilla #852, Frank Giessler).
- 558. Fix the installation location of the XRes and Xss manpage aliases
- (Bugzilla #848, ISHIKAWA Mutsumi).
- 557. Include backwards compatibility API for renamed stream functions in
- Freetype2 library (Torrey T. Lyons).
- 556. Fix acecad driver to call xf86DeleteInput() (Bugzilla #855, S. Voltz).
- 555. Register to handle X11 executables on Panther (John Harper).
- 554. Fixes for GLX on Mac OS X:
- - Make libGL not export libGLU symbols.
- - Fix uninitialized mutex for threaded direct GLX.
- (John Harper).
- 553. Fix "Non-aligned pointer being freed" warnings on XDarwin startup
- (Torrey T. Lyons).
- 552. Miscellaneous fixes for Panther:
- - Fix spurious #pragma getting inserted by cpp (Martin Costabel).
- - Fix startup failure due to bad keymapping file (Torrey T. Lyons).
- - Fix startup warning about missing semicolons (Torrey T. Lyons).
- 551. Mesa X86 asm build fix for Solaris (David Dawes).
- 550. Fix building libOSMesa on Darwin (Torrey T. Lyons).
- 549. Get backlight working on Apple's GeForce4 powerbooks (Guido Guenther).
-
-XFree86 4.3.99.15 ( 1 November 2003)
- 548. Update libfreetype-xtt2 to version 1.1:
- - Improved the very lazy method. To prevent displaying chipped bitmap
- when having italic angle, the lsb and rsb are adjusted by using
- italicAngle in post table.
- - Added automatic correction of bitmap position for preventing
- displaying chipped bitmap when using charcell or very lazy method.
- - Set DEFAULT_VERY_LAZY macro. If post table is available, the very
- lazy method is used as default when handling multi-bytes fonts.
- - Added additional glyphs(0x2d21-0x2d7c) to jisx0208.1990-0.enc.
- (Chisato Yamauchi, After X-TT Project).
- 547. Set the pixel clock limit above which hzoom is enabled for the video
- overlay for G450 and G550 cards to 234MHz. This fixes a problem with
- the Xv support having half horizontal resolution (Michel Lespinasse).
- 546. Add support on Mac OS X for building keymap using Carbon Keyboard
- Layout API (John Harper).
- 545. Map holes in kdrive VESA driver (#5436, Juliusz Chroboczek).
- 544. Add option to Radeon driver to allow minimum dot clock to be
- overridden (Bugzilla #831, Nils Philippsen).
- 543. Add shared libraries run-path information to pkg-config datafiles
- provided for some libraries. (Bugzilla #832, Frederick Bruckman,
- Matthieu Herrb).
- 542. Fix buglets detected by SGI compiler in neomagic, sis and tseng drivers
- (Marc La France).
- 541. Fix I/O alignment in mga and via drivers (Marc La France).
- 540. Improve xkbcomp's key types auto-recognition (Ivan Pascal).
- 539. Add support for multi-threaded direct GLX rendering with AppleDRI
- (John Harper).
- 538. Fix a problem in Xlib that was cause by the ANSI prototype cleanups
- (Bugzilla #839, Owen Taylor).
- 537. Limit the rate of duplicate audit messages in the X server. (Matthieu
- Herrb, David Dawes).
- 536. Fix ChipValidMode() return type (Marc La France).
- 535. Fix for AGP8x support on HP zx1-based systems (Marc La France).
- 534. Workaround for mysterious segfault related to mkfontscale's use of
- memcmp() (Marc La France).
- 533. Support the new Linear allocator in the trident driver and make the
- hardware cursor use it. Xv automagically uses it. (Alan Hourihane).
- 532. Fix acecad input driver build and re-enable it
- (Bugzilla #816, Alan Hourihane).
- 531. Fix DRM_CAS on ia64 as used by the DRI (Bugzilla #778, John Dennis).
- 530. Call OsCleanup() at the end of each server generation, and add an
- argument to indicate when the server is terminating. This allows
- misc end-of-generation cleanups to be added to OsCleanup() (David Dawes).
- 529. Explicitly free the DPMS and ScreenSaver timer resources at the end
- of each server generation (David Dawes).
- 528. Cygwin configuration updates and install script updates (Bugzilla #799,
- 805, Harold L Hunt II, Alexander Gottwald)
- 527. Build shared libraries for Xt and Xaw on Cygwin. (Bugzilla #804,
- Ralf Habacker).
- 526. Xterm patches #180, 181 (Thomas Dickey).
- 525. Update libfreetype-xtt2 to version 1.0d:
- - Fixed server crash caused by loading fonts for which encoding file
- does not exist.
- - Some fixes for minor bugs when handling errors.
- - Some minor cleanups.
- (Chisato Yamauchi, After X-TT Project).
- 524. Export strl{cat,cpy} functions to the server modules and provide
- an implementation for the systems that don't have them. (Matthieu
- Herrb).
- 523. Fixes and updates for XKB keyboard maps:
- - Update Serbian layouts (Bugzilla #92, Danilo Segan).
- - Add 'MS Windows like' US International variant for 'us' keymap (Ivan
- Pascal).
- - Change CapsLock default behavior to 'Caps acts as locking Shift,
- Shift cancels Caps'. Add new type for four-level keys (Ivan Pascal).
- 522. Fix generic rootless code bug which tests CopyWindow instead of CopyBytes
- (Kensuke Matsuzaki).
- 521. Update libfreetype-xtt2 to version 1.0c. This consists of some minor
- fixes and cleanups (Chisato Yamauchi, After X-TT Project).
- 520. Add accelerated rootless drawing support and fix bug in rootless
- FillSpans (Torrey T. Lyons and John Harper).
- 519. Update SiS driver:
- - Merge 661/741/760 support
- - Clean up
- - Fix Xv problems after swsuspend
- - Fix LCD-via-CRT1 on various machines
- 518. Prevent some compilers from optimising out Mesa's X11 error interface
- (Marc La France).
- 517. Add rules to generate post-processed and assembler source from C++ files
- (Marc La France).
- 516. Change `make World` so that well it interrupts itself to build a utility
- (makedepend, pswrap, etc), it only builds that utility. Some things were
- being built too early (Marc La France).
- 515. When the i830 driver's checks for sufficient memory for tiled mode
- fail, don't later try to allocate with tiling enabled (David Dawes).
- 514. Enable I845G_VBE_WORKAROUND in the i830 driver for all platforms, since
- this reportedly fixes VT switching problems on hardware other than the
- 845G.
- 513. Updated README.SiS (Thomas Winischhofer).
- 512. Add the After X-TT Project's libfreetype-xtt2 1.0b fixes and
- enhancements to the "freetype" module (Chisato Yamauchi,
- After X-TT Project). This should make it possible to deprecate the
- "xtt" module in a future release. Fixes and enhancements include:
- - Fixed crash caused by using fonts which have OS2 sfnt table.
- - Corrected metrics calculation error. Although the original code uses
- size->metrics, the FT_Size_Metrics does not have exact values when
- handling the outline. So the codes for metrics calculation were
- drastically rewritten.
- - Fixed some problems with FreeTypeRasteriseGlyph():
- + Made "only metrics is required" distinct from "both metrics and
- rasterised bitmap are required" to improve performance when
- loading large charset.
- + Fixed the erroneous usage of freetype2 API. To get valid metrics,
- FT_Outline_Get_BBox() or FT_Outline_Get_CBox() is used for outline.
- + Took the strange code for raster copying and rewrote it.
- - Fixed UNDERLINE_POSITION so that it counts downwards.
- - Fixed a risky calculational method for info->maxbound and
- info->minbound when spacing is not charcell. All glyphs' metrics are
- calculated and valid info->maxbounds and info->minbounds are set
- without cutting any corners.
- - Added TTCap option "fn","ai","ds","fs","vl","cr","bw","eb","hi",
- "fc" and "fm" which are compatible with X-TT 1.4.
- - Supported character width for vertical layouts.
- 511. Encoding file updates (After X-TT Project):
- - Removed jisx0208.1983-0.enc and added 'ALIAS jisx0208.1983-0' to
- jisx0208.1990-0.enc.
- - Added Windows ucs2 cmap(3,1) to jisx0208.1990-0.enc and
- jisx0201.1976-0.enc.
- - Added files for GB18030-0 and GB18030-1 (James Su).
- 510. Update X-TrueType (X-TT) to version 1.4.2 (Chisato Yamauchi,
- After X-TT Project):
- - Fixed several bugs of make_up_italic_bitmap() function.
- - Changed the order of priority of mapIDRelations in JISX0208 and
- JISX0201 code converter. The windows ucs2 is given the highest
- priority for kochi-substitute Japanese fonts.
- - Fixed code relation in cc_jisx0208_to_std_ucs2() function
- (not 0x215d -> 0x00b1 but 0x215d -> 0x2212)
- - Added minor improvements.
- 509. Fixes and updates for HTML and PDF versions of spec docs for
- installation and inclusion in the online docs (David Dawes).
- 508. Implement SharedLibtoolLibraryTarget, etc for bsdLib/ELF, including
- creating links for older but compatible revisions of such
- libraries (David Dawes).
- 507. Allow a simple form of option name aliasing for options handled
- via OptionInfoRec (David Dawes).
- 506. Add optimized code for RENDER with rootless XDarwin (John Harper,
- Torrey T. Lyons).
- 505. Declare LoadPalette, SetOverscan and DPMSSet as public functions through
- the XFree86's ScrnInfoRec, so these functions can be wrapped.
- (Alan Hourihane).
- 504. XDarwin improvements:
- - Add complete server side support for AppleWM with xpr.
- - Allow Aqua and X11 windows to interleave when AppleWM-aware window
- manager is present.
- - Fix hang on server reset.
- (Torrey T. Lyons, John Harper).
- 503. Fix double-free at server regeneration in the screensave/DPMS timer
- code (David Dawes).
- 502. Build most libraries as shared by default. (Matthieu Herrb,
- David Dawes).
- 501. Add missing symbol definition files for libraries (Matthieu Herrb).
- 500. Add 'inet' keymaps for two Logitec keyboard models (Bugzilla #762,
- Eric Mountain; Bugzilla #766, Chris Hornbaker) and cleanup Logitec
- keymaps (Ivan Pascal).
- 499. Add missing SetScreenSaverTimer() to ProcSetScreenSaver (Ivan Pascal).
- 498. Fix building on Mac OS X after DRI merge (Torrey T. Lyons).
-
-XFree86 4.3.99.14 (10 October 2003)
- 497. Add an xf86InitFBManagerLinear() function and implement the Linear
- allocation routines. These still fallback to XY area allocation if
- no (or the lack of) linear space is available. It assumes the driver
- has already called one of the init routines to the FBManager for Areas
- before this new setup can be used (Alan Hourihane).
- 496. Added USB keyboard support for Solaris/x86 platform (Bugzilla #352,
- Daniel Rock).
- 495. i830/i810 driver:
- * Added Christian Ziez's code to tweak BIOS image to convince chipset of
- resized video RAM.
- * Fixed viewport/video overlay window alignment issues.
- * Fixed calculation of video overlay memory size.
- * Fixed video overlay on TV out (Bugzilla #213). (Egbert Eich).
- 494. Fixed mode setting in trident driver: use mode passed in function
- argument, not value in currentMode (Bugzilla #197, Egbert Eich).
- 493. Added delay when writing to Glint PM2 ramdac to avoid lockups
- (Egbert Eich).
- 492. Fixed bug in Glint Bresenham line fallback code that caused line be drawn
- beyond framebuffer boundaries (Bugzilla #624, Egbert Eich).
- 490. Force sane pallette when entering DGA mode in Matrox driver
- (Egbert Eich).
- 489. ATI Rage128: Wait with modifying FP video mode according to BIOS values
- until final call of ValidMode() to prevent modes from being rejected
- (Bugzilla #661, Egbert Eich).
- 488. Some Savage BIOSes turn on clock doubling on non-doubled modes.
- Added code that catches and fixes this situation (Egbert Eich).
- 487. Tdfx driver: Fixed order of initialization/deinitialization in
- ScreenInit()/ CloseScreen().
- Fixed texture video support, removed artefacts in last line of overlay
- video support (Bugzilla #299). (Egbert Eich).
- 486. Add "automatic configuration" support for the XFree86 server, allowing
- it to be started in a useful way without an XF86Config file.
- - Add support to the config file parser for processing internally
- supplied configuration data.
- - Modify the algorithm for finding core input devices to maximise the
- likelihood that they will be found.
- - Add a FindDevice function to the OSMouse interface, allowing
- an OS-specific function to be called to find the mouse device when
- none is specified in the configuration. Implementations included for
- Linux and FreeBSD.
- - Add a GuessProtocol function to the OSMouse interface, allowing
- an OS-specific function to be called as a fallback when the mouse
- protocol can't otherwise be detected. Implementation included for
- Linux.
- - Bump the OSMouse interface version to 1.1 with the addition of the
- above two functions.
- - An interface for calling an external utility "getconfig" to generate
- some configuration data. Implementation of getconfig included.
- - Generate a default internal configuration, autodetecting as much
- as possible, with reasonable fallbacks.
- - Recognise "DefaultDepth" and "DefaultFbbpp" options in the Device
- section.
- - Add a "TargetRefreshRate" option to help prevent modes with too
- high a resolution (and poor refresh rate) being used as the default.
- - Use DDC-probed mode timings to estimate the monitor parameters when
- the DDC-probed information doesn't include a DS_RANGES property.
- This should improve the reliability of monitor auto-detection.
- (David Dawes, X-Oz Technologies).
- 485. Add functions for checking option values without marking them as "used"
- (David Dawes).
- 484. Add missing xf86ReplaceRealOption() function (David Dawes).
- 483. Added support for Siliconmotion Cougar3DR chip (Bugzilla #754,
- Chris Edgington).
- 482. Cygwin:
- * Added another German keyboard layout.
- * Added Japanese keyboard layout to the list of defaults as jp.
- * Added a new default keyboard layout for Portuguese (Brazil, ABNT2).
- * Print the layout number in hexadecimal.
- * Display the argument to the -query option in the window title.
- (Bugzilla #763, Alexander Gottwald)
- 481. Add processing for WM_WINDOWPOSCHANGED to cause window to repaint when
- using TweakUI's focus-follows-mouse behavior. (Bugzilla #763,
- Harold L Hunt II)
- 480. Added runtime detection of SHM support by checking the return value of
- shmget to the SHM and xf86BIGFONT extension to support SHM on Cygwin
- (Bugzilla #764, Harold L Hunt II).
- 479. Adding O_BINARY flag when opening an xkm file if this flag is defined
- (Bugzilla #768, Alexander Gottwald).
- 478. Radeon driver fixes (Hui Yu@ATI)
- - 9200 DVI fix and TMDS_PLL initialization for all chips
- - New chips support (9800XT/SE, 9600XT/SE, M11, T2/X2 etc.)
- - Cleanup unused/secondary chip ids
- - Autodetect PCI cards
- - Add BusType to override PCI card autodetect
- - Add display bandwidth calculation routine to fix flickering/tearing
- display problem
- - Workaround for corrupted BIOS image causing incorrect panel size
- - Fix the LCD table reading loop
- - Various small changes (including improving DDC reliability and
- CRTC_MORE_CNTL initialization)
- 477. Fix XAA Color8x8 cache bug:
- Pattern was expanded from source instead of destination
- (Thomas Winischhofer)
- 476. Fixes and updates for XKB keyboard maps:
- - Add 'United Kingdom w/deadkeys' gb(intl) keymap (Bugzilla #744,
- Phil Jones).
- - Add multi_layout compliant 'us_intl' keymap (Ivan Pascal).
- - Fix 'macintosh' geometry file (Bugzilla #753, Simon Vallet).
- 475. APM driver:
- . improved clock parameter calculation.
- . Fixed order of initialization of cursor.
- . Fixed restauration of graphical text mode.
- . Added YUY2 video format.
- . Corrected accel framebuffer pitches and max screen height
- (Bugzilla #528, Egbert Eich).
- 474. Moved DisableMMIO() out of the unmap() function, added call to
- EnableMMIO() to EnterVT() to work around lockup problems when
- switching between two Xserver (Bugzilla #748, Egbert Eich).
- 473. Fixed problem with text widget in Xaw when widget has a different
- depth than the default visual (Bugzilla #745, Wolfram Gloger).
- 472. Fixed Sig11 when calling X -query with no ipv6 support in kernel
- (Bugzilla #737, Egbert Eich).
- 471. Added support for Sparc64 and AMD64 on FreeBSD.
- This patch also disables warnings from system headers, fixes some elf
- relocations also relevant for other platforms and disables translation of
- KEY_SysReqest and KEY_Break on sparc64. (Bugzilla #739, Eric Anholt).
- 470. Switched VIA video driver to fillkey helper function (Bugzilla #525,
- Alan Cox).
- 469. Fixed CRT modes > FP panel size for siliconmotion (Bugzilla #727,
- Hugues Fournier).
- 468. Fixed xedit coredumps: update counter of free objects when getting an
- object from the list (Bugzilla #722, Egbert Eich).
- 467. Fixed definition of UseInstalledOnCrossCompile so that it never is
- undefined (Harlod L. Hunt II).
- 466. Add the 'b' flag to fopen() when opening binary xkm files. This is
- irrelevant for *nix OSes, but required for Cygwin. (Bugzilla #689,
- Harold L Hunt II).
- 465. Cygwin:
- * MultiWindow Mode: Automatically validate the size of windows that are
- being resized. (Earle F. Philhower III)
- * Safely shutdown the MultiWindow Mode and Clipboard Manager threads on
- server shutdown. (Earle F. Philhower III)
- * MultiWindow Mode - Fix a crash from a string copy bug.
- (Earle F. Philhower III)
- * Add lots of defaults for keyboardlayout. (Alexander Gottwald)
- * Add a system tha allows arbitrary commands to be added to the tray menu
- icon. (Earle F. Philhower III)
- * Print the name of the keyboardlayout to aid in adding more layouts.
- (Alexander Gottwald)
- * Stop printing the IDirectDrawSurface4_Blt() failure messages after 10
- times. (Harold L Hunt II)
- * Disable check for pc105 keyboard and just assume that it is present.
- This check was causing problems with certain keyboard drivers that
- failed to report that a pc105 keyboard was present.
- (Alexander Gottwald)
- * MultiWindow Mode - Add handling for WM_CHANGE_STATE IconicState
- messages;
- minimize the associated Windows window when these messages are
- received. (Harold L Hunt II).
- Submitted: (Bugzilla #704, Harold L. Hunt).
- 464. cygwin.cf:
- * removed BuildDPS flag.
- * Changed Alloca flag as Cygwin 1.5.x supports alloca, now.
- * Use external expat package by default.
- * Changed XawI18nDefines to utilize improved wide char support in
- Cygwin 1.5.x. (Bugzilla #699, Harold L. Hunt II).
- 463. Fixed C&T panel register setting (Akira Taniguchi, Egbert Eich).
- 462. Fixing crash on ia64 because of wrong setjmp buffer alignment (Bugzilla
- #596, John Dennis).
- 461. Changing ImPS/2 mouse Z-axis range to -8 to 7 (Bugzilla #691,
- Matthew W. S. Bell, Egbert Eich).
- 460. Making sure the compiled xkb config file is found by Xnest if
- ProjectRoot is modified (Bugzilla #688, Frank Giessler).
- 459. Fixing build of machine code .S files on OS/2 (Bugzilla #689,
- Frank Giessler).
- 458. Import Mesa 5.0.2 (Alan Hourihane).
- 457. DRI merge (DRI Project)
- * details to follow..........
- 456. Fixes and updates for XKB keyboard maps:
- - Update xkb geometry files (Alexander Pohoyda).
- - Fix German-Romanian maps (Manfred Pohler).
- - Cleanup Hungarian layout (Bugzilla #730, Egmont Koblinger).
- 455. Change the order of the timeouts processing and the input devices
- reading in WaitForSomething() which caused unneeded keyboard autorepat
- events (Ivan Pascal).
-
-XFree86 4.3.99.13 (25 September 2003)
- 454. Add support for chip ID 5964 (Radeon 9200 SE) to the radeon driver, and
- fix detection of IDs 5962 and 5963 with Driver "ati" (Bugzilla #732,
- Michel Daenzer)
- 453. Add gcc format checking for the X server's message and logging
- functions, and fix lots of associated warnings (David Dawes).
- 452. Replace the perl version of ucs2any with a C version ( Ben Collver and
- other NetBSD developers, Matthieu Herrb).
- 451. For drivers that support 'Option "dri"' have the driver request
- loading the dri module when this option is true. This brings
- it in to line with how other things are handled. Other drivers
- that have DRI support need to have the "dri" option added (David Dawes).
- 450. Fix libGL bug that could cause deadlock when switching contexts
- (John Harper).
- 449. Improve the contrast of the whiteglass xterm cursor, and fix the
- hotspot of the whiteglass right_ptr cursor and add transparency
- to it (#5867, René Rebe).
- 448. Fix a problem with the "pl2" (Polish qwertz) map where the order in
- which the Alt_R and Shift keys are pressed affects the results
- (Tom Pala).
- 447. In xdm, use better pseudo-random number generators to generate
- magic cookies. Add support for EGD and other compatible entropy
- gathering daemons. (Oswald Buddenhagen from KDE, Matthieu Herrb).
- 446. Fix IMPS/2 mouse wheel on platforms where char defaults to unsigned
- (Rene Rebe).
- 445. Fix rare xterm crash on Darwin due to dyld deadlock when a signal comes
- in while dyld is looking up a symbol (Rob Braun).
- 444. XDarwin cleanup and improvements:
- - Load bundle at runtime for chosen Quartz mode: xpr, cr, or fullscreen.
- - AppleWM extension has been generalized to work with any Quartz mode.
- Currently only the xpr implementation is complete.
- - Wrote a man page for AppleWM.
- - Moved hw/darwin/quartz/aqua* files that contained code to protect
- the alpha channel to miext/rootless/safeAlpha.
- (Torrey T. Lyons).
- 443. Remove lots of redundant redeclarations (David Dawes).
- 442. VIA driver:
- Fixed video memory detection. (Bugzilla #525, Alan Cox).
- Fixed TV and FP initialization problems (Bugzilla #525, Frederic Crozat,
- Alan Cox).
- Removed remaining globals (Egbert Eich).
- 441. Fixed memory leaks in the loader (Bugzilla #682 and #683, Juergen Keil).
- 440. Fixed erroneous freeing of DisplayModeRec in xf86DeleteMode() when
- deleting the modePool in xf86PruneDriverModes() the 'prev' member has
- a different meaning for modePool modes than for ScrnInfoPtr->modes modes
- where it creates a doubly linked list (Bugzilla #678, Juergen Keil).
- 439. Fixed SDK for VIA driver (Bugzilla #674, Bernhard Rosenkraenzer).
- 438. Extended list of monitor ranges and modes in xf86cfg (Egbert Eich).
-
-XFree86 4.3.99.12 (10 September 2003)
- 437. Move the X server log file handling from the XFree86 DDX to the DIX,
- allowing the more descriptive logging to be used throughout the server,
- and the log messages to be more uniform in formatting (David Dawes).
- 436. Added support for the Compaq Evo keyboard (Stanislav Brabec).
- 435. Fixed writes past end of array in via_bios.c (Bugzilla #662,
- Egbert Eich).
- 434. Let luit copy the termios settings from the calling terminal (Bugzilla
- #641, Juliusz Chroboczek).
- 433. Add _ADOBE_POSTSCRIPT_FONTNAME to the list of font properties xlsfonts
- that are atoms and should be converted to strings when run with the
- -ll flag. Also fixed the lenght problems that may arise (Bugzilla # 659,
- Alan Coopersmith).
- 432. Backing out 321.: sysMem gets initialized once during server lifetime
- (Egbert Eich).
- 431. Fixing X11.tmpl to set XFTINCLUDES after defining a non-standard path
- to fontconfig, adding FONTCONFIGINCLUDES to the build rules for fontconfig
- (Kevin P. Fleming).
- 430. Added support for the hp5181 inet keyboard (Bugzilla #648, Alan Strohm).
- 429. Added support for Apple Laptop keyboards, added level3/group switching to
- KP_Enter, modified layout so keyboards acts the same way as under Mac OS
- (Bugzilla #642, Frank Murphy).
- 428. Adding ANGKHANKHU (U+0E5A) character to level 3 of keycode <AD09> on
- th_tis keymap (Theppitak Karoonboonyanan).
- 427. Fixes and updates for XKB keyboard maps:
- - Add 'Romanian keymap for German keyboard' and 'Romanian keymap with
- access to German umlauts' (Manfred Pohler).
- - Update xfree86.dtd file (Sergey V. Oudaltsov).
- - Add an XkbOption that makes a keyboard map without special keysyms
- on Ctrl+Alt+smth for those who use such combinations for another
- purposes (Ivan Pascal).
- 426. Reverse patch #423 because it causes compile problems (Ivan Pascal).
- 425. Disable the bytecode interpreter by default in FreeType 1, bringing it
- into line with the default for FreeType 2. Document how to enable
- it in xf86site.def for those with no legal impediment to doing so
- (David Dawes).
- 424. Improvement of Xlib's keysym compose module:
- - Allow to figure out a mulibyte string if it is omitted in Compose file.
- - Add 'include' instruction with some substitutions.
- - Add a searching of Compose file as a value of XCOMPOSEFILE environment
- variable and as a $HOME/.XCompose file. (Ivan Pascal).
- 423. Add a writing of some Xserver XKB module error messages into a servers
- log file (Ivan Pascal).
- 422. Add Trident CyberBladeXP4 support, but acceleration is currently
- disabled. (Alan Hourihane).
- 421. Xinstall.sh updates to reduce its reliance on external utilities and
- provide better diagnostics when required external utilities don't exist.
- (David Dawes).
- 420. Fixes and updates for XKB keyboard maps:
- - Fix unneeded BKSL redefinition in Ukrainian 'winkeys' keyboard map
- (Andriy Rysin).
- - Fix some keycodes for jp106 keyboard model (Bugzilla #657,
- Stephen J. Turnbull).
- - Update xfree86.xml registry file (Andriy Rysin, Sergey V. Oudaltsov).
- 419. Add a missing xf86UnblockSIGIO() call to xf86InstallSIGIOHandler()
- (#5839, NetBSD PR xsrc/22668, Yorick Hardy).
- 418. Fix a problem with the "pl" map where the order in which the Alt_R and
- Shift keys are pressed affects the results (#5832, Tom Pala).
- 417. Fix the warning generated by the ONE_LEVEL <RALT> definition in
- the "level3" map (#5832, Tom Pala).
- 416. Remove the unnecessary dependence of RandR on RENDER (David Dawes).
- 415. Remove some static variables that should be per-screen (David Dawes).
- 414. SiS driver update:
- - Add 8x8 Color Pattern Fill (315/330 series)
- - Add transparency support for 8x8 Mono Pattern (300/315/330 series)
- - Fix Xv "insufficency" triggered by MPlayer (315 series)
- 413. Add missing REQUEST_SIZE_MATCH() to xSyncSetCounter protocol request
- (noticed by Ruben Nunez Francisco).
- 412. Allow building libOSMesa during non-XFree86 builds (Marc La France).
- 411. Rip out incorrect limits on the number of PCI buses an ix86 chipset can
- handle and implement an improved solution for avoiding "phantom" PCI
- buses (Marc La France, Bugzilla #604).
- 410. Fixes for potential integer overflows in font libraries. (blexim,
- Matthieu Herrb).
- 409. SiS driver: Add RENDER hardware acceleration
- 408. Add a Fopen() function to open the Xauthority file without spawning
- a shell (Bugzilla #255, Aidan Kehoe, Matthieu Herrb).
- 407. Fix a bug introduced with #397 that results in the core pointer and
- keyboard devices specified in a ServerLayout section being ignored
- (David Dawes).
- 406. Added big5hkscs encoding to font encoding files (Bugzilla #575,
- Jungshik Shin).
- 405. Don't call FBIOPAN_DISPLAY ioctl with arguments that will cause a
- confusing if harmless error; make an fbdevhw internal function static to
- fix a warning. (Michel Dänzer)
- 404. Passing correct virtual screen size to xf86ValidateModes() in VIA driver
- (Luc Verhaegen).
- 403. Added RGB overlays to i810 driver (Bugzilla# 625, Alastair M. Robinson).
- 402. Fixed mode switching and mode comparison for xf86VidMode extension for S3
- driver (Bugzilla #613, Alexey Baj, Egbert Eich).
- 401. Via driver: Fixed remaining globals, some formatting issues, out of
- memory handling in Xv overlay code and a couple of small glitches caused
- by the fixes (Bugzilla# 525, Alan Cox)
- Fixed some missing globals and static build (Egbert Eich).
- A handful globals still remain.
- 400. Update the Xserver(1), XFree86(1) and XF86Config(5) man pages to
- clarify how XFree86 configuration/run-time parameters are specified
- and their order of precedence (David Dawes).
-
-XFree86 4.3.99.11 (25 August 2003)
- 399. Try to make the state of libXfont more consistent. It shouldn't depend
- on whether a static or loadable XFree86 server is being built, so it
- now always has a dependency on the FreeType2 library (when FreeType
- support is enabled) (David Dawes).
- 398. Make the specification of a Monitor in the Screen sections of the
- XF86Config file optional. Some drivers may need changes (coming later)
- to maximise the utility of this (David Dawes).
- 397. When a core keyboard or core pointer cannot be found in the
- configuration, create default ones. The pointer part of this
- requires some changes to the mouse driver (coming later) before
- the default core pointer configuration will be useful on most
- platforms (David Dawes).
- 396. Add a facility for assigning version numbers to builtin XFree86 server
- interfaces and allowing modules to query them. Assign versions for
- the os-mouse and os-kbd interfaces (David Dawes).
- 395. Include uname(2) information in the server's banner messages
- (Marc La France).
- 394. Fix bug in detection of multi-function PCI devices (Marc La France, in
- partial resolution of Bugzilla #574).
- 393. Change the XFree86 server's global default depth to 16, and change most
- drivers that support the three common depths (8, 16, 24) to defer to
- the global default rather than specifying their own (David Dawes).
- 392. Fixed a crash when _XIMProtoOpenIM(), hich is called through XOpenIM()
- API when protocol IM is being set up, fails (Bugzilla #618,
- Hisashi MIYASHITA).
- 391. Fixed a possible source of Sig11 in Jamstudio driver (Bugzilla #617,
- Jonathan Hough, Egbert Eich).
- 390. Fixed building without RENDER support (Bugzilla #306, Matthieu Herrb,
- Egbert Eich).
- 389. Pass pointer obtained by Xalloc() to Xfree() not the one that may be
- manipulated in the mean time (Bugzilla #614, Alan Coopersmith).
- 388. Added reverse mapping of keysyms to keycodes (XKeysymToKeycode())
- to xev to detect situations where this maps to a different keycode than
- the one of the key pressed (Egbert Eich).
- 387. Made xauth called by startx quiet (Bugzilla #597, Stas Sergeev).
- 386. Added missing operand size override handling to PUSH imm8 in x86emu
- (Bugzilla #590, Boris Weissman).
- 385. Fixed compile glitch with NetBSD in xdm/genauth.c (Bugzilla #587,
- Nicolas JOLY)
- 384. Fix bugs in Xlib's EUC string converters that cause incorrect work of
- _Xmblen. Fix _Xmblen usage in imCallbk.c when Xlib is built with
- X_LOCALE (Etsushi Kato).
- 383. Update xev program for print the result of XmbLookupString call
- (Bugzilla #582, Noah Levitt, Ivan Pascal)
- 382. Fixes and updates for XKB keyboard maps:
- - Fix for Uzbek keyboard map (Bugzilla #595, Mashrab Kuvatov).
- - Fix for the problem with Alt+Tab combinations in some window mangers
- (Bugzilla #580,616): window chooser menu doesn't disappear after
- Alt key release (Egbert Eich, Ivan Pascal).
- 381. Allow a Display subsection with no depth or fbbpp specified to match
- any depth/fbbpp, and make Display subsections optional, creating one
- with default parameters when no suitable one can be found (David Dawes).
- 380. Include <sys/param.h> to get the BSD macro for luit (ITO Tsuyoshi).
- 379. DRM resync from the DRI trunk...
- - Lots of misc fixes/cleanups, and some resyncs with 2.4 and 2.6
- kernels.
- - Fix maplist entries being used after they were freed; thanks to
- Benjamin Herrenschmidt for tracking this down (Michel Daenzer).
- - FreeBSD updates (Eric Anholt).
- - Fail in DRM(agp_acquire) if the AGP aperture can't be used, such
- that the X server falls back to PCI GART or disables the DRI
- gracefully (Michel Daenzer).
- - Possibly fix stanford checker complaints about sarea for radeon
- (Keith Whitwell).
- - Restore i830 texture age waiting when swapping in new textures
- (Keith Whitwell).
- - Fix texture rectangle support for r100 (Keith Whitwell).
- - Add i810 add page flipping support to the DRM (Dave Airlie).
- - Merged DRM documentation (Jose Fonseca).
- - r128 MESA_ycbcr_texture (Ian Romanick, Leif Delgass).
- 378. Linux drm module build fixes for newish kernels from the DRI
- repository (Michel Daenzer, Linus Torvalds, Leif Delgass). This
- addresses Bugzilla #603, 605 (Calum Mackay).
- 377. Fix the test for 2.5.x with x < 52 Linux kernels for the drm module
- build (Bugzilla #601, Callum Mackay).
- 376. Fix an XAA pixmap cache server crash that can happen in some cases
- when the off-screen memory is heavily fragmented (David Dawes, based
- on #5752, Koike Kazuhiko, Chisato Yamauchi).
- 375. Fix for the Brazilian ABNT2 keyboard extra key that now translates to
- a different keycode value. Patch suggested by Ivan Pascal.
- 374. Fixed XDarwin fullscreen crash in some screen sizes (Torrey T. Lyons).
- 373. Be a little more precise about differentiating between active and
- inactive non-video PCI resources (Marc La France).
- 372. Added Apple-WM extension and library (John Harper, Torrey T. Lyons).
- 371. Fixed indirect GLX on Mac OS X when the client can not make a
- connection to the CoreGraphics window server (John Harper).
- 370. Fixed support for 64bit PCI bus on 32bit systems (Egbert Eich).
- 369. Added support for using aliases in the -nolisten option. '-nolisten tcp'
- aliases to IPv4 and IPv6 (Matthieu Herrb, Egbert Eich).
- 368. Added fallback Xlib transport layer if IPv6 socket cannot be openend
- (Egbert Eich).
- 367. Added missing symbol to the vbeSymbols table in i740 driver (Bugzilla
- #583, Egbert Eich).
- 366. Changed scripts containing 'head -1' which is not supported by
- POSIX 1003.1-2001 any more (Bugzilla #570, #569, Paul Eggert,
- Egbert Eich).
- 365. Changed POSIX 1003.1-2001 non-conformant 'sort +2' to 'sort -k 3' with
- backward compatibility (Bugzilla #568, Paul Eggert).
- 364. Add Microsoft Pro OEM model to XKB inet map (Bugzilla #458,
- maxim@wzzrd.com)
- 363. Extract the CHANGELOG's commit date and include it in the XFree86
- server log/version information (David Dawes).
- 362. Change the way xf86Build.h is created so that it doesn't cause its
- dependencies to be rebuilt when its contents are not changed
- (David Dawes).
-
-XFree86 4.3.99.10 (10 August 2003)
- 361. Fixes and updates for XKB keyboard maps:
- - Added numpad:microsoft XKB option (Bugzilla #558, Will Styles).
- - Fixed inconsistence in indicator names (Bugzilla #577, Noah Levitt).
- - Added type6 model of Sun keyboard (Warren Turkal).
- 360. Add UK (gb) layout to the dvorak XKB map (#5739, Mike Sulivan).
- 359. More work on the NativeGDI server for Cygwin/XFree86. The span routines
- are nearing completion (albeit they run slowly until the higher
- level X primitive functions are implemented). The obvious issue with
- the current code is the problems surrounding 1-bit DIBsections which
- have msb/lsb issues compared to the other types of DIBsections.
- This work was done quite some time ago in the Cygwin/XFree86 CVS.
- (Alan Hourihane).
- 358. SiS driver update:
- - Added pseudo-Xinerama extension for MergedFB mode
- - Fixes for Clevo L285/L287 (1024x768)
- 357. Include Xmd.h in Xpm/lib/XpmI.h to get definitions of LONG64
- (Bugzilla #562, John Dennis).
- 356. Moved Meta_L/R keys and added Super_L/R keys on macintosh keyboard.
- This makes the layout more compatible to the PC keyboard layout
- (Bugzilla #565, Frank Murphy).
- 355. Add check for Xmalloc() return value in XGetErrorDatabaseText() to avoid
- Sig11 (Bugzilla #563, Alan Coopersmith).
- 354. Separated build of libglx.a module and normal libglx.a library
- (Bugzilla #541, Frank Giessler).
- 353. Fixed build of Xnest, Xprt and Xvfb for OS/2 by linking with the linker
- definition files (Bugzilla #541, Frank Giessler).
- 352. Fixed freeing of properties form xkb_geomerty block (Bugzilla #550,
- Alexander Pohoyda).
- 351. Fixed string octal number parsing and string to int conversion for "\00"
- in xkbcomp (Bugzilla #553, Egbert Eich).
- 350. Removed stale definition from XftCompat.h (Bugzilla #543, Egbert Eich).
- 349. Added XLC_LOCALE file for zh_CN.UTF-8, moved iso10646 encoding to the end
- in ja_JP, ko_KR and zh_TW UTF-8 XLC_LOCALE files
- (Bugzilla #544, Akira TAGOH).
- 348. Fixed typo in #if conditional in cfb code (Bugzilla #556, Dave Love).
- 347. Fixed ValidMode() in C&T driver to work with option 'FixPanelSize'
- (Egbert Eich).
- 346. Fixed Meta_R key on us layout Macintosh keyboard (Bugzilla #539,
- Frank Murphy).
- 345. Add new charset sequence for CText at the end of list. This way the
- sequence of a charsets that were added earlier will be picked if two
- sequences for the same charset are registered (Bugzilla #228,
- Egbert Eich).
- 344. Use return value sysconf (_SC_OPEN_MAX) instead of the fixed number 256
- for allowed number of open files on POSIX.1 conformant systems
- (Egbert Eich).
- 343. Added missing exported functions in libfreetype to compile mkfontscale,
- made mkfontsdir script install on platforms that use extensions (Bugzilla
- 536, Frank Giessler).
- 342, Fixed a sig11 in Xaw that may appear on the rare condition that no font
- can be found (Bugzilla #482, Egbert Eich).
- 341. Added KP_Separator to symbols that can generate decimal() in xcalc
- (Egbert Eich).
- 340. Disabled Color8x8PatternFill() in savage driver (Egbert Eich).
- 339. Fixed a sig11 in twm when used with a session manager (Egbert Eich).
- 338. Fixed rounding of refresh rate in RandR, updated Xrandr man page
- (Bugzilla #527, Egbert Eich).
- 337. Added MenuBorderWidth and MenuBorderColor options to twm (Bugzilla #529,
- Alexander Pohoyda)
- 336. Update for VIA driver:
- - DGA no longer hangs (eg freedroidRPG now runs reliably)
- - Starting two copies of Xine no longer aborts the X server
- - Added support for KM400/K8M400
- - Improved video overlay support.
- - Fixed video overlay clipping when the image cliprects change but
- not the size.
- - TV tuner support via XV interface for two overlay ports.
- - DRI support (the client side library is not yet fully ported to 4.3).
- - Disable Xv in modes with insufficient bandwidth (1600c1200x16).
- - Updated documentation
- It differs from the base VIA codedrop.
- - Several of the fixes were done by me on top of it (the dual Xine fix,
- and bandwidth)
- - Various system types have been turned to CARD32 to make the code
- portable
- - The hybrid Video4Linux/XV glue was racy and has been removed
- (the XV layer is more than sufficient anyway)
- - DRI library client code is not included (porting not yet finished)
- - Additional debugging
- (Bugzilla #525, VIA, Alan Cox) .
- - Cleaning up namespace pollution, removing dependency on via_drm.h
- removing some global symbols from driver (Egbert Eich).
- Please note: there are more global symbols yet to be removed.
- 335. Remove the 'xc/xkbcomp/geometry/HP' directory from the CVS repository.
- 334. Substantial rewrite of the "nv" driver (Mark Vojkovich).
- 333. Resync with Cygwin/XFree86 changes up to Test92 (#5721, Harold Hunt and
- the Cygwin/XFree86 project).
- 332. Add a clean target for Cygwin's ResourceObjectRule() rule (#5720,
- Harold Hunt).
- 331. Fix xman's formatting/displaying of manual pages on Darwin, where
- 'groff' defaults to PostScript formatting (#5719, T. M. Pederson).
- 330. SiS driver update:
- - Fixed SiS 620 support
- - Added interface for sisctrl utility
- (Thomas Winischhofer)
- 329. Fixes for regressions in xauth and xhost with IPv6 code
- (Matthieu Herrb, Hideki ONO).
- 328. Update X-TrueType (X-TT) to version 1.4.1 (Chisato Yamauchi,
- After X-TT Project):
- - Extension of code converter modules for ARABIC, ARMSCII8,
- BIG5HKSCS, GB18030, ISO8859.*, etc. (Pablo Saratxaga, James Su)
- - Try to use TT_Load_Glyph_Bitmap() in get_metrics() when `bs'
- option is not set.
- - Use Embedded Bitmap with the option `eb=y' when Auto Italic is set.
- - Enhancements for `ds', `eb' and `bw' options.
- - New options for TTCap, `fc' and `fm': they enable the *extremely*
- fast loading of big Japanese or unicode fonts with `-p-' in the XLFD.
- - Performance improvement of FreeTypeGetMetrics() function.
- - Improved performance based on the solution to the buffer
- overflow problem, caused by exceeding the range of
- maxbounds.ascent/maxbounds.descent. This problem occurred only
- when `-m-' spacing was used.
- - Improved fix to crashes caused when certain fonts (e.g. verdana.ttf)
- are used; solution based on investigating the true nature of the
- problem.
- - Added patch for mktcapdir-0.5.4 and some ttfconf files suitable for
- X-TT 1.4.0.
- - Preparation for extending the encoding field of XLFD. X-TT permits
- the following additional XLFD format:
- "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.0"
- "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.1"
- The last number can be used to indicate the plane number of a huge
- character set.
- - Support for reverse `fc' specification. `fc=0xaa00-0xa0ff' means
- specifying the ranges 0x0000-0xa0ff and 0xaa00-0xffff. This is
- useful for GB18030 proportional fonts.
- - Improved fix for server crash that appears on Linux/PPC.
- - Added ksc5601.*-3 and ksx1001.*-3 to KSCJOHAB/main.c (Jungshik Shin).
- - Added U+20AC and U+00AE characters to KSCJOHABtoUCS2.c and
- KSC5601toUCS2.c (Jungshik Shin).
- - Fixed an X server crash when using LucidaSansRegular.ttf
- (reported by Koike Kazuhiko).
- - Improved fix to prevent NULL dereference when the font cache
- becomes full; solution by allocation of a dummy area for bitmap.
- - Fixed an X server crash because of an inconsistency problem between
- XFree86 and X-TT (reported by Koike Kazuhiko).
- - Numerous minor improvements.
-
-XFree86 4.3.99.9 (25 July 2003)
- 327. Add Mach64 I2C framework. Derived from GATOS project (Marc La France).
- 326. Removed ru_yawerty xkb symbols file as it is misleading as suggested
- by Ivan Pasacal (Bugzilla #516, Ivan Pascal).
- 325. Fixed two bounds errors in rman
- (Bugzilla #505, Dan Nelson, Bugzilla #506, Eric Anholt).
- 324. Cleaned up MMIO map/unmap in RADEONPreInit(), unmapped MMIO in
- CloseScreen() even when server is switched away (Bugzilla #504,
- Hui Yu, Egbert Eich).
- 323. Modified transport code so that a bind to an IPv4 socket fails silently
- when the bind to an IPv6 socket for the same port was successful.
- This works around a problem in theIPv6 implementation on some OSes
- that also handle IPv4 calls over IPv6 sockets (Egbert Eich).
- 322. Simplified handling of the -nolisten option as suggested by
- Alan Coopersmith. This option can now be issued multiple times.
- 321. Added code to unmap sysMem when freeing int10 (Bugzilla #504,
- Frank Giessler).
- 320. Fix generic rootless crash while resizing when CopyBytes is not defined
- by the implementation (Torrey T. Lyons).
- 319. Fix XDarwin Cocoa rootless crash when unshaping a shaped window
- (Torrey T. Lyons).
- 318. More IPv6 changes from Alan Coopersmith as follows:
- - Add support for IPv6 bracketed numeric addresses, similar to RFC 2732
- syntax to a number of areas.
- - Fix some issues with colon parsing and determining which addresses are
- DECnet (two colons between hostname and display number) and which are
- non-bracketed IPv6 numeric addresses ending in two colons, followed by
- another colon and the display number (three colons in a row).
- - Fix additional places Fabio forgot to change the string length when
- switching "inetv6" to "inet6".
- - Use MAXHOSTNAMELEN if it is defined for MAXHOSTNAME in xrdb. (Perhaps
- NI_MAXHOST should be used as well on platforms that support it.)
- - Make #include <sys/socket.h> in Xtrans.h look like the other places
- it's included in the tree, with checks for Lynx & Win32
- 317. IPv6: 2003.07.11 update to X.Org's response to comment #13; i.e.
- s/FamilyInternetV6/FamilyInternet6/g (Marc La France).
- 316. IPv6 build fixes for older Linux systems; Many of these are derived from
- a suggestion by Alan Coopersmith (Marc La France).
- 315. Change DEVID macro to work around glitch in SCO's C compiler
- (Marc La France).
- 314. Fixed Radeon driver so that clone modes survive server reset
- (Bugzilla #487, Egbert Eich).
- 313. Changed behavior of FreeType and Type1 renderer: when no encoding file
- is found fail with BadFontName instead of using an iso8859-1 encoding
- (Bugzilla #479, Roland Mainz, Juliusz Chroboczek, Egbert Eich).
- 312. Fixed screen switching problem on SCO where VT was off by one
- (Bugzilla #470, Kean Johnston).
- 311. S3 driver:
- . allow only specific displayWidths when acceleration is enabled
- . added double_scan support (Egbert Eich).
- 310. Removed build rules for hp Xserver that was recently removed from
- Xserver/Imakefile (Egbert Eich).
- 309. Fixes for C&T driver:
- . switch to SW mouse in doublescan modes.
- . centered video correctly for all interlaced modes (docs were
- misleading).
- . fixed README (Egbert Eich).
- 308. Fixed a typo in mkfontscale (Bugzilla #491, Juliusz Chroboczek).
- 307. A lot of X server prototype cleanups, including fixing an
- inconsistency between the cfbBitBlt and CopyPlane functions
- exposed by the prototyping (#A.1859, Alexander Stohr).
- 306. Fix missing newline in Message -> MessageF transition in dri_glx.c
- (#A.1833, Alexander Stohr).
- 305. Fill out the sunleo man page (#A.1783, Arnaud Quette).
- 304. Fix a typo in the XSetWMProtocols(3) man page (#5697, Alexander Pohoyda).
- 303. Fix for a few Xlib charset converters (Bruno Haible).
- 302. Fix calculation of CRTC2 frame offset with page flipping in radeon driver
- (Michel Daenzer)
- 301. Xinerama-fy the XTest extension (Rik Faith).
-
-XFree86 4.3.99.8 (10 July 2003)
- 300. X.Org IPv6 changes (Bugzilla #227, Alan Coopersmith, Marc La France).
- See http://www.x.org/IPV6_Specific_Changes.html for details. This has
- been further modified as follows.
- - Deal with small memory leaks in xdm & xauth.
- - Fix a number of compilation issues.
- - Where supported, use SIOCGLIFCONF to query network interfaces on more
- than only Solaris.
- - Incorporate X.Org responses to comments #'s 1, 2, 4, 5, 7, 10, 11, 12,
- 13, 14 and 15 (taken from an X.Org-internal document dated 2003.06.17).
- - Replace HasIPv6 imake symbol with BuildIPv6, defaulting it to YES, and
- build in IPv6 support whenever BuildIPv6 is asserted _and_ the OS
- #define's AF_INET6. This is to maximise IPv6 code exposure and
- eliminate <OS>.cf file changes to support IPv6.
- 299. On Solaris, don't allow remote root xdm logins if CONSOLE is set in
- /etc/default/login (Bugzilla #227, Alan Coopersmith).
- 298. Fix SEGV in fstobdf when font server is not specified and FSServerName()
- returns NULL (Bugzilla #227, Alan Coopersmith).
- 297. Fix XDMCP bug that could cause local host entries in /etc/X0.hosts to be
- lost (Bugzilla #227, Alan Coopersmith).
- 296. Make certain xtrans static variable volatile to avoid optimisation issues
- that occur when they are modified by SIGALRM handlers
- (Bugzilla #227, Alan Coopersmith).
- 295. Use %p instead of %x to print pointer values in xtrans debug messages to
- avoid overflow on platforms with 32-bit ints & 64-bit pointers
- (Bugzilla #227, Alan Coopersmith).
- 294. Change SUN-RPC code to use authdes_seccreate() call rather than the
- deprecated authdes_create() (Bugzilla #227, Alan Coopersmith).
- 293. Add xdm /dev/random handling for Solaris
- (Bugzilla #227, Alan Coopersmith).
- 292. Solaris compile fixes (Bugzilla #227, Alan Coopersmith).
- 291. Update X.Org version numbers to X11R6.6 or X11R6.7 and replace old
- references to X Consortium with X.Org (Bugzilla #227, Alan Coopersmith).
- 290. Update the usage of DRM AGP handles so that valid handles aren't
- mis-interpreted as invalid handles (based on Bugzilla #484, Dave Airlie).
- 289. Twisting fontfile.c and fontdir.c to be able to pass all fonts (bitmap
- and scaleable) to the scalable renderer as this one can deal with
- XLFD names (Bugzilla #475, Juliusz Chroboczek). PLEASE TEST!
- 288. Changing PS/2 mouse resolution to 8 counts/mm as some broken mice have
- problems with other values (W. uses 8) (Egbert Eich).
- 287. Fixing mode setting by BIOS. Wrong clock selection in MiscOut register
- caused screen to stay blank (Egbert Eich).
- 286. Added description for -dumpSched and -schedInterval to the usage
- message (Egbert Eich)
- 285. Update the SCO OpenServer port, fixing these specific problems:
- . Fixed the Imake template so i[3456]86 and friends arent defined
- . Fixed bad preprocessor stuff in X11.tmpl that was producing warnings
- . Updated default GCC flags to more aggresively optimize
- . Fixed keyboard LED handling
- . Enable SCO function keys in xterm
- . Make Delete key send DEL by default on SCO in xterm
- . Fix to make fonttosfnt compile (Bugzilla #470, Kean Johnston).
- 284. Added missing ro2 symbols file to list of files to install
- (Bugzilla #476, Egbert Eich).
- 283. Corrected precedence problem in test in xc/lib/X11/XKBUse.c:
- XkbUseExtension(). This avoids an extra round trip during application
- startup (Bugzilla #473, Owen Taylor).
- 282. Fixing deadlock in libXi - when is called _XLockDisplay() twice - when
- calling a Xi function that calls XGetExtensionVersion() (Bugzilla #260,
- Bastien Nocera, Owen Taylor).
- 281. Adding support for video modes <320x240 to S3 driver by changing the
- minimal clock frequency to 15.6 MHz (Bugzilla #472, Alexey Baj).
- 280. Made mkfontscale behavior and options compatible to mkfontdir, fixed
- bugs in output format (Bugzilla #425, Juliusz Chroboczek, Kean Johnston).
- 279. Changed xclock hands back to black (antialiased) , created XClk-col.ad
- to set colored hands instead, added missing documentation for missing
- resources. This follows the behavior of the other X applications more
- closely (Bugzilla #437, Joerg Wunsch).
- 278. Added support for Trio64UV+ and Trio64V2/DX/GX to S3 driver (backport
- from 3.x) (Bugzilla #465, Alexej Baj).
- 277. Increased Xlib default buffer size to 16k (was 2048), made size
- configurable thru environment variable XLIBBUFFERSIZE (minimum 2048)
- (Bugzilla #466, Roland Mainz).
- 276. Increased maximum BIGREQUEST size to 4Mb and made it configurable thru
- a command line option. This increases performance of certain
- applications considerably (Bugzilla #460, Roland Mainz).
- 275. VIA driver: initialized screen parameters in PreInit() instead of
- AccelInit() so that they are set even when acceleration is disabled
- (Egbert Eich).
- 274. Do not drop H&V sync during screen blanking for Radeon
- (Bugzilla #320, Michael Breuer, Hui Yu@ATI).
- 273. Let out-of-limit pixel clocks only use the frequency below pll output
- lower limit for Radeons (Bugzilla #262, John Vickers, Hui Yu@ATI).
- 272. Add support for Radeon cards with DAC/TMDS wire up in different ways
- from what the driver was originally programmed to; includes support
- for dual DVI cards (Hui Yu@ATI).
- 271. Add Radeon DPMS handling for flat panels (Bugzilla #26, Hui Yu@ATI).
- 270. Decreased the retry loops in DDC probing so that Radeon startup
- time won't be too long in the worst case (Hui Yu@ATI).
- 269. Fix Radeon Asic bug in RMX unit of IGP chips (Hui Yu@ATI).
- 268. Fix Radeon register initialization for RGB offset to fix the
- "milky-screen" problem (Bugzilla #351, Hui Yu@ATI).
- 267. Add support for new Radeon chips: R350(9800), RV350(9600,M10),
- RS250(IGP7000), RS300(IGP9000), RV280(9200) (Hui Yu@ATI).
- 266. Fix a lockup with the trident driver when stopping/starting Xv
- applications (Alan Hourihane).
- 265. Fix initialisation in xauth (Martin Birgmeier).
- 264. Calling RADEONSaveFPRegisters() regardless of display type to catch
- register restauration problems (Bugzilla #193, Hui Yu).
- 263. Fixed order of name and filename in encodings.dir files generated by
- mkfontscale (Roland Mainz).
- 262. Changed resource registration in TDFX driver: VGA mem resources
- are unused during OPERATING state, RAC isn't required for memory
- resources (Bugzilla #357, Egbert Eich).
- 261. Attempt to fix VIA driver lockups when moving windows:
- assumed bug compatibility to previous S3 products
- (Bugzilla #435, Egbert Eich).
- 260. Disabled mode writeback to client program from MGA driver (Egbert Eich).
- 259. #ifdef'ed variables in os-support/bsd in cases they are not needed
- (Bugzilla #430, Jason L. Wright).
- 258. Fixes and updates for XKB keyboard maps:
- - add Faroese keyboard map (Bugzilla #401, Roi a Torkilsheyggi)
- - add missing KPPT key to ABNT2 keycodes list (Bugzilla #431, Christian
- Tosta)
- - fix geometry/pc file (Alexander Pohoyda).
- 257. Don't sleep on Darwin for directory owner/mode problems (John Harper).
- 256. Limit 430TX and 430VX to 128 and 32 PCI buses respectively
- (Marc La France).
- 255. Add direct GLX rendering on Mac OS X and Apple-DRI extension
- (John Harper).
- 254. Replaced inline asms with compier intrinsics for Intel compiler
- (Bugzilla #427, Slava Sysoltsev).
- 253. Partly fixed build problems caused by mkfontdir replacement
- (Bugzilla #425, Egbert Eich).
- 252. SiS driver update:
- Fixed Xabre support
- (Final) fix for Compaq 3045US
- Customized timing for 848x480 parallel panels
- 251. Replaced mkfontdir by simple shell script that calls mkfontscale
- (see #233) (Bugzilla #388, Juliusz Chroboczek).
- 250. Added encoding files for Arabic (iso8859-6.16 and iso8859-6.8x)
- (Bugzilla #420, Roland Mainz).
- 249. Removed O_SYNC from open call for /dev/mem for all Linux platforms.
- This hopefully takes care of the speed problem
- (Bugzilla #419, #414, Egbert Eich).
- 248. Fixed fontstosfnt to build on OS/2 (Bugzilla #415, Frank Giessler
- Juliusz Chroboczek).
- 247. Fixed DMC touchscreen driver: button press events are properly
- recognized now, made sure device is still recognized after a restart,
- fixed misleading error messages (Bugzilla #418, Andreas Kies).
- 246. Added PanoramiX supprt for the RENDER requests: Trapezoids, Triangles,
- TriStrip, TriFan, SetPictureTransform and SetPictureFilter
- (Bugzilla #138, Egbert Eich).
- 245. Fixed SW/Theme cursor drawing glitches in i740 driver (Bugzilla #21,
- Egbert Eich).
- 244. Added input driver for Aiptek tablet (Bugzilla: #393, (list #5686),
- Bryan W. Headley).
-
-XFree86 4.3.99.7 (25 June 2003)
- 243. Added 'BitKeeper' to the directories that get excluded by lndir
- (Bugzilla #408, H.J.Lu).
- 242. Fixed gcc warnings in xdmauth.c (Bugzilla #410, Jason L. Wright).
- 241. Updated Citron touchscreen driver: set 'block duration time'
- to one second to avoid timeouts, added user strings to inform about
- HW version (Peter Kunzmann).
- 240. Fixed wraparound bug in TimerSet() (Peter Osterlund).
- 239. Fixed X*LookupString() in imDevLkup.c to return status
- XBufferOverflow and the required size as required
- (Bugzilla #397, Kusanagi Kouichi).
- Dto. for imLcLkup.c (Egbert Eich).
- 238. Removed unused function QualifyName, Exit() from Xprint
- and CountBits(), matchVisuals() from GLX
- (Bugzilla #395, #400, #394 Jason L. Wright).
- 237. Fixed type warning when building sunffb driver on 64bit
- (Bugzilla #404, Jason L. Wright).
- 236. Fixed warnings when building Palmex touchscreen driver statically
- (Bugzilla #405, Jason L. Wright).
- 235. Fixes and updates for XKB keyboard maps:
- - add programmers variant to the Turkish keyboard map (Nilgün Belma
- Bugüner)
- - add a variant of the Romanian keyboard map for German keyboard
- (Manfred Pohler)
- - add layout for BTC 9001AH keyboard (Nick Kurshev)
- - add Uzbek keymap description (Bugzilla #391, Mashrab Kuvatov)
- - update geometry files (Alexander Pohoyda)
- 234. Added fonttosfnt, a utility that generates bitmap-only TTFs. It is
- capable of reading most font formats (Bugzilla #389,
- Juliusz Chroboczek).
- 233. Added functionalities to mkfontscale so mkfontscale performs every
- functionality mkfontdir does (Bugzilla #387, Juliusz Chroboczek).
- 232. Removed absolute path from cpp for Linux as /usr/bin/ should be
- in the default search patch (Egbert Eich).
- 231. Fix regression of Xvideo not working with some videos on the
- CyberBladeXP/Ai1 chips (Bugzilla #251, Stephane Voltz).
- 230. Added early failure and warning message when not sufficient memory
- available for DRI in i8xx driver (Egbert Eich).
- 229. Fix bug in original patch which added support for two new relocation
- types for IA64 (Bugzilla #195, John Dennis).
- 228. Fix scaling calculus in savage driver (Bugzilla #274, Emmanuel).
- 227. Clarifying if conditions, fixing memory leaks in error path, removing
- useless code in savage driver (Bugzilla #278+279, Emmanuel).
- 226. Adding message to R128 driver which informs about modified modes for LCD
- according to VBIOS (Bugzilla #23, Egbert Eich).
- 225. Fixed chipset ID for v2100/v2200 for overrides (Egbert Eich).
- 224. Added interlaced support for Voodoo 3,4,5 to TDFX driver (Bugzilla #383,
- Jakub Bogusz).
- 223. Fixed typo in getPciBiosTypes() (Bugzilla #382, Jakub Bogusz).
- 222. Restore previous mode if mode switch fails (Bugzilla #381, Jakub Bogusz).
- 221. Fixed typo that prevented lubB19 fonts with different maps from being
- generated (Bugzilla #380, Jakub Bogusz).
- 220. Sync entrypoints for OS/2 with recent changes in fontconfig and Xft
- (Bugzilla #374, Frank Giessler).
- 219. Added detection of 2Mb memory for CLGD7548, fixed a possible memory
- leak and did minor cleanups (Bugzilla #369, Lucas Correia Villa Real).
- (PLEASE TEST!)
- 218. Recode single-byte keyboard scancodes that clash with recoded
- double-byte scancodes (David Dawes).
- 217. Fixes and updates for XKB keyboard maps:
- - add more EuroSign to "us_intl" keyboard map (Paul Bolle)
- - update geometry files (Alexander Pohoyda)
- - add AudioMute key to inet(hpxe3gc) (Bugzilla #350, Paul Pacheco)
- - add option for replacing RCtrl key with Right Alt (Bugzilla #343,
- Adam Tlalka)
- - add Uzbek keyboard map (Bugzilla #372, Mashrab Kuvatov)
- 216. (Re-)fix portability of gccmakedep and generate ccmakedep on all
- platforms (Marc La France).
- 215. Fix i810/i815 problem with interlaced modes where only the top half
- of the screen gets displayed (Paul Stewart).
- 214. Changed any occurance of x86_64 to AMD64, the official name of the
- architecture (Egbert Eich).
- 213. Removed Copyright sign from man pages as this causes some formatters
- to choke (Egbert Eich).
- 212. Export SysV IPC functions to modules in Net and OpenBSD
- (Bugzilla #355, Quentin Garnier).
- 211. Fix rootless bug when reordering windows behind others (Torrey T Lyons).
- 210. Fix page size issues that prevented the mmap()'ing of SBUS devices
- (Marc La France).
- 209. Fixes for the following problems on OS/2:
- - long startup delay of xinit
- - recovery from hard-error popups
- - text-mode version of xf86cfg
- - xf86cfg unable to find default config file
- - installation of static libraries
- - missing exported functions in X11.dll
- - typo in xf86pathIsAbsolute()
- (Bugzilla #267, Frank Giessler).
- 208. SiS driver update:
- Fixed 1280x960 and 1280x1024 LCD support (SiS 30x)
- Added Chroma-Keying support to Xv part
- Added support for Barco iQ R and G series projectors
-
-XFree86 4.3.99.6 (10 June 2003)
- 207. Add support for the Mac's KP_Equal key (untested) (David Dawes).
- 206. Import fontconfig 2.1.0 as an external package, and update the build
- to use this version (David Dawes).
- 205. New version of the FreeType backend. (Bugzilla #325, Juliusz Chroboczek).
- 204. Rework XDarwin's Cocoa rootless implementation to use new generic
- rootless code in miext/rootless (Torrey T. Lyons).
- 203. Fix repeated image problem when using a vesa video mode before starting
- the Xserver on the S3 Trio3D cards (Alan Hourihane).
- 202. Import zlib 1.1.4 for systems that don't provide it (Matthieu Herrb).
- 201. Improve fonts width and weight detection (Bugzilla #265-266,
- Juliusz Chroboczek).
- 200. Fix library dependencies for xlibi18n modules (Bugzilla #82, Joe Kelsey,
- Matthieu Herrb).
- 199. Fix manual pages typos (Bugzilla #316, Jens Schweikhardt).
- 198. Fix bug (Bugzilla #315) in _XTextPropertyToTextList() that causes
- an application crash in some circumstances (Ivan Pascal).
- 197. Fixes and updates for XKB keyboard maps:
- - add asciitilde to Swedish 'nodeadkeys' map (Bugzilla #291).
- - add map for true Romanian keyboard (Bugzilla #300, Manfred Pohler).
- - add EuroSign to "us_intl" keyboard map (Bugzilla #309, Paul Bolle).
- - fix some keys in Armenian 'phonetic' layout (Bugzilla #313, Ani).
- - add some geometry files (Alexander Pohoyda).
- - some cosmetic changes.
- 196. Import FreeType 2.1.4, and do initial merge for config/build
- (David Dawes).
- 195. Remove unnecessary links of libm (Marc La France).
- 194. IRIX 6.5 build fixes and noise reductions (Marc La France).
- 193. Clean up confusion in Imakefiles between XONLYLIB and XLIBONLY (and
- between DEPXONLYLIB and the previously non-existent DEPXLIBONLY)
- (Marc La France).
- 192. Do not unnecessarily link libXmu, libXt and/or libXext into executables
- (Marc La France).
- 191. Fix makedepend for IRIX 6.5 (Marc La France).
- 190. Make the handling of X_BYTE_ORDER in Imakefiles more portable
- (Marc La France).
- 189. Allow building of a libXfont without font cache support (Marc La France).
- 188. When using cpp to generate scripts and data files, change XCOMM to pound
- signs even when preceeded by only whitespace, and provide a means to
- generate output lines with trailing backslashes. Change `startx` script
- accordingly (Marc La France).
-
-XFree86 4.3.99.5 (25 May 2003)
- 187. Fix XDMCP queries in xdm on systems using getifaddrs().
- (Bugzilla #277, Joel Ray Holveck).
- 186. Initial imake/config support for more closely (and more
- automatically) emulating how libtool handles shared library revisions.
- Implmemented for Linux only so far (David Dawes).
- 185. Fix libexpat shared lib revision on platforms that use minor version
- numbers (David Dawes).
- 184. Update Tamil keyboard map (Thuraiappah Vaseeharan).
- 183. Add missing xfs reply to GetEventMask requests (Marc La France).
- 182. Change the ELF loader to ignore .debug* sections (Marc La France).
- 181. Simplify internal interfaces in the PCI code and remove the Xserver's
- interference with normal PCMCIA operation (Marc La France).
- 180. i810/815 depth buffer needs to be a multiple of the tile size. This
- fixes 3D corruption near the bottom of the screen at 800x600@16bpp
- (Bugzilla #283, Dave Airlie).
- 179. SiS driver update
- - Allow Modelines for LCD and secondary VGA on 301B
- - Support plasma panels natively (including a small
- database for some known panels since some panels
- report wrong timing data via DDC)
- 178. DRM resync from the DRI trunk...
- - Lots of fixes/cleanups/resyncs for the BSD DRM drivers (Eric Anholt).
- - Fix potential oops and memory leaks when allocations fail in
- addbufs_agp/pci (Leif Delgass).
- - Add support for buffer private structs with PCI DMA buffers
- (Leif Delgass).
- - Disable MTRRS on FreeBSD-stable (Eric Anholt).
- - Remove some unused code (Keith Whitwell).
- - Move prototypes for gamma functions to gamma_drv.h (Keith Whitwell).
- - 2.5.x resync (Linus Torvalds).
- - Ensure driver has been initialized before installing irq handler,
- and modify all drivers to ensure irq handler is removed before
- cleanup, and cleanup is called at takedown (Leif Delgass).
- - Check for lock on init/cleanup in all drivers except i810/i830
- (Leif Delgass).
- - Put back __HAVE_KERNEL_CTX_SWITCH for the sparc drm driver
- (Keith Whitwell).
- - Only free original pagelist in addbufs_pci if one already exists
- (fixes oops) (Leif Delgass).
- - texmem-0-0-1 branch merge (Ian Romanick).
- - Fix warning on machines where sizeof(drm_addr_t) != 4 (Randy Dunlap).
- - Support AGP bridges where the AGP aperture can't be accessed directly
- by the CPU (David Mosberger, Benjamin Herrenschmidt, Michel Daenzer,
- Paul Mackerras, Jeff Wiedemeier).
- 177. Fix another xedit compile problem (Marc La France).
- 176. Small fix for Italian keyboard map (Sebastiano Vigna).
- 175. Don't ship xf86Bus.h and xf86pciBus.h with the SDK (Marc La France).
- 174. Restore VGA driver's checking for depths 1, 4 & 8 (Marc La France).
- 173. Fix a problem with savage driver when UseBIOS is off, such that the
- performance drops dramatically. Now the performance matches or
- exceeds that of the option UseBIOS (Alan Hourihane).
- 172. Add workaround for problems that arise when in multi-layout map
- different modifier keysyms share the same key (Ivan Pascal).
- 171. Fix bug that causes XGetKeyboardMapping produce incorrect map when keys
- have more then two keysyms. Also add a map columns duplication for better
- compatibility with core protocol keyboard maps (Ivan Pascal).
- 170. Fix XKB bug (Bugzilla #253) that causes an Xserver crash when XKB action
- RedirectKey is used (Ivan Pascal).
- 169. Add missing letters to Ukrainian phonetic keyboard map (Andriy Rysin).
-
-XFree86 4.3.99.4 (10 May 2003)
- 168. Prevent a SIGFPE with the glint/pm3 driver when attempting to display
- an XVideo image less than 8 pixels wide (Måns Rullgård).
- 167. Support for building a DRI enabled server on OpenBSD (Wilbern Cobb,
- Matthieu Herrb).
- 166. Fix double free bug when a Mac-specific font fails to load with
- Freetype (Torrey T. Lyons).
- 165. Check for NULL tObj in the i830 3D driver's TexEnv function. This
- fixes a FlightGear crash (Keith Whitwell).
- 164. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers
- (Keith Whitwell).
- 163. Add an entry to the i2c module that drivers can call to retrieve an array
- of all I2C buses associated with a screen (Marc La France).
- 162. Fix to prevent PCI and CardBus resets when switching out of the server's
- virtual console (Marc La France).
- 161. Change the /dev/ file used on some *BSD's to mmap the framebuffer in DGA
- clients to match the /dev/ file used by the server (Marc La France).
- 160. SiS driver fixes:
- - Added MergedFB mode (including HWCursor and Xv)
- - Xv enhancements and fixes for all chipsets
- - New Xv properties (SWITCHCRT, TVPOSITION, etc)
- - Added support for custom LCD resolutions (via DDC)
- - Fixed DVI output (DVI-D and DVI-A), automatic detection
- - Numerous bugfixes and enhancements
- (Thomas Winischhofer)
- 159. Make freetype-config more useful on NetBSD (#5693, Thomas Klausner).
- 158. Small fixes in keyboard maps:
- - add an explicit type declaration in level3(ralt_switch)
- (Bugzilla #225, Séamus Ó Ciardhuáin);
- - fix wrong group number in Russian keyboard map (Ivan Pascal).
- 157. Add rootless implementation for XDarwin using Apple's Xplugin API
- (John Harper, Torrey T. Lyons).
- 156. Fix precision problems in xf86XVClipVideoHelper and in Mach64 XVideo
- support (Marc La France).
- 155. Add missing symbols when DRI is disabled to glint driver
- (Bugzilla #203, Mike Harris).
- 154. Fix a memory leak caused by the data allocated in XGetDefault() never
- being freed (Jim Radford).
- 153. Update keysym capitalization rules in XConvertCase() with unicode
- keysyms and some missed charsets (Bugzilla #209, Séamus Ó Ciardhuáin).
- 152. Use C89 style function prototypes in manual pages (Bugzilla #208,
- Aidan Kehoe).
- 151. Fix small memory leaks in XvQueryAdaptors() and __driUtilCreateScreen()
- (Jim Radford).
- 150. Updated Wacom driver to support ntuos 2 2D mouse and a few styli,
- TabletPC with ISD V4 protocol, intiq 15X and Cintiq 18SX
- (Wacom).
- 149. Fix programming error in ix86 motherboard chipset determination
- (Marc La France).
- 148. Ansi prototypes cleanup in Xserver/include and Xserver/os
- (Matthieu Herrb).
- 147. Fix shared libXp dependencies on *BSD and Darwin (Dale Rahn).
- 146. Fix infinite loop that occurs on systems whose PCI configuration space
- doesn't advertise a host bridge (Marc La France).
- 145. Workaround for broken devices that don't implement the header type field
- in their PCI configuration space (Marc La France).
- 144. Portability changes for older Sun compilers (Alan Coopersmith).
-
-XFree86 4.3.99.3 (25 April 2003)
- 143. Fix building of the dristat and drmstat utilities (David Dawes).
- 142. From the DRI trunk...
- - Remove more dead code from the BSD DRM (Eric Anholt).
- - Remove some #if 0'd code and unused string functions from the Linux
- DRM (Keith Whitwell).
- - Move debug versions of the DRM memory functions to a new file
- (Keith Whitwell).
- - drm_memory cleanup (Leif Delgass).
- - dristat and drmstat cleanups (Leif Delgass).
- - Remove unused dev->map_count (Leif Delgass).
- - For the i830 DRM driver, pass the dma handle from pci_alloc_consistent
- to the card for status page rather than using virt_to_bus on
- the virtual address (Leif Delgass).
- - Cleanup the style of the linux-compat code in the BSD DRM, and use
- ioctl directly rather than reimplementing it (Eric Anholt).
- 141. Remove old XF86Setup source code. (Matthieu Herrb).
- 140. Only add all default modes to mode list when RandR is enabled and
- active (Egbert Eich).
- 139. MGA driver: vertical blanking can generate interrupt (2D driver part)
- (Ville Syrjala Bugz.: 199).
- 138. Fix mmapw SEGV (Marc La France).
- 137. From the DRI trunk...
- - Install dummy/noop read & poll fops unless the driver has
- replacements (Keith Whitwell).
- - Remove gamma-specific stuff from the BSD DRM (Eric Anholt).
- - Remove DRM_DMA_HISTOGRAM and associated code from the BSD DRM
- (Eric Anholt).
- - Remove BSD DRM's unused drm_init.h (Eric Anholt).
- - Handle read() failures in the drm X server module (Michel Daenzer).
- - Set DRM device major for NetBSD.
- 136. Fix bug that prevented fbman from using the last partial scanline of a
- Mach64 framebuffer (Marc La France).
- 135. Make ATI Mach64 FIFO cache integrity testing optional (Marc La France).
- 134. Export ATI Mach64 hardware overlay as an XVideo adaptor (derived from
- GATOS project, Egbert Eich, Marc La France).
- 133. Reorganise ATI Mach64 support into separate source files
- (Marc La France).
- 132. Refine atimisc's decoding of the panel mode on server entry in an attempt
- to reduce the effect of atyfb bugs (Marc La France).
- 131. Make Rage128 and Radeon XVideo available even when 2D acceleration is
- disabled (Marc La France).
- 130. There is no longer any need to require hardware cursors during Rage128
- and Radeon XVideo displays (Marc La France).
- 129. Initialise v4l's XVideo adaptors last (Marc La France).
- 128. Reduce cut&paste effects by adding more helpers to Xv
- (derived from #5645, Björn Augustsson, Marc La France).
- 127. Centralise a region comparison primitive into 'mi' and use it instead of
- local definitions throughout the server (Marc La France).
- 126. DPMSExtension & XvExtension driver cleanups (Marc La France).
- 125. Add missing tests for vtSema to xaa 'Picture' functions.
- These missing checks caused strange behavior with some drivers
- when RENDER extension requests were made while X was switched away.
- (Egbert Eich).
- 124. i810 driver: call drmCtlUninstHandler() on CloseScreen()
- (David Airlie).
- 123. Savage driver updated to 1.1.1.27: several fixes for video glitches
- (Tim Roberts).
- 122. Put back the DRM part of Charl Botha's Radeon suspend/resume support
- that was inadvertently backed out in the DRI resync last week.
- 121. Resync the Linux drm modules with the DRI trunk. Includes:
- - Check for NULL map before calling DRM(ioremapfree) on cleanup
- (Leif Delgass).
- - Remove DRM read, poll and write_string (Keith Whitwell).
- - Add more get_param queries for embedded project (Keith Whitwell).
- - Move a bunch of gamma-specific code into a gamma-specific file,
- and restore the kooky DRM(write_string) code for gamma
- (Keith Whitwell).
- - Remove unused DMA histogram code (Keith Whitwell).
- - Remove unused 'DRM_FLAG_NOCTX' option (Keith Whitwell).
- - Remove unused __HAVE_KERNEL_CTX_SWITCH code (Keith Whitwell).
- - Fix templates so the i8x0 drivers don't have to define
- __HAVE_DMA_WAITLIST (Keith Whitwell).
- - Gamma drm updates (Alan Hourihane).
- - Only mga, i810, i830 require AGP (Leif Delgass).
- - Remove PCIGART_ENABLED define for radeon, pcigart support now
- included for any arch (Leif Delgass).
- - Get rid of superfluous fields in struct drm_radeon_ring_buffer
- (Michel Daenzer).
- - Use correct address for radeon ring read pointer writeback
- (Michel Daenzer).
- 120. Fix a potential bug in ZX1 support (Marc La France).
- 119. Fix a buffer overflow in xkbprint (Ivan Pascal).
- 118. Fix a bug in Xlib that prevents a vertical text drawing with
- X[mb|wc]DrawString (bugzilla #178, OSAME Ken-ichiro).
- 117. Added missing files to the SDK so it can actually be used (Sven Luther).
- 116. mkfontscale enhancements (bugzilla #166, Julius Chroboczek).
- 115. Fix handling of local host names in /etc/X<n>.hosts (bugzilla #156,
- Alan Coopersmith).
- 114. Add to XLookupString an automatic search of the layout which keysym can
- be converted to a control-code when Control modifier is set (Ivan Pascal).
- 113. Fix xkbcomp crash with some combinations of layouts in a multi-layout
- keyboard map (Ivan Pascal).
- 112. Keyboard maps cleanups, including:
- - fix incorrect aliases in a keycodes file.
- - remove unneeded type declarations.
- - remove ThirdLevel modifier key descriptions in maps and replace them
- with references to a common one in 'level3' file.
- - some cosmetic changes.
- (Ivan Pascal).
- 111. Fix some function definition conflicts from Xlib cleanup when X_LOCALE
- or NeedWidePrototypes is set (Torrey T. Lyons).
- 110. Resync the BSD drm modules with the DRI trunk (Eric Anholt).
- 109. Resync the Linux drm modules with the DRI trunk. Includes:
- - Add 2nd arg for DRM_FREE (Keith Whitwell).
- - Use file pointers instead of pids for resource and lock tracking
- (Keith Whitwell).
- - Add 'SG' map type identifier string ((pci scatter/gather) to /proc vm
- info (Leif Delgass).
- - Use list_entry() to get container struct from struct list_head
- pointers. Build fix for RedHat 9 kernel (5 args to
- remap_page_range()) (Leif Delgass).
- 108. Fix a server crash with shadowfb and render when refreshing outside the
- visible screen (Sven Luther).
- 107. Fix a potential infinite loop during server generation when in
- Xinerama (Rik Faith).
- 106. Fix DRM module build on 2.5.41 and later kernels (tqueue -> workqueue)
- (David Dawes).
- 105. Fix lockup when using Xv in the trident driver (Alan Hourihane).
- 104. Add support for TV chipsets VT1621 and CH7005 to the trident driver
- (VIA, Alan Hourihane).
- 103. Add VIA CLE266 driver (Bugzilla #154, VIA/S3)
- 102. Remove non-functioning glxStub, and remove external GlxStaticServerLib
- support (David Dawes).
- 101. Change the WORLDOPTS default to empty. This means that 'make World'
- will now stop on the first error. To get the old behaviour, run
- 'make WORLDOPTS=-k World' (David Dawes).
- 100. Add preliminary version of generic rootless code based on XDarwin's
- rootless mode (Torrey T. Lyons, John Harper).
- 99. Remove PEX and XIE source code (Matthieu Herrb).
- 98. The XKB version of XRefreshKeyboardMapping() had an UnlockDisplay()
- call without a preceding LockDisplay() call (Yoel Perl).
- 97. Xlib cleanups and fixes, including:
- - Fixed up any old style function defintions that raised warnings.
- - Fixed functions with no parameter or return value.
- - Moved any external prototype in a c-files to h-files.
- - Set unreferenced and unmentioned functions to static.
- - Completed any forward declartion with its calling parameters.
- - Established function typedefs where might be helpful.
- - Fixed bogus XIM callback function to XID type, fixed XPointer* -
- XPointer mismatch on some callback.
- - Added explicit FIXME XXX statement on locations for the work around
- macro XCMS_CONVERSION_HARDWARE where the compiler was unsatisfied
- about a known problem with the currently inconsistent src_to_CIEXYZ
- table types.
- - Split _XcmsSetGetColor and *Colors handling routine in order
- to avoid any type conflicts there, fixed a memory leak for
- error case in that area. Used stack based Buffer for single-color
- version (should be simpler and faster).
- - Fixed _XAsyncReply where a "register variable pend" was passed
- and returned with the & operator. This location is further
- suspect of variable size problems on anything else but 32 bit
- platforms, with the new code it might more likely raise a type
- mismatch warning for those specific location.
- (#A.1729, Alexander Stohr).
- 96. Fix the <KPDL> mapping for the hr XKB map, and add an hr_US map (#A.1726,
- Vlatko Kosturjak).
- 95. Fix vmware driver crash when running two X servers concurrently (#5688,
- Nolan Leake).
- 94. Rework the Linux drm kernel module build to leverage off the standard
- kernel build system. This is based on suggestions and examples from
- David Woodhouse. This approach has the advantage that the build
- requirements of a wider range of standard kernels are now supported
- transparently, but the disadvantage of some extra complexity to handle
- building against clean vendor-distributed kernel source trees.
- This has been tested with some recent Red Hat and SuSE distributions
- (David Dawes).
- 93. Update Italian keyboard map (Bugzilla #109, Sebastiano Vigna).
- 92. Add keys missed in multi-layout keyboard maps: LSGT key in Belgian map
- and 'old','phonetic' variants in Armenian map (Ivan Pascal).
- 91. More reliable workaround for handling the I830Sync() function being
- called while VT switched away (David Dawes).
- 90. Fix references to DRI functions in non-DRI i810_driver.c build
- (David Dawes).
- 89. Import expat 1.95.4 (Matthieu Herrb).
-
-XFree86 4.3.99.2 (10 April 2003)
- 88. Fix file descriptor leaks in xman (Ted Unangst, OpenBSD PR#3186).
- 87. Fix bug in mode validation that occurs when the XF86Config doesn't
- specify any mode or virtual resolution information (Marc La France).
- 86. Resetting 'bound' flag for an agp entry after undbind succeeded in
- drm_agpsupport.h (Egbert Eich).
- 85. Ignoring hw_lock for drm device if lock was set by a different instance
- (ie Xserver) to prevent second server to spin in driver release function
- (currently only relevant for i8xx drm drivers) (David Dawes).
- 84. Adding extra delay before doing a slowBcopy in ia64 to prevent a MC
- when saving/restoring VGA fonts (Egbert Eich).
- 83. Turn off needToSync in LeaveVT() in i830 driver to prevent server
- crashes because xaa tries to sync blitter while switched away
- (Egbert Eich).
- 82. Added the O_SYNC flag when opening /dev/mem to work around a kernel bug
- which causes conflits between WC settings in MTRR registers and cacheable
- attribute in page table (Egbert Eich).
- 81. Reduced retry count for mouse configuration to 4. This should speed
- up server start for people who use a mouse repeater like gpm
- (Egbert Eich).
- 80. Fixed xf86cfg to duplicate font names before they get freed when
- unloading the module (Egbert Eich).
- 79. Added missing functions to xf86cfg (Egbert Eich).
- 78. Added missing ROP_NEEDS_SOURCE to Savage driver;
- now all 2D accel functions should use this flag (Egbert Eich).
- 77. Reduced flicker with video playback in Savage driver (Tim Roberts).
- 76. Load vgahw submodule in RENDITION driver before using it
- (Egbert Eich).
- 75. Magically speed up video playback on Neomagic (Egbert Eich).
- 74. Added drmAgpUnbind()/drmAgpBind() functionality on Leave/Enter for i810
- cards to allow a second Xserver to be started if the first one has
- DRI enabled (Egbert Eich).
- 73. Set NeedRingBufferLow for i855/i865 to avoid lockups on vt switches
- (Egbert Eich).
- 72. Check for vtSema before accessing registers in I830BIOSSaveScreen()
- (Egbert Eich).
- 71. Some sanity fixes for atiprobe to work better with xf86cfg: Handle
- situation gracefully if the PCI config pointer doesn't exist
- (Egbert Eich).
- 70. Changed behavior of fontfile: don't drop the entire directory if some
- fonts cannot be rendered (Egbert Eich).
- 69. Fixed B&H bdf fonts: AVERAGE_WIDTH is not a string but an int (Mike Fabian).
- 68. Fixed type in radeon driver which caused display to go into
- powersaving mode when Xcursor is disabled (Bugz: 90, Michel Dänzer).
- 67. Fixed typo in XKB-Config.sgml (Bugz: 53, Hiroyuki Bessho).
- 66. Fix SiliconMotion driver for mode switching and SEGV problem when
- initializing Xv functionality (Bugzilla #50, Alan Hourihane).
- 65. Add Radeon DRI suspend/resume support (Charl Botha, #A.1431).
- 64. Rage 128 Xv fix for high resolution displays (Rik Faith).
- 63. PPC updates for Radeon (Michel Dänzer, Hui Yu@ATI).
- 62. Radeon patch from ATI (Hui Yu@ATI).
- - IGP320/330/340 support (2D only)
- - RV280 (9200/M9+) support
- - Fix for some M9 laptop panels
- - Improved version of monitor detection code previously submitted
- - Fixed bug for two or more radeon cards
- - Man page updates
- - Workaround for double scan modes problem at high resolutions
- - Overlay scaling problem when RMX is used
- 61. Fix xprop to get all windows (not only the first) in a property holding
- a window list printed (#A.1676, Kim Woelders).
- 60. Fix for spontaneous repeated keyboard events during sync grab (#A.1713,
- Michal Maruska).
- 59. Fixed DPMS problem on C&T 69000 due to incorrect LCD flag
- (Bugzilla #101, Egbert Eich).
- 58. Added xkb symbols layout for BTC 5090 internet keyboard
- (Bugzilla #57, Jack Angel).
- 57. Fix the Xinstall.sh script so that it can handle being run from a
- directory with white space in its path name (#A.1690, Eric Branlund).
- 56. Allow AGPGART support to be enabled for OpenBSD (#A.1684, Brian Feldman).
- 55. Make the mouse driver check the SendDragEvents option (based on #A.1682,
- Juuso Åberg).
- 54. Fix a double allocation in _XTextPropertyToTextList() (#A.1681,
- Lubos Lunak).
- 53. Fix a typo that causes the 'yu' keymap to emit a lower case 'L' in
- both shift states (#A.1675, Nikola Smolenski).
- 52. Allow the remote shell command for xon to be specified from the
- command line. This allows ssh to be used (for example) (#A.1657,
- Mike Urban).
- 51. Fix segfaults that can happen when using composition of RENDER and
- non-RENDER fonts (#A.1656, Wu Jian Feng).
- 50. Add convenient ways to enter "double quote" and "cedilla" with the
- en_US.UTF-8 compose rules (Alexandre Oliva).
- 49. Improve support for Wacom Cintiq boards (#A.1547, Sebastian Rittau).
- 48. Add support for Kensington's "ValuMouse" to the mouse driver (#A.1494,
- Roy Wood).
- 47. Workaround for a crash that happens if a scalable font has a bitmap
- entry in fonts.dir (#5687, Juliusz Chroboczek).
- 46. Single/dual rasterizer quiescence patch for the glint/gamma DRI driver
- (#5685, Sven Luther).
- 45. Fix a FreeBSD/alpha build problem (#5679, Fred Clift).
- 44. Fix a bug in the GLU/project.3gl man page (#5676, Thomas Klausner).
- 43. Luit fixes:
- - Fix a buffer overflow.
- - Allow for holes in the pty space, and use the union of the pty
- names in 4.4BSD and recent FreeBSD.
- - Allow luit to be set-uid on all BSD releases, and introduce an
- additional security fix on POSIX saved-id systems.
- (#5672, 5674, ITO Tsuyoshi, Juliusz Chroboczek).
- 42. Fix memory leaks in ProcXF86VidModeModModeLine and
- ProcXF86VidModeValidateModeLine, and unintialized fields of the mode
- structure in ProcXF86VidModeAddModeLine, VidModeCreateMode, and
- VidModeAddModeline (#5671, Miguel Freitas).
- 41. Fix SEGV in fbdev's mode validation (Alexandr Andreev).
- 40. Add two more variations of Thai XKB maps (#5658,
- Theppitak Karoonboonyanan, Visanu Euarchukiati,
- Supphachoke Santiwichaya).
- 39. Fix a twm crash when the window menu is used and no windows are open
- (#5667, Matthias Scheler).
- 38. Restore the sign of UNDERLINE_POSITION in the FreeType backend (#5665,
- Roman Kagan).
- 37. Check the return value of fclose() in xauth to prevent losing the
- existing contents of an Xauthority file when there is insufficient
- space to write the new one (#5663, Owen Taylor).
- 36. Fix case in xmag which would cause a BadMatch during a X_GetImage for
- single child of root class InputOnly. Also do some null pointer
- protection (#5657, Kevin Brosius).
- 35. Allow an arbitary message to be sent to the DDX by pressing a key
- which has the appropriate action definition (#5519, Joe Moss).
- 34. Add a new request to the XF86Misc extension that allows a client
- to send an arbitrary message to the DDX, which in turn can send the
- message to the driver. The driver may also send a string back.
- An example of this is implemented for the radeon driver (#5518,
- Joe Moss).
- 33. Remove duplicate XShmGetEventBase() declaration (#5656,
- Branden Robinson).
- 32. Fix drag lock when using a mouse button greater than 4
- (Bugzilla #51, Paul Elliott)
- 31. Fix lockup on server shutdown/restart with the radeon driver
- (Bugzilla #94, Michel Dänzer).
- 30. Add missing symbols to reference list that show up when DRI is not
- loaded in r128 driver (Bugzilla #83, Leif Delgass).
- 29. Add missing symbols to reference list that show up when DRI is not
- loaded in mga driver (Bugzilla #84, Leif Delgass).
- 28. Various build and warning fixes (#A.1703, Peter Breitenlohner).
- 27. Avoid overlapping strcpy() in imake.c (Dan Nelson).
- 26. Updates for building on OS/2 (#5650, Frank Giessler).
-
-XFree86 4.3.99.1 (23 March 2003)
- 25. Xterm patch #176 (Thomas Dickey).
- 24. Another int10 fix. This time for adapters found at PCI:0:0:0. This
- fix is particularly important for ZX1-based systems (Marc La France).
- 23. int10 fix for all ix86 non-Linux systems (Marc La France).
- 22. Add preliminary support for generating HTML and PDF versions of most
- spec documents (David Dawes).
- 21. Use lower-case extensions uniformly for text and PostScript documents
- (based on #4876, Branden Robinson).
- 20. Disable cuase of SEGV's in rendition driver (Marc La France).
- 18. Limit 440EX & 440LX based systems to 32 PCI buses (Marc La France).
- 18. Fix typo that caused incorrect initialization of xkb memory
- (John Heasley).
- 17. Fix bug in trident driver that caused old Cyber 9382/9385 chipsets
- to display half a jittered screen (Alan Hourihane).
- 16. Add shadowfb support to XDarwin IOKit mode (Torrey T. Lyons).
- 15. Change most of os-support/ to respect VIDMEM_READONLY (Marc La France).
- 14. Fix compatibility problem between modules generated without the recent
- setjmp/longjmp work and a server generated using glibc <= 2.2.*
- (Marc La France).
- 13. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France).
- 12. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb).
- 11. Various NetBSD fixes for non-i386 (#5662, #5666 Aymeric Vincent,
- Matthew Green, Chris Gilbert, Thomas Klausner).
- 10. Enable native thread support on NetBSD 1.6M and later (#5597, #5660,
- Matthias Scheler).
- 9. Make setjmp/longjmp emulation save/restore blocked signal masks on all
- libc5 & glibc systems (Marc La France).
- 8. Fix for non-PC keyboard bug introduced by changes to make SysRq
- generate the same keycode as PrtScrn (Ivan Pascal).
- 7. Workaround for problems linking C programs against libGLU on FreeBSD 3.x
- (David Dawes).
- 6. Make setjmp/longjmp emulation save/restore blocked signal masks on all
- 5. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove
- HasGlibc21Sigsetjmp override (Marc La France).
- 4. setjmp/longjmp-related compilation fixes for libc5 systems
- (Marc La France).
- 3. Fix minor glitch in the generation of Makefiles for libraries that don't
- need threads support (Marc La France).
- 2. Fix XDarwin build broken by #960 (Shantonu Sen).
- 1. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun).
-
-XFree86 4.3.0 (27 February 2003)
- 964. Add an imake option to allow the glibc21-style setjmp() behaviour
- to be forced when auto-detecting it fails (this is needed for RH 7.0).
- 963. Add missing raise/lower volume key descriptions for the "hpxe3gc"
- XKB map (#A.1651, Paul Pacheco).
- 962. Fix some typos in the Syriac XKB map (#5654, Emil Soleyman-Zomalan).
- 961. Add documentation about using XKB for the XFree86 server's special
- key sequences and the HandleSpecialKeys config option (#5653, Joe Moss).
- 960. Move the XF86_DATE definition to a separate file so that bumping it
- doesn't trigger almost everything to be rebuilt (David Dawes).
- 959. Xterm patch #174 (Thomas Dickey).
- 958. Fix a bug that was preventing DGA2 acceleration from being advertised
- by the i810 driver (David Dawes).
- 957. Fix an "xtt" font backend module crash that shows up on Linux/PPC,
- related to an invalid code converter module being loaded because of
- a broken string comparison in xttconv.c (#A.1647, Chisato Yamauchi,
- Daisuke MASATSUNA).
- 956. Fix a NULL dereference that can happen in lcGenConv.c (#A.1646,
- Anthony Fok Tung-Ling).
- 955. Bump the libXft minor revision for the UTF-16 APIs that were added
- after rev 2.0 (#A.1643, A.1644, Keith Packard, 5652, Mike Harris).
- 954. Fix a typo in the "freetype" font backend that prevents "ttc" fonts
- from working (#5651, Mike Fabian).
- 953. Fix atimisc bug in restoring colourmaps after a VT switch
- (Marc La France).
- 952. A more complete set of dead accent/space compose sequences, add
- <Multi_key> <slash> for letters with a "stroke", and add some
- combos for exponent characters, katakana voiced sounds, etc to
- the en_US.UTF-8 compose file (#5646, David Monniaux).
- 951. Reinstate the VBEInit() call in the savage driver's PreInit(). This
- appears to fix a problem on some Savage MX platforms (#5649,
- Mike Harris).
- 950. Restore the radeon driver's unconditional RADEONPreInt10Save() call
- on Alpha platforms because this is needed for Radeon cards where the
- BIOS ROM can't be read after it's been run once (by the firmware)
- without this (#5648, Jeff Wiedemeier).
- 949. Update Newport driver doc (#5647, Guido Guenther).
- 948. Fix reversed logic for VGA locking/unlocking (Nat Ersoz).
- 947. Luit fixes:
- - Fix a bug with --encoding being too strict with the syntax.
- - Add a -x flag that causes luit to exit as soon as the child does.
- - Update the man page to synchronise with Tomohiro's work on XTerm.
- (#5643, Juliusz Chroboczek).
- 946. Fix some endianness bugs in the r200 DRI driver, and guard a debugging
- print message (Michel Dänzer).
- 945. Fix radeon HW cursor artifacts when switching between 2-color and
- ARGB cursors by always using the ARGB mode (#A.1639, Michel Dänzer and
- Fredrik Höglund).
- 944. Fix rootless XDarwin crash when trying to GetImage with a rectangle
- bigger then the associated top level window (John Harper).
- 943. Add support for multi-head on ZX1-based Itanium2 systems (Marc La France
- with documentation and assistance from Hewlett-Packard).
- 942. Correctly initialize the RE_LINE_PATTERN register in the radeon
- and r200 DRI drivers (Keith Whitwell).
- 941. Fix a problem where a malformed Ximage can cause Xcursor to step
- outside the image data (#A.1636, Keith Packard, reported by
- Michel Dänzer).
- 940. Allow xf86setjmp/xf86setlongjmp to work with platforms where
- setjmp() isn't directly available as a function, specifically Linux
- platforms that use glibc 2.0 and 2.1. (David Dawes, Keith Packard).
- 939. Check pScrn->vtSema before calling xf86SetCursor() from
- xf86CursorCloseScreen(). This avoids a segfault at exit with some
- drivers (Alan Hourihane).
- 938. Fix adding FP native mode for Radeon (Hui Yu@ATI, Kevin Martin).
- 937. Initialize I2C when primary head has an invalid DDC type for the
- Radeon driver (Hui Yu@ATI).
- 936. Video fixes for TV and TVOverscan for the nsc driver (Sarma Kolluru).
- 935. Fix to prevent ShadowComposite() to try to update the framebuffer
- when server is switched away (Egbert Eich).
- 934. Fix problems where the ThirdLevel key and Alt modifiers don't work
- when a map that uses the ThirdLevel virtual modifier is not the first
- layout in a multi-layout configuration (#5642, Ivan Pascal).
- 933. Use safe values in the Thai XIM which should work regardless of
- the signedness of XIMStringConversionPosition (#A.1628,
- Theppitak Karoonboonyanan).
- 932. Replace xf86setjmp/xf86setlongjmp with symbol aliases that resolve
- directly to the native libc versions so that they can operate in
- modules, and make xf86jmp_buf much larger so that should be big enough
- for any reasonable CPU/OS combination. This should fix problems
- with the Freetype2-based freetype font module (#A.1625, Keith Packard).
- 931. Change the default base symbols map from pc104 to pc105, which should
- fix most cases where the <LSGT> key isn't defined. Also change the
- default XkbModel from pc101 to pc105 (Ivan Pascal).
- 930. Fix run-time enabling/disabling of VT switching via xf86EnableVTSwitch()
- (David Dawes).
- 929. Add a "DontVTSwitch" option to allow VT switching to be disabled
- (on platforms where the X server initiates VT switches) (#5640,
- Branden Robinson).
- 928. Fix a memory leak in _XimExtension() (#5638, MINAMI Hirokazu).
- 927. Fix hard-coded ProjectRoot paths in the proxymngr man page (#5634,
- Branden Robinson).
- 926. Fix a NULL pointer dereference in the fontenc library (#5633, Debian).
- 925. Update the neomagic man page to document the OverlayMem option (#5632,
- Diego Santa Cruz and Branden Robinson).
- 924. Fix a memory leak in XCloseDisplay, and a potential race condition
- when multiple threads attempt to initialize the Xcursor library
- simultaneously (#A.1623, Keith Packard).
- 923. Fix xvidtune to pop up a info window if mode on chipset is
- not tuneable (Egbert Eich).
- 922. Fix a NULL pointer in a var_arg list in xfd which causes problems
- on 64 bit systems (Egbert Eich).
- 921. Fix a typo in the nsc Imakefile when installing the linkkit
- (#A.1624, Stanislav Brabec).
- 920. Remove a dependency on how Xlib buffers requests internally for
- xtest's test 2 of XSync (Keith Packard).
- 919. Fix a bug in the way the bitmap font code calculates mix/max bounds
- (it was ignoring empty characters), which fixes some xtest fonts
- bounds check failures (Keith Packard).
- 918. Check that the HW cursor has been setup before calling
- xf86ForceHWCursor() in the radeon (and r128) driver. This fixes
- crashes when using only the SW cursor (#5628, Michel Dänzer).
- 917. Fix duplicate arguments for xf86MatchPciInstances() in the DESIGN doc
- (#5627, Guido Guenther).
- 916. Miscellaneous 64-bit and warning fixes to mfb, xf1bpp and xf4bpp
- (Marc La France).
- 915. Fix a bug in beforelight that was preventing it from being restarted
- and could cause random X clients to be killed. (Matthieu Herrb)
- 914. Add a means by which a motherboard chipset driver can prevent the common
- layer's check for mis-configured PCI-to-PCI bridges (Marc La France).
- 913. Fix bug that would sometimes cause an extra hardware cursor to re-appear
- on a secondary head after a server reset (Marc La France).
- 912. Protect "cvl" references in recent changes to _XEventsQueued() with
- '#ifdef XTHREADS' (reported by Dan Holm).
-
-XFree86 4.2.99.902 (17 February 2003)
- 911. Change the newport driver to use ShadowFBInit2 to fix the broken
- "switching back from the console" issue, and update the driver's man
- page (#5625, Guido Guenther).
- 910. SCO doc update (#5624, J. Kean Johnston).
- 909. Fix X11.tmpl so that Fontconfig works correctly if an OS.cf file
- sets HasFontconfig, and do this in sco5.cf (#5624, J. Kean Johnston).
- 908. Move the vbe module from xfree86/os-support/ to xfree86/ (David Dawes).
- 907. Some changes to the os-support kbd driver layer's calling conventions
- to provide more flexibility (#A.1615, Zephaniah E. Hull).
- 906. Fix a crash in the "xtt" font module caused by a NULL dereference
- when the font cache becomes full (#A.1611, Chisato Yamauchi and
- tokeijikakenoringo).
- 905. Update the list of DRI-supported Radeon hardware (#A.1610,
- Knut J Bjuland).
- 904. Fix a problem in _XEventsQueued() that causes an event reader lock
- of another thread to be released. This can cause a hang and keyboard
- lockup in KDE (#5619, Ewald Snel).
- 903. Fix some bugs with Xft drawing to non-Render enabled servers:
- - Drawing monochrome glyphs had an infinite loop.
- - XftGlyphSpecCore failed to render some glyphs, leading to application
- crashes from uninitialized values.
- (#A.1608, Keith Packard, reported by Nalin Dahyabhai).
- 902. Fix the <BKSL> key in the "winkeys" variants of the Russian and
- Ukrainian XKB maps (#5624, Leon Kanter).
- 901. Install the XKB README files (#5623, Ivan Pascal).
- 900. Add the numeric keys row to the pc/us symbols map (#5622, Ivan Pascal).
- 899. Resync with DRI mesa-4-0-4 branch:
- - Fix DOT3 texture combine env in the r200 driver (Ian Romanick).
- - Fix SW TCL path in the radeon driver (Felix Kühling).
- - Don't assert for FLUSH_STORED_VERTICES if a glBegin hasn't been
- emitted (Alan Hourihane).
- 898. Another update to the fix for the client-side DRI cleanup code that
- should fix references to freed data, an fix a potential memory leak
- (Leif Delgass).
- 897. Fix the behaviour of XLookupString() when XKB is enabled in Xlib
- but not the server. This fixes an xtest XRebindKeysym() failure
- (David Dawes).
- 896. Added radeon driver options documentation to the Options file
- (#5621, Michel Dänzer).
- 895. Fix the return value of SetFontPath() when a font path element is bad
- (David Dawes).
- 894. Add some more HP keyboard layouts (Peter Soos).
- 893. Remove XFree86-specific keysyms that already have generic equivalents
- (Menu, Redo, Print, Undo).
- 892. Add keyboard layout information for the HP 5181 Internet/Multimedia
- keyboard (#A.1603, John Mitchell).
- 891. Fix a problem where two-color render cursors have extra pixels set
- (#A.1607, Keith Packard).
- 890. Fix for corruption when using video modes requiring more than 2MB on
- S3 968 cards (#A.1602, Justin T. Gibbs).
- 889. Fix TVoverscan problems on the NSC SC1200 chip (Sarma Kolluru).
- 888. Cure cursor artifacts by setting HARDWARE_CURSOR_SHOW_TRANSPARENT and
- HARDWARE_CURSOR_UPDATE_UNHIDDEN in the r128 and radeon drivers. The
- wait-for-VSync nonsense the Radeon's currently do can, and should, be
- ripped out later. (Marc La France).
- 887. Extend HARDWARE_CURSOR_SHOW_TRANSPARENT to make hardware cursors
- transparent, rather than disabling them, when a switch to a software
- cursor is needed. This removes recently introduced cursor artifacts
- in the atimisc driver. (Marc La France).
- 886. Cancel repeat for switch screen XKB actions, which fixes a VT
- switching problem that has just become visible (Ivan Pascal).
- 885. Added reinitialization of screen layout after RandR size change
- on a multihead setup. This keeps cursor movement beween screens
- working (Egbert Eich).
- 884. Remove Xcms.txt entries that have server-side equivalents. It looks
- like the slightly different resulting colour definitions from the
- Xcms.txt entries were responsible for an xtest failure.
- 883. Fix some problems with using pre-existing version of fontconfig,
- freetype2 and expat (#A.1600, Keith Packard).
- 882. Add missing zero-sized check to one of Xft's core rendering routines
- (#A.1599, Keith Packard).
- 881. Add a missing symbol reference to the radeon driver (#5618, Mike Harris).
- 880. Fix the Xcursor include path in the man page (#5617, Kevin Brosius).
- 879. Update ViRGE documentation (#5617, Kevin Brosius).
- 878. Fix mkfontscale so that it doesn't include characters forbidden in XLFD
- in the names it generates (#5616, Mike Fabian and Juliusz Chroboczek).
- 877. Fix a rounding problem in the "freetype" module, which fixes the problem
- worked around in entry 864 below (#5615, Juliusz Chroboczek).
- 876. Fix incorrect alias for lv_LV.iso885913, and add some missing lv_LV
- aliases (#5614, Aivils Stoss).
- 875. Fix a bug where xauth may write an incomplete authority file and delete
- the old one if there is insufficient disk space (#5612, Harald Hoyer).
- 874. DPMSClose() wasn't correctly setting its devPrivate to NULL (based
- on #A.1594, Denis Zaitsev).
- 873. Fix scanpci's printing of routing information for PCI-to-PCI bridges
- (Marc La France).
- 872. Bring Cygwin/XFree86 up-to-date (#5613)
- - Multiwindow Window Manager (Kensuke Matsuzaki).
- - Clipboard integration (Harold Hunt).
- - Remove unnecessary redefines of fchown/fchmod (Takashi Sawanaka)
- - Fix some NULL pointer problems on screen changes (Alexander Gottwald).
- 871. Fix some problems when noaccel is used in the nsc driver (Sarma Kolluru).
- 870. Fix acceleration bugs in the nsc driver (Sarma Kolluru).
- 869. Change initMouseHW() to always return TRUE, which restores the older
- more graceful behaviour (Egbert Eich).
- 868. Revert the DestroyContext, GarbageCollectDrawables reording in
- dri_util.c, and instead check if the drawable is known to the DRI
- client code before calling XF86DRIGetDrawableInfo (Egbert Eich).
- 867. Fix some scaling problems with the updated whiteglass cursor icons,
- fixing some incorrect hotspots (Kevin Puetz).
- 866. The sunffb driver was treating a function with a void return value
- as if it had a Bool return value. This causes the driver to fail
- in some cases (#A.1588, Ferris McCormick).
- 865. Add private keysyms for the new XKB actions (XFree86 special keys),
- and move those actions to an XKB compatibility map. This fixes
- side-effects (loss of auto-repeat and mousekeys functionality) of
- the way this was implemented previously (#5610, Ivan Pascal).
- 864. Fix an X server crash with the "freetype" module when displaying
- kochi-mincho.ttf at a size of 18 pixels or higher (Chisato Yamauchi).
- 863. Fix segfault in XkbInitKeyboardDeviceStruct() (David Dawes).
- 862. Add a ServerFlags/ServerLayout option for disabling the RandR extension
- (David Dawes).
- 861. Resync with DRI mesa-4-0-4 branch:
- - Correct RADEON_MAX_TCL_VERTSIZE and set MaxArrayLockSize
- (Keith Whitwell).
- - Fix EAGAIN handling in radeon_cp_dispatch_texture(), which fixes
- corruption of large textures (Michel Dänzer).
- - Fix bufferSize and alphaMask for DRI in several drivers (Brian Paul,
- Leif Delgass).
- - Avoid a loop on validating destroyed drawable (Keith Whitwell).
- - Reorder DestroyContext, GarbageCollectDrawables to avoid error
- (Egbert Eich).
- - Remove untested BSD DRM vlank signal code (Eric Anholt).
- - Update Radeon PCI IDs for BSD drm driver (Eric Anholt).
- - Uninitialize mutexes on cleanup in the BSD drm driver, which
- fixes panics with FreeBSD-5.0 with WITNESS (Eric Anholt).
- - Remove the untested/unused gamma DRM driver for BSD (Eric Anholt).
- 860. Fix byte swapping of the refresh rate argument to RandR's
- SetScreenConfig request, and fix a 1.0 client compatibility problem
- with SetScreenConfig (#A.1574, Keith Packard).
- 859. The i810 driver wasn't releasing control of the agpgart when VT switching
- away for the 830M and later (David Dawes).
- 858. Update Rage 128 and Radeon PCI IDs (Mike Harris).
- 857. Fix vertical retrace to not interfere with interrupt handling
- (#5608, Michel Dänzer).
- 856. Add M9 DRI support (Hui Yu@ATI).
- 855. Update Radeon man page (Michel Dänzer).
- 854. Add Radeon man page (Hui Yu@ATI).
- 853. Use strtol instead of atoi in xf86cfg 'expert' mode. Make pauses
- when printing keyboard models in xf86config (#5609, Chisato Yamauchi).
- 852. Xterm patch #173 (Thomas Dickey).
- 851. Don't use XkbGetKeyboard() in xset, just use XkbAllocKeyboard()
- (Ivan Pascal).
- 850. Fixes for the nsc driver for HW cursor hotspots and GX2 video
- clipping issues (Sarma Kolluru, NSC).
- 849. Fix HW cursor on CRTC2 for SiS650+301B (Thomas Winischhofer).
- 848. Update the i810/i830 driver to recognise the 865G integrated graphics
- chipset (David Dawes).
- 847. Updates for the nsc driver (Sarma Kolluru, NSC).
- 846. Fixed dual head for 1400x1050 displays (Thomas Winischhofer).
- 845. Initializing clock ranges in several drivers to get rid of the
- annoying 'scaled from 0.0 MHz' message in xf86PrintModes()
- (Egbert Eich).
-
-XFree86 4.2.99.901 (4 February 2003)
- 844. Fixing a double free in libXRandr (Egbert Eich).
- 843. The microsoft-win3.1 encoding file wasn't being installed (#A.1569,
- Mike Harris).
- 842. Sync the FIFO in the vmware driver after defining an ARGB cursor
- (#5607, Nolan Leake).
- 841. Add missing Num_Lock and Scroll_Lock modifiers to the jp XKB map
- (Chisato Yamauchi).
- 840. Change the default cursor theme to "core".
- 839. Fix some keys in the Slovenian (si) XKB map (David Balazic,
- Henrik Nordström).
- 838. Add a check to xset for a NULL return from XkbGetKeyboard()
- (Tapani Utriainen).
- 837. Resync with DRI mesa-4-0-4 branch:
- - radeon DRM: only acknowledge interrupts we handle -- others could
- be used outside the DRM (Michel Dänzer).
- - Fix PCI and AGP posting problems (based on testing by Chris Ison
- and suggestions by Benjamin Herrenschmidt and Arjan van de Ven).
- - Remove radeon_flush_write_combine() which has been unused for a while
- (Michel Dänzer).
- - Disable strict aliasing when building the DRM (Michel Dänzer).
- 836. Fix xfs crash on Darwin by making libXfont a flat namespace image
- (Torrey T. Lyons).
- 835. Avoid endless loop when initializing an PS/2 mouse behind a
- repeater (Egbert Eich).
- 834. Radeon driver: make sure RADEONCPStop() is only called when
- RADEONCPStart() has been called before. Failing to do so may
- make the kernel driver oops (Egbert Eich).
- 833. Disabling MMX, 3DNow and SSE support for x86-64 as the function
- call sequence is hardcoded to ia32 (Egbert Eich).
- 832. Fix a hang in multi-thread mode caused by a missing UnlockDisplay() in
- XkbGetMapChanges() (Jose Luu).
- 831. Resync with DRI mesa-4-0-4 branch:
- - Don't inflate relative vblank sequence numbers on repeated calls
- (e.g., when interrupted by a signal) (Michel Dänzer).
- - Fix size of VERTEX2 ioctl struct (Egbert Eich).
- 830. SiS driver fixes:
- - Mode restoration fix.
- - Xv Hue and Saturation property fixes (310/325 series).
- - Built-in mode fixes.
- - Revert wrong bus width assumptions from previous patch.
- (Thomas Winischhofer).
- 829. R128 build fix on big endian platforms (#A.1565, George Staikos).
- 828. Updated whiteglass cursor icons that fix the resizing glitches in the
- existing ones (#A.1563, Kevin Puetz).
- 827. Include server control definitions in some XKB maps that were missing
- them (based on #A.1562, Jens Petersen).
- 826. Define Alt/Meta modifiers for the jp106 XKB layout, and include
- server control definitions (#A.1562, Jens Petersen).
- 825. Add some locales required for the OpenI18N compliance test (#A.1550,
- Leon Ho).
- 824. s3virge driver updates:
- - 320x240 doublescan support with mouse adjust.
- - Power management printouts, DAC error printout fix.
- - Log XVideo status based on chipset, and preliminary support for
- disabling XV when a mode doesn't support it.
- (#A.1550, Kevin Brosius).
- 823. Add an Ethiopic TTF and OTF font (#A.1549, Daniel Yacob).
- 822. Add a phonetic layout to the Bengali XKB map (#5606, Taneem Ahmed).
- 821. Work around an AGP bug in the AlphaServer ES45 by padding each ring
- buffer packet in the radeon drm with NOPs to cache line boundaries.
- This is only done for Alpha platforms (#5605, Jeff Wiedemeier).
- 820. Add missing domain decoding to DRM(irq_busid) for Alpha (#5604,
- Jeff Wiedemeier).
- 819. Build fix for the DRM on FreeBSD 5.0-current (#5603, Eric Anholt).
- 818. xaaStateChange.c was not calling RestoreAccelState before doing
- CPUToScreenTexture and CPUToScreenAlphaTexture, which seems to be the
- reason why RENDER acceleration was broken on some dual-monitor MGA cards
- (#5602, Nolan Leake).
- 817. Make the vmware driver a little more conservative about supporting
- HW RGBA cursors in 8-bit modes (#5606, Nolan Leake).
- 816. Work around a problem with the vmware driver's interaction with the
- offscreen memory manager (#5606, Nolan Leake).
- 815. Fix fb's rotation of tiles and stipples when using non-zero PixOrigin
- macros (Torrey T. Lyons).
- 814. Fix Radeon native FP mode initializion (Hui Yu@ATI).
- 813. Resync with DRI mesa-4-0-4 branch:
- - Fix Q3A mode change prolbem in thr r200 driver (Keith Whitwell).
- - Add a missing break to prevent spurious GL_INVALID_ENUM
- (Leif Delgass).
- - Fix __FUNCTION__ usage in the ffb 3D driver (Leif Delgass).
- - Limit the number of pending vblank signals to 100 to prevent
- a DoS (Michel Dänzer).
- - Fix a void * arithmetic warning in the radeon DRM driver
- (Leif Delgass).
- 812. Fix a typo in the "pl2" XKB map (#A.1553, Piotr Xurek).
- 811. Fix a null dereference in Mesa that can cause an X server crash at
- client exit (#A.1548, Ezra Peisach).
- 810. Improve the XTT code that prevents unexpected data to be passed to
- XAA (#5600, Chisato Yamauchi).
- 809. xkbcomp/rules/xfree86.xml wasn't being installed (#5599, Ivan Pascal).
- 808. Add knowledge about two Korean foundries to mkfontscale (#5598,
- Jungshik Shin).
- 807. Disable the INREG fallbackup in the radeon 3D driver on Alpha because
- it references a function that's not availalbe (#5596, Jeff Wiedemeier).
- 806. Fixed patch 760: VBEInit takes entity index, not screen index
- (Egbert Eich).
- 805. Card name changes/fixes (Hui Yu@ATI).
- 804. Panel color channel depth fix for Radeons (Hui Yu@ATI).
- 803. Include list_for_each_safe define for kernels that do not have it
- (Kevin Martin).
- 802. Fix 2D corruption around 3D window, when 3D window is moving and using
- Radeon page flipping code (Michel Dänzer).
- 801. Big endian fixes for Rage 128 and Radeon video and Radeon cursor code
- (Michel Dänzer).
- 800. Enable PCI GART for all architectures (still gated by ForcePCIMode, if
- on an AGP card) (Michel Dänzer).
- 799. Fix for Radeon's CP accelerated 2D sync routine (Michel Dänzer).
- 798. SiS driver fixes:
- - Fix for SiS730+LVDS machines (display modes restricted due to
- hardware limits; LCD text mode restoration fixed)
- - Fix for SiS300 bus width detection
- - Fix for Fn+Fx output device switching on some machines (still
- does not work on all)
- - Numerous Dual Head fixes
- - Added color hardware cursor support on 300/310/325/330 series
- - Added PAL-M and PAL-N support for Chrontel 701x
- - Added ModeLine handling for 300/310/325/330 series (CRT1 only)
- (Thomas Winischhofer).
- 797. Fix for memory fences on PowerPC (Marc La France).
- 796. Work-around for Radeon int10 problems (Marc La France).
- 795. Fix XDarwin crash in rootless mode with 16-bit color by ensuring that
- window pixmap pointers are 32-bit aligned (John Harper, Torrey T. Lyons).
- 794. Update the i810 2D driver and i830 3D drivers to recognise and handle
- the Intel 852GM/855GM integrated graphics chipsets (David Dawes,
- Keith Whitwell).
- 793. Force extension-generated mode switches always occur (Marc La France).
- 792. Fix OS/2 library build problem (Frank Giessler).
- 791. Fix bug that at times prevented recognition of resources decoded on PCI
- root buses (Marc La France).
- 790. Fix XDarwin's spurious transparent regions in rootless windows
- (Torrey T. Lyons).
- 789. Fix bug in recognition of certain ix86 Host-to-PCI bridges
- (Marc La France).
- 788. Fix for breakage in reading the serial PnP mouse ID string (David Dawes).
- 787. Add "core" theme to Xcursor to force old behaviour (Keith Packard).
- 786. Increase the default font cache size so that it works better for
- iso10646 (#A.1541, Hidetoshi Yamanouchi, Chisato Yamauchi).
- 785. Fix an XTT problem where garbage is displayed when there are undefined
- glyphs for fixed width fonts, and fix some other potential problems
- (#A.1541, Hidetoshi Yamanouchi, Chisato Yamauchi).
- 784. Resync symbols/fi with symbols/pc/fi (#A.1532, Marko Myllynen,
- #5589, Linus Torvalds).
- 783. Resync xkb/rules/xfree86.xml with xfree86.lst (#5595, Ivan Pascal).
- 782. ISO_Level3_Shift was breaking compose sequences because Xlib wasn't
- recognising it as a modifier key (#5594, Ivan Pascal).
- 781. Add a Lao (lo) XKB map (#5592, Anousak Souphavanh).
- 780. Add a multi-layout version of the Malayalam keymap (#5593, Ivan Pascal).
- 779. Add some missing entries to the xkb rules $oldlayouts and $nonlatin
- sets (#5593, Ivan Pascal).
- 778. Prevent mkfontscale from looking at bitmap fonts, and ensure that it
- doesn't crash if a font happens to have no head (#5591,
- Juliusz Chroboczek).
- 777. Document that DVI the mga_hal module may be necessary to use the DVI
- output with the G550 and other cards (#5590, Andrew Aitchison).
- 776. Fixes for a few "nodeadkeys" XKB maps (David Dawes).
- 775. Protect magic cookie from short-lived exposure on command line in
- startx (Christian Biere).
- 774. Fix ELF loader to ignore -g debugging information
- (#A.1539, Juergen Keil).
- 773. Fix artifacts left by XDarwin when reshaping a shaped window (reported
- by Adrian Umpleby).
- 772. Fix XDarwin rootless crash when resizing a window (John Harper).
- 771. Fix vbe module to not assume BIOS call results are zero-extended
- (Paulo Cesar Pereira de Andrade).
- 770. Fix improper initialisation of pciConfigRec's. Reported by Marcel
- Moolenaar (Marc La France).
- 769. Fix intermittent XDarwin crash on Mac OS X 10.1.x when changing cursors
- on dual processor machines (Torrey T. Lyons).
- 768. Correction to 'is' keymap (reported by Richard Allen).
- 767. Fix GLX library mis-use of LockDisplay()/UnlockDisplay() sequences
- (reported by Alexis Vartanian).
-
-XFree86 4.2.99.4 (20 January 2003)
- 766. Fix XDarwin's rootless mode with 16-bit color (John Harper).
- 765. Allow UTF8 conversion to work for Japanese locales (#A.1527,
- Etsushi Kato).
- 764. Add a method for working around a problem that can show up when
- running setxkbmap from a machine with a different version of XKB
- than the X server. The workaround method is documented in
- the setxkbmap(1) man page (#5588, Ivan Pascal).
- 763. Add some new keys and key combinations that can be used for switching
- between XKB groups (#5587, Ivan Pascal).
- 762. Fix typos in the README.fonts document (#5585, John Himpel,
- Juliusz Chroboczek).
- 761. Fix the pc/fi and pc/il XKB maps after recent changes made them
- non-compliant with the multi-layout scheme (#5581, Ivan Pascal).
- 760. Allow the mga driver to fallback to using VBE for DDC when using
- the native method fails. This allows DDC to work for DVI output
- on Matrox cards (#5580, Andrew Aitchison).
- 759. Add block handler for XDarwin's quartz modes to clean up any
- autoreleased objects in the server thread (Torrey T. Lyons).
- 758. Fix use of uninitliazed variable in xmag/xmag.c (A.1525, Keith Packard).
- 757. Fix typo in Radeon Mono8x8 code (#A.1526, Juergen Keil).
- 756. PS/2 mice initialization sequence changed: rerun entire sequence
- when something goes wrong - this needs to be rewritten completely
- after 4.3 is out (Egbert Eich).
- 755. Savage driver: disable HW cursor on stretched LCD displays,
- let SaveScreen and DGA test if HW cursor is on before
- disabling/reenabling it (Egbert Eich).
- 754. Fixed VBE EDID read: due to a missing register setting read
- ended in endless loop on certain systems (Egbert Eich).
- 753. Changed the default mouse device for FreeBSD to sysmouse and the
- protocol to auto when running X -configure (#5584, Eric Anholt).
- 752. Changed the default mouse device for xf86cfg and xf86config to
- /dev/sysmouse for FreeBSD (#5582, #5583, Eric Anholt).
- 751. Fix for Mono8x8 patterns on Radeon (#A.1520, Juergen Keil, Kevin Martin).
- 750. Fix for Radeon mode validation (#A.1330, #A.1380, #A.1393, #A.1522,
- #A.1523, Wayne Whitney, Hui Yu@ATI, Juergen Keil).
- 749. Workaround for flickering problem with switching between ARGB and mono
- cursors on Radeons (#A.1380, Hui Yu@ATI).
- 748. DDCMode fix for VidMode extension (#A.1380, Kevin Martin, Hui Yu@ATI).
- 747. Panel detection bug fix for Radeon (#A.1380, Hui Yu@ATI).
- 746. Add Xv overlay support for dual headed Radeons (#A.1380, Hui Yu@ATI).
- 745. Fix Radeon driver's 24-bit support for flat panels (#A.1380, Hui Yu@ATI).
- 744. Add Radeon 9500/Pro support (#A.1380, Hui Yu@ATI).
- 743. Disable CGWorkaround for non-A11 rev R300s (Kevin Martin, Hui Yu@ATI).
- 742. Radeon solid/dashed line fix for RV200 and newer card (Kevin Martin).
- 741. Radeon overlay gamma fix (Hui Yu@ATI).
- 740. Radeon LG panel fix (Hui Yu@ATI).
- 739. Change makedepend to warn about any whitespace it finds in front of
- pre-processor directives (Marc La France).
- 738. Missing deadkeys in UTF-8 compose table (Mike Fabian).
- 737. Build fix for SPARC (Thorsten Kukuk).
- 736. Fixed integer address value in vesa driver to be large enough
- to hold a 64 bit memory address (Andreas Schwab).
- 735. Disabled RENDER accel on Matrox when used in multihead mode
- (Stefan Dirsch).
- 734. Added FireGL 8700/8800 to the list of supported cards or RADEON
- driver (Stefan Dirsch).
- 733. Added -mcmodel=kernel to DRM Makefile for x86_64 (Stefan Dirsch).
- 732. Added vesa and fbdev driver to x86_64, removed nsc driver for ia64 build
- (Stefan Dirsch).
- 731. Fixing comments in th_TH.UTF-8 (Stefan Dirsch).
- 730. Fixes from the DRI CVS:
- - Don't segfault when spec or fog stride is 0.
- - Don't set RADEON_SURF_TRANSLATION_DIS for framebuffer aperture
- byte swapping on big endian machines; doesn't work with R200 and
- later chips.
- - Improve AGP workaround for pre-R200 chips.
- (Michel Dänzer).
- 729. Remove inappropriate __linux__ ifdef in the tdfx client-side DRI driver
- (#5579, Eric Anholt).
- 728. Allow makedepend handle whitespace in front of the '#' in preprocessor
- directives (ISO C permits this) (#A.1516, Alexander Stohr).
- 727. Add zh_TW.UTF-8 locale support (#A.1514, Leon Ho).
- 726. Add recognition of wacom "XD-xxxx" models to the wacom input driver,
- and treat them the same as "GD-xxxx" models (#A.1505, Rene Rask).
- 725. Fix some missing render extension big-req compatibility (#A.1493,
- Keith Packard).
- 724. Fix a missing initialisation in the calcomp input driver that makes
- the driver unusable and crashes the X server at startup (#A.1492,
- Martin Kroeker).
- 723. Work around for a bug in the i740 driver's XVideo support where the
- video output would sometimes stop updating (#5578, Stephen Blackheath).
- 722. Make DRM signal-on-vblank request return EINVAL on BSD since it's
- not been ported yet (#5576, Eric Anholt).
- 721. Remove the no longer used bsd/drm/kernel/r128/*.[ch] files (#5576,
- Eric Anholt).
- 720. drmFreeBufs was missing from the r128 driver's referenced symbols list
- (#5574, Eric Anholt).
- 719. Allow all of the extended mouse button bits for the "sysmouse" protocol
- to be passed through (#5573, Eric Anholt).
- 718. Update the XFree86 server special key handling so that by default
- there is a fallback to the the hard-coded keys when there is no
- Terminate action binding in the XKB map. A new global option is
- added to allow the fallback mechanism to be used never, when needed,
- or always, with "when needed" the default (#5572, Joe Moss).
- 717. Update the README.fonts document (#5570, Juliusz Chroboczek).
- 716. Build the loader's libc wrapper with -DHAVE_SYSV_IPC on FreeBSD
- since NVIDIA's binary driver uses it (#5569, Eric Anholt).
- 715. Reduce the stack usage from 64k to 8k in imLcPrs.c, which fixes
- a problem with Java for FreeBSD (#5568, Eric Anholt).
- 714. Gcc 3 deprecated the #pragma weak method for weak links (#5567,
- Motoyuki Konno).
- 713. FreeBSD.cf updates:
- - Sparc64 support
- - Recent 5.0-current doesn't need libXThrStub
- - Disable SharedLibXdmGreet, fixing xdm on alpha
- (#5566, Eric Anholt).
- 712. XDarwin now loads GLX support dynamically. Current options are Apple's
- OpenGL framework or Mesa (Torrey T. Lyons).
- 711. GeForceFX support in the nv driver (Mark Vojkovich).
- 710. DPMS support in the nv driver. CRTs only at this time (Mark Vojkovich).
- 709. Fix for recognition of non-existent PCI devices (Marc La France).
- 708. Fix for when firmware/BIOS initialisation does not enable the extra
- command FIFO entries available on second-generation integrated Mach64
- variants (Marc La France).
- 707. Copying Syriac OTF fonts to directory OTF instead of TTF.
- The xtt font renderer cannot handle OTF fonts causing the
- entire directory to be ignored (Egbert Eich).
- 706. Disabling MIT-SHM extensions for Xnest, fixing pixmap private
- code in Xnest, thus cleaning out bogus patch 137.
- NOTE: The MIT-SHM presently *does* *not* work with Xnest.
- I have code to make it work but it is not well tested therefore
- MIT-SHM is disabled for now! (Egbert Eich).
- 705. Fix the misnaming of three of the redglass cursors (#A.1491,
- Keith Packard).
- 704. Fix for two problems where the combination of xtt and XAA could result
- in a crash. The first problem was xtt returning a NULL pointer for
- the bitmap even though the height was non-zero. The second problem
- was glyph ascent/descent exceeding the range of maxbounds.ascent/
- maxbounds.descent (A.1484, Chisato Yamauchi, Masanori Shimada).
- 703. Eliminate locale-dependent behaviour in fontconfig's setfontdirs
- script (#A.1483, Markus Kuhn).
- 702. Fix a bug in previous Thai XIM changes (#5563,
- Theppitak Karoonboonyanan).
- 701. Updates for the Israeli XKB map, including:
- - Implement parens mirroring.
- - Add two additional variants: "lyx", replacing shifted Hebrew
- letters with Hebrew point marks, and "si1452", implementing the
- Standard of Israel no. 1452 mapping.
- (#5562, Tzafrir Cohen).
- 700. BuildServersOnly fix when building on a system with no installed
- X headers or libraries (#5559, ISHIKAWA Mutsumi).
- 699. Add extended symbols for the "Logitech Cordless Desktop Navigator"
- keyboard (#A.1480, Gilbert Fridgen).
- 698. Fix xdm resource's font references to match actual bitmap fonts (#A.1477,
- Göran Uddeborg).
- 697. Update the xcursorgen man page (#A.1475, Keith Packard).
- 696. Add a Mongolian XKB map (#5557, Sanlig Badral).
- 695. Fixes for the Turkish XKB map (#5556, Nilgün Belma Bugüner).
- 694. Thai XIM fixes:
- - Fix the arguments in calling to StringConversionCallback in Thai XIM
- filter, according to Hideki Hiura's explanation on the protocol.
- - Add input sequence correction capability to the Thai XIM by
- exploiting the XIMStringConversionSubstitution operation.
- (#5553, Theppitak Karoonboonyanan).
- 693. Resync the pc/fi XKB map with the previous map (#5552, Marko Myllynen).
- 692. Workaround for parsing of Layout sections caused by recent changes
- (#5558, Andrew Aitchison, Paulo César Pereira de Andrade).
- 691. Fix the enabling of the Glint Gamma for use on an Appian Graphics
- Jeronimo 2000 board which uses two Permedia3's (#5448, Sven Luther).
- 690. Fix a problem in the trident driver for older chipsets and using
- 16bit clock programming, manifested itself on a Thinkpad 760EL,
- but there are probably lots of others. (Alan Hourihane).
- 689. On Darwin add Mac font directories to fonts.conf (Torrey T. Lyons).
- 688. Post XDarwin mouse events in Quartz mode where they happen rather than
- where the cursor currently is (Adrian Umpleby).
- 687. Enable Freetype Mac FOND support on Mac OS X (Torrey T. Lyons).
- 686. Add an "lswitch" option to the group xkb map, allowing the left Alt
- key to be used for AltGr (#A.1463, Andreas Tobler).
- 685. Add some locales for OpenI18N1.2 (LI18NUX2000) level.1 conformance,
- and change zh_HK to point to zh_HK.big5hkscs which conforms to
- glibc's default for zh_HK (#A.1457, Leon Ho).
- 684. Updates for the Irish and Ogham XKB maps (#5549, 5550,
- Séamus Ó Ciardhuáin).
- 683. Xterm patch #172 (Thomas Dickey).
-
-XFree86 4.2.99.3 (21 December 2002)
- 682. Add a request to XFree86-VidModeExtension to get the read/write
- permissions so that clients can check if they have permission to
- change parameters (David Dawes).
- 681. Fix read-only XFree86-VidModeExtension requests for remote connections
- (David Dawes, reported by Jamie Zawinski).
- 680. Correct problem when the server prints the name of a 'private
- xkb action' in a format that xkbcomp cannot understand, and
- was causing problems when calling XkbGetKeyboard (Ivan Pascal).
- 679. Fix animated cursor problem with multiple screens (#A.1454,
- Keith Packard).
- 678. gtf.c build fix for LynxOS 4.0 (#A.1453, Stuart Lissaman).
- 677. Fix a segfault in fontconfig (#A.1450, Keith Packard).
- 676. If some LEDs are lighting when one reloads the XKB keyboard map
- (using setxkbmap or xf86cfg) the LEDs become 'frozen' and can't
- be switched off. The patch fixes this bug. (#5544, Ivan Pascal).
- 675. Fix some problems with the addition of multi-layout scheme to
- xkb: some keys that aren't 'alphabetic' should be treated as
- such to allow CapsLock+Shift working as expected; sometimes it
- is required to load an include file more than once due to
- multi-layout configuration, also fix some typos
- (#5545, Ivan Pascal).
- 674. XKB programable 'special combinations' (such as Ctrl+Alt+<key>)
- also send usual key evants (press and release). Although the
- keysym generated in this case is NoSymbol such events can confuse
- some applications (#5546, Ivan Pascal).
- 673. Fix some remaining memory leaks in xkb initialization code
- (Paulo César Pereira de Andrade).
- 672. Temporarily enable the hard-coded Ctrl-Alt-Backspace terminate sequence
- until a better fallback mechanism is implemented (Egbert Eich).
- 671. Allow XKB-remappable hot keys to work with the "kbd" driver
- (Egbert Eich).
- 670. Export xf86inSuspend as needed by the "kbd" driver (Egbert Eich).
- 669. SiS driver updates, including:
- - support for SiS 330 Xabre (untested)
- - Bugfix for boxes with two VGA connectors (tested)
- - Autodetection of second monitor (tested)
- - TV detection improved (tested)
- - fixed error in 1280x1024 panel support (yet untested)
- - Fixed bug in TV output on SiS30xB/30xLV (PAL still only BW, not
- even the Windows driver can display PAL in color)
- - Fixed positioning of TV picture. Works now for all video bridges
- except Chrontel 7019 (still untested).
- (Thomas Winischhofer).
- 668. Add an alternative French XKB layout (fr-latin9) (#A.1446, Guylhem Aznar,
- Rene Cougnenc, Nicolas Mailhot).
- 667. Add bar and brokenbar to default <LSGT> definition for pc102 and
- pc105 xkb maps (based on #A.1445, Göran Uddeborg).
- 666. Change the keypad "decimal" key to KP_Separator in the dk, fi, no, se
- xkb maps (#A.1440, Robin Rosenberg).
- 665. Fixes and cleanups for the ISO8859-14 Compose table (#5543,
- Séamus Ó Ciardhuáin).
- 664. Update the Ogham xkb map, including full support for the IS434 standard
- and laptops (#5542, Séamus Ó Ciardhuáin).
- 663. Update the Irish xkb map, including adding support for laptops (#5541,
- Séamus Ó Ciardhuáin).
- 662. Add "Inet" key definitions for the Honeywell Euroboard keyboard (#A.810,
- Scott Penrose).
- 661. Add "Inet" key definitions for the Trust Direct Access keyboard (#A.897,
- Raphaël Poss).
- 660. Add draglock support to the mouse driver, for aiding trackball use
- by people with low dexterity (#A.1224, Paul Elliott).
- 659. Fix bad includes in the xkb "level3" symbols file (A.1444,
- Göran Uddeborg).
- 658. Fix atimisc panel support bug that occurs when the mode on server entry
- is a VGA mode with large horizontal and/or vertical blanking pulses
- (Marc La France).
- 657. Fix small documentation error in config/imake/imakemdep.h (#A.1052,
- Linus Almstrom).
- 656. Small change to find_mesa_visual() in xf86glx.c to avoid
- branch misprediction on x86 (#A.1057, lompik at voila.fr).
- 655. Clear memory allocated in xtWidgetAlloc() to avoid garbage from
- malloc() being referenced later (#A.1114, Adam J. Richter).
- 656. Make SysRq generate the same keycode as PrtScrn, and Break the same
- keycode as Pause (#A.1160, Owen Taylor).
- 655. Add "Inet" key definitions for some HP and Toshiba laptops (#A.1213,
- Peter Soos).
- 654. "Inet" key definitions for the Brother Internet keyboard (#A.1242,
- Diego Iastrubni).
- 653. "Inet" key definitions for the Ennyah model DKB-1008 keyboard (#A.1256,
- Lionel Landwerlin).
- 652. Apply i830 DRM driver cleanups to the i810 driver (#A.1438,
- David Airlie).
- 651. Add XI18NOBJS files for the ko_KR.UTF-8 and ja_JP.UTF-8 locales
- (#5538, 5539, Jungshik Shin).
- 650. Add FIRSTINDEX to the gb2312.1980-0.enc, gbk-0.enc and jis0212.1990-0.enc
- encoding files (#5537, Jungshik Shin).
- 649. Increment shared libraries major revisions on OpenBSD if gcc with
- stack protector is used (Matthieu Herrb, Todd Fries).
- 648. Resync with DRI (mesa-4-0-4-branch).
- 647. Update XDarwin's IOKit mode to work with new event handling code
- (Torrey T. Lyons).
- 646. Add some more aliases for some German locales (#A.1263, Thomas Koeller).
- 645. Update kio8-r encoded Cyrillic BDF fonts (#A.1267, Andrey A. Chernov).
- 644. Fix Xtrans TLI code to handle a port scan and not fill the log file
- with error messages from _XSERVTransTLIAccept() (#A.1333, Fiel Cabral).
- 643. Only free cbs.data.text when cbs.type is XIMTextType in
- _XimStatusDrawCallback() (#A.1342, Owen Taylor).
- 642. Allow mouse pointer movement to be rotated (#A.1346, Joost Buelens).
- 641. Add xkb layouts for Indian scripts (Kannada, Telugu, and Oriya) (#A.1436,
- Guntupalli Karunakar).
- 640. Enable MMX, SSE and 3DNow! for NetBSD 1.6 and later (#5536,
- Matthias Scheler).
- 639. Merge the xkb 'lt' layouts into pc/lt (#5535, Nerijus Baliunas).
- 638. Set the default fa_IR character set to UTF-8 instead of
- ISIRI-3342 (#A.1356, Roozbeh Pournader).
- 637. Fixes and updates for building under LynxOS/PowerPC 4.0 (#A.1386,
- Stuart Lissaman).
- 636. Update the ClearlyU fonts to version 1.9 (#A.1386, Mark Leisher).
- 635. Fix for drmOpenDevice() ignoring success on its second attempt at
- opening the drm device (#A.1394, Alexander Stohr).
- 634. Add support for a "-include" command line option to makedepend, similar
- to the same GNU C option (#A.1396, Alexander Stohr).
- 633. Perform country-independent matching for Chinese languages in fontconfig
- (#A.1406, Keith Packard).
- 632. Finish off the UTF-16 APIs in Xft, and fix the UTF-16 conversion
- code in fontconfig (#A.1411, Keith Packard, Jungshik Shin).
- 631. Make XIM locale checking case-independent (based on #A.1422, Leon Ho).
- 630. Fix incorrect datatype for the pixmap width in
- fbCompositeSrcAdd_8000x8000(), and add some small optimisations
- (#A.1423, Keith Packard).
- 629. Update the se xkb map to allow the older AltGr+5 method of entering
- the Euro sign (#A.1433, Christian Rose).
- 628. Add validation for the screen number parameter received over the wire
- by the X server's DRI extension code, and fix some similar checks in
- the GLX code. This fixes X server segfaults when an invalid screen
- value is provided (#A.1434, Felix Kühling)..
- 627. Fix some bugs in the Iranian xkb layout (#A.1135, Roozbeh Pournader).
- 626. Add a Bosnian xkb layout (#A.1398, Amila Akagic).
- 625. Fix for Hungarian xkb layout (#A.1175, Peter Soos).
- 624. Update the Maltese xkb layouts (#A.1243, Ramon Casha).
- 623. Add EuroSign to the xkb "gb" layout (#A.901, Dermot McNally).
- 622. Various updates for the xkb "xfree86" keymap list (including #A.777,
- Andriy Rysin).
- 621. Let kbd driver test if Xserver is in suspend before handling any
- input events (Egbert Eich).
- 620. Fixed agp version checking to accept minor versions >= the specified
- number (Leif Delgass).
- 619. Update referenced symbols lists for the mga, vesa, i810 and vmware
- drivers (David Dawes).
- 618. Add missing symbol to the mga driver's referenced symbols lists
- (#5534, Mike Harris).
- 617. Add some utf8 locale aliases (#5533, Mike Harris).
- 616. Fix some Linux/Alpha (with domain support) build and runtime
- problems (#5532, Jeff Wiedemeier).
- 615. Add some missing symbols to the radeon driver's referenced symbols
- lists (#5531, Mike Harris).
- 614. Restore the Alt/Meta mappings for pc104/pc105 keyboards in the
- multi-layout maps (David Dawes).
- 613. Add UTF-8 locale entries for Amharic-Ethiopian, Tigrinya-Eritrean
- and Tigrinya-Ethiopian (#5529, Daniel Yacob).
- 612. Restore the "\|" key in the GB multi-layout keyboard layout (#5528,
- Andrew Aitchison).
- 611. Updates for the auto-generated UTF-8 Compose file (#5527,
- David Monniaux).
- 610. Updates/fixes for the Korean font encoding file (#5525, Jungshik Shin).
- 609. Fix some problems with the multilayout version of the Turkish layout
- (#5521, Nilgün Belma Bugüner).
- 608. DRM vertical blank ioctl can send a signal as an alternative to
- blocking (r200 and radeon only so far) (#5523, Michel Dänzer).
- 607. Build fix for Linux/Alpha (#5515, Mike Harris).
- 606. Change CppCmd on Linux to /usr/bin/cpp (#5514, Mike Harris).
- 605. Fix an incorrect check for the "StrangeLockups" option in the
- neomagic driver (#5505, Mike Harris).
- 604. Rename geode driver to nsc and add GX2 support (Sarma Kolluru, NatSemi).
- 603. Add the missing XKB definition for keysym "ISO_Level3_Lock" (#5526,
- Séamus Ó Ciardhuáin).
- 602. XkbSetControls should return True when successful, not False (#A.1385,
- Stephen Montgomery-Smith).
- 601. The functions XGetXlibControls and XSetXlibControls must work even if
- the X server doesn't have the XKB extensions (#5513, Ivan Pascal).
- 600. Add en_ZA locales (#5512, Berend De Schouwer).
- 599. Fix shadowfb to not make update callbacks for operations that don't
- touch offscreen memory, and to not double (or more) update glyph
- rendering (#5509, Nolan Leake).
- 598. Change XAA to not sync when it sees RENDER operations that don't
- touch VRAM, and to try to accelerate Glyphs with Composite if it
- seems likely that will work (#5509, Nolan Leake).
- 597. VMware driver updates, including:
- - Fixed vmwareGetImage to correctly calculate the region to be gotten.
- - Small cursor bypass optimization.
- - Fixed race between writing normal registers and writing HWcursor
- registers.
- - Fixed small race in the FIFO wrap code that could cause FIFO
- corruption.
- - Added temporary offscreen memory manager.
- - Added compositing (RENDER) acceleration.
- (#5509, Nolan Leake).
- 596. Newport driver updates, including:
- - Add hardware cursor support.
- - Workaround blank console after VT switch on some newports
- (based on a patch from Dominik Behr).
- - Support for the Indigo2 XL (based on a patch from Adrian Schroeter).
- (#5507, Guido Guenther).
- 595. Add SGML versions of the XKB config and enhancing docs (#5506,
- Kamil Toman).
- 594. Enable SSE, MMX, 3DNow support by default for Linux/x86_64 (#5502,
- Mike Harris).
- 593. Replace hard-coded "lib" directory names with LibDirName in Imake.tmpl
- (#5480, Mike Harris).
- 592. DRI shouldn't have been enabled for Linux/s390 (#5500, Mike Harris).
- 591. Numerous bug, stability, and correctness fixes for the Intel 830/845G
- 3D support (#5517, Keith Whitwell).
- 590. Numerous bug and stability fixes for the Intel 830/845G 2D and Xv
- support (#5517, David Dawes).
- 589. Move IOKit-specific global variables out of generic XDarwin code
- (Torrey T. Lyons).
- 588. Add a new interface for registration of core font renderers that allows
- priorities to be assigned. This allows multiple renderers for the
- same extension to be registered, with the one with the highest priority
- being the one that gets used (#5435, 5437, Juliusz Chroboczek).
- 587. Fix 640x480 modes in neomagic driver (Egbert Eich).
- 586. Fix reporting of G400/G450 in MGA driver (Andrew C. Aitchison).
- 585. Don't change the authorization data (and in particular, don't
- enable local host access) if the X server's authority file
- is removed or becomes unreadable while the server is running
- (David Dawes, reported by Dietmar Schröter).
- 584. Xterm patch #171 (Thomas Dickey).
- 583. Fix uninitialized buffer-count in luit (Semen A. Ustimenko).
- 582. Various xdm updates from Debian and Suse (#5358, Branden Robinson,
- #5511, Sebastian Krahmer).
- 581. Flesh out suncg6's SaveScreen() function (Moritz Bunkus).
- 580. lib/Xaw/MultiSrc.c improperly checks open() return value
- (A.1415, Jaromir Dolecek), Fix provided by Hideo Saito in NetBSD.
- 579. Add DPMS and screen blanking support in the sunffb driver
- (Ferris McCormick).
- 578. Fix SEGV that occurs when Xsun* runs into an unrecognized framebuffer
- type (Marc La France).
- 577. When the mode on server entry is found to be using composite sync on a
- Mach64 variant, turn on the "compositesync" option (Marc La France).
- 576. Plug SIGIO hole while the server is switching back into its VT
- (reported by Michel Lespinasse).
- 575. Use shadowfb in XDarwin fullscreen Quartz mode (Torrey T. Lyons).
- 574. Make RENDER optional for Xvfb. When RENDER is enabled add depth 32
- pixmap format to list of supported pixmaps (Egbert Eich).
- 573. Fix va_args glitches for xterm/libfontconfig: 0 == (void*)0 isn't true
- for all platforms (Egbert Eich).
- 572. Fix lbxproxy to also build on platforms that don't have snprintf()
- (Egbert Eich).
- 571. Fix va_args glitches in mkfontscale: arg stack isn't preserved after
- calling va_arg on all platforms (Egbert Eich).
- 570. Fixed x11perf aa benchmarks to support non-default visuals/colormaps
- (Egbert Eich).
- 569. Use -Os to build on Darwin PPC with Gcc 3.x (Torrey T. Lyons).
- 568. XEditResCheckMessages trashed XtMalloced memory on some widget
- hierarchies, due to using incorrect indexes when removing
- duplicates (A.1409, Rob Arthan).
- 567. xprop updates (Mihael Hategan).
- 566. Fix SEGV in ICE library (Petter Reinholdtsen).
- 565. Fix interaction between backing store and miext/shadow (adapted from
- Paulo César Pereira de Andrade).
- 564. Add new key descriptions for XFree86 special keys (i.e. for terminating
- and VT switching the Xserver) (#5510, Ivan Pascal).
- 563. #define DEALLOCATE_LOCAL as "do {} while(0)" instead of nothing to
- eliminate GCC warnings caused by code that does not assume
- DEALLOCATE_LOCAL can deal with null pointers (suggested by Kevin Martin).
- 562. -
- 561. Fix bug in kldload() call on FreeBSD (reported by Joy Ganguly).
- 560. Adding int10 symbols to the list of possibly unresolved symbols in
- Rage128 driver (Egbert Eich).
- 559. Allowing scanpci to be build on Ppc (Egbert Eich).
- 558. Updating SiS driver. Lots of new features, supported chipsets and
- LCD panels, bug fixes. For details please check:
- http://www.winischhofer.net/linuxsis630.shtml
- (Thomas Winischhofer).
- 557. Changed MGA driver to query fb_offset for DRI from kernel instead
- of taking the driver's FBAddress - this is required by platforms
- like Alpha (Egbert Eich).
- 556. Fix Xmu memory leak (reported by Michael Vogt).
- 555. Deal with Creative SBlive devices that mis-identify themselves as
- "prehistoric" VGA's (Marc La France).
- 554. Allow -configure to setup Unknown Vendor/Boards removing the requirement
- of xf86PciInfo information (Alan Hourihane).
- 553. Hardware alpha blended cursors in the "nv" driver, new PCI IDs, and
- a fix for a problem on PowerPC (Mark Vojkovich).
- 552. "nv" driver workaround needed to let Xv continue to work after a
- suspend on some laptops (Pierre Lombard).
- 551. Restore '--assembler-with-cpp' in AsCmd for Linux/mips, fixing the build
- on that platform (#5499, Guido Guenther).
- 550. An alternative update for alphabetic four level cz, sk XKB maps.
- This is compatible with the way MS Windows behaves (#5498, Kamil Toman).
- 549. Clarify the difference between characters and bytes in xev (#5497,
- Markus Kuhn).
- 548. Add an Irish (ie) XKB keyboard map (#5496, Seamus O Ciardhuain).
- 547. Replace the UTF-8 compose map with one automatically generated from
- the official Unicode documentation, with the addition of some
- handwritten rules (#5495, David Monniaux).
- 546. Document the "nomtrr" option in the XF86Config man page (#5494,
- Mike Harris).
- 545. Some fixes for the Icelandic xkb map (#5493, Olafur Osvaldsson).
- 544. Add French Canadian keyboard description to xfree86.lst (#5492,
- Mike Harris).
- 543. Add a new file for descriptions of XkbModel, XkbLayout, XkbVariant
- and XkbOption names, using an XML format. Includes a DTD file
- and perl script to convert from the new format to the old (.lst)
- format (#5491, Ivan Pascal).
- 542. Add missing "dvorak" single-group XKB layout (#5490, Ivan Pascal).
- 541. Change the xkbfile library to allow some names to be grouped into
- a named list, which allows the rules file to be simplified (#5490,
- Ivan Pascal).
- 540. Make the new single-group XKB symbols maps used by default (#5490,
- Ivan Pascal).
- 539. Fix a crash that can happen when some apps are run in CJK locales
- (#5489, Havoc Pennington).
- 538. Make xdm check the full password string (on Linux) for locked accounts
- rather than just the first character (#5485, Mike Harris,
- Nalin Dahyabhai).
- 537. Fix a few cases where the transport endpoints would be removed
- even if NOUNLINK is specified in the flags (#5484, J. Kean Johnston).
- 536. Attempt to fix bitblt problems when doing offscreen pixmaps in
- i810 (Egbert Eich).
- 535. Change Build rule so that x86 assembler code for MESA can be completely
- disabled on i386 (Egbert Eich).
- 534. Added IEEE Optimization for x86-64 (Egbert Eich).
- 533. Initialized fullscreen in DRIscreenPrivate to a vaild value
- (Egbert Eich).
- 532. Fixed module loader to map memory in the low 32bit address space on
- x86-64 (Egbert Eich).
- 531. Shifted Keypad delete: added KP_Separator for de_DE and de_CH keyboard.
- 530. Added sanity checks to various scripts (Egbert Eich).
- 529. Fixed Trident RGB16 video playback mode (Alastair Robinsion).
- 528. i810 only set OVRACT register when TVout isn't enabled
- (Sebastien BASTARD, Matthew J. Sottek, Egbert Eich).
- 527. Record changes of BusMaster state so that pciDisable/Enable/Mem/Io
- don't override these (Egbert Eich).
- 526. Fixed RAC code: when no resources are shared chips may still need
- RAC for bus access if both require non overlapping parts of the
- VGA resources (Egbert Eich).
- 525. Fix for resource registration of C&T and Tdfx driver (Egbert Eich).
- 524. Prevent core dumps in Xutf8Reset/Lookup code of Xlib (Masaru Yokoi).
- 523. Added support for BE systems for C&T driver (Michael Stephen Hanni).
- 522. Added support for special keys found on many ACPI control, Easy Access
- Keyboards, Internet keyboards, laptops, notebooks and PDA (via
- xkb/symbols/inet). Added new key symbols for these keyboards
- (Stanislav Brabec).
- 521. Fixed some problems with ininite loops which where introduced
- with the host bridge specific code (Egbert Eich).
- 520. AXP domain support (Jeff Wiedemeier).
- 519. Added -m32 flag to c++ when build on ia32 (Egbert Eich).
- 518. -
- 517. Added rule to be able to use Numlock key on broken IBM keyboards
- (Stefan Dirsch).
- 516. Fixed Xlib build rules so it builds a truly static library again
- (Egbert Eich).
- 515. When compiled with GCC, force imake to generate Makefile's using GCC's
- preprocessor rather than a system-provided one (Marc La France).
- 514. Replace hard-coded "lib" directory names with LibDirName in X11.tmpl
- (#5480, Mike Harris).
- 513. Add some README files for XKB and it's configuration files (#5479, 5483,
- Kamil Toman).
- 512. Fixes for the "pc" cz and sk XKB maps:
- - readded cz_qwerty (but new pc/ style) map
- - added bskl variant missing in cz_qwerty and sk, sk_qwerty
- - fixed keypad decimal key definition to affect only defined group
- in cz, cz_qwerty
- - missing SPCE definition readded to sk, sk_qwerty
- (#5478, Kamil Toman).
- 511. Union Reality UR-F98 headtracker input driver (Linux-only) (#5476, 5477,
- Alan Cox).
- 510. Palmax PD1100 touch screen driver (#5475, 5477, Alan Cox).
- 509. Fujitsu Stylistic input driver (#5474, 5477, Rob Tsuk, John Apfelbaum,
- Richard Miller-Smith, Alan Cox).
- 508. Initialise ProgramName in xterm's main before referencing it (#5473,
- Peter Valchev).
- 507. Add an Ogham XKB keyboard map (#5472, Seamus O Ciardhuain).
- 506. Handle Alt+Ctrl+Shift+SPECIAL differently from Alt+Ctrl+SPECIAL
- where SPECIAL is one of the fallback built-in XFree86 hot keys
- (#5468, J. Kean Johnston).
- 505. Add Syriac XKB keyboard maps (#5467, Emil Soleyman-Zomalan).
- 504. Rename HasKatmaiSupport to HasSSESupport (#5461-5463, 5465, Mike Harris).
- 503. Add mouse wheel support for SCO OpenServer (#5460, J. Kean Johnston).
- 502. Fix i18n problem in xmessage due to use of the useStringInPlace
- resource (A.1381, Chisato Yamauchi).
- 501. Fix xnest build on file systems that are not case sensitive
- (Torrey T. Lyons).
- 500. Use unique local Imake define for fonts.conf dir (#5482, Mike A. Harris)
- 499. Fix xc/lib/Imakefile to not break HasFontconfig (#5481, Mike A. Harris)
- 498. Refresh screen after wake from sleep in XDarwin full screen mode
- (Torrey T. Lyons).
- 497. Fixes and updates for the SCO OpenServer port (#5459, J. Kean Johnston).
- 496. Add PCI ID defines for some ATI R300 chipsets (#5458,
- Vladimir Dergachev).
- 495. Fix error message typo in MakeRootTile() (#5451, Mike Harris).
- 494. Redirect hostname's stderr in the xon script (#5450, Mike Harris).
- 493. Add a request to the XFree86-Misc extension for querying the
- X server's config file, module path, and log file name (#5456, Joe Moss).
- 492. Add support for using the XKEYBOARD extension's action handlers
- for the XFree86 X server hot keys. This provides control over
- the mapping of these hot keys (#A.1334, 5454, Joe Moss).
- 491. Reinstate the X server -xkbdir option, but only when the X server's
- real and effective uids are the same (based on #A.1132, Ivan Popov).
- 490. Fix an xkbcomp bug that prevents a later definition from specifying
- actions if the previous definition didn't (#5471, Joe Moss).
- 489. Add a stub handler to xkbcomp for the DeviceValuator action (#A.1341,
- Joe Moss).
- 488. Fix broken software cursor with XDarwin's new event handling
- (Torrey T. Lyons).
- 487. Change imake so that, when compiled with GCC, it invokes the pre-
- processor through the gcc front-end, passing it imake's -v flag
- (Marc La France).
- 486. xf86cfg and xf86config patches, includind 1400x1050 mode, update list
- of modules, auto inclusion of the xtt module when running X -configure
- (A.1363, A.1364, A.1365, Chisato Yamauchi).
- 485. Fix unbalanced paranthesis in linuxPci.c (#5466, Ishikawa Mutsumi).
- 484. Remove "Option VideoRam" from savage driver, there's no need for it,
- and utilize the entities given VideoRam size (Alan Hourihane).
- 483. Fix fontconfig to obey NothingOutsideProjectRoot, so that the directory
- /usr/share/fonts is ignored in this case (#A.1325, Joe Moss).
- 482. Fix a segfault when using xkbcomp's -I option, and update the man
- page to correctly document the way this option works (#5447, Joe Moss).
- 481. Don't assume mmap returns the pointer hint requested. This is in
- the DENSE map code for Linux/alpha (#5439, Ray Strode).
- 480. Build fix for r128_accel on PPC when DRI is disabled (based on
- #5438, Mike Harris and #5449, Matthieu Herrb).
- 479. Updates to bdf/misc UCS fonts (#5446, 5453, Markus Kuhn).
- 478. Fix Thai glyphs in the 6x13 UCS font (#5427, Theppitak Karoonboonyanan).
- 477. Add Thai glyphs to 7x13, 7x13B, 7x13O, 7x14, 7x14B UCS fonts
- (#5445, Theppitak Karoonboonyanan).
- 476. Add Thai subfont generation based on the ISO8859-11 map from unicode.org
- (#5434, 5445, Theppitak Karoonboonyanan).
- 475. Update the multilayout version of the Greek (el) xkb symbols (#5425,
- Vasilis Vasaitis).
- 474. On XDarwin startup, do not send events to the X server thread until it
- is ready to receive them (Torrey T. Lyons).
- 473. Add a utility (called gtf) for calculating VESA GTF mode lines
- (Andy Ritger).
- 472. Add an input driver for KB-Gear's Jamstudio pentablet (A.1328,
- Brian Goines).
- 471. Add a Tektronix 4957 input driver (#A.1211, Olivier Danet).
- 470. Fix backing store in Rage 128 and Radeon drivers (Kevin Martin).
- 469. Fix Mono8x8 code in savage driver, needed ROP_NEEDS_SOURCE, also
- add NO_PLANEMASK to ScreenToScreen as code doesn't handle that case
- (Alan Hourihane).
- 468. Add a little utility to read and write I/O ports, for those host
- architectures that have them (Marc La France).
- 467. Ignore (with messages) any HorizSync and VertRefresh specifications for
- panels when using ATI LT, LTPro, XL and Mobility M1 (Marc La France).
- 466. Fix a build failure when BuildServersOnly is defined and XnestServer
- is not defined, and when /usr/X11R6 is not installed. (#A.1145,
- Valeriy E. Ushakov).
- 465. Fix panel support bug for ATI LTPro, XL and Mobility M1 chips
- (Marc La France).
- 464. Fix mode validation to deal with video memory sizes 256MB or greater
- (Marc La France).
- 463. Add ARGB cursors support to the vmware driver (#5442, Nolan Leake).
- 462. Add more query options to glxinfo (#5441, Brian Paul).
- 461. Fix a typo in glxinfo (#5440, D. Hageman).
- 460. Fix a memory leak in Cygwin/XFree86 server (#5444, Kensuke Matsuzaki).
- 459. Missing fallback to miPolyArc in fbarc.c (#A.1339, Ralf Klingebiel).
- 458. Fix the cyrix driver support for the 5510, 5520 and 5530. This driver
- only works with VSA1 based chips (#A.1260, Alan Cox).
- 457. When building with gcc >= 2.8, generate Makefiles with `imake -Wundef`
- (Marc La France).
- 456. Re-instate changes clobbered by DRI merge (Marc La France).
- 455. Fix a typo in shadowfb support from #5413 (#5430, Nolan Leake).
- 454. Fix a bug in vmware's HW cursor support which conditionally hid the
- cursor (#5430, Nolan Leake).
- 453. Fix an initialization problem in the calcomp input driver (#A.1056,
- Josef Walzer).
- 452. Add command line and XF86Config options to control Render color
- allocation on dynamic indexed visuals (Olivier Chapuis, Keith Packard)
- 451. Keep track of whether the 830/845G HW cursor should be visible or
- hidden so that it doesn't get turned on when it shouldn't (David Dawes).
- 450. Fix for DGA offset inconsistency in the 830/845G driver (based on
- a patch from Edgar Toernig).
- 449. Fix a memory leak when calling _XCloseLC and removing the loadable
- locales (#A.855 Mark Robinson).
- 448. Fix input size of character strings used in lib/X11/lcGetConv.c (#A.828,
- Yong-Jhen Hong).
- 447. Add Shape extension support to Cygwin/XFree86 rootless mode (#5431,
- Matsuzaki Kensuke).
- 446. Fix a typo in the s3 driver which prevented virtual display sizes.
- (#A.965, Stef Voltz).
- 445. Fix a server crash that can happen when a DGA client frees its colormap
- before setting the mode back to the original mode (David Dawes).
- 444. Modify Type1 font RAM allocation heuristics to allow for larger fonts.
- (#A.1121, Melchior Franz).
- 443. Add new relocation entries for Alpha architecture to the loader which
- are used when compiling with gcc >3.1 (#A.819, Thorsten Kranzkowski).
- 442. Fix server crash when using Xinerama when application closes.
- (#A.808, Tsukahara Ken).
- 441. Import Mesa-4.0.4, and resync with the DRI trunk (DRI Project).
- 440. Server support for the alpha architecture on OpenBSD 3.2.
- (Matthieu Herrb, Arthur Grabowski).
- 439. Workaround for <linux/input.h> conflict (Marc La France).
-
-XFree86 4.2.99.2 (21 October 2002)
- 438. Fix some memory leaks in libX11 i18n code (#A.1314, Olivier Chapuis).
- 437. Add DGA and Xvideo support to the i740 driver (#A.1307, Kopecek Tomas).
- 436. Fix the number of beeps when using AccessX and XKB
- (#A.1302, Alan Coopersmith).
- 435. Add twelve hour format to xclock's digital format
- (#A.1285, Brian L. Matthews).
- 434. Fix application crash when using DPS client libraries
- (#A.1282, Frank Giessler).
- 433. Fix pixmap cache corruption on VT switches in mga driver
- (#A.1279, Ross Mikosh).
- 432. Add missing Increment option in Summa input driver (#A.1276, G.P.Halkes).
- 431. Missing semicolon in twm/gram.y (#A.1307, Jim Gifford).
- 430. Cygwin/XFree86 updates
- - Add X.ico, an icon for Windows (Harold Hunt, Jehan Bing)
- - Include a preliminary pseudo-rootless mode (Matsuzaki Kensuke)
- - XF86Config file support (Alexander Gottwald)
- - Scrollbars support (Jehan Bing, Harold Hunt)
- (#5424, Cygwin/XFree86 developers).
- 429. Add ko_KR.UTF-8 and ja_JP.UTF-8 XLC_LOCALE files (#5421, Jungshik Shin).
- 428. Add TCVN support to luit (#5416, Tomohiro KUBOTA).
- 427. Expand luit to support several major non-ISO-2022-compliant
- encodings such as GBK and Shift_JIS (#5416, Tomohiro KUBOTA).
- 426. Add support for double-buffering to the tdfx driver's XVideo overlay
- support (#5415, Stephen Davies).
- 425. Add a -strftime option for xclock's digital mode (#5414, George Belotsky).
- 424. README.fonts update (#5409, 5410, Khoda Hafez).
- 423. Major update for VMware driver
- - recoded to use XAA, offscreen memory support, and color expansion code
- - Add RENDER support
- - Optimization of HWcursor
- - Bug fixes for HWcursor in 8bit mode and VT switching
- (#5423, Nolan Leake, VMware).
- 422. Updates for shadowfb code
- - Add RENDER support
- - support for pre-fb modifications
- - support for real framebuffers rather than memory based framebuffer
- - Removal of old fullscreen update code (when VT switching)
- - fix bug in FillSpans
- (#5411, #5413, Nolan Leake, VMware).
- 421. Clear the list of registered renderers at the start of each new server
- generation, and only print warnings about suffixes with more than
- one registered renderer for the first generation (David Dawes).
- 420. Make xf86PrintModes() show which modes are hot-key switchable
- (David Dawes).
- 419. Fix the vesa driver's misuse of virtualX for displayWidth (David Dawes).
- 418. Fix the VBE module's depth/bpp matching, which fixes some 24/32 problems
- as well as some 15/16 problems (David Dawes).
- 417. Fix black cursor images on Mac OS X 10.2.2 (Joseph Maurer).
- 416. Fix hotkey switching for user-specified modes, and fix hotkey switching
- between all valid modes when no specific modes are specified in the
- config file (David Dawes).
- 415. Trival input drivers Imakefile cleanup (#5299, Mike Harris).
- 414. Use INSTDATFLAGS when installing X server modules (#5292,
- Branden Robinson).
- 413. Fix the iso8859-15 Compose map -- there is no diaeresis codepoint
- in iso8859-15 (#5389, Wolfgang Sourdeau, Rüdiger Kuhlman).
- 412. Acute/apostrophe fix for nodeadkeys section of XKB German symbols
- (#5388, Andreas Metzler).
- 411. Fix Cards file typo (#5387, Branden Robinson).
- 410. Cleanup the XKB Macinosh US keyboard symbols, and remove those that
- should be in other country maps (#5386, Branden Robinson).
- 409. Add a user-configurable throttle on xconsole's number of saved lines
- (#5379, Branden Robinson).
- 408. Fix missing declaration of XShmGetEventBase() in XShm.h (#5375,
- Branden Robinson).
- 407. Remove inconsistencies in the way extension headers are referred to
- in most extension libraries (David Dawes).
- 406. Install extension struct/protocol headers that weren't already
- being installed (#5369, Branden Robinson).
- 405. Fix long-standing colour map bug in ATI driver (Marc La France).
- 404. Enable imake.c to perform correct C library version detection on hppa
- machines (#5372, Ben Collins).
- 403. Add new Imake rules to handle C++ programs that don't have man pages
- (#5371, Branden Robinson).
- 402. Add a -color app-defaults file for xmessage that exercises some
- features of Xaw7, and fix the base app-defaults to not use the no
- longer supported "whenNeeded" value for the "Scroll" resource (#5370,
- Branden Robinson).
- 401. Stop the drm module from creating a world-writable directory in /dev.
- Since dev nodes can only be created by root, there's no need for
- anyone else to be able to write to /dev/dri (#5367, Brendan O'Dea,
- #5380, 5422, Mike Harris).
- 400. Fix a SEGV in lbxproxy because it's ResizeReverseMap() makes assumptions
- about the atom numbers that can lead to unallocated memory being
- accessed (#5366, Branden Robinson and Anthony DeRobertis).
- 399. Increase the wacom driver's timeout for reading data after a request.
- This is needed for PalmWac (Wacom emulation for PalmOS) (#5364,
- Mathieu Clabaut).
- 398. Add Big5-HKSCS to locale.dir, and fix a missing portion in X-TT's
- Big5HKSCS-Unicode table (#5362, Branden Robinson and ThizLinux
- Laboratory Ltd).
- 397. Handle vetoed APM suspend events properly on Linux (#5362,
- Branden Robinson).
- 396. Handle ARM and HP-PA separately from m68k and PowerPC in xfree86.cf,
- and some cleanups (#5360, Branden Robinson).
- 395. xfs updates and cleanups (#5359, Branden Robinson).
- 394. Fix for random crashes when a screen fails to initialise (Marc La France).
- 393. Update RandR to include refresh rates (v1.1) (Keith Packard)
- 392. Numerous man pages fixes, add some missing manpages (#5365, #5373,
- #5376, #5377, #5382-5385, #5390, #5391, #5393, #5295 Branden Robinson
- #5374, Jonathan Amery, #5378, Jochen Voss)
- 391. Install bdftruncate and ucs2any without the .pl extension
- (#5391, Branden Robinson)
- 390. Rewrite Radeon DDC/DFP mode detection and management (Kevin Martin).
- 389. Integrate ATI patch:
- - Add 2D support for Radeon 9000 (RV250), Mobility M9 (RV250 mobile)
- and Radeon 9700 (R300)
- - Clone mode fixes and improvements
- - Dell VE card fixes
- - Dual-head VT switching fixes
- - General code clean up
- (#A.1217, Hui Yu@ATI).
- 388. Rewrite XDarwin's event handling to fix some bugs and to use
- SetInputCheck() for a performance boost (Torrey T. Lyons).
- 387. Add a little utility to write files through mmap() (Marc La France).
- 386. Add National Semiconductor Geode driver, support for the 5530, SC1200
- and SC1400 chipsets (NSC, Alan Hourihane).
- 385. linux.cf updates:
- - Resync the DebianMaintainer #define and the stuff in the
- corresponding if block to meet Debian's current needs.
- - Sort long chains of architecture-dependent #if-#elif directives in
- ASCII order.
- - Add explicit recongition of several architectures to the #ifndef
- BuildXF86DRI block.
- - Define a fallback CplusplusCmd (g++) if we don't recongize the
- platform we're on.
- - Turn off the loadable server on MIPS and SuperH platforms, where it
- doesn't (yet) work.
- - Trash some unneeded #defines in the Mc68020Architecture compilation
- environment.
- - Remove the block that #defines HasXserver NO for the s390 and s390x
- architectures (things like Xvfb build fine on these platforms).
- (#5357, Branden Robinson).
- 384. Fix an error in the Finnish XKB keyboard map (#5356, Marko Myllynen).
- 383. Add a Malayalam XKB keyboard map (#5355, Baiju M).
- 382. Add a "kbd" driver module that can eventually replace the built-in
- "keyboard" driver (#5344, Ivan Pascal).
- 381. Add os-support level support for a loadable keyboard driver for BSD
- and Linux (#5344, Ivan Pascal).
- 380. Add some new common layer functions for supporting a loadable keyboard
- driver (#5344, Ivan Pascal).
- 379. Move the XkbDisable option to a global server flag rather than
- keyboard driver flag, since it really is a global setting (#5344,
- Ivan Pascal).
- 378. Fix RenderCreateCursor's conversion from an ARGB cursor to a 2-color
- cursor when the cursor is wider than 8 pixels (#5353, Greg Parker).
- 377. Fix 24bpp displays with the fbdev driver when not using shadowfb
- (#5351, Michel Lanners).
- 376. Fixes and improvements for the en_US.UTF8 compose rules (#5346,
- Alexandre Oliva).
- 375. Fix compose rules for some dead accents for iso8859-1 and iso8859-15
- (#5338, 5339, Alexandre Oliva).
- 374. Add support for th_TH.UTF-8. with XIM (#5336, Theppitak Karoonboonyanan).
- 373. Fix some bugs in the Thai XIM:
- - excessive '(' char when switching XKB keyboard group
- - ineffective Ctrl-<key> and Alt-<key>
- (#5335, Theppitak Karoonboonyanan).
- 372. Add an X server command line flag (-br) to make the default root window
- solid black (#5334, Jens Owen).
- 371. Add support for th_TH.ISO-8859-11 (#5327, Theppitak Karoonboonyanan).
- 370. Use pci_alloc_consistent/pci_free_consistent instead of the
- local page alloc/free functions in the i810 and i830 DRM drivers
- (#5323, Arjan van de Ven).
- 369. Fix some non-POSIX usage of tail, expand and sort (#5322, Paul Eggert).
- 368. Fix bug in PCI code for Solaris/SPARC (Marc La France).
- 367. When enabling PCI adapters, also enable their bus mastering capability;
- Consequently, deprecate xf86EnablePciBusMaster() (Marc La France).
- 366. Fix lndir's handling of relative symbolic links, and update the man page
- to document the -withrevinfo flag (H. J. Lu, Marc La France).
- 365. Xdm patches: realloc usage, zero malloc()ated memory, enable
- /dev/urandom on NetBSD 1.4 and later, OpenBSD patches (#5345,
- Mike A. Harris, #5401, Matthias Scheler, Matthieu Herrb)
- 364. Xterm patches #168, #169 (Thomas Dickey).
- 363. In certain circumstances, allow VGA-rerouting through Simba bridges.
- This only affects UltraSPARC-IIi systems. This is a small but
- necessary step in eradicating SparcArchitecture's need to compile the ati
- dribver with -DAVOID_CPIO (Marc La France).
- 362. In int10, ignore interrupts whose simulation isn't yet implemented.
- Previously, such interrupts caused the emulation to stop. (Egbert Eich,
- Marc La France).
- 361. Add full support for multi-head on 460GX-based Itanium systems
- (Marc La France, with documentation loaned by Intel under NDA).
- 360. Fix Darwin build problems with libXrandr and the new FreeType2 backend
- (Torrey T. Lyons).
- 359. Savage driver updates.
- - Support for ProSavage DDR (PCI ID 0x8D04)
- - TV output fixes
- - support for -pixmap24 flag
- - XAA fixes to cure lockups
- (#5412, Tim Roberts).
- 358. Enable version controlled .dll's on Cygwin/XFree86 (Alexander Gottwald).
- 357. Some build fixes for Cygwin/XFree86 (Alan Hourihane).
- 356. Add new FreeType2 backend which fixes a bug with -c- fonts
- (#5347, #5348, Juliusz Chroboczek).
- 355. Add new command line options to glxinfo for more detailed output
- (#5354, Brian Paul).
- 354. Support for 24bpp, fix screen blanking and bug fixes for newport driver
- (#5329, #5349, Guido Guenther).
- 353. Add RandR support to XFree86 DDX. (Keith Packard)
- 352. Update RandR extension to 1.0. Eliminate depth switching
- (Keith Packard, Jim Gettys)
- 351. Fix XDarwin rootless crash when window resizing with complex bit
- gravity (Greg Parker).
- 350. Fix some incorrect mappings in the gbk-0.enc encodings file (#5313,
- Tomohiro KUBOTA).
- 349. Fix C precedence bug in mfb (#5309, Tassia St. Germain).
- 348. Updates to mkfontscale (#5307, Juliusz Chroboczek).
- 347. Add SharedXcursorReqs to Cygwin build (#5405, Harold Hunt).
- 346. Add image transformation and subpixel order to Render (Keith Packard)
- 345. Add Xcursor-def.cpp to Xcursor library (#5350, Alexander Gottwald).
- 344. Update to pci.ids to 2002-09-24 snapshot (Marc La France).
- 343. Add a little utility to read files through mmap() (Marc La France).
- 342. Implement a means to ignore certain host bridges while determining PCI
- bus topology (not yet used) (Marc La France).
- 341. Bridge driver interface fixups for host bridges (Marc La France).
- 340. Change makedepend to recognise invocations of parameter'ed macros
- (Marc La France).
- 339. Major redesign in the Xedit syntax highlight code. Now there isn't
- anymore the builtin C mode, but a new version using the xedit lisp
- interpreter, as well as several new modes, including Lisp/Scheme,
- Imakefile, X Resource files, Makefile, Manpage source, Sgml and
- Html (Paulo César Pereira de Andrade).
- 338. Print a warning if more than one renderer is registered for a font type
- (#5305, Juliusz Chroboczek).
- 337. Fix a double free() that can cause a crash in XCloseIM() (based one
- #5303, Mo DeJong).
- 336. Allow xman's MANCONF definition to be specified in the Imakefile
- (based on #5302, Mike Harris).
- 335. Config typo and update for Linux on Hitachi SuperH architecture (#5301,
- ISHIKAWA Mutsumi).
- 334. Add a "DefaultRefresh" option to the vesa driver (David Dawes).
- 333. Fix build problem when calling GNU make with "--" prefixed options
- (#5291, Toomas (toomas at tklabor.ee)).
- 332. Avoid noise from hostname call in startx (#5270, Mike Harris).
- 331. xwd ignores the -frame option if the -id option is used (#5251,
- Mike Harris).
- 330. Fix problem where DRIUnlock was called when DRI fails to load
- (Kevin Martin)
- 329. Fix erroneous warnings about removing DRM signal handler when DRI
- fails to load (Kevin Martin)
- 328. Add LINE_LIMIT_COORDS option to XAA to work around limited coordinate
- space for lines on Radeons (Kevin Martin)
- 327. Fix Radeon DGA code to use XAA sync function (Michel Dänzer)
- 326. Major rework of Radeon accel code:
- - Merge CP and MMIO code (Kevin Martin and Michel Dänzer)
- - Fix indirect buffer CP code (Kevin Martin and Michel Dänzer)
- - Add CP support for scanline color expansion and image writes
- (Michel Dänzer)
- - Fix Mono8x8 problems (Kevin Martin and Michel Dänzer)
- - Fix clipping routine to properly set transparency and
- dp_gui_master_cntl reg (Kevin Martin and Michel Dänzer)
- - Fix clipping calculation errors (Kevin Martin)
- - Properly set line bias so that sw rendered solid and dashed lines
- match the accel TwoPoint lines (Kevin Martin)
- - Fix drawing last point for solid and dashed lines (Kevin Martin)
- - Remove NoLineAccel option since two point lines work (Kevin Martin)
- 325. Export some more Xft symbols (Cygwin) that are needed for qt 3.x
- (#5285, Ralf Habacker).
- 324. Don't sleep on Cygwin for ICE directory mode problems (#5284,
- Ralf Habacker).
- 323. Fix a bug in XtGetDisplays() with more than 1 open display (#5282,
- Kip Rugger).
- 322. Second part of xkb multi-layout keyboard map support (#5321,
- Ivan Pascal).
- 321. Allow the Record extension to report logical coordinated with Xinerama
- (#5231, Paul Stewart).
- 320. Allow the XTrap extension to report logical coordinated with Xinerama
- (#5230, Paul Stewart).
- 319. Moved LdPreLib define after the vendor/OS specific config files
- as it may depend on setting done there (Egbert Eich).
- 318. Several fixes for cross compile environment (Egbert Eich).
- 317. Added code to allow for building of static only libraries with
- -fPIC for platforms which require it (Egbert Eich).
- 316. Added '-m32' to gcc flags as default for ia32 builds when gcc version
- is >= 3.1. This allows building a 32 bit Version of X on 64bit x86-64
- (Egbert Eich).
- 315. Changed direct calls of ld to 'gcc -nostdlib' for Linux (Egbert Eich).
- 314. Changed calls to as to 'gcc -c -x assembler-with-cpp' for Linux
- (Egbert Eich).
- 313. Added '-fno-strict-aliasing' flag to gcc version >= 3.1 (Egbert Eich).
- Strict requires that one address must not contain pointers to
- different types - a feature heavily used by X (Egbert Eich).
- 312. Fixed a core dump problem in libXtt (?) (Egbert Eich).
- 311. Removed '#pragma pack' from structures that contain function pointers
- in x86emu. This causes problems on gcc 3.1 for ia64 (Egbert Eich).
- 310. Added defines for missing X types to saverproto.h (Egbert Eich).
- 309. Fixed compiler warings generated by gcc >= 3.1 in mesa drivers
- (Egbert Eich).
- 308. For platforms that allow both 32 and 64 bit libraries to be executed
- split Xlib i18n modules path into
- <libpath>/X11R6/lib/X11/locale/lib/common and
- <libpath>/X11R6/lib/X11/locale/lib64/common. 'lib64' has been defined
- to be the default path for 64bit shared libraries on these platforms
- (Egbert Eich).
- 307. Fixed obvious typo in OMlib (Egbert Eich).
- 306. Fixed code in cfb that didn't comply with C sequence rules.
- Modern C compilers tend to be more aggressive on code reordering
- (Egbert Eich).
- 305. Changed arguments of NoopDDA() from VarArgs to void. Handling
- of VarArgs by gcc isn't compatible with the way it was used
- on certain platforms (Egbert Eich).
- 304. Added support for 32bit pixmaps for 24bit overlay framebuffers in
- fb overlay code (Egbert Eich).
- 303. Fixed kdrive to print a meaningful error message instead of just
- core dump when no matching graphics cards is found (Egbert Eich).
- 302. fixed portability bug in xwd (Andreas Schwab <schwab@suse.de>)
- 301. fixed X Server crash, which happended each time a proportional iso10646
- font was loaded with xtt backend (Yong Li <rigel863@yahoo.com>)
- 300. Added some ARM specific fixes to compiler.h (Uli Hecht).
- 299. Added a virtual 'dummy' driver (Egbert Eich).
- 298. Fixed core dump when certain access functions are not set in
- xf86Bus.c (Egbert Eich).
- 297. Fixed problem where SIGIO could be disabled after a server reset.
- 296. Added configurable list of devices the xf86Misc extension is allowed
- to change the mouse device to (Egbert Eich).
- 295. Changed default mouse type to 'auto' when generating config file
- with '-configure' (Egbert Eich).
- 294. Made sure keyboard modifier settings are consistent after exit
- from DGA when the xkb extension is used (Egbert Eich).
- 293. Disabled keyboard processing when Xserver is suspended by power
- management.
- This allows effective locking of laptops when stolen (Egbert Eich).
- 292. Added/improved options for lockfile syncing (Egbert Eich).
- 291. Added support for backup copy of Xserver logfile (Egbert Eich).
- 290. Fixed GetTimeInMillis() to use deltas instead of absolute time
- returend by gettimeofday(). This ensures time is monotonic in X
- (Egbert Eich).
- 289. Fixed xf86Misc extension to allow modification of Expps2 mice
- (Egbert Eich).
- 288. Made code in xf86MiscExt.c more readable (Egbert Eich).
- 287. Fixed PCI CardBus bridge handling (Egbert Eich).
- 286. Added code to reenable PCI bus mastering after coming back from a
- VT switch to radeon driver (Charl P. Botha <http://cpbotha.net/>)
- (Egbert Eich).
- 285. Dito for r128 driver (M. Harris).
- 284. Dito for glint and mga driver (Egbert Eich).
- 283. Fixed double scan issues for low res modes in C&T driver (Egbert Eich).
- 282. Set rgbBits to 8 for all HiQV chips in chips driver (Egbert Eich).
- 281. Moved initialization of accel funtions past initialization of
- offscreen fb manager in chips driver (Egbert Eich).
- 280. Fixed initialization of video in chips driver (?).
- 279. Fixed HALlib problem restoring text mode on G550 (Egbert Eich).
- 278. Restructured and included Matrox's Merged Framebuffer changes
- to mga driver (Egbert Eich).
- 277. G450/550 clockchip programming fixes (Matrox).
- 276. Fixed HW Cursor for HALlib frame granularity (Egbert Eich).
- 275. Enabling 2D accel in 24-bit for neomagic 2360 and 2380 (Egbert Eich).
- 274. Added support for builtin 1024x480 mode of Sony subnotebooks for
- Neomagic driver (Egbert Eich).
- 273. Fixed support for lowRes (320x240) modes in neomagic driver
- (Egbert Eich).
- 272. Fixed RAC function registration in S3 driver (Egbert Eich).
- 271. Added some voodoo to screen initialization of S3 driver (Egbert Eich).
- 270. Fixed vbe/int10 support in SMI driver. It used to core dump
- when BIOS was not usable (Egbert Eich).
- 269. Separated BRIGHTNESS and and CAPTURE_BRIGNTESS video attributes
- in smi driver: CAPTURE_BRIGHTNESS refers to the capture chip
- (ie. Philips SAA7110) while BRIGHTNESS controls the video overlay
- of the SMI chip itself (Egbert Eich).
- 268. Disable automatic loading of DRI when running SUN ffb as this is
- inconsistent with other drivers (Thorsten Kukuk).
- 267. Fixed Gamma/Brightness code in trident driver (Egbert Eich).
- 266. Added FpDelay debugging option (Egbert Eich).
- 260. Fixed video support for Trident 9397 (Egbert Eich).
- 265. Fixed Cursor/VT switch support for vmware driver (Egbert Eich).
- 264. Fixed Blit problems in vmware driver when running KDE (Egbert Eich).
- 263. Added RENDER support to vmware driver (Egbert Eich).
- 262. Added C&T 69030 to extrapci.ids (Egbert Eich).
- 261. Improved mouse autodetection code (Egbert Eich).
- 260. Restructured int10 code so that vm86 and x86emu support can be loaded
- as modules. Implemented heuristic to try vm86 first and fall back to
- x86emu. This allows 32 bit Xservers to run on x86_64 on 64-bit kernel
- without vm86 support (Egbert Eich).
- 259. Restructured elf loader: determine which section to load from elfheader
- flags (Egbert Eich).
- 258. Adding RENDER Support to RAC (Egbert Eich).
- 257. Using borderClip instead of borderSize region for redisplay function
- in miext/shadow code to avoid core dumps when vt switched away
- (Egbert Eich).
- 256. Replacing sprintf() by snprintf() in lbxproxy to eliminate possible
- buffer overrun exploits (Egbert Eich).
- 255. KP_Decimal fixes to Czech and Slovak keybards
- (Jan Holesovsky <kendy@suse.cz>) (Egbert Eich).
- 254. Treat PCI-to-MCA and PCI-to_EISA bridges as PCI-to-ISA (Marc La France).
- 253. Correct the server's understanding of CardBus resource ranges
- (Marc La France).
- 252. Ignore unconfigured (and mis-configured) PCI-to-PCI and PCI-to-CardBus
- bridges (Marc La France).
- 251. Prevent infinite loops during VGA re-routing (Marc La France).
- 250. Add a framework for bus bridge drivers and use it to rework the handling
- of Sun's Simba P2P bridges (Marc La France).
- 249. Fix bdftopcf memory leak (Marc La France).
- 248. XVideo support for the i830 and i845G (David Dawes, Alan Hourihane).
- 247. Fix various bugs in the DRI support for the i830 and i845G
- (Keith Whitwell).
- 246. Major rework of the 2D i830/i845G support, including:
- - Improve VESA mode selection, and fix refresh rate selection.
- - Don't duplicate functions provided in the vbe modules.
- - Don't duplicate functions provided in the vgahw module.
- - Rewrite memory allocation.
- - Rewrite initialisation and save/restore state handling.
- - Decouple the i810 support from i830 and later.
- - Remove various unnecessary hacks and workarounds.
- - Fix an 845G problem with the ring buffer not in pre-allocated
- memory.
- - Fix screen blanking.
- - Fix some HW cursor glitches, and turn HW cursor off at VT switch
- and exit.
- - Don't attempt to use the i830's function 1 entity.
- - Fix problems with option handling.
- (David Dawes).
- 245. A "hammer" approach at ensuring font properties are freed properly
- (Marc La France).
- 244. Fix 'su' usage for FreeBSD in the default xdm config (Eric Anholt).
- 243. Fix a FreeBSD scrollwheel problem that shows up with gcc 3.1
- (Eric Anholt).
- 242. Make C++ libraries on FreeBSD get linked with $(CXX), fixing libGLU
- (Eric Anholt).
- 241. FreeBSD.cf updates, including enabling SSE/3DNow support (Eric Anholt).
- 240. Intel 830 and 845G DRI support, including i830 support updated for
- Mesa 4.x (#5288, Jeff Hartmann, 2D3D).
- 239. [SECURITY] Fix an Xlib problem that made it possible to load arbitrary
- code into privileged clients.
- 238. Add Xcursor library. Make Xlib use it. (Keith Packard)
- 237. Fix threaded libraries on Mac OS X 10.2 (A.1229, Marko Karppinen).
- 236. Add hardware accelerated GLX to XDarwin (Greg Parker).
- 235. Use Imake custom version variables in XDarwin startup message
- (Torrey T. Lyons).
- 234. Attempt to prevent PCI scans on non-PCI ix86 systems (Marc La France).
- 233. Allow master aborts on CardBus buses to complete normally during PCI
- scans (Marc La France).
- 232. Fix bug that prevented the server from restoring CardBus data properly
- (Marc La France).
- 231. Fix DEVID define and make it more generally available (Marc La France).
- 230. Fix bug in NetBSD PCI code (Marc La France).
- 229. Add an option to completely disable PCI scans (Marc La France).
- 228. Xterm patch #167 (Thomas Dickey).
- 227. Add CreateCursor request to Render extension (Keith Packard)
- 226. Change scanpci to not disable I/O too early (Marc La France).
- 225. Better error handling in xfs -ls argument parsing (Mordy Ovits).
- 224. Make loader ignore ELF objects that don't define any symbols (H. J. Lu)
- 223. Add a HasGcc3 imake symbol (Marc La France).
- 222. Enable threaded libraries on Darwin (Jeff Whitaker and Torrey T. Lyons).
- 221. Xaw documentation fixes (A.1218, Paul Vojta).
- 220. Add some mode collection/handling interfaces to the vbe module,
- which makes it easier for drivers to set modes via the video BIOS
- (David Dawes).
- 219. I830/845 Workaround for BIOSes which force 1MB stolen memory, and
- agpgart related fix (#5300, Abraham vd Merwe).
- 218. Add NetBSD specific PCI access functions for powerpc and alpha
- platforms (Charles Hannum).
- 217. Split bsd_video.c into architecture specific files, and merge NetBSD
- alpha and powerpc support there. (Matthieu Herrb, Simon Burge,
- Charles Hannum & other NetBSD developers).
- 216. Define CSRG_BASED for Darwin and fix xman so it works on Darwin
- (Torrey T. Lyons).
- 215. On Darwin, fix imake to find Gcc and correct config for RawCppCmd
- (Torrey T. Lyons).
- 214. Add functions to allow modules to query the core X server version
- and the version of its sub modules (David Dawes).
- 213. Fix scanpci's printing of 64-bit PCI bases (Marc La France).
- 212. Add missing dependency and regenerate xf86PciStdIds.h accordingly
- (Marc La France).
- 211. A more flexible way of dealing with ix86 motherboard chipsets that can
- only implement less than the full 256 PCI buses (Marc La France).
- 210. RAC-related fixups to ATI drivers and xf86SetOperatingState() call
- cleanups in most drivers (Marc La France).
- 209. Fix int10 miscompilation glitch on IA-64 (Marc La France).
- 208. Add support for Permedia3 (rev C) chips that use slightly different
- clock programming techniques (Jay Estabrook).
- 207. Fix Finder warnings about XDarwin plist format on Jaguar
- (Torrey T. Lyons).
- 206. Fix XDarwin build issues on Jaguar (Sean Fagan).
- 205. Fix Radeon DDC for non-Dell cards, and fix a radeon pci id-related
- build problem (#5326, Andrew C Aitchison).
- 204. Change the X server (and scanpci) to use the pci.ids file (from
- pciids.sf.net) for vendor/device descriptions (David Dawes).
- 203. Change XDarwin to use NSQuickDrawView instead of Carbon windows to
- get a QuickDraw graphics port for rootless windows (Torrey T. Lyons).
- 202. Add support for some missing 32-bit address modes to x86emu. Some
- video BIOSes use them, especially those for some of the integrated
- Intel chipsets, and this fixes int10/vbe support for these on
- platforms that use the emulator (David Dawes).
- 201. Add PCI ID for ATI Radeon Mobility M7 'LX' (#5233, Mike Harris).
- 200. Fix CrossCompile environment for Cygwin/XFree86
- (#5324, Alexander Gottwald, Harold Hunt).
- 199. ATI patch to:
- - Fix Dell OEM VE card support
- - Add better clone mode support
- - Fix large panel (>= 1600x1200) detection and initialization problems
- - Remove "PanelSize" and "CrtScreen" options since they are no longer
- needed with new CloneMode and improved flat panel support
- - Add "DDCMode" option to detect and use DDC modes
- - Add "PanelOff" option to disable panel on laptops
- - Fix corrupted console problem
- - Other misc fixes
- (#A.1043, Hui Yu@ATI).
- 198. Remove -DNO_TCP_H from cygwin.cf for Cygwin/XFree86 (#5320, Harold Hunt).
- 197. Major updates to Cygwin/XFree86.
- - fix depth 24 issues.
- - fix the handling of the DirectDraw module.
- - disable the use of the LAYER/RANDR extension.
- - lots of bug fixes.
- (#5318, #5317, Harold L. Hunt, Alan Hourihane).
- 196. When using the vesa driver and the DisplaySize option the server
- would crash with a floating point exception due to a divide by zero
- in miscreeninit() (#5298, Mike A. Harris).
- 195. The function MoveLine in lib/Xaw/TextAction.c sometimes attempts to
- read uninitialized memory when hit ctrl-N in a Text widget to move to
- the next line (#5245, Johnathan Kamens).
- 194. Adjust -probe for change in default stderr verbosity (Marc La France).
- 193. Radeon patch for Xv on all known Radeon devices (James Ralston and
- Keith Packard).
- 192. New XDarwin application icon (Michael Oland).
- 191. Dead strip unneeded code in rootlessValTree.c and other miscellaneous
- XDarwin code cleanup (Greg Parker and Torrey T. Lyons).
- 190. Lots of Cygwin/XFree86 cleanups and fixes (#5304, Harold Hunt)
- 189. Fix rootless XDarwin crash when resizing a window with negative x
- coordinate (Torrey T. Lyons).
-
-XFree86 4.2.99.1 (7 June 2002)
- 188. Fix some build problems when building with shared libraries disabled
- (David Dawes).
- 187. Update the magellan input driver and turn it on in the build process
- (#A.1024, Christoph Koulen).
- 186. Add Peritek Borealis support to the I128 driver (Robin Cutshaw).
- 185. Modify the r128 and radeon drivers to use fbdev's DPMS support when
- fbdev is enabled (#5219, Michel Dänzer).
- 184. Add support for the composite sync mode flag to the radeon driver
- (#5219, Michel Dänzer).
- 183. Add a mkfontscale utility for creating fonts.scale files (#5213, 5214,
- Juliusz Chroboczek).
- 182. Add a 1152x768 mode suitable for Titanium PowerBooks to the set of
- build-in modes (#5212, Michel Dänzer).
- 181. Add support to xkbcomp and libxkbfile for composing multi-layout
- keyboard maps from partial "single layout" files. This allows
- the XkbLayout to be specified as a comma-separated list of single
- layout names. Note: new "single layout" symbol maps aren't available
- yet. (#5210, Ivan Pascal).
- 180. Fix Xv endianess problem with the Radeon driver (#5207, Guido Guenther).
- 179. Updates to the Finnish xkb map, including:
- - add ISO-8859-15 missing symbols ([zZsS]caron)
- - reorganize some special symbols (such as paragraph, cent, division)
- - map AltGr+SPCE as space, nobreakspace comes way too often by accident
- - minor white space/comment cleanups
- (#5197, Marko Myllynen).
- 178. Add an option to the r128 driver for enabling DMA for Xv image transfers
- (#5195, Michel Dänzer).
- 177. Make the 'distclean' target remove depend files (#5194,
- Carlos A M dos Santos).
- 176. Fix bad usage of "UseInstalled" in FreeBSD.cf (#5192,
- Carlos A M dos Santos).
- 175. Several xkb layout updates:
- - Added other Armenian layouts.
- - Added Swedish dvorak layout.
- - Fixed typo in "la" file.
- - Added EuroSign in Dutch keyboard.
- - Added a "comma" variant for "ro" keyboard allowing to type real comma
- below Romanian letters.
- - New file "ro2" with the real Romanian layout (the file "ro" is not a
- Romanian keyboard, but a modified US one that has been hacked to
- include Romanian letters).
- (#5191, Pablo Saratxaga).
- 174. Fix makedepend so that it can parse a unary '+' operator (#5185,
- Mark Snitily).
- 173. Fix a typo in Xvesa's emulation of instructions forbidden in vm86
- mode (#5184, Juliusz Chroboczek)
- 172. Fix a bounds check in Xlib's Region code (#5183, Owen Taylor).
- 171. Fix LIBXML2LIBDIR name clash in lib/Imakefile (#5180, ISHIKAWA Mutsumi).
- 170. Avoid a problem with setfontdirs when run in some locales (#5179,
- ISHIKAWA Mutsumi).
- 169. A little tuning for XtAppPeekEvent() (#5178, Dan McNichol).
- 168. Add a command line option to luit to specify the encoding (#5177, 5181,
- Tomohiro Kubota).
- 167. A fix for luit's command line argument handling (#5173, Tomohiro Kubota).
- 166. Add support to luit for some more 8-bit encodings (#5171,
- Juliusz Chroboczek).
- 165. Add an option to luit to enable using GL codes instead of GR codes
- after a single shift for keyboard input (#5170-5172, Tomohiro Kubota
- and Juliusz Chroboczek).
- 164. Fix an fbdev driver crash when the VT isn't active (#5169,
- Michel Dänzer).
- 163. Fix a bug that resulted in XwcTextPropertyToTextList() storing an
- incomplete list (#5168, Tassia St. Germain, for X.Org).
- 162. Add "ISO8859-16" to the registry (#5167, Tassia St. Germain, for X.Org).
- 161. A revised Greek xkb layout, including a three-level "extended"
- variant, and a "polytonic" variant (#5165, Vasilis Vasaitis).
- 160. Add support for an el_GR.UTF-8 locale, including a compose file with
- support for polytonic Greek text (#5165, Vasilis Vasaitis).
- 159. Add missing zh_CN XI18N_OBJS file (#5164, Yong Li).
- 158. Make xfs chdir to "/" before fork()ing (#5162, Mike Harris).
- 157. Add some reference counting for Xlib's i18n modules, preventing
- a module getting unloaded while it's still in use (#5160, Owen Taylor).
- 156. Update for SCO OpenServer support (#5158, Kean Johnston).
- 155. Add aliases for the Brazilian Portuguese locale as defined on FreeBSD
- (#5157, Carlos A M dos Santos).
- 154. Recognise the en_UK.ISO8859-15 and en_US.ISO8859-15 locales (#5156, 5186,
- Matthias Scheler).
- 153. Some cleanups for the UTF-8 Compose file, including:
- - Better support for Greek
- - Typo fixes, including incorrect character literals and keysyms.
- (#5154, Vasilis Vasaitis).
- 152. Modify Xt's default fallback font pattern to work better in locales
- where the current one fails to find a useful font (#5152,
- Tomohiro KUBOTA).
- 151. Updates to bdf/misc UCS fonts, and generate ISO8859-16 subsets
- (#5147, Markus Kuhn).
- 150. Fix some empty delay loops and jiffie wrap bugs in the i830 drm driver
- (#5149, Arjan Van de Ven).
- 149. Fix a potential NULL dereference in the drm kernel module (#5148,
- Andreas Schwab).
- 148. Major OS/2 support update (#5119, Holger Veit).
- 147. Fix mode setting in DGA on the Rage128 & Radeon drivers (Alan Hourihane).
- 146. Build libXt as a flat namespace image on Darwin (Torrey T. Lyons).
- 145. Install the bitmap file xc/programs/bitmap/Stipple as Stippler on file
- systems that are not case sensitive (Torrey T. Lyons).
- 144. Fix enabling of MMIO window on BladeXP desktop chips (Alan Hourihane).
- 143. Due to bugs in the CyberBladei7/i1 series that cause offset problems,
- we're disabling the hardware cursor (for now) (Alan Hourihane).
- 142. Fix Xft-def.cpp file for Cygwin/XFree86 (#5283, Harold Hunt).
- 141. Server support for OpenBSD/sparc64 (Jason Wright, Matthieu Herrb).
- 140. Alignment fixes for Xvideo on the Permedia3 (Alan Hourihane).
- 139. lndir fix for paths containing '//' (H. J. Lu).
- 138. Fix blank display problem in trident driver for older TGUI series
- chips, and a few Xv cleanups too (Alan Hourihane).
- 137. Enable MIT-SHM extension in Xnest server (#A.795, Steve Schwarz).
- 136. Fix typo in Rage128 DGA driver (#5187. Charles M. Hannum).
- 135. Fix enabling of DRI when XvMC is disabled (#5208, Matthew Sottek, Intel).
- 134. Fix HW Cursor handling in vmware driver (#5193, Jeremy, VMWare).
- 133. YUV handling updates for v4l module. Can now handle multiple formats
- and find common format for both videocard and kernel.(#5196, Gerd Knorr).
- 132. Savage driver updates (#5203, Tim Roberts).
- 131. Drop the indirect buffer after ScreenInit, fixes corruption and
- kernel error messages. (#5199, Michel Dänzer).
- 130. Add Polygon support to Render extension (Carl Worth, Keith Packard)
- 129. Add Intel i845G 2D support to the i8x0 driver, DRI is disabled.
- (#A.1062, Graeme Fisher, 2D3D).
- 128. Fix RGB/BGR inversion problem and screen blanking in the glint
- driver (Alan Hourihane).
- 127. Add MIT-SCREEN-SAVER extension docs (Alan Coopersmith).
- 126. Fix problems opening /dev/fb0 in fbdevhw layer (#5229, Michel Dänzer).
- 125. Update the apm driver (#5227, Loic Grenie).
- 124. Update the Japanese localization of XDarwin (Toshimitsu Tanaka).
- 123. Symbol table cleanup, leaving xf86GetPointerScreenFuncs() as the only
- common/xf86Cursor.c entry available to modules (Marc La France).
- 122. Fix VidMode-generated mode switches by making them go through (almost)
- the same code path as keyboard-generated mode switches (Marc La France).
- 121. Allow AGP apertures to overlap with other BIOS-assigned PCI resources
- (Marc La France).
- 120. Indent'd most of xterm's C code (Thomas Dickey).
- 119. Major Radeon driver code cleanup (Kevin Martin).
- 118. Radeon Xv fixes and video key support added (Keith Packard).
- 117. DPMS support for DFP/LCD and second head added for Radeon (Hui Yu@ATI).
- 116. Option to disable line acceleration added since Radeon only has 14 bits
- for lines and clipping. This will be changed to an XAA option for 14
- bit support in the future (Hui Yu@ATI, Kevin Martin).
- 115. Radeon DDC and DFP handling improvements (Hui Yu@ATI).
- 114. Fixes for DRI lockup problems with Radeon 7500/VE and the AMD 761
- chipset (Hui Yu@ATI).
- 113. Radeon PLL routines rewritten with ATOMIC_UPDATE enabled (Hui Yu@ATI).
- 112. Clone mode added to Radeon driver (not yet functional and disabled
- by default) (Hui Yu@ATI, Kevin Martin).
- 111. Fix usage of BuildBinTop in Cygwin/XFree86 (#5223, Harold Hunt).
- 110. Implement WarpCursor for Cygwin/XFree86, and use GetProcAddress
- instead of relying on ddraw.dll (#5220-#5222, Harold Hunt).
- 109. Fix bug that prevented the vesa driver from accessing VGA CRTC registers
- (Marc La France).
- 108. New pre-processor files for expat, fontconfig and rename of
- OSmesa-def.cpp to OSMesa-def.cpp (#5215-#5218, Alexander Gottwald).
- 107. Rework ati, atimisc, r128 and radeon module versioning (Marc La France).
- 106. Code clean up for the original Rage LT (Marc La France).
- 105. An attempt at disabling display switches while the server is running on
- an LT Pro or Mobility M1 (Marc La France).
- 104. Make atimisc, r128 and radeon modules register the symbols they reference
- at module load time, rather than PreInit() (Marc La France).
- 103. Fix rounding error in Mach64 DSP calculation (Marc La France).
- 102. Convert xmh to ANSI C (Thomas Dickey).
- 101. Xterm patch #166 (Thomas Dickey).
- 100. Fix keyboard beeps on Cygwin/XFree86 (#5211, Harold Hunt).
- 99. Fixed i810 crash on vt switch due to call to Sync() while switched away
- (Andris Pavenis).
- 98. Fixed MGAG550 HW Cursor (Laure-Amelie Couturie).
- 97. Added Xv support to neomagic driver (Shigehiro Nomura).
- 96. Implemented cross compile environment (Egbert Eich).
- 95. Added AMD x86-64 architecture support (Egbert Eich).
- 94. Fixed memory leaks in xkb code (Egbert Eich).
- 93. Fixed several memory leaks in the config file parser and initialization
- routines (Egbert Eich).
- 92. Added CardBus bridge support (Egbert Eich).
- 91. Fixed strdup() define in glx (Egbert Eich).
- 90. Extended xf86misc extension to support changing the mouse device
- (Egbert Eich).
- 89. Replaced strdup() in xf86Configure.c with xalloc()/strcpy() to avoid
- conflicts when using internal malloc (Egbert Eich).
- 88. Extended memory debugging: Added signal handler to trigger a memory
- debugger dump on SIGUSR2 when compiled with memleak support
- (Egbert Eich).
- 87. Set vtSema to FALSE when suspended by APM to catch calls to 2D accel
- functions (Egbert Eich).
- 86. Implemented mouse protocol detection by analyzing data stream
- (Egbert Eich).
- 85. Added PnP mouse detection for PS/2, ImPS/2 and older MS serial mice
- (Egbert Eich).
- 84. Fixed gamma correction code for Trident 9397 (Alan Hourihane).
- 83. Fixed C&T driver to avoid initialization of video in non-linear mode
- (Egbert Eich).
- 82. Changed C&T driver to allow video even if acceleration is disabled
- (Egbert Eich).
- 81. Attempt to implement a more consistent handling of HW cursor in C&T
- driver (Egbert Eich).
- 80. Fixed MGA driver to make HALlib work with VESA framebuffer modes
- (Egbert Eich).
- 79. Reworked Rendition driver (Egbert Eich).
- 78. S3 Virge driver: added minimal gap between SyncStart and HDisplay to
- avoid video lockups (Egbert Eich).
- 77. Fixed memory leaks in S3 Savage driver (Egbert Eich).
- 76. Modified several drivers to do int10 initialization using the
- VBE functions instead of calling int10 directly (Egbert Eich).
- 75. Fixed video support and mode initialization in Silicon Motion driver,
- removed wait for v-retrace (Egbert Eich).
- 74. Misc fixes to SiS driver (Thomas Winischhofer).
- 73. Added support for 1400x1050 screen in Trident driver (Egbert Eich).
- 72. Fixed several video issues for Trident CyberBladeXP chips (Egbert Eich).
- 71. Added probe for Tseng ISA chips (Egbert Eich).
- 70. Added 'KGAUniversal' option to generic vga driver which changes handling
- left overscan to work also on chips with C&T core (ie all C&T and Intel
- graphics chips) (Egbert Eich).
- 69. Modified int10 code to map area between V_BIOS and SYS_BIOS instead of
- copying it. Copying causes problems if legacy devices map MMIO
- registers there (Egbert Eich).
- 68. Implemented an extended int10 init function to allow passing flags
- (Egbert Eich).
- 67. Implemented optional handling of BIOS video mode scratch area in int10
- code (Egbert Eich).
- 66. Again modified MTRR range splitting (Egbert Eich).
- 65. Added funtions to VBE to save and restore a video mode (Egbert Eich).
- 64. Added missing commas to symbols/us_intl (Hans Lunsing).
- 63. Added Ungherese (qwerty) support (Koblinger Egmont).
- 62. Added Euro symbol for hungarian kbd layout (Koblinger Egmont).
- 61. Build with libcurses on Darwin for forward compatibility
- (Jordan Hubbard).
- 60. Add Trident CyberBladeXP acceleration (Alan Hourihane).
- 59. Major XDarwin rootless mode rewrite:
- - Use Carbon to draw directly to windows' backing buffers, rather
- than "triple" buffering with Core Graphics.
- - Reorganized Xserver/hw/darwin directory structure to separate out
- legacy support for Mac OS X 10.0.x.
- (Torrey T. Lyons and Greg Parker).
- 58. Fix RGB/BGR inversion problem on Permedia3 chips (Alan Hourihane).
- 57. Fix server link problem that shows up on ppc (#5205, Guido Guenther).
- 56. Restore effect of option "NoSilkenMouse" (Marc La France).
- 55. Fix some nForce graphics regressions caused by recent flat panel and
- Mac updates to the nv driver (Mark Vojkovich).
- 54. Recognise the "Absolute" keyword that was documented in the
- XF86Config man page (David Dawes).
- 53. Fix the man page information about Absolute screen positioning in
- the ServerLayout section (David Dawes).
- 52. SunOS changes to xedit's lisp interpreter (Marc La France).
- 51. Support the Ti 3026 ramdac with 3DLabs Permedia found on some
- AccelStar boards (Alan Hourihane).
- 50. Move int10 softbooting furthur up in the glint driver to post
- much earlier (Alan Hourihane).
- 49. Fix bug that sometimes caused makedepend to forget #define'd symbols
- (Marc La France).
- 48. MIT-SHM updates (Roberto Zunino, Matthieu Herrb).
- 47. Import Mesa-4.0.1, and resync with the DRI trunk which is now based
- on this (Keith Whitwell, Brian Paul, Alan Hourihane, David Dawes).
- 46. Mga driver updates:
- - Don't try dual-head mode with the G400 unless the mga_hal module
- is loaded.
- - Distinguish between the G400 and G450 when showing the chipset in
- the log.
- - Update the mga man page for supported hardware and dual-head
- support. Futher updates are needed to document all of the
- drivers's options.
- (David Dawes).
- 45. Add -Wundef when compiling the tree with GCC >= 2.8 (Marc La France).
- 44. Macintosh flat panel fix in the "nv" driver (Mark Vojkovich).
- 43. XDarwin fixes and improvements for full screen Quartz mode:
- - Pull full screen specific code out of generic Quartz support.
- - Install new colormaps correctly with PseudoColor.
- - Release the screen immediately when closing down.
- - Do not try to release the screen when closing down in rootless mode.
- (Torrey T. Lyons).
- 42. Reimplement Xft library on top of new fontconfig library (Keith Packard).
- 41. Resync with the final Mesa-3.4.x-based DRI trunk.
- 40. Add support for wscons bell (Jason Wright).
- 39. Fix IBM-reported bug that could cause PCI bus lockouts with second
- generation integrated Mach64 controllers (Marc La France).
- 38. Rework ATI driver's registration of symbols with the loader
- (Marc La France).
- 37. In the ATI driver, add option "CrtDisplay" to force CRT display in a
- dual display situation (Marc La France).
- 36. In the ATI driver, rename option "CrtScreen" to "NoPanelDisplay", keeping
- "CrtScreen" as a private option for compatibility (Marc La France).
- 35. Document X_NOT_IMPLEMENTED (Marc La France).
- 34. NetBSD teeny OS version handling improvement in imake (#5176,
- Matthias Scheler).
- 33. Build I2C support before building drivers (Marc La France).
- 32. Fix a problem related to reserving the overlay key in the default
- colormap in 24+8 mode. This caused some clients using the 8-bit
- visuals to fail (David Dawes).
- 31. [SECURITY] Zlib error handling fix (Mark Adler).
- 30. Put back XDarwin's byte-ordering fix for reading keymappings on
- Darwin x86 that was inadvertently dropped (Rob Braun).
- 29. Fix Big Endian hardware cursor bug on GeForce3 (Mark Vojkovich).
- 28. Experimental flat panel support in the "nv" driver. GeForce2 Go
- should work now (Mark Vojkovich).
- 27. XDarwinStartup improvements:
- - Auto-detect proper mode to run XDarwin.
- - Find XDarwin.app with Launch Services.
- - Add XDarwinStartup man page.
- (Torrey T. Lyons).
- 26. Localize XDarwin credits in French (Olivier Verdier) and Portuguese
- (Fabr’cio L. de Castro).
- 25. Turn off XFree86-Misc and VidMode extensions for XDarwin
- (Torrey T. Lyons).
- 24. Localize a few missing strings in XDarwin preferences (Torrey T. Lyons).
- 23. GeForce4 support (Mark Vojkovich).
- 22. Add IA-64 460GX PCI IDs (Marc La France).
- 21. Some vesa driver updates:
- - Use the common layer's mode validation functions, which gives
- mode selection behaviour more consistent with other drivers.
- - Don't force the depth 24 framebuffer bpp. Instead check what
- framebuffer layouts are supported by VBE, and and choose the
- layout appropriately.
- - fb handles 24/32 fb/pixmap layout conversion, so don't use
- the xf24_32bpp module.
- - shadow + fb at depth 4 needs the bpp set to 8.
- (David Dawes).
- 20. Fix some misleading messages about why modes aren't available
- (David Dawes).
- 19. Fix for `hostname` issue on Linux (Marc La France).
- 18. Fix startx script for ksh (Phillip B. Bruce).
- 17. Fix Emulate3Buttons for wsmouse protocol on NetBSD and OpenBSD
- (Matthieu Herrb).
- 16. Add Portuguese localization of XDarwin front end
- (Fabr’cio L. de Castro).
- 15. Fix mouse Protocol "Auto" for SunOS (Marc La France).
- 14. Relocate all driver low memory accesses (atimisc module not yet done)
- (Marc La France).
- 13. Make driver I/O relocatable (atimisc, s3, sis and tseng not yet done)
- (Marc La France).
- 12. PCI domain changes for SunOS/SPARC64 (Marc La France).
- 11. PCI domain changes for Linux/SPARC64 (#4653, David S. Miller,
- Marc La France).
- 10. Temporary workaround for IA-64 (Marc La France).
- 9. Fix SIGSEGV when printing modes that have no modifiers (Marc La France).
- 8. Revert the ATI driver's composite sync default to off (Marc La France).
- 7. Add a note to the messages that get printed when a signal is caught
- during initialization (which includes X -configure) that reported
- unresolved symbols might not be the reason for the server aborting
- (David Dawes).
- 6. Fix symbol registration in some drivers, which reduces the number of
- symbols reported as "unresolved" when 'X -configure' crashes
- (David Dawes).
- 5. Fill in names for BIOS modes in the vesa driver's mode pool that weren't
- otherwise assigned names (David Dawes).
- 4. Fix an unresolved symbol in libGLU.so that shows up when building it
- with gcc-3 (David Dawes).
- 3. Fix invalid code caused by a memcpy() macro being split by a directive
- (#5150, Sami Farin).
- 2. Fix incorrect symbol prefixing with Xlib's i18n modules on Solaris
- (Keith Packard, David Dawes).
- 1. Don't try to print mode names when the name is NULL (David Dawes).
-
-XFree86 4.2.0 (18 January 2002)
- 690. Workaround for hardware bug that prevents older ATI 3D Rage adapters from
- being assigned to XF86Config device sections (Marc La France).
-
-XFree86 4.1.99.7 (17 January 2002)
- 689. Fix bug introduced in snapshot 4.1.99.5 causing XDarwin's PseudoramiX
- extension to always be disabled (Torrey T. Lyons).
- 688. Disable the pipe check for stdout/stderr that was added in the previous
- snapshot because it looks like it might cause too many problems
- (David Dawes).
- 687. Update the Arabic (ar) XKB keyboard map (#5145, Arabeyes team).
- 686. Update the Russian (ru) XKB keyboard map, adding two new variants
- ("typewriter" and "phonetic") (#5143, Ivan Pascal).
- 685. Remove the lt_a and lt_p XKB keyboard maps (#5139, Nerijus Baliunas).
- 684. Disable the DRI and print a warning message for Radeon 8500 cards
- until they are supported (Kevin Martin).
- 683. Properly detect when no BIOS is present on Radeon cards (#4978,
- Charles Hannum, Kevin Martin).
- 682. Delay before restoring VGA registers for Radeons to "fix" VT switch
- problems (Kevin Martin).
- 681. Add new PCI IDs from ATI (Kevin Martin).
- 680. Update the Xinstall.sh script to create version compatibility links for
- shared freetype libraries when needed (David Dawes).
- 679. Update Freetype2 shared library versions to match the versions libtool
- generates (Keith Packard).
- 678. Doc updates (lots of people, includes #5142, 5144)
-
-XFree86 4.1.99.6 (14 January 2002)
- 677. Change the default verbosity level for stderr from 1 to 0 (David Dawes).
- 676. Set the X server's stderr to non-blocking for non-root users
- (David Dawes).
- 675. Don't allow the X server to start when stdout or stderr is a pipe for
- non-root users (David Dawes).
- 674. Add OpenGL man pages.
- 673. Avoid duplicate symbol problem with xkbevd on some platform (#A.769,
- Nicholas Leippe).
- 672. Updated Ukranian XKB symbols file (#A.764, Andriy Rysin).
- 671. Fix ELF loader for ARM architecture (#5138, Phil Blundell and
- Adam C. Powell IV).
- 670. Fix a race condition in the Linux kernel DRM code (#5136,
- Arjan van de Ven).
- 669. Fix DGA support in the s3virge driver (#5135, Kevin Brosius).
- 668. Add XvBskew, XvRskew to adjust skew values for centering of an
- Xvideo window for the trident driver (Alan Hourihane).
- 667. Fix loader for Motorola 68k machines (Alan Hourihane).
- 666. Fix very high resolution modes (e.g. 1600x1200@16bpp) in the
- Trident driver (Alan Hourihane).
- 665. -
- 664. Quick hack to allow GLX to be included in non-XFree86 servers
- (Marc La France).
- 663. More ROP_NEEDS_SOURCE fixes for Savage chipsets (Egbert Eich).
- 662. Improvements to the SiS driver which should fix a lot of the 630
- issues (Thomas Winischhofer).
- 661. In XDarwin IOKit mode, ignore screens sized 1x1 (Torrey T. Lyons).
- 660. Some missing QNX fixes (#5121, Frank Liu).
- 659. Update XDarwin man page and usage message for XFree86 4.2.0. Add
- XFree86 man page to XDarwin distribution (Torrey T. Lyons).
- 658. Add bn_BD.UTF-8 to locale.dir (Taneem Ahmed).
- 657. Fix luit not dropping priviledges when run with the -c flag (#5134,
- Juliusz Chroboczek).
- 656. Fix unresolved symbol and loader symbol registration problems in the
- i810 driver that were introduced with the i830 support (David Dawes,
- Abraham vd Merwe).
- 655. Fix sparklies problem for other Trident *BladeXP chipsets
- (Alan Hourihane).
- 654. In XDarwin IOKit mode, ignore screens that can not provide the requested
- size, depth, or refresh rate instead of generating a fatal error
- (Torrey T. Lyons).
-
-XFree86 4.1.99.5 (7 January 2002)
- 653. Fix some typos in the DRI README (#A.757, Andreas Mohr).
- 652. xon.sh path setting from 3.3.6 (#A.756, Marc Herbert).
- 651. Fix a problem with the Radeon driver that was causing the sync polarity
- to be ignored (#A.753, Vedran Rodic).
- 650. Set the max clock correctly for the G550 second head (#5133,
- Luugi Marsan).
- 649. Fix a Radeon DRI lockup problem (#5128, Steven Pritchard).
- 648. Back out some mga_g450pll.c changes that cause problems on at least
- some G450 configurations (#5122, David Woodhouse).
- 647. Fix some xterm build warnings on *BSD (David Dawes, Thomas Dickey).
- 646. Some QNX4 fixes/updates (#5121, 5124, 5130, 5131, Frank Liu).
- 645. Prefer POSIX O_NONBLOCK to O_NDELAY (when defined) in lib/dps (#5121,
- Frank Liu).
- 644. Fix portability problem with XpmI.h (based on #5121, Frank Liu).
- 643. Only use SA_RESTART in xterm when it's available (#5121, Frank Liu).
- 642. Work around Watcom compiler bug that shows up when building Mesa's
- stencil.c (David Dawes, based on #5121, Frank Liu).
- 641. Handle __inline and __inline__ in compiler.h for non-GNU compilers,
- which makes it more likely that drivers will build with other compilers
- (David Dawes, based on #5121, Frank Liu).
- 640. Build fixes for xedit/lisp. Don't define NEED_SNPRINTF when not needed.
- Avoid a double recursion into subdirs (#5123, Matthieu Herrb).
- Added code for systems without getpagesize.
- 639. Fix the xdm's handling of keys, allowing keypad keys to work (#A.662,
- Servaas Vandenberghe).
- 638. Fix hang when quitting XDarwin before starting X server
- (Torrey T. Lyons).
- 637. Don't add XDarwin's PseudoramiX extension with only one screen
- (Greg Parker).
- 636. Add Spanish localization of XDarwin help file (Pablo Di Noto).
- 635. Improve XDarwinStartup's error reporting (Torrey T. Lyons).
-
-XFree86 4.1.99.4 (28 December 2001)
- 634. Update the ati/radeon driver to recognise the All-in-Wonder 8500's
- ID (#5117, Vladimir Dergachev).
- 633. Fix bug where a pointer may be checked without being intialized in xman
- (#5120, Martin Husemann).
- 632. Add an informational message to the radeon driver when LCD/DFP mode
- validation fails (#5118, Vladimir Dergachev).
- 631. Handle the ATI Rage128 "PP" variant like the "PR" variant (#4982,
- Mike Harris).
- 630. Fix a LynxOS on PowerPC build problem (#A.746, Stuart Lissaman).
- 629. Fix the names of the Northern Saami keyboards (#A.742,
- Petter Reinholdtsen).
- 628. Add Xinerama info to xdpyinfo (#A.741, Greg Parker).
- 627. Fix an xdm problem caused by not handling an interrupted read (#A.728,
- Darren Marshall).
- 626. Add functions completing text control for Render. Bump XRender library
- minor version (Keith Packard).
- 625. Add XKB layout info for a newer Logitech iTouch keyboard (#A.727,
- Dimitromanolakis Apostolos).
- 624. Fix a problem that shows up with the summa tablet driver when using
- a Genius EasyPen (#A.714, Anders Melchiorsen).
- 623. Fix for VT switch problem with the S3 driver (based on #A.677,
- Juergen Lesny).
- 622. Remove some more spurious entries in the KSC 5601 encoding file (#A.678,
- Jungshik Shin).
- 621. Fix for APM problem on devfs-based Linux systems with APM in a kernel
- module (#A.663, Denis Zaitsev).
- 620. Update the mga Xv double buffering to match the more recent submission
- (#4976, Didier Gautheron).
- 619. Fix a bug in the XKB Slovak (sk) layout (#A.621, Juraj Bednar).
- 618. Fix a small window when a SIGIO may be received without a handler
- installed (David Dawes, based on #A.620, Michel Lespinasse).
- 617. ISO 8859-{1,7,15} Compose file updates and fixes (#5114,
- Vasilis Vasaitis).
- 616. In XDarwin multi-monitor IOKit mode, read screen location from the
- kernel (Torrey T. Lyons).
- 615. Update XDarwin credits file (Torrey T. Lyons).
- 614. Fix various XDarwin crashes in multi-monitor rootless mode by using
- a new "light" version of PanoramiX/Xinerama called PseudoramiX
- (Gregory Parker).
- 613. Fix some typos in the X.Org INSTALL doc (#5113, Chris Pepper).
- 612. Fix an bug that prevented the releasing of XvMC memory on exit (#5112,
- Matthew J. Sottek).
- 611. Some Xprint build warning fixes (David Dawes).
- 610. Xprt PCL3 support (#5111, Mark Snitily, from X11R6.6).
- 609. Xprt PostScript bitmap cache (#5110, Chris Bare, from X11R6.6).
- 608. Updates for the Romanian (ro) XKB map (#5108, Marius Andreiana).
- 607. Update s3virge docs (#5107, Kevin Brosius).
- 606. Disable pixmap24 option for Permedia3/4/R4 as the chip doesn't support
- this (Alan Hourihane).
- 605. Fixed a infinite loop in the i2c code.
- 604. Fixed a Sig11 problem in siliconmotion driver (Egbert Eich).
- 603. Fixes to silicon motion driver:
- - gamma correction for 24 bit true color mode.
- - XAA: clipping rectangle was clipped to visible screen, so offscreen
- pixmaps could not been drawn at with accelerated drawing functions.
- - in SMI_ScreenInit frame buffer size calculation for video changed.
- - smi_video: partly rewritten.
- - Support for 7111
- - interlaced video via
- - XF86Config Option "Interlaced" or
- - attribute XV_INTERLACED (Corvin Zahn).
- 602. Add French localization of XDarwin help file (Olivier Verdier).
-
-XFree86 4.1.99.3 (19 December 2001)
- 601. Change the property Xprint uses to identify pmf printer internal fonts
- to avoid a clash with DPS (#5106, Chris Bare, from X11R6.6).
- 600. Fix a C type aliasing bug in xkbcomp (#5104, Jakub Jelinek).
- 599. Fix a bug in Xprint's PS output code that was over-optimizing out
- clip change requests (#5102, Chris Bare, from X11R6.6).
- 598. Improved error handling for Xprint's -XpFile option (#5101, 5105,
- Chris Bare, from X11R6.6).
- 597. Add higher resolution options to the Xprint postscript printer support
- (#5096, Chris Bare, from X11R6.6).
- 596. BuildLoadableXlibI18n should be keyed off "SharedLibX11" rather than
- "BuildX11Lib" (#5095, Ernie Coskrey).
- 595. Fix a luit inconsistency between the default data used when a
- locale is unknown and the data used by ISO 8859-1 locales (#5092,
- Juliusz Chroboczek).
- 594. Add eo_EO locale entries, which is what GNU libc 2.2 uses for the
- Esperanto locale (#5091, Juliusz Chroboczek).
- 593. Fix an Xprt page handling problem (#5090, Chris Bare, from X11R6.6).
- 592. Update the X.Org release number from 6.5.1 to 6.6 in various
- documents and header files (#5089, 5100, Chris Bare, from X11R6.6).
- 591. Recognise __SVR4 as an alternative for SVR4 in Xosdefs.h (#5087,
- Chris Bare, from X11R6.6).
- 590. Cleanup some header files to make them more C++ friendly (#5086, 5088,
- Chris Bare, from X11R6.6).
- 589. Update the driver status document (#5085, Branden Robinson).
- 588. Fix the SiS drm driver (#5084, Torsten Duwe).
- 588. Fix Trident driver pitch values when accelerator is in use, applies
- to Image and Blade series chips (Alan Hourihane).
- 586. Minor bugfix to SiS driver, restructured VT switching code
- (Egbert Eich).
- 585. Attempt to fix flickering in 24bpp on Trident CyberBladeXPAi1
- (Egbert Eich).
- 584. Fixed UTF8lib support (Mike Fabian).
- 583. Re-instate makedepend's recognition of backslash line terminations
- (Marc La France).
- 582. Add proper reference counting to the XvMCContext so that destroying
- the context before destroying associated surfaces is handled correctly
- (#5083, Matthew J. Sottek).
- 581. Fix the xtt (X-TrueType) font module so that it will recognise
- fonts with upper-case suffixes (".TTF" and ".TTC") (#5082,
- ISHIKAWA Mutsumi).
- 580. Use uname instead of hostname in rstart and xon scripts for portability,
- plus some other rstart and xon fixes (#5081, Chris Bare, from X11R6.6).
- 579. Some newport driver cleanups and fixes (#5080, 5103, Guido Guenther).
- 578. Fix XagNsingleScreen definition and some related side-effects (#5077,
- Chris Bare, from X11R6.6).
- 577. Fix some doc typos, and remove references to the non-existent
- shadowfb(4) man page (#5076, David Krause).
- 576. Pitch calculation updates for the r128 driver (#5074, Michel Dänzer).
- 575. Updates for VMware SVGA programming documentation (#5073,
- Jeremy (VMware)).
- 574. Fix cases where makedepend reports the wrong line number and file when
- an error occurs (#5072, Mark Snitily, from X11R6.6).
- 573. Fix differences in libXt behaviour when using poll() compared with
- when using select() (#5071, Chris Bare, from X11R6.6).
- 572. Some warning cleanups for Tru64 (#5069, Antti Tapaninen).
- 571. Fix a typo in the mt_us keymap entry (#5067, Nerijus Baliunas).
- 570. Add some missing UNDEFINE lines to the iso8859-11 and tis620-2
- encoding files (#5065, 5066, Theppitak Karoonboonyanan).
- 569. Some Luxi font updates:
- - update the Type 1 versions to fix a UID-related bug and cover more
- glyphs
- - update the TTF fonts.scale file to include ISO 8859-13
- - update the docs to properly reflect the fonts' glyph coverage
- (#5064, B&H, Juliusz Chroboczek).
- 568. Fix "The Open Group" copyright notices to reflect the change in
- post R6.4 licensing (#5093, Mark Snitily, from X11R6.6).
- 567. Added debugging helpers (Egbert Eich).
- 566. Added support for the Trident CyberBladeXPAi1 (Egbert Eich).
- 565. Fixed Mono8x8Fill problem in S3 Virge and Savage drivers (Egbert Eich).
-
-XFree86 4.1.99.2 (12 December 2001)
- 564. Fix XDarwin GetImage bug on screens other than 0 in rootless mode
- (Gregory Parker).
- 563. Fix acceleration, hw cursor and console restoration in the "nv" driver
- on PowerPC (Mark Vojkovich).
- 562. Fix console switching on r128 & radeon drivers using FBDev (#5075,
- Benjamin Herrenschmidt (radeon), Michel Dänzer (r128) ).
- 561. Implement double buffering for XVputimage in the mga driver (#A.601,
- Didier Gautheron).
- 560. Fix a wheel emulation problem that prevented delivery of button
- events when the wheel button was the same as one of the emulated
- button (#A.600, Antonio Larrosa Jiménez).
- 559. Fix some 'make install.sdk' problems (#A.586, Stanislav Brabec).
- 558. Fix mga DGA when UseFBDev is enabled (#A.584, Wayne Whitney).
- 557. Fix dri module build when BuildXinerama is set to NO (David Dawes,
- based on #A.599, Pontus Lidman).
- 556. Fix libXext build when BuildLBX is set to NO (based on #A.582,
- Didier Gautheron).
- 555. Fix typo in ms_MY locale name (was ms_NY) (Hasbullah Bin Pit).
- 554. Fix incorrect code in signal handlers in most of the clients,
- xterm and xdm not done yet (Matthieu Herrb).
- 553. Add Glint R4 and Gamma2 support to the glint driver (Alan Hourihane).
- 552. Fix rotated display in the nv driver (Mark Vojkovich).
- 551. By default, validate all available modes rather than only the largest
- such mode (Marc La France).
- 550. Various XDarwin improvements:
- - Use all 8 bits of PseudoColor in full screen Quartz mode.
- - Write XDarwin version number to console log.
- - Move Alt/Option key back to Mod1 by default.
- (Torrey T. Lyons)
- 549. Fix offscreen memory manager segfault (Jacques Gangloff).
- 548. XDarwin Quartz mode cursor improvements:
- - Safely free QuickDraw cursors.
- - Fix disappearing cursor in rootless mode with multiple monitors.
- (Gregory Parker and Torrey T. Lyons)
- 547. i810 XvMC fixes (#5078, Matthew J. Sottek).
- 546. Downgrade DDC-related mode rejections to warnings as some monitors
- advertise their nominal, rather than actual, tolerances (Marc La France).
- 545. Add Korean localization of XDarwin front end (Kyunghwan Kim).
- 544. Allow XDarwin to launch from the Finder even if there are spaces, etc.
- in the path to its application bundle (Torrey T. Lyons).
- 543. Add XvHsync, XvVsync to adjust skew values for centering of an
- Xvideo window for the trident driver (Geoffrey Hausheer, Alan Hourihane).
- 542. Fixed xkb to avoid setting of AccessXTimeout to 0 (Egbert Eich).
- 541. Added option to sync the logfile after every line written (Egbert Eich).
- 540. Improved APM handling:
- - Added disable of Input Handlers.
- - Added support for undo on failed APM requests.
- - Set vtSema to false (Egbert Eich).
- 539. Improved detection of primary device especially for non-PC platforms
- (Egbert Eich).
- 538. Silicon Motion driver Fixes:
- - Removed separate loading of int10 code.
- - Added reset of graphics engine on EnterVT (Egbert Eich).
- 537. Set flag ROP_NEEDS_SOURCE for CPUToScreenColorExpand for all
- S3 Savage chips (Egbert Eich).
- 536. SiS driver:
- - Added fix to restore fbdev mode properly on VT switch/exit.
- - Improved LCD handling on SiS 630.
- - fixed screen blanking in SiS driver to properly blank LCDs
- (Egbert Eich).
- 535. Trident driver:
- - Fixed screen centering for 640x480 Modes.
- - Fixed video playback for BladeAi1.
- - Fixed hotkey internal/external switching for XPm8/16.
- - Added support for on-the-fly video recentering.
- - Attempt to fix contrast settings for video (Egbert Eich).
- 534. Added reset code for PS/2 mice when replug events occurs
- (required for later Linux 2.4.x kernels) (Egbert Eich).
- 533. xf86cfg: start AccessX controls even when started from a running server
- (Egbert Eich).
- 532. Add support in glint driver for booting secondary cards that have
- the VGA disable jumper set (so no access to the BIOS) (Jay Estabrook).
- 531. Add Spanish localization of XDarwin front end (Pablo Di Noto).
- 530. Set the r128 DRI driver version back to 2.2 so that the major version is
- the same as for the version in XFree86 4.1.0.
- 529. Fixes for DGA2.0 support in the radeon driver (#A.585,
- Shyouzou Sugitani).
- 528. Fix mkfontdir's scanning of fonts.scale files to detect a bad file
- resulting from concatenating two fonts.scales files, and to avoid
- buffer overruns from over-long strings (#A.563, Jonathan Kamens).
- 527. Avoid i810 VT switching problems on FreeBSD (David Dawes).
- 526. Fix a possible SIGFPE in the X-TrueType fonts (#A.640, Nam SungHyun).
- 525. Fix -probe and -configure to not clear the screen on exit on SunOS SPARC.
- (Marc La France).
- 524. Fix support for ATI Graphics Pro Turbo 1600 adapters (Marc La France).
- 523. Newport driver updates, including 24-bit support (#5062, Guido Guenther).
- 522. Fix pixel info not being returned from the APPGROUP extension (#5061,
- Chris Bare, from X11R6.6).
- 521. Remove debug message in the calcomp driver (#5060, Martin Kroeker).
- 520. Replace "X Windows" with "X Window System" or "X" in various places
- (#5058, David Krause).
- 519. Fix the size of some lbx struct members on 64-bit architectures
- (#5053, Chris Bare, from X11R6.6).
- 518. Fix the size of some xXagGetAttrReply struct members on 64-bit
- architectures (#5052, Chris Bare, from X11R6.6).
- 517. Add a NULL check that was missing in the CID part of the Type1 code
- (#5050, Mark Snitily, from X11R6.6).
- 516. XKB AccessX LED beep feature (#5047, Chris Bare, from X11R6.6).
- 515. Fix WriteToClient flushing bug (#5046, Chris Bare, from X11R6.6).
- 514. Fix improper freeing of widget translations in libXt when
- REFCNT_TRANSLATIONS is defined (#5044, Chris Bare, from X11R6.6).
- 513. Fix XPrint memory leak (#5042, Chris Bare, from X11R6.6).
- 512. Local Authorization Fix (#5041, Chris Bare, from X11R6.6).
- 511. Add locale entries for Sami (#5055, Børre Gaup).
- 510. Fix XProcessInternalConnection man page duplication (#5040, Chris Bare,
- from X11R6.6).
- 509. Minor xrx Imakefile fix (#5038, Chris Bare, from X11R6.6).
- 508. Remove outdated xc/fonts/encodings/large/README (#5033,
- Juliusz Chroboczek).
- 507. Enable XVideo support for the SuperSavage (#5031, Tim Roberts).
- 506. Add some missing locale entries (#5026, Mike Harris).
- 505. s3virge driver updates, including:
- - cr3a patch (#4884, Adam J. Richter)
- - ViRGE MX XVideo patch (#4915, Sven Menke)
- - An option to disable XVideo
- - Disable solid filled rects for Trio3D because of trouble reports
- - Some MX fixes
- - Fix ViRGE MX XVideo so window overlap works
- - Enable ViRGE GX2 XVideo
- - Fix low resolution problems on ViRGE MX (&GX2)
- (#5024, 5030, 5034, Kevin Brosius).
- 504. Some new/updated xkb files (#5019, Pablo Saratxaga).
- 503. Add some ATI PCI IDs (#5018, Mike Harris).
- 502. Implement a hack for the DEC TGA2 cards which maps an extra page
- before framebuffer start as the acceleration code is slightly
- broken (Jay Estabrook).
- 501. Allow secondary MGA boards to be used on Alpha that have the VGA
- disable switch set (Jay Estabrook).
- 500. Fix Radeon jerky cursor movement bug (Jay Estabrook, #5054, Mike Harris).
- 499. Add new Luxi fonts from Bigelow & Holmes (#5010, Charles Bigelow and
- Kris Holmes, integrated by Juliusz Chroboczek).
- 498. Update the ClearlyU fonts to version 1.8 (#5009, Mark Leisher).
- 497. Add XKB symbols for Saami (#5006, 5059, Børre Gaup).
- 496. Change the mapping of the JIS reverse solidus to what most Japanese
- users expect (#5002, Juliusz Chroboczek).
- 495. Fix hiding/showing of mouse cursor under Windows on Cygwin/XFree86
- (#5056, Harold Hunt).
- 494. Fix Permedia3 SDRAM based boards planemask problems (Jay Estabrook).
- 493. Don't use int10 in glint driver when using fbdev interface (#5039,
- Michel Dänzer).
- 492. Fix SlowBCopy for MIPS and PowerPCs (Marc La France).
- 491. Fix XF86Config overrides for I/O base, framebuffer address and video
- memory size in cyrix driver (Marc La France).
- 490. Don't interfere with ATI panel support when using DDC information for
- monitor tolerance defaults (Marc La France).
- 489. Add Dutch localization of XDarwin help file (Paul Edens).
- 488. Add stub functions needed by libGL to libXThrStubs. Link libGL against
- libXthrStubs on systems that build it. (#4997, Matthieu Herrb).
- 487. Fix building and loading of I18N modules by Xlib on NetBSD and OpenBSD
- (#5049, Matthieu Herrb).
- 486. Fix duplicate loader symbols (#5048, Vladimir Dergachev).
- 485. Fix problems with clipping in fb when the clip list contains negative
- coordinates (Gregory Parker).
- 484. Fix return value of VBEBankSwitch() (Norm Raden).
- 483. Updates/fixes for the QNX6 (aka Neutrino) port (#4990, Frank Liu).
- 482. Autodetect when -fno-merge-constants is needed for building modules,
- and enable its use by default in those cases (Marc La France,
- David Dawes).
- 481. Status doc updates (#4991, Branden Robinson).
- 480. Fix for flickering i815 LCDs (#4968, Poul-Henning Kamp, Harald Koenig).
- 479. Move much of the I18N code in Xlib into separately loadable
- modules (#4965, 5043, Ernie Coskrey, from X11R6.6).
- 478. Modify UXTerm.ad's font5 resource so that xterm can display double
- width characters using a font distributed with XFree86 (#4962,
- Tomohiro KUBOTA).
- 477. Add Dutch localization of XDarwin front end (Paul Edens).
- 476. Add a quick check to not use as the default mode any internal modes
- with horizontal timing parameters that aren't CRT-friendly (David Dawes).
- 475. Add an 832x624 @ 75Hz mode line to the default mode set (#4960,
- Andrew C. Aitchison).
- 474. Fix Radeon LCD Panel detection and Power Delay (ATI Technologies).
- 473. Ignore XDarwin full screen switch key combination when in rootless mode
- (Torrey T. Lyons).
- 472. Xterm patches #163, #164 (Thomas Dickey): mostly bug fixes.
- 471. Fix race condition in XDarwin causing occasional hangs or crashes when
- quitting from the menu (Torrey T. Lyons).
- 470. Cygwin/XFree86 updates (#5035, #5036, Harold Hunt).
- 469. Make sure Cygwin checks ENOBUFS for error test in XlibInt.c, as under
- Cygwin when the socket is full ENOBUFS is returned (Brian Genisio).
- 468. Fix SIGFPE in LastLinePel for ATI Radeon, console restoring on dual CRT
- head on VE, improved panel and ddc line detection (ATI Technologies).
- 467. Fix bug that caused hardware cursors to disappear on mode switches when
- silken mouse is disabled (Marc La France).
- 466. Preliminary changes to keyboard handling for SPARC SunOS
- (Marc La France).
- 465. Zero out SPARC SunOS primary framebuffer on exit, like Sun's servers do
- (Marc La France).
- 464. More driver name normalisation (Marc La France).
- 463. Minor speedup for Mach64 acceleration for big-endian architectures
- (Marc La France).
- 462. Fix bug that prevented relocation of unassigned PCI I/O bases
- (Marc La France).
- 461. Add Swedish localization of the XDarwin help file (Patrik Montgomery).
- 460. Fix use of gethostbyname and getservbyname to _XGethostbyname and
- _XGetservbyname for portability (#5017, Mark W. Snitily, from X11R6.6).
- 459. Fix buffer problems used by xrdb to build command line, noticed on
- systems with a large amount of visuals (#5016, Alan Coopersmith).
- 458. Fix bug regarding signal handling in x11perf by inserting an abort
- test after each run (#5015, Mark W. Snitily, from X11R6.6).
- 457. Add improved diagnostic messages and error checking to libXfont
- which is used by bdftopcf command (#5014, Chris Bare, from X11R6.6).
- 456. Fix advertised surfaces for the i810 Motion Compensation driver and
- make use of new XVMC_INTRA_UNSIGNED surface flag (#5003, Matthew Sottek).
- 455. Fix r128 driver to call wrapped screen functions when using the
- fbdevhw layer (#5004, Michel Dänzer).
- 454. Add Rage128 Pro PP detection to ati driver (#5025, Alfred Perlstein,
- Mike Harris).
- 453. Add CyberBladeXPAi1 recognition to the trident driver (#A.658,
- Jani Jaakkola).
- 452. Fix typo in PCI bus scanning that caused a hang when there was more than
- one PCI bus (#A.652, Uwe Dannowski).
- 451. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka).
- 450. Update XDarwin help file (Torrey T. Lyons).
- 449. Fix XDarwin SHAPE support in rootless mode (Gregory Parker).
- 448. More corrections to Xaw manpage (#5022, Branden Robinson).
- 447. Fix XDarwin crash if a NULL mask is passed to Composite in rootless
- mode (Torrey T. Lyons).
- 446. Fix XDarwin crash if more than one keyboard interface is returned from
- NXEventSystemInfo (Gregory Parker).
- 445. Big5 encoding fix (#4957, Juliusz Chroboczek).
- 444. Use DDC sync (disabled by default) and DPMS info (#4955,
- Andrew C Aitchison).
- 443. Update the i810 XVideo support to double the maximum image width
- to 1440 (#4933, Philip Pokorny).
- 442. Fix several memory leaks in x11perf (#4931, Ernie Coskrey, from X11R6.6).
- 441. Bypass startup VT #1 switching hack for FreeBSD/syscons unless running
- on a pre-3.1 version of FreeBSD (#4926, Huver).
- 440. Catch bogus flat panel dimensions in the ati/r128 driver (#4907,
- Michel Dänzer).
- 439. Fix Maltese entry in xkbcomp/keymap/xfree86 (#4921, Nerijus Baliunas).
- 438. Fix a locale.alias typo (#4920, Nerijus Baliunas).
- 437. Documents Options for the Matrox and Neomagic drivers, and makes
- HW/SWcursor generic options (#5021, Dr. Andrew C. Aitchison).
- 436. Corrections and updates to Xaw manpage (#5020, Branden Robinson).
- 435. Add German localization of XDarwin front end (Andreas Monitzer).
- 434. Add the DEC-XTRAP extension and sample clients (#4904, 4918,
- Paul Stewart).
- 433. Update the us_intl XKB symbols map to include all diacritics used
- in latin script (#4917, Pablo Saratxaga).
- 432. Add a Compose file for utf-8 (#4917, 5019, Pablo Saratxaga).
- 431. Fix radeon and sis GL module Imakefiles (#4916, Bill Nottingham).
- 430. Bug fixes and updates for Savage driver (#5001, Tim Roberts).
- 429. Add luit (#4914, Juliusz Chroboczek).
- 428. Fix a typo in fontenc that prevents building with no dependency on
- libfont (#4913, Juliusz Chroboczek).
- 427. Add an encoding file for the KSC Johab encoding (#4912, Jungshik Shin).
- 426. Remove some spurious entries in the KSC 5601 encoding file (#4910,
- Jungshik Shin).
- 425. Add Swedish localization of XDarwin front end (Patrik Montgomery).
- 424. Fill in mode switch characters in XDarwin keymap (Mario Klebsch and
- Torrey T. Lyons).
- 423. Linux/PA-RISC portability fixes (#4892, Grant Grundler, Bdale Garbee,
- and LaMont Jones).
- 422. Linux/mips portability patch (#4891, 4919, Guido Guenther).
- 421. Preliminary support for building on Linux/arm32 (#4890,
- Branden Robinson).
- 420. Make it possible to build the X server on Linux/m68k platforms
- (#4889, Christian T. Steigies).
- 419. Fixes for xman's manpath config handling (#4886, Branden Robinson and
- Colin Watson).
- 418. Fix some man page aliases (#4882, Branden Robinson).
- 417. Define __GLX_ALIGN64 for glx on Alpha (based on #4888, Branden Robinson).
- 416. Remove PEX5 from the lists of specs in doc/specs/Imakefile (#4881,
- Branden Robinson).
- 415. linux.cf updates (#4874, Branden Robinson).
- 414. Updates for zh locale files (#4879, Branden Robinson).
- 413. xf86config man page update (#4877, Branden Robinson).
- 412. Startx enhancements and cleanups (#4875, Branden Robinson and
- Henry T. So).
- 411. Use DirectDraw2 instead of DirectDraw on Cygwin (#5012, Harold Hunt).
- 410. Add French localization of XDarwin front end (Olivier Verdier).
- 409. Fix portability problem in the generation of the man page version string
- (Marc La France).
- 408. Fix a NativeGDI problem on Cygwin/XFree86 (#5007, #5008, Harold Hunt).
- 407. Fix for threaded libraries (Marc La France).
- 406. Finish removal of SuperProbe (Marc La France).
- 405. A rather large number of warning fixes throughout (Marc La France).
- 404. Fix bug in HTML install script (Marc La France).
- 403. Missing ident lines for some XFree86-modified files (Marc La France).
- 402. Add default half-width doublescanned modes (Marc La France).
- 401. Mark all driver-registered resources with ResBus (Marc La France).
- 400. Fix DPMS-related build problem (Marc La France).
- 399. Log a message just before calling each ChipProbe() during '-probe'
- processing (Marc La France).
- 398. Temporarily disable ISA probing on SPARCs and PowerPCs (Marc La France).
- 397. Add PCI IDs for Sun hardware (Marc La France).
- 396. Fix memory leak in resource relocation (Marc La France).
- 395. Do not relocate resources that only conflict with disabled non-video PCI
- devices or disabled PCI ROMs (Marc La France).
- 394. Re-organise SBUS code (Marc La France).
- 393. Add as-yet-unused definitions for PCI resource types other than I/O and
- memory (Marc La France).
- 392. Add doc for Solaris, but don't format it yet (Marc La France).
- 391. Normalise driver names (Marc La France).
- 390. For SPARCs, disable DGA support in ATI driver
- (from #4650, David S. Miller).
- 389. Clean up some debugging messages (Marc La France).
- 388. Fix newport driver for when a /proc fs isn't mounted (Marc La France).
- 387. Fix DAC handling bugs in s3 driver (Marc La France).
- 386. Fix resource registration bug for PCI Tseng's (Marc La France).
- 385. Add aperture driver for Solaris (not yet used) (Marc La France).
- 384. Rework scanpci to fix problems that prevented it from completely
- displaying non-PCI bridges and Simba bridges (Marc La France).
- 383. Fix build problems in some input drivers (Marc La France).
- 382. Fix int10 compile problem for SPARCs and PowerPCs (Marc La France).
- 381. Ensure master aborts on secondary buses complete normally during PCI
- scans (Marc La France).
- 380. Some memory mapping and Solaris cleanups (Marc La France).
- 379. Fix XDarwin crash on server reset and problem in full screen mode when
- switching from X to Aqua to X too rapidly (Torrey T. Lyons).
- 378. Add __apploaddir__ definition to imake MANDEFS, to specify location of
- app-defaults directory, fixes Debian bug report #87611 (Thomas Dickey).
- 377. Xterm patches #161, #162 (Thomas Dickey): mostly bug fixes.
- 376. Add new CyberBladeXP Aladdin based chip ID's (#4994, Hubert Feyrer).
- 375. fix a potential issue where POSIX allows the string returned
- from getenv to be overwritten (from X11R6.6, Chris Bare).
- 374. Cygwin/XFree86 cleanups and fixes (#4992, #4993, #4999 Harold Hunt).
- 373. Fix i830 VT switching problems which hang the ring buffer (#4987,
- #4989, Abraham vd Merwe).
- 372. fix a format string problem in lbxproxy, apparently not exploitable
- (r0gue@vertarmy.org, Matthieu Herrb).
- 371. Fix disappearing cursor in XDarwin rootless mode by falling back to
- system cursor for cursors bigger than 16x16 (Torrey T. Lyons).
- 370. Make XDarwin start more robustly from the Finder (Torrey T. Lyons).
- 369. Update XDarwin Japanese localization (Toshimitsu Tanaka).
- 368. Fix calculation of DPI when Xinerama in use (#4986, Andrew C Aitchison).
- 367. Update XDarwin preferences GUI to match current features
- (Torrey T. Lyons).
- 366. Xkb fixes for international keyboards (Matthieu Herrb).
- 365. Add client side sparc64 support for NetBSD and OpenBSD (Eduardo Horvath,
- Matthieu Herrb).
- 364. Allow xkbcomp to be used in a cross-compile environment (Alan Hourihane).
- 363. Update documention for the SiS driver, the Options file
- (Ademar de Souza Reis Jr.).
- 362. Xterm patches #157, #158, #159, #160 (Thomas Dickey): mostly bug fixes.
- 361. Fix high-res modes in the nv driver. Add interlaced support for
- chips older than NV11 (Mark Vojkovich).
- 360. Cross compilation fixes (#4981, Harold Hunt, Alan Hourihane).
- 359. Fix cursor artifacts when running XDarwin in full screen Quartz mode
- with 8 bit depth (Torrey T. Lyons).
- 358. Fix byte ordering issue in XDarwin when loading keymapping files on x86
- and correctly set ByteOrder for PPC and x86 (Rob Braun).
- 357. When XDarwin is launched from the Finder, start X clients in an
- interactive shell if user's shell is Bourne-based (Torrey T. Lyons).
- 356. Add CaseSensitiveFileSystem definition, which defaults to YES, except
- on Darwin, Cygwin, and OS/2. Fix another case problem spotted by
- NAKAHASHI Ichiro (Torrey T. Lyons).
- 355. Enable Vendor specific FatalError for Cygwin/XFree86 and create
- the Xserver as a windows executable (#4967, Harold Hunt).
- 354. Add i830 2D and DRI driver (#A.604, VA Linux Systems, 2D3D).
- 353. Use the -no-cpp-precomp compiler option on Darwin, rather than the
- deprecated -traditional-cpp (Christoph Pfisterer).
- 352. Reverting patch #340, fixing type (Egbert Eich).
- 351. Fix rotation in fbdev driver (#4958, #4959, Michel Dänzer).
- 350. Resync with DRI CVS trunk (DRI Project).
- 349. Move ati driver out of DevelDrivers on PPC platforms (#4952,
- Michel Dänzer).
- 348. SECURITY: set default value of authComplain resource in xdm to true.
- This closes a hole where anyone can connect to the X server if
- the xdm auth dir doesn't exist (Galen Hancock).
- 347. SECURITY: don't let a non-root user halt the machine by having X
- send SIGUSR1 to init (Thomas Moestl).
- 346. Changed int10 module to stub on Sparc (Egbert Eich).
- 345. Added hyperpen driver (Roland Jansen et. al.).
- 344. Fixed alignments of x86emu-structures for AXP (Jay Estabrook).
- 343. Fixed XLoadQueryFont() and XLoadFont() to support locales
- (required for Euro support) (Markus Kuhn).
- 342. Modified XtCvtStringToFont() to match any ISO8859 instead of
- latin1 as fallback. Required for Euro Support (Markus Kuhn).
- 341. Added acute to compose key list for iso8859-15 (Markus Kuhn).
- 340. Modified XV Xinerama support to recognize adaptors if screen 0
- has no adaptor (Egbert Eich).
- 339. Modified order of disable devices and LeaveVT() to be symetric
- to the enter case (Egbert Eich).
- 338. Modified GetTimeInMillis() to handle non monotonous system clocks
- (Egbert Eich).
- 337. Added comment about a Zeos Meridan 850c Notebook to C&T docs (Alan Cox).
- 336. Added call to vbeFree() to apm driver (Egbert Eich).
- 335. C&T driver:
- - fixed sig11 problem for non-69030 chipsets.
- - fixed DGA to announce acellerated functions only if accelleration
- is enabled.
- - added FP_mode flag to C&T driver which allows to override the detected
- state of the flat panel (Egbert Eich).
- - fixed driver to act appropriately if the BIOS switches to the
- external monitor it detects when doing DDC.
- - Set IOBase correctly for MMIO when detection 65545 PCI.
- - fixed text screen restauration on 69030 (Egbert Eich).
- - reinabled correct KGA handling of C&T chips: unblank before the end
- of scanline.
- - added support for composite sync.
- - when FP is active disallow display sizes greater than panel.
- - added double buffering to video support.
- - fixed register settings to prevent flickering during video playback.
- (Egbert Eich).
- 334. Fixed bug in C&T driver that caused interlaced mode not to work
- (Claus Hulstrøm).
- 333. Added full MMIO support for C&T 69030 chips (Gregg H. Burman).
- 332. Fixed MMIO accel code in Cirrus Alpine driver, got PIO accel code to
- work (Egbert Eich).
- 331. Fixed fbdev to obtain 24 bit framebuffer format from the kernel, added
- more failure messages to fbdev driver (Egbert Eich).
- 330. Added calls to vbeFree() to rendition, savage, silicon motion,
- i740 and i810 driver (Egbert Eich).
- 329. Modified MGA driver for new Sparse allocation sceme (Jay Estabrook).
- 328. Modified handling of sparse addresses on AXP: The code now no longer
- maps the entire sparse range. Now the required ranges are mapped
- relative to a fixed base address (Jay Estabrook).
- 327. Fixed HW cursor for MGA G100 (Egbert Eich).
- 326. Fixed MGA drivers to be able to use overlay modes when HAL lib is
- loaded (Egbert Eich).
- 325. Disabled accel functions that cause lockups on certain neomagic
- systems by default. They can be reenabled by setting the option
- "StrangeLockups" to "no" (Egbert Eich).
- 324. Did a further fix on ScreenToScreenCopy() for Neomagic 2200
- (Egbert Eich).
- 323. Added experimental support for Toshiba Libretto. This can be enabled
- by the option "DisplayHeight480" (Egbert Eich).
- 322. Fixed clipping in Savage driver, update to version 1.1.1.19
- (Tim Roberts).
- 321. fixed calls to BLTSync() on SiS driver (Egbert Eich).
- 320. Fixed Mono8x8PatternFill(): Moving SETROPFG behind SETROPBG did the
- trick (Egbert Eich).
- 319. Setting 24 bpp pximap flags correctly in SiS driver dependening
- on chipset (Egbert Eich).
- 318. Setting depth and bpp of framebuffer correctly for suncg14 and sunleo
- driver (Thorsten Kukuk).
- 317. Tseng driver not longer ignores results of TsengDoMemLimit() which
- tests for certain restrictions on the usable framebuffer size
- (Egbert Eich).
- 316. Vesa driver: adding calls to vbeFree() before exiting PreInit().
- Reinit vbe in ScreenInit() (Egbert Eich).
- 315. Adding int10 initialization to generic vga driver (Egbert Eich).
- 314. Modified generic vga driver to use shadow fb for vga16 on AXP.
- This works around the problem that AXP can address memory only 32bit
- wide which doesn't work on a latched register planar fb (Egbert Eich).
- 313. Removing 3.3 code from wacom driver. Makes driver hard to read
- (Egbert Eich).
- 312. Removing message output from xf86WcmPlug() which causes -configure
- to core dump (Egbert Eich).
- 311. Modified int10 Pci code to be able to use new version of
- xf86ReadPciBIOS() (Egbert Eich).
- 310. Modified int10 int1A handler to return valid when an unimplemented int10
- call is encountered. This allows fallback to system BIOS (Egbert Eich).
- 309. Modified xf86ReadPciBIOS() to check for valid i386 PC signature.
- Added functions xf86GetAvailablePciBIOSTypes() and
- xf86ReadPciBIOSByType() to obtain available PCI BIOS types and
- retrieve a certain BIOS by type (Egbert Eich).
- 308. Reversed bogus patch 1050 of version 4.0.2. The graphics engine will
- *never* be called after receiving an APM suspend and before receiving
- an APM resume. If the neomagic locks up on resume this has a different
- reason (Egbert Eich).
- 307. Change real/effective user ID to 0/0 before calling modprobe in
- xf86LoadKernelModule() on Linux so user can also load drm modules. Fixed
- PATH environment variable to /sbin (Stefan Dirsch, Egbert Eich).
- 306. Removed disable/enable interrupt code on ia64 as interrupts cannot
- be controled from user level (Egbert Eich).
- 305. Further attempt to fix split algorithm for MTRR regions (Egbert Eich).
- 304. Fixed problem in XAACopyPlaneNtoNColorExpand() that caused bogus
- memory accesses when src was not in fb memory (Egbert Eich).
- 303. Fixed cfb8_32PaintWindow() to use correct cfb32FillBoxTileOdd function
- (Egbert Eich).
- 302. Fix to xdm PAM support (Werner Fink).
- 301. Fixed cz and cz_querty keyboard layouts, added support for Slovak
- keyboard (Jan Holesovsky).
- 300. Fixed core dump in twm if no locales are present (Egbert Eich).
- 299. Modified xterm app default to use LFD fontnames instead of old type
- (Michael Schroeder).
- 298. Add a f.startwm function to twm to start another manager.
- (Matthieu Herrb).
- 297. Disable MIT-SHM in Xnest, caused a segfault (Matthieu Herrb).
- 296. Update wskbd keyboard protocol handling for OpenBSD/macppc
- (Matthieu Herrb).
- 295. Fix problems starting XDarwin from the Finder and pasting with
- multi-button mouse emulation (Torrey T. Lyons).
- 294. S3 driver updates. Restore console for 964 with Ti3025 and Trio64, and
- support for Aurora64V+ (#4953, Ani Joshi).
- 293. Fix USB Keyboard access when no PS/2 controller present
- (#4948, Pontus Lidman).
- 292. Add i810 XvMC (Motion Compensation) driver (#4946, #4964, #4966,
- Matthew Sottek, Intel).
- 291. When using XKB and LEDs are switched on/off by external application
- the keyboard module doesn't change phisycal LEDs state immediately
- (#4951, Ivan Pascal).
- 290. Clean up Cygwin/XFree86 keyboard files (#4949 Harold Hunt).
- 289. Add Matrox G550 support (#4947, Luugi Marson, Matrox).
- 288. Remove SuperProbe.man definition for manual page
- (#4944, Ishikawa Mutsumi).
- 287. Ark driver updates (#4943, Ani Joshi).
- 286. Fix xterm when XIM is disabled - caused a segfault
- (#4942, Tomohiro Kubota).
- 285. Add Big Endian support (PowerPC) to radeon driver (#4934, Ani Joshi).
- 284. Fix support for legacy Windows TrueType fonts in Big5 encoding
- (#4938, Joe Man).
- 283. Support Radeon 7500, 8500 and Rage128ProII (#4941, ATI Technologies).
- 282. Support Trident TGUI96xx and greater with Xv (Alan Hourihane).
- 281. XDarwin fixes for Xinerama in Quartz modes:
- - Turn Xinerama on by default.
- - Fix warping the cursor.
- Also load keymapping from file in IOKit mode for Mac OS X 10.1
- compatibility. (Torrey T. Lyons and Gregory Parker)
- 280. Fix Trident 96xx high clock setting, acceleration fixes (Alan Hourihane).
- 279. Fix XDarwin rootless crashing bug when window resizing with the Mac menu
- bar not on X11 main screen (Gregory Parker).
- 278. Define X_LOCALE on Darwin as Darwin's setlocale() does not work
- properly (Torrey T. Lyons).
- 277. Fix problems with XDarwin multi-monitor support for some screen
- arrangements (Gregory Parker).
- 276. Preliminary big endian (PowerPC) support for the "nv" driver
- (Ani Joshi, Mark Vojkovich).
- 275. Enable ThreadedX for Cygwin/XFree86 using auto import features of
- newer binutils packages (Alan Hourihane).
- 274. Exclude the Mac OS X menu bar from the X11 screen while running XDarwin
- in rootless mode (Yannick Bessette and Torrey T. Lyons).
- 273. Add support for builtin MTRR and AGP support in NetBSD 1.5Y.
- (Matthias Drochner and Frank van der Linden).
- 272. Rework XDarwin front end to start X clients in the user's normal
- environment and fix issues while quitting (Torrey T. Lyons).
- 271. SECURITY: fix glyph clipping for large origin (Keith Packard).
- Reported to be remotly exploitable through konqueror or netscape
- by Georgi Guninski.
- 270. Fix setting of memPhysBase in a few drivers (#4937, Gerd Knorr).
- 269. Finish merging freetype-2-0-4 into trunk by resolving conflicts. This
- also fixes a syntax error on Darwin caused by an out of date version of
- ttgload.c (Torrey T. Lyons).
- 268. Update VMware driver (#4935, Jeremy (VMware)).
- 267. Native GDI infrastructure sync with Cygwin/XFree86 (#4936, Harold Hunt).
- 266. Update Darwin build configuration files including:
- - Report full OS version and more capabilities.
- - Fix X server build problem due to libraries in ProjectRoot being
- listed as dependencies for some targets.
- - Allow dynamic shared libraries to take advantage of two-level
- namespace on Darwin 1.4.
- (Torrey T. Lyons)
- 265. Disable clipboard viewer, external program xwinclip handles this (fow now)
- (#4932, Harold Hunt).
- 264. Add ability to let Aqua and X use different display modes while running
- XDarwin full screen (Torrey T. Lyons).
- 263. Fix build dependency problem in xedit/lisp/lisp.rules
- (#4930, Harald Koenig).
- 262. Fix a fontenc-related problem that can cause the TrueType backend
- to crash (#4909, Juliusz Chroboczek).
- 261. Fix DPMS support for I128 driver (Robin Cutshaw).
- 260. Add OSVErrorF for Cygwin/XFree86 (#4923, Harold Hunt).
- 259. Support Trident Cyber9320, TGUI9440, TVGA8900C, TVGA9000 ISA chips
- (Alan Hourihane).
- 258. Fix banked 24bpp displayWidth calculation (Marc La France).
- 257. Fix accel initialisation bugs in ATI driver (Marc La France).
- 256. Add entry to initialise framebuffer manager by area (allowing for a
- possible extra partial scanline) and make it print all largest areas
- (Marc La France).
- 255. Make xdm use BSD authentification on OpenBSD and use setproctitle()
- instead of home grown version where available (enabled on
- OpenBSD and NetBSD only) (Matthieu Herrb).
- 254. Make -configure generate the DisplaySize from the acquired DDC
- information (#4897, Andrew C Aitchison).
-
-XFree86 4.1.99.1 (20 August 2001)
- 253. Fix bad xalloc() in the new fontenc code (#4899, ISHIKAWA Mutsumi).
- 252. Fix some Xrandr build issues on Cygwin/XFree86 (#4898, Suhaib Siddiqi).
- 251. Fix some Cygwin/XFree86 dependencies in cygwin.rules (#4894, Harold Hunt).
- 250. Add ATI Xpert2000 (Rage 128 SM) (#4896, Mike Harris).
- 249. Fix '-configure' crash introduced recently (#4895, Andrew C Aitchison).
- 248. Re-write Xvideo support for Permedia3 (Alan Hourihane).
- 247. Add Texas Instruments Permedia to Delta attached chips (Alan Hourihane).
- 246. Add Permedia4 support (different clock synth) (Jay Estabrook).
- 245. Resync with DRI CVS trunk (VA Linux Systems).
- 244. Add XKB descriptions for the extra keys on a Dell Internet keyboard
- (#A.533, Ben Liblit).
- 243. Add a Maltese XKB map and locale support (#A.527, Ramon Casha).
- 242. Add a new "bksl" variant of the Czech XKB map (#A.515, Stanislav Brabec).
- 241. Fix the initialization sequence for ExplorerPS/2 (#A.510,
- Arndt Schoenewald).
- 240. When xdm is built with PAM support, don't call getpwnam() before
- calling the various PAM functions associated with authenticating a user
- (A.504, Ben Harris).
- 239. Fix ccmakedep to handle source file extensions of more than one
- character (#A.507, Andy Wiggin).
- 238. Fix a VT switching crash in the cirrus driver when acceleration is
- disabled (#A.489, Kirill V. Semenkov, #A.518, B. D. Elliott).
- 237. Add support for the "PR" variant of the Rage 128 Pro (#A.487,
- Alfred Perlstein).
- 236. Make the config file created with 'XFree86 -configure' load the
- speedo and/or type1 modules if relevant font directory is in
- the font path (#A.484, Dmitry Yu. Bolkhovityanov).
- 235. Fix a bug in the nv driver's detection of the crystal frequency (A.481,
- Leo L. Schwab).
- 234. Make xfontsel use the same order in its menus as the sort order used
- by the X server and xfs (#A.480, Dmitry Yu. Bolkhovityanov).
- 233. Add an input driver for DMC FIT10 touch-panel (#A.477, Mayk Langer).
- 232. Fix xf86PostMotionEvent() to handle first_valuator values other than
- zero (#A.468, Joe Krahn).
- 231. Change the Swedish xkb map to map AltGr+Space to space (#A.467,
- David Härdeman).
- 230. Fix the return value information in the Xv library man pages (#A.458,
- Tommi Vainikainen).
- 229. Fix the DGA client library so that it can map the video memory on
- Solaris 8 x86 (#A.454, Juergen Keil).
- 228. Change {Max,Min}{X,Y}Position options in the elographics and mutouch
- drivers to {Max,Min}{X,Y} so that it's consistent with the other
- drivers.
- 227. Some Bulgarian and Serbian locale updates (#A.444, Anton Zinoviev).
- 226. Add a usage message to glxinfo (#A.430, Mike Coleman).
- 225. Set the Alt/Windows key mappings for 104-key keyboards to be
- compatible with 101-key keyboards by default, and add some new
- XKB options to set them differently.
- 224. Add some new XKB options to select third level shift and group
- switchers/togglers (#A.425, Anton Zinoviev).
- 223. Fix a bug in the Serbian XKB map (#A.424, Anton Zinoviev).
- 222. Export from the loader the DIX symbols necessary for a modular version
- of the DEC-XTRAP extension (#4797, Paul Stewart).
- 221. Add a workaround for FreeBSD to make programs (like mkfontdir) that
- are run as part of the build use the shared libraries from the build
- rather than those that may be installed on the system (David Dawes).
- 220. Use MAXSOCKS for connection limit in Cygwin/XFree86 (Alan Hourihane).
- 219. Add Render's layer support to Cygwin/XFree86 (#4872, Harold Hunt).
- 218. Support for OpenBSD/powerpc (Matthieu Herrb).
- 217. Experimental change to default behaviour of ATI panel support to override
- the horizontal and vertical porches of all modes to that found in the
- mode on entry (Marc La France).
- 216. Fix detection of a panel's mode on entry in the ATI driver
- (Marc La France).
- 215. Fix for Option "CRTScreen" in ATI driver (Marc La France).
- 214. Patch for the Thai glyphs in Mark Leisher's ClearlyU font (#4846,
- Theppitak Karoonboonyanan).
- 213. Add a font encoding file for tis620-2 (#4845, Theppitak Karoonboonyanan).
- 212. Add a font encoding file for ISO8859-16 (#4844, Markus Kuhn).
- 211. Make the input method framework in Xlib work better in an UTF-8
- locale (#4843, Yao Zhang and Bruno Haible).
- 210. Default *sampleText*international to false in xfontsel's app-defaults
- file, since it breaks if the user has '*international: true' (#4842,
- Juliusz Chroboczek).
- 209. A new version of the fontenc layer. A major difference is that it
- reads from a "system" encodings directory
- <ProjectRoot>/lib/fonts/encodings/encodings.dir, which is searched
- after any encodings.dir file in the font's directory. The font
- ABI version is bumped to 0.3 and the Xfont shared library's version
- is bumped to 1.4 (#4839, Juliusz Chroboczek).
- 208. Add support to xload for displaying the load of remote hosts by using
- information in rwhod(1)'s database (#4833, Anders Eriksson).
- 207. Rename the XVisibilityNotifyEvent man page to XVisibilityEvent,
- which matches the naming convention for the other X Event man pages
- (#4830, Ernie Coskrey, from X11R6.6).
- 206. Update the registry to match X.Org's X11R6.6 version (#4829,
- Ernie Coskrey, from X11R6.6).
- 205. Fix for the SlowKeys feature of the AccessX portion of XKB not working
- when the delay is longer than the amount of time between the delivery
- of key press events to the extension (#4828, Ernie Coskrey,
- from X11R6.6).
- 204. Add a locale alias for "th_TH.TIS-620" (#4827,
- Theppitak Karoonboonyanan).
- 203. Some linux.cf updates (#4825, Branden Robinson).
- 202. Make the vbe module build like the other modules.
- 201. -
- 200. Add a command line options (-show) to xvidtune to print out the current
- video mode (#4809, Markus Kuhn).
- 199. A new driver for the "Acecad Flair" tablet (not enabled by default yet)
- (#4800, Edouard TISSERANT).
- 198. Fix some typos in the iso8859-2 Compose file (#4799, Kamil Toman).
- 197. Add some XKB options to allow the CapsLock behaviour to be easily
- selected (#4794, Ivan Pascal).
- 196. Don't reference the log file in the FatalError message if it hasn't
- been opened yet (#4793, Branden Robinson).
- 195. Add Calcomp input driver (#A.554 Martin Kroeker).
- 194. Add preliminary 8 bit PseudoColor support to XDarwin full screen Quartz
- mode and fix IOKit mode PseudoColor that was broken by the multi-monitor
- patch (Torrey T. Lyons).
- 193. Load XDarwin keymapping from file by default and give more useful error
- message if getting keymapping from kernel fails. Change keymapping
- translation so delete key is XK_BackSpace by default (Torrey T. Lyons).
- 192. Create the two sets of locale.alias and locale.dir entries (those with
- and those without the ':' separator) from a single set of entries in
- the source files (David Dawes).
- 191. Add an MS mouse driver for KDrive (#4754, Juliusz Chroboczek).
- 190. Improve "true Big5" and "Emacs Big5" support (#4792, Yong Li, #4798,
- Tomohiro KUBOTA).
- 189. Fix a non-standard character set bug in Xlib (#4792, Ivan Pascal).
- 188. Fix for the savage driver on 64-bit platforms (#4788, Jay Estabrook).
- 187. Xv fix for the r128 driver on big-endian architectures (#4781,
- Michel Dänzer).
- 186. Fix an Xlib bug that affects conversion from CTEXT to multibyte /
- wide character (#4780, Tomohiro KUBOTA, #4783, Bruno Haible).
- 185. Release notes (4.1.0) and Status doc fixes (#4778, 4779,
- Branden Robinson).
- 184. 64-bit fix for lib/X11/ImUtil.c (#4773, Mike Harris).
- 183. Fix dashed lines for the r128 driver on big-endian architectures
- (#4769, Michel Dänzer).
- 182. Fix Xlib's parsing of CTEXT with multi-byte characters in GR (#4761,
- Juliusz Chroboczek).
- 181. Fixes for the Romanian (ro) XKB map (#4746, Marius Andreiana).
- 180. XDarwin bug fixes:
- - Stop FatalError re-entry in "no Quartz support" messages.
- - Synchronize XDarwin serverVisible state with application on rootless
- startup.
- (Torrey T. Lyons)
- 179. Fix an XDarwin bug that broke XWarpPointer in Quartz modes (Gregory
- Parker).
- 178. Fix some more mi build warnings (David Dawes).
- 177. Fix some mi build warnings (#4716-4719,4721-4724, Adam Sulmicki).
- 176. Port for Linux/SuperH (Jornada680/690 and SEGA Dreamcast) (#4680, 4681,
- ISHIKAWA Mutsumi).
- 175. Support for mouse wheel emulation (#A.506, Henry T. So).
- 174. Add support to Cygwin/XFree86 to use CTRL+ALT+BKSPACE as the shutdown
- signal and fix up command line options to accomodate.
- (#4838, Alexander Gottwald).
- 173. In XDarwin, add ability to change modifiers to use when faking multiple
- mouse buttons (Gregory Parker).
- 172. Do not build Cygwin/XFree86 with -ansi as Cygwin's library (newlib) lacks
- some prototype definitions that cause runtime failures (hypot being one
- of them) (Alan Hourihane).
- 171. Add extra library flags (commented out for now) for building
- Cygwin/XFree86's server (#4834, Harold Hunt).
- 170. Fix a bug in the v4l module which caused multiple TV cards not to work
- (#4835, Gerd Knorr).
- 169. Add multi-monitor support to XDarwin for all display modes using
- Xinerama (Gregory Parker and Torrey T. Lyons).
- 168. Fix 16bpp colour maps on Mach64's (Marc La France).
- 167. Fix Mach64 DPMS bug (Marc La France).
- 166. Fix bug that prevented hardware cursors on Mach64 CT's (Marc La France).
- 165. Document what a ChipAdjustFrame() function should to to prevent moving
- of hardware cursors during mode switches (Marc La France).
- 164. -Wimplicit warning cleanup [`make World` >required<] (Marc La France).
- 163. Ensure installed headers can find the headers they, in turn, #include
- (Marc La France).
- 162. Make imake pass its -W* flags to cpp (Marc La France).
- 161. More accomodations for newer GCC's (Mike A. Harris).
- 160. Remove a CYGWIN define from Xserver/include/windowstr.h
- (#4832, Harold Hunt).
- 159. Fix a casting problem which causes bdftopcf to write corrupted
- fonts on buffer boundaries (#A.522, Jakub Bogusz).
- 158. Cygwin/XFree86 updates (#4824, #4826 Harold Hunt).
- 157. Fix horizontal stripes problem in Permedia3 driver (Alan Hourihane).
- 156. Remove most X_NOT_STDC_ENV code, and assume that __STDC__ is defined
- (David Dawes).
- 155. Remove (stale) support for Amoeba and Minix (David Dawes).
- 154. Update Cygwin/XFree86 cross-compilation and update to latest
- source base (#4801, #4802, Harold Hunt).
- 153. Fix 'make install' for Freetype. (#4812, Carlos A M dos Santos).
- 152. Turn on dll style modules for Linux/MIPS. (#4807, Guido Guenther).
- 151. Add support for ATI's Radeon VE, Mobility M6, All-In-Wonder Radeon
- and Rage128 Pro Ultra, Digital Flat Panel support. Use DDC2 interface.
- (#4817, Mike Smith, ATI Technologies).
- 150. Add IBM S/390 support for building the tree (#4815, Mike A. Harris)
- 149. Fixes incorrect spelling of "XChangeWindowAttributes" found in
- XCreateColormap(3X11) and XInstallColormap(3X11)
- (#4813 Carlos A M dos Santos).
- 148. Fix a serious memory leak in XAA (Mark Vojkovich).
- 147. Add a DriverPrivate field to I2C devices (Marc La France).
- 146. In the ATI driver, initialise the fb manager whether or not XAA is also
- used (Marc La France).
- 145. Fix typos in radeon and wacom drivers.
- 144. Don't disable the secondary CRTC on ATI Rage XL adapters (it doesn't
- exist) (Marc La France).
- 143. Speed up ix86 block moves in ATI driver (Marc La France).
- 142. Temporarily disable hardware cursor support for ATI GX & CX adapters
- (Marc La France).
- 141. Make composite sync the default in the ATI driver (David S. Miller).
- 140. Rework stretching of small DFP modes in ATI driver (Marc La France).
- 139. Add an interesting PCI ID (Marc La France).
- 138. Allow ChipValidMode() functions to pre-calculate a mode's horizontal
- sync and vertical refresh rates (Marc La France).
- 137. Another fix for mode switch and cursor interactions (Marc La France).
- 136. Temporary fix for endianness problems in ATI driver (Marc La France).
- 135. Add XGetIMValues() prototype to Xlib.h (Marc La France).
- 134. Use a more reasonable numbering for recent binutils versions on Linux
- (Marc La France).
- 133. Fix dependencies for building drivers in a static server
- (Marc La France).
- 132. Update XDarwin Japanese localization to include rootless UI changes
- (Toshimitsu Tanaka).
- 131. Fix potential XDarwin bug in translating Darwin keymappings to X11
- keymaps with unrecognized modifier keys (Gregory Parker).
- 130. Make XDarwin ignore Caps Lock when checking for VT switch, except when
- the user's switch key preference includes Caps Lock (Gregory Parker).
- 129. Update XDarwin Cocoa UI and preferences for rootless mode. Add more
- explicit error message for users trying to run in Quartz modes without
- Quartz support. Remove unneeded info.nib files (Torrey T. Lyons).
- 128. Added XDarwin menu bar hiding/showing in rootless mode (Gregory Parker).
- 127. Fix DDC from reporting misleading information.
- (#4806 Andrew C Aitchison)
- 126. Patch to make VBE DDC honour the NoDDC option.
- Before this, NoDDC disabled only 2 of the 3 ways the server might
- ask the monitor for DDC infomation.
- (#4805 Andrew C Aitchison)
- 125. Stops xf86cfg complaining about non-video chips from Intel.
- Adds a few PCI card ids for Intel and one for Matrox.
- (#4804 Andrew C Aitchison)
- 124. Add support for NVIDIA nForce integrated graphics (Mark Vojkovich).
- 123. Fix a possible fatal crash in Xv when Xinerama is used (Mark Vojkovich).
- 122. Corrects typos in output of xf86cfg when checking modules and
- documents ddc module options (Andrew C Aitchison).
- 121. On Mac OS X, allow users to disable mouse acceleration changes by
- XDarwin (Torrey T. Lyons).
- 120. By default, don't build the MagicTouch input driver until a common layer
- interface is coded for it (Marc La France).
- 119. Fix Offscreen Image support for Xv/v4l in tdfx driver (Alan Hourihane).
- 118. Add MagicTouch driver (A.482, Mauro Ziliani)
- 117. Fix side effect in XFree86 of the recent changes to libxf86config
- (A.486, Knuts Andy).
- 116. Define Xutf8LookupString in X11-def.cpp for Cygwin/XFree86
- (#4790, Suhaib Siddiqi).
- 115. Turn on RandR build for Cygwin/XFree86 (#4789, Harold Hunt).
- 114. Import of Gregory Parker's rootless code for Mac OS X. The code has
- been cleaned up, reorganized, and modified to use Cocoa and fb
- (Gregory Parker and Torrey T. Lyons).
- 113. Freshen SCO port (#4709, J. Kean Johnston).
- 112. Fix int10 build for GCC 3.0 (Marc La France).
- 111. An attempt at fixing the i740 driver to not reference options before they
- are collected (Marc La France).
- 110. Fix for RandR build (Bill Crawford).
- 109. Fix 3Dfx Voodoo Banshee boards with timing issues (Alan Hourihane).
- 108. Allow Cygwin/XFree86 to be cross compiled (#4784-#4786 Harold Hunt).
- 107. Fix fatal bug in XAA's N-to-N CopyPlane acceleration (Elliot Lee).
- 106. Add RandR support to the Kdrive PCMCIA driver (Alan Hourihane).
- 105. Fix SharedLibGL to SharedLibGlx in cygwin.rules and some Cygwin/XFree86
- fixes including enabling backing store. (#4770, #4771 Harold Hunt).
- 104. xf86UnMapVidMem shows the wrong number of arguments in
- os-support/README.OS-lib (#4357, Guido Guenther).
- 103. Some driver loader symbol req/ref registration cleanups (David Dawes).
- 102. Cygwin/XFree86 fixes.
- Release pressed modifier keys when server looses focus.
- Remove declaration in lib/X11/lcGetConv.c (no longer needed).
- Remove unnecessary #if(n)def __CYGWIN__ in lib/X11/lcGetConv.c, one in
- lib/dps/csconndi.c and one in lib/font/Type1/regions.h.
- Add a new SharedDepLibraryTarget rule (#4763-#4768, Harold Hunt).
- 101. Fix bogus handling of BUS_CNTL Mach64 register (Marc La France).
- 100. Fix a typo in xc/programs/bitmap/Bitmap.h (#4757, Suhaib Siddiqi).
- 99. Add Cygwin/XFree86 manpage and minor tweaks (#4756, Harold Hunt).
- 98. Ensure PCI master aborts are allowed to complete normally on non-root
- buses (Marc La France).
- 97. Allow ChipScreenInit()'s to load modules during the first server
- generation (Marc La France).
- 96. Update XvMC header files to match the spec (Matthew Sottek).
- 95. Darwin build configuration changes:
- - Turn on building Xv and GLX extensions.
- - Make GLX and GLU build successfully.
- - Use Darwin's libz instead of building one for XFree86.
- - Use XFree86's standard compiler optimization flags per CPU type.
- (Torrey T. Lyons).
- 94. Fix Xserver/Imakefile typo which broke XDarwin build (Torrey T. Lyons).
- 93. Fix Darwin bindist files so that dynamic shared libraries are put in
- Xbin.tgz instead of Xprog.tgz (Torrey T. Lyons).
- 92. Fix problem in Ib/Xaw/AsciiSrc.c:nitStringOrFile() when descriptor 0
- is closed, as a zero return value from open(2) is taken as an error
- (splite at purdue.edu).
- 91. Fix glide driver that causes -configure to fail for all drivers
- (Alan Hourihane).
- 90. Don't define SVR4 on Cygwin/XFree86 (#4751, Suhaib Siddiqi,
- Alan Hourihane).
- 89. Don't override system commands specified in host.def on Cygwin/XFree86
- (#4753, Alexander Gottwald).
- 88. Fix cursor problem in server respawn's on Cygwin/XFree86
- (#4750, Harold Hunt).
- 87. Fix typo definition of CplusplusCmd in cygwin.cf
- (#4752, Alexander Gottwald).
- 86. Fix makedepend for use on Cygwin/XFree86.
- Use makedepend on Cygwin/XFree86.
- Fix SharedDepLibraryTarget so that build dependencies are correct,
- this fixes libGLU's build problem (Alan Hourihane).
- 85. Don't define MKSTEMP on Cygwin/XFree86 (#4725, Harold Hunt).
- 84. Fix memory count function for I128 (Mark Thompson).
- 83. Use TermcapLibrary as -lncurses instead of -ltermcap, fixes problem
- building xterm/resize on Cygwin/XFree86 (#4749, Harold Hunt).
- 82. Fix X server segfault in the GLX code (Brian Paul).
- 81. PseudoColor fixes for Cygwin/XFree86 (#4745, Harold Hunt).
- 80. Fix broken TGA driver (Alan Hourihane).
- 79. Fix FIFO reset trouble in tdfx driver by lowering the FIFO size due to
- suspect code in Glide3. (Alan Hourihane).
- 78. Fix Xvideo in tdfx driver when using YUY2 or UYVY data (Alan Hourihane).
- 77. Add two missing symbols to loader reference for the glint driver
- (#4740, Mike Harris).
- 76. Make Cygwin/XFree86 work at 8bpp, and re-arrange some command line
- flags. (#4743, Harold Hunt).
- 75. Fix some build issues on Cygwin/XFree86 (#4736, #4737, Suhaib Siddiqi).
- 74. Some Cygwin/XFree86 cleanups (#4735, Harold Hunt).
- 73. Fix XAA's incorrect acceleration of X-Render's repeated sources and
- masks (Mark Vojkovich).
- 72. Disable PCI resource conflict checking for Linux/Alpha (Jay Estabrook).
- 71. Fix Linux xf86GetPciSizeFromOS() parsing when the kernel is 64 bit
- and any base or size is larger than 32 bits in magnitude (#4732,
- David S. Miller).
- 70. Xinstall.sh updates and bug fixes (David Dawes).
- 69. Make XDarwin ddx pass up proper right and middle mouse button numbers
- and fix mouse button 5 (Christoph Pfisterer and Torrey T. Lyons).
- 68. Restore backwards compatibility from 4.0.[2,3] to 4.1.0 for
- the i810, r128 and radeon DRI drivers (Gareth Hughes).
- 67. Fix a problem when using patterns of horizontal lines with the mga
- video overlay (#A.442, Ewald Snel).
- 66. Remove duplicate XineramaLibrary section in X11.tmpl (#4731,
- Mike Harris).
- 65. Enable building DRI for Linux/ppc, and fix a drm-related bug
- for Linux/ppc (#4728, 4730, Michel Dänzer).
- 64. Document Options for the r128 and fbdev drivers (#4727, 4729,
- Michel Dänzer).
- 63. Add a BuildBindist switch which causes a file containing the XFree86
- version number to be installed in ProjectRoot, include this in
- the Xbin bindist tarballs, and turn on this switch in the bindist
- host.def files. The purpose is to allow the installer script to
- easily identify which version the bindist tarballs are (David Dawes).
- 62. Resync bindist and Xinstall.sh with changes made for 4.0.3 (David Dawes).
- 61. Fix the Shape extension's XShapeCombineMask to handle cases where
- src_mask is None according to the spec. This reportedly fixes an
- X server crash (#4715, Huver).
- 60. Exclude the DRI extension when NO_HW_ONLY_EXTS is defined (based on
- #4714, Frederic Lepied).
- 59. Fixup Cygwin/XFree86 after recent Xrandr changes (#4726, Harold Hunt).
- 58. Fix ATI Radeon driver on Alpha. Seems as though the BIOS doesn't
- like Re-POSTing and memory setup gets confused. (Jay Estabrook, Jeff
- Weidemeier)
- 57. Build fixes for Cygwin/XFree86 (#4710,#4711,#4713 Harold Hunt).
- 56. Fix problem with Xinstall.sh on Darwin 1.3.x (#A.431, Stefan Pantos).
- 55. Update Xinstall.sh and Darwin bindist directories to optionally
- install Quartz support and to add an x86 distribution (Torrey T. Lyons).
- 54. Install xterm.termcap and xterm.terminfo when installing xterm
- (Torrey T. Lyons).
- 53. Add missing return value for miSetPixmapDepths() (#4708,
- ISHIKAWA Mutsumi).
- 52. Fill in the v4l man page template with some useful information (#4707,
- Gerd Knorr).
- 51. Fix FFB OpenGL SwapBuffers (#4705, David S. Miller).
- 50. Fix some mi build warnings (#4695-4701,4704, Adam Sulmicki).
- 49. Work around a problem building the rstart specs doc with a symlinked
- build tree (David Dawes).
- 48. Fix Glint 300SX+Delta support. Add faster 500TX text acceleration
- based on other code (Alan Hourihane).
- 47. Remove SPARC-specific byte-swapping code that would not work on older
- SPARC CPUs (part of #4653, David S. Miller).
- 46. NULLify mapVidMem() and remove DEV_MEM define for Linux/SPARC
- (#4651, David S. Miller).
- 45. Fixing MTRR split code (hopefully) (Egbert Eich).
- 44. Fixing coredump when doing vbeFree() twice: S3 Virge and C&T
- (Egbert Eich).
- 43. Fixing HWCursor for mga driver in fbdev mode (Egbert Eich).
- 42. Make the entire source tree (except GLX) compile under SunOS/SPARC 5.7.
- Functions that have yet to be ported are FatalError()'s. This is
- temporarily controlled through a BuildXFree86onSparcSunOS #define in
- host.def (Marc La France).
- 41. Merge support for all Solaris/ix86 versions together (Marc La France).
- 40. Replace Xserver/Imakefile's DDXDIRn scheme with a more general scheme
- (Marc La France).
- 39. For GCC on SVR4 variants, use -fPIC rather than -fpic to generate shared
- objects (Marc La France).
- 38. Fix xmh's use of XtNewString() with getenv (#4694, Tim Waugh).
- 37. Xdm/PAM fixes: leave it to PAM to observe whether or not an account
- is locked, and reinitialize credentials after calling initgroups(),
- because sometimes the credentials pam_setcred() gives are in the
- form of group membership (#4693, Mike Harris).
- 36. Add an encodings file for standard box drawing characters for
- VT100-compatible terminals (#4691, Juliusz Chroboczek).
- 35. Fix warnings when building mieq.c (#4689, Adam Sulmicki).
- 34. Fix some bugs in the cz and sk entried in XKB's keymap/xfree86 file
- (#4692, Ivan Pascal).
- 33. Add 'hr' entries to XKB's keymap/xfree86 and rules/xfree86.lst files
- (#4687, Nerijus Baliunas).
- 32. Include <X11/Xutil.h> in shape.h to get Region typedef (#4686,
- Adam Sulmicki).
- 31. Acceleration bug fixes for GLINT Permedia1 (Alan Hourihane).
- 30. Ensure glint driver chips don't exceed the specified virtual sizes.
- (Alan Hourihane).
- 29. ATI DGA changes (Patrick Chase and Marc La France):
- - Add accelerated DGA primitives for Mach64 variants;
- - Add accelerated DGA transparent blits for Rage128 and Radeon;
- - Fix setting of DGA_CONCURRENT_ACCESS;
- - Take XaaNo* options into consideration.
- 28. Simplify DGAShutdown() (Marc La France).
- 27. Fix colourmap bug when switching out of a DGA mode (Marc La France).
- 26. Make it possible, but not required, for a driver to initialise DGA after
- XAA so that it may factor in any XaaNo* options in determining what DGA
- drawing primitives to support (Marc La France).
- 25. Prevent mode switches while DGA modes are set (Marc La France).
- 24. Remove all VGA'isms from the glint driver, it doesn't need them
- (Alan Hourihane).
- 23. Support the Delta in the glint driver, needed for boards that have
- the Delta connected to the rasterizer, as it acts as an arbiter for
- the bus. Resolves acceleration troubles. (Alan Hourihane).
- 22. Add an lv entry to XKB's keymap/xfree86 file (#4685, Nerijus Baliunas).
- 21. Fix some typos in XKB's xfree86.lst file (#4684, Nerijus Baliunas).
- 20. Add DDXOSVERRORF ifdefs to the XFree86 ddx code that make use of the
- OsVendorVErrorFProc feature (#4678, Michel Dänzer).
- 19. Convert the r128 driver's "UseBIOSDisplay" option into a more general
- "Display" option (#4678, Michel Dänzer).
- 18. Treat GL_POINT like GL_POINTS and GL_LINE like GL_LINES in the sunffb
- DRI driver (#4677, David S. Miller).
- 17. Some doc updates related to cross compiling (#A.413, Scott A McConnell).
- 16. Fix bsdLib.rules and bsdLib.tmpl problems that show up when
- X11ProjectRoot is defined (#4676, Johnny C. Lam).
- 15. Fix Trident XVideo colorkey at depth 15, 24 (Alan Hourihane).
- 14. Fix some apm driver bugs, including one that prevented acceleration
- from working (#4674, Loïc Grenié).
- 13. Fix 555 (depth 15) palette handling in the i810 driver (#4673,
- Andrew C. Aitchison).
- 12. [SECURITY] Fix authentication issues with mmap() on drm devices
- (Jeff Hartmann).
- 11. Add euro locales and some other missing locales to locale.alias and
- locale.dir (#4662, 4665, 4667, Mike Harris).
- 10. Fix Romanian XKB map (#4664, Mike Harris).
- 9. Spell Portuguese correctly in XKB lst files (#4663, Mike Harris).
- 8. Fix new ioperm calls in lnx_video.c for Alpha that are not needed
- (Jay Estabrook).
- 7. Add drivers for PCMCIA cards, HP VGA Out F1252A, and the ColorGraphic
- Voyager VGA card to the KDrive server. Tested on the Compaq IPAQ.
- Use -listmodes, to check resolutions supported.
- (Alan Hourihane).
- 6. Add RandR extension (Jim Gettys)
- 5. Fix int10 option handling and DDC max clock reporting (Marc La France).
- 4. Fix problems with assembler file dependencies when using gccmakedep
- with the build (Frederic Lepied).
- 3. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka).
- 2. Update XDarwin man pages, help files, and version info. Add option to
- build XDarwin.app bundle for deployment (Torrey Lyons).
- 1. Finish DRI resync, including tdfx driver updates for textured video
- support (VA Linux Systems).
-
-XFree86 4.0.99.900 (18 May 2001)
- 561. Add an XKB description for Latvian (lv) keyboards (#A.411, Ilya Ketris).
- 560. Resync with DRI CVS trunk (VA Linux Systems).
- 559. Savage driver updates, including compiler warning fixes, document
- the "ShadowStatus" option in the man page, and fix an argument
- mismatch between ShadowWait and SavageWaitQueue (#4661, Tim Roberts).
- 558. Update the wacom driver to add a "ScreenNo" option to allow a tablet
- to be attached to a screen in a multi-head setup, and to add auto-
- detection of USB line and max parameters of USB tablets (#4640,
- Frederic Lepied).
- 557. Add a README file that has information about enabling the extra buttons
- on the IBM Rapid Access keyboard (#4639, Dennis Bjorklund).
- 556. Fix some Slovene/Slovak confusion in locale.dir/locale.alias files
- (#4638, Kamil Toman).
- 555. New XKB keymaps for cz and sk (#4634, 4637, Kamil Toman).
- 554. Updates for the iso8859-2 Compose file (#4634, Kamil Toman).
- 553. Check V_CSYNC in the r128 driver, and fix building with R128_DEBUG
- enabled (#4631, Michel Dänzer).
- 552. Mesa 3.4.2 (and later) import.
- 551. More build & warning fixes (Marc La France).
- 550. Fix bug that caused hardware cursors to be temporarily moved during mode
- switches (Marc La France).
- 549. Optimise HARDWARE_CURSOR_AND_SOURCE_WITH_MASK case (Marc La France).
- 548. Move xf86CursorScreenRec definition into xf86CursorPriv.h
- (Marc La France).
- 547. Fix BIOS retrievals in MGA driver (Marc La France).
- 546. Fix ATIProbe() for newer Rage128 and Radeon chips (Marc La France).
- 545. Add temporary workaround in ATI driver for interrupts that occur on
- PowerPC's upon PCI master-aborts (Marc La France).
- 544. Update XDarwin to use fb and support Render (Torrey Lyons).
- 543. Back out sunleo conversion to fb. This driver is too heavily dependent
- on cfb32 for a simple fb conversion (Marc La France).
- 542. Miscellaneous build/warning fixes (Marc La France).
- 541. More prep work for SunOS (Marc La France).
- 540. Fix libXft build on SunOS (Marc La France).
- 539. Another makedepend bug fix (Marc La France).
- 538. Fix use of xftcache utility during !UseInstalled builds (Marc La France).
- 537. Adds #XFree86LOADER define to wrap ModuleInfo related functions
- (#4654, Harold Hunt).
- 536. Add an option to the SiS driver to turn off Xvideo support
- (Ademar de Souza Reis Jr.)
- 535. Fix FreeType bug, use MAXFONTNAMELEN (#4652, Janusz Gorycki,
- Juliusz Chroboczek).
- 534. Fix hw/vfb for compilation on Cygwin/XFree86 (#4655, Harold Hunt).
- 533. Fix some Sparc platform issues with Pci resources and the glint
- driver (#4641-4641,4644-4648 David S. Miller).
- 532. Update glide, imstt, newport, rendition, suncg14, suncg3, suncg6,
- sunleo, suntcx, vga and vmware to use fb and support Render
- (Keith Packard).
- 531. XDarwin fixes:
- - Turn off building non-functional RENDER support.
- - Reduce disappearing cursor problems when switching with Dock.
- - Top of X display is no longer occasionally drawn black when
- switching from Aqua.
- (Torrey Lyons).
- 530. Update freetype2 bits to 2.0.2 version (Keith Packard).
- 529. Re-fix the Trident Video scaler support for Blade series chips
- (Alan Hourihane).
- 528. Fixed lbx to handle endian swapping without core dump (Egbert Eich).
- 527. Fixed MTRR region splitting (Egbert Eich).
- 526. Cleaned up option handling in int10 code (Egbert Eich).
- 525. Added options to specify the Video BIOS to use for POSTing a
- chipset (Egbert Eich).
- 524. Trident driver: added call to BIOS to enable unstretched mode when
- display is stretched. This should make the option "CyberShadow"
- obsolete. (Egbert Eich).
- 523. Attempt to fix video Support on Trident driver (Egbert Eich).
- 522. Added VBE DDC support to SiS driver (Egbert Eich).
- 521. Fixed Silicon Motion to unblank the display when driver fails
- in PreInit() (Egbert Eich).
- 520. Cleaned up handling of 'shadow status' in Savage driver
- (Egbert Eich).
- 519. Savage driver: fixed lockups for Savage4 when loading colormap,
- manipulating the HW cursor, doing certain blit operations
- 518. Cleanded up DDC code in mga driver (Egbert Eich).
- 517. Fixed KGA handling in i740 driver (Egbert Eich).
- 516. Converted i740 and Silicon Motion drivers to fb (Egbert Eich).
- 515. Added calls to vbeFree() or xf86FreeInt10() to C&T, glint,
- mga, neomagic, nv, s3v, tdfx and trident drivers to clean up
- shared memory segments (Egbert Eich).
- 514. Reworked video support in C&T driver, cleaned up block handler
- (Egbert Eich).
- 513. C&T driver: introduced a delay when setting the cursor image for
- the first time after a mode change (Egbert Eich).
- 512. Fixed R128CCE_RESET in r128 driver to do a reset only when dri
- is enabled (Egbert Eich).
- 511. Rewrote readPciBIOS() and getValidBIOSBase() (Egbert Eich).
- 510. Fixed xf86Info structure in xf86Globals.c to match prototype
- (Egbert Eich).
- 509. -
- 508. Fix XDarwin install problems with DESTDIR handling and with soft links
- to the XtAppAddTimeOut manpage (Christoph Pfisterer).
- 507. Add Error message output in Cygwin/XFree86 (#4632, Harold Hunt).
- 506. Fix xdm when HasPam defined, and enable Pam support on Solaris 2.6 and
- later (#A.401, #A.402, #A.403, Rainer Orth).
- 505. Add Croatian keyboard for xkbcomp from Slovenian keyboard layout
- (#A.405, Vlatko Kosturjak).
- 504. Fix XvQueryAdaptors when there is no adaptors found
- (#A.394, Jamie Strachan).
- 503. Remove a stray INCLUDES in Xmuu/Imakefile when snprintf isn't used.
- Set the Permedia2 DAC Mask to 0xFF.
- PCI ROM space address access patch for LynxOS PPC.
- Change limit of motoppcBusAddrToHostAddr for LynxOS PPC.
- Include <sys/wait.h> for LynxOS in os/osinit.c.
- Define CBAUD, when it's missing in xterm, on LynxOS.
- (#A.387, Stuart Lissaman).
- 502. Add SiS 86C204 to xf86PciInfo.h (#A.382, Carlos Manuel Duclos Vergara).
- 501. Fix mga font corruption problems introduced with the recent addition
- of big-endian support (#4629, Andrew C. Aitchison).
- 500. Update for the mga driver's man page (#4628, Andy Isaacson).
- 499. Add more drivers to the default build on Linux/mips (#4623,
- Guido Guenther).
- 498. Move the vgahw module load/init after the PROBD_DETECT handling
- in the i810 driver's PreInit(), which fixes a segv when using
- the X server's -configure option (#A.378, Leandro Martelli).
- 497. Fix a problem with Radeon VE cards failing to enable its video output
- (#A.376, Paul Stewart).
- 496. Fix some DRI-related build dependency problems (David Dawes).
- 495. Fix some drivers (including tdfx, r128, radeon, ark, imstt) that weren't
- respecting the Virtual resolution requested in the config file
- (David Dawes).
- 494. Fix some offscreen memory calculation/allocation problems in the
- tdfx driver (David Dawes).
- 493. Fix a bug in localResizeOffscreenLinear when checking widths
- (Alan Hourihane).
- 492. Update Japanese localization for XDarwin Dock related fixes
- (Toshimitsu Tanaka).
- 491. Fix restoring of text mode fonts on Permedia3 (Alan Hourihane).
- 490. Provide workaround for an apparent bug in Mac OS X 10.0.2 that causes
- XDarwin to lose the cursor when switching to X using the Dock icon.
- Fix "Application not responding" message in XDarwin's popup Dock menu
- (Torrey Lyons).
- 489. Hardware cursor documentation update (Marc La France).
- 488. XVideo extension support in ATI driver for generic (e.g. v4l) adapters
- (based on a patch by Ignacio Garcia Etxebarria).
- 487. Fix ATI driver bug that caused the hardware cursor to move after mode
- switches (Marc La France).
- 486. Fix off-by-one error in screen positioning after a mode switch
- (Marc La France).
- 485. Backout part of 479 and implement a proper fix in the ATI driver
- (Marc La France).
- 484. Fix palette problem on NVIDIA Riva128 in DGA mode (Mark Vojkovich).
- 483. setxkbmap patch that:
- - fixes bug in comand line parser
- - makes debug output more comprehensive
- - prevent to use 'variant' from previous call if 'layout' name changed.
- (#4627, Ivan Pascal)
- 482. Documents Xaa specific options in the XF86Config manual page
- (#4616, Branden Robinson)
- 481. Add Mouse 3 Button emulation to Cygwin/XFree86 (#4626, Harold Hunt,
- Alexander Gottwald).
- 480. V4L documentation fix (Marc La France).
- 479. Fix bug in generic hardware cursor RealizeCursor entry
- (Marc La France).
- 478. Extend the XFree86-VidModeExtension to accept gamma ramps from the
- client rather than just rgb gamma values (Mark Vojkovich).
- 477. More Xv updates for the Permedia3 (#4625, Sven Luther).
- 476. Build Cygwin/XFree86 with -ansi -pedantic (Alan Hourihane).
- 475. Limit the number of PCI buses to 128 on ix86 (Marc La France).
- 474. More fixes for the handling of unassigned PCI bases (Marc La France).
- 473. Fix option handling in most drivers so that per-screen options work
- correctly (David Dawes).
- 472. Resync with DRI CVS trunk (VA Linux Systems).
- 471. Import latest Mesa 3.4.x branch.
- 470. Add a PIOOffset value plus readEnable and writeEnable function pointers
- to the vgahw rec. The former allows vgahw to be used for VGA registers
- that are shadowed in I/O space. The latter allow the VGA_ENABLE
- register to be accessed in similar way to most other VGA registers.
- Add vgaHWEnable() and vgaHWDisable() functions (David Dawes).
- 469. Disable HWcursor for CyberBladeXP chips (Alan Hourihane).
- 468. Fix a Trident Cyber9388 setup issue (Alan Hourihane).
- 467. Fix man page building and installing on Darwin. To be safe we assume
- the Darwin file system is case insensitive since one common variety is,
- ie. HFS+ (Torrey Lyons).
- 466. Improve interoperability between Aqua pasteboard and X cut buffer with
- XDarwin (Gregory Parker).
- 465. Updates for Cygwin/XFree86 (Harold Hunt).
- 464. Provide more robust default preferences for XDarwin (Torrey Lyons).
- 463. Remove map84 keyboard map from Cygwin/XFree86 build (#4621, Harold Hunt).
- 462. Disable xload on Cygwin/XFree86 (Alan Hourihane).
- 461. Remove an errorneous i++ from os/xdmcp.c with -class (Alexander Gottwald).
- 460. Allow Cygwin/XFree86 to build with cygipc support (Alan Hourihane).
- 459. Small XDarwin fixes:
- - Don't leak IOService objects when searching for desired screen.
- - Eliminate chance of SIGPIPE while shutting down.
- - Revert to Aqua cursor when quit by exiting main client.
- - Stop console error messages when using mouse button 3.
- (Torrey Lyons and Christoph Pfisterer).
- 458. At Linus' request, make linux/int10 module deal with shmat() errors
- (Marc La France).
- 457. Fix makedepend's integer value parsing and make it understand GCC's
- #include_next directive as found in glibc & libc5 (Marc La France).
- 456. Xterm patch #156 (Thomas Dickey): change preference of types for
- selection-target between UTF8_STRING and STRING (Juliusz Chroboczek),
- fixes for configure script and documentation (report by Adam
- <adam@cfar.umd.edu>).
- 455. Fix XDarwin so display number preference is followed (Torrey Lyons).
- 454. Fix Xserver/Imakefile for Cygwin/XFree86 (Harold Hunt, Alan Hourihane).
-
-XFree86 4.0.99.3 (26 April 2001)
- 453. Loader fixups for Sparc's (Marc La France).
- 452. Fix dependencies for libGLU on Cygwin/XFree86 (Alan Hourihane).
- 451. Make xdm & xfs compile on Cygwin/XFree86 (Alan Hourihane).
- 450. Update Japanese localization of XDarwin.app's Preferences window
- (Toshimitsu Tanaka).
- 449. Don't build clients that require extension libraries unless those
- libraries are being built (#A.386, Scott A McConnell, David Dawes).
- 448. Fix the BuildXinerama test in Xserver/Imakefile (#4615, Harold Hunt).
- 447. Ignore MakeDllModules when DoLoadableServer isn't set (#4613,
- Guido Guenther).
- 446. Don't define the <Ctrl>T compose sequences in the iso8859-1 compose
- map by default (#4611, Mike Harris).
- 445. Allow the nls compose data files to be pre-processed (David Dawes).
- 444. Fix some problems introduced with the internationalisation of twm
- (#4607, Juliusz Chroboczek).
- 443. Fix dpsinfo so that the correct headers are included (#4606,
- Juliusz Chroboczek).
- 442. Fix mismatches between the way xlsfonts interprets font properties and
- the way they are defined in the XLFD spec (#4604, Jochen Voss).
- 441. Add entries for German iso-8859-15 locales (#4603,
- Philipp Matthias Hahn).
- 440. Cleanup build in Xserver/GL/mesa, making use of the earlier cleanups in
- the lib/GL build (David Dawes). #4602 is redundant as a result.
- 439. [SECURITY] Check for negative reply length/overflow in _XAsyncReply
- (Xlib) (#4601, Mike Harris).
- 438. New 'hu' xkb symbols file (#A.364, Peter Soos).
- 437. Trident driver fixes for PC98 platforms (#4612, Akio Morita).
- 436. Convert apm driver from cfb to fb (Alan Hourihane).
- 435. Fix makedepend for '//' comment parsing and symbols that contain
- expressions (Marc La France).
- 434. Fix a problem with the mga G400 2nd head going into power saver mode
- when it should be blanked, and enable DPMS for the 2nd head (#A.358,
- Craig Leres).
- 433. Fix a horizontal resolution problem that shows up with mga Xv (#A.365,
- Ewald Snel).
- 432. Work around a refresh rate problem when using custom modelines that
- have a refresh rate > 100Hz with the Matrox HAL library (#A.360,
- Ewald Snel).
- 431. XDarwin fixes:
- - Provide work around for kernel/driver issue on Darwin 1.3 that
- causes the kernel keymapping to be empty on Mac portables.
- - Command line -dpi option is no longer ignored.
- (Torrey Lyons).
- 430. Ensure that the X-TT module isn't built if the Xserver isn't being
- built (#4594, Chu-yeon Park).
- 429. Make xconsole try to reopen the /dev/xconsole pipe when it gets an EOF
- (#4593, Jeff King).
- 428. Prevent an infinite loop (or unpredictable behaviour) in xmodmap (#4592,
- Peter Maydell).
- 427. Add a font substitute for the zh locale (#4590, submitted by Branden
- Robinson).
- 426. Make the backspace key definitions for the xkb macintosh/us and
- dvorak layouts consistent with the default 'us' layout (#4588, 4589,
- Branden Robinson).
- 425. Update for the sessreg man page (#4587, Branden Robinson).
- 424. Add a font substitute for the ko locale (#4586, Changwoo Ryu).
- 423. Avoid using fileno() in xauth's signal handler, and write messages to
- stderr rather than stdout (#4585, submitted by Branden Robinson).
- 422. Fix nested comment warnings in dix/gc.c (#4584, Branden Robinson).
- 421. Include <stdlib.h> in two lbxutil files to get malloc/free prototypes
- (#4583, submitted by Branden Robinson).
- 420. Remove duplicate paragraph in xdm man page (#4582, Branden Robinson).
- 419. Fix line numbers in error messages when parsing .twmrc files (#4580,
- Topi Miettinen).
- 418. Fix backwards font glyphs in the ati/Mach64 driver for big endian
- platforms (#4579, Michael Dänzer).
- 417. Add a build-time option to xf86config to make it append the major version
- number to the config file name (David Dawes, prompted by #4577,
- Branden Robinson).
- 416. xf86config build fix for non-GNU make (Marc La France).
- 415. Build fix for Summa driver on SunOS/Sparc (Marc La France).
- 414. compiler.h cleanup (Marc La France).
- 413. More DependDefines, OS_DEFINES and EXT_DEFINES build fixes
- (Marc La France).
- 412. Fix installation of specs docs (#4575, Branden Robinson).
- 411. Make Cygwin/XFree86 call miSetPixmapDepth for RENDER extension
- (Alan Hourihane).
- 410. Xterm patch #155 (Thomas Dickey): correct change to return-type of
- in_put(), which caused problem with UTF-8 (fixed by Bruno Haible).
- 409. Some unobstrusive preparations for SunOS/Sparc (Marc La France).
- 408. Remove unnecessary libxf86_os link into Xnest & Xvfb (Marc La France).
- 407. Disable building of SuperProbe by default (Alan Hourihane).
- 406. Make OS_DEFINES available to all server Makefiles (Marc La France).
- 405. Add support to xman for parsing '\" <string> formatting hints.
- Also cleanup some of the vendor-specific definitions and fix
- processing of mandoc pages on FreeBSD (based on #4573,
- Branden Robinson, David Dawes).
- 404. Fix default mailbox selection in xbiff for Linux, add recognition of
- $MAIL, and update the man page accordingly (based on #4571,
- Branden Robinson).
- 403. Remove redundant PCI id definitions in the tdfx driver, and clean up
- the messages printed when the DRI can't be enabled because the bpp
- isn't supported (based on #4570, Branden Robinson and #4598,
- Antti Tapaninen). Also, re-enable soft booting.
- 402. Install the XftConfig file under $(CONFDIR), with a link from the
- usual place (based on #4569, Branden Robinson).
- 401. Update the Debian section on linux.cf (#4568, Branden Robinson).
- 400. Startx fixes/enhancements, including:
- - Fix argument processing.
- - Set XAUTHORITY.
- - Don't overwrite existing cookies, and remove ones added for this
- session when exiting.
- - Deallocate the VT that X was using.
- - Update the man page.
- (based on #4567, Branden Robinson, Henry T. So, Jr).
- 399. Implement two new driver-provided options in the common cursor code and
- use them to work around hardware bug that causes flickering Mach64
- hardware cursors (Marc La France).
- 398. Integrate SiS driver changes (Ademar De Souza Reis).
- 397. Initialize Elsa GloriaXXL (GLINT) framebuffer properly (Alan Hourihane).
- 396. Fix bug where XDarwin.app would not hide the X display when it was no
- longer the active application (Torrey Lyons).
- 395. Make XDarwin.app ignore .xserverrc file when started from the GUI so
- that it starts correctly (Torrey Lyons).
- 394. Cygwin updates (#4557, 4558, 4563, Suhaib Siddiqi).
- 393. Document the usage of the -server option in the xfsinfo man page (#4562,
- Mike Harris).
- 392. Fix xfs man page problem (#4561, Mike Harris).
- 391. Fix a crash that happens when a font encoding has no aliases and it is
- invoked using a non-canonical name (#4560, Takeshi Miyasaka).
- 390. Add imake/config support for distinguising big endian and little endian
- MipsArchitecture types (#4556, Florian Lohoff).
- 389. Add support to the mga driver for auto-detecting the display type
- (#4555, Stephane Duguay (Matrox)).
- 388. Savage driver updates, including:
- - Enable the Render extension.
- - Make the DGA mode setup look more like the other drivers.
- - First cut at Xvideo for the Savage4.
- - Add a "ShadowStatus" option, which is a reliable workaround for the
- scrolling hang that many experience.
- (#4554, Tim Roberts).
- 387. Enable wide character support for NetBSD 1.5P and later (#4553,
- Matthias Scheler).
- 386. Add offscreen image support to the i810 driver (for Xv), and fix
- physMemBase (#4552, Matthew Sottek).
- 385. Fix bad cut&paste update to the sunffb driver (#4551, David S. Miller).
- 384. Fix "DriDrivers" typo in the sparc section of xfree86.cf (#4550,
- David S. Miller).
- 383. Update UCS 75dpi and 100dpi fonts, including adding UCS versions of
- the UTBI and UTB fonts that were in the unnec_75dpi and unnec_100dpi
- directories. The other "unnec" fonts are also moved over (#4548,
- Markus Kuhn).
- 382. Make the v4l driver module keep searching for more devices if the first
- one can't do overlay (#4545, 4614, Gerd Knorr).
- 381. Bug fixes for Xv support using a Permedia3 chip (#4564, Sven Luther).
- 380. Xterm patches #151, #152, #153, #154 (Thomas Dickey):
- - improve select/paste of COMPOUND_TEXT and UTF8_STRING (Juliusz
- Chroboczek, Bruno Haible).
- - fixes for erase operations (Alexander V Lukyanov).
- - correct ifdef for bold overstriking when built to support UTF-8.
- - change resource corresponding to "-T" option to match Xt library's
- "-title", i.e., ".title" rather than "*title" so the command-line
- options are interchangeable as documented (Debian bug report #68843).
- - modify "RequestResize()" function to save/restore window manager hints
- (Debian bug report #79939).
- - improved error checking for input-method initialization.
- - minor fixes for terminfo entries.
- - various build/portability fixes.
- 379. XDarwin fixes:
- - Don't SetUID XDarwin X server. (The IOKit doesn't need it.)
- - Startup message reports correct display mode.
- - XDarwin.app is now installed in /Applications by default.
- - Update xinit server name list.
- - "make clean" now works for a non-root user.
- (Torrey T. Lyons)
- 378. Make XDarwin correctly handle color hardware cursors in Quartz mode
- (Gregory Parker).
- 377. Fixes to the XDarwin application:
- - Display menubar when started without a splash screen.
- - Query before quitting from Aqua when started with startx.
- (Torrey T. Lyons).
- 376. Update Japanese localization for XDarwin application (Toshimitsu Tanaka).
- 375. Fix byte ordering and static colormap issues with XDarwin server
- on x86 hardware (Rob Braun).
- 374. Fix problems with XDarwin hardware cursor support in Quartz mode
- (Gregory Parker).
- 373. Resync with DRI CVS trunk (VA Linux Systems).
- 372. Fix bug in XvMC protocol (Bob Paauwe).
- 371. Ensure NoInt10 is used for PC98 (Alan Hourihane).
- 370. Fix PC98 issues with the trident driver (#4547, Akio Morita).
- 369. Add a NoInt10 option to the int10 module, allowing it to be disabled
- per entity (Alan Hourihane).
- 368. Fixes to the XDarwin application:
- - X clients are now started correctly.
- - Shuts down cleanly.
- - Removed erroneous NSString releases in quartzCocoa.m.
- - Dragging with mouse button 3 or higher depressed produces events.
- (Christoph Pfisterer and Torrey Lyons)
- 367. Make the ramdac module for the IBM RGB640 DAC work at depth 15
- (Alan Hourihane).
- 366. Fix interference between acceleration and hardware cursors on Mach64
- variants (Marc La France).
- 365. Fix xload so it is functional on Darwin OS (Rob Braun).
- 364. Mac OS X specific fixes:
- - Fix typo in XDarwin startup program that could cause crash with
- many command line options.
- - Move Show/HideMenuBar() call to main thread so that XDarwin
- application displays a menu bar on the Mac OS X desktop.
- (Greg Parker).
- 363. XDarwin application fixes including:
- - Fix bugs causing XDarwin preferences to not be saved correctly.
- - When using system beep, turn off bell when beep volume is set to 0.
- (Christoph Pfisterer).
- 362. Fix building of dpsops.h and psops.h in correct order (Alan Hourihane).
- 361. Change xvmc.h to xvmcext.h to avoid case-(in)sensitive name clash with
- XvMC.h for Cygwin/XFree86 (Alan Hourihane).
-
-XFree86 4.0.99.2 (6 April 2001)
- 360. Fbdev driver updates, including:
- - Switch from shadowfb to mishadow.
- - Add RENDER extension support.
- - Add DGA support.
- - Fix SaveScreen function
- - Blank screen in ScreenInit so the former framebuffer contents aren't
- visible
- (#4544, Michel Dänzer).
- 359. Remove references to th_TH compose file from compose.dir (#4543,
- Theppitak Karoonboonyanan).
- 358. Fix for improper setting of the maxHValue limit in the tseng driver.
- This makes modes like 1152x864@24bpp possible (#A.355, Stanislav Brabec).
- 357. Fix a hw cursor related lockup that shows up with some mga G400
- 16MB OEM single head cards (#A.351, Ewald Snel).
- 356. Fix the XKB macintosh/it mapping (the accent-related keys were wrong)
- (#A.349, Andrea Ghirardini).
- 355. Add XKB descriptions for the extra keys on a Chicony internet
- keyboard (#A.356, John Gladkih).
- 354. Add support for the internal input device interface to mice on
- Solaris 8, and make it the default protocol ("VUID") (#A.340,
- Marcus Comstedt).
- 353. Add XKB descriptions for the extra keys on an IBM Rapid Access II
- keyboard (#A.332, Patrick D'Cruze).
- 352. Fix a typo in xvidtune (#A.327, Peter Breitenlohner).
- 351. Fix Linux/libc5 build problem in the bigfont extension code (#A.327,
- Peter Breitenlohner).
- 350. Fix typo in Chooser.ad (#A.327, Peter Breitenlohner).
- 349. Big endian and PowerPC support for the mga driver (#4540, Ani Joshi).
- 348. Big endian support for the tdfx driver (#4539, Ani Joshi,
- Nicolas Dimitrijevic).
- 347. Build the tdfx and imstt drivers on PowerPC platforms (#4538, Ani Joshi).
- 346. Add IMS (Integrated Micro Solutions) PCI data for the TwinTurbo128
- and TwinTurbo3D (#4537, Ani Joshi).
- 345. Fix some color and accel glitches in the imstt driver (#4536, Ani Joshi).
- 344. Add ISA I/O support for PowerPC Linux using the __NR_pciconfig_iobase
- syscall (#4535, Ani Joshi).
- 343. New Xwin server code from the Cygwin/XFree86 project. This version
- is more portable across Win32 platforms. Changes include:
- - Use fb and shadowfb, and use the faster of GDI blitter,
- DirectDraw blitter and DirectDraw4 blitter to update damaged
- regions. The video card's framebuffer is no longer mapped.
- - Works correctly at depths > 8, but colors are not correct at depth 8.
- - Uses the standard Win32 API messages for processing keyboard and
- mouse input rather than using DirectInput. This is more reliable.
- - Improved internal structure and coding conventions.
- - Builds completely from the XFree86 tree using gcc (the Visual C++
- compiled xf_dx.dll is no longer used).
- - The new server can run on machines that don't have DirectDraw/DirectX
- installed (or installed but not operable) by falling back to the
- GDI blitter. The best drawing interface is determined at startup,
- but this can be overriden with the -engine command line option.
- - The Xrender extension is now supported.
- - Command line option is available to run in full screen mode.
- (#4531, 4532, 4534, Cygwin/XFree86 project including Harold L Hunt II,
- Suhaib M Siddiqi, Dakshinamurthy Karra, Peter Busch).
- 342. v4l driver bug fixs: catch xalloc() failures, and set the depth
- correctly for the VIDIOCSPICT ioctl (#4530, Gerd Knorr).
- 341. Add a driver for VMware virtual SVGA devices. This is for use
- by X servers running under a VMware guest OS (#4529, VMware, Inc).
- 340. Remove Cygwin-specific #ifdef in Xserver/os/Waitfor.c, which fixes
- a crash (#4528, Suhaib Siddiqi).
- 339. Cygwin build fixes (#4527, Suhaib Siddiqi).
- 338. Updates to the "citron" input driver. It includes compatibility
- with the Winbond SIO chip (83977EF), and some new commands to
- communicate to the touch driver from an application program
- (via XChangeFeedbackControl) (#4526, Peter Kunzmann, Citron).
- 337. Updates to the "summa" input driver, including:
- - "Resolution" replaces "LPI" as option for setting resolution.
- - Fixed device reporting to give the actual tablet area size and
- resolution.
- - Tested and working with: SummaSketch3, Hitachi_1217D, a couple of
- others emulating the Summa protocol.
- - Reduce debug message verbosity.
- - Various cleanups.
- (#4525, Huver).
- 336. SunFFB driver bug fixes, including:
- - Be smarter about restoring Kernel framebuffer state.
- - Cure build errors when debug defines are enabled.
- - Do not enable DRI or DGA acceleration if NoAccel option is specified.
- (#4524, David S. Miller).
- 335. Mga G450 dual head support, (#4523, Luugi Marsan (Matrox) and
- David Woodhouse).
- 334. Fix missing xfree -> Xfree mapping in the Type1 font library code (#4521,
- Juliusz Chroboczek).
- 333. Make sure that an initialization assumption in parse_fontdata() in
- lib/X11/omGeneric.c is met (#4520, Jonathan Kamens).
- 332. Add checksum verification to detect monitors that give incorrect EDID
- data (#4517, Andrew C Aitchison).
- 331. Fix checking of LD_ELFDLOBJECT on big-endian systems (#4514,
- Guido Guenter).
- 330. Add an update.fonts target/rule for maintainer use to update
- the latin1 fonts in the source tree that are derived from the
- ISO10646-1 masters (David Dawes).
- 329. Update UCS misc fonts, which includes the addition of the missing
- 4 DEC VT100 graphics characters from Unicode 3.2 (#4533, Markus Kuhn).
- 328. Handle build-time generation of 8 bit fonts from the UCS versions,
- rework the way this is organised, and allow some better control over
- which fonts are built/installed (David Dawes).
- 327. Add UCS versions of most of the 75dpi and 100dpi bdf fonts, and generate
- 8-bit subsets of them. Also, remove the now-redundant latin2
- bdf font directories (#4512 Markus Kuhn).
- 326. Add support for Trident CyberBladeXP and CyberBladeXPm (mobile)
- (Alan Hourihane, Robert V Fleisig).
- 325. Add XKB descriptions for the extra keys on an IBM Rapid Access keyboard
- (#4510, Dennis Bjorklund).
- 324. Update Status and i810 docs to mention i815 support and FreeBSD support
- (#4509, Andrew C Aitchison, David Dawes).
- 323. Xprt fixes to make it closer to X.org version (Danny Backx).
- 322. Fix for reading PCI resource data on Linux/alpha (#4508,
- Ivan Kokshaysky).
- 321. Add XKB descriptions for the extra keys on a "Logitech Internet Keyboard"
- (#4505, Matthew Hand).
- 320. Build shared libGL and DRI client modules on Linux without PIC for
- performance reasons.
- 319. Updates to glxinfo (Brian Paul).
- 318. Add glxgears (Brian Paul).
- 317. glxinfo needs libGLU (Marc La France).
- 316. Rage128 fix to Cards database (Marc La France).
- 315. Minor fix to PCI resource overlap handling (Marc La France).
- 314. Loader code simplification and IA-64 cache flushes (Marc La France).
- 313. Workaround in the ATI driver for troublesome interaction between loader
- and compiler optimisation (Marc La France).
- 312. Warning fixes for `gcc -fno-builtin`, which appears to be the default on
- some systems (Marc La France).
- 311. Add glyph transformations to Xft (Tuomas J. Lukka)
- 310. Add XftCache creation to fonts/Type1 (Keith Packard)
- 309. Add Xmuu library for non-Xt/Xaw dependent applications (Jim Gettys)
- 308. Add i810 and Xv support to kdrive (Pontus Lidman)
- 307. Fix Radeon CPUToScreen acceleration on Alpha platforms (Jay Estabrook).
- 306. Fix bug in ServerLayout option handling when there's no ServerFlags
- section present (David Dawes).
- 305. Allow fb to access 16bit devices (Alan Hourihane).
- 304. XvImage support for GeForce chips in the nv driver (Mark Vojkovich).
- 303. XvMC build fix (Marc La France).
- 302. Fix recently introduced bug in xf86cfg (Marc La France).
- 301. Re-instate warning fixes clobbered by DRI merge (Marc La France).
- 300. Ignore disabled non-video PCI ROMs (Marc La France).
- 299. Hardware cursor implementation for Mach64 variants (William Blew,
- Ani Joshi, Marc La France).
- 298. Some endianness fixes in the ATI driver (incomplete) (Marc La France).
- 297. Fix MMIO ordering problems for Mach64 acceleration (Marc La France).
- 296. Fix ATI driver behaviour when it finds the LCD panel has been disabled
- on entry (Marc La France).
- 295. Fix ECP clock for GATOS (Vladimir Dergachev).
- 294. Undo part of CHANGELOG 36 (Marc La France).
- 293. Rework the building of libGL and the DRI drivers (David Dawes).
- 292. Update greek keyboard layout and compose map.
- (#4513, Katsaloulis Panagiotis)
- 291. Fix problems in Xnest when MouseKeys is enabled and patched it to
- use XKB to allow clients to change keyboard description and
- configuration whithout interfering with the "real" X server
- (Paulo César Pereira de Andrade).
- 290. Dvorak keymap fix (#A.343, J Phillips).
- 289. Some vesa driver updates, including:
- - Wrap CloseScreen().
- - Call xf86PrintModes().
- - Add error messages for when PreInit bails out for lack of modes.
- - Rework how the debugging information is printed.
- _ Avoid some build warnings.
- (David Dawes)
- 288. Make it possible to call xf86PrintModes() when there is no hsync or
- refresh data available, like from the vesa drivers (David Dawes).
- 287. Add a "cleanlinks" script for cleaning up dangling links in lndir-created
- shadow trees (David Dawes).
- 286. Resync with DRI CVS trunk (VA Linux Systems).
- 285. Make extension headers available when the extension is enabled but the
- extension's client library is disabled (David Dawes).
- 284. Make it possible to enable building selected extension libraries
- when BuildServersOnly is set, and allow independent control of
- building docs and clients (David Dawes).
- 283. Import latest Mesa 3.4.x branch.
- 282. Lower the default fifo threshold for PM3 chips (Alan Hourihane,
- Rafael Barbalho, 3DLabs).
- 281. Fix 3DLabs GLINT driver for use the Flat Panels, use the UseFlatPanel
- option. Tested with the SGI 1600SW and Permedia3 board (Alan Hourihane).
- 280. Fix glxinfo to query default display (Alan Hourihane).
- 279. Convert TGA driver to use fb (Alan Hourihane).
- 278. Fix XTRAP typo in miinitext.c (Damien Touraine).
- 277. Major updates to the XFree86(1) man page (David Dawes).
- 276. A new (perl) version of the mkhtmlindex script that works better than
- the shell version (David Dawes).
- 275. Fix the `make depend` scripts to accept -U flags and not require a blank
- in their -f flag (Marc La France).
- 274. Bump the video and input driver ABI minor numbers.
- 273. Add xf86SetRealOption() (Huver).
- 272. Change Xdarwin do that it processes all pending events instead of
- just the oldest one on ProcessInputEvents() call ,
- Quit Xdarwin cleanly, wether from the Xserve or from Cocoa front end,
- Fix a case typp which cases the Xdarwin server not to start if
- installed on a case sensitive file system like UFS.
- (#4504, #4507, #45011, Gregory Parker, Torrey T. Lyons).
- 271. Move Section DRI/Endsection into the DRI function to be consistant with
- all of the other sections. (Quentin Neill)
- 270. Made xf4bpp code moer 64bit clean (still doesn't work on Alphas)
- (Egbert Eich).
- 269. Removed disable/enable interrupt call on ia64 platforms.
- The machine instruction is privileged and not permitted in user space
- (Egbert Eich).
- 268. Improved mode setting in Trident driver; added code to ValidMode
- to reject any modes whose size is larger than the physical LCD
- size if LCD is enabled (Egbert Eich).
- 267. Modified error message in TDFX driver to give user a clue how
- to avoid error (Stefan Dirsch).
- 266. Fixed appearant typo in SMI driver (Egbert Eich).
- 265. Changed Savage driver to unmap memory when exiting PreInit() and
- maps it on every call to ScreenInit() (Egbert Eich).
- 264. Changed handling of failed vbe call in rage 128 driver.
- No the driver doesn't fail any more (Egbert Eich).
- 263. Integrate the currently Panix-specific keycodes into atKeynames.h,
- since they're not really Panix-specific (David Dawes).
- 262. Fix problem with a NULL pointer in Xv Xineramification (Benjamin Monate).
- 261. Bug fixes and improvements for mouse 3 button emulation state machine
- (Andrew Pimlott).
- 260. Updates for Hurd support (#A.324, Marcus Brinkmann).
- 259. Add call to setlocale() in xev (#A.322, Eugene B. Byrganov).
- 258. Add support fo the charset Big5HKSCS to the X-TrueType module, as
- well as some basic XLocale support for it (#A.321, Roger So).
- 257. Fix core dump in XqueueMousePreInit (#A.317, Fiel Cabral).
- 256. Allow the mga driver's "DigitalScreen" option to work for the first
- head (#A.297, Niels Gram Jeppesen).
- 255. Add zh_CN.GBK locale support (#A.293, Yong Li).
- 254. Fix a problem with the ThinkingMousePS/2 protocol handling of left
- movement (#A.292, Ian Remmler). (This has been in 3.3.x since 3.3.4.)
- 253. Make xdm Xinerama-aware so that it can avoid splitting login and
- chooser windows across physical screens (#A.276,
- Dmitry Yu. Bolkhovityanov).
- 252. Fix a resource allocation bug in the DBE code (#A.271, Bill Rugolsky).
- 251. Only enable Xv support for the 630 in the sis driver (#A.263, Nick Lamb).
- 250. Modify the sis driver to prefer 24bpp framebuffer layout. Perhaps not
- all support 32bpp? (#A.263, Nick Lamb).
- 249. Add missing byte to Intellimouse init string, which fixes problems
- that show up with some KVM switches (#A.258, Seung-Hyeon Rhee).
- 248. Some DRM module fixes for FreeBSD 5-current (#A.242, Andrew Atrens).
- 247. Fix xterm build on Solaris 2.5.1 (based on #A.282 from mark at zang.com).
- 246. Make the Linux/PPC "custom keycodes" choice a run-time option instead
- of a build-time option (#A.240, Franz Sirl).
- 245. Add support to splitting WC MTRR regions on Linux when the regions is
- not aligned on a size boudary (#A.238, _Usul John Obscurant).
- 244. Add Acecad support to the "summa" input driver (#A.237, Arpad Gereoffy).
- 243. Don't try to map 64K blit window aperture on older trident chips
- (Alan Hourihane).
- 242. V4L driver cleanups and Xineramification (#4502, Gerd Knorr).
- 241. Make the X server and the Mac OS X front end run in a single process.
- Other build fixes for Darwin (#4500, #4501, the XonX team).
- 240. Don't build xf86config under BuildServersOnly (Marc La France).
- 239. Potential fix for DGA apps that set colourmaps the normal way rather than
- through DGA (Mark Vojkovich, Marc La France, Pontus Lidman).
- 238. Make fstobdf generate correct ATTRIBUTES fields (Ishikawa Mutsumi).
- 237. Xt man page updates (Paul Vojta).
- 236. Plug kernel security hole in Linux int10 (Marc La France).
- 235. Fix Xnest build for newest gcc versions (Marc La France).
- 234. Fix typo in Xv Xinerama support (Gerd Knorr).
- 233. Fix a problem with multi-thread support on OpenBSD (released OpenBSD
- versions don't have getpwuid_r) (Matthieu Herrb)
- 232. Allow to compile on OpenBSD-current which has completly removed PCVT
- from its installation. (Matthieu Herrb)
- 231. Support for ThreadedX on FreeBSD (FreeBSD ports patch-xthread).
- 230. Updates for console-related FreeBSD system header changes as of 4.1-REL
- (FreeBSD ports patch-r, patch-s).
- 229. Don't leave free'd vrotate uninitialised in lib/X11/omGeneric.c
- (FreeBSD ports patch-q).
- 228. Protect #define HasPam in FreeBSD.cf (FreeBSD ports patch-d).
- 227. Fix border garbage for the G400 second head by backing out #4205
- (David Dawes).
- 227. Fix a typo in fonts/util/Imakefile (#4499, Juliusz Chroboczek).
- 226. Add a document describing the DPS code included in the tree, and
- pointers to web resources (#4498, Juliusz Chroboczek).
- 225. Use VBE to add runtime DDC support to the i810 driver (#4496,
- Andrew C. Aitchison).
- 224. DRM kernel module updates for FreeBSD (#4493, joe at cracktown.org).
- 223. Add support for the "Internet" keys of the Genius Comfy KB-16M keyboard
- (#4491, Kamil Toman).
- 222. Include three DPS sample clients:
- - dpsinfo: random info about the DPS extension;
- - dpsexec: interactive DPS ``executive'' (command-line);
- - texteroids: a demo of font support.
- (#4489, 4497, Juliusz Chroboczek).
- 221. Don't build the GLU library when not building GLX. This fixes
- a build failure when GLX is disabled (#4488, Juliusz Chroboczek).
- 220. Make the stub files that pswrap generates contain the same set of
- includes as the Adobe version, which fixes problems building
- standalone DPS clients (#4487, Juliusz Chroboczek).
- 219. Fix setxkbmap bugs, including:
- - Continue working if the appropriate root window property where the
- current xkb settings are saved can't be read or interpreted.
- - Make the -keymap option work.
- - Update the man page to explain how the "-option" option works.
- - Add primitive sanity checking for 'map name'.
- (#4482, Ivan Pascal).
- 218. Fix a server crash while reading DDC data from EDID2 capable monitors
- (#4481, Andrew C Aitchison).
- 217. Updates to Thai support, including:
- - Fix a bug combining characterw with Shift keys.
- - Remove the th_TH Compose file so that Thai XIM is/can be(?) activated
- without needing XSetLocaleModifiers().
- - A more precise context-sensitive input sequence check using
- XNStringConversionCallback added. This has been tested with
- xiterm+thai-1.04pre2. The implementation detail might be changed
- if found inconsistent with the X11 specification.
- (#4478, Theppitak Karoonboonyanan).
- 216. Update ucs2any.pl, and replace the special map-* files with the
- original mapping files from ftp.unicode.org. Changes include:
- - A bug has been fixed that caused sometimes the FONT property not
- to be updated correctly.
- - The FONTBOUNDINGBOX is now recalculated, which makes the script
- also suitable for proportional fonts.
- - The mapping table for the DEC VT100 graphic characters is now built
- into the script. This means the special map-* files are not necessary
- any more and they could be replaced with the original mapping files
- found on ftp://ftp.unicode.org/Public/MAPPINGS/
- - Whether the DEC VT100 graphic characters are added can be controlled
- with options +d/-d. Default is to add them for upright charcell fonts
- only.
- - Slightly improved warning messages.
- (#4472, Markus Kuhn).
- 215. Fix libGLU build problem on Cygwin (#4467, Suhaib M. Siddiqi).
- 214. Fix missing libX11 exported symbols for Cygwin (#4467,
- Suhaib M. Siddiqi).
- 213. Updates for Hurd support (#A.209, Marcus Brinkmann).
- 212. Fix some mis-placed mem_barrier's for Alpha platforms (Jay Estabrook).
- 211. Fix a Index/DAC register access in glint PM2v, PM3 driver.
- (#A.319, Romain Dolbeau).
- 210. Add Xv support to Permedia3 driver (#4480, #4486 Sven Luther).
- 209. Support for NVIDIA GeForce3 (Mark Vojkovich).
- 208. Allow GccWarningFlags overrides on Linux (Marc La France).
- 207. Fix a problem with xvinfo's listing of image formats
- (Giridhar Pemmasani).
- 206. Fix bug in XkbSetNamedDeviceIndicator (XkbSetNamedIndicator). This
- function can be used both for change state of specified indicator
- (on/off) and for change description (and so behavior) of indicator.
- Fix bug (in XkbGetPerClientControls). Typo where subroutine apply bit
- mask (that consist of bitwise OR of three separate masks) to value
- that have to be returned (#4474, Ivan Pascal).
- 205. Setxkbmap can crash X server if one specify some illegal string as
- 'xkb variant' name (#4471, Ivan Pascal).
- 204. In Grab mode XKB sends 'state' in key events without 'group info'
- (keyboard map layout) (#4469-4470, Ivan Pascal).
- 203. Rewrite the X-Video extension's Xineramification (Mark Vojkovich).
-
-XFree86 4.0.99.1 (19 February 2001)
- 202. Gamma correction and DirectColor visual support for NVIDIA RIVA TNT
- and newer chipsets (Mark Vojkovich).
- 201. IA64 fix for generic int10 code (Egbert Eich).
- 200. Redadding space as delimiter in locale.alias and locale.dir
- (Egbert Eich).
- 199. Modified memory debugger script to retieve backtrace information
- with an unmodified version of gdb (Egbert Eich).
- 198. Modified memory debugger to print out backtrace of call where
- a referenced freed pointer was once allocated (Egbert Eich).
- 197. Several more fixes for memory leaks and several "referenced freed"
- to keep memory debugger quiet (Egbert Eich).
- 196. Fixed "referenced freed" memory debugger message in xf8_24bpp code
- (Egbert Eich).
- 195. Add a new rule for building DRI (client) modules, so that only the
- relevant symbols are exported (#4454, Red Hat).
- 194. Fixed several memleaks in PCI bus code (Egbert Eich).
- 193. Added code to disable SIGIO when entering SETUP state and reenable
- it when leaving SETUP state (Egbert Eich).
- 192. Add type of option argument as comment to config file.
- (xf86cfg might need some fixing) (Egbert Eich).
- (Hopefully) fixed reordering of chips so primary comes first
- (Egbert Eich).
- 191. Fixed bug that caused server to crash when a DGA private colormap
- was freed as miSprite still had a pointer to this colormap
- (Egbert Eich).
- 190. Fixed savage driver for altered vbe functionality (Egbert Eich).
- 189. Moved bulk of generic VBE functionality from VESA driver into
- the vbe module (Egbert Eich).
- 188. Fixed some bugs in vesa driver (Egbert Eich).
- 187. Fixed memleaks in parser code as well as several referenced freed
- pointers which pollute output of memory debugger and obsucre debugging
- (Egbert Eich).
- 186. Fixed ChangeWindowAttributes() in cfb8_16 code (Egbert Eich).
- 185. Moved Linux specific typedef from shared/xf86AXP.h to linux-specific
- os-level code (Egbert Eich).
- 184. Added option to int10 softbooter to POST even primary device.
- 183. Fixed memory leak in linux int10 code (Egbert Eich).
- 182. Modified vm86 trap code not to fail on a #LOCK prefix byte
- (Egbert Eich).
- 181. Fixed memory leak in posix_tty.c (Egbert Eich).
- 180. Added support to generic driver to POST even primary devices
- (Egbert Eich).
- 179. Added support for more AXP chipsets that require sparse addressing
- to bsd os level (Egbert Eich).
- 178. Added missing symbols to C&T driver (Egbert Eich).
- 177. Fixed problems with Xv code in C&T driver (Egbert Eich).
- 176. Fixed a vertical and horizontal offsets on HiQV chips due to
- non-"standard" handling of H/VBlankEnd registers (Egbert Eich).
- 175. Removed code that sets a chipset into graphics mode when
- saving/restoring fonts in standard vga code. This causes problems
- on some trident chipsets (Egbert Eich). [EXPERIMENTAL!]
- 174. Moved KGA code that handles the H/VBlankEnd code that overscans remain
- invisible to separate functions. This way drivers have better control
- over these registers.
- 173. TGA driver fixes (Jay Estabrook).
- 172. Moved option processing to allow VGAClock option to be processed
- (Egbert Eich).
- 171. Added option to swap heads on a matrox G400 dual head (Stefan Dirsch).
- 170. Added handling of broken planemask support on different models of
- matrox G100 cards (Egbert Eich).
- 169. Fixed minor memory leak in ati driver (Egbert Eich).
- 168. Fixed resource registration in TDFX driver (Egbert Eich).
- 167. Set new modelines for Trident LCD modes (Egbert Eich).
- 166. Fixed handling of PreEnd Control register on Trident (Egbert Eich).
- 165. Fixed problem with Trident Blade Mono8x8Patterns (Egbert Eich).
- 164. Fixed clock division for CyberBlade E4 (Egbert Eich).
- 163. Removed last static symbols from Tseng driver (Egbert Eich).
- 162. Fixed handling of ICS5341 RAMDAC under 24bpp (Egbert Eich).
- 161. Fixed resource registration in rendition driver (Egbert Eich).
- 160. Attempt to fix various other issues on rendition - driver remains
- to be broken though (Egbert Eich)!
- 159. Fixed false linear size for NeoMagic 2380 (Egbert Eich).
- 158. Modified calulation of aperture size in NeoMagic driver to use the
- available video memory instead of the map size (Egbert Eich).
- 157. Added a delay to prevent rare cases of lockups when starting
- X on NeoMagic 2160 (Miles Lane).
- 156. Added DGA to Cirrus driver (Egbert Eich).
- 155. Missing symbols added to Cirrus driver (Egbert Eich).
- 154. Fixed acceleration on Alpine (Cirrus) driver. PIO and MMIO versions of
- the accelerator driver now support the same functionality (Egbert Eich).
- 153. Removed unneededed call to xfree() in ddc code (Egbert Eich).
- 152. -
- 151. Siliconmotion driver updates, including:
- - Color change/flash at 8bpp when switch back to desktop in rotation
- mode.
- - System hangs when enabling rotation in 24-bpp.
- - Overlay disappear in the virtual desktop when move the window.
- - Mouse pointer doesn't work properly in panning modes under rotation.
- - Garbage appears on desktop when click the Basic/Metal for the Theme
- Selector.
- - Added ZoomOnLCD option.
- - Desktop changes color when panning in 24-bpp mode.
- - CRT is off after exit X on DSTN 800x600.
- - Screen broken occurs in X when enable Rotation on DSTN 800x600.
- (#4463, Frido Garritsen).
- 150. Include <time.h> in Xos.h to get struct tm (based on #4464, Mike Harris,
- and H.J. Lu).
- 149. Add 1400x1050 60Hz and 75Hz to the default built-in modes (#4462,
- Tim Roberts).
- 148. Create the default modes source file from the mode definitions on
- systems that have perl (David Dawes).
- 147. Alias memset and memcpy to xf86memset and xf86memcpy in the loader,
- which should catch implicit compiler-generated calls to these functions
- (David Dawes).
- 146. Fix NV, Glint, ati and mga drivers for Alpha EV56 machines
- (Jay Estabrook).
- 145. Work around compiler-generated call to memcpy in the sis driver
- (David Dawes).
- 144. Fix the neomagic driver so that it saves/restores the palette (#4452,
- Ken Hornstein).
- 143. Fix a palette saving bug in the vgahw module (#4452, Ken Hornstein).
- 142. Fix a typo in Xfbdev.man (#4446, Juliusz Chroboczek).
- 141. Major updates to the savage driver, including:
- - DDC support
- - I2C support
- - XVideo YUV overlay support for Savage/MX and Savage/IX
- - DGA support
- - yanks Ani Joshi's depth/bitsPerPixel patch for searching the BIOS
- - fixes interactions with frame buffer and SVGATextMode consoles;
- VT switching now seems quite reliable for almost everyone
- - yanks unused options
- - adds new options for hacks to deal with the status register hangs
- - adds one special case memory configuration for Savage 4
- - adds support for doublescan modes (320x240 works)
- - adds LCD panel detection
- - fixes a panning bug at depth 24 (panning must be to even pixels)
- - adds a workaround for bugs in the latest ProSavage BIOSes
- (#4445, 4448, Tim Roberts).
- 140. Make 'X -configure' use the long monitor name when present in the
- DDC info (#4444, Andrew C. Aitchison).
- 139. Make glxinfo respect $DISPLAY (#4443, Meelis Roos).
- 138. Fix TrueType font problems in 4.0.2 (#4439, Juliusz Chroboczek).
- 137. Document the "DisplaySize" keyword in the XF86Config man page (#4438,
- Andrew C. Aitchison).
- 136. Update the i810 driver to set the UV vertical phase for the 4:2:0
- planar formats to account for the spatial relationship between the
- chroma and luma samples (#4436, Jonathan Bian).
- 135. Updates for Cygwin support (#4433, Suhaib M. Siddiqi).
- 134. Fix a bug in the fonts.sgml doc (#4432, Juliusz Chroboczek).
- 133. Fix the xdpyinfo so that it will build when the XKB extension isn't
- defined (#4422, Jim Gettys).
- 132. Fix the xdm greeter so that it will build when the XKB extension isn't
- defined (#4421, Jim Gettys).
- 131. Only build setxkbmap when building the XKB lib support (based on #4420,
- Jim Gettys).
- 130. Improve the mga driver messages when the HAL module isn't available
- (#4451, David Woodhouse).
- 129. Add G450 support to the mga driver (#4416, Luugi Marsan (Matrox),
- 4449, David Woodhouse).
- 128. Mga driver updates, including HAL cleanups, add a Crtc2Ram option,
- and merge with Matrox beta4 source (#4415, Antii Tapaninen, #4423,
- Simon Hosie).
- 127. Fix a rounding problem in the wacom driver that was causing some
- position instability (#4417, Hannes Eriksson).
- 126. Change Freetype2 compilation to pacify makedepend (Marc La France).
- 125. Added changes to il (Hebrew) xkb keyboard map (#4459, Tzafrir Cohen).
- Added new by (Belarusian) xkb keyboard map (#4460, Alexander Mikhailian).
- Small additions to fixes A.272 to allow autorepeat control of MouseKeys
- also in 'non-accelerated mode' (#4461, Ivan Pascal).
- 124. Add ATI Rage 128 PD support (#4455, ISHIKAWA Mutsumi).
- 123. Make modeline2c.pl script case-insensitive (#4453, Mike Harris).
- 122. Change ATI driver to detect panel dimensions of non-PC systems using an
- LT or LT Pro (Marc La France).
- 121. Fix misdetection of sparse I/O PCI bases and handling of unassigned PCI
- bases in ATI driver (Marc La France).
- 120. Extend libc wrapper's emulation of gettimeofday() and add emulation of PC
- and PC98 interval timers to int10 (Marc La France).
- 119. An attempt at fixing the handling of unassigned PCI resources by
- improving detection of them and forcing them to be relocated
- (Marc La France).
- 118. Make lndir ignore finder data files on Mac OS X (Matthieu Herrb).
- 117. -
- 116. -
- 115. Undo s3virge changes in 4.0.2 for Xv support on ViRGE chipsets since
- they caused problems with plain ViRGE cards. Xv is still supported
- for the ViRGE DX (#4414, 4430, Kevin Brosius).
- 114. Siliconmotion driver fixes:
- - 24bpp corruption
- - mouse cursor still showing after X-server shutdown
- (#4413, Frido Garritsen).
- 113. Change the Thai charset and locale description to a form agreed to
- by some Thai developers (#4412, Chanop Silpa-Anan).
- 112. [SECURITY] Fix temp files vulnerabilites in xman on systems with
- mkstemp(). (Matthieu Herrb).
- 111. Major improvement to the Xmaster UI on Mac OS X. (#4447, XonX team).
- 110. 8 bit DAC support for the NVIDIA Riva-128 (Mark Vojkovich).
- 109. Fix panning on Permedia3 (Alan Hourihane).
- 108. Enable wsmouse support on OpenBSD/i386 (Matthieu Herrb).
- 107. Xdarwin bug fixes and updates (#4440-4442, Torrey T. Lyons).
- 106. ATI driver Sparc compile fix (David S. Miller).
- 105. Implement BlockFills at 32bpp in the Permedia3 driver (Alan Hourihane).
- 104. Ensure PCI retry is off for Permedia3, and fix an over by 1 error on
- FIFO usage (Alan Hourihane).
- 103. Prevent glint driver from Seg faulting if mode pool is empty
- (Alan Hourihane).
- 102. Add FIFOSize to glint driver for overriding of the FIFO depending on
- the target chip being used (Alan Hourihane).
- 101. Major updates to the GLINT driver.
- - Add Dual-Headed Appian Jeronimo 2000 support (dual PM3's), it now
- shares heads as per MGA driver for G4xx dual head boards.
- - Faster Permedia3 WriteBitmap/WritePixmap accelerator functions.
- - Fix Scanline acceleration routines when MAX FIFO is reached.
- - Improved Gamma support.
- - Upload cursor and cursor colours for pm2v/pm3 during vertical retrace,
- which fixes r/b inversion and loss of video problems.
- - Fix pm2v/pm3 text restoration problems.
- - Re-arranged structure to accomodate multi-chips per screen.
- - Removed dualmx files and incorporated changes into standalone versions
- - Allow -configure to only configure VGA based Glint chips, works
- around multichip boards (for now).
- (Alan Hourihane).
- 100. Add XaaNoWriteBitmap and XaaNoWritePixmap options to XAA (Alan Hourihane).
- 99. Improve determination of primary adapter (Marc La France).
- 98. Fix PPC xf86sym.c compile problems (Marc La France).
- 97. Fix int10 option handling for drivers that call xf86CollectOptions()
- before calling int10 (Marc La France).
- 96. Properly detect unassigned MMIO address in ATI driver (Marc La France).
- 95. Fix default compilation on Sparc/Solaris (Marc La France).
- 94. Fix typo in Linux/Arm configuration (Marc La France).
- 93. By default, don't build libGLU on libc5 systems (Marc La France).
- 92. Fix HW cursor colors for pm2v/pm3 in the glint driver (Alan Hourihane).
- 91. Rework the memory detection code for Permedia3, now correctly detects
- boards which aren't 32MB (Alan Hourihane).
- 90. Write ScanlineCPUToScreen, ScanlineImageWrite functions for Permedia3
- which write directly to the FIFO, and remove obsolete functions
- (Alan Hourihane).
- 89. Fix ordering of writes in pm2v/pm3 ramdac functions in the glint driver,
- thus fixing the R/B inversion problems (Jay Estabrook).
- 88. Set the version strings in man pages dynamically (David Dawes).
- 87. Remove the XF86_VERSION string from xf86Version.h, leaving just
- the numerical values. All the version information is now derived
- from that single set of values (David Dawes).
- 86. [SECURITY] Fix temp vulnerabilities in Xaw/MultiSrc.c using the technique
- in patch #4279 (Branden Robinson). Fix temp file vulnerability in
- gccmakedep based on report from Alan Cox. Fix temp file vulnerability
- in Imake.rules, InstallManPageAliases (Matthieu Herrb).
- 85. Support vertical sub-pixel glyph rasterization in Xft
- (Keith Packard)
- 84. Allow xf86ClaimPciSlot to be called with a NULL GDevPtr, as it was
- previously (Alan Hourihane).
- 83. Fix clean rule in DRM build (Philip Willoghby).
- 82. If MouseKeys is switched on, then the mousekeys autorepeat. (fixes
- #272, Stephen Montgomery-Smith)
- 81. Ensure Video is unavailable when no acceleration available in the
- trident driver (Alan Hourihane).
- 80. Implement a distclean make target (Marc La France).
- NOTE: To correctly install this change, either `make Everything` or
- `rm xmakefile; make World`.
- 79. Preprocess all man pages to make sure that the references to pages
- in sections that are platform-dependent are correct. Also fixed some
- misc formatting problems found while doing that (David Dawes).
- 78. Ensure client side version checking in 3D drivers for Rage128 and
- Radeon chipsets (Alan Hourihane).
- 77. Nv driver update to fix the cursor for double scan modes, and to
- improve double scan mode handling in general (#4408, Csaba Halasz,
- Jarno Paananen).
- 76. Fix a twm segfault if it gets events for buttons > 5 (#4407, 4425,
- Nathan Hand).
- 75. Update the module subdirectory search list to include "multimedia/"
- (#4405, Vladimir Dergachev).
- 74. Small R6.5.1 merge update in Xlib (based on #4403, Bruno Haible).
- 73. Updates to the xprop utility, including:
- - Move to ANSI C, use const where possible.
- - Print WM_NAME and WM_ICON_NAME properties in the locale encoding.
- - Allow multiple "-remove" commands on the same command line.
- - Better error message when "-remove" is applied to a font.
- - New option "-set" that permits the changing of individual window
- properties.
- (#4402, Bruno Haible).
- 72. Remove schumacher-clean compatibility aliases, since the fonts are
- really ASCII and not iso8859-1 (#4401, Bruno Haible).
- 71. Allow drivers to provide their own substitute for the xf86I2CWriteRead
- function (#4399, Vladimir Dergachev).
- 70. Cirrus driver updates, including:
- - Add a call to fbPictureInit() in the Laguna driver.
- - Fix warning (missing a symbol from VBE) when starting the Alpine
- driver.
- - Fix MMIO acceleration for the CL-GD5480
- (#4395, Itai Nahshon).
- 69. Fix Neomagic 2200 screen corruption (Egbert Eich).
- 68. Disable RENDER extension support in the ATI(misc) driver when mibank
- and/or shadowfb is used (Marc La France).
- 67. Remove cfb & friends from the ATI driver (Marc La France).
- 66. Some additional ATI PCI IDs (Marc La France).
- 65. Make compilation of drivers produce the same object whether or not
- DPMS and DGA extensions are being built. Partial changes to do the same
- for RENDER (Marc La France).
- 64. Ensure `make depend` goes through the same set of subdirectories as
- `make all` does. Allows MakefileAdditions to contain depend rule(s)
- (Marc La France).
- 63. Move $(EXTRA_DEFINES) to the end of ALLDEFINES. Ditto for
- $(CXXEXTRA_DEFINES) and CXXDEFINES. Allows easier overrides at the
- subdirectory level (Marc La France).
- 62. Add a pre-clean phase to `make World` if xc/xmakefile already exists
- (Marc La France).
- 61. Import X.Org's X11R6.5.1 (David Dawes)
- 60. Change identification of Trident 8400(CyberBlade/i7) so that it is not
- a Cyber chipset (integrated Desktop version) (Alan Hourihane).
- 59. Use the wsmouse protocol in XFree86 -configure if wsmouse is available
- (Matthieu Herrb, lha at stacken.kth.se).
- 58. Sync Xdarwin with XonX version (#4428 Torrey T. Lyons):
- - add a working WarpCursor
- - add 15 bit pixel depth to the Quartz mode.
- 57. New version of Xmaster, a Mac OS X application that controls the
- X server (#4427, Torrey T. Lyons, Andreas Monitzer).
- 56. Add external CRT support for the Rage 128 Mobility (Kevin Martin
- and ATI).
- 55. Radeon DRI fixes (VA Linux Systems).
- - Re-enable freeing resources when the screen is destroyed (Kevin
- Martin)
- - Use screen-relative instead of window-relative coordiantes to
- calculate the tiled depth buffer offset address (Kevin Martin)
- - Fix texture upload at offset 0 bug. Quake 2 engine games use
- TexSubImage to update lightmaps and the like, and we were
- uploading the updates before the image had space in the texture
- heap allocated to it. (Gareth Hughes)
- - Add XF86Config file option to enable depth buffer moves (they
- are disabled by default since they are excuciatingly slow)
- (Kevin Martin)
- - Enable bus mastering in PCI config space for those systems that
- do not automatically have it enabled (Kevin Martin)
- - Remove AGP_CNTL register programming -- it was a holdover from
- the Rage 128 driver and is not needed on the Radeon (Kevin
- Martin)
- - Fix offscreen memory allocation calculation for textures (Kevin
- Martin)
- 54. Allow libGLU to be built (Craig Dunwoody, SGI, David Dawes,
- Alan Hourihane).
- 53. Import the GLU parts of ogl-sample.
- 52. Add an imake control for determining when xload should be installed
- set-gid (David Dawes).
- 51. Add some imake controls for installing Xkb and app-defaults files
- in the traditional location rather than under /etc/X11 (Red Hat does
- that) (David Dawes).
- 50. Add compressed man page functionality to the rules in Imake.rules,
- so it should be usable on most platforms (David Dawes).
- 49. Make acceleration work on the Trident Cyber9388 (Alan Hourihane).
- 48. - Various small changes to accomodate Mac OS X support and fix a
- problem people were having with uninitialized globals in X
- libraries,
- - Allow XFree86 to run on Mac OS X as a full screen client of
- CoreGraphics,
- - Add a Mac OS X application that controls the X server and feeds it
- events when running on Mac OS X. Currently must be built by
- ProjectBuilder (#4409, #4410, #4411, Torrey T. Lyons).
- 47. Fix Mach64 Mono 8x8 Pattern acceleration (Marc La France).
- 46. Experiment with setting the server's "vendor release" value from
- the information in xf86Version.h, and modify xdpyinfo to show the
- server version in an easily readable format (David Dawes).
- 45. Fix 1bpp colour map in vgaHW (Marc La France).
- 44. More IA64 loader fixes and make xf86sym.c compile again
- (Michael Madore, Marc La France).
- 43. Add missing symbols in vesa driver (Marc La France).
- 42. Fix multihead pointer problem on Rage 128 (Mark Vojkovich).
- 41. Resync with DRI CVS trunk (Kevin Martin, VA Linux Systems)
- - Add Radeon 3D driver (Kevin Martin and Gareth Hughes)
- - Improve Rage 128 3D driver support (Gareth Hughes)
- - Add fast AGP read/drawpixels support in MGA driver (Keith Whitwell)
- - Update DRI docs (Kevin Martin, Brian Paul)
- - Fix various bugs (Keith Whitwell, Brian Paul, Kevin Martin)
- 40. Rename fsinfo to xfsinfo to avoid a name clash with the fsinfo utility
- in the Berkeley automounter amd (Matthieu Herrb).
- 39. Invert NO_COMPILER_H_EXTRAS to prevent unintentional references to inx()/
- outx() on the likes of SunOS (Marc La France).
- 38. Change the os-support layer to only claim a bare minimum of I/O resources
- rather than a larger estimate (Marc La France).
- 37. Loader work: Fix handling of shared GOTs on IA-64 and Alpha's, and of
- PLT and OPD entries on IA-64; Cleanup debug messages and #if testing
- (Marc La France).
- 36. Extensive int10 rework to address lockups, spontaneous reboots and tight
- CPU loops on various architectures (Marc La France):
- - Use intialised BIOS to softboot primary adapters on non-PC's;
- - Fix endianness problems;
- - Move stack into its own page to prevent overwritting interrupt vectors;
- - Prevent (with a message) int10 from interfering with mainboard devices
- (i.e. RTC, keyboard, speaker, chipset, etc.);
- - Flesh out int 0x42 emulation on non-PC's;
- - Emulate BIOS data area on non-PC's;
- 35. Add missing symbols in i810 and sis drivers (Marc La France).
- 34. Optionally disable, at compile time, loader bug workarounds in ATI driver
- (Marc La France).
- 33. Prevent the Rage 128 and Radeon drivers from initialising an adapter more
- than once (Marc La France).
- 32. Move support for >64kB BIOS'es from int10 into the os-support/bus layer
- (Marc La France).
- 31. When retrieving PCI BIOS'es, only use another PCI base when a previous
- retrieval attempt fails (Marc La France).
- 30. Temporary kludge to not consider any adapter as primary if more than one
- candidate can be found (Marc La France).
- 29. Make deleted mode messages less fearsome (Marc La France).
- 28. Fix -configure to retrieve the correct set of options for ATI, C&T,
- Cirrus and NeoMagic adapters (Marc La France).
- 27. When removing PCI resource overlaps, always consider resources whose size
- can be accurately determined, whether active or not (Marc La France).
- 26. Real 4:2:0 YUV support for the Rage 128 (Mark Vojkovich).
- 25. Xinerama support for Render extension (Keith Packard).
- 24. Make some changes to the clock selection for trident driver
- (Alan Hourihane).
- 23. Switch savage driver to fb (+Render), correct maxHValue (Keith Packard).
- 22. Add font property caching in Xft (Keith Packard).
- 21. Xterm patch #150 (Thomas Dickey).
- 20. Fix 24/8 Overlay support on Permedia2v and Permedia3 chipsets
- (Alan Hourihane).
- 19. Add CyberStretch option to the trident driver for Cyber chipsets that
- allows Graphics modes to stretch to the full display (Alan Hourihane).
- 18. Xterm patch #149 (#4351, Thomas Dickey).
- 17. Fix Y offsets passed to pixmap cache when DRI disabled in R128 driver
- (Alan Hourihane).
- 16. Add BlockFills to Permedia3 (Alan Hourihane).
- 15. Fix pixmap cache when more than 16MB of memory on Permedia 3
- (Alan Hourihane).
- 14. Fix colourmap problems at depth15/16 on Permedia3 (Alan Hourihane).
- 13. Bump xc/programs/Xserver/GL/dri (libdri.a) version to 3.1.0 to
- correspond with the DRI backbuffer rewrite, and modify drivers accordingly
- (Alan Hourihane).
- 12. Enable ImageWrites on Rage128 and Radeon (Alan Hourihane).
- 11. Add DRIMoveBuffersHelper function to prevent code duplication in
- the drivers (Mark Vojkovich).
- 10. Bug fixes for endianness problems in Permedia3 driver
- (#4404, Sven Luther).
- 9. Add Appian Jeronimo 4x8Mb (PM2v) support to the glint driver
- (Alan Hourihane).
- 8. Add render support to i810 driver (Keith Packard with testing
- by Christien Bunting)
- 7. Switch misc (non-radeon, non-r128) ATI driver to fb (Keith Packard).
- 6. 3DFX driver changes (Mark Vojkovich).
- - fix some DGA issues.
- - 2D and 3D now share offscreen memory (much faster 2D now).
- - rewrite Xv support to use the video overlay.
- - add new Options "VideoKey" and "ShowCache".
- 5. Change xterm from simple face name to full Xft font name so
- that options can be provide (like minspace) (Keith Packard)
- 4. Add UTF-8 support to Xft (Keith Packard)
- 3. Add font/face sharing and a minumum vertical space option
- to Xft (Keith Packard)
- 2. Fix 64 bit DGA bug (Mark Vojkovich).
- 1. Rewrite DRI back buffer handling to minimize the impact on 2D
- performance (Mark Vojkovich).
- 0. Fix incorrect driverName fields in the cyrix, i810 and sis drivers.
- This was causing 'XFree86 -configure' to get the driver name wrong
- (David Dawes).
-
-XFree86 4.0.2 (18 December 2000)
-1211. Fix a problem introduced recently when using the "ps/2" protocol for
- mice on FreeBSD (David Dawes).
-1210. Disable DRI for tdfx when there's insufficient memory for textures
- (Alan Hourihane).
-1209. Rename the R6.4 INSTALL and RELNOTES docs at the top level of the source
- tree, and add a copy of the XFree86 RELNOTES.
-1208. Add Solaris 8/x86 key mappings for some more jp106 keys.
-1207. Fix wacom man page to match the driver (based on #4398, Akio Morita).
-1206. Install the iso8859-13 encoding file (#4397, Nerijus Baliunas).
-1205. Misc doc-related updates.
-
-XFree86 4.0.1Zc (15 December 2000)
-1204. Fix an Xlib memory overrun when the Xutf8TextPropertyToTextList function
- is used in a unibyte locale (#4394, Bruno Haible).
-1203. Fix the yen/backslash keys for Solaris 8/x86 with Japanese 106 keyboards
- (based on #4393, Takaaki Nomura).
-1202. Fix type mismatches in the r128 DRI driver on Alpha platforms (#4392,
- Gareth Hughes).
-1201. Fix build on Japanized version of Solaris 8 for x86 (#4390,
- Takaaki Nomura).
-1200. Remove some old XtOffset magic for the arm that affects building
- with gcc (#4388, Keith Packard).
-1199. Release notes updates (David Dawes, Egbert Eich, Mark Vojkovich,
- Robin Cutshaw, Keith Packard, Alan Hourihane, #4391, Kevin Brosius).
-1198. Revert the tdfx driver to something functionally close to the
- last known working version (4.0.1g) (David Dawes).
-
-XFree86 4.0.1Zb (14 December 2000)
-1197. New fonts document (#4386, 4387, Juliusz Chroboczek).
-1196. Status doc update for Trident (Alan Hourihane).
-1195. Update the R6.4 INSTALL and RELNOTES docs to include references at
- the top to the XFree86-specific docs (David Dawes).
-1194. Make it possible to install platform-specific man pages with most
- ix86 builds (David Dawes).
-1193. Add a short man page for the newport driver, update it's sample config
- file, and have the driver check user-supplied parameters (#4385,
- Guido Guenther).
-1192. Missing part of fix for FreeBSD sysmouse support (#4317, from FreeBSD
- ports collection).
-1191. Trident driver bug fixes (Alan Hourihane).
-1190. Make it possible to install hardcopy specs docs that we can't generate
- from source (David Dawes).
-1189. Set the HasPerl default correctly for LynxOS (#4384, Thomas Mueller).
-1188. Lots of Status doc updates (#4383, Branden Robinson).
-1187. Update some DebianMaintainer defaults in linux.cf (#4380,
- Branden Robinson).
-1186. Fix a segfault in the font path verification code in xfs (#4379,
- Charles C. Fu).
-1185. Rework and document the various MatroxHal imake parameters, and
- build in support for the mga_hal module by default for loadable server
- builds (David Dawes).
-1184. Fix sis driver corrupt display with more than 8MB of video memory (#4378,
- Can-Ru Yeou).
-1183. Fix xf86cfg build problem on systems that don't come with snprintf
- and/or regex (based on #4361, Thomas Mueller).
-1182. Fix siliconmotion driver screen restoration when a graphics vesafb mode
- is selected during boot up (#4377, Frido Garritsen).
-1181. Install and RELNOTES updates for Darwin (#4375, 4376, Torrey T. Lyons).
-1180. s3virge patch to get Xft/Xrender working (#4374, Kevin Brosius).
-1179. Improve aperture driver related error messages on OpenBSD
- (Matthieu Herrb).
-1178. Workaround for IA-64 loader bug (Marc La France).
-1177. Fix recognition of valid depth/fbbpp combinations in ATI driver
- (Marc La France).
-1176. Fix 1bpp in ATI driver (Marc La France).
-1175. Fix ATI DPMS support on panels by mimicking BIOS behaviour more closely
- (Marc La France).
-
-XFree86 4.0.1Za (12 December 2000)
-1174. Set defaults for Mesa's x86 CPU-specific asm options, and make it
- possible to build with MMX disabled for systems with older assemblers
- (David Dawes).
-1173. Fix some R128 DRI bugs:
- - Fix depth span functions (was causing rendering errors for windows
- not at (0,0)).
- - Don't use 32-bit depth buffers since they're not supported by Mesa.
- - Use subpixel offsets to fix coordinate rounding errors.
- (#4373, Gareth Hughes).
-1172. Reinstate the AllTarget for the rule to make html man pages
- (David Dawes).
-1171. Build all modules on Linux/mips, fixing Xnest build (#4372,
- Guido Guenther).
-1170. Update Permedia 3 README, Cards file, and glint section in the Status
- doc (#4371, Sven Luther).
-1169. Fix depth passed to the BIOS in the savage driver (affects depth 15)
- (#4369, Ani Joshi).
-1168. Update fbdev man page (#4368, Michel Daenzer).
-1167. Fix a problem with 32-bit depth buffers when using indirect rendering,
- by not advertising them in the mga driver (#4367, Brian Paul).
-1166. Update man page version strings, and convert some server/XFree86 man
- pages to cpp-processed files to make the references to pages in
- system-dependent sections correct (David Dawes).
-1165. Update the release notes for the i18n and Unicode support (#4366,
- Bruno Haible).
-1164. Document most of the environment variables that can influence libX11
- and libXt in the 'X' man page (#4365, Bruno Haible).
-1163. Update the ICCCM spec document to relfect the selection targets currently
- used in XFree86 (#4364, Bruno Haible).
-1162. Update the CTEXT spec document to reflect part of the current
- practice in XFree86 (#4363, Bruno Haible).
-1161. Augment SpecsDocDirs to reflect additional docs that have XFree86 changes
- (#4362, Bruno Haible).
-1160. Fix Xv library references in the xvinfo Imakefile (#4361,
- Thomas Mueller).
-1159. Fix a signed/unsigned error in the calculation of 16-bit displacements
- in x86emu (#4359, Tim Roberts).
-1158. Fix "noaccel" option in the tdfx driver when building without DRI
- (David Dawes).
-1157. Add Darwin documentation (Torrey T. Lyons).
-1156. Add Darwin bindist files and update Xinstall.sh (Matthieu Herrb).
-1155. Update bindist files for NetBSD 1.5 ELF (Matthieu Herrb).
-1154. Add DGA support to I128 driver (Robin Cutshaw).
-
-XFree86 4.0.1Z (8 December 2000)
-1153. Flesh out the wacom man page (#4358, Frederic Lepied).
-1152. Fix incorrect documentation for xf86UnMapVidMem() in README.OS-lib
- (#4357, Guido Guenther).
-1151. Update the newport driver to use the map/unmap functions provided by
- the os-support layer (#4356, Guido Guenther).
-1150. Bugfix to xf86UDelay() (Egbert Eich).
-1149. Added a sanity check to pciConvertRange2Host() (Egbert Eich).
-1148. Added more log messages to Linux APM code (Egbert Eich).
-1147. Added a sanity check to xf86ConfigPciEntity() (Egbert Eich).
-1146. Resync with DRI CVS trunk (tdfx driver updates) (Daryll Strauss).
-1145. Add -textmode mode option for xf86cfg, to run a ncurses interface, and
- add the "expert" interface, to provide more control over the config file.
- Updates to vesa driver, removed debug messages and fixed problem with
- console restoration in some S3 cards.
-1144. Merge tdfx 3D driver code (VA Linux).
-1143. Add support PPC support on Rage 128 and disable Int10 for PPC on
- Rage 128 (until the bug in PPC Int10 support is fixed) (Kevin Martin).
-1142. Install an alternative fonts.alias file that references the UCS-encoded
- fonts on systems without Perl (David Dawes).
-1141. Add CyberShadow Option back into Trident driver (Alan Hourihane).
-1140. Resync with DRI CVS trunk, including:
- - SSE support updates
- - DRI-specific full screen mode
- - Reduce the minimum space required for 3D on the Rage 128
- (VA Linux).
-1139. Fix a memory leak in the UTF-8 <--> CompoundText converter (#4354,
- Bruno Haible).
-1138. Add support for the selection target UTF8_STRING to libXaw (#4353,
- Bruno Haible).
-1137. Make Xlib's CompoundText converter ISO-2022 compliant (#4352,
- Bruno Haible).
-1136. Fix 2 wacom driver bugs (core dump on VT switching, and USB support)
- (#4350, Frederic Lepied).
-1135. Update the ClearlyU fonts to 1.8b. Changes include:
- - Cleaned up the Arabic glyphs so they don't look quite so juvenile.
- - Squared up the Hebrew glyphs so they match the style of the other
- scripts better.
- - Added many of the basic Hangul glyphs.
- - Brought the Cyrillic block in line with Unicode 3.0 and moved the
- extra glyphs into the PUA font in the 0xE4XX range.
- (#4349, Mark Leisher).
-1134. Update the savage driver to all I/O via MMIO, and add DPMS support
- (4347, Ani Joshi).
-1133. Change xfs to drop privs after daemonising so that the pid file can
- be written (#4346, Frederic Lepied).
-1132. Miscellaneous fixups to the trident driver (Alan Hourihane).
-1131. Add Xv support to the trident driver. Works for Blade and Image series
- chips, but zooming currently doesn't work on Image series.
- (Alan Hourihane).
-1130. Don't perform a software reset on the Graphics Engine for Trident
- Blade3D's and CyberBlade's (Alan Hourihane).
-1129. Fix typo in int10 for IA-64's (Marc La France).
-1128. Make PCI bridge information in the log more accurate (Marc La France).
-1127. Update ATI docs (Marc La France).
-1126. Another getValidBIOSBase() fix (Marc La France).
-1125. If the loader server dies from a signal during initialisation, print a
- list of undefined symbols (Marc La France).
-1124. Move Alpha MMIO definitions from xf86_OSproc.h to compiler.h
- (Marc La France).
-1123. Change update.docs rule for shadow tree friendliness (Marc La France).
-1122. Don't reference libc wrapper names directly in the newport driver
- (David Dawes).
-1121. Fix the fr_CH xkb Macintosh symbols file (#4345, Olaf Hering).
-1120. Revert the Estonian_Estonia.1257 change in patch #4297 because
- windows-1257 is a closer match to iso8859-13 than iso8859-15.
- Also add entries for the et_EE.ISO8859-1 locale (while not perfect for
- Estonian, it is commonly used) (#4344, Ville Hallik).
-1119. Change name of long Unicode keysyms from 6 to 8 hex digits, which
- matches conventional usage better (#4343, Ivan Pascal).
-1118. Make XF86VidModeSetViewPort() actually set the viewport to the
- X and Y coordinates specified as opposed to always setting it to (0,0)
- (#4342, Joe Moss).
-1117. Work around some build problems on SVR4.0 (#4341, Satoshi Kimura).
-1116. Compose characters for the Macedonian UTF-8 locale (#4338,
- Damjan Georgievski).
-1115. Fix build problems with the wacom driver on Linux 2.4 when building
- a static server (Frederic Lepied, David Dawes).
-1114. Changed name of server binary to call by xf86cfg back to "XFree86
- (Egbert Eich).
-1113. Modified handling of memory alloctaion in TDFX driver (Egbert Eich).
-1112. Attempt to fix the 'UseModes' directive in the Monitor section
- (Egbert Eich).
-1111. Added debugging output for BIOS base address search (Egbert Eich).
-1110. Changed neomagic driver to treat disable stretching for each mode
- individually (Egbert Eich).
-1109. Removed '-traditional' from cpp rule for makedpend. Required for
- new glibc header files (Ruediger Oertel).
-1107. Fix to make SuperProbe build again on ia64 (Andreas Schwab).
-1107. Attempt to fix int10 (Egbert Eich).
-1106. Modified blitter busy test to use the MMIO mapped registers on chips
- > CT69000 (Egbert Eich).
-1105. Attempt to improve dga support in C&T driver (Egbert Eich).
-1104. Moved ppc_flush_icache to compiler.h - hope this fixes build problems
- (Egert Eich).
-1103. changed cirrus driver to us fb instead of cfb (Egbert Eich).
-1102. Modularized HALlib for mga driver (Egbert Eich).
-1101. Added DGA support to tseng driver (Rainer Keller).
-1100. Added "framebuffer" bus type allowing resource control to take place
- outside of the server (Egbert Eich).
-1099. Added turkish keyboard layout (Togan Muftuoglu).
-1098. Fix Cyber9397/DVD acceleration problem (Alan Hourihane).
-1097. Resync with the DRI CVS trunk.
-1096. Fix alot of Rage 128 Xv bugs (Mark Vojkovich).
-1095. Fix XKB symbols for Swedish Macintosh keyboards (#4337, Olaf Hering).
-1094. Disable DRI on PPC (#4337, Olaf Hering).
-1093. Suppress xf86ReadBIOS debugging messages for BSD (#4336, Takaaki Nomura).
-1092. Silicon Motion driver update, includes bug fixes (#4335,
- Frido Garritsen, Silicon Motion, Inc.).
-1091. Updates to the dumpkeymap utility and its documentation (#4323,
- Eric Sunshine).
-1090. Enable 3D support for Rage 128 Mobility chips (Kevin Martin).
-1089. Add clip rectangles support to Render extension, Xrender and Xft.
- Make Xrender and Xft usable from c++.
- Fix a bunch of compiler warnings in Render extension code
- (Keith Packard)
-
-XFree86 4.0.1h (4 December 2000)
-1088. Fix key mapping for the '\' key on GB keyboards in Solaris 8.
-1087. Status doc updates for Neomagic an NVIDIA (#4334, Andrew C. Aitchison,
- Mark Vojkovich).
-1086. Updated Rage 128 DRI support from the DRI CVS (Gareth Hughes, VA Linux).
-1085. -
-1084. Bump the minor revisions of libXmu (UTF8_STRING) and libX11
- (Xutf8LookupString).
-1083. Fixes for all known bugs in the CompoundText parser and generator,
- including:
- * While adding a charset:
- - Adding a charset with two different escape sequences (e.g.
- ISO-8859-14) led to broken behaviour of the converter. Moreover
- the second added would have priority over the first added.
- - If an invalid escape sequence was detected by _XlcParseCharSet, it
- was still used when generating compound text.
- - Extended segment charsets with varying number of bytes per character
- were treated like those with 1 byte per character.
- - _XlcAddCT failed to copy its ct_sequence argument, thus leading to
- bugs when this argument was a dynamically allocated string.
- - Missing detection of different charsets having the same escape
- sequence.
- * Parsing Compound Text:
- - The functions _XlcParseCT and _XlcGetCTInfo did not perform range
- checks on the strings being parsed. Danger of core dump through
- out-of-bounds string access if a malicious client provides malformed
- text.
- - Builtin extended segment charsets were not recognized because the
- strncmp in _XlcGetCTInfo was returning false most of the time, due
- to the embedded length bytes.
- - Extended segment charsets in general would not be deactivated after
- the specified number of bytes.
- - In _XlcCheckCTSequence, extended segments with invalid embedded
- length bytes would lead to out-of-bounds string accesses as well.
- - Unrecognized escape sequences did not lead to a return value > 0.
- - Left-to-right and right-to-left indicators (starting with 0x9b) were
- just ignored, without leading to a return value > 0.
- - If the source string was larger than the intermediate buffer,
- multibyte characters could be split into pieces, leading to
- conversion errors.
- * Generating Compound Text:
- - The length embedded in an extended segment prefix was always wrong.
- - Long strings could give rise to extended segments with a length that
- doesn't fit in the allowed 14 bits.
- - After an extended segment, GL or GR designators would unnecessarily
- be repeated.
- - Bytes in the range 0x81..0x88, 0x8b..0x9a, 0x9c..0x9f in multibyte
- encodings could not be output, would be thrown away.
- - Byte 0x9b could not be output in the UTF-8 charset.
- * udcInf.c was generating invalid Compound Text (invalid length in
- extended segment).
- * lcConv.c: If in the indirect converter, the first step led to no
- output, the second step would still be called, possibly leading to
- out-of-bounds accesses.
- * lcUTF8.c: had knowledge about JISX0208.1983-0 but not about
- JISX0208.1990-0.
- (#4333, Bruno Haible).
-1082. Fix documentation for XSetOMValues() (#4332, Bruno Haible).
-1081. Fix namespace polution in <X11/Xlib.h> introduced with patch #4293
- (#4331, Bruno Haible).
-1080. Fix a bug in the newly introduced Xutf8LookupString() function that
- loses input not representable in the locale encoding (#4330,
- Bruno Haible).
-1079. Avoid four new gcc warnings about const in lcUTF8.c introduced by
- patch #4293 (#4329, Bruno Haible).
-1078. Fix some additional cases of confusing local typedef for wchar_t
- (#4328, Bruno Haible).
-1077. Fix some round-trip conversion errors in COMPOUND_TEXT -> UTF8_STRING ->
- COMPOUND_TEXT due to wrong tables introduced by patches #4214, 4215
- (#4327, Pablo Saratxaga).
-1076. Cygwin update for building Xrender DLL (#4326, Suhaib M. Siddiqi).
-1075. Fix an undefined SUBDIRS in xc/lib/GL/mesa/src/drv/Imakefile when
- compiling on something other than x86, alpha or sparc (#4325,
- Brian Paul).
-1074. Don't have the neomagic driver disable stretching when a mode that
- fills the panel is selected (#4324, Andrew C. Aitchison).
-1073. Fix a bug in Xlib's _XimLocalMbLookupString() that causes a crash when
- a zero keycode keypress event is received (#4322, HIBINO Kei).
-1072. NetBSD doesn't have perl in its default install (Matthieu Herrb).
-1071. Add Xft support to xditview with #ifdefs (Keith Packard)
-1070. Add a MIT-MAGIC-COOKIE-1 generator to startx for NetBSD 1.5 and OpenBSD
- and FreeBSD and make mkcookie support more generic (Matthieu Herrb).
-1069. Update OpenBSD and NetBSD docs (Matthieu Herrb).
-1068. Clean up r128_video.c again (Marc La France).
-1067. Fix ATI clock generator recognition when an adapter BIOS cannot be
- retrieved (Linus Torvalds).
-1066. Fix int10 and ATI driver for video BIOSes larger than 64kB
- (Marc La France).
-1065. Change xf86MatchDevice() to initialise its return pointer and clean up
- drivers accordingly (Marc La France).
-1064. Fix for bug in new imConv.c (#4318, Ivan Pascal).
-1063. Fix for FreeBSD sysmouse support (#4317, from FreeBSD ports collection).
-1062. Enable the ru_SU local entries for FreeBSD (based on patch from FreeBSD
- ports collection).
-1061. Driver for the S3 Savage family of chips (#4315, 4316, 4319-4321,
- Tim Roberts).
-1060. Add xkb definitions for the Logitech cordless keyboard (#4314,
- Michel Goraczko).
-1059. Add support for "unicode keysym" to XKeysymToString() and
- XStringToKeysym() (#4313, Ivan Pascal).
-1058. SiS driver updates, including:
- - Performance tuning for sis630
- - Support XV extension for sis630
- - Support Chrontel TV for sis630
- (#4312, Can-Ru Yeou).
-1057. Fix Xrender library to handle strings > 254 chars long.
- Change Xrender and Xft interfaces to use 'unsigned int'
- instead of 'unsigned long' for 32-bit glyph values.
- (Keith Packard)
-1056. Fix neomagic driver mangled acceleration test (#4309, 4310,
- Chip Salzenberg).
-1055. Add a rudimentary driver for the SGI Indy's newport cards (only
- 8-bit and non-accelerated so far) (#4308, Guido Guenther).
-1054. Fix a bug in rman that is provoked by the new dumpkeymap man page
- (David Dawes).
-1053. Updates to the dumpkeymap utility, and add documentation (including
- a man page) (#4307, Eric Sunshine).
-1052. Add -version and -showconfig options to the Darwin Xserver, and print
- the usual "XFree86" banner message (#4306, Torrey T. Lyons).
-1051. Fix i810 crash when running XFree86 -configure (#4305, Ryan Drake).
-1050. Linux APM fix, which fixes a problem that shows up with the neomagic
- driver after an APM suspend (#4304, 4311, Chip Salzenberg).
-1049. Correct maximum ranges for Wacom IV devices (#4303, Frederic Lepied).
-1048. Add preliminary support for USB input devices under Linux (wacom
- driver (#4303, MATSUMURA Namihiko).
-1047. Locale fixes/cleanups, including:
- - Cleanup garbage in XLC_LOCALES.
- - Add "use_stdc_env' to locales where it was absent.
- - Move non-standard charset descriptions from the lcCT.c table to
- the XLC_LOCALE files.
- (#4302, Ivan Pascal).
-1046. Make sure the correct "driverName" string is used in xf86Configure.c.
-1045. Fix some i810 driver problems when too little videoRam is specified
- (David Dawes).
-1044. Fix an i810 driver bug that prevents the DRI from being enabled
- after a server reset (Jeff Hartmann).
-1043. Add a "dri" config file option to the i810 driver that can be used
- to enable/disable the DRI (no other method works for statically
- linked servers) (David Dawes, from VA's 7.0.1).
-1042. Update the i810 driver to check the max available GART memory
- (Jeff Hartmann, David Dawes, from VA's 7.0.1).
-1041. Resync DRI code/drivers with the DRI CVS (VA Linux). Includes
- 3dfx driver updates (Daryll Strauss).
-1040. Fix a couple of clipping problems on the Trident CyberBlade/Blade3d
- chipsets (Alan Hourihane).
-1039. Fix a couple of Alpha related issues (Jay Estabrook).
-1038. Change Xft interface (again) to use new XftColor datatype for
- colors instead of XRenderColor. xterm and x11perf updated to
- match. (Keith Packard)
-1037. Fix an i810 init problem that resulted in the fallback to 2D failing
- for one case where there's insufficient memory to enable the DRI
- (David Dawes, from VA's 7.0.1).
-1036. Add support for printing a vendor-specific version string in the
- X server startup messages (David Dawes, from VA's 7.0.1).
-1035. Xwd workaround for a gcc bug (Red Hat's XFree86-4.0.1-xwd-gcc-workaround
- patch).
-1034. Fixes for sparc drivers, mostly to prevent accessing the hardware
- when the server doesn't have control of the VT (Red Hat's
- XFree86-4.0.1-ffb patch).
-1033. Use OS-provided interface for accessing PCI config space on Linux/ia64
- (based on Red Hat's XFree86-4.0.1-ia64-pci patch).
-1032. Use AsmDefines when processing the Sparc assembler code for cfb
- (based on Red Hat's XFree86-4.0-sparc-asmflags patch).
-1031. Add PAM authentication to the X server (based on Red Hat's
- XFree86-4.0-Xwrapper patch).
-1030. Add Slovenian and Romanian entries to XKB's keymap/xfree86 file
- (Red Hat's XFree86-4.0-si_xkb patch and XFree86-4.0-ro_xkb.patch).
-1029. Fix for PAM support in xdm SessionExit() (Red Hat's
- XFree86-4.0-pamsession patch).
-1028. XlibInt.c patch to avoid buffer overflow (Red Hat's
- XFree86-3.3.6-fixemacs patch).
-1027. Updates to xfs from Red Hat and Debian, including:
- - command line options to make xfs drop it's root privs (-droppriv
- and -user) - command line options to make xfs start as a daemon,
- and a build option to make this the default.
- - don't let a port option in the config file override the -port
- command line option
- - cleanup/fix syslogging
- (based on #4253, Topi Miettinen, Debian, and Red Hat's
- XFree86-4.0-xfsredhat patch).
-1026. Support for startx to set up the Xauth when starting an X server
- (based on Red Hat's XFree86-4.0-startx_xauth patch).
-1025. Fix an unaligned access on Alpha with the tdfx driver (Jay Estabrook).
-1024. Add detection for CyberBlade/Ai1 Socket A chipsets (Alan Hourihane).
-
-XFree86 4.0.1g (29 November 2000)
-1023. Fix small bug in lcGeneric.c (#4301, Ivan Pascal).
-1022. Rewrite Xft library for Render extension/core text and font management
- Change xterm to use new interface (Keith Packard).
-1021. s3virge driver updates, including Xv fixes for the ViRGE DX, disable
- GX2 color expansion until it's stable, GX2 Xv code (not enabled or
- working yet) (#4299, Kevin Brosius).
-1020. Siliconmotion driver (#4298, Frido Garritsen, Silicon Motion, Inc.).
-1019. Fix Estonian_Estonia.1257 entry in locale.alias (#4297, 4300,
- Nerijus Baliunas).
-1018. New Lithuanian XKB map (#4296, Nerijus Baliunas).
-1017. Fix a problem with the "xtt" font module introduced with recent
- changes to the "freetype" module (#4295, ISHIKAWA Mutsumi).
-1016. Fix the return value for the "indirect" converter in Xlib (#4294,
- Bruno Haible).
-1015. ANSI C cleanup of Xlib locale core code (#4293, Bruno Haible).
-1014. Optimize the i18n support for parsing resource files for the unibyte
- locales, and clean up pre-ANSI-C-isms and warnings (#4292, Bruno Haible).
-1013. Enhance the CompoundText <-> UTF-8 converter so that it understands
- the BIG5 encoding scheme used by Emacs (#4291, Bruno Haible).
-1012. Fix documentation and implementation of _XlcCompareISOLatin1 and
- _XlcNCompareISOLatin1 (#4290, Bruno Haible).
-1011. Add new Unicode-based APIs for internationalized text for Xlib (#4289,
- Bruno Haible).
-1010. Fix a minor Mesa lighting bug (#4288, Brian Paul).
-1009. Fix the glide driver's resolution of symbols from the glide library
- (#4281, Pontus Lidman).
-1008. Fix X server stalling forever with local font servers on Linux 2.4
- kernels (#4280, Branden Robinson).
-1007. Improve temp file handling in the Xaw library (#4279, Branden Robinson).
-1006. Add support for Rage 128 RG (#4277, Michael Mattice).
-1005. Modify XimGetCharCode() to use conversion from keysym to UCS and then
- from UCS to the appropriate charset specified in the locale description
- (#4276, Ivan Pascal).
-1004. Allow Unicode fonts to be used as UTF-8 locale native fonts (#4275,
- Ivan Pascal).
-1003. Fix abnt2/br XKB config (#4274, Paulo Cesar Pereira de Andrade).
-1002. Let the Darwin X server build on pure Darwin as well as Mac OS X systems
- (#4273, Torrey T. Lyons).
-1001. Patch to allow xdm to build on Darwin (#4273, Torrey T. Lyons).
-1000. Fix parser not dup'ing a string (#4272, Paulo Cesar Pereira de Andrade).
- 999. Improve direct fifo writes for the glint/permedia3 pixmapwrite hook
- when using FIFO disconnect (#4271, Sven Luther).
- 998. Fix a sprite problem with the "xwin" server (#4269, Suhaib M. Siddiqi).
- 997. Fix a confusing local typedef for "wchar_t' in xc/lib/X11/lcUTF8.c
- (#4268, Bruno Haible).
- 996. Allow ProjectVar to override "/var" when set (based on #4266,
- Bruno Haible).
- 995. Rework Trident Blade/CyberBlade acceleration (Alan Hourihane).
- 994. Make the CyberBlade/e4 (aka 9540) work (Alan Hourihane).
- 993. Updates to Big5 encodings for the TrueType font backends (#4265,
- Jacky Bryant).
- 992. Fixes for Thai (th_TH) locale support in Xlib (#4264,
- Theppitak Karoonboonyanan)
- 991. Fix a segv in Xnest caused by overflowing the pixmap formats array
- (based on #4262, Matthieu Herrb).
- 990. Fix an xdm problem that prevents the chooser from working (#4261,
- Matthieu Herrb).
- 989. Update the Cards file (#4260, Paulo Cesar Pereira de Andrade).
- 988. Update Macedonian xkb symbols, and add mk_MK.utf8 to locale.alias
- (#4258, 4259, Damjan Georgievski).
- 987. Safe tempfile handline for imake's probing of glibc version (based on
- #4257, Colin Phipps).
- 986. Fix typo in dvorak xkb symbols file, plus white space cleanup (#4256,
- Branden Robinson).
- 985. Fix typo in server startup message (#4255, Branden Robinson).
- 984. Make XOpenDisplay() bail out if the server claims that its vendor
- string is > 256 in length (#4254).
- 983. Add some useful default key bindings for the xdm login widget (#4252,
- Branden Robinson).
- 982. Change the default xdm Xaccess file to not allow any connections
- (#4252, Branden Robinson).
- 981. Set the default glyph caching mode to "CACHE_16_BIT_GLYPHS"
- (#4251, Branden Robinson).
- 980. Make the X server use the XAUTHORITY environment variable (if set)
- when the -authfile command line flag isn't given (#4250,
- Branden Robinson).
- 979. Add Debian-specific settings to linux.cf (#4249, Branden Robinson).
- 978. Rename Trident Cyber9540 to CyberBlade/e4 and make appropriate
- changes in driver (Alan Hourihane).
- 977. Fix Trident Cyber series to only detect SDRAM (Alan Hourihane).
- 976. Make xf86SoundKbdBell() available to modules (for citron driver)
- (Marc La France, #4270, Frederic Lepied).
- 975. Fix glide driver's check for glide library presence (Marc La France).
- 974. Add missing symbol references in r128 and s3virge drivers
- (Marc La France).
- 973. Fix int10 debugging and reading in all segments between 0x0C0000 and
- 0x0F0000 (Marc La France).
- 972. Fix typo in imake.c (Marc La France).
- 971. Turn off SGRAM optimization for Trident Blade chips, causes some
- problems. (Alan Hourihane).
- 970. Ignore various ".stab.*" sections for Solaris (Marc La France).
- 969. Fix ENXIO errors on Linux BIOS retrievals by removing restriction on
- several OSes that xf86ReadBIOS()'s Base be page-aligned (Marc La France).
- 968. Disable change 873. It causes device/monitor mismatches
- (Marc La France).
- 967. Change linux/int10 to intercept signals generated by the vm86() syscall
- rather than killing the server (Marc La France).
- 966. Reinstate DG/UX mmap() bug work-around in int10 (Marc La France).
- 965. Rage128 and Radeon fix for -configure (Marc La France).
- 964. Fix int10 woes with retrieving PCI BIOSes (Marc La France).
- 963. Allow modules to intercept signals that would otherwise kill the server
- (Marc La France).
- 962. Fix static Xvfb server build (Marc La France).
- 961. Some warning fixes (Marc La France).
- 960. Rage128 and Radeon #include changes to reduce recompilations
- (Marc La France).
- 959. Modify item no. 949 - only reset clipping for Cyber9382, Cyber9385 and
- ProVidia9682 (Alan Hourihane).
- 958. Added messages about modes rejected on lookup (Egbert Eich).
- 957. Attempt to fix DDC1 support on Neomagic (Egbert Eich).
- 956. Added Block/UnblockSIGIO() to DDC1 readout code (Egbert Eich).
- 955. Enabled virtual depth for a second head on a G400 multihead
- (this needs to be looked at) (Egbert Eich).
- 954. Added code to check if the PictureScreen structure was initialized
- before referencing it (Egbert Eich).
- 953. Modified xf86UDelay() to use Block/UnblockSIGIO and usleep()
- instead of gettimeofday() (Egbert Eich).
- 952. Modified xf86MatchPciInstances() to allow for chipset overrides
- even when called with no separate vendorID (Egbert Eich).
- 951. Changed Xvfb to use fb instead of cfb (Egbert Eich).
- 950. Moved a misplaced xfree() in the generic driver. Now more than
- one chipset can use this driver in a multihead setup (Egbert Eich).
- 949. Did some fixes for the Trident driver ie. fixed a LCD modeline,
- reset clipping register on all non 3D chips (Egbert Eich).
- 948. Added missing parts for AXP support to lnx_video.c (Egbert Eich).
- 947. Added bsr/bsf to x86emu (Jeff Wiedemeier).
-
-XFree86 4.0.1f (16 November 2000)
- 946. Add a dumpkeymap utility for Darwin (#4248, Eric Sunshine).
- 945. Fix a Darwin build problem with mkcfm, and get xdm closer to building
- (#4247, Torrey T. Lyons).
- 944. DDX for the Xdarwin server (#4246, Torrey T. Lyons).
- 943. Enable xdm/PAM support by default for FreeBSD versions with PAM.
- 942. Fix a problem where the X server thinks it has acquired a VT at startup
- before it has really been released. This is due to the ioctl()
- returning prematurely because of a pending signal (Jeff Hartmann).
- 941. Fix a problem with the PAM support in xdm that prevents
- pam_start_session() from ever being called (Takanori Saneto).
- 940. Enable PAM support for xdm on FreeBSD (#A.202, Jean-Marc Zucconi, and
- Takanori Saneto).
- 939. Fix xf86cfg build problem when BuildXinerama is set to NO (#A.200,
- Jean-Marc Zucconi).
- 938. gccmakedep has a typo which affects handling the -o and -O options
- (A.192, Ivan Zakharyaschev).
- 937. Specify the units for the dpms and rate commands in the xset man
- page (#A.191, John Heidemann).
- 936. Let makedepend ignore "//" style comments on all platforms, not
- just Win32, and fix a bug in that code that was causing the line
- after such comments to also be ignored (#A.189, Guenther Grau).
- 935. Update GNU/Hurd support (#A.188, Marcus Brinkmann).
- 934. Initial port of the ark driver to 4.x (#4242, Ani Joshi).
- 933. Wacom input driver update, including support for 38400 link speed
- and fix wrong advertisement of min/max values (#4241, Frederic Lepied).
- 932. Fix some parser problems, including:
- - parser does not write Modes section and UseModes keyword
- - the vscan value wasn't being used
- - make the XF86ConfModesPtr structure accessible from the
- XF86ConfMonitorPtr structure
- - allow xf86Parser.h to be included from in a C++ program
- (#4238, 4243-4245, Paulo Cesar Pereira de Andrade).
- 931. Fix the name of the Serbian xkb symbols file (rename from yu to sr)
- (#4237, Ivan Pascal).
- 930. Fix mkcfm bug (#4236, Juliusz Chroboczek).
- 929. Glint/permedia3 updates (#4235, 4238, Sven Luther).
- 928. Fix an SVR4 loader build problem introduced in 4.0.1d (#4234,
- Takaaki Nomura).
- 927. Fix a bug in fontenc that would cause a memory leak whenever an
- encoding would be declared in encodings.dir but not in the encoding
- file itself (#4233, Juliusz Chroboczek).
- 926. Make the freetype backend use the fontenc matrix encoding support,
- remove support for the defunct XAnti extension, and bump the version
- of the freetype backend to 1.1.8 (#4233, Juliusz Chroboczek).
- 925. Add proper support for matrix encodings in fontenc (including the
- new FIRSTINDEX keyword in encoding files), and bump the version of
- the font module ABI to 0.2 (#4233, Juliusz Chroboczek).
- 924. Fix a problem the vesa driver (#4232, Paulo Cesar Pereira de Andrade).
- 923. Fix problems building the C&T driver with DEBUG defined (#4231,
- Taketoshi Sano).
- 922. Remove lt_LT.ISO8859-1 entry from compose.dir (#4230, Nerijus Baliunas).
- 921. s3virge driver updates, including:
- - Stabilize GX2 support, reenable silken mouse
- - Enable MX fixes
- - Add support for the render extension
- - Enable BLT_BUG for ViRGE and VX chipsets
- (#4229, Kevin Brosius).
- 920. Don't initialize DRI when noaccel is specified in the tdfx driver
- (Alan Hourihane).
- 919. Make module ABI compatibility mismatches fatal by default, and
- add a command line option for making them non-fatal (David Dawes).
- 918. Changed SiS driver to use fb instead of cfb (Alan Hourihane).
- 917. Fix r128 and radeon driver source code formatting that was munged
- during ATI merge (Kevin Martin).
- 916. Update Markus Kuhn's UCS fonts, and add his scripts for extracting
- subsets of them to the build process (David Dawes).
- 915. Fix visual setting in ATI r128/radeon driver (Jeff Wiedemeier).
- 914. Alpha fix for xf86cfg (Alan Hourihane).
- 913. Resync DRI code/drivers with the DRI CVS (VA Linux).
- 912. Fix tdfx driver to register resources and remove some redundant code
- (Alan Hourihane).
-
-XFree86 4.0.1e (6 November 2000)
- 911. Fix the ksc5601.1987-0 encoding file (#4226, 4228, Pablo Saratxaga).
- 910. Update xdm/sessreg to write ":0" type entried in utmp on OpenBSD
- (#4225, Matthieu Herrb).
- 909. Fix for Xmu under NetBSD, which doesn't #define "unix" anymore (#4225,
- Matthieu Herrb).
- 908. Preliminary support for OpenBSD/powerpc (#4225, Tsubai Masanari,
- Matthieu Herrb).
- 907. Support for native WSCONS driver on NetBSD and OpenBSD (#4225,
- Tsubai Masanari).
- 906. Support for new OpenBSD 2.8 shared libs scheme (#4225, Matthieu Herrb).
- 905. Support for the OpenBSD ports tree (#4225, Marc Espie).
- 904. Update the list of layouts in the xfree86.lst file (#4224, Ivan Pascal).
- 903. Add an XKB map for Serbian (#4224, Milos Rancic).
- 903. New revision of the Bulgarian XKB map (#4224, Anton Zinoviev).
- 902. Change the Alt key definitions in the "group switcher" descriptions
- to not override the base Alt key mappings (#4223, Ivan Pascal).
- 901. Change XKB Mode_switch behavior description to not clear "locked
- group" (#4223, Ivan Pascal).
- 900. Create a root window property "XFree86_DDC_EDID2_RAWDATA" when
- suitable data is available (#4222, Andrew C. Aitchison).
- 899. Fix some typos/errors in the Latvian and Lithuanian entries in
- the locale.alias and locale.dir files (#4221, Nerijus Baliunas).
- 898. Fix two more bugs in xkbcomp: handling of 'keycode aliases', and
- copying of strings when copying structures (#4208, Ivan Pascal).
- 897. Added render extension support to tseng driver (Egbert Eich).
- 896. Fixed clock code in neomagic driver (Egbert Eich).
- 899. xf86Configure now uses the imake variable xf86ConfigFile (Egbert Eich).
- 898. xf86cfg has a new option for a server path (Egbert Eich).
- 897. xf86cfg can now handle more than one command line argument (Egbert Eich).
- 895. Added a delay to dac code in neomagic driver (Egbert Eich).
- 894. Changed shadowfb to use delayed updates in neomagic
- driver (Egbert Eich).
- 893. Rewrote ddc code in nv driver (Egbert Eich).
- 892. Rewrote ddc code in neomagic driver (Egbert Eich).
- 891. Fixed problems with enter/leave/closeScreen in nv
- driver (Egbert Eich).
- 890. Fixed a bug in the fixed modelines in trident driver (Egbert Eich).
- 889. Added reinitialization of blitter on enterVT in trident
- driver (Egbert Eich).
- 888. Fixed a typo which caused wrong register to be set in trident
- driver (Egbert Eich).
- 887. Added loader symbol handling to tseng driver (Egbert Eich).
- 886. Changed tseng driver to use fb instead of cfb (Egbert Eich).
- 885. Changed chips driver to use fb instead of cfb (Egbert Eich).
- 884. Added render extension support to chips driver (Egbert Eich).
- 883. Added render extension support to neomagic driver (Egbert Eich).
- 882. Added render extension support to nv driver (Egbert Eich).
- 881. Modified helper_mem.c to map everything between video bios and
- system bios on PC-like platforms (Egbert Eich).
- 880. Modified Linux mapVidMem() to map memory on page boundaries
- (Egbert Eich).
- 879. Changed BIOS_SIZE (Sys BIOS) from 0x10000 to 0xffff to make
- int10 work un DGUX (Takis Psarogiannakopoulos).
- 878. Fixed a bug in the argument list of the call to xf86ReadPciBIOS()
- from int10/pci.c (Egbert Eich).
- 877. Added simple sanity check to catch situation where DDC reads
- all 0 and therefore trivially has the correct checksum (Egbert Eich).
- 876. Changed i2c code to allow for longer rise/fall times on longer
- cables (Egbert Eich).
- 875. Removed limit on default visual for 4bpp (Egbert Eich).
- 874. Added macros to build nv driver on AXP (Jay Estabrook).
- 873. Changed -configure to use primary card as first card (Egbert Eich).
- 872. Changed generic vga driver to not unmap memory when switched away.
- 871. Fixed problem that caused APM support to be disabled on server
- reset (Egbert Eich).
- 870. Added support for newer sparse AXP systems (Egbert Eich).
- 869. Added support for MGA G100 PCI (Egbert Eich).
- 868. Add missing exported libXext Shm functions to loader (Alan Hourihane).
- 867. Change Rage 128 DRM driver name to what the r128 kernel module
- expects (Kevin Martin).
- 866. Fix newly merged "ati" driver probe to allow "r128" and "radeon"
- driver names in the XF86Config file for backwards compatibility
- (Kevin Martin).
- 865. Use vgaHW module to fix font save/restore in i128 driver (Robin Cutshaw).
- 864. Fixed (hopefully) a Xinerama problem with BE clients (Mark Vojkovich).
- 863. Modifications to GLw to allow it to build without Motif, and
- integrate it into the regular build process (#4142,
- Carlos A. M. dos Santos, David Dawes).
- 862. Import the GLw parts of SGI's ogl-sample (snapshot from 20001102)
- under xc/extras/ogl-sample.
- 861. Add support for SubSection in the Vendor Section of the config file
- (Stuart Anderson)
- 860. Fix a typo introduced in a recent update to the 'no' xkb symbols
- file (#4218, Pablo Saratxaga, 4219, Harald Nordgård-Hansen).
- 859. Parser symbol update (#4217, Paulo Cesar Pereira de Andrade).
- 858. Updates to iso8859-9e, microsoft_cp1251 charset handling, and
- add real support for microsoft_cp1255 and microsoft_cp1256 (#4214, 4215,
- Pablo Saratxaga).
- 857. Fix Sparc build problems linking xf86cfb with libloader that were
- related to various interdependencies (#4212, David S. Miller).
- 856. Allow generic XVideo adaptors (like v4l) to be initialised for
- the G400 crtc2 (#4211, Antti Tapaninen).
- 855. Update mga driver to check the chipset much earlier to prevent
- server hang when using g400 dual head + millennium 2, and some
- G200 PCI/warp cleanups (#4211, Antti Tapaninen).
- 854. Updates to the Macedonian xkb symbols (#4210, 4220, Damjan Georgievski).
- 853. Combine the ATI, Rage128 and Radeon drivers into one with multiple
- sub-modules (Marc La France).
- 852. Make BIOS accesses in the Rage128 and Radeon drivers independent of
- endianess and alignment (Marc La France).
- 851. Fix the claiming of XF86Config device sections by drivers, and change
- xf86MatchDevices() to only return unclaimed sections (Marc La France).
- 850. Fixed build problem in s3virge when XvExtension is not set (Stuart
- Anderson)
- 849. Add a message at the top of the server/log output for pre-release
- versions stating that they are unsupported (David Dawes).
- 848. Fix two problems in Imake.rules: have LinkBuildBinary create the
- used directory if it doesn't exist, and fix a missing ')' in
- the LinkConfFileLong (#A.187, Ivan Zakharyaschev).
- 847. Fix a libXt bug that affects multidisplay applications when Xt is
- built to use select(2) rather than poll(2) (#A.181, Antony Uspensky).
- 846. Add a -utime option to xclock that allows the digital clock to
- display the number of seconds since the Epoch (based on A.173,
- Kelsey Hudson).
- 845. Add symbols mappings for extra keys on the BTC 9000 keyboard (#A.167,
- Stefano Cavallari).
- 844. Fix twm's icon manager so that it is functional before an EnterNotify
- event is received in twm's event loop (#A.156, Jason Zwolak).
- 843. Update comments about standards for Estonian support, and add an
- entry for the Estonian keyboard layout to the xfree86.lst file
- (#A.155).
- 842. Fix for G400 crtc2 blank screen color (#4205, Antti Tapaninen).
- 841. Modify the mga/HALlib support to allow it to be selected at
- run-time. This allows a driver built with HALlib to be used with
- older hardware (like the Millennium, Millennium 2) (#4204,
- Antii Tapaninen).
- 840. Add config/imake support for Darwin (#4200, Torrey T. Lyons).
- 839. Add a driver for the citron touch screen (#4199, Peter Kunzmann).
- 838. Fix Html man page install problem (Robin Cutshaw).
- 837. Fix transparency problem with blits, add DDC2 for i128-II chipset
- in i128 driver (Robin Cutshaw).
- 836. Allow loader to be build if HasShm == NO (Marcus Brinkmann).
- 835. Allow the log file to be set in the config files (Stuart Anderson).
- 834. Fix Rage128/Radeon drivers to free correct scratch buffer on LeaveVT
- (Alan Hourihane).
- 833. Xterm patch #148 (#4213, Thomas Dickey).
- 832. Split ATI driver into two modules in preparation for merging in the
- r128 and radeon drivers (Marc La France).
- 831. Update the XFree86 -configure code to put the default font path
- in the Files section of the config file it generates (#4202,
- Paulo Cesar Pereira de Andrade).
- 830. Add write-combine support for IA-64 (Mark Vojkovich).
-
-XFree86 4.0.1d (27 October 2000)
- 829. Add code to the xf86config utility to get the list of XKB selections
- from the appropriate XKB files rather than having them hard-coded.
- Also allow XkbOptions to be set (#4209, Ivan Pascal).
- 828. -
- 827. Xterm patch #147 (#4207, Thomas Dickey).
- 826. Move the initialisation of pScrn->EnableDisableFBAccess into
- InitOutput(), which fixes an infinite loop problem that can show up
- on server resets (#4206, Joe Moss).
- 825. Make xf86cfg use the same config file search path as the X server
- (#4203, Paulo Cesar Pereira de Andrade).
- 824. -
- 823. Fix a bug in the vesa driver when finding the linear address for the
- card, some compile time warnings, faster code for handling colormap
- changes, and add DGA support (#4201, Paulo Cesar Pereira de Andrade).
- 822. Fix a typo in the mga driver that causes planemask problems with
- the PCI version of the G100 (#4198, Antti Tapaninen).
- 821. Add an option to the C&T driver to disable "TMED" (DSTN dithering
- scheme) (#A.172, Damir Anicic, #4196, 4197, David Bateman).
- 820. Pablo Saratxaga's i18n updates for XFree86 that are used in Mandrake 7.2.
- Includes various new and fixed xkb files, locale name additions and
- updates, and new support for various charset encodings (#4195,
- Pablo Saratxaga).
- 819. Improve Xaw 7 compatibility with version 6 in the form widget geometry
- management code. This should fix some problems seen with ghostview
- (#4194, Paulo Cesar Pereira de Andrade).
- 818. Build fixes for XFree86 on Cygwin (#4193, Suhaib Siddiqi).
- 817. Fix for missing symbol messages in int10 and cirrus driver
- (Marc La France).
- 816. Detect null windows of PCI-to-PCI bridges (Marc La France).
- 815. Update pciConfigRec's and pciVideoRec's when relocating PCI resources
- (Marc La France).
- 814. Fix handling of 64-bit PCI bases (Marc La France).
- 813. Fix cursor hide on i128 in multi-head mode (Robin Cutshaw).
- 812. Fix accel on i128 non-primary cards (Robin Cutshaw).
- 811. locale.alias fix for ko_KR.utf8 (#4190, Won-kyu Park).
- 810. Fix incorrect vtSema usage in neomagic driver DPMS code (#4184,
- Andrew C Aitchison).
- 809. Fix a 1-byte overflow in Xtrans.c (#4182, Aaron Campbell).
- 808. Enable building the loadable server for BSD/OS.
- 807. Fix the following xkbcomp bugs:
- - 'base group' keyword added to 'whichGroup' possible values list
- - 'groupsWrap' keyword removed from 'controls' possible values list
- - fix crash in processing files with unnamed sections
- - now keep 'per key group adjustment mode' in XKM file
- - now allow an empty 'key' description to be specified in an
- xkb_symbols file.
- (#4170, Ivan Pascal).
- 806. Add a "bcast" flag for mode lines, which is needed to display
- broadcast resolutions (#4169, Michel Danzer).
- 805. Fix compiler warnings when building the mga driver with or without
- the Matrox HALlib, add the digital/tv-out/tvstandard/cabletype
- options, missing files, and some cleanups (#4166, Antti Tapaninen).
- 804. Fix spelling from xvinfo (#4166, Antti Tapaninen).
- 803. Add support to twm for displaying multibyte strings on window titles,
- and make the twm config file reader 8-bit clean (#4165, 4168, 4180,
- Tomohiro Kubota).
- 802. Fix a tseng driver problem related to the usable amount of video memory
- (#4164, A.182, Randy McCaskill).
- 801. Add support for the new Render extension to the nv driver, and
- turn on fb support by default in the nv driver (#4161, Jarno Paananen).
- 800. Fix a typo that prevents DPS from being built statically (#4160,
- Juliusz Chroboczek).
- 799. Fix some xkbfile bugs in the .xkb files that it writes
- (two adjacent commas, no xkb_types section in xkb_layout) (#4159,
- Ivan Pascal).
- 798. Fix an xkbcomp bug that causes an infinite loop for some error
- message output (#4158, Ivan Pascal).
- 797. Fix XlcNONE usage in charset description (#4153, Ivan Pascal).
- 796. Fix a bug in XKB group adjustment (#4152, Ivan Pascal).
- 795. Fix some build problems that show up with the SVR4 C compiler
- (based on #4139, Takaaki Nomura).
- 794. Add two new XKB group switches (Alt+Shift and Menu key) (#4151,
- Ivan Pascal).
- 793. Fix HTML man page links when the man page suffix has more than one
- character (#4150, Bruno Haible, A.149, Serguei Ostrovskii).
- 792. Remove the old UTF-1 locale (it's not filesystems safe, deprecated
- for years, withdrawn from ISO standards, and nobody uses it) (#4147,
- 4149, Bruno Haible).
- 791. Replace multiple stub functions in libXThrStub by only one (#4141,
- Carlos A. M. dos Santos).
- 790. Fix some build problems that show up with glibc 2.1.3 where ctype.h
- sometimes (always?) depends on stdlib.h being included (#4134,
- Kevin Brosius).
- 789. Updates for building on BSD/OS 4.2 on UltraSparc (#4132, Kurt J. Lidl).
- 788. Default to linking the Xfont library into the X server statically
- (based on #4127, Kurt J. Lidl).
- 787. Update apNetBSD.shar for a kernel mmap interface change (#4124,
- Bernd Ernesti).
- 786. When the "auto" mouse protocol is specified, do the auto-detection
- whenever regaining control of the VT (based on #4120, Kazutaka Yokota).
- 785. Change the usage of the "Xinerama" config file option to be consistent
- with all the other ServerLayout/ServerFlags options, and document it
- in the XF86Config man page (#4118, Itai Nahshon).
- 784. Add I2C/DDC support to i128 driver (Robin Cutshaw).
- 783. Add non-GXcopy raster op support to cirrus driver (#4178, David Monniaux).
- 782. Use DlLibrary instead of referencing -ldl explicitly in xf86cfg
- (#4189, Matthieu Herrb).
- 781. Add S3 Virge XVideo support (preliminary) (#4186, Kevin Brosius).
- 780. Fix non-DRI build problem in r128 driver (#4188, Matthieu Herrb).
- 779. Add XLIB for OpenBSD/i386 dependency problem to xvinfo
- (#4187, Matthieu Herrb).
- 778. Update C&T driver, remove obsolete acceleration and use fb instead
- of cfb with USE_FB option (#4185, David Bateman).
- 777. Experimental XAA Render support in the MGA driver (Mark Vojkovich).
- 776. Preliminary XAA support for the Render extension (Mark Vojkovich).
- 775. Pass depth/bpp correctly, scan all fbdev devices, misc fbdev fixes.
- (#4179, Michel Danzer).
- 774. Add generic Vesa driver, fixes for xf86cfg plus changes to parser to
- reflect xf86cfg changes (#4174,#4175, Paulo Cesar Pereira de Andrade).
- 773. Loader fixes for Alpha. (Jay Estabrook).
- 772. Accelerated TGA2 32bpp for tga driver (Jay Estabrook).
- 771. Allow use of Compaq's Math Library on Alpha (currently for Mesa)
- (Alan Hourihane).
- 770. Update Tiny-X Xvesa server for standard VGA BIOS modes. (Keith Packard)
- 769. Added ATI Radeon driver, accelerated 2D only (for now) (VA Linux).
- 768. Fix depth24/32 issue in i128 driver (#4176, Andrew C Aitchison).
- 767. On IA-64's, build DRI and drm's if they would be built on IA-32's
- (David Mosberger).
- 766. Fix xf8_32wid build on Sparc's (Marc La France).
- 765. Fix MMIO macros for Sparc's (David S. Miller, Jakub Jelinek,
- Marc La France).
- 764. Sparc warning fixes (Marc La France).
- 763. Fix for decoded I/O and memory ranges of certain Sun PCI-to-PCI bridges
- (David S. Miller, Jakub Jelinek).
- 762. Force ATIAvoidCPIO to YES on Sparc's (Marc La France).
- 761. Minor fix for the ATI driver's printing of MMIO registers
- (Marc La France).
- 760. Minor fix for sunffb DGA support (Marc La France).
- 759. Remove unnecessary pointer<->long casts in tseng driver (Marc La France).
- 758. Re-align Sparc PCI support with that of other architectures
- (Marc La France).
- 757. mmap() /dev/fb instead of /dev/mem on Linux/Sparc (Marc La France).
- 756. Fix OS-reported PCI ranges on Linux/Sparc (David S. Miller,
- Jakub Jelinek).
- 755. Remove a dependency on word size in the determination of PCI resource
- sizes on Linux (Marc La France).
- 754. Permedia3 updates (#4177, 4183, 4192, Sven Luther).
- 753. Add Xv support to the r128 driver (Stuart Anderson/Vladmir Dergacheb)
- 752. Make VBE module log a message when the BIOS doesn't support any VESA
- extensions (Marc La France).
- 751. Fix int10 so that it rejects BIOS's that are not aligned on a 512-byte
- boundary (Marc La France).
- 750. Fix int10 for ISA adapters on Alpha's (Egbert Eich).
- 749. Fix for ATI ISA adapters on Alpha's or with -configure (Marc La France).
- 748. Fix stupid clock probe bug in ATI driver (Marc La France).
- 747. Reorganise ATI driver in preparation for futuure changes
- (Marc La France).
- 746. Formatting changes to hsync/vrefresh messages (Marc La France).
- 745. Fix spurious free() when using an ISA adapter (Marc La France).
- 744. Preliminary acceleration of the Render extension for Matrox G200/G400
- (Mark Vojkovich).
- 743. Fix ordering of drawable destruction in client-side DRI (Brian Paul).
- 742. Update Trident's text acceleration routines (Alan Hourihane).
- 741. Destroy unbound window info when a client destroys a context in
- the client-side DRI driver (Kevin Martin).
- 740. Make ATI driver's detection of Rage 128's more precise (Marc La France).
- 739. Reinstate BIOS checksum verification but make it non-fatal
- (Marc La France).
- 738. Don't set protection register on older trident chips
- Fixes Vertical line problem. (Alan Hourihane).
- 737. Add missing symbols for Solaris (incomplete) (Marc La France).
- 736. Add primitive support in xterm for Xft based fonts (Keith Packard)
- 735. Add new Xft library to hook FreeType 2 to Render (Keith Packard)
- 734. Added support for Number Nine I128 chipsets (Robin Cutshaw).
- 733. Added support for softbooting BIOSes on ia64 (Egbert Eich).
- 732. Fixed handling of XtMakeGeometryRequest() to test for parent
- belonging to subclass of composite class only if the widget
- itself is managed. This follows the specs more closely.
- (Keith Packard).
- 731. Changed handling of DDC read in r128 driver. Driver does not
- fail any more if vbe DDC reads don't succeed (Egbert Eich).
- 730. Fixed infinite loop when referencing the same mnitor section
- twice when using a Mode Section (Egbert Eich).
- 729. Fixed problem that caused SIGV in xf86GetValidBiosBase() (Egbert Eich).
- 728. Fixed macintosh us keyboard (Olaf Hering).
- 727. Added missing symbols to mga driver (Stefan Dirsch).
- 726. Fixed a ia64 loader problem that caused SIGV when PLT was present
- (Andreas Schwab).
- 725. Fixed ia64 build rules (Andreas Schwab).
- 724. Fix DGA library to only swap events for DGA 2.0 X servers
- 723. Fix locale parsing code in Xlib and Xt (Matthieu Herrb)
- 722. Fix X Test Suite to work on 800x600 screens (Keith Packard)
- 721. PCI chip ID updates to ATI driver (Marc La France).
- 720. Fix i810 driver for -probe and -configure (Marc La France).
- 719. Change message when default modes are deleted (Marc La France).
- 718. Fix Xinerama byte swapping bug (Marc La France).
- 717. IA-64 and Alpha fixes for pswrap, Mesa, DRI, Xpm, libX11, Xt, Xaw, Xmu,
- dps, Type1 fonts, cfb24, most output drivers, ELF loader, ramdac module,
- xf4bpp and xf86cfg (Marc La France).
- 716. Improve IA-64 support by removing a plethora of 32-bit'isms
- (Marc La France).
- 715. Default HasLinuxDoc to NO (Marc La France).
- 714. Lots of Neomagic driver fixes/enhancements (Mark Vojkovich).
- - Fix logic bug that kept HW cursor from being used.
- - Added support for gamma correction and DirectColor visuals.
- - Fixed some depth/bpp confusion (depth 15 works now).
- - Convert from cfb to fb.
- - Fix typo that kept the pixmap cache from being used.
- - Fixed DGA support.
- - Disable 8x8 pattern fills because they don't work.
- - Set correct virtual desktop size limits for 2160 and older chips.
- - Preliminary man page.
- - Enable burst modes by default.
- - Accelerate ImageWrite support for 2097/2160.
- 713. Fix some depth 32 problems in XAA (Mark Vojkovich).
- 712. Add Silken Mouse to Rage 128 driver (Alan Hourihane).
- 711. Resync DRI code/drivers with the DRI CVS (VA Linux).
- 710. Add glxinfo to programs list (#4138, Mark Paton).
- 709. Add LVDS support for SiS and fix copyright messages (#4136, Can-Ru Yeou).
- 708. Fix support for C&T 69030 (#4137, David Bateman).
- 707. Support Cirrus Logic 7548 chip (#4146, David Monniaux).
- 706. Fix typos in Xt man pages (#4156, Carlos Santos).
- 705. Fix libdps bug (#4154, Juliusz Chroboczek).
- 704. Xterm patch #146 (#4144, Thomas Dickey).
- 703. Xterm patch #145 (#4140, Thomas Dickey).
- 702. Fix 32bpp on the Permedia3 (Sven Luther).
- 701. Fix to xterm InsertChar() to handle cases where cur_col + n
- ends up past the end of the line (Andreas Schwab).
- 700. Added keyboard layouts for PowerMac (Olaf Hering).
- 609. Fixed Macintosh keyboard layouts (Olaf Hering).
- 608. Fixed build when BuildServer defined NO (Egbert Eich).
- 607. Fixes for C&T 69030 (David Bateman).
- 606. Fix for locale setting in Xlib and Xt using getlocale()
- from glibc5 (Egbert Eich).
- 605. Added handling of i5/686 and k6 compiler defines to Imake.cf
- (Philipp Thomas).
- 604. Added support for non-English locales in xload (Egbert Eich).
- 603. Fixed memory initialization in Xlib (Vladimir Nadvornik).
- 602. Fixed memory initialization in xdm (Egbert Eich).
- 601. Rudimentary S390 support (Ruediger Oertel, Bernhard Kaindl).
- 600. Enabled support for compressed xpm-files (Stefan Dirsch).
- 599. Added support for Czech querty keyboard (Jan Holesovsky).
- Some fixes for ia64 ().
- 598. Added CPU to Screen Color expansion to Neomagic driver (Egbert Eich).
- 597. Added support for hotkey display output switch for Neomagic
- driver (Egbert Eich).
- 596. Add "xvinfo" client for querying Xv adaptors (Mark Vojkovich).
- 595. Fix DGA support in the i810 driver (Mark Vojkovich).
- 594. Enlarge the i810 pixmap cache and have the YUV overlay use that memory
- rather than allocate dedicated memory for overlay data (Mark Vojkovich).
- 593. Add/fix support for the Rage 128 Mobility chips (M3/M4) (Kevin Martin).
- 592. Fix RegisterResources for multiple heads in glint driver
- (#4143, Berend Ozceri).
- 591. Update Permedia3's hw cursor to match the Permedia2v's they are
- the same (Alan Hourihane).
- 590. Fix glint driver to use colorKey rather than fixed value (Alan Hourihane).
- 589. Add ScreenToScreenCopies for Permedia3 (Alan Hourihane).
- 588. Add SilkenMouse support to the i810 driver (Mark Vojkovich).
- 587. Disable DRI acceleration in depth 15 on the i810 because it doesn't
- work (Mark Vojkovich).
- 586. Fix some ordering problems in the I810ScreenInit that broke the
- software cursor and backing store (Mark Vojkovich).
- 585. Convert the i810 driver from cfb to fb (Mark Vojkovich).
- 584. Fix some depth/bpp confusion in the i810 driver. Depth 15 works now
- (Mark Vojkovich).
- 583. Turn off visual ID matching in Xv (Mark Vojkovich).
- 582. Add the IA-64 ELF loader (Jakub Jelinek).
- 581. Add I420 and UYVY image formats to the i810 driver (#4135, Jonathan Bian).
- 580. Fix an Xaw problem with illegal aliases (#4133, Jakub Jelinek).
- 579. Set $(SHELL) to '/bin/sh -e' on Linux to allow builds/installs stop
- immediately on errors as on other platforms (Brandon Robinson).
- 578. Update i810 driver for -configure to work (Alan Hourihane).
- 577. Have Xv silently ignore client requests with zero sized primitives
- (Mark Vojkovich).
- 576. Disable gamma correction and DirectColor visuals on the i810 because
- they don't work (Mark Vojkovich).
- 575. Fix a bug in XAA's MSBFIRST color expansion support (Mark Vojkovich).
- 574. Allow the default i810 video overlay key to be changed from the
- XF86Config file (Mark Vojkovich).
- 573. Don't build DRM modules with a non-module Linux kernel (Marc La France).
- 572. Reinstate non-MMIO-only version of ATI driver for Alpha architecture
- (Marc La France).
- 571. Fix input event queueuing for 64-bit platforms (Marc La France).
- 570. IA-64 changes resulting from a source cross-check with Alpha support
- for 64-bit dependencies (Marc La France).
- 569. Fix in ATI drivber for DPMS support on panels (Marc La France).
- 568. I810 bugs fixes and enhancements relating to Xv (#4121, 4117, 4123,
- 4128, Jonathan Bian).
-
-XFree86 4.0.1c (28 August 2000)
- 567. Add support to xset for setting the keyboard repeat rate using XKB
- (A.119, A.126, Stephen Montgomery-Smith).
- 566. Various DRI-related 64-bit/IA-64 fixes (#A.134, David Mosberger).
- 565. Support for multithreaded libraries on NetBSD when used in conjunction
- with the GNU pth library (#4113, Chris Sekiya).
- 564. Add /usr/pkg/bin to NetBSD's DefaultUserPath (#4112, Bernd Ernesti).
- 563. Add a (Linux-specific) VESA driver for Keith's small X server (#4111,
- Juliusz Chroboczek).
- 562. Update Hungarian xkb maps (#A.145, Peter Soos).
- 561. Fix ATI driver bug that prevented the disabling of int10, ddc and vbe
- through options (Marc La France).
- 560. Improve libX11 behaviour when a server doesn't have XKB, allowing
- XKB-aware XLookupString features with servers without XKB (#4108,
- Ivan Pascal).
- 559. Fix a bug in xkbcomp'shandling of 'group compat' data (#4107,
- Ivan Pascal).
- 558. Fix an i810 driver problem doing XvImage with clipping (#4106, 4110,
- Jonathan Bian).
- 557. Add PCI info for devices found on the G4 Mac (#4105, Matthieu Herrb).
- 556. New XkbOptions for LED selection (#4101, Ivan Pascal).
- 555. Changes to XkbGetControls regarding ax_options (#4100, Ivan Pascal,
- based on A.125, Stephen Montgomery-Smith).
- 554. Changes to XkbSetControls regarding per_key_repeat (#4099, Ivan Pascal,
- based on A.124, Stephen Montgomery-Smith).
- 553. Fix MouseKeys acceleration (#4098, Ivan Pascal, based on A.112,
- Stephen Montgomery-Smith).
- 552. -
- 551. Man page for Xmark (#4097, Richard Braakman).
- 550. Fixes for Macintosh XKB data files (#4094, Ani Joshi).
- 549. Change VarDbDirectory to /var/lib on Linux to comply with FHS 2.1
- (#4093, Branden Robinson).
- 548. Include <sys/types.h> in agpgart.h (#4091, Branden Robinson).
- 547. Re-add installation of the micro font (#4090, Branden Robinson).
- 546. Fix the rstart/server script generation (#4088, 4089, Branden Robinson).
- 545. Allow mkhtmlindex.sh to work when the shell's -e flag is used (#4087,
- Branden Robinson).
- 544. Xterm patch #144 (#4109, Thomas Dickey).
- 543. Xterm patch #143 (#4104, Thomas Dickey).
- 542. Xterm patch #142 (#4102, Thomas Dickey).
- 541. Xterm patch #141 (#4085, Thomas Dickey).
- 540. Xterm patch #140 (Thomas Dickey).
- 539. Xaw bug fix (#4084, Paulo Cesar Pereira de Andrade).
- 538. Add support for the NeoMagic NM2230 MagicMedia 256AV+ to the neomagic
- driver (#4083, Andrew C Aitchison).
- 537. Fix generic Xom to select the same font for measuring text escapement
- as is used for drawing (#4082, Owen Taylor).
- 536. Resync DRI code/drivers with the DRI CVS (VA Linux).
- 535. Engine polling changes in r128 driver (David Mosberger).
- 534. Fix linear memory mapping in ATI driver (Marc La France).
- 533. Fix endianness problems in the ATI driver when accessing BIOS images
- (Marc La France).
- 532. Allow building Xptr, Xnest and Xvfb with MakeDllModules
- (Bill Nottingham).
- 531. Build DRI drivers on IA-64 (David Mosberger, Marc La France).
- 530. Use $(CC) instead of $(LD) when building modules (Bill Nottingham).
- 529. When building with MakeDllModules, generate both dynamic and static
- libraries (Bill Nottingham, Marc La France).
- 528. Fix detection problem with ramdac for Glint Permedia1's
- (Alan Hourihane).
- 527. Fix minor symbol resoltion problem in dlopen() loader (Marc La France).
- 526. Alpha changes that fell out of RadHat's IA-64 changes (Marc La France).
- 525. A merge of most of RedHat's IA-64 changes (Keith Fish, Stephane Eranian,
- Bill Nottingham, Marc La France):
- - Don't force static server build.
- - Fix NULL #define'ition for loader server.
- - Various #if-testing changes.
- 524. Fix the few problems that showed up with the integration of the cygwin
- support (Suhaib M. Siddiqi).
- 523. ATI driver changes (Marc La France):
- - Make ATIProbe() and ATIPreInit() optionally more verbose.
- - Fix compile problem on Alpha's.
- - Fix Mach64 hardware clipping bug.
- - Support transparency during Mach64 screen-to-screen copies.
- - Disable int10 interface in MMIO-only driver version.
- - Fix determination of MMIO base address for Mach64 GX, CX, CT, ET,
- VT and GT.
- - "Wake" up ATI VGA's before probing for them.
- - Other cosmetic changes.
- 522. Workaround for problems with static during palette changes on the
- MGA G400 (Mark Vojkovich).
- 521. Share common drm files between Linux and FreeBSD. This fixes
- DRI-related build problems on FreeBSD (David Dawes).
- 520. Add Romanian xkb symbols definitions (Cristian Gafton).
- 519. First cut at pushing the AGP GART interface into the os-support
- layer, with support for Linux and FreeBSD (David Dawes).
- 518. Fix SHM support in Xv that was broken in 4.0.1b (David Dawes)
- 517. Change the Solaris8/x86 keyboard handling to map the raw keycodes to
- the same keycodes that we use on other platforms, and remove the
- Solaris8/x86-specific XKB definitions (David Dawes).
- 516. Fix a problem in the fbdev driver where xf86DrvMsg() is called before
- the necessary pScrn fields have been initialised (Martin Dalecki).
- 515. Fix mga dri bug that caused some rendering corruption when the dri module
- was loaded (Mark Vojkovich).
-
-XFree86 4.0.1b (11 August 2000)
- 514. Fix the freetype font renderer's handling of True Type Collections
- (.ttc files) (based on #A.123, timecop at japan.co.jp).
- 513. Add PCI IDs for Silicon Motion, Inc (#A.122, Martin Dalecki).
- 512. Fix a problem with the sequence number not being byte-swapped
- for the reply to the DPMSCapable request (#A.120, Stephen Tse).
- 511. Fix input driver PreInit funtions to behave as expected by InitInput()
- (David Dawes).
- 510. Port the spaceorb input driver to 4.x (Guido Heumer).
- 509. Port the Summa input driver to 4.x (#A.116, Peter Schlaile).
- 508. Add a DigitalEdge input driver (#A.116, Peter Schlaile).
- 507. Remove obsolete PC98 code (#4081, Takaaki Nomura).
- 506. Fix PC98 keyboard problems (#4081, Osamu Tomita).
- 505. Imake support for building on Linux/arm32 (#4080, Andrew E. Mileski).
- 504. Fix a problem with restoring the PIXCONF register in the i810 driver
- (#4078, Jonathan Bian).
- 503. Fix a build problem with the sis dri driver Imakefile (#4076,
- Takaaki Nomura).
- 502. Add DPMS support to the fbdev driver (#4075, Ani Joshi).
- 501. Add DPMS support to the fbdevhw module (#4074, Ani Joshi).
- 500. Fix VGA detection bug with Mach64 integrated controllers
- (Marc La France).
- 499. Accelerated line support for the NV driver (Chas Inman, Mark Vojkovich).
- 498. Add GeForce2 support to the NV driver (Chas Inman).
- 497. Integrate Cygwin support. To compile, this requires Cygwin 1.0 or
- later with gcc 2.95.2 and Windows NT (#4073, Suhaib M. Siddiqi).
- 496. Add en_GB.ISO8859-15 to locale.dir (David Dawes)
- 495. Build int10 on all platforms and move ATI driver after r128 driver in
- compiled-in probe lists (Marc La France, Michael Madore).
- 494. Fix bug in parser code: addNewOption2() trunkates option list
- when an option is added that already exists (Egbert Eich).
- 493. Fix tmp file problem with makedepend scripts (based on report from
- Alan Cox).
- 492. ATI driver changes (Marc La France):
- - Fix resource relocation bug.
- - An attempt at fixing problems reported with Chrontel 8398's.
- - Workaround for Mobility BIOS bug that affected the driver's ability to
- restore the mode on server entry.
- - Fix SEGV that occurs with ATI adapter BIOS'es that do not support some
- flavour of VBE.
- - Allow the driver to tolerate the absence of an initialised adapter BIOS
- image and introduce XF86Config options for the information the driver
- would otherwise require from it.
- - Recognise more cases where a DFP panel might be in use.
- - Fix minor bug that occurred on xf86SetDepthBpp() failures.
- - Implement a compilation option that produces an MMIO-only version of
- the driver. Intended for non-Intel architectures. See the driver's
- Imakefile for details.
- 491. fixed handling of backwards compatibility in xvmode (Egbert Eich).
- 490. fixed changing mouse protocol with xf86misc extensions (Egbert Eich).
- 489. added code to sanitize uninitialized PCI config space
- base addresses (Egbert Eich).
- 488. Changed xf86xv.c to call StopVideo(exit=TRUE) even
- if StopVideo(exit=FALSE) has already been sent (Egbert Eich).
- 487. fixed core dump in C&T video driver when vt switching
- Changed C&T video driver to only register a block handler
- when StopVideo() is called with exit = TRUE (Egbert Eich).
- 486. Fixed Cirrus driver not segfault when termineated while
- switched away (Egbert Eich).
- 485. Neomagic driver: select sw cursor when screen stretching is
- enabled (Egbert Eich).
- 484. Neomagic driver: fixed problem with screen to screen copy
- on 2200 chipsets (Egbert Eich).
- 483. Neomagic driver: fixed 'white screen problem' by implementing
- a signal save delay routine (Egbert Eich).
- 482. r128 driver: Fixed colormap set problem when server is switched
- away (Egbert Eich).
- 481. r128 driver Added reinitialization of accel engine after vt switch.
- 480. fixed a fg/bg color problem in SiS driver (Egbert Eich).
- 479. attempt to address some problems with Cyber LCD chipsets in
- Trident driver (Egbert Eich).
- 478. tseng driver: Implemented correct MMIO handling (Egbert Eich).
- 477. tseng driver: made accel driver multi screen capable (Egbert Eich).
- 476. fixed vgaHW driver to use forground color for readability
- test of pallette registers. This prevents annoying flashing
- screen on server start (Egbert Eich).
- 475. added module/font/rgb path parameters to xf86cfg (Egbert Eich).
-
-XFree86 4.0.1a (2 August 2000)
- 474. i810 DRI updates (Jeff Hartmann).
- 473. i810 driver updates (H. J. Lu).
- 472. Save/restore the text mode colourmap for Solaris, to fix a blank
- screen problem on Solaris 8 after exiting the X server (#A.104,
- Richard Coley).
- 471. Patch for SuperProbe on Linux with devfs (#A.103, Adam J. Richter).
- 470. Enable BSD/gcc-2.95.2 workaround for BSD/OS 4.2 (#4072, Kurt Lidl).
- 469. Fix a problem with the header symlinks in Xserver/GL/mesa/include/GL
- (#4071, Matthieu Herrb).
- 468. Finish integrating the SiS DRI driver support (Can-Ru Yeou, SiS).
- 467. Change references to the Mesa source directory in Imakefiles to
- $(MESASRCDIR) (David Dawes).
- 467. Fix a typo an error in the example code in the XtAppAddInput man page
- (#4070, Carlos A. M. dos Santos).
- 466. Imstt driver updates, including moving from cfb to fb, fixing fbdev
- bugs and an accel blit bug, and a general cleanup (#4068, Ani Joshi).
- 465. Fix the installation path of the xditview bitmap (#4067,
- Carlos A. M. dos Santos).
- 464. Some xf86cfg fixes (#4065, 4068, Paulo Cesar Pereira de Andrade).
- 463. Fix some syntax errors in xkb config files and a size mismatch between
- two xkbcomp structures that were being masked one to another (#4063,
- Paulo Cesar Pereira de Andrade).
- 462. Fix a problem where the xkbcomp would read junk data from the server
- if SmartScheduleTimer() is called while writing to it (#4063,
- Paulo Cesar Pereira de Andrade).
- 461. Increase MAXVISUALSPERDEPTH further for Xnest so that it will work
- with GLX (#4062, Harald Koenig).
- 460. Xv overlay support for the Intel i810 chipset (#4061, Jonathan Bian,
- Matthew J Sottek, Intel).
- 459. Penmount touch panel input driver (#4060, Mayk Langer).
- 458. Fix the r128 SaveScreen function so that it doesn't touch the hardware
- when switched away (#4056, Benjamin Herrenschmidt).
- 457. Add support to xman for FreeBSD's /etc/manpath.config (#4055,
- Carlos A M dos Santos).
- 456. Update Xinstall.sh to handle the different behaviour of ldconfig
- 2.1.3 (used on SuSE 6.4) (#4058, Michael Rohleder).
- 455. Fix incorrect use of xf86{En,Dis}ableInterrupts() for ppc
- (Marc La France).
- 454. Add man pages for pcitweak and scanpci (David Dawes).
- 453. Fix problems with xkb "Internet" keyboard mapping support (David Dawes).
- 452. A few corrections to PIO and MMIO definitions affecting mips, arm32,
- powerpc architectures and QNX4 (Marc La France).
- 451. Minor int10 and VBE fixups (Marc La France).
- 450. For frequency options, don't clobber the old value before verifying the
- new one is valid (Marc La France).
- 449. Ensure xf86_ansic.h is always #include'd before compiler.h in code
- that can be compiled as a module (even for the static server). Generate
- an error if not (Marc La France).
- 448. Make linux/int10 module complain when SystemV IPC isn't configured
- into the kernel (Marc La France).
- 447. Add new offscreen frame bufffer manager functions for managing linear
- offscreen areas (Mark Vojkovich).
- 446. int10 fixes and remove checksum verification (Marc La France).
- 445. More message formatting changes for DDC (Marc La France).
- 444. Add missing xf86write symbol (Marc La France).
- 443. Fix open(, O_CREAT) emulation (Marc La France).
- 442. Fix Trident Cyber9320 > 8bpp modes (Alan Hourihane).
- 441. Allow memory mapping during probe phase (Marc La France).
- 440. Clean up os-support/dgux/dgux_video.c (Marc La France).
- 439. Fix int10 bug that prevented recognition of video BIOS'es that are part
- of the system BIOS (Marc La France).
- 438. MGA driver warning fix (Marc La France).
- 437. An update to change 425 (Marc La France).
- 436. More EDID formatting changes (Marc La France).
- 435. Fix bug that caused the relocation of PCI I/O bases assigned to multiples
- of 0x0100 (but not 0x0400) by the system BIOS (Marc La France).
- 434. Add ATI driver to Alpha, and experimentally, to ppc architectures. ppc
- support is still known to be incomplete (Marc La France).
- 433. For IA64, compile everything, except PEX, that is also compiled for IA32
- (Marc La France).
- 432. Fix Cyrix driver for -configure (Alan Hourihane).
- 431. Fix Glint PM3 memory detect when only 1MB of videoram (Alan Hourihane).
- 430. Fix DAC colour problem and blank out issue in glint driver
- (Alan Hourihane).
- 429. Add missing clock values to the trident driver (Alan Hourihane).
- 428. Fix Glint driver's SaveScreen function (#4057, Michel Danzer).
- 427. Convert MGA driver to use fb instead of cfb (Mark Vojkovich).
- 426. Rewrite MGA color expansion routines so that pci retries never occur
- (Mark Vojkovich).
- 425. Make ATI driver tolerate relocation of conflicting resources
- (Marc La France).
- 424. Make Mach64 FIFO handling available to GATOS (Marc La France).
- 423. Fix bug in Mach64 scissor handling (Marc La France).
- 422. Implement Mark Vojkovich's suggestions in the ATI driver
- (LSB ordering of monochrome data and host transfer burst modes)
- (Marc La France).
- 421. More fixes to ATI DSP register calculation (Marc La France).
- 420. ATI DGA support fixes for VGA Wonder capable adapters and the
- setting of the DGA_CONCURRENT_ACCESS flag (Marc La France).
- 419. Change imake to generate symbols for the GCC version used to
- compile it (Marc La France).
- 418. Fix xf1bpp/xf4bpp in trident driver and some planemask problems
- (Alan Hourihane).
-
-XFree86 4.0.1 (1 July 2000)
- 417. Update OpenBSD and NetBSD docs (#4053, Matthieu Herrb).
- 416. Fix segfault when destroying a GLX context (Kevin Martin).
- 415. Doc updates (Georgina Economou).
- 414. Fix some palette and fbdev problems, and add a missing break to the
- video memory type detection code for the r128 (#4043, Benjamin
- Herrenschmidt).
-
-XFree86 4.0Z (30 June 2000)
- 413. README updates (Georgina Economou).
- 412. Add some SiS DRI code, but currently disabled because the X server
- driver level support hasn't been integrated yet (Can-Ru Yeou, SiS).
- 411. Remove the PPC-specific assembly for load/stores from the r128 driver,
- and use the versions now provided in compiler.h, which are faster (#4051,
- Ani Joshi).
- 410. Fix the UTF-8 converters so that cut&paste works better in UTF-8 locales
- (#4049, Bruno Haible).
- 409. Complete the move of glx.h to xc/include/GL, and don't include
- Xmd.h in glx.h (#4048, Brian Paul).
- 408. Apm driver updates, including fixing 24/32 access, fixing an
- initialization bug, and some code cleanups (#4047, Loic Grenie).
- 407. Sparc/sbus updates: put sparcProm* in the correct header file, add
- xf86SbusSetOsHwCursorCmap sbus layer interface, and export symbols for
- this new interface and the sparcProm* interfaces in the loader (#4046,
- Jakub Jelinek).
- 406. Add cg3/cg14/tcx/bw2 drivers (sparc), and fix a few bugs in leo and
- cg6 drivers. Build these driver, plus the ati and glint drivers
- on Linux/sparc (#4046, Jakub Jelinek).
- 405. Fix Elite3D detection (#4045, David S. Miller).
- 404. Treat SBUS like ISA when assigning access control records, so now
- multi-head, Xinerama, etc works with SBUS drivers (#4045,
- David S. Miller).
- 403. SDK install updates (#4044, David Bateman).
- 402. Work around an odd problem with waitpid() in the code for auto-loading
- DRM kernel modules on Linux (#4042, Brian Paul).
- 401. Change the imake parameter for BSD/OS from BSD386Architecture to
- BSDOSArchitecture (#4041, Kurt Lidl).
- 400. Make the neomagic driver recognise the NM2380 chip, and treat it
- exactly like a NM2360 (#4041, Kurt Lidl).
- 399. Updates for compiling cleanly on BSD/OS 4.0.1, and to make the
- BSD/OS support less i386-centric (#4041, Kurt Lidl).
- 398. Disable SilkenMouse for the s3virge GX2 to avoid some lockup problems
- (#4039, Kevin Brosius).
- 397. Some mga DRI updates to improve stability (Jeff Hartmann).
- 396. Fix some DRI offscreen memory calculations in the Matrox driver
- (Mark Vojkovich).
- 395. IA64 workarounds - should compile and run right out of the box now
- (Mark Vojkovich).
- 394. LBX, X-TrueType and Xnest warning fixes (Marc La France).
- 393. Remove unused xf86MapDisplay() and xf86UnMapDisplay() os-support entry
- points (Marc La France).
-
-XFree86 4.0g (26 June 2000)
- 392. Fix a missing -I in sunffb/Imakefile (#4038, David S. Miller).
- 391. Some -misc-fixed-* BDF font updates, primarily expanding the 7x13
- set to include the same 8-bit variants as the 6x13 set, including
- a new oblique/italic version (#4037, Markus Kuhn).
- 390. Fix an endless loop in the UTF-8 converters (#4036, Bruno Haible).
- 389. Straighten out xfindproxy exit codes to match success/failer status;
- also change one instance where error message was printed to stdout
- (#4035, Huver).
- 388. With LBX enabled, the X server wasn't checking the proxy connection,
- and so fails the connection request without calling InvalidHost()
- (#4033, Huver).
- 387. xfwp doProcessWritables() closes connection, but then proceeds
- to reset client fd via FD_SET() (#4031, Huver).
- 386. Don't build a non-DRI libOSMesa (#4029, Takaaki Nomura).
- 385. Add generic DGA support to SiS driver (Alan Hourihane).
- 384. Add more support structure for Alpha/DRI (not enabled yet though)
- (Alan Hourihane).
- 383. Fix glXDestroyContext bug that caused Q3A to use old clip rect info
- when opening a new window (Kevin Martin).
- 382. Fix R128 3D driver clear problem which caused R128Pro cards to lock
- up, and fix dword count on ring-based vertex buffer code for PCI
- R128 cards (Gareth Hughes).
- 381. Possible fix for a problem introduced with item 332 that resulted
- in the first screen's config file data being used for all screens
- (Mark Vojkovich, David Dawes).
- 380. Add an imake parameter NothingOutsideProjectRoot that turns off
- installing links and config files, etc, outside of ProjectRoot
- (David Dawes).
- 379. Possible fix a problem with 'make install' on Linux when there is
- already a /usr/include/GL directory (David Dawes).
- 378. Fix a DGA-related crash when using multiple input devices with the
- DGA extension disabled (Matthieu Herrb).
-
-XFree86 4.0f (23 June 2000)
- 377. Suppress the use of a temporary directory to build man pages on
- OpenBSD, which fixes problems with some external programs (#4028,
- Matthieu Herrb).
- 376. Allow some linux/mips settings in linux.cf to be overriden (#4026,
- Guido Guenther).
- 375. Synchronize the pointer state before checking it in xf86CheckButton()
- (Paulo Cesar Pereira de Andrade).
- 374. s3virge driver fixes for noise and console corruptionn on the GX2 and
- MX (but they're commented out for the MX because it hasn't been tested
- yet) (#4027, Kevin Brosius).
- 373. Fixes for lib/GL Imakefiles (Marc La France).
- 372. Update DRI drivers sunffb,mga,i810,glint,r128,tdfx to check for
- DRIQueryVersion, overcomes an older libdri issue (Alan Hourihane).
- 371. Change tdfx driver to use fb instead of cfb (Alan Hourihane).
- 370. Make using libpthread optional for OpenBSD 2.7.
- 369. Fix a problem when calling XF86VidModeSwitchMode() when the switched
- screen is different from the one that has the pointer (#4024,
- Paulo Cesar Pereira de Andrade).
- 368. Bindist files for Linux/mips (#4023, Guido Guenther).
- 367. Allow XFree86 to compile on NetBSD-current and 1.5_ALPHA, which
- no longer use the pcvt console, but have a compatibility mode for it
- in wscons (#4021, Bernd Ernesti).
- 366. Add support for the iso8859-13 charset to Xlib (#4020, Bruno Haible).
- 365. Add ISO-8859-13 support to the UTF-8 converters, which is needed for
- Lithuanian UTF-8 locales (#4019, Bruno Haible).
- 364. Fix three bugs in the UTF-8 converters:
- - In an UTF-8 locale, keyboard input coming in as UTF-8 would not be
- accepted.
- - Incorrect handling of the "end of string" and "invalid byte sequence"
- situations.
- - A bug on platforms with sizeof(wchar_t) != sizeof(int).
- (#4018, Bruno Haible).
- 363. Enable building DRI support for FreeBSD 4.1 and higher.
- 362. Don't try to use kldload() on FreeBSD versions prior to 3.0 (#4016,
- Takaaki Nomura).
- 361. Some sunffb cleanups (#4015, David S. Miller).
- 360. Add DRI drawable index callback (#4015, David S. Miller).
- 359. Fix -configure option to print out fatal message and abort gracefully
- when pci data isn't entered into xf86PciInfo.h (Alan Hourihane).
- 358. Add generic DGA support to NeoMagic (not tested) (Alan Hourihane).
- 357. Add generic DGA support to i810 (not tested) (Alan Hourihane).
- 356. Fix GCC 2.96 complaints in big font extension and imstt driver
- (Steven King).
- 355. Fix remaining DRI III compile glitches (Marc La France).
- 354. Fix long standing bug with 3Dfx driver when DRI module isn't loaded.
- It complained about unresolved symbol called after 'Textures memory'
- output (Alan Hourihane).
-
-XFree86 4.0e (20 June 2000)
- 353. Fix a couple of acceleration problems in glint driver (Alan Hourihane).
- 352. Don't attempt to build the Sparc DRI drivers on ix86, and vice versa
- (David Dawes).
- 351. Fix a lib/GL build problem when the DRI isn't enabled (#4014,
- Nicholas J Brealey).
- 350. Fix location of dri module links in the xc/exports directory of the
- build tree.
- 349. Replace LoaderSymbol() with xf86LoaderCheckSymbol() in drivers.
- 348. Disable SmartScheduler on LynxOS 3.1 (#4013, Thomas Mueller).
- 347. Update Japanese PC98 docs (#4012, Isao Ohishi, Takaaki Nomura).
- 346. Add some S3/Diamond PCI IDs (#4011, Werner Leeb).
- 345. Update sbus support for recent bus infrastructure changes
- (David S. Miller)
- 344. Check for NULL pointers from item 332 (Alan Hourihane).
- 343. Xf86cfg updates (#4010, Paulo Cesar Pereira de Andrade).
- 342. Fix threads support in OpenBSD 2.7 and above (#4006, 4009,
- Carlos A M dos Santos).
- 341. UCS misc BDF fonts updates, including new oblique/italic versions
- (6x13O, 8x13O), Korean font covering all Hangul symbols (18x18ko)
- and many additional autogenerated ISO 8859 fonts to cover with
- 6x13 and 8x13 all the locale encodings suggested by the Li18nux
- specification (#4007, Markus Kuhn).
- 340. Add Linux/Sparc support for the DRI, and a DRI driver for Sun
- Creator3D hardware (#4004).
- 339. Fix DRI BusIDString length usage (#4003, David S. Miller).
- 338. Xterm patch #139 (#4002, Thomas Dickey).
- 337. Make the use of GlxDefines for libGL independent of BuildXF86DRI (#4001,
- David S. Miller).
- 336. Fix i810 build warnings (#4000, Jarno Paananen).
- 335. Fix an i810 build problem (Keith Whitwell, #4000, Jarno Paananen).
- 334. Fix a multihead problem with the mga driver (Mark Vojkovich).
- 333. Add support to the i810 driver for the i815 (Keith Whitwell).
- 332. Add infrastructure support for cards with multiple CRTCs (screens)
- per accelerator (PCI entity) (Jeff Hartmann and David Dawes).
- 331. Fix some Mesa problems (Brian Paul).
- 330. Rework patch for mapping drmAddMap on Alpha platforms
- (Bruce Stockwell/Compaq, Alan Hourihane).
- 329. Don't build Debuggable Library on Linux for the release (Alan Hourihane).
- 328. Don't build lib/GL/mesa/src/X86 on Alpha systems (Alan Hourihane).
- 327. xdm warning fix (Marc La France).
- 326. Make x11perf die gracefully when display cannot be opened
- (Marc La France).
- 325. Fix rendition driver compile glitch (Marc La France).
- 324. #ifdef out glitch in glint driver (Marc La France).
- 323. Preliminary DGA support in ATI driver (Marc La France).
- 322. Minor update to DESIGN and Status documents (Marc La France).
- 321. Fix DGA's reporting of vertical refresh rates to clients
- (Marc La France).
- 320. Make driver-provided Sync(), SetViewport() and GetViewport() DGA
- callbacks optional (Marc La France).
- 319. Fix XKB compile glitch (Marc La France).
- 318. Make imstt driver compile (Marc La France).
-
-XFree86 4.0d (16 June 2000)
- 317. Fix a typo in the xfree86 xkb keycodes file (#3999, Matthieu Herrb).
- 316. Fix some build problems when the DRI is not enabled (#3998,
- Matthieu Herrb).
- 315. Add missing Linux/mips config changes (#3997, Guido Guenther).
- 314. Fix for libICE DOS (Keith Packard).
- 313. FontInfo.c (lib/X11) needs to be built with the bigfont defines (#3996,
- Paulo Cesar Pereira de Andrade).
- 312. Disable the smart scheduler for SVR4.0 (based on #3916, Takaaki Nomura).
- 311. Add a check for PS/2 mice on Linux for the X server's -configure
- option (#3991, Paulo Cesar Pereira de Andrade).
- 310. Fix a problem mouse driver button flush was causing with Xaw menus
- (#3991, Paulo Cesar Pereira de Andrade, David Dawes).
- 309. Modify scanpci to print out card/subsys information, and add a few
- more entries to the pci data (David Dawes).
- 308. Fix r128_cursor.c build problem for big-endian machines (#3989,
- Thomas Mueller, #3994, Ani Joshi).
- 307. Update LynxOS docs (#3989, Thomas Mueller).
- 306. Add a few PPC compiler internal symbols to the loader's export list
- (#3989, Thomas Mueller).
- 305. Add crypt support to xdm for LynxOS (#3989, Thomas Mueller).
- 304. Add preliminary build support for LynxOS 3.1.0 (#3989, Thomas Mueller).
- 303. Add keysyms to complete the set for the Compaq SK2850 keyboard and
- the Microsoft Natural Keyboard Pro (David Dawes).
- 302. Add new keysyms for PDAs (#3985, 3987, 3988, Jim Gettys).
- 301. Xterm patch #138 (#3986, Thomas Dickey).
- 300. DRI megapatch III. This includes DRI enhancements, 3dfx fixes and
- updates, updates Mesa to the latest version, adds Intel i810, Matrox
- G200/G400, ATI Rage 128 and 3dfx Voodoo5 3D support, adds ATI Rage
- Mobility 2D support (disabled by default). (Precision Insight and
- VA Linux Systems).
- 299. Add a function to the X server that performs the same checks on
- command line arguments and environment variables as the Xwrapper
- from 3.3.x. This function is called very early from main()
- (David Dawes).
- 298. Fix for some Xlib problems that can show up when connecting to
- a rogue server (Keith Packard, with analysis by Chris Evans).
- 297. Increase MAXVISUALSPERDEPTH to 64 for Xnest so that it can handle
- GLX's visuals.
- 296. Add a Macedonian xkb symbols file (#A.96, Zlatko Trajceski).
- 295. Fix a buffer overflow with the -xkbmap X server flag (#A.91,
- Trevor Johnson).
- 294. Fix a rectangle fill problem that shows up with an AGP SiS 6326
- (A.81, A.83, Milivoj Savin).
- 293. Fix a problem in xcalc when the current locale uses a character
- other than "." for the decimal point (#A.63, Stanislav Brabec).
- 292. Allow some more parameters in linux.cf and lnxLib.rules to be
- redefined (#A.60, Stanislav Brabec).
- 291. Fix a typo in lib/Xss/Imakefile (#A.59, Stanislav Brabec).
- 290. Fix an xfs crash that shows up when many clients connect (#A.48,
- Remy Card).
- 289. Fix some man page build problems (#A.43, Ian Collier).
- 288. Fix xedit core dump (in Xaw) on Solaris, related to the bsearch()
- usage (#A.42, Ian Collier).
- 287. Add xkb mappings for the keycodes generated by the SysRq and Break
- keys, which are different from the keycodes generated when used as
- PrtScn and Pause (#A.29, Eric W. Biederman).
- 286. Fix problems when building on Solaris 2.6/sparc and Irix 6.5.5
- (#A.21, A.28, Sullivan N. Beck).
- 285. Fix a core dump in fstobdf when using 16 bit fonts (#A.25,
- Morten Storgaard Nielsen).
- 284. Clean up some of the messages printed by the neomagic driver
- (David Dawes).
- 283. Add support for the 2360 (256ZX) to the neomagic driver, and enable
- acceleration at depth 24 for this chip (#A.23, Gregory M Pomerantz).
- 282. Adjust the bigfont extension to not use SHM segments for fonts with
- a small glyph metric size, and fix a build problem on systems without
- shared memory (#3984, Bruno Haible).
- 281. Status doc updates (#A.9, Chris Smith, A.80, Ferenc Acs).
- 280. Fix memleak warning when doing realloc(NULL, size) (#A.7,
- Charles G Waldman).
- 279. xf86cfg fixes (#3983, Paulo Cesar Pereira de Andrade).
- 278. Add SilkenMouse support to the s3virge driver (#3982, Kevin Brosius).
- 277. Update Xv support in the glint driver and add the XvPutImage function
- for the Permedia 2 (#3926, Michael Schimek).
-
-XFree86 4.0c (13 June 2000)
- 276. Xterm patch #137 (#3976, Thomas Dickey).
- 275. Doc update for the chips driver (#3981, David Bateman).
- 274. Fix some problems building with the SDK (#3981, David Bateman).
- 273. Fix comments for the address matching algorithm in
- XauGetAuthByAddr() and XauGetBestAuthByAddr() (Keith Packard, based on
- #3939, Peter Runestig).
- 272. Handle setting SharedLibXdmGreet in the OS imake config files rather
- than having a complicated expression in the xdm Imakefile (#3980,
- Matthieu Herrb).
- 271. xdm updates from the OpenBSD team, including:
- - support for Kerberos IV authentication [enabled only in OpenBSD.cf,
- but could be enabled for other systems by setting HasdKrbIV]
- - use the arc4random(4) random number generator on OpenBSD
- - add a new resource "allowRootLogin", which can be used to disable
- root logins through xdm
- - log failed logins to syslogd [OpenBSD only, but could be enabled on
- other systems]
- - verify that the shell is valid using /etc/shells [OpenBSD only]
- - verify that the account hasn't expired [OpenBSD only, but could be
- enabled on other system that use the same passwd aging structure]
- (#3948, 3980, OpenBSD team, Matthieu Herrb).
- 270. Big/little endian MMIO_XX macros for ppc, and also PIO macros check
- that IOBase is mmapped before doing any accesses (#3979,
- Kostas Gewrgiou).
- 269. Preliminary driver for Integrated Micro Solutions TwinTurbo128
- (imstt) (#3978, Ani Joshi).
- 268. Fix broken czsk keymaps, and let the user directly select either
- Czech or Slovak keyboard in xf86config (#3975, Kamil Toman).
- 267. Implement DGA2 support with depth switching for ATI Rage 128 cards
- (#3974, Ove Kaaven).
- 266. Recent versions of FreeBSD have the xpg4 library folded into libc.
- 265. xf86cfg updates (#3973, Paulo Cesar Pereira de Andrade).
- 264. Xaw bug fixes (#3973, Paulo Cesar Pereira de Andrade).
- 263. Fix M-d and M-h key bindings in the Xaw Text widget (#A.87,
- Jonathan Kamens).
- 262. Fix some Xaw memory errors (#A.79, Jonathan Kamens).
- 261. Xman fixes/updates, including:
- - Fix a core dump in fclose()
- - Append the default search path when MANPATH ends in a ':'
- - Understand man pages that have a single line with a .so directive
- (#3969, 3973, Paulo Cesar Pereira de Andrade).
- 260. Resync nls Compose file with 3.3.6 (#3964, 3973,
- Paulo Cesar Pereira de Andrade).
- 259. Fix moving the pointer between screens when using MouseKeys, and fix
- some bugs in the xkbfile code (#3963, 3973,
- Paulo Cesar Pereira de Andrade).
- 258. Fix XC-SECURITY security bug (#3954, 3973,
- Paulo Cesar Pereira de Andrade).
- 257. Bigfont bug fix, which stops cvsup crashing (#3954, 3973,
- Paulo Cesar Pereira de Andrade).
- 256. Replace some bitswapping assembler code in XAA with faster C code
- (Mark Vojkovich).
- 255. Rendition driver updates, including:
- - add DirectColor support
- - add SilkenMouse support
- - documentation updates
- - some code cleanups
- (#3972, Dejan Ilic).
- 254. For v4l: don't advertise the XV_VOLUME attr if we're only going to
- return BadMatch on use (#3968, David Woodhouse).
- 253. Modify the I2C delay routine to use xf86getsecs (gettimeofday) instead
- of an uncalibrated loop (#3967, Andrew Aitchison).
- 252. Add some PCI ids to xf86PciInfo.h, and include some instructions
- about how to add new PCI data (#3966, Kevin Brosius).
- 251. Update documentation for Japanese PC98 (#3965, Satoshi Kimura,
- Akio Morita, Takaaki Nomura).
- 250. XIM patch (imInt.c) (#3962, Fuminori Hirayama).
- 249. Xterm patch #136 (#3960, Thomas Dickey).
- 248. Fix Imake.rules for building on Solaris 7 with gcc-2.95.2 (#3958,
- Nicholas Brealey).
- 247. Add basic support for the Linux/mips and mipsel architecture (#3957,
- 3970, Guido Guenther).
- 246. Disable reading the BIOS in the int10 code for Japanese PC98 (#3959,
- Isao Ohishi).
- 245. Add a "NoPciBurst" option to the Trident drive for Japanese PC98
- cards with the TGUi968x chip (#3955, Akio Morita).
- 244. Xterm patch #135 (#3951, Thomas Dickey).
- 243. Fbdev driver fix (#3953, Ani Joshi).
- 242. Xterm patch #134 (#3949, Thomas Dickey).
- 241. Import the mktemp() usage fixes for imake from the 3.3.x branch
- (#3947, Matthieu Herrb).
- 240. Rman updates, including:
- - minor reformating (make { and } match)
- - fix logic for parsing comments in man pages, which allows the
- copyrights to appear in the output html
- - a few changes based on weblint and tidy
- (#3946, Thomas Dickey).
- 239. Fix incorrect type for vgaIOBase in the neomagic driver (#3944,
- Ani Joshi).
- 238. Fix an Xlib build problem when the big-font extension is disabled
- (#3945, Mutsumi Ishikawa).
- 237. Xv v4l attribute handling bug fix (#3928, Gerd Knorr).
- 236. Fix some problems with the locale-dependent input processing in Xlib
- by:
- - removing unneeded to/from CTEXT conversion for characters coming
- from keyboard input
- - move "locale_code" and "keyboard charset" searching to the
- initialization step (XIM creation)
- - Fix some inconsistencies between memory allocation and freeing
- in XIM objects (imLcIm.c imThaiIm.c)
- (#3927, Ivan Pascal).
- 235. Update support for Appian J2000 board with dual PM3 chips, and
- add partial acceleration (#3977, Sven Luther).
- 234. Only claim other devices on the same card when gamma chip is used
- in the glint driver (Alan Hourihane).
- 233. Separate offscreen memory manager API from implementation to facilitate
- driver replacement of the default manager (Mark Vojkovich).
- 232. Add Option "TexturedVideo" to have the Matrox driver optionally use
- YUV textures instead of the video overlay for XvImage support
- (Mark Vojkovich).
- 232. Add Xv functions for allocating/freeing XvVideoAdaptorRecs to shield
- drivers from structure size changes (Mark Vojkovich).
- 231. Have XDGAQueryModes return no modes as being available instead of an
- error when DGA is not supported on the particular screen (Mark Vojkovich).
- 230. Fix xdm when PAM is not available (Marc La France).
- 229. Fix int10 bug on non-PC platforms (Marc La France).
- 228. Finish prototyping of DPS libraries. Fix argument promotions in
- pswrap. Fix yytext portability problem. Fix non-standard format
- in pswrap (#3941, #3942, Nomura Takaaki, Thomas Dickey).
- 227. Fixed FP chipset handling in Trident driver. LCD-CRT switching
- should work now (Egbert Eich).
- 226. Modified device detection on PCI bus to handle Host-to-PCI bridges
- better (Egbert Eich).
- 225. Fix i810 driver so it advertises 32bpp pixmaps in depth 24 like the
- rest of the drivers do (Mark Vojkovich).
- 224. Added a call ioperm() to to allow vm86 to execute in/out calls
- directly to avoid problems with certain notebook bioses (Egbert Eich).
- 223. Fixed mouse driver to flush pending button press events on
- protocol change (Egbert Eich).
- 222. Fixed DDC support and sync flags handling in trident driver
- (Egbert Eich).
- 221. Added PAM support to xdm, ANSIfied prototypes (Werner Fink).
- 220. Added ServerFlag to force the use of OS PCI config space
- support (Egbert Eich).
- 219. Fix Xv DDX stop overlaid stills/images when XvStopVideo() is called
- (Mark Vojkovich).
- 218. Have the Xv DDX send clients exposure events when windows containing
- overlaid data, which isn't actually in the framebuffer, are moved
- (Mark Vojkovich).
- 217. Fix ordering of calling DDC probe in VBE to respect NoDDC options
- (Alan Hourihane).
- 216. Fix VBE initialization in trident driver for DDC (Alan Hourihane).
- 215. Fix a typo in the glint driver (#3943, Michael Schimek).
- 214. Fix multithread bug in Xlib big font support (Mark Vojkovich).
- 213. Fix a window class initialization problem in Xinerama (Mark Vojkovich).
- 212. Fix some multithreading related problems in the Xv client library
- (Mark Vojkovich).
-
-XFree86 4.0b (23 May 2000)
- 211. Add support to the sunffb driver for multiple visuals on the same screen,
- overlays, double buffering and some other niceties (#3938,
- David S. Miller, Jakub Jelinek).
- 210. Make the modifier setting on Sun keyboards match what XFree86 expects
- (#3937, Jakub Jelinek).
- 209. Add unaccelerated support for the Sun CG6 (#3935, Jakub Jelinek).
- 208. Make the -configure option work with SBUS/UPA drivers, fix some
- bugs in the sbus layer, add support for ioctl based colormap setting,
- and fix leds on Sun keyboards (#3934, Jakub Jelinek).
- 207. Fix a parallel build problem in lib/dps (#3932, H. J. Lu).
- 206. Fix some build problems that show up with LynxOS x86 and PowerPC (#3929,
- Thomas Mueller).
- 205. Fix documentation files for the mutouch and elographics drivers,
- and build these drivers by default (#3935, Patrick Lecoanet).
- 204. Make the dga2 library use the device name provide by the driver rather
- than always using the default (3924, David S. Miller).
- 203. Fix a problem with the internal xalloc that shows up on Sparc (#3923,
- David S. Miller).
- 202. Fix a GLX visual problem that causes a crash at server shutdown
- (#3922, David S. Miller).
- 201. 8+32 framebuffer for hardware that uses window IDs (David S. Miller).
- 200. Fix a memory allocation in lbxproxy that can cause it to crash at
- startup (#3921, Peter Runestig, #A.46, Rob Clark).
- 199. Fix a problem with imake's handling of DefaultGccIncludeDir (#3920,
- Peter Runestig, #A.64, Stanislav Brabec).
- 198. lib/X11/imInt.c fix from the OpenMotif release notes (#3919).
- 197. Prototype and fix almost all compiler warnings fot he dps library
- and the related pswrap program (#3912, Thomas Dickey).
- 196. Fix for x-tt font cache corruption (#3911, H. J. Lu).
- 195. Ansi prototypes for the lbxusilt library and Xserver/lbx directory
- (#3908, Matthieu Herrb).
- 194. Fix some bugs in the cirrus lg driver (#3900, Itai Nahshon).
- 193. Accelerated driver for Sun Leo/ZX cards (#3899, 3936, Jakub Jelinek).
- 192. Fully accelerated driver for Sun FFB and AFB chips (#3898,
- Jakub Jelinek).
- 191. Generic SBUS and UPA support for XFree86 (#3897, Jakub Jelinek).
- 190. Fix building xf86cfg on systems where libxpm isn't linked in
- implicitly (#3903, Matthieu Herrb).
- 189. Update the fbdevhw stubs for an interface change (#3902, Matthieu Herrb,
- #3910, Bernd Ernesti).
- 188. Simplify the platform defines in servermd.h to make them more hardware
- dependent than OS dependent (#3913, Kurt Lidl).
- 187. Fix a bug in the search/replace dialog in the Xaw text widget (#3896,
- Paulo Cesar Pereira de Andrade).
- 186. Xterm patch #133 (#3894, Thomas Dickey).
- 185. Fixes for the Xaw TipWidget (#3893, Paulo Cesar Pereira de Andrade).
- 184. Change CTEXT from/to converters to allow processing of "C1" codes
- (0x80-0x9f) as ordinary characters for "non-standard" encodings
- (such as UTF-8) (#3891, Ivan Pascal).
- 183. Add "software" per-key auto-repeat disabling (#3889, Ivan Pascal).
- 182. Refix fog.c build problem on Alpha (#3888, Dave Gilbert).
- 181. Add some new things for the VidMode interface in xf86cfg (#3877,
- Paulo Cesar Pereira de Andrade).
- 180. Rework most of the look and feel of xf86cfg, and fix some bugs (#3877,
- 3886, 3892, Paulo Cesar Pereira de Andrade).
- 179. Add a ProjectRoot to Xaw rather than hard-coding it, so that the
- pixmap code can find pixmaps and bitmaps on non-standard installations
- (#3877, Paulo Cesar Pereira de Andrade).
- 178. Fix a bug in the DRI section parsing (David Dawes).
- 177. Add support for building shared libraries on BSD/OS (#3876, Kurt Lidl).
- 176. Add imake support for automatically determining the version for BSD/OS,
- and update bsdi.cf for the features relevant to the different versions
- (#3876, 3940, Kurt Lidl).
- 175. Xterm patch #132 (#3874, Thomas Dickey).
- 174. Fix rman-related build problems when building external applications
- (#3869, Matthieu Herrb, #3890, H. J. Lu).
- 173. Fix a typo in OpenBSD.cf (#3867, Matthieu Herrb).
- 172. Fix some build warnings (#3864, Ani Joshi).
- 171. Fix some BSDI typos in hw/sun (#3862, Kurt Lidl).
- 170. Fix r128 palette save/restore when VT switching (#3861, Ani Joshi).
- 169. Disable the X server's internal malloc by default (#3860, Keith Packard).
- 168. Make xdpyinfo and xf86dga fail gracefully when DGA is not enabled
- in the driver, but the extension is enabled (#3870, Andrew Aitchison).
- 167. Fix too many xfree calls in lbxproxy (#3907, Matthieu Herrb).
- 166. Fix uninitialized fd_set mask in lbxproxy (#3906, Matthieu Herrb).
- 165. Fix typo when printing HSync frequency when not a range
- (#3895, Andrew Aitchison).
- 164. Fix a window unmapping bug in the mioverlay code (Mark Vojkovich).
- 163. Attempt to improve memory detection reliability in the Matrox driver
- (Mark Vojkovich).
- 162. Fix possible SEGV in generic int10 module (Marc La France).
- 161. Fix *BSD aperture driver to allow for int10 (Bernd Ernesti,
- Marc La France).
- 160. Fix vesafb restore problem in ATI driver (Marc La France).
- 159. Fix a few more compilation glitches (Marc La France).
- 158. Fix DRM for gamma for single and dual MX chips (Alan Hourihane).
- 157. Fix Mesa for single and dual MX chips (Alan Hourihane).
- 156. Fix Mesa for multiple screen widths (Alan Hourihane).
- 155. Add DGA support to the glint driver.
- - Fix initialization of DRI when using single or dual MX's.
- - Fix register resources.
- - Turn on more acceleration for DualMX boards.
- - Fix DualMX boards displaywidth problems at >640 widths.
- - Fix depth15/16 for PM2v and PM3 chipsets (Alan Hourihane).
- 154. Use MMIO_xx macros in glint driver (#3904, Michel Danzer).
- 153. Fix lib/GL/mesa/src/X86/Imakefile for m4 (Alan Hourihane).
- 152. Fix m4 rules in Imake.tmpl (Alan Hourihane).
- 151. ATI documentation update (Marc La France).
- 150. Disable debugging messages from XF86-Misc extension (Marc La France).
- 149. Ensure XAA always respects user options that disable subsets of its
- primitives (Marc La France).
- 148. Bug fix in XAA's CPU-to-screen colour expansion (Marc La France).
- 147. Finish off XAA's CPU-to-screen colour expansion for 24bpp
- (Marc La France).
- 146. When matching adapters to XF86Config sections, the ATI driver will now
- look at the primary adapter before any other non-primary PCI adapters
- (Marc La France).
- 145. Ensure Mach64 acceleration is disabled when using the VGA CRTC
- (Marc La France).
- 144. Set a Mach64's scaler/overlay clock divider in preparation for a GATOS
- merge (Marc La France).
- 143. Make VBE use its own option instead of DDC's (a consequence of
- re-entrancy) (Marc La France).
- 142. Make option processing re-entrant in DDC, int10, VBE and XAA modules, and
- in the common layer (Marc La France).
- 141. Add Permedia3 support to the glint driver (Sven Luther).
- 140. Fix XvPutImage in the client libs so that it can use the BIG-REQUESTS
- extension (Mark Vojkovich).
- 139. Fixed xf4bpp for devPrivates in PixmapRec. (Egbert Eich).
- 138. Fixed laguna driver to map FB after the video RAM size is known
- (Egbert Eich).
- 137. Fixed xdm to give up to respawn Xservers if the server crashes
- more than once within 60 seconds (Egbert Eich).
- 136. Added VGA default clock option to generic driver (Egbert Eich).
- 135. Fixed CyberShadow option in Trident driver (Egbert Eich).
- 134. Fix bug where the cursor is not put back after a failed DGA mode
- initialization attempt (Mark Vojkovich).
- 133. Add a missing symbol "AllocateColormapPrivateIndex" (Mark Vojkovich).
- 132. Remove Intel 440BX-specific resources from os-support layer
- (Marc La France).
- 131. Change ATI driver to mark VGA resources as unused in operating state when
- appropriate (Marc La France).
- 130. Fix bug in the generation of default screen layout (Marc La France).
- 129. Include all resource attributes when printing them (Marc La France).
- 128. Fix compiled-in input driver list (Marc La France).
- 127. Allow driver access to resource manipulation functions (Marc La France).
- 126. Fix a DGA 2.0 crash that happened when bogus mode numbers were sent
- by the client (Lionel Ulmer).
- 125. Make a recent shm pixmap fix Xinerama aware (Mark Vojkovich).
- 124. Fix mode setting bug in ATI driver (Marc La France).
- 123. Add int10, DDC & VBE support to ATI driver
- (Andrew C Aitchison, Marc La France).
- 122. Allow driver to supply DDC module to VBE (Marc La France).
- 121. Attempt to fix cyrix driver (untested). (Egbert Eich)
- 120. Added support for 'inactive' devices. (Egbert Eich)
- 119. Fixed xf86misc extensions. (Egbert Eich)
- 118. Fixed design of xf86SetAccessFuncs(). Now all old access funcs
- are returned if the driver asks for them not only the one
- that is used in OPERATING state. (Egbert Eich)
- 117. Added a function LoadDrvSubModule() to allow drivers to load
- sub modules before a screen is allocated. (Egbert Eich)
- 116. Fixed lndir to handle trailing '/' on path correctly. (Egbert Eich)
- 115. Undefined i486/i586/i686 in Imake.cf. cpp might predefine
- them which might cause undesirable results. (Egbert Eich)
- 114. Updated x86emu. (Egbert Eich)
- 113. Fixed problems with xf86RegisterResources() if preregistered
- resources are not marked ResBios. Identical ranges are not considered
- to conflict with each other. (Egbert Eich)
- 112. Improved DDC information printout. (Egbert Eich)
- 111. Added NODDC options to vbe. (Egbert Eich)
- 110. Added fixes for Lynx OS. (Egbert Eich)
- Changed int10 code to always map/allocate entire 1Meg. (Egbert Eich)
- 109. Let int10 code try harder to locate a video bios to work
- around some system bios bugs. (Holger Veit, Egbert Eich)
- 108. Modified fbdevProbe() to return the name string representing
- the chipset. (Egbert Eich)
- 107. Minor fixes to i810 driver (Egbert Eich)
- 106. Fixed format of float numbers in C&T driver. (Jens Taprogge)
- 105. Added support for the NeoMagic 2360. (Gregory Pomerantz)
- 104. Add an xf86UnloadSubModule() entry (temporarily disabled)
- (Marc La France).
- 103. Fix missing symbol "ServerGrabCallback" (Mark Vojkovich).
- 102. Fix XAA problems with CPU-to-screen colour expansion (Marc La France).
- 101. For panel support in the ATI driver, add an entry to the monitor
- section's mode list for the panel's native resolution (Marc La France).
- 100. Fix depth24 acceleration problems with 300SX (Alan Hourihane).
- 99. Update glint driver for fb24_32 and ensure memset used in fb is
- xf86memset when using loader (Alan Hourihane).
- 98. By default, limit ATI 3DRage LTPro's to 200 MHz, instead of 230 MHz
- (Marc La France).
- 97. Remove some leftover INTERNAL_VS_EXTERNAL_PADDING stuff from the
- extensions (Mark Vojkovich).
- 96. Fix a NonTE text bug in XAA where zero-height primitives could be passed
- to the driver (Mark Vojkovich).
- 95. Add CPU-to-screen colour expansion acceleration for Mach64's
- (Kevin Martin, Marc La France).
-
-XFree86 4.0a (6 April 2000)
- 94. Major OS/2 resync (#3859, Holger Veit).
- 93. Fix some 'XFree86 -configure' problems when multiple cards (#3850,
- Paulo Cesar Pereira de Andrade).
- 92. New graphical config tool (xf86cfg) (#3850,
- Paulo Cesar Pereira de Andrade).
- 91. Fix a typo in Xinstall.sh that prevents moving config files to
- /etc/X11 from being optional (#3858, Richard Gooch).
- 90. Add lt_LT.ISO_8859-4 to locale.alias, and update the lt symbols for
- xkb (#3857, Ricardas Cepas).
- 89. Fix the return values of some "xkb action" filters (SetControls and
- RedirectKey) (#3854, Ivan Pascal).
- 88. Fix problems with using "radio group" number one in XKB keyboard
- descriptions (#3853, Ivan Pascal).
- 87. Fix MIT-SHM crash caused by incorrect reference tracking (#3851,
- Keith Packard).
- 86. Updates to allow a build on sparc-linux to succeed (#3849,
- Jakub Jelinek).
- 85. Fix GetImage in XY format in fb at 32bpp (#3848, Keith Packard).
- 84. Add support for 24/32 fb/pixmap format conversion to fb (#3847,
- Keith Packard).
- 83. Update the r128 driver to use fb and fb24_32, and disable
- transparency at 24bpp (#3846, Keith Packard).
- 82. Let the server continue when a font path element in the default path
- is found to be invalid (#3843, Keith Packard).
- 81. Fix parsing of the Group keyword in the DRI section of the config file
- (#3842, Stefan Dirsch, David Dawes).
- 80. Add support for YUV422, YV12, RGB15 and RGB16 XvImages to the C&T driver
- (#3840, David Bateman).
- 79. Change the config file Xkb* option priority. Now, if XkbKeymap is
- set it will be tried first. If a component is present it will override
- components computed from ruls/module/layout/etc (#3839, Ivan Pascal).
- 78. Fix an infinite loop problem that can show up in makedepend (#3838, A.10,
- Jeremy Buhler).
- 77. Fix Overlay support in the TI ramdac module (Alan Hourihane).
- 76. Fix mixup between TVP3026/3030 ramdacs in the ramdac module
- (Alan Hourihane).
- 75. Increase usage of ReadPixmap within XAA (Mark Vojkovich).
- 74. Allow the v4l driver to use offscreen YUV surfaces exported by the
- chipset drivers (Gerd Knorr).
- 73. Change xf86LoadModules() so that it doesn't quit at the first module
- that fails to load (David Dawes).
- 72. SIGIO doesn't work on Linux pipes, so diasble it for input devices
- which are pipes (#3835, Keith Packard).
- 71. Bring the SDK support up to date (#3834, David Bateman).
- 70. Fix an Xlib problem that causes an application crash when inputting
- cyrillic symbols with the koi8-r locale (and other locales with
- long esc-sequences) (#3833, Ivan Pascal, #A.15, Serguei Poliakov, #A.34,
- Stanislav Meduna, #A.40, Rimantas Plaipa, #A.74, Sergei Laskavy).
- 69. Fixes for S3 Trio3D/2X:
- - flickering for some cards (bad FIFO setting from bios).
- - workaround for 8MB ram (ramdac can access only 4MB).
- - adjust clock limits which have been too low.
- (#3832, Harald Koenig).
- 68. Fix v4l problem with a function being called after the module is
- unloaded (#3831, gbritton@light-brigade.mit.edu).
- 67. Fixes for the PPC icache flushing code (#3830, Kostas Gewrgiou).
- 66. Fix for /tmp race installing man pages on OpenBSD (#3829,
- Matthieu Herrb).
- 65. Fix problems building the Xsun and XsunMono servers on
- NetBSD-current/sparc (#3828, Matthieu Herrb).
- 64. Add a comment to site.def about how to move the /etc/X11 contents to
- a directory under ProjectRoot (#3827, R Horn).
- 63. Fix an Xaw bug that shows up when usingn c-mode with xedit on Linux
- (#3824, Paulo Cesar Pereira de Andrade).
- 62. Enable devfs support for the v4l driver (based on #3823,
- Christopher Sekiya).
- 61. Update for README.FreeBSD (#3822, Kazutaka Yokota).
- 60. Bump the video driver ABI minor version because of interface changes
- (now 0.2).
- 59. Disable SilkenMouse when IO/MEM resource sharing means that it cannot
- be reliably used (#382o, Keith Packard and Egbert Eich).
- 58. Fix DGA 1.0 compatibility for mouse events and SetViewport behaviour
- (#3820, Keith Packard).
- 57. Fix the Linux APM code so that the X server doesn't hang the machine
- on suspend (#3820, Keith Packard and Egbert Eich).
- 56. Fix problems that break Overlay support in the glint driver (#3818,
- Michel Dänzer).
- 55. Possible fix for AvailableOptions function and submodule loading
- for the cirrus driver (David Dawes).
- 54. Add an entry for the GeForce to the Cards file (#A.6, Oliver Lau).
- 53. Fix pswrap build problem when cross compiling (#3815, Jim Gettys).
- 52. Fix a typo in itsy.cf (#3814, Jim Gettys).
- 51. SiS driver fixes:
- - 630/540/300 display abnormal for all modes.
- - 630/540/300 cannot enter true color modes.
- - 530/620 1600x1200x8bpp display abnormal.
- (#3807, Can-Ru Yeou, SiS).
- 50. Fix a -configure crash in the nv driver (#3805, Jarno Paananen).
- 49. Rendition driver updates:
- - rename most v_ to verite_ to avoid potential namespace clashes.
- - add support for VBE DDC and "XFree86 -configure".
- - fix PROBE_DETECT issues.
- - Replace a number of ErrorF's with xf86DrvMsg to reduce noise
- when not requested. A number of debugging messages #ifdef'ed also.
- - Option "MTRR" reenabled. Was disabled when acceleration was debugged.
- (#3785, 3808, Dejan Ilic).
- 48. S3virge driver updates:
- - Revert WAITIDLE to cleanly abort a segfaulting imagewrite.
- - Start of GX2 fixes.
- - Add DDC monitor X -configure code.
- - Update copyrights
- (#3783, Kevin Brosius).
- 47. Update XSetWMProperties() to set the WM_LOCALE_NAME property (#3780,
- Peter Novodvorsky).
- 46. Xterm patch #131 (#3777, Thomas Dickey).
- 45. Add some xtest tests to cover some accelerated cases implemented by
- XAA, and fix some Linux/glibc build problems (#3767, Rik Faith).
- 44. Xineramification of XvImage support (Mark Vojkovich).
- 43. By default, cache writes to selected Mach64 MMIO registers and allow this
- cache to be disabled (Marc La France).
- 42. Add detection of Rage128 Mobility to ATI driver (Marc La France).
- 41. Fix a Xinerama GetImage bug that showed up in 24+32 (Mark Vojkovich).
- 40. Fix XAA transparent blits. They are broken in 4.0 (Mark Vojkovich).
- 39. Fix typo in mioverlay that broke resize gravity (Mark Vojkovich).
- 38. Fix PCI/AGP bridge I/O and memory window detection (Marc La France).
- 37. Add Mach64 solid zero-width line acceleration, except for 24bpp
- (Kevin Martin, Marc La France).
- 36. Add Mach64 mono 8x8 pattern fill acceleration (Kevin Martin,
- Marc La France).
- 35. Fix DDC bug (John McCorquodale).
- 34. Fix minClock and maxClock determination in ATI driver (Marc La France).
- 33. A first step at allowing -configure to deal with more than one device per
- driver (Marc La France).
- 32. ATI driver changes: Implement Mach64 engine restriction on virtual
- resolution; Add DPMS support; More DSP calculation fixes; Fix text
- mode restoration bug; Fix Mach64 screen blanking; Don't probe for
- previously claimed VGA compatibles; Fix device section matching for
- Mach64 controllers made by UMC foundry; Miscellaneous cleanups
- (Marc La France).
- 31. Add GLINT 300SX support to the glint driver (Alan Hourihane).
- 30. Remove the unused GLINT Delta code (for now) to re-implement as
- a chipset (like the gamma) from the glint driver (Alan Hourihane).
- 29. Add support for the TVP3026 ramdac to the ramdac module (Alan Hourihane).
- 28. Add support for building and installing HTML versions of the man
- pages (David Dawes).
- 27. Fix some limitation in rman so that it will handle our man pages
- correctly (David Dawes).
- 26. Import rman-3.0.8, for generating HTML versions of the man pages
- (David Dawes).
- 25. ATI fixes to Cards database (Marc La France).
- 24. Fix some man page formatting problems that show up on some platforms
- (David Dawes).
- 23. Fix an 8+24 bug that occured when shared memory pixmaps were used as
- tiles (Mark Vojkovich).
- 22. Support for the Trident CyberBlade/DSTN/i1 (Alan Hourihane).
- 21. Fix Xinerama problems that occured when screen zero was not at (0,0)
- (Mark Vojkovich).
- 20. Add untested support for Matrox SDRAM G400s (Mark Vojkovich).
- 19. Improve memory probing reliability in the Matrox driver (Mark Vojkovich).
- 18. Fix DESIGN doc and XF86Config man page information about the Screen
- entry format in the ServerLayout sections (David Dawes).
- 17. Add missing file permission flags to xf86shmget (Mark Vojkovich).
- 16. Workaround in 8+32 for applications that assume changes to window
- background pixmaps go into effect immediately (Mark Vojkovich).
- 15. Change loader search order to look in more specific subdirectories first,
- thereby avoiding loading 3.3.* module versions (Marc La France).
- 14. Remove the var-* bindist files for platforms that don't use Xvar.tgz
- (David Dawes).
- 13. No Xset.tgz, so remove the set-list bindist files (David Dawes).
- 12. Fix Xinstall's symlink testing for Solaris (/bin/sh's builtin doesn't
- recognise '-L') (David Dawes).
- 11. Update Xinstall.sh to handle the xkb/compiled directory properly in all
- cases, including when there is no Xvar.tgz tarball (David Dawes).
- 10. Add missing cs_CZ.ISO_8859-2 entries to locale.alias (#A.20,
- Cejka Rudolf).
- 9. Updates to Linux-ix86 bindist host.def file.
- 8. Fix installation of iso8859-{1,2,3} Compose files, and fix the czech
- entry in locale.alias (Charles Lopes, #A.62, Stanislav Brabec).
- 7. Fix some problems with layers forgetting that SwitchMode is an
- optional function (Mark Vojkovich).
- 6. Parser bug fix for hexadecimal numbers (Marc La France).
- 5. Fix scanpci (Marc La France).
- 4. DPMS #include fix (Marc La France).
- 3. Fix an event ordering problem in Xinerama (Mark Vojkovich).
- 2. Fix some clipping bugs in the Xv DDX (Mark Vojkovich).
- 1. Remove 24bpp shadowfb support from the NV driver since the hardware
- is not capable of 24bpp (Mark Vojkovich).
-
-XFree86 4.0 (8 March 2000)
-3972. Possible fix for a cirrus driver crash when using -configure
- (David Dawes).
-3971. R128 driver doc update (#3813, Ove Kaaven).
-3970. Update Unicode/ISO 10646 information in the release notes (#3812,
- Markus Kuhn).
-3969. Fix an apm driver crash when using -configure (#3811, Loic Grenie).
-3968. Release notes updates (David Dawes).
-3967. Major updates to the XF86Config man page (David Dawes).
-3966. Update the Cyrix driver documentation (#3810, Richard Hecker).
-3965. Update the APM driver documentation (#3809, Loic Grenie).
-3964. Fix a name clash in XF86OffscreenImageRec (Mark Vojkovich).
-
-XFree86 3.9.18Za (7 March 2000)
-3963. GCC/egcs bug workaround and other more minor ATI fixes (Marc La France).
-3962. Split HasGlide into HasGlide2 and HasGlide3 (David Dawes).
-3961. Enable known gcc optmisation work arounds by default (David Dawes).
-3960. Fix uninitialized screen function (RestackWindow) (#3806, Keith Packard).
-3959. Added DRI users guide documentation (Brian Paul and Kevin Martin).
-3958. Update the -misc-fixed-* BDF fonts. New glyphs have been added and
- some old ones fixed. 10x20.bdf and 9x15.bdf now also cover the
- ISO 8859-6 characters (Arabic), and 18x18ja.bdf covers now all
- characters necessary to display the full ISO-2022-JP-2 repertoire
- (#3799, Markus Kuhn).
-3957. Make sure the fbdevhw module is loaded by the glint driver when it
- is needed, and add some memory barriers to some register access macros
- (#3804, Michel Dänzer).
-3956. Update the glint driver man page and release notes (#3804,
- Michel Dänzer).
-3955. Remove some noisy messages from the mga driver (#3803, Mark Vojkovich).
-3954. The last segment in any zero-width polysegment drawing request to
- a window with more than one clipping rectangle gets dropped in the
- fb code (#3802, Keith Packard).
-3953. Fix the versions for which HasMTRRSupport is enabled for OpenBSD
- (#3800, Matthieu Herrb).
-3952. Fix some "ambiguous" else statements in some of the driver Probe()
- functions (David Dawes).
-3951. Don't make the VBEInit call in the chips driver dependent on the loader
- server (David Dawes).
-3950. Register vbe symbols as "referenced" with the loader in drivers that
- use them (David Dawes).
-3949. Fixed the unresolved VBE symbols in the r128 driver and a crash
- related to referencing vgahw symbols before the module is loaded
- (Kevin Martin).
-3948. Fix a -configure crash in the tdfx driver (David Dawes).
-3947. Fix a mouse driver bug that prevented the X server from seeing the
- mouse button 4 and above when three button emulation is enabled
- (#3773, Yoshihiko Sarumau, Kazutaka Yokota).
-3946. Add NO_GXCOPY to the s3virge driver's imagewrite flags, which fixes
- a crash (#3783, Kevin Brosius).
-3945. Fix a parser build problem for Interactive Unix, and update the
- docs (#3796, Michael Rohleder).
-3944. Fix the r128 hw cursor for big endian machines, and enable building
- the r128 driver for PPC (#3975, Kostas Gewrgiou).
-3943. Update lnxResource.c to allow builds to succeed on PPC platforms
- (#3795, Kostas Gewrgiou).
-3942. B&H Lucidux fonts (#3794, donated by Charles Bigelow, Kris Holmes
- from Bigelow and Holmes Inc, with hinting donated by Berthold Horn and
- Blenda Horn from Y&Y, Inc).
-3941. Doc update for the sis driver (#3793, R Horn).
-3940. Fix an xman build problem on LynxOS (#3792, Thomas Mueller).
-3939. Fix some 24-plane problems with the tga driver, and update the docs
- (#3789, Martin Lucina).
-3938. Rage 128 documentation update (Kevin Martin).
-3937. Fix an unresolved reference to VErrorF from the int10 module
- (David Dawes).
-3936. Reduce some of the noise in the server startup messages (David Dawes).
-3935. Static library objects don't use THREADS_CFLAGS (#3790, Matthieu Herrb).
-3934. Fix a fatal error related to shared memory pixmaps in Xinerama (#3788,
- Mark Vojkovich).
-3933. Fix IA64 build fixes (#3787, Mark Vojkovich).
-3932. Fill out the rendition man page (#3785, Dejan Ilic).
-3931. Update the s3virge man page (#3784, Kevin Brosius).
-3930. Fix the FreeBSD/alpha code to track changes made to the Linux memory
- mapping code (#3782, Doug Rabson).
-3929. Update email addresses for C&T driver authors (#3781, Nozomi Ytow).
-
-XFree86 3.9.18Z (3 March 2000)
-3928. Restrict the X server -configure option to root, and fix a crash
- when the server fails to read the first stage config file that it
- writes when run with this option (David Dawes).
-3927. Modify the parser's xf86WriteConfigFile() function to write the
- file using the real user id when the real and effective ids are
- different (David Dawes).
-3926. Fix a problem with VT switching disabling direct rendering 3D apps
- (Kevin Martin).
-3925. Add an imake parameter called XFree86Devel that can be set in host.def
- to enable devel-specific settings (like more verbose compiler warnings),
- and adjust GccWarningOptions to use this (David Dawes).
-3924. Various doc updates, and don't install out of date docs (David Dawes).
-3923. Fix a thread related problem in the Xv client library (Mark Vojkovich).
-3922. Fix a Xinerama problem with XShapeMask (Mark Vojkovich).
-3921. LynxOS documentation and bindist updates, and an os-support fix (#3779,
- Thomas Mueller).
-3920. Update the wacom input driver to suppor the PL400 model and the
- stroking pen on the Intuos model (#3778, Frederic Lepied).
-3919. -
-3918. -
-3917. Add prototypes for xman, and eliminate most of the compiler warnings
- (#3772, Thomas Dickey).
-3916. Xterm patch #130 (#3771, Thomas Dickey).
-3915. Fix a segfault in XAA caused by reading beyond shared memory bitmaps
- when hardware clipping is not available (Mark Vojkovich).
-3914. Update the mga man page (Mark Vojkovich).
-3913. A Q&D fix for GLX segment violation in loader server (Marc La France).
-3912. Add Mach64 screen-to-screen copy acceleration (Kevin Martin,
- Marc La France).
-3911. IA-64 fixes (Mark Vojkovich).
-3910. Add skeleton man pages for the video and input drivers that don't
- already have one (David Dawes).
-3909. Add man pages for the mouse, keyboard and void input drivers
- (David Dawes).
-3908. Enable building the "void" input driver by default (David Dawes).
-3907. Keep xf86RegisterRootWindowProperty from freeing data it didn't
- allocate (Mark Vojkovich).
-3906. Add an extra file name to the server config file search path --
- XF86Config-M, where M is the major version number (David Dawes).
-3905. DRI megapatch II. This includes DRI enhancements, 3dfx fixes and
- updates, updates Mesa to version 3.3 beta, adds new GLX dispatch
- code and adds i810 2D support (Precision Insight).
-3904. Add SERVER_OVERLAY_VISUALS root window property (Mark Vojkovich).
-3903. Remove unnecessary VGA CRTC unlock/relock in cyrix driver
- (Marc La France).
-3902. Fix ATI driver's 8514/A probe delay when one isn't present
- (Marc La France).
-3901. Changes to -configure: ATI driver interface; Move default monitor
- tolerances to xf86ValidateModes(); Let drivers decide on default depth
- and mode; Don't "special-case" VGA driver. (Marc La France)
-3900. Fix xc/lib/Imakefile for BuildServersOnly (Marc La France).
-
-XFree86 3.9.18b (29 February 2000)
-3899. Fix a bug in lnx_apm.c that causes fd 0 to be closed instead
- of the just opened /proc/apm (#3766, Kars de Jong).
-3898. Fix a SuperProbe build problem on UnixWare 7 (#3765, Thanh Ma).
-3897. Mouse doc updates (#3764, Kazutaka Yokota).
-3896. Speed up dashed lines and conic sections in fb, including changing
- mi to use PolyPoint instead of FillSpans for dashed arcs (#3763,
- Keith Packard).
-3895. Add shadowfb support to the rendition driver (#3762, Dejan Ilic).
-3894. Allow Rage128 driver to Probe DDC too (Alan Hourihane).
-3893. Allow i740 driver to Probe DDC (using vbe) for -configure, and remove
- one liner from tdfx driver to enable it too (Alan Hourihane).
-3892. Make GNU make -j workaround separately configurable (Marc La France).
-3891. Replace remaining occurrences of BuildXTT imake symbol with
- BuildXTrueType (Marc La France).
-3890. Fix some problems using the UTF-8 -locale:
- - Add proper side (GL/GR) handling to the UTF-8 locale
- - No more need to define ISO10646-1 in en_US.UTF-8. It is already
- defined in lcCT.c
- - The fontset loading routines would access invalid memory when
- not all fonts for a fontset were found
- (#3761, Bruno Haible).
-3889. Avoid spurious warnings from the XFree86-Bigfont extension (#3760,
- Bruno Haible).
-3888. Fix an error in the XtAppMainLoop() man page related to its return
- behaviour (#3759, Bruno Haible).
-3887. Make it possible for gcc to compile the Linux int10 module with -fPIC
- (#3758, Bruno Haible).
-3886. Fix typos in fontcacheP.h and RELNOTES (#3757, Bruno Haible).
-3885. Disable stripping programs when they are installed to make it
- easier to debug problems that may show up within libraries (#3756,
- Bruno Haible).
-3884. Add support for reading power management events for NetBSD and
- OpenBSD (#3755, Matthieu Herrb).
-3883. Update Xinstall.sh for NetBSD-current-ELF (#3754, Matthieu Herrb).
-3882. Update NetBSD and OpenBSD bindist files (#3753, Matthieu Herrb).
-3881. Apm driver update, including extending the Rush extension to allow
- initialisation of the Rush chip in a legal way (#3752, Loic Grenie).
-3880. Xterm patch #129 (#3751, Thomas Dickey).
-3879. Add DDC support to the tdfx driver via the vbe interface (#3750,
- Jarno Paananen).
-3878. Enable double scan and interlaced modes for the tdfx and nv drivers
- (#3750, Jarno Paananen).
-3877. Fix 8bpp initialisation problem with the rendition driver (#3749,
- Dejan Ilic).
-3876. Update the XThrStub library version with that in the 3.3.x branch,
- and enable thread-safe libraries for OpenBSD 2.6 and later (#3748,
- Matthieu Herrb).
-3875. Fix some REGION_BROKEN related stuff with the overlays (Mark Vojkovich).
-3874. Fix a bug with unaccelerated pixmap cache uploads when virtualX
- was larger than the displayWidth (Mark Vojkovich).
-3873. Xinerama changes (Mark Vojkovich).
- - extend the Xinerama protocol and change the version number to 1.1.
- - add a new client API in the "Xinerama" namespace with more
- functionality than the previous "PanoramiX" functions.
- - move Xinerama functions out of libXext and into libXinerama.a.
- - some Xinerama bug fixes.
-3872. Add a flags field to the XF86OffscreenImageRec (Mark Vojkovich).
-3871. Fix a malloc/free problem in Xnest on 64-bit platforms (David Dawes).
-3870. Update bindist definition files (David Dawes).
-3869. More installer updates (David Dawes).
-3868. Make -configure generate multihead configs (Alan Hourihane).
-
-XFree86 3.9.18a (25 February 2000)
-3867. Add a preliminary Install document (David Dawes).
-3866. Remove obsolete XF98 and XF68 definitions from xfree86.cf (David Dawes).
-3865. Fix some rendition driver problems (#3746, Dejan Ilic).
-3864. Add build-time support for using fb instead of cfb with the nv
- driver (#3744, Jarno Paananen).
-3863. Add missing xf86_ansic.h include for the nv driver, and avoid a
- gcc 2.96-generated memcpy call in Mesa (#3743, Jarno Paananen).
-3862. Glint driver updates:
- - removed obsolete NoWriteBitmap option
- - reworked pm2_accel.c (cleaned up swapping/mirroring, removed
- obsolete hacks)
- - fixed setting of mode sync flags
- - fixed PolySegmentThinSolidWrapper functions
- (#3742, Michel Dänzer).
-3861. Change the positioning of $(XF86INT10LIB) to fix some static server
- linking problems (#3741, Kevin Brosius).
-3860. Make xclock's -brief option off by default, and document it in the
- man page (#3740, Nozomi Ytow).
-3859. Improve the default converters set in libX11, and use it for all
- "one byte" locales (#3737, Ivan Pascal).
-3858. Some improvements to the generic converters set in libX11, including:
- - some converter optimization
- - actions that can be done once at initialization step moved to
- lcGeneric.c
- - converters from CharSet to MultiByte/WideChar added
- (#3731, Ivan Pascal).
-3857. Add a "showCurrent" resource for Xaw, which makes the list widget
- always show the selected item (#3728, Paulo Cesar Pereira de Andrade).
-3856. Use fb for the fbdev driver, and check if the fbdev modes are suitable
- for the monitor (#3709, Michel Dänzer).
-3855. Add support for finding VT devices for Linux kernels compiled with
- devfs (#3692, Christopher Sekiya).
-3854. Implmenent the Font Type font properties for the Speedo, Type 1 and
- TrueType backends (#3688, Juliusz Chroboczek).
-3853. Add an installation script (Xinstall.sh) for installing binary
- distributions (David Dawes).
-3852. Fix bitmap installation location for xditview (#3724, Harald Koenig).
-3851. Make -probe and -configure deal with vendor-supplied modules again
- (Marc La France).
-3850. Fix an exposure problem that occured in 8+32 mode when the root
- window was in depth 24 (Mark Vojkovich).
-3849. The MGA driver now recognizes a "VideoKey" option that sets the
- default video key for YUV overlays (Mark Vojkovich).
-3848. Add some missing cfbDrawableEnabled checks to the 8+32 and 24+32
- framebuffers (Mark Vojkovich).
-3847. Fix a segfault introduced by the workaround in 3546 below.
-3846. Fix big endian problems in XAA stipple code (Michel Dänzer).
-3845. Fix xf86MatchPciInstances() to not cause r128 to report detection of
- other ATI adapters to -probe (Marc La France).
-3844. Fix bug in xf86MatchDevices() with -probe or -configure (Marc La France).
-3843. More compilation fixups (Marc La France).
-3842. Make -probe and -configure use compiled-in driver lists. Make -configure
- work in the static server (Marc La France).
-3841. A second attempt at fixing DPS compilation (Marc La France).
-3840. Add DDC probing to the -configure option and enable it in the trident
- driver (Alan Hourihane).
-3839. Bring xditview over from the contrib dist.
-3838. Fix drm free list bug (Jeff Hartmann and Rik Faith, Precision Insight).
-3837. Remove deprecated keywords (Kevin Martin).
-3836. Support for YUV offscreen surfaces in Xv and have the MGA driver
- offer them (Mark Vojkovich).
-3835. Reorder generic Xv adaptor registration to allow V4L to use
- driver-managed YUV offscreen surfaces (Gerd Knorr).
-3834. Preliminary IA-64 support (Mark Vojkovich, Johannes Erdfelt).
-
-XFree86 3.9.18 (21 February 2000)
-3833. Bump the minor version number for libXaw since it has some symbols
- that are not present in 6.0.
-3832. Add a "xf86LoaderCheckSymbol" function and use this in drivers to
- check if the vgahw module is loaded before calling vgaHWFreeHWRec()
- (David Dawes).
-3831. Fix some build problems on Interactive Unix (#3739, Michael Rohleder).
-3830. Disable NetBSD aperture driver support by default (#3736,
- Matthieu Herrb).
-3829. Update OpenBSD and NetBSD docs (#3735, Matthieu Herrb).
-3828. Update the VideoBoard98 file (#3734, Isao Ohishi).
-3827. Fix 'X -scanpci' crash (David Dawes).
-3826. Fix the "ev56" gcc option (#3730, Keith Packard).
-3825. Fix some problems with the MMIO macro use of function pointers on
- Alpha (#3729, Keith Packard).
-3824. Fix a Mesa bug involving paletted textures and software rendering
- (#3727, Brian Paul).
-3823. Fix a glx bug involving glFlush() inside glXWaitGL() (#3727, Brian Paul).
-3822. Disable the 3DNow assembler code for now, to avoid problems with
- assemblers that don't recognise the instructions (Brian Paul).
-3821. Fix some problems with the Cards file (#3726,
- Paulo Cesar Pereira de Andrade).
-3820. Eliminate the double mappings added to the r128 driver work around
- earlier limitations, and add the fix necessary to make the R128
- work on an Alpha UP1000 box without hanging the AGP bus during fb
- rendering (#3720, Keith Packard).
-3819. Fix an int10 crash when the BIOS accessed memory beyond the first
- 8kbytes (#3722, Keith Packard).
-3818. Fix PCI memory regions on dense alpha (#3720, Keith Packard).
-3817. Fix an int10 module build problem on big endian machines (#3719,
- Kostas Gewrgiou).
-3816. Remove "lib" from the GLcore module name (David Dawes).
-3815. Set HasPoll to NO for Linux to work around a problem that Netscape
- has when libXt uses poll() instead of select() (#3718, Keith Packard).
-3814. Disable 24bpp fb rendering on big endian machines because it doesn't
- work yet (#3717, Keith Packard).
-3813. Fix an Xlib bug that causes freed memory to be accessed. This is
- exposed by Netscape (#3716, Keith Packard).
-3812. Fix a problem in glxUseXFont() when direct rendering (#3715, Brian Paul).
-3811. A rework of Kevin Martin's Mach64 acceleration. Only solid fills for
- now (Marc La France).
-3810. ATI Mobility fixes (Marc La France).
-3809. A new clock ordering has been reported for Mach32's. Treated as a
- different clock chip for now (Marc La France).
-3808. Build fixups (Marc La France).
-3807. Fix a bug in the code that checks for the presence of a core keyboard
- and pointer (David Dawes).
-3806. Remove unnecessary system headers from Xext/fontcache.c, which were
- causing unresolved symbols for the extmod module on Solaris
- (David Dawes).
-
-XFree86 3.9.17Z (17 February 2000)
-3805. Fix VT switch problem when using shadowfb with the ati driver
- (Marc La France).
-3804. Fix some typos in the mouse driver that affect some of the extended
- PS/2 protocols (Kazutaka Yokota).
-3803. Xterm patch #128 (#3713, Thomas Dickey).
-3802. Fix a crash in the XKB library code (#3712,
- Paulo Cesar Pereira de Andrade).
-3801. Set the right max clock for the Voodoo3 3000 (#3707,
- Yoann Vandoorselaere).
-3800. Fix various build problems (David Dawes).
-3799. Fix all other SaveScreen() functions, and add a helper xf86IsUnblank()
- that drivers can use to interpret the SaveScreen mode values
- (David Dawes).
-3798. Fix GLINTSaveScreen's use of the second argument (#3706, Michel Danzer).
-3797. Glint driver updates: register int10 module's symbols, and add a
- workaround to set the sync flags in supplied modes to make the HW
- cursor work with FBDev (#3650, Michel Danzer).
-3796. Indented xfree86 for better readability. (Egbert Eich)
-3795. Fixed int10 build rules (hope they are right now) (Egbert Eich)
-3794. Changed lnxResources.c to know about differences between ev4/5 and ev6.
- (Egbert Eich).
-3793. xf86pciBus.c restores old registration if attempt fo fix PCI
- registration fails. (Egbert Eich)
-3792. Removed sparse mapping from vidmem.c. (Egbert Eich)
-3791. Changed memory mapping for linux on Alpha:
- - removed separate mapping functions for sparse and dense.
- - allow for 32bit read/write to access memory directly without
- going thru a function call if Jensen support is not enabled
- (Egbert Eich)
-3790. Fix for dead keys in XKB Norwegian keyboards (#3702, 3703,
- Preston Brown).
-3789. Synced with latest Mesa 3.3 sources (Brian Paul, Precision Insight).
-3788. Bug fixes for DRI (Kevin Martin, Precision Insight).
-3787. Bug fixes for tdfx DRI driver (Daryll Strauss, Precision Insight).
-3786. Cleanups for the contrib programs recently moved into the main xc/
- tree (#3701, Bruno Haible).
-3785. Small lynx.cf fix (#3700, Thomas Mueller).
-3784. Initialise MMIO32 for r128 when using fbdev (#3699, Kostas Gewrgiou).
-3783. Avoid most lockups for Trio3D startup (s3virge driver) (#3698,
- Harald Koenig).
-3782. Fix unresolved and conflicting symbols in X-TT, and fix the broken
- BIG5 converter (#3697, Takuya Shiozaki).
-3781. Update README.fonts (#3696, Juliusz Chroboczek).
-3780. Add dot, line, arc accelerations for 24bpp in fb, and cleanup most
- warnings (#3695, 3711, Keith Packard).
-3779. Make it possible to build the r128 driver with support for fb
- (disabled by default) (#3693, Keith Packard).
-3778. Fix a problem with lnx_ev56 (#3693, Keith Packard).
-3777. Fix references to noPanoramiXExtension when Xinerama is not built
- (#3691, Christopher Sekiya).
-3776. Fix possible races in xauth and libXau (#3690, 3694, Colin Phipps).
-3775. Fix some Xv and PC-98 init bugs in the apm driver (#3689, Loic Grenie).
-3774. Fix SVR4.0 build problem in the cyrix driver (David Dawes).
-3773. Fix SVR4.0 build problems in the sis driver (#3687, Takaaki Nomura).
-3772. Change CppProgram to /usr/bin/cpp for FreeBSD.
-3771. DPS build fixes (#3686, Juliusz Chroboczek, David Dawes).
-3770. Back out the pMga->PointerMoved change.
-3769. Fix DRI/DRM code to build tdfx driver and turn off building MGA DRI
- support until the next code merge (Kevin Martin).
-3768. Attempt to first read the PLL parameters in the BIOS from PCI space,
- then fallback to 0xc0000, and then fallback to default PLL parameters
- in r128 driver (Kevin Martin).
-3767. Fix compiler warnings in r128 driver (Kevin Martin).
-
-XFree86 3.9.17f (12 February 2000)
-3766. Moved Alpha ev5/56 read dense functions to a separate file.
- (Egbert Eich)
-3765. Improved RAC support for asynchronous events (not yet enabled).
- (Egbert Eich)
-3764. Fixed a bug that prevented restoration of PCI registers after
- a VT switch. (Egbert Eich)
-3763. Fixed support for BIOS reading on multiple chipset cards. (Egbert Eich)
-3762. Separated stub functions from pcitweak. (Egbert Eich)
-3761. Rewrote scanpci to use libxf86_os.a. (Egbert Eich)
-3760. Improved server state notification callback handler to meet the
- needs of multi-head dri. (Egbert Eich)
-3759. Mga fix for pMga->PointerMoved init (#3684, Isao Ohishi).
-3758. Import FreeType 1.3.1 and X-TrueType 1.3, and incorporate the
- font cache extension (#3653, Akio Morita, X-TrueType team, Nozomi Ytow).
-3757. Add a stub for xf86OSPMOpen() for OS's that don't have their own
- (David Dawes).
-3756. Move the other XFree86-supported contrib programs to the main xc/
- tree (except for xditview) (David Dawes).
-3755. Add a dummylib that provides functions required by libxf86_os. This
- makes it easier for utilities (like scanpci and pcitweak) to use
- libxf86_os (Egbert Eich, David Dawes).
-3754. Some bug fixes and PC-98 enhancements for the apm driver (#3685,
- Loic Grenie).
-3753. GL build fix (#3683, Christopher Sekiya).
-3752. Xterm patch #127 (#3682, Thomas Dickey).
-3751. Cyrix MediaGX driver. Not very usable yet (#3681, Richard Hecker).
-3750. Add DPS libraries. Building these is disabled right now because
- some more work is needed on the Imakefiles and portability issues
- (#3645, 3680, Juliusz Chroboczek).
-3749. Fix the mga driver to work with the MGA 2064W on Alpha architectures
- (#3679, Doug Rabson).
-3748. Support for building XFree86 on FreeBSD/alpha (#3678, Doug Rabson).
-3747. Restore viewport correctly on VT switch for the s3virge, and clean
- up the logging messages (#3676, Kevin Brosius).
-3746. Don't try to program the keyboard repeat rate directly for Linux/98
- (#3675, Takaaki Nomura).
-3745. Update information about mouse support in 3.9.18 (#3673, 3674,
- Kazutaka Yokota).
-3744. Remove the "Extended PS/2 mouse protocol" class from the supported
- interfaces in FreeBSD, since they are already handled at the
- device driver level (#3672, Kazutaka Yokota).
-3743. Merge Kevin Hendricks fbdev/ppc patches in r128, fix wrong order
- in cursor init (#3671, Kostas Gewrgiou, Kevin Hendricks).
-3742. Fix a problem building xedit/realpath.c that shows up on Linux
- (#3670, Andrew Aitcheson).
-3741. Fix a build problem for lcUTF.c on Linux/libc5 (#3668,
- Andrew Aitcheson).
-3740. Make sure the cursor is positioned correctly after mode changes
- (#3667, Harald Koenig).
-3739. Add support for the SiS 630/540/300/530/620 to the SiS driver with
- hw acceleration. Support for the tvout function is included for
- the 630/540/300 (#3666, Can-Ru Yeou, SiS).
-3738. Fix some build problems with the apm driver on SVR4.0 (David Dawes).
-
-XFree86 3.9.17e (11 February 2000)
-3727. Move xman into the main xc/ tree.
-3726. The leak-tracing allocator now works on 64-bit machines, and update
- the server to allow the use of the leak-tracing allocator (#3665,
- Keith Packard).
-3725. Fix fb so that it works with 64-bit pointers and works on big-endian
- machines (#3665, Keith Packard).
-3724. r128 driver updates to work on Alpha UP1000 (ev6). The changes follow
- recommendations from Kevin Martin and Egbert to try to make them
- reasonable (#3665, Keith Packard).
-3723. Modify mfb, cfb and mi so that they now do all accesses 32-bits at
- a time instead of 64 (on 64-bit platforms). This eliminates image
- repadding in DIX (#3665, Keith Packard).
-3722. Bug fixes, comments and cosmetics for the input method code:
- - Add prefix "_Xim" to two input specific functions.
- - Remove buggy function ConvertUCS4toUTF8 (bug: UCS-4 never contains
- surrogates), and replace with simpler code. Based on a patch by
- Ivan Pascal.
- - Fix for _XimLookupMBText and _XimLookupWCText in multibyte locales
- Patch by Ivan Pascal.
- (#3664, Bruno Haible, Ivan Pascal).
-3721. Fix ugly code in _XlcCreateDefaultCharSet and add comments (#3663,
- Bruno Haible).
-3720. Introduce a UTF-8 locale, including conversion from/to compound text.
- This is not fully functional yet (#3662, Bruno Haible).
-3719. Resturcutre lib/X11/lcCt.c so that it is more understandable. Update
- the default_ct_data array. Fix bugs in _XlcCheckCTSequence and cstoct,
- and fix the UTF-8 introducing sequence (#3661, Bruno Haible).
-3718. Fix parsing of resource files so that it works better in multi-byte
- locales (#3660, Bruno Haible).
-3717. Add commens to the libX11 locale files, declare _XlcInitLoader and
- XlcConverter and a portability fix for dlopen() (#3659, Bruno Haible).
-3716. Fix an indentation problem in Xlib that was the origin of a malloc/free
- bug (#3658, Bruno Haible).
-3715. Fix a bug in the locale file parsing routines (#3657, Bruno Haible).
-3714. Create a locale en_US.UTF-8. This isn't fully functional yet, but
- parts of Xlib work with it (#3657, Bruno Haible).
-3713. Modify xman to search for man pages in a locale-specific directory
- first (#3652, Paulo Cesar Pereira de Andrade).
-3712. Have xedit use the BSD realpath() provided instead of the standard
- Linux one because the Linux one behaves differently (#3652,
- Paulo Cesar Pereira de Andrade).
-3711. Fix some typos in the Monitors and Cards files (#3652,
- Paulo Cesar Pereira de Andrade).
-3710. Disable SilkenMouse in the C&T driver until the memory transfer
- sync problem is solved (#3654, Nozomi Ytow).
-3709. -
-3708. Don't "normalise" module names in xf86LoadModules (David Dawes).
-3707. Apm driver updates, including updates to the xf86Rush extension (#3649,
- 3655, Loic Grenie).
-3706. Small cosmetic patch to glide driver (#3648, Loic Grenie).
-3705. Fix a bug in the way the BIOS mapping size is calculated in
- in the ReadBIOS functions (#3647, Loic Grenie).
-3704. Add ReputImage function to the Xv DDX to prevent flickering during
- window moves on some hardware (Loic Grenie).
-3703. Fix a bigfont extension build problem on Interactive UNIX (#3646,
- Michael Rohleder).
-3702. Fix a bigfont extension build problem on NetBSD and OpenBSD (#3644,
- Matthieu Herrb).
-3701. USB mouse support for *BSD (enabled for OpenBSD) (#3644, 3656,
- Matthieu Herrb).
-3700. Update README.fonts (#3643, Juliusz Chroboczek).
-3699. i810 driver and preliminary DRI support for i810 and mga (#3638,
- Keith Whitwell, Precision Insight).
-3698. 8+24 support upgraded to a non-destructive overlay (Mark Vojkovich).
-3697. Modify XAA to allow image rendering into DMA buffers (Mark Vojkovich).
-3696. Fix some SVR4.0 build problems (#3642, 3653, Satoshi Kimura).
-3695. Add XErrorDB entries for the DPS extension (#3639, Juliusz Chroboczek).
-3694. Fix a bigfont extension build problem on Linux/libc5 (#3637,
- Takaaki Nomura).
-3693. Extend the Mouse "ZAxisMapping" option so that it can accept
- (optionally) four arguments. The additional two are for mice that
- have two wheels or whose scroll device has two axes) (#3636, 3641,
- Kazutaka Yokota).
-3692. Add support for some new mice (Microsoft IntelliMouse Explorer,
- Genius NetScroll Mouse Optical, IBM ScrollPoint) and serial PnP
- IDs (A4 Tech 4D/4D+, MouseSystems SmartScroll, Logitech Cordless
- MouseMan Wheel, 8D Scroll mouse) to the mouse driver, and update
- the mouse documentation (#3636, 3640, 3641, Kazutaka Yokota).
-3691. Xterm patch #126 (#3635, Thomas Dickey).
-3690. Fix for the Japanese PC-98 with GA-RUSH/6PCI in the apm driver (#3634,
- Isao Ohishi).
-3689. Update man pages and server messages for -xf86config usage, and
- FatalError when an unsafe path is given by a non-root user (#3633,
- Mark Montague).
-3688. Add support for the Melco WHP-PS8 Permedia2-based card for Japanese
- PC-98 machines to the glint driver (#3354, Isao Ohishi).
-3687. Avoid segv in new Linux apm support (David Dawes, Michel Danzer).
-3686. Fix unresolved symbols in the linux int10 module and the GLcore module
- (David Dawes).
-3685. Add xkb support plus new (XFree86-specific) keysym names for the
- HP and Logitech iTouch "Internet" keyboards (David Dawes).
-3684. Fix a vbe-related build problem on Solaris (David Dawes).
-
-XFree86 3.9.17d (9 February 2000)
-3684. XKB could crash with keycodes larger than the range given in the
- keycodes file (David Dawes).
-3683. Allow the passing of all extended keycodes, which makes it possible
- to access keys on "Internet" keyboards (David Dawes).
-3682. Added support for saving/restoring access state during
- asynchronous events. Added code to make xf86EnableAccess()
- atomic for asynchronous events. (Egbert Eich)
-3681. Modified xf86EnterServerState() to avoid any unnecessary
- disabling of resources during state transition. (Egbert Eich)
-3680. Added function callback registration. Drivers can register
- callback functions to be notified of the start/end of a
- resource transition. (Egbert Eich)
-3679. Added support for OS specific Pci address windows. (Egbert Eich)
-3678. Added more debug traps to xalloc.c. Added support to peek/poke
- MMIO registers and fb addresses from a debugger. (Egbert Eich)
-3677. Changed resource registration to use CPU space addresses
- instead of BUS space addresses. Added flag to resource type
- to mark addresses in bus address space. (Egbert Eich)
-3676. Extended host2bus and bus2host address conversion for PCI
- addresses to PIO. (Egbert Eich)
-3675. Improved subset and intersect handling for resources ranges.
- (Egbert Eich)
-3674. Modified mapping of V_RAM in int10/generic.c. (Egbert Eich)
-3673. Updated INT10.HOWTO. (Egbert Eich)
-3672. Added support for VBE DDC read out to s3v driver. (Egbert Eich)
-3671. Added xf86SetDDCProperties() to glint, chips, neomagic, s3v
- and r128 driver. (Egbert Eich)
-3670. Fixed problems with virtual screen size != real screen size
- when using shadow fb in mga driver. (Egbert Eich)
-3669. Fixed handling of virtual != real screen in shadowfb. (Egbert Eich)
-3668. Prevent reinitialization of pMga->PointerMoved in mga_driver.c
- on server reset. (Egbert Eich).
-3667. Added int10 support to r128 driver. (Egbert Eich)
-3666. Attempt to make apm driver 64bit clean. (Egbert Eich)
-3665. Added options to swap x/y coordinates on mice. Useful when
- using rotate on notebooks. (Egbert Eich)
-3664. Modified memory mapping on AXP to map entire MMIO space
- at once. (Egbert Eich)
-3663. Fixed handling of sparsely mapped MMIO on AXP increasing
- performance considerably. (Egbert Eich).
-3662. Added non-barrier versions of MMIO_OUTxx. (Egbert Eich).
-3661. Added support for new AXPs that don't have sparse mapping.
- (Egbert Eich)
-3660. Separated high and low level handling in ModeInit() and
- Restore() in cirrus driver. (Egbert Eich)
-3659. Made chipset specific record subrecord of vendor record
- in cirrus driver. (Egbert Eich).
-3658. Made some improvements to acceleration code of Cirrus Alpine driver.
- (Egbert Eich)
-3657. Added support for 64-bit cursor for Cirrus Alpine. (Egbert Eich)
-3656. Fixed cirrus driver to handle MMIO access using MMIO_IN/OUTxx
- (Egbert Eich)
-3655. Fixed xf86HWCurs.c to handle 32-bit cursors on 64-bit machines
- correctly. (Egbert Eich)
-3654. Added rotate support to neomagic, s3v, chips and cirrus
- driver (Egbert Eich)
-3653. Added shadow fb support to s3v and cirrus driver (Egbert Eich)
-3652. Fixed sig11 problem after server reset caused by the new
- extension loading code. (Egbert Eich)
-3651. Attempted to fix build problems with int10 (Egbert Eich)
-3650. Added a baseclass/subclass override to xf86PciInfo.h.
- This override is evaluated in xf86pciBus.c (Egbert Eich)
-3649. Changed memory mapping in int10 support for Linux to use SYSV
- IPC shm instead of mapping /proc/self/mem (Egbert Eich)
-3648. Added APM support for portable systems. (Egbert Eich)
-3647. XFree86-Bigfont extension that provides efficient client access to
- the complete glyph metrics, using shared memory where possible/available
- or transmitting the data in a compressed format otherwise (#3626,
- Bruno Haible).
-3646. Update locale support for Celtic languages (Welsh, Irish, Scots, Manx
- and Cornish), and include a compose file for ISO-8859-14 (#3612,
- Alastair McKinstry).
-3645. Add a Slovenian xkb symbols file (#3629, Marko Samastur,
- Primoz Peterlin).
-3644. The new extension init code didn't handle server resets (#3628,
- Ebgert Eich).
-3643. xf86GetPciSizeFromOS() didn't close the file it opened (#3627,
- Loic Grenie).
-3642. Export frexp() and ldexp() to modules (#3624, 3631, Juliusz Chroboczek).
-3641. Fixes for CTEXT handling in Xlib:
- - rewrite CTEXT from/to converters for standard compliance
- - CTEXT parser now understands UTF-8 (and other DOC) sequences and
- performs only CTEXT sequence recognition
- - detailed charset information parsing moved to the procedure that
- adds 'charset object'
- - Some actions for preparing 'charset object' moved to lcCharSet.c
- (where it can be done easily)
- - XlcAddCT call added to XLC_LOCALE file parser to allow recognition
- of charsets that are described only in those files (ie, not
- in internal Xlib tables)
- (#3624, Ivan Pascal).
-3640. Convert the nv driver to use MMIO to access the VGA registers
- instead of normal I/O ports. Also riva_hw is updated to the
- same version as is in 3.3.6 (#3620, Jarno Paananen).
-3639. DRI and Mesa update (#3619, Brian Paul, Precision Insight).
-3638. Fix a problem with the tdfx driver that can result in a lockup
- (#3618, Nicholas Brealey).
-3627. Fix some PPC inline assembler in compiler.h (#3617, Kostas Gewrgiou).
-3626. Add support for the S3 Trio3D/2x and Trio3D chips to the s3virge
- driver (#3616, 3623, Harald Koenig).
-3625. Fix some build problems on Solaris 8 with gcc (#3615, Richard Coley).
-3624. Fix an Xserver core dump that can happen when xdmcp-related command
- line options have missing arguments (#3614, Harald Koenig).
-3623. Xterm patch #125 (#3611, Thomas Dickey).
-3622. Add a Type1 version of the cursor font (#3610, Juliusz Chroboczek).
-3621. Add Trident Cyber9540 detection (not tested) (Alan Hourihane).
-3620. Fix horizontal/vertical line drawing for r128 driver (Kevin Martin).
-3619. Update -probe option for all bus types (Alan Hourihane).
-3618. Fix primary card detection for -configure (Alan Hourihane).
-3617. Modularize the mouse driver (Alan Hourihane).
-3616. Fix Cyber9388 detection in trident driver (Alan Hourihane).
-3615. Implement some of the (installed) path restructuring that was
- discussed back in April 1999 (David Dawes).
-3614. Remove duplicated code in XKB and InputMethod processing (#3396,
- Ivan Pascal).
-
-XFree86 3.9.17c (30 January 2000)
-3613. Add DDC1 and DDC2 support to the NVIDIA driver (#3608, Jarno Paananen).
-3612. Make -configure multihead aware, add loading of all extension modules,
- setup Layout sections (Alan Hourihane).
-3611. XTextPropertyToTextList doesn't work if incoming XTextProperty has
- encoding field other than STRING or COMPOUND_TEXT (#3606, Ivan Pascal).
-3610. Fix a bug in the X11 generic converters that prevents them from
- converting the last character in a string (#3605, Ivan Pascal).
-3609. Fix a bug in _XOpenLC() that was causing unallocated memory to be
- freed (#3604, Ivan Pascal).
-3608. Xterm patch #124 (#3603, Thomas Dickey).
-3607. Fixes to the character set conversion tables (#3602, Bruno Haible).
-3606. Reduce the data section of libX11 by 30% by proper use of
- 'const' for tables (#3601, Bruno Haible).
-3605. Fix a bug in ConvertUCS4toUTF8() in libX11 (#3600, Bruno Haible).
-3604. Fix some fb macros that gcc accepted but which weren't legal ANSI C
- (#3599, Keith Packard).
-3603. Update micmap to allow the drivers to specify the r/g/b mask values
- (3598, Keith Packard).
-3602. Disable the cfbCopyPlane functions on big endian machines, and fix
- a cfb24 bug (#3597, David Bateman).
-3601. Add a CheckExtension() function that can be called to check if an
- extension has been initialised (David Dawes).
-3600. Allow extensions to specify which other extensions must be
- initialised first, and sort the initialisation order according to
- this information (David Dawes).
-3599. Force BIOS to be read from 0xc0000 for r128 driver (Kevin Martin).
-3598. Add a XXXAvailableOptions to DriverRec which allows passing available
- options back to the -configure option (Alan Hourihane).
-3597. Avoid PCI-PCI bridges with an unexpected header type, which avoids
- an infinite loop that can show up in the PCI bus enumeration code
- (Egbert Eich).
-3596. More compilation fixups (Marc La France).
-3595. Add '###' (Comment) line capability to the parser (Alan Hourihane).
-3594. Fix the laguna driver to return MOD_CLASS_NONE (Alan Hourihane).
-3593. Add the 'extmod' module to the -configure option (Alan Hourihane).
-3592. Modify the extension loading code so that he core server no longer
- needs to be aware of all extensions that can be loaded (David Dawes).
-3591. Remove XExtensionVersion from XPrint headers (Dirk Hohndel, from 3.3.5).
-3590. Fix a build problem with the static server related to the -configure
- option code (#3596, Takaaki Nomura).
-
-XFree86 3.9.17b (24 January 2000)
-3589. Add a rule to lnxdoc.rules for maintainers to use to update the
- formatted docs (David Dawes).
-3588. Add new -configure option to generate a clean XF86Config without the
- need for a config tool. But hopefully could be used with XF86Setup.
- (Needs some OS based updates - tested only on linux so far)
- (Alan Hourihane).
-3587. Fix 64 bit problem in the Xv client header files (Mark Vojkovich).
-3586. Change the default charset for et_EE from ISO8859-4 to ISO8859-15,
- which conforms with the upcoming standard EVS8:1999
- (http://www.eki.ee/itstandard/) (#3595, Ville Hallik).
-3585. Fix a bug in XKB's CapsLock handling for some non-Latin1 locales,
- and add support for ISO8859-15. Without this, CapsLock only affects
- Latin1 keysyms and has no effect on scaron and zcaron, for example
- (#3595, Ville Hallik).
-3584. Add Estonian keyboard support to XKB (#3595, Ville Hallik).
-3583. Hack to disable optimisation when building Xext/xf86vmode.c on FreeBSD
- 4.0 to avoid a compiler bug (David Dawes).
-3582. Disable the hardware cursor in the tdfx driver when the screen is
- too wide for the hardware to properly position the cursor on the
- right side of the screen (#3593, Scott Bertin).
-3581. Fix a typo in panoramiXprocs.c that shows up on SVR4.0 (#3592,
- Takaaki Nomura).
-3580. Xterm patch #123 (#3591, Thomas Dickey).
-3579. Add a "Status" document that lists and compares the driver status of
- 4.0 and 3.3.x (needs a lot more input) (David Dawes, plus contributions
- from the devel team).
-3578. Fix a problem with the EmulateTimeout line in the file generated
- by xf86config, and have xf86config create /etc/X11 if it doesn't
- already exist (David Dawes).
-3577. Put an OS-independent version of the int10 module/library in
- xfree86/int10, but still allow an OS-specific version to override
- it (David Dawes).
-3576. Import a minimal subset of the x86emu 0.6 distribution (David Dawes).
-3575. Register the required/referenced int10 symbols in the nv driver
- so that there are no warnings on platforms that don't have this
- module (David Dawes).
-3574. Don't probe for PC98 architecture on Solaris (David Dawes).
-3573. Fix some SVR4.0 build problems related to bzero() (David Dawes).
-3572. Rewrite the way Xinerama deals with events (Mark Vojkovich).
-3571. Fix VT switching problem in shadowfb (Marc La France).
-3570. Initialize DST_X_DIR and DST_Y_DIR for solid filled rects and for
- horizontal and vertical lines to fix line drawing problems, and
- initialize ScanlineCPUToScreenColorExpandFillFlags to fix font
- corruption problems in r128 driver (Kevin Martin and Rik Faith).
-3569. Fix BIOS reading problem with r128 driver (Kevin Martin).
-3568. Fix imake failure in Mesa Imakefile (Kevin Martin).
-3567. Change trident driver to use fb instead of cfb and make DDC1 info
- available to the primary card (Alan Hourihane).
-3566. Fix an XAA text corruption problem introduced by the endian fix
- in 3.9.17a (David Dawes).
-
-XFree86 3.9.17a (21 January 2000)
-3565. Update linux.cf to use the kernel header files on Debian rather than
- those packaged with the libc headers (#3544, Simon Richter).
-3564. Add an item to the default twm menu to open an xterm window (#3584,
- David Brownlee).
-3563. Update Spanish locales in xc/nls (#3583, Fernando Herrera).
-3562. Fix I2C/DDC for S3 ViRGE (#3582, Harald Koenig).
-3561. Update the fbdevhw module for some new cards (#3579, Kostas Gewrgiou).
-3560. Fix interpret_vdif.c for big endian machines (#3578, Kostas Gewrgiou).
-3559. Minor fix to DDC to find monitor descriptions in EDID v1.1 (#3576,
- Andrew Aitchison).
-3558. Allow silken mouse to work when building on Linux without DRI (#3574,
- Keith Packard).
-3557. Only do the kbdrate I/O on architectures that support it (#3573, 3581,
- Kostas Gewrgiou, Branden Robinson).
-3556. Fix XAA colour expansion for big-endian architectures (#3572,
- Kostas Gewrgiou).
-3555. Update QNX support (#3570, Frank Guangxin Liu).
-3554. Fix "controlization" in XLookupString for chars > 127 (#3569,
- Ivan Pascal).
-3553. Take advantage of FB speedups in Tiny-X (#3568, Keith Packard).
-3552. Speed up FB and do 32bit accesses instead of 64bit accesses
- (#3567, Keith Packard).
-3551. Eliminate saving the contents of the screen durint VT switching
- (#3562, Keith Packard).
-3550. Make using fb easier for driver writers (#3561, Keith Packard).
-3549. Fix TCP font server connections (#3560, Keith Packard).
-3548. Implement the "OverclockMem" option for the Millennium and Millennium
- II (#3558, Andrew Aitchison).
-3547. Speed up some FB performance problems (#3557, 3559, 3560, 3588, 3589,
- Keith Packard).
-3546. Work around a bad code generation bug in gcc 2.7.2.3 that shows up
- in XAA (#3550, Rik Faith).
-3545. Add a -brief option to xclock to show only hours and minutes when in
- digital mode (#3549, Keith Packard).
-3544. Fix some dead key problems with xkb symbols for Swiss French and
- Swiss German keyboards (#3546, Charles Lopes).
-3543. Add drm_poll to fix SIGIO problem in the drm kernel modules, and change
- drm to use /{proc,dev}/dri to avoid conflicts with /{proc,dev}/graphics
- (Rik Faith and Daryll Strauss).
-3542. Fix some fb/glint-realted static build problems (Marc La France).
-3541. Add 3.9.17 xterm information to the RELNOTES (#3541, Thomas Dickey).
-3540. Fix some 64-bit problems in the GLX code (#3539, Dave Gilbert).
-3539. Execute the GLINT delta code in the Probe for each instance of
- hardware found, not just the first one (#3534, Michael Rohleder).
-3538. Allow mesa to build on an Alpha (#3533, Matt Grossman).
-3537. Fix glint/Imakefile so that the correct fb.h is included, and rename
- the private fb.h file in fbdevhw so that it won't be mistakenly included
- instead of the one in Xserver/fb (David Dawes).
-3536. Fix some (unused) bad usages of InstallDynamicModule (David Dawes).
-3535. Make the Glint driver use the new fb module and fix correct operation
- for 24bpp support (Alan Hourihane).
-3534. Fix for various compilation glitches (Marc La France).
-3533. Fix some Segmentation faults with NULL pointers in xf86Config.c
- (Alan Hourihane).
-3532. Update some drivers to respect the PROBE_DETECT flag and update
- xf86DoProbe to print out the supported chipset list (Alan Hourihane).
-3531. Update Trident driver to fix Clock source for 9440 chips and allow
- linear framebuffer mapping for nommio (Alan Hourihane).
-3530. Fix fb for module compiling and ifdef fbcmap for now (Alan Hourihane).
-3529. Add Cyber9397 and Cyber9397DVD PCI ID detection to trident driver
- (Alan Hourihane).
-3528. Fix Multiple MX RegisterResources with RAC in glint
- driver (Alan Hourihane).
-3527. Update loader for Xinerama changes (Alan Hourihane).
-3526. Massive Xinerama rewrite (Mark Vojkovich).
- - Change the way it deals with resources.
- - Remove broken Xinerama code from the multibuf extension.
- - Add support for shared memory pixmaps.
- - Lessen Xinerama's impact on DIX.
-3525. Point and arc acceleration improvements for the NVIDIA driver
- (Mark Vojkovich).
-3524. MGA acceleration modifications to prevent pci retries during
- color expansions (Mark Vojkovich).
-
-XFree86 3.9.17 (31 December 1999)
-3523. Clean up bindist directories for the loader server (Robin Cutshaw).
-3522a. Fix return values in PsImageText8() and PsImageText16() (#3535,
- Takaaki Nomura).
-3522. Old-style DGA keyboard input fix (#3536, Keith Packard).
-
-XFree86 3.9.16Za (29 December 1999)
-3521. Fix HW cursor on rendition V2K (#3532, Dejan Ilic).
-3520. Sync wacom driver with 3.3 (Frederic Lepied).
-3519. Resolve missing symbol in TDFX driver (#3531, Dave Gilbert).
-3518. Allow TDFX driver to build on Linux-axp (#3530, Dave Gilbert).
-3517. Fix Linux-axp compile problem (#3529, Dave Gilbert).
-3516. Jumbo Tiny-X patch with Itsy support (#3527, Keith Packard).
-3515. Turn off debug messages in font client code (#3525, Keith Packard).
-3414. Allow colormap privates to be allocated before default colormap
- (#3524, Keith Packard).
-3413. Make Xserver/fb work with R6.3 server and with MSB cpu
- (#3523, Keith Packard).
-3412. Compress built-in fonts (#3522, Keith Packard).
-3411. Fix ct_driver for static server (#3521, Takaaki Nomura).
-3410. Fix the last Xaw user of XtOffset (#3520, Keith Packard).
-3409. FreeBSD-current compile fix (#3519, Eric Anholt).
-3408. Xterm patch #122. (#3517, Thomas Dickey).
-3407. Remove duplicate symbol from loader (#3516/3528,
- Jarno Paananen/Nicholas Brealey).
-
-XFree86 3.9.16Z (28 December 1999)
-3406. Temporary fix for building linux platform without glide (Robin Cutshaw).
-3405. Fix unresolved symbols for the loader (#3501, Matthieu Herrb).
-3404. Fix compiles on non-NetBSD systems (#3499, Matthieu Herrb).
-3403. Fix XKB XlookupString usage (#3511, Ivan Pascal).
-3402. Use ForceLatin1Lookup mode after XmbLookupString/XwcLookupString
- (#3510, Ivan Pascal).
-3401. Export symbols for SGI driver (#3505, Terence Ripperda).
-3400. Fix problem with compilation of static server on SVR4.0
- (#3497,3514 Takaaki Nomura).
-3399. Fix where using bitsPerPixel from screen pixmap to use drawable,
- fix default visual class search for fallback visual, fix pixmap
- privates allocation, change screen init sequence so that the
- calling function is responsible for init of backing store
- (#3495, Keith Packard).
-3398. Fix more problems between the X and font servers (#3493, Keith Packard).
-3397. Fix util/memleak to work on linux/x86 (#3492, Keith Packard).
-3396. Add DPS support hooks (#3491, Juliusz Chroboczek).
-3395. Add QNX4, Neutrino support (#3489, Frank Guangxin Liu).
-3394. Add ATI Rage 128 Pro PF support to r128 driver (#3488, Rik Faith).
-3393. AutoRepeat fix for xf86config (#3485, Harald Koenig).
-3392. Cirrus driver split for Laguna and Alpine (#3484, Derek Fawcus).
-3391. Mga_dac3026 rev A/B fixes (#3427, Mark Montague).
-3390. Jumbo font patch. This updates the bdf/misc fonts to the
- latest ISO versions (#3429+updates, Markus Kuhn).
-3389. Fix a problem with no Xv encodings being reported (Mark Vojkovich).
-3388. Update Xv driver interface docs (Mark Vojkovich).
-
-XFree86 3.9.16f (15 December 1999)
-3387. Fix posix compliance problem in Xserver/os/utils.c
- (Robin Cutshaw/Keith Packard).
-3386. Fix for os2_bios (#3483, Holger Veit).
-3385. Enhance DK keyboard support (#3481, Keld Simonsen).
-3384. Xv client library documentation (#3480, Mark Vojkovich).
-3383. Rendition microcode cleanup, accel fix, int10/ddc support,
- pixmap cache fix, doc update (#3479, Dejan Ilic/Marc Langenbach).
-3382. Reverse kbdrate patch (#3478, Harald Koenig).
-3381. Add Xv support to tga driver (#3473, Matt Grossman).
-3380. Add ViRGE/MX and BIOS probing to the s3virge driver (#3470,
- Harald Koenig).
-3379. Install NetBSD aperture driver in /usr/local until added to
- the core O/S (#3466, Matthieu Herrb).
-3378. Add QNX/Neutrino support (#3464, Frank Guangxin Liu).
-3377. DRI megapatch. This moves mesa to xc/extras, updates Mesa to
- version 3.2, adds full support and fifo code for 3dfx hardware,
- and updates the device driver to work with Linux 2.3 kernels
- (#3463, Daryll Strauss).
-3376. Fix dynamic loading on the alpha platform (#3459, Hannes Reinecke).
-3375. Add Xinerama option to the serverlayout section of the config file
- (#3458, Joe Moss).
-3374. Add accelerated line support, clean up accel code, and other fixes
- for the tga driver (#3453, Matt Grossman).
-3373. Restore colormap on exit in nv driver (#3452, Thomas Mueller).
-3372. Generalize the SIGIO way of reading input data (#3450, Frederic Lepied).
-3371. Fix missing quotes in Xt docs (#3443, Matthieu Herrb).
-3370. Add request bounds checking for xfs (#3449, Keith Packard).
-3369. Fix problem where font library fails to match bitmap instances
- (#3448, Keith Packard).
-3368. Change font client code to recover from font server hangs/crashes
- and reduce memory fragmentation (#3446, Keith Packard).
-3367. Allow MAXCLIENT to be any of 64, 128, 256, or 512 and adjust the
- resource allocation code as appropriate (#3445, Keith Packard).
-3366. Fix compile problems with Solaris 7 (#3437, Nicholas Brealey).
-3365. Add Riva TNT2 M64 to nv_driver (#3436, Jarno Paananen).
-3364. Add prototypes for Xserver/Xprint and fix various problems with
- Xprint (#3432, Thomas Dickey).
-3363. Add proper clock checking for VidMode extension, add SDK fixes for
- missing files, add SilkenMouse for C&T driver (#3424, David Bateman).
-3362. Sync v4l and glint drivers with the new Xv changes (Mark Vojkovich).
-3361. Add XvImage support to the MGA driver - G200/400 only (Mark Vojkovich).
-3360. Xv changes/additions (Mark Vojkovich)
- - XvImage support in the Xv DDX, DIX, client libs and header files.
- - Add min and max fields to the XvAttributes.
- - Reved Xv minor version.
- - Rewrote some of the way clipping is dealt with in the Xv DDX.
-3359. Fix nv driver rendering bugs (Mark Vojkovich).
-3358. Add MTRR support for LynxOS (#3419, Thomas Mueller).
-3357. Fix bad return in GLINTAdjustFrame (#3418, David Holland).
-3356. Fix some build problems with the rendition driver, including a general
- problem building the static server, and problems that show up on
- some OSs (David Dawes, #3418, David Holland).
-
-XFree86 3.9.16e (5 December 1999)
-3355. Fix a problem with the bitmap font module (#3421, Matthieu Herrb).
-3354. Misc. bug/typo fixes. (Egbert Eich)
-3353. Fixed scanpci to generate better output on Alphas (Harald Koenig,
- Egbert Eich)
-3352. Added initial VESA VBE support. This includes initialization
- and DDC. (Egbert Eich)
-3351. Added support for 64bit PCI devices (untested) (Egbert Eich.
-3350. Added support to read PCI memory and io ranges from kernel on
- Linux 2.3 (untested). (Egbert Eich)
-3349. introduced "#undef" before definitions in xf86_libc.h to keep
- gcc on Alpha quite. (Egbert Eich)
-3348. Added a function to check if any resource needs to share memory.
- Required for DGA. (Egbert Eich)
-3347. Added copyright messages to int10 code. Fixed int10 code to
- run on Alphas.
-3346. Changed some byte and word access to MMIO registers in drivers
- to use MMIO_READ/WRITE8/16(). Made attempt to make some drivers
- 64 bit (and Alpha!) clean: s3virge, chips, gling, neomagic.
- Fixed bugs in compiler.h. (Egbert Eich)
-3345. Made part of the code 64 bit clean. (Egbert Eich)
-3344. Cleanups in the C&T driver. (Egbert Eich)
-3343. Clearified meaning of VIDMEM_MMIO and VIDMEM_MMIO_32BIT. (Egbert Eich)
-3342. Added support for host-PCI bridges. (Egbert Eich)
-3341. Changed policy for removing resource overlaps.
- Removed a bug in findIntersect() (xf86Bus.c).
- Added function that enables/disables all resources of a given
- screen. Added a config file option to set overlap removal
- aggressiveness.(Egbert Eich)
-3340. Split xf86Bus.c into generic/pci/isa specific parts. (Egbert Eich)
-3339. Faster clocks for the G400 (Mark Vojkovich).
-3338. Fix bug in FB manager's ResizeArea function (Mark Vojkovich).
-3337. Pass positioning information for the obsolete ServerLayout format
- to the common layer, and update the DESIGN doc for the newer ServerLayout
- formats (David Dawes).
-
-XFree86 3.9.16d (19 November 1999)
-3336. Fx up new MMIO macros (#3337, Matt Grossman).
-3335. Clean up compiler warnings in lib/font/bitmap (#3411, Matt Grossman).
-3334. TGA fixes, add sync on green (#3410, Matt Grossman).
-3333. Fix NULL pointer dereference in libXaw (#3406, Christopher Sekiya).
-3332. Add Rage128 support (#3405, Rik Faith, funded by ATI).
-3331. Add MTRR support for NetBSD and OpenBSD. Add new NetBSD aperture driver
- (#3404, Matthieu Herrb).
-3330. Xterm patch #121 (#3402, Thomas Dickey).
-3329. Rendition driver bugfixes and alpha related cleanups (#3400,
- Dejan Ilic, Marc Langenbach, Egbert Eich).
-3328. Add void input device (ä3392, Frederic Lepied).
-3327. Changed the Xon serial option to be able to select xon/xoff for input,
- output or both. Add support for Graphire models. Change wacom init
- phase to use new Xoff option (#3391, Frederic Lepied).
-3326. Change the SwapAxes option to SwapXY in elographics/microtouch driver
- to match an already existing option in the Dynapro driver. Add a Focus
- class capability to the elographics driver (#3395, Patrick Lecoanet).
-3325. Update mouse rate handling (#3388, Harald Koenig).
-3324. Fix NULL pointer dereference in misprite.c (#3380, Edward Wang).
-3323. Add FBDev and ShadowFB support to glint driver. Add new option
- "NoWriteBitmap" (#3383, Michel Daenzer).
-3322. Update SuperProbe to handle S3 Savage4, Savage200 and clean up
- Trio3D/Savage3D detection (#3382,3384 Harald Koenig).
-3321. Add new framebuffer code and tiny X DDX architecture (#3379,
- Keith Packard).
-3320. Add DGA2 documentation (#3378, Mark Vojkovich).
-3319. Update XFree86 manpage wrt -bpp/-depth/-fbbpp (#3377, Andy Isaacson).
-3318. Make SuperProbe check primary cards, only (#3374, Harald Koenig).
-3317. Add SilkenMouse to *BSD (#3373, Matthieu Herrb).
-3316. Allow SilkenMouse to work if not all drivers of an OS support SIGIO
- (#3372, Keith Packard).
-3315. Fix a few problems in TGA driver and add support for backing store
- and SilkenMouse (#3371, Matt Grossman).
-3314. Add smarter scheduler (#3370, Keith Packard).
-3313. Xterm patch #120 (#3369, Thomas Dickey).
-3312. Enable xf86SetKbdRate function on Solaris 8 (#3364, David Holland).
-3311. Fix some bugs and add acceleration to Rendition server (#3360,
- Dejan Ilic).
-3310. Make raw DDC information available as properties in the root window
- (#3357, Andrew Aitchison).
-3309. Fix for xf86CreateRootWindow (#3355, Andrew Aitchison).
-3308. Add manpage for the chips driver (#3353, David Bateman).
-3307. Update contact info (#3352, Andrew van der Stock).
-3306. Add kbd rate support for Linux (#3363, Harald Koenig).
-3305. Update Portuguese XKB map (#3351, Joao Esteves, Francisco Colaco).
-3304. Fix text clipping in 3dfx driver (#3349, Henrik Harmsen).
-3303. Fix S3 ViRGE hw cursor (#3348, Harald Koenig).
-3302. Fix clipping in 3dfx driver (#3342, Daryll Strauss).
-3301. Enable SilkenMouse for 3dfx driver (#3341, Henrik Harmsen).
-3300. Enable SIGIO support on LynxOS (#3339, Thomas Mueller).
-3299. Get TRUE defined in sigio.c. Fix xterm compile problem on ISC
- (#3338, Michael Rohleder).
-3298. Correct DPMS suspend/standby modes for 3dfx driver (#3336,
- Henrik Harmsen)
-3297. Xterm patch #119 (#3335, Thomas Dickey).
-3296. ATI LCD changes to add interlaced mode support and near-final rework of
- mode validation (Marc La France).
-3295. Keep track of a mode's hsync and vrefresh rates used for monitor checks
- so they can be displayed by xf86PrintModes() (Marc La France).
-3294. Add sync polarities to VESA modes (Marc La France).
-3293. Fix VESA mode typos and some warnings (Marc La France).
-3292. Add GeForce/Quadro support to the NVIDIA driver (Chas Inman,
- Mark Vojkovich).
-3291. Fix a DGA colormap problem (Mark Vojkovich).
-3290. Disable the Double-Buffer extension in Xinerama mode since it
- doesn't work (Mark Vojkovich).
-3289. Fix XAA scanline color expansion routines to check the buffer address
- after the Subsequent function is called. This allows the driver to
- change buffers on-the-fly (Mark Vojkovich).
-3288. Update PCI device IDs for newer NVIDIA chipsets (Mark Vojkovich).
-3287. Add an 80 Hz sample rate option for PS/2 mice (Mark Vojkovich).
-3286. Remove ATI driver's meddling with LCD power management facilities
- (Marc La France).
-3285. Ensure miInitializeBanking() fails when a bank clip region cannot be
- allocated (Marc La France).
-3284. Static server fix for s3virge and nv drivers (Marc La France).
-3283. Map MMIO areas on ATI adapters (Marc La France).
-3282. Disable DirectColor and gamma support for the original ATI integrated
- controllers (Marc La France).
-3281. Linear aperture fixes for ATI 88800 and CT controllers (Marc La France).
-3280. Make LCD mode validation changes in ATI driver (CHANGELOG #3271)
- into a development option, restoring the previous behaviour by
- default (Marc La France).
-3279. When display subsection mode names run out without yeilding a valid mode,
- continue validation with the largest unvalidated modePool member, rather
- than the first (Marc La France).
-3278. Allow drivers to specify whether or not sync/refresh rates in monitor
- sections are optional and use this for ATI LCD support (Marc La France).
-3277. Replace xf86Exiting with its DIX counterpart, dispatchException's
- DE_TERMINATE bit (Marc La France).
-3276. NVIDIA driver changes (Mark Vojkovich):
- - Improved shadowfb support (screen rotation).
- - Improved acceleration (color expansion, lines).
- - Fixed some rendering correctness issues.
- - Full DGA 2.0 support including changing depth on the fly.
-3275. Make usage of hardware clipping in XAA more consistent (Mark Vojkovich).
-3274. Limit MGA driver to using 16 Meg of ram to workaround some hardware
- limitations (Mark Vojkovich).
-3273. Fix DGA event bug (Mark Vojkovich).
-3272. Mode validation changes (Marc La France).
- - Remove assumption that modes of the same name are also of the same
- size.
- - Even if Display subsection mode names include duplicates, no two names
- will ever match the same mode.
- - If the supplied mode names do not yield a usable mode (including the
- case where no names are supplied), scan the mode pool until a usable
- mode is found. This is a step towards allowing successful server
- runs with XF86Config's that specify no mode information whatsoever.
- - Implement minHeight and maxHeight checks.
- - Call the driver's ValidMode() for a final OK just before accepting a
- mode.
- - Free mode pool on xf86PruneDriverModes() calls.
- - Documentation updates.
- - Minor fixes to C&T and GLINT drivers.
-3271. ATI driver updates (Marc La France).
- - Disallow interlaced modes when scanline pitch exceeds hardware limits.
- - LCD support no longer depends on the mode on server entry.
- - Fix bug introduced by CHANGELOG entry 3245.
- - Re-lock adapters on ATIPreInit() failures.
- - Make default sync polarities consistent.
-3270. Trident updates for ISA cards and DGA support (Alan Hourihane).
-3269. mibank bug fixes (Marc La France).
-3268. Add -withrevinfo flag to lndir to allow shadowing of RCS, SCCS, CVS and
- CVS.adm directories (Marc La France).
-3267. SIGIO workaround for older Linux kernels (Marc La France).
-3266. Fix xalloc.c compilation failure with -DXALLOC_LOG (Marc La France).
-3265. Change ATIProbe() to use int 10 vector to locate the BIOS of VGA and
- VGA Wonder non-PCI adapters (Marc La France).
-3264. Make '-probe' work for static server and ATI driver (Marc La France).
-3263. #define _POSIX_C_SOURCE to 2 for Linux libc5 (Marc La France).
-
-XFree86 3.9.16c (13 October 1999)
-3262. Export SetCriticalEvent from DIX, it was an unresolved external in
- xf86dga2.c (#3326, Jarno Paananen).
-3261. Removes Alpha-specific MMIO-mappings from NVIDIA driver in the
- same fashion that was done in MGA-driver (#3326, Jarno Paananen).
-3260. Add SilkenMouse to NVIDIA and Glint drivers (#3326, Jarno Paananen).
-3259. Workaround for problem in xf86RegisterRootWindowProperty() code
- (Jarno Paananen).
-3258. DGA workaround for recent VTSwitch changes (#3325, Mark Vojkovich).
-3257. Out of memory fixes for the mi region code (#3323, 3324, Keith Packard).
-3256. "Silken Mouse" support (#3323, Keith Packard).
-3255. Modify the ati driver to temporarily ignore Rage 128s (#3322,
- Marc La France).
-3254. Fix offscreen memory handling for xf4bpp when VT switched away
- (Alan Hourihane).
-3253. xf4bpp, xf1bpp, ISA additions for the trident driver (Alan Hourihane).
-3252. Fix problem with cleanup after XAA offscreen pixmap allocation fails
- (Mark Vojkovich).
-3251. Fix missing USE_MMIO define in trident driver (Alan Hourihane).
-3250. Blade, image and trident updates for the trident driver (Alan Hourihane).
-3249. A very preliminary "-probe" mode for the X server (David Dawes).
-3248. Remove __alpha__ ifdefs from the mga and s3virge drivers by changing
- the way sparse MMIO access is handled (David Dawes).
-3247. Fix a WarpPointer bug introduced when "xineramifying" some dix code
- (Mark Vojkovich).
-3246. Move the BuildObjectFromLibrary rule into Imake.rules.
-3245. Fix text mode restoration when large modes are used in the ATI driver
- (#3318, 3321, Marc La France).
-3244. Rendition driver update, including skeleton HW cursor and accelerated
- support (#3317, Dejan Ilic, Marc Langenbach).
-3243. Change mode validation to allow drivers to modify a mode before it
- is checked against the monitor's constraints (#3316, Marc La France).
-3242. C&T driver fix (#3314, David Bateman).
-3241. Change the ati mode validation strategy for programmable clocks to best
- refresh (#3313, Marc La France).
-3240. Fix ATI Rage XL/XC & Mobility support so that it actually works this time
- (#3313, Marc La France).
-3239. Update the xfsft code to version 1.1.7 (#3310, Juliusz Chroboczek).
-3238. Remaining keyboard support for Solaris 8/x86, including keyboard beep,
- auto-repeat, keyboard LEDs, modifier keys (#3294, 3309, David Holland).
-3237. Add xf86RegisterRootWindowProperty() - a mechanism for drivers etc
- to add properties to the root window before the screen is created
- (#3307, Andrew Aitchison).
-3236. Fix two problems that may occur when some extension allocates a "font
- private index" while a font is already open (#3305, Bruno Haible).
-3235. Xterm patch #118 (#3303, Thomas Dickey).
-3234. Fix a typo in a dga header file (#3302, Mark Vojkovich).
-3233. Update rendition name info in scanpci (#3301, Dejan Ilic).
-3232. Getuid fix for scanpci (#3300, Marc La France).
-3231. This patch will avoid compilation warnings when GCC 3.0 comes out (#3299,
- Bruno Haible).
-3230. Fix some build warnings (#3298, Bruno Haible).
-3229. Fix for the DebuggableLibraries support (#3297, Bruno Haible).
-3228. Revert to always using bison instead of yacc on Linux (#3296,
- Bruno Haible).
-3227. Fix XAA flags checking for the ScanlineImageWrite function (#3293,
- Alan Hourihane).
-3226. Fix some problems wth the SiS 2x5 chipsets, and disable advertising
- support for the 201 and 202 chipsets (#3292, Juanjo Santamarta).
-3225. Call SoftReset for MGA cards on PC-98 machines (#3291, Isao Ohishi).
-3224. Use the int10 soft booter to get a non-primary voodoo3 card to work
- with the tdfx driver (#3290, Henrik Harmsen).
-3223. Fixes for the i740 and neomagic drivers (#3289, Jeff Hartmann).
-3222. Enable compiling ico on systems with pre-standard pthread API (e.g.,
- LynxOS), and fix a problem where a condition variable is used without
- holding the corresponding mutex (#3288, Thomas Mueller).
-3221. Add soft-booting capability to the glint and nv drivers (#3287,
- Jarno Paananen).
-3220. Xterm patch #117 (#3285, Thomas Dickey).
-3219. Fix xf8_32bpp's VT switching by restoring the previous
- xf86SaveRestoreImage() into it (#3284, Marc La France).
-3218. Remove duplicate symbol in misym.c (#3283, Alan Hourihane).
-
-XFree86 3.9.16b (27 September 1999)
-3217. Xterm patch #116 (#3280, Thomas Dickey).
-3216. Add new flags to the Xv adaptor type to indicate that it can be used
- to render into window or pixmaps and do video or stills (#3279,
- Mark Vojkovich).
-3215. Fix some MGA pci retry related corruption problems (#3278,
- Mark Vojkovich).
-3214. Attempt to autoprobe the memory on all MGA cards except the 2164
- (#3277, Mark Vojkovich).
-3213. APM driver updates, including bug fixes, 24bpp acceleration and
- improved Rush support (#3276, Loic Grenie).
-3212. Some DGA fixes (3275, Loic Grenie).
-3211. Fix and document the CMAP_LOAD_EVEN_IF_OFFSCREEN option for the common
- layer cmap code (#3274, Marc La France).
-3210. Some resource management speed improvements in Xinerama (#3273,
- Mark Vojkovich).
-3209. Fix an off-by-one error in shadowfb's EnterVT wrapper (#3272,
- Marc La France).
-3208. Fix ATI driver DAC handling for >8bpp TrueColor and add >8bpp
- DirectColor support (#3271, Marc La France).
-3207. Add a hardcopy version of the Xv specs (#3270, Mark Vojkovich).
-3206. Integration of a bug fix by David Woodhouse in the Microtouch
- driver. Correct a possible problem when configuring only one of
- the two devices supported by the driver (#3269, Patrick Lecoanet).
-3205. Update XF86Conf.man to reflect the current state of the input drivers
- (#3269, Patrick Lecoanet).
-3204. Add support for the ThruGlass touchscreens to the Microtouch driver
- (#3269, Andreas Micklei).
-3203. Add SwapAxes and PortraitMode options to the Elographics and
- Microtouch drivers (#3269, Patrick Lecoanet).
-3202. Port Microtouch and elographics drivers to the new module loading method
- (#3269, Patrick Lecoanet).
-3201. Rewrite the way Xinerama handles visibility events. Also fix some
- problems with CoordModePrevious primitives drawn on the root window
- (#3267, Mark Vojkovich).
-3200. Some Xaw and xedit updates. The html-mode code is removed from xedit
- (#3265, Paulo Cesar Pereira de Andrade).
-3199. Fix a problem with pScrn->rgbBits not being set in the correct place
- in the tdfx driver (#3264, Scott Bertin).
-3198. Update ATI info for `XFree86 -scanpci` (#3263, Marc La France).
-3197. ATI driver changes:
- - Rage XC & Rage XL fixes.
- - Preliminary Rage Mobility support.
- - Fix from Christian Lupien to disable TVOUT feature of 3D Rage
- adapters.
- - Work around vertical blending limitations with "shallow" modes by
- doublescanning (accelerator CRTC) or multiscanning (VGA CRTC) them.
- - Fix bug that did not map the VGA aperture for generic VGA support.
- (#3260, Marc La France).
-3196. Warning fixes in miscrinit.c (#3260, Marc La France).
-3195. Rework mibank for maintenance reasons (#3260, 3281, Marc La France).
-3194. VT switching changes, implementing a framework for framebuffer layers
- to be notified when an aperture is remapped at a different virtual
- address during EnterVT, and improved DDX-independence for mibank,
- and xf86SaveRestoreImage() no longer cares how the lower framebuffer
- layers access pixmap pixels (#3260, Marc La France).
-3193. Remove scanpci's redundant check for "root". It get in the way when
- setting its setuid bit (#3260, Marc La France).
-3192. Add several acceleration functions to the tdfx driver, and fix some
- compliance problems (#3259, Darryl Strauss).
-3191. i740 driver updates (#3256, Kurt Olsen).
-3190. Enable image writes in the nv driver for the TNT in 32 bit mode
- (#3255, Jarno Paananen, Neil Burch).
-3189. Remove the last global variables from the nv driver (#3255,
- Jarno Paananen).
-3188. Turn MGA soft reset stuff back on but modified so that it doesn't
- poll for fifos in case the PLLs aren't powered up (#3254,
- Mark Vojkovich).
-3187. Xterm patch #115 (#3253, Thomas Dickey).
-3186. Comment out some of the CacheBlit tiling code since the logic is not
- quite correct and it can get stuck in an endless loop in some cases
- (#3250, Mark Vojkovich).
-3185. Fix tseng 24 bpp mode (#3249, Egbert Eich).
-3184. Fix et4000W32p font corruption with ColorExpandScanline in modes > 8bpp
- (#3249, Egbert Eich).
-3183. Add Solaris 8 support (#3241, 3247, David Holland).
-3182. Fix some build problems in the Type1 code that show up on Solaris 8
- (#3241, David Holland).
-3181. Add an ISO8859-1 version of the "micro" font (#3246, Mark Montague).
-3180. Minor DDC code improvement: xf86PrintEDID() now returns pointer to
- monitor structure (#3245, Egbert Eich).
-3179. Problem with RAC wrapper (hopefully) fixed (#3245, Egbert Eich).
-3178. Neomagic ScreenToScreenCopy bug fix (#3245, Egbert Eich).
-3177. Initial INT10 module (Linux-only so far) (#3245, 3248, 3251, Egbert Eich).
-3176. Update the DRM Linux kernel module to match that in the Linux 2.3.18
- tree, and update libdrm and the DRI routines that use libdrm to reflect
- changes in the Linux kernel (#3244, Rik Faith).
-3175. Fix a WarpPointer bug in Xinerama (#3243, 3252, Mark Vojkovich).
-3174. Fix a seg fault when changing DGA mode (#3242, Loic Grenie).
-3173. Xterm patch #114 (#3240, Thomas Dickey).
-3172. Fix an XAA GC validation problem with Polygons for some fillStyles in
- some situations (#3239, Mark Vojkovich).
-3171. Fix an incorrect method for preallocating a color on the default map
- (#3237, Mark Vojkovich).
-3170. Fix a bad assumption in the XAA NonTE text rendering code (#3236,
- Mark Vojkovich).
-3169. An attempt to autodetect the G400 Max and set the max pixel clock
- appropriately (#3235, Mark Vojkovich).
-3168. Fix shadowfb problems when drawing is done while switched out (#3234,
- Marc La France).
-3167. Attempt to autodetect SDRAM in the MGA driver for the primary head
- (#3233, Mark Vojkovich).
-3166. Make Window->Pixmap copies in Xinerama less broken (#3232,
- Mark Vojkovich).
-3165. Fix a bug in the Xinerama ShmGetImage support added in the last alpha
- (#3230, Mark Vojkovich).
-3164. New cursor warping code. This implements the new way of specifying
- screen positions in the ServerLayout config file section (#3229,
- Mark Vojkovich).
-3163. Add a xf86CheckMTRR function which returns TRUE when changing the
- MTRR setting is supported and enabled (#3227, Alan Hourihane).
-3162. Resync SuperProbe and scanpci with the 3.3.x version (#3226,
- Marc La France).
-3161. Make 8+24 work on Matrox 2064w (Millennium I) with >4MB (#3224,
- Mark Montague).
-3160. Make xdpyinfo -ext XFree86-VidModeExtension print the current mode line
- (#3223, Andrew Aitchison).
-3159. Minor fix to Xnest Imakefile (#3222, Marc La France).
-3158. Make the wrapping or replacement of ScreenRec region code function
- pointers reliable when NEED_SCREEN_REGIONS is #define'd (#3221,
- Marc La France).
-3157. Remove ScreenRec region code function pointers (except BitmapToRegion)
- when the server is compiled with NEED_SCREEN_REGIONS #undef'ined
- (#3221, Marc La France).
-3156. Fix memory leak during resource broker initialisation (#3220,
- Marc La France).
-3155. During broker initialisation, use both system and non-system PCI
- resources to "trim" OS resources. Among other things, this allows the
- maximum memory limit to be bumped back up to 2G (#3220, 3282,
- Marc La France).
-3154. Temporarily allow a driver to register resources that only conflict with
- resources whose size the common layer has only estimated (#3220,
- Marc La France).
-3153. ATI driver updates, including:
- - Add option to display on the CRT interface whether or not a digital
- flat panel is detected.
- - Add support for ShadowFB (adapted from Henrik Harmsen).
- - Always read BIOS from legacy location for adapters found enabled on
- server entry.
- - Ensure the primary CRTC is always used for the CRT interface.
- - Fix determination of panel dimensions with older BIOS's.
- - Stop driver when panel dimensions cannot be determined.
- (#3219, Marc La France).
-3152. Thread-related updates to 'ico' (#3217, Carlos A M dos Santos).
-3151. Fix a build problem on 64-bit platforms introduced in 3.9.16a (#3216,
- Matt Grossman).
-
-XFree86 3.9.16a (6 September 1999)
-3150. Add support to the parser for a new way of specifying the screen
- positions (not made use of yet) (David Dawes).
-3149. Remove a spurious #endif in linux.cf (#3215, Jarno Paananen).
-3148. Add driver option VIDEO_OVERLAID_STILLS for the Xv DDX (untested)
- (#3214, Mark Vojkovich).
-3147. Comment out the MGASoftReset() call in the mga driver to fix a
- multi-head problem (#3213, Mark Vojkovich).
-3146. xman updates, including some app-defaults file tuning, change some
- widget names for better consistency, reformat the help file and
- update the man page (#3212, Carlos A M dos Santos)..
-3145. Add support for DG/ux systems to xload (#3212,
- Takis Psarogiannakopoulos).
-3144. App-defaults file updates for xcalc (#3212, Carlos A M dos Santos).
-3143. Fix some prototypes/casts in viewres (#3212, Carlos A M dos Santos).
-3142. Add an XtSetLanguageProc() call to all contrib programs except xman
- (#3212, Carlos A M dos Santos).
-3141. Fix a zero-height bug in the xaa text code (#3211, Mark Vojkovich).
-3140. ScreenToScreenColorExpansion bug fix for the G400 (#3210,
- Mark Vojkovich).
-3139. Xineramify ShmGetImage (#3209, Mark Vojkovich).
-3138. Rewrite PanoramiXGetImage so that it passes xtest (#3209,
- Mark Vojkovich).
-3137. Increase IMAGE_BUFSIZE to 64k (#3208, Mark Vojkovich).
-3136. Remove the "old input" code (David Dawes).
-3135. Fix a problem with xman that prevents it form recognising the
- XM_DELETE_WINDOW message when xman is run with the "topbox" disabled
- (#3207, Carlos A M dos Santos).
-3134. Prevent xkbcomp from overwriting writing through symlinks (#3206,
- Branden Robinson).
-3133. Use ncurses instead of termcap for Linux/libc6 (#3204, H.J. Lu).
-3132. Fix a build problem with the tdfx driver (#3203, Takaaki Nomura).
-3131. Add a clean rule to remove the automatically generated
- doc/sgml/index.sgml file (#3202, Marc La France).
-3130. Fix some build warnings (#3202, Marc La France).
-3129. Add missing files for the Rush extension (#3199, Loic Grenie).
-3128. Export the xf86InitFBManagerRegion symbol.
-
-XFree86 3.9.16 (31 August 1999)
-3127. Potential fix for a server crash when connecting from a byte-swapped
- client in Xinerama mode (based on #3196, Attila Fülöp).
-3126. Build xterm/resize with -lncurses on Debian (#3197, Attila Fülöp).
-3125. Allow inclusion of Xvlib.h into C++ code (#3195, Vladimir Dergachev).
-3124. Modify the ISO-8859-{6,7,10} to Unicode tables so that they agree with
- the tables found on ftp.unicode.org (#3172, Bruno Haible).
-3123. Some minor C&T bug fixes (#3194, David Bateman).
-3122. Xman update (#3174, Carlos A M dos Santos).
-3021. Import some xkb data file updates from 3.3.5.
-3020. Fix a build problem on Alpha platforms (#3191, Matt Grossman).
-3019. Allow driver SDK builds for the i740 driver (#3190, Daryll Strauss).
-3018. Allow driver SDK builds for the tdfx driver, and allow it to be built
- without DRI support (#3189, Daryll Strauss).
-
-XFree86 3.9.15d (29 August 1999)
-3017. 3Dfx driver for Banshee and Voodoo3 (#3188,
- Daryll Strauss/Precision Insight).
-3016. Fix a 24/32 GetImage problem (#3187, Mark Vojkovich).
-3015. Intel i740 driver (#3186, Precision Insight/Daryll Strauss).
-3014. Fix a planemask problem in 24bpp with the recently added MGA point
- speedups (#3185, Mark Vojkovich).
-3013. Some new and updated ISO 10646-1 fonts, including 5x7, 6x10, 6x13, 6x13B,
- 7x13, 7x13B, 7x14, 7x14B, 8x13, 8x13B, 9x15, 9x15B, 10x20, 9x18, 12x13ja,
- 18x18ja (#3184, Markus Kuhn, Robert Brady, Birger Langkjer,
- Constantine Stathopoulos).
-3012. Update the default xdm config file to disable listening for XDMCP
- requests (#3183, Matthieu Herrb).
-3011. Reinstate the code to stop DDC1 problems on secondary screens with
- the MGA driver (#3182, Andrew Aitchison).
-3010. Fix for the option handling in the glide driver (#3181, Henrik Harmsen).
-3009. NVIDIA doc update (#3179, Jarno Paananen).
-3008. Doc update for the C&T driver (#3176, David Bateman).
-3007. Update some of the bindist files (#3175, Michael Rohleder).
-3006. Fix a libXfont build problem that shows up on IUS (#3175,
- Michael Rohleder).
-3005. Xaw and xedit updates (#3174, 3180, Paulo Cesar Pereira de Andrade).
-3004. Add a new DebuggableLibraries imake parameter to allow libraries to
- be built with debugging symbols, and enable this by default for Linux
- (#3173, Bruno Haible).
-3003. Some Driver SDK build fixes (#3172, David Bateman).
-3002. Modify the MGA driver to fall back to DDC1 if DDC2 fails or is
- disabled (#3171, Andrew Aitchison).
-3001. Allow the -allowMouseOpenFail X server command line option to be
- recognised independently of the XFree86-Misc extension (#3170, Joe Moss).
-3000. Update NetBSD's and OpenBSD's aperture driver to remove a warning from
- xf86ReadBIOS() during xf86Config.c's PC98 detection on non-PC98 systems
- (#3169, Marc La France).
-2999. Disable setting the default gamma from the DDC data (#3168,
- Andrew Aitchison).
-2998. Update the microtouch input driver for "NEW_INPUT", and re-enable
- building it (#3178, David Woodhouse).
-2997. Back out the change in 3.9.15c that includes "non-system" resources
- in the RAC "system" resources list (#3167, Marc La France).
-2996. Update the RELNOTES for DDC (#3165, Andrew Aitchison).
-2995. Fix a problem with xf86ReadBIOS() on NetBSD/OpenBSD (#3164,
- Marc La France).
-2994. Add an XLC_LOCALE file for zh_TW.Big5 (#3163, Pablo Saratxaga).
-2993. Add dummy Compose files for encodings that don't already have them
- (#3163, Pablo Saratxaga).
-2992. APM driver updates. The Rush extension is now included in the driver
- (some files missing, so not enabled yet) (#3162, 3159, Loic Grenie).
-2991. Some fixes for the VidMode extension (#3161, Loic Grenie).
-2990. Update SuperProbe to recognise the APM AT3D chipset (#3160, Loic Grenie).
-2989. Some fixes for the nv driver (#3158, Jarno Paananen).
-2988. Fix a typo in ObjectFromAsmSource() in xf86.rules (#3157,
- Matthieu Herrb).
-2987. Add some NVIDIA cards to the Cards file (#3155, Jarno Paananen).
-2986. A quick hack to cut down on XAA pixmap cache thrashing that
- happens with some particular apps (#3154, Mark Vojkovich).
-2985. Update the tabtcvn file to include the full tcvn-5712 encoding, not
- only lowercase characters (#3153, Pablo Saratxaga).
-2984. Create the doc index list from information in the .sgml files
- (David Dawes).
-2983. Basic man page for the generic VGA driver (David Dawes).
-2982. Fix for lockup problem with Trident Image 975 (Alan Hourihane).
-
-XFree86 3.9.15c (22 August 1999)
-2981. Update NetBSD.cf to reflect NetBSD's switch from GNU malloc to FreeBSD's
- malloc (#3151, Bernd Ernesti).
-2980. Change xf86ReadBIOS() to reuse the fd for /dev/mem or /dev/xf86 from
- the other bsd_video.c functions in order to avoid the difficulty caused
- by the NetBSD aperture driver only allowing one open of /dev/xf86 at
- a time (#3150, Matthieu Herrb).
-2979. Add pre-R6.4 compatible entries to the NLS .dir and .alias files. This
- should make it possible for them to be used with older versions of Xlib.
-2978. Fix a typo in the MGA arc code that broke some arcs (#3149,
- Mark Vojkovich).
-2977. Fix a problem with cfb allocating too much space on the stack when
- clipping rects (#3148, Mark Vojkovich).
-2976. Add missing sync when uploading into the XAA pixmap cache (#3147,
- Mark Vojkovich).
-2975. Change XDGAFlush() to XDGASync() (#3146, Mark Vojkovich).
-2974. Add transparent DGA blits to the MGA driver, and enable the OverclockMem
- option for the G400 (#3145, Mark Vojkovich).
-2973. Update the common cursor code to keep virtual desktop panning from
- interfering with screen rotation (#3144, Mark Vojkovich).
-2972. Dynapro driver update: initialise the incoming packet state machine,
- and add a "SwapXY" option (#3142, David Woodhouse).
-2971. Fix a loader problem that shows up on Alpha/ELF platforms when there
- is a .sbss section (#3141, Hannes Reinecke).
-2970. Modify DDC for neomagic (#3139, Egbert Eich).
-2969. Add DDC support for the S3 ViRGE (DDC2 untested) (#3139, Egbert Eich).
-2968. Fix DDC2 support for MGA and C&T drivers (#3139, Egbert Eich).
-2967. Add a call to xf86SetPciVideo(NULL,NONE) after each probe (#3139,
- Egbert Eich).
-2966. Modified registration of the OS access windows (#3139, Egbert Eich).
-2965. Some Xaw and xedit fixes (#3138, Paulo Cesar Pereira de Andrade).
-2964. Next round of the font ansification and warning removal (#3135,
- Matthieu Herrb).
-2963. Fix ATI 18800-x detection problem (#3133, Marc La France).
-2962. Check for limitations on vertical blending in panel support for the ATI
- driver (#3133, Marc La France).
-2961. Update ATI driver to complain about bad BIOS data (#3133,
- Marc La France).
-2960. Man page corrections for the MGA driver (#3132, Mark Vojkovich).
-2959. Limit PCI BIOS apertures to 16MB as per the PCI 2.1 spec (#3131,
- Marc La France).
-2958. Assume a system has up to 1G of physical memory installed, rather than
- 2G (#3130, Marc La France).
-2957. Fix a bug in the handling for buggy VGA CRTCs (#3129, Marc La France).
-2956. Fix to build the mga driver with the driver SDK (#3128, David Bateman).
-2955. Xterm patch #113 (#3125, Thomas Dickey).
-2954. Port the XAA cfb copyplane functions, adding them to the cfb code
- (#3124, 3126, 3127, David Bateman).
-
-XFree86 3.9.15b (15 August 1999)
-2953. Improved point rendering performance for the MGA driver (#3123,
- Mark Vojkovich).
-2952. Xaw and xedit updates (#3122, Paulo Cesar Pereira de Andrade).
-2951. Remove the Latin2 Type1 fonts.
-2950. Change the RGB mask names in the DGA structures (#3120, Mark Vojkovich).
-2949. More acceleration and bug fixes for the NV driver (#3119,
- Jarno Paananen).
-2948. Change some things in the XAA color expansion code to facilitate
- rendering into DMA buffers (#3118, Mark Vojkovich).
-2947. Fix a 64 bit problem with the xf24_32bpp layer (#3117, Mark Vojkovich).
-2946. Modify XF86FlushInput() to work for non-tty devices, which is required
- for PS/2 mice with Linux 2.2.x kernels (#3114, Kazutaka Yokota).
-2945. Support for rotating the virtual desktop for the MGA driver using
- the shadowfb (#3113, 3116, Mark Vojkovich).
-2944. Fix a colormap problem with DGA when initialized from an 8+24 mode with
- the MGA driver (#3112, Mark Vojkovich).
-2943. Fix multihead on the MGA-2164W (#3111, Mark Vojkovich).
-2942. XAA speedups for planar copies in some cases (#3110, Mark Vojkovich).
-2941. Add a driver SDK which performs a similar function to the old LinkKit,
- but for the loadable server (#3105, David Bateman).
-2940. C&T doc update and xgamma man page update (#3105, David Bateman).
-2939. Add an option to the C&T driver to allow the user to select the
- transparency key when using the overlay (#3105, David Bateman).
-2938. Add DGA2 support to the C&T driver (#3105, David Bateman).
-2937. Fix a bug in the bitmap font code introduced in 3.9.15a (#3101,
- Juliusz Chroboczek).
-2936. Some TGA driver cleanups, including a SaveScreen function and code to
- disallow virtual desktops in a nicer way (#3100, Matt Grossman).
-
-XFree86 3.9.15a (1 August 1999)
-2935. Fix the RAC usage in the nv driver to allow multi-head to work
- (#3093, Itai Nahshon).
-2934. Reduce memory consumption of the bitmap font backends when using
- sparse fonts, which is important when using Unicode-encoded fonts
- (#3092, Juliusz Chroboczek).
-2933. Fix Option register initialisation in multi-head for MGA 2064/2164
- (#3089, Andrew Aitchison).
-2932. Convert the nv (NVIDIA) driver from 3.3.4 (#3078-3080, 3087,
- Jarno Paananen).
-2931. Add SuperProbe for NetBSD 1.4 wscons (#3083, Matthias Drochner).
-2930. Fix button and modifier key state problems in DGA (#3082,
- Mark Vojkovich).
-2929. Avoid a possible segmentation fault in "xsm" which, for example,
- occurs local hostname can't be resolved (#3073, Matthias Scheler).
-2928. ATI driver updates, including:
- - Add preliminary panel support.
- - Rework RAC interface.
- - PCI VGA's not on primary bus are now detected.
- - Fix bug when an adapter's VGA has been disabled.
- - Fix gamma support.
- (#3069, Marc La France)
-2927. Fix 8514/A pre-defined resource and pre-define VGA sparse I/O resources
- (#3069, 3081, Marc La France).
-2926. Fix a bug in the registration of background device BIOS'es (#3069,
- Marc La France).
-2925. Invert the meaning of ResMinimised bit into ResEstimated (#3069,
- Marc La France).
-2924. Allow drivers to print resource lists, and allow them to enable/disable
- adapters before creating bus slots for them (#3069, Marc La France).
-2923. Resync SuperProbe and scanpci with 3.3.x (#3069, Marc La France).
-2922. Add some missing man pages for the DGA and VidMode extensions (#3064,
- Joe Moss).
-2921. Some changes to the DGA and colormap layers to allow gamma changes
- during DGA mode (#3060, Mark Vojkovich).
-2920. Fix XIM segv error (#3033, 3051, Manabe Takashi).
-2919. Add a client state callback to the DGA extension so that the server side
- can be cleaned up when a DGA client exits (#3048, 3049, Mark Vojkovich).
-2918. Update the FreeBSD/mouse documentation (#3047, Kazutaka Yokota).
-2917. Fix an undocumented blitter constraint on the G200 (#3046,
- Mark Vojkovich).
-2916. Fix the MGA driver so that it can support changing depth on the fly
- in DGA mode. All depths are now offered to DGA clients regardless of
- what the screen's main depth is (#3045, Mark Vojkovich).
-2915. Fix a bug in the InstallGenManPageLong() rule in lynx.cf (#3043,
- Thomas Mueller).
-2914. Update ATI doc with info about a VGA/RAC problem (#3044,
- Andrew Aitchison).
-
-XFree86 3.9.15 (19 July 1999)
-2913. -
-2912. Fix a problem with the library spec in xgc/Imakefile (#3042,
- Thomas Mueller).
-2911. Add native 69030 support to the C&T driver (#3041, David Bateman).
-2910. Update release notes for the apm driver (#3040, Loic Grenie).
-2909. Fix a small bug in the color expands in the TGA driver (#3039,
- Matt Grossman).
-2908. Updates for the Japanese (PC98) docs (#3038, Takaaki Nomura).
-2907. Some Xaw and xedit updates (#3037, Paulo Cesar Pereira de Andrade).
-2906. Fix a problem with the VidMode extension (#3036, David Bateman).
-2905. Sample config file for Japanese PC98 architecture (#3035,
- Takaaki Nomura).
-
-XFree86 3.9Py (18 July 1999)
-2904. Add a visualClass to the XDGAMode request and a XDGACreateColormap
- request to DGA 2.0 so Colormaps can be created for XDGADevices
- without needing a corresponding visual (#3032, Mark Vojkovich).
-2903. Update the mmap versions of xf86ReadBIOS() to use a map size that
- fits the requested BIOS offset and length rather than using a fixed
- map size (David Dawes).
-2902. Xterm patch #112 (#3031, Thomas Dickey).
-2901. Change the colormap layer's LoadPalette function to take a Visual as
- an argument rather than just the Visual class (#3030, Mark Vojkovich).
-2900. Add some code to auto-detect Japanese PC98 systems (#3029,
- Takaaki Nomura).
-2899. Fix a casting problem in DefineSelf() that shows up on FreeBSD/alpha
- (#3028, Doug Rabson).
-2898. Fix a problem with the GMX2000 DRI support (#3034, Jens Owen).
-2897. Work around a problem in mfb that is caused by an optimiser bug
- in egcs-1.1.2 for the alpha (#3027, Doug Rabson).
-2896. Fix a problem that shows up in the s3virge driver after the recent
- vgahw module changes (David Dawes).
-2895. Add missing references to xf86MiscExt.c in common/Imakefile (#3025,
- Joe Moss).
-2894. Update for the apm driver so that it will work on a Japanese PC-98
- with GA-RUSH6/PCI(VoodooRUSH based video card) (#3024, Isao Ohishi).
-2893. ISO 10646-1 Japanese font (12x13ja.bdf) that covers a superset of
- CP1252 and JIS X 208, and which is suitable to be used together with
- 6x13 for bi-width Japanese text output (#3022, Markus Kuhn).
-2892. Refine the MouseMan+ (PS2++) protocol support (#3020, Kazutaka Yokota).
-2891. Fix problems with the wheels on some mice, including the OEM version of
- the Logitech FirstMouse+, are not recognized and the mouse cursor jumps
- around (#3020, Kazutaka Yokota).
-2890. Fix a problem building the X-TT modules on Solaris 7 (based on #3019,
- David Holland).
-2889. Fix a bug in Xaw/TextAction.c introduced in 3.9Pw (#3018,
- Paulo Cesar Pereira de Andrade).
-2888. ISO 10646-1 version of the 5x7 and 6x13B fonts, and an update for the
- 6x13 font (#3017, Markus Kuhn).
-2887. First part of the ansification of xc/lib/fonts. So far the bitmap,
- fc and fontfile directories have been done (#3016, Matthieu Herrb).
-2886. Fix default PC98 XKB setting (#3015, Akio Morita).
-2885. Remove the reference to VGADriverDoc in xfree86/Imakefile (#3015,
- Takaaki Nomura).
-2884. Fix a bug in Xaw/TextPop.c (#3014, Paulo Cesar Pereira de Andrade).
-2883. Man page update for xfontsel (#3013, Paulo Cesar Pereira de Andrade).
-
-XFree86 3.9Px (12 July 1999)
-2882. Updates to get XF86Setup to build again after the NewInput-related
- changes, and have XF86Setup print a short message stating that it
- isn't usable before exiting (#3012, Joe Moss).
-2881. Fix some compiler warnings in lib/Xext (#3011, Matt Grossman).
-2880. Fix a bug in the wacom driver that shows up when multiple wacom devices
- don't report the same valuators (#3010, Frederic Lepied).
-2879. Some updates to the PCI/RAC code (#3008, Egbert Eich).
-2878. Fix the acute and apostrophe mixup in the German xkb layout with the
- nodeadkey option, and add the EuroSign to AltGr+e (#3006, Markus Kuhn).
-2877. Add code to the mga driver to handle PC98 architecture machines
- (#3007, Takaaki Nomura).
-2876. Add a global (ServerFlags) "PC98" Option for the Japanese PC98
- architecture, and add a function xf86IsPc98() that drivers can call
- to check for this.
-2875. Fix a relocation problem in the ELF loader that shows up on 64-bit
- platforms when mapping unresolved symbols to LoaderDefaultFunc()
- (#3005, Doug Rabson).
-2874. Remove the original text version of the DESIGN doc from hw/xfree86.
-2873. Fix a glyph padding problem in XAA's nonTE text code that shows up on
- 64-bit platforms (Doug Rabson).
-2872. Rework the wacom driver's init phase (#3004, Frederic Lepied).
-2871. Add a 19200 speed option to the wacom driver for Airbrush tablets
- (#3004, Frederic Lepied).
-2870. Add support for transparent stipples to the tga driver (#3003,
- Matt Grossman).
-2869. Modify xfontsel to not show scaled fonts by default (#3002,
- Paulo Cesar Pereira de Andrade).
-2868. Some notes about xterm for the release notes (#3001, Thomas Dickey).
-2867. Some Xaw, Xmu and xedit updates (#2999, 3002,
- Paulo Cesar Pereira de Andrade).
-2866. Xterm patch #111 (#2998, Thomas Dickey).
-2865. Fix a "NoAccel" problem with the PM2 video support (#2997,
- Michael Schimek).
-2864. Update for lynx.cf (#2995, Thomas Mueller).
-2863. Fix a LynxOS macro clash with the cirrus driver, and fix a
- xf86UnmapVidMem() warning in the cirrus driver (#2995, Thomas Mueller).
-2862. Fix a problem on LynxOS where assert is unresolved in the static server
- (#2995, Thomas Mueller).
-2861. Fix a problme with vsnprintf being unresolved when building Xvfb
- and Xnest on some platforms (#2995, Thomas Mueller).
-2860. Remove the s3virge fifo_ changes introduced in 3.9Pu, update the
- DGA2 support and docs (#2994, Kevin Brosius).
-2859. Initial attempt to get the XFree86-Misc again (#2993, Joe Moss).
-2858. Remove XAASync() (#2992, Rik Faith).
-2857. Cleanup the TGA driver's hw cursor code, remove global variables in
- in the "accel" files, and fix up the RAC support (#2991, Matt Grossman).
-2856. Add partial support for color expands to the 8-bit TGA driver (#2991,
- Matt Grossman).
-2855. Re-enable DDC2 support in the MGA driver (#2989, Andrew Aitchison).
-2854. Add missing TIOC defines for Interactive Unix to xf86_OSlib.h (#2990,
- Michael Rohleder).
-2853. Don't register the Xqueue mouse handler for Interactive Unix (#2990,
- Michael Rohleder).
-2852. Don't include sys/mman.h in cidchar.c when USE_MMAP isn't defined
- (#2990, Michael Rohleder).
-2851. Disable BuildXF86DRI and BuildXF86DRIDriverSupport for Interactive Unix
- (#2990, Michael Rohleder).
-2851. Update the apm (Alliance ProMotion) driver (#2987, 2988, Loic Grenie).
-2850. Fix a problem with the xf86config screen configuration that was
- introduced with the removal of "32bpp" (#2986, Matthieu Herrb).
-2849. Add a DefaultDepth configuration page to xf86config (#2986,
- Matthieu Herrb).
-2848. Add the inputDevice examples from XF86Config.eg to config files
- generated by xf86config (#2986, Matthieu Herrb).
-2847. Modify the vgahw module to allow it to save/restore more than the
- standard number VGA CRTC, Sequencer, Graphics and Attribute registers
- (2985, 2996, Jeff Garzik).
-2846. Add DDC information to the release notes (#2984, Andrew Aitchison).
-2845. Change XDGAChangePixmapMode to return the X-Y position of the pixmap
- in case the server is not able to place it exactly where requested
- (#2983, Mark Vojkovich).
-2844. Fix some problems with unfavorable alignment of XAA offscreen pixmap
- (#2982, Mark Vojkovich).
-2843. Some XAA speedups for NonTE text in certain cases (#2981,
- Mark Vojkovich).
-2842. Rename the assembler files that need preprocessing from .s to .S,
- and adjust the imake rules accordingly.
-2841. A fix for xf86PciReadBios() (#2979, Egbert Eich).
-2840. Fix a problem with false detection of multi-function PCI devices (#2978,
- Loic Grenie).
-2839. Fix a problem with libXfont.a not being linked into exports/lib during
- the build phase (#2977, Thomas Mueller, 2990, Michael Rohleder).
-2838. Deal with OSes which don't have TIOCM ioctls in posix_tty.c (#2976,
- Thomas Mueller).
-2837. Fix the use of TIOCM_ in some calls to xf86SerialModem..() in mouse/pnp.c
- (#2976, Thomas Mueller).
-2836. Enable NEW_INPUT on LynxOS (#2976, Thomas Mueller).
-
-XFree86 3.9Pw (6 July 1999)
-2835. Fix for GetBlock() (#2974, Egbert Eich).
-2834. Remove the test for SHAREDIOCLASS when creating a pciAccessInfoRec for
- a device (#2974, Egbert Eich).
-2833. Modified BIOS ROM handling, doing validation only on demand (#2974,
- Egbert Eich).
-2832. Add a ChangeGamma function to the ScrnInfoRec, which allows drivers to
- optionally provide a function to do this instead of the default one
- provided by the colormap layer (#2972, Mark Vojkovich).
-2831. Sis driver memclock fixes (#2971, Bart Oldeman, Juanjo Santamarta).
-2830. Add snprintf() and vsnprintf() to libc emulation (#2970, Marc La France).
-2829. Increase array size in PciInfo data (#2970, Marc La France).
-2828. Add a LoaderRefSymbols() function (#2970, Marc La France).
-2827. When matching fixed clocks, prefer non-CLKDIV2 modes over CLKDIV2 modes
- (#2970, Marc La France).
-2826. Reinstate xf86GetPciConfigInfo() and some warning fixes (#2970,
- Marc La France).
-2825. Build libXext and libX11 client-side libraries when also building
- GLX, despite BuildServersOnly (#2970, Marc La France).
-2824. Update ATI doc (#2970, Marc La France).
-2823. ATI driver from 3.3.3.1 (rac interface is preliminary, no LCD panel
- or Rage 128 support yet) (#2970, Marc La France).
-2822. Fix Ukrainian_GHE_with_upturn double definition error (#2969,
- Peter Novodvorsky).
-2822. Updates to the xf86config utility for the 4.0 config file format
- (#2968, Matthieu Herrb).
-2821. Add default rules to allow easy compilation of .c files to assembler.
-
-XFree86 3.9Pv (4 July 1999)
-2820. Add a marked up (SGML) version of the DESIGN doc (David Dawes).
-2819. Remove the Alpha-specific Linux libc6 parts in linux.cf.
-2818. Add a "defs.ent" file for defining SGML entities that can be shared by
- other docs (David Dawes).
-2817. Import the mouse.sgml doc from 3.3.x, and update it for 4.0.
-2816. Remove support for the very old LinuxDoc tools.
-2815. Use SpecialCObjectRule() in favour of SpecialObjectRule().
-2814. Fix lots of 64-bit problems in XAA (#2967, Mark Vojkovich).
-2813. Add a new DGA request to allow switching the DGA pixmap from one the
- size of the framebuffer to one the size of the viewport that you
- can move around (#2966, Mark Vojkovich).
-2812. Make sure that all Xinerama heads have the same root window depth,
- and don't advertise backing store or save unders as being available
- unless it's available on all heads (#2965, Mark Vojkovich).
-2811. Some Xaw and xedit updates (#2964, Paulo Cesar Pereira de Andrade).
-2810. Some DRI updates (#2962, Rik Faith).
-2809. Fix a double-free problem in the mouse driver (#2959, Egbert Eich).
-2808. Add some debugging code to xalloc.c to detect and allow trapping of
- double xfree() calls (#2954, Egbert Eich).
-2807. Add Single GLINT MX support for Direct Rendering, which now allows
- ELSA Gloria XXL to take part in this (#2592, 2955, 2957, 2958,
- Alan Hourihane and #2960, Rik Faith).
-2806. Add ScanlineCPU function to the glint driver for PM2 when pci
- retries aren't used (#2952, Alan Hourihane).
-2805. Use mediumraw keyboard mode for LinuxPPC (#2946, Gerd Knorr).
-2804. Xterm patch #110 (#2943, Thomas Dickey).
-2803. Add CyberBlade/i7 (Socket 7), CyberBlade/i7 DSTN (Laptop Socket 7) and
- CyberBlade/i1 (Slot 1) support to the trident driver (#2940,
- Alan Hourihane).
-2802. Some new PCI ids for Cyberblades and Via MVP4 (#2939, Alan Hourihane).
-2801. Replace `__volatile__' in xf86drm.h with `volatile' (#2938,
- Takaaki Nomura).
-2800. Fix a problem with the umask not being reset in some cases in the
- xtrans code (#2936, Bill Nottingham).
-2799. Improve the latency associated with writing to the PCI config space,
- which is important for RAC to work efficiently (Egbert Eich).
-
-XFree86 3.9Pu (27 June 1999)
-2798. Xterm patch #109 (#2920, Thomas Dickey).
-2797. Xaw and xedit updates (#2932, 2933, Paulo Cesar Pereira de Andrade).
-2796. Make the "fifo_conservative" memory settings default for the s3virge
- accelerator (#2931, Kevin Brosius).
-2795. Preliminary DGA2 code for the s3virge driver (#2931, Kevin Brosius).
-2794. Updates to PI's DRI sample implementation, including:
- - Dynamic loading of the OpenGL client driver is implemented
- - 3D client death while holding the drawable lock does not cause deadlock
- - The kernel module works with Linux 2.2.x [x <= 10] and 2.3.y [y <= 8]
- - A better authentication mechanism has been implemented
- - XF86Config options for the DRI are supported
- (#2929, Precision Insight).
-2793. Add functions to the FBManager to query the largest size available and
- to purge all areas that aren't nailed down (#2928, Mark Vojkovich).
-2792. Fix some serious performance problems with Xinerama when the number
- of resource IDs becomes large (#2927, Carsten Haitzler).
-2791. Remove the significant RGB bits check from Xinerama visual eliminations
- (#2926, Mark Vojkovich).
-2790. Fix a typo in xmodmap and xstdcmap (#2924, Matthieu Herrb).
-2789. Fix the type of the OverclockMem Option in the MGA driver (#2922,
- Andrew Aitchison).
-2788. Fix PCI resource handling problems that were showing up with the
- glint driver (#2918, Egbert Eich).
-2787. Fix a problem building some Makefiles when JoystickSupport is enabled
- (#2917, Todd Fries).
-2786. Fix a typo in the RAC support for the glint driver (#2915, Jens Owen).
-2785. Fix a RAC-related build problem on 64-bit machines (#2913,
- Matt Grossman).
-2784. Some afb-related updates (#2911, Sven Luther).
-2783. Fix race condition in xinit (Nate Eldredge, Mark Montague).
-2782. Documentation for the new RAC code (Egbert Eich).
-2781. Fix some problems with the glide driver that can result in server crashes
- if there is a problem when it is starting up (David Dawes).
-2780. Install the X server signal handlers before xf86OpenConsole is first
- called. This makes sure that the VT is returned to text mode if the
- server crashes in the early stages of InitOutput() (David Dawes).
-2779. Fix xf86vsprintf() and xf86vfprintf().
-2778. Support for the different PLL reference clock used for HP's on-board
- G200s.
-2777. Disable building the Xanti extension (Mark Vojkovich).
-2776. Update the log file handling to catch most messages that are generated
- before the log file is actually opened (David Dawes).
-2775. Another fix for PM2 text restoration (Egbert Eich).
-
-XFree86 3.9Pt (20 June 1999)
-2774. First cut at converting the fbdev, sis, glide, neomagic and rendition
- drivers for the new RAC code (David Dawes).
-2773. Fix a PM2 lockup problem during GLINTSave, and fix a text mode font
- corruption problem (#2907, Egbert Eich).
-2772. Xterm patch #108 (#2906, Thomas Dickey).
-2771. Fix a problem with duplicate ShmCompletion events in Xinerama mode
- (#2905, Mark Vojkovich).
-2770. Add a XDGAKeyEventToXKeyEvent helper function to the DGA client library
- (#2904, Mark Vojkovich).
-2769. Fix some incorrect XAA GC validation checks (#2903, Mark Vojkovich).
-2768. Fix some XAA caching problems with shared memory pixmaps (#2903,
- Mark Vojkovich).
-2767. Wait for the fifo to clear out in the mga driver before returning to
- the client after any cpu->screen color expansion or image writes (#2901,
- Mark Vojkovich).
-2766. Don't use the BIOS info for the MGA G400 since we don't understand
- the format (#2901, Mark Vojkovich).
-2765. Fix some MGA bitblit problems when more than 16MB of memory is being
- used (#2901, Mark Vojkovich).
-2764. Set memory clocks to the bios defaults in the MGA driver, and add an
- Option "OverclockMem" to allow the previous settings to be used (#2901,
- Mark Vojkovich).
-2763. Xaw and xedit updates (see lib/Xaw/Changelog) (#2899,
- Paulo Cesar Pereira de Andrade).
-2762. Ansification and warning elimination in lib/xtrans (#2896,
- Matthieu Herrb).
-2761. Fix a glint scanline interleave bug introduced by the change in
- device scaning order in the new RAC code (#2890, Jens Owen).
-2760. Fix a dual head Xinerama crash that happens when running the xv program
- (#2889, Itai Nahshon).
-2759. Add v4l Xv support to the trident driver (#2877, Alan Hourihane).
-2758. Trident Image series and standard chipset acceleration fixes (#2877,
- Alan Hourihane).
-2757. Add more Blade3D acceleration to the trident driver (#2877,
- Alan Hourihane).
-2756. Fix for DPMS with the new RAC (Itai Nahshon).
-2755. RAC updates, including changing the way PCI resource validation works
- (Egbert Eich).
-2754. Update the TGA driver for the new RAC (#2886, Matt Grossman).
-2753. Fix a fatal event problem with DGA 2.0 (#2884, Mark Vojkovich).
-2752. Fix some macros in xf86str.h that conflict with system headers on some
- platforms (#2883, 2888, 2902, Matt Grossman).
-
-XFree86 3.9Ps (14 June 1999)
-2751. Some small RAC updates (Egbert Eich).
-2750. Direct Rendering Infrastructure from Precision Insight (#2871).
-2749. Fix a problem building xedit on SVR4.0 (missing strcasecmp).
-
-XFree86 3.9Pr (13 June 1999)
-2748. Xterm patch #107 (#2879, Thomas Dickey).
-2747. Cirrus driver updates, including support for generic (V4L) video
- adapters, fix depth 15 mode for the laguna chips and turn of the DAC
- when blanking the screen (#2878, Itai Nahshon).
-2746. Fix problems with the build of the 6.1-compatible Xaw shared library,
- and some optimizations and bug fixes for the Xaw and xedit (#2877,
- Paulo Cesar Pereira de Andrade).
-2745. Add functions (CreateFontRec and DestroyFontRec) for allocating and
- freeing FontRecs rather than having the size encoded in all of the
- renderer modules. Also, change the font private index handling to
- make all indices show up in all FontRecs (#2873, Mark Vojkovich).
-2744. Add ANSI prototypes for lib/XIE (#2870, Thomas Dickey).
-2743. Some preliminary work on adding afb support to the fbdev driver (#2869,
- Sven Luther).
-2742. Change the semantics of xf86ReadPciBIOS() to allow it to temporarily
- map an unmapped BIOS at the address assigned to another of the card's
- base address registers, and modify the MGA driver to make use of this
- (David Dawes).
-2741. Add some functions to the common layer to allow drivers to register
- input handling functions, and modify the pm2_video code to make use of
- this instead of the XInput code (David Dawes).
-2740. Trap for packed 24bpp on systems with 64-bit scanlines.
-2739. Fix the type of the "set_mckl" option in the s3virge driver (#2865,
- Harald Koenig).
-2738. Fix some s3virge palette problems in 8bpp mode (#2863, Harald Koenig).
-2737. Avoid clobbering CR55 in the s3virge HW cursor code (#2862,
- Harald Koenig).
-2736. Xterm patch #106 (#2861, Thomas Dickey).
-2735. Fix an incorrect test in I2CWriteBytes() in the i2c module (#2875,
- Ben Cahill).
-2734. Don't set YDSTORG for the non-WRAM Matrox cards (#2874, Mark Vojkovich).
-2733. Change the order of text-mode font restoration in the vgahw module
- (#2872).
-2732. XInput driver for Dynapro touch screens (#2859, 2860, 2867,
- David Woodhouse).
-2731. Enable support for extended PS/2 protocols on Solaris/x86 (#2857,
- Nicholas Brealey).
-2730. Fix the ZAxisMapping handling in the mouse driver (#2857,
- Nicholas Brealey).
-2729. Add a sixth valuator to the wacom driver to support the wheel of
- the airbrush and of the lens cursor (Frederic Lepied).
-2728. Convert the wacom driver to work with the new input code
- (Frederic Lepied).
-2727. Increase the MAXSCREENS value from 4 to 16 (Egbert Eich).
-2726. Add support to scanpci for printing out PCI-PCI bridge header
- information correctly (Egbert Eich).
-2725. New RAC (Resource Access Control) code (Egbert Eich).
-2724. Update the Solaris/x86 version of xf86ReadBIOS() to handle BIOSs located
- at high physical addresses (David Dawes).
-2723. An attempt at allowing the server to correct the /tmp/.X11-unix
- directory when it is possible to do so safely (David Dawes).
-2722. Re-enable screen->screen blts for the Trident Image3D, and fix a problem
- with mapping/unmapping memory with VT switching (David Dawes).
-2721. Fix a problem linking with libXfont when building the shared version
- is disabled (David Dawes).
-2720. Fix an Xlib problem introduced in 3.9Pq that shows up when X_LOCALE
- is defined (David Dawes).
-
-XFree86 3.9Pq (6 June 1999)
-2719. Change the parser's error message printing so that they will end
- up in the log file (David Dawes).
-2718. Add support for armscii-8, ibm-cp1133, mulelao-1, viscii1.1-1,
- tcvn-5712, georgian-academy, georgian-ps (not all complete yet)
- (#2843, Pablo Saratxaga).
-2717. Some fixes for the v4l driver that make it keep track of the video
- state correctly (#2854, Gerd Knorr).
-2716. Xterm patch #105 (#2853, Thomas Dickey).
-2715. Add defines to the Xaw code to make it possible to build a version
- of the shared library that is binary compatible with the standard 6.1
- version (#2849, Paulo Cesar Pereira de Andrade).
-2714. Xedit updates (see the Xaw Changelog for details) (#2849,
- Paulo Cesar Pereira de Andrade).
-2713. Bump the Xaw library major version (now 7.0), and enable the Xpm
- dependency by default (#2849, Paulo Cesar Pereira de Andrade).
-2712. Fix an Xmu build warning (#2849, Paulo Cesar Pereira de Andrade).
-2711. Some updates to the XAnti extension (#2851, 2852, Mark Vojkovich).
-2710. Update the scanline width choices used in the MGA driver to better
- match the capabilities of the different chips (#2850, Mark Vojkovich).
-2709. Add G400 support to the MGA driver (#2850, Mark Vojkovich).
-2708. Resync SuperProbe with 3.3.3.1e, and add ATI Rage XL & XC detection
- (#2847, Marc La France).
-2707. Fix for drivers/v4l/README (#2846, David Woodhouse).
-2706. Fixes for the big5.eten-0 and gb2312.1980-0 encoding files (#2840, 2841,
- 2846, Juliusz Chroboczek).
-2705. Use 8-bit I/O instead of 16-bit I/O in xf4bpp (better for older
- adapters), and some cleanups (#2838, Marc La France).
-2704. Fix RGB "masks" for depth <=8, and fix the formatting of the "Clocks"
- messages (#2838, Marc La France).
-2703. Remove assumption that PCI systems contain PCI video (#2838,
- Marc La France).
-2702. Add missing parsing of the ZAxisMapping option to the revised mouse
- driver (David Dawes).
-2701. Add a simple verification check for core-capable input devices
- (David Dawes).
-2700. Update the serial PnP mouse support for the revised mouse driver
- (David Dawes).
-
-XFree86 3.9Pp (30 May 1999)
-2699. Xterm patch #104 (#2836, Thomas Dickey).
-2698. Doc updates for the s3virge driver, and cleanup register debugging
- printouts (#2835, Kevin Brosius).
-2697. Rework the config file search algorithm, and allow "safe" relative
- paths to be specified by non-root users (David Dawes).
-2696. Close input devices while VT switched away (David Dawes).
-2695. Prevent the input device "PreInit" from being called in subsequent
- server generations (David Dawes).
-2694. Handle the Keyboard config information as an InputDevice section
- (but the keyboard driver isn't converted yet) (David Dawes).
-2693. Add basic accessEnable calls to the Tseng driver so that it will at
- least work single head with an ET6000 (David Dawes).
-2692. Fix Xinerama bugs related to the Shape extension (#2832, Mark Vojkovich).
-2691. Separate the pitch and virtual X increments (#2829, Marc La France).
-2690. Add some large encoding files for the `fontenc' layer (#2827,
- Juliusz Chroboczek).
-2689. A rewrite of the way Xinerama handles visuals (#2824, Mark Vojkovich).
-2688. Integrate the pointer acceleration patch from Kevin Brown (#2823,
- Frederic Lepied).
-2687. Make button mapping work for XInput "AlwaysCore" devices (#2823,
- Frederic Lepied).
-2686. Fix xtest failure with SiS TwoPointLine (#2821, Juanjo Santamarta).
-2685. Xlib support for KOI8-U (#2820, Aleksey Novodvorsky).
-2684. Fix a problems with the new mouse code looping by adding CLOCAL to
- the standard termios flags for xf86OpenSerial() (#2819, Matthieu Herrb).
-2683. New font document (#2818, Juliusz Chroboczek).
-2682. Fix the reworked "wsmouse" code for NetBSD (#2815, Matthieu Herrb).
-2681. Fix for `resize' on OpenBSD (#2814, Matthieu Herrb).
-2680. Add the `s' flag to ArCmd and ArAddCmd for SVR4 so that empty archives
- can be created (#2813, Nicholas Brealey).
-
-XFree86 3.9Po (23 May 1999)
-2679. Enable the new input code (NewInput) by default in xfree86.cf
- (David Dawes).
-2678. Add compatibilty support for interpreting "Pointer" sections as
- "InputDevice" sections in the reworked input device code (David Dawes).
-2677. Modify mkfontdir to handle duplicate encodings in a reasonable way
- when generating the encodings.dir file (#2812, Juliusz Chroboczek).
-2676. Xaw and xedit updates (see lib/Xaw/Changelog for details) (#2811,
- Paulo Cesar Pereira de Andrade).
-2675. Fix xinerama problems with clipmasks and stipple/tile offsets
- in GCs used on the root window (#2810, Mark Vojkovich).
-2674. Fix problems uploading to the pixmap cache in 8+32 mode when
- ImageWrites aren't available (#2809, Mark Vojkovich).
-2673. Ansify the Xv client library (#2808, Mark Vojkovich).
-2672. Add a XvQueryPortAttributes request to the Xv API/protocol and
- driver interface, with an example in the v4l driver, and update the
- documentation (#2808, Mark Vojkovich).
-2671. Fix some compiler warnings in the oldX and ICE libraries (#2807,
- Matt Grossman).
-2670. Fix a problem with the Type1 font handling that was introduced when the
- CID support was added (#2805, Ivan Bach).
-2669. Wacom driver update, including a fix for initialization problems with
- Wacom IV devices, and improved Wacom V device support (Lens cursor
- support) (#2803, Frederic Lepied).
-2668. Fix for some 8+32 xinerama problems (#2802, Mark Vojkovich).
-2667. Xkb fixes for PC98 (#2800, Akio Morita).
-2666. Xkb data files for a Macintosh keyboard (#2798, Sven LUTHER).
-2665. Some preliminary support for the "new" mouse driver for most OSs
- (David Dawes).
-2664. Prevent xf86LogInit() being called for subsequent server generations.
-
-XFree86 3.9Pn (16 May 1999)
-2663. Add a SetClientVersion request to the DGA extension (David Dawes).
-2662. Change DGA initialisation ordering in the MGA driver (#2796,
- Mark Vojkovich).
-2661. Turn off DGA pixmaps in xinerama since it insists on duplicating
- the rendering protocol on all heads despite the DGA pixmaps existing
- only on a single head (#2795, Mark Vojkovich).
-2660. Fix some xinerama problems with 8+32 overlays (#2795, Mark Vojkovich).
-2659. Add XAA acceleration for DGA pixmaps (#2795, Mark Vojkovich).
-2658. Add PCI IDs for new NVIDIA chipsets (#2794, Mark Vojkovich).
-2657. Change the default cursor colour in the app-defaults for editres
- (#2793, Paulo Cesar Pereira de Andrade).
-2656. Xedit updates, including a new Xedit-color.ad file, to show some of
- the new features of Xaw, and some improvements to the ispell interface
- (#2793, Paulo Cesar Pereira de Andrade).
-2655. Xaw updates, including some fixes, optimizations, and additional
- documentation (#2793, Paulo Cesar Pereira de Andrade).
-2654. Working mouse support with the new input device code (David Dawes).
-2653. Fix for sysv_video.c on Interactive UNIX (#2792, Michael Rohleder).
-2652. Fix handling of xkbcomp's -I flag (Stanislav Meduna).
-2651. CID updates (third submission) (#2769, Ivan Bach, SGI).
-2650. Kludge to allow a server with the glint driver to link without XInput
- (#2788, Marc La France).
-2649. Remove unused dacSpeeds field from the ScrnInfoRec (#2788,
- Marc La France).
-2648. Add an option to the colourmap code to allow a driver's LoadPalette()
- to be called even when switched out (#2788, Marc La France).
-2647. Add more reasons for rejecting a mode (#2788, Marc La France).
-2646. Factor in the log verbosity when reporting the verbosity to a driver
- (#2788, Marc La France).
-2645. Allow xf86GetClocks() to be called with NULL ProtectRegs() and
- BlankScreen() functions (#2788, Marc La France).
-2644. When deleting a screen, also free its mode lists and options (#2788,
- Marc La France).
-2643. Allow a driver to determine if -probeonly was specified (#2788,
- Marc La France).
-2642. Fix a large jump in changelog numbering that happened a little while
- ago (#2788, Marc La France).
-2641. Various warning and include fixes (#2788, Marc La France).
-2640. Xterm patch #103 (#2786, Thomas Dickey).
-2639. SiS driver updates, including fixing the SetMClk option, change solid
- lines from bresenham to two-point, correct a clippling bug, and change
- the verbose level of some messages (#2784, 2785, Juanjo Santamarta).
-2638. Fix a server loop that can happen when VT switching while a grab is
- in progress (#2782, Edward Wang).
-2637. Xterm patch #102 (#2778, Thomas Dickey).
-2636. Fix some spelling errors in Xlib.h (#2775, Itai Nahshon).
-2635. Add auto-detection of Debian to imake (#2774, Sven Luther).
-2634. SiS driver updates, including turning on solid line acceleration,
- remove GXCOPY_ONLY for Mono8x8 patterns, change mmio pointers to
- volatile to avoid optimization problems, use xaarop.h, fix offscreen
- memory init to avoid exceeding the accelerator's address range
- (#2772, Alan Hourihane).
-2633. Fix build problems with the v4l driver on some systems (based on #2771,
- Gerd Knorr, and a suggestion from David Woodhouse).
-2632. Xterm patch #101 (#2770, Thomas Dickey).
-2631. Fix some more Xinerarma bugs (#2766, 2768, Mark Vojkovich).
-2630. Fix the use of va_lists in the logging code (David Dawes).
-
-XFree86 3.9Pm (9 May 1999)
-2629. Clean up the handling of Alphas in the s3virge driver (#2767,
- Matt Grossman).
-2628. Fix a problem that can show up when a module is unloaded while another
- module has unaccounted for references to its symbols (Egbert Eich).
-2627. -
-2626. Finish DGA event support (#2765, Mark Vojkovich).
-2625. Xaw updates (including compatibility updates and a man page), xedit
- and editres updates (#2764, Paulo Cesar Pereira de Andrade).
-2624. Disable MIT-SHM in Xnest since it doesn't work (#2763, Wolfram Gloger).
-2623. Add hw clipping for the SiS 6326, and solid lines (disabled) (#2760,
- Juanjo Santamarta).
-2622. Cirrus driver updates (#2759, Itai Nahshon).
-2621. Fix complier warnings in lib/X11 (#2758, Matt Grossman).
-2620. Fix complier warnings in lib/Xau (#2757, Matt Grossman).
-2619. Update some of the font encoding translation files (#2756,
- Juliusz Chroboczek).
-2618. Fix some bugs in the font encoding support (#2756, Juliusz Chroboczek).
-2617. Update the Arabic24 BDF font to version 1.3 (#2754, Mark Leisher).
-2616. Xterm patch #100 (#2753, Thomas Dickey).
-2615. A start at the unification of input devices (David Dawes).
-2614. Change the MGA ImageWrite code to not use the image transfer window
- for simple cpu->framebuffer copies (#2738, Mark Vojkovich).
-2613. Add lseek and bsearch to the libc wrappers (and fix fseek), as needed
- by the CID font code.
-2612. Add missing file for CID fonts support, and fix a few module-related
- thing with it.
-
-XFree86 3.9Pl (3 May 1999)
-2611. Fix Xinerama bugs in GetImage and PolyRectangle (#2751, Mark Vojkovich).
-2610. Xterm patch #99 (#2750, Thomas Dickey).
-2609. Disable unneccessary C&T message (#2748, Nozomi Ytow).
-2608. Add some DGA event support (not working yet) (#2747, Mark Vojkovich).
-2607. Xaw and xedit updates including some compatibility updates and
- performance improvements (#2746, Paulo Cesar Pereira de Andrade).
-2606. Modify mkfontdir to create "encodings.dir" files (#2745,
- Juliusz Chroboczek).
-2605. Update the DESIGN doc for the new DGA driver interface (#2744,
- Mark Vojkovich).
-2604. Update the LynxOS vidmem code to use the new shared vidmem.c (#2743,
- Thomas Mueller).
-2603. -
-2602. Update TGA docs (#2737, Matt Grossman).
-2601. Fix a zero width problem that shows up in xaaSpans.c when hardware
- clipping is enabled (#2736, Alan Hourihane).
-2600. Add support for Adobe CID fonts (#2728, Ivan Bach, SGI).
-2599. Quick fix for cirrus driver problem introduced in 3.9Pk.
-2598. Fix a problem with pcitweak that was preventing it from working with
- buses other than bus 0 (David Dawes).
-2597. Update xfontsel to display appropriate glyphs for ISO10646 fonts
- (Mark Leisher).
-2596. Add support for building XF86Setup with ncurses on NetBSD and OpenBSD
- (#2734, Matthieu Herrb).
-2595. Fix vidmem map/unmap mismatch in the TGA driver (#2733, Matt Grossman).
-2594. A minor interlace improvement for the PM2 Xv driver (#2731,
- Michael Schimek).
-2593. Fix color expansion bug in the SiS driver (#2729, Juanjo Santamarta).
-2592. Major resync for OS/2 (#2727, 2732, 2735, Holger Veit).
-2591. Xterm patch #98 (#2726, 2730, Thomas Dickey).
-2590. Fix a build V4L driver build problem (#2725, David Woodhouse).
-2589. Xterm patch #97 (#2724, Thomas Dickey).
-2588. Move the VTInit and VTSysReq keywords from the Keyboard section to
- the ServerFlags section (as options) (David Dawes).
-2587. Remove the legacy ServerNumLock and "RightAlt", etc special key mapping
- support (David Dawes).
-2586. Add a new, more complete version of snprintf, vsnprintf for OSs that
- don't have it. This one is based on the "SIO" stdio-like package
- (David Dawes).
-2585. Add log file support, including separate log and stderr streams, and
- separate verbosity levels for each stream. Changed the -verbose option
- to accept an optional integer argument that specifies the verbosity
- level, add a -logverbose option and a root-only -logfile option
- (David Dawes).
-2584. Unify the "Overlay" options and "SetMclk" options, and remove the
- SetMClk Device section keyword (David Dawes).
-2583. Add a "frequency" option value type for use with options processed
- by xf86ProcessOptions(). This value type consists of a floating point
- number optionally followed by "Hz", "kHz" or "MHz" (David Dawes).
-
-XFree86 3.9Pk (25 April 1999)
-2582. Move the SVR4-specific handling of mapping memory areas which have
- read side-effects out of the drivers and into the os-support layer
- (David Dawes).
-2581. Fix unmap parameters for the SiS driver (David Dawes).
-2580. Fix unmap parameters for the glint driver (#2722, Alan Hourihane).
-2579. Fix the depth 24 visual initialisation (mask, offset) in the
- Rendition driver (#2720, Martin Cerveny).
-2578. Rework the use of inb/outb in the trident driver, replacing it with
- MMIO. Also, don't use the 0xBF000 range for the accelerator registers
- (#2719, Alan Hourihane).
-2577. Add a -screen option to the xgamma utility so that the gamma of each
- screen can be changed in Xinerama mode (#2717, Mark Vojkovich).
-2576. Fix all the known problems with the ispell support in xedit (#2716,
- Paulo Cesar Pereira de Andrade).
-2575. Xaw updates, including improved speed for FindPiece in AsciiSrc.c,
- add submenu support to the SimpleMenuWidget, add support for text
- justification to the TextWidget, add an overwrite mode to the
- TextWidget, make the TextWidget understand negative "multiply" values,
- add an indent action to the TextWidget, fix a bug in the undo code
- (#2716, 2721, Paulo Cesar Pereira de Andrade).
-2574. Pcitweak fix for LynxOS, and define NO_MMAP for pre 2.5.0 LynxOS
- releases (#2715, Thomas Mueller).
-2573. Fix for cirrus hardware cursor on (big endian) PowerPC platform
- (#2715, Thomas Mueller).
-2572. Experimental DDC support for the Matrox "G" series cards (#2713,
- Andrew Aitchison).
-2571. Fix a crash in the XAA fill code that happens when
- Mono8x8PatternFillFlags is set only to HARDWARE_PATTERN_PROGRAMMED_BITS,
- which affects the TGA driver (#2712, Matt Grossman).
-2570. Replace the default "fixed" (6x13) font with Markus Kuhn's ISO 10646-1
- version (#2711, Markus Kuhn).
-2569. Import Mark Leisher's ClearlyU BDF fonts (#2707, Mark Leisher).
-2568. Import Mark Leisher's Arabic24 BDF font (#2706, Mark Leisher).
-2567. Initial acceleration for the 24-plane TGA (#2710, Tim Rowley).
-2566. Fix clip bugs in the MGA driver (#2709, Mark Vojkovich).
-2565. Update the `xfsft' TrueType backend to version beta1.1.4. This includes
- updates to the `fontenc' interfaces (#2708, Juliusz Chroboczek).
-2564. Fix some #include problems with the rendition driver (#2704, Dejan Ilic).
-2563. Fix a syntax error in the `ru' symbols file (#2703, Peter Novodvorsky).
-2562. Update the xf86SetGamma and xf86SetDpi helpers to use DDC information
- when it is available, and update the MGA driver to make the DDC
- information available earlier in the PreInit phase (#2702,
- Andrew Aitchison).
-2561. Flesh out XF86Setup's config file read and write routines (#2701,
- Joe Moss).
-2560. Parser fixes (#2700, Joe Moss).
-2559. Remove the out of date references to the sparse map mem functions from
- the loader (#2699, Matt Grossman).
-2558. Color expansion for the SiS driver, and change the "NoTurboQueue" option
- to "TurboQueue" (#2696, Juanjo Santamarta).
-2557. Xterm patch #96, including improved logic for bold fonts, improved
- Unix98 PTY support, and modify initial-erase logic to ensure that the
- ttyModes resource overrides it (#2695, Thomas Dickey).
-2556. Some #include and warning fixes (#2693, Marc La France).
-2555. On an error, tell user to re-run the server >without< -quiet. This is
- generalized to allow the production of error messages to specify the
- minimum verbosity to be used before reporting a problem (#2693,
- Marc La France).
-2554. Make -depth 24 produce a more appropriate message when the driver
- doesn't support it (#2693, Marc La France).
-2553. Reinstate black & white colour options for 1bpp (#2693, Marc La France).
-2552. Fix a typo in XF86Conf.man (#2691, Itai Nahshon).
-2551. Fix the initialisation of some global flags when the config file has
- no ServerFlags section (David Dawes).
-
-XFree86 3.9Pj (18 April 1999)
-2550. Update SiS docs (#2690, Juanjo Santamarta).
-2549. Glide driver and documentation updates. Fix the "EXTERN_MODULE"
- usage, force the virtual size to be the display size, and add a
- GlideDevice Option to specify one of multiple cards (#2689,
- Henrik Harmsen).
-2548. Resync DPMS timeout code with the 3.3.x code, which fixes some problems
- (#2688, David Wragg).
-2547. Preliminary MTRR support for FreeBSD (3.2 and later) (David Dawes).
-2546. Separate the OS-independent and OS-dependent parts of the MapVidMem
- functions, and handle sparse mapping with a flag to MapVidMem instead
- of using a separate function (David Dawes).
-2545. Remove most LinkKit references.
-2544. Disable WC for the framebuffer for the Rendition V1K by default,
- because it appears to be causing lockups (Dejan Ilic).
-2543. Some fixes for the Rendition driver (Dejan Ilic).
-2542. Add HW cursor using the Bt485 ramdac to the DEC TGA driver (#2687,
- Matt Grossman).
-2541. More of the DGA 2.0 extension. Most of it is there now except for
- the events (#2686, Mark Vojkovich).
-2540. Imlement attributes for Audio (mute, volume) and implement
- QueryBestSize for the v4l driver (#2685, Gerd Knorr).
-2539. Fix hardware cursor code so that it works with the internal 64 bit
- scanlines used on Alpha platforms (#2679, Matt Grossman).
-2538. Export new DGA symbols from the loader (#2678, Alan Hourihane).
-2537. Update C&T driver to use independent clocks for FP/dual and CRT modes
- with HiQV chipsets (#2677, Egbert Eich).
-2536. Port of Precision Insight's NeoMagic driver to the new design
- (#2677, Egbert Eich).
-2535. Add a Linux kernel backbone to the Permedia 2 Xv driver (#2661+revisions,
- Michael Schimek).
-2534. Port of the rendition driver to the new design (#2674, Marc Langenbach).
-2533. Fix for the parser's printDeviceSection() function (#2673, Joe Moss).
-2532. Fix a bug in the handling of ZAxisMapping in the parser (#2672,
- Nicholas Brealey).
-2531. Enable mono 8x8 pattern fills for the SiS driver (#2670,
- Juanjo Santamarta).
-2530. Remove references to ru_SU in locale.alias (#2669, Aleksey Nowodworsky).
-2529. Fix a bug in xf86CollectOptions() that could cause a server crash.
-2528. Fix the problem causing the mouse acceleration to be done twice
- (#2671, Frederic Lepied).
-2527. Disable clipping in the trident driver for FillRectSolid because the
- driver gets passed zero values (#2681, Alan Hourihane).
-2526. Add Trident Blade3D support (#2681, Alan Hourihane).
-2525. Add Mono8x8 pattern for the Trident Image series (#2681, Alan Hourihane).
-2524. Fix trident screen glitches when mode switching (#2681, Alan Hourihane).
-2523. Some minor documentation-related cleanups. Doctools version 1.0.2 is
- now required to format the XFree86 docs.
-
-XFree86 3.9Pi (11 April 1999)
-2522. Fix a Linux/PPC loader relocation bug, and reenable building the
- loadable server by default for Linux/PPC (#2668, Gerd Knorr).
-2521. Fix a problem with non-terminated strings in the Xv library (#2665,
- Gerd Knorr).
-2520. Update the v4l driver -- fix open/close handling and add support for
- the XV_ENCODING attribute (#2665, Gerd Knorr).
-2519. Implement FBDevSaveScreen() (#2664, Gerd Knorr).
-2518. Enable shadowfb by default for the fbdev driver (#2664, Gerd Knorr).
-2517. Fix fbdev option handling (#2664, Gerd Knorr).
-2516. Fbdev documentation updates (#2664, Gerd Knorr).
-2515. Some more progress on the DGA 2.0 API/protocol (#2663, Mark Vojkovich).
-2514. Add ispell support to xedit (#2662, Paulo Cesar Pereira de Andrade).
-2513. Fix -DUSE_XPM handling in Xaw (#2662, Paulo Cesar Pereira de Andrade).
-2512. Some updates to the offscreen memory allocator and the i2c code
- (#2661, Michael Schimek).
-2711. Use the correct version of xf86Xinput.c (the wrong version was
- included in 3.9Ph) (Frederic Lepied).
-2710. Fix a pcitweak build problem on NetBSD (#2659, Isao Ohishi).
-2509. Add acceleration for the 8+16 mode of the C&T driver (#2658,
- David Bateman).
-2508. Add compatibility to the client-side of the VidMode extension so that
- it will work with 3.3.x servers (#2657, David Bateman).
-2507. Update 'ru' xkb symbols file (#2656, Aleksey Nowodworsky).
-2506. Add Trident 9525 ID to PCI info and trident driver (#2655,
- Alan Hourihane).
-2505. Cleanup some compiler warnings in mfb and mi (#2654, Alan Hourihane).
-2504. Added a glide driver. It currently only works with the loadable
- server (read the manpage before trying it) (#2653, Henrik Harmsen).
-2503. Update the Type1/latin2 fonts.* files to disable reencoding of the
- fonts while keeping the same XLFD names (#2652, Juliusz Chroboczek).
-2502. Fix some pcitweak build problems on Interactive UNIX (#2651,
- Michael Rohleder).
-2501. Xterm patch #95 (see xterm.log.html for details) (#2649, Thomas Dickey).
-2500. Fix typos in the VidMode extension that causes a protocol problem
- (#2648, 2657, David Bateman).
-2499. Reorder the visuals to put TrueColor before DirectColor so that broken
- clients (like Wabi) that assume the default visual is the first visual
- will work (2647, David Woodhouse).
-2498. Fix a problem with the ThinkingMousePS/2 protocol handling of left
- movement (#2392, Ian Remmler).
-2497. Fix an ISO8859-5 support bug in Xlib (Nikolai Saoukh).
-2496. Rework the GlxInitVisuals hooks with a more general wrapper-based
- mechanism (David Dawes).
-2495. Fix a XINERAMA bug in dix/events.c (Dirk Hohndel).
-
-XFree86 3.9Ph (5 April 1999)
-2494. Add code to XF86Setup for mode adjustment (like xvidtune), addition,
- and removal (#2646, Joe Moss).
-2493. Remove the use of the `dialog' program from XF86Setup, and add
- various curses routines and the start of a text mode user-interface
- (both curses & plain text). Also remove some obsolete Tk 4.0-specific
- code (#2645, Joe Moss).
-2492. Add code to XF86Setup to convert all of the config file sections
- to/from Tcl variables (#2644, Joe Moss).
-2491. Allow fbdev to handle non-page-aligned framebuffers correctly (#2643,
- Gerd Knorr).
-2490. Add RAC code to the fbdev driver (if there is a PCI BusID specified
- in the config file it will "check in" this into access control)
- (#2643, Gerd Knorr).
-2489. Cleanup in sysv_video.c (#2642, Michael Rohleder).
-2488. Update xedit's realpath.c for IUS (#2642, Michael Rohleder).
-2487. Add support for InputDevice sections to the parser (not used yet)
- (David Dawes).
-2486. A first cut at cleaning up the handling of memory mapping and client
- exit/crash in the DGA library (David Dawes).
-2485. Shadowfb support for the generic VGA driver at depths 4 and 1
- (Dirk Hohndel and Mark Vojkovich).
-2484. Fix the printMonitorSection and printDeviceSection functions in
- the parser (#2641, Joe Moss).
-2483. Change the s3virge chipset names, removing the slashes (#2640,
- Kevin Brosius).
-2482. Preliminary s3virge man page (#2640, Kevin Brosius).
-2481. Fix s3virge HW cursor (#2640, Kevin Brosius, Mark Vojkovich).
-2480. Remove some multiply defined variables in the cfb modules to avoid
- a problem on LynxOS PowerPC (#2639, Thomas Mueller).
-2479. Fix a crash in the new xedit code for listing files and directories
- (#2638, Paulo Cesar Pereira de Andrade).
-2478. Change the kill_ring code in TextAction.c to always end in a text block
- of zero length (#2638, Paulo Cesar Pereira de Andrade).
-2477. Add xpm pixmap support to Xaw (needs to be built with -DUSE_XPM
- for this), and if the xpm image has a mask, the widget will be
- automatically reshaped to the pixmap mask (#2638,
- Paulo Cesar Pereira de Andrade).
-2476. Add some PCI IDs for Creative Labs 3D Blaster Banshee PCI (#2637,
- Nicholas Brealey).
-2475. XAA pixmap->window and window->pixmap copy optimization (#2636,
- Mark Vojkovich).
-2474. Implement some attributes for the v4l module, and fix the clipping
- code (#2635, Gerd Knorr).
-2473. Incorporate 3.3.1 FIFO settings for the SiS driver based on memory
- bandwidth and pixel clock (#2632, Juanjo Santamarta).
-2472. SetMclk and FastVram options for the SiS driver (#2632,
- Juanjo Santamarta).
-2471. Fix some SiS mode switch problems (#2632, Juanjo Santamarta).
-2470. Imakefile fix for building the X server with BuildGlxExt=NO (#2631,
- Thomas Mueller).
-2469. Imakefile fixes for cxpm and sxpm (#2631, Thomas Mueller).
-2468. LynxOS resync, including removing the CrossCompile rule from lynx.cf,
- LynxOS sparc resync, remove SMEM warning for default verbose level,
- LynxOS support for chips driver util programs (#2631, Thomas Mueller).
-2467. Add man pages for the fbdevhw and fbdev modules (#2630, Gerd Knorr).
-2466. Add fb.h so that fbdevhw can be built on pre-2.2 Linux (#2630,
- Gerd Knorr).
-2465. Add support for generic Xv adaptors to the fbdev driver (#2629,
- David Woodhouse).
-2464. Fix X locale problem for Linux/libc6 introduced in 3.9Pg (#2628,
- Nozomi Ytow).
-2463. Fix VT switching problems with the 8+16 code (#2627, David Bateman).
-2462. Generic Xv support for the s3virge driver (#2626, David Woodhouse).
-2461. Add a permission notice to videodev.h (#2625, David Woodhouse).
-2460. Resync parts of the XInput DDX code with 3.3.x, including restoring
- the "Switch" device, RELATIVE_CHECK code, Elographics driver,
- Wacom driver, and Joystick driver (#2514, 2548, Frederic Lepied
- and Patrick Lecoanet).
-2459. Fix remaining build issued with the GLX/Mesa integration
- (Marc La France).
-2458. Some preliminary support code that the new RAC code may use
- (David Dawes).
-2457. Add a utility called `pcitweak' that can be used to read/write
- registers in the PCI config space from the command line (David Dawes).
-
-XFree86 3.9Pg (29 March 1999)
-2456. Fix an off-by-one clipping error in the XAA wide line code (#2624,
- Mark Vojkovich).
-2455. Add HW cursor support to the s3virge driver and make it the default
- (#2623, Kevin Brosius).
-2454. Add OS-specific subdirectories to the loader subdirectory search lists,
- and install OS-specific modules in such directories (David Dawes).
-2453. Set the screen numbering in multihead configurations based on the
- ordering of the Screen entries in the ServerLayout section,
- and allow an optional numerical argument to follow the Screen
- keyword to indicate a different ordering (David Dawes).
-2452. Fix some signedness discrepancies in the libc_wrapper code.
-2451. Add missing parts to the parser's printKeyboardSection routine (#2621,
- Joe Moss).
-2450. Finalising the DGA 2.0 driver interface (#2619, Mark Vojkovich).
-2449. Xterm patch #94 (#2618, Thomas Dickey).
-2448. Accelerated support for 8+16 overlays in XAA (untested) (#2617,
- Mark Vojkovich).
-2447. Some optimisations for the 8+32 and 24+32 layers (#2616, Mark Vojkovich).
-2446. Updates for IUS (Interactive Unix) (#2614, Michael Rohleder).
-2445. Update xf86config for the 4.0 config file format (#2613,
- Justin Bradford).
-2444. Update and clean up the Cards file (#2600, 2612, Justin Bradford).
-2443. When probing for a VGA, it's unnecessary to unlock its CRTC registers
- (#2611, Marc La France).
-2442. Remove xf86FreeBusSlots(), which is redundant, unused and incorrect
- (#2611, Marc La France).
-2441. Move the claiming of ISA resources from xf86Check???Slot() to
- xf86Claim???Slot() (#2611, Marc La France).
-2440. On Linux, define _GNU_SOURCE only compiling the xc/ source tree (#2611,
- Marc La France).
-2439. Remove uneeded s3virge files (#2615, Kevin Brosius).
-2438. "pci_burst" option updates for the s3virge driver (#2615, Kevin Brosius).
-2437. Fix missing accel flags and depth 24 problem with the s3virge driver
- from the Alpha patch (#2615, Kevin Brosius).
-2436. Make sure the size of offscreen pixmaps don't exceed the address space
- of the ViRGE (#2610, Mark Vojkovich).
-2435. Add a driver for video4linux frame grabber cards (#2609, Gerd Knorr,
- David Woodhouse).
-2434. Add support to the MGA driver so that it will use any available
- generic Xv adaptors (#2609, David Woodhouse).
-2433. Add xf86XVRegisterGenericAdaptor() and xf86XVListGenericAdaptors()
- functions for maintaining a list of Xv adaptors which are not tied
- to a particular screen (#2609, David Woodhouse).
-2432. Fix virtual screen panning with the SiS driver (#2608,
- Juanjo Santamarta).
-2431. Fix security problem with the creation of the /tmp/.X11-unix directory
- (#2607, Matthieu Herrb).
-2430. Update the 8+16 layer to get the color key from the new field in
- the ScrnInfoRec (#2605, Mark Vojkovich).
-2429. Complete the Xv config evaluation code in the PM2 Xv driver and the
- common layer (#2604, Michael Schimek).
-2428. Modify Xv DDX's clipping interface (#2604, Michael Schimek).
-2427. Fix a bug in the handling of Boolean options (#2603, Michael Schimek).
-2426. Have xf86ChangeGamma() update and install the default colormap
- when the currently installed colormap is not implemented by lookup
- (#2602, Mark Vojkovich).
-2425. Export StoreColors() (#2601, Mark Vojkovich).
-2424. Replace all Imakefile.obj files with Imakefile.inc because .obj is
- a reserved extension for object file on OS/2 (#2599, Holger Veit).
-2423. Update the Cards file parser to accept a new DRIVER line (#2598,
- Justin Bradford).
-2422. Fix getline clash in proxymngr and xsm (#2595, Dejan Ilic).
-2421. Fix colourmap on Permedia2, and fix GLINT SaveScreen to blank the
- display (#2594, 2596, Alan Hourihane).
-2420. Make fbdev work on Sparc Linux, and fix a few bugs in fbdevhw and
- fbdev (#2593, Jakub Jelinek).
-2419. Sparc Linux support for XFree86 (#2593, Jakub Jelinek).
-2418. Add DPMS support to the s3virge driver (#2592, Matt Grossman).
-2417. ppc_flush_icache() for Linux/PPC, required for the loader to work
- correctly (#2591, Gerd Knorr).
-2416. Linux/PPC loader fix (#2590, Stuart Anderson).
-2415. Modify the ramdac module and glint driver to use the ScrnInfoRec
- overlay fields (#2589, 2594, Alan Hourihane).
-2414. Add RTL ethernet and VIA APCI PCI devices to the ID list (#2588,
- Kevin Brosius).
-2413. Fix a problem with $(STD_CPP_DEFINES) that was introduced in 3.9Pf.
-2412. Add VESA default modes, small perl hack to create an initialized data
- structure from them, and the code to use those modes as default if no
- other modes with the same name are defined (Dirk Hohndel).
-
-XFree86 3.9Pf (21 March 1999)
-2411. Fix some malloc problems in xf86xv.c (#2587, Michael Schimek).
-2410. Fix building of Xprt, Xnest and Xvfb when doing a loader build
- (David Dawes).
-2409. Updates to s3virge driver to get it working under Linux/Alpha
- (#2586, Matt Grossman).
-2408. Fix getline() clash (#2585, Alan Hourihane).
-2407. Have the s3virge driver use the new XAA rop helper functions (#2584,
- Mark Vojkovich).
-2406. Add code to SuperProbe to detect the S3 Trio3D and Savage3D
- (2583, Eric Molitor).
-2405. Add some XAA helper functions that drivers can call for help
- converting X rops into MS rops (#2582, Mark Vojkovich).
-2404. Resync the overlay support in the glint driver (#2580, 2581,
- Mark Vojkovich).
-2403. Add support for changing the overlay color key to the MGA driver
- (#2579, Mark Vojkovich).
-2402. Preallocate the color key in the default colormap and set it to
- something already in the default man (black) so that AllocColor will
- never allocate it (#2578, Mark Vojkovich).
-2401. Use the color key field in the ScrnInfoRec for the overlay layers
- (#2578, Mark Vojkovich).
-2400. Preliminary loader support for Linux/PPC ELF objects (#2577 (2570),
- Stuart Anderson).
-2399. Fix some XAA offscreen pixmap problmes (#2576, Mark Vojkovich).
-2398. DGA fixes. Old apps should now run with the new driver interface,
- and event handling should work better than before (#2575,
- Mark Vojkovich).
-2397. Fix most remaining signed/unsigned and prototype warnings in the
- following directories: lib/Xaw, lib/Xmu, programs/xclipboard,
- programs/xconsole, programs/xmag, and programs/xvidtune (#2574,
- Thomas Dickey).
-2396. Restore the interface of XmuConvertStandardSelection() to use
- XPointer rather than XtPointer (#2574, Thomas Dickey).
-2395. Fix an malloc size bug in libICE (#2572, Christopher Sekiya).
-2394. Make MIT-SHM resource types non-static so that other extensions
- (like Xv) can access client shared memory segments (#2571,
- Mark Vojkovich).
-2393. First cut at altering the C&T user docs for 4.0 (#2569, David Bateman).
-2392. Fix a C&T problem affecting the colourmap setup for 1bpp modes, and some
- other minor C&T driver fixes (#2569, David Bateman).
-2391. Fix an buffer overflow in os/connection.c (#2568, Gerd Knorr).
-2390. Add support for Modes sections and the UseModes keyword for Monitor
- sections to the parser (#2567, Dirk Hohndel).
-2389. Fix xfree86.cf for Alpha (#2567, Dirk Hohndel).
-2388. Fix XAAFillPolygonStippled to obey the flag NO_TRANSPARENCY in
- Mono8x8PatternFill (#2566, Xavier Ducoin).
-2387. Only allow the shadowfb layer in the C&T driver when linear addressing
- is enabled (#2565 (2561), David Bateman).
-2386. Fix some problems with the xf8_16bpp layer, and allow it to work
- with depth 15 as well as 16 (#2565 (2561, 2562), David Bateman).
-2385. Implement TrueColor with PseudoColor Overlays (8+16) for the
- C&T driver for HiQV chipsets (#2565 (2561), David Bateman).
-2384. Add a -quiet option to xgamma (#2565 (2561), David Bateman).
-2383. Add TrueColor Gamma Correction for C&T HiQV chipsets (#2565 (2561),
- David Bateman).
-2382. Fix Permedia 2 HW cursor lockup (#2563, Alan Hourihane).
-2381. Initial XAA support for SiS530 and SiS620 (#2560, Xavier Ducoin).
-2380. Add SuperProbe for SiS (#2559, Xavier Ducoin).
-2379. Fix the InstalMultipleMan and InstallMultipleManSuffix rules for
- NetBSD and OpenBSD (#2558 (2557), Matthieu Herrb).
-2378. Add Cards entry for Number Nine FX Reality 772 (#2556, Harald Koenig).
-2377. Make XF86Setup build again (not fully functional yet) (#2555, Joe Moss).
-2376. Update the apm (Alliance Promotion) driver to the 4.0 interface (#2554,
- Loic Grenie, Henrik Harmsen).
-2375. Add some rules for driver/module man pages, and add a sample driver
- man page for the mga driver (David Dawes).
-2374. Update the Option Names section of xfree86/Registry (David Dawes).
-2373. Merge the OPTV_BOOLEAN and OPTV_TRI option classes, removing the
- latter. Update code affected by this (David Dawes).
-2372. Fix the BackingStore option.
-2371. Disable transparency for screen->screen copies for Trident Image for
- now.
-2370. Trident Image transparency update (#2564, Alan Hourihane).
-
-XFree86 3.9Pe (14 March 1999)
-2369. Fix problems debugging archive library modules on Linux with long
- member names (Paul Flinders).
-2368. Add new XAA clipping for Trident Image (#2553, Alan Hourihane).
-2367. Fix Trident save screen so that it blanks the display (#2553,
- Alan Hourihane).
-2366. Fix tranparency for the Trident Image cards (#2553, Alan Hourihane).
-2365. Remove the panmi and pandix directories, since they're no longer
- needed.
-2364. Add gamma correction to the C&T driver, but disabled because it doesn't
- work yet (David Bateman).
-2363. Add shadow fb support to the C&T driver (David Bateman).
-2362. Finish off the VidMode extension backward compatibility code
- (David Bateman).
-2361. Add SetGamma/GetGamma requests to the VidMode extension, and a client
- called 'xgamma' that makes use of them to allow the server's gamma
- correction to be changed dynamically (David Bateman).
-2360. Make the cursor layer smart enough to remove the cursor itself when
- DGA is activated (#2552, Mark Vojkovich).
-2359. Add some overlay-related entries to the ScrnInfoRec (#2550,
- Mark Vojkovich).
-2358. Some DGA fixes (#2550, 2551, Mark Vojkovich).
-2357. Set X_BYTE_ORDER from the imake config, and use it in place of
- the system's BYTE_ORDER (David Dawes).
-2356. Update copyright notices in the s3virge driver (#2546, Kevin Brosius).
-2355. Xterm patch #93 (#2546, Thomas Dickey).
-2354. Fix some minor fbdev problems in fbdevhw and the mga driver (#2545,
- Gerd Knorr).
-2353. Disable the loader for LinuxPPC because it doesn't work (#2545,
- Gerd Knorr).
-2352. Disable the Linux fbdevhw by default for versions older than 2.2
- (#2545, Gerd Knorr).
-2351. Xaw and xedit updates, including changes to Xaw to support latin*
- languages in the text code when not using the "international" resource
- (#2544, Paulo Cesar Pereira de Andrade).
-2350. Add 3D decoration and the ability to display an XPM pixmap in the xdm
- Login widget. A default pixmap made with the XFree86 logo is included
- (#2543, Amit Margalit, Caolan McNamara, Ivan Griffin, Matthieu Herrb).
-2349. Improve attribute scaling in the PM2 Xv driver (#2542, Michael Schimek).
-2348. Add an "acecad" mouse protocol so that an acecad tablet can be used
- with the standard mouse driver (#2541, Jeff Anton).
-2347. Include xf86_ansic.h in module build of xf86vmode.c (#2540,
- Matthieu Herrb).
-2346. Fix a server crash when no mode lines are specified in the Monitor
- section (#2539, Andreas Ehliar).
-2345. Resync SuperProbe with the 3.3.3.1 version (#2538, Marc La France).
-2344. Document -once server commad line option (#2538, Marc La France).
-2343. Add and document a -noreset server command line option to disable server
- resets when the last client connection is closed. This is useful for
- xtest'ing a server that is switched out (#2538, Marc La France).
-2342. More compiler warning fixups, including a re-integration of GLX for both
- static and loader builds (#2538, Marc La France).
-2341. On Linux, compile with _GNU_SOURCE so that declarations for snprintf &
- friends may be #include'd with <stdio.h> (#2538, Marc La France).
-2340. Fix the glint driver's use of resource control, which fixes problems
- using MGA/GLINT combinations in multi-head (#2537, Alan Hourihane).
-2339. Fix a problem building xrdb with SVR4.0's cc (#2536, Satoshi Kimura).
-2338. Fix a trident 24bpp bug (#2535, Alan Hourihane).
-2337. Fix Permedia 2V hardware cursor (#2534, Alan Hourihane).
-2336. Add the rest of the known EM_ machine type defines, and Sparc
- specific relocation defines to loader/elf.h (#2533, David Miller).
-2335. -
-2334. Disable MTRRs when unmapping memory (#2531, David Wragg).
-2333. Avoid the MTRR messages on systems with no MTRR support unless
- the "mtrr" option is specified or -verbose is used (#2531, David Wragg).
-2332. -
-2331. Fix some offscreen pixmap-related problems with XAA (#2497, 2549,
- Mark Vojkovich).
-
-XFree86 3.9Pd (9 March 1999)
-2330. Updates for Hurd port (#2528, UCHIYAMA Yasushi).
-2329. Fix some Solaris 7 build problems (#2530, Nicholas Brealey).
-2328. Add some more PCI entries (#2529, Nicholas Brealey).
-2327. Preliminary DGA support for the mga driver (#2527, Mark Vojkovich).
-2326. Fix some DGA bugs and turn on events in the DGA compatibility code
- (#2526, Mark Vojkovich).
-2325. Fix the memory units in the old DGA (#2525, Mark Vojkovich).
-2324. Allow drivers to limit the size of XAA offscreen pixmaps (#2524,
- Mark Vojkovich).
-2323. Fix the problem with XAA pixmap cache messages only being printed
- for the first screen (#2524, Mark Vojkovich).
-2322. Temporarily disable rops without a source in the s3virge driver,
- and add the ShowCache option (#2523, Mark Vojkovich).
-2321. Add XF86Config parser for VideoAdaptor configuration (#2521,
- Michael Schimek).
-2320. Fis Permedia DPMS bug and Permedia 2 hw cursor (#2521, Michael Schimek).
-2319. Move include/Xvlib.h to include/X11/extensions/, add missing
- XvPortNotify, and fix Xv DDX StopVideo deficiency (#2521,
- Michael Schimek).
-2318. More ansifications/gcc warning removal for the clients (#2520,
- Matthieu Herrb).
-2317. Implement backward compatibility for the server side of the VidMode
- extension, which relies on the new clients informing the server of
- their version (David Dawes).
-2316. Initial conversion of the VidMode extension for 4.0 (David Bateman).
-2315. Add DPMS support to the TGA driver (#2518, Matt Grossman).
-2314. Fix a bug in xaaInitAccel.c that affects disabling offscreen pixmaps
- (#2519, Andrew Aitchison).
-2313. Some SiS driver fixes/updates (#2517, Juanjo Santamarta).
-2312. Fix a server crash when assiging the primary device (#2516,
- Alan Hourihane).
-2311. Don't save/restore the VGA colourmap in the glint driver (#2515,
- Alan Hourihane).
-2310. Fix a problem of using freed data in xgc (#2512, Jeff Anton).
-2309. Make the server fail gracefully when it can't load its base modules
- (#2511, Alan Hourihane).
-2308. Fix a global declaration clash in panoramiXprocs.c (#2510,
- Alan Hourihane).
-2307. Fix installation of GLX man pages (based on #2509, Matthieu Herrb).
-2306. Update the Linux/ppc section of xfree86.cf (#2507, Gerd Knorr).
-2305. Add code to the mga driver for using the fbdevhw module (#2507, 2522,
- Gerd Knorr).
-2304. Add a fbdev module that provides a simple non-accelerated driver that
- works on top of fbdevhw (#2507, Gerd Knorr).
-2303. Add a fbdevhw module that provides the functions needed to access
- Linux framebuffer devices (#2507, Gerd Knorr).
-2302. Add a wrapper for mmap and munmap (#2507, Gerd Knorr).
-2301. Fix an XAA FillPoly problem that shows up with the noblank screen
- saver (#2513, Mark Vojkovich).
-2300. Fix some problems in XAA's 32->24bpp image conversion (Mark Vojkovich).
-2299. Fix padding in the xf24_32bpp layer (#2508, Mark Vojkovich).
-
-XFree86 3.9Pc (2 March 1999)
-2298. Preliminary work on new DGA event support (#2506, Mark Vojkovich).
-2297. Add rewrite of s3virge driver's accel code (#2505, Mark Vojkovich,
- Kevin Brosius).
-2296. Remove typos and inconsistencies between the Xv manual pages and
- the implementation (#2504, Michael Schimek).,
-2295. Ansification and gcc warning elimnation in xfwp, xhost, xieperf,
- xinit, xkbevd, xkbprint, xkbutils, xkill, xlogo (#2502, Matthieu Herrb).
-2294. Fix an MGA driver crash that shows up when running xtest (#2501
- Alan Hourihane).
-2293. Correctly indicate when the MGA driver auto-detects SDRAM cards
- (#2500, Alan Hourihane).
-2292. Add "noddc1" and "noddc2" options to the DDC layer to allow DDC to
- be disabled (#2499, Alan Hourihane).
-2291. Change PsAttVal.c (Xprt/PS) so that values other then {PostScript 2}
- can be put into xp-raw-formats-supported (#2498, Noah Roberts).
-2290. Fix a 'make includes' problem in lib/font that shows up on SVR4.
-2289. Integrate SGI's GLX and the Mesa core rendering library
- (#2492, Precision Insight, SGI, Mesa).
-2288. -
-2287. New DGA DDX layer (not finished yet) (#2495, Mark Vojkovich).
-2286. Backwards compatibility layer translating DGA 1.0 into the new DDX
- (#2494, Mark Vojkovich).
-2285. Disable old DGA support in the cirrus driver (#2493, Mark Vojkovich).
-2284. Ansification and gcc warning elimnation in xclipboard, xclock, xcmsdb,
- xconsole, xdm, xdpyinfo, xedit, xfd and xfindproxy (#2491,
- Matthieu Herrb).
-2283. Fix 8 plane TGA 8x8 pattern fill (#2490, Matt Grossman).
-2282. Fix pitch padding in the xf24_32bpp layer (#2489, 2496, Itai Nahshon).
-2281. Add DPMS support for the Cirrus Laguna chips (#2489, 2496, Itai Nahshon).
-2280. Add loader req/ref symbol lists to the cirrus module (#2489, 2496,
- Itai Nahshon).
-2279. Fix cirrus display corruption with acceleration and SW cursor
- (#2489, 2496, Itai Nahshon).
-2278. Add minimal 5430 support to the cirrus driver (#2489, 2496,
- Itai Nahshon).
-2277. Resync LynxOS support (#2486, Thomas Mueller).
-2276. Remove the driver for the never-released P3D chipset (#2285, Dejan Ilic).
-2275. Change xf86XVScreenInit's arguments so that it's easier to initialize
- the Xv DDX when adaptors come from multiple sources (#2484,
- Mark Vojkovich).
-2274. Ansification and gcc warning elimnation in x11perf and xauth
- (#2483, Matthieu Herrb).
-2273. Fix a backing store bug in the 24/32 layer, and add a local version
- of a 24->24bpp copy routine since the performance in cfb24 is too
- poor (#2481, Mark Vojkovich).
-2272. Add support for setting write-combining for the frame buffer memory,
- and disabling WC for MMIO memory via the PPro/PII MTRR facility
- provided in Linux 2.2 (#2480, 2503, David Wragg).
-2271. Xaw and xedit updates/fixes (#2479, Paulo Cesar Pereira de Andrade).
-2270. Add some more PCI data (#2478, Andrew Aitchison, #2489, 2495,
- Itai Nahshon).
-2269. Fix a bug in the KIO8-U encoding in fontenc.c (#2477,
- Juliusz Chroboczek).
-2268. Fix most of the warnings that show up when building on Digital Unix 4.0D,
- with the DEC C compiler.
-2267. Fix for Millennium II hardware cursor-related loss of sync problem
- that shows up with some revs of the 3026 ramdac (Trey Boudreau).
-2266. Update the setting of the option registers in G-type RAMDAC
- Matrox cards and add "no_ddc" flag (Dirk Hohndel, Michael
- Brown).
-
-XFree86 3.9Pb (20 February 1999)
-2265. Allow YaccCmd to be overridden in host.def (#2474-2476,
- Christopher Sekiya).
-2264. Implement null overscans in VGA, minor fixups to VGA generic
- default mode, re-add #ifndef's in VGA generic driver erroneously
- deleted in 3.9No (#2473, Marc LaFrance).
-2263. More MULTIBUFFER extension fixes (#2471, Marc LaFrance).
-2262. Add support for the Matrox G200 SDRAM cards; G100 SGRAM still
- doesn't work (Dirk Hohndel).
-2261. Support Linux PowerPC. Add Linux 2.2 PCI config space code
- (#2470, Gerd Knorr).
-2260. Remove gcc warnings in the clients and lib/FS (#2469, Matthieu Herrb).
-2259. Updates to the PCI database (Dirk Hohndel, David Monro).
-
-XFree86 3.9Pa (14 February 1999)
-2258. Use /dev/io to enable I/O access on FreeBSD instead of KDENABIO.
-2257. Correct some typos/grammatical problems with the DESIGN doc (Ivan Bach).
-2256. Fix a crash when PciAccInfo isn't initialized (#2468, Alan Hourihane).
-2255. Add SiS530 detection to the SiS driver. Clock programming,
- acceleration and hw cursor are not implemented, yet (Dirk Hohndel).
-2254. Fix some bugs related to hardware clipping of spans. XAA
- WideLine speedups when hardware clipping is available (#2467
- Mark Vojkovich).
-2253. Permedia2 clipping fixes, fix WritePixmap for non-GXcopy rasters
- (#2466, Alan Hourihane).
-2252. Add -scanpci option and a scanpci module to the server. Add tons
- of PCI2.1 subsystem ids to identify specifc cards; the PCI data
- base needs more work (Dirk Hohndel).
-2251. Remove obsolete xf86[GS]etDefaultColorVisualClass() and fix some
- small typos and comments; make type of BIOS, Memory and I/O
- bases consistent (#2460,2465 Marc LaFrance).
-2250. Add ScanlineCPUToScreen for TX/MX and older Permedia chipsets
- for when PCI retries are not enabled (#2459,2461,2462,2463
- Alan Hourihane).
-2249. Add 24/8 overlay support for 3Dlabs chipsets and switch to MMIO
- for vga access (#2459, Alan Hourihane).
-2248. Add 24/8 overlay support to IBM526 and IBM640 ramdacs, fix IBM640 hw
- cursor (#2458, Alan Hourihane).
-2247. Fix depth 24 support in TGA driver (#2456, Tim Rowley).
-
-XFree86 3.9P (7 February 1999)
-2246. Some TGA driver speedups and cleanups (#2454, Matt Grossman).
-2245. Fix a lock_display() prototype problem in Xlibint.h that shows up
- when building with -DXTHREADS.
-2244. Allow the driver to override XAA's assignment of Screen functions which
- access the framebuffer (#2453, Mark Vojkovich).
-2243. Fix mga overlay problems related to the software cursor and disable
- overlays for the G100 since it doesn't support planemasks (#2452,
- Mark Vojkovich).
-2242. Rectangle outline performance improvements for the shadow framebuffer
- (2451, Mark Vojkovich).
-2241. Update the ati driver code to include changes in 3.3.3.1. The driver
- is not buildable yet (#2450, Marc La France).
-2240. Add support for VT switching to the 8+16 layer (#2449, Mark Vojkovich).
-2239. Export xf86NewSerialNumber() (#2448, Mark Vojkovich).
-2238. Fix XAA pixmap cache in 24bpp when ImageWrites are not available and
- 32bpp pixmaps are used (#2447, Mark Vojkovich).
-2237. Improve performance for zero width arcs at 24bpp in the mga driver
- (#2446, Mark Vojkovich).
-2236. Optimise 24->32bpp transfers (#2445, Mark Vojkovich).
-2235. Xterm patch #92 (#2444, Thomas Dickey).
-2234. Fix some compiler warnings in libfont (#2443, Marc La France).
-2233. Make building the Speedo and Type1 font code optional (#2443,
- Marc La France).
-2232. Add DDC2 and Xv support for Permedia 2 to the glint driver (#2442,
- Michael Schimek).
-2231. Update the glint driver's clipping for the new XAA clip support
- (#2440, Alan Hourihane).
-2230. Add support for the ELSA Gloria-XXL with Glint Gamma chip (#2440, 2441,
- Alan Hourihane).
-2229. Fix some ANSI vs non-ANSI prototype mixing in the Speedo code.
-2228. Fix a bug setting the framebuffer pixmap format for depth 4 in
- xf86SetDepthBpp().
-2227. Fix some misuse of the VGA "Palette" enable/disable functions in the
- vgahw code, and clarify what they do. This fixes some display artefacts
- that were showing up when writing to the colourmap.
-
-XFree86 3.9Nz (1 February 1999)
-2226. Add an 8+16bpp dual framebuffer layer (#2425, Mark Vojkovich).
-2225. Add "ShadowFB" to the mga driver for experimenting with the shadowfb
- layer (#2439, Mark Vojkovich).
-2224. Some cleanups/fixes for Solaris 7 (#2437, David Holland).
-2223. Ansify (and remove gcc warnings from) the following clients: appres,
- bdftopcf, beforelight, bitmap and editres (#2436, Matthieu Herrb).
-2222. Eliminate cpp-related warnings about the "unix" symbol on NetBSD-current
- (#2434, Matthieu Herrb).
-2221. Fix a bug in Xaw's StripChart widget that shows up with xload
- (#2433, Matthieu Herrb).
-2220. Some initial code for supporting other SiS cards in the SiS driver
- (#2420, Juanjo Santamarta).
-2219. Allow static Xvfb to compile (#2432, Marc La France).
-2218. Fix ddc and chips Imakefiles (#2432, Marc La France,
- #2435, Matthieu Herrb).
-2217. Remove redundant BitsPerPixel macro definitions (#2432, Marc La France).
-2216. Remove some redundant rules from Xpm's Imakefile (#2432, Marc La France).
-2215. Fix some compiler warnings (#2432, Marc La France).
-2214. Allow the deprecated MultiBuffer extension to compile (#2432,
- Marc La France).
-2213. Fix problems building with XInput disabled (#2432, Marc La France).
-2212. Fix 'make clean' to remove lndir and revpath (#2432, Marc La France).
-2211. Add a new "shadowfb" layer that maintains a virtual framebuffer in
- system memory and tells the driver what parts of the videoram
- framebuffer need updating. This allows the use of write-only videoram
- framebuffers (#2431, 2438, Mark Vojkovich).
-2210. Fix some compilation problems on Alpha platforms caused by some
- inlines in complier.h being declared as extern instead of static
- (2430, Matt Grossman).
-2209. Remove the inconsistencies with numeric chipset tokens in the s3virge
- driver (#2428, Kevin Brosius).
-2208. Move the mga DDC code into the PreInit function, add I2C support
- (disabled and not working so far), and allow the driver to continue
- without DDC support if the DDC module is missing (#2427,
- Andrew Aitchison).
-2207. Fix a problem with xsm not acknowledging the SaveYourself message it
- sends clients with a SaveComplete message (#2426, Robert Bihlmeyer).
-2206. Update the mga driver to use the new XAA clipping (#2424,
- Mark Vojkovich).
-2205. Some enhancements to XAA's HW clipping handling, allowing clipping
- to be used for more than just lines (#2423, Mark Vojkovich).
-2204. Fix a problem with the previous cfb screen pixmap access fix (#2242,
- Mark Vojkovich).
-2203. Fix SiS 24bpp support (#2421, Alan Hourihane).
-2202. Fix SiS HW cursor, max clock and 16bpp support (#2418, Alan Hourihane).
-2201. Update the ramdac module's HW cursor support to handle hardware that
- requires nibble swapping (#2417, 2419, Alan Hourihane).
-2200. Make the fact that the XAA TE font rendering assembly code is disabled
- by default more obvious (#2416, David Bateman).
-2199. Fix VT switches in 8+32 mode (#2415, Mark Vojkovich).
-2198. Add common encoding support for the Speedo, Type1 and FreeType
- font backends (#2385, Juliusz Chroboczek).
-2197. Update lib/font/FreeType to xfsft-1.0.3 (#2385, Juliusz Chroboczek).
-2196. X-TT updates for our loader (X-TT team and Nozomi Ytow).
-2195. Import X-TrueType 1.2pre-19990125 (X-TT team).
-
-XFree86 3.9Ny (26 January 1999)
-2194. Some improvements to the XAA TE font rendering assembly code (note
- that this assembly code is disabled by default) (#2413, David Bateman).
-2193. Fix some places in cfb that were accessing the screen pixmap directly
- from the private (#2412, Mark Vojkovich).
-2192. Fix a FreeType build problem on 64-bit platforms (#2411, Alan Hourihane).
-2191. Fix a cfb24 build problem that shows up with egcs (#2410,
- Alan Hourihane).
-2190. Add DPMS, DDC1 and HW cursor support to the SiS driver, and fix panning
- in the SiS driver (#2409, Alan Hourihane).
-2189. Put copyright notices from the pandix/panmi code into the merged
- dix/mi versions (#2408, Alan Hourihane).
-2188. Update drivers to use the 24/32 conversion layer, and to default to
- a 24bpp framebuffer format when supported.
-2187. Make some refinements to the way the depth 24 pixmap format is set.
-2186. Replace the ModuleInit function with a ModuleData data object. This
- allows the loader to get the version and entry points from a module
- without first executing module code.
-2185. Unify the abiclass and abivendor fields of XF86ModuleVersionInfo,
- and add a moduleclass field.
-2184. Add a SaveRestoreImage field to the ScrnInfoRec to allow drivers to
- supply an alternative to the default.
-
-XFree86 3.9Nx (24 January 1999)
-2183. Prevent LoadSubModule() from passing absolute module paths and from
- providing its own module search path.
-2182. Import FreeType 1.2. This includes the FreeType library specific parts
- of #2385 from Juliusz Chroboczek.
-2181. Add a root-only -modulepath command line option to the X server.
-2180. Fix the VT switch screen restore bug introduced a few versions ago
- (#2406, Mark Vojkovich).
-2179. ND version of the SiS driver, currently only for the 6326 chip (#2404,
- 2405, 2407, Alan Hourihane).
-2178. xterm patch #91 (#2402, Thomas Dickey).
-2177. Add 32/24 support to the MGA driver (#2401, Mark Vojkovich).
-2176. Add 32bpp->24bpp conversion acceleration to XAA (#2400, Mark Vojkovich).
-2175. Add partial acceleration support to the TGA driver (#2399, 2403,
- Matt Grossman).
-2174. Fix an 8+32 layer bug introduced in 3.9Nw (#2398, Mark Vojkovich).
-2173. Add a 32/24 conversion layer. Pixmaps are still 24bpp internally,
- but the interfaces visible to clients are all 32bpp (#2397,
- Mark Vojkovich).
-2172. Fix trident driver panning at 24bpp (#2395, Alan Hourihane).
-2171. Add DDC1 and DDC2 (the latter not working yet) to the trident driver
- (#2395, Alan Hourihane).
-2170. Add MCLK override to the trident driver (#2395, Alan Hourihane).
-2169. Enable pixel multiplexing to the trident drive for high resolution
- 8bpp modes (#2395, Alan Hourihane).
-2168. Add clipping for the Trident 9682 and 9685 and Mono8x8 and CPUToScreen
- support for the 9685 (#2395, Alan Hourihane).
-2167. Add offscreen pixmap support for the Trident Image series (#2395,
- Alan Hourihane).
-2166. Fix some cfb24 problems that showed up after the previous changes
- (#2396, Nozomi Ytow).
-2165. Update the C&T HW cursor defaults to only disable them by default when
- necessary (#2394, David Bateman).
-2164. Add some sanity checking for the subdirs argument to LoadSubModule, etc.
-2163. Fix a bug in the verbose Mode handling in the parser that can result
- in an infinite loop when the "Mode" keyword is used incorrectly in
- a config file.
-2162. Add a global default module path to the loader, and a function that
- the common layer can call to set it.
-2161. LoadModule was ignoring the subdir list argument (Nozomi Ytow).
-2160. Add printing of subsystem ids to scanpci (Dirk Hohndel).
-
-XFree86 3.9Nw (17 January 1999)
-2159. Add functions for finding the pixmap format and pixmap bpp for a
- given depth, and fix a crash in xf86ValidateModes() caused by recent
- changes in this area.
-2158. Add an extra argument to LoadSubModule (and LoadModule) to allow the
- caller to optionally specify version and/or ABI requirements that
- the loaded module must meet for the load to complete successfully.
-2158. Add support to the loader for vendor-defined ABI classes. These classes
- are specified as a string. The main use is for third party modules that
- themselves load sub-modules (like X-TT).
-2157. Fix the MGA driver's handling of the "MGA_SDRAM" option. SDRAM cards
- are still not auto-detected though (#2391, Mark Vojkovich).
-2156. Add a screen->screen colour expansion bug workaround to the MGA driver,
- and enable the faster linear expansions instead of the planar ones
- (#2390, Mark Vojkovich).
-2155. Fix some depth/bpp issues in the SHM code (#2389, Mark Vojkovich).
-2154. Export some missing symbols for Alpha platforms (#2388, Alan Hourihane).
-2153. Fix a bug in determing the card type in the TGA driver (#2387,
- Alan Hourihane).
-2152. Fix a problem in ramdac/BT.c (#2386, Alan Hourihane).
-
-XFree86 3.9Nv (15 January 1999)
-2151. Fix cfb24 problems that show up with xtest (#2384, Nozomi Ytow).
-2150. Fix 64 pixel rounding of display width in the C&T driver (#2383,
- David Bateman).
-2149. Add an UnloadSubModule() function that can unload individual sub-modules
- without unloading sibilings.
-2148. Remove a lot of unnecessary casts of x*alloc().
-2147. Add a pciGetBaseSize() funtion to the PCI code.
-2146. Make our PCI code aware of the following 2.1 type 0 header fields:
- Cardbus CIS pointer and subsystem ids.
-2145. Remove the KEEP_BPP code, and fix problems with some drivers referencing
- the unused pixmapBPP ScrnInfoRec field.
-
-XFree86 3.9Nu (13 January 1999)
-2144. Fix a bug in PANORAMIX_FREE(), which was referencing just freed data.
-2143. Merge the pandix/panmi code into dix and mi, and enable building
- the Xinerama (panoramiX) extension by default (#2377-2381,
- Alan Hourihane).
-2142. Rework the handling of the depth/bpp/fbbpp options. The -bpp flag and
- related config file keywords are no longer used. New flags and options
- have been added to specify the server-wide depth 24 pixmap format.
- A "standard" set of pixmap formats is always advertised, so drivers
- using these don't need to worry about explicitly adding them.
-2141. Fix some sun_path overflows in xtrans.
-2140. Some panoramix fixups (#2376, Alan Hourihane).
-2139. Don't allow arbitrarily long display number strings to be passed on
- to xtrans by _X11TransConnectDisplay().
-2138. Update the parser and xf86Config.c to allow Options to be specified in
- the config file's ServerLayout section. Options in the ServerLayout
- section can override those in the ServerFlags section.
-2137. Update the parser and xf86Config.c to allow "Inactive" devices
- to be specified in the config file's ServerLayout section.
-2136. Import xpm version 3.4k.
-
-XFree86 3.9Nt (11 January 1999)
-2135. Fix 8+32 rendering bugs (#2374, Mark Vojkovich).
-2134. Update vgaHWddc1SetSpeed() to select the 25 MHz clock (#2373,
- Alan Hourihane).
-2133. Add support for a shared font library (#2364, Takuya SHIOZAKI).
-2132. Add ProfiledDepLibraryTarget, DebuggedDepLibraryTarget and
- SharedDepLibraryTarget rules to imake (#2364, Takuya SHIOZAKI).
-2131. Fix a typo in xf86Init.c (#2372, Nozomi Ytow).
-2130. Xaw and xedit updates (#2371, Paulo Cesar Pereira de Andrade).
-2129. Move the DDC call to before the mode initialisation in the mga driver
- (#2367, Alan Hourihane).
-2128. Fix a problem with the xkb dvorak layout (#2362, Tabman)
-2127. Fix an xsm crash (NULL dereference) when a client sets an SM property
- list to a length of zero (#2361, Robert Bihlmeyer).
-2126. Untested support for the Trident 939A/DVD (#2359, 2360, Alan Hourihane).
-
-XFree86 3.9Ns (3 January 1999)
-2125. Allow backing store to be controlled with a per-screen config file
- option (#2357, Mark Vojkovich).
-2124. Fix XAA so that the offscreen pixmaps are compatible with backing store
- (#2354, Mark Vojkovich).
-2123. Fix a bug in XAA's stipple to 8x8 pattern reduction code (#2352,
- Mark Vojkovich).
-2122. 8+32 overlay support for XAA (#2352, 2356, Mark Vojkovich).
-2121. Add TGUI9440 and Cyber9320 support to the trident driver (#2348,
- Alan Hourihane).
-2120. Fix a typo in xkbcomp/symbols/sun/Imakefile (#2337, Matthieu Herrb).
-2119. Mga driver updates for the new 8+32 overlay support (#2332, 2353,
- Mark Vojkovich).
-2118. New 8+32 overlay support (#2331, 2351, 2358, Mark Vojkovich).
-2117. Fix a bug in the xterm man page (#2333, Thomas Dickey).
-2116. Remove the -fno-strength-reduce option for OpenBSD and NetBSD (#2328,
- Matthieu Herrb).
-2115. Import regex for systems that don't have a Posix regex.
-2114. Add a LoaderListDir() function that can be used to list the available
- modules.
-2113. Modify LoadModule and LoadSubmodule to accept optional subdir and
- pattern lists, and use regular expressions for the module matching
- instead of prefix/suffix lists.
-2112. Add a "revpath" utility to xc/config/util to help in dealing with
- imake's use of relative paths. If this proves to be useful, it could
- be used more widely in imake's rules.
-2111. Install some classes of modules into subdirectories of the "modules"
- directory. The imake module install rules have been updated
- accordingly.
-
-XFree86 3.9Nr (20 December 1998)
-2110. Add support for the wscons console driver for NetBSD-current (#2326,
- Matthieu Herrb).
-2109. Remove cfbPuntCopyPlane from cfb (#2325, Mark Vojkovich).
-2108. Fix a build problem related to Xarch.h on NetBSD (#2322, Isao Ohishi).
-2107. Fix an XAA bug tha can result in a zero height when rendering TE text
- (#2321, Mark Vojkovich).
-2106. Fix an optimization bug in the new XAA rect and span code (#2319,
- Mark Vojkovich).
-2105. Accelerate CopyPlane on offscreen pixmaps (#2318, Mark Vojkovich).
-2104. Fix a 4bpp problem with the C&T driver and the new colourmap code
- (#2317, David Bateman).
-2103. Enable XAA offscreen pixmaps in the C&T driver (#2317, David Bateman).
-2102. ImageRead functions for some C&T HiQV chipsets (disabled) (#2317,
- David Bateman).
-2101. MMIO access to the registers for PCI C&T 69000 (#2317, David Bateman).
-2100. Cleanup code in mipushpxl.c (#2313, Thomas Mueller).
-2099. Fix MX/TX clipping bugs in the glint driver (#2312, Alan Hourihane).
-2098. xterm patch #90 (#2311, Thomas Dickey).
-2097. Export missing symbols for panoramiX (#2310, Alan Hourihane).
-2096. Initialise a number of Xlib/Xt data structures, correct a minor linker
- bug in OS/2 (#2026, Holger Veit).
-2095. Fix some realloc() usages (#2019, Matthieu Herrb).
-2094. Support for arc4random() in xdm/genauth.c (#2019, Michael Shalayeff).
-2093. Update mkfontdir to create an appropriate fonts.dir file when no
- fonts are found rather than doing nothing.
-2092. Replace void main() -> int main() for ANSI conformance (#2019,
- Matthieu Herrb).
-2091. Only allow the X server -nolock option when the real uid is root.
-2090. Some sanity checks on DISPLAY name (#2168, Kevin Vajk).
-2089. Fix an Xnest crash with too many visuals (#2019, Matthieu Herrb).
-2088. Swedish sun keyboard support in Xsun and xkb (#2019, Magnus Holmberg).
-2087. A quick attempt at neutralising a stack-buffer overflow problem in
- the Xprt server.
-2086. LP64 compiler warning fixes from the NetBSD xsrc tree (#2019,
- Ross Harvey).
-2085. Don't install lndir on OpenBSD (#2019, Matthieu Herrb).
-2084. Teach imake how to automatically determine the NetBSD architecture
- (#2180, Jason Thorpe).
-2083. Add local font directory (Dirk Hohndel).
-2082. LynxOS OS version detection for imake (#2039, Thomas Mueller).
-2081. Resync OpenBSD.cf (#2019, Matthieu Herrb).
-2080. Fix security problem by creating /tmp/.X11-unix with sticky bit (#2168,
- Kevin Vajk, David Dawes, Dirk Hohndel).
-2079. Make LinkVarDirectory handle DESTDIR (#2019, Matthieu Herrb).
-2078. Resync NetBSD.cf.
-2077. Some doc and nroff-related updates to the build system.
-2076. Update tk/tcl definitions in FreeBSD.cf and add support for building
- a.out compatibility libraries on FreeBSD/ELF systems.
-2075. Create host.def with sane defaults when none exists and when a cut-down
- source tree is detected.
-2074. Resync with 3.3.3 (items 2075-2096 above).
-2073. Fix an xset segfault (#2320, Itai Nahshon).
-
-XFree86 3.9Nq (13 December 1998)
-2072. Change the modversion field in the XF86ModuleVersionInfo struct into
- separate major, minor and patchlevel fields.
-2071. Initial DG/ux support (#2299, Takis Psarogiannakopoulos).
-2070. DDC1 support for TVP3026 based Matrox cards (#2309, Andrew Aitchison).
-2069. More rewrites of the way spans and rects are handles in XAA so that
- it never has to allocate any memory, thereby eliminating potential
- stack overflow problems (#2308, Mark Vojkovich).
-2068. MGA driver-provided FillCacheBltRects replacement, optimised for fastblt
- (#2307, Mark Vojkovich).
-2067. Choose MGA planar vs linear screen to screen colour expansion at runtime
- rather than at compile time (#2307, Mark Vojkovich).
-2066. Fix a build problem related to Xarch.h on OpenBSD (#2306,
- Matthieu Herrb).
-2065. Fix a typo in FreeBSD.cf that affects adding the runtime library
- search patch for 2.2.x (#2305, Keisuke Inoue).
-2064. Some enhanced XKB files for French-Canadian keyboards (#2204,
- Eric Moreau).
-2063. Fix an incorrect realloc in xmodmap (#2303, Alexander V. Lukyanov).
-2062. Fix depth 30 for the glint driver (#2297, Alan Hourihane).
-2061. Resync pandix and panmi, and fix some panoramix build problems
- (#2296, Alan Hourihane).
-2060. Enable offscreen pixmaps for the glint driver (#2295, Alan Hourihane).
-2059. Fix PC98 XKB (#2292, Hirofumi Nishizuka and #2300, Tetsuo Tsukamoto).
-2058. Fix some unresolved symbols (#2293, Michael Rohleder).
-
-XFree86 3.9Np (6 December 1998)
-2057. Some xedit updates (#2291, Paulo Cesar Pereira de Andrade).
-2056. Updates to the Xaw text code (#2291, Paulo Cesar Pereira de Andrade).
-2055. XAA doc updates (#2289, Mark Vojkovich).
-2054. Replace linear screen to screen colour expansions with planar ones
- in the MGA driver because there seems to be a hardware problem with
- the linear ones (#2288, Mark Vojkovich).
-2053. Enable offscreen pixmaps for the MGA driver (#2288, Mark Vojkovich).
-2052. Some misc XAA updates (#2287, Mark Vojkovich).
-2051. A non-trival rewrite of the way fills are done in XAA (#2287,
- Mark Vojkovich).
-2050. Add a LINEAR_FRAMEBUFFER flag to XAA so that the pixmap cache can
- be loaded without requiring a driver-supplied ImageWrite function
- (#2287, Mark Vojkovich).
-2049. Add fully accelerated offscreen pixmaps support to XAA (#2287,
- Mark Vojkovich).
-2048. Add a RemoveAreaCallback for the offscreen memory manager. Areas
- for which this is supplied are considered lower priority than ones
- that don't, and can be booted out when something of higher priority
- needs the space (#2286, Mark Vojkovich).
-2047. Remove the ScreenPtr passed to the offscreen memory manager's resize
- function since it is already available from the FbAreaPtr (#2286,
- Mark Vojkovich).
-2046. Change xf86SaveRestoreImage() so that it doesn't create a new
- screen pixmap but modifies the old one (#2285, Mark Vojkovich).
-2045. Add support to mi for pixmaps with non-zero origins (#2284,
- Mark Vojkovich).
-2044. Fix some Alpha compilation problems introduced in 3.9No (#2283,
- Alan Hourihane).
-2043. Fix an Xlib problem with _XimLookupMBText() when using KOI8-R
- (#2282, Alexander Kabaev).
-2042. Fix the pattern source address mask for the C&T HiQV chips, which
- was causing 8x8 pattern problems when using more than 2MB of video
- memory (#2281, Peter Wainwright).
-2041. Update the TGA and Trident drivers for the ramdac/cmap changes (#2277,
- Alan Hourihane).
-2040. Change the Permedia2 to use a direct LoadPalette rather than the
- ramdac module because of 16bpp difficulty with the TVP3026 (#2277,
- Alan Hourihane).
-2039. Remove the old cmap code from the ramdac module and use the new
- cmap layer instead (#2277, Alan Hourihane).
-2038. Fix os.h and misc.h so that system headers don't get included when
- building modules.
-2037. Make the X server read an Xauthority file using the real user id
- to avoid problems when it is located on an NFS-mounted filesystem.
- (as suggested by #2276, MIHIRA Sanpei Yoshiro).
-2036. Xdm patch to allow the "Willing to manage" test displayed in the chooser
- window to be generated from a program run on the target host. This
- allows information like number of users, load average, etc to be
- displayed (like CDE does) (#2275, Dick Snippe).
-2035. Fix a core dump problem in xauth when interrupted while attempting
- to lock the auth file. Also fix a potential problem with calling
- printf() from within a signal handler (#2274, BSDI/Jeff Polk).
-2034. Add DDC2 probing for Cirrus 5446/5480 and Laguna chipsets (#2273,
- Itai Nahshon).
-2033. Fix some possible memory corruption and some minor bugs in the new DDC
- code (#2271, 2272, Itai Nahshon).
-2032. Offscreen memory manager and colormap layer doc updates (#2270, 2290,
- Mark Vojkovich).
-2031. Some glint clipping fixes (#2269, Alan Hourihane).
-2030. New XInput code, including new drivers for the SpaceOrb and Magellan
- (#2243, Metro Link).
-2029. Fix mga YDstOrg start address adjustment after VT switching.
-2028. Fix cfb24 bitblt for non-trivial planemasks (Peter Wainwright).
-2027. Fix bad headers included when compiling cup.c for extmod module.
-2026. Fix a malloc/xfree mismatch in xtrans LocalInitTransports().
-2025. Add some documentation for DDC (#2259, Egbert Eich).
-2024. Fix a problem with recent VT switch changes.
-
-XFree86 3.9No (29 November 1998)
-2023. Fix the depth vs bpp mixup in miCreateScreenResources().
-2022. Resync the s3virge driver with most of the updates contained in 3.3.3.
- This includes GX2 and MX+ support and the set_mclk and set_lcdclk
- options (#2267, Kevin Brosius).
-2021. Update the cirrus, chips and tseng drivers to use the new colourmap
- layer (via vgaHWHandleColormaps).
-2020. Add support for automatically adjusting the overscan colour index to
- the new colourmap layer.
-2019. Disable backing store by default, and provide a "+bs" option to enable
- it from the command line. This may be done in a better way later.
-2018. Remove the per-depth cfb private indices added in 3.9Nn (#2265,
- Mark Vojkovich).
-2017. Build cfb with -DSINLGEDEPTH because we don't need the per-depth
- cfb Screen privates.
-2016. Fix problems with the allocation of the cfbScreenPrivateIndex
- parameters.
-2015. Remove the offscreen memory manager functions out of the ScrnInfoRec
- (#2266, Mark Vojkovich).
-2014. Update the s3virge driver to use the new colormap layer, which fixes
- the VT switch colormap problem (#2264, Kevin Brosius).
-2013. Disable s3virge trapezoid fills since they don't match cfb (#2264,
- Kevin Brosius).
-2012. Add an ImageWrite function for the s3virge driver, so the pixmap
- cache support now works (#2264, Kevin Brosius).
-2011. Turn off PCI_RETRY by default in the glint driver, and various other
- driver updates (#2263, Alan Hourihane).
-2010. Fix a glint driver bug in WritePixmap for TX/MX chipsets (#2263,
- Alan Hourihane).
-2009. Update the Alpha unaligned access inlines in compiler.h, based on
- similar code in the Linux kernel (#2240, Matti Aarnio).
-2008. Fix a typo in the C&T driver (#2262, Nozomi Ytow).
-2007. Enable building libraries and clients for for sparclinux (#2261,
- Christopher Sekiya).
-2006. Define _XOPEN_SOURCE for Linux (#2261, Christopher Sekiya).
-2005. Add the vga copy plane expansion patch to the vgafb code (#2021,
- Jens Owen).
-2004. -
-2003. Fix a bug in xaaStipple.c which can cause a blitter lockup.
-2002. Fix a C&T bug that causes memory corruption when not in linear mode
- (#2260, Egbert Eich).
-2001. Only disable C&T transparency blits for HiQV chips below 65550, and
- fix the display pitch when acceleration is enabled (#2260,
- David Bateman).
-2000. Conditionally enable ScreenToScreenColorExpandFills for C&T HiQV
- chips (#2259, 2260, Nozomi Ytow, Egbert Eich).
-1999. Reduce the timeout period for C&T blitter lockups and reset the reset-bit
- after blitter timeouts (#2260, Egbert Eich).
-1998. Add DDC1/2 support for the C&T driver (not tested) (#2260, Egbert Eich).
-1997. Add a DDC module with DDC1 and DDC2 support for EDID version 1.x,
- and untested VDIF support (#2259, 2260, Egbert Eich).
-1996. Fix a problem switching from VT back to X when displayPitch
- != displayWidth (#2260, Egbert Eich).
-1995. Some colormap layer optimisations (#2258, Mark Vojkovich).
-1994. Add some missing micmap symbols to the loader's export list (#2257,
- Alan Hourihane).
-
-XFree86 3.9Nn (22 November 1998)
-1993. Set the valid gamma range as macros rather than having it hard coded
- in various places.
-1992. Always refer to and store the gamma values as those of the monitor,
- not of the correction. This means that the values stored in the
- ScrnInfoRec are now the same as those entered in the config file and
- on the command line.
-1991. Fix the colormap layer's handling of static colormaps (#2255,
- Mark Vojkovich).
-1990. Add XAA acceleration for pixmap->window N deep planar copies (#2254,
- Mark Vojkovich).
-1989. Add an xf86ChangeGamma() function to the colormap layer (#2253,
- Mark Vojkovich).
-1988. Have NameCompare() check for NULL pointers (#2252, Rik Faith).
-1987. Port Mark Vojkovich's accelerated line code form Permedia 2 to TX
- and Permedia 1 chips (#2249, Alan Hourihane).
-1986. Fix mono 8x8 pattern problem for Permedia 1 (#2249, Alan Hourihane).
-1985. Fix glint crash in CloseScreen, and set rgbBits to 8 by default
- (#2249, Alan Hourihane).
-1984. Fix glint CRTC setting alignment when using 24bpp (#2249,
- Alan Hourihane).
-1983. Give all cfb private indices unique names so that cfb's for multiple
- depths can be loaded on the same screen (#2248, 2250, 2251,
- Mark Vojkovich).
-1982. xterm patch #89, including the completion of double-sized character
- support (#2247, Thomas Dickey).
-1981. Fix an MGA dashed line clipping bug (#2246, Mark Vojkovich).
-1980. S3virge driver updates, including som acceleration, reinstatement of
- config options and chip ID changes (#2245, Kevin Brosius).
-1979. Fix some RAC-related problems with the glint driver (#2244,
- Alan Hourihane).
-1978. Fix some 64-bit problems in some unused driver code (for reference)
- (#2242, Matti Aarnio).
-1977. Fix a 64-bit alignment problem in cfb8line.c (#2242, Matti Aarnio).
-1976. Fix a typo in Pclose() (#2242, Matti Aarnio).
-1975. Update some Linux-related Imake.cf settings (#2242, Matti Aarnio).
-1974. -
-1973. Cirrus 546x memory interleaving (#2235, Corin Anderson).
-1972. XAA and HW cursor support for the Cirrus 546x series (#2235,
- Corin Anderson).
-1971. Fix a cirrus 546x clock setting problem that was introduced in 3.9Nm
- and add a few more predefined dot clocks (#2234, #2235, Corin Anderson).
-1970. Move the generic one-installed-colormap colormap handling functions
- into micmap.c, remove the use of STATIC_COLOR, update other fb
- layers to use the micmap functions where appropriate and ensure
- that they initialise InstallColormap, UninstallColormap, StoreColors
- and ListInstalledColormaps in their ScreenInit functions. Also move
- the global InstalledMaps array into micmap.c.
-
-XFree86 3.9Nm (15 November 1998)
-1969. libXv fix (#2233, Michael Schimek).
-1968. Add support for building clients on NetBSD/vax 1.3H (#2231,
- Chris Sekiya).
-1967. Add an alternate init function for the framebuffer manager. The new
- one takes a region rather than a box which allows disconnected regions
- to be managed (#2230, Mark Vojkovich).
-1966. XAA pixmap cache fix (#2229, Mark Vojkovich).
-1965. Add support to XAA for filled rects via ImageWrites (#2227,
- Mark Vojkovich).
-1964. Preliminary "XAnti" extension for antialiasing (#2224, Mark Vojkovich).
-1963. Fix glint driver coordinates when offscreen (negative) when using
- colour expansion and the NEGATIVE_X stuff (#2221, Alan Hourihane).
-1962. Add PCI IDs for S3 Trio3D and Savage chips to scanpci and xf86PciInfo.h
- (#2220, Harald Koenig).
-1961. Add support to XAA for the caching of planar colour expansion data,
- including an example of how to use it in the mga driver (#2215,
- Mark Vojkovich).
-1960. Xaw and xedit updates (#2205, Paulo Cesar Pereira de Andrade).
-1959. Provide code to initialise cirrus memory config registers on non-primary
- cards using config file options (#2202, Itai Nahshon).
-1958. Initial code for Cirrus Laguna I2C/DDC support (#2202, Itai Nahshon).
-1957. Fix some cirrus initialisation errors and MCLK calculation (#2202,
- Itai Nahshon).
-1956. Synch the cir.h and lg.h files (#2202, Itai Nahshon).
-1955. For newer Cirrus Alpine chips, replace most I/O operations to calls
- to the vgahw I/O routines, and configure them for MMIO when available
- (#2202, Itai Nahshon).
-1954. Fix mga G100/200 planemask problem (#2198, Mark Vojkovich).
-1953. Update the mga driver to use the new colourmap layer (#2198,
- Mark Vojkovich).
-1952. A new colourmap layer (#2197, Mark Vojkovich).
-1951. Redo the lbx colourmap fix in a multihead friendly way (#2196,
- Mark Vojkovich).
-1950. Make the resource access updates to the glint driver to get it working
- again (#2177, Alan Hourihane).
-1949. Fix Cirrus 546x big screen modes, 32bpp modes (#2175, Corin Anderson).
-1948. Support for the Cirrus 5464 (5462 remains untested) (#2175,
- Corin Anderson).
-1947. Fix xf86ValidateModes() to make the maxHeight parameter optional
- as documented (#2174, Corin Anderson).
-1946. Acceleration for the trident 3DImage/Cyber9388/Cyber9397 chipsets,
- and accel updates for other trident chips (#2161, Alan Hourihane).
-1945. Implement I2C layer for the trident driver (#2161, Alan Hourihane).
-1944. Add TGUI96xx hardware cursor support (#2161, Alan Hourihane).
-1943. Add some xkb entries for 105 key international PC keyboards (#2157,
- Matthieu Herrb).
-1942. Enable mode switching for the ViRGE driver (#2156, Kevin Brosius,
- 2200, Joe Moss).
-1941. Add depths 15,16,24 to the preliminary ViRGE driver (#2156,
- Kevin Brosius).
-1940. Replace __syscall() with syscall() in Linux/Alpha PCI code (#2211,
- Matti Aarnio).
-
-XFree86 3.9Nl (1 November 1998)
-1939. xterm patch #88 (#2152, Thomas Dickey).
-1938. Fix some build problems that show up on SunOS 4.1.4.
-1937. Allow the driver to give XAA the definition of a full planemask,
- with a reasonable default set when it doesn't (#2150, Mark Vojkovich).
-1936. XAA optimisation: when fgPixel == bgPixel draw opaque stipples as
- solid rects (#2150, Mark Vojkovich).
-1935. Preliminary S3 ViRGE driver conversion (#2148, Kevin Brosius).
-1934. Fix a bug in the LBX extension's colourmap code (#2143, Mark Vojkovich).
-1933. Add base address size and type fields to PciVideoRec (#2141,
- Egbert Eich).
-1932. Change the PCIInfo entries for NeoMagic chips (#2141, Egbert Eich).
-1931. Some C&T driver updates (#2141, Egbert Eich).
-1930. Add support for the Cirrus 5465 (and 5464, 5462 -- untested)
- (#2140, Corin Anderson).
-1929. Make the vgahw module a little easier to use by setting its own
- defaults where appropriate.
-
-XFree86 3.9Nk (25 October 1998)
-1928. Some XAA GC validation bug fixes and optimisations. This includes
- wrapping pixmap rendering to determine when pixmap cache invalidation
- is required (#2126, Mark Vojkovich).
-1927. Backout the dix fb,bg planemask manipulation added in a previous version
- (#2125, Mark Vojkovich).
-1926. Fix an MGA fastblt bug (#2124, Mark Vojkovich).
-1925. Accelerate zero width arcs on MGA (only use for rops other than
- GXcopy and when PCI retries are enabled) (#2124, Mark Vojkovich).
-1924. Restore default-promotion to the Xdmcp library (#2103, Thomas Dickey).
-1923. Prototype/ansification cleanup for Xserver/XIE, xfs, fontlib, mkfontdir,
- and fix some bugs found along the way (#2103, Thomas Dickey).
-1922. Set HasPoll to YES for Linux with glibc2 (#2095, Kars de Jong).
-1921. Fix some MGA modeline problems and change the G200 MCLK to 143MHz
- (#2088, Radislaw Kapitan).
-1920. Move xedit from the contrib tree to the main tree.
-1919. Xaw and xedit updates (see the changelog in the Xaw directory for
- details) (#2083, Paulo Cesar Pereira de Andrade).
-1918. Add support for BSD 4.4 style long file names in ar archives to
- the loader (#2066, Matthieu Herrb).
-1917. Some GNU/Hurd config/build updates (#2057, UCHIYAMA Yasushi).
-1916. Do a soft reset for secondary MGA cards prior to probing for the
- video memory size (#2052, Radislaw Kapitan).
-1915. sigset_t isn't an integer type on NetBSD (and some other OSs) so
- don't try to print it in xdm (#2048, Matthieu Herrb).
-1914. NetBSD's preprocessor emits a warning when it sees '#ifdef unix',
- which makes imake noisy (#2048, Matthieu Herrb).
-1913. xterm patches 85, 86, 87 (see xterm.log.html for details) (#2043, 2056,
- 2097, Thomas Dickey).
-1912. Change "fcd8859-15" to "iso8859-15".
-1911. Some updates to the "dacG" mga reset code, and enable it by default
- since it helps initialising an inactive secondary G200 (#2032,
- Radoslaw Kapitan).
-
-XFree86 3.9Nj (11 October 1998)
-1910. Fix the 8+24 overlay's CopyWindow wrapper so that it works properly
- with "NoAccel" or without hardware planemasks (#2041, Mark Vojkovich).
-1909. Reenable planemasks for SDRAM G200s and disable for all G100 (#2040,
- Mark Vojkovich).
-1908. Add mga overlay support for the TVP3026 (#2040, Mark Vojkovich).
-1907. Ansifiy and remove most warnings from the Xdmcp library and xdm
- (#2038, Thomas Dickey).
-1906. xterm patch 84 (see xterm.log.html for details) (#2036,
- Thomas Dickey, Bjorn Helgaas).
-1905. Enhancements for xedit (#2028, 2033, Paulo Cesar Pereira de Andrade).
-1904. Patch to make editres work properly (#2028,
- Paulo Cesar Pereira de Andrade).
-1903. Xaw updates (see the changelog in the Xaw directory for details)
- (#2028, 2033, Paulo Cesar Pereira de Andrade).
-
-XFree86 3.9Ni (6 October 1998)
-1902. Fix miCreateDefColormap() for depth 1.
-1901. Update the "extmod" module of the new extensions.
-1900. Fix some font-related problems introduced by the R6.4 merge.
-1899. Update the cirrus driver for the recent i2c module changes (#2025,
- Itai Nahshon).
-1898. Initial XAA acceleration for the cirrus driver (#2025, Itai Nahshon).
-1897. Add some option code to do a soft reset when restoring the video state
- for the "dacG" part of the MGA driver (#2012, Uli Walther).
-1896. Add some TTF encoding files (#2013-2016, Juliusz Chroboczek).
-1895. Resync the FreeType server interface with Xfsft-1.0.2, including
- code to read encodings from plain text files (#2013-2016,
- Juliusz Chroboczek).
-1894. Add an "8plus24" option to the MGA driver that turns on overlays when
- in 32bpp mode. Support is there only for the 1064 and SGRAM G100/G200
- chips so far (#2024, Mark Vojkovich).
-1893. Fix an MGA dashed line bug (#2024, Mark Vojkovich).
-1892. Add an "mga_sdram" option that turns off block mode and disables
- planemasks (#2024, Mark Vojkovich).
-1891. Add SGRAM and NonTEText optimisations to the MGA driver (#2024,
- Mark Vojkovich).
-1890. Add XYPixmap support to XAA (#2023, Mark Vojkovich).
-1889. Preliminary support for depth 8 + 24 mode. Depth 8 currently uses
- 32bpp pixmaps. Support is included for destructive and non-destructive
- overlays and driver-chosen transparency key (#2022, Mark Vojkovich).
-1888. Update imake for cpp changes with egcs-1.1 and gcc-2.8.1 (#2017,
- David Wragg).
-1887. Fix XvQueryAdaptors() when more than one adaptor is present, and
- export xf86XVScreenInit() to drivers (#2018, Michael Schimek).
-1886. Updates/improvements to the I2C module (#2008, 2018, Michael Schimek).
-1885. Don't include standard system headers when building XIE as a module.
-1884. Cleanup Xlibint.h, which significantly reduces the level of compiler
- warnings, and also cleanup XIE's error.h (#2007, Thomas Dickey).
-1883. Add support for built-in driver modes (#2006, Egbert Eich).
-1882. Ansify and remove gcc warnings for imake, makedepend, lndir, makestrs,
- makekeys and mkg3states) (#2005, Matthieu Herrb).
-1881. Introduce a "generic" PCI device (pseudo vendor/devids) for use with
- the generic vga driver (#1994, Egbert Eich).
-1880. Fix some bugs in the C&T driver (#1994, Egbert Eich).
-1879. Fix an XAA bug with CPU_TRANSFER_PAD_QWORD handling (#1994, Egbert Eich).
-1878. Sanity fix: if all devices of a screen are of type none assume
- resource type NONE in xf86AddControlledResource() even if specified
- otherwise (#1994, Egbert Eich).
-1877. Added more support to the resource code for mono devices (for
- consistency) (#1994, Egbert Eich).
-1876. Add RAC wrappers to the sprite functions (#1994, Egbert Eich).
-1875. Reset xf86Resetting in xf86Init.c (#1994, Egbert Eich).
-
-XFree86 3.9Nh (5 October 1998)
-1874. Temporary workaround to avoid static server build problem introduced
- in 3.9Ng.
-1873. Import and merge in X11R6.4 and its first three public patches.
-
-XFree86 3.9Ng (27 September 1998)
-1872. Rewrite the XAA NonTE text code, fixing the handling of overlapping
- characters (#2002, Mark Vojkovich).
-1871. Fix an typo causing a CapNotLast line bug in XAA (#2002, Mark Vojkovich).
-1870. Some updates to the FreeBSD/ELF support, including auto-detection
- of the binary format.
-1869. Update the Type1 and Speedo fonts.scale files to take advantage
- of the recent ISO 8859-2 encoding updates (#1995, Juliusz Chroboczek).
-1868. Update drivers to use miCreateDefColormap instead of calling
- the ones in the fb-specific code, update mfbCreateDefColormap
- to call the mi version, and remove the xf4bpp version.
-1867. ANSI-related cleanups for the C&T driver, and make use of the
- LoaderRefSymobols() code to eliminate loader warnings (#1993,
- David Bateman).
-1866. Fix pixmap cache sizing for C&T DSTN systems (#1993, David Bateman).
-1865. Fix a typo that affected the memory probing for C&T 65550 sysems
- with 2MB of memory (#1993, David Bateman).
-1864. Let the C&T driver accept '-depth 15' (#1993, David Bateman).
-1863. Reintroduce DirectColor visual support for depth >8 for the
- Millennium I (#1992, Andrew Aitchison).
-1862. Fixes and cleanups for Linux/Alpha build problems (#1989, 2000,
- Andrew P. Lentvorski).
-1861. Make some changes to the vgahw MMIO handling for Alpha platforms.
-1860. Cleanup and simply some of the mga driver/dac/clock code (#1991,
- Radislaw Kapitan).
-1859. Enable mga TVP3026 interlaced cursor (#1991, Radislaw Kapitan).
-1858. Enable the Pseudo-DMA window for the G100 in the mga driver (#1991,
- Radislaw Kapitan).
-1857. Change some tables in the mga driver to 'const' to help make sure
- that they are not abused, and fix the code that was abusing them
- (#1991, Radislaw Kapitan).
-1856. Fix some G200 problems introduced in 3.9Nf (#1988, 1991, Mark Vojkovich,
- Radislaw Kapitan).
-1855. Fix static server problems caused by item 1851 (based on #1984, 1985,
- Takaaki Nomura).
-1854. xman improvements for NetBSD/OpenBSD (#1983, Matthieu Herrb,
- Ross Harvey).
-1853. C&T update for SuperProbe (#1981, Taketoshi Sano).
-
-XFree86 3.9Nf (20 September 1998)
-1852. Update the sample config file to be consistent with the updated format.
-1851. Add a mechanism to allow modules to tell the loader which symbols from
- from other modules it references, and which of those are essential.
- This makes it possible to eliminate unnecessary warnings about
- unresolved symbols, and to trigger a fatal error where appropriate.
-1850. More attempts towards a working G100 server (#1982, Dirk Hohndel).
-1849. Update the mga driver for use with the resource management code.
-1848. Fix some bugs and typos in the resource management code.
-1847. Rework the vgahw module, abstracting the register accesses and split up
- the save/restore parts.
-1846. Add '\n' to some of the messages in PEXExtensionInit().
-1845. Fix the mga driver's handling of the option register in mga_dac3026.c.
-1844. Trap reentrancy to the FatalError() function and call abort() when
- this happens.
-1843. Avoid a bug in SunPro C 4.2 (ix86) that shows up when building libPEX5
- (#1980, David Holland).
-1842. Fix a typo in Xserver/Imakefile (#1979, David Holland).
-1841. Have the Xv DIX layer trap zero size src and/or dest, returning
- BadValue (#1978, Mark Vojkovich).
-1840. Parially accelerated lines for the Permedia 2 (#1977, Mark Vojkovich).
-1839. Some formatting, bug fix updates to the C&T driver, and reintroduce
- the screen blanking during initialisation for the C&T drivers
- (#1976, David Bateman).
-1838. Update the C&T driver to use the RAC wrapper (#1976, Egbert Eich).
-1837. Add a Resource Access Control (RAC) wrapper module which allows
- colourmap, cursor and fb access to be wrapped when necessary in
- cases where memory and/or I/O resources are being shared (#1976,
- Egbert Eich).
-1836. Back out item 1823 (mi bank enable) (#1976, Ebgert Eich).
-
-XFree86 3.9Ne (13 September 1998)
-1835. Remove the OS dependence in the formatting of docs in xfree86/doc/sgml
- (which removes the need for the BuildAllDocs setting).
-1834. Update mi and dix cursor handling to avoid displaying empty cursors
- (#1972, Mark Vojkovich).
-1833. Update Xv docs (#1971, Mark Vojkovich).
-1832. Add return values to the Get/Put driver functions in the Xv DDX
- (#1970, Mark Vojkovich).
-1831. Some preliminary reorganisation of the MGA driver (#1969,
- Mark Vojkovich).
-1830. Update CURSOR.NOTES (#1968, Mark Vojkovich).
-1829. MGA driver should recognise 15 as a valid depth (#1967,
- Andrew Aitchison).
-1828. Experimental G100 support for the MGA driver, and fix clock PLL
- programming (#1966, Radislaw Kapitan).
-1827. Add support for the 9660, 9680 and 9682 chips to the new trident driver,
- and add some initial acceleration (#1963, Alan Hourihane).
-1826. Fix some planemask test problems at 16bpp with the C&T driver (#1962,
- Taketoshi Sano).
-1825. Fix a problem with QWORD_PAD in XAA (#1961, David Bateman).
-1824. Fix SuperProbe's detection of some C&T HiQV chipsets (#1960,
- Taketoshi Sano).
-1823. Update the mi banking code to enable resources as required (#1959,
- Egbert Eich).
-1822. Update the generic VGA driver to use the new resource control code
- (#1959, Egbert Eich).
-1821. Restructure the C&T driver, and fix the following:
- - CRT half-screen blanking
- - 1bpp mode
- - several SEGV problems
- - the long standing LCD blank problem
- (#1959, Egbert Eich).
-1820. Allow a Device section without a BusID be acceptable for the primary
- vga device when multiple heads are detected (#1959, Egbert Eich).
-1819. New resource management code, which should provide an improved
- infrastructure for handling multi-head configuration, particularly
- where resource sharing is required (#1959, Egbert Eich).
-1818. Fix problems with NonTE ImageText in XAA (#1958, Mark Vojkovich).
-1817. Fix the tseng driver's handling of cases when there is insufficient
- free memory for acceleration to be used (#1957, Koen Gadeyne).
-1816. Change the RELATIVE_CHECK() macro in xf86Xinput.c to fix a multi-head
- cursor problem (Chris Bare).
-1815. Update xf86ReadPciBIOS to set the decode enable bit while reading,
- and update the mga driver to use xf86ReadPciBIOS when appropriate.
-1814. Use mmap for reading the BIOS on more platforms because the
- lseek/read method doesn't work in many cases when the offset is
- greater than 2G.
-
-XFree86 3.9Nd (6 September 1998)
-1813. Preliminary port of the trident driver for the ND (the old version
- has been moved to the olddrivers directory (#1956, Alan Hourihane).
-1812. Document the offscreen memory managers new ResizeArea function
- (#1955, Mark Vojkovich).
-1810. Allow the FreeType code to be build as an X server font module.
-1809. Add Latin2 support to the Speedo and Type1 font code (#1792,
- Robert Wilhelm).
-1808. Updates to XFree86 specific parts of FreeType (#1792, 1933,
- Robert Wilhelm, Juliusz Chroboczek).
-1807. Add the base FreeType 1.1 distribution to /xc/extras/FreeType, and
- update the build procedure to get the source from there.
-1806. Map the pseudo-DMA transfer window used on newer MGA chips, and use
- it for solid rects and spans (#1953, Mark Vojkovich).
-1805. Fix C&T HiQV detection (#1952, Taketoshi Sano).
-1804. Add dashed line support to XAA, and update the mga driver to use it
- (#1951, 1953, 1954, Mark Vojkovich).
-1803. Lots of glint driver updates, including a memclock option to set the
- mclk, and some more XAA functions for the older Permedia chip (#1950,
- Alan Hourihane).
-1802. Use POSIX macro S_IS* instead of (((m)&S_IFMT)==S_IF*) and replace
- "u_long" with "unsigned long" (#1949, UCHIYAMA Yasushi).
-1801. Fix IBM hw cursor pixel ordering (#1948, Alan Hourihane).
-1800. Remove accel/tga and accel/glint directories that are no longer needed
- (#1947, Alan Hourihane).
-1799. Build support for FreeBSD/ELF (#1946, Doug Rabson, Joachim Kuebart,
- Ollivier Robert).
-1798. Xaw and Xmu fixes (#1945, Paulo Cesar Pereira de Andrade).
-1797. HW Bresenham line drawing support for Tseng W32p and ET6000
- (#1944, Koen Gadeyne).
-1796. Fix depth/bpp issues at depth 16 and depth 15 with the IBM support
- in the ramdac module (#1943, Alan Hourihane).
-1795. Change messages in xf86PruneMonitorModes() so that they appear at the
- default verbosity level (#1942, Egbert Eich).
-1794. Print out clock ranges or fixed clocks scaled by the mul/div factors
- (#1942, Egbert Eich).
-1793. MGA G200 support (#1941, Radislaw Kapitan).
-1792. Preliminary I2C module (#1940, Itai Nahshon).
-1791. Add config support for building XFree86 on Linux with DECnet transport
- (#1939, Eduardo Serrat).
-
-XFree86 3.9Nc (29 August 1998)
-1790. 24bpp (high res display problems) and 32bpp (horizontal stripe) fixes
- for the mga driver (#1715, 1716, Doug Merritt).
-1789. Take the mga driver's YDstOrg parameter into account when it passed the
- framebuffer start address to the cfbInitScreen functions. This fixes
- problems that can show up when using more than 4MB.
-1788. Fix an extraneous pixel drawn for some H/V two point lines with
- a Millennium I (Mark Vojkovich).
-1787. Make the BuildLinuxDoc* symbols default to YES when HasSgmlFmt is YES
- (Marc La France).
-1786. Add a resize function to the offscreen memory manager (#1937,
- Mark Vojkovich).
-1785. Fix C&T 69000 horizontal CRT overflow register settings (#1936,
- David Bateman).
-1784. Add some missing UnlockDisplay calls to lib/Xv/Xv.c (#1935,
- Thomas Mueller).
-1783. Fix colourmap save problem (#1935, Thomas Mueller).
-1782. Support for LynxOS 3.0.0 and LynxOS PowerPC fixes (#1935,
- Thomas Mueller).
-1781. An ND version of the Cirrus driver, currently for 5480 and 5446 chips
- only. The old driver has been moved to xfree86/olddrivers/cirrus
- for reference (#1932, 1938, Itai Nahshon).
-1780. Xterm updates:
- - add configure test to infer if xterm should be installed setuid
- based on previously installed xterm (reported by Stephen Marley).
- - integrate/extend patch by Jason Bacon to implement quasi-continuous
- mouse reporting.
- - correct control sequences transmitted by function keys F1 to F4
- when sunFunctionKeys resource is true (it was still using the
- VT100 control sequences).
- - modify handling of backarrow key so that the control modifier
- toggles the backspace/delete interpretation set by the
- backarrowKey resource.
- - limit the row and column values used to report mouse position.
- (#1931, Thomas Dickey).
-1779. Fix clockRanges alloction problem in the tseng driver (#1927,
- Koen Gadeyne).
-1778. Fix tseng banked accelerated mode, and disable ImageWrite in banked
- mode if it requires more than 8k (#1927, Koen Gadeyne).
-1777. Some initial ET4000W32p acceleration (#1927, Koen Gadeyne).
-1776. Fix 24 and 32bpp tseng modes for cards with programmable clocks
- (#1930, Koen Gadeyne).
-1775. Implement the pci_retry and Memclk options for the MGA driver (#1927,
- Mark Vojkovich).
-1774. Update the mga driver to use MMIO for everything (making use of the
- MMIO support in the vgahw module), and do its own colourmap handling
- (#1927, Mark Vojkovich).
-1773. Add a MMIO version of the vgahw code to the vgahw module (#1926, 1928,
- Mark Vojkovich).
-1772. Small Xv DDX udpate (#1925, Mark Vojkovich).
-1771. Update the C&T driver to use the new ClockMulFactor code (#1924, 1936,
- David Bateman).
-1770. Add a ROP_NEEDS_SOURCE option to XAA, as needed by the C&T driver
- (#1924, David Bateman).
-1769. Add support to the tga driver for 24 plane cards (#1923, Tim Rowley).
-1768. Resync the scale[] find_scale[] arrays in the bitmap font code, which
- got out of sync when gzipped font support was added (#1921 Doug Ridgway).
-1767. Fix incorrect #ifdef in sunKeyMap.c for Danish Type 5 Sun keyboards
- (#1919, Erik Bertelsen).
-1766. Move HW cursor support from the XAA module to the ramdac module,
- update drivers for this change, move IBM cursor code from the glint
- driver to the ramdac module, and intergrate the HW cursor code fir
- the IBM ramdacs using a new helper function in the ramdac module.
- (#1918, Alan Hourihane).
-1765. Fix some more compiler.h problems for AXP platforms (#1918,
- Alan Hourihane).
-
-XFree86 3.9Nb (20 August 1998)
-1764. Fix some memory leaks in Xlib that happen on realloc failures
- (#1914, ??)
-1763. Optimise the way C&T acceleration is handled by reorganising
- some of the graphics primitives, including caching foreground and
- background colours, and moving some operations from the Subsequent
- primitives to the Setup primitives (#1915, David Bateman).
-1762. Introduce HW cursor for the Permedia2 (but p2 and p2v dont' work
- yet), fixup pm2v_dac and pm2_dac register naming, and add reset
- logic to reset the accelerator (but not used yet) (#1912,
- Alan Hourihane).
-1761. Fix building in xfree86/common when XINPUT is not defined (Egbert Eich).
-1760. Fix problem compiling xf86_IlHack.c on Alpha platforms.
-1759. Add an option "ShowOverscan" to the vgahw module which makes the
- unblanked area of overscan clearly visible.
-1758. Adjust the builtin mode for the 8bpp generic vga driver to blank as
- much of the overscan area as possible.
-1757. Adjust the horizontal blank end value in the vgahw module to avoid
- excessive blanking for most chipsets when running in generic vga mode.
-1756. Tseng driver updates, including:
- - Add support for chips with a set of discrete clocks instead of a
- programmable clock.
- - use the new ClockRanges code to auutomatically select between pixmux
- and normal modes, and for 24bpp clock scaling.
- - add a replacement for vgaHWBlankScreen() that doesn't do a
- sequencer reset.
- - remove some old, unused code.
- (#1910, Koen Gadeyne).
-1755. Loader updates required for the updated gdb (#1908, Paul Flinders).
-1754. Add VSTATUS control char support to xterm (#1907, Robert Earl).
-1753. Update the register probing of the chipset for the C&T HiQV chips
- in SuperProbe and the C&T driver (#1904, David Bateman).
-1752. Add cached screen to screen colour expansion to the C&T driver
- (1904, David Bateman).
-1751. Add options to XAA to allow acceleration primitives to be disabled
- individually (#1903, David Bateman).
-1750. Add preliminary solid Bresenham and two point line support for XAA,
- and code to make use of it for the mga driver (#1900-1902,
- Mark Vojkovich).
-1749. Introduce Helper functions for ramdac module, Save/Restore/SetBpp,
- and update the glint and tga drivers to use them (#1899, 1913,
- Alan Hourihane).
-1748. Move IBM640 code from the glint driver intot he generic ramdac module
- (#1899, Alan Hourihane).
-1747. Add ClockMulFactor and ClockDivFactor fields to clockRanges to allow
- for scaling of clocks when doing mode validation (#1898, 1905,
- Koen Gadeyne, 1906, Itai Nahshon).
-1746. Add recognition of the Voodoo 2 to the PCI list (#1897, Koen Gadeyne).
-1745. Some editres, xedit and xgc updates (#1788, 1842,
- Paulo Cesar Pereira de Andrade).
-1744. Lots of Xaw/Xmu updates (including ansification of Xaw and Xmu) --
- see the Changelog in xc/lib/Xaw for further details (#1776, 1788, 1842,
- Paulo Cesar Pereira de Andrade).
-1743. Support for GNU/Hurd (#1895, UCHIYAMA Yasushi).
-1742. Remove the implicit assumption in some areas that O_RDONLY is 0
- (#1894, UCHIYAMA Yasushi).
-1741. Merge in Metro Link's version of the 64 bit select fixes for the
- X server and lbxproxy (#1893, Stuart Anderson).
-1740. Set DlLibrary to be empty for OpenBSD, and remove formatted man pages
- on 'make clean' for OpenBSD and NetBSD (#1892, Matthieu Herrb).
-
-XFree86 3.9Na (14 August 1998)
-1739. Rework the way the maximum number of server client connections
- is determined, and experimentally increase MAXCLIENTS to 256.
-1738. Enable mmap support in Xvfb for Linux (#1889, Douglas Ridgway).
-1737. Xv DDX layer for XFree86, and add documentation for it to the DESIGN
- doc (#1883, 1884, Mark Vojkovich).
-1736. Modify AddScreen() and AllocateScreenPrivateIndex() to initialise new
- screen devPrivates to zero.
-1735. Ansify the Xv server dix code (#1881, Mark Vojkovich).
-1734. XAA doc update (#1880, Mark Vojkovich).
-1733. Cache the fg, bg and planemask values in the MGA driver and only
- change them when needed (#1878, Mark Vojkovich).
-1732. Preliminary ImageRead support for the MGA driver (disabled) (#1879,
- Mark Vojkovich).
-1731. Preliminary ImageRead support (#1878, Mark Vojkovich).
-1730. Use accelerated ImageWrites for PutImage and BackingStore and SaveUnder
- pixmap restores (#1878, Mark Vojkovich).
-1729. Fix an XAA text rendering bug for rotated text (#1878, Mark Vojkovich).
-1728. Tseng driver updates:
- - Add DPMS support
- - Replace some Boolean options with Tristate options
- - Add ET4000W32p support and the ICS5341 16-bit ramdac support
- - 1bpp and 4bpp support added (1bpp doesn't work yet)
- - cleanup mode validation code
- (#1877, Koen Gadeyne).
-1727. Fix problems using ffs() in the X server on 64bit platforms
- (specifically Linux/Alpha) (#1876, Raphael Finkel).
-1726. Fix for palette problems with the BT ramdac support in the ramdac
- module (#1873, Alan Hourihane).
-1725. Export the symbols __remq and __remqu from the loader for Alpha
- platforms (#1872, Alan Hourihane).
-1724. Fix a 24/32bpp problem with the IBM code in the ramdac module
- (#1871, Alan Hourihane).
-1723. Change the way the depth/bpp/fbbpp values are selected form the
- command line and config file to prevent inconsistently mixing values
- from the two sources (#1868, Alan Hourihane).
-1722. Fix some XAA hw cursor problems:
- - Apply the HARDWARE_CURSOR_INVERT_MASK flag only after applying
- HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
- - Fix the 1-bit interleaving code
- (#1867, Koen Gadeyne).
-1721. Remove all the (currently unused) colour expansion code from
- the old branch that replaced some XAA functions. This should no
- longer be necessary (#1866, Koen Gadeyne).
-1720. Add XAA hw cursor support for the ET6000 (#1866, Koen Gadeyne).
-1719. Fix some problems that showed up with the glint driver when
- using a P2 and TX500 card together (#1861, Dirk Hohndel).
-1718. Have the glint driver remove all but one mode since the chipset
- doesn't support panning (#1859, 1870, Alan Hourihane).
-1717. Update the loader to correctly identify dll ELF modules (#1858,
- Itai Nahshon).
-1716. Fix an infinite loop in the xf86Config code that can happen with a
- config file error (#1858, Itai Nahshon).
-1715. Resync the TGA driver with changes elsewhere (#1856, 1874,
- Alan Hourihane).
-1714. Glint driver updates, including:
- - HW cursor for IBM 526 and 640 ramdacs
- - Depth 30 support for the IBM 640
- - GLINT MX (ELSA Gloria XL) support
- - More acceleration for the TX/MX chipsets
- - Fixes for Alpha platforms
- - Major acceleration updates for Permedia, Permedia2, 500TX and MX chips
- - Permedia 2v cleanups
- (#1855, 1857, 1860, 1863, 1864, 1865, 1890, Alan Hourihane).
-1713. Add support for depth 30 to xf86SetWeight() (#1854, Alan Hourihane).
-1712. Reinstate the ONLY_LEFT_TO_RIGHT_BITBLT and ONLY_TWO_BITBLT_DIRECTIONS
- XAA options (#1853, Alan Hourihane).
-1711. Add support for the IBM 640 ramdac to the ramdac module (#1852,
- Alan Hourihane).
-1710. Add finer grained offscreen memory management for the accelerator
- to the Tseng driver to allow as many acceleration features to be
- enabled as can be supported by the available offscreen memory
- (#1851, Koen Gadeyne).
-1709. Add XAA scanline colour expansion, screen-to-screen colour expansion,
- 8x8 colour pattern fills, ImageWrite to the Tseng driver (#1851,
- Koen Gadeyne).
-
-XFree86 3.9N (2 August 1998)
-1708. Fix some XAA problems (#1850, Mark Vojkovich and Koen Gadeyne).
-1707. Rename some of the XAA colour expansion stuff, and update the XAA docs
- (#1848, 1849, Mark Vojkovich).
-1706. Tseng driver updates (#1847, Koen Gadeyne):
- Add Mclk support, replace globals in tseng_bank.c with entries
- in the TsengRec, remove redundant parameter passing, fix a potential
- bug in the ET6000 memory detection code, implement memory limit
- checking, fix a bug in the 555/565 handling, cleanup locking/unlocking
- code.
-1705. Some fine tuning of the way the extension modules are build.
-1704. Merge in the new design branch. A full changelog for the new design
- branch can be found in the CHANGELOG.ND file.
-1703. Font-related X server buffer overflow fixes (Robin Cutshaw).
-
-XFree86 3.9Ak (11 July 1998)
-1702. xterm patches 81 and 82. Fix Linux/Alpha build problems,
- utmp handling on Solaris, some terminfo nits, and improve
- cursor colour (#1794, 1797, Thomas Dickey).
-1701. Fix CloseScreen() related problems (#1793, Marc La France).
-1700. Close some sockets that xdm was leaving open when running new
- sessions (#1704, Matthieu Herrb).
-1699. Fix usleep problems with static servers on SVR4.
-1698. Fix a problem parsing "ModeLine" entries (#1779, Keldon Jones).
-
-XFree86 3.9Aj (04 July 1998)
-1697. PC98 fix for VT switching, VideoBoard98 update (#1766, Takaaki Nomura).
-1696. xterm patches 79 and 80. Fix for F1-F4 key handling, fg/bg pixel
- value with -flipPixels, scrollbar color, keypad handling, and
- various terminfo enhancements (#1758,1762 Thomas Dickey).
-1695. Lots of Xaw work. See xc/lib/Xaw/Changelog for details
- (#1660, 1673, 1678, 1686, 1701, 1738, 1752, 1755, 1765
- Paulo Cesar Pereira de Andrade).
-1694. Add the library security fixes (#1722).
-1693. Fix rendering errors in the generic bit expansion code (#1746,
- Jens Owen).
-1692. Fix problem in Oak clock setting routines (#1744, Kevin Buhr).
-1691. Clean up vga16 (remove unused code, remove vga16's mfb (vga2 is used
- instead), clean up vga16's external name space). Minor fix to ATI
- driver. (#1742, Marc LaFrance).
-1690. Fix macro expansion in xf86Config.c (#1730, Jens Maurer).
-1689. On Linux, default the use of special or internal malloc's to NO
- (instead of forcing it to NO). Allow CloseScreen to free wrapper
- private storage in most servers. Push out backing store initialisation
- to the callers of the various <framebuffer>ScreenInit()'s. Change
- m68k's XF68_FBDev to use backing store low-level functions to
- save/restore the screen during VT switches. Minor fixup to loader
- message. (#1719, Marc La France).
-1688. Fixes for 24bpp and 32bpp on Matrox Millenium II. This fixes the
- horizontal stripe for modes using > 4MB (#1715,1716, Doug Merritt).
-1687. Fix build problems on LynxOS and enable keyboard LEDs on LynxOS 2.5.1
- (1712, Thomas Mueller).
-
-XFree86 3.9Ai (05 June 1998)
-1686. Add rendition directory. This is not included in the build process, yet
- (#1707, Marc Langenbach).
-1685. Make glint compile on Alpha. Some xtest fixes for Alpha (#1705,
- Christian Worley).
-1684. xterm patch 77,78, convert to ANSI C (#1702,1706 Thomas Dickey).
-1683. Fix compile problems under OS/2 (#1693, Holger Veit).
-1682. Fix xmag segfault (#1675, Andy Sloane).
-1681. Fix build problem of the static servers on FreeBSD. Fix build problem
- on SVR4(incomplete). Update PC98 Card Database(#1691, Isao Ohishi,
- Takaaki Nomura).
-1680. Minor fix to ATI driver clock code. Fix vga16 for xtest-detected
- problems. Fix up vga16's pixmap printing when enabled by DEBUG. There's
- no need for XFree86LOADER specifics in mibitblt.c(#1690, Marc La France).
-1679. Fix hw cursor on CT65555 and fix loader problem (#1688,1689 Nozomi Ytow).
-1678. Fix freeing of names when removing modes (#1685, Matthieu Herrb).
-1677. Enable ImageWrite in 24 bpp for C&T HiQV (#1684,1687 Nozomi Ytow).
-1676. Fix unknown symbol type 1e message in a.out loader (#1683,
- Matthieu Herrb).
-1675. xterm patches 75 and 76. Fix for print-window function, minor cleanups,
- lots of fixes from other people (see xterm.log.html) (#1681,1682,
- Thomas Dickey).
-1674. Make vga16 use backing store functions to save/restore the screen on VT
- switches. Don't call xf86InvalidatePixmapCache when bpp is 1 or 4
- (#1680, Marc La France).
-1673. Change PIC code to print names of ALL devices capable of displaying
- video. Return pointer to the last card instead of the first (#1662,
- Dejan Ilic).
-1672. Add skeleton driver for Tritech Pyramid 3D (#1661, Dejan Ilic,
- Mark Vojkovich).
-1671. Check additional pci bus in scanpci (Robin Cutshaw).
-
-XFree86 3.9Ah (28 April 1998)
-1670. Xterm patch 74 fix define conflicts and update print support (#1674,
- T.E.Dickey).
-1669. Xterm patch 73 added print window facility, terminfo updates,
- conditional include cleanup, debugging trace enhancements, and
- HP-UX configure updates (#1672 T.E.Dickey).
-1668. Framebuffer fixes leaving valid GC on exit, fix for opaque types
- (#1669 Marc Aurele La France).
-1667. Add ELF support for AXP platform (#1666 Stuart Anderson).
-1666. PCI function fixes for AXP platform (#1665 Alan Hourihane).
-1665. SiS updates (#1664 Mike Chapman, Mitani Hiroshi).
-1664. Fix CompressAllFonts define use in X11.tmpl (#1663 Matthieu Herrb).
-1663. Xaw updates including more functions for diaplayLists, fixes
- for simpleMenuWidget, boxWidget, and panedWidget (#1660 Paulo Cesar
- Pereira de Andrade).
-1662. Xdm seg fault fix (#1658 Matthieu Herrb).
-1661. Tseng PIXMUX updates (#1656 Krajcsovits Gyorgy).
-1660. Mouse driver loop restructuring and additional packet data
- checks (#1654, Oyvind Aabling).
-1659. PANIX build fix for PC98 platform (#1653, Satoshi Kimura).
-1658. Sync loss on cursor change fix (#1650, Mark Vojkovich).
-1657. Driver line fix, unresolved symbol fix, remove loading of xaavga256
- at depths greater than 8, glint 24bpp fix (#1645-1649 Alan Hourihane).
-1656. More XF86Setup patches, P9000 symbol fix, PC98 Imakefile sync (#1644
- Takaaki Nomura).
-1655. Tseng doc, accel sync with 3.3.2, PIXMUX and misc fixes (#1641,1642
- Koen Gadeyne).
-1654. ISC fix for usleep and glint probe fix for DELTA (#1639,1640 Michael
- Rohleder).
-1653. Add FreeType code to lib/font/FreeType, but the build-related
- things haven't been done yet (David Turner, Robert Wilhelm,
- Werner Lemberg, Mark Leisher, Juliusz Chroboczek).
-1652. Xterm patch 72 activity notification enhancement (#1659, T.E.Dickey).
-1651. Xterm patch 71 buffer overflow fix (#1651, T.E.Dickey).
-1650. Sync I128 server acceleration with 3.3.2 (Robin Cutshaw).
-
-XFree86 3.9Ag (05 April 1998)
-1649. AGX ScrnInfoRec fix, fix compiler warnings for Xprt and loader,
- fix vgaCloseScreen problem, add new ScreenRec functions to
- set/get pixmaps and wrapper functions, VC switch to use
- low-level backing store functions (#1635, Marc Aurele La France).
-1648. xfree98/XF86Setup sync with 3.3.2 (#1632, Takaaki Nomura).
-1647. xfree86/XF86Setup sync with 3.3.2 (#1629,1634 Kazutaka Yokota).
-1646. Back out the following R6.4-related changes:
- #1169, 1170, 1342 -- version numbering changes,
- #1167 -- CUP extension,
- #1225, 1282, 1341 -- EVI extension,
- #1171-1178, 1198, 1246, 1305 -- Xinerama extension,
- #1165 -- Xt Resource Configuration Management.
-1645. XAA fixes for xf86bpp (#1633, Alan Hourihane).
-1644. More 3.3.2 syncs, PC98 sync, usleep problem with FreeBSD,
- SVR4.0 build problem fixes (#1631, Takaaki Nomura).
-1643. Kensinngton Thinking and Expert Mouse fix (#1630, Kazutaka Yokota).
-1642. S3 968 fix (#1628, Kazutaka Yokota).
-1641. Add DoImageWrite for Permedia2 and partial 24bpp acceleration to
- the glint server (#1627, Alan Hourihane).
-1640. ISC sync with 3.3.2 (#1625,1626, Michael Rohleder).
-1639. Xterm patch 70 including Imakefile fix for logging, "ich"
- restoration, cursor color fix, "-vb" arg fix, character-set
- rework, SS2/SS3 control fix, terminfo updates (#1624, T.E.Dickey).
-1638. Add loader symbol for miSetZeroLineBias (#1623, Mark Vojkovich).
-1637. Fix duplicate symbols in s3 server (#1621, Takaaki Nomura).
-1636. glint cleanup for XAA autoload modules (#1620, Alan Hourihane).
-1635. xf86Config fixes for svga and accel servers, extmod load for all
- depths (#1618,1619, Alan Hourihane).
-
-XFree86 3.9Af (28 March 1998)
-1634. Add 1024x600 to the identified video modes in the chips server
- (#1617, Nozomi Ytow).
-1633. Resync xfree98 with xfree86 and resync some PC98 files with 3.3.2
- (#1616, Takaaki Nomura).
-1632. Fix micro typo in chips.sgml (#1615, David Bateman).
-1631. Define defaults for XF86Config file locations. Have make World remove
- Makefile.bak files. Resync ScrnInfoRec's for the last time (Hope
- springs eternal). "Externalise" InstalledMaps in all XFree?? servers.
- Remove reference to DEFAULT_MODULE_PATH in static servers. Deal with
- some of the warnings produced by gcc by default. Resync ATI driver with
- the version found in XFree86 3.3.2. Fix loader bug in dealing with XAA.
- (#1614, Marc La France).
-1630. Don't abort a static server if the Driver statement in the Device
- section is missing (#1613, Kazutaka Yokota).
-1629. Fix typo in #1606 and improve printing of mouse related messages
- (#1613, Kazutaka Yokota).
-1628. Build fixes for static S3 and S3V servers (#1613, Kazutaka Yokota).
-1627. Re-add 8x8 trap fill support in XAA (#1612, Mark Vojkovich).
-1626. Add new text replacements to glint server, add packed data modes, tune
- fifo handling, fix drawing bugs and others (#1609,1611, Mark Vojkovich,
- Alan Hourihane).
-1625. Add mouse related 3.3.2 changes to XF86Setup (which still doesn't
- compile) (#1608,1610, Kazutaka Yokota).
-1624. Update xdpyinfo to reflect mouse code changes (#1607, Kazutaka Yokota).
-1623. Merge missing mouse code from 3.3.2 (#1606, Kazutaka Yokota).
-1622. Resync xterm, add missing patches from 3.3.2 (#1605, Thomas Dickey).
-
-XFree86 3.9Ae (22 March 1998)
-1621. Bring over some of the new mouse code from the 3.3.2 tree.
-1620. Link X11 apps against libxpg4 on FreeBSD to get multibyte locale
- support.
-1619. SVGA/chips. include support for the new 69000 chipset. Fix up the
- memory probing for the 65554, 65555 and 68554 chips. Add probing for
- the 64200, 64300 and 69000 chips to SuperProbe. Fix the memory probing
- for the 65554, etc in SuperProbe. Some docs updates (#1603,1604,
- David Bateman).
-1618. Fix Mach32 text restoration (#1601, Marc La France).
-1618. Add Rendition V2x00 to vgaPCI.h (#1598, Marc Langenbach).
-1617. xterm patches. improve test for highlightColor so that xterm does not
- attempt to use that unless it is different from the foreground and
- background colors. remove ich and ich1 from xterm and xterm-8bit
- terminfo descriptions. restore 1-pixel overlap of scrollbar border with
- left edge of window. add a configure option, --enable-logfile-exec.
- make the ALLOWLOGFILEEXEC code compile & run, if configured. minor
- documentation nits. correct the problem in xterm with utmp by removing
- the reset of setuid/setgid before the main event loop (#1525,1571,1599,
- Thomas Dickey).
-1616. Change s3/svga from using 8x8 pattern fills to 8x8 color expand fills.
- Add support for S3's type planar 8x8 pattern fills to XAA. Add support
- for S3's planar 8x8 fills to the XAA stippled trapezoid stuff
- (#1594,1595,1596,1597, Mark Vojkovich).
-1615. Ensure the correct message for lines at startup (#1591, Alan Hourihane).
-1614. Fix XAA to allow vertical lines using TwoPointLine (#1590,
- Alan Hourihane).
-1613. Change the xf86orect.c code to always use a hardware filled rect rather
- than a software one when drawing vertical lines (#1589, Mark Vojkovich).
-1612. Add MICROSOFT_ZERO_LINE_BIAS flag to xaa to indicate that the hardware
- uses MicroSoft's line bias rules rather than X's. Fix the end point
- sematics for two point lines. Add TiledFilled Rects via image write.
- Fix a problem with the CopyArea wrapper syncing when it shouldn't. Fix
- twopoint line problems with XAA dashed lines. Make sure we alway check
- for one rect situations when using XAA polygon code (#1575,1576,1577,
- 1578,1579,1580,1581, Mark Vojkovich).
-1611. Add new MGA acceleration, including image writes and 8x8 pattern trap
- fills. Go back to two point lines. Add solid filled span replacement.
- Make PCI retries off for mga by default (need Option "pci_retry" to turn
- them on). Make hardware cursor work better in doublescan modes. And
- turn hw cursor on by default (#1582,1583,1592 Mark Vojkovich).
-1610. Removes assumption that we have a Trapezoid function (#1573,
- Alan Hourihane).
-1609. Fix ImageWrite code at 15bpp by fixing xaa not to rely on xf86bpp, but
- use the accel structure (#1572, Alan Hourihane).
-1608. Fix problem building resize on BSDI, update manpages, add log
- xterm.log.html (#1490, Thomas Dickey).
-1607. Small patch to xterm's 8-bit terminal description (#1481, Thomas Dickey).
-1606. Move framebuffer ModuleInit functions to separate C source files.
- Another fixup to mono's ScrnInfoRec (#1474. Marc La France).
-1605. Loader updates (#1467, Stuart Anderson).
-1604. Ensure window and GC privates are aligned on a sizeof(long) boundary.
- Minor bug fix to mfb and afb framebuffers. Reinstate building of Xibm
- server. Move pRotatedPixmap, pCompositeClip, fExpose, freeCompClip from
- GC privates to the GC structure proper (in preparation for the banking
- mi wrapper) (#1442,1443,1444,1445,1588 Marc La France).
-1603. xterm fixes for configuration (#1437, Bjorn Helgaas).
-1602. Lots of SVGA/ATI updates. Enforce architectural limits on panning &
- scrolling. Duplicate recent XF86_Mach64 changes (Bus detection, Chipset
- detection adjustments, Support for 16MB linear apertures, maxClock
- settings). First swipe at supporting adapters whose VGA has been
- disabled. Save and restore more registers on mode
- entries/switches/exits. Colour map initialization changes to make use
- of uninitialized entries more obvious. Bug fix to DSP register
- calculation. Support 15, 16, 24 and 32bpp on integrated controllers.
- Remove dependence on TimingTab. Include VGA DAC registers in verbose
- output. Skip sparse I/O probes when PCI configuration space indicates a
- device has registered a block I/O base. Virtual X rounding adjustments
- for packed modes. Documentation updates (#1430, Marc La France).
-1601. Clean up ScrnInfo, make vgaCloseScreen call the framebuffer's
- CloseScreen() function, determine more pricely whether the virtual
- resolution fits in video memory, minor optimization of cfb's
- ImageGlyphBlt entry (#1428,1429, Marc La France).
-1600. Fix typo in mga.h (#1418, Tim Rowley).
-1599. Fix some baserom/_baserom confusion (#1407, Gary Barton/Concurrent).
-1598. More fixes from Metro Link and some updates for clients. Remove
- all but one copy of sdimple.c (#1405,1406, Craig Groeschel).
-1597. Remove unnecessary byte_reversed arrays (#1400, Craig Groeschel).
-1596. Add missing Xarch.h (#1399, Craig Groeschel).
-1595. Add no-listen keyword to xfs (#1397, Topi Miettinen).
-1594. Build fixes for PC98 static build (#1391,1396 Takaaki Nomura).
-1593. Build fixes to loader directory (#1388, Alan Hourihane).
-1592. Some Link Kit fixes (#1384, David Bateman).
-1591. Add zoom initialization and fix blits on T2R (Robin Cutshaw).
-1590. Add support for several new mice, including Kensington ThinkingMouse,
- ALPS GlidePoint, Genius NetScroll, Genius NetMouse, Genius NetMouse,
- ASCII MieMouse, Logitech MouseMan+, Logitech FirstMouse+ (#1380,
- Kazutaka Yokota).
-
-XFree86 3.9Ad (25 January 1998)
-1596. Fix two buffer overflow problems in the X server.
-1595. Fix some libXt VSW5 failures (#1347, 1359-1363, 1365, Kaleb Keithley,
- Arthur Barstow).
-1594. Change server's default vendor string and release (#1342,
- Kaleb Keithley).
-1593. Fix problem entering mode_shifted characters with xdm and XKB
- (#1340, Kaleb Keithley).
-1592. Bump SunOS 4.x libXext rev (#1339, Kaleb Keithley).
-1591. Pick up PCI multimedia/video devices and display devices of all
- subclasses (not just VGA) in vgaGetPCIInfo().
-1590. Reinstate Xserver/hw/ibm for reference purposes.
-1589. Cirrus and vga256 driver changes to support the PowerPC machines.
- (1357, Gary Barton/Concurrent).
-1588. Organize xf86_ansic.h/xf86_libc.h/xf86_OSlib.h, and de-mangle xf86*
- libc calls. Move Probe routine to the beginning of the ScrnInfoRec to
- match the vgaVideoChipRec. Make the mach32, mach64, mach8, i128, and
- ibm8514 servers loadable. Use one global byte_reversed array. When
- SetCursor is called with a null CursorPtr, turn the cursor off. Fix
- CapNotLast lines and segments in mach64 and xaa. Copy some code from
- Metro-X 3 to handle panning at 24 bpp on Mach64. Mask the correct
- number of pitch bits when updating the CRTC_OFF_PITCH register. Use
- xf86scanpci instead of vgaPCIInfo. Fix tseng driver DPMS bug. Declare
- and initialize xf86PixmapIndex. (#1356, Craig Groeschel/Metro Link).
-1587. Add xf86Serial functions (#1355, Chris Bare/Metro Link).
-1586. New config file parser, new functions for accessing xf86Info,
- handle an XQUEUE race condition, make sure XqueQaddr is initialized
- (1353, Stuart Anderson/Metro Link)
-1585. Build cleanups and fixes to cursor handling for multi screen layout
- (#1354, Craig Groeschel/Metro Link).
-1584. Add portable and extensible PCI support framework (#1352,
- Gary Barton/Concurrent).
-1583. Support PowerMAX_OS on Motorola/Concurrent PowerPC machines
- (#1351, Gary Barton/Concurrent).
-1582. .cf and Imakefile changes to use PpcArchitecture and PpcSvr4Architecture
- definitions for consistency (#1350, Gary Barton/Concurrent).
-1581. Fix 9397 detection in Trident driver (#1376, Alan Hourihane).
-1580. Add support for the DacSpeed entry to the Mach64 server (#1375,
- Kevin Martin).
-1579. Fix 16bpp for the Permedia 2 (#1373, Alan Hourihane).
-1578. Fix DPMS for Trident cards (#1372, Alan Hourihane).
-1577. Add Option "no_pci_retry" to option code and the MGA driver (#1370,1371,
- Mark Vojkovich).
-1576. Add back CyberCont that was removed from Trident driver in 3.9Ac by
- mistake (#1369, Alan Hourihane).
-1575. Fix ImageWrite code to not read beyond the end of the source in cases
- of bad alignment (#1368, Mark Vojkovich).
-1574. xterm updates (#1366,1378 Thomas Dickey) including:
- - change the terminfo entry so that rs1 does a hard reset
- - modify treatment of hard reset by the xterm program to reset the saved
- lines
- - correct hard reset by also resetting user-defined keys.
- - change the way highlihting is implemented
-1573. Fix PutImage to work with Rops other than GXcopy (#1364, Alan Hourihane).
-1572. Fix clipping in 16bpp on tgui chipsets, fix 32bpp and add transparency
- (#1345,1346,1349 Alan Hourihane).
-1571. Some updates to stub driver to reflect current layout (#1343,
- Dejan Ilic).
-1570. Change xdm config to explicitly specify the VT used on OpenBSD (#1337,
- Matthieu Herrb).
-1569. Build fix for P9x00 driver (#1336,1344 Takaaki Nomura).
-1568. Resync xaa/Imakefile for PC98 (#1335, Takaaki Nomura).
-
-XFree86 3.9Ac (11 January 1998)
-1567. Fix some VSW5 failures in libXt (#1333, Kaleb Keithley).
-1566. xterm updates (#1332, Thomas Dickey) including:
- - Add xterm support for blinking text. It doesn't actually cause the
- text to flash, but text with the blink attribute can be displayed in
- color, using new resources colorBL and colorBLMode.
- - Corrected a missing save-cursor in the handling of SGR 1048.
- - Flush the output of the transparent printing after each line.
- - Correct the modes that are affected by save/restore cursor.
- - Corrected placement of one of the XSync calls which had the
- side-effect of writing on the window border when the xterm was
- resizing from 132 to 80 columns.
- - Work around an incompatibility of the XKB definition used in xterm
- versus that symbol from IRIX 6.2's imake definitions (by adjusting
- the standalone configure script).
-1565. Add detection of Intel TX chips and Pyramid 3D TR25202 to scanpci
- (#1330, Dejan Ilic).
-1564. Fix xtest related problems on MGA (related to syncing before reading)
- (#1329, 1334, Mark Vojkovich).
-1563. Possible fix for Millennium II crashing (#1328, Mark Vojkovich).
-1562. Add more careful checking of $HOME/.xsession in the default xdm
- Xsession script (#1327, Geoff Wing).
-1561. Fix uninitialised variables in decddx (#1326, Kaleb Keithley).
-1560. Fix a typo in the Xlib docs (#1325, Kaleb Keithley).
-1559. Add 8x8 pattern filled 1 rect polygons to XAA. Also included is
- an 8x8 pattern filled trapezoid function (#1324, 1331, Mark Vojkovich).
-1558. Add more conservative limits for when XAA uses trapezoid fills rather
- than spans (#1323, Mark Vojkovich).
-1557. Add transparent 8x8 pattern fills to s3/svga (#1322, Mark Vojkovich).
-1556. Xt (VSW5 failures): Xt11/XtCallConverter - Test Purposes 11, 12, 13
- (#1321, Kaleb Keithley).
-1555. Xt: XtMakeGeometryRequest doesn't emit error if parent != composite
- (#1320, Kaleb Keithley).
-1554. S3 (svga) ramdac fixes in IBMRGB52x_Init, TI_3020_3025_Init,
- NORMAL_PreInit, and ATT_409_498_Probe routines, including fixes for
- the use of the dacSpeeds array (#1319, Craig Groeschel/Metro Link).
-1553. Fixes for Permedia PM2 support to correct 32bpp, and improve things
- for 16bpp (#1318, Alan Hourihane).
-1552. P9x00 driver (#1317, Joerg Knura).
-1551. Allow xvidtune to be driven by the keyboard (#1315, via Kaleb Keithley).
-1550. Add missing exported symbols to Win32 DLLs (#1314, Kaleb Keithley).
-1549. Detect an extra Trident Cyber chip (#1313, Alan Hourihane).
-1548. Add timeouts to all Tseng "wait for something" functions (#1312,
- Koen Gadeyne).
-1547. Tseng driver documentation update (#1311, Koen Gadeyne).
-1546. Update xterm man page, configure script and related things (#1310,
- Thomas Dickey).
-1545. Add a version number to xterm, and make the -version and -help options
- used before attempting to open the display (#1310, 1316, Thomas Dickey).
-1544. Implement logic to permit xterm to work with proportional fonts.
- This is done by rendering the characters on a fixed pitch (#1310,
- Thomas Dickey).
-1543. Fix missing planemask in XAA function (#1309, Mark Vojkovich).
-1542. Fix XAA syncing inconsistencies (#1308, Mark Vojkovich).
-1541. Allow Trident 9397 and later 3D chipsets to work by not using
- acceleration (#1307, Alan Hourihane).
-1540. Fixes for older Trident Cyber series (#1307, Arthur Tateshi).
-1539. Fix includes for xfwp (#1306, Craig Groeschel/Metro Link).
-1538. Fix for large pixmaps in XINERAMA extension (#1305, Kaleb Keithley).
-1537. Xlib: XGetICValues fails for {preedit,status}Attributes
- (#1299, Kaleb Keithley).
-1536. Add locale and xkb files for Lithuanian (#1298, Ricardas Cepas).
-1535. Device updates for scanpci (Robin Cutshaw).
-1534. First cut at cleaning up the parallel make dependencies (Robin Cutshaw).
-
-XFree86 3.9Ab (29 December 1997)
-1533. Reorganize the acceleration code in the tseng driver. Fix tseng XAA init
- problem (#1303, Koen Gadeyne).
-1532. Add support for changing the MClk from the XF86Config file for
- W32p cards with ICS5341 RAMDAC and for the ET6000 family (#1302,
- Koen Gadeyne).
-1531. Add option to build xterm without tek4014 emulation. Add option to
- build xterm with default TERM value other than "xterm". Apply some
- minor bugfixes to OS/2 version. Fix configure help message and missing
- quotes in memmove/bcopy configure test (#1297, Thomas Dickey, Darren
- Heibert).
-1530. Add support for clock setting of the new trident chips (#1294,
- Alan Hourihane).
-1529. XAA vertical line speedup (#1293, Alan Hourihane).
-1528. Add panning for Permedia and Permedia 2 (#1292, Alan Hourihane).
-1527. Add a few more messages to tseng driver and clean up the use of
- the different bytes-per-pixel variables. Add "showcache" option
- (#1300,1301, Koen Gadeyne).
-1526. Fix XAA pixmap cache bug with 16bpp and RGB=555 or 32bpp (#1295,
- Walter Gadeyne).
-1525. Fix ImageWrite for Tseng (and re-enable it) (#1296, Koen Gadeyne).
-1524. Fix horizontal lines in Tseng driver (#1291, George Krajcsovits).
-1523. Support MUSIC MU9C4910 RAMDAC in Tseng driver (#1290, Koen Gadeyne).
-1522. Fix bad color in hardware linedraw for Tseng (#1290, Koen Gadeyne).
-
-XFree86 3.9Aa (20 December 1997)
-1521. Fix border colours for Trident server (#1289, Alan Hourihane).
-1520. Major update to Mach64 server. Proper identification of the different
- chips. Support for 16MB boards. Increased max DAC speed settings for
- newer chips. Support for AGP RagePro cards. Block write mode for
- RagePro chips. 1600x1200 mode support for VT and newer chips. Use the
- auxilliary register aperture on chips that support it. Use 16MB memory
- aperture on PCI Mach64s with integrated controllers.
- (#1288, Kevin Martin).
-1519. New code for the glint server. Preliminary support for the Permedia 2
- hardware cursor. Preliminary support for panning the display with
- multiple modelines for Permedia/Permedia 2. Fix ELSA Permedia 2 boards.
- Cleanup of glint_init.c. Fix DGA when using software cursor. Addition
- of code to not save VGA state if the VGA core is disabled.
- (#1285,1286,1287, Alan Hourihane).
-1518. Fix the "invalid depth" problem with packed 24 (#1284, Andrew Aitchison).
-1517. Fixes to finish keyboard layout (Johan Myreen).
-
-XFree86 3.9z (14 December 1997)
-1516. Fix loss of sync while panning problem and attempt to fix the occasional
- crashes of the Millennium II by restricting the MGACountRam function
- to test the first 8MB, only (#1280, Mark Vojkovich).
-1515. Fix XF86Setup to create a (symbolic) link of /usr/X11R6/bin/X when it
- doesn't exist (#1279, Matthieu Herrb).
-1514. Fix solid trap/rect fill bugain the mga server for the Millennium II
- that was hurting performance severely (#1277, Mark Vojkovich).
-1513. Reenable BitBlt accelerations for Millennium II (#1271, Mark Montague).
-1512. Fix mmap memory leak in IGS driver. ARM32/NetBSD specific fix for
- xf86MapInfoMap (#1265, Katrina Maffey).
-1511. Resync change 1474 for PC98 and fix a reference to usleep on SVR4
- (#1264, Takaaki Nomura).
-1510. Add BLK opaque color expansion for 2164 and change the mga code to use
- a lookup table for XFree->mga rop conversions (#1261, Mark Vojkovich).
-1509. Fix XAA hardware cursor support for BT485 ramdacs
- in the S3/SVGA server (#1260, Mark Vojkovich).
-1508. Fix VT switching hang in FreeBSD (#1259, Joerg Wunsch).
-1507. Enable MMIO / linear FB on Cirrus 7548. Experimental patch for screen
- expansion (640x480 on 800x600 LCD) which doesn't seem to work, yet
- (#1258, Achim Oppelt).
-1506. Fix gc validation (#1257,1262 Mark Vojkovich).
-1505. Fix SIGSEGV in xf86setup (Dirk Hohndel).
-1504. Extend XF86Setup to allow selecting the modes and the default color
- depth (Dirk Hohndel).
-1503. Fix build problem on Solaris 2.6/x86 with gcc 2.7.2.3.
-1502. Fix Solaris 2.x + gcc build problem in xfwp (#1272, Takaaki Nomura).
-1501. Xkb{Get,Set}PerClientControls missing from XKBlib.h (#1283,
- Kaleb Keithley).
-1500. BSD 4.4 sockets not handled correctly in xfwp/transport.c (#1276, 1281,
- Kaleb Keithley).
-1499. Local connection doesn't work for lbxproxy on AIX (#1275,
- Arthur Barstow).
-1498. Get fcntl flags in Xtrans before setting them (#1268, Kaleb Keithley).
-1497. Fix 'Xnest -query' on IBM (#1263, Kaleb Keithley).
-1496. Fix X server core dump after disconnecting from a font server
- (#1256, Arthur Barstow).
-1495. Xserver:Security Policy parsing code returns bogus value on suceess
- (#1254, M.S. Ramesh).
-1494. Install app-defaults in /var (#1253, Kaleb Keithley).
-1493. Some xfwp fixes (#1252, Arthur Barstow).
-1492. Fix some Win32 problems (#1251, 1255, Kaleb Keithley).
-1491. DPMS was missing from pandix main.c (#1246, Kaleb Keithley).
-1490. Solaris 2.x LOCALCONN updates (#1269 Kaleb Keithley).
-1489. DPMS updates (#1229, Kaleb Keithley).
-1488. KeyPress event doesn't use XKB state when GrabsUseXKBStateMask is set
- (#1227, Kaleb Keithley).
-1487. Add EVI (Extended Visual Information) server extension (#1225, 1282,
- Kaleb Keithley).
-1486. Fix some Xmb man pages and specs docs (#1220, 1270, Kaleb Keithley).
-1485. Plugin fixes (#1219, 1221, 1224, 1226, 1247, 1273, Kaleb Keithley).
-
-XFree86 3.9y (6 December 1997)
-1484. Fix some initialization problems in the xkb programs (#1233,
- Andreas Schwab).
-1483. Fix loader to resolve symbols properly in Xext (#1250, Robin Cutshaw).
-1482. Fix loader on Solaris and enable it for SVR4 (#1248,1249, Robin Cutshaw).
-1481. Fix some problems with T2R support (#1245, Robin Cutshaw).
-1480. Fix rfhcnt calculation and VT swithcing in mga driver. Allow DirectColor
- on Millennium II cards (#1241,1242,1243,1244, Mark Montague).
-1479. Potential fix for s3/svga cursor support for Ti ramdacs. Remove a
- mistake from the s3/svga acceleration code (#1237, Mark Vojkovich).
-1478. Switch the MGA driver over to XAA Hardware Cursor. Only support for
- TVP3026 is included (#1236,1239, Mark Vojkovich).
-1477. Add delayed syncing abd faster arcs ub 8bpp to mga driver (#1235,
- Mark Vojkovich).
-1476. Fix another SIGSEGV in xterm, where wrong assumptions about the type of
- widget passed to an action handler were made (#1234, Thomas Dickey,
- Arfst Ludwig).
-1475. Fix the wraparound problem with the Mach32 cursor and add another seven
- pixels to the possible width of the cursor (#1232, Bryan Feir).
-1474. Remove vga256/vgainit (#1231, Mark La France).
-1473. Fix a namespace collision in Mach8 server (#1230, Mark La France).
-1472. Fix SIGSEGV when some internal xterm buffers overflowed (#1228,
- Thomas Dickey).
-1471. Fix HiQV version of ImageWrite in the C&T driver (#1222,1223,
- David Bateman).
-1470. Yet another attempt to fix packing order for dashed lines (#1217,
- Mark Vojkovich).
-1469. Build fixes for Xext (#1216,1238 Takaaki Nomura).
-1468. Remove all references to the W32 server (but not the actual server code)
- (#1215, Koen Gadeyne).
-1467. Complete initial support for Permedia 2 and add some acceleration for it
- (Alan Hourihane).
-1466. Some more code for supporting the IBM RGB640 in the glint server
- (Dirk Hohndel).
-
-XFree86 3.9x (23 November 1997)
-1466. Updates for SCO (#1211, 1212, J. Kean Johnston).
-1465. Fix netscape plugin core dump when transfer is interrupted (#1209,
- Kaleb Keithley).
-1464. Registry updates (#1205, Kaleb Keithley).
-1463. Preliminary imake support for different Linux distributions (#1203,
- Kaleb Keithley).
-1462. Enable JIS, SJIS, EUC, etc. on X_LOCALE machines (#1201, Kaleb Keithley).
-1461. Linux and HP imake cf updated (#1200, Kaleb Keithley).
-1460. Updates to XINERAMA (#1198, Kaleb Keithley).
-1459. Make the DPMS extension a more "standard" item (ie, its library code
- is now in libXext) (#1197, Kaleb Keithley).
-1458. xload doesn't need libutil and libkvm on NetBSD and OpenBSD (#1189,
- Scott Reynolds).
-1457. Separate module-specific and non-module-specific Xserver/Xext code
- (#1149, Holger Veit).
-1456. OS/2 updates (don't use WIN32 file handling) (#1149, Holger Veit).
-1455. Clean up XAA calls in glint server (#1210, Alan Hourihane).
-1454. Adapt memory detection in I128 server to T2R (#1208, Robin Cutshaw).
-1453. Add DGA to glint server and get xvidtune to work with it (#1207,
- Alan Hourihane).
-1452. Cleanups and preliminary support for the Trident 3DImage975 and
- 3DImage985 (#1206, Alan Hourihane).
-1451. Add stipple acceleration to the tseng driver (#1192, Koen Gadeyne,
- Mark Vojkovich).
-1450. Add better text acceleration to the tseng driver (#1190, Koen Gadeyne).
-1449. Fix HiQV image writes (#1191, David Bateman).
-1448. Remove the need for the VideoMemSave buffers in glint server (#1196,
- Alan Hourihane).
-1447. Handle bogus base address in vgaPCIInfo for s3/svga (#1194, Mark
- Vojkovich).
-1446. Fix XF86Setup to work with Tcl/Tk 8.0 and improve support for future
- mouse protocols in XF86Setup (#1158,1159, Joe Moss).
-1445. Fix DGASetViewPort problem in S3 server (#1157, Harald Koenig).
-1444. Add -U flag to imake (#1156, Chris Demetriou).
-1443. First cut for I128 Revolution support (#1155, Robin Cutshaw).
-1442. Fix packing order for dashed lines (#1154, 1188, Alan Hourihane, Mark
- Vojkovich).
-1441. Fix joycal.c to work with Linux 2.1.x (#1153, Robin Cutshaw).
-1440. Fix ImageString xtest results. Call miImageGlyphBlt instead of
- cfbImageGlyphBlt8 (#1152, Alan Hourihane).
-1439. Add overlay support for the IBM RGB526 (disabled)(#1151, Mark Vojkovich).
-1438. Fix setting maxclock in s3/svga (#1151, Mark Vojkovich).
-1437. Print module version in plain text (#1150, Holger Veit).
-1436. Correct change 1390 (#1148, Takaaki Nomura).
-
-XFree86 3.9w (16 November 1997)
-1435. Remove some compiler warnings.
-1434. Fix lcPublic state_depend_encoding test in Xlib (#1181, Kaleb Keithley).
-1433. Fix buffer overrun in lib/X11/omGeneric.c (#1180, Kaleb Keithley).
-1432. Add new XINERAMA extension (#1171-1178, Kaleb Keithley).
-1431. Update man pages for X11R6.4 (#1169, 1170, Kaleb Keithley).
-1430. Add new CUP (Colormap Utilization) extension code (#1167,
- Kaleb Keithley).
-1429. Add resource configuration management code to libXt (#1165,
- Arthur Barstow).
-1428. Xkb{Get,Set}PerClientControls not implemented in Xlib (#1164,
- Kaleb Keithley).
-1427. Fix bug in lbxproxy's detection of synonymous server names (#1161,
- Arthur Barstow).
-1426. Various xfwp fixes and cleanups (#1103-1107, 1109, 1110, 1140-1144,
- 1160, 1162, 1163, 1166, 1168, 1179, Arthur Barstow).
-1426. Fix select prototype for HP/UX 10.x (#1102, Kaleb Keithley).
-1425. Fix a 64-bit nit in MakeRootTile (#1080, Kaleb Keithley).
-1424. Export weak symbols in elistgen.sun (#1078, Kaleb Keithley).
-1423. Put back the reference to the xfree68 directory in
- xkbcomp/symbols/Imakefile.
-1422. Add xkb support for some older HP keyboards (#1077, Kaleb Keithley).
-1421. Fix some typos in the iso8859-1 compose file (#1076,
- Niels Kristian Bech Jensen).
-1420. Xlib UTF support uses longs, but should use wchar_t (#1068,
- Kaleb Keithley).
-1419. HP/UX 10 config update (#1066, 1079, Kaleb Keithley).
-1418. Update lbxproxy to use the Xtrans library (#1060, Arthur Barstow).
-1417. Deal with gratuitous Xserver colormap flashing (#1059, Kaleb Keithley).
-1416. LBX-related updates to the Xserver (#1049, Kaleb Keithley).
-1415. Remove Xibm server from the source (#1048, Kaleb Keithley).
-1414. Remove xmh from the core tree (#1043, Kaleb Keithley). Note, only
- the entry for it in xc/programs/Imakefile is removed here so far, and
- we may want to move it into our supported contrib.
-1413. Update sgi.cf (#1042, Kaleb Keithley).
-1412. Fix inconsistency with the naming of general man pages and the sections
- they are installed in (#1040, Kaleb Keithley).
-1411. Fix xrx plug-in build problem on Solaris 2.6 (#1039, Kaleb Keithley).
-1410. Fix Xserver crash when using lbxproxy and xdm-auth-1 (#1038,
- Kaleb Keithley).
-1409. Fix an infinite loop in CreateVisual() in lbxproxy (#1034,
- Arthur Barstow).
-1408. locale.alias updates (#1032, Kaleb Keithley).
-1407. Misc very minor TOG updates (#1031, Kaleb Keithley).
-1406. Fix for MaxClients not being defined correctly in the Xserver
- (#1030, Sekhar Makkapati).
-1405. Fix an Xserver problem related to FreeCursor() in
- DisposeWindowOptional() (#1026, Kaleb Keithley).
-1404. Add setusercontext support to xdm for FreeBSD (#1025, Kaleb Keithley).
-1403. Use named pipes for local connections with Solaris 2.x (#1011, 1067
- Kaleb Keithley).
-1402. Fix lost support for non-standard encodings in Xlib (#1005,
- Kaleb Keithley).
-1401. Fix Xserver crash when colormap of copyfromparent given (#990,
- Sekhar Makkapati).
-1400. Make lbxproxy try another port when bind fails (#988, Arthur Barstow).
-1399. Remove the Xserver '-config' flag for OSs that don't have tight command
- line length restrictions (#987, Kaleb Keithley).
-1398. Remove some vararg cruft from the Appgroup library (#986,
- Kaleb Keithley).
-1397. Fix SecurityLookupIDByClass in Xserver (#1186, Sekhar Makkapati).
-1396. Fix for sample site.def (#1184, Sekhar Makkapati).
-1395. Fix references to LINE_MAX in Xos_r.h (#1182, Sekhar Makkapati).
-
-XFree86 3.9v (9 November 1997)
-1394. Add unrolled text code for the 9 pixel width fonts (#1147,
- Mark Vojkovich).
-1393. Fix planemask/transparency problems in tseng driver (#1146,
- Harald Nordgard Hansen).
-1392. Add Fire GL 3000 option for glint server (#1139, Bart van den Broek).
-1391. Remove unnecessary ARM32 code (#1138, Katrina Maffey).
-1390. Fix a crash in XCopyPlane after server reset (#1137, Katrina Maffey).
-1389. Add support for PS/2 Intellimouse (#1136, Tim Goodwin).
-1388. Add a PolyArc replacement for s3/svga in 8bpp when using a linear
- framebuffer. Add a stippled rect speedup for destinations less than 32
- pixels wide (#1135, Mark Vojkovich).
-1387. Add read speed benchmark and support for >8bpp modes to dga test
- program (#1134, Koen Gadeyne).
-1386. Fix dashed lines for vga256 (#1133, Alan Hourihane).
-1385. Enable trapezoid fill on mga (#1132, Radek Kapitan).
-1384. Fix ImageWriteFlags in trident driver (#1131, Alan Hourihane).
-1383. Fix wide line problem in the static server (#1129, Brian Wainscott).
-1382. Fix syncing problems with the scanline routines in XAA (#1128,
- Alan Hourihane).
-1381. Restructure glint server to call the AccelInit function in a sane
- manner (#1127, Alan Hourihane).
-1380. Add planemask support for the tridents and add hardware clipping for
- the Cyber chipsets. Add Cyber 9397 detection (#1126,1130, Alan Hourihane).
-1379. Fix a typo in vgaPCI.h (#1125, Alan Hourihane).
-1378. Fix a problem with setting the maximum clock value on s3 cards at depths
- other than 8bpp (#1123, Steve Forsythe).
-1377. Fix dashed lines for matrox driver (#1122, Radek Kapitan).
-1376. Use correct arguments to xf86ImageWrite when uploading cursor image to
- videoram. Units of pixels instead of bytes (#1120, Mark Vojkovich).
-1375. Fix s3/svga cursor location computation error (#1119, Mark Vojkovich).
-1374. Improve GC validation code in XAA (#1117,1118,1121, Mark Vojkovich,
- David Bateman).
-1373. Add accelerated color expansion for all color depths and for all
- W32-style chips (#1116, Koen Gadeyne).
-1372. Add Warpnext/Warpprev to twm (#1114, Benjamin Gras).
-1371. One more fix to restore changes to variable types made in change 1347.
- This should fix MouseSystem mice (#1111,1124,1145, Steve Forsythe,
- Andrew Aitchison).
-1370. Add missing pm_accel.c.
-1369. Add ImageWrite support to glint server (Alan Hourihane).
-
-XFree86 3.9u (1 November 1997)
-1368. Add support for I128 Revolution to scanpci and SuperProbe (#1108,
- Robin Cutshaw).
-1367. Compile fixes for ARM32/NetBSD (#1099, Katrina Maffey).
-1366. Change mga to use bresenham lines instead of two point (#1098,
- Radek Kapitan).
-1365. Add mga stipple code so that it is 256K pixels barrier sensible and
- even faster than current XAA stipple code (#1097, Mark Vojkovich,
- Radek Kapitan).
-1364. Move C&T hw cursor into XAA. Re-enable ImageWrite on C&T. Rewrite 32bpp
- HiQV code (should be almost usable) (#1096, David Bateman).
-1363. Get the ch8398 work in tseng driver at every color depth and any hibit
- setting (#1095, George Krajcsovits).
-1362. Changes to XAA hw cursor code to better support switching between hw
- and sw cursor (#1094, David Bateman).
-1361. Fix incorrect parenthesis placement caused by hand-applying part of
- change 1347 (#1092, Mark Vojkovich).
-1360. Resync PC98 Imakefiles (#1091, Takaaki Nomura).
-1359. Build fix for PANIX (#1090, Takaaki Nomura).
-1358. Fix a duplicate inclusion of <sys/termio.h> on ISC inside xterm/screen.c
- and update the help text for xterm to correspond with the appropriate
- commandline switches (#1089, Michael Rohleder).
-1357. Fix some incorrect type modifications in change 1347 (#1087,1088
- Alan Hourihane, Michael Rohleder).
-1356. Fix mga_xaarepl.c to compile with non-GNU cc (#1086, Robin Cutshaw).
-1355. Clean up vgaPCI.h for Trident (#1085, Alan Hourihane).
-1354. Fix a bug introduced in change 1222 (#1084, Koen Gadeyne).
-1353. Remove amiga/ataritt files from xkbcomp/symbols Imakefile (they have
- been moved to a subdir in change 1338) (#1083, Takaaki Nomura).
-1352. Update VideoBoard98 (#1081, Takaaki Nomura).
-1351. Add DO_NOT_BLIT_STIPPLES to the xf86AccelInfoRec.Flags (#1070,
- Marc Vojkovich).
-1350. More work for Permedia 2 support. Still doesn't work (Dirk Hohndel).
-1349. Split acceleration drivers for GLINT and Permedia. Get glint server
- to work (again) on Fire GL 1000 (Helmut Fahrion).
-1348. Get glint server to work on Fire GL 3000 (Bart van den Broek).
-
-XFree86 3.9t (26 October 1997)
-1347. Add support for ARM32 architecture and IGS CyberPro 2010 support
- (#1052, Digital Equipment Corporation).
-1346. Multi-display support for lbxproxy (#969-971, 977, 978, Arthur Barstow).
-1345. Remove some misleading 32-bit comments in Xlib (#967, Kaleb Keithley).
-1344. Additional symbols for Japanese 109 key keyboard (#962, Kaleb Keithley).
-1343. Faster bit counting algorithm for Xlib/Xt modifier code (#958,
- Kaleb Keithley).
-1342. XKB updates for hp ddx (#955, 956, Kaleb Keithley).
-1341. Fix Xaw Text Widget call to XtMalloc(0) (#954, Kaleb Keithley).
-1340. Updates to xrx plugins (#953, 957, 959-961, 963, Kaleb Keithley).
-1339. Use dump instead of nm in elistgen.sun (#922, Kaleb Keithley).
-1338. xkb updates (#920, Kaleb Keithley).
-1337. Fix imake's SPARCcompiler CCompilerMajorVersion detection (#919,
- Kaleb Keithley).
-1336. Updates related to xkbcomp install (#918, Kaleb Keithley).
-1335. General MS-Win lib fixes (#917, Kaleb Keithley).
-1334. xterm support for -lcurses on HPUX 10.2 (#914, 916, 952, Kaleb Keithley).
-1333. Fix incorrect mode name in xf86config.c.
-1332. Fix text restore problem on some Avance Logic cards (#1072, Thomas
- Dreibholz).
-1331. WriteBitmap code for MGA driver (#1069, Mark Vojkovich, Radek Kapitan).
-1330. Add a clean rule to remove XKB's .dir files. Add support for newer 3D
- Rage III adapters to SuperProbe, the Mach64 server and the ATI driver.
- Fix misuse of DirtyStartup define. Fix Mach64 mode restoration problems
- in ATI driver. Fix 8MB linear aperture problem in ATI driver. Fix
- typo's in drivers/s3* Imakefiles. Fix banking globals when a linear
- aperture is used. Retrofit 3.3.1 vgaPCI code into 3.9s. (#1065,
- Marc La France).
-1329. Add support for the Microsoft Intellimouse in the XFree86-Misc
- Extension and XF86Setup (#1063,1064, Takaaki Nomura, Joe Moss).
-1328. Add Scanline ImageWrite support to XAA (#1062, Alan Hourihane).
-1327. Missing Millennium II AGP fixes (#1058, Brian Wainscott).
-1326. XAA hw cursor fix. Delay cursor restoration until after the saved screen
- is restored (#1057, Mark Vojkovich).
-1325. Fix server to print the clock scale instead of effective clocks when
- using a clockchip (#1056, Krajcsovits Gyorgy).
-1324. Correct eraser/stylus detection in wacom driver (#1055, Frederic Lepied).
-1323. Fixes for APM driver. HW lines/HW clipping. ROP support. Text accel now
- uses PAD_DWORD. Bugfix for WaitForFifo() (lost serial interrupts) and
- ApmSync() (various errors). HW cursor now uses XAA interface. Combined
- write for many registers (x+y in one longword etc.) (#1054, Henrik
- Harmsen).
-1322. xterm fixes. Correct a minor placement problem with the right scrollbar.
- Implement a new set of control sequences for switching between the
- normal and alternate VT100 screens. Implement the alternate-screen menu
- entry (#1053, Thomas Dickey).
-1321. Add some reasonable limit for when a trapezoid fill is used rather than
- using spans (#1051, Mark Vojkovich).
-1320. Add bindist description files for an OpenBSD/sparc binary distribution
- (#1045, Todd Fries).
-1319. Some fixes and additions to the PCI databases (#1046,1050, Dejan Ilic).
-1318. Add 543x cirrus driver for PowerPC, fix some LynxOS related problems
- (#1044, Thomas Mueller).
-1317. Add support for ViRGE/GX2 to SuperProbe (Dirk Hohndel).
-1316. Add support for ViRGE/GX2 to SVGA and S3V server (#1041, Harald Koenig).
-
-XFree86 3.9s (15 October 1997)
-1315. Fix segmentation fault in glint driver when server is started with a
- card without GLINT/PERMEDIA chip (Stefan Dirsch).
-1314. Lots of fixes and additions to glint acceleration (Helmut Fahrion).
-1313. Fix problem with xterm hanging when opening a log file. Add
- right-scrollbar to xterm (#1037, Thomas Dickey, Michael Rohleder).
-1312. Add GD7555 to vgaPCI.h and fix XF98_SVGA (#1036, Shuichi Ueno).
-1311. Fix a bug with Qword pad support in ImageWrite (#1033, Mark Vojkovich).
-1310. Fix mystique driver and build problem on SVR4.0 (#1029, Takaaki Nomura,
- Isao Ohishi).
-1309. Fix SuperProbe to correctly detect memory on the Trident 9685 (#1023,
- Alan Hourihane).
-1308. Add hardware clipping and transparency for the trident chips that
- support it. Partially implement the 'set_mclk' option, not yet
- complete, remove the tgui_mclk_66 option, clean up the TV output for
- 9685 boards. Documentation updates (#1022, Alan Hourihane).
-1307. Add accelerated ImageWrite and a WriteBitmap replacement to the tseng
- driver (#1021, Mark Vojkovich, Koen Gadeyne).
-1306. Documentation update for tseng driver (#1020, Koen Gadeyne).
-1305. Clear disallowed flags in Options bitmap (#1019, Alan Hourihane).
-1304. Fix XAA hardware cursor for built-in S3 RAMDACs (#1018, Alan Hourihane).
-1303. Use trapezoid fills for some wide lines (#1017, Mark Vojkovich).
-1302. Fix colormap switching problem in svga/s3 (#1016, Mark Vojkovich).
-1301. Fix install problem with xkbcomp (#1014, Robin Cutshaw).
-1300. Fix lnx_jstk.c to work with 2.1.x joystick.h file (#1013, Robin Cutshaw).
-1299. Disable some HTotals in matrox driver that cause vertical stripes (#1010,
- 1015, Radek Kapitan).
-1298. Improve some bailout messages in tseng driver (#1009, Koen Gadeyne).
-1297. Suppress popen/pclose messages (#1008, Takaaki Nomura).
-1296. Initial support for Millennium II AGP (Dirk Hohndel).
-1295. Fixes to make glint server pass more of xtest (Alan Hourihane).
-
-XFree86 3.9r (30 September 1997)
-1294. Bug fixes to xterm. Change default resource of colorMode to true. Fix
- 'ech' control. Add resource boldColors and +pc / -pc. Add resource
- colorAttrMode. Fix conflict between colorULMode/colorBDMode versus ANSI
- colors. Correct two problems with the optional logging support. Various
- updates to configure-script macros (#1004, Thomas Dickey).
-1293. Make sure ImageWriteBase gets set with a default value (#1003,
- Alan Hourihane).
-1292. Replace mktemp() with mkstemp() in xrdb (#1002, Luke Mewburn).
-1291. Don't fail to start if there isn't enough memory for the hw cursor in
- tseng driver (#1001, Koen Gadeyne).
-1290. Fix the install problem with XF98_SVGA (#1000, Takaaki Nomura).
-1289. Add bresenham lines to tseng driver (#997, Koen Gadeyne).
-1288. Significantly accelerate clipped terminal font performance (#996,998,999,
- Andrew van der Stock, David Bateman).
-1287. Enable 24bpp for Trident TGUI 96xx (#995, Alan Hourihane).
-1286. Add support for the Trident ClearTV (#994, Alan Hourihane).
-1285. Remove INT64 from XAA text code (#993, Mark Vojkovich).
-1284. XAA hw cursor support for s3/svga. IBM cursor works, other RAMDAC
- cursors need to be implemented/verified. S3 builtin curser seems
- to work in 8bpp, but fails in other depths (#992, Mark Vojkovich).
-1283. Some fixes for Unixware 2.1.2 (#989, Steve Forsythe).
-1282. Fix the remaining line drawing problems for the CL-GD5428 and CL-GD754x
- chips (#985, Corin Anderson).
-1281. Fix build problem (982, Takaaki Nomura).
-1280. Add more acceleration for Permedia (this is partly producing drawing
- errors and needs much more testing) and remove Trapezoid bug in 500TX
- support of glint server (Helmut Fahrion).
-1279. Build fixes for XAA hw cursor and updates to glint XAA hw cursor (#983,
- 984, Alan Hourihane).
-1278. Better color depth support and cleanups for glint server (Helmut Fahrion).
-1277. Add initial support for Permedia 2 chip to glint server (Dirk Hohndel).
-1276. Add support for GLINT MX chip to glint server (Dirk Hohndel).
-1275. Add RIVA 128 to scanpci (Dirk Hohndel).
-
-XFree86 3.9q (19 September 1997)
-1274. Add XF98_SVGA server, update XF98Conf.cpp, VideoBoard98, fix mga driver
- for PC98 (#980,981, Michio "Karl" Jinbo, Shuichirou Urata).
-1273. Some fixes to glint server (Helmut Fahrion, Stefan Dirsch, Dirk Hohndel).
-1272. Fix for glint_dump_regs and disable accelerated lines for glint
- (Stefan Dirsch).
-1271. Add XAA hw cursor support and update trident and glint drivers to use it
- (#973-976,979, Alan Hourihane).
-1270. Several fixes to xterm: fix redraw errors after font changes or resizes,
- add sunKeyboard resource, correct fg/bg test in the control sequence
- that replies with the current SGR settings ((#972, Thomas Dickey).
-1269. Several fixes to the xterm standalone configure script (#972,
- Thomas Dickey).
-1268. Fix to pointer movement constraints (#968, Stuart Anderson).
-
-XFree86 3.9p (15 September 1997)
-1267. Disable Image Write for HiQV chips in C&T driver (#966, David Bateman).
-1266. Add stipple accelerated functions through the ScanlineScreenToScreen
- function (#965, Alan Hourihane).
-1255. Add ImageWrite support for the Laguna chips in cirrus driver (#964,
- Corin Anderson).
-1254. Disable the Xserver '-config' option when run set-uid.
-1253. Have the Xservers run xkbcomp under the real user's ID.
-1252. Fix xterm's default handling of the KP_Add key.
-1251. Fix Linux-axp xdm build problem.
-1250. Fix stripping of extension from module names (so that it works OK
- when there is a '.' in the module directory pathname).
-1249. Fix some problems in the trident driver with the 9685 programmable clock
- and disable the GE when too little memory is available (#950,
- Alan Hourihane).
-1248. Fix build problem with non gcc compilers (#948,949, Takaaki Nomura,
- David Bateman).
-1247. Fix some dangling references and max MClk value in matrox driver (#951,
- Dirk Hohndel).
-1246. Disable debugging messages in DirectColor support (Andrew Aitchison).
-1245. Fix saving video memory for glint server (Helmut Fahrion).
-
-XFree86 3.9o (9 September 1997)
-1244. Yet another fix for the problems around installing xkbcomp
- (Michael Rohleder, David Dawes, Dirk Hohndel).
-1243. Add more acceleration for 500TX to glint server (Alan Hourihane).
-1242. Add initial acceleration for Permedia to glint server (Dirk Hohndel).
-1241. Lots of cleanups and fixes to glint server (Stefan Dirsch, Helmut
- Fahrion, Dirk Hohndel).
-1240. Fix glint server problems on some ASUS motherboards (Stefan Dirsch).
-1239. Add Permedia support to glint server (Helmut Fahrion, Dirk Hohndel).
-1238. Several m68k related fixes (faster pic code, change Atari TT geometry),
- fixes to not reference the undefined variable XPROJECTROOT, some glibc
- updates (#947, Andreas Schwab).
-1237. Move some of the improvements that Mark Vojkovich made for the S3 stipple
- code back into XAA (#945, David Bateman).
-1236. Fix problem with HW cursor disappearing on Cirrus Laguna chips (#943,
- Corin Anderson).
-1235. Fix 24bpp XAA NonTE image text with RGB_EQUAL (#942, David Bateman).
-1234. Fix BIOS layout issues in matrox drivers. This might make Millennium
- Rev 3 cards work (#941, Andrew van der Stock).
-1233. Improve the performance of the 24bpp fills on the 6554x machines and
- hopefully implements a solid fill at 32bpp for the 6555x machines
- (untested). Some cosmetic changes (#940,944, David Bateman).
-1232. Turn off CPU_TRANSFER_BASE_FIXED in SVGA/S3 driver (#939, Mark Vojkovich).
-1231. Add the correct Enable/DisableIO Ports back into the glint driver (#938,
- Alan Hourihane).
-1230. Fix trident & mga driver for PC98. Fix XF98Conf.cpp. Resync PC98
- Imakefiles (#935, Takaaki Nomura).
-1229. Add accelerated Image Write to C&T driver. Attempted fix for the use
- of TMED DSTN dithering on the 65555 and 68554 chips. Small
- documentation patch (#934, David Bateman).
-1228. Fix XF86Setup to load XFree86-VidModeExtension (#932, Takaaki Nomura).
-1227. Fix MClk limits for matrox driver (#931, Andrew van der Stock).
-1226. Fix build problem on Solaris (#929, Matthieu Herrb).
-1225. Add DacSpeed to C&T driver (#930, David Bateman).
-1224. Disable acceleration for IMA bus chips in tseng driver (#928,
- David Bateman)
-1223. Turn Record extension into module and fix problems in XInput joystick
- module (#927,933, Matthieu Herrb).
-1222. Add support for the ch8398 and ch8398a clockchips to the tseng driver
- (#913,914 Gyorgy Krajcsovits).
-
-XFree86 3.9n (26 August 1997)
-1221. Lots of small fixes for xterm (#912, Thomas Dickey).
-1220. Add DirectColor visual to Matrox server (#911, Andrew Aitchison).
-1219. Disable 8x8 pattern tiling on W32 (not W32i/p) cards. Fix lowend W32p
- cards with IMA bus. Modify linear memory code (#910, Koen Gadeyne).
-1218. Fix locale in R6.3, Fix PC98 XKB, Remove xf86ClearIOPortList() and
- xf86AddIOPorts() from PEGC driver (#908, Takaaki Nomura, Isao Ohishi).
-1217. Remove xf86ClearIOPortList() and xf86AddIOPorts() (#907,909
- Matthieu Herrb).
-1216. Add ET6100 support to tseng driver (#906, Koen Gadeyne).
-1215. Add wide lines to XAA (#904, Mark Vojkovich).
-1214. Add Chrontel8391CalcClock function (#903, Gyorgy Krajcsovits).
-1213. Fix output of hex numbers in chip revision (#902, Dejan Ilic).
-1212. Add accelerated Bresenham lines to tseng driver at 8bpp (#901,
- Koen Gadeyne).
-1211. Xlib: XIMStringConversionRetrival should be XIMStringConversionRetrieval
- (#905, Kaleb Keithley).
-1210. Official fix for potential buffer overflow in XGetErrorDatabaseText
- (#900, Kaleb Keithley).
-1209. Fix typo in cde.rules (#899, Kaleb Keithley).
-1208. SGI threads patch update (#898, Kaleb Keithley).
-1207. Fix UNSHARED_CXXLIB for SPARCcompiler4.0 (#897, Kaleb Keithley).
-1206. Fix SPARCcompiler CCompilerMajorVersion (#896, Kaleb Keithley).
-1205. Parse junk from export lists better (#895, Kaleb Keithley).
-1204. Removes some dead or unused code in os-support (#893, Matthieu Herrb).
-1203. Remove xf86tmpnam() from libc_wrapper and rewrites xf86tmpfile() to
- use tmpfile() (#892, Matthieu Herrb).
-1202. Add a separate README.OpenBSD for 3.9 (#890, Matthieu Herrb).
-1201. Move most common extensions into a module (#889, Matthieu Herrb).
-1200. OpenBSD multi-architecture support (#888, Matthieu Herrb).
-1199. Disable disables broken software/hardware cursor switching in s3/svga
- (#887, Mark Vojkovich).
-1198. Some fixes for PC98. XF86Setup, mga driver, VideoBoards98, Cards98
- (#886, Takaaki Nomura, Takefumi Tsukada).
-1197. Acceleration fixes for Trident and accelerated ImageWrite (#883,884,885
- Alan Hourihane).
-1196. Bring the 3.3.1 Trident fixes into 3.9 (#882, Alan Hourihane).
-1195. Add incomplete Rendition detection code to SuperProbe (Dirk Hohndel).
-1194. Add Rendition detection to PCI code (#881, Marc Langenbach, Dirk Hohndel).
-1193. Fix to only build *.dir file for xkbcomp on make install (#880,
- Michael Rohleder).
-1192. Add ImageWrites for s3/svga (#879, Mark Vojkovich).
-1191. Rename dashed pattern flags (#878, Mark Vojkovich).
-1190. Add ImageWrite support for XAA (#877, Mark Vojkovich).
-1189. Add MGA2164 define to vgaPCI.h (#876, Takaaki Nomura).
-1188. Extend the frame buffer test in glint_dump_regs (Stefan Dirsch).
-
-XFree86 3.9m (13 August 1997)
-1187. Add printing support to xterm (#870, Thomas E. Dickey).
-1186. Fix denial of service attack through xdm double freeing memory (#875,
- Kaleb Keithley).
-1185. Fix Solaris build problem (#874, Takaaki Nomura).
-1184. Preliminary experimental support for the Millennium II (#852-857,
- Andrew Vanderstock).
-1183. Recognise the rev 3 Mystique, and hopefully set everything up
- correctly for it, change MMIO/fb mapping for Mystique rev >=3.
- (David Dawes)
-1182. Patches to both XAA and the Glint sources that enable the
- ScanlineScreenToScreen colour expansion (#873, Alan Hourihane).
-1181. Fix problem of xkbcomp not generating .dir files during install
- (#872, Kaleb Keithley).
-1180. Fix problem with possible denial of service attack using the X server
- (#867, Kaleb Keithley).
-1179. Update VidModes.sgml to latest version (#871, Eric Raymond).
-1178. Fix I128 support for AXP (#868, Robin Cutshaw).
-1177. Add planemask support to most XAA functions for all tseng chips
- (#869, Koen Gadeyne).
-1176. Fix text rendering for W32 at 16bpp, always determine bus type, fix
- bug in XAA color expansion (#865, Koen Gadeyne).
-1175. Fix ET6000 dram speed code, disable 32bpp on ics5301 ramdacs (#864,
- Koen Gadeyne).
-1174. Clean up RAMDAC handling in tseng driver, extend stg1702 support, and
- fix problems caused by treating unknown RAMDACs as AT&T compatible
- (#862, Koen Gadeyne).
-1173. Fix support for linear memory mode on W32p rev a&b (#861, Koen Gadeyne).
-1172. Fix ET6000 black screen problem (#861, Koen Gadeyne).
-1171. Changes to Amiga XKB code (#860, Bernd Ernesti).
-
-XFree86 3.9l (31 July 1997)
-1170. Fix parsing of DPMS parameters in config file.
-1169. Catch a NULL dereference in lib/X11/lcFile.c (#843, Dirk Hohndel).
-1168. Xterm support for compound text cut and paste (#836, Kaleb Keithley).
-1166. Fix some I128 problems reported with PPro CPUs (#834, Robin Cutshaw).
-1165. Disable C&T fill at 32bpp (#831, David Bateman).
-1164. Update VideoBoard98 file (#830, 842 Takaaki Nomura, Isao Ohishi).
-1163. Prevent re-allocation of cfb ScreenPrivateIndex for multi-head
- server (#829, Stuart Anderson).
-1162. Fix unintended changes in PCI code.
-1161. Fix handling of PS/2 protocol mice with OpenBSD (it doesn't translate
- to BusMouse protocol like NetBSD does) (#820, Matthieu Herrb).
-
-XFree86 3.9k (29 July 1997)
-1160. Several fixes to xterm. Correct an indexing error in the doublesize
- character logic. Correct the logic of ShowCursor when it is painting in
- a doublesize cell. Correct the behavior when switching to doublesize
- characters and back again. Add cbt (back_tab) to the terminfo
- description. Correct the logic for disabling xmc. Minor correction to
- positioning of underlines for small (e.g., 5x8 font size. Add more
- special-case tokens to the standalone configure script's imake-option
- filter. Add a '--enable-logging' option for the standalone configure
- script. Add check and ifdef's for the standalone configure script to
- allow for building on platforms with X11R6, which lacks Xpoll.h
- (#769,821, Thomas Dickey).
-1159. Preliminary support for Millennium on PC98 (#825, Shuichiro Urata,
- Takaaki Nomura).
-1158. update XKB for PC98 (#825, Isao Ohishi).
-1157. Support XF86Setup for PC98 (#825, Takaaki Nomura, Kazunori Ueno).
-1156. PC98 resync (#825, Michio "Karl" Jinbo).
-1155. Add common Imakefiles for some PC98 sub directories (#825,
- Michio "Karl" Jinbo).
-1154. Add code to fine tune memory access on ET6000 boards and cleanup some
- W32 specific code that would write to illegal registers on ET6000 cards
- (#818, Harald Nordgard Hansen).
-1153. Ensure accelerator CRTC registers are unlocked before writing them and
- horizontal & vertical syncs are not disabled on mode switches (#817,
- Marc La France).
-1152. Change xsetroot -mod option to count pixels from left to right within
- each 16-pixel slice, instead of right to left (#817, Marc La France).
-1151. Cleanup declarations for xf86Verbose, xf86ProbeOnly & xf86ProbeFailed,
- make VGABase XF86Config option recognized by more servers, HSkew wasn't
- being dealt with correctly in matching modes to clocks, fixup default
- mode for the generic VGA driver (#817, Marc La France).
-1150. Fix a few bugs in ATI driver, break it up in multiple files, add
- support for Mach64 accelerator CTRC, which now is used by default, and
- generic VGA (untested) (#817, Marc La France).
-1149. Fix build problem on Solaris (#810, Dirk Hohndel).
-1148. Re-enable LEFT_EDGE_CLIPPING_NEGATIVE for the HiQV chips and tidy up the
- ScreenToScreenColorExpand stuff (#808, David Bateman).
-1147. Enable the sw_cursor option and add support for the no_accel option (#806,
- Joe Moss).
-1146. Avoid source overruns in xf86DrawStippleScanline() and remove the
- restrictions on TRIPLE_BITS_24BPP, LEFT_EDGE_CLIPPING
- and LEFT_EDGE_CLIPPING_NEGATIVE_X (#805, David Bateman).
-1145. Allow keywords with underscores in XF86Setup (#802, Harald Koenig).
-1144. Explicitly enable hsync and vsync on Mach64 boards (#799, Marc La France).
-1143. Small fix for norwegian keyboard in xkb (#797, Harald Nordgard Hansen).
-1142. Add 32bpp to HiQV driver and get CopyArea and Solid Fills accelerated
- in 32bpp (#790,796, David Bateman).
-1141. Fix clock calculation on HiQV chips (#783, David Bateman).
-1140. Fix hardware clipping and get closer to a working 8x8pattern color expand
- (#781,811, Alan Hourihane).
-1139. Disable C&T HiQV ImageWrite (#780, David Bateman).
-1138. Change how patterns are packed for LINE_PATTERN_MSBFIRST_INCREASING
- (#779, Mark Vojkovich).
-1137. SVGA/S3 acceleration improvements (#778, Mark Vojkovich).
-1136. Fix xclock problem that shows up on Cirrus 542x chips
- (#777, Corin Anderson).
-1135. Small fix for C&T driver (#775,776 David Bateman).
-1134. Merge missing ViRGE code from 3.3* into 3.9* (#773, Harald Koenig).
-1133. Support for I128 DRAM cards (#816, Robin Cutshaw).
-1132. PCI updates required for the I128 server (#815, Robin Cutshaw).
-1131. Fix for Xt/Error.c (#813, Kaleb Keithley).
-1130. Make XF86Setup's keyword matching the same as the Xservers (ie,
- ignore '_', ' ', '\t' in keywords).
-1129. Tseng documentation update (#800, 803, Koen Gadeyne).
-1128. Update to imake's auto GCC PostIncDir detection for OpenBSD
- (#794, Matthieu Herrb).
-1127. Fix I128 problems (#792, 809, Robin Cutshaw).
-1126. Fix some errors in the symbols/th XKB file (Poonlap Veeratanabutr).
-1125. Don't use EXTRA_DEFINES in Xserver/xkb/Imakefile (#786, Kaleb Keithley).
-1124. Alternate way of fixing the "./" problem in Imake.rules
- (#785, Kaleb Keithley).
-1123. Install full path in dynamic libraries for SCO (#782, J. Kean Johnston).
-1122. Fix remaining problems with SCO OpenServer 5 support (#772,
- J. Kean Johnston).
-1121. Fix support for older I128 cards (#771, Robin Cutshaw).
-1120. Add detection for C&T 68554, and fix detection of the 65550 revision
- numbers (#770, David Bateman).
-1119. Fix STG170x support in tseng driver (#766, Koen Gadeyne).
-1118. Fix linkkit install problem in apm driver (#767, Holger Veit).
-1117. Add more resolutions to xf86config (#767, Holger Veit).
-1116. Add OS/2 diagnostic on network config (#767, Holger Veit).
-1115. Fix EditRes problems that show up on OS/2 (#767, Holger Veit).
-1114. Fix a problem in OS/2's imakesvc.cmd (#767, Holger Veit).
-1113. Fix lockup when the SVGA server dumps core with the MGA driver
- on some OSs.
-1112. Fix a bug in cfb24GetSpans which can cause a server crash
- (StarOffice will provoke this).
-1111. Fix the use of a C++ reserved word in xf86vmode.h.
-1110. Reset the DPMS state to ON when re-entering the server's VT.
-
-XFree86 3.9j (12 July 1997)
-1109. Process Xqueue events synchronously to avoid problems with
- accelerated servers.
-1108. Fix sqrt problems in miarc (#765, Harald Koenig).
-1107. Remove special Tk 4.0 support in XF86Setup and add C code to match the
- latest vidmode extension changes. Fix a minor bug in the DPMS code
- (#764, Joe Moss).
-1106. Several small fixes to Xserver/{dix,include,os/,PEX5} (#760-763,
- Craig Groeschel).
-1105. XKB fixes (#759, Stuart Anderson).
-1104. Fix uninitialized variable (verbose) in scanpci.c (#757, Thomas Mueller).
-1103. Add big endian version of PCI config structure (#757, Thomas Mueller).
-1102. Add cross compile definitions for LynxOS and add static vga server for
- LynxOS PowerPC (#757, Thomas Mueller).
-1101. Add bindist files for LynxOS (#756, Thomas Mueller).
-1100.
-1099. Add handling for AST onboard Mach32 card (#754, Bryan Feir).
-1098. Fix a problem in Imake.rules that shows up when using Motif.rules.
-1097. Fix MGA lockup on SVR4.0.
-1096. Add missing for Japanese "small TSU" character to the XKB
- symbols/jp file (#751, Shigehiko Sasaki).
-1095. Fix ET4000/W32i acceleration at 16 and 24bpp, and accelerate colour
- expansion at 16bpp and 24bpp for the W32p (#747, Koen Gadeyne).
-1094. Fix for I128 rev 2 chips (#746, Robin Cutshaw).
-1093. Fix typo in xf86_libc.h.
-
-XFree86 3.9i (6 July 1997)
-1092. Fix apm HW cursor problem at VT switch, and a problem with
- screen-to-screen bitblts (#745, Henrik Harmsen).
-1091. VidMode extensions updates, including adding a new function to
- return the available clocks, and how many more clocks can be programmed,
- add the HSkew parameter and some reserved fields (this introduces
- a protocol incompatibility), and fix a bug in the ValidateModeLine
- function's clock checking (#744, Joe Moss).
-1090. Add port probing to SuperProbe for the Alliance 6410, 6422 and AT24
- (#743, Joe Moss).
-1089. Add similar ET6300 detection to scanpci and vgaPCI.h.
-1088. Fix SuperProbe's ET6000 memory probe (#742, Koen Gadeyne).
-1087. Add detection for the ET6100 and ET6300 to SuperProbe (#742,
- Koen Gadeyne).
-1086. Some PCI video cards don't have the expected "IBM" string in the
- BIOS, so look for the "PCI" string too. Without this, scanning with
- -nopci fails for some cards (#741, Koen Gadeyne).
-1085. Possible fix for XWarpCursor() not working with the XInput
- xf86PostMotionEvent() function (#740, Michael Rohleder).
-1084. Add some "test-support" code to xterm, which is not enabled by
- default (#739, Thomas E. Dickey).
-1083. Fix ET4000W32p RAMDAC detection (backs out most of #717), make
- the tseng driver use DELAYED_SYNC, and an (unsuccessful) attempt
- to get CPU-to-screen colour expansion working (#737, Koen Gadeyne).
-1082. Add missing valuator initialisation to the OS/2, SCO and Xqueue
- MouseProc() functions. This fixes the mouse problems on those OSs
- (#736, 738, Holger Veit and Richard Coley).
-1081. Fix a misplaced va_end() in the recent XInput code which caused a core
- dump on OS/2 (#736, Holger Veit).
-1080. Fix SummaSketch bug that shows up with newer XInput code, add
- a missing conversion_proc, fix misplaced break, and add new config
- options to the SummaSketch subsection for ActiveArea and ActiveOffset
- (#735, Steven Lang).
-1079. Fix a problem with xterm's cursor colour versus the background, and
- remove a duplicate initialisation of the cursor's GC (#734,
- Thomas E. Dickey).
-1078. Fix XAA's bpp setting at 24bpp (#733, Mark Vojkovich).
-1077. Fix cpp script problem on AIX (#732, Kaleb Keithley).
-1076. Fix xhost core dump that can happen if no hosts are authorised
- (#731, Kaleb Keithley).
-1075. Glint driver updates (#729, 730, Alan Hourihane).
-1074. Move the solx86usleep() function out of solx86_init.c into a separate
- file, which should fix the problems addressed by #726.
-1073. Add ANSI-C wrappers (#724, Holger Veit).
-1072. Update recent config and libX11 changes for OS/2 (#724, Holger Veit).
-1071. Fix and enable ET4000W32i acceleration, and fix unmap bug in the
- ET6000 memory probe (#723, Koen Gadeyne).
-1070. Replace fdflush() in the Summa and AceCad drivers with tcflush
- (#722, Steven Lang).
-1069. SCO support updates (#721, J. Kean Johnston).
-1068. Add some more dead accents to the 'se' xkb layout (#718, Dejan Ilic).
-1067. Merge in TOG's X11R6.3 public patch 2.
-
-XFree86 3.9h (30 June 1997)
-1066. Don't call seteuid in the server when the real uid is root. This
- fixes a problem of not getting a core file under some FreeBSD versions.
-1065. Tseng driver cleanups (#717, Koen Gadeyne).
-1064. 'xset dpms 600 0 0' complains about 600 being greater than 0.
-1063. New XInput driver for the AceCad ADVANCEDigitizer (#716, Shane Watts).
-1062. Clean up some problems with the xf86 wrappers (#715, Matthieu Herrb).
-1061. New Xinput driver for MicroTouch TouchPen touch screen (#714,
- Patrick Lecoanet).
-1060. Changes for E281-2310 and fully compatible controllers in the
- Elographics driver (#714, Juergen P. Meier).
-1059. Elographics driver updates (#714, Patrick Lecoanet).
-1058. Fix ROP bugs in the svga/s3v driver (#713, Harald Koenig).
-1057. Fix a malloc/free bug which can cause the Xserver to crash when
- an lbxproxy terminates.
-1056. Change default compression level in lbxproxy (#710, Kaleb Keithley).
-1055. Xt/Error.c update (#708, Kaleb Keithley).
-1054. LibXext cleanups (#707, Kaleb Keithley).
-1053. Config updates (#706, Kaleb Keithley).
-1052. Add PreviousCandidate and MultipleCandidate keysyms (some new Japanese
- keyboards have these keys) (#705, Kaleb Keithley).
-1051. Fix some xterm bugs (#700, Thomas E. Dickey).
-1050. Initial part of implementing VT100 doublesize characters for xterm
- (#700, Thomas E. Dickey).
-1049. First stab at adding dlopen() style loader (#712, Matthieu Herrb).
-1048. Add further acceleration to the GLINT server (mostly disabled) (#711,
- Alan Hourihane).
-1047. Add support for I128 Series II Rev 2 chips (#704, Robin Cutshaw).
-1046. Additions to the apm driver. Add support for AT3D, acceleration for
- 8,16,32bpp (for AT3D and AT24, filled rectangles, screen-screen bitblts,
- host-screen color expansion bitblts for text). DPMS support, hardware
- cursor code (also in 8bpp), use programmable clock, set MCLK to 57.3
- MHz on AT3D, various bugfixes and cleanups (#702, Henrik Harmsen).
-1045. Fix problems with displaying card READMEs in XF86Setup (#701, Dirk
- Hohndel).
-1044. Add left-edge clipping to s3_newmmio. There's bug in both the scanline
- screen->screen and CPU->screen stipple fallback routines though. Both
- break certain patterns and the screen->screen bug is worse than the
- CPU->screen one (#694, Mark Vojkovich).
-1043. Enables the XInput modules from 3.2 to be loaded as modules in
- XF86_LOADER (#693, Matthieu Herrb).
-1042. Add code to have XAA check to see if a stipple can be reduced to an 8x8
- pattern before banishing it from the pixmap cache on account of it's
- size (#692, Mark Vojkovich).
-1041. Fix CapNotLast problem in dashed line code (#686, Mark Vojkovich).
-1040. Add stippled fill fallback for SVGA/S3 if the pixmap cache is too small
- (#685, Mark Vojkovich)
-1039. Fix for xf86initac,c so that drivers can specify their own WriteBitmap
- functions and fallbacks for non-cachable stippled fills. This also
- allows usage of both CPU->screen and scanline screen->screen color
- expansion instead of one or the other (#684, Mark Vojkovich).
-1038. Some Xlib fixes (#687-690, 695-699, Kaleb Keithley).
-1037. XKB updates (#674, 675, 709, Kaleb Keithley).
-1036. Config updates to make use of change 1033 (#673, Kaleb Keithley).
-1035. Fix a typo in the XKB symbols/hu file and add an entry for it in
- the rules/xfree86.lst file (Peter Soos).
-1034. Fix a bug in Xt/Error.c that can result in partially duplicated
- error/warning messages.
-
-XFree86 3.9g (20 June 1997)
-1033. Changes to imake to determine LinuxCLib*Version,
- LinuxBinUtilsMajorVersion and PostIncDir at build time (#673,
- Kaleb Keithley).
-1032. Fix SEGV in solx86's xf86MapVidMem() when called without first
- calling xf86LinearVidMem() (David Thompson).
-1031. Fix for pci detection code in S3 server (#683, Harald Koenig).
-1030. Fix problems with rop -1 in S3V server (#679,681,682, Huver Hu, Harald
- Koenig).
-1029. Fix cache expansion routine for HARDWARE_PATTERN_NOT_LINEAR (#680,
- Mark Vojkovich).
-1028. Add "no_split_xfer" option to S3 server (#678, Harald Koenig).
-1027. Fix bug in xterm. Logout records should contain '\0' as first char
- in user name (#676, Alex Belits).
-1026. Fix color problems on S3 cards with Ti3026 for SVGA/S3 (#671,
- Achim Oppelt).
-1025. Adapt code to future changes in NetBSD's (and OpenBSD's?) mmap
- semantics (#670, Matthieu Herrb).
-1024. Fix xterm's op termcap entry, and shorten the entry so it fits within
- the 1024 character limit.
-1023. Actually include changes 963-965.
-1022. Add accelerated server for cards based on 3DLabs GLINT chipsets. This
- server is known to work on Elsa GLoria L cards on most motherboards.
- It does not support any other cards at this time. This work was
- sponsored by S.u.S.E., Elsa, and SNI (Alan Hourihane, Stefan Dirsch,
- Dirk Hohndel).
-
-XFree86 3.9f (16 June 1997)
-1021. Fix some build problems with 3.9e.
-
-XFree86 3.9e (15 June 1997)
-1020. Add some more I128 acceleration, including pixmap cache, rectangle
- fills and line drawing (#669, Robin Cutshaw).
-1019. Fix a compile problem that shows up with GLX isn't enabled
- (#668, Frederic Lepied).
-1018. If the Wacom driver isn't supplied with a value for the Suppress
- option it is calculated to report motions according to the screen
- resolution (#668, Frederic Lepied).
-1017. Fix a bug in the XInput Wacom driver which prevented the eraser from
- working (#668, Frederic Lepied).
-1016. Add a virtual XInput device called "Switch" which sends extended
- motions when a different device sends a core event (with AlwaysCore
- enabled (#668, Frederic Lepied).
-1015. Fix behaviour of XInput relative devices. They send events with
- accumulated valuators not with valuators deltas (#668, Frederic Lepied).
-1014. XInput devices with AlwaysCore enabled send both core and extended
- events at the same time (#668, Frederic Lepied).
-1014. Move HP's HPkeysym.h (#667, Kaleb Keithley).
-1013. Fix a bad include in FS.h (#666, Arthur Barstow).
-1012. Add the mechanism to acknowledge the new DacSpeed[] values to the
- svga/s3 driver. Only the Trios use it so far (#665, Mark Vojkovich).
-1011. Fix(?) Truecolor depths for the Ti 3026/3030 ramdacs in the svga/s3
- driver (#665, Mark Vojkovich).
-1010. Fix a logic bug in the XAA code that checks to see if there is
- enough room for 8x8 patterns in the pixmap cache (#664,
- Mark Vojkovich).
-1009. Changes to vga256/vga to allow the NV1 driver to work without
- requiring any VGA functionality (#663, David McKay).
-1008. Resync the MGA driver with 3.3 (#660, Radoslaw Kapitan).
-1007. Lots of updates to the svga/ati driver (#659, Marc Aurele La France).
-1006. Update support for ATI Rage II+, Rage Pro in the Mach64 server, scanpci,
- and SuperProbe (#659, Marc Aurele La France).
-1005. Remove man pages for VGA16 and Mono servers (#659,
- Marc Aurele La France).
-1004. Fix duplicate target in drivers/s3/Imakefile (#658, Robin Cutshaw).
-1003. Fix some Xprt problems (#655-657, Kevin Samborn).
-1002. Fix some DPMS problems, including problems when the DPMS timeouts
- are smaller than the screensaver cycle time, and problems with the
- various DPMS setting not being re-initialised at server reset.
-1001. Fix an InfoRec initialisation problem in xfree68/fbdev (#652,
- Andreas Schwab).
-1000. Fix incorrect links created from nls/XLC_LOCALE to xc/exports
- (#652, Andreas Schwab).
- 999. Fix a flaw in a libX11 security fix (#652, Andreas Schwab).
- 998. Add libc 6 config for Linux/m68k to Linux.cf (#652, Andreas Schwab).
- 997. Allow depth-specific Dacspeeds to work for the tseng driver
- (#651, Koen Gadeyne).
- 996. Tseng driver cleanups (#650, Koen Gadeyne).
- 995. Allow xterm to start when /etc/termcap is missing, and fix some
- configure script nits (#649, Thomas E. Dickey).
- 994. Fix twm crash if interrupted during startup (#644, Wolfram Gloger).
- 993. Fontlib fixes (#636-640, 642, 646, 648, Arthur Barstow).
- 992. Add audit logging to xfwp (#623, Kaleb Keithley).
- 991. Sun/XKB keyboard fix (#621, Kaleb Keithley).
- 990. Update xrx defaults (#620, Kaleb Keithley).
- 989. Fontserver fixes (#613, 643, Arthur Barstow).
- 988. Imake config updates (#610-612, 614-617, 619, 624, Kaleb Keithley).
-
-XFree86 3.9d (10 June 1997)
- 987. Fix "xaa_no_color_exp" option for scanline-screen-to-screen color
- expansion (#629, Koen Gadeyne).
- 986. Add hint how to disable building Xprt to xf86site.def (#627, Koen
- Gadeyne).
- 985. Change Linux to use -D_REENTRANT (#644, Wolfram Gloger).
- 984. Fix C&T driver to be more strict about DClk and MClk limits for HiQV
- chips (#645, David Bateman).
- 983. Fix I128 server (#635, Robin Cutshaw).
- 982. Fix VT switching problems in mga driver (#634, Guy Desbief).
- 981. Fixes for xterm (missing part of install-rule, incorrect assignment for
- --enable-color-mode option, unexpected cursor color change while
- scrolling) (#632,633, Thomas Dickey).
- 980. Fix a problem where the Tseng memory mapped registers get cleared in
- vgaScreenInit() when it is clearing the screen as startup. This only
- happened for 8bpp with linear mode enabled (#630, OEyvind Aabling).
- 979. Avoid nested asm calls for SVR4.0 (#631, Takaaki Nomura).
- 978. Fix error messages when loading modules in the static server (#626,
- Matthieu Herrb).
- 977. Change svga/s3 into two separate modules s3_pio and s3_newmmio. This
- doesn't work with the static server at this point. Add linear
- addressing and 16/24(packed)/32bpp. Add pci_retry option. (#625,
- Mark Vojkovich).
- 976. Allow the ChipId and ChipRev values to be overridden from the XF86Config
- for the Mach64 server.
- 975. Fix some 1bpp and 4bpp problems (#609, Marc Aurele La France).
- 974. Changes to allow SuperProbe, Mach64 driver, scanpci and vgaPCI to
- detect the newer ATI 3D Rage II+ chips (#609, Marc Aurele La France).
- 973. Allow the server side of the multibuffer extension to compile (#609,
- Marc Aurele La France).
- 972. Continue removal of the XF86_VGA16 & XF86_Mono servers (#609,
- Marc Aurele La France).
- 971. Add some new keywords to xf86_Config.h (#608, Stuart Anderson).
- 970. Fix problem building the PC98 loader server (#607, Takaaki Nomura).
- 969. Fix xdm/Imakefile for OpenBSD (which doesn't have libcrypt)
- (#606, Matthieu Herrb).
- 968. Fix default value for xf86bpp (David Dawes, Dirk Hohndel).
- 967. Some cleanups to tseng driver, re-apply the STG1700 RAMDAC changes and
- re-introduce some 1/4bpp checks (#605, Koen Gadeyne).
- 966. Fix a few typos in tseng.sgml (#605, Koen Gadeyne).
- 965. Automagically select the correct protocol for PS/2 mice at startup
- with XF86Setup (#604, Dirk Hohndel).
- 964. Fix XF86Setup to follow links that point to non-existing files (so that
- it creates /var/X11R6/bin/X if necessary (#604, Dirk Hohndel).
- 963. Fix XF86Setup to allow reading the right README files for cards using
- the SVGA server (#604, Dirk Hohndel).
- 962. Fix small problem with installing the LinkKit (#603, Geert Uytterhoeven).
- 961. Fix 8x8 pattern cache size checking (#602, David Bateman).
- 960. Remove old (pre-XAA) acceleration from C&T driver (#601, David Bateman).
- 959. Two small fixes in C&T driver for "use_vclk1" option and ImageWrites
- (#600, David Bateman).
- 958. Add C&T 65555 detection to SuperProbe and SVGA server; treat it
- basically like a 65550 but attempts to use the TMED features (untested)
- (#600, David Bateman).
- 957. Fix build problems in tseng_driver.c (#599, David Bateman).
- 956. Fix XF86Setup build problem (#598, Takaaki Nomura).
- 955. Fix yet another fontserver problem (#597, Arthur Barstow).
- 954. Remove bogus changes to xc/Imakefile (Dirk Hohndel).
- 953. Fix incorrect define for DGA (Steve Kump).
-
-XFree86 3.9c (3 June 1997)
- 952. Fix a problem with the HW cursor being drawn in the overscan area
- with the svga/s3v driver and cleanup some of the register
- save/restore (#585, Harald Koenig).
- 951. Disable the banked-mode speedups for the Tseng driver when running
- in linear mode (#584, David Bateman).
- 950. Fix for CR53 not being restored unless xf86Verbose > 1 in the svga/s3v
- driver (#572, Sebastien Marineau).
- 720. Fix problems restoring some non-standard text modes for the Millennium
- (#571,573, Radoslaw Kapitan, #574, Ansgar Hockmann).
- 948. Fix svga/s3v panning at 24bpp (#570, Harald Koenig).
- 947. Fix S3V panning at 24bpp (#569, Harald Koenig).
- 946. Fix misleading messages in the svga/s3v driver when the SVGA server
- is started with a non-ViRGE S3 card (#568, Sebastien Marineau).
- 945. Alternate S3V 32<->24 bpp translation to avoid unaligned traps
- on Alpha platforms (#567, Harald Koenig).
- 944. Disable 8x8 pattern fill when less than 8 scanlines are available
- in the XAA pixmap cache (#566, David Bateman).
- 943. Fix a screen restore problem for the Mystique when the server is
- started with '-probeonly' (#559, Radoslaw Kapitan).
- 942. Turn the monitor back on after DPMS has done its thing for
- OSs where the input devices are not selectable (558, Jack Thomasson).
- 941. Fix some incorrect ROP definitions in the C&T driver (#557,
- David Bateman).
- 940. Fix some text font corruption for the S3 Trio64 (#549,554 Harald Koenig).
- 939. XF86Setup carddata updates (#547, Koen Gadeyne, #552, Matthieu Herrb).
- 938. Modify xon to use the fully qualified hostname on Linux (#544,
- Burchard Steinbild, Dirk Hohndel).
- 937. Exclude ROPs with no source from XAA CopyPlane functions (#538,
- David Bateman).
- 936. Mach32 updates, including accepting '-bpp 15' and increasing the
- 16bpp clock limit for the 68875 ramdac to 80MHz (#536, Bryan Feir).
- 935. PC98 doc updates (#535, Takaaki Nomura).
- 934. Fix for an S3V server problem at 16bpp introduced in change 650
- (#532, Huver Hu).
- 933. Further fix for Mystique problems when VT switching (#531,
- Radoslaw Kapitan).
- 932. Fix a blit bug with the ViRGE chip in the svga/s3v driver which
- shows up with xv rubber-banding (#529, Sebastien Marineau).
- 931. Fix a blank screen problem when switching back to the Xserver
- from a text VT with the Mystique (#520, Radoslaw Kapitan).
- 930. Some minor Tseng code cleanups (#519, Koen Gadeyne).
- 929. Add a timeout to the MGA Sync() function (#518, Radoslaw Kapitan).
- 928. Map only the amount of video memory present in the MGA driver
- rather than always 8MB (#516, Radoslaw Kapitan).
- 927. Disable the HW cursor in the tseng driver when entering DGA mode
- (#514, Koen Gadeyne).
- 926. Fix a S3V server text console corruption problem when running at 24bpp
- (#513, Kevin Brosius).
- 925. Update NetBSD/OpenBSD docs (#512, Matthieu Herrb).
- 925. Update Cirrus docs (#509, Harm Hanemaayer).
- 924. Change Tseng memory mapped registers to volatile (#507, Koen Gadeyne).
- 923. Disable Tseng 24bpp for CH8398 RAMDAC (#507, Koen Gadeyne).
- 922. Update docs to reflect change 643 (#507, Koen Gadeyne).
- 921. Re-enable Tseng 8bpp+linear+accel combination (#507, OEyvind Aabling).
- 920. Update mga docs (#502, #503, Radoslaw Kapitan).
- 919. Fix font and LUT corruption on VT switch for the svga/s3v driver
- (#497, Harald Koenig).
- 918. Fix some acceleration bugs in the TGUI driver (#495,496, Alan Hourihane).
- 917. Updates to the I128 server for Alpha platforms (#494, Robin Cutshaw).
- 916. Fix a Mystique colour problem when switching VTs (#488, Guy Desbief).
- 915. Fix a bug in Mystique memory detection (2MB was detected as 4MB)
- (#482, Radoslaw Kapitan).
- 914. Merge in simple dashed horizontal and vertical line drawing in the
- S3V server into s3line.c, and use this for 24/32bpp (#474, Huver Hu).
- 913. Modify the S3V server to advertise a 32 bits-per-pixel pixmap
- format to clients, and translate to/from packed 24bpp when accessing
- the framebuffer. This allows a lot of clients which didn't know
- how to handle the 24 bits-per-pixel pixmap format to work
- (#474, Huver Hu).
- 912. Start cleanup of depth/bitPerPixel usage in the SVGA server. xdpyinfo
- should now report the correct information (#472, Mark Vojkovich).
- 911. Change chiprounding from 128 to 64 in 8bpp for the Mystique, which
- allows 1600x1200x8 on 2MB boards (#467, Radoslaw Kapitan).
- 910. Position the tseng accel scratchpad area correctly (#461, Koen Gadeyne).
- 909. Fix a problem with the W32 server that causes it to hang with
- W32i cards (#456, Koen Gadeyne).
- 908. Save the initial state of bit 7 of CR58 in the S3, S3V servers and
- svga/s3v driver, and change the "ras_precharge" option to allow it
- to be turned on or off (#458, Harald Koenig).
- 907. Enable the clockchip in the tseng driver by default when a suitable
- RAMDAC/clockchip is found (#448, Koen Gadeyne).
- 906. Fix text mode restore with ViRGE (#443, Harald Koenig).
- 905. Add CH8398 probing to XF86_W32 (#439, Kurt Olsen).
- 904. Add STG1702 probing to XF86_W32 (#434, Stuart Lamble).
- 903. Fix blitbug widths in SVGA/S3V and S3V servers, enable the hardware
- cursor in doublescan mode in SVGA/S3V server, fix the 24bpp problem in
- SVGA/S3V server when mode switching (#432, Sebastien Marineau).
- 902. Disable 24bpp on the STG1700, new "default" linear memory base for W32p
- cards, fix STG170x problems (#430 Koen Gadeyne).
- 901. Add MODULEVENDORSTRING to the ModuleVersionInfo (#423, Stuart Anderson).
- 900. Finetuning for Miro 80SV support. Add "no_pci_disconnect" Option
- (for some Alpha boxes, Alphastation255 and UDB) (#416, Harald Koenig).
- 899. Fix several problems with the tseng driver. Don't allow pixmux modes
- in the VGA16 or MONO server (it doesn't work), disable the combination
- 8bpp + linear + acceleration, fix maximal pixel clock for W32p, fix
- cut'n'paste bug where CRTC 0x31 was restored incorrectly, update the
- XF86_SVGA manual pages (#414,415, Koen Gadeyne).
- 898. NetBSD and OpenBSD doc updates (#412, Matthieu Herrb).
- 897. LynxOS documentation updates (#411,537 Thomas Mueller).
- 896. LynxOS microSPARC fixes (#410, Thomas Mueller).
- 895. Small fixes for dacspeed and set_mclk code in the S3V server (#401,
- Harald Koenig).
- 894. Fix text mode restauration in S3V server (#400, Harald Koenig).
- 893. Some misc bug fixes (#395, Harald Koenig).
- 892. Change clock limits for S3 /DX and /GX chips to 170/170/135 based
- on information from S3 (#395, Harald Koenig).
- 891. Add detection and higher clock limits for MELCO S3 ViRGE card
- (#395, Harald Koenig).
- 890. Add set_mclk for S3V and S3/Trio64 (#395, Harald Koenig).
- 889. Add support for specifying DACSpeeds separately for 8/16/24/32bpp
- (#395, Harald Koenig).
- 888. Fix module handle leak in LoaderOpen (#393, Eric Nygren).
- 877. Add Mach8 and 8514 to loader server (#387,394, Hans Nasten).
- 876. More 68k loader updates (#380, Alan Hourihane).
- 875. Some updates to the S3 server (#374, Harald Koenig).
- 874. Fix some hangs on C&T 65550/65554 (#370, David Bateman).
- 873. Several OS/2 fixes: Add the creation of host.def if not present. Get
- errno declared correctly. Add missing commandline options (#403,405
- Holger Veit).
- 872. Fix a problem in the tseng driver which was causing it to fail at >8bpp
- with the STG1700 RAMDAC (#594, Koen Gadeyne).
- 871. Tseng doc updates (#594, Koen Gadeyne).
- 870. Enable shadow passwords by default for xdm on Linux-Elf.
- 869. Fix Xrm buffer overflow in Xprint ddx (#591, Kaleb Keithley).
- 868. Fix for incorrect handling of negative values in cfb (#586, Harald
- Koenig).
- 867. Fix for fontserver accessing NULL pointer (#587, Arthur Barstow).
- 866. A better fix for change 862 (#590, Kaleb Keithley).
- 865. Fix the incorrect resetting of the HW cursor hotx/hoty values at
- VT switch in most servers/drivers that support HW cursor
- (based on #582, OEyvind Aabling, #588, Dejan Ilic).
- 864. Fix for Xlib/Xt buffer overflows which can be triggered by long
- $LANG and related environment variables (#576, Alex Belits).
- 863. Cards db updates (#583, Dirk Hohndel, Harald Koenig).
- 862. Fix for NULL dereference in XtOpenApplication/XtAppInitialize.
- This also makes these functions behave as documented (ie, exit
- when the display open fails).
- 861. Some man page updates.
- 860. Refine change 856 to take into account that some forms of 8x8
- pattern fill only need one scanline in the XAA pixmap cache
- (#581, David Bateman).
- 859. Remove some unneeded <locale.h> includes in libXp and XKB (libX11)
- (#579, 580, Kaleb Keithley).
- 858. Fix a problem that can cause xfs to crash after running for a while
- (#578, Arthur Barstow).
- 857. Fix a problem with xfs that meant it could be killed by interrupting
- one of its clients (#575, Arthur Barstow).
- 856. Disable 8x8 pattern fill when less than 8 scanlines are available
- in the XAA pixmap cache (#566, David Bateman).
- 855. Fix some sgml problems in fbdev.sgml (#564, Matthieu Herrb).
- 854. Cards db updates (#548, Koen Gadeyne, #552, Matthieu Herrb,
- #555, Harald Koenig).
- 853. Make the TGA server us the same black/white pixel defaults as the
- others, and make it honour the flippixels flag (#551, Alan Hourihane).
- 852. Updates for the VGADriverDoc sample stub driver (#546, Harald Koenig).
- 851. Fix uninitialised variables in xeyes which can cause it to crash
- on Alpha platforms (#546, Harald Koenig).
- 850. Fix a problem where XAA calls accel text functions with a ROP that
- has no source by rechecking the text function when the ROP is changed
- in the gc (#543, David Bateman).
- 849. Fix an xterm autoconf problem (#541, Thomas E. Dickey).
- 848. Add support for ICD2061 programmable clock in the pvga1 driver,
- as used by Diamond Speedstar 24X cards (#539, Torsten Duwe).
- 847. Fix XAA cap style problem with thin lines that shows up with the
- MGA driver (#540, Radoslaw Kapitan).
- 846. Update the Cards db for ViRGE cards (#534, Sebastien Marineau).
- 845. PC98 doc updates (#530, Michio "Karl" Jinbo).
- 844. Implement the Get/SetViewPort() functions in the VidMode extension
- (these were already documented).
- 843. Fix some client/server protocol mismatches in some newer VidMode
- extension functions, and allow new clients to not fail with
- servers that don't have these fixes. The extension version has
- been bumped to 0.8.
- 842. Allow xconsole to handle regular files (it could in our R5-based
- releases, but this was lost when we moved to R6).
- 841. Updates of tgetent for terminfo vs termcap for resize (#527,
- Thomas E. Dickey).
- 840. Add aixterm-style 16 colour support to xterm (#527, Thomas E. Dickey).
- 839. Make sure the port number is printed in host byte order in Xserver
- AUTH warning messages (#525, Marc W. Eichin).
- 838. Stop xterm from setting the TERMCAP environment variable when
- using terminfo (#523, Mark W. Eichin).
- 837. Remove '.' from DefaultUserPath (#517, Per Fogelstrom).
- 836. Add more ET6000-based cards to the Cards db, and make ET6000 and
- ET4000w32i/p cards point to the SVGA server instead of the W32 server
- (#515, Koen Gadeyne).
- 835. Remove '-m486' from the default gcc options.
- 834. Add detection of other variants of the Cyber9385 to the trident
- driver and SuperProbe (Arthur Tateishi and Alan Hourihane).
- 833. Change the SVGA server to tell DGA clients that the memory available
- is InfoRec.videoRam rather than ChipLinearSize (which is often
- too large).
- 832. Cards db updates (#511, Harm Hanemaayer).
- 831. Fix LynxOS inconsistent TERMCAP use by xterm and resize ($504,
- Thomas Mueller).
- 830. Fix a duplicate declaration in imConv.c that shows up when building
- without XKB support, and remove a "Const" from the declaration
- (#505, David A. Koontz).
- 829. Remove all local symlinks for 'make clean' in lnxLib.rules.
- 828. Add an autoconf configuration script for xterm. This isn't used
- in the standard build process, but is useful when building xterm
- standalone (#500, Thomas E. Dickey).
- 827. Fix a problem in the RECORD server extension where the last ClientDied
- is never flushed (#498, Kaleb Keithley).
- 826. Fix array bounds problem in dixutils.c (#493, Kaleb Keithley).
- 825. Fix Xserver crash in SHAPE extension (#492, Kaleb Keithley).
- 824. Fix typos in NetBSD.cf and OpenBSD.cf (#491, Takaaki Nomura).
- 823. Update sun.cf with the version numbers of more recent Sun ProWorks
- compilers (#489, William Austin).
- 822. TOG fix for the lib/X11 -xrm buffer overflow (#487, Kaleb Keithley).
- 821. XInput doc updates (#486, Frederic Lepied).
- 820. Fix SuperProbe's memory size detection for the ATI 264VT-B, 264GT-B,
- 264LT and above, and fix SuperProbe's detection of the 264LT
- (#481, Marc Aurele La France).
- 819. New entries for the Monitors db (#478, collected by Andrew Vanderstock).
- 818. Enable building support for the NetBSD/OpenBSD/Solaris aperture
- drivers by default.
- 817. Have postinst.sh optionally install a link in /usr/bin to rstartd.
- 816. Change the name of the saved ids feature test macro in xterm to
- be more accurate.
- 815. Enable colour in the default XTerm app-defaults file, and include
- the colour-related resources there.
- 814. Update SOLX86 docs (#477, Matthieu Herrb).
- 813. Update the Xservers to check for /dev/xsvc before /dev/fbs/aperture
- on Solaris (#477, Matthieu Herrb).
- 812. Fix XAA stipple ScreenToScreen colour expansion, and fix a problem
- with stipples when ONLY_TRANSPARENCY is flagged (#476, David Bateman).
- 811. Fix Xlib ctstowcs parser mishandling charset escape sequences in
- COMPOUND_TEXT (#470, Kaleb Keithley).
- 810. Fix the -ar1 and -ar2 Xserver flags breaking XKB auto-repeat (#469,
- Kaleb Keithley).
- 809. Add a backward-compatibility option to disable the recent XtMalloc
- changes (#468, Kaleb Keithley).
- 808. Bump the revision number of SuperProbe (#462, Koen Gadeyne).
- 807. Add ICS5341 and ISC5301 SDAC/Gendac detection to SuperProbe (#462,
- Koen Gadeyne).
- 806. Fix negative offsets in pixmap during stipple fill (#460,
- Radoslaw Kapitan).
- 805. Fix the layout of the mouse protocol buttons in XF86Setup. XF86Setup
- now requires Tk version 4.1 or later (#459, Matthieu Herrb).
- 804. Install rstartd in /usr/X11R6/bin rather than in /usr/bin.
- 803. Fix a DGA addressing problem in the S3 server (#457, Mark Vojkovich).
- 802. Remove the part of the PCI config-type detection that seems to switch
- some Neptune-based machines from type 1 to type 2.
- 801. xtest update for OpenBSD (#455, Matthieu Herrb).
- 800. Only show Xinput initialisation messages once (#454, Matthieu Herrb).
- 799. Add support for the IntelliMouse protocol to xf86config and XF86Setup.
- 798. Fix a problem in the Xservers where the DPMS timer code can cause
- select() can get called with a negative timeout value (and get stuck
- in an infinite loop) (#453, Van Jacobson).
- 797. OS/2 updates (including docs) (#452, Holger Veit).
- 796. Doc updates (#450, Matthieu Herrb).
- 795. Fix the trident driver to make virtual resolutions work for the
- TGUI96xx/Cyber chips and make 32bpp available to these chips too.
- Also, update the clock code for these chips to allow higher
- resolutions (#386, Alan Hourihane).
- 794. Disable the svga/s3v register dumps except for xf86Verbose > 1.
- 793. Fix the svga/s3v driver Probe() to not falsely assume a ViRGE card
- is present in some circumstances.
- 792. Add some new entries for the ServerFlags section to allow some
- control of the code used to determine the PCI config type on
- Intel platforms.
- 791. Fix handling of the "line" parameter for the scroll-forw/scroll-back
- actions in xterm, and add entries to the XTerm app-defaults to
- use buttons 4 and 5 (as generated by the wheel on the IntelliMouse)
- for scrolling.
- 790. Add debugging messages to the PCI probe code. These are enabled
- when xf86Verbose > 2. Also, try scanpci's method of detecting PCI
- config type 1 when the other method fails.
- 789. Fix DeviceButtonMotion (#437, George Sachs).
- 788. Fix for SuperProbe dumping core on NetBSD (#433, Matthieu Herrb).
- 787. Fix fbdev.c and update documentation (#428, Geert Uytterhoeven).
- 786. mga/README updates (#419, Radoslaw Kapitan, #431, Guy Desbief).
- 785. xtest fixes, and updates for Linux (Harald Koenig).
- 784. MGA doc updates (#447, Guy Desbief).
- 783. Fix the Xt TopLevelShell's XtNiconic resource (Sekhar Makkapati).
- 782. Tseng doc updates (#445, Koen Gadeyne).
- 781. Tseng doc updates (#421, Harald Nordgard Hansen).
- 780. Change the behaviour of XtMalloc, XtCalloc and XtRealloc when
- Malloc0ReturnsNull is set to YES so that they conform to the
- Xt spec (#444, Kaleb Keithley).
- 779. Fix for buffer overflows in libX11's GetDatabase(). This can be
- used to exploit setuid programs linked against libX11
- (#442, Harald Nordgard Hansen).
- 778. Doc updates (#441, Takaaki Nomura).
- 777. Doc updates (#440, Thomas Mueller).
- 776. Modify some messages in the svga/s3v driver (#443, Harald Koenig).
- 775. Undo change 623; the post dividers were incorrect (#435, Marc Aurele
- La France).
- 774. Move the Tk/Tcl include dirs after all the others in the XF86Setup
- Imakefile to make sure they don't cause installed X headers to be
- incorrectly used.
- 773. Add CH8398 RAMDAC detection to SuperProbe (#418, Kurt Olsen).
- 772. Fix an error in xterm's vt220 emulation: the DECUDK is only supposed
- to be interpreted for _shifted_ function keys (#384, Thomas E. Dickey).
- 771. Patch to GLX comment/example in xf86site.def (#409, Henry Worth).
- 770. Improve handling of screen pitch for accelerated C&T driver (#407,
- David Bateman).
- 769. Add support for the Miro 80SV to the S3 server (#406, Harald Koenig).
- 768. Fix bmtoa, smproxy, twm, xsm and Xprint to use mkstemp, if available,
- to avoid the mktemp() race condition (#404, Matthieu Herrb).
- 767. Several updates XInput: Add always core feature to mouse driver. Add zone
- configuration for the wacom driver (TopX, TopY, BottomX, BottomY). Add
- KeepShape option for the wacom to respect the ratio of width/height
- |of the screen. Add multiple active zones on the same tablet. Add
- checks not to send core button events when multiple devices control the
- core pointer. Fix problem in the mouse driver not sending the button id
- in extended events. (#402, Frederic Lepied).
- 766. More modes for xf86config and XF86Setup database (#397, Koen Gadeyne).
- 765. Fix name of GLX stub library (#389, Henry Worth).
- 764. Renumber option flag definitions to allow more space in the various
- categories.
- 763. Fix problems with DGA on 4/8MB Millenniums (#390, Radoslaw Kapitan).
- 762. Fix Mystique display problems and dim text font after exit problems
- (#378,379, Guy Desbief).
- 761. Rewrite clock restoring procedure for mga driver (#385, Radoslaw Kapitan).
- 760. More modes for XF86Setup database (#372, Koen Gadeyne).
- 759. Fix typos in NetBSD.cf (#363, Takaaki Nomura).
- 758. Add a ModuleInit function to libxaa.a (#362, J. Kean Johnston).
- 757. Fix a NULL dereference in xf86Config.c on OSs that don't support
- dlopen() loading for the static servers (#361, Thomas Mueller).
- 756. Fix a problem with references to the GLX stub libraries in
- Xserver/Imakefile that affects building static servers
- (#361, Thomas Mueller).
- 755. Allow most of the extensions in Xext to be dynamically loaded (in
- a single module) (#360, Matthieu Herrb).
- 754. Allow the DBE extension to be dynamically loaded (#359, Matthieu Herrb).
-
-XFree86 3.9b (4 May 1997)
- 753. Add BuildPC98Servers as an easy way to enable/disable building
- all PC98 servers.
- 752. Build Xvfb by default to help pick up build problems.
- 751. Make 'makedepend' understand '-U' on the command line.
- 750. Some fix-trackers from TOG, includes:
- lib/Xi: missing error message (#352 -- we already had this fix)
- lib/X11: long font paths can garbage heap (#353)
- fix potential memory leak in xinput ProcXGetDeviceMotionEvents (#354)
- fix unmatched quotes in comments (and other stuff?!?) (#355)
- config updates (#356)
- lib/X11: when IMS dies the library closes all open IMs (#357)
- lib/X11: When doing XSetICValues and IMS returns ERROR, library core
- dump (#358).
- 749. Clean up the GLX for the static-linked servers (#351, Henry Worth).
- 748. Fix SCO Open Server build problem (#348, J. Kean Johnston).
- 747. Add an option to allow VClk1 to be used as the programmable clock
- with C&T 65550 and 65554 chips (#346 Daniel Bischof, Andreas Heitmann
- and Thomas Landgraf).
- 746. Remove trailing ',' at the end of InfoRec initialisations, which
- was hiding potential compiler warnings (#343, Koen Gadeyne).
- 745. Replace the ChipClockScaleFactor field with ChipClockMulFactor and
- ChipClockDivFactor to allow for non-integer factors required in
- some cases (#343, Koen Gadeyne).
- 744. Fix some 'make' problems that show up on NetBSD and OpenBSD, and clean
- up BSD 4.4 -specific make stuff in the config/cf directory
- (#342, #344, Matthieu Herrb).
- 743. Add better error/warning messages for the aperture driver code for
- NetBSD/OpenBSD (#341, Matthieu Herrb).
- 742. Block choosing interleave mode for the Mystique, and set maxPixelClock
- for the Mystique (#338, Radoslaw Kapitan).
- 741. Add ability to set MCLK for the mga driver in XF86Config (#338, #339,
- Radoslaw Kapitan).
- 740. Fix some problems with XAA DELAYED_SYNC and the software cursor and
- backing store -- new wrappers are added (#337, Sebastien Marineau).
- 739. Re-enable HW cursor for Millennium, and implement looping over
- MGAIdent when checking the Chipset (#336, Radoslaw Kapitan).
- 738. Remove some assumptions about burst modes from the C&T ImageWrite
- function (#335, David Bateman).
- 737. Matrox Mystique driver support, which should work fine with
- acceleration disabled (#334, Guy Desbief).
- 736. Fix for double-height MGA hw cursor when using interlaced modes
- (#333, Radoslaw Kapitan).
- 735. Explicit syncing of the blitter at the end of the C&T XAA primitives
- is no longer needed since delayed syncing is off by default
- (#332, David Bateman).
- 734. Use the source pitch for colour CPU to screen operations in the C&T
- driver (#332, David Bateman).
- 733. Fix writing the 16bpp planemask to the chip in the C&T driver
- (#332, David Bateman).
- 732. Stop reserving 1kb of video memory when the accelerator is disabled
- for the Tseng driver (#331, Stuart Lamble).
- 731. Fix Trident 96xx/Cyber series for snow on the screen and fix
- acceleration issues (#330, #349, Alan Hourihane).
- 730. C&T doc updates (#329, David Bateman).
- 729. Fix a bitblt bug for 8bpp, widths 49..56 in the s3v driver (#328,
- Sebastien Marineau).
- 728. Add filled trapezoid support to the s3v driver (#328,
- Sebastien Marineau).
- 727. Add caching of often-used ViRGE registers (#328, Sebastien Marineau).
- 726. Add hw cursor support for the SVGA s3v driver (#328, Sebastien Marineau).
- 725. Add a new kind of XAA pixmap cache slot which is used to hold mono
- 8x8 patterns for chips which have PROGRAMMED_BITS (#327,
- Sebastien Marineau).
- 724. Fix XAA pixmap cache invalidation after a VT switch (#327,
- Sebastien Marineau).
- 723. Fix lockup problem in SVGA s3v driver, and some cleanups (#326,
- Harald Koenig).
- 722. Fix MGA hw cursor not displaying after switching resolutions
- (#325, Radoslaw Kapitan).
- 721. Fix text colour problems for ViRGE/VX, a rectfill and bitblt bug
- for virtual width == 2048, and avoid some more bad hardware lines in
- the S3V server (#324, Harald Koenig).
- 720. Move chipset independent hw-cursor stub from mga_dac3026.c to
- mga_hwcurs.c (#322, Radoslaw Kapitan).
- 719. Fix a build problem in osPexFont.c, and add a ModuleInit function
- for libxf86cache.a (#321, Michael Rohleder).
- 718. Fix a 32bpp Millennium DAC initialisation typo (#318, Radoslaw Kapitan).
- 717. Loader support for m68k (#317, #323, Alan Hourihane).
- 716. Fix copyright and remove RCS idents in xf86_ldext.h (#316,
- Matthieu Herrb).
- 715. Fix some NonTE text problems, and back out change #690 (#315,
- David Bateman).
- 714. Add initialisation of GlxInitVisualsPtr to loadmod.c (#313, Henry Worth).
- 713. Don't build libX11 for BuildServers only unless building the Xnest
- server (#312, Marc Aurele La France).
- 712. Remove extraneous line in xf86text.c (#311, Harald Nordgard Hansen).
- 711. Restore changes accidentally backed out of xfree86.cf in 3.9a
- (includes #310, #313, #320, #326).
- 710. Open /dev/tty0 instead of /dev/console on Linux to find the first
- free VT.
-
-XFree86 3.9a (17 April 1997)
- 709. Add delayed syncing as an optional flag for XAA. This is now
- currently enabled only in the S3 driver (#308, Mark Vojkovich).
- 708. Several fixes to TE and NonTE fonts. The server now passes CH06
- drwimgstr, drwimgst16, drwstr, drwstr16, drwtxt and drwtxt16 xtest tests
- (#305,307, Sebastien Marineau).
- 707. Add Latin2 Type1 fonts (Peter Soos).
- 706. Add Latin2 bdf fonts (Petr Kolar).
- 705. Add SubsequentDashedTwoPointLine to XAA (#296, Mark Vojkovich).
- 704. Add a Hungarian XKB symbols file (Peter Soos).
- 703. Add support for Microsoft Intellimouse (#304, Thomas Vogler).
- 702. Add ViRGE/VX support to SVGA/S3V server; this isn't really working, yet
- (#299,301, Harald Koenig).
- 701. Add memory, FIFO, and PCI retry options to SVGA/S3V server (#293,300,
- Sebastien Marineau).
- 700. Add support for 15bpp and 32bpp to SVGA/S3V server. 32bpp only with
- very limited acceleration (#293,300, Sebastien Marineau).
- 699. Only build libX11 while doing BuildServersOnly if Xnest is enabled (295,
- Harald Koenig).
- 698. Disable color expansion with planemask at 24bpp in chips driver (#303,
- David Bateman).
- 697. Fix small bug in SVGA/S3 dash line code (#302, Mark Vojkovich).
- 696. Allow trident 96xx chips to restore text mode (#298, Alan Hourihane).
- 695. Fix virtual resolutions for trident driver at 24bpp (#298, Massimiliano
- Ghilardi).
- 694. TGUI driver updates for PC98 (#297, Akio Morita)
- 693. Fix building PC98 modules, resync PC98 Imakefile (#297, Takaaki Nomura).
- 692. Fix ch8398 ramdac command byte for 8bpp in tseng driver (#294,
- Krajcsovits Gyorgy).
- 691. Fix NonTE fonts in XAA (#292,309 David Bateman).
- 690. Disable XAA matchcommon logic to fix problem with grayed out fonts
- (#291, David Bateman).
- 689. Fix sis driver for 8x8 color expand pattern fill pattern flags and XAA's
- new synching policy (#290, Xavier Ducoin).
- 688. LynxOS updates (#289, Thomas Mueller).
- 687. Enable 1bpp and 4bpp for the chips driver (#288, David Bateman).
- 686. Jump version number to document that this is the branch working towards
- XFree86-4.0.
-
-XFree86 3.2At (14 April 1997)
- 685. Fix ImageText fallback (#287, David Bateman).
- 684. Some fixes for NonTE text. Add FixedBase support. Add TRIPLE_BITS24BPP
- support. Fix CPU_TRANSFER_PAD_QWORD problem. Fix possible loss of a few
- pixels at the end of NonTE text strings (#286, David Bateman).
- 683. Fix compile problem with USL compiler (#283, David Bateman).
- 682. Updates to mga_reg.h for Mystique (Guy Desbief).
- 681. Add ATT20C49x RAMDAC support for 16 and 24bpp modes to tseng driver.
- Make ET6000 hardware cursor use closest available color instead of
- refusing to change colors when it can't find an exact match. Fix
- another W32i linear mode bug. Change ET6000 pixel clock limits as per
- Tseng's recommendations (=much lower than we had before). fix a BUG in
- the ET4000 "standard set-of-clocks" code. Use ChipClockScaleFactor.
- (#282, Koen Gadeyne).
- 680. Fix and re-enable 8x8 pattern color expansion (!=24bpp) for Alpine cards
- Fix CPUToScreen color expansion for 24bpp mode, fix determining the BG
- color in 24bpp color expansion routines (#281,285, Corin Anderson).
- 679. Various Cirrus fixes and additions. Fix HAVE_546X() macro for Laguna
- support. Add support for CL-GD5480. Disable Alpine XAA color expansion
- code. Fix 32bpp Alpine mode bug. Overload {slow,med,fast}_dram options
- to set Rambus BCLK on Laguna chips. Remove Sync()'s in laguna_acl.c.
- Removed unnecessary, dead, and/or dumb code in cir_driver.c. Add clock
- values for 150MHz through 229MHz dot clocks. Set clock limits correctly
- for Laguna chips. (#280, Corey Anderson).
- 678. Fix problem in xf86gcmisc.c that could cause a segfault (#279,
- Mark Vojkovich).
- 677. Fix problems with NonTE text in XAA (#278, David Bateman).
- 676. Fix loader under SVR4.0.4 (lstat,fstat,mknod)(#277, Richard Coley).
- 675. Speedups for dashed lines in SVGA/S3 (#276, Mark Vojkovich).
- 674. Allow building Xnest with BuildServersOnly (#275, Marc Aurele La France).
- 673. Fix vga16 and banked vga2 without also breaking either of the loader or
- static servers. Remove obsolete directories and other extraneous junk.
- Remove mi's dependence on mfb. LoaderFixups is no longer needed. Add
- xf86InitViewport to the symbol table. Combine vga2/mfb & vga2/mfb.banked.
- (#274 Marc Aurele La France).
- 672. More layout cleanups in matrox driver (#273, Radek Kapitan).
- 671. Fix LinkKit to build loader (#272, Takaaki Nomura).
- 670. Fix some Alpha problems (#270, Robin Cutshaw).
- 669. Add MemClk field to all drivers (#270,271 Robin Cutshaw, Sebastien
- Marineau).
- 668. Fix server crashes in C&T driver caused by delayed syncing (#269, David
- Bateman).
- 667. Fix problems with PEX modules (#268, Takaaki Nomura).
- 666. Fix some problems in XAA benchmarks and Trident Cyber support (#266,267,
- Alan Hourihane).
- 665. Add Mystique to scanpci (#264, Guy Desbief).
- 664. Fix problems with delayed syncing (#263, Mark Vojkovich).
- 663. Fix LinkKit and cirrus driver (#262, Takaaki Nomura).
- 662. Fix I18N bug (#261, Nagao Tadaaki).
- 661. First steps to get loader on SCO (#260, J. Kean Johnston).
- 660. File structure changes for mga driver (#259, Radek Kapitan).
- 659. Add stubs to load GLX extension (#228,246, Henry Worth, Dirk Hohndel).
-
-XFree86 3.2As (09 April 1997)
- 658. Several fixes and enhancements for the cirrus driver. Fix the crash that
- showed up in 3.2A with MMIO on some chips at 16bpp. Enable the 8x8
- pattern fill code for different chips. Reorganize the BitBLT feature
- checks in the accelerated driver, and make it compatible with the new
- delayed syncing in XAA.Fix the > 85 MHz dot clock mode on the
- CL-GD5436/46. Detect all DRAM configurations that are possible on the
- CL-GD5446. Add code to handle the 7555 (no detection).
- (#258, Harm Hanemaayer).
- 657. Fix Bresenham line bug in trident/9440 driver (#257, Alan Hourihane).
- 656. Add trapezoid acceleration to tseng driver (disabled), disable W32 hw
- cursor, remove redundant warning message about "Wrong Cursor Color Tried"
- (#256, Koen Gadeyne).
- 655. Add mga dashed lines (#255, Andrew Vanderstock).
- 654. Add more flexible way of loading and initializing extensions (#253,
- Matthieu Herrb).
- 653. Fix bugs in the S3V server concerning rectfill with scan line width of
- 2048 and with lines (#251,252, Harald Koenig).
- 652. Add option "set_memclk" (#249, Sebastien Marineau).
- 651. Fix hangs in svga/s3v server, fix some bugs, add planemask support to
- most accelerated primitives and start accelerated lines (#249, Sebastien
- Marineau).
- 650. Fix XAA to force ROP to GXcopy for XDrawImageString (#249, Sebastien
- Marineau).
- 649. Change "unsigned long" to CARD32 in dashed line support (#248,
- Mark Vojkovich).
- 648. Add Matrox Mystique to vgaPCI.h (Guy Desbief).
- 647. Fix building XF98_EGC (#247, Takaaki Nomura).
- 646. Fix some problems with delayed syncing in the C&T driver (#245, David
- Bateman).
- 645. Add dashed line support for SVGA/S3 (#243, Mark Vojkovich).
- 644. Add dashed line support for XAA (#242,244, Mark Vojkovich).
- 643. Fix some fill problems in S3V server (#241, Harald Koenig).
- 642. Several fixes to C&T driver that rearrange code in XAA FillRect code to
- work around bug in HW cursor, add ImageWrite function, use the 8x8
- pattern where possible to simulate a planemask, add preliminary support
- for vga2 and vga16 and temporary fix for Syncing problems in new XAA code
- (#239, David Bateman).
- 641. Further LinkKit changes (#238, Takaaki Nomura).
- 640. Small fix for LinkKit (#237, David Bateman).
- 639. Fix twm double-frees (#236, John Hawkinson).
- 638. Include missing patch for change 601.
- 637. Update Compaq vgaVideoChipRec (1bpp,4bpp,15bpp,32bpp) (#234, Gerry Toll).
- 636. Fix Linkkit (#233, Takaaki Nomura).
- 635. Fix broken console restore for 4bpp driver (#232, Marc Aurele La France).
- 634. Add S3 chipset override code to SVGA/S3 server (#231, Harald Koenig).
- 633. Start converting XF86Setup to use the loader (#230, Joe Moss).
- 632. Correct DCLK limits for S3V server (#229, Harald Koenig).
- 631. Add STG1702 to SuperProbe (#227, Stuart Lamble).
- 630. Small fix for syncing in XAA color expansion (#225, Mark Vojkovich).
- 629. Resync PC98 server (#224, Takaaki Nomura).
- 628. Add stg1702 auto probing to the tseng driver (#223,#226, Stuart Lamble).
- 627. Fix 4bpp for PC98 (#222, Takaaki Nomura).
-
-XFree86 3.2Ar (28 March 1997)
- 626. Remove the old driver subdirectories.
- 625. Fix setting of CRTC[22] on VGA compatibles (#220, Marc Aurele La France).
- 624. Fix vga16 & banked vga2; don't remap *fb's endtab. Use the correct
- banking functions, displayWidth handling (#219, Marc Aurele La France).
- 623. Change Mach64 to use the known extended post-divider setting on the
- 3D Rage II (#218, Marc Aurele La France).
- 622. Lots of changes to the SVGA/ATI driver, including 3D Rage II support,
- memory type detection (#217, Marc Aurele La France).
- 621. Clean up internal allocator a bit, and make it log more information
- (when enabled) (#216, Marc Aurele La France).
- 620. Fix misuse of UseInstalled in the .cf files for BSD derivatives.
- Make LinkKit use the same default CCOPTIONS as the main build.
- Remove redundancy in svr4.cf (#215, Marc Aurele La France).
- 619. Add newer ATI chipsets to SuperProbe (#214, Marc Aurele La France).
- 618. Fix color expansion and pixmap cache in trident driver (#212,213,
- Alan Hourihane).
- 617. Change XAA to delay syncing (#211, Mark Vojkovich).
- 616. Fix OS/2 naming problem in Xserver Imakefile and XAA 8x8 pattern
- rotations and flag checking inconsistency (#210, Sebastien Marineau).
- 615. Add SVGA/S3V driver (#210, Sebastien Marineau).
- 614. Add Sigma Designs REALMagic to SuperProbe (#209, Harald Koenig).
- 613. Merge Trio64V2/Aurora64V+/PLATO changes into S3/SVGA driver (#208,
- Harald Koenig).
- 612. Fix building XF98_EGC (#207, Takaaki Nomura).
- 611. Add ImageWrite to s3/svga and prepare driver for upcoming XAA changes;
- the s3/svga server no longer does cursor blocking, users of Xqueue
- might have to use the Option "sw_cursor" (#206, Mark Vojkovich).
- 610. Fix 8 bit DAC handling in SVGA server (#205, Mark Vojkovich).
- 609. Add better support for linear memory on W32i cards (#204, Koen Gadeyne).
- 608. Add HORIZONTAL_TWOPOINTLINE to XAA (#203, Alan Hourihane).
- 607. Add autoloading of libxf86cache to Mach32 & Mach64 server and compile
- ServerInit() and ModuleInit() only for the LOADER (#202, Takaaki Nomura).
- 606. Add support for Cirrus CL-GD5464BD, CL-GD5465 (#201, Corin Anderson).
- 605. Documentation updates and improved memory bandwidth handling in tseng
- driver (#200, Koen Gadeyne).
- 604. ViRGE/DX support for S3V server (#199, Harald Koenig).
- 603. Some fixes to Trio64V+ & Trio64V2 (#198, Harald Koenig).
- 602. Recognize 1MB on ViRGE (using an illegal setting) (Alan Hourihane).
- 601. Fix and enhance handling of unresolved symbols in loader (#196, Harald
- Koenig).
- 600. Fixes and Additions for XF86Setup (#194,195, Joe Moss).
- 599. Fix SuperProbe for W32 chipsets (#191, Koen Gadeyne).
- 598. Fix building the static S3 server (#188-190, Harald Koenig).
- 597. Fix undefined symbols in the pex5 module (#187, Matthieu Herrb).
- 596. Fix autoloading modules in the S3 server for PC98 (#186,197 Takaaki
- Nomura).
-
-XFree86 3.2Aq (23 March 1997)
- 595. Fix building static XF86_S3 (#185, Harald Koenig).
- 594. Enable loader on OpenBSD (#184, Matthieu Herrb).
- 593. Add missing files for NV1 (change 591).
-
-XFree86 3.2Ap (22 March 1997)
- 592. Fix screen problems with C&T at 24bpp (#182, Nozomi Ytow).
- 591. Add NV1 acceleration (#181, David McKay).
- 590. Add Trio64V2 170/110/60MHz support to S3 server (#180, Harald Koenig).
- 589. Automagic loading of modules for old S3 server (#178,179 Harald Koenig).
- 588. Automagic loading of modules for PC98 servers (#177, Takaaki Nomura).
- 587. Fixes to blitter and hw cursor handling in C&T driver (#176, David
- Bateman, Egbert Eich).
- 586. Add Elsa handling to S3/SVGA and Trio64V2/DX/GX, ViRGE/DX/GX and PLATO/PX
- to SuperProbe, scanpci, S3, S3V and S3/SVGA servers (#174,175,
- Harald Koenig).
- 585. Build fix for Xprt, Xnest and Xvfb (#172, Takaaki Nomura).
-
-XFree86 3.2Ao (18 March 1997)
- 584. Fix/add IBM RGB528 support and add ELSA eeprom detection (only
- for IBM ramdacs right now) (#170, Harald Koenig).
- 583. Fix linking problem of XF86_LOADER for Linux/a.out (#170,171, Harald
- Koenig, Xavier Ducoin)
- 582. Fix several problems with loader and static server that were caused
- by change 567 (Dirk Hohndel).
- 581. Fix bad 400x300 mode line (#165, Koen Gadeyne).
- 580. Finer W32 chipset detection (#165, Koen Gadeyne).
- 579. Tseng documentation updates (#165, Koen Gadeyne).
- 578. Fix unresolved strlen in PEX and XIE (#164, Takaaki Nomura).
- 577. Fix changes of NEC480 to PEGC (#163, Michio "Karl" Jinbo).
- 576. Fix building of XF98_LOADER (#163,169, Michio "Karl" Jinbo,
- Takaaki Nomura).
- 575. Fix building of normal X servers for PC98 (#163, Takaaki Nomura).
- 574. Fix building P9000 module (#160, Takaaki Nomura).
- 573. Add S3/SVGA color expansion (#161, Mark Vojkovich).
- 572. Fix problems with "dac_8_bit" in svga server (#159, Mark Vojkovich).
- 571. Fix ET6000 hardware cursor (#158, Harald Nordgard Hansen).
- 570. Changes to NetBSD + BSD Elf library configuration (#157, Chris G.
- Demetriou).
- 569. Fix for the SVGA/S3 hardware cursor (Xavier Ducoin).
-
-XFree86 3.2An (15 March 1997)
- 568. Build fixes in order to get a clean compile on Linux and FreeBSD
- (not for PC98, though). The servers still don't work quite as
- they should.
-
-XFree86 3.2Am (12 March 1997)
- 567. First attempt to get a universal SVGA server that statically links
- in all drivers except those from the accel directory. Links ok and
- seems to work at >=8bpp, but has bit ordering problems for 1,4bpp.
- (David Dawes, Dirk Hohndel).
- 566. Fixes for Trident Cyber chipsets (#154,155, Alan Hourihane).
- 565. Fixes for OS/2 (more IHaveModules and drive letters in ModulePath),
- get Mach64 to work again (#153, Holger Veit).
- 564. Cleanups and improvements to tseng hw cursor code (#152, Koen Gadeyne,
- Harald Nordgard Hansen).
- 563. Add pci_retry option to tseng driver (#151, Dejan Ilic).
- 562. Change NEC480 to PEGC, resync of SuperProbe/Imakefile (#150, Takaaki
- Nomura).
- 561. Add hardware cursor to MGA driver (#149, Xavier Ducoin).
- 560. Make tseng driver handle 1/4/8bpp at runtime (#145, Koen Gadeyne).
- 559. Make apm driver loadable (#146, Joe Moss).
- 558. Fix some cross compilation problem for XAA on OS/2 (#144, Sebastien
- Marineau).
- 557. Fix some 24bpp problems for ViRGE and cfb (#144, Sebastien Marineau).
- 556. Move cursor area to top of vidmem for ViRGE (#144, Sebastien Marineau).
- 555. Really fix mono/Imakefile and fix PEX struct dirent problem (#143,
- Matthieu Herrb).
- 554. Add handling for S3-style 8x8 pattern fill to XAA; fix s3/svga
- accordingly (#141, Mark Vojkovich).
- 553. Fix OS/2 problems; disable cross compiling Xprt, Xvfb, Xnest (#140,
- Holger Veit).
- 552. Include some fix trackers, fixing problems with sunLib.tmpl, hp.cf,
- memory leak in xdm: xdmcp.c manage(), Imake.rules, zlib 1.0.4, AltGR
- not working in Xlib (#131,132,135-139).
- 551. Reapply change 536 for the new drivers (#130, Mark Vojkovich).
- 550. Enable loader for NetBSD and fix a few typos (#127-129, Takaaki Nomura).
-
-XFree86 3.2Al ( 7 March 1997)
- 549. Fix a.out loader for FreeBSD (#126, Takaaki Nomura).
- 548. Add the BT-848 to scanpci (#121, Dejan Ilic).
- 547. Change the way dynamic loading of vga2. vga16, vga256 modules is done
- (just one module per driver for all color depths, all the drivers are
- moved to xfree86/drivers) (#122-124, Alan Hourihane, Dirk Hohndel).
- 546. Add support for 3DLabs GLINT chipsets to scanpci and SuperProbe, start
- working on a 2D server for Elsa Gloria L (Dirk Hohndel, Stefan Dirsch).
-
-XFree86 3.2Ak ( 4 March 1997)
- 545. Make Mono drivers loadable and clean up some of XF86_LOADER; this
- change replaces some of the things done in change 537 (#119, H.J. Lu).
- 544. Fix char alignment in COFF loader as well (#120, Thomas Mueller).
- 543. Fix short alignment in COFF loader and add missing entry to SYMENT
- (#118, Michael Rohleder).
- 542. Build fix for libc_wrapper.c on ISC (#117, Michael Rohleder).
- 541. Add Module Version to Mach32 server (#117, Michael Rohleder).
- 540. Add smarter handling of unresolved symbols in the loader (#116,
- Sebastien Marineau).
- 539. Fix problem in OS/2 loader (#115, Sebastien Marineau).
- 538. Add module versioning and auto loading to S3V server (#114, Sebastien
- Marineau).
- 537. Change name of Screen Section to "XFree86".
- 536. Set correct clipping rectangle for SVGA/S3 (#112, Mark Vojkovich).
- 535. Fix a problem in trapezoid solid fill code (not sure if this fixes
- the problems that caused change 533 to be disabled) (#110,
- Mark Vojkovich).
- 534. Add 'Doublescan' support to MGA driver (#109, Radoslaw Kapitan).
- 533. Add trapezoid solid fill acceleration to MGA driver; disabled as it
- doesn't draw correctly at this point (#109, Radoslaw Kapitan).
- 532. Remove MgaAccelSwitch (#108, Radoslaw Kapitan).
- 531. Improve SolidFill speed on C&T65545/6/8 (#107, Nozomi Ytow).
- 530. Fix libc_wrapper.c build problem on SVR4 (#106, Takaaki Nomura).
- 529. Fix VGA16 driver (#105, Thomas Mueller).
- 528. Fix Compaq AVGA driver (#104, Ming Yu, Joseph Pfeiffer, Gerry Toll).
- 527. Add more comments to MGA driver (#103, Radoslaw Kapitan).
-
-XFree86 3.2Aj (28 February 1997)
- 526. Various build fixes for FreeBSD, NetBSD, Linux, Solaris (Dirk Hohndel).
- 525. Fixes for OS/2 loader and ar code (#100, Sebastien Marineau).
- 524. Updates to S3/SVGA driver (#99, Mark Vojkovich).
- 523. Add SubsequentFillTrapezoidSolid to XAA (#99, Mark Vojkovich).
- 522. First stab at getting VGA16 as loadable module; doesn't work, yet
- (Dirk Hohndel).
- 521. Add Mystique register definitions (#98, Guy Desbief).
- 520. Fix unresolved symbols with loadable ati driver (#96, Thomas Mueller).
- 519. Add module versioning (#97, Holger Veit).
- 518. LynxOS doesn't have vfscanf (#95, Thomas Mueller).
- 517. Fix 499 was missing. It is now included.
- 516. Remove bogus code in xf86frect.c (#93, Harm Hanemaayer, Harald Nordgard
- Hansen).
- 515. Build fixes for FreeBSD (#92, Takaaki Nomura).
- 514. Restructure RAMDAC handling in tseng driver and add 16/24bpp support
- for STG1703 (#91, Koen Gadeyne).
- 513. Tseng HW cursor state save/restore (#91, Dejan Ilic).
- 512. Disable HW cursor on et4000 (#91, Koen Gadeyne).
- 511. Fix et6000 memory probing (#91, Koen Gadeyne).
- 510. Fix handling of PCI probe in the tseng driver (#91, Koen Gadeyne).
- 509. Fix "double-magic" in libc_wrapper.c (#90, Holger Veit).
- 508. Fix for ET6000 HW cursor (#89, Harald Nordgard Hansen).
- 507. Fixes to MGA driver: remove "nolinear", allow overriding MMIO address
- as IoBase in XF86Config, remove obsolete files (#88, Radoslaw Kapitan).
-
-XFree86 3.2Ai (25 February 1997)
- 506. Fix libc_wrapper.c for LynxOS, where stdin/out/err isn't a valid
- initializer (#87, Thomas Mueller).
- 505. Updates to SiS driver: fix setting MemBase, allow some XAA functions
- in 8bpp even without linear mode, support DPMS (#86, Xavier Ducoin).
- 504. Disable the stream display fetch length control for Trio64V2
- (#85, Xavier Ducoin).
- 503. Update SuperProbe for sis86c202 and sis86c205 (#84, Xavier Ducoin).
- 502. Allow ModulePath to have multiple elements; use heuristic to find the
- module if only part of the exact filename is specified; allow subdirs
- of the module directory to be searched (Dirk Hohndel).
- 501. Change loader code so that ModuleInit is a magic function name that
- indicates the init function for a module. ServerInit now is the function
- used to get the initial ScrnInfoRec; change all modules to follow these
- naming conventions (Dirk Hohndel).
- 500. Fix missing fsetpos/fgetpos in ISC (#78, Michael Rohleder).
- 499. Fix elfloader to recognize .data1 and .rodata1 sections
- (#82, Steve Forsythe).
- 498. Add readdir family of functions to libc_wrapper (#81, Holger Veit).
- 497. Add crosscompilation support for OS/2 (#81, Holger Veit).
- 496. Add loadable module support for P9000 (#80, Erik Nygren).
- 495. Fix error message in loader (#79, Matthieu Herrb).
- 494. Workaround for a bug in 68k GNU binutils (#77, Geert Uytterhoeven).
- 493. Add new xf86_libc.h to make porting to the new style loader
- architecture easier. Adapt PEX5 using the new header file (Dirk Hohndel).
- 492. Fixes for a.out loader (#74-76, Matthieu Herrb).
- 491. More fixes for libc_wrapper.c (#73, Michael Rohleder).
-
-XFree86 3.2Ah (23 February 1997)
- 490. Some a.out loader updates for Linux/a.out (#72, Harald Koenig).
- 489. Add support for cross compilation of modules in the Imake rules
- (#71, Holger Veit).
- 488. Add a subset of xf86stdio functions to libc_wrapper.c (#71, Holger Veit).
- 487. Make the I128 driver loadable (#65,66,70, Robin Cutshaw).
- 486. Fix et4000 driver compile problems for vga2 and vga16
- (#69, Koen Gadeyne).
- 485. Fix 8x8 patterns for TGUI chips (#68, Alan Hourihane).
- 484. Fix direct reference to memset() (#67, Harald Nordgard Hansen).
- 483. Gnu parallel make update for loadable server (#64, H.J. Lu).
- 482. Include the summasketch support explicitly in xf86Xinput.c when
- not using dynamic modules (#63, Christer Nilsson).
- 481. Loader support for OS/2-style a.out (#62, Sebastien Marineau).
- 480. Fix nested asm calls in tseng_cursor.c (#61, Takaaki Nomura).
- 479. Add a timeout to the C&T blitter wait loop, and reset the blitter
- when this happens (#60, David Bateman).
- 478. Add missing imake patch for massaging the results of parse_utsname()
- (#57, Chris Demetriou).
- 477. Don't define DoLoadableServer yet for non-Intel Linux platforms.
- 476. Don't refer to the PEX init function in loadmod.c when PEXEXT isn't
- defined (as is the case on Alpha platforms) (#56, Alan Hourihane).
- 475. Fix references to usleep on SVR4 (#61, Takaaki Nomura).
- 474. Fix references to snprintf on SVR4 (David Dawes).
- 473. Fix some compile problems on FreeBSD (David Dawes).
-
-XFree86 3.2Ag (19 February 1997)
- 472. Fix Imakefiles and loader problems on OS/2 (#53, Sebastien Marineau).
- 471. Fix problems with ISC and the Mach32 module (#55, Michael Rohleder).
- 470. Fix Xnest and Xvfb when DoLoadableServer is YES (Dirk Hohndel).
- 469. Clear up multiplex support on 96xx and display error message when
- requested resolution exceeds available memory with the accelerator
- engine (#52, Alan Hourihane).
- 468. Let Trio64V2 use newmmio driver (#49, Tom Angert).
- 467. First cut for ET6000 hardware cursor (#48, Dejan Ilic).
- 466. Some xf86 wrappers (#47, Craig Groeschel).
- 465. Convert PEX and XIE to be loadable with the new style loader
- (Dirk Hohndel).
- 464. Clean up configuration files to distinguish old and new style
- loading of extensions (Dirk Hohndel).
- 463. Add DPMS support (off mode only) to the P9000 server
- (#9, Karl Anders Oygard).
- 462. Add PCI probing to the P9000 server (#9, Karl Anders Oygard).
- 461. Resync PC98 Imakefiles.
- 460. Enable the loadable server for LynxOS AT (#46, Thomas Mueller).
- 459. Better fix for XF86Setup compile problems (David Dawes).
-
-XFree86 3.2Af (17 February 1997)
- 458. Fix XF86Setup/Imakefile (#45, Harald Nordgard Hansen).
- 457. Fix xdm/Imakefile for ISC (Michael Rohleder).
- 456. Fix problem with S3V and W32 modules (Dirk Hohndel).
- 455. Move module rules from xf86.rules to Imake.rules, and when building
- a module, install a link to it in xc/exports/lib/modules/ (David Dawes).
- 454. Start Elf loader for Linux/Alpha; doesn't work, yet (#44, Alan Hourihane).
- 453. Hide cursor in S3/SVGA when DGA is active (#43, Mark Vojkovich).
- 452. a.out loader for module loading (#42, Matthieu Herrb).
- 451. Extend OS support layer to cover some libc functions and update all
- drivers to use the internal functions (Dirk Hohndel).
-
-XFree86 3.2Ae (16 February 1997)
- 450. Add -showunresolved flag to server.
- 449. Add sourceAddress option to xdm (#41, Christos Zoulas).
- 448. Fix cfb8line (#40, Jeff Anton).
- 447. Turn pixmap cache in SVGA/S3 server back on and switch over to XAA for
- lines and segments (#39, Mark Vojkovich).
- 446. Fix COFF header file (#38, Stuart Anderson).
- 445. Better XKB russian keyboard support (#36, Andrey A. Chernov).
- 444. Fix an X11R6.3 problem with SCO 5 build (#35, Alan Hourihane).
- 443. Fixes for Trio64V2 (#35, Tom Angert, Harald Koenig, Xavier Ducoin).
- 442. avoid nested asm calls which cause compile errors on PANIX(SVR4) (#31,
- Takaaki Nomura).
- 441. Resync LinkKit (#26, Takaaki Nomura).
- 440. Fix some build problems when not using the new loader code
- (on FreeBSD) (David Dawes).
- 439. Stop S3 and S3V server from overwriting CR11 (#30, Harald Koenig).
- 438. Fix banking code in S3/SVGA driver (#29, Thomas Mueller).
- 437. Fix DPMS code for C&T (#28, David Bateman).
- 436. Enable left edge clipping for HiQV chips (#28, David Bateman).
- 435. Stop C&T probe from printing out messages for non C&T chips (#28,
- David Bateman).
-
-XFree86 3.2Ad (14 February 1997)
- 434. Merge Metro Link loader code and make all SVGA drivers and S3, S3V
- server loadable (Metro Link, Dirk Hohndel).
- 433. Avoid installing CVS admin files when doing 'make install' for rstart
- (#25).
- 432. Resync xfree98/SuperProbe/Imakefile.
- 431. Fix for 'xset r rate' and XF86MiscSetKbdSettings() for some OSs (#24).
-
-XFree86 3.2Ac (12 February 1997)
- 430. Fix problem with system #define Control on LynxOS (Thomas Mueller).
- 429. FreeBSD 2.2 doesn't need libz (Takaaki Nomura).
- 428. Another attempt at left edge clipping for HiQV chips (still disabled
- by default) (David Bateman).
- 427. DPMS in C&T is now enabled even when no monitor is detect (David Bateman).
- 426. Additional fixes for 65530/35 linear addressing (untested) (Egbert Eich).
- 425. Fix for the 16/24 bpp corruption in RIGHT2LEFT blits in the C&T driver
- (Egbert Eich).
- 424. Fix LinkKit and XF98_TGUI server (Takaaki Nomura).
- 423. Reenable xsetpointer, xsetmode, xsetxkbmap in programs/Imakefile.
- 422. Encapsulate arguments in C&T header files (Nozomi Ytow).
- 421. Documentation updates for ET4000, mostly about 16/24/32bpp (Koen Gadeyne).
- 420. Fix VGA2 and VGA16 that were broken in 394/395 and reenable them
- (Koen Gadeyne).
- 419. Improved resolution switching and 24bpp handling in S3V (Kevin Brosius).
- 418. Matrox detection in SuperProbe (Alan Hourihane).
- 417. Fix bug in the Type1 font code (H.J. Lu).
- 416. Autoprobe Viper PCI and DPMI support for P9000 (Karl Anders Oygard).
- 415. Use fill rect solid for horizontal lines on S3 (Mark Vojkovich).
- 414. Add 8bit dac support to MGA (Mark Vojkovich).
- 413. Add make -j support for gnu make (H.J. Lu and Craig Groeschel).
-
-XFree86 3.2Ab (11 February 1997)
- 412. Some fixes for Linux/m68k (Geert Uytterhoeven).
- 411. Add XAA S3 driver to the SVGA server (Mark Vojkovich).
- 410. Add a flag argument to the ValidMode functions (Dirk Hohndel).
- 409. Implemented (but disabled) left edge clipping for color expansion for
- HiQV chips (David Bateman).
- 408. 8x8 mono pattern fills for HiQV chips (David Bateman).
- 407. DPMS support for C&T driver (David Bateman).
- 406. Scanpci for Alpha (Robin Cutshaw).
- 405. Fix clock clock limits for trident driver (Alan Hourihane).
- 404. 9420/9430 acceleration - not tested, only partial, too (Alan Hourihane).
- 403. DPMS support for the Trident driver (Alan Hourihane).
- 402. 24/32bpp support for Trident chipsets (Alan Hourihane).
- 401. Trident support for the Alpha platform (Alan Hourihane).
- 400. Add DPMS to et4000 driver of the SVGA server (Harald Nordgard Hansen).
- 399. Fixes and addition to the acceleration for W32 and ET6000 (Koen Gadeyne).
- 398. Chrontel RAMDAC support for W32 in SVGA server (Kurt Olsen).
- 397. Hardware Linedraw support for ET6000 and ET4000W32p (Koen Gadeyne).
- 396. Add memory bandwidth as a concept to the W32 RAMDAC code (Koen Gadeyne).
- 395. Move W32/ET6k clock setting functions into tseng_clock.c. This together
- with change 394 breaks the W32 server and the et4000 driver in the
- VGA2 and VGA16 server (all those are disabled by default for now)
- (Koen Gadeyne).
- 394. Move RAMDAC support from W32 server in SVGA server and added
- accelerated 16/24/32 bpp support for ET4000/W32p (Koen Gadeyne).
-
-XFree86 3.2Aa (10 February 1997)
- 393. Much additional acceleration for the HiQV chips (David Bateman).
- 392. Print the PCI retry setting in MGA server (Radoslaw Kapitan).
- 391. OpenBSD fixes (Matthieu Herrb).
- 390. Small fix for doc naming.
- 389. Fix 24bpp clock limit for ViRGE (Harald Koenig).
- 388. Fix 16bpp 6554x 8x8 pattern fill problem (David Bateman).
- 387. Fix core dump in C&T driver (Egbert Eich).
-
-XFree86 3.2A (28 January 1997)
- 386. Updates to the OS/2 pipe xtrans code (Sebastien Marineau).
- 385. Update the max clock for the TGUI ProVidia 968x (Alan Hourihane).
- 384. Disable memory interleaving before restoring the text font info
- for the MGA driver. This fixes font corruption that shows up
- in Alpha platforms (Jay Estabrook).
- 383. Fix some document formatting problems.
- 382. Enable MMIO by default for TGUI chips when acceleration is enabled.
- It can be disabled with the "no_mmio" option.
- 381. Fix problems with the Trident driver in 16-colour mode (Alan Hourihane).
- 380. Back out change 370 because it is obsoleted by change 373.
- 379. Fix 369 was missing, and is now included.
- 378. OS/2 updates (including documentation) (Holger Veit).
- 377. Add bitblt acceleration for 16 and 32bpp for the I128 server
- (Robin Cutshaw).
- 376. Tseng doc update (Koen Gadeyne).
-
-XFree86 3.2y (26 January 1997)
- 375. I128 accel fix (Robin Cutshaw).
- 374. Update Japanese version of documentation to 3.2 (Kazuyuki Okamoto).
- 373. Fix 8x8 pattern acceleration for ET6000 (Koen Gadeyne).
- 372. Fix an optimisation/volatile problem with the I128 accel code
- (Robin Cutshaw).
- 371. Fix the clearing of video memory in the SVGA server when the linear
- base address has been offset (Jay Estabrook).
- 370. Disable 8x8 pattern acceleration for ET6000 (Harald Nordgard Hansen).
- 369. Fix stippled/tiled lines (segments) (Harm Hanemaayer).
- 368. Update the LinkKit for recent I128 server changes (Takaaki Nomura).
- 367. Fix display of 8bit characters in xterm (when in VT100 mode)
- (Thomas E. Dickey).
- 366. m68k server updates (Geert Uytterhoeven).
- 365. Matrox doc updates (Andrew Vanderstock).
- 364. Update Mach64 docs (Kevin Martin).
- 363. Fix a ELSA Winner 2000PRO/X-8 initialisation problem that shows up
- after running a certain other X server (Harald Koenig).
- 362. Fix a PC98 TGUI problem when using XAA colour expansion (Kazunori Ueno).
-
-XFree86 3.2x (23 January 1997)
- 361. Remove some XAA debugging messages (David Bateman).
- 360. Preliminary I128 bitblt acceleration using XAA (Robin Cutshaw).
- 359. NetBSD doc updates (Matthieu Herrb).
- 358. Fix a problem with specifying the chipset as "et6000" with the W32
- server (Koen Gadeyne).
- 357. Fix for XAA bitmap problem which showed up with the C&T driver, and
- With this fixed, change 339 has been backed out (David Bateman).
- 356. Update clock limits for the PC98 TGUI server (Akio Morita).
- 355. PC98 documentation update (Akio Morita).
- 354. Tseng doc updates (Koen Gadeyne).
- 353. Add NO_PLANEMASK to the Tseng XAA colorexpansion flags (Koen Gadeyne).
- 352. LynxOS doc updates (Thomas Mueller).
- 351. Fix some unaligned access problems with pixmap data that show up on
- Alpha platforms (Jay Estabrook).
- 350. Fix a problem with passing the depth/weight specified on the
- server command line in some situations (Harald Koenig).
- 349. Add support for the S3 Aurora64V+ programmable clock, which is slightly
- different from the Trio64 (Harald Koenig).
- 348. Blank the screen before turning off the sync signals for the WD90C24
- DPMS support (Brad Bosch).
- 347. Change 341 was missing, and is now included.
- 346. Don't accelerate XAA functions which use source bitmap data when
- the rop is GXclear, GXnoop, and GXset (as well as GXinvert)
- (Harm Hanemaayer).
- 345. S3V doc updates (Kevin Brosius).
- 344. S3 doc updates (Harald Koenig).
- 343. Remove some experimental code in XF86Setup that was causing it
- to fail when starting the first server (Joe Moss).
-
-XFree86 3.2w (22 January 1997)
- 342. Update the xset man page for the DPMS additions.
- 341. Updates to TGUI acceleration, to hopefully fix some problems that
- show up with xtest (Alan Hourihane).
- 340. Add recognition of some other TGUI Cyber chipset codes (Alan Hourihane).
- 339. Enable 8x8 mono pattern fills for C&T 65545, and limit colour expansion
- to GXCOPY_ONLY to avoid some crashes when running things like
- xengine and xdvi (David Bateman).
- 338. Fix various Chips & Tech display problems for 6554x, 65550 and
- 64300 chips (Egbert Eich).
- 337. Fix some XAA-related xtest errors (Harm Hanemaayer).
- 336. Enable the "no_accel" flag for the ET6000 (Koen Gadeyne).
- 335. When the "et6000" chipset is specified, use the port-probed value
- for the membase rather than getting it from the PCI info (Koen Gadeyne).
- 334. Tseng documentation updates (Koen Gadeyne).
- 333. Cirrus documentation updates (Harm Hanemaayer).
- 332. Add README.SiS (Xavier Ducoin).
- 331. Temporary workaround for Mode_switch problems when using XKB and
- Latin1 charset (Matthieu Herrb).
-
-XFree86 3.2v (20 January 1997)
- 330. Added rules to use FreeBSD's sgmlfmt tool to format Linuxdoc/sgml
- docs -- but this needs more work.
- 329. Blank the screen before setting a DPMS mode (Leonard N. Zubkoff).
- 328. Fix sync disabling for DPMS for the S3 (and S3V) server (Robert Wilhelm).
- 327. Change the .name parameter of the S3V server to "S3V" (Kevin Brosius).
- 326. Improve S3V 24bpp mode switching (still has some problems)
- (Kevin Brosius).
- 325. Disable 32bpp for the S3V server (not supported) (Kevin Brosius).
- 324. Fix S3V aspect ratio problem at 24bpp (Kevin Brosius).
- 323. Fix rotation direction of 8x8 mono patterns in XAA (David Bateman).
- 322. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
- 321. Another fix for 5446 clocks higher than 85 MHz (Harm Hanemaayer).
- 320. When a clocks line is specified in the XF86Config file for the
- cirrus driver, ignore it rather that insisting on its removal
- (Harm Hanemaayer).
- 319. Remove artificial limit for LCD dot clock for Cirrus 754x chips
- (Harm Hanemaayer).
- 318. Fix a problem with default cirrus MMIO operation (Harm Hanemaayer)
- 317. Improved acceleration support at 24bpp for the Ark driver
- (Harm Hanemaayer).
- 316. Ark documentation updates (Harm Hanemaayer).
- 315. Enable "slow_dram" in the tseng driver for cards below W32i
- (Koen Gadeyne).
- 314. Fix a tseng driver typo (missing braces) which was causing linear
- mode to incorrectly disable acceleration for the ET6000 (Dejan Ilic)
- 313. Fix a tseng driver bug which was causing a system hang because
- "fast_dram" wasn't completely disabled (Dejan Ilic).
- 312. Fix a tseng driver bug which causes a server crash when the chipset
- "et6000" is specified for the SVGA server (Koen Gadeyne).
- 311. Some more W32i accel code, but disabled because it doesn't yet
- work (Koen Gadeyne).
- 310. Fix for ET6000 24bpp MULBPP optimisation (Harald Nordgard Hansen).
- 309. Tseng documentation updates (Koen Gadeyne).
- 308. Cirrus documentation updates (Corin Anderson).
- 307. Updates for TGUI96xx hw cursor (8bpp, 16bpp), and PC98 TGUI card
- list (Akio Morita).
- 306. Fix build TGA compile problem and xdm build problem on Linux/Alpha
- (Robin Cutshaw).
-
-XFree86 3.2u (19 January 1997)
- 305. Only show the "extension not loaded" messages for the first
- server generation.
- 304. Don't allow DPMS to be switched if the Xserver's VT isn't active
- (Leonard N. Zubkoff).
- 303. Implement DPMS "off" support for the WD90C24, for LCD, CRT or both
- (Brad Bosch).
- 302. Add a missing DPMSExtension #ifdef in os/WaitFor.c (Corin Anderson).
- 301. Fix an XAA bug with mono patterns, SCREEN_ORIGIN, and PROGRAMMED_ORIGIN
- (Corin Anderson).
- 300. Implement monochrome pattern fill for Cirrus Laguna chips
- (Corin Anderson).
- 299. Disable "fast_dram" for the ET6000 because it can cause serious
- problems (Koen Gadeyne).
- 298. Disable "power saving" in the Tseng driver because the current
- way of doing it causes memory corruption (Koen Gadeyne).
- 297. Disable linear mode and acceleration for Tseng chips that have
- not been tested or which are not supported (Koen Gadeyne).
- 296. Add some code to treat the ET6000 slightly differently when the
- chipset is specified in the XF86Config file, to help the case
- when another (disabled) PCI video card is detected (Koen Gadeyne).
- 295. Use triple-buffering for colour expansion in the tseng driver
- (Koen Gadeyne).
- 294. Make some variables in the tseng driver static (Koen Gadeyne).
- 293. Remove some asm stuff in the tseng driver, and add a C optimised
- MULBPP calculation (Koen Gadeyne).
- 292. Disable XAA framebuffer concurrency in the tseng driver, which
- hides most of the text corruption problems (Koen Gadeyne).
- 291. Man page (DPMS) and documentation (MGA) updates (Leonard N. Zubkoff).
- 290. Fix invalid modelines in XF98Conf.cpp (Takaaki Nomura).
- 289. Add checking of mode size against video memory requirements to the
- Mach32 and Mach64 servers.
- 288. Fix GXnor and GXnand ROP definitions for the TGUI driver.
- 287. Update for Linux a.out libX11's jump_ignore (Harald Koenig).
- 286. Fix (?) TGA server link problem.
-
-XFree86 3.2t (18 January 1997)
- 285. Update W32 docs (Dirk Hohndel).
- 284. Recognise "noaccel" and "slow_dram" options in the ET4000 driver
- (Dirk Hohndel).
- 283. Fix problem with not truncating pixel values in the MGA driver
- (Dirk Hohndel).
-
-XFree86 3.2s (18 January 1997)
- 282. Fix a problem with xdm's sessreg and utmp on Linux (Leonard N. Zubkoff).
- 281. Fix a plane-enable bug for Cirrus 754x (Corin Anderson).
- 280. Don't use teblt code for depths other than 8 for Cirrus 754x
- chips (Corin Anderson).
- 279. Implement programmable pattern offset using XAA, add support for
- plane masks and fix sum bugs for Cirrus Laguna chips (Corin Anderson).
- 278. Don't check the PCI command FIFO for Cirrus Laguna chips
- (Corin Anderson).
- 277. Add XAA support to the SiS driver. The old code can be reverted
- to at runtime with the "noaccel" option (Xavier Ducoin).
- 276. Add recognition of XAA options as valid options for the SVGA
- server (Alan Hourihane).
- 275. Add "please report" messages when S3 Trio64V2, Trio64UV+ or
- Aurora64V+ chips are detected (Harald Koenig).
- 274. Add undocumented options to XF86Config to allow a numerical ChipID
- and ChipRev to be specified (used by the S3 and S3V servers)
- (Harald Koenig).
- 273. Attempt to fix false detection of RGB524 ramdac as RGB528
- (Harald Koenig).
- 272. Make sure x coordinate doesn't overflow into the y coordinate
- for some MGA operations (Xavier Ducoin and Radoslaw Kapitan).
- 271. Don't write high order CRTC vertical bits for Trident chips earlier
- than TGUI9440AGi (Alan Hourihane).
- 270. Fix an error in koi8-r charset switching code (Andrey Chernov).
- 269. Disable acceleration for TGUI Cyber chips (Alan Hourihane).
- 268. Fix register access in Cirrus 754x LCD size detection (Harm Hanemaayer).
- 267. Add support for the "no_stretch" option for Cirrus 754x chips
- (Harm Hanemaayer).
- 266. Enable MMIO by default for Cirrus 543x/4x chips, and add a "no_mmio"
- option to allow it to be disabled (Harm Hanemaayer).
- 265. Disable PCI burst mode on the TGUI by default, but allow it to be
- turned on with options (Alan Hourihane).
- 264. Update max clocks for the TGUI 96xx chips (Alan Hourihane).
- 263. Fix centre/stretch TGUI LCD problems (Alan Hourihane).
- 262. Add Option "tgui_mclk_66" to force MCLK to 66 MHz (Alan Hourihane).
- 261. Fix TGUI Cyber detection problems (Alan Hourihane).
- 260. Flush MGA "direct access read cache" in MgaSync(), which fixes
- problems reading directly from the framebuffer after accelerated
- operations (Radoslaw Kapitan).
- 259. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
- 258. Updates for LynxOS 2.5.0 (Thomas Mueller).
- 257. Fix xterm text highlighting when the window it partly off-screen
- (Thomas E. Dickey).
- 256. Remove the GetSaver/SetSaver functionality from the client
- side of the XFree86-Misc extension, but leave dummy support in
- the server side for now to avoid breaking old clients
- (Leonard N. Zubkoff).
- 255. Implement hw-specific DPMS support for servers/drivers which already
- had an old implementation, adding support for Standby mode where
- possible, and adding a StandbyTime keyword for the XF86Config
- file (Leonard N. Zubkoff).
- 254. Fix some problems with the original DPMS extension behaviour
- (Leonard N. Zubkoff).
- 253. Possible speedup for S3V polypoint code (Harald Koenig).
- 252. Disable C&T 65550 acceleration features that weren't present
- in 3.2 (David Bateman).
- 251. Fix a C&T 24bpp pattern fill problem (David Bateman).
- 250. Make the XAA C&T code independent of the old acceleration code
- (David Bateman).
- 249. Recognise the Alliance AT24, but treat the same way as a 6442
- (Joe Moss).
- 248. Add detection for newer TGUI chipsets to SuperProbe (Alan Hourihane).
-
-XFree86 3.2r (14 January 1997)
- 247. Use some extra XAA flags in the MGA acceleration (Radoslaw Kapitan).
- 246. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
- 245. Fix DAC register for > 85 MHz mode on Cirrus 5446 (Harm Hanemaayer).
- 244. Memory config fix for 2MB Cirrus 7543/8 and fix 754x LCD size detection
- (Harm Hanemaayer).
- 243. Fix a problem in Imake.rules that causes problems when using bash
- (Leonard N. Zubkoff).
- 242. Fix some server prototyping problems (Thomas E. Dickey).
- 241. Detect the Trio64UV+, Trio64V2 and Aurora64V+, and handle them
- as a Trio64V+ (Harald Koenig).
- 240. Add preliminary support for the ELSA Winner 2000PRO/X-8 (S3 968,
- IBM RGB528A, 8MB VRAM 250 MHz) (Harald Koenig).
- 239. Fix retrace waits in the MGA driver (Radoslaw Kapitan).
- 238. Enable CPUToScreen colour expansion for the TGUI driver (Alan Hourihane).
- 237. Add an options "lcd_center" to the TGUI driver for Cyber chips
- (Alan Hourihane).
- 236. Some S3V updates, including combining s3dline.c and s3dseg.c,
- moving planemask/colour conversion into a separate module,
- add FillSolid, improve speed of s3plypt.c, and enable some
- previously disable functions (Berry Dijk).
- 235. Updates for ISC support (Michael Rohleder).
- 234. Disable ExportLists for Solaris versions older than 2.5.
- 233. Fix for C&T 8x8 pattern fills (David Bateman).
- 232. LinkKit fix (SiS driver) (Takaaki Nomura).
- 231. Fix for XAA colour expansion when using FIXED_BASE (Koen Gadeyne).
- 230. ET6000 accel updates and optimisations (Koen Gadeyne).
- 229. Add code to the MGA driver to set MCLK based on the values
- stored in the BIOS and the memory size (Andrew E. Mileski).
-
-XFree86 3.2q (12 January 1997)
- 228. Make makedepend recognise #warning on all OSs (since we have it
- in shm.h).
- 227. Add Digital's DPMS server extension (no device-specific support yet).
- 226. Fix some compile problems on Solaris x86 2.4 with gcc (James Hawtin).
- 225. Add prelim support for LCD stretching with the TGUI Cyber chips
- (Alan Hourihane).
- 224. Add support for some blitter functions to the SiS driver (not XAA
- yet) (Xavier Ducoin).
- 223. Fix HW cursor problems in the SiS driver (Xavier Ducoin).
- 222. Add 15/16/24bpp support to the SiS driver (Xavier Ducoin).
- 221. Fix problems with linear mode in the SiS driver (Xavier Ducoin).
- 220. Programmable clock support for the SiS 205 (Xavier Ducoin).
- 219. TGUI acceleration updates (Alan Hourihane).
- 218. Add XAA support for the Chips & Technologies driver (David Bateman).
- 217. Support for 555 weighting in the MGA driver (Xavier Ducoin).
- 216. TGUI clock fix (Alan Hourihane and Massimiliano Ghilardi).
- 215. VGA server compiler warning fixes (Thomas E. Dickey).
- 214. LinkKit fixes (Takaaki Nomura).
- 213. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
- 212. The item 203 fix was missing. It is included now.
- 211. Modify Cirrus 754x LCD size detection (Harm Hanemaayer).
- 210 Add support for pattern offset for the Cirrus 5446 (Harm Hanemaayer).
- 209. Fix non-MMIO operation for the Cirrus 5446 (Harm Hanemaayer).
- 208. Fix font cache problem introduced in 3.2p (Takaaki Nomura).
-
-XFree86 3.2p (8 January 1997)
- 207. XAA support for the Cirrus Laguna chips (Corin Anderson).
- 206. Modify the PF1-PF4 coding in the xterm termcap/terminfo, and add an
- interim xterm-vt220 description to accommodate the old and new styles
- (Thomas E. Dickey).
- 205. Combine the coding for foreground and background colours in xterm
- into a single byte (Thomas E. Dickey).
- 204. Some optimisations and transparent 8x8 pattern tiling for the ET6000
- driver (Koen Gadeyne)
- 203. Parallel make fix for lbxproxy (Robin Cutshaw).
- 202. LinkKit fixes (David Bateman).
- 201. Defining XF86ExpireServer to YES in host.def allows easy enabling
- of server expiry.
- 200. The item 176 fix was missing. It is included now.
- 199. Fix an Xlib problem with non-8859-1 locales (Kaleb Keithley).
- 198. Set default hsync and vsync polarity for the MGA driver in the same
- way as other servers (Leonard N. Zubkoff).
- 197. Fix sync polarity in MGA driver (Radoslaw Kapitan).
- 196. Add DGA support to the MGA driver (Mark Vojkovich).
- 195. Some xterm cleanups (Thomas E. Dickey).
- 194. Implement DECSTR (soft terminal reset) for xterm (Thomas E. Dickey).
- 193. Fix some unaligned accesses in cfb16SegmentSS1RectCopy() on Alpha
- (Harald Koenig).
- 192. 8x8 colour expand patterns for MGA (Radoslaw Kapitan).
- 191. Fix various compiler warnings in the S3 server (Thomas E. Dickey).
- 190. Fix TRANS_ENABLE definition for the TGUI driver (Alan Hourihane).
- 189. Fix a problem with the location of ident lines in the tclIndex file
- (Joe Moss).
-
-XFree86 3.2o (5 January 1997)
- 188. Add MIPS/Arc support to build the S3 server on OpenBSD (Per Fogelstrom).
- 187. Split OpenBSD config support out into a new OpenBSD.cf file
- (Matthieu Herrb).
- 186. Split the retrace wait out into a separate function in the S3
- server (Mark Vojkovich).
- 185. Fix a problem with FIFO setting for Mach64 chips with an
- integrated DAC (Kevin Martin).
- 184. Fix a pixmap corruption problem that shows up on Mach64 [CVG]T chips
- (Kevin Martin).
- 183. Disallow block write mode for [CVG]T Mach64 chips (Kevin Martin).
- 182. Fix a problem for Mach64 CT-D cards where the server writes to the
- wrong I/O address, possibly that of another PCI device (Kevin Martin).
- 181. Fix Rage II support in the Mach64 server (Kevin Martin).
- 180. Add preliminary XAA support for the TGA server (Alan Hourihane).
- 179. Don't compile Xprint/Xrm.c because it is already included in
- attributes.c (Holger Veit).
- 178. Various updates for OS/2 (Holger Veit).
- 177. Fix some typing problems in xf86expblt.c (Alan Hourihane).
- 176. Fix XAA crash for drivers that don't fill in the ServerInfoRec
- (Harm Hanemaayer).
- 175. Add DPMS support for the MGA driver (Leonard N. Zubkoff).
- 174. Add sync-on-green support to the MGA driver (Leonard N. Zubkoff).
- 173. Add support for display modes that require more than 4MB on
- Millennium cards (Leonard N. Zubkoff).
- 172. Enable acceleration support for the Trident 9320LCD chips
- (Alan Hourihane).
- 171. Add parallel make support for the lbxutil Imakefile (Robin Cutshaw).
- 170. Fix a problem with the Xmark script (Andrew E. Mileski).
-
-XFree86 3.2n (3 January 1997)
- 169. Fix some xaa build problems on some platforms.
- 168. Updates to NetBSD.cf, including auto-detection of ELF (Chris Demetriou).
- 167. Add I128 series II detection to scanpci and SuperProbe (Robin Cutshaw).
- 166. Fix a problem in sun.cf (Robin Cutshaw).
-
-XFree86 3.2m (2 January 1997)
- 165. Fix some problems creating Xserver links in XF86Setup (Dirk Hohndel).
- 164. Update to R6.3 public patch 1.
- 165. XAA updates (Harm Hanemaayer).
- 163. Fix problems with out-of-date cirrus_acl.c (Harm Hanemaayer).
- 162. Move all default settings from xf86site.def to xfree86.cf, and leave
- xf86site.def containing only commented out definitions.
- 161. Fix 'make install' problems in xkbcomp.
- 160. Fix some ZLIB problems.
-
-XFree86 3.2l (31 December 1996)
- 159. Tseng acceleration updates (Koen Gadeyne).
- 158. Add config support for using the system's standard version of libz
- when it exists (Chris Demetriou).
- 157. Add rules for ELF shared libraries on BSD (Chris Demetriou).
- 156. Recognise __alpha__ as AlphaArchitecture for NetBSD, and treat
- __alpha__ the same way as __alpha is various part of the code
- (Chris Demetriou).
- 155. Update NetBSD config file (Chris Demetriou).
- 154. Add code to dynamically recognise NetBSD versions in imake, and
- add defines to allow massaging of the information returned by
- uname Chris Demetriou).
- 153. Fix inconsistent usage of malloc/xalloc/Xalloc in the Xprt server.
- 152. Fix segfault at startup of clients linked with libICE on SVR4.0
- 151. Add detection for the 250MHz ramdac used on the PowerDoc Edition
- variant of the Matrox Millennium (Dirk Hohndel).
- 150. Fix some compile/cpp warnings (Marc Aurele La France).
- 149. Add support to makedepend for the '^' and '? :' operators
- (Marc Aurele La France).
- 148. Change GZIP to GZIPCMD in Makefiles because of a conflict with
- an environment variable used by gzip (Marc Aurele La France).
- 147. Fix make depend problem for xdm-shadow (Marc Aurele La France).
- 146. Update Linux a.out support for R6.3 (Harald Koenig).
- 145. Trident doc updates (Alan Hourihane).
- 144. TGUI solidfill updates (Alan Hourihane).
- 143. XC fixes.
-
-XFree86 3.2k (28 December 1996)
- 142. Fix a problem introduced in 3.2i which causes the S3 server to crashed
- for cards with a Ti3026.
- 141. Updates for GNU libc on Linux, and fix some compile warnings
- (H.J. Lu).
- 140. Updated Russian XKB layout (Andrey Chernov).
- 139. Workaround for KOI8-R problem in XmbLookupString(). The change
- is to XLC_XLOCALE/koi8-r (Andrey Chernov).
- 138. Fix some problems with the server build on Alphas (Jay Estabrook).
- 137. Avoid a server hang in the et4000 driver (Koen Gadeyne).
- 136. Add some more acceleration for ET4000 chips (Koen Gadeyne).
- 135. Fix server crash when chipset "et6000" is specified (Koen Gadeyne).
- 134. Cleanup of vgaHW.c (Marc Aurele La France).
- 133. In the vga2 server, use the bank size, not the aperture size, to
- decide between banked and non-banked support (Marc Aurele La France).
- 132. Fix to FIFO depth calculation in the Mach64 server
- (Marc Aurele La France).
- 131. Fix some problems with the width of the pixmap used by the VGA servers
- when the server's VT isn't active (Marc Aurele La France).
- 130. Major ati SVGA driver updates (Marc Aurele La France).
- 129. Fix Xserver/Imakefile problem that sometimes causes problems with
- cfb24 not being built (Marc Aurele La France).
- 128. Fix some compiler warnings (including a problem with the ScreenInfoRec
- initialisation in the I128 server) (Marc Aurele La France).
- 127. Updated PC98 TGUI support (Akio Morita).
- 126. Add MMIO support to the TGUI driver, and remove MCLK limits
- (Alan Hourihane).
- 125. Add pa, Sf, Sb capabilities to the xterm termcap.
- 124. Add Tcl interfaces for the new vidmode functions (Joe Moss).
- 123. Complete the implementation of XF86VidModeAddModeLine() (Joe Moss).
- 122. Some more s3init.c cleanups (Mark Vojkovich).
- 121. XC fixes.
- 120. More R6.3-related updates.
-
-XFree86 3.2j (26 December 1996)
- 119. Integrate X11R6.3 (pre-release) source base.
-
-XFree86 3.2i (20 December 1996)
- 118. Some general cleanups (Stuart Anderson, Dirk Hohndel).
-
-XFree86 3.2h (20 December 1996)
- 117. Fix a "void * used in arithmetic" warning in lnx_video.c.
- 116. Allow the XInput "AlwaysCore" feature to be controlled dynamically
- via an "integer feedback" (Frederic Lepied).
- 115. Fix TGUI clock programming problems (Alan Hourihane).
- 114. Fix clock scaling with ClockChip "cirrus" (Harm Hanemaayer).
- 113. Fix some compile problems on SVR4 (Takaaki Nomura).
-
-XFree86 3.2g (19 December 1996)
- 112. Separate the function prototypes out of xf86_OSlib.h (Stuart Anderson).
- 111. Fix for change 97 (which was causing a server startup problem)
- (Harald Koenig).
- 110. Enable accelerated copy plane for 24bpp in XAA.
- 109. Fix some compile problems related to the recent Cirrus changes.
-
-XFree86 3.2f (18 December 1996)
- 108. Enable the XAA driver for cirrus chips with a BitBLT engine and
- the driver for Laguna family chips (Harm Hanemaayer).
- 107. Modify the support for dot clocks > 85 MHz on the 5436/46
- (Harm Hanemaayer).
- 106. Fix 24bpp support for the CL-GD5430 (Harm Hanemaayer).
- 105. Add optimized support for the CL-GD5446 to the XAA driver
- (Harm Hanemaayer).
- 104. When a PCI cirrus chip is detected, enable linear addressing by default
- (Harm Hanemaayer).
- 103. Better LCD control settings for CL-GD754x for different LCD sizes,
- and improve 754x LCD type detection (Harm Hanemaayer).
- 102. Modify CRT FIFO threshold setting for the CL-GD7548 (Harm Hanemaayer).
- 101. Don't treat the CL-GD7543 as an Alpine-family chip (Harm Hanemaayer).
- 100. XAA updates (see the NOTES file in the xaa directory for details)
- (Harm Hanemaayer).
- 99. Support for sharing the core pointer between multiple XInput devices
- (Frederic Lepied).
- 98. XAA support for the ET6000 (Koen Gadeyne).
- 97. Fix an S3 server crash caused by an off-by-one access when displaying
- images (Harald Koenig).
- 96. Updates to LynxOS support for 2.5.0 (Thomas Mueller).
- 95. Add a "pc104" XKB layout for keyboards with the extra "Windows" keys
- (Joe Moss).
- 94. Fix for problem clearing "chordmiddle" flag from XF86Setup (Joe Moss).
- 93. Ti3026 clock programming updates for the MGA driver (Andrew E. Mileski).
- 92. A general s3init.c cleanup and modularization. This isolates
- ramdac register save/restore functions, and moves them into
- s3ramdacs.c (Mark Vojkovich).
- 91. Fix S3 server lockup due to vsync wait when power-saving mode is
- active (Xavier Ducoin).
- 90. PC98 LinkKit updates (Takaaki Nomura).
-
-XFree86 3.2e (12 December 1996)
- 89. Fix some TGUI clock programming problems (Massimiliano Ghilardi).
- 88. Disable <ctrl><alt><backspace> when in DGA mode (Mark Vojkovich).
- 87. Fix some XAA-related server link problems (Marc Aurele La France).
- 86. Fix some LinkKit problems (David Bateman and Takaaki Nomura).
- 85. Fix some more implicit typing in function declarations (Andreas Schwab).
- 84. Add some more ELSA cards to the Cards file (Harald Koenig).
- 83. Fix the ICS5342 clock limit (Harald Koenig).
- 82. Fix typos in the mga Alpha support.
- 81. Fix a typo in the XThrStub Imakefile (H.J. Lu).
- 80. Resync the PC98 Imakefiles (Takaaki Nomura).
-
-XFree86 3.2d (9 December 1996)
- 79. Updates to SCO Open Server 5 support (Tom Angert and J Kean Johnston).
- 78. Add support for Linux C library version 6 (GLIBC), and fix some
- prototype problems (H.J. Lu).
- 77. Add Alpha support for the mga driver (SVGA server), and generic
- driver (Mono/VGA2 server) (Jay Estabrook).
- 76. Fix s3ReadImageBanked() with a planemask (Harald Koenig).
- 75. Add fast bitblt support for the mga driver (Radoslaw Kapitan).
- 74. Allow probing of the Bt485 when an S3 968 is detected (Mark Vojkovich).
- 73. Fix an integer overflow in the S3V server when drawing long lines
- (Harald Koenig).
- 72. Add detection of the Alliance ProMotion chips to SuperProbe
- (Joe Moss).
- 71. XAA updates (including disabling non-TE text acceleration)
- (Harm Hanemaayer).
- 70. Fix pixmap support in XAA (Harm Hanemaayer and Alan Hourihane).
- 69. Update the device-specific XF86Config parsing support to report
- unknown keyword and options (Egbert Eich).
- 68. Add another check for the fb base address in the S3 server
- (Harald Koenig).
- 67. Fix some typos in the SuperProbe Imakefile (Harald Koenig).
- 66. Update the AXP/IO Jensen support (David Mosberger).
- 65. Add code to the S3 server to recognise the ELSA 1000PRO/X
- (Harald Koenig).
- 64. Fix an initialisation problem for Diamond ViRGE/VX cards, which
- causes a lockup (Harald Koenig).
- 63. Add support for the STREAMS processor to the S3V server (Kevin Brosius).
- 62. Fix a problem in xf86bench.c for OS/2 (Holger Veit).
- 61. Some mga line fixes (Radek Kapitan).
- 60. Chips & Technologies driver updates (includes support for the
- 64200 and 64300 WinGine series of chips, and the 65525 and 65535
- chips) (David Bateman and Egbert Eich).
- 59. Fix some problems with the new S3 probe code (Mark Vojkovich).
- 58. Allow xterm to output 8-bit characters in VT100 mode (Matthieu Herrb
- and Thomas Dickey).
- 57. Add a return value to XF86DGAGetVideo() (Mark Vojkovich).
- 56. Add missing write_mem_barrier definitions (Harald Koenig).
- 55. Fix some compile problems with 3.2c.
-
-XFree86 3.2c (24 November 1996)
- 54. Fix some potential buffer overflows in SuperProbe, and don't
- install it setuid root (Marc Slemko).
- 53. Add support for driver-specific parsing of the XF86Config file's
- Device section (Egbert Eich).
- 52. Fix S3 virtual resolution handling problem introduced in 3.2a
- (Mark Vojkovich).
- 51. Add a '-nolisten' flag to the X server to allow disabling of
- a transport type (Nathaniel D. Daw).
- 50. Update Imake.rules to do better error recovery for missing
- directory or Makefiles (Thomas E. Dickey).
- 49. Add REP (repeat) control for xterm (Thomas E. Dickey).
- 48. XAA updates (Harm Hanemaayer).
- 47. Add required changes for the PC98 servers to build using XAA
- (Takaaki Nomura).
- 46. Fix an unaligned access in cfb (Harald Koenig).
- 45. Add support for Alpha Jensen (EISA) using sparse memory MMIO
- (Martin Ostermann).
- 44. Add working "newmmio" support for AXP (Harald Koenig).
- 43. Add some memory barriers to the ViRGE server for AXP (Harald Koenig).
- 42. Reset the ViRGE (but not ViRGE/VX) GE while reading the BIOS to avoid
- text font corruption (Harald Koenig).
- 41. Change the S3 ViRGE default base address when PCI config registers
- can't be accessed (mainly for AXP) (Harald Koenig).
- 40. S3 ViRGE/VX fix (Harald Koenig).
- 39. Patch for mk68 servers (Geert Uytterhoeven).
- 38. Add detection for the S3 Aurora64V+ and Trio64UV+ (Harald Koenig).
- 37. Replace the truncated files in xterm/tektests with full versions
- (from color_xterm) (Thomas E. Dickey).
- 36. Add some more MGA line code (Andrew Vanderstock).
- 35. Add some MGA macros, especially for access type setting
- (Radoslaw Kapitan).
- 34. Add MGA screen-to-screen color expansion (not used yet)
- (Radoslaw Kapitan).
-
-XFree86 3.2b (20 November 1996)
- 33. Fix some compilation problems with 3.2a.
- 32. Fix DGA fb mapping for SVR4 (Richard Coley).
- 31. Fix Hercules mono driver text bug (H.J. Lu).
-
-XFree86 3.2a (18 November 1996)
- 30. Bump default FreeBSD version to 2.1.6.
- 29. TGUI driver updates for PC98 (Akio Morita).
- 28. Fix trident driver compile problem with VGA2 and VGA16 servers
- (Takaaki Nomura).
- 27. XAA support for the Trident driver (Alan Hourihane).
- 26. Add VT52 emulation to xterm (Thomas E. Dickey).
- 25. Fix a missing resets to groundstate in xterm (Denis Auroux and
- Thomas Dickey).
- 24. Improve overflow problem in XAA internal benchmarking
- (Akio Morita).
- 23. XAA support for the mga driver (Radoslaw Kapitan and the Matrox team).
- 22. XAA support for the Cirrus BitBLT and Laguna chips (but not enabled
- yet) (Harm Hanemaayer).
- 21. XAA support for the ARK driver (Harm Hanemaayer).
- 20. A new acceleration interface (XAA) for the SVGA server (Harm Hanemaayer).
- 19. S3V s3plypt.c changed to use GE, but is slower so still disabled
- (Harald Koenig).
- 18. Change the S3V GE reset to avoid lockups (Harald Koenig).
- 17. Add WaitIdle() at the end of S3V accel routines to avoid screen
- corruption from direct fb access while the GE is still active
- (Harald Koenig).
- 16. Remove unsupported option flags from the S3V server (Harald Koenig).
- 15. Allow large S3 cursors by switching to SW cursor when required
- (Harald Koenig).
- 14. Fix S3 frame buffer probing and memory leak (Harald Koenig).
- 13. Fix S3 ReadImage with a planemask (when ReadImageNoMem can't be used)
- (Harald Koenig).
- 12. S3 line and text fixes (Harald Koenig).
- 11. Fix DGA colourmap problems in the W32 server.
- 10. Fix a problem with realloc usage in xrdb for some older OSs
- (eg, SunOS 4.x) (Wolfgang Rupprecht).
- 9. Fix an xrdb malloc problem (Michael Lipp).
- 8. Fix xload problems on Solaris 2.5 (David Thompson).
- 7. Fix xload problem for most BSD OSs that was introduced in 3.2, and
- fix some problems in the BSDI-specific code (Matthieu Herrb).
- 6. Modify the external ClockProg support to allow for programmable
- clocks (ie, no clocks line) (Egbert Eich).
- 5. Fix W32p rev C and rev D PCI ids (Koen Gadeyne).
- 4. Fix a problem which causes a server crash on PANIX/PC98 when using
- the XFree86-Misc extension (Takaaki Nomura).
- 3. S3 server probe cleanup (Mark Vojkovich).
- 2. Fix XF86Setup compile problem on Solaris (Robin Cutshaw).
- 1. Patches for OS/2 support (Holger Veit).
-
-XFree86 3.2 (26 October 1996)
-1079. Fix a bug in xgc that can cause a SEGV (Takaaki Nomura).
-1078. README and FreeBSD doc updates (Takaaki Nomura).
-1077. RELNOTES updates, and some updates to the preinst and postinst scripts.
-1076. Tell xf86config about the S3V server.
-1075. Fix some typos in XF86Setup.
-1074. Fix a problem with XF86Setup that shows up when there is no
- <Xroot>/bin/X link present.
-1073. Fix a test restoration problem with the ali driver.
-1072. NetBSD and Solaris doc updates (Matthieu Herrb).
-1071. Cirrus doc updates (Harm Hanemaayer).
-1070. Prevent Oak probe from falsely detecting some Avance Logic chips.
-
-XFree86 3.1.2Zd (24 October 1996)
-1069. Fix a problem with the TGUI driver disabling linear mode when the
- OS doesn't support it.
-1068. Fix an image stipple problem in the S3, Mach8, Mach32 and 8514 servers
- (Harald Koenig).
-
-XFree86 3.1.2Zc (24 October 1996)
-1067. Mach64 doc updates (Kevin Martin).
-1066. Xvfb shouldn't depend on cfb24 (Geert Uytterhoeven).
-1065. Update contrib to R6.1.
-1064. C&T doc updates (David Bateman).
-1063. Fix an image stipple problem in the S3V server (Harald Koenig).
-1062. Doc updates (Takaaki Nomura).
-
-XFree86 3.1.2Zb (23 October 1996)
-1061. Fix some NV1 problems, including clock selection problems and
- pixel corruption problems (David McKay).
-1060. Fix some bad random() prototypes for Linux (Harald Koenig).
-1059. Fix NeqnCmd definition in NetBSD.cf (Matthieu Herrb).
-1058. Chips&Tech doc updates (David Bateman).
-1057. Cards db update for Chips&Tech (David Bateman).
-1056. Some updates to the "supported" contrib clients (Harald Koenig).
-1055. VGADriver doc updates (Stuart Lamble).
-1054. LynxOS doc updates (Thomas Mueller).
-1053. Fix a problem in mgaFillBoxSolid() (Radoslaw Kapitan).
-1052. Fix a serious probe bug in the MGA driver which causes a crash on
- non-PCI machines (Egbert Eich).
-1051. Fix a serious probe bug in the NV driver (David Bateman).
-
-XFree86 3.1.2Za (21 October 1996)
-1052. Some documentation updates (Dirk Hohndel).
-1051. A few cleanups that have no affect on function (Harald Koenig).
-1050. Fix a problem in XF86Setup (Harald Koenig).
-
-XFree86 3.1.2Z (20 October 1996)
-1049. Update XF86_SVGA man page (Harm Hanemaayer).
-1048. Update Linux README (Dirk Hohndel).
-1047. Fix some mono/4bpp problems introduced by recent ET6000 changes
- (Koen Gadeyne).
-1046. Updates to the Cards database (Harald Koenig).
-1045. Fix xdpyinfo core dump when the XInput extension is not available
- (Frederic Lepied).
-1044. Fix SuperProbe mis-detection of S3 ViRGE (Harald Koenig).
-1043. S3V README (Harald Koenig).
-1042. Resync some PC98 Imakefiles (Takaaki Nomura).
-1041. Update XF86Setup card list features, and add 1152x864 video modes
- (Harald Koenig).
-
-XFree86 3.1.2Gq (19 October 1996)
-1040. Some updates to use the native setlocale() in the GNU libc used
- by Linux/Alpha/ELF (Ulrich Drepper, Harald Koenig).
-1039. MGA README (Andrew Vanderstock and Dirk Hohndel).
-1038. Fix REQUIREDLIBS problem with dynamic xie.so (Alan Hourihane).
-1037. Update man page versions (Takaaki Nomura).
-1036. Add xf86VTSema checks to the MGA server, move blitter init to
- HWRestore, and wait for drawing engine before enter/leave VT
- (Radoslaw Kapitan).
-1035. TGA and Trident doc updates (Alan Hourihane).
-1034. Remove an unused TGA server file (Alan Hourihane).
-1033. Update to the Chips&Tech screen corruption fix (Egbert Eich).
-1032. Fix a typo in the Chips&Tech driver which prevents the "hw_clocks"
- option from working (David Bateman).
-1031. Move the SVGA 'mx' driver to after the 'chips' driver, because its
- probe causes problems for the chips driver. Also, fix a problem
- in the 'mx' probe where it writes to a register without first saving
- its contents.
-
-XFree86 3.1.2Gp (18 October 1996)
-1030. Fix the cursor colour not being correctly set in 15/16/32bpp modes
- on the CT, ET, VT and GT chips (Kevin Martin).
-1029. Change Mach64 block_write behaviour. Assume that block write mode is
- initialised by the BIOS, but still allow it to be turned on or off
- explicitly in the XF86Config (Kevin Martin).
-1028. Set the extended display FIFO LWM bit on the Mach64 CT-D (Kevin Martin).
-1027. Fix the retrace wait in mach64AdjustFrame() (Kevin Martin).
-1026. Delete Mach64 doublescan modes for chipsets that don't support any
- accelerated doublescan modes (Kevin Martin).
-1025. Set Mach64 display FIFO setting to the values supplied by ATI for
- various chipset/memory type/memory size/bpp combinations (Kevin Martin).
-1024. Fix some MGA accel problems (Radoslaw Kapitan).
-1023. FreeBSD and NetBSD doc updates (Takaaki Nomura).
-1022. Fix some Mach32 16bit font display problems (Bryan Feir).
-1021. Add support for the ICS1562 clockchip used by the DEC TGA (Harald
- Koenig).
-1020. Make WaitQueue wait for three more free slots than requested to
- allow a safety margin in case of coding bugs (the ViRGE will lock
- up the PCI bus when the FIFO is full) (Harald Koenig).
-1019. S3V fixes for some XTEST errors, and remove debug and unused code
- (Harald Koenig).
-1018. Preliminary support for the Trident Cyber 938x chipset (Alan Hourihane).
-1017. Update the max clock for the Cirrus 754x with LCD enabled, and
- deal more gracefully when a clock line is encountered (Harm Hanemaayer).
-1016. Add/implement XF86DGAGetViewPortSize() and add an extra argument
- to XF86DGAViewPortChanged() which indicates the number of pages
- being used when multi-buffering (Harm Hanemaayer).
-1015. Move the setting of the XF86DGADirectColormap flag into
- XF86DGAInstallColormap() so that apps which use this function but
- don't explicitly set the flag will work correctly.
-
-XFree86 3.1.2Go (17 October 1996)
-1014. Add xterm-r6 entries to the xterm termcap and terminfo files. These
- are compatible with the standard X11R6 version of xterm.
-1013. Chips&Tech driver updates, including: add an option to deal with
- LCD panel size problems, add an option to use an 18bit bus for some
- TFT laptops, allow imageblt to be disabled, support sync-on-green
- for the 65550, improve some screen scrambling problems, add DGA
- support, fix 24bpp acceleration problems, fix HW cursor colouring
- problems, update docs (Egbert Eich, David Bateman, Nozomi Ytow,
- Marc de Courville, Jens Mauer, Adam Sulmicki).
-1012. BlankDelay settings for ViRGE (non-VX) (Harald Koenig).
-1011. More S3V ROPs for planemask simulation for BLTs (not used yet)
- (Harald Koenig).
-1010. S3V fix for some image ops (Harald Koenig).
-1009. LynxOS microSPARC updates (Thomas Mueller).
-1008. OS/2 updates (Holger Veit and Sebastien Marineau).
-1007. TGA server updates, including disallow interlace modes, parse /proc/pci
- output to find the memory base address (Alan Hourihane).
-1006. Add a DGA flag (XF86DGADirectColormap) to control when the colourmap
- is in the exclusive control of XF86DGAInstallColormap(). This allows
- older DGA clients which don't use XF86DGAInstallColormap() to work
- as before.
-1005. Fix mmap in libXxf86dga for FreeBSD 1.1.5.
-1004. Fix a typo in xf86writepci() which causes it to return without doing
- anything (URATA Shuichiro).
-
-XFree86 3.1.2Gn (16 October 1996)
-1003. Fix a problem with the ospex Imakefile regarding the building of
- a non-shared library.
-1002. Increase the listen(2) backlog value in Xtranssock.c.
-1001. VidMode extensions updates (Joe Moss).
-1000. Add QueryDirectVideo and ViewPortChanged functions to the DGA
- extension (Harm Hanemaayer and Mark Vojkovich).
- 999. Fix a problem where parts of lines incorrectly appear black with the
- S3V server (Berry Dijk).
- 998. Fix some S3V problems that show up when running xtest (Harald Koenig).
- 997. Change MGAAdjustPitch to choose a pitch for which acceleration is
- possible (Ansgar Hockmann).
- 996. Fix some server compile warnings (Thomas E. Dickey).
- 995. Set HasPoll to YES for NetBSD 1.2 and OpenBSD. This solves the
- fundamental problem select has with the width of a fd_set
- (Matthieu Herrb).
- 994. Use modified ROPs and colour bit patterns to simulate the planemask
- where possible in the S3V line code (Harald Koenig).
- 993. Report the Wacom function/macro button as key events (Frederic Lepied).
- 992. Initial DSP programming of Mach64 VT-B and GT-B implemented, but not
- enabled yet (Kevin Martin).
- 991. Mach64 CT, ET, VT, GT clock programming changed to be more accurate.
- Previously it used integer arithmetic, now it uses floats (Kevin Martin).
- 990. Mach64 VT-B and GT-B extra clock divisors (3,6,12) implemented
- (Kevin Martin).
- 989. Fix Mach64 VT-B and GT-B memory detection (Kevin Martin).
- 988. Updates for LinkKit and SVR4 README files (Takaaki Nomura).
- 987. Add a MGAWAITFIFOSLOTS macro for use with accel functions
- (Andrew Vanderstock).
- 986. Fix for MGA line colour that works at all depths (Andrew Vanderstock).
- 985. Add a wait for retrace to the end of most Adjust functions when DGA
- mode is active (Mark Vojkovich and Harm Hanemaayer).
- 984. Fix a typo in XF86Setup, and change the vsync parameters of some
- of the default monitor types (Harm Hanemaayer).
- 983. ET6000 support for linear memory and 16/24/32bpp in the SVGA server
- (Koen Gadeyne).
- 982. OpenBSD no longer defines __NetBSD__ in their cpp (Matthieu Herrb).
- 981. OpenBSD/NetBSD doc updates (Matthieu Herrb).
-
-XFree86 3.1.2Gm (13 October 1996)
-980. Set foreground colour for MGA line code (Ansgar Hockmann).
-979. Add weight 555 support for the Cirrus 5464 (Corin Anderson).
-978. Fix Cirrus HAVE546X macro to detect the 5464 (Corin Anderson).
-977. Updates to Cirrus docs and Cards database (Corin Anderson).
-976. Add detection of the ARK2000MI to SuperProbe (Harm Hanemaayer).
-975. Cirrus updates, including fix MMIO for the Cirrus 5446, update some
- DAC register values, disallow clocks line and change max clock for
- LCD displays (Harm Hanemaayer).
-974. Add some sanity checks for potential VT problems in the cirrus and
- ARK drivers (Harm Hanemaayer).
-973. Fix for LynxOS microSPARC (Thomas Mueller).
-972. Update the LynxOS docs for 3.2 (Thomas Mueller).
-971. Change the various malloc/free calls in the XKB code to use the
- XkbMalloc/XkbFree equivalents (Joe Moss).
-970. Update the Wacom driver to support the new stylus with two side
- buttons. The second side button is reported as button 4
- (Frederic Lepied).
-969. Update the LinkKit to build the SVGA and I128 servers, and update the
- LinkKit README (Takaaki Nomura).
-968. DGA support for the W32 server (Koen Gadeyne).
-967. Resynch some PC98 Imakefiles (Takaaki Nomura).
-966. LinkKit updates for a PC98-only LinkKit (Takaaki Nomura).
-965. Add some missing bits to the MGA solid box fill patch (Radoslaw Kapitan).
-964. Fix a typo in SuperProbe that would result in incorrect chipset
- reporting for some Cirrus chips (Harm Hanemaayer).
-
-XFree86 3.1.2Gl (10 October 1996)
-963. PC98 doc updates (Michio "Karl" Jinbo).
-962. Add some solid box fills to the MGA driver (Radoslaw Kapitan).
-961. Cirrus and Ark doc updates (Harm Hanemaayer).
-960. Apply 959 to the Mach32 server.
-959. Ignore clipping boxes completely to the left of right of each glyph
- for the S3, Mach8 and 8514 servers (Hans Nasten).
-958. LinkKit fixes for PC98 (Takaaki Nomura).
-957. Fix Imakefile problem related to dynamic loading for PC98
- (Michio "Karl" Jinbo).
-956. ViRGE/VX update (Harald Koenig).
-955. Add power_saver support to the TGA server (Alan Hourihane).
-954. Some more line/seg updates for S3V (Harald Koenig).
-953. Fix some problems with the previous S3V planemask patch (Harald Koenig).
-952. Add code to read the MGA card information from the BIOS. This
- allows the RAMDAC type/speed to be determined (Andrew E. Mileski).
-951. Disable 24/32bpp for S3V server because it doesn't work yet.
-950. Driver for NVidia NV1 / SGS-Thomson STG2000 (David McKay).
-
-XFree86 3.1.2Gk (8 October 1996)
-949. Use cfb code in the S3V server when the planemask is non-trivial
- (Harald Koenig).
-948. More line/seg fixes for the S3V server (Harald Koenig).
-947. Fix XORing text (and other ROPs) for the S3V server (Harald Koenig).
-946. Force 1-cycle EDO mode for the ViRGE/VX (Harald Koenig).
-945. Disable the font and pixmap caches in the S3V server (not implemented).
-944. Apply 943 to the Mach32 and S3V servers.
-943. Ignore clipping boxes completely above or below the displayed text
- for the S3, Mach8 and 8514 servers. This improves performance
- when a window is partly covered by a shaped window (Hans Nasten).
-942. Resync PC98 Imakefiles, and update documentation (Michio "Karl" Jinbo).
-941. Some LinkKit changes to prevent conflicts between the xf86 and xf98
- linkkits when doing a combined build/install.
-940. Fix for keycodes/xfree98 (Takefumi Tsukada).
-939. LinkKit support for PC98 servers (Takaaki Nomura).
-938. Fix MGA 24bpp problems (Ansgar Hockmann).
-937. Fix a potential memory interleave problem and spurious warning messages
- in the Cirrus driver (Corin Anderson).
-
-XFree86 3.1.2Gj (6 October 1996)
-936. Build PEX, XIE as dynamically loaded modules by default where it is
- supported.
-935. Fix some S3gendac interface changes (Koen Gadeyne).
-934. Fix a lex warning for reconfig (Koen Gadeyne).
-933. Fix a ROP problem in the W32 solid fill code (Koen Gadeyne).
-932. Dynamic PEX, XIE extension support for Linux/ELF.
-931. 24bpp packed support for the MGA driver (Ansgar Hockmann).
-930. Fix the way the list of clocks is derived for the Cirrus driver
- (Harm Hanemaayer).
-929. Fix problems with 16bpp for a 1MB Cirrus 5434 (Harm Hanemaayer).
-928. Fix for xdm indirect query for ISC (Michael Rohleder).
-927. Remove virtual size check in the mach32ValidMode (Michael Rohleder).
-926. Fix a typo in lib/Xbsd (Michael Rohleder).
-925. Fix "nolinear" mode in the MGA driver (Radoslaw Kapitan).
-924. Add memory detection to the MGA driver (Radoslaw Kapitan).
-923. Update NetBSD/OpenBSD docs (Matthieu Herrb).
-922. Add OpenBSD/mips config support (Per Fogelstrom, Matthieu Herrb).
-921. Update OpenBSD version to 2.0 (Matthieu Herrb).
-920. Updates to the S3 ViRGE line code (Harald Koenig).
-919. Updated ViRGE/VX support (Harald Koenig).
-918. TGA server shouldn't report DGA support (Alan Hourihane).
-917. Alpha-related config updates (Harald Koenig).
-916. Updates to Cirrus probing in SuperProbe (Harm Hanemaayer).
-915. Fix a Cirrus bitmap overrun problem (Harm Hanemaayer).
-914. Fix Cirrus FIFO settings for 5436/5446 (Harm Hanemaayer).
-913. Fix Cirrus HW cursor colours at 32bpp (Harm Hanemaayer).
-912. Fix 24bpp support for Cirrus 54xx (Harm Hanemaayer).
-
-XFree86 3.1.2Gi (3 October 1996)
-911. SCO updates. SCO5 is now the only supported version (there are
- still problems to be resolved though) (J. Kean Johnston).
-910. LinkKit updates and related cleanups (Marc Aurele La France).
-909. Updated code to program the Ti3026 clock in the MGA server
- (Andrew E. Mileski).
-908. Preliminary S3 ViRGE/VX support (Harald Koenig).
-907. Fix S3 PCI read burst disable problem (Harald Koenig)
-906. Fix SuperProbe memory reporting for the S3 ViRGE, ViRGE/VX, and
- separately report off-screen memory (Harald Koenig).
-905. Fix MGA interleave and 32bpp problems (Radoslaw Kapitan).
-904. Fix a RD_MASK problem that shows with 928 cards (at least on some
- PC98 servers) (Michio "Karl" Jinbo, Harald Koenig).
-903. Allow xterm to be statically linked with libtermcap on Linux
- (Dirk Hohndel).
-902. Fix screen save/restore on VT switch for the TGA server (Alan Hourihane).
-901. Chips&Tech updates, including a fix for line acceleration
- problems (David Bateman).
-900. VidMode extension changes/enhancements (not complete yet) (Joe Moss).
-899. S3 ViRGE solid line code (Harald Koenig).
-898. S3 ViRGE updates, including using cfb calls for non-implemented
- functions (Harald Koenig).
-897. Fix for a line drawing problem in the Cirrus driver (Harm Hanemaayer).
-896. Ark driver updates, including fixes for FIFO settings, HW cursor at
- 16/32bpp, virtual panning at 24bpp, and enable BitBlt acceleration at
- 32bpp (Harm Hanemaayer).
-895. LynxOS microSPARC updates (Thomas Mueller).
-894. Add support for Japanese 106 key keyboards on PANIX. This is enabled
- with the 'panix106' keyword in the Keyboard section (Takefumi Tsukada).
-893. README.SVR4 update (Takaaki Nomura).
-892. ValidMode function for Mach32 (Bryan Feir).
-891. Fix a Mach32 problem with VT switch screen save/restore when the
- virtual width is less than 1024 (Bryan Feir).
-890. Updated NetBSD aperture driver (Matthieu Herrb).
-889. Allow the PEX and XIE server extensions to be built as dynamic modules
- (FreeBSD and NetBSD so far). (Matthieu Herrb).
-
-XFree86 3.1.2Gh (29 September 1996)
-888. Replace virtualX by displayWidth where appropriate in many SVGA drivers.
-887. Fix virtual width/pitch checking/setting for the MGA driver.
-886. Solid line acceleration for the MGA driver (Dirk Hohndel).
-885. Improve the way scanline pitch restrictions are implemented for the
- SVGA server.
-884. Set default W32 black/white pixel values the same as for the other
- servers.
-883. Fix some W32 stipple problems (Glenn Lai).
-882. Allow "mclk" as a synonym for "s3mclk" (Harm Hanemaayer).
-881. Adjust mode timings in the ARK driver when required for 24bpp operation
- and for HW cursor operation (Harm Hanemaayer).
-880. Some MGA driver cleanups.
-879. Fix selection of interleave mode for MGA (Ansgar Hockmann).
-878. Add "fifo_conservative" option for the ARK driver (Harm Hanemaayer).
-877. Possible fix for ICS5342 MCLK calculation in the Ark driver
- (Harm Hanemaayer).
-876. Fix max clocks when ClockChip "cirrus" is used (Harm Hanemaayer).
-875. XF86Setup updates (see XF86Setup/CHANGELOG for details) (Joe Moss).
-874. LCD code for Cyber9320 in PC98_TGUI server (X98 core team).
-873. Fix typos in pc98_tgui.{c,h} (X98 core team).
-872. PC98 Imakefile updates (X98 core team).
-871. PC98 documentation updates (X98 core team).
-870. New Chips&Tech accelerations, including: multiple depth ImageGlyph
- and PolyGlyph for 65545, 8bpp CopyPlane1to8 for 65545, 8bpp
- FillRectTransparentStippled32 and FillRectOpaqueStippled32 for 65545,
- modified simple BitBlt and Solid fill for 65550, stipple and tile
- functions for 65550 (Egbert Eich, Xavier Ducoin, David Bateman).
-869. Chips&Tech driver fixes, including: improve stability of
- suspend/resume, fix DSTN screens with 65550, reduce the size of
- MMIO regions, fix PCI burst mode, disable line acceleration because
- it can cause a server crash in rare circumstances (Egbert Eich,
- Xavier Ducoin, David Bateman).
-868. Make the Cirrus fifo options work for the 546x chips (Corin Anderson).
-867. Support for the Cirrus 5464 (Corin Anderson).
-866. Add a hook to the SVGA server to allow drivers to specify a display
- width (pitch) which is different from the virtual width. This
- is required for some Cirrus chipsets (Corin Anderson).
-865. 24bpp packed pixel Cirrus support (Harm Hanemaayer and Corin Anderson).
-864. Work around a problem on NetBSD/OpenBSD where dlsym() searches for
- the symbol in the whole executable rather than just in the modules
- specified (Matthieu Herrb).
-863. Add an X server and config/imake support for LynxOS microSPARC 2.4.0
- (Thomas Mueller).
-862. Remove stale fb shared memory before dying on LynxOS (Thomas Mueller).
-861. Work around a popen/pclose bug on LynxOS in the server XKB code
- (Thomas Mueller).
-860. Work around a bash problem on LynxOS which affects rstart/Imakefile
- (Thomas Mueller).
-859. Solid vertical and horizontal lines for the S3 ViRGE server (Berry Dijk).
-858. Fix max clock for TGA (Alan Hourihane).
-857. Fix for TGA VT switching problems (Alan Hourihane).
-856. Add code to detect the ViRGE/VX (Dirk Hohndel).
-
-XFree86 3.1.2Gg (26 September 1996)
-855. Preliminary support for the Matrox Millennium (MGA 2064W)
- (Radoslaw Kapitan, Andrew Vanderstock, Dirk Hohndel).
-
-XFree86 3.1.2Gf (25 September 1996)
-854. Mach32 documentation (Bryan Feir).
-853. Improve Mach32 ramdac probing in SuperProbe (Bryan Feir).
-852. Fix xf86writepci() prototype (Alan Hourihane).
-851. TGA server and documentation updates (Alan Hourihane).
-850. Fix missing argument in the QueryBestSize functions in the SVGA server
- (Harm Hanemaayer).
-849. Another fix for usage of XInput defines, and make initext depend on
- ICONFIGFILES (Marc Aurele La France).
-848. Improve reliability of detecting Mach64 cards in SuperProbe, the
- Mach64 server and the ati driver (Marc Aurele La France).
-847. Complete s3im.c for s3_virge (Harald Koenig).
-846. Fix s3_virge framebuffer detection (Harald Koenig).
-845. Fix s3_virge compile problems when using a compiler other than gcc.
-844. Missing patch to vgaCmap.c for item 842 (Harm Hanemaayer).
-
-XFree86 3.1.2Ge (24 September 1996)
-843. Add Trio/ViRGE clock support to the "s3_svga" driver. This is still
- incomplete, and for development use (Harald Koenig).
-842. Add vgaGetInstalledColormaps() and support for 8-bit colour components
- to the SVGA server (Harm Hanemaayer).
-841. ARK driver updates, including: fix problems with BitBlts at 24bpp,
- fix hw cursor at 8bpp, fix some ZoomDAC problems, and add support
- for 8-bit colour components (dac_8_bit) at 8bpp (Harm Hanemaayer).
-840. Fix some typos in compiler.h (Harald Koenig).
-839. Initial ViRGE s3im.c, and remove unneeded s3linear.h and bank switching
- (Harald Koenig).
-838. Fix some XInput and XKB defines (Marc Aurele La France).
-837. LinkKit fixes (Marc Aurele La France).
-836. Add ARK Logic chipset detection to SuperProbe (Harm Hanemaayer).
-835. Fix a typo in xkbcomp/symbols/de (Thomas Mueller).
-
-XFree86 3.1.2Gd (23 September 1996)
-834. Rename ViRGE driver from s3_generic to s3_virge (Dirk Hohndel).
-833. Don't reference uninitialised s3MmioMem in ViRGE server (Harald Koenig
- and Dirk Hohndel).
-832. Don't do S3 bug tests for 928 and earlier (Harald Koenig).
-831. ViRGE fixes, including BITBLT and text clipping (Harald Koenig).
-830. Updates to the Cards file for Cirrus and Ark (Harm Hanemaayer).
-829. xf86config updates, including 24bpp support, and making "virtual"
- optional (Harm Hanemaayer).
-828. Fix trident probe so that it restores all registers it touches
- (Harm Hanemaayer).
-827. ARK driver updates, including: auto-detect the ZoomDAC and print out
- the RAMDAC type, use DRAM bandwidth for CRT FIFO setting, don't allow
- 5-5-5 weight for 16bpp with 1000PV and ZoomDAC, and add sanity check
- for off-screen CopyWindow (Harm Hanemaayer).
-826. Fix a typo in the TGA server that could cause it to think it has found
- a valid mode (Alan Hourihane).
-825. Don't try to use -ldl for XF86Setup on non-ELF Linux (Harald Koenig).
-824. Add "slow_dram" option for the W32 server to fix some problems with
- older cards (Dirk Hohndel).
-
-XFree86 3.1.2Gc (22 September 1996)
-823. XKB data file updates for jp106/jp (Takaaki Nomura).
-822. S3 Virge server (preliminary version) (Harald Koenig).
-821. ARK driver updates, including basic BitBlt acceleration, improved
- ramdac support, experimental 24bpp support, and max dot clocks take
- the memory clock into consideration (Harm Hanemaayer).
-820. Minor xdm and xterm changes to allow them to compile on FreeBSD 1.1.5.
-819. Fix Trident probe in SuperProbe so that it doesn't corrupt ET6000
- display (Koen Gadeyne).
-818. Fix Sierra 1502X RAMDAC handling in the W32 server (Dirk Hohndel).
-817. TGA server for Alpha machines. Not accelerated at this stage
- (Alan Hourihane).
-816. SuperProbe update for ELSA Gloria (Harald Koenig).
-815. Fix/add 15/16bpp support for S3 805i with AT&T 20C498 (Hermann Lauer).
-814. Improve S3 clipped text performance (Harald Koenig).
-813. Fix a typo in xkbcomp/rules/xfree86 (Joe Moss).
-812. Add detection for the Cirrus 7548, and treat it like the other 754x
- chips (Harm Hanemaayer).
-811. Change xterm valid-response code in DECRQSS from 0 to 1 to match a
- real VT420 terminal (Thomas E. Dickey).
-810. Add a resource 'decTerminalID' to control the reporting level of
- xterm (e.g., VT100, VT220), and use it to implement/correct the
- DA1, DA2 and DECRPTUI reports (Thomas E. Dickey).
-809. Fix xterm restoration of color for bold/underline color mode
- (Thomas E. Dickey).
-
-XFree86 3.1.2Gb (15 September 1996)
-808. Update PC98 Imakefiles (Michio "Karl" Jinbo).
-807. Fixes for problems with the PC98 TGUI server (Michio "Karl" Jinbo).
-806. Fix/workaround to avoid DGAInstallColormap() being affected by
- window managers.
-805. Fix some problems related to the change in the xf86scanpci() interface.
-
-XFree86 3.1.2Ga (14 September 1996)
-804. Implement s3ValidMode() (Mark Vojkovich).
-803. Modify the ValidMode interface in preparation for some VidMode extension
- changes.
-802. Fix a problem with the XOpenDisplay buffer overflow fix (item 734 below)
- (X Consortium, Kaleb Keithley).
-801. Fix FIFO setting for Cirrus Alpine (543x, 5446) cards with 1MB
- (Harm Hanemaayer).
-800. Modify Cirrus asm code to allow PCI burst accesses (Harm Hanemaayer).
-799. Change default for MvCmd to 'mv -f'.
-798. Redo the xf86PCI code, based on that in FreeBSD-current.
-797. Update xf86PCI code to deal with PCI bridges and multi-function
- devices (Mihoko Tanaka).
-796. Fix a problem with the Sigma L-View driver (and presumably the same
- problem in the HGC1280 driver (Norbert Berzen).
-795. Add a "Sundeadkeys" XKB variant for European keyboards.
-794. Change the "es" XKB symbols to match a Spanish keyboard (Jon Tombs).
-793. Update Cards database.
-792. Fix panning problem with some Cirrus cards (Corin Anderson).
-791. Map the S3 MMIO area separately (Harald Koenig).
-790. Don't allow S3 newmmio to be selected for chips that don't support
- it (Harald Koenig).
-789. Fix for Linux/m68k frame buffer device (Geert Uytterhoeven).
-788. Fix detection of some SiS chips.
-787. Turn on 32-bit mode for TGUI chips. This allows PCI burst to be
- turned on by default. (Alan Hourihane).
-786. Disable 16bpp for the TGUI9320LCD since it doesn't work (Alan Hourihane).
-785. Fix ET6000 problems with the VGA16/Mono servers (Koen Gadeyne).
-784. Speedups for the W32 arc and teblt8 code (Glenn Lai).
-783. Fix W32 line-drawing using the wrong ROP for horizontal and vertical
- lines (Koen Gadeyne).
-782. Add a new xdm access control keyword "NOBROADCAST" to disable answering
- broadcasts from specified hosts (Kimmo Suominen).
-781. Make xf86config run the correct server by name rather than trying
- to run 'X' (Holger Veit).
-780. Change default "gb" XKB symbols (James Hawtin).
-779. Config and documentation updates for LynxOS (Thomas Mueller).
-778. Update XF86Setup's device list for LynxOS (Thomas Mueller).
-777. Fix compile problem when XINPUT isn't defined (James Hawtin).
-776. XF86Setup needs to be linked with -ldl on Solaris (James Hawtin).
-
-XFree86 3.1.2G (3 September 1996)
-775. Fixes for some NECS3 server problems (Naofumi Honda).
-774. Fix some XF86Setup typos.
-773. OS/2 updates (Holger Veit).
-
-XFree86 3.1.2Fc (3 September 1996)
-772. XF86Setup updates (see XF86Setup/CHANGELOG for details) (Joe Moss).
-771. PCI detection for the Alliance ProMotion 6422 (Kent Hamilton).
-770. Documentation updates (Dirk Hohndel, Matthieu Herrb).
-769. Updates for OpenBSD, including support for recent changes to the
- console drivers (Matthieu Herrb).
-768. Need rint() for ISC and Lynx (Michael Rohleder).
-
-XFree86 3.1.2Fb (1 September 1996)
-767. S3 support for the Diamond SS2410 RAMDAC (eriks).
-746. Fix resize on Linux (for terminfo) (Rik Faith).
-745. Updates to Cyrillic fonts (Andrey Chernov).
-
-XFree86 3.1.2Fa (31 August 1996)
-744. Fix xterm's handling of SGR 22, 24 and 25 in combination with colorUL
- and colorBD resources. Also noted & fixed reset of colored
- underline/bold with SGR 0 (Thomas E. Dickey).
-743. Fix a typo in the xterm termcap (Thomas E. Dickey).
-742. Don't allow the "fb_debug" option when newmmio is used (Harald Koenig).
-741. Make sure s3Port59/s3Port5A are initialised before s3Init() is called
- (Harald Koenig).
-740. Force 64MB alignment of linear FB, even when MemBase is given in
- the config file (Harald Koenig).
-739. Disable newmmio when "nolinear" is specified, or when linear memory
- mapping isn't available (Harald Koenig).
-738. Fix C&T driver printing out a line in its probe in cases where a
- C&T chip hasn't been detected.
-737. Driver for the Alliance ProMotion 6422 (Alliance Semiconductor, and
- Kent Hamilton).
-736. Make the Ark SVGA driver detect the ARK2000MT, and treat it as an
- ARK2000PV.
-735. Updates for SCO OpenServer 5 support (J. Kean Johnston).
-734. Fix for a buffer overflow problem in XOpenDislpay (libX11)
- (X Consortium, Kaleb Keithley).
-733. Some imake/config updates (Dirk Hohndel).
-732. Add a '-nolock' server command line option to disable the X server
- locking (Roger Wolff).
-731. Scanpci updates: Check general pci-pci bridges, add some more
- vendor and device IDs, and add a '-f' flag to print out the full
- information -- otherwise just print the vendor/device name
- (Mihoko Tanaka).
-730. Updates for ISC (Michael Rohleder).
-729. Fix typo in XF86Setup/mouse.tcl (Thomas Mueller).
-728. Fix malloc problem in TLI xtrans code (Joe Moss).
-727. Fix some WaitQueue problems with the S3 server (Naofumi Honda,
- Takaaki Nomura, Harald Koenig).
-726. Fix for display problem with Trio64V+ at 16bpp (Harald Koenig).
-725. Fix clock limit arrays for Cirrus 754x chip (Corin Anderson).
-724. Add a "DefaultColorDepth" keyword for the Screen section of the
- XF86Config (Dirk Hohndel).
-723. Fix problem using non-linear mode with TGUI chips (Alan Hourihane).
-722. Turn off PCI burst write by default for TGUI chips.
-
-XFree86 3.1.2F (27 August 1996)
-721. Update the QuickStart guide with details about using XF86Setup (Joe Moss).
-720. Some XF86Setup updates (Joe Moss).
-719. Avoid a possible malloc/free problem in the xtrans TLI code (Joe Moss).
-718. Some Linux a.out lib updates for libX11, libXt (Harald Koenig).
-717. Fix 32bpp S3 newmmio problem (Harald Koenig).
-
-XFree86 3.1.2Eo (26 August 1996)
-716. Disable 24bpp packed mode in S3 server because it doesn't work properly
- yet (Harald Koenig).
-715. Don't use newmmio S3 driver by default on Alpha architecture (or
- for ISC) (need to specify it explicitly in XF86Config) (Harald Koenig).
-714. Fix some incorrect printf-style arguments in xkbcomp (Thomas E. Dickey).
-713. Fix compiler warnings, including uninitialised variables, missing
- prototypes, etc (Thomas E. Dickey).
-712. XF86Setup updates (Joe Moss).
-711. Fix for some potential buffer overrun problems in libXt and libX11 that
- can lead to security holes.
-
-XFree86 3.1.2En (25 August 1996)
-710. Build/install the xkbui library regardless of whether XF86Setup is
- being built.
-709. Fix lots of compiler warnings and related problems when building on
- Alpha (Richard Henderson).
-708. Fix missing function prototype problem in libXi that causes problems
- on Alpha platforms (Richard Henderson).
-707. XF86Setup updates.
-
-XFree86 3.1.2Em (24 August 1996)
-706. Swap acute and apostrophe keys in de(nodeadkeys) (Michael Rohleder).
-705. ISC documentation updates (Michael Rohleder).
-704. Chips & Tech documentation update (Egbert Eich).
-703. Chips & Tech driver updates, including a fix for a 65545 PCI problem,
- and a hack/option for a suspend/resume problem (Egbert Eich).
-702. Major updates to XF86Setup (Joe Moss).
-701. Updates to the Cards database (various).
-700. ATI (SVGA) driver update (Marc Aurele La France).
-699. Cards file update for AGX (Henry Worth).
-698. Fix for a BIOS initialisation problem on some VideoLogic (S3) cards
- (Harald Koenig).
-697. Fix some 32bpp problems with S3 newmmio (Harald Koenig, Bernd Lind).
-696. Fix some PCI lockups when using S3 newmmio mode (Harald Koenig).
-
-XFree86 3.1.2El (23 August 1996)
-695. NetBSD/OpenBSD doc updates (Matthieu Herrb).
-694. Fix typo in rules/xfree86 (Joe Moss).
-693. Fix some virtual desktop scrolling bugs with the CL-GD5462 in the
- Cirrus driver (Corin Anderson).
-692. Set BSD (syscons/pcvt) keyboard to K_RAW after establishing the tty
- settings (was done in the opposite order) (Naofumi Honda).
-691. Fix PCVT_SUPPORT in BSD xf86KbdOn/Off functions (Naofumi Honda).
-690. Add correct handling of PCI connect/disconnect for the PC98 S3 968
- server (Naofumi Honda).
-689. Fix PCI probing for PC98 machines (Michio Jinbo).
-688. Fix mask used for TGUI fb address when membase is supplied (Michio Jinbo).
-687. Add an xterm option/resource to allow text selection to be shown
- differently -- ie, only highlight the characters selected when selecting
- beyond the end of a line (Thomas E. Dickey).
-686. Fix PCI base address for S3 868/968, and newmmio fixes (Harald Koenig).
-685. Fix problem with memory allocation in XKB that could cause the server
- to crash (Joe Moss).
-
-XFree86 3.1.2Ek (21 August 1996)
-684. Fixes for m68k support (Geert Uytterhoeven).
-683. Naming changes for m68k servers and config options (Geert Uytterhoeven).
-682. Update SuperProbe to identify the amount of memory for a 65550/54,
- and fix detection of 65545 (David Bateman).
-681. Fix for 65545 PCI problems in the C&T driver (Egbert Eich).
-680. resync os2_select.c (Holger Veit).
-
-XFree86 3.1.2Ej (20 August 1996)
-679. Fix install problem when xkbcomp is linked against shared libs.
-678. Prevent server exit if the mouse device is changed to something
- unsuitable (Joe Moss).
-677. XF86Setup updates (Joe Moss).
-676. Update XF86Config man page and sample XF86Config file for XKB changes
- (Joe Moss).
-675. LinkKit fixes (David Bateman).
-674. Chips & Tech driver updates (David Bateman and others?).
-673. xterm bug fixes (Thomas E. Dickey).
-672. PCI probe fix for S3 server (Harald Koenig).
-671. Support for new MMIO style for 868/968/Trio64V+, and MMIO support
- (with optimised use of memory barriers) for Alpha/AXP. This currently
- has problems at 32bpp (Bernd Lind, Harald Koenig).
-670. Use POSIX termios for xterm for all Linux systems (Richard Henderson).
-669. Generalise mmap access to DENSE I/O memory for Alpha (Richard Henderson).
-668. 32/64 bit cleanup, especially in server's XIE code (Richard Henderson).
-667. Config updates for Linux/Alpha (Richard Henderson).
-666. Updates for OS/2 (Holger Veit).
-665. Fix problems building XF86Setup with BuildServersOnly set to YES.
-
-XFree86 3.1.2Ei (18 August 1996)
-664. Fix some PC98 Imakefile problems (Michio "Karl" Jinbo).
-663. Linux/m68k support (Geert Uytterhoeven, Martin Schaller, Gary Henderson).
-662. Change the S3 server's handling of situations where mode choices
- cause problems. It is now less likely to exit in these situations.
-661. Add a -bestRefresh command line option to the X servers to change
- the mode selection to pick the mode with the best refresh rate when
- multiple modes of the same name are available.
-660. XF86Setup updates (see XF86Setup/CHANGELOG) (Joe Moss).
-
-XFree86 3.1.2Eh (14 August 1996)
-659. Update Cyrillic fonts (Andrey Chernov).
-658. Add support for the CL-GD5462 to the cirrus driver, and update
- documentation for recent cirrus driver changes (Corin Anderson).
-657. XF86Setup updates (Joe Moss).
-656. Fix some LynxOS-related typos in the config (Thomas Mueller).
-655. Add a man page for the DGA extension.
-
-XFree86 3.1.2Eg (14 August 1996)
-654 Update Japanese docs (Michio "Karl" Jinbo).
-653 Add XF98_GA968 server for GA-968V4/PCI(S3 968) (Michio "Karl" Jinbo).
-652. Bring the PC98 tree into sync with the main tree, and add XF86Setup
- (Michio "Karl" Jinbo).
-651. Fix problems with 32bpp sparse mode that were introduced in 3.1.2Eb.
- Need to check that this fix works OK with 24bpp packed mode.
-650. Fix some compiler warnings (Thomas E. Dickey).
-649. Mods to ct_driver.c so that it will compile on SVR4.0 (no nested
- asm calls, and work around a code generation problem).
-648. Fix some problems with mouse changes in 3.1.2Ef (Joe Moss).
-
-XFree86 3.1.2Ef (13 August 1996)
-647. ET6000 support for the SVGA and W32 servers. The support in the
- W32 server is accelerated (Koen Gadeyne).
-646. Add support to xterm for most vt220 and vt320 terminal features
- (Thomas E. Dickey).
-645. Support for I128 series II cards (Robin Cutshaw).
-644. Wacom driver updates (Frederic Lepied).
-643. Support for core motion history management through mi (Frederic Lepied).
-642. Improved integration of mouse with XInput (Frederic Lepied).
-641. Major updates to XF86Setup (Joe Moss).
-640. Update to latest version of XKB.
-639. Fix broken 32bpp sparse support in S3 server (there are still some
- problems though, and they are also seen with the Mach64 server).
-
-XFree86 3.1.2Ee (11 August 1996)
-638. Implement ech and ech1 terminal capabilities for xterm (Thomas E. Dickey).
-637. Add blinking cursor support for xterm (disabled for now)
- (Thomas E. Dickey).
-636. Fix a PEX font struct being freed twice (Richard Henderson).
-635. Make xterm tolerant of applications that allocate the whole colour map
- (by disabling colour mode if the ANSI colours are set with non fg/bg
- values) (Thomas E. Dickey).
-634. Allow ISO colour support to be #ifdef'd out in xterm. This allows
- xterm's memory usage to be significantly reduced when colorMode is not
- enabled (Thomas E. Dickey).
-633. Reduce flickering during resize for ReverseVideo in xterm
- (Thomas E. Dickey).
-632. Fix xterm core dump problem on IRIX 5.2 (Thomas E. Dickey).
-631. Update scanpci to detect the #9 I128 series II (Robin Cutshaw).
-630. Preliminary Mach32 ramdac support updates (Bryan Feir).
-629. Document new xterm control sequences (Thomas E. Dickey).
-628. Fix problem introduced in 3.1.2E with software cursor on some non-i386
- platforms (Thomas E. Dickey and Thomas Mueller).
-627. Support for SCO Open Server 5 (J. Kean Johnston).
-626. Add detection of the S3 ViRGE chip to SuperProbe (and scanpci), and
- use PCI probing for S3 chipset detection in SuperProbe where appropriate
- (Harald Koenig).
-625. Add detection of newly supported C&T chips to SuperProbe.
-624. Add a TextClock keyword for the XF86Config to fix problems restoring
- the text clock with the chips & tech driver (Egbert Eich).
-623. Updates for the LinkKit (Egbert Eich).
-622. Significantly improved driver for Chips and Technologies chipsets.
- Includes linear addressing (65530 and above), 16/24bpp (65540 and above),
- programmable clock support (65540 and above), HW cursor support (65545
- and above), BitBLT acceleration (65545/46 and 48), support for the
- 65546, 65548, 65550 and 65554 (Nozomi Ytow, Egbert Eich, Ken Raeburn,
- Xavier Ducoin and David Bateman).
-
-XFree86 3.1.2Ed (10 August 1996)
-621. Fix xterm colour translation problem (Michael Rohleder and
- Thomas E. Dickey).
-620. xterm termcap/terminfo fixes (Thomas E. Dickey).
-619. Add escape sequences to xterm that act like CDE ddterm's window
- operations (Thomas E. Dickey).
-618. Set the initial cleared screen colour correctly for the 8514 and Mach8
- servers to match the default black pixel value and the -flipPixels
- flag (Hans Nasten).
-617. Add support for LynxOS AT version 2.4.0, and client-only support for
- LynxOS microSPARC and PowerPC (Thomas Mueller).
-616. Config updates for OpenBSD and NetBSD 1.2 (Matthieu Herrb).
-615. Fix typo in trident driver, and update XFree86 man page (Alan Hourihane).
-614. Fix problems with Trio64V+ video blanking signal. Some undocumented
- options "trio64v+_bug1" to "trio64v+_bug3" have been added enable/disable
- parts of the code in case they are required later (Harald Koenig).
-613. Don't require SuperProbe to do the BIOS signature check for VGA cards
- when the PCI probe detects a VGA card (Koen Gadeyne).
-612. Add ET6000 detection to SuperProbe (Koen Gadeyne).
-611. Add PCI detection of ET6000 to scanpci and SVGA server (Koen Gadeyne).
-610. Update AGX documentation (Henry Worth).
-609. Add DGA support to the AGX server (Henry Worth).
-608. AGX server recognises "fast_vram" and "slow_vram" options as equivalents
- to "fast_dram" and "slow_dram" (Henry Worth).
-607. 8 bit/RGB DAC mode is now the default for the AGX server where supported
- (Henry Worth).
-606. Fix initialisation of the Bt481 for AGX-016 based Hercules dual-DAC
- Graphite cards (Henry Worth).
-605. Fix overscan colour correctly for the AGX server to match the change
- to the default black pixel value and the -flipPixels flag (Henry Worth).
-604. Update et4000w32.c for ChipHas24bpp in vgaVideoChipRec (Thomas E. Dickey).
-603. Prevent Xserver from exiting when a mouse device can't be opened and
- the '-allowMouseOpenFail' command line option is used (Joe Moss).
-602. Add CL-GD5446 detection to SuperProbe.
-601. Add support for CL-GD5446 to the cirrus driver (Corin Anderson).
-600. Add PCI detection of Cirrus CL-GD5446 to SVGA server and scanpci
- (Corin Anderson).
-599. Add a function XF86DGAForkApp() to the dga library, which causes
- the client to fork, with the parent remaining to clean up after the
- child exits (Jon Tombs).
-598. Add an InstallColormap function to the DGA extension (Jon Tombs).
-597. Fix broken DGA setviewport on SVGA servers (Jon Tombs).
-
-XFree86 3.1.2Ec (8 July 1996)
-596. XF86Setup fixes and updates (Joe Moss).
-595. Fix some build problems on Solaris due to the positioning of
- <stdlib.h> includes in xconsole and xwd (William Austin).
-594. Fix a make problem in xfree98/vga16/drivers (Takaaki Nomura).
-593. Add some minor features from ISO 6429 to xterm (Thomas E. Dickey).
-592. Fix for SiS clock programming, and implement HW cursor for SiS
- (Alan Hourihane).
-591. XInput support for SummaSketch tablets (Steven Lang).
-590. Improve the startup of the Wacom driver (Frederic Lepied).
-589. Fix an XInput bug with extended events reporting the wrong number
- of valuators (Frederic Lepied).
-588. Fix xterm's utmp usage for Solaris (Christos Zoulas).
-
-XFree86 3.1.2Eb (30 June 1996)
-587. Fix MMIO setting which causes problems with Trio64V+ cards in machines
- with PCI SCSI controllers (Harald Koenig).
-586. Auto-select the ICD2061A for Diamond Stealth 64 VRAM cards (when
- a Diamond BIOS, Bt485 and S3 964 are all detected).
-585. Fix a problem with the VGA16 server when Chipset "generic" is specified.
-584. Fix twm/gram.y and fonts/PEX/to_wfont.y problems that show up when
- using bison-1.25 (Matthieu Herrb).
-583. Move the beta expiry check code into a separate file, and add a command
- line option to allow the expiry date to be extended when a key is
- provided.
-582. Preliminary 24bpp packed support for some S3 cards (Harald Koenig).
-581. Add 24bpp (packed pixel) support for cfb (cfb24), and the required
- hooks for using it with the SVGA server (Shigehiro Nomura and
- NoZomi Ytow).
-580. Fix some xterm background colouring problems (Thomas E. Dickey).
-579. Allow the PCI burst to be separately turned on/off for read and write
- for the TGUI chips (Alan Hourihane).
-578. vgaHW.c fix (NoZomi Ytow).
-577. Fix for Mach64 block_write problems introduced in 3.1.2E (Kevin Martin).
-576. An alternate fix to the Makedirectories() rule, which causes only
- one 'sh -c' to be used (Marc Aurele La France).
-575. Some sanity checks for the trident driver (Alan Hourihane).
-574. Another HSkew fix for the ATI SVGA driver (Marc Aurele La France).
-573. Add 256 colour support to the SiS driver (Alan Hourihane).
-572. Fix a stdlib.h -related problem in xwd (Joe Moss).
-571. Fix a stdlib.h -related problem in xfs/os/utils.h (Takaaki Nomura).
-570. Add a new Xserver configuration utility -- XF86Setup (Joe Moss).
-569. Remove the "-noscale" flag from the Xserver usage message (Joe Moss).
-568. Fix session handling of xdm for *BSD (Peter Wemm).
-
-XFree86 3.1.2Ea (10 June 1996)
-567. xf86config.c update in preparation for the XF86Setup utility (Joe Moss).
-566. Fix some Mach64 problems in the SVGA ati driver (Marc Aurele La France).
-565. Fix the xf86GetClocks prototype (Marc Aurele La France).
-564. Fix MakeDirectories rule (Stephen Hocking).
-563. By default, don't change PCI burst settings for TGUI (Alan Hourihane).
-562. Fix interlaced modes for the SVGA ali driver (Thomas Graichen).
-561. xfs updates for OS/2 (Sebastien Marineau).
-560. Fix some TGUI problems introduced in 3.1.2E (Alan Hourihane).
-559. Fix problems with scanpci on NetBSD (Michio "Karl" Jinbo).
-558. Some cleanups/removal of compiler warnings (Christos Zoulas).
-557. Patch for compiling on BSD/OS 2.1 (Mike Bernson).
-556. Turn off the Xaw3d arrow scrollbar support in xterm by default (it
- causes xterm to suck CPU), and make it an option/resource
- (Thomas E. Dickey).
-555. Reinstate the "no_program_clocks" for TGUI9440 chips (Alan Hourihane).
-554. XInput updates, including motion history support for the joystick and
- elo devices, removing auto link speed detection for the elo -- it is
- now set with the LinkSpeed XF86Config option, and added acceleration
- handling for relative devices (Patrick Lecoanet and Frederic Lepied).
-553. Add VGA16 support to the ET3000 driver (Thomas Graichen).
-552. Fix for first button click in a xterm being mistaken for a double
- click (Kaleb Keithley).
-551. Fix for server crash on Alpha when using the logo screen saver
- (Manabe Takashi).
-550. xkb datafile updates, including more/better European keymaps, pc102
- geometry and keycodes (Stuart Anderson, courtesy Metro Link).
-549. Fix xterm problem on *BSD (VMIN initialisation) that would cause
- rlogin to fail (Matthieu Herrb).
-548. Fix problems when a dynamic module is specified with an absolute path.
-
-XFree86 3.1.2E (13 May 1996)
-547. Fix Trio64V+ problem with DAC entry#255 for color mode 0 (1 8bpp/DCLK)
- by only using color mode 8 (2 8bpp pixel/DCLK, CR67=10) (Harald Koenig).
-546. Added options to the S3 server to slow down DRAM and EDO DRAM access
- (Harald Koenig).
-545. Add inlined assembler code to do unaligned access on Alphas
- (Harald Koenig).
-544. Fix a font corruption problem for Alphas in cfb (Harald Koenig).
-543. Fix sample Xcms.txt colour entries (Harald Koenig).
-542. Fix some problems building the a.out DLL version of libX11
- (Harald Koenig).
-541. OS/2 updates (Sebastien Marineau).
-540. Fix(?) server crash on keyboard input when using DGA with XKB disabled.
-539. Install xterm termcap/terminfo files in lib/X11/etc for all OSs, not
- just SYSV/SVR4.
-538. Convert egc_asm.s to the portable assembler format so it can be built
- on SVR4 (Takaaki Nomura).
-537. Fix Mach64 ghostview scrollbar problem. This may also fix some font
- corruption problems seen in Netscape (Kevin Martin).
-536. Fix Mach64 ol[v]wm icon problem (Kevin Martin).
-535. Add Mach64 cursor in doublescan mode -- this still has problems
- (Kevin Martin).
-534. Add Mach64 doublescan mode for low resolution modes (only works so far
- for the VT chip) (Kevin Martin).
-533. Fix Mach64 264VT support in the Mach64 server (Kevin Martin).
-532. Update the xterm termcap and terminfo descriptions (Thomas E. Dickey).
-531. Fix an xterm bug where XmbLookupString is used even though an
- IM/IC isn't open/used (Kaleb Keithley).
-530. Fix a clock roll-over bug in xterm (Kaleb Keithley).
-529. Add some new locale aliases used by Solaris 2.5 and some other OSs
- (Kaleb Keithley).
-528. Fix some potential data overruns with long environment variables in
- libX11 and libXt which could create security holes in suid root
- programs like xterm (Kaleb Keithley).
-527. Fix makedepend's handling of long typed defines (eg, 1993L)
- (Kaleb Keithley).
-526. User alloca on UnixWare (Kaleb Keithley).
-525. Improved fix for removing compiled keymap files (Kaleb Keithley).
-
-XFree86 3.1.2Dj (12 May 1996)
-524. Disable POSIX_TERMIOS in xterm for FreeBSD versions prior to 2.1.
-523. Add a document for XInput (Frederic Lepied).
-522. Have the server remove the compiled keymap file when shutting down
- (Joe Moss).
-521. Fix problem of XkbListComponents() not listing anything in
- subdirectories (Joe Moss).
-520. Fix passing of button events for the Joystick (Frederic Lepied).
-519. NetBSD documentation updates (Matthieu Herrb).
-
-XFree86 3.1.2Di (11 May 1996)
-518. Modify xterm to revoke() its pty before opening it on *BSD
- (Matthieu Herrb).
-517. Fix xterm not sending SIGHUP to its children when it dies on *BSD
- (Matthieu Herrb).
-516. Fix some problems that were preventing extended Mouse devices from
- working.
-515. Add "Port" as a synonym for "Device" in the Pointer section.
-514. Fix Makefile dependencies for dynamically loaded XInput modules.
-513. Fix screen saver blanking for Mach64 CT at 16bpp and 32bpp.
-512. Remove the directory components from the XKB parameters in the sample
- XF86Config files, and from the XF86Config files generated by xf86config.
-511. Fix Mach64 memory mapping bug introduced in 3.1.2Dg.
-
-XFree86 3.1.2Dh (10 May 1996)
-510. Fix for some image problems on VGAWonder V3, V4 and V5 adapters
- (Marc Aurele La France).
-509. Enable TERMIOS for xterm on Linux/Alpha (Kazushige Goto).
-508. Make the "clkdiv2" option a valid option for most accelerated
- servers (Koen Gadeyne).
-507. Unified the global function names to use the xf86 prefix in the XInput
- code (Frederic Lepied).
-506. Add support for motion history for extended input devices (implemented
- for the Wacom driver) (Frederic Lepied).
-505. Oak documentation updates (Jorge Delgado).
-504. Fix compiler warnings introduced in 3.1.2Dg (Thomas E. Dickey).
-503. OS/2 updates (Sebastien Marineau and Holger Veit).
-502. Fix formatting of xtrans error messages (Holger Veit).
-501. S3 image fixes for Alpha (Harald Koenig).
-
-XFree86 3.1.2Dg (6 May 1996)
-500. X98 updates for PANIX(98) support (X98 core team).
-499. Allow halved clocks to be used with the VGA servers (Koen Gadeyne).
-498. Use same xlfd value rounding for alpha as for i386 (Harald Koenig).
-497. Support for Linux/Alpha (Jay Estabrook, Craig Ruff, Harald Koenig
- and others?).
-496. Fix autorepeating modifier keys (Kaleb Keithley).
-495. Fix nonMuxMaxClock for S3 864/868 (Harald Koenig).
-494. Make sure that imake, xinit and the XFree86 servers don't inherit
- a SIGCHLD signal handler of SIG_IGN (Marc Aurele La France).
-493. Fix default HSkew for ATI 28800 cards (Marc Aurele La France).
-492. Fix typo in SuperProbe/PCI.c (Holger Veit).
-491. Colour xterm fixes -- fixes inner border being painted with the wrong
- colour (Thomas E. Dickey).
-490. More X server prototyping fixes -- mostly for Xserver/Xext
- (Thomas E. Dickey).
-489. DGA support for the P9000 server (Erik Nygren).
-
-XFree86 3.1.2Df (15 April 1996)
-488. Changes to xf86Config.c in preparation for XF86Setup sharing this
- code (Joe Moss).
-487. Prevent SuperProbe from falsely detecting non-VGA PCI devices.
-486. Config/Imake support for building LBX (Holger Veit).
-485. OS/2 updates (Holger Veit and Sebastien Marineau).
-484. Add support for the I128 8MB board with the IBM528 RAMDAC (Robin Cutshaw).
-483. Add prototyping for Xserver/dix, and fix copyright notices in new
- header files (Thomas E. Dickey).
-482. Replace the vsync wait delays in the ICD2061A code with a 20ms usleep
- (Harald Koenig).
-481. Ensure that the S3 server clears the screen to black even when
- '-flipPixels' is used, and erase the S3 HW bug test patterns after
- completing the tests (Harald Koenig).
-480. Fix incorrect S3 HW cursor offset after VT switching (Harald Koenig).
-479. Fix SuperProbe's memory probing for S3 cards with more than 4MB,
- and add detection for the TVP3030 RAMDAC (Harald Koenig).
-478. Fix some S3 TVP3026 problems introduced in 3.1.2Dc (Harald Koenig).
-477. Add support to the S3 server for the ELSA Gloria-8 card (except the
- GLint 300SX 3D chip) (Harald Koenig).
-476. Fix for POSIX termios support in xterm (Matthieu Herrb).
-475. Add -li386 to ServerExtraSysLibs for NetBSD (Matthieu Herrb).
-474. Fix problems when XINPUT isn't defined (Kaleb Keithley).
-473. Fix for TGUI 9320 LCD support (Alan Hourihane).
-472. Imakefile updates for X98, and PCI detection added for TGUI9320
- (Michio "Karl" Jinbo).
-
-XFree86 3.1.2De (31 March 1996)
-471. Change the default HSkew calculation (Marc Aurele La France).
-470. Add detection of the ATI 264VT, 264VT2 and 264GT to the ati driver,
- SuperProbe, scanpci, and the Mach64 server (Marc Aurele La France).
-469. Fix the W32 server's reporting of the bits/rgb resolution (Koen Gadeyne).
-468. Add ICD2061A clockchip support to the W32 server (Koen Gadeyne and
- Peter Chang).
-467. Add support for PowerWindow968, Cyber9320 and TGUI9680 (X98 core team).
-466. Fixes for XF98_NEC480 on PANIX-PC98 (X98 core team).
-465. Remove X98 style version info from the server startup messages
- (X98 core team).
-464. Improve stability of the XF98_PWSK server (X98 core team).
-463. Add some missing XFreeXDGA #ifdefs (Kaleb Keithley).
-462. Fix problem of the XKB keymaps not getting loaded when using the
- Xqueue keyboard driver on SVR4 (Joe Moss).
-461. Add POSIX termios support to xterm, and use it for BSD Net/2
- derived systems. This removes the need for kernels on those systems
- to be compiled with COMPAT_43 in order to run xterm (Matthieu Herrb).
-460. Update the I/O enabling in the X servers and SuperProbe for
- NetBSD-current (Matthieu Herrb).
-459. Save the S3 cursor colour stack (CR4A/CR4B) (Harald Koenig).
-458. Add macro button support to the Wacom driver, and handle more than
- six valuators to post events (Frederic Lepied).
-457. Support for the Miro Magic S4 (S3 928 + Bt485). A known problem is
- that switching between pixmux an non-pixmux modes doesn't work
- (Bernd Strobel).
-456. Fix banked mono for the SiS driver (Alan Hourihane).
-455. X server prototype cleanups and fixes, particularly in the Xi code
- (Thomas E. Dickey).
-454. Possible fix for tvga9000 and tvga8900d problems (Alan Hourihane).
-
-XFree86 3.1.2Dd (17 March 1996)
-453. Include R6.1 public patch 1.
-452. Fix incorrect type in SuperProbe/PCI.c (Thomas E. Dickey).
-451. Fix a memory leak in xterm when switching fonts (Thomas E. Dickey).
-450. Fixes for mouse problems introduced in 3.1.2Dc (Joe Moss,
- Michael Rohleder, Takaaki Nomura).
-449. Man page for the VidMode extension (Joe Moss).
-448. Modify xterm to work properly with Xaw3d's arror scrollbars (based on
- Kaleb Keithley's R5 patch).
-447. Add tilt report for the Wacom device (Frederic Lepied).
-446. Deal with DAC/clock discrepancy for Mach64 in the ati driver
- (Marc Aurele La France).
-445. Reduce warnings in the ati driver when compiling with 'gcc -Wall'
- (Marc Aurele La France).
-444. Fix recognition of ATI extended VGA register I/O port number on some
- Mach32 Mach64 PCI adapters in the ati driver (Marc Aurele La France).
-443. Add nested prototypes to xf86_HWlib.h (Marc Aurele La France).
-442. Fix typo in IBM RGB514 programming for the Mach64 (Marc Aurele La France).
-441. Fix a problem with the Mach64 server incorrectly using Block I/O mode
- on some cards.
-
-XFree86 3.1.2Dc (11 March 1996)
-440. XKB updates from recent XC fix-tracker.
-439. Fix freeing a random pointer in the module code when an absolute
- path is given (Thomas E. Dickey).
-438. Updates to Ti3026 PLL parameter limits (Harald Koenig).
-437. Support for ELSA Winner 2000PRO/X rev G (Harald Koenig).
-436. Fix 'make clean' problems for PC98 (Takefumi Tsukada).
-435. OS/2 updates (Holger Veit).
-434. Remove DEVINTPTR ifdefs by renaming the entrypoints of the affected
- functions (Thomas E. Dickey).
-433. Fix for handling of long version strings in beta servers (Harald Koenig).
-432. Some XFree86-Misc cleanups (Joe Moss).
-431. Add an extended input device supporting mouse protocols. This shares
- code with the core mouse (Frederic Lepied).
-430. Fix the behaviour of ANSI colours in xterm when reverse video is used,
- and some other xterm updates (Thomas E. Dickey).
-429. Fix SEGV with ark driver when no Ramdac is given in the XF86Config.
-428. Avoid retrace wait for S3 HW cursor when DGA is active (Jon Tombs).
-
-XFree86 3.1.2Db (5 March 1996)
-427. Fix a problem where hw cursors get recoloured incorrectly.
-426. Fix another possible Trio32 font cache problem (Harald Koenig).
-425. Another S3 968 dashed line fix (Harald Koenig).
-424. Fix RecolorCursor problems for S3 hw cursors in RAMDACs and for
- sw cursor (Harald Koenig).
-423. Add a Japanese version of the FreeBSD README (Takefumi Tsukada).
-422. Fix for problems with XF86_WSNA server (X98 core team).
-421. Add a mapping for Pointer_EnableKeys to the XKB symbols/us map (Joe Moss).
-420. XC patch for XKB.
-419. Add code to the vidmode and misc extensions to print details of mode
- keyboard and mouse setting changes (Joe Moss).
-418. Add code to recognise extra keys on Digital LK201 PC keyboards
- (Basil Duval).
-417. Don't include Multibuffer support in xdpyinfo when it isn't included
- in the X servers (Joe Moss).
-416. Fix core dump when XInput debugging is enabled (Frederic Lepied).
-415. Fix implicit grab problem with Wacom input device (Frederic Lepied).
-414. Add an "allowMouseOpenFail" XF86Config and command-line option to allow
- the server to be started when no mouse can be initialised (Joe Moss).
-413. Updates for parallel make (Robin Cutshaw).
-412. Update xf86config for the I128 server (Robin Cutshaw).
-
-XFree86 3.1.2Da (3 March 1996)
-411. Add a preinst.sh script.
-410. Documentation updates.
-409. Fix for Linux/ELF rules (H.J. Lu).
-408. Always used extended I/O for SYSV/SVR4. This is required now for
- ISC (Michael Rohleder).
-407. Fix BootstrapCFlags in sun.cf for Solaris x86.
-406. Solaris fixes for SuperProbe and the Mach64 server (Robin Cutshaw
- and James Hawtin).
-405. Wacom bug fix (Frederic Lepied).
-404. Add support for writing to stdout for gccmakedep, which is required
- for NetBSD and FreeBSD (Matthieu Herrb).
-
-XFree86 3.1.2D (24 February 1996)
-403. Fix xterm SEGV if it cannot open an input method (Manabe Takashi).
-402. Update Linux/ELF SharedLibraryTarget() (H.J. Lu).
-401. Add a BinUtilsVersion parameter for Linux, and modify ExtraLoadFlags for
- Binutils versions 2.6.0.7 and later (H.J. Lu).
-400. Set CplusplusCmd to 'c++' for Linux, set YaccCmd to byacc when
- USE_BYACC is defined, and remove $(CBRT) from ServerExtraSysLibs
- (H.J. Lu).
-399. Fix installation of some SCO rules/cf files (H.J. Lu).
-398. Modify imake.rules to include Motif rules/tmpl files when BUILD_MOTIF
- is defined (H.J. Lu).
-397. Fix argument passing typo in SuperProbe (Thomas E. Dickey).
-396. Update Cards database (Joe Moss).
-395. Documentation updates (Holger Veit, Joe Moss).
-394. Fix xset/Imakefile for OS/2 (Holger Veit).
-393. Don't use the index/rindex macros with arguments for non-ANSI compilers.
-392. Uncomment xf86cleanpci() in vga.c.
-
-XFree86 3.1.2Ch (22 February 1996)
-391. Fix xset linking for Linux a.out (Harald Koenig).
-390. Disallow interlaced modes with the SiS driver (Alan Hourihane).
-389. Change SCO interface to allow for a 128K VGA aperture
- (Marc Aurele La France).
-388. Add support to the ati driver for Mach64 cards with a base address
- other than 0x2EC (Marc Aurele La France).
-387. Introduce a new XF86Config mode option called HSkew which sets bits
- 0x60 of CRTC[3] (Marc Aurele La France).
-386. Fix colour map problem on VGA Wonder V3 boards (Randall Hopper,
- Marc Aurele La France).
-385. Allow multiple "-verbose" command line flags to increase the verbosity
- level (Marc Aurele La France).
-384. Modify xf86scanpci() so that it will be able to deal with multi-headed
- servers in the future, add an xf86cleanpci() function to allow
- the PCI data to be freed after use, allow xf86scanpci() to be called
- more than once, and fix a problem with it not always returning with I/O
- permissions disabled (Marc Aurele La France).
-383. SuperProbe updates for Mach64 and PCI (Marc Aurele La France).
-382. OS/2 updates (Holger Veit).
-381. Keyboard/mouse parameter changes with XFree86-Misc can now be disabled,
- and these are only allowable by default for local client connections
- (Joe Moss).
-380. Only check/change relevant parameters with XFree86-Misc (Joe Moss).
-379. Add new/better protocol error messages for XFree86-Misc (Joe Moss).
-378. Man page for the XFree86-Misc library functions (Joe Moss).
-377. Add detection of the SiS 86C202 and 86C205 to SuperProbe and the SiS
- driver (Alan Hourihane).
-
-XFree86 3.1.2Cg (20 February 1996)
-376. Modify the handling of the XF86Config xkb options to allow the
- -xkbmap server flag to work (it overrides what is in the XF86Config).
- The XKBKeyMap XF86Config setting will now work too, and it overrides
- any other XKB settings given there.
-375. Fix for parts of a VT switch sequence getting passed to clients when
- XKB is enabled.
-374. NetBSD.cf update (Matthieu Herrb).
-373. Fix various cases of nested comment delimiters (Thomas E. Dickey).
-372. Config additions/updates for CLIX and for HP with GCC2 (Thomas E. Dickey).
-371. Fix RecolorCursor for HW cursor in AGX, Mach32, Mach64, P9000, I128,
- Cirrus, Ark and Trident server/drivers (untested).
-370. Fix xinit problem introduced in 3.1.2Cf.
-369. S3 dashed line fix, including an option "s3_968_dash_bug" to enable
- a workaround for a 968 bug. There is code to auto-detect this problem,
- so the option shouldn't need to be specified explicitly (Harald Koenig).
-368. Fix for RecolorCursor problem with S3 HW cursors. This problem is
- also present in other accel servers (Harald Koenig).
-367. Trident linear mode updates (Alan Hourihane).
-
-XFree86 3.1.2Cf (19 February 1996)
-366. S3 update for ELSA Winner1000 cards with the AT&T 20C409 Ramdac
- (Dirk Hohndel).
-365. PC98 updates, including a new xkbcomp/compat/pc98 description
- (X98 core team).
-364. SiS driver updated (Alan Hourihane).
-363. Work around an S3 968 dashed line bug (Harald Koenig).
-362. OS/2 updates, including a new OS/2 README (Holger Veit and
- Sebastien Marineau).
-361. ISC documentation updates (Michael Rohleder).
-360. NetBSD documentation updates (Matthieu Herrb).
-359. Trident driver updates (Alan Hourihane).
-
-XFree86 3.1.2Ce (18 February 1996)
-358. PC98 documentation (X98 core team).
-357. Fix a bug in the handling of the Wacom eraser as a third button
- (Frederic Lepied).
-356. Enable the Joystick driver for NetBSD (using a port of the FreeBSD
- joystick driver to NetBSD) (Matthieu Herrb).
-355. Allow XInput dynamic loading for NetBSD (Matthieu Herrb).
-354. Use the FreeBSD way of making dependencies in .depend files for NetBSD
- (Matthieu Herrb).
-353. Change the XInput Dynamic module loading to allow a ModulePath to
- be specified in the Files section of the XF86Config, and move the
- list of loadable modules into a Modules section in XF86Config
- (Frederic Lepied).
-352. Fix some glitches in xterm's colour behaviour (Thomas E. Dickey).
-351. Modify the xf86config utility to allow XKB information to be entered
- (Holger Veit).
-350. Fix Xserver prototyping problems (Thomas E. Dickey).
-349. Modify PCI code for PC98 (X98 core team).
-348. Add PC98 server for WSN-A2F (X98 core team).
-347. XKB description files for a Japanese 106 key keyboard (Takefumi Tsukada).
-346. Probe the VGA sis driver before the the cl64xx to avoid mis-probing
- (Alan Hourihane).
-345. Modify XF86VidModeGetAllModeLines() to allocate memory in one chunk
- so it can be freed later by the client (Joe Moss).
-344. Fix incorrect handling of S3RefClock when specified in the XF86Config
- (Harald Koenig).
-343. Clean up linear mode setup in the Trident Driver (Alan Hourihane).
-342. Disable PCI burst mode by default for the Trident driver
- (Alan Hourihane).
-341. Fix a problem restoring 16bpp modes with the Mach32 server on OS/2
- (Sebastien Marineau).
-340. Fix a problem that was preventing the tgui driver from working on
- some TGUI9440 cards (Alan Hourihane).
-
-XFree86 3.1.2Cd (12 February 1996)
-339. Fix library ordering for Linux a.out for xset, xdpyinfo and xvidtune
- (Harald Koenig).
-338. Add a version check to the XInput dynamic modules (Frederic Lepied).
-337. Fix keyboard LED initialisation. This usually shows up as a problem
- on *BSD where the NumLock LED is on when the server is started.
-336. Update Linux DLL jump files (Harald Koenig).
-335. PC98 updates, including XF98Conf, and the XKB nec geometry description
- (X98 core team).
-334. Automatically treat the PS/2 protocol the same as the busmouse protocol
- on NetBSD (since that's how NetBSD's PS/2 driver works).
-333. Add XInput dynamic loading support for FreeBSD 2.x.
-332. Fix problem with XInput on non-Linux/ELF systems.
-331. xterm fixes, including updates to allow building on R5
- (Thomas E. Dickey).
-330. Add to the docs a file containing a list of PC98 cards that are
- supported (X98 core team).
-329. Documentation updates for xterm (Thomas E. Dickey).
-328. Disable the TGUI HW cursor by default (Alan Hourihane).
-327. Add PCI support to SuperProbe (Alan Hourihane).
-
-XFree86 3.1.2Cc (10 February 1996)
-326. Merge in final form of R6.1.
-
-XFree86 3.1.2Cb (9 February 1996)
-325. XC fix-trackers to seq-4114 (mostly XKB).
-324. Xlib prototyping improvements/fixes (Thomas E. Dickey).
-323. OS/2 updates (Holger Veit and Sebastien Marineau).
-322. Allow the eraser button of a wacom stylus to act as a third button
- if the WacomEraser device isn't enabled (Frederic Lepied).
-321. Allow XInput device support to be dynamically loaded. This is for
- Linux only so far (Frederic Lepied).
-320. Major updates to the ati driver, including support for the newer
- Mach64 chips and clocks, preliminary support or pre- VGAWonder V3
- adapters and generic VGA. The default chipset name has been changed
- back to "ati" from "vgawonder" (Marc Aurele La France).
-319. Properly implement xf86DisableIOPrivs and xf86Disable/EnableInterrupts
- for Linux (Marc Aurele La France).
-318. ATI doc updates (Marc Aurele La France).
-317. Remove ati.test.c, and move the functionality into the ati driver
- (Marc Aurele La France).
-316. Remove the "undoc_clocks" option (Marc Aurele La France).
-315. Make all I/O ports in compiler.h unsigned short, and all values
- unsigned char/short/int (Marc Aurele La France).
-314. Updates Mach64 probing for SuperProbe (Marc Aurele La France).
-313. Make the Linux ELF/a.out default build the same as the system default
- (Marc Aurele La France).
-312. Delete unneeded cmd/sh files in xfree98/vga256 (X98 core team).
-311. Fix problems with XF98_WABS (X98 core team).
-310. update xfree98/etc/Imakefile, and remove the *.sed files and their
- related imake rules (X98 core team).
-309. XF98_WABEP server added (for Melco WAB-EP) (X98 core team).
-308. Trident driver updates including some clock probing fixes
- (Alan Hourihane).
-307. Fix 2MB Trio64 display error problem due to incorrect parameter
- calculation (Harald Koenig).
-
-XFree86 3.1.2Ca (5 February 1996)
-306. Improve S3 Diamond BIOS detection.
-305. XC fix-trackers to seq-4104 (mostly a new XKB snapshot).
-304. Don't include the compaq driver by default -- it is broken.
-
-XFree86 3.1.2C (31 January 1996)
-303. Allow the mouse parameters (except the device) to be changed with
- the XFree86-Misc extension. This causes a close/reopen of the the
- device (Joe Moss).
-302. Fix problem introduced with the server lock code which causes a delay
- at startup.
-301. Add some checking for the mouse baud rate given in the XF86Config
- (Joe Moss).
-300. Fix for the bright left border problem with some Trio64V+ cards
- (Harald Koenig).
-299. PC98 XKB support files (Kaleb Keithley, Toyonori Fujiura).
-298. Update German XKB symbols (Thomas Mueller).
-
-XFree86 3.1.2Bo (30 January 1996)
-297. Updates for XF98Conf.cpp (Takefumi Tsukada).
-296. Add an XF86Config option for disabling XKB (Kaleb Keithley).
-295. Further OS/2 support updates, including a working X server
- (Sebastien Marineau and Holger Veit).
-294. Documentation update for PC98 (Takefumi Tsukada).
-293. Improved prototyping for Xlib.h (Thomas E. Dickey).
-292. xterm updates, including mods to allow it to be built with X11R5
- (Thomas E. Dickey).
-291. Some XFree86-Misc extension updates (Joe Moss).
-290. GlidePoint updates (Jean-Christophe Hugly).
-289. Add XInput knowledge to xdpyinfo, and update the output format of
- xsetpointer (Frederic Lepied).
-288. NetBSD updates for scanpci now that console.h isn't included any more
- (Matthieu Herrb).
-287. XC fix-trackers to seq-4086 (xsm updates).
-286. xkb symbol addition for European-style keyboards (Kaleb Keithley).
-285. Possible fix for security problem related to the X server's lock files.
-
-XFree86 3.1.2Bn (28 January 1996)
-284. Fix reporting of the ATI68860 Rev C Ramdac with the Mach64 server.
-283. Support for ALPS GlidePoint. A tap on the pad is treated as a fourth
- button (Jean-Christophe Hugly).
-282. Improved XKB support for XFree86 servers (Kaleb Keithley).
-281. Prevent mode switching and VT switching when DGA is active (Jon Tombs).
-280. Don't include for syscons with NetBSD by default.
-279. NetBSD doc updates (Matthieu Herrb).
-278. XFree86-Misc extension updates, including more sanity checking (Joe Moss).
-277. Fix some length calculations in libXxf86vm (Joe Moss).
-
-XFree86 3.1.2Bm (26 January 1996)
-276. Remove (for now) the vertical retrace wait in the S3 SetViewPort.
-275. Updates TGUI support for SuperProbe (Alan Hourihane).
-274. TGUI driver updates (Alan Hourihane).
-273. Major updates to OS/2 support (Holger Veit).
-272. Update xdpyinfo for the latest XFree86-Misc changes, and update xset
- to allow the keyboard repeat parameters to be changed (Joe Moss).
-271. Add functions to the XFree86-Misc extension to allow getting and
- setting mouse and keyboard configuration (Joe Moss).
-270. Remove the low ICS5342 clock limit (Harald Koenig).
-269. Add an "XF98Config.cpp" from which a sample config file suitable for
- the X98 servers is generated (X98 core team).
-268. Update Imakefiles under hw/xfree98 (X98 core team).
-267. Fix for make dependency problem with BSD make and the XFree86 drivers
- subdirectories (Matthieu Herrb).
-266. X Consortium fix-trackers to seq-4084 (mostly XKB and doc updates).
-265. Allow the XInput debug level to be set from the XF86Config
- (Frederic Lepied).
-
-XFree86 3.1.2Bl (21 January 1996)
-264. Fix xterm IM problem if *inputMethod == "" (Kaleb Keithley).
-263. Xvfb fix for systems that have mmap, but not the MS_ASYNC flag for
- msync().
-262. XC fix-trackers to seq-4060 (some XKB and config updates).
-261. 6-bit/rgb fix for the I128 server (Robin Cutshaw).
-260. Update hw/xfree98 Imakefiles (Takefumi Tsukada).
-259. Add a GetAllModeLines function to the VidMode extension, and modify
- xdpyinfo to use it (Joe Moss).
-
-XFree86 3.1.2Bk (17 January 1996)
-258. Don't allow DGA operations which affect the server when it isn't on
- the active screen.
-257. Have XFree86-Misc report the power saver times in seconds rather
- than milliseconds (to be consistent with XGetScreenSaver).
-256. Modify xset to allow setting/viewing the power saver parameters via
- the XFree86-Misc extension.
-255. Modify the VidMode extension to disallow both mode switches and
- the locking/unlocking of mode switching when DontZoom has been set
- in the XF86Config.
-254. Only allow the DGA extension to accept local connections.
-253. Fix Home/End key support in xterm (Thomas Mueller).
-252. Add support for VT200 compatible cursor on/off to xterm (Thomas Mueller).
-251. Add support for the XFree86-Misc extension to xdpyinfo (Joe Moss).
-250. VidMode/xvidtune updates (Kaleb Keithley).
-249. XC fix-trackers to seq-4055 (mostly XKB fixes).
-248. Fix link ordering of new libraries (Thomas Mueller).
-247. Add some missing XKB #defines (Thomas Mueller).
-246. Fix typo in include/extensions/Imakefile (Thomas Mueller).
-
-XFree86 3.1.2Bj (16 January 1996)
-245. Remove the XExExt library, and replace it with individual libraries
- for each extension.
-244. Remove the GetSaver/SetSaver functions from the VidMode extension
- and add them to a new extension: XFree86-Misc.
-243. Cleanup VidMode extension code -- removing "vgahelp" references
- (Kaleb Keithley).
-242. Allow the write functions of the VidMode extension to be disabled
- for non-local clients (default), and all clients (Kaleb Keithley).
-241. XC fix-trackers to seq-4052 (new XKB snapshot).
-240. README.S3 updates (Paul Gortmaker).
-239. Do framebuffer address scan for all VLB Trio64 cards, not just those
- with > 1MB.
-238. Fix typo in trident driver (Alan Hourihane).
-237. Modify the I128 server to use xf86scanpci() rather than its own PCI
- probe (which didn't work for PCI config type 1 boards) (Robin Cutshaw).
-
-XFree86 3.1.2Bi (14 January 1996)
-236. Enable dynamic allocation of XInput devices to allow for multiple
- instances of the same device type. The Joystick2 device has been
- removed (Frederic Lepied).
-235. Fix typo in a recent xconsole fix (Michael Rohleder).
-234. Add POSIX build config option for ISC, and change the Vendor name to IUS
- (Interactive Unix System) (Michael Rohleder).
-233. Disable linear mode by default for non-PCI Trident cards (Alan Hourihane).
-232. Fix some compiler warnings in various parts of the source (Fred Appelman).
-231. Fix xterm compile problem with -DALLOWLOGGING (William Austin).
-230. Fix compile problem in resize for NetBSD (Matthieu Herrb).
-
-XFree86 3.1.2Bh (13 January 1996)
-229. Fix dga speed test problem when the bank size is less than 64k.
-228. Add DGA support to the Mach32 server (untested).
-227. Add SVGA-based servers for PC98 (Cirrus driver) (X98 core team).
-226. Update the Cirrus driver to use the vga PCI probe data (not tested).
-225. Include XC fix-trackers to seq-4035 (mostly fixes for Solaris 2.5
- build problems).
-224. Update xdpyinfo to print some info about XKB (Joe Moss).
-223. Fix(?) problem some people see with vertical lines / black screens
- with the Trident driver (Alan Hourihane).
-222. Update the Trident and SiS drivers to use the vga PCI probe data
- (Alan Hourihane).
-221. Define SetTtyGroup for Linux (Kevin Martin).
-
-XFree86 3.1.2Bg (12 January 1996)
-220. Fix cursor colour for TGUI 9660/9680 (Alan Hourihane).
-219. LynxOS fix for xterm's resize (Thomas Mueller).
-218. Write beta marker file as the user's real uid rather than as root.
-217. Fix DGA for SVGA cards using banked memory, and enable it for most
- SVGA drivers.
-216. Add a PCI probe to the VGA servers. The happens before the chipset
- probes, and may be disabled with the "no_pci_probe" option.
-215. Add 16bpp support for Trident 8900D, and some cleanups (Alan Hourihane).
-214. Add install.linkkit target to the top level Makefile.
-
-XFree86 3.1.2Bf (11 January 1996)
-213. Xinput updates, including: improved error handling, "Screen" option
- renamed to "ScreenNo" for consistency, new config options for the
- Wacom tablet, update to the Linux joystick support, and a fix
- for xsetmode (Frederic Lepied and Patrick Lecoanet).
-212. Fix core dump when exiting an X server started with XKB enabled.
-211. Update accelerated servers' use of miZeroClipLine().
-210. Include XC fix-trackers to seq-4031 (includes update of RECORD spec
- to version 1.13, some Xlib and xterm fixes, and preliminary ISO Latin-2
- compose support).
-209. Add code to detect the Trio32 BITBLT bug, and automatically enable
- the workaround when it is detected (Harald Koenig).
-208. Final changes for POSIXized ISC build (Michael Rohleder).
-207. Define NO_READAHEAD for ISC in xconsole (Michael Rohleder).
-206. Fix(?) Xalloca.h problem on Solaris 2.5.
-205. Fix missing XFreeDGA #ifdef in change 187 (Kaleb Keithley).
-
-XFree86 3.1.2Be (10 January 1996)
-204. Fix build with BuildServersOnly set to YES (Takefumi Tsukada).
-203. Major xterm cleanup (including prototyping), and fixes to the colour
- code (Thomas E. Dickey).
-202. PC98 EGC (16 colour) server added (X98 core team).
-201. Updates for LynxOS AT, including a workaround in the xkb clients
- for the fact that stdin/out/err isn't a valid initialiser
- (Thomas Mueller).
-200. Modify the dga test program to use GetTimeInMillis() (Tiago Gons).
-199. Fix merge problem in xconsole (Michael Rohleder).
-198. Initial changes to POSIXize the ISC build (Michael Rohleder).
-197. Fix a clash of symbols between libX11 and the X server's libxkb which
- shows up when building Xnest on ISC (Michael Rohleder).
-196. Fix XKB merge problem in xf86Events.c (Kaleb Keithley).
-195. Complete the logging code in xalloc (Pascal Haible).
-
-XFree86 3.1.2Bd (8 January 1996)
-194. Fix a build problem when BuildServersOnly is set to YES.
-193. Clean up the InstallManPageLong() run for NetBSD (Takefumi Tsukada).
-192. Modify ForceSubdirs() rule for NetBSD and FreeBSD so that it works
- with GNU make (Matthieu Herrb).
-191. Fix a Ti3026 clock problem that appears on SPEA 968+Ti3026 cards
- (Harald Koenig).
-190. Fix TGUI 9440 HW cursor problems (Alan Hourihane).
-189. Fix problems with the TGUI 9660/9680 support (Alan Hourihane).
-188. Fix 256-colour interlace problem with TGUI cards (Alan Hourihane).
-187. Fix for text mode restore problem when the DGA extension has been
- used with the SVGA server (Alan Hourihane).
-186. Set the Block I/O bit in the PCI userconfig register for Mach64 cards
- that report an I/O address range.
-
-XFree86 3.1.2Bc (7 January 1996)
-185. Update lnxLib.rules for new GNU elf tools which look for libname.so
- rather than libname.so.rev at link time (Helmut Geyer).
-184. Set default ProjectRoot back to /usr/X11R6.
-183. Include fix-trackers to seq-4024 (includes more a more recent XKB snap,
- some record updates, and some config and Xlib updates).
-182. Fix some merge problems.
-
-XFree86 3.1.2Bb (6 January 1996)
-181. Merge in X11R6.1 beta.
-180. Fix problems with the ARK/ICS5342 clock programming (Leon Bottou).
-179. Fix problem with Mach64 CT cards that incorrectly appear to be using
- block I/O.
-
-XFree86 3.1.2Ba (3 January 1996)
-178. Fix support for the old ET4000 in the et4000 driver.
-177. Fix problem with the SIS driver that can cause a server crash
- (Alan Hourihane).
-176. Modify linux config for building a.out binaries on Slackware 3.0.
-175. Fix Linux Joystick compilation problems.
-174. Doc updates.
-
-XFree86 3.1.2B (28 December 1995)
-173. Fix a problem with the ARK/ICS5342 clock programming (don't know if this
- completely fixes the clock programming problems).
-172. Don't do PCI probe in S3 server for PC98 (Takefumi Tsukada).
-171. Fix bank select problem with S3 911 cards when using DGA.
-
-XFree86 3.1.2Af (26 December 1995)
-170. Added README.DGA which gives a brief outline of the API for the DGA
- extension. This should be converted to man pages.
-169. Added a simple standalone program (joycal) to get the Joystick
- calibration coordinates.
-168. Modify the Joystick code to auto-detect the centre values at startup
- if they are not given the XF86Config (this assumes that the Joystick
- is centred when first enabled).
-167. Add XInput Joystick support for FreeBSD 2.x.
-166. Remove the strict membase checking for "orchid_p9000" in the P9000
- server so that the correct membase can be specified for some other
- types of P9000 cards which are not explicitly supported.
-165. Fix problem with the trident driver in the VGA16 server (Alan Hourihane).
-164. XF86Config(4/5) man page additions for the XInput section
- (Frederic Lepied).
-163. Update xfree98/Imakefile (Takefumi Tsukada).
-162. Remove the "no_ti3026_curs" option again.
-161. Updates for xdpyinfo's Imakefile and the Xinput code for ISC
- (Michael Rohleder).
-
-XFree86 3.1.2Ae (23 December 1995)
-160. A new document called QuickStart.doc which is a quick-start guide
- to XFree86 setup (Joe Moss).
-159. Add a PCI probe to the S3 server, and use the membase value reported
- when it is non-zero. This should help for some TrioV64+ cards.
-158. Move the DGA client-side helper functions into libXExExt.
-157. XInput support for XFree86. This includes device support for two
- Joysticks (Linux-only so far), Wacom tablet (Wacom IV protocol only),
- and Elographics touchscreen. Two utility programs are included.
- xsetpointer can be used to make an extended device the core pointer
- or to list the extended devices. xsetmode can be used to set a device
- in absolute or relative mode (Frederic Lepied and Patrick Lecoanet).
-156. Workaround for a hardware bug in some S3 Trio32 revisions which causes
- font corruption when using the font cache. This is currently enabled
- with the "trio32_fc_bug" Option (Harald Koenig).
-155. Logging support for the internal xalloc code (Pascal Haible).
-154. Fix the S3 server's detection of the Trio64V+.
-153. Fix problems building the PC98 code (Takefumi Tsukada).
-152. LynxOS support for the DGA extension (Thomas Mueller).
-151. Fix a problem were XListFonts() can return fewer font names than
- XListFontsWithInfo() (Manabe Takashi).
-150. Add knowledge of the XFree86-VidModeExtension, XFree86-DGA and LBX
- extensions to xdpyinfo (Joe Moss).
-149. Add a benchmark function to the dga test program. It is activated with
- the 'b' key (Koen Gadeyne).
-148. Change all servers to default to blackPixel = 0 and whitePixel = 1,
- and allow this default to be swapped with the -flipPixels server
- command line flag (Michael Rohleder).
-147. Restore the "no_ti3026_curs" option to the S3 server (Harald Koenig).
-146. Trident driver and documentation updates (Alan Hourihane).
-
-XFree86 3.1.2Ad (21 December 1995)
-145. Fix for incorrect usage of S3 PIX_TRANS writing (Takefumi Tsukada).
-144. PC98 support integrated into the main XFree86 source tree. The PC98
- code gets built under xc/programs/Xserver/hw/xfree98 (Takefumi Tsukada
- and the X98 team).
-
-XFree86 3.1.2Ac (17 December 1995)
-143. Modify the XDGA implementation in the server, and add support for it
- to the Mach64 server. Also, XDGA is now enabled for all OSs since there
- are now no OS-specific parts on the server side.
-142. Add "no_font_cache" and "no_pixmap_cache" options to allow the font
- cache and pixmap cache/expansion to be disabled in the S3 and Mach64
- servers.
-141. Fix positioning and shape of the Bt485 HW cursor for doublescan modes
- in the S3 server.
-140. Fix positioning of the HW cursor for interlaced and doublescan modes
- with the IBM RGB RAMDACs in the S3 server. The cursor shape still
- isn't correct though (Trent Piepho and R.E. Wolff).
-139. HW cursor support for the Trident 9660/9680 and 9430 -- not tested
- (Alan Hourihane).
-138. XFree86-DGA extension support for ISC SVR3 (Michael Rohleder).
-137. Fix for "XIOerror 11 (Resource temporarily unavailable)" errors while
- running xterm on ISC (Michael Rohleder).
-136. Major Trident driver updates, including HW cursor for 9440, and
- an option to use a set of fixed clocks instead of fully programmable
- clocks for the TGUI chips (Alan Hourihane).
-135. I128 updates (Robin Cutshaw).
-134. Mach64 support for ATI Extended VGA register location on PCI
- cards with block I/O (Kevin Martin).
-133. Clean up Mach64 software cursor support (Kevin Martin).
-132. "dac_8_bit" is now the default for supported RAMDACs in the Mach64
- server. 6-bit mode can be forced with the "dac_6_bit" option
- (Kevin Martin).
-131. Mach64 support for the ATI Graphics Pro Turbo 1600, including
- 1600x1200 mode support (Kevin Martin).
-130. Mach64 support for the IBM RGB514 RAMDAC (Kevin Martin).
-129. Mach64 support for the GX-F (GX rev 3) (Kevin Martin).
-128. Add new options "w32_interleave_on" and "w32_interleave_off" to
- the SVGA and W32 servers. They allow the desired mode to be
- forced for W32i and W32p cards (Dirk Hohndel).
-127. Full STG1703 support for W32 server (Dirk Hohndel).
-126. Fix some incorrect prototype ifdefs in xf86.h (Kaleb Keithley).
-125. Modify xterm to call XtSetLanguageProc() rather than setlocale()
- (Kaleb Keithley).
-124. Preliminary driver for the SIS 86C201 chipset (VGA2 and VGA16 only
- so far) (Alan Hourihane).
-123. Change the Mach64 aperture mapping to map the video memory and
- mmapped registers into two separate areas rather than mapping the
- entire 8MB aperture range.
-122. Use an 8MB aperture for all but ISA Mach64 cards since most of the
- newer Mach64 chips only support an 8MB aperture size.
-121. Fix typo in Mach64 server that was causing some RAMDACs to be incorrectly
- detected.
-120. Fix aperture address detection for VLB Mach64 cards.
-119. In the Mach64 server, set RAMDAC to 20C408 if the 20C408 clock type
- is detected, and same for STG1703.
-118. SIGWINCH support for xterm on ISC 4.x (Geoff Steckel).
-
-XFree86 3.1.2Ab (9 December 1995)
-117. FreeBSD support for the DGA extension.
-116. Split the DGA code out into a separate extension (called XFree86-DGA)
- (Kaleb Keithley).
-115. Fix some compiler warnings when compiling on LynxOS (Thomas Mueller).
-114. Fix some byte swapping problems in XFree86-VidModeExtension
- (Thomas Mueller).
-113. Add preliminary STG1703 support to the W32 server. No clock
- programming and no pixmux yet (Dirk Hohndel).
-112. Add new options "pci_burst_on" and "pci_burst_off" to SVGA and
- W32 server. They will allow to solve display problems on many
- ET4000/W32p based cards (Dirk Hohndel).
-111. Add new clock selection scheme to SVGA and W32 server, so that
- 32 clocks are used. The first 16 are the same as before, the
- second 16 use CS3 (Dirk Hohndel and Koen Gadeyne).
-110. Add STG1703 detection to SuperProbe for ET4000/W32 based cards (Dirk
- Hohndel).
-109. Fix extension version checking in xvidtune.
-108. Modify xterm to call XSupportsLocale() before initialising I18N
- support (William Volkman).
-107. Fix S3 support for clocks up to 135MHz in 8 bpp for S3 868 cards
- with ATT20C409 Gendac (e.g., Elsa Winner 1000AVI) (Dirk Hohndel).
-106. Fix S3 HW cursor handling for doublescan modes (Jon Tombs).
-105. Config and doc updates for NetBSD 1.1 (Matthieu Herrb).
-104. Preliminary (unaccelerated) I128 server code (Robin Cutshaw).
-103. Attempt to fix problem of Mach64 server mis-detecting the CH8398
- RAMDAC.
-102. Modify the Mach64 server to use the membase address it reads from
- the configuration registers.
-101. Fix cursor colour problem at 16, 32bpp with the Mach64 server.
-100. Support for the Mach64 CT.
-
-XFree86 3.1.2Aa (2 December 1995)
- 99. Fix for xterm behaving badly when TERM is set to "vt100" (Joerg Wunsch).
- 98. XDGA (direct graphics access) support added via the XFree86 VidMode
- extension. This is primarily intended for games support. Currently
- it is implemented only for Linux, and for the S3 and Cirrus drivers
- (Jon Tombs).
- 97. Fixes for Ti3026 loop clock calculation code (Dirk Hohndel).
- 96. Detection and preliminary support for the Elsa Winner2000PRO/X-2,4 Rev.G
- which has a S3-968, Ti3026, and ICS9161A clock chip. Clock doubling
- doesn't work yet (Dirk Hohndel).
- 95. Mach64 code cleanups and documentation updates (Kevin Martin).
- 94. Fix Mach64 pixmap cache bug which resulted in xcalloc being called
- with a negative size (Kevin Martin).
- 93. The state of the AT&T20C408 is now saved/restored by the Mach64 server.
- This should fix the dim screen problem when exiting from the server
- (Kevin Martin).
- 92. ClockChip and Ramdac can now be specified in the XF86Config for the
- Mach64 server (Kevin Martin).
- 91. Mach64 server ATI 18818/ICS 2595 clock chip programming now works
- (Kevin Martin).
- 90. Mach64 server now automatically programs a programmable clock chip
- when present. This can be overridden with the "no_program_clocks"
- Option. The "program_clocks" option has been removed (Kevin Martin).
- 89. Initial changes to allow for integration of the I128 server
- (Robin Cutshaw).
- 88. Avoid defining __USLC__ for MP/RAS in compiler.h (Kaleb Keithley).
- 87. If the server can't find an XF86Config file, print out the files it
- tried to open (Joe Moss).
- 86. Fix(?) display centering for the Cirrus 754x.
- 85. Fix text mode clock problem in ET4000/W32 server (Koen Gadeyne).
- 84. Remove the "-noscale" flag from the Xserver and xfs since it has
- been obsoleted by the ":unscaled" fontpath attribute.
- 83. Remove the RepeatedMiddle mouse option because it doesn't work
- properly (Jon Tombs).
- 82. Remove some casts in xf86MouseProtocol() to work around in the
- Metaware compiler/NCR assembler (Kaleb Keithley).
- 81. When the X server exits due to an unrecognised command-line option,
- print out the offending option (Joe Moss).
- 80. Remove '-lc_s' from ExtraLibraries for ISC (Michael Rohleder).
- 79. Add code to SuperProbe and the Cirrus driver to recognise the
- CL-GD7542 (and a guess for the CL-GD7541).
- 78. Fix RAMDAC probe problem introduced into the S3 server in 3.1.2e
- (Joe Moss).
-
-XFree86 3.1.2A (19 November 1995)
- 77. Added a Beta Report template form.
- 76. Update xf86config for some of the new Ramdacs.
- 75. Allow 'Ramdac "ibm_rgb526" to be recognised by the S3 server. It
- then treats it as an RGB524.
- 74. Modify the beta startup message usage so that it gets printed once
- for each different server started.
- 73. Fix for AGX-010 clock probing (Henry Worth).
-
-XFree86 3.1.2e (16 November 1995)
- 72. Updates to the Cards database.
- 71. S3 868 + AT&T 20C409 support (8/15/16/24bpp) without pixmux, and
- S3-868 + AT&T 20C499 support (untested) (8/15/16/24bpp, no pixmux).
- Pixmux support is enabled, but not functional (Dirk Hohndel).
- 70. Update SuperProbe to recognise AT&T 20C409 and AT&T 20C499 RAMDACs
- (Dirk Hohndel).
- 69. Allow attributes to be appended to elements of a font path. The
- attributes are introduced by a ':' character, and multiple attributes
- are separated by a ':'. Currently the attribute "unscaled" is
- supported for bitmap fonts, and this prevents them from being scaled.
- 68. Trident driver cleanups, and fixes for interlacing (Alan Hourihane).
- 67. LynxOS updates for using MetroLink Motif (Thomas Mueller).
- 66. Preliminary AT&T 20C409 support for the S3 server (not functional
- yet) (Dirk Hohndel).
- 65. W32 updates to Xserver and SuperProbe (Dirk Hohndel and Koen Gadeyne).
-
-XFree86 3.1.2d (12 November 1995)
- 64. Fix a typo in the iso8859-1 Compose file.
- 63. Add a '-noscale' flag to the Xserver and xfs to allow scaling of
- bitmap fonts to be disabled. The keyword DontScaleBitmapFonts
- in the ServerFlags section of the XF86Config file has the same affect.
- 62. Fix problem that prevents bitmap fonts from being scaled after
- running something like 'xset fp rehash'.
- 61. Add a Release Date to the X server startup messages.
- 60. Add a "RELNOTES" document to describe changes in beta releases.
- 59. Fix panning for ARK2000PV chips with 2MB of memory (Leon Bottou).
- 58. Support for ICS5342 programmable clock in the ARK driver (Leon Bottou).
- 57. Major updates to the Oak driver, including more accelerated functions
- for the OTI087 (Jorge Delgado).
- 56. Option "program_clocks" added for the Mach64 server to allow
- arbitrary clocks to be programmed for most clock chips. This
- currently doesn't work with the ATI18818/ICS2595 chips (Kevin Martin).
- 55. Mach64 server support for the AT&T 20C408 (Kevin Martin).
- 54. Fix problem of two undisplayed pixels with the CL-GD7543
- (Thomas Zerucha).
- 53. Add support for three button operation with some dual protocol mice
- when they are in Microsoft-compatible mode. The keyword to enable
- this is 'RepeatedMiddle' (Jon Tombs).
- 52. Fix 3 button emulation problem introduced in item 48 (Thomas Mueller).
- 51. Add support for '-crt /dev/ttyXX' command line option for the X
- servers for SCO. This is for compatibility with the native SCO X
- servers (Didier Poirot).
-
-XFree86 3.1.2c (5 November 1995)
- 50. Add expiry date and startup message for beta versions.
- 49. Fix problem using a LinkKit generated with BuildLBX set to YES.
- 48. Allow a real middle button event to be passed when 3 button mouse
- emulation is enabled (Thomas Wu).
- 47. Fix panning and some initial clock selection problems for TGUI9440
- cards (Alan Hourihane).
- 46. Support for the Cirrus CL-GD7543 (Thomas Zerucha).
- 45. Fix for instability problems with Cirrus programmable clock
- (Koen Gadeyne).
- 44. Fix memory overwrite problem in xterm which could be a security
- problem.
- 43. Merge in the X Consortium's public patch 13.
- 42. Define X_LOCALE for LynxOS for compatibility with Metrolink's
- Motif package (Thomas Mueller).
- 41. Update SuperProbe to recognise the Cirrus CL-GD7543.
- 40. The Trident driver now automatically selects the "tgui" clockchip
- when it detects a TGUI9440 (Alan Hourihane).
- 39. Remove the dependency on -lthread for UnixWare 2.x, while still
- allowing full MT support. This is done by adding a threads stub
- library with weak symbols (David Wexelblat).
-
-XFree86 3.1.2b (22 October 1995)
- 38. Updated Japanese docs, including SGML versions suitable for formatting
- with jlinuxdoc-sgml. These docs use EUC encoding (Kazuyuki Okamoto).
- 37. Preliminary support for the Trident TGUI9440 (Alan Hourihane).
- 36. Add an "AllowNullPasswd" resource to xdm to make it possible for xdm
- to login to accounts with a null password. This is set to "False"
- by default (Joerg Wunsch).
- 35. Use dynamically allocated strings in xrdb to avoid overruns that
- can occur otherwise (Joerg Wunsch).
- 34. Add ELSA Winner 2000PRO/X-8 to the S3 ELSA probe code (Dirk Hohndel).
- 33. Fix S3 probe of IBM RGB RAMDACs incorrectly identifying an RGB528
- or RGB528A as an RGB524 (Dirk Hohndel).
- 32. Fix incorrect memory probe for S3 964/968 (Dirk Hohndel).
- 31. Prelim pixmux support for ICS5341 RAMDAC in W32 server (Dirk Hohndel).
- 30. Support for ICS5341 programmable clock in W32 server (Dirk Hohndel).
- 29. Add RFC1700-conformant charset names for ISO-8859 locales to
- locale.alias.
- 28. Fix LynxOS video mapping problem that shows up when the "fb_debug"
- option is set in the S3 server (Thomas Mueller).
- 27. Fix reference to undeclared variable in os/xalloc.c for OSs which
- don't have MMAP_ANON or MMAP_DEV_ZERO defined (Thomas Mueller).
- 26. Fix W32 server core dump on LynxOS when run with '-probeonly'
- and no Clocks line in the XF86Config file (Thomas Mueller).
- 25. Fix reference to uninitialised string in Hercules mono driver
- (Paul Gortmaker).
-
-XFree86 3.1.2a (23 September 1995)
- 24. Fix HW cursor masks in Mach32 and Mach64 servers.
- 23. Add detection of C&T 65548 to SuperProbe.
- 22. Fix snow problems with WD90C24 when for clocks higher than MCLK
- (Brad Bosch).
- 21. Add XNLS support for KOI8-R (Andrey Chernov).
- 20. Fix problem with IBM ramdac and clockchip handling in xf86config.
- 19. Change XF86Config parsing to ignore '_' characters in keywords, and
- to ignore '_', ' ', and '\t' characters when comparing strings with
- StrCaseCmp() (ie, all strings except paths, Device/Monitor identifiers
- and Mode names).
- 18. Reduce nonMuxMaxClock to 80MHz (from 100MHz) for S3 864 with
- ATT498-compatible RAMDACs because it was too high for some cards.
- 17. Fix problem installing xterm on SunOS 4.x introduced in 3.1.2.
- 16. Set -fno-strength-reduce with -O2 for gcc2 to avoid a compiler bug.
- 15. Fix xvidtune/XF86VidMode problem when the Monitor Vendor and/or Model
- are not specified in the XF86Config file.
- 14. Colour support for xterm (David Wexelblat).
- 13. Fix usage of $LINES and $COLUMNS by xterm on SVR4 (David Wexelblat).
- 12. Fix xconsole for Unixware 2.0 (David Wexelblat).
- 11. Fix optimisation problem with inline asm on Unixware 2.0
- (David Wexelblat).
- 10. Improve subdir/lib dependence on systems using BSD 4.4. make
- (Matthieu Herrb)
- 9. Allow the Xserver to accept InvertVCLK, EarlySC and BlankDelay. It
- previously expected Invert_VCLK, Early_SC and Blank_Delay.
- 8. Fix problem selecting a StaticGray visual with the VGA16 server
- (Olivier De Smet).
- 7. Fix compile problem on FreeBSD 1.1.5 (David Bremner).
- 6. Change index and rindex macros in Xos.h when X_NOT_STDC_ENV is not
- defined.
- 5. Fix(?) alloca declaration in Xtos.h for Solaris 2.5.
- 4. Fix dependencies for 'make includes' to ensure that auto-generated
- headers exist before linking them to xc/X11 (David McCullough).
- 3. Change default InvertVCLK setting for the Hercules Terminator 64 Pro
- (Harald Koenig).
- 2. Update for lynx.cf (Thomas Mueller).
- 1. README updates.
-
-XFree86 3.1.2 (24 July 1995)
-235. Fix(?) scanpci compile problem with gcc on Solaris.
-234. Documentation updates.
-
-XFree86 3.1.1Z (22 July 1995)
-233. Code Freeze for 3.1.2.
-232. Fix an imake config problem on non-XFree86 platforms.
-231. xman update for Solaris 2.5 (William Austin).
-230. Cyrillic fonts with KOI8 encoding added (Cronyx Ltd, Serge Vakulenko,
- Andrey A. Chernov).
-229. Allow ndbm to be used for the rgb database on NetBSD for those
- who want it (Matthieu Herrb).
-228. Attempt to fix register corruption for Cirrus 5430/5434/5436 in
- SuperProbe.
-227. Remove -DUNIXCONN from the default SVR3 ConnectionFlags.
-226. Fix disappearing S3 hw cursor when switching modes with xvidtune
- (Harald Koenig).
-225. Sync-on-green support for the ELSA Winner 2000Pro/X (Harald Koenig).
-224. Add vendor options to S3 server (hercules, stb, genoa) (Harald Koenig).
-223. Documentation updates (Joe Moss, Harald Koenig, Matthieu Herrb).
-
-XFree86 3.1.1Dc (19 July 1995)
-222. Fix(?) server crash when the Cirrus driver auto-detects the linear
- fb address for PCI cards.
-221. Support for 964+IBM (Hercules Terminator 64) (Harald Koenig).
-220. Disable >8bpp for S3 911 and 924 because it won't work.
-219. Fix some auto-apply problems in xvidtune, and added a restore hot-key "R".
-
-XFree86 3.1.1Db (17 July 1995)
-218. Documentation updates.
-217. xvidtune updates.
-216. S3 parameter updates for STB 968 card, and update to the Trio64V
- probe (Harald Koenig).
-
-XFree86 3.1.1Da (16 July 1995)
-215. Replace xf86pci.c with the real scanpci.c (Robin Cutshaw).
-214. Updates to the code for the additional S3 mode parameters, including
- better default settings (Harald Koenig).
-
-XFree86 3.1.1D (15 July 1995)
-213. xterm fix for crash when inputMethod is set to kinput2 (Manabe Keishi).
-212. Code to detect the AT&T20C490, and Sierra 1148[234579] ramdacs
- (Joe Moss).
-211. Update the VidMode extension to handle extra mode-specific parameters,
- and update xvidtune for extra S3 parameters.
-210. Allow some S3 parameters to be set in the Display SubSection for
- individual modes.
-209. xf86config Cards database updates.
-208. Updates to README.WstDig for the 90C24 (Brad Bosch).
-207. Updates to LynxOS support, including support for version 2.2.1, and
- a README.LynxOS (Thomas Mueller).
-206. Support for the SC1148{2,3,4} ramdacs at 15bpp, and the SC1148{5,7,9}
- ramdacs at 15 and 16bpp in the S3 server (Joe Moss).
-205. Fix for problems with some WD90C24 TFT systems (Brad Bosch).
-
-XFree86 3.1.1Cd (12 July 1995)
-204. Allow for three verbosity levels for Xserver messages: -quiet, default,
- and -verbose (Marc Aurele La France).
-203. Make the LinkKit self-contained. Apart from Xnest, it no longer
- depends on the config files, headers, and utility programs being
- installed (Marc Aurele La France).
-202. Updates to xvidtune. The Show button now also sets the primary
- selection, better usage/error messages and exit codes, man page
- updates (Joe Moss).
-201. Updates for SCO -- mostly for lbx (David McCullough).
-200. Fix a cause for some S3 lockups (Harald Koenig).
-199. Updates/fixes and SVR4 support for new malloc code.
-
-XFree86 3.1.1Cc (8 July 1995)
-198. Merge in final form of XC fix-12.
-
-XFree86 3.1.1Cb (7 July 1995)
-197. Minor IBM RGB updates (Harald Koenig).
-196. MCLK detection for STG1703 (Harald Koenig).
-195. Add detection for new S3 Trio64V+ chip to the S3 server and
- SuperProbe (Harald Koenig).
-194. Fix some clashing option numbers (Harald Koenig).
-193. Preliminary STG1703 clock programming code.
-192. A new malloc for use by the Xserver. It is enabled by setting
- UseInternalMalloc to YES (Pascal Haible).
-191. Fix for threads lib problem on Unixware 2.0
-190. Support for the WD90C24 in the pvga1 driver (Bradley Bosch).
-
-XFree86 3.1.1Ca (5 July 1995)
-189. Don't enable HAS_MMAP for Xvfb on Linux (Marc Aurele La France).
-188. Code to detect the STG1703 RAMDAC in SuperProbe and the S3 server
- (Harald Koenig).
-187. A few AGX bug fixes (Henry Worth).
-186. More pre-fix-12 fix-trackers.
-
-XFree86 3.1.1C (3 July 1995)
-185. Manual page updates.
-184. Add extended power_saver support to the VGA and Mach64 servers.
- Suspend mode isn't currently supported by the VGA servers.
-183. Add entries for the SunFA_ dead accents to the iso8859-1 Compose file
- (Jon Tombs).
-182. Updates to IBM RGB52x in the S3 server, including fixing the
- 8bpp problem.
-181. Documentation updates (including a README.ark) (Harm Hanemaayer).
-180. Change the Mach64 server to ignore the Clocks line in the XF86Config
- unless the "no_bios_clocks" option is used (Kevin Martin).
-179. Fix font corruption with Mach64 server (seen when running Mosaic
- or Netscape) (Kevin Martin).
-178. Fixes for constant-metric fonts in AGX server (Henry Worth).
-
-XFree86 3.1.1Bi (2 July 1995)
-177. Improved "power_saver" for the S3 server, and modified XFree86-VidMode
- extension to allow its parameters to be set from a client.
-176. Fixes for AGX copyplane (Henry Worth).
-
-XFree86 3.1.1Bh (1 July 1995)
-175. Updates to AGX server. Includes reversing previous copyplane change,
- restoring the setting of membase for AGX chips, cleanup setting
- of the default planemask, and fixes to the agxIm routines + some
- speedups (Henry Worth).
-174. Some more pre-fix-12 fix-trackers.
-
-XFree86 3.1.1Bg (29 June 1995)
-173. Turn on "dac_8_bit" by default in the S3 server for RAMDACs that
- support it. Add "dac_6_bit" option to allow 6-bit mode to be selected.
- Also, complain when "dac_8_bit" is used for a RAMDAC that can't do it.
-172. Improve "power_saver" operation by adding a delay between turning off
- the video signal and the syncs (Bernhard Bender).
-171. Workaround for the NumLock modifier interfering with the xterm
- ctrl+btn menus.
-170. More pre-fix-12 fix-trackers. Mostly some libX11 and libXt fixes.
- Includes a workaround for the NumLock modifier interfering with
- Xaw pull-down menus.
-169. Preliminary support for the IBM RGB52x ramdacs in the S3 server
- (Harald Koenig).
-
-XFree86 3.1.1Bf (27 June 1995)
-168. Another stab at the ET4000/W32p mouse droppings fix (Glenn Lai).
-167. Back out some LBX fixes that won't be in fix-12.
-
-XFree86 3.1.1Be (25 June 1995)
-166. Some documentation updates.
-165. Fix a few LinkKit problems.
-164. Fix LBXProxyOnly build.
-
-XFree86 3.1.1Bd (24 June 1995)
-163. Add a BuildLBXProxyOnly Imake config option to allow building lbxproxy
- from a self-contained cut-down source tree.
-162. vtname was too short in Linux OS-dep code (similar change for LynxOS
- and SCO too) (Pascal Haible).
-161. Change uses of malloc/free in Xserver to xalloc/xfree (Pascal Haible).
-160. AGX documentation updates (Henry Worth).
-159. Fixes for AGX font rendering, and copyplane (Henry Worth).
-158. AGX font cache flushed by screensaver (Henry Worth).
-157. AGX screensaver for >8bpp (Henry Worth).
-156. pre-fix-12 fix-tracker: improvement to the Xt translation manager
- performance when high order modifiers are assigned. Also, change
- the servers to use Mod3 for Mode_switch instead of Mod5 to further
- improve this.
-155. Fix some UseGnuMalloc config stuff, and set this to YES by default
- for FreeBSD.
-154. Fix some problems with the VGA2 server, including crashes in banked
- mode, and incorrectly switching banks when bitblting in non-banked
- mode.
-
-XFree86 3.1.1Bc (21 June 1995)
-153. Fix for ET4000/W32p cards -- don't change the PCI burst setting.
- This should fix mouse droppings and missing characters in text mode
- for some cards (Glenn Lai).
-152. Fix AGX font corruption problem (Henry Worth).
-151. Disable 32bpp in AGX server by default -- it is too unstable
- (Henry Worth).
-150. XGA clock updates in AGX server (Henry Worth).
-149. EISA XGA probing in AGX server (Henry Worth).
-148. Better scratchpad and font cache support for XGAs in AGX server
- (Henry Worth).
-147. Font glyph blting for non-cached fonts with AGX server (Henry Worth).
-146. AGX font cache fixes (Henry Worth).
-145. pre-fix-12 fix-trackers, including:
- - LBX fixes and additional functionality
- - some xtrans and fontlib fixes
- - smproxy and xsm fixes
-144. Fix sessreg (WTMP, LASTLOG, but no UTMP) for *BSD.
-143. Allow 'UseGnuMalloc' to work on all platforms.
-
-XFree86 3.1.1Bb (17 June 1995)
-142. Config updates to make LinkKit more self-contained
- (Marc Aurele La France).
-141. Fix some problems with blocking stderr on BSD/OS 2.0 (Hans Nasten).
-140. Add auto-apply mode to xvidtune, and flesh out the xvidtune man
- page (Joe Moss).
-139. AGX font cache bug fixes, and fix font clipping problem (Henry Worth).
-138. Some more pre-fix-12 fix-trackers, including:
- - Xaw - removal of undocumented/broken INTERNAL selection mechanism
- - Fix makestrs problem with -earlyR6bc.
-
-XFree86 3.1.1Ba (14 June 1995)
-137. Fix AGX problem with vertically overlapping fonts (Henry Worth).
-136. Fix some mono (VGA2) problems that can lead to a server crash.
-135. New "VGAbase" keyword for XF86Config -- currently used only by the
- AGX server (Henry Worth).
-134. Fixes for XGA autoconfig code in the AGX server (Henry Worth).
-133. Documentation updates (Dirk Hohndel).
-132. Change default FreeBSD version in FreeBSD.cf to 2.0.5.
-131. Add a LockModeSwitch function to the VidMode extension, and modify
- xvidtune to use it.
-130. Force VTotal to be odd for interlaced modes.
-129. Fix default Vsync/Hsync polarity setting (Marc Aurele La France).
-128. Trap a failed 'cd' in 'make Makefiles'. This prevents the Makefile
- in the . directory being removed (and other potential problems) when
- one of the SUBDIRS directories is missing.
-127. Include some XC fix-trackers intended for fix-12. Main changes include:
- - Using -Xa for SVR4 compiles, and changing '#if __STDC__' to
- '#ifdef __STDC__'
- - Overhall tty setup in xterm -- should work better for Solaris now.
- - Fix SVR4 ABI problems with libXt strings.
-126. Recognise 'Ramdac "generic"' in W32 server (Glenn Lai).
-
-XFree86 3.1.1B (10 June 1995)
-125. Fix problem with dacspeed line in files generated by xf86config.
-
-XFree86 3.1.1Ad (8 June 1995)
-124. Rename the vgahelp client to xvidtune.
-123. Rename "VGAHelp" extension to our registered name
- "XFree86-VidModeExtension", and update API to use the XF86VidMode
- prefix instead of the "XVGAHelp"/"VGAHelp" prefix.
-122. Undef i386 in Imake.cf for i386Architecture systems.
-121. Fix(?) WTMP problem with xterm on SYSV and Linux.
-120. Mach64 documentation updates (Kevin Martin).
-119. Power_saver support for the Mach64 server (Kevin Martin).
-118. Autodetect when block write mode should be disabled for the Mach64
- server. A "block_write" option has been added to override this
- (Kevin Martin).
-117. Use "dead_*" keysyms instead of the DEC "D*" keysyms for the dead keys
- in the Linux keyboard code and Compose file.
-116. Use our registered name for the ModeLock keysym.
-
-XFree86 3.1.1Ac (6 June 1995)
-115. Vgahelp client enhancements (Jon Tombs).
-114. Fix core dump in fslsfonts when no fontserver is specified
- (Matthieu Herrb).
-113. Fix W32 problem introduced with modified SaveScreen code.
-112. Update "M" parameter calculation for Trio boards (Harald Koenig).
-
-XFree86 3.1.1Ab (2 June 1995)
-111. Preliminary support for the Cirrus 5436 (Harm Hanemaayer).
-110. PCI base address detection for the Cirrus driver (Harm Hanemaayer).
-109. Fix problem linking AGX server with the LinkKit (Stephen Kump).
-108. Support for LynxOS (Thomas Mueller).
-107. Update LinkKit to make it self-contained regarding X headers
- (Marc Aurele La France).
-106. Realtek SVGA driver. It works with the RTG3106, and possibly the
- RTG3103 and RTG3105 (Peter Trattler).
-105. Enable the s3MCLK option for the S3 805i, and fix some bugs relating to
- s3MCLK (Harald Koenig).
-104. Fix XF86Config problem when monitor and screen sections are interleaved.
-
-XFree86 3.1.1Aa (1 June 1995)
-103. Fix SiteIConfigFiles settings for the LinkKit (Marc Aurele La France).
-102. Fix gccmakedep problem with .s files.
-101. Updates to BSDI docs (Hans Nasten).
-100. Updates to Linux ELF config/rules (Orest Zborowski).
- 99. Check for 868 before 864 in S3 server (Harald Koenig).
- 98. Add rule for compiling/installing scanpci.
-
-XFree86 3.1.1A (28 May 1995)
- 97. vgawonder driver updates (including fix for VGA2 driver with Mach64)
- (Marc Aurele La France).
- 97. Small TVP3026 fix (Harald Koenig).
- 95. Fix keyboard LEDs not being turned off now that the initial lock state
- is ignored.
-
-XFree86 3.1.1h (26 May 1995)
- 94. Support for parallel make (on SVR4) (Robin Cutshaw).
- 93. Don't initialise the state of the lock keys based on their state
- prior to server startup.
- 92. Untested changes in the AGX server for AGX-010 support (Henry Worth).
- 91. Tested support in the AGX server for the XGA-2 at 8bpp and 16bpp
- (Henry Worth).
- 90. 16bpp and 32bpp support for the AGX server (Henry Worth).
- 89. Additional accelerations for the P9000 server (Henrik Harmsen and
- Chris Mason).
- 88. Fix some gamma correction problems in the S3 server (Harald Koenig).
- 87. More 968/868 fixes, including code to recognise the newer ELSA cards
- (Harald Koenig).
- 86. Further VGA16 scrolling fix (Stuart Anderson).
- 85. Fix problems with some 1MB P9000 cards (Erik Nygren).
- 84. Swap the black and white pixel values in the SVGA server's default
- colour map. This fixes a white line problem with some older
- VGA Wonder boards (Marc Aurele La France).
- 83. Move sequencer resets into the driver's SaveScreen function
- (Marc Aurele La France).
- 82. vgawonder and ati_test updates (Marc Aurele La France).
- 81. Handle "crippled" Mach32 and Mach64 chips in SuperProbe and the
- vgawonder driver (Marc Aurele La France).
- 80. Distinguish between different types of Mach64 chips in SuperProbe and
- the vgawonder driver (Marc Aurele La France).
- 79. Add defines to xf86Version.h for each part of the XFree86
- version numbers (Marc Aurele La France).
- 78. LinkKit updates to make it self-contained (Marc Aurele La France).
- 77. Memleak support for NetBSD, and add UseMemLeak Imake config
- parameter to allow compiling Xserver/os with memleak (Matthieu Herrb).
- 76. Update NetBSD aperture driver to support -current loadable kernel
- modules (Matthieu Herrb).
- 75. Don't try to do clock doubling for 964 + Bt485 at 32bpp.
-
-XFree86 3.1.1g (7 May 1995)
- 74. i386 BSD support for the memleak utility (Jeffrey Hsu).
- 73. Fix a scrolling corruption problem with multiple regions in the VGA16
- server (Stuart Anderson).
- 72. Modify VGA16 server to provide 4 visuals which can be selected
- using the standard -cc flag (Stuart Anderson).
- 71. Changes to allow XDMCP broadcasts on some transports when using
- STREAMSCONN (Stuart Anderson).
- 70. Updates for building on NCR SVR4/MP-RAS 3.0 (Stuart Anderson).
- 69. Some updates for ISC (Michael Rohleder).
- 68. Fix FillRect problem that causes a server crash for most accel servers
- when running at 16/32bpp and X isn't on the active VC (Harald Koenig).
- 67. Fix mach32 inline asm problem (outsw) that shows up with recent gcc
- versions.
- 66. Modify xterm to find all ptys on recent FreeBSD (Satoshi Asami).
- 65. Work around S3 Trio "white line" problem by swapping the default black
- and white pixel values.
-
-XFree86 3.1.1f (24 April 1995)
- 64. Remove ComplexProgramTargetNoMan rule, and use NormalProgramTarget
- instead.
- 63. Fix cirrus MMIO problem introduced in 3.1.1e, and allow 135MHz clocks
- for a wider range of CL-GD5434 revisions (Harm Hanemaayer).
- 62. Update to S3 HW cursor fix (Harald Koenig).
- 61. Preliminary support for S3 866 and 868 boards (tested with the
- ELSA Winner 1000AVI) (Harald Koenig).
- 60. Fix a problem with virtual resolution calculation in the Mach32 and
- Mach64 servers (when none is given in the XF86Config file)
- (David Holland).
-
-XFree86 3.1.1e (10 April 1995)
- 59. Fix problems that can lead to S3 crash/lockup when using HW cursor
- (Harald Koenig).
- 58. S3 Trio updates (Harald Koenig).
- 57. Fix return value of QueryBestSize() for HW cursors.
- 56. Fix cirrus display error when scrolling without BitBLT engine
- (Harm Hanemaayer).
- 55. Sanity check to prevent cirrus crash with negative size rectangle
- fill (Harm Hanemaayer).
- 54. Cirrus MMIO improvements, including support for 5429 (Harm Hanemaayer).
- 53. More balanced cirrus FIFO settings to resolve display refresh errors
- during drawing operations at high dot clocks (Harm Hanemaayer).
- 52. Support for clocks up to 135MHz for CL-GD5434 revision E and later
- (Harm Hanemaayer).
- 51. Fix memory leak in cirrus text drawing (Harm Hanemaayer).
- 50. Updates for Linux ELF support (H.J. Lu).
- 49. Fix mail directory path in xbiff.
- 48. Fix S3 interlace mode problem for boards with programmable clocks
- (Harald Koenig).
- 47. Fix core dump from vgahelp when started with no args (Christos Zoulas).
- 46. Fix 968 detection in SuperProbe, and add Ti3026 detection (Harald Koenig).
- 45. Preliminary S3 968 and Ti3026 support (Harald Koenig).
- 44. Added similar code for SYSV regarding I/O permission, but not enabled
- (yet) by default.
- 43. Modify Linux I/O permission code to use IOPL rather than TSS bitmap
- in all cases (Orest Zborowski and Harm Hanemaayer).
- 42. Fix lack of keysyms for numerical keypad when ServerNumLock is enabled
- on Linux (Orest Zborowski).
- 41. Update _SC_OPEN_MAX code.
- 40. Fix ALLOCATE_LOCAL() not using alloca() with gcc.
-
-XFree86 3.1.1d (21 March 1995)
- 39. Preliminary mode checking for the VGAHelp extension.
- 38. Add timeout for 3 button emulation (Mike Hench).
- 37. Reorganise Ti302x code to remove S3-specifics from common_hw
- (Robin Cutshaw).
- 36. General PCI probe code (Robin Cutshaw).
- 35. FreeBSD 1.1.5 has _SC_OPEN_MAX defined, but no sysconf().
-
-XFree86 3.1.1c (12 March 1995)
- 34. Updates for #9 GXE64Pro required due to changes in 3.1.1b (Hans Nasten).
- 33. Support for BSD/OS 2.0 (Hans Nasten).
- 32. Updates for OS/2, including work on the X server support (Holger Veit).
- 31. SVGA driver for the ARK 1000PV and 2000PV chipsets (Harm Hanemaayer).
- 30. Add predefs to makedepend for FreeBSD and NetBSD. This allows
- xf86_OSlib.h to be cleaned up a little.
- 29. Fix config rules for Sentinel build (David Wexelblat).
-
-XFree86 3.1.1b (8 March 1995)
- 28. Fix for byte swapped extension problem in lbxproxy (Dave Lemke).
- 27. Support for Unixware 2.0 (Robin Cutshaw and Kaleb Keithley).
- 26. Fix FIFO detection problem and bug reading BIOS video max modes in
- Mach64 server (Kevin Martin).
- 25. Support for Chrontel 8398 and STG1703 clock programming in the Mach64
- server (Kevin Martin).
- 24. Add "no_block_write" option to turn of block write mode in the Mach64
- server (Kevin Martin).
- 23. Add "override_bios" option to override the Mach64 server's BIOS mode
- checking (Kevin Martin).
- 22. Allow Membase to be given in XF86Config for the Mach64 server
- (Kevin Martin).
- 21. Fix bug in Mach64 ATI68860 RAMDAC code which causes noisy display
- (Kevin Martin).
- 20. Add support for STG1702, STG1703, ATI68875, CH8398 RAMDACs to Mach64
- server (Kevin Martin).
- 19. Post events for initial lock key state differently to avoid calling
- ProcessKeyboardEvents() before all the data it uses is initialised.
- 18. Fix and extend ISO8859-1 Compose file (Peter Dalgaard).
- 17. Update S3 SVGA driver so that it works with 3.1.1.
- 16. Fix 90C33 problem with 2MB cards when memory is not auto-probed.
- 15. Fix some ISC LOCALCONN problems (Michael Rohleder).
- 14. Put back some #9 GXE64Pro specific bits in S3 server.
- 13. Remove 1024 min virtual width restriction from Mach64 server
- (Kevin Martin).
- 12. Fix dashed line server hang problem for Mach32.
- 11. Add UseGnuMalloc to xf86site.def (only implemented for ISC so far).
- 10. Fix POSIX_SAVED_IDS typo in xterm (Christos Zoulas).
- 9. Fix problem of attempting to include the VGAHELP extension in Xnest.
-
-XFree86 3.1.1a (12 February 1995)
- 8. VGAHELP X server extension for tuning video modes (Kaleb Keithley).
- 7. Fix libfont problem that can cause xfs to get into a loop (Jason Venner).
- 6. Fix problem with TekHVC colours (Kaz Sasayama).
- 5. Fix merge problems in hw/sun.
- 4. Fix line clipping problem in Mach32 server (can affect font cache).
- 3. Fix font cache problem on 2MB Mach32 cards.
- 2. Add detection of Trident GUI9440 to SuperProbe (untested).
- 1. Fix some ISC problems (Michael Rohleder).
-
-
-XFree86 3.1.1 (30 January 1995)
-265. --- Code freeze ---
-264. Include final form of fix-11.
-
-XFree86 3.1.0Zg (29 January 1995)
-263. Include final form of fix-10.
-262. Fix some merge problems.
-
-XFree86 3.1.0Zf (28 January 1995)
-261. Merge in prelim version of XC fix-11.
-
-XFree86 3.1.0Ze (28 January 1995)
-260. Merge in prelim version of XC fix-10.
-
-XFree86 3.1.0Zd (28 January 1995)
-259. Merge in XC fix-09.
-258. Minor updates (mostly typographical) to smooth the fix-11 merge.
-257. Define X_LOCALE for Linux.
-
-XFree86 3.1.0Zc (27 January 1995)
-256. Doc updates.
-255. Minor hw/xfree86 updates for fix-11 (Kaleb Keithley).
-254. Merge in XC fix-08.
-
-XFree86 3.1.0Zb (26 January 1995)
-253. Rename some files under hw/xfree86 to avoid clashes when truncated to
- 8.3 type names as used on ISO9660 format CDROMs.
-
-XFree86 3.1.0Za (25 January 1995)
-252. Minor pixmux clock limit update for Trio64 (Harald Koenig).
-251. Merge in XC fix-07.
-250. Some documentation updates.
-
-XFree86 3.1.0Z (23 January 1995)
-249. Restore correct key maps for 84-key keyboard, but allow alternate (old)
- behaviour when "ServerNumLock" is set in the XF86Config.
-248. xf86config updates (Harald Koenig).
-247. Remove stripes when panning with Ti3025 (Harald Koenig).
-246. Enable linear fb probing for VLB Trio64 cards with > 1MB DRAM
- (Harald Koenig).
-245. Put blank delay values back to what they were for non-#9 Ti3025
- boards (Harald Koenig).
-244. Fix AGX fill problems and hangs when exiting with an AGX-016 under
- SVR4 (Henry Worth).
-243. Fix AGX font cache problem, and other updates/cleanups
- (Henry Worth).
-
-XFree86 3.1.0Ce (22 January 1995)
-242. Updates to vgawonder driver, including fix for 68800-6 memory probe,
- and a reworking of the clock matching code (Marc Aurele La France).
-241. Remove most BIOS dependencies in vgawonder probe code
- (Marc Aurele La France).
-240. Change ordering of Mach32 and Mach64 probing in SuperProbe, ati.test
- and the vgawonder driver to avoid hanging Mach32 boards. Also use
- a timeout in all WaitIdle loops in the probes (Marc Aurele La France).
-239. Minor #9 GXE64Pro updates (Hans Nasten).
-238. Allow LASTLOG to be independent of SYSV_UTMP in xterm -- so it will
- work for Linux (Helmut Geyer).
-
-XFree86 3.1.0Cd (21 January 1995)
-237. Improve positioning of pixmap expansion and font cache areas with
- the S3 server.
-236. Fix problem with Cirrus mono server crashing (Stephen Kump).
-235. Allow the "sw_cursor" option to work for the S3 server.
-234. Fix S3 HW cursor hot spot problem when no ViewPort entry is given in
- the XF86Config (Harald Koenig).
-233. Fix some S3 Trio64 8bpp+pixmux display errors (Harald Koenig).
-232. Fix #9 GXE64Pro problems introduced in 3.1.0Cc (Hans Nasten).
-231. SPEA auto-detection for their Trio64 cards (Norbert Distler).
-230. Possible fix for keymap problems with 84-key keyboards.
-229. Internationalisation support for xterm (Martin Forssén).
-228. Remove the need for a Virtual entry in the XF86Config for the Mach64
- server.
-
-XFree86 3.1.0Cc (20 January 1995)
-227. Add a check to the W32 server for invalid depths.
-226. Fix bug in PaintWindow in Mach32 and AGX servers (Stuart Anderson).
-225. Chrontel 8391 programmable clock support (Richard Burdick
- and Harald Koenig).
-224. S3 programmable clock code updates (Harald Koenig).
-223. Support for S3 Trio32 and Trio64 (Harald Koenig).
-222. Updates to S3 Ti3025 code for the Miro 40SV (Harald Koenig).
-221. Update xf86config to know about the latest clockchip changes
- (Harm Hanemaayer).
-220. Minor cirrus HW cursor patch (Harm Hanemaayer).
-219. Updates to OAK driver, including mapping the linear fb above 64MB
- (Jorge Delgado).
-
-XFree86 3.1.0Cb (19 January 1995)
-218. Fix XLOCAL parsing problem introduced in XC fix-06 (Steve Forsythe).
-217. Added a DocIndex (to use as a starting point for the HTML docs).
-216. README.Oak (Jorge Delgado).
-215. SuperProbe/kbd_mode updates for compiling with PCVT_SUPPORT
- (Joerg Wunsch).
-214. Fix for 90C31 acceleration problems.
-213. Don't use '-ansi -pedantic' for Solaris versions earlier than 2.4.
-
-XFree86 3.1.0Ca (18 January 1995)
-212. S3 update for SPEA Mercury P64 (Norbert Distler).
-211. Late LBX updates from the XC.
-210. Add a "no_imageblt" option for the Cirrus driver (Harm Hanemaayer).
-209. Support for 2:1 pixmux 8bpp RAMDACs on boards with fixed clock chips.
-208. S3 changes for the ICS5342 ramdac/clock (Harald Koenig).
-207. Fix problem in miZeroClipLine() which can cause a server hang
- (Harald Koenig).
-206. Fix register unlocking problem in S3 server (for Stealth 64 VRAM)
- (Harald Koenig).
-
-XFree86 3.1.0C (15 January 1995)
-205. Preliminary programmable clock support for the Mach64 server
- (Kevin Martin).
-204. Add accelerated line code for the P9000 server and fix/update some
- other accelerated code (Chris Mason).
-203. Allow XF86Config Videoram to override autodetection with the P9000
- server, and allow the "vram_128" option force recognition of
- 128kx8 VRAM (Erik Nygren).
-202. Change P9000 programmable clock operation to be consistent with other
- servers (Erik Nygren).
-201. Allow Cirrus MMIO for the 5429, and change on of the fixed clocks
- in the Cirrus programmable clock code (Harm Hanemaayer).
-
-XFree86 3.1.0Bf (14 January 1995)
-200. Preprocess Linux jump files, and allow libX11 to be built with XdmAuth
- (Orest Zborowski).
-199. Fix VTSema-related problem in s3bstore.c (Henry Worth).
-198. Merge in XC's pre-fix-07 LBX code.
-
-XFree86 3.1.0Be (12 January 1995)
-197. Include Japanese translations of some XFree86 3.1 docs (Kazuyuki Okamoto).
-196. Updates to SPEA detection code (Norbert Distler).
-195. Fix for ICS2595 initialisation problem (Norbert Distler).
-194. Some vgawonder driver fixes (Marc Aurele La France).
-193. Prevent xf86config from crashing when some fields are missing in
- the Cards database (Matthieu Herrb).
-192. Fix S3 cursor X position when the display address is not changed to
- avoid display errors.
-191. Set S3 M/N parameters depending on the MCLK value (which can be probed
- or set in XF86Config) (Harald Koenig).
-
-XFree86 3.1.0Bd (12 January 1995)
-190. Update cl64xx driver for modeRec changes.
-189. Merge in XC public fix-06.
-
-XFree86 3.1.0Bc (11 January 1995)
-188. Added a DontZoom keyword for the XF86Config "ServerFlags" section
- to disable the mode switching key sequences.
-187. Updates for ISC. Includes imake config support for the SVR3 mmap
- driver, updates to install.svr3, and patches for building lbxproxy
- (Michael Rohleder).
-186. Fix 864 + STG1700 8bpp pixmux for clocks between 67.5 and 95 MHz
- (Harald Koenig).
-185. Change VRAM timings for Diamond Stealth 64 VRAM (Harald Koenig).
-184. Set HSyncEnd overflow in S3 server when needed (Harald Koenig).
-183. Prevent C&T driver from pretending to support the 82c45x chipsets.
-182. Don't trap <ctrl><alt><bs> when DontZap is set.
-
-XFree86 3.1.0Bb (10 January 1995)
-181. Updates to linear fb code for OTI087, and allow the FIFO threshold
- to be set from XF86Config (Jorge Delgado).
-180. Add hooks for server/driver mode validation. This is currently used
- only by the NCR SVGA driver (Stuart Anderson).
-179. Fix for ET4000/W32 bank switching code in the SVGA et4000 driver
- (David Etherton).
-178. Similar hw cursor move fix for S3 server.
-177. Fix for Cirrus crash when the hw cursor is moved while in another VT
- (Harm Hanemaayer).
-176. Allow the "s3_964_bt485_vclk" to be used for the Diamond Stealth64 (VRAM).
- This requires the "diamond" option (Harald Koenig).
-175. Rewrite xlfd_round_double() to speed it up on machines with no
- hw floating point. This reduces server startup time on such machines
- (Harald Koenig).
-174. Reduce amount of floating-point calculation in icd2061a and S3 gendac
- clock code (Harald Koenig).
-173. Probe code to detect some SPEA boards and correctly set the clockchip
- (Norbert Distler).
-172. Allow Xservers to be built with only PCVT support on *BSD, and
- clean up the console driver probing for *BSD (Joerg Wunsch).
-
-XFree86 3.1.0Ba (8 January 1995)
-171. Change "ct5??" chips&tech names to "ct655??".
-170. Fix for Xnest (and Xvfb) not calling OsInitColors().
-169. Add support for relinking the Xnest server with the LinkKit.
-168. Modify vgawonder to probe clocks when -probeonly is used
- (Marc Aurele La France).
-167. Fix some cirrus line drawing problems and fix non-interlaced modes
- with vertical timings > 1024 (Harm Hanemaayer).
-166. Avoid use of the threads lib for SolX86 (David Holland).
-
-XFree86 3.1.0B (4 January 1995)
-165. Support for C&T 65540/45 added to the SVGA server (Régis Cridlig).
-164. Change cirrus programmable clock code to use a tested set of clock
- parameters when there is one close to the requested clock frequency
- (Harm Hanemaayer).
-163. Fix cirrus BitBLTs with height > 1024 for 543x (Harm Hanemaayer).
-162. Clock-related updates to the vgawonder driver (reject invalid clocks
- where possible) (Marc Aurele La France).
-161. Config updates (including installation of host.def and fix references
- to cl64xx driver in xf86site.def) (Marc Aurele La France).
-
-XFree86 3.1.0Ae (2 January 1995)
-160. Replace docs with the ascii versions generated from the sgml source.
-159. Major updates to xf86config(1), including the addition of a Cards
- database (Harm Hanemaayer).
-158. Check and reject invalid XF86Config depths for the VGA16 and Mono
- servers.
-157. Add an "s3_964_bt485_vclk" option to fix a problem with 964+Bt485.
- Also added code to detect the MIRO 20SV board revision (Harald Koenig).
-156. Add an S3Mclk entry to XF86Config to allow the MCLK value to be specified
- in order to aid the calculation of the optimal M parameter
- (Harald Koenig).
-155. Fix S3 linear fb check and allow membase to work for 864/964 boards
- (Harald Koenig).
-154. Move server lock code back into Xserver/os so that it gets used by
- Xnest and Xvfb.
-
-XFree86 3.1.0Ad (26 December 1994)
-153. Fix problems with DBLSCAN code introduced in 3.1.0Aa (Harm Hanemaayer).
-152. Support for adding LBX via the LinkKit.
-151. Fix some LinkKit config problems.
-150. Fix LinkKit Imakefile bug introduced in 3.1.0A.
-149. Support for SPEA Mercury P64 (Bt485 + 964) (Norbert Distler).
-148. Enable ICD2061A/SC11412 clockchip by default for S3 server if the
- the "SPEA_Mercury" option is given and Bt485 + 964/928 is detected
- (doesn't happen if an XF86Config entry for either ramdac or clockchip
- is present) (Norbert Distler).
-147. Fix for PCI Type 2 probe for I128 SuperProbe code (Robin Cutshaw).
-146. Major Cirrus update. Includes new acceleration using mmio (lines
- tilefill and rectangles), and more acceleration for 16/32bpp
- (Harm Hanemaayer).
-145. Fixes for AGX dashed line code (Henry Worth).
-144. Allow S3 server to put the cache in the area to the right of the screen
- when it is larger than the area below it (Leonard N. Zubkoff).
-
-XFree86 3.1.0Ac (20 December 1994)
-143. Imake template and rules for LinuxDoc-SGML formatting.
-142. Documentation converted to LinuxDoc-SGML (Gertjan Akkerman,
- Jayadev Billa, Matthieu Herrb, Michael Klemme).
-141. Re-enable SO_REUSEADDR code in Xtranssock.
-
-XFree86 3.1.0Ab (18 December 1994)
-140. Item 58. below (the patch didn't get included before).
-139. Add some sanity checking for horizontal timing parameters (including
- HTotal overflow for 864 with 24bpp, pixmux and HTotal > 1024)
- (Harald Koenig).
-138. Add check for 864 DCLK limit for 24bpp (Harald Koenig).
-137. Clean up of SDAC/GENDAC detection and related messages (Harald Koenig).
-136. Allow the following ramdac and clock chips to be specified by name:
- att21c498 (att20c498), ics5300 (s3_gendac), ics5342 (s3_sdac),
- ics9161a & dcs2824 (icd2061a). (Harald Koenig)
-135. OS/2 updates, including config updates, SuperProbe support and
- compile-time support for most of the Xserver (Holger Veit).
-134. Updated cl64xx driver, including support for the CL6440. Note, the
- driver name has changed from "cl6420" to "cl64xx" (Manfred Brands and
- Randy Hendry).
-133. Fix VT switch problem with the SVGA MX driver (Frank Dikker).
-132. Add PCI config type 1 support to I128 probe in SuperProbe (Robin Cutshaw).
-131. Update support for STB Pegasus (928 + Bt485), including 16bpp and
- 32bpp (Leonard N. Zubkoff).
-130. Fix pixmux clock check in Mach32 server (Alan Hourihane).
-129. Mods to allow XFree86 servers to compile with 'gcc -ansi -pedantic'
- on Solaris 2.x (David Holland).
-128. Fix stipple problem in S3 server.
-127. Fix for setuid-root xterm problem reading .Xauthority file on
- nfs-mounted filesystem (so far only for systems with POSIX_SAVED_IDS)
- (Christos Zoulas).
-126. Move server lock code into hw/xfree86 (Kaleb Keithley).
-125. Really fix Membase handling for S3 server and 805/928.
-124. Fix Mach32 probe problem.
-123. Fix SVR3 config problems (Michael Rohleder).
-
-XFree86 3.1.0Aa (11 December 1994)
-122. Fix default mapping for numpad keys. ServerNumLock should now not
- be required (for clients using R6 Xlib).
-121. DoubleScan modes are no longer specified with doubled vertical timings.
-120. Add extra timings fields to the ModeRec which are the CRTC values
- used by the hardware.
-119. Update oak driver to support linear mode for the oti-087 (Jorge Delgado).
-118. Fix '-DSTATIC_COLOR' problems (Hans Nasten).
-117. Fix typos which prevented Mach64 detection in SuperProbe from working
- (Marc Aurele La France).
-116. Allow XF86Config settings to override ELSA probe (Harald Koenig).
-115. Fix Membase handling for S3 server and 805/928.
-114. Make BSD console driver support selectable from imake.
-113. Fix some SVR4 config problems.
-
-XFree86 3.1.0A (5 December 1994)
-112. Mach64 pixmap cache fixes (Kevin Martin).
-111. Improve cirrus programmable clock handling (Harm Hanemaayer).
-110. Add code to SuperProbe to detect the #9 Imagine I128 (Robin Cutshaw).
-
-XFree86 3.1.0g (2 December 1994)
-109. Enable mmio for the Cirrus 543x (Harm Hanemaayer).
-108. Updates to xf86config (Harm Hanemaayer).
-107. Code for SuperProbe to successfully detect CL-GD543x (Harm Hanemaayer).
-106. Eliminate all references to "SYSV386". "-Di386" should be used instead,
- even in the BOOTSTRAPCFLAGS for SVR4 and SVR3 (Kaleb Keithley).
-105. Some typo changes to bring our code closer to what the XC has.
-
-XFree86 3.1.0f (1 December 1994)
-104. Eliminate references to SYSV386.
-103. Add check for usable linear fb for 864/964 boards.
-102. Detect and reject Mach64 boards whose ROM or VGA capability has been
- disabled (Marc Aurele La France).
-101. Experimental code in the vgawonder driver to reset Mach* boards. This
- is enabled with the "noaccel" option (Marc Aurele La France).
-100. Fix clashes with K_SCROLLLOCK and related symbols defined in newer
- Linux releases (Marc Aurele La France).
- 99. Change SuperProbe to detect the Mach64, and deal with ATI DAC classes
- 6 and 7, and recognise the ATI 28800-6 chip (Marc Aurele La France).
- 98. ISC 3.x and 4.x support (Michael Rohleder).
- 97. Add support for 640 and 800 line widths to AGX server (Henry Worth).
- 96. Fix cursor/screen scrolling problem for doublescan modes (Henry Worth).
- 95. Add missing XF86_Mach64.c file.
-
-XFree86 3.1.0e (27 November 1994)
- 94. Add missing install rule for gccmakedep.
- 93. Define CSRG_BASED for *BSD (Kaleb Keithley).
- 92. Code/prototype cleanup under hw/xfree86 (Kaleb Keithley).
- 91. Mach64 accelerated server (Kevin Martin).
-
-XFree86 3.1.0d (22 November 1994)
- 90. Updates to NetBSD aperture driver (Matthieu Herrb).
- 89. Bring back 'gccmakedep' from 2.x. Currently only use it when
- UseInstalled is true.
- 88. Support for additional keys on Microsoft ergonomic keyboard (may
- require support in the OS's console driver) (Kaleb Keithley).
- 87. Updates for SCO (David McCullough).
- 86. Don't require the Virtual size to be specified for the Mach32 server.
- 85. Allow virtual widths < 1024 for Mach32 server (currently untested).
- 84. Some preliminary support for ISC (SVR3) 4.x (Michael Rohleder).
- 83. ET4000/W32 server updates. Includes accelerated 32-bit opaque and
- transparent stipple, acceleration for cases where the planemask != 0xFF,
- and ramdac code changed to accommodate more ramdac types (Glenn Lai).
- 82. NetBSD support in hw/sun (Dennis Ferguson, Matthew Green, Matthieu
- Herrb).
- 81. Fix xterm hang-on-exit problem on SolX86 2.4 (David Holland).
- 80. Speedups for AGX constant-metric and non-overlapping characters
- (Henry Worth).
- 79. AGX accelerated dashed lines, and solid fills for arcs and polygons
- (Henry Worth).
- 78. Doublescan support for the AGX server (Henry Worth).
- 77. Update AGX server to delete unusable modes, and to allow the virtual
- width to be less than the display width (Henry Worth).
- 76. Fix typo in oak driver (which broke 067/077 support) (Jorge Delgado).
- 75. NetBSD updates, including SparcArchitecture support in imake config
- (Matthieu Herrb).
- 74. 32bpp support for SPEA Mercury (928+Bt485) (Norbert Distler).
- 73. Modify Linux kbd code to read the "high_keys" mapping (Takashi Manabe).
- 72. Fix RGBPath in XF86Config being ignored.
-
-XFree86 3.1.0c (6 November 1994)
- 71. Fix xload for FreeBSD 1.1.5 (Joerg Wunsch).
- 70. Modify S3 linear fb probe to handle the non-standard CR5A[6:7] address
- mapping used by some Diamond boards (including the Diamond Stealth Pro).
- Also, the 10 most significant bits of a specified MemBase value are
- now used (which leads to an incompatibility with previous usage)
- (Dick Streefland).
- 69. Fix clock matching and some other problems in vgawonder driver
- (Marc Aurele La France).
- 68. Reduce RAS to 6 MCLKs for SPEA Mercury (Norbert Distler).
- 67. Fix setting of CR65 for the SPEA Mercury -- fixes 1600 width at 8bpp
- and 1152 width at 16bpp (Norbert Dislter).
- 66. Change MCLK from 46MHz to 49MHz in the SC11412 clock code (Norbert
- Distler).
- 65. S3 code to detect 866/868/968/Trio32/Trio64 and treat them as
- an 864 (Harald Koenig).
- 64. Update SuperProbe to detect STG1700, S3 GENDAC and SDAC, ATT22C498,
- S3 Vision866, 868, 968, Trio32 and Trio64 (Harald Koenig).
- 63. Enforce 95MHz limit for 864 when no pixmux (eg, 16bpp) (Harald Koenig).
- 62. Increase pixmux cut-in point for ATT20C498 to 95MHz (Harald Koenig).
- 61. ATT22C498 detection and (untested) support (Harald Koenig).
- 60. New code for S3 SDAC/GENDAC detection, and enable the programmable
- clock when one of these is detected (Harald Koenig).
- 59. Fixes for S3 RAMDAC detection (STG1700 and SDAC) (Harald Koenig).
- 58. Fix ICD2061A code for clocks between 110MHz and 120MHz (Harald Koenig).
- 57. Chips & Technology SVGA driver (Jon Block, Mike Hollick, Régis Cridlig).
- 56. 16/32bpp support for #9 boards with Ti3020 ramdac (Robin Cutshaw).
- 55. Fix bsdi.cf problems with gcc options (Hans Nasten).
-
-XFree86 3.1.0b (30 October 1994)
- 54. 16/32bpp support for Elsa Winner2000Pro (964+Ti3020) (Dirk Hohndel).
- 53. Update to cirrus programmable clock code (Harm Hanemaayer).
- 52. Accelerated 16/32bpp bitblt for the Cirrus driver (Harm Hanemaayer).
- 51. The vgawonder driver will now attempt to determine what the board uses to
- generate clocks (Marc Aurele La France).
- 50. Allow mode flags to specify composite sync polarity (Marc Aurele
- La France).
- 49. ati.test and vgawonder driver updates (Marc Aurele La France).
- 48. Vgawonder driver will now attempt to use a default video mode (derived
- from the existing CRTC settings) when no modes are specified in the
- XF86Config (Marc Aurele La France).
- 47. Fix problem where clock probe could report high values as zero (Marc
- Aurele La France).
- 46. SVGA driver for Avance Logic Inc. ali2301, ali2302, ali2308 and
- ali2401 (Ching-Tai Chiu).
- 45. Enable linear aperture access for BSD/386 (Hans Nasten).
- 44. Some Linux xterm fixes (Orest Zborowski).
- 43. Fix Linux xdm groups setting problem (Orest Zborowski).
- 42. Allow Mach8 server to delete unsuitable modes (Hans Nasten).
- 41. Attempt at fixing FatalError() re-entrancy problems when aborting.
- 40. Add X server lock file code.
- 39. Modify PTS code in xtrans to remove an existing node at server startup
- (as happens with UNIXCONN).
- 38. Set debug level to 1 in xtrans (this should allow error messages to
- finally be seen).
- 37. Modify xtrans to use ErrorF() for debug/error messages within the
- X server.
- 36. Updates to the S3MNAdjust option -- including no longer using global
- variables (Harald Koenig).
- 35. Fix horizontal stripes when panning with an S3 805i (Harald Koenig).
- 34. Fix SDAC + pixmux patch (Harald Koenig).
- 33. Fix line-related crash problem when using linear addressing with
- the SVGA server (Harm Hanemaayer).
- 32. Fix Cirrus 5434 linear addressing text blt bug (Harm Hanemaayer).
- 31. Fix Cirrus 14-pixel font bug (Harm Hanemaayer).
- 30. Improve Cirrus probing (Harm Hanemaayer).
-
-XFree86 3.1.0a (21 October 1994)
- 29. Fix some missing globals in Linux libX11 (Orest Zborowski).
- 28. Fix for TCPCONN code's checking for an existing server.
- 27. Support for building ELF dynamic libs on Linux (Michael Riepe).
- 26. Fix gcc local label usage in vgaFasm.h (Adam Richter).
- 25. OS/2 client support (Holger Veit).
- 24. Fix some data initialisation problems in libX11 and libXt
- (Christos Zoulas).
- 23. Use '-ansi -pedantic' with GCC when building the core tree.
- 22. Changes to vgaFasm.h to allow compilation with 'gcc -ansi -pedantic'.
- 21. Revised OAK driver which includes OTI-087 support (Jorge Delgado).
- 20. Don't use -lmalloc for FreeBSD 1.1.5 -- it seems to cause some server
- crashes.
- 19. Change FreeBSD.cf to refer to the compiler as 'cc' instead of 'gcc'
- (Rich Murphey).
- 18. Work around some problems GNU make 3.62 has with the rstart Imakefile
- (Jim Tsillas).
- 17. Fix HW cursor problems after switching resolutions with the SVGA
- server (Harm Hanemaayer).
- 16. Fix I/O permission problem with AL2101 driver (Harm Hanemaayer).
- 15. Preliminary doublescan mode flag support (Harm Hanemaayer).
- 14. Accelerated transparent text for Cirrus 5426/8 (Harm Hanemaayer).
- 13. Cirrus programmable clock support (Harm Hanemaayer).
- 12. Cirrus accelerated image text for 16/32bpp (Harm Hanemaayer).
- 11. Fix Cirrus HW cursor colour map at 16/32bpp (Harm Hanemaayer).
- 10. Fix 16bpp VC switch lockup on Cirrus 5426 (Harm Hanemaayer).
- 9. Fix SDAC 15/16bpp setup and 8bpp pixmux clock selection (Harald Koenig).
- 8. New (faster) S3 stipple code (Hans Nasten).
- 7. Add the xf86config program to the source tree (Harm Hanemaayer).
- 6. Gamma correction support for Ti3025 (Hans Nasten).
- 5. Add code to set 170MHz Bt485/20C505 limits for 32bpp.
- 4. Fix incorrect clock limit for ATT20C490 + programmable clock.
- 3. Fix S3 co-ord overflow check for bpp > 8.
- 2. Fix to S3 server to support newer #9 GXE64Pro boards (Robin Cutshaw).
- 1. Documentation updates.
-
-XFree86 3.1 (29 September 1994)
-400. --- Code freeze ---
-399. Fix slow server death and VT switching problems with W32 server
- (Glenn Lai).
-398. Fix problem with the W32 server not being installed set-uid (Hans Nasten).
-397. Fix problem with LinkKit Imakefile (Matthieu Herrb).
-396. Documentation updates.
-
-XFree86 3.0Z (27 September 1994)
-395. Fix mouse access problem when server resets while not in the active VT
- (Orest Zborowski).
-394. Fix typo in pvga1 driver (Simon Cooper).
-393. Documentation updates.
-392. Disable MMIO for Cirrus -- doesn't work yet (Harm Hanemaayer).
-391. Workaround for Cirrus GRF corruption in SVGA probe (Harm Hanemaayer).
-390. Update colourmap/blanking for W32 server (Glenn Lai).
-389. Fix clock ordering problem for vgawonder driver (Marc Aurele La France).
-388. Fix typo in Mach32 server which prevents it from starting at 16bpp
- (Alan Hourihane).
-
-XFree86 3.0Fe (26 September 1994)
-387. Fix for S3 line drawing overwriting HW cursor storage.
-386. Include Monitors and Devices files which contain the Monitor and Device
- XF86Config sections that have been submitted (Gertjan Akkerman).
-385. Update Cirrus probing for 543x chips in SuperProbe (Harm Hanemaayer).
-384. Update ET4000/W32 probing for SuperProbe (Glenn Lai).
-383. 16bpp support for S3 GENDAC + 801/805 (Harald Koenig).
-382. Updates to S3 GENDAC code -- program best matching clock frequency
- (Harald Koenig).
-381. Fix most pixel shift problems for #9GXE64Pro (Hans Nasten and
- Robin Cutshaw).
-380. Don't allow the S3 "dac_8_bit" option to have any affect at 16/32bpp,
- and fix related problem when using the SC15025 RAMDAC.
-379. Fix problem with Spea Mercury (Norbert Distler).
-378. Documentation updates.
-377. Updates to SolX86 aperture driver config (David Holland).
-376. Don't write mouse speed setting commands when using a non-logitech
- protocols.
-
-XFree86 3.0Fd (25 September 1994)
-375. AGX documentation updates (Henry Worth).
-374. Fix for text-mode restore problem with AGX server (Henry Worth).
-373. Change name of XF86Vga256Drivers to XF86SvgaDrivers.
-372. Documentation updates.
-371. Enable 16bpp, 32bpp for 964+Bt485.
-370. Support for 16bpp and 32bpp on 964+Bt485 -- tested so far on
- Miro Crystal 20SV (Eddy Olk).
-369. Fix pixel wrapping for 964+Bt485 (Eddy Olk).
-368. Fix low-res mode support for GXE64Pro (Robin Cutshaw).
-367. Fix some depth 15 vs depth 16 code for the Ti3020 (Hans Nasten).
-366. Update W32 server (Glenn Lai).
-
-XFree86 3.0Fc (24 September 1994)
-365. Fix image shift at 32bpp on GXE64Pro (Hans Nasten).
-364. Only initialise TrueColor visual for 16/32bpp since DirectColor is
- not appropriate for the hardware.
-363. Man page updates.
-362. Fix installation problems with XF86Config man page.
-361. Disable some code in vgawonder driver that leads to problems with
- SuperProbe (Marc Aurele La France).
-360. Change clock ordering (in some cases) for vgawonder driver so it
- now depends only on the clock chip used (Marc Aurele La France).
-359. Fix S3 VT switching problem with #9 GXE64Pro (Robin Cutshaw).
-358. Added README.SOLX86 (David Holland).
-
-XFree86 3.0Fb (23 September 1994)
-357. Enable ICS2595 clockchip support.
-356. Enable 32bpp for Ti3025+964.
-355. Change font cache and pixmap expansion allocation policy for S3
- server. This allows better performance when there isn't much
- offscreen memory available (Hans Nasten).
-354. Fix for banked ImageFill for bpp>8 (Hans Nasten).
-353. Updates to XF86_Accel man page.
-352. Remove references to 'Xconfig' in source code.
-351. Updates for ICS2595 code (Norbert Distler).
-350. Enable 16bpp for Spea Mercury.
-349. VTSema fixes for AGX server (Henry Worth).
-348. Updated 16bpp/32bpp support for 928+Bt485 (Norbert Distler).
-347. Partial support for 16bpp/32bpp with 964+Bt485 (Steve Parker).
-346. Fix Ti3025 pll save/restore, and set MCLK to 54.8MHz to eliminate
- screen corruption (Hans Nasten).
-345. Fix for AGX tile SEGV (plus some cleanups) (Henry Worth).
-344. Update to solx86 aperture driver docs (David Holland).
-343. Fix problem with S3 mmio usage at 16bpp and 32bpp (Hans Nasten).
-342. Fix Mono VGA server crashes when compiled with gcc2.
-341. Updates to xterm for Linux to handle its UTMP style and lastlog
- (Helmut Geyer).
-340. Remove some dependencies on removed cfb.banked.
-339. Fix Mach32 SW cursor SEGV.
-338. Prevent "nomemaccess" being used for S3 864/964.
-337. Change FreeBSD.cf to use gnumalloc for FreeBSD 2.x (Rich Murphey).
-336. Set weights correctly for Cirrus 32bpp (Harm Hanemaayer).
-335. Fix signal handling in xinit for SVR4 (David Holland).
-
-XFree86 3.0Fa (21 September 1994)
-334. Fix problems with cirrus top/left edge handling with HW cursor
- (Simon Cooper).
-333. Fix GC problem causing S3 server crash at 16bpp and 32bpp.
-332. Added copyright to the output of reconfig.
-331. Fixes for vgawonder driver (Marc Aurele La France).
-330. Update README.ati and ati.test.c (Marc Aurele La France).
-329. Fix potential problem with transparent text for the cirrus 543x
- (Harm Hanemaayer).
-328. Fixes for ICS2595 clock code (Norbert Distler).
-327. Remove cfb.banked.
-
-XFree86 3.0F (20 September 1994)
-326. Fix problem building reconfig when BuildServersOnly is YES.
-325. Updates to README.FreeBSD (Rich Murphey).
-324. Fix P9000 problem starting at 16bpp (Erik Nygren).
-323. Fix AGX screen saver, and a flash that occurs when switching into
- XGA mode (Henry Worth).
-322. Preliminary support for the ICS2595 clock chip (not enabled yet)
- (Norbert Distler).
-321. Fix pixel shift problem with GXE64Pro at 8bpp and 16bpp (Robin Cutshaw).
-320. Change clock doubler transition to 80MHz for Ti3025 (Robin Cutshaw).
-319. Add README.Bsdi (Hans Nasten).
-318. Removed the need to specify the "elsa_w1000pro" and "elsa_w1000isa"
- Options.
-317. Remove "stealth64" and "miro_crystal20sv" Options -- they are no longer
- needed.
-
-XFree86 3.0Ec (19 September 1994)
-316. Fixes for Ti3025 support -- fixes problem with machine lockups, and
- adds preliminary 16bpp support (Robin Cutshaw).
-315. No longer allow 'Device' in the Keyboard section. Must now use
- 'Protocol'.
-314. Updates to Cirrus BitBLT and fix for tile fill bug (Harm Hanemaayer).
-313. Disable Cirrus top/left edge HW cursor handling -- problems when
- changing cursors near the edge.
-312. Fix another clock limit bug in S3 server.
-311. Disable Fresco by default.
-310. Updates to W32 server (Glenn Lai).
-
-XFree86 3.0Eb (18 September 1994)
-309. Updates to README.NetBSD (Matthieu Herrb).
-308. Fix Mode Flags error reporting in xf86Config.c.
-307. Fix sessreg for Linux and add an install rule for it (Leonard N. Zubkoff).
-306. Fix xdm support with shadow passwords for Linux (Leonard N. Zubkoff).
-305. Fix typo in bsdi.cf (Hans Nasten).
-304. Support for Ti3025/#9GXE64pro (Robin Cutshaw).
-303. Don't include s3_svga driver in SVGA server by default.
-
-XFree86 3.0Ea (17 September 1994)
-302. Update bsdi.cf so Gcc2 is default for versions 1.1 and later only
- (Hans Nasten).
-301. Fix mfb.banked so it will compile with gcc 1.4x (Hans Nasten).
-300. Remove old Xconfig code.
-299. Fix some SEGV after FatalError() problems in xf86Config.c.
-298. Set max clock to 67.5MHz for Mach32 at 16bpp.
-297. Support for P9000 screen blanking at 16bpp and 32bpp (Erik Nygren).
-296. Merge in XC public fix-05.
-295. Trap bpp > 8 in S3 server for Bt485 and Ti RAMDACs since it doesn't work.
-294. Fixes for various xf86Config.c bugs.
-293. Fix S3 clock limits when using clock doubling RAMDACs.
-292. Fixes to Ti3025 code to prevent lockups (Robin Cutshaw).
-291. Move S3 Bt485 probe to after the Ti3020/5 probe (Robin Cutshaw).
-290. Fix cirrus HW cursor behaviour at top and left edges (Simon Cooper).
-289. Set background colour mapping of Cirrus HW cursor correctly
- (Simon Cooper).
-288. Allow cirrus hardware cursor to be used when accel is turned off
- (Simon Cooper).
-287. Don't build shared lib for LBX on Linux (Orest Zborowski).
-286. Add README.Linux (Orest Zborowski).
-285. Fix P9000 cursor problems when VT switching (Erik Nygren).
-284. Update P9000 server to work with XF86Config (Erik Nygren).
-283. Fixes for Solaris 2.4 x86 build problems with reconfig and shm.c
- (Doug Anson).
-
-XFree86 3.0E (14 September 1994)
-282. Change the 'Device' entry in the Keyboard section of XF86Config to
- 'Protocol'.
-281. Update the M magic formula for S3 server (Harald Koenig).
-280. Disable TI3025 support in S3 server -- it is incomplete.
-
-XFree86 3.0Dl (13 September 1994)
-279. XF86Config(4/5) manual page.
-278. LinkKit support for the W32 server.
-277. Change HW cursor code to position cursor next to the top/left edges
- instead of disappearing (Harm Hanemaayer).
-276. Add code to the Cirrus driver to determine clock limits based on the
- available DRAM bandwidth (Harm Hanemaayer).
-275. Add an "S3MNAdjust" entry to the Device section of the XF86Config
- to allow tuning of the M and N parameters in the S3 server (Harald
- Koenig).
-274. Add a Gamma entry to the Monitor section in the XF86Config (Harald
- Koenig).
-273. Don't strip server binaries when installing.
-272. Set PLL limits in S3 server for S3 GENDAC and SDAC.
-
-XFree86 3.0Dk (11 September 1994)
-271. Add check for incorrect Modes line in XF86Config.
-270. Add some sanity checks to S3 server for supported depths.
-269. Fix SEGV during startup of VGA16 server.
-268. Support for HW cursor in the Cirrus driver (Simon Cooper).
-267. Fix LinkKit Imakefile for building SVGA server (Simon Cooper).
-266. Update lnxLib.rules for new dll tools (Orest Zborowski).
-265. Add code to the VGA servers to handle drivers (like tvga with 512k
- in 256 colour mode) which require scaling of the raw clock to give
- the pixel clock.
-264. Add code to the VGA servers to handle drivers (like the generic 256
- colour driver) which use only builtin modes.
-263. Fix bitPerRGB reported by the SVGA server.
-262. ET4000/W32 accelerated server (Glenn Lai).
-261. Fix for AGX rect tile and stipple code (Henry Worth).
-260. Add checks for the presence of Modes lines to servers that require them.
-259. S3 code to handle limits imposed by clock chips.
-258. Fix S3 pMode->SynthClock code (Harald Koenig).
-257. Fix S3 raw clock setting for SC15025 (Harald Koenig).
-256. Fixes for Mach32ImageStipple (Mike Bernson).
-255. Improve AGX support for the Hercules dual RAMDACs, provide
- better screen blanking at startup, and fix memory probe (Henry Worth).
-254. Add clockchip "ti3025" recognition (Hans Nasten).
-253. Fix xf86Config handling of ClockChip (Harald Koenig).
-252. Fix xf86Config handling of default colour weights (Harm Hanemaayer).
-251. P9000 updates (Erik Nygren).
-250. Fix SEGV problem in Mach32 font cache code.
-249. S3 code to handle clock/bpp/ramdac dependent raw-clock vs pixel clock
- scaling.
-
-XFree86 3.0Dj (8 September 1994)
-248. Fixed and enabled ImageRead in CopyArea for P9000 server (Chris Mason).
-247. Fixed xdm server restart problem with P9000 server (Erik Nygren).
-246. Added a sample XF86Config file that gets installed as
- $(LIBDIR)/XF86Config.eg.
-245. Change search method for XF86Config file. Only allow user-specified
- location when real-uid == 0. Also change -xconfig flag to -xf86config,
- and $XCONFIG to $XF86CONFIG.
-244. Fix reconfig's problem with "ps/2" (Orest Zborowski).
-243. External changes for W32 server (Glenn Lai).
-242. Change ELSA probe to check for BIOS signature first (Harald Koenig).
-241. Preliminary support for the Ti3025 & #9GXE64pro (Robin Cutshaw).
-
-XFree86 3.0Di (7 September 1994)
-240. Remove AGX server's dependence on VGA256 (Henry Worth).
-239. Fix display start address in vgawonder driver for Mach32 and Mach64
- boards (Marc Aurele La France).
-238. Fix clock probing in vgawonder driver for Mach64 boards
- (Marc Aurele La France).
-237. vgawonder driver now detects and rejects Mach32 boards without
- VGA Wonder functionality (Marc Aurele La France).
-236. Add ClockChip XF86Config keyword for programmable clock chips.
-235. Add a FIFO_MODERATE option for AGX server (Henry Worth).
-234. Limited support for Big-RAMDAC and dual-RAMDAC for 2MB Hercules
- Graphite cards (Henry Worth).
-233. Eliminate use of libvga256 in AGX server (Henry Worth).
-232. Convert AGX code to use the Ramdac keyword instead of Options (Henry
- Worth).
-231. Fix (?) ELSA probe code's register restoral.
-230. Auto-detection code for the NetBSD aperture driver (Matthieu Herrb).
-229. Change OpStipple interface in font code (Hans Nasten and Jon Tombs).
-228. Fix clock and register restoration in P9000 server (Chris Mason,
- Harry Langenbacher, Erik Nygren).
-227. Fix Orchid P9000 support (Harry Langenbacher).
-226. Fix BIOS Probe for Viper PCI (Bob Hollinger).
-225. 16bpp/32bpp support code for SVGA server. Cirrus 16bpp/32bpp support
- is now enabled (Harm Hanemaayer).
-224. Fix Mach32 cache problems (Mike Bernson).
-223. Fix Mach32 memory probe.
-222. xf86Config and reconfig bug fixes.
-
-XFree86 3.0Dh (4 September 1994)
-221. Added minimal reconfig(1) man page so that 'make install.man'
- doesn't fail.
-220. Combine Stealth64 and Miro Crystal 20SV code. This should fix
- some Stealth64 problems.
-219. Fix InstallManPageAliases rule for FreeBSD (Ernest Hua).
-218. 16bpp and 32bpp support for Cirrus driver -- still requires some changes
- to the SVGA server, so not enabled yet (Harm Hanemaayer).
-217. Fixes for Mach32 cache clipping problems (Mike Bernson).
-216. 32bpp S3 updates for ELSA cards (Harald Koenig).
-215. Updates to new XF86Config code.
-
-XFree86 3.0Dg (3 September 1994)
-214. Change over to new config file format -- XF86Config (Gertjan Akkerman).
-
-XFree86 3.0Df (31 August 1994)
-213. Amoeba support updates (Kees Verstoep).
-212. Fixes for Viper PCI support (Matt Thomas).
-211. MoveWindow acceleration for all depths on P9000, and acceleration
- now enabled by default (Chris Mason).
-210. P9000 updates. Includes updates to sysconfig code, Orchid and PCI
- support now enabled by default (Erik Nygren).
-209. SuperProbe and ModeDB updates (David Wexelblat).
-208. Support for the S3 805i and 16-bit RAMDACS (including ATT20C498,
- STG1700, SDAC) (Bernhard Bender).
-207. Support for the S3 SDAC with S3 864 (Bernhard Bender).
-206. Basic support for ET4000W32 chipsets in the VGA servers. Includes
- chipset detection and code to handle up to 4MB video memory (Harm
- Hanemaayer).
-205. Mach32 server modified to use generic cache code (Mike Bernson).
-204. Allow pixmap expansion for display widths <= 800 in S3 server.
-203. Updates for SCO (including 3.2.4 and international crypt support)
- (David McCullough).
-202. Use mi cursor for 32bpp on S3 928 because HW cursor is broken (Harald
- Koenig).
-201. Fix nomemaccess code in s3im.c (Harald Koenig).
-200. Code to auto-detect ELSA Winner cards, and automatically enable the
- icd2061a clock (Harald Koenig).
-199. Fix for 32bpp S3 font cache problems (Harald Koenig).
-198. Support for a linear addressing mode in the Cirrus driver (Harm
- Hanemaayer).
-197. Performance improvements for the "fastvga256" asm code (Harm Hanemaayer).
-196. Fix for Cirrus problem caused by pvga1 probe.
-195. Code added to S3, Mach8 and VGA servers to delete modes from the
- "Modes" line which would previously have caused the server to
- not start (Stuart Anderson). Note: the Mach32 server already had
- this code.
-
-XFree86 3.0De (20 August 1994)
-194. Add run-time check for SHM kernel support on FreeBSD and NetBSD.
-193. Updates to xload for Solx86 (David Holland).
-192. Fix NULL dereference in showfont (David Holland).
-191. xconsole and doc updates for NetBSD 1.0_BETA (Matthieu Herrb).
-190. Major Cirrus driver update. Includes faster solid, stipple and tile
- filling, improved text acceleration, blt in background, shadow I/O
- registers, optional MMIO support for 543x (Harm Hanemaayer).
-189. Support for the miroCRYSTAL 20SV (S3 964) (Eddy Olk).
-188. Preliminary 32bpp S3 support (Harald Koenig).
-187. Make TrueColor the default root visual for 15/16/24bpp S3 (Harald Koenig).
-186. Fix S3 16bpp for 1024x768 and 1152x900 and some panning problems
- (Harald Koenig).
-185. Fix tiling problem, and VT switch problems for S3 16bpp (Harald Koenig).
-184. Fix for Ti3020 ramdac support at >8bpp (Robin Cutshaw).
-183. AGX server fixes. Includes CopyPlane, (vga) save/restore, SC15021 CLUT
- access, scratchpad config. (Henry Worth).
-182. Merge in XC public fix-04.
-
-XFree86 3.0Dd (12 August 1994)
-181. Fix for unnecessary read-ahead in mfbblt, and remove the '-32' display
- width restriction (Pascal Haible, Gertjan Akkerman).
-180. Support for SGS/inmos STG1700 RAMDAC -- S3 server (Bernhard Bender).
-179. Performance improvements for AGX server (Henry Worth).
-178. More 15/16bpp fixes for S3 (Harald Koenig).
-
-XFree86 3.0Dc (11 August 1994)
-177. Various 15/16bpp S3 fixes (Jon Tombs, Harald Koenig).
-176. 16bpp support for ATT 20C490 (Jon Tombs).
-175. 16/24/32bpp code for SC15025 (Harald Koenig).
-174. Support for gamma correction in S3 server (Harald Koenig).
-173. Probe code for the SC15025 (S3 server and SuperProbe) (Harald Koenig).
-
-XFree86 3.0Db (6 August 1994)
-172. Patches for N.M value trimming (Harald Koenig).
-171. ATT20C498 and 864 support for 15/16/24bpp in S3 server (Harald Koenig).
-170. Ti3020 and Bt485 Ramdac support for 15/16/24bpp in S3 server
- (Robin Cutshaw).
-169. Fix problems building debugging libFS (Christos Zoulas).
-168. Remove XOR'd extended register addressing in S3 server.
-
-XFree86 3.0Da (3 August 1994)
-167. Use XOR'd extended register addresses for S3 server -- avoids clash
- with "COM4" I/O address (Jon Tombs).
-166. 16bpp S3 support (no ramdac initialisation yet) (Jon Tombs).
-
-XFree86 3.0D (1 August 1994)
-165. Fix for text restore problems with cl6420 driver (Manfred Brands).
-164. Change S3 screensaver code to do the same thing as the vga256 code
- (Bernhard Bender).
-163. Update Cirrus driver for vga256 changes (Harm Hanemaayer).
-162. Fixes for font scaling problems on SVR4 (David Wexelblat).
-161. Remove all of the old unused pixmap cache code (David Wexelblat).
-160. Use generic font cache code for S3 server (David Wexelblat).
-159. Native AGX code for Save/RestoreAreas, CopyWindow and PaintWindow
- (Henry Worth).
-158. Change AGX clock mappings -- see README.agx for details (Henry Worth).
-157. Update AGX server for vga256 changes (Henry Worth).
-156. Xtest fix for Linux (Erik Nygren).
-155. Speedup for cached text output in Mach8 and 8514 servers (Hans Nasten).
-154. Workaround for 6225 with LCD where full on white pixels cause display
- problems (Philip Homburg).
-153. Fix memory handling for Mach8 boards with the SVGA vgawonder driver
- (Marc Aurele La France).
-152. Fix some build problems on NCR SVR4 (Stuart Anderson).
-151. Fix problem which caused xjewel to lock up the S3 server when running
- in linear mode (Harald Koenig).
-150. xman support for gzip'd man pages.
-149. Fix LinkKit problems.
-148. Omit monitor ID check in 8514 server.
-147. Fix card ident problem with ati driver.
-146. Fix asm problem in new pvga1/bank.s.
-145. Fix programs/Imakefile error.
-
-XFree86 3.0Ce (24 July 1994)
-144. Alternate "SlowBcopy()" which avoids I/O (which causes problems on
- some cards) (Glenn Lai).
-143. Restore original mouse baud rate when exiting and VT switching (Harald
- Koenig).
-142. pvga1 driver updates. Includes 90C33 support for 2MB, and accel code
- updates (Bill Conn and Bill Morgart).
-141. Major updates to the SVGA ATI vgawonder driver. Includes support for
- 4MB, probe code to detect Mach8, Mach32 and Mach64 boards, RAMDAC
- detection, clock probe update to handle the clock chip used on Mach64
- boards, and fixes for V3, V4 and V5 boards (Marc Aurele La France).
-140. Support for BuildServersOnly option to build only the servers using
- a cut-down source tree (Gertjan Akkerman).
-139. Preliminary P9000 accelerated support (currently incomplete and
- disabled by default) (Chris Mason and Erik Nygren).
-138. Preliminary Viper PCI, Orchid P9000 support (currently disabled by
- default) (Erik Nygren).
-137. Replace the cfb.banked code with fb code which relies more on the
- standard cfb code. For further details see the file "Design" in
- xfree86/vga256/vga/ (Stuart Anderson).
-
-XFree86 3.0Cd (22 July 1994)
-136. Add dacspeed Xconfig keyword, and modify the S3 server to use it.
-135. Update contrib source to the XC's full release version.
-134. Fix pixel doubling problem on #9 GXE64 cards (Robin Cutshaw).
-133. Change '--print' to 'print-libgcc-file-name' in Linux config files
- for compatibility with gcc 2.6 (Orest Zbrowoski).
-
-XFree86 3.0Cc (19 July 1994)
-132. Make use of the Xconfig Ramdac keyword in the S3 server.
-131. Improved support for the ELSA W2000Pro (Dirk Hohndel).
-
-XFree86 3.0Cb (16 July 1994)
-130. Updated xc/bug-report for XC fix-03.
-129. Don't mark duplicate clocks as zero in VGA servers.
-128. Support for #9GXE64 in S3 server (Robin Cutshaw).
-127. Tiled pixmap/stipple expansion for the S3 server (David Wexelblat).
-126. Tiled pixmap/stipple expansion for Mach8 and 8514 servers (Hans Nasten).
-125. P9000 updates. Includes colour restoration fix, changes in Modes
- processing, and removal of banking support (Erik Nygren).
-124. 16 and 32 bpp TrueColor support for the P9000 server (Erik Nygren).
-123. Updates to AGX server. Includes font cache fixes, line fixes and
- some more tuning options (Henry Worth).
-122. Aperture driver for NetBSD (Matthieu Herrb).
-121. Added basic man page for beforelight (Rich Murphey).
-120. Swap order of libXExExt and libXext.
-119. Remove the temporary Mach32ShareCfb option.
-
-XFree86 3.0Ca (28 June 1994)
-118. NetBSD updates (Christos Zoulas).
-117. Various updates for Minix (Philip Homburg).
-116. Support for including the MIT-SCREEN-SAVER extension (David Holland).
-115. Fixes for AGX font cache code (Henry Worth).
-114. Banking support for P9000 (doesn't seem to work yet) (David Moews).
-113. Text restoration code for P9000 (Chris Mason).
-
-XFree86 3.0C (22 June 1994)
-112. Fix server crash when started with a lock key on.
-111. Recognise 864/964 PCI as capable of linear memory access.
-110. Fix ramdac access and clock probe problems with AGX server (Henry Worth).
-109. Support for Stealth 64 (S3 964 + Bt485) (Steven Parker).
-108. Fix for 4-pixel border problem with S3 864 pixmux (Harald Koenig).
-107. Allow the S3 SVGA driver to recognise the 864 and 964 (Harald Koenig).
-106. Improved 5434 support, and accelerated copyPlane1to8 for cirrus
- (Harm Hanemaayer).
-
-XFree86 3.0Bc (19 June 1994)
-105. Fix VT switch problem in 16bpp Mach32 when sharing cfb.
-104. Add framework for a ramdac Xconfig setting (like chipset).
-103. Reorganise mode/clock matching code (Marc Aurele La France).
-102. Fix server's client count problem after authorisation failure.
-101. Option "power_saver" to enable power-down mode on "green" monitors.
- So far this is implemented only for VGA (all depths) and S3 servers.
-100. Remove old "memaccess" S3 option.
- 99. Add Option "pci_hack" to work around a lockup problem reported with
- some 928-P cards.
- 98. Fix S3 928-P detection/reporting.
- 97. Don't allow S3 "nomemaccess" option for 864/964 chipsets.
- 96. Make cbrt a library -- removes the need for NeedCbrt on Linux
- (Marc Aurele La France).
- 95. Change ATI SVGA driver to Marc Aurele La France's version
- (includes support for Vga2 and Vga16).
- 94. Function prototyping for AGX, and prototype cleanup in vga16 (Stuart
- Anderson).
- 93. Fix (not complete?) problem with dual-headed servers.
-
-XFree86 3.0Bb (16 June 1994)
- 92. AGX server (Henry Worth).
- 91. Accelerated support for 90C33 (Bill Conn).
- 90. Use s3ImageWriteFunc to load S3 cursor.
- 89. Fix problems with SPEA Mercury for clocks > 120MHz (Norbert Distler).
- 88. Code to program S3 GENDAC clock (Clocks "s3gendac") (Jon Tombs).
- 87. Fix some build problems with lbx.
- 86. Build servers with -DAVOID_GLYPHBLT.
-
-XFree86 3.0Ba (11 June 1994)
- 85. Preliminary ELSA Winner 2000PRO support (S3 964) (Dirk Hohndel).
- 84. Updates to S3 864 support (Harald Koenig).
- 83. Merge in XC fix-02.
-
-XFree86 3.0B (6 June 1994)
- 82. bitblt fixes (including big memory leak) for 8514, Mach8, Mach32 and
- S3 servers (Tiago Gons).
- 81. line/seg fixes for 8514 and Mach8 servers (Tiago Gons).
- 80. Remove separate cfb libs for Mach32 (only compile-tested so far).
- 79. Restore hw/xfree86/etc directory.
- 78. Update bsdinst.sh for SVR4 (use /usr/ucb/install, and run 'mcs -d'
- as well as strip).
- 77. Cirrus driver updates (Harm Hanamaayer).
- 76. Mach support (Robert Baron).
-
-XFree86 3.0Ac (1 June 1994)
- 75. Amoeba fixes (Kees Verstoep).
- 74. Fixes for Mach32 dashed line/segment code (Mike Bernson).
- 73. Preliminary 90C33 support (Bill Conn).
- 72. NetBSD.cf updates, and README.NetBSD added (Matthieu Herrb).
- 71. Preliminary support for the ELSA Winner 1000PRO-VL-2 (Harald Koenig).
- 70. Add "weight" and "displayWidth" entries to ScrnInfoRec.
- 69. Banked vga2 server (Pascal Haible).
- 68. Font cache changes for the Mach8 and 8514 servers. This allows them
- to work without a font cache, and should allow their use with 512k
- Mach8 cards. (Hans Nasten)
- 67. Don't include XIE in the Mono and VGA16 servers (it doesn't handle
- bit-order != byte_order).
- 66. Add LinkKit and updated VGADriverDoc.
-
-XFree86 3.0Ab (28 May 1994)
- 65. Add support for gzip'd man pages on FreeBSD.
- 64. P9000 server (Erik Nygren).
- 63. Video7 SVGA driver (Craig Struble).
- 62. CL6420 SVGA driver (Manfred Brands).
- 61. Set default paths for xdm for *BSD (so {Give,Take}Console can find chown).
- 60. Add a hw/xfree86/doc directory, and start putting the docs back.
- 59. Fixes for Amoeba support (Kees Verstoep).
-
-XFree86 3.0Aa (22 May 1994)
- 58. Merge in XC public fix-01.
- 57. Updates to FreeBSD.cf.
- 56. Add xf86site.def which can optionally be included from site.def.
- 55. SCO support and some bug fixes (David McCullough).
- 54. Some initial untested S3 864/964 code (Harald Koenig).
- 53. Fix for bsdLib.tmpl.
- 52. STREAMSCONN fixes for xdm, chooser and Xserver XDMCP code (Stuart
- Anderson).
-
-XFree86 3.0A (15 May 1994)
- 51. SVGA driver for the AL2101 chipset (Paolo Severini).
- 50. SVGA driver for the MX68000 and MX68010 chipsets (Frank Dikker).
- 49. Updates to the Cirrus driver (Harm Hanemaayer). Includes code cleanup,
- mono support, improved handling of the 5430, 5434, and transparent
- text acceleration.
- 48. Preliminary code for detecting S3 864/964 and AT&T 20C498 (Harald Koenig).
- 47. Generic VGA256 driver -- works only at 320x200 (Harm Hanemaayer)
- 46. Fixes for vga2/mfb and vga16/mfb Imakefiles.
- 45. Include SuperProbe.
-
-XFree86 3.0d (8 May 1994)
- 44. Add missing files to vga2/mfb.
- 43. Set VendorString and VendorRelease up for XFree86.
- 42. Workaround for STREAMSCONN Xdmcp problems (Xserver and xdm).
- 41. 16 bit (directcolor) support for Mach32 (Craig Groeschel).
- 40. Minix 3886vm support (Philip Homburg).
-
-XFree86 3.0c (6 May 1994)
- 39. Fixes for Solaris X86 (Doug Anson).
- 38. No longer link the Mono and VGA16 servers with Xserver/mfb/libmfb.a.
- 37. Updates to the VGA16 code (Gertjan Akkerman). Includes banking support
- (old-style rather than the Xsvga method), staticcolor visual, oak
- driver enabled, added some missing files to vga16/mfb.
- 36. Fix Linux shared libs (Orest Zborowski)
- 35. Apollo mono driver (Hamish Coleman)
- 34. Support for dual-headed vga2+mono and vga16+mono servers (Pascal Haible).
- 33. Reorganisation of the mono server (Pascal Haible). Includes removing
- xfree86/bdm2, xfree86/hga2, and replacing them with xfree86/mono.
- 32. Fixes for PEX font compiler (from our 940327a snapshot).
- 31. Fix SIOCGIFCONF code in xdm and Xserver for SVR4 (with Lachman TCP)
- and FreeBSD. There are still xdm and chooser problems on SVR4.
-
-XFree86 3.0b (29 April 1994)
- 30. Add S3 driver to SVGA server.
- 29. Disable accelerated text blit for Cirrus 543x.
- 28. Reorder some of the Bt485 code, and get clock doubling working again
- without pixmux.
- 27. Fix image shift problem for pixmux on #9 cards (Robin Cutshaw).
- 26. Fix initialisation bug for Cirrus 62{2,3}5 cards (Harm Hanemaayer).
- 25. Remove 8514 monitor ID check in Mach8 server.
- 24. Fix for problem with compaq driver.
- 23. Add "no_bitblt" option for the cirrus driver.
- 22. Recognise the 5429 in the cirrus driver.
- 21. Disable interrupts while programming the ICD2061A.
- 20. sync-on-green support for the TI3020.
- 19. Move S3 clock doubler setting from icd2061ClockSelect() to s3Init().
- 18. Fix dac_8_bit for Bt485 cursor, and fix Bt cursor blanking problem.
- 17. S3 pixmux support for STB Pegasus, and cleanup of pixmux and icd code.
- (Leonard Zubkoff).
- 16. Change "fifo_conservative" setting for CLGD543x.
- 15. Don't reserve video memory for HW cursor on S3 when using a RAMDAC cursor.
- 14. Allow the "8clocks" option to force 9 clocks instead of 17 on WD90C3{0,1}
- cards.
- 13. Fix some DEALLOCATE_LOCAL problems in accel servers.
- 12. Support for Bt485 on #9 cards (Robin Cutshaw).
- 11. Fixes for Cirrus driver (Harm Hanemaayer).
- 10. Fix for text restore problem on some S3 cards (Jon Tombs).
- 9. Workaround for Mach32 detection problem on some platforms.
- 8. Fix incorrect usage of $(DESTDIR) in some lnxLib.rules.
- 7. Code to detect 928-P (Harald Koenig).
- 6. Fix cbrt() in mi/ so that it can handle negative arguments.
- 5. Fix for line clipping problem in cfb.banked (Glenn Lai).
-
-XFree86 3.0a (28 April 1994)
- 4. Add XFree86 server names to the list in xinit.
- 3. Set XawI18nDefines correctly for SVR4.0.
- 2. Update ncr.cf to pick up AllocateLocalDefines when building servers.
- 1. Fold in client/lib OS support not picked up by the XC.
-
-XFree86 3.0 (26 April 1994)
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2982 2003/11/21 06:01:42 dawes Exp $
-
-
-
-
-
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG.ND b/hw/xfree86/doc/changelogs/CHANGELOG.ND
deleted file mode 100644
index 3c9e1e1f6..000000000
--- a/hw/xfree86/doc/changelogs/CHANGELOG.ND
+++ /dev/null
@@ -1,418 +0,0 @@
-XFree86 3.9jw (31 July 1998)
-1327. Fix a crash in the chips driver when the chipset is specified in the
- config file (#1846, Taketoshi Sano).
-1326. Add more Pm2 acceleration and add DPMS support for all glint chips
- (#1844, Alan Hourihane).
-1325. Add 8x8 pattern trapezium fills, screen to screen colour expansion
- to the MGA driver, and fix a clipping bug with colour expansion
- (#1843, Mark Vojkovich).
-1324. Add Screen->Screen colour expansion to XAA (#1841, Mark Vojkovich).
-1323. Fix negative widths and heights in XAA's wide line code (#1840,
- Alan Hourihane).
-1322. Fix an XAA tiled rect alignment problem (#1839, David Bateman).
-1321. Fix XAA 8x8 mono for 24bpp.
-
-XFree86 3.9jv (24 July 1998)
-1320. Fix the BitsPerPixel() macro in cfb.h for 24bpp.
-1319. Update XAA docs (#1838, Mark Vojkovich).
-1318. Add colour expansion stipples to XAA (#1837, Mark Vojkovich).
-1317. Add a stipple replacement for the MGA driver that takes into account
- the 256K blit maximum per operation (#1836, Mark Vojkovich).
-1316. Fix C&T memory clock messages (#1834, David Bateman).
-1315. Add some new colour expansion code for older tseng chips (W32/W32i)
- (#1832, Koen Gadeyne).
-1314. Preliminary tseng XAA support (#1832, Koen Gadeyne).
-1313. Resync the tseng driver with the main branch version (#1832,
- Koen Gadeyne).
-1312. Some C&T updates (#1833, David Bateman).
-1311. Speed up GXcopy for XAAFillCacheBltRects (#1831, David Bateman).
-1310. Remove some code duplication in the C&T driver (#1830, David Bateman).
-1309. Add 8x8 colour and mono fills for 8bpp and 16bpp for all C&T chips
- and 8x8 mono fills at 24bpp for HiQV chips (#1830, David Bateman).
-1308. Fix problems with XAA 8x8 patterns (#1830, David Bateman).
-1307. Get 4bpp working with C&T chipsets, and add the ShowCache option to
- the C&T driver (#1829, David Bateman).
-
-XFree86 3.9ju (19 July 1998)
-1306. Calculate DPI from the DisplaySize entry in the Monitor section
- if present.
-1305. Implement "tri-state" options.
-1304. Move most of cfbcmap.c to mi.
-1303. Update the C&T driver for recent XAA ImageWrite changes, and fix
- some bugs in CHIPSHiQVWritePixmap (#1824, Nozomi Ytow).
-1302. Optimised horizontal and vertical lines for MGA (#1823, Mark Vojkovich).
-1301. Fix some XAA bugs (#1822, Mark Vojkovich).
-1300. Major updates to the XAA documentation (#1821, Mark Vojkovich).
-1299. Update XAA for the EnterVT type change (#1821, Mark Vojkovich).
-1298. Add scanline ImageWrites to XAA (#1821, Mark Vojkovich).
-1297. Make XAA Alpha friendly (#1821, Mark Vojkovich).
-1296. Set pScrn->vtSema to FALSE in ChipCloseScreen() after restoring the
- video hardware state.
-1295. Move xf86SetDpi() calls into PreInit().
-1294. Don't show module version info on subsequent loads.
-
-XFree86 3.9jt (18 July 1998)
-1293. Add IBM 528A to the ramdac module (#1820, Alan Hourihane).
-1292. Make it a fatal error when any AddScreen() call in XFree86's InitOutput()
- fails.
-1291. Change the type of EnterVT() from void to Bool, and make it a fatal
- error for this to fail.
-1290. Add a helper xf86SetBlackWhitePixels() to set the values according
- to the presence of the -flipPixels command line option.
-1289. Add xDpi and yDpi fields to the ScrnInfoRec, and a helper xf86SetDpi()
- to set them.
-1288. Allow a bus type prefix for BusID strings.
-1287. Remove the global xf86VTSema (David Bateman, David Dawes).
-1286. Complete the XAA 8x8 pattern caching (#1817, Mark Vojkovich).
-1285. Add a missing Millennium accel flag (#1816, Mark Vojkovich).
-1284. Make the CRTC blanking setting exact rather than allowing some unblanked
- overscan area (#1813, Koen Gadeyne).
-1283. Prelminary TGA (AXP only) driver (#1811, 1818, Alan Hourihane).
-1282. Prelminary Bt485 ramdac support for the ramdac module (#1809, 1815,
- Alan Hourihane).
-1281. OS-support and config updates for AXP (#1808, Alan Hourihane).
-1280. Add code to the ramdac module for initialising gamma correction
- (1807, Alan Hourihane).
-1279. Fix C&T HiQV PCI bus support (#1802, David Bateman and Nozomi Ytow).
-1278. Add HW cursor support for the Permedia2v (#1812, Alan Hourihane).
-1277. Remove most vgahw dependencies from the glint driver (#1810,
- Alan Hourihane).
-1276. Add preliminary support for the Permedia2v to the glint driver
- (#1800, 1810, Alan Hourihane).
-1275. Some C&T updates (#1791, 1796, Nozomi Ytow, David Bateman).
-1274. Reintegrate Harm's XAA SolidArc code (#1814, David Bateman).
-1273. Make sure assembler usage is set correctly for x86 when MakeDllModules
- is true (#1806, David Bateman).
-1272. Fix too little data being sent by the XAA BitmapScanline when the
- number of dwords sent was divisible by four (#1806, David Bateman).
-1275. Fix for the swapping of fg and bg in the XAA WriteBitmap primitives
- (#1806, David Bateman).
-1274. Add TRIPLE_BITS_24BPP code for the XAA WriteBitmap function (#1806,
- David Bateman).
-1273. Attempts at optimised 6 and 8 pixel drawTETextScanline functions
- in assembler (#1789, 1806, David Bateman).
-1272. Remove some redundant extern declarations (xf86Procs.h & xnest)
- (#1790, Marc La France).
-1271. xf4bpp now loads xf1bpp (#1790, Marc La France).
-1270. Make vgahw module load cfb (re: cfbExpandDirectColors()) (#1790,
- Marc La France).
-1269. Fix vgahw's saving/restoring of text modes, overscan handling
- and memory leaks (#1790, Marc La France).
-1268. Fix compilation warnings in libc wrapper (Marc La France).
-1267. Rewrite VGA generic driver (Marc La France).
-1266. Fix bug that nullified the driver's mode list when deleting the
- second-to-last mode (#1790, Marc La France).
-1265. Reduce verbosity level of the message that gets printed when
- a driver's ValidMode() rejects a mode (#1790, Marc La France).
-1264. Allow drivers to supply a default mode (#1790, Marc La France).
-1263. Allow for more than 4 (== MAXSCREENS) drivers to probe a system
- (1790, Marc La France).
-1262. Fix xf4bpp integration (#1790, Marc La France).
-1261. Implement -dpi flag and -flippixels flags (#1790, Marc La France).
-1260. Fix CLKDIV2 support (#1790, Marc La France).
-1259. Implement multiscanned modes (#1790, Marc La France).
-1258. Fix some depth/bitsPerPixel confusion (#1790, 1799, Marc La France).
-1257. Fix memory leaks in the MITSHM and dix pixmap code (#1790,
- Marc La France).
-1256. Fix a minor header problem in the Type1 code (#1790, Marc La France).
-
-XFree86 3.9js (12 July 1998)
-1255. Make sure DPMSEnabled gets set correctly.
-1254. Use a BlankScreen function with xf86GetClocks() that takes more
- appropriate arguments than SaveScreen.
-1253. Fix SEGV in TsengProbe() when there are no Tseng cards present.
-1252. Add caching of 8x8 patterns to XAA (#1787, Mark Vojkovich).
-1251. XAA updates, including TRIPPLE_BITS_24BPP, check QWORD padding in
- the font rendering, and an attempt at Pentium optimised assembler
- for 6 pixel wide TE font (#1785, David Bateman).
-1250. Fix an omission in xf86MatchPciInstances() (#1786, Kevin Martin).
-1249. Numerous C&T driver fixes and HW cursor support added (#1781-1783,
- David Bateman).
-1248. Add support for 1, 8, 16, 32 and 64 bit interleaves to the XAA
- hardware cursor code (#1780, David Bateman).
-1247. Fix a segfault in xf86DPMSInit() (#1780, David Bateman).
-1246. Some updates to the ramdac module (#1777, 1778, Alan Hourihane).
-1245. Add 500TX support to the glint driver (#1777, Alan Hourihane).
-1244. Fix parsing of ModeLine keyword (#1779, Keldon Jones).
-
-XFree86 3.9jr (5 July 1998)
-1243. Avoid mishandling 64-bit PCI base addresses, and "safely" avoid them.
-1242. Fix font modules so that clients can use the font libraries
- (#1774, Alan Hourihane, David Dawes).
-1241. Fix for XAA GC problems that show up when backing store is enabled
- (#1775, Mark Vojkovich).
-1240. Fix for xf86MatchPciInstances() (#1773, Alan Hourihane).
-1239. Unload drivers in InitOutput that end up not being used.
-1238. Make the ScrnInfoRec.privates persistent rather than per-generation
- data.
-1237. Remove the "requiredModules" field from the ScrnInfoRec and have the
- drivers load the modules they need explicitly. The loader and parts
- of the design have been updated to take this into account.
-1236. Remove refcount code added in change 1175, and fix problem with the
- preexisting refcount code not incrementing the count when modules
- are loaded second and subsequent times.
-1235. Add more info for LoaderPrint{Symbol,Address} functions (1772,
- Stuart Anderson).
-1234. Fix some Linux/Alpha loader problem (#1772, Stuart Anderson).
-
-XFree86 3.9jq (3 July 1998)
-1233. Loadable font modules (#1767, Alan Hourihane).
-1232. Add Option "ShowCache" to allow scrolling down to see part of the
- pixmap cache (#1770, Mark Vojkovich).
-1231. Fix MGA loss of sync problem when scrolling the desktop (#1770,
- Mark Vojkovich).
-1230. Add XAA cursor support to the MGA driver (#1770, Mark Vojkovich).
-1229. Have XAA wrap the EnterVT and LeaveVT functions so that it can
- invalidate the pixmap cache. Also further progress towards
- getting 8x8 patterns cached (#1769, Mark Vojkovich).
-1228. XAA cursor support. Only the TVP3026's style cursor data packing
- (ie. source and mask not interleaved) is supported at the moment
- (#1768, 1771, Mark Vojkovich).
-1227. Implement correct CRTC blanking timings (Koen Gadeyne).
-1226. Lots up updates to the Tseng driver (Koen Gadeyne).
-1225. Chips & Technologies driver converted to ND (#1761, David Bateman).
-1224. Ramdac/colourmap module. Support for IBM ramdac so far (#1759, 1760,
- Alan Hourihane).
-1223. Set the Crtc[HV]Adjusted flags more appropriately in
- xf86SetCrtcForModes() (#1757, David Bateman).
-1222. Change xf86MatchPciInstances() to work with drivers supporting chips
- from more than one vendor (#1753, 1754, Alan Hourihane).
-
-XFree86 3.9jp (27 June 1998)
-1221. Preliminary tseng driver (Koen Gadeyne).
-1220. Add the Xv extension (from the R5 contrib) (#1749, Mark Vojkovich).
-1219. Fix a rendering error in cfb's bit expansion code that can show
- up with a very complex clip mask (#1747, Jens Owen).
-1218. Allow XAA's pixmap cache to use smaller slots when the larger ones
- are not available (#1751, Mark Vojkovich).
-1217. Document the offscreen memory manager (#1747, Mark Vojkovich).
-1216. Fixes and temporary workarounds for mibank problems detected by xf4bpp
- (#1743, Marc La France).
-1215. Fix a XF68_FBDev typo (#1743, Marc La France).
-1214. Fix up cfb and mfb header files (#1743, Marc La France).
-1213. Fix up xf1bpp's integration into the new design (#1743, Marc La France).
-1212. Introduce xf4bpp, a port of vga16 to the new design (#1743,
- Marc La France).
-1211. Allow for zero to be a valid setting for chipID and chipRev. These
- are now initialised to -1 to indicate when they have not been set.
-
-XFree86 3.9jo (22 June 1998)
-1210. Add accelerated solid trapezoid fills to the MGA driver (#1740,
- Mark Vojkovich).
-1209. Add accelerated polygons and wide lines to XAA, and fix some pixmap
- cache problems (#1739, Mark Vojkovich).
-1208. Move the offscreen memory manager from XAA to xfree86/common
- (#1739, 1741, Mark Vojkovich).
-1207. Fix a typo in the glint driver (#1737, Alan Hourihane).
-1206. Resync the parser with the common layer data structures, removing
- some obsolete things and adding a few missing things.
-1205. Include the class/subclass/interface values in pciVideoRec.
-
-XFree86 3.9jn (21 June 1998)
-1204. Replace the "MAGIC" module init interface with the more general
- SetupProc/TearDownProc interface.
-1203. Fix some typos in the DESIGN doc (Koen Gadeyne).
-1202. Add some more acceleration to XAA, and support for it to the MGA
- driver (#1732, 1733, 1735, Mark Vojkovich).
-1201. Preliminary pixmap cache support and offscreen memory manager added
- to XAA (#1732, 1734, 1736, Mark Vojkovich).
-1200. Fix linepitch handling in the glint driver (#1731, Alan Hourihane).
-
-XFree86 3.9jm (15 June 1998)
-1199. Add preliminary infrastructure for different pixmap and framebuffer
- formats.
-1198. Start a module/driver name space registry.
-1197. Accelerated glint driver (#1725-1727, Alan Hourihane).
-1196. Resync the PCI IDs.
-1195. Update xf86GetPciInfoForScreen() and add a similar
- xf86GetIsaInfoForScreen().
-1194. Update DGA support code in the common layer.
-1193. Update DPMS support code in the common layer.
-1192. Reintroduce xf86GetClocks() as a helper.
-
-XFree86 3.9jl (9 June 1998)
-1191. Bring over the serial port functions (from Metro Link).
-1190. Bring over the os-support/pmax code.
-1189. Change the interface for xf86MatchPciInstances() to use separate
- lists of PCI chipset names and IDs.
-1188. Fix some build problems on SVR4.0 and Solaris.
-1187. Rename xf1bpp_mfb* entry points to xf1bpp (#1714, Marc La France).
-1186. Port some recent vga16 changes over to the nd branch (#1714,
- Marc La France).
-1185. Remove CloseScreen() and SaveScreen() from ScrnInfoRec's (#1714,
- Marc La France).
-1184. m68k's XF86_FBDev now uses low-level backing store functions
- during VC switches (#1714, Marc La France).
-1183. Push out backing store and banking wrapper initialisation to the
- to the callers of the various <framebuffer>ScreenInit()'s. This allows
- XAA to wrap screens after banking, but before backing store (#1714,
- Marc La France).
-1182. Allow screen wrappers to free their private data on server reset and
- termination (#1714, Marc La France).
-1181. Minimise the number of public globals in the common layer, and replace
- those the drivers need with functions to access their values.
-1180. Update the PCI code to match that on the main branch.
-
-XFree86 3.9jk (4 June 1998)
-1179. Change the Xserver binary name to "XFree86".
-1178. Add support for building a static Xserver.
-1177. Clean up some of the module Imake config stuff.
-1176. Fix generic vga driver probe crash.
-1175. Keep a reference count for loading modules and avoid loading the
- same module twice.
-1174. A first attempt at ABI versioning the modules and checking it
- in the loader.
-1173. Add a canonical naming for modules, without things like the "lib"
- prefix or "_drv" suffix.
-1172. Add the -layout and -screen options to allow a layout or screen section
- to be specified from the command line.
-1171. Make the interface in the xf86Find{Vendor,Layout} parser functions
- consistent with the others.
-
-XFree86 3.9jj (31 May 1998)
-1170. Add call to LoaderCheckUnresolved().
-1169. Add finding the correct Display subsection to the xf86SetDepthBpp()
- helper (David Dawes).
-1168. Some os-support layer cleanups (more required).
-1167. Add a new helper to simplify the driver Probe() code for PCI cards
- (David Dawes).
-1166. Remove some fields from the ScrnInfoRec.
-1165. Add a set of option handling functions and helpers to the common layer.
- These allow the option data structures to be opaque to the drivers
- (David Dawes).
-1164. Add xstrdup (Xstrdup) to os/utils.c, and treat xf86strdup the same way
- as xf86malloc in the libc wrappers.
-1163. Fix XAA 14 pixel width fonts (#1699, Mark Vojkovich).
-1162. Fix XAA CopyGC crash (#1698, Mark Vojkovich).
-
-XFree86 3.9ji (23 May 1998)
-1161. MGA Support for the new XAA code (#1697, Mark Vojkovich).
-1160. New XAA code (#1695, 1696, Mark Vojkovich).
-1159. Millennium 2 (inc AGP) support for the mga driver (#1697,
- Mark Vojkovich).
-
-XFree86 3.9jh (22 May 1998)
-1158. Fix 'Unknown symbol type 1e' messages in the a.out loader
- (#1683, Matthieu Herrb).
-1157. Loader updates, including Alpha and PowerPC support (#1467, 1666,
- Metro Link).
-1156. Add '-Wall' to gcc compile options
-1155. Add Xarch.h (#1399, Metro Link).
-1154. Resync libc/ansic wrappering.
-
-XFree86 3.9jg (3 May 1998)
-1153. Remove ilbm's call to miRegisterGCPrivateIndex(), which no longer
- exists (#1670, Marc La France).
-1152. Fix problems with mi generic functions in mibank (#1670,
- Marc La France).
-1151. Symbolically link xf86_ansic.h so osPexFont.c can #include it
- (#1670, Marc La France).
-1150. Fix opaque types in xf86_libc.h (#1670, Marc La France).
-1149. Fix a typo in mibank which makes miScanLineWidth() always fail.
-1148. Fix various missing symbols that show up when attempting to use
- non-dlopen modules.
-
-XFree86 3.9jf (18 April 1998)
-1147. Add xf1bpp framebuffer for use by vga2 and mono (i.e. hga2)
- drivers. This is just a copy of mfb compiled for the bitmapScanlinePad
- and bitmapBitOrder needed by these hardware framebuffers (#1636,
- Marc La France).
-1146. A mode that fails validation (for whatever reason) no longer
- affects the resulting virtual resolution (#1636, Marc La France).
-1145. miScanlineWidth() is now passed the hardware plane pixmap format
- rather than nBankBPP (the harware plane bpp) and nPixelBPP (the
- "total" bpp), and have xf86ValidateModes() call miScanLineWidth()
- to determine an appropriate line pitch for the virtual resolution
- requested (#1636, Marc La France).
-1144. Remove the helpers' concept of pixelArea as this can be derived
- from videoRam and bitsPerPixel, express pitchInc in bits, and
- pass apertureSize to mode validation helper (#1636, Marc La France).
-1143. Introduce the new mi banking wrapper (not yet used) (#1636,
- Marc La France).
-1142. Make each screen keep track of the pixmap formats and display-
- wide attributes it needs in its ScreenInfoRec. InitOutput()
- can then ensure consistency before adding the screens to the
- display (#1636, Marc La France).
-1141. Use low-level backing store functions to save/restore the
- screen during VC switches (doesn't work with vga16) (#1636,
- Marc La France).
-1140. Move a copy of the backing store low-level function pointers
- into the ScreenRec. This allows them to be wrapped (#1636,
- Marc La France).
-1139. Rename [GS]etRootPixmap screen entries to [GS]etScreenPixmap
- and add [GS]etWindowPixmap entries. Some may not be needed and
- can be removed later (#1636, Marc La France).
-1138. Remove cfbScreenInitLong() entries. They are not needed since the
- RGB ordering and masks can be fixed after calling cfbScreenInit()
- (#1636, Marc La France).
-1137. Fix the saving and restoring of PSZ #define in cfb??.h headers,
- add copyright notice to them, and get right Imakefile to include
- them in the link kit (#1636, Marc La France).
-1136. Fix oversight in 1133 (#1636, Marc La France).
-1135. Some include file fixes (#1539, Marc La France).
-
-XFree86 3.9je (14 February 1998)
-1134. Move framebuffer ModuleInit funtions into separate files (#1475,
- Marc La France).
-1133. Move the following GC privates to the GC structure proper:
- pRotatedPixmap, pCompositeClip, fExpose, freeCompClip. This is in
- preparation for the banking mi wrapper (#1451, Marc La France).
-1132. Minor bug fix to mfb and afb framebuffers (#1443, Marc La France).
-1131. Ensure window and GC privates are aligned on a sizeof(long)
- boundary (#1442, Marc La France).
-1130. Minor optimisation of cfb's ImageGlyphBlt entry, required for
- the new banking code (#1431, Marc La France).
-
-XFree86 3.9jd (1 February 1998)
-1129. Update the generic VGA driver for these changes (David Dawes).
-1128. Flesh out and update the design document, and add it to the source
- tree (in xc/programs/Xserver/hw/xfree86/DESIGN) (David Dawes).
-1127. Working non-accel MGA driver (Millennium I only) (David Dawes).
-1126. Update parser (from Metro Link).
-1125. Fill in some missing bits of infrastructure, and fix some bugs there
- (David Dawes).
-
-XFree86 3.9jc (16 January 1998)
-1124. A start at modifying non-accel MGA driver for new design (David Dawes).
-1123. Pick up multimedia/video PCI devices in xf86GetPCIVideoInfo()
- (David Dawes).
-1122. Fix some header usage and missing prototypes (David Dawes).
-1121. Continue filling in missing bits of the new design infrastructure
- (David Dawes).
-1120. Get the generic vga driver working (using dll modules on FreeBSD)
- (David Dawes).
-1119. Reorganise the vgahw module (David Dawes).
-
-XFree86 3.9jb (25 September 1997)
-1118. Continuation of 1117.
-
-XFree86 3.9ja (29 July 1997)
-1117. Start converting the generic vga driver to the new design (Dirk Hohndel,
- David Dawes).
-1116. Add flags to allow to build some modules as shared objects (Dirk Hohndel).
-1115. Fix dll loader to work on Linux (and re-fix it to work on FreeBSD
- again) (Dirk Hohndel, David Dawes).
-1114. Add helper functions for various stages of the server (David Dawes,
- Dirk Hohndel).
-1113. Add glue code to interface with new parser and create internal data
- structures (David Dawes, Dirk Hohndel).
-1112. Split up vga256/vga into vgahw and vgafb (Dirk Hohndel).
-1111. New parser for the config file (Stuart Anderson).
-1110. Start work on the new design.
-
-XFree86 3.9j (12 July 1997)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG.ND,v 1.3 1998/08/02 05:16:54 dawes Exp $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG.R5 b/hw/xfree86/doc/changelogs/CHANGELOG.R5
deleted file mode 100644
index 5f8e03a19..000000000
--- a/hw/xfree86/doc/changelogs/CHANGELOG.R5
+++ /dev/null
@@ -1,1249 +0,0 @@
-XFree86 2.1.1 (4 May 1994)
- 36. Fix server crash on reset problem in Mach32 and S3 servers
- 35. Fix typos in apollo driver
- 34. Fix for Imake config problem on ISC 4.0
- 33. ET3000 memory probe fix for SuperProbe
- 32. Documentation updates
- 31. Some updates for NetBSD-current
-
-XFree86 2.1.0B (26 April 1994)
- 30. Disable accelerated text blit for Cirrus 543x
- 29. Reorder some of the Bt485 code, and get clock doubling working again
- without pixmux
- 28. Disable the PIXMUX_SWITCH_HACK stuff -- it doesn't seem needed any more
- 27. Fix image shift problem for pixmux on #9 cards (Robin Cutshaw)
- 26. Fix initialisation bug for Cirrus 62{2,3}5 cards (Harm Hanemaayer)
- 25. Remove 8514 monitor ID check in Mach8 server
- 24. Updates to the NetBSD README (Matthieu Herrb)
- 23. Hey Rocky, watch me unbreak the Compaq driver... This time for sure...
-
-XFree86 2.1.0Ab (16 April 1994)
- 22. Rewrite of ATI SVGA driver (Marc La France)
- 21. Add "no_bitblt" option for the cirrus driver
- 20. Recognise the 5429 in the cirrus driver
- 19. Disable interrupts while programming the ICD2061A
- 18. sync-on-green support for the TI3020
- 17. Move S3 clock doubler setting from icd2061ClockSelect() to s3Init()
- 16. Fix dac_8_bit for Bt485 cursor, and fix Bt cursor blanking problem
- 15. SuperProbe updates
-
-XFree86 2.1.0Aa (10 April 1994)
- 14. BDM2 apollo driver (Hamish Coleman)
- 13. S3 support for switching between pixmux and non-pixmux modes
- (Amancio Hasty)
- 12. S3 pixmux support for STB Pegasus, and cleanup of pixmux and icd code
- (Leonard Zubkoff)
- 11. Change "fifo_conservative" setting for CLGD543x
- 10. Updates for NetBSD-current, including bumping shared lib revs
-
-XFree86 2.1.0A (7 April 1994)
- 9. Don't reserve video memory for HW cursor on S3 when using a RAMDAC cursor
- 8. Allow the "8clocks" option to force 9 clocks instead of 17 on WD90C3{0,1}
- cards
-
-XFree86 2.1.0a (6 April 1994)
- 7. Fix some DEALLOCATE_LOCAL problems in accel servers
- 6. Support for Bt485 on #9 cards (Robin Cutshaw)
- 5. Fixes for Cirrus driver (Harm Hanemaayer)
- 4. Fix for text restore problem on some S3 cards (Jon Tombs)
- 3. Workaround for Mach32 detection problem on some platforms
- 2. Fix incorrect usage of $(DESTDIR) in some lnuxLib.rules and x386.cf rules
- 1. Code to detect 928-P (Harald Koenig)
-
-XFree86 2.1 (11 March 1994)
-151. OS README updates (affect individual OSs only)
-150. Fix AltGr handling for Linux (affects Linux only)
-149. Comment out the unused s3Save() and s3Restore() functions -- a typo in
- some unreachable code may cause problems with some compilers (should not
- affect any OSs)
-148. Linux compile-time fix for fonts/PEX/lex.l (affects Linux only)
-147. Late cirrus fix for large tiles
-146. Fix for LinkKit site.def and Imakefile (remove dbm references)
-
-XFree86 2.0Z (8 March 1994)
-145. Fix text/graphics mode switching for pixmux with SPEA Mercury. This
- code is now reasonably stable (interlace support is still absent though)
- (Norbert Distler)
-144. Fix for cirrus stipple fill when virtual width is not a multiple of 32
-143. Linux keyboard updates
-
-XFree86 2.0Ce (7 March 1994)
-142. Preliminary support for Bt485 pixel multiplexing on the SPEA Mercury
- card (Norbert Distler)
-141. More documentation updates
-140. SuperProbe updates (ATI and Weitek fixes)
-139. Fix for second MB cirrus BitBLT but -- BitBLT now turned back on for
- 2MB cards (Wolfgang Jung)
-
-XFree86 2.0Cd (6 March 1994)
-138. Default to building shared libs for FreeBSD
-137. Updates to cirrus driver: (Harm Hanemaayer)
- New Option flag "no_2mb_banksel" for cards that have 2MB in the form
- of 512kx8 DRAMS (4 chips)
- Disable BitBLT engine use when using more than 1MB because there
- are problems
- New text bitmap transfer code
-136. Documentation updates
-135. Fix mi/cbrt.c so it handles negative arguments.
-
-XFree86 2.0Cc (5 March 1994)
-134. Update x386/etc/console.h to current version
-133. Some documentation updates (including removing README.XS3)
-132. Updates to cirrus driver: (Harm Hanemaayer)
- New option flags "fifo_conservative" and "fifo_aggressive" to
- control the CRTC fifo threshold.
- Reduce clock limit for the 5420
- Remove accelerated PolyGlyphBlt -- it causes problems
-131. Modify pvga1 driver to detect the 90C24 and treat it as a 90C30
-130. Support for the SC15025 RAMDAC in 8-bit/RGB mode (requires
- the "sc15025" and "dac_8_bit" options) (Helmut Geyer)
-129. Fix vga colourmap save/restore when using a RAMDAC in 8-bit mode (Helmut
- Geyer)
-
-XFree86 2.0Cb (3 March 1994)
-128. Fix for "snow" problems on WD90C3x cards with 80MHz clock (Anders Bostrom)
-127. Fixes for compilation problems on Mach and ISC
-126. Support for 8-bit/RGB for the AT&T 20C490/491 ramdacs (S3 server).
- There is no auto-detect, so the "att_20c490_1" Option must be
- specified (together with the "dac_8_bit" Option)
-125. Added some sample patches from Gertjan Akkerman which document some
- useful changes which could me made to the VGA16 server (these are
- in x386/vga16/doc/).
-124. Fix Mach8 and Mach32 server hang when run on a card with no Mach chip
-123. Update xterm's terminfo file
-122. Install mit/config/README in lib/X11/config
-121. Modify Trident driver to recognise the 9000i, 9200CX, 9100B and 9420
- chipsets. The first is treated as a 9000, and the last three are
- treated as a 8900CL.
-
-XFree86 2.0Ca (2 March 1994)
-120. Fix CR60 setting for clocks > 100MHz (S3 server)
-119. Fix cirrus compilation on SVR4, and bsd_init.c typo
-118. Enable Home/End esc sequences for xterm on all OSs
-117. SuperProbe register unlock fixes
-
-XFree86 2.0C (1 March 1994)
-116. Allow the MIT-SHM extension to be disabled at run-time on BSD systems
- when kernel support for sysv-shm isn't present
-115. Enable Home/End esc sequences for xterm (Linux only -- should this be
- extended?)
-114. Set default xterm tty parameters to reasonable values (fixes problems
- seen when using xdm)
-113. gccmakedep fix (David McCullough)
-112. Special-case code for lines where this is one rectangle in the clip
- region -- for Mach32 (Craig Groeschel)
-111. Update to compaq probe code -- hopefully this will reduce the number
- of false positives
-110. Major updates to SuperProbe
-109. Cirrus driver patches
-
-XFree86 2.0Bb (27 February 1994)
-108. Removed experimental "cr60=..." options (S3), and made CR60=0xFF
- the default setting. The "dram_{slow,med,fast}" options still remain
- as un-documented options (just in case).
-107. Manual page updates
-106. Support for linear fb location on Mach32 PCI cards
-105. Include Solaris x86 "aperture driver" (Doug Anson and David Holland)
-104. Updated Thomas Wolfram's SVR3 mmap driver to version 2.2.3
-103. Allow the MemBase setting in Xconfig specify the high 5 bits of the
- 4MB aperture address for the Mach32 server, and the high 6 bits of
- the LAW address for the S3 server
-
-XFree86 2.0Ba (25 February 1994)
-102. Fix/speedup for window->pixmap part of CopyPlane() in the accel servers
-101. Fix bits per RGB reported for S3 server when using 8bpRGB
-100. Modify code for determining when pixel multiplexing is required for
- the S3 server, and restrict the DisplayWidth to either 1024 or 2048 when
- pixel multiplexing is used
- 99. Preliminary support for the SC11412 clock chip used on the SPEA Mercury
- (S3). Use 'Clocks "sc11412"' to select this (Norbert Distler)
- 98. "icd2061a" now uses the "icd2061a_slow" clock setting algorithm.
- The name "icd2061a_slow" will be dropped in the release after 2.1
- 97. Fixes for zero-width arcs for the VGA16 server (Gertjan Akkerman)
- 96. Support for David Holland's "aperture driver" for linear fbs on Solaris
- 95. Fix Solaris panic when no free VTs are available
- 94. Much-enhanced accelerated support for Cirrus chips (Harm Hanemaayer)
- 93. Support for up to 17 clocks on WD90C3x cards (Anders Bostrom)
- 92. Fix for Compaq avga driver
- 91. Keyboard updates to handle Linux' key remapping (Orest Zborowski)
- 90. README for Solaris (David Holland)
-
-XFree86 2.0B (21 February 1994)
- 89. Possible fix for Bt probe problem that some people see
-
-XFree86 2.0Ab (19 February 1994)
- 88. Combine DRAM and non-DRAM mach8 image assembler code into single files
- with #ifdefs
- 87. Fix for hga2 driver to prevent it from blanking MDA displays when
- swithching back to text mode
- 86. Code to explicitly recognise the *BSD PCVT console driver
- 85. Preliminary support for the S3 805i in interleaved mode
- 85. Fix for single-bank SVGA bitblt code (Giovanni Novelli)
- 84. Fix alu usage in mach32CopyArea() (Craig Groeschel)
- 83. Fix dash line support in Mach32 server (Mike Bernson)
-
-XFree86 2.0Aa (13 February 1994)
- 82. S3 "No_Bt485" and "No_Ti3020" options have been replaced by "Normal_DAC",
- and a "20C505" option has been added
- 81. ATI text restore fixes for Mach32 server (Ton van Rosmalen)
- 80. Planemask fixes for Mach32GetImage() (Craig Groeschel)
- 79. Prevent S3 Ti cursor from being turned on when the screen is blanked
- 78. No longer define __386BSD__ for BSD/386, NetBSD, FreeBSD. Change
- the FreeBSD define from -DFreeBSD to -D__FreeBSD__. Code outside
- ddx/x386 now uses the value of BSD (from <sys/param.h>) and for
- code below ddx/x386, __BSD__ is defined for all the x86 BSD OSs
- 77. Rewrite of Mach32 memory detection code (Mark Weaver)
- 76. Set clock-doubler cut-in to 67.5MHz for Bt485 and 90MHz for AT&T 20C505
- 75. Add ClearRTS option (some mice seem to need it)
- 74. Mach8 server now uses a 1024 line pitch (regardless of virtualX) for
- cards with 1MB
- 73. Support for bank switching with the VGA16 server. Staticgray and
- Grayscale visuals added to the VGA16 server (Gertjan Akkerman)
- 72. Slowed down image routines for DRAM based Mach8 cards (Hans Nasten)
- 71. Improvements to solx86 in/out assembler code, and removal of the
- broken ProworksMOption
-
-XFree86 2.0A (15 January 1994)
- 70. Increase Bt485 clock-doubler cut-in point from 67.5MHz to 90MHz. This
- should fix the "flashing pixel" problem many have reported
- 69. Mach8 font cache performance updates
- 68. Update assembler code and SuperProbe Makefile.std for the ProWorks
- compile on Solaris x86
- 67. Ti3020 probe code for SuperProbe (Robin Cutshaw)
- 66. Fix Mach32 server to recognise PCI cards
-
-XFree86 2.0g (9 January 1994)
- 65. Clock probe code for Mach32 server
- 64. Support for TI3020 ramdac for S3 server (Robin Cutshaw)
- 63. Fix server crash problem if reset occurs when VT switched away
- 62. Make accel servers honour the -dpi flag
- 61. Mach8 font cache updates
- 60. Support for the ProWorks compiler on Solarix x86
- 59. Add memory probe to SuperProbe (only for a couple of chipsets so far)
- 58. Support for display widths of 640, 800 and 2048 with S3 server
- 57. Generalise S3 HW cursor memory allocation -- fixes problems that showed
- up with some virtualY/displaywidth combinations, and will work for
- display widths < 1024
-
-XFree86 2.0f (27 December 1993)
- 56. Fix mach32RecolorCursor() SIGSEGV when VT switched away
- 55. Possible fix for cases where the S3 linear fb probe fails the first
- time the server is started but succeeds on subsequent times
- 54. Updates to Mach32 memory probe
- 53. Fixes for ATI SVGA save/restore code (Ton van Rosmalen)
- 52. Fix xman's handling of nroff bullets and bolding (Rich Murphey)
- 51. Mach8 font cache updates (Hans Nasten)
- 50. Mach32 HW cursor fixes (Mark Weaver)
- 49. Change "makedepend" for systems with gcc to use "gcc -M" (based on
- code from Hongjiu Lu). This is much slower than the other version,
- and maybe should be disabled by default for !UseInstalled
-
-XFree86 2.0e (18 December 1993)
- 48. SuperProbe updates (details in SuperProbe/ChangeLog)
- 47. Imake updates for NetBSD
- 46. Ramdac multiplexing for Mach32 cards with TLC34075 (and ATI68875?)
- ramdacs (Mike Bernson)
- 45. Imake changes to allow easy building of just the servers with a
- cut-down source tree
- 44. Fix ClearDTR -- now it clears *only* the DTR line
-
-XFree86 2.0d (11 December 1993)
- 43. Xconfig keyboard option: VTSysReq to enable SVR4-style VT switching
- sequence on Linux and *BSD+syscons
- 42. Solaris 2.x x86 support (David Holland, Doug Anson)
- 41. Accelerated dline and dseg for Mach32 (Mike Bernson)
- 40. Accelerated non-cache text code for Mach8 (Hans Nasten)
- 39. VirtualY limit removed for Mach8 (cache can be disabled)
- 38. Dynamic allocation for font cache for Mach8 (Hans Nasten)
- 37. New GetImage for Mach32 (Mike Bernson)
- 36. Support for linear fb on *BSD with mmapable /dev/mem
- 35. Preliminary support for 1152 width on Rev C 801 and Rev E 928, and
- 1600 width on Rev E 928 in S3 server
-
-XFree86 2.0c (3 December 1993)
- 34. Support for 8-bit/gun for Mach32 server (Craig Groeschel)
- 33. New GetImage() for Mach8 and 8514
- 32. Fix error message printed when no appropriate graphics sections are
- present in Xconfig
- 31. Add a "fb_debug" option to the S3 server
- 30. MemBase Xconfig parameter added to allow the fb base address to be
- specified. This is currently used only by some bdm2 drivers
- 29. Support added to bdm2 for Visa board (untested)
- 28. HGC-1280 now supported on both primary and secondary addresses
- 27. Sigma L-View driver tested and works now
- 26. Code from ATI to work around memory probing problems with some Mach32
- chips (untested)
- 25. Workaround for some 2MB DRAM ATI cards (eg, CLX). This allows the
- VideoRam amount specified in Xconfig to override the detected value
- 24. Support for NetBSD/FreeBSD shared libraries (John Brezak & ??)
- 23. Add option "intel_gx" to handle linear fb on Intel GX/Pro (Mach32)
- 22. Composite sync support for Mach8
- 21. Allow linear fb for EISA S3 cards
- 20. Fix s3RecolorCursor() SIGSEGV when VT switched away
-
-XFree86 2.0b (14 November 1993)
- 19. Add virtualY <= 896 check to Mach8 server
- 18. Restore settings for VGA aperture mapping if linear fb access fails for,
- S3. Also restore those registers at exit
- 17. Merge in MIT fix-26 (mainly xterm security patch)
- 16. Fix S3 interlaced modes with VTotal > 1025.
- 15. Hack for 1280x1024 on S3 801 with 110MHz clock
- 14. Composite sync support for Mach32 (Todd Pfaff)
-
-XFree86 2.0a (9 November 1993)
- 13. Speedup for aligned <=16 bit wide stipple ops for Mach8 and 8514
- 12. Fix NULL dereference when ModeDB is empty (Bill Metzenthen)
- 11. make mit/rgb consistent with the server's usage of it. showrgb can now
- read rgb.txt directly, and [sng]dbm is no longer required
- 10. Attempt to clean up strerror() vs sys_errlist[] usage outside ddx/x386
- 9. Disable saving the Tek screen to a file in xterm -- a quick hack to
- get around another security problem. An official X Consortium fix
- should be available soon
- 8. Fix vgaFasm.h so it works for gcc2 with '-traditional'
- 7. Fix clock probing problem in pvga1 driver
- 6. Fix typo in xf86_OSlib.h
- 5. Fix ClockProg informational message
- 4. Truncate clock values to MHz resolution when checking against the limit
- 3. Fix bug in LinkKit Imakefile
- 2. Fix malloc problem in the PEX font reader
- 1. Some documentation fixes
-
-XFree86 2.0 (24 October 1993)
-247. Documentation finalised
-246. Fix for VT switching problem with Mach32 server
-
-XFree86 1.9Za (23 October 1993)
-245. Documentation updates
-244. Fix bug in backing pixmap used for VT switching with the S3 server
-243. Fix typo which prevented nomemaccess being turned of when a localbus
- S3 card is used without linear fb mapping
-
-XFree86 1.9Z (18 October 1993)
-242. Code freeze for 2.0. Docs still not finished
-241. Disable linear fb mapping for BSD/386 since it doesn't appear to work
-240. Fix for dline bug in Mach8 and 8514 servers
-239. Updates to ati SVGA driver
-238. SCO doc updates
-237. Allow "nolinear" Option for Mach32 server
-
-XFree86 1.9Fe (17 October 1993)
-236. Fix S3 cursor problem when panning
-235. Mach32 HW cursor fixes
-234. Include Accel cards db
-233. Fix video mmap problem with *BSD
-
-XFree86 1.9Fd (17 October 1993)
-232. Add undocumented "showcache" Option for the S3 server
-231. Fix ALLOCATE_LOCAL/DEALLOCATE_LOCAL problem in S3 server
-230. Fix multi-screen I/O permission bug on SYSV
-229. SVR3 version of IOPL kernel patch (required for ISC 2.0.2)
-228. Get xload's compiled-in kernel name from <paths.h> for BSD
-227. Fix some compilation-related problems
-226. Sigma Lview driver doesn't work, so removed references to it
-225. DAC_MASK save/restore for 8514 server
-
-XFree86 1.9Fc (16 October 1993)
-224. Stipple and colour mapping fixes for vga16
-223. Fix for Mach8 VT switching problem
-222. Include README.Bsdi
-221. Fix SEGV in s3WarpCursor when VT not active
-220. Don't use kbd_mode for BSDI
-
-XFree86 1.9Fb (13 October 1993)
-219. Mach32 HW cursor colouring fixes (still not quite right)
-218. Change Mach8 clock probing to measure the divided-by-4 values only
-217. Correct fix for problems when some cards are in mono address mode
-216. Fix sync polarity problem with S3 server
-215. Update kbd_mode for syscons
-214. Add "memaccess" option (for S3) so that mem access can be forced on
- for localbus cards when the linear framebuffer can't be mapped
-
-XFree86 1.9Fa (9 October 1993)
-213. 1-pixel segments fix for Mach8
-212. Trap virtual screen sizes which are too large for Mach32
-211. Turn off Mach32 HW cursor if insufficient videoram
-210. Some documentation updates
-209. Move clock limit definitions so that they can be changed when using
- the LinkKit
-208. SuperProbe updates
-207. Fix mis-detection of ATI cards by the compaq driver
-206. Fix hard-coded path in xdpr script
-205. Print max clock before resolving modes
-204. Fix CRTC setting procedure for Mach32
-
-XFree86 1.9F (4 October 1993)
-203. Limit clock to 80MHz for Mach8 and Mach32
-202. Mach32 HW cursor fixes and mach32im cleanup
-201. Cleanup startup messages in Mach8 and Mach32 servers
-200. Disable xterm logging by default, and provide a safer(?) method of
- opening the log file
-
-XFree86 1.9Ed (2 October 1993)
-199. Support for Cirrus 62x5 chips (Prof. Hank Dietz)
-198. Clean up handling of 'volatile', etc for 'gcc -traditional'
-197. Merge Mach8 font cache fix into Mach32
-196. Default to probe for 4 clocks on pvga1 cards
-195. Remove implicit assumption that certain mouse protocols are only used
- by serial devices
-194. Updates/cleanups for bdm2 code
-193. Include SVR3 mmap and SCO dmmap drivers (in x386/etc)
-192. Change location of console.h to machine/ for FreeBSD
-191. Fix setting of AdmDir for *BSD
-190. Update GnuMalloc option. Now it enables use of GNU malloc for clients
- as well as the servers
-189. Patches for Amoeba
-188. Fix for OAK crash with SVGA server
-187. Fix for ATI SVGA restore problem
-186. HW cursor for Mach32 (Mike Bernson)
-185. Option checking in other accel servers
-
-XFree86 1.9Ec (1 October 1993)
-184. Option checking in S3 server
-183. Fix default colour visual handling for accel servers
-182. Add checking of clock limits
-181. Clean up s3Init()
-180. Fix to allow SVR3 shared libs to build when using gas
-
-XFree86 1.9Eb (29 September 1993)
-179. Updates to syscons support (requires lastest console.h -- which is now
- included in ddx/x386/etc)
-178. Fix for colourmap restoration problem with 8514/A cards
-177. Updates to Bt485 code
-
-XFree86 1.9Ea (28 September 1993)
-176. Man page updates
-175. Modify "number9gxe" option to use the Bt485's clock doubling for clocks
- higher than 67.5Mhz
-174. Alternate ICD clock selection code. Enable it with
- 'Clocks "icd2061a_slow"'
-173. site.def cleanup
-172. Fix Bt485 Cursor support
-171. Update syscons support
-170. Fix for S3 font cache server crash problem
-169. Fix for S3 xqueue problems when operating in linear mode
-168. Fix for S3 928 localbus problem
-167. Fix SuperProbe's graphics co-processor detection, and add code to detect
- Bt485 on S3 cards.
-166. Fix text problems in Mach8 and 8514 servers
-165. Image read/write fix for Mach32
-
-XFree86 1.9E (23 September 1993)
-164. Support for the syscons driver on *BSD (S|ren Schmidt)
-163. Get/PutImage speedups for S3
-162. Accelerated image text for non-cached fonts (S3)
-161. Image read/write speedups for Mach32
-
-XFree86 1.9Dc (22 September 1993)
-160. Hooks added for HW cursor support on SVGA cards
-159. Support for ISC 4.0
-158. Accel text functions for non-cached fonts (S3 server)
-157. Fix problems with vga sequencer not being turned off in the right places
-156. Support for dmmap driver for SCO
-155. Oak driver (from Steve Goldman)
-154. Updates for Minix
-
-XFree86 1.9Db (21 September 1993)
-153. Accelerated WD90C31 support (Mike Tierney)
-152. Updates to ImageStipple code for Mach8 and 8514
-151. Fix for memory leak in mi backing store (Amancio Hasty)
-150. Accelerated Cirrus support (Simon Cooper and Bill Reynolds)
-149. Accelerated dline for Mach8 and 8514 (from Tiago Gons)
-148. Fixes for localbus 928
-147. Modify server to use rgb.txt directly and create an internal hash table
- (from Thomas Roell)
-146. SuperProbe updates
-145. Fix cursor recolour problems in S3 server
-144. Use uname/gethostbyname for cases where SIOCGIFCONF fails
-
-XFree86 1.9Da (18 September 1993)
-143. ImageStipple speedup for Mach8 and 8514 (from Hans Nasten)
-142. Reorganise man page installation details for *BSD
-141. Fix various minor bugs
-
-XFree86 1.9D (15 September 1993)
-140. Use non-MAP_FIXED for mmap on Linux -- requires latest kernel
-139. dseg for S3
-
-XFree86 1.9Cf (14 September 1993)
-138. line updates for S3 (including dline)
-137. Support for Thomas Wolfram's mmap driver for SVR3
-136. Config changes to support NetBSD and FreeBSD
-135. Correct fix for SIOCGIFCONF on *BSD (from Mark Davies)
-134. Use Jerry Whelan's BSDselect() for SVR4 in libXt and libXbsd
-133. CopyPlane() for Mach32 server
-132. Include Berkeley str{,n}casecmp() in libXbsd
-131. Sigma LView driver for bdm2 (untested)
-130. OsMouse support for SCO (uses the SCO event driver)
-
-XFree86 1.9Ce (9 September 1993)
-129. Improve reliablilty of mmio code (thanks Thomas)
-128. Fix xdm-related server crash on Linux
-127. Support for 4MB aperture with EISA Mach32 cards
-126. CopyPlane() for 8514 server
-125. Fix "xfig" problem in accel servers
-124. Fix GetImage and PolyText in accel servers
-123. Fix problem with VT-switching and server reset
-122. Fix some more cfb.banked bugs
-
-XFree86 1.9Cd (5 September 1993)
-121. Fast image read/write for 8514 server
-120. Mmio support for 928 in S3 server
-119. Fixes for BT ramdac HW cursor (S3) (still doesn't work)
-118. CopyPlane() fixes for S3
-117. Speedup for PolyPoint() in Mach8 (and others)
-116. Fix for lines in accel servers -- now match cfb lines.
-115. CopyPlane()
-
-XFree86 1.9Cc (2 September 1993)
-114. Fix auto-repeat trapping of lock keys
-113. Support BT485 ramdac's HW cursor (S3 server) (doesn't work yet)
-112. Use mmap for BIOS access on SVR4
-111. Only protect page 0 for SVR4 when the -protect0 flag is given. It makes
- cores less useful
-110. bdm2 (banked dumb mono) fb/driver (from Pascal Haible)
-109. Fast image fill for Mach8 (from Hans Nasten)
-108. Update shared-lib version numbers for Linux
-107. Split bsdi os-support from 386BSD -- little code was common
-106. Modify s3Init() code to use vgaHWInit()
-
-XFree86 1.9Cb (28 August 1993)
-105. Fast image read/write for Mach8 (from Hans Nasten)
-
-XFree86 1.9Ca (28 August 1993)
-104. Default to NoMemAccess for S3 localbus cards on OSs that don't
- support linear videomem mapping
-103. Add QueryBestSize() for S3
-102. Protect page 0 for SVR4 (to help find NULL pointer dereferences)
-101. Fix ChordMiddle
-100. Fix some compilation problems with vga16
- 99. vga16 fix for OpaqueMove bug
- 98. Work around GNU make's "different" default dependency handling.
- Dependencies should now work reliably with GNU make.
- 97. Fast CopyPlane() for S3 server
- 96. Fix I/O port handling to deal with multiple screens
- 95. Mach8 updates
-
-XFree86 1.9C (25 August 1993)
- 94. Updated video mem <-> main mem copy code to get better performance on
- localbus cards
- 93. Alternate fix for xqueue with S3 (previous fix degraded performance too
- much)
-
-XFree86 1.9Be (25 August 1993)
- 92. SIOCGIFCONF fix for ISC in xdm
- 91. Mach support for mapping arbitrary video memory
- 90. Fix for performance problems in S3 server
-
-XFree86 1.9Bd (24 August 1993)
- 89. Updated version of Xconfig/probe info
- 88. Update libXt jump entries for Shm on Linux
- 87. Another S3 cursor update
- 86. Use mmap() for mapping framebuffer on SVR4
- 85. Localbus linear mapping for S3 (tested only on Linux)
-
-XFree86 1.9Bc (23 August 1993)
- 84. SuperProbe update
- 83. Improve picture stability when using high clocks (S3)
- 82. Get memory detection right for S3 911
- 81. Change localbus wait states for S3
- 80. Go back to the MAP_FIXED mmap for Linux, added xf86UnMapVidMem()
- 79. S3 cache updates and cursor changes
-
-XFree86 1.9Bb (21 August 1993)
- 78. Fix S3 server crash if it exits when its VT isn't active
- 77. Indicate where information in server startup messages comes from (ie
- whether from Xconfig or by probing, etc)
- 76. Fix ATI/Mach probing in SuperProbe
- 75. Fix S3 cursor "shadowing" in interlaced modes
- 74. Fix problems with the S3 server when using xqueue
- 73. 16-colour generic VGA server (from Gertjan Akkerman)
-
-XFree86 1.9Ba (18 August 1993)
- 72. Support for a Hitachi Puma Plus digitising tablet's 4-button puck
- (from Randy Terbush)
- 71. Mouse "ChordMiddle" option. This is for a 3-button mouse which
- generates left+right events when the middle button is used. This is
- for Microsoft protocol only (from Ted Goldblatt)
- 70. Reorganise the way SpeedUp options are handled so that the speedup code
- is only linked into the server when the appropriate chipset driver is
- included.
- 69. Fix inb/inw inlines for gcc without gas
- 68. Code to use memory to the right of the screen for caching (S3)
- 67. Various compilation-related fixes
-
-XFree86 1.9B (16 August 1993)
- 66. Fix memory leak on server reset
-
-XFree86 1.9Ai (16 August 1993)
- 65. Fix LinkKit
- 64. Cirrus driver was ignoring clocks when a VideoRam line is specified
- 63. Fix VT switching for Mach8 and ibm8514 servers
- 62. Fix server reset for S3 server
- 61. Fix problems in mach32ImageFill for virtual width != 1024
- 60. Text save/restore added to Mach32 server
-
-XFree86 1.9Ah (15 August 1993)
- 59. Updates to SuperProbe so it can detect the latest S3 chip revisions
- 58. VT switching support for the S3 server
- 57. Fix for S3 image write problems with screen width 1024 & 2MB videoram
-
-XFree86 1.9Ag (14 August 1993)
- 56. Another stipple fill fix in cfb.banked
- 55. S3 clock select fixes -- allows clock probing to work
- 54. Fix initialisation of miCacheFreeSlot
-
-XFree86 1.9Af (13 August 1993)
- 53. Allow programmable clocks to be specified with 'Clocks "prog_clk_type"'
- in Xconfig.
- 52. Virtual size fixes for S3
-
-XFree86 1.9Ae (13 August 1993)
- 51. Extended I/O and IOPL handling for BSDI.
- 50. Set virtual size for S3 if not given.
-
-XFree86 1.9Ad (13 August 1993)
- 49. Imake config updates
- 48. Created libxf86_hw in common_hw, and moved clock probe code there.
- 47. XF86_Mach8 and XF86_8514 compilable.
-
-XFree86 1.9Ac (12 August 1993)
- 46. S3 updates (diff15)
- 45. XF86_Mach32 compilable
-
-XFree86 1.9Ab (11 August 1993)
- 44. XF86_S3 compilable and runnable on Linux
- 43a Cirrus driver updates (including fix for line problem)
- 43. Fix problem in Xlib compose-key code that caused auto-repeat problems
- on some SVR4.
- 42. Keep /dev/console open for pccons on 386BSD to work around keyboard
- hanging problem (from Mark Weaver)
- 41. Fix for zero width horiz, vert lines with rop other than GXcopy, GXxor
- (from Mark Weaver)
-
-XFree86 1.9Aa (6 August 1993)
- 40. Include accel dirs (not compilable yet)
-
-XFree86 1.9A (4 August 1993)
- 39. Fix authorisation for LOCALCONN connections on SYSV.
- 38. OS-lib fixes
-
-XFree86 1.9e (1 August 1993)
- 37. Make the ET4000 Option "force_bits" standard behaviour
- 36. Fix problem of renderer config not being handled properly in the LinkKit
- 35. Update screen configuration handling to better suit multiple servers.
-
-XFree86 1.9d (29 July 1993)
- 34. Mach OS-lib fixes
-
-XFree86 1.9c (28 July 1993)
- 33. Lots of SCO patches (including fixing the bogus window problem, xterm,
- font server, PEX)
- 32. SuperProbe updates (includes identification of AT&T RAMDACs and
- detection of 8514/A and ATI Mach-xx chipsets)
- 31. Fix for bug in cfbgetsp.c
- 30. Include pixmap cache support in mi, mfb, cfb.
- 29. SVR3/ISC updates for gcc 2.4.5
- 28. Moved OS-specific parts of x386Io.c to the OS-lib
- 27. OS-lib fixes.
- 26. Converted the experimental ET4000 RCCONF code to an Option flag:
- "fast_dram"
- 25. Fix SIOCGIFCONF related problems in xdm, chooser and server/os/access.c
- on SVR4 and 386BSD (thanks to Ian Donaldson and Peter Wemm).
- 24. Support for easily adding multiple servers to server/Imakefile and
- the LinkKit
-
-XFree86 1.9b (13 July 1993)
- 23. Fix for interlaced support in the Cirrus driver
- 22. OS-library added to separate out OS-specifics under ddx/x386
- 21. Fix initialisation of supported pixmap formats
- 20. Fix for authorisation on streams connections for SVR3
- 19. Fix other line bugs (fLineH.s, suLine.s, suVHLine.s)
- 18. Really make the horizontal panning symmetric
- 17. Fix 2MB support on Cirrus 5426
- 16. Fix line bug in non-speedup code (fLineBres.s)
-
-XFree86 1.9a (3 July 1993)
- 15. Added support for BSDI's BSD/386 (from Hans Nasten)
- 14. SuperProbe updates for C&T chipsets
- 13. Make horizontal panning symmetric
- 12. Allow Cirrus driver to address 2MB on the 5426 cards (not tested)
- 11. Add ChipRounding to the vga ChipRec so that chip-specific rounding of
- virtualX can be handled properly
- 10. OSF/1 patches (Marc Evans)
- 9. Fix for xload problem on Linux
- 8. Fix for ATI text-mode font restore problem
- 7. Experimental code to set the RCCONF register on ET4000 cards (this is
- only used if Et4000SetRCConf is set to YES in site.def)
- 6. Allow "black" and "white" colours to be specified in Xconfig for the mono
- vga server
- 5. Fix Xconfig visual spec check for mono servers
- 4. Fixed some long file names (in extensions/lib/PEXlib, fonts/bdf/misc)
- 3. Fix xman bug introduced in 1.2Da
- 2. Fix bank-switching bug in cfbfillsp.c
- 1. Fix a couple problems that show up when using a XFree86 patched source
- tree on non-i386 systems
-
-XFree86 1.3 (5 June 1993)
-98. Updates to ncr driver
-97. NCR imake config changes
-96. Docs updated for gzip extension change ".z" -> ".gz"
-95. Experimental "force_bits" option flag for ET4000
-
-XFree86 1.2Da (2 June 1993)
-94. Modify xman to use groff instead of nroff for Linux
-93. Modify xload to use /proc/loadavg for Linux
-92. Change ownership of /dev/console and /dev/tty0 for Linux
-91. Added xmodmap.std to the etc dir which lists the default key map in a form
- that can be read by xmodmap(1)
-90. Various small SVR3 adjustments, and new README.SVR3
-89. Add a README for the LinkKit
-88. Support for banked mono in ET3000 driver (thanks to Joerg Wunsch)
-87. ET3000 probe changes
-86. README.Linux updates
-
-XFree86 1.2D (26 May 1993)
-85. Merge in MIT fix-25
-84. OSF/1 support is incomplete -- so remove references to it in the docs
-83. Add -keeptty flag to prevent server from detaching its controlling tty
- (useful when debugging)
-82. Include support for 77C22E in ncr driver
-81. Set bank 0 for save/restore in trident driver [removed]
-80. Workaround for mouse loss when VT switching on SCO
-79. Compile-time support for SCO 3.2.4
-78. Don't include PEX in mono server (even when BuildPex is set) because it
- only works for 8-bit PseudoColour
-77. Mach support for SuperProbe
-76. Various SVR3 shared lib fixes including fixes for AT&T SVR3.2, XDM auth
- support and fixes for initialisation problems that showed up with Motif.
-75. Ignore SIGHUP in xterm for ISC 2.2.1, 3.0
-74. rgb/Imakefile fix
-73. Imake.tmpl updates for ISC
-
-XFree86 1.2Cb (19 May 1993)
-72. Code to slow down DAC access
-71. Possible fix for font restore bug on Linux and 386BSD (works for some
- people, but not everyone)
-70. Merge in MIT fix-24
-69. Xosdefs.h mod for Mach
-68. Eliminate various compiler warnings with PEX
-67. Modify lndir to ignore directories called "CVS"
-66. Fix overscan restore problem when mode switching
-65. Fix a Cirrus-specific font/text restore problem
-
-XFree86 1.2Ca (16 May 1993)
-64. Fix for lndir to work with Linux (Gnu ls)
-63. Documentation updates
-62. Allow PEX to be turned on/off at link-time with the LinkKit
-61. Add "hibit_high" and "hibit_low" Option flags to handle some ET4000
- cards when the server is started from a high-res text mode
-60. Fix screen corruption when mode-resolving fails (problem was introduced
- in 1.2Bb)
-59. Fix to pvga1 driver for 90C11
-58. kbd_mode modified to be a no-op for codrv
-57. Imake.tmpl updates for SCO and OSF/1
-56. Remove need for <sys/ioctl_pc.h> with LinkKit on 386BSD
-
-XFree86 1.2C (8 May 1993)
-55. Modify Cirrus driver to set the reported clocks to the preset values
- rather than probing them. Probing can be forced with the "Probe_Clocks"
- Option flag.
-
-XFree86 1.2Bb (6 May 1993)
-54. Compatibility support for codrv 0.1.1 (run-time only)
-53. Merge in OSF/1 support (from Marc Evans)
-52. Merge in SCO support (from David McCullough)
-
-XFree86 1.2Ba (4 May 1993)
-51. SuperProbe updates (can now be compiled with a K&R compiler)
-50. Compaq driver (from Hans Oey)
-49. Merge codrv and pccons support so that a single server can support
- both
-48. Cirrus driver for CLGD542x cards (no accelerated support) (from Bill
- Reynolds)
-47. Allow inline'd macros to be disabled for debugging purposes (by compiling
- the video drivers with -DNO_INLINE)
-46. Print OS version in startup message
-
-XFree86 1.2B (19 April 1993)
-45. ET4000 text clock restoration modified -- maybe it will fix the problems
- when restoring to a high res text mode
-44. Sample SVGA driver stubs and documentation added
-43. Xconfig option to specify VGA BIOS base address (not all are at 0xC0000)
-42. Major rewrite of tvga driver. Now supports 8800CS, 8900B, 8900C, 8900CL,
- 9000 in all modes.
-41. Xconfig option to clear DTR after opening MouseSystems mouse (only for
- SYSV, Linux, 386BSD)
-40. Change server names. X386 -> XF86_SVGA, X386mono -> XF86_Mono.
-
-XFree86 1.2Aa (17 April 1993)
-39. SuperProbe will now find vga BIOS at addresses other than 0xC0000
-38. Support for building Linux shared libs (DLL version)
-37. Remove case-sensitivity of the Chipset option.
-36. Save and restore registers affected by clock probing
-35. Some more Xconfig validity checks
-34. Change 'Vendor' keyword in Xconfig to 'Option'
-33. Fix to make use of the RGBPath specified in Xconfig (this was pointed out
- by Greg Hartman back in Sept)
-32. Use XWINHOME to specify ProjectRoot at run-time
-31. PEX patches for Linux
-30. libX11 shared lib problem fixed (for SVR4)
-
-XFree86 1.2A (3 April 1993)
-29. More pvga1/wd driver tuning, added rudimentary support for 90c20
-28. Improve overscan handling
-27. modeDB.txt updates
-
-XFree86 1.2e (27 March 1993)
-26. Minix/Amoeba updates
-25. New et3000 probe (to prevent tvga8900CL being falsly detected as et3000)
-24. More interlace tuning for pvga1 and tvga8900 drivers
-23. SuperProbe
-22. XDMCP fixes for Linux (and others)
-
-XFree86 1.2d (24 March 1993)
-21. Added support for Minix-386 and Amoeba (from Kees Verstoep)
-
-XFree86 1.2c (20 March 1993)
-20. Merged in MIT fix-23
-19. Support for 9th clock on WD90Cxx chips
-18. NCR 77C22 driver (from Stuart Anderson)
-17. Allow multiple Clocks lines in Xconfig
-16. Changes to external clock program code to handle VT switching better
-15. ISC 2.0.2 support (from Aki Atoji)
-14. Include driver source instead of objects in LinkKit
-
-XFree86 1.2b (1 March 1993)
-13. Improved ISC support for xman
-12. Improved handling of overscan colour
-11. Make the server's -pn option the default (compile time configurable)
-10. Hga2 support for 386BSD and Mach
-9. pvga1 driver support for WD90C3x
-8. Portable assembler macros (from Greg Sharp)
-7. More flexible handling of Vendor strings in Xconfig
-6. Store clock resolutions to nearest 1kHz.
-5. Removed old SpeedUp version
-4. Changes in LinkKit to handle distributions built with PEX support
-
-XFree86 1.2a (20 February 1993)
-3. Xlib support for run-time selectable multiple LOCAL connection types
- for SVR3, SVR4
-2. Fix mapping problem when using codrv and a non-US keyboard mapping
-1. Fix for TVGA interlaced modes
-
-
-XFree86 1.2 (8 February 1993)
-74. README updates
-73. ATI driver updates
-72. Banked mono doesn't work on ET3000 -- so turned off for that driver
-71. Merged in MIT fix-22
-70. Changes so that XFree86 patched source will build on other platforms.
-
-XFree86 1.1F (1 February 1993)
-69. Add check for presence of "Modes" line in Xconfig
-68. Add assembler code for byte-order swapping in mfb
-67. More svr3 shlib "tuning"
-
-XFree86 1.1E (26 January 1993)
-66. Change to pvga1 driver to get correct clock ordering for 90C30
-65. Fix linux problem building liboldX
-64. server locking to prevent clobbering of local connection pipes
-63. xhost fix for LOCALCONN
-62. Add missing svr3 shlib patches
-
-XFree86 1.1D (24 January 1993)
-61. Removed SVR3 shlib stubs from clients
-
-XFree86 1.1Ce (23 January 1993)
-60. SVR3 shared lib support (from Thomas Wolfram)
-59. Added Hercules driver (from Davor Matic)
-58. Re-map scancodes for Codrv so that the keycodes the server sees are the
- same on all platforms
-57. Modify NumPad handling so that Shift works properly.
-
-XFree86 1.1Cd (13 January 1993)
-56. Commented out force VT disabling -- causes problems with Esix 4.0.3A
-55. Support for tvga9000 (from Gertjan Akkerman)
-54. Ignore FontPath in Xconfig when a FontPath is provided with the -fp option
-53. Support for new Linux VTs
-52. Turn off Alt-Sysreq-F (forced VT switch) by default for SYSV. Added an
- Xconfig option to prevent this disabling (AllowForceVT)
-51. X386keybd man page added
-50. mfb.banked fixes
-
-XFree86 1.1Cc (3 January 1993)
-49. tvga driver updates for banked mono
-48. Fixes to cfbblt, mfbblt for single-banked drivers
-
-XFree86 1.1Cb (1 January 1993)
-47. Added -verbose (default) and -quiet flags, and print out more information
- in verbose mode
-46. Improved banking for mfb.banked
-
-XFree86 1.1Ca (30 December 1992)
-45. cmfb code (from Davor Matic), and an experimental mfb.banked
-44. Flush mouse input after opening
-43. Fix problem starting X from within an X session
-
-XFree86 1.1C (23 December 1992)
-42. Added -probeonly option which causes the server to exit after the
- device probe stage.
-41. Merged in MIT fix-21
-40. Support for an external clock setting program
-39. Patches for Destiny (SVR4.2)
-
-XFree86 1.1Ba (17 December 1992)
-38. Merged in MIT fix-20
-37. Various improved error messages
-36. Improve accuracy of clock probing code -- add delay so VCO can
- stabilise before starting the measurement
-35. Store dot-clocks to .1MHz accuracy
-34. Make the server's -dpi option work
-33. Extend fontpath validation to the compiled-in default fontpath
-32. Increase server priority while probing for clocks
-31. Fixed KDSETRAD bug introduced in 1.1a (affected DELL)
-30. Bell support for pccons driver on 386BSD
-
-XFree86 1.1B (21 November 1992)
-29. Hack for ISC local connection on SVR4 with ACP (requires the ISC
- client binary to be edited)
-28. Added code to change IOPL on SYSV for extended I/O (including patch
- scripts for the SVR4 kernel)
-27. Merged in MIT fix-18 and fix-19
-26. Support for PS/2 mouse
-
-XFree86 1.1A (16 November 1992)
-25. Fix problems compiling with a non-ansi compiler.
-
-XFree86 1.1c (8 November 1992)
-24. Xconfig options to set default mapping of some special keys
-23. Code to validate the fontpath given in Xconfig
-22. Patches for Logitech Trackman/Mouseman (from Christian Ziemann)
-21. Updates for version 0.1.1 of Holger's co driver
-20. Fix for et3000 text mode restoration (from Holger Veit)
-19. Fix NumLock support -- use two sets of keycodes for num keypad
-18. Add Compose / Multi-key support to Xlib (from MIT contrib)
-17. Don't reset state of lock keys when starting the server
-16. Fix code for setting visual type from Xconfig
-
-XFree86 1.1b (21 October 1992)
-15. Xload support for Linux
-14. Use Xconfig.cpp to generate the sample Xconfig with paths consistent with
- the configuration.
-13. Allow multiple "FontPath" lines in Xconfig which are concatenated to build
- the FontPath.
-12. Blank and clear the screen during server startup
-11. Fix tegblt code for mono server (instead of the previous workaround)
-10. Fix non-32bit tiles and stipples for mono server with 8-bit scanlines
-9. Fix circle/ellipse drawing for mono server
-8. Use 8-bit bitmap scanlines for mono server (can now remove pixmap hack)
-7. Add check in server to see if euid==0. If not, exit with a warning.
-
-XFree86 1.1a (11 October 1992)
-6. Add a VTInit option to Xconfig to run a program on the VT during
- screen initialisation.
-5. Fix security holes in reading Xconfig files, and the undocumented
- -mono and -colour options.
-4. Use KDMKTONE for bell for systems that support it
-3. Allow 4 clocks for generic driver
-2. Mods to allow compile time selection of 128k display mapping for mono
- (this is experimental and may be removed)
-1. Holger's 386BSD co driver support (compile-time selectable)
-
-
-XFree86 1.1 (1 October 1992)
-70. Public release
-69. Set mailbox for 386bsd in Xaw
-
-XFree86 1.0Zb (30 September 1992)
-68. Mods to startx so that an absolute path is not required for a server
-67. Make the right-hand <ALt> key behave like Alt_R
-66. Updates to X386.man
-65. Add -mono and -colour (undocumented) options to server
-64. Look for Xconfig file in /etc before /usr/X386/lib/X11
-63. Print out Trident version in probe routine and add README.trident
-
-XFree86 1.0Za (27 September 1992)
-62. cfb.banked changes for Mach's BSD cpp.
-61. Add mkwhatis script for 386BSD
-60. Fix problems with xgc/lex.l
-59. Modify default keymap so Alt_L will work like both Meta_L and Alt_L.
-58. xload fixes for 386BSD
-57. Change config/x386config.sh for dumb BSD sh.
-
-XFree86 1.0Z (24 September 1992)
-56. Beta release (final for 1.1)
-55. Add ISC22, ISC30 defines
-
-XFree86 1.0Yb (21 September 1992)
-54. Included Thomas Eberhardt's updates to the compressed font code.
-53. Put Alan Hourihane's generic save/restore code into vgaHW.c
-52. Correction to xmh man page
-51. Support use of libdbm.a for ISC 3.0
-
-XFree86 1.0Ya (17 September 1992)
-50. Merge in Linux support (from Orest Zborowski)
-
-XFree86 1.0Y (14 September 1992)
-49. Beta release (second for 1.1)
-48. Removed FAS support on SVR4
-47. Changes to font and text save/restore
-
-XFree86 1.0Xc (12 September 1992)
-46. Fix xman scroll bug
-45. Update to ati driver to save more planes
-44. Single/double bank selection for drivers
-
-XFree86 1.0Xb (9 September 1992)
-43. Link Kit updates
-
-XFree86 1.0Xa (8 September 1992)
-42. Fix some Xconfig related problems
-41. Trident driver (256 colour and mono)
-40. Mono drivers for et3000, pvga1, gvga (untested)
-
-XFree86 1.0X (4 September 1992)
-39. Beta release
-38. Minor updates
-
-XFree86 1.0m (2 September 1992)
-37. Change name to XFree86
-36. Added link kit
-
-X386 1.2E 1.0l (30 August 1992)
-35. Added (experimental) ATI driver
-34. Changed configuration so that mono and colour servers can be built
- at the same time.
-X386 1.2E 1.0k (30 August 1992)
-33. Directory re-organisation
-
-X386 1.2E 1.0j (29 August 1992)
-32. Fix problem of server crashing while resetting
-
-X386 1.2E 1.0i (28 August 1992)
-31. Portability changes to vgaFasm.h (for cc and gcc-1.??)
-30. Added a -xconfig flag to specifiy the Xconfig file from the command line.
-29. Fixed problem with xdmauth accessing memory between 640k and 1M.
-28. Round down the specified virtual width to the nearest required multiple.
-27. Fix some bugs in the Xconfig parser.
-26. Added 'vga2' keyword for Xconfig so one file can be used for both the
- colour and mono servers.
-25. README's updated
-24. Minor speedup fix
-23. More server configuration changes
-
-X386 1.2E 1.0h (26 August 1992)
-22. cfb.banked updated for fix-17
-21. New SpeedUp code (works for any* virtual width)
-20. Monochrome VGA server
-19. Changes for compile-time selection of supported chipsets, and font
- renderers
-18. Updated X386.man, README.Mach
-17. Fix mouse map bug for logitech (and microsoft?).
-16. Merge in changes for Mach386 (from Robert Baron, Joel Jacobson)
-15. Merge in changes for 386BSD (from Rich Murphey, Amancio Hasty)
-
-X386 1.2E 1.0g (25 August 1992)
-14. Merged in MIT fix-17
-
-X386 1.2E 1.0f (4 August 1992)
-13. SpeedUp flag for Rectangle Stipple fills
-
-X386 1.2E 1.0e (4 August 1992)
-12. Extend the trapping of unexpected fatal signals beyond just SIGSEGV.
- The NoTrapSegV option has been changed to NoTrapSignals.
-
-X386 1.2E 1.0d (3 August 1992)
-11. Run mkfontdir in install directory rather than copying fonts.dir from
- the build directory.
-10. Merged in MIT fix-16
-
-X386 1.2E 1.0c (1 August 1992)
-9. Run 'mcs -d' on SVR4 shared libraries
-8. Merged in official Type1 font patch
-7. Merged in MIT fix-15
-6. Fixed malloc/free problems in lib/X/XcmsLRGB.c, clients/xdm/greet.c
-5. Merged in MIT fix-14
-
-X386 1.2E 1.0b (27 July 1992)
-4. Updated version of fFill.s
-3. Bug fixes (for stipple) from Jim (require GCC at the moment)
-
-X386 1.2E 1.0a (22 July 1992)
-2. Merged in MIT fix-13
-1. Fix problem with divide by zero when bell pitch was set to zero.
-
-
-X386 1.2E 1.0 (16 July 1992)
-97. First general release
-96. Define repz to be repe for gas.
-95. Update XdmConf.svr4 to read /etc/default/login to set ulimit, etc.
-
-X386 1.2E 0.2c (15 July 1992)
-94. Allow easy selection of ansi level when building non-core clients.
-93. Install and use sessreg (for xdm)
-92. .align changes for gas
-91. README and X386.man updates
-
-X386 1.2E 0.2b (11 July 1992)
-90. Mods to SpeedUp for gas (jcxz changes).
-89. Minor change to xdm/auth.c for ISC3.0
-88. Removed SVR4 Vendor defines.
-
-X386 1.2E 0.2a (8 July 1992)
-87. Added some missing cld's to gBitBlt.s
-86. Some portability changes to fFill.s
-85. VT release problem when using FAS/SVR4 really fixed this time.
-84. Moved libinetemul.a to lib/InetEmul; library now called libXinetem.a, and
- used in a similar way as libXbsd.a. Changes to top level Imakefile have
- been removed.
-83. Updates to README (building under ISC2.2, compiling clients)
-82. Include libXbsd.a in ExtraLibraries for SVR4/SYSV
-
-X386 1.2E 0.2 (3 July 1992)
-81. Second beta version
-80. et debug option removed
-
-X386 1.2E 0.1i (2 July 1992)
-79. Fixed VT release problem when using FAS/SVR4.
-78. Added warning about using xdmauth.
-77. Updated XdmConf.svr4 to handle different auth types
-76. Reorganisation of some compiler and assembler related options in x386.cf
-
-X386 1.2E 0.1h (27 June 1992)
-75. More portability changes to assembler code.
-74. Updates to modeDB, XdmConf.svr4
-
-X386 1.2E 0.1g (25 June 1992)
-73. Assembler portability changes from Jon Block.
-72. Change startup message from 'X Windows System' to 'X Window System'
-
-X386 1.2E 0.1f (20 June 1992)
-71. Fixed line problem when compiling with SVR4 'cc'.
-70. Changes to make source compile with Esix 3.2D, ISC 3.0 (without TCPCONN)
-
-X386 1.2E 0.1e (17 June 1992)
-69. Removed Glenn's wrapper comments from cfb.banked files.
-68. Added a debug flag to check operation of hiclock selection, and hopefully
- fixed the problem with that.
-67. Fixed PIC flag problem in sv4Lib.rules
-
-X386 1.2E 0.1d (13 June 1992)
-66. Xconfig is installed as Xconfig.sample so as not to overwrite a locally
- configured one.
-65. Use HasSdbm to determine use of -lsdbm for server and rgb.
-64. Made SpeedUp the default when appropriate, and added 'SpeedUp "none"' and
- 'NoSpeedUp' options.
-63. Updates to README, X386.man, modeDB.txt.
-62. Added a shar file with sample configuration files for xdm.
-61. Another setpgrp() change in xdm.
-60. Added command line option to specify which VT the server runs on.
-59. Changed default pointer map to the correct 1:1 map.
-58. Fixed bug in merge of SPEEDUP_TEGBLT8 which caused problems when that
- option was not selected.
-
-X386 1.2E 0.1c (7 June 1992)
-57. Remove some setpgrp() calls in xdm. This allows xdm to work with
- xqueue on Microport, Dell, AT&T versions.
-56. Default for server to open SCO Xsight connection for SVR4. SVR4.0.4
- supports this as part of its "Advanced Compatibility Package". The
- code doesn't appear to cause problems with versions of SVR4 without this
- (the feature just can't be used on them).
-
-X386 1.2E 0.1b (3 June 1992)
-55. Fixed bug in SPEEDUP_TEGBLT8 selection in vga.c
-54. Glenn's new cfbteblt8.c
-
-X386 1.2E 0.1a (30 May 1992)
-53. Fixed problem when switching VT away too quickly after switching back.
-52. Added Vendor defines for ISC SVR4 (ISC4), AT&T SVR4 (ATT4)
-
-X386 1.2E 0.1 (29 May 1992)
-51. First beta version
-
-X386 1.2E 0.0n (28 May 1992)
-50. Added README.X386-1.2E
-49. Introductory info added to modeDB.
-48. A few missed RCS Header lines.
-
-X386 1.2E 0.0m (26 May 1992)
-47. Added options to control building 75dpi, 100dpi, and large misc fonts.
-46. More updates to modeDB.
-45. Assembly changes for more pedantic 4.0.4 assembler.
-44. Moved site-specific defines from x386.cf to site.def
-43. Define usleep as the nap syscall for all SVR4 to avoid using libucb.a
-
-X386 1.2E 0.0l (23 May 1992)
-42. Added BuildType1 option
-41. Fixed ManDir and LibmanDir in site.def
-40. Added RCS Header lines to modified files
-
-X386 1.2E 0.0k (23 May 1992)
-39. Moved Glenn's and Jim's assembler routines into ddx/x386/enhanced
-38. Local connection added to X386.man
-37. Jim's update to cfbtileodd.c
-
-X386 1.2E 0.0j (21 May 1992)
-36. Updates to ModeDB.txt
-35. New fLineH.s from Jim
-34. New gLine.s from Glenn
-
-X386 1.2E 0.0i (19 May 1992)
-33. Fixed problem with setting mouse acceleration
-32. Prettied up startup message
-
-X386 1.2E 0.0h (16 May 1992)
-31. Removed SPEEDUP_TEGBLT8 from SPEEDUP_ALL -- it causes problems for some
- font rendering (characters coming out as solid filled blocks).
-30. Added Thomas Eberhardt's compressed bitmap font patches
-
-X386 1.2E 0.0g (15 May 1992)
-29. #undef'd SO_DONTLINGER in os/connection.c for SVR4 -- it is not properly
- defined for SVR4, and it removes the familiar startup error message.
-28. Changed SPEEDUP_VHLINE to SPEEDUP_LINE since it's not just for V, H lines
-27. Included Glenn's gLine.s
-26. Modified auto-detect HiClock code to use Thomas' method of making 16
- clocks available with ET4000. HiClock option has been removed since
- this change makes it obsolete. X386.man and Xconfig have been updated
- accordingly.
-25. Fix problem switching after SIGHUP is sent while VT switched away.
-24. Take x386Resetting out of os/utils.c and put it in x386Init.c
-23. Turn on screen saver before copying screen to pixmap when switching away
-22. Fixed typo in vga.c related to SPEEDUP_TEGBLT8
-
-X386 1.2E 0.0f (14 May 1992)
-21. Removed special handling of SIGSEGV when server is exiting.
-20. Take care of server exiting and resetting when VT is switched away.
-19. Copy screen to dummy pixmap when switching away, and copy it back when
- switching back. (The contents were of the dummy pixmap were previously
- ignored.) Masking window is no longer used.
-
-X386 1.2E 0.0e (13 May 1992)
-18. Add missing argument in call of GlennsFillBoxSolid -- hopefully fixes
- SIGSEGV problem.
-17. Added x386Version.h, CHANGELOG
-16. Added a couple of #undef's in cfbhrzvert.c
-15. Fold in public-patch-9 for cfb/cfbbresd.c into cfb.banked/cfbbresd.c
-14. casting for VGABASE in cfbbitblt.c
-13. #include fix in connection.c
-12. Disable building of FontServer in site.def
-
-X386 1.2E 0.0d (12 May 1992)
-11. Changes to gFillCopy.s, gVHLine.s to improve hseg100 performance.
-10. Change the way GCOps are initialised when SpeedUp is selected
-9. Add SpeedUp to cfbteblt8.c that assumes xdim=1024
-
-X386 1.2E 0.0c (10 May 1992)
-8. Allow SpeedUp Xconfig option to individually select various speedups
-
-X386 1.2E 0.0b (10 May 1992)
-7. Autodetect for HiClock option (not tested yet)
-6. Fix for cfbblt not setting read on dst for GC ops that require it
-5. Minor change in X386.man
-
-X386 1.2E 0.0a (09 May 1992)
-4. Reset screen saver timer for ForceScreenSaver(Reset)
-3. Reset screen saver when switching back
-2. Raise masking window when switching back so all windows get expose events
-1. Use dummy buffer for screen writes when VT is switched away
-
-X386 1.2E 0.0 (07 May 1992)
diff --git a/hw/xfree86/doc/devel/DebuggingHints b/hw/xfree86/doc/devel/DebuggingHints
deleted file mode 100644
index 300fe4813..000000000
--- a/hw/xfree86/doc/devel/DebuggingHints
+++ /dev/null
@@ -1,192 +0,0 @@
-
- Xserver Debugging
- =================
-
-This file is intended to collect helpful hints on Xserver debugging.
-I merely outline my experiences here. Somebody else might have better
-methods on doing it. This person is therefore invited to share this
-experience with the rest of the world by adding it here.
-
-Paul Flinders has made some patches to gdb to add support for loadable
-modules. This version of gdb is currently available as binary for
-Linux/x86 on Paul's web site:
-
- www.dawa.demon.co.uk/xfree-gdb
-
-This web-site also contains the patches to gdb 4.18 so you may port it
-to other platforms.
-
-It loads the module symbols and supports all gdb features like
-breakpointing, disassembling and single stepping. It also shows the
-exact location of a signal 11. Paul has fixed the code so that all of
-this is working even if using modules compiled without -g. You can
-find his latest version on his web site.
-
-If no module aware gdb is available the following hints might help:
-
-1. Use remote login. This can be done thru a network connection or
- simply by connecting a serial console. This enables you to watch
- the Xservers output while running set breakpoints with gdb etc.
- Don't even try to run the Xserver from a system console. Whenever
- something happens gdb waits for input. However the Xserver has
- locked the system console including the keyboard, therefore you'll
- never be able to send any input to gdb. Even if your process
- doesn't crash or you haven't set any breakpoints a vt switch can be
- hazardous: When doing vt switching a signal is sent; unless you did
-
- gdb> handle SIGUSR1 nostop
-
- gdb waits for you to continue the program which cannot happen as
- you don't have access to gdb's console.
-
-2. You can compile any source file with debugging symbols to obtain
- more information about where an error occurred. Simply go to the
- directory which holds the corresponding object file and do:
-
- # rm <file>.o
- # xc/config/util/makeg.sh <file>.o
-
- After relinking the server or module gdb is able to obtain the
- necessary debugging information and will show the exact line in the
- source where the error ccurred. See also:
- xc/config/util/makeg.man.
-
-3. In some cases it might be useful to have the assembler output of a
- compiled source file. This can be obtained by doing:
-
- # make <file>.s
-
- or
-
- # xc/config/util/makeg.sh <file>.s
-
- Make will use exactly the same rules it uses for building *.o files.
-
-4. In some cases it might be useful to set breakpoints in modules. If
- no module aware gdb is available you should add a call to one of
- the three dummy breakpoint functions
-
- xf86Break1(), xf86Break2() and xf86Break3()
-
- to the source file and recompile the module. You now just have to
- set a breakpoint onto the appropriate dummy functions. These
- functions are located in the core part of the server and therefore
- will be available any time.
-
-5. Without module support gdb is not able to print the function where
- an error occurred in a module.
-
- If you get a line like:
-
- (gdb) bt
- #0 0x823b4f5 in ?? ()
- ....
-
- You may obtain the function the address belongs to by calling
- LoaderPrintSymbol():
-
- (gdb) call LoaderPrintSymbol(0x823b4f5)
-
- The symbol returned might not always be the name of the function
- which contains the address. In case of static functions the symbol
- is not known to the loader. However LoaderPrintSymbol() will print
- the nearest known function and the offset from its start. You may
- easily find the exact location of the address if you do:
-
- # objdump --disassemble <file>.o
-
- <file>.o is the name of the object file containing the symbol printed.
-
-6. Locating static symbols in modules is simpler if the module is a
- single object file instead of a library. Such a object file can
- easily be build from a library: # mkdir tmp # cd tmp; ar x
- module-path/<libname>.a # ld -r *.o -o module-path/<name>.o
-
- When calling LoaderPrintSymbol() the closes public symbol will be
- printed together with the offset from the symbol's address. If a
- static symbol comes before the first public symbol in a module The
- following trick may help:
-
- create a file 1-<name>.c in tmp/
- containing:
- void Dummy-<name>() {}
-
- Compile it:
-
- # gcc -c 1-<name>.c
-
- and do the link step above.
-
- This way Dummy-<name>() will be the first public function in the
- module. All addresses in static function can now be printed
- relatively to this address if no other public function comes before
- this static one.
-
-7. In some situations it is quite helpful to add debugging symbols to
- the binary. This can be done per object file. Simply remove the
- object file and do
-
- # makeg
-
- When looking for a bug in a module these debugging infos can be
- very helpful: Calling LoaderPrintSymbol() as described above will
- return a function and an offset giving the exact location of the
- address with respect to this function entry point. When
- disassembling an object file with debugging symbols: # objdump -d
- -l <file>.o one will receive a disassembled output containing line
- number information. Thus one can locate the exact line of code
- where the error occurred.
-
-8. To quickly trace the value of a variable declared in a module three
- dummy variables have been added to the core part:
-
- CARD32 xf86DummyVar1;
- CARD32 xf86DummyVar2;
- CARD32 xf86DummyVar3;
-
- The variable can be assigned to one of them. One can then use gdb
- to return the value of this variable:
-
- gdb> p /x xf86DummyVar1
-
-9. Sometimes it might be useful to check how the preprocessor replaced
- symbols. One can obtain a preprocessed version of the source file
- by doing:
-
- make <filename>.i
-
- This will generate a preprocessed source in <filename>.i.
-
-10. xfree() can catch if one tries to free a memory range twice. You
- will get the message:
-
- Xalloc error: range already freed in Xrealloc() :-(
-
- To find the location from which xfree() was called one can
- breakpoint on XfreeTrap(). The backtrace should show the origin of the
- call this call.
-
-11. To access mapped physical memory the following functions might be
- useful.
-
- These may be used to access physical memory that was mapped using
- the flags VIDMEM_FRAMEBUFFER or VIDMEM_MMIO32:
-
- CARD8 xf86PeekFb8(CARD8 *p);
- CARD16 xf86PeekFb16(CARD16 *p);
- CARD32 xf86PeekFb32(CARD32 *p);
- void xf86PokeFb8(CARD8 *p, CARD8 v);
- void xf86PokeFb16(CARD16 *p, CARD16 v);
- void xf86PokeFb32(CARD16 *p, CARD32 v);
-
- Physical memory which was mapped by setting VIDMEM_MMIO should be
- accessed using the following. Here the base address to which the
- memory is mapped and the offset are required separately.
-
- CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
- CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
- CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
- void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
- void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
- void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
-
diff --git a/hw/xfree86/doc/devel/Domain.note b/hw/xfree86/doc/devel/Domain.note
deleted file mode 100644
index 3db2aefae..000000000
--- a/hw/xfree86/doc/devel/Domain.note
+++ /dev/null
@@ -1,159 +0,0 @@
-The purpose of the changes described here is to implement a more general
-framework for multi-head on systems with more than one host-to-PCI bridge.
-The changes also implement a basic port of XFree86 to SPARC Solaris.
-
-These changes are derived from David S. Miller's submission #4653 to the
-patch list. David Andrew of Sun Microsystems was also kind enough to
-arrange for a hardware loan for development of these changes.
-
-These changes are known to work on several SPARC SunOS and UltraSPARC
-Linux configurations. Linux kernel work is in progress to port these
-changes to Linux/PowerPC.
-
-Several loose ends still need to be addressed before these changes can be
-considered stable. The bulk of this note is devoted to enumerating what
-remains to be done, along with other notes, broken down into various broad
-categories.
-
-SPARC SunOS (aka Solaris)
--------------------------
-- An overview of this XFree86 port is available in README.Solaris.
-- The keyboard map code in hw/xfree86/os-support/sunos/sun_kbdEv.c needs
- to be extended to handle more than only the sun5 keyboard I targeted it
- for. Even for the sun5, the map is incomplete as several keys are not
- mapped. What is there is just barely usable.
-- On exit, the server will zero out /dev/fb, but that might not be the
- right thing to do for all primary adapters. This does however
- appear to emulate the behaviour of Sun's commercial servers. It also
- eliminates the need for output drivers to save and restore video memory
- contents. (They still need to save/restore the mode timing however.)
- This also chimes into a long-standing XFree86 policy to not save/restore
- video memory contents if the mode on entry is found to be non-VGA, a
- policy several existing drivers comply with.
-- The SBUS drivers (sunbw2, suncg14, suncg3, suncg6, sunffb, sunleo and
- suntcx), the common layer's SBUS code and the fbdev driver have all
- only been compile tested. There are likely to be Linux'isms within
- them that remain to be dealt with.
-- It still needs to be verified whether or not this work adversely
- affected support for ix86 Solaris.
-
-UltraSPARC Linux
-----------------
-- Although this code can be compiled using any Linux/SPARC64 kernel, it
- can only run successfully using 2.4.12 or later.
-- I haven't had time to sufficiently dig into XKB to properly configure it
- for sun5 keyboards. Given XFree86 on Linux/SPARC has been around for a
- while, it's likely someone has already done this, and I'd appreciate
- receiving a copy of a working XF86Config input section.
-
-PowerPC Linux
--------------
-- As mentioned above, kernel work is in progress to port this PCI scheme
- to Linux/PowerPC.
-- Aside from kernel work, the inX() and outX() definitions in compiler.h
- will need to be changed to do something akin to their SPARC definitions,
- i.e. consider their port argument to be a virtual address.
-
-Other Linux ports to multi-domain architectures
------------------------------------------------
-- Comments in os-support/bus/linuxPci.c document the kernel interface
- required to port these changes. In short, Linux ports, such as Alpha
- and mips, should follow SPARC and PowerPC's lead in providing support to
- mmap() PCI devices through their /proc/bus/pci pseudo-files and to treat
- such requests for host bridges as requests to mmap() space provided by
- these bridges.
-
-Other OS's
-----------
-- In the right hands, either linuxPci.c or sparcPci.c can be used as a
- guide for what would need to be done to port this scheme to other OS's.
- Perhaps the largest difference between the two (in terms of interface to
- the common layer) is that the SunOS port includes internally generated
- domain numbers in PCITAG's, whereas the Linux port doesn't need to. The
- remainder of the PCI code (which is OS-independent) can handle either
- scheme.
-- Required entry points are xf86GetPciDomain(), xf86MapDomainMemory(),
- xf86MapDomainIO() and xf86ReadDomainMemory(). Replacements for
- xf86BusAccWindowsFromOS(), xf86PciBusAccWindowsFromOS() and
- xf86AccResFromOS() might also be required.
-- Development of these changes has detected the fact that the XFree86 port
- to the PowerMax OS is broken, and has been for some time, i.e. since
- shortly after its introduction, back in the 3.9* days.
-
-SPARC PCI (OS-independent)
---------------------------
-- The "Simba" PCI-to-PCI bridge used in SPARC's does not implement VGA
- routing, as defined in the PCI specs. Fortunately, OpenPROM seems to
- always route VGA resources to the bus with PCI connectors, but this also
- causes the common layer to not mark any PCI adapter as primary.
-
-Multiple PCI domains (architecture- and OS-independent)
--------------------------------------------------------
-- This implementation assumes every host-to-PCI bridge provides access to
- a separate PCI domain. Each such domain provides three different
- "address" spaces: PCI configuration, I/O and memory. The
- implementation can also deal with situations where more than one PCI
- domain share (different subsets of) the same PCI configuration space. I
- have unconfirmed information that suggests it might be necessary to also
- allow the sharing of PCI memory spaces.
-- This implementation also assumes the CPU's physical address space
- includes the entirety of each domain's I/O and memory spaces. I know
- this'll need to be changed to deal with the so-called UniNorth bridge,
- found on PowerPC's, which allows access to only a subset of the memory
- space behind it.
-- Ideally, the common layer should mark as primary up to one PCI adapter
- per domain. This has yet to be done.
-- Something needs to be done about PCI master aborts on primary buses.
- For details on this, see my long-winded diatribe in sparcPci.c, and
- related comments in linuxPci.c. Suffice it to say here that I see the
- eventual implementation of host bridge drivers within XFree86 as
- unavoidable at this point.
-- DGA is broken on multi-domain platforms. The information passed to the
- client to locate the framebuffer still needs to be revised. The best way
- to deal with this is to change all drivers' OpenFramebuffer() function to
- call a common layer routine to set the device name and displacements to be
- returned to the DGA client.
-
-Output drivers
---------------
-Most drivers currently used on ix86 need(ed) source code changes.
-- Calls to xf86ReadBIOS() and xf86MapVidMem() were replaced with calls to
- xf86ReadDomainMemory() and xf86MapDomainMemory() respectively. Except
- for the "ati" and "atimisc" modules, this has already been done.
-- All ix86-style I/O port numbers need to be declared as an IOADDRESS, a
- type defined in xf86Pci.h as "unsigned long". Such port numbers also
- need to be offset by a displacement which is also defined as an
- IOADDRESS. Before a driver's PreInit() is called, the common layer
- makes this displacement available in ScrnInfoRec.domainIOBase. For
- single-domain architectures, such as ix86, domainIOBase will always be
- zero. Current use of vgaHWRec.PIOOffset has also been adjusted
- accordingly. Some drivers have been changed to keep a copy of this
- displacement in their private structure. Internally, an IOADDRESS is
- actually a pointer that has been recasted to an unsigned long, but the
- common layer "hides" this fact from the driver ABI, which means that I/O
- port numbers, as seen by drivers, remain as integers rather than
- addresses. Aside from the ati and atimisc modules, s3, sis and tseng
- are the only modules left whose I/O still needs to be converted (I've
- temporarily run out of steam).
-- Note that these conversions are not necessarily sufficient to produce
- drivers that will work on any given multi-domain architecture. A driver
- that, for example, had endianness problems, still does. But, at least,
- these conversions, along with the supporting common layer changes, make
- PCI drivers more widely amenable to porting.
-- rdinx(), wrinx(), modinx(), testrg(), testinx() and testinx2() are not
- given enough information to allow for the relocation of their I/O. They
- are consequently being deleted. The apm and ark drivers, the only
- remaining callers of the first three, have been changed to use local
- definitions instead. The last three (test*()) were already unused.
-- As a temporary measure, these changes completely disable ISA-style
- probing on SPARC's and PowerPC's. This means that driver calls to
- xf86MatchIsaInstances(), while still valid, will always return detection
- failure on SPARC's and PowerPC's. This will be dealt with when a more
- general master abort handling scheme is implemented.
-- I need to make a decision about the master abort issues mentionned above
- before I can convert the "ati" and "atimisc" modules. Consequently,
- these modules still need to be compiled with -DAVOID_CPIO on
- multi-domain architectures, and support for Mach64 variants as
- non-primary heads is not yet available.
-
-$XFree86: xc/programs/Xserver/hw/xfree86/Domain.note,v 1.2 2002/01/25 21:55:49 tsi Exp $
diff --git a/hw/xfree86/doc/devel/RAC.Notes b/hw/xfree86/doc/devel/RAC.Notes
deleted file mode 100644
index 0aec9d795..000000000
--- a/hw/xfree86/doc/devel/RAC.Notes
+++ /dev/null
@@ -1,696 +0,0 @@
-I. Abstract
-===========
-
-Graphics devices are accessed thru ranges in I/O or memory space. While
-most modern graphics devices allow relocation of such ranges many of
-them still require the use of well established interfaces such as VGA
-memory and IO ranges or 8514/A IO ranges. Up to version 3.3 of
-XFree86 only a single graphics device could be driven. Therfore there
-was no need to address the issue of sharing such memory or I/O ranges
-among several devices. Starting with version 4.0 XFree86 is capable of
-driving more than one graphics interface in a multi-head environment.
-Therefore a mechanism needed to be designed which was capable of
-controlling the sharing the access to memory and I/O ranges. In this
-document we describe to use of the RAC (Resource Access Control)
-system in the XFree86 server which provides the service of controlling
-access to interface resources.
-
-II. Introduction
-================
-
-Terms and definitions:
-
-II.1. Bus
----------
-
-'Bus' is ambiguous as it is used for different things: It may refer to
-physical incompatible extension connectors in a computer system. The
-RAC system knows two such systems: The ISA bus and the PCI bus. (On
-the software level EISA, MC and VL buses are currently treated like
-ISA buses). 'Bus' may always refer to logically different entities on
-a single bus system which are connected via bridges. A PCI system may
-have several distinct PCI buses connecting each other by PCI-PCI
-bridges or to the host CPU by HOST-PCI bridges.
-
-Systems that host more than one bus system link these together using
-bridges. Bridges are a concern to RAC as they might block or pass
-specific resources. PCI-PCI bridges may be set up to pass VGA
-resources to the secondary bus. PCI-ISA buses pass any resources not
-decoded on the primary PCI bus to the ISA bus. This way VGA resources
-(although exclusive on the ISA bus) can be shared by ISA and PCI
-cards. Currently HOST-PCI bridges are not yet handled by RACY as they
-require specific drivers.
-
-II.2. Entity
-------------
-
-The smallest independently addressable unit on a system bus is
-referred to as an entity. So far we know ISA and PCI entities. PCI
-entities can be located on the PCI bus by an unique ID consisting of
-the bus, card and function number.
-
-II.3. Resource
---------------
-
- 'Resource' refers to a range of memory or I/O addresses an entity
-can decode.
-
-If a device is capable of disabling this decoding the resource is
-called sharable. For PCI devices a generic method is provided to
-control resource decoding. Other devices will have to provide a device
-specific function to control decoding.
-
-If the entity is capable of decoding this range at a different
-location this resource is considered relocatable. Resource which start
-at a specific address and occupy a single continuous range are called
-block resources.
-
-Alternatively resource addresses can be decoded in a way that they
-satisfy the condition:
-
- address & mask == base
-
-with base & mask == base. Resources addressed in such a way are
-considered sparse resources.
-
-
-II.4. Server States
-------------------
-
-The resource access control system knows two server states: the SETUP
-and the OPERATING state. The setup state is entered whenever a mode
-change takes place or the server exits or does VT switching. During
-this state any entity resource is under resource access control.
-During OPERATING state only those entities are controlled which
-actually have shared resources that conflict with others. The
-determination which entity is to be placed under RAC during OPERATING
-state takes place after ScreenInit() during the first server
-generation. This doesn't apply if only one screen is active: in this
-case no RAC is needed and the screen is simply left enabled while the
-server is active.
-
-
-III. Theory of operation
-========================
-
-III.1. General
---------------
-
-The common level has knowledge of generic access control mechanisms
-for devices on certain bus systems (currently the PCI bus) as well as
-of methods to enable or disable access to the buses
-itself. Furthermore it can access information on resources decoded by
-these devices and if necessary modify it.
-
-When first starting the Xserver collects all this information, saves
-it for restoration checks it for consistency and if necessary corrects
-it. Finally it disables all resources on a generic level prior to
-calling any driver function.
-
- The user should provide a device section in XF86Config for each
-graphics device installed in his system. Each such entity which is
-never to be used as X display device might be marked as inactive by
-adding the keyword "Inactive" to the device section.
-
-When the Probe() function of each driver is called the device sections
-are matched against the devices found in the system. The driver may
-probe devices at this stage that cannot be identified by using device
-independent methods. Access to all resources that can be controlled in
-a device independent way is disabled. The Probe() function should
-register all non-relocatable resources at this stage. If a resource
-conflict is found between exclusive resources the driver will fail
-immediately. Optionally the driver might specify an EntityInit(),
-EntityLeave() and EntityEnter() function.
-
-EntityInit() can be used to disable any shared resources that are not
-controlled by the generic access control functions. It is called prior
-to the PreInit phase regardless if an entity is active or not. When
-calling the EntityInit(), EntityEnter() and EntityLeave() functions
-the common level will disable access to all other entities on a
-generic level. Since the common level has no knowledge of device
-specific methods to disable access to resources it cannot be
-guaranteed that certain resources are not decoded by any other entity
-until the EntityInit() or EntityEnter() phase is finished. Device
-drivers should therefore register all those resources which they are
-going to disable. If these resources are never to be used by any
-driver function they may be flagged 'ResInit' so that they can be
-removed from the resource list after processing all EntityInit()
-functions. EntityEnter() should disable decoding of all resources
-which are not registered as exclusive and which are not handled by the
-generic access control in the common level. The difference to
-EntityInit() is that the latter one is only called once during
-lifetime of the server. It can therefore be used to set up variables
-prior to disabling resources. EntityLeave() should restore the
-original state when exiting the server or switching to a different vt.
-It also needs to disable device specific access functions if they need
-to be disabled on server exit or VT switch. The default state is to
-enable them before giving up the VT.
-
-In PreInit() phase each driver should check if any sharable resources
-it has registered during Probe() has been denied and take appropriate
-action which could simply be to fail. If it needs to access resources
-it has disabled during EntitySetup() it can do so provided it has
-registered these and will disable them before returning from
-PreInit(). This also applies to all other driver functions. Several
-functions are provided to request resource ranges, register these,
-correct PCI config space and add replacements for the generic access
-functions. Resources may be marked 'disabled' or 'unused' during
-OPERATING stage. Although these steps could also be performed in
-ScreenInit(), this is not desirable.
-
-Following PreInit() phase the common level determines if resource
-access control is needed. This is the case if more than one screen is
-used. If necessary the RAC wrapper module is loaded. In ScreenInit()
-the drivers can decide which operations need to be placed under
-RAC. Available are the frame buffer operations, the pointer operations
-and the colormap operations. Any operation that requires resources
-which might be disabled during OPERATING state should be set to use
-RAC. This can be specified separately for memory and IO resources.
-
-When ScreenInit() phase is done the common level will determine which
-shared resources are requested by more than one driver and set the
-access functions accordingly. This is done following these rules:
-
-a. The sharable resources registered by each entity are compared. if
- a resource is registered by more than one entity the entity will be
- marked to need to share this resources type (IO or MEM).
-
-b. A resource marked 'disabled' during OPERATING state will be ignored
- entirely.
-
-c. A resource marked 'unused' will only conflicts with an overlapping
- resource of an other entity if the second is actually in use during
- OPERATING state.
-
-d. If an 'unused' resource was found to conflict however the entity
- does not use any other resource of this type the entire resource
- type will be disabled for that entity.
-
-The driver has the choice among different ways to control access to
-certain resources:
-
-a. It can relay on the generic access functions. This is probably the
- most common case. Here the driver only needs to register any
- resource it is going to use.
-
-b. It can replace the generic access functions by driver specific
- ones. This will mostly be used in cases where no generic access
- functions are available. In this case the driver has to make sure
- these resources are disabled when entering the PreInit() stage.
- Since the replacement functions are registered in PreInit() the
- driver will have to enable these resources itself if it needs to
- access them during this state. The driver can specify if the
- replacement functions can control memory and/or I/O resources
- separately.
-
-c. The driver can enable resources itself when it needs them. Each
- driver function enabling them needs to disable them before it will
- return. This should be used if a resource which can be controlled
- in a device dependent way is only required during SETUP state. This
- way it can be marked 'unused' during OPERATING state.
-
-A resource which is decoded during OPERATING state however never
-accessed by the driver should be marked unused.
-
-Since access switching latencies are an issue during Xserver
-operation, the common level attempts to minimize the number of
-entities that need to be placed under RAC control. When a wrapped
-operation is called, the EnableAccess() function is called before
-control is passed on. EnableAccess() checks if a screen is under
-access control. If not it just establishes bus routing and returns. If
-the screen needs to be under access control, EnableAccess() determines
-which resource types (MEM,IO) are required. Then it tests if this
-access is already established. If so it simply returns. If not it
-disables the currently established access, fixes bus routing and
-enables access to all entities registered for this screen.
-
-Whenever a mode switch or a vt-switch is performed the common level
-will return to SETUP state.
-
-III.3. Resource Types
----------------------
-
-Resource have certain properties. When registering resources each
-range is accompanied by a flag consisting of the or'ed flags of the
-different properties the resource has. Each resource range may be
-classified according to
-
-- its physical properties ie. if it addresses
- memory (ResMem) or
- I/O space (ResIo),
-- if it addresses a
- block (ResBlock) or
- sparse (ResSparse)
- range,
-- its access properties.
-
-There are two known access properties:
-
-- ResExclusive
- for resources which may not be shared with any other device and
-- ResShared
- for resources which can be disabled and therefore can be shared.
-
-If it is desirable to test a resource against any type a generic
-access type 'ResAny' is provided. If this is set the resource will
-conflict with any resource of a different entity intersecting its
-range. Further it can be specified that a resource is decoded however
-never used during any stage (ResUnused) or during OPERATING state
-(ResUnusedOpr). A resource only visible during the init functions (ie.
-EntityInit(), EntityEnter() and EntityLeave() should be registered
-with the flag 'ResInit'. A resource that might conflict with
-background resource ranges may be flagged with 'ResBios'. This might
-be useful when registering resources ranges that were assigned by the
-system Bios.
-
-Several predefined resource lists are available for VGA and 8514/A
-resources in common/sf86Resources.h.
-
-IV. Available Functions
-=======================
-
-The functions provided for resource management will be listed in order
-of use in the driver.
-
-IV.1. Probe phase
------------------
-
-In this stage each driver detects those resources it is able to drive,
-creates an entity record for each of them, registers non-relocatable
-resources and allocates screens and adds the resources to screens.
-
-Two helper functions are provided for matching device sections in the
-XF86Config file to the devices:
-
- int xf86MatchPciInstances(const char *driverName, int vendorID,
- SymTabPtr chipsets, PciChipsets *PCIchipsets,
- GDevPtr *devList, int numDevs, DriverPtr drvp,
- int **foundEntities);
-
- int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
- IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList,
- int numDevs, int **foundEntities);
-
-Both functions return the number of matched entities and their indices
-in foundEntities list.
-
-They make use of several sub functions which are also available on the
-driver level:
-
- Bool xf86ComparePciBusString(const char *busID, int bus,
- int device, int func);
-
-and
-
- Bool xf86ParseIsaBusString(const char *busID);
-
-are called to interpret the busID in the device section. The functions:
-
- int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
- int chipset, GDevPtr dev, Bool active);
-
- int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool
- active);
-
-are used to allocate the entities and initialize their data
-structures. Both functions return the index of the newly allocated
-entity record or (-1) should the function fail. Before probing an ISA
-card
-
- Bool xf86IsPrimaryIsa();
-
-gets called to determine if the primary card was not detected on the
-PCI bus.
-
-Two helper functions are provided to aid configuring entities:
-
- Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
- PciChipsets *p_chip, resList res,
- EntityProc init, EntityProc enter,
- EntityProc leave, pointer private);
- Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
- IsaChipsets *i_chip, resList res,
- EntityProc init, EntityProc enter,
- EntityProc leave, pointer private);
-
-They are used to register the init/enter/leave functions described
-above as well as the non-relocatable resources. Generally the list of
-fixed resources is obtained from the Isa/PciChipsets lists. However
-an additional list of resources may be passed. Generally this is not
-required. The init/enter/leave functions have to be of type
-
- typedef void (*EntityProc)(int entityIndex,pointer private);
-
-They are passed the entity index and a pointer to a private scratch
-area. This are can be set up during Probe() and its address can be
-passed to xf86ConfigActiveIsaEntity() xf86ConfigActivePciEntity() as
-the last argument.
-
-These helper functions use:
-
- void xf86ClaimFixedResources(resList list, int entityIndex);
-
- To register the non relocatable resources which cannot be disabled
- and which therefore would cause the server to fail immediately if
- they were found to conflict. It also records non-relocatable but
- sharable resources for processing after the Probe() phase.
-
- Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
- EntityProc enter, EntityProc leave, pointer);
-
- This function registers the init/enter/leave() functions along with
- the pointer to their private area to the entity.
-
- void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
-
- adds the entity to the screen.
-
-These functions are also available on the driver level. A detailed
-Probe() function is listed below. For most drivers this can be used
-with little change.
-
-Please note that VGA resources have to be claimed in Probe()
-phase. Otherwise they are not routed to the bus.
-
-IV.2. PreInit() phase
----------------------
-
-During this phase the remaining resource should be registered.
-PreInit() should call
-
- EntityInfoPtr xf86GetEntityInfo(int entityIndex);
-
-To obtain a pointer to an EntityInfoRec for each entity it is able to
-drive and check if any resource are listed in 'resources'. These have
-been rejected in the post-Probe() phase. The driver should decide if
-it can continue without using these or if it should fail. The pointer
-to the EntityInfoRec should be freed if not needed any more.
-
-Several functions are provided to simplify resource registration:
-
- Bool xf86IsEntityPrimary(int entityIndex);
-
-is used to determine if the entity is the display device that is used
-during boot-up and text mode.
-
- Bool xf86IsScreenPrimary(int scrnIndex);
-
-finds out if the primary entity is registered for the screen with
-specified index.
-
- pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
-
-returns a pointer to the pciVideoRec of the specified entity. If the
-entity is not a PCI device NULL is returned.
-
-The primary function for registration of resources is
-
- resPtr xf86RegisterResources(int entityIndex, resList list, int access);
-
-it tries to register the resources in 'list'. If list is NULL it tries
-to determine the resources automatically. This only works for entities
-that provide a generic way to read out the resource ranges they
-decode. So far this is only the case for PCI devices. By default the
-PCI resources are registered as shared (ResShared) if the driver wants
-to set a different access type it can do so by specifying the access
-flags in the third argument. A value of 0 means to use the default
-settings. If for any reason the resource broker is not able to
-register some of the requested resources the function will return a
-pointer to a list of the failed ones. In this case the driver may move
-the resource to different locations. In case of PCI bus entities this
-is done by passing the list of failed resources to
-
- resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
-
-this function returns a list of reallocated resource. This list needs
-to be passed to xf86RegisterResources() again to be registered with
-the broker.
-
-Two functions are provided to obtain a resource range of a given type:
-
- resRange xf86GetBlock(long type, memType size,
- memType window_start, memType window_end,
- memType align_mask, resPtr avoid);
- resRange xf86GetSparse(long type, unsigned long fixed_bits,
- unsigned long decode_mask, unsigned long address_mask,
- resPtr avoid);
-
-The first one tries to find a block range of size 'size' and type
-'type' in a window bound by window_start and window_end with the
-alignment specified in alignment mask. Optionally a list of resource
-ranges which should be avoided inside this window can be passed. On
-failure it will return a zero range of type 'ResEnd'.
-
-The latter function does the same for sparse resources. A spares range
-is determined by to parameters: the mask and the base value. An
-address satisfying
-
- mask & address == base
-
-belongs to the specific spares range. 'mask' and 'base' themselves
-have to satisfy:
-
- mask & base == base.
-
-Here three values have to be specified: the address mask which marks
-all bits of the mask part of the address, the decode_mask which masks
-out the bits which are hard coded and are therefore not available for
-relocation and the values of the fixed bits. The function tries to
-find a base that satisfies the given condition. If the function fails
-it will return a zero range of type 'ResEnd'. Optionally it might be
-passed a list of resource ranges to avoid.
-
-Certain PCI devices are broken in the sense that they return invalid
-size information for a certain resource. In this case the driver can
-supply the correct size and make sure that the resource range
-allocated for the card is large enough to hold the address range
-decoded by the card. The function:
-
- Bool xf86FixPciResource(int entityIndex, unsigned int prt, CARD32 alignment,
- long type);
-
-is used for that. The parameter prt contains the number of the PCI
-base register that needs to be modified. A value of 6 refers to the
-BIOS base register. The size is specified in the alignment
-register. Since PCI resources need to span an integral range of the
-size 2^n the alignment also specifies the number of addresses that
-will be decoded. If the driver specifies a type mask it can override
-the default type for PCI resources which is 'ResShared'. The resource
-broker needs to know that to find a matching resource range. This
-function should be called before calling xf86RegisterResources().
-
- Bool xf86CheckPciMemBase(pciVideoPtr pPci, unsigned long base);
-
-checks that the memory base value specified in base matches one of the
-PCI base address register values for the given PCI device.
-
-The driver may replace the generic access control functions for an
-entity by it's own ones.
-
- void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
- xf86SetAccessFuncPtr oldFuncs);
-
- with:
-
- typedef struct {
- xf86AccessPtr mem;
- xf86AccessPtr io;
- xf86AccessPtr io_mem;
- } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
-
-is used for that. The driver can pass three functions: one for I/O
-access, one for memory access and one for combined memory and I/O
-access. If the memory access and combined access functions are
-identical the common level assumes that the memory access cannot be
-controlled independently of I/O access, if the I/O access function and
-the combined access functions are the same it is assumed that I/O can
-not be controlled independently. If memory and I/O have to be
-controlled together all three values should be the same. If a non
-NULL value is passed as third argument it is interpreted as an address
-where to store the old access records. If the third argument is NULL
-it will be assumed that the generic access should be enabled before
-replacing the access functions. Otherwise it will be disabled. The
-driver may enable them itself using the returned values. It should do
-this from his replacement access functions as the generic access may
-be disabled by the common level on certain occasions. If replacement
-functions are specified they must control all resources of the
-specific type registered for the entity.
-
-To find out if specific resource range is conflicting with another
-resource
-
- memType xf86ChkConflict(resRange *rgp, int entityIndex);
-
-may be called. If a non-zero value is returned a conflict is found.
-
- resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
-
-is used to set the state of a resource during OPERATING state. 'list'
-holds a list to which 'mask' is to be applied. The parameter 'mask'
-may have the value 'ResUnusedOpr' and 'ResDisableOpr'. The first one
-should be used if a resource isn't used during OPERATING state however
-decoded by the device while the latter one indicates that the resource
-is not decoded during OPERATING state. Note that the resource ranges
-have to match those specified during registration. If a range has been
-specified starting at A and ending at B and suppose C us a value
-satisfying A < C < B one may not specify the resource range (A,B) by
-splitting it into two ranges (A,C) and (C,B).
-
-Two functions are provided for special cases:
-
- void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
-
-may be used to remove an entity from a screen. This only makes sense
-if a screen has more than one entity assigned or the screen is to be
-deleted. No test is made if the screen has any entities left.
-
- void xf86DeallocateResourcesForEntity(int entityIndex, long type);
-
-deallocates all resources of a given type registered for a certain
-entity from the resource broker list.
-
-IV.3. ScreenInit() phase
-------------------------
-
-Setting up the rac flags is all that remains to do in ScreenInit()
-phase (Note that these flags might also be set up in PreInit() phase).
-The ScrnInfoRec has separate flags for memory and PIO access:
-racIoFlags and racMemFlags. They specifies which graphics operations
-might require the use of resources which might be disabled for some
-reason. Note that even exclusive resources might be disabled if they
-are disabled along with shared resources. For example if a driver has
-registered the VGA PIO resources and lets the common level disable
-these by disabling PIO access in PCI config space (the standard way),
-exclusive PCI PIO ranges will also be disabled. Therefore the driver
-has to flag any operations requiring PCI PIO resources in racIoFlags.
-The avaliable flags are defined in rac/xf86RAC.h. Available are:
-
- RAC_FB for framebuffer operations (including hw acceleration)
- RAC_CURSOR for Cursor operations
- (??? I'm not sure if we need this for SW cursor it depends
- on which level the sw cursor is drawn)
- RAC_COLORMAP for colormap operations
- RAC_VIEWPORT for the call to RACAdjustFrame()
-
-The flags are or'ed.
-
-V. Appendix
-===========
-
-A. Sample Probe() Function
---------------------------
-
-static Bool
-XXXProbe(DriverPtr drv, int flags)
-{
- Bool foundScreen = FALSE;
- int numDevSections, numUsed;
- GDevPtr *devSections;
- int *usedChips;
- int i;
-
- /*
- * Find the config file Device sections that match this
- * driver, and return if there are none.
- */
- if ((numDevSections = xf86MatchDevice(CHIPS_DRIVER_NAME,
- &devSections)) <= 0) {
- return FALSE;
- }
- /* PCI BUS */
- /* test if PCI bus present */
- if (xf86GetPciVideoInfo() ) {
- /* match PCI instances with ones supported by the driver */
- numUsed = xf86MatchPciInstances(XXX_NAME, PCI_VENDOR_XXX,
- XXXChipsets, XXXPCIchipsets,
- devSections,numDevSections, drv,
- &usedChips);
- if (numUsed > 0) {
- for (i = 0; i < numUsed; i++) {
- /* Allocate a ScrnInfoRec */
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv,0);
- pScrn->driverVersion = VERSION;
- pScrn->driverName = XXX_DRIVER_NAME;
- pScrn->name = XXX_NAME;
- pScrn->Probe = XXXProbe;
- pScrn->PreInit = XXXPreInit;
- pScrn->ScreenInit = XXXScreenInit;
- pScrn->SwitchMode = XXXSwitchMode;
- pScrn->AdjustFrame = XXXAdjustFrame;
- pScrn->EnterVT = XXXEnterVT;
- pScrn->LeaveVT = XXXLeaveVT;
- pScrn->FreeScreen = XXXFreeScreen;
- pScrn->ValidMode = XXXValidMode;
- foundScreen = TRUE;
- /* add screen to entity */
- xf86ConfigActivePciEntity(pScrn,usedChips[i],XXXPCIchipsets,
- NULL,NULL,NULL,NULL,NULL);
- }
- }
- }
-
- /* Isa Bus */
- numUsed = xf86MatchIsaInstances(XXX_NAME,XXXChipsets,XXXISAchipsets,
- drv,chipsFindIsaDevice,devSections,
- numDevSections,&usedChips);
- if(numUsed >= 0)
- for (i = 0; i < numUsed; i++) {
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv,0);
-
- pScrn->driverVersion = VERSION;
- pScrn->driverName = XXX_DRIVER_NAME;
- pScrn->name = XXX_NAME;
- pScrn->Probe = XXXProbe;
- pScrn->PreInit = XXXPreInit;
- pScrn->ScreenInit = XXXScreenInit;
- pScrn->SwitchMode = XXXSwitchMode;
- pScrn->AdjustFrame = XXXAdjustFrame;
- pScrn->EnterVT = XXXEnterVT;
- pScrn->LeaveVT = XXXLeaveVT;
- pScrn->FreeScreen = XXXFreeScreen;
- pScrn->ValidMode = XXXValidMode;
- foundScreen = TRUE;
- xf86ConfigActiveIsaEntity(pScrn,usedChips[i],XXXISAchipsets,
- NULL,NULL,NULL,NULL,NULL);
- }
- xfree(devSections);
- return foundScreen;
-}
-
-B. Porting Issues
------------------
-
-Here are some hints on porting code developed for RAC 1 to RAC 2.
-
-1. a. Initialization of RAC is now entirely done on the common level.
- Therefore the call to xf86RACInit() can be removed.
-
- b. Also there is no need for the racSymbols list.
-
- c. LoadSubModule(..,rac) should be removed.
-
- d. racSymbols should be removed from LoaderRequestSymList(racSymbols,..)
-
-2. a. if the driver uses the predefined resource lists xf86Resources.h
- needs to be included.
-
- b. RES_VGA should be changed to RES_EXCLUSIVE_VGA
-
-3. The device list now belongs to the EntityInfoRec.
- Change pScrn->device to xxx->pEnt->device.
-
-4. Rewrite the Probe() function. The example given above should work
- as a guideline.
-
-5. Register all necessary resources in PreInit() by calling
- xf86RegisterResources().
-
-6. If applicable set the operating state of the registered resources
- by calling xf86SetOperatingState(). This should be done during
- PreInit(). If necessary it might still be done in ScreenInit()
-
-7. Set up the racIoFlags and racMemFlags.
-
-
- LocalWords: ISA
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp
deleted file mode 100644
index 0f1bd1b69..000000000
--- a/hw/xfree86/doc/devel/README.DRIcomp
+++ /dev/null
@@ -1,557 +0,0 @@
- DRI Compilation Guide
-
- VA Linux Systems, Inc. Professional Services - Graphics.
-
- 21 April 2001
-
-1. Preamble
-
-1.1 Copyright
-
-Copyright © 2000-2001 by VA Linux Systems, Inc. All Rights Reserved.
-
-Permission is granted to make and distribute verbatim copies of this document
-provided the copyright notice and this permission notice are preserved on all
-copies.
-
-1.2 Trademarks
-
-OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics,
-Inc. Unix is a registered trademark of The Open Group. The `X' device and X
-Window System are trademarks of The Open Group. XFree86 is a trademark of
-The XFree86 Project. Linux is a registered trademark of Linus Torvalds.
-Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
-Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
-3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
-active, Incorporated. Matrox is a registered trademark of Matrox Electronic
-Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo-
-gies, Inc. All other trademarks mentioned are the property of their respec-
-tive owners.
-
-2. Introduction
-
-This document describes how to download, compile and install the DRI. The
-DRI provides 3D graphics hardware acceleration for the XFree86 project. This
-information is intended for experienced Linux developers. Beginners are
-probably better off installing precompiled packages.
-
-Edits, corrections and updates to this document may be mailed to <brian@tung-
-stengraphics.com>.
-
-Last updated on 13 February 2002 by Brian Paul.
-
-3. Prerequisites
-
-You'll need the following:
-
- o An installation of XFree86 4.1 or later. The DRI tree has been pruned
- down to minimize its size. But in order to build the DRI tree you need
- to have recent X header files, etc. already installed. If you don't
- have XFree86 4.1 (or later) installed you can probably install it from
- RPMs (or another package format). Or, you can download XFree86 as
- sources and compile/install it yourself.
-
- o At least 200MB of free disk space. If you compile for debugging (the -g
- option) then you'll need about 600MB.
-
- o GCC compiler and related tools.
-
- o ssh (secure shell) if you're a DRI developer and don't want to use
- anonymous CVS download.
-
- o A 2.4.x Linux Kernel. See below for details.
-
- o FreeBSD support is not currently being maintained and may not work.
-
-The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How-
-ever, limited support for Alpha and PowerPC support is underway.
-
-For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library
-(libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be
-downloaded from the DRI website. You can compile them yourself, but it's
-often a painful process.
-
-For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll
-also need AGP support in your Linux kernel, either built-in or as a loadable
-module.
-
-4. Linux Kernel Preparation
-
-Only the Linux 2.4.x kernels are currently supported by the DRI hardware
-drivers. 2.5.x kernels may work, but aren't tested.
-
-Most of the DRI drivers require AGP support and using Intel Pentium III SSE
-optimizations also requires an up-to-date Linux kernel. Configuring your
-kernel correctly is very important, as features such as SSE optimizations
-will be disabled if your kernel does not support them. Thus, if you have a
-Pentium III processor, you must configure your kernel for the Pentium III
-processor family.
-
-Building a new Linux kernel can be difficult for beginners but there are
-resources on the Internet to help. This document assumes experience with
-configuring, building and installing Linux kernels.
-
-Linux kernels can be downloaded from www.kernel.org
-
-Here are the basic steps for kernel setup.
-
- o Download the needed kernel and put it in /usr/src. Create a directory
- for the source and unpack it. For example:
-
- cd /usr/src
- rm -f linux
- mkdir linux-2.4.x
- ln -s linux-2.4.x linux
- bzcat linux-2.4.x.tar.bz2 | tar xf -
-
- It is critical that /usr/src/linux point to your new kernel sources,
- otherwise the kernel headers will not be used when building the DRI.
- This will almost certainly cause compilation problems.
-
- o Read /usr/src/linux/Documentation/Changes. This file lists the minimum
- requirements for all software packages required to build the kernel.
- You must upgrade at least gcc, make, binutils and modutils to at least
- the versions specified in this file. The other packages may not be
- needed. If you are upgrading from Linux 2.2.x you must upgrade your
- modutils package for Linux 2.4.x.
-
- o Configure your kernel. You might, for example, use make menuconfig and
- do the following:
-
- o Go to Code maturity level options
-
- o Enable Prompt for development and/or incomplete code/drivers
-
- o hit ESC to return to the top-level menu
-
- o Go to Processor type and features
-
- o Select your processor type from Processor Family
-
- o hit ESC to return to the top-level menu
-
- o Go to Character devices
-
- o Disable Direct Rendering Manager (XFree86 DRI support) since we'll
- use the DRI code from the XFree86/DRI tree and will compile it
- there.
-
- o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW)
-
- o Hit SPACE twice to build AGP support into the kernel
-
- o Enable all chipsets' support for AGP
-
- o It's recommended that you turn on MTRRs under Processor type and
- Features, but not required.
-
- o Configure the rest of the kernel as required for your system (i.e. Eth-
- ernet, SCSI, etc)
-
- o Exit, saving your kernel configuration.
-
- o Edit your /etc/lilo.conf file. Make sure you have an image entry as
- follows (or similar):
-
- image=/boot/vmlinuz
- label=linux.2.4.x
- read-only
- root=/dev/hda1
-
- The important part is that you have /boot/vmlinuz without a trailing
- version number. If this is the first entry in your /etc/lilo.conf AND
- you haven't set a default, then this will be your default kernel.
-
- o Compile the new kernel.
-
- cd /usr/src/linux-2.4.x
- make dep
- make bzImage
- make modules
- make modules_install
- make install
-
- Note that last make command will automatically run lilo for you.
-
- o Now reboot to use the new kernel.
-
-5. CPU Architectures
-
-In general, nothing special has to be done to use the DRI on different CPU
-architectures. There are, however, a few optimizations that are CPU-depen-
-dent. Mesa will determine at runtime which CPU-dependent optimizations
-should be used and enable them where appropriate.
-
-5.1 Intel Pentium III Features
-
-The Pentium III SSE instructions are used in optimized vertex transformation
-functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent
-kernel (such as 2.4.0-test11 or later) both at compile time and runtime.
-
-5.2 AMD 3DNow! Features
-
-AMD's 3DNow! instructions are used in optimized vertex transformation func-
-tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of
-Linux.
-
-5.3 Alpha Features
-
-On newer Alpha processors a significant performance increase can be seen with
-the addition of the -mcpu= option to GCC. This option is dependent on the
-architecture of the processor. For example, -mcpu=ev6 will build specifi-
-cally for the EV6 based AXP's, giving both byte and word alignment access to
-the DRI/Mesa drivers.
-
-To enable this optimization edit your xc/config/host.def file and add the
-line:
-
-#define DefaultGcc2AxpOpt -O2 -mcpu=ev6
-
-Additional speed improvements to 3D rendering can be achieved by installing
-Compaq's Math Libraries (CPML) which can be obtained from http://www.sup-
-port.compaq.com/alpha-tools/software/index.html
-
-Once installed, you can add this line to your host.def to build with the CPML
-libraries:
-
-#define UseCompaqMathLibrary YES
-
-The host.def file is explained below.
-
-6. Downloading the XFree86/DRI CVS Sources
-
-The DRI project is hosted by SourceForge. The DRI source code, which is a
-subset of the XFree86 source tree, is kept in a CVS repository there.
-
-The DRI CVS sources may be accessed either anonymously or as a registered
-SourceForge user. It's recommended that you become a registered SourceForge
-user so that you may submit non-anonymous bug reports and can participate in
-the mailing lists.
-
-6.1 Anonymous CVS download:
-
- 1. Create a directory to store the CVS files:
-
- cd ~
- mkdir DRI-CVS
-
- You could put your CVS directory in a different place but we'll use
- ~/DRI-CVS/ here.
-
- 2. Check out the CVS sources:
-
- cd ~/DRI-CVS
- cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login
- (hit ENTER when prompted for a password)
- cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc
-
- The -z3 flag causes compression to be used in order to reduce the down-
- load time.
-
-6.2 Registered CVS download:
-
- 1. Create a directory to store the CVS files:
-
- cd ~
- mkdir DRI-CVS
-
- You could put your CVS directory in a different place but we'll use
- ~/DRI-CVS/ here.
-
- 2. Set the CVS_RSH environment variable:
-
- setenv CVS_RSH ssh // if using csh or tcsh
- export CVS_RSH=ssh // if using sh or bash
-
- 3. Check out the CVS sources:
-
- cd ~/DRI-CVS
- cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc
-
- Replace YOURID with your CVS login name. You'll be prompted to enter
- your sourceforge password.
-
- The -z3 flag causes compression to be used in order to reduce the down-
- load time.
-
-6.3 Updating your CVS sources
-
-In the future you'll want to occasionally update your local copy of the DRI
-source code to get the latest changes. This can be done with:
-
- cd ~/DRI-CVS
- cvs -z3 update -dA xc
-
-The -d flag causes any new subdirectories to be created and -A causes most
-recent trunk sources to be fetched, not branch sources.
-
-7. Mesa
-
-Most of the DRI 3D drivers are based on Mesa (the free implementation of the
-OpenGL API). The relevant files from Mesa are already included in the
-XFree86/DRI source tree. There is no need to download or install the Mesa
-source files separately.
-
-Sometimes a newer version of Mesa will be available than the version included
-in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor-
-ward. It can be an error-prone undertaking, especially for beginners, and is
-not generally recommended. The DRI developers will upgrade Mesa when appro-
-priate.
-
-8. Compiling the XFree86/DRI tree
-
-8.1 Make a build tree
-
-Rather than placing object files and library files right in the source tree,
-they're instead put into a parallel build tree. The build tree is made with
-the lndir command:
-
- cd ~/DRI-CVS
- ln -s xc XFree40
- mkdir build
- cd build
- lndir -silent -ignorelinks ../XFree40
-
-The build tree will be populated with symbolic links which point back into
-the CVS source tree.
-
-Advanced users may have several build trees for compiling and testing with
-different options.
-
-8.2 Edit the host.def file
-
-The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the
-XFree86 build process. You can change it to customize your build options or
-make adjustments for your particular system configuration
-
-The default host.def file will look something like this:
-
- #define DefaultCCOptions -Wall
- (i386) #define DefaultGcc2i386Opt -O2
- (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
- #define LibraryCDebugFlags -O2
- #define BuildServersOnly YES
- #define XF86CardDrivers vga tdfx mga ati i810
- #define LinuxDistribution LinuxRedHat
- #define DefaultCCOptions -ansi GccWarningOptions -pipe
- #define BuildXF86DRI YES
- /* Optionally turn these on for debugging */
- /* #define GlxBuiltInTdfx YES */
- /* #define GlxBuiltInMga YES */
- /* #define GlxBuiltInR128 YES */
- /* #define GlxBuiltInRadeon YES */
- /* #define DoLoadableServer NO */
- #define SharedLibFont NO
-
-The ProjectRoot variable specifies where the XFree86 files will be installed.
-We recommend installing the DRI files over your existing XFree86 installation
-- it's generally safe to do and less error-prone. This policy is different
-than what we used to recommend.
-
-If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow-
-ing to the host.def file:
-
- #define ProjectRoot pathToYourXFree86installation
-
-Note the XF86CardDrivers line to be sure your card's driver is listed.
-
-If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you
-should add the following:
-
- #define MesaUse3DNow YES
-
-You don't have to be using an AMD processor in order to enable this option.
-The DRI will look for 3DNow! support and runtime and only enable it if appli-
-cable.
-
-If you want to enable SSE optimizations in Mesa and the DRI drivers, you must
-upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by
-both your processor and your operating system, but to build Mesa inside the
-DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If
-you enable SSE optimizations with an earlier version of the Linux kernel in
-/usr/src/linux, Mesa will not compile. You have been warned. If you do have
-a 2.4.x kernel, you should add the following:
-
- #define MesaUseSSE YES
-
-If you want to build the DRM kernel modules as part of the full build pro-
-cess, add the following:
-
- #define BuildXF86DRM YES
-
-Otherwise, you'll need to build them separately as described below.
-
-8.3 Compilation
-
-To compile the complete DRI tree:
-
- cd ~/DRI-CVS/build/xc/
- make World >& world.log
-
-Or if you want to watch the compilation progress:
-
- cd ~/DRI-CVS/build/xc/
- make World >& world.log &
- tail -f world.log
-
-With the default compilation flags it's normal to get a lot of warnings dur-
-ing compilation.
-
-Building will take some time so you may want to go check your email or visit
-slashdot.
-
-WARNING: do not use the -j option with make. It's reported that it does not
-work with XFree86/DRI.
-
-8.4 Check for compilation errors
-
-Using your text editor, examine world.log for errors by searching for the
-pattern ***.
-
-After fixing the errors, run make World again. Later, you might just compile
-parts of the source tree but it's important that the whole tree will build
-first.
-
-If you edited your host.def file to enable automatic building of the DRI ker-
-nel module(s), verify that they were built:
-
- cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
- ls
-
-Otherwise, build them now by running
-
- cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
- make -f Makefile.linux
-
-For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you
-should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI
-Radeon, you should see radeon.o. For the Intel i810, you should see i810.o.
-
-If the DRI kernel module(s) failed to build you should verify that you're
-using the right version of the Linux kernel. The most recent kernels are not
-always supported.
-
-If your build machine is running a different version of the kernel than your
-target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel
-source tree. This can be fixed by explicitly setting the value of LINUXDIR.
-If the path to your kernel source is /usr/src/linux-2.4.x,
-
- cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
- make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x
-
-or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN-
-UXDIR line.
-
-8.5 DRI kernel module installation
-
-The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro-
-grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/.
-
-To load the appropriate DRM module in your running kernel you can either use
-ismod and restart your X server or copy the kernel module to /lib/mod-
-ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X
-server.
-
-Make sure you first unload any older DRI kernel modules that might be already
-loaded.
-
-Note that some DRM modules require that the agpgart module be loaded first.
-
-9. Normal Installation and Configuration
-
-Most users will want to install the new X server and use it in place of their
-old X server. This section explains how to do that.
-
-Developers, on the other hand, may just want to test the X server without
-actually installing it as their default server. If you want to do that, skip
-to the next section.
-
-9.1 Installation
-
-Here are the installation commands:
-
- su
- cd ~/DRI-CVS/build/xc
- make install
-
-9.2 Update the XF86Config File
-
-You may need to edit your XF86Config file to enable the DRI. The config file
-is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for
-details, but basically, you need to load the "glx" and "dri" modules and add
-a "DRI" section.
-
-On the DRI web site, in the resources section, you'll find example XF86Config
-files for a number of graphics cards. These configuration files also setup
-DRI options so it's highly recommended that you look at these examples.
-
-The XFree86 4.x server can generate a basic configuration file itself. Sim-
-ply do this:
-
- cd /usr/X11R6/bin
- ./XFree86 -configure
-
-A file named /root/XF86Config.new will be created. It should allow you to
-try your X server but you'll almost certainly have to edit it. For example,
-you should add HorizSync and VertRefresh options to the Monitor section and
-Modes options to the Screen section. Also, the ModulePath option in the
-Files section should be set to /usr/X11R6/lib/modules.
-
-9.3 Start the New X Server
-
-The new X server should be ready to use now. Start your X server in your
-usual manner. Often times the startx command is used:
-
- startx
-
-10. Testing the Server Without Installing It
-
-As mentioned at the start of section 9, developers may want to simply run the
-X server without installing it. This can save some time and allow you to
-keep a number of X servers available for testing.
-
-10.1 Configuration
-
-As described in the preceding section, you'll need to create a configuration
-file for the new server. Put the XF86Config file in your ~/DRI-
-CVS/build/xc/programs/Xserver directory.
-
-Be sure the ModulePath option in your XF86Config file is set correctly.
-
-10.2 A Startup Script
-
-A simple shell script can be used to start the X server. Here's an example.
-
- #!/bin/sh
- export DISPLAY=:0
- ./XFree86 -xf86config XF86Config & \
- sleep 2
- fvwm2 &
- xset b off
- xmodmap -e "clear mod4"
- xsetroot -solid "#00306f"
- xterm -geometry 80x40+0+0
-
-You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro-
-grams/Xserver directory.
-
-To test the server run the script:
-
- cd ~/DRI-CVS/build/xc/programs/Xserver
- ./start-dri
-
-For debugging, you may also want to capture the log messages printed by the
-server in a file. If you're using the C-shell:
-
- ./start-dri >& log
-
-11. Where To Go From Here
-
-At this point your X server should be up and running with hardware-acceler-
-ated direct rendering. Please read the DRI User Guide for information about
-trouble shooting and how to use the DRI-enabled X server for 3D applications.
-
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.20 dawes Exp $
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.17 2003/07/15 02:28:28 dawes Exp $
diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/devel/Registry
deleted file mode 100644
index 9c4111348..000000000
--- a/hw/xfree86/doc/devel/Registry
+++ /dev/null
@@ -1,410 +0,0 @@
-This is the XFree86 driver/module registry. To avoid name space clashes and
-to maintain some consistency between drivers the important name spaces are
-maintained here.
-
-1. Module Names.
-
-Each module is required to have a unique name. Registered names are:
-
-GLcore
-acecad
-afb
-apm
-ark
-ati
-atimisc
-bitmap
-bt8xx
-calcomp
-cfb
-cfb16
-cfb24
-cfb32
-chips
-cirrus
-citron
-cyrix
-dbe
-ddc
-digitaledge
-dmc
-dri
-drm
-dynapro
-elo2300
-elographics
-extmod
-fb
-fbdev
-fbdevhw
-fi12x6
-freetype
-glide
-glint
-glx
-hyperpen
-i128
-i2c
-i740
-i810
-imstt
-int10
-joystick
-keyboard
-layer
-magellan
-magictouch
-mfb
-mga
-microtouch
-mouse
-msp34xx
-mutouch
-neomagic
-newport
-nv
-pcidata
-penmount
-pex5
-r128
-radeon
-rac
-ramdac
-record
-rendition
-s3
-s3virge
-savage
-scanpci
-shadow
-shadowfb
-siliconmotion
-sis
-spaceorb
-speedo
-summa
-sunbw2
-suncg14
-suncg3
-suncg6
-sunffb
-sunleo
-suntcx
-tdfx
-tga
-trident
-tseng
-type1
-v4l
-vbe
-vesa
-vga
-vgahw
-vmware
-void
-wacom
-xaa
-xf1bpp
-xf24_32bpp
-xf4bpp
-xf8_16bpp
-xf8_32bpp
-xf8_32wid
-xie
-xtrap
-xtt
-
-2. External Module Object Symbols.
-
-Each module is required to use a unique prefix or prefixes for all of
-its externally visible symbols. They should be unique without regard to
-case. Registered prefixes are:
-
-ati
-bt8xx
-cfb
-chips
-fi12x6
-glide
-glint
-mfb
-mga
-msp34xx
-neo
-permedia
-tseng
-vga
-vgahw
-vmware
-xaa
-xf1bpp
-xf4bpp
-
-3. Chipset Names.
-
-Each video driver is required to use a unique set of chipset names. Case,
-white space and underscore characters are ignored when comparing chipset
-names. All names listed here are in lower case with all white space and
-underscores removed. Registered chipset names are:
-
-ati
-ativga
-ct64200
-ct64300
-ct65520
-ct65525
-ct65530
-ct65535
-ct65540
-ct65545
-ct65546
-ct65548
-ct65550
-ct65554
-ct65555
-ct68554
-ct69000
-et4000
-et4000w32
-et4000w32i
-et4000w32p
-et6000
-et6100
-generic
-ibmvga
-ibm8514
-mach32
-mach64
-mach8
-mga2064w
-mga1064sg
-mga2164w
-mga2164wagp
-neo2070
-neo2090
-neo2093
-neo2097
-neo2160
-neo2200
-tipm2
-vgawonder
-voodoo
-
-4. Option Names.
-
-Option names and their usage should be consistent between drivers.
-Case, white space and underscore characters are ignored when comparing
-option names. The prefix "no" may be added or removed from boolean
-option names. All names listed here are in their preferred user-visible
-form. Some registered option names are:
-
-Types are: B = boolean, O = set/unset (no value), I = integer, S = string,
- A = optional string, F = floating point number Q = frequency
-
-Scopes are: F = global flags, V = video driver, C = common (per screen),
- I = input drivers, X = XAA, Xv = Xv extension, M = misc.
-
-Names currently in use:
-
-Name Type Scope Description
-----------------------------------------------------------------------------
-AllowMouseOpenFail B F ignore mouse dev open failure
-AllowNonLocalModInDev B F allow non-local mod of input devs
-AllowNonLocalXvidtune B F allow non-local VidMode connections
-BlankTime I F Screen saver timeout (min)
-DisableModInDev B F disallow changing input devs
-DisableVidModeExtension B F disable VidMode extension
-DontVTSwitch B F disable Ctrl-Alt-Fn
-DontZap B F disable Ctrl-Alt-BS sequence
-DontZoom B F disable Ctrl-Alt-+/-
-NoTrapSignals B F don't trap signals
-OffTime I F Time before DPMS off mode active (min)
-PciProbe1 O F use PCI probe algorithm 1
-PciProbe2 O F use PCI probe algorithm 2
-PciForceConfig1 O F force PCI config type 1
-PciForceConfig2 O F force PCI config type 2
-Pixmap I F depth 24 pixmap size (24 or 32)
-StandbyTime I F Time before DPMS standby active (min)
-SuspendTime I F Time before DPMS suspend mode active (min)
-
-BackingStore B C Enable backing store
-DDC B C Enable/disable DDC
-DDC1 B C Enable/disable DDC1
-DDC2 B C Enable/disable DDC2
-DPMS O C Enable DPMS
-MTRR B C Enable/disable setting MTRRs
-
-BaudRate I I Serial port baud rate
-ButtonNumber I I Button number (for touch screen?)
-ButtonThreshold I I ??
-ClearDTR O I Clear serial port DTR
-ClearRTS O I Clear serial port RTS
-DataBits I I Serial port data bits
-DemandLoad O I ??
-Device S I Device file name
-DeviceName S I Input device name
-FlowControl S I Serial flow control ("xon", "none")
-HistorySize I I ??
-MaxX I I Maximum X coordinate
-MaxY I I Maximum Y coordinate
-MinX I I Minimum X coordinate
-MinY I I Minimum Y coordinate
-Parity S I Serial port parity ("odd", "even", "none")
-ReportDelay I I ??
-ReportingMode S I may be "raw" or "scaled"
-ScreenNumber I I Screen number (for touch screen)
-SendCoreEvents B I Send core events
-SendDragEvents B I Send drag events
-StopBits I I Serial port stop bits
-SwapXY B I Swap the X and Y axes
-UntouchDelay I I ??
-Vmin I I Tty VMIN
-Vtime I I Tty VTIME
-
-
-18BitBus B V ??
-8Plus16 B V Enable depth 8 + depth 16 with overlay
-8Plus24 B V Enable depth 8 + depth 24 with overlay
-BlockWrite B V Enable/disable block write
-ColorKey I V Set the color key for overlay modes
-CompositeSync B V Composite sync
-CRTDisplay B V Force display on CRT, not LCD
-CRTScreen B V Display on CRT, not LCD (Obsolete)
-EarlyRasPrecharge O V Early RAS pre-charge
-FastDRAM O V Fast DRAM
-FifoAggressive O V Aggressive FIFO setting
-FifoConservative O V Conservative FIFO setting
-FifoModerate O V Moderate FIFO setting
-FireGL3000 B V Card is Diamond FireGL3000
-FixPanelSize B V ??
-FPClock8 Q V Flat panel clock for 8bpp fb (MHz)
-FPClock16 Q V Flat panel clock for 16bpp fb (MHz)
-FPClock24 Q V Flat panel clock for 24bpp fb (MHz)
-FPClock32 Q V Flat panel clock for 32bpp fb (MHz)
-FPMVRAM O V Fast page mode VRAM
-FramebufferWC B V Enable/disable WC for the framebuffer
-GlideDevice I V Selects which Voodoo board to use
-HiBitHigh O V High clock bit default to set
-HiBitLow O V High clock bit default to cleared
-HWClocks B V Enable/disable HW clocks
-HWCursor B V Enable/disable HW cursor
-LateRasPrecharge O V Late RAS pre-charge
-Legend O V Card is Legend ET4000
-LCDCenter B V Enable/disable centering for LCD displays
-Linear B V Enable/disable linear framebuffer
-MCLK Q V Specify the current MCLK value (MHz)
-MedDRAM B V Medium speed DRAM
-MemCfg1 I V ??
-MemCfg2 I V ??
-MGASDRAM B V Mga card has SDRAM
-MMIO B V Enable/disable memory mapped I/O
-MMIOCache B V Enable/Disable MMIO cache
-MuxThreshold I V Multiplexing threshold (kHz)
-NoAccel B V Disable/enable acceleration
-NoClockChip B V ??
-NoStretch B V Disable/enable stretching for LCD displays
-OnAtExit B V Leave video signal on when exiting server
-OverclockMem B V Enable memory overclocking
-Overlay A V Enable multi-depth/overlay. An optional
- string "M,N" may be specified, where
- M, N are the depths.
-PanelDisplay B V Force display on LCD
-PciBurst B V Enable/disable PCI burst mode
-PciRetry B V Enable/disable PCI retries
-ProbeClocks B V Force probe for non-programmable clocks
-ReferenceClock Q V Clock generator reference frequency
-RGBbits I V Number of significant bits per rgb
-Rotate S V Rotate the virtual display (CW or CCW)
-SetLCDClk Q V Set LCD clock (MHz)
-SetMclk Q V Set Memory Clock (MHz)
-ShadowFB B V Enable shadow framebuffer layer
-ShowCache B V Enable viewing of offscreen memory
-ShowOverscan O V Set the overscan area to a visible colour
-SlowDRAM O V Slow DRAM
-SlowEDODRAM O V Slow EDO DRAM
-STN B V STN screen type (??)
-SWCursor B V Enable/disable SW cursor
-SuspendHack B V ??
-SyncOnGreen B V Enable/disable sync on green
-TurboQueue B V Enable/disable turbo queue
-UseFBDev B V Use the fbdev driver interface
-UseModeLine B V Use Modeline (??)
-W32Interleave B V ??
-
-Buffers I Xv Number of buffers
-Device S Xv Device file name
-Expose B Xv Disable occlusion clipping (see DESIGN)
-FramesPerSec I Xv Max. refresh frequency
-
-XAA options. All are of type "O" and scope "X", and are self-explanatory
-
-XaaNoColor8x8PatternFillRect
-XaaNoColor8x8PatternFillTrap
-XaaNoCPUToScreenColorExpandFill
-XaaNoDashedBresenhamLine
-XaaNoDashedTwoPointLine
-XaaNoScreenToScreenCopy
-XaaNoImageReadRect
-XaaNoImageWriteRect
-XaaNoMono8x8PatternFillRect
-XaaNoMono8x8PatternFillTrap
-XaaNoOffscreenPixmaps
-XaaNoPixmapCache
-XaaNoScanlineCPUToScreenColorExpandFill
-XaaNoScanlineImageWriteRect
-XaaNoScreenToScreenColorExpandFill
-XaaNoSolidBresenhamLine
-XaaNoSolidFillRect
-XaaNoSolidFillTrap
-XaaNoSolidHorVertLine
-XaaNoSolidTwoPointLine
-
-
-Names used in previous versions:
-
-16Clocks
-8Clocks
-ClkDiv2
-EDO VRAM
-ExternDisp
-ExtFramBuf
-FastVRAM
-FavorBitBlt
-InternDisp
-NoBitBlt
-NoFontCache
-NoImageBlt
-NoMemAccess
-NoPciDisconnect
-NoPixmapCache
-NoProgramClocks
-NoSplitXfer
-OverrideBIOS
-OverrideValidateMode
-ProgLcdModeRegs
-ProgLcdModeStretch
-SlowDRAMrefresh
-SlowVRAM
-SwapHiBit
-
-
-5. Ramdac Names.
-
-Ramdac names should be consistent between drivers. Case, white space
-and underscore characters are ignored when comparing ramdac names. All
-names listed here are in lower case with all white space and underscores
-removed.
-
-
-6. Clock Chip Names.
-
-Clock chip names should be consistent between drivers. Case, white
-space and underscore characters are ignored when comparing clock chip
-names. All names listed here are in lower case with all white space
-and underscores removed.
-
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.19 2003/02/20 04:05:12 dawes Exp $
diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml
deleted file mode 100644
index 365acaf1a..000000000
--- a/hw/xfree86/doc/sgml/DESIGN.sgml
+++ /dev/null
@@ -1,7417 +0,0 @@
-<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN" [
- <!-- config file keyword markup -->
- <!ENTITY s.key STARTTAG "bf">
- <!ENTITY e.key ENDTAG "bf">
- <!-- specific config file keywords -->
- <!ENTITY k.device "&s.key;Device&e.key;">
- <!ENTITY k.monitor "&s.key;Monitor&e.key;">
- <!ENTITY k.display "&s.key;Display&e.key;">
- <!ENTITY k.inputdevice "&s.key;InputDevice&e.key;">
- <!ENTITY k.screen "&s.key;Screen&e.key;">
- <!ENTITY k.serverlayout "&s.key;ServerLayout&e.key;">
- <!ENTITY k.driver "&s.key;Driver&e.key;">
- <!ENTITY k.module "&s.key;Module&e.key;">
- <!ENTITY k.identifier "&s.key;Identifier&e.key;">
- <!ENTITY k.serverflags "&s.key;ServerFlags&e.key;">
- <!-- command line markup -->
- <!ENTITY s.cmd STARTTAG "tt">
- <!ENTITY e.cmd ENDTAG "tt">
- <!-- inline code markup -->
- <!ENTITY s.code STARTTAG "tt">
- <!ENTITY e.code ENDTAG "tt">
- <!-- function indent -->
- <!ENTITY f.indent "&nl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp">
-] >
-
-<article>
-
-<title>XFree86 X server ``New Design'' (DRAFT)
-<author>The XFree86 Project, Inc
-<date>Last modified 2003 January 22
-
-
-
-
-
-
-
-<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.53 2003/08/23 14:10:14 dawes Exp $
-</ident>
-
-
-<p>
-<bf>NOTE</bf>: This is a DRAFT document, and the interfaces described here
-are subject to change without notice.
-
-
-<sect>Preface
-<p>
-
-The broad design principles are:
-<itemize>
- <item>keep it reasonable
- <itemize>
- <item>We cannot rewrite the complete server
- <item>We don't want to re-invent the wheel
- </itemize>
- <item>keep it modular
- <itemize>
- <item>As many things as possible should go into modules
- <item>The basic loader binary should be minimal
- <item>A clean design with well defined layering is important
- <item>DDX specific global variables are a nono
- <item>The structure should be flexible enough to allow
- future extensions
- <item> The structure should minimize duplication of common code
- </itemize>
- <item>keep important features in mind
- <itemize>
- <item>multiple screens, including multiple instances of drivers
- <item>mixing different color depths and visuals on different
- and ideally even on the same screen
- <item>better control of the PCI device used
- <item>better config file parser
- <item>get rid of all VGA compatibility assumptions
- </itemize>
-</itemize>
-
-Unless we find major deficiencies in the DIX layer, we should avoid
-making changes there.
-
-<sect>The XF86Config File
-<p>
-
-The XF86Config file format is similar to the old format, with the following
-changes:
-
-<sect1>&k.device; section
-<p>
-
- The &k.device; sections are similar to what they used to be, and
- describe hardware-specific information for a single video card.
- &k.device;
- Some new keywords are added:
-
-
- <descrip>
- <tag>Driver "drivername"</tag>
- Specifies the name of the driver to be used for the card. This
- is mandatory.
- <tag>BusID "busslot"</tag>
- Specifies uniquely the location of the card on the bus. The
- purpose is to identify particular cards in a multi-headed
- configuration. The format of the argument is intentionally
- vague, and may be architecture dependent. For a PCI bus, it
- is something like "bus:slot:func".
- </descrip>
-
- A &k.device; section is considered ``active'' if there is a reference
- to it in an active &k.screen; section.
-
-<sect1>&k.screen; section
-<p>
-
- The &k.screen; sections are similar to what they used to be. They
- no longer have a &k.driver; keyword, but an &k.identifier; keyword
- is added. (The &k.driver; keyword may be accepted in place of the
- &k.identifier; keyword for compatibility purposes.) The identifier
- can be used to identify which screen is to be active when multiple
- &k.screen sections are present. It is possible to specify the active
- screen from the command line. A default is chosen in the absence
- of one being specified. A &k.screen; section is considered ``active''
- if there is a reference to it either from the command line, or from
- an active &k.serverlayout; section.
-
-<sect1>&k.inputdevice; section
-<p>
-
- The &k.inputdevice; section is a new section that describes
- configuration information for input devices. It replaces the old
- &s.key;Keyboard&e.key;, &s.key;Pointer&e.key; and &s.key;XInput&e.key;
- sections. Like the &k.device; section, it has two mandatory keywords:
- &k.identifier; and &k.driver;. For compatibility purposes the old
- &s.key;Keyboard&e.key; and &s.key;Pointer&e.key; sections are
- converted by the parser into &k.inputdevice; sections as follows:
-
- <descrip>
- <tag>&s.key;Keyboard&e.key;</tag>
- &k.identifier; "Implicit Core Keyboard"<newline>
- &k.driver; "keyboard"
- <tag>&s.key;Pointer&e.key;</tag>
- &k.identifier; "Implicit Core Pointer"<newline>
- &k.driver; "mouse"
- </descrip>
-
- An &k.inputdevice; section is considered active if there is a
- reference to it in an active &k.serverlayout; section. An
- &k.inputdevice; section may also be referenced implicitly if there
- is no &k.serverlayout; section, if the &s.cmd;-screen&e.cmd; command
- line options is used, or if the &k.serverlayout; section doesn't
- reference any &k.inputdevice; sections. In this case, the first
- sections with drivers "keyboard" and "mouse" are used as the core
- keyboard and pointer respectively.
-
-<sect1>&k.serverlayout; section
-<p>
-
- The &k.serverlayout; section is a new section that is used to identify
- which &k.screen; sections are to be used in a multi-headed configuration,
- and the relative layout of those screens. It also identifies which
- &k.inputdevice; sections are to be used. Each &k.serverlayout section
- has an identifier, a list of &k.screen; section identifiers, and a list of
- &k.inputdevice; section identifiers. &k.serverflags; options may also be
- included in a &k.serverlayout; section, making it possible to override
- the global values in the &k.serverflags; section.
-
- A &k.serverlayout; section can be made active by being referenced on
- the command line. In the absence of this, a default will be chosen
- (the first one found). The screen names may optionally be followed
- by a number specifying the preferred screen number, and optionally
- by information specifying the physical positioning of the screen,
- either in absolute terms or relative to another screen (or screens).
- When no screen number is specified, they are numbered according to
- the order in which they are listed. The old (now obsolete) method
- of providing the positioning information is to give the names of
- the four adjacent screens. The order of these is top, bottom, left,
- right. Here is an example of a &k.serverlayout; section for two
- screens using the old method, with the second located to the right
- of the first:
-
- <code>
- Section "ServerLayout"
- Identifier "Main Layout"
- Screen 0 "Screen 1" "" "" "" "Screen 2"
- Screen 1 "Screen 2"
- Screen "Screen 3"
- EndSection
- </code>
-
- The preferred way of specifying the layout is to explicitly specify
- the screen's location in absolute terms or relative to another
- screen.
-
- In the absolute case, the upper left corner's coordinates are given
- after the &s.key;Absolute&e.key; keyword. If the coordinates are
- omitted, a value of &s.code;(0,0)&e.code; is assumed. An example
- of absolute positioning follows:
-
- <code>
- Section "ServerLayout"
- Identifier "Main Layout"
- Screen 0 "Screen 1" Absolute 0 0
- Screen 1 "Screen 2" Absolute 1024 0
- Screen "Screen 3" Absolute 2048 0
- EndSection
- </code>
-
- In the relative case, the position is specified by either using one of
- the following keywords followed by the name of the reference screen:
-
- <quote>
- &s.key;RightOf&nl;
- LeftOf&nl;
- Above&nl;
- Below&nl;
- Relative&e.key;
- </quote>
-
- When the &s.key;Relative&e.key; keyword is used, the reference screen
- name is followed by the coordinates of the new screen's origin
- relative to reference screen. The following example shows how to use
- some of the relative positioning options.
-
- <code>
- Section "ServerLayout"
- Identifier "Main Layout"
- Screen 0 "Screen 1"
- Screen 1 "Screen 2" RightOf "Screen 1"
- Screen "Screen 3" Relative "Screen 1" 2048 0
- EndSection
- </code>
-
-<sect1>Options
-<p>
-
- Options are used more extensively. They may appear in most sections
- now. Options related to drivers can be present in the &k.screen;,
- &k.device; and &k.monitor; sections and the &k.display; subsections.
- The order of precedence is &k.display;, &k.screen;, &k.monitor;,
- &k.device;. Options have been extended to allow an optional value
- to be specified in addition to the option name. For more details
- about options, see the <ref id="options" name="Options"> section
- for details.
-
-<sect>Driver Interface
-<p>
-
-The driver interface consists of a minimal set of entry points that are
-required based on the external events that the driver must react to.
-No non-essential structure is imposed on the way they are used beyond
-that. This is a significant difference compared with the old design.
-
-The entry points for drawing operations are already taken care of by
-the framebuffer code (including, XAA). Extensions and enhancements to
-framebuffer code are outside the scope of this document.
-
-This approach to the driver interface provides good flexibility, but does
-increase the complexity of drivers. To help address this, the XFree86
-common layer provides a set of ``helper'' functions to take care of things
-that most drivers need. These helpers help minimise the amount of code
-duplication between drivers. The use of helper functions by drivers is
-however optional, though encouraged. The basic philosophy behind the
-helper functions is that they should be useful to many drivers, that
-they should balance this against the complexity of their interface. It
-is inevitable that some drivers may find some helpers unsuitable and
-need to provide their own code.
-
-Events that a driver needs to react to are:
-
- <descrip>
- <tag>ScreenInit</tag>
-
- An initialisation function is called from the DIX layer for each
- screen at the start of each server generation.
-
- <tag>Enter VT</tag>
-
- The server takes control of the console.
-
- <tag>Leave VT</tag>
-
- The server releases control of the console.
-
- <tag>Mode Switch</tag>
-
- Change video mode.
-
- <tag>ViewPort change</tag>
-
- Change the origin of the physical view port.
-
- <tag>ScreenSaver state change</tag>
-
- Screen saver activation/deactivation.
-
- <tag>CloseScreen</tag>
-
- A close screen function is called from the DIX layer for each screen
- at the end of each server generation.
- </descrip>
-
-
-In addition to these events, the following functions are required by
-the XFree86 common layer:
-
- <descrip>
- <tag>Identify</tag>
-
- Print a driver identifying message.
-
- <tag>Probe</tag>
-
- This is how a driver identifies if there is any hardware present that
- it knows how to drive.
-
- <tag>PreInit</tag>
-
- Process information from the XF86Config file, determine the
- full characteristics of the hardware, and determine if a valid
- configuration is present.
- </descrip>
-
-The VidMode extension also requires:
-
- <descrip>
- <tag>ValidMode</tag>
-
- Identify if a new mode is usable with the current configuration.
- The PreInit function (and/or helpers it calls) may also make use
- of the ValidMode function or something similar.
- </descrip>
-
-
-Other extensions may require other entry points. The drivers will
-inform the common layer of these in such cases.
-
-<sect>Resource Access Control Introduction
-<p>
-
-Graphics devices are accessed through ranges in I/O or memory space.
-While most modern graphics devices allow relocation of such ranges many
-of them still require the use of well established interfaces such as
-VGA memory and IO ranges or 8514/A IO ranges. With modern buses (like
-PCI) it is possible for multiple video devices to share access to these
-resources. The RAC (Resource Access Control) subsystem provides a
-mechanism for this.
-
-<sect1>Terms and Definitions
-<p>
-
-<sect2>Bus
-<p>
-
- ``Bus'' is ambiguous as it is used for different things: it may refer
- to physical incompatible extension connectors in a computer system.
- The RAC system knows two such systems: The ISA bus and the PCI bus.
- (On the software level EISA, MCA and VL buses are currently treated
- like ISA buses). ``Bus'' may also refer to logically different
- entities on a single bus system which are connected via bridges. A
- PCI system may have several distinct PCI buses connecting each other
- by PCI-PCI bridges or to the host CPU by HOST-PCI bridges.
-
- Systems that host more than one bus system link these together using
- bridges. Bridges are a concern to RAC as they might block or pass
- specific resources. PCI-PCI bridges may be set up to pass VGA
- resources to the secondary bus. PCI-ISA buses pass any resources not
- decoded on the primary PCI bus to the ISA bus. This way VGA resources
- (although exclusive on the ISA bus) can be shared by ISA and PCI
- cards. Currently HOST-PCI bridges are not yet handled by RAC as they
- require specific drivers.
-
-<sect2>Entity
-<p>
-
- The smallest independently addressable unit on a system bus is
- referred to as an entity. So far we know ISA and PCI entities. PCI
- entities can be located on the PCI bus by an unique ID consisting of
- the bus, card and function number.
-
-<sect2>Resource
-<p>
-
- ``Resource'' refers to a range of memory or I/O addresses an entity
- can decode.
-
- If a device is capable of disabling this decoding the resource is
- called sharable. For PCI devices a generic method is provided to
- control resource decoding. Other devices will have to provide a
- device specific function to control decoding.
-
- If the entity is capable of decoding this range at a different
- location this resource is considered relocatable.
-
- Resources which start at a specific address and occupy a single
- continuous range are called block resources.
-
- Alternatively resource addresses can be decoded in a way that they
- satisfy the conditions:
- <quote><verb>
- address & mask == base
- </verb></quote>
- and
- <quote><verb>
- base & mask == base
- </verb></quote>
- Resources addressed in such a way are called sparse resources.
-
-<sect2>Server States
-<p>
-
- The resource access control system knows two server states: the
- SETUP and the OPERATING state. The SETUP state is entered whenever
- a mode change takes place or the server exits or does VT switching.
- During this state all entity resources are under resource access
- control. During OPERATING state only those entities are controlled
- which actually have shared resources that conflict with others.
-
-<sect>Control Flow in the Server and Mandatory Driver Functions
-<p>
-
-At the start of each server generation, &s.code;main()&e.code;
-(&s.code;dix/main.c&e.code;) calls the DDX function
-&s.code;InitOutput()&e.code;. This is the first place that the DDX gets
-control. &s.code;InitOutput()&e.code; is expected to fill in the global
-&s.code;screenInfo&e.code; struct, and one
-&s.code;screenInfo.screen[]&e.code; entry for each screen present. Here
-is what &s.code;InitOutput()&e.code; does:
-
-<sect1>Parse the XF86Config file
-<p>
-
- This is done at the start of the first server generation only.
-
- The XF86Config file is read in full, and the resulting information
- stored in data structures. None of the parsed information is
- processed at this point. The parser data structures are opaque to
- the video drivers and to most of the common layer code.
-
- The entire file is parsed first to remove any section ordering
- requirements.
-
-
-<sect1>Initial processing of parsed information and command line options
-<p>
-
- This is done at the start of the first server generation only.
-
- The initial processing is to determine paths like the
- &s.key;ModulePath&e.key;, etc, and to determine which &k.serverlayout;,
- &k.screen; and &k.device; sections are active.
-
-
-<sect1>Enable port I/O access
-<p>
-
- Port I/O access is controlled from the XFree86 common layer, and is
- ``all or nothing''. It is enabled prior to calling driver probes, at
- the start of subsequent server generations, and when VT switching
- back to the Xserver. It is disabled at the end of server generations,
- and when VT switching away from the Xserver.
-
- The implementation details of this may vary on different platforms.
-
-
-<sect1>General bus probe
-<p>
-
- This is done at the start of the first server generation only.
-
- In the case of ix86 machines, this will be a general PCI probe.
- The full information obtained here will be available to the drivers.
- This information persists for the life of the Xserver. In the PCI
- case, the PCI information for all video cards found is available by
- calling &s.code;xf86GetPciVideoInfo()&e.code;.
-
- <quote>
- &s.code;pciVideoPtr *xf86GetPciVideoInfo(void)&e.code;
- <quote><p>
- returns a pointer to a list of pointers to
- &s.code;pciVideoRec&e.code; entries, of which there is one for
- each detected PCI video card. The list is terminated with a
- &s.code;NULL&e.code; pointer. If no PCI video cards were
- detected, the return value is &s.code;NULL&e.code;.
-
- </quote>
- </quote>
-
- After the bus probe, the resource broker is initialised.
-
-
-<sect1>Load initial set of modules
-<p>
-
- This is done at the start of the first server generation only.
-
- The core server contains a list of mandatory modules. These are loaded
- first. Currently the only module on this list is the bitmap font module.
-
- The next set of modules loaded are those specified explicitly in the
- &k.module; section of the config file.
-
- The final set of initial modules are the driver modules referenced
- by the active &k.device; and &k.inputdevice; sections in the config
- file. Each of these modules is loaded exactly once.
-
-
-<sect1>Register Video and Input Drivers
-<p>
-
- This is done at the start of the first server generation only.
-
- When a driver module is loaded, the loader calls its
- &s.code;Setup&e.code; function. For video drivers, this function
- calls &s.code;xf86AddDriver()&e.code; to register the driver's
- &s.code;DriverRec&e.code;, which contains a small set of essential
- details and driver entry points required during the early phase of
- &s.code;InitOutput()&e.code;. &s.code;xf86AddDriver()&e.code; adds
- it to the global &s.code;xf86DriverList[]&e.code; array.
-
- The &s.code;DriverRec&e.code; contains the driver canonical name,
- the &s.code;Identify()&e.code;,
- &s.code;Probe()&e.code; and &s.code;AvailableOptions()&e.code;
- function entry points as well as a pointer
- to the driver's module (as returned from the loader when the driver
- was loaded) and a reference count which keeps track of how many
- screens are using the driver. The entry driver entry points are
- those required prior to the driver allocating and filling in its
- &s.code;ScrnInfoRec&e.code;.
-
- For a static server, the &s.code;xf86DriverList[]&e.code; array is
- initialised at build time, and the loading of modules is not done.
-
- A similar procedure is used for input drivers. The input driver's
- &s.code;Setup&e.code; function calls
- &s.code;xf86AddInputDriver()&e.code; to register the driver's
- &s.code;InputDriverRec&e.code;, which contains a small set of
- essential details and driver entry points required during the early
- phase of &s.code;InitInput()&e.code;.
- &s.code;xf86AddInputDriver()&e.code; adds it to the global
- &s.code;xf86InputDriverList[]&e.code; array. For a static server,
- the &s.code;xf86InputDriverList[]&e.code; array is initialised at
- build time.
-
- Both the &s.code;xf86DriverList[]&e.code; and
- &s.code;xf86InputDriverList[]&e.code; arrays have been initialised
- by the end of this stage.
-
- Once all the drivers are registered, their
- &s.code;ChipIdentify()&e.code; functions are called.
-
- <quote>
- &s.code;void ChipIdentify(int flags)&e.code;
- <quote>
- This is expected to print a message indicating the driver name,
- a short summary of what it supports, and a list of the chipset
- names that it supports. It may use the xf86PrintChipsets() helper
- to do this.
- </quote>
- </quote>
-
- <quote>
- &s.code;void xf86PrintChipsets(const char *drvname, const char *drvmsg,
- &f.indent;SymTabPtr chips)&e.code;
- <quote>
- This function provides an easy way for a driver's ChipIdentify
- function to format the identification message.
- </quote>
- </quote>
-
-<sect1>Initialise Access Control
-<p>
-
- This is done at the start of the first server generation only.
-
- The Resource Access Control (RAC) subsystem is initialised before
- calling any driver functions that may access hardware. All generic
- bus information is probed and saved (for restoration later). All
- (shared resource) video devices are disabled at the generic bus
- level, and a probe is done to find the ``primary'' video device. These
- devices remain disabled for the next step.
-
-
-<sect1>Video Driver Probe<label id="probe">
-<p>
- This is done at the start of the first server generation only. The
- &s.code;ChipProbe()&e.code; function of each registered video driver
- is called.
-
- <quote><p>
- &s.code;Bool ChipProbe(DriverPtr drv, int flags)&e.code;
- <quote><p>
- The purpose of this is to identify all instances of hardware
- supported by the driver. The flags value is currently either 0,
- &s.code;PROBE_DEFAULT&e.code; or &s.code;PROBE_DETECT&e.code;.
- &s.code;PROBE_DETECT&e.code; is used if "-configure" or "-probe"
- command line arguments are given and indicates to the
- &s.code;Probe()&e.code; function that it should not configure the
- bus entities and that no XF86Config information is available.
-
- The probe must find the active device sections that match the
- driver by calling &s.code;xf86MatchDevice()&e.code;. The number
- of matches found limits the maximum number of instances for this
- driver. If no matches are found, the function should return
- &s.code;FALSE&e.code; immediately.
-
- Devices that cannot be identified by using device-independent
- methods should be probed at this stage (keeping in mind that access
- to all resources that can be disabled in a device-independent way
- are disabled during this phase). The probe must be a minimal
- probe. It should just determine if there is a card present that
- the driver can drive. It should use the least intrusive probe
- methods possible. It must not do anything that is not essential,
- like probing for other details such as the amount of memory
- installed, etc. It is recommended that the
- &s.code;xf86MatchPciInstances()&e.code; helper function be used
- for identifying matching PCI devices, and similarly the
- &s.code;xf86MatchIsaInstances()&e.code; for ISA (non-PCI) devices
- (see the <ref id="rac" name="RAC"> section). These helpers also
- checks and claims the appropriate entity. When not using the
- helper, that should be done with &s.code;xf86CheckPciSlot()&e.code;
- and &s.code;xf86ClaimPciSlot()&e.code; for PCI devices and
- &s.code;xf86ClaimIsaSlot()&e.code; for ISA devices (see the
- <ref id="rac" name="RAC"> section).
-
- The probe must register all non-relocatable resources at this
- stage. If a resource conflict is found between exclusive resources
- the driver will fail immediately. This is usually best done with
- the &s.code;xf86ConfigPciEntity()&e.code; helper function
- for PCI and &s.code;xf86ConfigIsaEntity()&e.code; for ISA
- (see the <ref id="rac" name="RAC"> section). It is possible to
- register some entity specific functions with those helpers. When
- not using the helpers, the &s.code;xf86AddEntityToScreen()&e.code;
- &s.code;xf86ClaimFixedResources()&e.code; and
- &s.code;xf86SetEntityFuncs()&e.code; should be used instead (see
- the <ref id="rac" name="RAC"> section).
-
- If a chipset is specified in an active device section which the
- driver considers relevant (ie it has no driver specified, or the
- driver specified matches the driver doing the probe), the Probe
- must return &s.code;FALSE&e.code; if the chipset doesn't match
- one supported by the driver.
-
- If there are no active device sections that the driver considers
- relevant, it must return &s.code;FALSE&e.code;.
-
- Allocate a &s.code;ScrnInfoRec&e.code; for each active instance of the
- hardware found, and fill in the basic information, including the
- other driver entry points. This is best done with the
- &s.code;xf86ConfigIsaEntity()&e.code; helper function for ISA
- instances or &s.code;xf86ConfigPciEntity()&e.code; for PCI instances.
- These functions allocate a &s.code;ScrnInfoRec&e.code; for active
- entities. Optionally &s.code;xf86AllocateScreen()&e.code;
- function may also be used to allocate the &s.code;ScrnInfoRec&e.code;.
- Any of these functions take care of initialising fields to defined
- ``unused'' values.
-
- Claim the entities for each instance of the hardware found. This
- prevents other drivers from claiming the same hardware.
-
- Must leave hardware in the same state it found it in, and must not
- do any hardware initialisation.
-
- All detection can be overridden via the config file, and that
- parsed information is available to the driver at this stage.
-
- Returns &s.code;TRUE&e.code; if one or more instances are found,
- and &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;int xf86MatchDevice(const char *drivername,
- &f.indent;GDevPtr **driversectlist)&e.code;
- <quote><p>
-
- This function takes the name of the driver and returns via
- &s.code;driversectlist&e.code; a list of device sections that
- match the driver name. The function return value is the number
- of matches found. If a fatal error is encountered the return
- value is &s.code;-1&e.code;.
-
- The caller should use &s.code;xfree()&e.code; to free
- &s.code;*driversectlist&e.code; when it is no longer needed.
-
- </quote>
-
- &s.code;ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags)&e.code;
- <quote><p>
- This function allocates a new &s.code;ScrnInfoRec&e.code; in the
- &s.code;xf86Screens[]&e.code; array. This function is normally
- called by the video driver &s.code;ChipProbe()&e.code; functions.
- The return value is a pointer to the newly allocated
- &s.code;ScrnInfoRec&e.code;. The &s.code;scrnIndex&e.code;,
- &s.code;origIndex&e.code;, &s.code;module&e.code; and
- &s.code;drv&e.code; fields are initialised. The reference count
- in &s.code;drv&e.code; is incremented. The storage for any
- currently allocated ``privates'' pointers is also allocated and
- the &s.code;privates&e.code; field initialised (the privates data
- is of course not allocated or initialised). This function never
- returns on failure. If the allocation fails, the server exits
- with a fatal error. The flags value is not currently used, and
- should be set to zero.
- </quote>
- </quote>
-
- At the completion of this, a list of &s.code;ScrnInfoRecs&e.code;
- have been allocated in the &s.code;xf86Screens[]&e.code; array, and
- the associated entities and fixed resources have been claimed. The
- following &s.code;ScrnInfoRec&e.code; fields must be initialised at
- this point:
-
- <quote><verb>
- driverVersion
- driverName
- scrnIndex(*)
- origIndex(*)
- drv(*)
- module(*)
- name
- Probe
- PreInit
- ScreenInit
- EnterVT
- LeaveVT
- numEntities
- entityList
- access
- </verb></quote>
-
- <tt>(*)</tt> These are initialised when the &s.code;ScrnInfoRec&e.code;
- is allocated, and not explicitly by the driver.
-
- The following &s.code;ScrnInfoRec&e.code; fields must be initialised
- if the driver is going to use them:
-
- <quote><verb>
- SwitchMode
- AdjustFrame
- FreeScreen
- ValidMode
- </verb></quote>
-
-<sect1>Matching Screens
-<p>
-
- This is done at the start of the first server generation only.
-
- After the Probe phase is finished, there will be some number of
- &s.code;ScrnInfoRecs&e.code;. These are then matched with the active
- &k.screen; sections in the XF86Config, and those not having an active
- &k.screen; section are deleted. If the number of remaining screens
- is 0, &s.code;InitOutput()&e.code; sets
- &s.code;screenInfo.numScreens&e.code; to &s.code;0&e.code; and
- returns.
-
- At this point the following fields of the &s.code;ScrnInfoRecs&e.code;
- must be initialised:
-
- <quote><verb>
- confScreen
- </verb></quote>
-
-
-<sect1>Allocate non-conflicting resources
-<p>
-
- This is done at the start of the first server generation only.
-
- Before calling the drivers again, the resource information collected
- from the Probe phase is processed. This includes checking the extent
- of PCI resources for the probed devices, and resolving any conflicts
- in the relocatable PCI resources. It also reports conflicts, checks
- bus routing issues, and anything else that is needed to enable the
- entities for the next phase.
-
- If any drivers registered an &s.code;EntityInit()&e.code; function
- during the Probe phase, then they are called here.
-
-
-<sect1>Sort the Screens and pre-check Monitor Information
-<p>
-
- This is done at the start of the first server generation only.
-
- The list of screens is sorted to match the ordering requested in the
- config file.
-
- The list of modes for each active monitor is checked against the
- monitor's parameters. Invalid modes are pruned.
-
-
-<sect1>PreInit
-<p>
-
- This is done at the start of the first server generation only.
-
- For each &s.code;ScrnInfoRec&e.code;, enable access to the screens entities and call
- the &s.code;ChipPreInit()&e.code; function.
-
- <quote><p>
- &s.code;Bool ChipPreInit(ScrnInfoRec screen, int flags)&e.code;
- <quote><p>
- The purpose of this function is to find out all the information
- required to determine if the configuration is usable, and to
- initialise those parts of the &s.code;ScrnInfoRec&e.code; that
- can be set once at the beginning of the first server generation.
-
- The number of entities registered for the screen should be checked
- against the expected number (most drivers expect only one). The
- entity information for each of them should be retrieved (with
- &s.code;xf86GetEntityInfo()&e.code;) and checked for the correct
- bus type and that none of the sharable resources registered during
- the Probe phase was rejected.
-
- Access to resources for the entities that can be controlled in a
- device-independent way are enabled before this function is called.
- If the driver needs to access any resources that it has disabled
- in an &s.code;EntityInit()&e.code; function that it registered,
- then it may enable them here providing that it disables them before
- this function returns.
-
- This includes probing for video memory, clocks, ramdac, and all
- other HW info that is needed. It includes determining the
- depth/bpp/visual and related info. It includes validating and
- determining the set of video modes that will be used (and anything
- that is required to determine that).
-
- This information should be determined in the least intrusive way
- possible. The state of the HW must remain unchanged by this
- function. Although video memory (including MMIO) may be mapped
- within this function, it must be unmapped before returning. Driver
- specific information should be stored in a structure hooked into
- the &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code;
- field. Any other modules which require persistent data (ie data
- that persists across server generations) should be initialised in
- this function, and they should allocate a ``privates'' index to
- hook their data into by calling
- &s.code;xf86AllocateScrnInfoPrivateIndex().&e.code; The ``privates''
- data is persistent.
-
- Helper functions for some of these things are provided at the
- XFree86 common level, and the driver can choose to make use of
- them.
-
- All additional resources that the screen needs must be registered
- here. This should be done with
- &s.code;xf86RegisterResources()&e.code;. If some of the fixed
- resources registered in the Probe phase are not needed or not
- decoded by the hardware when in the OPERATING server state, their
- status should be updated with
- &s.code;xf86SetOperatingState()&e.code;.
-
- Modules may be loaded at any point in this function, and all
- modules that the driver will need must be loaded before the end
- of this function. Either the &s.code;xf86LoadSubModule()&e.code;
- or the &s.code;xf86LoadDrvSubModule()&e.code; function should be
- used to load modules depending on whether a
- &s.code;ScrnInfoRec&e.code; has been set up. A driver may unload
- a module within this function if it was only needed temporarily,
- and the &s.code;xf86UnloadSubModule()&e.code; function should be used
- to do that. Otherwise there is no need to explicitly unload modules
- because the loader takes care of module dependencies and will
- unload submodules automatically if/when the driver module is
- unloaded.
-
- The bulk of the &s.code;ScrnInfoRec&e.code; fields should be filled
- out in this function.
-
- &s.code;ChipPreInit()&e.code; returns &s.code;FALSE&e.code; when
- the configuration is unusable in some way (unsupported depth, no
- valid modes, not enough video memory, etc), and &s.code;TRUE&e.code;
- if it is usable.
-
- It is expected that if the &s.code;ChipPreInit()&e.code; function
- returns &s.code;TRUE&e.code;, then the only reasons that subsequent
- stages in the driver might fail are lack or resources (like xalloc
- failures). All other possible reasons for failure should be
- determined by the &s.code;ChipPreInit()&e.code; function.
-
- </quote>
- </quote>
-
- The &s.code;ScrnInfoRecs&e.code; for screens where the &s.code;ChipPreInit()&e.code; fails are removed.
- If none remain, &s.code;InitOutput()&e.code; sets &s.code;screenInfo.numScreens&e.code; to &s.code;0&e.code; and returns.
-
- At this point, further fields of the &s.code;ScrnInfoRecs&e.code; would normally be
- filled in. Most are not strictly mandatory, but many are required
- by other layers and/or helper functions that the driver may choose
- to use. The documentation for those layers and helper functions
- indicates which they require.
-
- The following fields of the &s.code;ScrnInfoRecs&e.code; should be filled in if the
- driver is going to use them:
-
- <quote><verb>
- monitor
- display
- depth
- pixmapBPP
- bitsPerPixel
- weight (>8bpp only)
- mask (>8bpp only)
- offset (>8bpp only)
- rgbBits (8bpp only)
- gamma
- defaultVisual
- maxHValue
- maxVValue
- virtualX
- virtualY
- displayWidth
- frameX0
- frameY0
- frameX1
- frameY1
- zoomLocked
- modePool
- modes
- currentMode
- progClock (TRUE if clock is programmable)
- chipset
- ramdac
- clockchip
- numClocks (if not programmable)
- clock[] (if not programmable)
- videoRam
- biosBase
- memBase
- memClk
- driverPrivate
- chipID
- chipRev
- </verb></quote>
-
- <quote><p>
- &s.code;pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)&e.code:
- and
- &s.code;pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name)&e.code:
- <quote><p>
- Load a module that a driver depends on. This function loads the
- module &s.code;name&e.code; as a sub module of the driver. The
- return value is a handle identifying the new module. If the load
- fails, the return value will be &s.code;NULL&e.code;. If a driver
- needs to explicitly unload a module it has loaded in this way,
- the return value must be saved and passed to
- &s.code;xf86UnloadSubModule()&e.code; when unloading.
-
- </quote>
-
- &s.code;void xf86UnloadSubModule(pointer module)&e.code;
- <quote><p>
- Unloads the module referenced by &s.code;module&e.code;.
- &s.code;module&e.code; should be a pointer returned previously
- by &s.code;xf86LoadSubModule()&e.code; or
- &s.code;xf86LoadDrvSubModule()&e.code; .
-
- </quote>
- </quote>
-
-<sect1>Cleaning up Unused Drivers
-<p>
-
- At this point it is known which screens will be in use, and which
- drivers are being used. Unreferenced drivers (and modules they
- may have loaded) are unloaded here.
-
-
-<sect1>Consistency Checks
-<p>
-
- The parameters that must be global to the server, like pixmap formats,
- bitmap bit order, bitmap scanline unit and image byte order are
- compared for each of the screens. If a mismatch is found, the server
- exits with an appropriate message.
-
-
-<sect1>Check if Resource Control is Needed
-<p>
-
- Determine if resource access control is needed. This is the case
- if more than one screen is used. If necessary the RAC wrapper module
- is loaded.
-
-<sect1>AddScreen (ScreenInit)
-<p>
-
- At this point, the valid screens are known.
- &s.code;AddScreen()&e.code; is called for each of them, passing
- &s.code;ChipScreenInit()&e.code; as the argument.
- &s.code;AddScreen()&e.code; is a DIX function that allocates a new
- &s.code;screenInfo.screen[]&e.code; entry (aka
- &s.code;pScreen&e.code;), and does some basic initialisation of it.
- It then calls the &s.code;ChipScreenInit()&e.code; function, with
- &s.code;pScreen&e.code; as one of its arguments. If
- &s.code;ChipScreenInit()&e.code; returns &s.code;FALSE&e.code;,
- &s.code;AddScreen()&e.code; returns &s.code;-1&e.code;. Otherwise
- it returns the index of the screen. &s.code;AddScreen()&e.code;
- should only fail because of programming errors or failure to allocate
- resources (like memory). All configuration problems should be
- detected BEFORE this point.
-
- <quote><p>
- &s.code;Bool ChipScreenInit(int index, ScreenPtr pScreen,
- &f.indent;int argc, char **argv)&e.code;
- <quote><p>
- This is called at the start of each server generation.
-
- Fill in all of &s.code;pScreen&e.code;, possibly doing some of
- this by calling ScreenInit functions from other layers like mi,
- framebuffers (cfb, etc), and extensions.
-
- Decide which operations need to be placed under resource access
- control. The classes of operations are the frame buffer operations
- (&s.code;RAC_FB&e.code;), the pointer operations
- (&s.code;RAC_CURSOR&e.code;), the viewport change operations
- (&s.code;RAC_VIEWPORT&e.code;) and the colormap operations
- (&s.code;RAC_COLORMAP&e.code;). Any operation that requires
- resources which might be disabled during OPERATING state should
- be set to use RAC. This can be specified separately for memory
- and IO resources (the &s.code;racMemFlags&e.code; and
- &s.code;racIoFlags&e.code; fields of the &s.code;ScrnInfoRec&e.code;
- respectively).
-
- Map any video memory or other memory regions.
-
- Save the video card state. Enough state must be saved so that
- the original state can later be restored.
-
- Initialise the initial video mode. The &s.code;ScrnInfoRec&e.code;'s
- &s.code;vtSema&e.code; field should be set to &s.code;TRUE&e.code;
- just prior to changing the video hardware's state.
-
- </quote>
- </quote>
-
-
- The &s.code;ChipScreenInit()&e.code; function (or functions from other
- layers that it calls) should allocate entries in the
- &s.code;ScreenRec&e.code;'s &s.code;devPrivates&e.code; area by
- calling &s.code;AllocateScreenPrivateIndex()&e.code; if it needs
- per-generation storage. Since the &s.code;ScreenRec&e.code;'s
- &s.code;devPrivates&e.code; information is cleared for each server
- generation, this is the correct place to initialise it.
-
- After &s.code;AddScreen()&e.code; has successfully returned, the
- following &s.code;ScrnInfoRec&e.code; fields are initialised:
-
- <quote><verb>
- pScreen
- racMemFlags
- racIoFlags
- </verb></quote>
-
- The &s.code;ChipScreenInit()&e.code; function should initialise the
- &s.code;CloseScreen&e.code; and &s.code;SaveScreen&e.code; fields
- of &s.code;pScreen&e.code;. The old value of
- &s.code;pScreen-&gt;CloseScreen&e.code; should be saved as part of
- the driver's per-screen private data, allowing it to be called from
- &s.code;ChipCloseScreen()&e.code;. This means that the existing
- &s.code;CloseScreen()&e.code; function is wrapped.
-
-<sect1>Finalising RAC Initialisation
-<p>
-
- After all the &s.code;ChipScreenInit()&e.code; functions have been
- called, each screen has registered its RAC requirements. This
- information is used to determine which shared resources are requested
- by more than one driver and set the access functions accordingly.
- This is done following these rules:
-
- <enum>
- <item>The sharable resources registered by each entity are compared.
- If a resource is registered by more than one entity the entity
- will be marked to indicate that it needs to share this resources
- type (IO or MEM).
-
- <item>A resource marked ``disabled'' during OPERATING state will be
- ignored entirely.
-
- <item>A resource marked ``unused'' will only conflict with an overlapping
- resource of an other entity if the second is actually in use
- during OPERATING state.
-
- <item>If an ``unused'' resource was found to conflict but the entity
- does not use any other resource of this type the entire resource
- type will be disabled for that entity.
- </enum>
-
-
-<sect1>Finishing InitOutput()
-<p>
-
- At this point &s.code;InitOutput()&e.code; is finished, and all the
- screens have been setup in their initial video mode.
-
-
-<sect1>Mode Switching
-<p>
-
- When a SwitchMode event is received, &s.code;ChipSwitchMode()&e.code;
- is called (when it exists):
-
- <quote><p>
- &s.code;Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags)&e.code;
- <quote><p>
- Initialises the new mode for the screen identified by
- &s.code;index;&e.code;. The viewport may need to be adjusted
- also.
-
- </quote>
- </quote>
-
-
-<sect1>Changing Viewport
-<p>
-
- When a Change Viewport event is received,
- &s.code;ChipAdjustFrame()&e.code; is called (when it exists):
-
- <quote><p>
- &s.code;void ChipAdjustFrame(int index, int x, int y, int flags)&e.code;
- <quote><p>
- Changes the viewport for the screen identified by
- &s.code;index;&e.code;.
-
- It should be noted that many chipsets impose restrictions on where the
- viewport may be placed in the virtual resolution, either for alignment
- reasons, or to prevent the start of the viewport from being positioned
- within a pixel (as can happen in a 24bpp mode). After calculating the
- value the chipset's panning registers need to be set to for non-DGA
- modes, this function should recalculate the ScrnInfoRec's
- &s.code;frameX0&e.code;, &s.code;frameY0&e.code, &s.code;frameX1&e.code;
- and &s.code;frameY1&e.code; fields to correspond to that value. If
- this is not done, switching to another mode might cause the position
- of a hardware cursor to change.
-
- </quote>
- </quote>
-
-
-<sect1>VT Switching
-<p>
-
- When a VT switch event is received, &s.code;xf86VTSwitch()&e.code;
- is called. &s.code;xf86VTSwitch()&e.code; does the following:
-
- <descrip>
- <tag>On ENTER:</tag>
- <itemize>
- <item>enable port I/O access
-
- <item>save and initialise the bus/resource state
-
- <item>enter the SETUP server state
-
- <item>calls &s.code;ChipEnterVT()&e.code; for each screen
-
- <item>enter the OPERATING server state
-
- <item>validate GCs
-
- <item>Restore fb from saved pixmap for each screen
-
- <item>Enable all input devices
- </itemize>
- <tag>On LEAVE:</tag>
- <itemize>
- <item>Save fb to pixmap for each screen
-
- <item>validate GCs
-
- <item>enter the SETUP server state
-
- <item>calls &s.code;ChipLeaveVT()&e.code; for each screen
-
- <item>disable all input devices
-
- <item>restore bus/resource state
-
- <item>disables port I/O access
- </itemize>
- </descrip>
-
- <quote><p>
- &s.code;Bool ChipEnterVT(int index, int flags)&e.code;
- <quote><p>
- This function should initialise the current video mode and
- initialise the viewport, turn on the HW cursor if appropriate,
- etc.
-
- Should it re-save the video state before initialising the video
- mode?
-
- </quote>
-
- &s.code;void ChipLeaveVT(int index, int flags)&e.code;
- <quote><p>
- This function should restore the saved video state. If
- appropriate it should also turn off the HW cursor, and invalidate
- any pixmap/font caches.
-
- </quote>
-
- Optionally, &s.code;ChipLeaveVT()&e.code; may also unmap memory
- regions. If so, &s.code;ChipEnterVT()&e.code; will need to remap
- them. Additionally, if an aperture used to access video memory is
- unmapped and remapped in this fashion, &s.code;ChipEnterVT()&e.code;
- will also need to notify the framebuffer layers of the aperture's new
- location in virtual memory. This is done with a call to the screen's
- &s.code;ModifyPixmapHeader()&e.code; function, as follows
-
- <quote><p>
- &s.code;(*pScreen->ModifyPixmapHeader)(pScrn->ppix,
- &f.indent;-1, -1, -1, -1, -1, <it>NewApertureAddress</it>);&e.code;
- <quote><p>
- where the &s.code``ppix''&e.code; field in a ScrnInfoRec
- points to the pixmap used by the screen's
- &s.code;SaveRestoreImage()&e.code; function to hold the screen's
- contents while switched out.
-
- </quote>
- </quote>
-
- Currently, aperture remapping, as described here, should not be
- attempted if the driver uses the &s.code;xf8_16bpp&e.code; or
- &s.code;xf8_32bpp&e.code; framebuffer layers. A pending
- restructuring of VT switching will address this restriction in
- the near future.
-
- </quote>
-
- Other layers may wrap the &s.code;ChipEnterVT()&e.code; and
- &s.code;ChipLeaveVT()&e.code; functions if they need to take some
- action when these events are received.
-
-<sect1>End of server generation
-<p>
-
- At the end of each server generation, the DIX layer calls
- &s.code;ChipCloseScreen()&e.code; for each screen:
-
- <quote><p>
- &s.code;Bool ChipCloseScreen(int index, ScreenPtr pScreen)&e.code;
- <quote><p>
- This function should restore the saved video state and unmap the
- memory regions.
-
- It should also free per-screen data structures allocated by the
- driver. Note that the persistent data held in the
- &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field
- should not be freed here because it is needed by subsequent server
- generations.
-
- The &s.code;ScrnInfoRec&e.code;'s &s.code;vtSema&e.code; field
- should be set to &s.code;FALSE&e.code; once the video HW state
- has been restored.
-
- Before freeing the per-screen driver data the saved
- &s.code;CloseScreen&e.code; value should be restored to
- &s.code;pScreen-&gt;CloseScreen&e.code;, and that function should
- be called after freeing the data.
-
- </quote>
- </quote>
-
-<sect>Optional Driver Functions
-<p>
-
-The functions outlined here can be called from the XFree86 common layer,
-but their presence is optional.
-
-<sect1>Mode Validation
-<p>
-
- When a mode validation helper supplied by the XFree86-common layer is
- being used, it can be useful to provide a function to check for hw
- specific mode constraints:
-
- <quote><p>
- &s.code;ModeStatus ChipValidMode(int index, DisplayModePtr mode,
- &f.indent;Bool verbose, int flags)&e.code;
- <quote><p>
- Check the passed mode for hw-specific constraints, and return the
- appropriate status value.
-
- </quote>
- </quote>
-
-<p>
-This function may also modify the effective timings and clock of the passed
-mode. These have been stored in the mode's &s.code;Crtc*&e.code; and
-&s.code;SynthClock&e.code; elements, and have already been adjusted for
-interlacing, doublescanning, multiscanning and clock multipliers and dividers.
-The function should not modify any other mode field, unless it wants to modify
-the mode timings reported to the user by &s.code;xf86PrintModes()&e.code;.
-
-<p>
-The function is called once for every mode in the XF86Config Monitor section
-assigned to the screen, with &s.code;flags&e.code; set to
-&s.code;MODECHECK_INITIAL&e.code;. It is subsequently called for every mode
-in the XF86Config Display subsection assigned to the screen, with
-&s.code;flags&e.code; set to &s.code;MODECHECK_FINAL&e.code;. In the second
-case, the mode will have successfully passed all other tests. In addition,
-the &s.code;ScrnInfoRec&e.code;'s &s.code;virtualX&e.code;,
-&s.code;virtualY&e.code; and &s.code;displayWidth&e.code; fields will have been
-set as if the mode to be validated were to be the last mode accepted.
-
-<p>
-In effect, calls with MODECHECK_INITIAL are intended for checks that do not
-depend on any mode other than the one being validated, while calls with
-MODECHECK_FINAL are intended for checks that may involve more than one mode.
-
-<sect1>Free screen data
-<p>
-
- When a screen is deleted prior to the completion of the ScreenInit
- phase the &s.code;ChipFreeScreen()&e.code; function is called when defined.
-
- <quote><p>
- &s.code;void ChipFreeScreen(int scrnindex, int flags)&e.code;
- <quote><p>
- Free any driver-allocated data that may have been allocated up to
- and including an unsuccessful &s.code;ChipScreenInit()&e.code;
- call. This would predominantly be data allocated by
- &s.code;ChipPreInit()&e.code; that persists across server
- generations. It would include the &s.code;driverPrivate&e.code;,
- and any ``privates'' entries that modules may have allocated.
-
- </quote>
- </quote>
-
-
-<sect>Recommended driver functions
-<p>
-
-The functions outlined here are for internal use by the driver only.
-They are entirely optional, and are never accessed directly from higher
-layers. The sample function declarations shown here are just examples.
-The interface (if any) used is up to the driver.
-
-<sect1>Save
-<p>
-
- Save the video state. This could be called from &s.code;ChipScreenInit()&e.code; and
- (possibly) &s.code;ChipEnterVT()&e.code;.
-
- <quote><p>
- &s.code;void ChipSave(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- Saves the current state. This will only be saving pre-server
- states or states before returning to the server. There is only
- one current saved state per screen and it is stored in private
- storage in the screen.
-
- </quote>
- </quote>
-
-<sect1>Restore
-<p>
-
- Restore the original video state. This could be called from the
- &s.code;ChipLeaveVT()&e.code; and &s.code;ChipCloseScreen()&e.code;
- functions.
-
- <quote><p>
- &s.code;void ChipRestore(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- Restores the saved state from the private storage. Usually only
- used for restoring text modes.
-
- </quote>
- </quote>
-
-
-<sect1>Initialise Mode
-<p>
-
- Initialise a video mode. This could be called from the
- &s.code;ChipScreenInit()&e.code;, &s.code;ChipSwitchMode()&e.code;
- and &s.code;ChipEnterVT()&e.code; functions.
-
- <quote><p>
- &s.code;Bool ChipModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)&e.code;
- <quote><p>
- Programs the hardware for the given video mode.
-
- </quote>
- </quote>
-
-
-<sect>Data and Data Structures
-<p>
-
-<sect1>Command line data
-<p>
-
-Command line options are typically global, and are stored in global
-variables. These variables are read-only and are available to drivers
-via a function call interface. Most of these command line values are
-processed via helper functions to ensure that they are treated consistently
-by all drivers. The other means of access is provided for cases where
-the supplied helper functions might not be appropriate.
-
-Some of them are:
-
-<quote><verb>
- xf86Verbose verbosity level
- xf86Bpp -bpp from the command line
- xf86Depth -depth from the command line
- xf86Weight -weight from the command line
- xf86Gamma -{r,g,b,}gamma from the command line
- xf86FlipPixels -flippixels from the command line
- xf86ProbeOnly -probeonly from the command line
- defaultColorVisualClass -cc from the command line
-</verb></quote>
-
-If we ever do allow for screen-specific command line options, we may
-need to rethink this.
-
-These can be accessed in a read-only manner by drivers with the following
-functions:
-
- <quote><p>
- &s.code;int xf86GetVerbosity()&e.code;
- <quote><p>
- Returns the value of &s.code;xf86Verbose&e.code;.
-
- </quote>
-
- &s.code;int xf86GetDepth()&e.code;
- <quote><p>
- Returns the &s.cmd;-depth&e.cmd; command line setting. If not
- set on the command line, &s.code;-1&e.code; is returned.
-
- </quote>
-
- &s.code;rgb xf86GetWeight()&e.code;
- <quote><p>
- Returns the &s.cmd;-weight&e.cmd; command line setting. If not
- set on the command line, &s.code;{0, 0, 0}&e.code; is returned.
-
- </quote>
-
- &s.code;Gamma xf86GetGamma()&e.code;
- <quote><p>
- Returns the &s.cmd;-gamma&e.cmd; or &s.cmd;-rgamma&e.cmd;,
- &s.cmd;-ggamma&e.cmd;, &s.cmd;-bgamma&e.cmd; command line settings.
- If not set on the command line, &s.code;{0.0, 0.0, 0.0}&e.code;
- is returned.
-
- </quote>
-
- &s.code;Bool xf86GetFlipPixels()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if &s.cmd;-flippixels&e.cmd; is
- present on the command line, and &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;const char *xf86GetServerName()&e.code;
- <quote><p>
- Returns the name of the X server from the command line.
-
- </quote>
- </quote>
-
-<sect1>Data handling
-<p>
-
-Config file data contains parts that are global, and parts that are
-Screen specific. All of it is parsed into data structures that neither
-the drivers or most other parts of the server need to know about.
-
-The global data is typically not required by drivers, and as such, most
-of it is stored in the private &s.code;xf86InfoRec&e.code;.
-
-The screen-specific data collected from the config file is stored in
-screen, device, display, monitor-specific data structures that are separate
-from the &s.code;ScrnInfoRecs&e.code;, with the appropriate elements/fields
-hooked into the &s.code;ScrnInfoRecs&e.code; as required. The screen
-config data is held in &s.code;confScreenRec&e.code;, device data in
-the &s.code;GDevRec&e.code;, monitor data in the &s.code;MonRec&e.code;,
-and display data in the &s.code;DispRec&e.code;.
-
-The XFree86 common layer's screen specific data (the actual data in use
-for each screen) is held in the &s.code;ScrnInfoRecs&e.code;. As has
-been outlined above, the &s.code;ScrnInfoRecs&e.code; are allocated at probe
-time, and it is the responsibility of the Drivers' &s.code;Probe()&e.code;
-and &s.code;PreInit()&e.code; functions to finish filling them in based
-on both data provided on the command line and data provided from the
-Config file. The precedence for this is:
-
- <quote>
- command line -&gt; config file -&gt; probed/default data
- </quote>
-
-For most things in this category there are helper functions that the
-drivers can use to ensure that the above precedence is consistently
-used.
-
-As well as containing screen-specific data that the XFree86 common layer
-(including essential parts of the server infrastructure as well as helper
-functions) needs to access, it also contains some data that drivers use
-internally. When considering whether to add a new field to the
-&s.code;ScrnInfoRec&e.code;, consider the balance between the convenience
-of things that lots of drivers need and the size/obscurity of the
-&s.code;ScrnInfoRec&e.code;.
-
-Per-screen driver specific data that cannot be accommodated with the
-static &s.code;ScrnInfoRec&e.code; fields is held in a driver-defined
-data structure, a pointer to which is assigned to the
-&s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field. This
-is per-screen data that persists across server generations (as does the
-bulk of the static &s.code;ScrnInfoRec&e.code; data). It would typically
-also include the video card's saved state.
-
-Per-screen data for other modules that the driver uses (for example,
-the XAA module) that is reset for each server generation is hooked into
-the &s.code;ScrnInfoRec&e.code; through it's &s.code;privates&e.code;
-field.
-
-Once it has stabilised, the data structures and variables accessible to
-video drivers will be documented here. In the meantime, those things
-defined in the &s.code;xf86.h&e.code; and &s.code;xf86str.h&e.code;
-files are visible to video drivers. Things defined in
-&s.code;xf86Priv.h&e.code; and &s.code;xf86Privstr.h&e.code; are NOT
-intended to be visible to video drivers, and it is an error for a driver
-to include those files.
-
-
-<sect1>Accessing global data
-<p>
-
-Some other global state information that the drivers may access via
-functions is as follows:
-
- <quote><p>
- &s.code;Bool xf86ServerIsExiting()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if the server is at the end of a
- generation and is in the process of exiting, and
- &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;Bool xf86ServerIsResetting()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if the server is at the end of a
- generation and is in the process of resetting, and
- &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;Bool xf86ServerIsInitialising()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if the server is at the beginning of
- a generation and is in the process of initialising, and
- &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;Bool xf86ServerIsOnlyProbing()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if the -probeonly command line flag
- was specified, and &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;Bool xf86CaughtSignal()&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; if the server has caught a signal,
- and &s.code;FALSE&e.code; otherwise.
-
- </quote>
- </quote>
-
-<sect1>Allocating private data
-<p>
-
-A driver and any module it uses may allocate per-screen private storage
-in either the &s.code;ScreenRec&e.code; (DIX level) or
-&s.code;ScrnInfoRec&e.code; (XFree86 common layer level).
-&s.code;ScreenRec&e.code; storage persists only for a single server
-generation, and &s.code;ScrnInfoRec&e.code; storage persists across
-generations for the lifetime of the server.
-
-The &s.code;ScreenRec&e.code; &s.code;devPrivates&e.code; data must be
-reallocated/initialised at the start of each new generation. This is
-normally done from the &s.code;ChipScreenInit()&e.code; function, and
-Init functions for other modules that it calls. Data allocated in this
-way should be freed by the driver's &s.code;ChipCloseScreen()&e.code;
-functions, and Close functions for other modules that it calls. A new
-&s.code;devPrivates&e.code; entry is allocated by calling the
-&s.code;AllocateScreenPrivateIndex()&e.code; function.
-
- <quote><p>
- &s.code;int AllocateScreenPrivateIndex()&e.code;
- <quote><p>
- This function allocates a new element in the
- &s.code;devPrivates&e.code; field of all currently existing
- &s.code;ScreenRecs&e.code;. The return value is the index of this
- new element in the &s.code;devPrivates&e.code; array. The
- &s.code;devPrivates&e.code; field is of type
- &s.code;DevUnion&e.code;:
-
- <verb>
- typedef union _DevUnion {
- pointer ptr;
- long val;
- unsigned long uval;
- pointer (*fptr)(void);
- } DevUnion;
- </verb>
-
- which allows the element to be used for any of the above types.
- It is commonly used as a pointer to data that the caller allocates
- after the new index has been allocated.
-
- This function will return &s.code;-1&e.code; when there is an
- error allocating the new index.
-
- </quote>
- </quote>
-
-The &s.code;ScrnInfoRec&e.code; &s.code;privates&e.code; data persists
-for the life of the server, so only needs to be allocated once. This
-should be done from the &s.code;ChipPreInit()&e.code; function, and Init
-functions for other modules that it calls. Data allocated in this way
-should be freed by the driver's &s.code;ChipFreeScreen()&e.code; functions,
-and Free functions for other modules that it calls. A new
-&s.code;privates&e.code; entry is allocated by calling the
-&s.code;xf86AllocateScrnInfoPrivateIndex()&e.code; function.
-
-
- <quote><p>
- &s.code;int xf86AllocateScrnInfoPrivateIndex()&e.code;
- <quote><p>
- This function allocates a new element in the &s.code;privates&e.code;
- field of all currently existing &s.code;ScrnInfoRecs&e.code;.
- The return value is the index of this new element in the
- &s.code;privates&e.code; array. The &s.code;privates&e.code;
- field is of type &s.code;DevUnion&e.code;:
-
- <verb>
- typedef union _DevUnion {
- pointer ptr;
- long val;
- unsigned long uval;
- pointer (*fptr)(void);
- } DevUnion;
- </verb>
-
- which allows the element to be used for any of the above types.
- It is commonly used as a pointer to data that the caller allocates
- after the new index has been allocated.
-
- This function will not return when there is an error allocating
- the new index. When there is an error it will cause the server
- to exit with a fatal error. The similar function for allocation
- privates in the &s.code;ScreenRec&e.code;
- (&s.code;AllocateScreenPrivateIndex()&e.code;) differs in this
- respect by returning &s.code;-1&e.code; when the allocation fails.
-
- </quote>
- </quote>
-
-<sect>Keeping Track of Bus Resources<label id="rac">
-<p>
-
-<sect1>Theory of Operation
-<p>
-
-The XFree86 common layer has knowledge of generic access control mechanisms
-for devices on certain bus systems (currently the PCI bus) as well as
-of methods to enable or disable access to the buses itself. Furthermore
-it can access information on resources decoded by these devices and if
-necessary modify it.
-
-When first starting the Xserver collects all this information, saves it
-for restoration, checks it for consistency, and if necessary, corrects
-it. Finally it disables all resources on a generic level prior to
-calling any driver function.
-
-When the &s.code;Probe()&e.code; function of each driver is called the
-device sections are matched against the devices found in the system.
-The driver may probe devices at this stage that cannot be identified by
-using device independent methods. Access to all resources that can be
-controlled in a device independent way is disabled. The
-&s.code;Probe()&e.code; function should register all non-relocatable
-resources at this stage. If a resource conflict is found between
-exclusive resources the driver will fail immediately. Optionally the
-driver might specify an &s.code;EntityInit()&e.code;,
-&s.code;EntityLeave()&e.code; and &s.code;EntityEnter()&e.code; function.
-
-&s.code;EntityInit()&e.code; can be used to disable any shared resources
-that are not controlled by the generic access control functions. It is
-called prior to the PreInit phase regardless if an entity is active or
-not. When calling the &s.code;EntityInit()&e.code;,
-&s.code;EntityEnter()&e.code; and &s.code;EntityLeave()&e.code; functions
-the common level will disable access to all other entities on a generic
-level. Since the common level has no knowledge of device specific
-methods to disable access to resources it cannot be guaranteed that
-certain resources are not decoded by any other entity until the
-&s.code;EntityInit()&e.code; or &s.code;EntityEnter()&e.code; phase is
-finished. Device drivers should therefore register all those resources
-which they are going to disable. If these resources are never to be
-used by any driver function they may be flagged &s.code;ResInit&e.code;
-so that they can be removed from the resource list after processing all
-&s.code;EntityInit()&e.code; functions. &s.code;EntityEnter()&e.code;
-should disable decoding of all resources which are not registered as
-exclusive and which are not handled by the generic access control in
-the common level. The difference to &s.code;EntityInit()&e.code; is
-that the latter one is only called once during lifetime of the server.
-It can therefore be used to set up variables prior to disabling resources.
-&s.code;EntityLeave()&e.code; should restore the original state when
-exiting the server or switching to a different VT. It also needs to
-disable device specific access functions if they need to be disabled on
-server exit or VT switch. The default state is to enable them before
-giving up the VT.
-
-In &s.code;PreInit()&e.code; phase each driver should check if any
-sharable resources it has registered during &s.code;Probe()&e.code; has
-been denied and take appropriate action which could simply be to fail.
-If it needs to access resources it has disabled during
-&s.code;EntitySetup()&e.code; it can do so provided it has registered
-these and will disable them before returning from
-&s.code;PreInit()&e.code;. This also applies to all other driver
-functions. Several functions are provided to request resource ranges,
-register these, correct PCI config space and add replacements for the
-generic access functions. Resources may be marked ``disabled'' or
-``unused'' during OPERATING stage. Although these steps could also be
-performed in &s.code;ScreenInit()&e.code;, this is not desirable.
-
-Following &s.code;PreInit()&e.code; phase the common level determines
-if resource access control is needed. This is the case if more than
-one screen is used. If necessary the RAC wrapper module is loaded. In
-&s.code;ScreenInit()&e.code; the drivers can decide which operations
-need to be placed under RAC. Available are the frame buffer operations,
-the pointer operations and the colormap operations. Any operation that
-requires resources which might be disabled during OPERATING state should
-be set to use RAC. This can be specified separately for memory and IO
-resources.
-
-When &s.code;ScreenInit()&e.code; phase is done the common level will
-determine which shared resources are requested by more than one driver
-and set the access functions accordingly. This is done following these
-rules:
-
-<enum>
-<item>The sharable resources registered by each entity are compared. If
- a resource is registered by more than one entity the entity will be
- marked to need to share this resources type (&s.code;IO&e.code; or
- &s.code;MEM&e.code;).
-
-<item>A resource marked ``disabled'' during OPERATING state will be ignored
- entirely.
-
-<item>A resource marked ``unused'' will only conflicts with an overlapping
- resource of an other entity if the second is actually in use during
- OPERATING state.
-
-<item>If an ``unused'' resource was found to conflict however the entity
- does not use any other resource of this type the entire resource type
- will be disabled for that entity.
-</enum>
-
-The driver has the choice among different ways to control access to
-certain resources:
-
-<enum>
-<item>It can rely on the generic access functions. This is probably the
- most common case. Here the driver only needs to register any resource
- it is going to use.
-
-<item>It can replace the generic access functions by driver specific
- ones. This will mostly be used in cases where no generic access
- functions are available. In this case the driver has to make sure
- these resources are disabled when entering the &s.code;PreInit()&e.code;
- stage. Since the replacement functions are registered in
- &s.code;PreInit()&e.code; the driver will have to enable these
- resources itself if it needs to access them during this state. The
- driver can specify if the replacement functions can control memory
- and/or I/O resources separately.
-
-<item>The driver can enable resources itself when it needs them. Each
- driver function enabling them needs to disable them before it will
- return. This should be used if a resource which can be controlled
- in a device dependent way is only required during SETUP state. This
- way it can be marked ``unused'' during OPERATING state.
-</enum>
-
-A resource which is decoded during OPERATING state however never accessed
-by the driver should be marked unused.
-
-Since access switching latencies are an issue during Xserver operation,
-the common level attempts to minimize the number of entities that need
-to be placed under RAC control. When a wrapped operation is called,
-the &s.code;EnableAccess()&e.code; function is called before control is
-passed on. &s.code;EnableAccess()&e.code; checks if a screen is under
-access control. If not it just establishes bus routing and returns.
-If the screen needs to be under access control,
-&s.code;EnableAccess()&e.code; determines which resource types
-(&s.code;MEM&e.code;, &s.code;IO&e.code;) are required. Then it tests
-if this access is already established. If so it simply returns. If
-not it disables the currently established access, fixes bus routing and
-enables access to all entities registered for this screen.
-
-Whenever a mode switch or a VT-switch is performed the common level will
-return to SETUP state.
-
-<sect1>Resource Types
-<p>
-
-Resource have certain properties. When registering resources each range
-is accompanied by a flag consisting of the ORed flags of the different
-properties the resource has. Each resource range may be classified
-according to
-
-<itemize>
- <item>its physical properties i.e., if it addresses
- memory (&s.code;ResMem&e.code;) or
- I/O space (&s.code;ResIo&e.code;),
- <item>if it addresses a
- block (&s.code;ResBlock&e.code;) or
- sparse (&s.code;ResSparse&e.code;)
- range,
- <item>its access properties.
-</itemize>
-
-There are two known access properties:
-
-<itemize>
- <item>&s.code;ResExclusive&e.code;
- for resources which may not be shared with any other device and
- <item>&s.code;ResShared&e.code;
- for resources which can be disabled and therefore can be shared.
-</itemize>
-
-If it is necessary to test a resource against any type a generic access
-type &s.code;ResAny&e.code; is provided. If this is set the resource
-will conflict with any resource of a different entity intersecting its
-range. Further it can be specified that a resource is decoded however
-never used during any stage (&s.code;ResUnused&e.code;) or during
-OPERATING state (&s.code;ResUnusedOpr&e.code;). A resource only visible
-during the init functions (ie. &s.code;EntityInit()&e.code;,
-&s.code;EntityEnter()&e.code; and &s.code;EntityLeave()&e.code; should
-be registered with the flag &s.code;ResInit&e.code;. A resource that
-might conflict with background resource ranges may be flagged with
-&s.code;ResBios&e.code;. This might be useful when registering resources
-ranges that were assigned by the system Bios.
-
-Several predefined resource lists are available for VGA and 8514/A
-resources in &s.code;common/xf86Resources.h&e.code;.
-
-<sect1>Available Functions<label id="avail">
-<p>
-
-The functions provided for resource management are listed in their order
-of use in the driver.
-
-
-<sect2>Probe Phase
-<p>
-
-In this phase each driver detects those resources it is able to drive,
-creates an entity record for each of them, registers non-relocatable
-resources and allocates screens and adds the resources to screens.
-
-Two helper functions are provided for matching device sections in the
-XF86Config file to the devices:
-
- <quote><p>
- &s.code;int xf86MatchPciInstances(const char *driverName, int vendorID,
- &f.indent;SymTabPtr chipsets, PciChipsets *PCIchipsets,
- &f.indent;GDevPtr *devList, int numDevs, DriverPtr drvp,
- &f.indent;int **foundEntities)&e.code;
- <quote><p>
- This function finds matches between PCI cards that a driver supports
- and config file device sections. It is intended for use in the
- &s.code;ChipProbe()&e.code; function of drivers for PCI cards.
- Only probed PCI devices with a vendor ID matching
- &s.code;vendorID&e.code; are considered. &s.code;devList&e.code;
- and &s.code;numDevs&e.code; are typically those found from
- calling &s.code;xf86MatchDevice()&e.code;, and represent the active
- config file device sections relevant to the driver.
- &s.code;PCIchipsets&e.code; is a table that provides a mapping
- between the PCI device IDs, the driver's internal chipset tokens
- and a list of fixed resources.
-
- When a device section doesn't have a &s.key;BusID&e.key; entry it
- can only match the primary video device. Secondary devices are
- only matched with device sections that have a matching
- &s.key;BusID&e.key; entry.
-
- Once the preliminary matches have been found, a final match is
- confirmed by checking if the chipset override, ChipID override or
- probed PCI chipset type match one of those given in the
- &s.code;chipsets&e.code; and &s.code;PCIchipsets&e.code; lists.
- The &s.code;PCIchipsets&e.code; list includes a list of the PCI
- device IDs supported by the driver. The list should be terminated
- with an entry with PCI ID &s.code;-1&e.code;". The
- &s.code;chipsets&e.code; list is a table mapping the driver's
- internal chipset tokens to names, and should be terminated with
- a &s.code;NULL&e.code; entry. Only those entries with a
- corresponding entry in the &s.code;PCIchipsets&e.code; list are
- considered. The order of precedence is: config file chipset,
- config file ChipID, probed PCI device ID.
-
- In cases where a driver handles PCI chipsets with more than one
- vendor ID, it may set &s.code;vendorID&e.code; to
- &s.code;0&e.code;, and OR each devID in the list with (the
- vendor&nbsp;ID&nbsp;&lt;&lt;&nbsp;16).
-
- Entity index numbers for confirmed matches are returned as an
- array via &s.code;foundEntities&e.code;. The PCI information,
- chipset token and device section for each match are found in the
- &s.code;EntityInfoRec&e.code; referenced by the indices.
-
- The function return value is the number of confirmed matches. A
- return value of &s.code;-1&e.code; indicates an internal error.
- The returned &s.code;foundEntities&e.code; array should be freed
- by the driver with &s.code;xfree()&e.code; when it is no longer
- needed in cases where the return value is greater than zero.
-
- </quote>
-
- &s.code;int xf86MatchIsaInstances(const char *driverName,
- &f.indent;SymTabPtr chipsets, IsaChipsets *ISAchipsets,
- &f.indent;DriverPtr drvp, FindIsaDevProc FindIsaDevice,
- &f.indent;GDevPtr *devList, int numDevs,
- int **foundEntities)&e.code;
- <quote><p>
- This function finds matches between ISA cards that a driver supports
- and config file device sections. It is intended for use in the
- &s.code;ChipProbe()&e.code; function of drivers for ISA cards.
- &s.code;devList&e.code; and &s.code;numDevs&e.code; are
- typically those found from calling &s.code;xf86MatchDevice()&e.code;,
- and represent the active config file device sections relevant to
- the driver. &s.code;ISAchipsets&e.code; is a table that provides
- a mapping between the driver's internal chipset tokens and the
- resource classes. &s.code;FindIsaDevice&e.code; is a
- driver-provided function that probes the hardware and returns the
- chipset token corresponding to what was detected, and
- &s.code;-1&e.code; if nothing was detected.
-
- If the config file device section contains a chipset entry, then
- it is checked against the &s.code;chipsets&e.code; list. When
- no chipset entry is present, the &s.code;FindIsaDevice&e.code;
- function is called instead.
-
- Entity index numbers for confirmed matches are returned as an
- array via &s.code;foundEntities&e.code;. The chipset token and
- device section for each match are found in the
- &s.code;EntityInfoRec&e.code; referenced by the indices.
-
- The function return value is the number of confirmed matches. A
- return value of &s.code;-1&e.code; indicates an internal error.
- The returned &s.code;foundEntities&e.code; array should be freed
- by the driver with &s.code;xfree()&e.code; when it is no longer
- needed in cases where the return value is greater than zero.
-
- </quote>
- </quote>
-
-These two helper functions make use of several core functions that are
-available at the driver level:
-
- <quote><p>
- &s.code;Bool xf86ParsePciBusString(const char *busID, int *bus,
- &f.indent;int *device, int *func)&e.code;
- <quote><p>
- Takes a &s.code;BusID&e.code; string, and if it is in the correct
- format, returns the PCI &s.code;bus&e.code;, &s.code;device&e.code;,
- &s.code;func&e.code; values that it indicates. The format of the
- string is expected to be "PCI:bus:device:func" where each of `bus',
- `device' and `func' are decimal integers. The ":func" part may
- be omitted, and the func value assumed to be zero, but this isn't
- encouraged. The "PCI" prefix may also be omitted. The prefix
- "AGP" is currently equivalent to the "PCI" prefix. If the string
- isn't a valid PCI BusID, the return value is &s.code;FALSE&e.code;.
-
- </quote>
-
-
- &s.code;Bool xf86ComparePciBusString(const char *busID, int bus,
- &f.indent;int device, int func)&e.code;
- <quote><p>
- Compares a &s.code;BusID&e.code; string with PCI &s.code;bus&e.code;,
- &s.code;device&e.code;, &s.code;func&e.code; values. If they
- match &s.code;TRUE&e.code; is returned, and &s.code;FALSE&e.code;
- if they don't.
-
- </quote>
-
- &s.code;Bool xf86ParseIsaBusString(const char *busID)&e.code;
- <quote><p>
- Compares a &s.code;BusID&e.code; string with the ISA bus ID string
- ("ISA" or "ISA:"). If they match &s.code;TRUE&e.code; is returned,
- and &s.code;FALSE&e.code; if they don't.
-
- </quote>
-
- &s.code;Bool xf86CheckPciSlot(int bus, int device, int func)&e.code;
- <quote><p>
- Checks if the PCI slot &s.code;bus:device:func&e.code; has been
- claimed. If so, it returns &s.code;FALSE&e.code;, and otherwise
- &s.code;TRUE&e.code;.
-
- </quote>
-
- &s.code;int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
- &f.indent;int chipset, GDevPtr dev, Bool active)&e.code;
- <quote><p>
- This function is used to claim a PCI slot, allocate the associated
- entity record and initialise their data structures. The return
- value is the index of the newly allocated entity record, or
- &s.code;-1&e.code; if the claim fails. This function should always
- succeed if &s.code;xf86CheckPciSlot()&e.code; returned
- &s.code;TRUE&e.code; for the same PCI slot.
-
- </quote>
-
- &s.code;Bool xf86IsPrimaryPci(void)&e.code;
- <quote><p>
- This function returns &s.code;TRUE&e.code; if the primary card is
- a PCI device, and &s.code;FALSE&e.code; otherwise.
-
- </quote>
-
- &s.code;int xf86ClaimIsaSlot(DriverPtr drvp, int chipset,
- &f.indent;GDevPtr dev, Bool active)&e.code;
- <quote><p>
- This allocates an entity record entity and initialise the data
- structures. The return value is the index of the newly allocated
- entity record.
-
- </quote>
-
- &s.code;Bool xf86IsPrimaryIsa(void)&e.code;
- <quote><p>
- This function returns &s.code;TRUE&e.code; if the primary card is
- an ISA (non-PCI) device, and &s.code;FALSE&e.code; otherwise.
-
- </quote>
- </quote>
-
-Two helper functions are provided to aid configuring entities:
- <quote><p>
- &s.code;ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
- &f.indent;int scrnFlag, int entityIndex,
- &f.indent;PciChipsets *p_chip,
- &f.indent;resList res, EntityProc init,
- &f.indent;EntityProc enter, EntityProc leave,
- &f.indent;pointer private)&e.code;
- <p>
- &s.code;ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn,
- &f.indent;int scrnFlag, int entityIndex,
- &f.indent;IsaChipsets *i_chip,
- &f.indent;resList res, EntityProc init,
- &f.indent;EntityProc enter, EntityProc leave,
- &f.indent;pointer private)&e.code;
- <quote><p>
- These functions are used to register the non-relocatable resources
- for an entity, and the optional entity-specific &s.code;Init&e.code;, &s.code;Enter&e.code; and
- &s.code;Leave&e.code; functions. Usually the list of fixed resources is obtained
- from the Isa/PciChipsets lists. However an additional list of
- resources may be passed. Generally this is not required.
- For active entities a &s.code;ScrnInfoRec&e.code; is allocated
- if the &s.code;pScrn&e.code; argument is &s.code;NULL&e.code;.
-The
- return value is &s.code;TRUE&e.code; when successful. The init, enter, leave
- functions are defined as follows:
-
- <quote>
- &s.code;typedef void (*EntityProc)(int entityIndex,
- &f.indent;pointer private)&e.code;
- </quote>
-
- They are passed the entity index and a pointer to a private scratch
- area. This can be set up during &s.code;Probe()&e.code; and
- its address can be passed to
- &s.code;xf86ConfigIsaEntity()&e.code; and
- &s.code;xf86ConfigPciEntity()&e.code; as the last argument.
-
- </quote>
- </quote>
-
-These two helper functions make use of several core functions that are
-available at the driver level:
- <quote><p>
- &s.code;void xf86ClaimFixedResources(resList list, int entityIndex)&e.code;
- <quote><p>
- This function registers the non-relocatable resources which cannot
- be disabled and which therefore would cause the server to fail
- immediately if they were found to conflict. It also records
- non-relocatable but sharable resources for processing after the
- &s.code;Probe()&e.code; phase.
-
- </quote>
-
- &s.code;Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
- &f.indent;EntityProc enter, EntityProc leave, pointer)&e.code;
- <quote><p>
- This function registers with an entity the &s.code;init&e.code;,
- &s.code;enter&e.code;, &s.code;leave&e.code; functions along
- with the pointer to their private area.
-
- </quote>
-
- &s.code;void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)&e.code;
- <quote><p>
- This function associates the entity referenced by
- &s.code;entityIndex&e.code; with the screen.
-
- </quote>
- </quote>
-
-<sect2>PreInit Phase
-<p>
-
-During this phase the remaining resources should be registered.
-&s.code;PreInit()&e.code; should call &s.code;xf86GetEntityInfo()&e.code;
-to obtain a pointer to an &s.code;EntityInfoRec&e.code; for each entity
-it is able to drive and check if any resource are listed in its
-&s.code;resources&e.code; field. If resources registered in the Probe
-phase have been rejected in the post-Probe phase
-(&s.code;resources&e.code; is non-&s.code;NULL&e.code;), then the driver should
-decide if it can continue without using these or if it should fail.
-
- <quote><p>
- &s.code;EntityInfoPtr xf86GetEntityInfo(int entityIndex)&e.code;
- <quote><p>
- This function returns a pointer to the &s.code;EntityInfoRec&e.code;
- referenced by &s.code;entityIndex&e.code;. The returned
- &s.code;EntityInfoRec&e.code; should be freed with
- &s.code;xfree()&e.code; when no longer needed.
-
- </quote>
- </quote>
-Several functions are provided to simplify resource registration:
- <quote><p>
- &s.code;Bool xf86IsEntityPrimary(int entityIndex)&e.code;
- <quote><p>
- This function returns &s.code;TRUE&e.code; if the entity referenced
- by &s.code;entityIndex&e.code; is the primary display device (i.e.,
- the one initialised at boot time and used in text mode).
-
- </quote>
-
- &s.code;Bool xf86IsScreenPrimary(int scrnIndex)&e.code;
- <quote><p>
- This function returns &s.code;TRUE&e.code; if the primary entity
- is registered with the screen referenced by
- &s.code;scrnIndex&e.code;.
-
- </quote>
-
- &s.code;pciVideoPtr xf86GetPciInfoForEntity(int entityIndex)&e.code;
- <quote><p>
- This function returns a pointer to the &s.code;pciVideoRec&e.code;
- for the specified entity. If the entity is not a PCI device,
- &s.code;NULL&e.code; is returned.
-
- </quote>
- </quote>
-
-The primary function for registration of resources is:
- <quote><p>
- &s.code;resPtr xf86RegisterResources(int entityIndex, resList list,
- &f.indent;int access)&e.code;
- <quote><p>
- This function tries to register the resources in
- &s.code;list&e.code;. If list is &s.code;NULL&e.code; it tries
- to determine the resources automatically. This only works for
- entities that provide a generic way to read out the resource ranges
- they decode. So far this is only the case for PCI devices. By
- default the PCI resources are registered as shared
- (&s.code;ResShared&e.code;) if the driver wants to set a different
- access type it can do so by specifying the access flags in the
- third argument. A value of &s.code;0&e.code; means to use the
- default settings. If for any reason the resource broker is not
- able to register some of the requested resources the function will
- return a pointer to a list of the failed ones. In this case the
- driver may be able to move the resource to different locations.
- In case of PCI bus entities this is done by passing the list of
- failed resources to &s.code;xf86ReallocatePciResources()&e.code;.
- When the registration succeeds, the return value is
- &s.code;NULL&e.code;.
-
- </quote>
-
- &s.code;resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes)&e.code;
- <quote><p>
- This function takes a list of PCI resources that need to be
- reallocated and returns &s.code;NULL&e.code when all relocations are
- successful.
- &s.code;xf86RegisterResources()&e.code; should be called again to
- register the relocated resources with the broker.
- If the reallocation fails, a list of the resources that could not be
- relocated is returned.
-
- </quote>
- </quote>
-
-Two functions are provided to obtain a resource range of a given type:
- <quote><p>
- &s.code;resRange xf86GetBlock(long type, memType size,
- &f.indent;memType window_start, memType window_end,
- &f.indent;memType align_mask, resPtr avoid)&e.code;
- <quote><p>
- This function tries to find a block range of size
- &s.code;size&e.code; and type &s.code;type&e.code; in a window
- bound by &s.code;window_start&e.code; and &s.code;window_end&e.code;
- with the alignment specified in &s.code;align_mask&e.code;.
- Optionally a list of resource ranges which should be avoided within
- the window can be supplied. On failure a zero-length range of
- type &s.code;ResEnd&e.code; will be returned.
-
- </quote>
- &s.code;resRange xf86GetSparse(long type, memType fixed_bits,
- &f.indent;memType decode_mask, memType address_mask,
- &f.indent;resPtr avoid)&e.code;
- <quote><p>
- This function is like the previous one, but attempts to find a
- sparse range instead of a block range. Here three values have to
- be specified: the &s.code;address_mask&e.code; which marks all
- bits of the mask part of the address, the &s.code;decode_mask&e.code;
- which masks out the bits which are hardcoded and are therefore
- not available for relocation and the values of the fixed bits.
- The function tries to find a base that satisfies the given condition.
- If the function fails it will return a zero range of type
- &s.code;ResEnd&e.code;. Optionally it might be passed a list of
- resource ranges to avoid.
-
- </quote>
- </quote>
-
-Some PCI devices are broken in the sense that they return invalid size
-information for a certain resource. In this case the driver can supply
-the correct size and make sure that the resource range allocated for
-the card is large enough to hold the address range decoded by the card.
-The function &s.code;xf86FixPciResource()&e.code; can be used to do this:
- <quote><p>
- &s.code;Bool xf86FixPciResource(int entityIndex, unsigned int prt,
- &f.indent;CARD32 alignment, long type)&e.code;
- <quote><p>
- This function fixes a PCI resource allocation. The
- &s.code;prt&e.code; parameter contains the number of the PCI base
- register that needs to be fixed (&s.code;0-5&e.code;, and
- &s.code;6&e.code; for the BIOS base register). The size is
- specified by the alignment. Since PCI resources need to span an
- integral range of size &s.code;2^n&e.code;, the alignment also
- specifies the number of addresses that will be decoded. If the
- driver specifies a type mask it can override the default type for
- PCI resources which is &s.code;ResShared&e.code;. The resource
- broker needs to know that to find a matching resource range. This
- function should be called before calling
- &s.code;xf86RegisterResources()&e.code;. The return value is
- &s.code;TRUE&e.code; when the function succeeds.
-
- </quote>
-
- &s.code;Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base)&e.code;
- <quote><p>
- This function checks that the memory base address specified matches
- one of the PCI base address register values for the given PCI
- device. This is mostly used to check that an externally provided
- base address (e.g., from a config file) matches an actual value
- allocated to a device.
-
- </quote>
- </quote>
-
-The driver may replace the generic access control functions for an entity.
-This is done with the &s.code;xf86SetAccessFuncs()&e.code;:
- <quote><p>
- &s.code;void xf86SetAccessFuncs(EntityInfoPtr pEnt,
- &f.indent;xf86SetAccessFuncPtr funcs,
- &f.indent;xf86SetAccessFuncPtr oldFuncs)&e.code;
- <quote><p>
- with:
- </quote>
-
- <verb>
- typedef struct {
- xf86AccessPtr mem;
- xf86AccessPtr io;
- xf86AccessPtr io_mem;
- } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
- </verb>
-
- <quote><p>
- The driver can pass three functions: one for I/O access, one for
- memory access and one for combined memory and I/O access. If the
- memory access and combined access functions are identical the
- common level assumes that the memory access cannot be controlled
- independently of I/O access, if the I/O access function and the
- combined access functions are the same it is assumed that I/O can
- not be controlled independently. If memory and I/O have to be
- controlled together all three values should be the same. If a
- non &s.code;NULL&e.code; value is passed as third argument it is
- interpreted as an address where to store the old access record.
- If the third argument is &s.code;NULL&e.code; it will be assumed
- that the generic access should be enabled before replacing the
- access functions. Otherwise it will be disabled. The driver may
- enable them itself using the returned values. It should do this
- from its replacement access functions as the generic access may
- be disabled by the common level on certain occasions. If replacement
- functions are specified they must control all resources of the
- specific type registered for the entity.
-
- </quote>
- </quote>
-
-To find out if a specific resource range conflicts with another
-resource the &s.code;xf86ChkConflict()&e.code; function may be used:
- <quote><p>
- &s.code;memType xf86ChkConflict(resRange *rgp, int entityIndex)&e.code;
- <quote><p>
- This function checks if the resource range &s.code;rgp&e.code; of
- for the specified entity conflicts with with another resource.
- If a conflict is found, the address of the start of the conflict
- is returned. The return value is zero when there is no conflict.
-
- </quote>
- </quote>
-
-The OPERATING state properties of previously registered fixed resources
-can be set with the &s.code;xf86SetOperatingState()&e.code; function:
- <quote><p>
- &s.code;resPtr xf86SetOperatingState(resList list, int entityIndex,
- &f.indent;int mask)&e.code;
- <quote><p>
- This function is used to set the status of a resource during
- OPERATING state. &s.code;list&e.code; holds a list to which
- &s.code;mask&e.code; is to be applied. The parameter
- &s.code;mask&e.code; may have the value &s.code;ResUnusedOpr&e.code;
- and &s.code;ResDisableOpr&e.code;. The first one should be used
- if a resource isn't used by the driver during OPERATING state
- although it is decoded by the device, while the latter one indicates
- that the resource is not decoded during OPERATING state. Note
- that the resource ranges have to match those specified during
- registration. If a range has been specified starting at
- &s.code;A&e.code; and ending at &s.code;B&e.code; and suppose
- &s.code;C&e.code; us a value satisfying
- &s.code;A&nbsp;&lt;&nbsp;C&nbsp;&lt;&nbsp;B&e.code; one may not
- specify the resource range &s.code;(A,B)&e.code; by splitting it
- into two ranges &s.code;(A,C)&e.code; and &s.code;(C,B)&e.code;.
-
- </quote>
- </quote>
-
-The following two functions are provided for special cases:
- <quote><p>
- &s.code;void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)&e.code;
- <quote><p>
- This function may be used to remove an entity from a screen. This
- only makes sense if a screen has more than one entity assigned or
- the screen is to be deleted. No test is made if the screen has
- any entities left.
-
- </quote>
-
- &s.code;void xf86DeallocateResourcesForEntity(int entityIndex, long type)&e.code;
- <quote><p>
- This function deallocates all resources of a given type registered
- for a certain entity from the resource broker list.
-
- </quote>
- </quote>
-
-<sect2>ScreenInit Phase
-<p>
-
-All that is required in this phase is to setup the RAC flags. Note that
-it is also permissible to set these flags up in the PreInit phase. The
-RAC flags are held in the &s.code;racIoFlags&e.code; and &s.code;racMemFlags&e.code; fields of the
-&s.code;ScrnInfoRec&e.code; for each screen. They specify which graphics operations
-might require the use of shared resources. This can be specified
-separately for memory and I/O resources. The available flags are defined
-in &s.code;rac/xf86RAC.h&e.code;. They are:
-
- &s.code;RAC_FB&e.code;
- <quote>
- for framebuffer operations (including hw acceleration)
- </quote>
- &s.code;RAC_CURSOR&e.code;
- <quote>
- for Cursor operations
- (??? I'm not sure if we need this for SW cursor it depends
- on which level the sw cursor is drawn)
- </quote>
- &s.code;RAC_COLORMAP&e.code;
- <quote>
- for colormap operations
- </quote>
- &s.code;RAC_VIEWPORT&e.code;
- <quote>
- for the call to &s.code;ChipAdjustFrame()&e.code; </quote>
-
-
-The flags are ORed together.
-
-<sect>Config file ``Option'' entries<label id="options">
-<p>
-
-Option entries are permitted in most sections and subsections of the
-config file. There are two forms of option entries:
-
-<descrip>
-<tag>Option "option-name"</tag>
- A boolean option.
-<tag>Option "option-name" "option-value"</tag>
- An option with an arbitrary value.
-</descrip>
-
-The option entries are handled by the parser, and a list of the parsed
-options is included with each of the appropriate data structures that
-the drivers have access to. The data structures used to hold the option
-information are opaque to the driver, and a driver must not access the
-option data directly. Instead, the common layer provides a set of
-functions that may be used to access, check and manipulate the option
-data.
-
-First, the low level option handling functions. In most cases drivers
-would not need to use these directly.
-
- <quote><p>
- &s.code;pointer xf86FindOption(pointer options, const char *name)&e.code;
- <quote><p>
- Takes a list of options and an option name, and returns a handle
- for the first option entry in the list matching the name. Returns
- &s.code;NULL&e.code; if no match is found.
-
- </quote>
-
- &s.code;char *xf86FindOptionValue(pointer options, const char *name)&e.code;
- <quote><p>
- Takes a list of options and an option name, and returns the value
- associated with the first option entry in the list matching the
- name. If the matching option has no value, an empty string
- (&s.code;""&e.code;) is returned. Returns &s.code;NULL&e.code;
- if no match is found.
-
- </quote>
-
- &s.code;void xf86MarkOptionUsed(pointer option)&e.code;
- <quote><p>
- Takes a handle for an option, and marks that option as used.
-
- </quote>
-
- &s.code;void xf86MarkOptionUsedByName(pointer options, const char *name)&e.code;
- <quote><p>
- Takes a list of options and an option name and marks the first
- option entry in the list matching the name as used.
-
- </quote>
- </quote>
-
-
-Next, the higher level functions that most drivers would use.
- <quote><p>
- &s.code;void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)&e.code;
- <quote><p>
- Collect the options from each of the config file sections used by
- the screen (&s.code;pScrn&e.code;) and return the merged list as
- &s.code;pScrn-&gt;options&e.code;. This function requires that
- &s.code;pScrn-&gt;confScreen&e.code;, &s.code;pScrn-&gt;display&e.code;,
- &s.code;pScrn-&gt;monitor&e.code;,
- &s.code;pScrn-&gt;numEntities&e.code;, and
- &s.code;pScrn-&gt;entityList&e.code; are initialised.
- &s.code;extraOpts&e.code; may optionally be set to an additional
- list of options to be combined with the others. The order of
- precedence for options is &s.code;extraOpts&e.code;, display,
- confScreen, monitor, device.
-
- </quote>
-
- &s.code;void xf86ProcessOptions(int scrnIndex, pointer options,
- &f.indent;OptionInfoPtr optinfo)&e.code;
- <quote><p>
- Processes a list of options according to the information in the
- array of &s.code;OptionInfoRecs&e.code; (&s.code;optinfo&e.code;).
- The resulting information is stored in the &s.code;value&e.code;
- fields of the appropriate &s.code;optinfo&e.code; entries. The
- &s.code;found&e.code; fields are set to &s.code;TRUE&e.code;
- when an option with a value of the correct type if found, and
- &s.code;FALSE&e.code; otherwise. The &s.code;type&e.code; field
- is used to determine the expected value type for each option.
- Each option in the list of options for which there is a name match
- (but not necessarily a value type match) is marked as used.
- Warning messages are printed when option values don't match the
- types specified in the optinfo data.
-
- NOTE: If this function is called before a driver's screen number
- is known (e.g., from the &s.code;ChipProbe()&e.code; function) a
- &s.code;scrnIndex&e.code; value of &s.code;-1&e.code; should be
- used.
-
- NOTE 2: Given that this function stores into the
- &s.code;OptionInfoRecs&e.code; pointed to by &s.code;optinfo&e.code,
- the caller should ensure the &s.code;OptionInfoRecs&e.code; are
- (re-)initialised before the call, especially if the caller expects
- to use the predefined option values as defaults.
-
- The &s.code;OptionInfoRec&e.code; is defined as follows:
-
- <verb>
- typedef struct {
- double freq;
- int units;
- } OptFrequency;
-
- typedef union {
- unsigned long num;
- char * str;
- double realnum;
- Bool bool;
- OptFrequency freq;
- } ValueUnion;
-
- typedef enum {
- OPTV_NONE = 0,
- OPTV_INTEGER,
- OPTV_STRING, /* a non-empty string */
- OPTV_ANYSTR, /* Any string, including an empty one */
- OPTV_REAL,
- OPTV_BOOLEAN,
- OPTV_FREQ
- } OptionValueType;
-
- typedef enum {
- OPTUNITS_HZ = 1,
- OPTUNITS_KHZ,
- OPTUNITS_MHZ
- } OptFreqUnits;
-
- typedef struct {
- int token;
- const char* name;
- OptionValueType type;
- ValueUnion value;
- Bool found;
- } OptionInfoRec, *OptionInfoPtr;
- </verb>
-
- &s.code;OPTV_FREQ&e.code; can be used for options values that are
- frequencies. These values are a floating point number with an
- optional unit name appended. The unit name can be one of "Hz",
- "kHz", "k", "MHz", "M". The multiplier associated with the unit
- is stored in &s.code;freq.units&e.code;, and the scaled frequency
- is stored in &s.code;freq.freq&e.code;. When no unit is specified,
- &s.code;freq.units&e.code; is set to &s.code;0&e.code;, and
- &s.code;freq.freq&e.code; is unscaled.
-
- Typical usage is to setup an array of
- &s.code;OptionInfoRecs&e.code; with all fields initialised.
- The &s.code;value&e.code; and &s.code;found&e.code; fields get
- set by &s.code;xf86ProcessOptions()&e.code;. For cases where the
- value parsing is more complex, the driver should specify
- &s.code;OPTV_STRING&e.code;, and parse the string itself. An
- example of using this option handling is included in the
- <ref id="sample" name="Sample Driver"> section.
-
- </quote>
-
- &s.code;void xf86ShowUnusedOptions(int scrnIndex, pointer options)&e.code;
- <quote><p>
- Prints out warning messages for each option in the list of options
- that isn't marked as used. This is intended to show options that
- the driver hasn't recognised. It would normally be called near
- the end of the &s.code;ChipScreenInit()&e.code; function, but only
- when &s.code;serverGeneration&nbsp;==&nbsp;1&e.code;.
-
- </quote>
-
- &s.code;OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table,
- &f.indent;int token)&e.code;
-
- <quote><p>
- Returns a pointer to the &s.code;OptionInfoRec&e.code; in
- &s.code;table&e.code; with a token field matching
- &s.code;token&e.code;. Returns &s.code;NULL&e.code; if no match
- is found.
-
- </quote>
-
- &s.code;Bool xf86IsOptionSet(const OptionInfoRec *table, int token)&e.code;
- <quote><p>
- Returns the &s.code;found&e.code; field of the
- &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
- &s.code;token&e.code; field matching &s.code;token&e.code;. This
- can be used for options of all types. Note that for options of
- type &s.code;OPTV_BOOLEAN&e.code;, it isn't sufficient to check
- this to determine the value of the option. Returns
- &s.code;FALSE&e.code; if no match is found.
-
- </quote>
-
- &s.code;char *xf86GetOptValString(const OptionInfoRec *table, int token)&e.code;
- <quote><p>
- Returns the &s.code;value.str&e.code; field of the
- &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
- token field matching &s.code;token&e.code;. Returns
- &s.code;NULL&e.code; if no match is found.
-
- </quote>
-
- &s.code;Bool xf86GetOptValInteger(const OptionInfoRec *table, int token,
- &f.indent;int *value)&e.code;
- <quote><p>
- Returns via &s.code;*value&e.code; the &s.code;value.num&e.code;
- field of the &s.code;OptionInfoRec&e.code; in &s.code;table&e.code;
- with a &s.code;token&e.code; field matching &s.code;token&e.code;.
- &s.code;*value&e.code; is only changed when a match is found so
- it can be safely initialised with a default prior to calling this
- function. The function return value is as for
- &s.code;xf86IsOptionSet()&e.code;.
-
- </quote>
-
- &s.code;Bool xf86GetOptValULong(const OptionInfoRec *table, int token,
- &f.indent;unsigned long *value)&e.code;
- <quote><p>
- Like &s.code;xf86GetOptValInteger()&e.code;, except the value is
- treated as an &s.code;unsigned long&e.code;.
-
- </quote>
-
- &s.code;Bool xf86GetOptValReal(const OptionInfoRec *table, int token,
- &f.indent;double *value)&e.code;
- <quote><p>
- Like &s.code;xf86GetOptValInteger()&e.code;, except that
- &s.code;value.realnum&e.code; is used.
-
- </quote>
-
- &s.code;Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
- &f.indent;OptFreqUnits expectedUnits, double *value)&e.code;
- <quote><p>
- Like &s.code;xf86GetOptValInteger()&e.code;, except that the
- &s.code;value.freq&e.code; data is returned. The frequency value
- is scaled to the units indicated by &s.code;expectedUnits&e.code;.
- The scaling is exact when the units were specified explicitly in
- the option's value. Otherwise, the &s.code;expectedUnits&e.code;
- field is used as a hint when doing the scaling. In this case,
- values larger than &s.code;1000&e.code; are assumed to have be
- specified in the next smallest units. For example, if the Option
- value is "10000" and expectedUnits is &s.code;OPTUNITS_MHZ&e.code;,
- the value returned is &s.code;10&e.code;.
-
- </quote>
-
- &s.code;Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)&e.code;
- <quote><p>
- This function is used to check boolean options
- (&s.code;OPTV_BOOLEAN&e.code;). If the function return value is
- &s.code;FALSE&e.code;, it means the option wasn't set. Otherwise
- &s.code;*value&e.code; is set to the boolean value indicated by
- the option's value. No option &s.code;value&e.code; is interpreted
- as &s.code;TRUE&e.code;. Option values meaning &s.code;TRUE&e.code;
- are "1", "yes", "on", "true", and option values meaning
- &s.code;FALSE&e.code; are "0", "no", "off", "false". Option names
- both with the "no" prefix in their names, and with that prefix
- removed are also checked and handled in the obvious way.
- &s.code;*value&e.code; is not changed when the option isn't present.
- It should normally be set to a default value before calling this
- function.
-
- </quote>
-
- &s.code;Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)&e.code;
- <quote><p>
- This function is used to check boolean options
- (&s.code;OPTV_BOOLEAN&e.code;). If the option is set, its value
- is returned. If the options is not set, the default value specified
- by &s.code;def&e.code; is returned. The option interpretation is
- the same as for &s.code;xf86GetOptValBool()&e.code;.
-
- </quote>
-
- &s.code;int xf86NameCmp(const char *s1, const char *s2)&e.code;
- <quote><p>
- This function should be used when comparing strings from the config
- file with expected values. It works like &s.code;strcmp()&e.code;,
- but is not case sensitive and space, tab, and `<tt>_</tt>' characters
- are ignored in the comparison. The use of this function isn't
- restricted to parsing option values. It may be used anywhere
- where this functionality required.
-
- </quote>
- </quote>
-
-<sect>Modules, Drivers, Include Files and Interface Issues
-<p>
-
-NOTE: this section is incomplete.
-
-
-<sect1>Include files
-<p>
-
-The following include files are typically required by video drivers:
-
- <quote><p>
- All drivers should include these:
- <quote>
- &s.code;"xf86.h"&nl;
- "xf86_OSproc.h"&nl;
- "xf86_ansic.h"&nl;
- "xf86Resources.h"&e.code;
- </quote>
- Wherever inb/outb (and related things) are used the following should be
- included:
- <quote>
- &s.code;"compiler.h"&e.code;
- </quote>
- Note: in drivers, this must be included after &s.code;"xf86_ansic.h"&e.code;.
-
- Drivers that need to access PCI vendor/device definitions need this:
- <quote>
- &s.code;"xf86PciInfo.h"&e.code;
- </quote>
-
- Drivers that need to access the PCI config space need this:
- <quote>
- &s.code;"xf86Pci.h"&e.code;
- </quote>
-
- Drivers that initialise a SW cursor need this:
- <quote>
- &s.code;"mipointer.h"&e.code;
- </quote>
-
- All drivers implementing backing store need this:
- <quote>
- &s.code;"mibstore.h"&e.code;
- </quote>
-
- All drivers using the mi colourmap code need this:
- <quote>
- &s.code;"micmap.h"&e.code;
- </quote>
-
- If a driver uses the vgahw module, it needs this:
- <quote>
- &s.code;"vgaHW.h"&e.code;
- </quote>
-
- Drivers supporting VGA or Hercules monochrome screens need:
- <quote>
- &s.code;"xf1bpp.h"&e.code;
- </quote>
-
- Drivers supporting VGA or EGC 16-colour screens need:
- <quote>
- &s.code;"xf4bpp.h"&e.code;
- </quote>
-
- Drivers using cfb need:
- <quote>
- &s.code;#define PSZ 8&nl;
- #include "cfb.h"&nl;
- #undef PSZ&e.code;
- </quote>
-
- Drivers supporting bpp 16, 24 or 32 with cfb need one or more of:
- <quote>
- &s.code;"cfb16.h"&nl;
- "cfb24.h"&nl;
- "cfb32.h"&e.code;
- </quote>
-
- If a driver uses XAA, it needs these:
- <quote>
- &s.code;"xaa.h"&nl;
- "xaalocal.h"&e.code;
- </quote>
-
- If a driver uses the fb manager, it needs this:
- <quote>
- &s.code;"xf86fbman.h"&e.code;
- </quote>
- </quote>
-
-Non-driver modules should include &s.code;"xf86_ansic.h"&e.code; to get the correct
-wrapping of ANSI C/libc functions.
-
-All modules must NOT include any system include files, or the following:
-
- <quote>
- &s.code;"xf86Priv.h"&nl;
- "xf86Privstr.h"&nl;
- "xf86_OSlib.h"&nl;
- "Xos.h"&e.code;
- </quote>
-
-In addition, "xf86_libc.h" must not be included explicitly. It is
-included implicitly by "xf86_ansic.h".
-
-
-<sect>Offscreen Memory Manager
-<p>
-
-Management of offscreen video memory may be handled by the XFree86
-framebuffer manager. Once the offscreen memory manager is running,
-drivers or extensions may allocate, free or resize areas of offscreen
-video memory using the following functions (definitions taken from
-&s.code;xf86fbman.h&e.code;):
-
-<code>
- typedef struct _FBArea {
- ScreenPtr pScreen;
- BoxRec box;
- int granularity;
- void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*)
- void (*RemoveAreaCallback)(struct _FBArea*)
- DevUnion devPrivate;
- } FBArea, *FBAreaPtr;
-
- typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr from, FBAreaPtr to)
- typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr)
-
- FBAreaPtr xf86AllocateOffscreenArea (
- ScreenPtr pScreen,
- int width, int height,
- int granularity,
- MoveAreaCallbackProcPtr MoveAreaCallback,
- RemoveAreaCallbackProcPtr RemoveAreaCallback,
- pointer privData
- )
-
- void xf86FreeOffscreenArea (FBAreaPtr area)
-
- Bool xf86ResizeOffscreenArea (
- FBAreaPtr area
- int w, int h
- )
-</code>
-
-The function:
-<quote>
- &s.code;Bool xf86FBManagerRunning(ScreenPtr pScreen)&e.code;
-</quote>
-
-can be used by an extension to check if the driver has initialized
-the memory manager. The manager is not available if this returns
-&s.code;FALSE&e.code; and the functions above will all fail.
-
-
-&s.code;xf86AllocateOffscreenArea()&e.code; can be used to request a
-rectangle of dimensions &s.code;width&e.code; x &s.code;height&e.code;
-(in pixels) from unused offscreen memory. &s.code;granularity&e.code;
-specifies that the leftmost edge of the rectangle must lie on some
-multiple of &s.code;granularity&e.code; pixels. A granularity of zero
-means the same thing as a granularity of one - no alignment preference.
-A &s.code;MoveAreaCallback&e.code; can be provided to notify the requester
-when the offscreen area is moved. If no &s.code;MoveAreaCallback&e.code;
-is supplied then the area is considered to be immovable. The
-&s.code;privData&e.code; field will be stored in the manager's internal
-structure for that allocated area and will be returned to the requester
-in the &s.code;FBArea&e.code; passed via the
-&s.code;MoveAreaCallback&e.code;. An optional
-&s.code;RemoveAreaCallback&e.code; is provided. If the driver provides
-this it indicates that the area should be allocated with a lower priority.
-Such an area may be removed when a higher priority request (one that
-doesn't have a &s.code;RemoveAreaCallback&e.code;) is made. When this
-function is called, the driver will have an opportunity to do whatever
-cleanup it needs to do to deal with the loss of the area, but it must
-finish its cleanup before the function exits since the offscreen memory
-manager will free the area immediately after.
-
-&s.code;xf86AllocateOffscreenArea()&e.code; returns &s.code;NULL&e.code;
-if it was unable to allocate the requested area. When no longer needed,
-areas should be freed with &s.code;xf86FreeOffscreenArea()&e.code;.
-
-&s.code;xf86ResizeOffscreenArea()&e.code; resizes an existing
-&s.code;FBArea&e.code;. &s.code;xf86ResizeOffscreenArea()&e.code;
-returns &s.code;TRUE&e.code; if the resize was successful. If
-&s.code;xf86ResizeOffscreenArea()&e.code; returns &s.code;FALSE&e.code;,
-the original &s.code;FBArea&e.code; is left unmodified. Resizing an
-area maintains the area's original &s.code;granularity&e.code;,
-&s.code;devPrivate&e.code;, and &s.code;MoveAreaCallback&e.code;.
-&s.code;xf86ResizeOffscreenArea()&e.code; has considerably less overhead
-than freeing the old area then reallocating the new size, so it should
-be used whenever possible.
-
-The function:
- <quote>
- &s.code;Bool xf86QueryLargestOffscreenArea(
- &f.indent;ScreenPtr pScreen,
- &f.indent;int *width, int *height,
- &f.indent;int granularity,
- &f.indent;int preferences,
- &f.indent;int priority
- &nl)&e.code;
- </quote>
-
-is provided to query the width and height of the largest single
-&s.code;FBArea&e.code; allocatable given a particular priority.
-&s.code;preferences&e.code; can be one of the following to indicate
-whether width, height or area should be considered when determining
-which is the largest single &s.code;FBArea&e.code; available.
-
- <quote>
- &s.code;FAVOR_AREA_THEN_WIDTH&nl;
- FAVOR_AREA_THEN_HEIGHT&nl;
- FAVOR_WIDTH_THEN_AREA&nl;
- FAVOR_HEIGHT_THEN_AREA&e.code;
- </quote>
-
-&s.code;priority&e.code; is one of the following:
-
- <quote><p>
- &s.code;PRIORITY_LOW&e.code;
- <quote><p>
- Return the largest block available without stealing anyone else's
- space. This corresponds to the priority of allocating a
- &s.code;FBArea&e.code; when a &s.code;RemoveAreaCallback&e.code;
- is provided.
-
- </quote>
- &s.code;PRIORITY_NORMAL&e.code;
- <quote><p>
- Return the largest block available if it is acceptable to steal a
- lower priority area from someone. This corresponds to the priority
- of allocating a &s.code;FBArea&e.code; without providing a
- &s.code;RemoveAreaCallback&e.code;.
-
- </quote>
- &s.code;PRIORITY_EXTREME&e.code;
- <quote><p>
- Return the largest block available if all &s.code;FBAreas&e.code;
- that aren't locked down were expunged from memory first. This
- corresponds to any allocation made directly after a call to
- &s.code;xf86PurgeUnlockedOffscreenAreas()&e.code;.
-
- </quote>
- </quote>
-
-
-The function:
-
- <quote>
- &s.code;Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen)&e.code;
- </quote>
-
-is provided as an extreme method to free up offscreen memory. This
-will remove all removable &s.code;FBArea&e.code; allocations.
-
-
-Initialization of the XFree86 framebuffer manager is done via
-
- <quote>
- &s.code;Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox)&e.code;
- </quote>
-
-&s.code;FullBox&e.code; represents the area of the framebuffer that the
-manager is allowed to manage. This is typically a box with a width of
-&s.code;pScrn-&gt;displayWidth&e.code; and a height of as many lines as
-can be fit within the total video memory, however, the driver can reserve
-areas at the extremities by passing a smaller area to the manager.
-
-&s.code;xf86InitFBManager()&e.code; must be called before XAA is
-initialized since XAA uses the manager for it's pixmap cache.
-
-An alternative function is provided to allow the driver to initialize
-the framebuffer manager with a Region rather than a box.
-
- <quote>
- &s.code;Bool xf86InitFBManagerRegion(ScreenPtr pScreen,
- &f.indent;RegionPtr FullRegion)&e.code;
- </quote>
-
-&s.code;xf86InitFBManagerRegion()&e.code;, unlike
-&s.code;xf86InitFBManager()&e.code;, does not remove the area used for
-the visible screen so that area should not be included in the region
-passed to the function. &s.code;xf86InitFBManagerRegion()&e.code; is
-useful when non-contiguous areas are available to be managed, and is
-required when multiple framebuffers are stored in video memory (as in
-the case where an overlay of a different depth is stored as a second
-framebuffer in offscreen memory).
-
-
-<sect>Colormap Handling<label id="cmap">
-<p>
-
-A generic colormap handling layer is provided within the XFree86 common
-layer. This layer takes care of most of the details, and only requires
-a function from the driver that loads the hardware palette when required.
-To use the colormap layer, a driver calls the
-&s.code;xf86HandleColormaps()&e.code; function.
-
- <quote><p>
- &s.code;Bool xf86HandleColormaps(ScreenPtr pScreen, int maxColors,
- &f.indent;int sigRGBbits, LoadPaletteFuncPtr loadPalette,
- &f.indent;SetOverscanFuncPtr setOverscan,
- unsigned int flags)&e.code;
- <quote><p>
- This function must be called after the default colormap has been
- initialised. The &s.code;pScrn-&gt;gamma&e.code; field must also
- be initialised, preferably by calling &s.code;xf86SetGamma()&e.code;.
- &s.code;maxColors&e.code; is the number of entries in the palette.
- &s.code;sigRGBbits&e.code; is the size in bits of each color
- component in the DAC's palette. &s.code;loadPalette&e.code;
- is a driver-provided function for loading a colormap into the
- hardware, and is described below. &s.code;setOverscan&e.code; is
- an optional function that may be provided when the overscan color
- is an index from the standard LUT and when it needs to be adjusted
- to keep it as close to black as possible. The
- &s.code;setOverscan&e.code; function programs the overscan index.
- It shouldn't normally be used for depths other than 8.
- &s.code;setOverscan&e.code; should be set to &s.code;NULL&e.code;
- when it isn't needed. &s.code;flags&e.code; may be set to the
- following (which may be ORed together):
-
- &s.code;CMAP_PALETTED_TRUECOLOR&e.code;
- <quote><p>
- the TrueColor visual is paletted and is
- just a special case of DirectColor.
- This flag is only valid for
- &s.code;bpp&nbsp;&gt;&nbsp;8&e.code;.
-
- </quote>
-
- &s.code;CMAP_RELOAD_ON_MODE_SWITCH&e.code;
- <quote><p>
- reload the colormap automatically
- after mode switches. This is useful
- for when the driver is resetting the
- hardware during mode switches and
- corrupting or erasing the hardware
- palette.
-
- </quote>
-
- &s.code;CMAP_LOAD_EVEN_IF_OFFSCREEN&e.code;
- <quote><p>
- reload the colormap even if the screen
- is switched out of the server's VC.
- The palette is <it>not</it> reloaded when
- the screen is switched back in, nor after
- mode switches. This is useful when the
- driver needs to keep track of palette
- changes.
-
- </quote>
-
- The colormap layer normally reloads the palette after VT enters so it
- is not necessary for the driver to save and restore the palette
- when switching VTs. The driver must, however, still save the
- initial palette during server start up and restore it during
- server exit.
-
- </quote>
-
- &s.code;void LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- &f.indent;LOCO *colors, VisualPtr pVisual)&e.code;
- <quote><p>
- &s.code;LoadPalette()&e.code; is a driver-provided function for
- loading a colormap into hardware. &s.code;colors&e.code; is the
- array of RGB values that represent the full colormap.
- &s.code;indices&e.code; is a list of index values into the colors
- array. These indices indicate the entries that need to be updated.
- &s.code;numColors&e.code; is the number of the indices to be
- updated.
-
- </quote>
-
- &s.code;void SetOverscan(ScrnInfoPtr pScrn, int overscan)&e.code;
- <quote><p>
- &s.code;SetOverscan()&e.code; is a driver-provided function for
- programming the &s.code;overscan&e.code; index. As described
- above, it is normally only appropriate for LUT modes where all
- colormap entries are available for the display, but where one of
- them is also used for the overscan (typically 8bpp for VGA compatible
- LUTs). It isn't required in cases where the overscan area is
- never visible.
-
- </quote>
- </quote>
-
-
-<sect>DPMS Extension
-<p>
-
-Support code for the DPMS extension is included in the XFree86 common layer.
-This code provides an interface between the main extension code, and a means
-for drivers to initialise DPMS when they support it. One function is
-available to drivers to do this initialisation, and it is always available,
-even when the DPMS extension is not supported by the core server (in
-which case it returns a failure result).
-
-
- <quote><p>
- &s.code;Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)&e.code;
- <quote><p>
- This function registers a driver's DPMS level programming function
- &s.code;set&e.code;. It also checks
- &s.code;pScrn-&gt;options&e.code; for the "dpms" option, and when
- present marks DPMS as being enabled for that screen. The
- &s.code;set&e.code; function is called whenever the DPMS level
- changes, and is used to program the requested level.
- &s.code;flags&e.code; is currently not used, and should be
- &s.code;0&e.code;. If the initialisation fails for any reason,
- including when there is no DPMS support in the core server, the
- function returns &s.code;FALSE&e.code;.
-
- </quote>
- </quote>
-
-
-Drivers that implement DPMS support must provide the following function,
-that gets called when the DPMS level is changed:
-
-
- <quote><p>
- &s.code;void ChipDPMSSet(ScrnInfoPtr pScrn, int level, int flags)&e.code;
- <quote><p>
- Program the DPMS level specified by &s.code;level&e.code;. Valid
- values of &s.code;level&e.code; are &s.code;DPMSModeOn&e.code;,
- &s.code;DPMSModeStandby&e.code;, &s.code;DPMSModeSuspend&e.code;,
- &s.code;DPMSModeOff&e.code;. These values are defined in
- &s.code;"extensions/dpms.h"&e.code;.
-
- </quote>
- </quote>
-
-
-<sect>DGA Extension
-<p>
-
-Drivers can support the XFree86 Direct Graphics Architecture (DGA) by
-filling out a structure of function pointers and a list of modes and
-passing them to DGAInit.
-
- <quote><p>
- &s.code;Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
- &f.indent;DGAModePtr modes, int num)&e.code;
- <quote><p>
- <verb>
-/** The DGAModeRec **/
-
-typedef struct {
- int num;
- DisplayModePtr mode;
- int flags;
- int imageWidth;
- int imageHeight;
- int pixmapWidth;
- int pixmapHeight;
- int bytesPerScanline;
- int byteOrder;
- int depth;
- int bitsPerPixel;
- unsigned long red_mask;
- unsigned long green_mask;
- unsigned long blue_mask;
- int viewportWidth;
- int viewportHeight;
- int xViewportStep;
- int yViewportStep;
- int maxViewportX;
- int maxViewportY;
- int viewportFlags;
- int offset;
- unsigned char *address;
- int reserved1;
- int reserved2;
-} DGAModeRec, *DGAModePtr;
-</verb>
-
- &s.code;num&e.code;
- <quote>
- Can be ignored. The DGA DDX will assign these numbers.
- </quote>
-
- &s.code;mode&e.code;
- <quote>
- A pointer to the &s.code;DisplayModeRec&e.code; for this mode.
- </quote>
-
- &s.code;flags&e.code;
- <quote><p>
- The following flags are defined and may be OR'd together:
-
- &s.code;DGA_CONCURRENT_ACCESS&e.code;
- <quote><p>
- Indicates that the driver supports concurrent graphics
- accelerator and linear framebuffer access.
-
- </quote>
-
- &s.code;DGA_FILL_RECT&nl;
- DGA_BLIT_RECT&nl;
- DGA_BLIT_RECT_TRANS&e.code;
- <quote><p>
- Indicates that the driver supports the FillRect, BlitRect
- or BlitTransRect functions in this mode.
-
- </quote>
-
- &s.code;DGA_PIXMAP_AVAILABLE&e.code;
- <quote><p>
- Indicates that Xlib may be used on the framebuffer.
- This flag will usually be set unless the driver wishes
- to prohibit this for some reason.
-
- </quote>
-
- &s.code;DGA_INTERLACED&nl;
- DGA_DOUBLESCAN&e.code;
- <quote><p>
- Indicates that these are interlaced or double scan modes.
-
- </quote>
- </quote>
-
- &s.code;imageWidth&nl;
- imageHeight&e.code;
- <quote><p>
- These are the dimensions of the linear framebuffer
- accessible by the client.
-
- </quote>
-
- &s.code;pixmapWidth&nl;
- pixmapHeight&e.code;
- <quote><p>
- These are the dimensions of the area of the
- framebuffer accessible by the graphics accelerator.
-
- </quote>
-
- &s.code;bytesPerScanline&e.code;
- <quote><p>
- Pitch of the framebuffer in bytes.
-
- </quote>
-
- &s.code;byteOrder&e.code;
- <quote><p>
- Usually the same as
- &s.code;pScrn-&gt;imageByteOrder&e.code;.
-
- </quote>
-
- &s.code;depth&e.code;
- <quote><p>
- The depth of the framebuffer in this mode.
-
- </quote>
-
- &s.code;bitsPerPixel&e.code;
- <quote><p>
- The number of bits per pixel in this mode.
-
- </quote>
-
- &s.code;red_mask&nl;
- green_mask&nl;
- blue_mask&e.code;
- <quote><p>
- The RGB masks for this mode, if applicable.
-
- </quote>
-
- &s.code;viewportWidth&nl;
- viewportHeight&e.code;
- <quote><p>
- Dimensions of the visible part of the framebuffer.
- Usually &s.code;mode-&gt;HDisplay&e.code; and
- &s.code;mode-&gt;VDisplay&e.code;.
-
- </quote>
-
- &s.code;xViewportStep&nl;
- yViewportStep&e.code;
- <quote><p>
- The granularity of x and y viewport positions that
- the driver supports in this mode.
-
- </quote>
-
- &s.code;maxViewportX&nl;
- maxViewportY&e.code;
- <quote><p>
- The maximum viewport position supported by the
- driver in this mode.
-
- </quote>
-
- &s.code;viewportFlags&e.code;
- <quote><p>
- The following may be OR'd together:
-
- &s.code;DGA_FLIP_IMMEDIATE&e.code;
- <quote><p>
- The driver supports immediate viewport changes.
-
- </quote>
- &s.code;DGA_FLIP_RETRACE&e.code;
- <quote<p>
- The driver supports viewport changes at retrace.
-
- </quote>
- </quote>
-
- &s.code;offset&e.code;
- <quote><p>
- The offset into the linear framebuffer that corresponds to
- pixel (0,0) for this mode.
-
- </quote>
-
- &s.code;address&e.code;
- <quote><p>
- The virtual address of the framebuffer as mapped by the driver.
- This is needed when DGA_PIXMAP_AVAILABLE is set.
-
- </quote>
-
- <verb>
-/** The DGAFunctionRec **/
-
-typedef struct {
- Bool (*OpenFramebuffer)(
- ScrnInfoPtr pScrn,
- char **name,
- unsigned char **mem,
- int *size,
- int *offset,
- int *extra
- );
- void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
- Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
- void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
- int (*GetViewport)(ScrnInfoPtr pScrn);
- void (*Sync)(ScrnInfoPtr);
- void (*FillRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned long color
- );
- void (*BlitRect)(
- ScrnInfoPtr pScrn,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty
- );
- void (*BlitTransRect)(
- ScrnInfoPtr pScrn,
- int srcx, int srcy,
- int w, int h,
- int dstx, int dsty,
- unsigned long color
- );
-} DGAFunctionRec, *DGAFunctionPtr;
-</verb>
-
- </quote>
-
- &s.code;Bool OpenFramebuffer (pScrn, name, mem, size, offset, extra)&e.code;
- <quote><p>
- &s.code;OpenFramebuffer()&e.code; should pass the client everything
- it needs to know to be able to open the framebuffer. These
- parameters are OS specific and their meanings are to be interpreted
- by an OS specific client library.
-
- &s.code;name&e.code;
- <quote><p>
- The name of the device to open or &s.code;NULL&e.code; if
- there is no special device to open. A &s.code;NULL&e.code;
- name tells the client that it should open whatever device
- one would usually open to access physical memory.
-
- </quote>
- &s.code;mem&e.code;
- <quote><p>
- The physical address of the start of the framebuffer.
-
- </quote>
- &s.code;size&e.code;
- <quote><p>
- The size of the framebuffer in bytes.
-
- </quote>
- &s.code;offset&e.code;
- <quote><p>
- Any offset into the device, if applicable.
-
- </quote>
- &s.code;flags&e.code;
- <quote><p>
- Any additional information that the client may need.
- Currently, only the &s.code;DGA_NEED_ROOT&e.code; flag is
- defined.
-
- </quote>
- </quote>
-
- &s.code;void CloseFramebuffer (pScrn)&e.code;
- <quote><p>
- &s.code;CloseFramebuffer()&e.code; merely informs the driver (if it
- even cares) that client no longer needs to access the framebuffer
- directly. This function is optional.
-
- </quote>
-
- &s.code;Bool SetMode (pScrn, pMode)&e.code;
- <quote><p>
- &s.code;SetMode()&e.code; tells the driver to initialize the mode
- passed to it. If &s.code;pMode&e.code; is &s.code;NULL&e.code;,
- then the driver should restore the original pre-DGA mode.
-
- </quote>
-
- &s.code;void SetViewport (pScrn, x, y, flags)&e.code;
- <quote><p>
- &s.code;SetViewport()&e.code; tells the driver to make the upper
- left-hand corner of the visible screen correspond to coordinate
- &s.code;(x,y)&e.code; on the framebuffer. &s.code;Flags&e.code;
- currently defined are:
-
- &s.code;DGA_FLIP_IMMEDIATE&e.code;
- <quote><p>
- The viewport change should occur immediately.
-
- </quote>
- &s.code;DGA_FLIP_RETRACE&e.code;
- <quote><p>
- The viewport change should occur at the
- vertical retrace, but this function should
- return sooner if possible.
-
- </quote>
- The &s.code;(x,y)&e.code; locations will be passed as the client
- specified them, however, the driver is expected to round these
- locations down to the next supported location as specified by the
- &s.code;xViewportStep&e.code; and &s.code;yViewportStep&e.code;
- for the current mode.
-
- </quote>
-
- &s.code;int GetViewport (pScrn)&e.code;
- <quote><p>
- &s.code;GetViewport()&e.code; gets the current page flip status.
- Set bits in the returned int correspond to viewport change requests
- still pending. For instance, set bit zero if the last SetViewport
- request is still pending, bit one if the one before that is still
- pending, etc.
-
- </quote>
-
- &s.code;void Sync (pScrn)&e.code;
- <quote><p>
- This function should ensure that any graphics accelerator operations
- have finished. This function should not return until the graphics
- accelerator is idle.
-
- </quote>
-
- &s.code;void FillRect (pScrn, x, y, w, h, color)&e.code;
- <quote><p>
- This optional function should fill a rectangle
- &s.code;w&nbsp;&times;&nbsp;h&e.code; located at
- &s.code;(x,y)&e.code; in the given color.
-
- </quote>
-
- &s.code;void BlitRect (pScrn, srcx, srcy, w, h, dstx, dsty)&e.code;
- <quote><p>
- This optional function should copy an area
- &s.code;w&nbsp;&times;&nbsp;h&e.code; located at
- &s.code;(srcx,srcy)&e.code; to location &s.code;(dstx,dsty)&e.code;.
- This function will need to handle copy directions as appropriate.
-
- </quote>
-
- &s.code;void BlitTransRect (pScrn, srcx, srcy, w, h, dstx, dsty, color)&e.code;
- <quote><p>
- This optional function is the same as BlitRect except that pixels
- in the source corresponding to the color key &s.code;color&e.code;
- should be skipped.
-
- </quote>
- </quote>
-
-<sect>The XFree86 X Video Extension (Xv) Device Dependent Layer
-<p>
-
-XFree86 offers the X Video Extension which allows clients to treat video
-as any another primitive and ``Put'' video into drawables. By default,
-the extension reports no video adaptors as being available since the
-DDX layer has not been initialized. The driver can initialize the DDX
-layer by filling out one or more &s.code;XF86VideoAdaptorRecs&e.code;
-as described later in this document and passing a list of
-&s.code;XF86VideoAdaptorPtr&e.code; pointers to the following function:
-
- <quote>
- &s.code;Bool xf86XVScreenInit(
- &f.indent;ScreenPtr pScreen,
- &f.indent;XF86VideoAdaptorPtr *adaptPtrs,
- &f.indent;int num)&e.code;
- </quote>
-
-After doing this, the extension will report video adaptors as being
-available, providing the data in their respective
-&s.code;XF86VideoAdaptorRecs&e.code; was valid.
-&s.code;xf86XVScreenInit()&e.code; <em>copies</em> data from the structure
-passed to it so the driver may free it after the initialization. At
-the moment, the DDX only supports rendering into Window drawables.
-Pixmap rendering will be supported after a sufficient survey of suitable
-hardware is completed.
-
-The &s.code;XF86VideoAdaptorRec&e.code;:
-
-<quote><p>
-<verb>
-typedef struct {
- unsigned int type;
- int flags;
- char *name;
- int nEncodings;
- XF86VideoEncodingPtr pEncodings;
- int nFormats;
- XF86VideoFormatPtr pFormats;
- int nPorts;
- DevUnion *pPortPrivates;
- int nAttributes;
- XF86AttributePtr pAttributes;
- int nImages;
- XF86ImagePtr pImages;
- PutVideoFuncPtr PutVideo;
- PutStillFuncPtr PutStill;
- GetVideoFuncPtr GetVideo;
- GetStillFuncPtr GetStill;
- StopVideoFuncPtr StopVideo;
- SetPortAttributeFuncPtr SetPortAttribute;
- GetPortAttributeFuncPtr GetPortAttribute;
- QueryBestSizeFuncPtr QueryBestSize;
- PutImageFuncPtr PutImage;
- QueryImageAttributesFuncPtr QueryImageAttributes;
-} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr;
-</verb>
-
- Each adaptor will have its own XF86VideoAdaptorRec. The fields are
- as follows:
-
- &s.code;type&e.code;
- <quote><p>
- This can be any of the following flags OR'd together.
-
- &s.code;XvInputMask&e.code;
- &s.code;XvOutputMask&e.code;
- <quote><p>
- These refer to the target drawable and are similar to a Window's
- class. &s.code;XvInputMask&e.code; indicates that the adaptor
- can put video into a drawable. &s.code;XvOutputMask&e.code;
- indicates that the adaptor can get video from a drawable.
- </quote>
-
- &s.code;XvVideoMask&e.code;
- &s.code;XvStillMask&e.code;
- &s.code;XvImageMask&e.code;
- <quote><p>
- These indicate that the adaptor supports video, still or
- image primitives respectively.
- </quote>
-
- &s.code;XvWindowMask&e.code;
- &s.code;XvPixmapMask&e.code;
- <quote><p>
- These indicate the types of drawables the adaptor is capable
- of rendering into. At the moment, Pixmap rendering is not
- supported and the &s.code;XvPixmapMask&e.code; flag is ignored.
- </quote>
-
- </quote>
-
- &s.code;flags&e.code;
- <quote><p>
- Currently, the following flags are defined:
-
- &s.code;VIDEO_NO_CLIPPING&e.code;
- <quote><p>
- This indicates that the video adaptor does not support
- clipping. The driver will never receive ``Put'' requests
- where less than the entire area determined by
- &s.code;drw_x&e.code;, &s.code;drw_y&e.code;,
- &s.code;drw_w&e.code; and &s.code;drw_h&e.code; is visible.
- This flag does not apply to ``Get'' requests. Hardware
- that is incapable of clipping ``Gets'' may punt or get
- the extents of the clipping region passed to it.
-
- </quote>
-
- &s.code;VIDEO_INVERT_CLIPLIST&e.code;
- <quote><p>
- This indicates that the video driver requires the clip
- list to contain the regions which are obscured rather
- than the regions which are are visible.
-
- </quote>
-
- &s.code;VIDEO_OVERLAID_STILLS&e.code;
- <quote><p>
- Implementing PutStill for hardware that does video as an
- overlay can be awkward since it's unclear how long to leave
- the video up for. When this flag is set, StopVideo will be
- called whenever the destination gets clipped or moved so that
- the still can be left up until then.
-
- </quote>
-
- &s.code;VIDEO_OVERLAID_IMAGES&e.code;
- <quote><p>
- Same as &s.code;VIDEO_OVERLAID_STILLS&e.code; but for images.
- </quote>
-
- &s.code;VIDEO_CLIP_TO_VIEWPORT&e.code;
- <quote><p>
- Indicates that the clip region passed to the driver functions
- should be clipped to the visible portion of the screen in the
- case where the viewport is smaller than the virtual desktop.
- </quote>
-
- </quote>
-
- &s.code;name&e.code;
- <quote><p>
- The name of the adaptor.
-
- </quote>
-
- &s.code;nEncodings&nl;
- pEncodings&e.code;
- <quote><p>
- The number of encodings the adaptor is capable of and pointer
- to the &s.code;XF86VideoEncodingRec&e.code; array. The
- &s.code;XF86VideoEncodingRec&e.code; is described later on.
- For drivers that only support XvImages there should be an encoding
- named "XV_IMAGE" and the width and height should specify
- the maximum size source image supported.
-
- </quote>
-
- &s.code;nFormats&nl;
- pFormats&e.code;
- <quote><p>
- The number of formats the adaptor is capable of and pointer to
- the &s.code;XF86VideoFormatRec&e.code; array. The
- &s.code;XF86VideoFormatRec&e.code; is described later on.
-
- </quote>
-
- &s.code;nPorts&nl;
- pPortPrivates&e.code;
- <quote><p>
- The number of ports is the number of separate data streams which
- the adaptor can handle simultaneously. If you have more than
- one port, the adaptor is expected to be able to render into more
- than one window at a time. &s.code;pPortPrivates&e.code; is
- an array of pointers or ints - one for each port. A port's
- private data will be passed to the driver any time the port is
- requested to do something like put the video or stop the video.
- In the case where there may be many ports, this enables the
- driver to know which port the request is intended for. Most
- commonly, this will contain a pointer to the data structure
- containing information about the port. In Xv, all ports on
- a particular adaptor are expected to be identical in their
- functionality.
-
- </quote>
-
- &s.code;nAttributes&nl;
- pAttributes&e.code;
- <quote><p>
- The number of attributes recognized by the adaptor and a pointer to
- the array of &s.code;XF86AttributeRecs&e.code;. The
- &s.code;XF86AttributeRec&e.code; is described later on.
-
- </quote>
-
- &s.code;nImages&nl;
- pImages&e.code;
- <quote><p>
- The number of &s.code;XF86ImageRecs&e.code; supported by the adaptor
- and a pointer to the array of &s.code;XF86ImageRecs&e.code;. The
- &s.code;XF86ImageRec&e.code; is described later on.
-
- </quote>
-
-
- &s.code;PutVideo PutStill GetVideo GetStill StopVideo
- SetPortAttribute GetPortAttribute QueryBestSize PutImage
- QueryImageAttributes&e.code;
- <quote><p>
- These functions define the DDX-&gt;driver interface. In each
- case, the pointer &s.code;data&e.code; is passed to the driver.
- This is the port private for that port as described above. All
- fields are required except under the following conditions:
-
- <enum>
- <item>&s.code;PutVideo&e.code;, &s.code;PutStill&e.code; and
- the image routines &s.code;PutImage&e.code; and
- &s.code;QueryImageAttributes&e.code; are not required when the
- adaptor type does not contain &s.code;XvInputMask&e.code;.
-
- <item>&s.code;GetVideo&e.code; and &s.code;GetStill&e.code;
- are not required when the adaptor type does not contain
- &s.code;XvOutputMask&e.code;.
-
- <item>&s.code;GetVideo&e.code; and &s.code;PutVideo&e.code;
- are not required when the adaptor type does not contain
- &s.code;XvVideoMask&e.code;.
-
- <item>&s.code;GetStill&e.code; and &s.code;PutStill&e.code;
- are not required when the adaptor type does not contain
- &s.code;XvStillMask&e.code;.
-
- <item>&s.code;PutImage&e.code; and &s.code;QueryImageAttributes&e.code;
- are not required when the adaptor type does not contain
- &s.code;XvImageMask&e.code;.
-
- </enum>
-
- With the exception of &s.code;QueryImageAttributes&e.code;, these
- functions should return &s.code;Success&e.code; if the operation was
- completed successfully. They can return &s.code;XvBadAlloc&e.code;
- otherwise. &s.code;QueryImageAttributes&e.code; returns the size
- of the XvImage queried.
-
- If the &s.code;VIDEO_NO_CLIPPING&e.code;
- flag is set, the &s.code;clipBoxes&e.code; may be ignored by
- the driver. &s.code;ClipBoxes&e.code; is an &s.code;X-Y&e.code;
- banded region identical to those used throughout the server.
- The clipBoxes represent the visible portions of the area determined
- by &s.code;drw_x&e.code;, &s.code;drw_y&e.code;,
- &s.code;drw_w&e.code; and &s.code;drw_h&e.code; in the Get/Put
- function. The boxes are in screen coordinates, are guaranteed
- not to overlap and an empty region will never be passed.
- If the driver has specified &s.code;VIDEO_INVERT_CLIPLIST&e.code;,
- &s.code;clipBoxes&e.code; will indicate the areas of the primitive
- which are obscured rather than the areas visible.
-
- </quote>
-
- &s.code;typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
- &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
- &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
- <quote><p>
- This indicates that the driver should take a subsection
- &s.code;vid_w&e.code; by &s.code;vid_h&e.code; at location
- &s.code;(vid_x,vid_y)&e.code; from the video stream and direct
- it into the rectangle &s.code;drw_w&e.code; by &s.code;drw_h&e.code;
- at location &s.code;(drw_x,drw_y)&e.code; on the screen, scaling as
- necessary. Due to the large variations in capabilities of
- the various hardware expected to be used with this extension,
- it is not expected that all hardware will be able to do this
- exactly as described. In that case the driver should just do
- ``the best it can,'' scaling as closely to the target rectangle
- as it can without rendering outside of it. In the worst case,
- the driver can opt to just not turn on the video.
-
- </quote>
-
- &s.code;typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
- &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
- &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
- <quote><p>
- This is same as &s.code;PutVideo&e.code; except that the driver
- should place only one frame from the stream on the screen.
-
- </quote>
-
- &s.code;typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
- &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
- &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
- <quote><p>
- This is same as &s.code;PutVideo&e.code; except that the driver
- gets video from the screen and outputs it. The driver should
- do the best it can to get the requested dimensions correct
- without reading from an area larger than requested.
-
- </quote>
-
- &s.code;typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
- &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
- &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
- <quote><p>
- This is the same as &s.code;GetVideo&e.code; except that the
- driver should place only one frame from the screen into the
- output stream.
-
- </quote>
-
- &s.code;typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn,
- &f.indent;pointer data, Bool cleanup)&e.code;
- <quote><p>
- This indicates the driver should stop displaying the video.
- This is used to stop both input and output video. The
- &s.code;cleanup&e.code; field indicates that the video is
- being stopped because the client requested it to stop or
- because the server is exiting the current VT. In that case
- the driver should deallocate any offscreen memory areas (if
- there are any) being used to put the video to the screen. If
- &s.code;cleanup&e.code; is not set, the video is being stopped
- temporarily due to clipping or moving of the window, etc...
- and video will likely be restarted soon so the driver should
- not deallocate any offscreen areas associated with that port.
-
- </quote>
- &s.code;typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn,
- &f.indent;Atom attribute,INT32 value, pointer data)&e.code;
-
- &s.code;typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn,
- &f.indent;Atom attribute,INT32 *value, pointer data)&e.code;
-
- <quote><p>
- A port may have particular attributes such as hue,
- saturation, brightness or contrast. Xv clients set and
- get these attribute values by sending attribute strings
- (Atoms) to the server. Such requests end up at these
- driver functions. It is recommended that the driver provide
- at least the following attributes mentioned in the Xv client
- library docs:
- <quote>
- &s.code;XV_ENCODING&nl;
- XV_HUE&nl;
- XV_SATURATION&nl;
- XV_BRIGHTNESS&nl;
- XV_CONTRAST&e.code;
- </quote>
- but the driver may recognize as many atoms as it wishes. If
- a requested attribute is unknown by the driver it should return
- &s.code;BadMatch&e.code;. &s.code;XV_ENCODING&e.code; is the
- attribute intended to let the client specify which video
- encoding the particular port should be using (see the description
- of &s.code;XF86VideoEncodingRec&e.code; below). If the
- requested encoding is unsupported, the driver should return
- &s.code;XvBadEncoding&e.code;. If the value lies outside the
- advertised range &s.code;BadValue&e.code; may be returned.
- &s.code;Success&e.code; should be returned otherwise.
-
- </quote>
-
- &s.code;typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn,
- &f.indent;Bool motion, short vid_w, short vid_h,
- &f.indent;short drw_w, short drw_h,
- &f.indent;unsigned int *p_w, unsigned int *p_h, pointer data)&e.code;
- <quote><p>
- &s.code;QueryBestSize&e.code; provides the client with a way
- to query what the destination dimensions would end up being
- if they were to request that an area
- &s.code;vid_w&e.code by &s.code;vid_h&e.code; from the video
- stream be scaled to rectangle of
- &s.code;drw_w&e.code; by &s.code;drw_h&e.code; on the screen.
- Since it is not expected that all hardware will be able to
- get the target dimensions exactly, it is important that the
- driver provide this function.
-
- </quote>
-
- &s.code;typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;short src_x, short src_y, short drw_x, short drw_y,
- &f.indent;short src_w, short src_h, short drw_w, short drw_h,
- &f.indent;int image, char *buf, short width, short height,
- &f.indent;Bool sync, RegionPtr clipBoxes, pointer data )&e.code;
- <quote><p>
- This is similar to &s.code;PutStill&e.code; except that the
- source of the video is not a port but the data stored in a system
- memory buffer at &s.code;buf&e.code;. The data is in the format
- indicated by the &s.code;image&e.code; descriptor and represents a
- source of size &s.code;width&e.code; by &s.code;height&e.code;.
- If &s.code;sync&e.code; is TRUE the driver should not return
- from this function until it is through reading the data
- from &s.code;buf&e.code;. Returning when &s.code;sync&e.code;
- is TRUE indicates that it is safe for the data at &s.code;buf&e.code;
- to be replaced, freed, or modified.
-
- </quote>
-
- &s.code;typedef int (* QueryImageAttributesFuncPtr)( ScrnInfoPtr pScrn,
- &f.indent;int image, short *width, short *height,
- &f.indent;int *pitches, int *offsets)&e.code;
- <quote><p>
- This function is called to let the driver specify how data for
- a particular &s.code;image&e.code; of size &s.code;width&e.code;
- by &s.code;height&e.code; should be stored. Sometimes only
- the size and corrected width and height are needed. In that
- case &s.code;pitches&e.code; and &s.code;offsets&e.code; are
- NULL. The size of the memory required for the image is returned
- by this function. The &s.code;width&e.code; and
- &s.code;height&e.code; of the requested image can be altered by
- the driver to reflect format limitations (such as component
- sampling periods that are larger than one). If
- &s.code;pitches&e.code; and &s.code;offsets&e.code; are not NULL,
- these will be arrays with as many elements in them as there
- are planes in the &s.code;image&e.code; format. The driver
- should specify the pitch (in bytes) of each scanline in the
- particular plane as well as the offset to that plane (in bytes)
- from the beginning of the image.
-
- </quote>
-
- </quote>
-
-The XF86VideoEncodingRec:
-<quote><p>
-<verb>
-typedef struct {
- int id;
- char *name;
- unsigned short width, height;
- XvRationalRec rate;
-} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
-
-</verb>
- The &s.code;XF86VideoEncodingRec&e.code; specifies what encodings
- the adaptor can support. Most of this data is just informational
- and for the client's benefit, and is what will be reported by
- &s.code;XvQueryEncodings&e.code;. The &s.code;id&e.code; field is
- expected to be a unique identifier to allow the client to request a
- certain encoding via the &s.code;XV_ENCODING&e.code; attribute string.
-
-</quote>
-
-The XF86VideoFormatRec:
-
-<quote><p>
-<verb>
-typedef struct {
- char depth;
- short class;
-} XF86VideoFormatRec, *XF86VideoFormatPtr;
-</verb>
-
- This specifies what visuals the video is viewable in.
- &s.code;depth&e.code; is the depth of the visual (not bpp).
- &s.code;class&e.code; is the visual class such as
- &s.code;TrueColor&e.code;, &s.code;DirectColor&e.code; or
- &s.code;PseudoColor&e.code;. Initialization of an adaptor will fail
- if none of the visuals on that screen are supported.
-
-</quote>
-
-The XF86AttributeRec:
-
-<quote><p>
-<verb>
-typedef struct {
- int flags;
- int min_value;
- int max_value;
- char *name;
-} XF86AttributeListRec, *XF86AttributeListPtr;
-
-</verb>
-
- Each adaptor may have an array of these advertising the attributes
- for its ports. Currently defined flags are &s.code;XvGettable&e.code;
- and &s.code;XvSettable&e.code; which may be OR'd together indicating that
- attribute is ``gettable'' or ``settable'' by the client. The
- &s.code;min&e.code; and &s.code;max&e.code; field specify the valid range
- for the value. &s.code;Name&e.code; is a text string describing the
- attribute by name.
-
-</quote>
-
-The XF86ImageRec:
-
-<quote><p>
-<verb>
-typedef struct {
- int id;
- int type;
- int byte_order;
- char guid[16];
- int bits_per_pixel;
- int format;
- int num_planes;
-
- /* for RGB formats */
- int depth;
- unsigned int red_mask;
- unsigned int green_mask;
- unsigned int blue_mask;
-
- /* for YUV formats */
- unsigned int y_sample_bits;
- unsigned int u_sample_bits;
- unsigned int v_sample_bits;
- unsigned int horz_y_period;
- unsigned int horz_u_period;
- unsigned int horz_v_period;
- unsigned int vert_y_period;
- unsigned int vert_u_period;
- unsigned int vert_v_period;
- char component_order[32];
- int scanline_order;
-} XF86ImageRec, *XF86ImagePtr;
-</verb>
-
- XF86ImageRec describes how video source data is laid out in memory.
- The fields are as follows:
-
- &s.code;id&e.code;
- <quote><p>
- This is a unique descriptor for the format. It is often good to
- set this value to the FOURCC for the format when applicable.
- </quote>
-
- &s.code;type&e.code;
- <quote><p>
- This is &s.code;XvRGB&e.code; or &s.code;XvYUV&e.code;.
- </quote>
-
- &s.code;byte_order&e.code;
- <quote><p>
- This is &s.code;LSBFirst&e.code; or &s.code;MSBFirst&e.code;.
- </quote>
-
- &s.code;guid&e.code;
- <quote><p>
- This is the Globally Unique IDentifier for the format. When
- not applicable, all characters should be NULL.
- </quote>
-
- &s.code;bits_per_pixel&e.code;
- <quote><p>
- The number of bits taken up (but not necessarily used) by each
- pixel. Note that for some planar formats which have fractional
- bits per pixel (such as IF09) this number may be rounded _down_.
- </quote>
-
- &s.code;format&e.code;
- <quote><p>
- This is &s.code;XvPlanar&e.code; or &s.code;XvPacked&e.code;.
- </quote>
-
- &s.code;num_planes&e.code;
- <quote><p>
- The number of planes in planar formats. This should be set to
- one for packed formats.
- </quote>
-
- &s.code;depth&e.code;
- <quote><p>
- The significant bits per pixel in RGB formats (analgous to the
- depth of a pixmap format).
- </quote>
-
- &s.code;red_mask&e.code;
- &s.code;green_mask&e.code;
- &s.code;blue_mask&e.code;
- <quote><p>
- The red, green and blue bitmasks for packed RGB formats.
- </quote>
-
- &s.code;y_sample_bits&e.code;
- &s.code;u_sample_bits&e.code;
- &s.code;v_sample_bits&e.code;
- <quote><p>
- The y, u and v sample sizes (in bits).
- </quote>
-
- &s.code;horz_y_period&e.code;
- &s.code;horz_u_period&e.code;
- &s.code;horz_v_period&e.code;
- <quote><p>
- The y, u and v sampling periods in the horizontal direction.
- </quote>
-
- &s.code;vert_y_period&e.code;
- &s.code;vert_u_period&e.code;
- &s.code;vert_v_period&e.code;
- <quote><p>
- The y, u and v sampling periods in the vertical direction.
- </quote>
-
- &s.code;component_order&e.code;
- <quote><p>
- Uppercase ascii characters representing the order that
- samples are stored within packed formats. For planar formats
- this represents the ordering of the planes. Unused characters
- in the 32 byte string should be set to NULL.
- </quote>
-
- &s.code;scanline_order&e.code;
- <quote><p>
- This is &s.code;XvTopToBottom&e.code; or &s.code;XvBottomToTop&e.code;.
- </quote>
-
- Since some formats (particular some planar YUV formats) may not
-be completely defined by the parameters above, the guid, when
-available, should provide the most accurate description of the
-format.
-
-</quote>
-
-<sect>The Loader
-<p>
-
-This section describes the interfaces to the module loader. The loader
-interfaces can be divided into two groups: those that are only available to
-the XFree86 common layer, and those that are also available to modules.
-
-<sect1>Loader Overview
-<p>
-
-The loader is capable of loading modules in a range of object formats,
-and knowledge of these formats is built in to the loader. Knowledge of
-new object formats can be added to the loader in a straightforward
-manner. This makes it possible to provide OS-independent modules (for
-a given CPU architecture type). In addition to this, the loader can
-load modules via the OS-provided &s.code;dlopen(3)&e.code; service where
-available. Such modules are not platform independent, and the semantics
-of &s.code;dlopen()&e.code; on most systems results in significant
-limitations in the use of modules of this type. Support for
-&s.code;dlopen()&e.code; modules in the loader is primarily for
-experimental and development purposes.
-
-Symbols exported by the loader (on behalf of the core X server) to
-modules are determined at compile time. Only those symbols explicitly
-exported are available to modules. All external symbols of loaded
-modules are exported to other modules, and to the core X server. The
-loader can be requested to check for unresolved symbols at any time,
-and the action to be taken for unresolved symbols can be controlled by
-the caller of the loader. Typically the caller identifies which symbols
-can safely remain unresolved and which cannot.
-
-NOTE: Now that ISO-C allows pointers to functions and pointers to data to
-have different internal representations, some of the following interfaces
-will need to be revisited.
-
-<sect1>Semi-private Loader Interface
-<p>
-
-The following is the semi-private loader interface that is available to the
-XFree86 common layer.
-
- <quote><p>
- &s.code;void LoaderInit(void)&e.code;
- <quote><p>
- The &s.code;LoaderInit()&e.code; function initialises the loader,
- and it must be called once before calling any other loader functions.
- This function initialises the tables of exported symbols, and anything
- else that might need to be initialised.
-
- </quote>
-
- &s.code;void LoaderSetPath(const char *path)&e.code;
- <quote><p>
- The &s.code;LoaderSetPath()&e.code; function initialises a default
- module search path. This must be called if calls to other functions
- are to be made without explicitly specifying a module search path.
- The search path &s.code;path&e.code; must be a string of one or more
- comma separated absolute paths. Modules are expected to be located
- below these paths, possibly in subdirectories of these paths.
-
- </quote>
-
- &s.code;pointer LoadModule(const char *module, const char *path,
- &f.indent;const char **subdirlist, const char **patternlist,
- &f.indent;pointer options, const XF86ModReqInfo * modreq,
- &f.indent;int *errmaj, int *errmin)&e.code;
- <quote><p>
- The &s.code;LoadModule()&e.code; function loads the module called
- &s.code;module&e.code;. The return value is a module handle, and
- may be used in future calls to the loader that require a reference
- to a loaded module. The module name &s.code;module&e.code; is
- normally the module's canonical name, which doesn't contain any
- directory path information, or any object/library file prefixes of
- suffixes. Currently a full pathname and/or filename is also accepted.
- This might change. The other parameters are:
-
- &s.code;path&e.code;
- <quote><p>
- An optional comma-separated list of module search paths.
- When &s.code;NULL&e.code;, the default search path is used.
-
- </quote>
-
- &s.code;subdirlist&e.code;
- <quote><p>
- An optional &s.code;NULL&e.code; terminated list of
- subdirectories to search. When &s.code;NULL&e.code;,
- the default built-in list is used (refer to
- &s.code;stdSubdirs&e.code; in &s.code;loadmod.c&e.code;).
- The default list is also substituted for entries in
- &s.code;subdirlist&e.code; with the value
- &s.code;DEFAULT_LIST&e.code;. This makes is possible
- to augment the default list instead of replacing it.
- Subdir elements must be relative, and must not contain
- &s.code;".."&e.code;. If any violate this requirement,
- the load fails.
-
- </quote>
-
- &s.code;patternlist&e.code;
- <quote><p>
- An optional &s.code;NULL&e.code; terminated list of
- POSIX regular expressions used to connect module
- filenames with canonical module names. Each regex
- should contain exactly one subexpression that corresponds
- to the canonical module name. When &s.code;NULL&e.code;,
- the default built-in list is used (refer to
- &s.code;stdPatterns&e.code; in
- &s.code;loadmod.c&e.code;). The default list is also
- substituted for entries in &s.code;patternlist&e.code;
- with the value &s.code;DEFAULT_LIST&e.code;. This
- makes it possible to augment the default list instead
- of replacing it.
-
- </quote>
-
- &s.code;options&e.code;
- <quote><p>
- An optional parameter that is passed to the newly
- loaded module's &s.code;SetupProc&e.code; function
- (if it has one). This argument is normally a
- &s.code;NULL&e.code; terminated list of
- &s.code;Options&e.code;, and must be interpreted that
- way by modules loaded directly by the XFree86 common
- layer. However, it may be used for application-specific
- parameter passing in other situations.
-
- When loading ``external'' modules (modules that don't
- have the standard entry point, for example a
- special shared library) the options parameter can be
- set to &s.code;EXTERN_MODULE&e.code; to tell the
- loader not to reject the module when it doesn't find
- the standard entry point.
-
- </quote>
-
- &s.code;modreq&e.code;
- <quote><p>
- An optional &s.code;XF86ModReqInfo*&e.code; containing
- version/ABI/vendor information to requirements to
- check the newly loaded module against. The main
- purpose of this is to allow the loader to verify that
- a module of the correct type/version before running
- its &s.code;SetupProc&e.code; function.
-
- The &s.code;XF86ModReqInfo&e.code; struct is defined
- as follows:
-<verb>
-typedef struct {
- CARD8 majorversion; /* MAJOR_UNSPEC */
- CARD8 minorversion; /* MINOR_UNSPEC */
- CARD16 patchlevel; /* PATCH_UNSPEC */
- const char * abiclass; /* ABI_CLASS_NONE */
- CARD32 abiversion; /* ABI_VERS_UNSPEC */
- const char * moduleclass; /* MOD_CLASS_NONE */
-} XF86ModReqInfo;
-</verb>
-
- The information here is compared against the equivalent
- information in the module's
- &s.code;XF86ModuleVersionInfo&e.code; record (which
- is described below). The values in comments above
- indicate ``don't care'' settings for each of the fields.
- The comparisons made are as follows:
-
- &s.code;majorversion&e.code;
- <quote><p>
- Must match the module's majorversion
- exactly.
-
- </quote>
- &s.code;minorversion&e.code;
- <quote><p>
- The module's minor version must be
- no less than this value. This
- comparison is only made if
- &s.code;majorversion&e.code; is
- specified and matches.
-
- </quote>
- &s.code;patchlevel&e.code;
- <quote><p>
- The module's patchlevel must be no
- less than this value. This comparison
- is only made if
- &s.code;minorversion&e.code; is
- specified and matches.
-
- </quote>
- &s.code;abiclass&e.code;
- <quote><p>
- String must match the module's abiclass
- string.
-
- </quote>
- &s.code;abiversion&e.code;
- <quote><p>
- Must be consistent with the module's
- abiversion (major equal, minor no
- older).
-
- </quote>
- &s.code;moduleclass&e.code;
- <quote><p>
- String must match the module's
- moduleclass string.
-
- </quote>
-
- </quote>
-
- &s.code;errmaj&e.code;
- <quote><p>
- An optional pointer to a variable holding the major
- part or the error code. When provided,
- &s.code;*errmaj&e.code; is filled in when
- &s.code;LoadModule()&e.code; fails.
-
- </quote>
-
- &s.code;errmin&e.code;
- <quote><p>
- Like &s.code;errmaj&e.code;, but for the minor part
- of the error code.
-
- </quote>
-
- </quote>
-
- &s.code;void UnloadModule(pointer mod)&e.code;
- <quote><p>
- This function unloads the module referred to by the handle mod.
- All child modules are also unloaded recursively. This function must
- not be used to directly unload modules that are child modules (i.e.,
- those that have been loaded with the &s.code;LoadSubModule()&e.code;
- described below).
-
- </quote>
- </quote>
-
-<sect1>Module Requirements
-<p>
-
-Modules must provide information about themselves to the loader, and
-may optionally provide entry points for "setup" and "teardown" functions
-(those two functions are referred to here as &s.code;SetupProc&e.code;
-and &s.code;TearDownProc&e.code;).
-
-The module information is contained in the
-&s.code;XF86ModuleVersionInfo&e.code; struct, which is defined as follows:
-
-<quote><p><verb>
-typedef struct {
- const char * modname; /* name of module, e.g. "foo" */
- const char * vendor; /* vendor specific string */
- CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
- CARD32 _modinfo2_; /* infoarea with a binary editor/sign tool */
- CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
- CARD8 majorversion; /* module-specific major version */
- CARD8 minorversion; /* module-specific minor version */
- CARD16 patchlevel; /* module-specific patch level */
- const char * abiclass; /* ABI class that the module uses */
- CARD32 abiversion; /* ABI version */
- const char * moduleclass; /* module class */
- CARD32 checksum[4]; /* contains a digital signature of the */
- /* version info structure */
-} XF86ModuleVersionInfo;
-</verb>
-
-The fields are used as follows:
-
- &s.code;modname&e.code;
- <quote><p>
- The module's name. This field is currently only for
- informational purposes, but the loader may be modified
- in future to require it to match the module's canonical
- name.
-
- </quote>
-
- &s.code;vendor&e.code;
- <quote><p>
- The module vendor. This field is for informational purposes
- only.
-
- </quote>
-
- &s.code;_modinfo1_&e.code;
- <quote><p>
- This field holds the first part of a signature that can
- be used to locate this structure in the binary. It should
- always be initialised to &s.code;MODINFOSTRING1&e.code;.
-
- </quote>
-
- &s.code;_modinfo2_&e.code;
- <quote><p>
- This field holds the second part of a signature that can
- be used to locate this structure in the binary. It should
- always be initialised to &s.code;MODINFOSTRING2&e.code;.
-
- </quote>
-
- &s.code;xf86version&e.code;
- <quote><p>
- The XFree86 version against which the module was compiled.
- This is mostly for informational/diagnostic purposes. It
- should be initialised to &s.code;XF86_VERSION_CURRENT&e.code;, which is
- defined in &s.code;xf86Version.h&e.code;.
-
- </quote>
-
- &s.code;majorversion&e.code;
- <quote><p>
- The module-specific major version. For modules where this
- version is used for more than simply informational
- purposes, the major version should only change (be
- incremented) when ABI incompatibilities are introduced,
- or ABI components are removed.
-
- </quote>
-
- &s.code;minorversion&e.code;
- <quote><p>
- The module-specific minor version. For modules where this
- version is used for more than simply informational
- purposes, the minor version should only change (be
- incremented) when ABI additions are made in a backward
- compatible way. It should be reset to zero when the major
- version is increased.
-
- </quote>
-
- &s.code;patchlevel&e.code;
- <quote><p>
- The module-specific patch level. The patch level should
- increase with new revisions of the module where there
- are no ABI changes, and it should be reset to zero when
- the minor version is increased.
-
- </quote>
-
- &s.code;abiclass&e.code;
- <quote><p>
- The ABI class that the module requires. The class is
- specified as a string for easy extensibility. It should
- indicate which (if any) of the X server's built-in ABI
- classes that the module relies on, or a third-party ABI
- if appropriate. Built-in ABI classes currently defined are:
-
- <quote>
- &s.code;ABI_CLASS_NONE&e.code;
- <quote>no class</quote>
- &s.code;ABI_CLASS_ANSIC&e.code;
- <quote>only requires the ANSI C interfaces</quote>
- &s.code;ABI_CLASS_VIDEODRV&e.code;
- <quote>requires the video driver ABI</quote>
- &s.code;ABI_CLASS_XINPUT&e.code;
- <quote>requires the XInput driver ABI</quote>
- &s.code;ABI_CLASS_EXTENSION&e.code;
- <quote>requires the extension module ABI</quote>
- &s.code;ABI_CLASS_FONT&e.code;
- <quote>requires the font module ABI</quote>
- </quote>
-
- </quote>
-
- &s.code;abiversion&e.code;
- <quote><p>
- The version of abiclass that the module requires. The
- version consists of major and minor components. The
- major version must match and the minor version must be
- no newer than that provided by the server or parent
- module. Version identifiers for the built-in classes
- currently defined are:
-
- <quote>
- &s.code;ABI_ANSIC_VERSION&nl;
- ABI_VIDEODRV_VERSION&nl;
- ABI_XINPUT_VERSION&nl;
- ABI_EXTENSION_VERSION&nl;
- ABI_FONT_VERSION&e.code;
- </quote>
-
- </quote>
-
- &s.code;moduleclass&e.code;
- <quote><p>
- This is similar to the abiclass field, except that it
- defines the type of module rather than the ABI it
- requires. For example, although all video drivers require
- the video driver ABI, not all modules that require the
- video driver ABI are video drivers. This distinction
- can be made with the moduleclass. Currently pre-defined
- module classes are:
-
- <quote>
- &s.code;MOD_CLASS_NONE&nl;
- MOD_CLASS_VIDEODRV&nl;
- MOD_CLASS_XINPUT&nl;
- MOD_CLASS_FONT&nl;
- MOD_CLASS_EXTENSION&e.code;
- </quote>
-
- </quote>
-
- &s.code;checksum&e.code;
- <quote><p>
- Not currently used.
-
- </quote>
-
-</quote>
-
-The module version information, and the optional &s.code;SetupProc&e.code;
-and &s.code;TearDownProc&e.code; entry points are found by the loader
-by locating a data object in the module called "modnameModuleData",
-where "modname" is the canonical name of the module. Modules must
-contain such a data object, and it must be declared with global scope,
-be compile-time initialised, and is of the following type:
-
-<quote>
-<verb>
-typedef struct {
- XF86ModuleVersionInfo * vers;
- ModuleSetupProc setup;
- ModuleTearDownProc teardown;
-} XF86ModuleData;
-</verb>
-</quote>
-
-The vers parameter must be initialised to a pointer to a correctly
-initialised &s.code;XF86ModuleVersionInfo&e.code; struct. The other
-two parameter are optional, and should be initialised to
-&s.code;NULL&e.code; when not required. The other parameters are defined
-as
-
- <quote><p>
- &s.code;typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *)&e.code;
-
- &s.code;typedef void (*ModuleTearDownProc)(pointer)&e.code;
-
-
- &s.code;pointer SetupProc(pointer module, pointer options,
- &f.indent;int *errmaj, int *errmin)&e.code;
- <quote><p>
- When defined, this function is called by the loader after successfully
- loading a module. module is a handle for the newly loaded module,
- and maybe used by the &s.code;SetupProc&e.code; if it calls other
- loader functions that require a reference to it. The remaining
- arguments are those that were passed to the
- &s.code;LoadModule()&e.code; (or &s.code;LoadSubModule()&e.code;),
- and are described above. When the &s.code;SetupProc&e.code; is
- successful it must return a non-&s.code;NULL&e.code; value. The
- loader checks this, and if it is &s.code;NULL&e.code; it unloads
- the module and reports the failure to the caller of
- &s.code;LoadModule()&e.code;. If the &s.code;SetupProc&e.code;
- does things that need to be undone when the module is unloaded,
- it should define a &s.code;TearDownProc&e.code;, and return a
- pointer that the &s.code;TearDownProc&e.code; can use to undo what
- has been done.
-
- When a module is loaded multiple times, the &s.code;SetupProc&e.code;
- is called once for each time it is loaded.
-
- </quote>
-
- &s.code;void TearDownProc(pointer tearDownData)&e.code;
- <quote><p>
- When defined, this function is called when the loader unloads a
- module. The &s.code;tearDownData&e.code; parameter is the return
- value of the &s.code;SetupProc()&e.code; that was called when the
- module was loaded. The purpose of this function is to clean up
- before the module is unloaded (for example, by freeing allocated
- resources).
-
- </quote>
- </quote>
-
-<sect1>Public Loader Interface
-<p>
-
-The following is the Loader interface that is available to any part of
-the server, and may also be used from within modules.
-
- <quote><p>
- &s.code;pointer LoadSubModule(pointer parent, const char *module,
- &f.indent;const char **subdirlist, const char **patternlist,
- &f.indent;pointer options, const XF86ModReqInfo * modreq,
- &f.indent;int *errmaj, int *errmin)&e.code;
- <quote><p>
- This function is like the &s.code;LoadModule()&e.code; function
- described above, except that the module loaded is registered as a
- child of the calling module. The &s.code;parent&e.code; parameter
- is the calling module's handle. Modules loaded with this function
- are automatically unloaded when the parent module is unloaded. The
- other difference is that the path parameter may not be specified.
- The module search path used for modules loaded with this function
- is the default search path as initialised with
- &s.code;LoaderSetPath()&e.code;.
-
- </quote>
-
- &s.code;void UnloadSubModule(pointer module)&e.code;
- <quote><p>
- This function unloads the module with handle &s.code;module&e.code;.
- If that module itself has children, they are also unloaded. It is
- like &s.code;UnloadModule()&e.code;, except that it is safe to use
- for unloading child modules.
-
- </quote>
-
- &s.code;pointer LoaderSymbol(const char *symbol)&e.code;
- <quote><p>
- This function returns the address of the symbol with name
- &s.code;symbol&e.code;. This may be used to locate a module entry
- point with a known name.
-
- </quote>
-
- &s.code;char **LoaderlistDirs(const char **subdirlist,
- &f.indent;const char **patternlist)&e.code;
- <quote><p>
- This function returns a &s.code;NULL&e.code; terminated list of
- canonical modules names for modules found in the default module
- search path. The &s.code;subdirlist&e.code; and
- &s.code;patternlist&e.code; parameters are as described above, and
- can be used to control the locations and names that are searched.
- If no modules are found, the return value is &s.code;NULL&e.code;.
- The returned list should be freed by calling
- &s.code;LoaderFreeDirList()&e.code; when it is no longer needed.
-
- </quote>
-
- &s.code;void LoaderFreeDirList(char **list)&e.code;
- <quote><p>
- This function frees a module list created by
- &s.code;LoaderlistDirs()&e.code;.
-
- </quote>
-
- &s.code;void LoaderReqSymLists(const char **list0, ...)&e.code;
- <quote><p>
- This function allows the registration of required symbols with the
- loader. It is normally used by a caller of
- &s.code;LoadSubModule()&e.code;. If any symbols registered in this
- way are found to be unresolved when
- &s.code;LoaderCheckUnresolved()&e.code; is called then
- &s.code;LoaderCheckUnresolved()&e.code; will report a failure.
- The function takes one or more &s.code;NULL&e.code; terminated
- lists of symbols. The end of the argument list is indicated by a
- &s.code;NULL&e.code; argument.
-
- </quote>
-
- &s.code;void LoaderReqSymbols(const char *sym0, ...)&e.code;
- <quote><p>
- This function is like &s.code;LoaderReqSymLists()&e.code; except
- that its arguments are symbols rather than lists of symbols. This
- function is more convenient when single functions are to be registered,
- especially when the single function might depend on runtime factors.
- The end of the argument list is indicated by a &s.code;NULL&e.code;
- argument.
-
- </quote>
-
- &s.code;void LoaderRefSymLists(const char **list0, ...)&e.code;
- <quote><p>
- This function allows the registration of possibly unresolved symbols
- with the loader. When &s.code;LoaderCheckUnresolved()&e.code; is
- run it won't generate warnings for symbols registered in this way
- unless they were also registered as required symbols.
- The function takes one or more &s.code;NULL&e.code; terminated
- lists of symbols. The end of the argument list is indicated by a
- &s.code;NULL&e.code; argument.
-
- </quote>
-
- &s.code;void LoaderRefSymbols(const char *sym0, ...)&e.code;
- <quote><p>
- This function is like &s.code;LoaderRefSymLists()&e.code; except
- that its arguments are symbols rather than lists of symbols. This
- function is more convenient when single functions are to be registered,
- especially when the single function might depend on runtime factors.
- The end of the argument list is indicated by a &s.code;NULL&e.code;
- argument.
-
- </quote>
-
- &s.code;int LoaderCheckUnresolved(int delayflag)&e.code;
- <quote><p>
- This function checks for unresolved symbols. It generates warnings
- for unresolved symbols that have not been registered with
- &s.code;LoaderRefSymLists()&e.code;, and maps them to a dummy
- function. This behaviour may change in future. If unresolved
- symbols are found that have been registered with
- &s.code;LoaderReqSymLists()&e.code; or
- &s.code;LoaderReqSymbols()&e.code; then this function returns a
- non-zero value. If none of these symbols are unresolved the return
- value is zero, indicating success.
-
- The &s.code;delayflag&e.code; parameter should normally be set to
- &s.code;LD_RESOLV_IFDONE&e.code;.
-
- </quote>
-
- &s.code;LoaderErrorMsg(const char *name, const char *modname,
- &f.indent;int errmaj, int errmin)&e.code;
- <quote><p>
- This function prints an error message that includes the text ``Failed
- to load module'', the module name &s.code;modname&e.code;, a message
- specific to the &s.code;errmaj&e.code; value, and the value if
- &s.code;errmin&e.code;. If &s.code;name&e.code; is
- non-&s.code;NULL&e.code;, it is printed as an identifying prefix
- to the message (followed by a `:').
-
- </quote>
- </quote>
-
-<sect1>Special Registration Functions
-<p>
-
-The loader contains some functions for registering some classes of modules.
-These may be moved out of the loader at some point.
-
- <quote><p>
- &s.code;void LoadExtension(ExtensionModule *ext)&e.code;
- <quote><p>
- This registers the entry points for the extension identified by
- &s.code;ext&e.code;. The &s.code;ExtensionModule&e.code; struct is
- defined as:
-
-<quote>
-<verb>
-typedef struct {
- InitExtension initFunc;
- char * name;
- Bool *disablePtr;
- InitExtension setupFunc;
-} ExtensionModule;
-</verb>
-</quote>
-
- </quote>
-
- &s.code;void LoadFont(FontModule *font)&e.code;
- <quote><p>
- This registers the entry points for the font rasteriser module
- identified by &s.code;font&e.code;. The &s.code;FontModule&e.code;
- struct is defined as:
-
-<quote>
-<verb>
-typedef struct {
- InitFont initFunc;
- char * name;
- pointer module;
-} FontModule;
-</verb>
-</quote>
-
- </quote>
- </quote>
-
-</sect>
-
-
-<sect>Helper Functions
-<p>
-
-This section describe ``helper'' functions that video driver
-might find useful. While video drivers are not required to use any of
-these to be considered ``compliant'', the use of appropriate helpers is
-strongly encouraged to improve the consistency of driver behaviour.
-
-<sect1>Functions for printing messages
-<p>
-
- <quote><p>
- &s.code;ErrorF(const char *format, ...)&e.code;
- <quote><p>
- This is the basic function for writing to the error log (typically
- stderr and/or a log file). Video drivers should usually avoid
- using this directly in favour of the more specialised functions
- described below. This function is useful for printing messages
- while debugging a driver.
-
- </quote>
-
- &s.code;FatalError(const char *format, ...)&e.code;
- <quote><p>
- This prints a message and causes the Xserver to abort. It should
- rarely be used within a video driver, as most error conditions
- should be flagged by the return values of the driver functions.
- This allows the higher layers to decide how to proceed. In rare
- cases, this can be used within a driver if a fatal unexpected
- condition is found.
-
- </quote>
-
- &s.code;xf86ErrorF(const char *format, ...)&e.code;
- <quote><p>
- This is like &s.code;ErrorF()&e.code;, except that the message is
- only printed when the Xserver's verbosity level is set to the
- default (&s.code;1&e.code;) or higher. It means that the messages
- are not printed when the server is started with the
- &s.cmd;-quiet&e.cmd; flag. Typically this function would only be
- used for continuing messages started with one of the more specialised
- functions described below.
-
- </quote>
-
- &s.code;xf86ErrorFVerb(int verb, const char *format, ...)&e.code;
- <quote><p>
- Like &s.code;xf86ErrorF()&e.code;, except the minimum verbosity
- level for which the message is to be printed is given explicitly.
- Passing a &s.code;verb&e.code; value of zero means the message
- is always printed. A value higher than &s.code;1&e.code; can be
- used for information would normally not be needed, but which might
- be useful when diagnosing problems.
-
- </quote>
-
- &s.code;xf86Msg(MessageType type, const char *format, ...)&e.code;
- <quote><p>
- This is like &s.code;xf86ErrorF()&e.code;, except that the message
- is prefixed with a marker determined by the value of
- &s.code;type&e.code;. The marker is used to indicate the type of
- message (warning, error, probed value, config value, etc). Note
- the &s.code;xf86Verbose&e.code; value is ignored for messages of
- type &s.code;X_ERROR&e.code;.
-
- The marker values are:
-
- <quote>
- &s.code;X_PROBED&e.code;
- <quote>Value was probed.</quote>
- &s.code;X_CONFIG&e.code;
- <quote>Value was given in the config file.</quote>
- &s.code;X_DEFAULT&e.code;
- <quote>Value is a default.</quote>
- &s.code;X_CMDLINE&e.code;
- <quote>Value was given on the command line.</quote>
- &s.code;X_NOTICE&e.code;
- <quote>Notice.</quote>
- &s.code;X_ERROR&e.code;
- <quote>Error message.</quote>
- &s.code;X_WARNING&e.code;
- <quote>Warning message.</quote>
- &s.code;X_INFO&e.code;
- <quote>Informational message.</quote>
- &s.code;X_NONE&e.code;
- <quote>No prefix.</quote>
- &s.code;X_NOT_IMPLEMENTED&e.code;
- <quote>The message relates to functionality that is not yet
- implemented.</quote>
- </quote>
-
-
- </quote>
-
- &s.code;xf86MsgVerb(MessageType type, int verb, const char *format, ...)&e.code;
- <quote><p>
- Like &s.code;xf86Msg()&e.code;, but with the verbosity level given
- explicitly.
-
- </quote>
-
- &s.code;xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)&e.code;
- <quote><p>
- This is like &s.code;xf86Msg()&e.code; except that the driver's
- name (the &s.code;name&e.code; field of the
- &s.code;ScrnInfoRec&e.code;) followed by the
- &s.code;scrnIndex&e.code; in parentheses is printed following the
- prefix. This should be used by video drivers in most cases as it
- clearly indicates which driver/screen the message is for. If
- &s.code;scrnIndex&e.code; is negative, this function behaves
- exactly like &s.code;xf86Msg()&e.code;.
-
- NOTE: This function can only be used after the
- &s.code;ScrnInfoRec&e.code; and its &s.code;name&e.code; field
- have been allocated. Normally, this means that it can not be
- used before the END of the &s.code;ChipProbe()&e.code; function.
- Prior to that, use &s.code;xf86Msg()&e.code;, providing the
- driver's name explicitly. No screen number can be supplied at
- that point.
-
- </quote>
-
- &s.code;xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
- &f.indent;const char *format, ...)&e.code;
- <quote><p>
- Like &s.code;xf86DrvMsg()&e.code;, but with the verbosity level
- given explicitly.
-
- </quote>
- </quote>
-
-
-<sect1>Functions for setting values based on command line and config file
-<p>
-
- <quote><p>
- &s.code;Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
- &f.indent;int fbbpp, int depth24flags)&e.code;
- <quote><p>
- This function sets the &s.code;depth&e.code;, &s.code;pixmapBPP&e.code; and &s.code;bitsPerPixel&e.code; fields
- of the &s.code;ScrnInfoRec&e.code;. It also determines the defaults for display-wide
- attributes and pixmap formats the screen will support, and finds
- the Display subsection that matches the depth/bpp. This function
- should normally be called very early from the
- &s.code;ChipPreInit()&e.code; function.
-
- It requires that the &s.code;confScreen&e.code; field of the &s.code;ScrnInfoRec&e.code; be
- initialised prior to calling it. This is done by the XFree86
- common layer prior to calling &s.code;ChipPreInit()&e.code;.
-
- The parameters passed are:
-
- &s.code;depth&e.code;
- <quote><p>
- driver's preferred default depth if no other is given.
- If zero, use the overall server default.
-
- </quote>
- &s.code;bpp&e.code;
- <quote><p>
- Same, but for the pixmap bpp.
-
- </quote>
- &s.code;fbbpp&e.code;
- <quote><p>
- Same, but for the framebuffer bpp.
-
- </quote>
- &s.code;depth24flags&e.code;
- <quote><p>
- Flags that indicate the level of 24/32bpp support
- and whether conversion between different framebuffer
- and pixmap formats is supported. The flags for this
- argument are defined as follows, and multiple flags
- may be ORed together:
-
- &s.code;NoDepth24Support&e.code;
- <quote>No depth 24 formats supported</quote>
- &s.code;Support24bppFb&e.code;
- <quote>24bpp framebuffer supported</quote>
- &s.code;Support32bppFb&e.code;
- <quote>32bpp framebuffer supported</quote>
- &s.code;SupportConvert24to32&e.code;
- <quote>Can convert 24bpp pixmap to 32bpp fb</quote>
- &s.code;SupportConvert32to24&e.code;
- <quote>Can convert 32bpp pixmap to 24bpp fb</quote>
- &s.code;ForceConvert24to32&e.code;
- <quote>Force 24bpp pixmap to 32bpp fb conversion</quote>
- &s.code;ForceConvert32to24&e.code;
- <quote>Force 32bpp pixmap to 24bpp fb conversion</quote>
-
- </quote>
-
- It uses the command line, config file, and default values in the
- correct order of precedence to determine the depth and bpp values.
- It is up to the driver to check the results to see that it supports
- them. If not the &s.code;ChipPreInit()&e.code; function should
- return &s.code;FALSE&e.code;.
-
- If only one of depth/bpp is given, the other is set to a reasonable
- (and consistent) default.
-
- If a driver finds that the initial &s.code;depth24flags&e.code;
- it uses later results in a fb format that requires more video
- memory than is available it may call this function a second time
- with a different &s.code;depth24flags&e.code; setting.
-
- On success, the return value is &s.code;TRUE&e.code;. On failure
- it prints an error message and returns &s.code;FALSE&e.code;.
-
- The following fields of the &s.code;ScrnInfoRec&e.code; are
- initialised by this function:
-
- <quote>
- &s.code;depth&e.code;, &s.code;bitsPerPixel&e.code;,
- &s.code;display&e.code;, &s.code;imageByteOrder&e.code;,
- &s.code;bitmapScanlinePad&e.code;,
- &s.code;bitmapScanlineUnit&e.code;, &s.code;bitmapBitOrder&e.code;,
- &s.code;numFormats&e.code;, &s.code;formats&e.code;,
- &s.code;fbFormat&e.code;.
- </quote>
-
- </quote>
-
- &s.code;void xf86PrintDepthBpp(scrnInfoPtr scrp)&e.code;
- <quote><p>
- This function can be used to print out the depth and bpp settings.
- It should be called after the final call to
- &s.code;xf86SetDepthBpp()&e.code;.
-
- </quote>
-
- &s.code;Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)&e.code;
- <quote><p>
- This function sets the &s.code;weight&e.code;, &s.code;mask&e.code;,
- &s.code;offset&e.code; and &s.code;rgbBits&e.code; fields of the
- &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
- early in the &s.code;ChipPreInit()&e.code; function for
- depths&nbsp;>&nbsp;8bpp.
-
- It requires that the &s.code;depth&e.code; and
- &s.code;display&e.code; fields of the &s.code;ScrnInfoRec&e.code;
- be initialised prior to calling it.
-
- The parameters passed are:
-
- &s.code;weight&e.code;
- <quote><p>
- driver's preferred default weight if no other is given.
- If zero, use the overall server default.
-
- </quote>
-
- &s.code;mask&e.code;
- <quote><p>
- Same, but for mask.
-
- </quote>
-
- It uses the command line, config file, and default values in the
- correct order of precedence to determine the weight value. It
- derives the mask and offset values from the weight and the defaults.
- It is up to the driver to check the results to see that it supports
- them. If not the &s.code;ChipPreInit()&e.code; function should
- return &s.code;FALSE&e.code;.
-
- On success, this function prints a message showing the weight
- values selected, and returns &s.code;TRUE&e.code;.
-
- On failure it prints an error message and returns &s.code;FALSE&e.code;.
-
- The following fields of the &s.code;ScrnInfoRec&e.code; are
- initialised by this function:
-
- <quote>
- &s.code;weight&e.code;, &s.code;mask&e.code;, &s.code;offset&e.code;.
- </quote>
-
- </quote>
-
- &s.code;Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)&e.code;
- <quote><p>
- This function sets the &s.code;defaultVisual&e.code; field of the
- &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
- early from the &s.code;ChipPreInit()&e.code; function.
-
- It requires that the &s.code;depth&e.code; and
- &s.code;display&e.code; fields of the &s.code;ScrnInfoRec&e.code;
- be initialised prior to calling it.
-
- The parameters passed are:
-
- &s.code;visual&e.code;
- <quote><p>
- driver's preferred default visual if no other is given.
- If &s.code;-1&e.code;, use the overall server default.
-
- </quote>
-
- It uses the command line, config file, and default values in the
- correct order of precedence to determine the default visual value.
- It is up to the driver to check the result to see that it supports
- it. If not the &s.code;ChipPreInit()&e.code; function should
- return &s.code;FALSE&e.code;.
-
- On success, this function prints a message showing the default visual
- selected, and returns &s.code;TRUE&e.code;.
-
- On failure it prints an error message and returns &s.code;FALSE&e.code;.
-
- </quote>
-
- &s.code;Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)&e.code;
- <quote><p>
- This function sets the &s.code;gamma&e.code; field of the
- &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
- early from the &s.code;ChipPreInit()&e.code; function in cases
- where the driver supports gamma correction.
-
- It requires that the &s.code;monitor&e.code; field of the
- &s.code;ScrnInfoRec&e.code; be initialised prior to calling it.
-
- The parameters passed are:
-
- &s.code;gamma&e.code;
- <quote><p>
- driver's preferred default gamma if no other is given.
- If zero (&s.code;< 0.01&e.code;), use the overall server
- default.
-
- </quote>
-
- It uses the command line, config file, and default values in the
- correct order of precedence to determine the gamma value. It is
- up to the driver to check the results to see that it supports
- them. If not the &s.code;ChipPreInit()&e.code; function should
- return &s.code;FALSE&e.code;.
-
- On success, this function prints a message showing the gamma
- value selected, and returns &s.code;TRUE&e.code;.
-
- On failure it prints an error message and returns &s.code;FALSE&e.code;.
-
- </quote>
-
- &s.code;void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)&e.code;
- <quote><p>
- This function sets the &s.code;xDpi&e.code; and &s.code;yDpi&e.code;
- fields of the &s.code;ScrnInfoRec&e.code;. The driver can specify
- preferred defaults by setting &s.code;x&e.code; and &s.code;y&e.code;
- to non-zero values. The &s.cmd;-dpi&e.cmd; command line option
- overrides all other settings. Otherwise, if the
- &s.key;DisplaySize&e.key; entry is present in the screen's &k.monitor;
- config file section, it is used together with the virtual size to
- calculate the dpi values. This function should be called after
- all the mode resolution has been done.
-
- </quote>
-
- &s.code;void xf86SetBlackWhitePixels(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- This functions sets the &s.code;blackPixel&e.code; and
- &s.code;whitePixel&e.code; fields of the &s.code;ScrnInfoRec&e.code;
- according to whether or not the &s.cmd;-flipPixels&e.cmd; command
- line options is present.
-
- </quote>
-
- &s.code;const char *xf86GetVisualName(int visual)&e.code;
- <quote><p>
- Returns a printable string with the visual name matching the
- numerical visual class provided. If the value is outside the
- range of valid visual classes, &s.code;NULL&e.code; is returned.
-
- </quote>
- </quote>
-
-
-<sect1>Primary Mode functions
-<p>
-
-The primary mode helper functions are those which would normally be
-used by a driver, unless it has unusual requirements which cannot
-be catered for the by the helpers.
-
- <quote><p>
- &s.code;int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
- &f.indent;char **modeNames, ClockRangePtr clockRanges,
- &f.indent;int *linePitches, int minPitch, int maxPitch,
- &f.indent;int pitchInc, int minHeight, int maxHeight,
- &f.indent;int virtualX, int virtualY,
- &f.indent;unsigned long apertureSize,
- &f.indent;LookupModeFlags strategy)&e.code;
- <quote><p>
- This function basically selects the set of modes to use based on
- those available and the various constraints. It also sets some
- other related parameters. It is normally called near the end of
- the &s.code;ChipPreInit()&e.code; function.
-
- The parameters passed to the function are:
-
- &s.code;availModes&e.code;
- <quote><p>
- List of modes available for the monitor.
-
- </quote>
- &s.code;modeNames&e.code;
- <quote><p>
- List of mode names that the screen is requesting.
-
- </quote>
- &s.code;clockRanges&e.code;
- <quote><p>
- A list of clock ranges allowed by the driver. Each
- range includes whether interlaced or multiscan modes
- are supported for that range. See below for more on
- &s.code;clockRanges&e.code;.
-
- </quote>
- &s.code;linePitches&e.code;
- <quote><p>
- List of line pitches supported by the driver.
- This is optional and should be &s.code;NULL&e.code; when
- not used.
-
- </quote>
- &s.code;minPitch&e.code;
- <quote><p>
- Minimum line pitch supported by the driver. This must
- be supplied when &s.code;linePitches&e.code; is
- &s.code;NULL&e.code;, and is ignored otherwise.
-
- </quote>
- &s.code;maxPitch&e.code;
- <quote><p>
- Maximum line pitch supported by the driver. This is
- required when &s.code;minPitch&e.code; is required.
-
- </quote>
- &s.code;pitchInc&e.code;
- <quote><p>
- Granularity of horizontal pitch values as supported by
- the chipset. This is expressed in bits. This must be
- supplied.
-
- </quote>
- &s.code;minHeight&e.code;
- <quote><p>
- minimum virtual height allowed. If zero, no limit is
- imposed.
-
- </quote>
- &s.code;maxHeight&e.code;
- <quote><p>
- maximum virtual height allowed. If zero, no limit is
- imposed.
-
- </quote>
- &s.code;virtualX&e.code;
- <quote><p>
- If greater than zero, this is the virtual width value
- that will be used. Otherwise, the virtual width is
- chosen to be the smallest that can accommodate the modes
- selected.
-
- </quote>
- &s.code;virtualY&e.code;
- <quote><p>
- If greater than zero, this is the virtual height value
- that will be used. Otherwise, the virtual height is
- chosen to be the smallest that can accommodate the modes
- selected.
-
- </quote>
- &s.code;apertureSize&e.code;
- <quote><p>
- The size (in bytes) of the aperture used to access video
- memory.
-
- </quote>
- &s.code;strategy&e.code;
- <quote><p>
- The strategy to use when choosing from multiple modes
- with the same name. The options are:
-
- &s.code;LOOKUP_DEFAULT&e.code;
- <quote>???</quote>
- &s.code;LOOKUP_BEST_REFRESH&e.code;
- <quote>mode with best refresh rate</quote>
- &s.code;LOOKUP_CLOSEST_CLOCK&e.code;
- <quote>mode with closest matching clock</quote>
- &s.code;LOOKUP_LIST_ORDER&e.code;
- <quote>first usable mode in list</quote>
-
- The following options can also be combined (OR'ed) with
- one of the above:
-
- &s.code;LOOKUP_CLKDIV2&e.code;
- <quote>Allow halved clocks</quote>
- &s.code;LOOKUP_OPTIONAL_TOLERANCES&e.code;
- <quote>Allow missing horizontal sync and/or vertical refresh
- ranges in the XF86Config Monitor section</quote>
-
- &s.code;LOOKUP_OPTIONAL_TOLERANCES&e.code; should only be
- specified when the driver can ensure all modes it generates
- can sync on, or at least not damage, the monitor or digital
- flat panel. Horizontal sync and/or vertical refresh ranges
- specified by the user will still be honoured (and acted upon).
-
- </quote>
-
- This function requires that the following fields of the
- &s.code;ScrnInfoRec&e.code; are initialised prior to calling it:
-
- &s.code;clock[]&e.code;
- <quote>List of discrete clocks (when non-programmable)</quote>
- &s.code;numClocks&e.code;
- <quote>Number of discrete clocks (when non-programmable)</quote>
- &s.code;progClock&e.code;
- <quote>Whether the clock is programmable or not</quote>
- &s.code;monitor&e.code;
- <quote>Pointer to the applicable XF86Config monitor section</quote>
- &s.code;fdFormat&e.code;
- <quote>Format of the screen buffer</quote>
- &s.code;videoRam&e.code;
- <quote>total video memory size (in bytes)</quote>
- &s.code;maxHValue&e.code;
- <quote>Maximum horizontal timing value allowed</quote>
- &s.code;maxVValue&e.code;
- <quote>Maximum vertical timing value allowed</quote>
- &s.code;xInc&e.code;
- <quote>Horizontal timing increment in pixels (defaults to 8)</quote>
-
- This function fills in the following &s.code;ScrnInfoRec&e.code;
- fields:
-
- &s.code;modePool&e.code;
- <quote><p>
- A subset of the modes available to the monitor which
- are compatible with the driver.
-
- </quote>
- &s.code;modes&e.code;
- <quote><p>
- One mode entry for each of the requested modes, with
- the status field of each filled in to indicate if
- the mode has been accepted or not. This list of
- modes is a circular list.
-
- </quote>
- &s.code;virtualX&e.code;
- <quote><p>
- The resulting virtual width.
-
- </quote>
- &s.code;virtualY&e.code;
- <quote><p>
- The resulting virtual height.
-
- </quote>
- &s.code;displayWidth&e.code;
- <quote><p>
- The resulting line pitch.
-
- </quote>
- &s.code;virtualFrom&e.code;
- <quote><p>
- Where the virtual size was determined from.
-
- </quote>
-
- The first stage of this function checks that the
- &s.code;virtualX&e.code; and &s.code;virtualY&e.code; values
- supplied (if greater than zero) are consistent with the line pitch
- and &s.code;maxHeight&e.code; limitations. If not, an error
- message is printed, and the return value is &s.code;-1&e.code;.
-
- The second stage sets up the mode pool, eliminating immediately
- any modes that exceed the driver's line pitch limits, and also
- the virtual width and height limits (if greater than zero). For
- each mode removed an informational message is printed at verbosity
- level &s.code;2&e.code;. If the mode pool ends up being empty,
- a warning message is printed, and the return value is
- &s.code;0&e.code;.
-
- The final stage is to lookup each mode name, and fill in the remaining
- parameters. If an error condition is encountered, a message is
- printed, and the return value is &s.code;-1&e.code;. Otherwise,
- the return value is the number of valid modes found
- (&s.code;0&e.code; if none are found).
-
- Even if the supplied mode names include duplicates, no two names will
- ever match the same mode. Furthermore, if the supplied mode names do not
- yield a valid mode (including the case where no names are passed at all),
- the function will continue looking through the mode pool until it finds
- a mode that survives all checks, or until the mode pool is exhausted.
-
- A message is only printed by this function when a fundamental
- problem is found. It is intended that this function may be called
- more than once if there is more than one set of constraints that
- the driver can work within.
-
- If this function returns &s.code;-1&e.code;, the
- &s.code;ChipPreInit()&e.code; function should return
- &s.code;FALSE&e.code;.
-
- &s.code;clockRanges&e.code; is a linked list of clock ranges
- allowed by the driver. If a mode doesn't fit in any of the defined
- &s.code;clockRanges&e.code;, it is rejected. The first
- &s.code;clockRange&e.code; that matches all requirements is used.
- This structure needs to be initialized to NULL when allocated.
-
- &s.code;clockRanges&e.code; contains the following fields:
-
- &s.code;minClock&nl;
- maxClock&e.code;
- <quote><p>
- The lower and upper mode clock bounds for which the rest
- of the &s.code;clockRange&e.code; parameters apply.
- Since these are the mode clocks, they are not scaled
- with the &s.code;ClockMulFactor&e.code; and
- &s.code;ClockDivFactor&e.code;. It is up to the driver
- to adjust these values if they depend on the clock
- scaling factors.
-
- </quote>
- &s.code;clockIndex&e.code;
- <quote><p>
- (not used yet) &s.code;-1&e.code; for programmable clocks
-
- </quote>
- &s.code;interlaceAllowed&e.code;
- <quote><p>
- &s.code;TRUE&e.code; if interlacing is allowed for this
- range
-
- </quote>
- &s.code;doubleScanAllowed&e.code;
- <quote><p>
- &s.code;TRUE&e.code; if doublescan or multiscan is allowed
- for this range
-
- </quote>
- &s.code;ClockMulFactor&nl;
- ClockDivFactor&e.code;
- <quote><p>
- Scaling factors that are applied to the mode clocks ONLY
- before selecting a clock index (when there is no
- programmable clock) or a &s.code;SynthClock&e.code;
- value. This is useful for drivers that support pixel
- multiplexing or that need to scale the clocks because
- of hardware restrictions (like sending 24bpp data to an
- 8 bit RAMDAC using a tripled clock).
-
- Note that these parameters describe what must be done
- to the mode clock to achieve the data transport clock
- between graphics controller and RAMDAC. For example
- for &s.code;2:1&e.code; pixel multiplexing, two pixels
- are sent to the RAMDAC on each clock. This allows the
- RAMDAC clock to be half of the actual pixel clock.
- Hence, &s.code;ClockMulFactor=1&e.code; and
- &s.code;ClockDivFactor=2&e.code;. This means that the
- clock used for clock selection (ie, determining the
- correct clock index from the list of discrete clocks)
- or for the &s.code;SynthClock&e.code; field in case of
- a programmable clock is: (&s.code;mode-&gt;Clock *
- ClockMulFactor) / ClockDivFactor&e.code;.
-
- </quote>
- &s.code;PrivFlags&e.code;
- <quote><p>
- This field is copied into the
- &s.code;mode-&gt;PrivFlags&e.code; field when this
- &s.code;clockRange&e.code; is selected by
- &s.code;xf86ValidateModes()&e.code;. It allows the
- driver to find out what clock range was selected, so it
- knows it needs to set up pixel multiplexing or any other
- range-dependent feature. This field is purely
- driver-defined: it may contain flag bits, an index or
- anything else (as long as it is an &s.code;INT&e.code;).
- </quote>
-
- Note that the &s.code;mode-&gt;SynthClock&e.code; field is always
- filled in by &s.code;xf86ValidateModes()&e.code;: it will contain
- the ``data transport clock'', which is the clock that will have
- to be programmed in the chip when it has a programmable clock, or
- the clock that will be picked from the clocks list when it is not
- a programmable one. Thus:
-
- &s.code;mode-&gt;SynthClock =
- &f.indent;(mode-&gt;Clock * ClockMulFactor) / ClockDivFactor&e.code;
-
- </quote>
-
- &s.code;void xf86PruneDriverModes(ScrnInfoPtr scrp)&e.code;
- <quote><p>
- This function deletes modes in the modes field of the
- &s.code;ScrnInfoRec&e.code; that have been marked as invalid.
- This is normally run after having run
- &s.code;xf86ValidateModes()&e.code; for the last time. For each
- mode that is deleted, a warning message is printed out indicating
- the reason for it being deleted.
-
- </quote>
-
- &s.code;void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)&e.code;
- <quote><p>
- This function fills in the &s.code;Crtc*&e.code; fields for all
- the modes in the &s.code;modes&e.code; field of the
- &s.code;ScrnInfoRec&e.code;. The &s.code;adjustFlags&e.code;
- parameter determines how the vertical CRTC values are scaled for
- interlaced modes. They are halved if it is
- &s.code;INTERLACE_HALVE_V&e.code;. The vertical CRTC values are
- doubled for doublescan modes, and are further multiplied by the
- &s.code;VScan&e.code; value.
-
- This function is normally called after calling
- &s.code;xf86PruneDriverModes()&e.code;.
-
- </quote>
-
- &s.code;void xf86PrintModes(ScrnInfoPtr scrp)&e.code;
- <quote><p>
- This function prints out the virtual size setting, and the line
- pitch being used. It also prints out two lines for each mode being
- used. The first line includes the mode's pixel clock, horizontal sync
- rate, refresh rate, and whether it is interlaced, doublescanned and/or
- multi-scanned. The second line is the mode's Modeline.
-
- This function is normally called after calling
- &s.code;xf86SetCrtcForModes()&e.code;.
-
- </quote>
- </quote>
-
-
-<sect1>Secondary Mode functions
-<p>
-
-The secondary mode helper functions are functions which are normally
-used by the primary mode helper functions, and which are not normally
-called directly by a driver. If a driver has unusual requirements
-and needs to do its own mode validation, it might be able to make
-use of some of these secondary mode helper functions.
-
- <quote><p>
- &s.code;int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
- &f.indent;int *divider)&e.code;
- <quote><p>
- This function returns the index of the closest clock to the
- frequency &s.code;freq&e.code; given (in kHz). It assumes that
- the number of clocks is greater than zero. It requires that the
- &s.code;numClocks&e.code; and &s.code;clock&e.code; fields of the
- &s.code;ScrnInfoRec&e.code; are initialised. The
- &s.code;allowDiv2&e.code; field determines if the clocks can be
- halved. The &s.code;*divider&e.code; return value indicates
- whether clock division is used when determining the clock returned.
-
- This function is only for non-programmable clocks.
-
- </quote>
-
- &s.code;const char *xf86ModeStatusToString(ModeStatus status)&e.code;
- <quote><p>
- This function converts the &s.code;status&e.code; value to a
- descriptive printable string.
-
- </quote>
-
- &s.code;ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
- &f.indent;ClockRangePtr clockRanges, LookupModeFlags strategy)&e.code;
- <quote><p>
- This function takes a pointer to a mode with the name filled in,
- and looks for a mode in the &s.code;modePool&e.code; list which
- matches. The parameters of the matching mode are filled in to
- &s.code;*modep&e.code;. The &s.code;clockRanges&e.code; and
- &s.code;strategy&e.code; parameters are as for the
- &s.code;xf86ValidateModes()&e.code; function above.
-
- This function requires the &s.code;modePool&e.code;,
- &s.code;clock[]&e.code;, &s.code;numClocks&e.code; and
- &s.code;progClock&e.code; fields of the &s.code;ScrnInfoRec&e.code;
- to be initialised before being called.
-
- The return value is &s.code;MODE_OK&e.code; if a mode was found.
- Otherwise it indicates why a matching mode could not be found.
-
- </quote>
-
- &s.code;ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp,
- &f.indent;DisplayModePtr mode, ClockRangePtr clockRanges,
- &f.indent;LookupModeFlags strategy, int maxPitch,
- &f.indent;int virtualX, int virtualY)&e.code;
- <quote><p>
- This function checks the passed mode against some basic driver
- constraints. Apart from the ones passed explicitly, the
- &s.code;maxHValue&e.code; and &s.code;maxVValue&e.code; fields of
- the &s.code;ScrnInfoRec&e.code; are also used. If the
- &s.code;ValidMode&e.code; field of the &s.code;ScrnInfoRec&e.code;
- is set, that function is also called to check the mode. Next, the
- mode is checked against the monitor's constraints.
-
- If the mode is consistent with all constraints, the return value
- is &s.code;MODE_OK&e.code;. Otherwise the return value indicates
- which constraint wasn't met.
-
- </quote>
-
- &s.code;void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode)&e.code;
- <quote><p>
- This function deletes the &s.code;mode&e.code; given from the
- &s.code;modeList&e.code;. It never prints any messages, so it is
- up to the caller to print a message if required.
-
- </quote>
- </quote>
-
-<sect1>Functions for handling strings and tokens
-<p>
-
- Tables associating strings and numerical tokens combined with the
- following functions provide a compact way of handling strings from
- the config file, and for converting tokens into printable strings.
- The table data structure is:
-
-<quote><verb>
-typedef struct {
- int token;
- const char * name;
-} SymTabRec, *SymTabPtr;
-</verb></quote>
-
- A table is an initialised array of &s.code;SymTabRec&e.code;. The
- tokens must be non-negative integers. Multiple names may be mapped
- to a single token. The table is terminated with an element with a
- &s.code;token&e.code; value of &s.code;-1&e.code; and
- &s.code;NULL&e.code; for the &s.code;name&e.code;.
-
-
- <quote><p>
- &s.code;const char *xf86TokenToString(SymTabPtr table, int token)&e.code;
- <quote><p>
- This function returns the first string in &s.code;table&e.code;
- that matches &s.code;token&e.code;. If no match is found,
- &s.code;NULL&e.code; is returned (NOTE, older versions of this
- function would return the string "unknown" when no match is found).
-
- </quote>
-
- &s.code;int xf86StringToToken(SymTabPtr table, const char *string)&e.code;
- <quote><p>
- This function returns the first token in &s.code;table&e.code;
- that matches &s.code;string&e.code;. The
- &s.code;xf86NameCmp()&e.code; function is used to determine the
- match. If no match is found, &s.code;-1&e.code; is returned.
-
- </quote>
- </quote>
-
-
-<sect1>Functions for finding which config file entries to use
-<p>
-
- These functions can be used to select the appropriate config file
- entries that match the detected hardware. They are described above
- in the <ref id="probe" name="Probe"> and
- <ref id="avail" name="Available Functions"> sections.
-
-
-<sect1>Probing discrete clocks on old hardware
-<p>
-
- The &s.code;xf86GetClocks()&e.code; function may be used to assist
- in finding the discrete pixel clock values on older hardware.
-
-
- <quote><p>
- &s.code;void xf86GetClocks(ScrnInfoPtr pScrn, int num,
- &f.indent;Bool (*ClockFunc)(ScrnInfoPtr, int),
- &f.indent;void (*ProtectRegs)(ScrnInfoPtr, Bool),
- &f.indent;void (*BlankScreen)(ScrnInfoPtr, Bool),
- &f.indent;int vertsyncreg, int maskval, int knownclkindex,
- &f.indent;int knownclkvalue)&e.code;
- <quote><p>
- This function uses a comparative sampling method to measure the
- discrete pixel clock values. The number of discrete clocks to
- measure is given by &s.code;num&e.code;. &s.code;clockFunc&e.code;
- is a function that selects the &s.code;n&e.code;'th clock. It
- should also save or restore any state affected by programming the
- clocks when the index passed is &s.code;CLK_REG_SAVE&e.code; or
- &s.code;CLK_REG_RESTORE&e.code;. &s.code;ProtectRegs&e.code; is
- a function that does whatever is required to protect the hardware
- state while selecting a new clock. &s.code;BlankScreen&e.code;
- is a function that blanks the screen. &s.code;vertsyncreg&e.code;
- and &s.code;maskval&e.code; are the register and bitmask to
- check for the presence of vertical sync pulses.
- &s.code;knownclkindex&e.code; and &s.code;knownclkvalue&e.code;
- are the index and value of a known clock. These are the known
- references on which the comparative measurements are based. The
- number of clocks probed is set in &s.code;pScrn-&gt;numClocks&e.code;,
- and the probed clocks are set in the &s.code;pScrn-&gt;clock[]&e.code;
- array. All of the clock values are in units of kHz.
-
- </quote>
-
- &s.code;void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)&e.code;
- <quote><p>
- Print out the pixel clocks &s.code;scrp-&gt;clock[]&e.code;.
- &s.code;from&e.code; indicates whether the clocks were probed
- or from the config file.
-
- </quote>
- </quote>
-
-<sect1>Other helper functions
-<p>
- <quote><p>
- &s.code;Bool xf86IsUnblank(int mode)&e.code;
- <quote><p>
- Returns &s.code;TRUE&e.code; when the screen saver mode specified
- by &s.code;mode&e.code; requires the screen be unblanked,
- and &s.code;FALSE&e.code; otherwise. The screen saver modes that
- require blanking are &s.code;SCREEN_SAVER_ON&e.code; and
- &s.code;SCREEN_SAVER_CYCLE&e.code;, and the screen saver modes that
- require unblanking are &s.code;SCREEN_SAVER_OFF&e.code; and
- &s.code;SCREEN_SAVER_FORCER&e.code;. Drivers may call this helper
- from their &s.code;SaveScreen()&e.code; function to interpret the
- screen saver modes.
-
- </quote>
- </quote>
-
-<sect>The vgahw module
-<p>
-
-The vgahw modules provides an interface for saving, restoring and
-programming the standard VGA registers, and for handling VGA colourmaps.
-
-<sect1>Data Structures
-<p>
-
- The public data structures used by the vgahw module are
- &s.code;vgaRegRec&e.code; and &s.code;vgaHWRec&e.code;. They are
- defined in &s.code;vgaHW.h.&e.code;
-
-
-<sect1>General vgahw Functions
-<p>
-
- <quote><p>
- &s.code;Bool vgaHWGetHWRec(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- This function allocates a &s.code;vgaHWRec&e.code; structure, and
- hooks it into the &s.code;ScrnInfoRec&e.code;'s
- &s.code;privates&e.code;. Like all information hooked into the
- &s.code;privates&e.code;, it is persistent, and only needs to be
- allocated once per screen. This function should normally be called
- from the driver's &s.code;ChipPreInit()&e.code; function. The
- &s.code;vgaHWRec&e.code; is zero-allocated, and the following
- fields are explicitly initialised:
-
- &s.code;ModeReg.DAC[]&e.code;
- <quote>initialised with a default colourmap</quote>
- &s.code;ModeReg.Attribute[0x11]&e.code;
- <quote>initialised with the default overscan index</quote>
- &s.code;ShowOverscan&e.code;
- <quote>initialised according to the "ShowOverscan" option</quote>
- &s.code;paletteEnabled&e.code;
- <quote>initialised to FALSE</quote>
- &s.code;cmapSaved&e.code;
- <quote>initialised to FALSE</quote>
- &s.code;pScrn&e.code;
- <quote>initialised to pScrn</quote>
-
- In addition to the above, &s.code;vgaHWSetStdFuncs()&e.code; is
- called to initialise the register access function fields with the
- standard VGA set of functions.
-
- Once allocated, a pointer to the &s.code;vgaHWRec&e.code; can be
- obtained from the &s.code;ScrnInfoPtr&e.code; with the
- &s.code;VGAHWPTR(pScrn)&e.code; macro.
-
- </quote>
-
- &s.code;void vgaHWFreeHWRec(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- This function frees a &s.code;vgaHWRec&e.code; structure. It
- should be called from a driver's &s.code;ChipFreeScreen()&e.code;
- function.
-
- </quote>
-
- &s.code;Bool vgaHWSetRegCounts(ScrnInfoPtr pScrn, int numCRTC,
- &f.indent;int numSequencer, int numGraphics, int numAttribute)&e.code;
- <quote><p>
- This function allows the number of CRTC, Sequencer, Graphics and
- Attribute registers to be changed. This makes it possible for
- extended registers to be saved and restored with
- &s.code;vgaHWSave()&e.code; and &s.code;vgaHWRestore()&e.code;.
- This function should be called after a &s.code;vgaHWRec&e.code;
- has been allocated with &s.code;vgaHWGetHWRec()&e.code;. The
- default values are defined in &s.code;vgaHW.h&e.code; as follows:
-
- <quote><verb>
-#define VGA_NUM_CRTC 25
-#define VGA_NUM_SEQ 5
-#define VGA_NUM_GFX 9
-#define VGA_NUM_ATTR 21
- </verb></quote>
-
- </quote>
-
- &s.code;Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src)&e.code;
- <quote><p>
- This function copies the contents of the VGA saved registers in
- &s.code;src&e.code; to &s.code;dst&e.code;. Note that it isn't
- possible to simply do this with &s.code;memcpy()&e.code; (or
- similar). This function returns &s.code;TRUE&e.code; unless there
- is a problem allocating space for the &s.code;CRTC&e.code and
- related fields in &s.code;dst&e.code;.
-
- </quote>
-
- &s.code;void vgaHWSetStdFuncs(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function initialises the register access function fields of
- &s.code;hwp&e.code; with the standard VGA set of functions. This
- is called by &s.code;vgaHWGetHWRec()&e.code;, so there is usually
- no need to call this explicitly. The register access functions
- are described below. If the registers are shadowed in some other
- port I/O space (for example a PCI I/O region), these functions
- can be used to access the shadowed registers if
- &s.code;hwp-&gt;PIOOffset&e.code; is initialised with
- &s.code;offset&e.code;, calculated in such a way that when the
- standard VGA I/O port value is added to it the correct offset into
- the PIO area results. This value is initialised to zero in
- &s.code;vgaHWGetHWRec()&e.code;. (Note: the PIOOffset functionality
- is present in XFree86 4.1.0 and later.)
-
- </quote>
-
- &s.code;void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset)&e.code;
- <quote><p>
- This function initialised the register access function fields of
- hwp with a generic MMIO set of functions.
- &s.code;hwp-&gt;MMIOBase&e.code; is initialised with
- &s.code;base&e.code;, which must be the virtual address that the
- start of MMIO area is mapped to. &s.code;hwp-&gt;MMIOOffset&e.code;
- is initialised with &s.code;offset&e.code;, which must be calculated
- in such a way that when the standard VGA I/O port value is added
- to it the correct offset into the MMIO area results. That means
- that these functions are only suitable when the VGA I/O ports are
- made available in a direct mapping to the MMIO space. If that is
- not the case, the driver will need to provide its own register
- access functions. The register access functions are described
- below.
-
- </quote>
-
- &s.code;Bool vgaHWMapMem(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- This function maps the VGA memory window. It requires that the
- &s.code;vgaHWRec&e.code; be allocated. If a driver requires
- non-default &s.code;MapPhys&e.code; or &s.code;MapSize&e.code;
- settings (the physical location and size of the VGA memory window)
- then those fields of the &s.code;vgaHWRec&e.code; must be initialised
- before calling this function. Otherwise, this function initialiases
- the default values of &s.code;0xA0000&e.code; for
- &s.code;MapPhys&e.code; and &s.code;(64&nbsp;*&nbsp;1024)&e.code; for
- &s.code;MapSize&e.code;. This function must be called before
- attempting to save or restore the VGA state. If the driver doesn't
- call it explicitly, the &s.code;vgaHWSave()&e.code; and
- &s.code;vgaHWRestore()&e.code; functions may call it if they need
- to access the VGA memory (in which case they will also call
- &s.code;vgaHWUnmapMem()&e.code; to unmap the VGA memory before
- exiting).
-
- </quote>
-
- &s.code;void vgaHWUnmapMem(ScrnInfoPtr pScrn)&e.code;
- <quote><p>
- This function unmaps the VGA memory window. It must only be called
- after the memory has been mapped. The &s.code;Base&e.code; field
- of the &s.code;vgaHWRec&e.code; field is set to &s.code;NULL&e.code;
- to indicate that the memory is no longer mapped.
-
- </quote>
-
- &s.code;void vgaHWGetIOBase(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function initialises the &s.code;IOBase&e.code; field of the
- &s.code;vgaHWRec&e.code;. This function must be called before
- using any other functions that access the video hardware.
-
- A macro &s.code;VGAHW_GET_IOBASE()&e.code; is also available in
- &s.code;vgaHW.h&e.code; that returns the I/O base, and this may
- be used when the vgahw module is not loaded (for example, in the
- &s.code;ChipProbe()&e.code; function).
-
- </quote>
-
- &s.code;void vgaHWUnlock(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function unlocks the VGA &s.code;CRTC[0-7]&e.code; registers,
- and must be called before attempting to write to those registers.
-
- </quote>
-
- &s.code;void vgaHWLock(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function locks the VGA &s.code;CRTC[0-7]&e.code; registers.
-
- </quote>
-
- &s.code;void vgaHWEnable(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function enables the VGA subsystem. (Note, this function is
- present in XFree86 4.1.0 and later.).
-
- </quote>
-
- &s.code;void vgaHWDisable(vgaHWPtr hwp)&e.code;
- <quote><p>
- This function disables the VGA subsystem. (Note, this function is
- present in XFree86 4.1.0 and later.).
-
- </quote>
-
- &s.code;void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags)&e.code;
- <quote><p>
- This function saves the VGA state. The state is written to the
- &s.code;vgaRegRec&e.code; pointed to by &s.code;save&e.code;.
- &s.code;flags&e.code; is set to one or more of the following flags
- ORed together:
-
- &s.code;VGA_SR_MODE&e.code;
- <quote>the mode setting registers are saved</quote>
- &s.code;VGA_SR_FONTS&e.code;
- <quote>the text mode font/text data is saved</quote>
- &s.code;VGA_SR_CMAP&e.code;
- <quote>the colourmap (LUT) is saved</quote>
- &s.code;VGA_SR_ALL&e.code;
- <quote>all of the above are saved</quote>
-
- The &s.code;vgaHWRec&e.code; and its &s.code;IOBase&e.code; fields
- must be initialised before this function is called. If
- &s.code;VGA_SR_FONTS&e.code; is set in &s.code;flags&e.code;, the
- VGA memory window must be mapped. If it isn't then
- &s.code;vgaHWMapMem()&e.code; will be called to map it, and
- &s.code;vgaHWUnmapMem()&e.code; will be called to unmap it
- afterwards. &s.code;vgaHWSave()&e.code; uses the three functions
- below in the order &s.code;vgaHWSaveColormap()&e.code;,
- &s.code;vgaHWSaveMode()&e.code;, &s.code;vgaHWSaveFonts()&e.code; to
- carry out the different save phases. It is undecided at this
- stage whether they will remain part of the vgahw module's public
- interface or not.
-
- </quote>
-
- &s.code;void vgaHWSaveMode(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
- <quote><p>
- This function saves the VGA mode registers. They are saved to
- the &s.code;vgaRegRec&e.code; pointed to by &s.code;save&e.code;.
- The registers saved are:
-
- <quote>
- &s.code;MiscOut&nl;
- CRTC[0-0x18]&nl;
- Attribute[0-0x14]&nl;
- Graphics[0-8]&nl;
- Sequencer[0-4]&e.code;
- </quote>
-
- The number of registers actually saved may be modified by a prior call
- to &s.code;vgaHWSetRegCounts()&e.code;.
-
- </quote>
-
- &s.code;void vgaHWSaveFonts(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
- <quote><p>
- This function saves the text mode font and text data held in the
- video memory. If called while in a graphics mode, no save is
- done. The VGA memory window must be mapped with
- &s.code;vgaHWMapMem()&e.code; before to calling this function.
-
- On some platforms, one or more of the font/text plane saves may be
- no-ops. This is the case when the platform's VC driver already
- takes care of this.
-
- </quote>
-
- &s.code;void vgaHWSaveColormap(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
- <quote><p>
- This function saves the VGA colourmap (LUT). Before saving it, it
- attempts to verify that the colourmap is readable. In rare cases
- where it isn't readable, a default colourmap is saved instead.
-
- </quote>
-
- &s.code;void vgaHWRestore(ScrnInfoPtr pScrn, vgaRegPtr restore, int flags)&e.code;
- <quote><p>
- This function programs the VGA state. The state programmed is
- that contained in the &s.code;vgaRegRec&e.code; pointed to by
- &s.code;restore&e.code;. &s.code;flags&e.code; is the same
- as described above for the &s.code;vgaHWSave()&e.code; function.
-
- The &s.code;vgaHWRec&e.code; and its &s.code;IOBase&e.code; fields
- must be initialised before this function is called. If
- &s.code;VGA_SR_FONTS&e.code; is set in &s.code;flags&e.code;, the
- VGA memory window must be mapped. If it isn't then
- &s.code;vgaHWMapMem()&e.code; will be called to map it, and
- &s.code;vgaHWUnmapMem()&e.code; will be called to unmap it
- afterwards. &s.code;vgaHWRestore()&e.code; uses the three functions
- below in the order &s.code;vgaHWRestoreFonts()&e.code;,
- &s.code;vgaHWRestoreMode()&e.code;,
- &s.code;vgaHWRestoreColormap()&e.code; to carry out the different
- restore phases. It is undecided at this stage whether they will
- remain part of the vgahw module's public interface or not.
-
- </quote>
-
- &s.code;void vgaHWRestoreMode(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
- <quote><p>
- This function restores the VGA mode registers. They are restored
- from the data in the &s.code;vgaRegRec&e.code; pointed to by
- &s.code;restore&e.code;. The registers restored are:
-
- <quote>
- &s.code;MiscOut&nl;
- CRTC[0-0x18]&nl;
- Attribute[0-0x14]&nl;
- Graphics[0-8]&nl;
- Sequencer[0-4]&e.code;
- </quote>
-
- The number of registers actually restored may be modified by a prior call
- to &s.code;vgaHWSetRegCounts()&e.code;.
-
- </quote>
-
- &s.code;void vgaHWRestoreFonts(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
- <quote><p>
- This function restores the text mode font and text data to the
- video memory. The VGA memory window must be mapped with
- &s.code;vgaHWMapMem()&e.code; before to calling this function.
-
- On some platforms, one or more of the font/text plane restores
- may be no-ops. This is the case when the platform's VC driver
- already takes care of this.
-
- </quote>
-
- &s.code;void vgaHWRestoreColormap(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
- <quote><p>
- This function restores the VGA colourmap (LUT).
-
- </quote>
-
- &s.code;void vgaHWInit(ScrnInfoPtr pScrn, DisplayModePtr mode)&e.code;
- <quote><p>
- This function fills in the &s.code;vgaHWRec&e.code;'s
- &s.code;ModeReg&e.code; field with the values appropriate for
- programming the given video mode. It requires that the
- &s.code;ScrnInfoRec&e.code;'s &s.code;depth&e.code; field is
- initialised, which determines how the registers are programmed.
-
- </quote>
-
- &s.code;void vgaHWSeqReset(vgaHWPtr hwp, Bool start)&e.code;
- <quote><p>
- Do a VGA sequencer reset. If start is &s.code;TRUE&e.code;, the
- reset is started. If start is &s.code;FALSE&e.code;, the reset
- is ended.
-
- </quote>
-
- &s.code;void vgaHWProtect(ScrnInfoPtr pScrn, Bool on)&e.code;
- <quote><p>
- This function protects VGA registers and memory from corruption
- during loads. It is typically called with on set to
- &s.code;TRUE&e.code; before programming, and with on set to
- &s.code;FALSE&e.code; after programming.
-
- </quote>
-
- &s.code;Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode)&e.code;
- <quote><p>
- This function blanks and unblanks the screen. It is blanked when
- &s.code;mode&e.code; is &s.code;SCREEN_SAVER_ON&e.code; or
- &s.code;SCREEN_SAVER_CYCLE&e.code;, and unblanked when
- &s.code;mode&e.code; is &s.code;SCREEN_SAVER_OFF&e.code; or
- &s.code;SCREEN_SAVER_FORCER&e.code;.
-
- </quote>
-
- &s.code;void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on)&e.code;
- <quote><p>
- This function blanks and unblanks the screen. It is blanked when
- &s.code;on&e.code; is &s.code;FALSE&e.code;, and unblanked when
- &s.code;on&e.code; is &s.code;TRUE&e.code;. This function is
- provided for use in cases where the &s.code;ScrnInfoRec&e.code;
- can't be derived from the &s.code;ScreenRec&e.code; (while probing
- for clocks, for example).
-
- </quote>
- </quote>
-
-<sect1>VGA Colormap Functions
-<p>
-
- The vgahw module uses the standard colormap support (see the
- <ref id="cmap" name="Colormap Handling"> section. This is initialised
- with the following function:
-
- <quote>
- &s.code;Bool vgaHWHandleColormaps(ScreenPtr pScreen)&e.code;
- </quote>
-
-
-<sect1>VGA Register Access Functions
-<p>
-
- The vgahw module abstracts access to the standard VGA registers by
- using a set of functions held in the &s.code;vgaHWRec&e.code;. When
- the &s.code;vgaHWRec&e.code; is created these function pointers are
- initialised with the set of standard VGA I/O register access functions.
- In addition to these, the vgahw module includes a basic set of MMIO
- register access functions, and the &s.code;vgaHWRec&e.code; function
- pointers can be initialised to these by calling the
- &s.code;vgaHWSetMmioFuncs()&e.code; function described above. Some
- drivers/platforms may require a different set of functions for VGA
- access. The access functions are described here.
-
-
- <quote><p>
- &s.code;void writeCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to CRTC register &s.code;index&e.code;.
-
- </quote>
-
- &s.code;CARD8 readCrtc(vgaHWPtr hwp, CARD8 index)&e.code;
- <quote><p>
- Return the value read from CRTC register &s.code;index&e.code;.
-
- </quote>
-
- &s.code;void writeGr(vgaHWPtr hwp, CARD8 index, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to Graphics Controller register
- &s.code;index&e.code;.
-
- </quote>
-
- &s.code;CARD8 readGR(vgaHWPtr hwp, CARD8 index)&e.code;
- <quote><p>
- Return the value read from Graphics Controller register
- &s.code;index&e.code;.
-
- </quote>
-
- &s.code;void writeSeq(vgaHWPtr hwp, CARD8 index, CARD8, value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to Sequencer register
- &s.code;index&e.code;.
-
- </quote>
-
- &s.code;CARD8 readSeq(vgaHWPtr hwp, CARD8 index)&e.code;
- <quote><p>
- Return the value read from Sequencer register &s.code;index&e.code;.
-
- </quote>
-
- &s.code;void writeAttr(vgaHWPtr hwp, CARD8 index, CARD8, value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to Attribute Controller register
- &s.code;index&e.code;. When writing out the index value this
- function should set bit 5 (&s.code;0x20&e.code;) according to the
- setting of &s.code;hwp-&gt;paletteEnabled&e.code; in order to
- preserve the palette access state. It should be cleared when
- &s.code;hwp-&gt;paletteEnabled&e.code; is &s.code;TRUE&e.code;
- and set when it is &s.code;FALSE&e.code;.
-
- </quote>
-
- &s.code;CARD8 readAttr(vgaHWPtr hwp, CARD8 index)&e.code;
- <quote><p>
- Return the value read from Attribute Controller register
- &s.code;index&e.code;. When writing out the index value this
- function should set bit 5 (&s.code;0x20&e.code;) according to the
- setting of &s.code;hwp-&gt;paletteEnabled&e.code; in order to
- preserve the palette access state. It should be cleared when
- &s.code;hwp-&gt;paletteEnabled&e.code; is &s.code;TRUE&e.code;
- and set when it is &s.code;FALSE&e.code;.
-
- </quote>
-
- &s.code;void writeMiscOut(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write `&s.code;value&e.code;' to the Miscellaneous Output register.
-
- </quote>
-
- &s.code;CARD8 readMiscOut(vgwHWPtr hwp)&e.code;
- <quote><p>
- Return the value read from the Miscellaneous Output register.
-
- </quote>
-
- &s.code;void enablePalette(vgaHWPtr hwp)&e.code;
- <quote><p>
- Clear the palette address source bit in the Attribute Controller
- index register and set &s.code;hwp-&gt;paletteEnabled&e.code; to
- &s.code;TRUE&e.code;.
-
- </quote>
-
- &s.code;void disablePalette(vgaHWPtr hwp)&e.code;
- <quote><p>
- Set the palette address source bit in the Attribute Controller
- index register and set &s.code;hwp-&gt;paletteEnabled&e.code; to
- &s.code;FALSE&e.code;.
-
- </quote>
-
- &s.code;void writeDacMask(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to the DAC Mask register.
-
- </quote>
-
- &s.code;CARD8 readDacMask(vgaHWptr hwp)&e.code;
- <quote><p>
- Return the value read from the DAC Mask register.
-
- </quote>
-
- &s.code;void writeDacReadAddress(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to the DAC Read Address register.
-
- </quote>
-
- &s.code;void writeDacWriteAddress(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to the DAC Write Address register.
-
- </quote>
-
- &s.code;void writeDacData(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to the DAC Data register.
-
- </quote>
-
- &s.code;CARD8 readDacData(vgaHWptr hwp)&e.code;
- <quote><p>
- Return the value read from the DAC Data register.
-
- </quote>
-
- &s.code;CARD8 readEnable(vgaHWptr hwp)&e.code;
- <quote><p>
- Return the value read from the VGA Enable register. (Note: This
- function is present in XFree86 4.1.0 and later.)
-
- </quote>
-
- &s.code;void writeEnable(vgaHWPtr hwp, CARD8 value)&e.code;
- <quote><p>
- Write &s.code;value&e.code; to the VGA Enable register. (Note: This
- function is present in XFree86 4.1.0 and later.)
-
- </quote>
- </quote>
-
-<sect>Some notes about writing a driver<label id="sample">
-<p>
-
-<em>NOTE: some parts of this are not up to date</em>
-
-The following is an outline for writing a basic unaccelerated driver
-for a PCI video card with a linear mapped framebuffer, and which has a
-VGA core. It is includes some general information that is relevant to
-most drivers (even those which don't fit that basic description).
-
-The information here is based on the initial conversion of the Matrox
-Millennium driver to the ``new design''. For a fleshing out and sample
-implementation of some of the bits outlined here, refer to that driver.
-Note that this is an example only. The approach used here will not be
-appropriate for all drivers.
-
-Each driver must reserve a unique driver name, and a string that is used
-to prefix all of its externally visible symbols. This is to avoid name
-space clashes when loading multiple drivers. The examples here are for
-the ``ZZZ'' driver, which uses the ``ZZZ'' or ``zzz'' prefix for its externally
-visible symbols.
-
-
-<sect1>Include files
-<p>
-
- All drivers normally include the following headers:
- <quote>
- &s.code;"xf86.h"&nl;
- "xf86_OSproc.h"&nl;
- "xf86_ansic.h"&nl;
- "xf86Resources.h"&e.code;
- </quote>
- Wherever inb/outb (and related things) are used the following should be
- included:
- <quote>
- &s.code;"compiler.h"&e.code;
- </quote>
- Note: in drivers, this must be included after &s.code;"xf86_ansic.h"&e.code;.
-
- Drivers that need to access PCI vendor/device definitions need this:
- <quote>
- &s.code;"xf86PciInfo.h"&e.code;
- </quote>
-
- Drivers that need to access the PCI config space need this:
- <quote>
- &s.code;"xf86Pci.h"&e.code;
- </quote>
-
- Drivers using the mi banking wrapper need:
-
- <quote>
- &s.code;"mibank.h"&e.code;
- </quote>
-
- Drivers that initialise a SW cursor need this:
- <quote>
- &s.code;"mipointer.h"&e.code;
- </quote>
-
- All drivers implementing backing store need this:
- <quote>
- &s.code;"mibstore.h"&e.code;
- </quote>
-
- All drivers using the mi colourmap code need this:
- <quote>
- &s.code;"micmap.h"&e.code;
- </quote>
-
- If a driver uses the vgahw module, it needs this:
- <quote>
- &s.code;"vgaHW.h"&e.code;
- </quote>
-
- Drivers supporting VGA or Hercules monochrome screens need:
- <quote>
- &s.code;"xf1bpp.h"&e.code;
- </quote>
-
- Drivers supporting VGA or EGC 16-colour screens need:
- <quote>
- &s.code;"xf4bpp.h"&e.code;
- </quote>
-
- Drivers using cfb need:
- <quote>
- &s.code;#define PSZ 8&nl;
- #include "cfb.h"&nl;
- #undef PSZ&e.code;
- </quote>
-
- Drivers supporting bpp 16, 24 or 32 with cfb need one or more of:
- <quote>
- &s.code;"cfb16.h"&nl;
- "cfb24.h"&nl;
- "cfb32.h"&e.code;
- </quote>
-
- The driver's own header file:
- <quote>
- &s.code;"zzz.h"&e.code;
- </quote>
-
- Drivers must NOT include the following:
-
- <quote>
- &s.code;"xf86Priv.h"&nl;
- "xf86Privstr.h"&nl;
- "xf86_libc.h"&nl;
- "xf86_OSlib.h"&nl;
- "Xos.h"&e.code;&nl;
- any OS header
- </quote>
-
-
-<sect1>Data structures and initialisation
-<p>
-
-<itemize>
- <item>The following macros should be defined:
- <code>
-#define VERSION <version-as-an-int>
-#define ZZZ_NAME "ZZZ" /* the name used to prefix messages */
-#define ZZZ_DRIVER_NAME "zzz" /* the driver name as used in config file */
-#define ZZZ_MAJOR_VERSION <int>
-#define ZZZ_MINOR_VERSION <int>
-#define ZZZ_PATCHLEVEL <int>
- </code>
-<p>
- NOTE: &s.code;ZZZ_DRIVER_NAME&e.code; should match the name of the
- driver module without things like the "lib" prefix, the "_drv" suffix
- or filename extensions.
-<p>
-
- <item>A DriverRec must be defined, which includes the functions required
- at the pre-probe phase. The name of this DriverRec must be an
- upper-case version of ZZZ_DRIVER_NAME (for the purposes of static
- linking).
-<p>
- <code>
-DriverRec ZZZ = {
- VERSION,
- ZZZ_DRIVER_NAME,
- ZZZIdentify,
- ZZZProbe,
- ZZZAvailableOptions,
- NULL,
- 0
-};
- </code>
-
- <item>Define list of supported chips and their matching ID:
-<p>
- <code>
-static SymTabRec ZZZChipsets[] = {
- { PCI_CHIP_ZZZ1234, "zzz1234a" },
- { PCI_CHIP_ZZZ5678, "zzz5678a" },
- { -1, NULL }
-};
- </code>
-<p>
- The token field may be any integer value that the driver may use to
- uniquely identify the supported chipsets. For drivers that support
- only PCI devices using the PCI device IDs might be a natural choice,
- but this isn't mandatory. For drivers that support both PCI and other
- devices (like ISA), some other ID should probably used. When other
- IDs are used as the tokens it is recommended that the names be
- defined as an &s.code;enum&e.code; type.
-<p>
- <item>If the driver uses the &s.code;xf86MatchPciInstances(&e.code;)
- helper (recommended for drivers that support PCI cards) a list that
- maps PCI IDs to chip IDs and fixed resources must be defined:
-<p>
- <code>
-static PciChipsets ZZZPciChipsets[] = {
- { PCI_CHIP_ZZZ1234, PCI_CHIP_ZZZ1234, RES_SHARED_VGA },
- { PCI_CHIP_ZZZ5678, PCI_CHIP_ZZZ5678, RES_SHARED_VGA },
- { -1, -1, RES_UNDEFINED }
-}
- </code>
-<p>
- <item>Define the &s.code;XF86ModuleVersionInfo&e.code; struct for the
- driver. This is required for the dynamically loaded version:
-<p>
- <code>
-#ifdef XFree86LOADER
-static XF86ModuleVersionInfo zzzVersRec =
-{
- "zzz",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- ZZZ_MAJOR_VERSION, ZZZ_MINOR_VERSION, ZZZ_PATCHLEVEL,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_VIDEODRV,
- {0,0,0,0}
-};
-#endif
- </code>
-<p>
- <item>Define a data structure to hold the driver's screen-specific data.
- This must be used instead of global variables. This would be defined
- in the &s.code;"zzz.h"&e.code; file, something like:
-<p>
- <code>
-typedef struct {
- type1 field1;
- type2 field2;
- int fooHack;
- Bool pciRetry;
- Bool noAccel;
- Bool hwCursor;
- CloseScreenProcPtr CloseScreen;
- OptionInfoPtr Options;
- ...
-} ZZZRec, *ZZZPtr;
- </code>
-<p>
- <item>Define the list of config file Options that the driver accepts. For
- consistency between drivers those in the list of ``standard'' options
- should be used where appropriate before inventing new options.
-<p>
- <code>
-typedef enum {
- OPTION_FOO_HACK,
- OPTION_PCI_RETRY,
- OPTION_HW_CURSOR,
- OPTION_NOACCEL
-} ZZZOpts;
-
-static const OptionInfoRec ZZZOptions[] = {
- { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE },
- { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
-};
- </code>
-<p>
-</itemize>
-
-<sect1>Functions
-<p>
-
-
-<sect2>SetupProc
-<p>
-
- For dynamically loaded modules, a &s.code;ModuleData&e.code;
- variable is required. It is should be the name of the driver
- prepended to "ModuleData". A &s.code;Setup()&e.code; function is
- also required, which calls &s.code;xf86AddDriver()&e.code; to add
- the driver to the main list of drivers.
-
- <code>
-#ifdef XFree86LOADER
-
-static MODULESETUPPROTO(mgaSetup);
-
-XF86ModuleData zzzModuleData = { &amp;zzzVersRec, zzzSetup, NULL };
-
-static pointer
-zzzSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- /* This module should be loaded only once, but check to be sure. */
-
- if (!setupDone) {
- /*
- * Modules that this driver always requires may be loaded
- * here by calling LoadSubModule().
- */
-
- setupDone = TRUE;
- xf86AddDriver(&amp;MGA, module, 0);
-
- /*
- * The return value must be non-NULL on success even though
- * there is no TearDownProc.
- */
- return (pointer)1;
- } else {
- if (errmaj) *errmaj = LDR_ONCEONLY;
- return NULL;
- }
-}
-#endif
- </code>
-
-<sect2>GetRec, FreeRec
-<p>
-
- A function is usually required to allocate the driver's
- screen-specific data structure and hook it into the
- &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field.
- The &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; is
- initialised to &s.code;NULL&e.code;, so it is easy to check if the
- initialisation has already been done. After allocating it, initialise
- the fields. By using &s.code;xnfcalloc()&e.code; to do the allocation
- it is zeroed, and if the allocation fails the server exits.
-<p>
- NOTE:
- When allocating structures from inside the driver which are defined
- on the common level it is important to initialize the structure to
- zero.
- Only this guarantees that the server remains source compatible to
- future changes in common level structures.
-
- <code>
-static Bool
-ZZZGetRec(ScrnInfoPtr pScrn)
-{
- if (pScrn->driverPrivate != NULL)
- return TRUE;
- pScrn->driverPrivate = xnfcalloc(sizeof(ZZZRec), 1);
- /* Initialise as required */
- ...
- return TRUE;
-}
- </code>
-
- Define a macro in &s.code;"zzz.h"&e.code; which gets a pointer to
- the &s.code;ZZZRec&e.code; when given &s.code;pScrn&e.code;:
-
- <code>
-#define ZZZPTR(p) ((ZZZPtr)((p)->driverPrivate))
- </code>
-
- Define a function to free the above, setting it to &s.code;NULL&e.code;
- once it has been freed:
-
- <code>
-static void
-ZZZFreeRec(ScrnInfoPtr pScrn)
-{
- if (pScrn->driverPrivate == NULL)
- return;
- xfree(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
-}
- </code>
-
-<sect2>Identify
-<p>
-
- Define the &s.code;Identify()&e.code; function. It is run before
- the Probe, and typically prints out an identifying message, which
- might include the chipsets it supports. This function is mandatory:
-
- <code>
-static void
-ZZZIdentify(int flags)
-{
- xf86PrintChipsets(ZZZ_NAME, "driver for ZZZ Tech chipsets",
- ZZZChipsets);
-}
- </code>
-
-<sect2>Probe
-<p>
-
- Define the &s.code;Probe()&e.code; function. The purpose of this
- is to find all instances of the hardware that the driver supports,
- and for the ones not already claimed by another driver, claim the
- slot, and allocate a &s.code;ScrnInfoRec&e.code;. This should be
- a minimal probe, and it should under no circumstances leave the
- state of the hardware changed. Because a device is found, don't
- assume that it will be used. Don't do any initialisations other
- than the required &s.code;ScrnInfoRec&e.code; initialisations.
- Don't allocate any new data structures.
-
- This function is mandatory.
-
- NOTE: The &s.code;xf86DrvMsg()&e.code; functions cannot be used from
- the Probe.
-
- <code>
-static Bool
-ZZZProbe(DriverPtr drv, int flags)
-{
- Bool foundScreen = FALSE;
- int numDevSections, numUsed;
- GDevPtr *devSections;
- int *usedChips;
- int i;
-
- /*
- * Find the config file Device sections that match this
- * driver, and return if there are none.
- */
- if ((numDevSections = xf86MatchDevice(ZZZ_DRIVER_NAME,
- &amp;devSections)) <= 0) {
- return FALSE;
- }
-
- /*
- * Since this is a PCI card, "probing" just amounts to checking
- * the PCI data that the server has already collected. If there
- * is none, return.
- *
- * Although the config file is allowed to override things, it
- * is reasonable to not allow it to override the detection
- * of no PCI video cards.
- *
- * The provided xf86MatchPciInstances() helper takes care of
- * the details.
- */
- /* test if PCI bus present */
- if (xf86GetPciVideoInfo()) {
-
- numUsed = xf86MatchPciInstances(ZZZ_NAME, PCI_VENDOR_ZZZ,
- ZZZChipsets, ZZZPciChipsets, devSections,
- numDevSections, drv, &amp;usedChips);
-
- for (i = 0; i < numUsed; i++) {
- ScrnInfoPtr pScrn = NULL;
- if ((pScrn = xf86ConfigPciEntity(pScrn, flags, usedChips[i],
- ZZZPciChipsets, NULL, NULL,
- NULL, NULL, NULL))) {
- /* Allocate a ScrnInfoRec */
- pScrn->driverVersion = VERSION;
- pScrn->driverName = ZZZ_DRIVER_NAME;
- pScrn->name = ZZZ_NAME;
- pScrn->Probe = ZZZProbe;
- pScrn->PreInit = ZZZPreInit;
- pScrn->ScreenInit = ZZZScreenInit;
- pScrn->SwitchMode = ZZZSwitchMode;
- pScrn->AdjustFrame = ZZZAdjustFrame;
- pScrn->EnterVT = ZZZEnterVT;
- pScrn->LeaveVT = ZZZLeaveVT;
- pScrn->FreeScreen = ZZZFreeScreen;
- pScrn->ValidMode = ZZZValidMode;
- foundScreen = TRUE;
- /* add screen to entity */
- }
- }
- xfree(usedChips);
- }
-
-#ifdef HAS_ISA_DEVS
- /*
- * If the driver supports ISA hardware, the following block
- * can be included too.
- */
- numUsed = xf86MatchIsaInstances(ZZZ_NAME, ZZZChipsets,
- ZZZIsaChipsets, drv, ZZZFindIsaDevice,
- devSections, numDevSections, &amp;usedChips);
- for (i = 0; i < numUsed; i++) {
- ScrnInfoPtr pScrn = NULL;
- if ((pScrn = xf86ConfigIsaEntity(pScrn, flags, usedChips[i],
- ZZZIsaChipsets, NULL, NULL, NULL,
- NULL, NULL))) {
- pScrn->driverVersion = VERSION;
- pScrn->driverName = ZZZ_DRIVER_NAME;
- pScrn->name = ZZZ_NAME;
- pScrn->Probe = ZZZProbe;
- pScrn->PreInit = ZZZPreInit;
- pScrn->ScreenInit = ZZZScreenInit;
- pScrn->SwitchMode = ZZZSwitchMode;
- pScrn->AdjustFrame = ZZZAdjustFrame;
- pScrn->EnterVT = ZZZEnterVT;
- pScrn->LeaveVT = ZZZLeaveVT;
- pScrn->FreeScreen = ZZZFreeScreen;
- pScrn->ValidMode = ZZZValidMode;
- foundScreen = TRUE;
- }
- }
- xfree(usedChips);
-#endif /* HAS_ISA_DEVS */
-
- xfree(devSections);
- return foundScreen;
- </code>
-
-<sect2>AvailableOptions
-<p>
-
- Define the &s.code;AvailableOptions()&e.code; function. The purpose
- of this is to return the available driver options back to the
- -configure option, so that an XF86Config file can be built and the
- user can see which options are available for them to use.
-
-<sect2>PreInit
-<p>
-
- Define the &s.code;PreInit()&e.code; function. The purpose of
- this is to find all the information required to determine if the
- configuration is usable, and to initialise those parts of the
- &s.code;ScrnInfoRec&e.code; that can be set once at the beginning
- of the first server generation. The information should be found in
- the least intrusive way possible.
-
- This function is mandatory.
-
- NOTES:
- <enum>
- <item>The &s.code;PreInit()&e.code; function is only called once
- during the life of the X server (at the start of the first
- generation).
-
- <item>Data allocated here must be of the type that persists for
- the life of the X server. This means that data that hooks into
- the &s.code;ScrnInfoRec&e.code;'s &s.code;privates&e.code;
- field should be allocated here, but data that hooks into the
- &s.code;ScreenRec&e.code;'s &s.code;devPrivates&e.code; field
- should not be allocated here. The &s.code;driverPrivate&e.code;
- field should also be allocated here.
-
- <item>Although the &s.code;ScrnInfoRec&e.code; has been allocated
- before this function is called, the &s.code;ScreenRec&e.code;
- has not been allocated. That means that things requiring it
- cannot be used in this function.
-
- <item>Very little of the &s.code;ScrnInfoRec&e.code; has been
- initialised when this function is called. It is important to
- get the order of doing things right in this function.
-
- </enum>
-
- <code>
-static Bool
-ZZZPreInit(ScrnInfoPtr pScrn, int flags)
-{
- /* Fill in the monitor field */
- pScrn->monitor = pScrn->confScreen->monitor;
-
- /*
- * If using the vgahw module, it will typically be loaded
- * here by calling xf86LoadSubModule(pScrn, "vgahw");
- */
-
- /*
- * Set the depth/bpp. Use the globally preferred depth/bpp. If the
- * driver has special default depth/bpp requirements, the defaults should
- * be specified here explicitly.
- * We support both 24bpp and 32bpp framebuffer layouts.
- * This sets pScrn->display also.
- */
- if (!xf86SetDepthBpp(pScrn, 0, 0, 0,
- Support24bppFb | Support32bppFb)) {
- return FALSE;
- } else {
- if (depth/bpp isn't one we support) {
- print error message;
- return FALSE;
- }
- }
- /* Print out the depth/bpp that was set */
- xf86PrintDepthBpp(pScrn);
-
- /* Set bits per RGB for 8bpp */
- if (pScrn->depth <= 8) {
- /* Take into account a dac_6_bit option here */
- pScrn->rgbBits = 6 or 8;
- }
-
- /*
- * xf86SetWeight() and xf86SetDefaultVisual() must be called
- * after pScrn->display is initialised.
- */
-
- /* Set weight/mask/offset for depth > 8 */
- if (pScrn->depth > 8) {
- if (!xf86SetWeight(pScrn, defaultWeight, defaultMask)) {
- return FALSE;
- } else {
- if (weight isn't one we support) {
- print error message;
- return FALSE;
- }
- }
- }
-
- /* Set the default visual. */
- if (!xf86SetDefaultVisual(pScrn, -1)) {
- return FALSE;
- } else {
- if (visual isn't one we support) {
- print error message;
- return FALSE;
- }
- }
-
- /* If the driver supports gamma correction, set the gamma. */
- if (!xf86SetGamma(pScrn, default_gamma)) {
- return FALSE;
- }
-
- /* This driver uses a programmable clock */
- pScrn->progClock = TRUE;
-
- /* Allocate the ZZZRec driverPrivate */
- if (!ZZZGetRec(pScrn)) {
- return FALSE;
- }
-
- pZzz = ZZZPTR(pScrn);
-
- /* Collect all of the option flags (fill in pScrn->options) */
- xf86CollectOptions(pScrn, NULL);
-
- /*
- * Process the options based on the information in ZZZOptions.
- * The results are written to pZzz->Options. If all of the options
- * processing is done within this function a local variable "options"
- * can be used instead of pZzz->Options.
- */
- if (!(pZzz->Options = xalloc(sizeof(ZZZOptions))))
- return FALSE;
- (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options);
-
- /*
- * Set various fields of ScrnInfoRec and/or ZZZRec based on
- * the options found.
- */
- from = X_DEFAULT;
- pZzz->hwCursor = FALSE;
- if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) {
- from = X_CONFIG;
- pZzz->hwCursor = TRUE;
- }
- xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
- pZzz->hwCursor ? "HW" : "SW");
- if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) {
- pZzz->noAccel = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Acceleration disabled\n");
- } else {
- pZzz->noAccel = FALSE;
- }
- if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) {
- pZzz->UsePCIRetry = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
- }
- pZzz->fooHack = 0;
- if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK,
- &amp;pZzz->fooHack)) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n",
- pZzz->fooHack);
- }
-
- /*
- * Find the PCI slot(s) that this screen claimed in the probe.
- * In this case, exactly one is expected, so complain otherwise.
- * Note in this case we're not interested in the card types so
- * that parameter is set to NULL.
- */
- if ((i = xf86GetPciInfoForScreen(pScrn->scrnIndex, &amp;pciList, NULL))
- != 1) {
- print error message;
- ZZZFreeRec(pScrn);
- if (i > 0)
- xfree(pciList);
- return FALSE;
- }
- /* Note that pciList should be freed below when no longer needed */
-
- /*
- * Determine the chipset, allowing config file chipset and
- * chipid values to override the probed information. The config
- * chipset value has precedence over its chipid value if both
- * are present.
- *
- * It isn't necessary to fill in pScrn->chipset if the driver
- * keeps track of the chipset in its ZZZRec.
- */
-
- ...
-
- /*
- * Determine video memory, fb base address, I/O addresses, etc,
- * allowing the config file to override probed values.
- *
- * Set the appropriate pScrn fields (videoRam is probably the
- * most important one that other code might require), and
- * print out the settings.
- */
-
- ...
-
- /* Initialise a clockRanges list. */
-
- ...
-
- /* Set any other chipset specific things in the ZZZRec */
-
- ...
-
- /* Select valid modes from those available */
-
- i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
- pScrn->display->modes, clockRanges,
- NULL, minPitch, maxPitch, rounding,
- minHeight, maxHeight,
- pScrn->display->virtualX,
- pScrn->display->virtualY,
- pScrn->videoRam * 1024,
- LOOKUP_BEST_REFRESH);
- if (i == -1) {
- ZZZFreeRec(pScrn);
- return FALSE;
- }
-
- /* Prune the modes marked as invalid */
-
- xf86PruneDriverModes(pScrn);
-
- /* If no valid modes, return */
-
- if (i == 0 || pScrn->modes == NULL) {
- print error message;
- ZZZFreeRec(pScrn);
- return FALSE;
- }
-
- /*
- * Initialise the CRTC fields for the modes. This driver expects
- * vertical values to be halved for interlaced modes.
- */
- xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
-
- /* Set the current mode to the first in the list. */
- pScrn->currentMode = pScrn->modes;
-
- /* Print the list of modes being used. */
- xf86PrintModes(pScrn);
-
- /* Set the DPI */
- xf86SetDpi(pScrn, 0, 0);
-
- /* Load bpp-specific modules */
- switch (pScrn->bitsPerPixel) {
- case 1:
- mod = "xf1bpp";
- break;
- case 4:
- mod = "xf4bpp";
- break;
- case 8:
- mod = "cfb";
- break;
- case 16:
- mod = "cfb16";
- break;
- case 24:
- mod = "cfb24";
- break;
- case 32:
- mod = "cfb32";
- break;
- }
- if (mod && !xf86LoadSubModule(pScrn, mod))
- ZZZFreeRec(pScrn);
- return FALSE;
-
- /* Load XAA if needed */
- if (!pZzz->noAccel || pZzz->hwCursor)
- if (!xf86LoadSubModule(pScrn, "xaa")) {
- ZZZFreeRec(pScrn);
- return FALSE;
- }
-
- /* Done */
- return TRUE;
-}
- </code>
-
-<sect2>MapMem, UnmapMem
-<p>
-
- Define functions to map and unmap the video memory and any other
- memory apertures required. These functions are not mandatory, but
- it is often useful to have such functions.
-
- <code>
-static Bool
-ZZZMapMem(ScrnInfoPtr pScrn)
-{
- /* Call xf86MapPciMem() to map each PCI memory area */
- ...
- return TRUE or FALSE;
-}
-
-static Bool
-ZZZUnmapMem(ScrnInfoPtr pScrn)
-{
- /* Call xf86UnMapVidMem() to unmap each memory area */
- ...
- return TRUE or FALSE;
-}
- </code>
-
-<sect2>Save, Restore
-<p>
-
- Define functions to save and restore the original video state. These
- functions are not mandatory, but are often useful.
-
- <code>
-static void
-ZZZSave(ScrnInfoPtr pScrn)
-{
- /*
- * Save state into per-screen data structures.
- * If using the vgahw module, vgaHWSave will typically be
- * called here.
- */
- ...
-}
-
-static void
-ZZZRestore(ScrnInfoPtr pScrn)
-{
- /*
- * Restore state from per-screen data structures.
- * If using the vgahw module, vgaHWRestore will typically be
- * called here.
- */
- ...
-}
- </code>
-
-<sect2>ModeInit
-<p>
-
- Define a function to initialise a new video mode. This function isn't
- mandatory, but is often useful.
-
- <code>
-static Bool
-ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- /*
- * Program a video mode. If using the vgahw module,
- * vgaHWInit and vgaRestore will typically be called here.
- * Once up to the point where there can't be a failure
- * set pScrn->vtSema to TRUE.
- */
- ...
-}
- </code>
-
-<sect2>ScreenInit
-<p>
-
- Define the &s.code;ScreenInit()&e.code; function. This is called
- at the start of each server generation, and should fill in as much
- of the &s.code;ScreenRec&e.code; as possible as well as any other
- data that is initialised once per generation. It should initialise
- the framebuffer layers it is using, and initialise the initial video
- mode.
-
- This function is mandatory.
-
- NOTE: The &s.code;ScreenRec&e.code; (&s.code;pScreen&e.code;) is
- passed to this driver, but it and the
- &s.code;ScrnInfoRecs&e.code; are not yet hooked into each
- other. This means that in this function, and functions it
- calls, one cannot be found from the other.
-
- <code>
-static Bool
-ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
-{
- /* Get the ScrnInfoRec */
- pScrn = xf86Screens[pScreen->myNum];
-
- /*
- * If using the vgahw module, its data structures and related
- * things are typically initialised/mapped here.
- */
-
- /* Save the current video state */
- ZZZSave(pScrn);
-
- /* Initialise the first mode */
- ZZZModeInit(pScrn, pScrn->currentMode);
-
- /* Set the viewport if supported */
-
- ZZZAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-
- /*
- * Setup the screen's visuals, and initialise the framebuffer
- * code.
- */
-
- /* Reset the visual list */
- miClearVisualTypes();
-
- /*
- * Setup the visuals supported. This driver only supports
- * TrueColor for bpp > 8, so the default set of visuals isn't
- * acceptable. To deal with this, call miSetVisualTypes with
- * the appropriate visual mask.
- */
-
- if (pScrn->bitsPerPixel > 8) {
- if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
- pScrn->rgbBits, pScrn->defaultVisual))
- return FALSE;
- } else {
- if (!miSetVisualTypes(pScrn->depth,
- miGetDefaultVisualMask(pScrn->depth),
- pScrn->rgbBits, pScrn->defaultVisual))
- return FALSE;
- }
-
- /*
- * Initialise the framebuffer.
- */
-
- switch (pScrn->bitsPerPixel) {
- case 1:
- ret = xf1bppScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 4:
- ret = xf4bppScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 8:
- ret = cfbScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 16:
- ret = cfb16ScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 24:
- ret = cfb24ScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 32:
- ret = cfb32ScreenInit(pScreen, FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- default:
- print a message about an internal error;
- ret = FALSE;
- break;
- }
-
- if (!ret)
- return FALSE;
-
- /* Override the default mask/offset settings */
- if (pScrn->bitsPerPixel > 8) {
- for (i = 0, visual = pScreen->visuals;
- i < pScreen->numVisuals; i++, visual++) {
- if ((visual->class | DynamicClass) == DirectColor) {
- visual->offsetRed = pScrn->offset.red;
- visual->offsetGreen = pScrn->offset.green;
- visual->offsetBlue = pScrn->offset.blue;
- visual->redMask = pScrn->mask.red;
- visual->greenMask = pScrn->mask.green;
- visual->blueMask = pScrn->mask.blue;
- }
- }
- }
-
- /*
- * If banking is needed, initialise an miBankInfoRec (defined in
- * "mibank.h"), and call miInitializeBanking().
- */
- if (!miInitializeBanking(pScreen, pScrn->virtualX, pScrn->virtualY,
- pScrn->displayWidth, pBankInfo))
- return FALSE;
-
- /*
- * If backing store is to be supported (as is usually the case),
- * initialise it.
- */
- miInitializeBackingStore(pScreen);
-
- /*
- * Set initial black & white colourmap indices.
- */
- xf86SetBlackWhitePixels(pScreen);
-
- /*
- * Install colourmap functions. If using the vgahw module,
- * vgaHandleColormaps would usually be called here.
- */
-
- ...
-
- /*
- * Initialise cursor functions. This example is for the mi
- * software cursor.
- */
- miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
-
- /* Initialise the default colourmap */
- switch (pScrn->depth) {
- case 1:
- if (!xf1bppCreateDefColormap(pScreen))
- return FALSE;
- break;
- case 4:
- if (!xf4bppCreateDefColormap(pScreen))
- return FALSE;
- break;
- default:
- if (!cfbCreateDefColormap(pScreen))
- return FALSE;
- break;
- }
-
- /*
- * Wrap the CloseScreen vector and set SaveScreen.
- */
- ZZZPTR(pScrn)->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = ZZZCloseScreen;
- pScreen->SaveScreen = ZZZSaveScreen;
-
- /* Report any unused options (only for the first generation) */
- if (serverGeneration == 1) {
- xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
- }
-
- /* Done */
- return TRUE;
-}
- </code>
-
-
-<sect2>SwitchMode
-<p>
-
- Define the &s.code;SwitchMode()&e.code; function if mode switching
- is supported by the driver.
-
- <code>
-static Bool
-ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
-{
- return ZZZModeInit(xf86Screens[scrnIndex], mode);
-}
- </code>
-
-
-<sect2>AdjustFrame
-<p>
-
- Define the &s.code;AdjustFrame()&e.code; function if the driver
- supports this.
-
- <code>
-static void
-ZZZAdjustFrame(int scrnIndex, int x, int y, int flags)
-{
- /* Adjust the viewport */
-}
- </code>
-
-
-<sect2>EnterVT, LeaveVT
-<p>
-
- Define the &s.code;EnterVT()&e.code; and &s.code;LeaveVT()&e.code;
- functions.
-
- These functions are mandatory.
-
- <code>
-static Bool
-ZZZEnterVT(int scrnIndex, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- return ZZZModeInit(pScrn, pScrn->currentMode);
-}
-
-static void
-ZZZLeaveVT(int scrnIndex, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- ZZZRestore(pScrn);
-}
- </code>
-
-<sect2>CloseScreen
-<p>
-
- Define the &s.code;CloseScreen()&e.code; function:
-
- This function is mandatory. Note that it unwraps the previously
- wrapped &s.code;pScreen-&gt;CloseScreen&e.code;, and finishes by
- calling it.
-
- <code>
-static Bool
-ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- if (pScrn->vtSema) {
- ZZZRestore(pScrn);
- ZZZUnmapMem(pScrn);
- }
- pScrn->vtSema = FALSE;
- pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen;
- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
-}
- </code>
-
-<sect2>SaveScreen
-<p>
-
- Define the &s.code;SaveScreen()&e.code; function (the screen
- blanking function). When using the vgahw module, this will typically
- be:
-
- <code>
-static Bool
-ZZZSaveScreen(ScreenPtr pScreen, int mode)
-{
- return vgaHWSaveScreen(pScreen, mode);
-}
- </code>
-
- This function is mandatory. Before modifying any hardware register
- directly this function needs to make sure that the Xserver is active
- by checking if &s.code;pScrn&e.code; is non-NULL and for
- &s.code;pScrn->vtSema == TRUE&e.code;.
-
-<sect2>FreeScreen
-<p>
-
- Define the &s.code;FreeScreen()&e.code; function. This function
- is optional. It should be defined if the &s.code;ScrnInfoRec&e.code;
- &s.code;driverPrivate&e.code; field is used so that it can be freed
- when a screen is deleted by the common layer for reasons possibly
- beyond the driver's control. This function is not used in during
- normal (error free) operation. The per-generation data is freed by
- the &s.code;CloseScreen()&e.code; function.
-
- <code>
-static void
-ZZZFreeScreen(int scrnIndex, int flags)
-{
- /*
- * If the vgahw module is used vgaHWFreeHWRec() would be called
- * here.
- */
- ZZZFreeRec(xf86Screens[scrnIndex]);
-}
- </code>
-
-
-</article>
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
deleted file mode 100644
index 409ada437..000000000
--- a/hw/xfree86/dri/dri.c
+++ /dev/null
@@ -1,2117 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#else
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-#define _XF86DRI_SERVER_
-#include "xf86dristr.h"
-#include "swaprep.h"
-#include "dri.h"
-#include "sarea.h"
-#include "dristruct.h"
-#include "xf86.h"
-#include "xf86drm.h"
-#include "glxserver.h"
-#include "mi.h"
-#include "mipointer.h"
-
-#if defined(XFree86LOADER) && !defined(PANORAMIX)
-extern Bool noPanoramiXExtension;
-#endif
-
-static int DRIScreenPrivIndex = -1;
-static int DRIWindowPrivIndex = -1;
-static unsigned long DRIGeneration = 0;
-static unsigned int DRIDrawableValidationStamp = 0;
-static int lockRefCount=0;
-
- /* Support cleanup for fullscreen mode,
- independent of the DRICreateDrawable
- resource management. */
-static Bool _DRICloseFullScreen(pointer pResource, XID id);
-static RESTYPE DRIFullScreenResType;
-
-static RESTYPE DRIDrawablePrivResType;
-static RESTYPE DRIContextPrivResType;
-static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv);
-
- /* Wrapper just like xf86DrvMsg, but
- without the verbosity level checking.
- This will make it easy to turn off some
- messages later, based on verbosity
- level. */
-
-/*
- * Since we're already referencing things from the XFree86 common layer in
- * this file, we'd might as well just call xf86VDrvMsgVerb, and have
- * consistent message formatting. The verbosity of these messages can be
- * easily changed here.
- */
-#define DRI_MSG_VERBOSITY 1
-static void
-DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap);
- va_end(ap);
-}
-
-Bool
-DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
-{
- DRIScreenPrivPtr pDRIPriv;
- drmContextPtr reserved;
- int reserved_count;
- int i, fd, drmWasAvailable;
- Bool xineramaInCore = FALSE;
- int err = 0;
-
- if (DRIGeneration != serverGeneration) {
- if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- DRIGeneration = serverGeneration;
- }
-
- /*
- * If Xinerama is on, don't allow DRI to initialise. It won't be usable
- * anyway.
- */
-#if defined(PANORAMIX) && !defined(XFree86LOADER)
- xineramaInCore = TRUE;
-#elif defined(XFree86LOADER)
- if (xf86LoaderCheckSymbol("noPanoramiXExtension"))
- xineramaInCore = TRUE;
-#endif
-
-#if defined(PANORAMIX) || defined(XFree86LOADER)
- if (xineramaInCore) {
- if (!noPanoramiXExtension) {
- DRIDrvMsg(pScreen->myNum, X_WARNING,
- "Direct rendering is not supported when Xinerama is enabled\n");
- return FALSE;
- }
- }
-#endif
-
- drmWasAvailable = drmAvailable();
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- fd = drmOpen(pDRIInfo->drmDriverName, NULL );
- if (fd < 0) {
- /* failed to open DRM */
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] drmOpen failed\n");
- return FALSE;
- }
-
- if (!drmWasAvailable) {
- /* drmOpen loaded the kernel module, print a message to say so */
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] loaded kernel module for \"%s\" driver\n",
- pDRIInfo->drmDriverName);
- }
-
- pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
- if (!pDRIPriv) {
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- return FALSE;
- }
-
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv;
- pDRIPriv->drmFD = fd;
- pDRIPriv->directRenderingSupport = TRUE;
- pDRIPriv->pDriverInfo = pDRIInfo;
- pDRIPriv->nrWindows = 0;
- pDRIPriv->fullscreen = NULL;
-
- pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx;
- pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv;
-
- pDRIPriv->grabbedDRILock = FALSE;
- pDRIPriv->drmSIGIOHandlerInstalled = FALSE;
-
- if ((err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString)) < 0) {
- pDRIPriv->directRenderingSupport = FALSE;
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- drmClose(pDRIPriv->drmFD);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] drmSetBusid failed (%d, %s), %s\n",
- pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err));
- return FALSE;
- }
-
- *pDRMFD = pDRIPriv->drmFD;
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] created \"%s\" driver at busid \"%s\"\n",
- pDRIPriv->pDriverInfo->drmDriverName,
- pDRIPriv->pDriverInfo->busIdString);
-
- if (drmAddMap( pDRIPriv->drmFD,
- 0,
- pDRIPriv->pDriverInfo->SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &pDRIPriv->hSAREA) < 0)
- {
- pDRIPriv->directRenderingSupport = FALSE;
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- drmClose(pDRIPriv->drmFD);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] drmAddMap failed\n");
- return FALSE;
- }
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] added %d byte SAREA at 0x%08lx\n",
- pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA);
-
- if (drmMap( pDRIPriv->drmFD,
- pDRIPriv->hSAREA,
- pDRIPriv->pDriverInfo->SAREASize,
- (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0)
- {
- pDRIPriv->directRenderingSupport = FALSE;
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- drmClose(pDRIPriv->drmFD);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] drmMap failed\n");
- return FALSE;
- }
- memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize);
- DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA 0x%08lx to %p\n",
- pDRIPriv->hSAREA, pDRIPriv->pSAREA);
-
- if (drmAddMap( pDRIPriv->drmFD,
- (drmHandle)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
- pDRIPriv->pDriverInfo->frameBufferSize,
- DRM_FRAME_BUFFER,
- 0,
- &pDRIPriv->hFrameBuffer) < 0)
- {
- pDRIPriv->directRenderingSupport = FALSE;
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize);
- drmClose(pDRIPriv->drmFD);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] drmAddMap failed\n");
- return FALSE;
- }
- DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = 0x%08lx\n",
- pDRIPriv->hFrameBuffer);
-
- /* Add tags for reserved contexts */
- if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
- &reserved_count))) {
- int i;
- void *tag;
-
- for (i = 0; i < reserved_count; i++) {
- tag = DRICreateContextPrivFromHandle(pScreen,
- reserved[i],
- DRI_CONTEXT_RESERVED);
- drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag);
- }
- drmFreeReservedContextList(reserved);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] added %d reserved context%s for kernel\n",
- reserved_count, reserved_count > 1 ? "s" : "");
- }
-
- /* validate max drawable table entry set by driver */
- if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) ||
- (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "Invalid max drawable table size set by driver: %d\n",
- pDRIPriv->pDriverInfo->maxDrawableTableEntry);
- }
-
- /* Initialize drawable tables (screen private and SAREA) */
- for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
- pDRIPriv->DRIDrawables[i] = NULL;
- pDRIPriv->pSAREA->drawableTable[i].stamp = 0;
- pDRIPriv->pSAREA->drawableTable[i].flags = 0;
- }
-
- return TRUE;
-}
-
-Bool
-DRIFinishScreenInit(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
- DRIContextFlags flags = 0;
- DRIContextPrivPtr pDRIContextPriv;
-
- /* Set up flags for DRICreateContextPriv */
- switch (pDRIInfo->driverSwapMethod) {
- case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break;
- case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break;
- }
-
- if (!(pDRIContextPriv = DRICreateContextPriv(pScreen,
- &pDRIPriv->myContext,
- flags))) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "failed to create server context\n");
- return FALSE;
- }
- pDRIPriv->myContextPriv = pDRIContextPriv;
-
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "X context handle = 0x%08lx\n", pDRIPriv->myContext);
-
- /* Now that we have created the X server's context, we can grab the
- * hardware lock for the X server.
- */
- DRILock(pScreen, 0);
- pDRIPriv->grabbedDRILock = TRUE;
-
- /* pointers so that we can prevent memory leaks later */
- pDRIPriv->hiddenContextStore = NULL;
- pDRIPriv->partial3DContextStore = NULL;
-
- switch(pDRIInfo->driverSwapMethod) {
- case DRI_HIDE_X_CONTEXT:
- /* Server will handle 3D swaps, and hide 2D swaps from kernel.
- * Register server context as a preserved context.
- */
-
- /* allocate memory for hidden context store */
- pDRIPriv->hiddenContextStore
- = (void *)xcalloc(1, pDRIInfo->contextSize);
- if (!pDRIPriv->hiddenContextStore) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "failed to allocate hidden context\n");
- DRIDestroyContextPriv(pDRIContextPriv);
- return FALSE;
- }
-
- /* allocate memory for partial 3D context store */
- pDRIPriv->partial3DContextStore
- = (void *)xcalloc(1, pDRIInfo->contextSize);
- if (!pDRIPriv->partial3DContextStore) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[DRI] failed to allocate partial 3D context\n");
- xfree(pDRIPriv->hiddenContextStore);
- DRIDestroyContextPriv(pDRIContextPriv);
- return FALSE;
- }
-
- /* save initial context store */
- if (pDRIInfo->SwapContext) {
- (*pDRIInfo->SwapContext)(
- pScreen,
- DRI_NO_SYNC,
- DRI_2D_CONTEXT,
- pDRIPriv->hiddenContextStore,
- DRI_NO_CONTEXT,
- NULL);
- }
- /* fall through */
-
- case DRI_SERVER_SWAP:
- /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT
- * setup signal handler for receiving swap requests from kernel
- */
- if (!(pDRIPriv->drmSIGIOHandlerInstalled =
- drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[drm] failed to setup DRM signal handler\n");
- if (pDRIPriv->hiddenContextStore)
- xfree(pDRIPriv->hiddenContextStore);
- if (pDRIPriv->partial3DContextStore)
- xfree(pDRIPriv->partial3DContextStore);
- DRIDestroyContextPriv(pDRIContextPriv);
- return FALSE;
- } else {
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] installed DRM signal handler\n");
- }
-
- default:
- break;
- }
-
- /* Wrap DRI support */
- if (pDRIInfo->wrap.ValidateTree) {
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree;
- }
- if (pDRIInfo->wrap.PostValidateTree) {
- pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
- }
- if (pDRIInfo->wrap.WindowExposures) {
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
- }
- if (pDRIInfo->wrap.CopyWindow) {
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
- }
- if (pDRIInfo->wrap.ClipNotify) {
- pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
- pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
- }
- if (pDRIInfo->wrap.AdjustFrame) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
- pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
- }
- pDRIPriv->wrapped = TRUE;
-
- DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n");
-
- return TRUE;
-}
-
-void
-DRICloseScreen(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo;
- drmContextPtr reserved;
- int reserved_count;
-
- if (pDRIPriv && pDRIPriv->directRenderingSupport) {
-
- pDRIInfo = pDRIPriv->pDriverInfo;
-
- if (pDRIPriv->wrapped) {
- /* Unwrap DRI Functions */
- if (pDRIInfo->wrap.ValidateTree) {
- pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
- pDRIPriv->wrap.ValidateTree = NULL;
- }
- if (pDRIInfo->wrap.PostValidateTree) {
- pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
- pDRIPriv->wrap.PostValidateTree = NULL;
- }
- if (pDRIInfo->wrap.WindowExposures) {
- pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
- pDRIPriv->wrap.WindowExposures = NULL;
- }
- if (pDRIInfo->wrap.CopyWindow) {
- pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
- pDRIPriv->wrap.CopyWindow = NULL;
- }
- if (pDRIInfo->wrap.ClipNotify) {
- pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
- pDRIPriv->wrap.ClipNotify = NULL;
- }
- if (pDRIInfo->wrap.AdjustFrame) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
- pDRIPriv->wrap.AdjustFrame = NULL;
- }
- pDRIPriv->wrapped = FALSE;
- }
-
- if (pDRIPriv->drmSIGIOHandlerInstalled) {
- if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[drm] failed to remove DRM signal handler\n");
- }
- }
-
- if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) {
- DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv);
- }
-
- if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "failed to destroy server context\n");
- }
-
- /* Remove tags for reserved contexts */
- if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
- &reserved_count))) {
- int i;
-
- for (i = 0; i < reserved_count; i++) {
- DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD,
- reserved[i]));
- }
- drmFreeReservedContextList(reserved);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] removed %d reserved context%s for kernel\n",
- reserved_count, reserved_count > 1 ? "s" : "");
- }
-
- /* Make sure signals get unblocked etc. */
- drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext);
- lockRefCount=0;
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] unmapping %d bytes of SAREA 0x%08lx at %p\n",
- pDRIInfo->SAREASize,
- pDRIPriv->hSAREA,
- pDRIPriv->pSAREA);
- if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[drm] unable to unmap %d bytes"
- " of SAREA 0x%08lx at %p\n",
- pDRIInfo->SAREASize,
- pDRIPriv->hSAREA,
- pDRIPriv->pSAREA);
- }
-
- drmClose(pDRIPriv->drmFD);
-
- xfree(pDRIPriv);
- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
- }
-}
-
-Bool
-DRIExtensionInit(void)
-{
- int i;
- ScreenPtr pScreen;
-
- if (DRIScreenPrivIndex < 0) {
- return FALSE;
- }
-
- /* Allocate a window private index with a zero sized private area for
- * each window, then should a window become a DRI window, we'll hang
- * a DRIWindowPrivateRec off of this private index.
- */
- if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
- return FALSE;
-
- DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
- DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete);
- DRIFullScreenResType = CreateNewResourceType(_DRICloseFullScreen);
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0))
- return FALSE;
- }
-
- RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
-
- return TRUE;
-}
-
-void
-DRIReset(void)
-{
- /*
- * This stub routine is called when the X Server recycles, resources
- * allocated by DRIExtensionInit need to be managed here.
- *
- * Currently this routine is a stub because all the interesting resources
- * are managed via the screen init process.
- */
-}
-
-Bool
-DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv)
- *isCapable = pDRIPriv->directRenderingSupport;
- else
- *isCapable = FALSE;
-
- return TRUE;
-}
-
-Bool
-DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- *hSAREA = pDRIPriv->hSAREA;
- *busIdString = pDRIPriv->pDriverInfo->busIdString;
-
- return TRUE;
-}
-
-Bool
-DRIAuthConnection(ScreenPtr pScreen, drmMagic magic)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
- return TRUE;
-}
-
-Bool
-DRICloseConnection(ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-Bool
-DRIGetClientDriverName(ScreenPtr pScreen,
- int *ddxDriverMajorVersion,
- int *ddxDriverMinorVersion,
- int *ddxDriverPatchVersion,
- char **clientDriverName)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion;
- *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion;
- *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion;
- *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName;
-
- return TRUE;
-}
-
-/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper
- functions that layer on drmCreateContext and drmAddContextTag.
-
- DRICreateContextPriv always creates a kernel drmContext and then calls
- DRICreateContextPrivFromHandle to create a DRIContextPriv structure for
- DRI tracking. For the SIGIO handler, the drmContext is associated with
- DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv
- area and are passed to the kernel (if necessary).
-
- DRICreateContextPriv returns a pointer to newly allocated
- DRIContextPriv, and returns the kernel drmContext in pHWContext. */
-
-DRIContextPrivPtr
-DRICreateContextPriv(ScreenPtr pScreen,
- drmContextPtr pHWContext,
- DRIContextFlags flags)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) {
- return NULL;
- }
-
- return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags);
-}
-
-DRIContextPrivPtr
-DRICreateContextPrivFromHandle(ScreenPtr pScreen,
- drmContext hHWContext,
- DRIContextFlags flags)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIContextPrivPtr pDRIContextPriv;
- int contextPrivSize;
-
- contextPrivSize = sizeof(DRIContextPrivRec) +
- pDRIPriv->pDriverInfo->contextSize;
- if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) {
- return NULL;
- }
- pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1);
-
- drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv);
-
- pDRIContextPriv->hwContext = hHWContext;
- pDRIContextPriv->pScreen = pScreen;
- pDRIContextPriv->flags = flags;
- pDRIContextPriv->valid3D = FALSE;
-
- if (flags & DRI_CONTEXT_2DONLY) {
- if (drmSetContextFlags(pDRIPriv->drmFD,
- hHWContext,
- DRM_CONTEXT_2DONLY)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[drm] failed to set 2D context flag\n");
- DRIDestroyContextPriv(pDRIContextPriv);
- return NULL;
- }
- }
- if (flags & DRI_CONTEXT_PRESERVED) {
- if (drmSetContextFlags(pDRIPriv->drmFD,
- hHWContext,
- DRM_CONTEXT_PRESERVED)) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[drm] failed to set preserved flag\n");
- DRIDestroyContextPriv(pDRIContextPriv);
- return NULL;
- }
- }
- return pDRIContextPriv;
-}
-
-Bool
-DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv)
-{
- DRIScreenPrivPtr pDRIPriv;
-
- if (!pDRIContextPriv) return TRUE;
-
- pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
-
- if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) {
- /* Don't delete reserved contexts from
- kernel area -- the kernel manages its
- reserved contexts itself. */
- if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext))
- return FALSE;
- }
-
- /* Remove the tag last to prevent a race
- condition where the context has pending
- buffers. The context can't be re-used
- while in this thread, but buffers can be
- dispatched asynchronously. */
- drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext);
- xfree(pDRIContextPriv);
- return TRUE;
-}
-
-static Bool
-DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
- __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
- void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
- DRIContextPrivPtr pDRIContextPriv;
- void *contextStore;
- VisualPtr visual;
- int visNum;
-
- visual = pScreen->visuals;
-
- /* Find the X visual that corresponds the the first GLX visual */
- for (visNum = 0;
- visNum < pScreen->numVisuals;
- visNum++, visual++) {
- if (pGLXVis->vid == visual->vid)
- break;
- }
- if (visNum == pScreen->numVisuals) return FALSE;
-
- if (!(pDRIContextPriv =
- DRICreateContextPriv(pScreen,
- &pDRIPriv->pSAREA->dummy_context, 0))) {
- return FALSE;
- }
-
- contextStore = DRIGetContextStore(pDRIContextPriv);
- if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) {
- if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual,
- pDRIPriv->pSAREA->dummy_context,
- *pVisualConfigPriv,
- (DRIContextType)(long)contextStore)) {
- DRIDestroyContextPriv(pDRIContextPriv);
- return FALSE;
- }
- }
-
- pDRIPriv->dummyCtxPriv = pDRIContextPriv;
- return TRUE;
-}
-
-static void
-DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv;
- void *contextStore;
-
- if (!pDRIContextPriv) return;
- if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) {
- contextStore = DRIGetContextStore(pDRIContextPriv);
- pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
- pDRIContextPriv->hwContext,
- (DRIContextType)(long)contextStore);
- }
-
- DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv);
- pDRIPriv->dummyCtxPriv = NULL;
-}
-
-Bool
-DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
- XID context, drmContextPtr pHWContext)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
- __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
- void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
- DRIContextPrivPtr pDRIContextPriv;
- void *contextStore;
- int visNum;
-
- if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) {
- if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) {
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] Could not create dummy context\n");
- return FALSE;
- }
- }
-
- /* Find the GLX visual associated with the one requested */
- for (visNum = 0;
- visNum < pGLXScreen->numVisuals;
- visNum++, pGLXVis++, pVisualConfigPriv++)
- if (pGLXVis->vid == visual->vid)
- break;
- if (visNum == pGLXScreen->numVisuals) {
- /* No matching GLX visual found */
- return FALSE;
- }
-
- if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) {
- return FALSE;
- }
-
- contextStore = DRIGetContextStore(pDRIContextPriv);
- if (pDRIPriv->pDriverInfo->CreateContext) {
- if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual,
- *pHWContext, *pVisualConfigPriv,
- (DRIContextType)(long)contextStore))) {
- DRIDestroyContextPriv(pDRIContextPriv);
- return FALSE;
- }
- }
-
- /* track this in case the client dies before cleanup */
- AddResource(context, DRIContextPrivResType, (pointer)pDRIContextPriv);
-
- return TRUE;
-}
-
-Bool
-DRIDestroyContext(ScreenPtr pScreen, XID context)
-{
- FreeResourceByType(context, DRIContextPrivResType, FALSE);
-
- return TRUE;
-}
-
-/* DRIContextPrivDelete is called by the resource manager. */
-Bool
-DRIContextPrivDelete(pointer pResource, XID id)
-{
- DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr)pResource;
- DRIScreenPrivPtr pDRIPriv;
- void *contextStore;
-
- pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
- if (pDRIPriv->pDriverInfo->DestroyContext) {
- contextStore = DRIGetContextStore(pDRIContextPriv);
- pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
- pDRIContextPriv->hwContext,
- (DRIContextType)(long)contextStore);
- }
- return DRIDestroyContextPriv(pDRIContextPriv);
-}
-
-
-/* This walks the drawable timestamp array and invalidates all of them
- * in the case of transition from private to shared backbuffers. It's
- * not necessary for correctness, because DRIClipNotify gets called in
- * time to prevent any conflict, but the transition from
- * shared->private is sometimes missed if we don't do this.
- */
-static void
-DRIClipNotifyAllDrawables(ScreenPtr pScreen)
-{
- int i;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
- pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++;
- }
-}
-
-
-static void
-DRITransitionToSharedBuffers(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
-
- DRIClipNotifyAllDrawables( pScreen );
-
- if (pDRIInfo->TransitionSingleToMulti3D)
- pDRIInfo->TransitionSingleToMulti3D( pScreen );
-}
-
-
-static void
-DRITransitionToPrivateBuffers(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
-
- DRIClipNotifyAllDrawables( pScreen );
-
- if (pDRIInfo->TransitionMultiToSingle3D)
- pDRIInfo->TransitionMultiToSingle3D( pScreen );
-}
-
-
-static void
-DRITransitionTo3d(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
-
- DRIClipNotifyAllDrawables( pScreen );
-
- if (pDRIInfo->TransitionTo3d)
- pDRIInfo->TransitionTo3d( pScreen );
-}
-
-static void
-DRITransitionTo2d(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
-
- DRIClipNotifyAllDrawables( pScreen );
-
- if (pDRIInfo->TransitionTo2d)
- pDRIInfo->TransitionTo2d( pScreen );
-}
-
-
-Bool
-DRICreateDrawable(ScreenPtr pScreen, Drawable id,
- DrawablePtr pDrawable, drmDrawablePtr hHWDrawable)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
- pDRIDrawablePriv->refCount++;
- }
- else {
- /* allocate a DRI Window Private record */
- if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
- return FALSE;
- }
-
- /* Only create a drmDrawable once */
- if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
- xfree(pDRIDrawablePriv);
- return FALSE;
- }
-
- /* add it to the list of DRI drawables for this screen */
- pDRIDrawablePriv->hwDrawable = *hHWDrawable;
- pDRIDrawablePriv->pScreen = pScreen;
- pDRIDrawablePriv->refCount = 1;
- pDRIDrawablePriv->drawableIndex = -1;
-
- /* save private off of preallocated index */
- pWin->devPrivates[DRIWindowPrivIndex].ptr =
- (pointer)pDRIDrawablePriv;
-
- switch (++pDRIPriv->nrWindows) {
- case 1:
- DRITransitionTo3d( pScreen );
- break;
- case 2:
- DRITransitionToSharedBuffers( pScreen );
- break;
- default:
- break;
- }
-
- /* track this in case this window is destroyed */
- AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable)
-{
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
- pDRIDrawablePriv->refCount--;
- if (pDRIDrawablePriv->refCount <= 0) {
- /* This calls back DRIDrawablePrivDelete which frees private area */
- FreeResourceByType(id, DRIDrawablePrivResType, FALSE);
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIDrawablePrivDelete(pointer pResource, XID id)
-{
- DrawablePtr pDrawable = (DrawablePtr)pResource;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
- WindowPtr pWin;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
-
- if (pDRIDrawablePriv->drawableIndex != -1) {
- /* bump stamp to force outstanding 3D requests to resync */
- pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
- = DRIDrawableValidationStamp++;
-
- /* release drawable table entry */
- pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
- }
-
- if (drmDestroyDrawable(pDRIPriv->drmFD,
- pDRIDrawablePriv->hwDrawable)) {
- return FALSE;
- }
- xfree(pDRIDrawablePriv);
- pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL;
-
- switch (--pDRIPriv->nrWindows) {
- case 0:
- DRITransitionTo2d( pDrawable->pScreen );
- break;
- case 1:
- DRITransitionToPrivateBuffers( pDrawable->pScreen );
- break;
- default:
- break;
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIGetDrawableInfo(ScreenPtr pScreen,
- DrawablePtr pDrawable,
- unsigned int* index,
- unsigned int* stamp,
- int* X,
- int* Y,
- int* W,
- int* H,
- int* numClipRects,
- XF86DRIClipRectPtr* pClipRects,
- int* backX,
- int* backY,
- int* numBackClipRects,
- XF86DRIClipRectPtr* pBackClipRects)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv;
- WindowPtr pWin, pOldWin;
- int i;
-
- printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry);
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- pWin = (WindowPtr)pDrawable;
- if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
-
- /* Manage drawable table */
- if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */
-
- /* Search table for empty entry */
- i = 0;
- while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
- if (!(pDRIPriv->DRIDrawables[i])) {
- pDRIPriv->DRIDrawables[i] = pDrawable;
- pDRIDrawablePriv->drawableIndex = i;
- pDRIPriv->pSAREA->drawableTable[i].stamp =
- DRIDrawableValidationStamp++;
- break;
- }
- i++;
- }
-
- /* Search table for oldest entry */
- if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
- unsigned int oldestStamp = ~0;
- int oldestIndex = 0;
- i = pDRIPriv->pDriverInfo->maxDrawableTableEntry;
- while (i--) {
- if (pDRIPriv->pSAREA->drawableTable[i].stamp <
- oldestStamp) {
- oldestIndex = i;
- oldestStamp =
- pDRIPriv->pSAREA->drawableTable[i].stamp;
- }
- }
- pDRIDrawablePriv->drawableIndex = oldestIndex;
-
- /* release oldest drawable table entry */
- pOldWin = (WindowPtr)pDRIPriv->DRIDrawables[oldestIndex];
- pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin);
- pOldDrawPriv->drawableIndex = -1;
-
- /* claim drawable table entry */
- pDRIPriv->DRIDrawables[oldestIndex] = pDrawable;
-
- /* validate SAREA entry */
- pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp =
- DRIDrawableValidationStamp++;
-
- /* check for stamp wrap around */
- if (oldestStamp > DRIDrawableValidationStamp) {
-
- /* walk SAREA table and invalidate all drawables */
- for( i=0;
- i < pDRIPriv->pDriverInfo->maxDrawableTableEntry;
- i++) {
- pDRIPriv->pSAREA->drawableTable[i].stamp =
- DRIDrawableValidationStamp++;
- }
- }
- }
-
- /* If the driver wants to be notified when the index is
- * set for a drawable, let it know now.
- */
- if (pDRIPriv->pDriverInfo->SetDrawableIndex)
- pDRIPriv->pDriverInfo->SetDrawableIndex(pWin,
- pDRIDrawablePriv->drawableIndex);
-
- /* reinit drawable ID if window is visible */
- if ((pWin->viewable) &&
- (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS))
- {
- (*pDRIPriv->pDriverInfo->InitBuffers)(pWin,
- &pWin->clipList, pDRIDrawablePriv->drawableIndex);
- }
- }
-
- *index = pDRIDrawablePriv->drawableIndex;
- *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp;
- *X = (int)(pWin->drawable.x);
- *Y = (int)(pWin->drawable.y);
-#if 0
- *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1);
- *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
-#endif
- *W = (int)(pWin->drawable.width);
- *H = (int)(pWin->drawable.height);
- *numClipRects = REGION_NUM_RECTS(&pWin->clipList);
- *pClipRects = (XF86DRIClipRectPtr)REGION_RECTS(&pWin->clipList);
-
- if (!*numClipRects && pDRIPriv->fullscreen) {
- /* use fake full-screen clip rect */
- pDRIPriv->fullscreen_rect.x1 = *X;
- pDRIPriv->fullscreen_rect.y1 = *Y;
- pDRIPriv->fullscreen_rect.x2 = *X + *W;
- pDRIPriv->fullscreen_rect.y2 = *Y + *H;
-
- *numClipRects = 1;
- *pClipRects = &pDRIPriv->fullscreen_rect;
- }
-
- *backX = *X;
- *backY = *Y;
-
- if (pDRIPriv->nrWindows == 1 && *numClipRects) {
- /* Use a single cliprect. */
-
- int x0 = *X;
- int y0 = *Y;
- int x1 = x0 + *W;
- int y1 = y0 + *H;
-
- if (x0 < 0) x0 = 0;
- if (y0 < 0) y0 = 0;
- if (x1 > pScreen->width-1) x1 = pScreen->width-1;
- if (y1 > pScreen->height-1) y1 = pScreen->height-1;
-
- pDRIPriv->private_buffer_rect.x1 = x0;
- pDRIPriv->private_buffer_rect.y1 = y0;
- pDRIPriv->private_buffer_rect.x2 = x1;
- pDRIPriv->private_buffer_rect.y2 = y1;
-
- *numBackClipRects = 1;
- *pBackClipRects = &(pDRIPriv->private_buffer_rect);
- } else {
- /* Use the frontbuffer cliprects for back buffers. */
- *numBackClipRects = 0;
- *pBackClipRects = 0;
- }
- }
- else {
- /* Not a DRIDrawable */
- return FALSE;
- }
- }
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
- /* NOT_DONE */
- return FALSE;
- }
-
- return TRUE;
-}
-
-Bool
-DRIGetDeviceInfo(ScreenPtr pScreen,
- drmHandlePtr hFrameBuffer,
- int* fbOrigin,
- int* fbSize,
- int* fbStride,
- int* devPrivateSize,
- void** pDevPrivate)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- *hFrameBuffer = pDRIPriv->hFrameBuffer;
- *fbOrigin = 0;
- *fbSize = pDRIPriv->pDriverInfo->frameBufferSize;
- *fbStride = pDRIPriv->pDriverInfo->frameBufferStride;
- *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize;
- *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate;
-
- return TRUE;
-}
-
-DRIInfoPtr
-DRICreateInfoRec(void)
-{
- DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec));
- if (!inforec) return NULL;
-
- /* Initialize defaults */
- inforec->busIdString = NULL;
-
- /* Wrapped function defaults */
- inforec->wrap.WakeupHandler = DRIDoWakeupHandler;
- inforec->wrap.BlockHandler = DRIDoBlockHandler;
- inforec->wrap.WindowExposures = DRIWindowExposures;
- inforec->wrap.CopyWindow = DRICopyWindow;
- inforec->wrap.ValidateTree = DRIValidateTree;
- inforec->wrap.PostValidateTree = DRIPostValidateTree;
- inforec->wrap.ClipNotify = DRIClipNotify;
- inforec->wrap.AdjustFrame = DRIAdjustFrame;
-
- inforec->TransitionTo2d = 0;
- inforec->TransitionTo3d = 0;
- inforec->SetDrawableIndex = 0;
-
- return inforec;
-}
-
-void
-DRIDestroyInfoRec(DRIInfoPtr DRIInfo)
-{
- if (DRIInfo->busIdString) xfree(DRIInfo->busIdString);
- xfree((char*)DRIInfo);
-}
-
-
-void
-DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask)
-{
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv &&
- pDRIPriv->pDriverInfo->wrap.WakeupHandler)
- (*pDRIPriv->pDriverInfo->wrap.WakeupHandler)(i, wakeupData,
- result, pReadmask);
- }
-}
-
-void
-DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
-{
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv &&
- pDRIPriv->pDriverInfo->wrap.BlockHandler)
- (*pDRIPriv->pDriverInfo->wrap.BlockHandler)(i, blockData,
- pTimeout, pReadmask);
- }
-}
-
-void
-DRIDoWakeupHandler(int screenNum, pointer wakeupData,
- unsigned long result, pointer pReadmask)
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- DRILock(pScreen, 0);
- if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
- /* hide X context by swapping 2D component here */
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- DRI_3D_SYNC,
- DRI_2D_CONTEXT,
- pDRIPriv->partial3DContextStore,
- DRI_2D_CONTEXT,
- pDRIPriv->hiddenContextStore);
- }
-}
-
-void
-DRIDoBlockHandler(int screenNum, pointer blockData,
- pointer pTimeout, pointer pReadmask)
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
- /* hide X context by swapping 2D component here */
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- DRI_2D_SYNC,
- DRI_NO_CONTEXT,
- NULL,
- DRI_2D_CONTEXT,
- pDRIPriv->partial3DContextStore);
- }
- DRIUnlock(pScreen);
-}
-
-void
-DRISwapContext(int drmFD, void *oldctx, void *newctx)
-{
- DRIContextPrivPtr oldContext = (DRIContextPrivPtr)oldctx;
- DRIContextPrivPtr newContext = (DRIContextPrivPtr)newctx;
- ScreenPtr pScreen = newContext->pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- void* oldContextStore = NULL;
- DRIContextType oldContextType;
- void* newContextStore = NULL;
- DRIContextType newContextType;
- DRISyncType syncType;
-#ifdef DEBUG
- static int count = 0;
-#endif
-
- if (!newContext) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n",
- oldContext, newContext);
- return;
- }
-
-#ifdef DEBUG
- /* usefull for debugging, just print out after n context switches */
- if (!count || !(count % 1)) {
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[DRI] Context switch %5d from %p/0x%08x (%d)\n",
- count,
- oldContext,
- oldContext ? oldContext->flags : 0,
- oldContext ? oldContext->hwContext : -1);
- DRIDrvMsg(pScreen->myNum, X_INFO,
- "[DRI] Context switch %5d to %p/0x%08x (%d)\n",
- count,
- newContext,
- newContext ? newContext->flags : 0,
- newContext ? newContext->hwContext : -1);
- }
- ++count;
-#endif
-
- if (!pDRIPriv->pDriverInfo->SwapContext) {
- DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[DRI] DDX driver missing context swap call back\n");
- return;
- }
-
- if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
-
- /* only 3D contexts are swapped in this case */
- if (oldContext) {
- oldContextStore = DRIGetContextStore(oldContext);
- oldContext->valid3D = TRUE;
- oldContextType = DRI_3D_CONTEXT;
- } else {
- oldContextType = DRI_NO_CONTEXT;
- }
- newContextStore = DRIGetContextStore(newContext);
- if ((newContext->valid3D) &&
- (newContext->hwContext != pDRIPriv->myContext)) {
- newContextType = DRI_3D_CONTEXT;
- }
- else {
- newContextType = DRI_2D_CONTEXT;
- }
- syncType = DRI_3D_SYNC;
- }
- else /* default: driverSwapMethod == DRI_SERVER_SWAP */ {
-
- /* optimize 2D context swaps */
-
- if (newContext->flags & DRI_CONTEXT_2DONLY) {
- /* go from 3D context to 2D context and only save 2D
- * subset of 3D state
- */
- oldContextStore = DRIGetContextStore(oldContext);
- oldContextType = DRI_2D_CONTEXT;
- newContextStore = DRIGetContextStore(newContext);
- newContextType = DRI_2D_CONTEXT;
- syncType = DRI_3D_SYNC;
- pDRIPriv->lastPartial3DContext = oldContext;
- }
- else if (oldContext->flags & DRI_CONTEXT_2DONLY) {
- if (pDRIPriv->lastPartial3DContext == newContext) {
- /* go from 2D context back to previous 3D context and
- * only restore 2D subset of previous 3D state
- */
- oldContextStore = DRIGetContextStore(oldContext);
- oldContextType = DRI_2D_CONTEXT;
- newContextStore = DRIGetContextStore(newContext);
- newContextType = DRI_2D_CONTEXT;
- syncType = DRI_2D_SYNC;
- }
- else {
- /* go from 2D context to a different 3D context */
-
- /* call DDX driver to do partial restore */
- oldContextStore = DRIGetContextStore(oldContext);
- newContextStore =
- DRIGetContextStore(pDRIPriv->lastPartial3DContext);
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- DRI_2D_SYNC,
- DRI_2D_CONTEXT,
- oldContextStore,
- DRI_2D_CONTEXT,
- newContextStore);
-
- /* now setup for a complete 3D swap */
- oldContextStore = newContextStore;
- oldContext->valid3D = TRUE;
- oldContextType = DRI_3D_CONTEXT;
- newContextStore = DRIGetContextStore(newContext);
- if ((newContext->valid3D) &&
- (newContext->hwContext != pDRIPriv->myContext)) {
- newContextType = DRI_3D_CONTEXT;
- }
- else {
- newContextType = DRI_2D_CONTEXT;
- }
- syncType = DRI_NO_SYNC;
- }
- }
- else {
- /* now setup for a complete 3D swap */
- oldContextStore = newContextStore;
- oldContext->valid3D = TRUE;
- oldContextType = DRI_3D_CONTEXT;
- newContextStore = DRIGetContextStore(newContext);
- if ((newContext->valid3D) &&
- (newContext->hwContext != pDRIPriv->myContext)) {
- newContextType = DRI_3D_CONTEXT;
- }
- else {
- newContextType = DRI_2D_CONTEXT;
- }
- syncType = DRI_3D_SYNC;
- }
- }
-
- /* call DDX driver to perform the swap */
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- syncType,
- oldContextType,
- oldContextStore,
- newContextType,
- newContextStore);
-}
-
-void*
-DRIGetContextStore(DRIContextPrivPtr context)
-{
- return((void *)context->pContextStore);
-}
-
-void
-DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
-
- if(pDRIDrawablePriv) {
- (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn,
- pDRIDrawablePriv->drawableIndex);
- }
-
- /* call lower wrapped functions */
- if (pDRIPriv && pDRIPriv->wrap.WindowExposures) {
-
- /* unwrap */
- pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
-
- /* call lower layers */
- (*pScreen->WindowExposures)(pWin, prgn, bsreg);
-
- /* rewrap */
- pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = DRIWindowExposures;
- }
-}
-
-
-static int
-DRITreeTraversal(WindowPtr pWin, pointer data)
-{
- DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
-
- if(pDRIDrawablePriv) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- RegionPtr reg = (RegionPtr)data;
-
- REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
-
- if(pDRIPriv->nrWindows == 1)
- return WT_STOPWALKING;
- }
- return WT_WALKCHILDREN;
-}
-
-void
-DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if(!pDRIPriv) return;
-
- if(pDRIPriv->nrWindows > 0) {
- RegionRec reg;
-
- REGION_NULL(pScreen, &reg);
- TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
-
- if(REGION_NOTEMPTY(pScreen, &reg)) {
- REGION_TRANSLATE(pScreen, &reg, ptOldOrg.x - pWin->drawable.x,
- ptOldOrg.y - pWin->drawable.y);
- REGION_INTERSECT(pScreen, &reg, &reg, prgnSrc);
-
- /* The MoveBuffers interface is not ideal */
- (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, &reg,
- pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
- }
-
- REGION_UNINIT(pScreen, &reg);
- }
-
- /* call lower wrapped functions */
- if(pDRIPriv->wrap.CopyWindow) {
- /* unwrap */
- pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
-
- /* call lower layers */
- (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
-
- /* rewrap */
- pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = DRICopyWindow;
- }
-}
-
-static void
-DRIGetSecs(long *secs, long *usecs)
-{
-#ifdef XFree86LOADER
- getsecs(secs,usecs);
-#else
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
-
- *secs = tv.tv_sec;
- *usecs = tv.tv_usec;
-#endif
-}
-
-static unsigned long
-DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs,
- unsigned long f_secs, unsigned long f_usecs)
-{
- if (f_usecs < s_usecs) {
- --f_secs;
- f_usecs += 1000000;
- }
- return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000;
-}
-
-static void
-DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */)
-{
- int count = 10000;
-#if !defined(__alpha__) && !defined(__powerpc__)
- char ret;
-#else
- int ret;
-#endif
- long s_secs, s_usecs;
- long f_secs, f_usecs;
- long msecs;
- long prev = 0;
-
- DRIGetSecs(&s_secs, &s_usecs);
-
- do {
- DRM_SPINLOCK_COUNT(lock, val, count, ret);
- if (!ret) return; /* Got lock */
- DRIGetSecs(&f_secs, &f_usecs);
- msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs);
- if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */
- } while (msecs < timeout);
-
- /* Didn't get lock, so take it. The worst
- that can happen is that there is some
- garbage written to the wrong part of the
- framebuffer that a refresh will repair.
- That's undesirable, but better than
- locking the server. This should be a
- very rare event. */
- DRM_SPINLOCK_TAKE(lock, val);
-}
-
-static void
-DRILockTree(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- if(!pDRIPriv) return;
-
- /* Restore the last known 3D context if the X context is hidden */
- if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- DRI_2D_SYNC,
- DRI_NO_CONTEXT,
- NULL,
- DRI_2D_CONTEXT,
- pDRIPriv->partial3DContextStore);
- }
-
- /* Call kernel to release lock */
- DRIUnlock(pScreen);
-
- /* Grab drawable spin lock: a time out between 10 and 30 seconds is
- appropriate, since this should never time out except in the case of
- client death while the lock is being held. The timeout must be
- greater than any reasonable rendering time. */
- DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/
-
- /* Call kernel flush outstanding buffers and relock */
- DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
-
- /* Switch back to our 2D context if the X context is hidden */
- if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
- /* hide X context by swapping 2D component here */
- (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
- DRI_3D_SYNC,
- DRI_2D_CONTEXT,
- pDRIPriv->partial3DContextStore,
- DRI_2D_CONTEXT,
- pDRIPriv->hiddenContextStore);
- }
-}
-
-/* It appears that somebody is relying on the lock being set even
- if we aren't touching 3D windows */
-
-#define DRI_BROKEN
-
-static Bool DRIWindowsTouched = FALSE;
-
-int
-DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- ScreenPtr pScreen = pParent->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- int returnValue = 1; /* always return 1, not checked by dix/window.c */
-
- if(!pDRIPriv) return returnValue;
-
- DRIWindowsTouched = FALSE;
-
-#ifdef DRI_BROKEN
- if(!DRIWindowsTouched) {
- DRILockTree(pScreen);
- DRIWindowsTouched = TRUE;
- }
-#endif
-
- /* call lower wrapped functions */
- if(pDRIPriv->wrap.ValidateTree) {
- /* unwrap */
- pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
-
- /* call lower layers */
- returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
-
- /* rewrap */
- pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
- pScreen->ValidateTree = DRIValidateTree;
- }
-
- return returnValue;
-}
-
-void
-DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- ScreenPtr pScreen;
- DRIScreenPrivPtr pDRIPriv;
-
- if (pParent) {
- pScreen = pParent->drawable.pScreen;
- } else {
- pScreen = pChild->drawable.pScreen;
- }
- if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return;
-
- if (pDRIPriv->wrap.PostValidateTree) {
- /* unwrap */
- pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
-
- /* call lower layers */
- (*pScreen->PostValidateTree)(pParent, pChild, kind);
-
- /* rewrap */
- pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
- pScreen->PostValidateTree = DRIPostValidateTree;
- }
-
- if (DRIWindowsTouched) {
- /* Release spin lock */
- DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1);
- DRIWindowsTouched = FALSE;
- }
-}
-
-void
-DRIClipNotify(WindowPtr pWin, int dx, int dy)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv;
-
- if(!pDRIPriv) return;
-
- if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
-
-#ifndef DRI_BROKEN
- if(!DRIWindowsTouched) {
- DRILockTree(pScreen);
- DRIWindowsTouched = TRUE;
- }
-#endif
-
- pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
- = DRIDrawableValidationStamp++;
- }
-
- /* call lower wrapped functions */
- if(pDRIPriv->wrap.ClipNotify) {
-
- /* unwrap */
- pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
-
- /* call lower layers */
- (*pScreen->ClipNotify)(pWin, dx, dy);
-
- /* rewrap */
- pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
- pScreen->ClipNotify = DRIClipNotify;
- }
-}
-
-CARD32
-DRIGetDrawableIndex(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
- CARD32 index;
-
- if (pDRIDrawablePriv) {
- index = pDRIDrawablePriv->drawableIndex;
- }
- else {
- index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry;
- }
-
- return index;
-}
-
-unsigned int
-DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp;
-}
-
-
-void
-DRIPrintDrawableLock(ScreenPtr pScreen, char *msg)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
-
- ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock);
-}
-
-void
-DRILock(ScreenPtr pScreen, int flags)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if(!pDRIPriv) return;
-
- if (!lockRefCount)
- DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
- lockRefCount++;
-}
-
-void
-DRIUnlock(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if(!pDRIPriv) return;
-
- if (lockRefCount > 0) {
- lockRefCount--;
- }
- else {
- ErrorF("DRIUnlock called when not locked\n");
- return;
- }
- if (!lockRefCount)
- DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
-}
-
-void *
-DRIGetSAREAPrivate(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if (!pDRIPriv) return 0;
-
- return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
-}
-
-drmContext
-DRIGetContext(ScreenPtr pScreen)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- if (!pDRIPriv) return 0;
-
- return pDRIPriv->myContext;
-}
-
-/* This lets get at the unwrapped functions so that they can correctly
- * call the lowerlevel functions, and choose whether they will be
- * called at every level of recursion (eg in validatetree).
- */
-DRIWrappedFuncsRec *
-DRIGetWrappedFuncs(ScreenPtr pScreen)
-{
- return &(DRI_SCREEN_PRIV(pScreen)->wrap);
-}
-
-void
-DRIQueryVersion(int *majorVersion,
- int *minorVersion,
- int *patchVersion)
-{
- *majorVersion = XF86DRI_MAJOR_VERSION;
- *minorVersion = XF86DRI_MINOR_VERSION;
- *patchVersion = XF86DRI_PATCH_VERSION;
-}
-
-static void
-_DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y)
-{
- pDRIPriv->pSAREA->frame.x = x;
- pDRIPriv->pSAREA->frame.y = y;
- pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1;
- pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1;
-}
-
-void
-DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[scrnIndex];
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- int px, py;
-
- if (!pDRIPriv || !pDRIPriv->pSAREA) {
- DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n",
- pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL);
- return;
- }
-
- if (pDRIPriv->fullscreen) {
- /* Fix up frame */
- pScrn->frameX0 = pDRIPriv->pSAREA->frame.x;
- pScrn->frameY0 = pDRIPriv->pSAREA->frame.y;
- pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1;
- pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1;
-
- /* Fix up cursor */
- miPointerPosition(&px, &py);
- if (px < pScrn->frameX0) px = pScrn->frameX0;
- if (px > pScrn->frameX1) px = pScrn->frameX1;
- if (py < pScrn->frameY0) py = pScrn->frameY0;
- if (py > pScrn->frameY1) py = pScrn->frameY1;
- pScreen->SetCursorPosition(pScreen, px, py, TRUE);
- return;
- }
-
- if (pDRIPriv->wrap.AdjustFrame) {
- /* unwrap */
- pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
- /* call lower layers */
- (*pScrn->AdjustFrame)(scrnIndex, x, y, flags);
- /* rewrap */
- pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
- pScrn->AdjustFrame = DRIAdjustFrame;
- }
-
- _DRIAdjustFrame(pScrn, pDRIPriv, x, y);
-}
-
-/* WARNING WARNING WARNING: Just like every other function call in this
- file, the DRIOpenFullScreen and DRICloseFullScreen calls are for
- internal use only! They should be used only by GLX internals and
- should NEVER be called from a GL application.
-
- Some time in the future, there will be a (proposed) standard GLX
- extension that performs expanded functionality, that is designed for
- used by application-level programs, and that should be portable
- across multiple GLX implementations. */
-Bool
-DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
-{
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- WindowPtr pWin = (WindowPtr)pDrawable;
- XF86DRIClipRectPtr pClipRects = (void *)REGION_RECTS(&pWin->clipList);
-
- _DRIAdjustFrame(pScrn, pDRIPriv, pScrn->frameX0, pScrn->frameY0);
-
- if (pDrawable->type != DRAWABLE_WINDOW) return FALSE;
-
- if (!pScrn->vtSema) return FALSE; /* switched away */
-
- if (pDrawable->x != pScrn->frameX0
- || pDrawable->y != pScrn->frameY0
- || pDrawable->width != pScrn->frameX1 - pScrn->frameX0 + 1
- || pDrawable->height != pScrn->frameY1 - pScrn->frameY0 + 1) {
- return FALSE;
- }
-
- if (REGION_NUM_RECTS(&pWin->clipList) != 1) return FALSE;
- if (pDrawable->x != pClipRects[0].x1
- || pDrawable->y != pClipRects[0].y1
- || pDrawable->width != pClipRects[0].x2 - pClipRects[0].x1
- || pDrawable->height != pClipRects[0].y2 - pClipRects[0].y1) {
- return FALSE;
- }
-
- AddResource(pDrawable->id, DRIFullScreenResType, (pointer)pWin);
-
- xf86EnableVTSwitch(FALSE);
- pScrn->EnableDisableFBAccess(pScreen->myNum, FALSE);
- pScrn->vtSema = FALSE;
- pDRIPriv->fullscreen = pDrawable;
- DRIClipNotify(pWin, 0, 0);
-
- if (pDRIPriv->pDriverInfo->OpenFullScreen)
- pDRIPriv->pDriverInfo->OpenFullScreen(pScreen);
-
- pDRIPriv->pSAREA->frame.fullscreen = 1;
- return TRUE;
-}
-
-static Bool
-_DRICloseFullScreen(pointer pResource, XID id)
-{
- DrawablePtr pDrawable = (DrawablePtr)pResource;
- ScreenPtr pScreen = pDrawable->pScreen;
- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- WindowPtr pWin = (WindowPtr)pDrawable;
- WindowOptPtr optional = pWin->optional;
- Mask mask = pWin->eventMask;
-
- if (pDRIPriv->pDriverInfo->CloseFullScreen)
- pDRIPriv->pDriverInfo->CloseFullScreen(pScreen);
-
- pDRIPriv->fullscreen = NULL;
- pScrn->vtSema = TRUE;
-
- /* Turn off expose events for the top window */
- pWin->eventMask &= ~ExposureMask;
- pWin->optional = NULL;
- pScrn->EnableDisableFBAccess(pScreen->myNum, TRUE);
- pWin->eventMask = mask;
- pWin->optional = optional;
-
- xf86EnableVTSwitch(TRUE);
- pDRIPriv->pSAREA->frame.fullscreen = 0;
- return TRUE;
-}
-
-Bool
-DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
-{
- FreeResourceByType(pDrawable->id, DRIFullScreenResType, FALSE);
- return TRUE;
-}
-
-
-/*
- * DRIMoveBuffersHelper swaps the regions rects in place leaving you
- * a region with the rects in the order that you need to blit them,
- * but it is possibly (likely) an invalid region afterwards. If you
- * need to use the region again for anything you have to call
- * REGION_VALIDATE on it, or better yet, save a copy first.
- */
-
-void
-DRIMoveBuffersHelper(
- ScreenPtr pScreen,
- int dx,
- int dy,
- int *xdir,
- int *ydir,
- RegionPtr reg
-)
-{
- BoxPtr extents, pbox, firstBox, lastBox;
- BoxRec tmpBox;
- int y, nbox;
-
- extents = REGION_EXTENTS(pScreen, reg);
- nbox = REGION_NUM_RECTS(reg);
- pbox = REGION_RECTS(reg);
-
- if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
- *ydir = -1;
- if(nbox > 1) {
- firstBox = pbox;
- lastBox = pbox + nbox - 1;
- while((unsigned long)firstBox < (unsigned long)lastBox) {
- tmpBox = *firstBox;
- *firstBox = *lastBox;
- *lastBox = tmpBox;
- firstBox++;
- lastBox--;
- }
- }
- } else *ydir = 1;
-
- if((dx > 0) && (dx < (extents->x2 - extents->x1))) {
- *xdir = -1;
- if(nbox > 1) {
- firstBox = lastBox = pbox;
- y = pbox->y1;
- while(--nbox) {
- pbox++;
- if(pbox->y1 == y) lastBox++;
- else {
- while((unsigned long)firstBox < (unsigned long)lastBox) {
- tmpBox = *firstBox;
- *firstBox = *lastBox;
- *lastBox = tmpBox;
- firstBox++;
- lastBox--;
- }
-
- firstBox = lastBox = pbox;
- y = pbox->y1;
- }
- }
- while((unsigned long)firstBox < (unsigned long)lastBox) {
- tmpBox = *firstBox;
- *firstBox = *lastBox;
- *lastBox = tmpBox;
- firstBox++;
- lastBox--;
- }
- }
- } else *xdir = 1;
-
-}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
deleted file mode 100644
index 80602d3dd..000000000
--- a/hw/xfree86/dri/dri.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.19 2002/10/30 12:52:03 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@tungstengraphics.com>
- *
- */
-
-/* Prototypes for DRI functions */
-
-#ifndef _DRI_H_
-
-#include "scrnintstr.h"
-#include "xf86dri.h"
-
-typedef int DRISyncType;
-
-#define DRI_NO_SYNC 0
-#define DRI_2D_SYNC 1
-#define DRI_3D_SYNC 2
-
-typedef int DRIContextType;
-
-typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
-
-typedef enum _DRIContextFlags
-{
- DRI_CONTEXT_2DONLY = 0x01,
- DRI_CONTEXT_PRESERVED = 0x02,
- DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
-} DRIContextFlags;
-
-#define DRI_NO_CONTEXT 0
-#define DRI_2D_CONTEXT 1
-#define DRI_3D_CONTEXT 2
-
-typedef int DRISwapMethod;
-
-#define DRI_HIDE_X_CONTEXT 0
-#define DRI_SERVER_SWAP 1
-#define DRI_KERNEL_SWAP 2
-
-typedef int DRIWindowRequests;
-
-#define DRI_NO_WINDOWS 0
-#define DRI_3D_WINDOWS_ONLY 1
-#define DRI_ALL_WINDOWS 2
-
-
-typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
-typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags);
-
-
-/*
- * These functions can be wrapped by the DRI. Each of these have
- * generic default funcs (initialized in DRICreateInfoRec) and can be
- * overridden by the driver in its [driver]DRIScreenInit function.
- */
-typedef struct {
- ScreenWakeupHandlerProcPtr WakeupHandler;
- ScreenBlockHandlerProcPtr BlockHandler;
- WindowExposuresProcPtr WindowExposures;
- CopyWindowProcPtr CopyWindow;
- ValidateTreeProcPtr ValidateTree;
- PostValidateTreeProcPtr PostValidateTree;
- ClipNotifyProcPtr ClipNotify;
- AdjustFramePtr AdjustFrame;
-} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
-
-
-
-
-typedef struct {
- /* driver call back functions
- *
- * New fields should be added at the end for backwards compatability.
- * Don't forget to bump the version minor number in
- * xc/lib/GL/dri/xf86dristr.h
- */
- Bool (*CreateContext)(ScreenPtr pScreen,
- VisualPtr visual,
- drmContext hHWContext,
- void* pVisualConfigPriv,
- DRIContextType context);
- void (*DestroyContext)(ScreenPtr pScreen,
- drmContext hHWContext,
- DRIContextType context);
- void (*SwapContext)(ScreenPtr pScreen,
- DRISyncType syncType,
- DRIContextType readContextType,
- void* readContextStore,
- DRIContextType writeContextType,
- void* writeContextStore);
- void (*InitBuffers)(WindowPtr pWin,
- RegionPtr prgn,
- CARD32 indx);
- void (*MoveBuffers)(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc,
- CARD32 indx);
- void (*TransitionTo3d)(ScreenPtr pScreen);
- void (*TransitionTo2d)(ScreenPtr pScreen);
-
- void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx);
- Bool (*OpenFullScreen)(ScreenPtr pScreen);
- Bool (*CloseFullScreen)(ScreenPtr pScreen);
-
- /* wrapped functions */
- DRIWrappedFuncsRec wrap;
-
- /* device info */
- char* drmDriverName;
- char* clientDriverName;
- char* busIdString;
- int ddxDriverMajorVersion;
- int ddxDriverMinorVersion;
- int ddxDriverPatchVersion;
- CARD32 frameBufferPhysicalAddress;
- long frameBufferSize;
- long frameBufferStride;
- long SAREASize;
- int maxDrawableTableEntry;
- int ddxDrawableTableEntry;
- long contextSize;
- DRISwapMethod driverSwapMethod;
- DRIWindowRequests bufferRequests;
- int devPrivateSize;
- void* devPrivate;
- Bool createDummyCtx;
- Bool createDummyCtxPriv;
-
- /* New with DRI version 4.1.0 */
- void (*TransitionSingleToMulti3D)(ScreenPtr pScreen);
- void (*TransitionMultiToSingle3D)(ScreenPtr pScreen);
-} DRIInfoRec, *DRIInfoPtr;
-
-
-extern Bool DRIScreenInit(ScreenPtr pScreen,
- DRIInfoPtr pDRIInfo,
- int *pDRMFD);
-
-extern void DRICloseScreen(ScreenPtr pScreen);
-
-extern Bool DRIExtensionInit(void);
-
-extern void DRIReset(void);
-
-extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
- Bool *isCapable);
-
-extern Bool DRIOpenConnection(ScreenPtr pScreen,
- drmHandlePtr hSAREA,
- char **busIdString);
-
-extern Bool DRIAuthConnection(ScreenPtr pScreen, drmMagic magic);
-
-extern Bool DRICloseConnection(ScreenPtr pScreen);
-
-extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
- int* ddxDriverMajorVersion,
- int* ddxDriverMinorVersion,
- int* ddxDriverPatchVersion,
- char** clientDriverName);
-
-extern Bool DRICreateContext(ScreenPtr pScreen,
- VisualPtr visual,
- XID context,
- drmContextPtr pHWContext);
-
-extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
-
-extern Bool DRIContextPrivDelete(pointer pResource, XID id);
-
-extern Bool DRICreateDrawable(ScreenPtr pScreen,
- Drawable id,
- DrawablePtr pDrawable,
- drmDrawablePtr hHWDrawable);
-
-extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
- Drawable id,
- DrawablePtr pDrawable);
-
-extern Bool DRIDrawablePrivDelete(pointer pResource,
- XID id);
-
-extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
- DrawablePtr pDrawable,
- unsigned int* indx,
- unsigned int* stamp,
- int* X,
- int* Y,
- int* W,
- int* H,
- int* numClipRects,
- XF86DRIClipRectPtr* pClipRects,
- int* backX,
- int* backY,
- int* numBackClipRects,
- XF86DRIClipRectPtr* pBackClipRects);
-
-extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
- drmHandlePtr hFrameBuffer,
- int* fbOrigin,
- int* fbSize,
- int* fbStride,
- int* devPrivateSize,
- void** pDevPrivate);
-
-extern DRIInfoPtr DRICreateInfoRec(void);
-
-extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
-
-extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
-
-extern void DRIWakeupHandler(pointer wakeupData,
- int result,
- pointer pReadmask);
-
-extern void DRIBlockHandler(pointer blockData,
- OSTimePtr pTimeout,
- pointer pReadmask);
-
-extern void DRIDoWakeupHandler(int screenNum,
- pointer wakeupData,
- unsigned long result,
- pointer pReadmask);
-
-extern void DRIDoBlockHandler(int screenNum,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask);
-
-extern void DRISwapContext(int drmFD,
- void *oldctx,
- void *newctx);
-
-extern void *DRIGetContextStore(DRIContextPrivPtr context);
-
-extern void DRIWindowExposures(WindowPtr pWin,
- RegionPtr prgn,
- RegionPtr bsreg);
-
-extern void DRICopyWindow(WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-
-extern int DRIValidateTree(WindowPtr pParent,
- WindowPtr pChild,
- VTKind kind);
-
-extern void DRIPostValidateTree(WindowPtr pParent,
- WindowPtr pChild,
- VTKind kind);
-
-extern void DRIClipNotify(WindowPtr pWin,
- int dx,
- int dy);
-
-extern CARD32 DRIGetDrawableIndex(WindowPtr pWin);
-
-extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
-
-extern void DRILock(ScreenPtr pScreen, int flags);
-
-extern void DRIUnlock(ScreenPtr pScreen);
-
-extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
-
-extern void *DRIGetSAREAPrivate(ScreenPtr pScreen);
-
-extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
- CARD32 drawable_index);
-
-extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
- drmContextPtr pHWContext,
- DRIContextFlags flags);
-
-extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
- drmContext hHWContext,
- DRIContextFlags flags);
-
-extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
-
-extern drmContext DRIGetContext(ScreenPtr pScreen);
-
-extern void DRIQueryVersion(int *majorVersion,
- int *minorVersion,
- int *patchVersion);
-
-extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
-
-extern int DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
-extern int DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
-
-extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
- int dx,
- int dy,
- int *xdir,
- int *ydir,
- RegionPtr reg);
-
-#define _DRI_H_
-
-#endif
diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c
deleted file mode 100644
index bb7a89ee0..000000000
--- a/hw/xfree86/dri/drimodule.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/**************************************************************************
-
-Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/programs/Xserver/GL/dri/drimodule.c,v 1.6 2001/12/10 19:07:19 dawes Exp $ */
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- * Rickard E. Faith <faith@precisioninsight.com>
- *
- */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(driSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "dri",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-extern void XFree86DRIExtensionInit(INITARGS);
-#define _XF86DRI_SERVER_
-#include "xf86dristr.h"
-
-ExtensionModule XF86DRIExt =
-{
- XFree86DRIExtensionInit,
- XF86DRINAME,
- NULL,
- NULL,
- NULL
-};
-
-static const char *drmSymbols[] = {
- "drmAddContextTag",
- "drmAddMap",
- "drmAuthMagic",
- "drmAvailable",
- "drmClose",
- "drmCreateContext",
- "drmCreateDrawable",
- "drmDelContextTag",
- "drmDestroyContext",
- "drmDestroyDrawable",
- "drmFreeReservedContextList",
- "drmGetContextTag",
- "drmGetLock",
- "drmGetReservedContextList",
- "drmInstallSIGIOHandler",
- "drmMap",
- "drmOpen",
- "drmRemoveSIGIOHandler",
- "drmSetBusid",
- "drmSetContextFlags",
- "drmUnlock",
- "drmUnmap",
- NULL
-};
-
-XF86ModuleData driModuleData = { &VersRec, driSetup, NULL };
-
-static pointer
-driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
- pointer drm = NULL;
-
- if (!setupDone) {
- setupDone = TRUE;
-
- drm =
- LoadSubModule(module, "drm", NULL, NULL, NULL, NULL, errmaj, errmin);
-
- if (!drm) {
- if (errmaj) *errmaj = LDR_NOSUBENT;
- }
- else {
- LoaderReqSymLists(drmSymbols, NULL);
- LoaderRefSymbols("noPanoramiXExtension", NULL);
- LoadExtension(&XF86DRIExt, FALSE);
- }
- } else {
- if (errmaj) *errmaj = LDR_ONCEONLY;
- }
- /* Need a non-NULL return value to indicate success */
- return drm;
-}
-
diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h
deleted file mode 100644
index e733ac210..000000000
--- a/hw/xfree86/dri/dristruct.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.13 2002/11/20 18:10:24 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Jens Owen <jens@tungstengraphics.com>
- *
- */
-
-#ifndef DRI_STRUCT_H
-#define DRI_STRUCT_H
-
-#include "xf86drm.h"
-
-
-#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
- ((DRIWindowPrivIndex < 0) ? \
- NULL : \
- ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
-
-#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
- ((DRIPixmapPrivIndex < 0) ? \
- NULL : \
- ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
-
-typedef struct _DRIDrawablePrivRec
-{
- drmDrawable hwDrawable;
- int drawableIndex;
- ScreenPtr pScreen;
- int refCount;
-} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
-
-struct _DRIContextPrivRec
-{
- drmContext hwContext;
- ScreenPtr pScreen;
- Bool valid3D;
- DRIContextFlags flags;
- void** pContextStore;
-};
-
-#define DRI_SCREEN_PRIV(pScreen) \
- ((DRIScreenPrivIndex < 0) ? \
- NULL : \
- ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
-
-#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
- (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
-
-
-typedef struct _DRIScreenPrivRec
-{
- Bool directRenderingSupport;
- int drmFD; /* File descriptor for /dev/video/? */
- drmHandle hSAREA; /* Handle to SAREA, for mapping */
- XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
- drmHandle hFrameBuffer; /* Handle to framebuffer, for mapping */
- drmContext myContext; /* DDX Driver's context */
- DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
- DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
- void** hiddenContextStore; /* hidden X context */
- void** partial3DContextStore; /* parital 3D context */
- DRIInfoPtr pDriverInfo;
- int nrWindows;
- XF86DRIClipRectRec private_buffer_rect; /* management of private buffers */
- DrawablePtr fullscreen; /* pointer to fullscreen drawable */
- XF86DRIClipRectRec fullscreen_rect; /* fake rect for fullscreen mode */
- DRIWrappedFuncsRec wrap;
- DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
- DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
- Bool createDummyCtx;
- Bool createDummyCtxPriv;
- Bool grabbedDRILock;
- Bool drmSIGIOHandlerInstalled;
- Bool wrapped;
-} DRIScreenPrivRec, *DRIScreenPrivPtr;
-
-#endif /* DRI_STRUCT_H */
diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
deleted file mode 100644
index fcb4b59bd..000000000
--- a/hw/xfree86/dri/sarea.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
-/**
- * \file sarea.h
- * SAREA definitions.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Jens Owen <jens@tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- */
-
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
-
-#ifndef _SAREA_H_
-#define _SAREA_H_
-
-#include "xf86drm.h"
-
-/* SAREA area needs to be at least a page */
-#if defined(__alpha__)
-#define SAREA_MAX 0x2000
-#elif defined(__ia64__)
-#define SAREA_MAX 0x10000 /* 64kB */
-#else
-/* Intel 830M driver needs at least 8k SAREA */
-#define SAREA_MAX 0x2000
-#endif
-
-#define SAREA_MAX_DRAWABLES 256
-
-#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
-
-/**
- * SAREA per drawable information.
- *
- * \sa _XF86DRISAREA.
- */
-typedef struct _XF86DRISAREADrawable {
- unsigned int stamp;
- unsigned int flags;
-} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
-
-/**
- * SAREA frame information.
- *
- * \sa _XF86DRISAREA.
- */
-typedef struct _XF86DRISAREAFrame {
- unsigned int x;
- unsigned int y;
- unsigned int width;
- unsigned int height;
- unsigned int fullscreen;
-} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
-
-/**
- * SAREA definition.
- */
-typedef struct _XF86DRISAREA {
- /** first thing is always the DRM locking structure */
- drmLock lock;
- /** \todo Use readers/writer lock for drawable_lock */
- drmLock drawable_lock;
- XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
- XF86DRISAREAFrameRec frame;
- drmContext dummy_context;
-} XF86DRISAREARec, *XF86DRISAREAPtr;
-
-#endif
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
deleted file mode 100644
index 3df0cca59..000000000
--- a/hw/xfree86/dri/xf86dri.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.13 2003/09/24 02:43:12 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#endif
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _XF86DRI_SERVER_
-#include "xf86dristr.h"
-#include "swaprep.h"
-#include "dri.h"
-#include "sarea.h"
-#include "dristruct.h"
-#include "xf86.h"
-#include "xf86drm.h"
-
-static int DRIErrorBase;
-
-static DISPATCH_PROC(ProcXF86DRIQueryVersion);
-static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(ProcXF86DRIOpenConnection);
-static DISPATCH_PROC(ProcXF86DRICloseConnection);
-static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
-static DISPATCH_PROC(ProcXF86DRICreateContext);
-static DISPATCH_PROC(ProcXF86DRIDestroyContext);
-static DISPATCH_PROC(ProcXF86DRICreateDrawable);
-static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
-static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
-static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
-static DISPATCH_PROC(ProcXF86DRIDispatch);
-static DISPATCH_PROC(ProcXF86DRIAuthConnection);
-static DISPATCH_PROC(ProcXF86DRIOpenFullScreen);
-static DISPATCH_PROC(ProcXF86DRICloseFullScreen);
-
-static DISPATCH_PROC(SProcXF86DRIQueryVersion);
-static DISPATCH_PROC(SProcXF86DRIDispatch);
-
-static void XF86DRIResetProc(ExtensionEntry* extEntry);
-
-static unsigned char DRIReqCode = 0;
-
-extern void XFree86DRIExtensionInit(void);
-
-void
-XFree86DRIExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
-#ifdef XF86DRI_EVENTS
- EventType = CreateNewResourceType(XF86DRIFreeEvents);
-#endif
-
- if (
- DRIExtensionInit() &&
-#ifdef XF86DRI_EVENTS
- EventType && ScreenPrivateIndex != -1 &&
-#endif
- (extEntry = AddExtension(XF86DRINAME,
- XF86DRINumberEvents,
- XF86DRINumberErrors,
- ProcXF86DRIDispatch,
- SProcXF86DRIDispatch,
- XF86DRIResetProc,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- }
-}
-
-/*ARGSUSED*/
-static void
-XF86DRIResetProc (
- ExtensionEntry* extEntry
-)
-{
- DRIReset();
-}
-
-static int
-ProcXF86DRIQueryVersion(
- register ClientPtr client
-)
-{
- xXF86DRIQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XF86DRI_MAJOR_VERSION;
- rep.minorVersion = XF86DRI_MINOR_VERSION;
- rep.patchVersion = XF86DRI_PATCH_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIQueryDirectRenderingCapable(
- register ClientPtr client
-)
-{
- xXF86DRIQueryDirectRenderingCapableReply rep;
- Bool isCapable;
-
- REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
- REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
- &isCapable)) {
- return BadValue;
- }
- rep.isCapable = isCapable;
-
- if (!LocalClient(client))
- rep.isCapable = 0;
-
- WriteToClient(client,
- sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIOpenConnection(
- register ClientPtr client
-)
-{
- xXF86DRIOpenConnectionReply rep;
- drmHandle hSAREA;
- char* busIdString;
-
- REQUEST(xXF86DRIOpenConnectionReq);
- REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- if (!DRIOpenConnection( screenInfo.screens[stuff->screen],
- &hSAREA,
- &busIdString)) {
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.busIdStringLength = 0;
- if (busIdString)
- rep.busIdStringLength = strlen(busIdString);
- rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) +
- ((rep.busIdStringLength + 3) & ~3)) >> 2;
-
- rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff);
-#ifdef LONG64
- rep.hSAREAHigh = (CARD32)(hSAREA >> 32);
-#else
- rep.hSAREAHigh = 0;
-#endif
-
- WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep);
- if (rep.busIdStringLength)
- WriteToClient(client, rep.busIdStringLength, busIdString);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIAuthConnection(
- register ClientPtr client
-)
-{
- xXF86DRIAuthConnectionReply rep;
-
- REQUEST(xXF86DRIAuthConnectionReq);
- REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.authenticated = 1;
-
- if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
- ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic);
- rep.authenticated = 0;
- }
- WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRICloseConnection(
- register ClientPtr client
-)
-{
- REQUEST(xXF86DRICloseConnectionReq);
- REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- DRICloseConnection( screenInfo.screens[stuff->screen]);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIGetClientDriverName(
- register ClientPtr client
-)
-{
- xXF86DRIGetClientDriverNameReply rep;
- char* clientDriverName;
-
- REQUEST(xXF86DRIGetClientDriverNameReq);
- REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- DRIGetClientDriverName( screenInfo.screens[stuff->screen],
- (int *)&rep.ddxDriverMajorVersion,
- (int *)&rep.ddxDriverMinorVersion,
- (int *)&rep.ddxDriverPatchVersion,
- &clientDriverName);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.clientDriverNameLength = 0;
- if (clientDriverName)
- rep.clientDriverNameLength = strlen(clientDriverName);
- rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) -
- SIZEOF(xGenericReply) +
- ((rep.clientDriverNameLength + 3) & ~3)) >> 2;
-
- WriteToClient(client,
- sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep);
- if (rep.clientDriverNameLength)
- WriteToClient(client,
- rep.clientDriverNameLength,
- clientDriverName);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRICreateContext(
- register ClientPtr client
-)
-{
- xXF86DRICreateContextReply rep;
- ScreenPtr pScreen;
- VisualPtr visual;
- int i;
-
- REQUEST(xXF86DRICreateContextReq);
- REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- pScreen = screenInfo.screens[stuff->screen];
- visual = pScreen->visuals;
-
- /* Find the requested X visual */
- for (i = 0; i < pScreen->numVisuals; i++, visual++)
- if (visual->vid == stuff->visual)
- break;
- if (i == pScreen->numVisuals) {
- /* No visual found */
- return BadValue;
- }
-
- if (!DRICreateContext( pScreen,
- visual,
- stuff->context,
- (drmContextPtr)&rep.hHWContext)) {
- return BadValue;
- }
-
- WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIDestroyContext(
- register ClientPtr client
-)
-{
- REQUEST(xXF86DRIDestroyContextReq);
- REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- if (!DRIDestroyContext( screenInfo.screens[stuff->screen],
- stuff->context)) {
- return BadValue;
- }
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRICreateDrawable(
- ClientPtr client
-)
-{
- xXF86DRICreateDrawableReply rep;
- DrawablePtr pDrawable;
-
- REQUEST(xXF86DRICreateDrawableReq);
- REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
- (Drawable)stuff->drawable,
- client,
- SecurityReadAccess))) {
- return BadValue;
- }
-
- if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable,
- pDrawable,
- (drmDrawablePtr)&rep.hHWDrawable)) {
- return BadValue;
- }
-
- WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIDestroyDrawable(
- register ClientPtr client
-)
-{
- REQUEST(xXF86DRIDestroyDrawableReq);
- DrawablePtr pDrawable;
- REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
- (Drawable)stuff->drawable,
- client,
- SecurityReadAccess))) {
- return BadValue;
- }
-
- if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable,
- pDrawable)) {
- return BadValue;
- }
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIGetDrawableInfo(
- register ClientPtr client
-)
-{
- xXF86DRIGetDrawableInfoReply rep;
- DrawablePtr pDrawable;
- int X, Y, W, H;
- XF86DRIClipRectPtr pClipRects;
- XF86DRIClipRectPtr pBackClipRects;
- int backX, backY;
-
- REQUEST(xXF86DRIGetDrawableInfoReq);
- REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
- (Drawable)stuff->drawable,
- client,
- SecurityReadAccess))) {
- return BadValue;
- }
-
- if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen],
- pDrawable,
- (unsigned int*)&rep.drawableTableIndex,
- (unsigned int*)&rep.drawableTableStamp,
- (int*)&X,
- (int*)&Y,
- (int*)&W,
- (int*)&H,
- (int*)&rep.numClipRects,
- &pClipRects,
- &backX,
- &backY,
- (int*)&rep.numBackClipRects,
- &pBackClipRects)) {
- return BadValue;
- }
-
- rep.drawableX = X;
- rep.drawableY = Y;
- rep.drawableWidth = W;
- rep.drawableHeight = H;
- rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) -
- SIZEOF(xGenericReply));
-
- rep.backX = backX;
- rep.backY = backY;
-
- if (rep.numBackClipRects)
- rep.length += sizeof(XF86DRIClipRectRec) * rep.numBackClipRects;
-
- if (rep.numClipRects)
- rep.length += sizeof(XF86DRIClipRectRec) * rep.numClipRects;
-
- rep.length = ((rep.length + 3) & ~3) >> 2;
-
- WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep);
-
- if (rep.numClipRects) {
- WriteToClient(client,
- sizeof(XF86DRIClipRectRec) * rep.numClipRects,
- (char *)pClipRects);
- }
-
- if (rep.numBackClipRects) {
- WriteToClient(client,
- sizeof(XF86DRIClipRectRec) * rep.numBackClipRects,
- (char *)pBackClipRects);
- }
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIGetDeviceInfo(
- register ClientPtr client
-)
-{
- xXF86DRIGetDeviceInfoReply rep;
- drmHandle hFrameBuffer;
- void *pDevPrivate;
-
- REQUEST(xXF86DRIGetDeviceInfoReq);
- REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen],
- &hFrameBuffer,
- (int*)&rep.framebufferOrigin,
- (int*)&rep.framebufferSize,
- (int*)&rep.framebufferStride,
- (int*)&rep.devPrivateSize,
- &pDevPrivate)) {
- return BadValue;
- }
-
- rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff);
-#ifdef LONG64
- rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32);
-#else
- rep.hFrameBufferHigh = 0;
-#endif
-
- rep.length = 0;
- if (rep.devPrivateSize) {
- rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) -
- SIZEOF(xGenericReply) +
- ((rep.devPrivateSize + 3) & ~3)) >> 2;
- }
-
- WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep);
- if (rep.length) {
- WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate);
- }
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIOpenFullScreen (
- register ClientPtr client
-)
-{
- REQUEST(xXF86DRIOpenFullScreenReq);
- xXF86DRIOpenFullScreenReply rep;
- DrawablePtr pDrawable;
-
- REQUEST_SIZE_MATCH(xXF86DRIOpenFullScreenReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!(pDrawable = SecurityLookupDrawable(stuff->drawable,
- client,
- SecurityReadAccess)))
- return BadValue;
-
- rep.isFullScreen = DRIOpenFullScreen(screenInfo.screens[stuff->screen],
- pDrawable);
-
- WriteToClient(client, sizeof(xXF86DRIOpenFullScreenReply), (char *)&rep);
- return client->noClientException;
-}
-
-static int
-ProcXF86DRICloseFullScreen (
- register ClientPtr client
-)
-{
- REQUEST(xXF86DRICloseFullScreenReq);
- xXF86DRICloseFullScreenReply rep;
- DrawablePtr pDrawable;
-
- REQUEST_SIZE_MATCH(xXF86DRICloseFullScreenReq);
- if (stuff->screen >= screenInfo.numScreens) {
- client->errorValue = stuff->screen;
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!(pDrawable = SecurityLookupDrawable(stuff->drawable,
- client,
- SecurityReadAccess)))
- return BadValue;
-
- DRICloseFullScreen(screenInfo.screens[stuff->screen], pDrawable);
-
- WriteToClient(client, sizeof(xXF86DRICloseFullScreenReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86DRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_XF86DRIQueryVersion:
- return ProcXF86DRIQueryVersion(client);
- case X_XF86DRIQueryDirectRenderingCapable:
- return ProcXF86DRIQueryDirectRenderingCapable(client);
- }
-
- if (!LocalClient(client))
- return DRIErrorBase + XF86DRIClientNotLocal;
-
- switch (stuff->data)
- {
- case X_XF86DRIOpenConnection:
- return ProcXF86DRIOpenConnection(client);
- case X_XF86DRICloseConnection:
- return ProcXF86DRICloseConnection(client);
- case X_XF86DRIGetClientDriverName:
- return ProcXF86DRIGetClientDriverName(client);
- case X_XF86DRICreateContext:
- return ProcXF86DRICreateContext(client);
- case X_XF86DRIDestroyContext:
- return ProcXF86DRIDestroyContext(client);
- case X_XF86DRICreateDrawable:
- return ProcXF86DRICreateDrawable(client);
- case X_XF86DRIDestroyDrawable:
- return ProcXF86DRIDestroyDrawable(client);
- case X_XF86DRIGetDrawableInfo:
- return ProcXF86DRIGetDrawableInfo(client);
- case X_XF86DRIGetDeviceInfo:
- return ProcXF86DRIGetDeviceInfo(client);
- case X_XF86DRIAuthConnection:
- return ProcXF86DRIAuthConnection(client);
- case X_XF86DRIOpenFullScreen:
- return ProcXF86DRIOpenFullScreen(client);
- case X_XF86DRICloseFullScreen:
- return ProcXF86DRICloseFullScreen(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcXF86DRIQueryVersion(
- register ClientPtr client
-)
-{
- register int n;
- REQUEST(xXF86DRIQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXF86DRIQueryVersion(client);
-}
-
-static int
-SProcXF86DRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return DRIErrorBase + XF86DRIClientNotLocal;
-
- /* only local clients are allowed DRI access */
- switch (stuff->data)
- {
- case X_XF86DRIQueryVersion:
- return SProcXF86DRIQueryVersion(client);
- default:
- return BadRequest;
- }
-}
diff --git a/hw/xfree86/dummylib/README b/hw/xfree86/dummylib/README
deleted file mode 100644
index 8e5b539a6..000000000
--- a/hw/xfree86/dummylib/README
+++ /dev/null
@@ -1,7 +0,0 @@
-
-libdummy (dummylib) contains basic utility functions required by libxf86_os.a.
-There is one symbol per source/object so that each can be overriden
-individually by whatever uses this library.
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/dummylib/README,v 1.1 2000/02/13 03:06:38 dawes Exp $
diff --git a/hw/xfree86/dummylib/dummylib.h b/hw/xfree86/dummylib/dummylib.h
deleted file mode 100644
index d8a0d285a..000000000
--- a/hw/xfree86/dummylib/dummylib.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#ifndef _DUMMY_LIB_H
-#define _DUMMY_LIB_H
-
-#endif /* _DUMMY_LIB_H */
diff --git a/hw/xfree86/dummylib/fatalerror.c b/hw/xfree86/dummylib/fatalerror.c
deleted file mode 100644
index 3c482b480..000000000
--- a/hw/xfree86/dummylib/fatalerror.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/fatalerror.c,v 1.1 2000/02/13 03:06:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-FatalError(const char *f, ...)
-{
- va_list args;
-
- va_start(args, f);
- fprintf(stderr, "Fatal Error:\n");
- vfprintf(stderr, f, args);
- va_end(args);
- exit(1);
-}
-
diff --git a/hw/xfree86/dummylib/getvalidbios.c b/hw/xfree86/dummylib/getvalidbios.c
deleted file mode 100644
index a16126842..000000000
--- a/hw/xfree86/dummylib/getvalidbios.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.3 2001/05/15 10:19:41 eich Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-memType
-getValidBIOSBase(PCITAG tag, int num)
-{
- return 0;
-}
diff --git a/hw/xfree86/dummylib/logvwrite.c b/hw/xfree86/dummylib/logvwrite.c
deleted file mode 100644
index 75634d7f3..000000000
--- a/hw/xfree86/dummylib/logvwrite.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/logvwrite.c,v 1.1 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-LogVWrite(int verb, const char *format, va_list ap)
-{
- if (xf86Verbose >= verb)
- vfprintf(stderr, format, ap);
-}
-
diff --git a/hw/xfree86/dummylib/pcitestmulti.c b/hw/xfree86/dummylib/pcitestmulti.c
deleted file mode 100644
index 4259f678e..000000000
--- a/hw/xfree86/dummylib/pcitestmulti.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/pcitestmulti.c,v 1.1 2000/02/13 03:06:39 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-int
-pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag)
-{
- return 0;
-}
-
diff --git a/hw/xfree86/dummylib/verrorf.c b/hw/xfree86/dummylib/verrorf.c
deleted file mode 100644
index e36a590e7..000000000
--- a/hw/xfree86/dummylib/verrorf.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/verrorf.c,v 1.1 2000/02/13 03:06:39 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-VErrorF(const char *f, va_list args)
-{
- vfprintf(stderr, f, args);
-}
-
diff --git a/hw/xfree86/dummylib/xalloc.c b/hw/xfree86/dummylib/xalloc.c
deleted file mode 100644
index 63d3ff8c7..000000000
--- a/hw/xfree86/dummylib/xalloc.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c,v 1.2 2002/11/09 09:00:13 herrb Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-pointer
-Xalloc(unsigned long n)
-{
- if (!n)
- n = 1;
- return malloc(n);
-}
-
-pointer
-Xrealloc(pointer p, unsigned long n)
-{
- if (!n)
- n = 1;
- return realloc(p, n);
-}
-
-pointer
-Xcalloc(unsigned long n)
-{
- pointer r;
-
- r = Xalloc(n);
- memset(r, 0, n);
- return r;
-}
-
-pointer
-XNFalloc(unsigned long n)
-{
- pointer r;
-
- r = Xalloc(n);
- if (!r)
- FatalError("XNFalloc failed\n");
- return r;
-
-}
-
-pointer
-XNFrealloc(pointer p, unsigned long n)
-{
- pointer r;
-
- r = Xrealloc(p, n);
- if (!r)
- FatalError("XNFrealloc failed\n");
- return r;
-
-}
-
-pointer
-XNFcalloc(unsigned long n)
-{
- pointer r;
-
- r = Xcalloc(n);
- if (!r)
- FatalError("XNFcalloc failed\n");
- return r;
-
-}
-
-void
-Xfree(pointer p)
-{
- free(p);
-}
-
-char *
-Xstrdup(const char *s)
-{
- char *sd;
-
- if (s == NULL)
- return NULL;
-
- sd = (char *)Xalloc(strlen(s) + 1);
- if (sd != NULL)
- strcpy(sd, s);
- return sd;
-}
diff --git a/hw/xfree86/dummylib/xf86addrestolist.c b/hw/xfree86/dummylib/xf86addrestolist.c
deleted file mode 100644
index ea24fc1dc..000000000
--- a/hw/xfree86/dummylib/xf86addrestolist.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86addrestolist.c,v 1.3 2002/12/24 15:50:43 tsi Exp $ */
-
-#include "xf86.h"
-
-resPtr
-xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex)
-{
- return rlist;
-}
-
-void
-xf86FreeResList(resPtr rlist)
-{
- return;
-}
-
-resPtr
-xf86DupResList(const resPtr rlist)
-{
- return rlist;
-}
diff --git a/hw/xfree86/dummylib/xf86allocscripi.c b/hw/xfree86/dummylib/xf86allocscripi.c
deleted file mode 100644
index 1f61eda4d..000000000
--- a/hw/xfree86/dummylib/xf86allocscripi.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86allocscripi.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-int
-xf86AllocateScrnInfoPrivateIndex()
-{
- return -1;
-}
-
diff --git a/hw/xfree86/dummylib/xf86drvmsg.c b/hw/xfree86/dummylib/xf86drvmsg.c
deleted file mode 100644
index 5780d9c13..000000000
--- a/hw/xfree86/dummylib/xf86drvmsg.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86DrvMsg(int i, MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(1, format, ap);
- va_end(ap);
-}
-
diff --git a/hw/xfree86/dummylib/xf86drvmsgverb.c b/hw/xfree86/dummylib/xf86drvmsgverb.c
deleted file mode 100644
index b7c0ddb53..000000000
--- a/hw/xfree86/dummylib/xf86drvmsgverb.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86DrvMsgVerb(int i, MessageType type, int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(verb, format, ap);
- va_end(ap);
-}
-
diff --git a/hw/xfree86/dummylib/xf86errorf.c b/hw/xfree86/dummylib/xf86errorf.c
deleted file mode 100644
index 122f46d43..000000000
--- a/hw/xfree86/dummylib/xf86errorf.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.3 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86ErrorF(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(1, format, ap);
- va_end(ap);
-}
-
-void
-ErrorF(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(1, format, ap);
- va_end(ap);
-}
diff --git a/hw/xfree86/dummylib/xf86errorfverb.c b/hw/xfree86/dummylib/xf86errorfverb.c
deleted file mode 100644
index 61c3e02a2..000000000
--- a/hw/xfree86/dummylib/xf86errorfverb.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86ErrorFVerb(int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(verb, format, ap);
- va_end(ap);
-}
-
diff --git a/hw/xfree86/dummylib/xf86getpagesize.c b/hw/xfree86/dummylib/xf86getpagesize.c
deleted file mode 100644
index 51b785a73..000000000
--- a/hw/xfree86/dummylib/xf86getpagesize.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86getpagesize.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-int xf86getpagesize(void);
-
-int
-xf86getpagesize(void)
-{
- return 4096; /* not used */
-}
-
diff --git a/hw/xfree86/dummylib/xf86getverb.c b/hw/xfree86/dummylib/xf86getverb.c
deleted file mode 100644
index a4255698f..000000000
--- a/hw/xfree86/dummylib/xf86getverb.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86getverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-int
-xf86GetVerbosity()
-{
- return xf86Verbose;
-}
-
diff --git a/hw/xfree86/dummylib/xf86info.c b/hw/xfree86/dummylib/xf86info.c
deleted file mode 100644
index d7b95b430..000000000
--- a/hw/xfree86/dummylib/xf86info.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86info.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/* Dummy variables */
-xf86InfoRec xf86Info = {NULL, };
-
diff --git a/hw/xfree86/dummylib/xf86msg.c b/hw/xfree86/dummylib/xf86msg.c
deleted file mode 100644
index 2d36bea97..000000000
--- a/hw/xfree86/dummylib/xf86msg.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86Msg(MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(1, format, ap);
- va_end(ap);
-}
-
diff --git a/hw/xfree86/dummylib/xf86msgverb.c b/hw/xfree86/dummylib/xf86msgverb.c
deleted file mode 100644
index f460b6b9f..000000000
--- a/hw/xfree86/dummylib/xf86msgverb.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86MsgVerb(MessageType type, int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVWrite(verb, format, ap);
- va_end(ap);
-}
-
diff --git a/hw/xfree86/dummylib/xf86opt.c b/hw/xfree86/dummylib/xf86opt.c
deleted file mode 100644
index dd00635b0..000000000
--- a/hw/xfree86/dummylib/xf86opt.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.2 2001/05/04 19:05:50 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-void
-xf86ProcessOptions(int i, pointer p, OptionInfoPtr o)
-{
-}
-
-Bool
-xf86GetOptValBool(const OptionInfoRec *o, int i, Bool *b)
-{
- return FALSE;
-}
-
diff --git a/hw/xfree86/dummylib/xf86screens.c b/hw/xfree86/dummylib/xf86screens.c
deleted file mode 100644
index 031b6e55a..000000000
--- a/hw/xfree86/dummylib/xf86screens.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86screens.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/* Dummy variables */
-ScrnInfoPtr *xf86Screens = NULL;
-
diff --git a/hw/xfree86/dummylib/xf86servisinit.c b/hw/xfree86/dummylib/xf86servisinit.c
deleted file mode 100644
index 8339c658b..000000000
--- a/hw/xfree86/dummylib/xf86servisinit.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86servisinit.c,v 1.1 2000/02/13 03:06:43 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-Bool
-xf86ServerIsInitialising()
-{
- return FALSE;
-}
-
diff --git a/hw/xfree86/dummylib/xf86verbose.c b/hw/xfree86/dummylib/xf86verbose.c
deleted file mode 100644
index 877bd6fd7..000000000
--- a/hw/xfree86/dummylib/xf86verbose.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86verbose.c,v 1.1 2000/02/13 03:06:43 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/* Dummy variables */
-int xf86Verbose = 0;
-
diff --git a/hw/xfree86/fbdevhw/README b/hw/xfree86/fbdevhw/README
deleted file mode 100644
index 27cc337d4..000000000
--- a/hw/xfree86/fbdevhw/README
+++ /dev/null
@@ -1,16 +0,0 @@
-
-This is a submodule to access linux framebuffer devices.
-It is supported to work as helper module (like vgahw)
-for the chipset drivers. There are functions for
-saving/restoring/setting video modes, set palette entries,
-and a few more helper functions. Some of them can be
-hooked directly into ScrnInfoRec.
-
-In ../drivers/fbdev is a "chipset" driver. It is a simple,
-non-accelerated and hardware-independent driver which works
-on top of this fbdevhw submodule.
-
- Gerd
-
---
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
deleted file mode 100644
index 752cdb044..000000000
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ /dev/null
@@ -1,875 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.33 2003/10/30 17:37:16 tsi Exp $ */
-
-/* all driver need this */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-/* pci stuff */
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-
-#include "xf86cmap.h"
-
-#include "fbdevhw.h"
-#include "fbpriv.h"
-
-#include "asm/page.h" /* #define for PAGE_* */
-
-#include "globals.h"
-#define DPMS_SERVER
-#include "extensions/dpms.h"
-
-#define DEBUG 0
-
-#if DEBUG
-# define TRACE_ENTER(str) ErrorF("fbdevHW: " str " %d\n",pScrn->scrnIndex)
-#else
-# define TRACE_ENTER(str)
-#endif
-
-/* -------------------------------------------------------------------- */
-
-#ifdef XFree86LOADER
-
-static MODULESETUPPROTO(fbdevhwSetup);
-
-static XF86ModuleVersionInfo fbdevHWVersRec =
-{
- "fbdevhw",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 0, 0, 2,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData fbdevhwModuleData = { &fbdevHWVersRec, fbdevhwSetup, NULL };
-
-static pointer
-fbdevhwSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- const char *osname;
-
- /* Check that we're being loaded on a Linux system */
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (!osname || strcmp(osname, "linux") != 0) {
- if (errmaj)
- *errmaj = LDR_BADOS;
- if (errmin)
- *errmin = 0;
- return NULL;
- } else {
- /* OK */
- return (pointer)1;
- }
-}
-
-#else /* XFree86LOADER */
-
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/mman.h>
-
-#endif /* XFree86LOADER */
-
-/* -------------------------------------------------------------------- */
-/* our private data, and two functions to allocate/free this */
-
-#define FBDEVHWPTRLVAL(p) (p)->privates[fbdevHWPrivateIndex].ptr
-#define FBDEVHWPTR(p) ((fbdevHWPtr)(FBDEVHWPTRLVAL(p)))
-
-static int fbdevHWPrivateIndex = -1;
-
-typedef struct {
- /* framebuffer device: filename (/dev/fb*), handle, more */
- char* device;
- int fd;
- void* fbmem;
- unsigned int fbmem_len;
- unsigned int fboff;
- char* mmio;
- unsigned int mmio_len;
-
- /* current hardware state */
- struct fb_fix_screeninfo fix;
- struct fb_var_screeninfo var;
-
- /* saved video mode */
- struct fb_var_screeninfo saved_var;
-
- /* FIXME: unused??? [geert] */
- struct fb_cmap saved_cmap;
- unsigned short *saved_red;
- unsigned short *saved_green;
- unsigned short *saved_blue;
-
- /* buildin video mode */
- DisplayModeRec buildin;
-
-} fbdevHWRec, *fbdevHWPtr;
-
-Bool
-fbdevHWGetRec(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr;
-
- if (fbdevHWPrivateIndex < 0)
- fbdevHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
-
- if (FBDEVHWPTR(pScrn) != NULL)
- return TRUE;
-
- fPtr = FBDEVHWPTRLVAL(pScrn) = xnfcalloc(sizeof(fbdevHWRec), 1);
- return TRUE;
-}
-
-void
-fbdevHWFreeRec(ScrnInfoPtr pScrn)
-{
- if (fbdevHWPrivateIndex < 0)
- return;
- if (FBDEVHWPTR(pScrn) == NULL)
- return;
- xfree(FBDEVHWPTR(pScrn));
- FBDEVHWPTRLVAL(pScrn) = NULL;
-}
-
-/* -------------------------------------------------------------------- */
-/* some helpers for printing debug informations */
-
-#if DEBUG
-static void
-print_fbdev_mode(char *txt, struct fb_var_screeninfo *var)
-{
- ErrorF( "fbdev %s mode:\t%d %d %d %d %d %d %d %d %d %d %d:%d:%d\n",
- txt,var->pixclock,
- var->xres, var->right_margin, var->hsync_len, var->left_margin,
- var->yres, var->lower_margin, var->vsync_len, var->upper_margin,
- var->bits_per_pixel,
- var->red.length, var->green.length, var->blue.length);
-}
-
-static void
-print_xfree_mode(char *txt, DisplayModePtr mode)
-{
- ErrorF( "xfree %s mode:\t%d %d %d %d %d %d %d %d %d\n",
- txt,mode->Clock,
- mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
- mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal);
-}
-#endif
-
-/* -------------------------------------------------------------------- */
-/* Convert timings between the XFree and the Frame Buffer Device */
-
-static void
-xfree2fbdev_fblayout(ScrnInfoPtr pScrn, struct fb_var_screeninfo *var)
-{
- var->xres_virtual = pScrn->virtualX;
- var->yres_virtual = pScrn->virtualY;
- var->bits_per_pixel = pScrn->bitsPerPixel;
- var->red.length = pScrn->weight.red;
- var->green.length = pScrn->weight.green;
- var->blue.length = pScrn->weight.blue;
-}
-
-static void
-xfree2fbdev_timing(DisplayModePtr mode, struct fb_var_screeninfo *var)
-{
- var->xres = mode->HDisplay;
- var->yres = mode->VDisplay;
- if (var->xres_virtual < var->xres)
- var->xres_virtual = var->xres;
- if (var->yres_virtual < var->yres)
- var->yres_virtual = var->yres;
- var->xoffset = var->yoffset = 0;
- var->pixclock = mode->Clock ? 1000000000/mode->Clock : 0;
- var->right_margin = mode->HSyncStart-mode->HDisplay;
- var->hsync_len = mode->HSyncEnd-mode->HSyncStart;
- var->left_margin = mode->HTotal-mode->HSyncEnd;
- var->lower_margin = mode->VSyncStart-mode->VDisplay;
- var->vsync_len = mode->VSyncEnd-mode->VSyncStart;
- var->upper_margin = mode->VTotal-mode->VSyncEnd;
- var->sync = 0;
- if (mode->Flags & V_PHSYNC)
- var->sync |= FB_SYNC_HOR_HIGH_ACT;
- if (mode->Flags & V_PVSYNC)
- var->sync |= FB_SYNC_VERT_HIGH_ACT;
- if (mode->Flags & V_PCSYNC)
- var->sync |= FB_SYNC_COMP_HIGH_ACT;
-#if 1 /* Badly needed for PAL/NTSC on Amiga (amifb)!! [geert] */
- if (mode->Flags & V_BCAST)
- var->sync |= FB_SYNC_BROADCAST;
-#endif
- if (mode->Flags & V_INTERLACE)
- var->vmode = FB_VMODE_INTERLACED;
- else if (mode->Flags & V_DBLSCAN)
- var->vmode = FB_VMODE_DOUBLE;
- else
- var->vmode = FB_VMODE_NONINTERLACED;
-}
-
-static void
-fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode)
-{
- mode->Clock = var->pixclock ? 1000000000/var->pixclock : 28000000;
- mode->HDisplay = var->xres;
- mode->HSyncStart = mode->HDisplay+var->right_margin;
- mode->HSyncEnd = mode->HSyncStart+var->hsync_len;
- mode->HTotal = mode->HSyncEnd+var->left_margin;
- mode->VDisplay = var->yres;
- mode->VSyncStart = mode->VDisplay+var->lower_margin;
- mode->VSyncEnd = mode->VSyncStart+var->vsync_len;
- mode->VTotal = mode->VSyncEnd+var->upper_margin;
- mode->Flags = 0;
- mode->Flags |= var->sync & FB_SYNC_HOR_HIGH_ACT ? V_PHSYNC : V_NHSYNC;
- mode->Flags |= var->sync & FB_SYNC_VERT_HIGH_ACT ? V_PVSYNC : V_NVSYNC;
- mode->Flags |= var->sync & FB_SYNC_COMP_HIGH_ACT ? V_PCSYNC : V_NCSYNC;
-#if 1 /* Badly needed for PAL/NTSC on Amiga (amifb)!! [geert] */
- if (var->sync & FB_SYNC_BROADCAST)
- mode->Flags |= V_BCAST;
-#endif
- if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED)
- mode->Flags |= V_INTERLACE;
- else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE)
- mode->Flags |= V_DBLSCAN;
- mode->SynthClock = mode->Clock;
- mode->CrtcHDisplay = mode->HDisplay;
- mode->CrtcHSyncStart = mode->HSyncStart;
- mode->CrtcHSyncEnd = mode->HSyncEnd;
- mode->CrtcHTotal = mode->HTotal;
- mode->CrtcVDisplay = mode->VDisplay;
- mode->CrtcVSyncStart = mode->VSyncStart;
- mode->CrtcVSyncEnd = mode->VSyncEnd;
- mode->CrtcVTotal = mode->VTotal;
- mode->CrtcHAdjusted = FALSE;
- mode->CrtcVAdjusted = FALSE;
-}
-
-
-/* -------------------------------------------------------------------- */
-/* open correct framebuffer device */
-
-/* try to find the framebuffer device for a given PCI device */
-static int
-fbdev_open_pci(pciVideoPtr pPci, char **namep)
-{
- struct fb_fix_screeninfo fix;
- char filename[16];
- int fd,i,j;
- memType res_start, res_end;
-
- for (i = 0; i < 8; i++) {
- sprintf(filename,"/dev/fb%d",i);
- if (-1 == (fd = open(filename,O_RDWR,0))) {
- xf86DrvMsg(-1, X_WARNING,
- "open %s: %s\n", filename, strerror(errno));
- continue;
- }
- if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) {
- close(fd);
- continue;
- }
- for (j = 0; j < 6; j++) {
- res_start = pPci->memBase[j];
- res_end = res_start+pPci->size[j];
- if ((0 != fix.smem_len &&
- (memType) fix.smem_start >= res_start &&
- (memType) fix.smem_start < res_end) ||
- (0 != fix.mmio_len &&
- (memType) fix.mmio_start >= res_start &&
- (memType) fix.mmio_start < res_end))
- break;
- }
- if (j == 6) {
- close(fd);
- continue;
- }
- if (namep) {
- *namep = xnfalloc(16);
- strncpy(*namep,fix.id,16);
- }
- return fd;
- }
- if (namep)
- *namep = NULL;
- return -1;
-}
-
-static int
-fbdev_open(int scrnIndex, char *dev, char** namep)
-{
- struct fb_fix_screeninfo fix;
- int fd;
-
- /* try argument (from XF86Config) first */
- if (dev) {
- fd = open(dev,O_RDWR,0);
- } else {
- /* second: environment variable */
- dev = getenv("FRAMEBUFFER");
- if ((NULL == dev) || ((fd = open(dev,O_RDWR,0)) == -1)) {
- /* last try: default device */
- dev = "/dev/fb0";
- fd = open(dev,O_RDWR,0);
- }
- }
-
- if (fd == -1) {
- xf86DrvMsg(scrnIndex, X_ERROR,
- "open %s: %s\n", dev, strerror(errno));
- return -1;
- }
-
- if (namep) {
- if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)(&fix))) {
- *namep = NULL;
- xf86DrvMsg(scrnIndex, X_ERROR,
- "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
- return -1;
- } else {
- *namep = xnfalloc(16);
- strncpy(*namep,fix.id,16);
- }
- }
- return fd;
-}
-
-/* -------------------------------------------------------------------- */
-
-Bool
-fbdevHWProbe(pciVideoPtr pPci, char *device,char **namep)
-{
- int fd;
-
- if (pPci)
- fd = fbdev_open_pci(pPci,namep);
- else
- fd = fbdev_open(-1,device,namep);
-
- if (-1 == fd)
- return FALSE;
- close(fd);
- return TRUE;
-}
-
-Bool
-fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device)
-{
- fbdevHWPtr fPtr;
-
- TRACE_ENTER("Init");
-
- fbdevHWGetRec(pScrn);
- fPtr = FBDEVHWPTR(pScrn);
-
- /* open device */
- if (pPci)
- fPtr->fd = fbdev_open_pci(pPci,NULL);
- else
- fPtr->fd = fbdev_open(pScrn->scrnIndex,device,NULL);
- if (-1 == fPtr->fd) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to open framebuffer device, consult warnings"
- " and/or errors above for possible reasons\n"
- "\t(you may have to look at the server log to see"
- " warnings)\n");
- return FALSE;
- }
-
- /* get current fb device settings */
- if (-1 == ioctl(fPtr->fd,FBIOGET_FSCREENINFO,(void*)(&fPtr->fix))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "ioctl FBIOGET_FSCREENINFO: %s\n",
- strerror(errno));
- return FALSE;
- }
- if (-1 == ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "ioctl FBIOGET_VSCREENINFO: %s\n",
- strerror(errno));
- return FALSE;
- }
-
- /* we can use the current settings as "buildin mode" */
- fbdev2xfree_timing(&fPtr->var, &fPtr->buildin);
- fPtr->buildin.name = "current";
- fPtr->buildin.next = &fPtr->buildin;
- fPtr->buildin.prev = &fPtr->buildin;
- fPtr->buildin.type |= M_T_BUILTIN;
-
- return TRUE;
-}
-
-char*
-fbdevHWGetName(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- return fPtr->fix.id;
-}
-
-int
-fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- if (fbbpp)
- *fbbpp = fPtr->var.bits_per_pixel;
-
- if (fPtr->fix.visual == FB_VISUAL_TRUECOLOR ||
- fPtr->fix.visual == FB_VISUAL_DIRECTCOLOR)
- return fPtr->var.red.length+fPtr->var.green.length+
- fPtr->var.blue.length;
- else
- return fPtr->var.bits_per_pixel;
-}
-
-int
-fbdevHWGetLineLength(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- if (fPtr->fix.line_length)
- return fPtr->fix.line_length;
- else
- return fPtr->var.xres_virtual*fPtr->var.bits_per_pixel/8;
-}
-
-int
-fbdevHWGetType(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- return fPtr->fix.type;
-}
-
-int
-fbdevHWGetVidmem(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- return fPtr->fix.smem_len;
-}
-
-void
-fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- int virtX = pScrn->display->virtualX;
- int virtY = pScrn->display->virtualY;
- struct fb_var_screeninfo var;
- char **modename;
- DisplayModePtr mode,this,last = pScrn->modes;
-
- TRACE_ENTER("VerifyModes");
- if (NULL == pScrn->display->modes)
- return;
-
- for (modename = pScrn->display->modes; *modename != NULL; modename++) {
- for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next)
- if (0 == strcmp(mode->name,*modename))
- break;
- if (NULL == mode) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "\tmode \"%s\" not found\n", *modename);
- continue;
- }
- memset(&var,0,sizeof(var));
- xfree2fbdev_timing(mode,&var);
- var.xres_virtual = virtX;
- var.yres_virtual = virtY;
- var.bits_per_pixel = pScrn->bitsPerPixel;
- var.red.length = pScrn->weight.red;
- var.green.length = pScrn->weight.green;
- var.blue.length = pScrn->weight.blue;
-
- var.activate = FB_ACTIVATE_TEST;
- if (var.xres_virtual < var.xres) var.xres_virtual = var.xres;
- if (var.yres_virtual < var.yres) var.yres_virtual = var.yres;
- if (-1 == ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&var))) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "\tmode \"%s\" test failed\n", *modename);
- continue;
- }
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "\tmode \"%s\" ok\n", *modename);
- if (virtX < var.xres) virtX = var.xres;
- if (virtY < var.yres) virtY = var.yres;
- if (NULL == pScrn->modes) {
- pScrn->modes = xnfalloc(sizeof(DisplayModeRec));
- this = pScrn->modes;
- memcpy(this,mode,sizeof(DisplayModeRec));
- this->next = this;
- this->prev = this;
- } else {
- this = xnfalloc(sizeof(DisplayModeRec));
- memcpy(this,mode,sizeof(DisplayModeRec));
- this->next = pScrn->modes;
- this->prev = last;
- last->next = this;
- pScrn->modes->prev = this;
- }
- last = this;
- }
- pScrn->virtualX = virtX;
- pScrn->virtualY = virtY;
-}
-
-DisplayModePtr
-fbdevHWGetBuildinMode(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- return &fPtr->buildin;
-}
-
-void
-fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("UseBuildinMode");
- pScrn->modes = &fPtr->buildin;
- pScrn->virtualX = pScrn->display->virtualX;
- pScrn->virtualY = pScrn->display->virtualY;
- if (pScrn->virtualX < fPtr->buildin.HDisplay)
- pScrn->virtualX = fPtr->buildin.HDisplay;
- if (pScrn->virtualY < fPtr->buildin.VDisplay)
- pScrn->virtualY = fPtr->buildin.VDisplay;
-}
-
-/* -------------------------------------------------------------------- */
-
-static void
-calculateFbmem_len(fbdevHWPtr fPtr)
-{
- fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK;
- fPtr->fbmem_len = (fPtr->fboff+fPtr->fix.smem_len+~PAGE_MASK) &
- PAGE_MASK;
-}
-
-
-void*
-fbdevHWMapVidmem(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("MapVidmem");
- if (NULL == fPtr->fbmem) {
- calculateFbmem_len(fPtr);
- fPtr->fbmem = mmap(NULL, fPtr->fbmem_len, PROT_READ | PROT_WRITE,
- MAP_SHARED, fPtr->fd, 0);
- if (-1 == (long)fPtr->fbmem) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "mmap fbmem: %s\n", strerror(errno));
- fPtr->fbmem = NULL;
- } else {
- /* Perhaps we'd better add fboff to fbmem and return 0 in
- fbdevHWLinearOffset()? Of course we then need to mask
- fPtr->fbmem with PAGE_MASK in fbdevHWUnmapVidmem() as
- well. [geert] */
- }
- }
- pScrn->memPhysBase = (unsigned long)fPtr->fix.smem_start & (unsigned long)(PAGE_MASK);
- pScrn->fbOffset = (unsigned long)fPtr->fix.smem_start & (unsigned long)(~PAGE_MASK);
- return fPtr->fbmem;
-}
-
-int
-fbdevHWLinearOffset(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("LinearOffset");
- return fPtr->fboff;
-}
-
-Bool
-fbdevHWUnmapVidmem(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("UnmapVidmem");
- if (NULL != fPtr->fbmem) {
- if (-1 == munmap(fPtr->fbmem, fPtr->fbmem_len))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "munmap fbmem: %s\n", strerror(errno));
- fPtr->fbmem = NULL;
- }
- return TRUE;
-}
-
-void*
-fbdevHWMapMMIO(ScrnInfoPtr pScrn)
-{
- unsigned int mmio_off;
-
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("MapMMIO");
- if (NULL == fPtr->mmio) {
- /* tell the kernel not to use accels to speed up console scrolling */
- fPtr->var.accel_flags = 0;
- if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
- return FALSE;
- }
- mmio_off = (unsigned long) fPtr->fix.mmio_start & ~PAGE_MASK;
- fPtr->mmio_len = (mmio_off+fPtr->fix.mmio_len+~PAGE_MASK) &
- PAGE_MASK;
- if (NULL == fPtr->fbmem)
- calculateFbmem_len(fPtr);
- fPtr->mmio = mmap(NULL, fPtr->mmio_len, PROT_READ | PROT_WRITE,
- MAP_SHARED, fPtr->fd, fPtr->fbmem_len);
- if (-1 == (long)fPtr->mmio) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "mmap mmio: %s\n", strerror(errno));
- fPtr->mmio = NULL;
- } else
- fPtr->mmio += mmio_off;
- }
- return fPtr->mmio;
-}
-
-Bool
-fbdevHWUnmapMMIO(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("UnmapMMIO");
- if (NULL != fPtr->mmio) {
- if (-1 == munmap((void *)((unsigned long)fPtr->mmio & PAGE_MASK), fPtr->mmio_len))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "munmap mmio: %s\n", strerror(errno));
- fPtr->mmio = NULL;
- /* FIXME: restore var.accel_flags [geert] */
- }
- return TRUE;
-}
-
-/* -------------------------------------------------------------------- */
-
-Bool
-fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("ModeInit");
- xfree2fbdev_fblayout(pScrn, &fPtr->var);
- xfree2fbdev_timing(mode, &fPtr->var);
-#if DEBUG
- print_xfree_mode("init",mode);
- print_fbdev_mode("init",&fPtr->var);
-#endif
- pScrn->vtSema = TRUE;
-
- /* set */
- if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
- return FALSE;
- }
- /* read back */
- if (0 != ioctl(fPtr->fd,FBIOGET_FSCREENINFO,(void*)(&fPtr->fix))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
- return FALSE;
- }
- if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
- return FALSE;
- }
- return TRUE;
-}
-
-/* -------------------------------------------------------------------- */
-/* video mode save/restore */
-
-/* TODO: colormap */
-void
-fbdevHWSave(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("Save");
- if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->saved_var)))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
-}
-
-void
-fbdevHWRestore(ScrnInfoPtr pScrn)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("Restore");
- if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->saved_var)))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
-}
-
-/* -------------------------------------------------------------------- */
-/* callback for xf86HandleColormaps */
-
-void
-fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- struct fb_cmap cmap;
- unsigned short red,green,blue;
- int i;
-
- TRACE_ENTER("ModeInit");
- cmap.len = 1;
- cmap.red = &red;
- cmap.green = &green;
- cmap.blue = &blue;
- cmap.transp = NULL;
- for (i = 0; i < numColors; i++) {
- cmap.start = indices[i];
- red = (colors[indices[i]].red << 8) |
- colors[indices[i]].red;
- green = (colors[indices[i]].green << 8) |
- colors[indices[i]].green;
- blue = (colors[indices[i]].blue << 8) |
- colors[indices[i]].blue;
- if (-1 == ioctl(fPtr->fd,FBIOPUTCMAP,(void*)&cmap))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOPUTCMAP: %s\n", strerror(errno));
- }
-}
-
-/* -------------------------------------------------------------------- */
-/* these can be hooked directly into ScrnInfoRec */
-
-ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- struct fb_var_screeninfo var;
-
- TRACE_ENTER("ValidMode");
- memcpy(&var,&fPtr->var,sizeof(var));
- xfree2fbdev_timing(mode, &var);
- var.activate = FB_ACTIVATE_TEST;
- if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(scrnIndex, X_ERROR,
- "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
- return MODE_BAD;
- }
- return MODE_OK;
-}
-
-Bool
-fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("SwitchMode");
- xfree2fbdev_timing(mode, &fPtr->var);
- if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
- xf86DrvMsg(scrnIndex, X_ERROR,
- "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
- return FALSE;
- }
- return TRUE;
-}
-
-void
-fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
-
- TRACE_ENTER("AdjustFrame");
-
- if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
- y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
- return;
-
- fPtr->var.xoffset = x;
- fPtr->var.yoffset = y;
- if (-1 == ioctl(fPtr->fd,FBIOPAN_DISPLAY,(void*)&fPtr->var))
- xf86DrvMsgVerb(scrnIndex,5, X_WARNING,
- "FBIOPAN_DISPLAY: %s\n", strerror(errno));
-}
-
-Bool
-fbdevHWEnterVT(int scrnIndex, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
- TRACE_ENTER("EnterVT");
- if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
- return FALSE;
- fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
- return TRUE;
-}
-
-void
-fbdevHWLeaveVT(int scrnIndex, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
- TRACE_ENTER("LeaveVT");
- fbdevHWRestore(pScrn);
-}
-
-void
-fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
-{
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- unsigned long fbmode;
-
- if (!pScrn->vtSema)
- return;
-
- switch (mode) {
- case DPMSModeOn:
- fbmode = 0;
- break;
- case DPMSModeStandby:
- fbmode = 2;
- break;
- case DPMSModeSuspend:
- fbmode = 3;
- break;
- case DPMSModeOff:
- fbmode = 4;
- break;
- default:
- return;
- }
-
- if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *)fbmode))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
-}
-
-Bool
-fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
- unsigned long unblank;
-
- if (!pScrn->vtSema)
- return TRUE;
-
- unblank = xf86IsUnblank(mode);
-
- if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *)(1-unblank))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
deleted file mode 100644
index cfc47f905..000000000
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.12 2003/10/30 17:37:16 tsi Exp $ */
-
-#ifndef _FBDEVHW_H_
-#define _FBDEVHW_H_
-
-#include "xf86str.h"
-#include "colormapst.h"
-
-#define FBDEVHW_PACKED_PIXELS 0 /* Packed Pixels */
-#define FBDEVHW_PLANES 1 /* Non interleaved planes */
-#define FBDEVHW_INTERLEAVED_PLANES 2 /* Interleaved planes */
-#define FBDEVHW_TEXT 3 /* Text/attributes */
-#define FBDEVHW_VGA_PLANES 4 /* EGA/VGA planes */
-
-Bool fbdevHWGetRec(ScrnInfoPtr pScrn);
-void fbdevHWFreeRec(ScrnInfoPtr pScrn);
-
-Bool fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep);
-Bool fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device);
-
-char* fbdevHWGetName(ScrnInfoPtr pScrn);
-int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp);
-int fbdevHWGetLineLength(ScrnInfoPtr pScrn);
-int fbdevHWGetType(ScrnInfoPtr pScrn);
-int fbdevHWGetVidmem(ScrnInfoPtr pScrn);
-
-void* fbdevHWMapVidmem(ScrnInfoPtr pScrn);
-int fbdevHWLinearOffset(ScrnInfoPtr pScrn);
-Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn);
-void* fbdevHWMapMMIO(ScrnInfoPtr pScrn);
-Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn);
-
-void fbdevHWSetVideoModes(ScrnInfoPtr pScrn);
-DisplayModePtr fbdevHWGetBuildinMode(ScrnInfoPtr pScrn);
-void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn);
-Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
-void fbdevHWSave(ScrnInfoPtr pScrn);
-void fbdevHWRestore(ScrnInfoPtr pScrn);
-
-void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual);
-
-ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
-Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
-void fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags);
-Bool fbdevHWEnterVT(int scrnIndex, int flags);
-void fbdevHWLeaveVT(int scrnIndex, int flags);
-void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
-
-Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
-
-#endif
diff --git a/hw/xfree86/fbdevhw/fbdevhw.man.pre b/hw/xfree86/fbdevhw/fbdevhw.man.pre
deleted file mode 100644
index dadc1f9a3..000000000
--- a/hw/xfree86/fbdevhw/fbdevhw.man.pre
+++ /dev/null
@@ -1,21 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.2 2001/01/27 18:20:56 dawes Exp $
-.TH FBDEVHW __drivermansuffix__ __vendorversion__
-.SH NAME
-fbdevhw \- os-specific submodule for framebuffer device access
-.SH DESCRIPTION
-.B fbdevhw
-provides functions for talking to a framebuffer device. It is
-os-specific. It is a submodule used by other video drivers.
-A
-.B fbdevhw
-module is currently available for linux framebuffer devices.
-.PP
-fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the
-fbdevhw module. fbdevhw can be used by other drivers too, this
-is usually activated with `Option "UseFBDev"' in the device section.
-.SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__),
-fbdev(__drivermansuffix__)
-.SH AUTHORS
-Authors include: Gerd Knorr, based on the XF68_FBDev Server code
-(Martin Schaller, Geert Uytterhoeven).
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
deleted file mode 100644
index b262be90f..000000000
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.13 2003/10/30 17:37:16 tsi Exp $ */
-
-#include "xf86.h"
-#include "xf86cmap.h"
-#include "fbdevhw.h"
-
-/* Stubs for the static server on platforms that don't support fbdev */
-
-
-Bool
-fbdevHWGetRec(ScrnInfoPtr pScrn)
-{
- return FALSE;
-}
-
-void
-fbdevHWFreeRec(ScrnInfoPtr pScrn)
-{
-}
-
-
-Bool
-fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep)
-{
- return FALSE;
-}
-
-Bool
-fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device)
-{
- xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n");
- return FALSE;
-}
-
-char*
-fbdevHWGetName(ScrnInfoPtr pScrn)
-{
- return NULL;
-}
-
-int
-fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp)
-{
- return -1;
-}
-
-int
-fbdevHWGetLineLength(ScrnInfoPtr pScrn)
-{
- return -1; /* Should cause something spectacular... */
-}
-
-int
-fbdevHWGetType(ScrnInfoPtr pScrn)
-{
- return -1;
-}
-
-int
-fbdevHWGetVidmem(ScrnInfoPtr pScrn)
-{
- return -1;
-}
-
-void
-fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
-{
-}
-
-DisplayModePtr
-fbdevHWGetBuildinMode(ScrnInfoPtr pScrn)
-{
- return NULL;
-}
-
-void
-fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
-{
-}
-
-void*
-fbdevHWMapVidmem(ScrnInfoPtr pScrn)
-{
- return NULL;
-}
-
-int
-fbdevHWLinearOffset(ScrnInfoPtr pScrn)
-{
- return 0;
-}
-
-Bool
-fbdevHWUnmapVidmem(ScrnInfoPtr pScrn)
-{
- return FALSE;
-}
-
-void*
-fbdevHWMapMMIO(ScrnInfoPtr pScrn)
-{
- return NULL;
-}
-
-Bool
-fbdevHWUnmapMMIO(ScrnInfoPtr pScrn)
-{
- return FALSE;
-}
-
-Bool
-fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- return FALSE;
-}
-
-void
-fbdevHWSave(ScrnInfoPtr pScrn)
-{
-}
-
-void
-fbdevHWRestore(ScrnInfoPtr pScrn)
-{
-}
-
-void
-fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual)
-{
-}
-
-ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
-{
- return MODE_ERROR;
-}
-
-Bool
-fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
-{
- return FALSE;
-}
-
-void
-fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
-{
-}
-
-Bool
-fbdevHWEnterVT(int scrnIndex, int flags)
-{
- return FALSE;
-}
-
-void
-fbdevHWLeaveVT(int scrnIndex, int flags)
-{
-}
-
-void
-fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
-{
-}
-
-Bool
-fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/fbdevhw/fbpriv.h b/hw/xfree86/fbdevhw/fbpriv.h
deleted file mode 100644
index d651e5129..000000000
--- a/hw/xfree86/fbdevhw/fbpriv.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * copyed from from linux kernel 2.2.4
- * removed internal stuff (#ifdef __KERNEL__)
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbpriv.h,v 1.3 2000/08/11 17:27:14 dawes Exp $ */
-
-#ifndef _LINUX_FB_H
-#define _LINUX_FB_H
-
-#include <asm/types.h>
-
-/* Definitions of frame buffers */
-
-#define FB_MAJOR 29
-
-#define FB_MODES_SHIFT 5 /* 32 modes per framebuffer */
-#define FB_NUM_MINORS 256 /* 256 Minors */
-#define FB_MAX (FB_NUM_MINORS / (1 << FB_MODES_SHIFT))
-#define GET_FB_IDX(node) (MINOR(node) >> FB_MODES_SHIFT)
-
-/* ioctls
- 0x46 is 'F' */
-#define FBIOGET_VSCREENINFO 0x4600
-#define FBIOPUT_VSCREENINFO 0x4601
-#define FBIOGET_FSCREENINFO 0x4602
-#define FBIOGETCMAP 0x4604
-#define FBIOPUTCMAP 0x4605
-#define FBIOPAN_DISPLAY 0x4606
-/* 0x4607-0x460B are defined below */
-/* #define FBIOGET_MONITORSPEC 0x460C */
-/* #define FBIOPUT_MONITORSPEC 0x460D */
-/* #define FBIOSWITCH_MONIBIT 0x460E */
-#define FBIOGET_CON2FBMAP 0x460F
-#define FBIOPUT_CON2FBMAP 0x4610
-#define FBIOBLANK 0x4611
-
-#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
-#define FB_TYPE_PLANES 1 /* Non interleaved planes */
-#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
-#define FB_TYPE_TEXT 3 /* Text/attributes */
-
-#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
-#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
-#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
-#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
-#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
-
-#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
-#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
-#define FB_VISUAL_TRUECOLOR 2 /* True color */
-#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
-#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
-#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
-
-#define FB_ACCEL_NONE 0 /* no hardware accelerator */
-#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
-#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
-#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
-#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
-#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
-#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
-#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
-#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
-#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
-#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
-#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
-#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
-#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
-#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
-#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
-#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
-#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
-#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
-#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
-#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
-#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
-#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
-#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
-#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
-#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
-#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
-#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
-#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
-#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
-#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
-#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
-#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
-
-struct fb_fix_screeninfo {
- char id[16]; /* identification string eg "TT Builtin" */
- char *smem_start; /* Start of frame buffer mem */
- /* (physical address) */
- __u32 smem_len; /* Length of frame buffer mem */
- __u32 type; /* see FB_TYPE_* */
- __u32 type_aux; /* Interleave for interleaved Planes */
- __u32 visual; /* see FB_VISUAL_* */
- __u16 xpanstep; /* zero if no hardware panning */
- __u16 ypanstep; /* zero if no hardware panning */
- __u16 ywrapstep; /* zero if no hardware ywrap */
- __u32 line_length; /* length of a line in bytes */
- char *mmio_start; /* Start of Memory Mapped I/O */
- /* (physical address) */
- __u32 mmio_len; /* Length of Memory Mapped I/O */
- __u32 accel; /* Type of acceleration available */
- __u16 reserved[3]; /* Reserved for future compatibility */
-};
-
-/* Interpretation of offset for color fields: All offsets are from the right,
- * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
- * can use the offset as right argument to <<). A pixel afterwards is a bit
- * stream and is written to video memory as that unmodified. This implies
- * big-endian byte order if bits_per_pixel is greater than 8.
- */
-struct fb_bitfield {
- __u32 offset; /* beginning of bitfield */
- __u32 length; /* length of bitfield */
- __u32 msb_right; /* != 0 : Most significant bit is */
- /* right */
-};
-
-#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
-
-#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
-#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
-#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
-#define FB_ACTIVATE_MASK 15
- /* values */
-#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
-#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
-#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
-
-#define FB_ACCELF_TEXT 1 /* text mode acceleration */
-
-#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
-#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
-#define FB_SYNC_EXT 4 /* external sync */
-#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
-#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
- /* vtotal = 144d/288n/576i => PAL */
- /* vtotal = 121d/242n/484i => NTSC */
-#define FB_SYNC_ON_GREEN 32 /* sync on green */
-
-#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
-#define FB_VMODE_INTERLACED 1 /* interlaced */
-#define FB_VMODE_DOUBLE 2 /* double scan */
-#define FB_VMODE_MASK 255
-
-#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
-#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
-#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
-
-struct fb_var_screeninfo {
- __u32 xres; /* visible resolution */
- __u32 yres;
- __u32 xres_virtual; /* virtual resolution */
- __u32 yres_virtual;
- __u32 xoffset; /* offset from virtual to visible */
- __u32 yoffset; /* resolution */
-
- __u32 bits_per_pixel; /* guess what */
- __u32 grayscale; /* != 0 Graylevels instead of colors */
-
- struct fb_bitfield red; /* bitfield in fb mem if true color, */
- struct fb_bitfield green; /* else only length is significant */
- struct fb_bitfield blue;
- struct fb_bitfield transp; /* transparency */
-
- __u32 nonstd; /* != 0 Non standard pixel format */
-
- __u32 activate; /* see FB_ACTIVATE_* */
-
- __u32 height; /* height of picture in mm */
- __u32 width; /* width of picture in mm */
-
- __u32 accel_flags; /* acceleration flags (hints) */
-
- /* Timing: All values in pixclocks, except pixclock (of course) */
- __u32 pixclock; /* pixel clock in ps (pico seconds) */
- __u32 left_margin; /* time from sync to picture */
- __u32 right_margin; /* time from picture to sync */
- __u32 upper_margin; /* time from sync to picture */
- __u32 lower_margin;
- __u32 hsync_len; /* length of horizontal sync */
- __u32 vsync_len; /* length of vertical sync */
- __u32 sync; /* see FB_SYNC_* */
- __u32 vmode; /* see FB_VMODE_* */
- __u32 reserved[6]; /* Reserved for future compatibility */
-};
-
-struct fb_cmap {
- __u32 start; /* First entry */
- __u32 len; /* Number of entries */
- __u16 *red; /* Red values */
- __u16 *green;
- __u16 *blue;
- __u16 *transp; /* transparency, can be NULL */
-};
-
-struct fb_con2fbmap {
- __u32 console;
- __u32 framebuffer;
-};
-
-struct fb_monspecs {
- __u32 hfmin; /* hfreq lower limit (Hz) */
- __u32 hfmax; /* hfreq upper limit (Hz) */
- __u16 vfmin; /* vfreq lower limit (Hz) */
- __u16 vfmax; /* vfreq upper limit (Hz) */
- unsigned dpms : 1; /* supports DPMS */
-};
-
-#if 1
-
-#define FBCMD_GET_CURRENTPAR 0xDEAD0005
-#define FBCMD_SET_CURRENTPAR 0xDEAD8005
-
-#endif
-
-
-#if 1 /* Preliminary */
-
- /*
- * Hardware Cursor
- */
-
-#define FBIOGET_FCURSORINFO 0x4607
-#define FBIOGET_VCURSORINFO 0x4608
-#define FBIOPUT_VCURSORINFO 0x4609
-#define FBIOGET_CURSORSTATE 0x460A
-#define FBIOPUT_CURSORSTATE 0x460B
-
-
-struct fb_fix_cursorinfo {
- __u16 crsr_width; /* width and height of the cursor in */
- __u16 crsr_height; /* pixels (zero if no cursor) */
- __u16 crsr_xsize; /* cursor size in display pixels */
- __u16 crsr_ysize;
- __u16 crsr_color1; /* colormap entry for cursor color1 */
- __u16 crsr_color2; /* colormap entry for cursor color2 */
-};
-
-struct fb_var_cursorinfo {
- __u16 width;
- __u16 height;
- __u16 xspot;
- __u16 yspot;
- __u8 data[1]; /* field with [height][width] */
-};
-
-struct fb_cursorstate {
- __s16 xoffset;
- __s16 yoffset;
- __u16 mode;
-};
-
-#define FB_CURSOR_OFF 0
-#define FB_CURSOR_ON 1
-#define FB_CURSOR_FLASH 2
-
-#endif /* Preliminary */
-
-#endif /* _LINUX_FB_H */
diff --git a/hw/xfree86/getconfig/cfg.man.pre b/hw/xfree86/getconfig/cfg.man.pre
deleted file mode 100644
index fcf1a6161..000000000
--- a/hw/xfree86/getconfig/cfg.man.pre
+++ /dev/null
@@ -1,138 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/cfg.man,v 1.1 2003/11/12 04:52:15 dawes Exp $
-.TH getconfig __filemansuffix__ __vendorversion__
-.SH NAME
-getconfig - meta configuration files for getconfig(1)
-.SH SYNOPSIS
-.B \(**.cfg
-.SH DESCRIPTION
-.B getconfig
-is a programatic interface that is used by the
-.B XFree86
-server to get configuration information about video hardware when
-operating without an
-.B XF86Config
-file.
-.PP
-This implementation of
-.B getconfig
-is written in perl. It processes rules from meta-configuration files.
-All meta-configuration files have a
-.I .cfg
-suffix.
-.PP
-Lines starting with a pound-sign (#) are comments, and are ignored.
-Blank lines that consist only of white space are also treated as comments
-and ignored.
-.PP
-The first non-comment line must be a signature string followed by
-the file format version number. The signature string is
-.PP
-.RS 4
-.nf
-"XFree86 Project getconfig rules file.\ \ Version: "
-.fi
-.RE
-.PP
-The currently defined version is "1.0". Files that do not have the
-correct signature string are ignored.
-.PP
-The remaining non-comment lines define rules. The start of a new rule
-is indicated by a line with no leading white space. Subsequent lines
-making up a rule must be indented with white space. Logical lines within
-a rule may be split over multiple physical lines by using the usual
-continuation convention ('\e' at the end of the line). The first logical
-line of each rule is a perl expression. It may be any valid perl
-expression whose evaluated (with 'eval') result may be used as the
-argument to a perl 'if' statement. The second logical line should be
-the name of the XFree86 video driver to use when the rule is true, and
-subsequent logical lines of each rule, if present, are additional
-configuration output for the video device's
-.B XF86Config
-.B Device
-section. The driver name and additional lines of configuration information
-are written to standard output when the rule is chosen as the successful
-rule.
-.PP
-Pseudo rules consisting of perl expressions may be present in the file
-for the purpose of defining custom perl variables or setting the weight
-to use for the following rules. Pseudo rules are rules that consist of
-a single logical line only, and the are never candidates themselves for the
-successful rule.
-.PP
-Several perl variables are pre-defined, and may be used within rules.
-They include:
-.PP
-.RS 4
-.nf
-.BR "$vendor " "PCI vendor ID"
-.BR "$device " "PCI device ID"
-.BR "$revision " "PCI revision ID"
-.BR "$subsys " "PCI subsystem ID"
-.BR "$subsysVendor " "PCI subsystem vendor ID"
-.BR "$class " "PCI class"
-.BR "$XFree86Version " "XFree86 version, as a 'v' string"
-.BR "$XFree86VersionNumeric " "XFree86 numeric version"
-.BR "$XFree86VersionMajor " "XFree86 major version"
-.BR "$XFree86VersionMinor " "XFree86 minor version"
-.BR "$XFree86VersionPatch " "XFree86 patch version"
-.BR "$XFree86VersionSnap " "XFree86 snap version"
-.BR "$weight " "current rule weight"
-.fi
-.RE
-.PP
-The
-.B $weight
-variable deterines the weight of the rules as they are processed. The
-weight for subsequent rules may be set with a pseudo rule that sets or
-changes the value of
-.BR $weight .
-The default weight, and the weight used for built-in rules is 500. The
-meta-configuration files are processed in an unpredictable order. The
-weighting of the rules is used to determine their relative priority
-.PP
-After processing all of the rules, both built-in and those read from
-the meta-configration files, the
-.B getconfig
-program chooses as the successful rule the last and highest weighted
-rule that evaluates to true.
-.SH FILES
-.I .cfg
-files located in the search path. The search path typically specified
-by the
-.B XFree86
-server is:
-.PP
-.RS 4
-.nf
-.I /etc/X11
-.I __projectroot__/etc/X11
-.I <modulepath>
-.I __projectroot__/lib/X11/getconfig
-.fi
-.RE
-.PP
-where
-.I <modulepath>
-is the
-.B XFree86
-server's module search path.
-.PP
-.TP 30
-.I __projectroot__/lib/X11/getconfig/xfree86.cfg
-Default rules file that gets installed. This file doesn't contain any
-rules by default.
-.TP 30
-.I __projectroot__/lib/X11/getconfig/cfg.sample
-A sample rules file that gives some examples of what types of rules can
-appear in rules files.
-
-.SH "SEE ALSO"
-getconfig(1),
-XFree86(1),
-XF86Config(__filemansuffix__).
-
-.SH AUTHORS
-The XFree86 automatic configuration support and the
-.B getconfig
-interface was written by David H. Dawes, with the support of X-Oz
-Technologies.
diff --git a/hw/xfree86/getconfig/cfg.sample b/hw/xfree86/getconfig/cfg.sample
deleted file mode 100644
index acf262d1a..000000000
--- a/hw/xfree86/getconfig/cfg.sample
+++ /dev/null
@@ -1,111 +0,0 @@
-# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/cfg.sample,v 1.2 2003/09/23 05:12:07 dawes Exp $
-# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/cfg.sample,v 1.2 2003/11/12 04:52:15 dawes Exp $
-
-# Some sample XFree86 getconfig rules file.
-
-#
-# The line below is the getconfig rules file signature, and must be the
-# first non-blank, non-comment line.
-#
-
-XFree86 Project getconfig rules file. Version: 1.0
-
-#
-# Set the weight for the following rules. This should be set, otherwise
-# the previously set weight will get used, and you have no idea of knowing
-# what that might be.
-#
-
-$weight = 1000
-
-#
-# Rules. Rules consist of a condition (in perl code) followed by
-# a driver name and optionally some additional strings. The start of a
-# rule is indicated by a line with no leading white space. Subsequent
-# lines making up a rule must be indented. Logical lines may be split
-# over multiple physical lines by using the usual continuation '\'.
-#
-# Rules that are not followed by a driver name may be used to do other
-# things, like setting the weight as above.
-#
-
-#
-# Pre-defined variables include:
-#
-# $vendor PCI vendor ID
-# $device PCI device ID
-# $revision PCI revision ID
-# $subsys PCI subsystem ID
-# $subsysVendor PCI subsystem vendor ID
-# $class PCI class
-# $XFree86Version XFree86 version, as a 'v' string.
-#
-# The XFree86 version information is also available as the following:
-#
-# $XFree86VersionNumeric
-# $XFree86VersionMajor
-# $XFree86VersionMinor
-# $XFree86VersionPatch
-# $XFree86VersionSnap
-#
-
-# Define a fake vendor ID for some sample rules.
-
-$novendor = 0x10000
-$nodevice = 0x10000
-
-$vendor == $novendor
- nodriver
- Option "xx"
- Videoram 1000
-
-# A rule with continued lines.
-
-$vendor == $novendor && \
-$device == $nodevice
- nodriver2
- Option \
- "yy"
-
-# Increase the weight of the following rules if the XFree86 version is 4.3 or
-# higher.
-
-$weight++ if ($XFree86Version ge v4.3)
-
-$vendor == $novendor
- nodriver
- Option "yy"
-
-#
-# The weight can be changed at any times, and applies to rules that follow
-# until changed again.
-#
-
-$weight = 100
-
-$vendor == $novendor && $XFree86Version eq v4.3.2.1
- nodriver3
-
-$weight = 600
-
-#
-# The following two examples use some real values.
-#
-
-# Example: make the default depth 24 for Radeon R200 and RV200 cards.
-
-$vendor == 0x1002 && \
- ($device >= 0x5148 && $device <= 0x514F || \
- $device >= 0x5168 && $device <= 0x516C || \
- $device == 0x4242 || \
- $device >= 0x5157 && device <= 0x5158)
- ati
- Option "DefaultDepth" "24"
-
-
-# Example: enable DRI for MGA G400
-
-$vendor == 0x102b && $device == 0x0525
- mga
- Option "dri"
-
diff --git a/hw/xfree86/getconfig/getconfig b/hw/xfree86/getconfig/getconfig
deleted file mode 100644
index d2acc9bb8..000000000
--- a/hw/xfree86/getconfig/getconfig
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.sh,v 1.2 2003/09/20 01:45:57 dawes Exp $
-
-#
-# Copyright 2003 by David H. Dawes.
-# Copyright 2003 by X-Oz Technologies.
-# All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the copyright holder(s)
-# and author(s) shall not be used in advertising or otherwise to promote
-# the sale, use or other dealings in this Software without prior written
-# authorization from the copyright holder(s) and author(s).
-#
-# Author: David Dawes <dawes@XFree86.Org>.
-#
-
-# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.sh,v 1.1 2003/10/08 14:58:29 dawes Exp $
-
-# A simple wrapper to execute the real getconfig program. So long as perl
-# is in $PATH, we don't need to know where it is this way.
-
-if echo $0 | grep / >/dev/null 2>&1; then
- DIR=`dirname $0`/
-fi
-
-exec perl ${DIR}getconfig.pl "$@"
diff --git a/hw/xfree86/getconfig/getconfig.man.pre b/hw/xfree86/getconfig/getconfig.man.pre
deleted file mode 100644
index 16c472fc5..000000000
--- a/hw/xfree86/getconfig/getconfig.man.pre
+++ /dev/null
@@ -1,98 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.man,v 1.1 2003/11/12 04:52:15 dawes Exp $
-.TH getconfig 1 __vendorversion__
-.SH NAME
-getconfig - get configuration information for the XFree86 server
-.SH SYNOPSIS
-.B getconfig
-.RI [ option
-.IR ... ]
-.SH DESCRIPTION
-.B getconfig
-is a programatic interface that is used by the
-.B XFree86
-server to get configuration information about video hardware when
-operating without an
-.B XF86Config
-file.
-.PP
-This implementation of
-.B getconfig
-is written in perl. It processes a prioritized and ordered list of
-rules supplied internally and from meta-configuration files. The rules
-are in the form of perl expressions.
-.B getconfig
-writes to standard output the XF86Config-style configuration data
-specified by the last highest priority rule that evaluates to true.
-Information about the format of the meta-configuration files can be
-found in the getconfig(__filemansuffix__) manual page.
-.SH OPTIONS
-.TP 8
-.BI \-I " search-path"
-Specify the search path to use for meta-config files.
-.I search-path
-is a comma-separated list of directories to search. Each directory in
-the search path is searched for files with a
-.I .cfg
-suffix. Each such file is opened and checked for a valid signature
-string. Rules are read from files with a valid signature string and
-appended to the list of rules to evaluate. If no search path is specified,
-only the internally supplied configuration rules will be used.
-.TP 8
-.B \-D
-Enable debugging output.
-.TP 8
-.B \-V
-Print out the version information and exit.
-.TP 8
-.BI \-X " XFree86-version"
-Specify the XFree86 version in numeric (integer) form.
-.TP 8
-.BI \-b " subsys-id"
-Specify the PCI subsystem ID of the video device.
-.TP 8
-.BI \-c " class"
-Specify the PCI class of the video device.
-.TP 8
-.BI \-d " device-id"
-Specify the PCI devide ID of the video device.
-.TP 8
-.BI \-r " revision"
-Specify the PCI revision of the video device.
-.TP 8
-.BI \-s " subsysvendor-id"
-Specify the PCI subsystem vendor ID of the video device.
-.TP 8
-.BI \-v " vendor-id"
-Specify the PCI vendor ID of the video device.
-.SH FILES
-.I .cfg
-files located in the search path. The search path typically specified
-by the
-.B XFree86
-server is:
-.PP
-.RS 4
-.nf
-.I /etc/X11
-.I __projectroot__/etc/X11
-.I <modulepath>
-.I __projectroot__/lib/X11/getconfig
-.fi
-.RE
-.PP
-where
-.I <modulepath>
-is the
-.B XFree86
-server's module search path.
-
-.SH "SEE ALSO"
-getconfig(__filemansuffix__),
-XFree86(1),
-XF86Config(__filemansuffix__).
-
-.SH AUTHORS
-The XFree86 automatic configuration support and the
-.B getconfig
-interface was written by David H. Dawes, with the support of X-Oz
-Technologies.
diff --git a/hw/xfree86/getconfig/getconfig.pl b/hw/xfree86/getconfig/getconfig.pl
deleted file mode 100644
index fcfd7d057..000000000
--- a/hw/xfree86/getconfig/getconfig.pl
+++ /dev/null
@@ -1,429 +0,0 @@
-#!/usr/bin/perl
-
-# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.pl,v 1.13 2003/09/23 05:12:07 dawes Exp $
-
-#
-# Copyright 2003 by David H. Dawes.
-# Copyright 2003 by X-Oz Technologies.
-# All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the copyright holder(s)
-# and author(s) shall not be used in advertising or otherwise to promote
-# the sale, use or other dealings in this Software without prior written
-# authorization from the copyright holder(s) and author(s).
-#
-# Author: David Dawes <dawes@XFree86.Org>.
-#
-
-# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.pl,v 1.1 2003/10/08 14:58:29 dawes Exp $
-
-#
-# This script takes PCI id information, compares it against an ordered list
-# of rules, and prints out the configuration information specified by the
-# last matching rule.
-#
-# This script is called by xf86AutoConfig().
-#
-
-# Command line processing.
-
-$GetconfigVersion = v1.0;
-
-$debug = 0;
-
-$myname = $0;
-$myname =~ s/.*\///;
-
-$signature = "XFree86 Project getconfig rules file. Version: ";
-
-while (@ARGV[0] =~ /^-[A-Za-z]$/) {
- $f = shift;
- SWITCH: {
- if ($f eq "-D") {
- $debug = 1;
- last SWITCH;
- }
- if ($f eq "-I") {
- push(@searchPaths, split(/,/, shift));
- last SWITCH;
- }
- if ($f eq "-V") {
- printf STDERR "$myname: Version %vd.\n", $GetconfigVersion;
- exit 0;
- }
- if ($f eq "-X") {
- $XFree86VersionNumeric = shift;
- if (!defined($XFree86VersionNumeric)) {
- print STDERR "$myname: -X requires the XFree86 version.\n";
- exit 1;
- }
- }
- if ($f eq "-b") {
- $subsys = oct(shift);
- if (!defined($subsys)) {
- print STDERR "$myname: -b requires the subsys id.\n";
- exit 1;
- }
- last SWITCH;
- }
- if ($f eq "-c") {
- $class = oct(shift);
- if (!defined($class)) {
- print STDERR "$myname: -c requires the class value.\n";
- exit 1;
- }
- last SWITCH;
- }
- if ($f eq "-d") {
- $device = oct(shift);
- if (!defined($device)) {
- print STDERR "$myname: -d requires the device id.\n";
- exit 1;
- }
- last SWITCH;
- }
- if ($f eq "-r") {
- $revision = oct(shift);
- if (!defined($revision)) {
- print STDERR "$myname: -r requires the device revision.\n";
- exit 1;
- }
- last SWITCH;
- }
- if ($f eq "-s") {
- $subsysVendor = oct(shift);
- if (!defined($subsysVendor)) {
- print STDERR "$myname: -s requires the subsysVendor id.\n";
- exit 1;
- }
- last SWITCH;
- }
- if ($f eq "-v") {
- $vendor = oct(shift);
- if (!defined($vendor)) {
- print STDERR "$myname: -v requires the vendor id.\n";
- exit 1;
- }
- last SWITCH;
- }
- }
-}
-
-printf STDERR "$myname: Version %vd.\n", $GetconfigVersion;
-
-if (defined($XFree86VersionNumeric)) {
- $XFree86VersionMajor = $XFree86VersionNumeric / 10000000;
- $XFree86VersionMinor = ($XFree86VersionNumeric % 10000000) / 100000;
- $XFree86VersionPatch = ($XFree86VersionNumeric % 100000) / 1000;
- $XFree86VersionSnapshot = $XFree86VersionNumeric % 1000;
- $XFree86Version = chr($XFree86VersionMajor) . chr($XFree86VersionMinor) .
- chr($XFree86VersionPatch) . chr($XFree86VersionSnapshot);
-}
-
-if ($debug) {
- printf STDERR "$myname: XFree86 Version: %d, %d.%d.%d.%d, %vd.\n",
- $XFree86VersionNumeric, $XFree86VersionMajor, $XFree86VersionMinor,
- $XFree86VersionPatch, $XFree86VersionSnapshot, $XFree86Version;
-} else {
- printf STDERR "$myname: XFree86 Version: %vd.\n", $XFree86Version;
-}
-
-
-# The rules here are just basic vendor ID to driver mappings.
-# Ideally this is all that would be required. More complicated configuration
-# rules will be provided in external files.
-
-# XXX This set of basic rules isn't complete yet.
-
-@rules = (
-
-# Set the weight for the built-in rules.
-['$weight = 500'],
-
-# APM
-['$vendor == 0x1142',
- 'apm'],
-
-# ARK
-['$vendor == 0xedd8',
- 'apm'],
-
-# ATI
-['$vendor == 0x1002',
- 'ati'],
-
-# Chips & Technologies
-['$vendor == 0x102c',
- 'chips'],
-
-# Cirrus
-['$vendor == 0x1013',
- 'cirrus'],
-
-# Intel
-['$vendor == 0x8086',
- 'i810'],
-['$vendor == 0x8086 && ($chipType == 0x00d1 || $chipType == 0x7800)',
- 'i740'],
-
-# Matrox
-['$vendor == 0x102b',
- 'mga'],
-
-# Neomagic
-['$vendor == 0x10c8',
- 'neomagic'],
-
-# Number Nine
-['$vendor == 0x105d',
- 'i128'],
-
-# NVIDIA
-['$vendor == 0x10de || $vendor == 0x12d2',
- 'nv'],
-
-# S3
-['$vendor == 0x5333 && ($device == 0x88d0 ||' .
- '$device == 0x88d1 ||' .
- '$device == 0x88f0 ||' .
- '$device == 0x8811 ||' .
- '$device == 0x8812 ||' .
- '$device == 0x8814 ||' .
- '$device == 0x8901)',
- 's3'],
-
-# S3 virge
-['$vendor == 0x5333 && ($device == 0x5631 ||' .
- '$device == 0x883d ||' .
- '$device == 0x8a01 ||' .
- '$device == 0x8a10 ||' .
- '$device == 0x8c01 ||' .
- '$device == 0x8c03 ||' .
- '$device == 0x8904 ||' .
- '$device == 0x8a13)',
- 's3virge'],
-
-# S3 Savage
-['$vendor == 0x5333 && ($device >= 0x8a20 && $device <= 0x8a22 ||' .
- '$device == 0x9102 ||' .
- '$device >= 0x8c10 && $device <= 0x8c13 ||' .
- '$device == 0x8a25 ||' .
- '$device == 0x8a26 ||' .
- '$device >= 0x8d01 && $device <= 0x8d04 ||' .
- '$device >= 0x8c2a && $device <= 0x8c2f ||' .
- '$device == 0x8c22 ||' .
- '$device == 0x8c24 ||' .
- '$device == 0x8c26)',
- 'savage'],
-
-# SIS
-['$vendor == 0x1039',
- 'sis'],
-
-# SMI
-['$vendor == 0x126f',
- 'siliconmotion'],
-
-# 3Dfx
-['$vendor == 0x121a',
- 'tdfx'],
-
-# 3Dlabs
-['$vendor == 0x3d3d',
- 'glint'],
-
-# Trident
-['$vendor == 0x1023',
- 'trident'],
-
-# Tseng Labs
-['$vendor == 0x100c',
- 'tseng'],
-
-# VIA
-['$vendor == 0x1106',
- 'via'],
-
-# VMware
-['$vendor == 0x15ad',
- 'vmware'],
-
-);
-
-# Reverse the search path list, since the later rules have higher priority
-# than earlier ones (weighting being equal).
-
-@searchPaths = reverse(@searchPaths);
-
-if ($debug) {
- $i = 0;
- for $path (@searchPaths) {
- print STDERR "$myname: Search path $i is: \"$path\".\n";
- $i++;
- }
-}
-
-print STDERR "$myname: ", $#rules + 1, " built-in rule", plural($#rules + 1),
- ".\n";
-
-for $path (@searchPaths) {
- while (<$path/*.cfg>) {
- @tmp = readRulesFile($_);
- if (defined(@tmp[0])) {
- push @rules, @tmp;
- }
- }
-}
-
-if ($debug) {
- $i = 0;
- for $r (@rules) {
- print STDERR "$myname: rule $i is: \'@$r\'.\n";
- $i++
- }
-}
-
-$i = 0;
-$e = 0;
-$weight = 0;
-$w = 0;
-for $r (@rules) {
- ($cond, $d, @o) = @$r;
- $result = eval $cond;
- if ($@) {
- print STDERR "$myname: Error evaluating rule $i \'$cond\': $@";
- $e++;
- }
- if ($debug) {
- print STDERR "$myname: rule $i \'$cond\' evaluates to \'$result\'.\n";
- }
- if ($result && defined($d) && $weight >= $w) {
- $driver = $d;
- @opts = @o;
- $w = $weight;
- }
- $i++;
-}
-
-print STDERR "$myname: Evaluated $i rule", plural($i),
- " with $e error", plural($e), ".\n";
-
-print STDERR "$myname: Weight of result is $w.\n";
-
-if ($debug) {
- if (defined($driver)) {
- print STDERR "$myname: Driver is \'$driver\'.\n";
- } else {
- print STDERR "$myname: No driver.\n";
- }
- if (defined(@opts)) {
- print STDERR "$myname: options are:\n";
- for $opt (@opts) {
- print STDERR "\t$opt\n";
- }
- } else {
- print STDERR "$myname: No options.\n";
- }
-}
-
-print "$driver\n";
-for $opt (@opts) {
- print "$opt\n";
-}
-
-exit 0;
-
-# Subroutines.
-
-sub readRulesFile {
- my ($file) = @_;
- my $signatureOK = 0;
- my @r, @tmp;
- my $line, $cont, $prevcont, $fileversion;
-
- undef @tmp;
- undef @r;
-
- if (open(RF, "<$file")) {
- $prevcont = 0;
- while (<RF>) {
- chop;
- $line = $_;
- next if ($line =~ /^#/);
- next if ($line =~ /^\s*$/);
- if (!$signatureOK) {
- if ($line =~ /^$signature(.*)$/) {
- $fileversion = $1;
- $signatureOK = 1;
- print STDERR
- "$myname: rules file \'$file\' has version $fileversion.\n";
- next;
- }
- }
- if (!$signatureOK) {
- print STDERR "$myname: file \'$file\' has bad signature.\n";
- close(RF);
- last;
- }
- $cont = 0;
- if ($line =~ s/\\\s*$//) {
- $cont = 1;
- }
- if (!$prevcont && $line =~ /^\S+/) {
- if (defined(@tmp[0])) {
- push(@r,[@tmp]);
- }
- undef @tmp;
- }
- if ($prevcont) {
- push(@tmp, pop(@tmp) . $line);
- } else {
- push(@tmp, $line);
- }
- $prevcont = $cont;
- }
- if (defined(@tmp[0])) {
- push(@r,[@tmp]);
- }
- if (!defined(@r[0])) {
- print STDERR "$myname: no rules in file \'$file\'.\n";
- } else {
- print STDERR "$myname: ", $#r + 1,
- " rule", plural($#r + 1),
- " added from file \'$file\'.\n";
- }
- } else {
- print STDERR "$myname: cannot open file \'$file\'.\n";
- }
-
- return @r;
-}
-
-sub plural {
- my ($count) = @_;
-
- if ($count != 1) {
- return "s";
- } else {
- return "";
- }
-}
-
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
deleted file mode 100644
index a7f5adf1a..000000000
--- a/hw/xfree86/i2c/xf86i2c.c
+++ /dev/null
@@ -1,892 +0,0 @@
-/*
- * Copyright (C) 1998 Itai Nahshon, Michael Schimek
- *
- * The original code was derived from and inspired by
- * the I2C driver from the Linux kernel.
- * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.15 2003/08/29 21:08:06 tsi Exp $ */
-
-#if 1
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "validate.h"
-#include "resource.h"
-#include "gcstruct.h"
-#include "dixstruct.h"
-#else
-typedef int Bool;
-typedef void *Pointer;
-#define NULL ((void *)0)
-#define X_DEFAULT 0
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#include "xf86i2c.h"
-
-#define I2C_TIMEOUT(x) /*(x)*/ /* Report timeouts */
-#define I2C_TRACE(x) /*(x)*/ /* Report progress */
-
-/* Set which OSs have bad gettimeofday resolution. */
-#if defined(SVR4) && !defined(sun)
-#define BAD_GETTIMEOFDAY_RESOLUTION
-#endif
-
-
-/* This is the default I2CUDelay function if not supplied by the driver.
- * High level I2C interfaces implementing the bus protocol in hardware
- * should supply this function too.
- *
- * Delay execution at least usec microseconds.
- * All values 0 to 1e6 inclusive must be expected.
- */
-
-#ifdef BAD_GETTIMEOFDAY_RESOLUTION
-/*
- * This is temporary until a better, portable
- * way is found. Adjust bogo_usec to match CPU speed.
- */
-static int bogo_usec = 500;
-
-static void
-I2CUDelay(I2CBusPtr b, int usec)
-{
- volatile long i;
-
- if (usec > 0)
- for (i = usec * bogo_usec; i > 0; i--)
- /* (perhaps hw delay action) */;
-}
-#else
-static void
-I2CUDelay(I2CBusPtr b, int usec)
-{
- long b_secs, b_usecs;
- long a_secs, a_usecs;
- long d_secs, d_usecs;
- long diff;
-
- if (usec > 0) {
- xf86getsecs(&b_secs, &b_usecs);
- do {
- /* It would be nice to use {xf86}usleep,
- * but usleep (1) takes >10000 usec !
- */
- xf86getsecs(&a_secs, &a_usecs);
- d_secs = (a_secs - b_secs);
- d_usecs = (a_usecs - b_usecs);
- diff = d_secs*1000000 + d_usecs;
- } while (diff>0 && diff< (usec + 1));
- }
-}
-#endif
-
-/* Most drivers will register just with GetBits/PutBits functions.
- * The following functions implement a software I2C protocol
- * by using the promitive functions given by the driver.
- * ================================================================
- *
- * It is assumed that there is just one master on the I2C bus, therefore
- * there is no explicit test for conflits.
- */
-
-#define RISEFALLTIME 2 /* usec, actually 300 to 1000 ns according to the i2c specs */
-
-/* Some devices will hold SCL low to slow down the bus or until
- * ready for transmission.
- *
- * This condition will be noticed when the master tries to raise
- * the SCL line. You can set the timeout to zero if the slave device
- * does not support this clock synchronization.
- */
-
-static Bool
-I2CRaiseSCL(I2CBusPtr b, int sda, int timeout)
-{
- int i, scl;
-
- b->I2CPutBits(b, 1, sda);
- b->I2CUDelay(b, b->RiseFallTime);
-
- for (i = timeout; i > 0; i -= b->RiseFallTime) {
- b->I2CGetBits(b, &scl, &sda);
- if (scl) break;
- b->I2CUDelay(b, b->RiseFallTime);
- }
-
- if (i <= 0) {
- I2C_TIMEOUT(ErrorF("[I2CRaiseSCL(<%s>, %d, %d) timeout]", b->BusName, sda, timeout));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* Send a start signal on the I2C bus. The start signal notifies
- * devices that a new transaction is initiated by the bus master.
- *
- * The start signal is always followed by a slave address.
- * Slave addresses are 8+ bits. The first 7 bits identify the
- * device and the last bit signals if this is a read (1) or
- * write (0) operation.
- *
- * There may be more than one start signal on one transaction.
- * This happens for example on some devices that allow reading
- * of registers. First send a start bit followed by the device
- * address (with the last bit 0) and the register number. Then send
- * a new start bit with the device address (with the last bit 1)
- * and then read the value from the device.
- *
- * Note this is function does not implement a multiple master
- * arbitration procedure.
- */
-
-static Bool
-I2CStart(I2CBusPtr b, int timeout)
-{
- if (!I2CRaiseSCL(b, 1, timeout))
- return FALSE;
-
- b->I2CPutBits(b, 1, 0);
- b->I2CUDelay(b, b->HoldTime);
- b->I2CPutBits(b, 0, 0);
- b->I2CUDelay(b, b->HoldTime);
-
- I2C_TRACE(ErrorF("\ni2c: <"));
-
- return TRUE;
-}
-
-/* This is the default I2CStop function if not supplied by the driver.
- *
- * Signal devices on the I2C bus that a transaction on the
- * bus has finished. There may be more than one start signal
- * on a transaction but only one stop signal.
- */
-
-static void
-I2CStop(I2CDevPtr d)
-{
- I2CBusPtr b = d->pI2CBus;
-
- b->I2CPutBits(b, 0, 0);
- b->I2CUDelay(b, b->RiseFallTime);
-
- b->I2CPutBits(b, 1, 0);
- b->I2CUDelay(b, b->HoldTime);
- b->I2CPutBits(b, 1, 1);
- b->I2CUDelay(b, b->HoldTime);
-
- I2C_TRACE(ErrorF(">\n"));
-}
-
-/* Write/Read a single bit to/from a device.
- * Return FALSE if a timeout occurs.
- */
-
-static Bool
-I2CWriteBit(I2CBusPtr b, int sda, int timeout)
-{
- Bool r;
-
- b->I2CPutBits(b, 0, sda);
- b->I2CUDelay(b, b->RiseFallTime);
-
- r = I2CRaiseSCL(b, sda, timeout);
- b->I2CUDelay(b, b->HoldTime);
-
- b->I2CPutBits(b, 0, sda);
- b->I2CUDelay(b, b->HoldTime);
-
- return r;
-}
-
-static Bool
-I2CReadBit(I2CBusPtr b, int *psda, int timeout)
-{
- Bool r;
- int scl;
-
- r = I2CRaiseSCL(b, 1, timeout);
- b->I2CUDelay(b, b->HoldTime);
-
- b->I2CGetBits(b, &scl, psda);
-
- b->I2CPutBits(b, 0, 1);
- b->I2CUDelay(b, b->HoldTime);
-
- return r;
-}
-
-/* This is the default I2CPutByte function if not supplied by the driver.
- *
- * A single byte is sent to the device.
- * The function returns FALSE if a timeout occurs, you should send
- * a stop condition afterwards to reset the bus.
- *
- * A timeout occurs,
- * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs,
- * or slows down the bus for more than BitTimeout usecs for each bit,
- * or does not send an ACK bit (0) to acknowledge the transmission within
- * AcknTimeout usecs, but a NACK (1) bit.
- *
- * AcknTimeout must be at least b->HoldTime, the other timeouts can be
- * zero according to the comment on I2CRaiseSCL.
- */
-
-static Bool
-I2CPutByte(I2CDevPtr d, I2CByte data)
-{
- Bool r;
- int i, scl, sda;
- I2CBusPtr b = d->pI2CBus;
-
- if (!I2CWriteBit(b, (data >> 7) & 1, d->ByteTimeout))
- return FALSE;
-
- for (i = 6; i >= 0; i--)
- if (!I2CWriteBit(b, (data >> i) & 1, d->BitTimeout))
- return FALSE;
-
- b->I2CPutBits(b, 0, 1);
- b->I2CUDelay(b, b->RiseFallTime);
-
- r = I2CRaiseSCL(b, 1, b->HoldTime);
-
- if (r) {
- for (i = d->AcknTimeout; i > 0; i -= b->HoldTime) {
- b->I2CUDelay(b, b->HoldTime);
- b->I2CGetBits(b, &scl, &sda);
- if (sda == 0) break;
- }
-
- if (i <= 0) {
- I2C_TIMEOUT(ErrorF("[I2CPutByte(<%s>, 0x%02x, %d, %d, %d) timeout]",
- b->BusName, data, d->BitTimeout,
- d->ByteTimeout, d->AcknTimeout));
- r = FALSE;
- }
-
- I2C_TRACE(ErrorF("W%02x%c ", (int) data, sda ? '-' : '+'));
- }
-
- b->I2CPutBits(b, 0, 1);
- b->I2CUDelay(b, b->HoldTime);
-
- return r;
-}
-
-/* This is the default I2CGetByte function if not supplied by the driver.
- *
- * A single byte is read from the device.
- * The function returns FALSE if a timeout occurs, you should send
- * a stop condition afterwards to reset the bus.
- *
- * A timeout occurs,
- * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs,
- * or slows down the bus for more than b->BitTimeout usecs for each bit.
- *
- * ByteTimeout must be at least b->HoldTime, the other timeouts can be
- * zero according to the comment on I2CRaiseSCL.
- *
- * For the <last> byte in a sequence the acknowledge bit NACK (1),
- * otherwise ACK (0) will be sent.
- */
-
-static Bool
-I2CGetByte(I2CDevPtr d, I2CByte *data, Bool last)
-{
- int i, sda;
- I2CBusPtr b = d->pI2CBus;
-
- b->I2CPutBits(b, 0, 1);
- b->I2CUDelay(b, b->RiseFallTime);
-
- if (!I2CReadBit(b, &sda, d->ByteTimeout))
- return FALSE;
-
- *data = (sda > 0) << 7;
-
- for (i = 6; i >= 0; i--)
- if (!I2CReadBit(b, &sda, d->BitTimeout))
- return FALSE;
- else
- *data |= (sda > 0) << i;
-
- if (!I2CWriteBit(b, last ? 1 : 0, d->BitTimeout))
- return FALSE;
-
- I2C_TRACE(ErrorF("R%02x%c ", (int) *data, last ? '+' : '-'));
-
- return TRUE;
-}
-
-/* This is the default I2CAddress function if not supplied by the driver.
- *
- * It creates the start condition, followed by the d->SlaveAddr.
- * Higher level functions must call this routine rather than
- * I2CStart/PutByte because a hardware I2C master may not be able
- * to send a slave address without a start condition.
- *
- * The same timeouts apply as with I2CPutByte and additional a
- * StartTimeout, similar to the ByteTimeout but for the start
- * condition.
- *
- * In case of a timeout, the bus is left in a clean idle condition.
- * I. e. you *must not* send a Stop. If this function succeeds, you *must*.
- *
- * The slave address format is 16 bit, with the legacy _8_bit_ slave address
- * in the least significant byte. This is, the slave address must include the
- * R/_W flag as least significant bit.
- *
- * The most significant byte of the address will be sent _after_ the LSB,
- * but only if the LSB indicates:
- * a) an 11 bit address, this is LSB = 1111 0xxx.
- * b) a 'general call address', this is LSB = 0000 000x - see the I2C specs
- * for more.
- */
-
-static Bool
-I2CAddress(I2CDevPtr d, I2CSlaveAddr addr)
-{
- if (I2CStart(d->pI2CBus, d->StartTimeout)) {
- if (I2CPutByte(d, addr & 0xFF)) {
- if ((addr & 0xF8) != 0xF0 &&
- (addr & 0xFE) != 0x00)
- return TRUE;
-
- if (I2CPutByte(d, (addr >> 8) & 0xFF))
- return TRUE;
- }
-
- I2CStop(d);
- }
-
- return FALSE;
-}
-
-/* These are the hardware independent I2C helper functions.
- * ========================================================
- */
-
-/* Function for probing. Just send the slave address
- * and return true if the device responds. The slave address
- * must have the lsb set to reflect a read (1) or write (0) access.
- * Don't expect a read- or write-only device will respond otherwise.
- */
-
-Bool
-xf86I2CProbeAddress(I2CBusPtr b, I2CSlaveAddr addr)
-{
- int r;
- I2CDevRec d;
-
- d.DevName = "Probing";
- d.BitTimeout = b->BitTimeout;
- d.ByteTimeout = b->ByteTimeout;
- d.AcknTimeout = b->AcknTimeout;
- d.StartTimeout = b->StartTimeout;
- d.SlaveAddr = addr;
- d.pI2CBus = b;
- d.NextDev = NULL;
-
- r = b->I2CAddress(&d, addr);
-
- if (r) b->I2CStop(&d);
-
- return r;
-}
-
-/* All functions below are related to devices and take the
- * slave address and timeout values from an I2CDevRec. They
- * return FALSE in case of an error (presumably a timeout).
- */
-
-/* General purpose read and write function.
- *
- * 1st, if nWrite > 0
- * Send a start condition
- * Send the slave address (1 or 2 bytes) with write flag
- * Write n bytes from WriteBuffer
- * 2nd, if nRead > 0
- * Send a start condition [again]
- * Send the slave address (1 or 2 bytes) with read flag
- * Read n bytes to ReadBuffer
- * 3rd, if a Start condition has been successfully sent,
- * Send a Stop condition.
- *
- * The functions exits immediately when an error occures,
- * not proceeding any data left. However, step 3 will
- * be executed anyway to leave the bus in clean idle state.
- */
-
-static Bool
-I2CWriteRead(I2CDevPtr d,
- I2CByte *WriteBuffer, int nWrite,
- I2CByte *ReadBuffer, int nRead)
-{
- Bool r = TRUE;
- I2CBusPtr b = d->pI2CBus;
- int s = 0;
-
- if (r && nWrite > 0) {
- r = b->I2CAddress(d, d->SlaveAddr & ~1);
- if (r) {
- for (; nWrite > 0; WriteBuffer++, nWrite--)
- if (!(r = b->I2CPutByte(d, *WriteBuffer)))
- break;
- s++;
- }
- }
-
- if (r && nRead > 0) {
- r = b->I2CAddress(d, d->SlaveAddr | 1);
- if (r) {
- for (; nRead > 0; ReadBuffer++, nRead--)
- if (!(r = b->I2CGetByte(d, ReadBuffer, nRead == 1)))
- break;
- s++;
- }
- }
-
- if (s) b->I2CStop(d);
-
- return r;
-}
-
-/* wrapper - for compatibility and convinience */
-
-Bool
-xf86I2CWriteRead(I2CDevPtr d,
- I2CByte *WriteBuffer, int nWrite,
- I2CByte *ReadBuffer, int nRead)
-{
- I2CBusPtr b = d->pI2CBus;
- return b->I2CWriteRead(d,WriteBuffer,nWrite,ReadBuffer,nRead);
-}
-
-/* Read a byte, the only readable register of a device.
- */
-
-Bool
-xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte)
-{
- return xf86I2CWriteRead(d, NULL, 0, pbyte, 1);
-}
-
-/* Read a byte from one of the registers determined by its sub-address.
- */
-
-Bool
-xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte)
-{
- return xf86I2CWriteRead(d, &subaddr, 1, pbyte, 1);
-}
-
-/* Read bytes from subsequent registers determined by the
- * sub-address of the first register.
- */
-
-Bool
-xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n)
-{
- return xf86I2CWriteRead(d, &subaddr, 1, pbyte, n);
-}
-
-/* Read a word (high byte, then low byte) from one of the registers
- * determined by its sub-address.
- */
-
-Bool
-xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword)
-{
- I2CByte rb[2];
-
- if (!xf86I2CWriteRead(d, &subaddr, 1, rb, 2)) return FALSE;
-
- *pword = (rb[0] << 8) | rb[1];
-
- return TRUE;
-}
-
-/* Write a byte to one of the registers determined by its sub-address.
- */
-
-Bool
-xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte)
-{
- I2CByte wb[2];
-
- wb[0] = subaddr;
- wb[1] = byte;
-
- return xf86I2CWriteRead(d, wb, 2, NULL, 0);
-}
-
-/* Write bytes to subsequent registers determined by the
- * sub-address of the first register.
- */
-
-Bool
-xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr,
- I2CByte *WriteBuffer, int nWrite)
-{
- I2CBusPtr b = d->pI2CBus;
- Bool r = TRUE;
-
- if (nWrite > 0) {
- r = b->I2CAddress(d, d->SlaveAddr & ~1);
- if (r){
- if ((r = b->I2CPutByte(d, subaddr)))
- for (; nWrite > 0; WriteBuffer++, nWrite--)
- if (!(r = b->I2CPutByte(d, *WriteBuffer)))
- break;
-
- b->I2CStop(d);
- }
- }
-
- return r;
-}
-
-/* Write a word (high byte, then low byte) to one of the registers
- * determined by its sub-address.
- */
-
-Bool
-xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word)
-{
- I2CByte wb[3];
-
- wb[0] = subaddr;
- wb[1] = word >> 8;
- wb[2] = word & 0xFF;
-
- return xf86I2CWriteRead(d, wb, 3, NULL, 0);
-}
-
-/* Write a vector of bytes to not adjacent registers. This vector is,
- * 1st byte sub-address, 2nd byte value, 3rd byte sub-address asf.
- * This function is intended to initialize devices. Note this function
- * exits immediately when an error occurs, some registers may
- * remain uninitialized.
- */
-
-Bool
-xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues)
-{
- I2CBusPtr b = d->pI2CBus;
- Bool r = TRUE;
- int s = 0;
-
- if (nValues > 0) {
- for (; nValues > 0; nValues--, vec += 2) {
- if (!(r = b->I2CAddress(d, d->SlaveAddr & ~1)))
- break;
-
- s++;
-
- if (!(r = b->I2CPutByte(d, vec[0])))
- break;
-
- if (!(r = b->I2CPutByte(d, vec[1])))
- break;
- }
-
- if (s > 0) b->I2CStop(d);
- }
-
- return r;
-}
-
-/* Administrative functions.
- * =========================
- */
-
-/* Allocates an I2CDevRec for you and initializes with propper defaults
- * you may modify before calling xf86I2CDevInit. Your I2CDevRec must
- * contain at least a SlaveAddr, and a pI2CBus pointer to the bus this
- * device shall be linked to.
- *
- * See function I2CAddress for the slave address format. Always set
- * the least significant bit, indicating a read or write access, to zero.
- */
-
-I2CDevPtr
-xf86CreateI2CDevRec(void)
-{
- return xcalloc(1, sizeof(I2CDevRec));
-}
-
-/* Unlink an I2C device. If you got the I2CDevRec from xf86CreateI2CDevRec
- * you should set <unalloc> to free it.
- */
-
-void
-xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc)
-{
- if (d) {
- I2CDevPtr *p;
-
- /* Remove this from the list of active I2C devices. */
-
- for (p = &d->pI2CBus->FirstDev; *p != NULL; p = &(*p)->NextDev)
- if (*p == d) {
- *p = (*p)->NextDev;
- break;
- }
-
- xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO,
- "I2C device \"%s:%s\" removed.\n",
- d->pI2CBus->BusName, d->DevName);
-
- if (unalloc) xfree(d);
- }
-}
-
-/* I2C transmissions are related to an I2CDevRec you must link to a
- * previously registered bus (see xf86I2CBusInit) before attempting
- * to read and write data. You may call xf86I2CProbeAddress first to
- * see if the device in question is present on this bus.
- *
- * xf86I2CDevInit will not allocate an I2CBusRec for you, instead you
- * may enter a pointer to a statically allocated I2CDevRec or the (modified)
- * result of xf86CreateI2CDevRec.
- *
- * If you don't specify timeouts for the device (n <= 0), it will inherit
- * the bus-wide defaults. The function returns TRUE on success.
- */
-
-Bool
-xf86I2CDevInit(I2CDevPtr d)
-{
- I2CBusPtr b;
-
- if (d == NULL ||
- (b = d->pI2CBus) == NULL ||
- (d->SlaveAddr & 1) ||
- xf86I2CFindDev(b, d->SlaveAddr) != NULL)
- return FALSE;
-
- if (d->BitTimeout <= 0) d->BitTimeout = b->BitTimeout;
- if (d->ByteTimeout <= 0) d->ByteTimeout = b->ByteTimeout;
- if (d->AcknTimeout <= 0) d->AcknTimeout = b->AcknTimeout;
- if (d->StartTimeout <= 0) d->StartTimeout = b->StartTimeout;
-
- d->NextDev = b->FirstDev;
- b->FirstDev = d;
-
- xf86DrvMsg(b->scrnIndex, X_INFO,
- "I2C device \"%s:%s\" registered at address 0x%02X.\n",
- b->BusName, d->DevName, d->SlaveAddr);
-
- return TRUE;
-}
-
-I2CDevPtr
-xf86I2CFindDev(I2CBusPtr b, I2CSlaveAddr addr)
-{
- I2CDevPtr d;
-
- if (b) {
- for (d = b->FirstDev; d != NULL; d = d->NextDev)
- if (d->SlaveAddr == addr)
- return d;
- }
-
- return NULL;
-}
-
-static I2CBusPtr I2CBusList;
-
-/* Allocates an I2CBusRec for you and initializes with propper defaults
- * you may modify before calling xf86I2CBusInit. Your I2CBusRec must
- * contain at least a BusName, a scrnIndex (or -1), and a complete set
- * of either high or low level I2C function pointers. You may pass
- * bus-wide timeouts, otherwise inplausible values will be replaced
- * with safe defaults.
- */
-
-I2CBusPtr
-xf86CreateI2CBusRec(void)
-{
- I2CBusPtr b;
-
- b = (I2CBusPtr) xcalloc(1, sizeof(I2CBusRec));
-
- if (b != NULL) {
- b->scrnIndex = -1;
- b->HoldTime = 5; /* 100 kHz bus */
- b->BitTimeout = 5;
- b->ByteTimeout = 5;
- b->AcknTimeout = 5;
- b->StartTimeout = 5;
- b->RiseFallTime = RISEFALLTIME;
- }
-
- return b;
-}
-
-/* Unregister an I2C bus. If you got the I2CBusRec from xf86CreateI2CBusRec
- * you should set <unalloc> to free it. If you set <devs_too>, the function
- * xf86DestroyI2CDevRec will be called for all devices linked to the bus
- * first, passing down the <unalloc> option.
- */
-
-void
-xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
-{
- if (b) {
- I2CBusPtr *p;
-
- /* Remove this from the list of active I2C buses */
-
- for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus)
- if (*p == b) {
- *p = (*p)->NextBus;
- break;
- }
-
- if (b->FirstDev != NULL) {
- if (devs_too) {
- I2CDevPtr d;
-
- while ((d = b->FirstDev) != NULL) {
- b->FirstDev = d->NextDev;
- xf86DestroyI2CDevRec(d, unalloc);
- }
- } else {
- if (unalloc) {
- xf86Msg(X_ERROR, "i2c bug: Attempt to remove I2C bus \"%s\", "
- "but device list is not empty.\n",
- b->BusName);
- return;
- }
- }
- }
-
- xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" removed.\n",
- b->BusName);
-
- if (unalloc) xfree(b);
- }
-}
-
-/* I2C masters have to register themselves using this function.
- * It will not allocate an I2CBusRec for you, instead you may enter
- * a pointer to a statically allocated I2CBusRec or the (modified)
- * result of xf86CreateI2CBusRec. Returns TRUE on success.
- *
- * At this point there won't be any traffic on the I2C bus.
- */
-
-Bool
-xf86I2CBusInit(I2CBusPtr b)
-{
- /* I2C buses must be identified by a unique scrnIndex
- * and name. If scrnIndex is unspecified (a negative value),
- * then the name must be unique throughout the server.
- */
-
- if (b->BusName == NULL ||
- xf86I2CFindBus(b->scrnIndex, b->BusName) != NULL)
- return FALSE;
-
- /* If the high level functions are not
- * supplied, use the generic functions.
- * In this case we need the low-level
- * function.
- */
- if (b->I2CWriteRead == NULL)
- {
- b->I2CWriteRead=I2CWriteRead;
-
- if (b->I2CPutBits == NULL ||
- b->I2CGetBits == NULL)
- {
- if (b->I2CPutByte == NULL ||
- b->I2CGetByte == NULL ||
- b->I2CAddress == NULL ||
- b->I2CStop == NULL)
- return FALSE;
- } else {
- b->I2CPutByte = I2CPutByte;
- b->I2CGetByte = I2CGetByte;
- b->I2CAddress = I2CAddress;
- b->I2CStop = I2CStop;
- }
- }
-
- if (b->I2CUDelay == NULL)
- b->I2CUDelay = I2CUDelay;
-
- if (b->HoldTime < 2) b->HoldTime = 5;
- if (b->BitTimeout <= 0) b->BitTimeout = b->HoldTime;
- if (b->ByteTimeout <= 0) b->ByteTimeout = b->HoldTime;
- if (b->AcknTimeout <= 0) b->AcknTimeout = b->HoldTime;
- if (b->StartTimeout <= 0) b->StartTimeout = b->HoldTime;
-
- /* Put new bus on list. */
-
- b->NextBus = I2CBusList;
- I2CBusList = b;
-
- xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" initialized.\n",
- b->BusName);
-
- return TRUE;
-}
-
-I2CBusPtr
-xf86I2CFindBus(int scrnIndex, char *name)
-{
- I2CBusPtr p;
-
- if (name != NULL)
- for (p = I2CBusList; p != NULL; p = p->NextBus)
- if (scrnIndex < 0 || p->scrnIndex == scrnIndex)
- if (!strcmp(p->BusName, name))
- return p;
-
- return NULL;
-}
-
-/*
- * Return an array of I2CBusPtr's related to a screen. The caller is
- * responsible for freeing the array.
- */
-int
-xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus)
-{
- I2CBusPtr pI2CBus;
- int n = 0;
-
- if (pppI2CBus)
- *pppI2CBus = NULL;
-
- for (pI2CBus = I2CBusList; pI2CBus; pI2CBus = pI2CBus->NextBus) {
- if ((pI2CBus->scrnIndex >= 0) && (pI2CBus->scrnIndex != scrnIndex))
- continue;
-
- n++;
-
- if (!pppI2CBus)
- continue;
-
- *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr));
- *pppI2CBus[n - 1] = pI2CBus;
- }
-
- return n;
-}
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
deleted file mode 100644
index e7423155a..000000000
--- a/hw/xfree86/i2c/xf86i2c.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 1998 Itai Nahshon, Michael Schimek
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.11 2003/08/29 21:08:06 tsi Exp $ */
-#ifndef _XF86I2C_H
-#define _XF86I2C_H
-
-#include "regionstr.h"
-
-typedef unsigned char I2CByte;
-typedef unsigned short I2CSlaveAddr;
-
-typedef struct _I2CBusRec *I2CBusPtr;
-typedef struct _I2CDevRec *I2CDevPtr;
-
-/* I2C masters have to register themselves */
-
-typedef struct _I2CBusRec {
- char * BusName;
- int scrnIndex;
-
- void (*I2CUDelay) (I2CBusPtr b, int usec);
-
- void (*I2CPutBits)(I2CBusPtr b, int scl, int sda);
- void (*I2CGetBits)(I2CBusPtr b, int *scl, int *sda);
-
- /* Look at the generic routines to see how these functions should behave. */
-
- Bool (*I2CAddress)(I2CDevPtr d, I2CSlaveAddr);
- void (*I2CStop) (I2CDevPtr d);
- Bool (*I2CPutByte)(I2CDevPtr d, I2CByte data);
- Bool (*I2CGetByte)(I2CDevPtr d, I2CByte *data, Bool);
-
- DevUnion DriverPrivate;
-
- int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */
-
- int BitTimeout; /* usec */
- int ByteTimeout; /* usec */
- int AcknTimeout; /* usec */
- int StartTimeout; /* usec */
- int RiseFallTime; /* usec */
-
- I2CDevPtr FirstDev;
- I2CBusPtr NextBus;
- Bool (*I2CWriteRead)(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
- I2CByte *ReadBuffer, int nRead);
-} I2CBusRec;
-
-I2CBusPtr xf86CreateI2CBusRec(void);
-void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too);
-Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
-I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name);
-int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus);
-
-
-/* I2C slave devices */
-
-typedef struct _I2CDevRec {
- char * DevName;
-
- int BitTimeout; /* usec */
- int ByteTimeout; /* usec */
- int AcknTimeout; /* usec */
- int StartTimeout; /* usec */
-
- I2CSlaveAddr SlaveAddr;
- I2CBusPtr pI2CBus;
- I2CDevPtr NextDev;
- DevUnion DriverPrivate;
-} I2CDevRec;
-
-I2CDevPtr xf86CreateI2CDevRec(void);
-void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc);
-Bool xf86I2CDevInit(I2CDevPtr pI2CDev);
-I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr);
-
-/* See descriptions of these functions in xf86i2c.c */
-
-Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr);
-Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
- I2CByte *ReadBuffer, int nRead);
-#define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr)
-Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte);
-Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte);
-Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n);
-Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword);
-#define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0)
-Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte);
-Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *WriteBuffer, int nWrite);
-Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word);
-Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues);
-
-#endif /*_XF86I2C_H */
diff --git a/hw/xfree86/i2c/xf86i2cmodule.c b/hw/xfree86/i2c/xf86i2cmodule.c
deleted file mode 100644
index de923b2f0..000000000
--- a/hw/xfree86/i2c/xf86i2cmodule.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* (c) Itai Nahshon
- *
- * This code is derived from and inspired by the I2C driver
- * from the Linux kernel.
- * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2cmodule.c,v 1.7 1999/04/11 13:11:02 dawes Exp $ */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(i2cSetup);
-
-static XF86ModuleVersionInfo i2cVersRec =
-{
- "i2c",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 2, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData i2cModuleData = { &i2cVersRec, i2cSetup, NULL };
-
-static pointer
-i2cSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
-/* ErrorF("i2cSetup\n"); */
- return (pointer)1;
-}
diff --git a/hw/xfree86/int10/INT10.HOWTO b/hw/xfree86/int10/INT10.HOWTO
deleted file mode 100644
index bba0c774f..000000000
--- a/hw/xfree86/int10/INT10.HOWTO
+++ /dev/null
@@ -1,344 +0,0 @@
-
- INT10 X86 Real Mode executor
- =============================
-
- PRELIMINARY
-
-INT10 is a XFree86 module for soft-booting and executing real mode
-int10 BIOS calls. The BIOS call code is largely untested, yet.
-
-1. Usage
-========
-
-To use the int10 module in a driver the header file
-xfree86/os-support/int10/xf86int10.h must be included.
-
- a. Initialization
- -----------------
-
-The int10-executer gets initialized by calling:
-
- xf86Int10InfoPtr xf86InitInt10(int entityIndex);
-
-The function will soft-boot any non-primary device and return a
-pointer to a xf86Int10InfoRec on success. If anything fails or if
-int10 execution is disabled by an option in the device section NULL
-will be returned. The driver should store this pointer for later
-calls to other int10 module functions.
-
- b. Memory allocation
- --------------------
-
-To allocate memory in the real mode execution environment
-
- void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off);
-
-can be called. It allocates num consecutive pagesize chunks. It
-returns the address of the allocated area. off is set to its offset in
-the real mode memory space.
-
- void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
-
-Is used to free num pages beginning at pbase.
-
- c. Doing int10 BIOS calls
- -------------------------
-
-The BIOS call is executed by calling:
-
- void xf86ExecX86int10(xf86Int10InfoPtr pInt);
-
-The number of the interrupt (normally 10) and the initial values of
-the ax, bx, cx, dx, si, di and es x86-CPU registers can be set in the
-xf86Int10InfoRec passed to the function. On return this structure
-contains the exit values of the registers listed above and the CPU
-flag register.
-
- d. De-initializing
- -----------------
-
-If no further int10 calls are required for a certain chipset
-the driver should call:
-
- void xf86FreeInt10(xf86Int10InfoPtr pInt);
-
-to free the memory allocated for real mode int10 calls.
-
-
-2. Porting issues
-=================
-
-The int10 real mode executor is designed to run on top of various x86
-CPU emulators as well as in vm86 mode of a real x86 CPU. If used with
-a CPU emulator the emulator and CPU specific interfaces can be held
-separate thus requiring minimal efforts to port the int10 module to
-new platforms. Currently an interface to the x86emu real mode
-emulator is provided. Since details of setting up and running the
-vm86 mode is platform dependent both the platform dependent
-environment and the emulation layer have to be ported. Several helper
-functions are provided for that.
-
-A CPU emulator should meet certain requirements to be usable
-for the INT10 executor:
-
-1. It must trap calls to intXX instructions and pass execution to an
- external function which is allowed to modify CPU registers
- including the instruction pointer (IP) before returning to the
- emulator for continuing execution. When the external function is
- called the IP must point to the instruction past the intXX call.
-
-2. The emulator should use externally provided functions to handle
- PIO.
-
-3. The emulator should be able to use externally provided functions
- to access memory from the real mode memory environment. Note, that
- the vm86 mode usually requires one hunk of consecutive memory
- starting at address 0 in the process virtual memory space. Thus if
- this mode is to be used, the OS environment has to be able to provide
- that, ie. it must be able to remap the processes virtual memory space
- onto itself. If the emulator is able to handle memory access thru
- externally provided functions the real mode process memory can be
- located anywhere in the processes virtual memory. It does not even
- have to be consecutive.
-
-4. The executor should terminate on encountering a 'hlt' instruction.
-
-
-Functions to implement:
-
-To simplify development the code has been split into a general setup
-part and an emulator specific one. A generic setup code is provided in
-generic.c. It should be usable with any emulator satisfying the
-conditions mentioned above. Therefore the following section on int10
-setup may be skipped when porting int10 to new emulator.
-
-If the vm86() is to be used no memory access functions can be used.
-Therefore the layout of the real mode memory image has to meet certain
-requirements. Therefore when porting to other platforms a new setup
-code may have to be designed, too. The following section will give
-guidelines how this may be done. A sample implementation using SysV
-IPC to map the appropriate real mode memory image to address 0 in
-virtual address space just prior to execution may be found in
-xfree86/os-support/linux/int10/linux.c.
-
-On non-PC like platforms emulation of certain PC features such as
-initialization of BIOS int vectors, sys_BIOS constants or PCI config
-method 1 can be turned on by defining _PC.
-
-I. Setup Code
--------------
-
-This sets up the real mode memory image, calls the emulator to POST
-the chipset if required and maintains memory allocations in real mode
-address space.
-
-1. xf86Int10InfoPtr xf86InitInt10(int entityIndex);
-
-This function should first find the screen assigned to the entity
-carrying entitiyIndex and then call
-
- Bool int10skip(ScrnInfoPtr pScrn)
-
-to find out if the user has requested not to initialize int10. If so
-xf86InitInt10() should return NULL. Otherwise an xf86Int10InfoRec
-should be allocated. This structure contains the following fields:
-
- a. int entityIndex - index of the entity whose BIOS is to be
- executed.
- b. int scrnIndex - index of the screen assigned the entity.
- c. pointer cpuRegs - pointer to a emulator/vm86-mode private
- structure. May hold cpu register values
- for the emulator.
- d. CARD16 BIOSseg - Video BIOS segment address.
- e. pointer private - pointer to a os specific data structure.
- f. struct _int10Mem* - pointer to a structure to hold the memory
- access functions for use by an emulator.
- g. int num - number of the int to be called.
- h. int ax..es,flags - CPU register values to pass to int-call.
-
-The Init function should initialize a-f. To initialize the emulator
-specific execute environment the function
-
- Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
-
-should be called. If this function returns FALSE any already allocated
-memory should be freed and xf86Int10Init(0 should exit returning NULL.
-
-If the platform has a PC like system BIOS it may be copied to or
-mapped into memory locations SYS_BIOS to SYS_SIZE-1 of the real mode
-memory environment of this process. Otherwise the helper function:
-
-int setup_system_bios(CARD32 base_addr);
-
-may be called to set up a rudimentary system BIOS sufficient to be
-used to boot video BIOSes. base_addr specifies the virtual address
-corresponding to SYS_BIOS in the real mode environment. If a PC-like
-int vector and BIOS data area is available it should be copied to 0 to
-LOW_PAGE_SIZE of the entities real mode environment. In this case the
-video interrupt related entries should be reset for all non-primary
-cards by calling:
-
-void reset_int_vect(xf86Int10InfoPtr pInt); To initialize the
-
-correct video BIOS entry points the BIOS must be warm-booted. If no
-PC-like int vector is available one can be set up by calling
-
-void setup_int_vect(xf86Int10InfoPtr pInt);
-
-In this case the video BIOS has to be warm-booted always. If the
-video BIOS for this entity has been installed during boot it may be
-mapped (or copied) directly to the correct address in the real mode
-memory environment. Otherwise
-
-int mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address);
-
-should be called to copy the BIOS image from PCI ROM. 'address'
-specifies the address this image should be copied to. Sufficient space
-to hold an entire BIOS image should be allocated prior to calling
-mapPciRom(). This function will return the size of the BIOS image in
-bytes if it was able to successfully copy the image and 0
-otherwise. To create a well defined point to exit the softbooter
-
-void set_return_trap(xf86Int10Ptr pInt);
-
-may be called. It sets up a 'hlt' instruction in the emulator memory
-just above the BIOS variable area. Before entering real mode execution
-this address will be pushed onto the return stack. If the BIOS needs
-to be warm-booted this should be done before leaving xf86InitInt10()
-by setting num in the xf86Int10InfoRec to 0xe6 and calling
-
-void xf86ExecX86int10(xf86Int10IfoPtr pInt);
-
-The implementation of this function will be discussed below. This
-function should be wrapped by calls to void LockLegacyVGA(screen,
-legacyVGAPtr vga); and void UnlockLegacyVGA(screen, legacyVGAPtr vga);
-The struct vga is used to hold the state of the legacy VGA access
-registers if a legacy VGA device exists. xf86InitInt10() should
-return a pointer to the xf86Int10InfoRec allocated.
-
-2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
-
-In case a platform specific mapping has to be performed to map the
-memory allocated for the real mode memory environment into a specific
-location prior to executing the x86 real mode code a function
-
- Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
-
-has to be provided. It will be called by a helper function whenever
-the active entity changes. If the vm86 mode is used it is most likely
-that the 1MB real mode memory space located somewhere in the processes
-virtual memory will have to be remapped to address 0 of the virtual
-memory space.
-
-3. void xf86FreeInt10(xf86Int10InfoPtr pInt);
-
-To free all memory allocated for video BIOS calls of a specific entity
-the function
-
- void xf86FreeInt10(xf86Int10InfoPtr pInt);
-
-should be provided. If the entity to be freed was mapped by
-MapCurrentInt10() this mapping needs to be undone also.
-
-4.
- void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
- void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
-
-xf86Int10AllocPages() should allocate 'num' consecutive page-size
-chunks of memory. In real mode memory space this range needs to occupy
-consecutive addresses, too. The function must return the address of
-this memory. The offset in real mode memory needs to be returned in
-'off'. If no block of 'num' pages are available the function should
-return NULL.
-
-xf86Int10FreePages() will free the 'num' pages starting at 'pbase'.
-'num' is equal to the number of pages allocated by a single
-xf86Int10AllocatePages() call. 'pbase' is the address of the range
-previously returned by xf86Int10AllocatePages().
-
-II. Emulator specific functions
--------------------------------
-
-1. Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
-
-This function will be called from xf86InitInt10(). It may be used to
-set up the static emulator specific part of the real mode
-environment. On success it should return TRUE.
-
-2. xf86ExecX86int10(xf86Int10InfoPtr pInt);
-
-This function gets called to execute an int call. It may call the
-helper function:
-
- void setup_int(xf86Int10InfoPrt pInt);
-
-to copy the register values to the emulator specific locations and to
-set up the non-static real mode execution environment. On return from
-setup_int() 'Int10Current' holds a pointer to the current
-xf86Int10InfoRec.
-
-It should start execution by calling
-
- Bool int_handler(xf86Int10InfoPtr pInt);
-
-and if this function returns TRUE it should call whatever necessary to
-continue execution until a 'hlt' instruction is encountered. To copy
-the resulting register values back to the xf86Int10InfoRec structure
-
- void finish_int(xf86Int10InfoPtr pInt);
-
-should be called.
-
-Helper functions are provided to aid the implementation of a vm86
-call:
-
- Bool vm86_GP_fault(xf86Int10InfoPtr pInt);
-
-This function handles instructions which cause a vm86 call to
-trap. PIO access is handled by the in/out calls as defined in
-compiler.h. Optionally the PIO instructions can be logged by defining
-PRINT_PORT in xf86int10.h. This is meant for debugging purposes.
-
-Unknown instructions and 'hlt' cause vm86_GP_fault() to return
-FALSE. Otherwise TRUE is returned.
-
-Note: This function is currently based on the Linux vm86 call. It
-might have to be modified or even rewritten for other OS. So your
-milage may vary.
-
-Functions to dump memory, code, xf86 CPU register values and stack are
-also provided. Take a look at helper.c To view a memory range the
-function
-
- void dprint(unsigned long start, unsigned long size)
-
-is provided. The use should be self explanatory.
-
-Register and memory access functions are provided in helper_mem.c.
-The PIO register access functions can trap access to PCI config space
-access register (config method 1) if _PC is not defined.
-
-A header file 'defines.h' is required to define OS/emulator specific
-ways to access memory and xf86 CPU registers: Defines need to be
-provided for memory byte/work/long read/write access
-(MEM_RB(name,addr),MEM_RW(name,addr),MEM_RL(name,addr),
-MEM_WB(name,addr,val),MEM_WL(name,addr,val),MEM_WL(name,addr,val)) of
-the real mode memory environment. 'name' will contain a pointer to the
-current xf86Int10InfoRec. Currently defines are available for
-vm86-mode under Linux and x86emu. They may be activated by defining
-_X86EMU or _VM86_LINUX respectively.
-
-Note: Emulators usually are not able to pass this pointer when calling
-memory access functions. In this case a global variable should be
-defined which can hold this pointer. This variable can be set in
-MapCurrentInt10(). It also must be set in xf86InitInt10() if this
-function calls the memory access functions either directly or by
-calling xf86ExecX86int10(pInt). Defines to access the emulator
-specific xf86 CPU register locations are also required:
-X86_EAX,...,X86_EFLAGS for access of the full 32 bit registers,
-X86_AX...X86_FLAGS for access of the 16 bit registers and
-XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the
-AX,BX,CX and DX register.
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.3 2001/04/30 14:34:57 tsi Exp $
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
deleted file mode 100644
index 845c8a177..000000000
--- a/hw/xfree86/int10/generic.c
+++ /dev/null
@@ -1,555 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.29 2003/09/24 02:43:33 dawes Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-#include "int10Defines.h"
-
-#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
-
-static CARD8 read_b(xf86Int10InfoPtr pInt,int addr);
-static CARD16 read_w(xf86Int10InfoPtr pInt,int addr);
-static CARD32 read_l(xf86Int10InfoPtr pInt,int addr);
-static void write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val);
-static void write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val);
-static void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val);
-
-/*
- * the emulator cannot pass a pointer to the current xf86Int10InfoRec
- * to the memory access functions therefore store it here.
- */
-
-typedef struct {
- int shift;
- int entries;
- void* base;
- void* vRam;
- int highMemory;
- void* sysMem;
- char* alloc;
-} genericInt10Priv;
-
-#define INTPriv(x) ((genericInt10Priv*)x->private)
-
-int10MemRec genericMem = {
- read_b,
- read_w,
- read_l,
- write_b,
- write_w,
- write_l
-};
-
-static void MapVRam(xf86Int10InfoPtr pInt);
-static void UnmapVRam(xf86Int10InfoPtr pInt);
-#ifdef _PC
-#define GET_HIGH_BASE(x) (((V_BIOS + size + getpagesize() - 1)/getpagesize()) \
- * getpagesize())
-#endif
-
-static void *sysMem = NULL;
-
-xf86Int10InfoPtr
-xf86InitInt10(int entityIndex)
-{
- return xf86ExtendedInitInt10(entityIndex, 0);
-}
-
-xf86Int10InfoPtr
-xf86ExtendedInitInt10(int entityIndex, int Flags)
-{
- xf86Int10InfoPtr pInt;
- void* base = 0;
- void* vbiosMem = 0;
- void* options = NULL;
- pciVideoPtr pvp;
- int screen;
- legacyVGARec vga;
- xf86int10BiosLocation bios;
-
-#ifdef _PC
- int size;
- CARD32 cs;
-#endif
-
- screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
-
- options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
-
- if (int10skip(options)) {
- xfree(options);
- return NULL;
- }
-
- pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
- pInt->entityIndex = entityIndex;
- if (!xf86Int10ExecSetup(pInt))
- goto error0;
- pInt->mem = &genericMem;
- pInt->private = (pointer)xnfcalloc(1, sizeof(genericInt10Priv));
- INTPriv(pInt)->alloc = (pointer)xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
- pInt->scrnIndex = screen;
- base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
-
- pvp = xf86GetPciInfoForEntity(entityIndex);
- if (pvp) pInt->Tag = ((pciConfigPtr)(pvp->thisCard))->tag;
-
- /*
- * we need to map video RAM MMIO as some chipsets map mmio
- * registers into this range.
- */
- MapVRam(pInt);
-#ifdef _PC
- if (!sysMem)
- sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS,
- BIOS_SIZE + SYS_BIOS - V_BIOS);
- INTPriv(pInt)->sysMem = sysMem;
-
- if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
- goto error1;
- }
-
- /*
- * Retrieve everything between V_BIOS and SYS_BIOS as some system BIOSes
- * have executable code there. Note that xf86ReadBIOS() can only read in
- * 64kB at a time.
- */
- (void)memset((char *)base + V_BIOS, 0, SYS_BIOS - V_BIOS);
-#if 0
- for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
- if (xf86ReadBIOS(cs, 0, (unsigned char *)base + cs, V_BIOS_SIZE) <
- V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x%06X.\n", cs);
-#endif
- INTPriv(pInt)->highMemory = V_BIOS;
-
- xf86int10ParseBiosLocation(options,&bios);
-
- if (xf86IsEntityPrimary(entityIndex)
- && !(initPrimary(options))) {
-
- if (bios.bus == BUS_ISA && bios.location.legacy) {
- xf86DrvMsg(screen, X_CONFIG,
- "Overriding BIOS location: 0x%x\n",
- bios.location.legacy);
- cs = bios.location.legacy >> 4;
-#define CHECK_V_SEGMENT_RANGE(x) \
- if (((x) << 4) < V_BIOS) {\
- xf86DrvMsg(screen, X_ERROR, \
- "V_BIOS address 0x%lx out of range\n", \
- (unsigned long)(x) << 4); \
- goto error1; \
- }
- CHECK_V_SEGMENT_RANGE(cs);
- vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
- if (!int10_check_bios(screen, cs, vbiosMem)) {
- xf86DrvMsg(screen, X_ERROR,
- "No V_BIOS at specified address 0x%lx\n",
- (unsigned long)cs << 4);
- goto error1;
- }
- } else {
- if (bios.bus == BUS_PCI) {
- xf86DrvMsg(screen, X_WARNING,
- "Option BiosLocation for primary device ignored: "
- "It points to PCI.\n");
- xf86DrvMsg(screen, X_WARNING,
- "You must set Option InitPrimary also\n");
- }
-
- cs = MEM_RW(pInt,((0x10<<2)+2));
- CHECK_V_SEGMENT_RANGE(cs);
- vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
- if (!int10_check_bios(screen, cs, vbiosMem)) {
- cs = MEM_RW(pInt, (0x42 << 2) + 2);
- CHECK_V_SEGMENT_RANGE(cs);
- vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
- if (!int10_check_bios(screen, cs, vbiosMem)) {
- cs = V_BIOS >> 4;
- vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
- if (!int10_check_bios(screen, cs, vbiosMem)) {
- xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
- goto error1;
- }
- }
- }
- }
-
- xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
- (unsigned long)cs);
-
- set_return_trap(pInt);
- pInt->BIOSseg = cs;
-
- pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
- if (! (pInt->Flags & SET_BIOS_SCRATCH))
- pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
- xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
-
- } else {
- BusType location_type;
- int bios_location = V_BIOS;
- int pci_entity;
-
- EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
- reset_int_vect(pInt);
- set_return_trap(pInt);
-
- if (bios.bus != BUS_NONE) {
- switch (location_type = bios.bus) {
- case BUS_PCI:
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "PCI:%i:%i%i\n",bios.location.pci.bus,
- bios.location.pci.dev,bios.location.pci.func);
- break;
- case BUS_ISA:
- bios_location = bios.location.legacy;
- if (bios.location.legacy)
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "Legacy:0x%x\n",bios.location.legacy);
- else
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "Legacy\n");
- break;
- default:
- break;
- }
- } else
- location_type = pEnt->location.type;
-
- switch (location_type) {
- case BUS_PCI:
- vbiosMem = (unsigned char *)base + bios_location;
- if (bios.bus == BUS_PCI)
- pci_entity = xf86GetPciEntity(bios.location.pci.bus,
- bios.location.pci.dev,
- bios.location.pci.func);
- else
- pci_entity = pInt->entityIndex;
- if (!(size = mapPciRom(pci_entity,(unsigned char *)(vbiosMem)))) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n");
- goto error1;
- }
- INTPriv(pInt)->highMemory = GET_HIGH_BASE(size);
- break;
- case BUS_ISA:
- vbiosMem = (unsigned char *)sysMem + bios_location;
-#if 0
- (void)memset(vbiosMem, 0, V_BIOS_SIZE);
- if (xf86ReadBIOS(bios_location, 0, vbiosMem, V_BIOS_SIZE)
- < V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x%x.\n",bios_location);
-#endif
- if (!int10_check_bios(screen, bios_location >> 4, vbiosMem)) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (4)\n");
- goto error1;
- }
- default:
- goto error1;
- }
- xfree(pEnt);
- pInt->BIOSseg = V_BIOS >> 4;
- pInt->num = 0xe6;
- LockLegacyVGA(pInt, &vga);
- xf86ExecX86int10(pInt);
- UnlockLegacyVGA(pInt, &vga);
- }
-#else
- if (!sysMem) {
- sysMem = xnfalloc(BIOS_SIZE);
- setup_system_bios(sysMem);
- }
- INTPriv(pInt)->sysMem = sysMem;
- setup_int_vect(pInt);
- set_return_trap(pInt);
-
- /*
- * Retrieve two segments: one at V_BIOS, the other 64kB beyond the first.
- * This'll catch any BIOS that might have been initialised before server
- * entry.
- */
- vbiosMem = (char *)base + V_BIOS;
- (void)memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
- if (xf86ReadDomainMemory(pInt->Tag, V_BIOS, V_BIOS_SIZE, vbiosMem) <
- V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x0C0000.\n");
- else if ((((unsigned char *)vbiosMem)[0] == 0x55) &&
- (((unsigned char *)vbiosMem)[1] == 0xAA) &&
- (((unsigned char *)vbiosMem)[2] > 0x80))
- if (xf86ReadDomainMemory(pInt->Tag, V_BIOS + V_BIOS_SIZE, V_BIOS_SIZE,
- (unsigned char *)vbiosMem + V_BIOS_SIZE) < V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x0D0000.\n");
-
- /*
- * If this adapter is the primary, use its post-init BIOS (if we can find
- * it).
- */
- xf86int10ParseBiosLocation(options,&bios);
-
- {
- int bios_location = V_BIOS;
- Bool done = FALSE;
- vbiosMem = (unsigned char *)base + bios_location;
-
- if ((bios.bus == BUS_ISA)
- || (bios.bus != BUS_PCI && xf86IsEntityPrimary(entityIndex))) {
- if (bios.bus == BUS_ISA && bios.location.legacy) {
- xf86DrvMsg(screen, X_CONFIG,"Looking for legacy V_BIOS "
- "at 0x%x for %sprimary device\n",
- bios.location.legacy,
- xf86IsEntityPrimary(entityIndex) ? "" : "non-");
- bios_location = bios.location.legacy;
- vbiosMem = (unsigned char *)base + bios_location;
- }
- if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
- done = TRUE;
- else
- xf86DrvMsg(screen,X_INFO,
- "No legacy BIOS found -- trying PCI\n");
- }
- if (!done) {
- int pci_entity;
-
- if (bios.bus == BUS_PCI) {
- xf86DrvMsg(screen,X_CONFIG,"Looking for BIOS at PCI:%i%i%i\n",
- bios.location.pci.bus,bios.location.pci.dev,
- bios.location.pci.func);
- pci_entity = xf86GetPciEntity(bios.location.pci.bus,
- bios.location.pci.dev,
- bios.location.pci.func);
- } else
- pci_entity = pInt->entityIndex;
-
- if (!mapPciRom(pci_entity, vbiosMem)) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n");
- goto error1;
- }
- }
-
- }
-
- pInt->BIOSseg = V_BIOS >> 4;
- pInt->num = 0xe6;
- LockLegacyVGA(pInt, &vga);
- xf86ExecX86int10(pInt);
- UnlockLegacyVGA(pInt, &vga);
-#endif
- xfree(options);
- return pInt;
-
- error1:
- xfree(base);
- UnmapVRam(pInt);
- xfree(INTPriv(pInt)->alloc);
- xfree(pInt->private);
- error0:
- xfree(pInt);
- xfree(options);
-
- return NULL;
-}
-
-static void
-MapVRam(xf86Int10InfoPtr pInt)
-{
- int pagesize = getpagesize();
- int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
-
- INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
- pInt->Tag, V_RAM, size);
-
- pInt->ioBase = xf86Screens[pInt->scrnIndex]->domainIOBase;
-}
-
-static void
-UnmapVRam(xf86Int10InfoPtr pInt)
-{
- int screen = pInt->scrnIndex;
- int pagesize = getpagesize();
- int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
-
- xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
-}
-
-Bool
-MapCurrentInt10(xf86Int10InfoPtr pInt)
-{
- /* nothing to do here */
- return TRUE;
-}
-
-void
-xf86FreeInt10(xf86Int10InfoPtr pInt)
-{
- if (!pInt)
- return;
-#if defined (_PC)
- xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
-#endif
- if (Int10Current == pInt)
- Int10Current = NULL;
- xfree(INTPriv(pInt)->base);
- UnmapVRam(pInt);
- xfree(INTPriv(pInt)->alloc);
- xfree(pInt->private);
- xfree(pInt);
-}
-
-void *
-xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
-{
- int pagesize = getpagesize();
- int num_pages = ALLOC_ENTRIES(pagesize);
- int i,j;
-
- for (i = 0; i < (num_pages - num); i++) {
- if (INTPriv(pInt)->alloc[i] == 0) {
- for (j = i; j < (num + i); j++)
- if (INTPriv(pInt)->alloc[j] != 0)
- break;
- if (j == (num + i))
- break;
- i += num;
- }
- }
- if (i == (num_pages - num))
- return NULL;
-
- for (j = i; j < (i + num); j++)
- INTPriv(pInt)->alloc[j] = 1;
-
- *off = (i + 1) * pagesize;
-
- return (char *)INTPriv(pInt)->base + *off;
-}
-
-void
-xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
-{
- int pagesize = getpagesize();
- int first = (((char *)pbase - (char *)INTPriv(pInt)->base) / pagesize) - 1;
- int i;
-
- for (i = first; i < (first + num); i++)
- INTPriv(pInt)->alloc[i] = 0;
-}
-
-#define OFF(addr) ((addr) & 0xffff)
-#if defined _PC
-# define HIGH_OFFSET (INTPriv(pInt)->highMemory)
-# define HIGH_BASE V_BIOS
-#else
-# define HIGH_OFFSET SYS_BIOS
-# define HIGH_BASE SYS_BIOS
-#endif
-# define SYS(addr) ((addr) >= HIGH_OFFSET)
-#define V_ADDR(addr) \
- (SYS(addr) ? ((char*)INTPriv(pInt)->sysMem) + (addr - HIGH_BASE) \
- : (((char*)(INTPriv(pInt)->base) + addr)))
-#define VRAM_ADDR(addr) (addr - V_RAM)
-#define VRAM_BASE (INTPriv(pInt)->vRam)
-
-#define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
-#define V_ADDR_RB(addr) \
- (VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \
- : *(CARD8*) V_ADDR(addr)
-#define V_ADDR_RW(addr) \
- (VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \
- : ldw_u((pointer)V_ADDR(addr))
-#define V_ADDR_RL(addr) \
- (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
- : ldl_u((pointer)V_ADDR(addr))
-
-#define V_ADDR_WB(addr,val) \
- if(VRAM(addr)) \
- MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- *(CARD8*) V_ADDR(addr) = val;
-#define V_ADDR_WW(addr,val) \
- if(VRAM(addr)) \
- MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- stw_u((val),(pointer)(V_ADDR(addr)));
-
-#define V_ADDR_WL(addr,val) \
- if (VRAM(addr)) \
- MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- stl_u(val,(pointer)(V_ADDR(addr)));
-
-static CARD8
-read_b(xf86Int10InfoPtr pInt, int addr)
-{
- return V_ADDR_RB(addr);
-}
-
-static CARD16
-read_w(xf86Int10InfoPtr pInt, int addr)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 1) > 0)
- return V_ADDR_RW(addr);
-#endif
- return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8);
-}
-
-static CARD32
-read_l(xf86Int10InfoPtr pInt, int addr)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 3) > 2)
- return V_ADDR_RL(addr);
-#endif
- return V_ADDR_RB(addr) |
- (V_ADDR_RB(addr + 1) << 8) |
- (V_ADDR_RB(addr + 2) << 16) |
- (V_ADDR_RB(addr + 3) << 24);
-}
-
-static void
-write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
-{
- V_ADDR_WB(addr,val);
-}
-
-static void
-write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 1) > 0)
- { V_ADDR_WW(addr, val); }
-#endif
- V_ADDR_WB(addr, val);
- V_ADDR_WB(addr + 1, val >> 8);
-}
-
-static void
-write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 3) > 2)
- { V_ADDR_WL(addr, val); }
-#endif
- V_ADDR_WB(addr, val);
- V_ADDR_WB(addr + 1, val >> 8);
- V_ADDR_WB(addr + 2, val >> 16);
- V_ADDR_WB(addr + 3, val >> 24);
-}
-
-pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
-{
- return V_ADDR(addr);
-}
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
deleted file mode 100644
index 7528fea0e..000000000
--- a/hw/xfree86/int10/helper_exec.c
+++ /dev/null
@@ -1,606 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.26 2003/11/06 18:38:12 tsi Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- *
- * Part of this is based on code taken from DOSEMU
- * (C) Copyright 1992, ..., 1999 the "DOSEMU-Development-Team"
- */
-
-/*
- * To debug port accesses define PRINT_PORT.
- * Note! You also have to comment out ioperm()
- * in xf86EnableIO(). Otherwise we won't trap
- * on PIO.
- */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "int10Defines.h"
-#include "xf86int10.h"
-
-#if !defined (_PC) && !defined (_PC_PCI)
-static int pciCfg1in(CARD16 addr, CARD32 *val);
-static int pciCfg1out(CARD16 addr, CARD32 val);
-#endif
-#if defined (_PC)
-static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
-#endif
-
-#define REG pInt
-
-int
-setup_int(xf86Int10InfoPtr pInt)
-{
- if (pInt != Int10Current) {
- if (!MapCurrentInt10(pInt))
- return -1;
- Int10Current = pInt;
- }
- X86_EAX = (CARD32) pInt->ax;
- X86_EBX = (CARD32) pInt->bx;
- X86_ECX = (CARD32) pInt->cx;
- X86_EDX = (CARD32) pInt->dx;
- X86_ESI = (CARD32) pInt->si;
- X86_EDI = (CARD32) pInt->di;
- X86_EBP = (CARD32) pInt->bp;
- X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4;
- X86_EIP = 0x0600; X86_CS = 0x0; /* address of 'hlt' */
- X86_DS = 0x40; /* standard pc ds */
- X86_ES = pInt->es;
- X86_FS = 0;
- X86_GS = 0;
- X86_EFLAGS = X86_IF_MASK | X86_IOPL_MASK;
-#if defined (_PC)
- if (pInt->flags & SET_BIOS_SCRATCH)
- SetResetBIOSVars(pInt, TRUE);
-#endif
- return xf86BlockSIGIO();
-}
-
-void
-finish_int(xf86Int10InfoPtr pInt, int sig)
-{
- xf86UnblockSIGIO(sig);
- pInt->ax = (CARD32) X86_EAX;
- pInt->bx = (CARD32) X86_EBX;
- pInt->cx = (CARD32) X86_ECX;
- pInt->dx = (CARD32) X86_EDX;
- pInt->si = (CARD32) X86_ESI;
- pInt->di = (CARD32) X86_EDI;
- pInt->es = (CARD16) X86_ES;
- pInt->bp = (CARD32) X86_EBP;
- pInt->flags = (CARD32) X86_FLAGS;
-#if defined (_PC)
- if (pInt->flags & RESTORE_BIOS_SCRATCH)
- SetResetBIOSVars(pInt, FALSE);
-#endif
-}
-
-/* general software interrupt handler */
-CARD32
-getIntVect(xf86Int10InfoPtr pInt,int num)
-{
- return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
-}
-
-void
-pushw(xf86Int10InfoPtr pInt, CARD16 val)
-{
- X86_ESP -= 2;
- MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
-}
-
-int
-run_bios_int(int num, xf86Int10InfoPtr pInt)
-{
- CARD32 eflags;
-#ifndef _PC
- /* check if bios vector is initialized */
- if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ?*/
-
- if (num == 21 && X86_AH == 0x4e) {
- xf86DrvMsg(pInt->scrnIndex, X_NOTICE,
- "Failing Find-Matching-File on non-PC"
- " (int 21, func 4e)\n");
- X86_AX = 2;
- SET_FLAG(F_CF);
- return 1;
- } else {
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "Ignoring int 0x%02x call\n", num);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- return 1;
- }
- }
-#endif
-#ifdef PRINT_INT
- ErrorF("calling card BIOS at: ");
-#endif
- eflags = X86_EFLAGS;
-#if 0
- eflags = eflags | IF_MASK;
- X86_EFLAGS = X86_EFLAGS & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK);
-#endif
- pushw(pInt, eflags);
- pushw(pInt, X86_CS);
- pushw(pInt, X86_IP);
- X86_CS = MEM_RW(pInt, (num << 2) + 2);
- X86_IP = MEM_RW(pInt, num << 2);
-#ifdef PRINT_INT
- ErrorF("0x%x:%lx\n", X86_CS, X86_EIP);
-#endif
- return 1;
-}
-
-/* Debugging stuff */
-void
-dump_code(xf86Int10InfoPtr pInt)
-{
- int i;
- unsigned long lina = SEG_ADR((CARD32), X86_CS, IP);
-
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina);
- for (i=0; i<0x10; i++)
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
- xf86ErrorFVerb(3, "\n");
- for (; i<0x20; i++)
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
- xf86ErrorFVerb(3, "\n");
-}
-
-void
-dump_registers(xf86Int10InfoPtr pInt)
-{
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
- (unsigned long)X86_EAX, (unsigned long)X86_EBX,
- (unsigned long)X86_ECX, (unsigned long)X86_EDX);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
- (unsigned long)X86_ESP, (unsigned long)X86_EBP,
- (unsigned long)X86_ESI, (unsigned long)X86_EDI);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "CS=0x%4.4x, SS=0x%4.4x,"
- " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
- X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
- (unsigned long)X86_EIP, (unsigned long)X86_EFLAGS);
-}
-
-void
-stack_trace(xf86Int10InfoPtr pInt)
-{
- int i = 0;
- unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
- unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000);
-
- if (stack >= tail) return;
-
- xf86MsgVerb(X_INFO, 3, "stack at 0x%8.8lx:\n", stack);
- for (; stack < tail; stack++) {
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, stack));
- i = (i + 1) % 0x10;
- if (!i)
- xf86ErrorFVerb(3, "\n");
- }
- if (i)
- xf86ErrorFVerb(3, "\n");
-}
-
-int
-port_rep_inb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -1 : 1;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_insb(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- MEM_WB(pInt, dst, x_inb(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_inw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -2 : 2;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_insw(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- MEM_WW(pInt, dst, x_inw(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_inl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -4 : 4;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_insl(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- MEM_WL(pInt, dst, x_inl(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -1 : 1;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_outb(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- x_outb(port, MEM_RB(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -2 : 2;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_outw(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- x_outw(port, MEM_RW(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -4 : 4;
- CARD32 dst = base;
-#ifdef PRINT_PORT
- ErrorF(" rep_outl(%#x) %d bytes at %p %s\n",
- port, count, base, d_f ? "up" : "down");
-#endif
- while (count--) {
- x_outl(port, MEM_RL(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-CARD8
-x_inb(CARD16 port)
-{
- CARD8 val;
-
- if (port == 0x40) {
- Int10Current->inb40time++;
- val = (CARD8)(Int10Current->inb40time >>
- ((Int10Current->inb40time & 1) << 3));
-#ifdef PRINT_PORT
- ErrorF(" inb(%#x) = %2.2x\n", port, val);
-#endif
-#ifdef __NOT_YET__
- } else if (port < 0x0100) { /* Don't interfere with mainboard */
- val = 0;
- xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "inb 0x%4.4x\n", port);
- if (xf86GetVerbosity() > 3) {
- dump_registers(Int10Current);
- stack_trace(Int10Current);
- }
-#endif /* __NOT_YET__ */
- } else {
- val = inb(Int10Current->ioBase + port);
-#ifdef PRINT_PORT
- ErrorF(" inb(%#x) = %2.2x\n", port, val);
-#endif
- }
- return val;
-}
-
-CARD16
-x_inw(CARD16 port)
-{
- CARD16 val;
-
- if (port == 0x5c) {
- /*
- * Emulate a PC98's timer. Typical resolution is 3.26 usec.
- * Approximate this by dividing by 3.
- */
- long sec, usec;
- (void)getsecs(&sec, &usec);
- val = (CARD16)(usec / 3);
- } else {
- val = inw(Int10Current->ioBase + port);
- }
-#ifdef PRINT_PORT
- ErrorF(" inw(%#x) = %4.4x\n", port, val);
-#endif
- return val;
-}
-
-void
-x_outb(CARD16 port, CARD8 val)
-{
- if ((port == 0x43) && (val == 0)) {
- /*
- * Emulate a PC's timer 0. Such timers typically have a resolution of
- * some .838 usec per tick, but this can only provide 1 usec per tick.
- * (Not that this matters much, given inherent emulation delays.) Use
- * the bottom bit as a byte select. See inb(0x40) above.
- */
- long sec, usec;
- (void) getsecs(&sec, &usec);
- Int10Current->inb40time = (CARD16)(usec | 1);
-#ifdef PRINT_PORT
- ErrorF(" outb(%#x, %2.2x)\n", port, val);
-#endif
-#ifdef __NOT_YET__
- } else if (port < 0x0100) { /* Don't interfere with mainboard */
- xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "outb 0x%4.4x,0x%2.2x\n", port, val);
- if (xf86GetVerbosity() > 3) {
- dump_registers(Int10Current);
- stack_trace(Int10Current);
- }
-#endif /* __NOT_YET__ */
- } else {
-#ifdef PRINT_PORT
- ErrorF(" outb(%#x, %2.2x)\n", port, val);
-#endif
- outb(Int10Current->ioBase + port, val);
- }
-}
-
-void
-x_outw(CARD16 port, CARD16 val)
-{
-#ifdef PRINT_PORT
- ErrorF(" outw(%#x, %4.4x)\n", port, val);
-#endif
-
- outw(Int10Current->ioBase + port, val);
-}
-
-CARD32
-x_inl(CARD16 port)
-{
- CARD32 val;
-
-#if !defined(_PC) && !defined(_PC_PCI)
- if (!pciCfg1in(port, &val))
-#endif
- val = inl(Int10Current->ioBase + port);
-
-#ifdef PRINT_PORT
- ErrorF(" inl(%#x) = %8.8x\n", port, val);
-#endif
- return val;
-}
-
-void
-x_outl(CARD16 port, CARD32 val)
-{
-#ifdef PRINT_PORT
- ErrorF(" outl(%#x, %8.8x)\n", port, val);
-#endif
-
-#if !defined(_PC) && !defined(_PC_PCI)
- if (!pciCfg1out(port, val))
-#endif
- outl(Int10Current->ioBase + port, val);
-}
-
-CARD8
-Mem_rb(CARD32 addr)
-{
- return (*Int10Current->mem->rb)(Int10Current, addr);
-}
-
-CARD16
-Mem_rw(CARD32 addr)
-{
- return (*Int10Current->mem->rw)(Int10Current, addr);
-}
-
-CARD32
-Mem_rl(CARD32 addr)
-{
- return (*Int10Current->mem->rl)(Int10Current, addr);
-}
-
-void
-Mem_wb(CARD32 addr, CARD8 val)
-{
- (*Int10Current->mem->wb)(Int10Current, addr, val);
-}
-
-void
-Mem_ww(CARD32 addr, CARD16 val)
-{
- (*Int10Current->mem->ww)(Int10Current, addr, val);
-}
-
-void
-Mem_wl(CARD32 addr, CARD32 val)
-{
- (*Int10Current->mem->wl)(Int10Current, addr, val);
-}
-
-#if !defined(_PC) && !defined(_PC_PCI)
-static CARD32 PciCfg1Addr = 0;
-
-#define TAG(Cfg1Addr) (Cfg1Addr & 0xffff00)
-#define OFFSET(Cfg1Addr) (Cfg1Addr & 0xff)
-
-static int
-pciCfg1in(CARD16 addr, CARD32 *val)
-{
- if (addr == 0xCF8) {
- *val = PciCfg1Addr;
- return 1;
- }
- if (addr == 0xCFC) {
- *val = pciReadLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr));
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1out(CARD16 addr, CARD32 val)
-{
- if (addr == 0xCF8) {
- PciCfg1Addr = val;
- return 1;
- }
- if (addr == 0xCFC) {
- pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr),val);
- return 1;
- }
- return 0;
-}
-#endif
-
-CARD8
-bios_checksum(CARD8 *start, int size)
-{
- CARD8 sum = 0;
-
- while (size-- > 0)
- sum += *start++;
- return sum;
-}
-
-/*
- * Lock/Unlock legacy VGA. Some Bioses try to be very clever and make
- * an attempt to detect a legacy ISA card. If they find one they might
- * act very strange: for example they might configure the card as a
- * monochrome card. This might cause some drivers to choke.
- * To avoid this we attempt legacy VGA by writing to all know VGA
- * disable registers before we call the BIOS initialization and
- * restore the original values afterwards. In beween we hold our
- * breath. To get to a (possibly exising) ISA card need to disable
- * our current PCI card.
- */
-/*
- * This is just for booting: we just want to catch pure
- * legacy vga therefore we don't worry about mmio etc.
- * This stuff should really go into vgaHW.c. However then
- * the driver would have to load the vga-module prior to
- * doing int10.
- */
-void
-LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
-{
- xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
- vga->save_msr = inb(pInt->ioBase + 0x03CC);
- vga->save_vse = inb(pInt->ioBase + 0x03C3);
-#ifndef __ia64__
- vga->save_46e8 = inb(pInt->ioBase + 0x46E8);
-#endif
- vga->save_pos102 = inb(pInt->ioBase + 0x0102);
- outb(pInt->ioBase + 0x03C2, ~(CARD8)0x03 & vga->save_msr);
- outb(pInt->ioBase + 0x03C3, ~(CARD8)0x01 & vga->save_vse);
-#ifndef __ia64__
- outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
-#endif
- outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
- xf86SetCurrentAccess(TRUE, xf86Screens[pInt->scrnIndex]);
-}
-
-void
-UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
-{
- xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
- outb(pInt->ioBase + 0x0102, vga->save_pos102);
-#ifndef __ia64__
- outb(pInt->ioBase + 0x46E8, vga->save_46e8);
-#endif
- outb(pInt->ioBase + 0x03C3, vga->save_vse);
- outb(pInt->ioBase + 0x03C2, vga->save_msr);
- xf86SetCurrentAccess(TRUE, xf86Screens[pInt->scrnIndex]);
-}
-
-#if defined (_PC)
-static void
-SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
-{
- int pagesize = getpagesize();
- unsigned char* base = xf86MapVidMem(pInt->scrnIndex,
- VIDMEM_MMIO, 0, pagesize);
- int i;
-
- if (set) {
- for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
- MEM_WW(pInt, i, *(base + i));
- } else {
- for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
- *(base + i) = MEM_RW(pInt, i);
- }
-
- xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
-}
-
-void
-xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
-{
- int pagesize = getpagesize();
- unsigned char* base;
- int i;
-
- if (!xf86IsEntityPrimary(pInt->entityIndex)
- || (!save && !pInt->BIOSScratch))
- return;
-
- base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize);
- base += BIOS_SCRATCH_OFF;
- if (save) {
- if ((pInt->BIOSScratch
- = xnfalloc(BIOS_SCRATCH_LEN)))
- for (i = 0; i < BIOS_SCRATCH_LEN; i++)
- *(((char*)pInt->BIOSScratch + i)) = *(base + i);
- } else {
- if (pInt->BIOSScratch) {
- for (i = 0; i < BIOS_SCRATCH_LEN; i++)
- *(base + i) = *(pInt->BIOSScratch + i);
- xfree(pInt->BIOSScratch);
- pInt->BIOSScratch = NULL;
- }
- }
-
- xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize);
-}
-#endif
diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c
deleted file mode 100644
index 6de89c5d9..000000000
--- a/hw/xfree86/int10/helper_mem.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.26 2002/11/25 14:05:01 eich Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#include "xf86Pci.h"
-#define _INT10_PRIVATE
-#if 0
-#include "int10Defines.h"
-#endif
-#include "xf86int10.h"
-
-#define REG pInt
-
-typedef enum {
- OPT_NOINT10,
- OPT_INIT_PRIMARY,
- OPT_BIOS_LOCATION
-} INT10Opts;
-
-static const OptionInfoRec INT10Options[] = {
- {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE },
- {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE },
- {OPT_BIOS_LOCATION, "BiosLocation", OPTV_STRING, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-#ifdef DEBUG
-void
-dprint(unsigned long start, unsigned long size)
-{
- int i,j;
- char *c = (char *)start;
-
- for (j = 0; j < (size >> 4); j++) {
- char *d = c;
- ErrorF("\n0x%lx: ",(unsigned long)c);
- for (i = 0; i<16; i++)
- ErrorF("%2.2x ",(unsigned char) (*(c++)));
- c = d;
- for (i = 0; i<16; i++) {
- ErrorF("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
- (unsigned char) (*(c)): '.');
- c++;
- }
- }
- ErrorF("\n");
-}
-#endif
-
-#ifndef _PC
-/*
- * here we are really paranoid about faking a "real"
- * BIOS. Most of this information was pulled from
- * dosemu.
- */
-void
-setup_int_vect(xf86Int10InfoPtr pInt)
-{
- int i;
-
- /* let the int vects point to the SYS_BIOS seg */
- for (i = 0; i < 0x80; i++) {
- MEM_WW(pInt, i << 2, 0);
- MEM_WW(pInt, (i << 2) + 2, SYS_BIOS >> 4);
- }
-
- reset_int_vect(pInt);
- /* font tables default location (int 1F) */
- MEM_WW(pInt,0x1f<<2,0xfa6e);
-
- /* int 11 default location (Get Equipment Configuration) */
- MEM_WW(pInt, 0x11 << 2, 0xf84d);
- /* int 12 default location (Get Conventional Memory Size) */
- MEM_WW(pInt, 0x12 << 2, 0xf841);
- /* int 15 default location (I/O System Extensions) */
- MEM_WW(pInt, 0x15 << 2, 0xf859);
- /* int 1A default location (RTC, PCI and others) */
- MEM_WW(pInt, 0x1a << 2, 0xff6e);
- /* int 05 default location (Bound Exceeded) */
- MEM_WW(pInt, 0x05 << 2, 0xff54);
- /* int 08 default location (Double Fault) */
- MEM_WW(pInt, 0x08 << 2, 0xfea5);
- /* int 13 default location (Disk) */
- MEM_WW(pInt, 0x13 << 2, 0xec59);
- /* int 0E default location (Page Fault) */
- MEM_WW(pInt, 0x0e << 2, 0xef57);
- /* int 17 default location (Parallel Port) */
- MEM_WW(pInt, 0x17 << 2, 0xefd2);
- /* fdd table default location (int 1e) */
- MEM_WW(pInt, 0x1e << 2, 0xefc7);
-
- /* Set Equipment flag to VGA */
- i = MEM_RB(pInt, 0x0410) & 0xCF;
- MEM_WB(pInt, 0x0410, i);
- /* XXX Perhaps setup more of the BDA here. See also int42(0x00). */
-}
-#endif
-
-int
-setup_system_bios(void *base_addr)
-{
- char *base = (char *) base_addr;
-
- /*
- * we trap the "industry standard entry points" to the BIOS
- * and all other locations by filling them with "hlt"
- * TODO: implement hlt-handler for these
- */
- memset(base, 0xf4, 0x10000);
-
- /* set bios date */
- strcpy(base + 0x0FFF5, "06/11/99");
- /* set up eisa ident string */
- strcpy(base + 0x0FFD9, "PCI_ISA");
- /* write system model id for IBM-AT */
- *((unsigned char *)(base + 0x0FFFE)) = 0xfc;
-
- return 1;
-}
-
-void
-reset_int_vect(xf86Int10InfoPtr pInt)
-{
- /*
- * This table is normally located at 0xF000:0xF0A4. However, int 0x42,
- * function 0 (Mode Set) expects it (or a copy) somewhere in the bottom
- * 64kB. Note that because this data doesn't survive POST, int 0x42 should
- * only be used during EGA/VGA BIOS initialisation.
- */
- static const CARD8 VideoParms[] = {
- /* Timing for modes 0x00 & 0x01 */
- 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
- 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for modes 0x02 & 0x03 */
- 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
- 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for modes 0x04, 0x05 & 0x06 */
- 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70,
- 0x02, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for mode 0x07 */
- 0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19,
- 0x02, 0x0d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
- /* Display page lengths in little endian order */
- 0x00, 0x08, /* Modes 0x00 and 0x01 */
- 0x00, 0x10, /* Modes 0x02 and 0x03 */
- 0x00, 0x40, /* Modes 0x04 and 0x05 */
- 0x00, 0x40, /* Modes 0x06 and 0x07 */
- /* Number of columns for each mode */
- 40, 40, 80, 80, 40, 40, 80, 80,
- /* CGA Mode register value for each mode */
- 0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29,
- /* Padding */
- 0x00, 0x00, 0x00, 0x00
- };
- int i;
-
- for (i = 0; i < sizeof(VideoParms); i++)
- MEM_WB(pInt, i + (0x1000 - sizeof(VideoParms)), VideoParms[i]);
- MEM_WW(pInt, 0x1d << 2, 0x1000 - sizeof(VideoParms));
- MEM_WW(pInt, (0x1d << 2) + 2, 0);
-
- MEM_WW(pInt, 0x10 << 2, 0xf065);
- MEM_WW(pInt, (0x10 << 2) + 2, SYS_BIOS >> 4);
- MEM_WW(pInt, 0x42 << 2, 0xf065);
- MEM_WW(pInt, (0x42 << 2) + 2, SYS_BIOS >> 4);
- MEM_WW(pInt, 0x6D << 2, 0xf065);
- MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4);
-}
-
-void
-set_return_trap(xf86Int10InfoPtr pInt)
-{
- /*
- * Here we set the exit condition: We return when we encounter
- * 'hlt' (=0xf4), which we locate at address 0x600 in x86 memory.
- */
- MEM_WB(pInt, 0x0600, 0xf4);
-
- /*
- * Allocate a segment for the stack
- */
- xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
-}
-
-void *
-xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
-{
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- OptionInfoPtr options = NULL;
-
- if (pEnt->device) {
- pointer configOptions = NULL;
-
- /* Check if xf86CollectOptions() has already been called */
- if (((pEnt->index < 0) ||
- !pScrn ||
- !(configOptions = pScrn->options)) &&
- pEnt->device)
- configOptions = pEnt->device->options;
-
- if (configOptions) {
- if (!(options = (OptionInfoPtr) xalloc(sizeof(INT10Options))))
- return NULL;
-
- (void)memcpy(options, INT10Options, sizeof(INT10Options));
- xf86ProcessOptions(pScrn->scrnIndex, configOptions, options);
- }
- }
- xfree(pEnt);
-
- return options;
-}
-
-Bool
-int10skip(void* options)
-{
- Bool noint10 = FALSE;
-
- if (!options) return FALSE;
-
- xf86GetOptValBool(options, OPT_NOINT10, &noint10);
- return noint10;
-}
-
-Bool
-int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem)
-{
- int size;
-
- if ((codeSeg & 0x1f) || /* Not 512-byte aligned otherwise */
- ((codeSeg << 4) < V_BIOS) ||
- ((codeSeg << 4) >= SYS_SIZE))
- return FALSE;
-
- if (xf86IsPc98())
- return FALSE;
-
- if ((*vbiosMem != 0x55) || (*(vbiosMem+1) != 0xAA) || !*(vbiosMem+2))
- return FALSE;
-
- size = *(vbiosMem + 2) * 512;
-
- if ((size + (codeSeg << 4)) > SYS_SIZE)
- return FALSE;
-
- if (bios_checksum(vbiosMem, size))
- xf86DrvMsg(scrnIndex, X_WARNING, "Bad V_BIOS checksum\n");
-
- return TRUE;
-}
-
-Bool
-initPrimary(void* options)
-{
- Bool initPrimary = FALSE;
-
- if (!options) return FALSE;
-
- xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
- return initPrimary;
-}
-
-/*
- * xf86int10ParseBiosLocation(): allows to set the location of the
- * BIOS. One may select a BIOS of another card for posting or the
- * legacy V_BIOS range located at 0xc0000 or an alternative address
- * (BUS_ISA).
- * This is only useful under very special circumstances and should
- * be used with extreme care.
- */
-void
-xf86int10ParseBiosLocation(void* options,
- xf86int10BiosLocationPtr bios)
-{
- char *s;
- char *p;
- char *str = NULL;
-
- if (options)
- str = xf86GetOptValString(options,OPT_BIOS_LOCATION);
-
- bios->bus = BUS_NONE;
- if (!str)
- return;
-
- s = xstrdup(str);
- p = strtok(s,":");
- if (xf86NameCmp(p,"pci") == 0) bios->bus = BUS_PCI;
- else
- if (xf86NameCmp(p,"primary") == 0) bios->bus = BUS_ISA;
-
- xfree(s);
-
- if (bios->bus == BUS_NONE) return;
-
- s = xstrdup(str);
- p = strchr(s, ':');
-
- switch (bios->bus) {
- case BUS_ISA:
- if (p)
- bios->location.legacy = atoi(++p);
- else
- bios->location.legacy = 0;
- break;
- case BUS_PCI:
- if (p) {
- bios->location.pci.bus = atoi(++p);
- if ((p = strchr(p, ':'))) {
- bios->location.pci.dev = atoi(++p);
- if ((p = strchr(p, ':'))) {
- bios->location.pci.func = atoi(++p);
- break;
- }
- }
- }
- /* fall through */
- bios->bus = BUS_NONE;
- break;
- default:
- break;
- }
- xfree(s);
-}
-
-
-
diff --git a/hw/xfree86/int10/pci.c b/hw/xfree86/int10/pci.c
deleted file mode 100644
index debd842e7..000000000
--- a/hw/xfree86/int10/pci.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.12 2002/04/04 14:05:51 eich Exp $ */
-
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include "xf86Pci.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-
-int
-mapPciRom(int pciEntity, unsigned char * address)
-{
- PCITAG tag;
- unsigned char *mem, *ptr;
- int length;
-
- pciVideoPtr pvp = xf86GetPciInfoForEntity(pciEntity);
-
- if (pvp == NULL) {
-#ifdef DEBUG
- ErrorF("mapPciRom: no PCI info\n");
-#endif
- return 0;
- }
-
- tag = pciTag(pvp->bus,pvp->device,pvp->func);
- length = 1 << pvp->biosSize;
-
- /* Read in entire PCI ROM */
- mem = ptr = xnfcalloc(length, 1);
- length = xf86ReadPciBIOS(0, tag, -1, ptr, length);
- if (length > 0)
- memcpy(address, ptr, length);
- /* unmap/close/disable PCI bios mem */
- xfree(mem);
-
-#ifdef DEBUG
- if (!length)
- ErrorF("mapPciRom: no BIOS found\n");
-#ifdef PRINT_PCI
- else
- dprint(address,0x20);
-#endif
-#endif
-
- return length;
-}
diff --git a/hw/xfree86/int10/stub.c b/hw/xfree86/int10/stub.c
deleted file mode 100644
index f6b38580c..000000000
--- a/hw/xfree86/int10/stub.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.4 2002/04/04 14:05:51 eich Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include "xf86.h"
-#include "xf86str.h"
-#include "xf86_OSproc.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-
-xf86Int10InfoPtr
-xf86InitInt10(int entityIndex)
-{
- return xf86ExtendedInitInt10(entityIndex, 0);
-}
-
-xf86Int10InfoPtr
-xf86ExtendedInitInt10(int entityIndex, int Flags)
-{
- return NULL;
-}
-
-Bool
-MapCurrentInt10(xf86Int10InfoPtr pInt)
-{
- return FALSE;
-}
-
-void
-xf86FreeInt10(xf86Int10InfoPtr pInt)
-{
- return;
-}
-
-void *
-xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
-{
- *off = 0;
- return NULL;
-}
-
-void
-xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
-{
- return;
-}
-
-Bool
-xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
-{
- return FALSE;
-}
-
-void
-xf86ExecX86int10(xf86Int10InfoPtr pInt)
-{
- return;
-}
-
-pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
-{
- return 0;
-}
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
deleted file mode 100644
index a74bbeacd..000000000
--- a/hw/xfree86/int10/xf86int10.c
+++ /dev/null
@@ -1,787 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.11 2003/03/21 22:26:11 tsi Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-#include "int10Defines.h"
-
-#define REG pInt
-
-xf86Int10InfoPtr Int10Current = NULL;
-
-static int int1A_handler(xf86Int10InfoPtr pInt);
-#ifndef _PC
-static int int42_handler(xf86Int10InfoPtr pInt);
-#endif
-static int intE6_handler(xf86Int10InfoPtr pInt);
-static PCITAG findPci(xf86Int10InfoPtr pInt, unsigned short bx);
-static CARD32 pciSlotBX(pciVideoPtr pvp);
-
-int
-int_handler(xf86Int10InfoPtr pInt)
-{
- int num = pInt->num;
- int ret = 0;
-
- switch (num) {
-#ifndef _PC
- case 0x10:
- case 0x42:
- case 0x6D:
- if (getIntVect(pInt, num) == I_S_DEFAULT_INT_VECT)
- ret = int42_handler(pInt);
- break;
-#endif
- case 0x1A:
- ret = int1A_handler(pInt);
- break;
- case 0xe6:
- ret = intE6_handler(pInt);
- break;
- default:
- break;
- }
-
- if (!ret)
- ret = run_bios_int(num, pInt);
-
- if (!ret) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "Halting on int 0x%2.2x!\n", num);
- dump_registers(pInt);
- stack_trace(pInt);
- }
-
- return ret;
-}
-
-#ifndef _PC
-/*
- * This is derived from a number of PC system BIOS'es. The intent here is to
- * provide very primitive video support, before an EGA/VGA BIOS installs its
- * own interrupt vector. Here, "Ignored" calls should remain so. "Not
- * Implemented" denotes functionality that can be implemented should the need
- * arise. What are "Not Implemented" throughout are video memory accesses.
- * Also, very little input validity checking is done here.
- */
-static int
-int42_handler(xf86Int10InfoPtr pInt)
-{
- switch (X86_AH) {
- case 0x00:
- /* Set Video Mode */
- /* Enter: AL = video mode number */
- /* Leave: Nothing */
- /* Implemented (except for clearing the screen) */
- { /* Localise */
- IOADDRESS ioport;
- int i;
- CARD16 int1d, regvals, tmp;
- CARD8 mode, cgamode, cgacolour;
-
- /*
- * Ignore all mode numbers but 0x00-0x13. Some systems also ignore
- * 0x0B and 0x0C, but don't do that here.
- */
- if (X86_AL > 0x13)
- break;
-
- /*
- * You didn't think that was really the mode set, did you? There
- * are only so many slots in the video parameter table...
- */
- mode = X86_AL;
- ioport = 0x03D4;
- switch (MEM_RB(pInt, 0x0410) & 0x30) {
- case 0x30: /* MDA */
- mode = 0x07; /* Force mode to 0x07 */
- ioport = 0x03B4;
- break;
- case 0x10: /* CGA 40x25 */
- if (mode >= 0x07)
- mode = 0x01;
- break;
- case 0x20: /* CGA 80x25 (MCGA?) */
- if (mode >= 0x07)
- mode = 0x03;
- break;
- case 0x00: /* EGA/VGA */
- if (mode >= 0x07) /* Don't try MDA timings */
- mode = 0x01; /* !?!?! */
- break;
- }
-
- /* Locate data in video parameter table */
- int1d = MEM_RW(pInt, 0x1d << 2);
- regvals = ((mode >> 1) << 4) + int1d;
- cgacolour = 0x30;
- if (mode == 0x06) {
- regvals -= 0x10;
- cgacolour = 0x3F;
- }
-
- /** Update BIOS Data Area **/
-
- /* Video mode */
- MEM_WB(pInt, 0x0449, mode);
-
- /* Columns */
- tmp = MEM_RB(pInt, mode + int1d + 0x48);
- MEM_WW(pInt, 0x044A, tmp);
-
- /* Page length */
- tmp = MEM_RW(pInt, (mode & 0x06) + int1d + 0x40);
- MEM_WW(pInt, 0x044C, tmp);
-
- /* Start Address */
- MEM_WW(pInt, 0x044E, 0);
-
- /* Cursor positions, one for each display page */
- for (i = 0x0450; i < 0x0460; i += 2)
- MEM_WW(pInt, i, 0);
-
- /* Cursor start & end scanlines */
- tmp = MEM_RB(pInt, regvals + 0x0B);
- MEM_WB(pInt, 0x0460, tmp);
- tmp = MEM_RB(pInt, regvals + 0x0A);
- MEM_WB(pInt, 0x0461, tmp);
-
- /* Current display page number */
- MEM_WB(pInt, 0x0462, 0);
-
- /* CRTC I/O address */
- MEM_WW(pInt, 0x0463, ioport);
-
- /* CGA Mode register value */
- cgamode = MEM_RB(pInt, mode + int1d + 0x50);
- MEM_WB(pInt, 0x0465, cgamode);
-
- /* CGA Colour register value */
- MEM_WB(pInt, 0x0466, cgacolour);
-
- /* Rows */
- MEM_WB(pInt, 0x0484, (25 - 1));
-
- /* Remap I/O port number into its domain */
- ioport += pInt->ioBase;
-
- /* Programme the mode */
- outb(ioport + 4, cgamode & 0x37); /* Turn off screen */
- for (i = 0; i < 0x10; i++) {
- tmp = MEM_RB(pInt, regvals + i);
- outb(ioport, i);
- outb(ioport + 1, tmp);
- }
- outb(ioport + 5, cgacolour); /* Select colour mode */
- outb(ioport + 4, cgamode); /* Turn on screen */
- }
- break;
-
- case 0x01:
- /* Set Cursor Type */
- /* Enter: CH = starting line for cursor */
- /* CL = ending line for cursor */
- /* Leave: Nothing */
- /* Implemented */
- { /* Localise */
- IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
-
- MEM_WB(pInt, 0x0460, X86_CL);
- MEM_WB(pInt, 0x0461, X86_CH);
-
- outb(ioport, 0x0A);
- outb(ioport + 1, X86_CH);
- outb(ioport, 0x0B);
- outb(ioport + 1, X86_CL);
- }
- break;
-
- case 0x02:
- /* Set Cursor Position */
- /* Enter: BH = display page number */
- /* DH = row */
- /* DL = column */
- /* Leave: Nothing */
- /* Implemented */
- { /* Localise */
- IOADDRESS ioport;
- CARD16 offset;
-
- MEM_WB(pInt, (X86_BH << 1) + 0x0450, X86_DL);
- MEM_WB(pInt, (X86_BH << 1) + 0x0451, X86_DH);
-
- if (X86_BH != MEM_RB(pInt, 0x0462))
- break;
-
- offset = (X86_DH * MEM_RW(pInt, 0x044A)) + X86_DL;
- offset += MEM_RW(pInt, 0x044E) << 1;
-
- ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
- outb(ioport, 0x0E);
- outb(ioport + 1, offset >> 8);
- outb(ioport, 0x0F);
- outb(ioport + 1, offset & 0xFF);
- }
- break;
-
- case 0x03:
- /* Get Cursor Position */
- /* Enter: BH = display page number */
- /* Leave: CH = starting line for cursor */
- /* CL = ending line for cursor */
- /* DH = row */
- /* DL = column */
- /* Implemented */
- { /* Localise */
- X86_CL = MEM_RB(pInt, 0x0460);
- X86_CH = MEM_RB(pInt, 0x0461);
- X86_DL = MEM_RB(pInt, (X86_BH << 1) + 0x0450);
- X86_DH = MEM_RB(pInt, (X86_BH << 1) + 0x0451);
- }
- break;
-
- case 0x04:
- /* Get Light Pen Position */
- /* Enter: Nothing */
- /* Leave: AH = 0x01 (down/triggered) or 0x00 (not) */
- /* BX = pixel column */
- /* CX = pixel row */
- /* DH = character row */
- /* DL = character column */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- X86_AH = X86_BX = X86_CX = X86_DX = 0;
- }
- break;
-
- case 0x05:
- /* Set Display Page */
- /* Enter: AL = display page number */
- /* Leave: Nothing */
- /* Implemented */
- { /* Localise */
- IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
- CARD16 start;
- CARD8 x, y;
-
- /* Calculate new start address */
- MEM_WB(pInt, 0x0462, X86_AL);
- start = X86_AL * MEM_RW(pInt, 0x044C);
- MEM_WW(pInt, 0x044E, start);
- start <<= 1;
-
- /* Update start address */
- outb(ioport, 0x0C);
- outb(ioport + 1, start >> 8);
- outb(ioport, 0x0D);
- outb(ioport + 1, start & 0xFF);
-
- /* Switch cursor position */
- y = MEM_RB(pInt, (X86_AL << 1) + 0x0450);
- x = MEM_RB(pInt, (X86_AL << 1) + 0x0451);
- start += (y * MEM_RW(pInt, 0x044A)) + x;
-
- /* Update cursor position */
- outb(ioport, 0x0E);
- outb(ioport + 1, start >> 8);
- outb(ioport, 0x0F);
- outb(ioport + 1, start & 0xFF);
- }
- break;
-
- case 0x06:
- /* Initialise or Scroll Window Up */
- /* Enter: AL = lines to scroll up */
- /* BH = attribute for blank */
- /* CH = upper y of window */
- /* CL = left x of window */
- /* DH = lower y of window */
- /* DL = right x of window */
- /* Leave: Nothing */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n",
- pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- " AL=0x%2.2x, BH=0x%2.2x,"
- " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
- X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x07:
- /* Initialise or Scroll Window Down */
- /* Enter: AL = lines to scroll down */
- /* BH = attribute for blank */
- /* CH = upper y of window */
- /* CL = left x of window */
- /* DH = lower y of window */
- /* DL = right x of window */
- /* Leave: Nothing */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n",
- pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- " AL=0x%2.2x, BH=0x%2.2x,"
- " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
- X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x08:
- /* Read Character and Attribute at Cursor */
- /* Enter: BH = display page number */
- /* Leave: AH = attribute */
- /* AL = character */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at"
- " Cursor\n", pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "BH=0x%2.2x\n", X86_BH);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- X86_AX = 0;
- }
- break;
-
- case 0x09:
- /* Write Character and Attribute at Cursor */
- /* Enter: AL = character */
- /* BH = display page number */
- /* BL = attribute (text) or colour (graphics) */
- /* CX = replication count */
- /* Leave: Nothing */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at"
- " Cursor\n", pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
- X86_AL, X86_BH, X86_BL, X86_CX);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x0a:
- /* Write Character at Cursor */
- /* Enter: AL = character */
- /* BH = display page number */
- /* BL = colour */
- /* CX = replication count */
- /* Leave: Nothing */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n",
- pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
- X86_AL, X86_BH, X86_BL, X86_CX);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x0b:
- /* Set Palette, Background or Border */
- /* Enter: BH = 0x00 or 0x01 */
- /* BL = colour or palette (respectively) */
- /* Leave: Nothing */
- /* Implemented */
- { /* Localise */
- IOADDRESS ioport = MEM_RW(pInt, 0x0463) + 5 + pInt->ioBase;
- CARD8 cgacolour = MEM_RB(pInt, 0x0466);
-
- if (X86_BH) {
- cgacolour &= 0xDF;
- cgacolour |= (X86_BL & 0x01) << 5;
- } else {
- cgacolour &= 0xE0;
- cgacolour |= X86_BL & 0x1F;
- }
-
- MEM_WB(pInt, 0x0466, cgacolour);
- outb(ioport, cgacolour);
- }
- break;
-
- case 0x0c:
- /* Write Graphics Pixel */
- /* Enter: AL = pixel value */
- /* BH = display page number */
- /* CX = column */
- /* DX = row */
- /* Leave: Nothing */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n",
- X86_AL, X86_BH, X86_CX, X86_DX);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x0d:
- /* Read Graphics Pixel */
- /* Enter: BH = display page number */
- /* CX = column */
- /* DX = row */
- /* Leave: AL = pixel value */
- /* Not Implemented */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n",
- X86_BH, X86_CX, X86_DX);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- X86_AL = 0;
- }
- break;
-
- case 0x0e:
- /* Write Character in Teletype Mode */
- /* Enter: AL = character */
- /* BH = display page number */
- /* BL = foreground colour */
- /* Leave: Nothing */
- /* Not Implemented */
- /* WARNING: Emulation of BEL characters will require */
- /* emulation of RTC and PC speaker I/O. */
- /* Also, this recurses through int 0x10 */
- /* which might or might not have been */
- /* installed yet. */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n",
- pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n",
- X86_AL, X86_BH, X86_BL);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- case 0x0f:
- /* Get Video Mode */
- /* Enter: Nothing */
- /* Leave: AH = number of columns */
- /* AL = video mode number */
- /* BH = display page number */
- /* Implemented */
- { /* Localise */
- X86_AH = MEM_RW(pInt, 0x044A);
- X86_AL = MEM_RB(pInt, 0x0449);
- X86_BH = MEM_RB(pInt, 0x0462);
- }
- break;
-
- case 0x10:
- /* Colour Control (subfunction in AL) */
- /* Enter: Various */
- /* Leave: Various */
- /* Ignored */
- break;
-
- case 0x11:
- /* Font Control (subfunction in AL) */
- /* Enter: Various */
- /* Leave: Various */
- /* Ignored */
- break;
-
- case 0x12:
- /* Miscellaneous (subfunction in BL) */
- /* Enter: Various */
- /* Leave: Various */
- /* Ignored. Previous code here optionally allowed */
- /* the enabling and disabling of VGA, but no system */
- /* BIOS I've come across actually implements it. */
- break;
-
- case 0x13:
- /* Write String in Teletype Mode */
- /* Enter: AL = write mode */
- /* BL = attribute (if (AL & 0x02) == 0) */
- /* CX = string length */
- /* DH = row */
- /* DL = column */
- /* ES:BP = string segment:offset */
- /* Leave: Nothing */
- /* Not Implemented */
- /* WARNING: Emulation of BEL characters will require */
- /* emulation of RTC and PC speaker I/O. */
- /* Also, this recurses through int 0x10 */
- /* which might or might not have been */
- /* installed yet. */
- { /* Localise */
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n",
- pInt->num);
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
- "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x,"
- " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n",
- X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- }
- break;
-
- default:
- /* Various extensions */
- /* Enter: Various */
- /* Leave: Various */
- /* Ignored */
- break;
- }
-
- return 1;
-}
-#endif
-
-#define SUCCESSFUL 0x00
-#define DEVICE_NOT_FOUND 0x86
-#define BAD_REGISTER_NUMBER 0x87
-
-static int
-int1A_handler(xf86Int10InfoPtr pInt)
-{
- PCITAG tag;
- pciVideoPtr pvp;
-
- if (!(pvp = xf86GetPciInfoForEntity(pInt->entityIndex)))
- return 0; /* oops */
-
-#ifdef PRINT_INT
- ErrorF("int 0x1a: ax=0x%x bx=0x%x cx=0x%x dx=0x%x di=0x%x es=0x%x\n",
- X86_EAX, X86_EBX, X86_ECX, X86_EDX, X86_EDI, X86_ESI);
-#endif
- switch (X86_AX) {
- case 0xb101:
- X86_EAX &= 0xFF00; /* no config space/special cycle support */
- X86_EDX = 0x20494350; /* " ICP" */
- X86_EBX = 0x0210; /* Version 2.10 */
- X86_ECX &= 0xFF00;
- X86_ECX |= (pciNumBuses & 0xFF); /* Max bus number in system */
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
-#ifdef PRINT_INT
- ErrorF("ax=0x%x dx=0x%x bx=0x%x cx=0x%x flags=0x%x\n",
- X86_EAX, X86_EDX, X86_EBX, X86_ECX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb102:
- if (X86_DX == pvp->vendor && X86_CX == pvp->chipType && X86_ESI == 0) {
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- X86_EBX = pciSlotBX(pvp);
- }
-#ifdef SHOW_ALL_DEVICES
- else
- if ((pvp = xf86FindPciDeviceVendor(X86_EDX, X86_ECX, X86_ESI, pvp))) {
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- X86_EBX = pciSlotBX(pvp);
- }
-#endif
- else {
- X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x bx=0x%x flags=0x%x\n", X86_EAX, X86_EBX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb103:
- if (X86_CL == pvp->interface &&
- X86_CH == pvp->subclass &&
- ((X86_ECX & 0xFFFF0000) >> 16) == pvp->class) {
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EBX = pciSlotBX(pvp);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- }
-#ifdef SHOW_ALL_DEVICES
- else if ((pvp = xf86FindPciClass(X86_CL, X86_CH,
- (X86_ECX & 0xffff0000) >> 16,
- X86_ESI, pvp))) {
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- X86_EBX = pciSlotBX(pvp);
- }
-#endif
- else {
- X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb108:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- X86_CL = pciReadByte(tag, X86_EDI);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb109:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- X86_CX = pciReadWord(tag, X86_EDI);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb10a:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- X86_ECX = pciReadLong(tag, X86_EDI);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb10b:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- pciWriteByte(tag, X86_EDI, X86_CL);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb10c:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- pciWriteWord(tag, X86_EDI, X86_CX);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
-#endif
- return 1;
- case 0xb10d:
- if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
- pciWriteLong(tag, X86_EDI, X86_ECX);
- X86_EAX = X86_AL | (SUCCESSFUL << 8);
- X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
- } else {
- X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
- X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
- }
-#ifdef PRINT_INT
- ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
-#endif
- return 1;
- default:
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "int 0x1a subfunction\n");
- dump_registers(pInt);
- if (xf86GetVerbosity() > 3)
- stack_trace(pInt);
- return 0;
- }
-}
-
-static PCITAG
-findPci(xf86Int10InfoPtr pInt, unsigned short bx)
-{
- int bus = ((pInt->Tag >> 16) & ~0x00FF) | ((bx >> 8) & 0x00FF);
- int dev = (bx >> 3) & 0x1F;
- int func = bx & 0x7;
- if (xf86IsPciDevPresent(bus, dev, func))
- return pciTag(bus, dev, func);
- return PCI_NOT_FOUND;
-}
-
-static CARD32
-pciSlotBX(pciVideoPtr pvp)
-{
- return ((pvp->bus << 8) & 0x00FF00) | (pvp->device << 3) | (pvp->func);
-}
-
-/*
- * handle initialization
- */
-static int
-intE6_handler(xf86Int10InfoPtr pInt)
-{
- pciVideoPtr pvp;
-
- if ((pvp = xf86GetPciInfoForEntity(pInt->entityIndex)))
- X86_AX = (pvp->bus << 8) | (pvp->device << 3) | (pvp->func & 0x7);
- pushw(pInt, X86_CS);
- pushw(pInt, X86_IP);
- X86_CS = pInt->BIOSseg;
- X86_EIP = 0x0003;
- X86_ES = 0; /* standard pc es */
- return 1;
-}
diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h
deleted file mode 100644
index 843902c5e..000000000
--- a/hw/xfree86/int10/xf86int10.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.24 2002/07/23 14:22:46 tsi Exp $ */
-
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-
-#ifndef _XF86INT10_H
-#define _XF86INT10_H
-
-#include "Xmd.h"
-#include "Xdefs.h"
-#include "xf86Pci.h"
-
-#define SEG_ADDR(x) (((x) >> 4) & 0x00F000)
-#define SEG_OFF(x) ((x) & 0x0FFFF)
-
-#define SET_BIOS_SCRATCH 0x1
-#define RESTORE_BIOS_SCRATCH 0x2
-
-/* int10 info structure */
-typedef struct {
- int entityIndex;
- int scrnIndex;
- pointer cpuRegs;
- CARD16 BIOSseg;
- CARD16 inb40time;
- char * BIOSScratch;
- int Flags;
- pointer private;
- struct _int10Mem* mem;
- int num;
- int ax;
- int bx;
- int cx;
- int dx;
- int si;
- int di;
- int es;
- int bp;
- int flags;
- int stackseg;
- PCITAG Tag;
- IOADDRESS ioBase;
-} xf86Int10InfoRec, *xf86Int10InfoPtr;
-
-typedef struct _int10Mem {
- CARD8(*rb)(xf86Int10InfoPtr, int);
- CARD16(*rw)(xf86Int10InfoPtr, int);
- CARD32(*rl)(xf86Int10InfoPtr, int);
- void(*wb)(xf86Int10InfoPtr, int, CARD8);
- void(*ww)(xf86Int10InfoPtr, int, CARD16);
- void(*wl)(xf86Int10InfoPtr, int, CARD32);
-} int10MemRec, *int10MemPtr;
-
-typedef struct {
- CARD8 save_msr;
- CARD8 save_pos102;
- CARD8 save_vse;
- CARD8 save_46e8;
-} legacyVGARec, *legacyVGAPtr;
-
-typedef struct {
- BusType bus;
- union {
- struct {
- int bus;
- int dev;
- int func;
- } pci;
- int legacy;
- } location;
-} xf86int10BiosLocation, *xf86int10BiosLocationPtr;
-
-/* OS dependent functions */
-xf86Int10InfoPtr xf86InitInt10(int entityIndex);
-xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags);
-void xf86FreeInt10(xf86Int10InfoPtr pInt);
-void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off);
-void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
-pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
-
-/* x86 executor related functions */
-void xf86ExecX86int10(xf86Int10InfoPtr pInt);
-
-#ifdef _INT10_PRIVATE
-
-#define I_S_DEFAULT_INT_VECT 0xFF065
-#define SYS_SIZE 0x100000
-#define SYS_BIOS 0xF0000
-#if 1
-#define BIOS_SIZE 0x10000
-#else /* a bug in DGUX requires this - let's try it */
-#define BIOS_SIZE (0x10000 - 1)
-#endif
-#define LOW_PAGE_SIZE 0x600
-#define V_RAM 0xA0000
-#define VRAM_SIZE 0x20000
-#define V_BIOS_SIZE 0x10000
-#define V_BIOS 0xC0000
-#define BIOS_SCRATCH_OFF 0x449
-#define BIOS_SCRATCH_END 0x466
-#define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1)
-#define HIGH_MEM V_BIOS
-#define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM)
-#define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg))
-#define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg))
-
-#define X86_TF_MASK 0x00000100
-#define X86_IF_MASK 0x00000200
-#define X86_IOPL_MASK 0x00003000
-#define X86_NT_MASK 0x00004000
-#define X86_VM_MASK 0x00020000
-#define X86_AC_MASK 0x00040000
-#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
-#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
-#define X86_ID_MASK 0x00200000
-
-#define MEM_RB(name, addr) (*name->mem->rb)(name, addr)
-#define MEM_RW(name, addr) (*name->mem->rw)(name, addr)
-#define MEM_RL(name, addr) (*name->mem->rl)(name, addr)
-#define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val)
-#define MEM_WW(name, addr, val) (*name->mem->ww)(name, addr, val)
-#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
-
-/* OS dependent functions */
-Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
-/* x86 executor related functions */
-Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
-
-/* int.c */
-extern xf86Int10InfoPtr Int10Current;
-int int_handler(xf86Int10InfoPtr pInt);
-
-/* helper_exec.c */
-int setup_int(xf86Int10InfoPtr pInt);
-void finish_int(xf86Int10InfoPtr, int sig);
-CARD32 getIntVect(xf86Int10InfoPtr pInt, int num);
-void pushw(xf86Int10InfoPtr pInt, CARD16 val);
-int run_bios_int(int num, xf86Int10InfoPtr pInt);
-void dump_code(xf86Int10InfoPtr pInt);
-void dump_registers(xf86Int10InfoPtr pInt);
-void stack_trace(xf86Int10InfoPtr pInt);
-xf86Int10InfoPtr getInt10Rec(int entityIndex);
-CARD8 bios_checksum(CARD8 *start, int size);
-void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
-void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
-#if defined (_PC)
-void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
-#endif
-int port_rep_inb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_inw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_inl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-int port_rep_outl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count);
-
-CARD8 x_inb(CARD16 port);
-CARD16 x_inw(CARD16 port);
-void x_outb(CARD16 port, CARD8 val);
-void x_outw(CARD16 port, CARD16 val);
-CARD32 x_inl(CARD16 port);
-void x_outl(CARD16 port, CARD32 val);
-
-CARD8 Mem_rb(CARD32 addr);
-CARD16 Mem_rw(CARD32 addr);
-CARD32 Mem_rl(CARD32 addr);
-void Mem_wb(CARD32 addr, CARD8 val);
-void Mem_ww(CARD32 addr, CARD16 val);
-void Mem_wl(CARD32 addr, CARD32 val);
-
-/* helper_mem.c */
-void setup_int_vect(xf86Int10InfoPtr pInt);
-int setup_system_bios(void *base_addr);
-void reset_int_vect(xf86Int10InfoPtr pInt);
-void set_return_trap(xf86Int10InfoPtr pInt);
-void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
-Bool int10skip(void* options);
-Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem);
-Bool initPrimary(void* options);
-void xf86int10ParseBiosLocation(void* options,
- xf86int10BiosLocationPtr bios);
-#ifdef DEBUG
-void dprint(unsigned long start, unsigned long size);
-#endif
-
-/* pci.c */
-int mapPciRom(int pciEntity, unsigned char *address);
-
-#endif /* _INT10_PRIVATE */
-#endif /* _XF86INT10_H */
diff --git a/hw/xfree86/int10/xf86int10module.c b/hw/xfree86/int10/xf86int10module.c
deleted file mode 100644
index 9e679ca6a..000000000
--- a/hw/xfree86/int10/xf86int10module.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10module.c,v 1.2 2002/09/16 18:06:09 eich Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include "xf86.h"
-#include "xf86str.h"
-#include "xf86Pci.h"
-#include "xf86int10.h"
-
-
-#ifdef XFree86LOADER
-
-
-#ifndef MOD_NAME
-# define MOD_NAME int10
-#endif
-
-#define stringify(x) #x
-#define STRING(x) stringify(x)
-#define concat(x,y) x ## y
-#define combine(a,b) concat(a,b)
-#define NAME(x) combine(MOD_NAME,x)
-
-static MODULESETUPPROTO(NAME(Setup));
-
-static XF86ModuleVersionInfo NAME(VersRec) =
-{
- STRING(NAME( )),
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData NAME(ModuleData) = { &NAME(VersRec), NAME(Setup), NULL };
-
-static pointer
-NAME(Setup)(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- /*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
-
-#endif
diff --git a/hw/xfree86/int10/xf86x86emu.c b/hw/xfree86/int10/xf86x86emu.c
deleted file mode 100644
index 6998a0880..000000000
--- a/hw/xfree86/int10/xf86x86emu.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.13 2002/09/16 18:06:09 eich Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#include <x86emu.h>
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#include "xf86_OSproc.h"
-#include "xf86Pci.h"
-#include "xf86_libc.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-#include "int10Defines.h"
-
-#define M _X86EMU_env
-
-static void
-x86emu_do_int(int num)
-{
- Int10Current->num = num;
-
- if (!int_handler(Int10Current)) {
- X86EMU_halt_sys();
- }
-}
-
-void
-xf86ExecX86int10(xf86Int10InfoPtr pInt)
-{
- int sig = setup_int(pInt);
-
- if (sig < 0)
- return;
-
- if (int_handler(pInt)) {
- X86EMU_exec();
- }
-
- finish_int(pInt, sig);
-}
-
-Bool
-xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
-{
- int i;
- X86EMU_intrFuncs intFuncs[256];
- X86EMU_pioFuncs pioFuncs = {
- (&x_inb),
- (&x_inw),
- (&x_inl),
- (&x_outb),
- (&x_outw),
- (&x_outl)
- };
-
- X86EMU_memFuncs memFuncs = {
- (&Mem_rb),
- (&Mem_rw),
- (&Mem_rl),
- (&Mem_wb),
- (&Mem_ww),
- (&Mem_wl)
- };
-
- X86EMU_setupMemFuncs(&memFuncs);
-
- pInt->cpuRegs = &M;
- M.mem_base = 0;
- M.mem_size = 1024*1024 + 1024;
- X86EMU_setupPioFuncs(&pioFuncs);
-
- for (i=0;i<256;i++)
- intFuncs[i] = x86emu_do_int;
- X86EMU_setupIntrFuncs(intFuncs);
- return TRUE;
-}
-
-void
-printk(const char *fmt, ...)
-{
- va_list argptr;
- va_start(argptr, fmt);
- VErrorF(fmt, argptr);
- va_end(argptr);
-}
diff --git a/hw/xfree86/int10/xf86x86emu.h b/hw/xfree86/int10/xf86x86emu.h
deleted file mode 100644
index 67c37d5f4..000000000
--- a/hw/xfree86/int10/xf86x86emu.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.h,v 1.2 2001/01/06 20:19:13 tsi Exp $ */
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#ifndef XF86X86EMU_H_
-#define XF86X86EMU_H_
-#include <x86emu.h>
-
-#define M _X86EMU_env
-
-#define X86_EAX M.x86.R_EAX
-#define X86_EBX M.x86.R_EBX
-#define X86_ECX M.x86.R_ECX
-#define X86_EDX M.x86.R_EDX
-#define X86_ESI M.x86.R_ESI
-#define X86_EDI M.x86.R_EDI
-#define X86_EBP M.x86.R_EBP
-#define X86_EIP M.x86.R_EIP
-#define X86_ESP M.x86.R_ESP
-#define X86_EFLAGS M.x86.R_EFLG
-
-#define X86_FLAGS M.x86.R_FLG
-#define X86_AX M.x86.R_AX
-#define X86_BX M.x86.R_BX
-#define X86_CX M.x86.R_CX
-#define X86_DX M.x86.R_DX
-#define X86_SI M.x86.R_SI
-#define X86_DI M.x86.R_DI
-#define X86_BP M.x86.R_BP
-#define X86_IP M.x86.R_IP
-#define X86_SP M.x86.R_SP
-#define X86_CS M.x86.R_CS
-#define X86_DS M.x86.R_DS
-#define X86_ES M.x86.R_ES
-#define X86_SS M.x86.R_SS
-#define X86_FS M.x86.R_FS
-#define X86_GS M.x86.R_GS
-
-#define X86_AL M.x86.R_AL
-#define X86_BL M.x86.R_BL
-#define X86_CL M.x86.R_CL
-#define X86_DL M.x86.R_DL
-
-#define X86_AH M.x86.R_AH
-#define X86_BH M.x86.R_BH
-#define X86_CH M.x86.R_CH
-#define X86_DH M.x86.R_DH
-
-#endif
diff --git a/hw/xfree86/loader/SparcMulDiv.S b/hw/xfree86/loader/SparcMulDiv.S
deleted file mode 100644
index e7281593c..000000000
--- a/hw/xfree86/loader/SparcMulDiv.S
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Hardware integer division and multiplication routines for SPARC v8 and higher.
- *
- * Copyright (C) 1996 David S. Miller (davem@redhat.com)
- * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK OR DAVID MILLER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/SparcMulDiv.S,v 1.1 2000/11/02 19:10:54 dawes Exp $ */
-
- .globl urem_sparcv89, umul_sparcv89, udiv_sparcv89
- .globl rem_sparcv89, mul_sparcv89, div_sparcv89
-
- .align 32
-urem_sparcv89:
- wr %g0, 0x0, %y
- nop
- nop
- nop
- udiv %o0, %o1, %o2
- umul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
- .align 32
-umul_sparcv89:
- umul %o0, %o1, %o0
- retl
- rd %y, %o1
-
- .align 32
-udiv_sparcv89:
- wr %g0, 0x0, %y
- nop
- nop
- retl
- udiv %o0, %o1, %o0
-
- .align 32
-rem_sparcv89:
- sra %o0, 0x1f, %o4
- wr %o4, 0x0, %y
- nop
- nop
- nop
- sdivcc %o0, %o1, %o2
- bvs,a 1f
- xnor %o2, %g0, %o2
-1: smul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
- .align 32
-mul_sparcv89:
- smul %o0, %o1, %o0
- retl
- rd %y, %o1
- nop
-
- .align 32
-div_sparcv89:
- sra %o0, 0x1f, %o2
- wr %o2, 0x0, %y
- nop
- nop
- nop
- sdivcc %o0, %o1, %o0
- bvs,a 1f
- xnor %o0, %g0, %o0
-1: retl
- nop
diff --git a/hw/xfree86/loader/aout.h b/hw/xfree86/loader/aout.h
deleted file mode 100644
index cd7807531..000000000
--- a/hw/xfree86/loader/aout.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.8 2003/10/15 16:29:02 dawes Exp $ */
-
-/*
- * Borrowed from NetBSD's exec_aout.h
- *
- * Copyright (c) 1993, 1994 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christopher G. Demetriou.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _AOUT_H
-#define _AOUT_H
-
-#include "Xos.h"
-
-/* Get prototype for ntohl. */
-#include <ctype.h>
-
-/* OS/2 EMX has ntohl in this file */
-#ifdef __UNIXOS2__
-#include <sys/param.h>
-#endif
-
-#define __LDPGSZ 4096U
-#ifndef AOUT_PAGSIZ
-#define AOUT_PAGSIZ(ex) (__LDPGSZ)
-#endif
-
-/*
- * a.out header
- */
-typedef struct AOUT_exec {
- unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
- unsigned long a_text; /* text segment size */
- unsigned long a_data; /* initialized data size */
- unsigned long a_bss; /* uninitialized data size */
- unsigned long a_syms; /* symbol table size */
- unsigned long a_entry; /* entry point */
- unsigned long a_trsize; /* text relocation size */
- unsigned long a_drsize; /* data relocation size */
-} AOUTHDR;
-
-/* a_magic */
-#define OMAGIC 0407 /* old impure format */
-#define NMAGIC 0410 /* read-only text */
-#define ZMAGIC 0413 /* demand load format */
-#define QMAGIC 0314 /* "compact" demand load format; deprecated */
-
-/*
- * a_mid - keep sorted in numerical order for sanity's sake
- * ensure that: 0 < mid < 0x3ff
- */
-#define MID_ZERO 0 /* unknown - implementation dependent */
-#define MID_SUN010 1 /* sun 68010/68020 binary */
-#define MID_SUN020 2 /* sun 68020-only binary */
-#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */
-#define MID_HP200 200 /* hp200 (68010) BSD binary */
-#define MID_I386 134 /* i386 BSD binary */
-#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */
-#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */
-#define MID_NS32532 137 /* ns32532 */
-#define MID_SPARC 138 /* sparc */
-#define MID_PMAX 139 /* pmax */
-#define MID_VAX 140 /* vax */
-#define MID_ALPHA 141 /* Alpha BSD binary */
-#define MID_MIPS 142 /* big-endian MIPS */
-#define MID_ARM6 143 /* ARM6 */
-#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
-#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
-#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
-
-/*
- * a_flags
- */
-#define EX_DYNAMIC 0x20
-#define EX_PIC 0x10
-#define EX_DPMASK 0x30
-/*
- * Interpretation of the (a_flags & EX_DPMASK) bits:
- *
- * 00 traditional executable or object file
- * 01 object file contains PIC code (set by `as -k')
- * 10 dynamic executable
- * 11 position independent executable image
- * (eg. a shared library)
- *
- */
-
-/*
- * The a.out structure's a_midmag field is a network-byteorder encoding
- * of this int
- * FFFFFFmmmmmmmmmmMMMMMMMMMMMMMMMM
- * Where `F' is 6 bits of flag like EX_DYNAMIC,
- * `m' is 10 bits of machine-id like MID_I386, and
- * `M' is 16 bits worth of magic number, ie. ZMAGIC.
- * The macros below will set/get the needed fields.
- */
-#define AOUT_GETMAGIC(ex) \
- ( (((ex)->a_midmag)&0xffff0000U) ? (ntohl(((ex)->a_midmag))&0xffffU) : ((ex)->a_midmag))
-#define AOUT_GETMAGIC2(ex) \
- ( (((ex)->a_midmag)&0xffff0000U) ? (ntohl(((ex)->a_midmag))&0xffffU) : \
- (((ex)->a_midmag) | 0x10000) )
-#define AOUT_GETMID(ex) \
- ( (((ex)->a_midmag)&0xffff0000U) ? ((ntohl(((ex)->a_midmag))>>16)&0x03ffU) : MID_ZERO )
-#define AOUT_GETFLAG(ex) \
- ( (((ex)->a_midmag)&0xffff0000U) ? ((ntohl(((ex)->a_midmag))>>26)&0x3fU) : 0 )
-#define AOUT_SETMAGIC(ex,mag,mid,flag) \
- ( (ex)->a_midmag = htonl( (((flag)&0x3fU)<<26) | (((mid)&0x03ffU)<<16) | \
- (((mag)&0xffffU)) ) )
-
-#define AOUT_ALIGN(ex,x) \
- (AOUT_GETMAGIC(ex) == ZMAGIC || AOUT_GETMAGIC(ex) == QMAGIC ? \
- ((x) + __LDPGSZ - 1) & ~(__LDPGSZ - 1) : (x))
-
-/* Valid magic number check. */
-#define AOUT_BADMAG(ex) \
- (AOUT_GETMAGIC(ex) != NMAGIC && AOUT_GETMAGIC(ex) != OMAGIC && \
- AOUT_GETMAGIC(ex) != ZMAGIC && AOUT_GETMAGIC(ex) != QMAGIC)
-
-/* Address of the bottom of the text segment. */
-#define AOUT_TXTADDR(ex) (AOUT_GETMAGIC2(ex) == (ZMAGIC|0x10000) ? 0 : __LDPGSZ)
-
-/* Address of the bottom of the data segment. */
-#define AOUT_DATADDR(ex) \
- (AOUT_GETMAGIC(ex) == OMAGIC ? AOUT_TXTADDR(ex) + (ex)->a_text : \
- (AOUT_TXTADDR(ex) + (ex)->a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))
-
-/* Address of the bottom of the bss segment. */
-#define AOUT_BSSADDR(ex) \
- (AOUT_DATADDR(ex) + (ex)->a_data)
-
-/* Text segment offset. */
-#define AOUT_TXTOFF(ex) \
- ( AOUT_GETMAGIC2(ex)==ZMAGIC || AOUT_GETMAGIC2(ex)==(QMAGIC|0x10000) ? \
- 0 : (AOUT_GETMAGIC2(ex)==(ZMAGIC|0x10000) ? __LDPGSZ : \
- sizeof(struct AOUT_exec)) )
-
-/* Data segment offset. */
-#define AOUT_DATOFF(ex) \
- AOUT_ALIGN(ex, AOUT_TXTOFF(ex) + (ex)->a_text)
-
-/* Text relocation table offset. */
-#define AOUT_TRELOFF(ex) \
- (AOUT_DATOFF(ex) + (ex)->a_data)
-
-/* Data relocation table offset. */
-#define AOUT_DRELOFF(ex) \
- (AOUT_TRELOFF(ex) + (ex)->a_trsize)
-
-/* Symbol table offset. */
-#define AOUT_SYMOFF(ex) \
- (AOUT_DRELOFF(ex) + (ex)->a_drsize)
-
-/* String table offset. */
-#define AOUT_STROFF(ex) \
- (AOUT_SYMOFF(ex) + (ex)->a_syms)
-
-/* Relocation format. */
-struct relocation_info_i386 {
- int r_address; /* offset in text or data segment */
- unsigned int r_symbolnum:24, /* ordinal number of add symbol */
- r_pcrel:1, /* 1 if value should be pc-relative */
- r_length:2, /* log base 2 of value's width */
- r_extern:1, /* 1 if need to add symbol to value */
- r_baserel:1, /* linkage table relative */
- r_jmptable:1, /* relocate to jump table */
- r_relative:1, /* load address relative */
- r_copy:1; /* run time copy */
-};
-
-#define relocation_info relocation_info_i386
-
-/*
- * Symbol table entry format. The #ifdef's are so that programs including
- * nlist.h can initialize nlist structures statically.
- */
-typedef struct AOUT_nlist {
- union {
- char *n_name; /* symbol name (in memory) */
- long n_strx; /* file string table offset (on disk) */
- } n_un;
-
-#define AOUT_UNDF 0x00 /* undefined */
-#define AOUT_ABS 0x02 /* absolute address */
-#define AOUT_TEXT 0x04 /* text segment */
-#define AOUT_DATA 0x06 /* data segment */
-#define AOUT_BSS 0x08 /* bss segment */
-#define AOUT_INDR 0x0a /* alias definition */
-#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */
-#define AOUT_COMM 0x12 /* common reference */
-#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */
-#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */
-
-#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */
-#define AOUT_TYPE 0x1e /* mask for all the type bits */
- unsigned char n_type; /* type defines */
-
- char n_other; /* spare */
-#define n_hash n_desc /* used internally by ld(1); XXX */
- short n_desc; /* used by stab entries */
- unsigned long n_value; /* address/value of the symbol */
-} AOUT_nlist;
-
-#define AOUT_FORMAT "%08x" /* namelist value format; XXX */
-#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */
-
-#endif
diff --git a/hw/xfree86/loader/aoutloader.c b/hw/xfree86/loader/aoutloader.c
deleted file mode 100644
index f77b3d73c..000000000
--- a/hw/xfree86/loader/aoutloader.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.20 2003/10/15 17:46:00 dawes Exp $ */
-
-/*
- *
- * Copyright (c) 1997 Matthieu Herrb
- * Copyright 1995-1998 Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Modified 21/02/97 by Sebastien Marineau to support OS/2 a.out objects
- */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef __QNX__
-#include <fcntl.h>
-#else
-#include <sys/fcntl.h>
-#endif
-#include <sys/stat.h>
-#include <netinet/in.h>
-
-#ifdef DBMALLOC
-#include <debug/malloc.h>
-#define Xalloc(size) malloc(size)
-#define Xcalloc(size) calloc(1,(size))
-#define Xfree(size) free(size)
-#endif
-
-#include "Xos.h"
-#include "os.h"
-#include "aout.h"
-
-#include "sym.h"
-#include "loader.h"
-#include "aoutloader.h"
-
-#ifndef LOADERDEBUG
-#define LOADERDEBUG 0
-#endif
-
-#if LOADERDEBUG
-#define AOUTDEBUG ErrorF
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
-/*
- * This structure contains all of the information about a module
- * that has been loaded.
- */
-
-typedef struct {
- int handle;
- int module;
- int fd;
- loader_funcs *funcs;
- AOUTHDR *header; /* file header */
- unsigned char *text; /* Start address of the text section */
- unsigned int textsize; /* Size of the text section */
- unsigned char *data; /* Start address of the data section */
- unsigned int datasize; /* Size of the data section */
- unsigned char *bss; /* Start address of the bss data */
- unsigned int bsssize; /* Size of the bss section */
- struct relocation_info *txtrel; /* Start address of the text relocation table */
- struct relocation_info *datarel; /* Start address of the data relocation table */
- AOUT_nlist *symtab; /* Start address of the symbol table */
- unsigned char *strings; /* Start address of the string table */
- unsigned long strsize; /* size of string table */
- unsigned char *common; /* Start address of the common data */
- unsigned long comsize; /* size of common data */
-} AOUTModuleRec, *AOUTModulePtr;
-
-/*
- * If an relocation is unable to be satisfied, then put it on a list
- * to try later after more modules have been loaded.
- */
-typedef struct AOUT_RELOC {
- AOUTModulePtr file;
- struct relocation_info *rel;
- int type; /* AOUT_TEXT or AOUT_DATA */
- struct AOUT_RELOC *next;
-} AOUTRelocRec;
-
-/*
- * Symbols with a section number of 0 (N_UNDF) but a value of non-zero
- * need to have space allocated for them.
- *
- * Gather all of these symbols together, and allocate one chunk when we
- * are done.
- */
-
-typedef struct AOUT_COMMON {
- struct AOUT_nlist *sym;
- int index;
- struct AOUT_COMMON *next;
-} AOUTCommonRec;
-
-static AOUTCommonPtr listCOMMON = NULL;
-
-/* prototypes for static functions */
-static int AOUTHashCleanOut(void *, itemPtr);
-static char *AOUTGetSymbolName(AOUTModulePtr, struct AOUT_nlist *);
-static void *AOUTGetSymbolValue(AOUTModulePtr, int);
-static AOUTCommonPtr AOUTAddCommon(struct AOUT_nlist *, int);
-static LOOKUP *AOUTCreateCommon(AOUTModulePtr);
-static LOOKUP *AOUT_GetSymbols(AOUTModulePtr);
-static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int,
- struct relocation_info_i386 *);
-static AOUTRelocPtr AOUTCollectRelocations(AOUTModulePtr);
-static void AOUT_Relocate(unsigned long *, unsigned long, int);
-static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int,
- struct relocation_info_i386 *);
-
-/*
- * Return 1 if the symbol in item belongs to aoutfile
- */
-static int
-AOUTHashCleanOut(void *voidptr, itemPtr item)
-{
- AOUTModulePtr aoutfile = (AOUTModulePtr) voidptr;
-
- return (aoutfile->handle == item->handle);
-}
-
-/*
- * Manage listResolv
- */
-static AOUTRelocPtr
-AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
- struct relocation_info *rel)
-{
- AOUTRelocPtr reloc;
-
- if ((reloc = xf86loadermalloc(sizeof(AOUTRelocRec))) == NULL) {
- ErrorF("AOUTDelayRelocation() Unable to allocate memory\n");
- return NULL;
- }
- if ((unsigned long)rel < 0x200) {
- ErrorF("bug");
- }
- reloc->file = aoutfile;
- reloc->type = type;
- reloc->rel = rel;
- reloc->next = 0;
- return reloc;
-}
-
-/*
- * Manage listCOMMON
- */
-
-static AOUTCommonPtr
-AOUTAddCommon(struct AOUT_nlist *sym, int index)
-{
- AOUTCommonPtr common;
-
- if ((common = xf86loadermalloc(sizeof(AOUTCommonRec))) == NULL) {
- ErrorF("AOUTAddCommon() Unable to allocate memory\n");
- return 0;
- }
- common->sym = sym;
- common->index = index;
- common->next = 0;
- return common;
-}
-
-static LOOKUP *
-AOUTCreateCommon(AOUTModulePtr aoutfile)
-{
- int numsyms = 0, size = 0, l = 0;
- int offset = 0;
- AOUTCommonPtr common;
- LOOKUP *lookup;
-
- if (listCOMMON == NULL)
- return NULL;
-
- common = listCOMMON;
- for (common = listCOMMON; common; common = common->next) {
- /* Ensure long word alignment */
- if ((common->sym->n_value & (sizeof(long) - 1)) != 0)
- common->sym->n_value = (common->sym->n_value + (sizeof(long) - 1))
- & ~(sizeof(long) - 1);
-
- /* accumulate the sizes */
- size += common->sym->n_value;
- numsyms++;
- } /* while */
-
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUTCreateCommon() %d entries (%d bytes) of COMMON data\n",
- numsyms, size);
-#endif
-
- if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) {
- ErrorF("AOUTCreateCommon() Unable to allocate memory\n");
- return NULL;
- }
-
- aoutfile->comsize = size;
- if ((aoutfile->common = xf86loadercalloc(1, size)) == NULL) {
- ErrorF("AOUTCreateCommon() Unable to allocate memory\n");
- return NULL;
- }
-
- while (listCOMMON) {
- common = listCOMMON;
- lookup[l].symName = AOUTGetSymbolName(aoutfile, common->sym);
- lookup[l].offset = (funcptr) (aoutfile->common + offset);
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
- lookup[l].symName);
-#endif
- listCOMMON = common->next;
- offset += common->sym->n_value;
- xf86loaderfree(common);
- l++;
- } /* while */
- /* listCOMMON == NULL */
-
- lookup[l].symName = NULL; /* Terminate the list */
- return lookup;
-}
-
-/*
- * Symbol Table
- */
-
-static char *
-AOUTGetString(AOUTModulePtr aoutfile, int index)
-{
- char *symname = (char *)&(aoutfile->strings[index]);
-
- if (symname[0] == '_') {
- symname++;
- }
-
- return symname;
-}
-
-/*
- * Return the name of a symbol
- */
-static char *
-AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym)
-{
- char *symname = AOUTGetString(aoutfile, sym->n_un.n_strx);
- char *name;
-
- name = xf86loadermalloc(strlen(symname) + 1);
- if (!name)
- FatalError("AOUTGetSymbolName: Out of memory\n");
-
- strcpy(name, symname);
-
- return name;
-}
-
-/*
- * Return the value of a symbol in the loader's symbol table
- */
-static void *
-AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
-{
- void *symval = NULL; /* value of the indicated symbol */
- itemPtr symbol = NULL; /* name/value of symbol */
- char *name = NULL;
-
- name = AOUTGetSymbolName(aoutfile, aoutfile->symtab + index);
-
- if (name)
- symbol = LoaderHashFind(name);
-
- if (symbol)
- symval = (unsigned char *)symbol->address;
-
- xf86loaderfree(name);
- return symval;
-}
-
-/*
- * Perform the actual relocation
- */
-static void
-AOUT_Relocate(unsigned long *destl, unsigned long val, int pcrel)
-{
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUT_Relocate %p : %08lx %s",
- (void *)destl, *destl, pcrel == 1 ? "rel" : "abs");
-
-#endif
- if (pcrel) {
- /* relative to PC */
- *destl = val - ((unsigned long)destl + sizeof(long));
- } else {
- *destl += val;
- }
-#ifdef AOUTDEBUG
- AOUTDEBUG(" -> %08lx\n", *destl);
-#endif
-}
-
-/*
- * Fix the relocation for text or data section
- */
-static AOUTRelocPtr
-AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
- struct relocation_info *rel)
-{
- AOUTHDR *header = aoutfile->header;
- AOUT_nlist *symtab = aoutfile->symtab;
- int symnum;
- void *symval;
- unsigned long *destl; /* address of the location to be modified */
-
- symnum = rel->r_symbolnum;
-#ifdef AOUTDEBUG
- {
- char *name;
-
- if (rel->r_extern) {
- AOUTDEBUG("AOUT_RelocateEntry: extern %s\n",
- name = AOUTGetSymbolName(aoutfile, symtab + symnum));
- xf86loaderfree(name);
- } else {
- AOUTDEBUG("AOUT_RelocateEntry: intern\n");
- }
- AOUTDEBUG(" pcrel: %d", rel->r_pcrel);
- AOUTDEBUG(" length: %d", rel->r_length);
- AOUTDEBUG(" baserel: %d", rel->r_baserel);
- AOUTDEBUG(" jmptable: %d", rel->r_jmptable);
- AOUTDEBUG(" relative: %d", rel->r_relative);
- AOUTDEBUG(" copy: %d\n", rel->r_copy);
- }
-#endif /* AOUTDEBUG */
-
- if (rel->r_length != 2) {
- ErrorF("AOUT_ReloateEntry: length != 2\n");
- }
- /*
- * First find the address to modify
- */
- switch (type) {
- case AOUT_TEXT:
- /* Check that the relocation offset is in the text segment */
- if (rel->r_address > header->a_text) {
- ErrorF("AOUT_RelocateEntry(): "
- "text relocation out of text section\n");
- }
- destl = (unsigned long *)(aoutfile->text + rel->r_address);
- break;
- case AOUT_DATA:
- /* Check that the relocation offset is in the data segment */
- if (rel->r_address > header->a_data) {
- ErrorF("AOUT_RelocateEntry():"
- "data relocation out of data section\n");
- }
- destl = (unsigned long *)(aoutfile->data + rel->r_address);
- break;
- default:
- ErrorF("AOUT_RelocateEntry(): unknown section type %d\n", type);
- return 0;
- } /* switch */
-
- /*
- * Now handle the relocation
- */
- if (rel->r_extern) {
- /* Lookup the symbol in the loader's symbol table */
- symval = AOUTGetSymbolValue(aoutfile, symnum);
- if (symval != 0) {
- /* we've got the value */
- AOUT_Relocate(destl, (unsigned long)symval, rel->r_pcrel);
- return 0;
- } else {
- /* The symbol should be undefined */
- switch (symtab[symnum].n_type & AOUT_TYPE) {
- case AOUT_UNDF:
-#ifdef AOUTDEBUG
- AOUTDEBUG(" extern AOUT_UNDEF\n");
-#endif
- /* Add this relocation back to the global list */
- return AOUTDelayRelocation(aoutfile, type, rel);
-
- default:
- ErrorF("AOUT_RelocateEntry():"
- " impossible intern relocation type: %d\n",
- symtab[symnum].n_type);
- return 0;
- } /* switch */
- }
- } else {
- /* intern */
- switch (rel->r_symbolnum) {
- case AOUT_TEXT:
-#ifdef AOUTDEBUG
- AOUTDEBUG(" AOUT_TEXT\n");
-#endif
- /* Only absolute intern text relocations need to be handled */
- if (rel->r_pcrel == 0)
- AOUT_Relocate(destl, (unsigned long)aoutfile->text,
- rel->r_pcrel);
- return 0;
- case AOUT_DATA:
-#ifdef AOUTDEBUG
- AOUTDEBUG(" AOUT_DATA\n");
-#endif
- if (rel->r_pcrel == 0)
- AOUT_Relocate(destl, (unsigned long)aoutfile->data
- - header->a_text, rel->r_pcrel);
- else
- ErrorF("AOUT_RelocateEntry(): "
- "don't know how to handle data pc-relative reloc\n");
-
- return 0;
- case AOUT_BSS:
-#ifdef AOUTDEBUG
- AOUTDEBUG(" AOUT_BSS\n");
-#endif
- if (rel->r_pcrel == 0)
- AOUT_Relocate(destl, (unsigned long)aoutfile->bss
- - header->a_text - header->a_data,
- rel->r_pcrel);
- else
- ErrorF("AOUT_RelocateEntry(): "
- "don't know how to handle bss pc-relative reloc\n");
-
- return 0;
- default:
- ErrorF("AOUT_RelocateEntry():"
- " unknown intern relocation type: %d\n", rel->r_symbolnum);
- return 0;
- } /* switch */
- }
-} /* AOUT_RelocateEntry */
-
-static AOUTRelocPtr
-AOUTCollectRelocations(AOUTModulePtr aoutfile)
-{
- AOUTHDR *header = aoutfile->header;
- int i, nreloc;
- struct relocation_info *rel;
- AOUTRelocPtr reloc_head = NULL;
- AOUTRelocPtr tmp;
-
- /* Text relocations */
- if (aoutfile->text != NULL && aoutfile->txtrel != NULL) {
- nreloc = header->a_trsize / sizeof(struct relocation_info);
-
- for (i = 0; i < nreloc; i++) {
- rel = aoutfile->txtrel + i;
- tmp = AOUTDelayRelocation(aoutfile, AOUT_TEXT, rel);
- if (tmp) {
- tmp->next = reloc_head;
- reloc_head = tmp;
- }
- } /* for */
- }
- /* Data relocations */
- if (aoutfile->data != NULL && aoutfile->datarel != NULL) {
- nreloc = header->a_drsize / sizeof(struct relocation_info);
-
- for (i = 0; i < nreloc; i++) {
- rel = aoutfile->datarel + i;
- tmp = AOUTDelayRelocation(aoutfile, AOUT_DATA, rel);
- tmp->next = reloc_head;
- reloc_head = tmp;
- } /* for */
- }
- return reloc_head;
-} /* AOUTCollectRelocations */
-
-/*
- * AOUT_GetSymbols()
- *
- * add the symbols to the loader's symbol table
- */
-static LOOKUP *
-AOUT_GetSymbols(AOUTModulePtr aoutfile)
-{
- int fd = aoutfile->fd;
- AOUTHDR *header = aoutfile->header;
- int nsyms, soff, i, l;
- char *symname;
- AOUT_nlist *s;
- LOOKUP *lookup, *lookup_common;
- AOUTCommonPtr tmp;
-
- aoutfile->symtab = (AOUT_nlist *) _LoaderFileToMem(fd,
- AOUT_SYMOFF(header),
- header->a_syms,
- "symbols");
- nsyms = header->a_syms / sizeof(AOUT_nlist);
- lookup = xf86loadermalloc(nsyms * sizeof(LOOKUP));
- if (lookup == NULL) {
- ErrorF("AOUT_GetSymbols(): can't allocate memory\n");
- return NULL;
- }
- for (i = 0, l = 0; i < nsyms; i++) {
- s = aoutfile->symtab + i;
- soff = s->n_un.n_strx;
- if (soff == 0 || (s->n_type & AOUT_STAB) != 0)
- continue;
- symname = AOUTGetSymbolName(aoutfile, s);
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08lx\n",
- symname, s->n_type, s->n_other, s->n_value);
-#endif
- switch (s->n_type & AOUT_TYPE) {
- case AOUT_UNDF:
- if (s->n_value != 0) {
- if (!LoaderHashFind(symname)) {
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding common %s\n", symname);
-#endif
- tmp = AOUTAddCommon(s, i);
- if (tmp) {
- tmp->next = listCOMMON;
- listCOMMON = tmp;
- }
- }
- } else {
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding undef %s\n", symname);
-#endif
- }
- xf86loaderfree(symname);
- break;
- case AOUT_TEXT:
- if (s->n_type & AOUT_EXT) {
- lookup[l].symName = symname;
- /* text symbols start at 0 */
- lookup[l].offset = (funcptr) (aoutfile->text + s->n_value);
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding text %s %p\n", symname,
- (void *)lookup[l].offset);
-#endif
- l++;
- } else {
- xf86loaderfree(symname);
- }
- break;
- case AOUT_DATA:
- if (s->n_type & AOUT_EXT) {
- lookup[l].symName = symname;
- /* data symbols are following text */
- lookup[l].offset = (funcptr) (aoutfile->data +
- s->n_value - header->a_text);
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding data %s %p\n", symname,
- (void *)lookup[l].offset);
-#endif
- l++;
- } else {
- xf86loaderfree(symname);
- }
- break;
- case AOUT_BSS:
- if (s->n_type & AOUT_EXT) {
- lookup[l].symName = symname;
- /* bss symbols follow both text and data */
- lookup[l].offset = (funcptr) (aoutfile->bss + s->n_value
- - (header->a_data
- + header->a_text));
-#ifdef AOUTDEBUG
- AOUTDEBUG("Adding bss %s %p\n", symname,
- (void *)lookup[l].offset);
-#endif
- l++;
- } else {
- xf86loaderfree(symname);
- }
- break;
- case AOUT_FN:
-#ifdef AOUTDEBUG
- if (s->n_type & AOUT_EXT) {
- AOUTDEBUG("Ignoring AOUT_FN %s\n", symname);
- } else {
- AOUTDEBUG("Ignoring AOUT_WARN %s\n", symname);
- }
-#endif
- xf86loaderfree(symname);
- break;
- default:
- ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE);
- xf86loaderfree(symname);
- } /* switch */
- } /* for */
- lookup[l].symName = NULL;
-
- lookup_common = AOUTCreateCommon(aoutfile);
- if (lookup_common) {
- LOOKUP *p;
-
- for (i = 0, p = lookup_common; p->symName; i++, p++) ;
- memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP));
-
- xf86loaderfree(lookup_common);
- l += i;
- lookup[l].symName = NULL;
- }
- return lookup;
-} /* AOUT_GetSymbols */
-
-/*
- * Public API for the a.out implementation of the loader
- */
-void *
-AOUTLoadModule(loaderPtr modrec, int aoutfd, LOOKUP ** ppLookup)
-{
- AOUTModulePtr aoutfile = NULL;
- AOUTHDR *header;
- AOUTRelocPtr reloc, tail;
- void *v;
-
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUTLoadModule(%s, %d, %d)\n",
- modrec->name, modrec->handle, aoutfd);
-#endif
- if ((aoutfile = xf86loadercalloc(1, sizeof(AOUTModuleRec))) == NULL) {
- ErrorF("Unable to allocate AOUTModuleRec\n");
- return NULL;
- }
-
- aoutfile->handle = modrec->handle;
- aoutfile->module = modrec->module;
- aoutfile->fd = aoutfd;
- v = aoutfile->funcs = modrec->funcs;
-
- /*
- * Get the a.out header
- */
- aoutfile->header =
- (AOUTHDR *) _LoaderFileToMem(aoutfd, 0, sizeof(AOUTHDR),
- "header");
- header = (AOUTHDR *) aoutfile->header;
-
- /*
- * Load the 6 other sections
- */
- /* text */
- if (header->a_text != 0) {
- aoutfile->text = _LoaderFileToMem(aoutfile->fd,
- AOUT_TXTOFF(header),
- header->a_text, "text");
- aoutfile->textsize = header->a_text;
- } else {
- aoutfile->text = NULL;
- }
- /* data */
- if (header->a_data != 0) {
- aoutfile->data = _LoaderFileToMem(aoutfile->fd,
- AOUT_DATOFF(header),
- header->a_data, "data");
- aoutfile->datasize = header->a_data;
- } else {
- aoutfile->data = NULL;
- }
- /* bss */
- if (header->a_bss != 0) {
- aoutfile->bss = xf86loadercalloc(1, header->a_bss);
- aoutfile->bsssize = header->a_bss;
- } else {
- aoutfile->bss = NULL;
- }
- /* Text Relocations */
- if (header->a_trsize != 0) {
- aoutfile->txtrel = _LoaderFileToMem(aoutfile->fd,
- AOUT_TRELOFF(header),
- header->a_trsize, "txtrel");
- } else {
- aoutfile->txtrel = NULL;
- }
- /* Data Relocations */
- if (header->a_drsize != 0) {
- aoutfile->datarel = _LoaderFileToMem(aoutfile->fd,
- AOUT_DRELOFF(header),
- header->a_drsize, "datarel");
- } else {
- aoutfile->datarel = NULL;
- }
- /* String table */
- _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
- &(aoutfile->strsize), sizeof(int));
- if (aoutfile->strsize != 0) {
- aoutfile->strings = _LoaderFileToMem(aoutfile->fd,
- AOUT_STROFF(header),
- aoutfile->strsize, "strings");
- } else {
- aoutfile->strings = NULL;
- }
- /* load symbol table */
- *ppLookup = AOUT_GetSymbols(aoutfile);
-
- /* Do relocations */
- reloc = AOUTCollectRelocations(aoutfile);
-
- if (reloc) {
- for (tail = reloc; tail->next; tail = tail->next) ;
- tail->next = _LoaderGetRelocations(v)->aout_reloc;
- _LoaderGetRelocations(v)->aout_reloc = reloc;
- }
-
- return (void *)aoutfile;
-}
-
-void
-AOUTResolveSymbols(void *mod)
-{
- AOUTRelocPtr newlist, p, tmp;
-
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUTResolveSymbols()\n");
-#endif
-
- newlist = 0;
- for (p = _LoaderGetRelocations(mod)->aout_reloc; p;) {
- tmp = AOUT_RelocateEntry(p->file, p->type, p->rel);
- if (tmp) {
- /* Failed to relocate. Keep it in the list. */
- tmp->next = newlist;
- newlist = tmp;
- }
- tmp = p;
- p = p->next;
- xf86loaderfree(tmp);
- }
- _LoaderGetRelocations(mod)->aout_reloc = newlist;
-} /* AOUTResolveSymbols */
-
-int
-AOUTCheckForUnresolved(void *mod)
-{
- int symnum;
- AOUTRelocPtr crel;
- char *name;
- int fatalsym = 0, flag;
-
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUTCheckForUnResolved()\n");
-#endif
- if ((crel = _LoaderGetRelocations(mod)->aout_reloc) == NULL)
- return 0;
-
- while (crel) {
- if (crel->type == AOUT_TEXT) {
- /* Attempt to make unresolved text references
- * point to a default function */
- AOUT_Relocate((unsigned long *)(crel->file->text
- + crel->rel->r_address),
- (unsigned long)LoaderDefaultFunc,
- crel->rel->r_pcrel);
- }
- symnum = crel->rel->r_symbolnum;
- name = AOUTGetSymbolName(crel->file, crel->file->symtab + symnum);
- flag = _LoaderHandleUnresolved(name,
- _LoaderHandleToName(crel->file->
- handle));
- xf86loaderfree(name);
- if (flag)
- fatalsym = 1;
- crel = crel->next;
- }
- return fatalsym;
-}
-
-void
-AOUTUnloadModule(void *modptr)
-{
- AOUTModulePtr aoutfile = (AOUTModulePtr) modptr;
- AOUTRelocPtr relptr, *prevptr;
-
-#ifdef AOUTDEBUG
- AOUTDEBUG("AOUTUnLoadModule(0x%p)\n", modptr);
-#endif
-
-/*
- * Delete any unresolved relocations
- */
-
- relptr = _LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
- prevptr = &(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
-
- while (relptr) {
- if (relptr->file == aoutfile) {
- *prevptr = relptr->next;
- xf86loaderfree(relptr);
- relptr = *prevptr;
- } else {
- prevptr = &(relptr->next);
- relptr = relptr->next;
- }
- } /* while */
-
- /* clean the symbols table */
- LoaderHashTraverse((void *)aoutfile, AOUTHashCleanOut);
-
-#define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
-
- CheckandFree(aoutfile->strings, aoutfile->strsize);
- CheckandFree(aoutfile->symtab, aoutfile->header->a_syms);
- CheckandFree(aoutfile->datarel, aoutfile->header->a_drsize);
- CheckandFree(aoutfile->txtrel, aoutfile->header->a_trsize);
- CheckandFree(aoutfile->data, aoutfile->header->a_data);
- CheckandFree(aoutfile->text, aoutfile->header->a_text);
- /* Free allocated sections */
- if (aoutfile->bss != NULL) {
- xf86loaderfree(aoutfile->bss);
- }
- if (aoutfile->common != NULL) {
- xf86loaderfree(aoutfile->common);
- }
-
- /* Free header */
- _LoaderFreeFileMem(aoutfile->header, sizeof(AOUTHDR));
-
- /* Free the module structure itself */
- xf86loaderfree(aoutfile);
-
- return;
-}
-
-char *
-AOUTAddressToSection(void *modptr, unsigned long address)
-{
- AOUTModulePtr aoutfile = (AOUTModulePtr) modptr;
-
- if (address >= (unsigned long)aoutfile->text &&
- address <= (unsigned long)aoutfile->text + aoutfile->textsize) {
- return "text";
- }
- if (address >= (unsigned long)aoutfile->data &&
- address <= (unsigned long)aoutfile->data + aoutfile->datasize) {
- return "data";
- }
- if (address >= (unsigned long)aoutfile->bss &&
- address <= (unsigned long)aoutfile->bss + aoutfile->bsssize) {
- return "bss";
- }
-
- return NULL;
-}
diff --git a/hw/xfree86/loader/aoutloader.h b/hw/xfree86/loader/aoutloader.h
deleted file mode 100644
index b0e156319..000000000
--- a/hw/xfree86/loader/aoutloader.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 1997,1998 Metro Link, Inc.
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
-
-#ifndef _AOUTLOADER_H
-#define _AOUTLOADER_H
-extern void *AOUTLoadModule(loaderPtr, int, LOOKUP **);
-extern void AOUTResolveSymbols(void *);
-extern int AOUTCheckForUnresolved(void *);
-extern char *AOUTAddressToSection(void *, unsigned long);
-extern void AOUTUnloadModule(void *);
-#endif
diff --git a/hw/xfree86/loader/ar.h b/hw/xfree86/loader/ar.h
deleted file mode 100644
index 956b810a0..000000000
--- a/hw/xfree86/loader/ar.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
-
-#ifndef _AR_H
-#define _AR_H
-
-#define ARMAG "!<arch>\n"
-#define SARMAG 8
-#define ARFMAG "`\n"
-
-#if !(defined(__powerpc__) && defined(Lynx))
-struct ar_hdr {
- char ar_name[16];
- char ar_date[12];
- char ar_uid[6];
- char ar_gid[6];
- char ar_mode[8];
- char ar_size[10];
- char ar_fmag[2];
-};
-
-#else
-
-#define AIAMAG "<aiaff>\n"
-#define SAIAMAG 8
-#define AIAFMAG "`\n"
-
-struct fl_hdr { /* archive fixed length header - printable ascii */
- char fl_magic[SAIAMAG]; /* Archive file magic string */
- char fl_memoff[12]; /* Offset to member table */
- char fl_gstoff[12]; /* Offset to global symbol table */
- char fl_fstmoff[12]; /* Offset to first archive member */
- char fl_lstmoff[12]; /* Offset to last archive member */
- char fl_freeoff[12]; /* Offset to first mem on free list */
-};
-
-#define FL_HDR struct fl_hdr
-#define FL_HSZ sizeof(FL_HDR)
-
-struct ar_hdr { /* archive file member header - printable ascii */
- char ar_size[12]; /* file member size - decimal */
- char ar_nxtmem[12]; /* pointer to next member - decimal */
- char ar_prvmem[12]; /* pointer to previous member - decimal */
- char ar_date[12]; /* file member date - decimal */
- char ar_uid[12]; /* file member user id - decimal */
- char ar_gid[12]; /* file member group id - decimal */
- char ar_mode[12]; /* file member mode - octal */
- char ar_namlen[4]; /* file member name length - decimal */
- union {
- char an_name[2]; /* variable length member name */
- char an_fmag[2]; /* AIAFMAG - string to end header */
- } _ar_name; /* and variable length name */
-};
-
-#define ar_name _ar_name.an_name
-
-/*
- * Note: 'ar_namlen' contains the length of the member name which
- * may be up to 255 chars. The character string containing
- * the name begins at '_ar_name.ar_name'. The terminating
- * string AIAFMAG, is only cosmetic. File member contents begin
- * at the first even byte boundary past 'header position +
- * sizeof(struct ar_hdr) + ar_namlen', and continue for
- * 'ar_size' bytes.
-*/
-
-#define AR_HDR struct ar_hdr
-#define AR_HSZ sizeof(AR_HDR)
-
-#endif /* !__powerpc__ && Lynx */
-
-#endif /* _AR_H */
diff --git a/hw/xfree86/loader/coff.h b/hw/xfree86/loader/coff.h
deleted file mode 100644
index 52553278e..000000000
--- a/hw/xfree86/loader/coff.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.6 2003/10/15 16:29:02 dawes Exp $ */
-
-/* This file was implemented from the information in the book
- Understanding and Using COFF
- Gintaras R. Gircys
- O'Reilly, 1988
- and by looking at the Linux kernel code.
-
- It is therefore most likely free to use...
-
- If the file format changes in the COFF object, this file should be
- subsequently updated to reflect the changes.
-
- The actual loader module only uses a few of the COFF structures.
- Only those are included here. If you wish more information about
- COFF, thein check out the book mentioned above.
-*/
-
-#ifndef _COFF_H
-#define _COFF_H
-
-#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
-/*
- * Intel 386/486
- */
-
-/*
- * FILE HEADER
- */
-
-typedef struct COFF_filehdr {
- unsigned short f_magic; /* magic number */
- unsigned short f_nscns; /* number of sections */
- long f_timdat; /* time & date stamp */
- long f_symptr; /* file pointer to symtab */
- long f_nsyms; /* number of symtab entries */
- unsigned short f_opthdr; /* sizeof(optional hdr) */
- unsigned short f_flags; /* flags */
-} FILHDR;
-
-#define FILHSZ sizeof(FILHDR)
-
-/*
- * SECTION HEADER
- */
-
-typedef struct COFF_scnhdr {
- char s_name[8]; /* section name */
- long s_paddr; /* physical address */
- long s_vaddr; /* virtual address */
- long s_size; /* section size */
- long s_scnptr; /* raw data for section */
- long s_relptr; /* relocation */
- long s_lnnoptr; /* line numbers */
- unsigned short s_nreloc; /* number of relocation entries */
- unsigned short s_nlnno; /* number of line number entries */
- long s_flags; /* flags */
-} SCNHDR;
-
-#define COFF_SCNHDR struct COFF_scnhdr
-#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
-#define SCNHSZ COFF_SCNHSZ
-
-/*
- * the optional COFF header as used by Linux COFF
- */
-
-typedef struct {
- char magic[2]; /* type of file */
- char vstamp[2]; /* version stamp */
- char tsize[4]; /* text size in bytes */
- char dsize[4]; /* initialized data */
- char bsize[4]; /* uninitialized data */
- char entry[4]; /* entry point */
- char text_start[4]; /* base of text */
- char data_start[4]; /* base of data */
-} AOUTHDR;
-
-/*
- * SYMBOLS
- */
-
-typedef struct COFF_syment {
- union {
- char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */
- struct {
- long _n_zeroes; /* Leading zeros */
- long _n_offset; /* Offset for a header section */
- } _n_n;
- char *_n_nptr[2]; /* allows for overlaying */
- } _n;
-
- long n_value; /* address of the segment */
- short n_scnum; /* Section number */
- unsigned short n_type; /* Type of section */
- char n_sclass; /* Loader class */
- char n_numaux; /* Number of aux entries following */
-} SYMENT;
-
-#define n_name _n._n_name
-#define n_nptr _n._n_nptr[1]
-#define n_zeroes _n._n_n._n_zeroes
-#define n_offset _n._n_n._n_offset
-
-#define COFF_E_SYMNMLEN 8 /* characters in a short symbol name */
-#define COFF_E_FILNMLEN 14 /* characters in a file name */
-#define COFF_E_DIMNUM 4 /* array dimensions in aux entry */
-#define SYMNMLEN COFF_E_SYMNMLEN
-#define SYMESZ 18 /* not really sizeof(SYMENT) due to padding */
-
-/* Special section number found in the symbol section */
-#define N_UNDEF 0
-#define N_ABS -1
-#define N_DEBUG -2
-
-/* Symbol storage class values */
-#define C_NULL 0
-#define C_EXT 2
-#define C_FILE 103
-#define C_HIDEXT 107
-
-/*
- * AUX Entries
- */
-typedef struct COFF_auxent {
- long x_scnlen;
- long x_parmhash;
- unsigned short x_snhash;
- unsigned char x_smtyp;
- unsigned char x_smclas;
- long x_stab;
- unsigned short x_snstab;
-} AUXENT;
-
-/* Auxillary Symbol type values */
-#define XTY_ER 0 /* Enternal Reference */
-#define XTY_SD 1 /* csect section definition */
-#define XTY_LD 2 /* Label definition */
-#define XTY_CM 3 /* common csect definition */
-
-/* Auxillary Symbol storage mapping class values */
-#define XMC_PR 0 /* Program code */
-#define XMC_RO 1 /* Read-only constant */
-#define XMC_DB 2 /* Debug dictionary */
-#define XMC_TC 3 /* TOC entry */
-#define XMC_UA 4 /* Unclassified */
-#define XMC_RW 5 /* Read/write data */
-#define XMC_GL 6 /* Global linkage */
-#define XMC_XO 7 /* Extended operation */
-#define XMC_SV 8 /* Supervisor call descriptor */
-#define XMC_BS 9 /* BSS class */
-#define XMC_DS 10 /* Function descriptor csect */
-#define XMC_UC 11 /* Unnamed FORTRAN comon */
-#define XMC_TI 12 /* Reserved */
-#define XMC_TB 13 /* Reserved */
-#define XMC_TC0 15 /* TOC anchor */
-#define XMC_TD 16 /* Scalar data entry in TOC */
-
-/*
- * RELOCATION DIRECTIVES
- */
-
-typedef struct COFF_reloc {
- long r_vaddr; /* Virtual address of item */
- long r_symndx; /* Symbol index in the symtab */
-#if defined(__powerpc__)
- union {
- unsigned short _r_type; /* old style coff relocation type */
- struct {
- char _r_rsize; /* sign and reloc bit len */
- char _r_rtype; /* toc relocation type */
- } _r_r;
- } _r;
-#define r_otype _r._r_type /* old style reloc - original name */
-#define r_rsize _r._r_r._r_rsize /* extract sign and bit len */
-#define r_type _r._r_r._r_rtype /* extract toc relocation type */
-#else
- unsigned short r_type; /* Relocation type */
-#endif
-} RELOC;
-
-#define COFF_RELOC struct COFF_reloc
-#define COFF_RELSZ 10
-#define RELSZ COFF_RELSZ
-
-/*
- * x86 Relocation types
- */
-#define R_ABS 000
-#define R_DIR32 006
-#define R_PCRLONG 024
-
-#if defined(__powerpc__)
-/*
- * Power PC
- */
-#define R_LEN 0x1F /* extract bit-length field */
-#define R_SIGN 0x80 /* extract sign of relocation */
-#define R_FIXUP 0x40 /* extract code-fixup bit */
-
-#define RELOC_RLEN(x) ((x)._r._r_r._r_rsize & R_LEN)
-#define RELOC_RSIGN(x) ((x)._r._r_r._r_rsize & R_SIGN)
-#define RELOC_RFIXUP(x) ((x)._r._r_r._r_rsize & R_FIXUP)
-#define RELOC_RTYPE(x) ((x)._r._r_r._r_rtype)
-
-/*
- * POWER and PowerPC - relocation types
- */
-#define R_POS 0x00 /* A(sym) Positive Relocation */
-#define R_NEG 0x01 /* -A(sym) Negative Relocation */
-#define R_REL 0x02 /* A(sym-*) Relative to self */
-#define R_TOC 0x03 /* A(sym-TOC) Relative to TOC */
-#define R_TRL 0x12 /* A(sym-TOC) TOC Relative indirect load. */
- /* modifiable instruction */
-#define R_TRLA 0x13 /* A(sym-TOC) TOC Rel load address. modifiable inst */
-#define R_GL 0x05 /* A(external TOC of sym) Global Linkage */
-#define R_TCL 0x06 /* A(local TOC of sym) Local object TOC address */
-#define R_RL 0x0C /* A(sym) Pos indirect load. modifiable instruction */
-#define R_RLA 0x0D /* A(sym) Pos Load Address. modifiable instruction */
-#define R_REF 0x0F /* AL0(sym) Non relocating ref. No garbage collect */
-#define R_BA 0x08 /* A(sym) Branch absolute. Cannot modify instruction */
-#define R_RBA 0x18 /* A(sym) Branch absolute. modifiable instruction */
-#define R_RBAC 0x19 /* A(sym) Branch absolute constant. modifiable instr */
-#define R_BR 0x0A /* A(sym-*) Branch rel to self. non modifiable */
-#define R_RBR 0x1A /* A(sym-*) Branch rel to self. modifiable instr */
-#define R_RBRC 0x1B /* A(sym-*) Branch absolute const. */
- /* modifiable to R_RBR */
-#define R_RTB 0x04 /* A((sym-*)/2) RT IAR Rel Branch. non modifiable */
-#define R_RRTBI 0x14 /* A((sym-*)/2) RT IAR Rel Br. modifiable to R_RRTBA */
-#define R_RRTBA 0x15 /* A((sym-*)/2) RT absolute br. modifiable to R_RRTBI */
-#endif /* __powerpc */
-
-#endif /* _COFF_H */
diff --git a/hw/xfree86/loader/coffloader.c b/hw/xfree86/loader/coffloader.c
deleted file mode 100644
index b2fbfcf14..000000000
--- a/hw/xfree86/loader/coffloader.c
+++ /dev/null
@@ -1,1351 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.21 2003/10/15 17:40:15 dawes Exp $ */
-
-/*
- *
- * Copyright 1995,96 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#ifdef __QNX__
-#include <fcntl.h>
-#else
-#include <sys/fcntl.h>
-#endif
-#include <sys/stat.h>
-
-#ifdef DBMALLOC
-#include <debug/malloc.h>
-#define Xalloc(size) malloc(size)
-#define Xcalloc(size) calloc(1,(size))
-#define Xfree(size) free(size)
-#endif
-
-#include "Xos.h"
-#include "os.h"
-#include "coff.h"
-
-#include "sym.h"
-#include "loader.h"
-#include "coffloader.h"
-
-#include "compiler.h"
-
-#ifndef LOADERDEBUG
-#define LOADERDEBUG 0
-#endif
-
-#if LOADERDEBUG
-#define COFFDEBUG ErrorF
-#endif
-
-/*
- * This structure contains all of the information about a module
- * that has been loaded.
- */
-
-typedef struct {
- int handle;
- long module; /* Id of the module used to find inter module calls */
- int fd;
- loader_funcs *funcs;
- FILHDR *header; /* file header */
- AOUTHDR *optheader; /* optional file header */
- unsigned short numsh;
- SCNHDR *sections; /* Start address of the section table */
- int secsize; /* size of the section table */
- unsigned char **saddr; /* Start addresss of the sections table */
- unsigned char **reladdr; /* Start addresss of the relocation table */
- unsigned char *strtab; /* Start address of the string table */
- int strsize; /* size of the string table */
- unsigned char *text; /* Start address of the .text section */
- int txtndx; /* index of the .text section */
- long txtaddr; /* offset of the .text section */
- int txtsize; /* size of the .text section */
- int txtrelsize; /* size of the .rel.text section */
- unsigned char *data; /* Start address of the .data section */
- int datndx; /* index of the .data section */
- long dataddr; /* offset of the .data section */
- int datsize; /* size of the .data section */
- int datrelsize; /* size of the .rel.data section */
- unsigned char *bss; /* Start address of the .bss section */
- int bssndx; /* index of the .bss section */
- long bssaddr; /* offset of the .bss section */
- int bsssize; /* size of the .bss section */
- SYMENT *symtab; /* Start address of the .symtab section */
- int symndx; /* index of the .symtab section */
- int symsize; /* size of the .symtab section */
- unsigned char *common; /* Start address of the .common section */
- int comsize; /* size of the .common section */
- long toc; /* Offset of the TOC csect */
- unsigned char *tocaddr; /* Address of the TOC csect */
-} COFFModuleRec, *COFFModulePtr;
-
-/*
- * If any relocation is unable to be satisfied, then put it on a list
- * to try later after more modules have been loaded.
- */
-typedef struct _coff_reloc {
- COFFModulePtr file;
- RELOC *rel;
- int secndx;
- struct _coff_reloc *next;
-} COFFRelocRec;
-
-/*
- * Symbols with a section number of 0 (N_UNDEF) but a value of non-zero
- * need to have space allocated for them.
- *
- * Gather all of these symbols together, and allocate one chunk when we
- * are done.
- */
-
-typedef struct _coff_COMMON {
- SYMENT *sym;
- int index;
- struct _coff_COMMON *next;
-} COFFCommonRec;
-
-static COFFCommonPtr listCOMMON = NULL;
-
-/* Prototypes for static functions */
-static int COFFhashCleanOut(void *, itemPtr);
-static char *COFFGetSymbolName(COFFModulePtr, int);
-static COFFCommonPtr COFFAddCOMMON(SYMENT *, int);
-static LOOKUP *COFFCreateCOMMON(COFFModulePtr);
-static COFFRelocPtr COFFDelayRelocation(COFFModulePtr, int, RELOC *);
-static SYMENT *COFFGetSymbol(COFFModulePtr, int);
-static unsigned char *COFFGetSymbolValue(COFFModulePtr, int);
-static COFFRelocPtr COFF_RelocateEntry(COFFModulePtr, int, RELOC *);
-static LOOKUP *COFF_GetSymbols(COFFModulePtr);
-static void COFFCollectSections(COFFModulePtr);
-static COFFRelocPtr COFFCollectRelocations(COFFModulePtr);
-
-/*
- * Utility Functions
- */
-
-static int
-COFFhashCleanOut(void *voidptr, itemPtr item)
-{
- COFFModulePtr module = (COFFModulePtr) voidptr;
-
- return (module->handle == item->handle);
-}
-
-/*
- * Manage listResolv
- */
-static COFFRelocPtr
-COFFDelayRelocation(COFFModulePtr cofffile, int secndx, RELOC *rel)
-{
- COFFRelocPtr reloc;
-
- if ((reloc = xf86loadermalloc(sizeof(COFFRelocRec))) == NULL) {
- ErrorF("COFFDelayRelocation() Unable to allocate memory!!!!\n");
- return 0;
- }
-
- reloc->file = cofffile;
- reloc->secndx = secndx;
- reloc->rel = rel;
- reloc->next = 0;
-
- return reloc;
-}
-
-/*
- * Manage listCOMMON
- */
-
-static COFFCommonPtr
-COFFAddCOMMON(SYMENT *sym, int index)
-{
- COFFCommonPtr common;
-
- if ((common = xf86loadermalloc(sizeof(COFFCommonRec))) == NULL) {
- ErrorF("COFFAddCOMMON() Unable to allocate memory!!!!\n");
- return 0;
- }
- common->sym = sym;
- common->index = index;
- common->next = 0;
-
- return common;
-}
-
-static LOOKUP *
-COFFCreateCOMMON(COFFModulePtr cofffile)
-{
- int numsyms = 0, size = 0, l = 0;
- int offset = 0;
- LOOKUP *lookup;
- COFFCommonPtr common;
-
- if (listCOMMON == NULL)
- return NULL;
-
- common = listCOMMON;
- for (common = listCOMMON; common; common = common->next) {
- /* Ensure long word alignment */
- if (common->sym->n_value != 2 && common->sym->n_value != 1) /* But not for short and char ;-)(mr) */
- if (common->sym->n_value % 4 != 0)
- common->sym->n_value += 4 - (common->sym->n_value % 4);
-
- /* accumulate the sizes */
- size += common->sym->n_value;
- numsyms++;
- }
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
- numsyms, size);
-#endif
-
- if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) {
- ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n");
- return NULL;
- }
-
- cofffile->comsize = size;
- if ((cofffile->common = xf86loadercalloc(1, size)) == NULL) {
- ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n");
- return NULL;
- }
-
- /* Traverse the common list and create a lookup table with all the
- * common symbols. Destroy the common list in the process.
- * See also ResolveSymbols.
- */
- while (listCOMMON) {
- common = listCOMMON;
- lookup[l].symName = COFFGetSymbolName(cofffile, common->index);
- lookup[l].offset = (funcptr) (cofffile->common + offset);
-#ifdef COFFDEBUG
- COFFDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
- lookup[l].symName);
-#endif
- listCOMMON = common->next;
- offset += common->sym->n_value;
- xf86loaderfree(common);
- l++;
- }
- /* listCOMMON == NULL */
-
- lookup[l].symName = NULL; /* Terminate the list */
- return lookup;
-}
-
-/*
- * Symbol Table
- */
-
-/*
- * Get symbol name
- */
-static char *
-COFFGetSymbolName(COFFModulePtr cofffile, int index)
-{
- char *name;
- SYMENT *sym;
-
- sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (index * SYMESZ));
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolName(%p,%x) %lx", (void *)cofffile, index,
- sym->n_zeroes);
-#endif
-
- name = xf86loadermalloc(sym->n_zeroes ? SYMNMLEN + 1
- : strlen((const char *)&cofffile->
- strtab[(int)sym->n_offset - 4]) + 1);
- if (!name)
- FatalError("COFFGetSymbolName: Out of memory\n");
-
- if (sym->n_zeroes) {
- strncpy(name, sym->n_name, SYMNMLEN);
- name[SYMNMLEN] = '\000';
- } else {
- strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset - 4]);
- }
-#ifdef COFFDEBUG
- COFFDEBUG(" %s\n", name);
-#endif
- return name;
-}
-
-static SYMENT *
-COFFGetSymbol(COFFModulePtr file, int index)
-{
- return (SYMENT *) (((unsigned char *)file->symtab) + (index * SYMESZ));
-}
-
-static unsigned char *
-COFFGetSymbolValue(COFFModulePtr cofffile, int index)
-{
- unsigned char *symval = 0; /* value of the indicated symbol */
- itemPtr symbol; /* name/value of symbol */
- char *symname;
-
- symname = COFFGetSymbolName(cofffile, index);
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolValue() for %s=", symname);
-#endif
-
- symbol = LoaderHashFind(symname);
-
- if (symbol)
- symval = (unsigned char *)symbol->address;
-
-#ifdef COFFDEBUG
- COFFDEBUG("%p\n", symval);
-#endif
-
- xf86loaderfree(symname);
- return symval;
-}
-
-#if defined(__powerpc__)
-/*
- * This function returns the address of the glink routine for a symbol. This
- * address is used in cases where the function being called is not in the
- * same module as the calling function.
- */
-static unsigned char *
-COFFGetSymbolGlinkValue(COFFModulePtr cofffile, int index)
-{
- unsigned char *symval = 0; /* value of the indicated symbol */
- itemPtr symbol; /* name/value of symbol */
- char *name;
-
- name = COFFGetSymbolName(cofffile, index);
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name);
-#endif
-
- symbol = LoaderHashFind(name + 1); /* Eat the '.' so we get the
- * Function descriptor instead */
-
-/* Here we are building up a glink function that will change the TOC
- * pointer before calling a function that resides in a different module.
- * The following code is being used to implement this.
-
- 1 00000000 3d80xxxx lis r12,hi16(funcdesc)
- 2 00000004 618cxxxx ori r12,r12,lo16(funcdesc)
- 3 00000008 90410014 st r2,20(r1) # save old TOC pointer
- 4 0000000c 804c0000 l r2,0(r12) # Get address of functions
- 5 00000010 7c4903a6 mtctr r2 # load destination address
- 6 00000014 804c0004 l r2,4(r12) # get TOC of function
- 7 00000018 4e800420 bctr # branch to it
-
- */
- if (symbol) {
- symval = (unsigned char *)&symbol->code.glink;
-#ifdef COFFDEBUG
- COFFDEBUG("%x\n", symval);
- COFFDEBUG("glink_%s=%x\n", name, symval);
-#endif
- symbol->code.glink[0] = 0x3d80; /* lis r12 */
- symbol->code.glink[1] =
- ((unsigned long)symbol->address & 0xffff0000) >> 16;
- symbol->code.glink[2] = 0x618c; /* ori r12 */
- symbol->code.glink[3] = ((unsigned long)symbol->address & 0x0000ffff);
- symbol->code.glink[4] = 0x9041; /* st r2,20(r1) */
- symbol->code.glink[5] = 0x0014;
- symbol->code.glink[6] = 0x804c; /* l r2,0(r12) */
- symbol->code.glink[7] = 0x0000;
- symbol->code.glink[8] = 0x7c49; /* mtctr r2 */
- symbol->code.glink[9] = 0x03a6;
- symbol->code.glink[10] = 0x804c; /* l r2,4(r12) */
- symbol->code.glink[11] = 0x0004;
- symbol->code.glink[12] = 0x4e80; /* bctr */
- symbol->code.glink[13] = 0x0420;
- ppc_flush_icache(&symbol->code.glink[0]);
- ppc_flush_icache(&symbol->code.glink[12]);
- }
-
- xf86loaderfree(name);
- return symval;
-}
-#endif /* __powerpc__ */
-
-/*
- * Fix all of the relocation for the given section.
- */
-static COFFRelocPtr
-COFF_RelocateEntry(COFFModulePtr cofffile, int secndx, RELOC *rel)
-{
- SYMENT *symbol; /* value of the indicated symbol */
- unsigned long *dest32; /* address of the place being modified */
-
-#if defined(__powerpc__)
- unsigned short *dest16; /* address of the place being modified */
- itemPtr symitem; /* symbol structure from has table */
- char *name;
-#endif
- unsigned char *symval; /* value of the indicated symbol */
-
-/*
- * Note: Section numbers are 1 biased, while the cofffile->saddr[] array
- * of pointer is 0 biased, so alway have to account for the difference.
- */
-
-/*
- * Reminder: secndx is the section to which the relocation is applied.
- * symbol->n_scnum is the section in which the symbol value resides.
- */
-
-#ifdef COFFDEBUG
- COFFDEBUG("%lx %ld %o ", (unsigned long)rel->r_vaddr,
- rel->r_symndx, rel->r_type);
-#if defined(__powerpc__)
- COFFDEBUG("[%x %x %x] ",
- RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel));
-#endif
-#endif
- symbol = COFFGetSymbol(cofffile, rel->r_symndx);
-#ifdef COFFDEBUG
- COFFDEBUG("%d %lx %d-%d\n", symbol->n_sclass, symbol->n_value,
- symbol->n_scnum, secndx);
-#endif
-
-/*
- * Check to see if the relocation offset is part of the .text segment.
- * If not, we must change the offset to be relative to the .data section
- * which is NOT contiguous.
- */
- switch (secndx + 1) { /* change the bias */
- case N_TEXT:
- if ((long)rel->r_vaddr < cofffile->txtaddr ||
- (long)rel->r_vaddr >
- (long)(cofffile->txtaddr + cofffile->txtsize)) {
- FatalError("Relocation against N_TEXT not in .text section\n");
- }
- dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
- ((unsigned char *)rel->r_vaddr -
- cofffile->txtaddr));
- break;
- case N_DATA:
- if ((long)rel->r_vaddr < cofffile->dataddr ||
- (long)rel->r_vaddr >
- (long)(cofffile->dataddr + cofffile->datsize)) {
- FatalError("Relocation against N_DATA not in .data section\n");
- }
- dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
- ((unsigned char *)rel->r_vaddr -
- cofffile->dataddr));
- break;
- case N_BSS:
- if ((long)rel->r_vaddr < cofffile->bssaddr ||
- (long)rel->r_vaddr >
- (long)(cofffile->bssaddr + cofffile->bsssize)) {
- FatalError("Relocation against N_TEXT not in .bss section\n");
- }
- dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
- ((unsigned char *)rel->r_vaddr -
- cofffile->bssaddr));
- break;
- default:
- FatalError("Relocation against unknown section %d\n", secndx);
- }
-
- if (symbol->n_sclass == 0) {
- symval = (unsigned char *)(symbol->n_value + (*dest32) -
- symbol->n_type);
-#ifdef COFFDEBUG
- COFFDEBUG("symbol->n_sclass==0\n");
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- *dest32 = (unsigned long)symval;
- return 0;
- }
-
- switch (rel->r_type) {
-#if defined(i386)
- case R_DIR32:
- symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
- if (symval) {
-#ifdef COFFDEBUG
- char *namestr;
-
- COFFDEBUG("R_DIR32 %s\n",
- namestr = COFFGetSymbolName(cofffile, rel->r_symndx));
- xf86loaderfree(namestr);
- COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value);
- } else {
- switch (symbol->n_scnum) {
- case N_UNDEF:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_UNDEF\n");
-#endif
- return COFFDelayRelocation(cofffile, secndx, rel);
- case N_ABS:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_ABS\n");
-#endif
- return 0;
- case N_DEBUG:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_DEBUG\n");
-#endif
- return 0;
- case N_COMMENT:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_COMMENT\n");
-#endif
- return 0;
- case N_TEXT:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_TEXT\n");
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- (unsigned long)(cofffile->
- saddr[N_TEXT - 1]));
- break;
- case N_DATA:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_DATA\n");
- COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- ((unsigned long)(cofffile->
- saddr[N_DATA -
- 1])) -
- cofffile->dataddr);
- break;
- case N_BSS:
-#ifdef COFFDEBUG
- COFFDEBUG("R_DIR32 N_BSS\n");
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- (unsigned long)(cofffile->
- saddr[N_BSS - 1]) -
- (cofffile->bssaddr));
- break;
- default:
- ErrorF("R_DIR32 with unexpected section %d\n",
- symbol->n_scnum);
- }
-
- }
-#ifdef COFFDEBUG
- COFFDEBUG("*dest32=%8.8lx\n", *dest32);
-#endif
- break;
- case R_PCRLONG:
- if (symbol->n_scnum == N_TEXT)
- break;
-
- symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
-#ifdef COFFDEBUG
- COFFDEBUG("R_PCRLONG ");
- COFFDEBUG("dest32=%p\t", (void *)dest32);
- COFFDEBUG("symval=%p\t", symval);
- COFFDEBUG("*dest32=%8.8lx\t", *dest32);
-#endif
- if (symval == 0) {
-#ifdef COFFDEBUG
- char *name;
-
- COFFDEBUG("***Unable to resolve symbol %s\n",
- name = COFFGetSymbolName(cofffile, rel->r_symndx));
- xf86loaderfree(name);
-#endif
- return COFFDelayRelocation(cofffile, secndx, rel);
- }
- *dest32 = (unsigned long)(symval - ((long)dest32 + sizeof(long)));
-
-#ifdef COFFDEBUG
- COFFDEBUG("*dest32=%8.8lx\n", *dest32);
-#endif
- break;
- case R_ABS:
- /*
- * Nothing to really do here.
- * Usually, a dummy relocation for .file
- */
- break;
-#endif /* i386 */
-#if defined(__powerpc__)
- case R_POS:
- /*
- * Positive Relocation
- */
- if (RELOC_RLEN(*rel) != 0x1f)
- FatalError("R_POS with size != 32 bits");
- symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
- if (symval) {
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS ");
- COFFDEBUG("dest32=%x\t", dest32);
- COFFDEBUG("symval=%x\t", symval);
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
-#endif
- *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value);
- ppc_flush_icache(dest32);
- } else {
- switch (symbol->n_scnum) {
- case N_UNDEF:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_UNDEF\n");
-#endif
- return COFFDelayRelocation(cofffile, secndx, rel);
- case N_ABS:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_ABS\n");
-#endif
- return 0;
- case N_DEBUG:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_DEBUG\n");
-#endif
- return 0;
- case N_COMMENT:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_COMMENT\n");
-#endif
- return 0;
- case N_TEXT:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_TEXT\n");
- COFFDEBUG("dest32=%x\t", dest32);
- COFFDEBUG("symval=%x\t", symval);
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- ((unsigned long)(cofffile->
- saddr[N_TEXT -
- 1])) -
- cofffile->txtaddr);
- ppc_flush_icache(dest32);
- break;
- case N_DATA:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_DATA\n");
- COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
- COFFDEBUG("dest32=%x\t", dest32);
- COFFDEBUG("symval=%x\t", symval);
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- ((unsigned long)(cofffile->
- saddr[N_DATA -
- 1])) -
- cofffile->dataddr);
- ppc_flush_icache(dest32);
- break;
- case N_BSS:
-#ifdef COFFDEBUG
- COFFDEBUG("R_POS N_BSS\n");
- COFFDEBUG("dest32=%x\t", dest32);
- COFFDEBUG("symval=%x\t", symval);
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
-#endif
- *dest32 = (unsigned long)((*dest32) +
- (unsigned long)(cofffile->
- saddr[N_BSS - 1]) -
- (cofffile->bssaddr));
- ppc_flush_icache(dest32);
- break;
- default:
- ErrorF("R_POS with unexpected section %d\n", symbol->n_scnum);
- }
- }
-#ifdef COFFDEBUG
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
- COFFDEBUG("\n");
-#endif
- break;
- case R_TOC:
- /*
- * Relative to TOC
- */
- {
- dest16 = (unsigned short *)dest32;
- if (RELOC_RLEN(*rel) != 0x0f)
- FatalError("R_TOC with size != 16 bits");
-#ifdef COFFDEBUG
- COFFDEBUG("R_TOC ");
- COFFDEBUG("dest16=%x\t", dest16);
- COFFDEBUG("symbol=%x\t", symbol);
- COFFDEBUG("symbol->n_value=%x\t", symbol->n_value);
- COFFDEBUG("cofffile->toc=%x\t", cofffile->toc);
- COFFDEBUG("*dest16=%8.8x\t", *dest16);
-#endif
- *dest16 = (unsigned long)((symbol->n_value - cofffile->toc));
- ppc_flush_icache(dest16);
- }
-#ifdef COFFDEBUG
- COFFDEBUG("*dest16=%8.8x\t", *dest16);
- COFFDEBUG("\n");
-#endif
- break;
- case R_BR:
- /*
- * Branch relative to self, non-modifiable
- */
-
- if (RELOC_RLEN(*rel) != 0x19)
- FatalError("R_BR with size != 24 bits");
- name = COFFGetSymbolName(cofffile, rel->r_symndx);
- symitem = LoaderHashFind(name);
- if (symitem == 0) {
- name++;
- symitem = LoaderHashFind(name);
- }
- if (symitem && cofffile->module != symitem->module) {
-#ifdef COFFDEBUG
- COFFDEBUG("Symbol module %d != file module %d\n",
- symitem->module, cofffile->module);
-#endif
- symval = COFFGetSymbolGlinkValue(cofffile, rel->r_symndx);
- } else
- symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
- if (symval == 0) {
-#ifdef COFFDEBUG
- char *name;
-
- COFFDEBUG("***Unable to resolve symbol %s\n",
- name = COFFGetSymbolName(cofffile, rel->r_symndx));
- xf86loaderfree(name);
-#endif
- return COFFDelayRelocation(cofffile, secndx, rel);
- }
-#ifdef COFFDEBUG
- COFFDEBUG("R_BR ");
- COFFDEBUG("dest32=%x\t", dest32);
- COFFDEBUG("symval=%x\t", symval);
- COFFDEBUG("*dest32=%8.8x\t", *dest32);
-#endif
- {
- unsigned long val;
-
- val = ((unsigned long)symval - (unsigned long)dest32);
-#ifdef COFFDEBUG
- COFFDEBUG("val=%8.8x\n", val);
-#endif
- val = val >> 2;
- if ((val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000) {
- FatalError("R_BR offset %x too large\n", val << 2);
- break;
- }
- val &= 0x00ffffff;
-#ifdef COFFDEBUG
- COFFDEBUG("val=%8.8x\n", val);
-#endif
- /*
- * The address part contains the offset to the beginning
- * of the .text section. Disreguard this since we have
- * calculated the correct offset already.
- */
- (*dest32) = ((*dest32) & 0xfc000003) | (val << 2);
-#ifdef COFFDEBUG
- COFFDEBUG("*dest32=%8.8x\n", *dest32);
-#endif
- if (cofffile->module != symitem->module) {
- (*++dest32) = 0x80410014; /* lwz r2,20(r1) */
- }
- ppc_flush_icache(--dest32);
- }
-
- break;
-#endif /* __powerpc__ */
- default:
- ErrorF("COFF_RelocateEntry() Unsupported relocation type %o\n",
- rel->r_type);
- break;
- }
- return 0;
-}
-
-static COFFRelocPtr
-COFFCollectRelocations(COFFModulePtr cofffile)
-{
- unsigned short i, j;
- RELOC *rel;
- SCNHDR *sec;
- COFFRelocPtr reloc_head = NULL;
- COFFRelocPtr tmp;
-
- for (i = 0; i < cofffile->numsh; i++) {
- if (cofffile->saddr[i] == NULL)
- continue; /* Section not loaded!! */
- sec = &(cofffile->sections[i]);
- for (j = 0; j < sec->s_nreloc; j++) {
- rel = (RELOC *) (cofffile->reladdr[i] + (j * RELSZ));
- tmp = COFFDelayRelocation(cofffile, i, rel);
- tmp->next = reloc_head;
- reloc_head = tmp;
- }
- }
-
- return reloc_head;
-}
-
-/*
- * COFF_GetSymbols()
- *
- * add the symbols to the symbol table maintained by the loader.
- */
-
-static LOOKUP *
-COFF_GetSymbols(COFFModulePtr cofffile)
-{
- SYMENT *sym;
- AUXENT *aux = NULL;
- int i, l, numsyms;
- LOOKUP *lookup, *lookup_common, *p;
- char *symname;
-
-/*
- * Load the symbols into memory
- */
- numsyms = cofffile->header->f_nsyms;
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFF_GetSymbols(): %d symbols\n", numsyms);
-#endif
-
- cofffile->symsize = (numsyms * SYMESZ);
- cofffile->symtab =
- (SYMENT *) _LoaderFileToMem(cofffile->fd,
- cofffile->header->f_symptr,
- (numsyms * SYMESZ), "symbols");
-
- if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL)
- return NULL;
-
- for (i = 0, l = 0; i < numsyms; i++) {
- sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (i * SYMESZ));
- symname = COFFGetSymbolName(cofffile, i);
- if (sym->n_numaux > 0)
- aux = (AUXENT *) (((unsigned char *)cofffile->symtab) +
- ((i + 1) * SYMESZ));
- else
- aux = NULL;
-#ifdef COFFDEBUG
- COFFDEBUG("\t%d %d %lx %x %d %d %s\n",
- i, sym->n_scnum, sym->n_value, sym->n_type,
- sym->n_sclass, sym->n_numaux, symname);
- if (aux)
- COFFDEBUG("aux=\t%ld %lx %x %x %x %lx %x\n",
- aux->x_scnlen, aux->x_parmhash, aux->x_snhash,
- aux->x_smtyp, aux->x_smclas, aux->x_stab,
- aux->x_snstab);
-#endif
- i += sym->n_numaux;
- /*
- * check for TOC csect before discarding C_HIDEXT below
- */
- if (aux && aux->x_smclas == XMC_TC0) {
- if (sym->n_scnum != N_DATA)
- FatalError("TOC not in N_DATA section");
- cofffile->toc = sym->n_value;
- cofffile->tocaddr = (cofffile->saddr[sym->n_scnum - 1] +
- sym->n_value - (cofffile->dataddr));
-#ifdef COFFDEBUG
- COFFDEBUG("TOC=%lx\n", cofffile->toc);
- COFFDEBUG("TOCaddr=%p\n", cofffile->tocaddr);
-#endif
- continue;
- }
- if (sym->n_sclass == C_HIDEXT) {
-/*
- && aux && !(aux->x_smclas == XMC_DS
- && aux->x_smtyp == XTY_SD) ) ) {
-*/
-#ifdef COFFDEBUG
- COFFDEBUG("Skipping C_HIDEXT class symbol %s\n", symname);
-#endif
- continue;
- }
- switch (sym->n_scnum) {
- case N_UNDEF:
- if (sym->n_value != 0) {
- char *name;
- COFFCommonPtr tmp;
-
- name = COFFGetSymbolName(cofffile, i);
-#ifdef COFFDEBUG
- COFFDEBUG("Adding COMMON space for %s\n", name);
-#endif
- if (!LoaderHashFind(name)) {
- tmp = COFFAddCOMMON(sym, i);
- if (tmp) {
- tmp->next = listCOMMON;
- listCOMMON = tmp;
- }
- }
- xf86loaderfree(name);
- }
- xf86loaderfree(symname);
- break;
- case N_ABS:
- case N_DEBUG:
- case N_COMMENT:
-#ifdef COFFDEBUG
- COFFDEBUG("Freeing %s, section %d\n", symname, sym->n_scnum);
-#endif
- xf86loaderfree(symname);
- break;
- case N_TEXT:
- if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
- && cofffile->saddr[sym->n_scnum - 1]) {
- lookup[l].symName = symname;
- lookup[l].offset = (funcptr)
- (cofffile->saddr[sym->n_scnum - 1] +
- sym->n_value - cofffile->txtaddr);
-#ifdef COFFDEBUG
- COFFDEBUG("Adding %p %s\n",
- (void *)lookup[l].offset, lookup[l].symName);
-#endif
- l++;
- } else {
-#ifdef COFFDEBUG
- COFFDEBUG("TEXT Section not loaded %d\n", sym->n_scnum - 1);
-#endif
- xf86loaderfree(symname);
- }
- break;
- case N_DATA:
- /*
- * Note: COFF expects .data to be contiguous with
- * .data, so that offsets for .data are relative to
- * .text. We need to adjust for this, and make them
- * relative to .data so that the relocation can be
- * properly applied. This is needed becasue we allocate
- * .data seperately from .text.
- */
- if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
- && cofffile->saddr[sym->n_scnum - 1]) {
- lookup[l].symName = symname;
- lookup[l].offset = (funcptr)
- (cofffile->saddr[sym->n_scnum - 1] +
- sym->n_value - cofffile->dataddr);
-#ifdef COFFDEBUG
- COFFDEBUG("Adding %p %s\n",
- (void *)lookup[l].offset, lookup[l].symName);
-#endif
- l++;
- } else {
-#ifdef COFFDEBUG
- COFFDEBUG("DATA Section not loaded %d\n", sym->n_scnum - 1);
-#endif
- xf86loaderfree(symname);
- }
- break;
- case N_BSS:
- /*
- * Note: COFF expects .bss to be contiguous with
- * .data, so that offsets for .bss are relative to
- * .text. We need to adjust for this, and make them
- * relative to .bss so that the relocation can be
- * properly applied. This is needed becasue we allocate
- * .bss seperately from .text and .data.
- */
- if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
- && cofffile->saddr[sym->n_scnum - 1]) {
- lookup[l].symName = symname;
- lookup[l].offset = (funcptr)
- (cofffile->saddr[sym->n_scnum - 1] +
- sym->n_value - cofffile->bssaddr);
-#ifdef COFFDEBUG
- COFFDEBUG("Adding %p %s\n",
- (void *)lookup[l].offset, lookup[l].symName);
-#endif
- l++;
- } else {
-#ifdef COFFDEBUG
- COFFDEBUG("BSS Section not loaded %d\n", sym->n_scnum - 1);
-#endif
- xf86loaderfree(symname);
- }
- break;
- default:
- ErrorF("Unknown Section number %d\n", sym->n_scnum);
- xf86loaderfree(symname);
- break;
- }
- }
-
- lookup[l].symName = NULL; /* Terminate the list */
-
- lookup_common = COFFCreateCOMMON(cofffile);
- if (lookup_common) {
- for (i = 0, p = lookup_common; p->symName; i++, p++) ;
- memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP));
-
- xf86loaderfree(lookup_common);
- l += i;
- lookup[l].symName = NULL;
- }
-
-/*
- * remove the COFF symbols that will show up in every module
- */
- for (i = 0, p = lookup; p->symName; i++, p++) {
- while (p->symName && (!strcmp(lookup[i].symName, ".text")
- || !strcmp(lookup[i].symName, ".data")
- || !strcmp(lookup[i].symName, ".bss")
- )) {
- memmove(&(lookup[i]), &(lookup[i + 1]),
- (l-- - i) * sizeof(LOOKUP));
- }
- }
-
- return lookup;
-}
-
-#define SecOffset(index) cofffile->sections[index].s_scnptr
-#define SecSize(index) cofffile->sections[index].s_size
-#define SecAddr(index) cofffile->sections[index].s_paddr
-#define RelOffset(index) cofffile->sections[index].s_relptr
-#define RelSize(index) (cofffile->sections[index].s_nreloc*RELSZ)
-
-/*
- * COFFCollectSections
- *
- * Do the work required to load each section into memory.
- */
-static void
-COFFCollectSections(COFFModulePtr cofffile)
-{
- unsigned short i;
-
-/*
- * Find and identify all of the Sections
- */
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh);
-#endif
-
- for (i = 0; i < cofffile->numsh; i++) {
-#ifdef COFFDEBUG
- COFFDEBUG("%d %s\n", i, cofffile->sections[i].s_name);
-#endif
- /* .text */
- if (strcmp(cofffile->sections[i].s_name, ".text") == 0) {
- cofffile->text = _LoaderFileToMem(cofffile->fd,
- SecOffset(i), SecSize(i),
- ".text");
- cofffile->saddr[i] = cofffile->text;
- cofffile->txtndx = i;
- cofffile->txtaddr = SecAddr(i);
- cofffile->txtsize = SecSize(i);
- cofffile->txtrelsize = RelSize(i);
- cofffile->reladdr[i] = _LoaderFileToMem(cofffile->fd,
- RelOffset(i), RelSize(i),
- ".rel.text");
-#ifdef COFFDEBUG
- COFFDEBUG(".text starts at %p (%x bytes)\n", cofffile->text,
- cofffile->txtsize);
-#endif
- continue;
- }
- /* .data */
- if (strcmp(cofffile->sections[i].s_name, ".data") == 0) {
- cofffile->data = _LoaderFileToMem(cofffile->fd,
- SecOffset(i), SecSize(i),
- ".data");
- cofffile->saddr[i] = cofffile->data;
- cofffile->datndx = i;
- cofffile->dataddr = SecAddr(i);
- cofffile->datsize = SecSize(i);
- cofffile->datrelsize = RelSize(i);
- cofffile->reladdr[i] = _LoaderFileToMem(cofffile->fd,
- RelOffset(i), RelSize(i),
- ".rel.data");
-#ifdef COFFDEBUG
- COFFDEBUG(".data starts at %p (%x bytes)\n", cofffile->data,
- cofffile->datsize);
-#endif
- continue;
- }
- /* .bss */
- if (strcmp(cofffile->sections[i].s_name, ".bss") == 0) {
- if (SecSize(i))
- cofffile->bss = xf86loadercalloc(1, SecSize(i));
- else
- cofffile->bss = NULL;
- cofffile->saddr[i] = cofffile->bss;
- cofffile->bssndx = i;
- cofffile->bssaddr = SecAddr(i);
- cofffile->bsssize = SecSize(i);
-#ifdef COFFDEBUG
- COFFDEBUG(".bss starts at %p (%x bytes)\n", cofffile->bss,
- cofffile->bsssize);
-#endif
- continue;
- }
- /* .comment */
- if (strncmp(cofffile->sections[i].s_name,
- ".comment", strlen(".comment")) == 0) {
- continue;
- }
- /* .stab */
- if (strcmp(cofffile->sections[i].s_name, ".stab") == 0) {
- continue;
- }
- /* .stabstr */
- if (strcmp(cofffile->sections[i].s_name, ".stabstr") == 0) {
- continue;
- }
- /* .stab.* */
- if (strncmp(cofffile->sections[i].s_name,
- ".stab.", strlen(".stab.")) == 0) {
- continue;
- }
- ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name);
- }
-}
-
-/*
- * Public API for the COFF implementation of the loader.
- */
-void *
-COFFLoadModule(loaderPtr modrec, int cofffd, LOOKUP **ppLookup)
-{
- COFFModulePtr cofffile;
- FILHDR *header;
- int stroffset; /* offset of string table */
- COFFRelocPtr coff_reloc, tail;
- void *v;
-
-#ifdef COFFDEBUG
- COFFDEBUG("COFFLoadModule(%s,%x,%x)\n", modrec->name, modrec->handle,
- cofffd);
-#endif
-
- if ((cofffile = xf86loadercalloc(1, sizeof(COFFModuleRec))) == NULL) {
- ErrorF("Unable to allocate COFFModuleRec\n");
- return NULL;
- }
-
- cofffile->handle = modrec->handle;
- cofffile->module = modrec->module;
- cofffile->fd = cofffd;
- v = cofffile->funcs = modrec->funcs;
-
-/*
- * Get the COFF header
- */
- cofffile->header =
- (FILHDR *) _LoaderFileToMem(cofffd, 0, sizeof(FILHDR), "header");
- header = (FILHDR *) cofffile->header;
-
- if (header->f_symptr == 0 || header->f_nsyms == 0) {
- ErrorF("No symbols found in module\n");
- _LoaderFreeFileMem(header, sizeof(FILHDR));
- xf86loaderfree(cofffile);
- return NULL;
- }
-/*
- * Get the section table
- */
- cofffile->numsh = header->f_nscns;
- cofffile->secsize = (header->f_nscns * SCNHSZ);
- cofffile->sections =
- (SCNHDR *) _LoaderFileToMem(cofffd, FILHSZ + header->f_opthdr,
- cofffile->secsize, "sections");
- cofffile->saddr =
- xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *));
- cofffile->reladdr =
- xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *));
-
-/*
- * Load the optional header if we need it ?????
- */
-
-/*
- * Load the rest of the desired sections
- */
- COFFCollectSections(cofffile);
-
-/*
- * load the string table (must be done before we process symbols).
- */
- stroffset = header->f_symptr + (header->f_nsyms * SYMESZ);
-
- _LoaderFileRead(cofffd, stroffset, &(cofffile->strsize), sizeof(int));
-
- stroffset += 4; /* Move past the size */
- cofffile->strsize -= sizeof(int); /* size includes itself, so reduce by 4 */
- cofffile->strtab =
- _LoaderFileToMem(cofffd, stroffset, cofffile->strsize, "strings");
-
-/*
- * add symbols
- */
- *ppLookup = COFF_GetSymbols(cofffile);
-
-/*
- * Do relocations
- */
- coff_reloc = COFFCollectRelocations(cofffile);
- if (coff_reloc) {
- for (tail = coff_reloc; tail->next; tail = tail->next) ;
- tail->next = _LoaderGetRelocations(v)->coff_reloc;
- _LoaderGetRelocations(v)->coff_reloc = coff_reloc;
- }
-
- return (void *)cofffile;
-}
-
-void
-COFFResolveSymbols(void *mod)
-{
- COFFRelocPtr newlist, p, tmp;
-
- /* Try to relocate everything. Build a new list containing entries
- * which we failed to relocate. Destroy the old list in the process.
- */
- newlist = 0;
- for (p = _LoaderGetRelocations(mod)->coff_reloc; p;) {
- tmp = COFF_RelocateEntry(p->file, p->secndx, p->rel);
- if (tmp) {
- /* Failed to relocate. Keep it in the list. */
- tmp->next = newlist;
- newlist = tmp;
- }
- tmp = p;
- p = p->next;
- xf86loaderfree(tmp);
- }
- _LoaderGetRelocations(mod)->coff_reloc = newlist;
-}
-
-int
-COFFCheckForUnresolved(void *mod)
-{
- char *name;
- COFFRelocPtr crel;
- int flag, fatalsym = 0;
-
- if ((crel = _LoaderGetRelocations(mod)->coff_reloc) == NULL)
- return 0;
-
- while (crel) {
- name = COFFGetSymbolName(crel->file, crel->rel->r_symndx);
- flag = _LoaderHandleUnresolved(name,
- _LoaderHandleToName(crel->file->
- handle));
- if (flag)
- fatalsym = 1;
- xf86loaderfree(name);
- crel = crel->next;
- }
- return fatalsym;
-}
-
-void
-COFFUnloadModule(void *modptr)
-{
- COFFModulePtr cofffile = (COFFModulePtr) modptr;
- COFFRelocPtr relptr, reltptr, *brelptr;
-
-/*
- * Delete any unresolved relocations
- */
-
- relptr = _LoaderGetRelocations(cofffile->funcs)->coff_reloc;
- brelptr = &(_LoaderGetRelocations(cofffile->funcs)->coff_reloc);
-
- while (relptr) {
- if (relptr->file == cofffile) {
- *brelptr = relptr->next; /* take it out of the list */
- reltptr = relptr; /* save pointer to this node */
- relptr = relptr->next; /* advance the pointer */
- xf86loaderfree(reltptr); /* free the node */
- } else {
- brelptr = &(relptr->next);
- relptr = relptr->next; /* advance the pointer */
- }
- }
-
-/*
- * Delete any symbols in the symbols table.
- */
-
- LoaderHashTraverse((void *)cofffile, COFFhashCleanOut);
-
-/*
- * Free the sections that were allocated.
- */
-#define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
-
- CheckandFree(cofffile->strtab, cofffile->strsize);
- CheckandFree(cofffile->symtab, cofffile->symsize);
- CheckandFree(cofffile->text, cofffile->txtsize);
- CheckandFree(cofffile->reladdr[cofffile->txtndx], cofffile->txtrelsize);
- CheckandFree(cofffile->data, cofffile->datsize);
- CheckandFree(cofffile->reladdr[cofffile->datndx], cofffile->datrelsize);
- CheckandFree(cofffile->bss, cofffile->bsssize);
- if (cofffile->common)
- xf86loaderfree(cofffile->common);
-/*
- * Free the section table, and section pointer array
- */
- _LoaderFreeFileMem(cofffile->sections, cofffile->secsize);
- xf86loaderfree(cofffile->saddr);
- xf86loaderfree(cofffile->reladdr);
- _LoaderFreeFileMem(cofffile->header, sizeof(FILHDR));
-/*
- * Free the COFFModuleRec
- */
- xf86loaderfree(cofffile);
-
- return;
-}
-
-char *
-COFFAddressToSection(void *modptr, unsigned long address)
-{
- COFFModulePtr cofffile = (COFFModulePtr) modptr;
- int i;
-
- for (i = 1; i < cofffile->numsh; i++) {
- if (address >= (unsigned long)cofffile->saddr[i] &&
- address <= (unsigned long)cofffile->saddr[i] + SecSize(i)) {
- return cofffile->sections[i].s_name;
- }
- }
- return NULL;
-}
diff --git a/hw/xfree86/loader/coffloader.h b/hw/xfree86/loader/coffloader.h
deleted file mode 100644
index 217474671..000000000
--- a/hw/xfree86/loader/coffloader.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright 1997,1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
-
-#ifndef _COFFLOADER_H
-#define _COFFLOADER_H
-/* coffloader.c */
-extern void *COFFLoadModule(loaderPtr, int, LOOKUP **);
-extern void COFFResolveSymbols(void *);
-extern int COFFCheckForUnresolved(void *);
-extern char *COFFAddressToSection(void *, unsigned long);
-extern void COFFUnloadModule(void *);
-#endif /* _COFFLOADER_H */
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
deleted file mode 100644
index 3808cf3e3..000000000
--- a/hw/xfree86/loader/dixsym.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.61 2003/11/10 18:22:35 tsi Exp $ */
-
-/*
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#undef DBMALLOC
-#include "sym.h"
-#include "colormap.h"
-#include "cursor.h"
-#include "dix.h"
-#include "dixevents.h"
-#include "dixfont.h"
-#include "dixstruct.h"
-#include "misc.h"
-#include "globals.h"
-#include "os.h"
-#include "osdep.h"
-#include "resource.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "extension.h"
-#define EXTENSION_PROC_ARGS void *
-#include "extnsionst.h"
-#include "swaprep.h"
-#include "swapreq.h"
-#include "inputstr.h"
-#include "XIproto.h"
-#include "exevents.h"
-#include "extinit.h"
-#ifdef XV
-#include "xvmodproc.h"
-#endif
-#include "dgaproc.h"
-#ifdef RENDER
-#include "mipict.h"
-#endif
-#include "selection.h"
-#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
-#endif
-
-extern Selection *CurrentSelections;
-extern int NumCurrentSelections;
-
-/* DIX things */
-
-LOOKUP dixLookupTab[] = {
-
- /* dix */
- /* atom.c */
- SYMFUNC(MakeAtom)
- SYMFUNC(ValidAtom)
- /* colormap.c */
- SYMFUNC(AllocColor)
- SYMFUNC(CreateColormap)
- SYMFUNC(FakeAllocColor)
- SYMFUNC(FakeFreeColor)
- SYMFUNC(FreeColors)
- SYMFUNC(StoreColors)
- SYMFUNC(TellLostMap)
- SYMFUNC(TellGainedMap)
- SYMFUNC(QueryColors)
- /* cursor.c */
- SYMFUNC(FreeCursor)
- /* devices.c */
- SYMFUNC(Ones)
- SYMFUNC(InitButtonClassDeviceStruct)
- SYMFUNC(InitFocusClassDeviceStruct)
- SYMFUNC(InitLedFeedbackClassDeviceStruct)
- SYMFUNC(InitPtrFeedbackClassDeviceStruct)
- SYMFUNC(InitValuatorClassDeviceStruct)
- SYMFUNC(InitKeyClassDeviceStruct)
- SYMFUNC(InitKeyboardDeviceStruct)
- SYMFUNC(SendMappingNotify)
- /* dispatch.c */
- SYMFUNC(SetInputCheck)
- SYMFUNC(SendErrorToClient)
- SYMFUNC(UpdateCurrentTime)
- SYMFUNC(UpdateCurrentTimeIf)
- SYMFUNC(ProcBadRequest)
- SYMVAR(dispatchException)
- SYMVAR(isItTimeToYield)
- SYMVAR(ClientStateCallback)
- SYMVAR(ServerGrabCallback)
- SYMVAR(CurrentSelections)
- SYMVAR(NumCurrentSelections)
- /* dixfonts.c */
- SYMFUNC(CloseFont)
- SYMFUNC(FontToXError)
- SYMFUNC(LoadGlyphs)
- SYMVAR(fpe_functions)
- /* dixutils.c */
- SYMFUNC(AddCallback)
- SYMFUNC(ClientSleep)
- SYMFUNC(ClientTimeToServerTime)
- SYMFUNC(ClientWakeup)
- SYMFUNC(CompareTimeStamps)
- SYMFUNC(CopyISOLatin1Lowered)
- SYMFUNC(DeleteCallback)
- SYMFUNC(LookupClient)
- SYMFUNC(LookupDrawable)
- SYMFUNC(LookupWindow)
- SYMFUNC(NoopDDA)
- SYMFUNC(QueueWorkProc)
- SYMFUNC(RegisterBlockAndWakeupHandlers)
- SYMFUNC(RemoveBlockAndWakeupHandlers)
-#ifdef XCSECURITY
- SYMFUNC(SecurityLookupDrawable)
- SYMFUNC(SecurityLookupWindow)
-#endif
- /* events.c */
- SYMFUNC(CheckCursorConfinement)
- SYMFUNC(DeliverEvents)
- SYMFUNC(NewCurrentScreen)
- SYMFUNC(PointerConfinedToScreen)
- SYMFUNC(TryClientEvents)
- SYMFUNC(WriteEventsToClient)
- SYMVAR(DeviceEventCallback)
- SYMVAR(EventCallback)
- SYMVAR(inputInfo)
- SYMVAR(SetCriticalEvent)
-#ifdef PANORAMIX
- SYMVAR(XineramaGetCursorScreen)
-#endif
- /* property.c */
- SYMFUNC(ChangeWindowProperty)
- /* extension.c */
- SYMFUNC(AddExtension)
- SYMFUNC(AddExtensionAlias)
- SYMFUNC(CheckExtension)
- SYMFUNC(DeclareExtensionSecurity)
- SYMFUNC(MinorOpcodeOfRequest)
- SYMFUNC(StandardMinorOpcode)
- /* gc.c */
- SYMFUNC(CopyGC)
- SYMFUNC(CreateGC)
- SYMFUNC(CreateScratchGC)
- SYMFUNC(ChangeGC)
- SYMFUNC(dixChangeGC)
- SYMFUNC(DoChangeGC)
- SYMFUNC(FreeGC)
- SYMFUNC(FreeScratchGC)
- SYMFUNC(GetScratchGC)
- SYMFUNC(SetClipRects)
- SYMFUNC(ValidateGC)
- SYMFUNC(VerifyRectOrder)
- SYMFUNC(SetDashes)
- /* globals.c */
- SYMVAR(DPMSEnabled)
- SYMVAR(DPMSCapableFlag)
- SYMVAR(DPMSOffTime)
- SYMVAR(DPMSPowerLevel)
- SYMVAR(DPMSStandbyTime)
- SYMVAR(DPMSSuspendTime)
- SYMVAR(DPMSEnabledSwitch)
- SYMVAR(DPMSDisabledSwitch)
- SYMVAR(defaultDPMSEnabled)
- SYMVAR(currentRegionScreen)
- /* bigreq */
- SYMVAR(maxBigRequestSize)
-#ifdef XV
- /* XXX These are exported from the DDX, not DIX. */
- SYMVAR(XvScreenInitProc)
- SYMVAR(XvGetScreenIndexProc)
- SYMVAR(XvGetRTPortProc)
- SYMVAR(XvMCScreenInitProc)
-#endif
- SYMVAR(ScreenSaverBlanking)
- SYMVAR(WindowTable)
- SYMVAR(clients)
- SYMVAR(currentMaxClients)
- SYMVAR(currentTime)
- SYMVAR(defaultColorVisualClass)
- SYMVAR(globalSerialNumber)
- SYMVAR(lastDeviceEventTime)
- SYMVAR(monitorResolution)
- SYMVAR(permitOldBugs)
- SYMVAR(screenInfo)
- SYMVAR(serverClient)
- SYMVAR(serverGeneration)
- /* main.c */
- SYMFUNC(NotImplemented)
- /* pixmap.c */
- SYMFUNC(AllocatePixmap)
- SYMFUNC(GetScratchPixmapHeader)
- SYMFUNC(FreeScratchPixmapHeader)
- SYMVAR(PixmapWidthPaddingInfo)
- /* privates.c */
- SYMFUNC(AllocateClientPrivate)
- SYMFUNC(AllocateClientPrivateIndex)
- SYMFUNC(AllocateGCPrivate)
- SYMFUNC(AllocateGCPrivateIndex)
- SYMFUNC(AllocateWindowPrivate)
- SYMFUNC(AllocateWindowPrivateIndex)
- SYMFUNC(AllocateScreenPrivateIndex)
- SYMFUNC(AllocateColormapPrivateIndex)
-#ifdef PIXPRIV
- SYMFUNC(AllocatePixmapPrivateIndex)
- SYMFUNC(AllocatePixmapPrivate)
-#endif
- /* resource.c */
- SYMFUNC(AddResource)
- SYMFUNC(ChangeResourceValue)
- SYMFUNC(CreateNewResourceClass)
- SYMFUNC(CreateNewResourceType)
- SYMFUNC(FakeClientID)
- SYMFUNC(FreeResource)
- SYMFUNC(FreeResourceByType)
- SYMFUNC(GetXIDList)
- SYMFUNC(GetXIDRange)
- SYMFUNC(LookupIDByType)
- SYMFUNC(LookupIDByClass)
- SYMFUNC(LegalNewID)
-#ifdef XCSECURITY
- SYMFUNC(SecurityLookupIDByClass)
- SYMFUNC(SecurityLookupIDByType)
-#endif
- SYMFUNC(FindClientResourcesByType)
- SYMFUNC(FindAllClientResources)
- SYMVAR(lastResourceType)
- SYMVAR(TypeMask)
-#ifdef RES
- SYMFUNC(RegisterResourceName)
- SYMVAR(ResourceNames)
-#endif
- /* swaprep.c */
- SYMFUNC(CopySwap32Write)
- SYMFUNC(Swap32Write)
- SYMFUNC(SwapConnSetupInfo)
- SYMFUNC(SwapConnSetupPrefix)
- SYMFUNC(SwapShorts)
- SYMFUNC(SwapLongs)
- /* swapreq.c */
- SYMFUNC(SwapColorItem)
- /* tables.c */
- SYMVAR(EventSwapVector)
- SYMVAR(ReplySwapVector)
- SYMVAR(ProcVector)
- /* window.c */
- SYMFUNC(ChangeWindowAttributes)
- SYMFUNC(CheckWindowOptionalNeed)
- SYMFUNC(CreateUnclippedWinSize)
- SYMFUNC(CreateWindow)
- SYMFUNC(FindWindowWithOptional)
- SYMFUNC(GravityTranslate)
- SYMFUNC(MakeWindowOptional)
- SYMFUNC(MapWindow)
- SYMFUNC(MoveWindowInStack)
- SYMFUNC(NotClippedByChildren)
- SYMFUNC(ResizeChildrenWinSize)
- SYMFUNC(SaveScreens)
- SYMFUNC(SendVisibilityNotify)
- SYMFUNC(SetWinSize)
- SYMFUNC(SetBorderSize)
- SYMFUNC(TraverseTree)
- SYMFUNC(UnmapWindow)
- SYMFUNC(WalkTree)
- SYMFUNC(WindowsRestructured)
- SYMVAR(deltaSaveUndersViewable)
- SYMVAR(numSaveUndersViewable)
- SYMVAR(savedScreenInfo)
- SYMVAR(screenIsSaved)
-
- /*os/ */
- /* access.c */
- SYMFUNC(LocalClient)
- /* utils.c */
- SYMFUNC(Xstrdup)
- SYMFUNC(XNFstrdup)
- SYMVAR(Must_have_memory)
- SYMFUNC(AdjustWaitForDelay)
- SYMVAR(noTestExtensions)
- SYMFUNC(GiveUp)
- /* log.c */
- SYMFUNC(LogVWrite)
- SYMFUNC(LogWrite)
- SYMFUNC(LogVMessageVerb)
- SYMFUNC(LogMessageVerb)
- SYMFUNC(LogMessage)
- SYMFUNC(FatalError)
- SYMFUNC(VErrorF)
- SYMFUNC(ErrorF)
- SYMFUNC(Error)
- /* xalloc.c */
- SYMFUNC(XNFalloc)
- SYMFUNC(XNFcalloc)
- SYMFUNC(XNFrealloc)
- SYMFUNC(Xalloc)
- SYMFUNC(Xcalloc)
- SYMFUNC(Xfree)
- SYMFUNC(Xrealloc)
- /* WaitFor.c */
- SYMFUNC(ScreenSaverTime)
- SYMFUNC(TimerFree)
- SYMFUNC(TimerSet)
- SYMFUNC(TimerCancel)
- /* io.c */
- SYMFUNC(WriteToClient)
- SYMFUNC(SetCriticalOutputPending)
- SYMVAR(FlushCallback)
- SYMVAR(ReplyCallback)
- SYMVAR(SkippedRequestsCallback)
- SYMFUNC(ResetCurrentRequest)
- /* connection.c */
- SYMFUNC(IgnoreClient)
- SYMFUNC(AttendClient)
- SYMFUNC(AddEnabledDevice)
- SYMFUNC(RemoveEnabledDevice)
- SYMFUNC(MakeClientGrabPervious)
- SYMFUNC(MakeClientGrabImpervious)
- SYMVAR(GrabInProgress)
-
- /* devices.c */
- SYMFUNC(InitPointerDeviceStruct)
- SYMFUNC(LookupKeyboardDevice)
- SYMFUNC(LookupPointerDevice)
-
-#ifdef XKB
- /* xkb/xkbInit.c */
- SYMFUNC(XkbInitKeyboardDeviceStruct)
- SYMFUNC(XkbSetRulesDflts)
- SYMVAR(noXkbExtension)
-#endif
-
-#ifdef XINPUT
- /* Xi */
- /* exevents.c */
- SYMFUNC(InitValuatorAxisStruct)
- SYMFUNC(InitProximityClassDeviceStruct)
- /* extinit.c */
- SYMFUNC(AssignTypeAndName)
-#endif
-
- /* xf86DGA.c */
- /* XXX This is exported from the DDX, not DIX. */
- SYMVAR(XDGAEventBase)
-
- /* librender.a */
-#ifdef RENDER
- SYMFUNC(PictureInit)
- SYMFUNC(miPictureInit)
- SYMFUNC(miComputeCompositeRegion)
- SYMFUNC(miGlyphs)
- SYMFUNC(miCompositeRects)
- SYMVAR(PictureScreenPrivateIndex)
- SYMFUNC(PictureTransformPoint)
- SYMFUNC(PictureAddFilter)
- SYMFUNC(PictureSetFilterAlias)
- SYMFUNC(PictureGetSubpixelOrder)
- SYMFUNC(PictureSetSubpixelOrder)
-#endif
-
- {0, 0}
-};
diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
deleted file mode 100644
index 9d3011caf..000000000
--- a/hw/xfree86/loader/dlloader.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.13 2003/10/15 16:29:02 dawes Exp $ */
-
-/*
- *
- * Copyright (c) 1997 The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of the
- * XFree86 Project, Inc. not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The Xfree86 Project, Inc. makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-
-#include "Xos.h"
-#include "os.h"
-
-#include "sym.h"
-#include "loader.h"
-#include "dlloader.h"
-
-#ifdef DL_LAZY
-#define DLOPEN_LAZY DL_LAZY
-#else
-#ifdef RTLD_LAZY
-#define DLOPEN_LAZY RTLD_LAZY
-#else
-#ifdef __FreeBSD__
-#define DLOPEN_LAZY 1
-#else
-#define DLOPEN_LAZY 0
-#endif
-#endif
-#endif
-#ifdef LD_GLOBAL
-#define DLOPEN_GLOBAL LD_GLOBAL
-#else
-#ifdef RTLD_GLOBAL
-#define DLOPEN_GLOBAL RTLD_GLOBAL
-#else
-#define DLOPEN_GLOBAL 0
-#endif
-#endif
-
-#define DLOPEN_FLAGS ( DLOPEN_LAZY | DLOPEN_GLOBAL )
-
-#if defined(CSRG_BASED) && !defined(__ELF__)
-#define NEED_UNDERSCORE_FOR_DLLSYM
-#endif
-
-/*
- * This structure contains all of the information about a module
- * that has been loaded.
- */
-typedef struct {
- int handle;
- void *dlhandle;
-} DLModuleRec, *DLModulePtr;
-
-/*
- * a list of loaded modules XXX can be improved
- */
-typedef struct DLModuleList {
- DLModulePtr module;
- struct DLModuleList *next;
-} DLModuleList;
-
-DLModuleList *dlModuleList = NULL;
-
-/*
- * Search a symbol in the module list
- */
-void *
-DLFindSymbol(const char *name)
-{
- DLModuleList *l;
- void *p;
-
-#ifdef NEED_UNDERSCORE_FOR_DLLSYM
- char *n;
-
- n = xf86loadermalloc(strlen(name) + 2);
- sprintf(n, "_%s", name);
-#endif
-
- (void)dlerror(); /* Clear out any previous error */
- for (l = dlModuleList; l != NULL; l = l->next) {
-#ifdef NEED_UNDERSCORE_FOR_DLLSYM
- p = dlsym(l->module->dlhandle, n);
-#else
- p = dlsym(l->module->dlhandle, name);
-#endif
- if (dlerror() == NULL) {
-#ifdef NEED_UNDERSCORE_FOR_DLLSYM
- xf86loaderfree(n);
-#endif
- return p;
- }
- }
-#ifdef NEED_UNDERSCORE_FOR_DLLSYM
- xf86loaderfree(n);
-#endif
-
- return NULL;
-}
-
-/*
- * public interface
- */
-void *
-DLLoadModule(loaderPtr modrec, int fd, LOOKUP ** ppLookup)
-{
- DLModulePtr dlfile;
- DLModuleList *l;
-
- if ((dlfile = xf86loadercalloc(1, sizeof(DLModuleRec))) == NULL) {
- ErrorF("Unable to allocate DLModuleRec\n");
- return NULL;
- }
- dlfile->handle = modrec->handle;
- dlfile->dlhandle = dlopen(modrec->name, DLOPEN_FLAGS);
- if (dlfile->dlhandle == NULL) {
- ErrorF("dlopen: %s\n", dlerror());
- xf86loaderfree(dlfile);
- return NULL;
- }
- /* Add it to the module list */
- l = xf86loadermalloc(sizeof(DLModuleList));
- l->module = dlfile;
- l->next = dlModuleList;
- dlModuleList = l;
- *ppLookup = NULL;
-
- return (void *)dlfile;
-}
-
-void
-DLResolveSymbols(void *mod)
-{
- return;
-}
-
-int
-DLCheckForUnresolved(void *mod)
-{
- return 0;
-}
-
-void
-DLUnloadModule(void *modptr)
-{
- DLModulePtr dlfile = (DLModulePtr) modptr;
- DLModuleList *l, *p;
-
- /* remove it from dlModuleList */
- if (dlModuleList->module == modptr) {
- l = dlModuleList;
- dlModuleList = l->next;
- xf86loaderfree(l);
- } else {
- p = dlModuleList;
- for (l = dlModuleList->next; l != NULL; l = l->next) {
- if (l->module == modptr) {
- p->next = l->next;
- xf86loaderfree(l);
- break;
- }
- p = l;
- }
- }
- dlclose(dlfile->dlhandle);
- xf86loaderfree(modptr);
-}
diff --git a/hw/xfree86/loader/dlloader.h b/hw/xfree86/loader/dlloader.h
deleted file mode 100644
index e9468e97b..000000000
--- a/hw/xfree86/loader/dlloader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 1997 Metro Link, Inc.
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.h,v 1.3 1998/09/20 14:41:04 dawes Exp $ */
-
-#ifndef _DLLOADER_H
-#define _DLLOADER_H
-extern void *DLLoadModule(loaderPtr, int, LOOKUP **);
-extern void DLResolveSymbols(void *);
-extern int DLCheckForUnresolved(void *);
-extern void DLUnloadModule(void *);
-extern void *DLFindSymbol(const char *name);
-
-#endif
diff --git a/hw/xfree86/loader/elf.h b/hw/xfree86/loader/elf.h
deleted file mode 100644
index 91130e63d..000000000
--- a/hw/xfree86/loader/elf.h
+++ /dev/null
@@ -1,707 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.17 2003/10/15 16:29:02 dawes Exp $ */
-
-typedef unsigned int Elf32_Addr;
-typedef unsigned short Elf32_Half;
-typedef unsigned int Elf32_Off;
-typedef long Elf32_Sword;
-typedef unsigned int Elf32_Word;
-
-typedef unsigned long Elf64_Addr;
-typedef unsigned short Elf64_Half;
-typedef unsigned long Elf64_Off;
-typedef int Elf64_Sword;
-typedef unsigned int Elf64_Word;
-typedef unsigned long Elf64_Xword;
-typedef long Elf64_Sxword;
-
-/* These constants are for the segment types stored in the image headers */
-#define PT_NULL 0
-#define PT_LOAD 1
-#define PT_DYNAMIC 2
-#define PT_INTERP 3
-#define PT_NOTE 4
-#define PT_SHLIB 5
-#define PT_PHDR 6
-#define PT_LOPROC 0x70000000
-#define PT_HIPROC 0x7fffffff
-
-/* These constants define the different elf file types */
-#define ET_NONE 0
-#define ET_REL 1
-#define ET_EXEC 2
-#define ET_DYN 3
-#define ET_CORE 4
-#define ET_LOPROC 5
-#define ET_HIPROC 6
-
-/* These constants define the various ELF target machines */
-#define EM_NONE 0
-#define EM_M32 1
-#define EM_SPARC 2
-#define EM_386 3
-#define EM_68K 4
-#define EM_88K 5
-#define EM_486 6 /* Perhaps disused */
-#define EM_860 7
-#define EM_MIPS 8
-#define EM_MIPS_RS4_BE 10
-#define EM_PARISC 15
-#define EM_SPARC32PLUS 18
-#define EM_PPC 20
-#define EM_SPARCV9 43
-#define EM_IA_64 50
-#define EM_ALPHA 0x9026
-
-/* This is the info that is needed to parse the dynamic section of the file */
-#define DT_NULL 0
-#define DT_NEEDED 1
-#define DT_PLTRELSZ 2
-#define DT_PLTGOT 3
-#define DT_HASH 4
-#define DT_STRTAB 5
-#define DT_SYMTAB 6
-#define DT_RELA 7
-#define DT_RELASZ 8
-#define DT_RELAENT 9
-#define DT_STRSZ 10
-#define DT_SYMENT 11
-#define DT_INIT 12
-#define DT_FINI 13
-#define DT_SONAME 14
-#define DT_RPATH 15
-#define DT_SYMBOLIC 16
-#define DT_REL 17
-#define DT_RELSZ 18
-#define DT_RELENT 19
-#define DT_PLTREL 20
-#define DT_DEBUG 21
-#define DT_TEXTREL 22
-#define DT_JMPREL 23
-#define DT_LOPROC 0x70000000
-#define DT_HIPROC 0x7fffffff
-
-/* This info is needed when parsing the symbol table */
-#define STB_LOCAL 0
-#define STB_GLOBAL 1
-#define STB_WEAK 2
-
-#define STT_NOTYPE 0
-#define STT_OBJECT 1
-#define STT_FUNC 2
-#define STT_SECTION 3
-#define STT_FILE 4
-#define STT_LOPROC 13
-#define STT_HIPROC 15
-
-#define ELF32_ST_BIND(x) ((x) >> 4)
-#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf)
-
-#define ELF64_ST_BIND(x) ELF32_ST_BIND (x)
-#define ELF64_ST_TYPE(x) ELF32_ST_TYPE (x)
-
-typedef struct dynamic32 {
- Elf32_Sword d_tag;
- union {
- Elf32_Sword d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef struct dynamic64 {
- Elf64_Sxword d_tag;
- union {
- Elf64_Xword d_val;
- Elf64_Addr d_ptr;
- } d_un;
-} Elf64_Dyn;
-
-#ifndef QNX4
-extern Elf32_Dyn _DYNAMIC[];
-#endif
-
-/* The following are used with relocations */
-#define ELF32_R_SYM(x) ((x) >> 8)
-#define ELF32_R_TYPE(x) ((x) & 0xff)
-
-#define ELF64_R_SYM(x) ((x) >> 32)
-#define ELF64_R_TYPE(x) ((x) & 0xffffffff)
-
-/* x86 Relocation Types */
-#define R_386_NONE 0
-#define R_386_32 1
-#define R_386_PC32 2
-#define R_386_GOT32 3
-#define R_386_PLT32 4
-#define R_386_COPY 5
-#define R_386_GLOB_DAT 6
-#define R_386_JMP_SLOT 7
-#define R_386_RELATIVE 8
-#define R_386_GOTOFF 9
-#define R_386_GOTPC 10
-#define R_386_NUM 11
-
-/* AMD64 Relocation Types */
-#define R_X86_64_NONE 0
-#define R_X86_64_64 1
-#define R_X86_64_PC32 2
-#define R_X86_64_GOT32 3
-#define R_X86_64_PLT32 4
-#define R_X86_64_COPY 5
-#define R_X86_64_GLOB_DAT 6
-#define R_X86_64_JUMP_SLOT 7
-#define R_X86_64_RELATIVE 8
-#define R_X86_64_GOTPCREL 9
-#define R_X86_64_32 10
-#define R_X86_64_32S 11
-#define R_X86_64_16 12
-#define R_X86_64_PC16 13
-#define R_X86_64_8 14
-#define R_X86_64_PC8 15
-#define R_X86_64_GNU_VTINHERIT 250
-#define R_X86_64_GNU_VTENTRY 251
-
-/* sparc Relocation Types */
-#define R_SPARC_NONE 0
-#define R_SPARC_8 1
-#define R_SPARC_16 2
-#define R_SPARC_32 3
-#define R_SPARC_DISP8 4
-#define R_SPARC_DISP16 5
-#define R_SPARC_DISP32 6
-#define R_SPARC_WDISP30 7
-#define R_SPARC_WDISP22 8
-#define R_SPARC_HI22 9
-#define R_SPARC_22 10
-#define R_SPARC_13 11
-#define R_SPARC_LO10 12
-#define R_SPARC_GOT10 13
-#define R_SPARC_GOT13 14
-#define R_SPARC_GOT22 15
-#define R_SPARC_PC10 16
-#define R_SPARC_PC22 17
-#define R_SPARC_WPLT30 18
-#define R_SPARC_COPY 19
-#define R_SPARC_GLOB_DAT 20
-#define R_SPARC_JMP_SLOT 21
-#define R_SPARC_RELATIVE 22
-#define R_SPARC_UA32 23
-#define R_SPARC_PLT32 24
-#define R_SPARC_HIPLT22 25
-#define R_SPARC_LOPLT10 26
-#define R_SPARC_PCPLT32 27
-#define R_SPARC_PCPLT22 28
-#define R_SPARC_PCPLT10 29
-#define R_SPARC_10 30
-#define R_SPARC_11 31
-#define R_SPARC_64 32
-#define R_SPARC_OLO10 33
-#define R_SPARC_HH22 34
-#define R_SPARC_HM10 35
-#define R_SPARC_LM22 36
-#define R_SPARC_PC_HH22 37
-#define R_SPARC_PC_HM10 38
-#define R_SPARC_PC_LM22 39
-#define R_SPARC_WDISP16 40
-#define R_SPARC_WDISP19 41
-#define R_SPARC_GLOB_JMP 42
-#define R_SPARC_7 43
-#define R_SPARC_5 44
-#define R_SPARC_6 45
-#define R_SPARC_DISP64 46
-#define R_SPARC_PLT64 47
-#define R_SPARC_HIX22 48
-#define R_SPARC_LOX10 49
-#define R_SPARC_H44 50
-#define R_SPARC_M44 51
-#define R_SPARC_L44 52
-#define R_SPARC_REGISTER 53
-#define R_SPARC_UA64 54
-#define R_SPARC_UA16 55
-#define R_SPARC_NUM 56
-
-/* m68k Relocation Types */
-#define R_68K_NONE 0 /* No reloc */
-#define R_68K_32 1 /* Direct 32 bit */
-#define R_68K_16 2 /* Direct 16 bit */
-#define R_68K_8 3 /* Direct 8 bit */
-#define R_68K_PC32 4 /* PC relative 32 bit */
-#define R_68K_PC16 5 /* PC relative 16 bit */
-#define R_68K_PC8 6 /* PC relative 8 bit */
-#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */
-#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */
-#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */
-#define R_68K_GOT32O 10 /* 32 bit GOT offset */
-#define R_68K_GOT16O 11 /* 16 bit GOT offset */
-#define R_68K_GOT8O 12 /* 8 bit GOT offset */
-#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */
-#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */
-#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */
-#define R_68K_PLT32O 16 /* 32 bit PLT offset */
-#define R_68K_PLT16O 17 /* 16 bit PLT offset */
-#define R_68K_PLT8O 18 /* 8 bit PLT offset */
-#define R_68K_COPY 19 /* Copy symbol at runtime */
-#define R_68K_GLOB_DAT 20 /* Create GOT entry */
-#define R_68K_JMP_SLOT 21 /* Create PLT entry */
-#define R_68K_RELATIVE 22 /* Adjust by program base */
-
-/* Alpha Relocation Types */
-#define R_ALPHA_NONE 0 /* No reloc */
-#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
-#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
-#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
-#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
-#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
-#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
-#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
-#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
-#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
-#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
-#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
-#define R_ALPHA_OP_PUSH 12 /* OP stack push */
-#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
-#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
-#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
-#define R_ALPHA_GPVALUE 16
-#define R_ALPHA_GPRELHIGH 17
-#define R_ALPHA_GPRELLOW 18
-#define R_ALPHA_GPREL16 19
-#define R_ALPHA_IMMED_GP_HI32 20
-#define R_ALPHA_IMMED_SCN_HI32 21
-#define R_ALPHA_IMMED_BR_HI32 22
-#define R_ALPHA_IMMED_LO32 23
-#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
-#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
-#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
-#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
-
-/* IA-64 relocations. */
-#define R_IA64_NONE 0x00 /* none */
-#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
-#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
-#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
-#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
-#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
-#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
-#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
-#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */
-#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */
-#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */
-#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */
-#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */
-#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */
-#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */
-#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */
-#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */
-#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */
-#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */
-#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */
-#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */
-#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */
-#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */
-#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */
-#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */
-#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */
-#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */
-#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */
-#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */
-#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */
-#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
-#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
-#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */
-#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */
-#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */
-#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */
-#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */
-#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */
-#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */
-#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */
-#define R_IA64_REL32MSB 0x6c /* data 4 + REL */
-#define R_IA64_REL32LSB 0x6d /* data 4 + REL */
-#define R_IA64_REL64MSB 0x6e /* data 8 + REL */
-#define R_IA64_REL64LSB 0x6f /* data 8 + REL */
-#define R_IA64_LTV32MSB 0x70 /* symbol + addend, data4 MSB */
-#define R_IA64_LTV32LSB 0x71 /* symbol + addend, data4 LSB */
-#define R_IA64_LTV64MSB 0x72 /* symbol + addend, data8 MSB */
-#define R_IA64_LTV64LSB 0x73 /* symbol + addend, data8 LSB */
-#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
-#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
-#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
-#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
-
-#define R_IA64_TYPE(R) ((R) & -8)
-#define R_IA64_FORMAT(R) ((R) & 7)
-
-/*
- * Apparantly, Linux and PowerMAXOS use different version of ELF as the
- * Relocation types are very different.
- */
-#if defined(PowerMAX_OS)
-/* PPC Relocation Types */
-#define R_PPC_NONE 0
-#define R_PPC_COPY 1
-#define R_PPC_GOTP_ENT 2
-#define R_PPC_8 4
-#define R_PPC_8S 5
-#define R_PPC_16S 7
-#define R_PPC_14 8
-#define R_PPC_DISP14 9
-#define R_PPC_24 10
-#define R_PPC_DISP24 11
-#define R_PPC_PLT_DISP24 14
-#define R_PPC_BBASED_16HU 15
-#define R_PPC_BBASED_32 16
-#define R_PPC_BBASED_32UA 17
-#define R_PPC_BBASED_16H 18
-#define R_PPC_BBASED_16L 19
-#define R_PPC_ABDIFF_16HU 23
-#define R_PPC_ABDIFF_32 24
-#define R_PPC_ABDIFF_32UA 25
-#define R_PPC_ABDIFF_16H 26
-#define R_PPC_ABDIFF_16L 27
-#define R_PPC_ABDIFF_16 28
-#define R_PPC_16HU 31
-#define R_PPC_32 32
-#define R_PPC_32UA 33
-#define R_PPC_16H 34
-#define R_PPC_16L 35
-#define R_PPC_16 36
-#define R_PPC_GOT_16HU 39
-#define R_PPC_GOT_32 40
-#define R_PPC_GOT_32UA 41
-#define R_PPC_GOT_16H 42
-#define R_PPC_GOT_16L 43
-#define R_PPC_GOT_16 44
-#define R_PPC_GOTP_16HU 47
-#define R_PPC_GOTP_32 48
-#define R_PPC_GOTP_32UA 49
-#define R_PPC_GOTP_16H 50
-#define R_PPC_GOTP_16L 51
-#define R_PPC_GOTP_16 52
-#define R_PPC_PLT_16HU 55
-#define R_PPC_PLT_32 56
-#define R_PPC_PLT_32UA 57
-#define R_PPC_PLT_16H 58
-#define R_PPC_PLT_16L 59
-#define R_PPC_PLT_16 60
-#define R_PPC_ABREL_16HU 63
-#define R_PPC_ABREL_32 64
-#define R_PPC_ABREL_32UA 65
-#define R_PPC_ABREL_16H 66
-#define R_PPC_ABREL_16L 67
-#define R_PPC_ABREL_16 68
-#define R_PPC_GOT_ABREL_16HU 71
-#define R_PPC_GOT_ABREL_32 72
-#define R_PPC_GOT_ABREL_32UA 73
-#define R_PPC_GOT_ABREL_16H 74
-#define R_PPC_GOT_ABREL_16L 75
-#define R_PPC_GOT_ABREL_16 76
-#define R_PPC_GOTP_ABREL_16HU 79
-#define R_PPC_GOTP_ABREL_32 80
-#define R_PPC_GOTP_ABREL_32UA 81
-#define R_PPC_GOTP_ABREL_16H 82
-#define R_PPC_GOTP_ABREL_16L 83
-#define R_PPC_GOTP_ABREL_16 84
-#define R_PPC_PLT_ABREL_16HU 87
-#define R_PPC_PLT_ABREL_32 88
-#define R_PPC_PLT_ABREL_32UA 89
-#define R_PPC_PLT_ABREL_16H 90
-#define R_PPC_PLT_ABREL_16L 91
-#define R_PPC_PLT_ABREL_16 92
-#define R_PPC_SREL_16HU 95
-#define R_PPC_SREL_32 96
-#define R_PPC_SREL_32UA 97
-#define R_PPC_SREL_16H 98
-#define R_PPC_SREL_16L 99
-#else
-/*
- * The Linux version
- */
-#define R_PPC_NONE 0
-#define R_PPC_ADDR32 1
-#define R_PPC_ADDR24 2
-#define R_PPC_ADDR16 3
-#define R_PPC_ADDR16_LO 4
-#define R_PPC_ADDR16_HI 5
-#define R_PPC_ADDR16_HA 6
-#define R_PPC_ADDR14 7
-#define R_PPC_ADDR14_BRTAKEN 8
-#define R_PPC_ADDR14_BRNTAKEN 9
-#define R_PPC_REL24 10
-#define R_PPC_REL14 11
-#define R_PPC_REL14_BRTAKEN 12
-#define R_PPC_REL14_BRNTAKEN 13
-#define R_PPC_GOT16 14
-#define R_PPC_GOT16_LO 15
-#define R_PPC_GOT16_HI 16
-#define R_PPC_GOT16_HA 17
-#define R_PPC_PLTREL24 18
-#define R_PPC_COPY 19
-#define R_PPC_GLOB_DAT 20
-#define R_PPC_JMP_SLOT 21
-#define R_PPC_RELATIVE 22
-#define R_PPC_LOCAL24PC 23
-#define R_PPC_UADDR32 24
-#define R_PPC_UADDR16 25
-#define R_PPC_REL32 26
-#define R_PPC_PLT32 27
-#define R_PPC_PLTREL32 28
-#define R_PPC_PLT16_LO 29
-#define R_PPC_PLT16_HI 30
-#define R_PPC_PLT16_HA 31
-#define R_PPC_SDAREL16 32
-#define R_PPC_SECTOFF 33
-#define R_PPC_SECTOFF_LO 34
-#define R_PPC_SECTOFF_HI 35
-#define R_PPC_SECTOFF_HA 36
-#endif
-
-/* ARM relocs. */
-#define R_ARM_NONE 0 /* No reloc */
-#define R_ARM_PC24 1 /* PC relative 26 bit branch */
-#define R_ARM_ABS32 2 /* Direct 32 bit */
-#define R_ARM_REL32 3 /* PC relative 32 bit */
-#define R_ARM_PC13 4
-#define R_ARM_ABS16 5 /* Direct 16 bit */
-#define R_ARM_ABS12 6 /* Direct 12 bit */
-#define R_ARM_THM_ABS5 7
-#define R_ARM_ABS8 8 /* Direct 8 bit */
-#define R_ARM_SBREL32 9
-#define R_ARM_THM_PC22 10
-#define R_ARM_THM_PC8 11
-#define R_ARM_AMP_VCALL9 12
-#define R_ARM_SWI24 13
-#define R_ARM_THM_SWI8 14
-#define R_ARM_XPC25 15
-#define R_ARM_THM_XPC22 16
-#define R_ARM_COPY 20 /* Copy symbol at runtime */
-#define R_ARM_GLOB_DAT 21 /* Create GOT entry */
-#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
-#define R_ARM_RELATIVE 23 /* Adjust by program base */
-#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
-#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
-#define R_ARM_GOT32 26 /* 32 bit GOT entry */
-#define R_ARM_PLT32 27 /* 32 bit PLT address */
-#define R_ARM_GNU_VTENTRY 100
-#define R_ARM_GNU_VTINHERIT 101
-#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
-#define R_ARM_THM_PC9 103 /* thumb conditional branch */
-#define R_ARM_RXPC25 249
-#define R_ARM_RSBREL32 250
-#define R_ARM_THM_RPC22 251
-#define R_ARM_RREL32 252
-#define R_ARM_RABS22 253
-#define R_ARM_RPC24 254
-#define R_ARM_RBASE 255
-
-typedef struct elf32_rel {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
-} Elf32_Rel;
-
-typedef struct elf64_rel {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
-} Elf64_Rel;
-
-typedef struct elf32_rela {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- Elf32_Sword r_addend;
-} Elf32_Rela;
-
-typedef struct elf64_rela {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
- Elf64_Sxword r_addend;
-} Elf64_Rela;
-
-typedef struct elf32_sym {
- Elf32_Word st_name;
- Elf32_Addr st_value;
- Elf32_Word st_size;
- unsigned char st_info;
- unsigned char st_other;
- Elf32_Half st_shndx;
-} Elf32_Sym;
-
-typedef struct elf64_sym {
- Elf64_Word st_name;
- unsigned char st_info;
- unsigned char st_other;
- Elf64_Half st_shndx;
- Elf64_Addr st_value;
- Elf64_Xword st_size;
-} Elf64_Sym;
-
-#define EI_NIDENT 16
-
-typedef struct elf32hdr {
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry; /* Entry point */
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
-} Elf32_Ehdr;
-
-typedef struct elf64hdr {
- unsigned char e_ident[EI_NIDENT];
- Elf64_Half e_type;
- Elf64_Half e_machine;
- Elf64_Word e_version;
- Elf64_Addr e_entry;
- Elf64_Off e_phoff;
- Elf64_Off e_shoff;
- Elf64_Word e_flags;
- Elf64_Half e_ehsize;
- Elf64_Half e_phentsize;
- Elf64_Half e_phnum;
- Elf64_Half e_shentsize;
- Elf64_Half e_shnum;
- Elf64_Half e_shstrndx;
-} Elf64_Ehdr;
-
-/* These constants define the permissions on sections in the program
- header, p_flags. */
-#define PF_R 0x4
-#define PF_W 0x2
-#define PF_X 0x1
-
-typedef struct elf_phdr {
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
-} Elf32_Phdr;
-
-typedef struct {
- Elf64_Word p_type;
- Elf64_Word p_flags;
- Elf64_Off p_offset;
- Elf64_Addr p_vaddr;
- Elf64_Addr p_paddr;
- Elf64_Xword p_filesz;
- Elf64_Xword p_memsz;
- Elf64_Xword p_align;
-} Elf64_Phdr;
-
-/* sh_type */
-#define SHT_NULL 0
-#define SHT_PROGBITS 1
-#define SHT_SYMTAB 2
-#define SHT_STRTAB 3
-#define SHT_RELA 4
-#define SHT_HASH 5
-#define SHT_DYNAMIC 6
-#define SHT_NOTE 7
-#define SHT_NOBITS 8
-#define SHT_REL 9
-#define SHT_SHLIB 10
-#define SHT_DYNSYM 11
-#define SHT_NUM 12
-#define SHT_LOPROC 0x70000000
-#define SHT_HIPROC 0x7fffffff
-#define SHT_LOUSER 0x80000000
-#define SHT_HIUSER 0xffffffff
-
-#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
-
-/* sh_flags */
-#define SHF_WRITE 0x1
-#define SHF_ALLOC 0x2
-#define SHF_EXECINSTR 0x4
-#define SHF_MASKPROC 0xf0000000
-
-/* special section indexes */
-#define SHN_UNDEF 0
-#define SHN_LORESERVE 0xff00
-#define SHN_LOPROC 0xff00
-#define SHN_HIPROC 0xff1f
-#define SHN_ABS 0xfff1
-#define SHN_COMMON 0xfff2
-#define SHN_HIRESERVE 0xffff
-
-typedef struct {
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
-} Elf32_Shdr;
-
-typedef struct {
- Elf64_Word sh_name;
- Elf64_Word sh_type;
- Elf64_Xword sh_flags;
- Elf64_Addr sh_addr;
- Elf64_Off sh_offset;
- Elf64_Xword sh_size;
- Elf64_Word sh_link;
- Elf64_Word sh_info;
- Elf64_Xword sh_addralign;
- Elf64_Xword sh_entsize;
-} Elf64_Shdr;
-
-#define EI_MAG0 0 /* e_ident[] indexes */
-#define EI_MAG1 1
-#define EI_MAG2 2
-#define EI_MAG3 3
-#define EI_CLASS 4
-#define EI_DATA 5
-#define EI_VERSION 6
-#define EI_PAD 7
-
-#define ELFMAG0 0x7f /* EI_MAG */
-#define ELFMAG1 'E'
-#define ELFMAG2 'L'
-#define ELFMAG3 'F'
-#define ELFMAG "\177ELF"
-#define SELFMAG 4
-
-#define ELFDLMAG 3
-#define ELFDLOFF 16
-
-#define ELFCLASSNONE 0 /* EI_CLASS */
-#define ELFCLASS32 1
-#define ELFCLASS64 2
-#define ELFCLASSNUM 3
-
-#define ELFDATANONE 0 /* e_ident[EI_DATA] */
-#define ELFDATA2LSB 1
-#define ELFDATA2MSB 2
-
-#define EV_NONE 0 /* e_version, EI_VERSION */
-#define EV_CURRENT 1
-#define EV_NUM 2
-
-/* Notes used in ET_CORE */
-#define NT_PRSTATUS 1
-#define NT_PRFPREG 2
-#define NT_PRPSINFO 3
-#define NT_TASKSTRUCT 4
-
-/* Note header in a PT_NOTE section */
-typedef struct elf_note {
- Elf32_Word n_namesz; /* Name size */
- Elf32_Word n_descsz; /* Content size */
- Elf32_Word n_type; /* Content type */
-} Elf32_Nhdr;
-
-#define ELF_START_MMAP 0x80000000
diff --git a/hw/xfree86/loader/elfloader.c b/hw/xfree86/loader/elfloader.c
deleted file mode 100644
index 5ab8af62d..000000000
--- a/hw/xfree86/loader/elfloader.c
+++ /dev/null
@@ -1,3237 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.62 2003/11/06 18:38:13 tsi Exp $ */
-
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include <sys/types.h>
-#ifndef __UNIXOS2__
-#include <sys/mman.h>
-#endif
-#include <unistd.h>
-#include <stdlib.h>
-#ifdef __QNX__
-# include <fcntl.h>
-#else
-# include <sys/fcntl.h>
-#endif
-#include <sys/stat.h>
-#if defined(linux) && defined (__ia64__)
-#include <sys/mman.h>
-#endif
-
-#ifdef DBMALLOC
-# include <debug/malloc.h>
-# define Xalloc(size) malloc(size)
-# define Xcalloc(size) calloc(1,(size))
-# define Xfree(size) free(size)
-#endif
-
-#include "Xos.h"
-#include "os.h"
-#include "elf.h"
-
-#include "sym.h"
-#include "loader.h"
-
-#include "compiler.h"
-
-#ifndef LOADERDEBUG
-#define LOADERDEBUG 0
-#endif
-
-#if LOADERDEBUG
-# define ELFDEBUG ErrorF
-#endif
-
-#if defined(__ia64__)
-
-/*
- * R_IA64_LTOFF22X and R_IA64_LDXMOV are relocation optimizations for
- * IA64. Conforming implementations must recognize them and may either
- * implement the optimization or may fallback to previous
- * non-optimized behavior by treating R_IA64_LTOFF22X as a
- * R_IA64_LTOFF22 and ignoring R_IA64_LDXMOV. The
- * IA64_LDX_OPTIMIZATION conditional controls the fallback behavior,
- * if defined the optimizations are performed.
- *
- * To implement the optimization we want to change is the sequence on
- * the left to that on the right, without regard to any intervening
- * instructions:
- *
- * 1) addl t1=@ltoff(var),gp ==> addl t1=@gprel(var),gp
- * 2) ld8 t2=[t1] ==> mov t2=t1
- * 3) ld8 loc0=[t2] ==> ld8 loc0=[t2]
- *
- * The relocations that match the above instructions are:
- *
- * 1) R_IA64_LTOFF22 ==> R_IA64_LTOFF22X
- * 2) -- ==> R_IA64_LDXMOV
- * 3) -- ==> --
- *
- * First lets look at left hand column to understand the original
- * mechanism. The virtual address of a symbol is stored in the GOT,
- * when that symbol is referenced the following sequence occurs,
- * instruction 1 loads the address of the GOT entry containing the
- * virtural address of the symbol into t1. Instruction 2 loads the
- * virtual address of the symbol into t2 by dereferencing t1. Finally
- * the symbol is loaded in instruction 3 by dereferencing its virtual
- * address in t2.
- *
- * The optimization that LTOFF22X/LDXMOV introduces is based on the
- * observation we are doing an extra load (instruction 2) if we can
- * generate the virtual address for the symbol without doing a lookup in
- * the GOT. This is possible if the virtual address of the symbol can be
- * computed via GP relative addressing. In other words the virtual
- * address of the symbol is a fixed offset from the GP. This fixed offset
- * must be within the limits of the signed 22 bit immediate offset in the
- * ld8 instruction, otherwise the original indirect GOT lookup must be
- * performed (LTOFF22).
- *
- * If we can use GP relative addressing for the symbol then the
- * instruction that loaded the virtual address of the symbol into t2 must
- * also be patched, hence the introduction of the LDXMOV relocation. The
- * LDXMOV essentially turns the GOT lookup into a no-op by changing the
- * ld8 into a register move that preserves the register location of the
- * symbol's virtual address (e.g. t2).
- *
- * The important point to recognize when implementing the LTOFF22X/LDXMOV
- * optimization is that relocations are interdependent, the LDXMOV is
- * only applied if the LTOFF22X is applied. It is also worth noting that
- * there is no relationship between LDXMOV relocations and LTOFF22X in
- * the ELF relocation section other than they share the same
- * symbol+addend value.
- */
-
-#define IA64_LDX_OPTIMIZATION 1
-#endif
-
-#ifndef UseMMAP
-# if defined (__ia64__) || defined (__sparc__)
-# define MergeSectionAlloc
-# endif
-#endif
-
-#if defined (DoMMAPedMerge)
-# include <sys/mman.h>
-# define MergeSectionAlloc
-# define MMAP_PROT (PROT_READ | PROT_WRITE | PROT_EXEC)
-# if !defined(linux)
-# error No MAP_ANON?
-# endif
-# if !defined (__AMD64__) || !defined(__linux__)
-# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON)
-# else
-# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_32BIT)
-# endif
-# if defined (MmapPageAlign)
-# define MMAP_ALIGN(size) do { \
- int pagesize = getpagesize(); \
- size = ( size + pagesize - 1) / pagesize; \
- size *= pagesize; \
- } while (0);
-# else
-# define MMAP_ALIGN(size)
-# endif
-#endif
-
-#if defined (__alpha__) || \
- defined (__ia64__) || \
- defined (__AMD64__) || \
- (defined (__sparc__) && \
- (defined (__arch64__) || \
- defined (__sparcv9)))
-typedef Elf64_Ehdr Elf_Ehdr;
-typedef Elf64_Shdr Elf_Shdr;
-typedef Elf64_Sym Elf_Sym;
-typedef Elf64_Rel Elf_Rel;
-typedef Elf64_Rela Elf_Rela;
-typedef Elf64_Addr Elf_Addr;
-typedef Elf64_Half Elf_Half;
-typedef Elf64_Off Elf_Off;
-typedef Elf64_Sword Elf_Sword;
-typedef Elf64_Word Elf_Word;
-
-#define ELF_ST_BIND ELF64_ST_BIND
-#define ELF_ST_TYPE ELF64_ST_TYPE
-#define ELF_R_SYM ELF64_R_SYM
-#define ELF_R_TYPE ELF64_R_TYPE
-
-# if defined (__alpha__) || defined (__ia64__)
-/*
- * The GOT is allocated dynamically. We need to keep a list of entries that
- * have already been added to the GOT.
- *
- */
-typedef struct _elf_GOT_Entry {
- Elf_Rela *rel;
- int offset;
- struct _elf_GOT_Entry *next;
-} ELFGotEntryRec, *ELFGotEntryPtr;
-
-typedef struct _elf_GOT {
- unsigned int size;
- unsigned int nuses;
- unsigned char *freeptr;
- struct _elf_GOT *next;
- unsigned char section[1];
-} ELFGotRec, *ELFGotPtr;
-
-# ifdef MergeSectionAlloc
-static ELFGotPtr ELFSharedGOTs;
-# endif
-# endif
-
-# if defined (__ia64__)
-/*
- * The PLT is allocated dynamically. We need to keep a list of entries that
- * have already been added to the PLT.
- */
-typedef struct _elf_PLT_Entry {
- Elf_Rela *rel;
- int offset;
- int gotoffset;
- struct _elf_PLT_Entry *next;
-} ELFPltEntryRec, *ELFPltEntryPtr;
-
-/*
- * The OPD is allocated dynamically within the GOT. We need to keep a list
- * of entries that have already been added to the OPD.
- */
-typedef struct _elf_OPD {
- LOOKUP *l;
- int index;
- int offset;
- struct _elf_OPD *next;
-} ELFOpdRec, *ELFOpdPtr;
-# endif
-
-#else
-typedef Elf32_Ehdr Elf_Ehdr;
-typedef Elf32_Shdr Elf_Shdr;
-typedef Elf32_Sym Elf_Sym;
-typedef Elf32_Rel Elf_Rel;
-typedef Elf32_Rela Elf_Rela;
-typedef Elf32_Addr Elf_Addr;
-typedef Elf32_Half Elf_Half;
-typedef Elf32_Off Elf_Off;
-typedef Elf32_Sword Elf_Sword;
-typedef Elf32_Word Elf_Word;
-
-#define ELF_ST_BIND ELF32_ST_BIND
-#define ELF_ST_TYPE ELF32_ST_TYPE
-#define ELF_R_SYM ELF32_R_SYM
-#define ELF_R_TYPE ELF32_R_TYPE
-#endif
-
-#if defined(__powerpc__) || \
- defined(__mc68000__) || \
- defined(__alpha__) || \
- defined(__sparc__) || \
- defined(__ia64__) || \
- defined(__AMD64__)
-typedef Elf_Rela Elf_Rel_t;
-#else
-typedef Elf_Rel Elf_Rel_t;
-#endif
-
-typedef struct {
- void *saddr;
- char *name;
- int ndx;
- int size;
- int flags;
-} LoadSection;
-
-#define RELOC_SECTION 0x1
-#define LOADED_SECTION 0x2
-
-/*
- * This structure contains all of the information about a module
- * that has been loaded.
- */
-
-typedef struct {
- int handle;
- int module;
- int fd;
- loader_funcs *funcs;
- Elf_Ehdr *header; /* file header */
- int numsh;
- Elf_Shdr *sections; /* Address of the section header table */
- int secsize; /* size of the section table */
- unsigned char **saddr; /* Start addresss of the section pointer table */
- unsigned char *shstraddr; /* Start address of the section header string table */
- int shstrndx; /* index of the section header string table */
- int shstrsize; /* size of the section header string table */
-#if defined(__alpha__) || defined(__ia64__)
- unsigned char *got; /* Start address of the .got section */
- ELFGotEntryPtr got_entries; /* List of entries in the .got section */
- int gotndx; /* index of the .got section */
- int gotsize; /* actual size of the .got section */
- ELFGotPtr shared_got; /* Pointer to ELFGotRec if shared */
-#endif /*(__alpha__) || (__ia64__) */
-#if defined(__ia64__)
- ELFOpdPtr opd_entries; /* List of entries in the .opd section */
- unsigned char *plt; /* Start address of the .plt section */
- ELFPltEntryPtr plt_entries; /* List of entries in the .plt section */
- int pltndx; /* index of the .plt section */
- int pltsize; /* size of the .plt section */
-#endif /*__ia64__*/
- Elf_Sym *symtab; /* Start address of the .symtab section */
- int symndx; /* index of the .symtab section */
- unsigned char *common; /* Start address of the SHN_COMMON space */
- int comsize; /* size of the SHN_COMMON space */
-
- unsigned char *base; /* Alloced address of section block */
- unsigned long baseptr; /* Pointer to next free space in base */
- int basesize; /* Size of that allocation */
- unsigned char *straddr; /* Start address of the string table */
- int strndx; /* index of the string table */
- int strsize; /* size of the string table */
- LoadSection *lsection;
- int lsectidx;
-} ELFModuleRec, *ELFModulePtr;
-
-/*
- * If a relocation is unable to be satisfied, then put it on a list
- * to try later after more modules have been loaded.
- */
-typedef struct _elf_reloc {
- Elf_Rel_t *rel;
- ELFModulePtr file;
- Elf_Word secn;
- struct _elf_reloc *next;
-} ELFRelocRec;
-
-/*
- * symbols with a st_shndx of COMMON need to have space allocated for them.
- *
- * Gather all of these symbols together, and allocate one chunk when we
- * are done.
- */
-typedef struct _elf_COMMON {
- Elf_Sym *sym;
- struct _elf_COMMON *next;
-} ELFCommonRec;
-
-static ELFCommonPtr listCOMMON = NULL;
-
-/* Prototypes for static functions */
-static int ELFhashCleanOut(void *, itemPtr);
-static char *ElfGetStringIndex(ELFModulePtr, int, int);
-static char *ElfGetString(ELFModulePtr, int);
-static char *ElfGetSectionName(ELFModulePtr, int);
-static ELFRelocPtr ElfDelayRelocation(ELFModulePtr, Elf_Word, Elf_Rel_t *);
-static ELFCommonPtr ElfAddCOMMON(Elf_Sym *);
-static int ElfCOMMONSize(void);
-static int ElfCreateCOMMON(ELFModulePtr, LOOKUP *);
-static char *ElfGetSymbolNameIndex(ELFModulePtr, int, int);
-static char *ElfGetSymbolName(ELFModulePtr, int);
-static Elf_Addr ElfGetSymbolValue(ELFModulePtr, int);
-static ELFRelocPtr Elf_RelocateEntry(ELFModulePtr, Elf_Word, Elf_Rel_t *,
- int);
-static ELFRelocPtr ELFCollectRelocations(ELFModulePtr, int);
-static LOOKUP *ELF_GetSymbols(ELFModulePtr, unsigned short **);
-static void ELFCollectSections(ELFModulePtr, int, int *, int *);
-
-#if defined(__alpha__) || defined(__ia64__)
-static void ElfAddGOT(ELFModulePtr, Elf_Rel_t *);
-static int ELFCreateGOT(ELFModulePtr, int);
-#endif
-#if defined(__ia64__)
-static void ElfAddOPD(ELFModulePtr, int, LOOKUP *);
-static void ELFCreateOPD(ELFModulePtr);
-static void ElfAddPLT(ELFModulePtr, Elf_Rel_t *);
-static void ELFCreatePLT(ELFModulePtr);
-enum ia64_operand {
- IA64_OPND_IMM22,
- IA64_OPND_TGT25C,
- IA64_OPND_LDXMOV
-};
-static void IA64InstallReloc(unsigned long *, int, enum ia64_operand, long);
-#endif /*__ia64__*/
-
-#ifdef MergeSectionAlloc
-static void *
-ELFLoaderSectToMem(ELFModulePtr elffile, int align, unsigned long offset,
- int size, char *label)
-{
- void *ret;
-
- elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1);
- ret = (void *)elffile->baseptr;
- _LoaderFileRead(elffile->fd, offset, ret, size);
- elffile->baseptr += size;
- return ret;
-}
-
-static void *
-ELFLoaderSectCalloc(ELFModulePtr elffile, int align, int size)
-{
- void *ret;
-
- elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1);
- ret = (void *)elffile->baseptr;
- elffile->baseptr += size;
-#ifndef DoMMAPedMerge
- memset(ret, 0, size); /* mmap() does this for us */
-#endif
- return ret;
-}
-#else /* MergeSectionAlloc */
-# define ELFLoaderSectToMem(elffile,align,offset,size,label) \
-_LoaderFileToMem((elffile)->fd,offset,size,label)
-# define ELFLoaderSectCalloc(elffile,align,size) xf86loadercalloc(1,size)
-#endif
-
-/*
- * Utility Functions
- */
-
-static int
-ELFhashCleanOut(void *voidptr, itemPtr item)
-{
- ELFModulePtr module = (ELFModulePtr) voidptr;
-
- return (module->handle == item->handle);
-}
-
-/*
- * Manage listResolv
- */
-static ELFRelocPtr
-ElfDelayRelocation(ELFModulePtr elffile, Elf_Word secn, Elf_Rel_t *rel)
-{
- ELFRelocPtr reloc;
-
- if ((reloc = xf86loadermalloc(sizeof(ELFRelocRec))) == NULL) {
- ErrorF("ElfDelayRelocation() Unable to allocate memory!!!!\n");
- return 0;
- }
- reloc->file = elffile;
- reloc->secn = secn;
- reloc->rel = rel;
- reloc->next = 0;
-#ifdef ELFDEBUG
- ELFDEBUG("ElfDelayRelocation %p: file %p, sec %d,"
- " r_offset 0x%lx, r_info 0x%x",
- (void *)reloc, (void *)elffile, secn,
- (unsigned long)rel->r_offset, rel->r_info);
-# if defined(__powerpc__) || \
- defined(__mc68000__) || \
- defined(__alpha__) || \
- defined(__sparc__) || \
- defined(__ia64__) || \
- defined(__AMD64__)
- ELFDEBUG(", r_addend 0x%lx", rel->r_addend);
-# endif
- ELFDEBUG("\n");
-#endif
- return reloc;
-}
-
-/*
- * Manage listCOMMON
- */
-static ELFCommonPtr
-ElfAddCOMMON(Elf_Sym *sym)
-{
- ELFCommonPtr common;
-
- if ((common = xf86loadermalloc(sizeof(ELFCommonRec))) == NULL) {
- ErrorF("ElfAddCOMMON() Unable to allocate memory!!!!\n");
- return 0;
- }
- common->sym = sym;
- common->next = 0;
- return common;
-}
-
-static int
-ElfCOMMONSize(void)
-{
- int size = 0;
- ELFCommonPtr common;
-
- for (common = listCOMMON; common; common = common->next) {
- size += common->sym->st_size;
-#if defined(__alpha__) || \
- defined(__ia64__) || \
- defined(__AMD64__) || \
- (defined(__sparc__) && \
- (defined(__arch64__) || \
- defined(__sparcv9)))
- size = (size + 7) & ~0x7;
-#endif
- }
- return size;
-}
-
-static int
-ElfCreateCOMMON(ELFModulePtr elffile, LOOKUP *pLookup)
-{
- int numsyms = 0, size = 0, l = 0;
- int offset = 0, firstcommon = 0;
- ELFCommonPtr common;
-
- if (listCOMMON == NULL)
- return TRUE;
-
- for (common = listCOMMON; common; common = common->next) {
- size += common->sym->st_size;
-#if defined(__alpha__) || \
- defined(__ia64__) || \
- defined(__AMD64__) || \
- (defined(__sparc__) && \
- (defined(__arch64__) || \
- defined(__sparcv9)))
- size = (size + 7) & ~0x7;
-#endif
- numsyms++;
- }
-
-#ifdef ELFDEBUG
- ELFDEBUG("ElfCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
- numsyms, size);
-#endif
-
- elffile->comsize = size;
- if ((elffile->common = ELFLoaderSectCalloc(elffile, 8, size)) == NULL) {
- ErrorF("ElfCreateCOMMON() Unable to allocate memory!!!!\n");
- return FALSE;
- }
-
- if (DebuggerPresent) {
- ldrCommons = xf86loadermalloc(numsyms * sizeof(LDRCommon));
- nCommons = numsyms;
- }
-
- for (l = 0; pLookup[l].symName; l++) ;
- firstcommon = l;
-
- /* Traverse the common list and create a lookup table with all the
- * common symbols. Destroy the common list in the process.
- * See also ResolveSymbols.
- */
- while (listCOMMON) {
- common = listCOMMON;
- /* this is xstrdup because is should be more efficient. it is freed
- * with xf86loaderfree
- */
- pLookup[l].symName =
- xf86loaderstrdup(ElfGetString(elffile, common->sym->st_name));
- pLookup[l].offset = (funcptr) (elffile->common + offset);
-#ifdef ELFDEBUG
- ELFDEBUG("Adding common %p %s\n",
- (void *)pLookup[l].offset, pLookup[l].symName);
-#endif
-
- /* Record the symbol address for gdb */
- if (DebuggerPresent && ldrCommons) {
- ldrCommons[l - firstcommon].addr = (void *)pLookup[l].offset;
- ldrCommons[l - firstcommon].name = pLookup[l].symName;
- ldrCommons[l - firstcommon].namelen = strlen(pLookup[l].symName);
- }
- listCOMMON = common->next;
- offset += common->sym->st_size;
-#if defined(__alpha__) || \
- defined(__ia64__) || \
- defined(__AMD64__) || \
- (defined(__sparc__) && \
- (defined(__arch64__) || \
- defined(__sparcv9)))
- offset = (offset + 7) & ~0x7;
-#endif
- xf86loaderfree(common);
- l++;
- }
- /* listCOMMON == 0 */
- pLookup[l].symName = NULL; /* Terminate the list. */
- return TRUE;
-}
-
-/*
- * String Table
- */
-static char *
-ElfGetStringIndex(ELFModulePtr file, int offset, int index)
-{
- if (!offset || !index)
- return "";
-
- return (char *)(file->saddr[index] + offset);
-}
-
-static char *
-ElfGetString(ELFModulePtr file, int offset)
-{
- return ElfGetStringIndex(file, offset, file->strndx);
-}
-
-static char *
-ElfGetSectionName(ELFModulePtr file, int offset)
-{
- return (char *)(file->shstraddr + offset);
-}
-
-/*
- * Symbol Table
- */
-
-/*
- * Get symbol name
- */
-static char *
-ElfGetSymbolNameIndex(ELFModulePtr elffile, int index, int secndx)
-{
- Elf_Sym *syms;
-
-#ifdef ELFDEBUG
- ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ", index, secndx);
-#endif
-
- syms = (Elf_Sym *) elffile->saddr[secndx];
-
-#ifdef ELFDEBUG
- ELFDEBUG("%s ", ElfGetString(elffile, syms[index].st_name));
- ELFDEBUG("%x %x ", ELF_ST_BIND(syms[index].st_info),
- ELF_ST_TYPE(syms[index].st_info));
- ELFDEBUG("%lx\n", (unsigned long)syms[index].st_value);
-#endif
-
- return ElfGetString(elffile, syms[index].st_name);
-}
-
-static char *
-ElfGetSymbolName(ELFModulePtr elffile, int index)
-{
- return ElfGetSymbolNameIndex(elffile, index, elffile->symndx);
-}
-
-static Elf_Addr
-ElfGetSymbolValue(ELFModulePtr elffile, int index)
-{
- Elf_Sym *syms;
- Elf_Addr symval = 0; /* value of the indicated symbol */
- char *symname = NULL; /* name of symbol in relocation */
- itemPtr symbol = NULL; /* name/value of symbol */
-
- syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
-
- switch (ELF_ST_TYPE(syms[index].st_info)) {
- case STT_NOTYPE:
- case STT_OBJECT:
- case STT_FUNC:
- switch (ELF_ST_BIND(syms[index].st_info)) {
- case STB_LOCAL:
- symval = (Elf_Addr) (elffile->saddr[syms[index].st_shndx] +
- syms[index].st_value);
-#ifdef __ia64__
- if (ELF_ST_TYPE(syms[index].st_info) == STT_FUNC) {
- ELFOpdPtr opdent;
-
- for (opdent = elffile->opd_entries; opdent;
- opdent = opdent->next)
- if (opdent->index == index)
- break;
- if (opdent) {
- ((unsigned long *)(elffile->got + opdent->offset))[0] =
- symval;
- ((unsigned long *)(elffile->got + opdent->offset))[1] =
- (long)elffile->got;
- symval = (Elf_Addr) (elffile->got + opdent->offset);
- }
- }
-#endif
- break;
- case STB_GLOBAL:
- case STB_WEAK: /* STB_WEAK seems like a hack to cover for
- * some other problem */
- symname = ElfGetString(elffile, syms[index].st_name);
- symbol = LoaderHashFind(symname);
- if (symbol == 0) {
- return 0;
- }
- symval = (Elf_Addr) symbol->address;
- break;
- default:
- symval = 0;
- ErrorF("ElfGetSymbolValue(), unhandled symbol scope %x\n",
- ELF_ST_BIND(syms[index].st_info));
- break;
- }
-#ifdef ELFDEBUG
- ELFDEBUG("%p\t", (void *)symbol);
- ELFDEBUG("%lx\t", (unsigned long)symval);
- ELFDEBUG("%s\n", symname ? symname : "NULL");
-#endif
- break;
- case STT_SECTION:
- symval = (Elf_Addr) elffile->saddr[syms[index].st_shndx];
-#ifdef ELFDEBUG
- ELFDEBUG("ST_SECTION %lx\n", (unsigned long)symval);
-#endif
- break;
- case STT_FILE:
- case STT_LOPROC:
- case STT_HIPROC:
- default:
- symval = 0;
- ErrorF("ElfGetSymbolValue(), unhandled symbol type %x\n",
- ELF_ST_TYPE(syms[index].st_info));
- break;
- }
- return symval;
-}
-
-#if defined(__powerpc__)
-/*
- * This function returns the address of a pseudo PLT routine which can
- * be used to compute a function offset. This is needed because loaded
- * modules have an offset from the .text section of greater than 24 bits.
- * The code generated makes the assumption that all function entry points
- * will be within a 24 bit offset (non-PIC code).
- */
-static Elf_Addr
-ElfGetPltAddr(ELFModulePtr elffile, int index)
-{
- Elf_Sym *syms;
- Elf_Addr symval = 0; /* value of the indicated symbol */
- char *symname = NULL; /* name of symbol in relocation */
- itemPtr symbol; /* name/value of symbol */
-
- syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
-
- switch (ELF_ST_TYPE(syms[index].st_info)) {
- case STT_NOTYPE:
- case STT_OBJECT:
- case STT_FUNC:
- switch (ELF_ST_BIND(syms[index].st_info)) {
- case STB_GLOBAL:
- symname = ElfGetString(elffile, syms[index].st_name);
- symbol = LoaderHashFind(symname);
- if (symbol == 0)
- return 0;
-/*
- * Here we are building up a pseudo Plt function that can make a call to
- * a function that has an offset greater than 24 bits. The following code
- * is being used to implement this.
-
- 1 00000000 .extern realfunc
- 2 00000000 .global pltfunc
- 3 00000000 pltfunc:
- 4 00000000 3d 80 00 00 lis r12,hi16(realfunc)
- 5 00000004 61 8c 00 00 ori r12,r12,lo16(realfunc)
- 6 00000008 7d 89 03 a6 mtctr r12
- 7 0000000c 4e 80 04 20 bctr
-
- */
-
- symbol->code.plt[0] = 0x3d80; /* lis r12 */
- symbol->code.plt[1] =
- (((Elf_Addr) symbol->address) & 0xffff0000) >> 16;
- symbol->code.plt[2] = 0x618c; /* ori r12,r12 */
- symbol->code.plt[3] = (((Elf_Addr) symbol->address) & 0xffff);
- symbol->code.plt[4] = 0x7d89; /* mtcr r12 */
- symbol->code.plt[5] = 0x03a6;
- symbol->code.plt[6] = 0x4e80; /* bctr */
- symbol->code.plt[7] = 0x0420;
- symbol->address = (char *)&symbol->code.plt[0];
- symval = (Elf_Addr) symbol->address;
- ppc_flush_icache(&symbol->code.plt[0]);
- ppc_flush_icache(&symbol->code.plt[6]);
- break;
- default:
- symval = 0;
- ErrorF("ElfGetPltAddr(), unhandled symbol scope %x\n",
- ELF_ST_BIND(syms[index].st_info));
- break;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("ElfGetPlt: symbol=%lx\t", symbol);
- ELFDEBUG("newval=%lx\t", symval);
- ELFDEBUG("name=\"%s\"\n", symname ? symname : "NULL");
-# endif
- break;
- case STT_SECTION:
- case STT_FILE:
- case STT_LOPROC:
- case STT_HIPROC:
- default:
- symval = 0;
- ErrorF("ElfGetPltAddr(), Unexpected symbol type %x",
- ELF_ST_TYPE(syms[index].st_info));
- ErrorF("for a Plt request\n");
- break;
- }
- return symval;
-}
-#endif /* __powerpc__ */
-
-#if defined(__alpha__) || defined(__ia64__)
-/*
- * Manage GOT Entries
- */
-static void
-ElfAddGOT(ELFModulePtr elffile, Elf_Rel_t *rel)
-{
- ELFGotEntryPtr gotent;
-
-# ifdef ELFDEBUG
- {
- Elf_Sym *sym;
-
- sym = (Elf_Sym *) & (elffile->symtab[ELF_R_SYM(rel->r_info)]);
- if (sym->st_name) {
- ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- } else
- ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n",
- ElfGetSectionName(elffile,
- elffile->sections[sym->st_shndx].
- sh_name));
- }
-# endif
-
- for (gotent = elffile->got_entries; gotent; gotent = gotent->next) {
- if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) &&
- gotent->rel->r_addend == rel->r_addend)
- break;
- }
-
- if (gotent) {
-# ifdef ELFDEBUG
- ELFDEBUG("Entry already present in GOT\n");
-# endif
- return;
- }
-
- if ((gotent = xf86loadermalloc(sizeof(ELFGotEntryRec))) == NULL) {
- ErrorF("ElfAddGOT() Unable to allocate memory!!!!\n");
- return;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("Entry added with offset %x\n", elffile->gotsize);
-# endif
- gotent->rel = rel;
- gotent->offset = elffile->gotsize;
- gotent->next = elffile->got_entries;
- elffile->got_entries = gotent;
- elffile->gotsize += 8;
- return;
-}
-
-static int
-ELFCreateGOT(ELFModulePtr elffile, int maxalign)
-{
-# ifdef MergeSectionAlloc
- ELFGotPtr gots;
-# endif
- int gotsize;
-
- /*
- * XXX: Is it REALLY needed to ensure GOT's are non-null?
- */
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreateGOT: %x entries in the GOT\n", elffile->gotsize / 8);
-
- /*
- * Hmmm. Someone is getting here without any got entries, but they
- * may still have R_ALPHA_GPDISP relocations against the got.
- */
- if (elffile->gotsize == 0)
- ELFDEBUG("Module %s doesn't have any GOT entries!\n",
- _LoaderModuleToName(elffile->module));
-# endif
- if (elffile->gotsize == 0)
- elffile->gotsize = 8;
- elffile->sections[elffile->gotndx].sh_size = elffile->gotsize;
- gotsize = elffile->gotsize;
-
-# ifdef MergeSectionAlloc
-# ifdef __alpha__
-# define GOTDistance 0x100000
-# endif
-# ifdef __ia64__
-# define GOTDistance 0x200000
-# endif
- for (gots = ELFSharedGOTs; gots; gots = gots->next) {
- if (gots->freeptr + elffile->gotsize > gots->section + gots->size)
- continue;
- if (gots->section > elffile->base) {
- if (gots->section + gots->size - elffile->base >= GOTDistance)
- continue;
- } else {
- if (elffile->base + elffile->basesize - gots->section >=
- GOTDistance)
- continue;
- }
- elffile->got = gots->freeptr;
- elffile->shared_got = gots;
- gots->freeptr = gots->freeptr + elffile->gotsize;
- gots->nuses++;
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreateGOT: GOT address %lx in shared GOT, nuses %d\n",
- elffile->got, gots->nuses);
-# endif
- return TRUE;
- }
-
- gotsize += 16383 + sizeof(ELFGotRec);
-# endif /*MergeSectionAlloc */
-
- if ((elffile->got = xf86loadermalloc(gotsize)) == NULL) {
- ErrorF("ELFCreateGOT() Unable to allocate memory!!!!\n");
- return FALSE;
- }
-# ifdef MergeSectionAlloc
- if (elffile->got > elffile->base) {
- if (elffile->got + elffile->gotsize - elffile->base >= GOTDistance)
- gotsize = 0;
- } else {
- if (elffile->base + elffile->basesize - elffile->got >= GOTDistance)
- gotsize = 0;
- }
-
- if (!gotsize) {
- xf86loaderfree(elffile->got);
-# if !defined(DoMMAPedMerge)
- elffile->basesize += 8 + elffile->gotsize;
- elffile->base = xf86loaderrealloc(elffile->base, elffile->basesize);
- if (elffile->base == NULL) {
- ErrorF("ELFCreateGOT() Unable to reallocate memory!!!!\n");
- return FALSE;
- }
-# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
- {
- unsigned long page_size = getpagesize();
- unsigned long round;
-
- round = (unsigned long)elffile->base & (page_size - 1);
- mprotect(elffile->base - round,
- (elffile->basesize + round + page_size -
- 1) & ~(page_size - 1),
- PROT_READ | PROT_WRITE | PROT_EXEC);
- }
-# endif
-# else
- {
- int oldbasesize = elffile->basesize;
-
- elffile->basesize += 8 + elffile->gotsize;
- MMAP_ALIGN(elffile->basesize);
- elffile->base = mremap(elffile->base, oldbasesize,
- elffile->basesize, MREMAP_MAYMOVE);
- if (elffile->base == NULL) {
- ErrorF("ELFCreateGOT() Unable to remap memory!!!!\n");
- return FALSE;
- }
- }
-# endif
-
- elffile->baseptr =
- ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
- elffile->got =
- (unsigned char
- *)((long)(elffile->base + elffile->basesize -
- elffile->gotsize) & ~7);
- } else {
- gots = (ELFGotPtr) elffile->got;
- elffile->got = gots->section;
- gots->size = gotsize - sizeof(ELFGotRec) + 1;
- gots->nuses = 1;
- gots->freeptr = gots->section + elffile->gotsize;
- gots->next = ELFSharedGOTs;
- ELFSharedGOTs = gots;
- elffile->shared_got = gots;
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreateGOT: Created a shareable GOT with size %d\n",
- gots->size);
-# endif
- }
-# endif /*MergeSectionAlloc */
-
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreateGOT: GOT address %lx\n", elffile->got);
-# endif
-
- return TRUE;
-}
-#endif /* defined(__alpha__) || defined(__ia64__) */
-
-#if defined(__ia64__)
-/*
- * Manage OPD Entries
- */
-static void
-ElfAddOPD(ELFModulePtr elffile, int index, LOOKUP *l)
-{
- ELFOpdPtr opdent;
-
- if (index != -1) {
- for (opdent = elffile->opd_entries; opdent; opdent = opdent->next)
- if (opdent->index == index)
- return;
- }
-
- if ((opdent = xf86loadermalloc(sizeof(ELFOpdRec))) == NULL) {
- ErrorF("ElfAddOPD() Unable to allocate memory!!!!\n");
- return;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("OPD Entry %d added with offset %x\n", index, elffile->gotsize);
-# endif
- opdent->l = l;
- opdent->index = index;
- opdent->offset = elffile->gotsize;
- opdent->next = elffile->opd_entries;
- elffile->opd_entries = opdent;
- elffile->gotsize += 16;
- return;
-}
-
-static void
-ELFCreateOPD(ELFModulePtr elffile)
-{
- ELFOpdPtr opdent;
-
- if (elffile->got == NULL)
- ErrorF("ELFCreateOPD() Unallocated GOT!!!!\n");
-
- for (opdent = elffile->opd_entries; opdent; opdent = opdent->next) {
- if (opdent->index != -1)
- continue;
- ((unsigned long *)(elffile->got + opdent->offset))[0] =
- (long)opdent->l->offset;
- ((unsigned long *)(elffile->got + opdent->offset))[1] =
- (long)elffile->got;
- opdent->l->offset = (funcptr) (elffile->got + opdent->offset);
- }
-}
-
-/*
- * Manage PLT Entries
- */
-static void
-ElfAddPLT(ELFModulePtr elffile, Elf_Rel_t *rel)
-{
- ELFPltEntryPtr pltent;
-
-# ifdef ELFDEBUG
- {
- Elf_Sym *sym;
-
- sym = (Elf_Sym *) & (elffile->symtab[ELF_R_SYM(rel->r_info)]);
- if (sym->st_name) {
- ELFDEBUG("ElfAddPLT: Adding PLT entry for %s\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- } else
- ErrorF("ElfAddPLT: Add PLT entry for section??\n");
- }
-# endif
-
- if (rel->r_addend)
- ErrorF("ElfAddPLT: Add PLT entry with non-zero addend??\n");
-
- for (pltent = elffile->plt_entries; pltent; pltent = pltent->next) {
- if (ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info))
- break;
- }
-
- if (pltent) {
-# ifdef ELFDEBUG
- ELFDEBUG("Entry already present in PLT\n");
-# endif
- return;
- }
-
- if ((pltent = xf86loadermalloc(sizeof(ELFPltEntryRec))) == NULL) {
- ErrorF("ElfAddPLT() Unable to allocate memory!!!!\n");
- return;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("Entry added with offset %x\n", elffile->pltsize);
-# endif
- pltent->rel = rel;
- pltent->offset = elffile->pltsize;
- pltent->gotoffset = elffile->gotsize;
- pltent->next = elffile->plt_entries;
- elffile->plt_entries = pltent;
- elffile->pltsize += 32;
- elffile->gotsize += 16;
- return;
-}
-
-static void
-ELFCreatePLT(ELFModulePtr elffile)
-{
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize / 8);
-# endif
-
- if (elffile->pltsize == 0)
- return;
-
- if ((elffile->plt =
- ELFLoaderSectCalloc(elffile, 32, elffile->pltsize)) == NULL) {
- ErrorF("ELFCreatePLT() Unable to allocate memory!!!!\n");
- return;
- }
- elffile->sections[elffile->pltndx].sh_size = elffile->pltsize;
-# ifdef ELFDEBUG
- ELFDEBUG("ELFCreatePLT: PLT address %lx\n", elffile->plt);
-# endif
-
- return;
-}
-
-static void
-IA64InstallReloc(unsigned long *data128, int slot, enum ia64_operand opnd,
- long value)
-{
- unsigned long data = 0;
-
-# ifdef ELFDEBUG
- ELFDEBUG("\nIA64InstallReloc %p %d %d %016lx\n", data128, slot, opnd,
- value);
- ELFDEBUG("Before [%016lx%016lx]\n", data128[1], data128[0]);
-# endif
- switch (slot) {
- case 0:
- data = *data128;
- break;
- case 1:
- memcpy(&data, (char *)data128 + 5, 8);
- break;
- case 2:
- memcpy(&data, (char *)data128 + 10, 6);
- break;
- default:
- FatalError("Unexpected slot in IA64InstallReloc()\n");
- }
- switch (opnd) {
- case IA64_OPND_IMM22:
- data &= ~(0x3fff9fc0000UL << slot);
- data |= (value & 0x7f) << (18 + slot); /* [13:19] + 5 + slot */
- data |= (value & 0xff80) << (25 + slot); /* [27:35] + 5 + slot */
- data |= (value & 0x1f0000) << (11 + slot); /* [22:26] + 5 + slot */
- data |= (value & 0x200000) << (20 + slot); /* [36:36] + 5 + slot */
- if (value << 42 >> 42 != value)
- ErrorF("Relocation %016lx truncated to fit into IMM22\n", value);
- break;
- case IA64_OPND_TGT25C:
- data &= ~(0x23ffffc0000UL << slot);
- data |= (value & 0xfffff0) << (14 + slot); /* [13:32] + 5 + slot */
- data |= (value & 0x1000000) << (17 + slot); /* [36:36] + 5 + slot */
- if (value << 39 >> 39 != value || (value & 0xf))
- ErrorF("Relocation %016lx truncated to fit into TGT25C\n", value);
- break;
-#ifdef IA64_LDX_OPTIMIZATION
- case IA64_OPND_LDXMOV:
- /*
- * Convert "ld8 t2=[t1]" to "mov t2=t1" which is really "add t2=0,t1"
- * Mask all but the r3,r1,qp fields,
- * then OR in the ALU opcode = 8 into the opcode field [40:37]
- *
- * Mask for the r3,r1,qp bit fields [26:20][12:6][5:0] = 0x7f01fff,
- * This mask negated only within the 41 bit wide instruction and
- * shifted left by 5 for the bundle template is 0x3FFF01FC0000
- *
- * opcode field [40:37] with a value of 8 is 0x10000000000
- * shifted left by 5 for the bundle template is 0x200000000000
- *
- */
- data &= ~(0x3FFF01FC0000 << slot);
- data |= (0x200000000000 << slot);
- break;
-#endif
- default:
- FatalError("Unhandled operand in IA64InstallReloc()\n");
- }
- switch (slot) {
- case 0:
- *data128 = data;
- break;
- case 1:
- memcpy((char *)data128 + 5, &data, 8);
- break;
- case 2:
- memcpy((char *)data128 + 10, &data, 6);
- break;
- default:
- FatalError("Unexpected slot in IA64InstallReloc()\n");
- }
- ia64_flush_cache(data128);
-# ifdef ELFDEBUG
- ELFDEBUG("After [%016lx%016lx]\n", data128[1], data128[0]);
-# endif
-}
-
-#endif /*__ia64__*/
-
-/*
- * Fix all of the relocations for the given section.
- * If the argument 'force' is non-zero, then the relocation will be
- * made even if the symbol can't be found (by substituting
- * LoaderDefaultFunc) otherwise, the relocation will be deferred.
- */
-
-static ELFRelocPtr
-Elf_RelocateEntry(ELFModulePtr elffile, Elf_Word secn, Elf_Rel_t *rel,
- int force)
-{
- unsigned char *secp = elffile->saddr[secn];
-
-#if !defined(__ia64__)
- unsigned int *dest32; /* address of the 32 bit place being modified */
-#endif
-#if defined(__powerpc__) || defined(__sparc__)
- unsigned short *dest16; /* address of the 16 bit place being modified */
-#endif
-#if defined(__sparc__)
- unsigned char *dest8; /* address of the 8 bit place being modified */
- unsigned long *dest64;
-#endif
-#if defined(__alpha__)
- unsigned int *dest32h; /* address of the high 32 bit place being modified */
- unsigned long *dest64;
- unsigned short *dest16;
-#endif
-#if defined(__AMD64__)
- unsigned long *dest64;
- int *dest32s;
-#endif
-#if defined(__ia64__)
- unsigned long *dest64;
- unsigned long *dest128;
-#endif
- Elf_Addr symval = 0; /* value of the indicated symbol */
-
-#ifdef ELFDEBUG
- ELFDEBUG("%lx %d %d\n", (unsigned long)rel->r_offset,
- ELF_R_SYM(rel->r_info), ELF_R_TYPE(rel->r_info));
-# if defined(__powerpc__) || \
- defined(__mc68000__) || \
- defined(__alpha__) || \
- defined(__sparc__) || \
- defined(__ia64__) || \
- defined(__AMD64__)
- ELFDEBUG("%lx", rel->r_addend);
-# endif
- ELFDEBUG("\n");
-#endif /*ELFDEBUG*/
-#if defined(__alpha__)
- if (ELF_R_SYM(rel->r_info)
- && ELF_R_TYPE(rel->r_info) != R_ALPHA_GPDISP)
-#else
- if (ELF_R_SYM(rel->r_info))
-#endif
- {
- symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info));
- if (symval == 0) {
- if (force) {
- symval = (Elf_Addr) & LoaderDefaultFunc;
- } else {
-#ifdef ELFDEBUG
- ELFDEBUG("***Unable to resolve symbol %s\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
-#endif
- return ElfDelayRelocation(elffile, secn, rel);
- }
- }
- }
-
- switch (ELF_R_TYPE(rel->r_info)) {
-#if defined(i386)
- case R_386_32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_386_32\t");
- ELFDEBUG("dest32=%p\t", (void *)dest32);
- ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32);
-# endif
- *dest32 = symval + (*dest32); /* S + A */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32);
-# endif
- break;
- case R_386_PC32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_386_PC32 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%p\t", secp);
- ELFDEBUG("symval=%lx\t", (unsigned long)symval);
- ELFDEBUG("dest32=%p\t", (void *)dest32);
- ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32);
-# endif
-
- *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
-
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32);
-# endif
-
- break;
-#endif /* i386 */
-#if defined(__AMD64__)
- case R_X86_64_32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_X86_32\t");
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8lx\t", *dest32);
- ELFDEBUG("r_addend=%lx\t", rel->r_addend);
-# endif
- *dest32 = symval + rel->r_addend + (*dest32); /* S + A */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8lx\n", *dest32);
-# endif
- break;
- case R_X86_64_32S:
- dest32s = (int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_X86_64_32\t");
- ELFDEBUG("dest32s=%x\t", dest32s);
- ELFDEBUG("*dest32s=%8.8lx\t", *dest32s);
- ELFDEBUG("r_addend=%lx\t", rel->r_addend);
-# endif
- *dest32s = symval + rel->r_addend + (*dest32s); /* S + A */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32s=%8.8lx\n", *dest32s);
-# endif
- break;
- case R_X86_64_PC32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_X86_64_PC32 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8lx\t", *dest32);
- ELFDEBUG("r_addend=%lx\t", rel->r_addend);
-# endif
- *dest32 = symval + rel->r_addend + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
-
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8lx\n", *dest32);
-# endif
- break;
- case R_X86_64_64:
- dest64 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_AMD64_64\t");
- ELFDEBUG("dest64=%x\t", dest64);
- ELFDEBUG("*dest64=%8.8lx\t", *dest64);
- ELFDEBUG("r_addend=%lx\t", rel->r_addend);
-# endif
- *dest64 = symval + rel->r_addend + (*dest64); /* S + A */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest64=%8.8lx\n", *dest64);
-# endif
- break;
-#endif /* __AMD64__ */
-#if defined(__alpha__)
- case R_ALPHA_NONE:
- case R_ALPHA_LITUSE:
- break;
-
- case R_ALPHA_REFQUAD:
- dest64 = (unsigned long *)(secp + rel->r_offset);
- symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info));
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_REFQUAD\t");
- ELFDEBUG("dest64=%lx\t", dest64);
- ELFDEBUG("*dest64=%8.8lx\t", *dest64);
-# endif
- *dest64 = symval + rel->r_addend + (*dest64); /* S + A + P */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest64=%8.8lx\n", *dest64);
-# endif
- break;
-
- case R_ALPHA_GPREL32:
- {
- dest64 = (unsigned long *)(secp + rel->r_offset);
- dest32 = (unsigned int *)dest64;
-
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_GPREL32 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest32=%lx\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
-# endif
- symval += rel->r_addend;
- symval = ((unsigned char *)symval) -
- ((unsigned char *)elffile->got);
-# ifdef ELFDEBUG
- ELFDEBUG("symval=%lx\t", symval);
-# endif
- if ((symval & 0xffffffff00000000) != 0x0000000000000000 &&
- (symval & 0xffffffff00000000) != 0xffffffff00000000) {
- FatalError("R_ALPHA_GPREL32 symval-got is too large for %s\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- }
-
- *dest32 = symval;
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%x\n", *dest32);
-# endif
- break;
- }
-
- case R_ALPHA_GPRELLOW:
- {
- dest64 = (unsigned long *)(secp + rel->r_offset);
- dest16 = (unsigned short *)dest64;
-
- symval += rel->r_addend;
- symval = ((unsigned char *)symval) -
- ((unsigned char *)elffile->got);
-
- *dest16 = symval;
- break;
- }
-
- case R_ALPHA_GPRELHIGH:
- {
- dest64 = (unsigned long *)(secp + rel->r_offset);
- dest16 = (unsigned short *)dest64;
-
- symval += rel->r_addend;
- symval = ((unsigned char *)symval) -
- ((unsigned char *)elffile->got);
- symval = ((long)symval >> 16) + ((symval >> 15) & 1);
- if ((long)symval > 0x7fff || (long)symval < -(long)0x8000) {
- FatalError
- ("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)),
- symval);
- }
-
- *dest16 = symval;
- break;
- }
-
- case R_ALPHA_LITERAL:
- {
- ELFGotEntryPtr gotent;
-
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_LITERAL %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest32=%lx\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
-# endif
-
- for (gotent = elffile->got_entries; gotent; gotent = gotent->next) {
- if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info)
- && gotent->rel->r_addend == rel->r_addend)
- break;
- }
-
- /* Set the address in the GOT */
- if (gotent) {
- *(unsigned long *)(elffile->got + gotent->offset) =
- symval + rel->r_addend;
-# ifdef ELFDEBUG
- ELFDEBUG("Setting gotent[%x]=%lx\t",
- gotent->offset, symval + rel->r_addend);
-# endif
- if ((gotent->offset & 0xffff0000) != 0)
- FatalError("\nR_ALPHA_LITERAL offset %x too large\n",
- gotent->offset);
- (*dest32) |= (gotent->offset); /* The address part is always 0 */
- } else {
- unsigned long val;
-
- /* S + A - P >> 2 */
- val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
-# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t", val);
-# endif
- if ((val & 0xffff0000) != 0xffff0000 &&
- (val & 0xffff0000) != 0x00000000) {
- ErrorF("\nR_ALPHA_LITERAL offset %x too large\n", val);
- break;
- }
- val &= 0x0000ffff;
- (*dest32) |= (val); /* The address part is always 0 */
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
-
- break;
- }
-
- case R_ALPHA_GPDISP:
- {
- long offset;
-
- dest32h = (unsigned int *)(secp + rel->r_offset);
- dest32 = (unsigned int *)((secp + rel->r_offset) + rel->r_addend);
-
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_GPDISP %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("got=%lx\t", elffile->got);
- ELFDEBUG("dest32=%lx\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
- ELFDEBUG("dest32h=%lx\t", dest32h);
- ELFDEBUG("*dest32h=%8.8x\t", *dest32h);
-# endif
- if ((*dest32h >> 26) != 9 || (*dest32 >> 26) != 8) {
- ErrorF("***Bad instructions in relocating %s\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- }
-
- symval = (*dest32h & 0xffff) << 16 | (*dest32 & 0xffff);
- symval = (symval ^ 0x80008000) - 0x80008000;
-
- offset = ((unsigned char *)elffile->got -
- (unsigned char *)dest32h);
-# ifdef ELFDEBUG
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("got-dest32=%lx\t", offset);
-# endif
-
- if ((offset >= 0x7fff8000L) || (offset < -0x80000000L)) {
- FatalError("Offset overflow for R_ALPHA_GPDISP\n");
- }
-
- symval += (unsigned long)offset;
-# ifdef ELFDEBUG
- ELFDEBUG("symval=%lx\t", symval);
-# endif
- *dest32 = (*dest32 & 0xffff0000) | (symval & 0xffff);
- *dest32h = (*dest32h & 0xffff0000) |
- (((symval >> 16) + ((symval >> 15) & 1)) & 0xffff);
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
- ELFDEBUG("*dest32h=%8.8x\n", *dest32h);
-# endif
- break;
- }
-
- case R_ALPHA_HINT:
- dest32 = (unsigned int *)((secp + rel->r_offset) + rel->r_addend);
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_HINT %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest32=%lx\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
-# endif
-
-# ifdef ELFDEBUG
- ELFDEBUG("symval=%lx\t", symval);
-# endif
- symval -= (Elf_Addr) (((unsigned char *)dest32) + 4);
- if (symval % 4) {
- ErrorF("R_ALPHA_HINT bad alignment of offset\n");
- }
- symval = symval >> 2;
-
-# ifdef ELFDEBUG
- ELFDEBUG("symval=%lx\t", symval);
-# endif
-
- if (symval & 0xffff8000) {
-# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_HINT symval too large\n");
-# endif
- }
-
- *dest32 = (*dest32 & ~0x3fff) | (symval & 0x3fff);
-
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
-
- case R_ALPHA_GPREL16:
- {
- dest64 = (unsigned long *)(secp + rel->r_offset);
- dest16 = (unsigned short *)dest64;
-
- symval += rel->r_addend;
- symval = ((unsigned char *)symval) -
- ((unsigned char *)elffile->got);
- if ((long)symval > 0x7fff || (long)symval < -(long)0x8000) {
- FatalError
- ("R_ALPHA_GPREL16 symval-got is too large for %s:%lx\n",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)),
- symval);
- }
-
- *dest16 = symval;
- break;
- }
-
-#endif /* alpha */
-#if defined(__mc68000__)
- case R_68K_32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_68K_32\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
-
- /* S + A */
- val = symval + (rel->r_addend);
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
-# endif
- *dest32 = val; /* S + A */
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_68K_PC32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_68K_PC32\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
-
- /* S + A - P */
- val = symval + (rel->r_addend);
- val -= *dest32;
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
- ELFDEBUG("S+A-P=%x\t", val + (*dest32) - (Elf_Addr) dest32);
-# endif
- *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
-#endif /* __mc68000__ */
-#if defined(__powerpc__)
-# if defined(PowerMAX_OS)
- case R_PPC_DISP24: /* 11 */
- dest32 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_DISP24 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
-# endif
-
- {
- unsigned long val;
-
- /* S + A - P >> 2 */
- val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
-# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t", val);
-# endif
- val = val >> 2;
- if ((val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000) {
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_DISP24 offset %x too large\n", val << 2);
-# endif
- symval = ElfGetPltAddr(elffile, ELF_R_SYM(rel->r_info));
- val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
-# ifdef ELFDEBUG
- ELFDEBUG("PLT offset is %x\n", val);
-# endif
- val = val >> 2;
- if ((val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000)
- FatalError("R_PPC_DISP24 PLT offset %x too large\n",
- val << 2);
- }
- val &= 0x00ffffff;
- (*dest32) |= (val << 2); /* The address part is always 0 */
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_16HU: /* 31 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- dest32 = (unsigned long *)(dest16 - 1);
-
-# endif
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_16HU\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest16=%x\t", dest16);
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned short val;
-
- /* S + A */
- val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16;
-# ifdef ELFDEBUG
- ELFDEBUG("uhi16(S+A)=%x\t", val);
-# endif
- *dest16 = val; /* S + A */
- ppc_flush_icache(dest16);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_32: /* 32 */
- dest32 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_32\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
-
- /* S + A */
- val = symval + (rel->r_addend);
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
-# endif
- *dest32 = val; /* S + A */
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_32UA: /* 33 */
- dest32 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_32UA\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
- unsigned char *dest8 = (unsigned char *)dest32;
-
- /* S + A */
- val = symval + (rel->r_addend);
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
-# endif
- *dest8++ = (val & 0xff000000) >> 24;
- *dest8++ = (val & 0x00ff0000) >> 16;
- *dest8++ = (val & 0x0000ff00) >> 8;
- *dest8++ = (val & 0x000000ff);
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_16H: /* 34 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- dest32 = (unsigned long *)(dest16 - 1);
-# endif
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_16H\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symbol=%s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest16=%x\t", dest16);
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned short val;
- unsigned short loval;
-
- /* S + A */
- val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16;
- loval = (symval + (rel->r_addend)) & 0xffff;
- if (loval & 0x8000) {
- /*
- * This is hi16(), instead of uhi16(). Because of this,
- * if the lo16() will produce a negative offset, then
- * we have to increment this part of the address to get
- * the correct final result.
- */
- val++;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("hi16(S+A)=%x\t", val);
-# endif
- *dest16 = val; /* S + A */
- ppc_flush_icache(dest16);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_16L: /* 35 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- dest32 = (unsigned long *)(dest16 - 1);
-# endif
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_16L\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest16=%x\t", dest16);
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned short val;
-
- /* S + A */
- val = (symval + (rel->r_addend)) & 0xffff;
-# ifdef ELFDEBUG
- ELFDEBUG("lo16(S+A)=%x\t", val);
-# endif
- *dest16 = val; /* S + A */
- ppc_flush_icache(dest16);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
-# else /* PowerMAX_OS */
- /* Linux PPC */
- case R_PPC_ADDR32: /* 1 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info));
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_ADDR32\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
-
- /* S + A */
- val = symval + (rel->r_addend);
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
-# endif
- *dest32 = val; /* S + A */
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_ADDR16_LO: /* 4 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- dest32 = (unsigned long *)(dest16 - 1);
-# endif
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_ADDR16_LO\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest16=%x\t", dest16);
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
-# endif
- {
- unsigned short val;
-
- /* S + A */
- val = (symval + (rel->r_addend)) & 0xffff;
-# ifdef ELFDEBUG
- ELFDEBUG("lo16(S+A)=%x\t", val);
-# endif
- *dest16 = val; /* S + A */
- ppc_flush_icache(dest16);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_ADDR16_HA: /* 6 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- dest32 = (unsigned long *)(dest16 - 1);
-# endif
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_ADDR16_HA\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest16=%x\t", dest16);
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
-# endif
- {
- unsigned short val;
- unsigned short loval;
-
- /* S + A */
- val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16;
- loval = (symval + (rel->r_addend)) & 0xffff;
- if (loval & 0x8000) {
- /*
- * This is hi16(), instead of uhi16(). Because of this,
- * if the lo16() will produce a negative offset, then
- * we have to increment this part of the address to get
- * the correct final result.
- */
- val++;
- }
-# ifdef ELFDEBUG
- ELFDEBUG("hi16(S+A)=%x\t", val);
-# endif
- *dest16 = val; /* S + A */
- ppc_flush_icache(dest16);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest16=%8.8x\t", *dest16);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_REL24: /* 10 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_REL24 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\t", *dest32);
-# endif
-
- {
- unsigned long val;
-
- /* S + A - P >> 2 */
- val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
-# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t", val);
-# endif
- val = val >> 2;
- if ((val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000) {
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_REL24 offset %x too large\n", val << 2);
-# endif
- symval = ElfGetPltAddr(elffile, ELF_R_SYM(rel->r_info));
- val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
-# ifdef ELFDEBUG
- ELFDEBUG("PLT offset is %x\n", val);
-# endif
- val = val >> 2;
- if ((val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000)
- FatalError("R_PPC_REL24 PLT offset %x too large\n",
- val << 2);
- }
- val &= 0x00ffffff;
- (*dest32) |= (val << 2); /* The address part is always 0 */
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
- case R_PPC_REL32: /* 26 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_REL32\t");
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%x\t", symval);
- ELFDEBUG("r_addend=%x\t", rel->r_addend);
- ELFDEBUG("dest32=%8.8x\t", dest32);
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- {
- unsigned long val;
-
- /* S + A - P */
- val = symval + (rel->r_addend);
- val -= *dest32;
-# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t", val);
- ELFDEBUG("S+A-P=%x\t", val + (*dest32) - (Elf_Addr) dest32);
-# endif
- *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
- ppc_flush_icache(dest32);
- }
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8x\n", *dest32);
-# endif
- break;
-# endif /* PowerMAX_OS */
-#endif /* __powerpc__ */
-#ifdef __sparc__
- case R_SPARC_NONE: /* 0 */
- break;
-
- case R_SPARC_8: /* 1 */
- dest8 = (unsigned char *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest8 = symval;
- break;
-
- case R_SPARC_16: /* 2 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest16 = symval;
- break;
-
- case R_SPARC_32: /* 3 */
- case R_SPARC_UA32: /* 23 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24);
- ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16);
- ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8);
- ((unsigned char *)dest32)[3] = (unsigned char)(symval);
- break;
-
- case R_SPARC_GLOB_DAT: /* 20 */
- case R_SPARC_64: /* 32 */
- dest64 = (unsigned long *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest64 = symval;
- break;
-
- case R_SPARC_DISP8: /* 4 */
- dest8 = (unsigned char *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest8 = (symval - (Elf_Addr) dest8);
- break;
-
- case R_SPARC_DISP16: /* 5 */
- dest16 = (unsigned short *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest16 = (symval - (Elf_Addr) dest16);
- break;
-
- case R_SPARC_DISP32: /* 6 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = (symval - (Elf_Addr) dest32);
- break;
-
- case R_SPARC_WDISP30: /* 7 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = ((*dest32 & 0xc0000000) |
- (((symval - (Elf_Addr) dest32) >> 2) & 0x3fffffff));
- break;
-
- case R_SPARC_HI22: /* 9 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = (*dest32 & 0xffc00000) | (symval >> 10);
- break;
-
- case R_SPARC_LO10: /* 12 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff);
- break;
-
- case R_SPARC_COPY: /* 19 */
- /* Fix your code... I'd rather dish out an error here
- * so people will not link together PIC and non-PIC
- * code into a final driver object file.
- */
- ErrorF("Elf_RelocateEntry():"
- " Copy relocs not supported on Sparc.\n");
- break;
-
- case R_SPARC_JMP_SLOT: /* 21 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- /* Before we change it the PLT entry looks like:
- *
- * pltent: sethi %hi(rela_plt_offset), %g1
- * b,a PLT0
- * nop
- *
- * We change it into:
- *
- * pltent: sethi %hi(rela_plt_offset), %g1
- * sethi %hi(symval), %g1
- * jmp %g1 + %lo(symval), %g0
- */
- symval += rel->r_addend;
- dest32[2] = 0x81c06000 | (symval & 0x3ff);
- __asm __volatile("flush %0 + 0x8"::"r"(dest32));
-
- dest32[1] = 0x03000000 | (symval >> 10);
- __asm __volatile("flush %0 + 0x4"::"r"(dest32));
-
- break;
-
- case R_SPARC_RELATIVE: /* 22 */
- dest64 = (unsigned long *)(secp + rel->r_offset);
- *dest64 = (unsigned long)secp + rel->r_addend;
- break;
-#endif /*__sparc__*/
-#ifdef __ia64__
- case R_IA64_NONE:
- break;
-
- case R_IA64_LTOFF_FPTR22:
- if (rel->r_addend)
- FatalError("\nAddend for R_IA64_LTOFF_FPTR22 not supported\n");
-# ifdef ELFDEBUG
- ELFDEBUG("opd=%016lx.%016lx\n",
- ((long *)symval)[0], ((long *)symval)[1]);
-# endif
- /* FALLTHROUGH */
- case R_IA64_LTOFF22:
-#ifndef IA64_LDX_OPTIMIZATION
- case R_IA64_LTOFF22X: /* If not implementing LDXMOV optimization treat LTOFF22X as LTOFF22 */
-#endif
- {
- ELFGotEntryPtr gotent;
-
- dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
-# ifdef ELFDEBUG
- ELFDEBUG("%s %s\t", ELF_R_TYPE(rel->r_info) == R_IA64_LTOFF22 ?
- "R_IA64_LTOFF22" : "R_IA64_LTOFF_FPTR22",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest128=%lx\t", dest128);
- ELFDEBUG("slot=%d\n", rel->r_offset & 3);
- ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
-# endif
-
- for (gotent = elffile->got_entries; gotent; gotent = gotent->next) {
- if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info)
- && gotent->rel->r_addend == rel->r_addend)
- break;
- }
-
- /* Set the address in the GOT */
- if (gotent) {
- *(unsigned long *)(elffile->got + gotent->offset) =
- symval + rel->r_addend;
-# ifdef ELFDEBUG
- ELFDEBUG("Setting gotent[%x]=%lx\n",
- gotent->offset, symval + rel->r_addend);
-# endif
- if ((gotent->offset & 0xffe00000) != 0)
- FatalError("\nR_IA64_LTOFF22 offset %x too large\n",
- gotent->offset);
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
- gotent->offset);
- } else
- FatalError("\nCould not find GOT entry\n");
- }
- break;
-
- case R_IA64_PCREL21B:
- {
- ELFPltEntryPtr pltent;
-
- dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_PCREL21B %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("opd=%lx.%lx\t", ((long *)symval)[0],
- ((long *)symval)[1]);
- ELFDEBUG("dest128=%lx\t", dest128);
- ELFDEBUG("slot=%d\n", rel->r_offset & 3);
- ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
-# endif
- if (rel->r_addend)
- FatalError("\nAddend for PCREL21B not supported\n");
- if (((long *)symval)[1] == (long)elffile->got
- && (((unsigned long)dest128 - ((unsigned long *)symval)[0]) +
- 0x2000000 < 0x4000000)) {
- /* We can save the travel through PLT */
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C,
- ((unsigned long *)symval)[0] -
- (unsigned long)dest128);
- break;
- }
- for (pltent = elffile->plt_entries; pltent; pltent = pltent->next) {
- if (ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info)
- && pltent->rel->r_addend == rel->r_addend)
- break;
- }
-
- /* Set the address in the PLT */
- if (pltent == NULL)
- FatalError("\nCould not find PLT entry\n");
- else {
- unsigned long *p =
- (unsigned long *)(elffile->plt + pltent->offset);
- unsigned long r =
- (unsigned long)symval - (unsigned long)elffile->got;
-
- if (r + 0x200000 >= 0x400000) {
- /* Too far from gp to use the official function descriptor,
- * so we have to make a local one.
- */
- r = pltent->gotoffset;
- memcpy(elffile->got + r, (char *)symval, 16);
- }
-
- /* [MMI] addl r15=NNN,r1;; ld8 r16=[r15],8; mov r14=r1;; */
- p[0] = 0x410024000200780bUL;
- p[1] = 0x84000801c028303cUL;
- /* [MIB] ld8 r1=[r15]; mov b6=r16; br.few b6;; */
- p[2] = 0x806010181e000811UL;
- p[3] = 0x0080006000038004UL;
- IA64InstallReloc(p, 0, IA64_OPND_IMM22, r);
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C,
- (unsigned long)p - (unsigned long)dest128);
- }
- }
- break;
-
- case R_IA64_FPTR64LSB:
- dest64 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_FPTR64LSB %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest64=%lx\t", dest64);
- ELFDEBUG("opd=%016lx.%016lx\n", ((long *)symval)[0],
- ((long *)symval)[1]);
-# endif
-
- if (rel->r_addend)
- FatalError("\nAddend not supported for R_IA64_FPTR64LSB\n");
- *dest64 = symval;
- ia64_flush_cache(dest64);
- break;
-
- case R_IA64_DIR64LSB:
- dest64 = (unsigned long *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_DIR64LSB %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest64=%lx\n", dest64);
-# endif
- *dest64 = symval + rel->r_addend;
- ia64_flush_cache(dest64);
- break;
-
- case R_IA64_PCREL64LSB:
- dest64 = (unsigned long *)(secp + rel->r_offset);
-#ifdef ELFDEBUG
- ELFDEBUG("R_IA64_PCREL64LSB %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest64=%lx\n", dest64);
-#endif
- *dest64 = symval + rel->r_addend - (unsigned long)dest64;
- break;
-
- case R_IA64_GPREL22:
- dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_GPREL22 %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest128=%lx\t", dest128);
- ELFDEBUG("slot=%d\n", rel->r_offset & 3);
- ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
-# endif
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
- symval + rel->r_addend - (long)elffile->got);
- break;
-
-#ifdef IA64_LDX_OPTIMIZATION
- case R_IA64_LTOFF22X:
- {
- ELFGotEntryPtr gotent;
- long gp_offset = symval + rel->r_addend - (long)elffile->got;
-
- dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
-
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_LTOFF22X %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest128=%lx\t", dest128);
- ELFDEBUG("slot=%d\n", rel->r_offset & 3);
-# endif
-
- if (gp_offset << 42 >> 42 != gp_offset) {
- /* Offset is too large for LTOFF22X,
- * fallback to using GOT lookup, e.g. LTOFF22.
- * Note: LDXMOV will fail the same test and will be ignored. */
-
-# ifdef ELFDEBUG
- ELFDEBUG("gp_offset=%ld too large, using GOT instead (LTOFF22)\n", gp_offset);
-# endif
-
- for (gotent = elffile->got_entries; gotent;
- gotent = gotent->next) {
- if (ELF_R_SYM(gotent->rel->r_info) ==
- ELF_R_SYM(rel->r_info)
- && gotent->rel->r_addend == rel->r_addend)
- break;
- }
-
- /* Set the address in the GOT */
- if (gotent) {
- *(unsigned long *)(elffile->got + gotent->offset) =
- symval + rel->r_addend;
-# ifdef ELFDEBUG
- ELFDEBUG("Setting gotent[%x]=%lx\n", gotent->offset,
- symval + rel->r_addend);
-# endif
- if ((gotent->offset & 0xffe00000) != 0)
- FatalError("\nR_IA64_LTOFF22 offset %x too large\n",
- gotent->offset);
- } else {
- FatalError("\nCould not find GOT entry\n");
- }
- gp_offset = gotent->offset; /* Use GOT lookup */
- } else {
-# ifdef ELFDEBUG
- ELFDEBUG("using gp_offset=%ld (LTOFF22X)", gp_offset);
-# endif
- }
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
- gp_offset);
- }
- break;
-#endif
-
- case R_IA64_LDXMOV:
-# ifdef ELFDEBUG
- ELFDEBUG("R_IA64_LDXMOV %s\t",
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
-# endif
-
-#ifdef IA64_LDX_OPTIMIZATION
- {
- long gp_offset = symval + rel->r_addend - (long)elffile->got;
-
- dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
-
- if (gp_offset << 42 >> 42 != gp_offset) {
- /* Offset is too large for LTOFF22X, ignore this relocation */
-# ifdef ELFDEBUG
- ELFDEBUG("offset = %ld too large, ignoring\n", gp_offset);
-# endif
- } else {
-
-# ifdef ELFDEBUG
- ELFDEBUG("secp=%lx\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest128=%lx\t", dest128);
- ELFDEBUG("slot=%d\n", rel->r_offset & 3);
- ELFDEBUG("offset=%ld\n", gp_offset);
- ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
-# endif
-
- IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_LDXMOV,
- 0);
- }
- }
-#endif
- break;
-
-#endif /*__ia64__*/
-
-#if defined(__arm__)
- case R_ARM_ABS32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- ELFDEBUG("R_ARM_ABS32\t");
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8lx\t", *dest32);
-# endif
- *dest32 = symval + (*dest32); /* S + A */
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8lx\n", *dest32);
-# endif
- break;
-
- case R_ARM_REL32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
-# ifdef ELFDEBUG
- {
- char *namestr;
-
- ELFDEBUG("R_ARM_REL32 %s\t",
- namestr =
- ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
- xf86loaderfree(namestr);
- ELFDEBUG("secp=%x\t", secp);
- ELFDEBUG("symval=%lx\t", symval);
- ELFDEBUG("dest32=%x\t", dest32);
- ELFDEBUG("*dest32=%8.8lx\t", *dest32);
- }
-# endif
-
- *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
-
-# ifdef ELFDEBUG
- ELFDEBUG("*dest32=%8.8lx\n", *dest32);
-# endif
-
- break;
-
- case R_ARM_PC24:
- {
- unsigned long val;
-
- dest32 = (unsigned int *)(secp + rel->r_offset);
- val = (*dest32 & 0x00ffffff) << 2;
- val = symval - (unsigned long)dest32 + val;
- val >>= 2;
- *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff);
-#ifdef NOTYET
- arm_flush_cache(dest32);
-#endif
- }
- break;
-
-#endif /* (__arm__) */
-
- default:
- ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n",
- (int)ELF_R_TYPE(rel->r_info));
- break;
- }
- return 0;
-}
-
-static ELFRelocPtr
-ELFCollectRelocations(elffile, index)
- ELFModulePtr elffile;
- int index; /* The section to use as relocation data */
-{
- int i, numrel;
- Elf_Shdr *sect = &(elffile->sections[index]);
- Elf_Rel_t *rel = (Elf_Rel_t *) elffile->saddr[index];
- ELFRelocPtr reloc_head = NULL;
- ELFRelocPtr tmp;
-
- numrel = sect->sh_size / sect->sh_entsize;
-
- for (i = 0; i < numrel; i++) {
-#if defined(__alpha__)
- if (ELF_R_TYPE(rel[i].r_info) == R_ALPHA_LITERAL) {
- ElfAddGOT(elffile, &rel[i]);
- }
-#endif
-#if defined(__ia64__)
- if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF22
- || ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF22X
- || ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22) {
- ElfAddGOT(elffile, &rel[i]);
- }
- if (ELF_R_TYPE(rel[i].r_info) == R_IA64_PCREL21B) {
- ElfAddPLT(elffile, &rel[i]);
- }
- if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22
- || ELF_R_TYPE(rel[i].r_info) == R_IA64_FPTR64LSB) {
- Elf_Sym *syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
-
- if (ELF_ST_BIND(syms[ELF_R_SYM(rel[i].r_info)].st_info) ==
- STB_LOCAL) {
- ElfAddOPD(elffile, ELF_R_SYM(rel[i].r_info), NULL);
- }
- }
-#endif
- tmp = ElfDelayRelocation(elffile, sect->sh_info, &(rel[i]));
- tmp->next = reloc_head;
- reloc_head = tmp;
- }
-
- return reloc_head;
-}
-
-/*
- * ELF_GetSymbols()
- *
- * add the symbols to the symbol table maintained by the loader.
- */
-
-static LOOKUP *
-ELF_GetSymbols(ELFModulePtr elffile, unsigned short **psecttable)
-{
- Elf_Sym *syms;
- Elf_Shdr *sect;
- int i, l, numsyms;
- LOOKUP *lookup, *p;
- ELFCommonPtr tmp;
- unsigned short *secttable;
-
- syms = elffile->symtab;
- sect = &(elffile->sections[elffile->symndx]);
- numsyms = sect->sh_size / sect->sh_entsize;
-
- if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL)
- return 0;
-
- if ((secttable =
- xf86loadercalloc(sizeof(unsigned short), (numsyms + 1))) == NULL) {
- xf86loaderfree(lookup);
- return 0;
- }
- *psecttable = secttable;
-
- for (i = 0, l = 0; i < numsyms; i++) {
-#ifdef ELFDEBUG
- ELFDEBUG("value=%lx\tsize=%lx\tBIND=%x\tTYPE=%x\tndx=%x\t%s\n",
- (unsigned long)syms[i].st_value,
- (unsigned long)syms[i].st_size,
- ELF_ST_BIND(syms[i].st_info), ELF_ST_TYPE(syms[i].st_info),
- syms[i].st_shndx, ElfGetString(elffile, syms[i].st_name));
-#endif
-
- if (ELF_ST_BIND(syms[i].st_info) == STB_LOCAL)
- /* Don't add static symbols to the symbol table */
- continue;
-
- switch (ELF_ST_TYPE(syms[i].st_info)) {
- case STT_OBJECT:
- case STT_FUNC:
- case STT_SECTION:
- case STT_NOTYPE:
- switch (syms[i].st_shndx) {
- case SHN_ABS:
- ErrorF("ELF_GetSymbols() Don't know how to handle SHN_ABS\n");
- break;
- case SHN_COMMON:
-#ifdef ELFDEBUG
- ELFDEBUG("Adding COMMON space for %s\n",
- ElfGetString(elffile, syms[i].st_name));
-#endif
- if (!LoaderHashFind(ElfGetString(elffile, syms[i].st_name))) {
- tmp = ElfAddCOMMON(&(syms[i]));
- if (tmp) {
- tmp->next = listCOMMON;
- listCOMMON = tmp;
- }
- }
- break;
- case SHN_UNDEF:
- /*
- * UNDEF will get resolved later, so the value
- * doesn't really matter here.
- */
- /* since we don't know the value don't advertise the symbol */
- break;
- default:
- lookup[l].symName =
- xf86loaderstrdup(ElfGetString
- (elffile, syms[i].st_name));
- lookup[l].offset = (funcptr) syms[i].st_value;
- secttable[l] = syms[i].st_shndx;
-#ifdef ELFDEBUG
- ELFDEBUG("Adding symbol %lx(%d) %s\n",
- (unsigned long)lookup[l].offset, secttable[l],
- lookup[l].symName);
-#endif
-#ifdef __ia64__
- if (ELF_ST_TYPE(syms[i].st_info) == STT_FUNC) {
- ElfAddOPD(elffile, -1, &lookup[l]);
- }
-#endif
- l++;
- break;
- }
- break;
- case STT_FILE:
- case STT_LOPROC:
- case STT_HIPROC:
- /* Skip this type */
-#ifdef ELFDEBUG
- ELFDEBUG("Skipping TYPE %d %s\n",
- ELF_ST_TYPE(syms[i].st_info),
- ElfGetString(elffile, syms[i].st_name));
-#endif
- break;
- default:
- ErrorF("ELF_GetSymbols(): Unepected symbol type %d\n",
- ELF_ST_TYPE(syms[i].st_info));
- break;
- }
- }
-
- lookup[l].symName = NULL; /* Terminate the list */
-
-/*
- * Remove the ELF symbols that will show up in every object module.
- */
- for (i = 0, p = lookup; p->symName; i++, p++) {
- while (!strcmp(lookup[i].symName, ".text")
- || !strcmp(lookup[i].symName, ".data")
- || !strcmp(lookup[i].symName, ".bss")
- || !strcmp(lookup[i].symName, ".comment")
- || !strcmp(lookup[i].symName, ".note")
- ) {
- memmove(&(lookup[i]), &(lookup[i + 1]), (l - i) * sizeof(LOOKUP));
- memmove(&(secttable[i]), &(secttable[i + 1]),
- (l-- - i) * sizeof(unsigned short));
- }
- }
- return lookup;
-}
-
-#define SecOffset(index) elffile->sections[index].sh_offset
-#define SecSize(index) elffile->sections[index].sh_size
-#define SecAlign(index) elffile->sections[index].sh_addralign
-#define SecType(index) elffile->sections[index].sh_type
-#define SecFlags(index) elffile->sections[index].sh_flags
-#define SecInfo(index) elffile->sections[index].sh_info
-
-#define AdjustSize(i) \
- if (!pass) { \
- if (SecAlign(i) > *maxalign) \
- *maxalign = SecAlign(i); \
- *totalsize += (SecAlign(i) - 1); \
- *totalsize &= ~(SecAlign(i) - 1); \
- *totalsize += SecSize(i); \
- continue; \
- } do { } while (0)
-
-/*
- * ELFCollectSections
- *
- * Do the work required to load each section into memory.
- */
-static void
-ELFCollectSections(ELFModulePtr elffile, int pass, int *totalsize,
- int *maxalign)
-{
- int i;
- int j;
-
-/*
- * Find and identify all of the Sections
- */
- j = elffile->lsectidx;
- for (i = 1; i < elffile->numsh; i++) {
- int flags = 0;
- char *name = ElfGetSectionName(elffile, elffile->sections[i].sh_name);
-
-#if defined(__alpha__) || defined(__ia64__)
- if (!strcmp(name, ".got") /*Isn't there a more generic way to do this? */
-# if defined(__ia64__)
- || !strcmp(name, ".plt") || !strcmp(name, ".IA_64.unwind_info")
-# endif
- )
- continue;
-#endif
- switch (SecType(i)) {
- case SHT_STRTAB:
- if (!strcmp(name, ".shstrtab")) /* already loaded */
- continue;
- if (!strcmp(name, ".stabstr")) /* ignore debug info */
- continue;
- case SHT_SYMTAB:
- if (pass)
- continue;
- flags = LOADED_SECTION;
- flags |= RELOC_SECTION;
- break;
- case SHT_REL:
- case SHT_RELA:
- if (pass)
- continue;
- if (!(SecFlags(SecInfo(i)) & SHF_ALLOC))
- continue;
-#ifdef __ia64__
- if (SecType(SecInfo(i)) == SHT_IA_64_UNWIND)
- continue;
-#endif
- flags = LOADED_SECTION;
- flags |= RELOC_SECTION;
- break;
- case SHT_PROGBITS:
- flags |= LOADED_SECTION;
- case SHT_NOBITS:
- if (!(elffile->sections[i].sh_flags & SHF_ALLOC))
- continue;
- AdjustSize(i);
- break;
- default:
-#ifdef ELFDEBUG
- if (pass)
- ELFDEBUG("ELF: Not loading %s\n", name);
-#endif
- continue;
- }
-
- elffile->lsection = xf86loaderrealloc(elffile->lsection,
- (j + 1) * sizeof(LoadSection));
- if (!(flags & RELOC_SECTION)) {
- if (flags & LOADED_SECTION) {
- elffile->lsection[j].saddr /* sect. contains data */
- = ELFLoaderSectToMem(elffile, SecAlign(i),
- SecOffset(i), SecSize(i), name);
- } else {
- if (SecSize(i))
- elffile->lsection[j].saddr
- = ELFLoaderSectCalloc(elffile, SecAlign(i),
- SecSize(i));
- else
- elffile->lsection[j].saddr = NULL;
- }
- } else {
- elffile->lsection[j].saddr =
- (Elf_Sym *) _LoaderFileToMem(elffile->fd, SecOffset(i),
- SecSize(i), name);
- }
- elffile->saddr[i] = elffile->lsection[j].saddr;
-#ifdef ELFDEBUG
- ELFDEBUG("%s starts at %p size: %lx\n",
- name, elffile->saddr[i], (unsigned long)SecSize(i));
-#endif
- elffile->lsection[j].name = name;
- elffile->lsection[j].ndx = i;
- elffile->lsection[j].size = SecSize(i);
- elffile->lsection[j].flags = flags;
- switch (SecType(i)) {
-#ifdef __OpenBSD__
- case SHT_PROGBITS:
- mprotect(elffile->lsection[j].saddr, SecSize(i),
- PROT_READ | PROT_WRITE | PROT_EXEC);
- break;
-#endif
- case SHT_SYMTAB:
- elffile->symtab = (Elf_Sym *) elffile->saddr[i];
- elffile->symndx = i;
- break;
- case SHT_STRTAB:
- elffile->straddr = elffile->saddr[i];
- elffile->strsize = elffile->lsection[j].size;
- elffile->strndx = i;
- break;
- default:
- break;
- }
- elffile->lsectidx = ++j;
- }
-}
-
-/*
- * Public API for the ELF implementation of the loader.
- */
-void *
-ELFLoadModule(loaderPtr modrec, int elffd, LOOKUP **ppLookup)
-{
- ELFModulePtr elffile;
- Elf_Ehdr *header;
- ELFRelocPtr elf_reloc, tail;
- void *v;
- LDRModulePtr elfmod;
- int totalsize, maxalign, i;
- unsigned short *secttable;
- LOOKUP *pLookup;
-
- ldrCommons = 0;
- nCommons = 0;
-
-#ifdef ELFDEBUG
- ELFDEBUG("Loading %s %s\n", modrec->name, modrec->cname);
-#endif
- if ((elffile = xf86loadercalloc(1, sizeof(ELFModuleRec))) == NULL) {
- ErrorF("Unable to allocate ELFModuleRec\n");
- return NULL;
- }
-
- elffile->handle = modrec->handle;
- elffile->module = modrec->module;
- elffile->fd = elffd;
- v = elffile->funcs = modrec->funcs;
-
-/*
- * Get the ELF header
- */
- elffile->header =
- (Elf_Ehdr *) _LoaderFileToMem(elffd, 0, sizeof(Elf_Ehdr),
- "header");
- header = (Elf_Ehdr *) elffile->header;
-
-/*
- * Get the section table
- */
- elffile->numsh = header->e_shnum;
- elffile->secsize = (header->e_shentsize * header->e_shnum);
- elffile->sections =
- (Elf_Shdr *) _LoaderFileToMem(elffd, header->e_shoff,
- elffile->secsize, "sections");
-#if defined(__alpha__) || defined(__ia64__)
- /*
- * Need to allocate space for the .got section which will be
- * fabricated later
- */
- elffile->gotndx = header->e_shnum;
- header->e_shnum++;
-# if defined(__ia64__)
- elffile->pltndx = header->e_shnum;
- header->e_shnum++;
-# endif
- elffile->numsh = header->e_shnum;
- elffile->secsize = (header->e_shentsize * header->e_shnum);
- elffile->sections =
- xf86loaderrealloc(elffile->sections, elffile->secsize);
-#endif /*defined(__alpha__) || defined(__ia64__) */
- elffile->saddr =
- xf86loadercalloc(elffile->numsh, sizeof(unsigned char *));
-
-#if defined(__alpha__) || defined(__ia64__)
- /*
- * Manually fill in the entry for the .got section so ELFCollectSections()
- * will be able to find it.
- */
- elffile->sections[elffile->gotndx].sh_name =
- SecSize(header->e_shstrndx) + 1;
- elffile->sections[elffile->gotndx].sh_type = SHT_PROGBITS;
- elffile->sections[elffile->gotndx].sh_flags = SHF_WRITE | SHF_ALLOC;
- elffile->sections[elffile->gotndx].sh_size = 0;
- elffile->sections[elffile->gotndx].sh_addralign = 8;
- /* Add room to copy ".got", and maintain alignment */
- SecSize(header->e_shstrndx) += 8;
-#endif
-#if defined(__ia64__)
- /*
- * Manually fill in the entry for the .plt section so ELFCollectSections()
- * will be able to find it.
- */
- elffile->sections[elffile->pltndx].sh_name =
- SecSize(header->e_shstrndx) + 1;
- elffile->sections[elffile->pltndx].sh_type = SHT_PROGBITS;
- elffile->sections[elffile->pltndx].sh_flags = SHF_EXECINSTR | SHF_ALLOC;
- elffile->sections[elffile->pltndx].sh_size = 0;
- elffile->sections[elffile->pltndx].sh_addralign = 32;
- /* Add room to copy ".plt", and maintain alignment */
- SecSize(header->e_shstrndx) += 32;
-#endif
-
-/*
- * Get the section header string table
- */
- elffile->shstrsize = SecSize(header->e_shstrndx);
- elffile->shstraddr =
- _LoaderFileToMem(elffd, SecOffset(header->e_shstrndx),
- SecSize(header->e_shstrndx), ".shstrtab");
- elffile->shstrndx = header->e_shstrndx;
-#if defined(__alpha__) || defined(__ia64__)
- /*
- * Add the string for the .got section
- */
- strcpy((char *)(elffile->shstraddr +
- elffile->sections[elffile->gotndx].sh_name), ".got");
-#endif
-#if defined(__ia64__)
- /*
- * Add the string for the .plt section
- */
- strcpy((char *)(elffile->shstraddr +
- elffile->sections[elffile->pltndx].sh_name), ".plt");
-#endif
-
-/*
- * Load some desired sections, compute size of the remaining ones
- */
- totalsize = 0;
- maxalign = 0;
- ELFCollectSections(elffile, 0, &totalsize, &maxalign);
- if (elffile->straddr == NULL || elffile->strsize == 0) {
-#if 0
- ErrorF("No symbols found in this module\n");
-#endif
- ELFUnloadModule(elffile);
- return (void *)-1L;
- }
-/*
- * add symbols
- */
- *ppLookup = pLookup = ELF_GetSymbols(elffile, &secttable);
-
-/*
- * Do relocations
- */
- for (i = 0; i < elffile->lsectidx; i++) {
- switch (SecType(elffile->lsection[i].ndx)) {
- case SHT_REL:
- case SHT_RELA:
- break;
- default:
- continue;
- }
- elf_reloc = ELFCollectRelocations(elffile, elffile->lsection[i].ndx);
- if (elf_reloc) {
- for (tail = elf_reloc; tail->next; tail = tail->next) ;
- tail->next = _LoaderGetRelocations(v)->elf_reloc;
- _LoaderGetRelocations(v)->elf_reloc = elf_reloc;
- }
- }
-
-#if defined(__ia64__)
- totalsize += (elffile->sections[elffile->pltndx].sh_addralign - 1);
- totalsize &= ~(elffile->sections[elffile->pltndx].sh_addralign - 1);
- totalsize += elffile->pltsize;
- if (maxalign < elffile->sections[elffile->pltndx].sh_addralign)
- maxalign = elffile->sections[elffile->pltndx].sh_addralign;
-#endif
-
- /* Space for COMMON */
- totalsize = (totalsize + 7) & ~7;
- totalsize += ElfCOMMONSize();
-
-#ifdef MergeSectionAlloc
- elffile->basesize = totalsize + maxalign;
-
-# if !defined(DoMMAPedMerge)
- elffile->base = xf86loadermalloc(elffile->basesize);
- if (elffile->base == NULL) {
- ErrorF("Unable to allocate ELF sections\n");
- return NULL;
- }
-# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
- {
- unsigned long page_size = getpagesize();
- unsigned long round;
-
- round = (unsigned long)elffile->base & (page_size - 1);
- mprotect(elffile->base - round,
- (elffile->basesize + round + page_size - 1) & ~(page_size -
- 1),
- PROT_READ | PROT_WRITE | PROT_EXEC);
- }
-# endif
-# else
- MMAP_ALIGN(elffile->basesize);
- elffile->base = mmap(0, elffile->basesize, MMAP_PROT, MMAP_FLAGS, -1,
- (off_t) 0);
- if (elffile->base == NULL) {
- ErrorF("Unable to mmap ELF sections\n");
- return NULL;
- }
-# endif
- elffile->baseptr =
- ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
-#endif
-
-#if defined(__alpha__) || defined(__ia64__)
- if (!ELFCreateGOT(elffile, maxalign))
- return NULL;
-#endif
-#if defined(__ia64__)
- ELFCreatePLT(elffile);
-#endif
-
- ELFCollectSections(elffile, 1, NULL, NULL);
-
- for (i = 0; pLookup[i].symName; i++)
- if (secttable[i]) {
- pLookup[i].offset =
- (funcptr) ((long)pLookup[i].offset +
- (long)elffile->saddr[secttable[i]]);
-#ifdef ELFDEBUG
- ELFDEBUG("Finalizing symbol %p %s\n",
- (void *)pLookup[i].offset, pLookup[i].symName);
-#endif
- }
- xf86loaderfree(secttable);
-
-#if defined(__ia64__)
- ELFCreateOPD(elffile);
-#endif
-
- if (!ElfCreateCOMMON(elffile, *ppLookup))
- return NULL;
-
- /* Record info for gdb - if we can't allocate the loader record fail
- * silently (the user will find out soon enough that there's no VM left */
- if ((elfmod = xf86loadercalloc(1, sizeof(LDRModuleRec))) != NULL) {
- elfmod->name = strdup(modrec->name);
- elfmod->namelen = strlen(modrec->name);
- elfmod->version = 1;
- for (i = 0; i < elffile->lsectidx; i++) {
- char *name = elffile->lsection[i].name;
-
- if (!strcmp(name, ".text"))
- elfmod->text = elffile->lsection[i].saddr;
- else if (!strcmp(name, ".data"))
- elfmod->data = elffile->lsection[i].saddr;
- else if (!strcmp(name, ".rodata"))
- elfmod->rodata = elffile->lsection[i].saddr;
- else if (!strcmp(name, ".bss"))
- elfmod->bss = elffile->lsection[i].saddr;
- }
- elfmod->next = ModList;
- elfmod->commons = ldrCommons;
- elfmod->commonslen = nCommons;
-
- ModList = elfmod;
-
- /* Tell GDB something interesting happened */
- _loader_debug_state();
- }
- return (void *)elffile;
-}
-
-void
-ELFResolveSymbols(void *mod)
-{
- ELFRelocPtr newlist, p, tmp;
-
- /* Try to relocate everything. Build a new list containing entries
- * which we failed to relocate. Destroy the old list in the process.
- */
- newlist = 0;
- for (p = _LoaderGetRelocations(mod)->elf_reloc; p;) {
-#ifdef ELFDEBUG
- ELFDEBUG("ResolveSymbols: "
- "file %p, sec %d, r_offset 0x%x, r_info 0x%p\n",
- (void *)p->file, p->secn, p->rel->r_offset,
- (void *)p->rel->r_info);
-#endif
- tmp = Elf_RelocateEntry(p->file, p->secn, p->rel, FALSE);
- if (tmp) {
- /* Failed to relocate. Keep it in the list. */
- tmp->next = newlist;
- newlist = tmp;
- }
- tmp = p;
- p = p->next;
- xf86loaderfree(tmp);
- }
- _LoaderGetRelocations(mod)->elf_reloc = newlist;
-}
-
-int
-ELFCheckForUnresolved(void *mod)
-{
- ELFRelocPtr erel;
- char *name;
- int flag, fatalsym = 0;
-
- if ((erel = _LoaderGetRelocations(mod)->elf_reloc) == NULL)
- return 0;
-
- while (erel) {
- Elf_RelocateEntry(erel->file, erel->secn, erel->rel, TRUE);
- name = ElfGetSymbolName(erel->file, ELF_R_SYM(erel->rel->r_info));
- flag = _LoaderHandleUnresolved(name,
- _LoaderHandleToName(erel->file->
- handle));
- if (flag)
- fatalsym = 1;
- erel = erel->next;
- }
- return fatalsym;
-}
-
-void
-ELFUnloadModule(void *modptr)
-{
- ELFModulePtr elffile = (ELFModulePtr) modptr;
- ELFRelocPtr relptr, reltptr, *brelptr;
- int i;
-
-/*
- * Delete any unresolved relocations
- */
-
- relptr = _LoaderGetRelocations(elffile->funcs)->elf_reloc;
- brelptr = &(_LoaderGetRelocations(elffile->funcs)->elf_reloc);
-
- while (relptr) {
- if (relptr->file == elffile) {
- *brelptr = relptr->next; /* take it out of the list */
- reltptr = relptr; /* save pointer to this node */
- relptr = relptr->next; /* advance the pointer */
- xf86loaderfree(reltptr); /* free the node */
- } else {
- brelptr = &(relptr->next);
- relptr = relptr->next; /* advance the pointer */
- }
- }
-
-/*
- * Delete any symbols in the symbols table.
- */
-
- LoaderHashTraverse((void *)elffile, ELFhashCleanOut);
-
-/*
- * Free the sections that were allocated.
- */
-#if !defined (DoMMAPedMerge)
-# define CheckandFree(ptr,size) if(ptr) xf86loaderfree(ptr)
-#else
-# define CheckandFree(ptr,size) if (ptr) munmap(ptr,size)
-#endif
-#define CheckandFreeFile(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
-
-#ifdef MergeSectionAlloc
- CheckandFree(elffile->base, elffile->basesize);
-# if defined(__alpha__) || defined(__ia64__)
- if (elffile->shared_got) {
- elffile->shared_got->nuses--;
- if (!elffile->shared_got->nuses) {
- ELFGotPtr *pgot = &ELFSharedGOTs;
-
- while (*pgot && *pgot != elffile->shared_got)
- pgot = &(*pgot)->next;
- if (*pgot)
- *pgot = elffile->shared_got->next;
- xf86loaderfree(elffile->shared_got);
- }
- }
-# endif
-#else /*MergeSectionAlloc */
- CheckandFree(elffile->common, elffile->comsize);
-# if defined(__alpha__) || defined(__ia64__)
- CheckandFree(elffile->got, elffile->gotsize);
-# endif
-# if defined(__ia64__)
- CheckandFree(elffile->plt, elffile->pltsize);
-# endif
-#endif
-#if defined(__alpha__) || defined(__ia64__)
- {
- ELFGotEntryPtr gotent;
-
- while ((gotent = elffile->got_entries)) {
- elffile->got_entries = gotent->next;
- xf86loaderfree(gotent);
- }
- }
-#endif
-#if defined(__ia64__)
- {
- ELFPltEntryPtr pltent;
-
- while ((pltent = elffile->plt_entries)) {
- elffile->plt_entries = pltent->next;
- xf86loaderfree(pltent);
- }
- }
- {
- ELFOpdPtr opdent;
-
- while ((opdent = elffile->opd_entries)) {
- elffile->opd_entries = opdent->next;
- xf86loaderfree(opdent);
- }
- }
-#endif
-
- for (i = 0; i < elffile->lsectidx; i++) {
-#ifdef MergeSectionAlloc
- if (!(elffile->lsection[i].flags & RELOC_SECTION))
- continue;
-#endif
- if (elffile->lsection[i].flags & LOADED_SECTION) {
- CheckandFreeFile(elffile->lsection[i].saddr,
- elffile->lsection[i].size);
- } else {
- CheckandFree(elffile->lsection[i].saddr,
- elffile->lsection[i].size);
- }
- }
- xf86loaderfree(elffile->lsection);
-
-/*
- * Free the section table, section pointer array, and section names
- */
- _LoaderFreeFileMem(elffile->sections, elffile->secsize);
- xf86loaderfree(elffile->saddr);
- _LoaderFreeFileMem(elffile->header, sizeof(Elf_Ehdr));
- _LoaderFreeFileMem(elffile->shstraddr, elffile->shstrsize);
-
-/*
- * Free the ELFModuleRec
- */
- xf86loaderfree(elffile);
-
- return;
-}
-
-char *
-ELFAddressToSection(void *modptr, unsigned long address)
-{
- ELFModulePtr elffile = (ELFModulePtr) modptr;
- int i;
-
- for (i = 1; i < elffile->numsh; i++) {
- if (address >= (unsigned long)elffile->saddr[i] &&
- address <= (unsigned long)elffile->saddr[i] + SecSize(i)) {
- return ElfGetSectionName(elffile, elffile->sections[i].sh_name);
- }
- }
- return NULL;
-}
diff --git a/hw/xfree86/loader/elfloader.h b/hw/xfree86/loader/elfloader.h
deleted file mode 100644
index e4693411b..000000000
--- a/hw/xfree86/loader/elfloader.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright 1997,1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.4 2003/10/15 16:29:03 dawes Exp $ */
-
-#ifndef _ELFLOADER_H
-#define _ELFLOADER_H
-/* elfloader.c */
-extern void *ELFLoadModule(loaderPtr, int, LOOKUP **);
-extern void ELFResolveSymbols(void *);
-extern int ELFCheckForUnresolved(void *);
-extern char *ELFAddressToSection(void *, unsigned long);
-extern void ELFUnloadModule(void *);
-#endif /* _ELFLOADER_h */
diff --git a/hw/xfree86/loader/extsym.c b/hw/xfree86/loader/extsym.c
deleted file mode 100644
index 8da5089bc..000000000
--- a/hw/xfree86/loader/extsym.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.9 2003/10/15 16:29:03 dawes Exp $ */
-
-/*
- *
- * Copyright 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of The XFree86 Project, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The XFree86 Project, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include "resource.h"
-#include "sym.h"
-#include "misc.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#endif
-#include "sleepuntil.h"
-
-#ifdef HAS_SHM
-extern int ShmCompletionCode;
-extern int BadShmSegCode;
-extern RESTYPE ShmSegType, ShmPixType;
-#endif
-
-#ifdef PANORAMIX
-extern Bool noPanoramiXExtension;
-extern int PanoramiXNumScreens;
-extern PanoramiXData *panoramiXdataPtr;
-extern XID *PanoramiXVisualTable;
-extern unsigned long XRT_WINDOW;
-extern unsigned long XRT_PIXMAP;
-extern unsigned long XRT_GC;
-extern unsigned long XRT_COLORMAP;
-extern unsigned long XRC_DRAWABLE;
-extern Bool XineramaRegisterConnectionBlockCallback(void (*func) (void));
-extern int XineramaDeleteResource(pointer, XID);
-#endif
-
-LOOKUP extLookupTab[] = {
-
- SYMFUNC(ClientSleepUntil)
-
-#ifdef HAS_SHM
- SYMVAR(ShmCompletionCode)
- SYMVAR(BadShmSegCode)
- SYMVAR(ShmSegType)
-#endif
-
-#ifdef PANORAMIX
- SYMFUNC(XineramaRegisterConnectionBlockCallback)
- SYMFUNC(XineramaDeleteResource)
- SYMVAR(noPanoramiXExtension)
- SYMVAR(PanoramiXNumScreens)
- SYMVAR(panoramiXdataPtr)
- SYMVAR(PanoramiXVisualTable)
- SYMVAR(XRT_WINDOW)
- SYMVAR(XRT_PIXMAP)
- SYMVAR(XRT_GC)
- SYMVAR(XRT_COLORMAP)
- SYMVAR(XRC_DRAWABLE)
-#endif
-
- {0, 0}
-};
diff --git a/hw/xfree86/loader/fontsym.c b/hw/xfree86/loader/fontsym.c
deleted file mode 100644
index d91a2e216..000000000
--- a/hw/xfree86/loader/fontsym.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.13 2003/10/15 16:29:04 dawes Exp $ */
-/*
- * Copyright (c) 1998-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "font.h"
-#include "sym.h"
-#include "fntfilst.h"
-#include "fontenc.h"
-#ifdef FONTENC_COMPATIBILITY
-#include "fontencc.h"
-#endif
-#include "fntfilio.h"
-#include "fntfil.h"
-#include "fontutil.h"
-#include "fontxlfd.h"
-#define _FONTCACHE_SERVER_
-#include "fontcache.h"
-
-LOOKUP fontLookupTab[] = {
-
- SYMFUNC(TwoByteSwap)
- SYMFUNC(FourByteSwap)
- SYMFUNC(FontCouldBeTerminal)
- SYMFUNC(BufFileRead)
- SYMFUNC(BufFileWrite)
- SYMFUNC(CheckFSFormat)
- SYMFUNC(FontFileOpen)
- SYMFUNC(FontFilePriorityRegisterRenderer)
- SYMFUNC(FontFileRegisterRenderer)
- SYMFUNC(FontParseXLFDName)
- SYMFUNC(FontFileCloseFont)
- SYMFUNC(FontFileOpenBitmap)
- SYMFUNC(FontFileCompleteXLFD)
- SYMFUNC(FontFileCountDashes)
- SYMFUNC(FontFileFindNameInDir)
- SYMFUNC(FontFileClose)
- SYMFUNC(FontComputeInfoAccelerators)
- SYMFUNC(FontDefaultFormat)
- SYMFUNC(NameForAtom)
- SYMFUNC(BitOrderInvert)
- SYMFUNC(FontFileMatchRenderer)
- SYMFUNC(RepadBitmap)
- SYMFUNC(FontEncName)
- SYMFUNC(FontEncRecode)
- SYMFUNC(FontEncFind)
- SYMFUNC(FontMapFind)
- SYMFUNC(FontEncMapFind)
- SYMFUNC(FontEncFromXLFD)
- SYMFUNC(FontEncDirectory)
- SYMFUNC(FontMapReverse)
- SYMFUNC(FontMapReverseFree)
- SYMFUNC(CreateFontRec)
- SYMFUNC(DestroyFontRec)
- SYMFUNC(GetGlyphs)
- SYMFUNC(QueryGlyphExtents)
-
- SYMVAR(FontFileBitmapSources)
-
-#ifdef FONTENC_COMPATIBILITY
- /* Obsolete backwards compatibility symbols -- fontencc.c */
- SYMFUNC(font_encoding_from_xlfd)
- SYMFUNC(font_encoding_find)
- SYMFUNC(font_encoding_recode)
- SYMFUNC(font_encoding_name)
- SYMFUNC(identifyEncodingFile)
-#endif
-
- /* fontcache.c */
- SYMFUNC(FontCacheGetSettings)
- SYMFUNC(FontCacheGetStatistics)
- SYMFUNC(FontCacheChangeSettings)
- SYMFUNC(FontCacheOpenCache)
- SYMFUNC(FontCacheCloseCache)
- SYMFUNC(FontCacheSearchEntry)
- SYMFUNC(FontCacheGetEntry)
- SYMFUNC(FontCacheInsertEntry)
- SYMFUNC(FontCacheGetBitmap)
-
- {0, 0}
-};
diff --git a/hw/xfree86/loader/hash.c b/hw/xfree86/loader/hash.c
deleted file mode 100644
index f8ddd45a4..000000000
--- a/hw/xfree86/loader/hash.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.24 2003/11/17 22:20:40 dawes Exp $ */
-
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "os.h"
-#include "Xos.h"
-#undef abs
-#include <stdlib.h>
-#include "sym.h"
-#include "loader.h"
-#include "hash.h"
-
-#if defined(Lynx)
-#define MAXINT 32000
-#else
-#include <limits.h>
-#undef MAXINT
-#define MAXINT INT_MAX
-#endif
-
-/* Prototypes for static functions. */
-static unsigned int hashFunc(const char *);
-static itemPtr LoaderHashFindNearest(
- unsigned long
- );
-
-static itemPtr LoaderhashTable[HASHSIZE];
-
-#ifdef DEBUG
-static int hashhits[HASHSIZE];
-
-void
-DumpHashHits(void)
-{
- int i;
- int depth = 0;
- int dev = 0;
-
- for (i = 0; i < HASHSIZE; i++) {
- ErrorF("hashhits[%d]=%d\n", i, hashhits[i]);
- depth += hashhits[i];
- }
-
- depth /= HASHSIZE;
- ErrorF("Average hash depth=%d\n", depth);
-
- for (i = 0; i < HASHSIZE; i++) {
- if (hashhits[i] < depth)
- dev += depth - hashhits[i];
- else
- dev += hashhits[i] - depth;
- }
-
- dev /= HASHSIZE;
- ErrorF("Average hash deviation=%d\n", dev);
-}
-#endif
-
-static unsigned int
-hashFunc(const char *string)
-{
- int i = 0;
-
- while (i < 10 && string[i])
- i++;
-
- if (i < 5) {
-#ifdef DEBUG
- hashhits[i]++;
-#endif
- return i;
- }
-
-/*
- * Original has function
-#define HASH ((string[ i-4 ] * string[i-3] + string[i-2] ) & (HASHSIZE-1))
- */
-
-#define HASH ((string[i-5] * string[ i-4 ] + string[i-3] * string[i-2] ) & (HASHSIZE-1))
-
-#ifdef DEBUG
- hashhits[HASH]++;
-#endif
-
- return HASH;
-}
-
-void
-LoaderHashAdd(itemPtr entry)
-{
- int bucket = hashFunc(entry->name);
- itemPtr oentry;
-
- if ((oentry = LoaderHashFind(entry->name)) != NULL)
- LoaderDuplicateSymbol(entry->name, oentry->handle);
-
- entry->next = LoaderhashTable[bucket];
- LoaderhashTable[bucket] = entry;
- return;
-}
-
-void
-LoaderAddSymbols(int handle, int module, LOOKUP *list)
-{
- LOOKUP *l = list, *exports = NULL;
- itemPtr i, exportsItem = NULL;
- char *modname;
-
- if (!list)
- return;
-
- /*
- * First look for a symbol called <name>ExportedSymbols. If it exists,
- * only export the symbols that are listed in that array. Otherwise
- * export all of the external symbols.
- */
- modname = _LoaderHandleToCanonicalName(handle);
- if (modname) {
- char *exportname;
-
- exportname = xf86loadermalloc(strlen("ExportedSymbols") +
- strlen(modname) + 1);
- if (exportname) {
- sprintf(exportname, "%sExportedSymbols", modname);
- while (l->symName) {
- if (strcmp(l->symName, exportname) == 0) {
- exports = l;
- ErrorF("LoaderAddSymbols: %s: %s found\n", modname,
- exportname);
- break;
- }
- l++;
- }
- xf86loaderfree(exportname);
- }
- }
-
- /*
- * Allocate the exports list item first.
- */
- if (exports) {
- exportsItem = xf86loadermalloc(sizeof(itemRec));
- exportsItem->name = exports->symName;
- exportsItem->address = (char *)exports->offset;
- exportsItem->handle = handle;
- exportsItem->module = module;
- exportsItem->exports = NULL;
- LoaderHashAdd(exportsItem);
- }
-
- /*
- * Visit every symbol in the lookup table, tagging it with the
- * reference to the export list, if present.
- */
- l = list;
- while (l->symName) {
- if (l != exports) {
- i = xf86loadermalloc(sizeof(itemRec));
- i->name = l->symName;
- i->address = (char *)l->offset;
- i->handle = handle;
- i->module = module;
- i->exports = exportsItem;
- LoaderHashAdd(i);
- }
- l++;
- }
-}
-
-itemPtr
-LoaderHashDelete(const char *string)
-{
- int bucket = hashFunc(string);
- itemPtr entry;
- itemPtr *entry2;
-
- entry = LoaderhashTable[bucket];
- entry2 = &(LoaderhashTable[bucket]);
- while (entry) {
- if (!strcmp(entry->name, string)) {
- *entry2 = entry->next;
- xf86loaderfree(entry->name);
- xf86loaderfree(entry);
- return 0;
- }
- entry2 = &(entry->next);
- entry = entry->next;
- }
- return 0;
-}
-
-itemPtr
-LoaderHashFind(const char *string)
-{
- int bucket = hashFunc(string);
- itemPtr entry;
-
- entry = LoaderhashTable[bucket];
- while (entry) {
- if (!strcmp(entry->name, string)) {
- return entry;
- }
- entry = entry->next;
- }
- return 0;
-}
-
-static itemPtr
-LoaderHashFindNearest(unsigned long address)
-{
- int i;
- itemPtr entry, best_entry = 0;
- long best_difference = MAXINT;
-
- for (i = 0; i < HASHSIZE; i++) {
- entry = LoaderhashTable[i];
- while (entry) {
- long difference = (long)address - (long)entry->address;
-
- if (difference >= 0) {
- if (best_entry) {
- if (difference < best_difference) {
- best_entry = entry;
- best_difference = difference;
- }
- } else {
- best_entry = entry;
- best_difference = difference;
- }
- }
- entry = entry->next;
- }
- }
- return best_entry;
-}
-
-void
-LoaderPrintSymbol(unsigned long address)
-{
- itemPtr entry;
-
- entry = LoaderHashFindNearest(address);
- if (entry) {
- const char *module, *section;
-
-#if defined(__alpha__) || defined(__ia64__)
- ErrorF("0x%016lx %s+%lx\n", (unsigned long)entry->address,
- entry->name, address - (unsigned long)entry->address);
-#else
- ErrorF("0x%lx %s+%lx\n", (unsigned long)entry->address, entry->name,
- address - (unsigned long)entry->address);
-#endif
-
- if (_LoaderAddressToSection(address, &module, &section))
- ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n", module, section);
- } else {
- ErrorF("(null)\n");
- }
-}
-
-void
-LoaderPrintItem(itemPtr pItem)
-{
- if (pItem) {
- const char *module, *section;
-
-#if defined(__alpha__) || defined(__ia64__)
- ErrorF("0x%016lx %s\n", (unsigned long)pItem->address, pItem->name);
-#else
- ErrorF("0x%lx %s\n", (unsigned long)pItem->address, pItem->name);
-#endif
- if (_LoaderAddressToSection((unsigned long)pItem->address,
- &module, &section))
- ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n", module, section);
- } else
- ErrorF("(null)\n");
-}
-
-void
-LoaderPrintAddress(const char *symbol)
-{
- itemPtr entry;
-
- entry = LoaderHashFind(symbol);
- LoaderPrintItem(entry);
-}
-
-void
-LoaderHashTraverse(void *card, int (*fnp)(void *, itemPtr))
-{
- int i;
- itemPtr entry, last_entry = 0;
-
- for (i = 0; i < HASHSIZE; i++) {
- last_entry = 0;
- entry = LoaderhashTable[i];
- while (entry) {
- if ((*fnp) (card, entry)) {
- if (last_entry) {
- last_entry->next = entry->next;
- xf86loaderfree(entry->name);
- xf86loaderfree(entry);
- entry = last_entry->next;
- } else {
- LoaderhashTable[i] = entry->next;
- xf86loaderfree(entry->name);
- xf86loaderfree(entry);
- entry = LoaderhashTable[i];
- }
- } else {
- last_entry = entry;
- entry = entry->next;
- }
- }
- }
-}
-
-void
-LoaderDumpSymbols()
-{
- itemPtr entry;
- int j;
-
- for (j = 0; j < HASHSIZE; j++) {
- entry = LoaderhashTable[j];
- while (entry) {
- LoaderPrintItem(entry);
- entry = entry->next;
- }
- }
-
-}
diff --git a/hw/xfree86/loader/hash.h b/hw/xfree86/loader/hash.h
deleted file mode 100644
index 96cd41c02..000000000
--- a/hw/xfree86/loader/hash.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.h,v 1.3 1998/07/25 16:56:16 dawes Exp $ */
-
-#ifndef _HASH_H
-#define _HASH_H
-
-#include "loader.h"
-
-typedef struct _HashIterator {
- itemPtr pItem;
- int bucket;
-} HashIteratorRec, *HashIteratorPtr;
-
-#endif /* _HASH_H */
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
deleted file mode 100644
index 39ba510a1..000000000
--- a/hw/xfree86/loader/loader.c
+++ /dev/null
@@ -1,1461 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.71 2003/11/06 18:38:13 tsi Exp $ */
-
-/*
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#if defined(UseMMAP) || (defined(linux) && defined(__ia64__))
-#include <sys/mman.h>
-#endif
-#include <unistd.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#if defined(linux) && \
- (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
- || defined(__AMD64__))
-#include <malloc.h>
-#endif
-#include <stdarg.h>
-#include "ar.h"
-#include "elf.h"
-#include "coff.h"
-
-#include "os.h"
-#include "sym.h"
-#include "loader.h"
-#include "loaderProcs.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include "compiler.h"
-
-extern LOOKUP miLookupTab[];
-extern LOOKUP xfree86LookupTab[];
-extern LOOKUP dixLookupTab[];
-extern LOOKUP fontLookupTab[];
-extern LOOKUP extLookupTab[];
-
-/*
-#define DEBUG
-#define DEBUGAR
-#define DEBUGLIST
-#define DEBUGMEM
-*/
-
-int check_unresolved_sema = 0;
-
-#if defined(Lynx) && defined(sun)
-/* Cross build machine doesn;t have strerror() */
-#define strerror(err) "strerror unsupported"
-#endif
-
-#ifdef __UNIXOS2__
-void *os2ldcalloc(size_t, size_t);
-#endif
-
-#ifdef HANDLE_IN_HASH_ENTRY
-/*
- * handles are used to identify files that are loaded. Even archives
- * are counted as a single file.
- */
-#define MAX_HANDLE 256
-#define HANDLE_FREE 0
-#define HANDLE_USED 1
-static char freeHandles[MAX_HANDLE];
-static int refCount[MAX_HANDLE];
-#endif
-
-#if defined(__sparc__) && defined(__GNUC__) && !defined(__FreeBSD__)
-# define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
-# if !defined(__OpenBSD__)
-# define SYMFUNCDOT89(func) { "." #func, (funcptr)&func ## _sparcv89 },
-# define DEFFUNCDOT(func) \
-extern void __sparc_dot_ ## func (void) __asm__ ("." #func); \
-extern void func ## _sparcv89 (void);
-# else
-# define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
-# define DEFFUNCDOT(func) \
-extern void __sparc_dot_ ## func (void) __asm__ ("." #func);
-#endif
-DEFFUNCDOT(rem)
-DEFFUNCDOT(urem)
-DEFFUNCDOT(mul)
-DEFFUNCDOT(umul)
-DEFFUNCDOT(div)
-DEFFUNCDOT(udiv)
-#ifdef linux
-static LOOKUP SparcV89LookupTab[] = {
- SYMFUNCDOT89(rem)
- SYMFUNCDOT89(urem)
- SYMFUNCDOT89(mul)
- SYMFUNCDOT89(umul)
- SYMFUNCDOT89(div)
- SYMFUNCDOT89(udiv)
- {0, 0}
-};
-#endif
-static LOOKUP SparcLookupTab[] = {
- SYMFUNCDOT(rem)
- SYMFUNCDOT(urem)
- SYMFUNCDOT(mul)
- SYMFUNCDOT(umul)
- SYMFUNCDOT(div)
- SYMFUNCDOT(udiv)
- {0, 0}
-};
-
-#ifdef linux
-#if defined(__GNUC__) && defined(__GLIBC__)
-#define HWCAP_SPARC_MULDIV 8
-extern unsigned long int _dl_hwcap;
-#endif
-
-static int
-sparcUseHWMulDiv(void)
-{
- FILE *f;
- char buffer[1024];
- char *p;
-
-#if defined(__GNUC__) && defined(__GLIBC__)
- unsigned long *hwcap;
-
- __asm(".weak _dl_hwcap");
-
- hwcap = &_dl_hwcap;
- __asm("": "=r"(hwcap):"0"(hwcap));
- if (hwcap) {
- if (*hwcap & HWCAP_SPARC_MULDIV)
- return 1;
- else
- return 0;
- }
-#endif
- f = fopen("/proc/cpuinfo", "r");
- if (!f)
- return 0;
- while (fgets(buffer, 1024, f) != NULL) {
- if (!strncmp(buffer, "type", 4)) {
- p = strstr(buffer, "sun4");
- if (p && (p[4] == 'u' || p[4] == 'd' || p[4] == 'm')) {
- fclose(f);
- return 1;
- }
- }
- }
- fclose(f);
- return 0;
-}
-#endif
-#endif
-
-/*
- * modules are used to identify compilation units (ie object modules).
- * Archives contain multiple modules, each of which is treated seperately.
- */
-static int moduleseq = 0;
-
-/*
- * GDB Interface
- * =============
- *
- * Linked list of loaded modules - gdb will traverse this to determine
- * whether it needs to add the symbols for the loaded module.
- */
-LDRModulePtr ModList = 0;
-
-/* Flag which gdb sets to let us know we're being debugged */
-char DebuggerPresent = 0;
-
-/* List of common symbols */
-LDRCommonPtr ldrCommons;
-int nCommons;
-
-typedef struct {
- int num;
- const char **list;
-} symlist;
-
-/*
- * List of symbols that may be referenced, and which are allowed to be
- * unresolved providing that they don't appear on the "reqired" list.
- */
-static symlist refList = { 0, NULL };
-
-/* List of symbols that must not be unresolved */
-static symlist reqList = { 0, NULL };
-
-static int fatalReqSym = 0;
-
-/* Prototypes for static functions. */
-static int _GetModuleType(int, long);
-static loaderPtr _LoaderListPush(void);
-static loaderPtr _LoaderListPop(int);
- /*ARGSUSED*/ static void
-ARCHIVEResolveSymbols(void *unused)
-{
-}
- /*ARGSUSED*/ static int
-ARCHIVECheckForUnresolved(void *v)
-{
- return 0;
-}
- /*ARGSUSED*/ static char *
-ARCHIVEAddressToSection(void *modptr, unsigned long address)
-{
- return NULL;
-}
- /*ARGSUSED*/ static void
-ARCHIVEUnload(void *unused2)
-{
-}
-
-/*
- * Array containing entry points for different formats.
- */
-
-static loader_funcs funcs[] = {
- /* LD_ARCHIVE */
- {ARCHIVELoadModule,
- ARCHIVEResolveSymbols,
- ARCHIVECheckForUnresolved,
- ARCHIVEAddressToSection,
- ARCHIVEUnload, {0, 0, 0, 0, 0}},
- /* LD_ELFOBJECT */
- {ELFLoadModule,
- ELFResolveSymbols,
- ELFCheckForUnresolved,
- ELFAddressToSection,
- ELFUnloadModule, {0, 0, 0, 0, 0}},
- /* LD_COFFOBJECT */
- {COFFLoadModule,
- COFFResolveSymbols,
- COFFCheckForUnresolved,
- COFFAddressToSection,
- COFFUnloadModule, {0, 0, 0, 0, 0}},
- /* LD_XCOFFOBJECT */
- {COFFLoadModule,
- COFFResolveSymbols,
- COFFCheckForUnresolved,
- COFFAddressToSection,
- COFFUnloadModule, {0, 0, 0, 0, 0}},
- /* LD_AOUTOBJECT */
- {AOUTLoadModule,
- AOUTResolveSymbols,
- AOUTCheckForUnresolved,
- AOUTAddressToSection,
- AOUTUnloadModule, {0, 0, 0, 0, 0}},
- /* LD_AOUTDLOBJECT */
-#ifdef DLOPEN_SUPPORT
- {DLLoadModule,
- DLResolveSymbols,
- DLCheckForUnresolved,
- ARCHIVEAddressToSection,
- DLUnloadModule, {0, 0, 0, 0, 0}},
-#else
- {AOUTLoadModule,
- AOUTResolveSymbols,
- AOUTCheckForUnresolved,
- AOUTAddressToSection,
- AOUTUnloadModule, {0, 0, 0, 0, 0}},
-#endif
- /* LD_ELFDLOBJECT */
-#ifdef DLOPEN_SUPPORT
- {DLLoadModule,
- DLResolveSymbols,
- DLCheckForUnresolved,
- ARCHIVEAddressToSection,
- DLUnloadModule, {0, 0, 0, 0, 0}},
-#else
- {ELFLoadModule,
- ELFResolveSymbols,
- ELFCheckForUnresolved,
- ELFAddressToSection,
- ELFUnloadModule, {0, 0, 0, 0, 0}},
-#endif
-};
-
-int numloaders = sizeof(funcs) / sizeof(loader_funcs);
-
-void
-LoaderInit(void)
-{
- const char *osname = NULL;
-
- LoaderAddSymbols(-1, -1, miLookupTab);
- LoaderAddSymbols(-1, -1, xfree86LookupTab);
- LoaderAddSymbols(-1, -1, dixLookupTab);
- LoaderAddSymbols(-1, -1, fontLookupTab);
- LoaderAddSymbols(-1, -1, extLookupTab);
-#if defined(__sparc__) && !defined(__FreeBSD__)
-#ifdef linux
- if (sparcUseHWMulDiv())
- LoaderAddSymbols(-1, -1, SparcV89LookupTab);
- else
-#endif
- LoaderAddSymbols(-1, -1, SparcLookupTab);
-#endif
-
- xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n");
- xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
- GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
- GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
- xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
- GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
- GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
- xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
- GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
- GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
- xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
- GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
- GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
- xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_FONT,
- GET_ABI_MAJOR(LoaderVersionInfo.fontVersion),
- GET_ABI_MINOR(LoaderVersionInfo.fontVersion));
-
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (osname)
- xf86MsgVerb(X_INFO, 2, "Loader running on %s\n", osname);
-
-#if defined(linux) && \
- (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
- || ( defined __AMD64__ && ! defined UseMMAP && ! defined DoMMAPedMerge))
- /*
- * The glibc malloc uses mmap for large allocations anyway. This breaks
- * some relocation types because the offset overflow. See loader.h for more
- * details. We need to turn off this behavior here.
- */
- mallopt(M_MMAP_MAX, 0);
-#endif
-}
-
-/*
- * Determine what type of object is being loaded.
- * This function is responsible for restoring the offset.
- * The fd and offset are used here so that when Archive processing
- * is enabled, individual elements of an archive can be evaluated
- * so the correct loader_funcs can be determined.
- */
-static int
-_GetModuleType(int fd, long offset)
-{
- unsigned char buf[256]; /* long enough for the largest magic type */
-
- if (read(fd, buf, sizeof(buf)) < 0) {
- return -1;
- }
-#ifdef DEBUG
- ErrorF("Checking module type %10s\n", buf);
- ErrorF("Checking module type %x %x %x %x\n", buf[0], buf[1], buf[2],
- buf[3]);
-#endif
-
- lseek(fd, offset, SEEK_SET);
-
- if (strncmp((char *)buf, ARMAG, SARMAG) == 0) {
- return LD_ARCHIVE;
- }
-#if defined(AIAMAG)
- /* LynxOS PPC style archives */
- if (strncmp((char *)buf, AIAMAG, SAIAMAG) == 0) {
- return LD_ARCHIVE;
- }
-#endif
-
- if (strncmp((char *)buf, ELFMAG, SELFMAG) == 0) {
- if (*((Elf32_Half *) (buf + ELFDLOFF)) == ELFDLMAG) {
- return LD_ELFDLOBJECT;
- } else {
- return LD_ELFOBJECT;
- }
- }
-
- if (buf[0] == 0x4c && buf[1] == 0x01) {
- /* I386MAGIC */
- return LD_COFFOBJECT;
- }
- if (buf[0] == 0x01 && buf[1] == 0xdf) {
- /* XCOFFMAGIC */
- return LD_COFFOBJECT;
- }
- if (buf[0] == 0x0d && buf[1] == 0x01) {
- /* ZCOFFMAGIC (LynxOS) */
- return LD_COFFOBJECT;
- }
- if (buf[0] == 0x00 && buf[1] == 0x86 && buf[2] == 0x01 && buf[3] == 0x07) {
- /* AOUTMAGIC */
- return LD_AOUTOBJECT;
- }
- if (buf[0] == 0x07 && buf[1] == 0x01
- && (buf[2] == 0x64 || buf[2] == 0x86)) {
- /* AOUTMAGIC, (Linux OMAGIC, old impure format, also used by OS/2 */
- return LD_AOUTOBJECT;
- }
- if (buf[0] == 0x07 && buf[1] == 0x01 && buf[2] == 0x00 && buf[3] == 0x00) {
- /* AOUTMAGIC, BSDI */
- return LD_AOUTOBJECT;
- }
- if ((buf[0] == 0xc0 && buf[1] == 0x86) || /* big endian form */
- (buf[3] == 0xc0 && buf[2] == 0x86)) { /* little endian form */
- /* i386 shared object */
- return LD_AOUTDLOBJECT;
- }
-
- return LD_UNKNOWN;
-}
-
-static int offsetbias = 0; /* offset into archive */
-
-/*
- * _LoaderFileToMem() loads the contents of a file into memory using
- * the most efficient method for a platform.
- */
-void *
-_LoaderFileToMem(int fd, unsigned long offset, int size, char *label)
-{
-#ifdef UseMMAP
- unsigned long ret;
-
-# ifdef MmapPageAlign
- unsigned long pagesize;
- unsigned long new_size;
- unsigned long new_off;
- unsigned long new_off_bias;
-# endif
-# define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC)
-
-# ifdef DEBUGMEM
- ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size,
- label);
-# endif
-# ifdef MmapPageAlign
- pagesize = getpagesize();
- new_size = (size + pagesize - 1) / pagesize;
- new_size *= pagesize;
- new_off = (offset + offsetbias) / pagesize;
- new_off *= pagesize;
- new_off_bias = (offset + offsetbias) - new_off;
- if ((new_off_bias + size) > new_size)
- new_size += pagesize;
- ret = (unsigned long)mmap(0, new_size, MMAP_PROT, MAP_PRIVATE
-# ifdef __AMD64__
- | MAP_32BIT
-# endif
- , fd, new_off);
- if (ret == -1)
- FatalError("mmap() failed: %s\n", strerror(errno));
- return (void *)(ret + new_off_bias);
-# else
- ret = (unsigned long)mmap(0, size, MMAP_PROT, MAP_PRIVATE
-# ifdef __AMD64__
- | MAP_32BIT
-# endif
- , fd, offset + offsetbias);
- if (ret == -1)
- FatalError("mmap() failed: %s\n", strerror(errno));
- return (void *)ret;
-# endif
-#else
- char *ptr;
-
-# ifdef DEBUGMEM
- ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size,
- label);
-# endif
-
- if (size == 0) {
-# ifdef DEBUGMEM
- ErrorF("=NULL\n", ptr);
-# endif
- return NULL;
- }
-# ifndef __UNIXOS2__
- if ((ptr = xf86loadercalloc(size, 1)) == NULL)
- FatalError("_LoaderFileToMem() malloc failed\n");
-# else
- if ((ptr = os2ldcalloc(size, 1)) == NULL)
- FatalError("_LoaderFileToMem() malloc failed\n");
-# endif
-# if defined(linux) && defined(__ia64__)
- {
- unsigned long page_size = getpagesize();
- unsigned long round;
-
- round = (unsigned long)ptr & (page_size - 1);
- mprotect(ptr - round,
- (size + round + page_size - 1) & ~(page_size - 1),
- PROT_READ | PROT_WRITE | PROT_EXEC);
- }
-# endif
-
- if (lseek(fd, offset + offsetbias, SEEK_SET) < 0)
- FatalError("\n_LoaderFileToMem() lseek() failed: %s\n",
- strerror(errno));
-
- if (read(fd, ptr, size) != size)
- FatalError("\n_LoaderFileToMem() read() failed: %s\n",
- strerror(errno));
-
-# if (defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__)) \
- && defined(__powerpc__)
- /*
- * Keep the instruction cache in sync with changes in the
- * main memory.
- */
- {
- int i;
-
- for (i = 0; i < size; i += 16)
- ppc_flush_icache(ptr + i);
- ppc_flush_icache(ptr + size - 1);
- }
-# endif
-
-# ifdef DEBUGMEM
- ErrorF("=%lx\n", ptr);
-# endif
-
- return (void *)ptr;
-#endif
-}
-
-/*
- * _LoaderFreeFileMem() free the memory in which a file was loaded.
- */
-void
-_LoaderFreeFileMem(void *addr, int size)
-{
-#if defined (UseMMAP) && defined (MmapPageAlign)
- unsigned long pagesize = getpagesize();
- memType i_addr = (memType) addr;
- unsigned long new_size;
-#endif
-#ifdef DEBUGMEM
- ErrorF("_LoaderFreeFileMem(%x,%d)\n", addr, size);
-#endif
-#ifdef UseMMAP
-# if defined (MmapPageAlign)
- i_addr /= pagesize;
- i_addr *= pagesize;
- new_size = (size + pagesize - 1) / pagesize;
- new_size *= pagesize;
- if (((memType) addr - i_addr + size) > new_size)
- new_size += pagesize;
- munmap((void *)i_addr, new_size);
-# else
- munmap((void *)addr, size);
-# endif
-#else
- if (size == 0)
- return;
-
- xf86loaderfree(addr);
-#endif
-
- return;
-}
-
-int
-_LoaderFileRead(int fd, unsigned int offset, void *buf, int size)
-{
- if (lseek(fd, offset + offsetbias, SEEK_SET) < 0)
- FatalError("_LoaderFileRead() lseek() failed: %s\n", strerror(errno));
-
- if (read(fd, buf, size) != size)
- FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno));
-
- return size;
-}
-
-static loaderPtr listHead = (loaderPtr) 0;
-
-static loaderPtr
-_LoaderListPush()
-{
- loaderPtr item = xf86loadercalloc(1, sizeof(struct _loader));
-
- item->next = listHead;
- listHead = item;
-
- return item;
-}
-
-static loaderPtr
-_LoaderListPop(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr *bptr = &listHead; /* pointer to previous node */
-
- while (item) {
- if (item->handle == handle) {
- *bptr = item->next; /* remove this from the list */
- return item;
- }
- bptr = &(item->next);
- item = item->next;
- }
-
- return 0;
-}
-
-/*
- * _LoaderHandleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
-/*
- * _LoaderHandleToCanonicalName() will return the cname of the first module
- * with a given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToCanonicalName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- lastitem = item;
- }
- item = item->next;
- }
-
- if (lastitem)
- return lastitem->cname;
-
- return NULL;
-}
-
-/*
- * _LoaderModuleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderModuleToName(int module)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (module < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->module == module) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
-/*
- * _LoaderAddressToSection() will return the name of the file & section
- * that contains the given address.
- */
-int
-_LoaderAddressToSection(const unsigned long address, const char **module,
- const char **section)
-{
- loaderPtr item = listHead;
-
- while (item) {
- if ((*section =
- item->funcs->AddressToSection(item->private, address)) != NULL) {
- *module = _LoaderModuleToName(item->module);
- return 1;
- }
- item = item->next;
- }
-
- return 0;
-}
-
-/*
- * Add a list of symbols to the referenced list.
- */
-
-static void
-AppendSymbol(symlist * list, const char *sym)
-{
- list->list = xnfrealloc(list->list, (list->num + 1) * sizeof(char **));
- list->list[list->num] = sym;
- list->num++;
-}
-
-static void
-AppendSymList(symlist * list, const char **syms)
-{
- while (*syms) {
- AppendSymbol(list, *syms);
- syms++;
- }
-}
-
-static int
-SymInList(symlist * list, char *sym)
-{
- int i;
-
- for (i = 0; i < list->num; i++)
- if (strcmp(list->list[i], sym) == 0)
- return 1;
-
- return 0;
-}
-
-void
-LoaderVRefSymbols(const char *sym0, va_list args)
-{
- const char *s;
-
- if (sym0 == NULL)
- return;
-
- s = sym0;
- do {
- AppendSymbol(&refList, s);
- s = va_arg(args, const char *);
- } while (s != NULL);
-}
-
-void
-LoaderRefSymbols(const char *sym0, ...)
-{
- va_list ap;
-
- va_start(ap, sym0);
- LoaderVRefSymbols(sym0, ap);
- va_end(ap);
-}
-
-void
-LoaderVRefSymLists(const char **list0, va_list args)
-{
- const char **l;
-
- if (list0 == NULL)
- return;
-
- l = list0;
- do {
- AppendSymList(&refList, l);
- l = va_arg(args, const char **);
- } while (l != NULL);
-}
-
-void
-LoaderRefSymLists(const char **list0, ...)
-{
- va_list ap;
-
- va_start(ap, list0);
- LoaderVRefSymLists(list0, ap);
- va_end(ap);
-}
-
-void
-LoaderVReqSymLists(const char **list0, va_list args)
-{
- const char **l;
-
- if (list0 == NULL)
- return;
-
- l = list0;
- do {
- AppendSymList(&reqList, l);
- l = va_arg(args, const char **);
- } while (l != NULL);
-}
-
-void
-LoaderReqSymLists(const char **list0, ...)
-{
- va_list ap;
-
- va_start(ap, list0);
- LoaderVReqSymLists(list0, ap);
- va_end(ap);
-}
-
-void
-LoaderVReqSymbols(const char *sym0, va_list args)
-{
- const char *s;
-
- if (sym0 == NULL)
- return;
-
- s = sym0;
- do {
- AppendSymbol(&reqList, s);
- s = va_arg(args, const char *);
- } while (s != NULL);
-}
-
-void
-LoaderReqSymbols(const char *sym0, ...)
-{
- va_list ap;
-
- va_start(ap, sym0);
- LoaderVReqSymbols(sym0, ap);
- va_end(ap);
-}
-
-/*
- * _LoaderHandleUnresolved() decides what to do with an unresolved
- * symbol. Symbols that are not on the "referenced" or "required" lists
- * get a warning if they are unresolved. Symbols that are on the "required"
- * list generate a fatal error if they are unresolved.
- */
-
-int
-_LoaderHandleUnresolved(char *symbol, char *module)
-{
- int fatalsym = 0;
-
- if (xf86ShowUnresolved && !fatalsym) {
- if (SymInList(&reqList, symbol)) {
- fatalReqSym = 1;
- ErrorF("Required symbol %s from module %s is unresolved!\n",
- symbol, module);
- }
- if (!SymInList(&refList, symbol)) {
- ErrorF("Symbol %s from module %s is unresolved!\n",
- symbol, module);
- }
- }
- return (fatalsym);
-}
-
-/*
- * Handle an archive.
- */
-void *
-ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP ** ppLookup)
-{
- loaderPtr tmp = NULL;
- void *ret = NULL;
- unsigned char magic[SARMAG];
- struct ar_hdr hdr;
-
-#if defined(__powerpc__) && defined(Lynx)
- struct fl_hdr fhdr;
- char name[255];
- int namlen;
-#endif
- unsigned int size;
- unsigned int offset;
- int arnamesize, modnamesize;
- char *slash, *longname;
- char *nametable = NULL;
- int nametablelen = 0;
- LOOKUP *lookup_ret, *p;
- LOOKUP *myLookup = NULL; /* Does realloc behave if ptr == 0? */
- int modtype;
- int i;
- int numsyms = 0;
-
- /* lookup_ret = xf86loadermalloc(sizeof (LOOKUP *)); */
-
- arnamesize = strlen(modrec->name);
-
-#if !(defined(__powerpc__) && defined(Lynx))
- read(arfd, magic, SARMAG);
-
- if (strncmp((const char *)magic, ARMAG, SARMAG) != 0) {
- ErrorF("ARCHIVELoadModule: wrong magic!!\n");
- return NULL;
- }
-#else
- read(arfd, &fhdr, FL_HSZ);
-
- if (strncmp(fhdr.fl_magic, AIAMAG, SAIAMAG) != 0) {
- ErrorF("ARCHIVELoadModule: wrong magic!!\n");
- return NULL;
- }
-#endif /* __powerpc__ && Lynx */
-
-#ifdef DEBUGAR
- ErrorF("Looking for archive members starting at offset %o\n", offset);
-#endif
-
- while (read(arfd, &hdr, sizeof(struct ar_hdr))) {
-
- longname = NULL;
- sscanf(hdr.ar_size, "%u", &size);
-#if defined(__powerpc__) && defined(Lynx)
- sscanf(hdr.ar_namlen, "%d", &namlen);
- name[0] = hdr.ar_name[0];
- name[1] = hdr.ar_name[1];
- read(arfd, &name[2], namlen);
- name[namlen] = '\0';
- offset = lseek(arfd, 0, SEEK_CUR);
- if (offset & 0x1) /* odd value */
- offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */
-#endif
- offset = lseek(arfd, 0, SEEK_CUR);
-
- /* Check for a Symbol Table */
- if ((hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') ||
-#if defined(__powerpc__) && defined(Lynx)
- namlen == 0 ||
-#endif
- strncmp(hdr.ar_name, "__.SYMDEF", 9) == 0) {
- /* If the file name is NULL, then it is a symbol table */
-#ifdef DEBUGAR
- ErrorF("Symbol Table Member '%16.16s', size %d, offset %d\n",
- hdr.ar_name, size, offset);
- ErrorF("Symbol table size %d\n", size);
-#endif
- offset = lseek(arfd, offset + size, SEEK_SET);
- if (offset & 0x1) /* odd value */
- offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */
- continue;
- }
-
- /* Check for a String Table */
- if (hdr.ar_name[0] == '/' && hdr.ar_name[1] == '/') {
- /* If the file name is '/', then it is a string table */
-#ifdef DEBUGAR
- ErrorF("String Table Member '%16.16s', size %d, offset %d\n",
- hdr.ar_name, size, offset);
- ErrorF("String table size %d\n", size);
-#endif
- nametablelen = size;
- nametable = (char *)xf86loadermalloc(nametablelen);
- read(arfd, nametable, size);
- offset = lseek(arfd, 0, SEEK_CUR);
- /* offset=lseek(arfd,offset+size,SEEK_SET); */
- if (offset & 0x1) /* odd value */
- offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */
- continue;
- }
-
- if (hdr.ar_name[0] == '/') {
- /* SYS V r4 style long member name */
- int nameoffset = atol(&hdr.ar_name[1]);
- char *membername;
-
- if (!nametable) {
- ErrorF("Missing string table whilst processing %s\n",
- modrec->name);
- offsetbias = 0;
- return NULL;
- }
- if (nameoffset > nametablelen) {
- ErrorF("Invalid string table offset (%s) whilst processing %s\n", hdr.ar_name, modrec->name);
- offsetbias = 0;
- xf86loaderfree(nametable);
- return NULL;
- }
- membername = nametable + nameoffset;
- slash = strchr(membername, '/');
- if (slash)
- *slash = '\0';
- longname = xf86loadermalloc(arnamesize + strlen(membername) + 2);
- strcpy(longname, modrec->name);
- strcat(longname, ":");
- strcat(longname, membername);
- } else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1' &&
- hdr.ar_name[2] == '/') {
- /* BSD 4.4 style long member name */
- if (sscanf(hdr.ar_name + 3, "%d", &modnamesize) != 1) {
- ErrorF("Bad archive member %s\n", hdr.ar_name);
- offsetbias = 0;
- return NULL;
- }
- /* allocate space for fully qualified name */
- longname = xf86loadermalloc(arnamesize + modnamesize + 2);
- strcpy(longname, modrec->name);
- strcat(longname, ":");
- i = read(arfd, longname + modnamesize + 1, modnamesize);
- if (i != modnamesize) {
- ErrorF("Bad archive member %s\n", hdr.ar_name);
- xf86loaderfree(longname);
- offsetbias = 0;
- return NULL;
- }
- longname[i] = '\0';
- offset += i;
- size -= i;
- } else {
- /* Regular archive member */
-#ifdef DEBUGAR
- ErrorF("Member '%16.16s', size %d, offset %x\n",
-#if !(defined(__powerpc__) && defined(Lynx))
- hdr.ar_name,
-#else
- name,
-#endif
- size, offset);
-#endif
-
- slash = strchr(hdr.ar_name, '/');
- if (slash == NULL) {
- /* BSD format without trailing slash */
- slash = strchr(hdr.ar_name, ' ');
- }
- /* SM: Make sure we do not overwrite other parts of struct */
-
- if ((slash - hdr.ar_name) > sizeof(hdr.ar_name))
- slash = hdr.ar_name + sizeof(hdr.ar_name) - 1;
- *slash = '\000';
- }
- if ((modtype = _GetModuleType(arfd, offset)) < 0) {
- ErrorF("%s is an unrecognized module type\n", hdr.ar_name);
- offsetbias = 0;
- if (nametable)
- xf86loaderfree(nametable);
- return NULL;
- }
-
- tmp = _LoaderListPush();
-
- tmp->handle = modrec->handle;
- tmp->module = moduleseq++;
- tmp->cname = xf86loadermalloc(strlen(modrec->cname) + 1);
- strcpy(tmp->cname, modrec->cname);
- tmp->funcs = &funcs[modtype];
- if (longname == NULL) {
- modnamesize = strlen(hdr.ar_name);
- tmp->name =
- (char *)xf86loadermalloc(arnamesize + modnamesize + 2);
- strcpy(tmp->name, modrec->name);
- strcat(tmp->name, ":");
- strcat(tmp->name, hdr.ar_name);
-
- } else {
- tmp->name = longname;
- }
- offsetbias = offset;
-
- if ((tmp->private = funcs[modtype].LoadModule(tmp, arfd, &lookup_ret))
- == NULL) {
- ErrorF("Failed to load %s\n", hdr.ar_name);
- offsetbias = 0;
- if (nametable)
- xf86loaderfree(nametable);
- return NULL;
- }
-
- offset = lseek(arfd, offset + size, SEEK_SET);
- if (offset & 0x1) /* odd value */
- lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */
-
- if (tmp->private == (void *)-1L) {
- ErrorF("Skipping \"%s\": No symbols found\n", tmp->name);
- continue;
- } else
- ret = tmp->private;
-
- /* Add the lookup table returned from funcs.LoadModule to the
- * one we're going to return.
- */
- for (i = 0, p = lookup_ret; p && p->symName; i++, p++) ;
- if (i) {
- myLookup = xf86loaderrealloc(myLookup, (numsyms + i + 1)
- * sizeof(LOOKUP));
- if (!myLookup)
- continue; /* Oh well! */
-
- memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof(LOOKUP));
- numsyms += i;
- myLookup[numsyms].symName = 0;
- }
- xf86loaderfree(lookup_ret);
- }
- /* xf86loaderfree(lookup_ret); */
- offsetbias = 0;
-
- *ppLookup = myLookup;
- if (nametable)
- xf86loaderfree(nametable);
-
- return ret;
-}
-
-/*
- * Relocation list manipulation routines
- */
-
-/*
- * _LoaderGetRelocations() Return the list of outstanding relocations
- */
-LoaderRelocPtr
-_LoaderGetRelocations(void *mod)
-{
- loader_funcs *formatrec = (loader_funcs *) mod;
-
- return &(formatrec->pRelocs);
-}
-
-/*
- * Public Interface to the loader.
- */
-
-int
-LoaderOpen(const char *module, const char *cname, int handle,
- int *errmaj, int *errmin, int *wasLoaded)
-{
- loaderPtr tmp;
- int new_handle, modtype;
- int fd;
- LOOKUP *pLookup;
-
-#if defined(DEBUG)
- ErrorF("LoaderOpen(%s)\n", module);
-#endif
-
- /*
- * Check to see if the module is already loaded.
- * Only if we are loading it into an existing namespace.
- * If it is to be loaded into a new namespace, don't check.
- * Note: We only have one namespace.
- */
- if (handle >= 0) {
- tmp = listHead;
- while (tmp) {
-#ifdef DEBUGLIST
- ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module, module,
- &(tmp->name), tmp->name, tmp->name);
-#endif
- if (!strcmp(module, tmp->name)) {
- refCount[tmp->handle]++;
- if (wasLoaded)
- *wasLoaded = 1;
- xf86MsgVerb(X_INFO, 2, "Reloading %s\n", module);
- return tmp->handle;
- }
- tmp = tmp->next;
- }
- }
-
- /*
- * OK, it's a new one. Add it.
- */
- xf86Msg(X_INFO, "Loading %s\n", module);
- if (wasLoaded)
- *wasLoaded = 0;
-
- /*
- * Find a free handle.
- */
- new_handle = 1;
- while (freeHandles[new_handle] && new_handle < MAX_HANDLE)
- new_handle++;
-
- if (new_handle == MAX_HANDLE) {
- xf86Msg(X_ERROR, "Out of loader space\n"); /* XXX */
- if (errmaj)
- *errmaj = LDR_NOSPACE;
- if (errmin)
- *errmin = LDR_NOSPACE;
- return -1;
- }
-
- freeHandles[new_handle] = HANDLE_USED;
- refCount[new_handle] = 1;
-
- if ((fd = open(module, O_RDONLY)) < 0) {
- xf86Msg(X_ERROR, "Unable to open %s\n", module);
- freeHandles[new_handle] = HANDLE_FREE;
- if (errmaj)
- *errmaj = LDR_NOMODOPEN;
- if (errmin)
- *errmin = errno;
- return -1;
- }
-
- if ((modtype = _GetModuleType(fd, 0)) < 0) {
- xf86Msg(X_ERROR, "%s is an unrecognized module type\n", module);
- freeHandles[new_handle] = HANDLE_FREE;
- if (errmaj)
- *errmaj = LDR_UNKTYPE;
- if (errmin)
- *errmin = LDR_UNKTYPE;
- return -1;
- }
-
- tmp = _LoaderListPush();
- tmp->name = xf86loadermalloc(strlen(module) + 1);
- strcpy(tmp->name, module);
- tmp->cname = xf86loadermalloc(strlen(cname) + 1);
- strcpy(tmp->cname, cname);
- tmp->handle = new_handle;
- tmp->module = moduleseq++;
- tmp->funcs = &funcs[modtype];
-
- if ((tmp->private = funcs[modtype].LoadModule(tmp, fd, &pLookup)) == NULL) {
- xf86Msg(X_ERROR, "Failed to load %s\n", module);
- _LoaderListPop(new_handle);
- freeHandles[new_handle] = HANDLE_FREE;
- if (errmaj)
- *errmaj = LDR_NOLOAD;
- if (errmin)
- *errmin = LDR_NOLOAD;
- return -1;
- }
-
- if (tmp->private != (void *)-1L) {
- LoaderAddSymbols(new_handle, tmp->module, pLookup);
- xf86loaderfree(pLookup);
- }
-
- close(fd);
-
- return new_handle;
-}
-
-int
-LoaderHandleOpen(int handle)
-{
- if (handle < 0 || handle >= MAX_HANDLE)
- return -1;
-
- if (freeHandles[handle] != HANDLE_USED)
- return -1;
-
- refCount[handle]++;
- return handle;
-}
-
-void *
-LoaderSymbol(const char *sym)
-{
- int i;
- itemPtr item = NULL;
-
- for (i = 0; i < numloaders; i++)
- funcs[i].ResolveSymbols(&funcs[i]);
-
- item = (itemPtr) LoaderHashFind(sym);
-
- if (item)
- return item->address;
- else
-#ifdef DLOPEN_SUPPORT
- return (DLFindSymbol(sym));
-#else
- return NULL;
-#endif
-}
-
-int
-LoaderResolveSymbols(void)
-{
- int i;
-
- for (i = 0; i < numloaders; i++)
- funcs[i].ResolveSymbols(&funcs[i]);
- return 0;
-}
-
-int
-LoaderCheckUnresolved(int delay_flag)
-{
- int i, ret = 0;
- LoaderResolveOptions delayFlag = (LoaderResolveOptions)delay_flag;
-
- LoaderResolveSymbols();
-
- if (delayFlag == LD_RESOLV_NOW) {
- if (check_unresolved_sema > 0)
- check_unresolved_sema--;
- else
- xf86Msg(X_WARNING, "LoaderCheckUnresolved: not enough "
- "MAGIC_DONT_CHECK_UNRESOLVED\n");
- }
-
- if (!check_unresolved_sema || delayFlag == LD_RESOLV_FORCE)
- for (i = 0; i < numloaders; i++)
- if (funcs[i].CheckForUnresolved(&funcs[i]))
- ret = 1;
-
- if (fatalReqSym)
- FatalError("Some required symbols were unresolved\n");
-
- return ret;
-}
-
-void xf86LoaderTrap(void);
-
-void
-xf86LoaderTrap(void)
-{
-}
-
-void
-LoaderDefaultFunc(void)
-{
- ErrorF("\n\n\tThis should not happen!\n"
- "\tAn unresolved function was called!\n");
-
- xf86LoaderTrap();
-
- FatalError("\n");
-}
-
-int
-LoaderUnload(int handle)
-{
- loaderRec fakeHead;
- loaderPtr tmp = &fakeHead;
-
- if (handle < 0 || handle > MAX_HANDLE)
- return -1;
-
- /*
- * check the reference count, only free it if it goes to zero
- */
- if (--refCount[handle])
- return 0;
- /*
- * find the loaderRecs associated with this handle.
- */
-
- while ((tmp = _LoaderListPop(handle)) != NULL) {
- if (strchr(tmp->name, ':') == NULL) {
- /* It is not a member of an archive */
- xf86Msg(X_INFO, "Unloading %s\n", tmp->name);
- }
- tmp->funcs->LoaderUnload(tmp->private);
- xf86loaderfree(tmp->name);
- xf86loaderfree(tmp->cname);
- xf86loaderfree(tmp);
- }
-
- freeHandles[handle] = HANDLE_FREE;
-
- return 0;
-}
-
-void
-LoaderDuplicateSymbol(const char *symbol, const int handle)
-{
- ErrorF("Duplicate symbol %s in %s\n", symbol,
- listHead ? listHead->name : "(built-in)");
- ErrorF("Also defined in %s\n", _LoaderHandleToName(handle));
- FatalError("Module load failure\n");
-}
-
-/* GDB Sync function */
-void
-_loader_debug_state()
-{
-}
-
-unsigned long LoaderOptions = 0;
-
-void
-LoaderResetOptions(void)
-{
- LoaderOptions = 0;
-}
-
-void
-LoaderSetOptions(unsigned long opts)
-{
- LoaderOptions |= opts;
-}
-
-void
-LoaderClearOptions(unsigned long opts)
-{
- LoaderOptions &= ~opts;
-}
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
deleted file mode 100644
index f48aadb02..000000000
--- a/hw/xfree86/loader/loader.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.28 2003/11/06 18:38:14 tsi Exp $ */
-
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _LOADER_H
-#define _LOADER_H
-
-#include "sym.h"
-
-#if defined(Lynx) && defined(sun)
-#define const /**/
-#endif
-#if (defined(__i386__) || defined(__ix86)) && !defined(i386)
-#define i386
-#endif
-#include <X11/Xosdefs.h>
-#include <X11/Xfuncproto.h>
-#include <X11/Xmd.h>
-/* For LOOKUP definition */
-#include "sym.h"
-#define LD_UNKNOWN -1
-#define LD_ARCHIVE 0
-#define LD_ELFOBJECT 1
-#define LD_COFFOBJECT 2
-#define LD_XCOFFOBJECT 3
-#define LD_AOUTOBJECT 4
-#define LD_AOUTDLOBJECT 5
-#define LD_ELFDLOBJECT 6
-#define LD_PROCESSED_ARCHIVE -1
-/* #define UNINIT_SECTION */
-#define HANDLE_IN_HASH_ENTRY
-/*
- * COFF Section nmumbers
- */
-#define N_TEXT 1
-#define N_DATA 2
-#define N_BSS 3
-#define N_COMMENT 4
-#define TestFree(a) if (a) { xfree (a); a = NULL; }
-#define HASHDIV 10
-#define HASHSIZE (1<<HASHDIV)
-typedef struct _elf_reloc *ELFRelocPtr;
-typedef struct _elf_COMMON *ELFCommonPtr;
-typedef struct _coff_reloc *COFFRelocPtr;
-typedef struct _coff_COMMON *COFFCommonPtr;
-typedef struct AOUT_RELOC *AOUTRelocPtr;
-typedef struct AOUT_COMMON *AOUTCommonPtr;
-
-typedef struct _LoaderReloc {
- int modtype;
- struct _LoaderReloc *next;
- COFFRelocPtr coff_reloc;
- ELFRelocPtr elf_reloc;
- AOUTRelocPtr aout_reloc;
-} LoaderRelocRec, *LoaderRelocPtr;
-
-typedef struct _loader_item *itemPtr;
-typedef struct _loader_item {
- char *name;
- void *address;
- itemPtr next;
- int handle;
- int module;
- itemPtr exports;
-#if defined(__powerpc__)
- /*
- * PowerPC file formats require special routines in some circumstances
- * to assist in the linking process. See the specific loader for
- * more details.
- */
- union {
- unsigned short plt[8]; /* ELF */
- unsigned short glink[14]; /* XCOFF */
- } code;
-#endif
-} itemRec;
-
-/* The following structures provide an interface to GDB (note that GDB
- has copies of the definitions - if you change anything here make
- sure that the changes are also made to GDB */
-
-typedef struct {
- char *name; /* Name of this symbol */
- unsigned int namelen; /* Name of this module */
- void *addr; /* Start address of the .text section */
-} LDRCommon, *LDRCommonPtr;
-
-typedef struct x_LDRModuleRec {
- unsigned int version; /* Version of this struct */
- char *name; /* Name of this module */
- unsigned int namelen; /* Length of name */
- void *text; /* Start address of the .text section */
- void *data; /* Start address of the .data section */
- void *rodata; /* Start address of the .rodata section */
- void *bss; /* Start address of the .bss section */
- LDRCommonPtr commons; /* List of commmon symbols */
- int commonslen; /* Number of common symbols */
- struct x_LDRModuleRec *next; /* Next module record in chain */
-} LDRModuleRec, *LDRModulePtr;
-
-extern char DebuggerPresent;
-extern LDRModulePtr ModList;
-extern LDRCommonPtr ldrCommons;
-extern int nCommons;
-
-/*
- * The loader uses loader specific alloc/calloc/free functions that
- * are mapped to either to the regular Xserver functions, or in a couple
- * of special cases, mapped to the C library functions.
- */
-#if !defined(PowerMAX_OS) && !(defined(linux) && (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__))) && 0
-#define xf86loadermalloc(size) xalloc(size)
-#define xf86loaderrealloc(ptr,size) xrealloc(ptr,size)
-#define xf86loadercalloc(num,size) xcalloc(num,size)
-#define xf86loaderfree(ptr) xfree(ptr)
-#define xf86loaderstrdup(ptr) xstrdup(ptr)
-#else
-/*
- * On Some OSes, xalloc() et al uses mmap to allocate space for large
- * allocation. This has the effect of placing the text section of some
- * modules very far away from the rest which are placed on the heap.
- * Certain relocations are limited in the size of the offsets that can be
- * handled, and this seperation causes these relocation to overflow. This
- * is fixed by just using the C library allocation functions for the loader
- * to ensure that all text sections are located on the heap. OSes that have
- * this problem are:
- * PowerMAX_OS/PPC
- * Linux/Alpha
- * Linux/PPC
- * Linux/IA-64
- */
-#define xf86loadermalloc(size) malloc(size)
-#define xf86loaderrealloc(ptr,size) realloc(ptr,size)
-#define xf86loadercalloc(num,size) calloc(num,size)
-#define xf86loaderfree(ptr) free(ptr)
-#define xf86loaderstrdup(ptr) strdup(ptr)
-#endif
-
-typedef struct _loader *loaderPtr;
-
-/*
- * _loader_funcs hold the entry points for a module format.
- */
-
-typedef void *(*LoadModuleProcPtr) (loaderPtr modrec, int fd, LOOKUP **);
-typedef void (*ResolveSymbolsProcPtr) (void *);
-typedef int (*CheckForUnresolvedProcPtr) (void *);
-typedef char *(*AddressToSectionProcPtr) (void *, unsigned long);
-typedef void (*LoaderUnloadProcPtr) (void *);
-
-typedef struct _loader_funcs {
- LoadModuleProcPtr LoadModule;
- ResolveSymbolsProcPtr ResolveSymbols;
- CheckForUnresolvedProcPtr CheckForUnresolved;
- AddressToSectionProcPtr AddressToSection;
- LoaderUnloadProcPtr LoaderUnload;
- LoaderRelocRec pRelocs; /* type specific relocations */
-} loader_funcs;
-
-/* Each module loaded has a loaderRec */
-typedef struct _loader {
- int handle; /* Unique id used to remove symbols from
- * this module when it is unloaded */
- int module; /* Unique id to identify compilation units */
- char *name;
- char *cname;
- void *private; /* format specific data */
- loader_funcs *funcs; /* funcs for operating on this module */
- loaderPtr next;
-} loaderRec;
-
-/* Compiled-in version information */
-typedef struct {
- int xf86Version;
- int ansicVersion;
- int videodrvVersion;
- int xinputVersion;
- int extensionVersion;
- int fontVersion;
-} ModuleVersions;
-extern ModuleVersions LoaderVersionInfo;
-
-extern unsigned long LoaderOptions;
-
-/* Internal Functions */
-
-void LoaderAddSymbols(int, int, LOOKUP *);
-void LoaderDefaultFunc(void);
-void LoaderDuplicateSymbol(const char *, const int);
-
-#if 0
-void LoaderFixups(void);
-#endif
-void LoaderResolve(void);
-int LoaderResolveSymbols(void);
-int _LoaderHandleUnresolved(char *, char *);
-void LoaderHashAdd(itemPtr);
-itemPtr LoaderHashDelete(const char *);
-itemPtr LoaderHashFind(const char *);
-void LoaderHashTraverse(void *, int (*)(void *, itemPtr));
-void LoaderPrintAddress(const char *);
-void LoaderPrintItem(itemPtr);
-void LoaderPrintSymbol(unsigned long);
-void LoaderDumpSymbols(void);
-char *_LoaderModuleToName(int);
-int _LoaderAddressToSection(const unsigned long, const char **,
- const char **);
-int LoaderOpen(const char *, const char *, int, int *, int *, int *);
-int LoaderHandleOpen(int);
-
-/*
- * File interface functions
- */
-void *_LoaderFileToMem(int fd, unsigned long offset, int size, char *label);
-void _LoaderFreeFileMem(void *addr, int size);
-int _LoaderFileRead(int fd, unsigned int offset, void *addr, int size);
-
-/*
- * Relocation list manipulation routines
- */
-LoaderRelocPtr _LoaderGetRelocations(void *);
-
-/*
- * object to name lookup routines
- */
-char *_LoaderHandleToName(int handle);
-char *_LoaderHandleToCanonicalName(int handle);
-
-/*
- * Entry points for the different loader types
- */
-#include "aoutloader.h"
-#include "coffloader.h"
-#include "elfloader.h"
-#include "dlloader.h"
-/* LD_ARCHIVE */
-void *ARCHIVELoadModule(loaderPtr, int, LOOKUP **);
-
-extern void _loader_debug_state(void);
-
-#endif /* _LOADER_H */
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
deleted file mode 100644
index d2779812f..000000000
--- a/hw/xfree86/loader/loaderProcs.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.21 2003/10/15 16:29:04 dawes Exp $ */
-
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _LOADERPROCS_H
-#define _LOADERPROCS_H
-
-#define IN_LOADER
-#include "xf86Module.h"
-#include "fontmod.h"
-
-typedef struct module_desc {
- struct module_desc *child;
- struct module_desc *sib;
- struct module_desc *parent;
- struct module_desc *demand_next;
- char *name;
- char *filename;
- char *identifier;
- XID client_id;
- int in_use;
- int handle;
- ModuleSetupProc SetupProc;
- ModuleTearDownProc TearDownProc;
- void *TearDownData; /* returned from SetupProc */
- const char *path;
- const XF86ModuleVersionInfo *VersionInfo;
-} ModuleDesc, *ModuleDescPtr;
-
-/*
- * Extenal API for the loader
- */
-
-void LoaderInit(void);
-
-ModuleDescPtr LoadDriver(const char *, const char *, int, pointer, int *,
- int *);
-ModuleDescPtr LoadModule(const char *, const char *, const char **,
- const char **, pointer, const XF86ModReqInfo *,
- int *, int *);
-ModuleDescPtr LoadSubModule(ModuleDescPtr, const char *,
- const char **, const char **, pointer,
- const XF86ModReqInfo *, int *, int *);
-ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
-void LoadFont(FontModule *);
-void UnloadModule(ModuleDescPtr);
-void UnloadSubModule(ModuleDescPtr);
-void UnloadDriver(ModuleDescPtr);
-void FreeModuleDesc(ModuleDescPtr mod);
-ModuleDescPtr NewModuleDesc(const char *);
-ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new);
-void LoaderSetPath(const char *path);
-void LoaderSortExtensions(void);
-
-void LoaderVReqSymLists(const char **, va_list args);
-void LoaderVReqSymbols(const char *, va_list args);
-void LoaderVRefSymLists(const char **, va_list args);
-void LoaderVRefSymbols(const char *, va_list args);
-
-void LoaderShowStack(void);
-void *LoaderSymbolHandle(const char *, int);
-int LoaderUnload(int);
-unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
-
-void LoaderResetOptions(void);
-void LoaderSetOptions(unsigned long);
-void LoaderClearOptions(unsigned long);
-
-/* Options for LoaderSetOptions */
-#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
-
-#endif /* _LOADERPROCS_H */
diff --git a/hw/xfree86/loader/loadext.c b/hw/xfree86/loader/loadext.c
deleted file mode 100644
index ffc98b243..000000000
--- a/hw/xfree86/loader/loadext.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadext.c,v 1.8 2003/10/15 16:29:04 dawes Exp $ */
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Maybe this file belongs elsewhere? */
-
-#define LOADERDECLARATIONS
-#include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-
-ExtensionModule *ExtensionModuleList = NULL;
-static int numExtensionModules = 0;
-
-static ExtensionModule *
-NewExtensionModule(void)
-{
- ExtensionModule *save = ExtensionModuleList;
- int n;
-
- /* Sanity check */
- if (!ExtensionModuleList)
- numExtensionModules = 0;
-
- n = numExtensionModules + 1;
- ExtensionModuleList = xrealloc(ExtensionModuleList,
- (n + 1) * sizeof(ExtensionModule));
- if (ExtensionModuleList == NULL) {
- ExtensionModuleList = save;
- return NULL;
- } else {
- numExtensionModules++;
- ExtensionModuleList[numExtensionModules].name = NULL;
- return ExtensionModuleList + (numExtensionModules - 1);
- }
-}
-
-void
-LoadExtension(ExtensionModule * e, Bool builtin)
-{
- ExtensionModule *newext;
-
- if (e == NULL || e->name == NULL)
- return;
-
- if (!(newext = NewExtensionModule()))
- return;
-
- if (builtin)
- xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n",
- e->name);
- else
- xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name);
-
- newext->name = e->name;
- newext->initFunc = e->initFunc;
- newext->disablePtr = e->disablePtr;
- newext->setupFunc = e->setupFunc;
- newext->initDependencies = e->initDependencies;
-
- if (e->setupFunc != NULL)
- e->setupFunc();
-}
-
-/*
- * Sort ExtensionModuleList according to the initialisation order
- * dependencies. The code for this is taken from BSD's tsort,
- * and carries the following copyright/license:
- *
- *
- * Copyright (c) 1989, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Michael Rendell of Memorial University of Newfoundland.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define NF_MARK 0x1 /* marker for cycle detection */
-#define NF_ACYCLIC 0x2 /* this node is cycle free */
-#define NF_NODEST 0x4 /* Unreachable */
-
-typedef struct node_str NODE;
-struct node_str {
- NODE **n_prevp; /* pointer to previous node's n_next */
- NODE *n_next; /* next node in graph */
- NODE **n_arcs; /* array of arcs to other nodes */
- int n_narcs; /* number of arcs in n_arcs[] */
- int n_arcsize; /* size of n_arcs[] array */
- int n_refcnt; /* # of arcs pointing to this node */
- int n_flags; /* NF_* */
- const char *n_name; /* name of this node */
-};
-
-static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL;
-static int longest = 0;
-static NODE *sorted = NULL, *last = NULL;
-
-/* Find a node in the graph (insert if not found) and return a pointer to it. */
-static NODE *
-get_node(const char *name)
-{
- NODE *n;
-
- for (n = graph; n && n->n_name && strcmp(n->n_name, name);
- n = n->n_next) ;
- if (n)
- return (n);
-
- n = xnfalloc(sizeof(NODE));
-
- n->n_narcs = 0;
- n->n_arcsize = 0;
- n->n_arcs = NULL;
- n->n_refcnt = 0;
- n->n_flags = 0;
- n->n_name = name;
-
- /* Add to linked list. */
- if ((n->n_next = graph) != NULL)
- graph->n_prevp = &n->n_next;
- n->n_prevp = &graph;
- graph = n;
-
- return (n);
-}
-
-/*
- * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in
- * the graph, then add them.
- */
-static void
-add_arc(const char *s1, const char *s2)
-{
- NODE *n1;
- NODE *n2;
- int bsize, i;
-
- n1 = get_node(s1);
-
- if (!strcmp(s1, s2))
- return;
-
- n2 = get_node(s2);
-
- /*
- * Check if this arc is already here.
- */
- for (i = 0; i < n1->n_narcs; i++)
- if (n1->n_arcs[i] == n2)
- return;
- /*
- * Add it.
- */
- if (n1->n_narcs == n1->n_arcsize) {
- if (!n1->n_arcsize)
- n1->n_arcsize = 10;
- bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2;
- n1->n_arcs = xnfrealloc(n1->n_arcs, bsize);
- n1->n_arcsize = bsize / sizeof(*n1->n_arcs);
- }
- n1->n_arcs[n1->n_narcs++] = n2;
- ++n2->n_refcnt;
-}
-
-/*
- * Clear the NODEST flag from all nodes.
- */
-static void
-clear_cycle(void)
-{
- NODE *n;
-
- for (n = graph; n != NULL; n = n->n_next)
- n->n_flags &= ~NF_NODEST;
-}
-
-/* print node and remove from graph (does not actually free node) */
-static void
-remove_node(NODE * n)
-{
- NODE **np;
- NODE *newnode;
- int i;
-
-#ifdef DEBUG
- ErrorF("%s\n", n->n_name);
-#endif
- newnode = xnfalloc(sizeof(NODE));
- memcpy(newnode, n, sizeof(NODE));
- if (last)
- last->n_next = newnode;
- else
- sorted = newnode;
- last = newnode;
- newnode->n_next = NULL;
-
- for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++)
- --(*np)->n_refcnt;
- n->n_narcs = 0;
- *n->n_prevp = n->n_next;
- if (n->n_next)
- n->n_next->n_prevp = n->n_prevp;
-}
-
-static void
-free_nodes(NODE * nodelist)
-{
- NODE *n, *nextnode;
-
- for (n = nodelist; n;) {
- nextnode = n->n_next;
- xfree(n);
- n = nextnode;
- }
-}
-
-/* look for the longest? cycle from node from to node to. */
-static int
-find_cycle(NODE * from, NODE * to, int longest_len, int depth)
-{
- NODE **np;
- int i, len;
-
- /*
- * avoid infinite loops and ignore portions of the graph known
- * to be acyclic
- */
- if (from->n_flags & (NF_NODEST | NF_MARK | NF_ACYCLIC))
- return (0);
- from->n_flags |= NF_MARK;
-
- for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) {
- cycle_buf[depth] = *np;
- if (*np == to) {
- if (depth + 1 > longest_len) {
- longest_len = depth + 1;
- memcpy((char *)longest_cycle,
- (char *)cycle_buf, longest_len * sizeof(NODE *));
- }
- } else {
- if ((*np)->n_flags & (NF_MARK | NF_ACYCLIC | NF_NODEST))
- continue;
- len = find_cycle(*np, to, longest_len, depth + 1);
-
-#ifdef DEBUG
- ErrorF("%*s %s->%s %d\n", depth, "",
- from->n_name, to->n_name, len);
-#endif
-
- if (len == 0)
- (*np)->n_flags |= NF_NODEST;
-
- if (len > longest_len)
- longest_len = len;
-
- if (len > 0 && !longest)
- break;
- }
- }
- from->n_flags &= ~NF_MARK;
- return (longest_len);
-}
-
-/* do topological sort on graph */
-static void
-tsort(void)
-{
- NODE *n, *next;
- int cnt, i;
-
- while (graph != NULL) {
- /*
- * Keep getting rid of simple cases until there are none left,
- * if there are any nodes still in the graph, then there is
- * a cycle in it.
- */
- do {
- for (cnt = 0, n = graph; n != NULL; n = next) {
- next = n->n_next;
- if (n->n_refcnt == 0) {
- remove_node(n);
- ++cnt;
- }
- }
- } while (graph != NULL && cnt);
-
- if (graph == NULL)
- break;
-
- if (!cycle_buf) {
- /*
- * Allocate space for two cycle logs - one to be used
- * as scratch space, the other to save the longest
- * cycle.
- */
- for (cnt = 0, n = graph; n != NULL; n = n->n_next)
- ++cnt;
- cycle_buf = xnfalloc(sizeof(NODE *) * cnt);
- longest_cycle = xnfalloc(sizeof(NODE *) * cnt);
- if (cycle_buf == NULL || longest_cycle == NULL)
- return;
- }
- for (n = graph; n != NULL; n = n->n_next)
- if (!(n->n_flags & NF_ACYCLIC)) {
- if ((cnt = find_cycle(n, n, 0, 0))) {
- ErrorF("tsort: cycle in data");
- for (i = 0; i < cnt; i++)
- ErrorF("%s", longest_cycle[i]->n_name);
- remove_node(n);
- clear_cycle();
- break;
- } else {
- /* to avoid further checks */
- n->n_flags |= NF_ACYCLIC;
- clear_cycle();
- }
- }
-
- if (n == NULL)
- ErrorF("tsort: internal error -- could not find cycle");
- }
- if (cycle_buf)
- xfree(cycle_buf);
- if (longest_cycle)
- xfree(longest_cycle);
- if (graph)
- free_nodes(graph);
-}
-
-void
-LoaderSortExtensions()
-{
- int i, j;
- ExtensionModule *ext, *newList;
- NODE *node;
-
- graph = NULL;
- longest = 0;
- sorted = NULL;
- last = NULL;
- cycle_buf = NULL;
- longest_cycle = NULL;
-
- /*
- * Parse list and build the graph. Enter them in reverse order
- * because tsort() will reverse those that have no depedencies.
- */
- for (i = numExtensionModules - 1; i >= 0; i--) {
- ext = &ExtensionModuleList[i];
- add_arc(ext->name, ext->name);
-#ifdef DEBUG
- ErrorF("Extension %s:\n", ext->name);
-#endif
- if (ext->initDependencies)
- for (j = 0; ext->initDependencies[j]; j++) {
- add_arc(ext->initDependencies[j], ext->name);
-#ifdef DEBUG
- ErrorF("\t%s\n", ext->initDependencies[j]);
-#endif
- }
- }
- tsort();
- newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule));
- i = 0;
- for (node = sorted; node; node = node->n_next) {
- for (j = 0; j < numExtensionModules; j++)
- if (!strcmp(node->n_name, ExtensionModuleList[j].name))
- break;
- if (j != numExtensionModules)
- newList[i++] = ExtensionModuleList[j];
- }
- if (sorted)
- free_nodes(sorted);
- newList[i].name = NULL;
- xfree(ExtensionModuleList);
- ExtensionModuleList = newList;
-#ifdef DEBUG
- for (i = 0; ExtensionModuleList[i].name; i++)
- ErrorF("Extension %s\n", ExtensionModuleList[i].name);
-#endif
-}
diff --git a/hw/xfree86/loader/loadfont.c b/hw/xfree86/loader/loadfont.c
deleted file mode 100644
index 6886692da..000000000
--- a/hw/xfree86/loader/loadfont.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */
-/*
- * Copyright (c) 1998 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Maybe this file belongs in lib/font/fontfile/module/ ? */
-
-#define LOADERDECLARATIONS
-#include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-
-FontModule *FontModuleList = NULL;
-static int numFontModules = 0;
-
-static FontModule *
-NewFontModule(void)
-{
- FontModule *save = FontModuleList;
- int n;
-
- /* Sanity check */
- if (!FontModuleList)
- numFontModules = 0;
-
- n = numFontModules + 1;
- FontModuleList = xrealloc(FontModuleList, (n + 1) * sizeof(FontModule));
- if (FontModuleList == NULL) {
- FontModuleList = save;
- return NULL;
- } else {
- numFontModules++;
- FontModuleList[numFontModules].name = NULL;
- return FontModuleList + (numFontModules - 1);
- }
-}
-
-void
-LoadFont(FontModule * f)
-{
- FontModule *newfont;
-
- if (f == NULL)
- return;
-
- if (!(newfont = NewFontModule()))
- return;
-
- xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name);
-
- newfont->name = f->name;
- newfont->initFunc = f->initFunc;
- newfont->module = f->module;
-}
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
deleted file mode 100644
index 733f6feb1..000000000
--- a/hw/xfree86/loader/loadmod.c
+++ /dev/null
@@ -1,1312 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.73 2003/11/03 05:11:51 tsi Exp $ */
-
-/*
- *
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "os.h"
-/* For stat() and related stuff */
-#define NO_OSLIB_PROTOTYPES
-#include "xf86_OSlib.h"
-#define LOADERDECLARATIONS
-#include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#ifdef XINPUT
-#include "xf86Xinput.h"
-#endif
-#include "loader.h"
-#include "xf86Optrec.h"
-
-#include <sys/types.h>
-#include <regex.h>
-#include <dirent.h>
-#include <limits.h>
-
-extern int check_unresolved_sema;
-
-typedef struct _pattern {
- const char *pattern;
- regex_t rex;
-} PatternRec, *PatternPtr;
-
-/* Prototypes for static functions */
-static char *FindModule(const char *, const char *, const char **,
- PatternPtr);
-static Bool CheckVersion(const char *, XF86ModuleVersionInfo *,
- const XF86ModReqInfo *);
-static void UnloadModuleOrDriver(ModuleDescPtr mod);
-static char *LoaderGetCanonicalName(const char *, PatternPtr);
-static void RemoveChild(ModuleDescPtr);
-
-ModuleVersions LoaderVersionInfo = {
- XF86_VERSION_CURRENT,
- ABI_ANSIC_VERSION,
- ABI_VIDEODRV_VERSION,
- ABI_XINPUT_VERSION,
- ABI_EXTENSION_VERSION,
- ABI_FONT_VERSION
-};
-
-#if 0
-void
-LoaderFixups(void)
-{
- /* Need to call LRS here because the frame buffers get loaded last,
- * and the drivers depend on them. */
-
- LoaderResolveSymbols();
-}
-#endif
-
-static void
-FreeStringList(char **paths)
-{
- char **p;
-
- if (!paths)
- return;
-
- for (p = paths; *p; p++)
- xfree(*p);
-
- xfree(paths);
-}
-
-static char **defaultPathList = NULL;
-
-/*
- * Convert a comma-separated path into a NULL-terminated array of path
- * elements, rejecting any that are not full absolute paths, and appending
- * a '/' when it isn't already present.
- */
-static char **
-InitPathList(const char *path)
-{
- char *fullpath = NULL;
- char *elem = NULL;
- char **list = NULL, **save = NULL;
- int len;
- int addslash;
- int n = 0;
-
- if (!path)
- return defaultPathList;
-
- fullpath = xstrdup(path);
- if (!fullpath)
- return NULL;
- elem = strtok(fullpath, ",");
- while (elem) {
- /* Only allow fully specified paths */
-#ifndef __UNIXOS2__
- if (*elem == '/')
-#else
- if (*elem == '/' || (strlen(elem) > 2 && isalpha(elem[0]) &&
- elem[1] == ':' && elem[2] == '/'))
-#endif
- {
- len = strlen(elem);
- addslash = (elem[len - 1] != '/');
- if (addslash)
- len++;
- save = list;
- list = xrealloc(list, (n + 2) * sizeof(char *));
- if (!list) {
- if (save) {
- save[n] = NULL;
- FreeStringList(save);
- }
- xfree(fullpath);
- return NULL;
- }
- list[n] = xalloc(len + 1);
- if (!list[n]) {
- FreeStringList(list);
- xfree(fullpath);
- return NULL;
- }
- strcpy(list[n], elem);
- if (addslash) {
- list[n][len - 1] = '/';
- list[n][len] = '\0';
- }
- n++;
- }
- elem = strtok(NULL, ",");
- }
- if (list)
- list[n] = NULL;
- return list;
-}
-
-static void
-FreePathList(char **pathlist)
-{
- if (pathlist && pathlist != defaultPathList)
- FreeStringList(pathlist);
-}
-
-void
-LoaderSetPath(const char *path)
-{
- if (!path)
- return;
-
- defaultPathList = InitPathList(path);
-}
-
-/* Standard set of module subdirectories to search, in order of preference */
-static const char *stdSubdirs[] = {
- "drivers/",
- "input/",
- "multimedia/",
- "extensions/",
- "fonts/",
- "internal/",
- "",
- NULL
-};
-
-/*
- * Standard set of module name patterns to check, in order of preference
- * These are regular expressions (suitable for use with POSIX regex(3)).
- */
-static PatternRec stdPatterns[] = {
- {"^lib(.*)\\.so$",},
- {"^lib(.*)\\.a$",},
- {"(.*)_drv\\.so$",},
- {"(.*)_drv\\.o$",},
- {"(.*)\\.so$",},
- {"(.*)\\.a$",},
- {"(.*)\\.o$",},
- {NULL,}
-};
-
-static PatternPtr
-InitPatterns(const char **patternlist)
-{
- char errmsg[80];
- int i, e;
- PatternPtr patterns = NULL;
- PatternPtr p = NULL;
- static int firstTime = 1;
- const char **s;
-
- if (firstTime) {
- /* precompile stdPatterns */
- firstTime = 0;
- for (p = stdPatterns; p->pattern; p++)
- if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) {
- regerror(e, &p->rex, errmsg, sizeof(errmsg));
- FatalError("InitPatterns: regcomp error for `%s': %s\n",
- p->pattern, errmsg);
- }
- }
-
- if (patternlist) {
- for (i = 0, s = patternlist; *s; i++, s++)
- if (*s == DEFAULT_LIST)
- i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1;
- patterns = xalloc((i + 1) * sizeof(PatternRec));
- if (!patterns) {
- return NULL;
- }
- for (i = 0, s = patternlist; *s; i++, s++)
- if (*s != DEFAULT_LIST) {
- p = patterns + i;
- p->pattern = *s;
- if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) {
- regerror(e, &p->rex, errmsg, sizeof(errmsg));
- ErrorF("InitPatterns: regcomp error for `%s': %s\n",
- p->pattern, errmsg);
- i--;
- }
- } else {
- for (p = stdPatterns; p->pattern; p++, i++)
- patterns[i] = *p;
- if (p != stdPatterns)
- i--;
- }
- patterns[i].pattern = NULL;
- } else
- patterns = stdPatterns;
- return patterns;
-}
-
-static void
-FreePatterns(PatternPtr patterns)
-{
- if (patterns && patterns != stdPatterns)
- xfree(patterns);
-}
-
-static const char **
-InitSubdirs(const char **subdirlist)
-{
- int i;
- const char **tmp_subdirlist = NULL;
- char **subdirs = NULL;
- const char **s, **stmp = NULL;
- const char *osname;
- const char *slash;
- int oslen = 0, len;
- Bool indefault;
-
- if (subdirlist == NULL) {
- subdirlist = tmp_subdirlist = xalloc(2 * sizeof(char *));
- if (subdirlist == NULL)
- return NULL;
- subdirlist[0] = DEFAULT_LIST;
- subdirlist[1] = NULL;
- }
-
- LoaderGetOS(&osname, NULL, NULL, NULL);
- oslen = strlen(osname);
-
- {
- /* Count number of entries and check for invalid paths */
- for (i = 0, s = subdirlist; *s; i++, s++) {
- if (*s == DEFAULT_LIST) {
- i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1;
- } else {
- /*
- * Path validity check. Don't allow absolute paths, or
- * paths containing "..". To catch absolute paths on
- * platforms that use driver letters, don't allow the ':'
- * character to appear at all.
- */
- if (**s == '/' || **s == '\\' || strchr(*s, ':') ||
- strstr(*s, "..")) {
- xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s);
- if (tmp_subdirlist)
- xfree(tmp_subdirlist);
- return NULL;
- }
- }
- }
- subdirs = xalloc((i * 2 + 1) * sizeof(char *));
- if (!subdirs) {
- if (tmp_subdirlist)
- xfree(tmp_subdirlist);
- return NULL;
- }
- i = 0;
- s = subdirlist;
- indefault = FALSE;
- while (*s) {
- if (*s == DEFAULT_LIST) {
- /* Divert to the default list */
- indefault = TRUE;
- stmp = ++s;
- s = stdSubdirs;
- }
- len = strlen(*s);
- if (**s && (*s)[len - 1] != '/') {
- slash = "/";
- len++;
- } else
- slash = "";
- len += oslen + 2;
- if (!(subdirs[i] = xalloc(len))) {
- while (--i >= 0)
- xfree(subdirs[i]);
- xfree(subdirs);
- if (tmp_subdirlist)
- xfree(tmp_subdirlist);
- return NULL;
- }
- /* tack on the OS name */
- sprintf(subdirs[i], "%s%s%s/", *s, slash, osname);
- i++;
- /* path as given */
- subdirs[i] = xstrdup(*s);
- i++;
- s++;
- if (indefault && !s) {
- /* revert back to the main list */
- indefault = FALSE;
- s = stmp;
- }
- }
- subdirs[i] = NULL;
- }
- if (tmp_subdirlist)
- xfree(tmp_subdirlist);
- return (const char **)subdirs;
-}
-
-static void
-FreeSubdirs(const char **subdirs)
-{
- const char **s;
-
- if (subdirs) {
- for (s = subdirs; *s; s++)
- xfree(*s);
- xfree(subdirs);
- }
-}
-
-static char *
-FindModule(const char *module, const char *dir, const char **subdirlist,
- PatternPtr patterns)
-{
- char buf[PATH_MAX + 1];
- char *dirpath = NULL;
- char *name = NULL;
- struct stat stat_buf;
- int len, dirlen;
- char *fp;
- DIR *d;
- const char **subdirs = NULL;
- PatternPtr p = NULL;
- const char **s;
- struct dirent *dp;
- regmatch_t match[2];
-
- subdirs = InitSubdirs(subdirlist);
- if (!subdirs)
- return NULL;
-
-#ifndef __EMX__
- dirpath = (char *)dir;
-#else
- dirpath = xalloc(strlen(dir) + 10);
- strcpy(dirpath, (char *)__XOS2RedirRoot(dir));
-#endif
- if (strlen(dirpath) > PATH_MAX)
- return NULL;
- /*xf86Msg(X_INFO,"OS2DIAG: FindModule: dirpath=%s\n",dirpath); */
-
- for (s = subdirs; *s; s++) {
- if ((dirlen = strlen(dirpath) + strlen(*s)) > PATH_MAX)
- continue;
- strcpy(buf, dirpath);
- strcat(buf, *s);
- /*xf86Msg(X_INFO,"OS2DIAG: FindModule: buf=%s\n",buf); */
- fp = buf + dirlen;
- if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
- (d = opendir(buf))) {
- if (buf[dirlen - 1] != '/') {
- buf[dirlen++] = '/';
- fp++;
- }
- while ((dp = readdir(d))) {
- if (dirlen + strlen(dp->d_name) + 1 > PATH_MAX)
- continue;
- strcpy(fp, dp->d_name);
- if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode)))
- continue;
- for (p = patterns; p->pattern; p++) {
- if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
- match[1].rm_so != -1) {
- len = match[1].rm_eo - match[1].rm_so;
- if (len == strlen(module) &&
- strncmp(module, dp->d_name + match[1].rm_so,
- len) == 0) {
- /*xf86Msg(X_INFO,"OS2DIAG: matching %s\n",buf); */
- name = buf;
- break;
- }
- }
- }
- if (name)
- break;
- }
- closedir(d);
- if (name)
- break;
- }
- }
- FreeSubdirs(subdirs);
- if (dirpath != dir)
- xfree(dirpath);
-
- if (name) {
- return xstrdup(name);
- }
- return NULL;
-}
-
-char **
-LoaderListDirs(const char **subdirlist, const char **patternlist)
-{
- char buf[PATH_MAX + 1];
- char **pathlist;
- char **elem;
- const char **subdirs;
- const char **s;
- PatternPtr patterns;
- PatternPtr p;
- DIR *d;
- struct dirent *dp;
- regmatch_t match[2];
- struct stat stat_buf;
- int len, dirlen;
- char *fp;
- char **listing = NULL;
- char **save;
- int n = 0;
-
- if (!(pathlist = InitPathList(NULL)))
- return NULL;
- if (!(subdirs = InitSubdirs(subdirlist))) {
- FreePathList(pathlist);
- return NULL;
- }
- if (!(patterns = InitPatterns(patternlist))) {
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- return NULL;
- }
-
- for (elem = pathlist; *elem; elem++) {
- for (s = subdirs; *s; s++) {
- if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX)
- continue;
- strcpy(buf, *elem);
- strcat(buf, *s);
- fp = buf + dirlen;
- if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
- (d = opendir(buf))) {
- if (buf[dirlen - 1] != '/') {
- buf[dirlen++] = '/';
- fp++;
- }
- while ((dp = readdir(d))) {
- if (dirlen + strlen(dp->d_name) > PATH_MAX)
- continue;
- strcpy(fp, dp->d_name);
- if (!(stat(buf, &stat_buf) == 0 &&
- S_ISREG(stat_buf.st_mode)))
- continue;
- for (p = patterns; p->pattern; p++) {
- if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
- match[1].rm_so != -1) {
- len = match[1].rm_eo - match[1].rm_so;
- save = listing;
- listing = xrealloc(listing,
- (n + 2) * sizeof(char *));
- if (!listing) {
- if (save) {
- save[n] = NULL;
- FreeStringList(save);
- }
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- FreePatterns(patterns);
- return NULL;
- }
- listing[n] = xalloc(len + 1);
- if (!listing[n]) {
- FreeStringList(listing);
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- FreePatterns(patterns);
- return NULL;
- }
- strncpy(listing[n], dp->d_name + match[1].rm_so,
- len);
- listing[n][len] = '\0';
- n++;
- break;
- }
- }
- }
- closedir(d);
- }
- }
- }
- if (listing)
- listing[n] = NULL;
- return listing;
-}
-
-void
-LoaderFreeDirList(char **list)
-{
- FreeStringList(list);
-}
-
-static Bool
-CheckVersion(const char *module, XF86ModuleVersionInfo * data,
- const XF86ModReqInfo * req)
-{
- int vercode[4];
- char verstr[4];
- long ver = data->xf86version;
- MessageType errtype;
-
- xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n",
- data->modname ? data->modname : "UNKNOWN!",
- data->vendor ? data->vendor : "UNKNOWN!");
-
- if (ver > (4 << 24)) {
- /* 4.0.x and earlier */
- verstr[1] = verstr[3] = 0;
- verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0;
- ver >>= 5;
- verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0;
- ver >>= 5;
- vercode[2] = ver & 0x7f;
- ver >>= 7;
- vercode[1] = ver & 0x7f;
- ver >>= 7;
- vercode[0] = ver;
- xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]);
- if (vercode[2] != 0)
- xf86ErrorF(".%d", vercode[2]);
- xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2,
- data->majorversion, data->minorversion, data->patchlevel);
- } else {
- vercode[0] = ver / 10000000;
- vercode[1] = (ver / 100000) % 100;
- vercode[2] = (ver / 1000) % 100;
- vercode[3] = ver % 1000;
- xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1],
- vercode[2]);
- if (vercode[3] != 0)
- xf86ErrorF(".%d", vercode[3]);
- xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
- data->minorversion, data->patchlevel);
- }
-
- if (data->moduleclass)
- xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass);
-
- ver = -1;
- if (data->abiclass) {
- int abimaj, abimin;
- int vermaj, vermin;
-
- if (!strcmp(data->abiclass, ABI_CLASS_ANSIC))
- ver = LoaderVersionInfo.ansicVersion;
- else if (!strcmp(data->abiclass, ABI_CLASS_VIDEODRV))
- ver = LoaderVersionInfo.videodrvVersion;
- else if (!strcmp(data->abiclass, ABI_CLASS_XINPUT))
- ver = LoaderVersionInfo.xinputVersion;
- else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION))
- ver = LoaderVersionInfo.extensionVersion;
- else if (!strcmp(data->abiclass, ABI_CLASS_FONT))
- ver = LoaderVersionInfo.fontVersion;
-
- abimaj = GET_ABI_MAJOR(data->abiversion);
- abimin = GET_ABI_MINOR(data->abiversion);
- xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n",
- data->abiclass, abimaj, abimin);
- if (ver != -1) {
- vermaj = GET_ABI_MAJOR(ver);
- vermin = GET_ABI_MINOR(ver);
- if (abimaj != vermaj) {
- if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
- errtype = X_WARNING;
- else
- errtype = X_ERROR;
- xf86MsgVerb(errtype, 0,
- "module ABI major version (%d) doesn't"
- " match the server's version (%d)\n",
- abimaj, vermaj);
- if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
- return FALSE;
- } else if (abimin > vermin) {
- if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
- errtype = X_WARNING;
- else
- errtype = X_ERROR;
- xf86MsgVerb(errtype, 0,
- "module ABI minor version (%d) is "
- "newer than the server's version "
- "(%d)\n", abimin, vermin);
- if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
- return FALSE;
- }
- }
- }
-
- /* Check against requirements that the caller has specified */
- if (req) {
- if (req->majorversion != MAJOR_UNSPEC) {
- if (data->majorversion != req->majorversion) {
- xf86MsgVerb(X_WARNING, 2, "module major version (%d) "
- "doesn't match required major version (%d)\n",
- data->majorversion, req->majorversion);
- return FALSE;
- } else if (req->minorversion != MINOR_UNSPEC) {
- if (data->minorversion < req->minorversion) {
- xf86MsgVerb(X_WARNING, 2, "module minor version (%d) "
- "is less than the required minor version (%d)\n",
- data->minorversion, req->minorversion);
- return FALSE;
- } else if (data->minorversion == req->minorversion &&
- req->patchlevel != PATCH_UNSPEC) {
- if (data->patchlevel < req->patchlevel) {
- xf86MsgVerb(X_WARNING, 2, "module patch level (%d) "
- "is less than the required patch level (%d)\n",
- data->patchlevel, req->patchlevel);
- return FALSE;
- }
- }
- }
- }
- if (req->moduleclass) {
- if (!data->moduleclass ||
- strcmp(req->moduleclass, data->moduleclass)) {
- xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match "
- "the required class (%s)\n",
- data->moduleclass ? data->moduleclass : "<NONE>",
- req->moduleclass);
- return FALSE;
- }
- } else if (req->abiclass != ABI_CLASS_NONE) {
- if (!data->abiclass || strcmp(req->abiclass, data->moduleclass)) {
- xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the "
- "required ABI class (%s)\n",
- data->abiclass ? data->abiclass : "<NONE>",
- req->abiclass);
- return FALSE;
- }
- }
- if ((req->abiclass != ABI_CLASS_NONE) &&
- req->abiversion != ABI_VERS_UNSPEC) {
- int reqmaj, reqmin, maj, min;
-
- reqmaj = GET_ABI_MAJOR(req->abiversion);
- reqmin = GET_ABI_MINOR(req->abiversion);
- maj = GET_ABI_MAJOR(data->abiversion);
- min = GET_ABI_MINOR(data->abiversion);
- if (maj != reqmaj) {
- xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't "
- "match the required ABI major version (%d)\n",
- maj, reqmaj);
- return FALSE;
- }
- /* XXX Maybe this should be the other way around? */
- if (min > reqmin) {
- xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) "
- "is new than that available (%d)\n", min, reqmin);
- return FALSE;
- }
- }
- }
-#ifdef NOTYET
- if (data->checksum) {
- /* verify the checksum field */
- /* TO BE DONE */
- } else {
- ErrorF("\t*** Checksum field is 0 - this module is untrusted!\n");
- }
-#endif
- return TRUE;
-}
-
-ModuleDescPtr
-LoadSubModule(ModuleDescPtr parent, const char *module,
- const char **subdirlist, const char **patternlist,
- pointer options, const XF86ModReqInfo * modreq,
- int *errmaj, int *errmin)
-{
- ModuleDescPtr submod;
-
- xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
-
- /* Absolute module paths are not allowed here */
-#ifndef __UNIXOS2__
- if (module[0] == '/')
-#else
- if (isalpha(module[0]) && module[1] == ':' && module[2] == '/')
-#endif
- {
- xf86Msg(X_ERROR,
- "LoadSubModule: Absolute module path not permitted: \"%s\"\n",
- module);
- if (errmaj)
- *errmaj = LDR_BADUSAGE;
- if (errmin)
- *errmin = 0;
- return NULL;
- }
-
- submod = LoadModule(module, NULL, subdirlist, patternlist, options,
- modreq, errmaj, errmin);
- if (submod) {
- parent->child = AddSibling(parent->child, submod);
- submod->parent = parent;
- }
- return submod;
-}
-
-ModuleDescPtr
-DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
-{
- ModuleDescPtr ret;
-
- if (!mod)
- return NULL;
-
- ret = NewModuleDesc(mod->name);
- if (ret == NULL)
- return NULL;
-
- if (LoaderHandleOpen(mod->handle) == -1)
- return NULL;
-
- ret->filename = xstrdup(mod->filename);
- ret->identifier = mod->identifier;
- ret->client_id = mod->client_id;
- ret->in_use = mod->in_use;
- ret->handle = mod->handle;
- ret->SetupProc = mod->SetupProc;
- ret->TearDownProc = mod->TearDownProc;
- ret->TearDownData = NULL;
- ret->path = mod->path;
- ret->child = DuplicateModule(mod->child, ret);
- ret->sib = DuplicateModule(mod->sib, parent);
- ret->parent = parent;
- ret->VersionInfo = mod->VersionInfo;
-
- return ret;
-}
-
-/*
- * LoadModule: load a module
- *
- * module The module name. Normally this is not a filename but the
- * module's "canonical name. A full pathname is, however,
- * also accepted.
- * path A comma separated list of module directories.
- * subdirlist A NULL terminated list of subdirectories to search. When
- * NULL, the default "stdSubdirs" list is used. The default
- * list is also substituted for entries with value DEFAULT_LIST.
- * patternlist A NULL terminated list of regular expressions used to find
- * module filenames. Each regex should contain exactly one
- * subexpression that corresponds to the canonical module name.
- * When NULL, the default "stdPatterns" list is used. The
- * default list is also substituted for entries with value
- * DEFAULT_LIST.
- * options A NULL terminated list of Options that are passed to the
- * module's SetupProc function.
- * modreq An optional XF86ModReqInfo* containing
- * version/ABI/vendor-ABI requirements to check for when
- * loading the module. The following fields of the
- * XF86ModReqInfo struct are checked:
- * majorversion - must match the module's majorversion exactly
- * minorversion - the module's minorversion must be >= this
- * patchlevel - the module's minorversion.patchlevel must be
- * >= this. Patchlevel is ignored when
- * minorversion is not set.
- * abiclass - (string) must match the module's abiclass
- * abiversion - must be consistent with the module's
- * abiversion (major equal, minor no older)
- * moduleclass - string must match the module's moduleclass
- * string
- * "don't care" values are ~0 for numbers, and NULL for strings
- * errmaj Major error return.
- * errmin Minor error return.
- *
- */
-
-ModuleDescPtr
-LoadModule(const char *module, const char *path, const char **subdirlist,
- const char **patternlist, pointer options,
- const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
-{
- XF86ModuleData *initdata = NULL;
- char **pathlist = NULL;
- char *found = NULL;
- char *name = NULL;
- char **path_elem = NULL;
- char *p = NULL;
- ModuleDescPtr ret = NULL;
- int wasLoaded = 0;
- PatternPtr patterns = NULL;
- int noncanonical = 0;
- char *m = NULL;
-
- /*xf86Msg(X_INFO,"OS2DIAG: LoadModule: %s\n",module); */
- xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
-
- patterns = InitPatterns(patternlist);
- name = LoaderGetCanonicalName(module, patterns);
- noncanonical = (name && strcmp(module, name) != 0);
- if (noncanonical) {
- xf86ErrorFVerb(3, " (%s)\n", name);
- xf86MsgVerb(X_WARNING, 1,
- "LoadModule: given non-canonical module name \"%s\"\n",
- module);
- m = name;
- } else {
- xf86ErrorFVerb(3, "\n");
- m = (char *)module;
- }
- if (!name) {
- if (errmaj)
- *errmaj = LDR_BADUSAGE;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- ret = NewModuleDesc(name);
- if (!ret) {
- if (errmaj)
- *errmaj = LDR_NOMEM;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
-
- pathlist = InitPathList(path);
- if (!pathlist) {
- /* This could be a malloc failure too */
- if (errmaj)
- *errmaj = LDR_BADUSAGE;
- if (errmin)
- *errmin = 1;
- goto LoadModule_fail;
- }
-
- /*
- * if the module name is not a full pathname, we need to
- * check the elements in the path
- */
-#ifndef __UNIXOS2__
- if (module[0] == '/')
- found = xstrdup(module);
-#else
- /* accept a drive name here */
- if (isalpha(module[0]) && module[1] == ':' && module[2] == '/')
- found = xstrdup(module);
-#endif
- path_elem = pathlist;
- while (!found && *path_elem != NULL) {
- found = FindModule(m, *path_elem, subdirlist, patterns);
- path_elem++;
- /*
- * When the module name isn't the canonical name, search for the
- * former if no match was found for the latter.
- */
- if (!*path_elem && m == name) {
- path_elem = pathlist;
- m = (char *)module;
- }
- }
-
- /*
- * did we find the module?
- */
- if (!found) {
- xf86Msg(X_WARNING, "Warning, couldn't open module %s\n", module);
- if (errmaj)
- *errmaj = LDR_NOENT;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- ret->handle = LoaderOpen(found, name, 0, errmaj, errmin, &wasLoaded);
- if (ret->handle < 0)
- goto LoadModule_fail;
-
- ret->filename = xstrdup(found);
-
- /*
- * now check if the special data object <modulename>ModuleData is
- * present.
- */
- p = xalloc(strlen(name) + strlen("ModuleData") + 1);
- if (!p) {
- if (errmaj)
- *errmaj = LDR_NOMEM;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- strcpy(p, name);
- strcat(p, "ModuleData");
- initdata = LoaderSymbol(p);
- if (initdata) {
- ModuleSetupProc setup;
- ModuleTearDownProc teardown;
- XF86ModuleVersionInfo *vers;
-
- vers = initdata->vers;
- setup = initdata->setup;
- teardown = initdata->teardown;
-
- if (!wasLoaded) {
- if (vers) {
- if (!CheckVersion(module, vers, modreq)) {
- if (errmaj)
- *errmaj = LDR_MISMATCH;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- } else {
- xf86Msg(X_ERROR,
- "LoadModule: Module %s does not supply"
- " version information\n", module);
- if (errmaj)
- *errmaj = LDR_INVALID;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- }
- if (setup)
- ret->SetupProc = setup;
- if (teardown)
- ret->TearDownProc = teardown;
- ret->path = path;
- ret->VersionInfo = vers;
- } else {
- /* No initdata is OK for external modules */
- if (options == EXTERN_MODULE)
- goto LoadModule_exit;
-
- /* no initdata, fail the load */
- xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s "
- "data object.\n", module, p);
- if (errmaj)
- *errmaj = LDR_INVALID;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
- }
- if (ret->SetupProc) {
- ret->TearDownData = ret->SetupProc(ret, options, errmaj, errmin);
- if (!ret->TearDownData) {
- goto LoadModule_fail;
- }
- } else if (options) {
- xf86Msg(X_WARNING, "Module Options present, but no SetupProc "
- "available for %s\n", module);
- }
- goto LoadModule_exit;
-
- LoadModule_fail:
- UnloadModule(ret);
- ret = NULL;
-
- LoadModule_exit:
- FreePathList(pathlist);
- FreePatterns(patterns);
- TestFree(found);
- TestFree(name);
- TestFree(p);
-
- /*
- * If you need to do something to keep the
- * instruction cache in sync with the main
- * memory before jumping to that code, you may
- * do it here.
- */
-#ifdef __alpha__
- istream_mem_barrier();
-#endif
- return ret;
-}
-
-ModuleDescPtr
-LoadDriver(const char *module, const char *path, int handle, pointer options,
- int *errmaj, int *errmin)
-{
- return LoadModule(module, path, NULL, NULL, options, NULL, errmaj,
- errmin);
-}
-
-void
-UnloadModule(ModuleDescPtr mod)
-{
- UnloadModuleOrDriver(mod);
-}
-
-void
-UnloadDriver(ModuleDescPtr mod)
-{
- UnloadModuleOrDriver(mod);
-}
-
-static void
-UnloadModuleOrDriver(ModuleDescPtr mod)
-{
- if (mod == NULL || mod->name == NULL)
- return;
-
- xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
-
- if ((mod->TearDownProc) && (mod->TearDownData))
- mod->TearDownProc(mod->TearDownData);
- LoaderUnload(mod->handle);
-
- if (mod->child)
- UnloadModuleOrDriver(mod->child);
- if (mod->sib)
- UnloadModuleOrDriver(mod->sib);
- TestFree(mod->name);
- TestFree(mod->filename);
- xfree(mod);
-#ifdef __alpha__
- istream_mem_barrier();
-#endif
-}
-
-void
-UnloadSubModule(ModuleDescPtr mod)
-{
- if (mod == NULL || mod->name == NULL)
- return;
-
- xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
-
- if ((mod->TearDownProc) && (mod->TearDownData))
- mod->TearDownProc(mod->TearDownData);
- LoaderUnload(mod->handle);
-
- RemoveChild(mod);
-
- if (mod->child)
- UnloadModuleOrDriver(mod->child);
-
- TestFree(mod->name);
- TestFree(mod->filename);
- xfree(mod);
-}
-
-void
-FreeModuleDesc(ModuleDescPtr head)
-{
- ModuleDescPtr sibs, prev;
-
- /*
- * only free it if it's not marked as in use. In use means that it may
- * be unloaded someday, and UnloadModule or UnloadDriver will free it
- */
- if (head->in_use)
- return;
- if (head->child)
- FreeModuleDesc(head->child);
- sibs = head;
- while (sibs) {
- prev = sibs;
- sibs = sibs->sib;
- TestFree(prev->name);
- xfree(prev);
- }
-}
-
-ModuleDescPtr
-NewModuleDesc(const char *name)
-{
- ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
-
- if (mdp) {
- mdp->child = NULL;
- mdp->sib = NULL;
- mdp->parent = NULL;
- mdp->demand_next = NULL;
- mdp->name = xstrdup(name);
- mdp->filename = NULL;
- mdp->identifier = NULL;
- mdp->client_id = 0;
- mdp->in_use = 0;
- mdp->handle = -1;
- mdp->SetupProc = NULL;
- mdp->TearDownProc = NULL;
- mdp->TearDownData = NULL;
- }
-
- return (mdp);
-}
-
-ModuleDescPtr
-AddSibling(ModuleDescPtr head, ModuleDescPtr new)
-{
- new->sib = head;
- return (new);
-
-}
-
-static void
-RemoveChild(ModuleDescPtr child)
-{
- ModuleDescPtr mdp;
- ModuleDescPtr prevsib;
- ModuleDescPtr parent;
-
- if (!child->parent)
- return;
-
- parent = child->parent;
- if (parent->child == child) {
- parent->child = child->sib;
- return;
- }
-
- prevsib = parent->child;
- mdp = prevsib->sib;
- while (mdp && mdp != child) {
- prevsib = mdp;
- mdp = mdp->sib;
- }
- if (mdp == child)
- prevsib->sib = child->sib;
- return;
-}
-
-void
-LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
-{
- const char *msg;
-
- switch (errmaj) {
- case LDR_NOERROR:
- msg = "no error";
- break;
- case LDR_NOMEM:
- msg = "out of memory";
- break;
- case LDR_NOENT:
- msg = "module does not exist";
- break;
- case LDR_NOSUBENT:
- msg = "a required submodule could not be loaded";
- break;
- case LDR_NOSPACE:
- msg = "too many modules";
- break;
- case LDR_NOMODOPEN:
- msg = "open failed";
- break;
- case LDR_UNKTYPE:
- msg = "unknown module type";
- break;
- case LDR_NOLOAD:
- msg = "loader failed";
- break;
- case LDR_ONCEONLY:
- msg = "once-only module";
- break;
- case LDR_NOPORTOPEN:
- msg = "port open failed";
- break;
- case LDR_NOHARDWARE:
- msg = "no hardware found";
- break;
- case LDR_MISMATCH:
- msg = "module requirement mismatch";
- break;
- case LDR_BADUSAGE:
- msg = "invalid argument(s) to LoadModule()";
- break;
- case LDR_INVALID:
- msg = "invalid module";
- break;
- case LDR_BADOS:
- msg = "module doesn't support this OS";
- break;
- case LDR_MODSPECIFIC:
- msg = "module-specific error";
- break;
- default:
- msg = "uknown error";
- }
- if (name)
- xf86Msg(X_ERROR, "%s: Failed to load module \"%s\" (%s, %d)\n",
- name, modname, msg, errmin);
- else
- xf86Msg(X_ERROR, "Failed to load module \"%s\" (%s, %d)\n",
- modname, msg, errmin);
-}
-
-/* Given a module path or file name, return the module's canonical name */
-static char *
-LoaderGetCanonicalName(const char *modname, PatternPtr patterns)
-{
- char *str;
- const char *s;
- int len;
- PatternPtr p;
- regmatch_t match[2];
-
- /* Strip off any leading path */
- s = strrchr(modname, '/');
- if (s == NULL)
- s = modname;
- else
- s++;
-
- /* Find the first regex that is matched */
- for (p = patterns; p->pattern; p++)
- if (regexec(&p->rex, s, 2, match, 0) == 0 && match[1].rm_so != -1) {
- len = match[1].rm_eo - match[1].rm_so;
- str = xalloc(len + 1);
- if (!str)
- return NULL;
- strncpy(str, s + match[1].rm_so, len);
- str[len] = '\0';
- return str;
- }
-
- /* If there is no match, return the whole name minus the leading path */
- return xstrdup(s);
-}
-
-/*
- * Return the module version information.
- */
-unsigned long
-LoaderGetModuleVersion(ModuleDescPtr mod)
-{
- if (!mod || !mod->VersionInfo)
- return 0;
-
- return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion,
- mod->VersionInfo->minorversion,
- mod->VersionInfo->patchlevel);
-}
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
deleted file mode 100644
index c2bf47587..000000000
--- a/hw/xfree86/loader/misym.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.38 2003/10/15 16:29:04 dawes Exp $ */
-
-/*
- *
- * Copyright 1995,96 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "sym.h"
-#include "misc.h"
-#include "mi.h"
-#include "mibank.h"
-#include "miwideline.h"
-#include "mibstore.h"
-#include "cursor.h"
-#include "mipointer.h"
-#include "migc.h"
-#include "miline.h"
-#include "mizerarc.h"
-#include "mifillarc.h"
-#include "micmap.h"
-#include "mioverlay.h"
-#ifdef PANORAMIX
-#include "resource.h"
-#include "panoramiX.h"
-#endif
-#ifdef RENDER
-#include "mipict.h"
-#endif
-
-/* mi things */
-
-extern miPointerSpriteFuncRec miSpritePointerFuncs;
-
-LOOKUP miLookupTab[] = {
- SYMFUNC(miClearToBackground)
- SYMFUNC(miSendGraphicsExpose)
- SYMFUNC(miModifyPixmapHeader)
- SYMFUNC(miHandleValidateExposures)
- SYMFUNC(miSetShape)
- SYMFUNC(miChangeBorderWidth)
- SYMFUNC(miShapedWindowIn)
- SYMFUNC(miRectIn)
- SYMFUNC(miZeroClipLine)
- SYMFUNC(miZeroDashLine)
- SYMFUNC(miClearDrawable)
- SYMFUNC(miPolyPoint)
- SYMFUNC(miStepDash)
- SYMFUNC(miEmptyBox)
- SYMFUNC(miEmptyData)
- SYMFUNC(miIntersect)
- SYMFUNC(miRegionAppend)
- SYMFUNC(miRegionCopy)
- SYMFUNC(miRegionDestroy)
- SYMFUNC(miRegionEmpty)
- SYMFUNC(miRegionExtents)
- SYMFUNC(miRegionInit)
- SYMFUNC(miRegionNotEmpty)
- SYMFUNC(miRegionEqual)
- SYMFUNC(miRegionReset)
- SYMFUNC(miRegionUninit)
- SYMFUNC(miRegionValidate)
- SYMFUNC(miTranslateRegion)
- SYMFUNC(miHandleExposures)
- SYMFUNC(miPolyFillRect)
- SYMFUNC(miPolyFillArc)
- SYMFUNC(miImageGlyphBlt)
- SYMFUNC(miPolyGlyphBlt)
- SYMFUNC(miFillPolygon)
- SYMFUNC(miFillConvexPoly)
- SYMFUNC(miPolySegment)
- SYMFUNC(miZeroLine)
- SYMFUNC(miWideLine)
- SYMFUNC(miWideDash)
- SYMFUNC(miZeroPolyArc)
- SYMFUNC(miPolyArc)
- SYMFUNC(miCreateGCOps)
- SYMFUNC(miDestroyGCOps)
- SYMFUNC(miComputeCompositeClip)
- SYMFUNC(miChangeGC)
- SYMFUNC(miCopyGC)
- SYMFUNC(miDestroyGC)
- SYMFUNC(miChangeClip)
- SYMFUNC(miDestroyClip)
- SYMFUNC(miCopyClip)
- SYMFUNC(miPolyRectangle)
- SYMFUNC(miPolyText8)
- SYMFUNC(miPolyText16)
- SYMFUNC(miImageText8)
- SYMFUNC(miImageText16)
- SYMFUNC(miRegionCreate)
- SYMFUNC(miPaintWindow)
- SYMFUNC(miZeroArcSetup)
- SYMFUNC(miFillArcSetup)
- SYMFUNC(miFillArcSliceSetup)
- SYMFUNC(miFindMaxBand)
- SYMFUNC(miClipSpans)
- SYMFUNC(miAllocateGCPrivateIndex)
- SYMFUNC(miScreenInit)
- SYMFUNC(miGetScreenPixmap)
- SYMFUNC(miSetScreenPixmap)
- SYMFUNC(miPointerCurrentScreen)
- SYMFUNC(miRectAlloc)
- SYMFUNC(miInitializeBackingStore)
- SYMFUNC(miInitializeBanking)
- SYMFUNC(miModifyBanking)
- SYMFUNC(miCopyPlane)
- SYMFUNC(miCopyArea)
- SYMFUNC(miCreateScreenResources)
- SYMFUNC(miGetImage)
- SYMFUNC(miPutImage)
- SYMFUNC(miPushPixels)
- SYMFUNC(miPointerInitialize)
- SYMFUNC(miPointerPosition)
- SYMFUNC(miRecolorCursor)
- SYMFUNC(miPointerWarpCursor)
- SYMFUNC(miDCInitialize)
- SYMFUNC(miRectsToRegion)
- SYMFUNC(miPointInRegion)
- SYMFUNC(miInverse)
- SYMFUNC(miSubtract)
- SYMFUNC(miUnion)
- SYMFUNC(miPolyBuildEdge)
- SYMFUNC(miPolyBuildPoly)
- SYMFUNC(miRoundJoinClip)
- SYMFUNC(miRoundCapClip)
- SYMFUNC(miSetZeroLineBias)
- SYMFUNC(miResolveColor)
- SYMFUNC(miInitializeColormap)
- SYMFUNC(miInstallColormap)
- SYMFUNC(miUninstallColormap)
- SYMFUNC(miListInstalledColormaps)
- SYMFUNC(miExpandDirectColors)
- SYMFUNC(miCreateDefColormap)
- SYMFUNC(miClearVisualTypes)
- SYMFUNC(miSetVisualTypes)
- SYMFUNC(miSetVisualTypesAndMasks)
- SYMFUNC(miGetDefaultVisualMask)
- SYMFUNC(miSetPixmapDepths)
- SYMFUNC(miInitVisuals)
- SYMFUNC(miWindowExposures)
- SYMFUNC(miSegregateChildren)
- SYMFUNC(miClipNotify)
- SYMFUNC(miHookInitVisuals)
- SYMFUNC(miPointerAbsoluteCursor)
- SYMFUNC(miPointerGetMotionEvents)
- SYMFUNC(miPointerGetMotionBufferSize)
- SYMFUNC(miOverlayCopyUnderlay)
- SYMFUNC(miOverlaySetTransFunction)
- SYMFUNC(miOverlayCollectUnderlayRegions)
- SYMFUNC(miInitOverlay)
- SYMFUNC(miOverlayComputeCompositeClip)
- SYMFUNC(miOverlayGetPrivateClips)
- SYMFUNC(miOverlaySetRootClip)
- SYMVAR(miZeroLineScreenIndex)
- SYMVAR(miSpritePointerFuncs)
- SYMVAR(miPointerScreenIndex)
- SYMVAR(miInstalledMaps)
- SYMVAR(miInitVisualsProc)
-#ifdef RENDER
- SYMVAR(miGlyphExtents)
-#endif
-
- {0, 0}
-};
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
deleted file mode 100644
index 49f9c0d84..000000000
--- a/hw/xfree86/loader/os.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */
-
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "loaderProcs.h"
-
-/*
- * OSNAME is a standard form of the OS name that may be used by the
- * loader and by OS-specific modules.
- */
-
-#if defined(__linux__)
-#define OSNAME "linux"
-#elif defined(__FreeBSD__)
-#define OSNAME "freebsd"
-#elif defined(__NetBSD__)
-#define OSNAME "netbsd"
-#elif defined(__OpenBSD__)
-#define OSNAME "openbsd"
-#elif defined(Lynx)
-#define OSNAME "lynxos"
-#elif defined(__GNU__)
-#define OSNAME "hurd"
-#elif defined(SCO)
-#define OSNAME "sco"
-#elif defined(DGUX)
-#define OSNAME "dgux"
-#elif defined(ISC)
-#define OSNAME "isc"
-#elif defined(SVR4) && defined(sun)
-#define OSNAME "solaris"
-#elif defined(SVR4)
-#define OSNAME "svr4"
-#elif defined(__UNIXOS2__)
-#define OSNAME "os2"
-#else
-#define OSNAME "unknown"
-#endif
-
-/* Return the OS name, and run-time OS version */
-
-void
-LoaderGetOS(const char **name, int *major, int *minor, int *teeny)
-{
- if (name)
- *name = OSNAME;
-
- /* reporting runtime versions isn't supported yet */
-}
diff --git a/hw/xfree86/loader/sym.h b/hw/xfree86/loader/sym.h
deleted file mode 100644
index e937b9f08..000000000
--- a/hw/xfree86/loader/sym.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.7 2003/10/15 16:29:04 dawes Exp $ */
-
-/*
- *
- * Copyright 1995,96 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _SYM_H
-#define _SYM_H
-
-/*
- * This structure is used to pass in symbol information that is being
- * added to the symbol table.
- */
-
-typedef void (*funcptr) (void);
-
-typedef struct {
- char *symName;
- funcptr offset;
-} LOOKUP;
-
-#define SYMFUNC( func ) { #func, (funcptr)&func },
-#define SYMFUNCALIAS( name, func ) { name, (funcptr)&func },
-#define SYMVAR( var ) { #var, (funcptr)&var },
-#define SYMVARALIAS( name, var ) { name, (funcptr)&var },
-
-#endif /* _SYM_H */
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
deleted file mode 100644
index b2823c2e5..000000000
--- a/hw/xfree86/loader/xf86sym.c
+++ /dev/null
@@ -1,1148 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.242 2003/10/27 20:51:16 herrb Exp $ */
-
-/*
- *
- * Copyright 1995,96 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#define INCLUDE_DEPRECATED 1
-
-#include <fcntl.h>
-#include <setjmp.h>
-#include "sym.h"
-#include "misc.h"
-#include "mi.h"
-#include "cursor.h"
-#include "mipointer.h"
-#include "loaderProcs.h"
-#include "xf86Pci.h"
-#include "xf86.h"
-#include "xf86Resources.h"
-#include "xf86_OSproc.h"
-#include "xf86Parser.h"
-#include "xf86Config.h"
-#ifdef XINPUT
-# include "xf86Xinput.h"
-#endif
-#include "xf86OSmouse.h"
-#include "xf86OSKbd.h"
-#include "xf86xv.h"
-#include "xf86xvmc.h"
-#include "xf86cmap.h"
-#include "xf86fbman.h"
-#include "dgaproc.h"
-#include "dpmsproc.h"
-#include "vidmodeproc.h"
-#include "xf86miscproc.h"
-#include "loader.h"
-#define DONT_DEFINE_WRAPPERS
-#include "xf86_ansic.h"
-#include "xisb.h"
-#include "vbe.h"
-#ifndef __OpenBSD__
-#include "xf86sbusBus.h"
-#endif
-#include "compiler.h"
-
-#ifndef HAS_GLIBC_SIGSETJMP
-#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
- (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
- ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
-#define HAS_GLIBC_SIGSETJMP 1
-#endif
-#endif
-
-#if defined(__alpha__)
-# ifdef linux
-extern unsigned long _bus_base(void);
-extern void _outb(char val, unsigned short port);
-extern void _outw(short val, unsigned short port);
-extern void _outl(int val, unsigned short port);
-extern unsigned int _inb(unsigned short port);
-extern unsigned int _inw(unsigned short port);
-extern unsigned int _inl(unsigned short port);
-# endif
-
-# ifdef __FreeBSD__
-# include <sys/types.h>
-extern void outb(u_int32_t port, u_int8_t val);
-extern void outw(u_int32_t port, u_int16_t val);
-extern void outl(u_int32_t port, u_int32_t val);
-extern u_int8_t inb(u_int32_t port);
-extern u_int16_t inw(u_int32_t port);
-extern u_int32_t inl(u_int32_t port);
-# endif
-
-extern void *__divl(long, long);
-extern void *__reml(long, long);
-extern void *__divlu(long, long);
-extern void *__remlu(long, long);
-extern void *__divq(long, long);
-extern void *__divqu(long, long);
-extern void *__remq(long, long);
-extern void *__remqu(long, long);
-#endif
-
-#if defined(__sparc__) && defined(__FreeBSD__)
-extern float _Qp_qtos(unsigned int *);
-extern double _Qp_qtod(unsigned int *);
-extern unsigned long long _Qp_qtoux(unsigned int *);
-extern void _Qp_dtoq(unsigned int *, double);
-extern void _Qp_uitoq(unsigned int *, unsigned int);
-#endif
-
-#if defined(__GNUC__)
-#ifndef __UNIXOS2__
-extern long __div64(long, long);
-#endif
-extern long __divdf3(long, long);
-extern long __divdi3(long, long);
-extern long __divsf3(long, long);
-extern long __divsi3(long, long);
-extern long __moddi3(long, long);
-extern long __modsi3(long, long);
-
-#ifndef __UNIXOS2__
-extern long __mul64(long, long);
-#endif
-extern long __muldf3(long, long);
-extern long __muldi3(long, long);
-extern long __mulsf3(long, long);
-extern long __mulsi3(long, long);
-extern long __udivdi3(long, long);
-extern long __udivsi3(long, long);
-extern long __umoddi3(long, long);
-extern long __umodsi3(long, long);
-
-#ifndef __UNIXOS2__
-#pragma weak __div64
-#endif
-#pragma weak __divdf3
-#pragma weak __divdi3
-#pragma weak __divsf3
-#pragma weak __divsi3
-#pragma weak __moddi3
-#pragma weak __modsi3
-#ifndef __UNIXOS2__
-#pragma weak __mul64
-#endif
-#pragma weak __muldf3
-#pragma weak __muldi3
-#pragma weak __mulsf3
-#pragma weak __mulsi3
-#pragma weak __udivdi3
-#pragma weak __udivsi3
-#pragma weak __umoddi3
-#pragma weak __umodsi3
-#endif
-
-#if defined(__arm__) && defined(__linux__)
-#include <sys/io.h>
-#endif
-
-#if defined(__powerpc__) && (defined(Lynx) || defined(linux))
-void _restf14();
-void _restf17();
-void _restf18();
-void _restf19();
-void _restf20();
-void _restf22();
-void _restf23();
-void _restf24();
-void _restf25();
-void _restf26();
-void _restf27();
-void _restf28();
-void _restf29();
-void _savef14();
-void _savef17();
-void _savef18();
-void _savef19();
-void _savef20();
-void _savef22();
-void _savef23();
-void _savef24();
-void _savef25();
-void _savef26();
-void _savef27();
-void _savef28();
-void _savef29();
-
-/* even if we compile without -DNO_INLINE we still provide
- * the usual port i/o functions for module use
- */
-
-extern volatile unsigned char *ioBase;
-
-/* XXX Should get all of these from elsewhere */
-#ifndef linux
-extern void outb(IOADDRESS, unsigned char);
-extern void outw(IOADDRESS, unsigned short);
-extern void outl(IOADDRESS, unsigned int);
-extern unsigned int inb(IOADDRESS);
-extern unsigned int inw(IOADDRESS);
-extern unsigned int inl(IOADDRESS);
-#endif
-extern void stl_brx(unsigned long, volatile unsigned char *, int);
-extern void stw_brx(unsigned short, volatile unsigned char *, int);
-extern unsigned long ldl_brx(volatile unsigned char *, int);
-extern unsigned short ldw_brx(volatile unsigned char *, int);
-#endif
-
-/* XFree86 things */
-
-LOOKUP xfree86LookupTab[] = {
-
- /* Public OSlib functions */
- SYMFUNC(xf86ReadBIOS)
- SYMFUNC(xf86EnableIO)
- SYMFUNC(xf86DisableIO)
- SYMFUNC(xf86DisableInterrupts)
- SYMFUNC(xf86EnableInterrupts)
- SYMFUNC(xf86LinearVidMem)
- SYMFUNC(xf86CheckMTRR)
- SYMFUNC(xf86MapVidMem)
- SYMFUNC(xf86UnMapVidMem)
- SYMFUNC(xf86MapReadSideEffects)
- SYMFUNC(xf86GetPciDomain)
- SYMFUNC(xf86MapDomainMemory)
- SYMFUNC(xf86MapDomainIO)
- SYMFUNC(xf86ReadDomainMemory)
- SYMFUNC(xf86UDelay)
- SYMFUNC(xf86IODelay)
- SYMFUNC(xf86SlowBcopy)
-#ifdef __alpha__
- SYMFUNC(xf86SlowBCopyToBus)
- SYMFUNC(xf86SlowBCopyFromBus)
-#endif
- SYMFUNC(xf86BusToMem)
- SYMFUNC(xf86MemToBus)
- SYMFUNC(xf86OpenSerial)
- SYMFUNC(xf86SetSerial)
- SYMFUNC(xf86SetSerialSpeed)
- SYMFUNC(xf86ReadSerial)
- SYMFUNC(xf86WriteSerial)
- SYMFUNC(xf86CloseSerial)
- SYMFUNC(xf86GetErrno)
- SYMFUNC(xf86WaitForInput)
- SYMFUNC(xf86SerialSendBreak)
- SYMFUNC(xf86FlushInput)
- SYMFUNC(xf86SetSerialModemState)
- SYMFUNC(xf86GetSerialModemState)
- SYMFUNC(xf86SerialModemSetBits)
- SYMFUNC(xf86SerialModemClearBits)
- SYMFUNC(xf86LoadKernelModule)
- SYMFUNC(xf86OSMouseInit)
- SYMFUNC(xf86OSKbdPreInit)
- SYMFUNC(xf86AgpGARTSupported)
- SYMFUNC(xf86GetAGPInfo)
- SYMFUNC(xf86AcquireGART)
- SYMFUNC(xf86ReleaseGART)
- SYMFUNC(xf86AllocateGARTMemory)
- SYMFUNC(xf86BindGARTMemory)
- SYMFUNC(xf86UnbindGARTMemory)
- SYMFUNC(xf86EnableAGP)
- SYMFUNC(xf86SoundKbdBell)
- SYMFUNC(xf86GARTCloseScreen)
-#ifdef XINPUT
- /* XISB routines (Merged from Metrolink tree) */
- SYMFUNC(XisbNew)
- SYMFUNC(XisbFree)
- SYMFUNC(XisbRead)
- SYMFUNC(XisbWrite)
- SYMFUNC(XisbTrace)
- SYMFUNC(XisbBlockDuration)
-#endif
-
- /* xf86Bus.c */
- SYMFUNC(xf86CheckPciSlot)
- SYMFUNC(xf86ClaimPciSlot)
- SYMFUNC(xf86GetPciVideoInfo)
- SYMFUNC(xf86GetPciEntity)
- SYMFUNC(xf86GetPciConfigInfo)
- SYMFUNC(xf86SetPciVideo)
- SYMFUNC(xf86ClaimIsaSlot)
- SYMFUNC(xf86ClaimFbSlot)
- SYMFUNC(xf86ClaimNoSlot)
- SYMFUNC(xf86ParsePciBusString)
- SYMFUNC(xf86ComparePciBusString)
- SYMFUNC(xf86FormatPciBusNumber)
- SYMFUNC(xf86ParseIsaBusString)
- SYMFUNC(xf86EnableAccess)
- SYMFUNC(xf86SetCurrentAccess)
- SYMFUNC(xf86IsPrimaryPci)
- SYMFUNC(xf86IsPrimaryIsa)
- SYMFUNC(xf86CheckPciGAType)
- SYMFUNC(xf86PrintResList)
- SYMFUNC(xf86AddResToList)
- SYMFUNC(xf86JoinResLists)
- SYMFUNC(xf86DupResList)
- SYMFUNC(xf86FreeResList)
- SYMFUNC(xf86ClaimFixedResources)
- SYMFUNC(xf86AddEntityToScreen)
- SYMFUNC(xf86SetEntityInstanceForScreen)
- SYMFUNC(xf86RemoveEntityFromScreen)
- SYMFUNC(xf86GetEntityInfo)
- SYMFUNC(xf86GetNumEntityInstances)
- SYMFUNC(xf86GetDevFromEntity)
- SYMFUNC(xf86GetPciInfoForEntity)
- SYMFUNC(xf86SetEntityFuncs)
- SYMFUNC(xf86DeallocateResourcesForEntity)
- SYMFUNC(xf86RegisterResources)
- SYMFUNC(xf86CheckPciMemBase)
- SYMFUNC(xf86SetAccessFuncs)
- SYMFUNC(xf86IsEntityPrimary)
- SYMFUNC(xf86FixPciResource)
- SYMFUNC(xf86SetOperatingState)
- SYMFUNC(xf86EnterServerState)
- SYMFUNC(xf86GetBlock)
- SYMFUNC(xf86GetSparse)
- SYMFUNC(xf86ReallocatePciResources)
- SYMFUNC(xf86ChkConflict)
- SYMFUNC(xf86IsPciDevPresent)
- SYMFUNC(xf86FindScreenForEntity)
- SYMFUNC(xf86FindPciDeviceVendor)
- SYMFUNC(xf86FindPciClass)
-#ifdef INCLUDE_DEPRECATED
- SYMFUNC(xf86EnablePciBusMaster)
-#endif
- SYMFUNC(xf86RegisterStateChangeNotificationCallback)
- SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
- SYMFUNC(xf86NoSharedResources)
-#ifdef async
- SYMFUNC(xf86QueueAsyncEvent)
-#endif
- /* Shared Accel Accessor Functions */
- SYMFUNC(xf86GetLastScrnFlag)
- SYMFUNC(xf86SetLastScrnFlag)
- SYMFUNC(xf86IsEntityShared)
- SYMFUNC(xf86SetEntityShared)
- SYMFUNC(xf86IsEntitySharable)
- SYMFUNC(xf86SetEntitySharable)
- SYMFUNC(xf86IsPrimInitDone)
- SYMFUNC(xf86SetPrimInitDone)
- SYMFUNC(xf86ClearPrimInitDone)
- SYMFUNC(xf86AllocateEntityPrivateIndex)
- SYMFUNC(xf86GetEntityPrivate)
-
- /* xf86Configure.c */
- SYMFUNC(xf86AddDeviceToConfigure)
-
- /* xf86Cursor.c */
- SYMFUNC(xf86GetPointerScreenFuncs)
-
- /* xf86DGA.c */
- /* For drivers */
- SYMFUNC(DGAInit)
- /* For extmod */
- SYMFUNC(DGAAvailable)
- SYMFUNC(DGAActive)
- SYMFUNC(DGASetMode)
- SYMFUNC(DGASetInputMode)
- SYMFUNC(DGASelectInput)
- SYMFUNC(DGAGetViewportStatus)
- SYMFUNC(DGASetViewport)
- SYMFUNC(DGAInstallCmap)
- SYMFUNC(DGASync)
- SYMFUNC(DGAFillRect)
- SYMFUNC(DGABlitRect)
- SYMFUNC(DGABlitTransRect)
- SYMFUNC(DGAGetModes)
- SYMFUNC(DGAGetOldDGAMode)
- SYMFUNC(DGAGetModeInfo)
- SYMFUNC(DGAChangePixmapMode)
- SYMFUNC(DGACreateColormap)
- SYMFUNC(DGAOpenFramebuffer)
- SYMFUNC(DGACloseFramebuffer)
-
- /* xf86DPMS.c */
- SYMFUNC(xf86DPMSInit)
-
- /* xf86Events.c */
- SYMFUNC(SetTimeSinceLastInputEvent)
- SYMFUNC(xf86AddInputHandler)
- SYMFUNC(xf86RemoveInputHandler)
- SYMFUNC(xf86DisableInputHandler)
- SYMFUNC(xf86EnableInputHandler)
- SYMFUNC(xf86AddEnabledDevice)
- SYMFUNC(xf86RemoveEnabledDevice)
- SYMFUNC(xf86InterceptSignals)
- SYMFUNC(xf86EnableVTSwitch)
-
- /* xf86Helper.c */
- SYMFUNC(xf86AddDriver)
- SYMFUNC(xf86AddInputDriver)
- SYMFUNC(xf86DeleteDriver)
- SYMFUNC(xf86DeleteInput)
- SYMFUNC(xf86AllocateInput)
- SYMFUNC(xf86AllocateScreen)
- SYMFUNC(xf86DeleteScreen)
- SYMFUNC(xf86AllocateScrnInfoPrivateIndex)
- SYMFUNC(xf86AddPixFormat)
- SYMFUNC(xf86SetDepthBpp)
- SYMFUNC(xf86PrintDepthBpp)
- SYMFUNC(xf86SetWeight)
- SYMFUNC(xf86SetDefaultVisual)
- SYMFUNC(xf86SetGamma)
- SYMFUNC(xf86SetDpi)
- SYMFUNC(xf86SetBlackWhitePixels)
- SYMFUNC(xf86EnableDisableFBAccess)
- SYMFUNC(xf86VDrvMsgVerb)
- SYMFUNC(xf86DrvMsgVerb)
- SYMFUNC(xf86DrvMsg)
- SYMFUNC(xf86MsgVerb)
- SYMFUNC(xf86Msg)
- SYMFUNC(xf86ErrorFVerb)
- SYMFUNC(xf86ErrorF)
- SYMFUNC(xf86TokenToString)
- SYMFUNC(xf86StringToToken)
- SYMFUNC(xf86ShowClocks)
- SYMFUNC(xf86PrintChipsets)
- SYMFUNC(xf86MatchDevice)
- SYMFUNC(xf86MatchPciInstances)
- SYMFUNC(xf86MatchIsaInstances)
- SYMFUNC(xf86GetVerbosity)
- SYMFUNC(xf86GetVisualName)
- SYMFUNC(xf86GetPix24)
- SYMFUNC(xf86GetDepth)
- SYMFUNC(xf86GetWeight)
- SYMFUNC(xf86GetGamma)
- SYMFUNC(xf86GetFlipPixels)
- SYMFUNC(xf86GetServerName)
- SYMFUNC(xf86ServerIsExiting)
- SYMFUNC(xf86ServerIsOnlyDetecting)
- SYMFUNC(xf86ServerIsOnlyProbing)
- SYMFUNC(xf86ServerIsResetting)
- SYMFUNC(xf86CaughtSignal)
- SYMFUNC(xf86GetVidModeAllowNonLocal)
- SYMFUNC(xf86GetVidModeEnabled)
- SYMFUNC(xf86GetModInDevAllowNonLocal)
- SYMFUNC(xf86GetModInDevEnabled)
- SYMFUNC(xf86GetAllowMouseOpenFail)
- SYMFUNC(xf86CommonSpecialKey)
- SYMFUNC(xf86IsPc98)
- SYMFUNC(xf86DisableRandR)
- SYMFUNC(xf86GetVersion)
- SYMFUNC(xf86GetModuleVersion)
- SYMFUNC(xf86GetClocks)
- SYMFUNC(xf86SetPriority)
- SYMFUNC(xf86LoadDrvSubModule)
- SYMFUNC(xf86LoadSubModule)
- SYMFUNC(xf86LoadOneModule)
- SYMFUNC(xf86UnloadSubModule)
- SYMFUNC(xf86LoaderCheckSymbol)
- SYMFUNC(xf86LoaderRefSymLists)
- SYMFUNC(xf86LoaderRefSymbols)
- SYMFUNC(xf86LoaderReqSymLists)
- SYMFUNC(xf86LoaderReqSymbols)
- SYMFUNC(xf86SetBackingStore)
- SYMFUNC(xf86SetSilkenMouse)
- /* SYMFUNC(xf86NewSerialNumber) */
- SYMFUNC(xf86FindXvOptions)
- SYMFUNC(xf86GetOS)
- SYMFUNC(xf86ConfigPciEntity)
- SYMFUNC(xf86ConfigIsaEntity)
- SYMFUNC(xf86ConfigFbEntity)
- SYMFUNC(xf86ConfigActivePciEntity)
- SYMFUNC(xf86ConfigActiveIsaEntity)
- SYMFUNC(xf86ConfigPciEntityInactive)
- SYMFUNC(xf86ConfigIsaEntityInactive)
- SYMFUNC(xf86IsScreenPrimary)
- SYMFUNC(xf86RegisterRootWindowProperty)
- SYMFUNC(xf86IsUnblank)
- SYMFUNC(xf86AddModuleInfo)
- SYMFUNC(xf86DeleteModuleInfo)
-
-#if defined(__sparc__) && !defined(__OpenBSD__)
- /* xf86sbusBus.c */
- SYMFUNC(xf86MatchSbusInstances)
- SYMFUNC(xf86GetSbusInfoForEntity)
- SYMFUNC(xf86GetEntityForSbusInfo)
- SYMFUNC(xf86SbusUseBuiltinMode)
- SYMFUNC(xf86MapSbusMem)
- SYMFUNC(xf86UnmapSbusMem)
- SYMFUNC(xf86SbusHideOsHwCursor)
- SYMFUNC(xf86SbusSetOsHwCursorCmap)
- SYMFUNC(xf86SbusHandleColormaps)
- SYMFUNC(sparcPromInit)
- SYMFUNC(sparcPromClose)
- SYMFUNC(sparcPromGetProperty)
- SYMFUNC(sparcPromGetBool)
-#endif
-
- /* xf86Init.c */
- SYMFUNC(xf86GetPixFormat)
- SYMFUNC(xf86GetBppFromDepth)
-
- /* xf86Mode.c */
- SYMFUNC(xf86GetNearestClock)
- SYMFUNC(xf86ModeStatusToString)
- SYMFUNC(xf86LookupMode)
- SYMFUNC(xf86CheckModeForMonitor)
- SYMFUNC(xf86InitialCheckModeForDriver)
- SYMFUNC(xf86CheckModeForDriver)
- SYMFUNC(xf86ValidateModes)
- SYMFUNC(xf86DeleteMode)
- SYMFUNC(xf86PruneDriverModes)
- SYMFUNC(xf86SetCrtcForModes)
- SYMFUNC(xf86PrintModes)
- SYMFUNC(xf86ShowClockRanges)
-
- /* xf86Option.c */
- SYMFUNC(xf86CollectOptions)
- SYMFUNC(xf86CollectInputOptions)
- /* Merging of XInput stuff */
- SYMFUNC(xf86AddNewOption)
- SYMFUNC(xf86NewOption)
- SYMFUNC(xf86NextOption)
- SYMFUNC(xf86OptionListCreate)
- SYMFUNC(xf86OptionListMerge)
- SYMFUNC(xf86OptionListFree)
- SYMFUNC(xf86OptionName)
- SYMFUNC(xf86OptionValue)
- SYMFUNC(xf86OptionListReport)
- SYMFUNC(xf86SetIntOption)
- SYMFUNC(xf86SetRealOption)
- SYMFUNC(xf86SetStrOption)
- SYMFUNC(xf86SetBoolOption)
- SYMFUNC(xf86CheckIntOption)
- SYMFUNC(xf86CheckRealOption)
- SYMFUNC(xf86CheckStrOption)
- SYMFUNC(xf86CheckBoolOption)
- SYMFUNC(xf86ReplaceIntOption)
- SYMFUNC(xf86ReplaceRealOption)
- SYMFUNC(xf86ReplaceStrOption)
- SYMFUNC(xf86ReplaceBoolOption)
- SYMFUNC(xf86FindOption)
- SYMFUNC(xf86FindOptionValue)
- SYMFUNC(xf86MarkOptionUsed)
- SYMFUNC(xf86MarkOptionUsedByName)
- SYMFUNC(xf86CheckIfOptionUsed)
- SYMFUNC(xf86CheckIfOptionUsedByName)
- SYMFUNC(xf86ShowUnusedOptions)
- SYMFUNC(xf86ProcessOptions)
- SYMFUNC(xf86TokenToOptinfo)
- SYMFUNC(xf86TokenToOptName)
- SYMFUNC(xf86IsOptionSet)
- SYMFUNC(xf86GetOptValString)
- SYMFUNC(xf86GetOptValInteger)
- SYMFUNC(xf86GetOptValULong)
- SYMFUNC(xf86GetOptValReal)
- SYMFUNC(xf86GetOptValFreq)
- SYMFUNC(xf86GetOptValBool)
- SYMFUNC(xf86ReturnOptValBool)
- SYMFUNC(xf86NameCmp)
- SYMFUNC(xf86InitValuatorAxisStruct)
- SYMFUNC(xf86InitValuatorDefaults)
-
- /* xf86fbman.c */
- SYMFUNC(xf86InitFBManager)
- SYMFUNC(xf86InitFBManagerArea)
- SYMFUNC(xf86InitFBManagerRegion)
- SYMFUNC(xf86InitFBManagerLinear)
- SYMFUNC(xf86RegisterFreeBoxCallback)
- SYMFUNC(xf86FreeOffscreenArea)
- SYMFUNC(xf86AllocateOffscreenArea)
- SYMFUNC(xf86AllocateLinearOffscreenArea)
- SYMFUNC(xf86ResizeOffscreenArea)
- SYMFUNC(xf86FBManagerRunning)
- SYMFUNC(xf86QueryLargestOffscreenArea)
- SYMFUNC(xf86PurgeUnlockedOffscreenAreas)
- SYMFUNC(xf86RegisterOffscreenManager)
- SYMFUNC(xf86AllocateOffscreenLinear)
- SYMFUNC(xf86ResizeOffscreenLinear)
- SYMFUNC(xf86QueryLargestOffscreenLinear)
- SYMFUNC(xf86FreeOffscreenLinear)
-
- /* xf86cmap.c */
- SYMFUNC(xf86HandleColormaps)
-
- /* xf86xv.c */
- SYMFUNC(xf86XVScreenInit)
- SYMFUNC(xf86XVRegisterGenericAdaptorDriver)
- SYMFUNC(xf86XVListGenericAdaptors)
- SYMFUNC(xf86XVRegisterOffscreenImages)
- SYMFUNC(xf86XVQueryOffscreenImages)
- SYMFUNC(xf86XVAllocateVideoAdaptorRec)
- SYMFUNC(xf86XVFreeVideoAdaptorRec)
- SYMFUNC(xf86XVFillKeyHelper)
- SYMFUNC(xf86XVClipVideoHelper)
- SYMFUNC(xf86XVCopyYUV12ToPacked)
- SYMFUNC(xf86XVCopyPacked)
-
- /* xf86xvmc.c */
- SYMFUNC(xf86XvMCScreenInit)
- SYMFUNC(xf86XvMCCreateAdaptorRec)
- SYMFUNC(xf86XvMCDestroyAdaptorRec)
-
- /* xf86VidMode.c */
- SYMFUNC(VidModeExtensionInit)
-#ifdef XF86VIDMODE
- SYMFUNC(VidModeGetCurrentModeline)
- SYMFUNC(VidModeGetFirstModeline)
- SYMFUNC(VidModeGetNextModeline)
- SYMFUNC(VidModeDeleteModeline)
- SYMFUNC(VidModeZoomViewport)
- SYMFUNC(VidModeGetViewPort)
- SYMFUNC(VidModeSetViewPort)
- SYMFUNC(VidModeSwitchMode)
- SYMFUNC(VidModeLockZoom)
- SYMFUNC(VidModeGetMonitor)
- SYMFUNC(VidModeGetNumOfClocks)
- SYMFUNC(VidModeGetClocks)
- SYMFUNC(VidModeCheckModeForMonitor)
- SYMFUNC(VidModeCheckModeForDriver)
- SYMFUNC(VidModeSetCrtcForMode)
- SYMFUNC(VidModeAddModeline)
- SYMFUNC(VidModeGetDotClock)
- SYMFUNC(VidModeGetNumOfModes)
- SYMFUNC(VidModeSetGamma)
- SYMFUNC(VidModeGetGamma)
- SYMFUNC(VidModeCreateMode)
- SYMFUNC(VidModeCopyMode)
- SYMFUNC(VidModeGetModeValue)
- SYMFUNC(VidModeSetModeValue)
- SYMFUNC(VidModeGetMonitorValue)
- SYMFUNC(VidModeSetGammaRamp)
- SYMFUNC(VidModeGetGammaRamp)
- SYMFUNC(VidModeGetGammaRampSize)
-#endif
-
- /* xf86Versions.c */
- SYMFUNC(xf86GetBuiltinInterfaceVersion)
- SYMFUNC(xf86RegisterBuiltinInterfaceVersion)
-
- /* xf86MiscExt.c */
-#ifdef XF86MISC
- SYMFUNC(MiscExtGetMouseSettings)
- SYMFUNC(MiscExtGetMouseValue)
- SYMFUNC(MiscExtSetMouseValue)
- SYMFUNC(MiscExtSetMouseDevice)
- SYMFUNC(MiscExtGetKbdSettings)
- SYMFUNC(MiscExtGetKbdValue)
- SYMFUNC(MiscExtSetKbdValue)
- SYMFUNC(MiscExtSetGrabKeysState)
- SYMFUNC(MiscExtCreateStruct)
- SYMFUNC(MiscExtDestroyStruct)
- SYMFUNC(MiscExtApply)
- SYMFUNC(MiscExtGetFilePaths)
- SYMFUNC(MiscExtPassMessage)
-#endif
-
- /* Misc */
- SYMFUNC(GetTimeInMillis)
-
- /* xf86Xinput.c */
-#ifdef XINPUT
- SYMFUNC(xf86ProcessCommonOptions)
- SYMFUNC(xf86IsCorePointer)
- SYMFUNC(xf86PostMotionEvent)
- SYMFUNC(xf86PostProximityEvent)
- SYMFUNC(xf86PostButtonEvent)
- SYMFUNC(xf86PostKeyEvent)
- SYMFUNC(xf86PostKeyboardEvent)
- SYMFUNC(xf86GetMotionEvents)
- SYMFUNC(xf86MotionHistoryAllocate)
- SYMFUNC(xf86FirstLocalDevice)
- SYMFUNC(xf86eqEnqueue)
-/* The following segment merged from Metrolink tree */
- SYMFUNC(xf86XInputSetScreen)
- SYMFUNC(xf86ScaleAxis)
- SYMFUNC(xf86XInputSetSendCoreEvents)
-/* End merged segment */
-#endif
- SYMFUNC(DPMSGet)
- SYMFUNC(DPMSSet)
- SYMFUNC(DPMSSupported)
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
- SYMFUNC(xf86Break1)
- SYMFUNC(xf86Break2)
- SYMFUNC(xf86Break3)
- SYMFUNC(xf86SPTimestamp)
- SYMFUNC(xf86STimestamp)
-#endif
-
- SYMFUNC(pciFindFirst)
- SYMFUNC(pciFindNext)
- SYMFUNC(pciWriteByte)
- SYMFUNC(pciWriteWord)
- SYMFUNC(pciWriteLong)
- SYMFUNC(pciReadByte)
- SYMFUNC(pciReadWord)
- SYMFUNC(pciReadLong)
- SYMFUNC(pciSetBitsLong)
- SYMFUNC(pciTag)
- SYMFUNC(pciBusAddrToHostAddr)
- SYMFUNC(pciHostAddrToBusAddr)
- SYMFUNC(xf86MapPciMem)
- SYMFUNC(xf86scanpci)
- SYMFUNC(xf86ReadPciBIOS)
-
- /* Loader functions */
- SYMFUNC(LoaderDefaultFunc)
- SYMFUNC(LoadSubModule)
- SYMFUNC(DuplicateModule)
- SYMFUNC(LoaderErrorMsg)
- SYMFUNC(LoaderCheckUnresolved)
- SYMFUNC(LoadExtension)
- SYMFUNC(LoadFont)
- SYMFUNC(LoaderReqSymbols)
- SYMFUNC(LoaderReqSymLists)
- SYMFUNC(LoaderRefSymbols)
- SYMFUNC(LoaderRefSymLists)
- SYMFUNC(UnloadSubModule)
- SYMFUNC(LoaderSymbol)
- SYMFUNC(LoaderListDirs)
- SYMFUNC(LoaderFreeDirList)
- SYMFUNC(LoaderGetOS)
-
- /*
- * These are our own interfaces to libc functions.
- */
- SYMFUNC(xf86abort)
- SYMFUNC(xf86abs)
- SYMFUNC(xf86acos)
- SYMFUNC(xf86asin)
- SYMFUNC(xf86atan)
- SYMFUNC(xf86atan2)
- SYMFUNC(xf86atof)
- SYMFUNC(xf86atoi)
- SYMFUNC(xf86atol)
- SYMFUNC(xf86bsearch)
- SYMFUNC(xf86ceil)
- SYMFUNC(xf86calloc)
- SYMFUNC(xf86clearerr)
- SYMFUNC(xf86close)
- SYMFUNC(xf86cos)
- SYMFUNC(xf86exit)
- SYMFUNC(xf86exp)
- SYMFUNC(xf86fabs)
- SYMFUNC(xf86fclose)
- SYMFUNC(xf86feof)
- SYMFUNC(xf86ferror)
- SYMFUNC(xf86fflush)
- SYMFUNC(xf86fgetc)
- SYMFUNC(xf86fgetpos)
- SYMFUNC(xf86fgets)
- SYMFUNC(xf86finite)
- SYMFUNC(xf86floor)
- SYMFUNC(xf86fmod)
- SYMFUNC(xf86fopen)
- SYMFUNC(xf86fprintf)
- SYMFUNC(xf86fputc)
- SYMFUNC(xf86fputs)
- SYMFUNC(xf86fread)
- SYMFUNC(xf86free)
- SYMFUNC(xf86freopen)
- SYMFUNC(xf86frexp)
- SYMFUNC(xf86fscanf)
- SYMFUNC(xf86fseek)
- SYMFUNC(xf86fsetpos)
- SYMFUNC(xf86ftell)
- SYMFUNC(xf86fwrite)
- SYMFUNC(xf86getc)
- SYMFUNC(xf86getenv)
- SYMFUNC(xf86getpagesize)
- SYMFUNC(xf86hypot)
- SYMFUNC(xf86ioctl)
- SYMFUNC(xf86isalnum)
- SYMFUNC(xf86isalpha)
- SYMFUNC(xf86iscntrl)
- SYMFUNC(xf86isdigit)
- SYMFUNC(xf86isgraph)
- SYMFUNC(xf86islower)
- SYMFUNC(xf86isprint)
- SYMFUNC(xf86ispunct)
- SYMFUNC(xf86isspace)
- SYMFUNC(xf86isupper)
- SYMFUNC(xf86isxdigit)
- SYMFUNC(xf86labs)
- SYMFUNC(xf86ldexp)
- SYMFUNC(xf86log)
- SYMFUNC(xf86log10)
- SYMFUNC(xf86lseek)
- SYMFUNC(xf86malloc)
- SYMFUNC(xf86memchr)
- SYMFUNC(xf86memcmp)
- SYMFUNC(xf86memcpy)
- /*
- * Some compilers generate calls to memcpy to handle structure copies
- * or run-time initializations.
- */
- SYMFUNCALIAS("memcpy", xf86memcpy)
- SYMFUNC(xf86memset)
- /*
- * Some compilers generate calls to memset to handle aggregate
- * initializations.
- */
- SYMFUNCALIAS("memset", xf86memset)
- SYMFUNC(xf86memmove)
- SYMFUNC(xf86mmap)
- SYMFUNC(xf86modf)
- SYMFUNC(xf86munmap)
- SYMFUNC(xf86open)
- SYMFUNC(xf86perror)
- SYMFUNC(xf86pow)
- SYMFUNC(xf86printf)
- SYMFUNC(xf86qsort)
- SYMFUNC(xf86read)
- SYMFUNC(xf86realloc)
- SYMFUNC(xf86remove)
- SYMFUNC(xf86rename)
- SYMFUNC(xf86rewind)
- SYMFUNC(xf86setbuf)
- SYMFUNC(xf86setvbuf)
- SYMFUNC(xf86sin)
- SYMFUNC(xf86snprintf)
- SYMFUNC(xf86sprintf)
- SYMFUNC(xf86sqrt)
- SYMFUNC(xf86sscanf)
- SYMFUNC(xf86strcat)
- SYMFUNC(xf86strcmp)
- SYMFUNC(xf86strcasecmp)
- SYMFUNC(xf86strcpy)
- SYMFUNC(xf86strcspn)
- SYMFUNC(xf86strerror)
- SYMFUNC(xf86strlcat)
- SYMFUNC(xf86strlcpy)
- SYMFUNC(xf86strlen)
- SYMFUNC(xf86strncasecmp)
- SYMFUNC(xf86strncat)
- SYMFUNC(xf86strncmp)
- SYMFUNC(xf86strncpy)
- SYMFUNC(xf86strpbrk)
- SYMFUNC(xf86strchr)
- SYMFUNC(xf86strrchr)
- SYMFUNC(xf86strspn)
- SYMFUNC(xf86strstr)
- SYMFUNC(xf86strtod)
- SYMFUNC(xf86strtok)
- SYMFUNC(xf86strtol)
- SYMFUNC(xf86strtoul)
- SYMFUNC(xf86tan)
- SYMFUNC(xf86tmpfile)
- SYMFUNC(xf86tolower)
- SYMFUNC(xf86toupper)
- SYMFUNC(xf86ungetc)
- SYMFUNC(xf86vfprintf)
- SYMFUNC(xf86vsnprintf)
- SYMFUNC(xf86vsprintf)
- SYMFUNC(xf86write)
-
- /* non-ANSI C functions */
- SYMFUNC(xf86opendir)
- SYMFUNC(xf86closedir)
- SYMFUNC(xf86readdir)
- SYMFUNC(xf86rewinddir)
- SYMFUNC(xf86ffs)
- SYMFUNC(xf86strdup)
- SYMFUNC(xf86bzero)
- SYMFUNC(xf86usleep)
- SYMFUNC(xf86execl)
-
- SYMFUNC(xf86getsecs)
- SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
-
- /* Some of these were added for DRI support. */
- SYMFUNC(xf86stat)
- SYMFUNC(xf86fstat)
- SYMFUNC(xf86access)
- SYMFUNC(xf86geteuid)
- SYMFUNC(xf86getegid)
- SYMFUNC(xf86getpid)
- SYMFUNC(xf86mknod)
- SYMFUNC(xf86chmod)
- SYMFUNC(xf86chown)
- SYMFUNC(xf86sleep)
- SYMFUNC(xf86mkdir)
- SYMFUNC(xf86shmget)
- SYMFUNC(xf86shmat)
- SYMFUNC(xf86shmdt)
- SYMFUNC(xf86shmctl)
-#ifdef HAS_GLIBC_SIGSETJMP
- SYMFUNC(xf86setjmp)
- SYMFUNC(xf86setjmp0)
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
- SYMFUNCALIAS("xf86setjmp1", __sigsetjmp)
-#else
- SYMFUNC(xf86setjmp1) /* For libc5 */
-#endif
-#else
- SYMFUNCALIAS("xf86setjmp", setjmp)
- SYMFUNCALIAS("xf86setjmp0", setjmp)
- SYMFUNC(xf86setjmp1)
-#endif
- SYMFUNCALIAS("xf86longjmp", longjmp)
- SYMFUNC(xf86getjmptype)
- SYMFUNC(xf86setjmp1_arg2)
- SYMFUNC(xf86setjmperror)
-#ifdef XF86DRI
- /*
- * These may have more general uses, but for now, they are only used
- * by the DRI. Loading them only when the DRI is built may make porting
- * (the non-DRI portions of the X server) easier.
- */
- SYMFUNC(xf86InstallSIGIOHandler)
- SYMFUNC(xf86RemoveSIGIOHandler)
-# if defined(__alpha__) && defined(linux)
- SYMFUNC(_bus_base)
-# endif
-#endif
- SYMFUNC(xf86BlockSIGIO)
- SYMFUNC(xf86UnblockSIGIO)
-
-#if defined(__alpha__)
- SYMFUNC(__divl)
- SYMFUNC(__reml)
- SYMFUNC(__divlu)
- SYMFUNC(__remlu)
- SYMFUNC(__divq)
- SYMFUNC(__divqu)
- SYMFUNC(__remq)
- SYMFUNC(__remqu)
-
-# ifdef linux
- SYMFUNC(_outw)
- SYMFUNC(_outb)
- SYMFUNC(_outl)
- SYMFUNC(_inb)
- SYMFUNC(_inw)
- SYMFUNC(_inl)
- SYMFUNC(_alpha_outw)
- SYMFUNC(_alpha_outb)
- SYMFUNC(_alpha_outl)
- SYMFUNC(_alpha_inb)
- SYMFUNC(_alpha_inw)
- SYMFUNC(_alpha_inl)
-# else
- SYMFUNC(outw)
- SYMFUNC(outb)
- SYMFUNC(outl)
- SYMFUNC(inb)
- SYMFUNC(inw)
- SYMFUNC(inl)
-# endif
- SYMFUNC(xf86ReadMmio32)
- SYMFUNC(xf86ReadMmio16)
- SYMFUNC(xf86ReadMmio8)
- SYMFUNC(xf86WriteMmio32)
- SYMFUNC(xf86WriteMmio16)
- SYMFUNC(xf86WriteMmio8)
- SYMFUNC(xf86WriteMmioNB32)
- SYMFUNC(xf86WriteMmioNB16)
- SYMFUNC(xf86WriteMmioNB8)
-#endif
-#if defined(sun) && defined(SVR4)
- SYMFUNC(inb)
- SYMFUNC(inw)
- SYMFUNC(inl)
- SYMFUNC(outb)
- SYMFUNC(outw)
- SYMFUNC(outl)
-#endif
-#if defined(__powerpc__) && !defined(__OpenBSD__)
- SYMFUNC(inb)
- SYMFUNC(inw)
- SYMFUNC(inl)
- SYMFUNC(outb)
- SYMFUNC(outw)
- SYMFUNC(outl)
-# if defined(NO_INLINE) || defined(Lynx)
- SYMFUNC(mem_barrier)
- SYMFUNC(ldl_u)
- SYMFUNC(eieio)
- SYMFUNC(ldl_brx)
- SYMFUNC(ldw_brx)
- SYMFUNC(stl_brx)
- SYMFUNC(stw_brx)
- SYMFUNC(ldq_u)
- SYMFUNC(ldw_u)
- SYMFUNC(stl_u)
- SYMFUNC(stq_u)
- SYMFUNC(stw_u)
- SYMFUNC(write_mem_barrier)
-# endif
-# if defined(Lynx)
- SYMFUNC(_restf14)
- SYMFUNC(_restf17)
- SYMFUNC(_restf18)
- SYMFUNC(_restf19)
- SYMFUNC(_restf20)
- SYMFUNC(_restf22)
- SYMFUNC(_restf23)
- SYMFUNC(_restf24)
- SYMFUNC(_restf25)
- SYMFUNC(_restf26)
- SYMFUNC(_restf27)
- SYMFUNC(_restf28)
- SYMFUNC(_restf29)
- SYMFUNC(_savef14)
- SYMFUNC(_savef17)
- SYMFUNC(_savef18)
- SYMFUNC(_savef19)
- SYMFUNC(_savef20)
- SYMFUNC(_savef22)
- SYMFUNC(_savef23)
- SYMFUNC(_savef24)
- SYMFUNC(_savef25)
- SYMFUNC(_savef26)
- SYMFUNC(_savef27)
- SYMFUNC(_savef28)
- SYMFUNC(_savef29)
-# endif
-# if PPCIO_DEBUG
- SYMFUNC(debug_inb)
- SYMFUNC(debug_inw)
- SYMFUNC(debug_inl)
- SYMFUNC(debug_outb)
- SYMFUNC(debug_outw)
- SYMFUNC(debug_outl)
-# endif
-#endif
-#if defined(__GNUC__)
-#ifndef __UNIXOS2__
- SYMFUNC(__div64)
-#endif
- SYMFUNC(__divdf3)
- SYMFUNC(__divdi3)
- SYMFUNC(__divsf3)
- SYMFUNC(__divsi3)
- SYMFUNC(__moddi3)
- SYMFUNC(__modsi3)
-#ifndef __UNIXOS2__
- SYMFUNC(__mul64)
-#endif
- SYMFUNC(__muldf3)
- SYMFUNC(__muldi3)
- SYMFUNC(__mulsf3)
- SYMFUNC(__mulsi3)
- SYMFUNC(__udivdi3)
- SYMFUNC(__udivsi3)
- SYMFUNC(__umoddi3)
- SYMFUNC(__umodsi3)
-#endif
-#if defined(__ia64__)
- SYMFUNC(_outw)
- SYMFUNC(_outb)
- SYMFUNC(_outl)
- SYMFUNC(_inb)
- SYMFUNC(_inw)
- SYMFUNC(_inl)
-#endif
-#if defined(__arm__)
- SYMFUNC(outw)
- SYMFUNC(outb)
- SYMFUNC(outl)
- SYMFUNC(inb)
- SYMFUNC(inw)
- SYMFUNC(inl)
-#endif
-
-#ifdef __FreeBSD__
-#if defined(__sparc__)
- SYMFUNC(_Qp_qtos)
- SYMFUNC(_Qp_qtod)
- SYMFUNC(_Qp_qtoux)
- SYMFUNC(_Qp_uitoq)
- SYMFUNC(_Qp_dtoq)
-#endif
-#endif
-
- /* Some variables. */
-
- SYMVAR(xf86stdin)
- SYMVAR(xf86stdout)
- SYMVAR(xf86stderr)
- SYMVAR(xf86errno)
- SYMVAR(xf86HUGE_VAL)
-
- /* General variables (from xf86.h) */
- SYMVAR(xf86ScreenIndex)
- SYMVAR(xf86PixmapIndex)
- SYMVAR(xf86Screens)
- SYMVAR(byte_reversed)
- SYMVAR(xf86inSuspend)
- /* debugging variables */
-#ifdef BUILDDEBUG
- SYMVAR(xf86p8bit)
- SYMVAR(xf86DummyVar1)
- SYMVAR(xf86DummyVar2)
- SYMVAR(xf86DummyVar3)
-#endif
-
-#ifdef async
- SYMVAR(xf86CurrentScreen)
-#endif
- /* predefined resource lists from xf86Bus.h */
- SYMVAR(resVgaExclusive)
- SYMVAR(resVgaShared)
- SYMVAR(resVgaMemShared)
- SYMVAR(resVgaIoShared)
- SYMVAR(resVgaUnusedExclusive)
- SYMVAR(resVgaUnusedShared)
- SYMVAR(resVgaSparseExclusive)
- SYMVAR(resVgaSparseShared)
- SYMVAR(res8514Exclusive)
- SYMVAR(res8514Shared)
- SYMVAR(PciAvoid)
-
-#if defined(__powerpc__) && (!defined(NO_INLINE) || defined(Lynx))
- SYMVAR(ioBase)
-#endif
-
- /* Globals from xf86Globals.c and xf86Priv.h */
- SYMVAR(xf86ConfigDRI)
-
- /* Globals from xf86Configure.c */
- SYMVAR(ConfiguredMonitor)
-
- /* Pci.c */
- SYMVAR(pciNumBuses)
-
- {0, 0}
-};
diff --git a/hw/xfree86/os-support/README.OS-lib b/hw/xfree86/os-support/README.OS-lib
deleted file mode 100644
index 27af6b3f2..000000000
--- a/hw/xfree86/os-support/README.OS-lib
+++ /dev/null
@@ -1,506 +0,0 @@
-
- README for XFree86 OS-support Layer
- -----------------------------------
-
-Contents
---------
- 1) Overview
- 2) Directory Layout
- 3) Adding a new OS
- 4) OS Support API
-
-1 - Overview
-------------
- This directory contains the OS support layer functions for the XFree86
-servers. In addition, some miscellaneous server support functions (not
-OS-dependent) are included here, to take advantage of the fact that this
-library comes last in the linking order.
-
-Most of the functionality required to support a new OS is encapsulated in
-this library. It is hoped that all OS-specific details can be encapsulated,
-but that is not likely ever to be completely possible. Hence some minor
-changes will wind up being made in other parts of the server. The major
-design principles for this library are maintainability, readability, and
-portability. Sometimes these goals conflict; some somewhat arbitrary choices
-have been made in implementation.
-
-2 - Directory Layout
---------------------
- os-support/ Contains headers and documentation; no code
- misc/ Non-OS-specific miscellaneous functions that
- fit best into the link architecture this way.
- shared/ Contains files with functions used by more than one
- OS. These are symlinked into the OS subdirectories
- at build time via Imakefile rules. This is alway
- preferable to reproducing functions in more than one
- OS library.
- bsd/ OS support for the 386BSD/NetBSD/FreeBSD operating
- systems.
- bsdi/ OS support for the BSD/386 operating system.
- linux/ OS support for the Linux operating system.
- os2/ OS support for OS/2 2.11 and OS/2 Warp
- sco/ OS support for the SCO SVR3.x operating system.
- solx86/ OS support for the Solaris x86 operating system.
- sysv/ OS support for all SVR4.0 and SVR4.2, and for
- ISC and AT&T SVR3.2 operating systems.
-
-3 - Adding A New OS
--------------------
- Adding a support for a new operating system entails implementing all of
-the functions described in the API below. Many of these functions are no-ops
-for many operating systems, and appropriate files with dummy declarations are
-available in the 'shared' subdirectory.
-
-If your OS is sufficiently similar to an existing OS, you can make use of
-the existing subdirectory. One of the reasons for implementing this OS
-library was the unmaintainability of the spagetti-#ifdef code that existed
-before. You should try to avoid cluttering the code with #ifdef's. If
-you find that the subdirectory is getting cluttered, split off into a
-seperate subdirectory (e.g. as was done for SCO, rather than cluttering
-the 'sysv' subdirectory). You can split functions out of an existing
-subdirectory into the 'shared' subdirectory, if that is appropriate. Just
-remember to update the Imakefile for the old subdirectory.
-
-You will still likely have to make some small changes to other parts of
-the server. You should not put OS-specific #define's or #include's anywhere
-else in the server. These should all go in the "xf86_OSlib.h" header file
-in this directory.
-
-4 - OS Support API
------------------
-void xf86OpenConsole(void)
-{
- /*
- * Open console device, activate VTs, etc, etc. Fill in requisite
- * pieces of xf86Info. Most of this code comes from xf86Init.c
- */
-}
-
-void xf86CloseConsole(void)
-{
- /*
- * Close console at server exit.
- */
-}
-
-Bool xf86VTSwitchPending(void)
-{
- /*
- * Returns TRUE iff there is a VT switch operation pending for
- * the server. In the USL VT model, this is indicated via a
- * signal handler. Should return FALSE always for OSs without
- * VTs.
- */
-}
-
-Bool xf86VTSwitchAway(void)
-{
- /*
- * Handles the OS-specific action for switching away from the active
- * VT. Returns FALSE if the switch away fails. Should return
- * FALSE always for OSs without VTs (then again, this function
- * should never be called in that case).
- */
-}
-
-Bool xf86VTSwitchTo(void)
-{
- /*
- * Handles the OS-specific action for switching to the active VT.
- * Returns FALSE if the switch to fails. Should return TRUE
- * always for OSs without VTs (then again, this function should
- * never be called in that case).
- */
-}
-
-Bool xf86LinearVidMem(void)
-{
- /*
- * Returns TRUE if the OS supports mapping linear frame buffers
- * (ie memory at addresses above physical memory).
- */
-}
-
-pointer xf86MapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- /*
- * Handle mapping the video memory. Returns (pointer *)0 for
- * failure; causes server exit. It is allowable to call FatalError()
- * from inside this function and exit directly.
- */
-}
-
-void xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- /*
- * Handle unmapping the video memory. This should undo what
- * xf86MapVidMem() does. Base is a pointer obtained from
- * a previous call to xf86MapVidMem().
- */
-}
-
-void xf86MapDisplay(int ScreenNum, int Region)
-{
- /*
- * For OSs that require the screen be mapped when entering a VT.
- * A dummy function will be defined for OSs that don't require
- * this (or don't have VTs at all).
- */
-}
-
-void xf86UnMapDisplay(int ScreenNum, int Region)
-{
- /*
- * For Os that require that the screen be unmapped when leaving a
- * VT. A dummy function will be defined for OSs that don't require
- * this (or don't have VTs at all).
- */
-}
-
-int xf86ReadBIOS(unsigned long Base, unsigned long Offset,
- unsigned char *Buf, int Len)
-{
- /*
- * Read Len bytes from the BIOS at address Base, offset Offset,
- * into buffer Buf. Returns -1 for failure or if the OS does
- * not support reading the BIOS. This causes a driver probe
- * to fail, but does not cause the server to abort.
- */
-}
-
-
-void xf86EnableIOPorts(int ScreenNum)
-{
- /*
- * Enables I/O permissions. The OS layer should
- * enable all I/O port access.
- */
-}
-
-void xf86DisableIOPorts(int ScreenNum)
-{
- /*
- * Disables I/O permissions.
- */
-}
-
-Bool xf86DisableInterrupts(void)
-{
- /*
- * Disable interrupts if allowed for this OS. Returns FALSE if
- * this is not allowed or if the attempt fails for some reason.
- */
-}
-
-void xf86EnableInterrupts(void)
-{
- /*
- * Reenable interrupts
- */
-}
-
-int xf86ProcessArgument(int argc, char *argv[], int i)
-{
- /*
- * Process OS-specific command-line arguments. See
- * ddxProcessArgument() for more info.
- */
-}
-
-void xf86UseMsg(void)
-{
- /*
- * Print list of OS-specific command-line arguments. See
- * ddxUseMsg() for more info.
- */
-}
-
-void xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- /*
- * Sound the keyboard bell. pitch is in Hz, duration in ms,
- * loudness is in the range 0-100 (0 -> off). For systems
- * where the loudness can't be controlled, scale the duration
- * by loudness/50.
- */
-}
-
-void xf86SetKbdLeds(int leds)
-{
- /*
- * Set the keyboard LEDs to the state indicated in leds
- */
-}
-
-int xf86GetKbdLeds(void)
-{
- /*
- * Return the state of the keyboard LEDs. If the OS doesn't
- * support this, return 0.
- */
-}
-
-void xf86SetKbdRepeat(char rad)
-{
- /*
- * Set the keyboard repeat rate and delay according the
- * the rad value. The lower 5 bits determine the repeat
- * rate (lower value -> higher rate). The next 2 bits
- * determine the delay.
- * This should possibly be changed to take separate rate and
- * delay parameters.
- */
-}
-
-void xf86KbdInit(void)
-{
- /*
- * Save initial keyboard state. This is called at the start of
- * each server generation.
- */
-}
-
-int xf86KbdOn(void)
-{
- /*
- * Set the keyboard up for use with X. This is called whenever
- * the server becomes active (ie at the start of each generation and
- * whenever its VT becomes active). Return the file descriptor
- * for keyboard input. Return -1 if there is no file descriptor
- * to add as an input device. If there are errors encountered,
- * call FatalError(). A return value of -1 is not considered an
- * error condition.
- */
-}
-
-int xf86KbdOff(void)
-{
- /*
- * Return the keyboard to the state saved by xf86KbdInit(). This is
- * called at the end of a server generation, and also when the
- * server's VT ceases being active. Returns the keyboard file
- * descriptor. Returns -1 if there is no file descriptor to be
- * removed as an input device. Errors should be handled the same
- * way as in xf86KbdOn().
- */
-}
-
-void xf86KbdEvents(void)
-{
- /*
- * Read characters from the keyboard device, and post the events
- * by calling xf86PostKbdEvent(). Read as much as is available
- * without waiting.
- */
-}
-
-void xf86SetMouseSpeed(int old, int new, unsigned cflag)
-{
- /*
- * Set the speed of the mouse port. old is the previous speed,
- * new is the new speed, and cflag is the value of the termio[s]
- * c_cflag field. For mice that have programmable speed operation,
- * this should send the appropriate commands to the mouse.
- */
-}
-
-void xf86MouseInit(void)
-{
- /*
- * This is called at the start of each server generation. In most
- * cases this is a noop. If the mouse must not be opened/closed
- * when VT switching, the open should be done here.
- */
-}
-
-int xf86MousedOn(void)
-{
- /*
- * Set the mouse up for use with X. This is called whenever
- * the server becomes active (ie at the start of each generation and
- * whenever its VT becomes active). This function normally opens
- * the mouse device, and may call xf86SetupMouse() to initialise
- * the mouse parameters. Return the file descriptor for mouse input.
- * Return -1 if there is no file descriptor to add as an input
- * device. If there are errors encountered, call FatalError().
- * A return value of -1 is not considered an error condition.
- */
-}
-
-int xf86MouseOff(Bool doclose)
-{
- /*
- * Release the mouse from use with X. This is called at the end
- * of a server generation (with doclose==TRUE), and also when the
- * server's VT ceases being active (with doclose==FALSE). If the
- * mouse should not be opened/closed when VT switching, the close
- * should be done here when doclose==TRUE. For other systems, the
- * mouse device should be closed regardless of the doclose value.
- * Returns the mouse file descriptor. Returns -1 if there is no
- * file descriptor to be removed as an input device. Errors
- * should be handled the same way as in xf86MouseOn().
- */
-}
-
-void xf86MouseEvents(void)
-{
- /*
- * Read characters from the mouse device, and post the events
- * by calling xf86PostMseEvent(). Read as much as is available
- * without waiting. If the OS doesn't handle the mouse protocol
- * translation, xf86MouseProtocol() may be called to do the
- * translation and event posting. If the OS does handle the protocol
- * translation, MOUSE_PROTOCOL_IN_KERNEL should be #define'd in
- * xf86_OSlib.h.
- */
-}
-
-int xf86OsMouseProc(DevicePtr pPointer, int what)
-{
- /*
- * Implements the device-proc for the pointer device when an
- * OS-based mouse driver is being used (as opposed to the
- * server's internal mouse driver). Implemented as any other
- * device-proc in the server.
- *
- * This function only needs to be implemented if USE_OSMOUSE is
- * defined for the OS.
- */
-}
-
-int xf86OsMouseEvents(void)
-{
- /*
- * When supporting an OS-based mouse driver (as opposed to the
- * server's internal mouse driver), read some events from the device
- * and post them to the DIX layer through xf86PostMseEvent().
- *
- * This function only needs to be implemented if USE_OSMOUSE is
- * defined for the OS.
- */
-}
-
-void xf86OsMouseOption(int token, pointer lex_ptr)
-{
- /*
- * Used in parsing an OsMouse keyword from the Xconfig file.
- * Passed the token type and a pointer to the token value.
- * The function should do whatever is appropriate for the OS's
- * mouse driver.
- *
- * This function only needs to be implemented if USE_OSMOUSE is
- * defined for the OS.
- */
-}
-
-/*
- * The following functions are simply wrappers around the OS specific
- * libc functions
- */
-
-void *
-xf86memmove(void * dest, const void * src, INT32 n)
-{
- return(memmove(dest,src,n));
-}
-
-void *
-xf86memset(void * s, int c, INT32 n)
-{
- return(memset(s,c,n));
-}
-
-void *
-xf86memcpy(void * dest, const void * src, INT32 n)
-{
- return(memcpy(dest,src,n));
-}
-
-int
-xf86memcmp(const void * s1, const void * s2, INT32 n)
-{
- return(memcmp(s1,s2,n));
-}
-
-char *
-xf86strcat(char * dest, const char * src)
-{
- return(strcat(dest,src));
-}
-
-char *
-xf86strcpy(char * dest, const char * src)
-{
- return(strcpy(dest,src));
-}
-
-int
-xf86strcmp(const char * s1, const char * s2)
-{
- return(strcmp(s1,s2));
-}
-
-int
-xf86strncmp(const char * s1, const char * s2, INT32 n)
-{
- return(strncmp(s1,s2,n));
-}
-
-size_t
-xf86strlen(const char * s)
-{
- return(strlen(s));
-}
-
-void
-xf86getsecs(INT32 * secs, INT32 * usecs)
-{
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- *secs = tv.tv_sec;
- *usecs= tv.tv_usec;
-
- return;
-}
-
-double
-xf86exp(double x)
-{
- return(exp(x));
-}
-
-double
-xf86log(double x)
-{
- return(log(x));
-}
-
-double
-xf86pow(double x, double y)
-{
- return(pow(x,y));
-}
-
-double
-xf86sqrt(double x)
-{
- return(sqrt(x));
-}
-
-double
-xf86cos(double x)
-{
- return(cos(x));
-}
-
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $
-
-
-
-
-
-$XConsortium: README.OS-lib /main/5 1996/02/21 17:50:28 kaleb $
diff --git a/hw/xfree86/os-support/assyntax.h b/hw/xfree86/os-support/assyntax.h
deleted file mode 100644
index 191c7e49e..000000000
--- a/hw/xfree86/os-support/assyntax.h
+++ /dev/null
@@ -1,752 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.13 2003/08/24 17:37:03 dawes Exp $ */
-#ifndef __ASSYNTAX_H__
-#define __ASSYNTAX_H__
-
-/*
- * Copyright 1992 Vrije Universiteit, The Netherlands
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the Vrije Universiteit not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The Vrije Universiteit makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1993-1999 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */
-
- /*
- * assyntax.h
- *
- * Select the syntax appropriate to the 386 assembler being used
- * To add support for more assemblers add more columns to the CHOICE
- * macro. Note that register names must also have uppercase names
- * to avoid macro recursion. e.g., #define ah %ah recurses!
- *
- * NB 1. Some of the macros for certain assemblers imply that the code is to
- * run in protected mode!! Caveat emptor.
- *
- * NB 2. 486 specific instructions are not included. This is to discourage
- * their accidental use in code that is intended to run on 386 and 486
- * systems.
- *
- * Supported assemblers:
- *
- * (a) AT&T SysVr4 as(1): default
- * (b) GNU Assembler gas: define USE_GAS or GNU_ASSEMBLER
- * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER
- *
- * The following naming conventions have been used to identify the various
- * data types:
- * _SR = segment register version
- * Integer:
- * _Q = quadword = 64 bits
- * _L = long = 32 bits
- * _W = short = 16 bits
- * _B = byte = 8 bits
- * Floating-point:
- * _X = m80real = 80 bits
- * _D = double = 64 bits
- * _S = single = 32 bits
- *
- * Author: Gregory J. Sharp, Sept 1992
- * Vrije Universiteit, Amsterdam, The Netherlands
- */
-
-#if defined(USE_GAS) && !defined(GNU_ASSEMBLER)
-#define GNU_ASSEMBLER
-#endif
-
-#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
-#define CONCAT(x, y) x ## y
-#else
-#define CONCAT(x, y) x/**/y
-#endif
-
-#ifdef ACK_ASSEMBLER
-
-/* Assume we write code for 32-bit protected mode! */
-
-/* Redefine register names for GAS & AT&T assemblers */
-#define AL al
-#define AH ah
-#define AX ax
-#define EAX ax
-#define BL bl
-#define BH bh
-#define BX bx
-#define EBX bx
-#define CL cl
-#define CH ch
-#define CX cx
-#define ECX cx
-#define DL dl
-#define DH dh
-#define DX dx
-#define EDX dx
-#define BP bp
-#define EBP bp
-#define SI si
-#define ESI si
-#define DI di
-#define EDI di
-#define SP sp
-#define ESP sp
-#define CS cs
-#define SS ss
-#define DS ds
-#define ES es
-#define FS fs
-#define GS gs
-/* Control Registers */
-#define CR0 cr0
-#define CR1 cr1
-#define CR2 cr2
-#define CR3 cr3
-/* Debug Registers */
-#define DR0 dr0
-#define DR1 dr1
-#define DR2 dr2
-#define DR3 dr3
-#define DR4 dr4
-#define DR5 dr5
-#define DR6 dr6
-#define DR7 dr7
-/* Floating-point Stack */
-#define ST st
-
-#define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
-
-
-#define _WTOG o16 /* word toggle for _W instructions */
-#define _LTOG /* long toggle for _L instructions */
-#define ADDR_TOGGLE a16
-#define OPSZ_TOGGLE o16
-#define USE16 .use16
-#define USE32 .use32
-
-#define CHOICE(a,b,c) c
-
-#else /* AT&T or GAS */
-
-/* Redefine register names for GAS & AT&T assemblers */
-#define AL %al
-#define AH %ah
-#define AX %ax
-#define EAX %eax
-#define BL %bl
-#define BH %bh
-#define BX %bx
-#define EBX %ebx
-#define CL %cl
-#define CH %ch
-#define CX %cx
-#define ECX %ecx
-#define DL %dl
-#define DH %dh
-#define DX %dx
-#define EDX %edx
-#define BP %bp
-#define EBP %ebp
-#define SI %si
-#define ESI %esi
-#define DI %di
-#define EDI %edi
-#define SP %sp
-#define ESP %esp
-#define CS %cs
-#define SS %ss
-#define DS %ds
-#define ES %es
-#define FS %fs
-#define GS %gs
-/* Control Registers */
-#define CR0 %cr0
-#define CR1 %cr1
-#define CR2 %cr2
-#define CR3 %cr3
-/* Debug Registers */
-#define DR0 %db0
-#define DR1 %db1
-#define DR2 %db2
-#define DR3 %db3
-#define DR4 %db4
-#define DR5 %db5
-#define DR6 %db6
-#define DR7 %db7
-/* Floating-point Stack */
-#define ST %st
-
-#define AS_BEGIN
-#define USE16
-#define USE32
-
-#ifdef GNU_ASSEMBLER
-
-#define ADDR_TOGGLE aword
-#define OPSZ_TOGGLE word
-
-#define CHOICE(a,b,c) b
-
-#else
-/*
- * AT&T ASSEMBLER SYNTAX
- * *********************
- */
-#define CHOICE(a,b,c) a
-
-#define ADDR_TOGGLE addr16
-#define OPSZ_TOGGLE data16
-
-#endif /* GNU_ASSEMBLER */
-#endif /* ACK_ASSEMBLER */
-
-
-#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__)
-#define GLNAME(a) a
-#else
-#define GLNAME(a) CONCAT(_,a)
-#endif
-
-
- /****************************************/
- /* */
- /* Select the various choices */
- /* */
- /****************************************/
-
-
-/* Redefine assembler directives */
-/*********************************/
-#define GLOBL CHOICE(.globl, .globl, .extern)
-#define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
-#define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
-/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
- * guaranteed to be filled with NOPs. Otherwise it does nothing.
- */
-#define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
-#define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
-#define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
-#define FILE(s) CHOICE(.file s, .file s, .file s)
-#define STRING(s) CHOICE(.string s, .asciz s, .asciz s)
-#define D_LONG CHOICE(.long, .long, .data4)
-#define D_WORD CHOICE(.value, .short, .data2)
-#define D_BYTE CHOICE(.byte, .byte, .data1)
-#define SPACE CHOICE(.comm, .space, .space)
-#define COMM CHOICE(.comm, .comm, .comm)
-#define SEG_DATA CHOICE(.data, .data, .sect .data)
-#define SEG_TEXT CHOICE(.text, .text, .sect .text)
-#define SEG_BSS CHOICE(.bss, .bss, .sect .bss)
-
-#ifdef GNU_ASSEMBLER
-#define D_SPACE(n) . = . + n
-#else
-#define D_SPACE(n) .space n
-#endif
-
-/* Addressing Modes */
-/* Immediate Mode */
-#define ADDR(a) CHOICE(CONCAT($,a), CONCAT($,a), a)
-#define CONST(a) CHOICE(CONCAT($,a), CONCAT($,a), a)
-
-/* Indirect Mode */
-#define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */
-#define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */
-/* Register b indirect plus displacement a */
-#define REGOFF(a, b) CHOICE(a(b), a(b), a(b))
-/* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode
- * which has no scaling
- */
-#define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i))
-/* Reg indirect Base + (Index * Scale) + Displacement */
-#define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
-/* Displaced Scaled Index: */
-#define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s))
-/* Indexed Base: */
-#define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i))
-/* Displaced Base: */
-#define REGDB(d,b) CHOICE(d(b), d(b), d(b))
-/* Variable indirect: */
-#define VARINDIRECT(var) CHOICE(*var, *var, (var))
-/* Use register contents as jump/call target: */
-#define CODEPTR(reg) CHOICE(*reg, *reg, reg)
-
-/* For expressions requiring bracketing
- * eg. (CRT0_PM | CRT_EM)
- */
-
-#define EXPR(a) CHOICE([a], (a), [a])
-#define ENOT(a) CHOICE(0!a, ~a, ~a)
-#define EMUL(a,b) CHOICE(a\*b, a*b, a*b)
-#define EDIV(a,b) CHOICE(a\/b, a/b, a/b)
-
-/*
- * We have to beat the problem of commas within arguments to choice.
- * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI
- * and other known cpp definitions evaluate arguments before substitution
- * so the following works.
- */
-#define ARG2(a, b) a,b
-#define ARG3(a,b,c) a,b,c
-
-/* Redefine assembler commands */
-#define AAA CHOICE(aaa, aaa, aaa)
-#define AAD CHOICE(aad, aad, aad)
-#define AAM CHOICE(aam, aam, aam)
-#define AAS CHOICE(aas, aas, aas)
-#define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))
-#define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))
-#define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))
-#define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))
-#define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))
-#define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))
-#define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))
-#define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))
-#define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))
-#define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))
-#define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))
-#define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))
-#define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))
-#define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))
-#define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))
-#define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))
-#define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))
-#define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))
-#define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))
-#define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))
-#define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))
-#define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))
-#define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))
-#define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))
-#define CALL(a) CHOICE(call a, call a, call a)
-#define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)
-#define CBW CHOICE(cbtw, cbw, cbw)
-#define CWDE CHOICE(cwtd, cwde, cwde)
-#define CLC CHOICE(clc, clc, clc)
-#define CLD CHOICE(cld, cld, cld)
-#define CLI CHOICE(cli, cli, cli)
-#define CLTS CHOICE(clts, clts, clts)
-#define CMC CHOICE(cmc, cmc, cmc)
-#define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))
-#define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))
-#define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))
-#define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps)
-#define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps)
-#define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb)
-#define CWD CHOICE(cwtl, cwd, cwd)
-#define CDQ CHOICE(cltd, cdq, cdq)
-#define DAA CHOICE(daa, daa, daa)
-#define DAS CHOICE(das, das, das)
-#define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a)
-#define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a)
-#define DEC_B(a) CHOICE(decb a, decb a, decb a)
-#define DIV_L(a) CHOICE(divl a, divl a, div a)
-#define DIV_W(a) CHOICE(divw a, divw a, div a)
-#define DIV_B(a) CHOICE(divb a, divb a, divb a)
-#define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))
-#define HLT CHOICE(hlt, hlt, hlt)
-#define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a)
-#define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a)
-#define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a)
-/* More forms than this for imul!! */
-#define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))
-#define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))
-#define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a)
-#define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)
-#define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)
-#define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX)
-/* Please AS code writer: use the following ONLY, if you refer to ports<256
- * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer
- */
-#if defined (sun)
-#define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a)
-#define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a)
-#define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a)
-#else
-#define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)
-#define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)
-#define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a)
-#endif
-#define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a)
-#define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a)
-#define INC_B(a) CHOICE(incb a, incb a, incb a)
-#define INS_L CHOICE(insl, insl, _LTOG ins)
-#define INS_W CHOICE(insw, insw, _WTOG ins)
-#define INS_B CHOICE(insb, insb, insb)
-#define INT(a) CHOICE(int a, int a, int a)
-#define INT3 CHOICE(int CONST(3), int3, int CONST(3))
-#define INTO CHOICE(into, into, into)
-#define IRET CHOICE(iret, iret, iret)
-#define IRETD CHOICE(iret, iret, iretd)
-#define JA(a) CHOICE(ja a, ja a, ja a)
-#define JAE(a) CHOICE(jae a, jae a, jae a)
-#define JB(a) CHOICE(jb a, jb a, jb a)
-#define JBE(a) CHOICE(jbe a, jbe a, jbe a)
-#define JC(a) CHOICE(jc a, jc a, jc a)
-#define JE(a) CHOICE(je a, je a, je a)
-#define JG(a) CHOICE(jg a, jg a, jg a)
-#define JGE(a) CHOICE(jge a, jge a, jge a)
-#define JL(a) CHOICE(jl a, jl a, jl a)
-#define JLE(a) CHOICE(jle a, jle a, jle a)
-#define JNA(a) CHOICE(jna a, jna a, jna a)
-#define JNAE(a) CHOICE(jnae a, jnae a, jnae a)
-#define JNB(a) CHOICE(jnb a, jnb a, jnb a)
-#define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a)
-#define JNC(a) CHOICE(jnc a, jnc a, jnc a)
-#define JNE(a) CHOICE(jne a, jne a, jne a)
-#define JNG(a) CHOICE(jng a, jng a, jng a)
-#define JNGE(a) CHOICE(jnge a, jnge a, jnge a)
-#define JNL(a) CHOICE(jnl a, jnl a, jnl a)
-#define JNLE(a) CHOICE(jnle a, jnle a, jnle a)
-#define JNO(a) CHOICE(jno a, jno a, jno a)
-#define JNP(a) CHOICE(jnp a, jnp a, jnp a)
-#define JNS(a) CHOICE(jns a, jns a, jns a)
-#define JNZ(a) CHOICE(jnz a, jnz a, jnz a)
-#define JO(a) CHOICE(jo a, jo a, jo a)
-#define JP(a) CHOICE(jp a, jp a, jp a)
-#define JPE(a) CHOICE(jpe a, jpe a, jpe a)
-#define JPO(a) CHOICE(jpo a, jpo a, jpo a)
-#define JS(a) CHOICE(js a, js a, js a)
-#define JZ(a) CHOICE(jz a, jz a, jz a)
-#define JMP(a) CHOICE(jmp a, jmp a, jmp a)
-#define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)
-#define LAHF CHOICE(lahf, lahf, lahf)
-#if !defined(_REAL_MODE) && !defined(_V86_MODE)
-#define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))
-#endif
-#define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))
-#define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))
-#define LEAVE CHOICE(leave, leave, leave)
-#define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a)
-#define LIDT(a) CHOICE(lidt a, lidt a, lidt a)
-#define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))
-#define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))
-#define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))
-#define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))
-#define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))
-#define LLDT(a) CHOICE(lldt a, lldt a, lldt a)
-#define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a)
-#define LOCK CHOICE(lock, lock, lock)
-#define LODS_L CHOICE(lodsl, lodsl, _LTOG lods)
-#define LODS_W CHOICE(lodsw, lodsw, _WTOG lods)
-#define LODS_B CHOICE(lodsb, lodsb, lodsb)
-#define LOOP(a) CHOICE(loop a, loop a, loop a)
-#define LOOPE(a) CHOICE(loope a, loope a, loope a)
-#define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a)
-#define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a)
-#define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a)
-#if !defined(_REAL_MODE) && !defined(_V86_MODE)
-#define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))
-#endif
-#define LTR(a) CHOICE(ltr a, ltr a, ltr a)
-#define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))
-#define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))
-#define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))
-#define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))
-#define MOVS_L CHOICE(movsl, movsl, _LTOG movs)
-#define MOVS_W CHOICE(movsw, movsw, _WTOG movs)
-#define MOVS_B CHOICE(movsb, movsb, movsb)
-#define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))
-#define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))
-#define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))
-#define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))
-#define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))
-#define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))
-#define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a)
-#define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a)
-#define MUL_B(a) CHOICE(mulb a, mulb a, mulb a)
-#define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a)
-#define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a)
-#define NEG_B(a) CHOICE(negb a, negb a, negb a)
-#define NOP CHOICE(nop, nop, nop)
-#define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a)
-#define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a)
-#define NOT_B(a) CHOICE(notb a, notb a, notb a)
-#define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))
-#define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))
-#define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))
-#define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)
-#define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)
-#define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX)
-/* Please AS code writer: use the following ONLY, if you refer to ports<256
- * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer
- */
-#define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)
-#define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)
-#define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a)
-#define OUTS_L CHOICE(outsl, outsl, _LTOG outs)
-#define OUTS_W CHOICE(outsw, outsw, _WTOG outs)
-#define OUTS_B CHOICE(outsb, outsb, outsb)
-#define POP_SR(a) CHOICE(pop a, pop a, pop a)
-#define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a)
-#define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a)
-#define POPA_L CHOICE(popal, popal, _LTOG popa)
-#define POPA_W CHOICE(popaw, popaw, _WTOG popa)
-#define POPF_L CHOICE(popfl, popfl, _LTOG popf)
-#define POPF_W CHOICE(popfw, popfw, _WTOG popf)
-#define PUSH_SR(a) CHOICE(push a, push a, push a)
-#define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a)
-#define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a)
-#define PUSH_B(a) CHOICE(push a, pushb a, push a)
-#define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha)
-#define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha)
-#define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf)
-#define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf)
-#define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))
-#define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))
-#define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))
-#define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))
-#define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))
-#define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))
-#define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))
-#define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))
-#define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))
-#define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))
-#define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))
-#define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))
-#define REP CHOICE(rep ;, rep ;, repe)
-#define REPE CHOICE(repz ;, repe ;, repe)
-#define REPNE CHOICE(repnz ;, repne ;, repne)
-#define REPNZ REPNE
-#define REPZ REPE
-#define RET CHOICE(ret, ret, ret)
-#define SAHF CHOICE(sahf, sahf, sahf)
-#define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))
-#define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))
-#define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))
-#define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))
-#define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))
-#define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))
-#define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))
-#define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))
-#define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))
-#define SCAS_L CHOICE(scasl, scasl, _LTOG scas)
-#define SCAS_W CHOICE(scasw, scasw, _WTOG scas)
-#define SCAS_B CHOICE(scasb, scasb, scasb)
-#define SETA(a) CHOICE(seta a, seta a, seta a)
-#define SETAE(a) CHOICE(setae a, setae a, setae a)
-#define SETB(a) CHOICE(setb a, setb a, setb a)
-#define SETBE(a) CHOICE(setbe a, setbe a, setbe a)
-#define SETC(a) CHOICE(setc a, setb a, setb a)
-#define SETE(a) CHOICE(sete a, sete a, sete a)
-#define SETG(a) CHOICE(setg a, setg a, setg a)
-#define SETGE(a) CHOICE(setge a, setge a, setge a)
-#define SETL(a) CHOICE(setl a, setl a, setl a)
-#define SETLE(a) CHOICE(setle a, setle a, setle a)
-#define SETNA(a) CHOICE(setna a, setna a, setna a)
-#define SETNAE(a) CHOICE(setnae a, setnae a, setnae a)
-#define SETNB(a) CHOICE(setnb a, setnb a, setnb a)
-#define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a)
-#define SETNC(a) CHOICE(setnc a, setnb a, setnb a)
-#define SETNE(a) CHOICE(setne a, setne a, setne a)
-#define SETNG(a) CHOICE(setng a, setng a, setng a)
-#define SETNGE(a) CHOICE(setnge a, setnge a, setnge a)
-#define SETNL(a) CHOICE(setnl a, setnl a, setnl a)
-#define SETNLE(a) CHOICE(setnle a, setnle a, setnle a)
-#define SETNO(a) CHOICE(setno a, setno a, setno a)
-#define SETNP(a) CHOICE(setnp a, setnp a, setnp a)
-#define SETNS(a) CHOICE(setns a, setns a, setna a)
-#define SETNZ(a) CHOICE(setnz a, setnz a, setnz a)
-#define SETO(a) CHOICE(seto a, seto a, seto a)
-#define SETP(a) CHOICE(setp a, setp a, setp a)
-#define SETPE(a) CHOICE(setpe a, setpe a, setpe a)
-#define SETPO(a) CHOICE(setpo a, setpo a, setpo a)
-#define SETS(a) CHOICE(sets a, sets a, seta a)
-#define SETZ(a) CHOICE(setz a, setz a, setz a)
-#define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a)
-#define SIDT(a) CHOICE(sidt a, sidt a, sidt a)
-#define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))
-#define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))
-#define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))
-#define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))
-#define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))
-#define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))
-#define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))
-#define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))
-#define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))
-#define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))
-#define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))
-#define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))
-#define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))
-#define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))
-#define SLDT(a) CHOICE(sldt a, sldt a, sldt a)
-#define SMSW(a) CHOICE(smsw a, smsw a, smsw a)
-#define STC CHOICE(stc, stc, stc)
-#define STD CHOICE(std, std, std)
-#define STI CHOICE(sti, sti, sti)
-#define STOS_L CHOICE(stosl, stosl, _LTOG stos)
-#define STOS_W CHOICE(stosw, stosw, _WTOG stos)
-#define STOS_B CHOICE(stosb, stosb, stosb)
-#define STR(a) CHOICE(str a, str a, str a)
-#define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))
-#define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))
-#define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))
-#define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))
-#define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))
-#define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))
-#define VERR(a) CHOICE(verr a, verr a, verr a)
-#define VERW(a) CHOICE(verw a, verw a, verw a)
-#define WAIT CHOICE(wait, wait, wait)
-#define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))
-#define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))
-#define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))
-#define XLAT CHOICE(xlat, xlat, xlat)
-#define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))
-#define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))
-#define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))
-
-
-/* Floating Point Instructions */
-#define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1)
-#define FABS CHOICE(fabs, fabs, fabs)
-#define FADD_D(a) CHOICE(faddl a, faddl a, faddd a)
-#define FADD_S(a) CHOICE(fadds a, fadds a, fadds a)
-#define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))
-#define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))
-#define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a)
-#define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a)
-#define FBLD(a) CHOICE(fbld a, fbld a, fbld a)
-#define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a)
-#define FCHS CHOICE(fchs, fchs, fchs)
-#define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex)
-#define FNCLEX CHOICE(fnclex, fnclex, fclex)
-#define FCOM(a) CHOICE(fcom a, fcom a, fcom a)
-#define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a)
-#define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a)
-#define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a)
-#define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a)
-#define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a)
-#define FCOMPP CHOICE(fcompp, fcompp, fcompp)
-#define FCOS CHOICE(fcos, fcos, fcos)
-#define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp)
-#define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a)
-#define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a)
-#define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
-#define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
-#define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a)
-#define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a)
-#define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a)
-#define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a)
-#define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
-#define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
-#define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a)
-#define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a)
-#define FFREE(a) CHOICE(ffree a, ffree a, ffree a)
-#define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a)
-#define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a)
-#define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a)
-#define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a)
-#define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a)
-#define FILD_L(a) CHOICE(fildl a, fildl a, fildl a)
-#define FILD_W(a) CHOICE(fild a, filds a, filds a)
-#define FINCSTP CHOICE(fincstp, fincstp, fincstp)
-#define FINIT CHOICE(finit, wait; fninit, wait; finit)
-#define FNINIT CHOICE(fninit, fninit, finit)
-#define FIST_L(a) CHOICE(fistl a, fistl a, fistl a)
-#define FIST_W(a) CHOICE(fist a, fists a, fists a)
-#define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a)
-#define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a)
-#define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a)
-#define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
-#define FLD_D(a) CHOICE(fldl a, fldl a, fldd a)
-#define FLD_S(a) CHOICE(flds a, flds a, flds a)
-#define FLD1 CHOICE(fld1, fld1, fld1)
-#define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t)
-#define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e)
-#define FLDPI CHOICE(fldpi, fldpi, fldpi)
-#define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2)
-#define FLDLN2 CHOICE(fldln2, fldln2, fldln2)
-#define FLDZ CHOICE(fldz, fldz, fldz)
-#define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a)
-#define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a)
-#define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a)
-#define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a)
-#define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
-#define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
-#define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a)
-#define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a)
-#define FNOP CHOICE(fnop, fnop, fnop)
-#define FPATAN CHOICE(fpatan, fpatan, fpatan)
-#define FPREM CHOICE(fprem, fprem, fprem)
-#define FPREM1 CHOICE(fprem1, fprem1, fprem1)
-#define FPTAN CHOICE(fptan, fptan, fptan)
-#define FRNDINT CHOICE(frndint, frndint, frndint)
-#define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a)
-#define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a)
-#define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a)
-#define FSCALE CHOICE(fscale, fscale, fscale)
-#define FSIN CHOICE(fsin, fsin, fsin)
-#define FSINCOS CHOICE(fsincos, fsincos, fsincos)
-#define FSQRT CHOICE(fsqrt, fsqrt, fsqrt)
-#define FST_D(a) CHOICE(fstl a, fstl a, fstd a)
-#define FST_S(a) CHOICE(fsts a, fsts a, fsts a)
-#define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a)
-#define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a)
-#define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a)
-#define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
-#define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a)
-#define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a)
-#define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a)
-#define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
-#define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a)
-#define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a)
-#define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a)
-#define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
-#define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
-#define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a)
-#define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a)
-#define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a)
-#define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a)
-#define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
-#define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
-#define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a)
-#define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a)
-#define FTST CHOICE(ftst, ftst, ftst)
-#define FUCOM(a) CHOICE(fucom a, fucom a, fucom a)
-#define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a)
-#define FUCOMPP CHOICE(fucompp, fucompp, fucompp)
-#define FWAIT CHOICE(wait, wait, wait)
-#define FXAM CHOICE(fxam, fxam, fxam)
-#define FXCH(a) CHOICE(fxch a, fxch a, fxch a)
-#define FXTRACT CHOICE(fxtract, fxtract, fxtract)
-#define FYL2X CHOICE(fyl2x, fyl2x, fyl2x)
-#define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
-
-#endif /* __ASSYNTAX_H__ */
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
deleted file mode 100644
index aa3313dc3..000000000
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.5 2003/04/03 16:50:04 dawes Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include <sys/param.h>
-#ifndef __NetBSD__
-# include <sys/sysctl.h>
-# ifdef __FreeBSD__
-# include <machine/sysarch.h>
-# endif
-# else
-# include <machine/sysarch.h>
-#endif
-
-#include "xf86Axp.h"
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-axpDevice bsdGetAXP(void);
-
-#ifndef __NetBSD__
-extern unsigned long dense_base(void);
-
-static int axpSystem = -1;
-static unsigned long hae_thresh;
-static unsigned long hae_mask;
-static unsigned long bus_base;
-static unsigned long sparse_size;
-
-static unsigned long
-memory_base(void)
-{
- static unsigned long base = 0;
-
- if (base == 0) {
- size_t len = sizeof(base);
- int error;
-#ifdef __OpenBSD__
- int mib[3];
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CHIPSET;
- mib[2] = CPU_CHIPSET_MEM;
-
- if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0)
-#else
- if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
- 0, 0)) < 0)
-#endif
- FatalError("xf86MapVidMem: can't find memory\n");
- }
-
- return base;
-}
-
-static int
-has_bwx(void)
-{
- static int bwx = 0;
- size_t len = sizeof(bwx);
- int error;
-#ifdef __OpenBSD__
- int mib[3];
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CHIPSET;
- mib[2] = CPU_CHIPSET_BWX;
-
- if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0)
- return FALSE;
- else
- return bwx;
-#else
- if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
- return FALSE;
- else
- return bwx;
-#endif
-}
-#else /* __NetBSD__ */
-static struct alpha_bus_window *abw;
-static int abw_count = -1;
-
-static void
-init_abw()
-{
- if (abw_count < 0) {
- abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
- if (abw_count <= 0)
- FatalError("init_abw: alpha_bus_getwindows failed\n");
- }
-}
-
-static int
-has_bwx(void)
-{
- if (abw_count < 0)
- init_abw();
-
- xf86Msg(X_INFO, "has_bwx = %d\n",
- abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */
- return abw[0].abw_abst.abst_flags & ABST_BWX;
-}
-
-static unsigned long
-dense_base()
-{
- if (abw_count < 0)
- init_abw();
-
- /* XXX check abst_flags for ABST_DENSE just to be safe? */
- xf86Msg(X_INFO, "dense base = %#lx\n",
- abw[0].abw_abst.abst_sys_start); /* XXXX */
- return abw[0].abw_abst.abst_sys_start;
-}
-
-static unsigned long
-memory_base()
-{
- if (abw_count < 0)
- init_abw();
-
- if (abw_count > 0) {
- xf86Msg(X_INFO, "memory base = %#lx\n",
- abw[1].abw_abst.abst_sys_start); /* XXXX */
- return abw[1].abw_abst.abst_sys_start;
- } else {
- xf86Msg(X_INFO, "no memory base\n"); /* XXXX */
- return 0;
- }
-}
-#endif /* __NetBSD__ */
-
-#define BUS_BASE dense_base()
-#define BUS_BASE_BWX memory_base()
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-#ifdef __OpenBSD__
-#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#endif
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#ifdef HAS_APERTURE_DRV
-#define DEV_APERTURE "/dev/xf86"
-#endif
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
-static void unmapVidMemSparse(int, pointer, unsigned long);
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
-#ifdef HAS_APERTURE_DRV
- /* Try the aperture driver first */
- if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED) {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
- DEV_APERTURE);
- return;
- } else {
- if (warn) {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_APERTURE, strerror(errno));
- }
- }
- }
-#endif
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0) {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED) {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- if (warn) {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- }
- }
- if (warn) {
-#ifndef HAS_APERTURE_DRV
- xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
-#else
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno));
-#else /* __OpenBSD__ */
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno),
- SYSCTL_MSG);
-#endif /* __OpenBSD__ */
-#endif
- xf86ErrorF("\tlinear framebuffer access unavailable\n");
- }
- useDevMem = FALSE;
- return;
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
-
- if (has_bwx()) {
- xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n");
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
- } else {
- xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
- pVidMem->mapMem = mapVidMemSparse;
- pVidMem->unmapMem = unmapVidMemSparse;
- if (axpSystem == -1)
- axpSystem = bsdGetAXP();
- hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
- hae_mask = xf86AXPParams[axpSystem].hae_mask;
- sparse_size = xf86AXPParams[axpSystem].size;
- }
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
- Base = Base & ((1L<<32) - 1);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return(base);
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%x outside allowable range\n",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base + BUS_BASE);
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
- strerror(errno));
- }
- return(base);
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return(-1);
- }
-
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
- return(-1);
- }
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return(Len);
-}
-
-
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
-
-extern int ioperm(unsigned long from, unsigned long num, int on);
-
-void
-xf86EnableIO()
-{
- ioperm(0, 65536, TRUE);
- return;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* __FreeBSD__ || __OpenBSD__ */
-
-#ifdef USE_ALPHA_PIO
-
-void
-xf86EnableIO()
-{
- alpha_pci_io_enable(1);
-}
-
-void
-xf86DisableIO()
-{
- alpha_pci_io_enable(0);
-}
-
-#endif /* USE_ALPHA_PIO */
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
- return;
-}
-
-
-#define vuip volatile unsigned int *
-
-static unsigned long msb_set = 0;
-static pointer memSBase = 0;
-static pointer memBase = 0;
-
-extern int readDense8(pointer Base, register unsigned long Offset);
-extern int readDense16(pointer Base, register unsigned long Offset);
-extern int readDense32(pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-static int readSparse8(pointer Base, register unsigned long Offset);
-static int readSparse16(pointer Base, register unsigned long Offset);
-static int readSparse32(pointer Base, register unsigned long Offset);
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset);
-
-#ifdef __FreeBSD__
-extern int sysarch(int, char *);
-#endif
-
-struct parms {
- u_int64_t hae;
-};
-
-static int
-sethae(u_int64_t hae)
-{
-#ifdef __FreeBSD__
-#ifndef ALPHA_SETHAE
-#define ALPHA_SETHAE 0
-#endif
- struct parms p;
- p.hae = hae;
- return (sysarch(ALPHA_SETHAE, (char *)&p));
-#endif
-#ifdef __OpenBSD__
- return -1;
-#endif
-}
-
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- static Bool was_here = FALSE;
-
- if (!was_here) {
- was_here = TRUE;
-
- checkDevMem(FALSE);
-
- xf86WriteMmio8 = writeSparse8;
- xf86WriteMmio16 = writeSparse16;
- xf86WriteMmio32 = writeSparse32;
- xf86WriteMmioNB8 = writeSparseNB8;
- xf86WriteMmioNB16 = writeSparseNB16;
- xf86WriteMmioNB32 = writeSparseNB32;
- xf86ReadMmio8 = readSparse8;
- xf86ReadMmio16 = readSparse16;
- xf86ReadMmio32 = readSparse32;
-
- memBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) BUS_BASE);
- memSBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) BUS_BASE_BWX);
-
- if (memSBase == MAP_FAILED || memBase == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
- strerror(errno));
- }
- }
- return (pointer)((unsigned long)memBase + Base);
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
-}
-
-static int
-readSparse8(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x3) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
- result >>= shift;
- return 0xffUL & result;
-}
-
-static int
-readSparse16(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x2) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
- result >>= shift;
- return 0xffffUL & result;
-}
-
-static int
-readSparse32(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(vuip)((unsigned long)Base+(Offset));
-}
-
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-
-}
-
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask ;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-}
-
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
- = writeDense8;
-void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
- = writeDense16;
-void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
- = writeDense32;
-void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB8;
-void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB16;
-void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB32;
-int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
- = readDense8;
-int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
- = readDense16;
-int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
- = readDense32;
-
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
deleted file mode 100644
index 36943add1..000000000
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.2 2003/03/14 13:46:03 tsi Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifdef __arm32__
-#include "machine/devmap.h"
-struct memAccess
-{
- int ioctl;
- struct map_info memInfo;
- pointer regionVirtBase;
- Bool Checked;
- Bool OK;
-};
-
-static pointer xf86MapInfoMap();
-static void xf86MapInfoUnmap();
-static struct memAccess *checkMapInfo();
-extern int vgaPhysLinearBase;
-
-/* A memAccess structure is needed for each possible region */
-struct memAccess vgaMemInfo = { CONSOLE_GET_MEM_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess linearMemInfo = { CONSOLE_GET_LINEAR_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
- FALSE, FALSE };
-#endif /* __arm32__ */
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-
-#define BUS_BASE 0L
-#define BUS_BASE_BWX 0L
-
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- /* This should not happen */
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
- }
- }
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
-
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
- pVidMem->mapMem = armMapVidMem;
- pVidMem->unmapVidMem = armUnmapVidMem;
-
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return(base);
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%x outside allowable range\n",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base - 0xA0000);
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
- strerror(errno));
- }
- return(base);
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return(-1);
- }
-
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
- return(-1);
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return(Len);
-}
-
-
-/* XXX This needs to be updated for the ND */
-
-/*
-** Find out whether the console driver provides memory mapping information
-** for the specified region and return the map_info pointer. Print a warning if required.
-*/
-static struct memAccess *
-checkMapInfo(Bool warn, int Region)
-{
- struct memAccess *memAccP;
-
- switch (Region)
- {
- case VGA_REGION:
- memAccP = &vgaMemInfo;
- break;
-
- case LINEAR_REGION:
- memAccP = &linearMemInfo;
- break;
-
- case MMIO_REGION:
- memAccP = &ioMemInfo;
- break;
-
- default:
- return NULL;
- break;
- }
-
- if(!memAccP->Checked)
- {
- if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
- {
- if(warn)
- {
- xf86Msg(X_WARNING,
- "checkMapInfo: failed to get map info for region %d\n\t(%s)\n",
- Region, strerror(errno));
- }
- }
- else
- {
- if(memAccP->memInfo.u.map_info_mmap.map_offset
- != MAP_INFO_UNKNOWN)
- memAccP->OK = TRUE;
- }
- memAccP->Checked = TRUE;
- }
- if (memAccP->OK)
- {
- return memAccP;
- }
- else
- {
- return NULL;
- }
-}
-
-static pointer
-xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- if (mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- Size = (unsigned long)Base + Size;
- }
- else
- {
- Size = mapInfoP->u.map_info_mmap.map_size;
- }
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- /* Need to remap if size is unknown because we may not have
- mapped the whole region initially */
- if(memInfoP->regionVirtBase == NULL ||
- mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- if((memInfoP->regionVirtBase =
- mmap((caddr_t)0,
- Size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED,
- xf86Info.screenFd,
- (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
- == (pointer)-1)
- {
- FatalError("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n",
- mapInfoP->u.map_info_mmap.map_offset, strerror(errno));
- }
- if(mapInfoP->u.map_info_mmap.internal_offset > 0)
- memInfoP->regionVirtBase +=
- mapInfoP->u.map_info_mmap.internal_offset;
- }
- break;
-
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-
- return (pointer)((int)memInfoP->regionVirtBase + (int)Base);
-}
-
-static void
-xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- if(memInfoP->regionVirtBase != NULL)
- {
- if(mapInfoP->u.map_info_mmap.map_size != MAP_INFO_UNKNOWN)
- Size = mapInfoP->u.map_info_mmap.map_size;
- munmap((caddr_t)memInfoP->regionVirtBase, Size);
- memInfoP->regionVirtBase = NULL;
- }
- break;
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-}
-
-static pointer
-armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- /*
- ** xf86 passes in a physical address offset from the start
- ** of physical memory, but xf86MapInfoMap expects an
- ** offset from the start of the specified region - it gets
- ** the physical address of the region from the display driver.
- */
- switch(Region)
- {
- case LINEAR_REGION:
- if (vgaPhysLinearBase)
- {
- Base -= vgaPhysLinearBase;
- }
- break;
- case VGA_REGION:
- Base -= 0xA0000;
- break;
- }
-
- base = xf86MapInfoMap(memInfoP, Base, Size);
- return (base);
- }
- return mapVidMem(ScreenNum, Base, Size, flags);
-}
-
-static void
-armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, Base, Size);
- }
- unmapVidMem(ScreenNum, Base, Size);
-}
-
-#ifdef USE_DEV_IO
-static int IoFd = -1;
-
-void
-xf86EnableIO()
-{
- if (IoFd >= 0)
- return;
-
- if ((IoFd = open("/dev/io", O_RDWR)) == -1)
- {
- FatalError("xf86EnableIO: "
- "Failed to open /dev/io for extended I/O\n");
- }
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (IoFd < 0)
- return;
-
- close(IoFd);
- IoFd = -1;
- return;
-}
-
-#endif
-
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-void
-xf86EnableIO()
-{
- int fd;
- pointer base;
-
- if (ExtendedEnabled)
- return;
-
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- FatalError("EnableIO: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
- }
- else {
- FatalError("EnableIO: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
-
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* USE_ARC_MMAP */
-
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-
- return;
-}
-
-
-
-#if 0
-/*
- * XXX This is here for reference. It needs to be handled differently for the
- * ND.
- */
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-#ifdef USE_ARM32_MMAP
-#define DEV_MEM_IOBASE 0x43000000
-#endif
-
-static Bool ScreenEnabled[MAXSCREENS];
-static Bool ExtendedEnabled = FALSE;
-static Bool InitDone = FALSE;
-
-void
-xf86EnableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
- int fd;
- pointer base;
-
-#ifdef __arm32__
- struct memAccess *memInfoP;
- int *Size;
-#endif
-
- ScreenEnabled[ScreenNum] = TRUE;
-
- if (ExtendedEnabled)
- return;
-
-#ifdef USE_ARC_MMAP
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- xf86Msg(X_ERROR,
- "EnableIOPorts: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
- }
- else {
- xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
-#endif
-
-#ifdef __arm32__
- IOPortBase = (unsigned int)-1;
-
- if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
- {
- /*
- * xf86MapInfoMap maps an offset from the start of video IO
- * space (e.g. 0x3B0), but IOPortBase is expected to map to
- * physical address 0x000, so subtract the start of video I/O
- * space from the result. This is safe for now becase we
- * actually mmap the start of the page, then the start of video
- * I/O space is added as an internal offset.
- */
- IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
- (caddr_t)0x0, 0L)
- - memInfoP->memInfo.u.map_info_mmap.internal_offset;
- ExtendedEnabled = TRUE;
- return;
- }
-#ifdef USE_ARM32_MMAP
- checkDevMem(TRUE);
-
- if (devMemFd >= 0 && useDevMem)
- {
- base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ | PROT_WRITE,
- MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
-
- if (base != (pointer)-1)
- IOPortBase = (unsigned int)base;
- }
-
- if (IOPortBase == (unsigned int)-1)
- {
- FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
- }
-#else
- /* We don't have the IOBASE, so we can't map the address */
- FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Try building the server with USE_ARM32_MMAP defined\n");
-#endif
-#endif
-
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
-#ifdef __arm32__
- struct memAccess *memInfoP;
-#endif
-
- ScreenEnabled[ScreenNum] = FALSE;
-
-#ifdef __arm32__
- if((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, 0);
- }
-#endif
-
-#ifdef USE_ARM32_MMAP
- if (!ExtendedEnabled)
- return;
-
- for (i = 0; i < MAXSCREENS; i++)
- if (ScreenEnabled[i])
- return;
-
- munmap((caddr_t)IOPortBase, 0x400);
- IOPortBase = (unsigned int)-1;
- ExtendedEnabled = FALSE;
-#endif
-
- return;
-}
-
-#endif /* USE_ARC_MMAP || USE_ARM32_MMAP */
-#endif
-
-
diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c
deleted file mode 100644
index 6c675b5da..000000000
--- a/hw/xfree86/os-support/bsd/bsdResource.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.9 2003/10/02 13:30:06 eich Exp $ */
-
-/* Resource information code */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86Pci.h"
-#include "xf86Resources.h"
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSlib.h"
-
-/* Avoid Imakefile changes */
-#include "bus/Pci.h"
-
-resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
-
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
-#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- /*
- * Only allow the upper half of the pci memory range to be used
- * for allocation. The lower half includes magic regions for DMA.
- * XXX this is not right for XP1000's and similar where we use the
- * region 0x40000000-0xbfffffff for DMA but this only matters if
- * the bios screws up the pci region mappings.
- */
- RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
-xf86AccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * Fallback is to claim the following areas:
- *
- * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
- */
-
- RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
- * along with their sparse I/O aliases, but that's too imprecise. Instead
- * claim a bare minimum here.
- */
- RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1); */
- RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* XXX add others */
- return ret;
-}
-
-#elif defined(__powerpc__)
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
-xf86AccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- return ret;
-}
-
-#else
-
-#error : Put your platform dependent code here!!
-
-#endif
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bsd/bsd_KbdMap.c b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
deleted file mode 100644
index a47dc2384..000000000
--- a/hw/xfree86/os-support/bsd/bsd_KbdMap.c
+++ /dev/null
@@ -1,1075 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
-
-/*
- * Slightly modified xf86KbdBSD.c which is
- *
- * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
- * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- * and from xf86KbdCODrv.c by Holger Veit
- */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSKbd.h"
-#include "atKeynames.h"
-#include "xf86Keymap.h"
-#include "bsd_kbd.h"
-
-#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP)
-#define KD_GET_ENTRY(i,n) \
- eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
-
-static unsigned char remap[NUM_KEYCODES] = {
- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
- 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
-};
-
-/* This table assumes the ibm code page 437 coding for characters
- * > 0x80. They are returned in this form by PCVT */
-static KeySym eascii_to_x[512] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
- XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
- XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
- XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
- XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
- XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
- XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
- XK_sterling, XK_yen, XK_paragraph, XK_section,
- XK_aacute, XK_iacute, XK_oacute, XK_uacute,
- XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
- XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
- XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
- XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
- XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
- XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
- XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
- XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
- XK_degree, NoSymbol, NoSymbol, XK_radical,
- XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
-
- /*
- * special marked entries (256 + x)
- */
-
- /* This has been checked against what syscons actually does */
- NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
- XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
- XK_ISO_Left_Tab,XK_Control_L, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_F1,
- XK_F2, XK_F3, XK_F4, XK_F5,
- XK_F6, XK_F7, XK_F8, XK_F9,
- XK_F10, XK_F11, XK_F12, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_Control_R, XK_Alt_R, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol
-};
-
-#ifdef __OpenBSD__
-/* don't mark AltR and CtrlR for remapping, since they
- * cannot be remapped by pccons */
-static unsigned char pccons_remap[128] = {
- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x77 */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
-};
-
-/* This table assumes an iso8859_1 encoding for the characters
- * > 80, as returned by pccons */
-static KeySym latin1_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
- };
-#endif
-
-#ifdef SYSCONS_SUPPORT
-static
-unsigned char sysconsCODEMap[] = {
- KEY_KP_Enter, KEY_RCtrl, KEY_KP_Divide, KEY_Print,
- KEY_AltLang, KEY_KP_7, KEY_KP_8, KEY_KP_9,
- KEY_KP_4, KEY_KP_6, KEY_KP_1, KEY_KP_2,
- KEY_KP_3, KEY_KP_0, KEY_KP_Decimal, KEY_Pause,
- KEY_LMeta, KEY_RMeta, KEY_Menu, KEY_Break
-};
-static
-TransMapRec sysconsCODE = {
- 0x59,
- 0x6d,
- sysconsCODEMap
-};
-#endif
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
-
-#ifdef WSCONS_SUPPORT
-
-static CARD8 wsUsbMap[] = {
- /* 0 */ KEY_NOTUSED,
- /* 1 */ KEY_NOTUSED,
- /* 2 */ KEY_NOTUSED,
- /* 3 */ KEY_NOTUSED,
- /* 4 */ KEY_A,
- /* 5 */ KEY_B,
- /* 6 */ KEY_C,
- /* 7 */ KEY_D,
- /* 8 */ KEY_E,
- /* 9 */ KEY_F,
- /* 10 */ KEY_G,
- /* 11 */ KEY_H,
- /* 12 */ KEY_I,
- /* 13 */ KEY_J,
- /* 14 */ KEY_K,
- /* 15 */ KEY_L,
- /* 16 */ KEY_M,
- /* 17 */ KEY_N,
- /* 18 */ KEY_O,
- /* 19 */ KEY_P,
- /* 20 */ KEY_Q,
- /* 21 */ KEY_R,
- /* 22 */ KEY_S,
- /* 23 */ KEY_T,
- /* 24 */ KEY_U,
- /* 25 */ KEY_V,
- /* 26 */ KEY_W,
- /* 27 */ KEY_X,
- /* 28 */ KEY_Y,
- /* 29 */ KEY_Z,
- /* 30 */ KEY_1, /* 1 !*/
- /* 31 */ KEY_2, /* 2 @ */
- /* 32 */ KEY_3, /* 3 # */
- /* 33 */ KEY_4, /* 4 $ */
- /* 34 */ KEY_5, /* 5 % */
- /* 35 */ KEY_6, /* 6 ^ */
- /* 36 */ KEY_7, /* 7 & */
- /* 37 */ KEY_8, /* 8 * */
- /* 38 */ KEY_9, /* 9 ( */
- /* 39 */ KEY_0, /* 0 ) */
- /* 40 */ KEY_Enter, /* Return */
- /* 41 */ KEY_Escape, /* Escape */
- /* 42 */ KEY_BackSpace, /* Backspace Delete */
- /* 43 */ KEY_Tab, /* Tab */
- /* 44 */ KEY_Space, /* Space */
- /* 45 */ KEY_Minus, /* - _ */
- /* 46 */ KEY_Equal, /* = + */
- /* 47 */ KEY_LBrace, /* [ { */
- /* 48 */ KEY_RBrace, /* ] } */
- /* 49 */ KEY_BSlash, /* \ | */
- /* 50 */ KEY_BSlash2, /* \ _ # ~ on some keyboards */
- /* 51 */ KEY_SemiColon, /* ; : */
- /* 52 */ KEY_Quote, /* ' " */
- /* 53 */ KEY_Tilde, /* ` ~ */
- /* 54 */ KEY_Comma, /* , < */
- /* 55 */ KEY_Period, /* . > */
- /* 56 */ KEY_Slash, /* / ? */
- /* 57 */ KEY_CapsLock, /* Caps Lock */
- /* 58 */ KEY_F1, /* F1 */
- /* 59 */ KEY_F2, /* F2 */
- /* 60 */ KEY_F3, /* F3 */
- /* 61 */ KEY_F4, /* F4 */
- /* 62 */ KEY_F5, /* F5 */
- /* 63 */ KEY_F6, /* F6 */
- /* 64 */ KEY_F7, /* F7 */
- /* 65 */ KEY_F8, /* F8 */
- /* 66 */ KEY_F9, /* F9 */
- /* 67 */ KEY_F10, /* F10 */
- /* 68 */ KEY_F11, /* F11 */
- /* 69 */ KEY_F12, /* F12 */
- /* 70 */ KEY_Print, /* PrintScrn SysReq */
- /* 71 */ KEY_ScrollLock, /* Scroll Lock */
- /* 72 */ KEY_Pause, /* Pause Break */
- /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */
- /* 74 */ KEY_Home, /* Home */
- /* 75 */ KEY_PgUp, /* Page Up */
- /* 76 */ KEY_Delete, /* Delete */
- /* 77 */ KEY_End, /* End */
- /* 78 */ KEY_PgDown, /* Page Down */
- /* 79 */ KEY_Right, /* Right Arrow */
- /* 80 */ KEY_Left, /* Left Arrow */
- /* 81 */ KEY_Down, /* Down Arrow */
- /* 82 */ KEY_Up, /* Up Arrow */
- /* 83 */ KEY_NumLock, /* Num Lock */
- /* 84 */ KEY_KP_Divide, /* Keypad / */
- /* 85 */ KEY_KP_Multiply, /* Keypad * */
- /* 86 */ KEY_KP_Minus, /* Keypad - */
- /* 87 */ KEY_KP_Plus, /* Keypad + */
- /* 88 */ KEY_KP_Enter, /* Keypad Enter */
- /* 89 */ KEY_KP_1, /* Keypad 1 End */
- /* 90 */ KEY_KP_2, /* Keypad 2 Down */
- /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */
- /* 92 */ KEY_KP_4, /* Keypad 4 Left */
- /* 93 */ KEY_KP_5, /* Keypad 5 */
- /* 94 */ KEY_KP_6, /* Keypad 6 */
- /* 95 */ KEY_KP_7, /* Keypad 7 Home */
- /* 96 */ KEY_KP_8, /* Keypad 8 Up */
- /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */
- /* 98 */ KEY_KP_0, /* Keypad 0 Ins */
- /* 99 */ KEY_KP_Decimal, /* Keypad . Del */
- /* 100 */ KEY_Less, /* < > on some keyboards */
- /* 101 */ KEY_Menu, /* Menu */
- /* 102 */ KEY_NOTUSED,
- /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
- /* 104 */ KEY_NOTUSED,
- /* 105 */ KEY_NOTUSED,
- /* 106 */ KEY_NOTUSED,
- /* 107 */ KEY_NOTUSED,
- /* 108 */ KEY_NOTUSED,
- /* 109 */ KEY_NOTUSED,
- /* 110 */ KEY_NOTUSED,
- /* 111 */ KEY_NOTUSED,
- /* 112 */ KEY_NOTUSED,
- /* 113 */ KEY_NOTUSED,
- /* 114 */ KEY_NOTUSED,
- /* 115 */ KEY_NOTUSED,
- /* 116 */ KEY_NOTUSED,
- /* 117 */ KEY_NOTUSED,
- /* 118 */ KEY_NOTUSED,
- /* 119 */ KEY_NOTUSED,
- /* 120 */ KEY_NOTUSED,
- /* 121 */ KEY_NOTUSED,
- /* 122 */ KEY_NOTUSED,
- /* 123 */ KEY_NOTUSED,
- /* 124 */ KEY_NOTUSED,
- /* 125 */ KEY_NOTUSED,
- /* 126 */ KEY_NOTUSED,
- /* 127 */ KEY_NOTUSED,
- /* 128 */ KEY_NOTUSED,
- /* 129 */ KEY_NOTUSED,
- /* 130 */ KEY_NOTUSED,
- /* 131 */ KEY_NOTUSED,
- /* 132 */ KEY_NOTUSED,
- /* 133 */ KEY_NOTUSED,
- /* 134 */ KEY_NOTUSED,
- /* 135 */ KEY_NOTUSED,
- /* 136 */ KEY_NOTUSED,
- /* 137 */ KEY_NOTUSED,
- /* 138 */ KEY_NOTUSED,
- /* 139 */ KEY_NOTUSED,
- /* 140 */ KEY_NOTUSED,
- /* 141 */ KEY_NOTUSED,
- /* 142 */ KEY_NOTUSED,
- /* 143 */ KEY_NOTUSED,
- /* 144 */ KEY_NOTUSED,
- /* 145 */ KEY_NOTUSED,
- /* 146 */ KEY_NOTUSED,
- /* 147 */ KEY_NOTUSED,
- /* 148 */ KEY_NOTUSED,
- /* 149 */ KEY_NOTUSED,
- /* 150 */ KEY_NOTUSED,
- /* 151 */ KEY_NOTUSED,
- /* 152 */ KEY_NOTUSED,
- /* 153 */ KEY_NOTUSED,
- /* 154 */ KEY_NOTUSED,
- /* 155 */ KEY_NOTUSED,
- /* 156 */ KEY_NOTUSED,
- /* 157 */ KEY_NOTUSED,
- /* 158 */ KEY_NOTUSED,
- /* 159 */ KEY_NOTUSED,
- /* 160 */ KEY_NOTUSED,
- /* 161 */ KEY_NOTUSED,
- /* 162 */ KEY_NOTUSED,
- /* 163 */ KEY_NOTUSED,
- /* 164 */ KEY_NOTUSED,
- /* 165 */ KEY_NOTUSED,
- /* 166 */ KEY_NOTUSED,
- /* 167 */ KEY_NOTUSED,
- /* 168 */ KEY_NOTUSED,
- /* 169 */ KEY_NOTUSED,
- /* 170 */ KEY_NOTUSED,
- /* 171 */ KEY_NOTUSED,
- /* 172 */ KEY_NOTUSED,
- /* 173 */ KEY_NOTUSED,
- /* 174 */ KEY_NOTUSED,
- /* 175 */ KEY_NOTUSED,
- /* 176 */ KEY_NOTUSED,
- /* 177 */ KEY_NOTUSED,
- /* 178 */ KEY_NOTUSED,
- /* 179 */ KEY_NOTUSED,
- /* 180 */ KEY_NOTUSED,
- /* 181 */ KEY_NOTUSED,
- /* 182 */ KEY_NOTUSED,
- /* 183 */ KEY_NOTUSED,
- /* 184 */ KEY_NOTUSED,
- /* 185 */ KEY_NOTUSED,
- /* 186 */ KEY_NOTUSED,
- /* 187 */ KEY_NOTUSED,
- /* 188 */ KEY_NOTUSED,
- /* 189 */ KEY_NOTUSED,
- /* 190 */ KEY_NOTUSED,
- /* 191 */ KEY_NOTUSED,
- /* 192 */ KEY_NOTUSED,
- /* 193 */ KEY_NOTUSED,
- /* 194 */ KEY_NOTUSED,
- /* 195 */ KEY_NOTUSED,
- /* 196 */ KEY_NOTUSED,
- /* 197 */ KEY_NOTUSED,
- /* 198 */ KEY_NOTUSED,
- /* 199 */ KEY_NOTUSED,
- /* 200 */ KEY_NOTUSED,
- /* 201 */ KEY_NOTUSED,
- /* 202 */ KEY_NOTUSED,
- /* 203 */ KEY_NOTUSED,
- /* 204 */ KEY_NOTUSED,
- /* 205 */ KEY_NOTUSED,
- /* 206 */ KEY_NOTUSED,
- /* 207 */ KEY_NOTUSED,
- /* 208 */ KEY_NOTUSED,
- /* 209 */ KEY_NOTUSED,
- /* 210 */ KEY_NOTUSED,
- /* 211 */ KEY_NOTUSED,
- /* 212 */ KEY_NOTUSED,
- /* 213 */ KEY_NOTUSED,
- /* 214 */ KEY_NOTUSED,
- /* 215 */ KEY_NOTUSED,
- /* 216 */ KEY_NOTUSED,
- /* 217 */ KEY_NOTUSED,
- /* 218 */ KEY_NOTUSED,
- /* 219 */ KEY_NOTUSED,
- /* 220 */ KEY_NOTUSED,
- /* 221 */ KEY_NOTUSED,
- /* 222 */ KEY_NOTUSED,
- /* 223 */ KEY_NOTUSED,
- /* 224 */ KEY_LCtrl, /* Left Control */
- /* 225 */ KEY_ShiftL, /* Left Shift */
- /* 226 */ KEY_Alt, /* Left Alt */
- /* 227 */ KEY_LMeta, /* Left Meta */
- /* 228 */ KEY_RCtrl, /* Right Control */
- /* 229 */ KEY_ShiftR, /* Right Shift */
- /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */
- /* 231 */ KEY_LMeta, /* Right Meta XXX */
-};
-#define WS_USB_MAP_SIZE (sizeof(wsUsbMap)/sizeof(unsigned char))
-
-static
-TransMapRec wsUsb = {
- 0,
- WS_USB_MAP_SIZE,
- wsUsbMap
-};
-
-/* Map for adb keyboards */
-static CARD8 wsAdbMap[] = {
- /* 0 */ KEY_A,
- /* 1 */ KEY_S,
- /* 2 */ KEY_D,
- /* 3 */ KEY_F,
- /* 4 */ KEY_H,
- /* 5 */ KEY_G,
- /* 6 */ KEY_Z,
- /* 7 */ KEY_X,
- /* 8 */ KEY_C,
- /* 9 */ KEY_V,
- /* 10 */ KEY_UNKNOWN, /* @ # on french keyboards */
- /* 11 */ KEY_B,
- /* 12 */ KEY_Q,
- /* 13 */ KEY_W,
- /* 14 */ KEY_E,
- /* 15 */ KEY_R,
- /* 16 */ KEY_Y,
- /* 17 */ KEY_T,
- /* 18 */ KEY_1,
- /* 19 */ KEY_2,
- /* 20 */ KEY_3,
- /* 21 */ KEY_4,
- /* 22 */ KEY_6,
- /* 23 */ KEY_5,
- /* 24 */ KEY_Equal,
- /* 25 */ KEY_9,
- /* 26 */ KEY_7,
- /* 27 */ KEY_Minus,
- /* 28 */ KEY_8,
- /* 29 */ KEY_0,
- /* 30 */ KEY_RBrace,
- /* 31 */ KEY_O,
- /* 32 */ KEY_U,
- /* 33 */ KEY_LBrace,
- /* 34 */ KEY_I,
- /* 35 */ KEY_P,
- /* 36 */ KEY_Enter,
- /* 37 */ KEY_L,
- /* 38 */ KEY_J,
- /* 39 */ KEY_Quote,
- /* 40 */ KEY_K,
- /* 41 */ KEY_SemiColon,
- /* 42 */ KEY_BSlash,
- /* 43 */ KEY_Comma,
- /* 44 */ KEY_Slash,
- /* 45 */ KEY_N,
- /* 46 */ KEY_M,
- /* 47 */ KEY_Period,
- /* 48 */ KEY_Tab,
- /* 49 */ KEY_Space,
- /* 50 */ KEY_Tilde,
- /* 51 */ KEY_Delete,
- /* 52 */ KEY_AltLang,
- /* 53 */ KEY_Escape,
- /* 54 */ KEY_LCtrl,
- /* 55 */ KEY_Alt,
- /* 56 */ KEY_ShiftL,
- /* 57 */ KEY_CapsLock,
- /* 58 */ KEY_LMeta,
- /* 59 */ KEY_Left,
- /* 60 */ KEY_Right,
- /* 61 */ KEY_Down,
- /* 62 */ KEY_Up,
- /* 63 */ KEY_UNKNOWN, /* Fn */
- /* 64 */ KEY_NOTUSED,
- /* 65 */ KEY_KP_Decimal,
- /* 66 */ KEY_NOTUSED,
- /* 67 */ KEY_KP_Multiply,
- /* 68 */ KEY_NOTUSED,
- /* 69 */ KEY_KP_Plus,
- /* 70 */ KEY_NOTUSED,
- /* 71 */ KEY_UNKNOWN, /* Clear */
- /* 72 */ KEY_NOTUSED,
- /* 73 */ KEY_NOTUSED,
- /* 74 */ KEY_NOTUSED,
- /* 75 */ KEY_KP_Divide,
- /* 76 */ KEY_KP_Enter,
- /* 77 */ KEY_NOTUSED,
- /* 78 */ KEY_KP_Minus,
- /* 79 */ KEY_NOTUSED,
- /* 80 */ KEY_NOTUSED,
- /* 81 */ KEY_KP_Equal, /* Keypad = */
- /* 82 */ KEY_KP_0,
- /* 83 */ KEY_KP_1,
- /* 84 */ KEY_KP_2,
- /* 85 */ KEY_KP_3,
- /* 86 */ KEY_KP_4,
- /* 87 */ KEY_KP_5,
- /* 88 */ KEY_KP_6,
- /* 89 */ KEY_KP_7,
- /* 90 */ KEY_NOTUSED,
- /* 91 */ KEY_KP_8,
- /* 92 */ KEY_KP_9,
- /* 93 */ KEY_NOTUSED,
- /* 94 */ KEY_NOTUSED,
- /* 95 */ KEY_UNKNOWN, /* Keypad , */
- /* 96 */ KEY_F5,
- /* 97 */ KEY_F6,
- /* 98 */ KEY_F7,
- /* 99 */ KEY_F3,
- /* 100 */ KEY_F8,
- /* 101 */ KEY_F9,
- /* 102 */ KEY_NOTUSED,
- /* 103 */ KEY_F11,
- /* 104 */ KEY_NOTUSED,
- /* 105 */ KEY_NOTUSED,
- /* 106 */ KEY_KP_Enter,
- /* 107 */ KEY_NOTUSED,
- /* 108 */ KEY_NOTUSED,
- /* 109 */ KEY_F10,
- /* 110 */ KEY_NOTUSED,
- /* 111 */ KEY_F12,
- /* 112 */ KEY_NOTUSED,
- /* 113 */ KEY_NOTUSED,
- /* 114 */ KEY_NOTUSED,
- /* 115 */ KEY_Home,
- /* 116 */ KEY_PgUp,
- /* 117 */ KEY_NOTUSED,
- /* 118 */ KEY_F4,
- /* 119 */ KEY_End,
- /* 120 */ KEY_F2,
- /* 121 */ KEY_PgDown,
- /* 122 */ KEY_F1
-};
-#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
-
-static
-TransMapRec wsAdb = {
- 0,
- WS_ADB_MAP_SIZE,
- wsAdbMap
-};
-
-static CARD8 wsSunMap[] = {
- /* 0x00 */ KEY_NOTUSED,
- /* 0x01 */ KEY_NOTUSED, /* stop */
- /* 0x02 */ KEY_NOTUSED, /* BrightnessDown / S-VolumeDown */
- /* 0x03 */ KEY_NOTUSED, /* again */
- /* 0x04 */ KEY_NOTUSED, /* BridgtnessUp / S-VolumeUp */
- /* 0x05 */ KEY_F1,
- /* 0x06 */ KEY_F2,
- /* 0x07 */ KEY_F10,
- /* 0x08 */ KEY_F3,
- /* 0x09 */ KEY_F11,
- /* 0x0a */ KEY_F4,
- /* 0x0b */ KEY_F12,
- /* 0x0c */ KEY_F5,
- /* 0x0d */ KEY_AltLang,
- /* 0x0e */ KEY_F6,
- /* 0x0f */ KEY_NOTUSED,
- /* 0x10 */ KEY_F7,
- /* 0x11 */ KEY_F8,
- /* 0x12 */ KEY_F9,
- /* 0x13 */ KEY_Alt,
- /* 0x14 */ KEY_Up,
- /* 0x15 */ KEY_Pause,
- /* 0x16 */ KEY_Print,
- /* 0x17 */ KEY_NOTUSED, /* props */
- /* 0x18 */ KEY_Left,
- /* 0x19 */ KEY_ScrollLock,
- /* 0x1a */ KEY_NOTUSED, /* undo */
- /* 0x1b */ KEY_Down,
- /* 0x1c */ KEY_Right,
- /* 0x1d */ KEY_Escape,
- /* 0x1e */ KEY_1,
- /* 0x1f */ KEY_2,
- /* 0x20 */ KEY_3,
- /* 0x21 */ KEY_4,
- /* 0x22 */ KEY_5,
- /* 0x23 */ KEY_6,
- /* 0x24 */ KEY_7,
- /* 0x25 */ KEY_8,
- /* 0x26 */ KEY_9,
- /* 0x27 */ KEY_0,
- /* 0x28 */ KEY_Minus,
- /* 0x29 */ KEY_Equal,
- /* 0x2a */ KEY_Tilde,
- /* 0x2b */ KEY_BackSpace,
- /* 0x2c */ KEY_Insert,
- /* 0x2d */ KEY_KP_Equal,
- /* 0x2e */ KEY_KP_Divide,
- /* 0x2f */ KEY_KP_Multiply,
- /* 0x30 */ KEY_NOTUSED,
- /* 0x31 */ KEY_NOTUSED, /* front */
- /* 0x32 */ KEY_KP_Decimal,
- /* 0x33 */ KEY_NOTUSED, /* copy */
- /* 0x34 */ KEY_Home,
- /* 0x35 */ KEY_Tab,
- /* 0x36 */ KEY_Q,
- /* 0x37 */ KEY_W,
- /* 0x38 */ KEY_E,
- /* 0x39 */ KEY_R,
- /* 0x3a */ KEY_T,
- /* 0x3b */ KEY_Y,
- /* 0x3c */ KEY_U,
- /* 0x3d */ KEY_I,
- /* 0x3e */ KEY_O,
- /* 0x3f */ KEY_P,
- /* 0x40 */ KEY_LBrace,
- /* 0x41 */ KEY_RBrace,
- /* 0x42 */ KEY_Delete,
- /* 0x43 */ KEY_NOTUSED, /* compose */
- /* 0x44 */ KEY_KP_7,
- /* 0x45 */ KEY_KP_8,
- /* 0x46 */ KEY_KP_9,
- /* 0x47 */ KEY_KP_Minus,
- /* 0x48 */ KEY_NOTUSED, /* open */
- /* 0x49 */ KEY_NOTUSED, /* paste */
- /* 0x4a */ KEY_End,
- /* 0x4b */ KEY_NOTUSED,
- /* 0x4c */ KEY_LCtrl,
- /* 0x4d */ KEY_A,
- /* 0x4e */ KEY_S,
- /* 0x4f */ KEY_D,
- /* 0x50 */ KEY_F,
- /* 0x51 */ KEY_G,
- /* 0x52 */ KEY_H,
- /* 0x53 */ KEY_J,
- /* 0x54 */ KEY_K,
- /* 0x55 */ KEY_L,
- /* 0x56 */ KEY_SemiColon,
- /* 0x57 */ KEY_Quote,
- /* 0x58 */ KEY_BSlash,
- /* 0x59 */ KEY_Enter,
- /* 0x5a */ KEY_KP_Enter,
- /* 0x5b */ KEY_KP_4,
- /* 0x5c */ KEY_KP_5,
- /* 0x5d */ KEY_KP_6,
- /* 0x5e */ KEY_KP_0,
- /* 0x5f */ KEY_NOTUSED, /* find */
- /* 0x60 */ KEY_PgUp,
- /* 0x61 */ KEY_NOTUSED, /* cut */
- /* 0x62 */ KEY_NumLock,
- /* 0x63 */ KEY_ShiftL,
- /* 0x64 */ KEY_Z,
- /* 0x65 */ KEY_X,
- /* 0x66 */ KEY_C,
- /* 0x67 */ KEY_V,
- /* 0x68 */ KEY_B,
- /* 0x69 */ KEY_N,
- /* 0x6a */ KEY_M,
- /* 0x6b */ KEY_Comma,
- /* 0x6c */ KEY_Period,
- /* 0x6d */ KEY_Slash,
- /* 0x6e */ KEY_ShiftR,
- /* 0x6f */ KEY_NOTUSED, /* linefeed */
- /* 0x70 */ KEY_KP_1,
- /* 0x71 */ KEY_KP_2,
- /* 0x72 */ KEY_KP_3,
- /* 0x73 */ KEY_NOTUSED,
- /* 0x74 */ KEY_NOTUSED,
- /* 0x75 */ KEY_NOTUSED,
- /* 0x76 */ KEY_NOTUSED, /* help */
- /* 0x77 */ KEY_CapsLock,
- /* 0x78 */ KEY_LMeta,
- /* 0x79 */ KEY_Space,
- /* 0x7a */ KEY_RMeta,
- /* 0x7b */ KEY_PgDown,
- /* 0x7c */ KEY_NOTUSED,
- /* 0x7d */ KEY_KP_Plus,
- /* 0x7e */ KEY_NOTUSED,
- /* 0x7f */ KEY_NOTUSED
-};
-#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char))
-
-static
-TransMapRec wsSun = {
- 0,
- WS_SUN_MAP_SIZE,
- wsSunMap
-};
-
-#endif /* WSCONS_SUPPORT */
-
-/*ARGSUSED*/
-
-/*
- * KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-void
-KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- KeySym *k;
- int i;
-
-#ifndef __bsdi__
- switch (pKbd->consType) {
-
-#ifdef PCCONS_SUPPORT
- case PCCONS:
-#if defined(__OpenBSD__)
- /*
- * on OpenBSD, the pccons keymap is programmable, too
- */
- {
- pccons_keymap_t keymap[KB_NUM_KEYS];
- if (ioctl(pInfo->fd, CONSOLE_GET_KEYMAP, &keymap) != -1) {
- for (i = 0; i < KB_NUM_KEYS; i++)
- if (pccons_remap[i]) {
- k = map + (pccons_remap[i] << 2);
- switch (keymap[i].type) {
- case KB_ASCII:
- /* For ASCII keys, there is only one char in the keymap */
- k[0] = latin1_to_x[(unsigned char)keymap[i].unshift[0]];
- k[1] = latin1_to_x[(unsigned char)keymap[i].shift[0]];
- k[2] = latin1_to_x[(unsigned char)keymap[i].altgr[0]];
- k[3] = latin1_to_x[(unsigned char)keymap[i].shift_altgr[0]];
- break;
- case KB_SCROLL:
- k[0] = XK_Scroll_Lock;
- goto special;
- case KB_NUM:
- k[0] = XK_Num_Lock;
- goto special;
- case KB_CAPS:
- k[0] = XK_Caps_Lock;
- goto special;
- case KB_SHIFT:
- switch (keymap[i].unshift[0]) {
- case 1:
- /* left shift */
- k[0] = XK_Shift_L;
- break;
- case 2:
- /* right shift */
- k[0] = XK_Shift_R;
- break;
- default:
- k[0] = NoSymbol;
- }
- goto special;
- case KB_CTL:
- k[0] = XK_Control_L;
- goto special;
- case KB_ALT:
- k[0] = XK_Alt_L;
- goto special;
- case KB_FUNC:
- switch (keymap[i].unshift[2]) {
- case 'M':
- k[0] = XK_F1;
- break;
- case 'N':
- k[0] = XK_F2;
- break;
- case 'O':
- k[0] = XK_F3;
- break;
- case 'P':
- k[0] = XK_F4;
- break;
- case 'Q':
- k[0] = XK_F5;
- break;
- case 'R':
- k[0] = XK_F6;
- break;
- case 'S':
- k[0] = XK_F7;
- break;
- case 'T':
- k[0] = XK_F8;
- break;
- case 'U':
- k[0] = XK_F9;
- break;
- case 'V':
- k[0] = XK_F10;
- break;
- case 'W':
- k[0] = XK_F11;
- break;
- case 'X':
- k[0] = XK_F12;
- break;
- default:
- k[0] = NoSymbol;
- break;
- }
- goto special;
- default:
- k[0] = NoSymbol;
- special:
- k[1] = k[2] = k[3] = NoSymbol;
- }
- }
- } else {
- ErrorF("Can't read pccons keymap\n");
- }
- }
-#endif /* __OpenBSD__ */
- break;
-#endif
-
-/*
- * XXX wscons has no GIO_KEYMAP
- */
-#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP)
- case SYSCONS:
- case PCVT:
- {
- keymap_t keymap;
-
- if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) {
- for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
- if (remap[i]) {
- k = map + (remap[i] << 2);
- k[0] = KD_GET_ENTRY(i,0); /* non-shifed */
- k[1] = KD_GET_ENTRY(i,1); /* shifted */
- k[2] = KD_GET_ENTRY(i,4); /* alt */
- k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */
- if (k[3] == k[2]) k[3] = NoSymbol;
- if (k[2] == k[1]) k[2] = NoSymbol;
- if (k[1] == k[0]) k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3])
- k[2] = k[3] = NoSymbol;
- }
- }
- }
- break;
-#endif /* SYSCONS || PCVT */
-
- }
-#endif /* !bsdi */
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- pKbd->kbdType = 0;
-
- pKeySyms->map = map;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-
- switch(pKbd->consType) {
-#ifdef SYSCONS_SUPPORT
- case SYSCONS:
- if (pKbd->CustomKeycodes)
- pKbd->scancodeMap = &sysconsCODE;
- else
- pKbd->RemapScanCode = ATScancode;
- break;
-#endif
-#if defined(PCCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case PCCONS:
- case PCVT:
- pKbd->RemapScanCode = ATScancode;
-#endif
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- switch (pKbd->wsKbdType) {
- case WSKBD_TYPE_PC_XT:
- case WSKBD_TYPE_PC_AT:
- pKbd->RemapScanCode = ATScancode;
- break;
- case WSKBD_TYPE_USB:
- pKbd->scancodeMap = &wsUsb;
- break;
-#ifdef WSKBD_TYPE_ADB
- case WSKBD_TYPE_ADB:
- pKbd->scancodeMap = &wsAdb;
- break;
-#endif
-#ifdef WSKBD_TYPE_SUN
- case WSKBD_TYPE_SUN:
- pKbd->scancodeMap = &wsSun;
- break;
-#endif
- default:
- ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType);
- }
- break;
-#endif
- }
- return;
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_VTsw.c b/hw/xfree86/os-support/bsd/bsd_VTsw.c
deleted file mode 100644
index adb101dc5..000000000
--- a/hw/xfree86/os-support/bsd/bsd_VTsw.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c,v 3.6 1998/07/25 16:56:33 dawes Exp $ */
-/*
- * Derived from VTsw_usl.c which is
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- * by S_ren Schmidt (sos@login.dkuug.dk)
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bsd_VTsw.c /main/4 1996/02/21 17:50:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * Handle the VT-switching interface for OSs that use USL-style ioctl()s
- * (the bsd, sysv, sco, and linux subdirs).
- */
-
-/*
- * This function is the signal handler for the VT-switching signal. It
- * is only referenced inside the OS-support layer.
- */
-void
-xf86VTRequest(int sig)
-{
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
- xf86Info.vtRequestsPending = TRUE;
- }
-#endif
- return;
-}
-
-Bool
-xf86VTSwitchPending()
-{
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
- return(xf86Info.vtRequestsPending ? TRUE : FALSE);
- }
-#endif
- return FALSE;
-}
-
-Bool
-xf86VTSwitchAway()
-{
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
- return(FALSE);
- else
- return(TRUE);
- }
-#endif
- return FALSE;
-}
-
-Bool
-xf86VTSwitchTo()
-{
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
- return(FALSE);
- else
- return(TRUE);
- }
-#endif
- return(TRUE);
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c
deleted file mode 100644
index 250e5cb55..000000000
--- a/hw/xfree86/os-support/bsd/bsd_apm.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_apm.c,v 1.1 2000/02/29 03:09:25 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-#include "xf86_OSlib.h"
-
-#include <machine/apmvar.h>
-
-#define APM_DEVICE "/dev/apm"
-
-static pointer APMihPtr = NULL;
-static void bsdCloseAPM(void);
-
-static struct {
- u_int apmBsd;
- pmEvent xf86;
-} bsdToXF86Array [] = {
- { APM_STANDBY_REQ, XF86_APM_SYS_STANDBY },
- { APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND },
- { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
- { APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME },
- { APM_BATTERY_LOW, XF86_APM_LOW_BATTERY },
- { APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
- { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
- { APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND },
- { APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY },
- { APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND },
- { APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
-#ifdef APM_CAPABILITY_CHANGE
- { APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED },
-#endif
-};
-
-#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0]))
-
-static pmEvent
-bsdToXF86(int type)
-{
- int i;
-
- for (i = 0; i < numApmEvents; i++) {
- if (type == bsdToXF86Array[i].apmBsd) {
- return bsdToXF86Array[i].xf86;
- }
- }
- return XF86_APM_UNKNOWN;
-}
-
-/*
- * APM events can be requested direclty from /dev/apm
- */
-static int
-bsdPMGetEventFromOS(int fd, pmEvent *events, int num)
-{
- struct apm_event_info bsdEvent;
- int i;
-
- for (i = 0; i < num; i++) {
-
- if (ioctl(fd, APM_IOC_NEXTEVENT, &bsdEvent) < 0) {
- if (errno != EAGAIN) {
- xf86Msg(X_WARNING, "bsdPMGetEventFromOS: APM_IOC_NEXTEVENT"
- " errno = %d\n", errno);
- }
- break;
- }
- events[i] = bsdToXF86(bsdEvent.type);
- }
- return i;
-}
-
-/*
- * XXX This won't work on /dev/apm !
- * We should either use /dev/apm_ctl (and kill apmd(8))
- * or talk to apmd (but its protocol is not publically available)...
- */
-static pmWait
-bsdPMConfirmEventToOs(int fd, pmEvent event)
-{
- switch (event) {
- case XF86_APM_SYS_STANDBY:
- case XF86_APM_USER_STANDBY:
- if (ioctl( fd, APM_IOC_STANDBY, NULL ) == 0)
- return PM_WAIT; /* should we stop the Xserver in standby, too? */
- else
- return PM_NONE;
- case XF86_APM_SYS_SUSPEND:
- case XF86_APM_CRITICAL_SUSPEND:
- case XF86_APM_USER_SUSPEND:
- if (ioctl( fd, APM_IOC_SUSPEND, NULL ) == 0)
- return PM_WAIT;
- else
- return PM_NONE;
- case XF86_APM_STANDBY_RESUME:
- case XF86_APM_NORMAL_RESUME:
- case XF86_APM_CRITICAL_RESUME:
- case XF86_APM_STANDBY_FAILED:
- case XF86_APM_SUSPEND_FAILED:
- return PM_CONTINUE;
- default:
- return PM_NONE;
- }
-}
-
-PMClose
-xf86OSPMOpen(void)
-{
- int fd;
-
- if (APMihPtr || !xf86Info.pmFlag) {
- return NULL;
- }
-
- if ((fd = open(APM_DEVICE, O_RDWR)) == -1) {
- return NULL;
- }
- xf86PMGetEventFromOs = bsdPMGetEventFromOS;
- xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
- APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
- return bsdCloseAPM;
-}
-
-static void
-bsdCloseAPM(void)
-{
- int fd;
-
- if (APMihPtr) {
- fd = xf86RemoveInputHandler(APMihPtr);
- close(fd);
- APMihPtr = NULL;
- }
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c
deleted file mode 100644
index 91367078e..000000000
--- a/hw/xfree86/os-support/bsd/bsd_axp.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.3 2003/10/07 22:33:37 herrb Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Axp.h"
-#include <sys/param.h>
-#include "xf86_OSlib.h"
-#include <stdio.h>
-#include <sys/sysctl.h>
-
-axpDevice bsdGetAXP(void);
-
-/*
- * BSD does a very nice job providing system information to
- * user space programs. Unfortunately it doesn't provide all
- * the information required. Therefore we just obtain the
- * system type and look up the rest from a list we maintain
- * ourselves.
- */
-
-typedef struct {
- char *name;
- int type;
-} _AXP;
-
-static _AXP axpList[] = {
- {"apecs",APECS},
- {"pyxis",PYXIS},
- {"cia",CIA},
- {"irongate",IRONGATE},
- {"lca",LCA},
- {"t2",T2},
- {"tsunami",TSUNAMI},
- {NULL,NONE}
-};
-
-axpDevice
-bsdGetAXP(void)
-{
- int i;
- char sysname[64];
- size_t len = sizeof(sysname);
-
-#ifdef __OpenBSD__
- int mib[3];
- int error;
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CHIPSET;
- mib[2] = CPU_CHIPSET_TYPE;
-
- if ((error = sysctl(mib, 3, &sysname, &len, NULL, 0)) < 0)
-#else
- if ((sysctlbyname("hw.chipset.type", &sysname, &len,
- 0, 0)) < 0)
-#endif
- FatalError("bsdGetAXP: can't find machine type\n");
-#ifdef DEBUG
- xf86Msg(X_INFO,"AXP is a: %s\n",sysname);
-#endif
- for (i=0;;i++) {
- if (axpList[i].name == NULL)
- return NONE;
- if (!strcmp(sysname, axpList[i].name))
- return axpList[i].type;
- }
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_ev56.c b/hw/xfree86/os-support/bsd/bsd_ev56.c
deleted file mode 100644
index ec95306e8..000000000
--- a/hw/xfree86/os-support/bsd/bsd_ev56.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_ev56.c,v 1.2 2001/02/27 23:05:00 alanh Exp $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-int readDense8(pointer Base, register unsigned long Offset);
-int readDense16(pointer Base, register unsigned long Offset);
-int readDense32(pointer Base, register unsigned long Offset);
-void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-int
-readDense8(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD8*) ((unsigned long)Base+(Offset));
-}
-
-int
-readDense16(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD16*) ((unsigned long)Base+(Offset));
-}
-
-int
-readDense32(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD32*)((unsigned long)Base+(Offset));
-}
-
-void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD8*)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD16*)((unsigned long)Base + (Offset)) = Value;
-}
-
-void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD32*)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense8(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD8 *)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense16(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD16 *)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value;
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
deleted file mode 100644
index e4927d91a..000000000
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c,v 3.22 2003/10/07 23:14:55 herrb Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bsd_init.c /main/8 1996/10/23 13:13:05 kaleb $ */
-
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include <sys/utsname.h>
-#include <stdlib.h>
-
-static Bool KeepTty = FALSE;
-static int devConsoleFd = -1;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
-static int VTnum = -1;
-static int initialVT = -1;
-#endif
-
-#ifdef PCCONS_SUPPORT
-/* Stock 0.1 386bsd pccons console driver interface */
-#ifndef __OpenBSD__
-# define PCCONS_CONSOLE_DEV1 "/dev/ttyv0"
-#else
-# define PCCONS_CONSOLE_DEV1 "/dev/ttyC0"
-#endif
-#define PCCONS_CONSOLE_DEV2 "/dev/vga"
-#define PCCONS_CONSOLE_MODE O_RDWR|O_NDELAY
-#endif
-
-#ifdef SYSCONS_SUPPORT
-/* The FreeBSD 1.1 version syscons driver uses /dev/ttyv0 */
-#define SYSCONS_CONSOLE_DEV1 "/dev/ttyv0"
-#define SYSCONS_CONSOLE_DEV2 "/dev/vga"
-#define SYSCONS_CONSOLE_MODE O_RDWR|O_NDELAY
-#endif
-
-#ifdef PCVT_SUPPORT
-/* Hellmuth Michaelis' pcvt driver */
-#ifndef __OpenBSD__
-# define PCVT_CONSOLE_DEV "/dev/ttyv0"
-#else
-# define PCVT_CONSOLE_DEV "/dev/ttyC0"
-#endif
-#define PCVT_CONSOLE_MODE O_RDWR|O_NDELAY
-#endif
-
-#if defined(WSCONS_SUPPORT) && defined(__NetBSD__)
-/* NetBSD's new console driver */
-#define WSCONS_PCVT_COMPAT_CONSOLE_DEV "/dev/ttyE0"
-#endif
-
-#define CHECK_DRIVER_MSG \
- "Check your kernel's console driver configuration and /dev entries"
-
-static char *supported_drivers[] = {
-#ifdef PCCONS_SUPPORT
- "pccons (with X support)",
-#endif
-#ifdef SYSCONS_SUPPORT
- "syscons",
-#endif
-#ifdef PCVT_SUPPORT
- "pcvt",
-#endif
-#ifdef WSCONS_SUPPORT
- "wscons",
-#endif
-};
-
-
-/*
- * Functions to probe for the existance of a supported console driver.
- * Any function returns either a valid file descriptor (driver probed
- * succesfully), -1 (driver not found), or uses FatalError() if the
- * driver was found but proved to not support the required mode to run
- * an X server.
- */
-
-typedef int (*xf86ConsOpen_t)(void);
-
-#ifdef PCCONS_SUPPORT
-static int xf86OpenPccons(void);
-#endif /* PCCONS_SUPPORT */
-
-#ifdef SYSCONS_SUPPORT
-static int xf86OpenSyscons(void);
-#endif /* SYSCONS_SUPPORT */
-
-#ifdef PCVT_SUPPORT
-static int xf86OpenPcvt(void);
-#endif /* PCVT_SUPPORT */
-
-#ifdef WSCONS_SUPPORT
-static int xf86OpenWScons(void);
-#endif
-
-/*
- * The sequence of the driver probes is important; start with the
- * driver that is best distinguishable, and end with the most generic
- * driver. (Otherwise, pcvt would also probe as syscons, and either
- * pcvt or syscons might succesfully probe as pccons.)
- */
-static xf86ConsOpen_t xf86ConsTab[] = {
-#ifdef PCVT_SUPPORT
- xf86OpenPcvt,
-#endif
-#ifdef SYSCONS_SUPPORT
- xf86OpenSyscons,
-#endif
-#ifdef PCCONS_SUPPORT
- xf86OpenPccons,
-#endif
-#ifdef WSCONS_SUPPORT
- xf86OpenWScons,
-#endif
- (xf86ConsOpen_t)NULL
-};
-
-
-void
-xf86OpenConsole()
-{
- int i, fd = -1;
- xf86ConsOpen_t *driver;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- int result;
- struct utsname uts;
- vtmode_t vtmode;
-#endif
-
- if (serverGeneration == 1)
- {
- /* check if we are run with euid==0 */
- if (geteuid() != 0)
- {
- FatalError("xf86OpenConsole: Server must be suid root");
- }
-
- if (!KeepTty)
- {
- /*
- * detaching the controlling tty solves problems of kbd character
- * loss. This is not interesting for CO driver, because it is
- * exclusive.
- */
- setpgrp(0, getpid());
- if ((i = open("/dev/tty",O_RDWR)) >= 0)
- {
- ioctl(i,TIOCNOTTY,(char *)0);
- close(i);
- }
- }
-
- /* detect which driver we are running on */
- for (driver = xf86ConsTab; *driver; driver++)
- {
- if ((fd = (*driver)()) >= 0)
- break;
- }
-
- /* Check that a supported console driver was found */
- if (fd < 0)
- {
- char cons_drivers[80] = {0, };
- for (i = 0; i < sizeof(supported_drivers) / sizeof(char *); i++)
- {
- if (i)
- {
- strcat(cons_drivers, ", ");
- }
- strcat(cons_drivers, supported_drivers[i]);
- }
- FatalError(
- "%s: No console driver found\n\tSupported drivers: %s\n\t%s",
- "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
- }
-#if 0 /* stdin is already closed in OsInit() */
- fclose(stdin);
-#endif
- xf86Info.consoleFd = fd;
- xf86Info.screenFd = fd;
-
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_ON, 0) < 0)
- {
- FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s",
- "xf86OpenConsole", strerror(errno),
- CHECK_DRIVER_MSG);
- }
- /*
- * Hack to prevent keyboard hanging when syslogd closes
- * /dev/console
- */
- if ((devConsoleFd = open("/dev/console", O_WRONLY,0)) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: couldn't open /dev/console (%s)\n",
- strerror(errno));
- }
- break;
-#endif
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- /* as of FreeBSD 2.2.8, syscons driver does not need the #1 vt
- * switching anymore. Here we check for FreeBSD 3.1 and up.
- * Add cases for other *BSD that behave the same.
- */
- uname (&uts);
- if (strcmp(uts.sysname, "FreeBSD") == 0) {
- i = atof(uts.release) * 100;
- if (i >= 310) goto acquire_vt;
- }
- /* otherwise fall through */
- case PCVT:
- /*
- * First activate the #1 VT. This is a hack to allow a server
- * to be started while another one is active. There should be
- * a better way.
- */
- if (initialVT != 1) {
-
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) != 0)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- sleep(1);
- }
-
-acquire_vt:
- /*
- * now get the VT
- */
- SYSCALL(result =
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- SYSCALL(result =
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- }
-
- signal(SIGUSR1, xf86VTRequest);
-
- vtmode.mode = VT_PROCESS;
- vtmode.relsig = SIGUSR1;
- vtmode.acqsig = SIGUSR1;
- vtmode.frsig = SIGUSR1;
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &vtmode) < 0)
- {
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed");
- }
-#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
- if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0)
- {
- FatalError("xf86OpenConsole: KDENABIO failed (%s)",
- strerror(errno));
- }
-#endif
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
- {
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
- }
- break;
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- fprintf(stderr, "xf86OpenConsole\n");
- /* xf86Info.consoleFd = open("/dev/wskbd0", 0); */
- break;
-#endif
- }
- }
- else
- {
- /* serverGeneration != 1 */
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
- {
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- }
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
- }
- return;
-}
-
-
-#ifdef PCCONS_SUPPORT
-
-static int
-xf86OpenPccons()
-{
- int fd = -1;
-
- if ((fd = open(PCCONS_CONSOLE_DEV1, PCCONS_CONSOLE_MODE, 0))
- >= 0 ||
- (fd = open(PCCONS_CONSOLE_DEV2, PCCONS_CONSOLE_MODE, 0))
- >= 0)
- {
- if (ioctl(fd, CONSOLE_X_MODE_OFF, 0) < 0)
- {
- FatalError(
- "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s",
- "xf86OpenPccons",
- strerror(errno),
- "Was expecting pccons driver with X support",
- CHECK_DRIVER_MSG);
- }
- xf86Info.consType = PCCONS;
- xf86Msg(X_PROBED, "Using pccons driver with X support\n");
- }
- return fd;
-}
-
-#endif /* PCCONS_SUPPORT */
-
-#ifdef SYSCONS_SUPPORT
-
-static int
-xf86OpenSyscons()
-{
- int fd = -1;
- vtmode_t vtmode;
- char vtname[12];
- struct stat status;
- long syscons_version;
- MessageType from;
-
- /* Check for syscons */
- if ((fd = open(SYSCONS_CONSOLE_DEV1, SYSCONS_CONSOLE_MODE, 0)) >= 0
- || (fd = open(SYSCONS_CONSOLE_DEV2, SYSCONS_CONSOLE_MODE, 0)) >= 0)
- {
- if (ioctl(fd, VT_GETMODE, &vtmode) >= 0)
- {
- /* Get syscons version */
- if (ioctl(fd, CONS_GETVERS, &syscons_version) < 0)
- {
- syscons_version = 0;
- }
-
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
-
-#ifdef VT_GETACTIVE
- if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0)
- initialVT = -1;
-#endif
- if (xf86Info.vtno == -1)
- {
- /*
- * For old syscons versions (<0x100), VT_OPENQRY returns
- * the current VT rather than the next free VT. In this
- * case, the server gets started on the current VT instead
- * of the next free VT.
- */
-
-#if 0
- /* check for the fixed VT_OPENQRY */
- if (syscons_version >= 0x100)
- {
-#endif
- if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0)
- {
- /* No free VTs */
- xf86Info.vtno = -1;
- }
-#if 0
- }
-#endif
-
- if (xf86Info.vtno == -1)
- {
- /*
- * All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
- */
- if (initialVT != -1)
- {
- xf86Info.vtno = initialVT;
- }
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
- else
- {
- if (syscons_version >= 0x100)
- {
- FatalError("%s: Cannot find a free VT",
- "xf86OpenSyscons");
- }
- /* Should no longer reach here */
- FatalError("%s: %s %s\n\t%s %s",
- "xf86OpenSyscons",
- "syscons versions prior to 1.0 require",
- "either the",
- "server's stdin be a VT",
- "or the use of the vtxx server option");
- }
- }
- from = X_PROBED;
- }
-
- close(fd);
-#ifndef __OpenBSD__
- sprintf(vtname, "/dev/ttyv%01x", xf86Info.vtno - 1);
-#else
- sprintf(vtname, "/dev/ttyC%01x", xf86Info.vtno - 1);
-#endif
- if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0)
- {
- FatalError("xf86OpenSyscons: Cannot open %s (%s)",
- vtname, strerror(errno));
- }
- if (ioctl(fd, VT_GETMODE, &vtmode) < 0)
- {
- FatalError("xf86OpenSyscons: VT_GETMODE failed");
- }
- xf86Info.consType = SYSCONS;
- xf86Msg(X_PROBED, "Using syscons driver with X support");
- if (syscons_version >= 0x100)
- {
- xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8,
- syscons_version & 0xFF);
- }
- else
- {
- xf86ErrorF(" (version 0.x)\n");
- }
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
- }
- else
- {
- /* VT_GETMODE failed, probably not syscons */
- close(fd);
- fd = -1;
- }
- }
- return fd;
-}
-
-#endif /* SYSCONS_SUPPORT */
-
-
-#ifdef PCVT_SUPPORT
-
-static int
-xf86OpenPcvt()
-{
- /* This looks much like syscons, since pcvt is API compatible */
- int fd = -1;
- vtmode_t vtmode;
- char vtname[12], *vtprefix;
- struct stat status;
- struct pcvtid pcvt_version;
-
-#ifndef __OpenBSD__
- vtprefix = "/dev/ttyv";
-#else
- vtprefix = "/dev/ttyC";
-#endif
-
- fd = open(PCVT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0);
-#ifdef WSCONS_PCVT_COMPAT_CONSOLE_DEV
- if (fd < 0)
- {
- fd = open(WSCONS_PCVT_COMPAT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0);
- vtprefix = "/dev/ttyE";
- }
-#endif
- if (fd >= 0)
- {
- if (ioctl(fd, VGAPCVTID, &pcvt_version) >= 0)
- {
- if(ioctl(fd, VT_GETMODE, &vtmode) < 0)
- {
- FatalError("%s: VT_GETMODE failed\n%s%s\n%s",
- "xf86OpenPcvt",
- "Found pcvt driver but X11 seems to be",
- " not supported.", CHECK_DRIVER_MSG);
- }
-
- xf86Info.vtno = VTnum;
-
- if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0)
- initialVT = -1;
-
- if (xf86Info.vtno == -1)
- {
- if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0)
- {
- /* No free VTs */
- xf86Info.vtno = -1;
- }
-
- if (xf86Info.vtno == -1)
- {
- /*
- * All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
- */
- if (initialVT != -1)
- {
- xf86Info.vtno = initialVT;
- }
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
- else
- {
- FatalError("%s: Cannot find a free VT",
- "xf86OpenPcvt");
- }
- }
- }
-
- close(fd);
- sprintf(vtname, "%s%01x", vtprefix, xf86Info.vtno - 1);
- if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0)
- {
- FatalError("xf86OpenPcvt: Cannot open %s (%s)",
- vtname, strerror(errno));
- }
- if (ioctl(fd, VT_GETMODE, &vtmode) < 0)
- {
- FatalError("xf86OpenPcvt: VT_GETMODE failed");
- }
- xf86Info.consType = PCVT;
-#ifdef WSCONS_SUPPORT
- xf86Msg(X_PROBED,
- "Using wscons driver in pcvt compatibility mode "
- "(version %d.%d)\n",
- pcvt_version.rmajor, pcvt_version.rminor);
-#else
- xf86Msg(X_PROBED, "Using pcvt driver (version %d.%d)\n",
- pcvt_version.rmajor, pcvt_version.rminor);
-#endif
- }
- else
- {
- /* Not pcvt */
- close(fd);
- fd = -1;
- }
- }
- return fd;
-}
-
-#endif /* PCVT_SUPPORT */
-
-#ifdef WSCONS_SUPPORT
-
-static int
-xf86OpenWScons()
-{
- int fd = -1;
- int mode = WSDISPLAYIO_MODE_MAPPED;
- int i;
- char ttyname[16];
-
- /* XXX Is this ok? */
- for (i = 0; i < 8; i++) {
-#if defined(__NetBSD__)
- sprintf(ttyname, "/dev/ttyE%d", i);
-#elif defined(__OpenBSD__)
- sprintf(ttyname, "/dev/ttyC%d", i);
-#endif
- if ((fd = open(ttyname, 2)) != -1)
- break;
- }
- if (fd != -1) {
- if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) < 0) {
- FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s",
- "xf86OpenConsole", strerror(errno),
- CHECK_DRIVER_MSG);
- }
- xf86Info.consType = WSCONS;
- xf86Msg(X_PROBED, "Using wscons driver\n");
- }
- return fd;
-}
-
-#endif /* WSCONS_SUPPORT */
-
-void
-xf86CloseConsole()
-{
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)
- struct vt_mode VT;
-#endif
-
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:
- ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_OFF, 0);
- break;
-#endif /* PCCONS_SUPPORT */
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode */
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO;
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */
- }
-#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
- if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0)
- {
- xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
- strerror(errno));
- }
-#endif
- if (initialVT != -1)
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT);
- break;
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- {
- int mode = WSDISPLAYIO_MODE_EMUL;
- ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
- break;
- }
-#endif
- }
-
- if (xf86Info.screenFd != xf86Info.consoleFd)
- {
- close(xf86Info.screenFd);
- close(xf86Info.consoleFd);
- if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
- {
- xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
- strerror(errno));
- }
- }
- close(xf86Info.consoleFd);
- if (devConsoleFd >= 0)
- close(devConsoleFd);
- return;
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful
- * when debugging (so the server can receive keyboard signals.
- */
- if (!strcmp(argv[i], "-keeptty"))
- {
- KeepTty = TRUE;
- return(1);
- }
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0 ||
- VTnum < 1 || VTnum > 12)
- {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- return(1);
- }
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
- return(0);
-}
-
-void
-xf86UseMsg()
-{
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- ErrorF("vtXX use the specified VT number (1-12)\n");
-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
- ErrorF("-keeptty ");
- ErrorF("don't detach controlling tty (for debugging only)\n");
- return;
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_io.c b/hw/xfree86/os-support/bsd/bsd_io.c
deleted file mode 100644
index 0f40ba707..000000000
--- a/hw/xfree86/os-support/bsd/bsd_io.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c,v 3.23 2002/10/21 20:38:04 herrb Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Dawes make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bsd_io.c /main/11 1996/10/19 18:06:07 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifdef WSCONS_SUPPORT
-#define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd)
-#endif
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
-#ifdef WSCONS_SUPPORT
- struct wskbd_bell_data wsb;
-#endif
-
- if (loudness && pitch)
- {
-#ifdef PCCONS_SUPPORT
- int data[2];
-#endif
-
- switch (xf86Info.consType) {
-
-#ifdef PCCONS_SUPPORT
- case PCCONS:
- data[0] = pitch;
- data[1] = (duration * loudness) / 50;
- ioctl(xf86Info.consoleFd, CONSOLE_X_BELL, data);
- break;
-#endif
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDMKTONE,
- ((1193190 / pitch) & 0xffff) |
- (((unsigned long)duration*loudness/50)<<16));
- break;
-#endif
-#if defined (WSCONS_SUPPORT)
- case WSCONS:
- wsb.which = WSKBD_BELL_DOALL;
- wsb.pitch = pitch;
- wsb.period = duration;
- wsb.volume = loudness;
- ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL,
- &wsb);
- break;
-#endif
- }
- }
-}
-
-void
-xf86SetKbdLeds(int leds)
-{
- switch (xf86Info.consType) {
-
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDSETLED, leds);
- break;
-#endif
-#if defined(WSCONS_SUPPORT)
- case WSCONS:
- ioctl(KBD_FD(xf86Info), WSKBDIO_SETLEDS, &leds);
- break;
-#endif
- }
-}
-
-int
-xf86GetKbdLeds()
-{
- int leds = 0;
-
- switch (xf86Info.consType) {
-
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDGETLED, &leds);
- break;
-#endif
-#if defined(WSCONS_SUPPORT)
- case WSCONS:
- ioctl(KBD_FD(xf86Info), WSKBDIO_GETLEDS, &leds);
- break;
-#endif
- }
- return(leds);
-}
-
-void
-xf86SetKbdRepeat(char rad)
-{
- switch (xf86Info.consType) {
-
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDSETRAD, rad);
- break;
-#endif
- }
-}
-
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
-static struct termio kbdtty;
-#endif
-
-void
-xf86KbdInit()
-{
- switch (xf86Info.consType) {
-
-#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case PCCONS:
- case SYSCONS:
- case PCVT:
- tcgetattr(xf86Info.consoleFd, &kbdtty);
- break;
-#endif
-#if defined WSCONS_SUPPORT
- case WSCONS:
- if (xf86Info.kbdFd != -1)
- xf86FlushInput(xf86Info.kbdFd);
- else
- tcgetattr(xf86Info.consoleFd, &kbdtty);
- break;
-#endif
- }
-}
-
-int
-xf86KbdOn()
-{
- struct termios nTty;
-#ifdef WSCONS_SUPPORT
- int option;
-#endif
-
-
- switch (xf86Info.consType) {
-
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
- case SYSCONS:
- case PCCONS:
- case PCVT:
- nTty = kbdtty;
- nTty.c_iflag = IGNPAR | IGNBRK;
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
- cfsetispeed(&nTty, 9600);
- cfsetospeed(&nTty, 9600);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
-
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW);
-#endif
- break;
-#endif
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- if (xf86Info.kbdFd == -1) {
- nTty = kbdtty;
- nTty.c_iflag = IGNPAR | IGNBRK;
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
- cfsetispeed(&nTty, 9600);
- cfsetospeed(&nTty, 9600);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
- option = WSKBD_RAW;
- if (ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE,
- &option) == -1)
- FatalError("can't switch keyboard to raw mode. "
- "Enable support for it in the kernel\n"
- "or use for example:\n\n"
- "Option \"Protocol\" \"wskbd\"\n"
- "Option \"Device\" \"/dev/wskbd0\"\n"
- "\nin your XF86Config(5) file\n");
- } else {
- return xf86Info.kbdFd;
- }
-#endif
- }
- return(xf86Info.consoleFd);
-}
-
-int
-xf86KbdOff()
-{
-#ifdef WSCONS_SUPPORT
- int option;
-#endif
-
- switch (xf86Info.consType) {
-
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(xf86Info.consoleFd, KDSKBMODE, K_XLATE);
- /* FALL THROUGH */
-#endif
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
- case PCCONS:
- tcsetattr(xf86Info.consoleFd, TCSANOW, &kbdtty);
- break;
-#endif
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- if (xf86Info.kbdFd != -1) {
- return xf86Info.kbdFd;
- } else {
- option = WSKBD_TRANSLATED;
- ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &kbdtty);
- }
- break;
-#endif
- }
- return(xf86Info.consoleFd);
-}
-
-#ifdef WSCONS_SUPPORT
-
-#define NUMEVENTS 64
-
-void
-xf86WSKbdEvents(void)
-{
- static struct wscons_event events[NUMEVENTS];
- int n, i;
-
- n = read(xf86Info.kbdFd, events, sizeof events);
- if (n <= 0)
- return;
- n /= sizeof(struct wscons_event);
- for (i = 0; i < n; i++)
- xf86PostWSKbdEvent(&events[i]);
-}
-
-#endif /* WSCONS_SUPPORT */
-
-
diff --git a/hw/xfree86/os-support/bsd/bsd_jstk.c b/hw/xfree86/os-support/bsd/bsd_jstk.c
deleted file mode 100644
index 7f24124dc..000000000
--- a/hw/xfree86/os-support/bsd/bsd_jstk.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright 1995 by Frederic Lepied, France. <fred@sugix.frmug.fr.net>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Frederic Lepied not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* Modified for FreeBSD by David Dawes <dawes@XFree86.org> */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_jstk.c,v 3.8 2002/08/06 13:20:47 herrb Exp $ */
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <machine/joystick.h>
-#include <fcntl.h>
-
-#ifdef XFree86LOADER
-#include "misc.h"
-#include "xf86_libc.h"
-#endif
-#include "xf86.h"
-
-#define JS_RETURN sizeof(struct joystick)
-
-/***********************************************************************
- *
- * xf86JoystickOn --
- *
- * open the device and init timeout according to the device value.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickOn(char * name, int *timeout, int *centerX, int *centerY)
-{
- int status;
- int changed = 0;
- int timeinmicros;
- struct joystick js;
-
-#ifdef DEBUG
- ErrorF("xf86JoystickOn: %s\n", name);
-#endif
-
- if ((status = open(name, O_RDWR | O_NDELAY, 0)) < 0)
- {
- xf86Msg(X_WARNING, "xf86JoystickOn: Cannot open joystick '%s' (%s)\n",
- name, strerror(errno));
- return -1;
- }
-
- if (*timeout <= 0) {
- /* Use the current setting */
- ioctl(status, JOY_GETTIMEOUT, (char *)&timeinmicros);
- *timeout = timeinmicros / 1000;
- if (*timeout == 0)
- *timeout = 1;
- changed = 1;
- }
- /* Maximum allowed timeout in the FreeBSD driver is 10ms */
- if (*timeout > 10) {
- *timeout = 10;
- changed = 1;
- }
-
- if (changed)
- xf86Msg(X_PROBED, "Joystick: timeout value = %d\n", *timeout);
-
- timeinmicros = *timeout * 1000;
-
- /* Assume the joystick is centred when this is called */
- read(status, &js, JS_RETURN);
- if (*centerX < 0) {
- *centerX = js.x;
- xf86Msg(X_PROBED, "Joystick: CenterX set to %d\n", *centerX);
- }
- if (*centerY < 0) {
- *centerY = js.y;
- xf86Msg(X_PROBED, "Joystick: CenterY set to %d\n", *centerY);
- }
-
- return status;
-}
-
-/***********************************************************************
- *
- * xf86JoystickInit --
- *
- * called when X device is initialized.
- *
- ***********************************************************************
- */
-
-void
-xf86JoystickInit()
-{
- return;
-}
-
-/***********************************************************************
- *
- * xf86JoystickOff --
- *
- * close the handle.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickOff(int *fd, int doclose)
-{
- int oldfd;
-
- if (((oldfd = *fd) >= 0) && doclose) {
- close(*fd);
- *fd = -1;
- }
- return oldfd;
-}
-
-/***********************************************************************
- *
- * xf86JoystickGetState --
- *
- * return the state of buttons and the position of the joystick.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickGetState(int fd, int *x, int *y, int *buttons)
-{
- struct joystick js;
- int status;
-
- status = read(fd, &js, JS_RETURN);
-
- if (status != JS_RETURN)
- {
- Error("Joystick read");
- return 0;
- }
-
- *x = js.x;
- *y = js.y;
- *buttons = js.b1 | (js.b2 << 1);
-#ifdef DEBUG
- ErrorF("xf86JoystickGetState: x = %d, y = %d, buttons = %d\n", *x, *y,
- *buttons);
-#endif
-
- return 1;
-}
-
-#ifdef XFree86LOADER
-/*
- * Entry point for XFree86 Loader
- */
-void
-bsd_jstkModuleInit(pointer *data, INT32 *magic)
-{
- *magic = MAGIC_DONE;
- *data = NULL;
-}
-#endif
-/* end of bsd_jstk.c */
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c
deleted file mode 100644
index 0d586ef72..000000000
--- a/hw/xfree86/os-support/bsd/bsd_kbd.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.8 2003/11/04 03:16:58 tsi Exp $ */
-
-/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
- * Author: Ivan Pascal.
- *
- * Based on the code from bsd_io.c which is
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- */
-
-#define NEED_EVENTS
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include "xf86Xinput.h"
-#include "xf86OSKbd.h"
-#include "atKeynames.h"
-#include "bsd_kbd.h"
-
-extern Bool VTSwitchEnabled;
-#ifdef USE_VT_SYSREQ
-extern Bool VTSysreqToggle;
-#endif
-
-static KbdProtocolRec protocols[] = {
- {"standard", PROT_STD },
-#ifdef WSCONS_SUPPORT
- {"wskbd", PROT_WSCONS },
-#endif
- { NULL, PROT_UNKNOWN_KBD }
-};
-
-typedef struct {
- struct termio kbdtty;
-} BsdKbdPrivRec, *BsdKbdPrivPtr;
-
-static
-int KbdInit(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
-
- if (pKbd->isConsole) {
- switch (pKbd->consType) {
-#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
- case PCCONS:
- case SYSCONS:
- case PCVT:
-#if defined WSCONS_SUPPORT
- case WSCONS:
-#endif
- tcgetattr(pInfo->fd, &(priv->kbdtty));
-#endif
- break;
- }
- }
-
- return Success;
-}
-
-static void
-SetKbdLeds(InputInfoPtr pInfo, int leds)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int real_leds = 0;
-
- if (leds & XLED1) real_leds |= LED_CAP;
- if (leds & XLED2) real_leds |= LED_NUM;
- if (leds & XLED3) real_leds |= LED_SCR;
- if (leds & XLED4) real_leds |= LED_SCR;
-
- switch (pKbd->consType) {
-
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(pInfo->fd, KDSETLED, real_leds);
- break;
-#endif
-#if defined(WSCONS_SUPPORT)
- case WSCONS:
- ioctl(pInfo->fd, WSKBDIO_SETLEDS, &real_leds);
- break;
-#endif
- }
-}
-
-static int
-GetKbdLeds(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int leds = 0, real_leds = 0;
-
- switch (pKbd->consType) {
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(pInfo->fd, KDGETLED, &real_leds);
- break;
-#endif
-#if defined(WSCONS_SUPPORT)
- case WSCONS:
- ioctl(pInfo->fd, WSKBDIO_GETLEDS, &real_leds);
- break;
-#endif
- }
-
- if (real_leds & LED_CAP) leds |= XLED1;
- if (real_leds & LED_NUM) leds |= XLED2;
- if (real_leds & LED_SCR) leds |= XLED3;
-
- return(leds);
-}
-
-static void
-SetKbdRepeat(InputInfoPtr pInfo, char rad)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- switch (pKbd->consType) {
-
- case PCCONS:
- break;
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(pInfo->fd, KDSETRAD, rad);
- break;
-#endif
- }
-}
-
-static int
-KbdOn(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
- BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
- struct termios nTty;
-#endif
-#ifdef WSCONS_SUPPORT
- int option;
-#endif
-
- if (pKbd->isConsole) {
- switch (pKbd->consType) {
-
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
- case SYSCONS:
- case PCCONS:
- case PCVT:
-#ifdef WSCONS_SUPPORT
- case WSCONS:
-#endif
- nTty = priv->kbdtty;
- nTty.c_iflag = IGNPAR | IGNBRK;
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
- cfsetispeed(&nTty, 9600);
- cfsetospeed(&nTty, 9600);
- tcsetattr(pInfo->fd, TCSANOW, &nTty);
- break;
-#endif
- }
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
- switch (pKbd->consType) {
- case SYSCONS:
- case PCVT:
-#ifdef K_CODE
- if (pKbd->CustomKeycodes)
- ioctl(pInfo->fd, KDSKBMODE, K_CODE);
- else
- ioctl(pInfo->fd, KDSKBMODE, K_RAW);
-#else
- ioctl(pInfo->fd, KDSKBMODE, K_RAW);
-#endif
- break;
-#endif
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- option = WSKBD_RAW;
- if (ioctl(pInfo->fd, WSKBDIO_SETMODE, &option) == -1) {
- FatalError("can't switch keyboard to raw mode. "
- "Enable support for it in the kernel\n"
- "or use for example:\n\n"
- "Option \"Protocol\" \"wskbd\"\n"
- "Option \"Device\" \"/dev/wskbd0\"\n"
- "\nin your XF86Config(5) file\n");
- }
- break;
-#endif
- }
- }
- return Success;
-}
-
-static int
-KbdOff(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
-#ifdef WSCONS_SUPPORT
- int option;
-#endif
-
- if (pKbd->isConsole) {
- switch (pKbd->consType) {
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(pInfo->fd, KDSKBMODE, K_XLATE);
- /* FALL THROUGH */
-#endif
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
- case PCCONS:
- tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
- break;
-#endif
-#ifdef WSCONS_SUPPORT
- case WSCONS:
- option = WSKBD_TRANSLATED;
- ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &(priv->kbdtty));
- break;
-#endif
- }
- }
- return Success;
-}
-
-static void
-SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-#ifdef WSCONS_SUPPORT
- struct wskbd_bell_data wsb;
-#endif
-
- if (loudness && pitch) {
- switch (pKbd->consType) {
-#ifdef PCCONS_SUPPORT
- case PCCONS:
- { int data[2];
- data[0] = pitch;
- data[1] = (duration * loudness) / 50;
- ioctl(pInfo->fd, CONSOLE_X_BELL, data);
- break;
- }
-#endif
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- case SYSCONS:
- case PCVT:
- ioctl(pInfo->fd, KDMKTONE,
- ((1193190 / pitch) & 0xffff) |
- (((unsigned long)duration*loudness/50)<<16));
- break;
-#endif
-#if defined (WSCONS_SUPPORT)
- case WSCONS:
- wsb.which = WSKBD_BELL_DOALL;
- wsb.pitch = pitch;
- wsb.period = duration;
- wsb.volume = loudness;
- ioctl(pInfo->fd, WSKBDIO_COMPLEXBELL, &wsb);
- break;
-#endif
- }
- }
-}
-
-#define ModifierSet(k) ((modifiers & (k)) == (k))
-
-static
-Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-
- if(!pKbd->vtSwitchSupported)
- return FALSE;
-
- if ((ModifierSet(ControlMask | AltMask)) ||
- (ModifierSet(ControlMask | AltLangMask))) {
- if (VTSwitchEnabled && !xf86Info.vtSysreq) {
- switch (key) {
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- if (down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
- return TRUE;
- }
- case KEY_F11:
- case KEY_F12:
- if (down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
- return TRUE;
- }
- }
- }
- }
-#ifdef USE_VT_SYSREQ
- if (VTSwitchEnabled && xf86Info.vtSysreq) {
- switch (key) {
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- if (VTSysreqToggle && down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
- VTSysreqToggle = FALSE;
- return TRUE;
- }
- break;
- case KEY_F11:
- case KEY_F12:
- if (VTSysreqToggle && down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
- VTSysreqToggle = FALSE;
- return TRUE;
- }
- break;
- /* Ignore these keys -- ie don't let them cancel an alt-sysreq */
- case KEY_Alt:
- case KEY_AltLang:
- break;
- case KEY_SysReqest:
- if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down)
- VTSysreqToggle = TRUE;
- break;
- default:
- /*
- * We only land here when Alt-SysReq is followed by a
- * non-switching key.
- */
- if (VTSysreqToggle)
- VTSysreqToggle = FALSE;
- }
- }
-#endif /* USE_VT_SYSREQ */
-
- return FALSE;
-}
-
-static void
-stdReadInput(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- unsigned char rBuf[64];
- int nBytes, i;
- if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
- for (i = 0; i < nBytes; i++)
- pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
- rBuf[i] & 0x80 ? FALSE : TRUE);
- }
-}
-
-#ifdef WSCONS_SUPPORT
-static void
-WSReadInput(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- struct wscons_event events[64];
- int n, i;
- if ((n = read( pInfo->fd, events, sizeof(events))) > 0) {
- n /= sizeof(struct wscons_event);
- for (i = 0; i < n; i++)
- pKbd->PostEvent(pInfo, events[i].value,
- events[i].type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
- }
-}
-#endif
-
-#ifdef WSCONS_SUPPORT
-static void
-printWsType(char *type, char *devname)
-{
- xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", type, devname);
-}
-#endif
-
-static Bool
-OpenKeyboard(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int i;
- KbdProtocolId prot = PROT_UNKNOWN_KBD;
- char *s;
-
- s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
- for (i = 0; protocols[i].name; i++) {
- if (xf86NameCmp(s, protocols[i].name) == 0) {
- prot = protocols[i].id;
- break;
- }
- }
-
- switch (prot) {
- case PROT_STD:
- pInfo->read_input = stdReadInput;
- break;
-#ifdef WSCONS_SUPPORT
- case PROT_WSCONS:
- pInfo->read_input = WSReadInput;
- break;
-#endif
- default:
- xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s);
- xfree(s);
- return FALSE;
- }
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s);
- xfree(s);
-
- s = xf86SetStrOption(pInfo->options, "Device", NULL);
- if (s == NULL) {
- if (prot == PROT_WSCONS) {
- xf86Msg(X_ERROR,"A \"device\" option is required with"
- " the \"wskbd\" keyboard protocol\n");
- return FALSE;
- } else {
- pInfo->fd = xf86Info.consoleFd;
- pKbd->isConsole = TRUE;
- pKbd->consType = xf86Info.consType;
- }
- } else {
- pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
- if (pInfo->fd == -1) {
- xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
- xfree(s);
- return FALSE;
- }
- pKbd->isConsole = FALSE;
- /* XXX What is consType here? */
- pKbd->consType = SYSCONS;
- xfree(s);
- }
-
-#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (pKbd->isConsole &&
- ((pKbd->consType == SYSCONS) || (pKbd->consType == PCVT)))
- pKbd->vtSwitchSupported = TRUE;
-#endif
-
-#ifdef WSCONS_SUPPORT
- if( prot == PROT_WSCONS) {
- pKbd->consType = WSCONS;
- /* Find out keyboard type */
- if (ioctl(pInfo->fd, WSKBDIO_GTYPE, &(pKbd->wsKbdType)) == -1) {
- xf86Msg(X_ERROR, "%s: cannot get keyboard type", pInfo->name);
- close(pInfo->fd);
- return FALSE;
- }
- switch (pKbd->wsKbdType) {
- case WSKBD_TYPE_PC_XT:
- printWsType("XT", pInfo->name);
- break;
- case WSKBD_TYPE_PC_AT:
- printWsType("AT", pInfo->name);
- break;
- case WSKBD_TYPE_USB:
- printWsType("USB", pInfo->name);
- break;
-#ifdef WSKBD_TYPE_ADB
- case WSKBD_TYPE_ADB:
- printWsType("ADB", pInfo->name);
- break;
-#endif
-#ifdef WSKBD_TYPE_SUN
- case WSKBD_TYPE_SUN:
- printWsType("Sun", pInfo->name);
- break;
-#endif
- default:
- xf86Msg(X_ERROR, "%s: Unsupported wskbd type \"%d\"",
- pKbd->wsKbdType, pInfo->name);
- close(pInfo->fd);
- return FALSE;
- }
- }
-#endif
- return TRUE;
-}
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = pInfo->private;
-
- pKbd->KbdInit = KbdInit;
- pKbd->KbdOn = KbdOn;
- pKbd->KbdOff = KbdOff;
- pKbd->Bell = SoundBell;
- pKbd->SetLeds = SetKbdLeds;
- pKbd->GetLeds = GetKbdLeds;
- pKbd->SetKbdRepeat = SetKbdRepeat;
- pKbd->KbdGetMapping = KbdGetMapping;
- pKbd->SpecialKey = SpecialKey;
-
- pKbd->RemapScanCode = NULL;
- pKbd->GetSpecialKey = NULL;
-
- pKbd->OpenKeyboard = OpenKeyboard;
- pKbd->vtSwitchSupported = FALSE;
- pKbd->CustomKeycodes = FALSE;
-
- pKbd->private = xcalloc(sizeof(BsdKbdPrivRec), 1);
- if (pKbd->private == NULL) {
- xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
- return FALSE;
- }
- return TRUE;
-}
-
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.h b/hw/xfree86/os-support/bsd/bsd_kbd.h
deleted file mode 100644
index c042d88bf..000000000
--- a/hw/xfree86/os-support/bsd/bsd_kbd.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
-
-extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
- CARD8 *pModMap);
-
diff --git a/hw/xfree86/os-support/bsd/bsd_kmod.c b/hw/xfree86/os-support/bsd/bsd_kmod.c
deleted file mode 100644
index 74345654b..000000000
--- a/hw/xfree86/os-support/bsd/bsd_kmod.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kmod.c,v 3.2 2002/11/29 17:47:24 tsi Exp $ */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/linker.h>
-
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-/*
- * Load a FreeBSD kernel module.
- * This is used by the DRI/DRM to load a DRM kernel module when
- * the X server starts. It could be used for other purposes in the future.
- * Input:
- * modName - name of the kernel module (Ex: "tdfx")
- * Return:
- * 0 for failure, 1 for success
- */
-int xf86LoadKernelModule(const char *modName)
-{
- if (kldload(modName) != -1)
- return 1;
- else
- return 0;
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
deleted file mode 100644
index 53fe8c3be..000000000
--- a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c,v 1.5 2002/07/30 23:24:32 herrb Exp $ */
-/*
- * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES
- * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- */
-/* $OpenBSD: bsd_kqueue_apm.c,v 1.5 2002/07/30 23:07:42 matthieu Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-#include "xf86_OSlib.h"
-
-#include <sys/event.h>
-#include <machine/apmvar.h>
-
-#define _PATH_APM_SOCKET "/var/run/apmdev"
-#define _PATH_APM_DEV "/dev/apm"
-#define _PATH_APM_CTLDEV "/dev/apmctl"
-
-static pointer APMihPtr = NULL;
-static int devFd = -1;
-static int ctlFd = -1;
-static void bsdCloseAPM(void);
-
-static struct {
- u_int apmBsd;
- pmEvent xf86;
-} bsdToXF86Array [] = {
- { APM_STANDBY_REQ, XF86_APM_SYS_STANDBY },
- { APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND },
- { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
- { APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME },
- { APM_BATTERY_LOW, XF86_APM_LOW_BATTERY },
- { APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
- { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
- { APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND },
- { APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY },
- { APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND },
- { APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
-#ifdef APM_CAPABILITY_CHANGE
- { APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED },
-#endif
-};
-
-#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0]))
-
-static pmEvent
-bsdToXF86(int type)
-{
- int i;
-
- for (i = 0; i < numApmEvents; i++) {
- if (type == bsdToXF86Array[i].apmBsd) {
- return bsdToXF86Array[i].xf86;
- }
- }
- return XF86_APM_UNKNOWN;
-}
-
-/*
- * APM events can be requested direclty from /dev/apm
- */
-static int
-bsdPMGetEventFromOS(int kq, pmEvent *events, int num)
-{
- struct kevent ev;
- int i, result;
- struct timespec ts = { 0, 0 };
-
- for (i = 0; i < num; i++) {
- result = kevent(kq, NULL, 0, &ev, 1, &ts);
- if (result == 0 || APM_EVENT_TYPE(ev.data) == APM_NOEVENT) {
- /* no event */
- break;
- } else if (result < 0) {
- xf86Msg(X_WARNING, "bsdPMGetEventFromOS: kevent returns"
- " errno = %d\n", errno);
- break;
- }
- events[i] = bsdToXF86(APM_EVENT_TYPE(ev.data));
- }
- return i;
-}
-
-/*
- * If apmd(8) is running, he will get the events and handle them,
- * so, we've nothing to do here.
- * Otherwise, opening /dev/apmctl will succeed and we have to send the
- * confirmations to /dev/apmctl.
- */
-static pmWait
-bsdPMConfirmEventToOs(int dummyfd, pmEvent event)
-{
- if (ctlFd < 0) {
- if ((ctlFd = open(_PATH_APM_CTLDEV, O_RDWR)) < 0) {
- return PM_NONE;
- }
- }
- /* apmctl open succeedeed */
- switch (event) {
- case XF86_APM_SYS_STANDBY:
- case XF86_APM_USER_STANDBY:
- if (ioctl( ctlFd, APM_IOC_STANDBY, NULL ) == 0)
- return PM_WAIT; /* should we stop the Xserver in standby, too? */
- else
- return PM_NONE;
-
- case XF86_APM_SYS_SUSPEND:
- case XF86_APM_CRITICAL_SUSPEND:
- case XF86_APM_USER_SUSPEND:
- if (ioctl( ctlFd, APM_IOC_SUSPEND, NULL ) == 0)
- return PM_WAIT;
- else
- return PM_NONE;
- break;
- case XF86_APM_STANDBY_RESUME:
- case XF86_APM_NORMAL_RESUME:
- case XF86_APM_CRITICAL_RESUME:
- case XF86_APM_STANDBY_FAILED:
- case XF86_APM_SUSPEND_FAILED:
- return PM_CONTINUE;
- break;
- default:
- return PM_NONE;
- }
-}
-
-PMClose
-xf86OSPMOpen(void)
-{
- int kq;
- struct kevent ev;
-
- if (APMihPtr || !xf86Info.pmFlag) {
- return NULL;
- }
- if ((devFd = open(_PATH_APM_DEV, O_RDONLY)) == -1) {
- return NULL;
- }
- if ((kq = kqueue()) <= 0) {
- close(devFd);
- return NULL;
- }
- EV_SET(&ev, devFd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR,
- 0, 0, NULL);
- if (kevent(kq, &ev, 1, NULL, 0, NULL) < 0) {
- close(devFd);
- return NULL;
- }
-
- xf86PMGetEventFromOs = bsdPMGetEventFromOS;
- xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
- APMihPtr = xf86AddInputHandler(kq, xf86HandlePMEvents, NULL);
- return bsdCloseAPM;
-}
-
-static void
-bsdCloseAPM(void)
-{
- int kq;
-
- if (APMihPtr) {
- kq = xf86RemoveInputHandler(APMihPtr);
- close(devFd);
- devFd = -1;
- close(kq);
- if (ctlFd >= 0) {
- close(ctlFd);
- ctlFd = -1;
- }
- APMihPtr = NULL;
- }
-}
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
deleted file mode 100644
index 943bb9855..000000000
--- a/hw/xfree86/os-support/bsd/bsd_mouse.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.26 2003/10/10 20:56:05 herrb Exp $ */
-
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xisb.h"
-#include "mipointer.h"
-#ifdef WSCONS_SUPPORT
-#include <dev/wscons/wsconsio.h>
-#endif
-#ifdef USBMOUSE_SUPPORT
-#ifdef HAS_LIB_USB_HID
-#include <usbhid.h>
-#else
-#include "usb.h"
-#endif
-
-#include <dev/usb/usb.h>
-#ifdef USB_GET_REPORT_ID
-#define USB_NEW_HID
-#endif
-
-#define HUP_GENERIC_DESKTOP 0x0001
-#define HUP_BUTTON 0x0009
-
-#define HUG_X 0x0030
-#define HUG_Y 0x0031
-#define HUG_Z 0x0032
-#define HUG_WHEEL 0x0038
-
-#define HID_USAGE2(p,u) (((p) << 16) | u)
-
-/* The UMS mices have middle button as number 3 */
-#define UMS_BUT(i) ((i) == 0 ? 2 : (i) == 1 ? 0 : (i) == 2 ? 1 : (i))
-#endif /* USBMOUSE_SUPPORT */
-
-#ifdef USBMOUSE_SUPPORT
-static void usbSigioReadInput (int fd, void *closure);
-#endif
-
-#if defined(__FreeBSD__)
-/* These are for FreeBSD */
-#define DEFAULT_MOUSE_DEV "/dev/mouse"
-#define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
-#define DEFAULT_PS2_DEV "/dev/psm0"
-
-static const char *mouseDevs[] = {
- DEFAULT_MOUSE_DEV,
- DEFAULT_SYSMOUSE_DEV,
- DEFAULT_PS2_DEV,
- NULL
-};
-#endif
-
-static int
-SupportedInterfaces(void)
-{
-#if defined(__NetBSD__)
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
-#elif defined(__FreeBSD__)
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
-#else
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
-#endif
-}
-
-/* Names of protocols that are handled internally here. */
-static const char *internalNames[] = {
-#if defined(WSCONS_SUPPORT)
- "WSMouse",
-#endif
-#if defined(USBMOUSE_SUPPORT)
- "usb",
-#endif
- NULL
-};
-
-/*
- * Names of MSC_MISC protocols that the OS supports. These are decoded by
- * main "mouse" driver.
- */
-static const char *miscNames[] = {
-#if defined(__FreeBSD__)
- "SysMouse",
-#endif
- NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
- return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
- int i;
-
- for (i = 0; internalNames[i]; i++)
- if (xf86NameCmp(protocol, internalNames[i]) == 0)
- return TRUE;
- for (i = 0; miscNames[i]; i++)
- if (xf86NameCmp(protocol, miscNames[i]) == 0)
- return TRUE;
- return FALSE;
-}
-
-static const char *
-DefaultProtocol(void)
-{
-#if defined(__FreeBSD__)
- return "Auto";
-#else
- return NULL;
-#endif
-}
-
-#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
-static struct {
- int dproto;
- const char *name;
-} devproto[] = {
- { MOUSE_PROTO_MS, "Microsoft" },
- { MOUSE_PROTO_MSC, "MouseSystems" },
- { MOUSE_PROTO_LOGI, "Logitech" },
- { MOUSE_PROTO_MM, "MMSeries" },
- { MOUSE_PROTO_LOGIMOUSEMAN, "MouseMan" },
- { MOUSE_PROTO_BUS, "BusMouse" },
- { MOUSE_PROTO_INPORT, "BusMouse" },
- { MOUSE_PROTO_PS2, "PS/2" },
- { MOUSE_PROTO_HITTAB, "MMHitTab" },
- { MOUSE_PROTO_GLIDEPOINT, "GlidePoint" },
- { MOUSE_PROTO_INTELLI, "Intellimouse" },
- { MOUSE_PROTO_THINK, "ThinkingMouse" },
- { MOUSE_PROTO_SYSMOUSE, "SysMouse" }
-};
-
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
- int i;
- mousehw_t hw;
- mousemode_t mode;
-
- if (pInfo->fd == -1)
- return NULL;
-
- /* set the driver operation level, if applicable */
- i = 1;
- ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
-
- /* interrogate the driver and get some intelligence on the device. */
- hw.iftype = MOUSE_IF_UNKNOWN;
- hw.model = MOUSE_MODEL_GENERIC;
- ioctl(pInfo->fd, MOUSE_GETHWINFO, &hw);
- xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: hw.iftype is %d, hw.model is %d\n",
- pInfo->name, hw.iftype, hw.model);
- if (ioctl(pInfo->fd, MOUSE_GETMODE, &mode) == 0) {
- for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); ++i) {
- if (mode.protocol == devproto[i].dproto) {
- /* override some parameters */
- if (protoPara) {
- protoPara[4] = mode.packetsize;
- protoPara[0] = mode.syncmask[0];
- protoPara[1] = mode.syncmask[1];
- }
- xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
- pInfo->name, devproto[i].name);
- return devproto[i].name;
- }
- }
- }
- return NULL;
-}
-
-static void
-SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
-{
- mousemode_t mode;
- MouseDevPtr pMse;
-
- pMse = pInfo->private;
-
- mode.rate = rate > 0 ? rate : -1;
- mode.resolution = res > 0 ? res : -1;
- mode.accelfactor = -1;
-#if defined(__FreeBSD__)
- if (pMse->autoProbe ||
- (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
- /*
- * As the FreeBSD sysmouse driver defaults to protocol level 0
- * everytime it is opened we enforce protocol level 1 again at
- * this point.
- */
- mode.level = 1;
- } else
- mode.level = -1;
-#else
- mode.level = -1;
-#endif
- ioctl(pInfo->fd, MOUSE_SETMODE, &mode);
-}
-#endif
-
-#if defined(__FreeBSD__)
-
-#define MOUSED_PID_FILE "/var/run/moused.pid"
-
-/*
- * Try to check if moused is running. DEFAULT_SYSMOUSE_DEV is useless without
- * it. There doesn't seem to be a better way of checking.
- */
-static Bool
-MousedRunning(void)
-{
- FILE *f = NULL;
- unsigned int pid;
-
- if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
- if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
- if (kill(pid, 0) == 0) {
- fclose(f);
- return TRUE;
- }
- }
- fclose(f);
- }
- return FALSE;
-}
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- int fd = -1;
- const char **pdev, *dev = NULL;
- Bool devMouse = FALSE;
- struct stat devMouseStat;
- struct stat sb;
-
- for (pdev = mouseDevs; *pdev; pdev++) {
- SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
- if (fd == -1) {
-#ifdef DEBUG
- ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
-#endif
- } else {
- /*
- * /dev/mouse is held until checks for matches with other devices
- * are done. This is so that when it points to /dev/sysmouse,
- * the test for whether /dev/sysmouse is usable can be made.
- */
- if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
- if (fstat(fd, &devMouseStat) == 0)
- devMouse = TRUE;
- close(fd);
- continue;
- } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
- /* Check if /dev/mouse is the same as /dev/sysmouse. */
- if (devMouse && fstat(fd, &sb) == 0 &&
- devMouseStat.st_dev == sb.st_dev &&
- devMouseStat.st_ino == sb.st_ino) {
- /* If the same, use /dev/sysmouse. */
- devMouse = FALSE;
- }
- close(fd);
- if (MousedRunning())
- break;
- else {
-#ifdef DEBUG
- ErrorF("moused isn't running\n");
-#endif
- }
- } else {
- close(fd);
- break;
- }
- }
- }
-
- if (*pdev)
- dev = *pdev;
- else if (devMouse)
- dev = DEFAULT_MOUSE_DEV;
-
- if (dev) {
- /* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", dev);
- xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
- pInfo->name, dev);
- }
-
- return *pdev;
-}
-#endif
-
-#if defined(WSCONS_SUPPORT)
-#define NUMEVENTS 64
-
-static void
-wsconsReadInput(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- static struct wscons_event eventList[NUMEVENTS];
- int n, c;
- struct wscons_event *event = eventList;
- unsigned char *pBuf;
-
- pMse = pInfo->private;
-
- XisbBlockDuration(pMse->buffer, -1);
- pBuf = (unsigned char *)eventList;
- n = 0;
- while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList)) {
- pBuf[n++] = (unsigned char)c;
- }
-
- if (n == 0)
- return;
-
- n /= sizeof(struct wscons_event);
- while( n-- ) {
- int buttons = pMse->lastButtons;
- int dx = 0, dy = 0, dz = 0, dw = 0;
- switch (event->type) {
- case WSCONS_EVENT_MOUSE_UP:
-#define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value))
- buttons &= ~BUTBIT;
- break;
- case WSCONS_EVENT_MOUSE_DOWN:
- buttons |= BUTBIT;
- break;
- case WSCONS_EVENT_MOUSE_DELTA_X:
- dx = event->value;
- break;
- case WSCONS_EVENT_MOUSE_DELTA_Y:
- dy = -event->value;
- break;
-#ifdef WSCONS_EVENT_MOUSE_DELTA_Z
- case WSCONS_EVENT_MOUSE_DELTA_Z:
- dz = event->value;
- break;
-#endif
- default:
- xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
- event->type);
- continue;
- }
-
- pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
- ++event;
- }
- return;
-}
-
-
-/* This function is called when the protocol is "wsmouse". */
-static Bool
-wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- MouseDevPtr pMse = pInfo->private;
-
- pMse->protocol = protocol;
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
- /* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, NULL, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- /* Check if the device can be opened. */
- pInfo->fd = xf86OpenSerial(pInfo->options);
- if (pInfo->fd == -1) {
- if (xf86GetAllowMouseOpenFail())
- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
- else {
- xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pMse);
- return FALSE;
- }
- }
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
-
- /* Process common mouse options (like Emulate3Buttons, etc). */
- pMse->CommonOptions(pInfo);
-
- /* Setup the local input proc. */
- pInfo->read_input = wsconsReadInput;
-
- pInfo->flags |= XI86_CONFIGURED;
- return TRUE;
-}
-#endif
-
-#if defined(USBMOUSE_SUPPORT)
-
-typedef struct _UsbMseRec {
- int packetSize;
- int iid;
- hid_item_t loc_x; /* x locator item */
- hid_item_t loc_y; /* y locator item */
- hid_item_t loc_z; /* z (wheel) locator item */
- hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
- unsigned char *buffer;
-} UsbMseRec, *UsbMsePtr;
-
-static int
-usbMouseProc(DeviceIntPtr pPointer, int what)
-{
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- UsbMsePtr pUsbMse;
- unsigned char map[MSE_MAXBUTTONS + 1];
- int nbuttons;
-
- pInfo = pPointer->public.devicePrivate;
- pMse = pInfo->private;
- pMse->device = pPointer;
- pUsbMse = pMse->mousePriv;
-
- switch (what) {
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
- map[nbuttons + 1] = nbuttons + 1;
-
- InitPointerDeviceStruct((DevicePtr)pPointer,
- map,
- min(pMse->buttons, MSE_MAXBUTTONS),
- miPointerGetMotionEvents,
- pMse->Ctrl,
- miPointerGetMotionBufferSize());
-
- /* X valuator */
- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 0);
- /* Y valuator */
- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 1);
- xf86MotionHistoryAllocate(pInfo);
- break;
-
- case DEVICE_ON:
- pInfo->fd = xf86OpenSerial(pInfo->options);
- if (pInfo->fd == -1)
- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
- else {
- pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
- if (!pMse->buffer) {
- xfree(pMse);
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
- } else {
- xf86FlushInput(pInfo->fd);
- if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
- pInfo))
- AddEnabledDevice(pInfo->fd);
- }
- }
- pMse->lastButtons = 0;
- pMse->emulateState = 0;
- pPointer->public.on = TRUE;
- break;
-
- case DEVICE_OFF:
- case DEVICE_CLOSE:
- if (pInfo->fd != -1) {
- RemoveEnabledDevice(pInfo->fd);
- if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
- xfree(pUsbMse->buffer);
- }
- if (pMse->buffer) {
- XisbFree(pMse->buffer);
- pMse->buffer = NULL;
- }
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
- }
- pPointer->public.on = FALSE;
- usleep(300000);
- break;
- }
- return Success;
-}
-
-static void
-usbReadInput(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- UsbMsePtr pUsbMse;
- int buttons = pMse->lastButtons;
- int dx = 0, dy = 0, dz = 0, dw = 0;
- int n, c;
- unsigned char *pBuf;
-
- pMse = pInfo->private;
- pUsbMse = pMse->mousePriv;
-
- XisbBlockDuration(pMse->buffer, -1);
- pBuf = pUsbMse->buffer;
- n = 0;
- while ((c = XisbRead(pMse->buffer)) >= 0 && n < pUsbMse->packetSize) {
- pBuf[n++] = (unsigned char)c;
- }
- if (n == 0)
- return;
- if (n != pUsbMse->packetSize) {
- xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n", pInfo->name,
- n);
- }
- /* discard packets with an id that don't match the mouse */
- /* XXX this is probably not the right thing */
- if (pUsbMse->iid != 0) {
- if (*pBuf++ != pUsbMse->iid)
- return;
- }
- dx = hid_get_data(pBuf, &pUsbMse->loc_x);
- dy = hid_get_data(pBuf, &pUsbMse->loc_y);
- dz = hid_get_data(pBuf, &pUsbMse->loc_z);
-
- buttons = 0;
- for (n = 0; n < pMse->buttons; n++) {
- if (hid_get_data(pBuf, &pUsbMse->loc_btn[n]))
- buttons |= (1 << UMS_BUT(n));
- }
- pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
- return;
-}
-
-static void
-usbSigioReadInput (int fd, void *closure)
-{
- usbReadInput ((InputInfoPtr) closure);
-}
-
-/* This function is called when the protocol is "usb". */
-static Bool
-usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- MouseDevPtr pMse = pInfo->private;
- UsbMsePtr pUsbMse;
- report_desc_t reportDesc;
- int i;
-
- pUsbMse = xalloc(sizeof(UsbMseRec));
- if (pUsbMse == NULL) {
- xf86Msg(X_ERROR, "%s: cannot allocate UsbMouseRec\n", pInfo->name);
- xfree(pMse);
- return FALSE;
- }
-
- pMse->protocol = protocol;
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
- /* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, NULL, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- /* Check if the device can be opened. */
- pInfo->fd = xf86OpenSerial(pInfo->options);
- if (pInfo->fd == -1) {
- if (xf86GetAllowMouseOpenFail())
- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
- else {
- xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pUsbMse);
- xfree(pMse);
- return FALSE;
- }
- }
- /* Get USB informations */
- reportDesc = hid_get_report_desc(pInfo->fd);
- /* Get packet size & iid */
-#ifdef USB_NEW_HID
- if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
- xf86Msg(X_ERROR, "Error ioctl USB_GET_REPORT_ID on %s : %s\n",
- pInfo->name, strerror(errno));
- return FALSE;
- }
- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
- pUsbMse->iid);
-#else
- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
- &pUsbMse->iid);
-#endif
- /* Allocate buffer */
- if (pUsbMse->packetSize <= 8) {
- pUsbMse->buffer = pMse->protoBuf;
- } else {
- pUsbMse->buffer = xalloc(pUsbMse->packetSize);
- }
- if (pUsbMse->buffer == NULL) {
- xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
- xfree(pUsbMse);
- xfree(pMse);
- xf86CloseSerial(pInfo->fd);
- return FALSE;
- }
-#ifdef USB_NEW_HID
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
- hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
- }
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
- hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) {
- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
- }
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
- hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
- }
-#else
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
- hid_input, &pUsbMse->loc_x) < 0) {
- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
- }
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
- hid_input, &pUsbMse->loc_y) < 0) {
- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
- }
- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
- hid_input, &pUsbMse->loc_z) < 0) {
- }
-#endif
- /* Probe for number of buttons */
- for (i = 1; i <= MSE_MAXBUTTONS; i++) {
- if (!hid_locate(reportDesc, HID_USAGE2(HUP_BUTTON, i),
- hid_input, &pUsbMse->loc_btn[i-1]
-#ifdef USB_NEW_HID
- , pUsbMse->iid
-#endif
- ))
- break;
- }
- pMse->buttons = i-1;
-
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
-
- /* Private structure */
- pMse->mousePriv = pUsbMse;
-
- /* Process common mouse options (like Emulate3Buttons, etc). */
- pMse->CommonOptions(pInfo);
-
- /* Setup the local procs. */
- pInfo->device_control = usbMouseProc;
- pInfo->read_input = usbReadInput;
-
- pInfo->flags |= XI86_CONFIGURED;
- return TRUE;
-}
-#endif /* USBMOUSE */
-
-static Bool
-bsdMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- /* The protocol is guaranteed to be one of the internalNames[] */
-#ifdef WSCONS_SUPPORT
- if (xf86NameCmp(protocol, "WSMouse") == 0) {
- return wsconsPreInit(pInfo, protocol, flags);
- }
-#endif
-#ifdef USBMOUSE_SUPPORT
- if (xf86NameCmp(protocol, "usb") == 0) {
- return usbPreInit(pInfo, protocol, flags);
- }
-#endif
- return TRUE;
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
- p->SupportedInterfaces = SupportedInterfaces;
- p->BuiltinNames = BuiltinNames;
- p->DefaultProtocol = DefaultProtocol;
- p->CheckProtocol = CheckProtocol;
-#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
- p->SetupAuto = SetupAuto;
- p->SetPS2Res = SetSysMouseRes;
- p->SetBMRes = SetSysMouseRes;
- p->SetMiscRes = SetSysMouseRes;
-#endif
-#if defined(__FreeBSD__)
- p->FindDevice = FindDevice;
-#endif
- p->PreInit = bsdMousePreInit;
- return p;
-}
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
deleted file mode 100644
index 75c8f8200..000000000
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.5 2003/10/07 23:14:55 herrb Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#ifdef HAS_MTRR_SUPPORT
-#ifndef __NetBSD__
-#include <sys/types.h>
-#include <sys/memrange.h>
-#else
-#include "memrange.h"
-#endif
-#define X_MTRR_ID "XFree86"
-#endif
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-#include <machine/mtrr.h>
-#include <machine/sysarch.h>
-#include <sys/queue.h>
-#endif
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-#ifdef __OpenBSD__
-#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#define SYSCTL_MSG2 \
- "Check that you have set 'machdep.allowaperture=2'\n" \
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#ifdef HAS_APERTURE_DRV
-#define DEV_APERTURE "/dev/xf86"
-#endif
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
-#ifdef HAS_MTRR_SUPPORT
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-static Bool cleanMTRR(void);
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
- MessageType);
-static void NetBSDundoWC(int, pointer);
-#endif
-
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- /* This should not happen */
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
- }
- }
-#ifndef HAS_APERTURE_DRV
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
-#else
- /* Failed to open /dev/mem, try the aperture driver */
- if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
- DEV_APERTURE);
- return;
- } else {
-
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_APERTURE, strerror(errno));
- }
- }
- } else {
- if (warn)
- {
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
-#else /* __OpenBSD__ */
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
- SYSCTL_MSG);
-#endif /* __OpenBSD__ */
- }
- }
-
- useDevMem = FALSE;
- return;
-
-#endif
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
-
-#ifdef HAS_MTRR_SUPPORT
- if (useDevMem) {
- if (cleanMTRR()) {
- pVidMem->setWC = setWC;
- pVidMem->undoWC = undoWC;
- }
- }
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
- pVidMem->setWC = NetBSDsetWC;
- pVidMem->undoWC = NetBSDundoWC;
-#endif
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return(base);
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%lx outside allowable range",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base - 0xA0000
- );
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
- strerror(errno));
- }
- return(base);
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return(-1);
- }
-
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
-#ifdef __OpenBSD__
- if (Base < 0xa0000) {
- xf86Msg(X_WARNING, SYSCTL_MSG2);
- }
-#endif
- return(-1);
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return(Len);
-}
-
-
-#ifdef USE_I386_IOPL
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-static Bool ExtendedEnabled = FALSE;
-
-void
-xf86EnableIO()
-{
- if (ExtendedEnabled)
- return;
-
- if (i386_iopl(TRUE) < 0)
- {
-#ifndef __OpenBSD__
- FatalError("%s: Failed to set IOPL for extended I/O",
- "xf86EnableIO");
-#else
- FatalError("%s: Failed to set IOPL for extended I/O\n%s",
- "xf86EnableIO", SYSCTL_MSG);
-#endif
- }
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (!ExtendedEnabled)
- return;
-
- i386_iopl(FALSE);
- ExtendedEnabled = FALSE;
-
- return;
-}
-
-#endif /* USE_I386_IOPL */
-
-#ifdef USE_DEV_IO
-static int IoFd = -1;
-
-void
-xf86EnableIO()
-{
- if (IoFd >= 0)
- return;
-
- if ((IoFd = open("/dev/io", O_RDWR)) == -1)
- {
- FatalError("xf86EnableIO: "
- "Failed to open /dev/io for extended I/O");
- }
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (IoFd < 0)
- return;
-
- close(IoFd);
- IoFd = -1;
- return;
-}
-
-#endif
-
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-
- return;
-}
-
-
-#ifdef __NetBSD__
-/***************************************************************************/
-/* Set TV output mode */
-/***************************************************************************/
-void
-xf86SetTVOut(int mode)
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to TV output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console");
- break;
- }
- return;
-}
-
-void
-xf86SetRGBOut()
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to RGB output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console");
- break;
- }
- return;
-}
-#endif
-
-
-#ifdef HAS_MTRR_SUPPORT
-/* memory range (MTRR) support for FreeBSD */
-
-/*
- * This code is experimental. Some parts may be overkill, and other parts
- * may be incomplete.
- */
-
-/*
- * getAllRanges returns the full list of memory ranges with attributes set.
- */
-
-static struct mem_range_desc *
-getAllRanges(int *nmr)
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
-
- /*
- * Find how many ranges there are. If this fails, then the kernel
- * probably doesn't have MTRR support.
- */
- mro.mo_arg[0] = 0;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro))
- return NULL;
- *nmr = mro.mo_arg[0];
- mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
- mro.mo_arg[0] = *nmr;
- mro.mo_desc = mrd;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
- xfree(mrd);
- return NULL;
- }
- return mrd;
-}
-
-/*
- * cleanMTRR removes any memory attribute that may be left by a previous
- * X server. Normally there won't be any, but this takes care of the
- * case where a server crashed without being able finish cleaning up.
- */
-
-static Bool
-cleanMTRR()
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
- int nmr, i;
-
- /* This shouldn't happen */
- if (devMemFd < 0)
- return FALSE;
-
- if (!(mrd = getAllRanges(&nmr)))
- return FALSE;
-
- for (i = 0; i < nmr; i++) {
- if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
- (mrd[i].mr_flags & MDF_ACTIVE)) {
-#ifdef DEBUG
- ErrorF("Clean for (0x%lx,0x%lx)\n",
- (unsigned long)mrd[i].mr_base,
- (unsigned long)rd[i].mr_len);
-#endif
- if (mrd[i].mr_flags & MDF_FIXACTIVE) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- mrd[i].mr_flags = MDF_UNCACHEABLE;
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = mrd + i;
- ioctl(devMemFd, MEMRANGE_SET, &mro);
- }
- }
-#ifdef DEBUG
- sleep(10);
-#endif
- xfree(mrd);
- return TRUE;
-}
-
-typedef struct x_RangeRec {
- struct mem_range_desc mrd;
- Bool wasWC;
- struct x_RangeRec * next;
-} RangeRec, *RangePtr;
-
-static void
-freeRangeList(RangePtr range)
-{
- RangePtr rp;
-
- while (range) {
- rp = range;
- range = rp->next;
- xfree(rp);
- }
-}
-
-static RangePtr
-dupRangeList(RangePtr list)
-{
- RangePtr new = NULL, rp, p;
-
- rp = list;
- while (rp) {
- p = xnfalloc(sizeof(RangeRec));
- *p = *rp;
- p->next = new;
- new = p;
- rp = rp->next;
- }
- return new;
-}
-
-static RangePtr
-sortRangeList(RangePtr list)
-{
- RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
- unsigned long minBase;
-
- /* Sort by base address */
- rp1 = copy = dupRangeList(list);
- while (rp1) {
- minBase = rp1->mrd.mr_base;
- minp = rp1;
- minprev = NULL;
- prev = rp1;
- rp2 = rp1->next;
- while (rp2) {
- if (rp2->mrd.mr_base < minBase) {
- minBase = rp2->mrd.mr_base;
- minp = rp2;
- minprev = prev;
- }
- prev = rp2;
- rp2 = rp2->next;
- }
- if (minprev) {
- minprev->next = minp->next;
- rp1 = copy;
- } else {
- rp1 = minp->next;
- }
- minp->next = sorted;
- sorted = minp;
- }
- return sorted;
-}
-
-/*
- * findRanges returns a list of ranges that overlap the specified range.
- */
-
-static void
-findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
-{
- struct mem_range_desc *mrd;
- int nmr, i;
- RangePtr rp, *p;
-
- if (!(mrd = getAllRanges(&nmr)))
- return;
-
- for (i = 0; i < nmr; i++) {
- if ((mrd[i].mr_flags & MDF_ACTIVE) &&
- mrd[i].mr_base < base + size &&
- mrd[i].mr_base + mrd[i].mr_len > base) {
- if (mrd[i].mr_flags & MDF_WRITECOMBINE)
- p = wcp;
- else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
- p = ucp;
- else
- continue;
- rp = xnfalloc(sizeof(RangeRec));
- rp->mrd = mrd[i];
- rp->next = *p;
- *p = rp;
- }
- }
- xfree(mrd);
-}
-
-/*
- * This checks if the existing overlapping ranges fully cover the requested
- * range. Is this overkill?
- */
-
-static Bool
-fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
-{
- RangePtr rp1, sorted = NULL;
- unsigned long end;
-
- sorted = sortRangeList(overlap);
- /* Look for gaps */
- rp1 = sorted;
- end = base + size;
- while (rp1) {
- if (rp1->mrd.mr_base > base) {
- freeRangeList(sorted);
- return FALSE;
- } else {
- base = rp1->mrd.mr_base + rp1->mrd.mr_len;
- }
- if (base >= end) {
- freeRangeList(sorted);
- return TRUE;
- }
- rp1 = rp1->next;
- }
- freeRangeList(sorted);
- return FALSE;
-}
-
-static pointer
-addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /* See of the full range is already WC */
- if (!uc && fullCoverage(base, size, wc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already set\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_WRITECOMBINE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to set write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx)\n", base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = FALSE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /*
- * See of the full range is already not WC, or if there is full
- * coverage from UC ranges.
- */
- if (!wc || fullCoverage(base, size, uc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already clear\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_UNCACHEABLE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to remove write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- /* XXX Should then remove all of the overlapping WC ranges */
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Removed Write-combining range (0x%lx,0x%lx)\n",
- base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = TRUE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- if (enable)
- return addWC(screenNum, base, size, from);
- else
- return delWC(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer list)
-{
- RangePtr rp;
- struct mem_range_op mro;
- Bool failed;
-
- rp = list;
- while (rp) {
-#ifdef DEBUG
- ErrorF("Undo for (0x%lx,0x%lx), %d\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len, rp->wasWC);
-#endif
- failed = FALSE;
- if (rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_WRITECOMBINE;
- strcpy(rp->mrd.mr_owner, "unknown");
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = &rp->mrd;
-
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- if (!rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_UNCACHEABLE;
- strcpy(rp->mrd.mr_owner, "unknown");
- if (ioctl(devMemFd, MEMRANGE_SET, &mro))
- failed = TRUE;
- } else
- failed = TRUE;
- }
- if (failed) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to restore MTRR range (0x%lx,0x%lx)\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len);
- }
- rp = rp->next;
- }
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer
-NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- struct mtrr *mtrrp;
- int n;
-
- xf86DrvMsg(screenNum, X_WARNING,
- "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
- base, (base + size));
-
- mtrrp = xnfalloc(sizeof (struct mtrr));
- mtrrp->base = base;
- mtrrp->len = size;
- mtrrp->type = MTRR_TYPE_WC;
-
- /*
- * MTRR_PRIVATE will make this MTRR get reset automatically
- * if this process exits, so we have no need for an explicit
- * cleanup operation when starting a new server.
- */
-
- if (enable)
- mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
- else
- mtrrp->flags = 0;
- n = 1;
-
- if (i386_set_mtrr(mtrrp, &n) < 0) {
- xfree(mtrrp);
- return NULL;
- }
- return mtrrp;
-}
-
-static void
-NetBSDundoWC(int screenNum, pointer list)
-{
- struct mtrr *mtrrp = (struct mtrr *)list;
- int n;
-
- if (mtrrp == NULL)
- return;
- n = 1;
- mtrrp->flags &= ~MTRR_VALID;
- i386_set_mtrr(mtrrp, &n);
- xfree(mtrrp);
-}
-#endif
diff --git a/hw/xfree86/os-support/bsd/libusb/data.c b/hw/xfree86/os-support/bsd/libusb/data.c
deleted file mode 100644
index bb84e5566..000000000
--- a/hw/xfree86/os-support/bsd/libusb/data.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $NetBSD: data.c,v 1.6 1999/09/20 04:48:12 lukem Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/data.c,v 1.1 2000/02/11 18:06:49 dawes Exp $ */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "usb.h"
-
-int
-hid_get_data(void *p, hid_item_t *h)
-{
- unsigned char *buf;
- unsigned int hpos;
- unsigned int hsize;
- int data;
- int i, end, offs;
-
- _DIAGASSERT(p != NULL);
- _DIAGASSERT(h != NULL);
-
- buf = p;
- hpos = h->pos; /* bit position of data */
- hsize = h->report_size; /* bit length of data */
-
- if (hsize == 0)
- return (0);
- offs = hpos / 8;
- end = (hpos + hsize) / 8 - offs;
- data = 0;
- for (i = 0; i <= end; i++)
- data |= buf[offs + i] << (i*8);
- data >>= hpos % 8;
- data &= (1 << hsize) - 1;
- if (h->logical_minimum < 0) {
- /* Need to sign extend */
- hsize = sizeof data * 8 - hsize;
- data = (data << hsize) >> hsize;
- }
- return (data);
-}
-
-void
-hid_set_data(void *p, hid_item_t *h, int data)
-{
- unsigned char *buf;
- unsigned int hpos;
- unsigned int hsize;
- int i, end, offs;
-
- _DIAGASSERT(p != NULL);
- _DIAGASSERT(h != NULL);
-
- buf = p;
- hpos = h->pos; /* bit position of data */
- hsize = h->report_size; /* bit length of data */
-
- if (hsize != 32)
- data &= (1 << hsize) - 1;
- data <<= (hpos % 8);
-
- offs = hpos / 8;
- end = (hpos + hsize) / 8 - offs;
- data = 0;
- for (i = 0; i <= end; i++)
- buf[offs + i] |= (data >> (i*8)) & 0xff;
-}
diff --git a/hw/xfree86/os-support/bsd/libusb/descr.c b/hw/xfree86/os-support/bsd/libusb/descr.c
deleted file mode 100644
index f75418964..000000000
--- a/hw/xfree86/os-support/bsd/libusb/descr.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $NetBSD: descr.c,v 1.7 1999/10/13 17:48:04 drochner Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/descr.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
-
-#include <sys/types.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/time.h>
-
-#include <dev/usb/usb.h>
-
-#include "usb.h"
-#include "usbvar.h"
-
-report_desc_t
-hid_get_report_desc(fd)
- int fd;
-{
- struct usb_ctl_report_desc rep;
- report_desc_t r;
-
- _DIAGASSERT(fd != -1);
-
- rep.size = 0;
- if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
- return (0);
- r = malloc(sizeof *r + rep.size);
- if (r == 0) {
- errno = ENOMEM;
- return (0);
- }
- r->size = rep.size;
- memcpy(r->data, rep.data, (unsigned int)rep.size);
- return (r);
-}
-
-void
-hid_dispose_report_desc(r)
- report_desc_t r;
-{
-
- free(r);
-}
diff --git a/hw/xfree86/os-support/bsd/libusb/parse.c b/hw/xfree86/os-support/bsd/libusb/parse.c
deleted file mode 100644
index 8c1a8b8a2..000000000
--- a/hw/xfree86/os-support/bsd/libusb/parse.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/* $NetBSD: parse.c,v 1.7 1999/10/13 17:48:04 drochner Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/parse.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include "usb.h"
-#include "usbvar.h"
-
-#define MAXUSAGE 100
-struct hid_data {
- u_char *start;
- u_char *end;
- u_char *p;
- hid_item_t cur;
- unsigned int usages[MAXUSAGE];
- int nusage;
- int minset;
- int multi;
- int multimax;
- int kindset;
-};
-
-static int min(int x, int y) { return x < y ? x : y; }
-
-static void
-hid_clear_local(hid_item_t *c)
-{
-
- _DIAGASSERT(c != NULL);
-
- c->usage = 0;
- c->usage_minimum = 0;
- c->usage_maximum = 0;
- c->designator_index = 0;
- c->designator_minimum = 0;
- c->designator_maximum = 0;
- c->string_index = 0;
- c->string_minimum = 0;
- c->string_maximum = 0;
- c->set_delimiter = 0;
-}
-
-hid_data_t
-hid_start_parse(report_desc_t d, int kindset)
-{
- struct hid_data *s;
-
- _DIAGASSERT(d != NULL);
-
- s = malloc(sizeof *s);
- memset(s, 0, sizeof *s);
- s->start = s->p = d->data;
- s->end = d->data + d->size;
- s->kindset = kindset;
- return (s);
-}
-
-void
-hid_end_parse(hid_data_t s)
-{
-
- _DIAGASSERT(s != NULL);
-
- while (s->cur.next) {
- hid_item_t *hi = s->cur.next->next;
- free(s->cur.next);
- s->cur.next = hi;
- }
- free(s);
-}
-
-int
-hid_get_item(hid_data_t s, hid_item_t *h)
-{
- hid_item_t *c;
- unsigned int bTag = 0, bType = 0, bSize;
- unsigned char *data;
- int dval;
- unsigned char *p;
- hid_item_t *hi;
- int i;
-
- _DIAGASSERT(s != NULL);
- _DIAGASSERT(h != NULL);
-
- c = &s->cur;
-
- top:
- if (s->multimax) {
- if (s->multi < s->multimax) {
- c->usage = s->usages[min(s->multi, s->nusage-1)];
- s->multi++;
- *h = *c;
- c->pos += c->report_size;
- h->next = 0;
- return (1);
- } else {
- c->report_count = s->multimax;
- s->multimax = 0;
- s->nusage = 0;
- hid_clear_local(c);
- }
- }
- for (;;) {
- p = s->p;
- if (p >= s->end)
- return (0);
-
- bSize = *p++;
- if (bSize == 0xfe) {
- /* long item */
- bSize = *p++;
- bSize |= *p++ << 8;
- bTag = *p++;
- data = p;
- p += bSize;
- } else {
- /* short item */
- bTag = bSize >> 4;
- bType = (bSize >> 2) & 3;
- bSize &= 3;
- if (bSize == 3) bSize = 4;
- data = p;
- p += bSize;
- }
- s->p = p;
- /*
- * The spec is unclear if the data is signed or unsigned.
- */
- switch(bSize) {
- case 0:
- dval = 0;
- break;
- case 1:
- dval = (int8_t)*data++;
- break;
- case 2:
- dval = *data++;
- dval |= *data++ << 8;
- dval = (int16_t)dval;
- break;
- case 4:
- dval = *data++;
- dval |= *data++ << 8;
- dval |= *data++ << 16;
- dval |= *data++ << 24;
- break;
- default:
- return (-1);
- }
-
- switch (bType) {
- case 0: /* Main */
- switch (bTag) {
- case 8: /* Input */
- if (!(s->kindset & (1 << hid_input)))
- continue;
- c->kind = hid_input;
- c->flags = dval;
- ret:
- if (c->flags & HIO_VARIABLE) {
- s->multimax = c->report_count;
- s->multi = 0;
- c->report_count = 1;
- if (s->minset) {
- for (i = c->usage_minimum;
- i <= c->usage_maximum;
- i++) {
- s->usages[s->nusage] = i;
- if (s->nusage < MAXUSAGE-1)
- s->nusage++;
- }
- s->minset = 0;
- }
- goto top;
- } else {
- if (s->minset)
- c->usage = c->usage_minimum;
- *h = *c;
- h->next = 0;
- c->pos += c->report_size * c->report_count;
- hid_clear_local(c);
- s->minset = 0;
- return (1);
- }
- case 9: /* Output */
- if (!(s->kindset & (1 << hid_output)))
- continue;
- c->kind = hid_output;
- c->flags = dval;
- goto ret;
- case 10: /* Collection */
- c->kind = hid_collection;
- c->collection = dval;
- c->collevel++;
- *h = *c;
- hid_clear_local(c);
- s->nusage = 0;
- return (1);
- case 11: /* Feature */
- if (!(s->kindset & (1 << hid_feature)))
- continue;
- c->kind = hid_feature;
- c->flags = dval;
- goto ret;
- case 12: /* End collection */
- c->kind = hid_endcollection;
- c->collevel--;
- *h = *c;
- hid_clear_local(c);
- s->nusage = 0;
- return (1);
- default:
- return (-2);
- }
-
- case 1: /* Global */
- switch (bTag) {
- case 0:
- c->_usage_page = dval << 16;
- break;
- case 1:
- c->logical_minimum = dval;
- break;
- case 2:
- c->logical_maximum = dval;
- break;
- case 3:
- c->physical_maximum = dval;
- break;
- case 4:
- c->physical_maximum = dval;
- break;
- case 5:
- c->unit_exponent = dval;
- break;
- case 6:
- c->unit = dval;
- break;
- case 7:
- c->report_size = dval;
- break;
- case 8:
- c->report_ID = dval;
- break;
- case 9:
- c->report_count = dval;
- break;
- case 10: /* Push */
- hi = malloc(sizeof *hi);
- *hi = s->cur;
- c->next = hi;
- break;
- case 11: /* Pop */
- hi = c->next;
- s->cur = *hi;
- free(hi);
- break;
- default:
- return (-3);
- }
- break;
- case 2: /* Local */
- switch (bTag) {
- case 0:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage = dval;
- if (s->nusage < MAXUSAGE)
- s->usages[s->nusage++] = dval;
- /* else XXX */
- break;
- case 1:
- s->minset = 1;
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_minimum = dval;
- break;
- case 2:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_maximum = dval;
- break;
- case 3:
- c->designator_index = dval;
- break;
- case 4:
- c->designator_minimum = dval;
- break;
- case 5:
- c->designator_maximum = dval;
- break;
- case 7:
- c->string_index = dval;
- break;
- case 8:
- c->string_minimum = dval;
- break;
- case 9:
- c->string_maximum = dval;
- break;
- case 10:
- c->set_delimiter = dval;
- break;
- default:
- return (-4);
- }
- break;
- default:
- return (-5);
- }
- }
-}
-
-int
-hid_report_size(report_desc_t r, enum hid_kind k, int *idp)
-{
- struct hid_data *d;
- hid_item_t h;
- int size, id;
-
- _DIAGASSERT(r != NULL);
- /* idp may be NULL */
-
- id = 0;
- if (idp)
- *idp = 0;
- memset(&h, 0, sizeof h);
- for (d = hid_start_parse(r, 1<<k); hid_get_item(d, &h); ) {
- if (h.report_ID != 0) {
- if (idp)
- *idp = h.report_ID;
- id = 8;
- }
- }
- hid_end_parse(d);
- size = h.pos + id;
- return ((size + 7) / 8);
-}
-
-int
-hid_locate(desc, u, k, h)
- report_desc_t desc;
- unsigned int u;
- enum hid_kind k;
- hid_item_t *h;
-{
- hid_data_t d;
-
- _DIAGASSERT(desc != NULL);
- _DIAGASSERT(h != NULL);
-
- for (d = hid_start_parse(desc, 1<<k); hid_get_item(d, h); ) {
- if (h->kind == k && !(h->flags & HIO_CONST) && h->usage == u) {
- hid_end_parse(d);
- return (1);
- }
- }
- hid_end_parse(d);
- h->report_size = 0;
- return (0);
-}
diff --git a/hw/xfree86/os-support/bsd/libusb/usage.c b/hw/xfree86/os-support/bsd/libusb/usage.c
deleted file mode 100644
index 9338e61d4..000000000
--- a/hw/xfree86/os-support/bsd/libusb/usage.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $NetBSD: usage.c,v 1.4 1999/07/02 15:46:53 simonb Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usage.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
-
-#include <ctype.h>
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "usb.h"
-
-#define _PATH_HIDTABLE "/usr/share/misc/usb_hid_usages"
-
-struct usage_in_page {
- char *name;
- int usage;
-};
-
-static struct usage_page {
- char *name;
- int usage;
- struct usage_in_page *page_contents;
- int pagesize, pagesizemax;
-} *pages;
-static int npages, npagesmax;
-
-#ifdef DEBUG
-void
-dump_hid_table(void)
-{
- int i, j;
-
- for (i = 0; i < npages; i++) {
- printf("%d\t%s\n", pages[i].usage, pages[i].name);
- for (j = 0; j < pages[i].pagesize; j++) {
- printf("\t%d\t%s\n", pages[i].page_contents[j].usage,
- pages[i].page_contents[j].name);
- }
- }
-}
-#endif
-
-void
-hid_init(char *hidname)
-{
- FILE *f;
- char line[100], name[100], *p, *n;
- int no;
- int lineno;
- struct usage_page *curpage = 0;
-
- if (hidname == 0)
- hidname = _PATH_HIDTABLE;
-
- f = fopen(hidname, "r");
- if (f == NULL)
- err(1, "%s", hidname);
- for (lineno = 1; ; lineno++) {
- if (fgets(line, sizeof line, f) == NULL)
- break;
- if (line[0] == '#')
- continue;
- for (p = line; *p && isspace(*p); p++)
- ;
- if (!*p)
- continue;
- if (sscanf(line, " * %[^\n]", name) == 1)
- no = -1;
- else if (sscanf(line, " 0x%x %[^\n]", &no, name) != 2 &&
- sscanf(line, " %d %[^\n]", &no, name) != 2)
- errx(1, "file %s, line %d, syntax error\n",
- hidname, lineno);
- for (p = name; *p; p++)
- if (isspace(*p) || *p == '.')
- *p = '_';
- n = strdup(name);
- if (!n)
- err(1, "strdup");
- if (isspace(line[0])) {
- if (!curpage)
- errx(1, "file %s, line %d, syntax error\n",
- hidname, lineno);
- if (curpage->pagesize >= curpage->pagesizemax) {
- curpage->pagesizemax += 10;
- curpage->page_contents =
- realloc(curpage->page_contents,
- curpage->pagesizemax *
- sizeof (struct usage_in_page));
- if (!curpage->page_contents)
- err(1, "realloc");
- }
- curpage->page_contents[curpage->pagesize].name = n;
- curpage->page_contents[curpage->pagesize].usage = no;
- curpage->pagesize++;
- } else {
- if (npages >= npagesmax) {
- if (pages == 0) {
- npagesmax = 5;
- pages = malloc(npagesmax *
- sizeof (struct usage_page));
- } else {
- npagesmax += 5;
- pages = realloc(pages,
- npagesmax *
- sizeof (struct usage_page));
- }
- if (!pages)
- err(1, "alloc");
- }
- curpage = &pages[npages++];
- curpage->name = n;
- curpage->usage = no;
- curpage->pagesize = 0;
- curpage->pagesizemax = 10;
- curpage->page_contents =
- malloc(curpage->pagesizemax *
- sizeof (struct usage_in_page));
- if (!curpage->page_contents)
- err(1, "malloc");
- }
- }
- fclose(f);
-#ifdef DEBUG
- dump_hid_table();
-#endif
-}
-
-char *
-hid_usage_page(int i)
-{
- static char b[10];
- int k;
-
- if (!pages)
- errx(1, "no hid table\n");
-
- for (k = 0; k < npages; k++)
- if (pages[k].usage == i)
- return pages[k].name;
- sprintf(b, "0x%02x", i);
- return b;
-}
-
-char *
-hid_usage_in_page(unsigned int u)
-{
- int page = HID_PAGE(u);
- int i = HID_USAGE(u);
- static char b[100];
- int j, k, us;
-
- for (k = 0; k < npages; k++)
- if (pages[k].usage == page)
- break;
- if (k >= npages)
- goto bad;
- for (j = 0; j < pages[k].pagesize; j++) {
- us = pages[k].page_contents[j].usage;
- if (us == -1) {
- sprintf(b, pages[k].page_contents[j].name, i);
- return b;
- }
- if (us == i)
- return pages[k].page_contents[j].name;
- }
- bad:
- sprintf(b, "0x%02x", i);
- return b;
-}
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.3 b/hw/xfree86/os-support/bsd/libusb/usb.3
deleted file mode 100644
index f88a28cd6..000000000
--- a/hw/xfree86/os-support/bsd/libusb/usb.3
+++ /dev/null
@@ -1,191 +0,0 @@
-.\" $NetBSD: usb.3,v 1.9 1999/11/08 22:33:40 augustss Exp $
-.\"
-.\" Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3,v 1.1 2000/02/11 18:06:50 dawes Exp $
-.\"
-.Dd May 11, 1999
-.Dt USB 3
-.Os
-.Sh NAME
-.Nm usb ,
-.Nm hid_get_report_desc ,
-.Nm hid_dispose_report_desc ,
-.Nm hid_start_parse ,
-.Nm hid_end_parse ,
-.Nm hid_get_item ,
-.Nm hid_report_size ,
-.Nm hid_locate ,
-.Nm hid_usage_page ,
-.Nm hid_usage_in_page ,
-.Nm hid_init ,
-.Nm hid_get_data ,
-.Nm hid_set_data
-.Nd USB HID access routines
-.Sh LIBRARY
-.Lb libusb
-.Sh SYNOPSIS
-.Fd #include <usb.h>
-.Ft report_desc_t
-.Fn hid_get_report_desc "int file"
-.Ft void
-.Fn hid_dispose_report_desc "report_desc_t d"
-.Ft hid_data_t
-.Fn hid_start_parse "report_desc_t d" "int kindset"
-.Ft void
-.Fn hid_end_parse "hid_data_t s"
-.Ft int
-.Fn hid_get_item "hid_data_t s" "hid_item_t *h"
-.Ft int
-.Fn hid_report_size "report_desc_t d" "hid_kind_t k" "int *idp"
-.Ft int
-.Fn hid_locate "report_desc_t d" "u_int usage" "hid_kind_t k" "hid_item_t *h"
-.Ft char *
-.Fn hid_usage_page "int i"
-.Ft char *
-.Fn hid_usage_in_page "u_int u"
-.Ft void
-.Fn hid_init "char *file"
-.Ft int
-.Fn hid_get_data "void *data" "hid_item_t *h"
-.Ft void
-.Fn hid_set_data "void *data" "hid_item_t *h" "u_int data"
-.Sh DESCRIPTION
-The
-.Nm
-library provides routines to extract data from USB Human Interface Devices.
-.Ss INTRODUCTION
-USB HID devices send and receive data layed out a device dependent
-way. The
-.Nm
-library contains routines to extract the
-.Em report descriptor
-which contains the data layout information and then use this information.
-.Pp
-The routines can be divided into four parts: extraction of the descriptor,
-parsing of the descriptor, translating to/from symbolic names, and
-data manipulation.
-.Ss DESCRIPTOR FUNCTIONS
-A report descriptor can be obtained by calling
-.Fn hid_get_report_desc
-with a file descriptor obtained by opening a
-.Xr uhid 4
-device.
-When the report descriptor is no longer needed it should be freed
-by calling
-.Fn hid_dispose_report_desc .
-The type
-.Fa report_desc_t
-is opaque and should be used when calling the parsing functions.
-.Ss DESCRIPTOR PARSING FUNCTIONS
-To parse the report descriptor the
-.Fn hid_start_parse
-function should be called with a report descriptor and a set that
-describes which items that are interesting. The set is obtained
-by oring together values
-.Fa "(1 << k)"
-where
-.Fa k
-is an item of type
-.Fa hid_kind_t .
-The function returns
-.Fa NULL
-if the initialization fails, otherwise an opaque value to be used
-in subsequent calls.
-After parsing the
-.Fn hid_end_parse
-function should be called to free internal data structures.
-.Pp
-To iterate through all the items in the report descriptor
-.Fn hid_get_item
-should be called while it returns a value greater than 0.
-When the report descriptor ends it will returns 0; a syntax
-error within the report descriptor will cause a return value less
-than 0.
-The struct pointed to by
-.Fa h
-will be filled with the relevant data for the item.
-The definition of
-.Fa hid_item_t
-can be found in
-.Pa <usb.h>
-and the meaning of the components in the USB HID documentation.
-.Pp
-Data should be read/written to the device in the size of
-the report. The size of a report (of a certain kind) can be
-computed by the
-.Fn hid_report_size
-function. If the report is prefixed by an ID byte it is
-stored at
-.Fa idp ,
-otherwise it will contain 0.
-.Pp
-To locate a single item the
-.Fn hid_locate
-function can be used. It should be given the usage code of
-the item and its kind and it will fill the item and return
-non-zero if the item was found.
-.Pp
-.Ss NAME TRANSLATION FUNCTIONS
-The function
-.Fn hid_usage_page
-will return the symbolic name of a usage page, and the function
-.Fn hid_usage_in_page
-will return the symbolic name of the usage within the page.
-Both these functions may return a pointer to static data.
-Before either of these functions can be called the usage table
-must be parsed, this is done by calling
-.Fn hid_init
-with the name of the table. Passing
-.Fa NULL
-to this function will cause it to use the default table.
-.Ss DATA EXTRACTION FUNCTIONS
-Given the data obtained from a HID device and an item in the
-report descriptor the
-.Fn hid_get_data
-function extracts the value of the item.
-Conversely
-.Fn hid_set_data
-can be used to put data into a report (which must be zeroed first).
-.Sh EXAMPLE
-Not yet.
-.Sh FILES
-.Pa /usr/share/misc/usb_hid_usages
-The default HID usage table.
-.Sh BUGS
-This man page is woefully incomplete.
-.Sh SEE ALSO
-The
-.Tn USB
-specifications can be found at
-.Dv http://www.usb.org/developers/docs.htm .
-.Pp
-.Xr hid 4 ,
-.Xr usb 4 .
-.Sh HISTORY
-The
-.Nm
-library first appeared in
-.Nx 1.5 .
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.h b/hw/xfree86/os-support/bsd/libusb/usb.h
deleted file mode 100644
index 69ef79a62..000000000
--- a/hw/xfree86/os-support/bsd/libusb/usb.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $NetBSD: usb.h,v 1.5 1999/07/02 15:46:53 simonb Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
-
-#define _DIAGASSERT(e) assert(e)
-
-typedef struct report_desc *report_desc_t;
-
-typedef struct hid_data *hid_data_t;
-
-typedef enum hid_kind {
- hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
-}hid_kind_t;
-
-typedef struct hid_item {
- /* Global */
- int _usage_page;
- int logical_minimum;
- int logical_maximum;
- int physical_minimum;
- int physical_maximum;
- int unit_exponent;
- int unit;
- int report_size;
- int report_ID;
- int report_count;
- /* Local */
- unsigned int usage;
- int usage_minimum;
- int usage_maximum;
- int designator_index;
- int designator_minimum;
- int designator_maximum;
- int string_index;
- int string_minimum;
- int string_maximum;
- int set_delimiter;
- /* Misc */
- int collection;
- int collevel;
- enum hid_kind kind;
- unsigned int flags;
- /* Absolute data position (bits) */
- unsigned int pos;
- /* */
- struct hid_item *next;
-} hid_item_t;
-
-#define HID_PAGE(u) ((u) >> 16)
-#define HID_USAGE(u) ((u) & 0xffff)
-
-/* Obtaining a report descriptor, descr.c: */
-report_desc_t hid_get_report_desc __P((int file));
-void hid_dispose_report_desc __P((report_desc_t));
-
-/* Parsing of a HID report descriptor, parse.c: */
-hid_data_t hid_start_parse __P((report_desc_t d, int kindset));
-void hid_end_parse __P((hid_data_t s));
-int hid_get_item __P((hid_data_t s, hid_item_t *h));
-int hid_report_size __P((report_desc_t d, enum hid_kind k, int *idp));
-int hid_locate __P((report_desc_t d, unsigned int usage, enum hid_kind k, hid_item_t *h));
-
-/* Conversion to/from usage names, usage.c: */
-char *hid_usage_page __P((int i));
-char *hid_usage_in_page __P((unsigned int u));
-void hid_init __P((char *file));
-
-/* Extracting/insertion of data, data.c: */
-int hid_get_data __P((void *p, hid_item_t *h));
-void hid_set_data __P((void *p, hid_item_t *h, int data));
diff --git a/hw/xfree86/os-support/bsd/libusb/usb_hid_usages b/hw/xfree86/os-support/bsd/libusb/usb_hid_usages
deleted file mode 100644
index 711ba206a..000000000
--- a/hw/xfree86/os-support/bsd/libusb/usb_hid_usages
+++ /dev/null
@@ -1,1079 +0,0 @@
-# $NetBSD: usb_hid_usages,v 1.3 1999/07/02 15:46:53 simonb Exp $
-#
-# USB HID usage table
-# Syntax:
-# - lines that do not start with a white space give the number and name of
-# a usage page.
-# - lines that start with a white space give the number and name of
-# a usage with the last given page.
-# If the number is * then the line matches all usages and the name
-# is a printf formatting string that will be given the usage number.
-#
-# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb_hid_usages,v 1.1 2000/02/11 18:06:51 dawes Exp $
-#
-1 Generic Desktop
- 0x00 Undefined
- 0x01 Pointer
- 0x02 Mouse
- 0x03 Reserved
- 0x04 Joystick
- 0x05 Game Pad
- 0x06 Keyboard
- 0x07 Keypad
- 0x08 Multi-axis Controller
- 0x30 X
- 0x31 Y
- 0x32 Z
- 0x33 Rx
- 0x34 Ry
- 0x35 Rz
- 0x36 Slider
- 0x37 Dial
- 0x38 Wheel
- 0x39 Hat Switch
- 0x3A Counted Buffer
- 0x3B Byte Count
- 0x3C Motion Wakeup
- 0x40 Vx
- 0x41 Vy
- 0x42 Vz
- 0x43 Vbrx
- 0x44 Vbry
- 0x45 Vbrx
- 0x46 Vno
- 0x80 System Control
- 0x81 System Power Down
- 0x82 System Sleep
- 0x83 System Wake Up
- 0x84 System Context Menu
- 0x85 System Main Menu
- 0x86 System App Menu
- 0x87 System Menu Help
- 0x88 System Menu Exit
- 0x89 System Menu Select
- 0x8A System Menu Right
- 0x8B System Menu Left
- 0x8C System Menu Up
- 0x8D System Menu Down
- 0x90 D-pad Up
- 0x91 D-pad Down
- 0x92 D-pad Right
- 0x93 D-pad Left
-
-2 Simulation Controls
- 0x00 Undefined
- 0x01 Flight Simulation Device
- 0x02 Automobile Simulation Device
- 0x03 Tank Simulation Device
- 0x04 Spaceship Simulation Device
- 0x05 Submarine Simulation Device
- 0x06 Sailing Simulation Device
- 0x07 Motorcycle Simulation Device
- 0x08 Sports Simulation Device
- 0x09 Airplane Simulation Device
- 0x0A Helicopter Simulation Device
- 0x0B Magic Carpet Simulation Device
- 0x0C Bicycle
- 0x20 Flight Control Stick
- 0x21 Flight Stick
- 0x22 Cyclic Control
- 0x23 Cyclic Trim
- 0x24 Flight Yoke
- 0x25 Track Control
- 0x26 Driving Control
- 0xB0 Aileron
- 0xB1 Aileron Trim
- 0xB2 Anti-Torque Control
- 0xB3 Auto-pilot Enable
- 0xB4 Chaff Release
- 0xB5 Collective Control
- 0xB6 Dive Brake
- 0xB7 Electronic Counter Measures
- 0xB8 Elevator
- 0xB9 Elevator Trim
- 0xBA Rudder
- 0xBB Throttle
- 0xBC Flight Communication
- 0xBD Flare Release
- 0xBE Landing Gear
- 0xBF Toe Brake
- 0xC0 Trigger
- 0xC1 Weapons Arm
- 0xC2 Weapons Select
- 0xC3 Wing Flaps
- 0xC4 Accelerator
- 0xC5 Brake
- 0xC6 Clutch
- 0xC7 Shifter
- 0xC8 Steering
- 0xC9 Turret Direction
- 0xCA Barrel Elevation
- 0xCB Dive Plane
- 0xCC Ballast
- 0xCD Bicycle Crank
- 0xCE Handle Bars
- 0xCF Front Brake
- 0xD0 Rear Brake
-
-3 VR Controls
- 0x00 Unidentified
- 0x01 Belt
- 0x02 Body Suit
- 0x03 Flexor
- 0x04 Glove
- 0x05 Head Tracker
- 0x06 Head Mounted Display
- 0x07 Hand Tracker
- 0x08 Oculometer
- 0x09 Vest
- 0x0A Animatronic Device
- 0x20 Stereo Enable
- 0x21 Display Enable
-
-4 Sports Controls
- 0x00 Unidentified
- 0x01 Baseball Bat
- 0x02 Golf Club
- 0x03 Rowing Machine
- 0x04 Treadmill
- 0x30 Oar
- 0x31 Slope
- 0x32 Rate
- 0x33 Stick Speed
- 0x34 Stick Face Angle
- 0x35 Stick Heel/Toe
- 0x36 Stick Follow Through
- 0x37 Stick Tempo
- 0x38 Stick Type
- 0x39 Stick Height
- 0x50 Putter
- 0x51 1 Iron
- 0x52 2 Iron
- 0x53 3 Iron
- 0x54 4 Iron
- 0x55 5 Iron
- 0x56 6 Iron
- 0x57 7 Iron
- 0x58 8 Iron
- 0x59 9 Iron
- 0x5A 10 Iron
- 0x5B 11 Iron
- 0x5C Sand Wedge
- 0x5D Loft Wedge
- 0x5E Power Wedge
- 0x5F 1 Wood
- 0x60 3 Wood
- 0x61 5 Wood
- 0x62 7 Wood
- 0x63 9 Wood
-
-5 Game Controls
- 0x00 Undefined
- 0x01 3D Game Controller
- 0x02 Pinball Device
- 0x03 Gun Device
- 0x20 Point of View
- 0x21 Turn Right/Left
- 0x22 Pitch Right/Left
- 0x23 Roll Forward/Backward
- 0x24 Move Right/Left
- 0x25 Move Forward/Backward
- 0x26 Move Up/Down
- 0x27 Lean Right/Left
- 0x28 Lean Forward/Backward
- 0x29 Height of POV
- 0x2A Flipper
- 0x2B Secondary Flipper
- 0x2C Bump
- 0x2D New Game
- 0x2E Shoot Ball
- 0x2F Player
- 0x30 Gun Bolt
- 0x31 Gun Clip
- 0x32 Gun Selector
- 0x33 Gun Single Shot
- 0x34 Gun Burst
- 0x35 Gun Automatic
- 0x36 Gun Safety
- 0x37 Gamepad Fire/Jump
- 0x39 Gamepad Trigger
-
-7 Keyboard
- 0x00 Reserved (no event indicated)
- 0x01 Keyboard ErrorRollOver
- 0x02 Keyboard POSTFail
- 0x03 Keyboard ErrorUndefined
- 0x04 Keyboard a and A
- 0x05 Keyboard b and B
- 0x06 Keyboard c and C
- 0x07 Keyboard d and D
- 0x08 Keyboard e and E
- 0x09 Keyboard f and F
- 0x0A Keyboard g and G
- 0x0B Keyboard h and H
- 0x0C Keyboard i and I
- 0x0D Keyboard j and J
- 0x0E Keyboard k and K
- 0x0F Keyboard l and L
- 0x10 Keyboard m and M
- 0x11 Keyboard n and N
- 0x12 Keyboard o and O
- 0x13 Keyboard p and P
- 0x14 Keyboard q and Q
- 0x15 Keyboard r and R
- 0x16 Keyboard s and S
- 0x17 Keyboard t and T
- 0x18 Keyboard u and U
- 0x19 Keyboard v and V
- 0x1A Keyboard w and W
- 0x1B Keyboard x and X
- 0x1C Keyboard y and Y
- 0x1D Keyboard z and Z
- 0x1E Keyboard 1 and !
- 0x1F Keyboard 2 and @
- 0x20 Keyboard 3 and #
- 0x21 Keyboard 4 and $
- 0x22 Keyboard 5 and %
- 0x23 Keyboard 6 and ^
- 0x24 Keyboard 7 and &
- 0x25 Keyboard 8 and *
- 0x26 Keyboard 9 and (
- 0x27 Keyboard 0 and )
- 0x28 Keyboard Return (ENTER)
- 0x29 Keyboard ESCAPE
- 0x2A Keyboard DELETE (Backspace)
- 0x2B Keyboard Tab
- 0x2C Keyboard Spacebar
- 0x2D Keyboard - and (underscore)
- 0x2E Keyboard = and +
- 0x2F Keyboard [ and {
- 0x30 Keyboard ] and }
- 0x31 Keyboard \ and |
- 0x32 Keyboard Non-US # and ~
- 0x33 Keyboard ; and :
- 0x34 Keyboard ' and "
- 0x35 Keyboard Grave Accent and Tilde
- 0x36 Keyboard, and <
- 0x37 Keyboard . and >
- 0x38 Keyboard / and ?
- 0x39 Keyboard Caps Lock
- 0x3A Keyboard F1
- 0x3B Keyboard F2
- 0x3C Keyboard F3
- 0x3D Keyboard F4
- 0x3E Keyboard F5
- 0x3F Keyboard F6
- 0x40 Keyboard F7
- 0x41 Keyboard F8
- 0x42 Keyboard F9
- 0x43 Keyboard F10
- 0x44 Keyboard F11
- 0x45 Keyboard F12
- 0x46 Keyboard PrintScreen
- 0x47 Keyboard Scroll Lock
- 0x48 Keyboard Pause
- 0x49 Keyboard Insert
- 0x4A Keyboard Home
- 0x4B Keyboard PageUp
- 0x4C Keyboard Delete Forward
- 0x4D Keyboard End
- 0x4E Keyboard PageDown
- 0x4F Keyboard RightArrow
- 0x50 Keyboard LeftArrow
- 0x51 Keyboard DownArrow
- 0x52 Keyboard UpArrow
- 0x53 Keypad Num Lock and Clear
- 0x54 Keypad /
- 0x55 Keypad *
- 0x56 Keypad -
- 0x57 Keypad +
- 0x58 Keypad ENTER
- 0x59 Keypad 1 and End
- 0x5A Keypad 2 and Down Arrow
- 0x5B Keypad 3 and PageDn
- 0x5C Keypad 4 and Left Arrow
- 0x5D Keypad 5
- 0x5E Keypad 6 and Right Arrow
- 0x5F Keypad 7 and Home
- 0x60 Keypad 8 and Up Arrow
- 0x61 Keypad 9 and PageUp
- 0x62 Keypad 0 and Insert
- 0x63 Keypad . and Delete
- 0x64 Keyboard Non-US \ and |
- 0x65 Keyboard Application
- 0x66 Keyboard Power
- 0x67 Keypad =
- 0x68 Keyboard F13
- 0x69 Keyboard F14
- 0x6A Keyboard F15
- 0x6B Keyboard F16
- 0x6C Keyboard F17
- 0x6D Keyboard F18
- 0x6E Keyboard F19
- 0x6F Keyboard F20
- 0x70 Keyboard F21
- 0x71 Keyboard F22
- 0x72 Keyboard F23
- 0x73 Keyboard F24
- 0x74 Keyboard Execute
- 0x75 Keyboard Help
- 0x76 Keyboard Menu
- 0x77 Keyboard Select
- 0x78 Keyboard Stop
- 0x79 Keyboard Again
- 0x7A Keyboard Undo
- 0x7B Keyboard Cut
- 0x7C Keyboard Copy
- 0x7D Keyboard Paste
- 0x7E Keyboard Find
- 0x7F Keyboard Mute
- 0x80 Keyboard Volume Up
- 0x81 Keyboard Volume Down
- 0x82 Keyboard Locking Caps Lock
- 0x83 Keyboard Locking Num Lock
- 0x84 Keyboard Locking Scroll Lock
- 0x85 Keypad Comma
- 0x86 Keypad Equal Sign
- 0x87 Keyboard International1
- 0x88 Keyboard International2
- 0x89 Keyboard International3
- 0x8A Keyboard International4
- 0x8B Keyboard International5
- 0x8C Keyboard International6
- 0x8D Keyboard International7
- 0x8E Keyboard International8
- 0x8F Keyboard International9
- 0x90 Keyboard LANG1
- 0x91 Keyboard LANG2
- 0x92 Keyboard LANG3
- 0x93 Keyboard LANG4
- 0x94 Keyboard LANG5
- 0x95 Keyboard LANG6
- 0x96 Keyboard LANG7
- 0x97 Keyboard LANG8
- 0x98 Keyboard LANG9
- 0x99 Keyboard Alternate Erase
- 0x9A Keyboard SysReq/Attention
- 0x9B Keyboard Cancel
- 0x9C Keyboard Clear
- 0x9D Keyboard Prior
- 0x9E Keyboard Return
- 0x9F Keyboard Separator
- 0xA0 Keyboard Out
- 0xA1 Keyboard Oper
- 0xA2 Keyboard Clear/Again
- 0xA3 Keyboard CrSel/Props
- 0xA4 Keyboard ExSel
- 0xE0 Keyboard LeftControl
- 0xE1 Keyboard LeftShift
- 0xE2 Keyboard LeftAlt
- 0xE3 Keyboard Left GUI
- 0xE4 Keyboard RightControl
- 0xE5 Keyboard RightShift
- 0xE6 Keyboard RightAlt
- 0xE7 Keyboard Right GUI
-
-8 LEDs
- 0x00 Undefined
- 0x01 Num Lock
- 0x02 Caps Lock
- 0x03 Scroll Lock
- 0x04 Compose
- 0x05 Kana
- 0x06 Power
- 0x07 Shift
- 0x08 Do Not Disturb
- 0x09 Mute
- 0x0A Tone Enable
- 0x0B High Cut Filter
- 0x0C Low Cut Filter
- 0x0D Equalizer Enable
- 0x0E Sound Field On
- 0x0F Surround Field On
- 0x10 Repeat
- 0x11 Stereo
- 0x12 Sampling Rate Detect
- 0x13 Spinning
- 0x14 CAV
- 0x15 CLV
- 0x16 Recording Format Detect
- 0x17 Off-Hook
- 0x18 Ring
- 0x19 Message Waiting
- 0x1A Data Mode
- 0x1B Battery Operation
- 0x1C Battery OK
- 0x1D Battery Low
- 0x1E Speaker
- 0x1F Head Set
- 0x20 Hold
- 0x21 Microphone
- 0x22 Coverage
- 0x23 Night Mode
- 0x24 Send Calls
- 0x25 Call Pickup
- 0x26 Conference
- 0x27 Stand-by
- 0x28 Camera On
- 0x29 Camera Off
- 0x2A On-Line
- 0x2B Off-Line
- 0x2C Busy
- 0x2D Ready
- 0x2E Paper-Out
- 0x2F Paper-Jam
- 0x30 Remote
- 0x31 Forward
- 0x32 Reverse
- 0x33 Stop
- 0x34 Rewind
- 0x35 Fast Forward
- 0x36 Play
- 0x37 Pause
- 0x38 Record
- 0x39 Error
- 0x3A Usage Selected Indicator
- 0x3B Usage In Use Indicator
- 0x3C Usage Multi Mode Indicator
- 0x3D Indicator On
- 0x3E Indicator Flash
- 0x3F Indicator Slow Blink
- 0x40 Indicator Fast Blink
- 0x41 Indicator Off
- 0x42 Flash On Time
- 0x43 Slow Blink On Time
- 0x44 Slow Blink Off Time
- 0x45 Fast Blink On Time
- 0x46 Fast Blink Off Time
- 0x47 Usage Indicator Color
- 0x48 Red
- 0x49 Green
- 0x4A Amber
- 0x4B Generic Indicator
- 0x4C System Suspend
- 0x4D External Power Connected
- 0x4C-FFFF Reserved
-
-9 Button
- 0x00 No Button Pressed
- * Button %d
-
-10 Ordinal
- 0x00 Unused
- * Instance %d
-
-11 Telephony
- 0x00 Unassigned
- 0x01 Phone
- 0x02 Answering Machine
- 0x03 Message Controls
- 0x04 Handset
- 0x05 Headset
- 0x06 Telephony Key Pad
- 0x07 Programmable Button
- 0x20 Hook Switch
- 0x21 Flash
- 0x22 Feature
- 0x23 Hold
- 0x24 Redial
- 0x25 Transfer
- 0x26 Drop
- 0x27 Park
- 0x28 Forward Calls
- 0x29 Alternate Function
- 0x2A Line
- 0x2B Speaker Phone
- 0x2C Conference
- 0x2D Ring Enable
- 0x2E Ring Select
- 0x2F Phone Mute
- 0x30 Caller ID
- 0x50 Speed Dial
- 0x51 Store Number
- 0x52 Recall Number
- 0x53 Phone Directory
- 0x70 Voice Mail
- 0x71 Screen Calls
- 0x72 Do Not Disturb
- 0x73 Message
- 0x74 Answer On/Off
- 0x90 Inside Dial Tone
- 0x91 Outside Dial Tone
- 0x92 Inside Ring Tone
- 0x93 Outside Ring Tone
- 0x94 Priority Ring Tone
- 0x95 Inside Ringback
- 0x96 Priority Ringback
- 0x97 Line Busy Tone
- 0x98 Reorder Tone
- 0x99 Call Waiting Tone
- 0x9A Confirmation Tone 1
- 0x9B Confirmation Tone 2
- 0x9C Tones Off
- 0xB0 Phone Key 0
- 0xB1 Phone Key 1
- 0xB2 Phone Key 2
- 0xB3 Phone Key 3
- 0xB4 Phone Key 4
- 0xB5 Phone Key 5
- 0xB6 Phone Key 6
- 0xB7 Phone Key 7
- 0xB8 Phone Key 8
- 0xB9 Phone Key 9
- 0xBA Phone Key Star
- 0xBB Phone Key Pound
- 0xBC Phone Key A
- 0xBD Phone Key B
- 0xBE Phone Key C
- 0xBF Phone Key D
-
-12 Consumer
- 0x00 Unassigned
- 0x01 Consumer Control
- 0x02 Numeric Key Pad
- 0x03 Programmable Buttons
- 0x20 +10
- 0x21 +100
- 0x22 AM/PM
- 0x30 Power
- 0x31 Reset
- 0x32 Sleep
- 0x33 Sleep After
- 0x34 Sleep Mode
- 0x35 Illumination
- 0x36 Function Buttons
- 0x40 Menu
- 0x41 Menu Pick
- 0x42 Menu Up
- 0x43 Menu Down
- 0x44 Menu Left
- 0x45 Menu Right
- 0x46 Menu Escape
- 0x47 Menu Value Increase
- 0x48 Menu Value Decrease
- 0x60 Data On Screen
- 0x61 Closed Caption
- 0x62 Closed Caption Select
- 0x63 VCR/TV
- 0x64 Broadcast Mode
- 0x65 Snapshot
- 0x66 Still
- 0x80 Selection
- 0x81 Assign Selection
- 0x82 Mode Step
- 0x83 Recall Last
- 0x84 Enter Channel
- 0x85 Order Movie
- 0x86 Channel
- 0x87 Media Selection
- 0x88 Media Select Computer
- 0x89 Media Select TV
- 0x8A Media Select WWW
- 0x8B Media Select DVD
- 0x8C Media Select Telephone
- 0x8D Media Select Program Guide
- 0x8E Media Select Video Phone
- 0x8F Media Select Games
- 0x90 Media Select Messages
- 0x91 Media Select CD
- 0x92 Media Select VCR
- 0x93 Media Select Tuner
- 0x94 Quit
- 0x95 Help
- 0x96 Media Select Tape
- 0x97 Media Select Cable
- 0x98 Media Select Satellite
- 0x99 Media Select Security
- 0x9A Media Select Home
- 0x9B Media Select Call
- 0x9C Channel Increment
- 0x9D Channel Decrement
- 0x9E Media Select SAP
- 0xA0 VCR Plus
- 0xA1 Once
- 0xA2 Daily
- 0xA3 Weekly
- 0xA4 Monthly
- 0xB0 Play
- 0xB1 Pause
- 0xB2 Record
- 0xB3 Fast Forward
- 0xB4 Rewind
- 0xB5 Scan Next Track
- 0xB6 Scan Previous Track
- 0xB7 Stop
- 0xB8 Eject
- 0xB9 Random Play
- 0xBA Select DisC
- 0xBB Enter Disc
- 0xBC Repeat
- 0xBD Tracking
- 0xBE Track Normal
- 0xBF Slow Tracking
- 0xC0 Frame Forward
- 0xC1 Frame Back
- 0xC2 Mark
- 0xC3 Clear Mark
- 0xC4 Repeat From Mark
- 0xC5 Return To Mark
- 0xC6 Search Mark Forward
- 0xC7 Search Mark Backwards
- 0xC8 Counter Reset
- 0xC9 Show Counter
- 0xCA Tracking Increment
- 0xCB Tracking Decrement
- 0xE0 Volume
- 0xE1 Balance
- 0xE2 Mute
- 0xE3 Bass
- 0xE4 Treble
- 0xE5 Bass Boost
- 0xE6 Surround Mode
- 0xE7 Loudness
- 0xE8 MPX
- 0xE9 Volume Up
- 0xEA Volume Down
- 0xF0 Speed Select
- 0xF1 Playback Speed
- 0xF2 Standard Play
- 0xF3 Long Play
- 0xF4 Extended Play
- 0xF5 Slow
- 0x100 Fan Enable
- 0x101 Fan Speed
- 0x102 Light
- 0x103 Light Illumination Level
- 0x104 Climate Control Enable
- 0x105 Room Temperature
- 0x106 Security Enable
- 0x107 Fire Alarm
- 0x108 Police Alarm
- 0x150 Balance Right
- 0x151 Balance Left
- 0x152 Bass Increment
- 0x153 Bass Decrement
- 0x154 Treble Increment
- 0x155 Treble Decrement
- 0x160 Speaker System
- 0x161 Channel Left
- 0x162 Channel Right
- 0x163 Channel Center
- 0x164 Channel Front
- 0x165 Channel Center Front
- 0x166 Channel Side
- 0x167 Channel Surround
- 0x168 Channel Low Frequency Enhancement
- 0x169 Channel Top
- 0x16A Channel Unknown
- 0x170 Sub-channel
- 0x171 Sub-channel Increment
- 0x172 Sub-channel Decrement
- 0x173 Alternate Audio Increment
- 0x174 Alternate Audio Decrement
- 0x180 Application Launch Buttons
- 0x181 AL Launch Button Configuration Tool
- 0x182 AL Programmable Button Configuration
- 0x183 AL Consumer Control Configuration
- 0x184 AL Word Processor
- 0x185 AL Text Editor
- 0x186 AL Spreadsheet
- 0x187 AL Graphics Editor
- 0x188 AL Presentation App
- 0x189 AL Database App
- 0x18A AL Email Reader
- 0x18B AL Newsreader
- 0x18C AL Voicemail
- 0x18D AL Contacts/Address Book
- 0x18E AL Calendar/Schedule
- 0x18F AL Task/Project Manager
- 0x190 AL Log/Journal/Timecard
- 0x191 AL Checkbook/Finance
- 0x192 AL Calculator
- 0x193 AL A/V Capture/Playback
- 0x194 AL Local Machine Browser
- 0x195 AL LAN/WAN Browser
- 0x196 AL Internet Browser
- 0x197 AL Remote Networking/ISP Connect
- 0x198 AL Network Conference
- 0x199 AL Network Chat
- 0x19A AL Telephony/Dialer
- 0x19B AL Logon
- 0x19C AL Logoff
- 0x19D AL Logon/Logoff
- 0x19E AL Terminal Lock/Screensaver
- 0x19F AL Control Panel
- 0x1A0 AL Command Line Processor/Run
- 0x1A1 AL Process/Task Manager
- 0x1A2 AL Select Tast/Application
- 0x1A3 AL Next Task/Application
- 0x1A4 AL Previous Task/Application
- 0x1A5 AL Preemptive Halt Task/Application
- 0x200 Generic GUI Application Controls
- 0x201 AC New
- 0x202 AC Open
- 0x203 AC Close
- 0x204 AC Exit
- 0x205 AC Maximize
- 0x206 AC Minimize
- 0x207 AC Save
- 0x208 AC Print
- 0x209 AC Properties
- 0x21A AC Undo
- 0x21B AC Copy
- 0x21C AC Cut
- 0x21D AC Paste
- 0x21E AC Select All
- 0x21F AC Find
- 0x220 AC Find and Replace
- 0x221 AC Search
- 0x222 AC Go To
- 0x223 AC Home
- 0x224 AC Back
- 0x225 AC Forward
- 0x226 AC Stop
- 0x227 AC Refresh
- 0x228 AC Previous Link
- 0x229 AC Next Link
- 0x22A AC Bookmarks
- 0x22B AC History
- 0x22C AC Subscriptions
- 0x22D AC Zoom In
- 0x22E AC Zoom Out
- 0x22F AC Zoom
- 0x230 AC Full Screen View
- 0x231 AC Normal View
- 0x232 AC View Toggle
- 0x233 AC Scroll Up
- 0x234 AC Scroll Down
- 0x235 AC Scroll
- 0x236 AC Pan Left
- 0x237 AC Pan Right
- 0x238 AC Pan
- 0x239 AC New Window
- 0x23A AC Tile Horizontally
- 0x23B AC Tile Vertically
- 0x23C AC Format
-
-13 Digitizer
- 0x00 Undefined
- 0x01 Digitizer
- 0x02 Pen
- 0x03 Light Pen
- 0x04 Touch Screen
- 0x05 Touch Pad
- 0x06 White Board
- 0x07 Coordinate Measuring Machine
- 0x08 3-D Digitizer
- 0x09 Stereo Plotter
- 0x0A Articulated Arm
- 0x0B Armature
- 0x0C Multiple Point Digitizer
- 0x0D Free Space Wand
- 0x20 Stylus
- 0x21 Puck
- 0x22 Finger
- 0x30 Tip Pressure
- 0x31 Barrel Pressure
- 0x32 In Range
- 0x33 Touch
- 0x34 Untouch
- 0x35 Tap
- 0x36 Quality
- 0x37 Data Valid
- 0x38 Transducer Index
- 0x39 Tablet Function Keys
- 0x3A Program Change Keys
- 0x3B Battery Strength
- 0x3C Invert
- 0x3D X Tilt
- 0x3E Y Tilt
- 0x3F Azimuth
- 0x40 Altitude
- 0x41 Twist
- 0x42 Tip Switch
- 0x43 Secondary Tip Switch
- 0x44 Barrel Switch
- 0x45 Eraser
- 0x46 Tablet Pick
-
-15 Physical Interface Device
-
-16 Unicode
- * Unicode Char u%04x
-
-20 Alphnumeric Display
- 0x00 Undefined
- 0x01 Alphanumeric Display
- 0x20 Display Attributes Report
- 0x21 ASCII Character Set
- 0x22 Data Read Back
- 0x23 Font Read Back
- 0x24 Display Control Report
- 0x25 Clear Display
- 0x26 Display Enable
- 0x27 Screen Saver Delay
- 0x28 Screen Saver Enable
- 0x29 Vertical Scroll
- 0x2A Horizontal Scroll
- 0x2B Character Report
- 0x2C Display Data
- 0x2D Display Status
- 0x2E Stat Not Ready
- 0x2F Stat Ready
- 0x30 Err Not a loadable character
- 0x31 Err Font data cannot be read
- 0x32 Cursor Position Report
- 0x33 Row
- 0x34 Column
- 0x35 Rows
- 0x36 Columns
- 0x37 Cursor Pixel Positioning
- 0x38 Cursor Mode
- 0x39 Cursor Enable
- 0x3A Cursor Blink
- 0x3B Font Report
- 0x3C Font Data
- 0x3D Character Width
- 0x3E Character Height
- 0x3F Character Spacing Horizontal
- 0x40 Character Spacing Vertical
- 0x41 Unicode Character Set
-
-128 Monitor
- 0x00 Undefined
- 0x01 Monitor Control
- 0x02 EDID Information
- 0x03 VDIF Information
- 0x04 VESA Version
- 0x05 On Screen Display
- 0x06 Auto Size Center
- 0x07 Polarity Horz Synch
- 0x08 Polarity Vert Synch
- 0x09 Sync Type
- 0x0A Screen Position
- 0x0B Horizontal Frequency
- 0x0C Vertical Frequency
-
-129 Monitor Enumerated Values
- 0x00 unassigned
- * ENUM %d
-
-130 VESA Virtual Controls
- 0x10 Brightness
- 0x12 Contrast
- 0x16 Video Gain Red
- 0x18 Video Gain Green
- 0x1A Video Gain Blue
- 0x1C Focus
- 0x20 Horizontal Position
- 0x22 Horizontal Size
- 0x24 Horizontal Pincushion
- 0x26 Horizontal Pincushion Balance
- 0x28 Horizontal Misconvergence
- 0x2A Horizontal Linearity
- 0x2C Horizontal Linearity Balance
- 0x30 Vertical Position
- 0x32 Vertical Size
- 0x34 Vertical Pincushion
- 0x36 Vertical Pincushion Balance
- 0x38 Vertical Misconvergence
- 0x3A Vertical Linearity
- 0x3C Vertical Linearity Balance
- 0x40 Parallelogram Distortion
- 0x42 Trapezoidal Distortion
- 0x44 Tilt
- 0x46 Top Corner Distortion Control
- 0x48 Top Corner Distortion Balance
- 0x4A Bottom Corner Distortion Control
- 0x4C Bottom Corner Distortion Balance
- 0x56 Moiré Horizontal
- 0x58 Moiré Vertical
- 0x5E Input Level Select
- 0x60 Input Source Select
- 0x62 Stereo Mode
- 0x6C Video Black Level Red
- 0x6E Video Black Level Green
- 0x70 Video Black Level Blue
-
-131 VESA Command
- 0x00 Undefined
- 0x01 Settings
- 0x02 Degauss
-
-132 Power Device
- 0x00 Undefined
- 0x01 iName
- 0x02 PresentStatus
- 0x03 ChangedStatus
- 0x04 UPS
- 0x05 PowerSupply
- 0x10 BatterySystem
- 0x11 BatterySystemID
- 0x12 Battery
- 0x13 BatteryID
- 0x14 Charger
- 0x15 ChargerID
- 0x16 PowerConverter
- 0x17 PowerConverterID
- 0x18 OutletSystem
- 0x19 OutletSystemID
- 0x1A Input
- 0x1B InputID
- 0x1C Output
- 0x1D OutputID
- 0x1E Flow
- 0x1F FlowID
- 0x20 Outlet
- 0x21 OutletID
- 0x22 Gang
- 0x23 GangID
- 0x24 Sink
- 0x25 SinkID
- 0x30 Voltage
- 0x31 Current
- 0x32 Frequency
- 0x33 ApparentPower
- 0x34 ActivePower
- 0x35 PercentLoad
- 0x36 Temperature
- 0x37 Humidity
- 0x40 ConfigVoltage
- 0x41 ConfigCurrent
- 0x42 ConfigFrequency
- 0x43 ConfigApparentPower
- 0x44 ConfigActivePower
- 0x45 ConfigPercentLoad
- 0x46 ConfigTemperature
- 0x47 ConfigHumidity
- 0x50 SwitchOnControl
- 0x51 SwitchOffControl
- 0x52 ToggleControl
- 0x53 LowVoltageTransfer
- 0x54 HighVoltageTransfer
- 0x55 DelayBeforeReboot
- 0x56 DelayBeforeStartup
- 0x57 DelayBeforeShutdown
- 0x58 Test
- 0x59 Vendorspecificcommand
- 0x60 Present
- 0x61 Good
- 0x62 InternalFailure
- 0x63 VoltageOutOfRange
- 0x64 FrequencyOutOfRange
- 0x65 Overload
- 0x66 OverCharged
- 0x67 OverTemperature
- 0x68 ShutdownRequested
- 0x69 ShutdownImminent
- 0x6A VendorSpecificAnswerValid
- 0x6B SwitchOn/Off
- 0x6C Switcheble
- 0x6D Used
- 0x6E Boost
- 0x6F Buck
- 0x70 Initialized
- 0x71 Tested
-
-133 Battery System
- 0x00 Undefined
- 0x01 SMBBatteryMode
- 0x02 SMBBatteryStatus
- 0x03 SMBAlarmWarning
- 0x04 SMBChargerMode
- 0x05 SMBChargerStatus
- 0x06 SMBChargerSpecInfo
- 0x07 SMBSelectorState
- 0x08 SMBSelectorPreset
- 0x09 SMBSelectorInfo
- 0x10 OptionalMfgFunction1
- 0x11 OptionalMfgFunction2
- 0x12 OptionalMfgFunction3
- 0x13 OptionalMfgFunction4
- 0x14 OptionalMfgFunction5
- 0x15 ConnectionToSMBus
- 0x16 OutputConnection
- 0x17 ChargerConnection
- 0x18 BatteryInsertion
- 0x19 Usenext
- 0x1A OKToUse
- 0x28 ManufacturerAccess
- 0x29 RemainingCapacityLimit
- 0x2A RemainingTimeLimit
- 0x2B AtRate
- 0x2C CapacityMode
- 0x2D BroadcastToCharger
- 0x2E PrimaryBattery
- 0x2F ChargeController
- 0x40 TerminateCharge
- 0x41 TermminateDischarge
- 0x42 BelowRemainingCapacityLimit
- 0x43 RemainingTimeLimitExpired
- 0x44 Charging
- 0x45 Discharging
- 0x46 FullyCharged
- 0x47 FullyDischarged
- 0x48 ConditionningFlag
- 0x49 AtRateOK
- 0x4A SMBErrorCode
- 0x4B NeedReplacement
- 0x60 AtRateTimeToFull
- 0x61 AtRateTimeToEmpty
- 0x62 AverageCurrent
- 0x63 Maxerror
- 0x64 RelativeStateOfCharge
- 0x65 AbsoluteStateOfCharge
- 0x66 RemainingCapacity
- 0x67 FullChargeCapacity
- 0x68 RunTimeToEmpty
- 0x69 AverageTimeToEmpty
- 0x6A AverageTimeToFull
- 0x6B CycleCount
- 0x80 BattPackModelLevel
- 0x81 InternalChargeController
- 0x82 PrimaryBatterySupport
- 0x83 DesignCapacity
- 0x84 SpecificationInfo
- 0x85 ManufacturerDate
- 0x86 SerialNumber
- 0x87 iManufacturerName
- 0x88 iDevicename
- 0x89 iDeviceChemistery
- 0x8A iManufacturerData
- 0x8B Rechargeable
- 0x8C WarningCapacityLimit
- 0x8D CapacityGranularity1
- 0x8E CapacityGranularity2
- 0xC0 InhibitCharge
- 0xC1 EnablePolling
- 0xC2 ResetToZero
- 0xD0 ACPresent
- 0xD1 BatteryPresent
- 0xD2 PowerFail
- 0xD3 AlarmInhibited
- 0xD4 ThermistorUnderRange
- 0xD5 ThermistorHot
- 0xD6 ThermistorCold
- 0xD7 ThermistorOverRange
- 0xD8 VoltageOutOfRange
- 0xD9 CurrentOutOfRange
- 0xDA CurrentNotRegulated
- 0xDB VoltageNotRegulated
- 0xDC MasterMode
- 0xDD ChargerBattery/HostControlled
- 0xF0 ChargerSpecInfo
- 0xF1 ChargerSpecRef
- 0xF2 Level2
- 0xF3 Level3
-
-140 Bar Code Scanner
-
-141 Scale Device
-
-144 Camera Control
-
-145 Arcade Device
-
-# Some Micro$oft non-standard extensions
-0xff00 Microsoft
- 0xe9 Base Up
- 0xea Base Down
diff --git a/hw/xfree86/os-support/bsd/libusb/usbvar.h b/hw/xfree86/os-support/bsd/libusb/usbvar.h
deleted file mode 100644
index cb0bf33ec..000000000
--- a/hw/xfree86/os-support/bsd/libusb/usbvar.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* $NetBSD: usbvar.h,v 1.2 1999/05/11 21:15:46 augustss Exp $ */
-
-/*
- * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
-
-struct report_desc {
- unsigned int size;
- unsigned char data[1];
-};
-
diff --git a/hw/xfree86/os-support/bsd/memrange.h b/hw/xfree86/os-support/bsd/memrange.h
deleted file mode 100644
index 99be9ea2f..000000000
--- a/hw/xfree86/os-support/bsd/memrange.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Memory range attribute operations, peformed on /dev/mem
- *
- * $FreeBSD: src/sys/sys/memrange.h,v 1.4 1999/12/29 04:24:44 peter Exp $
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/memrange.h,v 1.1 2002/08/06 13:25:36 herrb Exp $ */
-
-#ifndef _MEMRANGE_H
-#define _MEMRANGE_H
-
-/* Memory range attributes */
-#define MDF_UNCACHEABLE (1<<0) /* region not cached */
-#define MDF_WRITECOMBINE (1<<1) /* region supports "write combine"
- * action */
-#define MDF_WRITETHROUGH (1<<2) /* write-through cached */
-#define MDF_WRITEBACK (1<<3) /* write-back cached */
-#define MDF_WRITEPROTECT (1<<4) /* read-only region */
-#define MDF_ATTRMASK (0x00ffffff)
-
-#define MDF_FIXBASE (1<<24) /* fixed base */
-#define MDF_FIXLEN (1<<25) /* fixed length */
-#define MDF_FIRMWARE (1<<26) /* set by firmware (XXX not useful?) */
-#define MDF_ACTIVE (1<<27) /* currently active */
-#define MDF_BOGUS (1<<28) /* we don't like it */
-#define MDF_FIXACTIVE (1<<29) /* can't be turned off */
-#define MDF_BUSY (1<<30) /* range is in use */
-
-struct mem_range_desc {
- u_int64_t mr_base;
- u_int64_t mr_len;
- int mr_flags;
- char mr_owner[8];
-};
-
-struct mem_range_op {
- struct mem_range_desc *mo_desc;
- int mo_arg[2];
-#define MEMRANGE_SET_UPDATE 0
-#define MEMRANGE_SET_REMOVE 1
- /* XXX want a flag that says "set and undo when I exit" */
-};
-#define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op)
-#define MEMRANGE_SET _IOW('m', 51, struct mem_range_op)
-
-#ifdef _KERNEL
-
-struct mem_range_softc;
-struct mem_range_ops {
- void (*init) __P((struct mem_range_softc * sc));
- int (*set) __P((struct mem_range_softc * sc, struct mem_range_desc * mrd, int *arg));
- void (*initAP) __P((struct mem_range_softc * sc));
-};
-
-struct mem_range_softc {
- struct mem_range_ops *mr_op;
- int mr_cap;
- int mr_ndesc;
- struct mem_range_desc *mr_desc;
-};
-
-extern struct mem_range_softc mem_range_softc;
-
-extern int mem_range_attr_get __P((struct mem_range_desc * mrd, int *arg));
-extern int mem_range_attr_set __P((struct mem_range_desc * mrd, int *arg));
-extern void mem_range_AP_init __P((void));
-#endif
-
-#endif
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
deleted file mode 100644
index 3e4ff9ee7..000000000
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#include "bus/Pci.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-#ifndef __OpenBSD__
-#define DEV_MEM "/dev/mem"
-#else
-#define DEV_MEM "/dev/xf86"
-#endif
-
-static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
-static void ppcUnmapVidMem(int, pointer, unsigned long);
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = TRUE;
- pVidMem->mapMem = ppcMapVidMem;
- pVidMem->unmapMem = ppcUnmapVidMem;
- pVidMem->initialised = TRUE;
-}
-
-
-volatile unsigned char *ioBase = MAP_FAILED;
-
-static pointer
-ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- int fd = xf86Info.screenFd;
- pointer base;
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
- Base, Size, fd);
-#endif
-
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, Base);
- if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
- "xf86MapVidMem", Size, Base, strerror(errno));
-
- return base;
-}
-
-static void
-ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap(Base, Size);
-}
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- int rv;
- static int kmem = -1;
-
- if (kmem == -1) {
- kmem = open(DEV_MEM, 2);
- if (kmem == -1) {
- FatalError("xf86ReadBIOS: open %s", DEV_MEM);
- }
- }
-
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n",
- Base, Offset, Len);
-#endif
-
-
- lseek(kmem, Base + Offset, 0);
- rv = read(kmem, Buf, Len);
-
- return rv;
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-
- return;
-}
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
deleted file mode 100644
index fe301acf5..000000000
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.3 2003/10/07 23:14:55 herrb Exp $ */
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-
-/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
-static void sparc64UnmapVidMem(int, pointer, unsigned long);
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = TRUE;
- pVidMem->mapMem = sparc64MapVidMem;
- pVidMem->unmapMem = sparc64UnmapVidMem;
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
- int flags)
-{
- int fd = xf86Info.screenFd;
- pointer base;
-
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
- Base, Size, fd);
-#endif
-
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, Base);
- if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
- "xf86MapVidMem", Size, Base, strerror(errno));
- return base;
-}
-
-static void
-sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap(Base, Size);
-}
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
-
- return (0);
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
-
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-
- return;
-}
diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c
deleted file mode 100644
index 3b16f401a..000000000
--- a/hw/xfree86/os-support/bus/460gxPCI.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.4 2003/08/29 21:08:06 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-/*
- * This file contains the glue necessary for support of Intel's 460GX chipset.
- */
-
-#include "460gxPCI.h"
-#include "xf86.h"
-#include "Pci.h"
-
-/* 460GX register definitions */
-/* SAC at 0:10:0 */
-#define CBN 0x0040
-/* SAC at CBN:0:0 */
-#define DEVNPRES 0x0070
-/* SAC at CBN:1[0-7]:0 */
-#define BUSNO 0x0048
-#define SUBNO 0x0049
-#define VGASE 0x0080
-#define PCIS 0x0084
-#define IOR 0x008C
-#define IORD 0x008E /* CBN:10:0 only */
-/* PXB at CBN:1[0-7]:1 */
-#define ERRCMD 0x0046
-
-static int cbn_460gx = -1;
-static CARD32 cbdevs_460gx = 0;
-static CARD16 iord_460gx;
-static int busno_460gx[8], subno_460gx[8];
-static CARD8 pcis_460gx[8], ior_460gx[8];
-static CARD8 has_err_460gx[8], err_460gx[8];
-static CARD8 iomap_460gx[16]; /* One for each 4k */
-static pciBusFuncs_t BusFuncs_460gx;
-
-static pciConfigPtr
-Verify460GXBus(int bus)
-{
- pciConfigPtr pPCI;
-
- if ((bus < 0) || (bus >= pciNumBuses) ||
- !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
- (pPCI->busnum != cbn_460gx) || (pPCI->funcnum != 0) ||
- (pPCI->devnum < 0x10) || (pPCI->devnum > 0x17))
- return NULL;
-
- return pPCI;
-}
-
-/*
- * This function is called to emulate the various settings in a P2P or CardBus
- * bridge's control register using one of a 460GX's SAC host bridges.
- */
-static CARD16
-Control460GXBridge(int bus, CARD16 mask, CARD16 value)
-{
- pciConfigPtr pPCI;
- PCITAG tag;
- CARD16 current = 0;
- CARD8 tmp;
-
- if ((pPCI = Verify460GXBus(bus))) {
- /* Start with VGA enablement */
- tmp = pciReadByte(pPCI->tag, VGASE);
- if (tmp & 0x01) {
- current |= PCI_PCI_BRIDGE_VGA_EN;
- if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
- !(value & PCI_PCI_BRIDGE_VGA_EN))
- pciWriteByte(pPCI->tag, VGASE, tmp & ~0x01);
- } else {
- if (mask & value & PCI_PCI_BRIDGE_VGA_EN)
- pciWriteByte(pPCI->tag, VGASE, tmp | 0x01);
- }
-
- /* Move on to master abort failure enablement */
- if (has_err_460gx[pPCI->devnum - 0x10]) {
- tag = PCI_MAKE_TAG(pPCI->busnum, pPCI->devnum, pPCI->funcnum + 1);
- tmp = pciReadByte(tag, ERRCMD);
- if (tmp & 0x01) {
- current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
- if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
- !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
- pciWriteByte(tag, ERRCMD, tmp & ~0x01);
- } else {
- if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
- pciWriteByte(tag, ERRCMD, tmp | 0x01);
- }
- }
-
- /* Put emulation of any other P2P bridge control here */
- }
-
- return (current & ~mask) | (value & mask);
-}
-
-/*
- * Retrieve various bus numbers representing the connections provided by 460GX
- * host bridges.
- */
-static void
-Get460GXBridgeBuses(int bus, int *primary, int *secondary, int *subordinate)
-{
- pciConfigPtr pPCI = Verify460GXBus(bus);
- int i;
-
- /* The returned bus numbers are initialised by the caller */
-
- if (!pPCI)
- return;
-
- i = pPCI->devnum - 0x10;
-
- /* These are not modified, so no need to re-read them */
- if (primary)
- *primary = pPCI->busnum;
- if (secondary)
- *secondary = busno_460gx[i];
- if (subordinate)
- *subordinate = subno_460gx[i];
-}
-
-/* Retrieves a list of the resources routed to a host bridge's secondary bus */
-static void
-Get460GXBridgeResources(int bus,
- pointer *ppIoRes,
- pointer *ppMemRes,
- pointer *ppPmemRes)
-{
- pciConfigPtr pPCI = Verify460GXBus(bus);
- resRange range;
- unsigned int i, j;
-
- if (ppIoRes) {
- xf86FreeResList(*ppIoRes);
- *ppIoRes = NULL;
-
- if (pPCI) {
- for (i = 0; i <= 0x0F; i++) {
- if (iomap_460gx[i] != pPCI->devnum)
- continue;
-
- RANGE(range, i << 12, ((i + 1) << 12) - 1,
- RANGE_TYPE(ResExcIoBlock, 0));
- *ppIoRes = xf86AddResToList(*ppIoRes, &range, -1);
- }
- }
- }
-
- if (ppMemRes) {
- xf86FreeResList(*ppMemRes);
- *ppMemRes = NULL;
-
- if (pPCI) {
- if (!(i = (pPCI->devnum - 0x10)))
- j = 127; /* (4GB - 32M) / 32M */
- else
- j = pcis_460gx[i - 1] & 0x7F;
-
- i = pcis_460gx[i] & 0x7F;
- if (i < j) {
- RANGE(range, i << 25, (j << 25) - 1,
- RANGE_TYPE(ResExcMemBlock, 0));
- *ppMemRes = xf86AddResToList(*ppMemRes, &range, -1);
- }
- }
- }
-
- if (ppPmemRes) {
- xf86FreeResList(*ppPmemRes);
- *ppPmemRes = NULL;
- }
-}
-
-/*
- * This checks for, and validates, the presence of the 460GX chipset, and sets
- * cbn_460gx to a positive value accordingly. This function returns TRUE if
- * the chipset scan is to be stopped, or FALSE if the scan is to move on to the
- * next chipset.
- */
-Bool
-xf86PreScan460GX(void)
-{
- pciBusInfo_t *pBusInfo;
- PCITAG tag;
- CARD32 tmp;
- int i, devno;
-
- /* Bus zero should already be set up */
- if (!(pBusInfo = pciBusInfo[0])) {
- cbn_460gx = -1;
- return FALSE;
- }
-
- /* First look for a 460GX's primary host bridge */
- tag = PCI_MAKE_TAG(0, 0x10, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
- cbn_460gx = -1;
- return FALSE;
- }
-
- /* Get CBN (Chipset bus number) */
- if (!(cbn_460gx = (unsigned int)pciReadByte(tag, CBN))) {
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
-
- if (pciNumBuses <= cbn_460gx)
- pciNumBuses = cbn_460gx + 1;
-
- /* Set up bus CBN */
- if (!pciBusInfo[cbn_460gx]) {
- pciBusInfo[cbn_460gx] = xnfalloc(sizeof(pciBusInfo_t));
- *pciBusInfo[cbn_460gx] = *pBusInfo;
- }
-
- tag = PCI_MAKE_TAG(cbn_460gx, 0, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
-
- /*
- * Find out which CBN devices the firmware thinks are present. Of these,
- * we are only interested in devices 0x10 through 0x17.
- */
- cbdevs_460gx = pciReadLong(tag, DEVNPRES);
-
- for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
- tag = PCI_MAKE_TAG(cbn_460gx, devno, 0);
- if (pciReadLong(tag, PCI_ID_REG) !=
- DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
-
- if (devno == 0x10)
- iord_460gx = pciReadWord(tag, IORD);
-
- busno_460gx[i] = (unsigned int)pciReadByte(tag, BUSNO);
- subno_460gx[i] = (unsigned int)pciReadByte(tag, SUBNO);
- pcis_460gx[i] = pciReadByte(tag, PCIS);
- ior_460gx[i] = pciReadByte(tag, IOR);
-
- has_err_460gx[i] = err_460gx[i] = 0; /* Insurance */
-
- tag = PCI_MAKE_TAG(cbn_460gx, devno, 1);
- tmp = pciReadLong(tag, PCI_ID_REG);
- switch (tmp) {
- case DEVID(VENDOR_INTEL, CHIP_460GX_PXB):
- case DEVID(VENDOR_INTEL, CHIP_460GX_WXB):
- if (cbdevs_460gx & (1 << devno)) {
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
-
- /*
- * XXX I don't have WXB docs, but PCI register dumps indicate that
- * the registers we are interested in are consistent with those of
- * the PXB.
- */
- err_460gx[i] = pciReadByte(tag, ERRCMD);
- has_err_460gx[i] = 1;
- break;
-
- case DEVID(VENDOR_INTEL, CHIP_460GX_GXB_1):
- if (cbdevs_460gx & (1 << devno)) {
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
-
- /*
- * XXX GXB isn't documented to have an ERRCMD register, nor any
- * other means of failing master aborts. For now, assume master
- * aborts are always allowed to complete normally.
- */
- break;
-
- default:
- if (((CARD16)(tmp + 1U) <= (CARD16)1U) &&
- (cbdevs_460gx & (1U << devno)))
- break;
- /* Sanity check failed */
- cbn_460gx = -1;
- return TRUE;
- }
- }
-
- /* Allow master aborts to complete normally */
- for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
- if (!(err_460gx[i] & 0x01))
- continue;
-
- pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
- ERRCMD, err_460gx[i] & ~0x01);
- }
-
- /*
- * The 460GX spec says that any access to buses higher than CBN will be
- * master-aborted. It seems possible however that this is not the case in
- * all 460GX implementations. For now, limit the bus scan to CBN, unless
- * we have already found a higher bus number.
- */
- for (i = 0; subno_460gx[i] < cbn_460gx; ) {
- if (++i < 8)
- continue;
-
- pciMaxBusNum = cbn_460gx + 1;
- break;
- }
-
- return TRUE;
-}
-
-/* This does some 460GX-related processing after the PCI bus scan */
-void
-xf86PostScan460GX(void)
-{
- pciConfigPtr pPCI, *ppPCI;
- pciBusInfo_t *pBusInfo;
- int i, j, devno;
-
- if (cbn_460gx <= 0)
- return;
-
- /* Set up our extra bus functions */
- BusFuncs_460gx = *(pciBusInfo[0]->funcs);
- BusFuncs_460gx.pciControlBridge = Control460GXBridge;
- BusFuncs_460gx.pciGetBridgeBuses = Get460GXBridgeBuses;
- BusFuncs_460gx.pciGetBridgeResources = Get460GXBridgeResources;
-
- /*
- * Mark all host bridges so that they are ignored by the upper-level
- * xf86GetPciBridgeInfo() function. This marking is later clobbered by the
- * tail end of xf86scanpci() for those bridges that actually have bus
- * segments associated with them.
- */
- ppPCI = xf86scanpci(0); /* Recursion is only apparent */
- while ((pPCI = *ppPCI++)) {
- if ((pPCI->pci_base_class == PCI_CLASS_BRIDGE) &&
- (pPCI->pci_sub_class == PCI_SUBCLASS_BRIDGE_HOST))
- pPCI->businfo = HOST_NO_BUS;
- }
-
- ppPCI = xf86scanpci(0); /* Recursion is only apparent */
- j = 0;
-
- /*
- * Fix up CBN bus linkage. This is somewhat arbitrary. The bridge chosen
- * for this must be a CBN device so that bus CBN can be recognised as the
- * root segment. It also cannot be any of the bus expanders (devices
- * CBN:0x10:0 through CBN:0x17:0 nor any of their functions). For now, we
- * chose the SAC host bridge at CBN:0:0.
- */
- pBusInfo = pciBusInfo[cbn_460gx];
- pBusInfo->bridge = pciBusInfo[0]->bridge; /* Just in case */
- while ((pPCI = *ppPCI++)) {
- if (pPCI->busnum < cbn_460gx)
- continue;
- if (pPCI->busnum > cbn_460gx)
- break;
- if (pPCI->devnum < 0)
- continue;
- if (pPCI->devnum > 0)
- break;
- if (pPCI->funcnum < 0)
- continue;
- if (pPCI->funcnum > 0)
- break;
-
- pBusInfo->bridge = pPCI;
- pBusInfo->secondary = FALSE;
- pBusInfo->primary_bus = cbn_460gx;
- break;
- }
-
- for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
- /* Restore ERRCMD registers */
- if (err_460gx[i] & 0x01)
- pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
- ERRCMD, err_460gx[i]);
-
- if (!(cbdevs_460gx & (1 << devno))) {
- while ((pPCI = *ppPCI++)) {
- if (pPCI->busnum < cbn_460gx)
- continue;
- if (pPCI->busnum > cbn_460gx)
- break;
- if (pPCI->devnum < devno)
- continue;
- if (pPCI->devnum > devno)
- break;
- if (pPCI->funcnum < 0)
- continue;
- if (pPCI->funcnum > 0)
- break;
-
- if ((pBusInfo = pciBusInfo[busno_460gx[i]]))
- break;
-
- /* Fix bus linkage */
- pBusInfo->bridge = pPCI;
- pBusInfo->secondary = TRUE;
- pBusInfo->primary_bus = cbn_460gx;
-
- /* Plug in chipset routines */
- pBusInfo->funcs = &BusFuncs_460gx;
- break;
- }
- }
-
- /* Decode IOR registers */
- for(; j <= (ior_460gx[i] & 0x0F); j++)
- iomap_460gx[j] = devno;
- }
-
- /* The bottom 4k of I/O space is always routed to PCI0a */
- iomap_460gx[0] = 0x10;
-
- /* Decode IORD register */
- for (j = 1; j <= 0x0F; j++)
- if (iord_460gx & (1 << j))
- iomap_460gx[j] = 0x10;
-}
diff --git a/hw/xfree86/os-support/bus/460gxPCI.h b/hw/xfree86/os-support/bus/460gxPCI.h
deleted file mode 100644
index 2ae9c3528..000000000
--- a/hw/xfree86/os-support/bus/460gxPCI.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h,v 1.1 2003/01/02 18:12:48 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef PCI_460GX_H
-#define PCI_460GX_H 1
-
-#include <X11/Xdefs.h>
-
-Bool xf86PreScan460GX(void);
-void xf86PostScan460GX(void);
-
-#endif
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
deleted file mode 100644
index a0b639143..000000000
--- a/hw/xfree86/os-support/bus/Pci.c
+++ /dev/null
@@ -1,1476 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.81 2003/09/24 02:43:34 dawes Exp $ */
-/*
- * Pci.c - New server PCI access functions
- *
- * The XFree86 server PCI access functions have been reimplemented as a
- * framework that allows each supported platform/OS to have their own
- * platform/OS specific pci driver.
- *
- * All of the public PCI access functions exported to the other parts of
- * the server are declared in Pci.h and defined herein. These include:
- * pciInit() - Initialize PCI access functions
- * pciFindFirst() - Find a PCI device by dev/vend id
- * pciFindNext() - Find another PCI device by dev/vend id
- * pciReadLong() - Read a 32 bit value from a device's cfg space
- * pciReadWord() - Read a 16 bit value from a device's cfg space
- * pciReadByte() - Read an 8 bit value from a device's cfg space
- * pciWriteLong() - Write a 32 bit value to a device's cfg space
- * pciWriteWord() - Write a 16 bit value to a device's cfg space
- * pciWriteByte() - Write an 8 bit value to a device's cfg space
- * pciSetBitsLong() - Write a 32 bit value against a mask
- * pciSetBitsByte() - Write an 8 bit value against a mask
- * pciTag() - Return tag for a given PCI bus, device, &
- * function
- * pciBusAddrToHostAddr() - Convert a PCI address to a host address
- * pciHostAddrToBusAddr() - Convert a host address to a PCI address
- * pciGetBaseSize() - Returns the number of bits in a PCI base
- * addr mapping
- * xf86MapPciMem() - Like xf86MapVidMem() except function expects
- * a PCI address and a PCITAG that identifies
- * a PCI device
- * xf86ReadPciBIOS() - Like xf86ReadBIOS() but can handle PCI/host
- * address translation and BIOS decode enabling
- * xf86scanpci() - Return info about all PCI devices
- * xf86GetPciDomain() - Return domain number from a PCITAG
- * xf86MapDomainMemory() - Like xf86MapPciMem() but can handle
- * domain/host address translation
- * xf86MapDomainIO() - Maps PCI I/O spaces
- * xf86ReadDomainMemory() - Like xf86ReadPciBIOS() but can handle
- * domain/host address translation
- *
- * The actual PCI backend driver is selected by the pciInit() function
- * (see below) using either compile time definitions, run-time checks,
- * or both.
- *
- * Certain generic functions are provided that make the implementation
- * of certain well behaved platforms (e.g. those supporting PCI config
- * mechanism 1 or some thing close to it) very easy.
- *
- * Less well behaved platforms/OS's can roll their own functions.
- *
- * To add support for another platform/OS, add a call to fooPciInit() within
- * pciInit() below under the correct compile time definition or run-time
- * conditional.
- *
- * The fooPciInit() procedure must do three things:
- * 1) Initialize the pciBusTable[] for all primary PCI buses including
- * the per domain PCI access functions (readLong, writeLong,
- * addrBusToHost, and addrHostToBus).
- *
- * 2) Add entries to pciBusTable[] for configured secondary buses. This
- * step may be skipped if a platform is using the generic findFirst/
- * findNext functions because these procedures will automatically
- * discover and add secondary buses dynamically.
- *
- * 3) Overide default settings for global PCI access functions if
- * required. These include pciFindFirstFP, pciFindNextFP,
- * Of course, if you choose not to use one of the generic
- * functions, you will need to provide a platform specifc replacement.
- *
- * Gary Barton
- * Concurrent Computer Corporation
- * garyb@gate.net
- *
- */
-
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * This software is derived from the original XFree86 PCI code
- * which includes the following copyright notices as well:
- *
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * This code is also based heavily on the code in FreeBSD-current, which was
- * written by Wolfgang Stanglmeier, and contains the following copyright:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include <errno.h>
-#include <signal.h>
-#include "Xarch.h"
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-#include "Pci.h"
-
-#define PCI_MFDEV_SUPPORT 1 /* Include PCI multifunction device support */
-#define PCI_BRIDGE_SUPPORT 1 /* Include support for PCI-to-PCI bridges */
-
-#ifdef PC98
-#define outb(port,data) _outb(port,data)
-#define outl(port,data) _outl(port,data)
-#define inb(port) _inb(port)
-#define inl(port) _inl(port)
-#endif
-
-/*
- * Global data
- */
-static int pciInitialized = 0;
-
-CARD32 pciDevid; /* Requested device/vendor ID (after mask) */
-CARD32 pciDevidMask; /* Bit mask applied (AND) before comparison */
- /* of real devid's with requested */
-
-int pciBusNum; /* Bus Number of current device */
-int pciDevNum; /* Device number of current device */
-int pciFuncNum; /* Function number of current device */
-PCITAG pciDeviceTag; /* Tag for current device */
-
-pciBusInfo_t *pciBusInfo[MAX_PCI_BUSES] = { NULL, };
-int pciNumBuses = 0; /* Actual number of PCI buses */
-int pciMaxBusNum = MAX_PCI_BUSES;
-static Bool inProbe = FALSE;
-
-static pciConfigPtr pci_devp[MAX_PCI_DEVICES + 1] = {NULL, };
-
-/*
- * Platform specific PCI function pointers.
- *
- * NOTE: A platform/OS specific pci init procedure can override these defaults
- * by setting them to the appropriate platform dependent functions.
- */
-PCITAG (*pciFindFirstFP)(void) = pciGenFindFirst;
-PCITAG (*pciFindNextFP)(void) = pciGenFindNext;
-
-/*
- * pciInit - choose correct platform/OS specific PCI init routine
- */
-void
-pciInit()
-{
- if (pciInitialized)
- return;
-
- pciInitialized = 1;
-
- /* XXX */
-#if defined(DEBUGPCI)
- if (DEBUGPCI >= xf86Verbose)
- xf86Verbose = DEBUGPCI;
-#endif
-
- ARCH_PCI_INIT();
-#if defined(ARCH_PCI_OS_INIT)
- if (pciNumBuses <= 0)
- ARCH_PCI_OS_INIT();
-#endif
-}
-
-PCITAG
-pciFindFirst(CARD32 id, CARD32 mask)
-{
-#ifdef DEBUGPCI
- ErrorF("pciFindFirst(0x%lx, 0x%lx), pciInit = %d\n", id, mask, pciInitialized);
-#endif
- pciInit();
-
- pciDevid = id & mask;
- pciDevidMask = mask;
-
- return((*pciFindFirstFP)());
-}
-
-PCITAG
-pciFindNext(void)
-{
-#ifdef DEBUGPCI
- ErrorF("pciFindNext(), pciInit = %d\n", pciInitialized);
-#endif
- pciInit();
-
- return((*pciFindNextFP)());
-}
-
-CARD32
-pciReadLong(PCITAG tag, int offset)
-{
- int bus = PCI_BUS_FROM_TAG(tag);
-
-#ifdef DEBUGPCI
- ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset);
-#endif
- pciInit();
-
- if ((bus >= 0) && ((bus < pciNumBuses) || inProbe) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciReadLong) {
- CARD32 rv = (*pciBusInfo[bus]->funcs->pciReadLong)(tag, offset);
-
- PCITRACE(1, ("pciReadLong: tag=0x%x [b=%d,d=%d,f=%d] returns 0x%08x\n",
- tag, bus, PCI_DEV_FROM_TAG(tag), PCI_FUNC_FROM_TAG(tag), rv));
- return(rv);
- }
-
- return(PCI_NOT_FOUND);
-}
-
-CARD16
-pciReadWord(PCITAG tag, int offset)
-{
- CARD32 tmp;
- int shift = (offset & 3) * 8;
- int aligned_offset = offset & ~3;
-
- if (shift != 0 && shift != 16)
- FatalError("pciReadWord: Alignment error: Cannot read 16 bits "
- "at offset %d\n", offset);
-
- tmp = pciReadLong(tag, aligned_offset);
-
- return((CARD16)((tmp >> shift) & 0xffff));
-}
-
-CARD8
-pciReadByte(PCITAG tag, int offset)
-{
- CARD32 tmp;
- int shift = (offset & 3) * 8;
- int aligned_offset = offset & ~3;
-
- tmp = pciReadLong(tag, aligned_offset);
-
- return((CARD8)((tmp >> shift) & 0xff));
-}
-
-void
-pciWriteLong(PCITAG tag, int offset, CARD32 val)
-{
- int bus = PCI_BUS_FROM_TAG(tag);
-
- pciInit();
-
- if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciWriteLong)
- (*pciBusInfo[bus]->funcs->pciWriteLong)(tag, offset, val);
-}
-
-void
-pciWriteWord(PCITAG tag, int offset, CARD16 val)
-{
- CARD32 tmp;
- int aligned_offset = offset & ~3;
- int shift = (offset & 3) * 8;
-
- if (shift != 0 && shift != 16)
- FatalError("pciWriteWord: Alignment Error: Cannot read 16 bits "
- "from offset %d\n", offset);
-
- tmp = pciReadLong(tag, aligned_offset);
-
- tmp &= ~(0xffffL << shift);
- tmp |= (((CARD32)val) << shift);
-
- pciWriteLong(tag, aligned_offset, tmp);
-}
-
-void
-pciWriteByte(PCITAG tag, int offset, CARD8 val)
-{
- CARD32 tmp;
- int aligned_offset = offset & ~3;
- int shift = (offset & 3) *8 ;
-
- tmp = pciReadLong(tag, aligned_offset);
-
- tmp &= ~(0xffL << shift);
- tmp |= (((CARD32)val) << shift);
-
- pciWriteLong(tag, aligned_offset, tmp);
-}
-
-void
-pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val)
-{
- int bus = PCI_BUS_FROM_TAG(tag);
-
-#ifdef DEBUGPCI
- ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset);
-#endif
- pciInit();
-
- if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciSetBitsLong) {
- (*pciBusInfo[bus]->funcs->pciSetBitsLong)(tag, offset, mask, val);
- }
-}
-
-void
-pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val)
-{
- CARD32 tmp_mask, tmp_val;
- int aligned_offset = offset & ~3;
- int shift = (offset & 3) *8 ;
-
- tmp_mask = mask << shift;
- tmp_val = val << shift;
- pciSetBitsLong(tag, aligned_offset, tmp_mask, tmp_val);
-}
-
-ADDRESS
-pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
-{
- int bus = PCI_BUS_FROM_TAG(tag);
-
- pciInit();
-
- if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciAddrBusToHost)
- return (*pciBusInfo[bus]->funcs->pciAddrBusToHost)(tag, type, addr);
- else
- return(addr);
-}
-
-ADDRESS
-pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
-{
- int bus = PCI_BUS_FROM_TAG(tag);
-
- pciInit();
-
- if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciAddrHostToBus)
- return (*pciBusInfo[bus]->funcs->pciAddrHostToBus)(tag, type, addr);
- else
- return(addr);
-}
-
-/*
- * pciGetBaseSize() returns the size of a PCI base address mapping in bits.
- * The index identifies the base register: 0-5 are the six standard registers,
- * and 6 is the ROM base register. If destructive is TRUE, it will write
- * to the base address register to get an accurate result. Otherwise it
- * makes a conservative guess based on the alignment of the already allocated
- * address. If the result is accurate (ie, not an over-estimate), this is
- * indicated by setting *min to TRUE (when min is non-NULL). This currently
- * only happens when the destructive flag is set, but in future it may be
- * possible to get the information from the OS when supported.
- */
-
-int
-pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min)
-{
- int offset;
- CARD32 addr1;
- CARD32 addr2;
- CARD32 mask1;
- CARD32 mask2;
- int bits = 0;
-
- /*
- * Eventually a function for this should be added to pciBusFuncs_t, but for
- * now we'll just use a simple method based on the alignment of the already
- * allocated address.
- */
-
- /*
- * silently ignore bogus index values. Valid values are 0-6. 0-5 are
- * the 6 base address registers, and 6 is the ROM base address register.
- */
- if (index < 0 || index > 6)
- return 0;
-
- pciInit();
-
- if (xf86GetPciSizeFromOS(tag, index, &bits)) {
- if (min)
- *min = TRUE;
- return bits;
- }
-
- if (min)
- *min = destructive;
-
- /* Get the PCI offset */
- if (index == 6)
- offset = PCI_MAP_ROM_REG;
- else
- offset = PCI_MAP_REG_START + (index << 2);
-
- addr1 = pciReadLong(tag, offset);
- /*
- * Check if this is the second part of a 64 bit address.
- * XXX need to check how endianness affects 64 bit addresses.
- */
- if (index > 0 && index < 6) {
- addr2 = pciReadLong(tag, offset - 4);
- if (PCI_MAP_IS_MEM(addr2) && PCI_MAP_IS64BITMEM(addr2))
- return 0;
- }
-
- if (destructive) {
- pciWriteLong(tag, offset, 0xffffffff);
- mask1 = pciReadLong(tag, offset);
- pciWriteLong(tag, offset, addr1);
- } else {
- mask1 = addr1;
- }
-
- /* Check if this is the first part of a 64 bit address. */
- if (index < 5 && PCI_MAP_IS_MEM(mask1) && PCI_MAP_IS64BITMEM(mask1)) {
- if (PCIGETMEMORY(mask1) == 0) {
- addr2 = pciReadLong(tag, offset + 4);
- if (destructive) {
- pciWriteLong(tag, offset + 4, 0xffffffff);
- mask2 = pciReadLong(tag, offset + 4);
- pciWriteLong(tag, offset + 4, addr2);
- } else {
- mask2 = addr2;
- }
- if (mask2 == 0)
- return 0;
- bits = 32;
- while ((mask2 & 1) == 0) {
- bits++;
- mask2 >>= 1;
- }
- if (bits > 32)
- return bits;
- }
- }
- if (index < 6)
- if (PCI_MAP_IS_MEM(mask1))
- mask1 = PCIGETMEMORY(mask1);
- else
- mask1 = PCIGETIO(mask1);
- else
- mask1 = PCIGETROM(mask1);
- if (mask1 == 0)
- return 0;
- bits = 0;
- while ((mask1 & 1) == 0) {
- bits++;
- mask1 >>= 1;
- }
- /* I/O maps can be no larger than 8 bits */
-
- if ((index < 6) && PCI_MAP_IS_IO(addr1) && bits > 8)
- bits = 8;
- /* ROM maps can be no larger than 24 bits */
- if (index == 6 && bits > 24)
- bits = 24;
- return bits;
-}
-
-PCITAG
-pciTag(int busnum, int devnum, int funcnum)
-{
- return(PCI_MAKE_TAG(busnum,devnum,funcnum));
-}
-
-#if defined(PCI_MFDEV_SUPPORT) || defined(PowerMAX_OS)
-
-Bool
-pciMfDev(int busnum, int devnum)
-{
- PCITAG tag0, tag1;
- unsigned long id0, id1, val;
-
- /* Detect a multi-function device that complies to the PCI 2.0 spec */
-
- tag0 = PCI_MAKE_TAG(busnum, devnum, 0);
- id0 = pciReadLong(tag0, PCI_ID_REG);
- if ((CARD16)(id0 + 1) <= (CARD16)1UL)
- return FALSE;
-
- val = pciReadLong(tag0, PCI_HEADER_MISC) & 0x00ff0000;
- if ((val != 0x00ff0000) && (val & PCI_HEADER_MULTIFUNCTION))
- return TRUE;
-
- /*
- * Now, to find non-compliant devices...
- * If there is a valid ID for function 1 and the ID for func 0 and 1
- * are different, or the base0 values of func 0 and 1 are differend,
- * then assume there is a multi-function device.
- */
- tag1 = PCI_MAKE_TAG(busnum, devnum, 1);
- id1 = pciReadLong(tag1, PCI_ID_REG);
- if ((CARD16)(id1 + 1) <= (CARD16)1UL)
- return FALSE;
-
- /* Vendor IDs should match */
- if ((id0 ^ id1) & 0x0000ffff)
- return FALSE;
-
- if ((id0 != id1) ||
- /* Note the following test is valid for header types 0, 1 and 2 */
- (pciReadLong(tag0, PCI_MAP_REG_START) !=
- pciReadLong(tag1, PCI_MAP_REG_START)))
- return TRUE;
-
- return FALSE;
-}
-
-#endif
-
-/*
- * Generic find/read/write functions
- */
-PCITAG
-pciGenFindNext(void)
-{
- CARD32 devid, tmp;
- int sec_bus, pri_bus;
- static int previousBus = 0;
- Bool speculativeProbe = FALSE;
- unsigned char base_class, sub_class;
-
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext\n");
-#endif
-
- for (;;) {
-
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum);
-#endif
- if (pciBusNum == -1) {
- /*
- * Start at top of the order
- */
- if (pciNumBuses <= 0)
- return(PCI_NOT_FOUND);
-
- /* Skip ahead to the first bus defined by pciInit() */
- for (pciBusNum = 0; !pciBusInfo[pciBusNum]; ++pciBusNum);
- pciFuncNum = 0;
- pciDevNum = 0;
- previousBus = pciBusNum; /* make sure previousBus exists */
- } else {
-#ifdef PCI_MFDEV_SUPPORT
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum);
-#endif
- /*
- * Somewhere in middle of order. Determine who's
- * next up
- */
- if (pciFuncNum == 0) {
- /*
- * Is current dev a multifunction device?
- */
- if (!speculativeProbe && pciMfDev(pciBusNum, pciDevNum))
- /* Probe for other functions */
- pciFuncNum = 1;
- else
- /*
- * No more functions this device. Next
- * device please
- */
- pciDevNum ++;
- } else if (++pciFuncNum >= 8) {
- /* No more functions for this device. Next device please */
- pciFuncNum = 0;
- pciDevNum ++;
- }
-#else
- pciDevNum ++;
-#endif
- if (pciDevNum >= 32 ||
- !pciBusInfo[pciBusNum] ||
- pciDevNum >= pciBusInfo[pciBusNum]->numDevices) {
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: next bus\n");
-#endif
- /*
- * No more devices for this bus. Next bus please
- */
- if (speculativeProbe) {
- NextSpeculativeBus:
- xfree(pciBusInfo[pciBusNum]);
- pciBusInfo[pciBusNum] = NULL;
- speculativeProbe = FALSE;
- }
-
- if (++pciBusNum >= pciMaxBusNum) {
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: out of buses\n");
-#endif
- /* No more buses. All done for now */
- return(PCI_NOT_FOUND);
- }
-
- pciDevNum = 0;
- }
- }
-
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]);
-#endif
- if (!pciBusInfo[pciBusNum]) {
- pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t));
- *pciBusInfo[pciBusNum] = *pciBusInfo[previousBus];
-
- speculativeProbe = TRUE;
- }
-
- /*
- * At this point, pciBusNum, pciDevNum, and pciFuncNum have been
- * advanced to the next device. Compute the tag, and read the
- * device/vendor ID field.
- */
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum);
-#endif
- pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum);
- inProbe = TRUE;
- devid = pciReadLong(pciDeviceTag, PCI_ID_REG);
- inProbe = FALSE;
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid);
-#endif
- if ((CARD16)(devid + 1U) <= (CARD16)1UL)
- continue; /* Nobody home. Next device please */
-
- /*
- * Some devices mis-decode configuration cycles in such a way as to
- * create phantom buses.
- */
- if (speculativeProbe && (pciDevNum == 0) && (pciFuncNum == 0) &&
- (PCI_BUS_NO_DOMAIN(pciBusNum) > 0)) {
- for (;;) {
- if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices)
- goto NextSpeculativeBus;
- if (devid !=
- pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0),
- PCI_ID_REG))
- break;
- }
-
- pciDevNum = 0;
- }
-
- if (pciNumBuses <= pciBusNum)
- pciNumBuses = pciBusNum + 1;
-
- speculativeProbe = FALSE;
- previousBus = pciBusNum;
-
-#ifdef PCI_BRIDGE_SUPPORT
- /*
- * Before checking for a specific devid, look for enabled
- * PCI to PCI bridge devices. If one is found, create and
- * initialize a bus info record (if one does not already exist).
- */
- tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG);
- base_class = PCI_CLASS_EXTRACT(tmp);
- sub_class = PCI_SUBCLASS_EXTRACT(tmp);
- if ((base_class == PCI_CLASS_BRIDGE) &&
- ((sub_class == PCI_SUBCLASS_BRIDGE_PCI) ||
- (sub_class == PCI_SUBCLASS_BRIDGE_CARDBUS))) {
- tmp = pciReadLong(pciDeviceTag, PCI_PCI_BRIDGE_BUS_REG);
- sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp, pciDeviceTag);
- pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp, pciDeviceTag);
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n",
- pri_bus, sec_bus);
-#endif
- if (pciBusNum != pri_bus) {
- /* Some bridges do not implement the primary bus register */
- if ((PCI_BUS_NO_DOMAIN(pri_bus) != 0) ||
- (sub_class != PCI_SUBCLASS_BRIDGE_CARDBUS))
- xf86Msg(X_WARNING,
- "pciGenFindNext: primary bus mismatch on PCI"
- " bridge 0x%08lx (0x%02x, 0x%02x)\n",
- pciDeviceTag, pciBusNum, pri_bus);
- pri_bus = pciBusNum;
- }
- if ((pri_bus < sec_bus) && (sec_bus < pciMaxBusNum) &&
- pciBusInfo[pri_bus]) {
- /*
- * Found a secondary PCI bus
- */
- if (!pciBusInfo[sec_bus]) {
- pciBusInfo[sec_bus] = xnfalloc(sizeof(pciBusInfo_t));
-
- /* Copy parents settings... */
- *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus];
- }
-
- /* ...but not everything same as parent */
- pciBusInfo[sec_bus]->primary_bus = pri_bus;
- pciBusInfo[sec_bus]->secondary = TRUE;
- pciBusInfo[sec_bus]->numDevices = 32;
-
- if (pciNumBuses <= sec_bus)
- pciNumBuses = sec_bus + 1;
- }
- }
-#endif
-
- /*
- * Does this device match the requested devid after
- * applying mask?
- */
-#ifdef DEBUGPCI
- ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid);
-#endif
- if ((devid & pciDevidMask) == pciDevid)
- /* Yes - Return it. Otherwise, next device */
- return(pciDeviceTag); /* got a match */
-
- } /* for */
- /*NOTREACHED*/
-}
-
-PCITAG
-pciGenFindFirst(void)
-{
- /* Reset PCI bus number to start from top */
- pciBusNum = -1;
-
- return pciGenFindNext();
-}
-
-#if defined (__powerpc__)
-static int buserr_detected;
-
-static
-void buserr(int sig)
-{
- buserr_detected = 1;
-}
-#endif
-
-CARD32
-pciCfgMech1Read(PCITAG tag, int offset)
-{
- unsigned long rv = 0xffffffff;
-#ifdef DEBUGPCI
- ErrorF("pciCfgMech1Read(tag=%08x,offset=%08x)\n", tag, offset);
-#endif
-
-#if defined(__powerpc__)
- signal(SIGBUS, buserr);
- buserr_detected = 0;
-#endif
-
- outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
- rv = inl(0xCFC);
-
-#if defined(__powerpc__)
- signal(SIGBUS, SIG_DFL);
- if (buserr_detected)
- {
-#ifdef DEBUGPCI
- ErrorF("pciCfgMech1Read() BUS ERROR\n");
-#endif
- return(0xffffffff);
- }
- else
-#endif
- return(rv);
-}
-
-void
-pciCfgMech1Write(PCITAG tag, int offset, CARD32 val)
-{
-#ifdef DEBUGPCI
- ErrorF("pciCfgMech1Write(tag=%08x,offset=%08x,val=%08x)\n",
- tag, offset,val);
-#endif
-
-#if defined(__powerpc__)
- signal(SIGBUS, SIG_IGN);
-#endif
-
- outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
-#if defined(Lynx) && defined(__powerpc__)
- outb(0x80, 0x00); /* without this the next access fails
- * on my Powerstack system when we use
- * assembler inlines for outl */
-#endif
- outl(0xCFC, val);
-
-#if defined(__powerpc__)
- signal(SIGBUS, SIG_DFL);
-#endif
-}
-
-void
-pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask, CARD32 val)
-{
- unsigned long rv = 0xffffffff;
-
-#if defined(__powerpc__)
- signal(SIGBUS, buserr);
-#endif
-
- outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
- rv = inl(0xCFC);
- rv = (rv & ~mask) | val;
- outl(0xCFC, rv);
-
-#if defined(__powerpc__)
- signal(SIGBUS, SIG_DFL);
-#endif
-}
-
-CARD32
-pciByteSwap(CARD32 u)
-{
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-# if defined(__powerpc__) && defined(PowerMAX_OS)
- CARD32 tmp;
-
- __inst_stwbrx(u, &tmp, 0);
-
- return(tmp);
-
-# else /* !PowerMAX_OS */
-
- return lswapl(u);
-
-# endif /* !PowerMAX_OS */
-
-#else /* !BIG_ENDIAN */
-
- return(u);
-
-#endif
-}
-
-ADDRESS
-pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS addr)
-{
- return(addr);
-}
-
-pciConfigPtr *
-xf86scanpci(int flags)
-{
- pciConfigPtr devp;
- pciBusInfo_t *busp;
- int idx = 0, i;
- PCITAG tag;
-
- if (pci_devp[0])
- return pci_devp;
-
- pciInit();
-
-#ifdef XF86SCANPCI_WRAPPER
- XF86SCANPCI_WRAPPER(SCANPCI_INIT);
-#endif
-
- tag = pciFindFirst(0,0); /* 0 mask means match any valid device */
- /* Check if no devices, return now */
- if (tag == PCI_NOT_FOUND) {
-#ifdef XF86SCANPCI_WRAPPER
- XF86SCANPCI_WRAPPER(SCANPCI_TERM);
-#endif
- return NULL;
- }
-
-#ifdef DEBUGPCI
- ErrorF("xf86scanpci: tag = 0x%lx\n", tag);
-#endif
-#ifndef OLD_FORMAT
- xf86MsgVerb(X_INFO, 2, "PCI: PCI scan (all values are in hex)\n");
-#endif
-
- while (idx < MAX_PCI_DEVICES && tag != PCI_NOT_FOUND) {
- devp = xcalloc(1, sizeof(pciDevice));
- if (!devp) {
- xf86Msg(X_ERROR,
- "xf86scanpci: Out of memory after %d devices!!\n", idx);
- return (pciConfigPtr *)NULL;
- }
-
- /* Identify pci device by bus, dev, func, and tag */
- devp->tag = tag;
- devp->busnum = PCI_BUS_FROM_TAG(tag);
- devp->devnum = PCI_DEV_FROM_TAG(tag);
- devp->funcnum = PCI_FUNC_FROM_TAG(tag);
-
- /* Read config space for this device */
- for (i = 0; i < 17; i++) /* PCI hdr plus 1st dev spec dword */
- devp->cfgspc.dwords[i] = pciReadLong(tag, i * sizeof(CARD32));
-
- /* Some broken devices don't implement this field... */
- if (devp->pci_header_type == 0xff)
- devp->pci_header_type = 0;
-
- switch (devp->pci_header_type & 0x7f) {
- case 0:
- /* Get base address sizes for type 0 headers */
- for (i = 0; i < 7; i++)
- devp->basesize[i] =
- pciGetBaseSize(tag, i, FALSE, &devp->minBasesize);
- break;
-
- case 1:
- case 2:
- /* Allow master aborts to complete normally on secondary buses */
- if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
- break;
- pciWriteByte(tag, PCI_PCI_BRIDGE_CONTROL_REG,
- devp->pci_bridge_control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
- break;
-
- default:
- break;
- }
-
-#ifdef OLD_FORMAT
- xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
- "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
- devp->busnum, devp->devnum, devp->funcnum,
- devp->pci_vendor, devp->pci_device, devp->pci_rev_id,
- devp->pci_base_class, devp->pci_sub_class);
-#else
- xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
- " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
- devp->busnum, devp->devnum, devp->funcnum,
- devp->pci_vendor, devp->pci_device,
- devp->pci_subsys_vendor, devp->pci_subsys_card,
- devp->pci_rev_id, devp->pci_base_class,
- devp->pci_sub_class, devp->pci_prog_if,
- devp->pci_header_type);
-#endif
-
- pci_devp[idx++] = devp;
- tag = pciFindNext();
-
-#ifdef DEBUGPCI
- ErrorF("xf86scanpci: tag = pciFindNext = 0x%lx\n", tag);
-#endif
- }
-
- /* Restore modified data (in reverse order), and link buses */
- while (--idx >= 0) {
- devp = pci_devp[idx];
- switch (devp->pci_header_type & 0x7f) {
- case 0:
- if ((devp->pci_base_class != PCI_CLASS_BRIDGE) ||
- (devp->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
- break;
- pciBusInfo[devp->busnum]->bridge = devp;
- pciBusInfo[devp->busnum]->primary_bus = devp->busnum;
- break;
-
- case 1:
- case 2:
- i = PCI_SECONDARY_BUS_EXTRACT(devp->pci_pp_bus_register, devp->tag);
- if (i > devp->busnum) {
- if (pciBusInfo[i]) {
- pciBusInfo[i]->bridge = devp;
- /*
- * The back link needs to be set here, and is unlikely to
- * change.
- */
- devp->businfo = pciBusInfo[i];
- }
-#ifdef ARCH_PCI_PCI_BRIDGE
- ARCH_PCI_PCI_BRIDGE(devp);
-#endif
- }
- if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
- break;
- pciWriteByte(devp->tag, PCI_PCI_BRIDGE_CONTROL_REG,
- devp->pci_bridge_control);
- break;
-
- default:
- break;
- }
- }
-
-#ifdef XF86SCANPCI_WRAPPER
- XF86SCANPCI_WRAPPER(SCANPCI_TERM);
-#endif
-
- /*
- * Lastly, link bridges to their secondary bus, after the architecture has
- * had a chance to modify these assignments.
- */
- for (idx = 0; idx < pciNumBuses; idx++) {
- if (!(busp = pciBusInfo[idx]) || !(devp = busp->bridge))
- continue;
- devp->businfo = busp;
- }
-
-#ifndef OLD_FORMAT
- xf86MsgVerb(X_INFO, 2, "PCI: End of PCI scan\n");
-#endif
-
- return pci_devp;
-}
-
-CARD32
-pciCheckForBrokenBase(PCITAG Tag,int basereg)
-{
- pciWriteLong(Tag, PCI_MAP_REG_START + (basereg << 2), 0xffffffff);
- return pciReadLong(Tag, PCI_MAP_REG_START + (basereg << 2));
-}
-
-#if defined(INCLUDE_XF86_MAP_PCI_MEM)
-
-pointer
-xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base,
- unsigned long Size)
-{
- ADDRESS hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM,Base);
- pointer base;
- CARD32 save = 0;
-
- /*
- * If there are possible read side-effects, disable memory while
- * doing the mapping.
- */
- if (Flags & VIDMEM_READSIDEEFFECT) {
- save = pciReadLong(Tag, PCI_CMD_STAT_REG);
- pciWriteLong(Tag, PCI_CMD_STAT_REG,
- save & ~PCI_CMD_MEM_ENABLE);
- }
- base = xf86MapDomainMemory(ScreenNum, Flags, Tag, hostbase, Size);
- if (!base) {
- FatalError("xf86MapPciMem: Could not mmap PCI memory "
- "[base=0x%lx,hostbase=0x%lx,size=%lx] (%s)\n",
- Base, hostbase, Size, strerror(errno));
- }
- /*
- * If read side-effects, do whatever might be needed to prevent
- * unintended reads, then restore PCI_CMD_STAT_REG.
- */
- if (Flags & VIDMEM_READSIDEEFFECT) {
- xf86MapReadSideEffects(ScreenNum, Flags, base, Size);
- pciWriteLong(Tag, PCI_CMD_STAT_REG, save);
- }
- return((pointer)base);
-}
-
-static int
-handlePciBIOS(PCITAG Tag, int basereg,
- int (*func)(PCITAG, CARD8*, ADDRESS, pointer),
- pointer args)
-{
- CARD32 romsave = 0;
- int i;
- romBaseSource b_reg;
- ADDRESS hostbase;
- CARD8 tmp[64];
- int ret = 0;
-
- romsave = pciReadLong(Tag, PCI_MAP_ROM_REG);
-
- for (i = ROM_BASE_PRESET; i <= ROM_BASE_FIND; i++) {
- memType savebase = 0, newbase, romaddr;
-
- if (i == ROM_BASE_PRESET) {
- /* Does the driver have a preference? */
- if (basereg > ROM_BASE_PRESET && basereg <= ROM_BASE_FIND)
- b_reg = basereg;
- else
- b_reg = ++i;
- } else
- b_reg = i;
-
- if (!(newbase = getValidBIOSBase(Tag, b_reg)))
- continue; /* no valid address found */
-
- romaddr = PCIGETROM(newbase);
-
- /* if we use a mem base save it and move it out of the way */
- if (b_reg >= 0 && b_reg <= 5) {
- savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2));
- xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]"
- " for device %i:%i:%i\n", basereg,
- (int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag),
- (int)PCI_FUNC_FROM_TAG(Tag));
- pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
- (CARD32)~0);
- }
- /* Set ROM base address and enable ROM address decoding */
- pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr
- | PCI_MAP_ROM_DECODE_ENABLE);
-
- hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr));
-
- if ((xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) !=
- sizeof(tmp)) ||
- (tmp[0] != 0x55) || (tmp[1] != 0xaa) || !tmp[2] ) {
- /* Restore the base register if it was changed. */
- if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
- (CARD32) savebase);
-
- /* No BIOS found: try another address */
- continue;
- }
-
- ret = (*func)(Tag, tmp, hostbase, args);
-
- /* Restore the base register if it was changed. */
- if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
- (CARD32) savebase);
- /* Restore ROM address decoding */
- pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
-
- return ret;
- }
- /* Restore ROM address decoding */
- pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
- return 0;
-}
-
-typedef struct {
- unsigned long Offset;
- int Len;
- unsigned char *Buf;
- PciBiosType BiosType;
-} readBios, *readBiosPtr;
-
-static int
-readPciBios(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer args)
-{
- unsigned int image_length = 0;
- readBiosPtr rd = args;
- int ret;
-
- /* We found a PCI BIOS Image. Now we look for the correct type */
- while ((tmp[0] == 0x55) && (tmp[1] == 0xAA)) {
- unsigned short data_off = tmp[0x18] | (tmp[0x19] << 8);
- unsigned char data[0x18];
- unsigned char type;
-
- if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data)
- != sizeof(data)) ||
- (data[0] != 'P') ||
- (data[1] != 'C') ||
- (data[2] != 'I') ||
- (data[3] != 'R'))
- break;
- type = data[0x14];
-#ifdef PRINT_PCI
- ErrorF("data segment in BIOS: 0x%x, type: 0x%x\n", data_off, type);
-#endif
- if (type != rd->BiosType) { /* not correct image: find next one */
- unsigned char indicator = data[0x15];
- unsigned int i_length;
- if (indicator & 0x80) /* last image */
- break;
- i_length = (data[0x10] | (data[0x11] << 8)) << 9;
-#ifdef PRINT_PCI
- ErrorF("data image length: 0x%x, ind: 0x%x\n",
- image_length, indicator);
-#endif
- hostbase += i_length;
- if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp)
- != sizeof(tmp))
- break;
- continue;
- }
- /* OK, we have a PCI BIOS Image of the correct type */
-
- if (rd->BiosType == PCI_BIOS_PC)
- image_length = tmp[2] << 9;
- else
- image_length = (data[0x10] | (data[0x11] << 8)) << 9;
-#ifdef PRINT_PCI
- ErrorF("BIOS length: 0x%x\n", image_length);
-#endif
- break;
- }
-
- ret = 0;
- if (image_length) {
-
- /*
- * if no length is given return the full lenght,
- * Offset 0. Beware: Area pointed to by Buf must
- * be large enough!
- */
- if (rd->Len == 0) {
- rd->Len = image_length;
- rd->Offset = 0;
- }
- if ((rd->Offset) > (image_length)) {
- xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past "
- "end of BIOS %li > %i\n",(rd->Offset) , (image_length));
- } else {
- if ((rd->Offset + rd->Len) > (image_length)) {
- rd->Len = (image_length) - rd->Offset;
- xf86MsgVerb(X_INFO,3,"Truncating PCI BIOS Length to %i\n",rd->Len);
- }
- }
-
- /* Read BIOS */
- ret = xf86ReadDomainMemory(Tag, hostbase + rd->Offset, rd->Len, rd->Buf);
- }
-
- return ret;
-}
-
-static int
-getPciBIOSTypes(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer arg)
-{
- int n = 0;
- PciBiosType *Buf = arg;
-
- /* We found a PCI BIOS Image. Now we collect the types type */
- do {
- unsigned short data_off = tmp[0x18] | (tmp[0x19] << 8);
- unsigned char data[0x16];
- unsigned int i_length;
-
- if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data)
- != sizeof(data)) ||
- (data[0] != 'P') ||
- (data[1] != 'C') ||
- (data[2] != 'I') ||
- (data[3] != 'R'))
- break;
-
- if (data[0x14] >= PCI_BIOS_OTHER)
- *Buf++ = PCI_BIOS_OTHER;
- else
- *Buf++ = data[0x14];
-
- n++;
- if (data[0x15] & 0x80) /* last image */
- break;
-#ifdef PRINT_PCI
- ErrorF("data segment in BIOS: 0x%x, type: 0x%x\n", data_off, type);
-#endif
- i_length = (data[0x10] | (data[0x11] << 8)) << 9;
-#ifdef PRINT_PCI
- ErrorF("data image length: 0x%x, ind: 0x%x\n",
- image_length, indicator);
-#endif
- hostbase += i_length;
- if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp)
- != sizeof(tmp))
- break;
- continue;
- } while ((tmp[0] == 0x55) && (tmp[1] == 0xAA));
- return n;
-}
-
-typedef CARD32 (*ReadProcPtr)(PCITAG, int);
-typedef void (*WriteProcPtr)(PCITAG, int, CARD32);
-
-static int
-HandlePciBios(PCITAG Tag, int basereg,
- int (*func)(PCITAG, CARD8*, ADDRESS, pointer),
- pointer ptr)
-{
- int n, num;
- CARD32 Acc1, Acc2;
- PCITAG *pTag;
- int i;
-
- n = handlePciBIOS(Tag,basereg,func,ptr);
- if (n)
- return n;
-
- num = pciTestMultiDeviceCard(PCI_BUS_FROM_TAG(Tag),
- PCI_DEV_FROM_TAG(Tag),
- PCI_FUNC_FROM_TAG(Tag),&pTag);
-
- if (!num) return 0;
-
-#define PCI_ENA (PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE)
- Acc1 = pciReadLong(Tag, PCI_CMD_STAT_REG);
- pciWriteLong(Tag, PCI_CMD_STAT_REG, (Acc1 & ~PCI_ENA));
-
- for (i = 0; i < num; i++) {
- Acc2 = pciReadLong(pTag[i], PCI_CMD_STAT_REG);
- pciWriteLong(pTag[i], PCI_CMD_STAT_REG, (Acc2 | PCI_ENA));
-
- n = handlePciBIOS(pTag[i],0,func,ptr);
-
- pciWriteLong(pTag[i], PCI_CMD_STAT_REG, Acc2);
- if (n)
- break;
- }
- pciWriteLong(Tag, PCI_CMD_STAT_REG, Acc1);
- return n;
-}
-
-int
-xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
- unsigned char *Buf, int Len)
-{
- return xf86ReadPciBIOSByType(Offset, Tag, basereg, Buf, Len, PCI_BIOS_PC);
-}
-
-int
-xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag, int basereg,
- unsigned char *Buf, int Len, PciBiosType Type)
-{
-
- readBios rb;
- rb.Offset = Offset;
- rb.Len = Len;
- rb.Buf = Buf;
- rb.BiosType = Type;
-
- return HandlePciBios(Tag, basereg, readPciBios, &rb);
-}
-
-int
-xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg, PciBiosType *Buf)
-{
- return HandlePciBios(Tag, basereg, getPciBIOSTypes, (pointer) Buf);
-}
-
-#endif /* INCLUDE_XF86_MAP_PCI_MEM */
-
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
-int
-xf86GetPciDomain(PCITAG Tag)
-{
- return 0;
-}
-
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size)
-{
- return xf86MapVidMem(ScreenNum, Flags, Base, Size);
-}
-
-IOADDRESS
-xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
- IOADDRESS Base, unsigned long Size)
-{
- return Base;
-}
-
-int
-xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
-{
- int ret, length, rlength;
-
- /* Read in 64kB chunks */
- ret = 0;
- while ((length = Len) > 0) {
- if (length > 0x010000) length = 0x010000;
- rlength = xf86ReadBIOS(Base, 0, Buf, length);
- if (rlength < 0) {
- ret = rlength;
- break;
- }
- ret += rlength;
- if (rlength < length) break;
- Base += rlength;
- Buf += rlength;
- Len -= rlength;
- }
-
- return ret;
-}
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
deleted file mode 100644
index 74ca95baf..000000000
--- a/hw/xfree86/os-support/bus/Pci.h
+++ /dev/null
@@ -1,435 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.44 2003/11/07 23:57:47 dawes Exp $ */
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * This file is derived in part from the original xf86_PCI.h that included
- * following copyright message:
- *
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * This file has the private Pci definitions. The public ones are imported
- * from xf86Pci.h. Drivers should not use this file.
- */
-#ifndef _PCI_H
-#define _PCI_H 1
-
-#include "Xarch.h"
-#include "Xfuncproto.h"
-#include "xf86Pci.h"
-#include "xf86PciInfo.h"
-
-/*
- * Global Definitions
- */
-#define MAX_PCI_DEVICES 64 /* Max number of devices accomodated */
- /* by xf86scanpci */
-#if defined(sun) && defined(SVR4) && defined(sparc)
-# define MAX_PCI_BUSES 4096 /* Max number of PCI buses */
-#elif defined(__alpha__) && defined (linux)
-# define MAX_PCI_DOMAINS 512
-# define PCI_DOM_MASK 0x01fful
-# define MAX_PCI_BUSES (MAX_PCI_DOMAINS*256) /* 256 per domain */
-#else
-# define MAX_PCI_BUSES 256 /* Max number of PCI buses */
-#endif
-
-#define DEVID(vendor, device) \
- ((CARD32)((PCI_##device << 16) | PCI_##vendor))
-
-#ifndef PCI_DOM_MASK
-# define PCI_DOM_MASK 0x0ffu
-#endif
-#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
-
-/*
- * "b" contains an optional domain number.
- */
-#define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \
- (((d) & 0x00001fu) << 11) | \
- (((f) & 0x000007u) << 8))
-
-#define PCI_MAKE_BUS(d,b) ((((d) & (PCI_DOM_MASK)) << 8) | ((b) & 0xffu))
-
-#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK))
-#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK))
-#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11)
-#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8)
-
-#define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00u) >> 8)
-#define PCI_BDEV_FROM_TAG(tag) ((tag) & 0x00fff800u)
-
-#define PCI_DOM_FROM_BUS(bus) (((bus) >> 8) & (PCI_DOM_MASK))
-#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
-#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
-
-/*
- * Macros for bus numbers found in P2P headers.
- */
-#define PCI_PRIMARY_BUS_EXTRACT(x, tag) \
- ((((x) & PCI_PRIMARY_BUS_MASK ) >> 0) | (PCI_DOM_FROM_TAG(tag) << 8))
-#define PCI_SECONDARY_BUS_EXTRACT(x, tag) \
- ((((x) & PCI_SECONDARY_BUS_MASK ) >> 8) | (PCI_DOM_FROM_TAG(tag) << 8))
-#define PCI_SUBORDINATE_BUS_EXTRACT(x, tag) \
- ((((x) & PCI_SUBORDINATE_BUS_MASK) >> 16) | (PCI_DOM_FROM_TAG(tag) << 8))
-
-#define PCI_PRIMARY_BUS_INSERT(x, y) \
- (((x) & ~PCI_PRIMARY_BUS_MASK ) | (((y) & 0xffu) << 0))
-#define PCI_SECONDARY_BUS_INSERT(x, y) \
- (((x) & ~PCI_SECONDARY_BUS_MASK ) | (((y) & 0xffu) << 8))
-#define PCI_SUBORDINATE_BUS_INSERT(x, y) \
- (((x) & ~PCI_SUBORDINATE_BUS_MASK) | (((y) & 0xffu) << 16))
-
-/* Ditto for CardBus bridges */
-#define PCI_CB_PRIMARY_BUS_EXTRACT(x, tag) \
- PCI_PRIMARY_BUS_EXTRACT(x, tag)
-#define PCI_CB_CARDBUS_BUS_EXTRACT(x, tag) \
- PCI_SECONDARY_BUS_EXTRACT(x, tag)
-#define PCI_CB_SUBORDINATE_BUS_EXTRACT(x, tag) \
- PCI_SUBORDINATE_BUS_EXTRACT(x, tag)
-
-#define PCI_CB_PRIMARY_BUS_INSERT(x, tag) \
- PCI_PRIMARY_BUS_INSERT(x, tag)
-#define PCI_CB_CARDBUS_BUS_INSERT(x, tag) \
- PCI_SECONDARY_BUS_INSERT(x, tag)
-#define PCI_CB_SUBORDINATE_BUS_INSERT(x, tag) \
- PCI_SUBORDINATE_BUS_INSERT(x, tag)
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
- ((val >> 8) & 0x0000ff00) | \
- ((val << 8) & 0x00ff0000) | \
- ((val << 24) & 0xff000000))
-#else
-#define PCI_CPU(val) (val)
-#endif
-
-/*
- * Debug Macros/Definitions
- */
-/* #define DEBUGPCI 2 */ /* Disable/enable trace in PCI code */
-
-#if defined(DEBUGPCI)
-
-# define PCITRACE(lvl,printfargs) \
- if (lvl > xf86Verbose) { \
- ErrorF printfargs; \
- }
-
-#else /* !defined(DEBUGPCI) */
-
-# define PCITRACE(lvl,printfargs)
-
-#endif /* !defined(DEBUGPCI) */
-
-/*
- * PCI Config mechanism definitions
- */
-#define PCI_EN 0x80000000
-
-#define PCI_CFGMECH1_ADDRESS_REG 0xCF8
-#define PCI_CFGMECH1_DATA_REG 0xCFC
-
-#define PCI_CFGMECH1_MAXDEV 32
-
-/*
- * Select architecture specific PCI init function
- */
-#if defined(__alpha__)
-# if defined(linux)
-# define ARCH_PCI_INIT axpPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# elif defined(__FreeBSD__) || defined(__OpenBSD__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(__NetBSD__)
-# define ARCH_PCI_INIT netbsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__arm__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__hppa__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__ia64__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(FreeBSD)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-# define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper
-#elif defined(__i386__)
-# define ARCH_PCI_INIT ix86PciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# if defined(linux)
-# define ARCH_PCI_OS_INIT linuxPciInit
-# endif
-#elif defined(__mc68000__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__mips__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__powerpc__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */
-# elif defined(__OpenBSD__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(__NetBSD__)
-# define ARCH_PCI_INIT netbsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(PowerMAX_OS) /* This port is broken */
-# define ARCH_PCI_INIT ppcPciInit
-# else
-# define ARCH_PCI_INIT ppcPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__s390__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__sh__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-#elif defined(__sparc__)
-# if defined(linux)
-# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# elif defined(sun)
-# define ARCH_PCI_INIT sparcPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# endif
-# if !defined(__FreeBSD__)
-# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
-# endif
-#elif defined(__AMD64__)
-# if defined(__FreeBSD__)
-# define ARCH_PCI_INIT freebsdPciInit
-# else
-# define ARCH_PCI_INIT ix86PciInit
-# endif
-# define INCLUDE_XF86_MAP_PCI_MEM
-# define INCLUDE_XF86_NO_DOMAIN
-# if defined(linux)
-# define ARCH_PCI_OS_INIT linuxPciInit
-# endif
-#endif
-
-#ifndef ARCH_PCI_INIT
-#error No PCI support available for this architecture/OS combination
-#endif
-
-extern void ARCH_PCI_INIT(void);
-#if defined(ARCH_PCI_OS_INIT)
-extern void ARCH_PCI_OS_INIT(void);
-#endif
-
-#if defined(ARCH_PCI_PCI_BRIDGE)
-extern void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI);
-#endif
-
-#if defined(XF86SCANPCI_WRAPPER)
-typedef enum {
- SCANPCI_INIT,
- SCANPCI_TERM
-} scanpciWrapperOpt;
-extern void XF86SCANPCI_WRAPPER(scanpciWrapperOpt flags);
-#endif
-
-/*
- * Table of functions used to access a specific PCI bus domain
- * (e.g. a primary PCI bus and all of its secondaries)
- */
-typedef struct pci_bus_funcs {
- CARD32 (*pciReadLong)(PCITAG, int);
- void (*pciWriteLong)(PCITAG, int, CARD32);
- void (*pciSetBitsLong)(PCITAG, int, CARD32, CARD32);
- ADDRESS (*pciAddrHostToBus)(PCITAG, PciAddrType, ADDRESS);
- ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS);
- /*
- * The next three are optional. If NULL, the corresponding function is
- * to be performed generically.
- */
- CARD16 (*pciControlBridge)(int, CARD16, CARD16);
- void (*pciGetBridgeBuses)(int, int *, int *, int *);
- /* Use pointer's to avoid #include recursion */
- void (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *);
-} pciBusFuncs_t, *pciBusFuncs_p;
-
-/*
- * pciBusInfo_t - One structure per defined PCI bus
- */
-typedef struct pci_bus_info {
- unsigned char configMech; /* PCI config type to use */
- unsigned char numDevices; /* Range of valid devnums */
- unsigned char secondary; /* Boolean: bus is a secondary */
- int primary_bus; /* Parent bus */
-#ifdef PowerMAX_OS
- unsigned long ppc_io_base; /* PowerPC I/O spc membase */
- unsigned long ppc_io_size; /* PowerPC I/O spc size */
-#endif
- pciBusFuncs_p funcs; /* PCI access functions */
- void *pciBusPriv; /* Implementation private data */
- pciConfigPtr bridge; /* bridge that opens this bus */
-} pciBusInfo_t;
-
-#define HOST_NO_BUS ((pciBusInfo_t *)(-1))
-
-/* configMech values */
-#define PCI_CFG_MECH_UNKNOWN 0 /* Not yet known */
-#define PCI_CFG_MECH_1 1 /* Most machines */
-#define PCI_CFG_MECH_2 2 /* Older PC's */
-#define PCI_CFG_MECH_OTHER 3 /* Something else */
-
-/* Generic PCI service functions and helpers */
-PCITAG pciGenFindFirst(void);
-PCITAG pciGenFindNext(void);
-CARD32 pciCfgMech1Read(PCITAG tag, int offset);
-void pciCfgMech1Write(PCITAG tag, int offset, CARD32 val);
-void pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask,
- CARD32 val);
-CARD32 pciByteSwap(CARD32);
-Bool pciMfDev(int, int);
-ADDRESS pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS);
-
-extern PCITAG (*pciFindFirstFP)(void);
-extern PCITAG (*pciFindNextFP)(void);
-
-extern CARD32 pciDevid;
-extern CARD32 pciDevidMask;
-
-extern int pciMaxBusNum;
-
-extern int pciBusNum;
-extern int pciDevNum;
-extern int pciFuncNum;
-extern PCITAG pciDeviceTag;
-
-extern pciBusInfo_t *pciBusInfo[];
-
-#endif /* _PCI_H */
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
deleted file mode 100644
index 57262efa2..000000000
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * SBUS and OpenPROM access functions.
- *
- * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.4 2003/10/02 13:30:06 eich Exp $ */
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#ifdef sun
-#include <sys/utsname.h>
-#endif
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include "xf86sbusBus.h"
-#include "xf86Sbus.h"
-
-int promRootNode;
-
-static int promFd = -1;
-static int promCurrentNode;
-static int promOpenCount = 0;
-static int promP1275 = -1;
-#define MAX_PROP 128
-#define MAX_VAL (4096-128-4)
-static struct openpromio *promOpio;
-
-sbusDevicePtr *xf86SbusInfo = NULL;
-
-struct sbus_devtable sbusDeviceTable[] = {
- { SBUS_DEVICE_BW2, FBTYPE_SUN2BW, "bwtwo", "Sun Monochrome (bwtwo)" },
- { SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, "cgtwo", "Sun Color2 (cgtwo)" },
- { SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, "cgthree", "Sun Color3 (cgthree)" },
- { SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, "cgfour", "Sun Color4 (cgfour)" },
- { SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, "cgsix", "Sun GX" },
- { SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, "cgeight", "Sun CG8/RasterOps" },
- { SBUS_DEVICE_CG12, FBTYPE_SUNGP3, "cgtwelve", "Sun GS (cgtwelve)" },
- { SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, "cgfourteen", "Sun SX" },
- { SBUS_DEVICE_GT, FBTYPE_SUNGT, "gt", "Sun Graphics Tower" },
- { SBUS_DEVICE_MGX, -1, "mgx", "Quantum 3D MGXplus" },
- { SBUS_DEVICE_LEO, FBTYPE_SUNLEO, "leo", "Sun ZX or Turbo ZX" },
- { SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "Sun TCX" },
- { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "Sun FFB" },
- { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "Sun Elite3D" },
- { 0, 0, NULL }
-};
-
-int
-promGetSibling(int node)
-{
- promOpio->oprom_size = sizeof(int);
-
- if (node == -1) return 0;
- *(int *)promOpio->oprom_array = node;
- if (ioctl(promFd, OPROMNEXT, promOpio) < 0)
- return 0;
- promCurrentNode = *(int *)promOpio->oprom_array;
- return *(int *)promOpio->oprom_array;
-}
-
-int
-promGetChild(int node)
-{
- promOpio->oprom_size = sizeof(int);
-
- if (!node || node == -1) return 0;
- *(int *)promOpio->oprom_array = node;
- if (ioctl(promFd, OPROMCHILD, promOpio) < 0)
- return 0;
- promCurrentNode = *(int *)promOpio->oprom_array;
- return *(int *)promOpio->oprom_array;
-}
-
-char *
-promGetProperty(const char *prop, int *lenp)
-{
- promOpio->oprom_size = MAX_VAL;
-
- strcpy(promOpio->oprom_array, prop);
- if (ioctl(promFd, OPROMGETPROP, promOpio) < 0)
- return 0;
- if (lenp) *lenp = promOpio->oprom_size;
- return promOpio->oprom_array;
-}
-
-int
-promGetBool(const char *prop)
-{
- promOpio->oprom_size = 0;
-
- *(int *)promOpio->oprom_array = 0;
- for (;;) {
- promOpio->oprom_size = MAX_PROP;
- if (ioctl(promFd, OPROMNXTPROP, promOpio) < 0)
- return 0;
- if (!promOpio->oprom_size)
- return 0;
- if (!strcmp(promOpio->oprom_array, prop))
- return 1;
- }
-}
-
-#define PROM_NODE_SIBLING 0x01
-#define PROM_NODE_PREF 0x02
-#define PROM_NODE_SBUS 0x04
-#define PROM_NODE_EBUS 0x08
-#define PROM_NODE_PCI 0x10
-
-static int
-promSetNode(sbusPromNodePtr pnode)
-{
- int node;
-
- if (!pnode->node || pnode->node == -1)
- return -1;
- if (pnode->cookie[0] & PROM_NODE_SIBLING)
- node = promGetSibling(pnode->cookie[1]);
- else
- node = promGetChild(pnode->cookie[1]);
- if (pnode->node != node)
- return -1;
- return 0;
-}
-
-static void
-promIsP1275(void)
-{
-#ifdef linux
- FILE *f;
- char buffer[1024];
-
- if (promP1275 != -1)
- return;
- promP1275 = 0;
- f = fopen("/proc/cpuinfo","r");
- if (!f) return;
- while (fgets(buffer, 1024, f) != NULL)
- if (!strncmp (buffer, "type", 4) && strstr (buffer, "sun4u")) {
- promP1275 = 1;
- break;
- }
- fclose(f);
-#elif defined(sun)
- struct utsname buffer;
-
- if ((uname(&buffer) == 0) && !strcmp(buffer.machine, "sun4u"))
- promP1275 = TRUE;
- else
- promP1275 = FALSE;
-#elif defined(__FreeBSD__)
- promP1275 = TRUE;
-#else
-#error Missing promIsP1275() function for this OS
-#endif
-}
-
-void
-sparcPromClose(void)
-{
- if (promOpenCount > 1) {
- promOpenCount--;
- return;
- }
- if (promFd != -1) {
- close(promFd);
- promFd = -1;
- }
- if (promOpio) {
- xfree(promOpio);
- promOpio = NULL;
- }
- promOpenCount = 0;
-}
-
-int
-sparcPromInit(void)
-{
- if (promOpenCount) {
- promOpenCount++;
- return 0;
- }
- promFd = open("/dev/openprom", O_RDONLY, 0);
- if (promFd == -1)
- return -1;
- promOpio = (struct openpromio *)xalloc(4096);
- if (!promOpio) {
- sparcPromClose();
- return -1;
- }
- promRootNode = promGetSibling(0);
- if (!promRootNode) {
- sparcPromClose();
- return -1;
- }
- promIsP1275();
- promOpenCount++;
-
- return 0;
-}
-
-char *
-sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
-{
- if (promSetNode(pnode))
- return NULL;
- return promGetProperty(prop, lenp);
-}
-
-int
-sparcPromGetBool(sbusPromNodePtr pnode, const char *prop)
-{
- if (promSetNode(pnode))
- return 0;
- return promGetBool(prop);
-}
-
-static void
-promWalkAssignNodes(int node, int oldnode, int flags, sbusDevicePtr *devicePtrs)
-{
- int nextnode;
- int len, sbus = flags & PROM_NODE_SBUS;
- char *prop;
- int devId, i, j;
- sbusPromNode pNode, pNode2;
-
- prop = promGetProperty("device_type", &len);
- if (prop && (len > 0)) do {
- if (!strcmp(prop, "display")) {
- prop = promGetProperty("name", &len);
- if (!prop || len <= 0)
- break;
- while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',')
- prop++;
- for (i = 0; sbusDeviceTable[i].devId; i++)
- if (!strcmp(prop, sbusDeviceTable[i].promName))
- break;
- devId = sbusDeviceTable[i].devId;
- if (!devId)
- break;
- if (!sbus) {
- if (devId == SBUS_DEVICE_FFB) {
- /*
- * All /SUNW,ffb outside of SBUS tree come before all
- * /SUNW,afb outside of SBUS tree in Linux.
- */
- if (!strcmp(prop, "afb"))
- flags |= PROM_NODE_PREF;
- } else if (devId != SBUS_DEVICE_CG14)
- break;
- }
- for (i = 0; i < 32; i++) {
- if (!devicePtrs[i] || devicePtrs[i]->devId != devId)
- continue;
- if (devicePtrs[i]->node.node) {
- if ((devicePtrs[i]->node.cookie[0] & ~PROM_NODE_SIBLING) <=
- (flags & ~PROM_NODE_SIBLING))
- continue;
- for (j = i + 1, pNode = devicePtrs[i]->node; j < 32; j++) {
- if (!devicePtrs[j] || devicePtrs[j]->devId != devId)
- continue;
- pNode2 = devicePtrs[j]->node;
- devicePtrs[j]->node = pNode;
- pNode = pNode2;
- }
- }
- devicePtrs[i]->node.node = node;
- devicePtrs[i]->node.cookie[0] = flags;
- devicePtrs[i]->node.cookie[1] = oldnode;
- break;
- }
- break;
- }
- } while (0);
-
- prop = promGetProperty("name", &len);
- if (prop && len > 0) {
- if (!strcmp(prop, "sbus") || !strcmp(prop, "sbi"))
- sbus = PROM_NODE_SBUS;
- }
-
- nextnode = promGetChild(node);
- if (nextnode)
- promWalkAssignNodes(nextnode, node, sbus, devicePtrs);
-
- nextnode = promGetSibling(node);
- if (nextnode)
- promWalkAssignNodes(nextnode, node, PROM_NODE_SIBLING | sbus, devicePtrs);
-}
-
-void
-sparcPromAssignNodes(void)
-{
- sbusDevicePtr psdp, *psdpp;
- int n, holes = 0, i, j;
- FILE *f;
- sbusDevicePtr devicePtrs[32];
-
- (void)memset(devicePtrs, 0, sizeof(devicePtrs));
- for (psdpp = xf86SbusInfo, n = 0; (psdp = *psdpp); psdpp++, n++) {
- if (psdp->fbNum != n)
- holes = 1;
- devicePtrs[psdp->fbNum] = psdp;
- }
- if (holes && (f = fopen("/proc/fb", "r")) != NULL) {
- /* We could not open one of fb devices, check /proc/fb to see what
- * were the types of the cards missed. */
- char buffer[64];
- int fbNum, devId;
- static struct {
- int devId;
- char *prefix;
- } procFbPrefixes[] = {
- { SBUS_DEVICE_BW2, "BWtwo" },
- { SBUS_DEVICE_CG14, "CGfourteen" },
- { SBUS_DEVICE_CG6, "CGsix" },
- { SBUS_DEVICE_CG3, "CGthree" },
- { SBUS_DEVICE_FFB, "Creator" },
- { SBUS_DEVICE_FFB, "Elite 3D" },
- { SBUS_DEVICE_LEO, "Leo" },
- { SBUS_DEVICE_TCX, "TCX" },
- { 0, NULL },
- };
-
- while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) {
- for (i = 0; procFbPrefixes[i].devId; i++)
- if (! strncmp(procFbPrefixes[i].prefix, buffer,
- strlen(procFbPrefixes[i].prefix)))
- break;
- devId = procFbPrefixes[i].devId;
- if (! devId) continue;
- if (devicePtrs[fbNum]) {
- if (devicePtrs[fbNum]->devId != devId)
- xf86ErrorF("Inconsistent /proc/fb with FBIOGATTR\n");
- } else if (!devicePtrs[fbNum]) {
- devicePtrs[fbNum] = psdp = xnfcalloc(sizeof (sbusDevice), 1);
- psdp->devId = devId;
- psdp->fbNum = fbNum;
- psdp->fd = -2;
- }
- }
- fclose(f);
- }
- promGetSibling(0);
- promWalkAssignNodes(promRootNode, 0, PROM_NODE_PREF, devicePtrs);
- for (i = 0, j = 0; i < 32; i++)
- if (devicePtrs[i] && devicePtrs[i]->fbNum == -1)
- j++;
- xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (n + j + 1));
- for (i = 0, psdpp = xf86SbusInfo; i < 32; i++)
- if (devicePtrs[i]) {
- if (devicePtrs[i]->fbNum == -1) {
- memmove(psdpp + 1, psdpp, sizeof(psdpp) * (n + 1));
- *psdpp = devicePtrs[i];
- } else
- n--;
- }
-}
-
-static char *
-promGetReg(int type)
-{
- char *prop;
- int len;
- static char regstr[40];
-
- regstr[0] = 0;
- prop = promGetProperty("reg", &len);
- if (prop && len >= 4) {
- unsigned int *reg = (unsigned int *)prop;
- if (!promP1275 || (type == PROM_NODE_SBUS) || (type == PROM_NODE_EBUS))
- sprintf (regstr, "@%x,%x", reg[0], reg[1]);
- else if (type == PROM_NODE_PCI) {
- if ((reg[0] >> 8) & 7)
- sprintf (regstr, "@%x,%x", (reg[0] >> 11) & 0x1f, (reg[0] >> 8) & 7);
- else
- sprintf (regstr, "@%x", (reg[0] >> 11) & 0x1f);
- } else if (len == 4)
- sprintf (regstr, "@%x", reg[0]);
- else {
- unsigned int regs[2];
-
- /* Things get more complicated on UPA. If upa-portid exists,
- then address is @upa-portid,second-int-in-reg, otherwise
- it is @first-int-in-reg/16,second-int-in-reg (well, probably
- upa-portid always exists, but just to be safe). */
- memcpy (regs, reg, sizeof(regs));
- prop = promGetProperty("upa-portid", &len);
- if (prop && len == 4) {
- reg = (unsigned int *)prop;
- sprintf (regstr, "@%x,%x", reg[0], regs[1]);
- } else
- sprintf (regstr, "@%x,%x", regs[0] >> 4, regs[1]);
- }
- }
- return regstr;
-}
-
-static int
-promWalkNode2Pathname(char *path, int parent, int node, int searchNode, int type)
-{
- int nextnode;
- int len, ntype = type;
- char *prop, *p;
-
- prop = promGetProperty("name", &len);
- *path = '/';
- if (!prop || len <= 0)
- return 0;
- if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
- ntype = PROM_NODE_SBUS;
- else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
- ntype = PROM_NODE_EBUS;
- else if (!strcmp(prop, "pci") && !type)
- ntype = PROM_NODE_PCI;
- strcpy (path + 1, prop);
- p = promGetReg(type);
- if (*p)
- strcat (path, p);
- if (node == searchNode)
- return 1;
- nextnode = promGetChild(node);
- if (nextnode &&
- promWalkNode2Pathname(strchr(path, 0), node, nextnode, searchNode, ntype))
- return 1;
- nextnode = promGetSibling(node);
- if (nextnode &&
- promWalkNode2Pathname(path, parent, nextnode, searchNode, type))
- return 1;
- return 0;
-}
-
-char *
-sparcPromNode2Pathname(sbusPromNodePtr pnode)
-{
- char *ret;
-
- if (!pnode->node) return NULL;
- ret = xalloc(4096);
- if (!ret) return NULL;
- if (promWalkNode2Pathname(ret, promRootNode, promGetChild(promRootNode), pnode->node, 0))
- return ret;
- xfree(ret);
- return NULL;
-}
-
-static int
-promWalkPathname2Node(char *name, char *regstr, int parent, int type)
-{
- int len, node, ret;
- char *prop, *p;
-
- for (;;) {
- prop = promGetProperty("name", &len);
- if (!prop || len <= 0)
- return 0;
- if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
- type = PROM_NODE_SBUS;
- else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
- type = PROM_NODE_EBUS;
- else if (!strcmp(prop, "pci") && !type)
- type = PROM_NODE_PCI;
- for (node = promGetChild(parent); node; node = promGetSibling(node)) {
- prop = promGetProperty("name", &len);
- if (!prop || len <= 0)
- continue;
- if (*name && strcmp(name, prop))
- continue;
- if (*regstr) {
- p = promGetReg(type);
- if (! *p || strcmp(p + 1, regstr))
- continue;
- }
- break;
- }
- if (!node) {
- for (node = promGetChild(parent); node; node = promGetSibling(node)) {
- ret = promWalkPathname2Node(name, regstr, node, type);
- if (ret) return ret;
- }
- return 0;
- }
- name = strchr(regstr, 0) + 1;
- if (! *name)
- return node;
- p = strchr(name, '/');
- if (p)
- *p = 0;
- else
- p = strchr(name, 0);
- regstr = strchr(name, '@');
- if (regstr)
- *regstr++ = 0;
- else
- regstr = p;
- if (name == regstr)
- return 0;
- parent = node;
- }
-}
-
-int
-sparcPromPathname2Node(const char *pathName)
-{
- int i;
- char *name, *regstr, *p;
-
- i = strlen(pathName);
- name = xalloc(i + 2);
- if (! name) return 0;
- strcpy (name, pathName);
- name [i + 1] = 0;
- if (name[0] != '/')
- return 0;
- p = strchr(name + 1, '/');
- if (p)
- *p = 0;
- else
- p = strchr(name, 0);
- regstr = strchr(name, '@');
- if (regstr)
- *regstr++ = 0;
- else
- regstr = p;
- if (name + 1 == regstr)
- return 0;
- promGetSibling(0);
- i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0);
- xfree(name);
- return i;
-}
-
-pointer
-xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
-{
- pointer ret;
- unsigned long pagemask = xf86getpagesize() - 1;
- unsigned long off = offset & ~pagemask;
- unsigned long len = ((offset + size + pagemask) & ~pagemask) - off;
-
- if (psdp->fd == -1) {
- psdp->fd = open(psdp->device, O_RDWR);
- if (psdp->fd == -1)
- return NULL;
- } else if (psdp->fd < 0)
- return NULL;
-
- ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE,
- psdp->fd, off);
- if (ret == (pointer) -1) {
- ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
- psdp->fd, off);
- }
- if (ret == (pointer) -1)
- return NULL;
-
- return (char *)ret + (offset - off);
-}
-
-void
-xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
-{
- unsigned long mask = xf86getpagesize() - 1;
- unsigned long base = (unsigned long)addr & ~mask;
- unsigned long len = (((unsigned long)addr + size + mask) & ~mask) - base;
-
- munmap ((pointer)base, len);
-}
-
-/* Tell OS that we are driving the HW cursor ourselves. */
-void
-xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
-{
- struct fbcursor fbcursor;
- unsigned char zeros[8];
-
- memset(&fbcursor, 0, sizeof(fbcursor));
- memset(&zeros, 0, sizeof(zeros));
- fbcursor.cmap.count = 2;
- fbcursor.cmap.red = zeros;
- fbcursor.cmap.green = zeros;
- fbcursor.cmap.blue = zeros;
- fbcursor.image = (char *)zeros;
- fbcursor.mask = (char *)zeros;
- fbcursor.size.x = 32;
- fbcursor.size.y = 1;
- fbcursor.set = FB_CUR_SETALL;
- ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
-}
-
-/* Set HW cursor colormap. */
-void
-xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg)
-{
- struct fbcursor fbcursor;
- unsigned char red[2], green[2], blue[2];
-
- memset(&fbcursor, 0, sizeof(fbcursor));
- red[0] = bg >> 16;
- green[0] = bg >> 8;
- blue[0] = bg;
- red[1] = fg >> 16;
- green[1] = fg >> 8;
- blue[1] = fg;
- fbcursor.cmap.count = 2;
- fbcursor.cmap.red = red;
- fbcursor.cmap.green = green;
- fbcursor.cmap.blue = blue;
- fbcursor.set = FB_CUR_SETCMAP;
- ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
-}
diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c
deleted file mode 100644
index 04ff8b956..000000000
--- a/hw/xfree86/os-support/bus/axpPci.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/axpPci.c,v 1.15 2002/12/12 04:12:02 dawes Exp $ */
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-#include <asm/unistd.h>
-#include "../linux/lnx.h" /* for _iobase */
-
-/*
- * Alpha/Linux platform specific PCI access functions
- */
-static CARD32 axpPciCfgRead(PCITAG tag, int off);
-static void axpPciCfgWrite(PCITAG, int off, CARD32 val);
-static void axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
-
-static pciBusFuncs_t axpFuncs0 = {
-/* pciReadLong */ axpPciCfgRead,
-/* pciWriteLong */ axpPciCfgWrite,
-/* pciSetBitsLong */ axpPciCfgSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-typedef struct _axpDomainRec {
- int domain, hose;
- int root_bus;
- unsigned long dense_io, sparse_io;
- unsigned long dense_mem, sparse_mem;
- IOADDRESS mapped_io;
-} axpDomainRec, *axpDomainPtr;
-
-#define MAX_DOMAINS (MAX_PCI_BUSES / 256)
-static axpDomainPtr xf86DomainInfo[MAX_DOMAINS] = { NULL, };
-static int pciNumDomains = 0;
-
-/*
- * For debug, domain assignment can start downward from a fixed base
- * (instead of up from 0) by defining FORCE_HIGH_DOMAINS. This allows
- * debug of large domain numbers and sparse domain numbering on systems
- * which don't have as many hoses.
- */
-#if 0
-# define FORCE_HIGH_DOMAINS MAX_DOMAINS /* assign domains downward from here */
-#endif
-
-/*
- * If FORCE_HIGH_DOMAINS is set, make sure it's not larger than the
- * max domain
- */
-#if defined(FORCE_HIGH_DOMAINS) && (FORCE_HIGH_DOMAINS > MAX_DOMAINS)
-# undef FORCE_HIGH_DOMAINS
-# define FORCE_HIGH_DOMAINS MAX_DOMAINS
-#endif
-
-static int
-axpSetupDomains(void)
-{
- axpDomainRec axpDomain;
- int numDomains = 0;
- int hose;
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
-
-#ifdef FORCE_HIGH_DOMAINS
- xf86Msg(X_WARNING,
- "DEBUG OPTION FORCE_HIGH_DOMAINS in use - DRI will *NOT* work\n");
- numDomains = FORCE_HIGH_DOMAINS;
-#endif
-
- /*
- * Since each hose has a different address space, hoses are a perfect
- * overlay for domains, so set up one domain for each hose present
- * in the system. We have to loop through all possible hoses because
- * some systems allow sparse I/O controllers.
- */
- for(hose = 0; hose < MAX_DOMAINS; hose++) {
- axpDomain.root_bus = _iobase(IOBASE_ROOT_BUS, hose, -1, -1);
- if (axpDomain.root_bus < 0) continue;
-
- axpDomain.hose = hose;
-
-#ifndef FORCE_HIGH_DOMAINS
-
- axpDomain.domain = axpDomain.hose = hose;
- numDomains = axpDomain.domain + 1;
-
-#else /* FORCE_HIGH_DOMAINS */
-
- axpDomain.domain = numDomains - hose - 1;
-
- xf86Msg(X_WARNING,
- "FORCE_HIGH_DOMAINS - assigned hose %d to domain %d\n",
- axpDomain.hose, axpDomain.domain);
-
-#endif /* FORCE_HIGH_DOMAINS */
-
- axpDomain.dense_io = _iobase(IOBASE_DENSE_IO, hose, -1, -1);
- axpDomain.sparse_io = _iobase(IOBASE_SPARSE_IO, hose, -1, -1);
- axpDomain.mapped_io = 0;
- axpDomain.dense_mem = _iobase(IOBASE_DENSE_MEM, hose, -1, -1);
- axpDomain.sparse_mem = _iobase(IOBASE_SPARSE_MEM, hose, -1, -1);
-
- xf86DomainInfo[axpDomain.domain] = xnfalloc(sizeof(axpDomainRec));
- *(xf86DomainInfo[axpDomain.domain]) = axpDomain;
-
- /*
- * For now, only allow a single domain (hose) on sparse i/o systems.
- *
- * Allowing multiple domains on sparse systems would require:
- * 1) either
- * a) revamping the sparse video mapping code to allow
- * for multiple unrelated address regions
- * -- OR --
- * b) implementing sparse mapping directly in
- * xf86MapDomainMemory
- * 2) revaming read/write sparse routines to correctly handle
- * the solution to 1)
- * 3) implementing a sparse I/O system (mapping, inX/outX)
- * independent of glibc, since the glibc version only
- * supports hose 0
- */
- if (axpDomain.sparse_io) {
- if (_iobase(IOBASE_ROOT_BUS, hose + 1, -1, -1) >= 0) {
- /*
- * It's a sparse i/o system with (at least) one more hose,
- * show a message indicating that video is constrained to
- * hose 0
- */
- xf86Msg(X_INFO,
- "Sparse I/O system - constraining video to hose 0\n");
- }
- break;
- }
- }
-
-#else /* INCLUDE_XF86_NO_DOMAIN */
-
- /*
- * domain support is not included, so just set up a single domain (0)
- * to represent the first hose so that axpPciInit will still have
- * be able to set up the root bus
- */
- xf86DomainInfo[0] = xnfalloc(sizeof(axpDomainRec));
- *(xf86DomainInfo[0]) = axpDomain;
- numDomains = 1;
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
-
- return numDomains;
-}
-
-void
-axpPciInit()
-{
- axpDomainPtr pDomain;
- int domain, bus;
-
- pciNumDomains = axpSetupDomains();
-
- for(domain = 0; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain])) continue;
-
- /*
- * Since any bridged buses will be behind a probed pci-pci bridge,
- * only set up the root bus for each domain (hose) and the bridged
- * buses will be set up as they are found.
- */
- bus = PCI_MAKE_BUS(domain, 0);
- pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t));
- (void)memset(pciBusInfo[bus], 0, sizeof(pciBusInfo_t));
-
- pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER;
- pciBusInfo[bus]->numDevices = 32;
- pciBusInfo[bus]->funcs = &axpFuncs0;
- pciBusInfo[bus]->pciBusPriv = pDomain;
-
- pciNumBuses = bus + 1;
- }
-
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
-}
-
-/*
- * Alpha/Linux PCI configuration space access routines
- */
-static int
-axpPciBusFromTag(PCITAG tag)
-{
- pciBusInfo_t *pBusInfo;
- axpDomainPtr pDomain;
- int bus, dfn;
-
- bus = PCI_BUS_FROM_TAG(tag);
- if ((bus >= pciNumBuses)
- || !(pBusInfo = pciBusInfo[bus])
- || !(pDomain = pBusInfo->pciBusPriv)
- || (pDomain->domain != PCI_DOM_FROM_TAG(tag))) return -1;
-
- bus = PCI_BUS_NO_DOMAIN(bus) + pDomain->root_bus;
- dfn = PCI_DFN_FROM_TAG(tag);
- if (_iobase(IOBASE_HOSE, -1, bus, dfn) != pDomain->hose) return -1;
-
- return bus;
-}
-
-static CARD32
-axpPciCfgRead(PCITAG tag, int off)
-{
- int bus, dfn;
- CARD32 val = 0xffffffff;
-
- if ((bus = axpPciBusFromTag(tag)) >= 0) {
- dfn = PCI_DFN_FROM_TAG(tag);
-
- syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
- }
- return(val);
-}
-
-static void
-axpPciCfgWrite(PCITAG tag, int off, CARD32 val)
-{
- int bus, dfn;
-
- if ((bus = axpPciBusFromTag(tag)) >= 0) {
- dfn = PCI_DFN_FROM_TAG(tag);
- syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
- }
-}
-
-static void
-axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- int bus, dfn;
- CARD32 val = 0xffffffff;
-
- if ((bus = axpPciBusFromTag(tag)) >= 0) {
- dfn = PCI_DFN_FROM_TAG(tag);
-
- syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
- val = (val & ~mask) | (bits & mask);
- syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
- }
-}
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
-
-/*
- * Alpha/Linux addressing domain support
- */
-
-int
-xf86GetPciDomain(PCITAG Tag)
-{
- return PCI_DOM_FROM_TAG(Tag);
-}
-
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size)
-{
- axpDomainPtr pDomain;
- int domain = PCI_DOM_FROM_TAG(Tag);
-
- if ((domain < 0) || (domain >= pciNumDomains) ||
- !(pDomain = xf86DomainInfo[domain]))
- FatalError("%s called with invalid parameters\n", __FUNCTION__);
-
- /*
- * xf86MapVidMem already does what we need, but remember to subtract
- * _bus_base() (the physical dense memory root of hose 0) since
- * xf86MapVidMem is expecting an offset relative to _bus_base() rather
- * than an actual physical address.
- */
- return xf86MapVidMem(ScreenNum, Flags,
- pDomain->dense_mem + Base - _bus_base(), Size);
-}
-
-IOADDRESS
-xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
- IOADDRESS Base, unsigned long Size)
-{
- axpDomainPtr pDomain;
- int domain = PCI_DOM_FROM_TAG(Tag);
-
- if ((domain < 0) || (domain >= pciNumDomains) ||
- !(pDomain = xf86DomainInfo[domain]))
- FatalError("%s called with invalid parameters\n", __FUNCTION__);
-
- /*
- * Use glibc inx/outx routines for sparse I/O, so just return the
- * base [this is ok since we also constrain sparse I/O systems to
- * a single domain in axpSetupDomains()]
- */
- if (pDomain->sparse_io) return Base;
-
- /*
- * I/O addresses on Alpha are really just different physical memory
- * addresses that the system corelogic turns into I/O commands on the
- * bus, so just use xf86MapVidMem to map I/O as well, but remember
- * to subtract _bus_base() (the physical dense memory root of hose 0)
- * since xf86MapVidMem is expecting an offset relative to _bus_base()
- * rather than an actual physical address.
- *
- * Map the entire I/O space (64kB) at once and only once.
- */
- if (!pDomain->mapped_io)
- pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(ScreenNum, Flags,
- pDomain->dense_io - _bus_base(),
- 0x10000);
-
- return pDomain->mapped_io + Base;
-}
-
-int
-xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
-{
- static unsigned long pagemask = 0;
- unsigned char *MappedAddr;
- unsigned long MapSize;
- ADDRESS MapBase;
- int i;
-
- if (!pagemask) pagemask = xf86getpagesize() - 1;
-
- /* Ensure page boundaries */
- MapBase = Base & ~pagemask;
- MapSize = ((Base + Len + pagemask) & ~pagemask) - MapBase;
-
- /*
- * VIDMEM_MMIO in order to get sparse mapping on sparse memory systems
- * so we can use mmio functions to read (that way we can really get byte
- * at a time reads on dense memory systems with byte/word instructions.
- */
- MappedAddr = xf86MapDomainMemory(-1, VIDMEM_READONLY | VIDMEM_MMIO,
- Tag, MapBase, MapSize);
-
- for (i = 0; i < Len; i++) {
- *Buf++ = xf86ReadMmio8(MappedAddr, Base - MapBase + i);
- }
-
- xf86UnMapVidMem(-1, MappedAddr, MapSize);
- return Len;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for(domain = 0; domain < pciNumDomains; domain++) {
- if (!xf86DomainInfo[domain]) continue;
-
- RANGE(range, 0, 0xffffffffUL,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, 0x0000ffffUL,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- return xf86PciBusAccWindowsFromOS();
-}
-
-resPtr
-xf86AccResFromOS(resPtr pRes)
-{
- resRange range;
- int domain;
-
- for(domain = 0; domain < pciNumDomains; domain++) {
- if (!xf86DomainInfo[domain]) continue;
-
- /*
- * Fallback is to claim the following areas:
- *
- * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
- */
-
- RANGE(range, 0x000c0000, 0x000effff,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- /*
- * Fallback would be to claim well known ports in the 0x0 - 0x3ff
- * range along with their sparse I/O aliases, but that's too
- * imprecise. Instead claim a bare minimum here.
- */
- RANGE(range, 0x00000000, 0x000000ff,
- RANGE_TYPE(ResExcIoBlock, domain)); /* For mainboard */
- pRes = xf86AddResToList(pRes, &range, -1);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000, 0x00000000,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-/* RANGE(range, 0x00000000, 0x00000000,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1); */
- RANGE(range, 0xffffffff, 0xffffffff,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-#endif /* !INCLUDE_XF86_NO_DOMAIN */
-
diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c
deleted file mode 100644
index adbd189f1..000000000
--- a/hw/xfree86/os-support/bus/e8870PCI.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.2 2003/07/17 15:08:22 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-/*
- * This file contains the glue necessary for support of Intel's E8870 chipset.
- */
-
-#include "e8870PCI.h"
-#include "xf86.h"
-#include "Pci.h"
-
-Bool
-xf86PreScanE8870(void)
-{
- PCITAG tag;
-
- /* Look for an E8870's Hub interface */
- tag = PCI_MAKE_TAG(0, 0x1E, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_82801_P2P))
- return FALSE;
-
- /* XXX Fill me in... */
- return TRUE;
-}
-
-void
-xf86PostScanE8870(void)
-{
- /* XXX Fill me in... */
-}
diff --git a/hw/xfree86/os-support/bus/e8870PCI.h b/hw/xfree86/os-support/bus/e8870PCI.h
deleted file mode 100644
index b910bcfd8..000000000
--- a/hw/xfree86/os-support/bus/e8870PCI.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef PCI_E8870_H
-#define PCI_E8870_H 1
-
-#include <X11/Xdefs.h>
-
-Bool xf86PreScanE8870(void);
-void xf86PostScanE8870(void);
-
-#endif
diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c
deleted file mode 100644
index 06baa69ea..000000000
--- a/hw/xfree86/os-support/bus/freebsdPci.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.6 2003/10/02 13:30:07 eich Exp $ */
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-#include <sys/pciio.h>
-
-/*
- * freebsd platform specific PCI access functions -- using /dev/pci
- * needs kernel version 2.2.x
- */
-static CARD32 freebsdPciCfgRead(PCITAG tag, int off);
-static void freebsdPciCfgWrite(PCITAG, int off, CARD32 val);
-static void freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
-
-static pciBusFuncs_t freebsdFuncs0 = {
-/* pciReadLong */ freebsdPciCfgRead,
-/* pciWriteLong */ freebsdPciCfgWrite,
-/* pciSetBitsLong */ freebsdPciCfgSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t freebsdPci0 = {
-/* configMech */ PCI_CFG_MECH_OTHER,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-#ifdef PowerMAX_OS
-/* ppc_io_base */ 0,
-/* ppc_io_size */ 0,
-#endif
-/* funcs */ &freebsdFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-#ifdef __sparc__
-#ifndef ASI_PL
-#define ASI_PL 0x88
-#endif
-#define PCI_CPU(val) ({ \
-int __ret; \
-__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \
-__ret; \
-})
-#else
-#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
- ((val >> 8) & 0x0000ff00) | \
- ((val << 8) & 0x00ff0000) | \
- ((val << 24) & 0xff000000))
-#endif
-#else
-#define PCI_CPU(val) (val)
-#endif
-#else /* ! OpenBSD */
-/* OpenBSD has already the bytes in the right order
- for all architectures */
-#define PCI_CPU(val) (val)
-#endif
-
-
-#define BUS(tag) (((tag)>>16)&0xff)
-#define DFN(tag) (((tag)>>8)&0xff)
-
-static int pciFd = -1;
-
-void
-freebsdPciInit()
-{
- pciFd = open("/dev/pci", O_RDWR);
- if (pciFd < 0)
- return;
-
- pciNumBuses = 1;
- pciBusInfo[0] = &freebsdPci0;
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
-}
-
-static CARD32
-freebsdPciCfgRead(PCITAG tag, int off)
-{
- struct pci_io io;
- int error;
- io.pi_sel.pc_bus = BUS(tag);
- io.pi_sel.pc_dev = DFN(tag) >> 3;
- io.pi_sel.pc_func = DFN(tag) & 7;
- io.pi_reg = off;
- io.pi_width = 4;
- error = ioctl(pciFd, PCIOCREAD, &io);
- if (error)
- return ~0;
- return PCI_CPU(io.pi_data);
-}
-
-static void
-freebsdPciCfgWrite(PCITAG tag, int off, CARD32 val)
-{
- struct pci_io io;
- io.pi_sel.pc_bus = BUS(tag);
- io.pi_sel.pc_dev = DFN(tag) >> 3;
- io.pi_sel.pc_func = DFN(tag) & 7;
- io.pi_reg = off;
- io.pi_width = 4;
- io.pi_data = PCI_CPU(val);
- ioctl(pciFd, PCIOCWRITE, &io);
-}
-
-static void
-freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- CARD32 val = freebsdPciCfgRead(tag, off);
- val = (val & ~mask) | (bits & mask);
- freebsdPciCfgWrite(tag, off, val);
-}
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
deleted file mode 100644
index b135d0b73..000000000
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.25 2003/09/24 02:43:34 dawes Exp $ */
-/*
- * ix86Pci.c - x86 PCI driver
- *
- * The XFree86 server PCI access functions have been reimplemented as a
- * framework that allows each supported platform/OS to have their own
- * platform/OS specific PCI driver.
- *
- * Most of the code of these functions was simply lifted from the
- * Intel architecture specifric portion of the original Xfree86
- * PCI code in hw/xfree86/common_hw/xf86_PCI.C...
- *
- * Gary Barton
- * Concurrent Computer Corporation
- * garyb@gate.net
- */
-
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * This software is derived from the original XFree86 PCI code
- * which includes the following copyright notices as well:
- *
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * This code is also based heavily on the code in FreeBSD-current, which was
- * written by Wolfgang Stanglmeier, and contains the following copyright:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "Pci.h"
-
-#ifdef PC98
-#define outb(port,data) _outb(port,data)
-#define outl(port,data) _outl(port,data)
-#define inb(port) _inb(port)
-#define inl(port) _inl(port)
-#endif
-
-#define PCI_CFGMECH2_ENABLE_REG 0xCF8
-#ifdef PC98
-#define PCI_CFGMECH2_FORWARD_REG 0xCF9
-#else
-#define PCI_CFGMECH2_FORWARD_REG 0xCFA
-#endif
-
-#define PCI_CFGMECH2_MAXDEV 16
-
-#define PCI_ADDR_FROM_TAG_CFG1(tag,reg) (PCI_EN | tag | (reg & 0xfc))
-#define PCI_FORWARD_FROM_TAG(tag) PCI_BUS_FROM_TAG(tag)
-#define PCI_ENABLE_FROM_TAG(tag) (0xf0 | (((tag) & 0x00000700) >> 7))
-#define PCI_ADDR_FROM_TAG_CFG2(tag,reg) (0xc000 | (((tag) & 0x0000f800) >> 3) \
- | (reg & 0xfc))
-
-/*
- * Intel x86 platform specific PCI access functions
- */
-static CARD32 ix86PciReadLongSetup(PCITAG tag, int off);
-static void ix86PciWriteLongSetup(PCITAG, int off, CARD32 val);
-static void ix86PciSetBitsLongSetup(PCITAG, int off, CARD32 mask, CARD32 val);
-static CARD32 ix86PciReadLongCFG1(PCITAG tag, int off);
-static void ix86PciWriteLongCFG1(PCITAG, int off, CARD32 val);
-static void ix86PciSetBitsLongCFG1(PCITAG, int off, CARD32 mask, CARD32 val);
-static CARD32 ix86PciReadLongCFG2(PCITAG tag, int off);
-static void ix86PciWriteLongCFG2(PCITAG, int off, CARD32 val);
-static void ix86PciSetBitsLongCFG2(PCITAG, int off, CARD32 mask, CARD32 val);
-
-static pciBusFuncs_t ix86Funcs0 = {
-/* pciReadLong */ ix86PciReadLongSetup,
-/* pciWriteLong */ ix86PciWriteLongSetup,
-/* pciSetBitsLong */ ix86PciSetBitsLongSetup,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusFuncs_t ix86Funcs1 = {
-/* pciReadLong */ ix86PciReadLongCFG1,
-/* pciWriteLong */ ix86PciWriteLongCFG1,
-/* pciSetBitsLong */ ix86PciSetBitsLongCFG1,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusFuncs_t ix86Funcs2 = {
-/* pciReadLong */ ix86PciReadLongCFG2,
-/* pciWriteLong */ ix86PciWriteLongCFG2,
-/* pciSetBitsLong */ ix86PciSetBitsLongCFG2,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t ix86Pci0 = {
-/* configMech */ PCI_CFG_MECH_UNKNOWN, /* Set by ix86PciInit() */
-/* numDevices */ 0, /* Set by ix86PciInit() */
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-#ifdef PowerMAX_OS
-/* ppc_io_base */ 0,
-/* ppc_io_size */ 0,
-#endif
-/* funcs */ &ix86Funcs0, /* Set by ix86PciInit() */
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-static Bool
-ix86PciBusCheck(void)
-{
- PCITAG tag;
- CARD32 id, class;
- CARD8 device;
-
- for (device = 0; device < ix86Pci0.numDevices; device++) {
- tag = PCI_MAKE_TAG(0, device, 0);
- id = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_ID_REG);
-
- if ((CARD16)(id + 1U) <= (CARD16)1UL)
- continue;
-
- /* The rest of this is inspired by the Linux kernel */
- class = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_CLASS_REG);
-
- /* Ignore revision id and programming interface */
- switch (class >> 16) {
- case (PCI_CLASS_PREHISTORIC << 8) | PCI_SUBCLASS_PREHISTORIC_MISC:
- /* Check for vendors of known buggy chipsets */
- id &= 0x0000ffff;
- if ((id == PCI_VENDOR_INTEL) || (id == PCI_VENDOR_COMPAQ))
- return TRUE;
- continue;
-
- case (PCI_CLASS_PREHISTORIC << 8) | PCI_SUBCLASS_PREHISTORIC_VGA:
- case (PCI_CLASS_DISPLAY << 8) | PCI_SUBCLASS_DISPLAY_VGA:
- case (PCI_CLASS_BRIDGE << 8) | PCI_SUBCLASS_BRIDGE_HOST:
- return TRUE;
-
- default:
- break;
- }
- }
- return FALSE;
-}
-
-static
-void ix86PciSelectCfgmech(void)
-{
- static Bool beenhere = FALSE;
- CARD32 mode1Res1 = 0, mode1Res2 = 0, oldVal1 = 0;
- CARD8 mode2Res1 = 0, mode2Res2 = 0, oldVal2 = 0;
- int stages = 0;
-
- if (beenhere)
- return; /* Been there, done that */
-
- beenhere = TRUE;
-
- /*
- * Determine if motherboard chipset supports PCI Config Mech 1 or 2
- * We rely on xf86Info.pciFlags to tell which mechanisms to try....
- */
- switch (xf86Info.pciFlags) {
-
- case PCIProbe1: /* { */
-
- xf86MsgVerb(X_INFO, 2, "PCI: Probing config type using method 1\n");
- oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("Checking config type 1:\n"
- "\tinitial value of MODE1_ADDR_REG is 0x%08x\n", oldVal1);
- ErrorF("\tChecking that all bits in mask 0x7f000000 are clear\n");
- }
-#endif
-
- /* Assuming config type 1 to start with */
- if ((oldVal1 & 0x7f000000) == 0) {
-
- stages |= 0x01;
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tValue indicates possibly config type 1\n");
- ErrorF("\tWriting 32-bit value 0x%08x to MODE1_ADDR_REG\n", PCI_EN);
-#if 0
- ErrorF("\tWriting 8-bit value 0x00 to MODE1_ADDR_REG + 3\n");
-#endif
- }
-#endif
-
- ix86Pci0.configMech = PCI_CFG_MECH_1;
- ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs1;
-
- outl(PCI_CFGMECH1_ADDRESS_REG, PCI_EN);
-
-#if 0
- /*
- * This seems to cause some Neptune-based PCI machines to switch
- * from config type 1 to config type 2
- */
- outb(PCI_CFGMECH1_ADDRESS_REG + 3, 0);
-#endif
- mode1Res1 = inl(PCI_CFGMECH1_ADDRESS_REG);
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tValue read back from MODE1_ADDR_REG is 0x%08x\n",
- mode1Res1);
- ErrorF("\tRestoring original contents of MODE1_ADDR_REG\n");
- }
-#endif
-
- outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
-
- if (mode1Res1) {
-
- stages |= 0x02;
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tValue read back is non-zero, and indicates possible"
- " config type 1\n");
- }
-#endif
-
- if (ix86PciBusCheck()) {
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2)
- ErrorF("\tBus check Confirms this: ");
-#endif
-
- xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
- xf86MsgVerb(X_INFO, 3,
- "PCI: stages = 0x%02x, oldVal1 = 0x%08lx, mode1Res1"
- " = 0x%08lx\n", stages, (unsigned long)oldVal1,
- (unsigned long)mode1Res1);
- return;
- }
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tBus check fails to confirm this, continuing type 1"
- " check ...\n");
- }
-#endif
-
- }
-
- stages |= 0x04;
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tWriting 0xff000001 to MODE1_ADDR_REG\n");
- }
-#endif
- outl(PCI_CFGMECH1_ADDRESS_REG, 0xff000001);
- mode1Res2 = inl(PCI_CFGMECH1_ADDRESS_REG);
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tValue read back from MODE1_ADDR_REG is 0x%08x\n",
- mode1Res2);
- ErrorF("\tRestoring original contents of MODE1_ADDR_REG\n");
- }
-#endif
-
- outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
-
- if ((mode1Res2 & 0x80000001) == 0x80000000) {
-
- stages |= 0x08;
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tValue read back has only the msb set\n"
- "\tThis indicates possible config type 1\n");
- }
-#endif
-
- if (ix86PciBusCheck()) {
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2)
- ErrorF("\tBus check Confirms this: ");
-#endif
-
- xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
- xf86MsgVerb(X_INFO, 3,
- "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n"
- "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n",
- stages, (unsigned long)oldVal1,
- (unsigned long)mode1Res1, (unsigned long)mode1Res2);
- return;
- }
-
-#ifdef DEBUGPCI
- if (xf86Verbose > 2) {
- ErrorF("\tBus check fails to confirm this.\n");
- }
-#endif
-
- }
- }
-
- xf86MsgVerb(X_INFO, 3, "PCI: Standard check for type 1 failed.\n");
- xf86MsgVerb(X_INFO, 3, "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n"
- "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n",
- stages, (unsigned long)oldVal1, (unsigned long)mode1Res1,
- (unsigned long)mode1Res2);
-
- /* Try config type 2 */
- oldVal2 = inb(PCI_CFGMECH2_ENABLE_REG);
- if ((oldVal2 & 0xf0) == 0) {
- ix86Pci0.configMech = PCI_CFG_MECH_2;
- ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs2;
-
- outb(PCI_CFGMECH2_ENABLE_REG, 0x0e);
- mode2Res1 = inb(PCI_CFGMECH2_ENABLE_REG);
- outb(PCI_CFGMECH2_ENABLE_REG, oldVal2);
-
- if (mode2Res1 == 0x0e) {
- if (ix86PciBusCheck()) {
- xf86MsgVerb(X_INFO, 2, "PCI: Config type is 2\n");
- return;
- }
- }
- }
- break; /* } */
-
- case PCIProbe2: /* { */
-
- /* The scanpci-style detection method */
-
- xf86MsgVerb(X_INFO, 2, "PCI: Probing config type using method 2\n");
-
- outb(PCI_CFGMECH2_ENABLE_REG, 0x00);
- outb(PCI_CFGMECH2_FORWARD_REG, 0x00);
- mode2Res1 = inb(PCI_CFGMECH2_ENABLE_REG);
- mode2Res2 = inb(PCI_CFGMECH2_FORWARD_REG);
-
- if (mode2Res1 == 0 && mode2Res2 == 0) {
- xf86MsgVerb(X_INFO, 2, "PCI: Config type is 2\n");
- ix86Pci0.configMech = PCI_CFG_MECH_2;
- ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs2;
- return;
- }
-
- oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
- outl(PCI_CFGMECH1_ADDRESS_REG, PCI_EN);
- mode1Res1 = inl(PCI_CFGMECH1_ADDRESS_REG);
- outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
- if (mode1Res1 == PCI_EN) {
- xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
- ix86Pci0.configMech = PCI_CFG_MECH_1;
- ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs1;
- return;
- }
- break; /* } */
-
- case PCIForceConfig1:
-
- xf86MsgVerb(X_INFO, 2, "PCI: Forcing config type 1\n");
-
- ix86Pci0.configMech = PCI_CFG_MECH_1;
- ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs1;
- return;
-
- case PCIForceConfig2:
-
- xf86MsgVerb(X_INFO, 2, "PCI: Forcing config type 2\n");
-
- ix86Pci0.configMech = PCI_CFG_MECH_2;
- ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
- ix86Pci0.funcs = &ix86Funcs2;
- return;
-
- case PCIOsConfig:
- return;
-
- case PCIForceNone:
- break;
- }
-
- /* No PCI found */
- ix86Pci0.configMech = PCI_CFG_MECH_UNKNOWN;
- xf86MsgVerb(X_INFO, 2, "PCI: No PCI bus found or probed for\n");
-}
-
-#if 0
-static pciTagRec
-ix86PcibusTag(CARD8 bus, CARD8 cardnum, CARD8 func)
-{
- pciTagRec tag;
-
- tag.cfg1 = 0;
-
- if (func > 7 || cardnum >= pciBusInfo[bus]->numDevices)
- return tag;
-
- switch (ix86Pci0.configMech) {
- case PCI_CFG_MECH_1:
- tag.cfg1 = PCI_EN | ((CARD32)bus << 16) |
- ((CARD32)cardnum << 11) |
- ((CARD32)func << 8);
- break;
-
- case PCI_CFG_MECH_2:
- tag.cfg2.port = 0xc000 | ((CARD16)cardnum << 8);
- tag.cfg2.enable = 0xf0 | (func << 1);
- tag.cfg2.forward = bus;
- break;
- }
-
- return tag;
-}
-#endif
-
-static CARD32
-ix86PciReadLongSetup(PCITAG Tag, int reg)
-{
- ix86PciSelectCfgmech();
- return (*ix86Pci0.funcs->pciReadLong)(Tag,reg);
-}
-
-static CARD32
-ix86PciReadLongCFG1(PCITAG Tag, int reg)
-{
- CARD32 addr, data = 0;
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciReadLong 0x%lx, %d\n", Tag, reg);
-#endif
-
- addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
- outl(PCI_CFGMECH1_ADDRESS_REG, addr);
- data = inl(PCI_CFGMECH1_DATA_REG);
- outl(PCI_CFGMECH1_ADDRESS_REG, 0);
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciReadLong 0x%lx\n", data);
-#endif
-
- return data;
-}
-
-static CARD32
-ix86PciReadLongCFG2(PCITAG Tag, int reg)
-{
- CARD32 addr, data = 0;
- CARD8 forward, enable;
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciReadLong 0x%lx, %d\n", Tag, reg);
-#endif
-
- forward = PCI_FORWARD_FROM_TAG(Tag);
- enable = PCI_ENABLE_FROM_TAG(Tag);
- addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
-
- outb(PCI_CFGMECH2_ENABLE_REG, enable);
- outb(PCI_CFGMECH2_FORWARD_REG, forward);
- data = inl((CARD16)addr);
- outb(PCI_CFGMECH2_ENABLE_REG, 0);
- outb(PCI_CFGMECH2_FORWARD_REG, 0);
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciReadLong 0x%lx\n", data);
-#endif
-
- return data;
-}
-
-static void
-ix86PciWriteLongSetup(PCITAG Tag, int reg, CARD32 data)
-{
- ix86PciSelectCfgmech();
- (*ix86Pci0.funcs->pciWriteLong)(Tag,reg,data);
-}
-
-static void
-ix86PciWriteLongCFG1(PCITAG Tag, int reg, CARD32 data)
-{
- CARD32 addr;
-
- addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
- outl(PCI_CFGMECH1_ADDRESS_REG, addr);
- outl(PCI_CFGMECH1_DATA_REG, data);
- outl(PCI_CFGMECH1_ADDRESS_REG, 0);
-}
-
-static void
-ix86PciWriteLongCFG2(PCITAG Tag, int reg, CARD32 data)
-{
- CARD32 addr;
- CARD8 forward, enable;
-
- forward = PCI_FORWARD_FROM_TAG(Tag);
- enable = PCI_ENABLE_FROM_TAG(Tag);
- addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
-
- outb(PCI_CFGMECH2_ENABLE_REG, enable);
- outb(PCI_CFGMECH2_FORWARD_REG, forward);
- outl((CARD16)addr, data);
- outb(PCI_CFGMECH2_ENABLE_REG, 0);
- outb(PCI_CFGMECH2_FORWARD_REG, 0);
-}
-
-static void
-ix86PciSetBitsLongSetup(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
-{
- ix86PciSelectCfgmech();
- (*ix86Pci0.funcs->pciSetBitsLong)(Tag,reg,mask,val);
-}
-
-static void
-ix86PciSetBitsLongCFG1(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
-{
- CARD32 addr, data = 0;
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciSetBitsLong 0x%lx, %d\n", Tag, reg);
-#endif
-
- addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
- outl(PCI_CFGMECH1_ADDRESS_REG, addr);
- data = inl(PCI_CFGMECH1_DATA_REG);
- data = (data & ~mask) | (val & mask);
- outl(PCI_CFGMECH1_DATA_REG, data);
- outl(PCI_CFGMECH1_ADDRESS_REG, 0);
-}
-
-static void
-ix86PciSetBitsLongCFG2(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
-{
- CARD32 addr, data = 0;
- CARD8 enable, forward;
-
-#ifdef DEBUGPCI
- ErrorF("ix86PciSetBitsLong 0x%lx, %d\n", Tag, reg);
-#endif
-
- forward = PCI_FORWARD_FROM_TAG(Tag);
- enable = PCI_ENABLE_FROM_TAG(Tag);
- addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
-
- outb(PCI_CFGMECH2_ENABLE_REG, enable);
- outb(PCI_CFGMECH2_FORWARD_REG, forward);
- data = inl((CARD16)addr);
- data = (data & ~mask) | (val & mask);
- outl((CARD16)addr, data);
- outb(PCI_CFGMECH2_ENABLE_REG, 0);
- outb(PCI_CFGMECH2_FORWARD_REG, 0);
-}
-
-void
-ix86PciInit()
-{
- /* Initialize pciBusInfo[] array and function pointers */
- pciNumBuses = 1;
- pciBusInfo[0] = &ix86Pci0;
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
-
- /* Make sure that there is a PCI bus present. */
- ix86PciSelectCfgmech();
- if (ix86Pci0.configMech == PCI_CFG_MECH_UNKNOWN) {
- pciNumBuses = 0;
- pciBusInfo[0] = NULL;
- }
-}
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
deleted file mode 100644
index 76194802f..000000000
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.10 2002/11/17 18:42:01 alanh Exp $ */
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-/*
- * linux platform specific PCI access functions -- using /proc/bus/pci
- * needs kernel version 2.2.x
- */
-static CARD32 linuxPciCfgRead(PCITAG tag, int off);
-static void linuxPciCfgWrite(PCITAG, int off, CARD32 val);
-static void linuxPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
-
-static pciBusFuncs_t linuxFuncs0 = {
-/* pciReadLong */ linuxPciCfgRead,
-/* pciWriteLong */ linuxPciCfgWrite,
-/* pciSetBitsLong */ linuxPciCfgSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t linuxPci0 = {
-/* configMech */ PCI_CFG_MECH_OTHER,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-#ifdef PowerMAX_OS
-/* ppc_io_base */ 0,
-/* ppc_io_size */ 0,
-#endif
-/* funcs */ &linuxFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-void
-linuxPciInit()
-{
- struct stat st;
- if ((xf86Info.pciFlags == PCIForceNone) ||
- (-1 == stat("/proc/bus/pci", &st))) {
- /* when using this as default for all linux architectures,
- we'll need a fallback for 2.0 kernels here */
- return;
- }
- pciNumBuses = 1;
- pciBusInfo[0] = &linuxPci0;
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
-}
-
-static int
-linuxPciOpenFile(PCITAG tag)
-{
- static int lbus,ldev,lfunc,fd = -1;
- int bus, dev, func;
- char file[32];
-
- bus = PCI_BUS_FROM_TAG(tag);
- dev = PCI_DEV_FROM_TAG(tag);
- func = PCI_FUNC_FROM_TAG(tag);
- if (fd == -1 || bus != lbus || dev != ldev || func != lfunc) {
- if (fd != -1)
- close(fd);
- if (bus < 256)
- sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
- bus, dev, func);
- else
- sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
- bus, dev, func);
- fd = open(file,O_RDWR);
- lbus = bus;
- ldev = dev;
- lfunc = func;
- }
- return fd;
-}
-
-static CARD32
-linuxPciCfgRead(PCITAG tag, int off)
-{
- int fd;
- CARD32 val = 0xffffffff;
-
- if (-1 != (fd = linuxPciOpenFile(tag))) {
- lseek(fd,off,SEEK_SET);
- read(fd,&val,4);
- }
- return PCI_CPU(val);
-}
-
-static void
-linuxPciCfgWrite(PCITAG tag, int off, CARD32 val)
-{
- int fd;
-
- if (-1 != (fd = linuxPciOpenFile(tag))) {
- lseek(fd,off,SEEK_SET);
- val = PCI_CPU(val);
- write(fd,&val,4);
- }
-}
-
-static void
-linuxPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- int fd;
- CARD32 val = 0xffffffff;
-
- if (-1 != (fd = linuxPciOpenFile(tag))) {
- lseek(fd,off,SEEK_SET);
- read(fd,&val,4);
- val = PCI_CPU(val);
- val = (val & ~mask) | (bits & mask);
- val = PCI_CPU(val);
- lseek(fd,off,SEEK_SET);
- write(fd,&val,4);
- }
-}
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
-
-/*
- * Compiling the following simply requires the presence of <linux/pci.c>.
- * Actually running this is another matter altogether...
- *
- * This scheme requires that the kernel allow mmap()'ing of a host bridge's I/O
- * and memory spaces through its /proc/bus/pci/BUS/DFN entry. Which one is
- * determined by a prior ioctl().
- *
- * For the sparc64 port, this means 2.4.12 or later. For ppc, this
- * functionality is almost, but not quite there yet. Alpha and other kernel
- * ports to multi-domain architectures still need to implement this.
- *
- * This scheme is also predicated on the use of an IOADDRESS compatible type to
- * designate I/O addresses. Although IOADDRESS is defined as an unsigned
- * integral type, it is actually the virtual address of, i.e. a pointer to, the
- * I/O port to access. And so, the inX/outX macros in "compiler.h" need to be
- * #define'd appropriately (as is done on SPARC's).
- *
- * Another requirement to port this scheme to another multi-domain architecture
- * is to add the appropriate entries in the pciControllerSizes array below.
- *
- * TO DO: Address the deleterious reaction some host bridges have to master
- * aborts. This is already done for secondary PCI buses, but not yet
- * for accesses to primary buses (except for the SPARC port, where
- * master aborts are avoided during PCI scans).
- */
-
-#include <linux/pci.h>
-
-#ifndef PCIIOC_BASE /* Ioctls for /proc/bus/pci/X/Y nodes. */
-#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
-
-/* Get controller for PCI device. */
-#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00)
-/* Set mmap state to I/O space. */
-#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01)
-/* Set mmap state to MEM space. */
-#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02)
-/* Enable/disable write-combining. */
-#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03)
-
-#endif
-
-/* This probably shouldn't be Linux-specific */
-static pciConfigPtr
-xf86GetPciHostConfigFromTag(PCITAG Tag)
-{
- int bus = PCI_BUS_FROM_TAG(Tag);
- pciBusInfo_t *pBusInfo;
-
- while ((bus < pciNumBuses) && (pBusInfo = pciBusInfo[bus])) {
- if (bus == pBusInfo->primary_bus)
- return pBusInfo->bridge;
- bus = pBusInfo->primary_bus;
- }
-
- return NULL; /* Bad data */
-}
-
-/*
- * This is ugly, but until I can extract this information from the kernel,
- * it'll have to do. The default I/O space size is 64K, and 4G for memory.
- * Anything else needs to go in this table. (PowerPC folk take note.)
- *
- * Note that Linux/SPARC userland is 32-bit, so 4G overflows to zero here.
- *
- * Please keep this table in ascending vendor/device order.
- */
-static struct pciSizes {
- unsigned short vendor, device;
- unsigned long io_size, mem_size;
-} pciControllerSizes[] = {
- {
- PCI_VENDOR_SUN, PCI_CHIP_PSYCHO,
- 1U << 16, 1U << 31
- },
- {
- PCI_VENDOR_SUN, PCI_CHIP_SCHIZO,
- 1U << 24, 1U << 31 /* ??? */
- },
- {
- PCI_VENDOR_SUN, PCI_CHIP_SABRE,
- 1U << 24, (unsigned long)(1ULL << 32)
- },
- {
- PCI_VENDOR_SUN, PCI_CHIP_HUMMINGBIRD,
- 1U << 24, (unsigned long)(1ULL << 32)
- }
-};
-#define NUM_SIZES (sizeof(pciControllerSizes) / sizeof(pciControllerSizes[0]))
-
-static unsigned long
-linuxGetIOSize(PCITAG Tag)
-{
- pciConfigPtr pPCI;
- int i;
-
- /* Find host bridge */
- if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
- /* Look up vendor/device */
- for (i = 0; i < NUM_SIZES; i++) {
- if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
- continue;
- if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
- break;
- if (pPCI->pci_device > pciControllerSizes[i].device)
- continue;
- if (pPCI->pci_device < pciControllerSizes[i].device)
- break;
- return pciControllerSizes[i].io_size;
- }
- }
-
- return 1U << 16; /* Default to 64K */
-}
-
-static void
-linuxGetSizes(PCITAG Tag, unsigned long *io_size, unsigned long *mem_size)
-{
- pciConfigPtr pPCI;
- int i;
-
- *io_size = (1U << 16); /* Default to 64K */
- *mem_size = (unsigned long)(1ULL << 32); /* Default to 4G */
-
- /* Find host bridge */
- if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
- /* Look up vendor/device */
- for (i = 0; i < NUM_SIZES; i++) {
- if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
- continue;
- if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
- break;
- if (pPCI->pci_device > pciControllerSizes[i].device)
- continue;
- if (pPCI->pci_device < pciControllerSizes[i].device)
- break;
- *io_size = pciControllerSizes[i].io_size;
- *mem_size = pciControllerSizes[i].mem_size;
- break;
- }
- }
-}
-
-int
-xf86GetPciDomain(PCITAG Tag)
-{
- pciConfigPtr pPCI;
- int fd, result;
-
- pPCI = xf86GetPciHostConfigFromTag(Tag);
-
- if (pPCI && (result = PCI_DOM_FROM_BUS(pPCI->busnum)))
- return result;
-
- if ((fd = linuxPciOpenFile(pPCI ? pPCI->tag : 0)) < 0)
- return 0;
-
- if ((result = ioctl(fd, PCIIOC_CONTROLLER, 0)) < 0)
- return 0;
-
- return result + 1; /* Domain 0 is reserved */
-}
-
-static pointer
-linuxMapPci(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size, int mmap_ioctl)
-{
- do {
- pciConfigPtr pPCI;
- unsigned char *result;
- ADDRESS realBase, Offset;
- int fd, mmapflags, prot;
-
- xf86InitVidMem();
-
- pPCI = xf86GetPciHostConfigFromTag(Tag);
-
- if (((fd = linuxPciOpenFile(pPCI ? pPCI->tag : 0)) < 0) ||
- (ioctl(fd, mmap_ioctl, 0) < 0))
- break;
-
-/* Note: IA-64 doesn't compile this and doesn't need to */
-#ifdef __ia64__
-
-# ifndef MAP_WRITECOMBINED
-# define MAP_WRITECOMBINED 0x00010000
-# endif
-# ifndef MAP_NONCACHED
-# define MAP_NONCACHED 0x00020000
-# endif
-
- if (Flags & VIDMEM_FRAMEBUFFER)
- mmapflags = MAP_SHARED | MAP_WRITECOMBINED;
- else
- mmapflags = MAP_SHARED | MAP_NONCACHED
-
-#else /* !__ia64__ */
-
- mmapflags = (Flags & VIDMEM_FRAMEBUFFER) / VIDMEM_FRAMEBUFFER;
-
- if (ioctl(fd, PCIIOC_WRITE_COMBINE, mmapflags) < 0)
- break;
-
- mmapflags = MAP_SHARED;
-
-#endif /* ?__ia64__ */
-
- /* Align to page boundary */
- realBase = Base & ~(getpagesize() - 1);
- Offset = Base - realBase;
-
- if (Flags & VIDMEM_READONLY)
- prot = PROT_READ;
- else
- prot = PROT_READ | PROT_WRITE;
-
- result = mmap(NULL, Size + Offset, prot, mmapflags, fd, realBase);
-
- if (!result || ((pointer)result == MAP_FAILED))
- FatalError("linuxMapPci() mmap failure: %s\n", strerror(errno));
-
- xf86MakeNewMapping(ScreenNum, Flags, realBase, Size + Offset, result);
-
- return result + Offset;
- } while (0);
-
- if (mmap_ioctl == PCIIOC_MMAP_IS_MEM)
- return xf86MapVidMem(ScreenNum, Flags, Base, Size);
-
- return NULL;
-}
-
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size)
-{
- return linuxMapPci(ScreenNum, Flags, Tag, Base, Size, PCIIOC_MMAP_IS_MEM);
-}
-
-#define MAX_DOMAINS 257
-static pointer DomainMmappedIO[MAX_DOMAINS];
-
-/* This has no means of returning failure, so all errors are fatal */
-IOADDRESS
-xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
- IOADDRESS Base, unsigned long Size)
-{
- int domain = xf86GetPciDomain(Tag);
-
- if ((domain <= 0) || (domain >= MAX_DOMAINS))
- FatalError("xf86MapDomainIO(): domain out of range\n");
-
- /* Permanently map all of I/O space */
- if (!DomainMmappedIO[domain]) {
- DomainMmappedIO[domain] = linuxMapPci(ScreenNum, Flags, Tag,
- 0, linuxGetIOSize(Tag),
- PCIIOC_MMAP_IS_IO);
- if (!DomainMmappedIO[domain])
- FatalError("xf86MapDomainIO(): mmap() failure\n");
- }
-
- return (IOADDRESS)DomainMmappedIO[domain] + Base;
-}
-
-int
-xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
-{
- unsigned char *ptr, *src;
- ADDRESS offset;
- unsigned long size;
- int len, pagemask = getpagesize() - 1;
-
- /* Ensure page boundaries */
- offset = Base & ~pagemask;
- size = ((Base + Len + pagemask) & ~pagemask) - offset;
-
- ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, Tag, offset, size);
-
- if (!ptr)
- return -1;
-
- /* Using memcpy() here can hang the system */
- src = ptr + (Base - offset);
- for (len = Len; len-- > 0;)
- *Buf++ = *src++;
-
- xf86UnMapVidMem(-1, ptr, size);
-
- return Len;
-}
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- pciConfigPtr *ppPCI, pPCI;
- resPtr pRes = NULL;
- resRange range;
- unsigned long io_size, mem_size;
- int domain;
-
- if ((ppPCI = xf86scanpci(0))) {
- for (; (pPCI = *ppPCI); ppPCI++) {
- if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
- (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
- continue;
-
- domain = xf86GetPciDomain(pPCI->tag);
- linuxGetSizes(pPCI->tag, &io_size, &mem_size);
-
- RANGE(range, 0, (ADDRESS)(mem_size - 1),
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, (IOADDRESS)(io_size - 1),
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- if (domain <= 0)
- break;
- }
- }
-
- return pRes;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- pciConfigPtr *ppPCI, pPCI;
- resPtr pRes = NULL;
- resRange range;
- unsigned long io_size, mem_size;
- int domain;
-
- if ((ppPCI = xf86scanpci(0))) {
- for (; (pPCI = *ppPCI); ppPCI++) {
- if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
- (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
- continue;
-
- domain = xf86GetPciDomain(pPCI->tag);
- linuxGetSizes(pPCI->tag, &io_size, &mem_size);
-
- RANGE(range, 0, (ADDRESS)(mem_size - 1),
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, (IOADDRESS)(io_size - 1),
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- if (domain <= 0)
- break;
- }
- }
-
- return pRes;
-}
-
-
-resPtr
-xf86AccResFromOS(resPtr pRes)
-{
- pciConfigPtr *ppPCI, pPCI;
- resRange range;
- unsigned long io_size, mem_size;
- int domain;
-
- if ((ppPCI = xf86scanpci(0))) {
- for (; (pPCI = *ppPCI); ppPCI++) {
- if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
- (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
- continue;
-
- domain = xf86GetPciDomain(pPCI->tag);
- linuxGetSizes(pPCI->tag, &io_size, &mem_size);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so
- * that resources that are (or appear to be) unallocated can be
- * relocated.
- */
- RANGE(range, 0x00000000u, 0x0009ffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000c0000u, 0x000effffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000f0000u, 0x000fffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, (ADDRESS)(mem_size - 1), (ADDRESS)(mem_size - 1),
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0x00000000u, 0x00000000u,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, (IOADDRESS)(io_size - 1), (IOADDRESS)(io_size - 1),
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- if (domain <= 0)
- break;
- }
- }
-
- return pRes;
-}
-
-#endif /* !INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c
deleted file mode 100644
index 9c46ee3d3..000000000
--- a/hw/xfree86/os-support/bus/netbsdPci.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.4 2003/08/24 17:37:04 dawes Exp $ */
-/*
- * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written
- * authorization from the XFree86 Project.
- */
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <dev/pci/pciio.h>
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-
-#include "Pci.h"
-
-static CARD32 netbsdPciConfRead(PCITAG, int);
-static void netbsdPciConfWrite(PCITAG, int, CARD32);
-static void netbsdPciSetBits(PCITAG, int, CARD32, CARD32);
-
-static int devpci = -1;
-
-static pciBusFuncs_t netbsdFuncs0 = {
-/* pciReadLong */ netbsdPciConfRead,
-/* pciWriteLong */ netbsdPciConfWrite,
-/* pciSetBitsLong */ netbsdPciSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t netbsdPci0 = {
-/* configMech */ PCI_CFG_MECH_OTHER,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-/* funcs */ &netbsdFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-void
-netbsdPciInit()
-{
- struct pciio_businfo pci_businfo;
-
- devpci = open("/dev/pci0", O_RDWR);
- if (devpci == -1)
- FatalError("netbsdPciInit: can't open /dev/pci0\n");
-
- pciNumBuses = 1;
- pciBusInfo[0] = &netbsdPci0;
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
- /* use businfo to get the number of devs */
- if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0)
- FatalError("netbsdPciInit: not a PCI bus device");
- netbsdPci0.numDevices = pci_businfo.maxdevs;
-}
-
-static CARD32
-netbsdPciConfRead(PCITAG tag, int reg)
-{
- struct pciio_bdf_cfgreg bdfr;
-
- bdfr.bus = PCI_BUS_FROM_TAG(tag);
- bdfr.device = PCI_DEV_FROM_TAG(tag);
- bdfr.function = PCI_FUNC_FROM_TAG(tag);
- bdfr.cfgreg.reg = reg;
-
- if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1)
- FatalError("netbsdPciConfRead: failed on %d/%d/%d\n",
- bdfr.bus, bdfr.device, bdfr.function);
-
- return (bdfr.cfgreg.val);
-}
-
-static void
-netbsdPciConfWrite(PCITAG tag, int reg, CARD32 val)
-{
- struct pciio_bdf_cfgreg bdfr;
-
- bdfr.bus = PCI_BUS_FROM_TAG(tag);
- bdfr.device = PCI_DEV_FROM_TAG(tag);
- bdfr.function = PCI_FUNC_FROM_TAG(tag);
- bdfr.cfgreg.reg = reg;
- bdfr.cfgreg.val = val;
-
- if (ioctl(devpci, PCI_IOC_BDF_CFGWRITE, &bdfr) == -1)
- FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n",
- bdfr.bus, bdfr.device, bdfr.function);
-}
-
-static void
-netbsdPciSetBits(PCITAG tag, int reg, CARD32 mask, CARD32 bits)
-{
- CARD32 val;
-
- val = netbsdPciConfRead(tag, reg);
- val = (val & ~mask) | (bits & mask);
- netbsdPciConfWrite(tag, reg, val);
-}
diff --git a/hw/xfree86/os-support/bus/ppcPci.c b/hw/xfree86/os-support/bus/ppcPci.c
deleted file mode 100644
index 2aa98355b..000000000
--- a/hw/xfree86/os-support/bus/ppcPci.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.9 2002/08/27 22:07:07 tsi Exp $ */
-/*
- * ppcPci.c - PowerPC PCI access functions
- *
- * PCI driver functions supporting Motorola PowerPC platforms
- * including Powerstack(RiscPC/RiscPC+), PowerStackII, MTX, and
- * MVME 160x/260x/360x/460x VME boards
- *
- * Gary Barton
- * Concurrent Computer Corporation
- * garyb@gate.net
- *
- */
-
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED (pointer)(-1)
-#endif
-
-void
-ppcPciInit()
-{
-#if defined(PowerMAX_OS)
- extern void pmaxPciInit(void);
-
- pmaxPciInit();
-
-#else
-
- extern void motoppcPciInit(void);
-
- motoppcPciInit();
-
-#endif
-}
-
-/*
- * Motorola PowerPC platform support
- *
- * The following code should support the MVME 1600 & 2600 VME boards
- * as well as the various PowerStack and RiscPC models. All of these
- * machines support PCI config mechanism #1 and use the std config
- * address and data regs locations:
- * cfg address reg = 0xcf8 (PCI I/O)
- * cfg data reg = 0xcfc (PCI I/O)
- *
- * The moto machines do have different address maps on either side
- * of the PCI-host bridge though.
- */
-static ADDRESS motoppcBusAddrToHostAddr(PCITAG, PciAddrType, ADDRESS);
-static ADDRESS motoppcHostAddrToBusAddr(PCITAG, PciAddrType, ADDRESS);
-
-static pciBusFuncs_t motoppcFuncs0 = {
-/* pciReadLong */ pciCfgMech1Read,
-/* pciWriteLong */ pciCfgMech1Write,
-/* pciSetBitsLong */ pciCfgMech1SetBits,
-/* pciAddrHostToBus */ motoppcHostAddrToBusAddr,
-/* pciAddrBusToHost */ motoppcBusAddrToHostAddr
-};
-
-static pciBusInfo_t motoppcPci0 = {
-/* configMech */ PCI_CFG_MECH_1,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-#ifdef PowerMAX_OS
-/* ppc_io_base */ 0x80000000,
-/* ppc_io_size */ 64 * 1024,
-#endif
-/* funcs */ &motoppcFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-extern volatile unsigned char *ioBase;
-
-void
-motoppcPciInit()
-{
- pciNumBuses = 1;
- pciBusInfo[0] = &motoppcPci0;
- pciFindFirstFP = pciGenFindFirst;
- pciFindNextFP = pciGenFindNext;
-
- if (ioBase == MAP_FAILED) {
- ppcPciIoMap(0); /* Make inb/outb et al work for pci0 and its secondaries */
-
- if (ioBase == MAP_FAILED) {
- FatalError("motoppcPciInit: Cannot map pci0 I/O segment!!!\n");
- /*NOTREACHED*/
- }
- }
-}
-
-extern unsigned long motoPciMemBase = 0;
-
-#if defined(Lynx) && defined(__powerpc__)
-extern unsigned long motoPciMemLen = 0x40000000;
-#else
-extern unsigned long motoPciMemLen = 0x3f000000;
-#endif
-
-extern unsigned long motoPciMemBaseCPU = 0xc0000000;
-
-static ADDRESS
-motoppcBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
-{
- unsigned long addr_l = (unsigned long)addr;
-
- if (type == PCI_MEM) {
- if (addr_l >= motoPciMemBase && addr_l < motoPciMemLen)
- /*
- * PCI memory space addresses [0-0x3effffff] are
- * are seen at [0xc0000000,0xfeffffff] on moto host
- */
- return((ADDRESS)((motoPciMemBaseCPU - motoPciMemBase) + addr_l));
-
- else if (addr_l >= 0x80000000)
- /*
- * Moto host memory [0,0x7fffffff] is seen at
- * [0x80000000,0xffffffff] on PCI bus
- */
- return((ADDRESS)(addr_l & 0x7fffffff));
- else
- FatalError("motoppcBusAddrToHostAddr: PCI addr 0x%x is not accessible to host!!!\n",
- addr_l);
- } else
- return addr;
-
- /*NOTREACHED*/
-}
-
-static ADDRESS
-motoppcHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
-{
- unsigned long addr_l = (unsigned long)addr;
-
- if (type == PCI_MEM) {
- if (addr_l < 0x80000000)
- /*
- * Moto host memory [0,0x7fffffff] is seen at
- * [0x80000000,0xffffffff] on PCI bus
- */
- return((ADDRESS)(0x80000000 | addr_l));
-
- else if (addr_l >= motoPciMemBaseCPU && addr_l < motoPciMemBaseCPU + motoPciMemLen)
- /*
- * PCI memory space addresses [0-0x3effffff] are
- * are seen at [0xc0000000,0xfeffffff] on moto host
- */
- return((ADDRESS)(addr_l - (motoPciMemBaseCPU - motoPciMemBase)));
-
- else
- FatalError("motoppcHostAddrToBusAddr: Host addr 0x%x is not accessible to PCI!!!\n",
- addr_l);
- } else
- return addr;
-
- /*NOTREACHED*/
-}
diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c
deleted file mode 100644
index 2ada6fd47..000000000
--- a/hw/xfree86/os-support/bus/sparcPci.c
+++ /dev/null
@@ -1,1048 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.14 2003/08/24 17:37:04 dawes Exp $ */
-/*
- * Copyright (C) 2001-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-#include "xf86sbusBus.h"
-
-#if defined(sun)
-
-extern char *apertureDevName;
-static int apertureFd = -1;
-
-/*
- * A version of xf86MapVidMem() that allows for 64-bit displacements (but not
- * sizes). Areas thus mapped can be unmapped by xf86UnMapVidMem().
- */
-static pointer
-sparcMapAperture(int iScreen, int Flags,
- unsigned long long Base, unsigned long Size)
-{
- pointer result;
- static int lastFlags = 0;
-
- /* Assume both Base & Size are multiples of the page size */
-
- if ((apertureFd < 0) || (Flags != lastFlags)) {
- if (apertureFd >= 0)
- close(apertureFd);
- lastFlags = Flags;
- apertureFd = open(apertureDevName,
- (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (apertureFd < 0)
- FatalError("sparcMapAperture: open failure: %s\n",
- strerror(errno));
- }
-
- result = mmap(NULL, Size,
- (Flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, apertureFd, (off_t)Base);
-
- if (result == MAP_FAILED)
- FatalError("sparcMapAperture: mmap failure: %s\n", strerror(errno));
-
- return result;
-}
-
-/*
- * Platform-specific bus privates.
- */
-typedef struct _sparcDomainRec {
- unsigned long long io_addr, io_size;
- unsigned long long mem_addr, mem_size;
- pointer pci, io;
- int bus_min, bus_max;
- unsigned char dfn_mask[256 / 8];
-} sparcDomainRec, *sparcDomainPtr;
-
-#define SetBitInMap(bit, map) \
- do { \
- int _bit = (bit); \
- (map)[_bit >> 3] |= 1 << (_bit & 7); \
- } while (0)
-
-#define IsBitSetInMap(bit, map) \
- ((map)[(bit) >> 3] & (1 << ((bit) & 7)))
-
-/*
- * Domain 0 is reserved for the one that represents the system as a whole, i.e.
- * the one without any resource relocations.
- */
-#define MAX_DOMAINS (MAX_PCI_BUSES / 256)
-static sparcDomainPtr xf86DomainInfo[MAX_DOMAINS];
-static int pciNumDomains = 1;
-
-/* Variables that are assigned this must be declared volatile */
-#define PciReg(base, tag, off, type) \
- *(volatile type *)(pointer)((char *)(base) + \
- (PCI_TAG_NO_DOMAIN(tag) | (off)))
-
-/* Generic SPARC PCI access functions */
-static CARD32
-sparcPciCfgRead32(PCITAG tag, int off)
-{
- pciBusInfo_t *pBusInfo;
- sparcDomainPtr pDomain;
- volatile CARD32 result = (CARD32)(-1); /* Must be volatile */
- int bus;
-
- if ((off >= 0) && (off <= 252) && !(off & 3) &&
- ((bus = PCI_BUS_FROM_TAG(tag)) < pciNumBuses) &&
- (pBusInfo = pciBusInfo[bus]) && (pDomain = pBusInfo->pciBusPriv) &&
- (bus >= pDomain->bus_min) && (bus < pDomain->bus_max) &&
- ((bus > pDomain->bus_min) ||
- IsBitSetInMap(PCI_DFN_FROM_TAG(tag), pDomain->dfn_mask))) {
- result = PciReg(pDomain->pci, tag, off, CARD32);
-
- result = PCI_CPU(result);
- }
-
- return result;
-}
-
-static void
-sparcPciCfgWrite32(PCITAG tag, int off, CARD32 val)
-{
- pciBusInfo_t *pBusInfo;
- sparcDomainPtr pDomain;
- int bus;
-
- if ((off < 0) || (off > 252) || (off & 3) ||
- ((bus = PCI_BUS_FROM_TAG(tag)) >= pciNumBuses) ||
- !(pBusInfo = pciBusInfo[bus]) || !(pDomain = pBusInfo->pciBusPriv) ||
- (bus < pDomain->bus_min) || (bus >= pDomain->bus_max) ||
- ((bus == pDomain->bus_min) &&
- !IsBitSetInMap(PCI_DFN_FROM_TAG(tag), pDomain->dfn_mask)))
- return;
-
- val = PCI_CPU(val);
- PciReg(pDomain->pci, tag, off, CARD32) = val;
-}
-
-static void
-sparcPciCfgSetBits32(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- CARD32 PciVal;
-
- PciVal = sparcPciCfgRead32(tag, off);
- PciVal &= ~mask;
- PciVal |= bits;
- sparcPciCfgWrite32(tag, off, PciVal);
-}
-
-static pciBusFuncs_t sparcPCIFunctions =
-{
- sparcPciCfgRead32,
- sparcPciCfgWrite32,
- sparcPciCfgSetBits32,
- pciAddrNOOP,
- pciAddrNOOP
-};
-
-/*
- * Sabre-specific versions of the above because of its peculiar access size
- * requirements.
- */
-static CARD32
-sabrePciCfgRead32(PCITAG tag, int off)
-{
- pciBusInfo_t *pBusInfo;
- sparcDomainPtr pDomain;
- volatile CARD32 result; /* Must be volatile */
- int bus;
-
- if (PCI_BDEV_FROM_TAG(tag))
- return sparcPciCfgRead32(tag, off);
-
- if (PCI_FUNC_FROM_TAG(tag) || (off < 0) || (off > 252) || (off & 3) ||
- ((bus = PCI_BUS_FROM_TAG(tag)) >= pciNumBuses) ||
- !(pBusInfo = pciBusInfo[bus]) || !(pDomain = pBusInfo->pciBusPriv) ||
- (bus != pDomain->bus_min))
- return (CARD32)(-1);
-
- if (off < 8) {
- result = (PciReg(pDomain->pci, tag, off, CARD16) << 16) |
- PciReg(pDomain->pci, tag, off + 2, CARD16);
- return PCI_CPU(result);
- }
-
- result = (PciReg(pDomain->pci, tag, off + 3, CARD8) << 24) |
- (PciReg(pDomain->pci, tag, off + 2, CARD8) << 16) |
- (PciReg(pDomain->pci, tag, off + 1, CARD8) << 8) |
- (PciReg(pDomain->pci, tag, off , CARD8) );
- return result;
-}
-
-static void
-sabrePciCfgWrite32(PCITAG tag, int off, CARD32 val)
-{
- pciBusInfo_t *pBusInfo;
- sparcDomainPtr pDomain;
- int bus;
-
- if (PCI_BDEV_FROM_TAG(tag))
- sparcPciCfgWrite32(tag, off, val);
- else if (!PCI_FUNC_FROM_TAG(tag) &&
- (off >= 0) && (off <= 252) && !(off & 3) &&
- ((bus = PCI_BUS_FROM_TAG(tag)) < pciNumBuses) &&
- (pBusInfo = pciBusInfo[bus]) &&
- (pDomain = pBusInfo->pciBusPriv) &&
- (bus == pDomain->bus_min)) {
- if (off < 8) {
- val = PCI_CPU(val);
- PciReg(pDomain->pci, tag, off , CARD16) = val >> 16;
- PciReg(pDomain->pci, tag, off + 2, CARD16) = val;
- } else {
- PciReg(pDomain->pci, tag, off , CARD8) = val;
- PciReg(pDomain->pci, tag, off + 1, CARD8) = val >> 8;
- PciReg(pDomain->pci, tag, off + 2, CARD8) = val >> 16;
- PciReg(pDomain->pci, tag, off + 3, CARD8) = val >> 24;
- }
- }
-}
-
-static void
-sabrePciCfgSetBits32(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- CARD32 PciVal;
-
- PciVal = sabrePciCfgRead32(tag, off);
- PciVal &= ~mask;
- PciVal |= bits;
- sabrePciCfgWrite32(tag, off, PciVal);
-}
-
-static pciBusFuncs_t sabrePCIFunctions =
-{
- sabrePciCfgRead32,
- sabrePciCfgWrite32,
- sabrePciCfgSetBits32,
- pciAddrNOOP,
- pciAddrNOOP
-};
-
-static int pagemask;
-
-/* Scan PROM for all PCI host bridges in the system */
-void
-sparcPciInit(void)
-{
- int node, node2;
-
- if (!xf86LinearVidMem())
- return;
-
- apertureFd = open(apertureDevName, O_RDWR);
- if (apertureFd < 0) {
- xf86Msg(X_ERROR,
- "sparcPciInit: open failure: %s\n", strerror(errno));
- return;
- }
-
- sparcPromInit();
- pagemask = xf86getpagesize() - 1;
-
- for (node = promGetChild(promRootNode);
- node;
- node = promGetSibling(node)) {
- unsigned long long pci_addr;
- sparcDomainRec domain;
- sparcDomainPtr pDomain;
- pciBusFuncs_p pFunctions;
- char *prop_val;
- int prop_len, bus;
-
- prop_val = promGetProperty("name", &prop_len);
- /* Some PROMs include the trailing null; some don't */
- if (!prop_val || (prop_len < 3) || (prop_len > 4) ||
- strcmp(prop_val, "pci"))
- continue;
-
- prop_val = promGetProperty("model", &prop_len);
- if (!prop_val || (prop_len <= 0)) {
- prop_val = promGetProperty("compatible", &prop_len);
- if (!prop_val || (prop_len <= 0))
- continue;
- }
-
- pFunctions = &sparcPCIFunctions;
- (void)memset(&domain, 0, sizeof(domain));
-
- if (!strncmp("SUNW,sabre", prop_val, prop_len) ||
- !strncmp("pci108e,a000", prop_val, prop_len) ||
- !strncmp("pci108e,a001", prop_val, prop_len)) {
- /*
- * There can only be one "Sabre" bridge in a system. It provides
- * PCI configuration space, a 24-bit I/O space and a 32-bit memory
- * space, all three of which are at fixed physical CPU addresses.
- */
- static Bool sabre_seen = FALSE;
-
- xf86Msg(X_INFO,
- "Sabre or Hummingbird PCI host bridge found (\"%s\")\n",
- prop_val);
-
- /* There can only be one Sabre */
- if (sabre_seen)
- continue;
- sabre_seen = TRUE;
-
- /* Get "bus-range" property */
- prop_val = promGetProperty("bus-range", &prop_len);
- if (!prop_val || (prop_len != 8) ||
- (((unsigned int *)prop_val)[0]) ||
- (((unsigned int *)prop_val)[1] >= 256))
- continue;
-
- pci_addr = 0x01fe01000000ull;
- domain.io_addr = 0x01fe02000000ull;
- domain.io_size = 0x000001000000ull;
- domain.mem_addr = 0x01ff00000000ull;
- domain.mem_size = 0x000100000000ull;
- domain.bus_min = 0; /* Always */
- domain.bus_max = ((int *)prop_val)[1];
-
- pFunctions = &sabrePCIFunctions;
- } else
- if (!strncmp("SUNW,psycho", prop_val, prop_len) ||
- !strncmp("pci108e,8000", prop_val, prop_len)) {
- /*
- * A "Psycho" host bridge provides two PCI interfaces, each with
- * its own 16-bit I/O and 31-bit memory spaces. Both share the
- * same PCI configuration space. Here, they are assigned separate
- * domain numbers to prevent unintentional I/O and/or memory
- * resource conflicts.
- */
- xf86Msg(X_INFO,
- "Psycho PCI host bridge found (\"%s\")\n", prop_val);
-
- /* Get "bus-range" property */
- prop_val = promGetProperty("bus-range", &prop_len);
- if (!prop_val || (prop_len != 8) ||
- (((unsigned int *)prop_val)[1] >= 256) ||
- (((unsigned int *)prop_val)[0] > ((unsigned int *)prop_val)[1]))
- continue;
-
- domain.bus_min = ((int *)prop_val)[0];
- domain.bus_max = ((int *)prop_val)[1];
-
- /* Get "ranges" property */
- prop_val = promGetProperty("ranges", &prop_len);
- if (!prop_val || (prop_len != 112) ||
- prop_val[0] || (prop_val[28] != 0x01u) ||
- (prop_val[56] != 0x02u) || (prop_val[84] != 0x03u) ||
- (((unsigned int *)prop_val)[4] != 0x01000000u) ||
- ((unsigned int *)prop_val)[5] ||
- ((unsigned int *)prop_val)[12] ||
- (((unsigned int *)prop_val)[13] != 0x00010000u) ||
- ((unsigned int *)prop_val)[19] ||
- (((unsigned int *)prop_val)[20] != 0x80000000u) ||
- ((((unsigned int *)prop_val)[11] & ~0x00010000u) !=
- 0x02000000u) ||
- (((unsigned int *)prop_val)[18] & ~0x80000000u) ||
- (((unsigned int *)prop_val)[3] !=
- ((unsigned int *)prop_val)[10]) ||
- (((unsigned int *)prop_val)[17] !=
- ((unsigned int *)prop_val)[24]) ||
- (((unsigned int *)prop_val)[18] !=
- ((unsigned int *)prop_val)[25]) ||
- (((unsigned int *)prop_val)[19] !=
- ((unsigned int *)prop_val)[26]) ||
- (((unsigned int *)prop_val)[20] !=
- ((unsigned int *)prop_val)[27]))
- continue;
-
- /* Use memcpy() to avoid alignment issues */
- (void)memcpy(&pci_addr, prop_val + 12,
- sizeof(pci_addr));
- (void)memcpy(&domain.io_addr, prop_val + 40,
- sizeof(domain.io_addr));
- (void)memcpy(&domain.mem_addr, prop_val + 68,
- sizeof(domain.mem_addr));
-
- domain.io_size = 0x000000010000ull;
- domain.mem_size = 0x000080000000ull;
- } else
- if (!strncmp("SUNW,schizo", prop_val, prop_len) ||
- !strncmp("pci108e,8001", prop_val, prop_len)) {
- /*
- * I have no docs on the "Schizo", but judging from the Linux
- * kernel, it also provides two PCI domains. Each PCI
- * configuration space is the usual 16M in size, followed by a
- * variable-length I/O space. Each domain also provides a
- * variable-length memory space. The kernel seems to think the I/O
- * spaces are 16M long, and the memory spaces, 2G, but these
- * assumptions are actually only present in source code comments.
- * Sun has, however, confirmed to me the validity of these
- * assumptions.
- */
- volatile unsigned long long mem_match, mem_mask, io_match, io_mask;
- unsigned long Offset;
- pointer pSchizo;
-
- xf86Msg(X_INFO,
- "Schizo PCI host bridge found (\"%s\")\n", prop_val);
-
- /* Get "bus-range" property */
- prop_val = promGetProperty("bus-range", &prop_len);
- if (!prop_val || (prop_len != 8) ||
- (((unsigned int *)prop_val)[1] >= 256) ||
- (((unsigned int *)prop_val)[0] > ((unsigned int *)prop_val)[1]))
- continue;
-
- domain.bus_min = ((int *)prop_val)[0];
- domain.bus_max = ((int *)prop_val)[1];
-
- /* Get "reg" property */
- prop_val = promGetProperty("reg", &prop_len);
- if (!prop_val || (prop_len != 48))
- continue;
-
- /* Temporarily map some of Schizo's registers */
- pSchizo = sparcMapAperture(-1, VIDMEM_MMIO,
- ((unsigned long long *)prop_val)[2] - 0x000000010000ull,
- 0x00010000ul);
-
- /* Determine where PCI config, I/O and memory spaces reside */
- if ((((unsigned long long *)prop_val)[0] & 0x000000700000ull) ==
- 0x000000600000ull)
- Offset = 0x0040;
- else
- Offset = 0x0060;
-
- mem_match = PciReg(pSchizo, 0, Offset, unsigned long long);
- mem_mask = PciReg(pSchizo, 0, Offset + 8, unsigned long long);
- io_match = PciReg(pSchizo, 0, Offset + 16, unsigned long long);
- io_mask = PciReg(pSchizo, 0, Offset + 24, unsigned long long);
-
- /* Unmap Schizo registers */
- xf86UnMapVidMem(-1, pSchizo, 0x00010000ul);
-
- /* Calculate sizes */
- mem_mask = (((mem_mask - 1) ^ mem_mask) >> 1) + 1;
- io_mask = (((io_mask - 1) ^ io_mask ) >> 1) + 1;
-
- if (io_mask <= 0x000001000000ull) /* Nothing left for I/O */
- continue;
-
- domain.mem_addr = mem_match & ~0x8000000000000000ull;
- domain.mem_size = mem_mask;
- pci_addr = io_match & ~0x8000000000000000ull;
- domain.io_addr = pci_addr + 0x0000000001000000ull;
- domain.io_size = io_mask - 0x0000000001000000ull;
- } else {
- xf86Msg(X_WARNING, "Unknown PCI host bridge: \"%s\"\n", prop_val);
- continue;
- }
-
- /* Only map as much PCI configuration as we need */
- domain.pci = (char *)sparcMapAperture(-1, VIDMEM_MMIO,
- pci_addr + PCI_MAKE_TAG(domain.bus_min, 0, 0),
- PCI_MAKE_TAG(domain.bus_max - domain.bus_min + 1, 0, 0)) -
- PCI_MAKE_TAG(domain.bus_min, 0, 0);
-
- /* Allocate a domain record */
- pDomain = xnfalloc(sizeof(sparcDomainRec));
- *pDomain = domain;
-
- /*
- * Allocate and prime pciBusInfo records. These are allocated one at a
- * time because those for empty buses are eventually released.
- */
- bus = pDomain->bus_min =
- PCI_MAKE_BUS(pciNumDomains, domain.bus_min);
- pciNumBuses = pDomain->bus_max =
- PCI_MAKE_BUS(pciNumDomains, domain.bus_max) + 1;
-
- pciBusInfo[bus] = xnfcalloc(1, sizeof(pciBusInfo_t));
- pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER;
- pciBusInfo[bus]->numDevices = 32;
- pciBusInfo[bus]->funcs = pFunctions;
- pciBusInfo[bus]->pciBusPriv = pDomain;
- while (++bus < pciNumBuses) {
- pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t));
- *(pciBusInfo[bus]) = *(pciBusInfo[bus - 1]);
- pciBusInfo[bus]->funcs = &sparcPCIFunctions;
- }
-
- /* Next domain, please... */
- xf86DomainInfo[pciNumDomains++] = pDomain;
-
- /*
- * OK, enough of the straight-forward stuff. Time to deal with some
- * brokenness...
- *
- * The PCI specs require that when a bus transaction remains unclaimed
- * for too long, the master entity on that bus is to cancel the
- * transaction it issued or passed on with a master abort. Two
- * outcomes are possible:
- *
- * - the master abort can be treated as an error that is propogated
- * back through the bus tree to the entity that ultimately originated
- * the transaction; or
- * - the transaction can be allowed to complete normally, which means
- * that writes are ignored and reads return all ones.
- *
- * In the first case, if the CPU happens to be at the tail end of the
- * tree path through one of its host bridges, it will be told there is
- * a hardware mal-function, despite being generated by software.
- *
- * For a software function (be it firmware, OS or userland application)
- * to determine how a PCI bus tree is populated, it must be able to
- * detect when master aborts occur. Obviously, PCI discovery is much
- * simpler when master aborts are allowed to complete normally.
- *
- * Unfortunately, a number of non-Intel PCI implementations have chosen
- * to treat master aborts as severe errors. The net effect is to
- * cripple PCI discovery algorithms in userland.
- *
- * On SPARCs, master aborts cause a number of different behaviours,
- * including delivering a signal to the userland application, rebooting
- * the system, "dropping down" to firmware, or, worst of all, bus
- * lockouts. Even in the first case, the SIGBUS signal that is
- * eventually generated isn't delivered in a timely enough fashion to
- * allow an application to reliably detect the master abort that
- * ultimately caused it.
- *
- * This can be somewhat mitigated. On all architectures, master aborts
- * that occur on secondary buses can be forced to complete normally
- * because the PCI-to-PCI bridges that serve them are governed by an
- * industry-wide specification. (This is just another way of saying
- * that whatever justification there might be for erroring out master
- * aborts is deemed by the industry as insufficient to generate more
- * PCI non-compliance than there already is...)
- *
- * This leaves us with master aborts that occur on primary buses.
- * There is no specification for host-to-PCI bridges. Bridges used in
- * SPARCs can be told to ignore all PCI errors, but not specifically
- * master aborts. Not only is this too coarse-grained, but
- * master-aborted read transactions on the primary bus end up returning
- * garbage rather than all ones.
- *
- * I have elected to work around this the only way I can think of doing
- * so right now. The following scans an additional PROM level and
- * builds a device/function map for the primary bus. I can only hope
- * this PROM information represents all devices on the primary bus,
- * rather than only a subset of them.
- *
- * Master aborts are useful in other ways too, that are not addressed
- * here. These include determining whether or not a domain provides
- * VGA, or if a PCI device actually implements PCI disablement.
- *
- * --- TSI @ UQV 2001.09.19
- */
- for (node2 = promGetChild(node);
- node2;
- node2 = promGetSibling(node2)) {
- /* Get "reg" property */
- prop_val = promGetProperty("reg", &prop_len);
- if (!prop_val || (prop_len % 20))
- continue;
-
- /*
- * It's unnecessary to scan the entire "reg" property, but I'll do
- * so anyway.
- */
- prop_len /= 20;
- for (; prop_len--; prop_val += 20)
- SetBitInMap(PCI_DFN_FROM_TAG(*(PCITAG *)prop_val),
- pDomain->dfn_mask);
- }
-
- /* Assume the host bridge is device 0, function 0 on its bus */
- SetBitInMap(0, pDomain->dfn_mask);
- }
-
- sparcPromClose();
-
- close(apertureFd);
- apertureFd = -1;
-}
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
-
-int
-xf86GetPciDomain(PCITAG Tag)
-{
- return PCI_DOM_FROM_TAG(Tag);
-}
-
-pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size)
-{
- sparcDomainPtr pDomain;
- pointer result;
- int domain = PCI_DOM_FROM_TAG(Tag);
-
- if ((domain <= 0) || (domain >= pciNumDomains) ||
- !(pDomain = xf86DomainInfo[domain]) ||
- (((unsigned long long)Base + (unsigned long long)Size) >
- pDomain->mem_size))
- FatalError("xf86MapDomainMemory() called with invalid parameters.\n");
-
- result = sparcMapAperture(ScreenNum, Flags, pDomain->mem_addr + Base, Size);
-
- if (apertureFd >= 0) {
- close(apertureFd);
- apertureFd = -1;
- }
-
- return result;
-}
-
-IOADDRESS
-xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
- IOADDRESS Base, unsigned long Size)
-{
- sparcDomainPtr pDomain;
- int domain = PCI_DOM_FROM_TAG(Tag);
-
- if ((domain <= 0) || (domain >= pciNumDomains) ||
- !(pDomain = xf86DomainInfo[domain]) ||
- (((unsigned long long)Base + (unsigned long long)Size) >
- pDomain->io_size))
- FatalError("xf86MapDomainIO() called with invalid parameters.\n");
-
- /* Permanently map all of I/O space */
- if (!pDomain->io) {
- pDomain->io = sparcMapAperture(ScreenNum, Flags,
- pDomain->io_addr, pDomain->io_size);
-
- if (apertureFd >= 0) {
- close(apertureFd);
- apertureFd = -1;
- }
- }
-
- return (IOADDRESS)pDomain->io + Base;
-}
-
-int
-xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
-{
- unsigned char *ptr, *src;
- ADDRESS offset;
- unsigned long size;
- int len;
-
- /* Ensure page boundaries */
- offset = Base & ~pagemask;
- size = ((Base + Len + pagemask) & ~pagemask) - offset;
-
- ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, Tag, offset, size);
-
- /* Using memcpy() here hangs the system */
- src = ptr + (Base - offset);
- for (len = Len; len-- > 0;)
- *Buf++ = *src++;
-
- xf86UnMapVidMem(-1, ptr, size);
-
- return Len;
-}
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- sparcDomainPtr pDomain;
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for (domain = 1; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain]))
- continue;
-
- RANGE(range, 0, pDomain->mem_size - 1,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, pDomain->io_size - 1,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- sparcDomainPtr pDomain;
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for (domain = 1; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain]))
- continue;
-
- RANGE(range, 0, pDomain->mem_size - 1,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, pDomain->io_size - 1,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
-xf86AccResFromOS(resPtr pRes)
-{
- sparcDomainPtr pDomain;
- resRange range;
- int domain;
-
- for (domain = 1; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain]))
- continue;
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000u, 0x0009ffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000c0000u, 0x000effffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, 0x000f0000u, 0x000fffffu,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, pDomain->mem_size - 1, pDomain->mem_size - 1,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0x00000000u, 0x00000000u,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- RANGE(range, pDomain->io_size - 1, pDomain->io_size - 1,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-#endif /* !INCLUDE_XF86_NO_DOMAIN */
-
-#endif /* defined(sun) */
-
-#if defined(ARCH_PCI_PCI_BRIDGE)
-
-/* Definitions specific to Sun's APB P2P bridge (a.k.a. Simba) */
-#define APB_IO_ADDRESS_MAP 0xDE
-#define APB_MEM_ADDRESS_MAP 0xDF
-
-/*
- * Simba's can only occur on bus 0. Furthermore, Simba's must have a non-zero
- * device/function number because the Sabre interface they must connect to
- * occupies the 0:0:0 slot. Also, there can be only one Sabre interface in the
- * system, and therefore, only one Simba function can route any particular
- * resource. Thus, it is appropriate to use a single set of static variables
- * to hold the tag of the Simba function routing a VGA resource range at any
- * one time, and to test these variables for non-zero to determine whether or
- * not the Sabre would master-abort a VGA access (and kill the system).
- *
- * The trick is to determine when it is safe to re-route VGA, because doing so
- * re-routes much more.
- */
-static PCITAG simbavgaIOTag = 0, simbavgaMemTag = 0;
-static Bool simbavgaRoutingAllow = TRUE;
-
-/*
- * Scan the bus subtree rooted at 'bus' for a non-display device that might be
- * decoding the bottom 2 MB of I/O space and/or the bottom 512 MB of memory
- * space. Reset simbavgaRoutingAllow if such a device is found.
- *
- * XXX For now, this is very conservative and should be made less so as the
- * need arises.
- */
-static void
-simbaCheckBus(CARD16 pcicommand, int bus)
-{
- pciConfigPtr pPCI, *ppPCI = xf86scanpci(0);
-
- while ((pPCI = *ppPCI++)) {
- if (pPCI->busnum < bus)
- continue;
- if (pPCI->busnum > bus)
- break;
-
- /* XXX Assume all devices respect PCI disablement */
- if (!(pcicommand & pPCI->pci_command))
- continue;
-
- /* XXX This doesn't deal with mis-advertised classes */
- switch (pPCI->pci_base_class) {
- case PCI_CLASS_PREHISTORIC:
- if (pPCI->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
- continue; /* Ignore VGA */
- break;
-
- case PCI_CLASS_DISPLAY:
- continue;
-
- case PCI_CLASS_BRIDGE:
- switch (pPCI->pci_sub_class) {
- case PCI_SUBCLASS_BRIDGE_PCI:
- case PCI_SUBCLASS_BRIDGE_CARDBUS:
- /* Scan secondary bus */
- /* XXX First check bridge routing? */
- simbaCheckBus(pcicommand & pPCI->pci_command,
- PCI_SECONDARY_BUS_EXTRACT(pPCI->pci_pp_bus_register,
- pPCI->tag));
- if (!simbavgaRoutingAllow)
- return;
-
- default:
- break;
- }
-
- default:
- break;
- }
-
- /*
- * XXX We could check the device's bases here, but PCI doesn't limit
- * the device's decoding to them.
- */
-
- simbavgaRoutingAllow = FALSE;
- break;
- }
-}
-
-static pciConfigPtr
-simbaVerifyBus(int bus)
-{
- pciConfigPtr pPCI;
- if ((bus < 0) || (bus >= pciNumBuses) ||
- !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
- (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA)))
- return NULL;
-
- return pPCI;
-}
-
-static CARD16
-simbaControlBridge(int bus, CARD16 mask, CARD16 value)
-{
- pciConfigPtr pPCI;
- CARD16 current = 0, tmp;
- CARD8 iomap, memmap;
-
- if ((pPCI = simbaVerifyBus(bus))) {
- /*
- * The Simba does not implement VGA enablement as described in the P2P
- * spec. It does however route I/O and memory in large enough chunks
- * so that we can determine were VGA resources would be routed
- * (including ISA VGA I/O aliases). We can allow changes to that
- * routing only under certain circumstances.
- */
- iomap = pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP);
- memmap = pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP);
- if (iomap & memmap & 0x01) {
- current |= PCI_PCI_BRIDGE_VGA_EN;
- if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
- !(value & PCI_PCI_BRIDGE_VGA_EN)) {
- if (!simbavgaRoutingAllow) {
- xf86MsgVerb(X_WARNING, 3, "Attempt to disable VGA routing"
- " through Simba at %x:%x:%x disallowed.\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum);
- value |= PCI_PCI_BRIDGE_VGA_EN;
- } else {
- pciWriteByte(pPCI->tag, APB_IO_ADDRESS_MAP,
- iomap & ~0x01);
- pciWriteByte(pPCI->tag, APB_MEM_ADDRESS_MAP,
- memmap & ~0x01);
- simbavgaIOTag = simbavgaMemTag = 0;
- }
- }
- } else {
- if (mask & value & PCI_PCI_BRIDGE_VGA_EN) {
- if (!simbavgaRoutingAllow) {
- xf86MsgVerb(X_WARNING, 3, "Attempt to enable VGA routing"
- " through Simba at %x:%x:%x disallowed.\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum);
- value &= ~PCI_PCI_BRIDGE_VGA_EN;
- } else {
- if (pPCI->tag != simbavgaIOTag) {
- if (simbavgaIOTag) {
- tmp = pciReadByte(simbavgaIOTag,
- APB_IO_ADDRESS_MAP);
- pciWriteByte(simbavgaIOTag, APB_IO_ADDRESS_MAP,
- tmp & ~0x01);
- }
-
- pciWriteByte(pPCI->tag, APB_IO_ADDRESS_MAP,
- iomap | 0x01);
- simbavgaIOTag = pPCI->tag;
- }
-
- if (pPCI->tag != simbavgaMemTag) {
- if (simbavgaMemTag) {
- tmp = pciReadByte(simbavgaMemTag,
- APB_MEM_ADDRESS_MAP);
- pciWriteByte(simbavgaMemTag, APB_MEM_ADDRESS_MAP,
- tmp & ~0x01);
- }
-
- pciWriteByte(pPCI->tag, APB_MEM_ADDRESS_MAP,
- memmap | 0x01);
- simbavgaMemTag = pPCI->tag;
- }
- }
- }
- }
-
- /* Move on to master abort failure enablement (as per P2P spec) */
- tmp = pciReadWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG);
- current |= tmp;
- if (tmp & PCI_PCI_BRIDGE_MASTER_ABORT_EN) {
- if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
- !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
- pciWriteWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG,
- tmp & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
- } else {
- if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
- pciWriteWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG,
- tmp | PCI_PCI_BRIDGE_MASTER_ABORT_EN);
- }
-
- /* Insert emulation of other P2P controls here */
- }
-
- return (current & ~mask) | (value & mask);
-}
-
-static void
-simbaGetBridgeResources(int bus,
- pointer *ppIoRes,
- pointer *ppMemRes,
- pointer *ppPmemRes)
-{
- pciConfigPtr pPCI = simbaVerifyBus(bus);
- resRange range;
- int i;
-
- if (!pPCI)
- return;
-
- if (ppIoRes) {
- xf86FreeResList(*ppIoRes);
- *ppIoRes = NULL;
-
- if (pPCI->pci_command & PCI_CMD_IO_ENABLE) {
- unsigned char iomap = pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP);
- if (simbavgaRoutingAllow)
- iomap |= 0x01;
- for (i = 0; i < 8; i++) {
- if (iomap & (1 << i)) {
- RANGE(range, i << 21, ((i + 1) << 21) - 1,
- RANGE_TYPE(ResExcIoBlock,
- xf86GetPciDomain(pPCI->tag)));
- *ppIoRes = xf86AddResToList(*ppIoRes, &range, -1);
- }
- }
- }
- }
-
- if (ppMemRes) {
- xf86FreeResList(*ppMemRes);
- *ppMemRes = NULL;
-
- if (pPCI->pci_command & PCI_CMD_MEM_ENABLE) {
- unsigned char memmap = pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP);
- if (simbavgaRoutingAllow)
- memmap |= 0x01;
- for (i = 0; i < 8; i++) {
- if (memmap & (1 << i)) {
- RANGE(range, i << 29, ((i + 1) << 29) - 1,
- RANGE_TYPE(ResExcMemBlock,
- xf86GetPciDomain(pPCI->tag)));
- *ppMemRes = xf86AddResToList(*ppMemRes, &range, -1);
- }
- }
- }
- }
-
- if (ppPmemRes) {
- xf86FreeResList(*ppPmemRes);
- *ppPmemRes = NULL;
- }
-}
-
-void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI)
-{
- static pciBusFuncs_t simbaBusFuncs;
- pciBusInfo_t *pBusInfo;
- CARD16 pcicommand;
-
- if (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA))
- return;
-
- pBusInfo = pPCI->businfo;
-
- simbaBusFuncs = *(pBusInfo->funcs);
- simbaBusFuncs.pciControlBridge = simbaControlBridge;
- simbaBusFuncs.pciGetBridgeResources = simbaGetBridgeResources;
-
- pBusInfo->funcs = &simbaBusFuncs;
-
- if (!simbavgaRoutingAllow)
- return;
-
- pcicommand = 0;
-
- if (pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP) & 0x01) {
- pcicommand |= PCI_CMD_IO_ENABLE;
- simbavgaIOTag = pPCI->tag;
- }
-
- if (pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP) & 0x01) {
- pcicommand |= PCI_CMD_MEM_ENABLE;
- simbavgaMemTag = pPCI->tag;
- }
-
- if (!pcicommand)
- return;
-
- simbaCheckBus(pcicommand,
- PCI_SECONDARY_BUS_EXTRACT(pPCI->pci_pp_bus_register, pPCI->tag));
-}
-
-#endif /* defined(ARCH_PCI_PCI_BRIDGE) */
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
deleted file mode 100644
index f2b5c0727..000000000
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ /dev/null
@@ -1,807 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.39 2003/08/24 17:37:05 dawes Exp $ */
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * This file is derived in part from the original xf86_PCI.h that included
- * following copyright message:
- *
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * This file contains just the public interface to the PCI code.
- * Drivers should use this file rather than Pci.h.
- */
-
-#ifndef _XF86PCI_H
-#define _XF86PCI_H 1
-#include "Xarch.h"
-#include "Xfuncproto.h"
-#include "misc.h"
-
-#define PCI_NOT_FOUND 0xFFFFFFFFU
-
-/*
- * PCI cfg space definitions (e.g. stuff right out of the PCI spec)
- */
-
-/* Device identification register */
-#define PCI_ID_REG 0x00
-
-/* Command and status register */
-#define PCI_CMD_STAT_REG 0x04
-#define PCI_CMD_BASE_REG 0x10
-#define PCI_CMD_BIOS_REG 0x30
-#define PCI_CMD_MASK 0xffff
-#define PCI_CMD_IO_ENABLE 0x01
-#define PCI_CMD_MEM_ENABLE 0x02
-#define PCI_CMD_MASTER_ENABLE 0x04
-#define PCI_CMD_SPECIAL_ENABLE 0x08
-#define PCI_CMD_INVALIDATE_ENABLE 0x10
-#define PCI_CMD_PALETTE_ENABLE 0x20
-#define PCI_CMD_PARITY_ENABLE 0x40
-#define PCI_CMD_STEPPING_ENABLE 0x80
-#define PCI_CMD_SERR_ENABLE 0x100
-#define PCI_CMD_BACKTOBACK_ENABLE 0x200
-#define PCI_CMD_BIOS_ENABLE 0x01
-
-/* base class */
-#define PCI_CLASS_REG 0x08
-#define PCI_CLASS_MASK 0xff000000
-#define PCI_CLASS_SHIFT 24
-#define PCI_CLASS_EXTRACT(x) \
- (((x) & PCI_CLASS_MASK) >> PCI_CLASS_SHIFT)
-
-/* base class values */
-#define PCI_CLASS_PREHISTORIC 0x00
-#define PCI_CLASS_MASS_STORAGE 0x01
-#define PCI_CLASS_NETWORK 0x02
-#define PCI_CLASS_DISPLAY 0x03
-#define PCI_CLASS_MULTIMEDIA 0x04
-#define PCI_CLASS_MEMORY 0x05
-#define PCI_CLASS_BRIDGE 0x06
-#define PCI_CLASS_COMMUNICATIONS 0x07
-#define PCI_CLASS_SYSPERIPH 0x08
-#define PCI_CLASS_INPUT 0x09
-#define PCI_CLASS_DOCKING 0x0a
-#define PCI_CLASS_PROCESSOR 0x0b
-#define PCI_CLASS_SERIALBUS 0x0c
-#define PCI_CLASS_WIRELESS 0x0d
-#define PCI_CLASS_I2O 0x0e
-#define PCI_CLASS_SATELLITE 0x0f
-#define PCI_CLASS_CRYPT 0x10
-#define PCI_CLASS_DATA_ACQUISTION 0x11
-#define PCI_CLASS_UNDEFINED 0xff
-
-/* sub class */
-#define PCI_SUBCLASS_MASK 0x00ff0000
-#define PCI_SUBCLASS_SHIFT 16
-#define PCI_SUBCLASS_EXTRACT(x) \
- (((x) & PCI_SUBCLASS_MASK) >> PCI_SUBCLASS_SHIFT)
-
-/* Sub class values */
-/* 0x00 prehistoric subclasses */
-#define PCI_SUBCLASS_PREHISTORIC_MISC 0x00
-#define PCI_SUBCLASS_PREHISTORIC_VGA 0x01
-
-/* 0x01 mass storage subclasses */
-#define PCI_SUBCLASS_MASS_STORAGE_SCSI 0x00
-#define PCI_SUBCLASS_MASS_STORAGE_IDE 0x01
-#define PCI_SUBCLASS_MASS_STORAGE_FLOPPY 0x02
-#define PCI_SUBCLASS_MASS_STORAGE_IPI 0x03
-#define PCI_SUBCLASS_MASS_STORAGE_MISC 0x80
-
-/* 0x02 network subclasses */
-#define PCI_SUBCLASS_NETWORK_ETHERNET 0x00
-#define PCI_SUBCLASS_NETWORK_TOKENRING 0x01
-#define PCI_SUBCLASS_NETWORK_FDDI 0x02
-#define PCI_SUBCLASS_NETWORK_MISC 0x80
-
-/* 0x03 display subclasses */
-#define PCI_SUBCLASS_DISPLAY_VGA 0x00
-#define PCI_SUBCLASS_DISPLAY_XGA 0x01
-#define PCI_SUBCLASS_DISPLAY_MISC 0x80
-
-/* 0x04 multimedia subclasses */
-#define PCI_SUBCLASS_MULTIMEDIA_VIDEO 0x00
-#define PCI_SUBCLASS_MULTIMEDIA_AUDIO 0x01
-#define PCI_SUBCLASS_MULTIMEDIA_MISC 0x80
-
-/* 0x05 memory subclasses */
-#define PCI_SUBCLASS_MEMORY_RAM 0x00
-#define PCI_SUBCLASS_MEMORY_FLASH 0x01
-#define PCI_SUBCLASS_MEMORY_MISC 0x80
-
-/* 0x06 bridge subclasses */
-#define PCI_SUBCLASS_BRIDGE_HOST 0x00
-#define PCI_SUBCLASS_BRIDGE_ISA 0x01
-#define PCI_SUBCLASS_BRIDGE_EISA 0x02
-#define PCI_SUBCLASS_BRIDGE_MC 0x03
-#define PCI_SUBCLASS_BRIDGE_PCI 0x04
-#define PCI_SUBCLASS_BRIDGE_PCMCIA 0x05
-#define PCI_SUBCLASS_BRIDGE_NUBUS 0x06
-#define PCI_SUBCLASS_BRIDGE_CARDBUS 0x07
-#define PCI_SUBCLASS_BRIDGE_RACEWAY 0x08
-#define PCI_SUBCLASS_BRIDGE_MISC 0x80
-#define PCI_IF_BRIDGE_PCI_SUBTRACTIVE 0x01
-
-/* 0x07 communications controller subclasses */
-#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00
-#define PCI_SUBCLASS_COMMUNICATIONS_PARALLEL 0x01
-#define PCI_SUBCLASS_COMMUNICATIONS_MULTISERIAL 0x02
-#define PCI_SUBCLASS_COMMUNICATIONS_MODEM 0x03
-#define PCI_SUBCLASS_COMMUNICATIONS_MISC 0x80
-
-/* 0x08 generic system peripherals subclasses */
-#define PCI_SUBCLASS_SYSPERIPH_PIC 0x00
-#define PCI_SUBCLASS_SYSPERIPH_DMA 0x01
-#define PCI_SUBCLASS_SYSPERIPH_TIMER 0x02
-#define PCI_SUBCLASS_SYSPERIPH_RTC 0x03
-#define PCI_SUBCLASS_SYSPERIPH_HOTPCI 0x04
-#define PCI_SUBCLASS_SYSPERIPH_MISC 0x80
-
-/* 0x09 input device subclasses */
-#define PCI_SUBCLASS_INPUT_KEYBOARD 0x00
-#define PCI_SUBCLASS_INPUT_DIGITIZER 0x01
-#define PCI_SUBCLASS_INPUT_MOUSE 0x02
-#define PCI_SUBCLASS_INPUT_SCANNER 0x03
-#define PCI_SUBCLASS_INPUT_GAMEPORT 0x04
-#define PCI_SUBCLASS_INPUT_MISC 0x80
-
-/* 0x0a docking station subclasses */
-#define PCI_SUBCLASS_DOCKING_GENERIC 0x00
-#define PCI_SUBCLASS_DOCKING_MISC 0x80
-
-/* 0x0b processor subclasses */
-#define PCI_SUBCLASS_PROCESSOR_386 0x00
-#define PCI_SUBCLASS_PROCESSOR_486 0x01
-#define PCI_SUBCLASS_PROCESSOR_PENTIUM 0x02
-#define PCI_SUBCLASS_PROCESSOR_ALPHA 0x10
-#define PCI_SUBCLASS_PROCESSOR_POWERPC 0x20
-#define PCI_SUBCLASS_PROCESSOR_MIPS 0x30
-#define PCI_SUBCLASS_PROCESSOR_COPROC 0x40
-
-/* 0x0c serial bus controller subclasses */
-#define PCI_SUBCLASS_SERIAL_FIREWIRE 0x00
-#define PCI_SUBCLASS_SERIAL_ACCESS 0x01
-#define PCI_SUBCLASS_SERIAL_SSA 0x02
-#define PCI_SUBCLASS_SERIAL_USB 0x03
-#define PCI_SUBCLASS_SERIAL_FIBRECHANNEL 0x04
-#define PCI_SUBCLASS_SERIAL_SMBUS 0x05
-
-/* 0x0d wireless controller subclasses */
-#define PCI_SUBCLASS_WIRELESS_IRDA 0x00
-#define PCI_SUBCLASS_WIRELESS_CONSUMER_IR 0x01
-#define PCI_SUBCLASS_WIRELESS_RF 0x02
-#define PCI_SUBCLASS_WIRELESS_MISC 0x80
-
-/* 0x0e intelligent I/O controller subclasses */
-#define PCI_SUBCLASS_I2O_I2O 0x00
-
-/* 0x0f satellite communications controller subclasses */
-#define PCI_SUBCLASS_SATELLITE_TV 0x01
-#define PCI_SUBCLASS_SATELLITE_AUDIO 0x02
-#define PCI_SUBCLASS_SATELLITE_VOICE 0x03
-#define PCI_SUBCLASS_SATELLITE_DATA 0x04
-
-/* 0x10 encryption/decryption controller subclasses */
-#define PCI_SUBCLASS_CRYPT_NET_COMPUTING 0x00
-#define PCI_SUBCLASS_CRYPT_ENTERTAINMENT 0x10
-#define PCI_SUBCLASS_CRYPT_MISC 0x80
-
-/* 0x11 data acquisition and signal processing controller subclasses */
-#define PCI_SUBCLASS_DATAACQ_DPIO 0x00
-#define PCI_SUBCLASS_DATAACQ_MISC 0x80
-
-
-/* Header */
-#define PCI_HEADER_MISC 0x0c
-#define PCI_HEADER_MULTIFUNCTION 0x00800000
-
-/* Interrupt configration register */
-#define PCI_INTERRUPT_REG 0x3c
-#define PCI_INTERRUPT_PIN_MASK 0x0000ff00
-#define PCI_INTERRUPT_PIN_EXTRACT(x) \
- ((((x) & PCI_INTERRUPT_PIN_MASK) >> 8) & 0xff)
-#define PCI_INTERRUPT_PIN_NONE 0x00
-#define PCI_INTERRUPT_PIN_A 0x01
-#define PCI_INTERRUPT_PIN_B 0x02
-#define PCI_INTERRUPT_PIN_C 0x03
-#define PCI_INTERRUPT_PIN_D 0x04
-
-#define PCI_INTERRUPT_LINE_MASK 0x000000ff
-#define PCI_INTERRUPT_LINE_EXTRACT(x) \
- ((((x) & PCI_INTERRUPT_LINE_MASK) >> 0) & 0xff)
-#define PCI_INTERRUPT_LINE_INSERT(x,v) \
- (((x) & ~PCI_INTERRUPT_LINE_MASK) | ((v) << 0))
-
-/* Base registers */
-#define PCI_MAP_REG_START 0x10
-#define PCI_MAP_REG_END 0x28
-#define PCI_MAP_ROM_REG 0x30
-
-#define PCI_MAP_MEMORY 0x00000000
-#define PCI_MAP_IO 0x00000001
-
-#define PCI_MAP_MEMORY_TYPE 0x00000007
-#define PCI_MAP_IO_TYPE 0x00000003
-
-#define PCI_MAP_MEMORY_TYPE_32BIT 0x00000000
-#define PCI_MAP_MEMORY_TYPE_32BIT_1M 0x00000002
-#define PCI_MAP_MEMORY_TYPE_64BIT 0x00000004
-#define PCI_MAP_MEMORY_TYPE_MASK 0x00000006
-#define PCI_MAP_MEMORY_CACHABLE 0x00000008
-#define PCI_MAP_MEMORY_ATTR_MASK 0x0000000e
-#define PCI_MAP_MEMORY_ADDRESS_MASK 0xfffffff0
-
-#define PCI_MAP_IO_ATTR_MASK 0x00000003
-
-#define PCI_MAP_IS_IO(b) ((b) & PCI_MAP_IO)
-#define PCI_MAP_IS_MEM(b) (!PCI_MAP_IS_IO(b))
-
-#define PCI_MAP_IS64BITMEM(b) \
- (((b) & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_64BIT)
-
-#define PCIGETMEMORY(b) ((b) & PCI_MAP_MEMORY_ADDRESS_MASK)
-#define PCIGETMEMORY64HIGH(b) (*((CARD32*)&b + 1))
-#define PCIGETMEMORY64(b) \
- (PCIGETMEMORY(b) | ((CARD64)PCIGETMEMORY64HIGH(b) << 32))
-
-#define PCI_MAP_IO_ADDRESS_MASK 0xfffffffc
-
-#define PCIGETIO(b) ((b) & PCI_MAP_IO_ADDRESS_MASK)
-
-#define PCI_MAP_ROM_DECODE_ENABLE 0x00000001
-#define PCI_MAP_ROM_ADDRESS_MASK 0xfffff800
-
-#define PCIGETROM(b) ((b) & PCI_MAP_ROM_ADDRESS_MASK)
-
-/* PCI-PCI bridge mapping registers */
-#define PCI_PCI_BRIDGE_BUS_REG 0x18
-#define PCI_SUBORDINATE_BUS_MASK 0x00ff0000
-#define PCI_SECONDARY_BUS_MASK 0x0000ff00
-#define PCI_PRIMARY_BUS_MASK 0x000000ff
-
-#define PCI_PCI_BRIDGE_IO_REG 0x1c
-#define PCI_PCI_BRIDGE_MEM_REG 0x20
-#define PCI_PCI_BRIDGE_PMEM_REG 0x24
-
-#define PCI_PPB_IOBASE_EXTRACT(x) (((x) << 8) & 0xFF00)
-#define PCI_PPB_IOLIMIT_EXTRACT(x) (((x) << 0) & 0xFF00)
-
-#define PCI_PPB_MEMBASE_EXTRACT(x) (((x) << 16) & 0xFFFF0000)
-#define PCI_PPB_MEMLIMIT_EXTRACT(x) (((x) << 0) & 0xFFFF0000)
-
-#define PCI_PCI_BRIDGE_CONTROL_REG 0x3E
-#define PCI_PCI_BRIDGE_PARITY_EN 0x01
-#define PCI_PCI_BRIDGE_SERR_EN 0x02
-#define PCI_PCI_BRIDGE_ISA_EN 0x04
-#define PCI_PCI_BRIDGE_VGA_EN 0x08
-#define PCI_PCI_BRIDGE_MASTER_ABORT_EN 0x20
-#define PCI_PCI_BRIDGE_SECONDARY_RESET 0x40
-#define PCI_PCI_BRIDGE_FAST_B2B_EN 0x80
-/* header type 2 extensions */
-#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
-#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
-#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100
-#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
-#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
-
-#define PCI_CB_SEC_STATUS_REG 0x16 /* Secondary status */
-#define PCI_CB_PRIMARY_BUS_REG 0x18 /* PCI bus number */
-#define PCI_CB_CARD_BUS_REG 0x19 /* CardBus bus number */
-#define PCI_CB_SUBORDINATE_BUS_REG 0x1a /* Subordinate bus number */
-#define PCI_CB_LATENCY_TIMER_REG 0x1b /* CardBus latency timer */
-#define PCI_CB_MEM_BASE_0_REG 0x1c
-#define PCI_CB_MEM_LIMIT_0_REG 0x20
-#define PCI_CB_MEM_BASE_1_REG 0x24
-#define PCI_CB_MEM_LIMIT_1_REG 0x28
-#define PCI_CB_IO_BASE_0_REG 0x2c
-#define PCI_CB_IO_LIMIT_0_REG 0x30
-#define PCI_CB_IO_BASE_1_REG 0x34
-#define PCI_CB_IO_LIMIT_1_REG 0x38
-#define PCI_CB_BRIDGE_CONTROL_REG 0x3E
-
-#define PCI_CB_IO_RANGE_MASK ~0x03
-#define PCI_CB_IOBASE(x) (x & PCI_CB_IO_RANGE_MASK)
-#define PCI_CB_IOLIMIT(x) ((x & PCI_CB_IO_RANGE_MASK) + 3)
-
-/* Subsystem identification register */
-#define PCI_SUBSYSTEM_ID_REG 0x2c
-
-/* User defined cfg space regs */
-#define PCI_REG_USERCONFIG 0x40
-#define PCI_OPTION_REG 0x40
-
-/*
- * Typedefs, etc...
- */
-
-/* Primitive Types */
-typedef unsigned long ADDRESS; /* Memory/PCI address */
-typedef unsigned long IOADDRESS; /* Must be large enough for a pointer */
-typedef unsigned long PCITAG;
-
-/*
- * PCI configuration space
- */
-typedef struct pci_cfg_regs {
- /* start of official PCI config space header */
- union { /* Offset 0x0 - 0x3 */
- CARD32 device_vendor;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 device;
- CARD16 vendor;
-#else
- CARD16 vendor;
- CARD16 device;
-#endif
- } dv;
- } dv_id;
-
- union { /* Offset 0x4 - 0x8 */
- CARD32 status_command;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 status;
- CARD16 command;
-#else
- CARD16 command;
- CARD16 status;
-#endif
- } sc;
- } stat_cmd;
-
- union { /* Offset 0x8 - 0xb */
- CARD32 class_revision;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD8 base_class;
- CARD8 sub_class;
- CARD8 prog_if;
- CARD8 rev_id;
-#else
- CARD8 rev_id;
- CARD8 prog_if;
- CARD8 sub_class;
- CARD8 base_class;
-#endif
- } cr;
- } class_rev;
-
- union { /* Offset 0xc - 0xf */
- CARD32 bist_header_latency_cache;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD8 bist;
- CARD8 header_type;
- CARD8 latency_timer;
- CARD8 cache_line_size;
-#else
- CARD8 cache_line_size;
- CARD8 latency_timer;
- CARD8 header_type;
- CARD8 bist;
-#endif
- } bhlc;
- } bhlc;
- union { /* Offset 0x10 - 0x3b */
- struct { /* header type 2 */
- CARD32 cg_rsrvd1; /* 0x10 */
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 secondary_status; /* 0x16 */
- CARD16 cg_rsrvd2; /* 0x14 */
-
- union {
- CARD32 cg_bus_reg;
- struct {
- CARD8 latency_timer; /* 0x1b */
- CARD8 subordinate_bus_number; /* 0x1a */
- CARD8 cardbus_bus_number; /* 0x19 */
- CARD8 primary_bus_number; /* 0x18 */
- } cgbr;
- } cgbr;
-#else
- CARD16 cg_rsrvd2; /* 0x14 */
- CARD16 secondary_status; /* 0x16 */
-
- union {
- CARD32 cg_bus_reg;
- struct {
- CARD8 primary_bus_number; /* 0x18 */
- CARD8 cardbus_bus_number; /* 0x19 */
- CARD8 subordinate_bus_number; /* 0x1a */
- CARD8 latency_timer; /* 0x1b */
- } cgbr;
- } cgbr;
-#endif
- CARD32 mem_base0; /* 0x1c */
- CARD32 mem_limit0; /* 0x20 */
- CARD32 mem_base1; /* 0x24 */
- CARD32 mem_limit1; /* 0x28 */
- CARD32 io_base0; /* 0x2c */
- CARD32 io_limit0; /* 0x30 */
- CARD32 io_base1; /* 0x34 */
- CARD32 io_limit1; /* 0x38 */
- } cg;
- struct {
- union { /* Offset 0x10 - 0x27 */
- struct { /* header type 0 */
- CARD32 dv_base0;
- CARD32 dv_base1;
- CARD32 dv_base2;
- CARD32 dv_base3;
- CARD32 dv_base4;
- CARD32 dv_base5;
- } dv;
- struct { /* header type 1 */
- CARD32 bg_rsrvd[2];
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- union {
- CARD32 pp_bus_reg;
- struct {
- CARD8 secondary_latency_timer;
- CARD8 subordinate_bus_number;
- CARD8 secondary_bus_number;
- CARD8 primary_bus_number;
- } ppbr;
- } ppbr;
-
- CARD16 secondary_status;
- CARD8 io_limit;
- CARD8 io_base;
-
- CARD16 mem_limit;
- CARD16 mem_base;
-
- CARD16 prefetch_mem_limit;
- CARD16 prefetch_mem_base;
-#else
- union {
- CARD32 pp_bus_reg;
- struct {
- CARD8 primary_bus_number;
- CARD8 secondary_bus_number;
- CARD8 subordinate_bus_number;
- CARD8 secondary_latency_timer;
- } ppbr;
- } ppbr;
-
- CARD8 io_base;
- CARD8 io_limit;
- CARD16 secondary_status;
-
- CARD16 mem_base;
- CARD16 mem_limit;
-
- CARD16 prefetch_mem_base;
- CARD16 prefetch_mem_limit;
-#endif
- } bg;
- } bc;
- union { /* Offset 0x28 - 0x2b */
- CARD32 rsvd1;
- CARD32 pftch_umem_base;
- CARD32 cardbus_cis_ptr;
- } um_c_cis;
- union { /* Offset 0x2c - 0x2f */
- CARD32 subsys_card_vendor;
- CARD32 pftch_umem_limit;
- CARD32 rsvd2;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 subsys_card;
- CARD16 subsys_vendor;
-#else
- CARD16 subsys_vendor;
- CARD16 subsys_card;
-#endif
- } ssys;
- } um_ssys_id;
- union { /* Offset 0x30 - 0x33 */
- CARD32 baserom;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 io_ulimit;
- CARD16 io_ubase;
-#else
- CARD16 io_ubase;
- CARD16 io_ulimit;
-#endif
- } b_u_io;
- } uio_rom;
- struct {
- CARD32 rsvd3; /* Offset 0x34 - 0x37 */
- CARD32 rsvd4; /* Offset 0x38 - 0x3b */
- } rsvd;
- } cd;
- } cx;
- union { /* Offset 0x3c - 0x3f */
- union { /* header type 0 */
- CARD32 max_min_ipin_iline;
- struct {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD8 max_lat;
- CARD8 min_gnt;
- CARD8 int_pin;
- CARD8 int_line;
-#else
- CARD8 int_line;
- CARD8 int_pin;
- CARD8 min_gnt;
- CARD8 max_lat;
-#endif
- } mmii;
- } mmii;
- struct { /* header type 1 */
-#if X_BYTE_ORDER == X_BIG_ENDIAN
- CARD16 bridge_control; /* upper 8 bits reserved */
- CARD8 rsvd2;
- CARD8 rsvd1;
-#else
- CARD8 rsvd1;
- CARD8 rsvd2;
- CARD16 bridge_control; /* upper 8 bits reserved */
-#endif
- } bctrl;
- } bm;
- union { /* Offset 0x40 - 0xff */
- CARD32 dwords[48];
- CARD8 bytes[192];
- } devspf;
-} pciCfgRegs;
-
-typedef union pci_cfg_spc {
- pciCfgRegs regs;
- CARD32 dwords[256/sizeof(CARD32)];
- CARD8 bytes[256/sizeof(CARD8)];
-} pciCfgSpc;
-
-/*
- * Data structure returned by xf86scanpci including contents of
- * PCI config space header
- */
-typedef struct pci_device {
- PCITAG tag;
- int busnum;
- int devnum;
- int funcnum;
- pciCfgSpc cfgspc;
- int basesize[7]; /* number of bits in base addr allocations */
- Bool minBasesize;
- CARD32 listed_class;
- pointer businfo; /* pointer to secondary's bus info structure */
- Bool fakeDevice; /* Device added by system chipset support */
-} pciDevice, *pciConfigPtr;
-
-typedef enum {
- PCI_MEM,
- PCI_MEM_SIZE,
- PCI_MEM_SPARSE_BASE,
- PCI_MEM_SPARSE_MASK,
- PCI_IO,
- PCI_IO_SIZE,
- PCI_IO_SPARSE_BASE,
- PCI_IO_SPARSE_MASK
-} PciAddrType;
-
-#define pci_device_vendor cfgspc.regs.dv_id.device_vendor
-#define pci_vendor cfgspc.regs.dv_id.dv.vendor
-#define pci_device cfgspc.regs.dv_id.dv.device
-#define pci_status_command cfgspc.regs.stat_cmd.status_command
-#define pci_command cfgspc.regs.stat_cmd.sc.command
-#define pci_status cfgspc.regs.stat_cmd.sc.status
-#define pci_class_revision cfgspc.regs.class_rev.class_revision
-#define pci_rev_id cfgspc.regs.class_rev.cr.rev_id
-#define pci_prog_if cfgspc.regs.class_rev.cr.prog_if
-#define pci_sub_class cfgspc.regs.class_rev.cr.sub_class
-#define pci_base_class cfgspc.regs.class_rev.cr.base_class
-#define pci_bist_header_latency_cache cfgspc.regs.bhlc.bist_header_latency_cache
-#define pci_cache_line_size cfgspc.regs.bhlc.bhlc.cache_line_size
-#define pci_latency_timer cfgspc.regs.bhlc.bhlc.latency_timer
-#define pci_header_type cfgspc.regs.bhlc.bhlc.header_type
-#define pci_bist cfgspc.regs.bhlc.bhlc.bist
-#define pci_cb_secondary_status cfgspc.regs.cx.cg.secondary_status
-#define pci_cb_bus_register cfgspc.regs.cx.cg.cgbr.cg_bus_reg
-#define pci_cb_primary_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.primary_bus_number
-#define pci_cb_cardbus_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.cardbus_bus_number
-#define pci_cb_subordinate_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.subordinate_bus_number
-#define pci_cb_latency_timer cfgspc.regs.cx.cg.cgbr.cgbr.latency_timer
-#define pci_cb_membase0 cfgspc.regs.cx.cg.mem_base0
-#define pci_cb_memlimit0 cfgspc.regs.cx.cg.mem_limit0
-#define pci_cb_membase1 cfgspc.regs.cx.cg.mem_base1
-#define pci_cb_memlimit1 cfgspc.regs.cx.cg.mem_limit1
-#define pci_cb_iobase0 cfgspc.regs.cx.cg.io_base0
-#define pci_cb_iolimit0 cfgspc.regs.cx.cg.io_limit0
-#define pci_cb_iobase1 cfgspc.regs.cx.cg.io_base1
-#define pci_cb_iolimit1 cfgspc.regs.cx.cg.io_limit1
-#define pci_base0 cfgspc.regs.cx.cd.bc.dv.dv_base0
-#define pci_base1 cfgspc.regs.cx.cd.bc.dv.dv_base1
-#define pci_base2 cfgspc.regs.cx.cd.bc.dv.dv_base2
-#define pci_base3 cfgspc.regs.cx.cd.bc.dv.dv_base3
-#define pci_base4 cfgspc.regs.cx.cd.bc.dv.dv_base4
-#define pci_base5 cfgspc.regs.cx.cd.bc.dv.dv_base5
-#define pci_cardbus_cis_ptr cfgspc.regs.cx.cd.umem_c_cis.cardbus_cis_ptr
-#define pci_subsys_card_vendor cfgspc.regs.cx.cd.um_ssys_id.subsys_card_vendor
-#define pci_subsys_vendor cfgspc.regs.cx.cd.um_ssys_id.ssys.subsys_vendor
-#define pci_subsys_card cfgspc.regs.cx.cd.um_ssys_id.ssys.subsys_card
-#define pci_baserom cfgspc.regs.cx.cd.uio_rom.baserom
-#define pci_pp_bus_register cfgspc.regs.cx.cd.bc.bg.ppbr.pp_bus_reg
-#define pci_primary_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.primary_bus_number
-#define pci_secondary_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.secondary_bus_number
-#define pci_subordinate_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.subordinate_bus_number
-#define pci_secondary_latency_timer cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.secondary_latency_timer
-#define pci_io_base cfgspc.regs.cx.cd.bc.bg.io_base
-#define pci_io_limit cfgspc.regs.cx.cd.bc.bg.io_limit
-#define pci_secondary_status cfgspc.regs.cx.cd.bc.bg.secondary_status
-#define pci_mem_base cfgspc.regs.cx.cd.bc.bg.mem_base
-#define pci_mem_limit cfgspc.regs.cx.cd.bc.bg.mem_limit
-#define pci_prefetch_mem_base cfgspc.regs.cx.cd.bc.bg.prefetch_mem_base
-#define pci_prefetch_mem_limit cfgspc.regs.cx.cd.bc.bg.prefetch_mem_limit
-#define pci_rsvd1 cfgspc.regs.cx.cd.um_c_cis.rsvd1
-#define pci_rsvd2 cfgspc.regs.cx.cd.um_ssys_id.rsvd2
-#define pci_prefetch_upper_mem_base cfgspc.regs.cx.cd.um_c_cis.pftch_umem_base
-#define pci_prefetch_upper_mem_limit cfgspc.regs.cx.cd.um_ssys_id.pftch_umem_limit
-#define pci_upper_io_base cfgspc.regs.cx.cd.uio_rom.b_u_io.io_ubase
-#define pci_upper_io_limit cfgspc.regs.cx.cd.uio_rom.b_u_io.io_ulimit
-#define pci_int_line cfgspc.regs.bm.mmii.mmii.int_line
-#define pci_int_pin cfgspc.regs.bm.mmii.mmii.int_pin
-#define pci_min_gnt cfgspc.regs.bm.mmii.mmii.min_gnt
-#define pci_max_lat cfgspc.regs.bm.mmii.mmii.max_lat
-#define pci_max_min_ipin_iline cfgspc.regs.bm.mmii.max_min_ipin_iline
-#define pci_bridge_control cfgspc.regs.bm.bctrl.bridge_control
-#define pci_user_config cfgspc.regs.devspf.dwords[0]
-#define pci_user_config_0 cfgspc.regs.devspf.bytes[0]
-#define pci_user_config_1 cfgspc.regs.devspf.bytes[1]
-#define pci_user_config_2 cfgspc.regs.devspf.bytes[2]
-#define pci_user_config_3 cfgspc.regs.devspf.bytes[3]
-
-typedef enum {
- PCI_BIOS_PC = 0,
- PCI_BIOS_OPEN_FIRMARE,
- PCI_BIOS_HP_PA_RISC,
- PCI_BIOS_OTHER
-} PciBiosType;
-
-/* Public PCI access functions */
-void pciInit(void);
-PCITAG pciFindFirst(CARD32 id, CARD32 mask);
-PCITAG pciFindNext(void);
-CARD32 pciReadLong(PCITAG tag, int offset);
-CARD16 pciReadWord(PCITAG tag, int offset);
-CARD8 pciReadByte(PCITAG tag, int offset);
-void pciWriteLong(PCITAG tag, int offset, CARD32 val);
-void pciWriteWord(PCITAG tag, int offset, CARD16 val);
-void pciWriteByte(PCITAG tag, int offset, CARD8 val);
-void pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val);
-void pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val);
-ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
-ADDRESS pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
-PCITAG pciTag(int busnum, int devnum, int funcnum);
-int pciGetBaseSize(PCITAG tag, int indx, Bool destructive, Bool *min);
-CARD32 pciCheckForBrokenBase(PCITAG tag,int basereg);
-pointer xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size);
-int xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
- unsigned char *Buf, int Len);
-int xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag,
- int basereg, unsigned char *Buf,
- int Len, PciBiosType Type);
-int xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg,
- PciBiosType *Buf);
-pciConfigPtr *xf86scanpci(int flags);
-
-extern int pciNumBuses;
-
-/* Domain access functions. Some of these probably shouldn't be public */
-int xf86GetPciDomain(PCITAG tag);
-pointer xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
- ADDRESS Base, unsigned long Size);
-IOADDRESS xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
- IOADDRESS Base, unsigned long Size);
-int xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len,
- unsigned char *Buf);
-
-typedef enum {
- ROM_BASE_PRESET = -2,
- ROM_BASE_BIOS,
- ROM_BASE_MEM0 = 0,
- ROM_BASE_MEM1,
- ROM_BASE_MEM2,
- ROM_BASE_MEM3,
- ROM_BASE_MEM4,
- ROM_BASE_MEM5,
- ROM_BASE_FIND
-} romBaseSource;
-
-#endif /* _XF86PCI_H */
diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h
deleted file mode 100644
index 1f5f03bd2..000000000
--- a/hw/xfree86/os-support/bus/xf86Sbus.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Platform specific SBUS and OpenPROM access declarations.
- *
- * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.6 2003/10/02 13:30:07 eich Exp $ */
-
-#ifndef _XF86_SBUS_H
-#define _XF86_SBUS_H
-
-#if defined(linux)
-#include <asm/types.h>
-#include <asm/fbio.h>
-#include <asm/openpromio.h>
-#elif defined(SVR4)
-#include <sys/fbio.h>
-#include <sys/openpromio.h>
-#elif defined(__OpenBSD__) && defined(__sparc64__)
-/* XXX */
-#elif defined(CSRG_BASED)
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/fbio.h>
-#include <dev/ofw/openpromio.h>
-#else
-#include <machine/fbio.h>
-#endif
-#else
-#include <sun/fbio.h>
-#endif
-
-#ifndef FBTYPE_SUNGP3
-#define FBTYPE_SUNGP3 -1
-#endif
-#ifndef FBTYPE_MDICOLOR
-#define FBTYPE_MDICOLOR -1
-#endif
-#ifndef FBTYPE_SUNLEO
-#define FBTYPE_SUNLEO -1
-#endif
-#ifndef FBTYPE_TCXCOLOR
-#define FBTYPE_TCXCOLOR -1
-#endif
-#ifndef FBTYPE_CREATOR
-#define FBTYPE_CREATOR -1
-#endif
-
-#endif /* _XF86_SBUS_H */
diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c
deleted file mode 100644
index b5a483560..000000000
--- a/hw/xfree86/os-support/bus/zx1PCI.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.5 2003/11/06 18:38:14 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-/*
- * This file contains the glue necessary for support of HP's ZX1 chipset.
- * Keep in mind that this chipset is used in both Itanium2 and PA-RISC
- * architectures.
- */
-
-#include "zx1PCI.h"
-#include "xf86.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-#define MIO_BASE 0xFED00000UL /* mio register base */
-#define MIO_SIZE 0x00002000UL /* 8k, minimum */
-
-/* ZX1 mio register definitions */
-#define MIO_FUNCTION0 0x0000U
-
-#define MODULE_INFO 0x0100U
-#define STATUS_CONTROL 0x0108U
-#define DILLON_PRESENT 0x02UL
-
-#define LMMIO_DIR_BASE0 0x0300U
-#define LMMIO_DIR_MASK0 0x0308U
-#define LMMIO_DIR_ROUTE0 0x0310U
-#define LMMIO_DIR_BASE1 0x0318U
-#define LMMIO_DIR_MASK1 0x0320U
-#define LMMIO_DIR_ROUTE1 0x0328U
-#define LMMIO_DIR_BASE2 0x0330U
-#define LMMIO_DIR_MASK2 0x0338U
-#define LMMIO_DIR_ROUTE2 0x0340U
-#define LMMIO_DIR_BASE3 0x0348U
-#define LMMIO_DIR_MASK3 0x0350U
-#define LMMIO_DIR_ROUTE3 0x0358U
-#define LMMIO_DIST_BASE 0x0360U
-#define LMMIO_DIST_MASK 0x0368U
-#define LMMIO_DIST_ROUTE 0x0370U
-#define GMMIO_DIST_BASE 0x0378U
-#define PORT_DISABLE 0x02UL
-#define MAP_TO_LMMIO 0x04UL
-#define GMMIO_DIST_MASK 0x0380U
-#define GMMIO_DIST_ROUTE 0x0388U
-#define IOS_DIST_BASE 0x0390U
-#define IOS_DIST_MASK 0x0398U
-#define IOS_DIST_ROUTE 0x03A0U
-#define ROPE_CONFIG_BASE 0x03A8U
-#define VGA_ROUTE 0x03B0U
-#define VGA_ENABLE 0x8000000000000000UL
-#define VGA_LIGHT 0x4000000000000000UL
-
-#define IOS_DIR_BASE 0x03C0U
-#define IOS_DIR_MASK 0x03C8U
-#define IOS_DIR_ROUTE 0x03D0U
-#define IOS_BASE 0x03D8U
-
-#define MIO_FUNCTION1 0x1000U
-
-#define ROPE_CONFIG 0x1040U
-#define ROPE_D0 0x0100UL
-#define ROPE_D2 0x0200UL
-#define ROPE_D4 0x0400UL
-#define ROPE_D6 0x0800UL
-#define ROPE_Q0 0x1000UL
-#define ROPE_Q4 0x2000UL
-
-#define LBA_PORT0_CNTRL 0x1200U
-#define LBA_PORT1_CNTRL 0x1208U
-#define LBA_PORT2_CNTRL 0x1210U
-#define LBA_PORT3_CNTRL 0x1218U
-#define LBA_PORT4_CNTRL 0x1220U
-#define LBA_PORT5_CNTRL 0x1228U
-#define LBA_PORT6_CNTRL 0x1230U
-#define LBA_PORT7_CNTRL 0x1238U
-#define LBA_ROPE_RESET 0x01UL
-#define LBA_CLEAR_ERROR 0x10UL
-#define LBA_HARD_FAIL 0x40UL
-
-#define ROPE_PAGE_CONTROL 0x1418U
-
-/*
- * Total ioa configuration space size is actually 128k, but we only need the
- * first 64k.
- */
-#define IOA_SIZE 0x00010000UL
-
-/* ZX1 ioa register definitions */
-#define IOA_CONFIG_ADDR 0x0040U
-#define IOA_CONFIG_DATA 0x0048U
-
-#define IOA_SECONDARY_BUS 0x0058U
-#define IOA_SUBORDINATE_BUS 0x0059U
-
-#define IOA_CONTROL 0x0108U
-#define IOA_FORWARD_VGA 0x08UL
-#define IOA_HARD_FAIL 0x40UL
-
-#define IOA_LMMIO_BASE 0x0200U
-#define IOA_LMMIO_MASK 0x0208U
-#define IOA_GMMIO_BASE 0x0210U
-#define IOA_GMMIO_MASK 0x0218U
-#define IOA_WLMMIO_BASE 0x0220U
-#define IOA_WLMMIO_MASK 0x0228U
-#define IOA_WGMMIO_BASE 0x0230U
-#define IOA_WGMMIO_MASK 0x0238U
-#define IOA_IOS_BASE 0x0240U
-#define IOA_IOS_MASK 0x0248U
-#define IOA_ELMMIO_BASE 0x0250U
-#define IOA_ELMMIO_MASK 0x0258U
-#define IOA_EIOS_BASE 0x0260U
-#define IOA_EIOS_MASK 0x0268U
-
-#define IOA_SLAVE_CONTROL 0x0278U
-#define IOA_VGA_PEER_ENABLE 0x2000UL
-#define IOA_MSI_BASE 0x0280U
-#define IOA_MSI_MASK 0x0288U
-
-#define RANGE_ENABLE 0x01UL /* In various base registers */
-
-#define IO_MASK ((1UL << 16) - 1UL)
-#define LMMIO_MASK ((1UL << 32) - 1UL)
-#ifdef __ia64__
-#define GMMIO_MASK ((1UL << 44) - 1UL)
-#else /* PA-RISC */
-#define GMMIO_MASK ((1UL << 40) - 1UL)
-#endif
-
-#define PDH_START 0xFF000000UL
-#define PDH_LAST 0xFFFFFFFFUL
-
-static CARD8 *pZX1mio = NULL,
- *pZX1ioa = NULL;
-
-static INT8 zx1_ropemap[8]; /* One for each (potential) rope */
-static CARD64 zx1_lbacntl[8]; /* " " " " " */
-static int zx1_busno[8], zx1_subno[8];
-
-static pciBusFuncs_t zx1BusFuncs;
-static int zx1_fakebus = -1;
-static Bool zx1_hasvga = FALSE;
-
-static pointer pZX1IoRes[8], pZX1MemRes[8]; /* Rope resources */
-
-/* Non-PCI configuration space access macros */
-#define MIO_BYTE(offset) \
- (*(volatile CARD8 *)(pointer)(pZX1mio + (offset)))
-#define MIO_WORD(offset) \
- (*(volatile CARD16 *)(pointer)(pZX1mio + (offset)))
-#define MIO_LONG(offset) \
- (*(volatile CARD32 *)(pointer)(pZX1mio + (offset)))
-#define MIO_QUAD(offset) \
- (*(volatile CARD64 *)(pointer)(pZX1mio + (offset)))
-#define IOA_BYTE(ioa, offset) \
- (*(volatile CARD8 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
-#define IOA_WORD(ioa, offset) \
- (*(volatile CARD16 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
-#define IOA_LONG(ioa, offset) \
- (*(volatile CARD32 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
-#define IOA_QUAD(ioa, offset) \
- (*(volatile CARD64 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
-
-/* Range definitions */
-#define MAX_RANGE 16
-static CARD64 bot[MAX_RANGE], top[MAX_RANGE], msk[MAX_RANGE], siz[MAX_RANGE];
-static INT8 *pDecode[MAX_RANGE];
-static int nRange = 0;
-
-/* Track a resource range and assign a granularity to it */
-static void
-SetRange(CARD64 base, CARD64 last, CARD8 width)
-{
- int i;
-
- bot[nRange] = base;
- top[nRange] = last;
- msk[nRange] = (CARD64)(-1L);
- if (base)
- msk[nRange] &= (base ^ (base - 1UL)) >> 1;
- if (last + 1UL)
- msk[nRange] &= (last ^ (last + 1UL)) >> 1;
- if (width < 64)
- msk[nRange] &= (1UL << width) - 1UL;
-
- /* Look for overlapping ranges */
- for (i = 0; i < nRange; i++) {
- if ((bot[i] > top[i]) ||
- (top[nRange] < bot[i]) ||
- (top[i] < bot[nRange]))
- continue;
-
- /* Merge in overlapping range */
- if (bot[nRange] > bot[i])
- bot[nRange] = bot[i];
- if (top[nRange] < top[i])
- top[nRange] = top[i];
-
- /* Assign finer granularity */
- msk[nRange] &= msk[i];
- bot[i] = 1UL;
- top[i] = 0;
- }
-
- nRange++;
-}
-
-/* Lookup granularity associated with the range containing 'base' */
-static int
-GetRange(CARD64 base)
-{
- int i;
-
- for (i = 0; i < nRange; i++) {
- if ((bot[i] > top[i]) ||
- (base < bot[i]) ||
- (base > top[i]))
- continue;
-
- if (pDecode[i])
- break;
-
- /* Allocate decoding array */
- msk[i]++;
- siz[i] = ((top[i] - bot[i] + 1UL) / msk[i]) + 1UL;
- pDecode[i] = xnfalloc(siz[i]);
- (void)memset(pDecode[i], -1, siz[i]);
- break;
- }
-
- return i;
-}
-
-/*
- * Verify that 'bus' is a rope's secondary bus and return the pciConfigPtr of
- * the associated fake PCI-to-PCI bridge.
- */
-static pciConfigPtr
-VerifyZX1Bus(int bus)
-{
- pciConfigPtr pPCI;
-
- if ((bus < 0) || (bus >= pciNumBuses) ||
- !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
- (pPCI->busnum != zx1_fakebus) || (pPCI->funcnum != 0) ||
- (pPCI->devnum < 0x10) || (pPCI->devnum > 0x17))
- return NULL;
-
- return pPCI;
-}
-
-/*
- * This function is called to emulate the various settings in a P2P or CardBus
- * bridge's control register on a ZX1-based system.
- */
-static CARD16
-ControlZX1Bridge(int bus, CARD16 mask, CARD16 value)
-{
- pciConfigPtr pPCI;
- CARD64 tmp1, tmp2, tmp3, ropenum;
- CARD16 current = 0;
-
- if ((pPCI = VerifyZX1Bus(bus))) {
- ropenum = pPCI->devnum & 0x07;
-
- /*
- * Start with VGA enablement. This preserves the "VGA-lite" bit
- * in mio's VGA_ROUTE register, and the VPE bit in each ioa's
- * SLAVE_CONTROL register.
- */
- tmp1 = MIO_QUAD(VGA_ROUTE);
- tmp2 = IOA_QUAD(ropenum, IOA_CONTROL);
- if ((tmp1 & VGA_ENABLE) && ((tmp1 & 0x07UL) == ropenum)) {
- current |= PCI_PCI_BRIDGE_VGA_EN;
- if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
- !(value & PCI_PCI_BRIDGE_VGA_EN)) {
- MIO_QUAD(VGA_ROUTE) = tmp1 & ~VGA_ENABLE;
- tmp2 &= ~IOA_FORWARD_VGA;
- IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
- }
- } else if (mask & value & PCI_PCI_BRIDGE_VGA_EN) {
- if (!zx1_hasvga) {
- xf86MsgVerb(X_WARNING, 3,
- "HP ZX1: Attempt to enable VGA routing to bus %d"
- " through rope %ld disallowed\n", bus, ropenum);
- value &= ~PCI_PCI_BRIDGE_VGA_EN;
- } else {
- if (tmp1 & VGA_ENABLE) {
- /*
- * VGA is routed somewhere else. Disable it.
- */
- MIO_QUAD(VGA_ROUTE) = 0UL;
- tmp3 = IOA_QUAD(tmp1 & 0x07UL, IOA_CONTROL);
- if (tmp3 & IOA_FORWARD_VGA)
- IOA_QUAD(tmp1 & 0x07UL, IOA_CONTROL) =
- tmp3 & ~IOA_FORWARD_VGA;
- }
- if (!(tmp2 & IOA_FORWARD_VGA)) {
- tmp2 |= IOA_FORWARD_VGA;
- IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
- }
- tmp1 = (tmp1 & ~0x07UL) | ropenum | VGA_ENABLE;
- MIO_QUAD(VGA_ROUTE) = tmp1;
- }
- }
-
- /* Move on to master abort failure enablement */
- tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) &
- ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR);
- if ((tmp1 & LBA_HARD_FAIL) || (tmp2 & IOA_HARD_FAIL)) {
- current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
- if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
- !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)) {
- if (tmp1 & LBA_HARD_FAIL)
- MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) =
- tmp1 & ~LBA_HARD_FAIL;
- if (tmp2 & IOA_HARD_FAIL) {
- tmp2 &= ~IOA_HARD_FAIL;
- IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
- }
- }
- } else {
- if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN) {
- if (!(tmp1 & LBA_HARD_FAIL))
- MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) =
- tmp1 | LBA_HARD_FAIL;
- if (!(tmp2 & IOA_HARD_FAIL)) {
- tmp2 |= IOA_HARD_FAIL;
- IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
- }
- }
- }
-
- /* Put emulation of any other P2P bridge control here */
- }
-
- return (current & ~mask) | (value & mask);
-}
-
-/* Retrieves a list of the resources routed to a rope's secondary bus */
-static void
-GetZX1BridgeResources(int bus,
- pointer *ppIoRes,
- pointer *ppMemRes,
- pointer *ppPmemRes)
-{
- pciConfigPtr pPCI = VerifyZX1Bus(bus);
-
- if (ppIoRes) {
- xf86FreeResList(*ppIoRes);
- *ppIoRes =
- pPCI ? xf86DupResList(pZX1IoRes[pPCI->devnum & 0x07]) : NULL;
- }
-
- if (ppMemRes) {
- xf86FreeResList(*ppMemRes);
- *ppMemRes =
- pPCI ? xf86DupResList(pZX1MemRes[pPCI->devnum & 0x07]) : NULL;
- }
-
- if (ppPmemRes) {
- xf86FreeResList(*ppPmemRes);
- *ppPmemRes = NULL;
- }
-}
-
-/* The fake bus */
-static CARD32
-zx1FakeReadLong(PCITAG tag, int offset)
-{
- FatalError("zx1FakeReadLong(0x%lX, 0x%X) called\n",
- (unsigned long)tag, offset);
-}
-
-static void
-zx1FakeWriteLong(PCITAG tag, int offset, CARD32 val)
-{
- FatalError("zx1FakeWriteLong(0x%lX, 0x%X, 0x%08X) called\n",
- (unsigned long)tag, offset, val);
-}
-
-static void
-zx1FakeSetBits(PCITAG tag, int offset, CARD32 mask, CARD32 bits)
-{
- CARD32 val;
-
- val = zx1FakeReadLong(tag, offset);
- val &= ~mask;
- val |= bits;
- zx1FakeWriteLong(tag, offset, val);
-}
-
-static pciBusFuncs_t zx1FakeBusFuncs = {
- zx1FakeReadLong,
- zx1FakeWriteLong,
- zx1FakeSetBits
-};
-
-static pciBusInfo_t zx1FakeBus = {
- 0, /* configMech -- copied from bus 0 */
- 0, /* numDevices -- copied from bus 0 */
- FALSE, /* secondary */
- 0, /* primary_bus -- dynamically set */
-#ifdef PowerMAX_OS
- 0, /* ppc_io_base -- ignored */
- 0, /* ppc_io_size -- ignored */
-#endif
- &zx1FakeBusFuncs, /* funcs */
- NULL, /* pciBusPriv -- none */
- NULL, /* bridge -- dynamically set */
-};
-
-/*
- * This checks for, and validates, the presence of the ZX1 chipset, and sets
- * pZX1mio to a non-NULL pointer accordingly. This function is called before
- * the server's PCI bus scan and returns TRUE if the chipset scan is to be
- * stopped, or FALSE if the scan is to move on to the next chipset.
- */
-Bool
-xf86PreScanZX1(void)
-{
- resRange range;
- unsigned long mapSize = xf86getpagesize();
- unsigned long tmp, base, ioaaddr;
- unsigned long flagsd = 0, based = 0, lastd = 0, maskd = 0, routed = 0;
- unsigned long flags0 = 0, base0 = 0, last0 = 0, mask0 = 0, route0 = 0;
- unsigned long flags1 = 0, base1 = 0, last1 = 0, mask1 = 0, route1 = 0;
- unsigned long flags2 = 0, base2 = 0, last2 = 0, mask2 = 0, route2 = 0;
- unsigned long flags3 = 0, base3 = 0, last3 = 0, mask3 = 0, route3 = 0;
- unsigned long flagsg = 0, baseg = 0, lastg = 0, maskg = 0, routeg = 0;
- unsigned long flagsl = 0, basel = 0, lastl = 0;
- int i, rope;
-
- /* Map mio registers (minimum 8k) */
- if (mapSize < MIO_SIZE)
- mapSize = MIO_SIZE;
-
- if (!(pZX1mio = xf86MapVidMem(-1, VIDMEM_MMIO, MIO_BASE, mapSize)))
- return FALSE;
-
- /* Look for ZX1's SBA and IOC */
- if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) !=
- DEVID(VENDOR_HP, CHIP_ZX1_SBA)) ||
- (MIO_LONG(MIO_FUNCTION1 + PCI_ID_REG) !=
- DEVID(VENDOR_HP, CHIP_ZX1_IOC))) {
- xf86UnMapVidMem(-1, pZX1mio, mapSize);
- pZX1mio = NULL;
- return FALSE;
- }
-
- /* Map rope configuration space */
- ioaaddr = MIO_QUAD(ROPE_CONFIG_BASE);
- if (!(ioaaddr & RANGE_ENABLE) || /* No ropes */
- ((ioaaddr = ioaaddr & ~RANGE_ENABLE) & 0x01FFFFUL) || /* Not aligned */
- !(pZX1ioa = xf86MapVidMem(-1, VIDMEM_MMIO, ioaaddr, IOA_SIZE))) {
- xf86UnMapVidMem(-1, pZX1mio, mapSize);
- pZX1mio = NULL;
- return TRUE;
- }
-
- for (i = 0; i < 8; i++) {
- zx1_ropemap[i] = i;
- zx1_lbacntl[i] = 0;
- xf86FreeResList(pZX1IoRes[i]);
- xf86FreeResList(pZX1MemRes[i]);
- pZX1IoRes[i] = pZX1MemRes[i] = NULL;
- }
-
- /*
- * Determine which of 8 possible ropes exist in the system. This is done
- * by looking at their "coupling" to generate a list of candidates,
- * whittling this list down by factoring in ROPE_PAGE_CONTROL register
- * contents, then poking each candidate's configuration space to determine
- * its existence.
- */
- tmp = MIO_QUAD(ROPE_CONFIG);
- if (tmp & ROPE_D0)
- zx1_ropemap[1] = 0;
- if (tmp & ROPE_D2)
- zx1_ropemap[3] = 2;
- if (tmp & ROPE_D4)
- zx1_ropemap[5] = 4;
- if (tmp & ROPE_D6)
- zx1_ropemap[7] = 6;
- if (tmp & ROPE_Q0)
- zx1_ropemap[1] = zx1_ropemap[2] = zx1_ropemap[3] = 0;
- if (tmp & ROPE_Q4)
- zx1_ropemap[5] = zx1_ropemap[6] = zx1_ropemap[7] = 4;
-
- tmp = MIO_QUAD(ROPE_PAGE_CONTROL);
- for (i = 0; i < 8; i++, tmp >>= 8)
- if (!(CARD8)tmp)
- zx1_ropemap[i] = -1;
-
- for (i = 0; i < 8; ) {
- if (zx1_ropemap[i] == i) {
-
- /* Prevent hard-fails */
- zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) &
- ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR);
- if (zx1_lbacntl[i] & LBA_HARD_FAIL)
- MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) =
- zx1_lbacntl[i] & ~LBA_HARD_FAIL;
-
- /* Poke for an ioa */
- tmp = IOA_LONG(i, PCI_ID_REG);
- switch ((CARD32)tmp) {
- case DEVID(VENDOR_HP, CHIP_ELROY):
- case DEVID(VENDOR_HP, CHIP_ZX1_LBA): /* Mercury */
- case DEVID(VENDOR_HP, CHIP_ZX1_AGP8): /* QuickSilver */
- /* Expected vendor/device IDs */
- zx1_busno[i] =
- (unsigned int)IOA_BYTE(i, IOA_SECONDARY_BUS);
- zx1_subno[i] =
- (unsigned int)IOA_BYTE(i, IOA_SUBORDINATE_BUS);
- break;
-
- default:
- if ((CARD16)(tmp + 1U) > (CARD16)1U)
- xf86MsgVerb(X_NOTICE, 0,
- "HP ZX1: Unexpected vendor/device id 0x%08X"
- " on rope %d\n", (CARD32)tmp, i);
- /* Nobody home, or not the "right" kind of rope guest */
-
- /*
- * Restore hard-fail setting. For "active" ropes, this is done
- * later.
- */
- if (zx1_lbacntl[i] & LBA_HARD_FAIL) {
- MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) = zx1_lbacntl[i];
- zx1_lbacntl[i] = 0;
- }
-
- /* Ignore this rope and its couplings */
- do {
- zx1_ropemap[i++] = -1;
- } while ((i < 8) && (zx1_ropemap[i] < i));
- continue; /* Avoid over-incrementing 'i' */
- }
- }
- i++;
- }
-
- /* Determine if VGA is currently routed */
- tmp = MIO_QUAD(VGA_ROUTE);
- if (tmp & VGA_ENABLE)
- zx1_hasvga = TRUE;
-
- /*
- * Decode mio resource "coarse" routing (i.e. ignoring VGA). Due to the
- * rather unusual flexibility of this chipset, this is done in a number of
- * stages. For each of I/O and memory, first decode the relevant registers
- * to generate ranges with an associated granularity. Overlapping ranges
- * are merged into a larger range with the finer granularity. Each
- * original range is then more thoroughly decoded using the granularity
- * associated with the merged range that contains it. The result is then
- * converted into resource lists for the common layer.
- *
- * Note that this doesn't care whether or not read-only bits are actually
- * set as documented, nor that mask bits are contiguous. This does,
- * however, factor in upper limits on I/O, LMMIO anf GMMIO addresses, and
- * thus assumes high-order address bits are ignored rather than decoded.
- * For example, an I/O address of 0x76543210 will be treated as 0x3210
- * rather than considered out-of-range. In part, this handling is a
- * consequence of the fact that high-order mask bits are zeroes instead of
- * ones.
- */
-
- if ((tmp = MIO_QUAD(IOS_DIST_BASE)) & RANGE_ENABLE) {
- flagsd = RANGE_ENABLE;
- maskd = MIO_QUAD(IOS_DIST_MASK);
- based = tmp & maskd & (~RANGE_ENABLE & IO_MASK);
- lastd = based | (~maskd & IO_MASK);
- routed = MIO_QUAD(IOS_DIST_ROUTE) >> 58;
- SetRange(based, lastd, routed);
- }
-
- if ((tmp = MIO_QUAD(IOS_DIR_BASE)) & RANGE_ENABLE) {
- flags0 = RANGE_ENABLE;
- mask0 = MIO_QUAD(IOS_DIR_MASK);
- base0 = tmp & mask0 & (~RANGE_ENABLE & IO_MASK);
- last0 = base0 | (~mask0 & IO_MASK);
- route0 = MIO_QUAD(IOS_DIR_ROUTE) & 0x07U;
- SetRange(base0, last0, 64);
- }
-
- if (flagsd) {
- i = GetRange(based);
- for (tmp = based; tmp <= lastd; tmp += msk[i]) {
- if ((tmp & maskd) == based) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[(tmp >> routed) & 0x07U];
- }
- }
-
- flagsd = 0;
- }
-
- if (flags0) {
- i = GetRange(base0);
- for (tmp = base0; tmp <= last0; tmp += msk[i]) {
- if ((tmp & mask0) == base0) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[route0];
- }
- }
-
- flags0 = 0;
- }
-
- for (i = 0; i < nRange; i++) {
- if (!pDecode[i])
- continue;
-
- rope = pDecode[i][0];
- for (base = tmp = 0; ++tmp < siz[i]; ) {
- if (rope == pDecode[i][tmp])
- continue;
-
- if (rope >= 0) {
- RANGE(range, (base * msk[i]) + bot[i],
- (tmp * msk[i]) + bot[i] - 1UL,
- RANGE_TYPE(ResExcIoBlock, 0));
- pZX1IoRes[rope] =
- xf86AddResToList(pZX1IoRes[rope], &range, -1);
- }
-
- base = tmp;
- rope = pDecode[i][base];
- }
-
- xfree(pDecode[i]);
- pDecode[i] = NULL;
- }
-
- nRange = 0;
-
- /*
- * Move on to CPU memory access decoding. For now, don't tell the common
- * layer about CPU memory ranges that are either relocated to 0 or
- * translated into PCI I/O.
- */
-
- SetRange(MIO_BASE, MIO_BASE + MIO_SIZE - 1UL, 64); /* mio */
- SetRange(ioaaddr, ioaaddr + ((IOA_SIZE << 1) - 1UL), 64); /* ioa */
- SetRange(PDH_START, PDH_LAST, 64); /* PDH */
-
- SetRange(MIO_BASE, LMMIO_MASK, 64); /* Completeness */
-
- if ((tmp = MIO_QUAD(LMMIO_DIST_BASE)) & RANGE_ENABLE) {
- flagsd = RANGE_ENABLE;
- maskd = MIO_QUAD(LMMIO_DIST_MASK);
- based = tmp & maskd & (~RANGE_ENABLE & LMMIO_MASK);
- lastd = based | (~maskd & LMMIO_MASK);
- routed = MIO_QUAD(LMMIO_DIST_ROUTE) >> 58;
- SetRange(based, lastd, routed);
- }
-
- if ((tmp = MIO_QUAD(LMMIO_DIR_BASE0)) & RANGE_ENABLE) {
- flags0 = RANGE_ENABLE;
- mask0 = MIO_QUAD(LMMIO_DIR_MASK0);
- base0 = tmp & mask0 & (~RANGE_ENABLE & LMMIO_MASK);
- last0 = base0 | (~mask0 & LMMIO_MASK);
- route0 = MIO_QUAD(LMMIO_DIR_ROUTE0) & 0x07U;
- SetRange(base0, last0, 64);
- }
-
- if ((tmp = MIO_QUAD(LMMIO_DIR_BASE1)) & RANGE_ENABLE) {
- flags1 = RANGE_ENABLE;
- mask1 = MIO_QUAD(LMMIO_DIR_MASK1);
- base1 = tmp & mask1 & (~RANGE_ENABLE & LMMIO_MASK);
- last1 = base1 | (~mask1 & LMMIO_MASK);
- route1 = MIO_QUAD(LMMIO_DIR_ROUTE1) & 0x07U;
- SetRange(base1, last1, 64);
- }
-
- if ((tmp = MIO_QUAD(LMMIO_DIR_BASE2)) & RANGE_ENABLE) {
- flags2 = RANGE_ENABLE;
- mask2 = MIO_QUAD(LMMIO_DIR_MASK2);
- base2 = tmp & mask2 & (~RANGE_ENABLE & LMMIO_MASK);
- last2 = base2 | (~mask2 & LMMIO_MASK);
- route2 = MIO_QUAD(LMMIO_DIR_ROUTE2) & 0x07U;
- SetRange(base2, last2, 64);
- }
-
- if ((tmp = MIO_QUAD(LMMIO_DIR_BASE3)) & RANGE_ENABLE) {
- flags3 = RANGE_ENABLE;
- mask3 = MIO_QUAD(LMMIO_DIR_MASK3);
- base3 = tmp & mask3 & (~RANGE_ENABLE & LMMIO_MASK);
- last3 = base3 | (~mask3 & LMMIO_MASK);
- route3 = MIO_QUAD(LMMIO_DIR_ROUTE3) & 0x07U;
- SetRange(base3, last3, 64);
- }
-
- if ((tmp = MIO_QUAD(GMMIO_DIST_BASE)) & RANGE_ENABLE) {
- flagsg = tmp & (RANGE_ENABLE | PORT_DISABLE | MAP_TO_LMMIO);
- maskg = MIO_QUAD(GMMIO_DIST_MASK);
- baseg = tmp & maskg &
- (~(RANGE_ENABLE | PORT_DISABLE | MAP_TO_LMMIO) & GMMIO_MASK);
- lastg = baseg | (~maskg & GMMIO_MASK);
- tmp = routeg = MIO_QUAD(GMMIO_DIST_ROUTE) >> 58;
- if (!(flagsg & (PORT_DISABLE & MAP_TO_LMMIO)) && (tmp > 26))
- tmp = 26;
- SetRange(baseg, lastg, tmp);
- }
-
- if ((tmp = MIO_QUAD(IOS_BASE)) & RANGE_ENABLE) {
- flagsl = RANGE_ENABLE;
- basel = tmp & (~RANGE_ENABLE & GMMIO_MASK);
- lastl = basel | 0x001FFFFFUL;
- SetRange(basel, lastl, 64);
- }
-
- if (flagsd) {
- i = GetRange(based);
- for (tmp = based; tmp <= lastd; tmp += msk[i]) {
- if ((tmp & maskd) == based) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[(tmp >> routed) & 0x07U];
- }
- }
-
- flagsd = 0;
- }
-
- /* LMMIO distributed range does not address anything beyond 0xFED00000 */
- i = GetRange(MIO_BASE);
- for (tmp = MIO_BASE; tmp <= LMMIO_MASK; tmp += msk[i]) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = -1;
- }
-
- /* Dillon space can sometimes be redirected to rope 0 */
- tmp = MIO_QUAD(STATUS_CONTROL);
- if (!(tmp & DILLON_PRESENT)) {
- i = GetRange(PDH_START);
- for (tmp = PDH_START; tmp <= PDH_LAST; tmp += msk[i]) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[0];
- }
- }
-
- if (flagsg) {
- unsigned long mask = (0x07UL << routeg) | maskg;
-
- i = GetRange(baseg);
- for (tmp = baseg; tmp <= lastg; tmp += msk[i]) {
- if ((tmp & maskg) == baseg) {
- base = (tmp - bot[i]) / msk[i];
-
- if ((flagsg & MAP_TO_LMMIO) ||
- (!(flagsg & PORT_DISABLE) &&
- (tmp <= ((tmp & mask) | 0x03FFFFFFUL)))) {
- pDecode[i][base] = -1;
- } else {
- pDecode[i][base] = zx1_ropemap[(tmp >> routeg) & 0x07U];
- }
- }
- }
-
- flagsg = 0;
- }
-
- if (flagsl) {
- i = GetRange(basel);
- for (tmp = basel; tmp <= lastl; tmp += msk[i]) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = -1;
- }
-
- flagsl = 0;
- }
-
- /* For now, assume directed LMMIO ranges don't overlap with each other */
- if (flags0) {
- i = GetRange(base0);
- for (tmp = base0; tmp <= last0; tmp += msk[i]) {
- if ((tmp & mask0) == base0) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[route0];
- }
- }
-
- flags0 = 0;
- }
-
- if (flags1) {
- i = GetRange(base1);
- for (tmp = base1; tmp <= last1; tmp += msk[i]) {
- if ((tmp & mask1) == base1) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[route1];
- }
- }
-
- flags1 = 0;
- }
-
- if (flags2) {
- i = GetRange(base2);
- for (tmp = base2; tmp <= last2; tmp += msk[i]) {
- if ((tmp & mask2) == base2) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[route2];
- }
- }
-
- flags2 = 0;
- }
-
- if (flags3) {
- i = GetRange(base3);
- for (tmp = base3; tmp <= last3; tmp += msk[i]) {
- if ((tmp & mask3) == base3) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = zx1_ropemap[route3];
- }
- }
-
- flags3 = 0;
- }
-
- /* Claim iao config area */
- i = GetRange(ioaaddr);
- for (tmp = ioaaddr; tmp < ioaaddr + (IOA_SIZE << 1); tmp += msk[i]) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = -1;
- }
-
- /* Claim mio config area */
- i = GetRange(MIO_BASE);
- for (tmp = MIO_BASE; tmp < (MIO_BASE + MIO_SIZE); tmp += msk[i]) {
- base = (tmp - bot[i]) / msk[i];
- pDecode[i][base] = -1;
- }
-
- for (i = 0; i < nRange; i++) {
- if (!pDecode[i])
- continue;
-
- rope = pDecode[i][0];
- for (base = tmp = 0; ++tmp < siz[i]; ) {
- if (rope == pDecode[i][tmp])
- continue;
-
- if (rope >= 0) {
- RANGE(range, (base * msk[i]) + bot[i],
- (tmp * msk[i]) + bot[i] - 1UL,
- RANGE_TYPE(ResExcMemBlock, 0));
- pZX1MemRes[rope] =
- xf86AddResToList(pZX1MemRes[rope], &range, -1);
- }
-
- base = tmp;
- rope = pDecode[i][base];
- }
-
- xfree(pDecode[i]);
- pDecode[i] = NULL;
- }
-
- nRange = 0;
-
- return TRUE;
-}
-
-/* This is called to finalise the results of a PCI bus scan */
-void
-xf86PostScanZX1(void)
-{
- pciConfigPtr pPCI, *ppPCI, *ppPCI2;
- pciBusInfo_t *pBusInfo;
- int i, idx;
-
- if (!pZX1mio)
- return;
-
- /*
- * Certain 2.4 & 2.5 Linux kernels add fake PCI devices. Remove them to
- * prevent any possible interference with our PCI validation.
- *
- * Also, if VGA isn't routed on server entry, determine if VGA routing
- * needs to be enabled while the server is running.
- */
- idx = 0;
- ppPCI = ppPCI2 = xf86scanpci(0); /* Recursion is only apparent */
- while ((pPCI = *ppPCI2++)) {
- switch (pPCI->pci_device_vendor) {
- case DEVID(VENDOR_HP, CHIP_ZX1_SBA):
- case DEVID(VENDOR_HP, CHIP_ZX1_IOC):
- case DEVID(VENDOR_HP, CHIP_ZX1_LBA):
- xfree(pPCI); /* Remove it */
- continue;
-
- default:
- *ppPCI++ = pPCI;
- idx++;
-
- if (zx1_hasvga)
- continue;
-
- switch (pPCI->pci_base_class) {
- case PCI_CLASS_PREHISTORIC:
- if (pPCI->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
- break;
- continue;
-
- case PCI_CLASS_DISPLAY:
- if (pPCI->pci_sub_class == PCI_SUBCLASS_DISPLAY_VGA)
- break;
- continue;
-
- default:
- continue;
- }
-
- zx1_hasvga = TRUE;
- continue;
- }
- }
-
- /*
- * Restore hard-fail settings and figure out the actual subordinate bus
- * numbers.
- */
- for (i = 0; i < 8; i++) {
- if (zx1_ropemap[i] != i)
- continue;
-
- if (zx1_lbacntl[i] & LBA_HARD_FAIL)
- MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) = zx1_lbacntl[i];
-
- while ((zx1_busno[i] < zx1_subno[i]) && !pciBusInfo[zx1_subno[i]])
- zx1_subno[i]--;
-
- if (zx1_fakebus <= zx1_subno[i])
- zx1_fakebus = zx1_subno[i] + 1;
- }
-
- if (zx1_fakebus >= pciNumBuses) {
- if (zx1_fakebus >= pciMaxBusNum)
- FatalError("HP ZX1: No room for fake PCI bus\n");
- pciNumBuses = zx1_fakebus + 1;
- }
-
- /* Set up our extra bus functions */
- zx1BusFuncs = *(pciBusInfo[0]->funcs);
- zx1BusFuncs.pciControlBridge = ControlZX1Bridge;
- zx1BusFuncs.pciGetBridgeResources = GetZX1BridgeResources;
-
- /* Set up our own fake bus to act as the root segment */
- zx1FakeBus.configMech = pciBusInfo[0]->configMech;
- zx1FakeBus.numDevices = pciBusInfo[0]->numDevices;
- zx1FakeBus.primary_bus = zx1_fakebus;
- pciBusInfo[zx1_fakebus] = &zx1FakeBus;
-
- /* Add the fake bus' host bridge */
- if (++idx >= MAX_PCI_DEVICES)
- FatalError("HP ZX1: No room for fake Host-to-PCI bridge\n");
- *ppPCI++ = zx1FakeBus.bridge = pPCI = xnfcalloc(1, sizeof(pciDevice));
- pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, 0, 0);
- pPCI->busnum = zx1_fakebus;
- /* pPCI->devnum = pPCI->funcnum = 0; */
- pPCI->pci_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_SBA);
- pPCI->pci_base_class = PCI_CLASS_BRIDGE;
- /* pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_HOST; */
- pPCI->fakeDevice = TRUE;
-
-#ifdef OLD_FORMAT
- xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
- "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum,
- pPCI->pci_vendor, pPCI->pci_device, pPCI->pci_rev_id,
- pPCI->pci_base_class, pPCI->pci_sub_class);
-#else
- xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
- " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum,
- pPCI->pci_vendor, pPCI->pci_device,
- pPCI->pci_subsys_vendor, pPCI->pci_subsys_card,
- pPCI->pci_rev_id, pPCI->pci_base_class,
- pPCI->pci_sub_class, pPCI->pci_prog_if,
- pPCI->pci_header_type);
-#endif
-
- /* Add a fake PCI-to-PCI bridge to represent each active rope */
- for (i = 0; i < 8; i++) {
- if ((zx1_ropemap[i] != i) || !(pBusInfo = pciBusInfo[zx1_busno[i]]))
- continue;
-
- if (++idx >= MAX_PCI_DEVICES)
- FatalError("HP ZX1: No room for fake PCI-to-PCI bridge\n");
- *ppPCI++ = pPCI = xnfcalloc(1, sizeof(pciDevice));
- pPCI->busnum = zx1_fakebus;
- pPCI->devnum = i | 0x10;
- /* pPCI->funcnum = 0; */
- pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, pPCI->devnum, 0);
- pPCI->pci_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_LBA);
- pPCI->pci_base_class = PCI_CLASS_BRIDGE;
- pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_PCI;
- pPCI->pci_header_type = 1;
- pPCI->pci_primary_bus_number = zx1_fakebus;
- pPCI->pci_secondary_bus_number = zx1_busno[i];
- pPCI->pci_subordinate_bus_number = zx1_subno[i];
- pPCI->fakeDevice = TRUE;
-
- pBusInfo->bridge = pPCI;
- pBusInfo->secondary = TRUE;
- pBusInfo->primary_bus = zx1_fakebus;
-
- /* Plug in chipset routines */
- pBusInfo->funcs = &zx1BusFuncs;
-
-#ifdef OLD_FORMAT
- xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
- "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum,
- pPCI->pci_vendor, pPCI->pci_device, pPCI->pci_rev_id,
- pPCI->pci_base_class, pPCI->pci_sub_class);
-#else
- xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
- " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
- pPCI->busnum, pPCI->devnum, pPCI->funcnum,
- pPCI->pci_vendor, pPCI->pci_device,
- pPCI->pci_subsys_vendor, pPCI->pci_subsys_card,
- pPCI->pci_rev_id, pPCI->pci_base_class,
- pPCI->pci_sub_class, pPCI->pci_prog_if,
- pPCI->pci_header_type);
-#endif
- }
-
- *ppPCI = NULL; /* Terminate array */
-}
diff --git a/hw/xfree86/os-support/bus/zx1PCI.h b/hw/xfree86/os-support/bus/zx1PCI.h
deleted file mode 100644
index b1e8a95b5..000000000
--- a/hw/xfree86/os-support/bus/zx1PCI.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
-/*
- * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef PCI_ZX1_H
-#define PCI_ZX1_H 1
-
-#include <X11/Xdefs.h>
-
-Bool xf86PreScanZX1(void);
-void xf86PostScanZX1(void);
-
-#endif
diff --git a/hw/xfree86/os-support/drm/drmmodule.c b/hw/xfree86/os-support/drm/drmmodule.c
deleted file mode 100644
index 8be822445..000000000
--- a/hw/xfree86/os-support/drm/drmmodule.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* drmmodule.c -- Module initialization
- * Created: Fri Jun 4 09:05:48 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/drmmodule.c,v 1.3 2000/06/17 00:03:34 martin Exp $
- *
- */
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(drmSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "drm",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData drmModuleData = { &VersRec, drmSetup, NULL };
-
-static pointer
-drmSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- return (void *)1;
-}
diff --git a/hw/xfree86/os-support/int10Defines.h b/hw/xfree86/os-support/int10Defines.h
deleted file mode 100644
index 77d2f4db9..000000000
--- a/hw/xfree86/os-support/int10Defines.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.4 2003/08/24 17:37:03 dawes Exp $ */
-/*
- * Copyright (c) 2000-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _INT10DEFINES_H_
-#define _INT10DEFINES_H_ 1
-
-#ifdef _VM86_LINUX
-
-#include <asm/vm86.h>
-
-#define CPU_R(type,name,num) \
- (((type *)&(((struct vm86_struct *)REG->cpuRegs)->regs.name))[num])
-#define CPU_RD(name,num) CPU_R(CARD32,name,num)
-#define CPU_RW(name,num) CPU_R(CARD16,name,num)
-#define CPU_RB(name,num) CPU_R(CARD8,name,num)
-
-#define X86_EAX CPU_RD(eax,0)
-#define X86_EBX CPU_RD(ebx,0)
-#define X86_ECX CPU_RD(ecx,0)
-#define X86_EDX CPU_RD(edx,0)
-#define X86_ESI CPU_RD(esi,0)
-#define X86_EDI CPU_RD(edi,0)
-#define X86_EBP CPU_RD(ebp,0)
-#define X86_EIP CPU_RD(eip,0)
-#define X86_ESP CPU_RD(esp,0)
-#define X86_EFLAGS CPU_RD(eflags,0)
-
-#define X86_FLAGS CPU_RW(eflags,0)
-#define X86_AX CPU_RW(eax,0)
-#define X86_BX CPU_RW(ebx,0)
-#define X86_CX CPU_RW(ecx,0)
-#define X86_DX CPU_RW(edx,0)
-#define X86_SI CPU_RW(esi,0)
-#define X86_DI CPU_RW(edi,0)
-#define X86_BP CPU_RW(ebp,0)
-#define X86_IP CPU_RW(eip,0)
-#define X86_SP CPU_RW(esp,0)
-#define X86_CS CPU_RW(cs,0)
-#define X86_DS CPU_RW(ds,0)
-#define X86_ES CPU_RW(es,0)
-#define X86_SS CPU_RW(ss,0)
-#define X86_FS CPU_RW(fs,0)
-#define X86_GS CPU_RW(gs,0)
-
-#define X86_AL CPU_RB(eax,0)
-#define X86_BL CPU_RB(ebx,0)
-#define X86_CL CPU_RB(ecx,0)
-#define X86_DL CPU_RB(edx,0)
-
-#define X86_AH CPU_RB(eax,1)
-#define X86_BH CPU_RB(ebx,1)
-#define X86_CH CPU_RB(ecx,1)
-#define X86_DH CPU_RB(edx,1)
-
-#elif defined(_X86EMU)
-
-#include "xf86x86emu.h"
-
-#endif
-
-#endif
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
deleted file mode 100644
index 11fe19f67..000000000
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.31 2003/09/24 02:43:35 dawes Exp $ */
-/*
- * linux specific part of the int10 module
- * Copyright 1999 Egbert Eich
- */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "xf86Pci.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-#ifdef __sparc__
-#define DEV_MEM "/dev/fb"
-#else
-#define DEV_MEM "/dev/mem"
-#endif
-#ifndef XFree86LOADER
-#include <sys/mman.h>
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-#endif
-#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
-#define SHMERRORPTR (pointer)(-1)
-
-static int counter = 0;
-static unsigned long int10Generation = 0;
-
-static CARD8 read_b(xf86Int10InfoPtr pInt, int addr);
-static CARD16 read_w(xf86Int10InfoPtr pInt, int addr);
-static CARD32 read_l(xf86Int10InfoPtr pInt, int addr);
-static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val);
-static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val);
-static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val);
-
-int10MemRec linuxMem = {
- read_b,
- read_w,
- read_l,
- write_b,
- write_w,
- write_l
-};
-
-typedef struct {
- int lowMem;
- int highMem;
- char* base;
- char* base_high;
- int screen;
- char* alloc;
-} linuxInt10Priv;
-
-#if defined DoSubModules
-
-typedef enum {
- INT10_NOT_LOADED,
- INT10_LOADED_VM86,
- INT10_LOADED_X86EMU,
- INT10_LOAD_FAILED
-} Int10LinuxSubModuleState;
-
-static Int10LinuxSubModuleState loadedSubModule = INT10_NOT_LOADED;
-
-static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn);
-
-#endif /* DoSubModules */
-
-xf86Int10InfoPtr
-xf86InitInt10(int entityIndex)
-{
- return xf86ExtendedInitInt10(entityIndex, 0);
-}
-
-xf86Int10InfoPtr
-xf86ExtendedInitInt10(int entityIndex, int Flags)
-{
- xf86Int10InfoPtr pInt = NULL;
- CARD8 *bios_base;
- int screen;
- int fd;
- static void* vidMem = NULL;
- static void* sysMem = NULL;
- void* vMem = NULL;
- void *options = NULL;
- int low_mem;
- int high_mem = -1;
- char *base = SHMERRORPTR;
- char *base_high = SHMERRORPTR;
- int pagesize;
- memType cs;
- legacyVGARec vga;
- xf86int10BiosLocation bios;
- Bool videoBiosMapped = FALSE;
-
- if (int10Generation != serverGeneration) {
- counter = 0;
- int10Generation = serverGeneration;
- }
-
- screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
-
- options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
-
- if (int10skip(options)) {
- xfree(options);
- return NULL;
- }
-
-#if defined DoSubModules
- if (loadedSubModule == INT10_NOT_LOADED)
- loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]);
-
- if (loadedSubModule == INT10_LOAD_FAILED)
- return NULL;
-#endif
-
- if ((!vidMem) || (!sysMem)) {
- if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
- if (!sysMem) {
-#ifdef DEBUG
- ErrorF("Mapping sys bios area\n");
-#endif
- if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
- PROT_READ | PROT_EXEC,
- MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
- == MAP_FAILED) {
- xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n");
- close(fd);
- goto error0;
- }
- }
- if (!vidMem) {
-#ifdef DEBUG
- ErrorF("Mapping VRAM area\n");
-#endif
- if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_SHARED | MAP_FIXED, fd, V_RAM))
- == MAP_FAILED) {
- xf86DrvMsg(screen, X_ERROR, "Cannot map V_RAM\n");
- close(fd);
- goto error0;
- }
- }
- close(fd);
- } else {
- xf86DrvMsg(screen, X_ERROR, "Cannot open %s\n", DEV_MEM);
- goto error0;
- }
- }
-
- pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
- pInt->scrnIndex = screen;
- pInt->entityIndex = entityIndex;
- if (!xf86Int10ExecSetup(pInt))
- goto error0;
- pInt->mem = &linuxMem;
- pagesize = getpagesize();
- pInt->private = (pointer)xnfcalloc(1, sizeof(linuxInt10Priv));
- ((linuxInt10Priv*)pInt->private)->screen = screen;
- ((linuxInt10Priv*)pInt->private)->alloc =
- (pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize));
-
- if (!xf86IsEntityPrimary(entityIndex)) {
-#ifdef DEBUG
- ErrorF("Mapping high memory area\n");
-#endif
- if ((high_mem = shmget(counter++, HIGH_MEM_SIZE,
- IPC_CREAT | SHM_R | SHM_W)) == -1) {
- if (errno == ENOSYS)
- xf86DrvMsg(screen, X_ERROR, "shmget error\n Please reconfigure"
- " your kernel to include System V IPC support\n");
- goto error1;
- }
- } else {
-#ifdef DEBUG
- ErrorF("Mapping Video BIOS\n");
-#endif
- videoBiosMapped = TRUE;
- if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
- if ((vMem = mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_SHARED | MAP_FIXED, fd, V_BIOS))
- == MAP_FAILED) {
- xf86DrvMsg(screen, X_ERROR, "Cannot map V_BIOS\n");
- close(fd);
- goto error1;
- }
- close (fd);
- } else
- goto error1;
- }
- ((linuxInt10Priv*)pInt->private)->highMem = high_mem;
-
-#ifdef DEBUG
- ErrorF("Mapping 640kB area\n");
-#endif
- if ((low_mem = shmget(counter++, V_RAM,
- IPC_CREAT | SHM_R | SHM_W)) == -1)
- goto error2;
-
- ((linuxInt10Priv*)pInt->private)->lowMem = low_mem;
- base = shmat(low_mem, 0, 0);
- if (base == SHMERRORPTR) goto error4;
- ((linuxInt10Priv *)pInt->private)->base = base;
- if (high_mem > -1) {
- base_high = shmat(high_mem, 0, 0);
- if (base_high == SHMERRORPTR) goto error4;
- ((linuxInt10Priv*)pInt->private)->base_high = base_high;
- } else
- ((linuxInt10Priv*)pInt->private)->base_high = NULL;
-
- MapCurrentInt10(pInt);
- Int10Current = pInt;
-
-#ifdef DEBUG
- ErrorF("Mapping int area\n");
-#endif
- if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
- goto error3;
- }
-#ifdef DEBUG
- ErrorF("done\n");
-#endif
- /*
- * Read in everything between V_BIOS and SYS_BIOS as some system BIOSes
- * have executable code there. Note that xf86ReadBIOS() can only bring in
- * 64K bytes at a time.
- */
- if (!videoBiosMapped) {
- (void)memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
-#ifdef DEBUG
- ErrorF("Reading BIOS\n");
-#endif
- for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
- if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x%06lX.\n", cs);
-#ifdef DEBUG
- ErrorF("done\n");
-#endif
- }
-
- xf86int10ParseBiosLocation(options,&bios);
-
- if (xf86IsEntityPrimary(entityIndex)
- && !(initPrimary(options))) {
- if (bios.bus == BUS_ISA && bios.location.legacy) {
- xf86DrvMsg(screen, X_CONFIG,
- "Overriding BIOS location: 0x%x\n",
- bios.location.legacy);
- cs = bios.location.legacy >> 4;
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen, X_ERROR,
- "No V_BIOS at specified address 0x%lx\n",cs << 4);
- goto error3;
- }
- } else {
- if (bios.bus == BUS_PCI) {
- xf86DrvMsg(screen, X_WARNING,
- "Option BiosLocation for primary device ignored: "
- "It points to PCI.\n");
- xf86DrvMsg(screen, X_WARNING,
- "You must set Option InitPrimary also\n");
- }
-
- cs = ((CARD16*)0)[(0x10<<1) + 1];
-
- bios_base = (unsigned char *)(cs << 4);
-
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = ((CARD16*)0)[(0x42 << 1) + 1];
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = V_BIOS >> 4;
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
- goto error3;
- }
- }
- }
- }
-
- xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", cs);
-
- pInt->BIOSseg = cs;
- set_return_trap(pInt);
-#ifdef _PC
- pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
- if (! (pInt->Flags & SET_BIOS_SCRATCH))
- pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
- xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
-#endif
- } else {
- EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
- BusType location_type;
-
- if (bios.bus != BUS_NONE) {
- switch (location_type = bios.bus) {
- case BUS_PCI:
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "PCI:%i:%i%i\n",bios.location.pci.bus,
- bios.location.pci.dev,bios.location.pci.func);
- break;
- case BUS_ISA:
- if (bios.location.legacy)
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "Legacy:0x%x\n",bios.location.legacy);
- else
- xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
- "Legacy\n");
- break;
- default:
- break;
- }
- } else
- location_type = pEnt->location.type;
-
- switch (location_type) {
- case BUS_PCI:
- {
- int pci_entity;
-
- if (bios.bus == BUS_PCI)
- pci_entity = xf86GetPciEntity(bios.location.pci.bus,
- bios.location.pci.dev,
- bios.location.pci.func);
- else
- pci_entity = pInt->entityIndex;
- if (!mapPciRom(pci_entity, (unsigned char *)(V_BIOS))) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS\n");
- goto error3;
- }
- pInt->BIOSseg = V_BIOS >> 4;
- break;
- }
- case BUS_ISA:
- if (bios.bus == BUS_ISA && bios.location.legacy) {
- cs = bios.location.legacy >> 4;
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen,X_ERROR,"No V_BIOS found "
- "on override address %p\n",bios_base);
- goto error3;
- }
- } else {
- cs = ((CARD16*)0)[(0x10<<1)+1];
- bios_base = (unsigned char *)(cs << 4);
-
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = ((CARD16*)0)[(0x42<<1)+1];
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = V_BIOS >> 4;
- bios_base = (unsigned char *)(cs << 4);
- if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
- goto error3;
- }
- }
- }
- }
- xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%lx\n",cs);
- pInt->BIOSseg = cs;
- break;
- default:
- goto error3;
- }
- xfree(pEnt);
- pInt->num = 0xe6;
- reset_int_vect(pInt);
- set_return_trap(pInt);
- LockLegacyVGA(pInt, &vga);
- xf86ExecX86int10(pInt);
- UnlockLegacyVGA(pInt, &vga);
- }
-#ifdef DEBUG
- dprint(0xc0000, 0x20);
-#endif
-
- xfree(options);
- return pInt;
-
-error4:
- xf86DrvMsg(screen, X_ERROR, "shmat() call retruned errno %d\n", errno);
-error3:
- if (base_high)
- shmdt(base_high);
- shmdt(base);
- shmdt(0);
- if (base_high)
- shmdt((char*)HIGH_MEM);
- shmctl(low_mem, IPC_RMID, NULL);
- Int10Current = NULL;
-error2:
- if (high_mem > -1)
- shmctl(high_mem, IPC_RMID,NULL);
-error1:
- if (vMem)
- munmap(vMem, SYS_BIOS - V_BIOS);
- xfree(((linuxInt10Priv*)pInt->private)->alloc);
- xfree(pInt->private);
-error0:
- xfree(options);
- xfree(pInt);
- return NULL;
-}
-
-Bool
-MapCurrentInt10(xf86Int10InfoPtr pInt)
-{
- pointer addr;
- int fd = -1;
-
- if (Int10Current) {
- shmdt(0);
- if (((linuxInt10Priv*)Int10Current->private)->highMem >= 0)
- shmdt((char*)HIGH_MEM);
- else
- munmap((pointer)V_BIOS, (SYS_BIOS - V_BIOS));
- }
- addr = shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND);
- if (addr == SHMERRORPTR) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n");
- return FALSE;
- }
-
- if (((linuxInt10Priv*)pInt->private)->highMem >= 0) {
- addr = shmat(((linuxInt10Priv*)pInt->private)->highMem,
- (char*)HIGH_MEM, 0);
- if (addr == SHMERRORPTR) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "Cannot shmat() high memory\n");
- return FALSE;
- }
- } else {
- if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
- if (mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_SHARED | MAP_FIXED, fd, V_BIOS)
- == MAP_FAILED) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n");
- close (fd);
- return FALSE;
- }
- } else {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n",DEV_MEM);
- return FALSE;
- }
- close (fd);
- }
-
- return TRUE;
-}
-
-void
-xf86FreeInt10(xf86Int10InfoPtr pInt)
-{
- if (!pInt)
- return;
-
-#ifdef _PC
- xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
-#endif
- if (Int10Current == pInt) {
- shmdt(0);
- if (((linuxInt10Priv*)pInt->private)->highMem >= 0)
- shmdt((char*)HIGH_MEM);
- else
- munmap((pointer)V_BIOS, (SYS_BIOS - V_BIOS));
- Int10Current = NULL;
- }
-
- if (((linuxInt10Priv*)pInt->private)->base_high)
- shmdt(((linuxInt10Priv*)pInt->private)->base_high);
- shmdt(((linuxInt10Priv*)pInt->private)->base);
- shmctl(((linuxInt10Priv*)pInt->private)->lowMem, IPC_RMID, NULL);
- if (((linuxInt10Priv*)pInt->private)->highMem >= 0)
- shmctl(((linuxInt10Priv*)pInt->private)->highMem, IPC_RMID, NULL);
- xfree(((linuxInt10Priv*)pInt->private)->alloc);
- xfree(pInt->private);
- xfree(pInt);
-}
-
-void *
-xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
-{
- int pagesize = getpagesize();
- int num_pages = ALLOC_ENTRIES(pagesize);
- int i, j;
-
- for (i = 0; i < (num_pages - num); i++) {
- if (((linuxInt10Priv*)pInt->private)->alloc[i] == 0) {
- for (j = i; j < (num + i); j++)
- if ((((linuxInt10Priv*)pInt->private)->alloc[j] != 0))
- break;
- if (j == (num + i))
- break;
- else
- i = i + num;
- }
- }
- if (i == (num_pages - num))
- return NULL;
-
- for (j = i; j < (i + num); j++)
- ((linuxInt10Priv*)pInt->private)->alloc[j] = 1;
-
- *off = (i + 1) * pagesize;
-
- return ((linuxInt10Priv*)pInt->private)->base + ((i + 1) * pagesize);
-}
-
-void
-xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
-{
- int pagesize = getpagesize();
- int first = (((unsigned long)pbase
- - (unsigned long)((linuxInt10Priv*)pInt->private)->base)
- / pagesize) - 1;
- int i;
-
- for (i = first; i < (first + num); i++)
- ((linuxInt10Priv*)pInt->private)->alloc[i] = 0;
-}
-
-static CARD8
-read_b(xf86Int10InfoPtr pInt, int addr)
-{
- return *((CARD8 *)(memType)addr);
-}
-
-static CARD16
-read_w(xf86Int10InfoPtr pInt, int addr)
-{
- return *((CARD16 *)(memType)addr);
-}
-
-static CARD32
-read_l(xf86Int10InfoPtr pInt, int addr)
-{
- return *((CARD32 *)(memType)addr);
-}
-
-static void
-write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
-{
- *((CARD8 *)(memType)addr) = val;
-}
-
-static void
-write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
-{
- *((CARD16 *)(memType)addr) = val;
-}
-
-static
-void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
-{
- *((CARD32 *)(memType) addr) = val;
-}
-
-pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
-{
- if (addr < V_RAM)
- return ((linuxInt10Priv*)pInt->private)->base + addr;
- else if (addr < V_BIOS)
- return (pointer)(memType)addr;
- else if (addr < SYS_BIOS) {
- if (((linuxInt10Priv*)pInt->private)->base_high)
- return (pointer)(((linuxInt10Priv*)pInt->private)->base_high
- - V_BIOS + addr);
- else
- return (pointer) (memType)addr;
- } else
- return (pointer) (memType)addr;
-}
-
-#if defined DoSubModules
-
-static Bool
-vm86_tst(void)
-{
- int __res;
-
-#ifdef __PIC__
- /* When compiling with -fPIC, we can't use asm constraint "b" because
- %ebx is already taken by gcc. */
- __asm__ __volatile__("pushl %%ebx\n\t"
- "movl %2,%%ebx\n\t"
- "movl %1,%%eax\n\t"
- "int $0x80\n\t"
- "popl %%ebx"
- :"=a" (__res)
- :"n" ((int)113), "r" (NULL));
-#else
- __asm__ __volatile__("int $0x80\n\t"
- :"=a" (__res):"a" ((int)113),
- "b" ((struct vm86_struct *)NULL));
-#endif
-
- if (__res < 0 && __res == -ENOSYS)
- return FALSE;
-
- return TRUE;
-}
-
-static Int10LinuxSubModuleState
-int10LinuxLoadSubModule(ScrnInfoPtr pScrn)
-{
- if (vm86_tst()) {
- if (xf86LoadSubModule(pScrn,"vm86"))
- return INT10_LOADED_VM86;
- }
- if (xf86LoadSubModule(pScrn,"x86emu"))
- return INT10_LOADED_X86EMU;
-
- return INT10_LOAD_FAILED;
-}
-
-#endif /* DoSubModules */
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
deleted file mode 100644
index dc737ac47..000000000
--- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c,v 1.3 2003/11/03 05:36:33 tsi Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "xf86Pci.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-
-#define REG pInt
-
-#ifdef _VM86_LINUX
-#include "int10Defines.h"
-
-static int vm86_rep(struct vm86_struct *ptr);
-static struct vm86_struct vm86_s;
-
-Bool
-xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
-{
-#define VM86S ((struct vm86_struct *)pInt->cpuRegs)
-
- pInt->cpuRegs = &vm86_s;
- VM86S->flags = 0;
- VM86S->screen_bitmap = 0;
- VM86S->cpu_type = CPU_586;
- memset(&VM86S->int_revectored, 0xff, sizeof(VM86S->int_revectored));
- memset(&VM86S->int21_revectored, 0xff, sizeof(VM86S->int21_revectored));
- return TRUE;
-}
-
-/* get the linear address */
-#define LIN_PREF_SI ((pref_seg << 4) + X86_SI)
-#define LWECX ((prefix66 ^ prefix67) ? X86_ECX : X86_CX)
-#define LWECX_ZERO {if (prefix66 ^ prefix67) X86_ECX = 0; else X86_CX = 0;}
-#define DF (1 << 10)
-
-/* vm86 fault handling */
-static Bool
-vm86_GP_fault(xf86Int10InfoPtr pInt)
-{
- unsigned char *csp, *lina;
- CARD32 org_eip;
- int pref_seg;
- int done, is_rep, prefix66, prefix67;
-
- csp = lina = SEG_ADR((unsigned char *), X86_CS, IP);
-
- is_rep = 0;
- prefix66 = prefix67 = 0;
- pref_seg = -1;
-
- /* eat up prefixes */
- done = 0;
- do {
- switch (MEM_RB(pInt, (int)csp++)) {
- case 0x66: /* operand prefix */ prefix66=1; break;
- case 0x67: /* address prefix */ prefix67=1; break;
- case 0x2e: /* CS */ pref_seg=X86_CS; break;
- case 0x3e: /* DS */ pref_seg=X86_DS; break;
- case 0x26: /* ES */ pref_seg=X86_ES; break;
- case 0x36: /* SS */ pref_seg=X86_SS; break;
- case 0x65: /* GS */ pref_seg=X86_GS; break;
- case 0x64: /* FS */ pref_seg=X86_FS; break;
- case 0xf0: /* lock */ break;
- case 0xf2: /* repnz */
- case 0xf3: /* rep */ is_rep=1; break;
- default: done=1;
- }
- } while (!done);
- csp--; /* oops one too many */
- org_eip = X86_EIP;
- X86_IP += (csp - lina);
-
- switch (MEM_RB(pInt, (int)csp)) {
- case 0x6c: /* insb */
- /* NOTE: ES can't be overwritten; prefixes 66,67 should use esi,edi,ecx
- * but is anyone using extended regs in real mode? */
- /* WARNING: no test for DI wrapping! */
- X86_EDI += port_rep_inb(pInt, X86_DX, SEG_EADR((CARD32), X86_ES, DI),
- X86_FLAGS & DF, is_rep ? LWECX : 1);
- if (is_rep) LWECX_ZERO;
- X86_IP++;
- break;
-
- case 0x6d: /* (rep) insw / insd */
- /* NOTE: ES can't be overwritten */
- /* WARNING: no test for _DI wrapping! */
- if (prefix66) {
- X86_DI += port_rep_inl(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
- X86_EFLAGS & DF, is_rep ? LWECX : 1);
- }
- else {
- X86_DI += port_rep_inw(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
- X86_FLAGS & DF, is_rep ? LWECX : 1);
- }
- if (is_rep) LWECX_ZERO;
- X86_IP++;
- break;
-
- case 0x6e: /* (rep) outsb */
- if (pref_seg < 0) pref_seg = X86_DS;
- /* WARNING: no test for _SI wrapping! */
- X86_SI += port_rep_outb(pInt, X86_DX, (CARD32)LIN_PREF_SI,
- X86_FLAGS & DF, is_rep ? LWECX : 1);
- if (is_rep) LWECX_ZERO;
- X86_IP++;
- break;
-
- case 0x6f: /* (rep) outsw / outsd */
- if (pref_seg < 0) pref_seg = X86_DS;
- /* WARNING: no test for _SI wrapping! */
- if (prefix66) {
- X86_SI += port_rep_outl(pInt, X86_DX, (CARD32)LIN_PREF_SI,
- X86_EFLAGS & DF, is_rep ? LWECX : 1);
- }
- else {
- X86_SI += port_rep_outw(pInt, X86_DX, (CARD32)LIN_PREF_SI,
- X86_FLAGS & DF, is_rep ? LWECX : 1);
- }
- if (is_rep) LWECX_ZERO;
- X86_IP++;
- break;
-
- case 0xe5: /* inw xx, inl xx */
- if (prefix66) X86_EAX = x_inl(csp[1]);
- else X86_AX = x_inw(csp[1]);
- X86_IP += 2;
- break;
-
- case 0xe4: /* inb xx */
- X86_AL = x_inb(csp[1]);
- X86_IP += 2;
- break;
-
- case 0xed: /* inw dx, inl dx */
- if (prefix66) X86_EAX = x_inl(X86_DX);
- else X86_AX = x_inw(X86_DX);
- X86_IP += 1;
- break;
-
- case 0xec: /* inb dx */
- X86_AL = x_inb(X86_DX);
- X86_IP += 1;
- break;
-
- case 0xe7: /* outw xx */
- if (prefix66) x_outl(csp[1], X86_EAX);
- else x_outw(csp[1], X86_AX);
- X86_IP += 2;
- break;
-
- case 0xe6: /* outb xx */
- x_outb(csp[1], X86_AL);
- X86_IP += 2;
- break;
-
- case 0xef: /* outw dx */
- if (prefix66) x_outl(X86_DX, X86_EAX);
- else x_outw(X86_DX, X86_AX);
- X86_IP += 1;
- break;
-
- case 0xee: /* outb dx */
- x_outb(X86_DX, X86_AL);
- X86_IP += 1;
- break;
-
- case 0xf4:
-#ifdef DEBUG
- ErrorF("hlt at %p\n", lina);
-#endif
- return FALSE;
-
- case 0x0f:
- xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP);
- goto op0ferr;
-
- default:
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n");
-
- op0ferr:
- dump_registers(pInt);
- stack_trace(pInt);
- dump_code(pInt);
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n");
- return FALSE;
- } /* end of switch() */
- return TRUE;
-}
-
-static int
-do_vm86(xf86Int10InfoPtr pInt)
-{
- int retval, signo;
-
- xf86InterceptSignals(&signo);
- retval = vm86_rep(VM86S);
- xf86InterceptSignals(NULL);
-
- if (signo >= 0) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "vm86() syscall generated signal %d.\n", signo);
- dump_registers(pInt);
- dump_code(pInt);
- stack_trace(pInt);
- return 0;
- }
-
- switch (VM86_TYPE(retval)) {
- case VM86_UNKNOWN:
- if (!vm86_GP_fault(pInt)) return 0;
- break;
- case VM86_STI:
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n");
- dump_registers(pInt);
- dump_code(pInt);
- stack_trace(pInt);
- return 0;
- case VM86_INTx:
- pInt->num = VM86_ARG(retval);
- if (!int_handler(pInt)) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval));
- dump_registers(pInt);
- dump_code(pInt);
- stack_trace(pInt);
- return 0;
- }
- /* I'm not sure yet what to do if we can handle ints */
- break;
- case VM86_SIGNAL:
- return 1;
- /*
- * we used to warn here and bail out - but now the sigio stuff
- * always fires signals at us. So we just ignore them for now.
- */
- xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n");
- return 0;
- default:
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
- VM86_ARG(retval), VM86_TYPE(retval));
- dump_registers(pInt);
- dump_code(pInt);
- stack_trace(pInt);
- return 0;
- }
-
- return 1;
-}
-
-void
-xf86ExecX86int10(xf86Int10InfoPtr pInt)
-{
- int sig = setup_int(pInt);
-
- if (int_handler(pInt))
- while(do_vm86(pInt)) {};
-
- finish_int(pInt, sig);
-}
-
-static int
-vm86_rep(struct vm86_struct *ptr)
-{
- int __res;
-
-#ifdef __PIC__
- /* When compiling with -fPIC, we can't use asm constraint "b" because
- %ebx is already taken by gcc. */
- __asm__ __volatile__("pushl %%ebx\n\t"
- "movl %2,%%ebx\n\t"
- "movl %1,%%eax\n\t"
- "int $0x80\n\t"
- "popl %%ebx"
- :"=a" (__res)
- :"n" ((int)113), "r" ((struct vm86_struct *)ptr));
-#else
- __asm__ __volatile__("int $0x80\n\t"
- :"=a" (__res):"a" ((int)113),
- "b" ((struct vm86_struct *)ptr));
-#endif
-
- if (__res < 0) {
- errno = -__res;
- __res = -1;
- }
- else errno = 0;
- return __res;
-}
-
-#endif
diff --git a/hw/xfree86/os-support/linux/lnx.h b/hw/xfree86/os-support/linux/lnx.h
deleted file mode 100644
index f2dd16267..000000000
--- a/hw/xfree86/os-support/linux/lnx.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx.h,v 3.3 2002/11/25 14:05:04 eich Exp $ */
-
-#ifndef LNX_H_
-# ifdef __alpha__
-extern unsigned long _bus_base __P ((void)) __attribute__ ((const));
-extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const));
-extern int iopl __P ((int __level));
-
-/* new pciconfig_iobase syscall added in 2.2.15 and 2.3.99 */
-# include <linux/unistd.h>
-# include <asm/pci.h>
-extern long (*_iobase)(unsigned, int, int, int);
-
-/*
- * _iobase deals with the case the __NR_pciconfig_iobase is either undefined
- * or unsupported by the kernel, but we need to make sure that the `which'
- * argument symbols are defined.
- */
-# ifndef IOBASE_HOSE
-# define IOBASE_HOSE 0
-# endif
-# ifndef IOBASE_SPARSE_MEM
-# define IOBASE_SPARSE_MEM 1
-# endif
-# ifndef IOBASE_DENSE_MEM
-# define IOBASE_DENSE_MEM 2
-# endif
-# ifndef IOBASE_SPARSE_IO
-# define IOBASE_SPARSE_IO 3
-# endif
-# ifndef IOBASE_DENSE_IO
-# define IOBASE_DENSE_IO 4
-# endif
-# ifndef IOBASE_ROOT_BUS
-# define IOBASE_ROOT_BUS 5
-# endif
-# ifndef IOBASE_FROM_HOSE
-# define IOBASE_FROM_HOSE 0x10000
-# endif
-# endif /* __alpha__ */
-
-#define LNX_H_
-
-#endif
diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c
deleted file mode 100644
index 04e2f07c0..000000000
--- a/hw/xfree86/os-support/linux/lnxResource.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.18 2002/01/25 21:56:19 tsi Exp $ */
-
-/* Resource information code */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86Pci.h"
-#include "xf86Resources.h"
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSlib.h"
-#include "lnx.h"
-
-/* Avoid Imakefile changes */
-#include "bus/Pci.h"
-
-resRange PciAvoid[] =
-{
-#if !defined(__sparc__) || !defined(INCLUDE_XF86_NO_DOMAIN)
- _PCI_AVOID_PC_STYLE,
-#endif
- _END
-};
-
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
-#ifdef __alpha__
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
- /*
- * On the Alpha the first 16MB of every 128 Mb segment in
- * sparse address space are an image of the ISA bus range
- */
- if (_bus_base_sparse()) {
- RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- } else {
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- }
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
-xf86AccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * Fallback is to claim the following areas:
- *
- * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
- */
-
- RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
- * along with their sparse I/O aliases, but that's too imprecise. Instead
- * claim a bare minimum here.
- */
- RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1); */
- RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* XXX add others */
- return ret;
-}
-
-#elif defined(__powerpc__) || \
- defined(__sparc__) || \
- defined(__mips__) || \
- defined(__sh__) || \
- defined(__mc68000__) || \
- defined(__arm__) || \
- defined(__s390__) || \
- defined(__hppa__)
-
- /* XXX this isn't exactly correct but it will get the server working
- * for now until we get something better.
- */
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#ifdef __sparc__
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#ifdef __sparc__
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED */
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#ifdef __sparc__
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
-xf86AccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
- RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-#ifdef __sparc__
- RANGE(range, 0x00ffffff, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
-
- return ret;
-}
-
-#else
-
-#error : Put your platform dependent code here!!
-
-#endif
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/linux/lnx_KbdMap.c b/hw/xfree86/os-support/linux/lnx_KbdMap.c
deleted file mode 100644
index 25639d72d..000000000
--- a/hw/xfree86/os-support/linux/lnx_KbdMap.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_KbdMap.c,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
-
-/*
- * Slightly modified xf86KbdLnx.c which is
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- */
-
-#include "X.h"
-#include "Xmd.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSKbd.h"
-#include "atKeynames.h"
-
-#include "xf86Keymap.h"
-#include "DECkeysym.h"
-
-#include "lnx_kbd.h"
-
-/*ARGSUSED*/
-
-/*
- * KbdGetMapping --
- * Get the national keyboard mapping. The keyboard type is set, a new map
- * and the modifiermap is computed.
- */
-
-static void readKernelMapping(InputInfoPtr pInfo,
- KeySymsPtr pKeySyms, CARD8 *pModMap);
-void
-KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- KeySym *k;
- char type;
- int i;
-
- readKernelMapping(pInfo, pKeySyms, pModMap);
-
- /*
- * compute the modifier map
- */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = map, i = MIN_KEYCODE;
- i < (NUM_KEYCODES + MIN_KEYCODE);
- i++, k += 4)
-
- switch(*k) {
-
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* kana support */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
-
- }
-
- pKbd->kbdType = ioctl(pInfo->fd, KDGKBTYPE, &type) != -1 ? type : KB_101;
-
- pKeySyms->map = map;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-#include <linux/keyboard.h>
-
-static KeySym linux_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
-};
-
-/*
- * Maps the AT keycodes to Linux keycodes
- */
-static unsigned char at2lnx[NUM_KEYCODES] =
-{
- 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
- 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
- 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
- 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
- 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
- 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
- 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
- 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
- 0x11, /* KEY_W */ 0x12, /* KEY_E */
- 0x13, /* KEY_R */ 0x14, /* KEY_T */
- 0x15, /* KEY_Y */ 0x16, /* KEY_U */
- 0x17, /* KEY_I */ 0x18, /* KEY_O */
- 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
- 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
- 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
- 0x1f, /* KEY_S */ 0x20, /* KEY_D */
- 0x21, /* KEY_F */ 0x22, /* KEY_G */
- 0x23, /* KEY_H */ 0x24, /* KEY_J */
- 0x25, /* KEY_K */ 0x26, /* KEY_L */
- 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
- 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
- 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
- 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
- 0x2f, /* KEY_V */ 0x30, /* KEY_B */
- 0x31, /* KEY_N */ 0x32, /* KEY_M */
- 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
- 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
- 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
- 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
- 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
- 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
- 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
- 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
- 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
- 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
- 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
- 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
- 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
- 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
- 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
- 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
- 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
- 0x00, /* 0x55 */ 0x56, /* KEY_Less */
- 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
- 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
- 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
- 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
- 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
- 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
- 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
- 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
- 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
- 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
- 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
- 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
- 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
- 0x00, /* 0x71 */ 0x00, /* 0x72 */
- 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
- 0x00, /* 0x75 */ 0x00, /* 0x76 */
- 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
- 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
- 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
- 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
- 0x00, /* 0x7f */
-};
-#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
-
-#define NUM_CUSTOMKEYS NR_KEYS
-
-static void
-readKernelMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- KeySym *k;
- int i;
- int maxkey;
- static unsigned char tbl[GLYPHS_PER_KEY] =
- {
- 0, /* unshifted */
- 1, /* shifted */
- 0, /* modeswitch unshifted */
- 0 /* modeswitch shifted */
- };
-
- /*
- * Read the mapping from the kernel.
- * Since we're still using the XFree86 scancode->AT keycode mapping
- * routines, we need to convert the AT keycodes to Linux keycodes,
- * then translate the Linux keysyms into X keysyms.
- *
- * First, figure out which tables to use for the modeswitch columns
- * above, from the XF86Config fields.
- */
- tbl[2] = 8; /* alt */
- tbl[3] = tbl[2] | 1;
-
- if (pKbd->CustomKeycodes) {
- k = map;
- maxkey = NUM_CUSTOMKEYS;
- }
- else {
- k = map+GLYPHS_PER_KEY;
- maxkey = NUM_AT2LNX;
- }
-
- for (i = 0; i < maxkey; ++i)
- {
- struct kbentry kbe;
- int j;
-
- if (pKbd->CustomKeycodes)
- kbe.kb_index = i;
- else
- kbe.kb_index = at2lnx[i];
-
- for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k)
- {
- unsigned short kval;
-
- *k = NoSymbol;
-
- kbe.kb_table = tbl[j];
- if (
- (!pKbd->CustomKeycodes && kbe.kb_index == 0) ||
- ioctl(pInfo->fd, KDGKBENT, &kbe))
- continue;
-
- kval = KVAL(kbe.kb_value);
- switch (KTYP(kbe.kb_value))
- {
- case KT_LATIN:
- case KT_LETTER:
- *k = linux_to_x[kval];
- break;
-
- case KT_FN:
- if (kval <= 19)
- *k = XK_F1 + kval;
- else switch (kbe.kb_value)
- {
- case K_FIND:
- *k = XK_Home; /* or XK_Find */
- break;
- case K_INSERT:
- *k = XK_Insert;
- break;
- case K_REMOVE:
- *k = XK_Delete;
- break;
- case K_SELECT:
- *k = XK_End; /* or XK_Select */
- break;
- case K_PGUP:
- *k = XK_Prior;
- break;
- case K_PGDN:
- *k = XK_Next;
- break;
- case K_HELP:
- *k = XK_Help;
- break;
- case K_DO:
- *k = XK_Execute;
- break;
- case K_PAUSE:
- *k = XK_Pause;
- break;
- case K_MACRO:
- *k = XK_Menu;
- break;
- default:
- break;
- }
- break;
-
- case KT_SPEC:
- switch (kbe.kb_value)
- {
- case K_ENTER:
- *k = XK_Return;
- break;
- case K_BREAK:
- *k = XK_Break;
- break;
- case K_CAPS:
- *k = XK_Caps_Lock;
- break;
- case K_NUM:
- *k = XK_Num_Lock;
- break;
- case K_HOLD:
- *k = XK_Scroll_Lock;
- break;
- case K_COMPOSE:
- *k = XK_Multi_key;
- break;
- default:
- break;
- }
- break;
-
- case KT_PAD:
- switch (kbe.kb_value)
- {
- case K_PPLUS:
- *k = XK_KP_Add;
- break;
- case K_PMINUS:
- *k = XK_KP_Subtract;
- break;
- case K_PSTAR:
- *k = XK_KP_Multiply;
- break;
- case K_PSLASH:
- *k = XK_KP_Divide;
- break;
- case K_PENTER:
- *k = XK_KP_Enter;
- break;
- case K_PCOMMA:
- *k = XK_KP_Separator;
- break;
- case K_PDOT:
- *k = XK_KP_Decimal;
- break;
- case K_PPLUSMINUS:
- *k = XK_KP_Subtract;
- break;
- default:
- if (kval <= 9)
- *k = XK_KP_0 + kval;
- break;
- }
- break;
-
- /*
- * KT_DEAD keys are for accelerated diacritical creation.
- */
- case KT_DEAD:
- switch (kbe.kb_value)
- {
- case K_DGRAVE:
- *k = XK_dead_grave;
- break;
- case K_DACUTE:
- *k = XK_dead_acute;
- break;
- case K_DCIRCM:
- *k = XK_dead_circumflex;
- break;
- case K_DTILDE:
- *k = XK_dead_tilde;
- break;
- case K_DDIERE:
- *k = XK_dead_diaeresis;
- break;
- }
- break;
-
- case KT_CUR:
- switch (kbe.kb_value)
- {
- case K_DOWN:
- *k = XK_Down;
- break;
- case K_LEFT:
- *k = XK_Left;
- break;
- case K_RIGHT:
- *k = XK_Right;
- break;
- case K_UP:
- *k = XK_Up;
- break;
- }
- break;
-
- case KT_SHIFT:
- switch (kbe.kb_value)
- {
- case K_ALTGR:
- *k = XK_Alt_R;
- break;
- case K_ALT:
- *k = (kbe.kb_index == 0x64 ?
- XK_Alt_R : XK_Alt_L);
- break;
- case K_CTRL:
- *k = (kbe.kb_index == 0x61 ?
- XK_Control_R : XK_Control_L);
- break;
- case K_CTRLL:
- *k = XK_Control_L;
- break;
- case K_CTRLR:
- *k = XK_Control_R;
- break;
- case K_SHIFT:
- *k = (kbe.kb_index == 0x36 ?
- XK_Shift_R : XK_Shift_L);
- break;
- case K_SHIFTL:
- *k = XK_Shift_L;
- break;
- case K_SHIFTR:
- *k = XK_Shift_R;
- break;
- default:
- break;
- }
- break;
-
- /*
- * KT_ASCII keys accumulate a 3 digit decimal number that gets
- * emitted when the shift state changes. We can't emulate that.
- */
- case KT_ASCII:
- break;
-
- case KT_LOCK:
- if (kbe.kb_value == K_SHIFTLOCK)
- *k = XK_Shift_Lock;
- break;
-
- default:
- break;
- }
- }
-
- if (k[-1] == k[-2]) k[-1] = NoSymbol;
- if (k[-2] == k[-3]) k[-2] = NoSymbol;
- if (k[-3] == k[-4]) k[-3] = NoSymbol;
- if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
- if (k[-1] == k[-4] && k[-2] == k[-3] && k[-2] == NoSymbol) k[-1] =NoSymbol;
- }
-
- if (!pKbd->CustomKeycodes)
- return;
-
- /*
- * Find the Mapping for the special server functions
- */
- pKbd->specialMap = (TransMapPtr) xcalloc(NUM_CUSTOMKEYS, 1);
- if (pKbd->specialMap != NULL) {
- pKbd->specialMap->end = NUM_CUSTOMKEYS;
- pKbd->specialMap->map = (unsigned char*) xcalloc(NUM_CUSTOMKEYS, 1);
- if (pKbd->specialMap == NULL) {
- xfree(pKbd->specialMap);
- pKbd->specialMap = NULL;
- }
- }
- if (pKbd->specialMap == NULL) {
- xf86Msg(X_ERROR, "%s can't allocate \"special map\"\n", pInfo->name);
- return;
- }
-
- for (i = 0; i < NUM_CUSTOMKEYS; ++i) {
- struct kbentry kbe;
- int special = 0;
-
- kbe.kb_index = i;
- kbe.kb_table = 0; /* Plain map */
- if (!ioctl(pInfo->fd, KDGKBENT, &kbe))
- switch (kbe.kb_value) {
- case K(KT_LATIN,0x7f): /* This catches DEL too... But who cares? */
- special = KEY_BackSpace;
- break;
- case K_PMINUS:
- special = KEY_KP_Minus;
- break;
- case K_PPLUS:
- special = KEY_KP_Plus;
- break;
- case K_F1:
- special = KEY_F1;
- break;
- case K_F2:
- special = KEY_F2;
- break;
- case K_F3:
- special = KEY_F3;
- break;
- case K_F4:
- special = KEY_F4;
- break;
- case K_F5:
- special = KEY_F5;
- break;
- case K_F6:
- special = KEY_F6;
- break;
- case K_F7:
- special = KEY_F7;
- break;
- case K_F8:
- special = KEY_F8;
- break;
- case K_F9:
- special = KEY_F9;
- break;
- case K_F10:
- special = KEY_F10;
- break;
- case K_F11:
- special = KEY_F11;
- break;
- case K_F12:
- special = KEY_F12;
- break;
- case K_ALT:
- special = KEY_Alt;
- break;
- case K_ALTGR:
- special = KEY_AltLang;
- break;
- case K_CONS:
- special = KEY_SysReqest;
- break;
- }
- pKbd->specialMap->map[i] = special;
- }
-}
diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c
deleted file mode 100644
index acac20bce..000000000
--- a/hw/xfree86/os-support/linux/lnx_agp.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Abstraction of the AGP GART interface.
- *
- * This version is for both Linux and FreeBSD.
- *
- * Copyright © 2000 VA Linux Systems, Inc.
- * Copyright © 2001 The XFree86 Project, Inc.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.12 2003/09/24 02:43:35 dawes Exp $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(linux)
-#include <asm/ioctl.h>
-#include <linux/agpgart.h>
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/ioctl.h>
-#include <sys/agpio.h>
-#endif
-
-#ifndef AGP_DEVICE
-#define AGP_DEVICE "/dev/agpgart"
-#endif
-/* AGP page size is independent of the host page size. */
-#ifndef AGP_PAGE_SIZE
-#define AGP_PAGE_SIZE 4096
-#endif
-#define AGPGART_MAJOR_VERSION 0
-#define AGPGART_MINOR_VERSION 99
-
-static int gartFd = -1;
-static int acquiredScreen = -1;
-static Bool initDone = FALSE;
-/*
- * Close /dev/agpgart. This frees all associated memory allocated during
- * this server generation.
- */
-Bool
-xf86GARTCloseScreen(int screenNum)
-{
- if(gartFd != -1) {
- close(gartFd);
- acquiredScreen = -1;
- gartFd = -1;
- initDone = FALSE;
- }
- return TRUE;
-}
-
-/*
- * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called.
- */
-static Bool
-GARTInit(int screenNum)
-{
- struct _agp_info agpinf;
-
- if (initDone)
- return (gartFd != -1);
-
- initDone = TRUE;
-
- if (gartFd == -1)
- gartFd = open(AGP_DEVICE, O_RDWR, 0);
- else
- return FALSE;
-
- if (gartFd == -1) {
- xf86DrvMsg(screenNum, X_ERROR,
- "GARTInit: Unable to open " AGP_DEVICE " (%s)\n",
- strerror(errno));
- return FALSE;
- }
-
- xf86AcquireGART(-1);
- /* Check the kernel driver version. */
- if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
- xf86DrvMsg(screenNum, X_ERROR,
- "GARTInit: AGPIOC_INFO failed (%s)\n", strerror(errno));
- close(gartFd);
- gartFd = -1;
- return FALSE;
- }
- xf86ReleaseGART(-1);
-
-#if defined(linux)
- /* Per Dave Jones, every effort will be made to keep the
- * agpgart interface backwards compatible, so allow all
- * future versions.
- */
- if (
-#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
- agpinf.version.major < AGPGART_MAJOR_VERSION ||
-#endif
- (agpinf.version.major == AGPGART_MAJOR_VERSION &&
- agpinf.version.minor < AGPGART_MINOR_VERSION)) {
- xf86DrvMsg(screenNum, X_ERROR,
- "GARTInit: Kernel agpgart driver version is not current"
- " (%d.%d vs %d.%d)\n",
- agpinf.version.major, agpinf.version.minor,
- AGPGART_MAJOR_VERSION, AGPGART_MINOR_VERSION);
- close(gartFd);
- gartFd = -1;
- return FALSE;
- }
-#endif
-
- return TRUE;
-}
-
-Bool
-xf86AgpGARTSupported()
-{
- return GARTInit(-1);
-}
-
-AgpInfoPtr
-xf86GetAGPInfo(int screenNum)
-{
- struct _agp_info agpinf;
- AgpInfoPtr info;
-
- if (!GARTInit(screenNum))
- return NULL;
-
-
- if ((info = xcalloc(sizeof(AgpInfo), 1)) == NULL) {
- xf86DrvMsg(screenNum, X_ERROR,
- "xf86GetAGPInfo: Failed to allocate AgpInfo\n");
- return NULL;
- }
-
- if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
- xf86DrvMsg(screenNum, X_ERROR,
- "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n",
- strerror(errno));
- return NULL;
- }
-
- info->bridgeId = agpinf.bridge_id;
- info->agpMode = agpinf.agp_mode;
- info->base = agpinf.aper_base;
- info->size = agpinf.aper_size;
- info->totalPages = agpinf.pg_total;
- info->systemPages = agpinf.pg_system;
- info->usedPages = agpinf.pg_used;
-
- return info;
-}
-
-/*
- * XXX If multiple screens can acquire the GART, should we have a reference
- * count instead of using acquiredScreen?
- */
-
-Bool
-xf86AcquireGART(int screenNum)
-{
- if (screenNum != -1 && !GARTInit(screenNum))
- return FALSE;
-
- if (screenNum == -1 || acquiredScreen != screenNum) {
- if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) {
- xf86DrvMsg(screenNum, X_WARNING,
- "xf86AcquireGART: AGPIOC_ACQUIRE failed (%s)\n",
- strerror(errno));
- return FALSE;
- }
- acquiredScreen = screenNum;
- }
- return TRUE;
-}
-
-Bool
-xf86ReleaseGART(int screenNum)
-{
- if (screenNum != -1 && !GARTInit(screenNum))
- return FALSE;
-
- if (acquiredScreen == screenNum) {
- /*
- * The FreeBSD agp driver removes allocations on release.
- * The Linux driver doesn't. xf86ReleaseGART() is expected
- * to give up access to the GART, but not to remove any
- * allocations.
- */
-#if !defined(linux)
- if (screenNum == -1)
-#endif
- {
- if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) {
- xf86DrvMsg(screenNum, X_WARNING,
- "xf86ReleaseGART: AGPIOC_RELEASE failed (%s)\n",
- strerror(errno));
- return FALSE;
- }
- acquiredScreen = -1;
- }
- return TRUE;
- }
- return FALSE;
-}
-
-int
-xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
- unsigned long *physical)
-{
- struct _agp_allocate alloc;
- int pages;
-
- /*
- * Allocates "size" bytes of GART memory (rounds up to the next
- * page multiple) or type "type". A handle (key) for the allocated
- * memory is returned. On error, the return value is -1.
- */
-
- if (!GARTInit(screenNum) || acquiredScreen != screenNum)
- return -1;
-
- pages = (size / AGP_PAGE_SIZE);
- if (size % AGP_PAGE_SIZE != 0)
- pages++;
-
- /* XXX check for pages == 0? */
-
- alloc.pg_count = pages;
- alloc.type = type;
-
- if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) {
- xf86DrvMsg(screenNum, X_WARNING, "xf86AllocateGARTMemory: "
- "allocation of %d pages failed\n\t(%s)\n", pages,
- strerror(errno));
- return -1;
- }
-
- if (physical)
- *physical = alloc.physical;
-
- return alloc.key;
-}
-
-
-/* Bind GART memory with "key" at "offset" */
-Bool
-xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
-{
- struct _agp_bind bind;
- int pageOffset;
-
- if (!GARTInit(screenNum) || acquiredScreen != screenNum)
- return FALSE;
-
- if (acquiredScreen != screenNum) {
- xf86DrvMsg(screenNum, X_ERROR,
- "xf86BindGARTMemory: AGP not acquired by this screen\n");
- return FALSE;
- }
-
- if (offset % AGP_PAGE_SIZE != 0) {
- xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
- "offset (0x%lx) is not page-aligned (%d)\n",
- offset, AGP_PAGE_SIZE);
- return FALSE;
- }
- pageOffset = offset / AGP_PAGE_SIZE;
-
- xf86DrvMsgVerb(screenNum, X_INFO, 3,
- "xf86BindGARTMemory: bind key %d at 0x%08lx "
- "(pgoffset %d)\n", key, offset, pageOffset);
-
- bind.pg_start = pageOffset;
- bind.key = key;
-
- if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) {
- xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
- "binding of gart memory with key %d\n"
- "\tat offset 0x%lx failed (%s)\n",
- key, offset, strerror(errno));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/* Unbind GART memory with "key" */
-Bool
-xf86UnbindGARTMemory(int screenNum, int key)
-{
- struct _agp_unbind unbind;
-
- if (!GARTInit(screenNum) || acquiredScreen != screenNum)
- return FALSE;
-
- if (acquiredScreen != screenNum) {
- xf86DrvMsg(screenNum, X_ERROR,
- "xf86UnbindGARTMemory: AGP not acquired by this screen\n");
- return FALSE;
- }
-
- unbind.priority = 0;
- unbind.key = key;
-
- if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) {
- xf86DrvMsg(screenNum, X_WARNING, "xf86UnbindGARTMemory: "
- "unbinding of gart memory with key %d "
- "failed (%s)\n", key, strerror(errno));
- return FALSE;
- }
-
- xf86DrvMsgVerb(screenNum, X_INFO, 3,
- "xf86UnbindGARTMemory: unbind key %d\n", key);
-
- return TRUE;
-}
-
-
-/* XXX Interface may change. */
-Bool
-xf86EnableAGP(int screenNum, CARD32 mode)
-{
- agp_setup setup;
-
- if (!GARTInit(screenNum) || acquiredScreen != screenNum)
- return FALSE;
-
- setup.agp_mode = mode;
- if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) {
- xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: "
- "AGPIOC_SETUP with mode %ld failed (%s)\n",
- (unsigned long)mode, strerror(errno));
- return FALSE;
- }
-
- return TRUE;
-}
-
diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
deleted file mode 100644
index f2f326959..000000000
--- a/hw/xfree86/os-support/linux/lnx_apm.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c,v 3.13 2002/10/16 01:24:28 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-#include "lnx.h"
-#include <linux/apm_bios.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#define APM_PROC "/proc/apm"
-#define APM_DEVICE "/dev/apm_bios"
-
-#ifndef APM_STANDBY_FAILED
-# define APM_STANDBY_FAILED 0xf000
-#endif
-#ifndef APM_SUSPEND_FAILED
-# define APM_SUSPEND_FAILED 0xf001
-#endif
-
-static void lnxCloseAPM(void);
-static pointer APMihPtr = NULL;
-
-static struct {
- apm_event_t apmLinux;
- pmEvent xf86;
-} LinuxToXF86[] = {
- { APM_SYS_STANDBY, XF86_APM_SYS_STANDBY },
- { APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND },
- { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
- { APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME },
- { APM_LOW_BATTERY, XF86_APM_LOW_BATTERY },
- { APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
- { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
- { APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND },
- { APM_USER_STANDBY, XF86_APM_USER_STANDBY },
- { APM_USER_SUSPEND, XF86_APM_USER_SUSPEND },
- { APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
-#if defined(APM_CAPABILITY_CHANGED)
- { APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED },
-#endif
-#if 0
- { APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED },
- { APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED }
-#endif
-};
-
-#define numApmEvents (sizeof(LinuxToXF86) / sizeof(LinuxToXF86[0]))
-
-/*
- * APM is still under construction.
- * I'm not sure if the places where I initialize/deinitialize
- * apm is correct. Also I don't know what to do in SETUP state.
- * This depends if wakeup gets called in this situation, too.
- * Also we need to check if the action that is taken on an
- * event is reasonable.
- */
-static int
-lnxPMGetEventFromOs(int fd, pmEvent *events, int num)
-{
- int i,j,n;
- apm_event_t linuxEvents[8];
-
- if ((n = read( fd, linuxEvents, num * sizeof(apm_event_t) )) == -1)
- return 0;
- n /= sizeof(apm_event_t);
- if (n > num)
- n = num;
- for (i = 0; i < n; i++) {
- for (j = 0; j < numApmEvents; j++)
- if (LinuxToXF86[j].apmLinux == linuxEvents[i]) {
- events[i] = LinuxToXF86[j].xf86;
- break;
- }
- if (j == numApmEvents)
- events[i] = XF86_APM_UNKNOWN;
- }
- return n;
-}
-
-static pmWait
-lnxPMConfirmEventToOs(int fd, pmEvent event)
-{
- switch (event) {
- case XF86_APM_SYS_STANDBY:
- case XF86_APM_USER_STANDBY:
- if (ioctl( fd, APM_IOC_STANDBY, NULL ))
- return PM_FAILED;
- return PM_CONTINUE;
- case XF86_APM_SYS_SUSPEND:
- case XF86_APM_CRITICAL_SUSPEND:
- case XF86_APM_USER_SUSPEND:
- if (ioctl( fd, APM_IOC_SUSPEND, NULL )) {
- if (errno == EBUSY)
- return PM_CONTINUE;
- else
- return PM_FAILED;
- }
- return PM_CONTINUE;
- case XF86_APM_STANDBY_RESUME:
- case XF86_APM_NORMAL_RESUME:
- case XF86_APM_CRITICAL_RESUME:
- case XF86_APM_STANDBY_FAILED:
- case XF86_APM_SUSPEND_FAILED:
- return PM_CONTINUE;
- default:
- return PM_NONE;
- }
-}
-
-PMClose
-xf86OSPMOpen(void)
-{
- int fd, pfd;
-
-#ifdef DEBUG
- ErrorF("APM: OSPMOpen called\n");
-#endif
- if (APMihPtr || !xf86Info.pmFlag)
- return NULL;
-
-#ifdef DEBUG
- ErrorF("APM: Opening device\n");
-#endif
- if ((fd = open( APM_DEVICE, O_RDWR )) > -1) {
- if (access( APM_PROC, R_OK ) ||
- ((pfd = open( APM_PROC, O_RDONLY)) == -1)) {
- xf86MsgVerb(X_WARNING,3,"Cannot open APM (%s) (%s)\n",
- APM_PROC, strerror(errno));
- close(fd);
- return NULL;
- } else
- close(pfd);
- xf86PMGetEventFromOs = lnxPMGetEventFromOs;
- xf86PMConfirmEventToOs = lnxPMConfirmEventToOs;
- APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL);
- xf86MsgVerb(X_INFO,3,"Open APM successful\n");
- return lnxCloseAPM;
- }
- xf86MsgVerb(X_WARNING,3,"Open APM failed (%s) (%s)\n", APM_DEVICE,
- strerror(errno));
- return NULL;
-}
-
-static void
-lnxCloseAPM(void)
-{
- int fd;
-
-#ifdef DEBUG
- ErrorF("APM: Closing device\n");
-#endif
- if (APMihPtr) {
- fd = xf86RemoveInputHandler(APMihPtr);
- close(fd);
- APMihPtr = NULL;
- }
-}
-
diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
deleted file mode 100644
index 5813ef4e9..000000000
--- a/hw/xfree86/os-support/linux/lnx_axp.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c,v 1.5 2002/11/25 14:05:04 eich Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Axp.h"
-
-axpDevice lnxGetAXP(void);
-
-typedef struct
- { char* sysName;
- char* sysVari;
- char* cpu;
- axpDevice sys; }
-AXP;
-
-static AXP axpList[] = {
- { "Tsunami", NULL, NULL, TSUNAMI },
- { "Eiger", NULL, NULL, TSUNAMI },
- {"Noname", NULL, NULL, LCA },
- { "AlphaBook1", NULL, NULL, LCA },
- {"EB66", NULL, NULL, LCA},
- {"EB64+",NULL,NULL, APECS},
- {"Noritake",NULL,"EV5",CIA},
- {"Noritake",NULL,"EV56",CIA},
- {"Noritake",NULL,NULL,APECS},
- {"XL",NULL,NULL,APECS},
- {"Avanti",NULL,NULL,APECS},
- {"Mikasa",NULL,"EV5",CIA},
- {"Mikasa",NULL,"EV56",CIA},
- {"Mikasa",NULL,NULL,APECS},
- {"EB164","EB164",NULL,CIA},
- {"EB164","PC164", NULL,CIA},
- {"EB164","LX164",NULL, PYXIS},
- {"EB164","SX164",NULL, PYXIS},
- {"EB164","RX164",NULL, POLARIS},
- {"Alcor",NULL,NULL,CIA},
- {"Takara",NULL,NULL,CIA},
- {"Sable",NULL, "EV5",T2_GAMMA},
- {"Sable",NULL,"EV56",T2_GAMMA},
- {"Sable",NULL,NULL,T2},
- {"Rawhide",NULL,NULL,MCPCIA},
- {"Jensen",NULL,NULL,JENSEN},
- {"Miata",NULL,NULL,PYXIS_CIA},
- {"Ruffian",NULL,NULL,PYXIS_CIA},
- {"Nautilus",NULL,NULL,IRONGATE},
- {NULL,NULL,NULL,NONE}
-};
-
-
-axpDevice
-lnxGetAXP(void)
-{
- FILE *file;
- int count = 0;
- char res[256];
- char cpu[255];
- char systype[255];
- char sysvari[255];
- if (!(file = fopen("/proc/cpuinfo","r")))
- return SYS_NONE;
- do {
- if (!fgets(res,0xff,file)) return SYS_NONE;
- switch (count) {
- case 1:
- sscanf(res, "cpu model : %s",cpu);
-#ifdef DEBUG
- ErrorF("CPU %s\n",cpu);
-#endif
- break;
- case 5:
- sscanf(res, "system type : %s",systype);
-#ifdef DEBUG
- ErrorF("system type : %s\n",systype);
-#endif
- break;
- case 6:
- sscanf(res, "system variation : %s",sysvari);
-#ifdef DEBUG
- ErrorF("system variation: %s\n",sysvari);
-#endif
- break;
- }
- count++;
- } while (count < 8);
-
- fclose(file);
-
- count = 0;
-
- do {
- if (!axpList[count].sysName || !strcmp(axpList[count].sysName,systype)) {
- if (axpList[count].sysVari && strcmp(axpList[count].sysVari,sysvari)) {
- count++;
- continue;
- };
- if (axpList[count].cpu && strcmp(axpList[count].cpu,cpu)) {
- count++;
- continue;
- }
- return axpList[count].sys;
- }
- count++;
- } while (1);
-}
-
-/*
- * pciconfig_iobase wrappers and dynamic i/o selection
- */
-#include <linux/unistd.h>
-#include <asm/pci.h>
-#include <errno.h>
-
-/* glibc versions (single hose only) */
-extern void _outb(char val, unsigned long port);
-extern void _outw(short val, unsigned long port);
-extern void _outl(int val, unsigned long port);
-extern unsigned int _inb(unsigned long port);
-extern unsigned int _inw(unsigned long port);
-extern unsigned int _inl(unsigned long port);
-
-extern void _dense_outb(char, unsigned long);
-extern void _dense_outw(short, unsigned long);
-extern void _dense_outl(int, unsigned long);
-extern unsigned int _dense_inb(unsigned long);
-extern unsigned int _dense_inw(unsigned long);
-extern unsigned int _dense_inl(unsigned long);
-
-void (*_alpha_outb)(char, unsigned long) = _outb;
-void (*_alpha_outw)(short, unsigned long) = _outw;
-void (*_alpha_outl)(int, unsigned long) = _outl;
-unsigned int (*_alpha_inb)(unsigned long) = _inb;
-unsigned int (*_alpha_inw)(unsigned long) = _inw;
-unsigned int (*_alpha_inl)(unsigned long) = _inl;
-
-static long _alpha_iobase_query(unsigned, int, int, int);
-long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
-
-static long
-_alpha_iobase(unsigned flags, int hose, int bus, int devfn)
-{
-#ifdef __NR_pciconfig_iobase
- if (bus < 0) {
- bus = hose;
- flags |= IOBASE_FROM_HOSE;
- }
-
- return syscall(__NR_pciconfig_iobase, flags, bus, devfn);
-#else
- return -ENOSYS
-#endif
-}
-
-static long
-_alpha_iobase_legacy(unsigned flags, int hose, int bus, int devfn)
-{
- if (hose > 0) return -ENODEV;
- if (flags & IOBASE_DENSE_MEM) return _bus_base();
- if (flags & IOBASE_SPARSE_MEM) return _bus_base_sparse();
- return 0;
-}
-
-static long
-_alpha_iobase_query(unsigned flags, int hose, int bus, int devfn)
-{
- /*
- * Only use iobase if the syscall is supported *and* it's
- * a dense io system
- */
- if (_alpha_iobase(IOBASE_DENSE_IO, 0, 0, 0) > 0) {
- /*
- * The syscall worked and it's a dense io system - take over the
- * io subsystem
- */
- _iobase = _alpha_iobase;
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
- /*
- * Only take over the inx/outx functions if this is a dense I/O
- * system *and* addressing domains are being used. The dense I/O
- * routines expect I/O to be mapped (as done in xf86MapDomainIO)
- */
- _alpha_outb = _dense_outb;
- _alpha_outw = _dense_outw;
- _alpha_outl = _dense_outl;
- _alpha_inb = _dense_inb;
- _alpha_inw = _dense_inw;
- _alpha_inl = _dense_inl;
-#endif /* !INCLUDE_XF86_NO_DOMAIN */
- } else _iobase = _alpha_iobase_legacy;
-
- return _iobase(flags, hose, bus, devfn);
-}
-
diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c b/hw/xfree86/os-support/linux/lnx_ev56.c
deleted file mode 100644
index bfcb0d70f..000000000
--- a/hw/xfree86/os-support/linux/lnx_ev56.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c,v 3.7 2002/11/25 14:05:04 eich Exp $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-int readDense8(pointer Base, register unsigned long Offset);
-int readDense16(pointer Base, register unsigned long Offset);
-int readDense32(pointer Base, register unsigned long Offset);
-void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-int
-readDense8(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD8*) ((unsigned long)Base+(Offset));
-}
-
-int
-readDense16(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD16*) ((unsigned long)Base+(Offset));
-}
-
-int
-readDense32(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(volatile CARD32*)((unsigned long)Base+(Offset));
-}
-
-void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD8*)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD16*)((unsigned long)Base + (Offset)) = Value;
-}
-
-void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(volatile CARD32*)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense8(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD8 *)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense16(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD16 *)((unsigned long)Base+(Offset)) = Value;
-}
-
-void
-writeDense32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value;
-}
-
-
-#ifndef INCLUDE_XF86_NO_DOMAIN
-
-void
-_dense_outb(char val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _outb(val, port);
-
- write_mem_barrier();
- *(volatile CARD8 *)port = val;
-}
-
-void
-_dense_outw(short val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _outw(val, port);
-
- write_mem_barrier();
- *(volatile CARD16 *)port = val;
-}
-
-void
-_dense_outl(int val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _outl(val, port);
-
- write_mem_barrier();
- *(volatile CARD32 *)port = val;
-}
-
-unsigned int
-_dense_inb(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inb(port);
-
- mem_barrier();
- return *(volatile CARD8 *)port;
-}
-
-unsigned int
-_dense_inw(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inw(port);
-
- mem_barrier();
- return *(volatile CARD16 *)port;
-}
-
-unsigned int
-_dense_inl(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inl(port);
-
- mem_barrier();
- return *(volatile CARD32 *)port;
-}
-
-#endif /* !INCLUDE_XF86_NO_DOMAIN */
-
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
deleted file mode 100644
index 0ac8c6a8b..000000000
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c,v 3.14 2001/10/31 22:50:30 tsi Exp $ */
-/*
- * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Orest Zborowski and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Orest Zborowski
- * and David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID WEXELBLAT BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: lnx_init.c /main/7 1996/10/23 18:46:30 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "lnx.h"
-
-#ifdef USE_DEV_FB
-extern char *getenv(const char *);
-#include <linux/fb.h>
-char *fb_dev_name;
-#endif
-
-static Bool KeepTty = FALSE;
-static int VTnum = -1;
-static int activeVT = -1;
-
-void
-xf86OpenConsole(void)
-{
- int i, fd = -1;
- int result;
- struct vt_mode VT;
- char vtname[11];
- struct vt_stat vts;
- MessageType from = X_PROBED;
-#ifdef USE_DEV_FB
- struct fb_var_screeninfo var;
- int fbfd;
-#endif
- char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
- char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
-
- if (serverGeneration == 1)
- {
- /* check if we're run with euid==0 */
- if (geteuid() != 0)
- {
- FatalError("xf86OpenConsole: Server must be suid root\n");
- }
-
- /*
- * setup the virtual terminal manager
- */
- if (VTnum != -1) {
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
- } else {
- i=0;
- while (tty0[i] != NULL)
- {
- if ((fd = open(tty0[i],O_WRONLY,0)) >= 0)
- break;
- i++;
- }
- if (fd < 0)
- FatalError(
- "xf86OpenConsole: Cannot open /dev/tty0 (%s)\n",
- strerror(errno));
- if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1)) {
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
- }
- close(fd);
- }
-
-#ifdef USE_DEV_FB
- fb_dev_name=getenv("FRAMEBUFFER");
- if (!fb_dev_name)
- fb_dev_name="/dev/fb0current";
- if ((fbfd = open(fb_dev_name, O_RDONLY)) < 0)
- FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
- fb_dev_name, strerror(errno));
- if (ioctl(fbfd, FBIOGET_VSCREENINFO, &var))
- FatalError("xf86OpenConsole: Unable to get screen info\n");
-#endif
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
-
- if (!KeepTty) {
- setpgrp();
- }
-
- i=0;
- while (vcs[i] != NULL)
- {
- sprintf(vtname, vcs[i], xf86Info.vtno); /* /dev/tty1-64 */
- if ((xf86Info.consoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) >= 0)
- break;
- i++;
- }
-
- if (xf86Info.consoleFd < 0) {
- FatalError("xf86OpenConsole: Cannot open virtual console %d (%s)\n",
- xf86Info.vtno, strerror(errno));
- }
-
- /* change ownership of the vt */
- chown(vtname, getuid(), getgid());
-
- /*
- * the current VT device we're running on is not "console", we want
- * to grab all consoles too
- *
- * Why is this needed??
- */
- chown("/dev/tty0", getuid(), getgid());
-
- /*
- * Linux doesn't switch to an active vt after the last close of a vt,
- * so we do this ourselves by remembering which is active now.
- */
- if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) == 0)
- {
- activeVT = vts.v_active;
- }
-
- if (!KeepTty)
- {
- /*
- * Detach from the controlling tty to avoid char loss
- */
- if ((i = open("/dev/tty",O_RDWR)) >= 0)
- {
- ioctl(i, TIOCNOTTY, 0);
- close(i);
- }
- }
-
- /*
- * now get the VT
- */
- SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- SYSCALL(result =
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- }
- SYSCALL(result = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
- if (result < 0)
- {
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
- }
-
- signal(SIGUSR1, xf86VTRequest);
-
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- {
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
- }
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
- {
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
- }
-
- /* we really should have a InitOSInputDevices() function instead
- * of Init?$#*&Device(). So I just place it here */
-
-#ifdef USE_DEV_FB
- /* copy info to new console */
- var.yoffset=0;
- var.xoffset=0;
- if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &var))
- FatalError("Unable to set screen info\n");
- close(fbfd);
-#endif
- }
- else
- {
- /* serverGeneration != 1 */
- /*
- * now get the VT
- */
- SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- SYSCALL(result =
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno));
- if (result != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- }
- }
- return;
-}
-
-void
-xf86CloseConsole()
-{
- struct vt_mode VT;
-
-#if 0
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno);
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0);
-#endif
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO;
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */
- }
- /*
- * Perform a switch back to the active VT when we were started
- */
- if (activeVT >= 0)
- {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT);
- activeVT = -1;
- }
- close(xf86Info.consoleFd); /* make the vt-manager happy */
- return;
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful
- * when debugging (so the server can receive keyboard signals.
- */
- if (!strcmp(argv[i], "-keeptty"))
- {
- KeepTty = TRUE;
- return(1);
- }
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
- {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- return(1);
- }
- return(0);
-}
-
-void
-xf86UseMsg()
-{
- ErrorF("vtXX use the specified VT number\n");
- ErrorF("-keeptty ");
- ErrorF("don't detach controlling tty (for debugging only)\n");
- return;
-}
diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c
deleted file mode 100644
index 7631a1ff0..000000000
--- a/hw/xfree86/os-support/linux/lnx_io.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.26 2003/11/17 22:20:41 dawes Exp $ */
-/*
- * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Orest Zborowski and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Orest Zborowski
- * and David Dawes make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: lnx_io.c /main/8 1996/10/19 18:06:28 kaleb $ */
-
-#define NEED_EVENTS
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- if (loudness && pitch)
- {
- ioctl(xf86Info.consoleFd, KDMKTONE,
- ((1193190 / pitch) & 0xffff) |
- (((unsigned long)duration *
- loudness / 50) << 16));
- }
-}
-
-void
-xf86SetKbdLeds(int leds)
-{
- ioctl(xf86Info.consoleFd, KDSETLED, leds);
-}
-
-int
-xf86GetKbdLeds()
-{
- int leds = 0;
-
- ioctl(xf86Info.consoleFd, KDGETLED, &leds);
- return(leds);
-}
-
-/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
- * from util-linux-2.9t package */
-
-#include <linux/kd.h>
-#include <linux/version.h>
-#ifdef __sparc__
-#include <asm/param.h>
-#include <asm/kbio.h>
-#endif
-
-/* Deal with spurious kernel header change */
-#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
-# define rate period
-# endif
-#endif
-
-static int
-KDKBDREP_ioctl_ok(int rate, int delay) {
-#if defined(KDKBDREP) && !defined(__sparc__)
- /* This ioctl is defined in <linux/kd.h> but is not
- implemented anywhere - must be in some m68k patches. */
- struct kbd_repeat kbdrep_s;
-
- /* don't change, just test */
- kbdrep_s.rate = -1;
- kbdrep_s.delay = -1;
- if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- /* do the change */
- if (rate == 0) /* switch repeat off */
- kbdrep_s.rate = 0;
- else
- kbdrep_s.rate = 10000 / rate; /* convert cps to msec */
- if (kbdrep_s.rate < 1)
- kbdrep_s.rate = 1;
- kbdrep_s.delay = delay;
- if (kbdrep_s.delay < 1)
- kbdrep_s.delay = 1;
-
- if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- return 1; /* success! */
-#else /* no KDKBDREP */
- return 0;
-#endif /* KDKBDREP */
-}
-
-static int
-KIOCSRATE_ioctl_ok(int rate, int delay) {
-#ifdef KIOCSRATE
- struct kbd_rate kbdrate_s;
- int fd;
-
- fd = open("/dev/kbd", O_RDONLY);
- if (fd == -1)
- return 0;
-
- kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */
- kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */
- if (kbdrate_s.rate > 50)
- kbdrate_s.rate = 50;
-
- if (ioctl( fd, KIOCSRATE, &kbdrate_s ))
- return 0;
-
- close( fd );
-
- return 1;
-#else /* no KIOCSRATE */
- return 0;
-#endif /* KIOCSRATE */
-}
-
-#undef rate
-
-void xf86SetKbdRepeat(char rad)
-{
-#ifdef __sparc__
- int rate = 500; /* Default rate */
- int delay = 200; /* Default delay */
-#else
- int rate = 300; /* Default rate */
- int delay = 250; /* Default delay */
-#endif
-
-#if defined(__alpha__) || defined (__i386__) || defined(__ia64__)
- int i;
- int timeout;
- int value = 0x7f; /* Maximum delay with slowest rate */
-
- static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150,
- 133, 120, 109, 100, 92, 86, 80, 75, 67,
- 60, 55, 50, 46, 43, 40, 37, 33, 30, 27,
- 25, 23, 21, 20 };
-#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int ))
-
- static int valid_delays[] = { 250, 500, 750, 1000 };
-#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int ))
-#endif
-
- if (xf86Info.kbdRate >= 0)
- rate = xf86Info.kbdRate * 10;
- if (xf86Info.kbdDelay >= 0)
- delay = xf86Info.kbdDelay;
-
-
- if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */
- return;
-
- if(KIOCSRATE_ioctl_ok(rate, delay)) /* sparc? */
- return;
-
- if (xf86IsPc98())
- return;
-
-#if defined(__alpha__) || defined (__i386__) || defined(__ia64__)
-
- /* The ioport way */
-
- for (i = 0; i < RATE_COUNT; i++)
- if (rate >= valid_rates[i]) {
- value &= 0x60;
- value |= i;
- break;
- }
-
- for (i = 0; i < DELAY_COUNT; i++)
- if (delay <= valid_delays[i]) {
- value &= 0x1f;
- value |= i << 5;
- break;
- }
-
- timeout = KBC_TIMEOUT;
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- if (timeout == 0)
- return;
-
- outb(0x60, 0xf3); /* set typematic rate */
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- usleep(10000);
- outb(0x60, value);
-
-#endif /* __alpha__ || __i386__ || __ia64__ */
-}
-
-static int kbdtrans;
-static struct termios kbdtty;
-
-void
-xf86KbdInit()
-{
- ioctl (xf86Info.consoleFd, KDGKBMODE, &kbdtrans);
- tcgetattr (xf86Info.consoleFd, &kbdtty);
-}
-
-int
-xf86KbdOn()
-{
- struct termios nTty;
-
-#ifdef __powerpc__
- if (xf86Info.kbdCustomKeycodes)
- ioctl(xf86Info.consoleFd, KDSKBMODE, K_MEDIUMRAW);
- else
-#endif
- ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW);
-
- nTty = kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME]=0;
- nTty.c_cc[VMIN]=1;
- cfsetispeed(&nTty, 9600);
- cfsetospeed(&nTty, 9600);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
- return(xf86Info.consoleFd);
-}
-
-int
-xf86KbdOff()
-{
- ioctl(xf86Info.consoleFd, KDSKBMODE, kbdtrans);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &kbdtty);
- return(xf86Info.consoleFd);
-}
-
diff --git a/hw/xfree86/os-support/linux/lnx_jstk.c b/hw/xfree86/os-support/linux/lnx_jstk.c
deleted file mode 100644
index 2423bd45e..000000000
--- a/hw/xfree86/os-support/linux/lnx_jstk.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* $XConsortium: lnx_jstk.c /main/7 1996/02/21 17:51:36 kaleb $ */
-/* Id: lnx_jstk.c,v 1.1 1995/12/20 14:06:09 lepied Exp */
-/*
- * Copyright 1995 by Frederic Lepied, France. <fred@sugix.frmug.fr.net>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Frederic Lepied not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_jstk.c,v 3.13 1998/07/25 16:56:43 dawes Exp $ */
-
-static const char rcs_id[] = "Id: lnx_jstk.c,v 1.1 1995/12/20 14:06:09 lepied Exp";
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#define inline __inline__
-#include <linux/joystick.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-
-#ifdef XFree86LOADER
-#include "xf86.h"
-#include "xf86_ansic.h"
-#endif
-
-#if !defined(JSIOCGTIMELIMIT)
-/* make 2.1.x joystick.h backward compatable */
-#define JSIOCGTIMELIMIT JS_GET_TIMELIMIT
-#define JSIOCSTIMELIMIT JS_SET_TIMELIMIT
-#define js_status JS_DATA_TYPE
-#endif
-
-
-/***********************************************************************
- *
- * xf86JoystickOn --
- *
- * open the device and init timeout according to the device value.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickOn(char *name, int *timeout, int *centerX, int *centerY)
-{
- int fd;
- struct js_status js;
-
-#ifdef DEBUG
- ErrorF("xf86JoystickOn %s\n", name);
-#endif
-
- if ((fd = open(name, O_RDWR | O_NDELAY, 0)) < 0)
- {
- xf86Msg(X_WARNING, "Cannot open joystick '%s' (%s)\n", name,
- strerror(errno));
- return -1;
- }
-
- if (*timeout == 0) {
- if (ioctl (fd, JSIOCGTIMELIMIT, timeout) == -1) {
- Error("joystick JSIOCGTIMELIMIT ioctl");
- }
- else {
- xf86Msg(X_CONFIG, "Joystick: timeout value = %d\n", *timeout);
- }
- }
- else {
- if (ioctl(fd, JSIOCSTIMELIMIT, timeout) == -1) {
- Error("joystick JSIOCSTIMELIMIT ioctl");
- }
- }
-
- /* Assume the joystick is centred when this is called */
- read(fd, &js, JS_RETURN);
- if (*centerX < 0) {
- *centerX = js.x;
- xf86Msg(X_CONFIG, "Joystick: CenterX set to %d\n", *centerX);
- }
- if (*centerY < 0) {
- *centerY = js.y;
- xf86Msg(X_CONFIG, "Joystick: CenterY set to %d\n", *centerY);
- }
-
- return fd;
-}
-
-/***********************************************************************
- *
- * xf86JoystickInit --
- *
- * called when X device is initialized.
- *
- ***********************************************************************
- */
-
-void
-xf86JoystickInit()
-{
- return;
-}
-
-/***********************************************************************
- *
- * xf86JoystickOff --
- *
- * close the handle.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickOff(int *fd, int doclose)
-{
- int oldfd;
-
- if (((oldfd = *fd) >= 0) && doclose) {
- close(*fd);
- *fd = -1;
- }
- return oldfd;
-}
-
-/***********************************************************************
- *
- * xf86JoystickGetState --
- *
- * return the state of buttons and the position of the joystick.
- *
- ***********************************************************************
- */
-
-int
-xf86JoystickGetState(int fd, int *x, int *y, int *buttons)
-{
- struct js_status js;
- int status;
-
- status = read(fd, &js, JS_RETURN);
-
- if (status != JS_RETURN)
- {
- Error("Joystick read");
- return 0;
- }
-
- *x = js.x;
- *y = js.y;
- *buttons = js.buttons;
-
- return 1;
-}
-
-#ifdef XFree86LOADER
-/*
- * Entry point for XFree86 Loader
- */
-void
-linux_jstkModuleInit(pointer *data, INT32 *magic)
-{
- *magic = MAGIC_DONE;
- *data = NULL;
-}
-#endif
-
-/* end of lnx_jstk.c */
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c
deleted file mode 100644
index ba18f28a1..000000000
--- a/hw/xfree86/os-support/linux/lnx_kbd.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.5 2003/11/04 03:14:39 tsi Exp $ */
-
-/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
- * Author: Ivan Pascal.
- *
- * Based on the code from lnx_io.c which is
- * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- */
-
-#define NEED_EVENTS
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include "xf86Xinput.h"
-#include "xf86OSKbd.h"
-#include "atKeynames.h"
-#include "lnx_kbd.h"
-
-#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */
-
-static KbdProtocolRec protocols[] = {
- {"standard", PROT_STD },
- { NULL, PROT_UNKNOWN_KBD }
-};
-
-extern Bool VTSwitchEnabled;
-#ifdef USE_VT_SYSREQ
-extern Bool VTSysreqToggle;
-#endif
-
-static void
-SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
-{
- if (loudness && pitch)
- {
- ioctl(pInfo->fd, KDMKTONE,
- ((1193190 / pitch) & 0xffff) |
- (((unsigned long)duration *
- loudness / 50) << 16));
- }
-}
-
-static void
-SetKbdLeds(InputInfoPtr pInfo, int leds)
-{
- int real_leds = 0;
-
-#if defined (__sparc__)
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- if (pKbd->sunKbd) {
- if (leds & 0x08) real_leds |= XLED1;
- if (leds & 0x04) real_leds |= XLED3;
- if (leds & 0x02) real_leds |= XLED4;
- if (leds & 0x01) real_leds |= XLED2;
- leds = real_leds;
- real_leds = 0;
- }
-#endif /* defined (__sparc__) */
-#ifdef LED_CAP
- if (leds & XLED1) real_leds |= LED_CAP;
- if (leds & XLED2) real_leds |= LED_NUM;
- if (leds & XLED3) real_leds |= LED_SCR;
-#ifdef LED_COMP
- if (leds & XLED4) real_leds |= LED_COMP;
-#else
- if (leds & XLED4) real_leds |= LED_SCR;
-#endif
-#endif
- ioctl(pInfo->fd, KDSETLED, real_leds);
-}
-
-static int
-GetKbdLeds(InputInfoPtr pInfo)
-{
- int real_leds, leds = 0;
-
- ioctl(pInfo->fd, KDGETLED, &real_leds);
-
- if (real_leds & LED_CAP) leds |= XLED1;
- if (real_leds & LED_NUM) leds |= XLED2;
- if (real_leds & LED_SCR) leds |= XLED3;
-
- return(leds);
-}
-
-/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
- * from util-linux-2.9t package */
-
-#include <linux/kd.h>
-#include <linux/version.h>
-#ifdef __sparc__
-#include <asm/param.h>
-#include <asm/kbio.h>
-#endif
-
-/* Deal with spurious kernel header change */
-#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
-# define rate period
-# endif
-#endif
-
-static int
-KDKBDREP_ioctl_ok(int rate, int delay) {
-#if defined(KDKBDREP) && !defined(__sparc__)
- /* This ioctl is defined in <linux/kd.h> but is not
- implemented anywhere - must be in some m68k patches. */
- struct kbd_repeat kbdrep_s;
-
- /* don't change, just test */
- kbdrep_s.rate = -1;
- kbdrep_s.delay = -1;
- if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- /* do the change */
- if (rate == 0) /* switch repeat off */
- kbdrep_s.rate = 0;
- else
- kbdrep_s.rate = 10000 / rate; /* convert cps to msec */
- if (kbdrep_s.rate < 1)
- kbdrep_s.rate = 1;
- kbdrep_s.delay = delay;
- if (kbdrep_s.delay < 1)
- kbdrep_s.delay = 1;
-
- if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- return 1; /* success! */
-#else /* no KDKBDREP */
- return 0;
-#endif /* KDKBDREP */
-}
-
-static int
-KIOCSRATE_ioctl_ok(int rate, int delay) {
-#ifdef KIOCSRATE
- struct kbd_rate kbdrate_s;
- int fd;
-
- fd = open("/dev/kbd", O_RDONLY);
- if (fd == -1)
- return 0;
-
- kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */
- kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */
- if (kbdrate_s.rate > 50)
- kbdrate_s.rate = 50;
-
- if (ioctl( fd, KIOCSRATE, &kbdrate_s ))
- return 0;
-
- close( fd );
-
- return 1;
-#else /* no KIOCSRATE */
- return 0;
-#endif /* KIOCSRATE */
-}
-
-#undef rate
-
-static void
-SetKbdRepeat(InputInfoPtr pInfo, char rad)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int i;
- int timeout;
- int value = 0x7f; /* Maximum delay with slowest rate */
-
-#ifdef __sparc__
- int rate = 500; /* Default rate */
- int delay = 200; /* Default delay */
-#else
- int rate = 300; /* Default rate */
- int delay = 250; /* Default delay */
-#endif
-
- static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150,
- 133, 120, 109, 100, 92, 86, 80, 75, 67,
- 60, 55, 50, 46, 43, 40, 37, 33, 30, 27,
- 25, 23, 21, 20 };
-#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int ))
-
- static int valid_delays[] = { 250, 500, 750, 1000 };
-#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int ))
-
- if (pKbd->rate >= 0)
- rate = pKbd->rate * 10;
- if (pKbd->delay >= 0)
- delay = pKbd->delay;
-
- if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */
- return;
-
- if(KIOCSRATE_ioctl_ok(rate, delay)) /* sparc? */
- return;
-
- if (xf86IsPc98())
- return;
-
-#if defined(__alpha__) || defined (__i386__) || defined(__ia64__)
-
- /* The ioport way */
-
- for (i = 0; i < RATE_COUNT; i++)
- if (rate >= valid_rates[i]) {
- value &= 0x60;
- value |= i;
- break;
- }
-
- for (i = 0; i < DELAY_COUNT; i++)
- if (delay <= valid_delays[i]) {
- value &= 0x1f;
- value |= i << 5;
- break;
- }
-
- timeout = KBC_TIMEOUT;
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- if (timeout == 0)
- return;
-
- outb(0x60, 0xf3); /* set typematic rate */
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- usleep(10000);
- outb(0x60, value);
-
-#endif /* __alpha__ || __i386__ || __ia64__ */
-}
-
-typedef struct {
- int kbdtrans;
- struct termios kbdtty;
-} LnxKbdPrivRec, *LnxKbdPrivPtr;
-
-static int
-KbdInit(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
-
- if (pKbd->isConsole) {
- ioctl (pInfo->fd, KDGKBMODE, &(priv->kbdtrans));
- tcgetattr (pInfo->fd, &(priv->kbdtty));
- }
- if (!pKbd->CustomKeycodes) {
- pKbd->RemapScanCode = ATScancode;
- }
-
- return Success;
-}
-
-static int
-KbdOn(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
- struct termios nTty;
-
- if (pKbd->isConsole) {
- if (pKbd->CustomKeycodes)
- ioctl(pInfo->fd, KDSKBMODE, K_MEDIUMRAW);
- else
- ioctl(pInfo->fd, KDSKBMODE, K_RAW);
-
- nTty = priv->kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME]=0;
- nTty.c_cc[VMIN]=1;
- cfsetispeed(&nTty, 9600);
- cfsetospeed(&nTty, 9600);
- tcsetattr(pInfo->fd, TCSANOW, &nTty);
- }
- return Success;
-}
-
-static int
-KbdOff(InputInfoPtr pInfo, int what)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
-
- if (pKbd->isConsole) {
- ioctl(pInfo->fd, KDSKBMODE, priv->kbdtrans);
- tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
- }
- return Success;
-}
-
-static int
-GetSpecialKey(InputInfoPtr pInfo, int scanCode)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int specialkey = scanCode;
-
-#if defined (__sparc__)
- if (pKbd->sunKbd) {
- switch (scanCode) {
- case 0x2b: specialkey = KEY_BackSpace; break;
- case 0x47: specialkey = KEY_KP_Minus; break;
- case 0x7d: specialkey = KEY_KP_Plus; break;
- /* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
- case 0x05: specialkey = KEY_F1; break;
- case 0x06: specialkey = KEY_F2; break;
- case 0x08: specialkey = KEY_F3; break;
- case 0x0a: specialkey = KEY_F4; break;
- case 0x0c: specialkey = KEY_F5; break;
- case 0x0e: specialkey = KEY_F6; break;
- case 0x10: specialkey = KEY_F7; break;
- case 0x11: specialkey = KEY_F8; break;
- case 0x12: specialkey = KEY_F9; break;
- case 0x07: specialkey = KEY_F10; break;
- case 0x09: specialkey = KEY_F11; break;
- case 0x0b: specialkey = KEY_F12; break;
- default: specialkey = 0; break;
- }
- return specialkey;
- }
-#endif
-
- if (pKbd->CustomKeycodes) {
- specialkey = pKbd->specialMap->map[scanCode];
- }
- return specialkey;
-}
-
-#define ModifierSet(k) ((modifiers & (k)) == (k))
-
-static
-Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-
- if(!pKbd->vtSwitchSupported)
- return FALSE;
-
- if ((ModifierSet(ControlMask | AltMask)) ||
- (ModifierSet(ControlMask | AltLangMask))) {
- if (VTSwitchEnabled && !xf86Info.vtSysreq) {
- switch (key) {
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- if (down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
- return TRUE;
- }
- case KEY_F11:
- case KEY_F12:
- if (down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
- return TRUE;
- }
- }
- }
- }
-#ifdef USE_VT_SYSREQ
- if (VTSwitchEnabled && xf86Info.vtSysreq) {
- switch (key) {
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- if (VTSysreqToggle && down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
- VTSysreqToggle = FALSE;
- return TRUE;
- }
- break;
- case KEY_F11:
- case KEY_F12:
- if (VTSysreqToggle && down) {
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
- VTSysreqToggle = FALSE;
- return TRUE;
- }
- break;
- /* Ignore these keys -- ie don't let them cancel an alt-sysreq */
- case KEY_Alt:
- case KEY_AltLang:
- break;
- case KEY_SysReqest:
- if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down)
- VTSysreqToggle = TRUE;
- break;
- default:
- /*
- * We only land here when Alt-SysReq is followed by a
- * non-switching key.
- */
- if (VTSysreqToggle)
- VTSysreqToggle = FALSE;
- }
- }
-#endif /* USE_VT_SYSREQ */
- return FALSE;
-}
-
-static void
-stdReadInput(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- unsigned char rBuf[64];
- int nBytes, i;
- if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
- for (i = 0; i < nBytes; i++)
- pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
- rBuf[i] & 0x80 ? FALSE : TRUE);
- }
-}
-
-static Bool
-OpenKeyboard(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int i;
- KbdProtocolId prot = PROT_UNKNOWN_KBD;
- char *s;
-
- s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
- for (i = 0; protocols[i].name; i++) {
- if (xf86NameCmp(s, protocols[i].name) == 0) {
- prot = protocols[i].id;
- break;
- }
- }
-
- switch (prot) {
- case PROT_STD:
- pInfo->read_input = stdReadInput;
- break;
- default:
- xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s);
- xfree(s);
- return FALSE;
- }
-
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s);
- xfree(s);
-
- s = xf86SetStrOption(pInfo->options, "Device", NULL);
- if (s == NULL) {
- pInfo->fd = xf86Info.consoleFd;
- pKbd->isConsole = TRUE;
- } else {
- pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
- if (pInfo->fd == -1) {
- xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
- xfree(s);
- return FALSE;
- }
- pKbd->isConsole = FALSE;
- xfree(s);
- }
-
- if (pKbd->isConsole)
- pKbd->vtSwitchSupported = TRUE;
-
- return TRUE;
-}
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- KbdDevPtr pKbd = pInfo->private;
-
- pKbd->KbdInit = KbdInit;
- pKbd->KbdOn = KbdOn;
- pKbd->KbdOff = KbdOff;
- pKbd->Bell = SoundBell;
- pKbd->SetLeds = SetKbdLeds;
- pKbd->GetLeds = GetKbdLeds;
- pKbd->SetKbdRepeat = SetKbdRepeat;
- pKbd->KbdGetMapping = KbdGetMapping;
- pKbd->SpecialKey = SpecialKey;
-
- pKbd->RemapScanCode = NULL;
- pKbd->GetSpecialKey = GetSpecialKey;
-
- pKbd->OpenKeyboard = OpenKeyboard;
- pKbd->vtSwitchSupported = FALSE;
-
- pKbd->private = xcalloc(sizeof(LnxKbdPrivRec), 1);
- if (pKbd->private == NULL) {
- xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
- return FALSE;
- }
-
-#if defined(__powerpc__)
- {
- FILE *f;
- f = fopen("/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes","r");
- if (f) {
- if (fgetc(f) == '0')
- pKbd->CustomKeycodes = TRUE;
- fclose(f);
- }
- }
-#endif
- return TRUE;
-}
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.h b/hw/xfree86/os-support/linux/lnx_kbd.h
deleted file mode 100644
index ac783bfbc..000000000
--- a/hw/xfree86/os-support/linux/lnx_kbd.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
-
-extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
- CARD8 *pModMap);
-
diff --git a/hw/xfree86/os-support/linux/lnx_kmod.c b/hw/xfree86/os-support/linux/lnx_kmod.c
deleted file mode 100644
index 0cb69b209..000000000
--- a/hw/xfree86/os-support/linux/lnx_kmod.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c,v 3.6 2001/10/31 22:50:30 tsi Exp $ */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include "xf86_OSlib.h"
-#include "xf86.h"
-
-
-#define MODPROBE_PATH_FILE "/proc/sys/kernel/modprobe"
-#define MAX_PATH 1024
-
-
-#if 0
-/* XFree86 #defines execl to be the xf86execl() function which does
- * a fork AND exec. We don't want that. We want the regular,
- * standard execl().
- */
-#ifdef execl
-#undef execl
-#endif
-#endif
-
-
-/*
- * Load a Linux kernel module.
- * This is used by the DRI/DRM to load a DRM kernel module when
- * the X server starts. It could be used for other purposes in the future.
- * Input:
- * modName - name of the kernel module (Ex: "tdfx")
- * Return:
- * 0 for failure, 1 for success
- */
-int
-xf86LoadKernelModule(const char *modName)
-{
- char mpPath[MAX_PATH] = "";
- int fd = -1, status, n;
- pid_t pid;
-
- /* get the path to the modprobe program */
- fd = open(MODPROBE_PATH_FILE, O_RDONLY);
- if (fd >= 0) {
- int count = read(fd, mpPath, MAX_PATH - 1);
- if (count <= 0) {
- mpPath[0] = 0;
- }
- else if (mpPath[count - 1] == '\n') {
- mpPath[count - 1] = 0; /* replaces \n with \0 */
- }
- close(fd);
- /* if this worked, mpPath will be "/sbin/modprobe" or similar. */
- }
-
- if (mpPath[0] == 0) {
- /* we failed to get the path from the system, use a default */
- strcpy(mpPath, "/sbin/modprobe");
- }
-
- /* now fork/exec the modprobe command */
- /*
- * It would be good to capture stdout/stderr so that it can be directed
- * to the log file. modprobe errors currently are missing from the log
- * file.
- */
- switch (pid = fork()) {
- case 0: /* child */
- /* change real/effective user ID to 0/0 as we need to
- * preinstall agpgart module for some DRM modules
- */
- if (setreuid(0,0)) {
- xf86Msg(X_WARNING,"LoadKernelModule: "
- "Setting of real/effective user Id to 0/0 failed");
- }
- setenv("PATH","/sbin",1);
- n = execl(mpPath, "modprobe", modName, NULL);
- xf86Msg(X_WARNING,"LoadKernelModule %s\n",strerror(errno));
- exit(EXIT_FAILURE); /* if we get here the child's exec failed */
- break;
- case -1: /* fork failed */
- return 0;
- default: /* fork worked */
- {
- /* XXX we loop over waitpid() because it sometimes fails on
- * the first attempt. Don't know why!
- */
- int count = 0, p;
- do {
- p = waitpid(pid, &status, 0);
- } while (p == -1 && count++ < 4);
-
- if (p == -1) {
- return 0;
- }
-
- if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
- return 1; /* success! */
- }
- else {
- return 0;
- }
- }
- }
-
- /* never get here */
- return 0;
-}
diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c
deleted file mode 100644
index 3d0d30f52..000000000
--- a/hw/xfree86/os-support/linux/lnx_mouse.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.2 2003/10/08 14:58:30 dawes Exp $ */
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xf86_OSlib.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-static int
-SupportedInterfaces(void)
-{
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
-}
-
-static const char *
-DefaultProtocol(void)
-{
- return "Auto";
-}
-
-#define DEFAULT_MOUSE_DEV "/dev/mouse"
-#define DEFAULT_PS2_DEV "/dev/psaux"
-#define DEFAULT_GPM_DATA_DEV "/dev/gpmdata"
-#define DEFAULT_GPM_CTL_DEV "/dev/gpmdata"
-
-static const char *mouseDevs[] = {
- DEFAULT_MOUSE_DEV,
- DEFAULT_PS2_DEV,
- DEFAULT_GPM_DATA_DEV,
- NULL
-};
-
-typedef enum {
- MOUSE_PROTO_UNKNOWN = 0,
- MOUSE_PROTO_SERIAL,
- MOUSE_PROTO_PS2,
- MOUSE_PROTO_MSC,
- MOUSE_PROTO_GPM
-} protocolTypes;
-
-static struct {
- protocolTypes proto;
- const char *name;
-} devproto[] = {
- { MOUSE_PROTO_UNKNOWN, NULL },
- { MOUSE_PROTO_PS2, "PS/2" },
- { MOUSE_PROTO_MSC, "MouseSystems" },
- { MOUSE_PROTO_GPM, "GPM" }
-};
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- int fd = -1;
- const char **pdev;
-
- for (pdev = mouseDevs; *pdev; pdev++) {
- SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK | O_EXCL));
- if (fd == -1) {
-#ifdef DEBUG
- ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
-#endif
- } else
- break;
- }
-
- if (*pdev) {
- close(fd);
- /* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", *pdev);
- xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
- pInfo->name, *pdev);
- }
-
- return *pdev;
-}
-
-static const char *
-GuessProtocol(InputInfoPtr pInfo, int flags)
-{
- int fd = -1;
- const char *dev;
- char *realdev;
- struct stat sbuf;
- int i;
- int proto = MOUSE_PROTO_UNKNOWN;
-
- dev = xf86SetStrOption(pInfo->conf_idev->commonOptions, "Device", NULL);
- if (!dev) {
-#ifdef DEBUG
- ErrorF("xf86SetStrOption failed to return the device name\n");
-#endif
- return NULL;
- }
- /* Look at the device name to guess the protocol. */
- realdev = NULL;
- if (strcmp(dev, DEFAULT_MOUSE_DEV) == 0) {
- if (lstat(dev, &sbuf) != 0) {
-#ifdef DEBUG
- ErrorF("lstat failed for %s (%s)\n", dev, strerror(errno));
-#endif
- return NULL;
- }
- if (S_ISLNK(sbuf.st_mode)) {
- realdev = xnfalloc(PATH_MAX + 1);
- i = readlink(dev, realdev, PATH_MAX);
- if (i <= 0) {
-#ifdef DEBUG
- ErrorF("readlink failed for %s (%s)\n", dev, strerror(errno));
-#endif
- xfree(realdev);
- return NULL;
- }
- realdev[i] = '\0';
- }
- }
- if (!realdev)
- realdev = xnfstrdup(dev);
- else {
- /* If realdev doesn't contain a '/' then prepend "/dev/" */
- if (!strchr(realdev, '/')) {
- char *tmp = xnfalloc(strlen(realdev) + 5 + 1);
- sprintf(tmp, "/dev/%s", realdev);
- xfree(realdev);
- realdev = tmp;
- }
- }
-
- if (strcmp(realdev, DEFAULT_PS2_DEV) == 0)
- proto = MOUSE_PROTO_PS2;
- else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0)
- proto = MOUSE_PROTO_MSC;
- else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0)
- proto = MOUSE_PROTO_GPM;
- xfree(realdev);
- /*
- * If the protocol can't be guessed from the device name,
- * try to characterise it.
- */
- if (proto == MOUSE_PROTO_UNKNOWN) {
- SYSCALL (fd = open(dev, O_RDWR | O_NONBLOCK | O_EXCL));
- if (isatty(fd)) {
- /* Serial PnP has already failed, so give up. */
- } else {
- if (fstat(fd, &sbuf) != 0) {
-#ifdef DEBUG
- ErrorF("fstat failed for %s (%s)\n", dev, strerror(errno));
-#endif
- close(fd);
- return NULL;
- }
- if (S_ISFIFO(sbuf.st_mode)) {
- /* Assume GPM data in MSC format. */
- proto = MOUSE_PROTO_MSC;
- } else {
- /* Default to PS/2 */
- proto = MOUSE_PROTO_PS2;
- }
- }
- close(fd);
- }
- if (proto == MOUSE_PROTO_UNKNOWN) {
- xf86Msg(X_ERROR, "%s: GuessProtocol: Cannot find mouse protocol.\n",
- pInfo->name);
- return NULL;
- } else {
- for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) {
- if (devproto[i].proto == proto) {
- xf86Msg(X_INFO,
- "%s: GuessProtocol: "
- "setting mouse protocol to \"%s\"\n",
- pInfo->name, devproto[i].name);
- return devproto[i].name;
- }
- }
- }
- return NULL;
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
- p->SupportedInterfaces = SupportedInterfaces;
- p->DefaultProtocol = DefaultProtocol;
- p->FindDevice = FindDevice;
- p->GuessProtocol = GuessProtocol;
- return p;
-}
-
diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c
deleted file mode 100644
index 5477b9130..000000000
--- a/hw/xfree86/os-support/linux/lnx_pci.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.9 2003/02/17 15:29:22 dawes Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-#include "xf86Pci.h"
-
-#ifdef __sparc__
-#define PCIADDR_TYPE long long
-#define PCIADDR_IGNORE_FMT "%*x"
-#define PCIADDR_FMT "%llx"
-#else
-#define PCIADDR_TYPE long
-#define PCIADDR_IGNORE_FMT "%*x"
-#define PCIADDR_FMT "%lx"
-#endif
-
-Bool
-xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
-{
- FILE *file;
- char c[0x200];
- char *res;
- unsigned int bus, devfn, dev, fn;
- unsigned PCIADDR_TYPE size[7];
- unsigned int num;
- signed PCIADDR_TYPE Size;
-
- if (index > 7)
- return FALSE;
-
- if (!(file = fopen("/proc/bus/pci/devices","r")))
- return FALSE;
- do {
- res = fgets(c,0x1ff,file);
- if (res) {
- num = sscanf(res,
- /*bus+dev vendorid deviceid irq */
- "%02x%02x\t%*04x%*04x\t%*x"
- /* 7 PCI resource base addresses */
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- "\t" PCIADDR_IGNORE_FMT
- /* 7 PCI resource sizes, and then optionally a driver name */
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT
- "\t" PCIADDR_FMT,
- &bus,&devfn,&size[0],&size[1],&size[2],&size[3],
- &size[4],&size[5],&size[6]);
- if (num != 9) { /* apparantly not 2.3 style */
- fclose(file);
- return FALSE;
- }
- dev = devfn >> 3;
- fn = devfn & 0x7;
- if (tag == pciTag(bus,dev,fn)) {
- *bits = 0;
- if (size[index] != 0) {
- Size = size[index] - ((PCIADDR_TYPE) 1);
- while (Size & ((PCIADDR_TYPE) 0x01)) {
- Size = Size >> ((PCIADDR_TYPE) 1);
- (*bits)++;
- }
- }
- fclose(file);
- return TRUE;
- }
- }
- } while (res);
-
- fclose(file);
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
deleted file mode 100644
index ad3a17fa2..000000000
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.68 2003/09/24 02:43:35 dawes Exp $ */
-/*
- * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Orest Zborowski and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Orest Zborowski
- * and David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID WEXELBLAT BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: lnx_video.c /main/9 1996/10/19 18:06:34 kaleb $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-#include "lnx.h"
-#ifdef __alpha__
-#include "xf86Axp.h"
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
-#include <asm/mtrr.h>
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static Bool ExtendedEnabled = FALSE;
-
-#ifdef __ia64__
-
-#include "compiler.h"
-#include <sys/io.h>
-
-#elif !defined(__powerpc__) && \
- !defined(__mc68000__) && \
- !defined(__sparc__) && \
- !defined(__mips__)
-
-/*
- * Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
- * these.
- */
-extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
-extern int iopl(int __level);
-
-#endif
-
-#ifdef __alpha__
-
-# ifdef LIBC_IS_FIXED
-extern void sethae(unsigned long hae);
-# else
-# include <unistd.h>
-# define sethae(x) syscall(301,x);
-# endif
-
-/* define to test the Sparse addressing on a non-Jensen */
-# ifdef TEST_JENSEN_CODE
-# define isJensen (1)
-# else
-# define isJensen (axpSystem == JENSEN)
-# endif
-
-# define BUS_BASE bus_base
-
-#else
-
-#define BUS_BASE (0)
-
-#endif /* __alpha__ */
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-#if defined (__alpha__)
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
-extern axpDevice lnxGetAXP(void);
-static void unmapVidMemSparse(int, pointer, unsigned long);
-# if defined(JENSEN_SUPPORT)
-static pointer mapVidMemJensen(int, unsigned long, unsigned long, int);
-static void unmapVidMemJensen(int, pointer, unsigned long);
-# endif
-static axpDevice axpSystem = -1;
-static Bool needSparse;
-static unsigned long hae_thresh;
-static unsigned long hae_mask;
-static unsigned long bus_base;
-static unsigned long sparse_size;
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
-
-#define SPLIT_WC_REGIONS 1
-
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-
-/* The file desc for /proc/mtrr. Once opened, left opened, and the mtrr
- driver will clean up when we exit. */
-#define MTRR_FD_UNOPENED (-1) /* We have yet to open /proc/mtrr */
-#define MTRR_FD_PROBLEM (-2) /* We tried to open /proc/mtrr, but had
- a problem. */
-static int mtrr_fd = MTRR_FD_UNOPENED;
-
-/* Open /proc/mtrr. FALSE on failure. Will always fail on Linux 2.0,
- and will fail on Linux 2.2 with MTRR support configured out,
- so verbosity should be chosen appropriately. */
-static Bool
-mtrr_open(int verbosity)
-{
- /* Only report absence of /proc/mtrr once. */
- static Bool warned = FALSE;
-
- char **fn;
- static char *mtrr_files[] = {
- "/dev/cpu/mtrr", /* Possible future name */
- "/proc/mtrr", /* Current name */
- NULL
- };
-
- if (mtrr_fd == MTRR_FD_UNOPENED) {
- /* So open it. */
- for (fn = mtrr_files; mtrr_fd < 0 && *fn; fn++)
- mtrr_fd = open(*fn, O_WRONLY);
-
- if (mtrr_fd < 0)
- mtrr_fd = MTRR_FD_PROBLEM;
- }
-
- if (mtrr_fd == MTRR_FD_PROBLEM) {
- /* To make sure we only ever warn once, need to check
- verbosity outside xf86MsgVerb */
- if (!warned && verbosity <= xf86GetVerbosity()) {
- xf86MsgVerb(X_WARNING, verbosity,
- "System lacks support for changing MTRRs\n");
- warned = TRUE;
- }
-
- return FALSE;
- }
- else
- return TRUE;
-}
-
-/*
- * We maintain a list of WC regions for each physical mapping so they can
- * be undone when unmapping.
- */
-
-struct mtrr_wc_region {
- struct mtrr_sentry sentry;
- Bool added; /* added WC or removed it */
- struct mtrr_wc_region * next;
-};
-
-static struct mtrr_wc_region *
-mtrr_cull_wc_region(int screenNum, unsigned long base, unsigned long size,
- MessageType from)
-{
- /* Some BIOS writers thought that setting wc over the mmio
- region of a graphics devices was a good idea. Try to fix
- it. */
-
- struct mtrr_gentry gent;
- char buf[20];
- struct mtrr_wc_region *wcreturn = NULL, *wcr;
-
- /* Linux 2.0 users should not get a warning without -verbose */
- if (!mtrr_open(2))
- return NULL;
-
- for (gent.regnum = 0;
- ioctl(mtrr_fd, MTRRIOC_GET_ENTRY, &gent) >= 0;
- gent.regnum++) {
- if (gent.type != MTRR_TYPE_WRCOMB
- || gent.base + gent.size <= base
- || base + size <= gent.base)
- continue;
-
- /* Found an overlapping region. Delete it. */
-
- wcr = xalloc(sizeof(*wcr));
- if (!wcr)
- return NULL;
- wcr->sentry.base = gent.base;
- wcr->sentry.size = gent.size;
- wcr->sentry.type = MTRR_TYPE_WRCOMB;
- wcr->added = FALSE;
-
- /* There is now a nicer ioctl-based way to do this,
- but it isn't in current kernels. */
- snprintf(buf, sizeof(buf), "disable=%u\n", gent.regnum);
-
- if (write(mtrr_fd, buf, strlen(buf)) >= 0) {
- xf86DrvMsg(screenNum, from,
- "Removed MMIO write-combining range "
- "(0x%lx,0x%lx)\n",
- gent.base, gent.size);
- wcr->next = wcreturn;
- wcreturn = wcr;
- } else {
- xfree(wcr);
- xf86DrvMsgVerb(screenNum, X_WARNING, 0,
- "Failed to remove MMIO "
- "write-combining range (0x%lx,0x%lx)\n",
- gent.base, gent.size);
- }
- }
- return wcreturn;
-}
-
-
-static struct mtrr_wc_region *
-mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
- MessageType from)
-{
- struct mtrr_wc_region *wcr;
-
- /* Linux 2.0 should not warn, unless the user explicitly asks for
- WC. */
- if (!mtrr_open(from == X_CONFIG ? 0 : 2))
- return NULL;
-
- wcr = xalloc(sizeof(*wcr));
- if (!wcr)
- return NULL;
-
- wcr->sentry.base = base;
- wcr->sentry.size = size;
- wcr->sentry.type = MTRR_TYPE_WRCOMB;
- wcr->added = TRUE;
- wcr->next = NULL;
-
-#if SPLIT_WC_REGIONS
- /*
- * Splits up the write-combining region if it is not aligned on a
- * size boundary.
- */
-
- {
- unsigned long lbase, d_size = 1;
- unsigned long n_size = size;
- unsigned long n_base = base;
-
- for (lbase = n_base, d_size = 1; !(lbase & 1);
- lbase = lbase >> 1, d_size <<= 1);
- while (d_size > n_size)
- d_size = d_size >> 1;
-#ifdef DEBUG
- ErrorF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
-#endif
- n_base += d_size;
- n_size -= d_size;
- if (n_size) {
- xf86DrvMsgVerb(screenNum,X_INFO,3,"Splitting WC range: "
- "base: 0x%lx, size: 0x%lx\n",base,size);
- wcr->next = mtrr_add_wc_region(screenNum, n_base, n_size,from);
- }
- wcr->sentry.size = d_size;
- }
-
- /*****************************************************************/
-#endif /* SPLIT_WC_REGIONS */
-
- if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &wcr->sentry) >= 0) {
- /* Avoid printing on every VT switch */
- if (xf86ServerIsInitialising()) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx)\n",
- base, size);
- }
- return wcr;
- }
- else {
- xfree(wcr);
-
- /* Don't complain about the VGA region: MTRR fixed
- regions aren't currently supported, but might be in
- the future. */
- if ((unsigned long)base >= 0x100000) {
- xf86DrvMsgVerb(screenNum, X_WARNING, 0,
- "Failed to set up write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- }
- return NULL;
- }
-}
-
-static void
-mtrr_undo_wc_region(int screenNum, struct mtrr_wc_region *wcr)
-{
- struct mtrr_wc_region *p, *prev;
-
- if (mtrr_fd > 0) {
- p = wcr;
- while (p) {
- if (p->added)
- ioctl(mtrr_fd, MTRRIOC_DEL_ENTRY, &p->sentry);
- prev = p;
- p = p->next;
- xfree(prev);
- }
- }
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- if (enable)
- return mtrr_add_wc_region(screenNum, base, size, from);
- else
- return mtrr_cull_wc_region(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer regioninfo)
-{
- mtrr_undo_wc_region(screenNum, regioninfo);
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = TRUE;
-#ifdef __alpha__
- if (axpSystem == -1) {
- axpSystem = lnxGetAXP();
- if ((needSparse = (_bus_base_sparse() > 0))) {
- hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
- hae_mask = xf86AXPParams[axpSystem].hae_mask;
- sparse_size = xf86AXPParams[axpSystem].size;
- }
- bus_base = _bus_base();
- }
- if (isJensen) {
-# ifndef JENSEN_SUPPORT
- FatalError("Jensen is not supported any more\n"
- "If you are intereseted in fixing Jensen support\n"
- "please contact xfree86@xfree86.org\n");
-# else
- xf86Msg(X_INFO,"Machine type is Jensen\n");
- pVidMem->mapMem = mapVidMemJensen;
- pVidMem->unmapMem = unmapVidMemJensen;
-# endif /* JENSEN_SUPPORT */
- } else if (needSparse) {
- xf86Msg(X_INFO,"Machine needs sparse mapping\n");
- pVidMem->mapMem = mapVidMemSparse;
- pVidMem->unmapMem = unmapVidMemSparse;
- } else {
- xf86Msg(X_INFO,"Machine type has 8/16 bit access\n");
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
- }
-#else
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
-#endif /* __alpha__ */
-
-
-#ifdef HAS_MTRR_SUPPORT
- pVidMem->setWC = setWC;
- pVidMem->undoWC = undoWC;
-#endif
- pVidMem->initialised = TRUE;
-}
-
-#ifdef __sparc__
-/* Basically, you simply cannot do this on Sparc. You have to do something portable
- * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM
- */
-static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- return NULL;
-}
-#else
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
- int fd;
- int mapflags = MAP_SHARED;
- int prot;
- memType realBase, alignOff;
-
- realBase = Base & ~(getpagesize() - 1);
- alignOff = Base - realBase;
-#ifdef DEBUG
- ErrorF("base: %lx, realBase: %lx, alignOff: %lx \n",
- Base,realBase,alignOff);
-#endif
-
-#if defined(__ia64__)
-#ifndef MAP_WRITECOMBINED
-#define MAP_WRITECOMBINED 0x00010000
-#endif
-#ifndef MAP_NONCACHED
-#define MAP_NONCACHED 0x00020000
-#endif
- if(flags & VIDMEM_FRAMEBUFFER)
- mapflags |= MAP_WRITECOMBINED;
- else
- mapflags |= MAP_NONCACHED;
-#endif
-
-#if 0
- /* this will disappear when people upgrade their kernels */
- fd = open(DEV_MEM,
- ((flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR) | O_SYNC);
-#else
- fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
-#endif
- if (fd < 0)
- {
- FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
- strerror(errno));
- }
-
- if (flags & VIDMEM_READONLY)
- prot = PROT_READ;
- else
- prot = PROT_READ | PROT_WRITE;
-
- /* This requires linux-0.99.pl10 or above */
- base = mmap((caddr_t)0, Size + alignOff, prot, mapflags, fd,
- (off_t)(off_t)realBase + BUS_BASE);
- close(fd);
- if (base == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer"
- " (0x%08lx,0x%lx) (%s)\n", Base, Size,
- strerror(errno));
- }
-#ifdef DEBUG
- ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
-#endif
- return (char *)base + alignOff;
-}
-#endif /* !(__sparc__) */
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- memType alignOff = (memType)Base
- - ((memType)Base & ~(getpagesize() - 1));
-
-#ifdef DEBUG
- ErrorF("alignment offset: %lx\n",alignOff);
-#endif
- munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
-}
-
-
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-#if defined(__powerpc__)
-volatile unsigned char *ioBase = NULL;
-
-#ifndef __NR_pciconfig_iobase
-#define __NR_pciconfig_iobase 200
-#endif
-
-#endif
-
-void
-xf86EnableIO(void)
-{
-#if defined(__powerpc__)
- int fd;
- unsigned int ioBase_phys;
-#endif
-
- if (ExtendedEnabled)
- return;
-
-#if defined(__powerpc__)
- ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0);
-
- fd = open("/dev/mem", O_RDWR);
- if (ioBase == NULL) {
- ioBase = (volatile unsigned char *)mmap(0, 0x20000,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd,
- ioBase_phys);
-/* Should this be fatal or just a warning? */
-#if 0
- if (ioBase == MAP_FAILED) {
- FatalError(
- "xf86EnableIOPorts: Failed to map iobase (%s)\n",
- strerror(errno));
- }
-#endif
- }
- close(fd);
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
- if (ioperm(0, 1024, 1) || iopl(3))
- FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n");
-# if !defined(__alpha__)
- ioperm(0x40,4,0); /* trap access to the timer chip */
- ioperm(0x60,4,0); /* trap access to the keyboard controller */
-# endif
-#endif
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO(void)
-{
- if (!ExtendedEnabled)
- return;
-#if defined(__powerpc__)
- munmap(ioBase, 0x20000);
- ioBase = NULL;
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
- iopl(0);
- ioperm(0, 1024, 0);
-#endif
- ExtendedEnabled = FALSE;
-
- return;
-}
-
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-/* XXX The #ifdefs should be made simpler. */
-
-Bool
-xf86DisableInterrupts()
-{
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)
- if (!ExtendedEnabled)
- if (iopl(3) || ioperm(0, 1024, 1))
- return (FALSE);
-#endif
-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)
-#else
-# ifdef __GNUC__
-# if defined(__ia64__)
-# if 0
- __asm__ __volatile__ (";; rsm psr.i;; srlz.d" ::: "memory");
-# endif
-# else
- __asm__ __volatile__("cli");
-# endif
-# else
- asm("cli");
-# endif
-#endif
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)
- if (!ExtendedEnabled) {
- iopl(0);
- ioperm(0, 1024, 0);
- }
-
-#endif
- return (TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)
- if (!ExtendedEnabled)
- if (iopl(3) || ioperm(0, 1024, 1))
- return;
-#endif
-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)
-#else
-# ifdef __GNUC__
-# if defined(__ia64__)
-# if 0
- __asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory");
-# endif
-# else
- __asm__ __volatile__("sti");
-# endif
-# else
- asm("sti");
-# endif
-#endif
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)
- if (!ExtendedEnabled) {
- iopl(0);
- ioperm(0, 1024, 0);
- }
-#endif
- return;
-}
-
-#if defined (__alpha__)
-
-#define vuip volatile unsigned int *
-
-extern int readDense8(pointer Base, register unsigned long Offset);
-extern int readDense16(pointer Base, register unsigned long Offset);
-extern int readDense32(pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-static int readSparse8(pointer Base, register unsigned long Offset);
-static int readSparse16(pointer Base, register unsigned long Offset);
-static int readSparse32(pointer Base, register unsigned long Offset);
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset);
-
-#define DENSE_BASE 0x2ff00000000UL
-#define SPARSE_BASE 0x30000000000UL
-
-static unsigned long msb_set = 0;
-
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- int fd, prot;
- unsigned long ret, rets = 0;
-
- static Bool was_here = FALSE;
-
- if (!was_here) {
- was_here = TRUE;
-
- xf86WriteMmio8 = writeSparse8;
- xf86WriteMmio16 = writeSparse16;
- xf86WriteMmio32 = writeSparse32;
- xf86WriteMmioNB8 = writeSparseNB8;
- xf86WriteMmioNB16 = writeSparseNB16;
- xf86WriteMmioNB32 = writeSparseNB32;
- xf86ReadMmio8 = readSparse8;
- xf86ReadMmio16 = readSparse16;
- xf86ReadMmio32 = readSparse32;
- }
-
- fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (fd < 0) {
- FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
- strerror(errno));
- }
-
-#if 0
- xf86Msg(X_INFO,"mapVidMemSparse: try Base 0x%lx size 0x%lx flags 0x%x\n",
- Base, Size, flags);
-#endif
-
- if (flags & VIDMEM_READONLY)
- prot = PROT_READ;
- else
- prot = PROT_READ | PROT_WRITE;
-
- /* This requirers linux-0.99.pl10 or above */
-
- /*
- * Always do DENSE mmap, since read32/write32 currently require it.
- */
- ret = (unsigned long)mmap((caddr_t)(DENSE_BASE + Base), Size,
- prot, MAP_SHARED, fd,
- (off_t) (bus_base + Base));
-
- /*
- * Do SPARSE mmap only when MMIO and not MMIO_32BIT, or FRAMEBUFFER
- * and SPARSE (which should require the use of read/write macros).
- *
- * By not SPARSE mmapping an 8MB framebuffer, we can save approx. 256K
- * bytes worth of pagetable (32 pages).
- */
- if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) ||
- ((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE)))
- {
- rets = (unsigned long)mmap((caddr_t)(SPARSE_BASE + (Base << 5)),
- Size << 5, prot, MAP_SHARED, fd,
- (off_t) _bus_base_sparse() + (Base << 5));
- }
-
- close(fd);
-
- if (ret == (unsigned long)MAP_FAILED) {
- FatalError("xf86MapVidMemSparse: Could not (dense) mmap fb (%s)\n",
- strerror(errno));
- }
-
- if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) ||
- ((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE)))
- {
- if (rets == (unsigned long)MAP_FAILED ||
- rets != (SPARSE_BASE + (Base << 5)))
- {
- FatalError("mapVidMemSparse: Could not (sparse) mmap fb (%s)\n",
- strerror(errno));
- }
- }
-
-#if 1
- if (rets)
- xf86Msg(X_INFO,"mapVidMemSparse: mapped Base 0x%lx size 0x%lx"
- " to DENSE at 0x%lx and SPARSE at 0x%lx\n",
- Base, Size, ret, rets);
- else
- xf86Msg(X_INFO,"mapVidMemSparse: mapped Base 0x%lx size 0x%lx"
- " to DENSE only at 0x%lx\n",
- Base, Size, ret);
-
-#endif
- return (pointer) ret;
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
- unsigned long Offset = (unsigned long)Base - DENSE_BASE;
-#if 1
- xf86Msg(X_INFO,"unmapVidMemSparse: unmapping Base 0x%lx Size 0x%lx\n",
- Base, Size);
-#endif
- /* Unmap DENSE always. */
- munmap((caddr_t)Base, Size);
-
- /* Unmap SPARSE always, and ignore error in case we did not map it. */
- munmap((caddr_t)(SPARSE_BASE + (Offset << 5)), Size << 5);
-}
-
-static int
-readSparse8(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - DENSE_BASE;
- shift = (Offset & 0x3) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- mem_barrier();
- result = *(vuip) (SPARSE_BASE + (Offset << 5));
- result >>= shift;
- return 0xffUL & result;
-}
-
-static int
-readSparse16(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - DENSE_BASE;
- shift = (Offset & 0x2) << 3;
- if (Offset >= hae_thresh) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- mem_barrier();
- result = *(vuip)(SPARSE_BASE + (Offset<<5) + (1<<(5-2)));
- result >>= shift;
- return 0xffffUL & result;
-}
-
-static int
-readSparse32(pointer Base, register unsigned long Offset)
-{
- /* NOTE: this is really using DENSE. */
- mem_barrier();
- return *(vuip)((unsigned long)Base+(Offset));
-}
-
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - DENSE_BASE;
- if (Offset >= hae_thresh) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- write_mem_barrier();
- *(vuip) (SPARSE_BASE + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - DENSE_BASE;
- if (Offset >= hae_thresh) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
-
- write_mem_barrier();
- *(vuip)(SPARSE_BASE + (Offset<<5) + (1<<(5-2))) = w * 0x00010001;
-}
-
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset)
-{
- /* NOTE: this is really using DENSE. */
- write_mem_barrier();
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- Offset += (unsigned long)Base - DENSE_BASE;
- if (Offset >= hae_thresh) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip) (SPARSE_BASE + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- Offset += (unsigned long)Base - DENSE_BASE;
- if (Offset >= hae_thresh) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
- sethae(msb);
- msb_set = msb;
- }
- }
- *(vuip)(SPARSE_BASE+(Offset<<5)+(1<<(5-2))) = w * 0x00010001;
-}
-
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- /* NOTE: this is really using DENSE. */
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
- = writeDense8;
-void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
- = writeDense16;
-void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
- = writeDense32;
-void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB8;
-void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB16;
-void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB32;
-int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
- = readDense8;
-int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
- = readDense16;
-int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
- = readDense32;
-
-#ifdef JENSEN_SUPPORT
-
-static int
-readSparseJensen8(pointer Base, register unsigned long Offset);
-static int
-readSparseJensen16(pointer Base, register unsigned long Offset);
-static int
-readSparseJensen32(pointer Base, register unsigned long Offset);
-static void
-writeSparseJensen8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseJensen16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseJensen32(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseJensenNB8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseJensenNB16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseJensenNB32(int Value, pointer Base, register unsigned long Offset);
-
-/*
- * The Jensen lacks dense memory, thus we have to address the bus via
- * the sparse addressing scheme.
- *
- * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
- */
-
-#ifdef TEST_JENSEN_CODE
-#define SPARSE (5)
-#else
-#define SPARSE (7)
-#endif
-
-#define JENSEN_SHIFT(x) ((long)x<<SPARSE)
-
-static pointer
-mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
- int fd, prot;
-
- xf86WriteMmio8 = writeSparseJensen8;
- xf86WriteMmio16 = writeSparseJensen16;
- xf86WriteMmio32 = writeSparseJensen32;
- xf86WriteMmioNB8 = writeSparseJensenNB8;
- xf86WriteMmioNB16 = writeSparseJensenNB16;
- xf86WriteMmioNB32 = writeSparseJensenNB32;
- xf86ReadMmio8 = readSparseJensen8;
- xf86ReadMmio16 = readSparseJensen16;
- xf86ReadMmio32 = readSparseJensen32;
-
- fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (fd < 0) {
- FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
- strerror(errno));
- }
-
- if (flags & VIDMEM_READONLY)
- prot = PROT_READ;
- else
- prot = PROT_READ | PROT_WRITE;
-
- /* This requires linux-0.99.pl10 or above */
- base = mmap((caddr_t)0, JENSEN_SHIFT(Size),
- prot, MAP_SHARED, fd,
- (off_t)(JENSEN_SHIFT((off_t)Base) + _bus_base_sparse()));
- close(fd);
- if (base == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer"
- " (0x%08x,0x%x) (%s)\n", Base, Size,
- strerror(errno));
- }
- return base;
-}
-
-static void
-unmapVidMemJensen(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, JENSEN_SHIFT(Size));
-}
-
-static int
-readSparseJensen8(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
-
- mem_barrier();
- shift = (Offset & 0x3) << 3;
-
- result = *(vuip) ((unsigned long)Base + (Offset << SPARSE));
-
- result >>= shift;
- return 0xffUL & result;
-}
-
-static int
-readSparseJensen16(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
-
- mem_barrier();
- shift = (Offset & 0x2) << 3;
-
- result = *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2)));
-
- result >>= shift;
- return 0xffffUL & result;
-}
-
-static int
-readSparseJensen32(pointer Base, register unsigned long Offset)
-{
- register unsigned long result;
-
- mem_barrier();
- result = *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2)));
-
- return result;
-}
-
-static void
-writeSparseJensen8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned int b = Value & 0xffU;
-
- write_mem_barrier();
- *(vuip) ((unsigned long)Base + (Offset << SPARSE)) = b * 0x01010101;
-}
-
-static void
-writeSparseJensen16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned int w = Value & 0xffffU;
-
- write_mem_barrier();
- *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2))) =
- w * 0x00010001;
-}
-
-static void
-writeSparseJensen32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2))) = Value;
-}
-
-static void
-writeSparseJensenNB8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned int b = Value & 0xffU;
-
- *(vuip) ((unsigned long)Base + (Offset << SPARSE)) = b * 0x01010101;
-}
-
-static void
-writeSparseJensenNB16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned int w = Value & 0xffffU;
-
- *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(1<<(SPARSE-2))) =
- w * 0x00010001;
-}
-
-static void
-writeSparseJensenNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(vuip)((unsigned long)Base+(Offset<<SPARSE)+(3<<(SPARSE-2))) = Value;
-}
-#endif /* JENSEN_SUPPORT */
-
-#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/lynxos/lynx_init.c b/hw/xfree86/os-support/lynxos/lynx_init.c
deleted file mode 100644
index 8565dcc5c..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_init.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 1993 by Thomas Mueller
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Mueller not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Mueller makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS MUELLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS MUELLER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_init.c,v 3.3 1998/08/29 05:43:58 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static int VTnum = -1;
-
-void
-xf86OpenConsole()
-{
- struct vt_mode VT;
- char vtname1[11];
- int fd, pgrp;
- MessageType from = X_PROBED;
-
- if (serverGeneration == 1)
- {
- /* check if we're run with euid==0 */
- if (geteuid() != 0)
- {
- FatalError("xf86OpenConsole: Server must be suid root\n");
- }
-
- /*
- * setup the virtual terminal manager
- * NOTE:
- * We use the out-of-the-box atc terminal driver,
- * not the GE contributed vdt driver.
- * Also, we do setup signals for VT switching which
- * is not really necessary because we don't feed the
- * VT switch keystrokes to the kernel in xf86Events.c
- * (it bombs occasionally...)
- */
- if (VTnum != -1)
- {
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
- }
- else
- {
- /* We could use /dev/con which is usually a symlink
- * to /dev/atc0 but one could configure the system
- * to use a serial line as console device, so to
- * be sure we take /dev/atc0.
- */
- if ((fd = open("/dev/atc0",O_WRONLY,0)) < 0)
- {
- FatalError(
- "xf86OpenConsole: Cannot open /dev/atc0 (%s)\n",
- strerror(errno));
- }
- if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1))
- {
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
- }
- close(fd);
- }
- xf86Msg(from, "using VT number %d\n", xf86Info.vtno);
-
- sprintf(vtname1,"/dev/atc%d",xf86Info.vtno);
-
- pgrp = getpgrp(); /* POSIX version ! */
- ioctl(xf86Info.consoleFd, TIOCSPGRP, &pgrp);
-
- if ((xf86Info.consoleFd = open(vtname1,O_RDWR|O_NDELAY,0)) < 0)
- {
- FatalError(
- "xf86OpenConsole: Cannot open %s (%s)\n",
- vtname1, strerror(errno));
- }
- /* change ownership of the vt */
- chown(vtname1, getuid(), getgid());
-
- /*
- * now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
- {
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
- }
-
- /* for future use... */
- signal(SIGUSR1, xf86VTRequest);
-
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- {
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
- }
- }
- else
- {
- /* serverGeneration != 1 */
- /*
- * now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- /*
- * If the server doesn't have the VT when the reset occurs,
- * this is to make sure we don't continue until the activate
- * signal is received.
- */
- if (!xf86Screens[0]->vtSema)
- sleep(5);
- }
- return;
-}
-
-void
-xf86CloseConsole()
-{
- struct vt_mode VT;
-
-#if 0
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno);
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0);
-#endif
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO;
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */
- }
- close(xf86Info.consoleFd); /* make the vt-manager happy */
- return;
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
- {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- return(1);
- }
- return(0);
-}
-
-void
-xf86UseMsg()
-{
- ErrorF("vtXX use the specified VT number\n");
- return;
-}
-
diff --git a/hw/xfree86/os-support/lynxos/lynx_io.c b/hw/xfree86/os-support/lynxos/lynx_io.c
deleted file mode 100644
index e61ce76b7..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_io.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright 1993 by Thomas Mueller
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Mueller not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Mueller makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS MUELLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS MUELLER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_io.c,v 3.10 2003/02/17 15:11:57 dawes Exp $ */
-
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#if defined(KDMKTONE) || defined(KIOCSOUND)
-/* Lynx 2.2.1 has sophisticated atc stuff.... */
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- if (loudness && pitch)
- {
-#ifdef KDMKTONE
- /*
- * If we have KDMKTONE use it to avoid putting the server
- * to sleep
- */
- ioctl(xf86Info.consoleFd, KDMKTONE,
- (pitch & 0xffff) |
- (((unsigned long)duration *
- loudness / 50) << 16));
-#else
- ioctl(xf86Info.consoleFd, KIOCSOUND, pitch);
- usleep(xf86Info.bell_duration * loudness * 20);
- ioctl(xf86Info.consoleFd, KIOCSOUND, 0);
-#endif
- }
-}
-
-#else
-
-/* this is pulled from /sys/drivers/vt100/atbeep.c */
-
-#define SPEAKER_CONTROL 0x61
-#define TIMER_CONTROL 0x43
-#define TIMER_DATA 0x42
-#define TIMER_LOAD_CMD 0xb6
-
-#define TIMER_CONSTANT 1193280
-#define FREQ_LO(f) ((TIMER_CONSTANT / (f)) % 256)
-#define FREQ_HI(f) ((TIMER_CONSTANT / (f)) / 256)
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- int flo = FREQ_LO(pitch);
- int fhi = FREQ_HI(pitch);
-
- outb(TIMER_CONTROL, TIMER_LOAD_CMD);
- outb(TIMER_DATA, flo);
- outb(TIMER_DATA, fhi);
-
- /* speaker on */
- outb(SPEAKER_CONTROL, inb(SPEAKER_CONTROL) | 3);
- usleep(xf86Info.bell_duration * loudness * 20);
- /* speaker off */
- outb(SPEAKER_CONTROL, inb(SPEAKER_CONTROL) & ~3);
-}
-#endif
-
-void
-xf86SetKbdLeds(int leds)
-{
-#ifdef KBD_SET_LEDS
- ioctl(xf86Info.consoleFd, KBD_SET_LEDS, &leds);
-#endif
-}
-
-int
-xf86GetKbdLeds()
-{
-#ifdef KBD_SET_LEDS
- int leds;
-
- if (ioctl(xf86Info.consoleFd, KBD_SET_LEDS, &leds) < 0)
- return 0;
-
- return leds;
-#endif
- return 0;
-}
-
-void
-xf86SetKbdRepeat(char rad)
-{
-}
-
-static struct termio kbdtty;
-
-void
-xf86KbdInit()
-{
- ioctl(xf86Info.consoleFd, TCGETA, &kbdtty);
-}
-
-int
-xf86KbdOn()
-{
- struct termio nTty;
-
- /* set CAPS_LOCK to behave as CAPS_LOCK not as CTRL */
- write(xf86Info.consoleFd, "\033<", 2);
-
- /* enable scan mode */
- ioctl(xf86Info.consoleFd, TIO_ENSCANMODE, NULL);
-
- nTty = kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME]=0;
- nTty.c_cc[VMIN]=1;
- ioctl(xf86Info.consoleFd, TCSETA, &nTty);
-
- return(xf86Info.consoleFd);
-}
-
-int
-xf86KbdOff()
-{
- /* disable scan mode */
- ioctl(xf86Info.consoleFd, TIO_DISSCANMODE, NULL);
- ioctl(xf86Info.consoleFd, TCSETA, &kbdtty);
- return(xf86Info.consoleFd);
-}
-
-#include "xf86OSKbd.h"
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/lynxos/lynx_mmap.c b/hw/xfree86/os-support/lynxos/lynx_mmap.c
deleted file mode 100644
index dcf734965..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_mmap.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 1993 by Thomas Mueller
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Mueller not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Mueller makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS MUELLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS MUELLER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mmap.c,v 3.6 2000/02/11 22:36:02 dawes Exp $ */
-
-#include "X.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * Read BIOS using smem_create facility
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
-#if defined(__powerpc__)
- xf86Msg(X_WARNING, "xf86ReadBios: no BIOS-probe on PowerPC\n");
- return(-1);
-#else
- char *p;
- int mlen;
-
- mlen = (Offset + Len + 4095) & ~4095;
- p = smem_create("BIOS-probe", (char *)Base, mlen, SM_READ);
- if (p == NULL)
- {
- /* check if there is a stale segment around */
- if (smem_remove("BIOS-probe") == 0) {
- xf86Msg(X_INFO,
- "xf86ReadBios: removed stale smem_ segment\n");
- p = smem_create("BIOS-probe", (char *)Base, mlen, SM_READ);
- }
- if (p == NULL) {
- xf86Msg(X_WARNING, "xf86ReadBios: Failed to smem_create "
- "Base %x len %x %s \n",
- Base, mlen, strerror(errno));
- return(-1);
- }
- }
- memcpy(Buf, p + Offset, Len);
- smem_create(NULL, p, 0, SM_DETACH);
- smem_remove("BIOS-probe");
- return(Len);
-#endif
-}
diff --git a/hw/xfree86/os-support/lynxos/lynx_mouse.c b/hw/xfree86/os-support/lynxos/lynx_mouse.c
deleted file mode 100644
index 1dc5ff8af..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_mouse.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mouse.c,v 1.1 1999/05/22 08:40:14 dawes Exp $ */
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-
-static int
-SupportedInterfaces(void)
-{
- /* XXX Need to check this. */
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
- p->SupportedInterfaces = SupportedInterfaces;
- return p;
-}
-
diff --git a/hw/xfree86/os-support/lynxos/lynx_noinline.c b/hw/xfree86/os-support/lynxos/lynx_noinline.c
deleted file mode 100644
index 858b0eb65..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_noinline.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_noinline.c,v 3.6 2002/01/25 21:56:20 tsi Exp $ */
-/*
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if /* NO_INLINE && */ defined(__powerpc__)
-
-#include "xf86Pci.h"
-
-extern volatile unsigned char *ioBase;
-
-void
-eieio()
-{
- __asm__ __volatile__ ("eieio");
-}
-
-unsigned long
-ldl_brx(volatile unsigned char *base, int ndx)
-{
- register unsigned long tmp = *(volatile unsigned long *)(base+ndx);
- return( ((tmp & 0x000000ff) << 24) |
- ((tmp & 0x0000ff00) << 8) |
- ((tmp & 0x00ff0000) >> 8) |
- ((tmp & 0xff000000) >> 24) );
-}
-
-unsigned short
-ldw_brx(volatile unsigned char *base, int ndx)
-{
- register unsigned short tmp = *(volatile unsigned short *)(base+ndx);
- return((tmp << 8) | (tmp >> 8));
-}
-
-void
-stl_brx(unsigned long val, volatile unsigned char *base, int ndx)
-{
- unsigned char *p = (unsigned char *)&val;
- unsigned long tmp = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0] << 0);
- *(volatile unsigned long *)(base+ndx) = tmp;
-}
-
-void
-stw_brx(unsigned short val, volatile unsigned char *base, int ndx)
-{
- unsigned char *p = (unsigned char *)&val;
- unsigned short tmp = (p[1] << 8) | p[0];
- *(volatile unsigned short *)(base+ndx) = tmp;
-}
-
-void
-outb(IOADDRESS port, unsigned char value)
-{
- *((volatile unsigned char *)(ioBase + port)) = value; eieio();
-}
-
-void
-outw(IOADDRESS port, unsigned short value)
-{
- stw_brx(value, ioBase, port); eieio();
-}
-
-void
-outl(IOADDRESS port, unsigned int value)
-{
- stl_brx(value, ioBase, port); eieio();
-}
-
-unsigned char
-inb(IOADDRESS port)
-{
- unsigned char val;
-
- val = *((volatile unsigned char *)(ioBase + port)); eieio();
- return(val);
-}
-
-unsigned short
-inw(IOADDRESS port)
-{
- unsigned short val;
-
- val = ldw_brx(ioBase, port); eieio();
- return(val);
-}
-
-unsigned int
-inl(IOADDRESS port)
-{
- unsigned int val;
-
- val = ldl_brx(ioBase, port); eieio();
- return(val);
-}
-
-unsigned long
-ldl_u(void *p)
-{
- return (((*(unsigned char *)(p)) |
- (*((unsigned char *)(p)+1)<<8) |
- (*((unsigned char *)(p)+2)<<16) |
- (*((unsigned char *)(p)+3)<<24)));
-}
-
-unsigned long
-ldq_u(void *p)
-{
- return ldl_u(p);
-}
-
-unsigned short
-ldw_u(void *p)
-{
- return(((*(unsigned char *)(p)) |
- (*((unsigned char *)(p)+1)<<8)));
-}
-
-void
-stl_u(unsigned long v, void *p)
-{
-
- (*(unsigned char *)(p)) = (v);
- (*((unsigned char *)(p)+1)) = ((v) >> 8);
- (*((unsigned char *)(p)+2)) = ((v) >> 16);
- (*((unsigned char *)(p)+3)) = ((v) >> 24);
-}
-
-void
-stq_u(unsigned long v, void *p)
-{
- stl_u(v,p);
-}
-
-void
-stw_u(unsigned short v, void *p)
-{
- (*(unsigned char *)(p)) = (v);
- (*((unsigned char *)(p)+1)) = ((v) >> 8);
-}
-
-
-void
-mem_barrier(void)
-{
- __asm__ __volatile__("eieio");
-}
-
-void
-write_mem_barrier(void)
-{
- __asm__ __volatile__("eieio");
-}
-
-#endif /* NO_INLINE && __powerpc__ */
diff --git a/hw/xfree86/os-support/lynxos/lynx_ppc.c b/hw/xfree86/os-support/lynxos/lynx_ppc.c
deleted file mode 100644
index e587b7ee0..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_ppc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c,v 1.1 2002/12/14 04:41:14 dawes Exp $ */
-/*
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-void ppc_flush_icache()
-{
-__asm__ __volatile__ (" \
- mflr 0 ;\
- stw 31,-4(1) ;\
- stw 0,8(1) ;\
- stwu 1,-64(1) ;\
- mr 31,1 ;\
- stw 3,88(31) ;\
- li 6, 0 ;\
- dcbf 3, 6 ;\
- li 5, 32 ;\
- dcbf 3, 5 ;\
- sync ;\
- li 4,0 ;\
- icbi 3,4 ;\
- li 7,32 ;\
- icbi 3,7 ;\
- sync ;\
- isync ;\
- lwz 1,0(1) ;\
- lwz 0,8(1) ;\
- mtlr 0 ;\
- lwz 31,-4(1) ;\
- blr ;\
-");
-}
diff --git a/hw/xfree86/os-support/lynxos/lynx_video.c b/hw/xfree86/os-support/lynxos/lynx_video.c
deleted file mode 100644
index c667994b3..000000000
--- a/hw/xfree86/os-support/lynxos/lynx_video.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/*
- * Copyright 1993 by Thomas Mueller
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Mueller not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Mueller makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS MUELLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS MUELLER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_video.c,v 3.18 2002/12/14 04:41:14 dawes Exp $ */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(__powerpc__)
-
-# if defined(USE_MACHINE_ABSOLUTE)
-# include <machine/absolute.h>
-# else
-# define __USER_SPACE_INCLUDE
-# include <hw_absolute.h>
-# endif
-
-void ppcPciIoMap(int bus);
-#endif
-
-#if 0
-#define DEBUG
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
-#include <sys/memrange.h>
-#define X_MTRR_ID "XFree86"
-
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-static Bool cleanMTRR(void);
-static int devMemFd = -1;
-#define MTRR_DEVICE "/dev/mtrr"
-#endif
-
-
-#if !defined(NO_MMAP)
-#include <sys/mman.h>
-
-int smem_remove(char *name)
-{
- return(0);
-}
-
-char *smem_create(char *name, char *arg_addr, long size, int mode)
-{
- int fd;
- void *addr = 0;
- char *retval;
- size_t len = size;
- int prot = PROT_READ|PROT_WRITE|PROT_UNCACHE;
- int flags = MAP_SHARED;
- off_t off = (off_t)arg_addr;
-
- if ((fd = open("/dev/mem" , O_RDWR)) < 0)
- {
- retval = (char *)-1;
- }
- else
- {
- if (mode == SM_DETACH)
- {
- munmap(arg_addr, len);
- retval = 0;
- }
- else
- {
- if ((retval = mmap (addr, len, prot, flags, fd, off) ) == MAP_FAILED)
- {
- retval = (char *)-1;
- }
- }
-
- close(fd);
- }
-
- return(retval);
-}
-
-#endif
-
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-typedef struct
-{
- char name[16];
- unsigned long Base;
- unsigned long Size;
- char *ptr;
- int RefCnt;
-}
-_SMEMS;
-
-#define MAX_SMEMS 16
-
-static _SMEMS smems[MAX_SMEMS];
-
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void
-smemCleanup(void)
-{
- int i;
-
- for (i = 0; i < MAX_SMEMS; i++) {
- if (*smems[i].name && smems[i].ptr) {
- (void)smem_create(NULL, smems[i].ptr, 0, SM_DETACH);
- (void)smem_remove(smems[i].name);
- *smems[i].name = '\0';
- smems[i].ptr = NULL;
- smems[i].Base = 0;
- smems[i].Size = 0;
- smems[i].RefCnt = 0;
- }
- }
-}
-
-static pointer
-MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- static int once;
- int free_slot = -1;
- int i;
-
- if (!once)
- {
- atexit(smemCleanup);
- once = 1;
- }
- for (i = 0; i < MAX_SMEMS; i++)
- {
- if (!*smems[i].name && free_slot == -1)
- free_slot = i;
- if (smems[i].Base == Base && smems[i].Size == Size
- && *smems[i].name) {
- smems[i].RefCnt++;
- return smems[i].ptr;
- }
- }
- if (i == MAX_SMEMS && free_slot == -1)
- {
- FatalError("MapVidMem: failed to smem_create Base %x Size %x (out of SMEMS entries)\n",
- Base, Size);
- }
-
- i = free_slot;
- sprintf(smems[i].name, "Video-%d", i);
- smems[i].Base = Base;
- smems[i].Size = Size;
-
- xf86MsgVerb(X_INFO, 3, "MapVidMem: Base=0x%x Size=0x%x\n",
- Base, Size);
-
-#if defined(__powerpc__)
- if (((unsigned long)Base & PHYS_IO_MEM_START) != PHYS_IO_MEM_START) {
- Base = Base | PHYS_IO_MEM_START;
- }
-#endif
-
- smems[i].ptr = smem_create(smems[i].name, (char *)Base, Size, SM_READ|SM_WRITE);
- smems[i].RefCnt = 1;
- if (smems[i].ptr == NULL)
- {
- /* check if there is a stale segment around */
- if (smem_remove(smems[i].name) == 0) {
- xf86Msg(X_INFO,
- "MapVidMem: removed stale smem_ segment %s\n",
- smems[i].name);
- smems[i].ptr = smem_create(smems[i].name,
- (char *)Base, Size, SM_READ|SM_WRITE);
- }
- if (smems[i].ptr == NULL) {
- *smems[i].name = '\0';
- FatalError("MapVidMem: failed to smem_create Base %x Size %x (%s)\n",
- Base, Size, strerror(errno));
- }
- }
- xf86MsgVerb(X_INFO, 3, "MapVidMem: Base=0x%x Size=0x%x Ptr=0x%x\n",
- Base, Size, smems[i].ptr);
- return smems[i].ptr;
-}
-
-static void
-UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- int i;
-
- xf86MsgVerb(X_INFO, 3, "UnMapVidMem: Base/Ptr=0x%x Size=0x%x\n",
- Base, Size);
- for (i = 0; i < MAX_SMEMS; i++)
- {
- if (*smems[i].name && smems[i].ptr == Base
- && smems[i].Size == Size)
- {
- if (--smems[i].RefCnt > 0)
- return;
-
- (void)smem_create(NULL, smems[i].ptr, 0, SM_DETACH);
- xf86MsgVerb(X_INFO, 3,
- "UnMapVidMem: smem_create(%s, 0x%08x, ... "
- "SM_DETACH)\n", smems[i].name, smems[i].ptr);
- (void)smem_remove(smems[i].name);
- *smems[i].name = '\0';
- smems[i].RefCnt = 0;
- return;
- }
- }
- xf86MsgVerb(X_WARNING, 2,
- "UnMapVidMem: no SMEM found for Base = %lx Size = %lx\n",
- Base, Size);
-}
-
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = TRUE;
- pVidMem->mapMem = MapVidMem;
- pVidMem->unmapMem = UnMapVidMem;
- pVidMem->setWC = 0;
- pVidMem->undoWC = 0;
-#ifdef HAS_MTRR_SUPPORT
- if (cleanMTRR()) {
- pVidMem->setWC = setWC;
- pVidMem->undoWC = undoWC;
- }
-#endif
- pVidMem->initialised = TRUE;
-}
-
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
- return;
-}
-
-/***************************************************************************/
-/* I/O Permissions section for PowerPC */
-/***************************************************************************/
-
-#if defined(__powerpc__)
-
-volatile unsigned char *ioBase = MAP_FAILED;
-volatile unsigned char *pciConfBase = MAP_FAILED;
-
-static int IOEnabled;
-
-
-static void
-removeIOSmem(void)
-{
- smem_create(NULL, (char *) ioBase, 0, SM_DETACH);
- smem_remove("IOBASE");
- ioBase = MAP_FAILED;
-}
-
-void
-xf86EnableIO()
-{
- if (IOEnabled++ == 0) {
- ioBase = (unsigned char *) smem_create("IOBASE",
- (char *)PHYS_ISA_IO_SPACE, 64*1024, SM_READ|SM_WRITE);
- if (ioBase == MAP_FAILED) {
- --IOEnabled;
- FatalError("xf86EnableIO: Failed to map I/O\n");
- } else {
-#ifdef DEBUG
- ErrorF("xf86EnableIO: mapped I/O at vaddr 0x%08x\n",
- ioBase);
-#endif
- atexit(removeIOSmem);
- }
- }
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (!IOEnabled)
- return;
-
- if (--IOEnabled == 0)
- removeIOSmem();
- return;
-}
-
-#if 0
-void
-xf86DisableIOPrivs(void)
-{
- return;
-}
-#endif
-void
-ppcPciIoMap(int bus)
-{
- xf86EnableIO();
-}
-
-#endif
-
-
-#ifdef HAS_MTRR_SUPPORT
-/* memory range (MTRR) support for LynxOS (taken from BSD MTRR support) */
-
-/*
- * This code is experimental. Some parts may be overkill, and other parts
- * may be incomplete.
- */
-
-/*
- * getAllRanges returns the full list of memory ranges with attributes set.
- */
-
-static struct mem_range_desc *
-getAllRanges(int *nmr)
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
-
- /*
- * Find how many ranges there are. If this fails, then the kernel
- * probably doesn't have MTRR support.
- */
- mro.mo_arg[0] = 0;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro))
- return NULL;
- *nmr = mro.mo_arg[0];
- mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
- mro.mo_arg[0] = *nmr;
- mro.mo_desc = mrd;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
- xfree(mrd);
- return NULL;
- }
- return mrd;
-}
-
-/*
- * cleanMTRR removes any memory attribute that may be left by a previous
- * X server. Normally there won't be any, but this takes care of the
- * case where a server crashed without being able finish cleaning up.
- */
-
-static Bool
-cleanMTRR()
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
- int nmr, i;
-
- /* This shouldn't happen */
- if (devMemFd < 0) {
- if ((devMemFd = open(MTRR_DEVICE, O_RDONLY)) < 0) {
-perror("open MTRR");
- return FALSE;
- }
- }
-
- if (!(mrd = getAllRanges(&nmr)))
- return FALSE;
-
- for (i = 0; i < nmr; i++) {
- if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
- (mrd[i].mr_flags & MDF_ACTIVE)) {
-#ifdef DEBUG
- ErrorF("Clean for (0x%lx,0x%lx)\n",
- (unsigned long)mrd[i].mr_base,
- (unsigned long)mrd[i].mr_len);
-#endif
- if (mrd[i].mr_flags & MDF_FIXACTIVE) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- mrd[i].mr_flags = MDF_UNCACHEABLE;
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = mrd + i;
- ioctl(devMemFd, MEMRANGE_SET, &mro);
- }
- }
-#ifdef DEBUG
- sleep(10);
-#endif
- xfree(mrd);
- return TRUE;
-}
-
-typedef struct x_RangeRec {
- struct mem_range_desc mrd;
- Bool wasWC;
- struct x_RangeRec * next;
-} RangeRec, *RangePtr;
-
-static void
-freeRangeList(RangePtr range)
-{
- RangePtr rp;
-
- while (range) {
- rp = range;
- range = rp->next;
- xfree(rp);
- }
-}
-
-static RangePtr
-dupRangeList(RangePtr list)
-{
- RangePtr new = NULL, rp, p;
-
- rp = list;
- while (rp) {
- p = xnfalloc(sizeof(RangeRec));
- *p = *rp;
- p->next = new;
- new = p;
- rp = rp->next;
- }
- return new;
-}
-
-static RangePtr
-sortRangeList(RangePtr list)
-{
- RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
- unsigned long minBase;
-
- /* Sort by base address */
- rp1 = copy = dupRangeList(list);
- while (rp1) {
- minBase = rp1->mrd.mr_base;
- minp = rp1;
- minprev = NULL;
- prev = rp1;
- rp2 = rp1->next;
- while (rp2) {
- if (rp2->mrd.mr_base < minBase) {
- minBase = rp2->mrd.mr_base;
- minp = rp2;
- minprev = prev;
- }
- prev = rp2;
- rp2 = rp2->next;
- }
- if (minprev) {
- minprev->next = minp->next;
- rp1 = copy;
- } else {
- rp1 = minp->next;
- }
- minp->next = sorted;
- sorted = minp;
- }
- return sorted;
-}
-
-/*
- * findRanges returns a list of ranges that overlap the specified range.
- */
-
-static void
-findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
-{
- struct mem_range_desc *mrd;
- int nmr, i;
- RangePtr rp, *p;
-
- if (!(mrd = getAllRanges(&nmr)))
- return;
-
- for (i = 0; i < nmr; i++) {
- if ((mrd[i].mr_flags & MDF_ACTIVE) &&
- mrd[i].mr_base < base + size &&
- mrd[i].mr_base + mrd[i].mr_len > base) {
- if (mrd[i].mr_flags & MDF_WRITECOMBINE)
- p = wcp;
- else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
- p = ucp;
- else
- continue;
- rp = xnfalloc(sizeof(RangeRec));
- rp->mrd = mrd[i];
- rp->next = *p;
- *p = rp;
- }
- }
- xfree(mrd);
-}
-
-/*
- * This checks if the existing overlapping ranges fully cover the requested
- * range. Is this overkill?
- */
-
-static Bool
-fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
-{
- RangePtr rp1, sorted = NULL;
- unsigned long end;
-
- sorted = sortRangeList(overlap);
- /* Look for gaps */
- rp1 = sorted;
- end = base + size;
- while (rp1) {
- if (rp1->mrd.mr_base > base) {
- freeRangeList(sorted);
- return FALSE;
- } else {
- base = rp1->mrd.mr_base + rp1->mrd.mr_len;
- }
- if (base >= end) {
- freeRangeList(sorted);
- return TRUE;
- }
- rp1 = rp1->next;
- }
- freeRangeList(sorted);
- return FALSE;
-}
-
-static pointer
-addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /* See of the full range is already WC */
- if (!uc && fullCoverage(base, size, wc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already set\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_WRITECOMBINE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to set write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx)\n", base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = FALSE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /*
- * See of the full range is already not WC, or if there is full
- * coverage from UC ranges.
- */
- if (!wc || fullCoverage(base, size, uc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already clear\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_UNCACHEABLE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to remove write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- /* XXX Should then remove all of the overlapping WC ranges */
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Removed Write-combining range (0x%lx,0x%lx)\n",
- base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = TRUE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- if (enable)
- return addWC(screenNum, base, size, from);
- else
- return delWC(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer list)
-{
- RangePtr rp;
- struct mem_range_op mro;
- Bool failed;
-
- rp = list;
- while (rp) {
-#ifdef DEBUG
- ErrorF("Undo for (0x%lx,0x%lx), %d\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len, rp->wasWC);
-#endif
- failed = FALSE;
- if (rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_WRITECOMBINE;
- strcpy(rp->mrd.mr_owner, "unknown");
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = &rp->mrd;
-
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- if (!rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_UNCACHEABLE;
- strcpy(rp->mrd.mr_owner, "unknown");
- if (ioctl(devMemFd, MEMRANGE_SET, &mro))
- failed = TRUE;
- } else
- failed = TRUE;
- }
- if (failed) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to restore MTRR range (0x%lx,0x%lx)\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len);
- }
- rp = rp->next;
- }
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.S b/hw/xfree86/os-support/misc/BUSmemcpy.S
deleted file mode 100644
index e4ff36c62..000000000
--- a/hw/xfree86/os-support/misc/BUSmemcpy.S
+++ /dev/null
@@ -1,156 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.S,v 1.1 1999/07/10 07:24:49 dawes Exp $ */
-/******************************************************************************
- Copyright 1993 by Glenn G. Lai
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Glenn G. Lai not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-Glenn G. Lai
-P.O. Box 4314
-Austin, Tx 78765
-(glenn@cs.utexas.edu)
-8/9/93
-******************************************************************************/
-/* $XConsortium: BUSmemcpy.s /main/4 1996/02/21 17:39:34 kaleb $ */
-
-/*
- * Modified to use long-alignment of video memory rather than word-alignment
- * to improve performance for LocalBus video cards. Function names changed
- * from ISAToMem and MemToISA to BusToMem and MemToBus.
- *
- * David Dawes <dawes@XFree86.org>, 25 August 1993.
- */
-
-
-#include "assyntax.h"
-
- FILE("BUSmemcpy.s")
-
- AS_BEGIN
-
-/* BusToMem copies from video memory to main memory
- MemToBus copies from main memory to video memory
-
- void xf86BusToMem(unsigned char *dst, unsigned char *src, int len);
- void xf86MemToBus(unsigned char *dst, unsigned char *src, int len);
-*/
-
-#define dst REGOFF(4,ESP)
-#define src REGOFF(8,ESP)
-#define len REGOFF(12,ESP)
-
- GLOBL GLNAME(xf86BusToMem)
- GLOBL GLNAME(xf86MemToBus)
-
- SEG_DATA
-copyright:
- STRING("Copyright 8/9/1993 by Glenn G. Lai")
-
- ALIGNDATA4
-tmp: D_LONG 0
-
- SEG_TEXT
- ALIGNTEXT4
-GLNAME(xf86BusToMem):
- CLD
- MOV_L (ESI, CONTENT(tmp))
- MOV_L (EDI, EDX)
-
- MOV_L (src, ESI)
- MOV_L (dst, EDI)
- MOV_L (len, ECX)
-
- CMP_L (CONST(7), ECX)
- JC (quickBM)
-
- TEST_L (CONST(1), ESI)
- JZ (BwM)
-
- MOVS_B
- DEC_L (ECX)
-
-BwM:
- TEST_L (CONST(2), ESI)
- JZ (BlM)
-
- MOVS_W
- DEC_L (ECX)
- DEC_L (ECX)
-
-BlM:
- MOV_L (ECX, EAX)
- AND_L (CONST(3), EAX)
- SHR_L (CONST(2), ECX)
- REP
- MOVS_L
- MOV_L (EAX, ECX)
-quickBM:
- OR_L (ECX, ECX)
- JZ (return)
- REP
- MOVS_B
-return:
- MOV_L (CONTENT(tmp), ESI)
- MOV_L (EDX, EDI)
- RET
-/************************/
-
- ALIGNTEXT4
-GLNAME(xf86MemToBus):
- CLD
- MOV_L (ESI, CONTENT(tmp))
- MOV_L (EDI, EDX)
-
- MOV_L (src, ESI)
- MOV_L (dst, EDI)
- MOV_L (len, ECX)
-
- CMP_L (CONST(7), ECX)
- JC (quickMB)
-
- TEST_L (CONST(1), EDI)
- JZ (MwB)
-
- MOVS_B
- DEC_L (ECX)
-
-MwB:
- TEST_L (CONST(2), EDI)
- JZ (MlB)
-
- MOVS_W
- DEC_L (ECX)
- DEC_L (ECX)
-
-MlB:
- MOV_L (ECX, EAX)
- AND_L (CONST(3), EAX)
- SHR_L (CONST(2), ECX)
- REP
- MOVS_L
- MOV_L (EAX, ECX)
-quickMB:
- OR_L (ECX, ECX)
- JZ (return)
- REP
- MOVS_B
-
- MOV_L (CONTENT(tmp), ESI)
- MOV_L (EDX, EDI)
- RET
-
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.c b/hw/xfree86/os-support/misc/BUSmemcpy.c
deleted file mode 100644
index acef268a1..000000000
--- a/hw/xfree86/os-support/misc/BUSmemcpy.c
+++ /dev/null
@@ -1,409 +0,0 @@
-
-/****************************************************************************
-
- For Alpha Linux, BusToMem() and MemToBus() can be simply memcpy(), BUT:
- we need to prevent unaligned operations when accessing DENSE space on the BUS,
- as the video memory is mmap'd that way. The below code does this.
-
-NOTE: we could simply use the "memcpy()" from LIBC here, but that, currently, is
- not as fast.
-
-Thanks to Linus Torvalds for contributing this code.
-
-****************************************************************************/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.c,v 1.4 2000/02/12 20:45:44 dawes Exp $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifdef __alpha__
-
-#include "compiler.h"
-
-/*
- * The Jensen lacks dense memory, thus we have to address the bus via
- * the sparse addressing scheme. These routines are only used in s3im.c
- * Non time critical code uses SlowBCopy_{from/to} bus.
- *
- * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
- */
-
-#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
-#define LWORD_CODING (0x18)
-#define SPARSE (5)
-#else
-#define LWORD_CODING (0x60)
-#define SPARSE (7)
-#endif
-
-void
-xf86JensenMemToBus(char *Base, long dst, long src, int count)
-{
- if( ((long)src^((long)dst)) & 3) {
- /* src & dst are NOT aligned to each other */
- unsigned long addr;
- unsigned long low_word, high_word,last_read;
- long rm,loop;
- unsigned long tmp,org,org2,mask,src_org,count_org;
-
- src_org=src;
- count_org=count;
-
- /* add EISA longword coding and round off*/
- addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE);
- rm = (long)dst & 3;
- count += rm;
-
- count = count_org + rm;
- org = *(volatile unsigned int *)addr;
- __asm__("ldq_u %0,%1"
- :"=r" (low_word):"m" (*(unsigned long *)(src_org)));
- src = src_org - rm;
- if( count > 4 ) {
- last_read = src_org+count_org - 1;
- __asm__("ldq_u %0,%1"
- :"=r" (high_word):"m" (*(unsigned long *)(src+4)));
- __asm__("extll %1,%2,%0"
- :"=r" (low_word)
- :"r" (low_word), "r" ((unsigned long)(src)));
- __asm__("extlh %1,%2,%0"
- :"=r" (tmp)
- :"r" (high_word), "r" ((unsigned long)(src)));
- tmp |= low_word;
- src += 4;
- __asm__("mskqh %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" (rm));
- __asm__("mskql %1,%2,%0"
- :"=r" (org2)
- :"r" (org), "r" (rm));
- tmp |= org2;
-
- loop = (count-4) >> 2; /* loop eqv. count>=4 ; count -= 4 */
- while (loop) {
- /* tmp to be stored completly -- need to read next word*/
- low_word = high_word;
- *(volatile unsigned int *) (addr) = tmp;
- __asm__("ldq_u %0,%1"
- :"=r" (high_word):"m" (*(unsigned long*)(src+4)));
- loop --;
- __asm__("extll %1,%2,%0"
- :"=r" (low_word)
- :"r" (low_word), "r" ((unsigned long)src));
- __asm__("extlh %1,%2,%0"
- :"=r" (tmp)
- :"r" (high_word), "r" ((unsigned long)src));
- src += 4;
- tmp |= low_word;
- addr += 4<<SPARSE;
- }
- if ( count & 3 ) {
- /* Store tmp completly, and possibly read one more word.*/
- *(volatile unsigned int *) (addr) = tmp;
- __asm__("ldq_u %0,%1"
- :"=r" (tmp):"m" (*((unsigned long *)(last_read)) ));
- addr += 4<<SPARSE;
- __asm__("extll %1,%2,%0"
- :"=r" (low_word)
- :"r" (high_word), "r" ((unsigned long)src));
- __asm__("extlh %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" ((unsigned long)src));
- tmp |= low_word;
- org = *(volatile unsigned int *)addr;
-
- __asm__("mskql %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" (count&3));
- __asm__("mskqh %1,%2,%0"
- :"=r" (org)
- :"r" (org), "r" (count&3));
-
- tmp |= org;
- }
- *(volatile unsigned int *) (addr) = tmp;
- return;
- } else { /* count > 4 */
- __asm__("ldq_u %0,%1"
- :"=r" (high_word):"m" (*(unsigned long *)(src+4)));
- __asm__("extll %1,%2,%0"
- :"=r" (low_word)
- :"r" (low_word), "r" ((unsigned long)(src)));
- __asm__("extlh %1,%2,%0"
- :"=r" (tmp)
- :"r" (high_word), "r" ((unsigned long)(src)));
- tmp |= low_word;
- if( count < 4 ) {
-
- mask = -1;
- __asm__("mskqh %1,%2,%0"
- :"=r" (mask)
- :"r" (mask), "r" (rm));
- __asm__("mskql %1,%2,%0"
- :"=r" (mask)
- :"r" (mask), "r" (count));
- tmp = (tmp & mask) | (org & ~mask);
- *(volatile unsigned int *) (addr) = tmp;
- return;
- } else {
- __asm__("mskqh %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" (rm));
- __asm__("mskql %1,%2,%0"
- :"=r" (org2)
- :"r" (org), "r" (rm));
-
- tmp |= org2;
- *(volatile unsigned int *) (addr) = tmp;
- return;
- }
- }
- } else { /* src & dst are aligned to each other */
- unsigned long addr;
- unsigned int tmp,org,rm;
- unsigned int *src_r;
-
- /* add EISA longword coding and round off*/
- addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE);
-
- src_r = (unsigned int*)((long)src & ~3L);
- rm=(long)src & 3;
- count += rm;
-
- tmp = *src_r;
- org = *(volatile unsigned int *)addr;
-
- __asm__("mskqh %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" (rm));
- __asm__("mskql %1,%2,%0"
- :"=r" (org)
- :"r" (org), "r" (rm));
-
- tmp |= org;
-
- while (count > 4) {
- *(volatile unsigned int *) addr = tmp;
- addr += 4<<SPARSE;
- src_r += 1;
- tmp = *src_r;
- count -= 4;
- }
-
- org = *(volatile unsigned int *)addr;
- __asm__("mskql %1,%2,%0"
- :"=r" (tmp)
- :"r" (tmp), "r" (count));
- __asm__("mskqh %1,%2,%0"
- :"=r" (org)
- :"r" (org), "r" (count));
- tmp |= org;
- *(volatile unsigned int *) (addr) = tmp;
- }
-}
-
-void
-xf86JensenBusToMem(char *Base, char *dst, unsigned long src, int count)
-{
-#if 0
- /* Optimization of BusToMem() is left as an exercise to the reader ;-)
- * Consider that ldq_u/extlh/extll won't work because of the bus being
- * only 4 bytes wide!
- */
-#else
- unsigned long addr;
- long result;
-
- addr = (unsigned long)(Base+(src<<SPARSE)) ;
- while( addr & (3<<SPARSE) ){
- if(count <= 0) return;
- result = *(volatile int *) addr;
- result >>= ((addr>>SPARSE) & 3) * 8;
- *dst++ = (char) result;
- addr += 1<<SPARSE;
- count--;
- }
- count -=4;
- while(count >= 0){
- int i;
-
- result = *(volatile int *) (addr+LWORD_CODING);
- for(i=4;i--;) {
- *dst++ = (char) result;
- result >>= 8;
- }
- addr += 4<<SPARSE;
- count -= 4;
- }
- count +=4;
-
- while( count ){
- result = *(volatile int *) addr;
- result >>= ((addr>>SPARSE) & 3) * 8;
- *dst++ = (char) result;
- addr += 1<<SPARSE;
- count--;
- }
-#endif
-}
-
-
-static unsigned long __memcpy(unsigned long dest, unsigned long src, int n);
-
-void
-xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
-{
- __memcpy((unsigned long)dst, (unsigned long)src, len);
-}
-void
-xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
-{
- if (len == sizeof(int))
- if (!(((long)src | (long)dst) & 3))
- *((unsigned int*)dst) = *((unsigned int*)(src));
- else {
- int i;
- if (((long)src) & 3)
- i = ldl_u((unsigned int*)src);
- else
- i = *(unsigned int*)src;
- if (((long)dst) & 3)
- stl_u(i,(unsigned int*)dst);
- else
- *(unsigned int*)dst = i;
- }
- else
- __memcpy((unsigned long)dst, (unsigned long)src, len);
-}
-
-/*
- * linux/arch/alpha/lib/memcpy.c
- *
- * Copyright (C) 1995 Linus Torvalds, used with his permission.
- */
-
-/*
- * This is a reasonably optimized memcpy() routine.
- */
-
-/*
- * Note that the C code is written to be optimized into good assembly. However,
- * at this point gcc is unable to sanely compile "if (n >= 0)", resulting in a
- * explicit compare against 0 (instead of just using the proper "blt reg, xx" or
- * "bge reg, xx"). I hope alpha-gcc will be fixed to notice this eventually..
- */
-
-/*
- * This should be done in one go with ldq_u*2/mask/stq_u. Do it
- * with a macro so that we can fix it up later..
- */
-#define ALIGN_DEST_TO8(d,s,n) \
- while (d & 7) { \
- if (n <= 0) return; \
- n--; \
- *(char *) d = *(char *) s; \
- d++; s++; \
- }
-
-/*
- * This should similarly be done with ldq_u*2/mask/stq. The destination
- * is aligned, but we don't fill in a full quad-word
- */
-#define DO_REST(d,s,n) \
- while (n > 0) { \
- n--; \
- *(char *) d = *(char *) s; \
- d++; s++; \
- }
-
-/*
- * This should be done with ldq/mask/stq. The source and destination are
- * aligned, but we don't fill in a full quad-word
- */
-#define DO_REST_ALIGNED(d,s,n) DO_REST(d,s,n)
-
-/*
- * This does unaligned memory copies. We want to avoid storing to
- * an unaligned address, as that would do a read-modify-write cycle.
- * We also want to avoid double-reading the unaligned reads.
- *
- * Note the ordering to try to avoid load (and address generation) latencies.
- */
-static __inline__ void __memcpy_unaligned(unsigned long d, unsigned long s, long n)
-{
- ALIGN_DEST_TO8(d,s,n);
- n -= 8; /* to avoid compare against 8 in the loop */
- if (n >= 0) {
- unsigned long low_word, high_word;
- __asm__("ldq_u %0,%1":"=r" (low_word):"m" (*(unsigned long *) s));
- do {
- unsigned long tmp;
- __asm__("ldq_u %0,%1":"=r" (high_word):"m" (*(unsigned long *)(s+8)));
- n -= 8;
- __asm__("extql %1,%2,%0"
- :"=r" (low_word)
- :"r" (low_word), "r" (s));
- __asm__("extqh %1,%2,%0"
- :"=r" (tmp)
- :"r" (high_word), "r" (s));
- s += 8;
- *(unsigned long *) d = low_word | tmp;
- d += 8;
- low_word = high_word;
- } while (n >= 0);
- }
- n += 8;
- DO_REST(d,s,n);
-}
-
-/*
- * Hmm.. Strange. The __asm__ here is there to make gcc use a integer register
- * for the load-store. I don't know why, but it would seem that using a floating
- * point register for the move seems to slow things down (very small difference,
- * though).
- *
- * Note the ordering to try to avoid load (and address generation) latencies.
- */
-static __inline__ void __memcpy_aligned(unsigned long d, unsigned long s, long n)
-{
- ALIGN_DEST_TO8(d,s,n);
- n -= 8;
- while (n >= 0) {
- unsigned long tmp;
- __asm__("ldq %0,%1":"=r" (tmp):"m" (*(unsigned long *) s));
- n -= 8;
- s += 8;
- *(unsigned long *) d = tmp;
- d += 8;
- }
- n += 8;
- DO_REST_ALIGNED(d,s,n);
-}
-
-static unsigned long __memcpy(unsigned long dest, unsigned long src, int n)
-{
- if (!((dest ^ src) & 7)) {
- __memcpy_aligned(dest, src, n);
- return dest;
- }
- __memcpy_unaligned(dest, src, n);
- return dest;
-}
-
-#else /* __alpha__ */
-
-void
-xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
-{
- memcpy(dst, src, len);
-}
-void
-xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
-{
- memcpy(dst, src, len);
-}
-
-#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/misc/Delay.c b/hw/xfree86/os-support/misc/Delay.c
deleted file mode 100644
index b5de1d899..000000000
--- a/hw/xfree86/os-support/misc/Delay.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.4 2003/03/25 04:18:23 dawes Exp $ */
-
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#include <time.h>
-
-void
-xf86UDelay(long usec)
-{
-#if 0
- struct timeval start, interrupt;
-#else
- int sigio;
-
- sigio = xf86BlockSIGIO();
- xf86usleep(usec);
- xf86UnblockSIGIO(sigio);
-#endif
-
-#if 0
- gettimeofday(&start,NULL);
-
- do {
- usleep(usec);
- gettimeofday(&interrupt,NULL);
-
- if ((usec = usec - (interrupt.tv_sec - start.tv_sec) * 1000000
- - (interrupt.tv_usec - start.tv_usec)) < 0)
- break;
- start = interrupt;
- } while (1);
-#endif
-}
-
diff --git a/hw/xfree86/os-support/misc/IODelay.S b/hw/xfree86/os-support/misc/IODelay.S
deleted file mode 100644
index 4c6e32f3f..000000000
--- a/hw/xfree86/os-support/misc/IODelay.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S,v 1.1 1999/07/10 07:24:50 dawes Exp $ */
-/*******************************************************************************
- Copyright 1994 by Glenn G. Lai
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyr notice appear in all copies and that
-both that copyr notice and this permission notice appear in
-supporting documentation, and that the name of Glenn G. Lai not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-Glenn G. Lai
-P.O. Box 4314
-Austin, Tx 78765
-glenn@cs.utexas.edu)
-7/21/94
-*******************************************************************************/
-/* $XConsortium: IODelay.s /main/4 1996/02/21 17:40:21 kaleb $ */
-
-/*
- * All we really need is a delay of about 40ns for I/O recovery for just
- * about any occasion, but we'll be more conservative here: On a
- * 100-MHz CPU, produce at least a delay of 1,000ns.
- */
-
-#include "assyntax.h"
-
- FILE("DACDelay.s")
-
- AS_BEGIN
-
- GLOBL GLNAME(xf86IODelay)
-
- SEG_TEXT
- ALIGNTEXT4
-GLNAME(xf86IODelay):
- MOV_L (CONST(100), EAX)
-delay_it:
- DEC_L (EAX)
- JNE (delay_it)
- RET
-
diff --git a/hw/xfree86/os-support/misc/IODelay.c b/hw/xfree86/os-support/misc/IODelay.c
deleted file mode 100644
index 57176c5d5..000000000
--- a/hw/xfree86/os-support/misc/IODelay.c
+++ /dev/null
@@ -1,24 +0,0 @@
-
-/* $XConsortium: IODelay.c /main/1 1996/05/07 17:13:43 kaleb $ */
-/*******************************************************************************
- Stub for Alpha Linux
-*******************************************************************************/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.c,v 1.3 2000/08/04 16:13:41 eich Exp $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * All we really need is a delay of about 40ns for I/O recovery for just
- * about any occasion, but we'll be more conservative here: On a
- * 100-MHz CPU, produce at least a delay of 1,000ns.
- */
-void
-xf86IODelay()
-{
- xf86UDelay(1);
-}
-
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.S b/hw/xfree86/os-support/misc/SlowBcopy.S
deleted file mode 100644
index 9b6af1d69..000000000
--- a/hw/xfree86/os-support/misc/SlowBcopy.S
+++ /dev/null
@@ -1,108 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S,v 1.1 1999/07/10 07:24:51 dawes Exp $ */
-/*******************************************************************************
- Copyright 1994 by Glenn G. Lai
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyr notice appear in all copies and that
-both that copyr notice and this permission notice appear in
-supporting documentation, and that the name of Glenn G. Lai not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-Glenn G. Lai
-P.O. Box 4314
-Austin, Tx 78765
-glenn@cs.utexas.edu)
-7/21/94
-*******************************************************************************/
-/* $XConsortium: SlowBcopy.s /main/4 1996/02/21 17:40:52 kaleb $ */
-
-/*
- * Modified from the output generated by GCC
- *
- * Create a dependency that should be immune from the effect of register
- * renaming as is commonly seen in superscalar processors. This should
- * insert a minimum of 100-ns delays between reads/writes at clock rates
- * up to 100 MHz---GGL
- *
- * Slowbcopy(char *src, char *dst, int count)
- *
- */
-
-#include "assyntax.h"
-
- FILE("SlowBcopy.s")
-
- AS_BEGIN
-
-gcc2_compiled.:
-___gnu_compiled_c:
-
- GLOBL GLNAME(xf86SlowBcopy)
-
- SEG_TEXT
- ALIGNTEXT4
-GLNAME(xf86SlowBcopy):
- PUSH_L (EBP)
- MOV_L (ESP,EBP)
- PUSH_L (ESI)
- PUSH_L (EBX)
- MOV_L (REGOFF(8,EBP),ECX)
- MOV_L (REGOFF(12,EBP),EDX)
- MOV_L (REGOFF(16,EBP),ESI)
- XOR_L (EAX,EAX)
- CMP_L (ESI,EAX)
- JGE (L3)
-
- ALIGNTEXT4
-L5:
- MOV_B (REGIND(ECX),BL)
-
- MOV_B (BL, BH)
- MOV_B (BH, BL)
- MOV_B (BL, BH)
- MOV_B (BH, BL)
- MOV_B (BL, BH)
- MOV_B (BH, BL)
- MOV_B (BL, BH)
- MOV_B (BH, BL)
- MOV_B (BL, BH)
- MOV_B (BH, BL)
-
- MOV_B (BL,REGIND(EDX))
-
- INC_L (ECX)
- DEC_L (ECX)
- INC_L (ECX)
- DEC_L (ECX)
- INC_L (ECX)
- DEC_L (ECX)
- INC_L (ECX)
- DEC_L (ECX)
- INC_L (ECX)
- DEC_L (ECX)
-
- INC_L (ECX)
- INC_L (EDX)
- INC_L (EAX)
- CMP_L (ESI,EAX)
- JL (L5)
-L3:
- LEA_L (REGOFF(-8,EBP),ESP)
- POP_L (EBX)
- POP_L (ESI)
- MOV_L (EBP,ESP)
- POP_L (EBP)
- RET
-
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
deleted file mode 100644
index 98546b688..000000000
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-/* $XConsortium: SlowBcopy.c /main/1 1996/05/07 17:14:10 kaleb $ */
-/*******************************************************************************
- for Alpha Linux
-*******************************************************************************/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c,v 1.6 2003/04/07 16:23:39 eich Exp $ */
-
-/*
- * Create a dependency that should be immune from the effect of register
- * renaming as is commonly seen in superscalar processors. This should
- * insert a minimum of 100-ns delays between reads/writes at clock rates
- * up to 100 MHz---GGL
- *
- * Slowbcopy(char *src, char *dst, int count)
- *
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "compiler.h"
-
-/* The outb() isn't needed on my machine, but who knows ... -- ost */
-void
-xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
-{
-#if defined(__ia64__)
- outb(0x80, 0x00);
-#endif
- while(len--)
- {
- *dst++ = *src++;
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
- outb(0x80, 0x00);
-#endif
- }
-}
-
-#ifdef __alpha__
-/*
- * The Jensen lacks dense memory, thus we have to address the bus via
- * the sparse addressing scheme. Time critical code uses routines from
- * BUSmemcpy.c
- *
- * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
- */
-
-#ifdef linux
-
-unsigned long _bus_base(void);
-
-#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
-#define SPARSE (5)
-#else
-#define SPARSE (7)
-#endif
-
-#define isJensen() (!_bus_base())
-
-#else
-
-#define isJensen() 0
-#define SPARSE 0
-
-#endif
-
-void
-xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
-{
- if (isJensen())
- {
- unsigned long addr;
- long result;
-
- addr = (unsigned long) src;
- while( count ){
- result = *(volatile int *) addr;
- result >>= ((addr>>SPARSE) & 3) * 8;
- *dst++ = (unsigned char) (0xffUL & result);
- addr += 1<<SPARSE;
- count--;
- outb(0x80, 0x00);
- }
- }
- else
- xf86SlowBcopy(src,dst,count);
-}
-
-void
-xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
-{
- if (isJensen())
- {
- unsigned long addr;
-
- addr = (unsigned long) dst;
- while(count) {
- *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
- src++;
- addr += 1<<SPARSE;
- count--;
- outb(0x80, 0x00);
- }
- }
- else
- xf86SlowBcopy(src,dst,count);
-}
-#endif
diff --git a/hw/xfree86/os-support/misc/xf86_IlHack.c b/hw/xfree86/os-support/misc/xf86_IlHack.c
deleted file mode 100644
index 019156357..000000000
--- a/hw/xfree86/os-support/misc/xf86_IlHack.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/xf86_IlHack.c,v 3.5 1998/07/25 16:56:51 dawes Exp $ */
-/*
- * This file is an incredible crock to get the normally-inline functions
- * built into the server so that things can be debugged properly.
- *
- * Note: this doesn't work when using a compiler other than GCC.
- */
-/* $XConsortium: xf86_IlHack.c /main/4 1996/02/21 17:52:26 kaleb $ */
-
-
-#define static /**/
-#define __inline__ /**/
-#undef NO_INLINE
-#define DO_PROTOTYPES
-#include "compiler.h"
diff --git a/hw/xfree86/os-support/misc/xf86_Util.c b/hw/xfree86/os-support/misc/xf86_Util.c
deleted file mode 100644
index 7889617e3..000000000
--- a/hw/xfree86/os-support/misc/xf86_Util.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/xf86_Util.c,v 3.8 2001/10/28 03:34:02 tsi Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: xf86_Util.c /main/5 1996/10/23 13:13:10 kaleb $ */
-
-/*
- * This file is for utility functions that will be shared by other pieces
- * of the system. Putting things here ensure that all the linking order
- * dependencies are dealt with, as this library will be linked in last.
- */
-
-#include <ctype.h>
-
-/* To prevent empty source file warnings */
-int _xf86misc;
-
-#if 0
-/* For use only with gcc */
-#ifdef __GNUC__
-
-#include "os.h"
-
-char *
-debug_alloca(char *file, int line, int size)
-{
- char *ptr;
-
- ptr = Xalloc(size);
- ErrorF("Alloc: %s line %d; ptr = 0x%x, length = %d\n", file, line,
- ptr, size);
- return ptr;
-}
-
-void
-debug_dealloca(char *file, int line, char *ptr)
-{
- ErrorF("Dealloc: %s line %d; ptr = 0x%x\n", file, line, ptr);
- Xfree(ptr);
-}
-#endif
-#endif
-
-#if defined(ISC) || defined(Lynx)
-
-#include <math.h>
-
-/* Needed for apm_driver.c */
-/* These functions are modeled after the functions inside gnu's libc */
-
-static double
-copysign(double x, double y)
-{
- x = fabs(x);
- return y < 0 ? - x : x;
-}
-
-double
-RInt(double x)
-{
- double s,t;
- const double one = 1.0;
- const static double L = 4503599627370496.0E0;
-
- if (x!=x)
- return(x);
- if (copysign(x,one) >= L)
- return(x);
- s = copysign(L,x);
- t = x + s;
- return (t - s);
-}
-#endif
diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c
deleted file mode 100644
index 899c3820b..000000000
--- a/hw/xfree86/os-support/sco/VTsw_sco.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v 1.4 2003/07/07 15:34:27 eich Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- * Copyright 1993 by David McCullough <davidm@stallion.oz.au>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: VTsw_sco.c /main/2 1995/11/13 06:08:36 kaleb $ */
-
-#include "X.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/* For the event driver prototypes */
-#include <sys/event.h>
-#include <mouse.h>
-
-/*
- * Handle the VT-switching interface for SCO
- */
-
-/*
- * This function is the signal handler for the VT-switching signal. It
- * is only referenced inside the OS-support layer. NOTE: we do NOT need
- * to re-arm the signal here, since we used sigaction() to set the signal
- * disposition in sco_init.c. If we had used signal(), we would need to
- * re-arm the signal here. All we need to do now is record the fact that
- * we got the signal. XFree86 handles the rest.
- */
-void
-xf86VTRequest(int sig)
-{
- xf86Info.vtRequestsPending = TRUE;
- return;
-}
-
-Bool
-xf86VTSwitchPending()
-{
- return(xf86Info.vtRequestsPending ? TRUE : FALSE);
-}
-
-/*
- * When we switch away, we need to flush and suspend the event driver
- * before the VT_RELDISP. We also need to get the current LED status
- * and preserve it, so that we can restore it when we come back.
- */
-static int sco_ledstatus = -1;
-static unsigned int sco_ledstate = 0;
-
-Bool
-xf86VTSwitchAway()
-{
- ev_flush();
- ev_suspend();
-
- sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate);
-
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) {
- return(FALSE);
- } else {
- return(TRUE);
- }
-}
-
-/*
- * When we come back to the X server, we need to resume the event driver,
- * and we need to restore the LED settings to what they were when we
- * switched away.
- */
-Bool
-xf86VTSwitchTo()
-{
- ev_resume();
-
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
- return(FALSE);
- } else {
- if (sco_ledstatus >= 0) {
- ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
- }
- sco_ledstatus = -1;
-
- /*
- * Convince the console driver this screen is in graphics mode,
- * otherwise it assumes it can do more to the screen than it should.
- */
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
- ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
- }
-
- return TRUE;
- }
-}
diff --git a/hw/xfree86/os-support/sco/sco_init.c b/hw/xfree86/os-support/sco/sco_init.c
deleted file mode 100644
index 389664647..000000000
--- a/hw/xfree86/os-support/sco/sco_init.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_init.c,v 3.14 2002/11/20 23:00:44 dawes Exp $ */
-/*
- * Copyright 2001 by J. Kean Johnston <jkj@sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XConsortium$ */
-
-/* Re-written May 2001 to represent the current state of reality */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static Bool KeepTty = FALSE;
-static int VTnum = -1;
-static char *vtdevice = NULL;
-static int sco_console_mode = -1;
-
-extern Bool mpxLock;
-
-void
-xf86OpenConsole()
-{
- int fd,i, ioctl_ret;
- struct vt_mode VT;
- static char vtname[32];
- struct vid_info vidinf;
- struct sigaction sigvtsw;
-
- if (serverGeneration == 1) {
- /* check if we're run with euid==0 */
- if (geteuid() != 0) {
- FatalError("xf86OpenConsole: Server must be setuid root\n");
- }
-
- /*
- * Set up the virtual terminal (multiscreen in SCO parlance).
- * For the actual console itself, screens are numbered from
- * 1 to (usually) 16. However, it is possible to have a nested
- * server, and it is also possible to be on a multi-console
- * system such as MaxSpeed or SunRiver. Therefore, we should
- * not make any assumptions about the TTY name we are on, and
- * instead we rely on ttyname() to give us the real TTY name.
- * Previously, XFree86 tried to determine the TTY name manually.
- * This is wrong. The only time we need to futz with the TTY name
- * if if we were given the name of a TTY to run on explicity on
- * the command line.
- */
-
- if (VTnum == -1) {
- /*
- * We can query the current VT number using CONS_GETINFO.
- */
- char *ttn;
-
- vidinf.size = sizeof(vidinf);
- if (ioctl (0, CONS_GETINFO, &vidinf) < 0) {
- FatalError ("xf86OpenConsole: Not on a console device "
- "or error querying device (%s)\n", strerror (errno));
- }
-
- VTnum = vidinf.m_num + 1; /* 0-based */
- ttn = ttyname (0);
-
- if (ttn == (char *)0) {
- ErrorF ("xf86OpenConsole: Error determining TTY name (%s)\n",
- strerror(errno));
- snprintf (vtname, sizeof(vtname)-1, "/dev/tty%02d", VTnum);
- } else {
- strlcpy (vtname, ttn, sizeof(vtname));
- }
- vtdevice = vtname;
- } else if (VTnum == -2 || VTnum >= 0) {
- /*
- * An explicit device was specified. Make sure its a console device.
- */
- if (VTnum != -2) {
- snprintf (vtname, sizeof(vtname)-1, "/dev/tty%02d", VTnum);
- vtdevice = vtname;
- }
-
- fd = open (vtdevice, O_RDWR | O_NDELAY, 0);
- if (fd < 0) {
- FatalError ("xf86OpenConsole: Can not open device '%s' (%s)\n",
- vtdevice, strerror(errno));
- }
-
- vidinf.size = sizeof(vidinf);
- if (ioctl (fd, CONS_GETINFO, &vidinf) < 0) {
- FatalError ("xf86OpenConsole: '%s' is not a console device "
- "or error querying device (%s)\n", vtname, strerror (errno));
- }
- VTnum = vidinf.m_num + 1; /* 0-based */
- close (fd); /* We're done with it for now */
- }
-
- ErrorF("(using VT%02d device %s)\n\n", VTnum, vtdevice);
-
- if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NDELAY, 0)) < 0) {
- FatalError("xf86OpenConsole: Cannot open %s (%s)\n", vtdevice,
- strerror(errno));
- }
-
- /* Dispose of stdin and stdout */
- if (freopen(vtdevice, "r+", stdin) == (FILE *) NULL) {
- FatalError("xf86OpenConsole: Cannot reopen stdin as %s (%s)\n",
- vtdevice, strerror(errno));
- }
-
- if (freopen(vtname, "r+", stdout) == (FILE *) NULL) {
- FatalError("xf86OpenConsole: Cannot reopen stdout as %s (%s)\n",
- vtdevice, strerror(errno));
- }
-
- /*
- * We make 100% sure we use the correct VT number. This can get ugly
- * where there are multi-consoles in use, so we make sure we query
- * the kernel for the correct VT number. It knows best, we don't.
- */
- vidinf.size = sizeof(vidinf);
- if (ioctl (xf86Info.consoleFd, CONS_GETINFO, &vidinf) < 0) {
- FatalError ("xf86OpenConsole: Failed to query console number (%s)\n",
- strerror (errno));
- }
- xf86Info.vtno = vidinf.m_num;
-
- /* We activate the console just in case its not the one we are on */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
- ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno));
- }
-
- /* Disassociate from controling TTY */
- if (!KeepTty) {
- setpgrp();
- }
-
- /*
- * Now we get the current mode that the console device is on. We will
- * use this later when we close the console device to restore it to
- * that same mode.
- */
- if ((sco_console_mode = ioctl(xf86Info.consoleFd, CONS_GET, 0L)) < 0) {
- FatalError("xf86OpenConsole: CONS_GET failed on console (%s)\n",
- strerror(errno));
- }
-
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) {
- FatalError("xf86OpenConsole: VT_GETMODE failed (%s)\n", strerror(errno));
- }
-
- sigvtsw.sa_handler = xf86VTRequest;
- sigfillset(&sigvtsw.sa_mask);
- sigvtsw.sa_flags = 0;
-
- /* NOTE: Using sigaction means we dont have to re-arm the signal */
- sigaction(SIGUSR1, &sigvtsw, NULL);
-
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- VT.frsig = SIGINT; /* Not implemented */
- VT.waitv = 0;
-
- /*
- * The SCO X server tries the following call 5 times. Lets do the same
- * thing. It shouldn't really be required but sometimes things take a
- * while to settle down when switching screens. *helpless shrug* I know
- * its sucks but ...
- */
-
- ioctl_ret = 0;
- for (i = 0; i < 5; i++) {
- ioctl_ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
- if (ioctl_ret >= 0)
- break;
- usleep(999999); /* Dont use nap() - it forces linking with -lx */
- }
-
- if (ioctl_ret < 0) {
- FatalError("xf86OpenConsole: VT_SETMODE failed (%s)\n", strerror(errno));
- }
-
- /*
- * Convince the console driver we are in graphics mode.
- */
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
- ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
- }
- } else { /* serverGeneration != 1 */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
- ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno));
- }
- }
-}
-
-/*
- * Restore the console to its previous state. This may cause flicker if
- * the screen was previous in a graphics mode, because we first set it
- * to text mode. This has the advantage of getting the console driver
- * to do a soft reset on the card, which really does help settle the
- * video card down again after coming out of Xfree86.
- */
-void
-xf86CloseConsole()
-{
- struct vt_mode VT;
- struct sigaction sigvtsw;
-
- /* Set text mode (possibly briefly) */
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT0);
-
- /* Restore the original mode */
- if (sco_console_mode != -1) {
- ioctl(xf86Info.consoleFd, MODESWITCH | sco_console_mode, 0L);
- }
-
- ioctl(xf86Info.consoleFd, VT_RELDISP, 1); /* Release the display */
-
- sigvtsw.sa_handler = SIG_DFL;
- sigfillset(&sigvtsw.sa_mask);
- sigvtsw.sa_flags = 0;
-
- sigaction(SIGUSR1, &sigvtsw, NULL);
-
- VT.mode = VT_AUTO;
- VT.waitv = 0;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- VT.frsig = SIGINT;
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* Revert to auto handling */
-
- close(xf86Info.consoleFd); /* We're done with the device */
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful
- * when debugging (so the server can receive keyboard signals).
- */
- if (!strcmp(argv[i], "-keeptty")) {
- KeepTty = TRUE;
- return(1);
- }
-
- /*
- * By default, the X server wants to bind itself to CPU 0. This makes
- * sure that the server has full access to the I/O ports at IOPL 3.
- * Some SMP systems have trouble with I/O on CPU's other than 0. If,
- * however, you have a system that is well behaved, you can specify
- * this argument and let the scheduler decide which CPU the server
- * should run on.
- */
- if (!strcmp(argv[i], "-nompxlock")) {
- mpxLock = FALSE;
- return (1);
- }
-
- /*
- * Specify the VT number to run on (NOT the device).
- */
- if ((argv[i][0] == 'v') && (argv[i][1] == 't')) {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0) {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- if (VTnum <= 0) {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- return(1);
- }
-
- /*
- * Use a device the user specifies.
- */
- if (!strcmp(argv[i], "-crt")) {
- if (++i > argc) {
- UseMsg();
- VTnum = -1;
- return(0);
- } else {
- VTnum = -2;
- vtdevice = argv[i];
- return(2);
- }
- }
- return(0);
-}
-
-void
-xf86UseMsg()
-{
- ErrorF("vtXX use the specified VT number\n");
- ErrorF("-crt DEVICE use the specified VT device\n");
- ErrorF("-nompxlock dont bind X server to CPU 0\n");
- ErrorF("-keeptty ");
- ErrorF("don't detach controlling tty (for debugging only)\n");
-}
diff --git a/hw/xfree86/os-support/sco/sco_io.c b/hw/xfree86/os-support/sco/sco_io.c
deleted file mode 100644
index a018e3434..000000000
--- a/hw/xfree86/os-support/sco/sco_io.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_io.c,v 3.10 2003/02/17 15:11:59 dawes Exp $ */
-/*
- * Copyright 2001 by J. Kean Johnston <jkj@sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XConsortium$ */
-
-/* Re-written May 2001 to represent the current state of reality */
-
-#include "X.h"
-
-#include "compiler.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-#include "xf86_OSlib.h"
-
-#include <sys/param.h>
-#include <sys/emap.h>
-#include <sys/nmap.h>
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- if (loudness && pitch) {
- ioctl(xf86Info.consoleFd, KIOCSOUND, 1193180 / pitch);
- usleep(duration * loudness * 20);
- ioctl(xf86Info.consoleFd, KIOCSOUND, 0);
- }
-}
-
-void
-xf86SetKbdLeds(int leds)
-{
- /*
- * sleep the first time through under SCO. There appears to be a
- * timing problem in the driver which causes the keyboard to be lost.
- * This usleep stops it from occurring. NOTE: this was in the old code.
- * I am not convinced it is true any longer, but it doesn't hurt to
- * leave this in here.
- */
- static int once = 1;
-
- if (once) {
- usleep(100);
- once = 0;
- }
-
- ioctl(xf86Info.consoleFd, KDSETLED, leds );
-}
-
-int
-xf86GetKbdLeds()
-{
- int leds;
-
- ioctl (xf86Info.consoleFd, KDGETLED, &leds);
- return leds;
-}
-
-/*
- * Much of the code in this function is duplicated from the Linux code
- * by Orest Zborowski <obz@Kodak.com> and David Dawes <dawes@xfree86.org>.
- * Please see the file ../linux/lnx_io.c for full copyright information.
- *
- * NOTE: Only OpenServer Release 5.0.6 with Release Supplement 5.0.6A
- * and later have the required ioctl. 5.0.6A or higher is HIGHLY
- * recommended. The console driver is quite a different beast on that OS.
- */
-void
-xf86SetKbdRepeat(char rad)
-{
-#if defined(KBIO_SETRATE)
- int i;
- int value = 0x7f; /* Maximum delay with slowest rate */
- int delay = 250; /* Default delay */
- int rate = 300; /* Default repeat rate */
-
- static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150,
- 133, 120, 109, 100, 92, 86, 80, 75, 67,
- 60, 55, 50, 46, 43, 40, 37, 33, 30, 27,
- 25, 23, 21, 20 };
-#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int ))
-
- static int valid_delays[] = { 250, 500, 750, 1000 };
-#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int ))
-
- if (xf86Info.kbdRate >= 0)
- rate = xf86Info.kbdRate * 10;
- if (xf86Info.kbdDelay >= 0)
- delay = xf86Info.kbdDelay;
-
- for (i = 0; i < RATE_COUNT; i++)
- if (rate >= valid_rates[i]) {
- value &= 0x60;
- value |= i;
- break;
- }
-
- for (i = 0; i < DELAY_COUNT; i++)
- if (delay <= valid_delays[i]) {
- value &= 0x1f;
- value |= i << 5;
- break;
- }
-
- ioctl (xf86Info.consoleFd, KBIO_SETRATE, value);
-#endif /* defined(KBIO_SETRATE) */
-}
-
-static Bool use_tcs = TRUE, use_kd = TRUE;
-static Bool no_nmap = TRUE, no_emap = TRUE;
-static int orig_getsc, orig_kbm;
-static struct termios orig_termios;
-static keymap_t keymap, noledmap;
-static uchar_t *sc_mapbuf;
-static uchar_t *sc_mapbuf2;
-
-void
-xf86KbdInit()
-{
- orig_getsc = 0;
- if (ioctl (xf86Info.consoleFd, TCGETSC, &orig_getsc) < 0)
- use_tcs = FALSE;
- if (ioctl (xf86Info.consoleFd, KDGKBMODE, &orig_kbm) < 0)
- use_kd = FALSE;
-
- if (!use_tcs && !use_kd)
- FatalError ("xf86KbdInit: Could not determine keyboard mode\n");
-
- /*
- * One day this should be fixed to translate normal ASCII characters
- * back into scancodes or into events that XFree86 wants, but not
- * now. For the time being, we only support scancode mode screens.
- */
- if (use_tcs && !(orig_getsc & KB_ISSCANCODE))
- FatalError ("xf86KbdInit: Keyboard can not send scancodes\n");
-
- /*
- * We need to get the original keyboard map and NUL out the lock
- * modifiers. This prevents the scancode API from messing with
- * the keyboard LED's. We restore the original map when we exit.
- */
- if (ioctl (xf86Info.consoleFd, GIO_KEYMAP, &keymap) < 0) {
- FatalError ("xf86KbdInit: Failed to get keyboard map (%s)\n",
- strerror(errno));
- }
- if (ioctl (xf86Info.consoleFd, GIO_KEYMAP, &noledmap) < 0) {
- FatalError ("xf86KbdInit: Failed to get keyboard map (%s)\n",
- strerror(errno));
- } else {
- int i, j;
-
- for (i = 0; i < noledmap.n_keys; i++) {
- for (j = 0; j < NUM_STATES; j++) {
- if (IS_SPECIAL(noledmap, i, j) &&
- ((noledmap.key[i].map[j] == K_CLK) ||
- (noledmap.key[i].map[j] == K_NLK) ||
- (noledmap.key[i].map[j] == K_SLK))) {
- noledmap.key[i].map[j] = K_NOP;
- }
- }
- }
- }
-
- if (ioctl (xf86Info.consoleFd, XCGETA, &orig_termios) < 0) {
- FatalError ("xf86KbdInit: Failed to get terminal modes (%s)\n",
- strerror(errno));
- }
-
- sc_mapbuf = xalloc (10*BSIZE);
- sc_mapbuf2 = xalloc(10*BSIZE);
-
- /* Get the emap */
- if (ioctl (xf86Info.consoleFd, LDGMAP, sc_mapbuf) < 0) {
- if (errno != ENAVAIL) {
- FatalError ("xf86KbdInit: Failed to retrieve e-map (%s)\n",
- strerror (errno));
- }
- no_emap = FALSE;
- }
-
- /* Get the nmap */
- if (ioctl (xf86Info.consoleFd, NMGMAP, sc_mapbuf2) < 0) {
- if (errno != ENAVAIL) {
- FatalError ("xf86KbdInit: Failed to retrieve n-map (%s)\n",
- strerror (errno));
- }
- no_nmap = FALSE;
- }
-}
-
-int
-xf86KbdOn()
-{
- struct termios newtio;
-
- ioctl (xf86Info.consoleFd, LDNMAP); /* Turn e-mapping off */
- ioctl (xf86Info.consoleFd, NMNMAP); /* Turn n-mapping off */
-
- newtio = orig_termios; /* structure copy */
- newtio.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- newtio.c_oflag = 0;
- newtio.c_cflag = CREAD | CS8 | B9600;
- newtio.c_lflag = 0;
- newtio.c_cc[VTIME]=0;
- newtio.c_cc[VMIN]=1;
- cfsetispeed(&newtio, 9600);
- cfsetospeed(&newtio, 9600);
- ioctl(xf86Info.consoleFd, XCSETA, &newtio);
-
- /* Now tell the keyboard driver to send us raw scancodes */
- if (use_tcs) {
- int nm = orig_getsc;
- nm &= ~KB_XSCANCODE;
- ioctl (xf86Info.consoleFd, TCSETSC, &nm);
- }
-
- if (use_kd)
- ioctl (xf86Info.consoleFd, KDSKBMODE, K_RAW);
-
- ioctl (xf86Info.consoleFd, PIO_KEYMAP, &noledmap);
-
- return(xf86Info.consoleFd);
-}
-
-int
-xf86KbdOff()
-{
- /* Revert back to original translate scancode mode */
- if (use_tcs)
- ioctl (xf86Info.consoleFd, TCSETSC, &orig_getsc);
- if (use_kd)
- ioctl (xf86Info.consoleFd, KDSKBMODE, orig_kbm);
-
- ioctl (xf86Info.consoleFd, PIO_KEYMAP, &keymap);
-
- if (no_emap)
- ioctl (xf86Info.consoleFd, LDSMAP, sc_mapbuf);
- if (no_nmap)
- ioctl (xf86Info.consoleFd, NMSMAP, sc_mapbuf2);
-
- ioctl(xf86Info.consoleFd, XCSETA, &orig_termios);
-
- return(xf86Info.consoleFd);
-}
-
-#include "xf86OSKbd.h"
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/sco/sco_iop.c b/hw/xfree86/os-support/sco/sco_iop.c
deleted file mode 100644
index 85b4bbd41..000000000
--- a/hw/xfree86/os-support/sco/sco_iop.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c,v 1.1 2002/06/03 21:22:10 dawes Exp $ */
-/*
- * Copyright 2001 by J. Kean Johnston <jkj@caldera.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XConsortium$ */
-
-
-#include "X.h"
-
-#include "compiler.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-#include "xf86_OSlib.h"
-
-
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-/*
- * There is a right way and a wrong way of doing this. Unfortunately, we
- * are forced to do it the wrong way. The right way is to be told the range
- * or ranges of I/O ports the driver(s) need access to, in order to use the
- * CONS_IOPERM ioctl() to grant access only to those ports we care about.
- * This way we can guarantee some small level of stability because a driver
- * does not have access to all ports (which would mean it could play with
- * the PIT and thus affect scheduling times, or a whole slew of other
- * nasty things). However, because XFree86 currently only enables or disables
- * ALL port access, we need to run at IOPL 3, which basically means the
- * X Server runs at the same level as the kernel. You can image why this is
- * unsafe. Oh, and this is not a problem unique to OSR5, other OSes are
- * affected by this as well.
- *
- * So, for the time being, we change our IOPL until such time as the XFree86
- * architecture is changed to allow for tighter control of I/O ports. If and
- * when it is, then the CONS_ADDIOP/DELIOP ioctl() should be used to enable
- * or disable access to the desired ports.
- */
-
-extern long sysi86 (int cmd, ...);
-
-static Bool IOEnabled = FALSE;
-
-void xf86EnableIO(void)
-{
- if (IOEnabled)
- return;
-
- if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
- FatalError("Failed to set IOPL for extended I/O\n");
- IOEnabled = TRUE;
-}
-
-void xf86DisableIO(void)
-{
- if (!IOEnabled)
- return;
-
- sysi86(SI86V86, V86SC_IOPL, 0);
- IOEnabled = FALSE;
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool xf86DisableInterrupts()
-{
- if (!IOEnabled) {
- if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
- return FALSE;
- }
-
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-
- if (!IOEnabled) {
- sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
- }
-
- return(TRUE);
-}
-
-void xf86EnableInterrupts()
-{
- if (!IOEnabled) {
- if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
- return;
- }
-
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-
- if (!IOEnabled) {
- sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
- }
-}
diff --git a/hw/xfree86/os-support/sco/sco_mouse.c b/hw/xfree86/os-support/sco/sco_mouse.c
deleted file mode 100644
index 37b9eb5a8..000000000
--- a/hw/xfree86/os-support/sco/sco_mouse.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c,v 3.13 2002/11/20 23:07:50 dawes Exp $ */
-/*
- * Copyright 2001 by J. Kean Johnston <jkj@sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XConsortium$ */
-
-#include "X.h"
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "mipointer.h"
-#include <sys/event.h>
-#include <mouse.h>
-
-static int
-SupportedInterfaces (void)
-{
- /* FIXME: Is this correct? Should we just return MSE_MISC? */
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_MISC | MSE_AUTO;
-}
-
-static const char *internalNames[] = {
- "OSMouse",
- NULL
-};
-
-static const char **
-BuiltinNames (void)
-{
- return internalNames;
-}
-
-static Bool
-CheckProtocol (const char *protocol)
-{
- int i;
-
- for (i = 0; internalNames[i]; i++) {
- if (xf86NameCmp (protocol, internalNames[i]) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static const char *
-DefaultProtocol (void)
-{
- return "OSMouse";
-}
-
-static const char *
-evtErrStr (int evterr)
-{
- switch (evterr) {
- case -1: return "error in config files";
- case -2: return "no mouse devices to attach";
- case -3: return "unable to open device";
- case -4: return "unable to open event queue";
- case -999: return "unable to initialize event driver";
- default: return "unknown event driver error";
- }
-}
-
-static int
-OsMouseProc (DeviceIntPtr pPointer, int what)
-{
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- unsigned char map[9];
- dmask_t dmask;
- MessageType from = X_CONFIG;
- int evi;
-
- pInfo = pPointer->public.devicePrivate;
- pMse = pInfo->private;
- pMse->device = pPointer;
-
- switch (what) {
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- dmask = D_REL | D_BUTTON;
- if ((evi = ev_init()) < 0) {
- FatalError ("OsMouseProc: Event driver initialization failed (%s)\n",
- evtErrStr(evi));
- }
- pInfo->fd = ev_open (&dmask);
- if (pInfo->fd < 0) {
- FatalError ("OsMouseProc: DEVICE_INIT failed (%s)\n", evtErrStr(pInfo->fd));
- }
-
- pMse->buttons = xf86SetIntOption (pInfo->options, "Buttons", 0);
- if (pMse->buttons == 0) {
- pMse->buttons = 8;
- from = X_DEFAULT;
- }
- xf86Msg (from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
-
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- map[4] = 6;
- map[5] = 7;
- map[6] = 8;
- map[7] = 4;
- map[8] = 5; /* Compatibile with SCO X server */
-
- InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
- miPointerGetMotionEvents, pMse->Ctrl,
- miPointerGetMotionBufferSize());
-
- /* X valuator */
- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 0);
-
- /* Y valuator */
- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 1);
-
- xf86MotionHistoryAllocate(pInfo);
-
- ev_flush();
- ev_suspend();
- break;
-
- case DEVICE_ON:
- pMse->lastButtons = 0;
- pMse->emulateState = 0;
- pPointer->public.on = TRUE;
- ev_resume();
- AddEnabledDevice (pInfo->fd);
- break;
-
- case DEVICE_OFF:
- case DEVICE_CLOSE:
- pPointer->public.on = TRUE;
- RemoveEnabledDevice (pInfo->fd);
- if (what == DEVICE_CLOSE) {
- ev_close();
- pInfo->fd = -1;
- } else {
- ev_suspend();
- }
- break;
- }
-
- return Success;
-}
-
-static void
-OsMouseReadInput (InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- EVENT *evp;
-
- pMse = pInfo->private;
-
- while ((evp = ev_read()) != (EVENT *)0) {
- int buttons = EV_BUTTONS(*evp);
- int dx = EV_DX(*evp), dy = -(EV_DY(*evp)), dz = 0, dw = 0;
-
- if (EV_TAG(*evp) & T_WHEEL) {
- dz = (dy & 0x08) ? (dy & 0x0f) - 16 : (dy & 0x0f);
- dx = dy = 0;
- pMse->PostEvent (pInfo, buttons, dx, dy, dz, dw);
- /* Simulate button release */
- dz = 0;
- buttons &= ~(WHEEL_FWD | WHEEL_BACK);
- }
-
- pMse->PostEvent (pInfo, buttons, dx, dy, dz, dw);
- ev_pop();
- }
-}
-
-static Bool
-OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- MouseDevPtr pMse;
-
- /* This is called when the protocol is "OSMouse". */
-
- pMse = pInfo->private;
- pMse->protocol = protocol;
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
- /* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, NULL, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- /* Check if the device can be opened. */
- pInfo->fd = ev_init();
- if (pInfo->fd != -1) {
- dmask_t dmask = (D_REL | D_BUTTON);
- pInfo->fd = ev_open(&dmask);
- } else {
- pInfo->fd = -999;
- }
-
- if (pInfo->fd < 0) {
- if (xf86GetAllowMouseOpenFail())
- xf86Msg(X_WARNING, "%s: cannot open event manager (%s)\n",
- pInfo->name, evtErrStr(pInfo->fd));
- else {
- xf86Msg(X_ERROR, "%s: cannot open event manager (%s)\n",
- pInfo->name, evtErrStr(pInfo->fd));
- xfree(pMse);
- return FALSE;
- }
- }
- ev_close();
- pInfo->fd = -1;
-
- /* Process common mouse options (like Emulate3Buttons, etc). */
- pMse->CommonOptions(pInfo);
-
- /* Setup the local procs. */
- pInfo->device_control = OsMouseProc;
- pInfo->read_input = OsMouseReadInput;
-
- pInfo->flags |= XI86_CONFIGURED;
- return TRUE;
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit (int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
-
- p->SupportedInterfaces = SupportedInterfaces;
- p->BuiltinNames = BuiltinNames;
- p->DefaultProtocol = DefaultProtocol;
- p->CheckProtocol = CheckProtocol;
- p->PreInit = OsMousePreInit;
-
- return p;
-}
diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c
deleted file mode 100644
index 3c00f5564..000000000
--- a/hw/xfree86/os-support/sco/sco_video.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c,v 3.9 2003/03/14 13:46:07 tsi Exp $ */
-/*
- * Copyright 2001 by J. Kean Johnston <jkj@sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XConsortium$ */
-
-/* Re-written May 2001 to represent the current state of reality */
-
-/*
- * This file contains the completely re-written SCO OpenServer video
- * routines for XFree86 4.x. Much of this is based on the SCO X server
- * code (which is an X11R5 server) and will probably only work on
- * OpenServer versions 5.0.5, 5.0.6 and later. Please send me (jkj@sco.com)
- * email if you have any questions.
- *
- * Ideally, you should use OSR5.0.6A or later, with the updated console
- * driver for 5.0.6A (its the default driver in 5.0.7 and later).
- * However, if you are running on an older system, this code will detect
- * that and adjust accordingly.
- */
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-#include "xf86_OSlib.h"
-
-#include <sys/ci/ciioctl.h>
-#define MPXNAME "/dev/atp1"
-#define BASECPU 1
-
-Bool mpxLock = TRUE;
-
-#define USE_VASMETHOD 1
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static int sco_mcdone = 0, sco_ismc = 0;
-
-/***************************************************************************/
-/*
- * To map the video memory, we first need to see if we are on a multi-console
- * system. If we are, we need to try to use an existing video class in the
- * kernel. We do this by retrieving the list of currently defined classes
- * (via the new CONS_GETCLASS ioctl()) to see if we have a class that will
- * match the range of memory we desire. If we can't find one, we have an
- * error and we abort.
- *
- * If we are not using a multi-console, we can simply use mmap() to map in
- * the frame buffer, using the classs-access method as a fall-back only if
- * the mmap() fails (it shouldn't). We always set the appropriate pointers
- * in the config structure to point ot the right function to map and unmap
- * the video memory. An alternative to using mmap() is to use the new
- * CONS_ADDVAS call, which will use vasmalloc() and vasbind() in the kernel
- * to map the physical address to a virtual one, which it then returns.
- * I am not 100% sure if this is faster or not, but it may prove easier to
- * debug things. Just to be on the safe side, I have included both methods
- * here, and the mmap() method can be used by setting USE_VASMETHOD to 0
- * above.
- */
-
-#if !defined(CONS_ADDVAS)
-# undef USE_VASMETHOD
-# define USE_VASMETHOD 0
-#endif
-
-static int
-scoIsMultiConsole (void)
-{
- int x;
-
- if (sco_mcdone)
- return sco_ismc;
- x = access ("/usr/lib/vidconf/.multiconsole", F_OK);
- if (x == 0)
- sco_ismc = 1;
- sco_mcdone = 1;
- return sco_ismc;
-}
-
-/*
- * This maps memory using mmap()
- */
-static pointer
-mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- int fd;
- unsigned long realBase, alignOff;
- pointer base;
-
- fd = open (DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (fd < 0) {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM,
- strerror(errno));
- return 0; /* NOTREACHED */
- }
-
- realBase = Base & ~(getpagesize() - 1);
- alignOff = Base - realBase;
-
-#ifdef DEBUG
- ErrorF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
-#endif
-
- base = mmap((caddr_t)0, Size + alignOff,
- (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, (off_t)realBase);
- close(fd);
- if (base == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer (0x%08x,0x%x) (%s)\n",
- Base, Size, strerror(errno));
- return 0; /* NOTREACHED */
- }
-
-#ifdef DEBUG
- ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
-#endif
- return (pointer)((char *)base + alignOff);
-}
-
-#if (USE_VASMETHOD)
-/*
- * This maps memory using the virtual address space (VAS) console calls.
- */
-static pointer
-mapVidMemVAS(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- struct vidvasmem vas;
- pointer base;
-
- vas.base = (long)Base;
- vas.size = (long)Size;
-
- base = (pointer)ioctl (xf86Info.consoleFd, CONS_ADDVAS, &vas);
- if (base == (pointer)-1) {
- return mapVidMemMMAP(ScreenNum, Base, Size, flags);
- }
- return base;
-}
-#endif /* USE_VASMETHOD */
-
-struct vidclass vidclasslist[] = {
- { "VBE", "", 0xf0000000, 0x2000000, 0 },
- { "P9000", "", 0xc0000000, 0x400000, 0 },
- { "TULIP", "", 0x80000000, 0x400000, 0 },
- { "VIPER", "", 0xa0000000, 0x400000, 0 },
- { "S3T", "", 0xa0000000, 0x200000, 0 },
- { "S3DT", "", 0x4000000, 0x400000, 0 },
- { "MGA", "", 0x2200000, 0x4000, 0 },
- { "CLVGA", "", 0xa0000, 0x20000, 0 },
- { "OLIVE", "", 0xd8000000, 0x400000, 0 },
- { "S3C", "", 0xa0000, 0x10000, 0 },
- { "MGAVLB", "", 0xac000, 0x34000, 0 },
- { "ATI8514", "", 0xFF000, 0x1000, 0 },
- { "GXREGS", "", 0xb0000, 0x10000, 0 },
- { "GX", "", 0xa0000, 0x10000, 0 },
- { "CT64300", "", 0xa0000000, 0x400000, 0 },
- { "SVGA", "", 0xa0000, 0x20000, 0 },
- { "S3V", "", 0xa0000000, 0x400000, 0 },
- { "8514A", "", 0xFF000, 0x1000, 0 },
- { "VGA", "", 0xa0000, 0x10000, 0 },
- { 0 }
-};
-
-static pointer
-mapVidMemVC(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- struct vidclass *vcp;
- char *class = NULL;
- pointer base;
-
- for (vcp = vidclasslist; vcp->name; vcp++) {
- if ((vcp->base == Base) && (vcp->size == Size)) {
- class = vcp->name;
- break;
- }
- }
-
- if (class == NULL) {
- /*
- * As a fall-back, we will try and use the mmap() approach. This may
- * prove to be the wrong thing to do, but time and testing will tell.
- */
- ErrorF("xf86MapVidMem: No class map defined for (0x%08x,0x%08x)\n", Base, Size);
-#if USE_VASMETHOD
- return mapVidMemVAS(ScreenNum, Base, Size, flags);
-#else /* !USE_VASMETHOD */
- return mapVidMemMMAP(ScreenNum, Base, Size, flags);
-#endif
- }
-
- /*
- * We found a suitable class. Try and use it.
- */
- base = (pointer)ioctl(xf86Info.consoleFd, MAP_CLASS, class);
- if ((int)base == -1) {
- FatalError("xf86MapVidMem: Failed to map video memory class `%s'\n", class);
- return 0; /* NOTREACHED */
- }
-
- return base;
-}
-
-/*
- * Unmapping the video memory is easy. We always call munmap(), as it is
- * safe to do so even if we haven't actually mapped in any pages via mmap().
- * In the case where we used the video class, we don't need to do anything
- * as the kernel will clean up the TSS when we exit, and will undo the
- * vasbind() that was done when the class was originally mapped. If we used
- * vasmap, we simply undo the map. Again, it is benign to call vasunmap
- * even if we got the frame buffer via some other mechanism (like mmap).
- */
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-#if USE_VASMETHOD
- struct vidvasmem vas;
- int x;
-
- vas.base = (long)Base;
- vas.size = (long)Size;
-
- x = ioctl (xf86Info.consoleFd, CONS_DELVAS, &vas);
- if (x == 0)
- return;
-#endif /* USE_VASMETHOD */
-
- munmap(Base, Size);
-}
-
-/*
- * Set things up to point to our local functions. When the kernel gets
- * MTRR support, we will need to add the required functions for that
- * here too. MTRR support will most likely appear in 5.0.8 or 5.1.0.
- *
- * We also want to lock the X server process to the base CPU in an MPX
- * system, since we will be going to IOPL 3. Most engine drivers can cope
- * with I/O access on any CPU but there are a few (AST Manhattan I believe)
- * that can't, so the server needs to be locked to CPU0.
- */
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- int mpx_fd;
-
- if (scoIsMultiConsole ()) {
- pVidMem->mapMem = mapVidMemVC;
- } else {
-#if USE_VASMETHOD
- pVidMem->mapMem = mapVidMemVAS;
-#else
- pVidMem->mapMem = mapVidMemMMAP;
-#endif
- }
-
- pVidMem->unmapMem = unmapVidMem;
- pVidMem->linearSupported = TRUE;
- pVidMem->initialised = TRUE;
-
- if (mpxLock && (mpx_fd = open (MPXNAME, O_RDONLY)) > 0) {
- if (ioctl (mpx_fd, ACPU_XLOCK, BASECPU) < 0)
- ErrorF ("xf86OSInitVidMem: Can not bind to CPU 0 (%s)\n",
- strerror(errno));
- close (mpx_fd);
- }
-}
-
diff --git a/hw/xfree86/os-support/shared/VTsw_noop.c b/hw/xfree86/os-support/shared/VTsw_noop.c
deleted file mode 100644
index 265a45f91..000000000
--- a/hw/xfree86/os-support/shared/VTsw_noop.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_noop.c,v 3.2 1998/07/25 16:56:59 dawes Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: VTsw_noop.c /main/3 1996/02/21 17:53:25 kaleb $ */
-
-#include "X.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * No-op functions for OSs without VTs
- */
-
-Bool
-xf86VTSwitchPending()
-{
- return(FALSE);
-}
-
-Bool
-xf86VTSwitchAway()
-{
- return(FALSE);
-}
-
-Bool
-xf86VTSwitchTo()
-{
- return(TRUE);
-}
diff --git a/hw/xfree86/os-support/shared/VTsw_usl.c b/hw/xfree86/os-support/shared/VTsw_usl.c
deleted file mode 100644
index 81aac54de..000000000
--- a/hw/xfree86/os-support/shared/VTsw_usl.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c,v 3.4 2002/09/16 18:06:14 eich Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: VTsw_usl.c /main/3 1996/02/21 17:53:28 kaleb $ */
-
-#include "X.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/*
- * Handle the VT-switching interface for OSs that use USL-style ioctl()s
- * (the sysv, sco, and linux subdirs).
- */
-
-/*
- * This function is the signal handler for the VT-switching signal. It
- * is only referenced inside the OS-support layer.
- */
-void
-xf86VTRequest(int sig)
-{
- signal(sig, (void(*)(int))xf86VTRequest);
- xf86Info.vtRequestsPending = TRUE;
- return;
-}
-
-Bool
-xf86VTSwitchPending()
-{
- return(xf86Info.vtRequestsPending ? TRUE : FALSE);
-}
-
-Bool
-xf86VTSwitchAway()
-{
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
- {
- return(FALSE);
- }
- else
- {
- return(TRUE);
- }
-}
-
-Bool
-xf86VTSwitchTo()
-{
- xf86Info.vtRequestsPending = FALSE;
- if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
- {
- return(FALSE);
- }
- else
- {
- return(TRUE);
- }
-}
diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c
deleted file mode 100644
index 5da36fa19..000000000
--- a/hw/xfree86/os-support/shared/agp_noop.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.5 2003/08/24 17:37:05 dawes Exp $ */
-/*
- * Copyright (c) 2000-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Abstraction of the AGP GART interface. Stubs for platforms without
- * AGP GART support.
- */
-
-#ifdef __UNIXOS2__
-# define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-Bool
-xf86GARTCloseScreen(int screenNum)
-{
- return FALSE;
-}
-
-Bool
-xf86AgpGARTSupported()
-{
- return FALSE;
-}
-
-AgpInfoPtr
-xf86GetAGPInfo(int screenNum)
-{
- return NULL;
-}
-
-Bool
-xf86AcquireGART(int screenNum)
-{
- return FALSE;
-}
-
-Bool
-xf86ReleaseGART(int screenNum)
-{
- return FALSE;
-}
-
-int
-xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
- unsigned long *physical)
-{
- return -1;
-}
-
-
-Bool
-xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
-{
- return FALSE;
-}
-
-
-Bool
-xf86UnbindGARTMemory(int screenNum, int key)
-{
- return FALSE;
-}
-
-Bool
-xf86EnableAGP(int screenNum, CARD32 mode)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/shared/at_scancode.c b/hw/xfree86/os-support/shared/at_scancode.c
deleted file mode 100644
index 821e116ab..000000000
--- a/hw/xfree86/os-support/shared/at_scancode.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.4 2003/08/24 17:37:05 dawes Exp $ */
-/*
- * Copyright (c) 2002-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSKbd.h"
-#include "atKeynames.h"
-
-Bool
-ATScancode(InputInfoPtr pInfo, int *scanCode)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-
- switch (pKbd->scanPrefix) {
- case 0:
- switch (*scanCode) {
- case KEY_Prefix0:
- case KEY_Prefix1:
- pKbd->scanPrefix = *scanCode; /* special prefixes */
- return TRUE;
- case 0x59: *scanCode = KEY_0x59; break;
- case 0x5a: *scanCode = KEY_0x5A; break;
- case 0x5b: *scanCode = KEY_0x5B; break;
- case 0x5c: *scanCode = KEY_KP_Equal; break; /* Keypad Equal */
- case 0x5d: *scanCode = KEY_0x5D; break;
- case 0x5e: *scanCode = KEY_0x5E; break;
- case 0x5f: *scanCode = KEY_0x5F; break;
- case 0x62: *scanCode = KEY_0x62; break;
- case 0x63: *scanCode = KEY_0x63; break;
- case 0x64: *scanCode = KEY_0x64; break;
- case 0x65: *scanCode = KEY_0x65; break;
- case 0x66: *scanCode = KEY_0x66; break;
- case 0x67: *scanCode = KEY_0x67; break;
- case 0x68: *scanCode = KEY_0x68; break;
- case 0x69: *scanCode = KEY_0x69; break;
- case 0x6a: *scanCode = KEY_0x6A; break;
- case 0x6b: *scanCode = KEY_0x6B; break;
- case 0x6c: *scanCode = KEY_0x6C; break;
- case 0x6d: *scanCode = KEY_0x6D; break;
- case 0x6e: *scanCode = KEY_0x6E; break;
- case 0x6f: *scanCode = KEY_0x6F; break;
- case 0x70: *scanCode = KEY_0x70; break;
- case 0x71: *scanCode = KEY_0x71; break;
- case 0x72: *scanCode = KEY_0x72; break;
- case 0x73: *scanCode = KEY_0x73; break;
- case 0x74: *scanCode = KEY_0x74; break;
- case 0x75: *scanCode = KEY_0x75; break;
- case 0x76: *scanCode = KEY_0x76; break;
- }
- break;
- case KEY_Prefix0:
- pKbd->scanPrefix = 0;
- switch (*scanCode) {
- case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
- case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
- case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
- case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
- case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
- case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
- case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
- case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
- case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
- case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
- case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
- case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
- case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
- case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
- case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
- case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
- case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
- case 0x5b: *scanCode = KEY_LMeta; break;
- case 0x5c: *scanCode = KEY_RMeta; break;
- case 0x5d: *scanCode = KEY_Menu; break;
- case KEY_F3: *scanCode = KEY_F13; break;
- case KEY_F4: *scanCode = KEY_F14; break;
- case KEY_F5: *scanCode = KEY_F15; break;
- case KEY_F6: *scanCode = KEY_F16; break;
- case KEY_F7: *scanCode = KEY_F17; break;
- case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
- case 0x2A:
- case 0x36:
- return TRUE;
- default:
- xf86MsgVerb(X_INFO, 4, "Unreported Prefix0 scancode: 0x%02x\n",
- *scanCode);
- *scanCode += 0x78;
- }
- break;
- case KEY_Prefix1:
- pKbd->scanPrefix = (*scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
- return TRUE;
- case KEY_LCtrl:
- pKbd->scanPrefix = 0;
- if (*scanCode != KEY_NumLock)
- return TRUE;
- *scanCode = KEY_Pause; /* pause */
- }
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/shared/bios_devmem.c b/hw/xfree86/os-support/shared/bios_devmem.c
deleted file mode 100644
index 5c24b9751..000000000
--- a/hw/xfree86/os-support/shared/bios_devmem.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_devmem.c,v 3.7 2000/09/19 12:46:22 eich Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bios_devmem.c /main/5 1996/10/19 18:07:41 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include <string.h>
-
-/*
- * Read BIOS via /dev/mem.
- */
-
-#ifndef DEV_MEM
-# define DEV_MEM "/dev/mem"
-#endif
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- int fd;
-
-#ifdef __ia64__
- if ((fd = open(DEV_MEM, O_RDONLY | O_SYNC)) < 0)
-#else
- if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
-#endif
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- return(-1);
- }
-
- if (lseek(fd, (Base+Offset), SEEK_SET) < 0)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: %s seek failed (%s)\n",
- DEV_MEM, strerror(errno));
- close(fd);
- return(-1);
- }
- if (read(fd, Buf, Len) != Len)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: %s read failed (%s)\n",
- DEV_MEM, strerror(errno));
- close(fd);
- return(-1);
- }
- close(fd);
- return(Len);
-}
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
deleted file mode 100644
index ee7584222..000000000
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.9 2001/05/23 14:46:05 alanh Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: bios_V4mmap.c /main/4 1996/02/21 17:54:27 kaleb $ */
-
-#include "X.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-#ifndef __alpha__
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- int fd;
- unsigned char *ptr;
- int psize;
- int mlen;
-
- if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- return(-1);
- }
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, fd, (off_t)Base);
- if (ptr == MAP_FAILED)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed (%s)\n",
- DEV_MEM, strerror(errno));
- close(fd);
- return(-1);
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
- (void)close(fd);
- return(Len);
-}
-
-#else /* __alpha__ */
-
- /*
- * We trick "mmap" into mapping BUS memory for us via BUS_BASE,
- * which is the KSEG address of the start of the DENSE memory
- * area.
- */
-
- /*
- * NOTE: there prolly ought to be more validity checks and all
- * re: boundaries and sizes and such...
- */
-
-/*
- * The Jensen lacks dense memory, thus we have to address the bus via
- * the sparse addressing scheme.
- *
- * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
- */
-
-#ifdef linux
-
-#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
-#define SPARSE (5)
-#define isJensen (1)
-#else
-#define isJensen (!_bus_base())
-#define SPARSE (7)
-#endif
-
-extern unsigned long _bus_base(void);
-extern unsigned long _bus_base_sparse(void);
-#define BUS_BASE (isJensen ? _bus_base_sparse() : _bus_base())
-#define JENSEN_SHIFT(x) (isJensen ? ((long)x<<SPARSE) : (long)x)
-
-#else
-
-extern u_int64_t dense_base(void);
-#define BUS_BASE dense_base()
-#define JENSEN_SHIFT(x) ((long) x)
-
-#endif
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- caddr_t base;
- int fd;
- int psize;
- int mlen;
-
- if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- return(-1);
- }
-
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- base = mmap((caddr_t)0, JENSEN_SHIFT(mlen), PROT_READ,
- MAP_SHARED, fd, (off_t)(JENSEN_SHIFT(Base) + BUS_BASE));
-
- if (base == MAP_FAILED)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- return(-1);
- }
-
- xf86SlowBCopyFromBus((unsigned char *)(base+JENSEN_SHIFT(Offset)),
- Buf, Len);
-
- munmap((caddr_t)JENSEN_SHIFT(base), JENSEN_SHIFT(mlen));
- close(fd);
- return(Len);
-}
-
-#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/shared/inout.S b/hw/xfree86/os-support/shared/inout.S
deleted file mode 100644
index 80c47c419..000000000
--- a/hw/xfree86/os-support/shared/inout.S
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $XConsortium: inout.s /main/6 1996/02/21 17:53:35 kaleb $ */
-
-
-
-
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
-
-#include "assyntax.h"
-
-/*
- * Make i80386 io primitives available at C-level.
- */
-
- FILE("inout.s")
- AS_BEGIN
- SEG_TEXT
-
-/*
- *-----------------------------------------------------------------------
- * inb ---
- * Input one byte.
- *
- * Results:
- * Byte in al.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(inb)
-GLNAME(inb):
- MOV_L (REGOFF(4,ESP),EDX)
- SUB_L (EAX,EAX)
- IN_B
- RET
-
-/*
- *-----------------------------------------------------------------------
- * outb ---
- * Output one byte.
- *
- * Results:
- * None.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(outb)
-GLNAME(outb):
- MOV_L (REGOFF(4,sp),EDX)
- MOV_L (REGOFF(8,sp),EAX)
- OUT_B
- RET
-/*
- *-----------------------------------------------------------------------
- * inw ---
- * Input one 16-bit word.
- *
- * Results:
- * Word in ax.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(inw)
-GLNAME(inw):
- MOV_L (REGOFF(4,ESP),EDX)
- IN_W
- RET
-
-/*
- *-----------------------------------------------------------------------
- * outw ---
- * Output one 16-bit word.
- *
- * Results:
- * None.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(outw)
-GLNAME(outw):
- MOV_L (REGOFF(4,ESP),EDX)
- MOV_L (REGOFF(8,ESP),EAX)
- OUT_W
- RET
-
-/*
- *-----------------------------------------------------------------------
- * inl ---
- * Input one 32-bit longword.
- *
- * Results:
- * Word in eax.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(inl)
-GLNAME(inl):
- MOV_L (REGOFF(4,ESP),EDX)
- IN_L
- RET
-
-/*
- *-----------------------------------------------------------------------
- * outl ---
- * Output one 32-bit longword.
- *
- * Results:
- * None.
- *-----------------------------------------------------------------------
- */
- GLOBL GLNAME(outl)
-GLNAME(outl):
- MOV_L (REGOFF(4,ESP),EDX)
- MOV_L (REGOFF(8,ESP),EAX)
- OUT_L
- RET
-
diff --git a/hw/xfree86/os-support/shared/ioperm_noop.c b/hw/xfree86/os-support/shared/ioperm_noop.c
deleted file mode 100644
index c24f4f1b2..000000000
--- a/hw/xfree86/os-support/shared/ioperm_noop.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/ioperm_noop.c,v 3.4 2001/07/23 13:15:48 dawes Exp $ */
-/*
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: ioperm_noop.c /main/3 1996/02/21 17:53:39 kaleb $ */
-
-/*
- * Some platforms don't bother with I/O permissions,
- * or the permissions are implicit with opening/enabling the console.
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-void
-xf86EnableIO()
-{
- return;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
diff --git a/hw/xfree86/os-support/shared/kbd.c b/hw/xfree86/os-support/shared/kbd.c
deleted file mode 100644
index 213e8bd62..000000000
--- a/hw/xfree86/os-support/shared/kbd.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.3 2003/08/24 17:37:05 dawes Exp $ */
-/*
- * Copyright (c) 2001-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "xf86OSKbd.h"
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/shared/kmod_noop.c b/hw/xfree86/os-support/shared/kmod_noop.c
deleted file mode 100644
index ae6852ed9..000000000
--- a/hw/xfree86/os-support/shared/kmod_noop.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kmod_noop.c,v 1.2 2003/08/24 17:37:05 dawes Exp $ */
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "xf86_OSproc.h"
-
-int xf86LoadKernelModule(const char *pathname)
-{
- (void) pathname;
- return 0; /* failure */
-}
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
deleted file mode 100644
index b6aa8fb29..000000000
--- a/hw/xfree86/os-support/shared/libc_wrapper.c
+++ /dev/null
@@ -1,2030 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.102 2003/11/19 03:52:58 dawes Exp $ */
-/*
- * Copyright 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Orest Zborowski and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Orest Zborowski
- * and David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID WEXELBLAT BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#if defined(linux) && !defined(__GLIBC__)
-#undef __STRICT_ANSI__
-#endif
-#include <X.h>
-#ifdef __UNIXOS2__
-#define I_NEED_OS2_H
-#endif
-#include <Xmd.h>
-#include <Xos.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined(__bsdi__)
-#undef _POSIX_SOURCE
-#undef _ANSI_SOURCE
-#endif
-#include <sys/time.h>
-#include <math.h>
-#ifdef sun
-#include <ieeefp.h>
-#endif
-#include <stdarg.h>
-#include <fcntl.h>
-#include "Xfuncproto.h"
-#include "os.h"
-#include <ctype.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#ifdef __UNIXOS2__
-#define NO_MMAP
-#include <sys/param.h>
-#endif
-#ifdef HAS_SVR3_MMAPDRV
-#define NO_MMAP
-#ifdef SELF_CONTAINED_WRAPPER
-#include <sys/at_ansi.h>
-#include <sys/kd.h>
-#include <sys/sysmacros.h>
-#if !defined(_NEED_SYSI86)
-# include <sys/immu.h>
-# include <sys/region.h>
-#endif
-#include <sys/mmap.h>
-struct kd_memloc MapDSC;
-int mmapFd = -2;
-#else
-extern struct kd_memloc MapDSC;
-extern int mmapFd;
-#endif
-#endif
-#ifndef NO_MMAP
-#include <sys/mman.h>
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-#endif
-#if !defined(ISC)
-#include <stdlib.h>
-#endif
-
-#define NEED_XF86_TYPES
-#define NEED_XF86_PROTOTYPES
-#define DONT_DEFINE_WRAPPERS
-#include "xf86_ansic.h"
-
-#ifndef SELF_CONTAINED_WRAPPER
-#include "xf86.h"
-#include "xf86Priv.h"
-#define NO_OSLIB_PROTOTYPES
-#define XF86_OS_PRIVS
-#define HAVE_WRAPPER_DECLS
-#include "xf86_OSlib.h"
-#else
-void xf86WrapperInit(void);
-#endif
-
-
-#ifndef X_NOT_POSIX
-#include <dirent.h>
-#else
-#ifdef SYSV
-#include <dirent.h>
-#else
-#ifdef USG
-#include <dirent.h>
-#else
-#include <sys/dir.h>
-#ifndef dirent
-#define dirent direct
-#endif
-#endif
-#endif
-#endif
-typedef struct dirent DIRENTRY;
-
-#ifdef __UNIXOS2__
-#define _POSIX_SOURCE
-#endif
-#ifdef ISC202
-#include <sys/types.h>
-#define WIFEXITED(a) ((a & 0x00ff) == 0) /* LSB will be 0 */
-#define WEXITSTATUS(a) ((a & 0xff00) >> 8)
-#define WIFSIGNALED(a) ((a & 0xff00) == 0) /* MSB will be 0 */
-#define WTERMSIG(a) (a & 0x00ff)
-#else
-#if defined(ISC) && !defined(_POSIX_SOURCE)
-#define _POSIX_SOURCE
-#include <sys/types.h>
-#include <sys/wait.h>
-#undef _POSIX_SOURCE
-#else
-#if (defined(ISC) && defined(_POSIX_SOURCE)) || defined(Lynx) || (defined (__alpha__) && defined(linux))
-#include <sys/types.h>
-#endif
-#include <sys/wait.h>
-#endif
-#endif
-#ifdef Lynx
-#if !defined(S_IFIFO) && defined(S_IFFIFO)
-#define S_IFIFO S_IFFIFO
-#endif
-#endif
-
-/* For xf86getpagesize() */
-#if defined(linux)
-#define HAS_SC_PAGESIZE
-#define HAS_GETPAGESIZE
-#elif defined(CSRG_BASED)
-#define HAS_GETPAGESIZE
-#elif defined(DGUX)
-#define HAS_GETPAGESIZE
-#elif defined(sun) && !defined(SVR4)
-#define HAS_GETPAGESIZE
-#endif
-#ifdef XNO_SYSCONF
-#undef _SC_PAGESIZE
-#endif
-#ifdef HAVE_SYSV_IPC
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#endif
-#include <setjmp.h>
-
-#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
- (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
- ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
-#define HAS_GLIBC_SIGSETJMP 1
-#endif
-
-#if 0
-#define SETBUF_RETURNS_INT
-#endif
-
-double xf86HUGE_VAL;
-
-#ifndef SELF_CONTAINED_WRAPPERS
-extern void xf86DisableIO(void);
-#endif
-
-/*
- * This file contains the XFree86 wrappers for libc functions that can be
- * called by loadable modules
- */
-
-double
-xf86hypot(double x, double y)
-{
- return(hypot(x,y));
-}
-
-void
-xf86qsort(void *base, xf86size_t nmemb, xf86size_t size,
- int (*comp)(const void *, const void *))
-{
- qsort(base, nmemb, size, comp);
-}
-
-/* string functions */
-
-char*
-xf86strcat(char* dest, const char* src)
-{
- return(strcat(dest,src));
-}
-
-char*
-xf86strchr(const char* s, int c)
-{
- return strchr(s,c);
-}
-
-int
-xf86strcmp(const char* s1, const char* s2)
-{
- return strcmp(s1,s2);
-}
-
-/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
-int
-xf86strcasecmp(const char* s1, const char* s2)
-{
- const unsigned char *us1 = (const unsigned char *)s1;
- const unsigned char *us2 = (const unsigned char *)s2;
-
- while (tolower(*us1) == tolower(*us2++))
- if (*us1++ == '\0')
- return 0;
-
- return tolower(*us1) - tolower(*--us2);
-}
-
-char*
-xf86strcpy(char* dest, const char* src)
-{
- return strcpy(dest,src);
-}
-
-xf86size_t
-xf86strcspn(const char* s1, const char* s2)
-{
- return (xf86size_t)strcspn(s1,s2);
-}
-
-xf86size_t
-xf86strlen(const char* s)
-{
- return (xf86size_t)strlen(s);
-}
-
-xf86size_t
-xf86strlcat(char *dest, const char *src, xf86size_t size)
-{
- return(strlcat(dest, src, size));
-}
-
-xf86size_t
-xf86strlcpy(char *dest, const char *src, xf86size_t size)
-{
- return strlcpy(dest, src, size);
-}
-
-char*
-xf86strncat(char* dest, const char* src, xf86size_t n)
-{
- return strncat(dest,src,(size_t)n);
-}
-
-int
-xf86strncmp(const char* s1, const char* s2, xf86size_t n)
-{
- return strncmp(s1,s2,(size_t)n);
-}
-
-/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
-int
-xf86strncasecmp(const char* s1, const char* s2, xf86size_t n)
-{
- if (n != 0) {
- const unsigned char *us1 = (const unsigned char *)s1;
- const unsigned char *us2 = (const unsigned char *)s2;
-
- do {
- if (tolower(*us1) != tolower(*us2++))
- return tolower(*us1) - tolower(*--us2);
- if (*us1++ == '\0')
- break;
- } while (--n != 0);
- }
- return 0;
-}
-
-char*
-xf86strncpy(char* dest, const char* src, xf86size_t n)
-{
- return strncpy(dest,src,(size_t)n);
-}
-
-char*
-xf86strpbrk(const char* s1, const char* s2)
-{
- return strpbrk(s1,s2);
-}
-
-char*
-xf86strrchr(const char* s, int c)
-{
- return strrchr(s,c);
-}
-
-xf86size_t
-xf86strspn(const char* s1, const char* s2)
-{
- return strspn(s1,s2);
-}
-
-char*
-xf86strstr(const char* s1, const char* s2)
-{
- return strstr(s1,s2);
-}
-
-char*
-xf86strtok(char* s1, const char* s2)
-{
- return strtok(s1,s2);
-}
-
-char*
-xf86strdup(const char* s)
-{
- return xstrdup(s);
-}
-
-int
-xf86sprintf(char *s, const char *format, ...)
-{
- int ret;
- va_list args;
- va_start(args, format);
- ret = vsprintf(s, format, args);
- va_end(args);
- return ret;
-}
-
-int
-xf86snprintf(char *s, xf86size_t len, const char *format, ...)
-{
- int ret;
- va_list args;
- va_start(args, format);
- ret = vsnprintf(s, (size_t)len, format, args);
- va_end(args);
- return ret;
-}
-
-void
-xf86bzero(void* s, unsigned int n)
-{
- memset(s, 0, n);
-}
-
-#ifdef HAVE_VSSCANF
-int
-xf86sscanf(char *s, const char *format, ...)
-#else
-int
-xf86sscanf(char *s, const char *format, char *a0, char *a1, char *a2,
- char *a3, char *a4, char *a5, char *a6, char *a7, char *a8,
- char *a9) /* limit of ten args */
-#endif
-{
-#ifdef HAVE_VSSCANF
- int ret;
- va_list args;
- va_start(args, format);
-
- ret = vsscanf(s,format,args);
- va_end(args);
- return ret;
-#else
- return sscanf(s, format, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
-#endif
-}
-
-/* Basic I/O */
-
-int xf86errno;
-
-/* XXX This is not complete */
-
-static int
-xfToOsOpenFlags(int xfflags)
-{
- int flags = 0;
-
- /* XXX This assumes O_RDONLY is 0 */
- if (xfflags & XF86_O_WRONLY)
- flags |= O_WRONLY;
- if (xfflags & XF86_O_RDWR)
- flags |= O_RDWR;
- if (xfflags & XF86_O_CREAT)
- flags |= O_CREAT;
-
- return flags;
-}
-
-int
-xf86open(const char *path, int flags, ...)
-{
- int fd;
- va_list ap;
-
- va_start(ap, flags);
- flags = xfToOsOpenFlags(flags);
- if (flags & O_CREAT) {
- /* can't request a mode_t directly on systems where mode_t
- is an unsigned short */
- mode_t mode = (mode_t)va_arg(ap, unsigned int);
- fd = open(path, flags, mode);
- } else {
- fd = open(path, flags);
- }
- va_end(ap);
- xf86errno = xf86GetErrno();
- return fd;
-}
-
-int
-xf86close(int fd)
-{
- int status = close(fd);
-
- xf86errno = xf86GetErrno();
- return status;
-}
-
-long
-xf86lseek(int fd, long offset, int whence)
-{
- switch (whence) {
- case XF86_SEEK_SET:
- whence = SEEK_SET;
- break;
- case XF86_SEEK_CUR:
- whence = SEEK_CUR;
- break;
- case XF86_SEEK_END:
- whence = SEEK_END;
- break;
- }
- return (long)lseek(fd, (off_t)offset, whence);
-}
-
-int
-xf86ioctl(int fd, unsigned long request, pointer argp)
-{
- int status = ioctl(fd, request, argp);
-
- xf86errno = xf86GetErrno();
- return status;
-}
-
-xf86ssize_t
-xf86read(int fd, void *buf, xf86size_t nbytes)
-{
- xf86ssize_t n = read(fd, buf, (size_t)nbytes);
-
- xf86errno = xf86GetErrno();
- return n;
-}
-
-xf86ssize_t
-xf86write(int fd, const void *buf, xf86size_t nbytes)
-{
- xf86ssize_t n = write(fd, buf, (size_t)nbytes);
-
- xf86errno = xf86GetErrno();
- return n;
-}
-
-void*
-xf86mmap(void *start, xf86size_t length, int prot,
- int flags, int fd, xf86size_t /* off_t */ offset)
-{
-#ifndef NO_MMAP
- int p=0, f=0;
- void *rc;
-
- if (flags & XF86_MAP_FIXED) f |= MAP_FIXED;
- if (flags & XF86_MAP_SHARED) f |= MAP_SHARED;
- if (flags & XF86_MAP_PRIVATE) f |= MAP_PRIVATE;
-#if defined(__AMD64__) && defined(linux)
- if (flags & XF86_MAP_32BIT) f |= MAP_32BIT;
-#endif
- if (prot & XF86_PROT_EXEC) p |= PROT_EXEC;
- if (prot & XF86_PROT_READ) p |= PROT_READ;
- if (prot & XF86_PROT_WRITE) p |= PROT_WRITE;
- if (prot & XF86_PROT_NONE) p |= PROT_NONE;
-
- rc = mmap(start,(size_t)length,p,f,fd,(off_t)offset);
-
- xf86errno = xf86GetErrno();
- if (rc == MAP_FAILED)
- return XF86_MAP_FAILED;
- else
- return rc;
-#else
-#ifdef HAS_SVR3_MMAPDRV
- void *rc;
-#ifdef SELF_CONTAINED_WRAPPER
- if(mmapFd < 0) {
- if ((mmapFd = open("/dev/mmap", O_RDWR)) == -1) {
- ErrorF("Warning: failed to open /dev/mmap \n");
- xf86errno = xf86_ENOSYS;
- return XF86_MAP_FAILED;
- }
- }
-#endif
- MapDSC.vaddr = (char *)start;
- MapDSC.physaddr = (char *)offset;
- MapDSC.length = length;
- MapDSC.ioflg = 1;
-
- rc = (pointer)ioctl(mmapFd, MAP, &MapDSC);
- xf86errno = xf86GetErrno();
- if (rc == NULL)
- return XF86_MAP_FAILED;
- else
- return rc;
-#else
- ErrorF("Warning: mmap() is not supported on this platform\n");
- xf86errno = xf86_ENOSYS;
- return XF86_MAP_FAILED;
-#endif
-#endif
-}
-
-int
-xf86munmap(void *start, xf86size_t length)
-{
-#ifndef NO_MMAP
- int rc = munmap(start,(size_t)length);
-
- xf86errno = xf86GetErrno();
- return rc;
-#else
-#ifdef HAS_SVR3_MMAPDRV
- int rc = ioctl(mmapFd, UNMAPRM , start);
-
- xf86errno = xf86GetErrno();
- return rc;
-#else
- ErrorF("Warning: munmap() is not supported on this platform\n");
- xf86errno = xf86_ENOSYS;
- return -1;
-#endif
-#endif
-}
-
-int
-xf86stat(const char *file_name, struct xf86stat *xfst)
-{
- int rc;
- struct stat st;
-
- rc = stat(file_name, &st);
- xf86errno = xf86GetErrno();
- xfst->st_rdev = st.st_rdev; /* Not much is currently supported */
- return rc;
-}
-
-int
-xf86fstat(int fd, struct xf86stat *xfst)
-{
- int rc;
- struct stat st;
-
- rc = fstat(fd, &st);
- xf86errno = xf86GetErrno();
- xfst->st_rdev = st.st_rdev; /* Not much is currently supported */
- return rc;
-}
-
-static int
-xfToOsAccessMode(int xfmode)
-{
- switch(xfmode) {
- case XF86_R_OK: return R_OK;
- case XF86_W_OK: return W_OK;
- case XF86_X_OK: return X_OK;
- case XF86_F_OK: return F_OK;
- }
- return 0;
-}
-
-int
-xf86access(const char *pathname, int mode)
-{
- int rc;
-
- mode = xfToOsAccessMode(mode);
- rc = access(pathname, mode);
- xf86errno = xf86GetErrno();
- return rc;
-}
-
-
-
-/* limited stdio support */
-
-#define XF86FILE_magic 0x58464856 /* "XFHV" */
-
-typedef struct _xf86_file_ {
- INT32 fileno;
- INT32 magic;
- FILE* filehnd;
- char* fname;
-} XF86FILE_priv;
-
-XF86FILE_priv stdhnd[3] = {
- { 0, XF86FILE_magic, NULL, "$stdinp$" },
- { 0, XF86FILE_magic, NULL, "$stdout$" },
- { 0, XF86FILE_magic, NULL, "$stderr$" }
-};
-
-XF86FILE* xf86stdin = (XF86FILE*)&stdhnd[0];
-XF86FILE* xf86stdout = (XF86FILE*)&stdhnd[1];
-XF86FILE* xf86stderr = (XF86FILE*)&stdhnd[2];
-
-void
-xf86WrapperInit()
-{
- if (stdhnd[0].filehnd == NULL)
- stdhnd[0].filehnd = stdin;
- if (stdhnd[1].filehnd == NULL)
- stdhnd[1].filehnd = stdout;
- if (stdhnd[2].filehnd == NULL)
- stdhnd[2].filehnd = stderr;
- xf86HUGE_VAL = HUGE_VAL;
-}
-
-XF86FILE*
-xf86fopen(const char* fn, const char* mode)
-{
- XF86FILE_priv* fp;
- FILE *f = fopen(fn,mode);
- xf86errno = xf86GetErrno();
- if (!f) return 0;
-
- fp = xalloc(sizeof(XF86FILE_priv));
- fp->magic = XF86FILE_magic;
- fp->filehnd = f;
- fp->fileno = fileno(f);
- fp->fname = xf86strdup(fn);
-#ifdef DEBUG
- ErrorF("xf86fopen(%s,%s) yields FILE %p XF86FILE %p\n",
- fn,mode,f,fp);
-#endif
- return (XF86FILE*)fp;
-}
-
-static void _xf86checkhndl(XF86FILE_priv* f,const char *func)
-{
- if (!f || f->magic != XF86FILE_magic ||
- !f->filehnd || !f->fname) {
- FatalError("libc_wrapper error: passed invalid FILE handle to %s",
- func);
- exit(42);
- }
-}
-
-int
-xf86fclose(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
- int ret;
-
- _xf86checkhndl(fp,"xf86fclose");
-
- /* somewhat bad check */
- if (fp->fileno < 3 && fp->fname[0]=='$') {
- /* assume this is stdin/out/err, don't dispose */
- ret = fclose(fp->filehnd);
- } else {
- ret = fclose(fp->filehnd);
- fp->magic = 0; /* invalidate */
- xfree(fp->fname);
- xfree(fp);
- }
- return ret ? -1 : 0;
-}
-
-int
-xf86printf(const char *format, ...)
-{
- int ret;
- va_list args;
- va_start(args, format);
-
- ret = printf(format,args);
- va_end(args);
- return ret;
-}
-
-int
-xf86fprintf(XF86FILE* f, const char *format, ...)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- int ret;
- va_list args;
- va_start(args, format);
-
-#ifdef DEBUG
- ErrorF("xf86fprintf for XF86FILE %p\n", fp);
-#endif
- _xf86checkhndl(fp,"xf86fprintf");
-
- ret = vfprintf(fp->filehnd,format,args);
- va_end(args);
- return ret;
-}
-
-int
-xf86vfprintf(XF86FILE* f, const char *format, va_list ap)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
-#ifdef DEBUG
- ErrorF("xf86vfprintf for XF86FILE %p\n", fp);
-#endif
- _xf86checkhndl(fp,"xf86vfprintf");
-
- return vfprintf(fp->filehnd,format,ap);
-}
-
-int
-xf86vsprintf(char *s, const char *format, va_list ap)
-{
- return vsprintf(s, format, ap);
-}
-
-int
-xf86vsnprintf(char *s, xf86size_t len, const char *format, va_list ap)
-{
- return vsnprintf(s, (size_t)len, format, ap);
-}
-
-#ifdef HAVE_VFSCANF
-int
-xf86fscanf(XF86FILE* f, const char *format, ...)
-#else
-int
-xf86fscanf(XF86FILE* f, const char *format, char *a0, char *a1, char *a2,
- char *a3, char *a4, char *a5, char *a6, char *a7, char *a8,
- char *a9) /* limit of ten args */
-#endif
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
-#ifdef HAVE_VFSCANF
- int ret;
- va_list args;
- va_start(args, format);
-
- _xf86checkhndl(fp,"xf86fscanf");
-
- ret = vfscanf(fp->filehnd,format,args);
- va_end(args);
- return ret;
-#else
- _xf86checkhndl(fp,"xf86fscanf");
- return fscanf(fp->filehnd, format, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
-#endif
-}
-
-char *
-xf86fgets(char *buf, INT32 n, XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fgets");
- return fgets(buf,(int)n,fp->filehnd);
-}
-
-int
-xf86fputs(const char *buf, XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fputs");
- return fputs(buf,fp->filehnd);
-}
-
-int
-xf86getc(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86getc");
- return getc(fp->filehnd);
-}
-
-int
-xf86fgetc(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fgetc");
- return fgetc(fp->filehnd);
-}
-
-int
-xf86fputc(int c,XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fputc");
- return fputc(c,fp->filehnd);
-}
-
-int
-xf86fflush(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fflush");
- return fflush(fp->filehnd);
-}
-
-xf86size_t
-xf86fread(void* buf, xf86size_t sz, xf86size_t cnt, XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
-#ifdef DEBUG
- ErrorF("xf86fread for XF86FILE %p\n", fp);
-#endif
- _xf86checkhndl(fp,"xf86fread");
- return fread(buf,(size_t)sz,(size_t)cnt,fp->filehnd);
-}
-
-xf86size_t
-xf86fwrite(const void* buf, xf86size_t sz, xf86size_t cnt, XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fwrite");
- return fwrite(buf,(size_t)sz,(size_t)cnt,fp->filehnd);
-}
-
-int
-xf86fseek(XF86FILE* f, long offset, int whence)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fseek");
- switch (whence) {
- case XF86_SEEK_SET:
- whence = SEEK_SET;
- break;
- case XF86_SEEK_CUR:
- whence = SEEK_CUR;
- break;
- case XF86_SEEK_END:
- whence = SEEK_END;
- break;
- }
- return fseek(fp->filehnd,offset,whence);
-}
-
-long
-xf86ftell(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86ftell");
- return ftell(fp->filehnd);
-}
-
-#define mapnum(e) case (xf86_##e): err = e; break;
-
-char*
-xf86strerror(int n)
-{
- int err;
-
- switch (n)
- {
- case 0: err = 0; break;
- mapnum (EACCES);
- mapnum (EAGAIN);
- mapnum (EBADF);
- mapnum (EEXIST);
- mapnum (EFAULT);
- mapnum (EINTR);
- mapnum (EINVAL);
- mapnum (EISDIR);
- mapnum (ELOOP); /* not POSIX 1 */
- mapnum (EMFILE);
- mapnum (ENAMETOOLONG);
- mapnum (ENFILE);
- mapnum (ENOENT);
- mapnum (ENOMEM);
- mapnum (ENOSPC);
- mapnum (ENOTDIR);
- mapnum (EPIPE);
- mapnum (EROFS);
-#ifndef __UNIXOS2__
- mapnum (ETXTBSY); /* not POSIX 1 */
-#endif
- mapnum (ENOTTY);
- mapnum (EBUSY);
- mapnum (ENODEV);
- mapnum (EIO);
-
- default:
- err = 999;
- }
- return strerror(err);
-}
-
-#undef mapnum
-
-
-/* required for portable fgetpos/fsetpos,
- * use as
- * XF86fpos_t* pos = xalloc(xf86fpossize());
- */
-long
-xf86fpossize()
-{
- return sizeof(fpos_t);
-}
-
-int
-xf86fgetpos(XF86FILE* f,XF86fpos_t* pos)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
- fpos_t *ppos = (fpos_t*)pos;
-
- _xf86checkhndl(fp,"xf86fgetpos");
-#ifndef ISC
- return fgetpos(fp->filehnd,ppos);
-#else
- *ppos = ftell(fp->filehnd);
- if (*ppos < 0L)
- return(-1);
- return(0);
-#endif
-}
-
-int
-xf86fsetpos(XF86FILE* f,const XF86fpos_t* pos)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
- fpos_t *ppos = (fpos_t*)pos;
-
- /* XXX need to handle xf86errno here */
- _xf86checkhndl(fp,"xf86fsetpos");
-#ifndef ISC
- return fsetpos(fp->filehnd,ppos);
-#else
- if (ppos == NULL)
- {
- errno = EINVAL;
- return EOF;
- }
- return fseek(fp->filehnd, *ppos, SEEK_SET);
-#endif
-}
-
-void
-xf86perror(const char *s)
-{
- perror(s);
-}
-
-int
-xf86remove(const char *s)
-{
-#ifdef _POSIX_SOURCE
- return remove(s);
-#else
- return unlink(s);
-#endif
-}
-
-int
-xf86rename(const char *old, const char *new)
-{
-#ifdef _POSIX_SOURCE
- return rename(old,new);
-#else
- int ret = link(old,new);
- if (!ret) {
- ret = unlink(old);
- if (ret) unlink(new);
- } else
- ret = unlink(new);
- return ret;
-#endif
-}
-
-void
-xf86rewind(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fsetpos");
- rewind(fp->filehnd);
-}
-
-void
-xf86clearerr(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86clearerr");
- clearerr(fp->filehnd);
-}
-
-int
-xf86feof(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86feof");
- return feof(fp->filehnd);
-}
-
-int
-xf86ferror(XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86ferror");
- return ferror(fp->filehnd);
-}
-
-XF86FILE*
-xf86freopen(const char* fname,const char* mode,XF86FILE* fold)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)fold;
- FILE *fnew;
-
- _xf86checkhndl(fp,"xf86freopen");
- fnew = freopen(fname,mode,fp->filehnd);
- xf86errno = xf86GetErrno();
- if (!fnew) {
- xf86fclose(fold); /* discard old XF86FILE structure */
- return 0;
- }
- /* recycle the old XF86FILE structure */
- fp->magic = XF86FILE_magic;
- fp->filehnd = fnew;
- fp->fileno = fileno(fnew);
- fp->fname = xf86strdup(fname);
-#ifdef DEBUG
- ErrorF("xf86freopen(%s,%s,%p) yields FILE %p XF86FILE %p\n",
- fname,mode,fold,fnew,fp);
-#endif
- return (XF86FILE*)fp;
-}
-
-int
-xf86setbuf(XF86FILE* f, char *buf)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86fsetbuf");
-#ifdef SETBUF_RETURNS_INT
- return setbuf(fp->filehnd, buf);
-#else
- setbuf(fp->filehnd, buf);
- return 0;
-#endif
-}
-
-int
-xf86setvbuf(XF86FILE* f, char *buf, int mode, xf86size_t size)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
- int vbufmode;
-
- _xf86checkhndl(fp,"xf86fsetvbuf");
-
- switch (mode) {
- case XF86_IONBF:
- vbufmode = _IONBF;
- break;
- case XF86_IOLBF:
- vbufmode = _IOFBF;
- break;
- case XF86_IOFBF:
- vbufmode = _IOLBF;
- break;
- default:
- FatalError("libc_wrapper error: mode in setvbuf incorrect");
- exit(42);
- }
-
- return setvbuf(fp->filehnd,buf,vbufmode,(size_t)size);
-}
-
-XF86FILE*
-xf86tmpfile(void)
-{
-#ifdef NEED_TMPFILE
- return xf86fopen(tmpnam((char*)0),"w+");
-#else
- XF86FILE_priv* fp;
- FILE *f = tmpfile();
- xf86errno = xf86GetErrno();
- if (!f) return 0;
-
- fp = xalloc(sizeof(XF86FILE_priv));
- fp->magic = XF86FILE_magic;
- fp->filehnd = f;
- fp->fileno = fileno(f);
- fp->fname = xf86strdup("*tmpfile*"); /* so that it can be xfree()'d */
-#ifdef DEBUG
- ErrorF("xf86tmpfile() yields FILE %p XF86FILE %p\n",f,fp);
-#endif
- return (XF86FILE*)fp;
-}
-#endif /* HAS_TMPFILE */
-
-
-int
-xf86ungetc(int c,XF86FILE* f)
-{
- XF86FILE_priv* fp = (XF86FILE_priv*)f;
-
- _xf86checkhndl(fp,"xf86ungetc");
- return ungetc(c,fp->filehnd);
-}
-
-/* Misc functions. Some are ANSI C, some are not. */
-
-void
-xf86usleep(usec)
- unsigned long usec;
-{
-#if (defined(SYSV) || defined(SVR4)) && !defined(sun)
- syscall(3112, (usec) / 1000 + 1);
-#else
- usleep(usec);
-#endif
-}
-
-void
-xf86getsecs(long * secs, long * usecs)
-{
- struct timeval tv;
-
- X_GETTIMEOFDAY(&tv);
- if (secs)
- *secs = tv.tv_sec;
- if (usecs)
- *usecs= tv.tv_usec;
-
- return;
-}
-
-int
-xf86ffs(int mask)
-{
- int n;
- if (mask == 0) return 0;
- for (n = 1; (mask & 1)==0; n++)
- mask >>= 1;
- return n;
-}
-
-char *
-xf86getenv(const char * a)
-{
- /* Only allow this when the real and effective uids are the same */
- if (getuid() != geteuid())
- return NULL;
- else
- return(getenv(a));
-}
-
-void *
-xf86bsearch(const void *key, const void *base, xf86size_t nmemb,
- xf86size_t size, int (*compar)(const void *, const void *))
-{
- return bsearch(key, base, (size_t)nmemb, (size_t)size, compar);
-}
-
-int
-xf86execl(const char *pathname, const char *arg, ...)
-{
-#ifndef __UNIXOS2__
- int i;
- pid_t pid;
- int exit_status;
- char *arglist[5];
- va_list args;
- va_start(args, arg);
- arglist[0] = (char*)&args;
- i = 1;
- while (i < 5 && (arglist[i++] = va_arg(args, char *)) != NULL)
- ;
- va_end(args);
-
- if ((pid = fork()) < 0) {
- ErrorF("Fork failed (%s)\n", strerror(errno));
- return -1;
- } else if (pid == 0) { /* child */
- /*
- * Make sure that the child doesn't inherit any I/O permissions it
- * shouldn't have. It's better to put constraints on the development
- * of a clock program than to give I/O permissions to a bogus program
- * in someone's XF86Config file
- */
-#ifndef SELF_CONTAINED_WRAPPER
- xf86DisableIO();
-#endif
- setuid(getuid());
-#if !defined(SELF_CONTAINED_WRAPPER)
- /* set stdin, stdout to the consoleFD, and leave stderr alone */
- for (i = 0; i < 2; i++)
- {
- if (xf86Info.consoleFd != i)
- {
- close(i);
- dup(xf86Info.consoleFd);
- }
- }
-#endif
-
- execv(pathname, arglist);
- ErrorF("Exec failed for command \"%s\" (%s)\n",
- pathname, strerror(errno));
- exit(255);
- }
-
- /* parent */
- wait(&exit_status);
- if (WIFEXITED(exit_status))
- {
- switch (WEXITSTATUS(exit_status))
- {
- case 0: /* OK */
- return 0;
- case 255: /* exec() failed */
- return(255);
- default: /* bad exit status */
- ErrorF("Program \"%s\" had bad exit status %d\n",
- pathname, WEXITSTATUS(exit_status));
- return(WEXITSTATUS(exit_status));
- }
- }
- else if (WIFSIGNALED(exit_status))
- {
- ErrorF("Program \"%s\" died on signal %d\n",
- pathname, WTERMSIG(exit_status));
- return(WTERMSIG(exit_status));
- }
-#ifdef WIFSTOPPED
- else if (WIFSTOPPED(exit_status))
- {
- ErrorF("Program \"%s\" stopped by signal %d\n",
- pathname, WSTOPSIG(exit_status));
- return(WSTOPSIG(exit_status));
- }
-#endif
- else /* should never get to this point */
- {
- ErrorF("Program \"%s\" has unknown exit condition\n",
- pathname);
- return(1);
- }
-#else
- return(1);
-#endif /* __UNIXOS2__ Disable this crazy business for now */
-}
-
-void
-xf86abort(void)
-{
- ErrorF("Module called abort() function\n");
- abort();
-}
-
-void
-xf86exit(int ex)
-{
- ErrorF("Module called exit() function with value=%d\n",ex);
- exit(ex);
-}
-
-/* directory handling functions */
-#define XF86DIR_magic 0x78666876 /* "xfhv" */
-
-typedef struct _xf86_dir_ {
- DIR *dir;
- INT32 magic;
- XF86DIRENT *dirent;
-} XF86DIR_priv;
-
-static void
-_xf86checkdirhndl(XF86DIR_priv* f,const char *func)
-{
- if (!f || f->magic != XF86DIR_magic || !f->dir || !f->dirent) {
- FatalError("libc_wrapper error: passed invalid DIR handle to %s",
- func);
- exit(42);
- }
-}
-
-XF86DIR *
-xf86opendir(const char *name)
-{
- XF86DIR_priv *dp;
- DIR *dirp;
-
- dirp = opendir(name);
- if (!dirp)
- return (XF86DIR*)0;
-
- dp = xalloc(sizeof(XF86DIR_priv));
- dp->magic = XF86DIR_magic; /* This time I have this, Dirk! :-) */
- dp->dir = dirp;
- dp->dirent = xalloc(sizeof(struct _xf86dirent));
-
- return (XF86DIR*)dp;
-}
-
-XF86DIRENT*
-xf86readdir(XF86DIR* dirp)
-{
- XF86DIR_priv* dp = (XF86DIR_priv*)dirp;
- DIRENTRY *de;
- XF86DIRENT* xde;
- int sz;
-
- _xf86checkdirhndl(dp,"xf86readdir");
-
- de = readdir(dp->dir);
- if (!de)
- return (XF86DIRENT*)0;
- xde = dp->dirent;
- sz = strlen(de->d_name);
- strncpy(xde->d_name,de->d_name, sz>_XF86NAMELEN ? (_XF86NAMELEN+1) : (sz+1));
- xde->d_name[_XF86NAMELEN] = '\0'; /* be sure to have a 0 byte */
- return xde;
-}
-
-void
-xf86rewinddir(XF86DIR* dirp)
-{
- XF86DIR_priv* dp = (XF86DIR_priv*)dirp;
-
- _xf86checkdirhndl(dp,"xf86readdir");
- rewinddir(dp->dir);
-}
-
-int
-xf86closedir(XF86DIR* dir)
-{
- XF86DIR_priv* dp = (XF86DIR_priv*)dir;
- int n;
-
- _xf86checkdirhndl(dp,"xf86readdir");
-
- n = closedir(dp->dir);
- dp->magic = 0;
- xfree(dp->dirent);
- xfree(dp);
-
- return n;
-}
-
-static mode_t
-xfToOsChmodMode(xf86mode_t xfmode)
-{
- mode_t mode = 0;
-
- if (xfmode & XF86_S_ISUID) mode |= S_ISUID;
- if (xfmode & XF86_S_ISGID) mode |= S_ISGID;
-#ifndef __UNIXOS2__
- if (xfmode & XF86_S_ISVTX) mode |= S_ISVTX;
-#endif
- if (xfmode & XF86_S_IRUSR) mode |= S_IRUSR;
- if (xfmode & XF86_S_IWUSR) mode |= S_IWUSR;
- if (xfmode & XF86_S_IXUSR) mode |= S_IXUSR;
- if (xfmode & XF86_S_IRGRP) mode |= S_IRGRP;
- if (xfmode & XF86_S_IWGRP) mode |= S_IWGRP;
- if (xfmode & XF86_S_IXGRP) mode |= S_IXGRP;
- if (xfmode & XF86_S_IROTH) mode |= S_IROTH;
- if (xfmode & XF86_S_IWOTH) mode |= S_IWOTH;
- if (xfmode & XF86_S_IXOTH) mode |= S_IXOTH;
-
- return mode;
-}
-
-int
-xf86chmod(const char *path, xf86mode_t xfmode)
-{
- mode_t mode = xfToOsChmodMode(xfmode);
- int rc = chmod(path, mode);
-
- xf86errno = xf86GetErrno();
- return rc;
-}
-
-int
-xf86chown(const char *path, xf86uid_t owner, xf86gid_t group)
-{
-#ifndef __UNIXOS2__
- int rc = chown(path, owner, group);
-#else
- int rc = 0;
-#endif
- xf86errno = xf86GetErrno();
- return rc;
-}
-
-xf86uid_t
-xf86geteuid(void)
-{
- return geteuid();
-}
-
-xf86gid_t
-xf86getegid(void)
-{
- return getegid();
-}
-
-int
-xf86getpid(void)
-{
- return getpid();
-}
-
-static mode_t
-xfToOsMknodMode(xf86mode_t xfmode)
-{
- mode_t mode = xfToOsChmodMode(xfmode);
-
- if (xfmode & XF86_S_IFREG) mode |= S_IFREG;
- if (xfmode & XF86_S_IFCHR) mode |= S_IFCHR;
-#ifndef __UNIXOS2__
- if (xfmode & XF86_S_IFBLK) mode |= S_IFBLK;
-#endif
- if (xfmode & XF86_S_IFIFO) mode |= S_IFIFO;
-
- return mode;
-}
-
-int xf86mknod(const char *pathname, xf86mode_t xfmode, xf86dev_t dev)
-{
- mode_t mode = xfToOsMknodMode(xfmode);
-#ifndef __UNIXOS2__
- int rc = mknod(pathname, mode, dev);
-#else
- int rc = 0;
-#endif
- xf86errno = xf86GetErrno();
- return rc;
-}
-
-unsigned int xf86sleep(unsigned int seconds)
-{
- return sleep(seconds);
-}
-
-int xf86mkdir(const char *pathname, xf86mode_t xfmode)
-{
- mode_t mode = xfToOsChmodMode(xfmode);
- int rc = mkdir(pathname, mode);
-
- xf86errno = xf86GetErrno();
- return rc;
-}
-
-
-/* Several math functions */
-
-int
-xf86abs(int x)
-{
- return abs(x);
-}
-
-double
-xf86acos(double x)
-{
- return acos(x);
-}
-
-double
-xf86asin(double x)
-{
- return asin(x);
-}
-
-double
-xf86atan(double x)
-{
- return atan(x);
-}
-
-double
-xf86atan2(double x,double y)
-{
- return atan2(x,y);
-}
-
-double
-xf86atof(const char* s)
-{
- return atof(s);
-}
-
-int
-xf86atoi(const char* s)
-{
- return atoi(s);
-}
-
-long
-xf86atol(const char* s)
-{
- return atol(s);
-}
-
-double
-xf86ceil(double x)
-{
- return ceil(x);
-}
-
-double
-xf86cos(double x)
-{
- return(cos(x));
-}
-
-double
-xf86exp(double x)
-{
- return(exp(x));
-}
-
-double
-xf86fabs(double x)
-{
- return(fabs(x));
-}
-
-int
-xf86finite(double x)
-{
-#ifndef QNX4
-#ifndef __UNIXOS2__
- return(finite(x));
-#else
- return(isfinite(x));
-#endif /* __UNIXOS2__ */
-#else
- /* XXX Replace this with something that really works. */
- return 1;
-#endif
-}
-
-double
-xf86floor(double x)
-{
- return floor(x);
-}
-
-double
-xf86fmod(double x,double y)
-{
- return fmod(x,y);
-}
-
-long
-xf86labs(long x)
-{
- return labs(x);
-}
-
-double
-xf86ldexp(double x, int exp)
-{
- return ldexp(x, exp);
-}
-
-double
-xf86log(double x)
-{
- return(log(x));
-}
-
-double
-xf86log10(double x)
-{
- return(log10(x));
-}
-
-double
-xf86modf(double x,double* y)
-{
- return modf(x,y);
-}
-
-double
-xf86pow(double x, double y)
-{
- return(pow(x,y));
-}
-
-double
-xf86sin(double x)
-{
- return sin(x);
-}
-
-double
-xf86sqrt(double x)
-{
- return(sqrt(x));
-}
-
-double
-xf86strtod(const char *s, char **end)
-{
- return strtod(s,end);
-}
-
-long
-xf86strtol(const char *s, char **end, int radix)
-{
- return strtol(s,end,radix);
-}
-
-unsigned long
-xf86strtoul(const char *s, char **end,int radix)
-{
- return strtoul(s,end,radix);
-}
-
-double
-xf86tan(double x)
-{
- return tan(x);
-}
-
-/* memory functions */
-void*
-xf86memchr(const void* s, int c, xf86size_t n)
-{
- return memchr(s,c,(size_t)n);
-}
-
-int
-xf86memcmp(const void* s1, const void* s2, xf86size_t n)
-{
- return(memcmp(s1,s2,(size_t)n));
-}
-
-void*
-xf86memcpy(void* dest, const void* src, xf86size_t n)
-{
- return(memcpy(dest,src,(size_t)n));
-}
-
-void*
-xf86memmove(void* dest, const void* src, xf86size_t n)
-{
- return(memmove(dest,src,(size_t)n));
-}
-
-void*
-xf86memset(void* s, int c, xf86size_t n)
-{
- return(memset(s,c,(size_t)n));
-}
-
-/* ctype functions */
-
-int
-xf86isalnum(int c)
-{
- return isalnum(c) ? 1 : 0;
-}
-
-int
-xf86isalpha(int c)
-{
- return isalpha(c) ? 1 : 0;
-}
-
-int
-xf86iscntrl(int c)
-{
- return iscntrl(c) ? 1 : 0;
-}
-
-int
-xf86isdigit(int c)
-{
- return isdigit(c) ? 1 : 0;
-}
-
-int
-xf86isgraph(int c)
-{
- return isgraph(c) ? 1 : 0;
-}
-
-int
-xf86islower(int c)
-{
- return islower(c) ? 1 : 0;
-}
-
-int
-xf86isprint(int c)
-{
- return isprint(c) ? 1 : 0;
-}
-
-int
-xf86ispunct(int c)
-{
- return ispunct(c) ? 1 : 0;
-}
-
-int
-xf86isspace(int c)
-{
- return isspace(c) ? 1 : 0;
-}
-
-int
-xf86isupper(int c)
-{
- return isupper(c) ? 1 : 0;
-}
-
-int
-xf86isxdigit(int c)
-{
- return isxdigit(c) ? 1 : 0;
-}
-
-int
-xf86tolower(int c)
-{
- return tolower(c);
-}
-
-int
-xf86toupper(int c)
-{
- return toupper(c);
-}
-
-/* memory allocation functions */
-void*
-xf86calloc(xf86size_t sz,xf86size_t n)
-{
- return xcalloc(sz, n);
-}
-
-void
-xf86free(void* p)
-{
- xfree(p);
-}
-
-double
-xf86frexp(double x, int *exp)
-{
- return frexp(x, exp);
-}
-
-void*
-xf86malloc(xf86size_t n)
-{
- return xalloc(n);
-}
-
-void*
-xf86realloc(void* p, xf86size_t n)
-{
- return xrealloc(p,n);
-}
-
-/*
- * XXX This probably doesn't belong here.
- */
-int
-xf86getpagesize()
-{
- static int pagesize = -1;
-
- if (pagesize != -1)
- return pagesize;
-
-#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
- pagesize = sysconf(_SC_PAGESIZE);
-#endif
-#ifdef _SC_PAGE_SIZE
- if (pagesize == -1)
- pagesize = sysconf(_SC_PAGE_SIZE);
-#endif
-#ifdef HAS_GETPAGESIZE
- if (pagesize == -1)
- pagesize = getpagesize();
-#endif
-#ifdef PAGE_SIZE
- if (pagesize == -1)
- pagesize = PAGE_SIZE;
-#endif
- if (pagesize == -1)
- FatalError("xf86getpagesize: Cannot determine page size");
-
- return pagesize;
-}
-
-
-#define mapnum(e) case (e): return (xf86_##e)
-
-int
-xf86GetErrno ()
-{
- switch (errno)
- {
- case 0: return 0;
- mapnum (EACCES);
- mapnum (EAGAIN);
- mapnum (EBADF);
- mapnum (EEXIST);
- mapnum (EFAULT);
- mapnum (EINTR);
- mapnum (EINVAL);
- mapnum (EISDIR);
- mapnum (ELOOP); /* not POSIX 1 */
- mapnum (EMFILE);
- mapnum (ENAMETOOLONG);
- mapnum (ENFILE);
- mapnum (ENOENT);
- mapnum (ENOMEM);
- mapnum (ENOSPC);
- mapnum (ENOTDIR);
- mapnum (EPIPE);
- mapnum (EROFS);
-#ifndef __UNIXOS2__
- mapnum (ETXTBSY); /* not POSIX 1 */
-#endif
- mapnum (ENOTTY);
- mapnum (EBUSY);
- mapnum (ENODEV);
- mapnum (EIO);
-
- default:
- return (xf86_UNKNOWN);
- }
-}
-
-#undef mapnum
-
-
-
-#ifdef HAVE_SYSV_IPC
-
-int
-xf86shmget(xf86key_t key, int size, int xf86shmflg)
-{
- int shmflg;
-
- /* This copies the permissions (SHM_R, SHM_W for u, g, o). */
- shmflg = xf86shmflg & 0777;
-
- if (key == XF86IPC_PRIVATE) key = IPC_PRIVATE;
-
- if (xf86shmflg & XF86IPC_CREAT) shmflg |= IPC_CREAT;
- if (xf86shmflg & XF86IPC_EXCL) shmflg |= IPC_EXCL;
- if (xf86shmflg & XF86IPC_NOWAIT) shmflg |= IPC_NOWAIT;
- return shmget((key_t) key, size, shmflg);
-}
-
-char *
-xf86shmat(int id, char *addr, int xf86shmflg)
-{
- int shmflg = 0;
-
-#ifdef SHM_RDONLY
- if (xf86shmflg & XF86SHM_RDONLY) shmflg |= SHM_RDONLY;
-#endif
-#ifdef SHM_RND
- if (xf86shmflg & XF86SHM_RND) shmflg |= SHM_RND;
-#endif
-#ifdef SHM_REMAP
- if (xf86shmflg & XF86SHM_REMAP) shmflg |= SHM_REMAP;
-#endif
-
- return shmat(id,addr,shmflg);
-}
-
-int
-xf86shmdt(char *addr)
-{
- return shmdt(addr);
-}
-
-/*
- * for now only implement the rmid command.
- */
-int
-xf86shmctl(int id, int xf86cmd, pointer buf)
-{
- int cmd;
-
- switch (xf86cmd) {
- case XF86IPC_RMID:
- cmd = IPC_RMID;
- break;
- default:
- return 0;
- }
-
- return shmctl(id, cmd, buf);
-}
-#else
-
-int
-xf86shmget(xf86key_t key, int size, int xf86shmflg)
-{
- return -1;
-
-}
-
-char *
-xf86shmat(int id, char *addr, int xf86shmflg)
-{
- return (char *)-1;
-}
-
-int
-xf86shmctl(int id, int xf86cmd, pointer buf)
-{
- return -1;
-}
-
-int
-xf86shmdt(char *addr)
-{
- return -1;
-}
-#endif /* HAVE_SYSV_IPC */
-
-int
-xf86getjmptype()
-{
-#ifdef HAS_GLIBC_SIGSETJMP
- return 1;
-#else
- return 0;
-#endif
-}
-
-#ifdef HAS_GLIBC_SIGSETJMP
-
-int
-xf86setjmp(xf86jmp_buf env)
-{
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
- return __sigsetjmp((void *)env, xf86setjmp1_arg2());
-#else
- return xf86setjmp1(env, xf86setjmp1_arg2());
-#endif
-}
-
-int
-xf86setjmp0(xf86jmp_buf env)
-{
- FatalError("setjmp: type 0 called instead of type %d", xf86getjmptype());
-}
-
-#if !defined(__GLIBC__) || (__GLIBC__ < 2) /* libc5 */
-
-int
-xf86setjmp1(xf86jmp_buf env, int arg2)
-{
- __sigjmp_save((void *)env, arg2);
- return __setjmp((void *)env);
-}
-
-#endif
-
-#else /* HAS_GLIBC_SIGSETJMP */
-
-int
-xf86setjmp1(xf86jmp_buf env, int arg2)
-{
- FatalError("setjmp: type 1 called instead of type %d", xf86getjmptype());
-}
-
-#endif /* HAS_GLIBC_SIGSETJMP */
-
-int
-xf86setjmp1_arg2()
-{
- return 1;
-}
-
-int
-xf86setjmperror(xf86jmp_buf env)
-{
- FatalError("setjmp: don't know how to handle setjmp() type %d",
- xf86getjmptype());
-}
-
diff --git a/hw/xfree86/os-support/shared/pm_noop.c b/hw/xfree86/os-support/shared/pm_noop.c
deleted file mode 100644
index b5f4941bc..000000000
--- a/hw/xfree86/os-support/shared/pm_noop.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.2 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Stubs for the OS-support layer power-management functions. */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-
-PMClose
-xf86OSPMOpen(void)
-{
- return NULL;
-}
-
-
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
deleted file mode 100644
index 1812729c0..000000000
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.30 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright 1993-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-
-/* $XConsortium: posix_tty.c /main/7 1996/10/19 18:07:47 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static int
-GetBaud (int baudrate)
-{
-#ifdef B300
- if (baudrate == 300)
- return B300;
-#endif
-#ifdef B1200
- if (baudrate == 1200)
- return B1200;
-#endif
-#ifdef B2400
- if (baudrate == 2400)
- return B2400;
-#endif
-#ifdef B4800
- if (baudrate == 4800)
- return B4800;
-#endif
-#ifdef B9600
- if (baudrate == 9600)
- return B9600;
-#endif
-#ifdef B19200
- if (baudrate == 19200)
- return B19200;
-#endif
-#ifdef B38400
- if (baudrate == 38400)
- return B38400;
-#endif
-#ifdef B57600
- if (baudrate == 57600)
- return B57600;
-#endif
-#ifdef B115200
- if (baudrate == 115200)
- return B115200;
-#endif
-#ifdef B230400
- if (baudrate == 230400)
- return B230400;
-#endif
-#ifdef B460800
- if (baudrate == 460800)
- return B460800;
-#endif
- return (0);
-}
-
-int
-xf86OpenSerial (pointer options)
-{
-#ifdef Lynx
- struct sgttyb ms_sgtty;
-#endif
- struct termios t;
- int fd, i;
- char *dev;
-
- dev = xf86SetStrOption (options, "Device", NULL);
- if (!dev)
- {
- xf86Msg (X_ERROR, "xf86OpenSerial: No Device specified.\n");
- return (-1);
- }
-
- SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK));
- if (fd == -1)
- {
- xf86Msg (X_ERROR,
- "xf86OpenSerial: Cannot open device %s\n\t%s.\n",
- dev, strerror (errno));
- xfree(dev);
- return (-1);
- }
-
- if (!isatty (fd))
- {
-#if 1
- /* Allow non-tty devices to be opened. */
- xfree(dev);
- return (fd);
-#else
- xf86Msg (X_WARNING,
- "xf86OpenSerial: Specified device %s is not a tty\n",
- dev);
- SYSCALL (close (fd));
- errno = EINVAL;
- xfree(dev);
- return (-1);
-#endif
- }
-
-#ifdef Lynx
- /* LynxOS does not assert DTR without this */
- ioctl (fd, TIOCGETP, (char *) &ms_sgtty);
- ioctl (fd, TIOCSDTR, (char *) &ms_sgtty);
-#endif
-
- /* set up default port parameters */
- SYSCALL (tcgetattr (fd, &t));
- t.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR\
- |IGNCR|ICRNL|IXON);
- t.c_oflag &= ~OPOST;
- t.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
- t.c_cflag &= ~(CSIZE|PARENB);
- t.c_cflag |= CS8|CLOCAL;
-
- cfsetispeed (&t, B9600);
- cfsetospeed (&t, B9600);
- t.c_cc[VMIN] = 1;
- t.c_cc[VTIME] = 0;
-
- SYSCALL (tcsetattr (fd, TCSANOW, &t));
-
- if (xf86SetSerial (fd, options) == -1)
- {
- SYSCALL (close (fd));
- xfree(dev);
- return (-1);
- }
-
- SYSCALL (i = fcntl (fd, F_GETFL, 0));
- if (i == -1)
- {
- SYSCALL (close (fd));
- xfree(dev);
- return (-1);
- }
- i &= ~O_NONBLOCK;
- SYSCALL (i = fcntl (fd, F_SETFL, i));
- if (i == -1)
- {
- SYSCALL (close (fd));
- xfree(dev);
- return (-1);
- }
- xfree(dev);
- return (fd);
-}
-
-int
-xf86SetSerial (int fd, pointer options)
-{
- struct termios t;
- int val;
- const char *s;
- int baud, r;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
- SYSCALL (tcgetattr (fd, &t));
-
- if ((val = xf86SetIntOption (options, "BaudRate", 0)))
- {
- if ((baud = GetBaud (val)))
- {
- cfsetispeed (&t, baud);
- cfsetospeed (&t, baud);
- }
- else
- {
- xf86Msg (X_ERROR,
- "Invalid Option BaudRate value: %d\n", val);
- return (-1);
- }
- }
-
- if ((val = xf86SetIntOption (options, "StopBits", 0)))
- {
- switch (val)
- {
- case 1:
- t.c_cflag &= ~(CSTOPB);
- break;
- case 2:
- t.c_cflag |= CSTOPB;
- break;
- default:
- xf86Msg (X_ERROR,
- "Invalid Option StopBits value: %d\n", val);
- return (-1);
- break;
- }
- }
-
- if ((val = xf86SetIntOption (options, "DataBits", 0)))
- {
- switch (val)
- {
- case 5:
- t.c_cflag &= ~(CSIZE);
- t.c_cflag |= CS5;
- break;
- case 6:
- t.c_cflag &= ~(CSIZE);
- t.c_cflag |= CS6;
- break;
- case 7:
- t.c_cflag &= ~(CSIZE);
- t.c_cflag |= CS7;
- break;
- case 8:
- t.c_cflag &= ~(CSIZE);
- t.c_cflag |= CS8;
- break;
- default:
- xf86Msg (X_ERROR,
- "Invalid Option DataBits value: %d\n", val);
- return (-1);
- break;
- }
- }
-
- if ((s = xf86SetStrOption (options, "Parity", NULL)))
- {
- if (xf86NameCmp (s, "Odd") == 0)
- {
- t.c_cflag |= PARENB | PARODD;
- }
- else if (xf86NameCmp (s, "Even") == 0)
- {
- t.c_cflag |= PARENB;
- t.c_cflag &= ~(PARODD);
- }
- else if (xf86NameCmp (s, "None") == 0)
- {
- t.c_cflag &= ~(PARENB);
- }
- else
- {
- xf86Msg (X_ERROR, "Invalid Option Parity value: %s\n",
- s);
- return (-1);
- }
- }
-
- if ((val = xf86SetIntOption (options, "Vmin", -1)) != -1)
- {
- t.c_cc[VMIN] = val;
- }
- if ((val = xf86SetIntOption (options, "Vtime", -1)) != -1)
- {
- t.c_cc[VTIME] = val;
- }
-
- if ((s = xf86SetStrOption (options, "FlowControl", NULL)))
- {
- xf86MarkOptionUsedByName (options, "FlowControl");
- if (xf86NameCmp (s, "Xoff") == 0)
- {
- t.c_iflag |= IXOFF;
- }
- else if (xf86NameCmp (s, "Xon") == 0)
- {
- t.c_iflag |= IXON;
- }
- else if (xf86NameCmp (s, "XonXoff") == 0)
- {
- t.c_iflag |= IXON|IXOFF;
- }
- else if (xf86NameCmp (s, "None") == 0)
- {
- t.c_iflag &= ~(IXON | IXOFF);
- }
- else
- {
- xf86Msg (X_ERROR,
- "Invalid Option FlowControl value: %s\n", s);
- return (-1);
- }
- }
-
- if ((xf86SetBoolOption (options, "ClearDTR", FALSE)))
- {
-#ifdef CLEARDTR_SUPPORT
-# if !defined(Lynx) || defined(TIOCMBIC)
- val = TIOCM_DTR;
- SYSCALL (ioctl(fd, TIOCMBIC, &val));
-# else
- SYSCALL (ioctl(fd, TIOCCDTR, NULL));
-# endif
-#else
- xf86Msg (X_WARNING,
- "Option ClearDTR not supported on this OS\n");
- return (-1);
-#endif
- xf86MarkOptionUsedByName (options, "ClearDTR");
- }
-
- if ((xf86SetBoolOption (options, "ClearRTS", FALSE)))
- {
-#ifdef CLEARRTS_SUPPORT
- val = TIOCM_RTS;
- SYSCALL (ioctl(fd, TIOCMBIC, &val));
-#else
- xf86Msg (X_WARNING,
- "Option ClearRTS not supported on this OS\n");
- return (-1);
-#endif
- xf86MarkOptionUsedByName (options, "ClearRTS");
- }
-
- SYSCALL (r = tcsetattr (fd, TCSANOW, &t));
- return (r);
-}
-
-int
-xf86SetSerialSpeed (int fd, int speed)
-{
- struct termios t;
- int baud, r;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
- SYSCALL (tcgetattr (fd, &t));
-
- if ((baud = GetBaud (speed)))
- {
- cfsetispeed (&t, baud);
- cfsetospeed (&t, baud);
- }
- else
- {
- xf86Msg (X_ERROR,
- "Invalid Option BaudRate value: %d\n", speed);
- return (-1);
- }
-
- SYSCALL (r = tcsetattr (fd, TCSANOW, &t));
- return (r);
-}
-
-int
-xf86ReadSerial (int fd, void *buf, int count)
-{
- int r;
-#ifdef DEBUG
- int i;
-#endif
- SYSCALL (r = read (fd, buf, count));
-#ifdef DEBUG
- ErrorF("ReadingSerial: 0x%x",
- (unsigned char)*(((unsigned char *)buf)));
- for (i = 1; i < r; i++)
- ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
- return (r);
-}
-
-int
-xf86WriteSerial (int fd, const void *buf, int count)
-{
- int r;
-#ifdef DEBUG
- int i;
-
- ErrorF("WritingSerial: 0x%x",(unsigned char)*(((unsigned char *)buf)));
- for (i = 1; i < count; i++)
- ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
- SYSCALL (r = write (fd, buf, count));
- return (r);
-}
-
-int
-xf86CloseSerial (int fd)
-{
- int r;
-
- SYSCALL (r = close (fd));
- return (r);
-}
-
-int
-xf86WaitForInput (int fd, int timeout)
-{
- fd_set readfds;
- struct timeval to;
- int r;
-
- FD_ZERO(&readfds);
-
- if (fd >= 0) {
- FD_SET(fd, &readfds);
- }
-
- to.tv_sec = timeout / 1000000;
- to.tv_usec = timeout % 1000000;
-
- if (fd >= 0) {
- SYSCALL (r = select (FD_SETSIZE, &readfds, NULL, NULL, &to));
- }
- else {
- SYSCALL (r = select (FD_SETSIZE, NULL, NULL, NULL, &to));
- }
- xf86ErrorFVerb (9,"select returned %d\n", r);
- return (r);
-}
-
-int
-xf86SerialSendBreak (int fd, int duration)
-{
- int r;
-
- SYSCALL (r = tcsendbreak (fd, duration));
- return (r);
-
-}
-
-int
-xf86FlushInput(int fd)
-{
- fd_set fds;
- struct timeval timeout;
- char c[4];
-
-#ifdef DEBUG
- ErrorF("FlushingSerial\n");
-#endif
- if (tcflush(fd, TCIFLUSH) == 0)
- return 0;
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- while (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
- if (read(fd, &c, sizeof(c)) < 1)
- return 0;
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- }
- return 0;
-}
-
-static struct states {
- int xf;
- int os;
-} modemStates[] = {
-#ifdef TIOCM_LE
- { XF86_M_LE, TIOCM_LE },
-#endif
-#ifdef TIOCM_DTR
- { XF86_M_DTR, TIOCM_DTR },
-#endif
-#ifdef TIOCM_RTS
- { XF86_M_RTS, TIOCM_RTS },
-#endif
-#ifdef TIOCM_ST
- { XF86_M_ST, TIOCM_ST },
-#endif
-#ifdef TIOCM_SR
- { XF86_M_SR, TIOCM_SR },
-#endif
-#ifdef TIOCM_CTS
- { XF86_M_CTS, TIOCM_CTS },
-#endif
-#ifdef TIOCM_CAR
- { XF86_M_CAR, TIOCM_CAR },
-#elif defined(TIOCM_CD)
- { XF86_M_CAR, TIOCM_CD },
-#endif
-#ifdef TIOCM_RNG
- { XF86_M_RNG, TIOCM_RNG },
-#elif defined(TIOCM_RI)
- { XF86_M_CAR, TIOCM_RI },
-#endif
-#ifdef TIOCM_DSR
- { XF86_M_DSR, TIOCM_DSR },
-#endif
-};
-
-static int numStates = sizeof(modemStates) / sizeof(modemStates[0]);
-
-static int
-xf2osState(int state)
-{
- int i;
- int ret = 0;
-
- for (i = 0; i < numStates; i++)
- if (state & modemStates[i].xf)
- ret |= modemStates[i].os;
- return ret;
-}
-
-static int
-os2xfState(int state)
-{
- int i;
- int ret = 0;
-
- for (i = 0; i < numStates; i++)
- if (state & modemStates[i].os)
- ret |= modemStates[i].xf;
- return ret;
-}
-
-static int
-getOsStateMask(void)
-{
- int i;
- int ret = 0;
- for (i = 0; i < numStates; i++)
- ret |= modemStates[i].os;
- return ret;
-}
-
-static int osStateMask = 0;
-
-int
-xf86SetSerialModemState(int fd, int state)
-{
- int ret;
- int s;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
-#ifndef TIOCMGET
- return -1;
-#else
- if (!osStateMask)
- osStateMask = getOsStateMask();
-
- state = xf2osState(state);
- SYSCALL((ret = ioctl(fd, TIOCMGET, &s)));
- if (ret < 0)
- return -1;
- s &= ~osStateMask;
- s |= state;
- SYSCALL((ret = ioctl(fd, TIOCMSET, &s)));
- if (ret < 0)
- return -1;
- else
- return 0;
-#endif
-}
-
-int
-xf86GetSerialModemState(int fd)
-{
- int ret;
- int s;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
-#ifndef TIOCMGET
- return -1;
-#else
- SYSCALL((ret = ioctl(fd, TIOCMGET, &s)));
- if (ret < 0)
- return -1;
- return os2xfState(s);
-#endif
-}
-
-int
-xf86SerialModemSetBits(int fd, int bits)
-{
- int ret;
- int s;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
-#ifndef TIOCMGET
- return -1;
-#else
- s = xf2osState(bits);
- SYSCALL((ret = ioctl(fd, TIOCMBIS, &s)));
- return ret;
-#endif
-}
-
-int
-xf86SerialModemClearBits(int fd, int bits)
-{
- int ret;
- int s;
-
- if (fd < 0)
- return -1;
-
- /* Don't try to set parameters for non-tty devices. */
- if (!isatty(fd))
- return 0;
-
-#ifndef TIOCMGET
- return -1;
-#else
- s = xf2osState(bits);
- SYSCALL((ret = ioctl(fd, TIOCMBIC, &s)));
- return ret;
-#endif
-}
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
deleted file mode 100644
index fbab2a517..000000000
--- a/hw/xfree86/os-support/shared/sigio.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.16 2003/09/04 00:21:17 dawes Exp $ */
-
-/* sigio.c -- Support for SIGIO handler installation and removal
- * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
- */
-/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef XFree86Server
-# include "X.h"
-# include "xf86.h"
-# include "xf86drm.h"
-# include "xf86Priv.h"
-# include "xf86_OSlib.h"
-# include "xf86drm.h"
-# include "inputstr.h"
-#else
-# include <unistd.h>
-# include <signal.h>
-# include <fcntl.h>
-# include <sys/time.h>
-# include <errno.h>
-# include <stdio.h>
-# include <string.h>
-# define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-#endif
-
-/*
- * Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is
- * functional or not.
- */
-#if defined(FASYNC) && !defined(O_ASYNC)
-# define O_ASYNC FASYNC
-#endif
-
-#ifdef MAX_DEVICES
-/* MAX_DEVICES represents the maximimum number of input devices usable
- * at the same time plus one entry for DRM support.
- */
-# define MAX_FUNCS (MAX_DEVICES + 1)
-#else
-# define MAX_FUNCS 16
-#endif
-
-typedef struct _xf86SigIOFunc {
- void (*f) (int, void *);
- int fd;
- void *closure;
-} Xf86SigIOFunc;
-
-static Xf86SigIOFunc xf86SigIOFuncs[MAX_FUNCS];
-static int xf86SigIOMax;
-static int xf86SigIOMaxFd;
-static fd_set xf86SigIOMask;
-
-/*
- * SIGIO gives no way of discovering which fd signalled, select
- * to discover
- */
-static void
-xf86SIGIO (int sig)
-{
- int i;
- fd_set ready;
- struct timeval to;
- int r;
-
- ready = xf86SigIOMask;
- to.tv_sec = 0;
- to.tv_usec = 0;
- SYSCALL (r = select (xf86SigIOMaxFd, &ready, 0, 0, &to));
- for (i = 0; r > 0 && i < xf86SigIOMax; i++)
- if (xf86SigIOFuncs[i].f && FD_ISSET (xf86SigIOFuncs[i].fd, &ready))
- {
- (*xf86SigIOFuncs[i].f)(xf86SigIOFuncs[i].fd,
- xf86SigIOFuncs[i].closure);
- r--;
- }
-#ifdef XFree86Server
- if (r > 0) {
- xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r);
- }
-#endif
-}
-
-static int
-xf86IsPipe (int fd)
-{
- struct stat buf;
-
- if (fstat (fd, &buf) < 0)
- return 0;
- return S_ISFIFO(buf.st_mode);
-}
-
-int
-xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
-{
- struct sigaction sa;
- struct sigaction osa;
- int i;
- int blocked;
-
- for (i = 0; i < MAX_FUNCS; i++)
- {
- if (!xf86SigIOFuncs[i].f)
- {
- if (xf86IsPipe (fd))
- return 0;
- blocked = xf86BlockSIGIO();
- if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
-#ifdef XFree86Server
- xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
- fd, strerror(errno));
-#else
- fprintf(stderr,"fcntl(%d, O_ASYNC): %s\n",
- fd, strerror(errno));
-#endif
- xf86UnblockSIGIO(blocked);
- return 0;
- }
- if (fcntl(fd, F_SETOWN, getpid()) == -1) {
-#ifdef XFree86Server
- xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n",
- fd, strerror(errno));
-#else
- fprintf(stderr,"fcntl(%d, F_SETOWN): %s\n",
- fd, strerror(errno));
-#endif
- xf86UnblockSIGIO(blocked);
- return 0;
- }
- sigemptyset(&sa.sa_mask);
- sigaddset(&sa.sa_mask, SIGIO);
- sa.sa_flags = 0;
- sa.sa_handler = xf86SIGIO;
- sigaction(SIGIO, &sa, &osa);
- xf86SigIOFuncs[i].fd = fd;
- xf86SigIOFuncs[i].closure = closure;
- xf86SigIOFuncs[i].f = f;
- if (i >= xf86SigIOMax)
- xf86SigIOMax = i+1;
- if (fd >= xf86SigIOMaxFd)
- xf86SigIOMaxFd = fd + 1;
- FD_SET (fd, &xf86SigIOMask);
- xf86UnblockSIGIO(blocked);
- return 1;
- }
- /* Allow overwriting of the closure and callback */
- else if (xf86SigIOFuncs[i].fd == fd)
- {
- xf86SigIOFuncs[i].closure = closure;
- xf86SigIOFuncs[i].f = f;
- return 1;
- }
- }
- return 0;
-}
-
-int
-xf86RemoveSIGIOHandler(int fd)
-{
- struct sigaction sa;
- struct sigaction osa;
- int i;
- int max;
- int maxfd;
- int ret;
-
- max = 0;
- maxfd = -1;
- ret = 0;
- for (i = 0; i < MAX_FUNCS; i++)
- {
- if (xf86SigIOFuncs[i].f)
- {
- if (xf86SigIOFuncs[i].fd == fd)
- {
- xf86SigIOFuncs[i].f = 0;
- xf86SigIOFuncs[i].fd = 0;
- xf86SigIOFuncs[i].closure = 0;
- FD_CLR (fd, &xf86SigIOMask);
- ret = 1;
- }
- else
- {
- max = i + 1;
- if (xf86SigIOFuncs[i].fd >= maxfd)
- maxfd = xf86SigIOFuncs[i].fd + 1;
- }
- }
- }
- if (ret)
- {
- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC);
- xf86SigIOMax = max;
- xf86SigIOMaxFd = maxfd;
- if (!max)
- {
- sigemptyset(&sa.sa_mask);
- sigaddset(&sa.sa_mask, SIGIO);
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
- sigaction(SIGIO, &sa, &osa);
- }
- }
- return ret;
-}
-
-int
-xf86BlockSIGIO (void)
-{
- sigset_t set, old;
-
- sigemptyset (&set);
- sigaddset (&set, SIGIO);
- sigprocmask (SIG_BLOCK, &set, &old);
- return sigismember (&old, SIGIO);
-}
-
-void
-xf86UnblockSIGIO (int wasset)
-{
- sigset_t set;
-
- if (!wasset)
- {
- sigemptyset (&set);
- sigaddset (&set, SIGIO);
- sigprocmask (SIG_UNBLOCK, &set, NULL);
- }
-}
-
-#ifdef XFree86Server
-void
-xf86AssertBlockedSIGIO (char *where)
-{
- sigset_t set, old;
-
- sigemptyset (&set);
- sigprocmask (SIG_BLOCK, &set, &old);
- if (!sigismember (&old, SIGIO))
- xf86Msg (X_ERROR, "SIGIO not blocked at %s\n", where);
-}
-
-/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */
-
-int
-xf86SIGIOSupported (void)
-{
- return 1;
-}
-
-#endif
diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c
deleted file mode 100644
index 51f98f2a4..000000000
--- a/hw/xfree86/os-support/shared/sigiostubs.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.4 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef XFree86Server
-#ifdef __UNIXOS2__
-# define I_NEED_OS2_H
-#endif
-# include "X.h"
-# include "xf86.h"
-# include "xf86drm.h"
-# include "xf86Priv.h"
-# include "xf86_OSlib.h"
-# include "xf86drm.h"
-#else
-# include <unistd.h>
-# include <signal.h>
-# include <fcntl.h>
-# include <sys/time.h>
-# include <errno.h>
-#endif
-
-int
-xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
-{
- return 0;
-}
-
-int
-xf86RemoveSIGIOHandler(int fd)
-{
- return 0;
-}
-
-int
-xf86BlockSIGIO (void)
-{
- return 0;
-}
-
-void
-xf86UnblockSIGIO (int wasset)
-{
-}
-
-#ifdef XFree86Server
-void
-xf86AssertBlockedSIGIO (char *where)
-{
-}
-#endif
-
-/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */
-Bool
-xf86SIGIOSupported ()
-{
- return FALSE;
-}
-
diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c
deleted file mode 100644
index fd60ec509..000000000
--- a/hw/xfree86/os-support/shared/stdPci.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.4 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef __UNIXOS2__
-# define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86Pci.h"
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSlib.h"
-
-#ifndef HAVE_PCI_SIZE_FUNC
-#define xf86StdGetPciSizeFromOS xf86GetPciSizeFromOS
-#endif
-
-Bool
-xf86StdGetPciSizeFromOS(PCITAG tag, int index, int* bits)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
deleted file mode 100644
index df781c371..000000000
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.22 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Standard resource information code */
-
-#ifdef __UNIXOS2__
-# define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86Pci.h"
-#define NEED_OS_RAC_PROTOS
-#include "xf86_OSlib.h"
-#include "xf86Resources.h"
-
-#ifdef __UNIXOS2__
-# undef ADDRESS
-#endif
-/* Avoid Imakefile changes */
-#include "bus/Pci.h"
-
-#ifdef USESTDRES
-#define xf86StdBusAccWindowsFromOS xf86BusAccWindowsFromOS
-#define xf86StdAccResFromOS xf86AccResFromOS
-#define xf86StdPciBusAccWindowsFromOS xf86PciBusAccWindowsFromOS
-#define xf86StdIsaBusAccWindowsFromOS xf86IsaBusAccWindowsFromOS
-
-resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
-#endif
-
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
-resPtr
-xf86StdBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86StdPciBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86StdIsaBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
-xf86StdAccResFromOS(resPtr ret)
-{
- resRange range;
-
- /*
- * Fallback is to claim the following areas:
- *
- * 0x00000000 - 0x0009ffff low 640k host memory
- * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
- * 0x000f0000 - 0x000fffff system BIOS
- * 0x00100000 - 0x3fffffff low 1G - 1MB host memory
- * 0xfec00000 - 0xfecfffff default I/O APIC config space
- * 0xfee00000 - 0xfeefffff default Local APIC config space
- * 0xffe00000 - 0xffffffff high BIOS area (should this be included?)
- *
- * reference: Intel 440BX AGP specs
- *
- * The two APIC spaces appear to be BX-specific and should be dealt with
- * elsewhere.
- */
-
- /* Fallback is to claim 0x0 - 0x9ffff and 0x100000 - 0x7fffffff */
- RANGE(range, 0x00000000, 0x0009ffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x000f0000, 0x000fffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x00100000, 0x3fffffff,
- ResExcMemBlock | ResBios | ResEstimated);
- ret = xf86AddResToList(ret, &range, -1);
-#if 0
- RANGE(range, 0xfec00000, 0xfecfffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xfee00000, 0xfeefffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
-#endif
- RANGE(range, 0xffe00000, 0xffffffff, ResExcMemBlock | ResBios);
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
- * along with their sparse I/O aliases, but that's too imprecise. Instead
- * claim a bare minimum here.
- */
- RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
- ret = xf86AddResToList(ret, &range, -1);
-
- /*
- * At minimum, the top and bottom resources must be claimed, so that
- * resources that are (or appear to be) unallocated can be relocated.
- */
-/* RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1); */
- RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* XXX add others */
- return ret;
-}
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/shared/std_kbdEv.c b/hw/xfree86/os-support/shared/std_kbdEv.c
deleted file mode 100644
index 329346910..000000000
--- a/hw/xfree86/os-support/shared/std_kbdEv.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/std_kbdEv.c,v 3.3 1999/05/07 02:56:23 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Dawes makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: std_kbdEv.c /main/4 1996/03/11 10:47:33 kaleb $ */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-void
-xf86KbdEvents()
-{
- unsigned char rBuf[64];
- int nBytes, i;
-
- if ((nBytes = read( xf86Info.consoleFd, (char *)rBuf, sizeof(rBuf)))
- > 0)
- {
- for (i = 0; i < nBytes; i++)
- xf86PostKbdEvent(rBuf[i]);
- }
-}
-
diff --git a/hw/xfree86/os-support/shared/sysv_kbd.c b/hw/xfree86/os-support/shared/sysv_kbd.c
deleted file mode 100644
index 1bb2da386..000000000
--- a/hw/xfree86/os-support/shared/sysv_kbd.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c,v 3.4 1999/01/14 13:05:11 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Dawes <dawes@XFree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Dawes makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: sysv_kbd.c /main/3 1996/02/21 17:53:59 kaleb $ */
-
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-int
-xf86GetKbdLeds()
-{
- int leds;
-
- ioctl(xf86Info.consoleFd, KDGETLED, &leds);
- return(leds);
-}
-
-void
-xf86SetKbdRepeat(char rad)
-{
-#ifdef KDSETRAD
- ioctl(xf86Info.consoleFd, KDSETRAD, rad);
-#endif
-}
-
-static int kbdtrans;
-static struct termio kbdtty;
-static char *kbdemap = NULL;
-
-void
-xf86KbdInit()
-{
-#ifdef KDGKBMODE
- ioctl (xf86Info.consoleFd, KDGKBMODE, &kbdtrans);
-#endif
- ioctl (xf86Info.consoleFd, TCGETA, &kbdtty);
-#if defined(E_TABSZ) && !defined(SCO325)
- kbdemap = xalloc(E_TABSZ);
- if (ioctl(xf86Info.consoleFd, LDGMAP, kbdemap) < 0)
- {
- xfree(kbdemap);
- kbdemap = NULL;
- }
-#endif
-}
-
-int
-xf86KbdOn()
-{
- struct termio nTty;
-
- ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW);
- ioctl(xf86Info.consoleFd, LDNMAP, 0); /* disable mapping completely */
- nTty = kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8 | B9600;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME]=0;
- nTty.c_cc[VMIN]=1;
- ioctl(xf86Info.consoleFd, TCSETA, &nTty);
- return(xf86Info.consoleFd);
-}
-
-int
-xf86KbdOff()
-{
- if (kbdemap)
- {
- ioctl(xf86Info.consoleFd, LDSMAP, kbdemap);
- }
- ioctl(xf86Info.consoleFd, KDSKBMODE, kbdtrans);
- ioctl(xf86Info.consoleFd, TCSETA, &kbdtty);
- return(xf86Info.consoleFd);
-}
diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c
deleted file mode 100644
index aed735680..000000000
--- a/hw/xfree86/os-support/shared/vidmem.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.17 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 1993-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-#ifdef __UNIXOS2__
-# define I_NEED_OS2_H
-#endif
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-/*
- * This file contains the common part of the video memory mapping functions
- */
-
-/*
- * Get a piece of the ScrnInfoRec. At the moment, this is only used to hold
- * the MTRR option information, but it is likely to be expanded if we do
- * auto unmapping of memory at VT switch.
- *
- */
-
-typedef struct {
- unsigned long physBase;
- unsigned long size;
- pointer virtBase;
- pointer mtrrInfo;
- int flags;
-} MappingRec, *MappingPtr;
-
-typedef struct {
- int numMappings;
- MappingPtr * mappings;
- Bool mtrrEnabled;
- MessageType mtrrFrom;
- Bool mtrrOptChecked;
- ScrnInfoPtr pScrn;
-} VidMapRec, *VidMapPtr;
-
-static int vidMapIndex = -1;
-
-#define VIDMAPPTR(p) ((VidMapPtr)((p)->privates[vidMapIndex].ptr))
-
-static VidMemInfo vidMemInfo = {FALSE, };
-static VidMapRec vidMapRec = {0, NULL, TRUE, X_DEFAULT, FALSE, NULL};
-
-static VidMapPtr
-getVidMapRec(int scrnIndex)
-{
- VidMapPtr vp;
- ScrnInfoPtr pScrn;
-
- if ((scrnIndex < 0) ||
- !(pScrn = xf86Screens[scrnIndex]))
- return &vidMapRec;
-
- if (vidMapIndex < 0)
- vidMapIndex = xf86AllocateScrnInfoPrivateIndex();
-
- if (VIDMAPPTR(pScrn) != NULL)
- return VIDMAPPTR(pScrn);
-
- vp = pScrn->privates[vidMapIndex].ptr = xnfcalloc(sizeof(VidMapRec), 1);
- vp->mtrrEnabled = TRUE; /* default to enabled */
- vp->mtrrFrom = X_DEFAULT;
- vp->mtrrOptChecked = FALSE;
- vp->pScrn = pScrn;
- return vp;
-}
-
-static MappingPtr
-newMapping(VidMapPtr vp)
-{
- vp->mappings = xnfrealloc(vp->mappings, sizeof(MappingPtr) *
- (vp->numMappings + 1));
- vp->mappings[vp->numMappings] = xnfcalloc(sizeof(MappingRec), 1);
- return vp->mappings[vp->numMappings++];
-}
-
-static MappingPtr
-findMapping(VidMapPtr vp, pointer vbase, unsigned long size)
-{
- int i;
-
- for (i = 0; i < vp->numMappings; i++) {
- if (vp->mappings[i]->virtBase == vbase &&
- vp->mappings[i]->size == size)
- return vp->mappings[i];
- }
- return NULL;
-}
-
-static void
-removeMapping(VidMapPtr vp, MappingPtr mp)
-{
- int i, found = 0;
-
- for (i = 0; i < vp->numMappings; i++) {
- if (vp->mappings[i] == mp) {
- found = 1;
- xfree(vp->mappings[i]);
- } else if (found) {
- vp->mappings[i - 1] = vp->mappings[i];
- }
- }
- vp->numMappings--;
- vp->mappings[vp->numMappings] = NULL;
-}
-
-enum { OPTION_MTRR };
-static const OptionInfoRec opts[] =
-{
- { OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
-};
-
-static void
-checkMtrrOption(VidMapPtr vp)
-{
- if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) {
- OptionInfoPtr options;
-
- options = xnfalloc(sizeof(opts));
- (void)memcpy(options, opts, sizeof(opts));
- xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options,
- options);
- if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled))
- vp->mtrrFrom = X_CONFIG;
- xfree(options);
- vp->mtrrOptChecked = TRUE;
- }
-}
-
-void
-xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base, unsigned long Size, pointer Vbase)
-{
- VidMapPtr vp;
- MappingPtr mp;
-
- vp = getVidMapRec(ScreenNum);
- mp = newMapping(vp);
- mp->physBase = Base;
- mp->size = Size;
- mp->virtBase = Vbase;
- mp->flags = Flags;
-}
-
-void
-xf86InitVidMem(void)
-{
- if (!vidMemInfo.initialised) {
- memset(&vidMemInfo, 0, sizeof(VidMemInfo));
- xf86OSInitVidMem(&vidMemInfo);
- }
-}
-
-pointer
-xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
-{
- pointer vbase = NULL;
- VidMapPtr vp;
- MappingPtr mp;
-
- if (((Flags & VIDMEM_FRAMEBUFFER) &&
- (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))))
- FatalError("Mapping memory with more than one type\n");
-
- xf86InitVidMem();
- if (!vidMemInfo.initialised || !vidMemInfo.mapMem)
- return NULL;
-
- vbase = vidMemInfo.mapMem(ScreenNum, Base, Size, Flags);
-
- if (!vbase || vbase == (pointer)-1)
- return NULL;
-
- vp = getVidMapRec(ScreenNum);
- mp = newMapping(vp);
- mp->physBase = Base;
- mp->size = Size;
- mp->virtBase = vbase;
- mp->flags = Flags;
-
- /*
- * Check the "mtrr" option even when MTRR isn't supported to avoid
- * warnings about unrecognised options.
- */
- checkMtrrOption(vp);
-
- if (vp->mtrrEnabled && vidMemInfo.setWC) {
- if (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))
- mp->mtrrInfo =
- vidMemInfo.setWC(ScreenNum, Base, Size, FALSE,
- vp->mtrrFrom);
- else if (Flags & VIDMEM_FRAMEBUFFER)
- mp->mtrrInfo =
- vidMemInfo.setWC(ScreenNum, Base, Size, TRUE,
- vp->mtrrFrom);
- }
- return vbase;
-}
-
-void
-xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- VidMapPtr vp;
- MappingPtr mp;
-
- if (!vidMemInfo.initialised || !vidMemInfo.unmapMem) {
- xf86DrvMsg(ScreenNum, X_WARNING,
- "xf86UnMapVidMem() called before xf86MapVidMem()\n");
- return;
- }
-
- vp = getVidMapRec(ScreenNum);
- mp = findMapping(vp, Base, Size);
- if (!mp) {
- xf86DrvMsg(ScreenNum, X_WARNING,
- "xf86UnMapVidMem: cannot find region for [%p,0x%lx]\n",
- Base, Size);
- return;
- }
- if (vp->mtrrEnabled && vidMemInfo.undoWC && mp)
- vidMemInfo.undoWC(ScreenNum, mp->mtrrInfo);
-
- vidMemInfo.unmapMem(ScreenNum, Base, Size);
- removeMapping(vp, mp);
-}
-
-Bool
-xf86CheckMTRR(int ScreenNum)
-{
- VidMapPtr vp = getVidMapRec(ScreenNum);
-
- /*
- * Check the "mtrr" option even when MTRR isn't supported to avoid
- * warnings about unrecognised options.
- */
- checkMtrrOption(vp);
-
- if (vp->mtrrEnabled && vidMemInfo.setWC)
- return TRUE;
-
- return FALSE;
-}
-
-Bool
-xf86LinearVidMem()
-{
- xf86InitVidMem();
- return vidMemInfo.linearSupported;
-}
-
-void
-xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base,
- unsigned long Size)
-{
- if (!(Flags & VIDMEM_READSIDEEFFECT))
- return;
-
- if (!vidMemInfo.initialised || !vidMemInfo.readSideEffects)
- return;
-
- vidMemInfo.readSideEffects(ScreenNum, base, Size);
-}
-
diff --git a/hw/xfree86/os-support/shared/xf86Axp.c b/hw/xfree86/os-support/shared/xf86Axp.c
deleted file mode 100644
index 42edbc53c..000000000
--- a/hw/xfree86/os-support/shared/xf86Axp.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.3 2003/08/24 17:37:06 dawes Exp $ */
-/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#include "xf86Axp.h"
-
-axpParams xf86AXPParams[] = {
- {SYS_NONE, 0, 0, 0},
- {TSUNAMI, 0, 0, 0},
- {LCA, 1<<24,0xf8000000, 1UL << 32},
- {APECS, 1<<24,0xf8000000, 1UL << 32},
- {T2, 0,0xFC000000, 1UL << 31},
- {T2_GAMMA, 0,0xFC000000, 1UL << 31},
- {CIA, 0,0xE0000000, 1UL << 34},
- {MCPCIA, 0,0xf8000000, 1UL << 31},
- {JENSEN, 0, 0xE000000, 1UL << 32},
- {POLARIS, 0, 0, 0},
- {PYXIS, 0, 0, 0},
- {PYXIS_CIA, 0,0xE0000000, 1UL << 34},
- {IRONGATE, 0, 0, 0}
-};
-
diff --git a/hw/xfree86/os-support/shared/xf86Axp.h b/hw/xfree86/os-support/shared/xf86Axp.h
deleted file mode 100644
index e63619e3a..000000000
--- a/hw/xfree86/os-support/shared/xf86Axp.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.h,v 1.3 2001/02/15 19:46:03 eich Exp $ */
-
-#ifndef _XF86_AXP_H_
-#define _XF86_AXP_H_
-
-typedef enum {
- SYS_NONE,
- TSUNAMI,
- LCA,
- APECS,
- T2,
- T2_GAMMA,
- CIA,
- MCPCIA,
- JENSEN,
- POLARIS,
- PYXIS,
- PYXIS_CIA,
- IRONGATE
-} axpDevice;
-
-typedef struct {
- axpDevice id;
- unsigned long hae_thresh;
- unsigned long hae_mask;
- unsigned long size;
-} axpParams;
-
-extern axpParams xf86AXPParams[];
-
-#endif
-
diff --git a/hw/xfree86/os-support/solaris/apSolaris.shar b/hw/xfree86/os-support/solaris/apSolaris.shar
deleted file mode 100644
index 33cecdc4d..000000000
--- a/hw/xfree86/os-support/solaris/apSolaris.shar
+++ /dev/null
@@ -1,768 +0,0 @@
-#!/bin/sh
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/apSolaris.shar,v 1.3 2002/10/04 19:45:33 tsi Exp $
-# This is a shell archive (produced by GNU sharutils 4.2c).
-# To extract the files from this archive, save it to some FILE, remove
-# everything before the `!/bin/sh' line above, then type `sh FILE'.
-#
-# Made on 2002-10-04 13:41 MDT by <root@abcyxhiz>.
-# Source directory was `/archives'.
-#
-# Existing files will *not* be overwritten unless `-c' is specified.
-# This format requires very little intelligence at unshar time.
-# "if test", "echo", "mkdir", and "sed" may be needed.
-#
-# This shar contains:
-# length mode name
-# ------ ---------- ------------------------------------------
-# 1521 -rw-r--r-- aperture/Makefile
-# 1659 -rw-r--r-- aperture/README
-# 7557 -rw-r--r-- aperture/aperture.c
-# 450 -rw-r--r-- aperture/aperture.conf
-# 87 -rw-r--r-- aperture/devlink.tab
-# 1062 -rw-r--r-- aperture/Makefile.sun4u
-#
-echo=echo
-shar_tty= shar_n= shar_c='
-'
-mkdir _sh09806 || ( echo 'failed to create locking directory' '_sh09806'; exit 1 )
-# ============= aperture/Makefile ==============
-if test ! -d 'aperture'; then
- $echo $echo_n 'x -' 'aperture: '$echo_c
- if mkdir 'aperture'; then $echo 'created'; else $echo 'failed to create'; fi
-fi
-if test -f 'aperture/Makefile' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/Makefile' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/Makefile' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile' &&
-X#
-X# File: makefile for aperture Framebuffer Driver
-X# Author: Doug Anson (danson@lgc.com)
-X# Date: 2/15/94
-X# Modified: David Holland (davidh@use.com)
-X# Date: 2/23/94
-X# - Changed name, and debugging structure
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Date: 2001.06.08
-X# - SPARC support, cleanup and turf aptest.
-X#
-X# >>NOTE<< Have a look at Makefile.sun4u for sun4u specifics.
-X#
-X# GNU gcc compiler
-XCC=gcc
-XCFLGS=-fno-builtin -Wall -O3
-X
-X#
-X# Proworks compiler
-X#CC=/opt/SUNWspro/bin/cc
-X#CFLGS=-Xa -xnolib -xO3
-X
-X#
-X# Debug error reporting
-X#DEBUG_FLG=
-X#DEBUG_FLG=-DAPERTURE_DEBUG
-X
-X#
-X# Files and object declarations
-XKERNEL_FLGS=-D_KERNEL -DSUNDDI
-XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-XCFILES= aperture.c
-XOBJS= aperture.o
-XDRIVER= aperture
-X
-X#
-X# Make rules
-Xall: $(DRIVER)
-X
-X$(DRIVER): $(OBJS)
-X @if [ -f "Makefile.`uname -m`" ]; then \
-X make -f Makefile.`uname -m` $(DRIVER); \
-X else \
-X rm -f $(DRIVER); \
-X ld -r -o $(DRIVER) $(OBJS); \
-X fi
-X
-Xinstall: $(DRIVER)
-X @if [ -f "Makefile.`uname -m`" ]; then \
-X make -f Makefile.`uname -m` install; \
-X else \
-X cp aperture.conf /kernel/drv; \
-X cp $(DRIVER) /kernel/drv; \
-X fi
-X
-Xadd_drv:
-X @if [ -f "Makefile.`uname -m`" ]; then \
-X make -f Makefile.`uname -m` add_drv; \
-X else \
-X add_drv /kernel/drv/aperture; \
-X fi
-X
-Xclean:
-X rm -f *% *.BAK $(OBJS) $(DRIVER) core
-X
-X.SUFFIXES: .i
-X
-X.c.i:
-X $(CC) -E $(CFLAGS) $*.c > $@
-X
-X.c.o:
-X @if [ -f "Makefile.`uname -m`" ]; then \
-X make -f Makefile.`uname -m` $@; \
-X else \
-X rm -f $@; \
-X $(CC) -c $(CFLAGS) $*.c -o $@; \
-X fi
-SHAR_EOF
- : || $echo 'restore of' 'aperture/Makefile' 'failed'
-fi
-# ============= aperture/README ==============
-if test -f 'aperture/README' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/README' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/README' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/README' &&
-XFramebuffer apperture driver.
-X
-XThis driver was written to provide a device that, unlike /dev/mem, allows
-Xmmap()'ing of ranges beyond installed memory.
-X
-XThe original x86-based version of this driver was the corroborative work of
-XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
-Xbeen rewritten to also work on sun4u machines.
-X
-X
-XInstallation instructions:
-X
-X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling
-X with APERTURE_DEBUG defined means the driver will generate reams of
-X debugging output. You'll probably want to leave this off...
-X
-X2) type 'make'. The driver and test program should compile with out any
-X problems. There also should not be any warning messages.
-X
-X3) Become 'root'.
-X
-X4) type 'make install' and 'make add_drv'. The screen should look something
-X like this:
-X
-X # make install
-X cp aperture aperture.conf /kernel/drv
-X # make add_drv
-X add_drv /kernel/drv/aperture
-X
-X On a sun4u machine this will mention the /kernel/drv/sparcv9 directory
-X instead of /kernel/drv.
-X
-X This installs the driver in the system.
-X
-X5) While as root modify the file /etc/devlink.tab, adding these lines:
-X
-X# The following entry is for the framebuffer driver
-Xtype=ddi_pseudo;name=aperture fbs/\M0
-X
-X Add that line exactly as shown. You may also simply add the
-X contents of the devlink.tab file supplied to /etc/devlink.tab.
-X It contains the lines as well. (Yes, that is a tab between
-X aperture, and fbs, not spaces - very important)
-X
-X6) Perform a reconfiguration boot of the system.
-X
-X # touch /reconfigure
-X # init 6
-X
-XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
-SHAR_EOF
- : || $echo 'restore of' 'aperture/README' 'failed'
-fi
-# ============= aperture/aperture.c ==============
-if test -f 'aperture/aperture.c' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/aperture.c' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/aperture.c' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.c' &&
-X/*
-X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
-X *
-X * Permission is hereby granted, free of charge, to any person obtaining a copy
-X * of this software and associated documentation files (the "Software"), to
-X * deal in the Software without restriction, including without limitation the
-X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-X * sell copies of the Software, and to permit persons to whom the Software is
-X * furnished to do so, subject to the following conditions:
-X *
-X * The above copyright notice and this permission notice shall be included in
-X * all copies or substantial portions of the Software.
-X *
-X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-X *
-X * Except as contained in this notice, the name of the XFree86 Project shall
-X * not be used in advertising or otherwise to promote the sale, use or other
-X * dealings in this Software without prior written authorization from the
-X * XFree86 Project.
-X */
-X
-X/*
-X * Aperture driver for Solaris.
-X */
-X
-X#include <sys/conf.h>
-X#include <sys/ddi.h>
-X#include <sys/modctl.h>
-X#include <sys/open.h>
-X#include <sys/stat.h>
-X#include <sys/sunddi.h>
-X
-X#define DEV_IDENT "aperture"
-X#define DEV_BANNER "XFree86 aperture driver"
-X
-X#ifndef D_64BIT
-X#define D_64BIT 0
-X#endif
-X
-X#ifndef NULL
-X#define NULL ((void *)0)
-X#endif
-X
-X/*
-X * open(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_open
-X(
-X#ifdef __STDC__
-X dev_t *devp,
-X int flag,
-X int typ,
-X struct cred *cred
-X#endif
-X)
-X#ifndef __STDC__
-X dev_t *devp;
-X int flag;
-X int typ;
-X struct cred *cred;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
-X
-X#endif
-X
-X if ((typ != OTYP_CHR) || (getminor(*devp)))
-X error = EINVAL;
-X else
-X error = 0;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * mmap(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_mmap
-X(
-X#ifdef __STDC__
-X dev_t dev,
-X off_t off,
-X int prot
-X#endif
-X)
-X#ifndef __STDC__
-X dev_t dev;
-X off_t off;
-X int prot;
-X#endif
-X{
-X pfn_t pf;
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
-X
-X#endif
-X
-X pf = btop((unsigned long)off);
-X
-X /* Deal with mmap(9E) interface limits */
-X error = (int)pf;
-X if ((error < 0) || (pf != (pfn_t)error))
-X error = -1;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-Xstatic struct cb_ops aperture_cb_ops =
-X{
-X aperture_open, /* open */
-X nulldev, /* close */
-X nodev, /* strategy */
-X nodev, /* print */
-X nodev, /* dump */
-X nodev, /* read */
-X nodev, /* write */
-X nodev, /* ioctl */
-X nodev, /* devmap */
-X aperture_mmap, /* mmap */
-X ddi_segmap, /* segmap */
-X nochpoll, /* poll */
-X ddi_prop_op, /* cb_prop_op */
-X 0, /* streamtab */
-X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
-X};
-X
-X
-Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */
-X
-X/*
-X * getinfo(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_getinfo
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_info_cmd_t infocmd,
-X void *arg,
-X void **result
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_info_cmd_t infocmd;
-X void *arg;
-X void **result;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
-X
-X#endif
-X
-X switch (infocmd) {
-X case DDI_INFO_DEVT2DEVINFO:
-X *result = aperture_dip;
-X error = DDI_SUCCESS;
-X break;
-X case DDI_INFO_DEVT2INSTANCE:
-X *result = NULL;
-X error = DDI_SUCCESS;
-X break;
-X default:
-X error = DDI_FAILURE;
-X }
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * identify(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_identify
-X(
-X#ifdef __STDC__
-X dev_info_t *dip
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
-X
-X#endif
-X
-X if (strcmp(ddi_get_name(dip), DEV_IDENT))
-X error = DDI_NOT_IDENTIFIED;
-X else
-X error = DDI_IDENTIFIED;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * attach(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_attach
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_attach_cmd_t cmd
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_attach_cmd_t cmd;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
-X
-X#endif
-X
-X if (cmd != DDI_ATTACH)
-X {
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
-X
-X#endif
-X
-X error = DDI_FAILURE;
-X }
-X else
-X {
-X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR,
-X (minor_t)ddi_get_instance(dip),
-X NULL, NODESPECIFIC_DEV);
-X
-X if (error == DDI_SUCCESS)
-X {
-X aperture_dip = dip;
-X ddi_report_dev(dip);
-X }
-X }
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * detach(9E)
-X */
-Xstatic int
-Xaperture_detach
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_detach_cmd_t cmd
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_detach_cmd_t cmd;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
-X
-X#endif
-X
-X if (cmd != DDI_DETACH)
-X {
-X error = DDI_FAILURE;
-X }
-X else
-X {
-X ddi_remove_minor_node(dip, NULL);
-X aperture_dip = NULL;
-X error = DDI_SUCCESS;
-X }
-X
-X#if APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X
-Xstatic struct dev_ops aperture_ops =
-X{
-X DEVO_REV, /* revision */
-X 0, /* refcnt */
-X aperture_getinfo, /* getinfo */
-X aperture_identify, /* identify */
-X nulldev, /* probe */
-X aperture_attach, /* attach */
-X aperture_detach, /* detach */
-X nodev, /* reset */
-X &aperture_cb_ops, /* driver operations */
-X NULL /* bus operations */
-X};
-X
-X
-Xstatic struct modldrv modldrv =
-X{
-X &mod_driverops, /* mod_ops structure pointer */
-X DEV_BANNER, /* driver banner string */
-X &aperture_ops, /* dev_ops structure pointer */
-X};
-X
-X
-Xstatic struct modlinkage modlinkage =
-X{
-X MODREV_1, /* module API revision */
-X {
-X &modldrv, /* module driver structure pointer */
-X NULL /* list termination */
-X }
-X};
-X
-X
-X/*
-X * _init(9E)
-X */
-Xint
-X_init
-X(
-X#ifdef __STDC__
-X void
-X#endif
-X)
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
-X
-X#endif
-X
-X error = mod_install(&modlinkage);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * _info(9E)
-X */
-Xint
-X_info
-X(
-X#ifdef __STDC__
-X struct modinfo *modinfop
-X#endif
-X)
-X#ifndef __STDC__
-X struct modinfo *modinfop;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
-X
-X#endif
-X
-X error = mod_info(&modlinkage, modinfop);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * _fini(9E)
-X */
-Xint
-X_fini
-X(
-X#ifdef __STDC__
-X void
-X#endif
-X)
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
-X
-X#endif
-X
-X error = mod_remove(&modlinkage);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-SHAR_EOF
- : || $echo 'restore of' 'aperture/aperture.c' 'failed'
-fi
-# ============= aperture/aperture.conf ==============
-if test -f 'aperture/aperture.conf' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/aperture.conf' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/aperture.conf' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.conf' &&
-X#
-X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-X#
-X# File: aperture.conf
-X# Author: Doug Anson (danson@lgc.com)
-X#
-X# Modified: David Holland (davidh@use.com)
-X# Log: Change comments 02/23/94
-X# Change defaults/comments 09/25/94
-X#
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Log: SPARC changes 2001.09
-X#
-X# Purpose: This conf file is used by the aperture driver.
-X#
-Xname="aperture" parent="pseudo";
-SHAR_EOF
- : || $echo 'restore of' 'aperture/aperture.conf' 'failed'
-fi
-# ============= aperture/devlink.tab ==============
-if test -f 'aperture/devlink.tab' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/devlink.tab' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/devlink.tab' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/devlink.tab' &&
-X# The following entry is for the aperture driver
-Xtype=ddi_pseudo;name=aperture fbs/\M0
-SHAR_EOF
- : || $echo 'restore of' 'aperture/devlink.tab' 'failed'
-fi
-# ============= aperture/Makefile.sun4u ==============
-if test -f 'aperture/Makefile.sun4u' && test "$first_param" != -c; then
- $echo 'x -' SKIPPING 'aperture/Makefile.sun4u' '(file already exists)'
-else
- $echo 'x -' extracting 'aperture/Makefile.sun4u' '(text)'
- sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile.sun4u' &&
-X#
-X# File: makefile for aperture Framebuffer Driver
-X# Author: Doug Anson (danson@lgc.com)
-X# Date: 2/15/94
-X# Modified: David Holland (davidh@use.com)
-X# Date: 2/23/94
-X# - Changed name, and debugging structure
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Date: 2001.06.08
-X# - SPARC support, cleanup and turf aptest.
-X#
-X
-X#
-X# GNU gcc compiler, version 3.2 or later
-X#
-XCC=gcc
-XCFLGS=-fno-builtin -Wall -O3 -m64
-X
-X#
-X# Proworks compiler
-X#CC=/opt/SUNWspro/bin/cc
-X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
-X
-X#
-X# Debug error reporting
-X#DEBUG_FLG=
-X#DEBUG_FLG=-DAPERTURE_DEBUG
-X
-X#
-X# Files and object declarations
-XKERNEL_FLGS=-D_KERNEL -DSUNDDI
-XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-XCFILES= aperture.c
-XOBJS= aperture.o
-XDRIVER= aperture
-X
-X#
-X# Make rules
-Xall: $(DRIVER)
-X
-X$(DRIVER): $(OBJS)
-X rm -f $(DRIVER)
-X ld -r -o $(DRIVER) $(OBJS)
-X
-Xinstall: $(DRIVER)
-X cp aperture.conf /kernel/drv
-X cp $(DRIVER) /kernel/drv/sparcv9
-X
-Xadd_drv:
-X add_drv /kernel/drv/sparcv9/aperture
-X
-Xclean:
-X rm -f *% *.BAK $(OBJS) $(DRIVER) core
-X
-X.SUFFIXES: .i
-X
-X.c.i:
-X $(CC) -E $(CFLAGS) $*.c > $@
-SHAR_EOF
- : || $echo 'restore of' 'aperture/Makefile.sun4u' 'failed'
-fi
-$echo $shar_n 'x -' 'lock directory' "\`_sh09806': " $shar_c
-if rm -fr _sh09806; then
- $echo 'removed'
-else
- $echo 'failed to remove'
-fi
-exit 0
diff --git a/hw/xfree86/os-support/solaris/sun_bios.c b/hw/xfree86/os-support/solaris/sun_bios.c
deleted file mode 100644
index e93e0e9dd..000000000
--- a/hw/xfree86/os-support/solaris/sun_bios.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.3 2003/11/07 13:45:27 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- * Copyright 1999 by David Holland <davidh@iquest.net>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- * SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#ifdef i386
-#define _NEED_SYSI86
-#endif
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-extern char *apertureDevName;
-
-/*
- * Read BIOS via mmap()ing physical memory.
- */
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- int fd;
- unsigned char *ptr;
- char solx86_vtname[20];
- int psize;
- int mlen;
-
- /*
- * Solaris 2.1 x86 SVR4 (10/27/93)
- * The server must treat the virtual terminal device file
- * as the standard SVR4 /dev/pmem. By default, then used VT
- * is considered the "default" file to open.
- *
- * Solaris 2.8 x86 (7/26/99) - DWH
- *
- * Use /dev/xsvc for everything.
- */
- psize = xf86getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
-#if defined(i386) && !defined(__SOL8__)
- if (Base >= 0xA0000 && Base + mlen < 0xFFFFF && xf86Info.vtno >= 0)
- sprintf(solx86_vtname, "/dev/vt%02d", xf86Info.vtno);
- else
-#endif
- {
- if (!xf86LinearVidMem())
- FatalError("xf86ReadBIOS: Could not mmap BIOS"
- " [a=%lx]\n", Base);
- sprintf(solx86_vtname, apertureDevName);
- }
-
- if ((fd = open(solx86_vtname, O_RDONLY)) < 0)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
- solx86_vtname, strerror(errno));
- return(-1);
- }
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, fd, (off_t)Base);
- if (ptr == MAP_FAILED)
- {
- xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed "
- "[0x%08lx, 0x%04x]\n",
- solx86_vtname, Base, mlen);
- close(fd);
- return -1;
- }
-
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
- (void)close(fd);
-
- return Len;
-}
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
deleted file mode 100644
index b08529a00..000000000
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_init.c,v 1.6 2002/06/06 13:49:34 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- * Copyright 1999 by David Holland <davidh@iquest.net>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static Bool KeepTty = FALSE;
-static Bool Protect0 = FALSE;
-#ifdef HAS_USL_VTS
-static int VTnum = -1;
-static int xf86StartVT = -1;
-#endif
-
-static char fb_dev[PATH_MAX] = "/dev/console";
-
-void
-xf86OpenConsole(void)
-{
-#ifdef HAS_USL_VTS
- int fd, i;
- struct vt_mode VT;
- struct vt_stat vtinfo;
- int FreeVTslot;
- MessageType from = X_PROBED;
-#endif
-
- if (serverGeneration == 1)
- {
- /* Check if we're run with euid==0 */
- if (geteuid() != 0)
- FatalError("xf86OpenConsole: Server must be suid root\n");
-
- /* Protect page 0 to help find NULL dereferencing */
- /* mprotect() doesn't seem to work */
- if (Protect0)
- {
- int fd = -1;
-
- if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: cannot open /dev/zero (%s)\n",
- strerror(errno));
- }
- else
- {
- if ((int)mmap(0, 0x1000, PROT_NONE,
- MAP_FIXED | MAP_SHARED, fd, 0) == -1)
- xf86Msg(X_WARNING,
- "xf86OpenConsole: failed to protect page 0 (%s)\n",
- strerror(errno));
-
- close(fd);
- }
- }
-
-#ifdef HAS_USL_VTS
-
- /*
- * Setup the virtual terminal manager
- */
- if (VTnum != -1)
- {
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
- }
- else
- {
- if ((fd = open("/dev/vt00",O_RDWR,0)) < 0)
- FatalError("xf86OpenConsole: Cannot open /dev/vt00 (%s)\n",
- strerror(errno));
-
- if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
- FatalError("xf86OpenConsole: Cannot determine current VT\n");
-
- xf86StartVT = vtinfo.v_active;
-
- /*
- * There is a SEVERE problem with x86's VT's. The VT_OPENQRY
- * ioctl() will panic the entire system if all 8 (7 VT's+Console)
- * terminals are used. The only other way I've found to determine
- * if there is a free VT is to try activating all the the available
- * VT's and see if they all succeed - if they do, there there is no
- * free VT, and the Xserver cannot continue without panic'ing the
- * system. (It's ugly, but it seems to work.) Note there is a
- * possible race condition here.
- *
- * David Holland 2/23/94
- */
-
- FreeVTslot = 0;
- for (i = 7; (i >= 0) && !FreeVTslot; i--)
- if (ioctl(fd, VT_ACTIVATE, i) != 0)
- FreeVTslot = 1;
-
- if (!FreeVTslot ||
- (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1))
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
-
- close(fd);
- }
-
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
-
- sprintf(fb_dev, "/dev/vt%02d", xf86Info.vtno); /* Solaris 2.1 x86 */
-
-#endif /* HAS_USL_VTS */
-
- if (!KeepTty)
- setpgrp();
-
- if (((xf86Info.consoleFd = open(fb_dev, O_RDWR | O_NDELAY, 0)) < 0))
- FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
- fb_dev, strerror(errno));
-
-#ifdef HAS_USL_VTS
-
- /* Change ownership of the vt */
- chown(fb_dev, getuid(), getgid());
-
- /*
- * Now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
-
- signal(SIGUSR1, xf86VTRequest);
-
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
-
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
-
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
- }
- else /* serverGeneration != 1 */
- {
- /*
- * Now re-get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
-
- /*
- * If the server doesn't have the VT when the reset occurs,
- * this is to make sure we don't continue until the activate
- * signal is received.
- */
- if (!xf86Screens[0]->vtSema)
- sleep(5);
-
-#endif /* HAS_USL_VTS */
-
- }
-}
-
-void
-xf86CloseConsole(void)
-{
-#ifdef HAS_USL_VTS
- struct vt_mode VT;
-#endif
-#if defined(__SOL8__) || !defined(i386)
- int tmp;
-#endif
-
-#ifndef i386
-
- if (!xf86DoProbe && !xf86DoConfigure) {
- int fd;
-
- /*
- * Wipe out framebuffer just like the non-SI Xsun server does. This
- * could be improved by saving framebuffer contents in
- * xf86OpenConsole() above and restoring them here. Also, it's unclear
- * at this point whether this should be done for all framebuffers in
- * the system, rather than only the console.
- */
- if ((fd = open("/dev/fb", O_RDWR, 0)) < 0) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to open framebuffer (%s)\n",
- strerror(errno));
- } else {
- struct fbgattr fbattr;
-
- if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) &&
- (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to retrieve framebuffer"
- " attributes (%s)\n", strerror(errno));
- } else {
- pointer fbdata;
-
- fbdata = mmap(NULL, fbattr.fbtype.fb_size,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (fbdata == MAP_FAILED) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to mmap framebuffer"
- " (%s)\n", strerror(errno));
- } else {
- (void)memset(fbdata, 0, fbattr.fbtype.fb_size);
- (void)munmap(fbdata, fbattr.fbtype.fb_size);
- }
- }
-
- close(fd);
- }
- }
-
-#endif
-
-#ifdef HAS_USL_VTS
-
- /*
- * Solaris 2.1 x86 doesn't seem to "switch" back to the console when the VT
- * is relinquished and its mode is reset to auto. Also, Solaris 2.1 seems
- * to associate vt00 with the console so I've opened the "console" back up
- * and made it the active vt again in text mode and then closed it. There
- * must be a better hack for this but I'm not aware of one at this time.
- *
- * Doug Anson 11/6/93
- * danson@lgc.com
- *
- * Fixed - 12/5/93 - David Holland - davidh@dorite.use.com
- * Did the whole thing similarly to the way linux does it
- */
-
- /* Reset the display back to text mode */
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO; /* Set default vt handling */
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
- }
-
- /* Activate the VT that X was started on */
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
-
-#endif /* HAS_USL_VTS */
-
- close(xf86Info.consoleFd);
-
-#if defined(__SOL8__) || !defined(i386)
-
- /*
- * This probably shouldn't be here. However, there is no corresponding
- * xf86CloseKbd() routine - DWH
- */
-
- /* Set the keyboard into "indirect" mode and turn off even translation */
- tmp = 0;
- (void) ioctl(xf86Info.kbdFd, KIOCSDIRECT, &tmp);
- tmp = TR_ASCII;
- (void) ioctl(xf86Info.kbdFd, KIOCTRANS, &tmp);
-
- close(xf86Info.kbdFd);
-
-#endif
-}
-
-int
-xf86ProcessArgument(int argc, char **argv, int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful when
- * debugging, so the server can receive keyboard signals.
- */
- if (!strcmp(argv[i], "-keeptty"))
- {
- KeepTty = TRUE;
- return 1;
- }
-
- /*
- * Undocumented flag to protect page 0 from read/write to help catch NULL
- * pointer dereferences. This is purely a debugging flag.
- */
- if (!strcmp(argv[i], "-protect0"))
- {
- Protect0 = TRUE;
- return 1;
- }
-
-#ifdef HAS_USL_VTS
-
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
- {
- UseMsg();
- VTnum = -1;
- return 0;
- }
-
- return 1;
- }
-
-#endif /* HAS_USL_VTS */
-
-#if defined(__SOL8__) || !defined(i386)
-
- if ((i + 1) < argc) {
- if (!strcmp(argv[i], "-dev")) {
- strncpy(fb_dev, argv[i+1], PATH_MAX);
- fb_dev[PATH_MAX - 1] = '\0';
- return 2;
- }
-
- if (!strcmp(argv[i], "-ar1")) {
- xf86Info.kbdDelay = atoi(argv[i + 1]) * 1000;
- return 2;
- }
-
- if (!strcmp(argv[i], "-ar2")) {
- xf86Info.kbdRate = atoi(argv[i + 1]) * 1000;
- return 2;
- }
- }
-
-#endif
-
- return 0;
-}
-
-void xf86UseMsg()
-{
-#ifdef HAS_USL_VTS
- ErrorF("vtXX Use the specified VT number\n");
-#endif
-#if defined(__SOL8__) || !defined(i386)
- ErrorF("-dev <fb> Framebuffer device\n");
- ErrorF("-ar1 <float> Set autorepeat initiate time (sec)\n");
- ErrorF(" (if not using XKB)\n");
- ErrorF("-ar2 <float> Set autorepeat interval time (sec)\n");
- ErrorF(" (if not using XKB)\n");
-#endif
- ErrorF("-keeptty Don't detach controlling tty\n");
- ErrorF(" (for debugging only)\n");
-}
diff --git a/hw/xfree86/os-support/solaris/sun_inout.s b/hw/xfree86/os-support/solaris/sun_inout.s
deleted file mode 100644
index e8f03d0e8..000000000
--- a/hw/xfree86/os-support/solaris/sun_inout.s
+++ /dev/null
@@ -1,124 +0,0 @@
-/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
-/
-/ Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
-/
-/ Permission is hereby granted, free of charge, to any person obtaining a copy
-/ of this software and associated documentation files (the "Software"), to deal
-/ in the Software without restriction, including without limitation the rights
-/ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-/ copies of the Software, and to permit persons to whom the Software is
-/ furnished to do so, subject to the following conditions:
-/
-/ The above copyright notice and this permission notice shall be included in
-/ all copies or substantial portions of the Software.
-/
-/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-/ XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-/ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-/ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-/
-/ Except as contained in this notice, the name of the XFree86 Project shall not
-/ be used in advertising or otherwise to promote the sale, use or other
-/ dealings in this Software without prior written authorization from the
-/ XFree86 Project.
-/
-/
-/ File: sun_inout.s
-/
-/ Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions
-/ for Solaris x86 using the ProWorks compiler by SunPro
-/
-/ Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com)
-/ Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com)
-/
-/ Synopsis: (c callable external declarations)
-/ extern unsigned char inb(int port);
-/ extern unsigned short inw(int port);
-/ extern unsigned long inl(int port);
-/ extern void outb(int port, unsigned char value);
-/ extern void outw(int port, unsigned short value);
-/ extern void outl(int port, unsigned long value);
-/
-
-.file "sunos_inout.s"
-.text
-
-.globl inb
-.globl inw
-.globl inl
-.globl outb
-.globl outw
-.globl outl
-
-/
-/ unsigned char inb(int port);
-/
-.align 4
-inb:
- movl 4(%esp),%edx
- subl %eax,%eax
- inb (%dx)
- ret
-.type inb,@function
-.size inb,.-inb
-
-/
-/ unsigned short inw(int port);
-/
-.align 4
-inw:
- movl 4(%esp),%edx
- subl %eax,%eax
- inw (%dx)
- ret
-.type inw,@function
-.size inw,.-inw
-
-/
-/ unsigned long inl(int port);
-/
-.align 4
-inl:
- movl 4(%esp),%edx
- inl (%dx)
- ret
-.type inl,@function
-.size inl,.-inl
-
-/
-/ void outb(int port, unsigned char value);
-/
-.align 4
-outb:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- outb (%dx)
- ret
-.type outb,@function
-.size outb,.-outb
-
-/
-/ void outw(int port, unsigned short value);
-/
-.align 4
-outw:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- outw (%dx)
- ret
-.type outw,@function
-.size outw,.-outw
-
-/
-/ void outl(int port, unsigned long value);
-/
-.align 4
-outl:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- outl (%dx)
- ret
-.type outl,@function
-.size outl,.-outl
diff --git a/hw/xfree86/os-support/solaris/sun_io.c b/hw/xfree86/os-support/solaris/sun_io.c
deleted file mode 100644
index 27996d312..000000000
--- a/hw/xfree86/os-support/solaris/sun_io.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_io.c,v 1.3 2003/02/17 15:12:00 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Dawes makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- int kbdCmd;
-
- if (loudness && pitch)
- {
- kbdCmd = KBD_CMD_BELL;
- if (ioctl (xf86Info.kbdFd, KIOCCMD, &kbdCmd) == -1) {
- ErrorF("Failed to activate bell\n");
- return;
- }
-
- usleep(xf86Info.bell_duration * loudness * 20);
-
- kbdCmd = KBD_CMD_NOBELL;
- if (ioctl (xf86Info.kbdFd, KIOCCMD, &kbdCmd) == -1)
- ErrorF ("Failed to deactivate bell\n");
- }
-}
-
-void
-xf86SetKbdLeds(int leds)
-{
- if( ioctl(xf86Info.kbdFd, KIOCSLED, &leds) < 0 )
- ErrorF("Failed to set Keyboard LED's\n");
-}
-
-#include "xf86OSKbd.h"
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c
deleted file mode 100644
index 058f1109a..000000000
--- a/hw/xfree86/os-support/solaris/sun_kbd.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.2 2003/10/09 11:44:00 pascal Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Dawes <dawes@XFree86.org>
- * Copyright 1999 by David Holland <davidh@iquest.net)
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of Thomas Roell, David Dawes, and David Holland not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. Thomas Roell, David Dawes, and
- * David Holland make no representations about the suitability of this software
- * for any purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THOMAS ROELL, DAVID DAWES, AND DAVID HOLLAND DISCLAIM ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL THOMAS ROELL, DAVID DAWES, OR DAVID HOLLAND
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static int sun_otranslation = -1;
-static int sun_odirect = -1;
-int sun_ktype;
-
-int
-xf86GetKbdLeds()
-{
- int leds;
-
- ioctl(xf86Info.kbdFd, KIOCGLED, &leds);
- return leds;
-}
-
-void
-xf86SetKbdRepeat(char rad)
-{
- /* Nothing to do */
-}
-
-/*
- * Save initial keyboard state. This is called at the start of each server
- * generation.
- */
-
-void
-xf86KbdInit()
-{
- int klayout;
-
- if (xf86Info.kbdFd < 0) {
- xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK);
- if(xf86Info.kbdFd < 0)
- FatalError("Unable to open keyboard: /dev/kbd\n");
- }
-
- /*
- * None of the followin should ever fail. If it does, something is
- * broken (IMO) - DWH 8/21/99
- */
-
- if (ioctl(xf86Info.kbdFd, KIOCTYPE, &sun_ktype) < 0)
- FatalError("Unable to determine keyboard type: %d\n", errno);
-
- if (ioctl(xf86Info.kbdFd, KIOCLAYOUT, &klayout) < 0)
- FatalError("Unable to determine keyboard layout: %d\n", errno);
-
- if (ioctl(xf86Info.kbdFd, KIOCGTRANS, &sun_otranslation) < 0)
- FatalError("Unable to determine keyboard translation mode\n");
-
- if (ioctl(xf86Info.kbdFd, KIOCGDIRECT, &sun_odirect) < 0)
- FatalError("Unable to determine keyboard direct setting\n");
-}
-
-int
-xf86KbdOn(void)
-{
- int tmp = 1;
-
- if (ioctl(xf86Info.kbdFd, KIOCSDIRECT, &tmp) == -1)
- FatalError("Setting keyboard direct mode on\n");
-
- /* Setup translation */
-
- tmp = TR_UNTRANS_EVENT;
-
- if (ioctl(xf86Info.kbdFd, KIOCTRANS, &tmp) == -1)
- FatalError("Setting keyboard translation\n");
-
- return xf86Info.kbdFd;
-}
-
-int
-xf86KbdOff()
-{
- if ((sun_otranslation != -1) &&
- (ioctl(xf86Info.kbdFd, KIOCTRANS, &sun_otranslation) < 0))
- FatalError("Unable to restore keyboard translation mode\n");
-
- if ((sun_odirect != 0) &&
- (ioctl(xf86Info.kbdFd, KIOCSDIRECT, &sun_odirect) < 0 ))
- FatalError("Unable to restore keyboard direct setting\n");
-
- return xf86Info.kbdFd;
-}
diff --git a/hw/xfree86/os-support/solaris/sun_kbdEv.c b/hw/xfree86/os-support/solaris/sun_kbdEv.c
deleted file mode 100644
index f6481af29..000000000
--- a/hw/xfree86/os-support/solaris/sun_kbdEv.c
+++ /dev/null
@@ -1,922 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.6 2003/10/09 11:44:00 pascal Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of Thomas Roell and David Dawes not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Thomas Roell and David Dawes make no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * THOMAS ROELL AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
- * IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* [JCH-96/01/21] Extended std reverse map to four buttons. */
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifdef XINPUT
-#include "XI.h"
-#include "XIproto.h"
-#include "xf86Xinput.h"
-#else
-#include "inputstr.h"
-#endif
-
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-#include <sys/vuid_event.h>
-#include <sys/kbd.h>
-#include "atKeynames.h"
-
-extern int sun_ktype;
-
-#ifdef XKB
-extern Bool noXkbExtension;
-#endif
-
-#define XE_POINTER 1
-#define XE_KEYBOARD 2
-
-#ifdef XTESTEXT1
-
-#define XTestSERVER_SIDE
-#include "xtestext1.h"
-extern short xtest_mousex;
-extern short xtest_mousey;
-extern int on_steal_input;
-extern Bool XTestStealKeyData();
-extern void XTestStealMotionData();
-
-#ifdef XINPUT
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- if (!on_steal_input || \
- XTestStealKeyData((ev)->u.u.detail, (ev)->u.u.type, dev_type, \
- xtest_mousex, xtest_mousey)) \
- xf86eqEnqueue((ev))
-#else
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- if (!on_steal_input || \
- XTestStealKeyData((ev)->u.u.detail, (ev)->u.u.type, dev_type, \
- xtest_mousex, xtest_mousey)) \
- mieqEnqueue((ev))
-#endif
-
-#else /* ! XTESTEXT1 */
-
-#ifdef XINPUT
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- xf86eqEnqueue((ev))
-#else
-#define ENQUEUE(ev, code, direction, dev_type) \
- (ev)->u.u.detail = (code); \
- (ev)->u.u.type = (direction); \
- mieqEnqueue((ev))
-#endif
-
-#endif
-
-static void startautorepeat(long keycode);
-static CARD32 processautorepeat(OsTimerPtr timer, CARD32 now, pointer arg);
-
-static OsTimerPtr sunTimer = NULL;
-
-/* Map the Solaris keycodes to the "XFree86" keycodes. */
-/*
- * This doesn't seem right. It probably needs to be dependent on a keyboard
- * type.
- */
-static unsigned char map[256] = {
-#if defined(i386) || defined(__i386) || defined(__i386__)
- KEY_NOTUSED, /* 0 */
- KEY_Tilde, /* 1 */
- KEY_1, /* 2 */
- KEY_2, /* 3 */
- KEY_3, /* 4 */
- KEY_4, /* 5 */
- KEY_5, /* 6 */
- KEY_6, /* 7 */
- KEY_7, /* 8 */
- KEY_8, /* 9 */
- KEY_9, /* 10 */
- KEY_0, /* 11 */
- KEY_Minus, /* 12 */
- KEY_Equal, /* 13 */
- 0x7D, /*KEY_P_YEN*/ /* 14 */
- KEY_BackSpace, /* 15 */
- KEY_Tab, /* 16 */
- KEY_Q, /* 17 */
- KEY_W, /* 18 */
- KEY_E, /* 19 */
- KEY_R, /* 20 */
- KEY_T, /* 21 */
- KEY_Y, /* 22 */
- KEY_U, /* 23 */
- KEY_I, /* 24 */
- KEY_O, /* 25 */
- KEY_P, /* 26 */
- KEY_LBrace, /* 27 */
- KEY_RBrace, /* 28 */
- KEY_BSlash, /* 29 */
- KEY_CapsLock, /* 30 */
- KEY_A, /* 31 */
- KEY_S, /* 32 */
- KEY_D, /* 33 */
- KEY_F, /* 34 */
- KEY_G, /* 35 */
- KEY_H, /* 36 */
- KEY_J, /* 37 */
- KEY_K, /* 38 */
- KEY_L, /* 39 */
- KEY_SemiColon, /* 40 */
- KEY_Quote, /* 41 */
- KEY_UNKNOWN, /* 42 */
- KEY_Enter, /* 43 */
- KEY_ShiftL, /* 44 */
- KEY_Less, /* 45 */
- KEY_Z, /* 46 */
- KEY_X, /* 47 */
- KEY_C, /* 48 */
- KEY_V, /* 49 */
- KEY_B, /* 50 */
- KEY_N, /* 51 */
- KEY_M, /* 52 */
- KEY_Comma, /* 53 */
- KEY_Period, /* 54 */
- KEY_Slash, /* 55 */
- KEY_BSlash2, /* 56 */
- KEY_ShiftR, /* 57 */
- KEY_LCtrl, /* 58 */
- KEY_LMeta, /* 59 */
- KEY_Alt, /* 60 */
- KEY_Space, /* 61 */
- KEY_AltLang, /* 62 */
- KEY_RMeta, /* 63 */
- KEY_RCtrl, /* 64 */
- KEY_Menu, /* 65 */
- KEY_UNKNOWN, /* 66 */
- KEY_UNKNOWN, /* 67 */
- KEY_UNKNOWN, /* 68 */
- KEY_UNKNOWN, /* 69 */
- KEY_UNKNOWN, /* 70 */
- KEY_UNKNOWN, /* 71 */
- KEY_UNKNOWN, /* 72 */
- KEY_UNKNOWN, /* 73 */
- KEY_UNKNOWN, /* 74 */
- KEY_Insert, /* 75 */
- KEY_Delete, /* 76 */
- KEY_UNKNOWN, /* 77 */
- KEY_UNKNOWN, /* 78 */
- KEY_Left, /* 79 */
- KEY_Home, /* 80 */
- KEY_End, /* 81 */
- KEY_UNKNOWN, /* 82 */
- KEY_Up, /* 83 */
- KEY_Down, /* 84 */
- KEY_PgUp, /* 85 */
- KEY_PgDown, /* 86 */
- KEY_UNKNOWN, /* 87 */
- KEY_UNKNOWN, /* 88 */
- KEY_Right, /* 89 */
- KEY_NumLock, /* 90 */
- KEY_KP_7, /* 91 */
- KEY_KP_4, /* 92 */
- KEY_KP_1, /* 93 */
- KEY_UNKNOWN, /* 94 */
- KEY_KP_Divide, /* 95 */
- KEY_KP_8, /* 96 */
- KEY_KP_5, /* 97 */
- KEY_KP_2, /* 98 */
- KEY_KP_0, /* 99 */
- KEY_KP_Multiply, /* 100 */
- KEY_KP_9, /* 101 */
- KEY_KP_6, /* 102 */
- KEY_KP_3, /* 103 */
- KEY_KP_Decimal, /* 104 */
- KEY_KP_Minus, /* 105 */
- KEY_KP_Plus, /* 106 */
- KEY_UNKNOWN, /* 107 */
- KEY_KP_Enter, /* 108 */
- KEY_UNKNOWN, /* 109 */
- KEY_Escape, /* 110 */
- KEY_UNKNOWN, /* 111 */
- KEY_F1, /* 112 */
- KEY_F2, /* 113 */
- KEY_F3, /* 114 */
- KEY_F4, /* 115 */
- KEY_F5, /* 116 */
- KEY_F6, /* 117 */
- KEY_F7, /* 118 */
- KEY_F8, /* 119 */
- KEY_F9, /* 120 */
- KEY_F10, /* 121 */
- KEY_F11, /* 122 */
- KEY_F12, /* 123 */
- KEY_Print, /* 124 */
- KEY_ScrollLock, /* 125 */
- KEY_Pause, /* 126 */
- KEY_UNKNOWN, /* 127 */
- KEY_UNKNOWN, /* 128 */
- KEY_UNKNOWN, /* 129 */
- KEY_UNKNOWN, /* 130 */
- KEY_NFER, /* 131 */
- KEY_XFER, /* 132 */
- KEY_HKTG, /* 133 */
- KEY_UNKNOWN, /* 134 */
-#elif defined(sparc) || defined(__sparc__)
- KEY_UNKNOWN, /* 0x00 */
- KEY_UNKNOWN, /* 0x01 */
- KEY_UNKNOWN, /* 0x02 */
- KEY_UNKNOWN, /* 0x03 */
- KEY_UNKNOWN, /* 0x04 */
- KEY_F1, /* 0x05 */
- KEY_F2, /* 0x06 */
- KEY_F10, /* 0x07 */
- KEY_F3, /* 0x08 */
- KEY_F11, /* 0x09 */
- KEY_F4, /* 0x0A */
- KEY_F12, /* 0x0B */
- KEY_F5, /* 0x0C */
- KEY_UNKNOWN, /* 0x0D */
- KEY_F6, /* 0x0E */
- KEY_UNKNOWN, /* 0x0F */
- KEY_F7, /* 0x10 */
- KEY_F8, /* 0x11 */
- KEY_F9, /* 0x12 */
- KEY_Alt, /* 0x13 */
- KEY_Up, /* 0x14 */
- KEY_Pause, /* 0x15 */
- KEY_SysReqest, /* 0x16 */
- KEY_ScrollLock, /* 0x17 */
- KEY_Left, /* 0x18 */
- KEY_UNKNOWN, /* 0x19 */
- KEY_UNKNOWN, /* 0x1A */
- KEY_Down, /* 0x1B */
- KEY_Right, /* 0x1C */
- KEY_Escape, /* 0x1D */
- KEY_1, /* 0x1E */
- KEY_2, /* 0x1F */
- KEY_3, /* 0x20 */
- KEY_4, /* 0x21 */
- KEY_5, /* 0x22 */
- KEY_6, /* 0x23 */
- KEY_7, /* 0x24 */
- KEY_8, /* 0x25 */
- KEY_9, /* 0x26 */
- KEY_0, /* 0x27 */
- KEY_Minus, /* 0x28 */
- KEY_Equal, /* 0x29 */
- KEY_Tilde, /* 0x2A */
- KEY_BackSpace, /* 0x2B */
- KEY_Insert, /* 0x2C */
- KEY_UNKNOWN, /* 0x2D */
- KEY_KP_Divide, /* 0x2E */
- KEY_KP_Multiply, /* 0x2F */
- KEY_UNKNOWN, /* 0x30 */
- KEY_UNKNOWN, /* 0x31 */
- KEY_KP_Decimal, /* 0x32 */
- KEY_UNKNOWN, /* 0x33 */
- KEY_Home, /* 0x34 */
- KEY_Tab, /* 0x35 */
- KEY_Q, /* 0x36 */
- KEY_W, /* 0x37 */
- KEY_E, /* 0x38 */
- KEY_R, /* 0x39 */
- KEY_T, /* 0x3A */
- KEY_Y, /* 0x3B */
- KEY_U, /* 0x3C */
- KEY_I, /* 0x3D */
- KEY_O, /* 0x3E */
- KEY_P, /* 0x3F */
- KEY_LBrace, /* 0x40 */
- KEY_RBrace, /* 0x41 */
- KEY_Delete, /* 0x42 */
- KEY_UNKNOWN, /* 0x43 */
- KEY_KP_7, /* 0x44 */
- KEY_KP_8, /* 0x45 */
- KEY_KP_9, /* 0x46 */
- KEY_KP_Minus, /* 0x47 */
- KEY_UNKNOWN, /* 0x48 */
- KEY_UNKNOWN, /* 0x49 */
- KEY_End, /* 0x4A */
- KEY_UNKNOWN, /* 0x4B */
- KEY_LCtrl, /* 0x4C */
- KEY_A, /* 0x4D */
- KEY_S, /* 0x4E */
- KEY_D, /* 0x4F */
- KEY_F, /* 0x50 */
- KEY_G, /* 0x51 */
- KEY_H, /* 0x52 */
- KEY_J, /* 0x53 */
- KEY_K, /* 0x54 */
- KEY_L, /* 0x55 */
- KEY_SemiColon, /* 0x56 */
- KEY_Quote, /* 0x57 */
- KEY_BSlash, /* 0x58 */
- KEY_Enter, /* 0x59 */
- KEY_KP_Enter, /* 0x5A */
- KEY_KP_4, /* 0x5B */
- KEY_KP_5, /* 0x5C */
- KEY_KP_6, /* 0x5D */
- KEY_KP_0, /* 0x5E */
- KEY_UNKNOWN, /* 0x5F */
- KEY_PgUp, /* 0x60 */
- KEY_UNKNOWN, /* 0x61 */
- KEY_NumLock, /* 0x62 */
- KEY_ShiftL, /* 0x63 */
- KEY_Z, /* 0x64 */
- KEY_X, /* 0x65 */
- KEY_C, /* 0x66 */
- KEY_V, /* 0x67 */
- KEY_B, /* 0x68 */
- KEY_N, /* 0x69 */
- KEY_M, /* 0x6A */
- KEY_Comma, /* 0x6B */
- KEY_Period, /* 0x6C */
- KEY_Slash, /* 0x6D */
- KEY_ShiftR, /* 0x6E */
- KEY_UNKNOWN, /* 0x6F */
- KEY_KP_1, /* 0x70 */
- KEY_KP_2, /* 0x71 */
- KEY_KP_3, /* 0x72 */
- KEY_UNKNOWN, /* 0x73 */
- KEY_UNKNOWN, /* 0x74 */
- KEY_UNKNOWN, /* 0x75 */
- KEY_UNKNOWN, /* 0x76 */
- KEY_CapsLock, /* 0x77 */
- KEY_LMeta, /* 0x78 */
- KEY_Space, /* 0x79 */
- KEY_RMeta, /* 0x7A */
- KEY_PgDown, /* 0x7B */
- KEY_UNKNOWN, /* 0x7C */
- KEY_KP_Plus, /* 0x7D */
- KEY_UNKNOWN, /* 0x7E */
- KEY_UNKNOWN, /* 0x7F */
-#endif
- /* The rest default to KEY_UNKNOWN */
-};
-
-#if defined(KB_USB)
-static unsigned char usbmap[256] = {
-/*
- * partially taken from ../bsd/bsd_KbdMap.c
- *
- * added keycodes for Sun special keys (left function keys, audio control)
- */
- /* 0 */ KEY_NOTUSED,
- /* 1 */ KEY_NOTUSED,
- /* 2 */ KEY_NOTUSED,
- /* 3 */ KEY_NOTUSED,
- /* 4 */ KEY_A,
- /* 5 */ KEY_B,
- /* 6 */ KEY_C,
- /* 7 */ KEY_D,
- /* 8 */ KEY_E,
- /* 9 */ KEY_F,
- /* 10 */ KEY_G,
- /* 11 */ KEY_H,
- /* 12 */ KEY_I,
- /* 13 */ KEY_J,
- /* 14 */ KEY_K,
- /* 15 */ KEY_L,
- /* 16 */ KEY_M,
- /* 17 */ KEY_N,
- /* 18 */ KEY_O,
- /* 19 */ KEY_P,
- /* 20 */ KEY_Q,
- /* 21 */ KEY_R,
- /* 22 */ KEY_S,
- /* 23 */ KEY_T,
- /* 24 */ KEY_U,
- /* 25 */ KEY_V,
- /* 26 */ KEY_W,
- /* 27 */ KEY_X,
- /* 28 */ KEY_Y,
- /* 29 */ KEY_Z,
- /* 30 */ KEY_1, /* 1 !*/
- /* 31 */ KEY_2, /* 2 @ */
- /* 32 */ KEY_3, /* 3 # */
- /* 33 */ KEY_4, /* 4 $ */
- /* 34 */ KEY_5, /* 5 % */
- /* 35 */ KEY_6, /* 6 ^ */
- /* 36 */ KEY_7, /* 7 & */
- /* 37 */ KEY_8, /* 8 * */
- /* 38 */ KEY_9, /* 9 ( */
- /* 39 */ KEY_0, /* 0 ) */
- /* 40 */ KEY_Enter, /* Return */
- /* 41 */ KEY_Escape, /* Escape */
- /* 42 */ KEY_BackSpace, /* Backspace Delete */
- /* 43 */ KEY_Tab, /* Tab */
- /* 44 */ KEY_Space, /* Space */
- /* 45 */ KEY_Minus, /* - _ */
- /* 46 */ KEY_Equal, /* = + */
- /* 47 */ KEY_LBrace, /* [ { */
- /* 48 */ KEY_RBrace, /* ] } */
- /* 49 */ KEY_BSlash, /* \ | */
- /* 50 */ KEY_BSlash, /* \ _ # ~ on some keyboards */
- /* 51 */ KEY_SemiColon, /* ; : */
- /* 52 */ KEY_Quote, /* ' " */
- /* 53 */ KEY_Tilde, /* ` ~ */
- /* 54 */ KEY_Comma, /* , < */
- /* 55 */ KEY_Period, /* . > */
- /* 56 */ KEY_Slash, /* / ? */
- /* 57 */ KEY_CapsLock, /* Caps Lock */
- /* 58 */ KEY_F1, /* F1 */
- /* 59 */ KEY_F2, /* F2 */
- /* 60 */ KEY_F3, /* F3 */
- /* 61 */ KEY_F4, /* F4 */
- /* 62 */ KEY_F5, /* F5 */
- /* 63 */ KEY_F6, /* F6 */
- /* 64 */ KEY_F7, /* F7 */
- /* 65 */ KEY_F8, /* F8 */
- /* 66 */ KEY_F9, /* F9 */
- /* 67 */ KEY_F10, /* F10 */
- /* 68 */ KEY_F11, /* F11 */
- /* 69 */ KEY_F12, /* F12 */
- /* 70 */ KEY_Print, /* PrintScrn SysReq */
- /* 71 */ KEY_ScrollLock, /* Scroll Lock */
- /* 72 */ KEY_Pause, /* Pause Break */
- /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */
- /* 74 */ KEY_Home, /* Home */
- /* 75 */ KEY_PgUp, /* Page Up */
- /* 76 */ KEY_Delete, /* Delete */
- /* 77 */ KEY_End, /* End */
- /* 78 */ KEY_PgDown, /* Page Down */
- /* 79 */ KEY_Right, /* Right Arrow */
- /* 80 */ KEY_Left, /* Left Arrow */
- /* 81 */ KEY_Down, /* Down Arrow */
- /* 82 */ KEY_Up, /* Up Arrow */
- /* 83 */ KEY_NumLock, /* Num Lock */
- /* 84 */ KEY_KP_Divide, /* Keypad / */
- /* 85 */ KEY_KP_Multiply, /* Keypad * */
- /* 86 */ KEY_KP_Minus, /* Keypad - */
- /* 87 */ KEY_KP_Plus, /* Keypad + */
- /* 88 */ KEY_KP_Enter, /* Keypad Enter */
- /* 89 */ KEY_KP_1, /* Keypad 1 End */
- /* 90 */ KEY_KP_2, /* Keypad 2 Down */
- /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */
- /* 92 */ KEY_KP_4, /* Keypad 4 Left */
- /* 93 */ KEY_KP_5, /* Keypad 5 */
- /* 94 */ KEY_KP_6, /* Keypad 6 */
- /* 95 */ KEY_KP_7, /* Keypad 7 Home */
- /* 96 */ KEY_KP_8, /* Keypad 8 Up */
- /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */
- /* 98 */ KEY_KP_0, /* Keypad 0 Ins */
- /* 99 */ KEY_KP_Decimal, /* Keypad . Del */
- /* 100 */ KEY_Less, /* < > on some keyboards */
- /* 101 */ KEY_Menu, /* Menu */
- /* 102 */ KEY_Power, /* Sun: Power */
- /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
- /* 104 */ KEY_NOTUSED,
- /* 105 */ KEY_NOTUSED,
- /* 106 */ KEY_NOTUSED,
- /* 107 */ KEY_NOTUSED,
- /* 108 */ KEY_NOTUSED,
- /* 109 */ KEY_NOTUSED,
- /* 110 */ KEY_NOTUSED,
- /* 111 */ KEY_NOTUSED,
- /* 112 */ KEY_NOTUSED,
- /* 113 */ KEY_NOTUSED,
- /* 114 */ KEY_NOTUSED,
- /* 115 */ KEY_NOTUSED,
- /* 116 */ KEY_L7, /* Sun: Open */
- /* 117 */ KEY_Help, /* Sun: Help */
- /* 118 */ KEY_L3, /* Sun: Props */
- /* 119 */ KEY_L5, /* Sun: Front */
- /* 120 */ KEY_L1, /* Sun: Stop */
- /* 121 */ KEY_L2, /* Sun: Again */
- /* 122 */ KEY_L4, /* Sun: Undo */
- /* 123 */ KEY_L10, /* Sun: Cut */
- /* 124 */ KEY_L6, /* Sun: Copy */
- /* 125 */ KEY_L8, /* Sun: Paste */
- /* 126 */ KEY_L9, /* Sun: Find */
- /* 127 */ KEY_Mute, /* Sun: AudioMute */
- /* 128 */ KEY_AudioRaise, /* Sun: AudioRaise */
- /* 129 */ KEY_AudioLower, /* Sun: AudioLower */
- /* 130 */ KEY_NOTUSED,
- /* 131 */ KEY_NOTUSED,
- /* 132 */ KEY_NOTUSED,
- /* 133 */ KEY_NOTUSED,
- /* 134 */ KEY_NOTUSED,
- /* 135 */ KEY_NOTUSED,
- /* 136 */ KEY_NOTUSED,
- /* 137 */ KEY_NOTUSED,
- /* 138 */ KEY_NOTUSED,
- /* 139 */ KEY_NOTUSED,
- /* 140 */ KEY_NOTUSED,
- /* 141 */ KEY_NOTUSED,
- /* 142 */ KEY_NOTUSED,
- /* 143 */ KEY_NOTUSED,
- /* 144 */ KEY_NOTUSED,
- /* 145 */ KEY_NOTUSED,
- /* 146 */ KEY_NOTUSED,
- /* 147 */ KEY_NOTUSED,
- /* 148 */ KEY_NOTUSED,
- /* 149 */ KEY_NOTUSED,
- /* 150 */ KEY_NOTUSED,
- /* 151 */ KEY_NOTUSED,
- /* 152 */ KEY_NOTUSED,
- /* 153 */ KEY_NOTUSED,
- /* 154 */ KEY_NOTUSED,
- /* 155 */ KEY_NOTUSED,
- /* 156 */ KEY_NOTUSED,
- /* 157 */ KEY_NOTUSED,
- /* 158 */ KEY_NOTUSED,
- /* 159 */ KEY_NOTUSED,
- /* 160 */ KEY_NOTUSED,
- /* 161 */ KEY_NOTUSED,
- /* 162 */ KEY_NOTUSED,
- /* 163 */ KEY_NOTUSED,
- /* 164 */ KEY_NOTUSED,
- /* 165 */ KEY_NOTUSED,
- /* 166 */ KEY_NOTUSED,
- /* 167 */ KEY_NOTUSED,
- /* 168 */ KEY_NOTUSED,
- /* 169 */ KEY_NOTUSED,
- /* 170 */ KEY_NOTUSED,
- /* 171 */ KEY_NOTUSED,
- /* 172 */ KEY_NOTUSED,
- /* 173 */ KEY_NOTUSED,
- /* 174 */ KEY_NOTUSED,
- /* 175 */ KEY_NOTUSED,
- /* 176 */ KEY_NOTUSED,
- /* 177 */ KEY_NOTUSED,
- /* 178 */ KEY_NOTUSED,
- /* 179 */ KEY_NOTUSED,
- /* 180 */ KEY_NOTUSED,
- /* 181 */ KEY_NOTUSED,
- /* 182 */ KEY_NOTUSED,
- /* 183 */ KEY_NOTUSED,
- /* 184 */ KEY_NOTUSED,
- /* 185 */ KEY_NOTUSED,
- /* 186 */ KEY_NOTUSED,
- /* 187 */ KEY_NOTUSED,
- /* 188 */ KEY_NOTUSED,
- /* 189 */ KEY_NOTUSED,
- /* 190 */ KEY_NOTUSED,
- /* 191 */ KEY_NOTUSED,
- /* 192 */ KEY_NOTUSED,
- /* 193 */ KEY_NOTUSED,
- /* 194 */ KEY_NOTUSED,
- /* 195 */ KEY_NOTUSED,
- /* 196 */ KEY_NOTUSED,
- /* 197 */ KEY_NOTUSED,
- /* 198 */ KEY_NOTUSED,
- /* 199 */ KEY_NOTUSED,
- /* 200 */ KEY_NOTUSED,
- /* 201 */ KEY_NOTUSED,
- /* 202 */ KEY_NOTUSED,
- /* 203 */ KEY_NOTUSED,
- /* 204 */ KEY_NOTUSED,
- /* 205 */ KEY_NOTUSED,
- /* 206 */ KEY_NOTUSED,
- /* 207 */ KEY_NOTUSED,
- /* 208 */ KEY_NOTUSED,
- /* 209 */ KEY_NOTUSED,
- /* 210 */ KEY_NOTUSED,
- /* 211 */ KEY_NOTUSED,
- /* 212 */ KEY_NOTUSED,
- /* 213 */ KEY_NOTUSED,
- /* 214 */ KEY_NOTUSED,
- /* 215 */ KEY_NOTUSED,
- /* 216 */ KEY_NOTUSED,
- /* 217 */ KEY_NOTUSED,
- /* 218 */ KEY_NOTUSED,
- /* 219 */ KEY_NOTUSED,
- /* 220 */ KEY_NOTUSED,
- /* 221 */ KEY_NOTUSED,
- /* 222 */ KEY_NOTUSED,
- /* 223 */ KEY_NOTUSED,
- /* 224 */ KEY_LCtrl, /* Left Control */
- /* 225 */ KEY_ShiftL, /* Left Shift */
- /* 226 */ KEY_Alt, /* Left Alt */
- /* 227 */ KEY_LMeta, /* Left Meta */
- /* 228 */ KEY_RCtrl, /* Right Control */
- /* 229 */ KEY_ShiftR, /* Right Shift */
- /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */
- /* 231 */ KEY_RMeta, /* Right Meta */
-};
-
-#endif /* KB_USB */
-/*
- * sunPostKbdEvent --
- * Translate the raw hardware Firm_event into an XEvent, and tell DIX
- * about it. KeyCode preprocessing and so on is done ...
- *
- * Most of the Solaris stuff has whacked Panix/PC98 support in the
- * interests of simplicity - DWH 8/30/99
- */
-
-static void
-sunPostKbdEvent(Firm_event *event)
-{
- Bool down;
- KeyClassRec *keyc = ((DeviceIntPtr)xf86Info.pKeyboard)->key;
- Bool updateLeds = FALSE;
- xEvent kevent;
- KeySym *keysym;
- int keycode;
- static int lockkeys = 0;
-
- /* Give down a value */
- if (event->value == VKEY_DOWN)
- down = TRUE;
- else
- down = FALSE;
-
- /*
- * and now get some special keysequences
- */
-
-#if defined(KB_USB)
- if(sun_ktype == KB_USB)
- keycode = usbmap[event->id];
- else
-#endif
- keycode = map[event->id];
-
- if ((ModifierDown(ControlMask | AltMask)) ||
- (ModifierDown(ControlMask | AltLangMask)))
- {
- switch (keycode) {
- /*
- * The idea here is to pass the scancode down to a list of registered
- * routines. There should be some standard conventions for processing
- * certain keys.
- */
-
- case KEY_BackSpace:
- if (!xf86Info.dontZap) {
- DGAShutdown();
- GiveUp(0);
- }
- break;
-
- /* Check grabs */
- case KEY_KP_Divide:
- if (!xf86Info.grabInfo.disabled &&
- xf86Info.grabInfo.allowDeactivate) {
- if (inputInfo.pointer && inputInfo.pointer->grab != NULL &&
- inputInfo.pointer->DeactivateGrab)
- (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer);
- if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL &&
- inputInfo.keyboard->DeactivateGrab)
- (*inputInfo.keyboard->DeactivateGrab)(inputInfo.keyboard);
- }
- break;
-
- case KEY_KP_Multiply:
- if (!xf86Info.grabInfo.disabled &&
- xf86Info.grabInfo.allowClosedown) {
- ClientPtr pointer, keyboard, server;
-
- pointer = keyboard = server = NULL;
- if (inputInfo.pointer && inputInfo.pointer->grab != NULL)
- pointer =
- clients[CLIENT_ID(inputInfo.pointer->grab->resource)];
-
- if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL) {
- keyboard =
- clients[CLIENT_ID(inputInfo.keyboard->grab->resource)];
- if (keyboard == pointer)
- keyboard = NULL;
- }
-
- if ((xf86Info.grabInfo.server.grabstate == SERVER_GRABBED) &&
- (((server = xf86Info.grabInfo.server.client) == pointer) ||
- (server == keyboard)))
- server = NULL;
-
- if (pointer)
- CloseDownClient(pointer);
- if (keyboard)
- CloseDownClient(keyboard);
- if (server)
- CloseDownClient(server);
- }
- break;
-
- case KEY_KP_Minus: /* Keypad - */
- if (!xf86Info.dontZoom) {
- if (down)
- xf86ZoomViewport(xf86Info.currentScreen, -1);
- return;
- }
- break;
-
- case KEY_KP_Plus: /* Keypad + */
- if (!xf86Info.dontZoom) {
- if (down)
- xf86ZoomViewport(xf86Info.currentScreen, 1);
- return;
- }
- break;
- }
- }
-
- /*
- * Now map the scancodes to real X-keycodes ...
- */
- if (keycode == KEY_NOTUSED) {
- xf86MsgVerb(X_INFO, 0,
- "raw code %d mapped to KEY_NOTUSED -- please report\n", event->id);
- return;
- }
- if (keycode == KEY_UNKNOWN) {
- xf86MsgVerb(X_INFO, 0,
- "raw code %d mapped to KEY_UNKNOWN -- please report\n", event->id);
- return;
- }
- keycode += MIN_KEYCODE;
- keysym = keyc->curKeySyms.map +
- (keyc->curKeySyms.mapWidth *
- (keycode - keyc->curKeySyms.minKeyCode));
-
-#ifdef XKB
- if (noXkbExtension)
-#endif
- {
- /*
- * Toggle lock keys.
- */
-#define CAPSFLAG 0x01
-#define NUMFLAG 0x02
-#define SCROLLFLAG 0x04
-#define MODEFLAG 0x08
-
- if (down) {
- /*
- * Handle the KeyPresses of the lock keys.
- */
-
- switch (keysym[0]) {
-
- case XK_Caps_Lock:
- if (lockkeys & CAPSFLAG) {
- lockkeys &= ~CAPSFLAG;
- return;
- }
- lockkeys |= CAPSFLAG;
- updateLeds = TRUE;
- xf86Info.capsLock = down;
- break;
-
- case XK_Num_Lock:
- if (lockkeys & NUMFLAG) {
- lockkeys &= ~NUMFLAG;
- return;
- }
- lockkeys |= NUMFLAG;
- updateLeds = TRUE;
- xf86Info.numLock = down;
- break;
-
- case XK_Scroll_Lock:
- if (lockkeys & SCROLLFLAG) {
- lockkeys &= ~SCROLLFLAG;
- return;
- }
- lockkeys |= SCROLLFLAG;
- updateLeds = TRUE;
- xf86Info.scrollLock = down;
- break;
- }
- } else {
- /*
- * Handle the releases of the lock keys.
- */
-
- switch (keysym[0]) {
-
- case XK_Caps_Lock:
- if (lockkeys & CAPSFLAG)
- return;
- updateLeds = TRUE;
- xf86Info.capsLock = down;
- break;
-
- case XK_Num_Lock:
- if (lockkeys & NUMFLAG)
- return;
- updateLeds = TRUE;
- xf86Info.numLock = down;
- break;
-
- case XK_Scroll_Lock:
- if (lockkeys & SCROLLFLAG)
- return;
- updateLeds = TRUE;
- xf86Info.scrollLock = down;
- break;
- }
- }
-
- if (updateLeds)
- xf86KbdLeds();
-
- /*
- * If this keycode is not a modifier key, and its down initiate the
- * autorepeate sequence. (Only necessary if not using XKB).
- *
- * If its not down, then reset the timer.
- */
- if (!keyc->modifierMap[keycode]) {
- if (down) {
- startautorepeat(keycode);
- } else {
- TimerFree(sunTimer);
- sunTimer = NULL;
- }
- }
- }
-
- xf86Info.lastEventTime =
- kevent.u.keyButtonPointer.time =
- GetTimeInMillis();
-
- /*
- * And now send these prefixes ...
- * NOTE: There cannot be multiple Mode_Switch keys !!!!
- */
-
- ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
-}
-
-/*
- * Lets try reading more than one keyboard event at a time in the hopes that
- * this will be slightly more efficient. Or we could just try the MicroSoft
- * method, and forget about efficiency. :-)
- */
-void
-xf86KbdEvents()
-{
- Firm_event event[64];
- int nBytes, i;
-
- /* I certainly hope its not possible to read partial events */
-
- if ((nBytes = read(xf86Info.kbdFd, (char *)event, sizeof(event))) > 0)
- {
- for (i = 0; i < (nBytes / sizeof(Firm_event)); i++)
- sunPostKbdEvent(&event[i]);
- }
-}
-
-/*
- * Autorepeat stuff
- */
-
-void
-startautorepeat(long keycode)
-{
- sunTimer = TimerSet(sunTimer, /* Timer */
- 0, /* Flags */
- xf86Info.kbdDelay, /* millis */
- processautorepeat, /* callback */
- (pointer) keycode); /* arg for timer */
-}
-
-CARD32
-processautorepeat(OsTimerPtr timer, CARD32 now, pointer arg)
-{
- xEvent kevent;
- int keycode;
-
- keycode = (long)arg;
-
- xf86Info.lastEventTime =
- kevent.u.keyButtonPointer.time =
- GetTimeInMillis();
-
- /*
- * Repeat a key by faking a KeyRelease, and a KeyPress event in rapid
- * succession
- */
-
- ENQUEUE(&kevent, keycode, KeyRelease, XE_KEYBOARD);
- ENQUEUE(&kevent, keycode, KeyPress, XE_KEYBOARD);
-
- /* And return the appropriate value so we get rescheduled */
- return xf86Info.kbdRate;
-}
diff --git a/hw/xfree86/os-support/solaris/sun_mouse.c b/hw/xfree86/os-support/solaris/sun_mouse.c
deleted file mode 100644
index 2e9cee2b1..000000000
--- a/hw/xfree86/os-support/solaris/sun_mouse.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c,v 1.4 2002/01/25 21:56:21 tsi Exp $ */
-/*
- * Copyright 1999-2001 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#include "xf86.h"
-#include "xf86_OSlib.h"
-#include "xf86OSmouse.h"
-
-#if defined(__SOL8__) || !defined(i386)
-
-#include "xisb.h"
-#include "mipointer.h"
-#include <sys/vuid_event.h>
-
-/* Names of protocols that are handled internally here. */
-
-static const char *internalNames[] = {
- "VUID",
- NULL
-};
-
-typedef struct _VuidMseRec {
- Firm_event event;
- unsigned char *buffer;
-} VuidMseRec, *VuidMsePtr;
-
-
-static int vuidMouseProc(DeviceIntPtr pPointer, int what);
-static void vuidReadInput(InputInfoPtr pInfo);
-
-/* This function is called when the protocol is "VUID". */
-static Bool
-vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- MouseDevPtr pMse = pInfo->private;
- VuidMsePtr pVuidMse;
-
- pVuidMse = xalloc(sizeof(VuidMseRec));
- if (pVuidMse == NULL) {
- xf86Msg(X_ERROR, "%s: cannot allocate VuidMouseRec\n", pInfo->name);
- xfree(pMse);
- return FALSE;
- }
-
- pMse->protocol = protocol;
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
- /* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, NULL, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- /* Check if the device can be opened. */
- pInfo->fd = xf86OpenSerial(pInfo->options);
- if (pInfo->fd == -1) {
- if (xf86GetAllowMouseOpenFail())
- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
- else {
- xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pVuidMse);
- xfree(pMse);
- return FALSE;
- }
- }
- pVuidMse->buffer = (unsigned char *)&pVuidMse->event;
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
-
- /* Private structure */
- pMse->mousePriv = pVuidMse;
-
- /* Process common mouse options (like Emulate3Buttons, etc). */
- pMse->CommonOptions(pInfo);
-
- /* Setup the local procs. */
- pInfo->device_control = vuidMouseProc;
- pInfo->read_input = vuidReadInput;
-
- pInfo->flags |= XI86_CONFIGURED;
- return TRUE;
-}
-
-static void
-vuidReadInput(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- VuidMsePtr pVuidMse;
- int buttons;
- int dx = 0, dy = 0, dz = 0, dw = 0;
- unsigned int n;
- int c;
- unsigned char *pBuf;
-
- pMse = pInfo->private;
- pVuidMse = pMse->mousePriv;
- buttons = pMse->lastButtons;
- XisbBlockDuration(pMse->buffer, -1);
- pBuf = pVuidMse->buffer;
- n = 0;
-
- do {
- while (n < sizeof(Firm_event) && (c = XisbRead(pMse->buffer)) >= 0) {
- pBuf[n++] = (unsigned char)c;
- }
-
- if (n == 0)
- return;
-
- if (n != sizeof(Firm_event)) {
- xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n",
- pInfo->name, n);
- }
-
- if (pVuidMse->event.id >= BUT_FIRST && pVuidMse->event.id <= BUT_LAST) {
- /* button */
- int butnum = pVuidMse->event.id - BUT_FIRST;
- if (butnum < 3)
- butnum = 2 - butnum;
- if (!pVuidMse->event.value)
- buttons &= ~(1 << butnum);
- else
- buttons |= (1 << butnum);
- } else if (pVuidMse->event.id >= VLOC_FIRST &&
- pVuidMse->event.id <= VLOC_LAST) {
- /* axis */
- int delta = pVuidMse->event.value;
- switch(pVuidMse->event.id) {
- case LOC_X_DELTA:
- dx += delta;
- break;
- case LOC_Y_DELTA:
- dy -= delta;
- break;
- }
- }
-
- n = 0;
- if ((c = XisbRead(pMse->buffer)) >= 0) {
- /* Another packet. Handle it right away. */
- pBuf[n++] = c;
- }
- } while (n != 0);
-
- pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
- return;
-}
-
-#define NUMEVENTS 64
-
-static int
-vuidMouseProc(DeviceIntPtr pPointer, int what)
-{
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- VuidMsePtr pVuidMse;
- unsigned char map[MSE_MAXBUTTONS + 1];
- int nbuttons;
-
- pInfo = pPointer->public.devicePrivate;
- pMse = pInfo->private;
- pMse->device = pPointer;
- pVuidMse = pMse->mousePriv;
-
- switch (what) {
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
- map[nbuttons + 1] = nbuttons + 1;
-
- InitPointerDeviceStruct((DevicePtr)pPointer,
- map,
- min(pMse->buttons, MSE_MAXBUTTONS),
- miPointerGetMotionEvents,
- pMse->Ctrl,
- miPointerGetMotionBufferSize());
-
- /* X valuator */
- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 0);
- /* Y valuator */
- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 1);
- xf86MotionHistoryAllocate(pInfo);
- break;
-
- case DEVICE_ON:
- pInfo->fd = xf86OpenSerial(pInfo->options);
- if (pInfo->fd == -1)
- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
- else {
- pMse->buffer = XisbNew(pInfo->fd,
- NUMEVENTS * sizeof(Firm_event));
- if (!pMse->buffer) {
- xfree(pMse);
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
- } else {
- int fmt = VUID_FIRM_EVENT;
- ioctl(pInfo->fd, VUIDSFORMAT, &fmt);
- xf86FlushInput(pInfo->fd);
- AddEnabledDevice(pInfo->fd);
- }
- }
- pMse->lastButtons = 0;
- pMse->emulateState = 0;
- pPointer->public.on = TRUE;
- break;
-
- case DEVICE_OFF:
- case DEVICE_CLOSE:
- if (pInfo->fd != -1) {
- RemoveEnabledDevice(pInfo->fd);
- if (pMse->buffer) {
- XisbFree(pMse->buffer);
- pMse->buffer = NULL;
- }
- xf86CloseSerial(pInfo->fd);
- pInfo->fd = -1;
- }
- pPointer->public.on = FALSE;
- usleep(300000);
- break;
- }
- return Success;
-}
-
-static Bool
-sunMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- /* The protocol is guaranteed to be one of the internalNames[] */
- if (xf86NameCmp(protocol, "VUID") == 0) {
- return vuidPreInit(pInfo, protocol, flags);
- }
- return TRUE;
-}
-
-static const char **
-BuiltinNames(void)
-{
- return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
- int i;
-
- for (i = 0; internalNames[i]; i++)
- if (xf86NameCmp(protocol, internalNames[i]) == 0)
- return TRUE;
-
- return FALSE;
-}
-
-static const char *
-DefaultProtocol(void)
-{
- return "VUID";
-}
-
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
- return DefaultProtocol();
-}
-
-#else /* __SOL8__ || !i386 */
-
-#undef MSE_MISC
-#define MSE_MISC 0
-
-#endif /* !__SOL8__ && i386 */
-
-static int
-SupportedInterfaces(void)
-{
- /* XXX This needs to be checked. */
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_XPS2 | MSE_MISC;
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
- p->SupportedInterfaces = SupportedInterfaces;
-#if defined(__SOL8__) || !defined(i386)
- p->BuiltinNames = BuiltinNames;
- p->CheckProtocol = CheckProtocol;
- p->PreInit = sunMousePreInit;
- p->DefaultProtocol = DefaultProtocol;
- p->SetupAuto = SetupAuto;
-#endif
- return p;
-}
-
diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c
deleted file mode 100644
index 2f4b84e99..000000000
--- a/hw/xfree86/os-support/solaris/sun_vid.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_vid.c,v 1.3 2002/10/03 02:04:19 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- * SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- *
- */
-
-#ifdef i386
-#define _NEED_SYSI86
-#endif
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-char *apertureDevName = NULL;
-
-Bool
-xf86LinearVidMem(void)
-{
- int mmapFd;
-
- if (apertureDevName)
- return TRUE;
-
- apertureDevName = "/dev/xsvc";
- if ((mmapFd = open(apertureDevName, O_RDWR)) < 0)
- {
- apertureDevName = "/dev/fbs/aperture";
- if((mmapFd = open(apertureDevName, O_RDWR)) < 0)
- {
- xf86MsgVerb(X_WARNING, 0,
- "xf86LinearVidMem: failed to open %s (%s)\n",
- apertureDevName, strerror(errno));
- xf86MsgVerb(X_WARNING, 0,
- "xf86LinearVidMem: either /dev/fbs/aperture or /dev/xsvc"
- " device driver required\n");
- xf86MsgVerb(X_WARNING, 0,
- "xf86LinearVidMem: linear memory access disabled\n");
- apertureDevName = NULL;
- return FALSE;
- }
- }
- close(mmapFd);
- return TRUE;
-}
-
-pointer
-xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
-{
- pointer base;
- int fd;
- char vtname[20];
-
- /*
- * Solaris 2.1 x86 SVR4 (10/27/93)
- * The server must treat the virtual terminal device file as the
- * standard SVR4 /dev/pmem.
- *
- * Using the /dev/vtXX device as /dev/pmem only works for the
- * A0000-FFFFF region - If we wish you mmap the linear aperture
- * it requires a device driver.
- *
- * So what we'll do is use /dev/vtXX for the A0000-FFFFF stuff, and
- * try to use the /dev/fbs/aperture or /dev/xsvc driver if the server
- * tries to mmap anything > FFFFF. Its very very unlikely that the
- * server will try to mmap anything below FFFFF that can't be handled
- * by /dev/vtXX.
- *
- * DWH - 2/23/94
- * DWH - 1/31/99 (Gee has it really been 5 years?)
- *
- * Solaris 2.8 7/26/99
- * Use /dev/xsvc for everything
- *
- * DWH - 7/26/99 - Solaris8/dev/xsvc changes
- *
- * TSI - 2001.09 - SPARC changes
- */
-
-#if defined(i386) && !defined(__SOL8__)
- if(Base < 0xFFFFF)
- sprintf(vtname, "/dev/vt%02d", xf86Info.vtno);
- else
-#endif
- {
- if (!xf86LinearVidMem())
- FatalError("xf86MapVidMem: no aperture device\n");
-
- strcpy(vtname, apertureDevName);
- }
-
- fd = open(vtname, (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (fd < 0)
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- vtname, strerror(errno));
-
- base = mmap(NULL, Size,
- (Flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, (off_t)Base);
- close(fd);
- if (base == MAP_FAILED)
- FatalError("xf86MapVidMem: mmap failure: %s\n",
- strerror(errno));
-
- return(base);
-}
-
-/* ARGSUSED */
-void
-xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap(Base, Size);
-}
-
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-#ifdef i386
-static Bool ExtendedEnabled = FALSE;
-#endif
-
-void
-xf86EnableIO(void)
-{
-#ifdef i386
- if (ExtendedEnabled)
- return;
-
- if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
- FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n");
-
- ExtendedEnabled = TRUE;
-#endif /* i386 */
-}
-
-void
-xf86DisableIO(void)
-{
-#ifdef i386
- if(!ExtendedEnabled)
- return;
-
- sysi86(SI86V86, V86SC_IOPL, 0);
-
- ExtendedEnabled = FALSE;
-#endif /* i386 */
-}
-
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool xf86DisableInterrupts(void)
-{
-#ifdef i386
- if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
- return FALSE;
-
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-
- if (!ExtendedEnabled)
- sysi86(SI86V86, V86SC_IOPL, 0);
-#endif /* i386 */
-
- return TRUE;
-}
-
-void xf86EnableInterrupts(void)
-{
-#ifdef i386
- if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
- return;
-
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-
- if (!ExtendedEnabled)
- sysi86(SI86V86, V86SC_IOPL, 0);
-#endif /* i386 */
-}
-
-void
-xf86MapReadSideEffects(int ScreenNum, int Flags, pointer Base,
- unsigned long Size)
-{
-}
-
-Bool
-xf86CheckMTRR(int ScreenNum)
-{
- return FALSE;
-}
-
diff --git a/hw/xfree86/os-support/sysv/sysv_init.c b/hw/xfree86/os-support/sysv/sysv_init.c
deleted file mode 100644
index 1e9166712..000000000
--- a/hw/xfree86/os-support/sysv/sysv_init.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_init.c,v 3.5 1998/07/25 16:57:08 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Wexelblat makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: sysv_init.c /main/4 1996/02/21 17:54:31 kaleb $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static Bool KeepTty = FALSE;
-#ifdef SVR4
-static Bool Protect0 = FALSE;
-#endif
-static int VTnum = -1;
-
-
-void
-xf86OpenConsole()
-{
- int fd;
- struct vt_mode VT;
- char vtname1[10],vtname2[10];
- MessageType from = X_PROBED;
-
- if (serverGeneration == 1)
- {
- /* check if we're run with euid==0 */
- if (geteuid() != 0)
- {
- FatalError("xf86OpenConsole: Server must be suid root\n");
- }
-
-#ifdef SVR4
- /* Protect page 0 to help find NULL dereferencing */
- /* mprotect() doesn't seem to work */
- if (Protect0)
- {
- int fd = -1;
-
- if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: cannot open /dev/zero (%s)\n",
- strerror(errno));
- }
- else
- {
- if ((int)mmap(0, 0x1000, PROT_NONE,
- MAP_FIXED | MAP_SHARED, fd, 0) == -1)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: failed to protect page 0 (%s)\n",
- strerror(errno));
- }
- close(fd);
- }
- }
-#endif
- /*
- * setup the virtual terminal manager
- */
- if (VTnum != -1)
- {
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
- }
- else
- {
- if ((fd = open("/dev/console",O_WRONLY,0)) < 0)
- {
- FatalError(
- "xf86OpenConsole: Cannot open /dev/console (%s)\n",
- strerror(errno));
- }
- if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1))
- {
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
- }
- close(fd);
- }
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
-
- sprintf(vtname1,"/dev/vc%02d",xf86Info.vtno); /* ESIX */
- sprintf(vtname2,"/dev/vt%02d",xf86Info.vtno); /* rest of the world */
-
- if (!KeepTty)
- {
- setpgrp();
- }
-
- if (((xf86Info.consoleFd = open(vtname1, O_RDWR|O_NDELAY, 0)) < 0) &&
- ((xf86Info.consoleFd = open(vtname2, O_RDWR|O_NDELAY, 0)) < 0))
- {
- FatalError("xf86OpenConsole: Cannot open %s (%s) (%s)\n",
- vtname2, vtname1, strerror(errno));
- }
-
- /* change ownership of the vt */
- if (chown(vtname1, getuid(), getgid()) < 0)
- {
- chown(vtname2, getuid(), getgid());
- }
-
- /*
- * now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- }
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
- {
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
- }
-
- signal(SIGUSR1, xf86VTRequest);
-
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- {
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
- }
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
- {
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
- }
- }
- else
- {
- /* serverGeneration != 1 */
- /*
- * now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
- }
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- {
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
- }
- /*
- * If the server doesn't have the VT when the reset occurs,
- * this is to make sure we don't continue until the activate
- * signal is received.
- */
- if (!xf86Screens[0]->vtSema)
- sleep(5);
- }
- return;
-}
-
-void
-xf86CloseConsole()
-{
- struct vt_mode VT;
-
-#if 0
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno);
- ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0);
-#endif
- ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO;
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */
- }
- close(xf86Info.consoleFd); /* make the vt-manager happy */
- return;
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful
- * when debugging (so the server can receive keyboard signals.
- */
- if (!strcmp(argv[i], "-keeptty"))
- {
- KeepTty = TRUE;
- return(1);
- }
-#ifdef SVR4
- /*
- * Undocumented flag to protect page 0 from read/write to help
- * catch NULL pointer dereferences. This is purely a debugging
- * flag.
- */
- if (!strcmp(argv[i], "-protect0"))
- {
- Protect0 = TRUE;
- return(1);
- }
-#endif
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
- {
- UseMsg();
- VTnum = -1;
- return(0);
- }
- return(1);
- }
- return(0);
-}
-
-void
-xf86UseMsg()
-{
- ErrorF("vtXX use the specified VT number\n");
- ErrorF("-keeptty ");
- ErrorF("don't detach controlling tty (for debugging only)\n");
- return;
-}
diff --git a/hw/xfree86/os-support/sysv/sysv_io.c b/hw/xfree86/os-support/sysv/sysv_io.c
deleted file mode 100644
index d48efd76e..000000000
--- a/hw/xfree86/os-support/sysv/sysv_io.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_io.c,v 3.11 2003/02/17 15:12:00 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Dawes makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: sysv_io.c /main/8 1996/10/19 18:08:06 kaleb $ */
-
-#include "X.h"
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-void
-xf86SoundKbdBell(int loudness, int pitch, int duration)
-{
- if (loudness && pitch)
- {
-#ifdef KDMKTONE
- /*
- * If we have KDMKTONE use it to avoid putting the server
- * to sleep
- */
- ioctl(xf86Info.consoleFd, KDMKTONE,
- ((1193190 / pitch) & 0xffff) |
- (((unsigned long)duration *
- loudness / 50) << 16));
-#else
- ioctl(xf86Info.consoleFd, KIOCSOUND, 1193180 / pitch);
- usleep(xf86Info.bell_duration * loudness * 20);
- ioctl(xf86Info.consoleFd, KIOCSOUND, 0);
-#endif
- }
-}
-
-void
-xf86SetKbdLeds(int leds)
-{
-#ifdef KBIO_SETMODE
- ioctl(xf86Info.consoleFd, KBIO_SETMODE, KBM_AT);
- ioctl(xf86Info.consoleFd, KDSETLED, leds);
- ioctl(xf86Info.consoleFd, KBIO_SETMODE, KBM_XT);
-#endif
-}
-
-#include "xf86OSKbd.h"
-
-Bool
-xf86OSKbdPreInit(InputInfoPtr pInfo)
-{
- return FALSE;
-}
diff --git a/hw/xfree86/os-support/sysv/sysv_mouse.c b/hw/xfree86/os-support/sysv/sysv_mouse.c
deleted file mode 100644
index cfba52c2c..000000000
--- a/hw/xfree86/os-support/sysv/sysv_mouse.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_mouse.c,v 1.3 1999/09/04 13:04:49 dawes Exp $ */
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#include "X.h"
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xqueue.h"
-
-static int
-SupportedInterfaces(void)
-{
- /* XXX Need to check this. */
- return MSE_SERIAL | MSE_AUTO;
-}
-
-#ifndef ISC
-static const char *internalNames[] = {
- "Xqueue",
- NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
- return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
- int i;
-
- for (i = 0; internalNames[i]; i++)
- if (xf86NameCmp(protocol, internalNames[i]) == 0)
- return TRUE;
- return FALSE;
-}
-#endif
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
- OSMouseInfoPtr p;
-
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
- if (!p)
- return NULL;
- p->SupportedInterfaces = SupportedInterfaces;
-#ifndef ISC
- p->BuiltinNames = BuiltinNames;
- p->CheckProtocol = CheckProtocol;
- p->PreInit = XqueueMousePreInit;
-#endif
- return p;
-}
-
diff --git a/hw/xfree86/os-support/sysv/sysv_video.c b/hw/xfree86/os-support/sysv/sysv_video.c
deleted file mode 100644
index c0460f524..000000000
--- a/hw/xfree86/os-support/sysv/sysv_video.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c,v 3.21 2003/03/14 13:46:08 tsi Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Thomas Roell and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Thomas Roell and
- * David Wexelblat makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: sysv_video.c /main/8 1996/10/25 11:38:09 kaleb $ */
-
-#include "X.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#ifndef SI86IOPL
-#define SET_IOPL() sysi86(SI86V86,V86SC_IOPL,PS_IOPL)
-#define RESET_IOPL() sysi86(SI86V86,V86SC_IOPL,0)
-#else
-#define SET_IOPL() sysi86(SI86IOPL,3)
-#define RESET_IOPL() sysi86(SI86IOPL,0)
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-/*
- * XXX Support for SVR3 will need to be reworked if needed. In particular
- * the Region parameter is no longer passed, and will need to be dealt
- * with internally if required.
- * OK, i'll rework that thing ... (clean it up a lot)
- * SVR3 Support only with SVR3_MMAPDRV (mr)
- *
- */
-
-#ifdef HAS_SVR3_MMAPDRV
-#ifndef MMAP_DEBUG
-#define MMAP_DEBUG 3
-#endif
-
-struct kd_memloc MapDSC;
-int mmapFd = -2;
-
-static int
-mmapStat(pointer Base, unsigned long Size) {
-
- int nmmreg,i=0,region=-1;
- mmapinfo_t *ibuf;
-
- nmmreg = ioctl(mmapFd, GETNMMREG);
-
- if(nmmreg <= 0)
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "\nNo physical memory mapped currently.\n\n");
- else {
- if((ibuf = (mmapinfo_t *)malloc(nmmreg*sizeof(mmapinfo_t))) == NULL)
- xf86Msg(X_WARNING,
- "Couldn't allocate memory 4 mmapinfo_t\n");
- else {
- if(ioctl(mmapFd, GETMMREG, ibuf) != -1)
- {
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "# mmapStat: [Size=%x,Base=%x]\n", Size, Base);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "# Physical Address Size Reference Count\n");
- for(i = 0; i < nmmreg; i++) {
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "%-4d 0x%08X %5dk %5d ",
- i, ibuf[i].physaddr, ibuf[i].length/1024, ibuf[i].refcnt);
- if (ibuf[i].physaddr == Base || ibuf[i].length == Size ) {
- xf86MsgVerb(X_INFO, MMAP_DEBUG,"MATCH !!!");
- if (region==-1) region=i;
- }
- xf86ErrorFVerb(MMAP_DEBUG, "\n");
- }
- xf86ErrorFVerb(MMAP_DEBUG, "\n");
- }
- free(ibuf);
- }
- }
- if (region == -1 && nmmreg > 0) region=region * i;
- return(region);
-}
-#endif
-
-
-static Bool
-linearVidMem()
-{
-#ifdef SVR4
- return TRUE;
-#elif defined(HAS_SVR3_MMAPDRV)
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "# xf86LinearVidMem: MMAP 2.2.2 called\n");
-
- if(mmapFd >= 0) return TRUE;
-
- if ((mmapFd = open("/dev/mmap", O_RDWR)) != -1)
- {
- if(ioctl(mmapFd, GETVERSION) < 0x0222) {
- xf86Msg(X_WARNING,
- "xf86LinearVidMem: MMAP 2.2.2 or above required\n");
- xf86ErrorF("\tlinear memory access disabled\n");
- return FALSE;
- }
- return TRUE;
- }
- xf86Msg(X_WARNING, "xf86LinearVidMem: failed to open /dev/mmap (%s)\n",
- strerror(errno));
- xf86ErrorF("\tlinear memory access disabled\n");
- return FALSE;
-#endif
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
- int fd;
-
-#if defined(SVR4)
- fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
- if (fd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, (off_t)Base);
- close(fd);
- if (base == MAP_FAILED)
- {
- FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", Size, Base, strerror(errno));
- }
-#else /* SVR4 */
-#ifdef HAS_SVR3_MMAPDRV
-
- xf86MsgVerb(X_INFO, MMAP_DEBUG, "# xf86MapVidMem: MMAP 2.2.2 called\n");
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION));
- if (ioctl(mmapFd, GETVERSION) == -1)
- {
- xf86LinearVidMem();
- }
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION));
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "xf86MapVidMem: Screen: %d\n", ScreenNum);
- mmapStat(Base,Size);
- /* To force the MMAP driver to provide the address */
- base = (pointer)0;
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "xf86MapVidMem: [s=%x,a=%x]\n", Size, Base);
- MapDSC.vaddr = (char *)base;
- MapDSC.physaddr = (char *)Base;
- MapDSC.length = Size;
- MapDSC.ioflg = 1;
- if(mmapFd >= 0)
- {
- if((base = (pointer)ioctl(mmapFd, MAP, &MapDSC)) == (pointer)-1)
- {
- FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", Size, Base, strerror(errno));
- /* NOTREACHED */
- }
-
- /* Next time we want the same address! */
- MapDSC.vaddr = (char *)base;
- }
-
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "MapDSC.vaddr : 0x%x\n", MapDSC.vaddr);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "MapDSC.physaddr: 0x%x\n", MapDSC.physaddr);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "MapDSC.length : %d\n", MapDSC.length);
- mmapStat(Base,Size);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "xf86MapVidMem: [s=%x,a=%x,b=%x]\n", Size, Base, base);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "xf86MapVidMem: SUCCEED Mapping FrameBuffer \n");
-#endif /* HAS_SVR3_MMAPDRV */
-#endif /* SVR4 */
- return(base);
-}
-
-/* ARGSUSED */
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-#if defined (SVR4)
- munmap(Base, Size);
-#else /* SVR4 */
-#ifdef HAS_SVR3_MMAPDRV
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "# xf86UnMapVidMem: UNMapping FrameBuffer\n");
- mmapStat(Base,Size);
- ioctl(mmapFd, UNMAPRM , Base);
- mmapStat(Base,Size);
- xf86MsgVerb(X_INFO, MMAP_DEBUG,
- "# xf86UnMapVidMem: Screen: %d [v=%x]\n", ScreenNum, Base);
-#endif /* HAS_SVR3_MMAPDRV */
-#endif /* SVR4 */
- return;
-}
-
-#if defined(SVR4) && defined(i386) && !defined(sun)
-/*
- * For some SVR4 versions, a 32-bit read is done for the first location
- * in each page when the page is first mapped. If this is done while
- * memory access is enabled for regions that have read side-effects,
- * this can cause unexpected results, including lockups on some hardware.
- * This function is called to make sure each page is mapped while it is
- * safe to do so.
- */
-
-/*
- * XXX Should get this the correct way (see os/xalloc.c), but since this is
- * for one platform I'll be lazy.
- */
-#define X_PAGE_SIZE 4096
-
-static void
-readSideEffects(int ScreenNum, pointer Base, unsigned long Size)
-{
- unsigned long base, end, addr;
- CARD32 val;
-
- base = (unsigned long)Base;
- end = base + Size;
-
- for (addr = base; addr < end; addr += X_PAGE_SIZE)
- val = *(volatile CARD32 *)addr;
-}
-#endif
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = linearVidMem();
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
-#if defined(SVR4) && defined(i386) && !defined(sun)
- pVidMem->readSideEffects = readSideEffects;
-#endif
- pVidMem->initialised = TRUE;
-}
-
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-static Bool ExtendedEnabled = FALSE;
-static Bool InitDone = FALSE;
-
-void
-xf86EnableIO()
-{
- int i;
-
- if (ExtendedEnabled)
- return;
-
- if (SET_IOPL() < 0)
- {
- FatalError(
- "xf86EnableIO: Failed to set IOPL for extended I/O\n");
- }
- ExtendedEnabled = TRUE;
-
- return;
-}
-
-void
-xf86DisableIO()
-{
- if (!ExtendedEnabled)
- return;
-
- RESET_IOPL();
- ExtendedEnabled = FALSE;
-
- return;
-}
-
-/***************************************************************************/
-/* Interrupt Handling section */
-/***************************************************************************/
-
-Bool
-xf86DisableInterrupts()
-{
- if (!ExtendedEnabled)
- {
- if (SET_IOPL() < 0)
- {
- return(FALSE);
- }
- }
-
-#ifdef __GNUC__
- __asm__ __volatile__("cli");
-#else
- asm("cli");
-#endif /* __GNUC__ */
-
- if (!ExtendedEnabled)
- {
- RESET_IOPL();
- }
- return(TRUE);
-}
-
-void
-xf86EnableInterrupts()
-{
- if (!ExtendedEnabled)
- {
- if (SET_IOPL() < 0)
- {
- return;
- }
- }
-
-#ifdef __GNUC__
- __asm__ __volatile__("sti");
-#else
- asm("sti");
-#endif /* __GNUC__ */
-
- if (!ExtendedEnabled)
- {
- RESET_IOPL();
- }
- return;
-}
diff --git a/hw/xfree86/os-support/sysv/xqueue.c b/hw/xfree86/os-support/sysv/xqueue.c
deleted file mode 100644
index 0478ee65e..000000000
--- a/hw/xfree86/os-support/sysv/xqueue.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/xqueue.c,v 3.20 2001/03/06 18:20:31 dawes Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993-1999 by The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The copyright holders make no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: xqueue.c /main/8 1996/10/19 18:08:11 kaleb $ */
-
-#include "X.h"
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xqueue.h"
-
-#ifdef XQUEUE
-
-static xqEventQueue *XqueQaddr;
-static int xqueFd = -1;
-#ifndef XQUEUE_ASYNC
-static int xquePipe[2];
-#endif
-
-#ifdef XKB
-#include "inputstr.h"
-#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBstr.h>
-#include <X11/extensions/XKBsrv.h>
-extern Bool noXkbExtension;
-#endif
-
-#include "xf86Xinput.h"
-#include "mipointer.h"
-
-typedef struct {
- int xquePending;
- int xqueSema;
-} XqInfoRec, *XqInfoPtr;
-
-InputInfoPtr XqMouse = NULL;
-InputInfoPtr XqKeyboard = NULL;
-
-#ifndef XQUEUE_ASYNC
-/*
- * xf86XqueSignal --
- * Trap the signal from xqueue and let it be known that events are
- * ready for collection
- */
-
-static void
-xf86XqueSignal(int signum)
-{
- ((XqInfoPtr)(((MouseDevPtr)(XqMouse->private))->mousePriv))->xquePending = 1;
- /*
- * This is a hack, but it is the only reliable way I can find of letting
- * the main select() loop know that there is more input waiting. Receiving
- * a signal will interrupt select(), but there is no way I can find of
- * dealing with events that come in between the end of processing the
- * last set and when select() gets called.
- *
- * Suggestions for better ways of dealing with this without going back to
- * asynchronous event processing are welcome.
- */
-#ifdef DEBUG
- ErrorF("xf86XqueSignal\n");
-#endif
- write(xquePipe[1], "X", 1);
- signal(SIGUSR2, xf86XqueSignal);
-}
-#endif
-
-
-/*
- * xf86XqueKbdProc --
- * Handle the initialization, etc. of a keyboard.
- */
-
-int
-xf86XqueKbdProc(DeviceIntPtr pKeyboard, int what)
-{
- KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
-
- switch (what) {
-
- case DEVICE_INIT:
-
- xf86KbdGetMapping(&keySyms, modMap);
-
- /*
- * Get also the initial led settings
- */
- ioctl(xf86Info.consoleFd, KDGETLED, &xf86Info.leds);
-
- /*
- * Perform final initialization of the system private keyboard
- * structure and fill in various slots in the device record
- * itself which couldn't be filled in before.
- */
- pKeyboard->public.on = FALSE;
-
-#ifdef XKB
- if (noXkbExtension) {
-#endif
- InitKeyboardDeviceStruct((DevicePtr)xf86Info.pKeyboard,
- &keySyms,
- modMap,
- xf86KbdBell,
- (KbdCtrlProcPtr)xf86KbdCtrl);
-#ifdef XKB
- } else {
- XkbComponentNamesRec names;
- if (XkbInitialMap) {
- if ((xf86Info.xkbkeymap = strchr(XkbInitialMap, '/')) != NULL)
- xf86Info.xkbkeymap++;
- else
- xf86Info.xkbkeymap = XkbInitialMap;
- }
- if (xf86Info.xkbkeymap) {
- names.keymap = xf86Info.xkbkeymap;
- names.keycodes = NULL;
- names.types = NULL;
- names.compat = NULL;
- names.symbols = NULL;
- names.geometry = NULL;
- } else {
- names.keymap = NULL;
- names.keycodes = xf86Info.xkbkeycodes;
- names.types = xf86Info.xkbtypes;
- names.compat = xf86Info.xkbcompat;
- names.symbols = xf86Info.xkbsymbols;
- names.geometry = xf86Info.xkbgeometry;
- }
- if ((xf86Info.xkbkeymap || xf86Info.xkbcomponents_specified)
- && (xf86Info.xkbmodel == NULL || xf86Info.xkblayout == NULL)) {
- xf86Info.xkbrules = NULL;
- }
- XkbSetRulesDflts(xf86Info.xkbrules, xf86Info.xkbmodel,
- xf86Info.xkblayout, xf86Info.xkbvariant,
- xf86Info.xkboptions);
- XkbInitKeyboardDeviceStruct(pKeyboard,
- &names,
- &keySyms,
- modMap,
- xf86KbdBell,
- (KbdCtrlProcPtr)xf86KbdCtrl);
- }
-#endif
-
- xf86InitKBD(TRUE);
- break;
-
- case DEVICE_ON:
- pKeyboard->public.on = TRUE;
- xf86InitKBD(FALSE);
- break;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pKeyboard->public.on = FALSE;
- break;
- }
-
- return (Success);
-}
-
-
-/*
- * xf86XqueEvents --
- * Get some events from our queue. Nothing to do here ...
- */
-
-void
-xf86XqueEvents()
-{
-}
-
-
-#ifdef XQUEUE_ASYNC
-static void XqDoInput(int signum);
-#endif
-
-void
-XqReadInput(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- XqInfoPtr pXq;
- xqEvent *XqueEvents;
- int XqueHead;
- char buf[100];
- signed char dx, dy;
-
- if (xqueFd < 0)
- return;
-
- pMse = pInfo->private;
- pXq = pMse->mousePriv;
-
- XqueEvents = XqueQaddr->xq_events;
- XqueHead = XqueQaddr->xq_head;
-
- while (XqueHead != XqueQaddr->xq_tail) {
- switch (XqueEvents[XqueHead].xq_type) {
- case XQ_BUTTON:
- pMse->PostEvent(pInfo, ~(XqueEvents[XqueHead].xq_code) & 0x07,
- 0, 0, 0, 0);
-#ifdef DEBUG
- ErrorF("xqueue: buttons: %d\n", ~(XqueEvents[XqueHead].xq_code) & 0x07);
-#endif
- break;
-
- case XQ_MOTION:
- dx = (signed char)XqueEvents[XqueHead].xq_x;
- dy = (signed char)XqueEvents[XqueHead].xq_y;
- pMse->PostEvent(pInfo, ~(XqueEvents[XqueHead].xq_code) & 0x07,
- (int)dx, (int)dy, 0, 0);
-#ifdef DEBUG
- ErrorF("xqueue: Motion: (%d, %d) (buttons: %d)\n", dx, dy, ~(XqueEvents[XqueHead].xq_code) & 0x07);
-#endif
- break;
-
- case XQ_KEY:
- /* XXX Need to deal with the keyboard part nicely. */
-#ifdef DEBUG
- ErrorF("xqueue: key: %d\n", XqueEvents[XqueHead].xq_code);
-#endif
- xf86PostKbdEvent(XqueEvents[XqueHead].xq_code);
- break;
- default:
- xf86Msg(X_WARNING, "Unknown Xque Event: 0x%02x\n",
- XqueEvents[XqueHead].xq_type);
- }
-
- if ((++XqueHead) == XqueQaddr->xq_size) XqueHead = 0;
- xf86Info.inputPending = TRUE;
- }
-
- /* reenable the signal-processing */
-#ifdef XQUEUE_ASYNC
- signal(SIGUSR2, XqDoInput);
-#endif
-
-#ifndef XQUEUE_ASYNC
- {
- int rval;
-
- while ((rval = read(xquePipe[0], buf, sizeof(buf))) > 0)
-#ifdef DEBUG
- ErrorF("Read %d bytes from xquePipe[0]\n", rval);
-#else
- ;
-#endif
- }
-#endif
-
-#ifdef DEBUG
- ErrorF("Leaving XqReadInput()\n");
-#endif
- pXq->xquePending = 0;
- XqueQaddr->xq_head = XqueQaddr->xq_tail;
- XqueQaddr->xq_sigenable = 1; /* UNLOCK */
-}
-
-#ifdef XQUEUE_ASYNC
-static void
-XqDoInput(int signum)
-{
- if (XqMouse)
- XqReadInput(XqMouse);
-}
-#endif
-
-static void
-XqBlock(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
-{
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- XqInfoPtr pXq;
- /*
- * On MP SVR4 boxes, a race condition exists because the XQUEUE does
- * not have anyway to lock it for exclusive access. This results in one
- * processor putting something on the queue at the same time the other
- * processor is taking it something off. The count of items in the queue
- * can get off by 1. This just goes and checks to see if an extra event
- * was put in the queue a during this period. The signal for this event
- * was ignored while processing the previous event.
- */
-
- pInfo = blockData;
- pMse = pInfo->private;
- pXq = pMse-> mousePriv;
- if (!pXq->xquePending) {
-#ifdef DEBUG
- ErrorF("XqBlock: calling XqReadInput()\n");
-#endif
- XqReadInput((InputInfoPtr)blockData);
- } else {
-#ifdef DEBUG
- ErrorF("XqBlock: not calling XqReadInput()\n");
-#endif
- ;
- }
- /*
- * Make sure that any events that come in here are passed on without.
- * waiting for the next wakeup.
- */
- if (xf86Info.inputPending) {
-#ifdef DEBUG
- ErrorF("XqBlock: calling ProcessInputEvents()\n");
-#endif
- ProcessInputEvents();
- } else {
-#ifdef DEBUG
- ErrorF("XqBlock: not calling ProcessInputEvents()\n");
-#endif
- ;
- }
-}
-
-/*
- * XqEnable --
- * Enable the handling of the Xque
- */
-
-static int
-XqEnable(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- XqInfoPtr pXq;
- static struct kd_quemode xqueMode;
- static Bool was_here = FALSE;
-
- pMse = pInfo->private;
- pXq = pMse->mousePriv;
-
- if (xqueFd < 0) {
- if ((xqueFd = open("/dev/mouse", O_RDONLY | O_NDELAY)) < 0) {
- if (xf86GetAllowMouseOpenFail()) {
- xf86Msg(X_WARNING,
- "%s: Cannot open /dev/mouse (%s) - Continuing...\n",
- pInfo->name, strerror(errno));
- return Success;
- } else {
- xf86Msg(X_ERROR, "%s: Cannot open /dev/mouse (%s)\n",
- pInfo->name, strerror(errno));
- return !Success;
- }
- }
- }
-#ifndef XQUEUE_ASYNC
- if (!was_here) {
- pipe(xquePipe);
- fcntl(xquePipe[0], F_SETFL, fcntl(xquePipe[0], F_GETFL, 0) | O_NDELAY);
- fcntl(xquePipe[1], F_SETFL, fcntl(xquePipe[1], F_GETFL, 0) | O_NDELAY);
- was_here = TRUE;
- }
-#endif
-
- if (pXq->xqueSema++ == 0) {
-#ifdef XQUEUE_ASYNC
- (void) signal(SIGUSR2, XqDoInput);
-#else
- (void) signal(SIGUSR2, xf86XqueSignal);
-#endif
- xqueMode.qsize = 64; /* max events */
- xqueMode.signo = SIGUSR2;
- ioctl(xf86Info.consoleFd, KDQUEMODE, NULL);
-
- if (ioctl(xf86Info.consoleFd, KDQUEMODE, &xqueMode) < 0) {
- xf86Msg(X_ERROR, "%s: Cannot set KDQUEMODE", pInfo->name);
- return !Success;
- }
- XqueQaddr = (xqEventQueue *)xqueMode.qaddr;
- XqueQaddr->xq_sigenable = 1; /* UNLOCK */
- }
-
- return Success;
-}
-
-
-
-/*
- * xf86XqueDisable --
- * disable the handling of the Xque
- */
-
-static int
-XqDisable(InputInfoPtr pInfo)
-{
- MouseDevPtr pMse;
- XqInfoPtr pXq;
-
- pMse = pInfo->private;
- pXq = pMse->mousePriv;
-
- if (pXq->xqueSema-- == 1)
- {
- XqueQaddr->xq_sigenable = 0; /* LOCK */
-
- if (ioctl(xf86Info.consoleFd, KDQUEMODE, NULL) < 0) {
- xf86Msg(X_ERROR, "%s: Cannot unset KDQUEMODE", pInfo->name);
- return !Success;
- }
- }
-
- if (xqueFd >= 0) {
- close(xqueFd);
- xqueFd = -1;
- }
-
- return Success;
-}
-
-/*
- * XqMouseProc --
- * Handle the initialization, etc. of a mouse
- */
-
-static int
-XqMouseProc(DeviceIntPtr pPointer, int what)
-{
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- unchar map[4];
- int ret;
-
- pInfo = pPointer->public.devicePrivate;
- pMse = pInfo->private;
- pMse->device = pPointer;
-
- switch (what) {
- case DEVICE_INIT:
- pPointer->public.on = FALSE;
-
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
-
- InitPointerDeviceStruct((DevicePtr)pPointer,
- map,
- 3,
- miPointerGetMotionEvents,
- pMse->Ctrl,
- miPointerGetMotionBufferSize());
- /* X valuator */
- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 0);
- /* Y valuator */
- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
- xf86InitValuatorDefaults(pPointer, 1);
- xf86MotionHistoryAllocate(pInfo);
- RegisterBlockAndWakeupHandlers(XqBlock, (WakeupHandlerProcPtr)NoopDDA,
- pInfo);
- break;
-
- case DEVICE_ON:
- pMse->lastButtons = 0;
- pMse->emulateState = 0;
- pPointer->public.on = TRUE;
- ret = XqEnable(pInfo);
-#ifndef XQUEUE_ASYNC
- if (xquePipe[0] != -1) {
- pInfo->fd = xquePipe[0];
- AddEnabledDevice(xquePipe[0]);
- }
-#endif
- return ret;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pPointer->public.on = FALSE;
- ret = XqDisable(pInfo);
-#ifndef XQUEUE_ASYNC
- if (xquePipe[0] != -1) {
- RemoveEnabledDevice(xquePipe[0]);
- pInfo->fd = -1;
- }
-#endif
- return ret;
- }
- return Success;
-}
-
-Bool
-XqueueMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
- MouseDevPtr pMse;
- XqInfoPtr pXq;
-
- pMse = pInfo->private;
- pMse->protocol = protocol;
- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
- pXq = pMse->mousePriv = xnfcalloc(sizeof(XqInfoRec), 1);
-
- /* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, NULL, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- /* Process common mouse options (like Emulate3Buttons, etc). */
- pMse->CommonOptions(pInfo);
-
- /* Setup the local procs. */
- pInfo->device_control = XqMouseProc;
-#ifdef XQUEUE_ASYNC
- pInfo->read_input = NULL;
-#else
- pInfo->read_input = XqReadInput;
-#endif
- pInfo->fd = -1;
-
- XqMouse = pInfo;
-
- pInfo->flags |= XI86_CONFIGURED;
- return TRUE;
-}
-
-#endif /* XQUEUE */
diff --git a/hw/xfree86/os-support/sysv/xqueue.h b/hw/xfree86/os-support/sysv/xqueue.h
deleted file mode 100644
index 2085a3e70..000000000
--- a/hw/xfree86/os-support/sysv/xqueue.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/xqueue.h,v 1.1 1999/05/22 08:40:18 dawes Exp $ */
-
-#ifndef _XF86_XQUEUE_H_
-#define _XF86_XQUEUE_H_
-
-Bool XqueueMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags);
-
-#endif
diff --git a/hw/xfree86/os-support/xf86OSKbd.h b/hw/xfree86/os-support/xf86OSKbd.h
deleted file mode 100644
index 917b11526..000000000
--- a/hw/xfree86/os-support/xf86OSKbd.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.6 2003/11/03 05:11:51 tsi Exp $ */
-/*
- * Copyright (c) 2002-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- *
- * Author: Ivan Pascal.
- */
-
-#include "xf86Xinput.h"
-
-Bool ATScancode(InputInfoPtr pInfo, int *scanCode);
-
-/* Public interface to OS-specific keyboard support. */
-
-typedef int (*KbdInitProc)(InputInfoPtr pInfo, int what);
-typedef int (*KbdOnProc)(InputInfoPtr pInfo, int what);
-typedef int (*KbdOffProc)(InputInfoPtr pInfo, int what);
-typedef void (*BellProc)(InputInfoPtr pInfo,
- int loudness, int pitch, int duration);
-typedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds);
-typedef int (*GetLedsProc)(InputInfoPtr pInfo);
-typedef void (*SetKbdRepeatProc)(InputInfoPtr pInfo, char rad);
-typedef void (*KbdGetMappingProc)(InputInfoPtr pInfo,
- KeySymsPtr pKeySyms, CARD8* pModMap);
-typedef int (*GetSpecialKeyProc)(InputInfoPtr pInfo, int scanCode);
-typedef Bool (*SpecialKeyProc)(InputInfoPtr pInfo,
- int key, Bool down, int modifiers);
-typedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode);
-typedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo);
-typedef void (*PostEventProc)(InputInfoPtr pInfo,
- unsigned int key, Bool down);
-typedef struct {
- int begin;
- int end;
- unsigned char *map;
-} TransMapRec, *TransMapPtr;
-
-typedef struct {
- KbdInitProc KbdInit;
- KbdOnProc KbdOn;
- KbdOffProc KbdOff;
- BellProc Bell;
- SetLedsProc SetLeds;
- GetLedsProc GetLeds;
- SetKbdRepeatProc SetKbdRepeat;
- KbdGetMappingProc KbdGetMapping;
- RemapScanCodeProc RemapScanCode;
- GetSpecialKeyProc GetSpecialKey;
- SpecialKeyProc SpecialKey;
-
- OpenKeyboardProc OpenKeyboard;
- PostEventProc PostEvent;
-
- int rate;
- int delay;
- int bell_pitch;
- int bell_duration;
- Bool autoRepeat;
- unsigned long leds;
- unsigned long xledsMask;
- unsigned long keyLeds;
- int scanPrefix;
- Bool vtSwitchSupported;
- Bool CustomKeycodes;
- Bool noXkb;
- Bool isConsole;
- TransMapPtr scancodeMap;
- TransMapPtr specialMap;
-
- /* os specific */
- pointer private;
- int kbdType;
- int consType;
- int wsKbdType;
- Bool sunKbd;
- Bool Panix106;
-
-} KbdDevRec, *KbdDevPtr;
-
-typedef enum {
- PROT_STD,
- PROT_XQUEUE,
- PROT_WSCONS,
- PROT_USB,
- PROT_UNKNOWN_KBD
-} KbdProtocolId;
-
-typedef struct {
- const char *name;
- KbdProtocolId id;
-} KbdProtocolRec;
-
-Bool xf86OSKbdPreInit(InputInfoPtr pInfo);
-
-/* Adjust this when the kbd interface changes. */
-
-/*
- * History:
- *
- * 1.0.0 - Initial version.
- */
-
-#define OS_KBD_VERSION_MAJOR 1
-#define OS_KBD_VERSION_MINOR 0
-#define OS_KBD_VERSION_PATCH 0
-
-#define OS_KBD_VERSION_CURRENT \
- BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \
- OS_KBD_VERSION_MINOR, \
- OS_KBD_VERSION_PATCH)
-
diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h
deleted file mode 100644
index ee6313a3b..000000000
--- a/hw/xfree86/os-support/xf86OSmouse.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.24 2003/11/03 05:11:51 tsi Exp $ */
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Public interface to OS-specific mouse support. */
-
-#ifndef _XF86OSMOUSE_H_
-#define _XF86OSMOUSE_H_
-
-#include "xf86Xinput.h"
-
-/* Mouse interface classes */
-#define MSE_NONE 0x00
-#define MSE_SERIAL 0x01 /* serial port */
-#define MSE_BUS 0x02 /* old bus mouse */
-#define MSE_PS2 0x04 /* standard read-only PS/2 */
-#define MSE_XPS2 0x08 /* extended PS/2 */
-#define MSE_AUTO 0x10 /* auto-detect (PnP) */
-#define MSE_MISC 0x20 /* The OS layer will identify the
- * specific protocol names that are
- * supported for this class. */
-
-/* Mouse Protocol IDs. */
-typedef enum {
- PROT_UNKNOWN = -2,
- PROT_UNSUP = -1, /* protocol is not supported */
- PROT_MS = 0,
- PROT_MSC,
- PROT_MM,
- PROT_LOGI,
- PROT_LOGIMAN,
- PROT_MMHIT,
- PROT_GLIDE,
- PROT_IMSERIAL,
- PROT_THINKING,
- PROT_ACECAD,
- PROT_VALUMOUSESCROLL,
- PROT_PS2,
- PROT_GENPS2,
- PROT_IMPS2,
- PROT_EXPPS2,
- PROT_THINKPS2,
- PROT_MMPS2,
- PROT_GLIDEPS2,
- PROT_NETPS2,
- PROT_NETSCPS2,
- PROT_BM,
- PROT_AUTO,
- PROT_SYSMOUSE,
- PROT_NUMPROTOS /* This must always be last. */
-} MouseProtocolID;
-
-struct _MouseDevRec;
-
-typedef int (*GetInterfaceTypesProc)(void);
-typedef const char **(*BuiltinNamesProc)(void);
-typedef Bool (*CheckProtocolProc)(const char *protocol);
-typedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
- int flags);
-typedef const char *(*DefaultProtocolProc)(void);
-typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
-typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
- int res);
-typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
- int flags);
-typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
-
-/*
- * OSMouseInfoRec is used to pass information from the OSMouse layer to the
- * OS-independent mouse driver.
- */
-typedef struct {
- GetInterfaceTypesProc SupportedInterfaces;
- BuiltinNamesProc BuiltinNames;
- CheckProtocolProc CheckProtocol;
- BuiltinPreInitProc PreInit;
- DefaultProtocolProc DefaultProtocol;
- SetupAutoProc SetupAuto;
- SetResProc SetPS2Res;
- SetResProc SetBMRes;
- SetResProc SetMiscRes;
- FindDeviceProc FindDevice;
- GuessProtocolProc GuessProtocol;
-} OSMouseInfoRec, *OSMouseInfoPtr;
-
-/*
- * SupportedInterfaces: Returns the mouse interface types that the OS support.
- * If MSE_MISC is returned, then the BuiltinNames and
- * CheckProtocol should be set.
- *
- * BuiltinNames: Returns the names of the protocols that are fully handled
- * in the OS-specific code. These are names that don't appear
- * directly in the main "mouse" driver.
- *
- * CheckProtocol: Checks if the protocol name given is supported by the
- * OS. It should return TRUE for both "builtin" protocols and
- * protocols of type MSE_MISC that are supported by the OS.
- *
- * PreInit: The PreInit function for protocols that are builtin. This
- * function is passed the protocol name.
- *
- * DefaultProtocol: Returns the name of a default protocol that should be used
- * for the OS when none has been supplied in the config file.
- * This should only be set when there is a reasonable default.
- *
- * SetupAuto: This function can be used to do OS-specific protocol
- * auto-detection. It returns the name of the detected protocol,
- * or NULL when detection fails. It may also adjust one or more
- * of the "protoPara" values for the detected protocol by setting
- * then to something other than -1. SetupAuto gets called in two
- * ways. The first is before any devices have been opened. This
- * can be used when the protocol "Auto" always maps to a single
- * protocol type. The second is with the device open, allowing
- * OS-specific probing to be done.
- *
- * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
- * protocol types.
- *
- * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
- *
- * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
- *
- * FindDevice: This function gets called when no Device has been specified
- * in the config file. OS-specific methods may be used to guess
- * which input device to use. This function is called after the
- * pre-open attempts at protocol discovery are done, but before
- * the device is open. I.e., after the first SetupAuto() call,
- * after the DefaultProtocol() call, but before the PreInit()
- * call. Available protocol information may be used in locating
- * the default input device.
- *
- * GuessProtocol: A last resort attempt at guessing the mouse protocol by
- * whatever OS-specific means might be available. OS-independent
- * things should be in the mouse driver. This function gets
- * called after the mouse driver's OS-independent methods have
- * failed.
- */
-
-extern OSMouseInfoPtr xf86OSMouseInit(int flags);
-
-/* Adjust this when the mouse interface changes. */
-
-/*
- * History:
- *
- * 1.0.0 - Everything up to when versioning was started.
- * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
- *
- */
-
-#define OS_MOUSE_VERSION_MAJOR 1
-#define OS_MOUSE_VERSION_MINOR 1
-#define OS_MOUSE_VERSION_PATCH 0
-
-#define OS_MOUSE_VERSION_CURRENT \
- BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
- OS_MOUSE_VERSION_MINOR, \
- OS_MOUSE_VERSION_PATCH)
-
-#define HAVE_GUESS_PROTOCOL \
- (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
- BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
-
-#define HAVE_FIND_DEVICE \
- (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
- BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
-
-/*
- * Mouse device record. This is shared by the mouse driver and the OSMouse
- * layer.
- */
-
-typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
-typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
-typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
-typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
-
-typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
- int dx, int dy, int dz, int dw);
-typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
-
-typedef struct _MouseDevRec {
- PtrCtrlProcPtr Ctrl;
- PostMseEventProc PostEvent;
- MouseCommonOptProc CommonOptions;
- DeviceIntPtr device;
- const char * mseDevice;
- const char * protocol;
- MouseProtocolID protocolID;
- MouseProtocolID oldProtocolID; /* hack */
- int class;
- int mseModel;
- int baudRate;
- int oldBaudRate;
- int sampleRate;
- int lastButtons;
- int threshold; /* acceleration */
- int num;
- int den;
- int buttons; /* # of buttons */
- int emulateState; /* automata state for 2 button mode */
- Bool emulate3Buttons;
- Bool emulate3ButtonsSoft;
- int emulate3Timeout;/* Timeout for 3 button emulation */
- Bool chordMiddle;
- Bool flipXY;
- int invX;
- int invY;
- int mouseFlags; /* Flags to Clear after opening
- * mouse dev */
- int truebuttons; /* (not used)
- * Arg to maintain before
- * emulate3buttons timer callback */
- int resolution;
- int negativeZ; /* button mask */
- int positiveZ; /* button mask */
- int negativeW; /* button mask */
- int positiveW; /* button mask */
- pointer buffer; /* usually an XISBuffer* */
- int protoBufTail;
- unsigned char protoBuf[8];
- unsigned char protoPara[8];
- unsigned char inSync; /* driver in sync with datastream */
- pointer mousePriv; /* private area */
- InputInfoPtr pInfo;
- int origProtocolID;
- const char * origProtocol;
- Bool emulate3Pending;/* timer waiting */
- CARD32 emulate3Expires;/* time to fire emulation code */
- Bool emulateWheel;
- int wheelInertia;
- int wheelButtonMask;
- int negativeX; /* Button values. Unlike the Z and */
- int positiveX; /* W equivalents, these are button */
- int negativeY; /* values rather than button masks. */
- int positiveY;
- int wheelYDistance;
- int wheelXDistance;
- Bool autoProbe;
- checkMovementsProc checkMovements;
- autoProbeProc autoProbeMouse;
- collectDataProc collectData;
- dataGoodProc dataGood;
- int angleOffset;
- pointer pDragLock; /* drag lock area */
-} MouseDevRec, *MouseDevPtr;
-
-/* Z axis mapping */
-#define MSE_NOZMAP 0
-#define MSE_MAPTOX -1
-#define MSE_MAPTOY -2
-#define MSE_MAPTOZ -3
-#define MSE_MAPTOW -4
-
-/* Generalize for other axes. */
-#define MSE_NOAXISMAP MSE_NOZMAP
-
-#define MSE_MAXBUTTONS 12
-#define MSE_DFLTBUTTONS 3
-
-#endif /* _XF86OSMOUSE_H_ */
diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h
deleted file mode 100644
index 865738c40..000000000
--- a/hw/xfree86/os-support/xf86OSpriv.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.6 2003/08/24 17:37:03 dawes Exp $ */
-/*
- * Copyright (c) 1999-2000 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef _XF86OSPRIV_H
-#define _XF86OSPRIV_H
-
-typedef pointer (*MapMemProcPtr)(int, unsigned long, unsigned long, int);
-typedef void (*UnmapMemProcPtr)(int, pointer, unsigned long);
-typedef pointer (*SetWCProcPtr)(int, unsigned long, unsigned long, Bool,
- MessageType);
-typedef void (*ProtectMemProcPtr)(int, pointer, unsigned long, Bool);
-typedef void (*UndoWCProcPtr)(int, pointer);
-typedef void (*ReadSideEffectsProcPtr)(int, pointer, unsigned long);
-
-typedef struct {
- Bool initialised;
- MapMemProcPtr mapMem;
- UnmapMemProcPtr unmapMem;
- ProtectMemProcPtr protectMem;
- SetWCProcPtr setWC;
- UndoWCProcPtr undoWC;
- ReadSideEffectsProcPtr readSideEffects;
- Bool linearSupported;
-} VidMemInfo, *VidMemInfoPtr;
-
-void xf86OSInitVidMem(VidMemInfoPtr);
-
-#endif /* _XF86OSPRIV_H */
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
deleted file mode 100644
index 4d3205eb4..000000000
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ /dev/null
@@ -1,758 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.95 2003/11/17 22:20:40 dawes Exp $ */
-/*
- * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1992 by David Dawes <dawes@XFree86.org>
- * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
- * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
- * Copyright 1994-2003 by The XFree86 Project, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holders
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holders make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-/* $XConsortium: xf86_OSlib.h /main/22 1996/10/27 11:06:31 kaleb $ */
-
-/*
- * This is private, and should not be included by any drivers. Drivers
- * may include xf86_OSproc.h to get prototypes for public interfaces.
- */
-
-#ifndef _XF86_OSLIB_H
-#define _XF86_OSLIB_H
-
-#include <X11/Xos.h>
-#include <X11/Xfuncproto.h>
-
-/*
- * Define some things from the "ANSI" C wrappers that are needed in the
- * the core server.
- */
-#ifndef HAVE_WRAPPER_DECLS
-#define HAVE_WRAPPER_DECLS
-#undef usleep
-#define usleep(a) xf86usleep(a)
-extern void xf86usleep(unsigned long);
-extern int xf86getpagesize(void);
-extern int xf86GetErrno(void);
-typedef unsigned long xf86size_t;
-typedef signed long xf86ssize_t;
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stddef.h>
-
-/**************************************************************************/
-/* SYSV386 (SVR3, SVR4) - But not Solaris8 */
-/**************************************************************************/
-#if (defined(SYSV) || defined(SVR4)) && \
- !defined(DGUX) && !defined(sgi) && \
- !defined(__SOL8__) && \
- (!defined(sun) || defined(i386))
-# ifdef SCO325
-# ifndef _SVID3
-# define _SVID3
-# endif
-# ifndef _NO_STATIC
-# define _NO_STATIC
-# endif
-# endif
-# include <sys/ioctl.h>
-# include <signal.h>
-# include <termio.h>
-# include <sys/stat.h>
-# include <sys/types.h>
-# if defined(SCO) || defined(ISC)
-# include <sys/param.h>
-# endif
-
-# ifdef ISC
-# define TIOCMSET (TIOC|26) /* set all modem bits */
-# define TIOCMBIS (TIOC|27) /* bis modem bits */
-# define TIOCMBIC (TIOC|28) /* bic modem bits */
-# define TIOCMGET (TIOC|29) /* get all modem bits */
-# endif
-
-# include <errno.h>
-
-# if defined(PowerMAX_OS)
-# define HAS_USL_VTS
-# include <sys/immu.h>
-# include <sys/sysmacros.h>
-# elif defined(_NEED_SYSI86)
-# include <sys/immu.h>
-# if !(defined (sun) && defined (i386) && defined (SVR4))
-# include <sys/region.h>
-# endif
-# include <sys/proc.h>
-# include <sys/tss.h>
-# include <sys/sysi86.h>
-# if defined(SVR4) && !defined(sun)
-# include <sys/seg.h>
-# endif /* SVR4 && !sun */
-# if defined(sun) && defined (i386) && defined (SVR4) /* Solaris? */
-# if !defined(V86SC_IOPL) /* Solaris 7? */
-# include <sys/v86.h> /* Nope */
-# endif /* V86SC_IOPL */
-# else
-# include <sys/v86.h> /* Not solaris */
-# endif /* sun && i386 && SVR4 */
-# if defined(sun) && defined (i386) && defined (SVR4)
-# include <sys/psw.h>
-# endif
-# endif /* _NEED_SYSI86 */
-
-# if defined(HAS_SVR3_MMAPDRV)
-# include <sys/sysmacros.h>
-# if !defined(_NEED_SYSI86)
-# include <sys/immu.h>
-# include <sys/region.h>
-# endif
-# include <sys/mmap.h> /* MMAP driver header */
-# endif
-
-# if !defined(sun) || !defined(sparc)
-# define HAS_USL_VTS
-# endif
-# if !defined(sun)
-# include <sys/emap.h>
-# endif
-# if defined(SCO)
-# include <sys/vtkd.h>
-# include <sys/console.h>
-# include <sys/scankbd.h>
-# include <sys/vid.h>
-# define LED_CAP CLKED
-# define LED_NUM NLKED
-# define LED_SCR SLKED
-# elif defined(HAS_USL_VTS)
-# include <sys/at_ansi.h>
-# include <sys/kd.h>
-# include <sys/vt.h>
-# endif /* SCO */
-
-# if !defined(VT_ACKACQ)
-# define VT_ACKACQ 2
-# endif /* !VT_ACKACQ */
-
-# if defined(SCO)
-# include <sys/sysmacros.h>
-# define POSIX_TTY
-# endif /* SCO */
-
-# if defined(SVR4) || defined(SCO325)
-# include <sys/mman.h>
-# if !(defined(sun) && defined (i386) && defined (SVR4))
-# define DEV_MEM "/dev/pmem"
-# elif defined(PowerMAX_OS)
-# define DEV_MEM "/dev/iomem"
-# endif
-# ifdef SCO325
-# undef DEV_MEM
-# define DEV_MEM "/dev/mem"
-# endif
-# define CLEARDTR_SUPPORT
-# define POSIX_TTY
-# endif /* SVR4 */
-
-# ifdef ISC
-# include <termios.h>
-# define POSIX_TTY
-# endif
-
-# if defined(sun) && defined (i386) && defined (SVR4)
-# define USE_VT_SYSREQ
-# define VT_SYSREQ_DEFAULT TRUE
-# endif
-
-# if defined(ATT) && !defined(i386)
-# define i386 /* not defined in ANSI C mode */
-# endif /* ATT && !i386 */
-
-# if (defined(ATT) || defined(SVR4)) && !defined(sun) && !defined(SCO325)
-# ifndef XQUEUE
-# define XQUEUE
-# endif
-# include <sys/xque.h>
-# endif /* ATT || SVR4 */
-
-# ifdef SYSV
-# if !defined(ISC) || defined(ISC202) || defined(ISC22)
-# define NEED_STRERROR
-# endif
-# endif
-
-#endif /* (SYSV || SVR4) && !DGUX */
-
-/**********
- * Good ol' Solaris8, and its lack of VT support
- ***********/
-
-#if defined(__SOL8__) || (defined(sun) && !defined(i386))
-# include <sys/mman.h>
-# include <errno.h>
-# ifdef i386
-# include <sys/sysi86.h>
-# endif
-# include <sys/psw.h>
-
-# include <termio.h>
-# include <sys/fbio.h>
-# include <sys/kbd.h>
-# include <sys/kbio.h>
-
-# define LED_CAP LED_CAPS_LOCK
-# define LED_NUM LED_NUM_LOCK
-# define LED_SCR LED_SCROLL_LOCK
-
-# include <signal.h>
-
-#endif /* __SOL8__ */
-
-
-
-/**************************************************************************/
-/* DG/ux R4.20MU03 Intel AViion Machines */
-/**************************************************************************/
-#if defined(DGUX) && defined(SVR4)
-#include <sys/ioctl.h>
-#include <signal.h>
-#include <ctype.h>
-#include <termios.h> /* Use termios for BSD Flavor ttys */
-#include <sys/termios.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <errno.h>
-#include <sys/sysi86.h>
-#include <unistd.h>
-#include <sys/proc.h>
-#include <sys/map.h>
-#include <sys/sysmacros.h>
-#include <sys/mman.h> /* Memory handling */
-#include <sys/kd.h> /* definitios for KDENABIO KDDISABIO needed for IOPL s */
-#include <sys/kbd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/stream.h>
-#include <sys/ptms.h>
-
-#include <sys/socket.h>
-#include <sys/utsname.h>
-#include <sys/stropts.h>
-#include <sys/sockio.h>
-
-
-#define POSIX_TTY
-
-#undef HAS_USL_VTS
-#undef USE_VT_SYSREQ
-#undef VT_ACKACQ
-
-#define LED_CAP KBD_LED_CAPS_LOCK
-#define LED_NUM KBD_LED_NUM_LOCK
-#define LED_SCR KBD_LED_SCROLL_LOCK
-
-#define KDGKBTYPE KBD_GET_LANGUAGE
-
-
-/* General keyboard types */
-# define KB_84 2
-# define KB_101 1 /* Because ioctl(dgkeybdFd,KBD_GET_LANGUAGE,&type) gives 1=US keyboard */
-# define KB_OTHER 3
-
-#define KDSETLED KBD_SET_LED
-#define KDGETLED KBD_GET_STATE
-#undef KDMKTONE
-#define KDMKTONE KBD_TONE_HIGH
-
-
-#undef DEV_MEM
-#define DEV_MEM "/dev/mem"
-#define CLEARDTR_SUPPORT
-
-#undef VT_SYSREQ_DEFAULT
-#define VT_SYSREQ_DEFAULT FALSE /* Make sure that we dont define any VTs since DG/ux has none */
-
-#endif /* DGUX && SVR4 */
-
-/**************************************************************************/
-/* Linux */
-/**************************************************************************/
-#if defined(linux)
-# include <sys/ioctl.h>
-# include <signal.h>
-# include <termio.h>
-# ifdef __sparc__
-# include <sys/param.h>
-# endif
-
-# include <errno.h>
-
-# include <sys/stat.h>
-
-# define HAS_USL_VTS
-# include <sys/mman.h>
-# include <sys/kd.h>
-# include <sys/vt.h>
-# define LDGMAP GIO_SCRNMAP
-# define LDSMAP PIO_SCRNMAP
-# define LDNMAP LDSMAP
-
-# define CLEARDTR_SUPPORT
-# define USE_VT_SYSREQ
-
-# define POSIX_TTY
-
-#endif /* linux */
-
-/**************************************************************************/
-/* LynxOS AT */
-/**************************************************************************/
-#if defined(Lynx)
-
-# include <termio.h>
-# include <sys/ioctl.h>
-# include <param.h>
-# include <signal.h>
-# include <kd.h>
-# include <vt.h>
-# include <sys/stat.h>
-
-# include <errno.h>
-extern int errno;
-
-/* smem_create et.al. to access physical memory */
-# include <smem.h>
-
-/* keyboard types */
-# define KB_84 1
-# define KB_101 2
-# define KB_OTHER 3
-
-/* atc drivers ignores argument to VT_RELDISP ioctl */
-# define VT_ACKACQ 2
-
-# include <termios.h>
-# define POSIX_TTY
-# define CLEARDTR_SUPPORT
-
-/* LynxOS 2.5.1 has these */
-# ifdef LED_NUMLOCK
-# define LED_CAP LED_CAPSLOCK
-# define LED_NUM LED_NUMLOCK
-# define LED_SCR LED_SCROLLOCK
-# endif
-
-#endif /* Lynx */
-
-/**************************************************************************/
-/* 386BSD and derivatives, BSD/386 */
-/**************************************************************************/
-
-#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
-# undef __386BSD__
-#endif
-
-#ifdef CSRG_BASED
-# include <sys/ioctl.h>
-# include <signal.h>
-
-# include <termios.h>
-# define termio termios
-# define POSIX_TTY
-
-# include <errno.h>
-
-# if !defined(LINKKIT)
- /* Don't need this stuff for the Link Kit */
-# if defined(__bsdi__)
-# include <i386/isa/pcconsioctl.h>
-# define CONSOLE_X_MODE_ON PCCONIOCRAW
-# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
-# define CONSOLE_X_BELL PCCONIOCBEEP
-# else /* __bsdi__ */
-# if defined(__OpenBSD__)
-# ifdef PCCONS_SUPPORT
-# include <machine/pccons.h>
-# undef CONSOLE_X_MODE_ON
-# undef CONSOLE_X_MODE_OFF
-# undef CONSOLE_X_BELL
-# endif
-# endif
-# ifdef SYSCONS_SUPPORT
-# define COMPAT_SYSCONS
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# include <machine/console.h>
-# else
-# if defined(__FreeBSD__)
-# include <osreldate.h>
-# if __FreeBSD_version >= 410000
-# include <sys/consio.h>
-# include <sys/kbio.h>
-# else
-# include <machine/console.h>
-# endif /* FreeBSD 4.1 RELEASE or lator */
-# else
-# include <sys/console.h>
-# endif
-# endif
-# endif /* SYSCONS_SUPPORT */
-# if defined(PCVT_SUPPORT)
-# if !defined(SYSCONS_SUPPORT)
- /* no syscons, so include pcvt specific header file */
-# if defined(__FreeBSD__)
-# include <machine/pcvt_ioctl.h>
-# else
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# if !defined(WSCONS_SUPPORT)
-# include <machine/pcvt_ioctl.h>
-# endif /* WSCONS_SUPPORT */
-# else
-# include <sys/pcvt_ioctl.h>
-# endif /* __NetBSD__ */
-# endif /* __FreeBSD__ || __OpenBSD__ */
-# else /* pcvt and syscons: hard-code the ID magic */
-# define VGAPCVTID _IOWR('V',113, struct pcvtid)
- struct pcvtid {
- char name[16];
- int rmajor, rminor;
- };
-# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
-# endif /* PCVT_SUPPORT */
-# ifdef WSCONS_SUPPORT
-# include <dev/wscons/wsconsio.h>
-# include <dev/wscons/wsdisplay_usl_io.h>
-# endif /* WSCONS_SUPPORT */
-# if defined(__FreeBSD__)
-# include <osreldate.h>
-# if __FreeBSD_version >= 500013
-# include <sys/mouse.h>
-# else
-# undef MOUSE_GETINFO
-# include <machine/mouse.h>
-# endif
-# endif
- /* Include these definitions in case ioctl_pc.h didn't get included */
-# ifndef CONSOLE_X_MODE_ON
-# define CONSOLE_X_MODE_ON _IO('t',121)
-# endif
-# ifndef CONSOLE_X_MODE_OFF
-# define CONSOLE_X_MODE_OFF _IO('t',122)
-# endif
-# ifndef CONSOLE_X_BELL
-# define CONSOLE_X_BELL _IOW('t',123,int[2])
-# endif
-# ifndef CONSOLE_X_TV_ON
-# define CONSOLE_X_TV_ON _IOW('t',155,int)
-# define XMODE_RGB 0
-# define XMODE_NTSC 1
-# define XMODE_PAL 2
-# define XMODE_SECAM 3
-# endif
-# ifndef CONSOLE_X_TV_OFF
-# define CONSOLE_X_TV_OFF _IO('t',156)
-# endif
-#ifndef CONSOLE_GET_LINEAR_INFO
-# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
-#endif
-#ifndef CONSOLE_GET_IO_INFO
-# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
-#endif
-#ifndef CONSOLE_GET_MEM_INFO
-# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
-#endif
-# endif /* __bsdi__ */
-# endif /* !LINKKIT */
-
-# include <sys/types.h>
-# include <sys/mman.h>
-# include <sys/stat.h>
-
-# if defined(__bsdi__)
-# include <sys/param.h>
-# if (_BSDI_VERSION < 199510)
-# include <i386/isa/vgaioctl.h>
-# endif
-# endif /* __bsdi__ */
-
-#ifdef USE_I386_IOPL
-#include <machine/sysarch.h>
-#endif
-
-# define CLEARDTR_SUPPORT
-
-# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
-# define USE_VT_SYSREQ
-# endif
-
-#endif /* CSRG_BASED */
-
-/**************************************************************************/
-/* OS/2 */
-/**************************************************************************/
-/* currently OS/2 with a modified EMX/GCC compiler only */
-#if defined(__UNIXOS2__)
-# include <signal.h>
-# include <errno.h>
-# include <sys/stat.h>
-
-/* I would have liked to have this included here always, but
- * it causes clashes for BYTE and BOOL with Xmd.h, which is too dangerous.
- * So I'll include it in place where I know it does no harm.
- */
-#if defined(I_NEED_OS2_H)
-# undef BOOL
-# undef BYTE
-# include <os2.h>
-#endif
-
- /* keyboard types */
-# define KB_84 1
-# define KB_101 2
-/* could detect more keyboards */
-# define KB_OTHER 3
-
- /* LEDs */
-# define LED_CAP 0x40
-# define LED_NUM 0x20
-# define LED_SCR 0x10
-
- /* mouse driver */
-# define OSMOUSE_ONLY
-# define MOUSE_PROTOCOL_IN_KERNEL
-
-extern char* __XOS2RedirRoot(char*);
-
-#endif
-
-/**************************************************************************/
-/* QNX4 */
-/**************************************************************************/
-/* This is the QNX code for Watcom 10.6 and QNX 4.x */
-#if defined(QNX4)
-#include <signal.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <termios.h>
-#include <ioctl.h>
-#include <sys/param.h>
-
-/* Warning: by default, the fd_set size is 32 in QNX! */
-#define FD_SETSIZE 256
-#include <sys/select.h>
-
- /* keyboard types */
-# define KB_84 1
-# define KB_101 2
-# define KB_OTHER 3
-
- /* LEDs */
-# define LED_CAP 0x04
-# define LED_NUM 0x02
-# define LED_SCR 0x01
-
-# define POSIX_TTY
-# define OSMOUSE_ONLY
-# define MOUSE_PROTOCOL_IN_KERNEL
-
-#define TIOCM_DTR 0x0001 /* data terminal ready */
-#define TIOCM_RTS 0x0002 /* request to send */
-#define TIOCM_CTS 0x1000 /* clear to send */
-#define TIOCM_DSR 0x2000 /* data set ready */
-#define TIOCM_RI 0x4000 /* ring */
-#define TIOCM_RNG TIOCM_RI
-#define TIOCM_CD 0x8000 /* carrier detect */
-#define TIOCM_CAR TIOCM_CD
-#define TIOCM_LE 0x0100 /* line enable */
-#define TIOCM_ST 0x0200 /* secondary transmit */
-#define TIOCM_SR 0x0400 /* secondary receive */
-
-#endif
-
-/**************************************************************************/
-/* QNX/Neutrino */
-/**************************************************************************/
-/* This is the Neutrino code for for NTO2.0 and GCC */
-#if defined(__QNXNTO__)
-#include <signal.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <termios.h>
-#include <ioctl.h>
-#include <sys/param.h>
-
-/* Warning: by default, the fd_set size is 32 in NTO! */
-#define FD_SETSIZE 256
-#include <sys/select.h>
-
- /* keyboard types */
-# define KB_84 1
-# define KB_101 2
-# define KB_OTHER 3
-
-# define POSIX_TTY
-
-#endif
-
-/**************************************************************************/
-/* GNU/Hurd */
-/**************************************************************************/
-#if defined(__GNU__)
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <termios.h>
-#include <sys/stat.h>
-#include <assert.h>
-
-#define POSIX_TTY
-#define USE_OSMOUSE
-
-#endif /* __GNU__ */
-
-/**************************************************************************/
-/* IRIX */
-/**************************************************************************/
-#if defined(sgi)
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#endif
-
-/**************************************************************************/
-/* Generic */
-/**************************************************************************/
-
-#include <sys/wait.h> /* May need to adjust this for other OSs */
-
-/*
- * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
- * and it's safe, so just do it.
- */
-#if !defined(O_NDELAY) && defined(O_NONBLOCK)
-# define O_NDELAY O_NONBLOCK
-#endif /* !O_NDELAY && O_NONBLOCK */
-
-#if !defined(MAXHOSTNAMELEN)
-# define MAXHOSTNAMELEN 32
-#endif /* !MAXHOSTNAMELEN */
-
-#if !defined(X_NOT_POSIX)
-# if defined(_POSIX_SOURCE)
-# include <limits.h>
-# else
-# define _POSIX_SOURCE
-# include <limits.h>
-# undef _POSIX_SOURCE
-# endif /* _POSIX_SOURCE */
-#endif /* !X_NOT_POSIX */
-#if !defined(PATH_MAX)
-# if defined(MAXPATHLEN)
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
-#ifdef NEED_STRERROR
-# ifndef strerror
-extern char *sys_errlist[];
-extern int sys_nerr;
-# define strerror(n) \
- ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error"
-# endif /* !strerror */
-#endif /* NEED_STRERROR */
-
-#if defined(ISC) || defined(Lynx)
-#define rint(x) RInt(x)
-double RInt(
- double x
-);
-#endif
-
-#ifndef DEV_MEM
-#define DEV_MEM "/dev/mem"
-#endif
-
-#ifndef VT_SYSREQ_DEFAULT
-#define VT_SYSREQ_DEFAULT FALSE
-#endif
-
-#ifdef OSMOUSE_ONLY
-# ifndef MOUSE_PROTOCOL_IN_KERNEL
-# define MOUSE_PROTOCOL_IN_KERNEL
-# endif
-#endif
-
-#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-
-#ifndef NO_COMPILER_H
-#include "compiler.h"
-#endif
-
-#endif /* _XF86_OSLIB_H */
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
deleted file mode 100644
index 09d3f2861..000000000
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1992 by David Dawes <dawes@XFree86.org>
- * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
- * Copyright 1994-2003 by The XFree86 Project, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holders
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holders make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.57 2003/10/07 23:14:54 herrb Exp $ */
-
-#ifndef _XF86_OSPROC_H
-#define _XF86_OSPROC_H
-
-#ifdef XF86_OS_PRIVS
-#include "xf86Pci.h"
-#endif
-
-/*
- * The actual prototypes have been pulled into this seperate file so
- * that they can can be used without pulling in all of the OS specific
- * stuff like sys/stat.h, etc. This casues problem for loadable modules.
- */
-
-/*
- * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The
- * flags may be used as hints. For example it would be permissible to
- * enable write combining for memory marked only for framebuffer use.
- */
-
-#define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */
-#define VIDMEM_MMIO 0x02 /* memory for I/O use */
-#define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */
-#define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */
-#define VIDMEM_SPARSE 0x10 /* sparse mapping required
- * assumed when VIDMEM_MMIO is
- * set. May be used with
- * VIDMEM_FRAMEBUFFER) */
-#define VIDMEM_READONLY 0x20 /* read-only mapping
- * used when reading BIOS images
- * through xf86MapVidMem() */
-
-/*
- * OS-independent modem state flags for xf86SetSerialModemState() and
- * xf86GetSerialModemState().
- */
-#define XF86_M_LE 0x001 /* line enable */
-#define XF86_M_DTR 0x002 /* data terminal ready */
-#define XF86_M_RTS 0x004 /* request to send */
-#define XF86_M_ST 0x008 /* secondary transmit */
-#define XF86_M_SR 0x010 /* secondary receive */
-#define XF86_M_CTS 0x020 /* clear to send */
-#define XF86_M_CAR 0x040 /* carrier detect */
-#define XF86_M_RNG 0x080 /* ring */
-#define XF86_M_DSR 0x100 /* data set ready */
-
-#ifdef XF86_OS_PRIVS
-extern void xf86WrapperInit(void);
-#endif
-
-#ifndef NO_OSLIB_PROTOTYPES
-/*
- * This is to prevent re-entrancy to FatalError() when aborting.
- * Anything that can be called as a result of AbortDDX() should use this
- * instead of FatalError().
- */
-
-#define xf86FatalError(a, b) \
- if (dispatchException & DE_TERMINATE) { \
- ErrorF(a, b); \
- ErrorF("\n"); \
- return; \
- } else FatalError(a, b)
-
-/***************************************************************************/
-/* Prototypes */
-/***************************************************************************/
-
-#include <X11/Xfuncproto.h>
-#include "opaque.h"
-
-_XFUNCPROTOBEGIN
-
-/* public functions */
-extern Bool xf86LinearVidMem(void);
-extern Bool xf86CheckMTRR(int);
-extern pointer xf86MapVidMem(int, int, unsigned long, unsigned long);
-extern void xf86UnMapVidMem(int, pointer, unsigned long);
-extern void xf86MapReadSideEffects(int, int, pointer, unsigned long);
-extern int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int);
-extern void xf86EnableIO(void);
-extern void xf86DisableIO(void);
-extern Bool xf86DisableInterrupts(void);
-extern void xf86EnableInterrupts(void);
-extern void xf86SetTVOut(int);
-extern void xf86SetRGBOut(void);
-extern void xf86SoundKbdBell(int, int, int);
-#if defined(QNX4)
-#pragma aux xf86BusToMem modify [eax ebx ecx edx esi edi];
-#pragma aux xf86MemToBus modify [eax ebx ecx edx esi edi];
-#endif
-extern void xf86BusToMem(unsigned char *, unsigned char *, int);
-extern void xf86MemToBus(unsigned char *, unsigned char *, int);
-extern void xf86IODelay(void);
-extern void xf86UDelay(long usec);
-extern void xf86SlowBcopy(unsigned char *, unsigned char *, int);
-extern int xf86OpenSerial(pointer options);
-extern int xf86SetSerial(int fd, pointer options);
-extern int xf86SetSerialSpeed(int fd, int speed);
-extern int xf86ReadSerial(int fd, void *buf, int count);
-extern int xf86WriteSerial(int fd, const void *buf, int count);
-extern int xf86CloseSerial(int fd);
-extern int xf86FlushInput(int fd);
-extern int xf86WaitForInput(int fd, int timeout);
-extern int xf86SerialSendBreak(int fd, int duration);
-extern int xf86SetSerialModemState(int fd, int state);
-extern int xf86GetSerialModemState(int fd);
-extern int xf86SerialModemSetBits(int fd, int bits);
-extern int xf86SerialModemClearBits(int fd, int bits);
-extern int xf86LoadKernelModule(const char *pathname);
-
-/* AGP GART interface */
-
-typedef struct _AgpInfo {
- CARD32 bridgeId;
- CARD32 agpMode;
- unsigned long base;
- unsigned long size;
- unsigned long totalPages;
- unsigned long systemPages;
- unsigned long usedPages;
-} AgpInfo, *AgpInfoPtr;
-
-extern Bool xf86AgpGARTSupported(void);
-extern AgpInfoPtr xf86GetAGPInfo(int screenNum);
-extern Bool xf86AcquireGART(int screenNum);
-extern Bool xf86ReleaseGART(int screenNum);
-extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
- unsigned long *physical);
-extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
-extern Bool xf86UnbindGARTMemory(int screenNum, int key);
-extern Bool xf86EnableAGP(int screenNum, CARD32 mode);
-extern Bool xf86GARTCloseScreen(int screenNum);
-
-/* These routines are in shared/sigio.c and are not loaded as part of the
- module. These routines are small, and the code if very POSIX-signal (or
- OS-signal) specific, so it seemed better to provide more complex
- wrappers than to wrap each individual function called. */
-extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
-extern int xf86RemoveSIGIOHandler(int fd);
-extern int xf86BlockSIGIO (void);
-extern void xf86UnblockSIGIO (int);
-#ifdef XFree86Server
-extern void xf86AssertBlockedSIGIO (char *);
-#endif
-extern Bool xf86SIGIOSupported (void);
-
-#ifdef XF86_OS_PRIVS
-typedef void (*PMClose)(void);
-extern void xf86OpenConsole(void);
-extern void xf86CloseConsole(void);
-extern Bool xf86VTSwitchPending(void);
-extern Bool xf86VTSwitchAway(void);
-extern Bool xf86VTSwitchTo(void);
-extern void xf86VTRequest(int sig);
-extern int xf86ProcessArgument(int, char **, int);
-extern void xf86UseMsg(void);
-extern void xf86SetKbdLeds(int);
-extern int xf86GetKbdLeds(void);
-extern void xf86SetKbdRepeat(char);
-extern void xf86KbdInit(void);
-extern int xf86KbdOn(void);
-extern int xf86KbdOff(void);
-extern void xf86KbdEvents(void);
-#ifdef XQUEUE
-extern int xf86XqueKbdProc(DeviceIntPtr, int);
-extern void xf86XqueEvents(void);
-#endif
-#ifdef WSCONS_SUPPORT
-extern void xf86WSKbdEvents(void);
-#endif
-extern PMClose xf86OSPMOpen(void);
-
-#ifdef NEED_OS_RAC_PROTOS
-/* RAC-related privs */
-/* internal to os-support layer */
-resPtr xf86StdBusAccWindowsFromOS(void);
-resPtr xf86StdPciAccWindowsFromOS(void);
-resPtr xf86StdIsaAccWindowsFromOS(void);
-resPtr xf86StdAccResFromOS(resPtr ret);
-
-/* available to the common layer */
-resPtr xf86BusAccWindowsFromOS(void);
-resPtr xf86PciBusAccWindowsFromOS(void);
-#ifdef INCLUDE_UNUSED
-resPtr xf86IsaBusAccWindowsFromOS(void);
-#endif
-resPtr xf86AccResFromOS(resPtr ret);
-#endif /* NEED_OS_RAC_PROTOS */
-
-extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits);
-
-extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
-extern void xf86InitVidMem(void);
-
-#endif /* XF86_OS_PRIVS */
-
-
-_XFUNCPROTOEND
-#endif /* NO_OSLIB_PROTOTYPES */
-
-#endif /* _XF86_OSPROC_H */
diff --git a/hw/xfree86/os-support/xf86_ansic.h b/hw/xfree86/os-support/xf86_ansic.h
deleted file mode 100644
index 733a5543d..000000000
--- a/hw/xfree86/os-support/xf86_ansic.h
+++ /dev/null
@@ -1,353 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.53 2003/10/28 18:36:37 tsi Exp $ */
-/*
- * Copyright 1997-2003 by The XFree86 Project, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holders
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holders make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifndef _XF86_ANSIC_H
-#define _XF86_ANSIC_H
-
-/* Handle <stdarg.h> */
-
-#ifndef IN_MODULE
-# include <stdarg.h>
-#else /* !IN_MODULE */
-# ifndef __OS2ELF__
-# include <stdarg.h>
-# else /* __OS2ELF__ */
- /* EMX/gcc_elf under OS/2 does not have native header files */
-# if !defined (_VA_LIST)
-# define _VA_LIST
- typedef char *va_list;
-# endif
-# define _VA_ROUND(t) ((sizeof (t) + 3) & -4)
-# if !defined (va_start)
-# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4)
-# define va_end(ap) (ap = 0, (void)0)
-# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t)))
-# endif
-# endif /* __OS2ELF__ */
-#endif /* IN_MODULE */
-
-/*
- * The first set of definitions are required both for modules and
- * libc_wrapper.c.
- */
-
-#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
-
-#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || defined(SCO)
-#define HAVE_VSSCANF
-#define HAVE_VFSCANF
-#endif
-
-#ifndef NULL
-#if (defined(SVR4) || defined(SYSV)) && !defined(__GNUC__)
-#define NULL 0
-#else
-#define NULL ((void *)0)
-#endif
-#endif
-#ifndef EOF
-#define EOF (-1)
-#endif
-
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
-/* <limits.h> stuff */
-#define x_BITSPERBYTE 8
-#define x_BITS(type) (x_BITSPERBYTE * (int)sizeof(type))
-#define x_SHORTBITS x_BITS(short)
-#define x_INTBITS x_BITS(int)
-#define x_LONGBITS x_BITS(long)
-#ifndef SHRT_MIN
-#define SHRT_MIN ((short)(1 << (x_SHORTBITS - 1)))
-#endif
-
-#ifndef FONTMODULE
-#include "misc.h"
-#endif
-#include "xf86_libc.h"
-#ifndef SHRT_MAX
-#define SHRT_MAX ((short)~SHRT_MIN)
-#endif
-#ifndef USHRT_MAX
-#define USHRT_MAX ((unsigned short)~0)
-#endif
-#ifndef MINSHORT
-#define MINSHORT SHRT_MIN
-#endif
-#ifndef MAXSHORT
-#define MAXSHORT SHRT_MAX
-#endif
-#ifndef INT_MIN
-#define INT_MIN (1 << (x_INTBITS - 1))
-#endif
-#ifndef INT_MAX
-#define INT_MAX (~INT_MIN)
-#endif
-#ifndef UINT_MAX
-#define UINT_MAX (~0)
-#endif
-#ifndef MININT
-#define MININT INT_MIN
-#endif
-#ifndef MAXINT
-#define MAXINT INT_MAX
-#endif
-#ifndef LONG_MIN
-#define LONG_MIN ((long)(1 << (x_LONGBITS - 1)))
-#endif
-#ifndef LONG_MAX
-#define LONG_MAX ((long)~LONG_MIN)
-#endif
-#ifndef ULONG_MAX
-#define ULONG_MAX ((unsigned long)~0UL)
-#endif
-#ifndef MINLONG
-#define MINLONG LONG_MIN
-#endif
-#ifndef MAXLONG
-#define MAXLONG LONG_MAX
-#endif
-
-#endif /* XFree86LOADER || NEED_XF86_TYPES */
-
-#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES)
-/*
- * ANSI C compilers only.
- */
-
-/* ANSI C emulation library */
-
-extern void xf86abort(void);
-extern int xf86abs(int);
-extern double xf86acos(double);
-extern double xf86asin(double);
-extern double xf86atan(double);
-extern double xf86atan2(double,double);
-extern double xf86atof(const char*);
-extern int xf86atoi(const char*);
-extern long xf86atol(const char*);
-extern void *xf86bsearch(const void *, const void *, xf86size_t, xf86size_t,
- int (*)(const void *, const void *));
-extern double xf86ceil(double);
-extern void* xf86calloc(xf86size_t,xf86size_t);
-extern void xf86clearerr(XF86FILE*);
-extern double xf86cos(double);
-extern void xf86exit(int);
-extern double xf86exp(double);
-extern double xf86fabs(double);
-extern int xf86fclose(XF86FILE*);
-extern int xf86feof(XF86FILE*);
-extern int xf86ferror(XF86FILE*);
-extern int xf86fflush(XF86FILE*);
-extern int xf86fgetc(XF86FILE*);
-extern int xf86getc(XF86FILE*);
-extern int xf86fgetpos(XF86FILE*,XF86fpos_t*);
-extern char* xf86fgets(char*,INT32,XF86FILE*);
-extern int xf86finite(double);
-extern double xf86floor(double);
-extern double xf86fmod(double,double);
-extern XF86FILE* xf86fopen(const char*,const char*);
-extern double xf86frexp(double, int*);
-extern int xf86printf(const char*,...);
-extern int xf86fprintf(XF86FILE*,const char*,...);
-extern int xf86fputc(int,XF86FILE*);
-extern int xf86fputs(const char*,XF86FILE*);
-extern xf86size_t xf86fread(void*,xf86size_t,xf86size_t,XF86FILE*);
-extern void xf86free(void*);
-extern XF86FILE* xf86freopen(const char*,const char*,XF86FILE*);
-#if defined(HAVE_VFSCANF) || !defined(NEED_XF86_PROTOTYPES)
-extern int xf86fscanf(XF86FILE*,const char*,...);
-#else
-extern int xf86fscanf(/*XF86FILE*,const char*,char *,char *,char *,char *,
- char *,char *,char *,char *,char *,char * */);
-#endif
-extern int xf86fseek(XF86FILE*,long,int);
-extern int xf86fsetpos(XF86FILE*,const XF86fpos_t*);
-extern long xf86ftell(XF86FILE*);
-extern xf86size_t xf86fwrite(const void*,xf86size_t,xf86size_t,XF86FILE*);
-extern char* xf86getenv(const char*);
-extern int xf86isalnum(int);
-extern int xf86isalpha(int);
-extern int xf86iscntrl(int);
-extern int xf86isdigit(int);
-extern int xf86isgraph(int);
-extern int xf86islower(int);
-extern int xf86isprint(int);
-extern int xf86ispunct(int);
-extern int xf86isspace(int);
-extern int xf86isupper(int);
-extern int xf86isxdigit(int);
-extern long xf86labs(long);
-extern double xf86ldexp(double,int);
-extern double xf86log(double);
-extern double xf86log10(double);
-extern void* xf86malloc(xf86size_t);
-extern void* xf86memchr(const void*,int,xf86size_t);
-extern int xf86memcmp(const void*,const void*,xf86size_t);
-extern void* xf86memcpy(void*,const void*,xf86size_t);
-extern void* xf86memmove(void*,const void*,xf86size_t);
-extern void* xf86memset(void*,int,xf86size_t);
-extern double xf86modf(double,double*);
-extern void xf86perror(const char*);
-extern double xf86pow(double,double);
-extern void xf86qsort(void*, xf86size_t, xf86size_t,
- int(*)(const void*, const void*));
-extern void* xf86realloc(void*,xf86size_t);
-extern int xf86remove(const char*);
-extern int xf86rename(const char*,const char*);
-extern void xf86rewind(XF86FILE*);
-extern int xf86setbuf(XF86FILE*,char*);
-extern int xf86setvbuf(XF86FILE*,char*,int,xf86size_t);
-extern double xf86sin(double);
-extern int xf86sprintf(char*,const char*,...);
-extern int xf86snprintf(char*,xf86size_t,const char*,...);
-extern double xf86sqrt(double);
-#if defined(HAVE_VSSCANF) || !defined(NEED_XF86_PROTOTYPES)
-extern int xf86sscanf(char*,const char*,...);
-#else
-extern int xf86sscanf(/*char*,const char*,char *,char *,char *,char *,
- char *,char *,char *,char *,char *,char * */);
-#endif
-extern char* xf86strcat(char*,const char*);
-extern char* xf86strchr(const char*, int c);
-extern int xf86strcmp(const char*,const char*);
-extern int xf86strcasecmp(const char*,const char*);
-extern char* xf86strcpy(char*,const char*);
-extern xf86size_t xf86strcspn(const char*,const char*);
-extern char* xf86strerror(int);
-extern xf86size_t xf86strlcat(char*,const char*,xf86size_t);
-extern xf86size_t xf86strlcpy(char*,const char*,xf86size_t);
-extern xf86size_t xf86strlen(const char*);
-extern char* xf86strncat(char *, const char *, xf86size_t);
-extern int xf86strncmp(const char*,const char*,xf86size_t);
-extern int xf86strncasecmp(const char*,const char*,xf86size_t);
-extern char* xf86strncpy(char*,const char*,xf86size_t);
-extern char* xf86strpbrk(const char*,const char*);
-extern char* xf86strrchr(const char*,int);
-extern xf86size_t xf86strspn(const char*,const char*);
-extern char* xf86strstr(const char*,const char*);
-extern double xf86strtod(const char*,char**);
-extern char* xf86strtok(char*,const char*);
-extern long xf86strtol(const char*,char**,int);
-extern unsigned long xf86strtoul(const char*,char**,int);
-extern double xf86tan(double);
-extern XF86FILE* xf86tmpfile(void);
-extern char* xf86tmpnam(char*);
-extern int xf86tolower(int);
-extern int xf86toupper(int);
-extern int xf86ungetc(int,XF86FILE*);
-extern int xf86vfprintf(XF86FILE*,const char*,va_list);
-extern int xf86vsprintf(char*,const char*,va_list);
-extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list);
-
-extern int xf86open(const char*, int,...);
-extern int xf86close(int);
-extern long xf86lseek(int, long, int);
-extern int xf86ioctl(int, unsigned long, pointer);
-extern xf86ssize_t xf86read(int, void *, xf86size_t);
-extern xf86ssize_t xf86write(int, const void *, xf86size_t);
-extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */);
-extern int xf86munmap(void*, xf86size_t);
-extern int xf86stat(const char *, struct xf86stat *);
-extern int xf86fstat(int, struct xf86stat *);
-extern int xf86access(const char *, int);
-extern int xf86errno;
-extern int xf86GetErrno(void);
-
-extern double xf86HUGE_VAL;
-
-extern double xf86hypot(double,double);
-
-/* non-ANSI C functions */
-extern XF86DIR* xf86opendir(const char*);
-extern int xf86closedir(XF86DIR*);
-extern XF86DIRENT* xf86readdir(XF86DIR*);
-extern void xf86rewinddir(XF86DIR*);
-extern void xf86bcopy(const void*,void*,xf86size_t);
-extern int xf86ffs(int);
-extern char* xf86strdup(const char*);
-extern void xf86bzero(void*,unsigned int);
-extern int xf86execl(const char *, const char *, ...);
-extern long xf86fpossize(void);
-extern int xf86chmod(const char *, xf86mode_t);
-extern int xf86chown(const char *, xf86uid_t, xf86gid_t);
-extern xf86uid_t xf86geteuid(void);
-extern xf86gid_t xf86getegid(void);
-extern int xf86getpid(void);
-extern int xf86mknod(const char *, xf86mode_t, xf86dev_t);
-extern int xf86mkdir(const char *, xf86mode_t);
-unsigned int xf86sleep(unsigned int seconds);
-/* sysv IPC */
-extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
-extern char * xf86shmat(int id, char *addr, int xf86shmflg);
-extern int xf86shmdt(char *addr);
-extern int xf86shmctl(int id, int xf86cmd, pointer buf);
-
-extern int xf86setjmp(xf86jmp_buf env);
-extern int xf86setjmp0(xf86jmp_buf env);
-extern int xf86setjmp1(xf86jmp_buf env, int);
-extern int xf86setjmp1_arg2(void);
-extern int xf86setjmperror(xf86jmp_buf env);
-extern int xf86getjmptype(void);
-extern void xf86longjmp(xf86jmp_buf env, int val);
-#define xf86setjmp_macro(env) \
- (xf86getjmptype() == 0 ? xf86setjmp0((env)) : \
- (xf86getjmptype() == 1 ? xf86setjmp1((env), xf86setjmp1_arg2()) : \
- xf86setjmperror((env))))
-
-#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <ctype.h>
-#ifdef HAVE_SYSV_IPC
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#endif
-#include <sys/stat.h>
-#define stat_t struct stat
-#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */
-
-/*
- * These things are always required by drivers (but not by libc_wrapper.c),
- * even for a static server because some OSs don't provide them.
- */
-
-extern int xf86getpagesize(void);
-extern void xf86usleep(unsigned long);
-extern void xf86getsecs(long *, long *);
-#ifndef DONT_DEFINE_WRAPPERS
-#undef getpagesize
-#define getpagesize() xf86getpagesize()
-#undef usleep
-#define usleep(ul) xf86usleep(ul)
-#undef getsecs
-#define getsecs(a, b) xf86getsecs(a, b)
-#endif
-#endif /* _XF86_ANSIC_H */
diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h
deleted file mode 100644
index 61eb93d8b..000000000
--- a/hw/xfree86/os-support/xf86_libc.h
+++ /dev/null
@@ -1,704 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.60 2003/10/26 12:17:17 herrb Exp $ */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file is an attempt to make developing code for the new loadable module
- * architecure simpler. It tries to use macros to hide all libc wrappers so
- * that all that is needed to "port" a module to this architecture is to
- * include this one header file
- *
- * Revision history:
- *
- *
- * 0.4 Apr 12 1997 add the ANSI defines
- * 0.3 Feb 24 1997 handle getenv
- * 0.2 Feb 24 1997 hide few FILE functions
- * 0.1 Feb 24 1997 hide the trivial functions mem* str*
- */
-
-#ifndef XF86_LIBC_H
-#define XF86_LIBC_H 1
-
-#include "Xfuncs.h"
-
-/*
- * The first set of definitions are required both for modules and
- * libc_wrapper.c.
- */
-
-#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
-
-/*
- * First, the new data types
- *
- * note: if some pointer is declared "opaque" here, pass it between
- * xf86* functions only, and don't rely on it having a whatever internal
- * structure, even if some source file might reveal the existence of
- * such a structure.
- */
-typedef void XF86FILE; /* opaque FILE replacement */
-extern XF86FILE* xf86stdin;
-extern XF86FILE* xf86stdout;
-extern XF86FILE* xf86stderr;
-
-typedef void XF86fpos_t; /* opaque fpos_t replacement */
-
-#define _XF86NAMELEN 263 /* enough for a larger filename */
- /* (divisble by 8) */
-typedef void XF86DIR; /* opaque DIR replacement */
-
-/* Note: the following is POSIX! POSIX only requires the d_name member.
- * Normal Unix has often a number of other members, but don't rely on that
- */
-struct _xf86dirent { /* types in struct dirent/direct: */
- char d_name[_XF86NAMELEN+1]; /* char [MAXNAMLEN]; might be smaller or unaligned */
-};
-typedef struct _xf86dirent XF86DIRENT;
-
-typedef unsigned long xf86size_t;
-typedef signed long xf86ssize_t;
-typedef unsigned long xf86dev_t;
-typedef unsigned int xf86mode_t;
-typedef unsigned int xf86uid_t;
-typedef unsigned int xf86gid_t;
-
-struct xf86stat {
- xf86dev_t st_rdev; /* This is incomplete, and makes assumptions */
-};
-
-/* sysv IPC */
-typedef int xf86key_t;
-
-/* setjmp/longjmp */
-#if defined(__ia64__)
-typedef int xf86jmp_buf[1024] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
-#else
-typedef int xf86jmp_buf[1024];
-#endif
-
-/* for setvbuf */
-#define XF86_IONBF 1
-#define XF86_IOFBF 2
-#define XF86_IOLBF 3
-
-/* for open (XXX not complete) */
-#define XF86_O_RDONLY 0x0000
-#define XF86_O_WRONLY 0x0001
-#define XF86_O_RDWR 0x0002
-#define XF86_O_CREAT 0x0200
-
-/* for mmap */
-#define XF86_PROT_EXEC 0x0001
-#define XF86_PROT_READ 0x0002
-#define XF86_PROT_WRITE 0x0004
-#define XF86_PROT_NONE 0x0008
-#define XF86_MAP_FIXED 0x0001
-#define XF86_MAP_SHARED 0x0002
-#define XF86_MAP_PRIVATE 0x0004
-#define XF86_MAP_32BIT 0x0040
-#define XF86_MAP_FAILED ((void *)-1)
-
-/* for fseek */
-#define XF86_SEEK_SET 0
-#define XF86_SEEK_CUR 1
-#define XF86_SEEK_END 2
-
-/* for access */
-#define XF86_R_OK 0
-#define XF86_W_OK 1
-#define XF86_X_OK 2
-#define XF86_F_OK 3
-
-/* for chmod */
-#define XF86_S_ISUID 04000 /* set user ID on execution */
-#define XF86_S_ISGID 02000 /* set group ID on execution */
-#define XF86_S_ISVTX 01000 /* sticky bit */
-#define XF86_S_IRUSR 00400 /* read by owner */
-#define XF86_S_IWUSR 00200 /* write by owner */
-#define XF86_S_IXUSR 00100 /* execute/search by owner */
-#define XF86_S_IRGRP 00040 /* read by group */
-#define XF86_S_IWGRP 00020 /* write by group */
-#define XF86_S_IXGRP 00010 /* execute/search by group */
-#define XF86_S_IROTH 00004 /* read by others */
-#define XF86_S_IWOTH 00002 /* write by others */
-#define XF86_S_IXOTH 00001 /* execute/search by others */
-
-/* for mknod */
-#define XF86_S_IFREG 0010000
-#define XF86_S_IFCHR 0020000
-#define XF86_S_IFBLK 0040000
-#define XF86_S_IFIFO 0100000
-
-/*
- * errno values
- * They start at 1000 just so they don't match real errnos at all
- */
-#define xf86_UNKNOWN 1000
-#define xf86_EACCES 1001
-#define xf86_EAGAIN 1002
-#define xf86_EBADF 1003
-#define xf86_EEXIST 1004
-#define xf86_EFAULT 1005
-#define xf86_EINTR 1006
-#define xf86_EINVAL 1007
-#define xf86_EISDIR 1008
-#define xf86_ELOOP 1009
-#define xf86_EMFILE 1010
-#define xf86_ENAMETOOLONG 1011
-#define xf86_ENFILE 1012
-#define xf86_ENOENT 1013
-#define xf86_ENOMEM 1014
-#define xf86_ENOSPC 1015
-#define xf86_ENOTDIR 1016
-#define xf86_EPIPE 1017
-#define xf86_EROFS 1018
-#define xf86_ETXTBSY 1019
-#define xf86_ENOTTY 1020
-#define xf86_ENOSYS 1021
-#define xf86_EBUSY 1022
-#define xf86_ENODEV 1023
-#define xf86_EIO 1024
-
-/* sysv IPV */
-/* xf86shmget() */
-#define XF86IPC_CREAT 01000
-#define XF86IPC_EXCL 02000
-#define XF86IPC_NOWAIT 04000
-#define XF86SHM_R 0400
-#define XF86SHM_W 0200
-#define XF86IPC_PRIVATE ((xf86key_t)0)
-/* xf86shmat() */
-#define XF86SHM_RDONLY 010000 /* attach read-only else read-write */
-#define XF86SHM_RND 020000 /* round attach address to SHMLBA */
-#define XF86SHM_REMAP 040000 /* take-over region on attach */
-/* xf86shmclt() */
-#define XF86IPC_RMID 0
-
-#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
-
-/*
- * the rest of this file should only be included for code that is supposed
- * to go into modules
- */
-
-#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
-
-#undef abort
-#define abort() xf86abort()
-#undef abs
-#define abs(i) xf86abs(i)
-#undef acos
-#define acos(d) xf86acos(d)
-#undef asin
-#define asin(d) xf86asin(d)
-#undef atan
-#define atan(d) xf86atan(d)
-#undef atan2
-#define atan2(d1,d2) xf86atan2(d1,d2)
-#undef atof
-#define atof(ccp) xf86atof(ccp)
-#undef atoi
-#define atoi(ccp) xf86atoi(ccp)
-#undef atol
-#define atol(ccp) xf86atol(ccp)
-#undef bsearch
-#define bsearch(a,b,c,d,e) xf86bsearch(a,b,c,d,e)
-#undef ceil
-#define ceil(d) xf86ceil(d)
-#undef calloc
-#define calloc(I1,I2) xf86calloc(I1,I2)
-#undef clearerr
-#define clearerr(FP) xf86clearerr(FP)
-#undef cos
-#define cos(d) xf86cos(d)
-#undef exit
-#define exit(i) xf86exit(i)
-#undef exp
-#define exp(d) xf86exp(d)
-#undef fabs
-#define fabs(d) xf86fabs(d)
-#undef fclose
-#define fclose(FP) xf86fclose(FP)
-#undef feof
-#define feof(FP) xf86feof(FP)
-#undef ferror
-#define ferror(FP) xf86ferror(FP)
-#undef fflush
-#define fflush(FP) xf86fflush(FP)
-#undef fgetc
-#define fgetc(FP) xf86fgetc(FP)
-#undef getc
-#define getc(FP) xf86getc(FP)
-#undef fgetpos
-#define fgetpos(FP,fpp) xf86fgetpos(FP,fpp)
-#undef fgets
-#define fgets(cp,i,FP) xf86fgets(cp,i,FP)
-#undef finite
-#define finite(d) xf86finite(d)
-#undef floor
-#define floor(d) xf86floor(d)
-#undef fmod
-#define fmod(d1,d2) xf86fmod(d1,d2)
-#undef fopen
-#define fopen(ccp1,ccp2) xf86fopen(ccp1,ccp2)
-#undef printf
-#define printf xf86printf
-#undef fprintf
-#define fprintf xf86fprintf
-#undef fputc
-#define fputc(i,FP) xf86fputc(i,FP)
-#undef fputs
-#define fputs(ccp,FP) xf86fputs(ccp,FP)
-#undef fread
-#define fread(vp,I1,I2,FP) xf86fread(vp,I1,I2,FP)
-#undef free
-#define free(vp) xf86free(vp)
-#undef freopen
-#define freopen(ccp1,ccp2,FP) xf86freopen(ccp1,ccp2,FP)
-#undef frexp
-#define frexp(x,exp) xf86frexp(x,exp)
-#undef fscanf
-#define fscanf xf86fscanf
-#undef fseek
-#define fseek(FP,l,i) xf86fseek(FP,l,i)
-#undef fsetpos
-#define fsetpos(FP,cfpp) xf86fsetpos(FP,cfpp)
-#undef ftell
-#define ftell(FP) xf86ftell(FP)
-#undef fwrite
-#define fwrite(cvp,I1,I2,FP) xf86fwrite(cvp,I1,I2,FP)
-#undef getenv
-#define getenv(ccp) xf86getenv(ccp)
-#undef isalnum
-#define isalnum(i) xf86isalnum(i)
-#undef isalpha
-#define isalpha(i) xf86isalpha(i)
-#undef iscntrl
-#define iscntrl(i) xf86iscntrl(i)
-#undef isdigit
-#define isdigit(i) xf86isdigit(i)
-#undef isgraph
-#define isgraph(i) xf86isgraph(i)
-#undef islower
-#define islower(i) xf86islower(i)
-#undef isprint
-#define isprint(i) xf86isprint(i)
-#undef ispunct
-#define ispunct(i) xf86ispunct(i)
-#undef isspace
-#define isspace(i) xf86isspace(i)
-#undef isupper
-#define isupper(i) xf86isupper(i)
-#undef isxdigit
-#define isxdigit(i) xf86isxdigit(i)
-#undef labs
-#define labs(l) xf86labs(l)
-#undef ldexp
-#define ldexp(x, exp) xf86ldexp(x, exp)
-#undef log
-#define log(d) xf86log(d)
-#undef log10
-#define log10(d) xf86log10(d)
-#undef malloc
-#define malloc(I) xf86malloc(I)
-#undef memchr
-#define memchr(cvp,i,I) xf86memchr(cvp,i,I)
-#undef memcmp
-#define memcmp(cvp1,cvp2,I) xf86memcmp(cvp1,cvp2,I)
-#undef memcpy
-#define memcpy(vp,cvp,I) xf86memcpy(vp,cvp,I)
-#undef memmove
-#define memmove(vp,cvp,I) xf86memmove(vp,cvp,I)
-#undef memset
-#define memset(vp,int,I) xf86memset(vp,int,I)
-#undef modf
-#define modf(d,dp) xf86modf(d,dp)
-#undef perror
-#define perror(ccp) xf86perror(ccp)
-#undef pow
-#define pow(d1,d2) xf86pow(d1,d2)
-#undef realloc
-#define realloc(vp,I) xf86realloc(vp,I)
-#undef remove
-#define remove(ccp) xf86remove(ccp)
-#undef rename
-#define rename(ccp1,ccp2) xf86rename(ccp1,ccp2)
-#undef rewind
-#define rewind(FP) xf86rewind(FP)
-#undef setbuf
-#define setbuf(FP,cp) xf86setbuf(FP,cp)
-#undef setvbuf
-#define setvbuf(FP,cp,i,I) xf86setvbuf(FP,cp,i,I)
-#undef sin
-#define sin(d) xf86sin(d)
-#undef snprintf
-#define snprintf xf86snprintf
-#undef sprintf
-#define sprintf xf86sprintf
-#undef sqrt
-#define sqrt(d) xf86sqrt(d)
-#undef sscanf
-#define sscanf xf86sscanf
-#undef strcat
-#define strcat(cp,ccp) xf86strcat(cp,ccp)
-#undef strcmp
-#define strcmp(ccp1,ccp2) xf86strcmp(ccp1,ccp2)
-#undef strcasecmp
-#define strcasecmp(ccp1,ccp2) xf86strcasecmp(ccp1,ccp2)
-#undef strcpy
-#define strcpy(cp,ccp) xf86strcpy(cp,ccp)
-#undef strcspn
-#define strcspn(ccp1,ccp2) xf86strcspn(ccp1,ccp2)
-#undef strerror
-#define strerror(i) xf86strerror(i)
-#undef strlcat
-#define strlcat(cp,ccp,I) xf86strlcat(cp,ccp,I)
-#undef strlcpy
-#define strlcpy(cp,ccp,I) xf86strlcpy(cp,ccp,I)
-#undef strlen
-#define strlen(ccp) xf86strlen(ccp)
-#undef strncmp
-#define strncmp(ccp1,ccp2,I) xf86strncmp(ccp1,ccp2,I)
-#undef strncasecmp
-#define strncasecmp(ccp1,ccp2,I) xf86strncasecmp(ccp1,ccp2,I)
-#undef strncpy
-#define strncpy(cp,ccp,I) xf86strncpy(cp,ccp,I)
-#undef strpbrk
-#define strpbrk(ccp1,ccp2) xf86strpbrk(ccp1,ccp2)
-#undef strchr
-#define strchr(ccp,i) xf86strchr(ccp,i)
-#undef strrchr
-#define strrchr(ccp,i) xf86strrchr(ccp,i)
-#undef strspn
-#define strspn(ccp1,ccp2) xf86strspn(ccp1,ccp2)
-#undef strstr
-#define strstr(ccp1,ccp2) xf86strstr(ccp1,ccp2)
-#undef srttod
-#define strtod(ccp,cpp) xf86strtod(ccp,cpp)
-#undef strtok
-#define strtok(cp,ccp) xf86strtok(cp,ccp)
-#undef strtol
-#define strtol(ccp,cpp,i) xf86strtol(ccp,cpp,i)
-#undef strtoul
-#define strtoul(ccp,cpp,i) xf86strtoul(ccp,cpp,i)
-#undef tan
-#define tan(d) xf86tan(d)
-#undef tmpfile
-#define tmpfile() xf86tmpfile()
-#undef tolower
-#define tolower(i) xf86tolower(i)
-#undef toupper
-#define toupper(i) xf86toupper(i)
-#undef ungetc
-#define ungetc(i,FP) xf86ungetc(i,FP)
-#undef vfprinf
-#define vfprintf(p,f,a) xf86vfprintf(p,f,a)
-#undef vsnprintf
-#define vsnprintf(s,n,f,a) xf86vsnprintf(s,n,f,a)
-#undef vsprintf
-#define vsprintf(s,f,a) xf86vsprintf(s,f,a)
-/* XXX Disable assert as if NDEBUG was defined */
-/* Some X headers defined this away too */
-#undef assert
-#define assert(a) ((void)0)
-#undef HUGE_VAL
-#define HUGE_VAL xf86HUGE_VAL
-
-#undef hypot
-#define hypot(x,y) xf86hypot(x,y)
-
-#undef qsort
-#define qsort(b, n, s, f) xf86qsort(b, n, s, f)
-
-/* non-ANSI C functions */
-#undef opendir
-#define opendir(cp) xf86opendir(cp)
-#undef closedir
-#define closedir(DP) xf86closedir(DP)
-#undef readdir
-#define readdir(DP) xf86readdir(DP)
-#undef rewinddir
-#define rewinddir(DP) xf86rewinddir(DP)
-#undef bcopy
-#define bcopy(vp,cvp,I) xf86memmove(cvp,vp,I)
-#undef ffs
-#define ffs(i) xf86ffs(i)
-#undef strdup
-#define strdup(ccp) xf86strdup(ccp)
-#undef bzero
-#define bzero(vp,ui) xf86bzero(vp,ui)
-#undef execl
-#define execl xf86execl
-#undef chmod
-#define chmod(a,b) xf86chmod(a,b)
-#undef chown
-#define chown(a,b,c) xf86chown(a,b,c)
-#undef geteuid
-#define geteuid xf86geteuid
-#undef getegid
-#define getegid xf86getegid
-#undef getpid
-#define getpid xf86getpid
-#undef mknod
-#define mknod(a,b,c) xf86mknod(a,b,c)
-#undef sleep
-#define sleep(a) xf86sleep(a)
-#undef mkdir
-#define mkdir(a,b) xf86mkdir(a,b)
-#undef getpagesize
-#define getpagesize xf86getpagesize
-#undef shmget
-#define shmget(a,b,c) xf86shmget(a,b,c)
-#undef shmat
-#define shmat(a,b,c) xf86shmat(a,b,c)
-#undef shmdt
-#define shmdt(a) xf86shmdt(a)
-#undef shmctl
-#define shmctl(a,b,c) xf86shmctl(a,b,c)
-
-#undef S_ISUID
-#define S_ISUID XF86_S_ISUID
-#undef S_ISGID
-#define S_ISGID XF86_S_ISGID
-#undef S_ISVTX
-#define S_ISVTX XF86_S_ISVTX
-#undef S_IRUSR
-#define S_IRUSR XF86_S_IRUSR
-#undef S_IWUSR
-#define S_IWUSR XF86_S_IWUSR
-#undef S_IXUSR
-#define S_IXUSR XF86_S_IXUSR
-#undef S_IRGRP
-#define S_IRGRP XF86_S_IRGRP
-#undef S_IWGRP
-#define S_IWGRP XF86_S_IWGRP
-#undef S_IXGRP
-#define S_IXGRP XF86_S_IXGRP
-#undef S_IROTH
-#define S_IROTH XF86_S_IROTH
-#undef S_IWOTH
-#define S_IWOTH XF86_S_IWOTH
-#undef S_IXOTH
-#define S_IXOTH XF86_S_IXOTH
-#undef S_IFREG
-#define S_IFREG XF86_S_IFREG
-#undef S_IFCHR
-#define S_IFCHR XF86_S_IFCHR
-#undef S_IFBLK
-#define S_IFBLK XF86_S_IFBLK
-#undef S_IFIFO
-#define S_IFIFO XF86_S_IFIFO
-
-/* some types */
-#undef FILE
-#define FILE XF86FILE
-#undef fpos_t
-#define fpos_t XF86fpos_t
-#undef DIR
-#define DIR XF86DIR
-#undef DIRENT
-#define DIRENT XF86DIRENT
-#undef size_t
-#define size_t xf86size_t
-#undef ssize_t
-#define ssize_t xf86ssize_t
-#undef dev_t
-#define dev_t xf86dev_t
-#undef mode_t
-#define mode_t xf86mode_t
-#undef uid_t
-#define uid_t xf86uid_t
-#undef gid_t
-#define gid_t xf86gid_t
-#undef stat_t
-#define stat_t struct xf86stat
-
-#undef ulong
-#define ulong unsigned long
-
-/*
- * There should be no need to #undef any of these. If they are already
- * defined it is because some illegal header has been included.
- */
-
-/* some vars */
-#undef stdin
-#define stdin xf86stdin
-#undef stdout
-#define stdout xf86stdout
-#undef stderr
-#define stderr xf86stderr
-
-#undef SEEK_SET
-#define SEEK_SET XF86_SEEK_SET
-#undef SEEK_CUR
-#define SEEK_CUR XF86_SEEK_CUR
-#undef SEEK_END
-#define SEEK_END XF86_SEEK_END
-
-/*
- * XXX Basic I/O functions BAD,BAD,BAD!
- */
-#define open xf86open
-#define close(a) xf86close(a)
-#define lseek(a,b,c) xf86lseek(a,b,c)
-#define ioctl(a,b,c) xf86ioctl(a,b,c)
-#define read(a,b,c) xf86read(a,b,c)
-#define write(a,b,c) xf86write(a,b,c)
-#define mmap(a,b,c,d,e,f) xf86mmap(a,b,c,d,e,f)
-#define munmap(a,b) xf86munmap(a,b)
-#define stat(a,b) xf86stat(a,b)
-#define fstat(a,b) xf86fstat(a,b)
-#define access(a,b) xf86access(a,b)
-#undef O_RDONLY
-#define O_RDONLY XF86_O_RDONLY
-#undef O_WRONLY
-#define O_WRONLY XF86_O_WRONLY
-#undef O_RDWR
-#define O_RDWR XF86_O_RDWR
-#undef O_CREAT
-#define O_CREAT XF86_O_CREAT
-#undef PROT_EXEC
-#define PROT_EXEC XF86_PROT_EXEC
-#undef PROT_READ
-#define PROT_READ XF86_PROT_READ
-#undef PROT_WRITE
-#define PROT_WRITE XF86_PROT_WRITE
-#undef PROT_NONE
-#define PROT_NONE XF86_PROT_NONE
-#undef MAP_FIXED
-#define MAP_FIXED XF86_MAP_FIXED
-#undef MAP_SHARED
-#define MAP_SHARED XF86_MAP_SHARED
-#undef MAP_PRIVATE
-#define MAP_PRIVATE XF86_MAP_PRIVATE
-#undef MAP_FAILED
-#define MAP_FAILED XF86_MAP_FAILED
-#undef R_OK
-#define R_OK XF86_R_OK
-#undef W_OK
-#define W_OK XF86_W_OK
-#undef X_OK
-#define X_OK XF86_X_OK
-#undef F_OK
-#define F_OK XF86_F_OK
-#undef errno
-#define errno xf86errno
-#undef putchar
-#define putchar(i) xf86fputc(i, xf86stdout)
-#undef puts
-#define puts(s) xf86fputs(s, xf86stdout)
-
-#undef EACCES
-#define EACCES xf86_EACCES
-#undef EAGAIN
-#define EAGAIN xf86_EAGAIN
-#undef EBADF
-#define EBADF xf86_EBADF
-#undef EEXIST
-#define EEXIST xf86_EEXIST
-#undef EFAULT
-#define EFAULT xf86_EFAULT
-#undef EINTR
-#define EINTR xf86_EINTR
-#undef EINVAL
-#define EINVAL xf86_EINVAL
-#undef EISDIR
-#define EISDIR xf86_EISDIR
-#undef ELOOP
-#define ELOOP xf86_ELOOP
-#undef EMFILE
-#define EMFILE xf86_EMFILE
-#undef ENAMETOOLONG
-#define ENAMETOOLONG xf86_ENAMETOOLONG
-#undef ENFILE
-#define ENFILE xf86_ENFILE
-#undef ENOENT
-#define ENOENT xf86_ENOENT
-#undef ENOMEM
-#define ENOMEM xf86_ENOMEM
-#undef ENOSPC
-#define ENOSPC xf86_ENOSPC
-#undef ENOTDIR
-#define ENOTDIR xf86_ENOTDIR
-#undef EPIPE
-#define EPIPE xf86_EPIPE
-#undef EROFS
-#define EROFS xf86_EROFS
-#undef ETXTBSY
-#define ETXTBSY xf86_ETXTBSY
-#undef ENOTTY
-#define ENOTTY xf86_ENOTTY
-#undef ENOSYS
-#define ENOSYS xf86_ENOSYS
-#undef EBUSY
-#define EBUSY xf86_EBUSY
-#undef ENODEV
-#define ENODEV xf86_ENODEV
-#undef EIO
-#define EIO xf86_EIO
-
-/* IPC stuff */
-#undef SHM_RDONLY
-#define SHM_RDONLY XF86SHM_RDONLY
-#undef SHM_RND
-#define SHM_RND XF86SHM_RND
-#undef SHM_REMAP
-#define SHM_REMAP XF86SHM_REMAP
-#undef IPC_RMID
-#define IPC_RMID XF86IPC_RMID
-#undef IPC_CREAT
-#define IPC_CREAT XF86IPC_CREAT
-#undef IPC_EXCL
-#define IPC_EXCL XF86IPC_EXCL
-#undef PC_NOWAIT
-#define IPC_NOWAIT XF86IPC_NOWAIT
-#undef SHM_R
-#define SHM_R XF86SHM_R
-#undef SHM_W
-#define SHM_W XF86SHM_W
-#undef IPC_PRIVATE
-#define IPC_PRIVATE XF86IPC_PRIVATE
-
-/* Some ANSI macros */
-#undef FILENAME_MAX
-#define FILENAME_MAX 1024
-
-#endif /* XFree86LOADER && !DONT_DEFINE_WRAPPERS */
-
-#if defined(XFree86LOADER) && \
- (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS))
-#undef setjmp
-#define setjmp(a) xf86setjmp_macro(a)
-#undef longjmp
-#define longjmp(a,b) xf86longjmp(a,b)
-#undef jmp_buf
-#define jmp_buf xf86jmp_buf
-#endif
-
-#endif /* XF86_LIBC_H */
diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h
deleted file mode 100644
index 1659d1be4..000000000
--- a/hw/xfree86/parser/Configint.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.21 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * These definitions are used through out the configuration file parser, but
- * they should not be visible outside of the parser.
- */
-
-#ifndef _Configint_h_
-#define _Configint_h_
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include "xf86Parser.h"
-
-typedef struct
-{
- int num; /* returned number */
- char *str; /* private copy of the return-string */
- double realnum; /* returned number as a real */
-}
-LexRec, *LexPtr;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#include "configProcs.h"
-#include <stdlib.h>
-#define xf86confmalloc malloc
-#define xf86confrealloc realloc
-#define xf86confcalloc calloc
-#define xf86conffree free
-
-#define TestFree(a) if (a) { xf86conffree (a); a = NULL; }
-
-#define parsePrologue(typeptr,typerec) typeptr ptr; \
-if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return NULL; } \
-memset(ptr,0,sizeof(typerec));
-
-#define parsePrologueVoid(typeptr,typerec) int token; typeptr ptr; \
-if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return; } \
-memset(ptr,0,sizeof(typerec));
-
-#define HANDLE_RETURN(f,func)\
-if ((ptr->f=func) == NULL)\
-{\
- CLEANUP (ptr);\
- return (NULL);\
-}
-
-#define HANDLE_LIST(field,func,type)\
-{\
-type p = func ();\
-if (p == NULL)\
-{\
- CLEANUP (ptr);\
- return (NULL);\
-}\
-else\
-{\
- ptr->field = (type) xf86addListItem ((glp) ptr->field, (glp) p);\
-}\
-}
-
-#define Error(a,b) do { \
- xf86parseError (a, b); CLEANUP (ptr); return NULL; \
- } while (0)
-
-/*
- * These are defines for error messages to promote consistency.
- * error messages are preceded by the line number, section and file name,
- * so these messages should be about the specific keyword and syntax in error.
- * To help limit namespace polution, end each with _MSG.
- * limit messages to 70 characters if possible.
- */
-
-#define BAD_OPTION_MSG \
-"The Option keyword requires 1 or 2 quoted strings to follow it."
-#define INVALID_KEYWORD_MSG \
-"\"%s\" is not a valid keyword in this section."
-#define INVALID_SECTION_MSG \
-"\"%s\" is not a valid section name."
-#define UNEXPECTED_EOF_MSG \
-"Unexpected EOF. Missing EndSection keyword?"
-#define QUOTE_MSG \
-"The %s keyword requires a quoted string to follow it."
-#define NUMBER_MSG \
-"The %s keyword requires a number to follow it."
-#define POSITIVE_INT_MSG \
-"The %s keyword requires a positive integer to follow it."
-#define ZAXISMAPPING_MSG \
-"The ZAxisMapping keyword requires 2 positive numbers or X or Y to follow it."
-#define AUTOREPEAT_MSG \
-"The AutoRepeat keyword requires 2 numbers (delay and rate) to follow it."
-#define XLEDS_MSG \
-"The XLeds keyword requries one or more numbers to follow it."
-#define DACSPEED_MSG \
-"The DacSpeed keyword must be followed by a list of up to %d numbers."
-#define DISPLAYSIZE_MSG \
-"The DisplaySize keyword must be followed by the width and height in mm."
-#define HORIZSYNC_MSG \
-"The HorizSync keyword must be followed by a list of numbers or ranges."
-#define VERTREFRESH_MSG \
-"The VertRefresh keyword must be followed by a list of numbers or ranges."
-#define VIEWPORT_MSG \
-"The Viewport keyword must be followed by an X and Y value."
-#define VIRTUAL_MSG \
-"The Virtual keyword must be followed by a width and height value."
-#define WEIGHT_MSG \
-"The Weight keyword must be followed by red, green and blue values."
-#define BLACK_MSG \
-"The Black keyword must be followed by red, green and blue values."
-#define WHITE_MSG \
-"The White keyword must be followed by red, green and blue values."
-#define SCREEN_MSG \
-"The Screen keyword must be followed by an optional number, a screen name\n" \
-"\tin quotes, and optional position/layout information."
-#define INVALID_SCR_MSG \
-"Invalid Screen line."
-#define INPUTDEV_MSG \
-"The InputDevice keyword must be followed by an input device name in quotes."
-#define INACTIVE_MSG \
-"The Inactive keyword must be followed by a Device name in quotes."
-#define UNDEFINED_SCREEN_MSG \
-"Undefined Screen \"%s\" referenced by ServerLayout \"%s\"."
-#define UNDEFINED_MONITOR_MSG \
-"Undefined Monitor \"%s\" referenced by Screen \"%s\"."
-#define UNDEFINED_MODES_MSG \
-"Undefined Modes Section \"%s\" referenced by Monitor \"%s\"."
-#define UNDEFINED_DEVICE_MSG \
-"Undefined Device \"%s\" referenced by Screen \"%s\"."
-#define UNDEFINED_ADAPTOR_MSG \
-"Undefined VideoAdaptor \"%s\" referenced by Screen \"%s\"."
-#define ADAPTOR_REF_TWICE_MSG \
-"VideoAdaptor \"%s\" already referenced by Screen \"%s\"."
-#define UNDEFINED_DEVICE_LAY_MSG \
-"Undefined Device \"%s\" referenced by ServerLayout \"%s\"."
-#define UNDEFINED_INPUT_MSG \
-"Undefined InputDevice \"%s\" referenced by ServerLayout \"%s\"."
-#define NO_IDENT_MSG \
-"This section must have an Identifier line."
-#define ONLY_ONE_MSG \
-"This section must have only one of either %s line."
-#define UNDEFINED_DRIVER_MSG \
-"Device section \"%s\" must have a Driver line."
-#define UNDEFINED_INPUTDRIVER_MSG \
-"InputDevice section \"%s\" must have a Driver line."
-#define INVALID_GAMMA_MSG \
-"gamma correction value(s) expected\n either one value or three r/g/b values."
-#define GROUP_MSG \
-"The Group keyword must be followed by either a group name in quotes or\n" \
-"\ta numerical group id."
-#define MULTIPLE_MSG \
-"Multiple \"%s\" lines."
-
-/* Warning messages */
-#define OBSOLETE_MSG \
-"Ignoring obsolete keyword \"%s\"."
-#define MOVED_TO_FLAGS_MSG \
-"Keyword \"%s\" is now an Option flag in the ServerFlags section."
-
-#endif /* _Configint_h_ */
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
deleted file mode 100644
index fa22e220d..000000000
--- a/hw/xfree86/parser/DRI.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* DRI.c -- DRI Section in XF86Config file
- * Created: Fri Mar 19 08:40:22 1999 by faith@precisioninsight.com
- * Revised: Thu Jun 17 16:08:05 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/parser/DRI.c,v 1.14 2003/01/04 20:20:22 paulo Exp $
- *
- */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec DRITab[] =
-{
- {ENDSECTION, "endsection"},
- {GROUP, "group"},
- {BUFFERS, "buffers"},
- {MODE, "mode"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeBuffersList
-
-XF86ConfBuffersPtr
-xf86parseBuffers (void)
-{
- int token;
- parsePrologue (XF86ConfBuffersPtr, XF86ConfBuffersRec)
-
- if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
- Error ("Buffers count expected", NULL);
- ptr->buf_count = val.num;
-
- if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
- Error ("Buffers size expected", NULL);
- ptr->buf_size = val.num;
-
- if ((token = xf86getSubToken (&(ptr->buf_comment))) == STRING) {
- ptr->buf_flags = val.str;
- if ((token = xf86getToken (NULL)) == COMMENT)
- ptr->buf_comment = xf86addComment(ptr->buf_comment, val.str);
- else
- xf86unGetToken(token);
- }
-
-#ifdef DEBUG
- printf ("Buffers parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-#define CLEANUP xf86freeDRI
-
-XF86ConfDRIPtr
-xf86parseDRISection (void)
-{
- int token;
- parsePrologue (XF86ConfDRIPtr, XF86ConfDRIRec);
-
- /* Zero is a valid value for this. */
- ptr->dri_group = -1;
- while ((token = xf86getToken (DRITab)) != ENDSECTION) {
- switch (token)
- {
- case GROUP:
- if ((token = xf86getSubToken (&(ptr->dri_comment))) == STRING)
- ptr->dri_group_name = val.str;
- else if (token == NUMBER)
- ptr->dri_group = val.num;
- else
- Error (GROUP_MSG, NULL);
- break;
- case MODE:
- if (xf86getSubToken (&(ptr->dri_comment)) != NUMBER)
- Error (NUMBER_MSG, "Mode");
- ptr->dri_mode = val.num;
- break;
- case BUFFERS:
- HANDLE_LIST (dri_buffers_lst, xf86parseBuffers,
- XF86ConfBuffersPtr);
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- case COMMENT:
- ptr->dri_comment = xf86addComment(ptr->dri_comment, val.str);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- ErrorF("DRI section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr)
-{
- XF86ConfBuffersPtr bufs;
-
- if (ptr == NULL)
- return;
-
- fprintf (cf, "Section \"DRI\"\n");
- if (ptr->dri_comment)
- fprintf (cf, "%s", ptr->dri_comment);
- if (ptr->dri_group_name)
- fprintf (cf, "\tGroup \"%s\"\n", ptr->dri_group_name);
- else if (ptr->dri_group >= 0)
- fprintf (cf, "\tGroup %d\n", ptr->dri_group);
- if (ptr->dri_mode)
- fprintf (cf, "\tMode 0%o\n", ptr->dri_mode);
- for (bufs = ptr->dri_buffers_lst; bufs; bufs = bufs->list.next) {
- fprintf (cf, "\tBuffers %d %d",
- bufs->buf_count, bufs->buf_size);
- if (bufs->buf_flags) fprintf (cf, " \"%s\"", bufs->buf_flags);
- if (bufs->buf_comment)
- fprintf(cf, "%s", bufs->buf_comment);
- else
- fprintf (cf, "\n");
- }
- fprintf (cf, "EndSection\n\n");
-}
-
-void
-xf86freeDRI (XF86ConfDRIPtr ptr)
-{
- if (ptr == NULL)
- return;
-
- xf86freeBuffersList (ptr->dri_buffers_lst);
- TestFree (ptr->dri_comment);
- xf86conffree (ptr);
-}
-
-void
-xf86freeBuffersList (XF86ConfBuffersPtr ptr)
-{
- XF86ConfBuffersPtr prev;
-
- while (ptr) {
- TestFree (ptr->buf_flags);
- TestFree (ptr->buf_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c
deleted file mode 100644
index 9bfe4d1b9..000000000
--- a/hw/xfree86/parser/Device.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.27 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static
-xf86ConfigSymTabRec DeviceTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {VENDOR, "vendorname"},
- {BOARD, "boardname"},
- {CHIPSET, "chipset"},
- {RAMDAC, "ramdac"},
- {DACSPEED, "dacspeed"},
- {CLOCKS, "clocks"},
- {OPTION, "option"},
- {VIDEORAM, "videoram"},
- {BIOSBASE, "biosbase"},
- {MEMBASE, "membase"},
- {IOBASE, "iobase"},
- {CLOCKCHIP, "clockchip"},
- {CHIPID, "chipid"},
- {CHIPREV, "chiprev"},
- {CARD, "card"},
- {DRIVER, "driver"},
- {BUSID, "busid"},
- {TEXTCLOCKFRQ, "textclockfreq"},
- {IRQ, "irq"},
- {SCREEN, "screen"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeDeviceList
-
-XF86ConfDevicePtr
-xf86parseDeviceSection (void)
-{
- int i;
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfDevicePtr, XF86ConfDeviceRec)
-
- /* Zero is a valid value for these */
- ptr->dev_chipid = -1;
- ptr->dev_chiprev = -1;
- ptr->dev_irq = -1;
- while ((token = xf86getToken (DeviceTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->dev_comment = xf86addComment(ptr->dev_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->dev_identifier = val.str;
- has_ident = TRUE;
- break;
- case VENDOR:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Vendor");
- ptr->dev_vendor = val.str;
- break;
- case BOARD:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Board");
- ptr->dev_board = val.str;
- break;
- case CHIPSET:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Chipset");
- ptr->dev_chipset = val.str;
- break;
- case CARD:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Card");
- ptr->dev_card = val.str;
- break;
- case DRIVER:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Driver");
- ptr->dev_driver = val.str;
- break;
- case RAMDAC:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "Ramdac");
- ptr->dev_ramdac = val.str;
- break;
- case DACSPEED:
- for (i = 0; i < CONF_MAXDACSPEEDS; i++)
- ptr->dev_dacSpeeds[i] = 0;
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- {
- Error (DACSPEED_MSG, CONF_MAXDACSPEEDS);
- }
- else
- {
- ptr->dev_dacSpeeds[0] = (int) (val.realnum * 1000.0 + 0.5);
- for (i = 1; i < CONF_MAXDACSPEEDS; i++)
- {
- if (xf86getSubToken (&(ptr->dev_comment)) == NUMBER)
- ptr->dev_dacSpeeds[i] = (int)
- (val.realnum * 1000.0 + 0.5);
- else
- {
- xf86unGetToken (token);
- break;
- }
- }
- }
- break;
- case VIDEORAM:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "VideoRam");
- ptr->dev_videoram = val.num;
- break;
- case BIOSBASE:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "BIOSBase");
- ptr->dev_bios_base = val.num;
- break;
- case MEMBASE:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "MemBase");
- ptr->dev_mem_base = val.num;
- break;
- case IOBASE:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "IOBase");
- ptr->dev_io_base = val.num;
- break;
- case CLOCKCHIP:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "ClockChip");
- ptr->dev_clockchip = val.str;
- break;
- case CHIPID:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "ChipID");
- ptr->dev_chipid = val.num;
- break;
- case CHIPREV:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "ChipRev");
- ptr->dev_chiprev = val.num;
- break;
-
- case CLOCKS:
- token = xf86getSubToken(&(ptr->dev_comment));
- for( i = ptr->dev_clocks;
- token == NUMBER && i < CONF_MAXCLOCKS; i++ ) {
- ptr->dev_clock[i] = (int)(val.realnum * 1000.0 + 0.5);
- token = xf86getSubToken(&(ptr->dev_comment));
- }
- ptr->dev_clocks = i;
- xf86unGetToken (token);
- break;
- case TEXTCLOCKFRQ:
- if ((token = xf86getSubToken(&(ptr->dev_comment))) != NUMBER)
- Error (NUMBER_MSG, "TextClockFreq");
- ptr->dev_textclockfreq = (int)(val.realnum * 1000.0 + 0.5);
- break;
- case OPTION:
- ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst);
- break;
- case BUSID:
- if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
- Error (QUOTE_MSG, "BusID");
- ptr->dev_busid = val.str;
- break;
- case IRQ:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (QUOTE_MSG, "IRQ");
- ptr->dev_irq = val.num;
- break;
- case SCREEN:
- if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
- Error (NUMBER_MSG, "Screen");
- ptr->dev_screen = val.num;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Device section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printDeviceSection (FILE * cf, XF86ConfDevicePtr ptr)
-{
- int i;
-
- while (ptr)
- {
- fprintf (cf, "Section \"Device\"\n");
- if (ptr->dev_comment)
- fprintf (cf, "%s", ptr->dev_comment);
- if (ptr->dev_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->dev_identifier);
- if (ptr->dev_driver)
- fprintf (cf, "\tDriver \"%s\"\n", ptr->dev_driver);
- if (ptr->dev_vendor)
- fprintf (cf, "\tVendorName \"%s\"\n", ptr->dev_vendor);
- if (ptr->dev_board)
- fprintf (cf, "\tBoardName \"%s\"\n", ptr->dev_board);
- if (ptr->dev_chipset)
- fprintf (cf, "\tChipSet \"%s\"\n", ptr->dev_chipset);
- if (ptr->dev_card)
- fprintf (cf, "\tCard \"%s\"\n", ptr->dev_card);
- if (ptr->dev_ramdac)
- fprintf (cf, "\tRamDac \"%s\"\n", ptr->dev_ramdac);
- if (ptr->dev_dacSpeeds[0] > 0 ) {
- fprintf (cf, "\tDacSpeed ");
- for (i = 0; i < CONF_MAXDACSPEEDS
- && ptr->dev_dacSpeeds[i] > 0; i++ )
- fprintf (cf, "%g ", (double) (ptr->dev_dacSpeeds[i])/ 1000.0 );
- fprintf (cf, "\n");
- }
- if (ptr->dev_videoram)
- fprintf (cf, "\tVideoRam %d\n", ptr->dev_videoram);
- if (ptr->dev_bios_base)
- fprintf (cf, "\tBiosBase 0x%lx\n", ptr->dev_bios_base);
- if (ptr->dev_mem_base)
- fprintf (cf, "\tMemBase 0x%lx\n", ptr->dev_mem_base);
- if (ptr->dev_io_base)
- fprintf (cf, "\tIOBase 0x%lx\n", ptr->dev_io_base);
- if (ptr->dev_clockchip)
- fprintf (cf, "\tClockChip \"%s\"\n", ptr->dev_clockchip);
- if (ptr->dev_chipid != -1)
- fprintf (cf, "\tChipId 0x%x\n", ptr->dev_chipid);
- if (ptr->dev_chiprev != -1)
- fprintf (cf, "\tChipRev 0x%x\n", ptr->dev_chiprev);
-
- xf86printOptionList(cf, ptr->dev_option_lst, 1);
- if (ptr->dev_clocks > 0 ) {
- fprintf (cf, "\tClocks ");
- for (i = 0; i < ptr->dev_clocks; i++ )
- fprintf (cf, "%.1f ", (double)ptr->dev_clock[i] / 1000.0 );
- fprintf (cf, "\n");
- }
- if (ptr->dev_textclockfreq) {
- fprintf (cf, "\tTextClockFreq %.1f\n",
- (double)ptr->dev_textclockfreq / 1000.0);
- }
- if (ptr->dev_busid)
- fprintf (cf, "\tBusID \"%s\"\n", ptr->dev_busid);
- if (ptr->dev_screen > 0)
- fprintf (cf, "\tScreen %d\n", ptr->dev_screen);
- if (ptr->dev_irq >= 0)
- fprintf (cf, "\tIRQ %d\n", ptr->dev_irq);
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86freeDeviceList (XF86ConfDevicePtr ptr)
-{
- XF86ConfDevicePtr prev;
-
- while (ptr)
- {
- TestFree (ptr->dev_identifier);
- TestFree (ptr->dev_vendor);
- TestFree (ptr->dev_board);
- TestFree (ptr->dev_chipset);
- TestFree (ptr->dev_card);
- TestFree (ptr->dev_driver);
- TestFree (ptr->dev_ramdac);
- TestFree (ptr->dev_clockchip);
- TestFree (ptr->dev_comment);
- xf86optionListFree (ptr->dev_option_lst);
-
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-int
-xf86validateDevice (XF86ConfigPtr p)
-{
- XF86ConfDevicePtr device = p->conf_device_lst;
-
- if (!device) {
- xf86validationError ("At least one Device section is required.");
- return (FALSE);
- }
-
- while (device) {
- if (!device->dev_driver) {
- xf86validationError (UNDEFINED_DRIVER_MSG, device->dev_identifier);
- return (FALSE);
- }
- device = device->list.next;
- }
- return (TRUE);
-}
-
-XF86ConfDevicePtr
-xf86findDevice (const char *ident, XF86ConfDevicePtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->dev_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
-char *
-xf86configStrdup (const char *s)
-{
- char *tmp;
- if (!s) return NULL;
- tmp = xf86confmalloc (sizeof (char) * (strlen (s) + 1));
- if (tmp)
- strcpy (tmp, s);
- return (tmp);
-}
diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
deleted file mode 100644
index 816a16c94..000000000
--- a/hw/xfree86/parser/Files.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.16 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "X11/Xos.h"
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec FilesTab[] =
-{
- {ENDSECTION, "endsection"},
- {FONTPATH, "fontpath"},
- {RGBPATH, "rgbpath"},
- {MODULEPATH, "modulepath"},
- {INPUTDEVICES, "inputdevices"},
- {LOGFILEPATH, "logfile"},
- {-1, ""},
-};
-
-static char *
-prependRoot (char *pathname)
-{
-#ifndef __EMX__
- return pathname;
-#else
- /* XXXX caveat: multiple path components in line */
- return (char *) __XOS2RedirRoot (pathname);
-#endif
-}
-
-#define CLEANUP xf86freeFiles
-
-XF86ConfFilesPtr
-xf86parseFilesSection (void)
-{
- int i, j;
- int k, l;
- char *str;
- int token;
- parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec)
-
- while ((token = xf86getToken (FilesTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->file_comment = xf86addComment(ptr->file_comment, val.str);
- break;
- case FONTPATH:
- if (xf86getSubToken (&(ptr->file_comment)) != STRING)
- Error (QUOTE_MSG, "FontPath");
- j = FALSE;
- str = prependRoot (val.str);
- if (ptr->file_fontpath == NULL)
- {
- ptr->file_fontpath = xf86confmalloc (1);
- ptr->file_fontpath[0] = '\0';
- i = strlen (str) + 1;
- }
- else
- {
- i = strlen (ptr->file_fontpath) + strlen (str) + 1;
- if (ptr->file_fontpath[strlen (ptr->file_fontpath) - 1] != ',')
- {
- i++;
- j = TRUE;
- }
- }
- ptr->file_fontpath =
- xf86confrealloc (ptr->file_fontpath, i);
- if (j)
- strcat (ptr->file_fontpath, ",");
-
- strcat (ptr->file_fontpath, str);
- xf86conffree (val.str);
- break;
- case RGBPATH:
- if (xf86getSubToken (&(ptr->file_comment)) != STRING)
- Error (QUOTE_MSG, "RGBPath");
- ptr->file_rgbpath = val.str;
- break;
- case MODULEPATH:
- if (xf86getSubToken (&(ptr->file_comment)) != STRING)
- Error (QUOTE_MSG, "ModulePath");
- l = FALSE;
- str = prependRoot (val.str);
- if (ptr->file_modulepath == NULL)
- {
- ptr->file_modulepath = xf86confmalloc (1);
- ptr->file_modulepath[0] = '\0';
- k = strlen (str) + 1;
- }
- else
- {
- k = strlen (ptr->file_modulepath) + strlen (str) + 1;
- if (ptr->file_modulepath[strlen (ptr->file_modulepath) - 1] != ',')
- {
- k++;
- l = TRUE;
- }
- }
- ptr->file_modulepath = xf86confrealloc (ptr->file_modulepath, k);
- if (l)
- strcat (ptr->file_modulepath, ",");
-
- strcat (ptr->file_modulepath, str);
- xf86conffree (val.str);
- break;
- case INPUTDEVICES:
- if (xf86getSubToken (&(ptr->file_comment)) != STRING)
- Error (QUOTE_MSG, "InputDevices");
- l = FALSE;
- str = prependRoot (val.str);
- if (ptr->file_inputdevs == NULL)
- {
- ptr->file_inputdevs = xf86confmalloc (1);
- ptr->file_inputdevs[0] = '\0';
- k = strlen (str) + 1;
- }
- else
- {
- k = strlen (ptr->file_inputdevs) + strlen (str) + 1;
- if (ptr->file_inputdevs[strlen (ptr->file_inputdevs) - 1] != ',')
- {
- k++;
- l = TRUE;
- }
- }
- ptr->file_inputdevs = xf86confrealloc (ptr->file_inputdevs, k);
- if (l)
- strcat (ptr->file_inputdevs, ",");
-
- strcat (ptr->file_inputdevs, str);
- xf86conffree (val.str);
- break;
- case LOGFILEPATH:
- if (xf86getSubToken (&(ptr->file_comment)) != STRING)
- Error (QUOTE_MSG, "LogFile");
- ptr->file_logfile = val.str;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("File section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printFileSection (FILE * cf, XF86ConfFilesPtr ptr)
-{
- char *p, *s;
-
- if (ptr == NULL)
- return;
-
- if (ptr->file_comment)
- fprintf (cf, "%s", ptr->file_comment);
- if (ptr->file_logfile)
- fprintf (cf, "\tLogFile \"%s\"\n", ptr->file_logfile);
- if (ptr->file_rgbpath)
- fprintf (cf, "\tRgbPath \"%s\"\n", ptr->file_rgbpath);
- if (ptr->file_modulepath)
- {
- s = ptr->file_modulepath;
- p = index (s, ',');
- while (p)
- {
- *p = '\000';
- fprintf (cf, "\tModulePath \"%s\"\n", s);
- *p = ',';
- s = p;
- s++;
- p = index (s, ',');
- }
- fprintf (cf, "\tModulePath \"%s\"\n", s);
- }
- if (ptr->file_inputdevs)
- {
- s = ptr->file_inputdevs;
- p = index (s, ',');
- while (p)
- {
- *p = '\000';
- fprintf (cf, "\tInputDevices \"%s\"\n", s);
- *p = ',';
- s = p;
- s++;
- p = index (s, ',');
- }
- fprintf (cf, "\tInputdevs \"%s\"\n", s);
- }
- if (ptr->file_fontpath)
- {
- s = ptr->file_fontpath;
- p = index (s, ',');
- while (p)
- {
- *p = '\000';
- fprintf (cf, "\tFontPath \"%s\"\n", s);
- *p = ',';
- s = p;
- s++;
- p = index (s, ',');
- }
- fprintf (cf, "\tFontPath \"%s\"\n", s);
- }
-}
-
-void
-xf86freeFiles (XF86ConfFilesPtr p)
-{
- if (p == NULL)
- return;
-
- TestFree (p->file_logfile);
- TestFree (p->file_rgbpath);
- TestFree (p->file_modulepath);
- TestFree (p->file_inputdevs);
- TestFree (p->file_fontpath);
- TestFree (p->file_comment);
-
- xf86conffree (p);
-}
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
deleted file mode 100644
index e6326a74e..000000000
--- a/hw/xfree86/parser/Flags.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.23 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-#include <math.h>
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec ServerFlagsTab[] =
-{
- {ENDSECTION, "endsection"},
- {NOTRAPSIGNALS, "notrapsignals"},
- {DONTZAP, "dontzap"},
- {DONTZOOM, "dontzoom"},
- {DISABLEVIDMODE, "disablevidmodeextension"},
- {ALLOWNONLOCAL, "allownonlocalxvidtune"},
- {DISABLEMODINDEV, "disablemodindev"},
- {MODINDEVALLOWNONLOCAL, "allownonlocalmodindev"},
- {ALLOWMOUSEOPENFAIL, "allowmouseopenfail"},
- {OPTION, "option"},
- {BLANKTIME, "blanktime"},
- {STANDBYTIME, "standbytime"},
- {SUSPENDTIME, "suspendtime"},
- {OFFTIME, "offtime"},
- {DEFAULTLAYOUT, "defaultserverlayout"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeFlags
-
-XF86ConfFlagsPtr
-xf86parseFlagsSection (void)
-{
- int token;
- parsePrologue (XF86ConfFlagsPtr, XF86ConfFlagsRec)
-
- while ((token = xf86getToken (ServerFlagsTab)) != ENDSECTION)
- {
- int hasvalue = FALSE;
- int strvalue = FALSE;
- int tokentype;
- switch (token)
- {
- case COMMENT:
- ptr->flg_comment = xf86addComment(ptr->flg_comment, val.str);
- break;
- /*
- * these old keywords are turned into standard generic options.
- * we fall through here on purpose
- */
- case DEFAULTLAYOUT:
- strvalue = TRUE;
- case BLANKTIME:
- case STANDBYTIME:
- case SUSPENDTIME:
- case OFFTIME:
- hasvalue = TRUE;
- case NOTRAPSIGNALS:
- case DONTZAP:
- case DONTZOOM:
- case DISABLEVIDMODE:
- case ALLOWNONLOCAL:
- case DISABLEMODINDEV:
- case MODINDEVALLOWNONLOCAL:
- case ALLOWMOUSEOPENFAIL:
- {
- int i = 0;
- while (ServerFlagsTab[i].token != -1)
- {
- char *tmp;
-
- if (ServerFlagsTab[i].token == token)
- {
- char *valstr = NULL;
- /* can't use strdup because it calls malloc */
- tmp = xf86configStrdup (ServerFlagsTab[i].name);
- if (hasvalue)
- {
- tokentype = xf86getSubToken(&(ptr->flg_comment));
- if (strvalue) {
- if (tokentype != STRING)
- Error (QUOTE_MSG, tmp);
- valstr = val.str;
- } else {
- if (tokentype != NUMBER)
- Error (NUMBER_MSG, tmp);
- valstr = xf86confmalloc(16);
- if (valstr)
- sprintf(valstr, "%d", val.num);
- }
- }
- ptr->flg_option_lst = xf86addNewOption
- (ptr->flg_option_lst, tmp, valstr);
- }
- i++;
- }
- }
- break;
- case OPTION:
- ptr->flg_option_lst = xf86parseOption(ptr->flg_option_lst);
- break;
-
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("Flags section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printServerFlagsSection (FILE * f, XF86ConfFlagsPtr flags)
-{
- XF86OptionPtr p;
-
- if ((!flags) || (!flags->flg_option_lst))
- return;
- p = flags->flg_option_lst;
- fprintf (f, "Section \"ServerFlags\"\n");
- if (flags->flg_comment)
- fprintf (f, "%s", flags->flg_comment);
- xf86printOptionList(f, p, 1);
- fprintf (f, "EndSection\n\n");
-}
-
-static XF86OptionPtr
-addNewOption2 (XF86OptionPtr head, char *name, char *val, int used)
-{
- XF86OptionPtr new, old = NULL;
-
- /* Don't allow duplicates */
- if (head != NULL && (old = xf86findOption(head, name)) != NULL)
- new = old;
- else {
- new = xf86confcalloc (1, sizeof (XF86OptionRec));
- new->list.next = NULL;
- }
- new->opt_name = name;
- new->opt_val = val;
- new->opt_used = used;
-
- if (old == NULL)
- return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new));
- else
- return head;
-}
-
-XF86OptionPtr
-xf86addNewOption (XF86OptionPtr head, char *name, char *val)
-{
- return addNewOption2(head, name, val, 0);
-}
-
-void
-xf86freeFlags (XF86ConfFlagsPtr flags)
-{
- if (flags == NULL)
- return;
- xf86optionListFree (flags->flg_option_lst);
- TestFree(flags->flg_comment);
- xf86conffree (flags);
-}
-
-XF86OptionPtr
-xf86optionListDup (XF86OptionPtr opt)
-{
- XF86OptionPtr newopt = NULL;
-
- while (opt)
- {
- newopt = xf86addNewOption(newopt, xf86configStrdup(opt->opt_name),
- xf86configStrdup(opt->opt_val));
- newopt->opt_used = opt->opt_used;
- if (opt->opt_comment)
- newopt->opt_comment = xf86configStrdup(opt->opt_comment);
- opt = opt->list.next;
- }
- return newopt;
-}
-
-void
-xf86optionListFree (XF86OptionPtr opt)
-{
- XF86OptionPtr prev;
-
- while (opt)
- {
- TestFree (opt->opt_name);
- TestFree (opt->opt_val);
- TestFree (opt->opt_comment);
- prev = opt;
- opt = opt->list.next;
- xf86conffree (prev);
- }
-}
-
-char *
-xf86optionName(XF86OptionPtr opt)
-{
- if (opt)
- return opt->opt_name;
- return 0;
-}
-
-char *
-xf86optionValue(XF86OptionPtr opt)
-{
- if (opt)
- return opt->opt_val;
- return 0;
-}
-
-XF86OptionPtr
-xf86newOption(char *name, char *value)
-{
- XF86OptionPtr opt;
-
- opt = xf86confcalloc(1, sizeof (XF86OptionRec));
- if (!opt)
- return NULL;
-
- opt->opt_used = 0;
- opt->list.next = 0;
- opt->opt_name = name;
- opt->opt_val = value;
-
- return opt;
-}
-
-XF86OptionPtr
-xf86nextOption(XF86OptionPtr list)
-{
- if (!list)
- return NULL;
- return list->list.next;
-}
-
-/*
- * this function searches the given option list for the named option and
- * returns a pointer to the option rec if found. If not found, it returns
- * NULL
- */
-
-XF86OptionPtr
-xf86findOption (XF86OptionPtr list, const char *name)
-{
- while (list)
- {
- if (xf86nameCompare (list->opt_name, name) == 0)
- return (list);
- list = list->list.next;
- }
- return (NULL);
-}
-
-/*
- * this function searches the given option list for the named option. If
- * found and the option has a parameter, a pointer to the parameter is
- * returned. If the option does not have a parameter an empty string is
- * returned. If the option is not found, a NULL is returned.
- */
-
-char *
-xf86findOptionValue (XF86OptionPtr list, const char *name)
-{
- XF86OptionPtr p = xf86findOption (list, name);
-
- if (p)
- {
- if (p->opt_val)
- return (p->opt_val);
- else
- return "";
- }
- return (NULL);
-}
-
-XF86OptionPtr
-xf86optionListCreate( const char **options, int count, int used )
-{
- XF86OptionPtr p = NULL;
- char *t1, *t2;
- int i;
-
- if (count == -1)
- {
- for (count = 0; options[count]; count++)
- ;
- }
- if( (count % 2) != 0 )
- {
- fprintf( stderr, "xf86optionListCreate: count must be an even number.\n" );
- return (NULL);
- }
- for (i = 0; i < count; i += 2)
- {
- /* can't use strdup because it calls malloc */
- t1 = xf86confmalloc (sizeof (char) *
- (strlen (options[i]) + 1));
- strcpy (t1, options[i]);
- t2 = xf86confmalloc (sizeof (char) *
- (strlen (options[i + 1]) + 1));
- strcpy (t2, options[i + 1]);
- p = addNewOption2 (p, t1, t2, used);
- }
-
- return (p);
-}
-
-/* the 2 given lists are merged. If an option with the same name is present in
- * both, the option from the user list - specified in the second argument -
- * is used. The end result is a single valid list of options. Duplicates
- * are freed, and the original lists are no longer guaranteed to be complete.
- */
-XF86OptionPtr
-xf86optionListMerge (XF86OptionPtr head, XF86OptionPtr tail)
-{
- XF86OptionPtr a, b, ap = NULL, bp = NULL;
-
- a = tail;
- b = head;
- while (tail && b) {
- if (xf86nameCompare (a->opt_name, b->opt_name) == 0) {
- if (b == head)
- head = a;
- else
- bp->list.next = a;
- if (a == tail)
- tail = a->list.next;
- else
- ap->list.next = a->list.next;
- a->list.next = b->list.next;
- b->list.next = NULL;
- xf86optionListFree (b);
- b = a->list.next;
- bp = a;
- a = tail;
- ap = NULL;
- } else {
- ap = a;
- if (!(a = a->list.next)) {
- a = tail;
- bp = b;
- b = b->list.next;
- ap = NULL;
- }
- }
- }
-
- if (head) {
- for (a = head; a->list.next; a = a->list.next)
- ;
- a->list.next = tail;
- } else
- head = tail;
-
- return (head);
-}
-
-char *
-xf86uLongToString(unsigned long i)
-{
- char *s;
- int l;
-
- l = (int)(ceil(log10((double)i) + 2.5));
- s = xf86confmalloc(l);
- if (!s)
- return NULL;
- sprintf(s, "%lu", i);
- return s;
-}
-
-void
-xf86debugListOptions(XF86OptionPtr Options)
-{
- while (Options) {
- ErrorF("Option: %s Value: %s\n",Options->opt_name,Options->opt_val);
- Options = Options->list.next;
- }
-}
-
-XF86OptionPtr
-xf86parseOption(XF86OptionPtr head)
-{
- XF86OptionPtr option, cnew, old;
- char *name, *comment = NULL;
- int token;
-
- if ((token = xf86getSubToken(&comment)) != STRING) {
- xf86parseError(BAD_OPTION_MSG, NULL);
- if (comment)
- xf86conffree(comment);
- return (head);
- }
-
- name = val.str;
- if ((token = xf86getSubToken(&comment)) == STRING) {
- option = xf86newOption(name, val.str);
- option->opt_comment = comment;
- if ((token = xf86getToken(NULL)) == COMMENT)
- option->opt_comment = xf86addComment(option->opt_comment, val.str);
- else
- xf86unGetToken(token);
- }
- else {
- option = xf86newOption(name, NULL);
- option->opt_comment = comment;
- if (token == COMMENT)
- option->opt_comment = xf86addComment(option->opt_comment, val.str);
- else
- xf86unGetToken(token);
- }
-
- old = NULL;
-
- /* Don't allow duplicates */
- if (head != NULL && (old = xf86findOption(head, name)) != NULL) {
- cnew = old;
- xf86conffree(option->opt_name);
- TestFree(option->opt_val);
- TestFree(option->opt_comment);
- xf86conffree(option);
- }
- else
- cnew = option;
-
- if (old == NULL)
- return ((XF86OptionPtr)xf86addListItem((glp)head, (glp)cnew));
-
- return (head);
-}
-
-void
-xf86printOptionList(FILE *fp, XF86OptionPtr list, int tabs)
-{
- int i;
-
- if (!list)
- return;
- while (list) {
- for (i = 0; i < tabs; i++)
- fputc('\t', fp);
- if (list->opt_val)
- fprintf(fp, "Option \"%s\" \"%s\"", list->opt_name, list->opt_val);
- else
- fprintf(fp, "Option \"%s\"", list->opt_name);
- if (list->opt_comment)
- fprintf(fp, "%s", list->opt_comment);
- else
- fputc('\n', fp);
- list = list->list.next;
- }
-}
diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c
deleted file mode 100644
index 6e38bdd15..000000000
--- a/hw/xfree86/parser/Input.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.14 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static
-xf86ConfigSymTabRec InputTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {OPTION, "option"},
- {DRIVER, "driver"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeInputList
-
-XF86ConfInputPtr
-xf86parseInputSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
-
- while ((token = xf86getToken (InputTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->inp_identifier = val.str;
- has_ident = TRUE;
- break;
- case DRIVER:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "Driver");
- ptr->inp_driver = val.str;
- break;
- case OPTION:
- ptr->inp_option_lst = xf86parseOption(ptr->inp_option_lst);
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("InputDevice section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printInputSection (FILE * cf, XF86ConfInputPtr ptr)
-{
- while (ptr)
- {
- fprintf (cf, "Section \"InputDevice\"\n");
- if (ptr->inp_comment)
- fprintf (cf, "%s", ptr->inp_comment);
- if (ptr->inp_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->inp_identifier);
- if (ptr->inp_driver)
- fprintf (cf, "\tDriver \"%s\"\n", ptr->inp_driver);
- xf86printOptionList(cf, ptr->inp_option_lst, 1);
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86freeInputList (XF86ConfInputPtr ptr)
-{
- XF86ConfInputPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->inp_identifier);
- TestFree (ptr->inp_driver);
- TestFree (ptr->inp_comment);
- xf86optionListFree (ptr->inp_option_lst);
-
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-int
-xf86validateInput (XF86ConfigPtr p)
-{
- XF86ConfInputPtr input = p->conf_input_lst;
-
-#if 0 /* Enable this later */
- if (!input) {
- xf86validationError ("At least one InputDevice section is required.");
- return (FALSE);
- }
-#endif
-
- while (input) {
- if (!input->inp_driver) {
- xf86validationError (UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier);
- return (FALSE);
- }
- input = input->list.next;
- }
- return (TRUE);
-}
-
-XF86ConfInputPtr
-xf86findInput (const char *ident, XF86ConfInputPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->inp_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
-XF86ConfInputPtr
-xf86findInputByDriver (const char *driver, XF86ConfInputPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (driver, p->inp_driver) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Keyboard.c b/hw/xfree86/parser/Keyboard.c
deleted file mode 100644
index cca3ce412..000000000
--- a/hw/xfree86/parser/Keyboard.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.17 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-#include "ctype.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec KeyboardTab[] =
-{
- {ENDSECTION, "endsection"},
- {KPROTOCOL, "protocol"},
- {AUTOREPEAT, "autorepeat"},
- {XLEDS, "xleds"},
- {PANIX106, "panix106"},
- {XKBKEYMAP, "xkbkeymap"},
- {XKBCOMPAT, "xkbcompat"},
- {XKBTYPES, "xkbtypes"},
- {XKBKEYCODES, "xkbkeycodes"},
- {XKBGEOMETRY, "xkbgeometry"},
- {XKBSYMBOLS, "xkbsymbols"},
- {XKBDISABLE, "xkbdisable"},
- {XKBRULES, "xkbrules"},
- {XKBMODEL, "xkbmodel"},
- {XKBLAYOUT, "xkblayout"},
- {XKBVARIANT, "xkbvariant"},
- {XKBOPTIONS, "xkboptions"},
- /* The next two have become ServerFlags options */
- {VTINIT, "vtinit"},
- {VTSYSREQ, "vtsysreq"},
- /* Obsolete keywords */
- {SERVERNUM, "servernumlock"},
- {LEFTALT, "leftalt"},
- {RIGHTALT, "rightalt"},
- {RIGHTALT, "altgr"},
- {SCROLLLOCK_TOK, "scrolllock"},
- {RIGHTCTL, "rightctl"},
- {-1, ""},
-};
-
-/* Obsolete */
-static xf86ConfigSymTabRec KeyMapTab[] =
-{
- {CONF_KM_META, "meta"},
- {CONF_KM_COMPOSE, "compose"},
- {CONF_KM_MODESHIFT, "modeshift"},
- {CONF_KM_MODELOCK, "modelock"},
- {CONF_KM_SCROLLLOCK, "scrolllock"},
- {CONF_KM_CONTROL, "control"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeInputList
-
-XF86ConfInputPtr
-xf86parseKeyboardSection (void)
-{
- char *s, *s1, *s2;
- int l;
- int token, ntoken;
- parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
-
- while ((token = xf86getToken (KeyboardTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
- break;
- case KPROTOCOL:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "Protocol");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Protocol"),
- val.str);
- break;
- case AUTOREPEAT:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
- Error (AUTOREPEAT_MSG, NULL);
- s1 = xf86uLongToString(val.num);
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
- Error (AUTOREPEAT_MSG, NULL);
- s2 = xf86uLongToString(val.num);
- l = strlen(s1) + 1 + strlen(s2) + 1;
- s = xf86confmalloc(l);
- sprintf(s, "%s %s", s1, s2);
- xf86conffree(s1);
- xf86conffree(s2);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("AutoRepeat"), s);
- break;
- case XLEDS:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
- Error (XLEDS_MSG, NULL);
- s = xf86uLongToString(val.num);
- l = strlen(s) + 1;
- while ((token = xf86getSubToken (&(ptr->inp_comment))) == NUMBER)
- {
- s1 = xf86uLongToString(val.num);
- l += (1 + strlen(s1));
- s = xf86confrealloc(s, l);
- strcat(s, " ");
- strcat(s, s1);
- xf86conffree(s1);
- }
- xf86unGetToken (token);
- break;
- case SERVERNUM:
- xf86parseWarning(OBSOLETE_MSG, xf86tokenString());
- break;
- case LEFTALT:
- case RIGHTALT:
- case SCROLLLOCK_TOK:
- case RIGHTCTL:
- xf86parseWarning(OBSOLETE_MSG, xf86tokenString());
- break;
- ntoken = xf86getToken (KeyMapTab);
- switch (ntoken)
- {
- case EOF_TOKEN:
- xf86parseError (UNEXPECTED_EOF_MSG);
- CLEANUP (ptr);
- return (NULL);
- break;
-
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- break;
- case VTINIT:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "VTInit");
- xf86parseWarning(MOVED_TO_FLAGS_MSG, "VTInit");
- break;
- case VTSYSREQ:
- xf86parseWarning(MOVED_TO_FLAGS_MSG, "VTSysReq");
- break;
- case XKBDISABLE:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbDisable"),
- NULL);
- break;
- case XKBKEYMAP:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBKeymap");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbKeymap"),
- val.str);
- break;
- case XKBCOMPAT:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBCompat");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbCompat"),
- val.str);
- break;
- case XKBTYPES:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBTypes");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbTypes"),
- val.str);
- break;
- case XKBKEYCODES:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBKeycodes");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbKeycodes"),
- val.str);
- break;
- case XKBGEOMETRY:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBGeometry");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbGeometry"),
- val.str);
- break;
- case XKBSYMBOLS:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBSymbols");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbSymbols"),
- val.str);
- break;
- case XKBRULES:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBRules");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbRules"),
- val.str);
- break;
- case XKBMODEL:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBModel");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbModel"),
- val.str);
- break;
- case XKBLAYOUT:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBLayout");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbLayout"),
- val.str);
- break;
- case XKBVARIANT:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBVariant");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbVariant"),
- val.str);
- break;
- case XKBOPTIONS:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "XKBOptions");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("XkbOptions"),
- val.str);
- break;
- case PANIX106:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Panix106"), NULL);
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_KEYBOARD);
- ptr->inp_driver = xf86configStrdup("keyboard");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("CoreKeyboard"), NULL);
-
-#ifdef DEBUG
- printf ("Keyboard section parsed\n");
-#endif
-
- return ptr;
-}
-
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
deleted file mode 100644
index 9907d29c8..000000000
--- a/hw/xfree86/parser/Layout.c
+++ /dev/null
@@ -1,509 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.24 2003/08/24 17:37:07 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-#include <string.h>
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec LayoutTab[] =
-{
- {ENDSECTION, "endsection"},
- {SCREEN, "screen"},
- {IDENTIFIER, "identifier"},
- {INACTIVE, "inactive"},
- {INPUTDEVICE, "inputdevice"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec AdjTab[] =
-{
- {RIGHTOF, "rightof"},
- {LEFTOF, "leftof"},
- {ABOVE, "above"},
- {BELOW, "below"},
- {RELATIVE, "relative"},
- {ABSOLUTE, "absolute"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeLayoutList
-
-XF86ConfLayoutPtr
-xf86parseLayoutSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfLayoutPtr, XF86ConfLayoutRec)
-
- while ((token = xf86getToken (LayoutTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->lay_comment = xf86addComment(ptr->lay_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->lay_identifier = val.str;
- has_ident = TRUE;
- break;
- case INACTIVE:
- {
- XF86ConfInactivePtr iptr;
-
- iptr = xf86confcalloc (1, sizeof (XF86ConfInactiveRec));
- iptr->list.next = NULL;
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (INACTIVE_MSG, NULL);
- iptr->inactive_device_str = val.str;
- ptr->lay_inactive_lst = (XF86ConfInactivePtr)
- xf86addListItem ((glp) ptr->lay_inactive_lst, (glp) iptr);
- }
- break;
- case SCREEN:
- {
- XF86ConfAdjacencyPtr aptr;
- int absKeyword = 0;
-
- aptr = xf86confcalloc (1, sizeof (XF86ConfAdjacencyRec));
- aptr->list.next = NULL;
- aptr->adj_scrnum = -1;
- aptr->adj_where = CONF_ADJ_OBSOLETE;
- aptr->adj_x = 0;
- aptr->adj_y = 0;
- aptr->adj_refscreen = NULL;
- if ((token = xf86getSubToken (&(ptr->lay_comment))) == NUMBER)
- aptr->adj_scrnum = val.num;
- else
- xf86unGetToken (token);
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token != STRING)
- Error (SCREEN_MSG, NULL);
- aptr->adj_screen_str = val.str;
-
- token = xf86getSubTokenWithTab(&(ptr->lay_comment), AdjTab);
- switch (token)
- {
- case RIGHTOF:
- aptr->adj_where = CONF_ADJ_RIGHTOF;
- break;
- case LEFTOF:
- aptr->adj_where = CONF_ADJ_LEFTOF;
- break;
- case ABOVE:
- aptr->adj_where = CONF_ADJ_ABOVE;
- break;
- case BELOW:
- aptr->adj_where = CONF_ADJ_BELOW;
- break;
- case RELATIVE:
- aptr->adj_where = CONF_ADJ_RELATIVE;
- break;
- case ABSOLUTE:
- aptr->adj_where = CONF_ADJ_ABSOLUTE;
- absKeyword = 1;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- xf86unGetToken (token);
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token == STRING)
- aptr->adj_where = CONF_ADJ_OBSOLETE;
- else
- aptr->adj_where = CONF_ADJ_ABSOLUTE;
- }
- switch (aptr->adj_where)
- {
- case CONF_ADJ_ABSOLUTE:
- if (absKeyword)
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token == NUMBER)
- {
- aptr->adj_x = val.num;
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token != NUMBER)
- Error(INVALID_SCR_MSG, NULL);
- aptr->adj_y = val.num;
- } else {
- if (absKeyword)
- Error(INVALID_SCR_MSG, NULL);
- else
- xf86unGetToken (token);
- }
- break;
- case CONF_ADJ_RIGHTOF:
- case CONF_ADJ_LEFTOF:
- case CONF_ADJ_ABOVE:
- case CONF_ADJ_BELOW:
- case CONF_ADJ_RELATIVE:
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token != STRING)
- Error(INVALID_SCR_MSG, NULL);
- aptr->adj_refscreen = val.str;
- if (aptr->adj_where == CONF_ADJ_RELATIVE)
- {
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token != NUMBER)
- Error(INVALID_SCR_MSG, NULL);
- aptr->adj_x = val.num;
- token = xf86getSubToken(&(ptr->lay_comment));
- if (token != NUMBER)
- Error(INVALID_SCR_MSG, NULL);
- aptr->adj_y = val.num;
- }
- break;
- case CONF_ADJ_OBSOLETE:
- /* top */
- aptr->adj_top_str = val.str;
-
- /* bottom */
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (SCREEN_MSG, NULL);
- aptr->adj_bottom_str = val.str;
-
- /* left */
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (SCREEN_MSG, NULL);
- aptr->adj_left_str = val.str;
-
- /* right */
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (SCREEN_MSG, NULL);
- aptr->adj_right_str = val.str;
-
- }
- ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
- xf86addListItem ((glp) ptr->lay_adjacency_lst, (glp) aptr);
- }
- break;
- case INPUTDEVICE:
- {
- XF86ConfInputrefPtr iptr;
-
- iptr = xf86confcalloc (1, sizeof (XF86ConfInputrefRec));
- iptr->list.next = NULL;
- iptr->iref_option_lst = NULL;
- if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
- Error (INPUTDEV_MSG, NULL);
- iptr->iref_inputdev_str = val.str;
- while ((token = xf86getSubToken (&(ptr->lay_comment))) == STRING)
- {
- iptr->iref_option_lst =
- xf86addNewOption (iptr->iref_option_lst, val.str, NULL);
- }
- xf86unGetToken (token);
- ptr->lay_input_lst = (XF86ConfInputrefPtr)
- xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
- }
- break;
- case OPTION:
- ptr->lay_option_lst = xf86parseOption(ptr->lay_option_lst);
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Layout section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printLayoutSection (FILE * cf, XF86ConfLayoutPtr ptr)
-{
- XF86ConfAdjacencyPtr aptr;
- XF86ConfInactivePtr iptr;
- XF86ConfInputrefPtr inptr;
- XF86OptionPtr optr;
-
- while (ptr)
- {
- fprintf (cf, "Section \"ServerLayout\"\n");
- if (ptr->lay_comment)
- fprintf (cf, "%s", ptr->lay_comment);
- if (ptr->lay_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->lay_identifier);
-
- for (aptr = ptr->lay_adjacency_lst; aptr; aptr = aptr->list.next)
- {
- fprintf (cf, "\tScreen ");
- if (aptr->adj_scrnum >= 0)
- fprintf (cf, "%2d", aptr->adj_scrnum);
- else
- fprintf (cf, " ");
- fprintf (cf, " \"%s\"", aptr->adj_screen_str);
- switch(aptr->adj_where)
- {
- case CONF_ADJ_OBSOLETE:
- fprintf (cf, " \"%s\"", aptr->adj_top_str);
- fprintf (cf, " \"%s\"", aptr->adj_bottom_str);
- fprintf (cf, " \"%s\"", aptr->adj_right_str);
- fprintf (cf, " \"%s\"\n", aptr->adj_left_str);
- break;
- case CONF_ADJ_ABSOLUTE:
- if (aptr->adj_x != -1)
- fprintf (cf, " %d %d\n", aptr->adj_x, aptr->adj_y);
- else
- fprintf (cf, "\n");
- break;
- case CONF_ADJ_RIGHTOF:
- fprintf (cf, " RightOf \"%s\"\n", aptr->adj_refscreen);
- break;
- case CONF_ADJ_LEFTOF:
- fprintf (cf, " LeftOf \"%s\"\n", aptr->adj_refscreen);
- break;
- case CONF_ADJ_ABOVE:
- fprintf (cf, " Above \"%s\"\n", aptr->adj_refscreen);
- break;
- case CONF_ADJ_BELOW:
- fprintf (cf, " Below \"%s\"\n", aptr->adj_refscreen);
- break;
- case CONF_ADJ_RELATIVE:
- fprintf (cf, " Relative \"%s\" %d %d\n", aptr->adj_refscreen,
- aptr->adj_x, aptr->adj_y);
- break;
- }
- }
- for (iptr = ptr->lay_inactive_lst; iptr; iptr = iptr->list.next)
- fprintf (cf, "\tInactive \"%s\"\n", iptr->inactive_device_str);
- for (inptr = ptr->lay_input_lst; inptr; inptr = inptr->list.next)
- {
- fprintf (cf, "\tInputDevice \"%s\"", inptr->iref_inputdev_str);
- for (optr = inptr->iref_option_lst; optr; optr = optr->list.next)
- {
- fprintf(cf, " \"%s\"", optr->opt_name);
- }
- fprintf(cf, "\n");
- }
- xf86printOptionList(cf, ptr->lay_option_lst, 1);
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86freeLayoutList (XF86ConfLayoutPtr ptr)
-{
- XF86ConfLayoutPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->lay_identifier);
- TestFree (ptr->lay_comment);
- xf86freeAdjacencyList (ptr->lay_adjacency_lst);
- xf86freeInputrefList (ptr->lay_input_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
-{
- XF86ConfAdjacencyPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->adj_screen_str);
- TestFree (ptr->adj_top_str);
- TestFree (ptr->adj_bottom_str);
- TestFree (ptr->adj_left_str);
- TestFree (ptr->adj_right_str);
-
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-
-}
-
-void
-xf86freeInputrefList (XF86ConfInputrefPtr ptr)
-{
- XF86ConfInputrefPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->iref_inputdev_str);
- xf86optionListFree (ptr->iref_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-
-}
-
-#define CheckScreen(str, ptr)\
-if (str[0] != '\0') \
-{ \
-screen = xf86findScreen (str, p->conf_screen_lst); \
-if (!screen) \
-{ \
- xf86validationError (UNDEFINED_SCREEN_MSG, \
- str, layout->lay_identifier); \
- return (FALSE); \
-} \
-else \
- ptr = screen; \
-}
-
-int
-xf86validateLayout (XF86ConfigPtr p)
-{
- XF86ConfLayoutPtr layout = p->conf_layout_lst;
- XF86ConfAdjacencyPtr adj;
- XF86ConfInactivePtr iptr;
- XF86ConfInputrefPtr inptr;
- XF86ConfScreenPtr screen;
- XF86ConfDevicePtr device;
- XF86ConfInputPtr input;
-
- while (layout)
- {
- adj = layout->lay_adjacency_lst;
- while (adj)
- {
- /* the first one can't be "" but all others can */
- screen = xf86findScreen (adj->adj_screen_str, p->conf_screen_lst);
- if (!screen)
- {
- xf86validationError (UNDEFINED_SCREEN_MSG,
- adj->adj_screen_str, layout->lay_identifier);
- return (FALSE);
- }
- else
- adj->adj_screen = screen;
-
-#if 0
- CheckScreen (adj->adj_top_str, adj->adj_top);
- CheckScreen (adj->adj_bottom_str, adj->adj_bottom);
- CheckScreen (adj->adj_left_str, adj->adj_left);
- CheckScreen (adj->adj_right_str, adj->adj_right);
-#endif
-
- adj = adj->list.next;
- }
- iptr = layout->lay_inactive_lst;
- while (iptr)
- {
- device = xf86findDevice (iptr->inactive_device_str,
- p->conf_device_lst);
- if (!device)
- {
- xf86validationError (UNDEFINED_DEVICE_LAY_MSG,
- iptr->inactive_device_str, layout->lay_identifier);
- return (FALSE);
- }
- else
- iptr->inactive_device = device;
- iptr = iptr->list.next;
- }
- inptr = layout->lay_input_lst;
- while (inptr)
- {
- input = xf86findInput (inptr->iref_inputdev_str,
- p->conf_input_lst);
- if (!input)
- {
- xf86validationError (UNDEFINED_INPUT_MSG,
- inptr->iref_inputdev_str, layout->lay_identifier);
- return (FALSE);
- }
- else
- inptr->iref_inputdev = input;
- inptr = inptr->list.next;
- }
- layout = layout->list.next;
- }
- return (TRUE);
-}
-
-XF86ConfLayoutPtr
-xf86findLayout (const char *name, XF86ConfLayoutPtr list)
-{
- while (list)
- {
- if (xf86nameCompare (list->lay_identifier, name) == 0)
- return (list);
- list = list->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c
deleted file mode 100644
index 33b591d88..000000000
--- a/hw/xfree86/parser/Module.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.12 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec SubModuleTab[] =
-{
- {ENDSUBSECTION, "endsubsection"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec ModuleTab[] =
-{
- {ENDSECTION, "endsection"},
- {LOAD, "load"},
- {LOAD_DRIVER, "loaddriver"},
- {SUBSECTION, "subsection"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeModules
-
-XF86LoadPtr
-xf86parseModuleSubSection (XF86LoadPtr head, char *name)
-{
- int token;
- parsePrologue (XF86LoadPtr, XF86LoadRec)
-
- ptr->load_name = name;
- ptr->load_type = XF86_LOAD_MODULE;
- ptr->load_opt = NULL;
- ptr->list.next = NULL;
-
- while ((token = xf86getToken (SubModuleTab)) != ENDSUBSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->load_comment = xf86addComment(ptr->load_comment, val.str);
- break;
- case OPTION:
- ptr->load_opt = xf86parseOption(ptr->load_opt);
- break;
- case EOF_TOKEN:
- xf86parseError (UNEXPECTED_EOF_MSG, NULL);
- xf86conffree(ptr);
- return NULL;
- default:
- xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
- xf86conffree(ptr);
- return NULL;
- break;
- }
-
- }
-
- return ((XF86LoadPtr) xf86addListItem ((glp) head, (glp) ptr));
-}
-
-XF86ConfModulePtr
-xf86parseModuleSection (void)
-{
- int token;
- parsePrologue (XF86ConfModulePtr, XF86ConfModuleRec)
-
- while ((token = xf86getToken (ModuleTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->mod_comment = xf86addComment(ptr->mod_comment, val.str);
- break;
- case LOAD:
- if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
- Error (QUOTE_MSG, "Load");
- ptr->mod_load_lst =
- xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
- XF86_LOAD_MODULE, NULL);
- break;
- case LOAD_DRIVER:
- if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
- Error (QUOTE_MSG, "LoadDriver");
- ptr->mod_load_lst =
- xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
- XF86_LOAD_DRIVER, NULL);
- break;
- case SUBSECTION:
- if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
- Error (QUOTE_MSG, "SubSection");
- ptr->mod_load_lst =
- xf86parseModuleSubSection (ptr->mod_load_lst, val.str);
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("Module section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printModuleSection (FILE * cf, XF86ConfModulePtr ptr)
-{
- XF86LoadPtr lptr;
-
- if (ptr == NULL)
- return;
-
- if (ptr->mod_comment)
- fprintf(cf, "%s", ptr->mod_comment);
- for (lptr = ptr->mod_load_lst; lptr; lptr = lptr->list.next)
- {
- switch (lptr->load_type)
- {
- case XF86_LOAD_MODULE:
- if( lptr->load_opt == NULL ) {
- fprintf (cf, "\tLoad \"%s\"", lptr->load_name);
- if (lptr->load_comment)
- fprintf(cf, "%s", lptr->load_comment);
- else
- fputc('\n', cf);
- }
- else
- {
- fprintf (cf, "\tSubSection \"%s\"\n", lptr->load_name);
- if (lptr->load_comment)
- fprintf(cf, "%s", lptr->load_comment);
- xf86printOptionList(cf, lptr->load_opt, 2);
- fprintf (cf, "\tEndSubSection\n");
- }
- break;
- case XF86_LOAD_DRIVER:
- fprintf (cf, "\tLoadDriver \"%s\"", lptr->load_name);
- if (lptr->load_comment)
- fprintf(cf, "%s", lptr->load_comment);
- else
- fputc('\n', cf);
- break;
-#if 0
- default:
- fprintf (cf, "#\tUnknown type \"%s\"\n", lptr->load_name);
- break;
-#endif
- }
- }
-}
-
-XF86LoadPtr
-xf86addNewLoadDirective (XF86LoadPtr head, char *name, int type, XF86OptionPtr opts)
-{
- XF86LoadPtr new;
- int token;
-
- new = xf86confcalloc (1, sizeof (XF86LoadRec));
- new->load_name = name;
- new->load_type = type;
- new->load_opt = opts;
- new->list.next = NULL;
-
- if ((token = xf86getToken(NULL)) == COMMENT)
- new->load_comment = xf86addComment(new->load_comment, val.str);
- else
- xf86unGetToken(token);
-
- return ((XF86LoadPtr) xf86addListItem ((glp) head, (glp) new));
-}
-
-void
-xf86freeModules (XF86ConfModulePtr ptr)
-{
- XF86LoadPtr lptr;
- XF86LoadPtr prev;
-
- if (ptr == NULL)
- return;
- lptr = ptr->mod_load_lst;
- while (lptr)
- {
- TestFree (lptr->load_name);
- TestFree (lptr->load_comment);
- prev = lptr;
- lptr = lptr->list.next;
- xf86conffree (prev);
- }
- TestFree (ptr->mod_comment);
- xf86conffree (ptr);
-}
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
deleted file mode 100644
index 942b199d2..000000000
--- a/hw/xfree86/parser/Monitor.c
+++ /dev/null
@@ -1,901 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.28 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec MonitorTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {VENDOR, "vendorname"},
- {MODEL, "modelname"},
- {USEMODES, "usemodes"},
- {MODELINE, "modeline"},
- {DISPLAYSIZE, "displaysize"},
- {HORIZSYNC, "horizsync"},
- {VERTREFRESH, "vertrefresh"},
- {MODE, "mode"},
- {GAMMA, "gamma"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec ModesTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {MODELINE, "modeline"},
- {MODE, "mode"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec TimingTab[] =
-{
- {TT_INTERLACE, "interlace"},
- {TT_PHSYNC, "+hsync"},
- {TT_NHSYNC, "-hsync"},
- {TT_PVSYNC, "+vsync"},
- {TT_NVSYNC, "-vsync"},
- {TT_CSYNC, "composite"},
- {TT_PCSYNC, "+csync"},
- {TT_NCSYNC, "-csync"},
- {TT_DBLSCAN, "doublescan"},
- {TT_HSKEW, "hskew"},
- {TT_BCAST, "bcast"},
- {TT_VSCAN, "vscan"},
- {TT_CUSTOM, "CUSTOM"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec ModeTab[] =
-{
- {DOTCLOCK, "dotclock"},
- {HTIMINGS, "htimings"},
- {VTIMINGS, "vtimings"},
- {FLAGS, "flags"},
- {HSKEW, "hskew"},
- {BCAST, "bcast"},
- {VSCAN, "vscan"},
- {ENDMODE, "endmode"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeModeLineList
-
-XF86ConfModeLinePtr
-xf86parseModeLine (void)
-{
- int token;
- parsePrologue (XF86ConfModeLinePtr, XF86ConfModeLineRec)
-
- /* Identifier */
- if (xf86getSubToken (&(ptr->ml_comment)) != STRING)
- Error ("ModeLine identifier expected", NULL);
- ptr->ml_identifier = val.str;
-
- /* DotClock */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine dotclock expected", NULL);
- ptr->ml_clock = (int) (val.realnum * 1000.0 + 0.5);
-
- /* HDisplay */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine Hdisplay expected", NULL);
- ptr->ml_hdisplay = val.num;
-
- /* HSyncStart */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine HSyncStart expected", NULL);
- ptr->ml_hsyncstart = val.num;
-
- /* HSyncEnd */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine HSyncEnd expected", NULL);
- ptr->ml_hsyncend = val.num;
-
- /* HTotal */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine HTotal expected", NULL);
- ptr->ml_htotal = val.num;
-
- /* VDisplay */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine Vdisplay expected", NULL);
- ptr->ml_vdisplay = val.num;
-
- /* VSyncStart */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine VSyncStart expected", NULL);
- ptr->ml_vsyncstart = val.num;
-
- /* VSyncEnd */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine VSyncEnd expected", NULL);
- ptr->ml_vsyncend = val.num;
-
- /* VTotal */
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("ModeLine VTotal expected", NULL);
- ptr->ml_vtotal = val.num;
-
- token = xf86getSubTokenWithTab (&(ptr->ml_comment), TimingTab);
- while ((token == TT_INTERLACE) || (token == TT_PHSYNC) ||
- (token == TT_NHSYNC) || (token == TT_PVSYNC) ||
- (token == TT_NVSYNC) || (token == TT_CSYNC) ||
- (token == TT_PCSYNC) || (token == TT_NCSYNC) ||
- (token == TT_DBLSCAN) || (token == TT_HSKEW) ||
- (token == TT_VSCAN) || (token == TT_BCAST))
- {
- switch (token)
- {
-
- case TT_INTERLACE:
- ptr->ml_flags |= XF86CONF_INTERLACE;
- break;
- case TT_PHSYNC:
- ptr->ml_flags |= XF86CONF_PHSYNC;
- break;
- case TT_NHSYNC:
- ptr->ml_flags |= XF86CONF_NHSYNC;
- break;
- case TT_PVSYNC:
- ptr->ml_flags |= XF86CONF_PVSYNC;
- break;
- case TT_NVSYNC:
- ptr->ml_flags |= XF86CONF_NVSYNC;
- break;
- case TT_CSYNC:
- ptr->ml_flags |= XF86CONF_CSYNC;
- break;
- case TT_PCSYNC:
- ptr->ml_flags |= XF86CONF_PCSYNC;
- break;
- case TT_NCSYNC:
- ptr->ml_flags |= XF86CONF_NCSYNC;
- break;
- case TT_DBLSCAN:
- ptr->ml_flags |= XF86CONF_DBLSCAN;
- break;
- case TT_HSKEW:
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error (NUMBER_MSG, "Hskew");
- ptr->ml_hskew = val.num;
- ptr->ml_flags |= XF86CONF_HSKEW;
- break;
- case TT_BCAST:
- ptr->ml_flags |= XF86CONF_BCAST;
- break;
- case TT_VSCAN:
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error (NUMBER_MSG, "Vscan");
- ptr->ml_vscan = val.num;
- ptr->ml_flags |= XF86CONF_VSCAN;
- break;
- case TT_CUSTOM:
- ptr->ml_flags |= XF86CONF_CUSTOM;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- token = xf86getSubTokenWithTab (&(ptr->ml_comment), TimingTab);
- }
- xf86unGetToken (token);
-
-#ifdef DEBUG
- printf ("ModeLine parsed\n");
-#endif
- return (ptr);
-}
-
-XF86ConfModeLinePtr
-xf86parseVerboseMode (void)
-{
- int token, token2;
- int had_dotclock = 0, had_htimings = 0, had_vtimings = 0;
- parsePrologue (XF86ConfModeLinePtr, XF86ConfModeLineRec)
-
- if (xf86getSubToken (&(ptr->ml_comment)) != STRING)
- Error ("Mode name expected", NULL);
- ptr->ml_identifier = val.str;
- while ((token = xf86getToken (ModeTab)) != ENDMODE)
- {
- switch (token)
- {
- case COMMENT:
- ptr->ml_comment = xf86addComment(ptr->ml_comment, val.str);
- break;
- case DOTCLOCK:
- if ((token = xf86getSubToken (&(ptr->ml_comment))) != NUMBER)
- Error (NUMBER_MSG, "DotClock");
- ptr->ml_clock = (int) (val.realnum * 1000.0 + 0.5);
- had_dotclock = 1;
- break;
- case HTIMINGS:
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_hdisplay = val.num;
- else
- Error ("Horizontal display expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_hsyncstart = val.num;
- else
- Error ("Horizontal sync start expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_hsyncend = val.num;
- else
- Error ("Horizontal sync end expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_htotal = val.num;
- else
- Error ("Horizontal total expected", NULL);
- had_htimings = 1;
- break;
- case VTIMINGS:
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_vdisplay = val.num;
- else
- Error ("Vertical display expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_vsyncstart = val.num;
- else
- Error ("Vertical sync start expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_vsyncend = val.num;
- else
- Error ("Vertical sync end expected", NULL);
-
- if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
- ptr->ml_vtotal = val.num;
- else
- Error ("Vertical total expected", NULL);
- had_vtimings = 1;
- break;
- case FLAGS:
- token = xf86getSubToken (&(ptr->ml_comment));
- if (token != STRING)
- Error (QUOTE_MSG, "Flags");
- while (token == STRING)
- {
- token2 = xf86getStringToken (TimingTab);
- switch (token2)
- {
- case TT_INTERLACE:
- ptr->ml_flags |= XF86CONF_INTERLACE;
- break;
- case TT_PHSYNC:
- ptr->ml_flags |= XF86CONF_PHSYNC;
- break;
- case TT_NHSYNC:
- ptr->ml_flags |= XF86CONF_NHSYNC;
- break;
- case TT_PVSYNC:
- ptr->ml_flags |= XF86CONF_PVSYNC;
- break;
- case TT_NVSYNC:
- ptr->ml_flags |= XF86CONF_NVSYNC;
- break;
- case TT_CSYNC:
- ptr->ml_flags |= XF86CONF_CSYNC;
- break;
- case TT_PCSYNC:
- ptr->ml_flags |= XF86CONF_PCSYNC;
- break;
- case TT_NCSYNC:
- ptr->ml_flags |= XF86CONF_NCSYNC;
- break;
- case TT_DBLSCAN:
- ptr->ml_flags |= XF86CONF_DBLSCAN;
- break;
- case TT_CUSTOM:
- ptr->ml_flags |= XF86CONF_CUSTOM;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error ("Unknown flag string", NULL);
- break;
- }
- token = xf86getSubToken (&(ptr->ml_comment));
- }
- xf86unGetToken (token);
- break;
- case HSKEW:
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("Horizontal skew expected", NULL);
- ptr->ml_flags |= XF86CONF_HSKEW;
- ptr->ml_hskew = val.num;
- break;
- case VSCAN:
- if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
- Error ("Vertical scan count expected", NULL);
- ptr->ml_flags |= XF86CONF_VSCAN;
- ptr->ml_vscan = val.num;
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error ("Unexepcted token in verbose \"Mode\" entry\n", NULL);
- }
- }
- if (!had_dotclock)
- Error ("the dotclock is missing", NULL);
- if (!had_htimings)
- Error ("the horizontal timings are missing", NULL);
- if (!had_vtimings)
- Error ("the vertical timings are missing", NULL);
-
-#ifdef DEBUG
- printf ("Verbose Mode parsed\n");
-#endif
- return (ptr);
-}
-
-#undef CLEANUP
-
-#define CLEANUP xf86freeMonitorList
-
-XF86ConfMonitorPtr
-xf86parseMonitorSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
- while ((token = xf86getToken (MonitorTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->mon_comment = xf86addComment(ptr->mon_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->mon_identifier = val.str;
- has_ident = TRUE;
- break;
- case VENDOR:
- if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
- Error (QUOTE_MSG, "Vendor");
- ptr->mon_vendor = val.str;
- break;
- case MODEL:
- if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
- Error (QUOTE_MSG, "ModelName");
- ptr->mon_modelname = val.str;
- break;
- case MODE:
- HANDLE_LIST (mon_modeline_lst, xf86parseVerboseMode,
- XF86ConfModeLinePtr);
- break;
- case MODELINE:
- HANDLE_LIST (mon_modeline_lst, xf86parseModeLine,
- XF86ConfModeLinePtr);
- break;
- case DISPLAYSIZE:
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
- Error (DISPLAYSIZE_MSG, NULL);
- ptr->mon_width = val.realnum;
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
- Error (DISPLAYSIZE_MSG, NULL);
- ptr->mon_height = val.realnum;
- break;
-
- case HORIZSYNC:
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
- Error (HORIZSYNC_MSG, NULL);
- do {
- ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum;
- switch (token = xf86getSubToken (&(ptr->mon_comment)))
- {
- case COMMA:
- ptr->mon_hsync[ptr->mon_n_hsync].hi =
- ptr->mon_hsync[ptr->mon_n_hsync].lo;
- break;
- case DASH:
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER ||
- (float)val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo)
- Error (HORIZSYNC_MSG, NULL);
- ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum;
- if ((token = xf86getSubToken (&(ptr->mon_comment))) == COMMA)
- break;
- ptr->mon_n_hsync++;
- goto HorizDone;
- default:
- /* We cannot currently know if a '\n' was found,
- * or this is a real error
- */
- ptr->mon_hsync[ptr->mon_n_hsync].hi =
- ptr->mon_hsync[ptr->mon_n_hsync].lo;
- ptr->mon_n_hsync++;
- goto HorizDone;
- }
- if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
- Error ("Sorry. Too many horizontal sync intervals.", NULL);
- ptr->mon_n_hsync++;
- } while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
-HorizDone:
- xf86unGetToken (token);
- break;
-
- case VERTREFRESH:
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
- Error (VERTREFRESH_MSG, NULL);
- do {
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo = val.realnum;
- switch (token = xf86getSubToken (&(ptr->mon_comment)))
- {
- case COMMA:
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi =
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo;
- break;
- case DASH:
- if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER ||
- (float)val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo)
- Error (VERTREFRESH_MSG, NULL);
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum;
- if ((token = xf86getSubToken (&(ptr->mon_comment))) == COMMA)
- break;
- ptr->mon_n_vrefresh++;
- goto VertDone;
- default:
- /* We cannot currently know if a '\n' was found,
- * or this is a real error
- */
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi =
- ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo;
- ptr->mon_n_vrefresh++;
- goto VertDone;
- }
- if (ptr->mon_n_vrefresh >= CONF_MAX_VREFRESH)
- Error ("Sorry. Too many vertical refresh intervals.", NULL);
- ptr->mon_n_vrefresh++;
- } while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
-VertDone:
- xf86unGetToken (token);
- break;
-
- case GAMMA:
- if( xf86getSubToken (&(ptr->mon_comment)) != NUMBER )
- {
- Error (INVALID_GAMMA_MSG, NULL);
- }
- else
- {
- ptr->mon_gamma_red = ptr->mon_gamma_green =
- ptr->mon_gamma_blue = val.realnum;
- if( xf86getSubToken (&(ptr->mon_comment)) == NUMBER )
- {
- ptr->mon_gamma_green = val.realnum;
- if( xf86getSubToken (&(ptr->mon_comment)) == NUMBER )
- {
- ptr->mon_gamma_blue = val.realnum;
- }
- else
- {
- Error (INVALID_GAMMA_MSG, NULL);
- }
- }
- else
- xf86unGetToken (token);
- }
- break;
- case OPTION:
- ptr->mon_option_lst = xf86parseOption(ptr->mon_option_lst);
- break;
- case USEMODES:
- {
- XF86ConfModesLinkPtr mptr;
-
- if ((token = xf86getSubToken (&(ptr->mon_comment))) != STRING)
- Error (QUOTE_MSG, "UseModes");
-
- /* add to the end of the list of modes sections
- referenced here */
- mptr = xf86confcalloc (1, sizeof (XF86ConfModesLinkRec));
- mptr->list.next = NULL;
- mptr->ml_modes_str = val.str;
- mptr->ml_modes = NULL;
- ptr->mon_modes_sect_lst = (XF86ConfModesLinkPtr)
- xf86addListItem((GenericListPtr)ptr->mon_modes_sect_lst,
- (GenericListPtr)mptr);
- }
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
- CLEANUP (ptr);
- return NULL;
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Monitor section parsed\n");
-#endif
- return ptr;
-}
-
-#undef CLEANUP
-#define CLEANUP xf86freeModesList
-
-XF86ConfModesPtr
-xf86parseModesSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfModesPtr, XF86ConfModesRec)
-
- while ((token = xf86getToken (ModesTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->modes_comment = xf86addComment(ptr->modes_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->modes_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->modes_identifier = val.str;
- has_ident = TRUE;
- break;
- case MODE:
- HANDLE_LIST (mon_modeline_lst, xf86parseVerboseMode,
- XF86ConfModeLinePtr);
- break;
- case MODELINE:
- HANDLE_LIST (mon_modeline_lst, xf86parseModeLine,
- XF86ConfModeLinePtr);
- break;
- default:
- xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
- CLEANUP (ptr);
- return NULL;
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Modes section parsed\n");
-#endif
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printMonitorSection (FILE * cf, XF86ConfMonitorPtr ptr)
-{
- int i;
- XF86ConfModeLinePtr mlptr;
- XF86ConfModesLinkPtr mptr;
-
- while (ptr)
- {
- mptr = ptr->mon_modes_sect_lst;
- fprintf (cf, "Section \"Monitor\"\n");
- if (ptr->mon_comment)
- fprintf (cf, "%s", ptr->mon_comment);
- if (ptr->mon_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->mon_identifier);
- if (ptr->mon_vendor)
- fprintf (cf, "\tVendorName \"%s\"\n", ptr->mon_vendor);
- if (ptr->mon_modelname)
- fprintf (cf, "\tModelName \"%s\"\n", ptr->mon_modelname);
- while (mptr) {
- fprintf (cf, "\tUseModes \"%s\"\n", mptr->ml_modes_str);
- mptr = mptr->list.next;
- }
- if (ptr->mon_width)
- fprintf (cf, "\tDisplaySize %d\t%d\n",
- ptr->mon_width,
- ptr->mon_height);
- for (i = 0; i < ptr->mon_n_hsync; i++)
- {
- fprintf (cf, "\tHorizSync %2.1f - %2.1f\n",
- ptr->mon_hsync[i].lo,
- ptr->mon_hsync[i].hi);
- }
- for (i = 0; i < ptr->mon_n_vrefresh; i++)
- {
- fprintf (cf, "\tVertRefresh %2.1f - %2.1f\n",
- ptr->mon_vrefresh[i].lo,
- ptr->mon_vrefresh[i].hi);
- }
- if (ptr->mon_gamma_red) {
- if (ptr->mon_gamma_red == ptr->mon_gamma_green
- && ptr->mon_gamma_red == ptr->mon_gamma_blue)
- {
- fprintf (cf, "\tGamma %.4g\n",
- ptr->mon_gamma_red);
- } else {
- fprintf (cf, "\tGamma %.4g %.4g %.4g\n",
- ptr->mon_gamma_red,
- ptr->mon_gamma_green,
- ptr->mon_gamma_blue);
- }
- }
- for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
- {
- fprintf (cf, "\tModeLine \"%s\" %2.1f ",
- mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
- fprintf (cf, "%d %d %d %d %d %d %d %d",
- mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
- mlptr->ml_hsyncend, mlptr->ml_htotal,
- mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
- mlptr->ml_vsyncend, mlptr->ml_vtotal);
- if (mlptr->ml_flags & XF86CONF_PHSYNC)
- fprintf (cf, " +hsync");
- if (mlptr->ml_flags & XF86CONF_NHSYNC)
- fprintf (cf, " -hsync");
- if (mlptr->ml_flags & XF86CONF_PVSYNC)
- fprintf (cf, " +vsync");
- if (mlptr->ml_flags & XF86CONF_NVSYNC)
- fprintf (cf, " -vsync");
- if (mlptr->ml_flags & XF86CONF_INTERLACE)
- fprintf (cf, " interlace");
- if (mlptr->ml_flags & XF86CONF_CSYNC)
- fprintf (cf, " composite");
- if (mlptr->ml_flags & XF86CONF_PCSYNC)
- fprintf (cf, " +csync");
- if (mlptr->ml_flags & XF86CONF_NCSYNC)
- fprintf (cf, " -csync");
- if (mlptr->ml_flags & XF86CONF_DBLSCAN)
- fprintf (cf, " doublescan");
- if (mlptr->ml_flags & XF86CONF_HSKEW)
- fprintf (cf, " hskew %d", mlptr->ml_hskew);
- if (mlptr->ml_flags & XF86CONF_BCAST)
- fprintf (cf, " bcast");
- fprintf (cf, "\n");
- }
- xf86printOptionList(cf, ptr->mon_option_lst, 1);
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86printModesSection (FILE * cf, XF86ConfModesPtr ptr)
-{
- XF86ConfModeLinePtr mlptr;
-
- while (ptr)
- {
- fprintf (cf, "Section \"Modes\"\n");
- if (ptr->modes_comment)
- fprintf (cf, "%s", ptr->modes_comment);
- if (ptr->modes_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->modes_identifier);
- for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
- {
- fprintf (cf, "\tModeLine \"%s\" %2.1f ",
- mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
- fprintf (cf, "%d %d %d %d %d %d %d %d",
- mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
- mlptr->ml_hsyncend, mlptr->ml_htotal,
- mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
- mlptr->ml_vsyncend, mlptr->ml_vtotal);
- if (mlptr->ml_flags & XF86CONF_PHSYNC)
- fprintf (cf, " +hsync");
- if (mlptr->ml_flags & XF86CONF_NHSYNC)
- fprintf (cf, " -hsync");
- if (mlptr->ml_flags & XF86CONF_PVSYNC)
- fprintf (cf, " +vsync");
- if (mlptr->ml_flags & XF86CONF_NVSYNC)
- fprintf (cf, " -vsync");
- if (mlptr->ml_flags & XF86CONF_INTERLACE)
- fprintf (cf, " interlace");
- if (mlptr->ml_flags & XF86CONF_CSYNC)
- fprintf (cf, " composite");
- if (mlptr->ml_flags & XF86CONF_PCSYNC)
- fprintf (cf, " +csync");
- if (mlptr->ml_flags & XF86CONF_NCSYNC)
- fprintf (cf, " -csync");
- if (mlptr->ml_flags & XF86CONF_DBLSCAN)
- fprintf (cf, " doublescan");
- if (mlptr->ml_flags & XF86CONF_HSKEW)
- fprintf (cf, " hskew %d", mlptr->ml_hskew);
- if (mlptr->ml_flags & XF86CONF_VSCAN)
- fprintf (cf, " vscan %d", mlptr->ml_vscan);
- if (mlptr->ml_flags & XF86CONF_BCAST)
- fprintf (cf, " bcast");
- if (mlptr->ml_comment)
- fprintf (cf, "%s", mlptr->ml_comment);
- else
- fprintf (cf, "\n");
- }
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86freeMonitorList (XF86ConfMonitorPtr ptr)
-{
- XF86ConfMonitorPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->mon_identifier);
- TestFree (ptr->mon_vendor);
- TestFree (ptr->mon_modelname);
- TestFree (ptr->mon_comment);
- xf86optionListFree (ptr->mon_option_lst);
- xf86freeModeLineList (ptr->mon_modeline_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeModesList (XF86ConfModesPtr ptr)
-{
- XF86ConfModesPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->modes_identifier);
- TestFree (ptr->modes_comment);
- xf86freeModeLineList (ptr->mon_modeline_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeModeLineList (XF86ConfModeLinePtr ptr)
-{
- XF86ConfModeLinePtr prev;
- while (ptr)
- {
- TestFree (ptr->ml_identifier);
- TestFree (ptr->ml_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-XF86ConfMonitorPtr
-xf86findMonitor (const char *ident, XF86ConfMonitorPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->mon_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
-XF86ConfModesPtr
-xf86findModes (const char *ident, XF86ConfModesPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->modes_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
-XF86ConfModeLinePtr
-xf86findModeLine (const char *ident, XF86ConfModeLinePtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->ml_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
-int
-xf86validateMonitor (XF86ConfigPtr p, XF86ConfScreenPtr screen)
-{
- XF86ConfMonitorPtr monitor = screen->scrn_monitor;
- XF86ConfModesLinkPtr modeslnk = monitor->mon_modes_sect_lst;
- XF86ConfModesPtr modes;
- while(modeslnk)
- {
- modes = xf86findModes (modeslnk->ml_modes_str, p->conf_modes_lst);
- if (!modes)
- {
- xf86validationError (UNDEFINED_MODES_MSG,
- modeslnk->ml_modes_str,
- screen->scrn_identifier);
- return (FALSE);
- }
- modeslnk->ml_modes = modes;
- modeslnk = modeslnk->list.next;
- }
- return (TRUE);
-}
diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c
deleted file mode 100644
index 8b373c562..000000000
--- a/hw/xfree86/parser/Pointer.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec PointerTab[] =
-{
- {PROTOCOL, "protocol"},
- {EMULATE3, "emulate3buttons"},
- {EM3TIMEOUT, "emulate3timeout"},
- {ENDSUBSECTION, "endsubsection"},
- {ENDSECTION, "endsection"},
- {PDEVICE, "device"},
- {PDEVICE, "port"},
- {BAUDRATE, "baudrate"},
- {SAMPLERATE, "samplerate"},
- {CLEARDTR, "cleardtr"},
- {CLEARRTS, "clearrts"},
- {CHORDMIDDLE, "chordmiddle"},
- {PRESOLUTION, "resolution"},
- {DEVICE_NAME, "devicename"},
- {ALWAYSCORE, "alwayscore"},
- {PBUTTONS, "buttons"},
- {ZAXISMAPPING, "zaxismapping"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec ZMapTab[] =
-{
- {XAXIS, "x"},
- {YAXIS, "y"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeInputList
-
-XF86ConfInputPtr
-xf86parsePointerSection (void)
-{
- char *s, *s1, *s2;
- int l;
- int token;
- parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
-
- while ((token = xf86getToken (PointerTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
- break;
- case PROTOCOL:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "Protocol");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Protocol"),
- val.str);
- break;
- case PDEVICE:
- if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
- Error (QUOTE_MSG, "Device");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Device"),
- val.str);
- break;
- case EMULATE3:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Emulate3Buttons"),
- NULL);
- break;
- case EM3TIMEOUT:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (POSITIVE_INT_MSG, "Emulate3Timeout");
- s = xf86uLongToString(val.num);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Emulate3Timeout"),
- s);
- break;
- case CHORDMIDDLE:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("ChordMiddle"),
- NULL);
- break;
- case PBUTTONS:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (POSITIVE_INT_MSG, "Buttons");
- s = xf86uLongToString(val.num);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Buttons"), s);
- break;
- case BAUDRATE:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (POSITIVE_INT_MSG, "BaudRate");
- s = xf86uLongToString(val.num);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("BaudRate"), s);
- break;
- case SAMPLERATE:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (POSITIVE_INT_MSG, "SampleRate");
- s = xf86uLongToString(val.num);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("SampleRate"), s);
- break;
- case PRESOLUTION:
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (POSITIVE_INT_MSG, "Resolution");
- s = xf86uLongToString(val.num);
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Resolution"), s);
- break;
- case CLEARDTR:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("ClearDTR"), NULL);
- break;
- case CLEARRTS:
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("ClearRTS"), NULL);
- break;
- case ZAXISMAPPING:
- switch (xf86getToken(ZMapTab)) {
- case NUMBER:
- if (val.num < 0)
- Error (ZAXISMAPPING_MSG, NULL);
- s1 = xf86uLongToString(val.num);
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
- Error (ZAXISMAPPING_MSG, NULL);
- s2 = xf86uLongToString(val.num);
- l = strlen(s1) + 1 + strlen(s2) + 1;
- s = xf86confmalloc(l);
- sprintf(s, "%s %s", s1, s2);
- xf86conffree(s1);
- xf86conffree(s2);
- break;
- case XAXIS:
- s = xf86configStrdup("x");
- break;
- case YAXIS:
- s = xf86configStrdup("y");
- break;
- default:
- Error (ZAXISMAPPING_MSG, NULL);
- break;
- }
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("ZAxisMapping"),
- s);
- break;
- case ALWAYSCORE:
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_POINTER);
- ptr->inp_driver = xf86configStrdup("mouse");
- ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("CorePointer"), NULL);
-
-#ifdef DEBUG
- printf ("Pointer section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
deleted file mode 100644
index e3bf18048..000000000
--- a/hw/xfree86/parser/Screen.c
+++ /dev/null
@@ -1,574 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.28 2003/11/07 23:41:41 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec DisplayTab[] =
-{
- {ENDSUBSECTION, "endsubsection"},
- {MODES, "modes"},
- {VIEWPORT, "viewport"},
- {VIRTUAL, "virtual"},
- {VISUAL, "visual"},
- {BLACK_TOK, "black"},
- {WHITE_TOK, "white"},
- {DEPTH, "depth"},
- {BPP, "fbbpp"},
- {WEIGHT, "weight"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeDisplayList
-
-XF86ConfDisplayPtr
-xf86parseDisplaySubSection (void)
-{
- int token;
- parsePrologue (XF86ConfDisplayPtr, XF86ConfDisplayRec)
-
- ptr->disp_black.red = ptr->disp_black.green = ptr->disp_black.blue = -1;
- ptr->disp_white.red = ptr->disp_white.green = ptr->disp_white.blue = -1;
- ptr->disp_frameX0 = ptr->disp_frameY0 = -1;
- while ((token = xf86getToken (DisplayTab)) != ENDSUBSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->disp_comment = xf86addComment(ptr->disp_comment, val.str);
- break;
- case VIEWPORT:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (VIEWPORT_MSG, NULL);
- ptr->disp_frameX0 = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (VIEWPORT_MSG, NULL);
- ptr->disp_frameY0 = val.num;
- break;
- case VIRTUAL:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (VIRTUAL_MSG, NULL);
- ptr->disp_virtualX = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (VIRTUAL_MSG, NULL);
- ptr->disp_virtualY = val.num;
- break;
- case DEPTH:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (NUMBER_MSG, "Display");
- ptr->disp_depth = val.num;
- break;
- case BPP:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (NUMBER_MSG, "Display");
- ptr->disp_bpp = val.num;
- break;
- case VISUAL:
- if (xf86getSubToken (&(ptr->disp_comment)) != STRING)
- Error (QUOTE_MSG, "Display");
- ptr->disp_visual = val.str;
- break;
- case WEIGHT:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WEIGHT_MSG, NULL);
- ptr->disp_weight.red = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WEIGHT_MSG, NULL);
- ptr->disp_weight.green = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WEIGHT_MSG, NULL);
- ptr->disp_weight.blue = val.num;
- break;
- case BLACK_TOK:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (BLACK_MSG, NULL);
- ptr->disp_black.red = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (BLACK_MSG, NULL);
- ptr->disp_black.green = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (BLACK_MSG, NULL);
- ptr->disp_black.blue = val.num;
- break;
- case WHITE_TOK:
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WHITE_MSG, NULL);
- ptr->disp_white.red = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WHITE_MSG, NULL);
- ptr->disp_white.green = val.num;
- if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
- Error (WHITE_MSG, NULL);
- ptr->disp_white.blue = val.num;
- break;
- case MODES:
- {
- XF86ModePtr mptr;
-
- while ((token = xf86getSubTokenWithTab (&(ptr->disp_comment), DisplayTab)) == STRING)
- {
- mptr = xf86confcalloc (1, sizeof (XF86ModeRec));
- mptr->mode_name = val.str;
- mptr->list.next = NULL;
- ptr->disp_mode_lst = (XF86ModePtr)
- xf86addListItem ((glp) ptr->disp_mode_lst, (glp) mptr);
- }
- xf86unGetToken (token);
- }
- break;
- case OPTION:
- ptr->disp_option_lst = xf86parseOption(ptr->disp_option_lst);
- break;
-
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("Display subsection parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-static xf86ConfigSymTabRec ScreenTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {OBSDRIVER, "driver"},
- {MDEVICE, "device"},
- {MONITOR, "monitor"},
- {VIDEOADAPTOR, "videoadaptor"},
- {SCREENNO, "screenno"},
- {SUBSECTION, "subsection"},
- {DEFAULTDEPTH, "defaultcolordepth"},
- {DEFAULTDEPTH, "defaultdepth"},
- {DEFAULTBPP, "defaultbpp"},
- {DEFAULTFBBPP, "defaultfbbpp"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeScreenList
-XF86ConfScreenPtr
-xf86parseScreenSection (void)
-{
- int has_ident = FALSE;
- int has_driver= FALSE;
- int token;
-
- parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
-
- while ((token = xf86getToken (ScreenTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->scrn_comment = xf86addComment(ptr->scrn_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- ptr->scrn_identifier = val.str;
- if (has_ident || has_driver)
- Error (ONLY_ONE_MSG,"Identifier or Driver");
- has_ident = TRUE;
- break;
- case OBSDRIVER:
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "Driver");
- ptr->scrn_obso_driver = val.str;
- if (has_ident || has_driver)
- Error (ONLY_ONE_MSG,"Identifier or Driver");
- has_driver = TRUE;
- break;
- case DEFAULTDEPTH:
- if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
- Error (NUMBER_MSG, "DefaultDepth");
- ptr->scrn_defaultdepth = val.num;
- break;
- case DEFAULTBPP:
- if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
- Error (NUMBER_MSG, "DefaultBPP");
- ptr->scrn_defaultbpp = val.num;
- break;
- case DEFAULTFBBPP:
- if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
- Error (NUMBER_MSG, "DefaultFbBPP");
- ptr->scrn_defaultfbbpp = val.num;
- break;
- case MDEVICE:
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "Device");
- ptr->scrn_device_str = val.str;
- break;
- case MONITOR:
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "Monitor");
- ptr->scrn_monitor_str = val.str;
- break;
- case VIDEOADAPTOR:
- {
- XF86ConfAdaptorLinkPtr aptr;
-
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "VideoAdaptor");
-
- /* Don't allow duplicates */
- for (aptr = ptr->scrn_adaptor_lst; aptr;
- aptr = (XF86ConfAdaptorLinkPtr) aptr->list.next)
- if (xf86nameCompare (val.str, aptr->al_adaptor_str) == 0)
- break;
-
- if (aptr == NULL)
- {
- aptr = xf86confcalloc (1, sizeof (XF86ConfAdaptorLinkRec));
- aptr->list.next = NULL;
- aptr->al_adaptor_str = val.str;
- ptr->scrn_adaptor_lst = (XF86ConfAdaptorLinkPtr)
- xf86addListItem ((glp) ptr->scrn_adaptor_lst, (glp) aptr);
- }
- }
- break;
- case OPTION:
- ptr->scrn_option_lst = xf86parseOption(ptr->scrn_option_lst);
- break;
- case SUBSECTION:
- if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
- Error (QUOTE_MSG, "SubSection");
- {
- xf86conffree(val.str);
- HANDLE_LIST (scrn_display_lst, xf86parseDisplaySubSection,
- XF86ConfDisplayPtr);
- }
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- if (!has_ident && !has_driver)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Screen section parsed\n");
-#endif
-
- return ptr;
-}
-
-void
-xf86printScreenSection (FILE * cf, XF86ConfScreenPtr ptr)
-{
- XF86ConfAdaptorLinkPtr aptr;
- XF86ConfDisplayPtr dptr;
- XF86ModePtr mptr;
-
- while (ptr)
- {
- fprintf (cf, "Section \"Screen\"\n");
- if (ptr->scrn_comment)
- fprintf (cf, "%s", ptr->scrn_comment);
- if (ptr->scrn_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->scrn_identifier);
- if (ptr->scrn_obso_driver)
- fprintf (cf, "\tDriver \"%s\"\n", ptr->scrn_obso_driver);
- if (ptr->scrn_device_str)
- fprintf (cf, "\tDevice \"%s\"\n", ptr->scrn_device_str);
- if (ptr->scrn_monitor_str)
- fprintf (cf, "\tMonitor \"%s\"\n", ptr->scrn_monitor_str);
- if (ptr->scrn_defaultdepth)
- fprintf (cf, "\tDefaultDepth %d\n",
- ptr->scrn_defaultdepth);
- if (ptr->scrn_defaultbpp)
- fprintf (cf, "\tDefaultBPP %d\n",
- ptr->scrn_defaultbpp);
- if (ptr->scrn_defaultfbbpp)
- fprintf (cf, "\tDefaultFbBPP %d\n",
- ptr->scrn_defaultfbbpp);
- xf86printOptionList(cf, ptr->scrn_option_lst, 1);
- for (aptr = ptr->scrn_adaptor_lst; aptr; aptr = aptr->list.next)
- {
- fprintf (cf, "\tVideoAdaptor \"%s\"\n", aptr->al_adaptor_str);
- }
- for (dptr = ptr->scrn_display_lst; dptr; dptr = dptr->list.next)
- {
- fprintf (cf, "\tSubSection \"Display\"\n");
- if (dptr->disp_comment)
- fprintf (cf, "%s", dptr->disp_comment);
- if (dptr->disp_frameX0 >= 0 || dptr->disp_frameY0 >= 0)
- {
- fprintf (cf, "\t\tViewport %d %d\n",
- dptr->disp_frameX0, dptr->disp_frameY0);
- }
- if (dptr->disp_virtualX != 0 || dptr->disp_virtualY != 0)
- {
- fprintf (cf, "\t\tVirtual %d %d\n",
- dptr->disp_virtualX, dptr->disp_virtualY);
- }
- if (dptr->disp_depth)
- {
- fprintf (cf, "\t\tDepth %d\n", dptr->disp_depth);
- }
- if (dptr->disp_bpp)
- {
- fprintf (cf, "\t\tFbBPP %d\n", dptr->disp_bpp);
- }
- if (dptr->disp_visual)
- {
- fprintf (cf, "\t\tVisual \"%s\"\n", dptr->disp_visual);
- }
- if (dptr->disp_weight.red != 0)
- {
- fprintf (cf, "\t\tWeight %d %d %d\n",
- dptr->disp_weight.red, dptr->disp_weight.green, dptr->disp_weight.blue);
- }
- if (dptr->disp_black.red != -1)
- {
- fprintf (cf, "\t\tBlack 0x%04x 0x%04x 0x%04x\n",
- dptr->disp_black.red, dptr->disp_black.green, dptr->disp_black.blue);
- }
- if (dptr->disp_white.red != -1)
- {
- fprintf (cf, "\t\tWhite 0x%04x 0x%04x 0x%04x\n",
- dptr->disp_white.red, dptr->disp_white.green, dptr->disp_white.blue);
- }
- if (dptr->disp_mode_lst)
- {
- fprintf (cf, "\t\tModes ");
- }
- for (mptr = dptr->disp_mode_lst; mptr; mptr = mptr->list.next)
- {
- fprintf (cf, " \"%s\"", mptr->mode_name);
- }
- if (dptr->disp_mode_lst)
- {
- fprintf (cf, "\n");
- }
- xf86printOptionList(cf, dptr->disp_option_lst, 2);
- fprintf (cf, "\tEndSubSection\n");
- }
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-
-}
-
-void
-xf86freeScreenList (XF86ConfScreenPtr ptr)
-{
- XF86ConfScreenPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->scrn_identifier);
- TestFree (ptr->scrn_monitor_str);
- TestFree (ptr->scrn_device_str);
- TestFree (ptr->scrn_comment);
- xf86optionListFree (ptr->scrn_option_lst);
- xf86freeAdaptorLinkList (ptr->scrn_adaptor_lst);
- xf86freeDisplayList (ptr->scrn_display_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeAdaptorLinkList (XF86ConfAdaptorLinkPtr ptr)
-{
- XF86ConfAdaptorLinkPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->al_adaptor_str);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeDisplayList (XF86ConfDisplayPtr ptr)
-{
- XF86ConfDisplayPtr prev;
-
- while (ptr)
- {
- xf86freeModeList (ptr->disp_mode_lst);
- xf86optionListFree (ptr->disp_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeModeList (XF86ModePtr ptr)
-{
- XF86ModePtr prev;
-
- while (ptr)
- {
- TestFree (ptr->mode_name);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-int
-xf86validateScreen (XF86ConfigPtr p)
-{
- XF86ConfScreenPtr screen = p->conf_screen_lst;
- XF86ConfMonitorPtr monitor;
- XF86ConfDevicePtr device;
- XF86ConfAdaptorLinkPtr adaptor;
-
- if (!screen)
- {
- xf86validationError ("At least one Screen section is required.");
- return (FALSE);
- }
-
- while (screen)
- {
- if (screen->scrn_obso_driver && !screen->scrn_identifier)
- screen->scrn_identifier = screen->scrn_obso_driver;
-
- monitor = xf86findMonitor (screen->scrn_monitor_str, p->conf_monitor_lst);
- if (screen->scrn_monitor_str)
- {
- if (!monitor)
- {
- xf86validationError (UNDEFINED_MONITOR_MSG,
- screen->scrn_monitor_str, screen->scrn_identifier);
- return (FALSE);
- }
- else
- {
- screen->scrn_monitor = monitor;
- if (!xf86validateMonitor(p, screen))
- return (FALSE);
- }
- }
-
- device = xf86findDevice (screen->scrn_device_str, p->conf_device_lst);
- if (!device)
- {
- xf86validationError (UNDEFINED_DEVICE_MSG,
- screen->scrn_device_str, screen->scrn_identifier);
- return (FALSE);
- }
- else
- screen->scrn_device = device;
-
- adaptor = screen->scrn_adaptor_lst;
- while (adaptor)
- {
- adaptor->al_adaptor = xf86findVideoAdaptor (adaptor->al_adaptor_str, p->conf_videoadaptor_lst);
- if (!adaptor->al_adaptor)
- {
- xf86validationError (UNDEFINED_ADAPTOR_MSG, adaptor->al_adaptor_str, screen->scrn_identifier);
- return (FALSE);
- }
- else if (adaptor->al_adaptor->va_fwdref)
- {
- xf86validationError (ADAPTOR_REF_TWICE_MSG, adaptor->al_adaptor_str,
- adaptor->al_adaptor->va_fwdref);
- return (FALSE);
- }
-
- adaptor->al_adaptor->va_fwdref = xf86configStrdup(screen->scrn_identifier);
- adaptor = adaptor->list.next;
- }
-
- screen = screen->list.next;
- }
-
- return (TRUE);
-}
-
-XF86ConfScreenPtr
-xf86findScreen (const char *ident, XF86ConfScreenPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->scrn_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c
deleted file mode 100644
index fbbb2e00f..000000000
--- a/hw/xfree86/parser/Vendor.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.17 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec VendorSubTab[] =
-{
- {ENDSUBSECTION, "endsubsection"},
- {IDENTIFIER, "identifier"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeVendorSubList
-
-XF86ConfVendSubPtr
-xf86parseVendorSubSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfVendSubPtr, XF86ConfVendSubRec)
-
- while ((token = xf86getToken (VendorSubTab)) != ENDSUBSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->vs_comment = xf86addComment(ptr->vs_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->vs_comment)))
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->vs_identifier = val.str;
- has_ident = TRUE;
- break;
- case OPTION:
- ptr->vs_option_lst = xf86parseOption(ptr->vs_option_lst);
- break;
-
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("Vendor subsection parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-static xf86ConfigSymTabRec VendorTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {OPTION, "option"},
- {SUBSECTION, "subsection"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeVendorList
-
-XF86ConfVendorPtr
-xf86parseVendorSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfVendorPtr, XF86ConfVendorRec)
-
- while ((token = xf86getToken (VendorTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->vnd_comment = xf86addComment(ptr->vnd_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->vnd_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->vnd_identifier = val.str;
- has_ident = TRUE;
- break;
- case OPTION:
- ptr->vnd_option_lst = xf86parseOption(ptr->vnd_option_lst);
- break;
- case SUBSECTION:
- if (xf86getSubToken (&(ptr->vnd_comment)) != STRING)
- Error (QUOTE_MSG, "SubSection");
- {
- HANDLE_LIST (vnd_sub_lst, xf86parseVendorSubSection,
- XF86ConfVendSubPtr);
- }
- break;
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
-
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("Vendor section parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-void
-xf86printVendorSection (FILE * cf, XF86ConfVendorPtr ptr)
-{
- XF86ConfVendSubPtr pptr;
-
- while (ptr)
- {
- fprintf (cf, "Section \"Vendor\"\n");
- if (ptr->vnd_comment)
- fprintf (cf, "%s", ptr->vnd_comment);
- if (ptr->vnd_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->vnd_identifier);
-
- xf86printOptionList(cf, ptr->vnd_option_lst, 1);
- for (pptr = ptr->vnd_sub_lst; pptr; pptr = pptr->list.next)
- {
- fprintf (cf, "\tSubSection \"Vendor\"\n");
- if (pptr->vs_comment)
- fprintf (cf, "%s", pptr->vs_comment);
- if (pptr->vs_identifier)
- fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vs_identifier);
- xf86printOptionList(cf, pptr->vs_option_lst, 2);
- fprintf (cf, "\tEndSubSection\n");
- }
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-}
-
-void
-xf86freeVendorList (XF86ConfVendorPtr p)
-{
- if (p == NULL)
- return;
- xf86freeVendorSubList (p->vnd_sub_lst);
- TestFree (p->vnd_identifier);
- TestFree (p->vnd_comment);
- xf86optionListFree (p->vnd_option_lst);
- xf86conffree (p);
-}
-
-void
-xf86freeVendorSubList (XF86ConfVendSubPtr ptr)
-{
- XF86ConfVendSubPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->vs_identifier);
- TestFree (ptr->vs_name);
- TestFree (ptr->vs_comment);
- xf86optionListFree (ptr->vs_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-XF86ConfVendorPtr
-xf86findVendor (const char *name, XF86ConfVendorPtr list)
-{
- while (list)
- {
- if (xf86nameCompare (list->vnd_identifier, name) == 0)
- return (list);
- list = list->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
deleted file mode 100644
index de65c415e..000000000
--- a/hw/xfree86/parser/Video.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Video.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec VideoPortTab[] =
-{
- {ENDSUBSECTION, "endsubsection"},
- {IDENTIFIER, "identifier"},
- {OPTION, "option"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeVideoPortList
-
-XF86ConfVideoPortPtr
-xf86parseVideoPortSubSection (void)
-{
- int has_ident = FALSE;
- int token;
- parsePrologue (XF86ConfVideoPortPtr, XF86ConfVideoPortRec)
-
- while ((token = xf86getToken (VideoPortTab)) != ENDSUBSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->vp_comment = xf86addComment(ptr->vp_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->vp_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- ptr->vp_identifier = val.str;
- has_ident = TRUE;
- break;
- case OPTION:
- ptr->vp_option_lst = xf86parseOption(ptr->vp_option_lst);
- break;
-
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
-#ifdef DEBUG
- printf ("VideoPort subsection parsed\n");
-#endif
-
- return ptr;
-}
-
-#undef CLEANUP
-
-static xf86ConfigSymTabRec VideoAdaptorTab[] =
-{
- {ENDSECTION, "endsection"},
- {IDENTIFIER, "identifier"},
- {VENDOR, "vendorname"},
- {BOARD, "boardname"},
- {BUSID, "busid"},
- {DRIVER, "driver"},
- {OPTION, "option"},
- {SUBSECTION, "subsection"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeVideoAdaptorList
-
-XF86ConfVideoAdaptorPtr
-xf86parseVideoAdaptorSection (void)
-{
- int has_ident = FALSE;
- int token;
-
- parsePrologue (XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec)
-
- while ((token = xf86getToken (VideoAdaptorTab)) != ENDSECTION)
- {
- switch (token)
- {
- case COMMENT:
- ptr->va_comment = xf86addComment(ptr->va_comment, val.str);
- break;
- case IDENTIFIER:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "Identifier");
- ptr->va_identifier = val.str;
- if (has_ident == TRUE)
- Error (MULTIPLE_MSG, "Identifier");
- has_ident = TRUE;
- break;
- case VENDOR:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "Vendor");
- ptr->va_vendor = val.str;
- break;
- case BOARD:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "Board");
- ptr->va_board = val.str;
- break;
- case BUSID:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "BusID");
- ptr->va_busid = val.str;
- break;
- case DRIVER:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "Driver");
- ptr->va_driver = val.str;
- break;
- case OPTION:
- ptr->va_option_lst = xf86parseOption(ptr->va_option_lst);
- break;
- case SUBSECTION:
- if (xf86getSubToken (&(ptr->va_comment)) != STRING)
- Error (QUOTE_MSG, "SubSection");
- {
- HANDLE_LIST (va_port_lst, xf86parseVideoPortSubSection,
- XF86ConfVideoPortPtr);
- }
- break;
-
- case EOF_TOKEN:
- Error (UNEXPECTED_EOF_MSG, NULL);
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- break;
- }
- }
-
- if (!has_ident)
- Error (NO_IDENT_MSG, NULL);
-
-#ifdef DEBUG
- printf ("VideoAdaptor section parsed\n");
-#endif
-
- return ptr;
-}
-
-void
-xf86printVideoAdaptorSection (FILE * cf, XF86ConfVideoAdaptorPtr ptr)
-{
- XF86ConfVideoPortPtr pptr;
-
- while (ptr)
- {
- fprintf (cf, "Section \"VideoAdaptor\"\n");
- if (ptr->va_comment)
- fprintf (cf, "%s", ptr->va_comment);
- if (ptr->va_identifier)
- fprintf (cf, "\tIdentifier \"%s\"\n", ptr->va_identifier);
- if (ptr->va_vendor)
- fprintf (cf, "\tVendorName \"%s\"\n", ptr->va_vendor);
- if (ptr->va_board)
- fprintf (cf, "\tBoardName \"%s\"\n", ptr->va_board);
- if (ptr->va_busid)
- fprintf (cf, "\tBusID \"%s\"\n", ptr->va_busid);
- if (ptr->va_driver)
- fprintf (cf, "\tDriver \"%s\"\n", ptr->va_driver);
- xf86printOptionList(cf, ptr->va_option_lst, 1);
- for (pptr = ptr->va_port_lst; pptr; pptr = pptr->list.next)
- {
- fprintf (cf, "\tSubSection \"VideoPort\"\n");
- if (pptr->vp_comment)
- fprintf (cf, "%s", pptr->vp_comment);
- if (pptr->vp_identifier)
- fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vp_identifier);
- xf86printOptionList(cf, pptr->vp_option_lst, 2);
- fprintf (cf, "\tEndSubSection\n");
- }
- fprintf (cf, "EndSection\n\n");
- ptr = ptr->list.next;
- }
-
-}
-
-void
-xf86freeVideoAdaptorList (XF86ConfVideoAdaptorPtr ptr)
-{
- XF86ConfVideoAdaptorPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->va_identifier);
- TestFree (ptr->va_vendor);
- TestFree (ptr->va_board);
- TestFree (ptr->va_busid);
- TestFree (ptr->va_driver);
- TestFree (ptr->va_fwdref);
- TestFree (ptr->va_comment);
- xf86freeVideoPortList (ptr->va_port_lst);
- xf86optionListFree (ptr->va_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
-xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
-{
- XF86ConfVideoPortPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->vp_identifier);
- TestFree (ptr->vp_comment);
- xf86optionListFree (ptr->vp_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-XF86ConfVideoAdaptorPtr
-xf86findVideoAdaptor (const char *ident, XF86ConfVideoAdaptorPtr p)
-{
- while (p)
- {
- if (xf86nameCompare (ident, p->va_identifier) == 0)
- return (p);
-
- p = p->list.next;
- }
- return (NULL);
-}
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
deleted file mode 100644
index 522cf5c2f..000000000
--- a/hw/xfree86/parser/configProcs.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.17 2003/08/24 17:37:08 dawes Exp $ */
-/*
- * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */
-
-/* Device.c */
-XF86ConfDevicePtr xf86parseDeviceSection(void);
-void xf86printDeviceSection(FILE *cf, XF86ConfDevicePtr ptr);
-void xf86freeDeviceList(XF86ConfDevicePtr ptr);
-int xf86validateDevice(XF86ConfigPtr p);
-/* Files.c */
-XF86ConfFilesPtr xf86parseFilesSection(void);
-void xf86printFileSection(FILE *cf, XF86ConfFilesPtr ptr);
-void xf86freeFiles(XF86ConfFilesPtr p);
-/* Flags.c */
-XF86ConfFlagsPtr xf86parseFlagsSection(void);
-void xf86printServerFlagsSection(FILE *f, XF86ConfFlagsPtr flags);
-void xf86freeFlags(XF86ConfFlagsPtr flags);
-/* Input.c */
-XF86ConfInputPtr xf86parseInputSection(void);
-void xf86printInputSection(FILE *f, XF86ConfInputPtr ptr);
-void xf86freeInputList(XF86ConfInputPtr ptr);
-int xf86validateInput (XF86ConfigPtr p);
-/* Keyboard.c */
-XF86ConfInputPtr xf86parseKeyboardSection(void);
-/* Layout.c */
-XF86ConfLayoutPtr xf86parseLayoutSection(void);
-void xf86printLayoutSection(FILE *cf, XF86ConfLayoutPtr ptr);
-void xf86freeLayoutList(XF86ConfLayoutPtr ptr);
-void xf86freeAdjacencyList(XF86ConfAdjacencyPtr ptr);
-void xf86freeInputrefList(XF86ConfInputrefPtr ptr);
-int xf86validateLayout(XF86ConfigPtr p);
-/* Module.c */
-XF86LoadPtr xf86parseModuleSubSection(XF86LoadPtr head, char *name);
-XF86ConfModulePtr xf86parseModuleSection(void);
-void xf86printModuleSection(FILE *cf, XF86ConfModulePtr ptr);
-XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, char *name, int type, XF86OptionPtr opts);
-void xf86freeModules(XF86ConfModulePtr ptr);
-/* Monitor.c */
-XF86ConfModeLinePtr xf86parseModeLine(void);
-XF86ConfModeLinePtr xf86parseVerboseMode(void);
-XF86ConfMonitorPtr xf86parseMonitorSection(void);
-XF86ConfModesPtr xf86parseModesSection(void);
-void xf86printMonitorSection(FILE *cf, XF86ConfMonitorPtr ptr);
-void xf86printModesSection(FILE *cf, XF86ConfModesPtr ptr);
-void xf86freeMonitorList(XF86ConfMonitorPtr ptr);
-void xf86freeModesList(XF86ConfModesPtr ptr);
-void xf86freeModeLineList(XF86ConfModeLinePtr ptr);
-int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
-/* Pointer.c */
-XF86ConfInputPtr xf86parsePointerSection(void);
-/* Screen.c */
-XF86ConfDisplayPtr xf86parseDisplaySubSection(void);
-XF86ConfScreenPtr xf86parseScreenSection(void);
-void xf86printScreenSection(FILE *cf, XF86ConfScreenPtr ptr);
-void xf86freeScreenList(XF86ConfScreenPtr ptr);
-void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr);
-void xf86freeDisplayList(XF86ConfDisplayPtr ptr);
-void xf86freeModeList(XF86ModePtr ptr);
-int xf86validateScreen(XF86ConfigPtr p);
-/* Vendor.c */
-XF86ConfVendorPtr xf86parseVendorSection(void);
-XF86ConfVendSubPtr xf86parseVendorSubSection (void);
-void xf86freeVendorList(XF86ConfVendorPtr p);
-void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
-void xf86freeVendorSubList (XF86ConfVendSubPtr ptr);
-/* Video.c */
-XF86ConfVideoPortPtr xf86parseVideoPortSubSection(void);
-XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
-void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
-void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
-void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr);
-/* read.c */
-int xf86validateConfig(XF86ConfigPtr p);
-/* scan.c */
-unsigned int xf86strToUL(char *str);
-int xf86getToken(xf86ConfigSymTabRec *tab);
-int xf86getSubToken(char **comment);
-int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec *tab);
-void xf86unGetToken(int token);
-char *xf86tokenString(void);
-void xf86parseError(char *format, ...);
-void xf86parseWarning(char *format, ...);
-void xf86validationError(char *format, ...);
-void xf86setSection(char *section);
-int xf86getStringToken(xf86ConfigSymTabRec *tab);
-/* write.c */
-/* DRI.c */
-XF86ConfBuffersPtr xf86parseBuffers (void);
-void xf86freeBuffersList (XF86ConfBuffersPtr ptr);
-XF86ConfDRIPtr xf86parseDRISection (void);
-void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
-void xf86freeDRI (XF86ConfDRIPtr ptr);
-
-#ifndef IN_XSERVER
-/* Externally provided functions */
-void ErrorF(const char *f, ...);
-void VErrorF(const char *f, va_list args);
-#endif
diff --git a/hw/xfree86/parser/cpconfig.c b/hw/xfree86/parser/cpconfig.c
deleted file mode 100644
index 3cd3749ed..000000000
--- a/hw/xfree86/parser/cpconfig.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/cpconfig.c,v 1.7 2003/02/17 16:08:29 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-
-/* View/edit this file with tab stops set to 4 */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include "xf86Parser.h"
-#include "configProcs.h"
-
-#ifdef MALLOC_FUNCTIONS
-void
-xfree (void *p)
-{
- free (p);
- return;
-}
-
-void *
-xalloc (int size)
-{
- return malloc (size);
-}
-
-void *
-xrealloc (void *p, int size)
-{
- return realloc (p, size);
-}
-
-#endif
-
-#define CONFPATH "%A,%R,/etc/X11/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \
- "%P/etc/X11/%F,%D/%X,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \
- "%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X"
-
-int
-main (int argc, char *argv[])
-{
- const char *filename;
- char *cmdline = NULL;
- XF86ConfigPtr conf;
-
- if (argc > 1)
- {
- cmdline = argv[1];
- }
- if ((filename = xf86openConfigFile (CONFPATH, cmdline, NULL)))
- {
- fprintf (stderr, "Opened %s for the config file\n", filename);
- }
- else
- {
- fprintf (stderr, "Unable to open config file\n");
- exit (1);
- }
-
- if ((conf = xf86readConfigFile ()) == NULL)
- {
- fprintf (stderr, "Problem when parsing config file\n");
- }
- else
- {
- fprintf (stderr, "Config file parsed OK\n");
- }
- xf86closeConfigFile ();
-
- if (argc > 2) {
- fprintf(stderr, "Writing config file to `%s'\n", argv[2]);
- xf86writeConfigFile (argv[2], conf);
- }
- exit(0);
-}
-
-/* Functions that the parser requires */
-
-void
-VErrorF(const char *f, va_list args)
-{
- vfprintf(stderr, f, args);
-}
-
-void
-ErrorF(const char *f, ...)
-{
- va_list args;
-
- va_start(args, f);
- vfprintf(stderr, f, args);
- va_end(args);
-}
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
deleted file mode 100644
index 2a5afeb27..000000000
--- a/hw/xfree86/parser/read.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.24 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-extern LexRec val;
-
-static xf86ConfigSymTabRec TopLevelTab[] =
-{
- {SECTION, "section"},
- {-1, ""},
-};
-
-#define CLEANUP xf86freeConfig
-
-XF86ConfigPtr
-xf86readConfigFile (void)
-{
- int token;
- XF86ConfigPtr ptr = NULL;
-
- if ((ptr = xf86confcalloc (1, sizeof (XF86ConfigRec))) == NULL)
- {
- return NULL;
- }
- memset (ptr, 0, sizeof (XF86ConfigRec));
-
- while ((token = xf86getToken (TopLevelTab)) != EOF_TOKEN)
- {
- switch (token)
- {
- case COMMENT:
- ptr->conf_comment = xf86addComment(ptr->conf_comment, val.str);
- break;
- case SECTION:
- if (xf86getSubToken (&(ptr->conf_comment)) != STRING)
- {
- xf86parseError (QUOTE_MSG, "Section");
- CLEANUP (ptr);
- return (NULL);
- }
- xf86setSection (val.str);
- if (xf86nameCompare (val.str, "files") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_RETURN (conf_files, xf86parseFilesSection ());
- }
- else if (xf86nameCompare (val.str, "serverflags") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_RETURN (conf_flags, xf86parseFlagsSection ());
- }
- else if (xf86nameCompare (val.str, "keyboard") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_input_lst, xf86parseKeyboardSection,
- XF86ConfInputPtr);
- }
- else if (xf86nameCompare (val.str, "pointer") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_input_lst, xf86parsePointerSection,
- XF86ConfInputPtr);
- }
- else if (xf86nameCompare (val.str, "videoadaptor") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_videoadaptor_lst, xf86parseVideoAdaptorSection,
- XF86ConfVideoAdaptorPtr);
- }
- else if (xf86nameCompare (val.str, "device") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_device_lst, xf86parseDeviceSection,
- XF86ConfDevicePtr);
- }
- else if (xf86nameCompare (val.str, "monitor") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_monitor_lst, xf86parseMonitorSection,
- XF86ConfMonitorPtr);
- }
- else if (xf86nameCompare (val.str, "modes") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_modes_lst, xf86parseModesSection,
- XF86ConfModesPtr);
- }
- else if (xf86nameCompare (val.str, "screen") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_screen_lst, xf86parseScreenSection,
- XF86ConfScreenPtr);
- }
- else if (xf86nameCompare(val.str, "inputdevice") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_input_lst, xf86parseInputSection,
- XF86ConfInputPtr);
- }
- else if (xf86nameCompare (val.str, "module") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_RETURN (conf_modules, xf86parseModuleSection ());
- }
- else if (xf86nameCompare (val.str, "serverlayout") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_layout_lst, xf86parseLayoutSection,
- XF86ConfLayoutPtr);
- }
- else if (xf86nameCompare (val.str, "vendor") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_LIST (conf_vendor_lst, xf86parseVendorSection,
- XF86ConfVendorPtr);
- }
- else if (xf86nameCompare (val.str, "dri") == 0)
- {
- xf86conffree(val.str);
- val.str = NULL;
- HANDLE_RETURN (conf_dri, xf86parseDRISection ());
- }
- else
- {
- Error (INVALID_SECTION_MSG, xf86tokenString ());
- xf86conffree(val.str);
- val.str = NULL;
- }
- break;
- default:
- Error (INVALID_KEYWORD_MSG, xf86tokenString ());
- xf86conffree(val.str);
- val.str = NULL;
- }
- }
-
- if (xf86validateConfig (ptr))
- return (ptr);
- else
- {
- CLEANUP (ptr);
- return (NULL);
- }
-}
-
-#undef CLEANUP
-
-/*
- * This function resolves name references and reports errors if the named
- * objects cannot be found.
- */
-int
-xf86validateConfig (XF86ConfigPtr p)
-{
- if (!xf86validateDevice (p))
- return FALSE;
- if (!xf86validateScreen (p))
- return FALSE;
- if (!xf86validateInput (p))
- return FALSE;
- if (!xf86validateLayout (p))
- return FALSE;
-
- return (TRUE);
-}
-
-/*
- * adds an item to the end of the linked list. Any record whose first field
- * is a GenericListRec can be cast to this type and used with this function.
- * A pointer to the head of the list is returned to handle the addition of
- * the first item.
- */
-GenericListPtr
-xf86addListItem (GenericListPtr head, GenericListPtr new)
-{
- GenericListPtr p = head;
- GenericListPtr last = NULL;
-
- while (p)
- {
- last = p;
- p = p->next;
- }
-
- if (last)
- {
- last->next = new;
- return (head);
- }
- else
- return (new);
-}
-
-/*
- * Test if one chained list contains the other.
- * In this case both list have the same endpoint (provided they don't loop)
- */
-int
-xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2)
-{
- GenericListPtr p = list_1;
- GenericListPtr last_1 = NULL, last_2 = NULL;
-
- while (p) {
- last_1 = p;
- p = p->next;
- }
-
- p = list_2;
- while (p) {
- last_2 = p;
- p = p->next;
- }
-
- return (!(last_1 == last_2));
-}
-
-void
-xf86freeConfig (XF86ConfigPtr p)
-{
- if (p == NULL)
- return;
-
- xf86freeFiles (p->conf_files);
- xf86freeModules (p->conf_modules);
- xf86freeFlags (p->conf_flags);
- xf86freeMonitorList (p->conf_monitor_lst);
- xf86freeModesList (p->conf_modes_lst);
- xf86freeVideoAdaptorList (p->conf_videoadaptor_lst);
- xf86freeDeviceList (p->conf_device_lst);
- xf86freeScreenList (p->conf_screen_lst);
- xf86freeLayoutList (p->conf_layout_lst);
- xf86freeInputList (p->conf_input_lst);
- xf86freeVendorList (p->conf_vendor_lst);
- xf86freeDRI (p->conf_dri);
- TestFree(p->conf_comment);
-
- xf86conffree (p);
-}
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
deleted file mode 100644
index 4dc2e0dd1..000000000
--- a/hw/xfree86/parser/scan.c
+++ /dev/null
@@ -1,918 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.30 2003/11/03 05:11:52 tsi Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-#if !defined(X_NOT_POSIX)
-#if defined(_POSIX_SOURCE)
-#include <limits.h>
-#else
-#define _POSIX_SOURCE
-#include <limits.h>
-#undef _POSIX_SOURCE
-#endif /* _POSIX_SOURCE */
-#endif /* !X_NOT_POSIX */
-#if !defined(PATH_MAX)
-#if defined(MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
-#if !defined(MAXHOSTNAMELEN)
-#define MAXHOSTNAMELEN 32
-#endif /* !MAXHOSTNAMELEN */
-
-#include "Configint.h"
-#include "xf86tokens.h"
-
-#define CONFIG_BUF_LEN 1024
-
-static int StringToToken (char *, xf86ConfigSymTabRec *);
-
-static FILE *configFile = NULL;
-static const char **builtinConfig = NULL;
-static int builtinIndex = 0;
-static int configPos = 0; /* current readers position */
-static int configLineNo = 0; /* linenumber */
-static char *configBuf, *configRBuf; /* buffer for lines */
-static char *configPath; /* path to config file */
-static char *configSection = NULL; /* name of current section being parsed */
-static int pushToken = LOCK_TOKEN;
-static int eol_seen = 0; /* private state to handle comments */
-LexRec val;
-
-#ifdef __UNIXOS2__
-extern char *__XOS2RedirRoot(char *path);
-#endif
-
-/*
- * xf86strToUL --
- *
- * A portable, but restricted, version of strtoul(). It only understands
- * hex, octal, and decimal. But it's good enough for our needs.
- */
-unsigned int
-xf86strToUL (char *str)
-{
- int base = 10;
- char *p = str;
- unsigned int tot = 0;
-
- if (*p == '0')
- {
- p++;
- if ((*p == 'x') || (*p == 'X'))
- {
- p++;
- base = 16;
- }
- else
- base = 8;
- }
- while (*p)
- {
- if ((*p >= '0') && (*p <= ((base == 8) ? '7' : '9')))
- {
- tot = tot * base + (*p - '0');
- }
- else if ((base == 16) && (*p >= 'a') && (*p <= 'f'))
- {
- tot = tot * base + 10 + (*p - 'a');
- }
- else if ((base == 16) && (*p >= 'A') && (*p <= 'F'))
- {
- tot = tot * base + 10 + (*p - 'A');
- }
- else
- {
- return (tot);
- }
- p++;
- }
- return (tot);
-}
-
-/*
- * xf86getToken --
- * Read next Token form the config file. Handle the global variable
- * pushToken.
- */
-int
-xf86getToken (xf86ConfigSymTabRec * tab)
-{
- int c, i;
-
- /*
- * First check whether pushToken has a different value than LOCK_TOKEN.
- * In this case rBuf[] contains a valid STRING/TOKEN/NUMBER. But in the
- * oth * case the next token must be read from the input.
- */
- if (pushToken == EOF_TOKEN)
- return (EOF_TOKEN);
- else if (pushToken == LOCK_TOKEN)
- {
- /*
- * eol_seen is only set for the first token after a newline.
- */
- eol_seen = 0;
-
- c = configBuf[configPos];
-
- /*
- * Get start of next Token. EOF is handled,
- * whitespaces are skipped.
- */
-
-again:
- if (!c)
- {
- char *ret;
- if (configFile)
- ret = fgets (configBuf, CONFIG_BUF_LEN - 1, configFile);
- else {
- if (builtinConfig[builtinIndex] == NULL)
- ret = NULL;
- else {
- ret = strncpy(configBuf, builtinConfig[builtinIndex],
- CONFIG_BUF_LEN);
- builtinIndex++;
- }
- }
- if (ret == NULL)
- {
- return (pushToken = EOF_TOKEN);
- }
- configLineNo++;
- configPos = 0;
- eol_seen = 1;
- }
-
- i = 0;
- for (;;) {
- c = configBuf[configPos++];
- configRBuf[i++] = c;
- switch (c) {
- case ' ':
- case '\t':
- case '\r':
- continue;
- case '\n':
- i = 0;
- continue;
- }
- break;
- }
- if (c == '\0')
- goto again;
-
- if (c == '#')
- {
- do
- {
- configRBuf[i++] = (c = configBuf[configPos++]);
- }
- while ((c != '\n') && (c != '\r') && (c != '\0'));
- configRBuf[i] = '\0';
- /* XXX no private copy.
- * Use xf86addComment when setting a comment.
- */
- val.str = configRBuf;
- return (COMMENT);
- }
-
- /* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */
- else if ((c == ',') && !isalpha (configBuf[configPos]))
- {
- return COMMA;
- }
- else if ((c == '-') && !isalpha (configBuf[configPos]))
- {
- return DASH;
- }
-
- /*
- * Numbers are returned immediately ...
- */
- if (isdigit (c))
- {
- int base;
-
- if (c == '0')
- if ((configBuf[configPos] == 'x') ||
- (configBuf[configPos] == 'X'))
- base = 16;
- else
- base = 8;
- else
- base = 10;
-
- configRBuf[0] = c;
- i = 1;
- while (isdigit (c = configBuf[configPos++]) ||
- (c == '.') || (c == 'x') || (c == 'X') ||
- ((base == 16) && (((c >= 'a') && (c <= 'f')) ||
- ((c >= 'A') && (c <= 'F')))))
- configRBuf[i++] = c;
- configPos--; /* GJA -- one too far */
- configRBuf[i] = '\0';
- val.num = xf86strToUL (configRBuf);
- val.realnum = atof (configRBuf);
- return (NUMBER);
- }
-
- /*
- * All Strings START with a \" ...
- */
- else if (c == '\"')
- {
- i = -1;
- do
- {
- configRBuf[++i] = (c = configBuf[configPos++]);
- }
- while ((c != '\"') && (c != '\n') && (c != '\r') && (c != '\0'));
- configRBuf[i] = '\0';
- val.str = xf86confmalloc (strlen (configRBuf) + 1);
- strcpy (val.str, configRBuf); /* private copy ! */
- return (STRING);
- }
-
- /*
- * ... and now we MUST have a valid token. The search is
- * handled later along with the pushed tokens.
- */
- else
- {
- configRBuf[0] = c;
- i = 0;
- do
- {
- configRBuf[++i] = (c = configBuf[configPos++]);;
- }
- while ((c != ' ') && (c != '\t') && (c != '\n') && (c != '\r') && (c != '\0') && (c != '#'));
- --configPos;
- configRBuf[i] = '\0';
- i = 0;
- }
-
- }
- else
- {
-
- /*
- * Here we deal with pushed tokens. Reinitialize pushToken again. If
- * the pushed token was NUMBER || STRING return them again ...
- */
- int temp = pushToken;
- pushToken = LOCK_TOKEN;
-
- if (temp == COMMA || temp == DASH)
- return (temp);
- if (temp == NUMBER || temp == STRING)
- return (temp);
- }
-
- /*
- * Joop, at last we have to lookup the token ...
- */
- if (tab)
- {
- i = 0;
- while (tab[i].token != -1)
- if (xf86nameCompare (configRBuf, tab[i].name) == 0)
- return (tab[i].token);
- else
- i++;
- }
-
- return (ERROR_TOKEN); /* Error catcher */
-}
-
-int
-xf86getSubToken (char **comment)
-{
- int token;
-
- for (;;) {
- token = xf86getToken(NULL);
- if (token == COMMENT) {
- if (comment)
- *comment = xf86addComment(*comment, val.str);
- }
- else
- return (token);
- }
- /*NOTREACHED*/
-}
-
-int
-xf86getSubTokenWithTab (char **comment, xf86ConfigSymTabRec *tab)
-{
- int token;
-
- for (;;) {
- token = xf86getToken(tab);
- if (token == COMMENT) {
- if (comment)
- *comment = xf86addComment(*comment, val.str);
- }
- else
- return (token);
- }
- /*NOTREACHED*/
-}
-
-void
-xf86unGetToken (int token)
-{
- pushToken = token;
-}
-
-char *
-xf86tokenString (void)
-{
- return configRBuf;
-}
-
-int
-xf86pathIsAbsolute(const char *path)
-{
- if (path && path[0] == '/')
- return 1;
-#ifdef __UNIXOS2__
- if (path && (path[0] == '\\' || (path[1] == ':')))
- return 1;
-#endif
- return 0;
-}
-
-/* A path is "safe" if it is relative and if it contains no ".." elements. */
-int
-xf86pathIsSafe(const char *path)
-{
- if (xf86pathIsAbsolute(path))
- return 0;
-
- /* Compare with ".." */
- if (!strcmp(path, ".."))
- return 0;
-
- /* Look for leading "../" */
- if (!strncmp(path, "../", 3))
- return 0;
-
- /* Look for trailing "/.." */
- if ((strlen(path) > 3) && !strcmp(path + strlen(path) - 3, "/.."))
- return 0;
-
- /* Look for "/../" */
- if (strstr(path, "/../"))
- return 0;
-
- return 1;
-}
-
-/*
- * This function substitutes the following escape sequences:
- *
- * %A cmdline argument as an absolute path (must be absolute to match)
- * %R cmdline argument as a relative path
- * %S cmdline argument as a "safe" path (relative, and no ".." elements)
- * %X default config file name ("XF86Config")
- * %H hostname
- * %E config file environment ($XF86CONFIG) as an absolute path
- * %F config file environment ($XF86CONFIG) as a relative path
- * %G config file environment ($XF86CONFIG) as a safe path
- * %D $HOME
- * %P projroot
- * %M major version number
- * %% %
- * %& UNIXOS2 only: prepend X11ROOT env var
- */
-
-#ifndef XCONFIGFILE
-#define XCONFIGFILE "XF86Config"
-#endif
-#ifndef PROJECTROOT
-#define PROJECTROOT "/usr/X11R6"
-#endif
-#ifndef XCONFENV
-#define XCONFENV "XF86CONFIG"
-#endif
-#ifndef XF86_VERSION_MAJOR
-#ifdef XVERSION
-#if XVERSION > 40000000
-#define XF86_VERSION_MAJOR (XVERSION / 10000000)
-#else
-#define XF86_VERSION_MAJOR (XVERSION / 1000)
-#endif
-#else
-#define XF86_VERSION_MAJOR 4
-#endif
-#endif
-
-#define BAIL_OUT do { \
- xf86conffree(result); \
- return NULL; \
- } while (0)
-
-#define CHECK_LENGTH do { \
- if (l > PATH_MAX) { \
- BAIL_OUT; \
- } \
- } while (0)
-
-#define APPEND_STR(s) do { \
- if (strlen(s) + l > PATH_MAX) { \
- BAIL_OUT; \
- } else { \
- strcpy(result + l, s); \
- l += strlen(s); \
- } \
- } while (0)
-
-static char *
-DoSubstitution(const char *template, const char *cmdline, const char *projroot,
- int *cmdlineUsed, int *envUsed)
-{
- char *result;
- int i, l;
- static const char *env = NULL, *home = NULL;
- static char *hostname = NULL;
- static char majorvers[3] = "";
-#ifdef __UNIXOS2__
- static char *x11root = NULL;
-#endif
-
- if (!template)
- return NULL;
-
- if (cmdlineUsed)
- *cmdlineUsed = 0;
- if (envUsed)
- *envUsed = 0;
-
- result = xf86confmalloc(PATH_MAX + 1);
- l = 0;
- for (i = 0; template[i]; i++) {
- if (template[i] != '%') {
- result[l++] = template[i];
- CHECK_LENGTH;
- } else {
- switch (template[++i]) {
- case 'A':
- if (cmdline && xf86pathIsAbsolute(cmdline)) {
- APPEND_STR(cmdline);
- if (cmdlineUsed)
- *cmdlineUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'R':
- if (cmdline && !xf86pathIsAbsolute(cmdline)) {
- APPEND_STR(cmdline);
- if (cmdlineUsed)
- *cmdlineUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'S':
- if (cmdline && xf86pathIsSafe(cmdline)) {
- APPEND_STR(cmdline);
- if (cmdlineUsed)
- *cmdlineUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'X':
- APPEND_STR(XCONFIGFILE);
- break;
- case 'H':
- if (!hostname) {
- if ((hostname = xf86confmalloc(MAXHOSTNAMELEN + 1))) {
- if (gethostname(hostname, MAXHOSTNAMELEN) == 0) {
- hostname[MAXHOSTNAMELEN] = '\0';
- } else {
- xf86conffree(hostname);
- hostname = NULL;
- }
- }
- }
- if (hostname)
- APPEND_STR(hostname);
- break;
- case 'E':
- if (!env)
- env = getenv(XCONFENV);
- if (env && xf86pathIsAbsolute(env)) {
- APPEND_STR(env);
- if (envUsed)
- *envUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'F':
- if (!env)
- env = getenv(XCONFENV);
- if (env && !xf86pathIsAbsolute(env)) {
- APPEND_STR(env);
- if (envUsed)
- *envUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'G':
- if (!env)
- env = getenv(XCONFENV);
- if (env && xf86pathIsSafe(env)) {
- APPEND_STR(env);
- if (envUsed)
- *envUsed = 1;
- } else
- BAIL_OUT;
- break;
- case 'D':
- if (!home)
- home = getenv("HOME");
- if (home && xf86pathIsAbsolute(home))
- APPEND_STR(home);
- else
- BAIL_OUT;
- break;
- case 'P':
- if (projroot && xf86pathIsAbsolute(projroot))
- APPEND_STR(projroot);
- else
- BAIL_OUT;
- break;
- case 'M':
- if (!majorvers[0]) {
- if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
- fprintf(stderr, "XF86_VERSION_MAJOR is out of range\n");
- BAIL_OUT;
- } else
- sprintf(majorvers, "%d", XF86_VERSION_MAJOR);
- }
- APPEND_STR(majorvers);
- break;
- case '%':
- result[l++] = '%';
- CHECK_LENGTH;
- break;
-#ifdef __UNIXOS2__
- case '&':
- if (!x11root)
- x11root = getenv("X11ROOT");
- if (x11root)
- APPEND_STR(x11root);
- else
- BAIL_OUT;
- break;
-#endif
- default:
- fprintf(stderr, "invalid escape %%%c found in path template\n",
- template[i]);
- BAIL_OUT;
- break;
- }
- }
- }
-#ifdef DEBUG
- fprintf(stderr, "Converted `%s' to `%s'\n", template, result);
-#endif
- return result;
-}
-
-/*
- * xf86openConfigFile --
- *
- * This function take a config file search path (optional), a command-line
- * specified file name (optional) and the ProjectRoot path (optional) and
- * locates and opens a config file based on that information. If a
- * command-line file name is specified, then this function fails if none
- * of the located files.
- *
- * The return value is a pointer to the actual name of the file that was
- * opened. When no file is found, the return value is NULL.
- *
- * The escape sequences allowed in the search path are defined above.
- *
- */
-
-#ifndef DEFAULT_CONF_PATH
-#define DEFAULT_CONF_PATH "/etc/X11/%S," \
- "%P/etc/X11/%S," \
- "/etc/X11/%G," \
- "%P/etc/X11/%G," \
- "/etc/X11/%X-%M," \
- "/etc/X11/%X," \
- "/etc/%X," \
- "%P/etc/X11/%X.%H," \
- "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," \
- "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#endif
-
-const char *
-xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
-{
- char *pathcopy;
- const char *template;
- int cmdlineUsed = 0;
-
- configFile = NULL;
- configPos = 0; /* current readers position */
- configLineNo = 0; /* linenumber */
- pushToken = LOCK_TOKEN;
-
- if (!path || !path[0])
- path = DEFAULT_CONF_PATH;
- pathcopy = xf86confmalloc(strlen(path) + 1);
- strcpy(pathcopy, path);
- if (!projroot || !projroot[0])
- projroot = PROJECTROOT;
-
- template = strtok(pathcopy, ",");
-
- /* First, search for a config file. */
- while (template && !configFile) {
- if ((configPath = DoSubstitution(template, cmdline, projroot,
- &cmdlineUsed, NULL))) {
- if ((configFile = fopen(configPath, "r")) != 0) {
- if (cmdline && !cmdlineUsed) {
- fclose(configFile);
- configFile = NULL;
- }
- }
- }
- if (configPath && !configFile) {
- xf86conffree(configPath);
- configPath = NULL;
- }
- template = strtok(NULL, ",");
- }
- xf86conffree(pathcopy);
- if (!configFile) {
-
- return NULL;
- }
-
- configBuf = xf86confmalloc (CONFIG_BUF_LEN);
- configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
- configBuf[0] = '\0'; /* sanity ... */
-
- return configPath;
-}
-
-void
-xf86closeConfigFile (void)
-{
- xf86conffree (configPath);
- configPath = NULL;
- xf86conffree (configRBuf);
- configRBuf = NULL;
- xf86conffree (configBuf);
- configBuf = NULL;
-
- if (configFile) {
- fclose (configFile);
- configFile = NULL;
- } else {
- builtinConfig = NULL;
- builtinIndex = 0;
- }
-}
-
-void
-xf86setBuiltinConfig(const char *config[])
-{
- builtinConfig = config;
- configPath = xf86configStrdup("<builtin configuration>");
- configBuf = xf86confmalloc (CONFIG_BUF_LEN);
- configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
- configBuf[0] = '\0'; /* sanity ... */
-
-}
-
-void
-xf86parseError (char *format,...)
-{
- va_list ap;
-
- ErrorF ("Parse error on line %d of section %s in file %s\n\t",
- configLineNo, configSection, configPath);
- va_start (ap, format);
- VErrorF (format, ap);
- va_end (ap);
-
- ErrorF ("\n");
-}
-
-void
-xf86parseWarning (char *format,...)
-{
- va_list ap;
-
- ErrorF ("Parse warning on line %d of section %s in file %s\n\t",
- configLineNo, configSection, configPath);
- va_start (ap, format);
- VErrorF (format, ap);
- va_end (ap);
-
- ErrorF ("\n");
-}
-
-void
-xf86validationError (char *format,...)
-{
- va_list ap;
-
- ErrorF ("Data incomplete in file %s\n\t", configPath);
- va_start (ap, format);
- VErrorF (format, ap);
- va_end (ap);
-
- ErrorF ("\n");
-}
-
-void
-xf86setSection (char *section)
-{
- if (configSection)
- xf86conffree(configSection);
- configSection = xf86confmalloc(strlen (section) + 1);
- strcpy (configSection, section);
-}
-
-/*
- * xf86getToken --
- * Lookup a string if it is actually a token in disguise.
- */
-int
-xf86getStringToken (xf86ConfigSymTabRec * tab)
-{
- return StringToToken (val.str, tab);
-}
-
-static int
-StringToToken (char *str, xf86ConfigSymTabRec * tab)
-{
- int i;
-
- for (i = 0; tab[i].token != -1; i++)
- {
- if (!xf86nameCompare (tab[i].name, str))
- return tab[i].token;
- }
- return (ERROR_TOKEN);
-}
-
-
-/*
- * Compare two names. The characters '_', ' ', and '\t' are ignored
- * in the comparison.
- */
-int
-xf86nameCompare (const char *s1, const char *s2)
-{
- char c1, c2;
-
- if (!s1 || *s1 == 0) {
- if (!s2 || *s2 == 0)
- return (0);
- else
- return (1);
- }
-
- while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
- s1++;
- while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
- s2++;
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
- while (c1 == c2)
- {
- if (c1 == '\0')
- return (0);
- s1++;
- s2++;
- while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
- s1++;
- while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
- s2++;
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
- }
- return (c1 - c2);
-}
-
-char *
-xf86addComment(char *cur, char *add)
-{
- char *str;
- int len, curlen, iscomment, hasnewline = 0, endnewline;
-
- if (add == NULL || add[0] == '\0')
- return (cur);
-
- if (cur) {
- curlen = strlen(cur);
- if (curlen)
- hasnewline = cur[curlen - 1] == '\n';
- eol_seen = 0;
- }
- else
- curlen = 0;
-
- str = add;
- iscomment = 0;
- while (*str) {
- if (*str != ' ' && *str != '\t')
- break;
- ++str;
- }
- iscomment = (*str == '#');
-
- len = strlen(add);
- endnewline = add[len - 1] == '\n';
- len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
-
- if ((str = xf86confrealloc(cur, len + curlen)) == NULL)
- return (cur);
-
- cur = str;
-
- if (eol_seen || (curlen && !hasnewline))
- cur[curlen++] = '\n';
- if (!iscomment)
- cur[curlen++] = '#';
- strcpy(cur + curlen, add);
- if (!endnewline)
- strcat(cur, "\n");
-
- return (cur);
-}
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
deleted file mode 100644
index e096c6247..000000000
--- a/hw/xfree86/parser/write.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.18 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-
-#if ((defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
-#ifndef strerror
-extern char *sys_errlist[];
-extern int sys_nerr;
-#define strerror(n) \
- (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
-#endif
-#endif
-
-#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
-#define HAS_SAVED_IDS_AND_SETEUID
-#endif
-#if defined(__UNIXOS2__) || defined(WIN32)
-#define HAS_NO_UIDS
-#endif
-
-#ifdef HAS_NO_UIDS
-#define doWriteConfigFile xf86writeConfigFile
-#define Local /**/
-#else
-#define Local static
-#endif
-
-Local int
-doWriteConfigFile (const char *filename, XF86ConfigPtr cptr)
-{
- FILE *cf;
-
- if ((cf = fopen (filename, "w")) == NULL)
- {
- return 0;
- }
-
- if (cptr->conf_comment)
- fprintf (cf, "%s\n", cptr->conf_comment);
-
- xf86printLayoutSection (cf, cptr->conf_layout_lst);
-
- fprintf (cf, "Section \"Files\"\n");
- xf86printFileSection (cf, cptr->conf_files);
- fprintf (cf, "EndSection\n\n");
-
- fprintf (cf, "Section \"Module\"\n");
- xf86printModuleSection (cf, cptr->conf_modules);
- fprintf (cf, "EndSection\n\n");
-
- xf86printVendorSection (cf, cptr->conf_vendor_lst);
-
- xf86printServerFlagsSection (cf, cptr->conf_flags);
-
- xf86printInputSection (cf, cptr->conf_input_lst);
-
- xf86printVideoAdaptorSection (cf, cptr->conf_videoadaptor_lst);
-
- xf86printModesSection (cf, cptr->conf_modes_lst);
-
- xf86printMonitorSection (cf, cptr->conf_monitor_lst);
-
- xf86printDeviceSection (cf, cptr->conf_device_lst);
-
- xf86printScreenSection (cf, cptr->conf_screen_lst);
-
- xf86printDRISection (cf, cptr->conf_dri);
-
- fclose(cf);
- return 1;
-}
-
-#ifndef HAS_NO_UIDS
-
-int
-xf86writeConfigFile (const char *filename, XF86ConfigPtr cptr)
-{
- int ret;
-
-#if !defined(HAS_SAVED_IDS_AND_SETEUID)
- int pid, p;
- int status;
- void (*csig)(int);
-#else
- int ruid, euid;
-#endif
-
- if (getuid() != geteuid())
- {
-
-#if !defined(HAS_SAVED_IDS_AND_SETEUID)
- /* Need to fork to change ruid without loosing euid */
-#ifdef SIGCHLD
- csig = signal(SIGCHLD, SIG_DFL);
-#endif
- switch ((pid = fork()))
- {
- case -1:
- ErrorF("xf86writeConfigFile(): fork failed (%s)\n",
- strerror(errno));
- return 0;
- case 0: /* child */
- setuid(getuid());
- ret = doWriteConfigFile(filename, cptr);
- exit(ret);
- break;
- default: /* parent */
- do
- {
- p = waitpid(pid, &status, 0);
- } while (p == -1 && errno == EINTR);
- }
-#ifdef SIGCHLD
- signal(SIGCHLD, csig);
-#endif
- if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0)
- return 1; /* success */
- else
- return 0;
-
-#else /* HAS_SAVED_IDS_AND_SETEUID */
-
- ruid = getuid();
- euid = geteuid();
-
- if (seteuid(ruid) == -1)
- {
- ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
- ruid, strerror(errno));
- return 0;
- }
- ret = doWriteConfigFile(filename, cptr);
-
- if (seteuid(euid) == -1)
- {
- ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
- euid, strerror(errno));
- }
- return ret;
-
-#endif /* HAS_SAVED_IDS_AND_SETEUID */
-
- }
- else
- {
- return doWriteConfigFile(filename, cptr);
- }
-}
-
-#endif /* !HAS_NO_UIDS */
diff --git a/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h
deleted file mode 100644
index d7a1e7ae5..000000000
--- a/hw/xfree86/parser/xf86Optrec.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.11 2003/08/24 17:37:08 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * This file contains the Option Record that is passed between the Parser,
- * and Module setup procs.
- */
-#ifndef _xf86Optrec_h_
-#define _xf86Optrec_h_
-#include <stdio.h>
-
-/*
- * all records that need to be linked lists should contain a GenericList as
- * their first field.
- */
-typedef struct generic_list_rec
-{
- void *next;
-}
-GenericListRec, *GenericListPtr, *glp;
-
-/*
- * All options are stored using this data type.
- */
-typedef struct
-{
- GenericListRec list;
- char *opt_name;
- char *opt_val;
- int opt_used;
- char *opt_comment;
-}
-XF86OptionRec, *XF86OptionPtr;
-
-
-XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name, char *val);
-XF86OptionPtr xf86optionListDup(XF86OptionPtr opt);
-void xf86optionListFree(XF86OptionPtr opt);
-char *xf86optionName(XF86OptionPtr opt);
-char *xf86optionValue(XF86OptionPtr opt);
-XF86OptionPtr xf86newOption(char *name, char *value);
-XF86OptionPtr xf86nextOption(XF86OptionPtr list);
-XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *name);
-char *xf86findOptionValue(XF86OptionPtr list, const char *name);
-int xf86findOptionBoolean (XF86OptionPtr, const char *, int);
-XF86OptionPtr xf86optionListCreate(const char **options, int count, int used);
-XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail);
-char *xf86configStrdup (const char *s);
-int xf86nameCompare (const char *s1, const char *s2);
-char *xf86uLongToString(unsigned long i);
-void xf86debugListOptions(XF86OptionPtr);
-XF86OptionPtr xf86parseOption(XF86OptionPtr head);
-void xf86printOptionList(FILE *fp, XF86OptionPtr list, int tabs);
-
-
-#endif /* _xf86Optrec_h_ */
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
deleted file mode 100644
index 1a30d17a8..000000000
--- a/hw/xfree86/parser/xf86Parser.h
+++ /dev/null
@@ -1,471 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.33 2003/10/08 14:58:30 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/*
- * This file contains the external interfaces for the XFree86 configuration
- * file parser.
- */
-#ifndef _xf86Parser_h_
-#define _xf86Parser_h_
-
-#include "xf86Optrec.h"
-
-#define HAVE_PARSER_DECLS
-
-typedef struct
-{
- char *file_logfile;
- char *file_rgbpath;
- char *file_modulepath;
- char *file_inputdevs;
- char *file_fontpath;
- char *file_comment;
-}
-XF86ConfFilesRec, *XF86ConfFilesPtr;
-
-/* Values for load_type */
-#define XF86_LOAD_MODULE 0
-#define XF86_LOAD_DRIVER 1
-
-typedef struct
-{
- GenericListRec list;
- int load_type;
- char *load_name;
- XF86OptionPtr load_opt;
- char *load_comment;
-}
-XF86LoadRec, *XF86LoadPtr;
-
-typedef struct
-{
- XF86LoadPtr mod_load_lst;
- char *mod_comment;
-}
-XF86ConfModuleRec, *XF86ConfModulePtr;
-
-#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
-
-#define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
-
-#define XF86CONF_PHSYNC 0x0001
-#define XF86CONF_NHSYNC 0x0002
-#define XF86CONF_PVSYNC 0x0004
-#define XF86CONF_NVSYNC 0x0008
-#define XF86CONF_INTERLACE 0x0010
-#define XF86CONF_DBLSCAN 0x0020
-#define XF86CONF_CSYNC 0x0040
-#define XF86CONF_PCSYNC 0x0080
-#define XF86CONF_NCSYNC 0x0100
-#define XF86CONF_HSKEW 0x0200 /* hskew provided */
-#define XF86CONF_BCAST 0x0400
-#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */
-#define XF86CONF_VSCAN 0x1000
-
-typedef struct
-{
- GenericListRec list;
- char *ml_identifier;
- int ml_clock;
- int ml_hdisplay;
- int ml_hsyncstart;
- int ml_hsyncend;
- int ml_htotal;
- int ml_vdisplay;
- int ml_vsyncstart;
- int ml_vsyncend;
- int ml_vtotal;
- int ml_vscan;
- int ml_flags;
- int ml_hskew;
- char *ml_comment;
-}
-XF86ConfModeLineRec, *XF86ConfModeLinePtr;
-
-typedef struct
-{
- GenericListRec list;
- char *vp_identifier;
- XF86OptionPtr vp_option_lst;
- char *vp_comment;
-}
-XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *va_identifier;
- char *va_vendor;
- char *va_board;
- char *va_busid;
- char *va_driver;
- XF86OptionPtr va_option_lst;
- XF86ConfVideoPortPtr va_port_lst;
- char *va_fwdref;
- char *va_comment;
-}
-XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
-
-#define CONF_MAX_HSYNC 8
-#define CONF_MAX_VREFRESH 8
-
-typedef struct
-{
- float hi, lo;
-}
-parser_range;
-
-typedef struct
-{
- int red, green, blue;
-}
-parser_rgb;
-
-typedef struct
-{
- GenericListRec list;
- char *modes_identifier;
- XF86ConfModeLinePtr mon_modeline_lst;
- char *modes_comment;
-}
-XF86ConfModesRec, *XF86ConfModesPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *ml_modes_str;
- XF86ConfModesPtr ml_modes;
-}
-XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *mon_identifier;
- char *mon_vendor;
- char *mon_modelname;
- int mon_width; /* in mm */
- int mon_height; /* in mm */
- XF86ConfModeLinePtr mon_modeline_lst;
- int mon_n_hsync;
- parser_range mon_hsync[CONF_MAX_HSYNC];
- int mon_n_vrefresh;
- parser_range mon_vrefresh[CONF_MAX_VREFRESH];
- float mon_gamma_red;
- float mon_gamma_green;
- float mon_gamma_blue;
- XF86OptionPtr mon_option_lst;
- XF86ConfModesLinkPtr mon_modes_sect_lst;
- char *mon_comment;
-}
-XF86ConfMonitorRec, *XF86ConfMonitorPtr;
-
-#define CONF_MAXDACSPEEDS 4
-#define CONF_MAXCLOCKS 128
-
-typedef struct
-{
- GenericListRec list;
- char *dev_identifier;
- char *dev_vendor;
- char *dev_board;
- char *dev_chipset;
- char *dev_busid;
- char *dev_card;
- char *dev_driver;
- char *dev_ramdac;
- int dev_dacSpeeds[CONF_MAXDACSPEEDS];
- int dev_videoram;
- int dev_textclockfreq;
- unsigned long dev_bios_base;
- unsigned long dev_mem_base;
- unsigned long dev_io_base;
- char *dev_clockchip;
- int dev_clocks;
- int dev_clock[CONF_MAXCLOCKS];
- int dev_chipid;
- int dev_chiprev;
- int dev_irq;
- int dev_screen;
- XF86OptionPtr dev_option_lst;
- char *dev_comment;
-}
-XF86ConfDeviceRec, *XF86ConfDevicePtr;
-
-typedef struct
-{
- GenericListRec list;
- char *mode_name;
-}
-XF86ModeRec, *XF86ModePtr;
-
-typedef struct
-{
- GenericListRec list;
- int disp_frameX0;
- int disp_frameY0;
- int disp_virtualX;
- int disp_virtualY;
- int disp_depth;
- int disp_bpp;
- char *disp_visual;
- parser_rgb disp_weight;
- parser_rgb disp_black;
- parser_rgb disp_white;
- XF86ModePtr disp_mode_lst;
- XF86OptionPtr disp_option_lst;
- char *disp_comment;
-}
-XF86ConfDisplayRec, *XF86ConfDisplayPtr;
-
-typedef struct
-{
- XF86OptionPtr flg_option_lst;
- char *flg_comment;
-}
-XF86ConfFlagsRec, *XF86ConfFlagsPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *al_adaptor_str;
- XF86ConfVideoAdaptorPtr al_adaptor;
-}
-XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *scrn_identifier;
- char *scrn_obso_driver;
- int scrn_defaultdepth;
- int scrn_defaultbpp;
- int scrn_defaultfbbpp;
- char *scrn_monitor_str;
- XF86ConfMonitorPtr scrn_monitor;
- char *scrn_device_str;
- XF86ConfDevicePtr scrn_device;
- XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
- XF86ConfDisplayPtr scrn_display_lst;
- XF86OptionPtr scrn_option_lst;
- char *scrn_comment;
-}
-XF86ConfScreenRec, *XF86ConfScreenPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *inp_identifier;
- char *inp_driver;
- XF86OptionPtr inp_option_lst;
- char *inp_comment;
-}
-XF86ConfInputRec, *XF86ConfInputPtr;
-
-typedef struct
-{
- GenericListRec list;
- XF86ConfInputPtr iref_inputdev;
- char *iref_inputdev_str;
- XF86OptionPtr iref_option_lst;
-}
-XF86ConfInputrefRec, *XF86ConfInputrefPtr;
-
-/* Values for adj_where */
-#define CONF_ADJ_OBSOLETE -1
-#define CONF_ADJ_ABSOLUTE 0
-#define CONF_ADJ_RIGHTOF 1
-#define CONF_ADJ_LEFTOF 2
-#define CONF_ADJ_ABOVE 3
-#define CONF_ADJ_BELOW 4
-#define CONF_ADJ_RELATIVE 5
-
-typedef struct
-{
- GenericListRec list;
- int adj_scrnum;
- XF86ConfScreenPtr adj_screen;
- char *adj_screen_str;
- XF86ConfScreenPtr adj_top;
- char *adj_top_str;
- XF86ConfScreenPtr adj_bottom;
- char *adj_bottom_str;
- XF86ConfScreenPtr adj_left;
- char *adj_left_str;
- XF86ConfScreenPtr adj_right;
- char *adj_right_str;
- int adj_where;
- int adj_x;
- int adj_y;
- char *adj_refscreen;
-}
-XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *inactive_device_str;
- XF86ConfDevicePtr inactive_device;
-}
-XF86ConfInactiveRec, *XF86ConfInactivePtr;
-
-typedef struct
-{
- GenericListRec list;
- char *lay_identifier;
- XF86ConfAdjacencyPtr lay_adjacency_lst;
- XF86ConfInactivePtr lay_inactive_lst;
- XF86ConfInputrefPtr lay_input_lst;
- XF86OptionPtr lay_option_lst;
- char *lay_comment;
-}
-XF86ConfLayoutRec, *XF86ConfLayoutPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *vs_name;
- char *vs_identifier;
- XF86OptionPtr vs_option_lst;
- char *vs_comment;
-}
-XF86ConfVendSubRec, *XF86ConfVendSubPtr;
-
-typedef struct
-{
- GenericListRec list;
- char *vnd_identifier;
- XF86OptionPtr vnd_option_lst;
- XF86ConfVendSubPtr vnd_sub_lst;
- char *vnd_comment;
-}
-XF86ConfVendorRec, *XF86ConfVendorPtr;
-
-typedef struct
-{
- GenericListRec list;
- int buf_count;
- int buf_size;
- char *buf_flags;
- char *buf_comment;
-}
-XF86ConfBuffersRec, *XF86ConfBuffersPtr;
-
-typedef struct
-{
- char *dri_group_name;
- int dri_group;
- int dri_mode;
- XF86ConfBuffersPtr dri_buffers_lst;
- char *dri_comment;
-}
-XF86ConfDRIRec, *XF86ConfDRIPtr;
-
-typedef struct
-{
- XF86ConfFilesPtr conf_files;
- XF86ConfModulePtr conf_modules;
- XF86ConfFlagsPtr conf_flags;
- XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
- XF86ConfModesPtr conf_modes_lst;
- XF86ConfMonitorPtr conf_monitor_lst;
- XF86ConfDevicePtr conf_device_lst;
- XF86ConfScreenPtr conf_screen_lst;
- XF86ConfInputPtr conf_input_lst;
- XF86ConfLayoutPtr conf_layout_lst;
- XF86ConfVendorPtr conf_vendor_lst;
- XF86ConfDRIPtr conf_dri;
- char *conf_comment;
-}
-XF86ConfigRec, *XF86ConfigPtr;
-
-typedef struct
-{
- int token; /* id of the token */
- char *name; /* pointer to the LOWERCASED name */
-}
-xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
-
-/*
- * prototypes for public functions
- */
-extern const char *xf86openConfigFile (const char *, const char *,
- const char *);
-extern void xf86setBuiltinConfig(const char *config[]);
-extern XF86ConfigPtr xf86readConfigFile (void);
-extern void xf86closeConfigFile (void);
-extern void xf86freeConfig (XF86ConfigPtr p);
-extern int xf86writeConfigFile (const char *, XF86ConfigPtr);
-XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p);
-XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list);
-XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p);
-XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p);
-XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p);
-XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
-XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
-XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
-XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
-XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
- XF86ConfVideoAdaptorPtr p);
-
-GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new);
-int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2);
-
-int xf86pathIsAbsolute(const char *path);
-int xf86pathIsSafe(const char *path);
-char *xf86addComment(char *cur, char *add);
-
-#endif /* _xf86Parser_h_ */
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
deleted file mode 100644
index 387773dc0..000000000
--- a/hw/xfree86/parser/xf86tokens.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.20 2003/08/24 17:37:09 dawes Exp $ */
-/*
- *
- * Copyright (c) 1997 Metro Link Incorporated
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- *
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-#ifndef _xf86_tokens_h
-#define _xf86_tokens_h
-
-/* Undefine symbols that some OSs might define */
-#undef IOBASE
-
-/*
- * Each token should have a unique value regardless of the section
- * it is used in.
- */
-
-typedef enum {
- /* errno-style tokens */
- EOF_TOKEN = -4,
- LOCK_TOKEN = -3,
- ERROR_TOKEN = -2,
-
- /* value type tokens */
- NUMBER = 1,
- STRING,
-
- /* Tokens that can appear in many sections */
- SECTION,
- SUBSECTION,
- ENDSECTION,
- ENDSUBSECTION,
- IDENTIFIER,
- VENDOR,
- DASH,
- COMMA,
- OPTION,
- COMMENT,
-
- /* Frequency units */
- HRZ,
- KHZ,
- MHZ,
-
- /* File tokens */
- FONTPATH,
- RGBPATH,
- MODULEPATH,
- INPUTDEVICES,
- LOGFILEPATH,
-
- /* Server Flag tokens. These are deprecated in favour of generic Options */
- NOTRAPSIGNALS,
- DONTZAP,
- DONTZOOM,
- DISABLEVIDMODE,
- ALLOWNONLOCAL,
- DISABLEMODINDEV,
- MODINDEVALLOWNONLOCAL,
- ALLOWMOUSEOPENFAIL,
- BLANKTIME,
- STANDBYTIME,
- SUSPENDTIME,
- OFFTIME,
- DEFAULTLAYOUT,
-
- /* Monitor tokens */
- MODEL,
- MODELINE,
- DISPLAYSIZE,
- HORIZSYNC,
- VERTREFRESH,
- MODE,
- GAMMA,
- USEMODES,
-
- /* Modes tokens */
- /* no new ones */
-
- /* Mode tokens */
- DOTCLOCK,
- HTIMINGS,
- VTIMINGS,
- FLAGS,
- HSKEW,
- BCAST,
- VSCAN,
- ENDMODE,
-
- /* Screen tokens */
- OBSDRIVER,
- MDEVICE,
- MONITOR,
- SCREENNO,
- DEFAULTDEPTH,
- DEFAULTBPP,
- DEFAULTFBBPP,
-
- /* VideoAdaptor tokens */
- VIDEOADAPTOR,
-
- /* Mode timing tokens */
- TT_INTERLACE,
- TT_PHSYNC,
- TT_NHSYNC,
- TT_PVSYNC,
- TT_NVSYNC,
- TT_CSYNC,
- TT_PCSYNC,
- TT_NCSYNC,
- TT_DBLSCAN,
- TT_HSKEW,
- TT_BCAST,
- TT_VSCAN,
- TT_CUSTOM,
-
- /* Module tokens */
- LOAD,
- LOAD_DRIVER,
-
- /* Device tokens */
- DRIVER,
- CHIPSET,
- CLOCKS,
- VIDEORAM,
- BOARD,
- IOBASE,
- RAMDAC,
- DACSPEED,
- BIOSBASE,
- MEMBASE,
- CLOCKCHIP,
- CHIPID,
- CHIPREV,
- CARD,
- BUSID,
- TEXTCLOCKFRQ,
- IRQ,
-
- /* Keyboard tokens */
- AUTOREPEAT,
- XLEDS,
- KPROTOCOL,
- XKBKEYMAP,
- XKBCOMPAT,
- XKBTYPES,
- XKBKEYCODES,
- XKBGEOMETRY,
- XKBSYMBOLS,
- XKBDISABLE,
- PANIX106,
- XKBRULES,
- XKBMODEL,
- XKBLAYOUT,
- XKBVARIANT,
- XKBOPTIONS,
- /* The next two have become ServerFlags options */
- VTINIT,
- VTSYSREQ,
- /* Obsolete keyboard tokens */
- SERVERNUM,
- LEFTALT,
- RIGHTALT,
- SCROLLLOCK_TOK,
- RIGHTCTL,
- /* arguments for the above obsolete tokens */
- CONF_KM_META,
- CONF_KM_COMPOSE,
- CONF_KM_MODESHIFT,
- CONF_KM_MODELOCK,
- CONF_KM_SCROLLLOCK,
- CONF_KM_CONTROL,
-
- /* Pointer tokens */
- EMULATE3,
- BAUDRATE,
- SAMPLERATE,
- PRESOLUTION,
- CLEARDTR,
- CLEARRTS,
- CHORDMIDDLE,
- PROTOCOL,
- PDEVICE,
- EM3TIMEOUT,
- DEVICE_NAME,
- ALWAYSCORE,
- PBUTTONS,
- ZAXISMAPPING,
-
- /* Pointer Z axis mapping tokens */
- XAXIS,
- YAXIS,
-
- /* Display tokens */
- MODES,
- VIEWPORT,
- VIRTUAL,
- VISUAL,
- BLACK_TOK,
- WHITE_TOK,
- DEPTH,
- BPP,
- WEIGHT,
-
- /* Layout Tokens */
- SCREEN,
- INACTIVE,
- INPUTDEVICE,
-
- /* Adjaceny Tokens */
- RIGHTOF,
- LEFTOF,
- ABOVE,
- BELOW,
- RELATIVE,
- ABSOLUTE,
-
- /* Vendor Tokens */
- VENDORNAME,
-
- /* DRI Tokens */
- GROUP,
- BUFFERS
-} ParserTokens;
-
-#endif /* _xf86_tokens_h */
diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c
deleted file mode 100644
index d8d5332f9..000000000
--- a/hw/xfree86/rac/xf86RAC.c
+++ /dev/null
@@ -1,1256 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RAC.c,v 1.7 2002/09/16 18:06:18 eich Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "screenint.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "pixmap.h"
-#include "windowstr.h"
-#include "window.h"
-#include "xf86str.h"
-#include "xf86RAC.h"
-#include "mipointer.h"
-#include "mipointrst.h"
-#ifdef RENDER
-# include "picturestr.h"
-#endif
-
-#ifdef DEBUG
-#define DPRINT_S(x,y) ErrorF(x ": %i\n",y);
-#define DPRINT(x) ErrorF(x "\n");
-#else
-#define DPRINT_S(x,y)
-#define DPRINT(x)
-#endif
-
-#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\
- pScreen->x = y;}
-#define WRAP_SCREEN_COND(x,y,cond) \
- {pScreenPriv->x = pScreen->x;\
- if (flag & (cond))\
- pScreen->x = y;}
-#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
-
-#define SCREEN_PROLOG(x) \
- pScreen->x = \
- ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->x
-#define SCREEN_EPILOG(x,y) pScreen->x = y;
-
-#define WRAP_PICT_COND(x,y,cond) if (ps)\
- {pScreenPriv->x = ps->x;\
- if (flag & (cond))\
- ps->x = y;}
-#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
-
-#define PICTURE_PROLOGUE(field) \
- ps->field = \
- ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->field
-#define PICTURE_EPILOGUE(field, wrap) \
- ps->field = wrap
-
-#define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\
- pScrn->x = y;}
-#define WRAP_SCREEN_INFO_COND(x,y,cond) \
- {pScreenPriv->x = pScrn->x;\
- if (flag & (cond))\
- pScrn->x = y;}
-#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
-
-#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
-(miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;\
- RACScreenPtr pScreenPriv = \
-((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr);\
- PointPriv->spriteFuncs = pScreenPriv->miSprite;
-#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
- PointPriv->spriteFuncs = &RACSpriteFuncs;
-#define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\
- if(flag & (cond))\
- PointPriv->spriteFuncs = &RACSpriteFuncs;}
-#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
-
-
-#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
- pGCPriv->wrapFuncs = (x)->funcs;\
- (x)->ops = &RACGCOps;\
- (x)->funcs = &RACGCFuncs;
-#define GC_UNWRAP(x)\
- RACGCPtr pGCPriv = (RACGCPtr) (x)->devPrivates[RACGCIndex].ptr;\
- (x)->ops = pGCPriv->wrapOps;\
- (x)->funcs = pGCPriv->wrapFuncs;
-
-#define GC_SCREEN register ScrnInfoPtr pScrn \
- = xf86Screens[pGC->pScreen->myNum]
-
-#define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum])
-#define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum])
-
-typedef struct _RACScreen {
- CreateGCProcPtr CreateGC;
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- BSFuncRec BackingStoreFuncs;
- CreatePixmapProcPtr CreatePixmap;
- SaveScreenProcPtr SaveScreen;
- /* Colormap */
- StoreColorsProcPtr StoreColors;
- /* Cursor */
- DisplayCursorProcPtr DisplayCursor;
- RealizeCursorProcPtr RealizeCursor;
- UnrealizeCursorProcPtr UnrealizeCursor;
- RecolorCursorProcPtr RecolorCursor;
- SetCursorPositionProcPtr SetCursorPosition;
- void (*AdjustFrame)(int,int,int,int);
- Bool (*SwitchMode)(int, DisplayModePtr,int);
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- void (*FreeScreen)(int, int);
- miPointerSpriteFuncPtr miSprite;
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
- CompositeRectsProcPtr CompositeRects;
-#endif
-} RACScreenRec, *RACScreenPtr;
-
-typedef struct _RACGC {
- GCOps *wrapOps;
- GCFuncs *wrapFuncs;
-} RACGCRec, *RACGCPtr;
-
-/* Screen funcs */
-static Bool RACCloseScreen (int i, ScreenPtr pScreen);
-static void RACGetImage (DrawablePtr pDrawable, int sx, int sy,
- int w, int h, unsigned int format,
- unsigned long planemask, char *pdstLine);
-static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
- int *pwidth, int nspans, char *pdstStart);
-static void RACSourceValidate (DrawablePtr pDrawable,
- int x, int y, int width, int height );
-static void RACPaintWindowBackground(WindowPtr pWin, RegionPtr prgn, int what);
-static void RACPaintWindowBorder(WindowPtr pWin, RegionPtr prgn, int what);
-static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc );
-static void RACClearToBackground (WindowPtr pWin, int x, int y,
- int w, int h, Bool generateExposures );
-static void RACSaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
- int xorg, int yorg, WindowPtr pWin);
-static void RACRestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
- int xorg, int yorg, WindowPtr pWin);
-static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
-static Bool RACCreateGC(GCPtr pGC);
-static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
-static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
-static void RACRecolorCursor (ScreenPtr pScreen, CursorPtr pCurs,
- Bool displayed);
-static Bool RACRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
-static Bool RACUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
-static Bool RACDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor);
-static Bool RACSetCursorPosition (ScreenPtr pScreen, int x, int y,
- Bool generateEvent);
-static void RACAdjustFrame(int index, int x, int y, int flags);
-static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags);
-static Bool RACEnterVT(int index, int flags);
-static void RACLeaveVT(int index, int flags);
-static void RACFreeScreen(int index, int flags);
-/* GC funcs */
-static void RACValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-static void RACChangeGC(GCPtr pGC, unsigned long mask);
-static void RACCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void RACDestroyGC(GCPtr pGC);
-static void RACChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void RACDestroyClip(GCPtr pGC);
-static void RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-/* GC ops */
-static void RACFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
- DDXPointPtr pptInit, int *pwidthInit, int fSorted );
-static void RACSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
- register DDXPointPtr ppt, int *pwidth, int nspans,
- int fSorted );
-static void RACPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad,
- int format, char *pImage );
-static RegionPtr RACCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
- GC *pGC, int srcx, int srcy,
- int width, int height,
- int dstx, int dsty );
-static RegionPtr RACCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy,
- int width, int height, int dstx, int dsty,
- unsigned long bitPlane );
-static void RACPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode,
- int npt, xPoint *pptInit );
-static void RACPolylines(DrawablePtr pDraw, GCPtr pGC, int mode,
- int npt, DDXPointPtr pptInit );
-static void RACPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
- xSegment *pSeg );
-static void RACPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit,
- xRectangle *pRectsInit );
-static void RACPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs );
-static void RACFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode,
- int count, DDXPointPtr ptsIn );
-static void RACPolyFillRect( DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit );
-static void RACPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs );
-static int RACPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars );
-static int RACPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars );
-static void RACImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars );
-static void RACImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars );
-static void RACImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase );
-static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase );
-static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg );
-/* miSpriteFuncs */
-static Bool RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
-static Bool RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
-static void RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur,
- int x, int y);
-static void RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
-#ifdef RENDER
-static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, INT16 xSrc, INT16 ySrc,
- INT16 xMask, INT16 yMask, INT16 xDst,
- INT16 yDst, CARD16 width, CARD16 height);
-static void RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
- int nlist, GlyphListPtr list, GlyphPtr *glyphs);
-static void RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
- int nRect, xRectangle *rects);
-#endif
-
-GCFuncs RACGCFuncs = {
- RACValidateGC, RACChangeGC, RACCopyGC, RACDestroyGC,
- RACChangeClip, RACDestroyClip, RACCopyClip
-};
-
-GCOps RACGCOps = {
- RACFillSpans, RACSetSpans, RACPutImage, RACCopyArea,
- RACCopyPlane, RACPolyPoint, RACPolylines, RACPolySegment,
- RACPolyRectangle, RACPolyArc, RACFillPolygon, RACPolyFillRect,
- RACPolyFillArc, RACPolyText8, RACPolyText16, RACImageText8,
- RACImageText16, RACImageGlyphBlt, RACPolyGlyphBlt, RACPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
-miPointerSpriteFuncRec RACSpriteFuncs = {
- RACSpriteRealizeCursor, RACSpriteUnrealizeCursor, RACSpriteSetCursor,
- RACSpriteMoveCursor
-};
-
-int RACScreenIndex = -1;
-int RACGCIndex = -1;
-static unsigned long RACGeneration = 0;
-
-
-Bool
-xf86RACInit(ScreenPtr pScreen, unsigned int flag)
-{
- ScrnInfoPtr pScrn;
- RACScreenPtr pScreenPriv;
- miPointerScreenPtr PointPriv;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- pScrn = xf86Screens[pScreen->myNum];
- PointPriv = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- DPRINT_S("RACInit",pScreen->myNum);
- if (RACGeneration != serverGeneration) {
- if ( ((RACScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((RACGCIndex = AllocateGCPrivateIndex()) < 0))
- return FALSE;
-
- RACGeneration = serverGeneration;
- }
-
- if (!AllocateGCPrivate(pScreen, RACGCIndex, sizeof(RACGCRec)))
- return FALSE;
-
- if (!(pScreenPriv = xalloc(sizeof(RACScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[RACScreenIndex].ptr = (pointer)pScreenPriv;
-
- WRAP_SCREEN(CloseScreen, RACCloseScreen);
- WRAP_SCREEN(SaveScreen, RACSaveScreen);
- WRAP_SCREEN_COND(CreateGC, RACCreateGC, RAC_FB);
- WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB);
- WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB);
- WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB);
- WRAP_SCREEN_COND(PaintWindowBackground, RACPaintWindowBackground, RAC_FB);
- WRAP_SCREEN_COND(PaintWindowBorder, RACPaintWindowBorder, RAC_FB);
- WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB);
- WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB);
- WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB);
- WRAP_SCREEN_COND(BackingStoreFuncs.RestoreAreas, RACRestoreAreas, RAC_FB);
- WRAP_SCREEN_COND(BackingStoreFuncs.SaveAreas, RACSaveAreas, RAC_FB);
- WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP);
- WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR);
- WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR);
- WRAP_SCREEN_COND(UnrealizeCursor, RACUnrealizeCursor, RAC_CURSOR);
- WRAP_SCREEN_COND(RecolorCursor, RACRecolorCursor, RAC_CURSOR);
- WRAP_SCREEN_COND(SetCursorPosition, RACSetCursorPosition, RAC_CURSOR);
-#ifdef RENDER
- WRAP_PICT_COND(Composite,RACComposite,RAC_FB);
- WRAP_PICT_COND(Glyphs,RACGlyphs,RAC_FB);
- WRAP_PICT_COND(CompositeRects,RACCompositeRects,RAC_FB);
-#endif
- WRAP_SCREEN_INFO_COND(AdjustFrame, RACAdjustFrame, RAC_VIEWPORT);
- WRAP_SCREEN_INFO(SwitchMode, RACSwitchMode);
- WRAP_SCREEN_INFO(EnterVT, RACEnterVT);
- WRAP_SCREEN_INFO(LeaveVT, RACLeaveVT);
- WRAP_SCREEN_INFO(FreeScreen, RACFreeScreen);
- WRAP_SPRITE_COND(RAC_CURSOR);
-
- return TRUE;
-}
-
-/* Screen funcs */
-static Bool
-RACCloseScreen (int i, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
- miPointerScreenPtr PointPriv
- = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- DPRINT_S("RACCloseScreen",pScreen->myNum);
- UNWRAP_SCREEN(CreateGC);
- UNWRAP_SCREEN(CloseScreen);
- UNWRAP_SCREEN(GetImage);
- UNWRAP_SCREEN(GetSpans);
- UNWRAP_SCREEN(SourceValidate);
- UNWRAP_SCREEN(PaintWindowBackground);
- UNWRAP_SCREEN(PaintWindowBorder);
- UNWRAP_SCREEN(CopyWindow);
- UNWRAP_SCREEN(ClearToBackground);
- UNWRAP_SCREEN(BackingStoreFuncs.RestoreAreas);
- UNWRAP_SCREEN(BackingStoreFuncs.SaveAreas);
- UNWRAP_SCREEN(SaveScreen);
- UNWRAP_SCREEN(StoreColors);
- UNWRAP_SCREEN(DisplayCursor);
- UNWRAP_SCREEN(RealizeCursor);
- UNWRAP_SCREEN(UnrealizeCursor);
- UNWRAP_SCREEN(RecolorCursor);
- UNWRAP_SCREEN(SetCursorPosition);
-#ifdef RENDER
- UNWRAP_PICT(Composite);
- UNWRAP_PICT(Glyphs);
- UNWRAP_PICT(CompositeRects);
-#endif
- UNWRAP_SCREEN_INFO(AdjustFrame);
- UNWRAP_SCREEN_INFO(SwitchMode);
- UNWRAP_SCREEN_INFO(EnterVT);
- UNWRAP_SCREEN_INFO(LeaveVT);
- UNWRAP_SCREEN_INFO(FreeScreen);
- UNWRAP_SPRITE;
-
- xfree ((pointer) pScreenPriv);
-
- if (xf86Screens[pScreen->myNum]->vtSema) {
- xf86EnterServerState(SETUP);
- ENABLE;
- }
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void
-RACGetImage (
- DrawablePtr pDrawable,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planemask,
- char *pdstLine
- )
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- DPRINT_S("RACGetImage",pScreen->myNum);
- SCREEN_PROLOG(GetImage);
- if (xf86Screens[pScreen->myNum]->vtSema) {
- ENABLE;
- }
- (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
- format, planemask, pdstLine);
- SCREEN_EPILOG (GetImage, RACGetImage);
-}
-
-static void
-RACGetSpans (
- DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pdstStart
- )
-{
- ScreenPtr pScreen = pDrawable->pScreen;
-
- DPRINT_S("RACGetSpans",pScreen->myNum);
- SCREEN_PROLOG (GetSpans);
- ENABLE;
- (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- SCREEN_EPILOG (GetSpans, RACGetSpans);
-}
-
-static void
-RACSourceValidate (
- DrawablePtr pDrawable,
- int x, int y, int width, int height )
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- DPRINT_S("RACSourceValidate",pScreen->myNum);
- SCREEN_PROLOG (SourceValidate);
- ENABLE;
- if (pScreen->SourceValidate)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height);
- SCREEN_EPILOG (SourceValidate, RACSourceValidate);
-}
-
-static void
-RACPaintWindowBackground(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
- )
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- DPRINT_S("RACPaintWindowBackground",pScreen->myNum);
- SCREEN_PROLOG (PaintWindowBackground);
- ENABLE;
- (*pScreen->PaintWindowBackground) (pWin, prgn, what);
- SCREEN_EPILOG (PaintWindowBackground, RACPaintWindowBackground);
-}
-
-static void
-RACPaintWindowBorder(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- DPRINT_S("RACPaintWindowBorder",pScreen->myNum);
- SCREEN_PROLOG (PaintWindowBorder);
- ENABLE;
- (*pScreen->PaintWindowBorder) (pWin, prgn, what);
- SCREEN_EPILOG (PaintWindowBorder, RACPaintWindowBorder);
-}
-
-static void
-RACCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc )
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- DPRINT_S("RACCopyWindow",pScreen->myNum);
- SCREEN_PROLOG (CopyWindow);
- ENABLE;
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- SCREEN_EPILOG (CopyWindow, RACCopyWindow);
-}
-
-static void
-RACClearToBackground (
- WindowPtr pWin,
- int x, int y,
- int w, int h,
- Bool generateExposures )
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- DPRINT_S("RACClearToBackground",pScreen->myNum);
- SCREEN_PROLOG ( ClearToBackground);
- ENABLE;
- (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
- SCREEN_EPILOG (ClearToBackground, RACClearToBackground);
-}
-
-static void
-RACSaveAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
- )
-{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- DPRINT_S("RACSaveAreas",pScreen->myNum);
- SCREEN_PROLOG (BackingStoreFuncs.SaveAreas);
- ENABLE;
- (*pScreen->BackingStoreFuncs.SaveAreas) (
- pPixmap, prgnSave, xorg, yorg, pWin);
-
- SCREEN_EPILOG (BackingStoreFuncs.SaveAreas, RACSaveAreas);
-}
-
-static void
-RACRestoreAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
- )
-{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
-
- DPRINT_S("RACRestoreAreas",pScreen->myNum);
- SCREEN_PROLOG (BackingStoreFuncs.RestoreAreas);
- ENABLE;
- (*pScreen->BackingStoreFuncs.RestoreAreas) (
- pPixmap, prgnRestore, xorg, yorg, pWin);
-
- SCREEN_EPILOG ( BackingStoreFuncs.RestoreAreas, RACRestoreAreas);
-}
-
-static PixmapPtr
-RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
-{
- PixmapPtr pPix;
-
- DPRINT_S("RACCreatePixmap",pScreen->myNum);
- SCREEN_PROLOG ( CreatePixmap);
- ENABLE;
- pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
- SCREEN_EPILOG (CreatePixmap, RACCreatePixmap);
-
- return pPix;
-}
-
-static Bool
-RACSaveScreen(ScreenPtr pScreen, Bool unblank)
-{
- Bool val;
-
- DPRINT_S("RACSaveScreen",pScreen->myNum);
- SCREEN_PROLOG (SaveScreen);
- ENABLE;
- val = (*pScreen->SaveScreen) (pScreen, unblank);
- SCREEN_EPILOG (SaveScreen, RACSaveScreen);
-
- return val;
-}
-
-static void
-RACStoreColors (
- ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pmap->pScreen;
-
- DPRINT_S("RACStoreColors",pScreen->myNum);
- SCREEN_PROLOG (StoreColors);
- ENABLE;
- (*pScreen->StoreColors) (pmap,ndef,pdefs);
-
- SCREEN_EPILOG ( StoreColors, RACStoreColors);
-}
-
-static void
-RACRecolorCursor (
- ScreenPtr pScreen,
- CursorPtr pCurs,
- Bool displayed
- )
-{
- DPRINT_S("RACRecolorCursor",pScreen->myNum);
- SCREEN_PROLOG (RecolorCursor);
- ENABLE;
- (*pScreen->RecolorCursor) (pScreen,pCurs,displayed);
-
- SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor);
-}
-
-static Bool
-RACRealizeCursor (
- ScreenPtr pScreen,
- CursorPtr pCursor
- )
-{
- Bool val;
-
- DPRINT_S("RACRealizeCursor",pScreen->myNum);
- SCREEN_PROLOG (RealizeCursor);
- ENABLE;
- val = (*pScreen->RealizeCursor) (pScreen,pCursor);
-
- SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor);
- return val;
-}
-
-static Bool
-RACUnrealizeCursor (
- ScreenPtr pScreen,
- CursorPtr pCursor
- )
-{
- Bool val;
-
- DPRINT_S("RACUnrealizeCursor",pScreen->myNum);
- SCREEN_PROLOG (UnrealizeCursor);
- ENABLE;
- val = (*pScreen->UnrealizeCursor) (pScreen,pCursor);
-
- SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor);
- return val;
-}
-
-static Bool
-RACDisplayCursor (
- ScreenPtr pScreen,
- CursorPtr pCursor
- )
-{
- Bool val;
-
- DPRINT_S("RACDisplayCursor",pScreen->myNum);
- SCREEN_PROLOG (DisplayCursor);
- ENABLE;
- val = (*pScreen->DisplayCursor) (pScreen,pCursor);
-
- SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor);
- return val;
-}
-
-static Bool
-RACSetCursorPosition (
- ScreenPtr pScreen,
- int x, int y,
- Bool generateEvent)
-{
- Bool val;
-
- DPRINT_S("RACSetCursorPosition",pScreen->myNum);
- SCREEN_PROLOG (SetCursorPosition);
- ENABLE;
- val = (*pScreen->SetCursorPosition) (pScreen,x,y,generateEvent);
-
- SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition);
- return val;
-}
-
-static void
-RACAdjustFrame(int index, int x, int y, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
-
- DPRINT_S("RACAdjustFrame",index);
- xf86EnableAccess(xf86Screens[index]);
-
- (*pScreenPriv->AdjustFrame)(index, x, y, flags);
-}
-
-static Bool
-RACSwitchMode(int index, DisplayModePtr mode, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
-
- DPRINT_S("RACSwitchMode",index);
- xf86EnableAccess(xf86Screens[index]);
-
- return (*pScreenPriv->SwitchMode)(index, mode, flags);
-}
-
-static Bool
-RACEnterVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
-
- DPRINT_S("RACEnterVT",index);
- xf86EnableAccess(xf86Screens[index]);
-
- return (*pScreenPriv->EnterVT)(index, flags);
-}
-
-static void
-RACLeaveVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
-
- DPRINT_S("RACLeaveVT",index);
- xf86EnableAccess(xf86Screens[index]);
-
- (*pScreenPriv->LeaveVT)(index, flags);
-}
-
-static void
-RACFreeScreen(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- RACScreenPtr pScreenPriv =
- (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
-
- DPRINT_S("RACFreeScreen",index);
- xf86EnableAccess(xf86Screens[index]);
-
- (*pScreenPriv->FreeScreen)(index, flags);
-}
-
-static Bool
-RACCreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- RACGCPtr pGCPriv = (RACGCPtr) (pGC)->devPrivates[RACGCIndex].ptr;
- Bool ret;
-
- DPRINT_S("RACCreateGC",pScreen->myNum);
- SCREEN_PROLOG(CreateGC);
-
- ret = (*pScreen->CreateGC)(pGC);
-
- GC_WRAP(pGC);
- SCREEN_EPILOG(CreateGC,RACCreateGC);
-
- return ret;
-}
-
-/* GC funcs */
-static void
-RACValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACValidateGC");
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
- GC_WRAP(pGC);
-}
-
-
-static void
-RACDestroyGC(GCPtr pGC)
-{
- GC_UNWRAP (pGC);
- DPRINT("RACDestroyGC");
- (*pGC->funcs->DestroyGC)(pGC);
- GC_WRAP (pGC);
-}
-
-static void
-RACChangeGC (
- GCPtr pGC,
- unsigned long mask)
-{
- GC_UNWRAP (pGC);
- DPRINT("RACChangeGC");
- (*pGC->funcs->ChangeGC) (pGC, mask);
- GC_WRAP (pGC);
-}
-
-static void
-RACCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst)
-{
- GC_UNWRAP (pGCDst);
- DPRINT("RACCopyGC");
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- GC_WRAP (pGCDst);
-}
-
-static void
-RACChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects )
-{
- GC_UNWRAP (pGC);
- DPRINT("RACChangeClip");
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- GC_WRAP (pGC);
-}
-
-static void
-RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- GC_UNWRAP (pgcDst);
- DPRINT("RACCopyClip");
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- GC_WRAP (pgcDst);
-}
-
-static void
-RACDestroyClip(GCPtr pGC)
-{
- GC_UNWRAP (pGC);
- DPRINT("RACDestroyClip");
- (* pGC->funcs->DestroyClip)(pGC);
- GC_WRAP (pGC);
-}
-
-/* GC Ops */
-static void
-RACFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACFillSpans");
- ENABLE_GC;
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- GC_WRAP(pGC);
-}
-
-static void
-RACSetSpans(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACSetSpans");
- ENABLE_GC;
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- GC_WRAP(pGC);
-}
-
-static void
-RACPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPutImage");
- ENABLE_GC;
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- GC_WRAP(pGC);
-}
-
-static RegionPtr
-RACCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty )
-{
- RegionPtr ret;
-
- GC_UNWRAP(pGC);
- DPRINT("RACCopyArea");
- ENABLE_GC;
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- GC_WRAP(pGC);
- return ret;
-}
-
-static RegionPtr
-RACCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane )
-{
- RegionPtr ret;
-
- GC_UNWRAP(pGC);
- DPRINT("RACCopyPlane");
- ENABLE_GC;
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
- width, height, dstx, dsty, bitPlane);
- GC_WRAP(pGC);
- return ret;
-}
-
-static void
-RACPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyPoint");
- ENABLE_GC;
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- GC_WRAP(pGC);
-}
-
-
-static void
-RACPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolylines");
- ENABLE_GC;
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- GC_WRAP(pGC);
-}
-
-static void
-RACPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolySegment");
- ENABLE_GC;
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- GC_WRAP(pGC);
-}
-
-static void
-RACPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyRectangle");
- ENABLE_GC;
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- GC_WRAP(pGC);
-}
-
-static void
-RACPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyArc");
- ENABLE_GC;
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- GC_WRAP(pGC);
-}
-
-static void
-RACFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACFillPolygon");
- ENABLE_GC;
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- GC_WRAP(pGC);
-}
-
-
-static void
-RACPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyFillRect");
- ENABLE_GC;
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- GC_WRAP(pGC);
-}
-
-
-static void
-RACPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyFillArc");
- ENABLE_GC;
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- GC_WRAP(pGC);
-}
-
-static int
-RACPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars )
-{
- int ret;
-
- GC_UNWRAP(pGC);
- DPRINT("RACPolyText8");
- ENABLE_GC;
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- GC_WRAP(pGC);
- return ret;
-}
-
-static int
-RACPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars )
-{
- int ret;
-
- GC_UNWRAP(pGC);
- DPRINT("RACPolyText16");
- ENABLE_GC;
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- GC_WRAP(pGC);
- return ret;
-}
-
-static void
-RACImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACImageText8");
- ENABLE_GC;
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- GC_WRAP(pGC);
-}
-
-static void
-RACImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACImageText16");
- ENABLE_GC;
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- GC_WRAP(pGC);
-}
-
-
-static void
-RACImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACImageGlyphBlt");
- ENABLE_GC;
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
- nglyph, ppci, pglyphBase);
- GC_WRAP(pGC);
-}
-
-static void
-RACPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPolyGlyphBlt");
- ENABLE_GC;
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
- nglyph, ppci, pglyphBase);
- GC_WRAP(pGC);
-}
-
-static void
-RACPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg )
-{
- GC_UNWRAP(pGC);
- DPRINT("RACPushPixels");
- ENABLE_GC;
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- GC_WRAP(pGC);
-}
-
-
-/* miSpriteFuncs */
-static Bool
-RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
-{
- Bool val;
- SPRITE_PROLOG;
- DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum);
- ENABLE;
- val = PointPriv->spriteFuncs->RealizeCursor(pScreen, pCur);
- SPRITE_EPILOG;
- return val;
-}
-
-static Bool
-RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
-{
- Bool val;
- SPRITE_PROLOG;
- DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum);
- ENABLE;
- val = PointPriv->spriteFuncs->UnrealizeCursor(pScreen, pCur);
- SPRITE_EPILOG;
- return val;
-}
-
-static void
-RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur, int x, int y)
-{
- SPRITE_PROLOG;
- DPRINT_S("RACSpriteSetCursor",pScreen->myNum);
- ENABLE;
- PointPriv->spriteFuncs->SetCursor(pScreen, pCur, x, y);
- SPRITE_EPILOG;
-}
-
-static void
-RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y)
-{
- SPRITE_PROLOG;
- DPRINT_S("RACSpriteMoveCursor",pScreen->myNum);
- ENABLE;
- PointPriv->spriteFuncs->MoveCursor(pScreen, x, y);
- SPRITE_EPILOG;
-}
-
-#ifdef RENDER
-static void
-RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
- INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width,
- CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- PICTURE_PROLOGUE(Composite);
-
- ENABLE;
- (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
- yDst, width, height);
-
- PICTURE_EPILOGUE(Composite, RACComposite);
-}
-
-static void
-RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
- GlyphListPtr list, GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- PICTURE_PROLOGUE(Glyphs);
-
- ENABLE;
- (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
-
- PICTURE_EPILOGUE (Glyphs, RACGlyphs);
-}
-
-static void
-RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect,
- xRectangle *rects)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- PICTURE_PROLOGUE(CompositeRects);
-
- ENABLE;
- (*ps->CompositeRects)(op, pDst, color, nRect, rects);
-
- PICTURE_EPILOGUE (CompositeRects, RACCompositeRects);
-}
-#endif
-
diff --git a/hw/xfree86/rac/xf86RAC.h b/hw/xfree86/rac/xf86RAC.h
deleted file mode 100644
index c704bd75e..000000000
--- a/hw/xfree86/rac/xf86RAC.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RAC.h,v 1.3 1999/06/12 07:19:05 dawes Exp $ */
-
-#ifndef __XF86RAC_H
-#define __XF86RAC_H 1
-
-#include "screenint.h"
-#include "misc.h"
-#include "xf86.h"
-
-Bool xf86RACInit(ScreenPtr pScreen, unsigned int flag);
-
-/* flags */
-#define RAC_FB 0x01
-#define RAC_CURSOR 0x02
-#define RAC_COLORMAP 0x04
-#define RAC_VIEWPORT 0x08
-
-#endif /* __XF86RAC_H */
diff --git a/hw/xfree86/rac/xf86RACmodule.c b/hw/xfree86/rac/xf86RACmodule.c
deleted file mode 100644
index f0a960a66..000000000
--- a/hw/xfree86/rac/xf86RACmodule.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RACmodule.c,v 1.4 1999/01/26 05:54:14 dawes Exp $ */
-
-#include "xf86Module.h"
-
-static XF86ModuleVersionInfo racVersRec =
-{
- "rac",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-
-XF86ModuleData racModuleData = { &racVersRec, NULL, NULL };
-
diff --git a/hw/xfree86/ramdac/BT.c b/hw/xfree86/ramdac/BT.c
deleted file mode 100644
index 3b42ecb13..000000000
--- a/hw/xfree86/ramdac/BT.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * BT RAMDAC routines.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#define INIT_BT_RAMDAC_INFO
-#include "BTPriv.h"
-#include "xf86RamDacPriv.h"
-
-void
-BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i;
-
- /* Here we pass a short, so that we can evaluate a mask too */
- /* So that the mask is the high byte and the data the low byte */
- /* Just the command/status registers */
- for (i=0x06;i<0x0A;i++)
- (*ramdacPtr->WriteDAC)
- (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8,
- ramdacReg->DacRegs[i]);
-}
-
-void
-BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i;
-
- (*ramdacPtr->ReadAddress)(pScrn, 0); /* Start at index 0 */
- for (i=0;i<768;i++)
- ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
-
- /* Just the command/status registers */
- for (i=0x06;i<0x0A;i++)
- ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC)(pScrn, i);
-}
-
-RamDacHelperRecPtr
-BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/*, RamDacRecPtr ramdacPtr*/)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- Bool RamDacIsSupported = FALSE;
- RamDacHelperRecPtr ramdacHelperPtr = NULL;
- int BTramdac_ID = -1;
- int i, status, cmd0;
-
- /* Save COMMAND Register 0 */
- cmd0 = (*ramdacPtr->ReadDAC)(pScrn, BT_COMMAND_REG_0);
- /* Ensure were going to access the STATUS Register on next read */
- (*ramdacPtr->WriteDAC)(pScrn, BT_COMMAND_REG_0, 0x7F, 0x00);
-
- status = (*ramdacPtr->ReadDAC)(pScrn, BT_STATUS_REG);
- switch (status) {
- case 0x40:
- BTramdac_ID = ATT20C504_RAMDAC;
- break;
- case 0xD0:
- BTramdac_ID = ATT20C505_RAMDAC;
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Unknown BT RAMDAC type (0x%x), assuming BT485\n",
- status);
- case 0x80:
- case 0x90:
- case 0xA0:
- case 0xB0:
- case 0x28: /* This is for the DEC TGA - Questionable ? */
- BTramdac_ID = BT485_RAMDAC;
- break;
- }
-
- /* Restore COMMAND Register 0 */
- (*ramdacPtr->WriteDAC)(pScrn, BT_COMMAND_REG_0, 0x00, cmd0);
-
- if (BTramdac_ID == -1) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Cannot determine BT RAMDAC type, aborting\n");
- return NULL;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF].DeviceName);
- }
-
- for (i=0;ramdacs[i].token != -1;i++) {
- if (ramdacs[i].token == BTramdac_ID)
- RamDacIsSupported = TRUE;
- }
-
- if (!RamDacIsSupported) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "This BT RAMDAC is NOT supported by this driver, aborting\n");
- return NULL;
- }
-
- ramdacHelperPtr = RamDacHelperCreateInfoRec();
- switch(BTramdac_ID) {
- case BT485_RAMDAC:
- ramdacHelperPtr->SetBpp = BTramdacSetBpp;
- break;
- }
- ramdacPtr->RamDacType = BTramdac_ID;
- ramdacHelperPtr->RamDacType = BTramdac_ID;
- ramdacHelperPtr->Save = BTramdacSave;
- ramdacHelperPtr->Restore = BTramdacRestore;
-
- return ramdacHelperPtr;
-}
-
-void
-BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
-{
- /* We need to deal with Direct Colour visuals for 8bpp and other
- * good stuff for colours */
- switch (pScrn->bitsPerPixel) {
- case 32:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10;
- break;
- case 24:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10;
- break;
- case 16:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x38;
- break;
- case 15:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x30;
- break;
- case 8:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x40;
- break;
- case 4:
- ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x60;
- break;
- }
-}
diff --git a/hw/xfree86/ramdac/BT.h b/hw/xfree86/ramdac/BT.h
deleted file mode 100644
index ea1180285..000000000
--- a/hw/xfree86/ramdac/BT.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.h,v 1.3 1998/08/20 08:56:03 dawes Exp $ */
-
-#include "xf86RamDac.h"
-
-RamDacHelperRecPtr BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
-void BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
-
-#define ATT20C504_RAMDAC (VENDOR_BT << 16) | 0x00
-#define ATT20C505_RAMDAC (VENDOR_BT << 16) | 0x01
-#define BT485_RAMDAC (VENDOR_BT << 16) | 0x02
-
-/*
- * BT registers
- */
-
-#define BT_WRITE_ADDR 0x00
-#define BT_RAMDAC_DATA 0x01
-#define BT_PIXEL_MASK 0x02
-#define BT_READ_ADDR 0x03
-#define BT_CURS_WR_ADDR 0x04
-#define BT_CURS_DATA 0x05
-#define BT_COMMAND_REG_0 0x06
-#define BT_CURS_RD_ADDR 0x07
-#define BT_COMMAND_REG_1 0x08
-#define BT_COMMAND_REG_2 0x09
-#define BT_STATUS_REG 0x0A
-#define BT_CURS_RAM_DATA 0x0B
-#define BT_CURS_X_LOW 0x0C
-#define BT_CURS_X_HIGH 0x0D
-#define BT_CURS_Y_LOW 0x0E
-#define BT_CURS_Y_HIGH 0x0F
diff --git a/hw/xfree86/ramdac/BTPriv.h b/hw/xfree86/ramdac/BTPriv.h
deleted file mode 100644
index bea623b78..000000000
--- a/hw/xfree86/ramdac/BTPriv.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BTPriv.h,v 1.2 1998/07/25 16:57:18 dawes Exp $ */
-
-#include "BT.h"
-
-typedef struct {
- char *DeviceName;
-} xf86BTramdacInfo;
-
-extern xf86BTramdacInfo BTramdacDeviceInfo[];
-
-#ifdef INIT_BT_RAMDAC_INFO
-xf86BTramdacInfo BTramdacDeviceInfo[] = {
- {"AT&T 20C504"},
- {"AT&T 20C505"},
- {"BT485/484"}
-};
-#endif
diff --git a/hw/xfree86/ramdac/CURSOR.NOTES b/hw/xfree86/ramdac/CURSOR.NOTES
deleted file mode 100644
index 3e901e380..000000000
--- a/hw/xfree86/ramdac/CURSOR.NOTES
+++ /dev/null
@@ -1,191 +0,0 @@
- CURSOR.NOTES
-
- This file describes how to add hardware cursor support to a chipset
-driver. Though the cursor support itself is in the ramdac module,
-cursor management is separate from the rest of the module.
-
-
-1) CURSOR INITIALIZATION AND SHUTDOWN
-
- All relevant prototypes and defines are in xf86Cursor.h.
-
- To initialize the cursor, the driver should allocate an
-xf86CursorInfoRec via xf86CreateCursorInfoRec(), fill it out as described
-later in this document and pass it to xf86InitCursor(). xf86InitCursor()
-must be called _after_ the software cursor initialization (usually
-miDCInitialize).
-
- When shutting down, the driver should free the xf86CursorInfoRec
-structure in its CloseScreen function via xf86DestroyCursorInfoRec().
-
-
-2) FILLING OUT THE xf86CursorInfoRec
-
- The driver informs the ramdac module of it's hardware cursor capablities by
-filling out an xf86CursorInfoRec structure and passing it to xf86InitCursor().
-The xf86CursorInfoRec contains the following function pointers:
-
-
-/**** These functions are required ****/
-
-void ShowCursor(ScrnInfoPtr pScrn)
-
- ShowCursor should display the current cursor.
-
-void HideCursor(ScrnInfoPtr pScrn)
-
- HideCursor should hide the current cursor.
-
-void SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
-
- Set the cursor position to (x,y). X and/or y may be negative
- indicating that the cursor image is partially offscreen on
- the left and/or top edges of the screen. It is up to the
- driver to trap for this and deal with that situation.
-
-void SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
-
- Set the cursor foreground and background colors. In 8bpp, fg and
- bg are indicies into the current colormap unless the
- HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case
- and in all other bpps the fg and bg are in 8-8-8 RGB format.
-
-void LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits)
-
- LoadCursorImage is how the hardware cursor bits computed by the
- RealizeCursor function will be passed to the driver when the cursor
- shape needs to be changed.
-
-
-/**** These functions are optional ****/
-
-
-unsigned char* RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-
- If RealizeCursor is not provided by the driver, one will be provided
- for you based on the Flags field described below. The driver must
- provide this function if the hardware cursor format is not one of
- the common ones supported by this module.
-
-
-Bool UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
-
- If the driver is unable to use a hardware cursor for reasons
- other than the cursor being larger than the maximum specified
- in the MaxWidth or MaxHeight field below, it can supply the
- UseHWCursor function. If UseHWCursor is provided by the driver,
- it will be called whenever the cursor shape changes or the video
- mode changes. This is useful for when the hardware cursor cannot
- be used in interlaced or doublescan modes.
-
-
-/**** The following fields are required ****/
-
-MaxWidth
-MaxHeight
-
- These indicate the largest sized cursor that can be a hardware
- cursor. It will fall back to a software cursor when a cursor
- exceeding this size needs to be used.
-
-
-Flags
-
- /* Color related flags */
-
- HARDWARE_CURSOR_TRUECOLOR_AT_8BPP
-
- This indicates that the colors passed to the SetCursorColors
- function should not be in 8-8-8 RGB format in 8bpp but rather,
- they should be the pixel values from the current colormap.
-
-
- /* Cursor data loading flags */
-
- HARDWARE_CURSOR_SHOW_TRANSPARENT
-
- The HideCursor entry will normally be called instead of displaying a
- completely transparent cursor, or when a switch to a software cursor
- needs to occur. This flag prevents this behaviour, thus causing the
- LoadCursorImage entry to be called with transparent cursor data.
- NOTE: If you use this flag and provide your own RealizeCursor() entry,
- ensure this entry returns transparent cursor data when called
- with a NULL pCurs parameter.
-
- HARDWARE_CURSOR_UPDATE_UNHIDDEN
-
- This flag prevents the HideCursor call that would normally occur just before
- the LoadCursorImage entry is to be called to load a new hardware cursor
- image.
-
-
- /* Cursor data packing flags */
-
- Hardware cursor data consists of two pieces, a source and a mask.
- The mask is a bitmap indicating which parts of the cursor are
- transparent and which parts are drawn. The source is a bitmap
- indicating which parts of the non-transparent portion of the the
- cursor should be painted in the foreground color and which should
- be painted in the background color.
-
- HARDWARE_CURSOR_INVERT_MASK
-
- By default, set bits indicate the opaque part of the mask bitmap
- and clear bits indicate the transparent part. If your hardware
- wants this the opposite way, this flag will invert the mask.
-
- HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK
-
- By default, RealizeCursor will store the source first and then
- the mask. If the hardware needs this order reversed then this
- flag should be set.
-
- HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
-
- This flag will have the module logical AND the source with the mask to make
- sure there are no source bits set if the corresponding mask bits
- aren't set. Some hardware will not care if source bits are set where
- there are supposed to be transparent areas, but some hardware will
- interpret this as a third cursor color or similar. That type of
- hardware will need this flag set.
-
- HARDWARE_CURSOR_BIT_ORDER_MSBFIRST
-
- By default, it is assumed that the least significant bit in each byte
- corresponds to the leftmost pixel on the screen. If your hardware
- has this reversed you should set this flag.
-
- HARDWARE_CURSOR_NIBBLE_SWAPPED
-
- If your hardware requires byte swapping of the hardware cursor, enable
- this option.
-
-
- /* Source-Mask interleaving flags */
-
- By default the source and mask data are inlined (source first unless
- the HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK flag is set). Some hardware
- will require the source and mask to be interleaved, that is, X number
- of source bits should packed and then X number of mask bits repeating
- until the entire pattern is stored. The following flags describe the
- bit interleave.
-
- HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED
-
- This one is the default.
-
- The following are for interleaved cursors.
-
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64
-
- And once again, if your hardware requires something different than
- these packing styles, your driver can supply its own RealizeCursor
- function.
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.5 2003/02/13 20:28:41 tsi Exp $
diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c
deleted file mode 100644
index 34562e297..000000000
--- a/hw/xfree86/ramdac/IBM.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * IBM RAMDAC routines.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.13 2003/09/24 02:43:35 dawes Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86Cursor.h"
-
-#define INIT_IBM_RAMDAC_INFO
-#include "IBMPriv.h"
-#include "xf86RamDacPriv.h"
-
-#define INITIALFREQERR 100000
-
-unsigned long
-IBMramdac640CalculateMNPCForClock(
- unsigned long RefClock, /* In 100Hz units */
- unsigned long ReqClock, /* In 100Hz units */
- char IsPixClock, /* boolean, is this the pixel or the sys clock */
- unsigned long MinClock, /* Min VCO rating */
- unsigned long MaxClock, /* Max VCO rating */
- unsigned long *rM, /* M Out */
- unsigned long *rN, /* N Out */
- unsigned long *rP, /* Min P In, P Out */
- unsigned long *rC /* C Out */
-)
-{
- unsigned long M, N, P, iP = *rP;
- unsigned long IntRef, VCO, Clock;
- long freqErr, lowestFreqErr = INITIALFREQERR;
- unsigned long ActualClock = 0;
-
- for (N = 0; N <= 63; N++)
- {
- IntRef = RefClock / (N + 1);
- if (IntRef < 10000)
- break; /* IntRef needs to be >= 1MHz */
- for (M = 2; M <= 127; M++)
- {
- VCO = IntRef * (M + 1);
- if ((VCO < MinClock) || (VCO > MaxClock))
- continue;
- for (P = iP; P <= 4; P++)
- {
- if (P != 0)
- Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P);
- else
- Clock = (RefClock * (M + 1)) / (N + 1);
-
- freqErr = (Clock - ReqClock);
-
- if (freqErr < 0)
- {
- /* PixelClock gets rounded up always so monitor reports
- correct frequency. */
- if (IsPixClock)
- continue;
- freqErr = -freqErr;
- }
-
- if (freqErr < lowestFreqErr)
- {
- *rM = M;
- *rN = N;
- *rP = P;
- *rC = (VCO <= 1280000 ? 1 : 2);
- ActualClock = Clock;
-
- lowestFreqErr = freqErr;
- /* Return if we found an exact match */
- if (freqErr == 0)
- return (ActualClock);
- }
- }
- }
- }
-
- return (ActualClock);
-}
-
-unsigned long
-IBMramdac526CalculateMNPCForClock(
- unsigned long RefClock, /* In 100Hz units */
- unsigned long ReqClock, /* In 100Hz units */
- char IsPixClock, /* boolean, is this the pixel or the sys clock */
- unsigned long MinClock, /* Min VCO rating */
- unsigned long MaxClock, /* Max VCO rating */
- unsigned long *rM, /* M Out */
- unsigned long *rN, /* N Out */
- unsigned long *rP, /* Min P In, P Out */
- unsigned long *rC /* C Out */
-)
-{
- unsigned long M, N, P, iP = *rP;
- unsigned long IntRef, VCO, Clock;
- long freqErr, lowestFreqErr = INITIALFREQERR;
- unsigned long ActualClock = 0;
-
- for (N = 0; N <= 63; N++)
- {
- IntRef = RefClock / (N + 1);
- if (IntRef < 10000)
- break; /* IntRef needs to be >= 1MHz */
- for (M = 0; M <= 63; M++)
- {
- VCO = IntRef * (M + 1);
- if ((VCO < MinClock) || (VCO > MaxClock))
- continue;
- for (P = iP; P <= 4; P++)
- {
- if (P)
- Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P);
- else
- Clock = VCO;
-
- freqErr = (Clock - ReqClock);
-
- if (freqErr < 0)
- {
- /* PixelClock gets rounded up always so monitor reports
- correct frequency. */
- if (IsPixClock)
- continue;
- freqErr = -freqErr;
- }
-
- if (freqErr < lowestFreqErr)
- {
- *rM = M;
- *rN = N;
- *rP = P;
- *rC = (VCO <= 1280000 ? 1 : 2);
- ActualClock = Clock;
-
- lowestFreqErr = freqErr;
- /* Return if we found an exact match */
- if (freqErr == 0)
- return (ActualClock);
- }
- }
- }
- }
-
- return (ActualClock);
-}
-
-void
-IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i, maxreg, dacreg;
-
- switch (ramdacPtr->RamDacType) {
- case IBM640_RAMDAC:
- maxreg = 0x300;
- dacreg = 1024;
- break;
- default:
- maxreg = 0x100;
- dacreg = 768;
- break;
- }
-
- /* Here we pass a short, so that we can evaluate a mask too */
- /* So that the mask is the high byte and the data the low byte */
- for (i=0;i<maxreg;i++)
- (*ramdacPtr->WriteDAC)
- (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8,
- ramdacReg->DacRegs[i]);
-
- (*ramdacPtr->WriteAddress)(pScrn, 0);
- for (i=0;i<dacreg;i++)
- (*ramdacPtr->WriteData)(pScrn, ramdacReg->DAC[i]);
-}
-
-void
-IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i, maxreg, dacreg;
-
- switch (ramdacPtr->RamDacType) {
- case IBM640_RAMDAC:
- maxreg = 0x300;
- dacreg = 1024;
- break;
- default:
- maxreg = 0x100;
- dacreg = 768;
- break;
- }
-
- (*ramdacPtr->ReadAddress)(pScrn, 0);
- for (i=0;i<dacreg;i++)
- ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
-
- for (i=0;i<maxreg;i++)
- ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC)(pScrn, i);
-}
-
-RamDacHelperRecPtr
-IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/* , RamDacRecPtr ramdacPtr*/)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- RamDacHelperRecPtr ramdacHelperPtr = NULL;
- Bool RamDacIsSupported = FALSE;
- int IBMramdac_ID = -1;
- int i;
- unsigned char id, rev, id2, rev2;
-
- /* read ID and revision */
- rev = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_rev);
- id = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_id);
-
- /* check if ID and revision are read only */
- (*ramdacPtr->WriteDAC)(pScrn, ~rev, 0, IBMRGB_rev);
- (*ramdacPtr->WriteDAC)(pScrn, ~id, 0, IBMRGB_id);
- rev2 = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_rev);
- id2 = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_id);
-
- switch (id) {
- case 0x30:
- if (rev == 0xc0) IBMramdac_ID = IBM624_RAMDAC;
- if (rev == 0x80) IBMramdac_ID = IBM624DB_RAMDAC;
- break;
- case 0x12:
- if (rev == 0x1c) IBMramdac_ID = IBM640_RAMDAC;
- break;
- case 0x01:
- IBMramdac_ID = IBM525_RAMDAC;
- break;
- case 0x02:
- if (rev == 0xf0) IBMramdac_ID = IBM524_RAMDAC;
- if (rev == 0xe0) IBMramdac_ID = IBM524A_RAMDAC;
- if (rev == 0xc0) IBMramdac_ID = IBM526_RAMDAC;
- if (rev == 0x80) IBMramdac_ID = IBM526DB_RAMDAC;
- break;
- }
-
- if (id == 1 || id == 2) {
- if (id == id2 && rev == rev2) { /* IBM RGB52x found */
- /* check for 128bit VRAM -> RGB528 */
- if (((*ramdacPtr->ReadDAC)(pScrn, IBMRGB_misc1) & 0x03) == 0x03) {
- IBMramdac_ID = IBM528_RAMDAC; /* 128bit DAC found */
- if (rev == 0xe0)
- IBMramdac_ID = IBM528A_RAMDAC;
- }
- }
- }
-
- (*ramdacPtr->WriteDAC)(pScrn, rev, 0, IBMRGB_rev);
- (*ramdacPtr->WriteDAC)(pScrn, id, 0, IBMRGB_id);
-
- if (IBMramdac_ID == -1) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Cannot determine IBM RAMDAC type, aborting\n");
- return NULL;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF].DeviceName);
- }
-
- for (i=0;ramdacs[i].token != -1;i++) {
- if (ramdacs[i].token == IBMramdac_ID)
- RamDacIsSupported = TRUE;
- }
-
- if (!RamDacIsSupported) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "This IBM RAMDAC is NOT supported by this driver, aborting\n");
- return NULL;
- }
-
- ramdacHelperPtr = RamDacHelperCreateInfoRec();
- switch (IBMramdac_ID) {
- case IBM526_RAMDAC:
- case IBM526DB_RAMDAC:
- ramdacHelperPtr->SetBpp = IBMramdac526SetBpp;
- ramdacHelperPtr->HWCursorInit = IBMramdac526HWCursorInit;
- break;
- case IBM640_RAMDAC:
- ramdacHelperPtr->SetBpp = IBMramdac640SetBpp;
- ramdacHelperPtr->HWCursorInit = IBMramdac640HWCursorInit;
- break;
- }
- ramdacPtr->RamDacType = IBMramdac_ID;
- ramdacHelperPtr->RamDacType = IBMramdac_ID;
- ramdacHelperPtr->Save = IBMramdacSave;
- ramdacHelperPtr->Restore = IBMramdacRestore;
-
- return ramdacHelperPtr;
-}
-
-void
-IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
-{
- ramdacReg->DacRegs[IBMRGB_key_control] = 0x00; /* Disable Chroma Key */
-
- switch (pScrn->bitsPerPixel) {
- case 32:
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_32BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = B32_DCOL_DIRECT;
- ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
- if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
- ramdacReg->DacRegs[IBMRGB_key_control] = 0x01; /* Enable Key */
- ramdacReg->DacRegs[IBMRGB_key] = 0xFF;
- ramdacReg->DacRegs[IBMRGB_key_mask] = 0xFF;
- }
- break;
- case 24:
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_24BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_24bpp] = B24_DCOL_DIRECT;
- ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
- break;
- case 16:
- if (pScrn->depth == 16) {
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT|B16_LINEAR |
- B16_CONTIGUOUS | B16_565;
- ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
- } else {
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT|B16_LINEAR |
- B16_CONTIGUOUS | B16_555;
- ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
- }
- break;
- case 8:
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_8BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_8bpp] = B8_DCOL_INDIRECT;
- break;
- case 4:
- ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_4BPP;
- ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
- ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
- }
-}
-
-void
-IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
-{
- unsigned char bpp = 0x00;
- unsigned char overlaybpp = 0x00;
- unsigned char offset = 0x00;
- unsigned char dispcont = 0x44;
-
- ramdacReg->DacRegs[RGB640_SER_WID_03_00] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x00;
- ramdacReg->DacRegs[RGB640_DIAGS] = 0x07;
-
- switch (pScrn->depth) {
- case 8:
- ramdacReg->DacRegs[RGB640_SER_07_00] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_15_08] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_16_1; /*16:1 Mux*/
- ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
- bpp = 0x03;
- break;
- case 15:
- ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10;
- ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11;
- ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux*/
- ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
- bpp = 0x0E;
- break;
- case 16:
- ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10;
- ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11;
- ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
- ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux*/
- ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
- bpp = 0x05;
- break;
- case 24:
- ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30;
- ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31;
- ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32;
- ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33;
- ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux*/
- ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
- bpp = 0x09;
- if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
- ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x04;
- ramdacReg->DacRegs[RGB640_CHROMA_KEY0] = 0xFF;
- ramdacReg->DacRegs[RGB640_CHROMA_MASK0] = 0xFF;
- offset = 0x04;
- overlaybpp = 0x04;
- dispcont = 0x48;
- }
- break;
- case 30: /* 10 bit dac */
- ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30;
- ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31;
- ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32;
- ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33;
- ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux*/
- ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PSIZE10 |
- IBM640_PCLK_8; /* pll / 8 */
- bpp = 0x0D;
- break;
- }
-
- {
- int i;
- for (i=0x100;i<0x140;i+=4) {
- /* Initialize FrameBuffer Window Attribute Table */
- ramdacReg->DacRegs[i+0] = bpp;
- ramdacReg->DacRegs[i+1] = offset;
- ramdacReg->DacRegs[i+2] = 0x00;
- ramdacReg->DacRegs[i+3] = 0x00;
- /* Initialize Overlay Window Attribute Table */
- ramdacReg->DacRegs[i+0x100] = overlaybpp;
- ramdacReg->DacRegs[i+0x101] = 0x00;
- ramdacReg->DacRegs[i+0x102] = 0x00;
- ramdacReg->DacRegs[i+0x103] = dispcont;
- }
- }
-}
-
-static void
-IBMramdac526ShowCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Enable cursor - X11 mode */
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs, 0x00, 0x07);
-}
-
-static void
-IBMramdac640ShowCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Enable cursor - mode2 (x11 mode) */
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x0B);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CROSSHAIR_CONTROL, 0x00, 0x00);
-}
-
-static void
-IBMramdac526HideCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Disable cursor - X11 mode */
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs, 0x00, 0x24);
-}
-
-static void
-IBMramdac640HideCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Disable cursor - mode2 (x11 mode) */
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x08);
-}
-
-static void
-IBMramdac526SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- x += 64;
- y += 64;
-
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_hot_x, 0x00, 0x3f);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_hot_y, 0x00, 0x3f);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_xl, 0x00, x & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_xh, 0x00, (x>>8) & 0xf);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_yl, 0x00, y & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_yh, 0x00, (y>>8) & 0xf);
-}
-
-static void
-IBMramdac640SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- x += 64;
- y += 64;
-
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_OFFSETX, 0x00, 0x3f);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_OFFSETY, 0x00, 0x3f);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_X_LOW, 0x00, x & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_X_HIGH, 0x00, (x>>8) & 0xf);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_Y_LOW, 0x00, y & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_Y_HIGH, 0x00, (y>>8) & 0xf);
-}
-
-static void
-IBMramdac526SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_r, 0x00, bg >> 16);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_g, 0x00, bg >> 8);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_b, 0x00, bg);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_r, 0x00, fg >> 16);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_g, 0x00, fg >> 8);
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_b, 0x00, fg);
-}
-
-static void
-IBMramdac640SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_COL0, 0x00, 0);
- (*ramdacPtr->WriteData)(pScrn, fg>>16);
- (*ramdacPtr->WriteData)(pScrn, fg>>8);
- (*ramdacPtr->WriteData)(pScrn, fg);
- (*ramdacPtr->WriteData)(pScrn, bg>>16);
- (*ramdacPtr->WriteData)(pScrn, bg>>8);
- (*ramdacPtr->WriteData)(pScrn, bg);
- (*ramdacPtr->WriteData)(pScrn, fg>>16);
- (*ramdacPtr->WriteData)(pScrn, fg>>8);
- (*ramdacPtr->WriteData)(pScrn, fg);
- (*ramdacPtr->WriteData)(pScrn, bg>>16);
- (*ramdacPtr->WriteData)(pScrn, bg>>8);
- (*ramdacPtr->WriteData)(pScrn, bg);
-}
-
-static void
-IBMramdac526LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- int i;
- /*
- * Output the cursor data. The realize function has put the planes into
- * their correct order, so we can just blast this out.
- */
- for (i = 0; i < 1024; i++)
- (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_array + i, 0x00, (*src++));
-}
-
-static void
-IBMramdac640LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- int i;
- /*
- * Output the cursor data. The realize function has put the planes into
- * their correct order, so we can just blast this out.
- */
- for (i = 0; i < 1024; i++)
- (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_WRITE + i, 0x00, (*src++));
-}
-
-static Bool
-IBMramdac526UseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
-{
- return TRUE;
-}
-
-static Bool
-IBMramdac640UseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
-{
- return TRUE;
-}
-
-void
-IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr)
-{
- infoPtr->MaxWidth = 64;
- infoPtr->MaxHeight = 64;
- infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
- infoPtr->SetCursorColors = IBMramdac526SetCursorColors;
- infoPtr->SetCursorPosition = IBMramdac526SetCursorPosition;
- infoPtr->LoadCursorImage = IBMramdac526LoadCursorImage;
- infoPtr->HideCursor = IBMramdac526HideCursor;
- infoPtr->ShowCursor = IBMramdac526ShowCursor;
- infoPtr->UseHWCursor = IBMramdac526UseHWCursor;
-}
-
-void
-IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr)
-{
- infoPtr->MaxWidth = 64;
- infoPtr->MaxHeight = 64;
- infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
- infoPtr->SetCursorColors = IBMramdac640SetCursorColors;
- infoPtr->SetCursorPosition = IBMramdac640SetCursorPosition;
- infoPtr->LoadCursorImage = IBMramdac640LoadCursorImage;
- infoPtr->HideCursor = IBMramdac640HideCursor;
- infoPtr->ShowCursor = IBMramdac640ShowCursor;
- infoPtr->UseHWCursor = IBMramdac640UseHWCursor;
-}
diff --git a/hw/xfree86/ramdac/IBM.h b/hw/xfree86/ramdac/IBM.h
deleted file mode 100644
index 546296630..000000000
--- a/hw/xfree86/ramdac/IBM.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.h,v 1.8 2001/10/28 03:34:03 tsi Exp $ */
-
-#include <xf86RamDac.h>
-
-RamDacHelperRecPtr IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
-void IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
-void IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
-unsigned long IBMramdac526CalculateMNPCForClock(unsigned long RefClock,
- unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
- unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
- unsigned long *rP, unsigned long *rC);
-unsigned long IBMramdac640CalculateMNPCForClock(unsigned long RefClock,
- unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
- unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
- unsigned long *rP, unsigned long *rC);
-void IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr);
-void IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr);
-
-#define IBM524_RAMDAC ((VENDOR_IBM << 16) | 0x00)
-#define IBM524A_RAMDAC ((VENDOR_IBM << 16) | 0x01)
-#define IBM525_RAMDAC ((VENDOR_IBM << 16) | 0x02)
-#define IBM526_RAMDAC ((VENDOR_IBM << 16) | 0x03)
-#define IBM526DB_RAMDAC ((VENDOR_IBM << 16) | 0x04)
-#define IBM528_RAMDAC ((VENDOR_IBM << 16) | 0x05)
-#define IBM528A_RAMDAC ((VENDOR_IBM << 16) | 0x06)
-#define IBM624_RAMDAC ((VENDOR_IBM << 16) | 0x07)
-#define IBM624DB_RAMDAC ((VENDOR_IBM << 16) | 0x08)
-#define IBM640_RAMDAC ((VENDOR_IBM << 16) | 0x09)
-
-/*
- * IBM Ramdac registers
- */
-
-#define IBMRGB_REF_FREQ_1 14.31818
-#define IBMRGB_REF_FREQ_2 50.00000
-
-#define IBMRGB_rev 0x00
-#define IBMRGB_id 0x01
-#define IBMRGB_misc_clock 0x02
-#define IBMRGB_sync 0x03
-#define IBMRGB_hsync_pos 0x04
-#define IBMRGB_pwr_mgmt 0x05
-#define IBMRGB_dac_op 0x06
-#define IBMRGB_pal_ctrl 0x07
-#define IBMRGB_sysclk 0x08 /* not RGB525 */
-#define IBMRGB_pix_fmt 0x0a
-#define IBMRGB_8bpp 0x0b
-#define IBMRGB_16bpp 0x0c
-#define IBMRGB_24bpp 0x0d
-#define IBMRGB_32bpp 0x0e
-#define IBMRGB_pll_ctrl1 0x10
-#define IBMRGB_pll_ctrl2 0x11
-#define IBMRGB_pll_ref_div_fix 0x14
-#define IBMRGB_sysclk_ref_div 0x15 /* not RGB525 */
-#define IBMRGB_sysclk_vco_div 0x16 /* not RGB525 */
-/* #define IBMRGB_f0 0x20 */
-
-#define IBMRGB_sysclk_n 0x15
-#define IBMRGB_sysclk_m 0x16
-#define IBMRGB_sysclk_p 0x17
-#define IBMRGB_sysclk_c 0x18
-
-#define IBMRGB_m0 0x20
-#define IBMRGB_n0 0x21
-#define IBMRGB_p0 0x22
-#define IBMRGB_c0 0x23
-#define IBMRGB_m1 0x24
-#define IBMRGB_n1 0x25
-#define IBMRGB_p1 0x26
-#define IBMRGB_c1 0x27
-#define IBMRGB_m2 0x28
-#define IBMRGB_n2 0x29
-#define IBMRGB_p2 0x2a
-#define IBMRGB_c2 0x2b
-#define IBMRGB_m3 0x2c
-#define IBMRGB_n3 0x2d
-#define IBMRGB_p3 0x2e
-#define IBMRGB_c3 0x2f
-
-#define IBMRGB_curs 0x30
-#define IBMRGB_curs_xl 0x31
-#define IBMRGB_curs_xh 0x32
-#define IBMRGB_curs_yl 0x33
-#define IBMRGB_curs_yh 0x34
-#define IBMRGB_curs_hot_x 0x35
-#define IBMRGB_curs_hot_y 0x36
-#define IBMRGB_curs_col1_r 0x40
-#define IBMRGB_curs_col1_g 0x41
-#define IBMRGB_curs_col1_b 0x42
-#define IBMRGB_curs_col2_r 0x43
-#define IBMRGB_curs_col2_g 0x44
-#define IBMRGB_curs_col2_b 0x45
-#define IBMRGB_curs_col3_r 0x46
-#define IBMRGB_curs_col3_g 0x47
-#define IBMRGB_curs_col3_b 0x48
-#define IBMRGB_border_col_r 0x60
-#define IBMRGB_border_col_g 0x61
-#define IBMRGB_botder_col_b 0x62
-#define IBMRGB_key 0x68
-#define IBMRGB_key_mask 0x6C
-#define IBMRGB_misc1 0x70
-#define IBMRGB_misc2 0x71
-#define IBMRGB_misc3 0x72
-#define IBMRGB_misc4 0x73 /* not RGB525 */
-#define IBMRGB_key_control 0x78
-#define IBMRGB_dac_sense 0x82
-#define IBMRGB_misr_r 0x84
-#define IBMRGB_misr_g 0x86
-#define IBMRGB_misr_b 0x88
-#define IBMRGB_pll_vco_div_in 0x8e
-#define IBMRGB_pll_ref_div_in 0x8f
-#define IBMRGB_vram_mask_0 0x90
-#define IBMRGB_vram_mask_1 0x91
-#define IBMRGB_vram_mask_2 0x92
-#define IBMRGB_vram_mask_3 0x93
-#define IBMRGB_curs_array 0x100
-
-
-
-/* Constants rgb525.h */
-
-/* RGB525_REVISION_LEVEL */
-#define RGB525_PRODUCT_REV_LEVEL 0xf0
-
-/* RGB525_ID */
-#define RGB525_PRODUCT_ID 0x01
-
-/* RGB525_MISC_CTRL_1 */
-#define MISR_CNTL_ENABLE 0x80
-#define VMSK_CNTL_ENABLE 0x40
-#define PADR_RDMT_RDADDR 0x0
-#define PADR_RDMT_PAL_STATE 0x20
-#define SENS_DSAB_DISABLE 0x10
-#define SENS_SEL_BIT3 0x0
-#define SENS_SEL_BIT7 0x08
-#define VRAM_SIZE_32 0x0
-#define VRAM_SIZE_64 0x01
-
-/* RGB525_MISC_CTRL_2 */
-#define PCLK_SEL_LCLK 0x0
-#define PCLK_SEL_PLL 0x40
-#define PCLK_SEL_EXT 0x80
-#define INTL_MODE_ENABLE 0x20
-#define BLANK_CNTL_ENABLE 0x10
-#define COL_RES_6BIT 0x0
-#define COL_RES_8BIT 0x04
-#define PORT_SEL_VGA 0x0
-#define PORT_SEL_VRAM 0x01
-
-/* RGB525_MISC_CTRL_3 */
-#define SWAP_RB 0x80
-#define SWAP_WORD_LOHI 0x0
-#define SWAP_WORD_HILO 0x10
-#define SWAP_NIB_HILO 0x0
-#define SWAP_NIB_LOHI 0x02
-
-/* RGB525_MISC_CLK_CTRL */
-#define DDOT_CLK_ENABLE 0x0
-#define DDOT_CLK_DISABLE 0x80
-#define SCLK_ENABLE 0x0
-#define SCLK_DISABLE 0x40
-#define B24P_DDOT_PLL 0x0
-#define B24P_DDOT_SCLK 0x20
-#define DDOT_DIV_PLL_1 0x0
-#define DDOT_DIV_PLL_2 0x02
-#define DDOT_DIV_PLL_4 0x04
-#define DDOT_DIV_PLL_8 0x06
-#define DDOT_DIV_PLL_16 0x08
-#define PLL_DISABLE 0x0
-#define PLL_ENABLE 0x01
-
-/* RGB525_SYNC_CTRL */
-#define DLY_CNTL_ADD 0x0
-#define DLY_SYNC_NOADD 0x80
-#define CSYN_INVT_DISABLE 0x0
-#define CSYN_INVT_ENABLE 0x40
-#define VSYN_INVT_DISABLE 0x0
-#define VSYN_INVT_ENABLE 0x20
-#define HSYN_INVT_DISABLE 0x0
-#define HSYN_INVT_ENABLE 0x10
-#define VSYN_CNTL_NORMAL 0x0
-#define VSYN_CNTL_HIGH 0x04
-#define VSYN_CNTL_LOW 0x08
-#define VSYN_CNTL_DISABLE 0x0C
-#define HSYN_CNTL_NORMAL 0x0
-#define HSYN_CNTL_HIGH 0x01
-#define HSYN_CNTL_LOW 0x02
-#define HSYN_CNTL_DISABLE 0x03
-
-/* RGB525_HSYNC_CTRL */
-#define HSYN_POS(n) (n)
-
-/* RGB525_POWER_MANAGEMENT */
-#define SCLK_PWR_NORMAL 0x0
-#define SCLK_PWR_DISABLE 0x10
-#define DDOT_PWR_NORMAL 0x0
-#define DDOT_PWR_DISABLE 0x08
-#define SYNC_PWR_NORMAL 0x0
-#define SYNC_PWR_DISABLE 0x04
-#define ICLK_PWR_NORMAL 0x0
-#define ICLK_PWR_DISABLE 0x02
-#define DAC_PWR_NORMAL 0x0
-#define DAC_PWR_DISABLE 0x01
-
-/* RGB525_DAC_OPERATION */
-#define SOG_DISABLE 0x0
-#define SOG_ENABLE 0x08
-#define BRB_NORMAL 0x0
-#define BRB_ALWAYS 0x04
-#define DSR_DAC_SLOW 0x02
-#define DSR_DAC_FAST 0x0
-#define DPE_DISABLE 0x0
-#define DPE_ENABLE 0x01
-
-/* RGB525_PALETTE_CTRL */
-#define SIXBIT_LINEAR_ENABLE 0x0
-#define SIXBIT_LINEAR_DISABLE 0x80
-#define PALETTE_PARITION(n) (n)
-
-/* RGB525_PIXEL_FORMAT */
-#define PIXEL_FORMAT_4BPP 0x02
-#define PIXEL_FORMAT_8BPP 0x03
-#define PIXEL_FORMAT_16BPP 0x04
-#define PIXEL_FORMAT_24BPP 0x05
-#define PIXEL_FORMAT_32BPP 0x06
-
-/* RGB525_8BPP_CTRL */
-#define B8_DCOL_INDIRECT 0x0
-#define B8_DCOL_DIRECT 0x01
-
-/* RGB525_16BPP_CTRL */
-#define B16_DCOL_INDIRECT 0x0
-#define B16_DCOL_DYNAMIC 0x40
-#define B16_DCOL_DIRECT 0xC0
-#define B16_POL_FORCE_BYPASS 0x0
-#define B16_POL_FORCE_LOOKUP 0x20
-#define B16_ZIB 0x0
-#define B16_LINEAR 0x04
-#define B16_555 0x0
-#define B16_565 0x02
-#define B16_SPARSE 0x0
-#define B16_CONTIGUOUS 0x01
-
-/* RGB525_24BPP_CTRL */
-#define B24_DCOL_INDIRECT 0x0
-#define B24_DCOL_DIRECT 0x01
-
-/* RGB525_32BPP_CTRL */
-#define B32_POL_FORCE_BYPASS 0x0
-#define B32_POL_FORCE_LOOKUP 0x04
-#define B32_DCOL_INDIRECT 0x0
-#define B32_DCOL_DYNAMIC 0x01
-#define B32_DCOL_DIRECT 0x03
-
-/* RGB525_PLL_CTRL_1 */
-#define REF_SRC_REFCLK 0x0
-#define REF_SRC_EXTCLK 0x10
-#define PLL_EXT_FS_3_0 0x0
-#define PLL_EXT_FS_2_0 0x01
-#define PLL_CNTL2_3_0 0x02
-#define PLL_CNTL2_2_0 0x03
-
-/* RGB525_PLL_CTRL_2 */
-#define PLL_INT_FS_3_0(n) (n)
-#define PLL_INT_FS_2_0(n) (n)
-
-/* RGB525_PLL_REF_DIV_COUNT */
-#define REF_DIV_COUNT(n) (n)
-
-/* RGB525_F0 - RGB525_F15 */
-#define VCO_DIV_COUNT(n) (n)
-
-/* RGB525_PLL_REFCLK values */
-#define RGB525_PLL_REFCLK_MHz(n) ((n)/2)
-
-/* RGB525_CURSOR_CONTROL */
-#define SMLC_PART_0 0x0
-#define SMLC_PART_1 0x40
-#define SMLC_PART_2 0x80
-#define SMLC_PART_3 0xC0
-#define PIX_ORDER_RL 0x0
-#define PIX_ORDER_LR 0x20
-#define LOC_READ_LAST 0x0
-#define LOC_READ_ACTUAL 0x10
-#define UPDT_CNTL_DELAYED 0x0
-#define UPDT_CNTL_IMMEDIATE 0x08
-#define CURSOR_SIZE_32 0x0
-#define CURSOR_SIZE_64 0x40
-#define CURSOR_MODE_OFF 0x0
-#define CURSOR_MODE_3_COLOR 0x01
-#define CURSOR_MODE_2_COLOR_HL 0x02
-#define CURSOR_MODE_2_COLOR 0x03
-
-/* RGB525_REVISION_LEVEL */
-#define REVISION_LEVEL 0xF0 /* predefined */
-
-/* RGB525_ID */
-#define ID_CODE 0x01 /* predefined */
-
-/* MISR status */
-#define RGB525_MISR_DONE 0x01
-
-/* the IBMRGB640 is rather different from the rest of the RAMDACs,
- so we define a completely new set of register names for it */
-#define RGB640_SER_07_00 0x02
-#define RGB640_SER_15_08 0x03
-#define RGB640_SER_23_16 0x04
-#define RGB640_SER_31_24 0x05
-#define RGB640_SER_WID_03_00 0x06
-#define RGB640_SER_WID_07_04 0x07
-#define RGB640_SER_MODE 0x08
-#define IBM640_SER_2_1 0x00
-#define IBM640_SER_4_1 0x01
-#define IBM640_SER_8_1 0x02
-#define IBM640_SER_16_1 0x03
-#define IBM640_SER_16_3 0x05
-#define IBM640_SER_5_1 0x06
-#define RGB640_PIXEL_INTERLEAVE 0x09
-#define RGB640_MISC_CONF 0x0a
-#define IBM640_PCLK 0x00
-#define IBM640_PCLK_2 0x40
-#define IBM640_PCLK_4 0x80
-#define IBM640_PCLK_8 0xc0
-#define IBM640_PSIZE10 0x10
-#define IBM640_LCI 0x08
-#define IBM640_WIDCTL_MASK 0x07
-#define RGB640_VGA_CONTROL 0x0b
-#define IBM640_RDBK 0x04
-#define IBM640_PSIZE8 0x02
-#define IBM640_VRAM 0x01
-#define RGB640_DAC_CONTROL 0x0d
-#define IBM640_MONO 0x08
-#define IBM640_DACENBL 0x04
-#define IBM640_SHUNT 0x02
-#define IBM640_SLOWSLEW 0x01
-#define RGB640_OUTPUT_CONTROL 0x0e
-#define IBM640_RDAI 0x04
-#define IBM640_WDAI 0x02
-#define IBM640_WATCTL 0x01
-#define RGB640_SYNC_CONTROL 0x0f
-#define IBM640_PWR 0x20
-#define IBM640_VSP 0x10
-#define IBM640_HSP 0x08
-#define IBM640_CSE 0x04
-#define IBM640_CSG 0x02
-#define IBM640_BPE 0x01
-#define RGB640_PLL_N 0x10
-#define RGB640_PLL_M 0x11
-#define RGB640_PLL_P 0x12
-#define RGB640_PLL_CTL 0x13
-#define IBM640_PLL_EN 0x04
-#define IBM640_PLL_HIGH 0x10
-#define IBM640_PLL_LOW 0x01
-#define RGB640_AUX_PLL_CTL 0x17
-#define IBM640_AUXPLL 0x04
-#define IBM640_AUX_HI 0x02
-#define IBM640_AUX_LO 0x01
-#define RGB640_CHROMA_KEY0 0x20
-#define RGB640_CHROMA_MASK0 0x21
-#define RGB640_CURS_X_LOW 0x40
-#define RGB640_CURS_X_HIGH 0x41
-#define RGB640_CURS_Y_LOW 0x42
-#define RGB640_CURS_Y_HIGH 0x43
-#define RGB640_CURS_OFFSETX 0x44
-#define RGB640_CURS_OFFSETY 0x45
-#define RGB640_CURSOR_CONTROL 0x4B
-#define IBM640_CURS_OFF 0x00
-#define IBM640_CURS_MODE0 0x01
-#define IBM640_CURS_MODE1 0x02
-#define IBM640_CURS_MODE2 0x03
-#define IBM640_CURS_ADV 0x04
-#define RGB640_CROSSHAIR_CONTROL 0x57
-#define RGB640_VRAM_MASK0 0xf0
-#define RGB640_VRAM_MASK1 0xf1
-#define RGB640_VRAM_MASK2 0xf2
-#define RGB640_DIAGS 0xfa
-#define RGB640_CURS_WRITE 0x1000
-#define RGB640_CURS_COL0 0x4800
-#define RGB640_CURS_COL1 0x4801
-#define RGB640_CURS_COL2 0x4802
-#define RGB640_CURS_COL3 0x4803
diff --git a/hw/xfree86/ramdac/IBMPriv.h b/hw/xfree86/ramdac/IBMPriv.h
deleted file mode 100644
index 6fecb7705..000000000
--- a/hw/xfree86/ramdac/IBMPriv.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBMPriv.h,v 1.2 1998/07/25 16:57:19 dawes Exp $ */
-
-#include "IBM.h"
-
-typedef struct {
- char *DeviceName;
-} xf86IBMramdacInfo;
-
-extern xf86IBMramdacInfo IBMramdacDeviceInfo[];
-
-#ifdef INIT_IBM_RAMDAC_INFO
-xf86IBMramdacInfo IBMramdacDeviceInfo[] = {
- {"IBM 524"},
- {"IBM 524A"},
- {"IBM 525"},
- {"IBM 526"},
- {"IBM 526DB(DoubleBuffer)"},
- {"IBM 528"},
- {"IBM 528A"},
- {"IBM 624"},
- {"IBM 624DB(DoubleBuffer)"},
- {"IBM 640"}
-};
-#endif
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
deleted file mode 100644
index 5e466b707..000000000
--- a/hw/xfree86/ramdac/TI.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Modified from IBM.c to support TI RAMDAC routines
- * by Jens Owen, <jens@tungstengraphics.com>.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86Cursor.h"
-
-#define INIT_TI_RAMDAC_INFO
-#include "TIPriv.h"
-#include "xf86RamDacPriv.h"
-
-/* The following values are in kHz */
-#define TI_MIN_VCO_FREQ 110000
-#define TI_MAX_VCO_FREQ 220000
-
-unsigned long
-TIramdacCalculateMNPForClock(
- unsigned long RefClock, /* In 100Hz units */
- unsigned long ReqClock, /* In 100Hz units */
- char IsPixClock, /* boolean, is this the pixel or the sys clock */
- unsigned long MinClock, /* Min VCO rating */
- unsigned long MaxClock, /* Max VCO rating */
- unsigned long *rM, /* M Out */
- unsigned long *rN, /* N Out */
- unsigned long *rP /* Min P In, P Out */
-)
-{
- unsigned long n, p;
- unsigned long best_m = 0, best_n = 0;
- double VCO, IntRef = (double)RefClock;
- double m_err, inc_m, calc_m;
- unsigned long ActualClock;
-
- /* Make sure that MinClock <= ReqClock <= MaxClock */
- if ( ReqClock < MinClock)
- ReqClock = MinClock;
- if ( ReqClock > MaxClock )
- ReqClock = MaxClock;
-
- /*
- * ActualClock = VCO / 2 ^ p
- * Choose p so that TI_MIN_VCO_FREQ <= VCO <= TI_MAX_VCO_FREQ
- * Note that since TI_MAX_VCO_FREQ = 2 * TI_MIN_VCO_FREQ
- * we don't have to bother checking for this maximum limit.
- */
- VCO = (double)ReqClock;
- for ( p = 0; p < 3 && VCO < TI_MIN_VCO_FREQ; ( p )++ )
- VCO *= 2.0;
-
- /*
- * We avoid doing multiplications by ( 65 - n ),
- * and add an increment instead - this keeps any error small.
- */
- inc_m = VCO / ( IntRef * 8.0 );
-
- /* Initial value of calc_m for the loop */
- calc_m = inc_m + inc_m + inc_m;
-
- /* Initial amount of error for an integer - impossibly large */
- m_err = 2.0;
-
- /* Search for the closest INTEGER value of ( 65 - m ) */
- for ( n = 3; n <= 25; ( n )++, calc_m += inc_m ) {
-
- /* Ignore values of ( 65 - m ) which we can't use */
- if ( calc_m < 3.0 || calc_m > 64.0 )
- continue;
-
- /*
- * Pick the closest INTEGER (has smallest fractional part).
- * The optimizer should clean this up for us.
- */
- if (( calc_m - ( int ) calc_m ) < m_err ) {
- m_err = calc_m - ( int ) calc_m;
- best_m = ( int ) calc_m;
- best_n = n;
- }
- }
-
- /* 65 - ( 65 - x ) = x */
- *rM = 65 - best_m;
- *rN = 65 - best_n;
- *rP = p;
-
- /* Now all the calculations can be completed */
- VCO = 8.0 * IntRef * best_m / best_n;
- ActualClock = VCO / ( 1 << p );
-
-#ifdef DEBUG
- ErrorF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
- ActualClock, VCO, *rN, *rM, *rP);
-#endif
-
- return (ActualClock);
-}
-
-void
-TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i;
- unsigned long status;
-
- /* Here we pass a short, so that we can evaluate a mask too
- * So that the mask is the high byte and the data the low byte
- * Order is important
- */
- TIRESTORE(TIDAC_latch_ctrl);
- TIRESTORE(TIDAC_true_color_ctrl);
- TIRESTORE(TIDAC_multiplex_ctrl);
- TIRESTORE(TIDAC_clock_select);
- TIRESTORE(TIDAC_palette_page);
- TIRESTORE(TIDAC_general_ctrl);
- TIRESTORE(TIDAC_misc_ctrl);
- /* 0x2A & 0x2B are reserved */
- TIRESTORE(TIDAC_key_over_low);
- TIRESTORE(TIDAC_key_over_high);
- TIRESTORE(TIDAC_key_red_low);
- TIRESTORE(TIDAC_key_red_high);
- TIRESTORE(TIDAC_key_green_low);
- TIRESTORE(TIDAC_key_green_high);
- TIRESTORE(TIDAC_key_blue_low);
- TIRESTORE(TIDAC_key_blue_high);
- TIRESTORE(TIDAC_key_ctrl);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_clock_ctrl, 0, 0x30);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_clock_ctrl, 0, 0x38);
- TIRESTORE(TIDAC_clock_ctrl);
- TIRESTORE(TIDAC_sense_test);
- TIRESTORE(TIDAC_ind_curs_ctrl);
-
- /* only restore clocks if they were valid to begin with */
-
- if (ramdacReg->DacRegs[TIDAC_PIXEL_VALID]) {
- /* Reset pixel clock */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0, 0x3c);
-
- /* Restore N, M & P values for pixel clocks */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
- ramdacReg->DacRegs[TIDAC_PIXEL_N]);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
- ramdacReg->DacRegs[TIDAC_PIXEL_M]);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
- ramdacReg->DacRegs[TIDAC_PIXEL_P]);
-
- /* wait for pixel clock to lock */
- i = 1000000;
- do {
- status = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
- } while ((!(status & 0x40)) && (--i));
- if (!(status & 0x40)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Pixel clock setup timed out\n");
- return;
- }
- }
-
- if (ramdacReg->DacRegs[TIDAC_LOOP_VALID]) {
- /* Reset loop clock */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0, 0x70);
-
- /* Restore N, M & P values for pixel clocks */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
- ramdacReg->DacRegs[TIDAC_LOOP_N]);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
- ramdacReg->DacRegs[TIDAC_LOOP_M]);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
- ramdacReg->DacRegs[TIDAC_LOOP_P]);
-
- /* wait for loop clock to lock */
- i = 1000000;
- do {
- status = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
- } while ((!(status & 0x40)) && (--i));
- if (!(status & 0x40)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Loop clock setup timed out\n");
- return;
- }
- }
-
- /* restore palette */
- (*ramdacPtr->WriteAddress)(pScrn, 0);
-#ifndef NOT_DONE
- for (i=0;i<768;i++)
- (*ramdacPtr->WriteData)(pScrn, ramdacReg->DAC[i]);
-#else
- (*ramdacPtr->WriteData)(pScrn, 0);
- (*ramdacPtr->WriteData)(pScrn, 0);
- (*ramdacPtr->WriteData)(pScrn, 0);
- for (i=0;i<765;i++)
- (*ramdacPtr->WriteData)(pScrn, 0xff);
-#endif
-}
-
-void
-TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg)
-{
- int i;
-
- (*ramdacPtr->ReadAddress)(pScrn, 0);
- for (i=0;i<768;i++)
- ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
-
- /* Read back N,M and P values for pixel clock */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
- ramdacReg->DacRegs[TIDAC_PIXEL_N] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x11);
- ramdacReg->DacRegs[TIDAC_PIXEL_M] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
- ramdacReg->DacRegs[TIDAC_PIXEL_P] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
-
- /* Read back N,M and P values for loop clock */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
- ramdacReg->DacRegs[TIDAC_LOOP_N] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x11);
- ramdacReg->DacRegs[TIDAC_LOOP_M] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
- ramdacReg->DacRegs[TIDAC_LOOP_P] =
- (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
-
- /* Order is important */
- TISAVE(TIDAC_latch_ctrl);
- TISAVE(TIDAC_true_color_ctrl);
- TISAVE(TIDAC_multiplex_ctrl);
- TISAVE(TIDAC_clock_select);
- TISAVE(TIDAC_palette_page);
- TISAVE(TIDAC_general_ctrl);
- TISAVE(TIDAC_misc_ctrl);
- /* 0x2A & 0x2B are reserved */
- TISAVE(TIDAC_key_over_low);
- TISAVE(TIDAC_key_over_high);
- TISAVE(TIDAC_key_red_low);
- TISAVE(TIDAC_key_red_high);
- TISAVE(TIDAC_key_green_low);
- TISAVE(TIDAC_key_green_high);
- TISAVE(TIDAC_key_blue_low);
- TISAVE(TIDAC_key_blue_high);
- TISAVE(TIDAC_key_ctrl);
- TISAVE(TIDAC_clock_ctrl);
- TISAVE(TIDAC_sense_test);
- TISAVE(TIDAC_ind_curs_ctrl);
-}
-
-RamDacHelperRecPtr
-TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- RamDacHelperRecPtr ramdacHelperPtr = NULL;
- Bool RamDacIsSupported = FALSE;
- int TIramdac_ID = -1;
- int i;
- unsigned char id, rev, rev2, id2;
-
- /* read ID and revision */
- rev = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_rev);
- id = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_id);
-
- /* check if ID and revision are read only */
- (*ramdacPtr->WriteDAC)(pScrn, ~rev, 0, TIDAC_rev);
- (*ramdacPtr->WriteDAC)(pScrn, ~id, 0, TIDAC_id);
- rev2 = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_rev);
- id2 = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_id);
-
- switch (id) {
- case TIDAC_TVP_3030_ID:
- if (id == id2 && rev == rev2) /* check for READ ONLY */
- TIramdac_ID = TI3030_RAMDAC;
- break;
- case TIDAC_TVP_3026_ID:
- if (id == id2 && rev == rev2) /* check for READ ONLY */
- TIramdac_ID = TI3026_RAMDAC;
- break;
- }
-
- (*ramdacPtr->WriteDAC)(pScrn, rev, 0, TIDAC_rev);
- (*ramdacPtr->WriteDAC)(pScrn, id, 0, TIDAC_id);
-
- if (TIramdac_ID == -1) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Cannot determine TI RAMDAC type, aborting\n");
- return NULL;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF].DeviceName);
- }
-
- for (i=0;ramdacs[i].token != -1;i++) {
- if (ramdacs[i].token == TIramdac_ID)
- RamDacIsSupported = TRUE;
- }
-
- if (!RamDacIsSupported) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "This TI RAMDAC is NOT supported by this driver, aborting\n");
- return NULL;
- }
-
- ramdacHelperPtr = RamDacHelperCreateInfoRec();
- switch (TIramdac_ID) {
- case TI3030_RAMDAC:
- ramdacHelperPtr->SetBpp = TIramdac3030SetBpp;
- ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit;
- break;
- case TI3026_RAMDAC:
- ramdacHelperPtr->SetBpp = TIramdac3026SetBpp;
- ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit;
- break;
- }
- ramdacPtr->RamDacType = TIramdac_ID;
- ramdacHelperPtr->RamDacType = TIramdac_ID;
- ramdacHelperPtr->Save = TIramdacSave;
- ramdacHelperPtr->Restore = TIramdacRestore;
-
- return ramdacHelperPtr;
-}
-
-void
-TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
-{
- switch (pScrn->bitsPerPixel) {
- case 32:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5c;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01;
- }
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 24:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x25;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 16:
- /* order is important */
-#if 0
- /* Matrox driver uses this */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07;
-#else
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
-#endif
- if (pScrn->depth == 16) {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45;
- } else {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44;
- }
-#if 0
- /* Matrox driver uses this */
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x15;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
-#else
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x54;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
-#endif
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 8:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4c;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- }
-}
-
-void
-TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
-{
- switch (pScrn->bitsPerPixel) {
- case 32:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5D;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01;
- }
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 24:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x25;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 16:
- /* order is important */
-#if 0
- /* Matrox driver uses this */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07;
-#else
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
-#endif
- if (pScrn->depth == 16) {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45;
- } else {
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44;
- }
-#if 0
- /* Matrox driver uses this */
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x15;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
-#else
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x55;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x85;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
-#endif
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- case 8:
- /* order is important */
- ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
- ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80;
- ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4d;
- ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
- ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
- ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
- ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C;
- /* 0x2A & 0x2B are reserved */
- ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
- ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
- ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00;
- ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
- ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
- break;
- }
-}
-
-static void
-TIramdacShowCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Enable cursor - X11 mode */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x03);
-}
-
-static void
-TIramdacHideCursor(ScrnInfoPtr pScrn)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Disable cursor - X11 mode */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x00);
-}
-
-static void
-TIramdacSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- x += 64;
- y += 64;
-
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_XLOW, 0, x & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_XHIGH, 0, (x >> 8) & 0x0f);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_YLOW, 0, y & 0xff);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_YHIGH, 0, (y >> 8) & 0x0f);
-}
-
-static void
-TIramdacSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
-
- /* Background color */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_WRITE_ADDR, 0, 1);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((bg&0x00ff0000) >> 16));
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((bg&0x0000ff00) >> 8));
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, (bg&0x000000ff) );
-
- /* Foreground color */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_WRITE_ADDR, 0, 2);
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((fg&0x00ff0000) >> 16));
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((fg&0x0000ff00) >> 8));
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, (fg&0x000000ff) );
-}
-
-static void
-TIramdacLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
-{
- RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
- int i = 1024;
-
- /* reset A9,A8 */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x00);
- /* reset cursor RAM load address A7..A0 */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_INDEX, 0x00, 0x00);
-
- while(i--) {
- /* NOT_DONE: might need a delay here */
- (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_RAM_DATA, 0, *(src++));
- }
-}
-
-static Bool
-TIramdacUseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
-{
- return TRUE;
-}
-
-void
-TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr)
-{
- infoPtr->MaxWidth = 64;
- infoPtr->MaxHeight = 64;
- infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
- HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
- infoPtr->SetCursorColors = TIramdacSetCursorColors;
- infoPtr->SetCursorPosition = TIramdacSetCursorPosition;
- infoPtr->LoadCursorImage = TIramdacLoadCursorImage;
- infoPtr->HideCursor = TIramdacHideCursor;
- infoPtr->ShowCursor = TIramdacShowCursor;
- infoPtr->UseHWCursor = TIramdacUseHWCursor;
-}
-
-void TIramdacLoadPalette(
- ScrnInfoPtr pScrn,
- int numColors,
- int *indices,
- LOCO *colors,
- VisualPtr pVisual
-){
- RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
- int i, index, shift;
-
- if (pScrn->depth == 16) {
- for(i = 0; i < numColors; i++) {
- index = indices[i];
- (*hwp->WriteAddress)(pScrn, index << 2);
- (*hwp->WriteData)(pScrn, colors[index >> 1].red);
- (*hwp->WriteData)(pScrn, colors[index].green);
- (*hwp->WriteData)(pScrn, colors[index >> 1].blue);
-
- if(index <= 31) {
- (*hwp->WriteAddress)(pScrn, index << 3);
- (*hwp->WriteData)(pScrn, colors[index].red);
- (*hwp->WriteData)(pScrn, colors[(index << 1) + 1].green);
- (*hwp->WriteData)(pScrn, colors[index].blue);
- }
- }
-} else {
- shift = (pScrn->depth == 15) ? 3 : 0;
-
- for(i = 0; i < numColors; i++) {
- index = indices[i];
- (*hwp->WriteAddress)(pScrn, index << shift);
- (*hwp->WriteData)(pScrn, colors[index].red);
- (*hwp->WriteData)(pScrn, colors[index].green);
- (*hwp->WriteData)(pScrn, colors[index].blue);
- }
-}
-}
diff --git a/hw/xfree86/ramdac/TI.h b/hw/xfree86/ramdac/TI.h
deleted file mode 100644
index 9451f814c..000000000
--- a/hw/xfree86/ramdac/TI.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.h,v 1.5 2003/02/17 16:08:29 dawes Exp $ */
-
-#include <xf86RamDac.h>
-
-unsigned long TIramdacCalculateMNPForClock(unsigned long RefClock,
- unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
- unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
- unsigned long *rP);
-RamDacHelperRecPtr TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
-void TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
-void TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
-void TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
-unsigned long TIramdac3030CalculateMNPForClock(unsigned long RefClock,
- unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
- unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
- unsigned long *rP);
-void TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr);
-void TIramdacLoadPalette( ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual);
-
-
-#define TI3030_RAMDAC (VENDOR_TI << 16) | 0x00
-#define TI3026_RAMDAC (VENDOR_TI << 16) | 0x01
-
-/*
- * TI Ramdac registers
- */
-
-#define TIDAC_rev 0x01
-#define TIDAC_ind_curs_ctrl 0x06
-#define TIDAC_byte_router_ctrl 0x07
-#define TIDAC_latch_ctrl 0x0f
-#define TIDAC_true_color_ctrl 0x18
-#define TIDAC_multiplex_ctrl 0x19
-#define TIDAC_clock_select 0x1a
-#define TIDAC_palette_page 0x1c
-#define TIDAC_general_ctrl 0x1d
-#define TIDAC_misc_ctrl 0x1e
-#define TIDAC_pll_addr 0x2c
-#define TIDAC_pll_pixel_data 0x2d
-#define TIDAC_pll_memory_data 0x2e
-#define TIDAC_pll_loop_data 0x2f
-#define TIDAC_key_over_low 0x30
-#define TIDAC_key_over_high 0x31
-#define TIDAC_key_red_low 0x32
-#define TIDAC_key_red_high 0x33
-#define TIDAC_key_green_low 0x34
-#define TIDAC_key_green_high 0x35
-#define TIDAC_key_blue_low 0x36
-#define TIDAC_key_blue_high 0x37
-#define TIDAC_key_ctrl 0x38
-#define TIDAC_clock_ctrl 0x39
-#define TIDAC_sense_test 0x3a
-#define TIDAC_test_mode_data 0x3b
-#define TIDAC_crc_remain_lsb 0x3c
-#define TIDAC_crc_remain_msb 0x3d
-#define TIDAC_crc_bit_select 0x3e
-#define TIDAC_id 0x3f
-
-/* These are pll values that are accessed via TIDAC_pll_pixel_data */
-#define TIDAC_PIXEL_N 0x80
-#define TIDAC_PIXEL_M 0x81
-#define TIDAC_PIXEL_P 0x82
-#define TIDAC_PIXEL_VALID 0x83
-
-/* These are pll values that are accessed via TIDAC_pll_loop_data */
-#define TIDAC_LOOP_N 0x90
-#define TIDAC_LOOP_M 0x91
-#define TIDAC_LOOP_P 0x92
-#define TIDAC_LOOP_VALID 0x93
-
-/* Direct mapping addresses */
-#define TIDAC_INDEX 0xa0
-#define TIDAC_PALETTE_DATA 0xa1
-#define TIDAC_READ_MASK 0xa2
-#define TIDAC_READ_ADDR 0xa3
-#define TIDAC_CURS_WRITE_ADDR 0xa4
-#define TIDAC_CURS_COLOR 0xa5
-#define TIDAC_CURS_READ_ADDR 0xa7
-#define TIDAC_CURS_CTL 0xa9
-#define TIDAC_INDEXED_DATA 0xaa
-#define TIDAC_CURS_RAM_DATA 0xab
-#define TIDAC_CURS_XLOW 0xac
-#define TIDAC_CURS_XHIGH 0xad
-#define TIDAC_CURS_YLOW 0xae
-#define TIDAC_CURS_YHIGH 0xaf
-
-#define TIDAC_sw_reset 0xff
-
-/* Constants */
-#define TIDAC_TVP_3026_ID 0x26
-#define TIDAC_TVP_3030_ID 0x30
diff --git a/hw/xfree86/ramdac/TIPriv.h b/hw/xfree86/ramdac/TIPriv.h
deleted file mode 100644
index d81552764..000000000
--- a/hw/xfree86/ramdac/TIPriv.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TIPriv.h,v 1.2 2000/03/21 21:15:28 alanh Exp $ */
-
-#include "TI.h"
-
-typedef struct {
- char *DeviceName;
-} xf86TIramdacInfo;
-
-extern xf86TIramdacInfo TIramdacDeviceInfo[];
-
-#ifdef INIT_TI_RAMDAC_INFO
-xf86TIramdacInfo TIramdacDeviceInfo[] = {
- {"TI TVP3030"},
- {"TI TVP3026"}
-};
-#endif
-
-#define TISAVE(_reg) do { \
- ramdacReg->DacRegs[_reg] = (*ramdacPtr->ReadDAC)(pScrn, _reg); \
-} while (0)
-
-#define TIRESTORE(_reg) do { \
- (*ramdacPtr->WriteDAC)(pScrn, _reg, \
- (ramdacReg->DacRegs[_reg] & 0xFF00) >> 8, \
- ramdacReg->DacRegs[_reg]); \
-} while (0)
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
deleted file mode 100644
index 49379e934..000000000
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.20 2003/02/24 20:43:54 tsi Exp $ */
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86CursorPriv.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-
-int xf86CursorScreenIndex = -1;
-static unsigned long xf86CursorGeneration = 0;
-
-/* sprite functions */
-
-static Bool xf86CursorRealizeCursor(ScreenPtr, CursorPtr);
-static Bool xf86CursorUnrealizeCursor(ScreenPtr, CursorPtr);
-static void xf86CursorSetCursor(ScreenPtr, CursorPtr, int, int);
-static void xf86CursorMoveCursor(ScreenPtr, int, int);
-
-static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
- xf86CursorRealizeCursor,
- xf86CursorUnrealizeCursor,
- xf86CursorSetCursor,
- xf86CursorMoveCursor
-};
-
-/* Screen functions */
-
-static void xf86CursorInstallColormap(ColormapPtr);
-static void xf86CursorRecolorCursor(ScreenPtr, CursorPtr, Bool);
-static Bool xf86CursorCloseScreen(int, ScreenPtr);
-static void xf86CursorQueryBestSize(int, unsigned short*, unsigned short*,
- ScreenPtr);
-
-/* ScrnInfoRec functions */
-
-static Bool xf86CursorSwitchMode(int, DisplayModePtr,int);
-static Bool xf86CursorEnterVT(int, int);
-static void xf86CursorLeaveVT(int, int);
-static int xf86CursorSetDGAMode(int, int, DGADevicePtr);
-
-Bool
-xf86InitCursor(
- ScreenPtr pScreen,
- xf86CursorInfoPtr infoPtr
-)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- xf86CursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
-
- if (xf86CursorGeneration != serverGeneration) {
- if ((xf86CursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- xf86CursorGeneration = serverGeneration;
- }
-
- if (!xf86InitHardwareCursor(pScreen, infoPtr))
- return FALSE;
-
- ScreenPriv = xcalloc(1, sizeof(xf86CursorScreenRec));
- if (!ScreenPriv)
- return FALSE;
-
- pScreen->devPrivates[xf86CursorScreenIndex].ptr = ScreenPriv;
-
- ScreenPriv->SWCursor = TRUE;
- ScreenPriv->isUp = FALSE;
- ScreenPriv->CurrentCursor = NULL;
- ScreenPriv->CursorInfoPtr = infoPtr;
- ScreenPriv->PalettedCursor = FALSE;
- ScreenPriv->pInstalledMap = NULL;
-
- ScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = xf86CursorCloseScreen;
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = xf86CursorQueryBestSize;
- ScreenPriv->RecolorCursor = pScreen->RecolorCursor;
- pScreen->RecolorCursor = xf86CursorRecolorCursor;
-
- if ((infoPtr->pScrn->bitsPerPixel == 8) &&
- !(infoPtr->Flags & HARDWARE_CURSOR_TRUECOLOR_AT_8BPP)) {
- ScreenPriv->InstallColormap = pScreen->InstallColormap;
- pScreen->InstallColormap = xf86CursorInstallColormap;
- ScreenPriv->PalettedCursor = TRUE;
- }
-
- PointPriv = pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->showTransparent = PointPriv->showTransparent;
- if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT)
- PointPriv->showTransparent = TRUE;
- else
- PointPriv->showTransparent = FALSE;
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &xf86CursorSpriteFuncs;
-
- ScreenPriv->SwitchMode = pScrn->SwitchMode;
- ScreenPriv->EnterVT = pScrn->EnterVT;
- ScreenPriv->LeaveVT = pScrn->LeaveVT;
- ScreenPriv->SetDGAMode = pScrn->SetDGAMode;
-
- ScreenPriv->ForceHWCursorCount = 0;
- ScreenPriv->HWCursorForced = FALSE;
-
- if (pScrn->SwitchMode)
- pScrn->SwitchMode = xf86CursorSwitchMode;
- pScrn->EnterVT = xf86CursorEnterVT;
- pScrn->LeaveVT = xf86CursorLeaveVT;
- pScrn->SetDGAMode = xf86CursorSetDGAMode;
-
- return TRUE;
-}
-
-/***** Screen functions *****/
-
-static Bool
-xf86CursorCloseScreen(int i, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- miPointerScreenPtr PointPriv =
- pScreen->devPrivates[miPointerScreenIndex].ptr;
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (ScreenPriv->isUp && pScrn->vtSema)
- xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
-
- pScreen->CloseScreen = ScreenPriv->CloseScreen;
- pScreen->QueryBestSize = ScreenPriv->QueryBestSize;
- pScreen->RecolorCursor = ScreenPriv->RecolorCursor;
- if (ScreenPriv->InstallColormap)
- pScreen->InstallColormap = ScreenPriv->InstallColormap;
-
- PointPriv->spriteFuncs = ScreenPriv->spriteFuncs;
- PointPriv->showTransparent = ScreenPriv->showTransparent;
-
- pScrn->SwitchMode = ScreenPriv->SwitchMode;
- pScrn->EnterVT = ScreenPriv->EnterVT;
- pScrn->LeaveVT = ScreenPriv->LeaveVT;
- pScrn->SetDGAMode = ScreenPriv->SetDGAMode;
-
- xfree(ScreenPriv->transparentData);
- xfree(ScreenPriv);
-
- return (*pScreen->CloseScreen)(i, pScreen);
-}
-
-static void
-xf86CursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (class == CursorShape) {
- if(*width > ScreenPriv->CursorInfoPtr->MaxWidth)
- *width = ScreenPriv->CursorInfoPtr->MaxWidth;
- if(*height > ScreenPriv->CursorInfoPtr->MaxHeight)
- *height = ScreenPriv->CursorInfoPtr->MaxHeight;
- } else
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
-}
-
-static void
-xf86CursorInstallColormap(ColormapPtr pMap)
-{
- xf86CursorScreenPtr ScreenPriv =
- pMap->pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- ScreenPriv->pInstalledMap = pMap;
-
- (*ScreenPriv->InstallColormap)(pMap);
-}
-
-static void
-xf86CursorRecolorCursor(
- ScreenPtr pScreen,
- CursorPtr pCurs,
- Bool displayed)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (!displayed)
- return;
-
- if (ScreenPriv->SWCursor)
- (*ScreenPriv->RecolorCursor)(pScreen, pCurs, displayed);
- else
- xf86RecolorCursor(pScreen, pCurs, displayed);
-}
-
-/***** ScrnInfoRec functions *********/
-
-static Bool
-xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
-{
- Bool ret;
- ScreenPtr pScreen = screenInfo.screens[index];
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- miPointerScreenPtr PointPriv =
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- if (ScreenPriv->isUp) {
- xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
- ScreenPriv->isUp = FALSE;
- }
-
- ret = (*ScreenPriv->SwitchMode)(index, mode, flags);
-
- /*
- * Cannot restore cursor here because the new frame[XY][01] haven't been
- * calculated yet. However, because the hardware cursor was removed above,
- * ensure the cursor is repainted by miPointerWarpCursor().
- */
- ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
- PointPriv->waitForUpdate = FALSE; /* Force cursor repaint */
-
- return ret;
-}
-
-static Bool
-xf86CursorEnterVT(int index, int flags)
-{
- Bool ret;
- ScreenPtr pScreen = screenInfo.screens[index];
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- ret = (*ScreenPriv->EnterVT)(index, flags);
-
- if (ScreenPriv->CurrentCursor)
- xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor,
- ScreenPriv->x, ScreenPriv->y);
- return ret;
-}
-
-static void
-xf86CursorLeaveVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (ScreenPriv->isUp) {
- xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
- ScreenPriv->isUp = FALSE;
- }
- ScreenPriv->SWCursor = TRUE;
-
- (*ScreenPriv->LeaveVT)(index, flags);
-}
-
-static int
-xf86CursorSetDGAMode(int index, int num, DGADevicePtr devRet)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- int ret;
-
- if (num && ScreenPriv->isUp) {
- xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
- ScreenPriv->isUp = FALSE;
- ScreenPriv->SWCursor = TRUE;
- }
-
- ret = (*ScreenPriv->SetDGAMode)(index, num, devRet);
-
- if (ScreenPriv->CurrentCursor && (!num || (ret != Success))) {
- xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor,
- ScreenPriv->x, ScreenPriv->y);
- }
-
- return ret;
-}
-
-/****** miPointerSpriteFunctions *******/
-
-static Bool
-xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (pCurs->refcnt <= 1)
- pCurs->devPriv[pScreen->myNum] = NULL;
-
- return (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs);
-}
-
-static Bool
-xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (pCurs->refcnt <= 1) {
- xfree(pCurs->devPriv[pScreen->myNum]);
- pCurs->devPriv[pScreen->myNum] = NULL;
- }
-
- return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs);
-}
-
-static void
-xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
- miPointerScreenPtr PointPriv;
-
- ScreenPriv->CurrentCursor = pCurs;
- ScreenPriv->x = x;
- ScreenPriv->y = y;
- ScreenPriv->CursorToRestore = NULL;
-
- if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
- if (ScreenPriv->SWCursor)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
- else if (ScreenPriv->isUp) {
- xf86SetCursor(pScreen, NullCursor, x, y);
- ScreenPriv->isUp = FALSE;
- }
- return;
- }
-
- ScreenPriv->HotX = pCurs->bits->xhot;
- ScreenPriv->HotY = pCurs->bits->yhot;
-
- PointPriv = pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || ((
-#ifdef ARGB_CURSOR
- pCurs->bits->argb && infoPtr->UseHWCursorARGB &&
- (*infoPtr->UseHWCursorARGB) (pScreen, pCurs) ) || (
- pCurs->bits->argb == 0 &&
-#endif
- (pCurs->bits->height <= infoPtr->MaxHeight) &&
- (pCurs->bits->width <= infoPtr->MaxWidth) &&
- (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor)(pScreen, pCurs))))))
- {
-
- if (ScreenPriv->SWCursor) /* remove the SW cursor */
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
-
- xf86SetCursor(pScreen, pCurs, x, y);
- ScreenPriv->SWCursor = FALSE;
- ScreenPriv->isUp = TRUE;
- PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
- return;
- }
-
- PointPriv->waitForUpdate = TRUE;
-
- if (ScreenPriv->isUp) {
- /* Remove the HW cursor, or make it transparent */
- if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) {
- xf86SetTransparentCursor(pScreen);
- } else {
- xf86SetCursor(pScreen, NullCursor, x, y);
- ScreenPriv->isUp = FALSE;
- }
- }
-
- ScreenPriv->SWCursor = TRUE;
-
- if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
- pCurs = NullCursor;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y);
-}
-
-static void
-xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- ScreenPriv->x = x;
- ScreenPriv->y = y;
-
- if (ScreenPriv->CursorToRestore)
- xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore,
- ScreenPriv->x, ScreenPriv->y);
- else if (ScreenPriv->SWCursor)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
- else if (ScreenPriv->isUp)
- xf86MoveCursor(pScreen, x, y);
-}
-
-void
-xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
-
- if (on)
- {
- if (ScreenPriv->ForceHWCursorCount++ == 0)
- {
- if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor)
- {
- ScreenPriv->HWCursorForced = TRUE;
- xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
- ScreenPriv->x, ScreenPriv->y);
- }
- else
- ScreenPriv->HWCursorForced = FALSE;
- }
- }
- else
- {
- if (--ScreenPriv->ForceHWCursorCount == 0)
- {
- if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor)
- xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
- ScreenPriv->x, ScreenPriv->y);
- }
- }
-}
-
-xf86CursorInfoPtr
-xf86CreateCursorInfoRec(void)
-{
- return xcalloc(1, sizeof(xf86CursorInfoRec));
-}
-
-void
-xf86DestroyCursorInfoRec(xf86CursorInfoPtr infoPtr)
-{
- xfree(infoPtr);
-}
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
deleted file mode 100644
index 5e5df46f3..000000000
--- a/hw/xfree86/ramdac/xf86Cursor.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.11 2003/02/15 03:14:47 tsi Exp $ */
-
-#ifndef _XF86CURSOR_H
-#define _XF86CURSOR_H
-
-#include "xf86str.h"
-#include "mipointer.h"
-
-typedef struct _xf86CursorInfoRec {
- ScrnInfoPtr pScrn;
- int Flags;
- int MaxWidth;
- int MaxHeight;
- void (*SetCursorColors)(ScrnInfoPtr pScrn, int bg, int fg);
- void (*SetCursorPosition)(ScrnInfoPtr pScrn, int x, int y);
- void (*LoadCursorImage)(ScrnInfoPtr pScrn, unsigned char *bits);
- void (*HideCursor)(ScrnInfoPtr pScrn);
- void (*ShowCursor)(ScrnInfoPtr pScrn);
- unsigned char* (*RealizeCursor)(struct _xf86CursorInfoRec *, CursorPtr);
- Bool (*UseHWCursor)(ScreenPtr, CursorPtr);
-
-#ifdef ARGB_CURSOR
- Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
- void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
-#endif
-
-} xf86CursorInfoRec, *xf86CursorInfoPtr;
-
-Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
-xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
-void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
-void xf86ForceHWCursor (ScreenPtr pScreen, Bool on);
-
-#define HARDWARE_CURSOR_INVERT_MASK 0x00000001
-#define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002
-#define HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK 0x00000004
-#define HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED 0x00000008
-#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 0x00000010
-#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 0x00000020
-#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 0x00000040
-#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 0x00000080
-#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 0x00000100
-#define HARDWARE_CURSOR_TRUECOLOR_AT_8BPP 0x00000200
-#define HARDWARE_CURSOR_BIT_ORDER_MSBFIRST 0x00000400
-#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
-#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
-#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
-
-#endif /* _XF86CURSOR_H */
diff --git a/hw/xfree86/ramdac/xf86CursorPriv.h b/hw/xfree86/ramdac/xf86CursorPriv.h
deleted file mode 100644
index 5a6ab118a..000000000
--- a/hw/xfree86/ramdac/xf86CursorPriv.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.5 2003/02/15 03:14:47 tsi Exp $ */
-
-#ifndef _XF86CURSORPRIV_H
-#define _XF86CURSORPRIV_H
-
-#include "xf86Cursor.h"
-#include "mipointrst.h"
-
-typedef struct {
- Bool SWCursor;
- Bool isUp;
- Bool showTransparent;
- short HotX;
- short HotY;
- short x;
- short y;
- CursorPtr CurrentCursor, CursorToRestore;
- xf86CursorInfoPtr CursorInfoPtr;
- CloseScreenProcPtr CloseScreen;
- RecolorCursorProcPtr RecolorCursor;
- InstallColormapProcPtr InstallColormap;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
- Bool PalettedCursor;
- ColormapPtr pInstalledMap;
- Bool (*SwitchMode)(int, DisplayModePtr,int);
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- int (*SetDGAMode)(int, int, DGADevicePtr);
-
- /* Number of requests to force HW cursor */
- int ForceHWCursorCount;
- Bool HWCursorForced;
-
- pointer transparentData;
-} xf86CursorScreenRec, *xf86CursorScreenPtr;
-
-void xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y);
-void xf86SetTransparentCursor(ScreenPtr pScreen);
-void xf86MoveCursor(ScreenPtr pScreen, int x, int y);
-void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
-Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
-
-CARD32 xf86ReverseBitOrder(CARD32 data);
-
-extern int xf86CursorScreenIndex;
-
-#endif /* _XF86CURSORPRIV_H */
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
deleted file mode 100644
index 41b623a6a..000000000
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.13 2003/03/04 21:21:15 mvojkovi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "cursorstr.h"
-#include "mi.h"
-#include "mipointer.h"
-#include "xf86CursorPriv.h"
-
-#include "servermd.h"
-
-#if BITMAP_SCANLINE_PAD == 64
-
-#if 1
-/* Cursors might be only 32 wide. Give'em a chance */
-#define SCANLINE CARD32
-#define CUR_BITMAP_SCANLINE_PAD 32
-#define CUR_LOG2_BITMAP_PAD 5
-#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
-#else
-#define SCANLINE CARD64
-#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
-#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
-#define REVERSE_BIT_ORDER(w) xf86CARD64ReverseBits(w)
-static CARD64 xf86CARD64ReverseBits(CARD64 w);
-
-static CARD64
-xf86CARD64ReverseBits(CARD64 w)
-{
- unsigned char *p = (unsigned char *)&w;
-
- p[0] = byte_reversed[p[0]];
- p[1] = byte_reversed[p[1]];
- p[2] = byte_reversed[p[2]];
- p[3] = byte_reversed[p[3]];
- p[4] = byte_reversed[p[4]];
- p[5] = byte_reversed[p[5]];
- p[6] = byte_reversed[p[6]];
- p[7] = byte_reversed[p[7]];
-
- return w;
-}
-#endif
-
-#else
-
-#define SCANLINE CARD32
-#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
-#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
-#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
-
-#endif /* BITMAP_SCANLINE_PAD == 64 */
-
-static unsigned char* RealizeCursorInterleave0(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave1(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave8(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave16(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave32(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
-
-Bool
-xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
-{
- if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
- return FALSE;
-
- /* These are required for now */
- if (!infoPtr->SetCursorPosition ||
- !infoPtr->LoadCursorImage ||
- !infoPtr->HideCursor ||
- !infoPtr->ShowCursor ||
- !infoPtr->SetCursorColors)
- return FALSE;
-
- if (infoPtr->RealizeCursor) {
- /* Don't overwrite a driver provided Realize Cursor function */
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave1;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave8;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave16;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave32;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave64;
- } else { /* not interleaved */
- infoPtr->RealizeCursor = RealizeCursorInterleave0;
- }
-
- infoPtr->pScrn = xf86Screens[pScreen->myNum];
-
- return TRUE;
-}
-
-void
-xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
- unsigned char *bits;
-
- if (pCurs == NullCursor) {
- (*infoPtr->HideCursor)(infoPtr->pScrn);
- return;
- }
-
- bits = pCurs->devPriv[pScreen->myNum];
-
- x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
- y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
-
-#ifdef ARGB_CURSOR
- if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB)
-#endif
- if (!bits) {
- bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
- pCurs->devPriv[pScreen->myNum] = bits;
- }
-
- if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
- (*infoPtr->HideCursor)(infoPtr->pScrn);
-
-#ifdef ARGB_CURSOR
- if (pCurs->bits->argb && infoPtr->LoadCursorARGB)
- (*infoPtr->LoadCursorARGB) (infoPtr->pScrn, pCurs);
- else
-#endif
- if (bits)
- (*infoPtr->LoadCursorImage)(infoPtr->pScrn, bits);
-
- xf86RecolorCursor(pScreen, pCurs, 1);
-
- (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
-
- (*infoPtr->ShowCursor)(infoPtr->pScrn);
-}
-
-void
-xf86SetTransparentCursor(ScreenPtr pScreen)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
- if (!ScreenPriv->transparentData)
- ScreenPriv->transparentData =
- (*infoPtr->RealizeCursor)(infoPtr, NullCursor);
-
- if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
- (*infoPtr->HideCursor)(infoPtr->pScrn);
-
- if (ScreenPriv->transparentData)
- (*infoPtr->LoadCursorImage)(infoPtr->pScrn,
- ScreenPriv->transparentData);
-
- (*infoPtr->ShowCursor)(infoPtr->pScrn);
-}
-
-void
-xf86MoveCursor(ScreenPtr pScreen, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
- x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
- y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
-
- (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
-}
-
-void
-xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
-{
- xf86CursorScreenPtr ScreenPriv =
- pScreen->devPrivates[xf86CursorScreenIndex].ptr;
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
-#ifdef ARGB_CURSOR
- /* recoloring isn't applicable to ARGB cursors and drivers
- shouldn't have to ignore SetCursorColors requests */
- if (pCurs->bits->argb)
- return;
-#endif
-
- if (ScreenPriv->PalettedCursor) {
- xColorItem sourceColor, maskColor;
- ColormapPtr pmap = ScreenPriv->pInstalledMap;
-
- if (!pmap)
- return;
-
- sourceColor.red = pCurs->foreRed;
- sourceColor.green = pCurs->foreGreen;
- sourceColor.blue = pCurs->foreBlue;
- FakeAllocColor(pmap, &sourceColor);
- maskColor.red = pCurs->backRed;
- maskColor.green = pCurs->backGreen;
- maskColor.blue = pCurs->backBlue;
- FakeAllocColor(pmap, &maskColor);
- FakeFreeColor(pmap, sourceColor.pixel);
- FakeFreeColor(pmap, maskColor.pixel);
- (*infoPtr->SetCursorColors)(infoPtr->pScrn,
- maskColor.pixel, sourceColor.pixel);
- } else { /* Pass colors in 8-8-8 RGB format */
- (*infoPtr->SetCursorColors)(infoPtr->pScrn,
- (pCurs->backBlue >> 8) |
- ((pCurs->backGreen >> 8) << 8) |
- ((pCurs->backRed >> 8) << 16),
- (pCurs->foreBlue >> 8) |
- ((pCurs->foreGreen >> 8) << 8) |
- ((pCurs->foreRed >> 8) << 16)
- );
- }
-}
-
-/* These functions assume that MaxWidth is a multiple of 32 */
-static unsigned char*
-RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
-
- SCANLINE *SrcS, *SrcM, *DstS, *DstM;
- SCANLINE *pSrc, *pMsk;
- unsigned char *mem;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
- int SrcPitch, DstPitch, Pitch, y, x;
- /* how many words are in the source or mask */
- int words = size / (CUR_BITMAP_SCANLINE_PAD / 4);
-
-
- if (!(mem = xcalloc(1, size)))
- return NULL;
-
- if (pCurs == NullCursor) {
- if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
- DstM = (SCANLINE*)mem;
- if (!(infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK))
- DstM += words;
- (void)memset(DstM, -1, words * sizeof(SCANLINE));
- }
- return mem;
- }
-
- /* SrcPitch == the number of scanlines wide the cursor image is */
- SrcPitch = (pCurs->bits->width + (BITMAP_SCANLINE_PAD - 1)) >>
- CUR_LOG2_BITMAP_PAD;
-
- /* DstPitch is the width of the hw cursor in scanlines */
- DstPitch = infoPtr->MaxWidth >> CUR_LOG2_BITMAP_PAD;
- Pitch = SrcPitch < DstPitch ? SrcPitch : DstPitch;
-
- SrcS = (SCANLINE*)pCurs->bits->source;
- SrcM = (SCANLINE*)pCurs->bits->mask;
- DstS = (SCANLINE*)mem;
- DstM = DstS + words;
-
- if (infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) {
- SCANLINE *tmp;
- tmp = DstS; DstS = DstM; DstM = tmp;
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = SrcS[x] & SrcM[x];
- pMsk[x] = SrcM[x];
- }
- }
- } else {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = SrcS[x];
- pMsk[x] = SrcM[x];
- }
- }
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) {
- int count = size;
- unsigned char* pntr1 = (unsigned char *)DstS;
- unsigned char* pntr2 = (unsigned char *)DstM;
- unsigned char a, b;
- while (count) {
-
- a = *pntr1;
- b = *pntr2;
- *pntr1 = ((a & 0xF0) >> 4) | ((a & 0x0F) << 4);
- *pntr2 = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4);
- pntr1++; pntr2++;
- count-=2;
- }
- }
-
- /*
- * Must be _after_ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK to avoid wiping
- * out entire source mask.
- */
- if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
- int count = words;
- SCANLINE* pntr = DstM;
- while (count--) {
- *pntr = ~(*pntr);
- pntr++;
- }
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = REVERSE_BIT_ORDER(pSrc[x]);
- pMsk[x] = REVERSE_BIT_ORDER(pMsk[x]);
- }
- }
- }
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned char *DstS, *DstM;
- unsigned char *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = xcalloc(1, size))) {
- xfree(mem2);
- return NULL;
- }
-
- /* 1 bit interleave */
- DstS = mem2;
- DstM = DstS + (size >> 1);
- pntr = mem;
- count = size;
- while (count) {
- *pntr++ = ((*DstS&0x01) ) | ((*DstM&0x01) << 1) |
- ((*DstS&0x02) << 1) | ((*DstM&0x02) << 2) |
- ((*DstS&0x04) << 2) | ((*DstM&0x04) << 3) |
- ((*DstS&0x08) << 3) | ((*DstM&0x08) << 4);
- *pntr++ = ((*DstS&0x10) >> 4) | ((*DstM&0x10) >> 3) |
- ((*DstS&0x20) >> 3) | ((*DstM&0x20) >> 2) |
- ((*DstS&0x40) >> 2) | ((*DstM&0x40) >> 1) |
- ((*DstS&0x80) >> 1) | ((*DstM&0x80) );
- DstS++;
- DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- xfree(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned char *DstS, *DstM;
- unsigned char *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = xcalloc(1, size))) {
- xfree(mem2);
- return NULL;
- }
-
- /* 8 bit interleave */
- DstS = mem2;
- DstM = DstS + (size >> 1);
- pntr = mem;
- count = size;
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- xfree(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned short *DstS, *DstM;
- unsigned short *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = xcalloc(1, size))) {
- xfree(mem2);
- return NULL;
- }
-
- /* 16 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 2);
- pntr = (pointer)mem;
- count = (size >> 1);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- xfree(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- CARD32 *DstS, *DstM;
- CARD32 *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = xcalloc(1, size))) {
- xfree(mem2);
- return NULL;
- }
-
- /* 32 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 3);
- pntr = (pointer)mem;
- count = (size >> 2);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- xfree(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- CARD32 *DstS, *DstM;
- CARD32 *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = xcalloc(1, size))) {
- xfree(mem2);
- return NULL;
- }
-
- /* 64 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 3);
- pntr = (pointer)mem;
- count = (size >> 2);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- *pntr++ = *DstM++;
- count-=4;
- }
-
- /* Free the uninterleaved cursor */
- xfree(mem2);
-
- return mem;
-}
diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c
deleted file mode 100644
index b45be814d..000000000
--- a/hw/xfree86/ramdac/xf86RamDac.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Generic RAMDAC access routines.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.7 2003/11/03 05:11:53 tsi Exp $ */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-
-#include "xf86RamDacPriv.h"
-
-int RamDacHWPrivateIndex = -1;
-int RamDacScreenPrivateIndex = -1;
-
-RamDacRecPtr
-RamDacCreateInfoRec()
-{
- RamDacRecPtr infoRec;
-
- infoRec = xcalloc(1, sizeof(RamDacRec));
-
- return infoRec;
-}
-
-RamDacHelperRecPtr
-RamDacHelperCreateInfoRec()
-{
- RamDacHelperRecPtr infoRec;
-
- infoRec = xcalloc(1, sizeof(RamDacHelperRec));
-
- return infoRec;
-}
-
-void
-RamDacDestroyInfoRec(RamDacRecPtr infoRec)
-{
- xfree(infoRec);
-}
-
-void
-RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec)
-{
- xfree(infoRec);
-}
-
-Bool
-RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv)
-{
- RamDacScreenRecPtr ramdacScrPtr;
-
- /*
- * make sure the RamDacRec is allocated
- */
- if (!RamDacGetRec(pScrn))
- return FALSE;
- ramdacScrPtr =
- ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr);
- ramdacScrPtr->RamDacRec = ramdacPriv;
-
- return(TRUE);
-}
-
-void
-RamDacGetRecPrivate()
-{
- if (RamDacHWPrivateIndex < 0)
- RamDacHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
- if (RamDacScreenPrivateIndex < 0)
- RamDacScreenPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
- return;
-}
-
-Bool
-RamDacGetRec(ScrnInfoPtr scrp)
-{
- RamDacGetRecPrivate();
- /*
- * New privates are always set to NULL, so we can check if the allocation
- * has already been done.
- */
- if (scrp->privates[RamDacHWPrivateIndex].ptr != NULL)
- return TRUE;
- if (scrp->privates[RamDacScreenPrivateIndex].ptr != NULL)
- return TRUE;
-
- scrp->privates[RamDacHWPrivateIndex].ptr =
- xnfcalloc(sizeof(RamDacHWRec), 1);
- scrp->privates[RamDacScreenPrivateIndex].ptr =
- xnfcalloc(sizeof(RamDacScreenRec), 1);
-
- return TRUE;
-}
-
-void
-RamDacFreeRec(ScrnInfoPtr pScrn)
-{
- RamDacHWRecPtr ramdacHWPtr;
- RamDacScreenRecPtr ramdacScrPtr;
-
- if (RamDacHWPrivateIndex < 0)
- return;
-
- if (RamDacScreenPrivateIndex < 0)
- return;
-
- ramdacHWPtr = RAMDACHWPTR(pScrn);
- ramdacScrPtr = ((RamDacScreenRecPtr)
- (pScrn)->privates[RamDacGetScreenIndex()].ptr);
-
- if (ramdacHWPtr)
- xfree(ramdacHWPtr);
- ramdacHWPtr = NULL;
-
- if (ramdacScrPtr)
- xfree(ramdacScrPtr);
- ramdacScrPtr = NULL;
-}
-
-int
-RamDacGetHWIndex()
-{
- return RamDacHWPrivateIndex;
-}
-
-int
-RamDacGetScreenIndex()
-{
- return RamDacScreenPrivateIndex;
-}
diff --git a/hw/xfree86/ramdac/xf86RamDac.h b/hw/xfree86/ramdac/xf86RamDac.h
deleted file mode 100644
index 626a8b2b9..000000000
--- a/hw/xfree86/ramdac/xf86RamDac.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.h,v 1.11 2000/03/21 21:15:28 alanh Exp $ */
-
-#ifndef _XF86RAMDAC_H
-#define _XF86RAMDAC_H 1
-
-#include "colormapst.h"
-#include "xf86Cursor.h"
-
-/* Define unique vendor codes for RAMDAC's */
-#define VENDOR_IBM 0x0000
-#define VENDOR_BT 0x0001
-#define VENDOR_TI 0x0002
-
-typedef struct _RamDacRegRec {
-/* This is probably the nastiest assumption, we allocate 1024 slots for
- * ramdac registers, should be enough. I've checked IBM and TVP series
- * and they seem o.k
- * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME
- */
- unsigned short DacRegs[0x400]; /* register set */
- unsigned char DAC[0x300]; /* colour map */
- Bool Overlay;
-} RamDacRegRec, *RamDacRegRecPtr;
-
-typedef struct _RamDacHWRegRec {
- RamDacRegRec SavedReg;
- RamDacRegRec ModeReg;
-} RamDacHWRec, *RamDacHWRecPtr;
-
-typedef struct _RamDacRec {
- CARD32 RamDacType;
-
- void (*LoadPalette)(
- ScrnInfoPtr pScrn,
- int numColors,
- int *indices,
- LOCO *colors,
- VisualPtr pVisual
- );
-
- unsigned char (*ReadDAC)(
- ScrnInfoPtr pScrn,
- CARD32
- );
-
- void (*WriteDAC)(
- ScrnInfoPtr pScrn,
- CARD32,
- unsigned char,
- unsigned char
- );
-
- void (*WriteAddress)(
- ScrnInfoPtr pScrn,
- CARD32
- );
-
- void (*WriteData)(
- ScrnInfoPtr pScrn,
- unsigned char
- );
-
- void (*ReadAddress)(
- ScrnInfoPtr pScrn,
- CARD32
- );
-
- unsigned char (*ReadData)(
- ScrnInfoPtr pScrn
- );
-} RamDacRec, *RamDacRecPtr;
-
-typedef struct _RamDacHelperRec {
- CARD32 RamDacType;
-
- void (*Restore)(
- ScrnInfoPtr pScrn,
- RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg
- );
-
- void (*Save)(
- ScrnInfoPtr pScrn,
- RamDacRecPtr ramdacPtr,
- RamDacRegRecPtr ramdacReg
- );
-
- void (*SetBpp)(
- ScrnInfoPtr pScrn,
- RamDacRegRecPtr ramdacReg
- );
-
- void (*HWCursorInit)(
- xf86CursorInfoPtr infoPtr
- );
-} RamDacHelperRec, *RamDacHelperRecPtr;
-
-#define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
-
-typedef struct _RamdacScreenRec {
- RamDacRecPtr RamDacRec;
-} RamDacScreenRec, *RamDacScreenRecPtr;
-#define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
-
-extern int RamDacHWPrivateIndex;
-extern int RamDacScreenPrivateIndex;
-
-typedef struct {
- int token;
-} RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
-
-RamDacRecPtr RamDacCreateInfoRec(void);
-RamDacHelperRecPtr RamDacHelperCreateInfoRec(void);
-void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec);
-void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec);
-Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec);
-void RamDacSetGamma(ScrnInfoPtr pScrn, Bool Real8BitDac);
-void RamDacRestoreDACValues(ScrnInfoPtr pScrn);
-Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
- unsigned int flags);
-void RamDacFreeRec(ScrnInfoPtr pScrn);
-int RamDacGetHWIndex(void);
-
-#endif /* _XF86RAMDAC_H */
diff --git a/hw/xfree86/ramdac/xf86RamDacCmap.c b/hw/xfree86/ramdac/xf86RamDacCmap.c
deleted file mode 100644
index 3b01081df..000000000
--- a/hw/xfree86/ramdac/xf86RamDacCmap.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Generic RAMDAC access to colormaps.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacCmap.c,v 1.7 2000/07/26 01:52:24 tsi Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "windowstr.h"
-#include "mipointer.h"
-#include "micmap.h"
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-#include "colormapst.h"
-#include "xf86RamDacPriv.h"
-
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-
-void
-RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
- VisualPtr pVisual)
-{
- RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
- int i, index;
-
- for (i = 0; i < numColors; i++) {
- index = indices[i];
- (*hwp->WriteAddress)(pScrn, index);
- (*hwp->WriteData)(pScrn, colors[index].red);
- (*hwp->WriteData)(pScrn, colors[index].green);
- (*hwp->WriteData)(pScrn, colors[index].blue);
- }
-}
-
-Bool
-RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
- unsigned int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
-
- if (hwp->LoadPalette == NULL)
- return xf86HandleColormaps(pScreen, maxColors, sigRGBbits,
- RamDacLoadPalette, NULL, flags);
- else
- return xf86HandleColormaps(pScreen, maxColors, sigRGBbits,
- hwp->LoadPalette, NULL, flags);
-}
diff --git a/hw/xfree86/ramdac/xf86RamDacMod.c b/hw/xfree86/ramdac/xf86RamDacMod.c
deleted file mode 100644
index 754949606..000000000
--- a/hw/xfree86/ramdac/xf86RamDacMod.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Generic RAMDAC module.
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacMod.c,v 1.6 1999/01/26 05:54:18 dawes Exp $ */
-
-#include "xf86Module.h"
-
-
-static XF86ModuleVersionInfo VersRec = {
- "ramdac",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 0, 1, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0, 0, 0, 0}
-};
-
-XF86ModuleData ramdacModuleData = { &VersRec, NULL, NULL };
-
diff --git a/hw/xfree86/ramdac/xf86RamDacPriv.h b/hw/xfree86/ramdac/xf86RamDacPriv.h
deleted file mode 100644
index f1eeb3a7d..000000000
--- a/hw/xfree86/ramdac/xf86RamDacPriv.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacPriv.h,v 1.4 1999/07/18 03:27:02 dawes Exp $ */
-
-#include "xf86RamDac.h"
-#include "xf86cmap.h"
-
-void RamDacGetRecPrivate(void);
-Bool RamDacGetRec(ScrnInfoPtr pScrn);
-int RamDacGetScreenIndex(void);
-void RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
- LOCO *colors, VisualPtr pVisual);
diff --git a/hw/xfree86/scanpci/extrapci.ids b/hw/xfree86/scanpci/extrapci.ids
deleted file mode 100644
index 32d96cec8..000000000
--- a/hw/xfree86/scanpci/extrapci.ids
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Modifications and additions to the standard list of PCI IDs in
-# pci.ids.
-#
-# To modify an entry, simply add the modified version here.
-# To leave part of an entry unchanged, use '"' for the name
-# (e.g., leave the vendor name unchanged while adding/modifying
-# a device). To delete an entry, set the name to '-'.
-#
-# One syntax extension is allowing a 16-bit class value to be
-# specified for a device (see the syntax description below).
-#
-# Don't make gratuitous changes, and please send back
-# changes/additions that aren't XFree86-specific to the pciids
-# project (http://pciids.sf.net/).
-#
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.10 2003/10/30 15:29:32 tsi Exp $
-#
-
-# Vendors, devices and subsystems. Please keep sorted.
-
-# Syntax:
-# vendor vendor_name
-# device device_name <-- single tab
-# C class <-- two tabs
-# subvendor subdevice subsystem_name <-- two tabs
-#
-# Use lower-case hex digits for all numeric values.
-
-# Example: Add a new chipset for vendor who's ID is xyzw
-#
-# xyzw "
-# 20ce New Chipset Description
-
-103c "
- 12b4 zx1 QuickSilver AGP8x LBA
-
-1102 "
- 0002 "
- C 0401
-
-126f "
- 0730 SM731 Cougar3DR
-
diff --git a/hw/xfree86/scanpci/pci.ids b/hw/xfree86/scanpci/pci.ids
deleted file mode 100644
index 0d6a460f3..000000000
--- a/hw/xfree86/scanpci/pci.ids
+++ /dev/null
@@ -1,7442 +0,0 @@
-#
-# List of PCI ID's
-#
-# Maintained by Martin Mares <mj@ucw.cz> and other volunteers from the
-# Linux PCI ID's Project at http://pciids.sf.net/. New data are always
-# welcome (if they are accurate), we're eagerly expecting new entries,
-# so if you have anything to contribute, please visit the home page or
-# send a diff -u against the most recent pci.ids to pci-ids@ucw.cz.
-#
-# Daily snapshot on Wed 2003-05-14 10:00:04
-#
-
-# Vendors, devices and subsystems. Please keep sorted.
-
-# Syntax:
-# vendor vendor_name
-# device device_name <-- single tab
-# subvendor subdevice subsystem_name <-- two tabs
-
-0000 Gammagraphx, Inc.
-001a Ascend Communications, Inc.
-0033 Paradyne corp.
-003d Lockheed Martin-Marietta Corp
-# Real TJN ID is e159, but they got it wrong several times --mj
-0059 Tiger Jet Network Inc. (Wrong ID)
-0070 Hauppauge computer works Inc.
-0100 Ncipher Corp Ltd
-0675 Dynalink
- 1700 IS64PH ISDN Adapter
- 1702 IS64PH ISDN Adapter
-# Wrong ID used in subsystem ID of VIA USB controllers.
-0925 VIA Technologies, Inc. (Wrong ID)
-09c1 Arris
- 0704 CM 200E Cable Modem
-0a89 BREA Technologies Inc
-0e11 Compaq Computer Corporation
- 0001 PCI to EISA Bridge
- 0002 PCI to ISA Bridge
- 0049 NC7132 Gigabit Upgrade Module
- 004a NC6136 Gigabit Server Adapter
- 0508 Netelligent 4/16 Token Ring
- 1000 Triflex/Pentium Bridge, Model 1000
- 2000 Triflex/Pentium Bridge, Model 2000
- 3032 QVision 1280/p
- 3033 QVision 1280/p
- 3034 QVision 1280/p
- 4000 4000 [Triflex]
- 6010 HotPlug PCI Bridge 6010
- 7020 USB Controller
- a0ec Fibre Channel Host Controller
- a0f0 Advanced System Management Controller
- a0f3 Triflex PCI to ISA Bridge
- a0f7 PCI Hotplug Controller
- 8086 002a PCI Hotplug Controller A
- 8086 002b PCI Hotplug Controller B
- a0f8 ZFMicro Chipset USB
- a0fc Fibre Channel Host Controller
- ae10 Smart-2/P RAID Controller
- 0e11 4030 Smart-2/P Array Controller
- 0e11 4031 Smart-2SL Array Controller
- 0e11 4032 Smart Array Controller
- 0e11 4033 Smart 3100ES Array Controller
- ae29 MIS-L
- ae2a MPC
- ae2b MIS-E
- ae31 System Management Controller
- ae32 Netelligent 10/100
- ae33 Triflex Dual EIDE Controller
- ae34 Netelligent 10
- ae35 Integrated NetFlex-3/P
- ae40 Netelligent 10/100 Dual
- ae43 ProLiant Integrated Netelligent 10/100
- ae69 CETUS-L
- ae6c Northstar
- ae6d NorthStar CPU to PCI Bridge
- b011 Integrated Netelligent 10/100
- b012 Netelligent 10 T/2
- b01e NC3120 Fast Ethernet NIC
- b01f NC3122 Fast Ethernet NIC
- b02f NC1120 Ethernet NIC
- b030 Netelligent WS 5100
- b04a 10/100 TX PCI Intel WOL UTP Controller
- b060 Smart Array 5300 Controller
- b0c6 NC3161 Fast Ethernet NIC
- b0c7 NC3160 Fast Ethernet NIC
- b0d7 NC3121 Fast Ethernet NIC
- b0dd NC3131 Fast Ethernet NIC
- b0de NC3132 Fast Ethernet Module
- b0df NC6132 Gigabit Module
- b0e0 NC6133 Gigabit Module
- b0e1 NC3133 Fast Ethernet Module
- b123 NC6134 Gigabit NIC
- b134 NC3163 Fast Ethernet NIC
- b13c NC3162 Fast Ethernet NIC
- b144 NC3123 Fast Ethernet NIC
- b163 NC3134 Fast Ethernet NIC
- b164 NC3165 Fast Ethernet Upgrade Module
- b178 Smart Array 5i/532
- b1a4 NC7131 Gigabit Server Adapter
- f130 NetFlex-3/P ThunderLAN 1.0
- f150 NetFlex-3/P ThunderLAN 2.3
-0e55 HaSoTec GmbH
-# Formerly NCR
-1000 LSI Logic / Symbios Logic
- 0001 53c810
- 1000 1000 8100S
- 0002 53c820
- 0003 53c825
- 0004 53c815
- 0005 53c810AP
- 0006 53c860
- 000a 53c1510
- 000b 53c896
- 000c 53c895
- 1de1 3907 DC-390U2W
- 000d 53c885
- 000f 53c875
- 0e11 7004 Embedded Ultra Wide SCSI Controller
- 1092 8760 FirePort 40 Dual SCSI Controller
- 1de1 3904 DC390F Ultra Wide SCSI Controller
- 0010 53c895
- 0e11 4040 Integrated Array Controller
- 0e11 4048 Integrated Array Controller
- 0012 53c895a
- 0013 53c875a
- 0020 53c1010 Ultra3 SCSI Adapter
- 1de1 1020 DC-390U3W
- 0021 53c1010 66MHz Ultra3 SCSI Adapter
- 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
- 1028 1010 LSI U320 SCSI Controller
- 0040 53c1035
- 008f 53c875J
- 1092 8000 FirePort 40 SCSI Controller
- 1092 8760 FirePort 40 Dual SCSI Host Adapter
- 0621 FC909
- 0622 FC929
- 0623 FC929 LAN
- 0624 FC919
- 0625 FC919 LAN
- 0626 FC929X
- 0627 FC929X LAN
- 0628 FC919X
- 0629 FC919X LAN
- 0701 83C885 NT50 DigitalScape Fast Ethernet
- 0702 Yellowfin G-NIC gigabit ethernet
- 1318 0000 PEI100X
- 0901 61C102
- 1000 63C815
- 1960 PowerEdge Expandable RAID Controller 4
- 1028 0518 PowerEdge Expandable RAID Controller 4/DC
- 1028 0520 PowerEdge Expandable RAID Controller 4/SC
- 1028 0531 PowerEdge Expandable RAID Controller 4/QC
-1001 Kolter Electronic
- 0010 PCI 1616 Measurement card with 32 digital I/O lines
- 0011 OPTO-PCI Opto-Isolated digital I/O board
- 0012 PCI-AD/DA Analogue I/O board
- 0013 PCI-OPTO-RELAIS Digital I/O board with relay outputs
- 0014 PCI-Counter/Timer Counter Timer board
- 0015 PCI-DAC416 Analogue output board
- 0016 PCI-MFB Analogue I/O board
- 0017 PROTO-3 PCI Prototyping board
- 9100 INI-9100/9100W SCSI Host
-1002 ATI Technologies Inc
- 4136 Radeon IGP 320 M
-# New support forthcoming in XFree86 4.3.0
- 4144 Radeon R300 AD [Radeon 9500 Pro]
-# New support forthcoming in XFree86 4.3.0
- 4145 Radeon R300 AE [Radeon 9500 Pro]
-# New support forthcoming in XFree86 4.3.0
- 4146 Radeon R300 AF [Radeon 9500 Pro]
-# Update: Oops, AF was a typo above for 4147, should be AG
- 4147 Radeon R300 AG [FireGL Z1/X1]
- 4158 68800AX [Mach32]
- 4242 Radeon R200 BB [Radeon All in Wonder 8500DV]
- 1002 02aa Radeon 8500 AIW DV Edition
- 4336 Radeon Mobility U1
- 4337 Radeon IGP 340M
- 4354 215CT [Mach64 CT]
- 4358 210888CX [Mach64 CX]
- 4554 210888ET [Mach64 ET]
- 4654 Mach64 VT
- 4742 3D Rage Pro AGP 1X/2X
- 1002 0040 Rage Pro Turbo AGP 2X
- 1002 0044 Rage Pro Turbo AGP 2X
- 1002 0061 Rage Pro AIW AGP 2X
- 1002 0062 Rage Pro AIW AGP 2X
- 1002 0063 Rage Pro AIW AGP 2X
- 1002 0080 Rage Pro Turbo AGP 2X
- 1002 0084 Rage Pro Turbo AGP 2X
- 1002 4742 Rage Pro Turbo AGP 2X
- 1002 8001 Rage Pro Turbo AGP 2X
- 1028 0082 Rage Pro Turbo AGP 2X
- 1028 4082 Optiplex GX1 Onboard Display Adapter
- 1028 8082 Rage Pro Turbo AGP 2X
- 1028 c082 Rage Pro Turbo AGP 2X
- 8086 4152 Xpert 98D AGP 2X
- 8086 464a Rage Pro Turbo AGP 2X
- 4744 3D Rage Pro AGP 1X
- 1002 4744 Rage Pro Turbo AGP
- 4747 3D Rage Pro
- 4749 3D Rage Pro
- 1002 0061 Rage Pro AIW
- 1002 0062 Rage Pro AIW
- 474c Rage XC
- 474d Rage XL AGP 2X
- 1002 0004 Xpert 98 RXL AGP 2X
- 1002 0008 Xpert 98 RXL AGP 2X
- 1002 0080 Rage XL AGP 2X
- 1002 0084 Xpert 98 AGP 2X
- 1002 474d Rage XL AGP
- 1033 806a Rage XL AGP
- 474e Rage XC AGP
- 1002 474e Rage XC AGP
- 474f Rage XL
- 1002 0008 Rage XL
- 1002 474f Rage XL
- 4750 3D Rage Pro 215GP
- 1002 0040 Rage Pro Turbo
- 1002 0044 Rage Pro Turbo
- 1002 0080 Rage Pro Turbo
- 1002 0084 Rage Pro Turbo
- 1002 4750 Rage Pro Turbo
- 4751 3D Rage Pro 215GQ
- 4752 Rage XL
- 1002 0008 Rage XL
- 1002 4752 Rage XL
- 1002 8008 Rage XL
- 1028 00d1 PowerEdge 2550
- 4753 Rage XC
- 1002 4753 Rage XC
- 4754 3D Rage I/II 215GT [Mach64 GT]
- 4755 3D Rage II+ 215GTB [Mach64 GTB]
- 4756 3D Rage IIC 215IIC [Mach64 GT IIC]
- 1002 4756 Rage IIC
- 4757 3D Rage IIC AGP
- 1002 4757 Rage IIC AGP
- 1028 0089 Rage 3D IIC
- 1028 4082 Rage 3D IIC
- 1028 8082 Rage 3D IIC
- 1028 c082 Rage 3D IIC
- 4758 210888GX [Mach64 GX]
- 4759 3D Rage IIC
- 475a 3D Rage IIC AGP
- 1002 0087 Rage 3D IIC
- 1002 475a Rage IIC AGP
- 4964 Radeon R250 Id [Radeon 9000]
- 4965 Radeon R250 Ie [Radeon 9000]
- 4966 Radeon R250 If [Radeon 9000]
- 10f1 0002 R250 If [Tachyon G9000 PRO]
- 148c 2039 R250 If [Radeon 9000 Pro "Evil Commando"]
- 1509 9a00 R250 If [Radeon 9000 "AT009"]
-# New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified.
- 1681 0040 R250 If [3D prophet 9000]
- 174b 7176 R250 If [Sapphire Radeon 9000 Pro]
- 174b 7192 R250 If [Radeon 9000 "Atlantis"]
- 17af 2005 R250 If [Excalibur Radeon 9000 Pro]
- 17af 2006 R250 If [Excalibur Radeon 9000]
- 4967 Radeon R250 Ig [Radeon 9000]
- 496e Radeon R250 [Radeon 9000] (Secondary)
- 4c42 3D Rage LT Pro AGP-133
- 0e11 b0e8 Rage 3D LT Pro
- 0e11 b10e 3D Rage LT Pro (Compaq Armada 1750)
- 1002 0040 Rage LT Pro AGP 2X
- 1002 0044 Rage LT Pro AGP 2X
- 1002 4c42 Rage LT Pro AGP 2X
- 1002 8001 Rage LT Pro AGP 2X
- 1028 0085 Rage 3D LT Pro
- 4c44 3D Rage LT Pro AGP-66
- 4c45 Rage Mobility M3 AGP
- 4c46 Rage Mobility M3 AGP 2x
- 4c47 3D Rage LT-G 215LG
- 4c49 3D Rage LT Pro
- 1002 0004 Rage LT Pro
- 1002 0040 Rage LT Pro
- 1002 0044 Rage LT Pro
- 1002 4c49 Rage LT Pro
- 4c4d Rage Mobility P/M AGP 2x
- 0e11 b111 Armada M700
- 1002 0084 Xpert 98 AGP 2X (Mobility)
- 1014 0154 ThinkPad A20m
- 4c4e Rage Mobility L AGP 2x
- 4c50 3D Rage LT Pro
- 1002 4c50 Rage LT Pro
- 4c51 3D Rage LT Pro
- 4c52 Rage Mobility P/M
- 4c53 Rage Mobility L
- 4c54 264LT [Mach64 LT]
- 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500]
- 1014 0517 ThinkPad T30
- 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100)
- 144d c006 Radeon Mobility M7 LW in vpr Matrix 170B4
-# Update: More correct labelling for this FireGL chipset
- 4c58 Radeon RV200 LX [Mobility FireGL 7800 M7]
- 4c59 Radeon Mobility M6 LY
- 1014 0235 ThinkPad A30p (2653-64G)
- 1014 0239 ThinkPad X22/X23/X24
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 4c5a Radeon Mobility M6 LZ
-# Update: Add M9 to product name
- 4c64 Radeon R250 Ld [Radeon Mobility 9000 M9]
-# Update: Add M9 to product name
- 4c65 Radeon R250 Le [Radeon Mobility 9000 M9]
-# Update: Add M9 to product name
- 4c66 Radeon R250 Lf [Radeon Mobility 9000 M9]
-# Update: Add M9 to product name
- 4c67 Radeon R250 Lg [Radeon Mobility 9000 M9]
- 4d46 Rage Mobility M4 AGP
- 4d4c Rage Mobility M4 AGP
- 4e44 Radeon R300 ND [Radeon 9700 Pro]
- 4e45 Radeon R300 NE [Radeon 9500 Pro]
- 1002 0002 Radeon R300 NE [Radeon 9500 Pro]
- 4e46 Radeon R300 NF [Radeon 9700]
-# Update: This is FireGL X1, not Radeon 9700
- 4e47 Radeon R300 NG [FireGL X1]
- 4e48 Radeon R350 [Radeon 9800]
- 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary)
- 4e65 Radeon R300 [Radeon 9500 Pro] (Secondary)
- 4e66 Radeon R300 [Radeon 9700] (Secondary)
- 4e67 Radeon R300 [FireGL X1] (Secondary)
- 4e68 Radeon R350 [Radeon 9800] (Secondary)
- 5041 Rage 128 PA/PRO
- 5042 Rage 128 PB/PRO AGP 2x
- 5043 Rage 128 PC/PRO AGP 4x
- 5044 Rage 128 PD/PRO TMDS
- 1002 0028 Rage 128 AIW
- 1002 0029 Rage 128 AIW
- 5045 Rage 128 PE/PRO AGP 2x TMDS
- 5046 Rage 128 PF/PRO AGP 4x TMDS
- 1002 0004 Rage Fury Pro
- 1002 0008 Rage Fury Pro/Xpert 2000 Pro
- 1002 0014 Rage Fury Pro
- 1002 0018 Rage Fury Pro/Xpert 2000 Pro
- 1002 0028 Rage 128 Pro AIW AGP
- 1002 002a Rage 128 Pro AIW AGP
- 1002 0048 Rage Fury Pro
- 1002 2000 Rage Fury MAXX AGP 4x (TMDS) (VGA device)
- 1002 2001 Rage Fury MAXX AGP 4x (TMDS) (Extra device?!)
- 5047 Rage 128 PG/PRO
- 5048 Rage 128 PH/PRO AGP 2x
- 5049 Rage 128 PI/PRO AGP 4x
- 504a Rage 128 PJ/PRO TMDS
- 504b Rage 128 PK/PRO AGP 2x TMDS
- 504c Rage 128 PL/PRO AGP 4x TMDS
- 504d Rage 128 PM/PRO
- 504e Rage 128 PN/PRO AGP 2x
- 504f Rage 128 PO/PRO AGP 4x
- 5050 Rage 128 PP/PRO TMDS [Xpert 128]
- 1002 0008 Xpert 128
- 5051 Rage 128 PQ/PRO AGP 2x TMDS
- 5052 Rage 128 PR/PRO AGP 4x TMDS
- 5053 Rage 128 PS/PRO
- 5054 Rage 128 PT/PRO AGP 2x
- 5055 Rage 128 PU/PRO AGP 4x
- 5056 Rage 128 PV/PRO TMDS
- 5057 Rage 128 PW/PRO AGP 2x TMDS
- 5058 Rage 128 PX/PRO AGP 4x TMDS
-# Update: This same chip is used in all 32Mb and 64Mb SDR/DDR orig Radeons, and is now known as 7200
- 5144 Radeon R100 QD [Radeon 7200]
- 1002 0008 Radeon 7000/Radeon VE
- 1002 0009 Radeon 7000/Radeon
- 1002 000a Radeon 7000/Radeon
- 1002 001a Radeon 7000/Radeon
- 1002 0029 Radeon AIW
- 1002 0038 Radeon 7000/Radeon
- 1002 0039 Radeon 7000/Radeon
- 1002 008a Radeon 7000/Radeon
- 1002 00ba Radeon 7000/Radeon
- 1002 0139 Radeon 7000/Radeon
- 1002 028a Radeon 7000/Radeon
- 1002 02aa Radeon AIW
- 1002 053a Radeon 7000/Radeon
- 5145 Radeon R100 QE
- 5146 Radeon R100 QF
- 5147 Radeon R100 QG
- 5148 Radeon R200 QH [Radeon 8500]
- 1002 010a FireGL 8800 64Mb
- 1002 0152 FireGL 8800 128Mb
- 1002 0162 FireGL 8700 32Mb
- 1002 0172 FireGL 8700 64Mb
- 5149 Radeon R200 QI
- 514a Radeon R200 QJ
- 514b Radeon R200 QK
- 514c Radeon R200 QL [Radeon 8500 LE]
- 1002 003a Radeon R200 QL [Radeon 8500 LE]
- 1002 013a Radeon 8500
- 148c 2026 R200 QL [Radeon 8500 Evil Master II Multi Display Edition]
- 174b 7149 Radeon R200 QL [Sapphire Radeon 8500 LE]
-# New: Radeon 9100 is basically a Radeon 8500LE branded as 9100 by Sapphire
- 514d Radeon R200 QM [Radeon 9100]
-# New: Radeon 8500LE chip
- 514e Radeon R200 QN [Radeon 8500LE]
-# New: Radeon 8500LE chip
- 514f Radeon R200 QO [Radeon 8500LE]
- 5157 Radeon RV200 QW [Radeon 7500]
- 1002 013a Radeon 7500
- 1458 4000 RV200 QW [RADEON 7500 PRO MAYA AR]
- 148c 2024 RV200 QW [Radeon 7500LE Dual Display]
- 148c 2025 RV200 QW [Radeon 7500 Evil Master Multi Display Edition]
- 148c 2036 RV200 QW [Radeon 7500 PCI Dual Display]
- 174b 7147 RV200 QW [Sapphire Radeon 7500LE]
- 174b 7161 Radeon RV200 QW [Radeon 7500 LE]
- 17af 0202 RV200 QW [Excalibur Radeon 7500LE]
- 5158 Radeon RV200 QX [Radeon 7500]
-# Update: More correct name
- 5159 Radeon RV100 QY [Radeon 7000/VE]
- 1002 000a Radeon 7000/Radeon VE
- 1002 000b Radeon 7000
- 1002 0038 Radeon 7000/Radeon VE
- 1002 003a Radeon 7000/Radeon VE
- 1002 00ba Radeon 7000/Radeon VE
- 1002 013a Radeon 7000/Radeon VE
- 1458 4002 RV100 QY [RADEON 7000 PRO MAYA AV Series]
- 148c 2003 RV100 QY [Radeon 7000 Multi-Display Edition]
- 148c 2023 RV100 QY [Radeon 7000 Evil Master Multi-Display]
- 174b 7112 RV100 QY [Sapphire Radeon VE 7000]
- 1787 0202 RV100 QY [Excalibur Radeon 7000]
-# Update: More correct name
- 515a Radeon RV100 QZ [Radeon 7000/VE]
- 5168 Radeon R200 Qh
- 5169 Radeon R200 Qi
- 516a Radeon R200 Qj
- 516b Radeon R200 Qk
-# new: This one is not in ATI documentation, but is in XFree86 source code
- 516c Radeon R200 Ql
- 5245 Rage 128 RE/SG
- 1002 0008 Xpert 128
- 1002 0028 Rage 128 AIW
- 1002 0029 Rage 128 AIW
- 1002 0068 Rage 128 AIW
- 5246 Rage 128 RF/SG AGP
- 1002 0004 Magnum/Xpert 128/Xpert 99
- 1002 0008 Magnum/Xpert128/X99/Xpert2000
- 1002 0028 Rage 128 AIW AGP
- 1002 0044 Rage Fury/Xpert 128/Xpert 2000
- 1002 0068 Rage 128 AIW AGP
- 1002 0448 Rage Fury
- 5247 Rage 128 RG
- 524b Rage 128 RK/VR
- 524c Rage 128 RL/VR AGP
- 1002 0008 Xpert 99/Xpert 2000
- 1002 0088 Xpert 99
- 5345 Rage 128 SE/4x
- 5346 Rage 128 SF/4x AGP 2x
- 1002 0048 RAGE 128 16MB VGA TVOUT AMC PAL
- 5347 Rage 128 SG/4x AGP 4x
- 5348 Rage 128 SH
- 534b Rage 128 SK/4x
- 534c Rage 128 SL/4x AGP 2x
- 534d Rage 128 SM/4x AGP 4x
- 1002 0008 Xpert 99/Xpert 2000
- 1002 0018 Xpert 2000
- 534e Rage 128 4x
- 5354 Mach 64 VT
- 1002 5654 Mach 64 reference
- 5446 Rage 128 Pro Ultra TF
- 1002 0004 Rage Fury Pro
- 1002 0008 Rage Fury Pro/Xpert 2000 Pro
- 1002 0018 Rage Fury Pro/Xpert 2000 Pro
- 1002 0028 Rage 128 AIW Pro AGP
- 1002 0029 Rage 128 AIW
- 1002 002a Rage 128 AIW Pro AGP
- 1002 002b Rage 128 AIW
- 1002 0048 Xpert 2000 Pro
- 544c Rage 128 Pro Ultra TL
- 5452 Rage 128 Pro Ultra TR
- 1002 001c Rage 128 Pro 4XL
- 103c 1279 Rage 128 Pro 4XL
- 5453 Rage 128 Pro Ultra TS
- 5454 Rage 128 Pro Ultra TT
- 5455 Rage 128 Pro Ultra TU
- 5654 264VT [Mach64 VT]
- 1002 5654 Mach64VT Reference
- 5655 264VT3 [Mach64 VT3]
- 5656 264VT4 [Mach64 VT4]
- 700f PCI Bridge [IGP 320M]
- 7010 PCI Bridge [IGP 340M]
- cab2 RS200/RS200M AGP Bridge [IGP 340M]
-1003 ULSI Systems
- 0201 US201
-1004 VLSI Technology Inc
- 0005 82C592-FC1
- 0006 82C593-FC1
- 0007 82C594-AFC2
- 0008 82C596/7 [Wildcat]
- 0009 82C597-AFC2
- 000c 82C541 [Lynx]
- 000d 82C543 [Lynx]
- 0101 82C532
- 0102 82C534 [Eagle]
- 0103 82C538
- 0104 82C535
- 0105 82C147
- 0200 82C975
- 0280 82C925
- 0304 QSound ThunderBird PCI Audio
- 1004 0304 QSound ThunderBird PCI Audio
- 122d 1206 DSP368 Audio
- 1483 5020 XWave Thunder 3D Audio
- 0305 QSound ThunderBird PCI Audio Gameport
- 1004 0305 QSound ThunderBird PCI Audio Gameport
- 122d 1207 DSP368 Audio Gameport
- 1483 5021 XWave Thunder 3D Audio Gameport
- 0306 QSound ThunderBird PCI Audio Support Registers
- 1004 0306 QSound ThunderBird PCI Audio Support Registers
- 122d 1208 DSP368 Audio Support Registers
- 1483 5022 XWave Thunder 3D Audio Support Registers
- 0307 Thunderbird
- 0308 Thunderbird
- 0702 VAS96011 [Golden Gate II]
- 0703 Tollgate
-1005 Avance Logic Inc. [ALI]
- 2064 ALG2032/2064
- 2128 ALG2364A
- 2301 ALG2301
- 2302 ALG2302
- 2364 ALG2364
- 2464 ALG2364A
- 2501 ALG2564A/25128A
-1006 Reply Group
-1007 NetFrame Systems Inc
-1008 Epson
-100a Phoenix Technologies
-100b National Semiconductor Corporation
- 0001 DP83810
- 0002 87415/87560 IDE
- 000e 87560 Legacy I/O
- 000f FireWire Controller
- 0011 NS87560 National PCI System I/O
- 0012 USB Controller
- 0020 DP83815 (MacPhyter) Ethernet Controller
- 0022 DP83820 10/100/1000 Ethernet Controller
- 0500 SCx200 Bridge
- 0501 SCx200 SMI
- 0502 SCx200 IDE
- 0503 SCx200 Audio
- 0504 SCx200 Video
- 0505 SCx200 XBus
- d001 87410 IDE
-100c Tseng Labs Inc
- 3202 ET4000/W32p rev A
- 3205 ET4000/W32p rev B
- 3206 ET4000/W32p rev C
- 3207 ET4000/W32p rev D
- 3208 ET6000
- 4702 ET6300
-100d AST Research Inc
-100e Weitek
- 9000 P9000 Viper
- 9001 P9000 Viper
- 9002 P9000 Viper
- 9100 P9100 Viper Pro/SE
-1010 Video Logic, Ltd.
-1011 Digital Equipment Corporation
- 0001 DECchip 21050
- 0002 DECchip 21040 [Tulip]
- 0004 DECchip 21030 [TGA]
- 0007 NVRAM [Zephyr NVRAM]
- 0008 KZPSA [KZPSA]
- 0009 DECchip 21140 [FasterNet]
- 1025 0310 21140 Fast Ethernet
- 10b8 2001 SMC9332BDT EtherPower 10/100
- 10b8 2002 SMC9332BVT EtherPower T4 10/100
- 10b8 2003 SMC9334BDT EtherPower 10/100 (1-port)
- 1109 2400 ANA-6944A/TX Fast Ethernet
- 1112 2300 RNS2300 Fast Ethernet
- 1112 2320 RNS2320 Fast Ethernet
- 1112 2340 RNS2340 Fast Ethernet
- 1113 1207 EN-1207-TX Fast Ethernet
- 1186 1100 DFE-500TX Fast Ethernet
- 1186 1112 DFE-570TX Fast Ethernet
- 1186 1140 DFE-660 Cardbus Ethernet 10/100
- 1186 1142 DFE-660 Cardbus Ethernet 10/100
- 11f6 0503 Freedomline Fast Ethernet
- 1282 9100 AEF-380TXD Fast Ethernet
- 1385 1100 FA310TX Fast Ethernet
- 2646 0001 KNE100TX Fast Ethernet
- 000a 21230 Video Codec
- 000d PBXGB [TGA2]
- 000f DEFPA
- 0014 DECchip 21041 [Tulip Pass 3]
- 1186 0100 DE-530+
- 0016 DGLPB [OPPO]
- 0017 PV-PCI Graphics Controller (ZLXp-L)
- 0019 DECchip 21142/43
- 1011 500a DE500A Fast Ethernet
- 1011 500b DE500B Fast Ethernet
- 1014 0001 10/100 EtherJet Cardbus
- 1025 0315 ALN315 Fast Ethernet
- 1033 800c PC-9821-CS01 100BASE-TX Interface Card
- 1033 800d PC-9821NR-B06 100BASE-TX Interface Card
- 108d 0016 Rapidfire 2327 10/100 Ethernet
- 108d 0017 GoCard 2250 Ethernet 10/100 Cardbus
- 10b8 2005 SMC8032DT Extreme Ethernet 10/100
- 10b8 8034 SMC8034 Extreme Ethernet 10/100
- 10ef 8169 Cardbus Fast Ethernet
- 1109 2a00 ANA-6911A/TX Fast Ethernet
- 1109 2b00 ANA-6911A/TXC Fast Ethernet
- 1109 3000 ANA-6922/TX Fast Ethernet
- 1113 1207 Cheetah Fast Ethernet
- 1113 2220 Cardbus Fast Ethernet
- 115d 0002 Cardbus Ethernet 10/100
- 1179 0203 Fast Ethernet
- 1179 0204 Cardbus Fast Ethernet
- 1186 1100 DFE-500TX Fast Ethernet
- 1186 1101 DFE-500TX Fast Ethernet
- 1186 1102 DFE-500TX Fast Ethernet
- 1259 2800 AT-2800Tx Fast Ethernet
- 1266 0004 Eagle Fast EtherMAX
- 12af 0019 NetFlyer Cardbus Fast Ethernet
- 1374 0001 Cardbus Ethernet Card 10/100
- 1374 0002 Cardbus Ethernet Card 10/100
- 1374 0007 Cardbus Ethernet Card 10/100
- 1374 0008 Cardbus Ethernet Card 10/100
- 1385 2100 FA510
- 1395 0001 10/100 Ethernet CardBus PC Card
- 13d1 ab01 EtherFast 10/100 Cardbus (PCMPC200)
- 8086 0001 EtherExpress PRO/100 Mobile CardBus 32
- 001a Farallon PN9000SX
- 0021 DECchip 21052
- 0022 DECchip 21150
- 0023 DECchip 21150
- 0024 DECchip 21152
- 0025 DECchip 21153
- 0026 DECchip 21154
- 0034 56k Modem Cardbus
- 1374 0003 56k Modem Cardbus
- 0045 DECchip 21553
- 0046 DECchip 21554
- 0e11 4050 Integrated Smart Array
- 0e11 4051 Integrated Smart Array
- 0e11 4058 Integrated Smart Array
- 103c 10c2 Hewlett-Packard NetRAID-4M
- 12d9 000a VoIP PCI Gateway
- 9005 0365 Adaptec 5400S
- 9005 1364 Dell PowerEdge RAID Controller 2
- 9005 1365 Dell PowerEdge RAID Controller 2
- e4bf 1000 CC8-1-BLUES
- 1065 StrongARM DC21285
- 1069 0020 DAC960P / DAC1164P
-1012 Micronics Computers Inc
-1013 Cirrus Logic
- 0038 GD 7548
- 0040 GD 7555 Flat Panel GUI Accelerator
- 004c GD 7556 Video/Graphics LCD/CRT Ctrlr
- 00a0 GD 5430/40 [Alpine]
- 00a2 GD 5432 [Alpine]
- 00a4 GD 5434-4 [Alpine]
- 00a8 GD 5434-8 [Alpine]
- 00ac GD 5436 [Alpine]
- 00b0 GD 5440
- 00b8 GD 5446
- 00bc GD 5480
- 1013 00bc CL-GD5480
- 00d0 GD 5462
- 00d2 GD 5462 [Laguna I]
- 00d4 GD 5464 [Laguna]
- 00d5 GD 5464 BD [Laguna]
- 00d6 GD 5465 [Laguna]
- 13ce 8031 Barco Metheus 2 Megapixel, Dual Head
- 13cf 8031 Barco Metheus 2 Megapixel, Dual Head
- 00e8 GD 5436U
- 1100 CL 6729
- 1110 PD 6832 PCMCIA/CardBus Ctrlr
- 1112 PD 6834 PCMCIA/CardBus Ctrlr
- 1113 PD 6833 PCMCIA/CardBus Ctrlr
- 1200 GD 7542 [Nordic]
- 1202 GD 7543 [Viking]
- 1204 GD 7541 [Nordic Light]
- 4400 CD 4400
- 6001 CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]
- 1014 1010 CS4610 SoundFusion Audio Accelerator
- 6003 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]
- 1013 4280 Crystal SoundFusion PCI Audio Accelerator
- 1681 0050 Game Theater XP
- 1681 a011 Fortissimo III 7.1
- 6004 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]
- 6005 Crystal CS4281 PCI Audio
- 1013 4281 Crystal CS4281 PCI Audio
- 10cf 10a8 Crystal CS4281 PCI Audio
- 10cf 10a9 Crystal CS4281 PCI Audio
- 10cf 10aa Crystal CS4281 PCI Audio
- 10cf 10ab Crystal CS4281 PCI Audio
- 10cf 10ac Crystal CS4281 PCI Audio
- 10cf 10ad Crystal CS4281 PCI Audio
- 10cf 10b4 Crystal CS4281 PCI Audio
- 1179 0001 Crystal CS4281 PCI Audio
- 14c0 000c Crystal CS4281 PCI Audio
-1014 IBM
- 0002 PCI to MCA Bridge
- 0005 Alta Lite
- 0007 Alta MP
- 000a Fire Coral
- 0017 CPU to PCI Bridge
- 0018 TR Auto LANstreamer
- 001b GXT-150P
- 001c Carrera
- 001d 82G2675
- 0020 MCA
- 0022 IBM27-82351
- 002d Python
- 002e ServeRAID Controller
- 1014 002e ServeRAID-3x
- 1014 022e ServeRAID-4H
- 0036 Miami
- 003a CPU to PCI Bridge
- 003e 16/4 Token ring UTP/STP controller
- 1014 003e Token-Ring Adapter
- 1014 00cd Token-Ring Adapter + Wake-On-LAN
- 1014 00ce 16/4 Token-Ring Adapter 2
- 1014 00cf 16/4 Token-Ring Adapter Special
- 1014 00e4 High-Speed 100/16/4 Token-Ring Adapter
- 1014 00e5 16/4 Token-Ring Adapter 2 + Wake-On-LAN
- 1014 016d iSeries 2744 Card
- 0045 SSA Adapter
- 0046 MPIC interrupt controller
- 0047 PCI to PCI Bridge
- 0048 PCI to PCI Bridge
- 0049 Warhead SCSI Controller
- 004e ATM Controller (14104e00)
- 004f ATM Controller (14104f00)
- 0050 ATM Controller (14105000)
- 0053 25 MBit ATM Controller
- 0057 MPEG PCI Bridge
- 005c i82557B 10/100
- 007c ATM Controller (14107c00)
- 007d 3780IDSP [MWave]
- 0090 GXT 3000P
- 1014 008e GXT-3000P
- 0095 20H2999 PCI Docking Bridge
- 0096 Chukar chipset SCSI controller
- 1014 0097 iSeries 2778 DASD IOA
- 1014 0098 iSeries 2763 DASD IOA
- 1014 0099 iSeries 2748 DASD IOA
- 00a5 ATM Controller (1410a500)
- 00a6 ATM 155MBPS MM Controller (1410a600)
- 00b7 256-bit Graphics Rasterizer [Fire GL1]
- 00be ATM 622MBPS Controller (1410be00)
- 00dc Advanced Systems Management Adapter (ASMA)
- 00fc CPC710 Dual Bridge and Memory Controller (PCI-64)
- 0105 CPC710 Dual Bridge and Memory Controller (PCI-32)
- 010f Remote Supervisor Adapter (RSA)
- 0142 Yotta Video Compositor Input
- 1014 0143 Yotta Input Controller (ytin)
- 0144 Yotta Video Compositor Output
- 1014 0145 Yotta Output Controller (ytout)
- 0156 405GP PLB to PCI Bridge
- 01a7 PCI-X to PCI-X Bridge
- 01bd ServeRAID Controller
- 1014 01be ServeRAID-4M
- 1014 01bf ServeRAID-4L
- 1014 0208 ServeRAID-4Mx
- 1014 020e ServeRAID-4Lx
- 1014 022e ServeRAID-4H
- 1014 0258 ServeRAID-5i
- 1014 0259 ServeRAID-5i
- 0302 XA-32 chipset [Summit]
- ffff MPIC-2 interrupt controller
-1015 LSI Logic Corp of Canada
-1016 ICL Personal Systems
-1017 SPEA Software AG
- 5343 SPEA 3D Accelerator
-1018 Unisys Systems
-1019 Elitegroup Computer Systems
-101a AT&T GIS (NCR)
- 0005 100VG ethernet
-101b Vitesse Semiconductor
-101c Western Digital
- 0193 33C193A
- 0196 33C196A
- 0197 33C197A
- 0296 33C296A
- 3193 7193
- 3197 7197
- 3296 33C296A
- 4296 34C296
- 9710 Pipeline 9710
- 9712 Pipeline 9712
- c24a 90C
-101e American Megatrends Inc.
- 1960 MegaRAID
- 101e 0471 MegaRAID 471 Enterprise 1600 RAID Controller
- 101e 0475 MegaRAID 475 Express 500 RAID Controller
- 101e 0493 MegaRAID 493 Elite 1600 RAID Controller
- 1028 0471 PowerEdge RAID Controller 3/QC
- 1028 0475 PowerEdge RAID Controller 3/SC
- 1028 0493 PowerEdge RAID Controller 3/DC
- 1028 0511 PowerEdge Cost Effective RAID Controller ATA100/4Ch
- 9010 MegaRAID 428 Ultra RAID Controller
- 9030 EIDE Controller
- 9031 EIDE Controller
- 9032 EIDE & SCSI Controller
- 9033 SCSI Controller
- 9040 Multimedia card
- 9060 MegaRAID 434 Ultra GT RAID Controller
- 9063 MegaRAC
- 101e 0767 Dell Remote Assistant Card 2
-101f PictureTel
-1020 Hitachi Computer Products
-1021 OKI Electric Industry Co. Ltd.
-1022 Advanced Micro Devices [AMD]
- 1100 K8 NorthBridge
- 1101 K8 NorthBridge
- 1102 K8 NorthBridge
- 1103 K8 NorthBridge
- 2000 79c970 [PCnet32 LANCE]
- 1014 2000 NetFinity 10/100 Fast Ethernet
- 103c 104c Ethernet with LAN remote power Adapter
- 103c 1064 Ethernet with LAN remote power Adapter
- 103c 1065 Ethernet with LAN remote power Adapter
- 103c 106c Ethernet with LAN remote power Adapter
- 103c 106e Ethernet with LAN remote power Adapter
- 103c 10ea Ethernet with LAN remote power Adapter
- 1113 1220 EN1220 10/100 Fast Ethernet
- 1259 2450 AT-2450 10/100 Fast Ethernet
- 1259 2454 AT-2450v4 10Mb Ethernet Adapter
- 1259 2700 AT-2700TX 10/100 Fast Ethernet
- 1259 2701 AT-2700FX 100Mb Ethernet
- 2001 79c978 [HomePNA]
- 1092 0a78 Multimedia Home Network Adapter
- 1668 0299 ActionLink Home Network Adapter
- 2020 53c974 [PCscsi]
- 2040 79c974
- 3000 ELanSC520 Microcontroller
- 7006 AMD-751 [Irongate] System Controller
- 7007 AMD-751 [Irongate] AGP Bridge
- 700c AMD-760 MP [IGD4-2P] System Controller
- 700d AMD-760 MP [IGD4-2P] AGP Bridge
- 700e AMD-760 [IGD4-1P] System Controller
- 700f AMD-760 [IGD4-1P] AGP Bridge
- 7400 AMD-755 [Cobra] ISA
- 7401 AMD-755 [Cobra] IDE
- 7403 AMD-755 [Cobra] ACPI
- 7404 AMD-755 [Cobra] USB
- 7408 AMD-756 [Viper] ISA
- 7409 AMD-756 [Viper] IDE
- 740b AMD-756 [Viper] ACPI
- 740c AMD-756 [Viper] USB
- 7410 AMD-766 [ViperPlus] ISA
- 7411 AMD-766 [ViperPlus] IDE
- 7413 AMD-766 [ViperPlus] ACPI
- 7414 AMD-766 [ViperPlus] USB
- 7440 AMD-768 [Opus] ISA
- 1043 8044 A7M-D Mainboard
- 7441 AMD-768 [Opus] IDE
- 7443 AMD-768 [Opus] ACPI
- 1043 8044 A7M-D Mainboard
- 7445 AMD-768 [Opus] Audio
- 7446 AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible)
- 7448 AMD-768 [Opus] PCI
- 7449 AMD-768 [Opus] USB
- 7450 AMD-8131 PCI-X Bridge
- 7451 AMD-8131 PCI-X APIC
- 7454 AMD-8151 System Controller
- 7455 AMD-8151 AGP Bridge
- 7460 AMD-8111 PCI
- 7461 AMD-8111 USB
- 7462 AMD-8111 Ethernet
- 7464 AMD-8111 USB
- 7468 AMD-8111 LPC
- 7469 AMD-8111 IDE
- 746a AMD-8111 SMBus 2.0
- 746b AMD-8111 ACPI
- 746d AMD-8111 AC97 Audio
- 746e AMD-8111 MC97 Modem
-1023 Trident Microsystems
- 0194 82C194
- 2000 4DWave DX
- 2001 4DWave NX
- 8400 CyberBlade/i7
- 1023 8400 CyberBlade i7 AGP
- 8420 CyberBlade/i7d
- 0e11 b15a CyberBlade i7 AGP
- 8500 CyberBlade/i1
- 8520 CyberBlade i1
- 0e11 b16e CyberBlade i1 AGP
- 1023 8520 CyberBlade i1 AGP
- 8620 CyberBlade/i1
- 1014 0502 ThinkPad T30
- 8820 CyberBlade XPAi1
- 9320 TGUI 9320
- 9350 GUI Accelerator
- 9360 Flat panel GUI Accelerator
- 9382 Cyber 9382 [Reference design]
- 9383 Cyber 9383 [Reference design]
- 9385 Cyber 9385 [Reference design]
- 9386 Cyber 9386
- 9388 Cyber 9388
- 9397 Cyber 9397
- 939a Cyber 9397DVD
- 9420 TGUI 9420
- 9430 TGUI 9430
- 9440 TGUI 9440
- 9460 TGUI 9460
- 9470 TGUI 9470
- 9520 Cyber 9520
- 9525 Cyber 9525
- 10cf 1094 Lifebook C6155
- 9540 Cyber 9540
- 9660 TGUI 9660/938x/968x
- 9680 TGUI 9680
- 9682 TGUI 9682
- 9683 TGUI 9683
- 9685 ProVIDIA 9685
- 9750 3DImage 9750
- 1014 9750 3DImage 9750
- 1023 9750 3DImage 9750
- 9753 TGUI 9753
- 9754 TGUI 9754
- 9759 TGUI 975
- 9783 TGUI 9783
- 9785 TGUI 9785
- 9850 3DImage 9850
- 9880 Blade 3D PCI/AGP
- 1023 9880 Blade 3D
- 9910 CyberBlade/XP
- 9930 CyberBlade/XPm
-1024 Zenith Data Systems
-1025 Acer Incorporated [ALI]
- 1435 M1435
- 1445 M1445
- 1449 M1449
- 1451 M1451
- 1461 M1461
- 1489 M1489
- 1511 M1511
- 1512 ALI M1512 Aladdin
- 1513 M1513
- 1521 ALI M1521 Aladdin III CPU Bridge
- 10b9 1521 ALI M1521 Aladdin III CPU Bridge
- 1523 ALI M1523 ISA Bridge
- 10b9 1523 ALI M1523 ISA Bridge
- 1531 M1531 Northbridge [Aladdin IV/IV+]
- 1533 M1533 PCI-to-ISA Bridge
- 10b9 1533 ALI M1533 Aladdin IV/V ISA South Bridge
- 1535 M1535 PCI Bridge + Super I/O + FIR
- 1541 M1541 Northbridge [Aladdin V]
- 10b9 1541 ALI M1541 Aladdin V/V+ AGP+PCI North Bridge
- 1542 M1542 Northbridge [Aladdin V]
- 1543 M1543 PCI-to-ISA Bridge + Super I/O + FIR
- 1561 M1561 Northbridge [Aladdin 7]
- 1621 M1621 Northbridge [Aladdin-Pro II]
- 1631 M1631 Northbridge+3D Graphics [Aladdin TNT2]
- 1641 M1641 Northbridge [Aladdin-Pro IV]
- 1647 M1647 [MaGiK1] PCI North Bridge
- 3141 M3141
- 3143 M3143
- 3145 M3145
- 3147 M3147
- 3149 M3149
- 3151 M3151
- 3307 M3307 MPEG-I Video Controller
- 3309 M3309 MPEG-II Video w/ Software Audio Decoder
- 3321 M3321 MPEG-II Audio/Video Decoder
- 5212 M4803
- 5215 ALI PCI EIDE Controller
- 5217 M5217H
- 5219 M5219
- 5225 M5225
- 5229 M5229
- 5235 M5235
- 5237 M5237 PCI USB Host Controller
- 5240 EIDE Controller
- 5241 PCMCIA Bridge
- 5242 General Purpose Controller
- 5243 PCI to PCI Bridge Controller
- 5244 Floppy Disk Controller
- 5247 M1541 PCI to PCI Bridge
- 5251 M5251 P1394 Controller
- 5427 PCI to AGP Bridge
- 5451 M5451 PCI AC-Link Controller Audio Device
- 5453 M5453 PCI AC-Link Controller Modem Device
- 7101 M7101 PCI PMU Power Management Controller
- 10b9 7101 M7101 PCI PMU Power Management Controller
-1028 Dell Computer Corporation
- 0001 PowerEdge Expandable RAID Controller 2/Si
- 1028 0001 PowerEdge Expandable RAID Controller 2/Si
- 0002 PowerEdge Expandable RAID Controller 3
- 1028 0002 PowerEdge Expandable RAID Controller 3/Di
- 1028 00d1 PowerEdge Expandable RAID Controller 3/Di
- 1028 00d9 PowerEdge Expandable RAID Controller 3/Di
- 0003 PowerEdge Expandable RAID Controller 3/Si
- 1028 0003 PowerEdge Expandable RAID Controller 3/Si
- 0004 PowerEdge Expandable RAID Controller 3/Si
- 1028 00d0 PowerEdge Expandable RAID Controller 3/Si
- 0005 PowerEdge Expandable RAID Controller 3/Di
- 0006 PowerEdge Expandable RAID Controller 3/Di
- 0007 Remote Access Controller:DRAC III
- 0008 Remote Access Controller
- 0009 BMC/SMIC device not present
- 000a PowerEdge Expandable RAID Controller 3
- 1028 0106 PowerEdge Expandable RAID Controller 3/Di
- 1028 011b PowerEdge Expandable RAID Controller 3/Di
- 1028 0121 PowerEdge Expandable RAID Controller 3/Di
- 000c Remote Access Controller:ERA or ERA/O
- 000d BMC/SMIC device
- 000e PowerEdge Expandable RAID Controller
- 000f PowerEdge Expandable RAID Controller 4/Di
-1029 Siemens Nixdorf IS
-102a LSI Logic
- 0000 HYDRA
- 0010 ASPEN
-102b Matrox Graphics, Inc.
-# DJ: I've a suspicion that 0010 is a duplicate of 0d10.
- 0010 MGA-I [Impression?]
- 0100 MGA 1064SG [Mystique]
- 0518 MGA-II [Athena]
- 0519 MGA 2064W [Millennium]
- 051a MGA 1064SG [Mystique]
- 102b 0100 MGA-1064SG Mystique
- 102b 1100 MGA-1084SG Mystique
- 102b 1200 MGA-1084SG Mystique
- 1100 102b MGA-1084SG Mystique
- 110a 0018 Scenic Pro C5 (D1025)
- 051b MGA 2164W [Millennium II]
- 102b 051b MGA-2164W Millennium II
- 102b 1100 MGA-2164W Millennium II
- 102b 1200 MGA-2164W Millennium II
- 051e MGA 1064SG [Mystique] AGP
- 051f MGA 2164W [Millennium II] AGP
- 0520 MGA G200
- 102b dbc2 G200 Multi-Monitor
- 102b dbc8 G200 Multi-Monitor
- 102b dbe2 G200 Multi-Monitor
- 102b dbe8 G200 Multi-Monitor
- 102b ff03 Millennium G200 SD
- 102b ff04 Marvel G200
- 0521 MGA G200 AGP
- 1014 ff03 Millennium G200 AGP
- 102b 48e9 Mystique G200 AGP
- 102b 48f8 Millennium G200 SD AGP
- 102b 4a60 Millennium G200 LE AGP
- 102b 4a64 Millennium G200 AGP
- 102b c93c Millennium G200 AGP
- 102b c9b0 Millennium G200 AGP
- 102b c9bc Millennium G200 AGP
- 102b ca60 Millennium G250 LE AGP
- 102b ca6c Millennium G250 AGP
- 102b dbbc Millennium G200 AGP
- 102b dbc2 Millennium G200 MMS (Dual G200)
- 102b dbc3 G200 Multi-Monitor
- 102b dbc8 Millennium G200 MMS (Dual G200)
- 102b dbd2 G200 Multi-Monitor
- 102b dbd3 G200 Multi-Monitor
- 102b dbd4 G200 Multi-Monitor
- 102b dbd5 G200 Multi-Monitor
- 102b dbd8 G200 Multi-Monitor
- 102b dbd9 G200 Multi-Monitor
- 102b dbe2 Millennium G200 MMS (Quad G200)
- 102b dbe3 G200 Multi-Monitor
- 102b dbe8 Millennium G200 MMS (Quad G200)
- 102b dbf2 G200 Multi-Monitor
- 102b dbf3 G200 Multi-Monitor
- 102b dbf4 G200 Multi-Monitor
- 102b dbf5 G200 Multi-Monitor
- 102b dbf8 G200 Multi-Monitor
- 102b dbf9 G200 Multi-Monitor
- 102b f806 Mystique G200 Video AGP
- 102b ff00 MGA-G200 AGP
- 102b ff02 Mystique G200 AGP
- 102b ff03 Millennium G200 AGP
- 102b ff04 Marvel G200 AGP
- 110a 0032 MGA-G200 AGP
- 0525 MGA G400 AGP
- 0e11 b16f MGA-G400 AGP
- 102b 0328 Millennium G400 16Mb SDRAM
- 102b 0338 Millennium G400 16Mb SDRAM
- 102b 0378 Millennium G400 32Mb SDRAM
- 102b 0541 Millennium G450 Dual Head
- 102b 0542 Millennium G450 Dual Head LX
- 102b 0543 Millennium G450 Single Head LX
- 102b 0641 Millennium G450 32Mb SDRAM Dual Head
- 102b 0642 Millennium G450 32Mb SDRAM Dual Head LX
- 102b 0643 Millennium G450 32Mb SDRAM Single Head LX
- 102b 07c0 Millennium G450 Dual Head LE
- 102b 07c1 Millennium G450 SDR Dual Head LE
- 102b 0d41 Millennium G450 Dual Head PCI
- 102b 0d42 Millennium G450 Dual Head LX PCI
- 102b 0e00 Marvel G450 eTV
- 102b 0e01 Marvel G450 eTV
- 102b 0e02 Marvel G450 eTV
- 102b 0e03 Marvel G450 eTV
- 102b 0f80 Millennium G450 Low Profile
- 102b 0f81 Millennium G450 Low Profile
- 102b 0f82 Millennium G450 Low Profile DVI
- 102b 0f83 Millennium G450 Low Profile DVI
- 102b 19d8 Millennium G400 16Mb SGRAM
- 102b 19f8 Millennium G400 32Mb SGRAM
- 102b 2159 Millennium G400 Dual Head 16Mb
- 102b 2179 Millennium G400 MAX/Dual Head 32Mb
- 102b 217d Millennium G400 Dual Head Max
- 102b 23c0 Millennium G450
- 102b 23c1 Millennium G450
- 102b 23c2 Millennium G450 DVI
- 102b 23c3 Millennium G450 DVI
- 102b 2f58 Millennium G400
- 102b 2f78 Millennium G400
- 102b 3693 Marvel G400 AGP
- 102b 5dd0 4Sight II
- 102b 5f50 4Sight II
- 102b 5f51 4Sight II
- 102b 5f52 4Sight II
- 102b 9010 Millennium G400 Dual Head
- 1458 0400 GA-G400
- 1705 0001 Millennium G450 32MB SGRAM
- 1705 0002 Millennium G450 16MB SGRAM
- 1705 0003 Millennium G450 32MB
- 1705 0004 Millennium G450 16MB
- 0527 MGA Parhelia AGP
- 102b 0840 Parhelia 128Mb
- 0d10 MGA Ultima/Impression
- 1000 MGA G100 [Productiva]
- 102b ff01 Productiva G100
- 102b ff05 Productiva G100 Multi-Monitor
- 1001 MGA G100 [Productiva] AGP
- 102b 1001 MGA-G100 AGP
- 102b ff00 MGA-G100 AGP
- 102b ff01 MGA-G100 Productiva AGP
- 102b ff03 Millennium G100 AGP
- 102b ff04 MGA-G100 AGP
- 102b ff05 MGA-G100 Productiva AGP Multi-Monitor
- 110a 001e MGA-G100 AGP
- 2007 MGA Mistral
- 2527 MGA G550 AGP
- 102b 0f83 Millennium G550
- 102b 0f84 Millennium G550 Dual Head DDR 32Mb
- 102b 1e41 Millennium G550
- 4536 VIA Framegrabber
- 6573 Shark 10/100 Multiport SwitchNIC
-102c Chips and Technologies
- 00b8 F64310
- 00c0 F69000 HiQVideo
- 102c 00c0 F69000 HiQVideo
- 00d0 F65545
- 00d8 F65545
- 00dc F65548
- 00e0 F65550
- 00e4 F65554
- 00e5 F65555 HiQVPro
- 0e11 b049 Armada 1700 Laptop Display Controller
- 00f0 F68554
- 00f4 F68554 HiQVision
- 00f5 F68555
- 0c30 F69030
-102d Wyse Technology Inc.
- 50dc 3328 Audio
-102e Olivetti Advanced Technology
-102f Toshiba America
- 0009 r4x00
- 0020 ATM Meteor 155
- 102f 00f8 ATM Meteor 155
-1030 TMC Research
-1031 Miro Computer Products AG
- 5601 DC20 ASIC
- 5607 Video I/O & motion JPEG compressor
- 5631 Media 3D
- 6057 MiroVideo DC10/DC30+
-1032 Compaq
-1033 NEC Corporation
- 0001 PCI to 486-like bus Bridge
- 0002 PCI to VL98 Bridge
- 0003 ATM Controller
- 0004 R4000 PCI Bridge
- 0005 PCI to 486-like bus Bridge
- 0006 PC-9800 Graphic Accelerator
- 0007 PCI to UX-Bus Bridge
- 0008 PC-9800 Graphic Accelerator
- 0009 PCI to PC9800 Core-Graph Bridge
- 0016 PCI to VL Bridge
- 001a [Nile II]
- 0021 Vrc4373 [Nile I]
- 0029 PowerVR PCX1
- 002a PowerVR 3D
- 002c Star Alpha 2
- 002d PCI to C-bus Bridge
- 0035 USB
- 1179 0001 USB
- 12ee 7000 Root Hub
- 1799 0001 Root Hub
- 003b PCI to C-bus Bridge
- 003e NAPCCARD Cardbus Controller
- 0046 PowerVR PCX2 [midas]
- 005a Vrc5074 [Nile 4]
- 0063 Firewarden
- 0067 PowerVR Neon 250 Chipset
- 1010 0020 PowerVR Neon 250 AGP 32Mb
- 1010 0080 PowerVR Neon 250 AGP 16Mb
- 1010 0088 PowerVR Neon 250 16Mb
- 1010 0090 PowerVR Neon 250 AGP 16Mb
- 1010 0098 PowerVR Neon 250 16Mb
- 1010 00a0 PowerVR Neon 250 AGP 32Mb
- 1010 00a8 PowerVR Neon 250 32Mb
- 1010 0120 PowerVR Neon 250 AGP 32Mb
- 0074 56k Voice Modem
- 1033 8014 RCV56ACF 56k Voice Modem
- 009b Vrc5476
- 00a6 VRC5477 AC97
- 00cd IEEE 1394 [OrangeLink] Host Controller
- 12ee 8011 Root hub
- 00e0 USB 2.0
- 12ee 7001 Root hub
- 1799 0002 Root Hub
-1034 Framatome Connectors USA Inc.
-1035 Comp. & Comm. Research Lab
-1036 Future Domain Corp.
- 0000 TMC-18C30 [36C70]
-1037 Hitachi Micro Systems
-1038 AMP, Inc
-1039 Silicon Integrated Systems [SiS]
-# This is what all my tests report. I don't know if this is equivalent to "5591/5592 AGP".
- 0001 SiS 530 Virtual PCI-to-PCI bridge (AGP)
- 0002 SG86C202
- 0006 85C501/2/3
- 0008 85C503/5513
- 0009 ACPI
- 0018 SiS85C503/5513 (LPC Bridge)
- 0200 5597/5598/6326 VGA
- 1039 0000 SiS5597 SVGA (Shared RAM)
- 0204 82C204
- 0205 SG86C205
- 0300 SiS300/305 PCI/AGP VGA Display Adapter
- 107d 2720 Leadtek WinFast VR300
- 0310 SiS315H PCI/AGP VGA Display Adapter
- 0315 SiS315 PCI/AGP VGA Display Adapter
- 0325 SiS315PRO PCI/AGP VGA Display Adapter
- 0330 SiS330 [Xabre] PCI/AGP VGA Display Adapter
- 0406 85C501/2
- 0496 85C496
- 0530 530 Host
- 0540 540 Host
- 0597 5513C
- 0601 85C601
- 0620 620 Host
- 0630 630 Host
- 0633 633 Host
- 0635 635 Host
- 0645 SiS645 Host & Memory & AGP Controller
- 0646 SiS645DX Host & Memory & AGP Controller
- 0648 SiS 645xx
- 0650 650 Host
- 0651 SiS651 Host
- 0730 730 Host
- 0733 733 Host
- 0735 735 Host
- 0740 740 Host
- 0745 745 Host
- 0755 SiS 755 Host Bridge
- 0900 SiS900 10/100 Ethernet
- 1039 0900 SiS900 10/100 Ethernet Adapter
- 0961 SiS961 [MuTIOL Media IO]
- 0962 SiS962 [MuTIOL Media IO]
- 3602 83C602
- 5107 5107
- 5300 SiS540 PCI Display Adapter
- 5315 SiS550 AGP/VGA VGA Display Adapter
- 5401 486 PCI Chipset
- 5511 5511/5512
- 5513 5513 [IDE]
- 1019 0970 P6STP-FL motherboard
- 1039 5513 SiS5513 EIDE Controller (A,B step)
- 5517 5517
- 5571 5571
- 5581 5581 Pentium Chipset
- 5582 5582
- 5591 5591/5592 Host
- 5596 5596 Pentium Chipset
- 5597 5597 [SiS5582]
- 5600 5600 Host
- 6204 Video decoder & MPEG interface
- 6205 VGA Controller
- 6236 6236 3D-AGP
- 6300 SiS630 GUI Accelerator+3D
- 1019 0970 P6STP-FL motherboard
- 6306 SiS530 3D PCI/AGP
- 1039 6306 SiS530,620 GUI Accelerator+3D
- 6325 SiS650/651/M650/740 PCI/AGP VGA Display Adapter
- 6326 86C326 5598/6326
- 1039 6326 SiS6326 GUI Accelerator
- 1092 0a50 SpeedStar A50
- 1092 0a70 SpeedStar A70
- 1092 4910 SpeedStar A70
- 1092 4920 SpeedStar A70
- 1569 6326 SiS6326 GUI Accelerator
- 7001 USB 1.0 Controller
- 1039 7000 Onboard USB Controller
- 7002 USB 2.0 Controller
- 1509 7002 Onboard USB Controller
- 7007 FireWire Controller
- 7012 Sound Controller
- 7013 Intel 537 [56k Winmodem]
- 7016 10/100 Ethernet Adapter
- 1039 7016 SiS7016 10/100 Ethernet Adapter
- 7018 SiS PCI Audio Accelerator
- 1014 01b6 SiS PCI Audio Accelerator
- 1014 01b7 SiS PCI Audio Accelerator
- 1019 7018 SiS PCI Audio Accelerator
- 1025 000e SiS PCI Audio Accelerator
- 1025 0018 SiS PCI Audio Accelerator
- 1039 7018 SiS PCI Audio Accelerator
- 1043 800b SiS PCI Audio Accelerator
- 1054 7018 SiS PCI Audio Accelerator
- 107d 5330 SiS PCI Audio Accelerator
- 107d 5350 SiS PCI Audio Accelerator
- 1170 3209 SiS PCI Audio Accelerator
- 1462 400a SiS PCI Audio Accelerator
- 14a4 2089 SiS PCI Audio Accelerator
- 14cd 2194 SiS PCI Audio Accelerator
- 14ff 1100 SiS PCI Audio Accelerator
- 152d 8808 SiS PCI Audio Accelerator
- 1558 1103 SiS PCI Audio Accelerator
- 1558 2200 SiS PCI Audio Accelerator
- 1563 7018 SiS PCI Audio Accelerator
- 15c5 0111 SiS PCI Audio Accelerator
- 270f a171 SiS PCI Audio Accelerator
- a0a0 0022 SiS PCI Audio Accelerator
-103a Seiko Epson Corporation
-103b Tatung Co. of America
-103c Hewlett-Packard Company
- 1005 A4977A Visualize EG
- 1006 Visualize FX6
- 1008 Visualize FX4
- 100a Visualize FX2
- 1028 Tach TL Fibre Channel Host Adapter
- 1029 Tach XL2 Fibre Channel Host Adapter
- 107e 000f Interphase 5560 Fibre Channel Adapter
- 9004 9210 1Gb/2Gb Family Fibre Channel Controller
- 9004 9211 1Gb/2Gb Family Fibre Channel Controller
- 102a Tach TS Fibre Channel Host Adapter
- 107e 000e Interphase 5540/5541 Fibre Channel Adapter
- 9004 9110 1Gb/2Gb Family Fibre Channel Controller
- 9004 9111 1Gb/2Gb Family Fibre Channel Controller
- 1030 J2585A DeskDirect 10/100VG NIC
- 1031 J2585B HP 10/100VG PCI LAN Adapter
- 103c 1040 J2973A DeskDirect 10BaseT NIC
- 103c 1041 J2585B DeskDirect 10/100VG NIC
- 103c 1042 J2970A DeskDirect 10BaseT/2 NIC
- 1040 J2973A DeskDirect 10BaseT NIC
- 1041 J2585B DeskDirect 10/100 NIC
- 1042 J2970A DeskDirect 10BaseT/2 NIC
- 1048 Diva Serial [GSP] Multiport UART
- 103c 1049 Tosca Console
- 103c 104a Tosca Secondary
- 103c 104b Maestro SP2
- 103c 1223 Halfdome Console
- 103c 1226 Keystone SP2
- 103c 1227 Powerbar SP2
- 103c 1282 Everest SP2
- 1064 79C970 PCnet Ethernet Controller
- 108b Visualize FXe
- 10c1 NetServer Smart IRQ Router
- 10ed TopTools Remote Control
- 1200 82557B 10/100 NIC
- 1219 NetServer PCI Hot-Plug Controller
- 121a NetServer SMIC Controller
- 121b NetServer Legacy COM Port Decoder
- 121c NetServer PCI COM Port Decoder
- 1229 zx1 System Bus Adapter
- 122a zx1 I/O Controller
- 122e zx1 Local Bus Adapter
- 1290 Auxiliary Diva Serial Port
- 2910 E2910A PCIBus Exerciser
- 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer
-103e Solliday Engineering
-103f Synopsys/Logic Modeling Group
-1040 Accelgraphics Inc.
-1041 Computrend
-1042 Micron
- 1000 PC Tech RZ1000
- 1001 PC Tech RZ1001
- 3000 Samurai_0
- 3010 Samurai_1
- 3020 Samurai_IDE
-1043 Asustek Computer, Inc.
- 0675 ISDNLink P-IN100-ST-D
- 4021 v7100 Combo Deluxe [GeForce2 MX + TV tuner]
-1044 Distributed Processing Technology
- 1012 Domino RAID Engine
- a400 SmartCache/Raid I-IV Controller
- a500 PCI Bridge
- a501 SmartRAID V Controller
- 1044 c001 PM1554U2 Ultra2 Single Channel
- 1044 c002 PM1654U2 Ultra2 Single Channel
- 1044 c003 PM1564U3 Ultra3 Single Channel
- 1044 c004 PM1564U3 Ultra3 Dual Channel
- 1044 c005 PM1554U2 Ultra2 Single Channel (NON ACPI)
- 1044 c00a PM2554U2 Ultra2 Single Channel
- 1044 c00b PM2654U2 Ultra2 Single Channel
- 1044 c00c PM2664U3 Ultra3 Single Channel
- 1044 c00d PM2664U3 Ultra3 Dual Channel
- 1044 c00e PM2554U2 Ultra2 Single Channel (NON ACPI)
- 1044 c00f PM2654U2 Ultra2 Single Channel (NON ACPI)
- 1044 c014 PM3754U2 Ultra2 Single Channel (NON ACPI)
- 1044 c015 PM3755U2B Ultra2 Single Channel (NON ACPI)
- 1044 c016 PM3755F Fibre Channel (NON ACPI)
- 1044 c01e PM3757U2 Ultra2 Single Channel
- 1044 c01f PM3757U2 Ultra2 Dual Channel
- 1044 c020 PM3767U3 Ultra3 Dual Channel
- 1044 c021 PM3767U3 Ultra3 Quad Channel
- 1044 c028 PM2865U3 Ultra3 Single Channel
- 1044 c029 PM2865U3 Ultra3 Dual Channel
- 1044 c02a PM2865F Fibre Channel
- 1044 c03c 2000S Ultra3 Single Channel
- 1044 c03d 2000S Ultra3 Dual Channel
- 1044 c03e 2000F Fibre Channel
- 1044 c046 3000S Ultra3 Single Channel
- 1044 c047 3000S Ultra3 Dual Channel
- 1044 c048 3000F Fibre Channel
- 1044 c050 5000S Ultra3 Single Channel
- 1044 c051 5000S Ultra3 Dual Channel
- 1044 c052 5000F Fibre Channel
- 1044 c05a 2400A UDMA Four Channel
- 1044 c05b 2400A UDMA Four Channel DAC
- 1044 c064 3010S Ultra3 Dual Channel
- 1044 c065 3010S Ultra3 Four Channel
- 1044 c066 3010S Fibre Channel
- a511 SmartRAID V Controller
-1045 OPTi Inc.
- a0f8 82C750 [Vendetta] USB Controller
- c101 92C264
- c178 92C178
- c556 82X556 [Viper]
- c557 82C557 [Viper-M]
- c558 82C558 [Viper-M ISA+IDE]
- c567 82C750 [Vendetta], device 0
- c568 82C750 [Vendetta], device 1
- c569 82C579 [Viper XPress+ Chipset]
- c621 82C621 [Viper-M/N+]
- c700 82C700 [FireStar]
- c701 82C701 [FireStar Plus]
- c814 82C814 [Firebridge 1]
- c822 82C822
- c824 82C824
- c825 82C825 [Firebridge 2]
- c832 82C832
- c861 82C861
- c895 82C895
- c935 EV1935 ECTIVA MachOne PCI Audio
- d568 82C825 [Firebridge 2]
- d721 IDE [FireStar]
-1046 IPC Corporation, Ltd.
-1047 Genoa Systems Corp
-1048 Elsa AG
- 0d22 Quadro4 900XGL [ELSA GLoria4 900XGL]
- 1000 QuickStep 1000
- 3000 QuickStep 3000
-1049 Fountain Technologies, Inc.
-104a SGS Thomson Microelectronics
- 0008 STG 2000X
- 0009 STG 1764X
- 0010 STG4000 [3D Prophet Kyro Series]
-# From <http://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-stable/src/share/misc/pci_vendors>
- 0210 STPC Atlas ISA Bridge
- 0981 DEC-Tulip compatible 10/100 Ethernet
- 1746 STG 1764X
- 2774 DEC-Tulip compatible 10/100 Ethernet
- 3520 MPEG-II decoder card
-104b BusLogic
- 0140 BT-946C (old) [multimaster 01]
- 1040 BT-946C (BA80C30) [MultiMaster 10]
- 8130 Flashpoint LT
-104c Texas Instruments
- 0500 100 MBit LAN Controller
- 0508 TMS380C2X Compressor Interface
- 1000 Eagle i/f AS
- 104c PCI1510 PC card Cardbus Controller
- 3d04 TVP4010 [Permedia]
- 3d07 TVP4020 [Permedia 2]
- 1011 4d10 Comet
- 1040 000f AccelStar II
- 1040 0011 AccelStar II
- 1048 0a31 WINNER 2000
- 1048 0a32 GLoria Synergy
- 1048 0a35 GLoria Synergy
- 107d 2633 WinFast 3D L2300
- 1092 0127 FIRE GL 1000 PRO
- 1092 0136 FIRE GL 1000 PRO
- 1092 0141 FIRE GL 1000 PRO
- 1092 0146 FIRE GL 1000 PRO
- 1092 0148 FIRE GL 1000 PRO
- 1092 0149 FIRE GL 1000 PRO
- 1092 0152 FIRE GL 1000 PRO
- 1092 0154 FIRE GL 1000 PRO
- 1092 0155 FIRE GL 1000 PRO
- 1092 0156 FIRE GL 1000 PRO
- 1092 0157 FIRE GL 1000 PRO
- 1097 3d01 Jeronimo Pro
- 1102 100f Graphics Blaster Extreme
- 3d3d 0100 Reference Permedia 2 3D
- 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller
- e4bf 1010 CF1-1-SNARE
- e4bf 1020 CF1-2-SNARE
- 8009 FireWire Controller
- 104d 8032 8032 OHCI i.LINK (IEEE 1394) Controller
- 8017 PCI4410 FireWire Controller
- 8019 TSB12LV23 IEEE-1394 Controller
- 11bd 000a Studio DV500-1394
- 11bd 000e Studio DV
- e4bf 1010 CF2-1-CYMBAL
- 8020 TSB12LV26 IEEE-1394 Controller (Link)
- 8021 TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated)
- 104d 80df Vaio PCG-FX403
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)
- 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
- 8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
- 8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)
- 8027 PCI4451 IEEE-1394 Controller
- 1028 00e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)
- 8400 ACX 100 22Mbps Wireless Interface
- a001 TDC1570
- a100 TDC1561
- a102 TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f
- a106 TMS320C6205
- ac10 PCI1050
- ac11 PCI1053
- ac12 PCI1130
- ac13 PCI1031
- ac15 PCI1131
- ac16 PCI1250
- ac17 PCI1220
- ac18 PCI1260
- ac19 PCI1221
- ac1a PCI1210
- ac1b PCI1450
- 0e11 b113 Armada M700
- ac1c PCI1225
- ac1d PCI1251A
- ac1e PCI1211
- ac1f PCI1251B
- ac20 TI 2030
- ac21 PCI2031
- ac22 PCI2032 PCI Docking Bridge
- ac23 PCI2250 PCI-to-PCI Bridge
- ac28 PCI2050 PCI-to-PCI Bridge
- ac30 PCI1260 PC card Cardbus Controller
- ac40 PCI4450 PC card Cardbus Controller
- ac41 PCI4410 PC card Cardbus Controller
- ac42 PCI4451 PC card Cardbus Controller
- 1028 00e6 PCI4451 PC card CardBus Controller (Dell Inspiron 8100)
- ac50 PCI1410 PC card Cardbus Controller
- ac51 PCI1420
- 1014 023b ThinkPad T23 (2647-4MG)
- 10cf 1095 Lifebook C6155
- e4bf 1000 CP2-2-HIPHOP
- ac52 PCI1451 PC card Cardbus Controller
- ac53 PCI1421 PC card Cardbus Controller
- ac55 PCI1250 PC card Cardbus Controller
- 1014 0512 ThinkPad T30
- ac56 PCI1510 PC card Cardbus Controller
- ac60 PCI2040 PCI to DSP Bridge Controller
- fe00 FireWire Host Controller
- fe03 12C01A FireWire Host Controller
-104d Sony Corporation
- 8009 CXD1947Q i.LINK Controller
- 8039 CXD3222 i.LINK Controller
- 8056 Rockwell HCF 56K modem
- 808a Memory Stick Controller
-104e Oak Technology, Inc
- 0017 OTI-64017
- 0107 OTI-107 [Spitfire]
- 0109 Video Adapter
- 0111 OTI-64111 [Spitfire]
- 0217 OTI-64217
- 0317 OTI-64317
-104f Co-time Computer Ltd
-1050 Winbond Electronics Corp
- 0000 NE2000
- 0001 W83769F
- 0105 W82C105
- 0840 W89C840
- 1050 0001 W89C840 Ethernet Adapter
- 1050 0840 W89C840 Ethernet Adapter
- 0940 W89C940
- 5a5a W89C940F
- 6692 W6692
- 9970 W9970CF
-1051 Anigma, Inc.
-1052 ?Young Micro Systems
-1053 Young Micro Systems
-1054 Hitachi, Ltd
-1055 Efar Microsystems
- 9130 SLC90E66 [Victory66] IDE
- 9460 SLC90E66 [Victory66] ISA
- 9462 SLC90E66 [Victory66] USB
- 9463 SLC90E66 [Victory66] ACPI
-1056 ICL
-# Motorola made a mistake and used 1507 instead of 1057 in some chips. Please look at the 1507 entry as well when updating this.
-1057 Motorola
- 0001 MPC105 [Eagle]
- 0002 MPC106 [Grackle]
- 0003 MPC8240 [Kahlua]
- 0004 MPC107
- 0006 MPC8245 [Unity]
- 0100 MC145575 [HFC-PCI]
- 0431 KTI829c 100VG
- 1801 Audio I/O Controller (MIDI)
- ecc0 0030 Layla
- 18c0 MPC8265A/MPC8266
- 4801 Raven
- 4802 Falcon
- 4803 Hawk
- 4806 CPX8216
- 4d68 20268
- 5600 SM56 PCI Modem
- 1057 0300 SM56 PCI Speakerphone Modem
- 1057 0301 SM56 PCI Voice Modem
- 1057 0302 SM56 PCI Fax Modem
- 1057 5600 SM56 PCI Voice modem
- 13d2 0300 SM56 PCI Speakerphone Modem
- 13d2 0301 SM56 PCI Voice modem
- 13d2 0302 SM56 PCI Fax Modem
- 1436 0300 SM56 PCI Speakerphone Modem
- 1436 0301 SM56 PCI Voice modem
- 1436 0302 SM56 PCI Fax Modem
- 144f 100c SM56 PCI Fax Modem
- 1494 0300 SM56 PCI Speakerphone Modem
- 1494 0301 SM56 PCI Voice modem
- 14c8 0300 SM56 PCI Speakerphone Modem
- 14c8 0302 SM56 PCI Fax Modem
- 1668 0300 SM56 PCI Speakerphone Modem
- 1668 0302 SM56 PCI Fax Modem
- 6400 MPC190 Security Processor (S1 family, encryption)
-1058 Electronics & Telecommunications RSH
-1059 Teknor Industrial Computers Inc
-105a Promise Technology, Inc.
- 0d30 20265
- 105a 4d33 Ultra100
- 0d38 20263
- 105a 4d39 Fasttrak66
- 1275 20275
- 3376 PDC20376
- 1043 809e A7V8X motherboard
- 4d30 20267
- 105a 4d33 Ultra100
- 105a 4d39 Fasttrak100
- 4d33 20246
- 105a 4d33 20246 IDE Controller
- 4d38 20262
- 105a 4d30 Ultra Device on SuperTrak
- 105a 4d33 Ultra66
- 105a 4d39 Fasttrak66
- 4d68 20268
- 105a 4d68 Ultra100TX2
- 4d69 20269
- 105a 4d68 Ultra133TX2
- 5275 PDC20276 IDE
- 105a 0275 SuperTrak SX6000 IDE
- 5300 DC5300
- 6268 20268R
- 6269 PDC20271
- 105a 6269 FastTrak TX2/TX2000
- 6621 PDC20621 [SX4000] 4 Channel IDE RAID Controller
- 7275 PDC20277
-105b Foxconn International, Inc.
-105c Wipro Infotech Limited
-105d Number 9 Computer Company
- 2309 Imagine 128
- 2339 Imagine 128-II
- 105d 0000 Imagine 128 series 2 4Mb VRAM
- 105d 0001 Imagine 128 series 2 4Mb VRAM
- 105d 0002 Imagine 128 series 2 4Mb VRAM
- 105d 0003 Imagine 128 series 2 4Mb VRAM
- 105d 0004 Imagine 128 series 2 4Mb VRAM
- 105d 0005 Imagine 128 series 2 4Mb VRAM
- 105d 0006 Imagine 128 series 2 4Mb VRAM
- 105d 0007 Imagine 128 series 2 4Mb VRAM
- 105d 0008 Imagine 128 series 2e 4Mb DRAM
- 105d 0009 Imagine 128 series 2e 4Mb DRAM
- 105d 000a Imagine 128 series 2 8Mb VRAM
- 105d 000b Imagine 128 series 2 8Mb H-VRAM
- 11a4 000a Barco Metheus 5 Megapixel
- 13cc 0000 Barco Metheus 5 Megapixel
- 13cc 0004 Barco Metheus 5 Megapixel
- 13cc 0005 Barco Metheus 5 Megapixel
- 13cc 0006 Barco Metheus 5 Megapixel
- 13cc 0008 Barco Metheus 5 Megapixel
- 13cc 0009 Barco Metheus 5 Megapixel
- 13cc 000a Barco Metheus 5 Megapixel
- 13cc 000c Barco Metheus 5 Megapixel
- 493d Imagine 128 T2R [Ticket to Ride]
- 11a4 000a Barco Metheus 5 Megapixel, Dual Head
- 11a4 000b Barco Metheus 5 Megapixel, Dual Head
- 13cc 0002 Barco Metheus 4 Megapixel, Dual Head
- 13cc 0003 Barco Metheus 5 Megapixel, Dual Head
- 13cc 0007 Barco Metheus 5 Megapixel, Dual Head
- 13cc 0008 Barco Metheus 5 Megapixel, Dual Head
- 13cc 0009 Barco Metheus 5 Megapixel, Dual Head
- 13cc 000a Barco Metheus 5 Megapixel, Dual Head
- 5348 Revolution 4
- 105d 0037 Revolution IV-FP AGP (For SGI 1600SW)
-105e Vtech Computers Ltd
-105f Infotronic America Inc
-1060 United Microelectronics [UMC]
- 0001 UM82C881
- 0002 UM82C886
- 0101 UM8673F
- 0881 UM8881
- 0886 UM8886F
- 0891 UM8891A
- 1001 UM886A
- 673a UM8886BF
- 673b EIDE Master/DMA
- 8710 UM8710
- 886a UM8886A
- 8881 UM8881F
- 8886 UM8886F
- 888a UM8886A
- 8891 UM8891A
- 9017 UM9017F
- 9018 UM9018
- 9026 UM9026
- e881 UM8881N
- e886 UM8886N
- e88a UM8886N
- e891 UM8891N
-1061 I.I.T.
- 0001 AGX016
- 0002 IIT3204/3501
-1062 Maspar Computer Corp
-1063 Ocean Office Automation
-1064 Alcatel
-1065 Texas Microsystems
-1066 PicoPower Technology
- 0000 PT80C826
- 0001 PT86C521 [Vesuvius v1] Host Bridge
- 0002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Master
- 0003 PT86C524 [Nile] PCI-to-PCI Bridge
- 0004 PT86C525 [Nile-II] PCI-to-PCI Bridge
- 0005 National PC87550 System Controller
- 8002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave
-1067 Mitsubishi Electric
- 1002 VG500 [VolumePro Volume Rendering Accelerator]
-1068 Diversified Technology
-1069 Mylex Corporation
- 0001 DAC960P
- 0002 DAC960PD
- 0010 DAC960PX
- 0050 AcceleRAID 352/170/160 support Device
- ba55 eXtremeRAID 1100 support Device
- ba56 eXtremeRAID 2000/3000 support Device
-106a Aten Research Inc
-106b Apple Computer Inc.
- 0001 Bandit PowerPC host bridge
- 0002 Grand Central I/O
- 0003 Control Video
- 0004 PlanB Video-In
- 0007 O'Hare I/O
- 000e Hydra Mac I/O
- 0010 Heathrow Mac I/O
- 0017 Paddington Mac I/O
- 0018 UniNorth FireWire
- 0019 KeyLargo USB
- 001e UniNorth Internal PCI
- 001f UniNorth PCI
- 0020 UniNorth AGP
- 0021 UniNorth GMAC (Sun GEM)
- 0022 KeyLargo Mac I/O
- 0024 UniNorth/Pangea GMAC (Sun GEM)
- 0025 KeyLargo/Pangea Mac I/O
- 0026 KeyLargo/Pangea USB
- 0027 UniNorth/Pangea AGP
- 0028 UniNorth/Pangea PCI
- 0029 UniNorth/Pangea Internal PCI
- 002d UniNorth 1.5 AGP
- 002e UniNorth 1.5 PCI
- 002f UniNorth 1.5 Internal PCI
- 0030 UniNorth/Pangea FireWire
- 0031 UniNorth 2 FireWire
- 0032 UniNorth 2 GMAC (Sun GEM)
- 0033 UniNorth 2 ATA/100
- 0034 UniNorth 2 AGP
- 1645 Tigon3 Gigabit Ethernet NIC (BCM5701)
-106c Hyundai Electronics America
- 8801 Dual Pentium ISA/PCI Motherboard
- 8802 PowerPC ISA/PCI Motherboard
- 8803 Dual Window Graphics Accelerator
- 8804 LAN Controller
- 8805 100-BaseT LAN
-106d Sequent Computer Systems
-106e DFI, Inc
-106f City Gate Development Ltd
-1070 Daewoo Telecom Ltd
-1071 Mitac
-1072 GIT Co Ltd
-1073 Yamaha Corporation
- 0001 3D GUI Accelerator
- 0002 YGV615 [RPA3 3D-Graphics Controller]
- 0003 YMF-740
- 0004 YMF-724
- 1073 0004 YMF724-Based PCI Audio Adapter
- 0005 DS1 Audio
- 1073 0005 DS-XG PCI Audio CODEC
- 0006 DS1 Audio
- 0008 DS1 Audio
- 1073 0008 DS-XG PCI Audio CODEC
- 000a DS1L Audio
- 1073 0004 DS-XG PCI Audio CODEC
- 1073 000a DS-XG PCI Audio CODEC
- 000c YMF-740C [DS-1L Audio Controller]
- 107a 000c DS-XG PCI Audio CODEC
- 000d YMF-724F [DS-1 Audio Controller]
- 1073 000d DS-XG PCI Audio CODEC
- 0010 YMF-744B [DS-1S Audio Controller]
- 1073 0006 DS-XG PCI Audio CODEC
- 1073 0010 DS-XG PCI Audio CODEC
- 0012 YMF-754 [DS-1E Audio Controller]
- 1073 0012 DS-XG PCI Audio Codec
- 0020 DS-1 Audio
- 2000 DS2416 Digital Mixing Card
- 1073 2000 DS2416 Digital Mixing Card
-1074 NexGen Microsystems
- 4e78 82c500/1
-1075 Advanced Integrations Research
-1076 Chaintech Computer Co. Ltd
-1077 QLogic Corp.
- 1016 ISP10160 Single Channel Ultra3 SCSI Processor
- 1020 ISP1020 Fast-wide SCSI
- 1022 ISP1022 Fast-wide SCSI
- 1080 ISP1080 SCSI Host Adapter
- 1216 ISP12160 Dual Channel Ultra3 SCSI Processor
- 101e 8471 QLA12160 on AMI MegaRAID
- 101e 8493 QLA12160 on AMI MegaRAID
- 1240 ISP1240 SCSI Host Adapter
- 1280 ISP1280
- 2020 ISP2020A Fast!SCSI Basic Adapter
- 2100 QLA2100 64-bit Fibre Channel Adapter
- 1077 0001 QLA2100 64-bit Fibre Channel Adapter
- 2200 QLA2200
- 1077 0002 QLA2200
- 2300 QLA2300 64-bit FC-AL Adapter
- 2312 QLA2312 Fibre Channel Adapter
-1078 Cyrix Corporation
- 0000 5510 [Grappa]
- 0001 PCI Master
- 0002 5520 [Cognac]
- 0100 5530 Legacy [Kahlua]
- 0101 5530 SMI [Kahlua]
- 0102 5530 IDE [Kahlua]
- 0103 5530 Audio [Kahlua]
- 0104 5530 Video [Kahlua]
- 0400 ZFMicro PCI Bridge
- 0401 ZFMicro Chipset SMI
- 0402 ZFMicro Chipset IDE
- 0403 ZFMicro Expansion Bus
-1079 I-Bus
-107a NetWorth
-107b Gateway 2000
-107c LG Electronics [Lucky Goldstar Co. Ltd]
-107d LeadTek Research Inc.
- 0000 P86C850
-107e Interphase Corporation
- 0001 5515 ATM Adapter [Flipper]
- 0002 100 VG AnyLan Controller
- 0004 5526 Fibre Channel Host Adapter
- 0005 x526 Fibre Channel Host Adapter
- 0008 5525/5575 ATM Adapter (155 Mbit) [Atlantic]
- 9003 5535-4P-BRI-ST
- 9007 5535-4P-BRI-U
- 9008 5535-1P-SR
- 900c 5535-1P-SR-ST
- 900e 5535-1P-SR-U
- 9011 5535-1P-PRI
- 9013 5535-2P-PRI
- 9023 5536-4P-BRI-ST
- 9027 5536-4P-BRI-U
- 9031 5536-1P-PRI
- 9033 5536-2P-PRI
-107f Data Technology Corporation
- 0802 SL82C105
-1080 Contaq Microsystems
- 0600 82C599
- c691 Cypress CY82C691
- c693 82c693
-1081 Supermac Technology
- 0d47 Radius PCI to NuBUS Bridge
-1082 EFA Corporation of America
-1083 Forex Computer Corporation
- 0001 FR710
-1084 Parador
-1085 Tulip Computers Int.B.V.
-1086 J. Bond Computer Systems
-1087 Cache Computer
-1088 Microcomputer Systems (M) Son
-1089 Data General Corporation
-# Formerly Bit3 Computer Corp.
-108a SBS Technologies
- 0001 VME Bridge Model 617
- 0010 VME Bridge Model 618
- 0040 dataBLIZZARD
- 3000 VME Bridge Model 2706
-108c Oakleigh Systems Inc.
-108d Olicom
- 0001 Token-Ring 16/4 PCI Adapter (3136/3137)
- 0002 16/4 Token Ring
- 0004 RapidFire 3139 Token-Ring 16/4 PCI Adapter
- 108d 0004 OC-3139/3140 RapidFire Token-Ring 16/4 Adapter
- 0005 GoCard 3250 Token-Ring 16/4 CardBus PC Card
- 0006 OC-3530 RapidFire Token-Ring 100
- 0007 RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter
- 108d 0007 OC-3141 RapidFire Token-Ring 16/4 Adapter
- 0008 RapidFire 3540 HSTR 100/16/4 PCI Adapter
- 108d 0008 OC-3540 RapidFire HSTR 100/16/4 Adapter
- 0011 OC-2315
- 0012 OC-2325
- 0013 OC-2183/2185
- 0014 OC-2326
- 0019 OC-2327/2250 10/100 Ethernet Adapter
- 108d 0016 OC-2327 Rapidfire 10/100 Ethernet Adapter
- 108d 0017 OC-2250 GoCard 10/100 Ethernet Adapter
- 0021 OC-6151/6152 [RapidFire ATM 155]
- 0022 ATM Adapter
-108e Sun Microsystems Computer Corp.
- 0001 EBUS
- 1000 EBUS
- 1001 Happy Meal
- 1100 RIO EBUS
- 1101 RIO GEM
- 1102 RIO 1394
- 1103 RIO USB
- 2bad GEM
- 5000 Simba Advanced PCI Bridge
- 5043 SunPCI Co-processor
- 8000 Psycho PCI Bus Module
- 8001 Schizo PCI Bus Module
- a000 Ultra IIi
- a001 Ultra IIe
-108f Systemsoft
-1090 Encore Computer Corporation
-1091 Intergraph Corporation
- 0020 3D graphics processor
- 0021 3D graphics processor w/Texturing
- 0040 3D graphics frame buffer
- 0041 3D graphics frame buffer
- 0060 Proprietary bus bridge
- 00e4 Powerstorm 4D50T
- 0720 Motion JPEG codec
-1092 Diamond Multimedia Systems
- 00a0 Speedstar Pro SE
- 00a8 Speedstar 64
- 0550 Viper V550
- 08d4 Supra 2260 Modem
- 094c SupraExpress 56i Pro
- 1092 Viper V330
- 6120 Maximum DVD
- 8810 Stealth SE
- 8811 Stealth 64/SE
- 8880 Stealth
- 8881 Stealth
- 88b0 Stealth 64
- 88b1 Stealth 64
- 88c0 Stealth 64
- 88c1 Stealth 64
- 88d0 Stealth 64
- 88d1 Stealth 64
- 88f0 Stealth 64
- 88f1 Stealth 64
- 9999 DMD-I0928-1 "Monster sound" sound chip
-1093 National Instruments
- 0160 PCI-DIO-96
- 0162 PCI-MIO-16XE-50
- 1170 PCI-MIO-16XE-10
- 1180 PCI-MIO-16E-1
- 1190 PCI-MIO-16E-4
- 1330 PCI-6031E
- 1350 PCI-6071E
- 2a60 PCI-6023E
- b001 IMAQ-PCI-1408
- b011 IMAQ-PXI-1408
- b021 IMAQ-PCI-1424
- b031 IMAQ-PCI-1413
- b041 IMAQ-PCI-1407
- b051 IMAQ-PXI-1407
- b061 IMAQ-PCI-1411
- b071 IMAQ-PCI-1422
- b081 IMAQ-PXI-1422
- b091 IMAQ-PXI-1411
- c801 PCI-GPIB
- c831 PCI-GPIB bridge
-1094 First International Computers [FIC]
-1095 CMD Technology Inc
- 0240 Adaptec AAR-1210SA SATA HostRAID Controller
- 0640 PCI0640
- 0643 PCI0643
- 0646 PCI0646
- 0647 PCI0647
- 0648 PCI0648
- 0649 PCI0649
- 0e11 005d Integrated Ultra ATA-100 Dual Channel Controller
- 0e11 007e Integrated Ultra ATA-100 IDE RAID Controller
- 101e 0649 AMI MegaRAID IDE 100 Controller
- 0650 PBC0650A
- 0670 USB0670
- 1095 0670 USB0670
- 0673 USB0673
- 0680 PCI0680
- 3112 Silicon Image SiI 3112 SATARaid Controller
-1096 Alacron
-1097 Appian Technology
-1098 Quantum Designs (H.K.) Ltd
- 0001 QD-8500
- 0002 QD-8580
-1099 Samsung Electronics Co., Ltd
-109a Packard Bell
-109b Gemlight Computer Ltd.
-109c Megachips Corporation
-109d Zida Technologies Ltd.
-109e Brooktree Corporation
- 0350 Bt848 Video Capture
- 0351 Bt849A Video capture
- 0369 Bt878 Video Capture
- 1002 0001 TV-Wonder
- 1002 0003 TV-Wonder/VE
- 036c Bt879(??) Video Capture
- 13e9 0070 Win/TV (Video Section)
- 036e Bt878 Video Capture
- 0070 13eb WinTV Series
- 0070 ff01 Viewcast Osprey 200
- 107d 6606 WinFast TV 2000
- 11bd 0012 PCTV pro (TV + FM stereo receiver)
- 11bd 001c PCTV Sat (DBC receiver)
- 127a 0001 Bt878 Mediastream Controller NTSC
- 127a 0002 Bt878 Mediastream Controller PAL BG
- 127a 0003 Bt878a Mediastream Controller PAL BG
- 127a 0048 Bt878/832 Mediastream Controller
- 144f 3000 MagicTView CPH060 - Video
- 1461 0004 AVerTV WDM Video Capture
- 14f1 0001 Bt878 Mediastream Controller NTSC
- 14f1 0002 Bt878 Mediastream Controller PAL BG
- 14f1 0003 Bt878a Mediastream Controller PAL BG
- 14f1 0048 Bt878/832 Mediastream Controller
- 1851 1850 FlyVideo'98 - Video
- 1851 1851 FlyVideo II
- 1852 1852 FlyVideo'98 - Video (with FM Tuner)
- bd11 1200 PCTV pro (TV + FM stereo receiver)
- 036f Bt879 Video Capture
- 127a 0044 Bt879 Video Capture NTSC
- 127a 0122 Bt879 Video Capture PAL I
- 127a 0144 Bt879 Video Capture NTSC
- 127a 0222 Bt879 Video Capture PAL BG
- 127a 0244 Bt879a Video Capture NTSC
- 127a 0322 Bt879 Video Capture NTSC
- 127a 0422 Bt879 Video Capture NTSC
- 127a 1122 Bt879 Video Capture PAL I
- 127a 1222 Bt879 Video Capture PAL BG
- 127a 1322 Bt879 Video Capture NTSC
- 127a 1522 Bt879a Video Capture PAL I
- 127a 1622 Bt879a Video Capture PAL BG
- 127a 1722 Bt879a Video Capture NTSC
- 14f1 0044 Bt879 Video Capture NTSC
- 14f1 0122 Bt879 Video Capture PAL I
- 14f1 0144 Bt879 Video Capture NTSC
- 14f1 0222 Bt879 Video Capture PAL BG
- 14f1 0244 Bt879a Video Capture NTSC
- 14f1 0322 Bt879 Video Capture NTSC
- 14f1 0422 Bt879 Video Capture NTSC
- 14f1 1122 Bt879 Video Capture PAL I
- 14f1 1222 Bt879 Video Capture PAL BG
- 14f1 1322 Bt879 Video Capture NTSC
- 14f1 1522 Bt879a Video Capture PAL I
- 14f1 1622 Bt879a Video Capture PAL BG
- 14f1 1722 Bt879a Video Capture NTSC
- 1851 1850 FlyVideo'98 - Video
- 1851 1851 FlyVideo II
- 1852 1852 FlyVideo'98 - Video (with FM Tuner)
- 0370 Bt880 Video Capture
- 1851 1850 FlyVideo'98
- 1851 1851 FlyVideo'98 EZ - video
- 1852 1852 FlyVideo'98 (with FM Tuner)
- 0878 Bt878 Audio Capture
- 0070 13eb WinTV Series
- 0070 ff01 Viewcast Osprey 200
- 1002 0001 TV-Wonder
- 1002 0003 TV-Wonder/VE
- 11bd 0012 PCTV pro (TV + FM stereo receiver, audio section)
- 11bd 001c PCTV Sat (DBC receiver)
- 127a 0001 Bt878 Video Capture (Audio Section)
- 127a 0002 Bt878 Video Capture (Audio Section)
- 127a 0003 Bt878 Video Capture (Audio Section)
- 127a 0048 Bt878 Video Capture (Audio Section)
- 13e9 0070 Win/TV (Audio Section)
- 144f 3000 MagicTView CPH060 - Audio
- 1461 0004 AVerTV WDM Audio Capture
- 14f1 0001 Bt878 Video Capture (Audio Section)
- 14f1 0002 Bt878 Video Capture (Audio Section)
- 14f1 0003 Bt878 Video Capture (Audio Section)
- 14f1 0048 Bt878 Video Capture (Audio Section)
- bd11 1200 PCTV pro (TV + FM stereo receiver, audio section)
- 0879 Bt879 Audio Capture
- 127a 0044 Bt879 Video Capture (Audio Section)
- 127a 0122 Bt879 Video Capture (Audio Section)
- 127a 0144 Bt879 Video Capture (Audio Section)
- 127a 0222 Bt879 Video Capture (Audio Section)
- 127a 0244 Bt879 Video Capture (Audio Section)
- 127a 0322 Bt879 Video Capture (Audio Section)
- 127a 0422 Bt879 Video Capture (Audio Section)
- 127a 1122 Bt879 Video Capture (Audio Section)
- 127a 1222 Bt879 Video Capture (Audio Section)
- 127a 1322 Bt879 Video Capture (Audio Section)
- 127a 1522 Bt879 Video Capture (Audio Section)
- 127a 1622 Bt879 Video Capture (Audio Section)
- 127a 1722 Bt879 Video Capture (Audio Section)
- 14f1 0044 Bt879 Video Capture (Audio Section)
- 14f1 0122 Bt879 Video Capture (Audio Section)
- 14f1 0144 Bt879 Video Capture (Audio Section)
- 14f1 0222 Bt879 Video Capture (Audio Section)
- 14f1 0244 Bt879 Video Capture (Audio Section)
- 14f1 0322 Bt879 Video Capture (Audio Section)
- 14f1 0422 Bt879 Video Capture (Audio Section)
- 14f1 1122 Bt879 Video Capture (Audio Section)
- 14f1 1222 Bt879 Video Capture (Audio Section)
- 14f1 1322 Bt879 Video Capture (Audio Section)
- 14f1 1522 Bt879 Video Capture (Audio Section)
- 14f1 1622 Bt879 Video Capture (Audio Section)
- 14f1 1722 Bt879 Video Capture (Audio Section)
- 0880 Bt880 Audio Capture
- 2115 BtV 2115 Mediastream controller
- 2125 BtV 2125 Mediastream controller
- 2164 BtV 2164
- 2165 BtV 2165
- 8230 Bt8230 ATM Segment/Reassembly Ctrlr (SRC)
- 8472 Bt8472
- 8474 Bt8474
-109f Trigem Computer Inc.
-10a0 Meidensha Corporation
-10a1 Juko Electronics Ind. Co. Ltd
-10a2 Quantum Corporation
-10a3 Everex Systems Inc
-10a4 Globe Manufacturing Sales
-10a5 Smart Link Ltd.
- 3052 SmartPCI562 56K Modem
- 5449 SmartPCI561 modem
-10a6 Informtech Industrial Ltd.
-10a7 Benchmarq Microelectronics
-10a8 Sierra Semiconductor
- 0000 STB Horizon 64
-10a9 Silicon Graphics, Inc.
- 0001 Crosstalk to PCI Bridge
- 0002 Linc I/O controller
- 0003 IOC3 I/O controller
- 0004 O2 MACE
- 0005 RAD Audio
- 0006 HPCEX
- 0007 RPCEX
- 0008 DiVO VIP
- 0009 Alteon Gigabit Ethernet
- 10a9 8002 Acenic Gigabit Ethernet
- 0010 AMP Video I/O
- 0011 GRIP
- 0012 SGH PSHAC GSN
- 1001 Magic Carpet
- 1002 Lithium
- 1003 Dual JPEG 1
- 1004 Dual JPEG 2
- 1005 Dual JPEG 3
- 1006 Dual JPEG 4
- 1007 Dual JPEG 5
- 1008 Cesium
- 100a IOC4 I/O controller
- 2001 Fibre Channel
- 2002 ASDE
- 8001 O2 1394
- 8002 G-net NT
-10aa ACC Microelectronics
- 0000 ACCM 2188
-10ab Digicom
-10ac Honeywell IAC
-10ad Symphony Labs
- 0001 W83769F
- 0003 SL82C103
- 0005 SL82C105
- 0103 SL82c103
- 0105 SL82c105
- 0565 W83C553
-10ae Cornerstone Technology
-10af Micro Computer Systems Inc
-10b0 CardExpert Technology
-10b1 Cabletron Systems Inc
-10b2 Raytheon Company
-10b3 Databook Inc
- 3106 DB87144
- b106 DB87144
-10b4 STB Systems Inc
- 1b1d Velocity 128 3D
- 10b4 237e Velocity 4400
-10b5 PLX Technology, Inc.
- 0001 i960 PCI bus interface
- 1076 VScom 800 8 port serial adaptor
- 1077 VScom 400 4 port serial adaptor
- 1078 VScom 210 2 port serial and 1 port parallel adaptor
- 1103 VScom 200 2 port serial adaptor
- 1146 VScom 010 1 port parallel adaptor
- 1147 VScom 020 2 port parallel adaptor
- 2724 Thales PCSM Security Card
- 9030 PCI <-> IOBus Bridge Hot Swap
- 15ed 1002 MCCS 8-port Serial Hot Swap
- 15ed 1003 MCCS 16-port Serial Hot Swap
- 9036 9036
- 9050 PCI <-> IOBus Bridge
- 10b5 2036 SatPak GPS
- 10b5 2273 SH-ARC SoHard ARCnet card
- 10b5 9050 MP9050
- 1522 0001 RockForce 4 Port V.90 Data/Fax/Voice Modem
- 1522 0002 RockForce 2 Port V.90 Data/Fax/Voice Modem
- 1522 0003 RockForce 6 Port V.90 Data/Fax/Voice Modem
- 1522 0004 RockForce 8 Port V.90 Data/Fax/Voice Modem
- 1522 0010 RockForce2000 4 Port V.90 Data/Fax/Voice Modem
- 1522 0020 RockForce2000 2 Port V.90 Data/Fax/Voice Modem
- 15ed 1000 Macrolink MCCS 8-port Serial
- 15ed 1001 Macrolink MCCS 16-port Serial
- 15ed 1002 Macrolink MCCS 8-port Serial Hot Swap
- 15ed 1003 Macrolink MCCS 16-port Serial Hot Swap
- 5654 5634 OpenLine4 Telephony Card
- d531 c002 PCIntelliCAN 2xSJA1000 CAN bus
- d84d 4006 EX-4006 1P
- d84d 4008 EX-4008 1P EPP/ECP
- d84d 4014 EX-4014 2P
- d84d 4018 EX-4018 3P EPP/ECP
- d84d 4025 EX-4025 1S(16C550) RS-232
- d84d 4027 EX-4027 1S(16C650) RS-232
- d84d 4028 EX-4028 1S(16C850) RS-232
- d84d 4036 EX-4036 2S(16C650) RS-232
- d84d 4037 EX-4037 2S(16C650) RS-232
- d84d 4038 EX-4038 2S(16C850) RS-232
- d84d 4052 EX-4052 1S(16C550) RS-422/485
- d84d 4053 EX-4053 2S(16C550) RS-422/485
- d84d 4055 EX-4055 4S(16C550) RS-232
- d84d 4058 EX-4055 4S(16C650) RS-232
- d84d 4065 EX-4065 8S(16C550) RS-232
- d84d 4068 EX-4068 8S(16C650) RS-232
- d84d 4078 EX-4078 2S(16C552) RS-232+1P
- 9054 PCI <-> IOBus Bridge
- 10b5 2455 Wessex Techology PHIL-PCI
- 12d9 0002 PCI Prosody Card rev 1.5
- 9060 9060
- 906d 9060SD
- 125c 0640 Aries 16000P
- 906e 9060ES
- 9080 9080
- 10b5 9080 9080 [real subsystem ID not set]
- 129d 0002 Aculab PCI Prosidy card
- 12d9 0002 PCI Prosody Card
-10b6 Madge Networks
- 0001 Smart 16/4 PCI Ringnode
- 0002 Smart 16/4 PCI Ringnode Mk2
- 10b6 0002 Smart 16/4 PCI Ringnode Mk2
- 10b6 0006 16/4 CardBus Adapter
- 0003 Smart 16/4 PCI Ringnode Mk3
- 0e11 b0fd Compaq NC4621 PCI, 4/16, WOL
- 10b6 0003 Smart 16/4 PCI Ringnode Mk3
- 10b6 0007 Presto PCI Plus Adapter
- 0004 Smart 16/4 PCI Ringnode Mk1
- 0006 16/4 Cardbus Adapter
- 10b6 0006 16/4 CardBus Adapter
- 0007 Presto PCI Adapter
- 10b6 0007 Presto PCI
- 0009 Smart 100/16/4 PCI-HS Ringnode
- 10b6 0009 Smart 100/16/4 PCI-HS Ringnode
- 000a Smart 100/16/4 PCI Ringnode
- 10b6 000a Smart 100/16/4 PCI Ringnode
- 000b 16/4 CardBus Adapter Mk2
- 10b6 0008 16/4 CardBus Adapter Mk2
- 10b6 000b 16/4 Cardbus Adapter Mk2
- 000c RapidFire 3140V2 16/4 TR Adapter
- 10b6 000c RapidFire 3140V2 16/4 TR Adapter
- 1000 Collage 25/155 ATM Client Adapter
- 1001 Collage 155 ATM Server Adapter
-10b7 3Com Corporation
- 0001 3c985 1000BaseSX (SX/TX)
- 0910 3C910-A01
- 1006 MINI PCI type 3B Data Fax Modem
- 1007 Mini PCI 56k Winmodem
- 10b7 615c Mini PCI 56K Modem
- 3390 3c339 TokenLink Velocity
- 3590 3c359 TokenLink Velocity XL
- 10b7 3590 TokenLink Velocity XL Adapter (3C359/359B)
- 4500 3c450 Cyclone/unknown
- 5055 3c555 Laptop Hurricane
- 5057 3c575 [Megahertz] 10/100 LAN CardBus
- 10b7 5a57 3C575 Megahertz 10/100 LAN Cardbus PC Card
- 5157 3c575 [Megahertz] 10/100 LAN CardBus
- 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card
- 5257 3CCFE575CT Cyclone CardBus
- 10b7 5c57 FE575C-3Com 10/100 LAN CardBus-Fast Ethernet
- 5900 3c590 10BaseT [Vortex]
- 5920 3c592 EISA 10mbps Demon/Vortex
- 5950 3c595 100BaseTX [Vortex]
- 5951 3c595 100BaseT4 [Vortex]
- 5952 3c595 100Base-MII [Vortex]
- 5970 3c597 EISA Fast Demon/Vortex
- 5b57 3c595 [Megahertz] 10/100 LAN CardBus
- 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card
- 6055 3c556 Hurricane CardBus
- 6056 3c556B Hurricane CardBus
- 10b7 6556 10/100 Mini PCI Ethernet Adapter
- 6560 3CCFE656 Cyclone CardBus
- 10b7 656a 3CCFEM656 10/100 LAN+56K Modem CardBus
- 6561 3CCFEM656 10/100 LAN+56K Modem CardBus
- 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus
- 6562 3CCFEM656 [id 6562] Cyclone CardBus
- 10b7 656b 3CCFEM656B 10/100 LAN+56K Modem CardBus
- 6563 3CCFEM656B 10/100 LAN+56K Modem CardBus
- 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus
- 6564 3CCFEM656 [id 6564] Cyclone CardBus
- 7646 3cSOHO100-TX Hurricane
- 7940 3c803 FDDILink UTP Controller
- 7980 3c804 FDDILink SAS Controller
- 7990 3c805 FDDILink DAS Controller
- 8811 Token ring
- 9000 3c900 10BaseT [Boomerang]
- 9001 3c900 Combo [Boomerang]
- 9004 3c900B-TPO [Etherlink XL TPO]
- 10b7 9004 3C900B-TPO Etherlink XL TPO 10Mb
- 9005 3c900B-Combo [Etherlink XL Combo]
- 10b7 9005 3C900B-Combo Etherlink XL Combo
- 9006 3c900B-TPC [Etherlink XL TPC]
- 900a 3c900B-FL [Etherlink XL FL]
- 9050 3c905 100BaseTX [Boomerang]
- 9051 3c905 100BaseT4 [Boomerang]
- 9055 3c905B 100BaseTX [Cyclone]
- 1028 0080 3C905B Fast Etherlink XL 10/100
- 1028 0081 3C905B Fast Etherlink XL 10/100
- 1028 0082 3C905B Fast Etherlink XL 10/100
- 1028 0083 3C905B Fast Etherlink XL 10/100
- 1028 0084 3C905B Fast Etherlink XL 10/100
- 1028 0085 3C905B Fast Etherlink XL 10/100
- 1028 0086 3C905B Fast Etherlink XL 10/100
- 1028 0087 3C905B Fast Etherlink XL 10/100
- 1028 0088 3C905B Fast Etherlink XL 10/100
- 1028 0089 3C905B Fast Etherlink XL 10/100
- 1028 0090 3C905B Fast Etherlink XL 10/100
- 1028 0091 3C905B Fast Etherlink XL 10/100
- 1028 0092 3C905B Fast Etherlink XL 10/100
- 1028 0093 3C905B Fast Etherlink XL 10/100
- 1028 0094 3C905B Fast Etherlink XL 10/100
- 1028 0095 3C905B Fast Etherlink XL 10/100
- 1028 0096 3C905B Fast Etherlink XL 10/100
- 1028 0097 3C905B Fast Etherlink XL 10/100
- 1028 0098 3C905B Fast Etherlink XL 10/100
- 1028 0099 3C905B Fast Etherlink XL 10/100
- 10b7 9055 3C905B Fast Etherlink XL 10/100
- 9056 3c905B-T4 [Fast EtherLink XL 10/100]
- 9058 3c905B-Combo [Deluxe Etherlink XL 10/100]
- 905a 3c905B-FX [Fast Etherlink XL FX 10/100]
- 9200 3c905C-TX/TX-M [Tornado]
- 1028 0095 Integrated 3C905C-TX Fast Etherlink for PC Management NIC
- 10b7 1000 3C905C-TX Fast Etherlink for PC Management NIC
- 10b7 7000 10/100 Mini PCI Ethernet Adapter
- 9201 3C920B-EMB Integrated Fast Ethernet Controller
- 9300 3CSOHO100B-TX [910-A01]
- 9800 3c980-TX [Fast Etherlink XL Server Adapter]
- 10b7 9800 3c980-TX Fast Etherlink XL Server Adapter
- 9805 3c980-TX 10/100baseTX NIC [Python-T]
- 10b7 1201 3c982-TXM 10/100baseTX Dual Port A [Hydra]
- 10b7 1202 3c982-TXM 10/100baseTX Dual Port B [Hydra]
- 10b7 9805 3c980 10/100baseTX NIC [Python-T]
- 10f1 2462 Thunder K7 S2462
- 9900 3C990-TX [Typhoon]
- 9902 3CR990-TX-95 [Typhoon 56-bit]
- 9903 3CR990-TX-97 [Typhoon 168-bit]
- 9904 3C990B-TX-M/3C990BSVR [Typhoon2]
- 10b7 1000 3CR990B-TX-M [Typhoon2]
- 10b7 2000 3CR990BSVR [Typhoon2 Server]
- 9905 3CR990-FX-95/97/95 [Typhon Fiber]
- 10b7 1101 3CR990-FX-95 [Typhoon Fiber 56-bit]
- 10b7 1102 3CR990-FX-97 [Typhoon Fiber 168-bit]
- 10b7 2101 3CR990-FX-95 Server [Typhoon Fiber 56-bit]
- 10b7 2102 3CR990-FX-97 Server [Typhoon Fiber 168-bit]
- 9908 3CR990SVR95 [Typhoon Server 56-bit]
- 9909 3CR990SVR97 [Typhoon Server 168-bit]
- 990b 3C990SVR [Typhoon Server]
-10b8 Standard Microsystems Corp [SMC]
- 0005 83C170QF
- 1055 e000 LANEPIC 10/100 [EVB171Q-PCI]
- 1055 e002 LANEPIC 10/100 [EVB171G-PCI]
- 10b8 a011 EtherPower II 10/100
- 10b8 a014 EtherPower II 10/100
- 10b8 a015 EtherPower II 10/100
- 10b8 a016 EtherPower II 10/100
- 10b8 a017 EtherPower II 10/100
- 0006 LANEPIC
- 1055 e100 LANEPIC Cardbus Fast Ethernet Adapter
- 1055 e102 LANEPIC Cardbus Fast Ethernet Adapter
- 1055 e300 LANEPIC Cardbus Fast Ethernet Adapter
- 1055 e302 LANEPIC Cardbus Fast Ethernet Adapter
- 10b8 a012 LANEPIC Cardbus Fast Ethernet Adapter
- 13a2 8002 LANEPIC Cardbus Fast Ethernet Adapter
- 13a2 8006 LANEPIC Cardbus Fast Ethernet Adapter
- 1000 FDC 37c665
- 1001 FDC 37C922
- a011 83C170QF
- b106 SMC34C90
-10b9 ALi Corporation
- 0111 C-Media CMI8738/C3DX Audio Device (OEM)
- 10b9 0111 C-Media CMI8738/C3DX Audio Device (OEM)
- 1435 M1435
- 1445 M1445
- 1449 M1449
- 1451 M1451
- 1461 M1461
- 1489 M1489
- 1511 M1511 [Aladdin]
- 1512 M1512 [Aladdin]
- 1513 M1513 [Aladdin]
- 1521 M1521 [Aladdin III]
- 10b9 1521 ALI M1521 Aladdin III CPU Bridge
- 1523 M1523
- 10b9 1523 ALI M1523 ISA Bridge
- 1531 M1531 [Aladdin IV]
- 1533 M1533 PCI to ISA Bridge [Aladdin IV]
- 10b9 1533 ALI M1533 Aladdin IV ISA Bridge
- 1541 M1541
- 10b9 1541 ALI M1541 Aladdin V/V+ AGP System Controller
- 1543 M1543
- 1563 M1563 HyperTransport South Bridge
- 1621 M1621
- 1631 ALI M1631 PCI North Bridge Aladdin Pro III
- 1632 M1632M Northbridge+Trident
- 1641 ALI M1641 PCI North Bridge Aladdin Pro IV
- 1644 M1644/M1644T Northbridge+Trident
- 1646 M1646 Northbridge+Trident
- 1647 M1647 Northbridge [MAGiK 1 / MobileMAGiK 1]
- 1651 M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM]
- 1671 M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]
- 1681 M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR]
- 1687 M1687 K8 Northbridge [AGP8X and HyperTransport]
- 3141 M3141
- 3143 M3143
- 3145 M3145
- 3147 M3147
- 3149 M3149
- 3151 M3151
- 3307 M3307
- 3309 M3309
- 5212 M4803
- 5215 MS4803
- 5217 M5217H
- 5219 M5219
- 5225 M5225
- 5229 M5229 IDE
- 1043 8053 A7A266 Motherboard IDE
- 5235 M5225
- 5237 USB 1.1 Controller
- 5239 USB 2.0 Controller
- 5243 M1541 PCI to AGP Controller
- 5247 PCI to AGP Controller
- 5249 M5249 HTT to PCI Bridge
- 5251 M5251 P1394 OHCI 1.0 Controller
- 5253 M5253 P1394 OHCI 1.1 Controller
- 5261 M5261 Ethernet Controller
- 5450 Lucent Technologies Soft Modem AMR
- 5451 M5451 PCI AC-Link Controller Audio Device
- 1014 0506 ThinkPad R30
- 5453 M5453 PCI AC-Link Controller Modem Device
- 5455 M5455 PCI AC-Link Controller Audio Device
- 5457 Intel 537 [M5457 AC-Link Modem]
-# Same but more usefull for driver's lookup
- 5459 SmartLink SmartPCI561 56K Modem
-# SmartLink PCI SoftModem
- 545a SmartLink SmartPCI563 56K Modem
- 5471 M5471 Memory Stick Controller
- 5473 M5473 SD-MMC Controller
- 7101 M7101 PMU
- 10b9 7101 ALI M7101 Power Management Controller
-10ba Mitsubishi Electric Corp.
- 0301 AccelGraphics AccelECLIPSE
-10bb Dapha Electronics Corporation
-10bc Advanced Logic Research
-10bd Surecom Technology
- 0e34 NE-34
-10be Tseng Labs International Co.
-10bf Most Inc
-10c0 Boca Research Inc.
-10c1 ICM Co., Ltd.
-10c2 Auspex Systems Inc.
-10c3 Samsung Semiconductors, Inc.
- 1100 Smartether100 SC1100 LAN Adapter (i82557B)
-10c4 Award Software International Inc.
-10c5 Xerox Corporation
-10c6 Rambus Inc.
-10c7 Media Vision
-10c8 Neomagic Corporation
- 0001 NM2070 [MagicGraph 128]
- 0002 NM2090 [MagicGraph 128V]
- 0003 NM2093 [MagicGraph 128ZV]
- 0004 NM2160 [MagicGraph 128XD]
- 1014 00ba MagicGraph 128XD
- 1025 1007 MagicGraph 128XD
- 1028 0074 MagicGraph 128XD
- 1028 0075 MagicGraph 128XD
- 1028 007d MagicGraph 128XD
- 1028 007e MagicGraph 128XD
- 1033 802f MagicGraph 128XD
- 104d 801b MagicGraph 128XD
- 104d 802f MagicGraph 128XD
- 104d 830b MagicGraph 128XD
- 10ba 0e00 MagicGraph 128XD
- 10c8 0004 MagicGraph 128XD
- 10cf 1029 MagicGraph 128XD
- 10f7 8308 MagicGraph 128XD
- 10f7 8309 MagicGraph 128XD
- 10f7 830b MagicGraph 128XD
- 10f7 830d MagicGraph 128XD
- 10f7 8312 MagicGraph 128XD
- 0005 NM2200 [MagicGraph 256AV]
- 1014 00dd ThinkPad 570
- 0006 NM2360 [MagicMedia 256ZX]
- 0016 NM2380 [MagicMedia 256XL+]
- 10c8 0016 MagicMedia 256XL+
- 0025 NM2230 [MagicGraph 256AV+]
- 0083 NM2093 [MagicGraph 128ZV+]
- 8005 NM2200 [MagicMedia 256AV Audio]
- 0e11 b0d1 MagicMedia 256AV Audio Device on Discovery
- 0e11 b126 MagicMedia 256AV Audio Device on Durango
- 1014 00dd MagicMedia 256AV Audio Device on BlackTip Thinkpad
- 1025 1003 MagicMedia 256AV Audio Device on TravelMate 720
- 1028 008f MagicMedia 256AV Audio Device on Colorado Inspiron
- 103c 0007 MagicMedia 256AV Audio Device on Voyager II
- 103c 0008 MagicMedia 256AV Audio Device on Voyager III
- 103c 000d MagicMedia 256AV Audio Device on Omnibook 900
- 10c8 8005 MagicMedia 256AV Audio Device on FireAnt
- 110a 8005 MagicMedia 256AV Audio Device
- 14c0 0004 MagicMedia 256AV Audio Device
- 8006 NM2360 [MagicMedia 256ZX Audio]
- 8016 NM2380 [MagicMedia 256XL+ Audio]
-10c9 Dataexpert Corporation
-10ca Fujitsu Microelectr., Inc.
-10cb Omron Corporation
-10cc Mentor ARC Inc
-10cd Advanced System Products, Inc
- 1100 ASC1100
- 1200 ASC1200 [(abp940) Fast SCSI-II]
- 1300 ABP940-U / ABP960-U
- 10cd 1310 ASC1300 SCSI Adapter
- 2300 ABP940-UW
- 2500 ABP940-U2W
-10ce Radius
-10cf Citicorp TTI
- 2001 mb86605
-10d0 Fujitsu Limited
-10d1 FuturePlus Systems Corp.
-10d2 Molex Incorporated
-10d3 Jabil Circuit Inc
-10d4 Hualon Microelectronics
-10d5 Autologic Inc.
-10d6 Cetia
-10d7 BCM Advanced Research
-10d8 Advanced Peripherals Labs
-10d9 Macronix, Inc. [MXIC]
- 0512 MX98713
- 0531 MX987x5
- 1186 1200 DFE-540TX ProFAST 10/100 Adapter
- 8625 MX86250
- 8888 MX86200
-10da Compaq IPG-Austin
- 0508 TC4048 Token Ring 4/16
- 3390 Tl3c3x9
-10db Rohm LSI Systems, Inc.
-10dc CERN/ECP/EDU
- 0001 STAR/RD24 SCI-PCI (PMC)
- 0002 TAR/RD24 SCI-PCI (PMC)
- 0021 HIPPI destination
- 0022 HIPPI source
- 10dc ATT2C15-3 FPGA
-10dd Evans & Sutherland
-10de nVidia Corporation
- 0008 NV1 [EDGE 3D]
- 0009 NV1 [EDGE 3D]
- 0010 NV2 [Mutara V08]
- 0020 NV4 [RIVA TNT]
- 1043 0200 V3400 TNT
- 1048 0c18 Erazor II SGRAM
- 1048 0c1b Erazor II
- 1092 0550 Viper V550
- 1092 0552 Viper V550
- 1092 4804 Viper V550
- 1092 4808 Viper V550
- 1092 4810 Viper V550
- 1092 4812 Viper V550
- 1092 4815 Viper V550
- 1092 4820 Viper V550 with TV out
- 1092 4822 Viper V550
- 1092 4904 Viper V550
- 1092 4914 Viper V550
- 1092 8225 Viper V550
- 10b4 273d Velocity 4400
- 10b4 273e Velocity 4400
- 10b4 2740 Velocity 4400
- 10de 0020 Riva TNT
- 1102 1015 Graphics Blaster CT6710
- 1102 1016 Graphics Blaster RIVA TNT
- 0028 NV5 [RIVA TNT2/TNT2 Pro]
- 1043 0200 AGP-V3800 SGRAM
- 1043 0201 AGP-V3800 SDRAM
- 1043 0205 PCI-V3800
- 1043 4000 AGP-V3800PRO
- 1048 0c21 Synergy II
- 1092 4804 Viper V770
- 1092 4a00 Viper V770
- 1092 4a02 Viper V770 Ultra
- 1092 5a00 RIVA TNT2/TNT2 Pro
- 1092 6a02 Viper V770 Ultra
- 1092 7a02 Viper V770 Ultra
- 10de 0005 RIVA TNT2 Pro
- 10de 000f Compaq NVIDIA TNT2 Pro
- 1102 1020 3D Blaster RIVA TNT2
- 1102 1026 3D Blaster RIVA TNT2 Digital
- 14af 5810 Maxi Gamer Xentor
- 0029 NV5 [RIVA TNT2 Ultra]
- 1043 0200 AGP-V3800 Deluxe
- 1043 0201 AGP-V3800 Ultra SDRAM
- 1043 0205 PCI-V3800 Ultra
- 1102 1021 3D Blaster RIVA TNT2 Ultra
- 1102 1029 3D Blaster RIVA TNT2 Ultra
- 1102 102f 3D Blaster RIVA TNT2 Ultra
- 14af 5820 Maxi Gamer Xentor 32
- 002a NV5 [Riva TnT2]
- 002b NV5 [Riva TnT2]
- 002c NV6 [Vanta/Vanta LT]
- 1043 0200 AGP-V3800 Combat SDRAM
- 1043 0201 AGP-V3800 Combat
- 1092 6820 Viper V730
- 1102 1031 CT6938 VANTA 8MB
- 1102 1034 CT6894 VANTA 16MB
- 14af 5008 Maxi Gamer Phoenix 2
- 002d NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]
- 1043 0200 AGP-V3800M
- 1043 0201 AGP-V3800M
- 1048 0c3a Erazor III LT
- 10de 001e M64 AGP4x
- 1102 1023 CT6892 RIVA TNT2 Value
- 1102 1024 CT6932 RIVA TNT2 Value 32Mb
- 1102 102c CT6931 RIVA TNT2 Value [Jumper]
- 1462 8808 MSI-8808
- 1554 1041 PixelView RIVA TNT2 M64 32MB
- 002e NV6 [Vanta]
- 002f NV6 [Vanta]
- 0060 nForce2 ISA Bridge
- 1043 80ad A7N8X Mainboard
- 0064 nForce2 SMBus (MCP)
- 0065 nForce2 IDE
- 0066 nForce2 Ethernet Controller
- 0067 nForce2 USB Controller
- 1043 0c11 A7N8X Mainboard
- 0068 nForce2 USB Controller
- 1043 0c11 A7N8X Mainboard
- 006a nForce2 AC97 Audio Controler (MCP)
- 006b nForce MultiMedia audio [Via VT82C686B]
- 006e nForce2 FireWire (IEEE 1394) Controller
- 00a0 NV5 [Aladdin TNT2]
- 14af 5810 Maxi Gamer Xentor
- 0100 NV10 [GeForce 256 SDR]
- 1043 0200 AGP-V6600 SGRAM
- 1043 0201 AGP-V6600 SDRAM
- 1043 4008 AGP-V6600 SGRAM
- 1043 4009 AGP-V6600 SDRAM
- 1102 102d CT6941 GeForce 256
- 14af 5022 3D Prophet SE
- 0101 NV10DDR [GeForce 256 DDR]
- 1043 0202 AGP-V6800 DDR
- 1043 400a AGP-V6800 DDR SGRAM
- 1043 400b AGP-V6800 DDR SDRAM
- 1102 102e CT6971 GeForce 256 DDR
- 14af 5021 3D Prophet DDR-DVI
- 0103 NV10GL [Quadro]
- 0110 NV11 [GeForce2 MX/MX 400]
- 1043 4015 AGP-V7100 Pro
- 1043 4031 V7100 Pro with TV output
- 1462 8817 MSI GeForce2 MX400 Pro32S [MS-8817]
- 14af 7102 3D Prophet II MX
- 14af 7103 3D Prophet II MX Dual-Display
- 0111 NV11DDR [GeForce2 MX 100 DDR/200 DDR]
- 0112 NV11 [GeForce2 Go]
- 0113 NV11GL [Quadro2 MXR/EX]
- 0150 NV15 [GeForce2 GTS/Pro]
- 1043 4016 V7700 AGP Video Card
- 107d 2840 WinFast GeForce2 GTS with TV output
- 1462 8831 Creative GeForce2 Pro
- 0151 NV15DDR [GeForce2 Ti]
- 1043 405f V7700Ti
- 0152 NV15BR [GeForce2 Ultra, Bladerunner]
- 1048 0c56 GLADIAC Ultra
- 0153 NV15GL [Quadro2 Pro]
- 0170 NV17 [GeForce4 MX 460]
- 0171 NV17 [GeForce4 MX 440]
- 10b0 0002 Gainward Pro/600 TV
- 1462 8661 G4MX440-VTP
- 1462 8730 MX440SES-T (MS-8873)
- 147b 8f00 Abit Siluro GeForce4MX440
- 0172 NV17 [GeForce4 MX 420]
- 0173 NV17 [GeForce4 MX 440-SE]
- 0174 NV17 [GeForce4 440 Go]
- 0175 NV17 [GeForce4 420 Go]
- 0176 NV17 [GeForce4 420 Go 32M]
- 0178 NV17GL [Quadro4 550 XGL]
- 0179 NV17 [GeForce4 440 Go 64M]
- 017a NV17GL [Quadro4 200/400 NVS]
- 017b NV17GL [Quadro4 550 XGL]
- 017c NV17GL [Quadro4 550 GoGL]
- 0181 NV18 [GeForce4 MX 440 AGP 8x]
- 0182 NV18 [GeForce4 MX 440SE AGP 8x]
- 0183 NV18 [GeForce4 MX 420 AGP 8x]
- 0188 NV18GL [Quadro4 580 XGL]
- 018a NV18GL [Quadro4 NVS]
- 018b NV18GL [Quadro4 380 XGL]
- 01a0 NV15 [GeForce2 - nForce GPU]
- 01a4 nForce CPU bridge
- 01ab nForce 420 Memory Controller (DDR)
- 01ac nForce 220/420 Memory Controller
- 01ad nForce 220/420 Memory Controller
- 01b1 nForce Audio
- 01b2 nForce ISA Bridge
- 01b4 nForce PCI System Management
- 01b7 nForce AGP to PCI Bridge
- 01b8 nForce PCI-to-PCI bridge
- 01bc nForce IDE
- 01c1 Intel 537 [nForce MC97 Modem]
- 01c2 nForce USB Controller
- 01c3 nForce Ethernet Controller
- 01e8 nForce2 AGP
- 01f0 NV18 [GeForce4 MX - nForce GPU]
- 0200 NV20 [GeForce3]
- 1043 402f AGP-V8200 DDR
- 0201 NV20 [GeForce3 Ti 200]
- 0202 NV20 [GeForce3 Ti 500]
- 1043 405b V8200 T5
- 1545 002f Xtasy 6964
- 0203 NV20DCC [Quadro DCC]
- 0250 NV25 [GeForce4 Ti 4600]
- 0251 NV25 [GeForce4 Ti 4400]
- 0252 NV25 [GeForce4 Ti]
- 0253 NV25 [GeForce4 Ti 4200]
- 107d 2896 WinFast A250 LE TD (Dual VGA/TV-out/DVI)
- 147b 8f09 Siluro (Dual VGA/TV-out/DVI)
- 0258 NV25GL [Quadro4 900 XGL]
- 0259 NV25GL [Quadro4 750 XGL]
- 025b NV25GL [Quadro4 700 XGL]
- 0280 NV28 [GeForce4 Ti 4800]
- 0281 NV28 [GeForce4 Ti 4200 AGP 8x]
- 0282 NV28 [GeForce4 Ti 4800 SE]
- 0288 NV28GL [Quadro4 980 XGL]
- 0289 NV28GL [Quadro4 780 XGL]
- 0300 NV30 [GeForce FX]
- 0301 NV30 [GeForce FX 5800 Ultra]
- 0302 NV30 [GeForce FX 5800]
- 0308 NV30GL [Quadro FX 2000]
- 0309 NV30GL [Quadro FX 1000]
-10df Emulex Corporation
- 1ae5 LP6000 Fibre Channel Host Adapter
- f085 LP850 Fibre Channel Adapter
- f095 LP952 Fibre Channel Adapter
- f098 LP982 Fibre Channel Adapter
- f700 LP7000 Fibre Channel Host Adapter
- f800 LP8000 Fibre Channel Host Adapter
- f900 LP9000 Fibre Channel Host Adapter
- f980 LP9802 Fibre Channel Adapter
-10e0 Integrated Micro Solutions Inc.
- 5026 IMS5026/27/28
- 5027 IMS5027
- 5028 IMS5028
- 8849 IMS8849
- 8853 IMS8853
- 9128 IMS9128 [Twin turbo 128]
-10e1 Tekram Technology Co.,Ltd.
- 0391 TRM-S1040
- 10e1 0391 DC-315U SCSI-3 Host Adapter
- 690c DC-690c
- dc29 DC-290
-10e2 Aptix Corporation
-10e3 Tundra Semiconductor Corp.
- 0000 CA91C042 [Universe]
- 0860 CA91C860 [QSpan]
- 0862 CA91C862A [QSpan-II]
-10e4 Tandem Computers
-10e5 Micro Industries Corporation
-10e6 Gainbery Computer Products Inc.
-10e7 Vadem
-10e8 Applied Micro Circuits Corp.
- 2011 Q-Motion Video Capture/Edit board
- 4750 S5930 [Matchmaker]
- 5920 S5920
- 8043 LANai4.x [Myrinet LANai interface chip]
- 8062 S5933_PARASTATION
- 807d S5933 [Matchmaker]
- 8088 Kongsberg Spacetec Format Synchronizer
- 8089 Kongsberg Spacetec Serial Output Board
- 809c S5933_HEPC3
- 80d7 PCI-9112
- 80d9 PCI-9118
- 80da PCI-9812
- 811a PCI-IEEE1355-DS-DE Interface
- 8170 S5933 [Matchmaker] (Chipset Development Tool)
- 82db AJA HDNTV HD SDI Framestore
-10e9 Alps Electric Co., Ltd.
-10ea Intergraphics Systems
- 1680 IGA-1680
- 1682 IGA-1682
- 1683 IGA-1683
- 2000 CyberPro 2000
- 2010 CyberPro 2000A
- 5000 CyberPro 5000
- 5050 CyberPro 5050
- 5202 CyberPro 5202
-10eb Artists Graphics
- 0101 3GA
- 8111 Twist3 Frame Grabber
-10ec Realtek Semiconductor Co., Ltd.
- 8029 RTL-8029(AS)
- 10b8 2011 EZ-Card (SMC1208)
- 10ec 8029 RTL-8029(AS)
- 1113 1208 EN1208
- 1186 0300 DE-528
- 1259 2400 AT-2400
- 8129 RTL-8129
- 10ec 8129 RT8129 Fast Ethernet Adapter
- 8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter
- 10ec 8138 RT8139 (B/C) Fast Ethernet Adapter
- 8139 RTL-8139/8139C/8139C+
- 1025 8920 ALN-325
- 1025 8921 ALN-325
- 10bd 0320 EP-320X-R
- 10ec 8139 RT8139
- 1186 1300 DFE-538TX
- 1186 1320 SN5200
- 1186 8139 DRN-32TX
- 11f6 8139 FN22-3(A) LinxPRO Ethernet Adapter
- 1259 2500 AT-2500TX
- 1259 2503 AT-2500TX/ACPI
- 1429 d010 ND010
- 1432 9130 EN-9130TX
- 1436 8139 RT8139
- 146c 1439 FE-1439TX
- 1489 6001 GF100TXRII
- 1489 6002 GF100TXRA
- 149c 139a LFE-8139ATX
- 149c 8139 LFE-8139TX
- 2646 0001 EtheRx
- 8e2e 7000 KF-230TX
- 8e2e 7100 KF-230TX/2
- a0a0 0007 ALN-325C
- 8169 RTL-8169
- 1371 434e ProG-2000L
- 8197 SmartLAN56 56K Modem
-10ed Ascii Corporation
- 7310 V7310
-10ee Xilinx Corporation
- 3fc0 RME Digi96
- 3fc1 RME Digi96/8
- 3fc2 RME Digi96/8 Pro
- 3fc3 RME Digi96/8 Pad
- 3fc4 RME Digi9652 (Hammerfall)
- 3fc5 RME Hammerfall DSP
-10ef Racore Computer Products, Inc.
- 8154 M815x Token Ring Adapter
-10f0 Peritek Corporation
-10f1 Tyan Computer
-10f2 Achme Computer, Inc.
-10f3 Alaris, Inc.
-10f4 S-MOS Systems, Inc.
-10f5 NKK Corporation
- a001 NDR4000 [NR4600 Bridge]
-10f6 Creative Electronic Systems SA
-10f7 Matsushita Electric Industrial Co., Ltd.
-10f8 Altos India Ltd
-10f9 PC Direct
-10fa Truevision
- 000c TARGA 1000
-10fb Thesys Gesellschaft für Mikroelektronik mbH
- 186f TH 6255
-10fc I-O Data Device, Inc.
-# What's in the cardbus end of a Sony ACR-A01 card, comes with newer Vaio CD-RW drives
- 0003 Cardbus IDE Controller
- 0005 Cardbus SCSI CBSC II
-10fd Soyo Computer, Inc
-10fe Fast Multimedia AG
-10ff NCube
-1100 Jazz Multimedia
-1101 Initio Corporation
- 1060 INI-A100U2W
- 9100 INI-9100/9100W
- 9400 INI-940
- 9401 INI-950
- 9500 360P
-1102 Creative Labs
- 0002 SB Live! EMU10k1
- 1102 0020 CT4850 SBLive! Value
- 1102 0021 CT4620 SBLive!
- 1102 002f SBLive! mainboard implementation
- 1102 4001 E-mu APS
- 1102 8022 CT4780 SBLive! Value
- 1102 8023 CT4790 SoundBlaster PCI512
- 1102 8024 CT4760 SBLive!
- 1102 8025 SBLive! Mainboard Implementation
- 1102 8026 CT4830 SBLive! Value
- 1102 8027 CT4832 SBLive! Value
- 1102 8028 CT4760 SBLive! OEM version
- 1102 8031 CT4831 SBLive! Value
- 1102 8040 CT4760 SBLive!
- 1102 8051 CT4850 SBLive! Value
- 1102 8061 SBLive! Player 5.1
- 1102 8064 SB Live! 5.1 Model SB0100
- 1102 8065 SBLive! 5.1 Digital Model SB0220
- 0004 SB Audigy
- 1102 0051 SB0090 Audigy Player
- 1102 0053 SB0090 Audigy Player/OEM
- 0006 [SB Live! Value] EMU10k1X
- 4001 SB Audigy FireWire Port
- 1102 0010 SB Audigy FireWire Port
- 7002 SB Live! MIDI/Game Port
- 1102 0020 Gameport Joystick
- 7003 SB Audigy MIDI/Game port
- 1102 0040 SB Audigy MIDI/Game Port
- 7004 [SB Live! Value] Input device controller
- 8064 SB0100 [SBLive! 5.1 OEM]
- 8938 Ectiva EV1938
-1103 Triones Technologies, Inc.
- 0003 HPT343
-# Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372
- 0004 HPT366/368/370/370A/372
- 1103 0001 HPT370A
- 1103 0005 HPT370 UDMA100
- 0005 HPT372A
- 0006 HPT302
- 0007 HPT371
- 0008 HPT374
- 0009 HPT372N
-1104 RasterOps Corp.
-1105 Sigma Designs, Inc.
- 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder
- 8300 REALmagic Hollywood Plus DVD Decoder
- 8400 EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder
-1106 VIA Technologies, Inc.
- 0102 Embedded VIA Ethernet Controller
- 0130 VT6305 1394.A Controller
- 0305 VT8363/8365 [KT133/KM133]
- 1043 8033 A7V Mainboard
- 1043 803e A7V-E Mainboard
- 1043 8042 A7V133/A7V133-C Mainboard
- 147b a401 KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard
- 0391 VT8371 [KX133]
- 0501 VT8501 [Apollo MVP4]
- 0505 VT82C505
-# Shares chip with :0576. The VT82C576M has :1571 instead of :0561.
- 0561 VT82C576MV
- 0571 VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
- 1019 0985 P6VXA Motherboard
- 1043 8052 VT8233A Bus Master ATA100/66/33 IDE
- 1043 808c A7V8X motherboard
- 1106 0571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
- 1179 0001 Magnia Z310
- 1458 5002 GA-7VAX Mainboard
- 0576 VT82C576 3V [Apollo Master]
- 0585 VT82C585VP [Apollo VP1/VPX]
- 0586 VT82C586/A/B PCI-to-ISA [Apollo VP]
- 1106 0000 MVP3 ISA Bridge
- 0595 VT82C595 [Apollo VP2]
- 0596 VT82C596 ISA [Mobile South]
- 1106 0000 VT82C596/A/B PCI to ISA Bridge
- 1458 0596 VT82C596/A/B PCI to ISA Bridge
- 0597 VT82C597 [Apollo VP3]
- 0598 VT82C598 [Apollo MVP3]
- 0601 VT8601 [Apollo ProMedia]
- 0605 VT8605 [ProSavage PM133]
- 1043 802c CUV4X mainboard
- 0680 VT82C680 [Apollo P6]
- 0686 VT82C686 [Apollo Super South]
- 1019 0985 P6VXA Motherboard
- 1043 802c CUV4X mainboard
- 1043 8033 A7V Mainboard
- 1043 803e A7V-E Mainboard
- 1043 8040 A7M266 Mainboard
- 1043 8042 A7V133/A7V133-C Mainboard
- 1106 0000 VT82C686/A PCI to ISA Bridge
- 1106 0686 VT82C686/A PCI to ISA Bridge
- 1179 0001 Magnia Z310
- 147b a702 KG7-Lite Mainboard
- 0691 VT82C693A/694x [Apollo PRO133x]
- 1019 0985 P6VXA Motherboard
- 1179 0001 Magnia Z310
- 1458 0691 VT82C691 Apollo Pro System Controller
- 0693 VT82C693 [Apollo Pro Plus]
- 0698 VT82C693A [Apollo Pro133 AGP]
- 0926 VT82C926 [Amazon]
- 1000 VT82C570MV
- 1106 VT82C570MV
- 1571 VT82C576M/VT82C586
- 1595 VT82C595/97 [Apollo VP2/97]
- 3038 USB
- 0925 1234 USB Controller
- 1019 0985 P6VXA Motherboard
- 1043 808c A7V8X motherboard
- 1179 0001 Magnia Z310
- 3040 VT82C586B ACPI
- 3043 VT86C100A [Rhine]
- 10bd 0000 VT86C100A Fast Ethernet Adapter
- 1106 0100 VT86C100A Fast Ethernet Adapter
- 1186 1400 DFE-530TX rev A
- 3044 IEEE 1394 Host Controller
- 3050 VT82C596 Power Management
- 3051 VT82C596 Power Management
- 3057 VT82C686 [Apollo Super ACPI]
- 1019 0985 P6VXA Motherboard
- 1043 8033 A7V Mainboard
- 1043 803e A7V-E Mainboard
- 1043 8040 A7M266 Mainboard
- 1043 8042 A7V133/A7V133-C Mainboard
- 1179 0001 Magnia Z310
- 3058 VT82C686 AC97 Audio Controller
- 0e11 b194 Soundmax integrated digital audio
- 1019 0985 P6VXA Motherboard
- 1106 4511 Onboard Audio on EP7KXA
- 1458 7600 Onboard Audio
- 1462 3091 MS-6309 Onboard Audio
- 15dd 7609 Onboard Audio
- 3059 VT8233/A/8235 AC97 Audio Controller
- 1043 8095 A7V8X Motherboard (Realtek ALC650 codec)
- 1458 a002 GA-7VAX Onboard Audio (Realtek ALC650)
- 3065 VT6102 [Rhine-II]
- 1106 0102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235
- 1186 1400 DFE-530TX rev A
- 1186 1401 DFE-530TX rev B
- 13b9 1421 LD-10/100AL PCI Fast Ethernet Adapter (rev.B)
- 3068 Intel 537 [AC97 Modem]
- 3074 VT8233 PCI to ISA Bridge
- 1043 8052 VT8233A
- 3091 VT8633 [Apollo Pro266]
- 3099 VT8366/A/7 [Apollo KT266/A/333]
- 1043 8064 A7V266-E Mainboard
- 1043 807f A7V333 Mainboard
- 3101 VT8653 Host Bridge
- 3102 VT8662 Host Bridge
- 3103 VT8615 Host Bridge
- 3104 USB 2.0
- 1043 808c A7V8X motherboard
- 1458 5004 GA-7VAX Mainboard
- 3106 VT6105 [Rhine-III]
- 3109 VT8233C PCI to ISA Bridge
- 3112 VT8361 [KLE133] Host Bridge
- 3116 VT8375 [KM266/KL266] Host Bridge
-# found on EPIA M6000/9000 mainboard
- 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics
-# found on EPIA M6000/9000 mainboard
- 3123 VT8623 [Apollo CLE266]
- 3128 VT8753 [P4X266 AGP]
- 3133 VT3133 Host Bridge
- 3147 VT8233A ISA Bridge
- 3148 P4M266 Host Bridge
- 3156 P/KN266 Host Bridge
- 3168 VT8374 P4X400 Host Controller/AGP Bridge
- 3177 VT8235 ISA Bridge
- 1043 808c A7V8X motherboard
- 1458 5001 GA-7VAX Mainboard
- 3189 VT8377 [KT400 AGP] Host Bridge
- 1043 807f A7V8X motherboard
- 1458 5000 GA-7VAX Mainboard
- 5030 VT82C596 ACPI [Apollo PRO]
- 6100 VT85C100A [Rhine II]
- 8231 VT8231 [PCI-to-ISA Bridge]
- 8235 VT8235 ACPI
- 8305 VT8363/8365 [KT133/KM133 AGP]
- 8391 VT8371 [KX133 AGP]
- 8501 VT8501 [Apollo MVP4 AGP]
- 8596 VT82C596 [Apollo PRO AGP]
- 8597 VT82C597 [Apollo VP3 AGP]
- 8598 VT82C598/694x [Apollo MVP3/Pro133x AGP]
- 1019 0985 P6VXA Motherboard
- 8601 VT8601 [Apollo ProMedia AGP]
- 8605 VT8605 [PM133 AGP]
- 8691 VT82C691 [Apollo Pro]
- 8693 VT82C693 [Apollo Pro Plus] PCI Bridge
- b091 VT8633 [Apollo Pro266 AGP]
- b099 VT8366/A/7 [Apollo KT266/A/333 AGP]
- b101 VT8653 AGP Bridge
- b102 VT8362 AGP Bridge
- b103 VT8615 AGP Bridge
- b112 VT8361 [KLE133] AGP Bridge
- b168 VT8235 PCI Bridge
-1107 Stratus Computers
- 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!)
-1108 Proteon, Inc.
- 0100 p1690plus_AA
- 0101 p1690plus_AB
- 0105 P1690Plus
- 0108 P1690Plus
- 0138 P1690Plus
- 0139 P1690Plus
- 013c P1690Plus
- 013d P1690Plus
-1109 Cogent Data Technologies, Inc.
- 1400 EM110TX [EX110TX]
-110a Siemens Nixdorf AG
- 0002 Pirahna 2-port
- 0005 Tulip controller, power management, switch extender
- 0006 FSC PINC (I/O-APIC)
- 0015 FSC Multiprocessor Interrupt Controller
- 001d FSC Copernicus Management Controller
- 007b FSC Remote Service Controller, mailbox device
- 007c FSC Remote Service Controller, shared memory device
- 007d FSC Remote Service Controller, SMIC device
- 2102 DSCC4 WAN adapter
- 4942 FPGA I-Bus Tracer for MBD
- 6120 SZB6120
-110b Chromatic Research Inc.
- 0001 Mpact Media Processor
- 0004 Mpact 2
-110c Mini-Max Technology, Inc.
-110d Znyx Advanced Systems
-110e CPU Technology
-110f Ross Technology
-1110 Powerhouse Systems
- 6037 Firepower Powerized SMP I/O ASIC
- 6073 Firepower Powerized SMP I/O ASIC
-1111 Santa Cruz Operation
-# Also claimed to be RNS or Rockwell International, current PCISIG records list Osicom
-1112 Osicom Technologies Inc
- 2200 FDDI Adapter
- 2300 Fast Ethernet Adapter
- 2340 4 Port Fast Ethernet Adapter
- 2400 ATM Adapter
-1113 Accton Technology Corporation
- 1211 SMC2-1211TX
- 103c 1207 EN-1207D Fast Ethernet Adapter
- 1113 1211 EN-1207D Fast Ethernet Adapter
- 1216 EN-1216 Ethernet Adapter
- 111a 1020 SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]
- 1217 EN-1217 Ethernet Adapter
- 5105 10Mbps Network card
- 9211 EN-1207D Fast Ethernet Adapter
- 1113 9211 EN-1207D Fast Ethernet Adapter
- 9511 Fast Ethernet Adapter
-1114 Atmel Corporation
-1115 3D Labs
-1116 Data Translation
- 0022 DT3001
- 0023 DT3002
- 0024 DT3003
- 0025 DT3004
- 0026 DT3005
- 0027 DT3001-PGL
- 0028 DT3003-PGL
-1117 Datacube, Inc
- 9500 Max-1C SVGA card
- 9501 Max-1C image processing
-1118 Berg Electronics
-1119 ICP Vortex Computersysteme GmbH
- 0000 GDT 6000/6020/6050
- 0001 GDT 6000B/6010
- 0002 GDT 6110/6510
- 0003 GDT 6120/6520
- 0004 GDT 6530
- 0005 GDT 6550
- 0006 GDT 6x17
- 0007 GDT 6x27
- 0008 GDT 6537
- 0009 GDT 6557
- 000a GDT 6115/6515
- 000b GDT 6125/6525
- 000c GDT 6535
- 000d GDT 6555
- 0100 GDT 6117RP/6517RP
- 0101 GDT 6127RP/6527RP
- 0102 GDT 6537RP
- 0103 GDT 6557RP
- 0104 GDT 6111RP/6511RP
- 0105 GDT 6121RP/6521RP
- 0110 GDT 6117RD/6517RD
- 0111 GDT 6127RD/6527RD
- 0112 GDT 6537RD
- 0113 GDT 6557RD
- 0114 GDT 6111RD/6511RD
- 0115 GDT 6121RD/6521RD
- 0118 GDT 6118RD/6518RD/6618RD
- 0119 GDT 6128RD/6528RD/6628RD
- 011a GDT 6538RD/6638RD
- 011b GDT 6558RD/6658RD
- 0120 GDT 6117RP2/6517RP2
- 0121 GDT 6127RP2/6527RP2
- 0122 GDT 6537RP2
- 0123 GDT 6557RP2
- 0124 GDT 6111RP2/6511RP2
- 0125 GDT 6121RP2/6521RP2
- 0136 GDT 6113RS/6513RS
- 0137 GDT 6123RS/6523RS
- 0138 GDT 6118RS/6518RS/6618RS
- 0139 GDT 6128RS/6528RS/6628RS
- 013a GDT 6538RS/6638RS
- 013b GDT 6558RS/6658RS
- 013c GDT 6533RS/6633RS
- 013d GDT 6543RS/6643RS
- 013e GDT 6553RS/6653RS
- 013f GDT 6563RS/6663RS
- 0166 GDT 7113RN/7513RN/7613RN
- 0167 GDT 7123RN/7523RN/7623RN
- 0168 GDT 7118RN/7518RN/7518RN
- 0169 GDT 7128RN/7528RN/7628RN
- 016a GDT 7538RN/7638RN
- 016b GDT 7558RN/7658RN
- 016c GDT 7533RN/7633RN
- 016d GDT 7543RN/7643RN
- 016e GDT 7553RN/7653RN
- 016f GDT 7563RN/7663RN
- 01d6 GDT 4x13RZ
- 01d7 GDT 4x23RZ
- 01f6 GDT 8x13RZ
- 01f7 GDT 8x23RZ
- 01fc GDT 8x33RZ
- 01fd GDT 8x43RZ
- 01fe GDT 8x53RZ
- 01ff GDT 8x63RZ
- 0210 GDT 6519RD/6619RD
- 0211 GDT 6529RD/6629RD
- 0260 GDT 7519RN/7619RN
- 0261 GDT 7529RN/7629RN
- 0300 GDT Raid Controller
-111a Efficient Networks, Inc
- 0000 155P-MF1 (FPGA)
- 0002 155P-MF1 (ASIC)
- 0003 ENI-25P ATM
- 111a 0000 ENI-25p Miniport ATM Adapter
- 0005 SpeedStream (LANAI)
- 111a 0001 ENI-3010 ATM
- 111a 0009 ENI-3060 ADSL (VPI=0)
- 111a 0101 ENI-3010 ATM
- 111a 0109 ENI-3060CO ADSL (VPI=0)
- 111a 0809 ENI-3060 ADSL (VPI=0 or 8)
- 111a 0909 ENI-3060CO ADSL (VPI=0 or 8)
- 111a 0a09 ENI-3060 ADSL (VPI=<0..15>)
- 0007 SpeedStream ADSL
- 111a 1001 ENI-3061 ADSL [ASIC]
-111b Teledyne Electronic Systems
-111c Tricord Systems Inc.
- 0001 Powerbis Bridge
-111d Integrated Device Tech
- 0001 IDT77211 ATM Adapter
- 0003 IDT77252 ATM network controller
-111e Eldec
-111f Precision Digital Images
- 4a47 Precision MX Video engine interface
- 5243 Frame capture bus interface
-1120 EMC Corporation
-1121 Zilog
-1122 Multi-tech Systems, Inc.
-1123 Excellent Design, Inc.
-1124 Leutron Vision AG
-1125 Eurocore
-1126 Vigra
-1127 FORE Systems Inc
- 0200 ForeRunner PCA-200 ATM
- 0210 PCA-200PC
- 0250 ATM
- 0300 ForeRunner PCA-200EPC ATM
- 0310 ATM
- 0400 ForeRunnerHE ATM Adapter
- 1127 0400 ForeRunnerHE ATM
-1129 Firmworks
-112a Hermes Electronics Company, Ltd.
-112b Linotype - Hell AG
-112c Zenith Data Systems
-112d Ravicad
-112e Infomedia Microelectronics Inc.
-112f Imaging Technology Inc
- 0000 MVC IC-PCI
- 0001 MVC IM-PCI Video frame grabber/processor
-1130 Computervision
-1131 Philips Semiconductors
- 1561 USB 1.1 Host Controller
- 1562 USB 2.0 Host Controller
- 3400 SmartPCI56(UCB1500) 56K Modem
- 7130 SAA7130 Video Broadcast Decoder
- 7133 SAA7133 Audio+video broadcast decoder
-# PCI audio and video broadcast decoder (http://www.semiconductors.philips.com/pip/saa7134hl)
- 7134 SAA7134
- 7135 SAA7135 Audio+video broadcast decoder
- 7145 SAA7145
- 7146 SAA7146
- 114b 2003 DVRaptor Video Edit/Capture Card
- 11bd 0006 DV500 Overlay
- 11bd 000a DV500 Overlay
-1132 Mitel Corp.
-1133 Eicon Technology Corporation
- 7901 EiconCard S90
- 7902 EiconCard S90
- 7911 EiconCard S91
- 7912 EiconCard S91
- 7941 EiconCard S94
- 7942 EiconCard S94
- 7943 EiconCard S94
- 7944 EiconCard S94
- b921 EiconCard P92
- b922 EiconCard P92
- b923 EiconCard P92
- e001 DIVA 20PRO
- 1133 e001 DIVA Pro 2.0 S/T
- e002 DIVA 20
- 1133 e002 DIVA 2.0 S/T
- e003 DIVA 20PRO_U
- 1133 e003 DIVA Pro 2.0 U
- e004 DIVA 20_U
- 1133 e004 DIVA 2.0 U
- e005 DIVA LOW
- 1133 e005 DIVA 2.01 S/T
- e00b DIVA 2.02
- e010 DIVA Server BRI-2M
- 1133 e010 DIVA Server BRI-2M
- e012 DIVA Server BRI-8M
- 1133 e012 DIVA Server BRI-8M
- e014 DIVA Server PRI-30M
- 1133 e014 DIVA Server PRI-30M
- e018 DIVA Server BRI-2M/-2F
-1134 Mercury Computer Systems
- 0001 Raceway Bridge
-1135 Fuji Xerox Co Ltd
- 0001 Printer controller
-1136 Momentum Data Systems
-1137 Cisco Systems Inc
-1138 Ziatech Corporation
- 8905 8905 [STD 32 Bridge]
-1139 Dynamic Pictures, Inc
- 0001 VGA Compatable 3D Graphics
-113a FWB Inc
-113b Network Computing Devices
-113c Cyclone Microsystems, Inc.
- 0000 PCI-9060 i960 Bridge
- 0001 PCI-SDK [PCI i960 Evaluation Platform]
- 0911 PCI-911 [i960Jx-based Intelligent I/O Controller]
- 0912 PCI-912 [i960CF-based Intelligent I/O Controller]
- 0913 PCI-913
- 0914 PCI-914 [I/O Controller w/ secondary PCI bus]
-113d Leading Edge Products Inc
-113e Sanyo Electric Co - Computer Engineering Dept
-113f Equinox Systems, Inc.
- 0808 SST-64P Adapter
- 1010 SST-128P Adapter
- 80c0 SST-16P DB Adapter
- 80c4 SST-16P RJ Adapter
- 80c8 SST-16P Adapter
- 8888 SST-4P Adapter
- 9090 SST-8P Adapter
-1140 Intervoice Inc
-1141 Crest Microsystem Inc
-1142 Alliance Semiconductor Corporation
- 3210 AP6410
- 6422 ProVideo 6422
- 6424 ProVideo 6424
- 6425 ProMotion AT25
- 643d ProMotion AT3D
-1143 NetPower, Inc
-1144 Cincinnati Milacron
- 0001 Noservo controller
-1145 Workbit Corporation
- 8007 NinjaSCSI-32 Workbit
- f007 NinjaSCSI-32 KME
- f010 NinjaSCSI-32 Workbit
- f012 NinjaSCSI-32 Logitec
- f013 NinjaSCSI-32 Logitec
- f015 NinjaSCSI-32 Melco
-1146 Force Computers
-1147 Interface Corp
-1148 Syskonnect (Schneider & Koch)
- 4000 FDDI Adapter
- 0e11 b03b Netelligent 100 FDDI DAS Fibre SC
- 0e11 b03c Netelligent 100 FDDI SAS Fibre SC
- 0e11 b03d Netelligent 100 FDDI DAS UTP
- 0e11 b03e Netelligent 100 FDDI SAS UTP
- 0e11 b03f Netelligent 100 FDDI SAS Fibre MIC
- 1148 5521 FDDI SK-5521 (SK-NET FDDI-UP)
- 1148 5522 FDDI SK-5522 (SK-NET FDDI-UP DAS)
- 1148 5541 FDDI SK-5541 (SK-NET FDDI-FP)
- 1148 5543 FDDI SK-5543 (SK-NET FDDI-LP)
- 1148 5544 FDDI SK-5544 (SK-NET FDDI-LP DAS)
- 1148 5821 FDDI SK-5821 (SK-NET FDDI-UP64)
- 1148 5822 FDDI SK-5822 (SK-NET FDDI-UP64 DAS)
- 1148 5841 FDDI SK-5841 (SK-NET FDDI-FP64)
- 1148 5843 FDDI SK-5843 (SK-NET FDDI-LP64)
- 1148 5844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS)
- 4200 Token Ring adapter
- 4300 Gigabit Ethernet
- 1148 9821 SK-9821 (1000Base-T single link)
- 1148 9822 SK-9822 (1000Base-T dual link)
- 1148 9841 SK-9841 (1000Base-LX single link)
- 1148 9842 SK-9842 (1000Base-LX dual link)
- 1148 9843 SK-9843 (1000Base-SX single link)
- 1148 9844 SK-9844 (1000Base-SX dual link)
- 1148 9861 SK-9861 (1000Base-SX VF45 single link)
- 1148 9862 SK-9862 (1000Base-SX VF45 dual link)
-# Information got from SysKonnekt
- 1148 9871 SK-9871 (1000Base-ZX single link)
-# Information got from SysKonnekt
- 1148 9872 SK-9872 (1000Base-ZX dual link)
- 1259 2970 AT-2970SX [Allied Telesyn]
- 1259 2972 AT-2970T [Allied Telesyn]
- 1259 2975 AT-2970SX [Allied Telesyn]
- 1259 2977 AT-2970T [Allied Telesyn]
- 4320 SK-98xx Gigabit Ethernet Server Adapter
- 1148 5021 SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- 1148 5041 SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- 1148 5043 SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- 1148 5051 SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- 1148 5061 SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- 1148 5071 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- 1148 9521 SK-9521 10/100/1000Base-T Adapter
- 4400 Gigabit Ethernet
-1149 Win System Corporation
-114a VMIC
- 5579 VMIPCI-5579 (Reflective Memory Card)
- 5587 VMIPCI-5587 (Reflective Memory Card)
- 6504 VMIC PCI 7755 FPGA
- 7587 VMIVME-7587
-114b Canopus Co., Ltd
-114c Annabooks
-114d IC Corporation
-114e Nikon Systems Inc
-114f Digi International
- 0002 AccelePort EPC
- 0003 RightSwitch SE-6
- 0004 AccelePort Xem
- 0005 AccelePort Xr
- 0006 AccelePort Xr,C/X
- 0009 AccelePort Xr/J
- 000a AccelePort EPC/J
- 000c DataFirePRIme T1 (1-port)
- 000d SyncPort 2-Port (x.25/FR)
- 0011 AccelePort 8r EIA-232 (IBM)
- 0012 AccelePort 8r EIA-422
- 0013 AccelePort Xr
- 0014 AccelePort 8r EIA-422
- 0015 AccelePort Xem
- 0016 AccelePort EPC/X
- 0017 AccelePort C/X
- 001a DataFirePRIme E1 (1-port)
- 001b AccelePort C/X (IBM)
- 001d DataFire RAS T1/E1/PRI
- 114f 0050 DataFire RAS E1 Adapter
- 114f 0051 DataFire RAS Dual E1 Adapter
- 114f 0052 DataFire RAS T1 Adapter
- 114f 0053 DataFire RAS Dual T1 Adapter
- 0023 AccelePort RAS
- 0024 DataFire RAS B4 ST/U
- 114f 0030 DataFire RAS BRI U Adapter
- 114f 0031 DataFire RAS BRI S/T Adapter
- 0026 AccelePort 4r 920
- 0027 AccelePort Xr 920
- 0034 AccelePort 2r 920
- 0035 DataFire DSP T1/E1/PRI cPCI
- 0040 AccelePort Xp
- 0042 AccelePort 2p PCI
- 0070 Datafire Micro V IOM2 (Europe)
- 0071 Datafire Micro V (Europe)
- 0072 Datafire Micro V IOM2 (North America)
- 0073 Datafire Micro V (North America)
- 6001 Avanstar
-1150 Thinking Machines Corp
-1151 JAE Electronics Inc.
-1152 Megatek
-1153 Land Win Electronic Corp
-1154 Melco Inc
-1155 Pine Technology Ltd
-1156 Periscope Engineering
-1157 Avsys Corporation
-1158 Voarx R & D Inc
- 3011 Tokenet/vg 1001/10m anylan
- 9050 Lanfleet/Truevalue
- 9051 Lanfleet/Truevalue
-1159 Mutech Corp
- 0001 MV-1000
-115a Harlequin Ltd
-115b Parallax Graphics
-115c Photron Ltd.
-115d Xircom
- 0003 Cardbus Ethernet 10/100
- 1014 0181 10/100 EtherJet Cardbus Adapter
- 1014 1181 10/100 EtherJet Cardbus Adapter
- 1014 8181 10/100 EtherJet Cardbus Adapter
- 1014 9181 10/100 EtherJet Cardbus Adapter
- 115d 0181 Cardbus Ethernet 10/100
- 115d 1181 Cardbus Ethernet 10/100
- 1179 0181 Cardbus Ethernet 10/100
- 8086 8181 EtherExpress PRO/100 Mobile CardBus 32 Adapter
- 8086 9181 EtherExpress PRO/100 Mobile CardBus 32 Adapter
- 0005 Cardbus Ethernet 10/100
- 1014 0182 10/100 EtherJet Cardbus Adapter
- 1014 1182 10/100 EtherJet Cardbus Adapter
- 115d 0182 Cardbus Ethernet 10/100
- 115d 1182 Cardbus Ethernet 10/100
- 0007 Cardbus Ethernet 10/100
- 1014 0182 10/100 EtherJet Cardbus Adapter
- 1014 1182 10/100 EtherJet Cardbus Adapter
- 115d 0182 Cardbus Ethernet 10/100
- 115d 1182 Cardbus Ethernet 10/100
- 000b Cardbus Ethernet 10/100
- 1014 0183 10/100 EtherJet Cardbus Adapter
- 115d 0183 Cardbus Ethernet 10/100
- 000c Mini-PCI V.90 56k Modem
- 000f Cardbus Ethernet 10/100
- 1014 0183 10/100 EtherJet Cardbus Adapter
- 115d 0183 Cardbus Ethernet 10/100
- 0101 Cardbus 56k modem
- 115d 1081 Cardbus 56k Modem
- 0103 Cardbus Ethernet + 56k Modem
- 1014 9181 Cardbus 56k Modem
- 1115 1181 Cardbus Ethernet 100 + 56k Modem
- 115d 1181 CBEM56G-100 Ethernet + 56k Modem
- 8086 9181 PRO/100 LAN + Modem56 CardBus
-115e Peer Protocols Inc
-115f Maxtor Corporation
-1160 Megasoft Inc
-1161 PFU Limited
-1162 OA Laboratory Co Ltd
-1163 Rendition
- 0001 Verite 1000
- 2000 Verite V2000/V2100/V2200
- 1092 2000 Stealth II S220
-1164 Advanced Peripherals Technologies
-1165 Imagraph Corporation
- 0001 Motion TPEG Recorder/Player with audio
-1166 ServerWorks
- 0005 CNB20-LE Host Bridge
- 0006 CNB20HE Host Bridge
- 0007 CNB20-LE Host Bridge
- 0008 CNB20HE Host Bridge
- 0009 CNB20LE Host Bridge
- 0010 CIOB30
- 0011 CMIC-HE
- 0012 CMIC-LE
- 0013 CNB20-HE Host Bridge
- 0014 CNB20-HE Host Bridge
- 0015 CMIC-GC Host Bridge
- 0016 CMIC-GC Host Bridge
- 0017 GCNB-LE Host Bridge
- 0200 OSB4 South Bridge
- 0201 CSB5 South Bridge
- 0203 CSB6 South Bridge
- 0211 OSB4 IDE Controller
- 0212 CSB5 IDE Controller
- 0213 CSB6 RAID/IDE Controller
- 0220 OSB4/CSB5 OHCI USB Controller
- 0221 CSB6 OHCI USB Controller
- 0225 GCLE Host Bridge
- 0227 GCLE-2 Host Bridge
-1167 Mutoh Industries Inc
-1168 Thine Electronics Inc
-1169 Centre for Development of Advanced Computing
-116a Polaris Communications
- 6100 Bus/Tag Channel
- 6800 Escon Channel
- 7100 Bus/Tag Channel
- 7800 Escon Channel
-116b Connectware Inc
-116c Intelligent Resources Integrated Systems
-116d Martin-Marietta
-116e Electronics for Imaging
-116f Workstation Technology
-1170 Inventec Corporation
-1171 Loughborough Sound Images Plc
-1172 Altera Corporation
-1173 Adobe Systems, Inc
-1174 Bridgeport Machines
-1175 Mitron Computer Inc.
-1176 SBE Incorporated
-1177 Silicon Engineering
-1178 Alfa, Inc.
- afa1 Fast Ethernet Adapter
-1179 Toshiba America Info Systems
- 0103 EX-IDE Type-B
- 0404 DVD Decoder card
- 0406 Tecra Video Capture device
- 0407 DVD Decoder card (Version 2)
- 0601 601
- 0603 ToPIC95 PCI to CardBus Bridge for Notebooks
- 060a ToPIC95
- 060f ToPIC97
- 0617 ToPIC95 PCI to Cardbus Bridge with ZV Support
- 0618 CPU to PCI and PCI to ISA bridge
-# Claimed to be Lucent DSP1645 [Mars], but that's apparently incorrect. Does anyone know the correct ID?
- 0701 FIR Port
- 0804 TC6371AF SmartMedia Controller
- 0805 SD TypA Controller
- 0d01 FIR Port Type-DO
- 1179 0001 FIR Port Type-DO
-117a A-Trend Technology
-117b L G Electronics, Inc.
-117c Atto Technology
-117d Becton & Dickinson
-117e T/R Systems
-117f Integrated Circuit Systems
-1180 Ricoh Co Ltd
- 0465 RL5c465
- 0466 RL5c466
- 0475 RL5c475
- 144d c006 vpr Matrix 170B4 CardBus bridge
- 0476 RL5c476 II
- 1014 0185 ThinkPad A/T/X Series
- 104d 80df Vaio PCG-FX403
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 0477 RL5c477
- 0478 RL5c478
- 1014 0184 ThinkPad A30p (2653-64G)
- 0522 R5C522 IEEE 1394 Controller
- 1014 01cf ThinkPad A30p (2653-64G)
- 0551 R5C551 IEEE 1394 Controller
- 144d c006 vpr Matrix 170B4
- 0552 R5C552 IEEE 1394 Controller
- 1014 0511 ThinkPad A/T/X Series
-1181 Telmatics International
-1183 Fujikura Ltd
-1184 Forks Inc
-1185 Dataworld International Ltd
-1186 D-Link System Inc
- 0100 DC21041
- 1002 DL10050 Sundance Ethernet
- 1186 1002 DFE-550TX
- 1186 1012 DFE-580TX
- 1300 RTL8139 Ethernet
- 1186 1300 DFE-538TX 10/100 Ethernet Adapter
- 1186 1301 DFE-530TX+ 10/100 Ethernet Adapter
- 1340 DFE-690TXD CardBus PC Card
- 1561 DRP-32TXD Cardbus PC Card
- 4000 DL2K Ethernet
-1187 Advanced Technology Laboratories, Inc.
-1188 Shima Seiki Manufacturing Ltd.
-1189 Matsushita Electronics Co Ltd
-118a Hilevel Technology
-118b Hypertec Pty Limited
-118c Corollary, Inc
- 0014 PCIB [C-bus II to PCI bus host bridge chip]
- 1117 Intel 8-way XEON Profusion Chipset [Cache Coherency Filter]
-118d BitFlow Inc
- 0001 Raptor-PCI framegrabber
- 0012 Model 12 Road Runner Frame Grabber
- 0014 Model 14 Road Runner Frame Grabber
- 0024 Model 24 Road Runner Frame Grabber
- 0044 Model 44 Road Runner Frame Grabber
- 0112 Model 12 Road Runner Frame Grabber
- 0114 Model 14 Road Runner Frame Grabber
- 0124 Model 24 Road Runner Frame Grabber
- 0144 Model 44 Road Runner Frame Grabber
- 0212 Model 12 Road Runner Frame Grabber
- 0214 Model 14 Road Runner Frame Grabber
- 0224 Model 24 Road Runner Frame Grabber
- 0244 Model 44 Road Runner Frame Grabber
- 0312 Model 12 Road Runner Frame Grabber
- 0314 Model 14 Road Runner Frame Grabber
- 0324 Model 24 Road Runner Frame Grabber
- 0344 Model 44 Road Runner Frame Grabber
-118e Hermstedt GmbH
-118f Green Logic
-1190 Tripace
- c731 TP-910/920/940 PCI Ultra(Wide) SCSI Adapter
-1191 Artop Electronic Corp
- 0003 SCSI Cache Host Adapter
- 0004 ATP8400
- 0005 ATP850UF
- 0006 ATP860 NO-BIOS
- 0007 ATP860
- 0008 ATP865 NO-ROM
- 0009 ATP865
- 8002 AEC6710 SCSI-2 Host Adapter
- 8010 AEC6712UW SCSI
- 8020 AEC6712U SCSI
- 8030 AEC6712S SCSI
- 8040 AEC6712D SCSI
- 8050 AEC6712SUW SCSI
-1192 Densan Company Ltd
-1193 Zeitnet Inc.
- 0001 1221
- 0002 1225
-1194 Toucan Technology
-1195 Ratoc System Inc
-1196 Hytec Electronics Ltd
-1197 Gage Applied Sciences, Inc.
-1198 Lambda Systems Inc
-1199 Attachmate Corporation
-119a Mind Share, Inc.
-119b Omega Micro Inc.
- 1221 82C092G
-119c Information Technology Inst.
-119d Bug, Inc. Sapporo Japan
-119e Fujitsu Microelectronics Ltd.
- 0001 FireStream 155
- 0003 FireStream 50
-119f Bull HN Information Systems
-11a0 Convex Computer Corporation
-11a1 Hamamatsu Photonics K.K.
-11a2 Sierra Research and Technology
-11a3 Deuretzbacher GmbH & Co. Eng. KG
-11a4 Barco Graphics NV
-11a5 Microunity Systems Eng. Inc
-11a6 Pure Data Ltd.
-11a7 Power Computing Corp.
-11a8 Systech Corp.
-11a9 InnoSys Inc.
- 4240 AMCC S933Q Intelligent Serial Card
-11aa Actel
-11ab Galileo Technology Ltd.
- 0146 GT-64010/64010A System Controller
- 4611 GT-64115 System Controller
- 4620 GT-64120/64120A/64121A System Controller
- 4801 GT-48001
- f003 GT-64010 Primary Image Piranha Image Generator
-11ac Canon Information Systems Research Aust.
-11ad Lite-On Communications Inc
- 0002 LNE100TX
- 11ad 0002 LNE100TX
- 11ad 0003 LNE100TX
- 11ad f003 LNE100TX
- 11ad ffff LNE100TX
- 1385 f004 FA310TX
- c115 LNE100TX [Linksys EtherFast 10/100]
- 11ad c001 LNE100TX [ver 2.0]
-11ae Aztech System Ltd
-11af Avid Technology Inc.
-11b0 V3 Semiconductor Inc.
- 0002 V300PSC
- 0292 V292PBC [Am29030/40 Bridge]
- 0960 V96xPBC
- c960 V96DPC
-11b1 Apricot Computers
-11b2 Eastman Kodak
-11b3 Barr Systems Inc.
-11b4 Leitch Technology International
-11b5 Radstone Technology Plc
-11b6 United Video Corp
-11b7 Motorola
-11b8 XPoint Technologies, Inc
- 0001 Quad PeerMaster
-11b9 Pathlight Technology Inc.
- c0ed SSA Controller
-11ba Videotron Corp
-11bb Pyramid Technology
-11bc Network Peripherals Inc
- 0001 NP-PCI
-11bd Pinnacle Systems Inc.
-11be International Microcircuits Inc
-11bf Astrodesign, Inc.
-11c0 Hewlett Packard
-11c1 Lucent Microelectronics
- 0440 56k WinModem
- 1033 8015 LT WinModem 56k Data+Fax+Voice+Dsvd
- 1033 8047 LT WinModem 56k Data+Fax+Voice+Dsvd
- 1033 804f LT WinModem 56k Data+Fax+Voice+Dsvd
- 10cf 102c LB LT Modem V.90 56k
- 10cf 104a BIBLO LT Modem 56k
- 10cf 105f LB2 LT Modem V.90 56k
- 1179 0001 Internal V.90 Modem
- 11c1 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
- 122d 4101 MDP7800-U Modem
- 122d 4102 MDP7800SP-U Modem
- 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 0441 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 0450 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 f100 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 f101 LT WinModem 56k Data+Fax+Voice+Dsvd
- 144d 2101 LT56PV Modem
- 149f 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
- 0441 56k WinModem
- 1033 804d LT WinModem 56k Data+Fax
- 1033 8065 LT WinModem 56k Data+Fax
- 1092 0440 Supra 56i
- 1179 0001 Internal V.90 Modem
- 11c1 0440 LT WinModem 56k Data+Fax
- 11c1 0441 LT WinModem 56k Data+Fax
- 122d 4100 MDP7800-U Modem
- 13e0 0040 LT WinModem 56k Data+Fax
- 13e0 0100 LT WinModem 56k Data+Fax
- 13e0 0410 LT WinModem 56k Data+Fax
- 13e0 0420 TelePath Internet 56k WinModem
- 13e0 0440 LT WinModem 56k Data+Fax
- 13e0 0443 LT WinModem 56k Data+Fax
- 13e0 f102 LT WinModem 56k Data+Fax
- 1416 9804 CommWave 56k Modem
- 141d 0440 LT WinModem 56k Data+Fax
- 144f 0441 Lucent 56k V.90 DF Modem
- 144f 0449 Lucent 56k V.90 DF Modem
- 144f 110d Lucent Win Modem
- 1468 0441 Presario 56k V.90 DF Modem
- 1668 0440 Lucent Win Modem
- 0442 56k WinModem
- 11c1 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 11c1 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 13e0 0412 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 13e0 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 13fc 2471 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 144d 2104 LT56PT Modem
- 144f 1104 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 149f 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 1668 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 0443 LT WinModem
- 0444 LT WinModem
- 0445 LT WinModem
- 8086 2203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)
- 0446 LT WinModem
- 0447 LT WinModem
- 0448 WinModem 56k
- 1014 0131 Lucent Win Modem
- 1033 8066 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 0030 56k Voice Modem
- 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd
-# Actiontech eth+modem card as used by Dell &c.
- 1668 2400 LT WinModem 56k (MiniPCI Ethernet+Modem)
- 0449 WinModem 56k
- 0e11 b14d 56k V.90 Modem
- 13e0 0020 LT WinModem 56k Data+Fax
- 13e0 0041 TelePath Internet 56k WinModem
- 1436 0440 Lucent Win Modem
- 144f 0449 Lucent 56k V.90 DFi Modem
- 1468 0410 IBM ThinkPad T23 (2647-4MG)
- 1468 0440 Lucent Win Modem
- 1468 0449 Presario 56k V.90 DFi Modem
- 044a F-1156IV WinModem (V90, 56KFlex)
- 10cf 1072 LB Global LT Modem
- 13e0 0012 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 13e0 0042 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 144f 1005 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
- 044b LT WinModem
- 044c LT WinModem
- 044d LT WinModem
- 044e LT WinModem
- 044f V90 WildWire Modem
- 0450 LT WinModem
- 144f 4005 Magnia SG20
- 0451 LT WinModem
- 0452 LT WinModem
- 0453 LT WinModem
- 0454 LT WinModem
- 0455 LT WinModem
- 0456 LT WinModem
- 0457 LT WinModem
- 0458 LT WinModem
- 0459 LT WinModem
- 045a LT WinModem
- 045c LT WinModem
- 0461 V90 WildWire Modem
- 0462 V90 WildWire Modem
- 0480 Venus Modem (V90, 56KFlex)
- 5801 USB
- 5802 USS-312 USB Controller
-# 4 port PCI USB Controller made by Agere (formely Lucent)
- 5803 USS-344S USB Controller
- 5811 FW323
- dead 0800 FireWire Host Bus Adapter
-11c2 Sand Microelectronics
-11c3 NEC Corporation
-11c4 Document Technologies, Inc
-11c5 Shiva Corporation
-11c6 Dainippon Screen Mfg. Co. Ltd
-11c7 D.C.M. Data Systems
-11c8 Dolphin Interconnect Solutions AS
- 0658 PSB32 SCI-Adapter D31x
- d665 PSB64 SCI-Adapter D32x
- d667 PSB66 SCI-Adapter D33x
-11c9 Magma
- 0010 16-line serial port w/- DMA
- 0011 4-line serial port w/- DMA
-11ca LSI Systems, Inc
-11cb Specialix Research Ltd.
- 2000 PCI_9050
- 11cb 0200 SX
- 11cb b008 I/O8+
- 4000 SUPI_1
- 8000 T225
-11cc Michels & Kleberhoff Computer GmbH
-11cd HAL Computer Systems, Inc.
-11ce Netaccess
-11cf Pioneer Electronic Corporation
-11d0 Lockheed Martin Federal Systems-Manassas
-11d1 Auravision
- 01f7 VxP524
-11d2 Intercom Inc.
-11d3 Trancell Systems Inc
-11d4 Analog Devices
- 1805 SM56 PCI modem
- 1889 AD1889 sound chip
-11d5 Ikon Corporation
- 0115 10115
- 0117 10117
-11d6 Tekelec Telecom
-11d7 Trenton Technology, Inc.
-11d8 Image Technologies Development
-11d9 TEC Corporation
-11da Novell
-11db Sega Enterprises Ltd
-11dc Questra Corporation
-11dd Crosfield Electronics Limited
-11de Zoran Corporation
- 6057 ZR36057PQC Video cutting chipset
- 1031 7efe DC10 Plus
- 1031 fc00 MiroVIDEO DC50, Motion JPEG Capture/CODEC Board
- 13ca 4231 JPEG/TV Card
- 6120 ZR36120
- 1328 f001 Cinemaster C DVD Decoder
-11df New Wave PDG
-11e0 Cray Communications A/S
-11e1 GEC Plessey Semi Inc.
-11e2 Samsung Information Systems America
-11e3 Quicklogic Corporation
- 5030 PC Watchdog
-11e4 Second Wave Inc
-11e5 IIX Consulting
-11e6 Mitsui-Zosen System Research
-11e7 Toshiba America, Elec. Company
-11e8 Digital Processing Systems Inc.
-11e9 Highwater Designs Ltd.
-11ea Elsag Bailey
-11eb Formation Inc.
-11ec Coreco Inc
-11ed Mediamatics
-11ee Dome Imaging Systems Inc
-11ef Nicolet Technologies B.V.
-11f0 Compu-Shack
- 4231 FDDI
- 4232 FASTline UTP Quattro
- 4233 FASTline FO
- 4234 FASTline UTP
- 4235 FASTline-II UTP
- 4236 FASTline-II FO
- 4731 GIGAline
-11f1 Symbios Logic Inc
-11f2 Picture Tel Japan K.K.
-11f3 Keithley Metrabyte
-11f4 Kinetic Systems Corporation
- 2915 CAMAC controller
-11f5 Computing Devices International
-11f6 Compex
- 0112 ENet100VG4
- 0113 FreedomLine 100
- 1401 ReadyLink 2000
- 2011 RL100-ATX 10/100
- 11f6 2011 RL100-ATX
- 2201 ReadyLink 100TX (Winbond W89C840)
- 11f6 2011 ReadyLink 100TX
- 9881 RL100TX
-11f7 Scientific Atlanta
-11f8 PMC-Sierra Inc.
- 7375 PM7375 [LASAR-155 ATM SAR]
-11f9 I-Cube Inc
-11fa Kasan Electronics Company, Ltd.
-11fb Datel Inc
-11fc Silicon Magic
-11fd High Street Consultants
-11fe Comtrol Corporation
- 0001 RocketPort 8 Oct
- 0002 RocketPort 8 Intf
- 0003 RocketPort 16 Intf
- 0004 RocketPort 32 Intf
- 0005 RocketPort Octacable
- 0006 RocketPort 8J
- 0007 RocketPort 4-port
- 0008 RocketPort 8-port
- 0009 RocketPort 16-port
- 000a RocketPort Plus Quadcable
- 000b RocketPort Plus Octacable
- 000c RocketPort 8-port Modem
- 8015 RocketPort 4-port UART 16954
-11ff Scion Corporation
-1200 CSS Corporation
-1201 Vista Controls Corp
-1202 Network General Corp.
- 4300 Gigabit Ethernet Adapter
- 1202 9841 SK-9841 LX
- 1202 9842 SK-9841 LX dual link
- 1202 9843 SK-9843 SX
- 1202 9844 SK-9843 SX dual link
-1203 Bayer Corporation, Agfa Division
-1204 Lattice Semiconductor Corporation
-1205 Array Corporation
-1206 Amdahl Corporation
-1208 Parsytec GmbH
- 4853 HS-Link Device
-1209 SCI Systems Inc
-120a Synaptel
-120b Adaptive Solutions
-120c Technical Corp.
-120d Compression Labs, Inc.
-120e Cyclades Corporation
- 0100 Cyclom-Y below first megabyte
- 0101 Cyclom-Y above first megabyte
- 0102 Cyclom-4Y below first megabyte
- 0103 Cyclom-4Y above first megabyte
- 0104 Cyclom-8Y below first megabyte
- 0105 Cyclom-8Y above first megabyte
- 0200 Cyclades-Z below first megabyte
- 0201 Cyclades-Z above first megabyte
- 0300 PC300/RSV or /X21 (2 ports)
- 0301 PC300/RSV or /X21 (1 port)
- 0310 PC300/TE (2 ports)
- 0311 PC300/TE (1 port)
- 0320 PC300/TE-M (2 ports)
- 0321 PC300/TE-M (1 port)
- 0400 PC400
-120f Essential Communications
- 0001 Roadrunner serial HIPPI
-1210 Hyperparallel Technologies
-1211 Braintech Inc
-1212 Kingston Technology Corp.
-1213 Applied Intelligent Systems, Inc.
-1214 Performance Technologies, Inc.
-1215 Interware Co., Ltd
-1216 Purup Prepress A/S
-1217 O2 Micro, Inc.
- 6729 OZ6729
- 673a OZ6730
- 6832 OZ6832/6833 Cardbus Controller
- 6836 OZ6836/6860 Cardbus Controller
- 6872 OZ6812 Cardbus Controller
- 6925 OZ6922 Cardbus Controller
- 6933 OZ6933 Cardbus Controller
- 1025 1016 Travelmate 612 TX
- 6972 OZ6912 Cardbus Controller
- 1179 0001 Magnia Z310
-1218 Hybricon Corp.
-1219 First Virtual Corporation
-121a 3Dfx Interactive, Inc.
- 0001 Voodoo
- 0002 Voodoo 2
- 0003 Voodoo Banshee
- 1092 0003 Monster Fusion
- 1092 4000 Monster Fusion
- 1092 4002 Monster Fusion
- 1092 4801 Monster Fusion AGP
- 1092 4803 Monster Fusion AGP
- 1092 8030 Monster Fusion
- 1092 8035 Monster Fusion AGP
- 10b0 0001 Dragon 4000
- 1102 1018 3D Blaster Banshee VE
- 121a 0001 Voodoo Banshee AGP
- 121a 0003 Voodoo Banshee AGP SGRAM
- 121a 0004 Voodoo Banshee
- 139c 0016 Raven
- 139c 0017 Raven
- 14af 0002 Maxi Gamer Phoenix
- 0004 Voodoo Banshee [Velocity 100]
- 0005 Voodoo 3
- 121a 0004 Voodoo3 AGP
- 121a 0030 Voodoo3 AGP
- 121a 0031 Voodoo3 AGP
- 121a 0034 Voodoo3 AGP
- 121a 0036 Voodoo3
- 121a 0037 Voodoo3 AGP
- 121a 0038 Voodoo3 AGP
- 121a 003a Voodoo3 AGP
- 121a 0044 Voodoo3
- 121a 004b Velocity 100
- 121a 004c Velocity 200
- 121a 004d Voodoo3 AGP
- 121a 004e Voodoo3 AGP
- 121a 0051 Voodoo3 AGP
- 121a 0052 Voodoo3 AGP
- 121a 0060 Voodoo3 3500 TV (NTSC)
- 121a 0061 Voodoo3 3500 TV (PAL)
- 121a 0062 Voodoo3 3500 TV (SECAM)
- 0009 Voodoo 4 / Voodoo 5
- 121a 0009 Voodoo5 AGP 5500/6000
- 0057 Voodoo 3/3000 [Avenger]
-121b Advanced Telecommunications Modules
-121c Nippon Texaco., Ltd
-121d Lippert Automationstechnik GmbH
-121e CSPI
-121f Arcus Technology, Inc.
-1220 Ariel Corporation
- 1220 AMCC 5933 TMS320C80 DSP/Imaging board
-1221 Contec Co., Ltd
-1222 Ancor Communications, Inc.
-1223 Artesyn Communication Products
- 0003 PM/Link
- 0004 PM/T1
- 0005 PM/E1
- 0008 PM/SLS
- 0009 BajaSpan Resource Target
- 000a BajaSpan Section 0
- 000b BajaSpan Section 1
- 000c BajaSpan Section 2
- 000d BajaSpan Section 3
- 000e PM/PPC
-1224 Interactive Images
-1225 Power I/O, Inc.
-1227 Tech-Source
-1228 Norsk Elektro Optikk A/S
-1229 Data Kinesis Inc.
-122a Integrated Telecom
-122b LG Industrial Systems Co., Ltd
-122c Sican GmbH
-122d Aztech System Ltd
- 1206 368DSP
- 50dc 3328 Audio
- 122d 0001 3328 Audio
- 80da 3328 Audio
- 122d 0001 3328 Audio
-122e Xyratex
-122f Andrew Corporation
-1230 Fishcamp Engineering
-1231 Woodward McCoach, Inc.
-1232 GPT Limited
-1233 Bus-Tech, Inc.
-1234 Technical Corp.
-1235 Risq Modular Systems, Inc.
-1236 Sigma Designs Corporation
- 0000 RealMagic64/GX
- 6401 REALmagic 64/GX (SD 6425)
-1237 Alta Technology Corporation
-1238 Adtran
-1239 3DO Company
-123a Visicom Laboratories, Inc.
-123b Seeq Technology, Inc.
-123c Century Systems, Inc.
-123d Engineering Design Team, Inc.
- 0000 EasyConnect 8/32
- 0002 EasyConnect 8/64
- 0003 EasyIO
-123e Simutech, Inc.
-123f C-Cube Microsystems
- 00e4 MPEG
- 8120 E4?
- 11bd 0006 DV500 E4
- 11bd 000a DV500 E4
- 8888 Cinemaster C 3.0 DVD Decoder
- 1002 0001 Cinemaster C 3.0 DVD Decoder
- 1002 0002 Cinemaster C 3.0 DVD Decoder
- 1328 0001 Cinemaster C 3.0 DVD Decoder
-1240 Marathon Technologies Corp.
-1241 DSC Communications
-# Formerly Jaycor Networks, Inc.
-1242 JNI Corporation
- 1560 JNIC-1560 PCI-X Fibre Channel Controller
- 1242 6562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter
- 1242 656a FCX-6562 PCI-X Fibre Channel Adapter
- 4643 FCI-1063 Fibre Channel Adapter
-1243 Delphax
-1244 AVM Audiovisuelles MKTG & Computer System GmbH
- 0700 B1 ISDN
- 0800 C4 ISDN
- 0a00 A1 ISDN [Fritz]
- 1244 0a00 FRITZ!Card ISDN Controller
- 0e00 Fritz!PCI v2.0 ISDN
- 1100 C2 ISDN
- 1200 T1 ISDN
-1245 A.P.D., S.A.
-1246 Dipix Technologies, Inc.
-1247 Xylon Research, Inc.
-1248 Central Data Corporation
-1249 Samsung Electronics Co., Ltd.
-124a AEG Electrocom GmbH
-124b SBS/Greenspring Modular I/O
- 0040 PCI-40A or cPCI-200 Quad IndustryPack carrier
- 124b 9080 PCI9080 Bridge
-124c Solitron Technologies, Inc.
-124d Stallion Technologies, Inc.
- 0000 EasyConnection 8/32
- 0002 EasyConnection 8/64
- 0003 EasyIO
- 0004 EasyConnection/RA
-124e Cylink
-124f Infotrend Technology, Inc.
- 0041 IFT-2000 Series RAID Controller
-1250 Hitachi Microcomputer System Ltd
-1251 VLSI Solutions Oy
-1253 Guzik Technical Enterprises
-1254 Linear Systems Ltd.
-1255 Optibase Ltd
- 1110 MPEG Forge
- 1210 MPEG Fusion
- 2110 VideoPlex
- 2120 VideoPlex CC
- 2130 VideoQuest
-1256 Perceptive Solutions, Inc.
- 4201 PCI-2220I
- 4401 PCI-2240I
- 5201 PCI-2000
-1257 Vertex Networks, Inc.
-1258 Gilbarco, Inc.
-1259 Allied Telesyn International
- 2560 AT-2560 Fast Ethernet Adapter (i82557B)
-125a ABB Power Systems
-125b Asix Electronics Corporation
- 1400 ALFA GFC2204
-125c Aurora Technologies, Inc.
- 0640 Aries 16000P
-125d ESS Technology
- 0000 ES336H Fax Modem (Early Model)
- 1948 Solo?
- 1968 ES1968 Maestro 2
- 1028 0085 ES1968 Maestro-2 PCI
- 1033 8051 ES1968 Maestro-2 Audiodrive
- 1969 ES1969 Solo-1 Audiodrive
- 1014 0166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard
- 125d 8888 Solo-1 Audio Adapter
- 1978 ES1978 Maestro 2E
- 0e11 b112 Armada M700
- 1033 803c ES1978 Maestro-2E Audiodrive
- 1033 8058 ES1978 Maestro-2E Audiodrive
- 1092 4000 Monster Sound MX400
- 1179 0001 ES1978 Maestro-2E Audiodrive
- 1988 ES1988 Allegro-1
- 1092 4100 Sonic Impact S100
- 125d 1988 ESS Allegro-1 Audiodrive
- 1989 ESS Modem
- 125d 1989 ESS Modem
- 1998 ES1983S Maestro-3i PCI Audio Accelerator
- 1028 00e6 ES1983S Maestro-3i (Dell Inspiron 8100)
- 1999 ES1983S Maestro-3i PCI Modem Accelerator
- 199a ES1983S Maestro-3i PCI Audio Accelerator
- 199b ES1983S Maestro-3i PCI Modem Accelerator
- 2808 ES336H Fax Modem (Later Model)
- 2838 ES2838/2839 SuperLink Modem
- 2898 ES2898 Modem
- 125d 0424 ES56-PI Data Fax Modem
- 125d 0425 ES56T-PI Data Fax Modem
- 125d 0426 ES56V-PI Data Fax Modem
- 125d 0427 VW-PI Data Fax Modem
- 125d 0428 ES56ST-PI Data Fax Modem
- 125d 0429 ES56SV-PI Data Fax Modem
- 147a c001 ES56-PI Data Fax Modem
- 14fe 0428 ES56-PI Data Fax Modem
- 14fe 0429 ES56-PI Data Fax Modem
-125e Specialvideo Engineering SRL
-125f Concurrent Technologies, Inc.
-1260 Harris Semiconductor
- 3873 Prism 2.5 Wavelan chipset
- 1186 3501 DWL-520 Wireless PCI Adapter
- 1668 0414 HWP01170-01 802.11b PCI Wireless Adapter
- 1737 3874 WMP11 Wireless 802.11b PCI Adapter
- 8086 2513 Wireless 802.11b MiniPCI Adapter
- 3890 D-Links DWL-g650 A1
- 8130 HMP8130 NTSC/PAL Video Decoder
- 8131 HMP8131 NTSC/PAL Video Decoder
-1261 Matsushita-Kotobuki Electronics Industries, Ltd.
-1262 ES Computer Company, Ltd.
-1263 Sonic Solutions
-1264 Aval Nagasaki Corporation
-1265 Casio Computer Co., Ltd.
-1266 Microdyne Corporation
- 0001 NE10/100 Adapter (i82557B)
- 1910 NE2000Plus (RT8029) Ethernet Adapter
- 1266 1910 NE2000Plus Ethernet Adapter
-1267 S. A. Telecommunications
- 5352 PCR2101
- 5a4b Telsat Turbo
-1268 Tektronix
-1269 Thomson-CSF/TTM
-126a Lexmark International, Inc.
-126b Adax, Inc.
-126c Northern Telecom
-126d Splash Technology, Inc.
-126e Sumitomo Metal Industries, Ltd.
-126f Silicon Motion, Inc.
- 0710 SM710 LynxEM
- 0712 SM712 LynxEM+
- 0720 SM720 Lynx3DM
- 0810 SM810 LynxE
- 0811 SM811 LynxE
- 0820 SM820 Lynx3D
- 0910 SM910
-1270 Olympus Optical Co., Ltd.
-1271 GW Instruments
-1272 Telematics International
-1273 Hughes Network Systems
- 0002 DirecPC
-1274 Ensoniq
- 1171 ES1373 [AudioPCI] (also Creative Labs CT5803)
- 1371 ES1371 [AudioPCI-97]
- 0e11 0024 AudioPCI on Motherboard Compaq Deskpro
- 0e11 b1a7 ES1371, ES1373 AudioPCI
- 1033 80ac ES1371, ES1373 AudioPCI
- 1042 1854 Tazer
- 107b 8054 Tabor2
- 1274 1371 Creative Sound Blaster AudioPCI64V, AudioPCI128
- 1462 6470 ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A
- 1462 6560 ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10
- 1462 6630 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A
- 1462 6631 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A
- 1462 6632 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A
- 1462 6633 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A
- 1462 6820 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00
- 1462 6822 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A
- 1462 6830 ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00
- 1462 6880 ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00
- 1462 6900 ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00
- 1462 6910 ES1371, ES1373 AudioPCI On Motherboard MS-6191
- 1462 6930 ES1371, ES1373 AudioPCI On Motherboard MS-6193
- 1462 6990 ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A
- 1462 6991 ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A
- 14a4 2077 ES1371, ES1373 AudioPCI On Motherboard KR639
- 14a4 2105 ES1371, ES1373 AudioPCI On Motherboard MR800
- 14a4 2107 ES1371, ES1373 AudioPCI On Motherboard MR801
- 14a4 2172 ES1371, ES1373 AudioPCI On Motherboard DR739
- 1509 9902 ES1371, ES1373 AudioPCI On Motherboard KW11
- 1509 9903 ES1371, ES1373 AudioPCI On Motherboard KW31
- 1509 9904 ES1371, ES1373 AudioPCI On Motherboard KA11
- 1509 9905 ES1371, ES1373 AudioPCI On Motherboard KC13
- 152d 8801 ES1371, ES1373 AudioPCI On Motherboard CP810E
- 152d 8802 ES1371, ES1373 AudioPCI On Motherboard CP810
- 152d 8803 ES1371, ES1373 AudioPCI On Motherboard P3810E
- 152d 8804 ES1371, ES1373 AudioPCI On Motherboard P3810-S
- 152d 8805 ES1371, ES1373 AudioPCI On Motherboard P3820-S
- 270f 2001 ES1371, ES1373 AudioPCI On Motherboard 6CTR
- 270f 2200 ES1371, ES1373 AudioPCI On Motherboard 6WTX
- 270f 3000 ES1371, ES1373 AudioPCI On Motherboard 6WSV
- 270f 3100 ES1371, ES1373 AudioPCI On Motherboard 6WIV2
- 270f 3102 ES1371, ES1373 AudioPCI On Motherboard 6WIV
- 270f 7060 ES1371, ES1373 AudioPCI On Motherboard 6ASA2
- 8086 4249 ES1371, ES1373 AudioPCI On Motherboard BI440ZX
- 8086 424c ES1371, ES1373 AudioPCI On Motherboard BL440ZX
- 8086 425a ES1371, ES1373 AudioPCI On Motherboard BZ440ZX
- 8086 4341 ES1371, ES1373 AudioPCI On Motherboard Cayman
- 8086 4343 ES1371, ES1373 AudioPCI On Motherboard Cape Cod
- 8086 4649 ES1371, ES1373 AudioPCI On Motherboard Fire Island
- 8086 464a ES1371, ES1373 AudioPCI On Motherboard FJ440ZX
- 8086 4d4f ES1371, ES1373 AudioPCI On Motherboard Montreal
- 8086 4f43 ES1371, ES1373 AudioPCI On Motherboard OC440LX
- 8086 5243 ES1371, ES1373 AudioPCI On Motherboard RC440BX
- 8086 5352 ES1371, ES1373 AudioPCI On Motherboard SunRiver
- 8086 5643 ES1371, ES1373 AudioPCI On Motherboard Vancouver
- 8086 5753 ES1371, ES1373 AudioPCI On Motherboard WS440BX
- 5000 ES1370 [AudioPCI]
- 5880 5880 AudioPCI
- 1274 2000 Creative Sound Blaster AudioPCI128
- 1274 2003 Creative SoundBlaster AudioPCI 128
- 1274 5880 Creative Sound Blaster AudioPCI128
- 1458 a000 5880 AudioPCI On Motherboard 6OXET
- 1462 6880 5880 AudioPCI On Motherboard MS-6188 1.00
- 270f 2001 5880 AudioPCI On Motherboard 6CTR
- 270f 2200 5880 AudioPCI On Motherboard 6WTX
- 270f 7040 5880 AudioPCI On Motherboard 6ATA4
-1275 Network Appliance Corporation
-1276 Switched Network Technologies, Inc.
-1277 Comstream
-1278 Transtech Parallel Systems Ltd.
- 0701 TPE3/TM3 PowerPC Node
- 0710 TPE5 PowerPC PCI board
-1279 Transmeta Corporation
- 0295 Northbridge
- 0395 LongRun Northbridge
- 0396 SDRAM controller
- 0397 BIOS scratchpad
-127a Rockwell International
- 1002 HCF 56k Data/Fax Modem
- 1092 094c SupraExpress 56i PRO [Diamond SUP2380]
- 122d 4002 HPG / MDP3858-U
- 122d 4005 MDP3858-E
- 122d 4007 MDP3858-A/-NZ
- 122d 4012 MDP3858-SA
- 122d 4017 MDP3858-W
- 122d 4018 MDP3858-W
- 127a 1002 Rockwell 56K D/F HCF Modem
- 1003 HCF 56k Data/Fax Modem
- 0e11 b0bc 229-DF Zephyr
- 0e11 b114 229-DF Cheetah
- 1033 802b 229-DF
- 13df 1003 PCI56RX Modem
- 13e0 0117 IBM
- 13e0 0147 IBM F-1156IV+/R3 Spain V.90 Modem
- 13e0 0197 IBM
- 13e0 01c7 IBM F-1156IV+/R3 WW V.90 Modem
- 13e0 01f7 IBM
- 1436 1003 IBM
- 1436 1103 IBM 5614PM3G V.90 Modem
- 1436 1602 Compaq 229-DF Ducati
- 1004 HCF 56k Data/Fax/Voice Modem
- 1048 1500 MicroLink 56k Modem
- 10cf 1059 Fujitsu 229-DFRT
- 1005 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 1033 8029 229-DFSV
- 1033 8054 Modem
- 10cf 103c Fujitsu
- 10cf 1055 Fujitsu 229-DFSV
- 10cf 1056 Fujitsu 229-DFSV
- 122d 4003 MDP3858SP-U
- 122d 4006 Packard Bell MDP3858V-E
- 122d 4008 MDP3858SP-A/SP-NZ
- 122d 4009 MDP3858SP-E
- 122d 4010 MDP3858V-U
- 122d 4011 MDP3858SP-SA
- 122d 4013 MDP3858V-A/V-NZ
- 122d 4015 MDP3858SP-W
- 122d 4016 MDP3858V-W
- 122d 4019 MDP3858V-SA
- 13df 1005 PCI56RVP Modem
- 13e0 0187 IBM
- 13e0 01a7 IBM
- 13e0 01b7 IBM DF-1156IV+/R3 Spain V.90 Modem
- 13e0 01d7 IBM DF-1156IV+/R3 WW V.90 Modem
- 1436 1005 IBM
- 1436 1105 IBM
- 1437 1105 IBM 5614PS3G V.90 Modem
- 1022 HCF 56k Modem
- 1436 1303 M3-5614PM3G V.90 Modem
- 1023 HCF 56k Data/Fax Modem
- 122d 4020 Packard Bell MDP3858-WE
- 122d 4023 MDP3858-UE
- 13e0 0247 IBM F-1156IV+/R6 Spain V.90 Modem
- 13e0 0297 IBM
- 13e0 02c7 IBM F-1156IV+/R6 WW V.90 Modem
- 1436 1203 IBM
- 1436 1303 IBM
- 1024 HCF 56k Data/Fax/Voice Modem
- 1025 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 10cf 106a Fujitsu 235-DFSV
- 122d 4021 Packard Bell MDP3858V-WE
- 122d 4022 MDP3858SP-WE
- 122d 4024 MDP3858V-UE
- 122d 4025 MDP3858SP-UE
- 1026 HCF 56k PCI Speakerphone Modem
- 1032 HCF 56k Modem
- 1033 HCF 56k Modem
- 1034 HCF 56k Modem
- 1035 HCF 56k PCI Speakerphone Modem
- 1036 HCF 56k Modem
- 1085 HCF 56k Volcano PCI Modem
- 2005 HCF 56k Data/Fax Modem
- 104d 8044 229-DFSV
- 104d 8045 229-DFSV
- 104d 8055 PBE/Aztech 235W-DFSV
- 104d 8056 235-DFSV
- 104d 805a Modem
- 104d 805f Modem
- 104d 8074 Modem
- 2013 HSF 56k Data/Fax Modem
- 1179 0001 Modem
- 1179 ff00 Modem
- 2014 HSF 56k Data/Fax/Voice Modem
- 10cf 1057 Fujitsu Citicorp III
- 122d 4050 MSP3880-U
- 122d 4055 MSP3880-W
- 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 10cf 1063 Fujitsu
- 10cf 1064 Fujitsu
- 1468 2015 Fujitsu
- 2016 HSF 56k Data/Fax/Voice/Spkp Modem
- 122d 4051 MSP3880V-W
- 122d 4052 MSP3880SP-W
- 122d 4054 MSP3880V-U
- 122d 4056 MSP3880SP-U
- 122d 4057 MSP3880SP-A
- 4311 Riptide HSF 56k PCI Modem
- 127a 4311 Ring Modular? Riptide HSF RT HP Dom
- 13e0 0210 HP-GVC
- 4320 Riptide PCI Audio Controller
- 1235 4320 Riptide PCI Audio Controller
- 4321 Riptide HCF 56k PCI Modem
- 1235 4321 Hewlett Packard DF
- 1235 4324 Hewlett Packard DF
- 13e0 0210 Hewlett Packard DF
- 144d 2321 Riptide
- 4322 Riptide PCI Game Controller
- 1235 4322 Riptide PCI Game Controller
- 8234 RapidFire 616X ATM155 Adapter
- 108d 0022 RapidFire 616X ATM155 Adapter
- 108d 0027 RapidFire 616X ATM155 Adapter
-127b Pixera Corporation
-127c Crosspoint Solutions, Inc.
-127d Vela Research
-127e Winnov, L.P.
-127f Fujifilm
-1280 Photoscript Group Ltd.
-1281 Yokogawa Electric Corporation
-1282 Davicom Semiconductor, Inc.
- 9009 Ethernet 100/10 MBit
- 9100 Ethernet 100/10 MBit
- 9102 Ethernet 100/10 MBit
- 9132 Ethernet 100/10 MBit
-1283 Integrated Technology Express, Inc.
- 673a IT8330G
- 8330 IT8330G
- 8888 IT8888F PCI to ISA Bridge with SMB
- 8889 IT8889F PCI to ISA Bridge
- e886 IT8330G
-1284 Sahara Networks, Inc.
-1285 Platform Technologies, Inc.
- 0100 AGOGO sound chip (aka ESS Maestro 1)
-1286 Mazet GmbH
-1287 M-Pact, Inc.
- 001e LS220D DVD Decoder
- 001f LS220C DVD Decoder
-1288 Timestep Corporation
-1289 AVC Technology, Inc.
-128a Asante Technologies, Inc.
-128b Transwitch Corporation
-128c Retix Corporation
-128d G2 Networks, Inc.
- 0021 ATM155 Adapter
-128e Hoontech Corporation/Samho Multi Tech Ltd.
- 0008 ST128 WSS/SB
- 0009 ST128 SAM9407
- 000a ST128 Game Port
- 000b ST128 MPU Port
- 000c ST128 Ctrl Port
-128f Tateno Dennou, Inc.
-1290 Sord Computer Corporation
-1291 NCS Computer Italia
-1292 Tritech Microelectronics Inc
-1293 Media Reality Technology
-1294 Rhetorex, Inc.
-1295 Imagenation Corporation
-1296 Kofax Image Products
-1297 Holco Enterprise Co, Ltd/Shuttle Computer
-1298 Spellcaster Telecommunications Inc.
-1299 Knowledge Technology Lab.
-129a VMetro, inc.
- 0615 PBT-615 PCI-X Bus Analyzer
-129b Image Access
-129c Jaycor
-129d Compcore Multimedia, Inc.
-129e Victor Company of Japan, Ltd.
-129f OEC Medical Systems, Inc.
-12a0 Allen-Bradley Company
-12a1 Simpact Associates, Inc.
-12a2 Newgen Systems Corporation
-12a3 Lucent Technologies
-12a4 NTT Electronics Technology Company
-12a5 Vision Dynamics Ltd.
-12a6 Scalable Networks, Inc.
-12a7 AMO GmbH
-12a8 News Datacom
-12a9 Xiotech Corporation
-12aa SDL Communications, Inc.
-12ab Yuan Yuan Enterprise Co., Ltd.
- 3000 MPG-200C PCI DVD Decoder Card
-12ac Measurex Corporation
-12ad Multidata GmbH
-12ae Alteon Networks Inc.
- 0001 AceNIC Gigabit Ethernet
- 12ae 0001 Gigabit Ethernet-SX (Universal)
- 1410 0104 Gigabit Ethernet-SX PCI Adapter
- 0002 AceNIC Gigabit Ethernet (Copper)
- 10a9 8002 Acenic Gigabit Ethernet
- 12ae 0002 Gigabit Ethernet-T (3C986-T)
-12af TDK USA Corp
-12b0 Jorge Scientific Corp
-12b1 GammaLink
-12b2 General Signal Networks
-12b3 Inter-Face Co Ltd
-12b4 FutureTel Inc
-12b5 Granite Systems Inc.
-12b6 Natural Microsystems
-12b7 Cognex Modular Vision Systems Div. - Acumen Inc.
-12b8 Korg
-12b9 US Robotics/3Com
- 1006 WinModem
- 12b9 005c USR 56k Internal Voice WinModem (Model 3472)
- 12b9 005e USR 56k Internal WinModem (Models 662975)
- 12b9 0062 USR 56k Internal Voice WinModem (Model 662978)
- 12b9 0068 USR 56k Internal Voice WinModem (Model 5690)
- 12b9 007a USR 56k Internal Voice WinModem (Model 662974)
- 12b9 007f USR 56k Internal WinModem (Models 5698, 5699)
- 12b9 0080 USR 56k Internal WinModem (Models 2975, 3528)
- 12b9 0081 USR 56k Internal Voice WinModem (Models 2974, 3529)
- 12b9 0091 USR 56k Internal Voice WinModem (Model 2978)
- 1007 USR 56k Internal WinModem
- 12b9 00a3 USR 56k Internal WinModem (Model 3595)
- 1008 56K FaxModem Model 5610
- 12b9 00a2 USR 56k Internal FAX Modem (Model 2977)
- 12b9 00aa USR 56k Internal Voice Modem (Model 2976)
- 12b9 00ab USR 56k Internal Voice Modem (Model 5609)
- 12b9 00ac USR 56k Internal Voice Modem (Model 3298)
- 12b9 00ad USR 56k Internal FAX Modem (Model 5610)
-12ba BittWare, Inc.
-12bb Nippon Unisoft Corporation
-12bc Array Microsystems
-12bd Computerm Corp.
-12be Anchor Chips Inc.
- 3041 AN3041Q CO-MEM
- 3042 AN3042Q CO-MEM Lite
- 12be 3042 Anchor Chips Lite Evaluation Board
-12bf Fujifilm Microdevices
-12c0 Infimed
-12c1 GMM Research Corp
-12c2 Mentec Limited
-12c3 Holtek Microelectronics Inc
- 0058 PCI NE2K Ethernet
- 5598 PCI NE2K Ethernet
-12c4 Connect Tech Inc
-12c5 Picture Elements Incorporated
- 007e Imaging/Scanning Subsystem Engine
- 007f Imaging/Scanning Subsystem Engine
- 0081 PCIVST [Grayscale Thresholding Engine]
- 0085 Video Simulator/Sender
- 0086 THR2 Multi-scale Thresholder
-12c6 Mitani Corporation
-12c7 Dialogic Corp
-12c8 G Force Co, Ltd
-12c9 Gigi Operations
-12ca Integrated Computing Engines
-12cb Antex Electronics Corporation
-12cc Pluto Technologies International
-12cd Aims Lab
-12ce Netspeed Inc.
-12cf Prophet Systems, Inc.
-12d0 GDE Systems, Inc.
-12d1 PSITech
-12d2 NVidia / SGS Thomson (Joint Venture)
- 0008 NV1
- 0009 DAC64
- 0018 Riva128
- 1048 0c10 VICTORY Erazor
- 107b 8030 STB Velocity 128
- 1092 0350 Viper V330
- 1092 1092 Viper V330
- 10b4 1b1b STB Velocity 128
- 10b4 1b1d STB Velocity 128
- 10b4 1b1e STB Velocity 128, PAL TV-Out
- 10b4 1b20 STB Velocity 128 Sapphire
- 10b4 1b21 STB Velocity 128
- 10b4 1b22 STB Velocity 128 AGP, NTSC TV-Out
- 10b4 1b23 STB Velocity 128 AGP, PAL TV-Out
- 10b4 1b27 STB Velocity 128 DVD
- 10b4 1b88 MVP Pro 128
- 10b4 222a STB Velocity 128 AGP
- 10b4 2230 STB Velocity 128
- 10b4 2232 STB Velocity 128
- 10b4 2235 STB Velocity 128 AGP
- 2a15 54a3 3DVision-SAGP / 3DexPlorer 3000
- 0019 Riva128ZX
- 0020 TNT
- 0028 TNT2
- 0029 UTNT2
- 002c VTNT2
- 00a0 ITNT2
-12d3 Vingmed Sound A/S
-12d4 Ulticom (Formerly DGM&S)
- 0200 T1 Card
-12d5 Equator Technologies
-12d6 Analogic Corp
-12d7 Biotronic SRL
-12d8 Pericom Semiconductor
-12d9 Aculab PLC
- 0002 PCI Prosody
- 0004 cPCI Prosody
-12da True Time Inc.
-12db Annapolis Micro Systems, Inc
-12dc Symicron Computer Communication Ltd.
-12dd Management Graphics
-12de Rainbow Technologies
-12df SBS Technologies Inc
-12e0 Chase Research
- 0010 ST16C654 Quad UART
- 0020 ST16C654 Quad UART
- 0030 ST16C654 Quad UART
-12e1 Nintendo Co, Ltd
-12e2 Datum Inc. Bancomm-Timing Division
-12e3 Imation Corp - Medical Imaging Systems
-12e4 Brooktrout Technology Inc
-12e5 Apex Semiconductor Inc
-12e6 Cirel Systems
-12e7 Sunsgroup Corporation
-12e8 Crisc Corp
-12e9 GE Spacenet
-12ea Zuken
-12eb Aureal Semiconductor
- 0001 Vortex 1
- 104d 8036 AU8820 Vortex Digital Audio Processor
- 1092 2000 Sonic Impact A3D
- 1092 2100 Sonic Impact A3D
- 1092 2110 Sonic Impact A3D
- 1092 2200 Sonic Impact A3D
- 122d 1002 AU8820 Vortex Digital Audio Processor
- 12eb 0001 AU8820 Vortex Digital Audio Processor
- 5053 3355 Montego
- 0002 Vortex 2
- 104d 8049 AU8830 Vortex 3D Digital Audio Processor
- 104d 807b AU8830 Vortex 3D Digital Audio Processor
- 1092 3000 Monster Sound II
- 1092 3001 Monster Sound II
- 1092 3002 Monster Sound II
- 1092 3003 Monster Sound II
- 1092 3004 Monster Sound II
- 12eb 0001 AU8830 Vortex 3D Digital Audio Processor
- 12eb 0002 AU8830 Vortex 3D Digital Audio Processor
- 12eb 0088 AU8830 Vortex 3D Digital Audio Processor
- 144d 3510 AU8830 Vortex 3D Digital Audio Processor
- 5053 3356 Montego II
- 0003 AU8810 Vortex Digital Audio Processor
- 104d 8049 AU8810 Vortex Digital Audio Processor
- 104d 8077 AU8810 Vortex Digital Audio Processor
- 109f 1000 AU8810 Vortex Digital Audio Processor
- 12eb 0003 AU8810 Vortex Digital Audio Processor
- 1462 6780 AU8810 Vortex Digital Audio Processor
- 14a4 2073 AU8810 Vortex Digital Audio Processor
- 14a4 2091 AU8810 Vortex Digital Audio Processor
- 14a4 2104 AU8810 Vortex Digital Audio Processor
- 14a4 2106 AU8810 Vortex Digital Audio Processor
- 8803 Vortex 56k Software Modem
- 12eb 8803 Vortex 56k Software Modem
-12ec 3A International, Inc.
-12ed Optivision Inc.
-12ee Orange Micro
-12ef Vienna Systems
-12f0 Pentek
-12f1 Sorenson Vision Inc
-12f2 Gammagraphx, Inc.
-12f3 Radstone Technology
-12f4 Megatel
-12f5 Forks
-12f6 Dawson France
-12f7 Cognex
-12f8 Electronic Design GmbH
- 0002 VideoMaker
-12f9 Four Fold Ltd
-12fb Spectrum Signal Processing
-12fc Capital Equipment Corp
-12fd I2S
-12fe ESD Electronic System Design GmbH
-12ff Lexicon
-1300 Harman International Industries Inc
-1302 Computer Sciences Corp
-1303 Innovative Integration
-1304 Juniper Networks
-1305 Netphone, Inc
-1306 Duet Technologies
-1307 Computer Boards
- 0001 PCI-DAS1602/16
- 000b PCI-DIO48H
- 000c PCI-PDISO8
- 000d PCI-PDISO16
- 000f PCI-DAS1200
- 0010 PCI-DAS1602/12
- 0014 PCI-DIO24H
- 0015 PCI-DIO24H/CTR3
- 0016 PCI-DIO48H/CTR15
- 0017 PCI-DIO96H
- 0018 PCI-CTR05
- 0019 PCI-DAS1200/JR
- 001a PCI-DAS1001
- 001b PCI-DAS1002
- 001c PCI-DAS1602JR/16
- 001d PCI-DAS6402/16
- 001e PCI-DAS6402/12
- 001f PCI-DAS16/M1
- 0020 PCI-DDA02/12
- 0021 PCI-DDA04/12
- 0022 PCI-DDA08/12
- 0023 PCI-DDA02/16
- 0024 PCI-DDA04/16
- 0025 PCI-DDA08/16
- 0026 PCI-DAC04/12-HS
- 0027 PCI-DAC04/16-HS
- 0028 PCI-DIO24
- 0029 PCI-DAS08
- 002c PCI-INT32
- 0033 PCI-DUAL-AC5
- 0034 PCI-DAS-TC
- 0035 PCI-DAS64/M1/16
- 0036 PCI-DAS64/M2/16
- 0037 PCI-DAS64/M3/16
- 004c PCI-DAS1000
- 004d PCI-QUAD04
-1308 Jato Technologies Inc.
- 0001 NetCelerator Adapter
- 1308 0001 NetCelerator Adapter
-1309 AB Semiconductor Ltd
-130a Mitsubishi Electric Microcomputer
-130b Colorgraphic Communications Corp
-130c Ambex Technologies, Inc
-130d Accelerix Inc
-130e Yamatake-Honeywell Co. Ltd
-130f Advanet Inc
-1310 Gespac
-1311 Videoserver, Inc
-1312 Acuity Imaging, Inc
-1313 Yaskawa Electric Co.
-1316 Teradyne Inc
-1317 Linksys
- 0981 Fast Ethernet 10/100
- 0985 Network Everywhere Fast Ethernet 10/100 model NC100
- 1985 Fast Ethernet 10/100
-1318 Packet Engines Inc.
- 0911 PCI Ethernet Adapter
-1319 Fortemedia, Inc
- 0801 Xwave QS3000A [FM801]
- 0802 Xwave QS3000A [FM801 game port]
- 1000 FM801 PCI Audio
- 1001 FM801 PCI Joystick
-131a Finisar Corp.
-131c Nippon Electro-Sensory Devices Corp
-131d Sysmic, Inc.
-131e Xinex Networks Inc
-131f Siig Inc
- 1000 CyberSerial (1-port) 16550
- 1001 CyberSerial (1-port) 16650
- 1002 CyberSerial (1-port) 16850
- 1010 Duet 1S(16550)+1P
- 1011 Duet 1S(16650)+1P
- 1012 Duet 1S(16850)+1P
- 1020 CyberParallel (1-port)
- 1021 CyberParallel (2-port)
- 1030 CyberSerial (2-port) 16550
- 1031 CyberSerial (2-port) 16650
- 1032 CyberSerial (2-port) 16850
- 1034 Trio 2S(16550)+1P
- 1035 Trio 2S(16650)+1P
- 1036 Trio 2S(16850)+1P
- 1050 CyberSerial (4-port) 16550
- 1051 CyberSerial (4-port) 16650
- 1052 CyberSerial (4-port) 16850
- 2000 CyberSerial (1-port) 16550
- 2001 CyberSerial (1-port) 16650
- 2002 CyberSerial (1-port) 16850
- 2010 Duet 1S(16550)+1P
- 2011 Duet 1S(16650)+1P
- 2012 Duet 1S(16850)+1P
- 2020 CyberParallel (1-port)
- 2021 CyberParallel (2-port)
- 2030 CyberSerial (2-port) 16550
- 131f 2030 PCI Serial Card
- 2031 CyberSerial (2-port) 16650
- 2032 CyberSerial (2-port) 16850
- 2040 Trio 1S(16550)+2P
- 2041 Trio 1S(16650)+2P
- 2042 Trio 1S(16850)+2P
- 2050 CyberSerial (4-port) 16550
- 2051 CyberSerial (4-port) 16650
- 2052 CyberSerial (4-port) 16850
- 2060 Trio 2S(16550)+1P
- 2061 Trio 2S(16650)+1P
- 2062 Trio 2S(16850)+1P
-1320 Crypto AG
-1321 Arcobel Graphics BV
-1322 MTT Co., Ltd
-1323 Dome Inc
-1324 Sphere Communications
-1325 Salix Technologies, Inc
-1326 Seachange international
-1327 Voss scientific
-1328 quadrant international
-1329 Productivity Enhancement
-132a Microcom Inc.
-132b Broadband Technologies
-132c Micrel Inc
-132d Integrated Silicon Solution, Inc.
-1330 MMC Networks
-1331 Radisys Corp.
-1332 Micro Memory
- 5415 MM-5415CN PCI Memory Module with Battery Backup
- 5425 MM-5425CN PCI 64/66 Memory Module with Battery Backup
-1334 Redcreek Communications, Inc
-1335 Videomail, Inc
-1337 Third Planet Publishing
-1338 BT Electronics
-133a Vtel Corp
-133b Softcom Microsystems
-133c Holontech Corp
-133d SS Technologies
-133e Virtual Computer Corp
-133f SCM Microsystems
-1340 Atalla Corp
-1341 Kyoto Microcomputer Co
-1342 Promax Systems Inc
-1343 Phylon Communications Inc
-1344 Crucial Technology
-1345 Arescom Inc
-1347 Odetics
-1349 Sumitomo Electric Industries, Ltd.
-134a DTC Technology Corp.
- 0001 Domex 536
- 0002 Domex DMX3194UP SCSI Adapter
-134b ARK Research Corp.
-134c Chori Joho System Co. Ltd
-134d PCTel Inc
- 7890 HSP MicroModem 56
- 7891 HSP MicroModem 56
- 134d 0001 HSP MicroModem 56
- 7892 HSP MicroModem 56
- 7893 HSP MicroModem 56
- 7894 HSP MicroModem 56
- 7895 HSP MicroModem 56
- 7896 HSP MicroModem 56
- 7897 HSP MicroModem 56
-134e CSTI
-134f Algo System Co Ltd
-1350 Systec Co. Ltd
-1351 Sonix Inc
-1353 Thales Idatys
- 0002 Proserver
- 0003 PCI-FUT
- 0004 PCI-S0
- 0005 PCI-FUT-S0
-1354 Dwave System Inc
-1355 Kratos Analytical Ltd
-1356 The Logical Co
-1359 Prisa Networks
-135a Brain Boxes
-135b Giganet Inc
-135c Quatech Inc
- 0010 QSC-100
- 0020 DSC-100
- 0030 DSC-200/300
- 0040 QSC-200/300
- 0050 ESC-100D
- 0060 ESC-100M
- 00f0 MPAC-100 Syncronous Serial Card (Zilog 85230)
- 0170 QSCLP-100
- 0180 DSCLP-100
- 0190 SSCLP-100
- 01a0 QSCLP-200/300
- 01b0 DSCLP-200/300
- 01c0 SSCLP-200/300
-135d ABB Network Partner AB
-135e Sealevel Systems Inc
- 7101 Single Port RS-232/422/485/530
- 7201 Dual Port RS-232/422/485 Interface
- 7202 Dual Port RS-232 Interface
- 7401 Four Port RS-232 Interface
- 7402 Four Port RS-422/485 Interface
- 7801 Eight Port RS-232 Interface
- 8001 8001 Digital I/O Adapter
-135f I-Data International A-S
-1360 Meinberg Funkuhren
-1361 Soliton Systems K.K.
-1362 Fujifacom Corporation
-1363 Phoenix Technology Ltd
-1364 ATM Communications Inc
-1365 Hypercope GmbH
-1366 Teijin Seiki Co. Ltd
-1367 Hitachi Zosen Corporation
-1368 Skyware Corporation
-1369 Digigram
-136a High Soft Tech
-136b Kawasaki Steel Corporation
-136c Adtek System Science Co Ltd
-136d Gigalabs Inc
-136f Applied Magic Inc
-1370 ATL Products
-1371 CNet Technology Inc
-1373 Silicon Vision Inc
-1374 Silicom Ltd
-1375 Argosystems Inc
-1376 LMC
-1377 Electronic Equipment Production & Distribution GmbH
-1378 Telemann Co. Ltd
-1379 Asahi Kasei Microsystems Co Ltd
-137a Mark of the Unicorn Inc
-137b PPT Vision
-137c Iwatsu Electric Co Ltd
-137d Dynachip Corporation
-137e Patriot Scientific Corporation
-137f Japan Satellite Systems Inc
-1380 Sanritz Automation Co Ltd
-1381 Brains Co. Ltd
-1382 Marian - Electronic & Software
-1383 Controlnet Inc
-1384 Reality Simulation Systems Inc
-1385 Netgear
- 4100 802.11b Wireless Adapter (MA301)
- 4105 MA311 802.11b wireless adapter
- 620a GA620
- 622a GA622
- 630a GA630
- f311 FA311
-1386 Video Domain Technologies
-1387 Systran Corp
-1388 Hitachi Information Technology Co Ltd
-1389 Applicom International
- 0001 PCI1500PFB [Intelligent fieldbus adaptor]
-138a Fusion Micromedia Corp
-138b Tokimec Inc
-138c Silicon Reality
-138d Future Techno Designs pte Ltd
-138e Basler GmbH
-138f Patapsco Designs Inc
-1390 Concept Development Inc
-1391 Development Concepts Inc
-1392 Medialight Inc
-1393 Moxa Technologies Co Ltd
- 1040 Smartio C104H/PCI
- 1680 Smartio C168H/PCI
- 2040 Intellio CP-204J
- 2180 Intellio C218 Turbo PCI
- 3200 Intellio C320 Turbo PCI
-1394 Level One Communications
- 0001 LXT1001 Gigabit Ethernet
- 1394 0001 NetCelerator Adapter
-1395 Ambicom Inc
-1396 Cipher Systems Inc
-1397 Cologne Chip Designs GmbH
- 2bd0 ISDN network controller [HFC-PCI]
- 1397 2bd0 ISDN Board
- e4bf 1000 CI1-1-Harp
-1398 Clarion co. Ltd
-1399 Rios systems Co Ltd
-139a Alacritech Inc
- 0001 Quad Port 10/100 Server Accelerator
- 0003 Single Port 10/100 Server Accelerator
- 0005 Single Port Gigabit Server Accelerator
-139b Mediasonic Multimedia Systems Ltd
-139c Quantum 3d Inc
-139d EPL limited
-139e Media4
-139f Aethra s.r.l.
-13a0 Crystal Group Inc
-13a1 Kawasaki Heavy Industries Ltd
-13a2 Ositech Communications Inc
-13a3 Hifn Inc.
- 0005 7751 Security Processor
- 0006 6500 Public Key Processor
- 0007 7811 Security Processor
- 0012 7951 Security Processor
- 0014 78XX Security Processor
- 0016 8065 Security Processor
- 0017 8165 Security Processor
- 0018 8154 Security Processor
-13a4 Rascom Inc
-13a5 Audio Digital Imaging Inc
-13a6 Videonics Inc
-13a7 Teles AG
-13a8 Exar Corp.
- 0158 XR17C158 Octal UART
-13a9 Siemens Medical Systems, Ultrasound Group
-13aa Broadband Networks Inc
-13ab Arcom Control Systems Ltd
-13ac Motion Media Technology Ltd
-13ad Nexus Inc
-13ae ALD Technology Ltd
-13af T.Sqware
-13b0 Maxspeed Corp
-13b1 Tamura corporation
-13b2 Techno Chips Co. Ltd
-13b3 Lanart Corporation
-13b4 Wellbean Co Inc
-13b5 ARM
-13b6 Dlog GmbH
-13b7 Logic Devices Inc
-13b8 Nokia Telecommunications oy
-13b9 Elecom Co Ltd
-13ba Oxford Instruments
-13bb Sanyo Technosound Co Ltd
-13bc Bitran Corporation
-13bd Sharp corporation
-13be Miroku Jyoho Service Co. Ltd
-13bf Sharewave Inc
-13c0 Microgate Corporation
- 0010 SyncLink WAN Adapter
-13c1 3ware Inc
- 1000 3ware ATA-RAID
- 1001 3ware 7000-series ATA-RAID
- 1002 3ware ATA-RAID
-13c2 Technotrend Systemtechnik GmbH
-13c3 Janz Computer AG
-13c4 Phase Metrics
-13c5 Alphi Technology Corp
-13c6 Condor Engineering Inc
-13c7 Blue Chip Technology Ltd
-13c8 Apptech Inc
-13c9 Eaton Corporation
-13ca Iomega Corporation
-13cb Yano Electric Co Ltd
-13cc Metheus Corporation
-13cd Compatible Systems Corporation
-13ce Cocom A/S
-13cf Studio Audio & Video Ltd
-13d0 Techsan Electronics Co Ltd
-# http://www.b2c2inc.com/products/pc-specs.html
- 2103 B2C2 Sky2PC PCI [SkyStar2]
-13d1 Abocom Systems Inc
- ab02 ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter
- ab06 RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter
-13d2 Shark Multimedia Inc
-13d3 IMC Networks
-13d4 Graphics Microsystems Inc
-13d5 Media 100 Inc
-13d6 K.I. Technology Co Ltd
-13d7 Toshiba Engineering Corporation
-13d8 Phobos corporation
-13d9 Apex PC Solutions Inc
-13da Intresource Systems pte Ltd
-13db Janich & Klass Computertechnik GmbH
-13dc Netboost Corporation
-13dd Multimedia Bundle Inc
-13de ABB Robotics Products AB
-13df E-Tech Inc
- 0001 PCI56RVP Modem
- 13df 0001 PCI56RVP Modem
-13e0 GVC Corporation
-13e1 Silicom Multimedia Systems Inc
-13e2 Dynamics Research Corporation
-13e3 Nest Inc
-13e4 Calculex Inc
-13e5 Telesoft Design Ltd
-13e6 Argosy research Inc
-13e7 NAC Incorporated
-13e8 Chip Express Corporation
-13e9 Intraserver Technology Inc
-13ea Dallas Semiconductor
-13eb Hauppauge Computer Works Inc
-13ec Zydacron Inc
-13ed Raytheion E-Systems
-13ee Hayes Microcomputer Products Inc
-13ef Coppercom Inc
-13f0 Sundance Technology Inc
- 0201 ST201 Sundance Ethernet
-13f1 Oce' - Technologies B.V.
-13f2 Ford Microelectronics Inc
-13f3 Mcdata Corporation
-13f4 Troika Networks, Inc.
- 1401 Zentai Fibre Channel Adapter
-13f5 Kansai Electric Co. Ltd
-13f6 C-Media Electronics Inc
- 0100 CM8338A
- 13f6 ffff CMI8338/C3DX PCI Audio Device
- 0101 CM8338B
- 13f6 0101 CMI8338-031 PCI Audio Device
- 0111 CM8738
- 1019 0970 P6STP-FL motherboard
- 1043 8077 CMI8738 6-channel audio controller
- 1043 80e2 CMI8738 6ch-MX
- 13f6 0111 CMI8738/C3DX PCI Audio Device
- 1681 a000 Gamesurround MUSE XL
- 0211 CM8738
-13f7 Wildfire Communications
-13f8 Ad Lib Multimedia Inc
-13f9 NTT Advanced Technology Corp.
-13fa Pentland Systems Ltd
-13fb Aydin Corp
-13fc Computer Peripherals International
-13fd Micro Science Inc
-13fe Advantech Co. Ltd
- 1756 PCI-1756
-13ff Silicon Spice Inc
-1400 Artx Inc
- 1401 9432 TX
-1401 CR-Systems A/S
-1402 Meilhaus Electronic GmbH
-1403 Ascor Inc
-1404 Fundamental Software Inc
-1405 Excalibur Systems Inc
-1406 Oce' Printing Systems GmbH
-1407 Lava Computer mfg Inc
- 0100 Lava Dual Serial
- 0101 Lava Quatro A
- 0102 Lava Quatro B
- 0200 Lava Port Plus
- 0201 Lava Quad A
- 0202 Lava Quad B
- 0500 Lava Single Serial
- 0600 Lava Port 650
- 8000 Lava Parallel
- 8001 Dual parallel port controller A
- 8002 Lava Dual Parallel port A
- 8003 Lava Dual Parallel port B
- 8800 BOCA Research IOPPAR
-1408 Aloka Co. Ltd
-1409 Timedia Technology Co Ltd
- 7168 PCI2S550 (Dual 16550 UART)
-140a DSP Research Inc
-140b Ramix Inc
-140c Elmic Systems Inc
-140d Matsushita Electric Works Ltd
-140e Goepel Electronic GmbH
-140f Salient Systems Corp
-1410 Midas lab Inc
-1411 Ikos Systems Inc
-1412 IC Ensemble Inc
- 1712 ICE1712 [Envy24]
- 1724 ICE1724 [Envy24HT]
-1413 Addonics
-1414 Microsoft Corporation
-1415 Oxford Semiconductor Ltd
- 8403 VScom 011H-EP1 1 port parallel adaptor
- 9501 OX16PCI954 (Quad 16950 UART) function 0
- 15ed 2000 MCCR Serial p0-3 of 8
- 15ed 2001 MCCR Serial p0-3 of 16
- 950a EXSYS EX-41092 Dual 16950 Serial adapter
- 950b OXCB950 Cardbus 16950 UART
- 9511 OX16PCI954 (Quad 16950 UART) function 1
- 15ed 2000 MCCR Serial p4-7 of 8
- 15ed 2001 MCCR Serial p4-15 of 16
- 9521 OX16PCI952 (Dual 16950 UART)
-1416 Multiwave Innovation pte Ltd
-1417 Convergenet Technologies Inc
-1418 Kyushu electronics systems Inc
-1419 Excel Switching Corp
-141a Apache Micro Peripherals Inc
-141b Zoom Telephonics Inc
-141d Digitan Systems Inc
-141e Fanuc Ltd
-141f Visiontech Ltd
-1420 Psion Dacom plc
-1421 Ads Technologies Inc
-1422 Ygrec Systems Co Ltd
-1423 Custom Technology Corp.
-1424 Videoserver Connections
-1425 ASIC Designers Inc
-1426 Storage Technology Corp.
-1427 Better On-Line Solutions
-1428 Edec Co Ltd
-1429 Unex Technology Corp.
-142a Kingmax Technology Inc
-142b Radiolan
-142c Minton Optic Industry Co Ltd
-142d Pix stream Inc
-142e Vitec Multimedia
-142f Radicom Research Inc
-1430 ITT Aerospace/Communications Division
-1431 Gilat Satellite Networks
-1432 Edimax Computer Co.
-1433 Eltec Elektronik GmbH
-1435 Real Time Devices US Inc.
-1436 CIS Technology Inc
-1437 Nissin Inc Co
-1438 Atmel-dream
-1439 Outsource Engineering & Mfg. Inc
-143a Stargate Solutions Inc
-143b Canon Research Center, America
-143c Amlogic Inc
-143d Tamarack Microelectronics Inc
-143e Jones Futurex Inc
-143f Lightwell Co Ltd - Zax Division
-1440 ALGOL Corp.
-1441 AGIE Ltd
-1442 Phoenix Contact GmbH & Co.
-1443 Unibrain S.A.
-1444 TRW
-1445 Logical DO Ltd
-1446 Graphin Co Ltd
-1447 AIM GmBH
-1448 Alesis Studio Electronics
-1449 TUT Systems Inc
-144a Adlink Technology
- 7296 PCI-7296
- 7432 PCI-7432
- 7433 PCI-7433
- 7434 PCI-7434
- 7841 PCI-7841
- 8133 PCI-8133
- 8554 PCI-8554
- 9111 PCI-9111
- 9113 PCI-9113
- 9114 PCI-9114
-144b Loronix Information Systems Inc
-144c Catalina Research Inc
-144d Samsung Electronics Co Ltd
-144e OLITEC
-144f Askey Computer Corp.
-1450 Octave Communications Ind.
-1451 SP3D Chip Design GmBH
-1453 MYCOM Inc
-1454 Altiga Networks
-1455 Logic Plus Plus Inc
-1456 Advanced Hardware Architectures
-1457 Nuera Communications Inc
-1458 Giga-byte Technology
-1459 DOOIN Electronics
-145a Escalate Networks Inc
-145b PRAIM SRL
-145c Cryptek
-145d Gallant Computer Inc
-145e Aashima Technology B.V.
-145f Baldor Electric Company
- 0001 NextMove PCI
-1460 DYNARC INC
-1461 Avermedia Technologies Inc
-1462 Micro-Star International Co., Ltd.
-1463 Fast Corporation
-1464 Interactive Circuits & Systems Ltd
-1465 GN NETTEST Telecom DIV.
-1466 Designpro Inc.
-1467 DIGICOM SPA
-1468 AMBIT Microsystem Corp.
-1469 Cleveland Motion Controls
-146a IFR
-146b Parascan Technologies Ltd
-146c Ruby Tech Corp.
- 1430 FE-1430TX Fast Ethernet PCI Adapter
-146d Tachyon, INC.
-146e Williams Electronics Games, Inc.
-146f Multi Dimensional Consulting Inc
-1470 Bay Networks
-1471 Integrated Telecom Express Inc
-1472 DAIKIN Industries, Ltd
-1473 ZAPEX Technologies Inc
-1474 Doug Carson & Associates
-1475 PICAZO Communications
-1476 MORTARA Instrument Inc
-1477 Net Insight
-1478 DIATREND Corporation
-1479 TORAY Industries Inc
-147a FORMOSA Industrial Computing
-147b ABIT Computer Corp.
-147c AWARE, Inc.
-147d Interworks Computer Products
-147e Matsushita Graphic Communication Systems, Inc.
-147f NIHON UNISYS, Ltd.
-1480 SCII Telecom
-1481 BIOPAC Systems Inc
-1482 ISYTEC - Integrierte Systemtechnik GmBH
-1483 LABWAY Corporation
-1484 Logic Corporation
-1485 ERMA - Electronic GmBH
-1486 L3 Communications Telemetry & Instrumentation
-1487 MARQUETTE Medical Systems
-1488 KONTRON Electronik GmBH
-1489 KYE Systems Corporation
-148a OPTO
-148b INNOMEDIALOGIC Inc.
-148c C.P. Technology Co. Ltd
-148d DIGICOM Systems, Inc.
- 1003 HCF 56k Data/Fax Modem
-148e OSI Plus Corporation
-148f Plant Equipment, Inc.
-1490 Stone Microsystems PTY Ltd.
-1491 ZEAL Corporation
-1492 Time Logic Corporation
-1493 MAKER Communications
-1494 WINTOP Technology, Inc.
-1495 TOKAI Communications Industry Co. Ltd
-1496 JOYTECH Computer Co., Ltd.
-1497 SMA Regelsysteme GmBH
-1498 TEWS Datentechnik GmBH
-1499 EMTEC CO., Ltd
-149a ANDOR Technology Ltd
-149b SEIKO Instruments Inc
-149c OVISLINK Corp.
-149d NEWTEK Inc
- 0001 Video Toaster for PC
-149e Mapletree Networks Inc.
-149f LECTRON Co Ltd
-14a0 SOFTING GmBH
-14a1 Systembase Co Ltd
-14a2 Millennium Engineering Inc
-14a3 Maverick Networks
-14a4 GVC/BCM Advanced Research
-14a5 XIONICS Document Technologies Inc
-14a6 INOVA Computers GmBH & Co KG
-14a7 MYTHOS Systems Inc
-14a8 FEATRON Technologies Corporation
-14a9 HIVERTEC Inc
-14aa Advanced MOS Technology Inc
-14ab Mentor Graphics Corp.
-14ac Novaweb Technologies Inc
-14ad Time Space Radio AB
-14ae CTI, Inc
-14af Guillemot Corporation
- 7102 3D Prophet II MX
-14b0 BST Communication Technology Ltd
-14b1 Nextcom K.K.
-14b2 ENNOVATE Networks Inc
-14b3 XPEED Inc
- 0000 DSL NIC
-14b4 PHILIPS Business Electronics B.V.
-14b5 Creamware GmBH
- 0200 Scope
- 0300 Pulsar
- 0400 Pulsar2
- 0600 Pulsar2
- 0800 DSP-Board
- 0900 DSP-Board
- 0a00 DSP-Board
- 0b00 DSP-Board
-14b6 Quantum Data Corp.
-14b7 PROXIM Inc
- 0001 Symphony 4110
-14b8 Techsoft Technology Co Ltd
-14b9 AIRONET Wireless Communications
- 0001 PC4800
- 0340 PC4800
- 0350 PC4800
- 4500 PC4500
- 4800 PC4800
- a504 Cisco Aironet Wireless 802.11b
-14ba INTERNIX Inc.
-14bb SEMTECH Corporation
-14bc Globespan Semiconductor Inc.
-14bd CARDIO Control N.V.
-14be L3 Communications
-14bf SPIDER Communications Inc.
-14c0 COMPAL Electronics Inc
-14c1 MYRICOM Inc.
-14c2 DTK Computer
-14c3 MEDIATEK Corp.
-14c4 IWASAKI Information Systems Co Ltd
-14c5 Automation Products AB
-14c6 Data Race Inc
-14c7 Modular Technology Holdings Ltd
-14c8 Turbocomm Tech. Inc.
-14c9 ODIN Telesystems Inc
-14ca PE Logic Corp.
-14cb Billionton Systems Inc
-14cc NAKAYO Telecommunications Inc
-14cd Universal Scientific Ind.
-14ce Whistle Communications
-14cf TEK Microsystems Inc.
-14d0 Ericsson Axe R & D
-14d1 Computer Hi-Tech Co Ltd
-14d2 Titan Electronics Inc
- 8001 VScom 010L 1 port parallel adaptor
- 8002 VScom 020L 2 port parallel adaptor
- 8010 VScom 100L 1 port serial adaptor
- 8011 VScom 110L 1 port serial and 1 port parallel adaptor
- 8020 VScom 200L 1 port serial adaptor
- 8021 VScom 210L 2 port serial and 1 port parallel adaptor
- 8040 VScom 400L 4 port serial adaptor
- 8080 VScom 800L 8 port serial adaptor
- a000 VScom 010H 1 port parallel adaptor
- a001 VScom 100H 1 port serial adaptor
- a003 VScom 400H 4 port serial adaptor
- a004 VScom 400HF1 4 port serial adaptor
- a005 VScom 200H 2 port serial adaptor
- e001 VScom 010HV2 1 port parallel adaptor
- e010 VScom 100HV2 1 port serial adaptor
- e020 VScom 200HV2 2 port serial adaptor
-14d3 CIRTECH (UK) Ltd
-14d4 Panacom Technology Corp
-14d5 Nitsuko Corporation
-14d6 Accusys Inc
-14d7 Hirakawa Hewtech Corp
-14d8 HOPF Elektronik GmBH
-14d9 Alpha Processor Inc
-14da National Aerospace Laboratories
-14db AFAVLAB Technology Inc
- 2120 TK9902
-14dc Amplicon Liveline Ltd
- 0000 PCI230
- 0001 PCI242
- 0002 PCI244
- 0003 PCI247
- 0004 PCI248
- 0005 PCI249
- 0006 PCI260
- 0007 PCI224
- 0008 PCI234
- 0009 PCI236
- 000a PCI272
- 000b PCI215
-14dd Boulder Design Labs Inc
-14de Applied Integration Corporation
-14df ASIC Communications Corp
-14e1 INVERTEX
-14e2 INFOLIBRIA
-14e3 AMTELCO
-14e4 Broadcom Corporation
- 1644 NetXtreme BCM5700 Gigabit Ethernet
- 1014 0277 Broadcom Vigil B5700 1000Base-T
- 1028 00d1 Broadcom BCM5700
- 1028 0106 Broadcom BCM5700
- 1028 0109 Broadcom BCM5700 1000Base-T
- 1028 010a Broadcom BCM5700 1000BaseTX
- 10b7 1000 3C996-T 1000Base-T
- 10b7 1001 3C996B-T 1000Base-T
- 10b7 1002 3C996C-T 1000Base-T
- 10b7 1003 3C997-T 1000Base-T Dual Port
- 10b7 1004 3C996-SX 1000Base-SX
- 10b7 1005 3C997-SX 1000Base-SX Dual Port
- 10b7 1008 3C942 Gigabit LOM (31X31)
- 14e4 0002 NetXtreme 1000Base-SX
- 14e4 0003 NetXtreme 1000Base-SX
- 14e4 0004 NetXtreme 1000Base-T
- 14e4 1028 NetXtreme 1000BaseTX
- 14e4 1644 BCM5700 1000Base-T
- 1645 NetXtreme BCM5701 Gigabit Ethernet
- 0e11 007c NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
- 0e11 007d NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
- 0e11 0085 NC7780 Gigabit Server Adapter (embedded, WOL)
- 0e11 0099 NC7780 Gigabit Server Adapter (embedded, WOL)
- 0e11 009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
- 0e11 00c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
- 1028 0121 Broadcom BCM5701 1000Base-T
- 10a9 8010 SGI IO9 Gigabit Ethernet (Copper)
- 10a9 8011 SGI Gigabit Ethernet (Copper)
- 10a9 8012 SGI Gigabit Ethernet (Fiber)
- 10b7 1004 3C996-SX 1000Base-SX
- 10b7 1006 3C996B-T 1000Base-T
- 10b7 1007 3C1000-T 1000Base-T
- 10b7 1008 3C940-BR01 1000Base-T
- 14e4 0001 BCM5701 1000Base-T
- 14e4 0005 BCM5701 1000Base-T
- 14e4 0006 BCM5701 1000Base-T
- 14e4 0007 BCM5701 1000Base-SX
- 14e4 0008 BCM5701 1000Base-T
- 14e4 8008 BCM5701 1000Base-T
- 1646 NetXtreme BCM5702 Gigabit Ethernet
- 0e11 00bb NC7760 1000BaseTX
- 1028 0126 Broadcom BCM5702 1000BaseTX
- 14e4 8009 BCM5702 1000BaseTX
- 1647 NetXtreme BCM5703 Gigabit Ethernet
- 0e11 0099 NC7780 1000BaseTX
- 0e11 009a NC7770 1000BaseTX
- 10a9 8010 SGI IO9 Gigabit Ethernet (Copper)
- 14e4 0009 BCM5703 1000BaseTX
- 14e4 000a BCM5703 1000BaseSX
- 14e4 000b BCM5703 1000BaseTX
- 14e4 8009 BCM5703 1000BaseTX
- 14e4 800a BCM5703 1000BaseTX
- 1648 NetXtreme BCM5704 Gigabit Ethernet
- 0e11 00cf NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
- 0e11 00d0 NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
- 0e11 00d1 NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
- 10b7 2000 3C998-T Dual Port 10/100/1000 PCI-X
- 10b7 3000 3C999-T Quad Port 10/100/1000 PCI-X
- 1166 1648 NetXtreme CIOB-E 1000Base-T
- 164d NetXtreme BCM5702FE Gigabit Ethernet
- 1653 NetXtreme BCM5705 Gigabit Ethernet
- 165d NetXtreme BCM5705M Gigabit Ethernet
- 1696 NetXtreme BCM5782 Gigabit Ethernet
- 14e4 000d NetXtreme BCM5782 1000Base-T
- 169c NetXtreme BCM5788 Gigabit Ethernet
- 16a6 NetXtreme BCM5702 Gigabit Ethernet
- 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
- 1028 0126 BCM5702 1000Base-T
- 14e4 000c BCM5702 1000Base-T
- 14e4 8009 BCM5702 1000Base-T
- 16a7 NetXtreme BCM5703 Gigabit Ethernet
- 0e11 00ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
- 0e11 00cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
- 14e4 0009 NetXtreme BCM5703 1000Base-T
- 14e4 000a NetXtreme BCM5703 1000Base-SX
- 14e4 000b NetXtreme BCM5703 1000Base-T
- 14e4 800a NetXtreme BCM5703 1000Base-T
- 16a8 NetXtreme BCM5704S Gigabit Ethernet
- 10b7 2001 3C998-SX Dual Port 1000-SX PCI-X
- 16c6 NetXtreme BCM5702 Gigabit Ethernet
- 10b7 1100 3C1000B-T 10/100/1000 PCI
- 14e4 000c BCM5702 1000Base-T
- 14e4 8009 BCM5702 1000Base-T
- 16c7 NetXtreme BCM5703 Gigabit Ethernet
- 14e4 0009 NetXtreme BCM5703 1000Base-T
- 14e4 000a NetXtreme BCM5703 1000Base-SX
- 4210 BCM4210 iLine10 HomePNA 2.0
- 4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem
- 4212 BCM4212 v.90 56k modem
- 4301 BCM4301 802.11b
- 4320 BCM94306 802.11g
- 4401 BCM4401 100Base-T
- 1043 80a8 A7V8X motherboard
- 4402 BCM4402 Integrated 10/100BaseT
- 4410 BCM4413 iLine32 HomePNA 2.0
- 4411 BCM4413 V.90 56k modem
- 4412 BCM4413 10/100BaseT
- 5820 BCM5820 Crypto Accelerator
- 5821 BCM5821 Crypto Accelerator
-14e5 Pixelfusion Ltd
-14e6 SHINING Technology Inc
-14e7 3CX
-14e8 RAYCER Inc
-14e9 GARNETS System CO Ltd
-14ea Planex Communications, Inc
- ab06 FNW-3603-TX CardBus Fast Ethernet
-14eb SEIKO EPSON Corp
-14ec ACQIRIS
-14ed DATAKINETICS Ltd
-14ee MASPRO KENKOH Corp
-14ef CARRY Computer ENG. CO Ltd
-14f0 CANON RESEACH CENTRE FRANCE
-14f1 Conexant
- 1002 HCF 56k Modem
- 1003 HCF 56k Modem
- 1004 HCF 56k Modem
- 1005 HCF 56k Modem
- 1006 HCF 56k Modem
- 1022 HCF 56k Modem
- 1023 HCF 56k Modem
- 1024 HCF 56k Modem
- 1025 HCF 56k Modem
- 1026 HCF 56k Modem
- 1032 HCF 56k Modem
- 1033 HCF 56k Data/Fax Modem
- 1033 8077 NEC
- 122d 4027 Dell Zeus - MDP3880-W(B) Data Fax Modem
- 122d 4030 Dell Mercury - MDP3880-U(B) Data Fax Modem
- 122d 4034 Dell Thor - MDP3880-W(U) Data Fax Modem
- 13e0 020d Dell Copper
- 13e0 020e Dell Silver
- 13e0 0261 IBM
- 13e0 0290 Compaq Goldwing
- 13e0 02a0 IBM
- 13e0 02b0 IBM
- 13e0 02c0 Compaq Scooter
- 13e0 02d0 IBM
- 144f 1500 IBM P85-DF (1)
- 144f 1501 IBM P85-DF (2)
- 144f 150a IBM P85-DF (3)
- 144f 150b IBM P85-DF Low Profile (1)
- 144f 1510 IBM P85-DF Low Profile (2)
- 1034 HCF 56k Data/Fax/Voice Modem
- 1035 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 10cf 1098 Fujitsu P85-DFSV
- 1036 HCF 56k Data/Fax/Voice/Spkp Modem
- 104d 8067 HCF 56k Modem
- 122d 4029 MDP3880SP-W
- 122d 4031 MDP3880SP-U
- 13e0 0209 Dell Titanium
- 13e0 020a Dell Graphite
- 13e0 0260 Gateway Red Owl
- 13e0 0270 Gateway White Horse
- 1052 HCF 56k Data/Fax Modem (Worldwide)
- 1053 HCF 56k Data/Fax Modem (Worldwide)
- 1054 HCF 56k Data/Fax/Voice Modem (Worldwide)
- 1055 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide)
- 1056 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)
- 1057 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)
- 1059 HCF 56k Data/Fax/Voice Modem (Worldwide)
- 1063 HCF 56k Data/Fax Modem
- 1064 HCF 56k Data/Fax/Voice Modem
- 1065 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 1066 HCF 56k Data/Fax/Voice/Spkp Modem
- 122d 4033 Dell Athena - MDP3900V-U
- 1433 HCF 56k Data/Fax Modem
- 1434 HCF 56k Data/Fax/Voice Modem
- 1435 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 1436 HCF 56k Data/Fax Modem
- 1453 HCF 56k Data/Fax Modem
- 13e0 0240 IBM
- 13e0 0250 IBM
- 144f 1502 IBM P95-DF (1)
- 144f 1503 IBM P95-DF (2)
- 1454 HCF 56k Data/Fax/Voice Modem
- 1455 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 1456 HCF 56k Data/Fax/Voice/Spkp Modem
- 122d 4035 Dell Europa - MDP3900V-W
- 122d 4302 Dell MP3930V-W(C) MiniPCI
- 1610 ADSL AccessRunner PCI Arbitration Device
- 1611 AccessRunner PCI ADSL Interface Device
- 1620 ADSL AccessRunner V2 PCI Arbitration Device
- 1621 AccessRunner V2 PCI ADSL Interface Device
- 1622 AccessRunner V2 PCI ADSL Yukon WAN Adapter
- 1803 HCF 56k Modem
- 0e11 0023 623-LAN Grizzly
- 0e11 0043 623-LAN Yogi
- 1815 HCF 56k Modem
- 0e11 0022 Grizzly
- 0e11 0042 Yogi
- 2003 HSF 56k Data/Fax Modem
- 2004 HSF 56k Data/Fax/Voice Modem
- 2005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 2006 HSF 56k Data/Fax/Voice/Spkp Modem
- 2013 HSF 56k Data/Fax Modem
- 0e11 b195 Bear
- 0e11 b196 Seminole 1
- 0e11 b1be Seminole 2
- 1025 8013 Acer
- 1033 809d NEC
- 1033 80bc NEC
- 155d 6793 HP
- 155d 8850 E Machines
- 2014 HSF 56k Data/Fax/Voice Modem
- 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
- 2016 HSF 56k Data/Fax/Voice/Spkp Modem
- 2043 HSF 56k Data/Fax Modem (WorldW SmartDAA)
- 2044 HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)
- 2045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)
- 2046 HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)
- 2063 HSF 56k Data/Fax Modem (SmartDAA)
- 2064 HSF 56k Data/Fax/Voice Modem (SmartDAA)
- 2065 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)
- 2066 HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)
- 2093 HSF 56k Modem
- 155d 2f07 Legend
- 2143 HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)
- 2144 HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)
- 2145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)
- 2146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)
- 2163 HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)
- 2164 HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)
- 2165 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)
- 2166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)
- 2343 HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)
- 2344 HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)
- 2345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)
- 2346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)
- 2363 HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)
- 2364 HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)
- 2365 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)
- 2366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)
- 2443 HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)
- 104d 8075 Modem
- 104d 8083 Modem
- 104d 8097 Modem
- 2444 HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)
- 2445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)
- 2446 HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)
- 2463 HSF 56k Data/Fax Modem (Mob SmartDAA)
- 2464 HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)
- 2465 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)
- 2466 HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)
- 2f00 HSF 56k HSFi Modem
- 13e0 8d84 IBM HSFi V.90
- 13e0 8d85 Compaq Stinger
- 14f1 2004 Dynalink 56PMi
- 8234 RS8234 ATM SAR Controller [ServiceSAR Plus]
-14f2 MOBILITY Electronics
-14f3 BROADLOGIC
-14f4 TOKYO Electronic Industry CO Ltd
-14f5 SOPAC Ltd
-14f6 COYOTE Technologies LLC
-14f7 WOLF Technology Inc
-14f8 AUDIOCODES Inc
-14f9 AG COMMUNICATIONS
-14fa WANDEL & GOCHERMANN
-14fb TRANSAS MARINE (UK) Ltd
-14fc QUADRICS Supercomputers World
-14fd JAPAN Computer Industry Inc
-14fe ARCHTEK TELECOM Corp
-14ff TWINHEAD INTERNATIONAL Corp
-1500 DELTA Electronics, Inc
-1501 BANKSOFT CANADA Ltd
-1502 MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd
-1503 KAWASAKI LSI USA Inc
-1504 KAISER Electronics
-1505 ITA INGENIEURBURO FUR TESTAUFGABEN GmbH
-1506 CHAMELEON Systems Inc
-# Should be HTEC Ltd, but there are no known HTEC chips and 1507 is already used by mistake by Motorola (see vendor ID 1057).
-1507 Motorola ?? / HTEC
- 0001 MPC105 [Eagle]
- 0002 MPC106 [Grackle]
- 0003 MPC8240 [Kahlua]
- 0100 MC145575 [HFC-PCI]
- 0431 KTI829c 100VG
- 4801 Raven
- 4802 Falcon
- 4803 Hawk
- 4806 CPX8216
-1508 HONDA CONNECTORS/MHOTRONICS Inc
-1509 FIRST INTERNATIONAL Computer Inc
-150a FORVUS RESEARCH Inc
-150b YAMASHITA Systems Corp
-150c KYOPAL CO Ltd
-150d WARPSPPED Inc
-150e C-PORT Corp
-150f INTEC GmbH
-1510 BEHAVIOR TECH Computer Corp
-1511 CENTILLIUM Technology Corp
-1512 ROSUN Technologies Inc
-1513 Raychem
-1514 TFL LAN Inc
-1515 Advent design
-1516 MYSON Technology Inc
- 0803 SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
- 1320 10bd SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
-1517 ECHOTEK Corp
-1518 PEP MODULAR Computers GmbH
-1519 TELEFON AKTIEBOLAGET LM Ericsson
-151a Globetek
- 1002 PCI-1002
- 1004 PCI-1004
- 1008 PCI-1008
-151b COMBOX Ltd
-151c DIGITAL AUDIO LABS Inc
-151d Fujitsu Computer Products Of America
-151e MATRIX Corp
-151f TOPIC SEMICONDUCTOR Corp
- 0000 TP560 Data/Fax/Voice 56k modem
-1520 CHAPLET System Inc
-1521 BELL Corp
-1522 MainPine Ltd
- 0100 PCI <-> IOBus Bridge
- 1522 0200 RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem
- 1522 0300 RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem
- 1522 0400 RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem
- 1522 0500 RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem
- 1522 0600 RockForce+ 2 Port V.90 Data/Fax/Voice Modem
- 1522 0700 RockForce+ 4 Port V.90 Data/Fax/Voice Modem
- 1522 0800 RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem
-1523 MUSIC Semiconductors
-1524 ENE Technology Inc
- 1211 CB1211 Cardbus Controller
- 1225 CB1225 Cardbus Controller
- 1410 CB1410 Cardbus Controller
- 1420 CB1420 Cardbus Controller
-1525 IMPACT Technologies
-1526 ISS, Inc
-1527 SOLECTRON
-1528 ACKSYS
-1529 AMERICAN MICROSystems Inc
-152a QUICKTURN DESIGN Systems
-152b FLYTECH Technology CO Ltd
-152c MACRAIGOR Systems LLC
-152d QUANTA Computer Inc
-152e MELEC Inc
-152f PHILIPS - CRYPTO
-1530 ACQIS Technology Inc
-1531 CHRYON Corp
-1532 ECHELON Corp
-1533 BALTIMORE
-1534 ROAD Corp
-1535 EVERGREEN Technologies Inc
-1537 DATALEX COMMUNCATIONS
-1538 ARALION Inc
-1539 ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.
-153a ONO SOKKI
-153b TERRATEC Electronic GmbH
-153c ANTAL Electronic
-153d FILANET Corp
-153e TECHWELL Inc
-153f MIPS DENMARK
-1540 PROVIDEO MULTIMEDIA Co Ltd
-1541 MACHONE Communications
-1542 VIVID Technology Inc
-1543 SILICON Laboratories
- 3052 Intel 537 [Winmodem]
- 4c22 Si3036 MC'97 DAA
-1544 DCM DATA Systems
-1545 VISIONTEK
-1546 IOI Technology Corp
-1547 MITUTOYO Corp
-1548 JET PROPULSION Laboratory
-1549 INTERCONNECT Systems Solutions
-154a MAX Technologies Inc
-154b COMPUTEX Co Ltd
-154c VISUAL Technology Inc
-154d PAN INTERNATIONAL Industrial Corp
-154e SERVOTEST Ltd
-154f STRATABEAM Technology
-1550 OPEN NETWORK Co Ltd
-1551 SMART Electronic DEVELOPMENT GmBH
-1552 RACAL AIRTECH Ltd
-1553 CHICONY Electronics Co Ltd
-1554 PROLINK Microsystems Corp
-1555 GESYTEC GmBH
-1556 PLD APPLICATIONS
-1557 MEDIASTAR Co Ltd
-1558 CLEVO/KAPOK Computer
-1559 SI LOGIC Ltd
-155a INNOMEDIA Inc
-155b PROTAC INTERNATIONAL Corp
-155c Cemax-Icon Inc
-155d Mac System Co Ltd
-155e LP Elektronik GmbH
-155f Perle Systems Ltd
-1560 Terayon Communications Systems
-1561 Viewgraphics Inc
-1562 Symbol Technologies
-1563 A-Trend Technology Co Ltd
-1564 Yamakatsu Electronics Industry Co Ltd
-1565 Biostar Microtech Int'l Corp
-1566 Ardent Technologies Inc
-1567 Jungsoft
-1568 DDK Electronics Inc
-1569 Palit Microsystems Inc.
-156a Avtec Systems
-156b 2wire Inc
-156c Vidac Electronics GmbH
-156d Alpha-Top Corp
-156e Alfa Inc
-156f M-Systems Flash Disk Pioneers Ltd
-1570 Lecroy Corp
-1571 Contemporary Controls
- a001 CCSI PCI20-485 ARCnet
- a002 CCSI PCI20-485D ARCnet
- a003 CCSI PCI20-485X ARCnet
- a004 CCSI PCI20-CXB ARCnet
- a005 CCSI PCI20-CXS ARCnet
- a006 CCSI PCI20-FOG-SMA ARCnet
- a007 CCSI PCI20-FOG-ST ARCnet
- a008 CCSI PCI20-TB5 ARCnet
- a009 CCSI PCI20-5-485 5Mbit ARCnet
- a00a CCSI PCI20-5-485D 5Mbit ARCnet
- a00b CCSI PCI20-5-485X 5Mbit ARCnet
- a00c CCSI PCI20-5-FOG-ST 5Mbit ARCnet
- a00d CCSI PCI20-5-FOG-SMA 5Mbit ARCnet
- a201 CCSI PCI22-485 10Mbit ARCnet
- a202 CCSI PCI22-485D 10Mbit ARCnet
- a203 CCSI PCI22-485X 10Mbit ARCnet
- a204 CCSI PCI22-CHB 10Mbit ARCnet
- a205 CCSI PCI22-FOG_ST 10Mbit ARCnet
- a206 CCSI PCI22-THB 10Mbit ARCnet
-1572 Otis Elevator Company
-1573 Lattice - Vantis
-1574 Fairchild Semiconductor
-1575 Voltaire Advanced Data Security Ltd
-1576 Viewcast COM
-1578 HITT
-1579 Dual Technology Corp
-157a Japan Elecronics Ind Inc
-157b Star Multimedia Corp
-157c Eurosoft (UK)
- 8001 Fix2000 PCI Y2K Compliance Card
-157d Gemflex Networks
-157e Transition Networks
-157f PX Instruments Technology Ltd
-1580 Primex Aerospace Co
-1581 SEH Computertechnik GmbH
-1582 Cytec Corp
-1583 Inet Technologies Inc
-1584 Uniwill Computer Corp
-1585 Logitron
-1586 Lancast Inc
-1587 Konica Corp
-1588 Solidum Systems Corp
-1589 Atlantek Microsystems Pty Ltd
-158a Digalog Systems Inc
-158b Allied Data Technologies
-158c Hitachi Semiconductor & Devices Sales Co Ltd
-158d Point Multimedia Systems
-158e Lara Technology Inc
-158f Ditect Coop
-1590 3pardata Inc
-1591 ARN
-1592 Syba Tech Ltd
- 0781 Multi-IO Card
- 0782 Parallel Port Card 2xEPP
- 0783 Multi-IO Card
- 0785 Multi-IO Card
- 0786 Multi-IO Card
- 0787 Multi-IO Card
- 0788 Multi-IO Card
- 078a Multi-IO Card
-1593 Bops Inc
-1594 Netgame Ltd
-1595 Diva Systems Corp
-1596 Folsom Research Inc
-1597 Memec Design Services
-1598 Granite Microsystems
-1599 Delta Electronics Inc
-159a General Instrument
-159b Faraday Technology Corp
-159c Stratus Computer Systems
-159d Ningbo Harrison Electronics Co Ltd
-159e A-Max Technology Co Ltd
-159f Galea Network Security
-15a0 Compumaster SRL
-15a1 Geocast Network Systems
-15a2 Catalyst Enterprises Inc
- 0001 TA700 PCI Bus Analyzer/Exerciser
-15a3 Italtel
-15a4 X-Net OY
-15a5 Toyota Macs Inc
-15a6 Sunlight Ultrasound Technologies Ltd
-15a7 SSE Telecom Inc
-15a8 Shanghai Communications Technologies Center
-15aa Moreton Bay
-15ab Bluesteel Networks Inc
-15ac North Atlantic Instruments
-15ad VMWare Inc
- 0710 Virtual SVGA
-15ae Amersham Pharmacia Biotech
-15b0 Zoltrix International Ltd
-15b1 Source Technology Inc
-15b2 Mosaid Technologies Inc
-15b3 Mellanox Technology
- 5274 MT21108 InfiniBridge
-15b4 CCI/TRIAD
-15b5 Cimetrics Inc
-15b6 Texas Memory Systems Inc
-15b7 Sandisk Corp
-15b8 ADDI-DATA GmbH
-15b9 Maestro Digital Communications
-15ba Impacct Technology Corp
-15bb Portwell Inc
-15bc Agilent Technologies
- 2929 E2929A PCI/PCI-X Bus Analyzer
-15bd DFI Inc
-15be Sola Electronics
-15bf High Tech Computer Corp (HTC)
-15c0 BVM Ltd
-15c1 Quantel
-15c2 Newer Technology Inc
-15c3 Taiwan Mycomp Co Ltd
-15c4 EVSX Inc
-15c5 Procomp Informatics Ltd
-15c6 Technical University of Budapest
-15c7 Tateyama System Laboratory Co Ltd
- 0349 Tateyama C-PCI PLC/NC card Rev.01A
-15c8 Penta Media Co Ltd
-15c9 Serome Technology Inc
-15ca Bitboys OY
-15cb AG Electronics Ltd
-15cc Hotrail Inc
-15cd Dreamtech Co Ltd
-15ce Genrad Inc
-15cf Hilscher GmbH
-15d1 Infineon Technologies AG
-15d2 FIC (First International Computer Inc)
-15d3 NDS Technologies Israel Ltd
-15d4 Iwill Corp
-15d5 Tatung Co
-15d6 Entridia Corp
-15d7 Rockwell-Collins Inc
-15d8 Cybernetics Technology Co Ltd
-15d9 Super Micro Computer Inc
-15da Cyberfirm Inc
-15db Applied Computing Systems Inc
-15dc Litronic Inc
- 0001 Argus 300 PCI Cryptography Module
-15dd Sigmatel Inc
-15de Malleable Technologies Inc
-15df Infinilink Corp
-15e0 Cacheflow Inc
-15e1 Voice Technologies Group Inc
-15e2 Quicknet Technologies Inc
-15e3 Networth Technologies Inc
-15e4 VSN Systemen BV
-15e5 Valley technologies Inc
-15e6 Agere Inc
-15e7 Get Engineering Corp
-15e8 National Datacomm Corp
- 0130 Wireless PCI Card
-15e9 Pacific Digital Corp
-15ea Tokyo Denshi Sekei K.K.
-15eb Drsearch GmbH
-15ec Beckhoff GmbH
-15ed Macrolink Inc
-15ee In Win Development Inc
-15ef Intelligent Paradigm Inc
-15f0 B-Tree Systems Inc
-15f1 Times N Systems Inc
-15f2 Diagnostic Instruments Inc
-15f3 Digitmedia Corp
-15f4 Valuesoft
-15f5 Power Micro Research
-15f6 Extreme Packet Device Inc
-15f7 Banctec
-15f8 Koga Electronics Co
-15f9 Zenith Electronics Corp
-15fa J.P. Axzam Corp
-15fb Zilog Inc
-15fc Techsan Electronics Co Ltd
-15fd N-CUBED.NET
-15fe Kinpo Electronics Inc
-15ff Fastpoint Technologies Inc
-1600 Northrop Grumman - Canada Ltd
-1601 Tenta Technology
-1602 Prosys-tec Inc
-1603 Nokia Wireless Communications
-1604 Central System Research Co Ltd
-1605 Pairgain Technologies
-1606 Europop AG
-1607 Lava Semiconductor Manufacturing Inc
-1608 Automated Wagering International
-1609 Scimetric Instruments Inc
-1612 Telesynergy Research Inc.
-1619 FarSite Communications Ltd
- 0400 FarSync T2P (2 port X.21/V.35/V.24)
- 0440 FarSync T4P (4 port X.21/V.35/V.24)
-1629 Kongsberg Spacetec AS
- 1003 Format synchronizer v3.0
- 2002 Fast Universal Data Output
-1638 Standard Microsystems Corp [SMC]
- 1100 SMC2602W EZConnect / Addtron AWA-100
-163c Smart Link Ltd.
- 3052 SmartLink SmartPCI562 56K Modem
- 5449 SmartPCI561 Modem
-1657 Brocade Communications Systems, Inc.
-165a Epix Inc
- c100 PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232]
- d200 PIXCI(R) D2X Digital Video Capture Board [custom QL5232]
- d300 PIXCI(R) D3X Digital Video Capture Board [custom QL5232]
-165d Hsing Tech. Enterprise Co., Ltd.
-1661 Worldspace Corp.
-1668 Actiontec Electronics Inc
-1681 Hercules
-16ab Global Sun Technology Inc
- 1102 PCMCIA-to-PCI Wireless Network Bridge
-16be Creatix Polymedia GmbH
-16ca CENATEK Inc
- 0001 Rocket Drive DL
-16ec U.S. Robotics
- 3685 Wireless Access PCI Adapter Model 022415
-16f6 VideoTele.com, Inc.
-1705 Digital First, Inc.
-170b NetOctave Inc
-170c YottaYotta Inc.
-172a Accelerated Encryption
-1737 Linksys
-173b Altima (nee Broadcom)
- 03e8 AC1000 Gigabit Ethernet
- 03ea AC9100 Gigabit Ethernet
- 173b 0001 AC1002
-1743 Peppercon AG
- 8139 ROL/F-100 Fast Ethernet Adapter with ROL
-174b PC Partner Limited
-175e Sanera Systems, Inc.
-1787 Hightech Information System Ltd.
-# also used by Struck Innovative Systeme for joint developments
-1796 Research Centre Juelich
- 0001 SIS1100 [Gigabit link]
- 0002 HOTlink
- 0003 Counter Timer
- 0004 CAMAC Controller
- 0005 PROFIBUS
- 0006 AMCC HOTlink
-1799 Belkin
-17af Hightech Information System Ltd.
-17cc NetChip Technology, Inc
- 2280 USB 2.0
-1813 Ambient Technologies Inc
- 4000 HaM controllerless modem
- 16be 0001 V9x HAM Data Fax Modem
- 4100 HaM plus Data Fax Modem
- 16be 0002 V9x HAM 1394
-1851 Microtune, Inc.
-1852 Anritsu Corp.
-1888 Varisys Ltd
- 0301 VMFX1 FPGA PMC module
- 0601 VSM2 dual PMC carrier
- 0710 VS14x series PowerPC PCI board
- 0720 VS24x series PowerPC PCI board
-1a08 Sierra semiconductor
- 0000 SC15064
-1b13 Jaton Corp
-1c1c Symphony
- 0001 82C101
-1d44 DPT
- a400 PM2x24/PM3224
-1de1 Tekram Technology Co.,Ltd.
- 0391 TRM-S1040
- 2020 DC-390
- 690c 690c
- dc29 DC290
-1fc0 Tumsan Oy
- 0300 E2200 Dual E1/Rawpipe Card
-2000 Smart Link Ltd.
-2001 Temporal Research Ltd
-2003 Smart Link Ltd.
-2004 Smart Link Ltd.
-21c3 21st Century Computer Corp.
-2348 Racore
- 2010 8142 100VG/AnyLAN
-2646 Kingston Technologies
-270b Xantel Corporation
-270f Chaintech Computer Co. Ltd
-2711 AVID Technology Inc.
-2a15 3D Vision(???)
-3000 Hansol Electronics Inc.
-3142 Post Impression Systems.
-3388 Hint Corp
- 0013 HiNT HC4 PCI to ISDN bridge, Multimedia audio controller
- 0014 HiNT HC4 PCI to ISDN bridge, Network controller
- 0021 HB1-SE33 PCI-PCI Bridge
- 101a E.Band [AudioTrak Inca88]
- 101b E.Band [AudioTrak Inca88]
- 8011 VXPro II Chipset
- 3388 8011 VXPro II Chipset CPU to PCI Bridge
- 8012 VXPro II Chipset
- 3388 8012 VXPro II Chipset PCI to ISA Bridge
- 8013 VXPro II IDE
- 3388 8013 VXPro II Chipset EIDE Controller
-3411 Quantum Designs (H.K.) Inc
-3513 ARCOM Control Systems Ltd
-38ef 4Links
-3d3d 3DLabs
- 0001 GLINT 300SX
- 0002 GLINT 500TX
- 0003 GLINT Delta
- 0004 Permedia
- 0005 Permedia
- 0006 GLINT MX
- 0007 3D Extreme
- 0008 GLINT Gamma G1
- 0009 Permedia II 2D+3D
- 1040 0011 AccelStar II
- 3d3d 0100 AccelStar II 3D Accelerator
- 3d3d 0111 Permedia 3:16
- 3d3d 0114 Santa Ana
- 3d3d 0116 Oxygen GVX1
- 3d3d 0119 Scirocco
- 3d3d 0120 Santa Ana PCL
- 3d3d 0125 Oxygen VX1
- 3d3d 0127 Permedia3 Create!
- 000a GLINT R3
- 3d3d 0121 Oxygen VX1
- 000c GLINT R3 [Oxygen VX1]
- 3d3d 0144 Oxygen VX1-4X AGP [Permedia 4]
- 0100 Permedia II 2D+3D
- 1004 Permedia
- 3d04 Permedia
- ffff Glint VGA
-4005 Avance Logic Inc.
- 0300 ALS300 PCI Audio Device
- 0308 ALS300+ PCI Audio Device
- 0309 PCI Input Controller
- 1064 ALG-2064
- 2064 ALG-2064i
- 2128 ALG-2364A GUI Accelerator
- 2301 ALG-2301
- 2302 ALG-2302
- 2303 AVG-2302 GUI Accelerator
- 2364 ALG-2364A
- 2464 ALG-2464
- 2501 ALG-2564A/25128A
- 4000 ALS4000 Audio Chipset
- 4005 4000 ALS4000 Audio Chipset
- 4710 ALC200/200P
-4033 Addtron Technology Co, Inc.
- 1360 RTL8139 Ethernet
-4143 Digital Equipment Corp
-416c Aladdin Knowledge Systems
- 0100 AladdinCARD
- 0200 CPC
-4444 Internext Compression Inc
- 0803 iTVC15 MPEG-2 Encoder
-4468 Bridgeport machines
-4594 Cogetec Informatique Inc
-45fb Baldor Electric Company
-4680 Umax Computer Corp
-4843 Hercules Computer Technology Inc
-4916 RedCreek Communications Inc
- 1960 RedCreek PCI adapter
-4943 Growth Networks
-4978 Axil Computer Inc
-4a14 NetVin
- 5000 NV5000SC
- 4a14 5000 RT8029-Based Ethernet Adapter
-4b10 Buslogic Inc.
-4c48 LUNG HWA Electronics
-4c53 SBS Technologies
-4ca1 Seanix Technology Inc
-4d51 MediaQ Inc.
- 0200 MQ-200
-4d54 Microtechnica Co Ltd
-4ddc ILC Data Device Corp
- 0100 DD-42924I5-300 (ARINC 429 Data Bus)
- 0801 BU-65570I1 MIL-STD-1553 Test and Simulation
- 0802 BU-65570I2 MIL-STD-1553 Test and Simulation
- 0811 BU-65572I1 MIL-STD-1553 Test and Simulation
- 0812 BU-65572I2 MIL-STD-1553 Test and Simulation
- 0881 BU-65570T1 MIL-STD-1553 Test and Simulation
- 0882 BU-65570T2 MIL-STD-1553 Test and Simulation
- 0891 BU-65572T1 MIL-STD-1553 Test and Simulation
- 0892 BU-65572T2 MIL-STD-1553 Test and Simulation
- 0901 BU-65565C1 MIL-STD-1553 Data Bus
- 0902 BU-65565C2 MIL-STD-1553 Data Bus
- 0903 BU-65565C3 MIL-STD-1553 Data Bus
- 0904 BU-65565C4 MIL-STD-1553 Data Bus
- 0b01 BU-65569I1 MIL-STD-1553 Data Bus
- 0b02 BU-65569I2 MIL-STD-1553 Data Bus
- 0b03 BU-65569I3 MIL-STD-1553 Data Bus
- 0b04 BU-65569I4 MIL-STD-1553 Data Bus
-5046 GemTek Technology Corporation
- 1001 PCI Radio
-5053 Voyetra Technologies
- 2010 Daytona Audio Adapter
-5136 S S Technologies
-5143 Qualcomm Inc
-5145 Ensoniq (Old)
- 3031 Concert AudioPCI
-5168 Animation Technologies Inc.
-5301 Alliance Semiconductor Corp.
- 0001 ProMotion aT3D
-5333 S3 Inc.
- 0551 Plato/PX (system)
- 5631 86c325 [ViRGE]
- 8800 86c866 [Vision 866]
- 8801 86c964 [Vision 964]
- 8810 86c764_0 [Trio 32 vers 0]
- 8811 86c764/765 [Trio32/64/64V+]
- 8812 86cM65 [Aurora64V+]
- 8813 86c764_3 [Trio 32/64 vers 3]
- 8814 86c767 [Trio 64UV+]
- 8815 86cM65 [Aurora 128]
- 883d 86c988 [ViRGE/VX]
- 8870 FireGL
- 8880 86c868 [Vision 868 VRAM] vers 0
- 8881 86c868 [Vision 868 VRAM] vers 1
- 8882 86c868 [Vision 868 VRAM] vers 2
- 8883 86c868 [Vision 868 VRAM] vers 3
- 88b0 86c928 [Vision 928 VRAM] vers 0
- 88b1 86c928 [Vision 928 VRAM] vers 1
- 88b2 86c928 [Vision 928 VRAM] vers 2
- 88b3 86c928 [Vision 928 VRAM] vers 3
- 88c0 86c864 [Vision 864 DRAM] vers 0
- 88c1 86c864 [Vision 864 DRAM] vers 1
- 88c2 86c864 [Vision 864-P DRAM] vers 2
- 88c3 86c864 [Vision 864-P DRAM] vers 3
- 88d0 86c964 [Vision 964 VRAM] vers 0
- 88d1 86c964 [Vision 964 VRAM] vers 1
- 88d2 86c964 [Vision 964-P VRAM] vers 2
- 88d3 86c964 [Vision 964-P VRAM] vers 3
- 88f0 86c968 [Vision 968 VRAM] rev 0
- 88f1 86c968 [Vision 968 VRAM] rev 1
- 88f2 86c968 [Vision 968 VRAM] rev 2
- 88f3 86c968 [Vision 968 VRAM] rev 3
- 8900 86c755 [Trio 64V2/DX]
- 5333 8900 86C775 Trio64V2/DX
- 8901 86c775/86c785 [Trio 64V2/DX or /GX]
- 5333 8901 86C775 Trio64V2/DX, 86C785 Trio64V2/GX
- 8902 Plato/PX
- 8903 Trio 3D business multimedia
- 8904 Trio 64 3D
- 1014 00db Integrated Trio3D
- 5333 8904 86C365 Trio3D AGP
- 8905 Trio 64V+ family
- 8906 Trio 64V+ family
- 8907 Trio 64V+ family
- 8908 Trio 64V+ family
- 8909 Trio 64V+ family
- 890a Trio 64V+ family
- 890b Trio 64V+ family
- 890c Trio 64V+ family
- 890d Trio 64V+ family
- 890e Trio 64V+ family
- 890f Trio 64V+ family
- 8a01 ViRGE/DX or /GX
- 0e11 b032 ViRGE/GX
- 10b4 1617 Nitro 3D
- 10b4 1717 Nitro 3D
- 5333 8a01 ViRGE/DX
- 8a10 ViRGE/GX2
- 1092 8a10 Stealth 3D 4000
- 8a13 86c368 [Trio 3D/2X]
- 5333 8a13 Trio3D/2X
- 8a20 86c794 [Savage 3D]
- 5333 8a20 86C391 Savage3D
- 8a21 86c390 [Savage 3D/MV]
- 5333 8a21 86C390 Savage3D/MV
- 8a22 Savage 4
- 1033 8068 Savage 4
- 1033 8069 Savage 4
- 105d 0018 SR9 8Mb SDRAM
- 105d 002a SR9 Pro 16Mb SDRAM
- 105d 003a SR9 Pro 32Mb SDRAM
- 105d 092f SR9 Pro+ 16Mb SGRAM
- 1092 4207 Stealth III S540
- 1092 4800 Stealth III S540
- 1092 4807 SpeedStar A90
- 1092 4808 Stealth III S540
- 1092 4809 Stealth III S540
- 1092 480e Stealth III S540
- 1092 4904 Stealth III S520
- 1092 4905 SpeedStar A200
- 1092 4a09 Stealth III S540
- 1092 4a0b Stealth III S540 Xtreme
- 1092 4a0f Stealth III S540
- 1092 4e01 Stealth III S540
- 1102 101d 3d Blaster Savage 4
- 1102 101e 3d Blaster Savage 4
- 5333 8100 86C394-397 Savage4 SDRAM 100
- 5333 8110 86C394-397 Savage4 SDRAM 110
- 5333 8125 86C394-397 Savage4 SDRAM 125
- 5333 8143 86C394-397 Savage4 SDRAM 143
- 5333 8a22 86C394-397 Savage4
- 5333 8a2e 86C394-397 Savage4 32bit
- 5333 9125 86C394-397 Savage4 SGRAM 125
- 5333 9143 86C394-397 Savage4 SGRAM 143
- 8a23 Savage 4
- 8a25 ProSavage PM133
- 8a26 ProSavage KM133
- 8c00 ViRGE/M3
- 8c01 ViRGE/MX
- 1179 0001 ViRGE/MX
- 8c02 ViRGE/MX+
- 8c03 ViRGE/MX+MV
- 8c10 86C270-294 Savage/MX-MV
- 8c11 82C270-294 Savage/MX
- 8c12 86C270-294 Savage/IX-MV
- 1014 017f ThinkPad T20
- 8c13 86C270-294 Savage/IX
- 1179 0001 Magnia Z310
- 8c22 SuperSavage MX/128
- 8c24 SuperSavage MX/64
- 8c26 SuperSavage MX/64C
- 8c2a SuperSavage IX/128 SDR
- 8c2b SuperSavage IX/128 DDR
- 8c2c SuperSavage IX/64 SDR
- 8c2d SuperSavage IX/64 DDR
- 8c2e SuperSavage IX/C SDR
- 1014 01fc ThinkPad T23 (2647-4MG)
- 8c2f SuperSavage IX/C DDR
- 8d01 86C380 [ProSavageDDR K4M266]
- 8d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)
- 8d03 VT8751 [ProSavageDDR P4M266]
- 8d04 VT8375 [ProSavage8 KM266/KL266]
- 9102 86C410 Savage 2000
- 1092 5932 Viper II Z200
- 1092 5934 Viper II Z200
- 1092 5952 Viper II Z200
- 1092 5954 Viper II Z200
- 1092 5a35 Viper II Z200
- 1092 5a37 Viper II Z200
- 1092 5a55 Viper II Z200
- 1092 5a57 Viper II Z200
- ca00 SonicVibes
-544c Teralogic Inc
- 0350 TL880-based HDTV/ATSC tuner
-5455 Technische University Berlin
- 4458 S5933
-5519 Cnet Technologies, Inc.
-5544 Dunord Technologies
- 0001 I-30xx Scanner Interface
-5555 Genroco, Inc
- 0003 TURBOstor HFP-832 [HiPPI NIC]
-5654 VoiceTronix Pty Ltd
-5700 Netpower
-6356 UltraStor
-6374 c't Magazin für Computertechnik
- 6773 GPPCI
-6409 Logitec Corp.
-6666 Decision Computer International Co.
- 0001 PCCOM4
- 0002 PCCOM8
-7604 O.N. Electronic Co Ltd.
-7bde MIDAC Corporation
-7fed PowerTV
-8008 Quancom Electronic GmbH
- 0010 WDOG1 [PCI-Watchdog 1]
- 0011 PWDOG2 [PCI-Watchdog 2]
-8086 Intel Corp.
- 0007 82379AB
- 0008 Extended Express System Support Controller
- 0039 21145
- 0122 82437FX
- 0482 82375EB
- 0483 82424ZX [Saturn]
- 0484 82378IB [SIO ISA Bridge]
- 0486 82430ZX [Aries]
- 04a3 82434LX [Mercury/Neptune]
- 04d0 82437FX [Triton FX]
- 0600 RAID Controller
- 0960 80960RP [i960 RP Microprocessor/Bridge]
- 0962 80960RM [i960RM Bridge]
- 0964 80960RP [i960 RP Microprocessor/Bridge]
- 1000 82542 Gigabit Ethernet Controller
- 0e11 b0df NC1632 Gigabit Ethernet Adapter (1000-SX)
- 0e11 b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX)
- 0e11 b123 NC1634 Gigabit Ethernet Adapter (1000-SX)
- 1014 0119 Netfinity Gigabit Ethernet SX Adapter
- 8086 1000 PRO/1000 Gigabit Server Adapter
- 1001 82543GC Gigabit Ethernet Controller (Fiber)
- 0e11 004a NC6136 Gigabit Server Adapter
- 1014 01ea Netfinity Gigabit Ethernet SX Adapter
- 8086 1003 PRO/1000 F Server Adapter
- 1002 Pro 100 LAN+Modem 56 Cardbus II
- 8086 200e Pro 100 LAN+Modem 56 Cardbus II
- 8086 2013 Pro 100 SR Mobile Combo Adapter
- 8086 2017 Pro 100 S Combo Mobile Adapter
- 1004 82543GC Gigabit Ethernet Controller (Copper)
- 0e11 0049 NC7132 Gigabit Upgrade Module
- 0e11 b1a4 NC7131 Gigabit Server Adapter
- 1014 10f2 Gigabit Ethernet Server Adapter
- 8086 1004 PRO/1000 T Server Adapter
- 8086 2004 PRO/1000 T Server Adapter
- 1008 82544EI Gigabit Ethernet Controller (Copper)
- 8086 1107 PRO/1000 XT Server Adapter
- 8086 2107 PRO/1000 XT Server Adapter
- 8086 2110 PRO/1000 XT Server Adapter
- 1009 82544EI Gigabit Ethernet Controller (Fiber)
- 8086 1109 PRO/1000 XF Server Adapter
- 8086 2109 PRO/1000 XF Server Adapter
- 100c 82544GC Gigabit Ethernet Controller (Copper)
- 8086 1112 PRO/1000 T Desktop Adapter
- 8086 2112 PRO/1000 T Desktop Adapter
- 100d 82544GC Gigabit Ethernet Controller (LOM)
- 100e 82540EM Gigabit Ethernet Controller
- 8086 001e PRO/1000 MT Desktop Adapter
- 8086 002e PRO/1000 MT Desktop Adapter
- 100f 82545EM Gigabit Ethernet Controller (Copper)
- 8086 1001 PRO/1000 MT Server Adapter
- 1010 82546EB Gigabit Ethernet Controller (Copper)
- 8086 1011 PRO/1000 MT Dual Port Server Adapter
- 1011 82545EM Gigabit Ethernet Controller (Fiber)
- 8086 1002 PRO/1000 MF Server Adapter
- 1012 82546EB Gigabit Ethernet Controller (Fiber)
- 8086 1012 PRO/1000 MF Dual Port Server Adapter
- 1015 82540EM Gigabit Ethernet Controller (LOM)
- 1029 82559 Ethernet Controller
- 1030 82559 InBusiness 10/100
- 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
- 1014 0209 ThinkPad A/T/X Series
- 104d 80e7 Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 107b 5350 EtherExpress PRO/100 VE
- 1179 0001 EtherExpress PRO/100 VE
- 144d c000 EtherExpress PRO/100 VE
- 144d c001 EtherExpress PRO/100 VE
- 144d c003 EtherExpress PRO/100 VE
- 144d c006 vpr Matrix 170B4
- 1032 82801CAM (ICH3) PRO/100 VE Ethernet Controller
- 1033 82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller
- 1034 82801CAM (ICH3) PRO/100 VM Ethernet Controller
- 1035 82801CAM (ICH3)/82562EH (LOM) Ethernet Controller
- 1036 82801CAM (ICH3) 82562EH Ethernet Controller
- 1037 82801CAM (ICH3) Chipset Ethernet Controller
- 1038 82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller
- 1039 82801BD PRO/100 VE (LOM) Ethernet Controller
- 103a 82801BD PRO/100 VE (CNR) Ethernet Controller
- 103b 82801BD PRO/100 VM (LOM) Ethernet Controller
- 103c 82801BD PRO/100 VM (CNR) Ethernet Controller
- 103d 82801BD PRO/100 VE (MOB) Ethernet Controller
- 103e 82801BD PRO/100 VM (MOB) Ethernet Controller
- 1040 536EP Data Fax Modem
- 16be 1040 V.9X DSP Data Fax Modem
- 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter
- 1059 82551QM Ethernet Controller
- 1130 82815 815 Chipset Host Bridge and Memory Controller Hub
- 1025 1016 Travelmate 612 TX
- 1043 8027 TUSL2-C Mainboard
- 104d 80df Vaio PCG-FX403
- 8086 4532 D815EEA2 mainboard
- 8086 4557 D815EGEW Mainboard
- 1131 82815 815 Chipset AGP Bridge
- 1132 82815 CGC [Chipset Graphics Controller]
- 1025 1016 Travelmate 612 TX
- 104d 80df Vaio PCG-FX403
- 8086 4532 D815EEA2 Mainboard
- 8086 4557 D815EGEW Mainboard
- 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller
- 8086 1161 82806AA PCI64 Hub APIC
- 1162 Xscale 80200 Big Endian Companion Chip
- 1200 Intel IXP1200 Network Processor
- 172a 0000 AEP SSL Accelerator
- 1209 82559ER
- 1221 82092AA_0
- 1222 82092AA_1
- 1223 SAA7116
- 1225 82452KX/GX [Orion]
- 1226 82596 PRO/10 PCI
- 1227 82865 EtherExpress PRO/100A
- 1228 82556 EtherExpress PRO/100 Smart
-# the revision field differentiates between them (1-3 is 82557, 4-5 is 82558, 6-8 is 82559, 9 is 82559ER)
- 1229 82557/8/9 [Ethernet Pro 100]
- 0e11 3001 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3002 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3003 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3004 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3005 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3006 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 3007 82559 Fast Ethernet LOM with Alert on LAN*
- 0e11 b01e NC3120 Fast Ethernet NIC
- 0e11 b01f NC3122 Fast Ethernet NIC (dual port)
- 0e11 b02f NC1120 Ethernet NIC
- 0e11 b04a Netelligent 10/100TX NIC with Wake on LAN
- 0e11 b0c6 NC3161 Fast Ethernet NIC (embedded, WOL)
- 0e11 b0c7 NC3160 Fast Ethernet NIC (embedded)
- 0e11 b0d7 NC3121 Fast Ethernet NIC (WOL)
- 0e11 b0dd NC3131 Fast Ethernet NIC (dual port)
- 0e11 b0de NC3132 Fast Ethernet Module (dual port)
- 0e11 b0e1 NC3133 Fast Ethernet Module (100-FX)
- 0e11 b134 NC3163 Fast Ethernet NIC (embedded, WOL)
- 0e11 b13c NC3162 Fast Ethernet NIC (embedded)
- 0e11 b144 NC3123 Fast Ethernet NIC (WOL)
- 0e11 b163 NC3134 Fast Ethernet NIC (dual port)
- 0e11 b164 NC3135 Fast Ethernet Upgrade Module (dual port)
- 0e11 b1a4 NC7131 Gigabit Server Adapter
- 1014 005c 82558B Ethernet Pro 10/100
- 1014 01bc 82559 Fast Ethernet LAN On Motherboard
- 1014 01f1 10/100 Ethernet Server Adapter
- 1014 01f2 10/100 Ethernet Server Adapter
- 1014 0207 Ethernet Pro/100 S
- 1014 0232 10/100 Dual Port Server Adapter
- 1014 023a ThinkPad R30
- 1014 105c Netfinity 10/100
- 1014 2205 ThinkPad A22p
- 1014 305c 10/100 EtherJet Management Adapter
- 1014 405c 10/100 EtherJet Adapter with Alert on LAN
- 1014 505c 10/100 EtherJet Secure Management Adapter
- 1014 605c 10/100 EtherJet Secure Management Adapter
- 1014 705c 10/100 Netfinity 10/100 Ethernet Security Adapter
- 1014 805c 10/100 Netfinity 10/100 Ethernet Security Adapter
- 1028 009b PowerEdge 2550
- 1033 8000 PC-9821X-B06
- 1033 8016 PK-UG-X006
- 1033 801f PK-UG-X006
- 1033 8026 PK-UG-X006
- 1033 8063 82559-based Fast Ethernet Adapter
- 1033 8064 82559-based Fast Ethernet Adapter
- 103c 10c0 NetServer 10/100TX
- 103c 10c3 NetServer 10/100TX
- 103c 10ca NetServer 10/100TX
- 103c 10cb NetServer 10/100TX
- 103c 10e3 NetServer 10/100TX
- 103c 10e4 NetServer 10/100TX
- 103c 1200 NetServer 10/100TX
- 10c3 1100 SmartEther100 SC1100
- 10cf 1115 8255x-based Ethernet Adapter (10/100)
- 10cf 1143 8255x-based Ethernet Adapter (10/100)
- 1179 0001 8255x-based Ethernet Adapter (10/100)
- 1179 0002 PCI FastEther LAN on Docker
- 1179 0003 8255x-based Fast Ethernet
- 1259 2560 AT-2560 100
- 1259 2561 AT-2560 100 FX Ethernet Adapter
- 1266 0001 NE10/100 Adapter
- 144d 2501 SEM-2000 MiniPCI LAN Adapter
- 144d 2502 SEM-2100IL MiniPCI LAN Adapter
- 1668 1100 EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)
- 8086 0001 EtherExpress PRO/100B (TX)
- 8086 0002 EtherExpress PRO/100B (T4)
- 8086 0003 EtherExpress PRO/10+
- 8086 0004 EtherExpress PRO/100 WfM
- 8086 0005 82557 10/100
- 8086 0006 82557 10/100 with Wake on LAN
- 8086 0007 82558 10/100 Adapter
- 8086 0008 82558 10/100 with Wake on LAN
- 8086 0009 EtherExpress PRO/100+
- 8086 000a EtherExpress PRO/100+ Management Adapter
- 8086 000b EtherExpress PRO/100+
- 8086 000c EtherExpress PRO/100+ Management Adapter
- 8086 000d EtherExpress PRO/100+ Alert On LAN II* Adapter
- 8086 000e EtherExpress PRO/100+ Management Adapter with Alert On LAN*
- 8086 000f EtherExpress PRO/100 Desktop Adapter
- 8086 0010 EtherExpress PRO/100 S Management Adapter
- 8086 0011 EtherExpress PRO/100 S Management Adapter
- 8086 0012 EtherExpress PRO/100 S Advanced Management Adapter (D)
- 8086 0013 EtherExpress PRO/100 S Advanced Management Adapter (E)
- 8086 0030 EtherExpress PRO/100 Management Adapter with Alert On LAN* GC
- 8086 0031 EtherExpress PRO/100 Desktop Adapter
- 8086 0040 EtherExpress PRO/100 S Desktop Adapter
- 8086 0041 EtherExpress PRO/100 S Desktop Adapter
- 8086 0042 EtherExpress PRO/100 Desktop Adapter
- 8086 0050 EtherExpress PRO/100 S Desktop Adapter
- 8086 1009 EtherExpress PRO/100+ Server Adapter
- 8086 100c EtherExpress PRO/100+ Server Adapter (PILA8470B)
- 8086 1012 EtherExpress PRO/100 S Server Adapter (D)
- 8086 1013 EtherExpress PRO/100 S Server Adapter (E)
- 8086 1015 EtherExpress PRO/100 S Dual Port Server Adapter
- 8086 1017 EtherExpress PRO/100+ Dual Port Server Adapter
- 8086 1030 EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server
- 8086 1040 EtherExpress PRO/100 S Server Adapter
- 8086 1041 EtherExpress PRO/100 S Server Adapter
- 8086 1042 EtherExpress PRO/100 Server Adapter
- 8086 1050 EtherExpress PRO/100 S Server Adapter
- 8086 1051 EtherExpress PRO/100 Server Adapter
- 8086 1052 EtherExpress PRO/100 Server Adapter
- 8086 10f0 EtherExpress PRO/100+ Dual Port Adapter
- 8086 2009 EtherExpress PRO/100 S Mobile Adapter
- 8086 200d EtherExpress PRO/100 Cardbus
- 8086 200e EtherExpress PRO/100 LAN+V90 Cardbus Modem
- 8086 200f EtherExpress PRO/100 SR Mobile Adapter
- 8086 2010 EtherExpress PRO/100 S Mobile Combo Adapter
- 8086 2013 EtherExpress PRO/100 SR Mobile Combo Adapter
- 8086 2016 EtherExpress PRO/100 S Mobile Adapter
- 8086 2017 EtherExpress PRO/100 S Combo Mobile Adapter
- 8086 2018 EtherExpress PRO/100 SR Mobile Adapter
- 8086 2019 EtherExpress PRO/100 SR Combo Mobile Adapter
- 8086 2101 EtherExpress PRO/100 P Mobile Adapter
- 8086 2102 EtherExpress PRO/100 SP Mobile Adapter
- 8086 2103 EtherExpress PRO/100 SP Mobile Adapter
- 8086 2104 EtherExpress PRO/100 SP Mobile Adapter
- 8086 2105 EtherExpress PRO/100 SP Mobile Adapter
- 8086 2106 EtherExpress PRO/100 P Mobile Adapter
- 8086 2107 EtherExpress PRO/100 Network Connection
- 8086 2108 EtherExpress PRO/100 Network Connection
- 8086 2200 EtherExpress PRO/100 P Mobile Combo Adapter
- 8086 2201 EtherExpress PRO/100 P Mobile Combo Adapter
- 8086 2202 EtherExpress PRO/100 SP Mobile Combo Adapter
- 8086 2203 EtherExpress PRO/100+ MiniPCI
- 8086 2204 EtherExpress PRO/100+ MiniPCI
- 8086 2205 EtherExpress PRO/100 SP Mobile Combo Adapter
- 8086 2206 EtherExpress PRO/100 SP Mobile Combo Adapter
- 8086 2207 EtherExpress PRO/100 SP Mobile Combo Adapter
- 8086 2208 EtherExpress PRO/100 P Mobile Combo Adapter
- 8086 2402 EtherExpress PRO/100+ MiniPCI
- 8086 2407 EtherExpress PRO/100+ MiniPCI
- 8086 2408 EtherExpress PRO/100+ MiniPCI
- 8086 2409 EtherExpress PRO/100+ MiniPCI
- 8086 240f EtherExpress PRO/100+ MiniPCI
- 8086 2410 EtherExpress PRO/100+ MiniPCI
- 8086 2411 EtherExpress PRO/100+ MiniPCI
- 8086 2412 EtherExpress PRO/100+ MiniPCI
- 8086 2413 EtherExpress PRO/100+ MiniPCI
- 8086 3000 82559 Fast Ethernet LAN on Motherboard
- 8086 3001 82559 Fast Ethernet LOM with Basic Alert on LAN*
- 8086 3002 82559 Fast Ethernet LOM with Alert on LAN II*
- 8086 3006 EtherExpress PRO/100 S Network Connection
- 8086 3007 EtherExpress PRO/100 S Network Connection
- 8086 3008 EtherExpress PRO/100 Network Connection
- 8086 3010 EtherExpress PRO/100 S Network Connection
- 8086 3011 EtherExpress PRO/100 S Network Connection
- 8086 3012 EtherExpress PRO/100 Network Connection
- 122d 430FX - 82437FX TSC [Triton I]
- 122e 82371FB PIIX ISA [Triton I]
- 1230 82371FB PIIX IDE [Triton I]
- 1231 DSVD Modem
- 1234 430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)
- 1235 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)
- 1237 440FX - 82441FX PMC [Natoma]
- 1239 82371FB
- 123b 82380PB
- 123c 82380AB
- 123d 683053 Programmable Interrupt Device
- 123f 82466GX Integrated Hot-Plug Controller (IHPC)
- 1240 752 AGP
- 124b 82380FB
- 1250 430HX - 82439HX TXC [Triton II]
- 1360 82806AA PCI64 Hub PCI Bridge
- 1361 82806AA PCI64 Hub Controller (HRes)
- 8086 1361 82806AA PCI64 Hub Controller (HRes)
- 8086 8000 82806AA PCI64 Hub Controller (HRes)
- 1460 82870P2 P64H2 Hub PCI Bridge
- 1461 82870P2 P64H2 I/OxAPIC
- 15d9 3480 P4DP6
- 1462 82870P2 P64H2 Hot Plug Controller
- 1960 80960RP [i960RP Microprocessor]
- 101e 0431 MegaRAID 431 RAID Controller
- 101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller
- 101e 0466 MegaRAID 466 Express Plus RAID Controller
- 101e 0467 MegaRAID 467 Enterprise 1500 RAID Controller
- 101e 0490 MegaRAID 490 Express 300 RAID Controller
- 101e 0762 MegaRAID 762 Express RAID Controller
- 101e 09a0 PowerEdge Expandable RAID Controller 2/SC
- 1028 0467 PowerEdge Expandable RAID Controller 2/DC
- 1028 1111 PowerEdge Expandable RAID Controller 2/SC
- 103c 03a2 MegaRAID
- 103c 10c6 MegaRAID 438, HP NetRAID-3Si
- 103c 10c7 MegaRAID T5, Integrated HP NetRAID
- 103c 10cc MegaRAID, Integrated HP NetRAID
- 103c 10cd HP NetRAID-1Si
- 105a 0000 SuperTrak
- 105a 2168 SuperTrak Pro
- 105a 5168 SuperTrak66/100
- 1111 1111 MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC
- 1111 1112 PowerEdge Expandable RAID Controller 2/SC
- 113c 03a2 MegaRAID
- 1962 80960RM [i960RM Microprocessor]
- 105a 0000 SuperTrak SX6000 I2O CPU
- 1a21 82840 840 (Carmel) Chipset Host Bridge (Hub A)
- 1a23 82840 840 (Carmel) Chipset AGP Bridge
- 1a24 82840 840 (Carmel) Chipset PCI Bridge (Hub B)
- 1a30 82845 845 (Brookdale) Chipset Host Bridge
- 1a31 82845 845 (Brookdale) Chipset AGP Bridge
- 2410 82801AA ISA Bridge (LPC)
- 2411 82801AA IDE
- 2412 82801AA USB
- 2413 82801AA SMBus
- 2415 82801AA AC'97 Audio
- 1028 0095 Precision Workstation 220 Integrated Digital Audio
- 11d4 0040 SoundMAX Integrated Digital Audio
- 11d4 0048 SoundMAX Integrated Digital Audio
- 11d4 5340 SoundMAX Integrated Digital Audio
- 2416 82801AA AC'97 Modem
- 2418 82801AA PCI Bridge
- 2420 82801AB ISA Bridge (LPC)
- 2421 82801AB IDE
- 2422 82801AB USB
- 2423 82801AB SMBus
- 2425 82801AB AC'97 Audio
- 11d4 0040 SoundMAX Integrated Digital Audio
- 11d4 0048 SoundMAX Integrated Digital Audio
- 2426 82801AB AC'97 Modem
- 2428 82801AB PCI Bridge
- 2440 82801BA ISA Bridge (LPC)
- 2442 82801BA/BAM USB (Hub #1)
- 1014 01c6 Netvista A40/A40p
- 1025 1016 Travelmate 612 TX
- 104d 80df Vaio PCG-FX403
- 147b 0507 TH7II-RAID
- 8086 4532 D815EEA2 mainboard
- 8086 4557 D815EGEW Mainboard
- 2443 82801BA/BAM SMBus
- 1014 01c6 Netvista A40/A40p
- 1025 1016 Travelmate 612 TX
- 1043 8027 TUSL2-C Mainboard
- 104d 80df Vaio PCG-FX403
- 147b 0507 TH7II-RAID
- 8086 4532 D815EEA2 mainboard
- 8086 4557 D815EGEW Mainboard
- 2444 82801BA/BAM USB (Hub #2)
- 1025 1016 Travelmate 612 TX
- 104d 80df Vaio PCG-FX403
- 147b 0507 TH7II-RAID
- 8086 4532 D815EEA2 mainboard
- 2445 82801BA/BAM AC'97 Audio
- 1014 01c6 Netvista A40/A40p
- 1025 1016 Travelmate 612 TX
- 104d 80df Vaio PCG-FX403
- 1462 3370 STAC9721 AC
- 147b 0507 TH7II-RAID
- 8086 4557 D815EGEW Mainboard
- 2446 Intel 537 [82801BA/BAM AC'97 Modem]
- 1025 1016 Travelmate 612 TX
- 104d 80df Vaio PCG-FX403
- 2448 82801BAM/CAM PCI Bridge
- 2449 82801BA/BAM/CA/CAM Ethernet Controller
- 0e11 0012 EtherExpress PRO/100 VM
- 0e11 0091 EtherExpress PRO/100 VE
- 1014 01ce EtherExpress PRO/100 VE
- 1014 01dc EtherExpress PRO/100 VE
- 1014 01eb EtherExpress PRO/100 VE
- 1014 01ec EtherExpress PRO/100 VE
- 1014 0202 EtherExpress PRO/100 VE
- 1014 0205 EtherExpress PRO/100 VE
- 1014 0217 EtherExpress PRO/100 VE
- 1014 0234 EtherExpress PRO/100 VE
- 1014 023d EtherExpress PRO/100 VE
- 1014 0244 EtherExpress PRO/100 VE
- 1014 0245 EtherExpress PRO/100 VE
- 1014 0265 PRO/100 VE Desktop Connection
- 1014 0267 PRO/100 VE Desktop Connection
- 1014 026a PRO/100 VE Desktop Connection
- 109f 315d EtherExpress PRO/100 VE
- 109f 3181 EtherExpress PRO/100 VE
- 1179 ff01 PRO/100 VE Network Connection
- 1186 7801 EtherExpress PRO/100 VE
- 144d 2602 HomePNA 1M CNR
- 8086 3010 EtherExpress PRO/100 VE
- 8086 3011 EtherExpress PRO/100 VM
- 8086 3012 82562EH based Phoneline
- 8086 3013 EtherExpress PRO/100 VE
- 8086 3014 EtherExpress PRO/100 VM
- 8086 3015 82562EH based Phoneline
- 8086 3016 EtherExpress PRO/100 P Mobile Combo
- 8086 3017 EtherExpress PRO/100 P Mobile
- 8086 3018 EtherExpress PRO/100
- 244a 82801BAM IDE U100
- 1025 1016 Travelmate 612TX
- 104d 80df Vaio PCG-FX403
- 244b 82801BA IDE U100
- 1014 01c6 Netvista A40/A40p
- 1043 8027 TUSL2-C Mainboard
- 147b 0507 TH7II-RAID
- 8086 4532 D815EEA2 mainboard
- 8086 4557 D815EGEW Mainboard
- 244c 82801BAM ISA Bridge (LPC)
- 244e 82801BA/CA/DB/EB PCI Bridge
- 2450 82801E ISA Bridge (LPC)
- 2452 82801E USB
- 2453 82801E SMBus
- 2459 82801E Ethernet Controller 0
- 245b 82801E IDE U100
- 245d 82801E Ethernet Controller 1
- 245e 82801E PCI Bridge
- 2480 82801CA LPC Interface Controller
- 2482 82801CA/CAM USB (Hub #1)
- 1014 0220 ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 15d9 3480 P4DP6
- 8086 1958 vpr Matrix 170B4
- 2483 82801CA/CAM SMBus Controller
- 1014 0220 ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 15d9 3480 P4DP6
- 8086 1958 vpr Matrix 170B4
- 2484 82801CA/CAM USB (Hub #2)
- 1014 0220 ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 15d9 3480 P4DP6
- 8086 1958 vpr Matrix 170B4
- 2485 82801CA/CAM AC'97 Audio Controller
- 1014 0222 ThinkPad T23 (2647-4MG) or A30p (2653-64G)
- 1014 0508 ThinkPad T30
- 1014 051c ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 144d c006 vpr Matrix 170B4
- 2486 82801CA/CAM AC'97 Modem Controller
- 1014 0223 ThinkPad A/T/X Series
- 1014 0503 ThinkPad R31 2656BBG
- 1014 051a ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 1179 0001 Toshiba Satellite 1110 Z15 internal Modem
- 134d 4c21 Dell Inspiron 2100 internal modem
- 144d 2115 vpr Matrix 170B4 internal modem
- 14f1 5421 MD56ORD V.92 MDC Modem
- 2487 82801CA/CAM USB (Hub #3)
- 1014 0220 ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 15d9 3480 P4DP6
- 8086 1958 vpr Matrix 170B4
- 248a 82801CAM IDE U100
- 1014 0220 ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 8086 1958 vpr Matrix 170B4
- 248b 82801CA Ultra ATA Storage Controller
- 15d9 3480 P4DP6
- 248c 82801CAM ISA Bridge (LPC)
- 24c0 82801DB LPC Interface Controller
- 1462 5800 845PE Max (MS-6580)
- 24c2 82801DB USB (Hub #1)
- 1462 5800 845PE Max (MS-6580)
- 24c3 82801DB/DBM SMBus Controller
- 1462 5800 845PE Max (MS-6580)
- 24c4 82801DB USB (Hub #2)
- 1462 5800 845PE Max (MS-6580)
- 24c5 82801DB AC'97 Audio Controller
- 1462 5800 845PE Max (MS-6580)
- 24c6 82801DB AC'97 Modem Controller
- 24c7 82801DB USB (Hub #3)
- 1462 5800 845PE Max (MS-6580)
- 24ca 82801DBM Ultra ATA Storage Controller
- 24cb 82801DB Ultra ATA Storage Controller
- 1462 5800 845PE Max (MS-6580)
- 24cc 82801DBM LPC Interface Controller
- 24cd 82801DB USB2
- 1462 3981 845PE Max (MS-6580) Onboard USB EHCI Controller
- 24d0 82801EB LPC Interface Controller
- 24d1 82801EB Ultra ATA Storage Controller
- 24d2 82801EB USB
- 24d3 82801EB SMBus Controller
- 24d4 82801EB USB
- 24d5 82801EB AC'97 Audio Controller
- 24d6 82801EB AC'97 Modem Controller
- 24d7 82801EB USB
- 24db 82801EB Ultra ATA Storage Controller
- 24dc 82801EB LPC Interface Controller
- 24dd 82801EB USB2
- 24de 82801EB USB
- 2500 82820 820 (Camino) Chipset Host Bridge (MCH)
- 1028 0095 Precision Workstation 220 Chipset
- 1043 801c P3C-2000 system chipset
- 2501 82820 820 (Camino) Chipset Host Bridge (MCH)
- 1043 801c P3C-2000 system chipset
- 250b 82820 820 (Camino) Chipset Host Bridge
- 250f 82820 820 (Camino) Chipset AGP Bridge
- 2520 82805AA MTH Memory Translator Hub
- 2521 82804AA MRH-S Memory Repeater Hub for SDRAM
- 2530 82850 850 (Tehama) Chipset Host Bridge (MCH)
- 147b 0507 TH7II-RAID
- 2531 82860 860 (Wombat) Chipset Host Bridge (MCH)
- 2532 82850 850 (Tehama) Chipset AGP Bridge
- 2533 82860 860 (Wombat) Chipset AGP Bridge
- 2534 82860 860 (Wombat) Chipset PCI Bridge
- 2540 E7500 Memory Controller Hub
- 15d9 3480 P4DP6
- 2541 E7000 Series Host RASUM Controller
- 15d9 3480 P4DP6
- 2543 E7000 Series Hub Interface B PCI-to-PCI Bridge
- 2544 E7000 Series Hub Interface B RASUM Controller
- 2545 E7000 Series Hub Interface C PCI-to-PCI Bridge
- 2546 E7000 Series Hub Interface C RASUM Controller
- 2547 E7000 Series Hub Interface D PCI-to-PCI Bridge
- 2548 E7000 Series Hub Interface D RASUM Controller
- 254c E7501 Memory Controller Hub
- 2550 E7505 Memory Controller Hub
- 2551 E7000 Series RAS Controller
- 2552 E7000 Series Processor to AGP Controller
- 2553 E7000 Series Hub Interface B PCI-to-PCI Bridge
- 2554 E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller
- 255d E7205 Memory Controller Hub
- 2560 82845G/GL [Brookdale-G] Chipset Host Bridge
- 1462 5800 845PE Max (MS-6580)
- 2561 82845G/GL [Brookdale-G] Chipset AGP Bridge
- 2562 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device
- 2570 82865G/PE/P Processor to I/O Controller
- 2571 82865G/PE/P Processor to AGP Controller
- 2572 82865G Integrated Graphics Device
- 2573 82865G/PE/P Processor to PCI to CSA Bridge
- 2576 82864G/PE/P Processor to I/O Memory Interface
- 2578 82875P Memory Controller Hub
- 2579 82875P Processor to AGP Controller
- 257b 82875P Processor to PCI to CSA Bridge
- 257e 82875P Processor to I/O Memory Interface
- 3092 Integrated RAID
- 3340 82855PM Processor to I/O Controller
- 3341 82855PM Processor to AGP Controller
- 3575 82830 830 Chipset Host Bridge
- 1014 021d ThinkPad A/T/X Series
- 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
- 3576 82830 830 Chipset AGP Bridge
- 3577 82830 CGC [Chipset Graphics Controller]
- 1014 0513 ThinkPad A/T/X Series
- 3578 82830 830 Chipset Host Bridge
- 3580 82852/855GM Host Bridge
- 3582 82852/855GM Integrated Graphics Device
- 5200 EtherExpress PRO/100 Intelligent Server
- 5201 EtherExpress PRO/100 Intelligent Server
- 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter
- 530d 80310 IOP [IO Processor]
- 7000 82371SB PIIX3 ISA [Natoma/Triton II]
- 7010 82371SB PIIX3 IDE [Natoma/Triton II]
- 7020 82371SB PIIX3 USB [Natoma/Triton II]
- 7030 430VX - 82437VX TVX [Triton VX]
- 7100 430TX - 82439TX MTXC
- 7110 82371AB/EB/MB PIIX4 ISA
- 7111 82371AB/EB/MB PIIX4 IDE
- 7112 82371AB/EB/MB PIIX4 USB
- 7113 82371AB/EB/MB PIIX4 ACPI
- 7120 82810 GMCH [Graphics Memory Controller Hub]
- 7121 82810 CGC [Chipset Graphics Controller]
- 8086 4341 Cayman (CA810) Mainboard
- 7122 82810 DC-100 GMCH [Graphics Memory Controller Hub]
- 7123 82810 DC-100 CGC [Chipset Graphics Controller]
- 7124 82810E DC-133 GMCH [Graphics Memory Controller Hub]
- 7125 82810E DC-133 CGC [Chipset Graphics Controller]
- 7126 82810 DC-133 System and Graphics Controller
- 7128 82810-M DC-100 System and Graphics Controller
- 712a 82810-M DC-133 System and Graphics Controller
- 7180 440LX/EX - 82443LX/EX Host bridge
- 7181 440LX/EX - 82443LX/EX AGP bridge
- 7190 440BX/ZX/DX - 82443BX/ZX/DX Host bridge
- 0e11 0500 Armada 1750 Laptop System Chipset
- 0e11 b110 Armada M700
- 1179 0001 Toshiba Tecra 8100 Laptop System Chipset
- 7191 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge
- 7192 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)
- 0e11 0460 Armada 1700 Laptop System Chipset
- 7194 82440MX Host Bridge
- 7195 82440MX AC'97 Audio Controller
- 10cf 1099 QSound_SigmaTel Stac97 PCI Audio
- 11d4 0040 SoundMAX Integrated Digital Audio
- 11d4 0048 SoundMAX Integrated Digital Audio
- 7196 82440MX AC'97 Modem Controller
- 7198 82440MX ISA Bridge
- 7199 82440MX EIDE Controller
- 719a 82440MX USB Universal Host Controller
- 719b 82440MX Power Management Controller
- 71a0 440GX - 82443GX Host bridge
- 71a1 440GX - 82443GX AGP bridge
- 71a2 440GX - 82443GX Host bridge (AGP disabled)
- 7600 82372FB PIIX5 ISA
- 7601 82372FB PIIX5 IDE
- 7602 82372FB PIIX5 USB
- 7603 82372FB PIIX5 SMBus
- 7800 i740
- 003d 0008 Starfighter AGP
- 003d 000b Starfighter AGP
- 1092 0100 Stealth II G460
- 10b4 201a Lightspeed 740
- 10b4 202f Lightspeed 740
- 8086 0000 Terminator 2x/i
- 8086 0100 Intel740 Graphics Accelerator
- 84c4 450KX/GX [Orion] - 82454KX/GX PCI bridge
- 84c5 450KX/GX [Orion] - 82453KX/GX Memory controller
- 84ca 450NX - 82451NX Memory & I/O Controller
- 84cb 450NX - 82454NX/84460GX PCI Expander Bridge
- 84e0 460GX - 84460GX System Address Controller (SAC)
- 84e1 460GX - 84460GX System Data Controller (SDC)
- 84e2 460GX - 84460GX AGP Bridge (GXB function 2)
- 84e3 460GX - 84460GX Memory Address Controller (MAC)
- 84e4 460GX - 84460GX Memory Data Controller (MDC)
- 84e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)
- 84ea 460GX - 84460GX AGP Bridge (GXB function 1)
- 9621 Integrated RAID
- 9622 Integrated RAID
- 9641 Integrated RAID
- 96a1 Integrated RAID
- b152 21152 PCI-to-PCI Bridge
-# observed, and documented in Intel revision note; new mask of 1011:0026
- b154 21154 PCI-to-PCI Bridge
- b555 21555 Non transparent PCI-to-PCI Bridge
- e4bf 1000 CC8-1-BLUES
- ffff 450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]
-8800 Trigem Computer Inc.
- 2008 Video assistent component
-8866 T-Square Design Inc.
-8888 Silicon Magic
-8e0e Computone Corporation
-8e2e KTI
- 3000 ET32P2
-9004 Adaptec
- 1078 AIC-7810
- 1160 AIC-1160 [Family Fibre Channel Adapter]
- 2178 AIC-7821
- 3860 AHA-2930CU
- 3b78 AHA-4844W/4844UW
- 5075 AIC-755x
- 5078 AHA-7850
- 9004 7850 AHA-2904/Integrated AIC-7850
- 5175 AIC-755x
- 5178 AIC-7851
- 5275 AIC-755x
- 5278 AIC-7852
- 5375 AIC-755x
- 5378 AIC-7850
- 5475 AIC-755x
- 5478 AIC-7850
- 5575 AVA-2930
- 5578 AIC-7855
- 5675 AIC-755x
- 5678 AIC-7856
- 5775 AIC-755x
- 5778 AIC-7850
- 5800 AIC-5800
- 5900 ANA-5910/5930/5940 ATM155 & 25 LAN Adapter
- 5905 ANA-5910A/5930A/5940A ATM Adapter
- 6038 AIC-3860
- 6075 AIC-1480 / APA-1480
- 9004 7560 AIC-1480 / APA-1480 Cardbus
- 6078 AIC-7860
- 6178 AIC-7861
- 9004 7861 AHA-2940AU Single
- 6278 AIC-7860
- 6378 AIC-7860
- 6478 AIC-786x
- 6578 AIC-786x
- 6678 AIC-786x
- 6778 AIC-786x
- 6915 ANA620xx/ANA69011A
- 9004 0008 ANA69011A/TX 10/100
- 9004 0009 ANA69011A/TX 10/100
- 9004 0010 ANA62022 2-port 10/100
- 9004 0018 ANA62044 4-port 10/100
- 9004 0019 ANA62044 4-port 10/100
- 9004 0020 ANA62022 2-port 10/100
- 9004 0028 ANA69011A/TX 10/100
- 9004 8008 ANA69011A/TX 64 bit 10/100
- 9004 8009 ANA69011A/TX 64 bit 10/100
- 9004 8010 ANA62022 2-port 64 bit 10/100
- 9004 8018 ANA62044 4-port 64 bit 10/100
- 9004 8019 ANA62044 4-port 64 bit 10/100
- 9004 8020 ANA62022 2-port 64 bit 10/100
- 9004 8028 ANA69011A/TX 64 bit 10/100
- 7078 AHA-294x / AIC-7870
- 7178 AHA-2940/2940W / AIC-7871
- 7278 AHA-3940/3940W / AIC-7872
- 7378 AHA-3985 / AIC-7873
- 7478 AHA-2944/2944W / AIC-7874
- 7578 AHA-3944/3944W / AIC-7875
- 7678 AHA-4944W/UW / AIC-7876
- 7710 ANA-7711F Network Accelerator Card (NAC) - Optical
- 7711 ANA-7711C Network Accelerator Card (NAC) - Copper
- 7778 AIC-787x
- 7810 AIC-7810
- 7815 AIC-7815 RAID+Memory Controller IC
- 9004 7815 ARO-1130U2 RAID Controller
- 9004 7840 AIC-7815 RAID+Memory Controller IC
- 7850 AIC-7850
- 7855 AHA-2930
- 7860 AIC-7860
- 7870 AIC-7870
- 7871 AHA-2940
- 7872 AHA-3940
- 7873 AHA-3980
- 7874 AHA-2944
- 7880 AIC-7880P
- 7890 AIC-7890
- 7891 AIC-789x
- 7892 AIC-789x
- 7893 AIC-789x
- 7894 AIC-789x
- 7895 AHA-2940U/UW / AHA-39xx / AIC-7895
- 9004 7890 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
- 9004 7891 AHA-2940U/2940UW Dual
- 9004 7892 AHA-3940AU/AUW/AUWD/UWD
- 9004 7894 AHA-3944AUWD
- 9004 7895 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
- 9004 7896 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
- 9004 7897 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
- 7896 AIC-789x
- 7897 AIC-789x
- 8078 AIC-7880U
- 9004 7880 AIC-7880P Ultra/Ultra Wide SCSI Chipset
- 8178 AHA-2940U/UW/D / AIC-7881U
- 9004 7881 AHA-2940UW SCSI Host Adapter
- 8278 AHA-3940U/UW/UWD / AIC-7882U
- 8378 AHA-3940U/UW / AIC-7883U
- 8478 AHA-2944UW / AIC-7884U
- 8578 AHA-3944U/UWD / AIC-7885
- 8678 AHA-4944UW / AIC-7886
- 8778 AHA-2940UW Pro / AIC-788x
- 9004 7887 2940UW Pro Ultra-Wide SCSI Controller
- 8878 AHA-2930UW / AIC-7888
- 9004 7888 AHA-2930UW SCSI Controller
- 8b78 ABA-1030
- ec78 AHA-4944W/UW
-9005 Adaptec
- 0010 AHA-2940U2/U2W
- 9005 2180 AHA-2940U2 SCSI Controller
- 9005 8100 AHA-2940U2B SCSI Controller
- 9005 a180 AHA-2940U2W SCSI Controller
- 9005 e100 AHA-2950U2B SCSI Controller
- 0011 AHA-2930U2
- 0013 78902
- 9005 0003 AAA-131U2 Array1000 1 Channel RAID Controller
- 001f AHA-2940U2/U2W / 7890/7891
- 9005 000f 2940U2W SCSI Controller
- 9005 a180 2940U2W SCSI Controller
- 0020 AIC-7890
- 002f AIC-7890
- 0030 AIC-7890
- 003f AIC-7890
- 0050 AHA-3940U2x/395U2x
- 9005 f500 AHA-3950U2B
- 0051 AHA-3950U2D
- 9005 b500 AHA-3950U2D
- 0053 AIC-7896 SCSI Controller
- 9005 ffff AIC-7896 SCSI Controller mainboard implementation
- 005f AIC-7896U2/7897U2
- 0080 AIC-7892A U160/m
- 0e11 e2a0 Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter
- 9005 62a0 29160N Ultra160 SCSI Controller
- 9005 e220 29160LP Low Profile Ultra160 SCSI Controller
- 9005 e2a0 29160 Ultra160 SCSI Controller
- 0081 AIC-7892B U160/m
- 9005 62a1 19160 Ultra160 SCSI Controller
- 0083 AIC-7892D U160/m
- 008f AIC-7892P U160/m
- 1179 0001 Magnia Z310
- 15d9 9005 Onboard SCSI Host Adapter
- 00c0 AHA-3960D / AIC-7899A U160/m
- 0e11 f620 Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter
- 9005 f620 AHA-3960D U160/m
- 00c1 AIC-7899B U160/m
- 00c3 AIC-7899D U160/m
- 00c5 RAID subsystem HBA
- 1028 00c5 PowerEdge 2550
- 00cf AIC-7899P U160/m
- 1028 00d1 PowerEdge 2550
- 10f1 2462 Thunder K7 S2462
- 15d9 9005 Onboard SCSI Host Adapter
- 0250 ServeRAID Controller
- 1014 0279 ServeRAID-xx
- 1014 028c ServeRAID-xx
- 0285 AAC-RAID
- 1028 0287 PowerEdge Expandable RAID Controller 320/DC
- 8000 ASC-29320A U320
- 800f AIC-7901 U320
- 8010 ASC-39320 U320
- 8011 ASC-32320D U320
- 0e11 00ac U320
- 9005 0041 ASC-39320D U320
- 8012 ASC-29320 U320
- 8013 ASC-29320B U320
- 8014 ASC-29320LP U320
- 801e AIC-7901A U320
- 801f AIC-7902 U320
- 8080 ASC-29320A U320 w/HostRAID
- 808f AIC-7901 U320 w/HostRAID
- 8090 ASC-39320 U320 w/HostRAID
- 8091 ASC-39320D U320 w/HostRAID
- 8092 ASC-29320 U320 w/HostRAID
- 8093 ASC-29320B U320 w/HostRAID
- 8094 ASC-29320LP U320 w/HostRAID
- 8095 ASC-39320(B) U320 w/HostRAID
- 8096 ASC-39320A U320 w/HostRAID
- 8097 ASC-29320ALP U320 w/HostRAID
- 809c ASC-39320D(B) U320 w/HostRAID
- 809d AIC-7902(B) U320 w/HostRAID
- 809e AIC-7901A U320 w/HostRAID
- 809f AIC-7902 U320 w/HostRAID
-907f Atronics
- 2015 IDE-2015PL
-919a Gigapixel Corp
-9412 Holtek
- 6565 6565
-9699 Omni Media Technology Inc
- 6565 6565
-9710 NetMos Technology
- 9815 VScom 021H-EP2 2 port parallel adaptor
- 9835 222N-2 I/O Card (2S+1P)
-a0a0 AOPEN Inc.
-a0f1 UNISYS Corporation
-a200 NEC Corporation
-a259 Hewlett Packard
-a25b Hewlett Packard GmbH PL24-MKT
-a304 Sony
-a727 3Com Corporation
-aa42 Scitex Digital Video
-ac1e Digital Receiver Technology Inc
-b1b3 Shiva Europe Limited
-# Pinnacle should be 11bd, but they got it wrong several times --mj
-bd11 Pinnacle Systems, Inc. (Wrong ID)
-c001 TSI Telsys
-c0a9 Micron/Crucial Technology
-c0de Motorola
-c0fe Motion Engineering, Inc.
-ca50 Varian Australia Pty Ltd
-cafe Chrysalis-ITS
-cccc Catapult Communications
-cddd Tyzx, Inc.
- 0101 DeepSea 1 High Speed Stereo Vision Frame Grabber
- 0200 DeepSea 2 High Speed Stereo Vision Frame Grabber
-d4d4 Dy4 Systems Inc
- 0601 PCI Mezzanine Card
-d531 I+ME ACTIA GmbH
-d84d Exsys
-dead Indigita Corporation
-e000 Winbond
- e000 W89C940
-e159 Tiger Jet Network Inc.
- 0001 Intel 537
- 0059 0001 128k ISDN-S/T Adapter
- 0059 0003 128k ISDN-U Adapter
- 0002 Tiger100APC ISDN chipset
-e4bf EKF Elektronik GmbH
-ea01 Eagle Technology
-# The main chip of all these devices is by Xilinx -> It could also be a Xilinx ID.
-ea60 RME
- 9896 Digi32
- 9897 Digi32 Pro
- 9898 Digi32/8
-eabb Aashima Technology B.V.
-eace Endace Measurement Systems, Ltd
- 3100 DAG 3.10 OC-3/OC-12
- 3200 DAG 3.2x OC-3/OC-12
- 320e DAG 3.2E Fast Ethernet
- 340e DAG 3.4E Fast Ethernet
- 341e DAG 3.41E Fast Ethernet
- 3500 DAG 3.5 OC-3/OC-12
- 351c DAG 3.5ECM Fast Ethernet
- 4100 DAG 4.10 OC-48
- 4110 DAG 4.11 OC-48
- 4220 DAG 4.2 OC-48
- 422e DAG 4.2E Dual Gigabit Ethernet
-ec80 Belkin Corporation
- ec00 F5D6000
-ecc0 Echo Digital Audio Corporation
- 0050 Gina24_301
- 0051 Gina24_361
- 0060 Layla24
- 0070 Mona_301_80
- 0071 Mona_301_66
- 0072 Mona_361
- 0080 Mia
-edd8 ARK Logic Inc
- a091 1000PV [Stingray]
- a099 2000PV [Stingray]
- a0a1 2000MT
- a0a9 2000MI
-f1d0 AJA Video
-# All boards I have seen have this ID not efac, though all docs say efac...
- cafe KONA SD SMPTE 259M I/O
- efac KONA SD SMPTE 259M I/O
- facd KONA HD SMPTE 292M I/O
-fa57 Fast Search & Transfer ASA
-febd Ultraview Corp.
-feda Broadcom Inc (nee Epigram)
- a0fa BCM4210 iLine10 HomePNA 2.0
- a10e BCM4230 iLine10 HomePNA 2.0
-fffe VMWare Inc
- 0710 Virtual SVGA
-ffff Illegal Vendor ID
-
-
-# List of known device classes, subclasses and programming interfaces
-
-# Syntax:
-# C class class_name
-# subclass subclass_name <-- single tab
-# prog-if prog-if_name <-- two tabs
-
-C 00 Unclassified device
- 00 Non-VGA unclassified device
- 01 VGA compatible unclassified device
-C 01 Mass storage controller
- 00 SCSI storage controller
- 01 IDE interface
- 02 Floppy disk controller
- 03 IPI bus controller
- 04 RAID bus controller
- 80 Unknown mass storage controller
-C 02 Network controller
- 00 Ethernet controller
- 01 Token ring network controller
- 02 FDDI network controller
- 03 ATM network controller
- 04 ISDN controller
- 80 Network controller
-C 03 Display controller
- 00 VGA compatible controller
- 00 VGA
- 01 8514
- 01 XGA compatible controller
- 02 3D controller
- 80 Display controller
-C 04 Multimedia controller
- 00 Multimedia video controller
- 01 Multimedia audio controller
- 02 Computer telephony device
- 80 Multimedia controller
-C 05 Memory controller
- 00 RAM memory
- 01 FLASH memory
- 80 Memory controller
-C 06 Bridge
- 00 Host bridge
- 01 ISA bridge
- 02 EISA bridge
- 03 MicroChannel bridge
- 04 PCI bridge
- 00 Normal decode
- 01 Subtractive decode
- 05 PCMCIA bridge
- 06 NuBus bridge
- 07 CardBus bridge
- 08 RACEway bridge
- 00 Transparent mode
- 01 Endpoint mode
- 09 Semi-transparent PCI-to-PCI bridge
- 40 Primary bus towards host CPU
- 80 Secondary bus towards host CPU
- 0a InfiniBand to PCI host bridge
- 80 Bridge
-C 07 Communication controller
- 00 Serial controller
- 00 8250
- 01 16450
- 02 16550
- 03 16650
- 04 16750
- 05 16850
- 06 16950
- 01 Parallel controller
- 00 SPP
- 01 BiDir
- 02 ECP
- 03 IEEE1284
- fe IEEE1284 Target
- 02 Multiport serial controller
- 03 Modem
- 00 Generic
- 01 Hayes/16450
- 02 Hayes/16550
- 03 Hayes/16650
- 04 Hayes/16750
- 80 Communication controller
-C 08 Generic system peripheral
- 00 PIC
- 00 8259
- 01 ISA PIC
- 02 EISA PIC
- 10 IO-APIC
- 20 IO(X)-APIC
- 01 DMA controller
- 00 8237
- 01 ISA DMA
- 02 EISA DMA
- 02 Timer
- 00 8254
- 01 ISA Timer
- 02 EISA Timers
- 03 RTC
- 00 Generic
- 01 ISA RTC
- 04 PCI Hot-plug controller
- 80 System peripheral
-C 09 Input device controller
- 00 Keyboard controller
- 01 Digitizer Pen
- 02 Mouse controller
- 03 Scanner controller
- 04 Gameport controller
- 00 Generic
- 10 Extended
- 80 Input device controller
-C 0a Docking station
- 00 Generic Docking Station
- 80 Docking Station
-C 0b Processor
- 00 386
- 01 486
- 02 Pentium
- 10 Alpha
- 20 Power PC
- 30 MIPS
- 40 Co-processor
-C 0c Serial bus controller
- 00 FireWire (IEEE 1394)
- 00 Generic
- 10 OHCI
- 01 ACCESS Bus
- 02 SSA
- 03 USB Controller
- 00 UHCI
- 10 OHCI
- 20 EHCI
- 80 Unspecified
- fe USB Device
- 04 Fibre Channel
- 05 SMBus
- 06 InfiniBand
-C 0d Wireless controller
- 00 IRDA controller
- 01 Consumer IR controller
- 10 RF controller
- 80 Wireless controller
-C 0e Intelligent controller
- 00 I2O
-C 0f Satellite communications controller
- 00 Satellite TV controller
- 01 Satellite audio communication controller
- 03 Satellite voice communication controller
- 04 Satellite data communication controller
-C 10 Encryption controller
- 00 Network and computing encryption device
- 10 Entertainment encryption device
- 80 Encryption controller
-C 11 Signal processing controller
- 00 DPIO module
- 01 Performance counters
- 10 Communication synchronizer
- 80 Signal processing controller
diff --git a/hw/xfree86/scanpci/pciid2c.pl b/hw/xfree86/scanpci/pciid2c.pl
deleted file mode 100644
index 71586d421..000000000
--- a/hw/xfree86/scanpci/pciid2c.pl
+++ /dev/null
@@ -1,387 +0,0 @@
-#!/usr/bin/perl
-
-# Automatically generate the data structures for PCI vendor/device lists
-# from the pci.ids file.
-#
-# It should be run as:
-#
-# perl pciid2c.pl ../common/xf86PciInfo.h < pci.ids > xf86PciIds.h
-#
-#
-# Copyright © 2002 by The XFree86 Project, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the copyright holder(s)
-# and author(s) shall not be used in advertising or otherwise to promote
-# the sale, use or other dealings in this Software without prior written
-# authorization from the copyright holder(s) and author(s).
-#
-
-#
-# Author: David Dawes
-#
-# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.3 2003/08/24 17:37:10 dawes Exp $
-#
-
-if (@ARGV[0]) {
- $infofile = @ARGV[0];
-}
-
-#
-# The basic pci.ids format is:
-# - Vendor lines start with four (lower case) hex digits
-# - Device lines start with one tab followed by four hex digits
-# - Subsystem lines start with two tabs followed by two sets of four
-# hex digits.
-# - Class overrides for devices start with two tabs followed by a "C",
-# followed by four hex digits with the class/subclass value.
-# - Class lines start with a "C".
-# - Comment lines start with a '#'.
-# - Blank lines are ignored.
-#
-# We allow for extra lines to be appended to modify existing entries or
-# add new ones. To add/modify Device entries without modifying the
-# Vendor name, a special vendor name of '"' is used (mnemonic: "ditto").
-# Similarly for adding subsystem names without modifying (or adding)
-# a corresponding device entry. To rename an existing entry, simply
-# provide the new name. To remove an existing entry, use the special
-# name '-'.
-#
-
-while (<STDIN>) {
- # Process data lines
- if (/^([0-9a-f]{4})\s+(.*)/) {
- $vendor = $1;
- if ($2 eq '-') {
- delete($vendors{$vendor});
- } elsif ($2 ne '"') {
- $vendors{$vendor} = $2;
- # Remove " characters
- $vendors{$vendor} =~ s/"//g;
- # Remove multiple "?" sequences to avoid trigraphs
- $vendors{$vendor} =~ s/\?+/\?/g;
- }
- } elsif (/^\t([0-9a-f]{4})\s+(.*)/) {
- $device = $1;
- if ($2 eq '-') {
- delete($devices{$vendor}{$device});
- } elsif ($2 ne '"') {
- $devices{$vendor}{$device} = $2;
- # Remove " characters
- $devices{$vendor}{$device} =~ s/"//g;
- # Remove multiple "?" sequences to avoid trigraphs
- $devices{$vendor}{$device} =~ s/\?+/\?/g;
- }
- } elsif (/^\t\t([0-9a-f]{4})\s+([0-9a-f]{4})\s+(.*)/) {
- $v = $1;
- $s = $2;
- if ($3 eq '-') {
- delete($subsystems{$v}{$s});
- delete($devsubsystems{$vendor}{$device}{"$v-$s"});
- } elsif ($3 ne '"') {
- if ($subsystems{$v}{$s}) {
- #print STDERR "Duplicate subsytem: $v, $s, \"$subsystems{$v}{$s}\", \"$3\"\n";
- }
- $subsystems{$v}{$s} = $3;
- # Remove " characters
- $subsystems{$v}{$s} =~ s/"//g;
- # Remove multiple "?" sequences to avoid trigraphs
- $subsystems{$v}{$s} =~ s/\?+/\?/g;
- $devsubsystems{$vendor}{$device}{"$v-$s"} = $subsystems{$v}{$s};
- }
- } elsif (/^\t\tC\s+([0-9a-f]{4})/) {
- $classes{$vendor}{$device} = $1;
- }
- # Ignore all other lines.
-}
-
-# Find which vendors are "video" vendors.
-if ($infofile) {
- open(INFO, "<$infofile") || die "Can't open $infofile";
- while (<INFO>) {
- if (/^#define\s+PCI_VENDOR_.*0x([0-9a-fA-F]{4})/) {
- $vendor = $1;
- $vendor =~ tr/A-F/a-f/;
- $video{$vendor} = 1;
- }
- }
-}
-
-#
-# This layout is quite different from that used in the old xf86PciInfo.h
-# file. One main difference is that the list is initialised at runtime.
-# It's currently a flat list. This could be improved.
-#
-
-# Print out header information.
-
-$proj = "XFree86";
-print "/* \$$proj\$ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
- *
- * It is generated by pciid2c.pl using data from the following files:
- *
- * ../etc/pci.ids
- * ../etc/extrapci.ids
- * ../common/xf86PciInfo.h
- */
-
-/*
- * Copyright © 2002 by the XFree86 Project, Inc.
- *
- * The pci.ids file and the data it contains are from the Linux PCI ID's
- * Project (http://pciids.sf.net/). It is maintained by Martin Mares
- * <mj\@ucw.cz> and other volunteers. The pci.ids file contains no
- * copyright notice.
- */
-
-#include \"xf86PciInfo.h\"
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
-";
-
-# The following #ifdefs are used:
-# - INIT_SUBSYS_INFO -- initialise subsystem data
-# - INIT_VENDOR_SUBSYS_INFO -- initialise a vendor<->subsystem table.
-# - VENDOR_INCLUDE_NONVIDEO -- include data for non-video vendors.
-
-# Define static variables with all of the strings.
-
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- print "static const char pci_vendor_${vendor}[] = \"$vendors{$vendor}\";\n";
- foreach $device (sort keys %{$devices{$vendor}}) {
- print "static const char pci_device_${vendor}_${device}[] = " .
- "\"$devices{$vendor}{$device}\";\n";
- foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
- $s = $subsys;
- ($v) = split /-/, $s;
- if ($infofile && !$video{$vendor} && $video{$v}) {
- print "#endif\n";
- }
- $s =~ s/-/_/;
- print "#ifdef INIT_SUBSYS_INFO\n";
- print "static const char pci_subsys_${vendor}_${device}_${s}[] = " .
- "\"$devsubsystems{$vendor}{$device}{$subsys}\";\n";
- print "#endif\n";
- if ($infofile && !$video{$vendor} && $video{$v}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- }
- }
- if ($infofile && !$video{$vendor}) {
- print "#endif\n";
- }
-}
-
-
-# Pre-initialise the table structures (from the inner to the outer).
-
-# First, the subsys structures.
-
-print "#ifdef INIT_SUBSYS_INFO\n";
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- } else {
- undef($pre);
- undef($post);
- }
- foreach $device (sort keys %{$devices{$vendor}}) {
- foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
- $s = $subsys;
- $s =~ tr/-/_/;
- ($vid, $sid) = split /_/, $s;
- if ($pre) {
- print $pre;
- undef($pre);
- $post = "#endif\n";
- }
- if ($infofile && !$video{$vendor} && $video{$vid}) {
- print "#endif\n";
- }
- print "static const pciSubsystemInfo " .
- "pci_ss_info_${vendor}_${device}_$s =\n";
- print "\t{0x$vid, 0x$sid, pci_subsys_${vendor}_${device}_$s, 0};\n";
- print "#undef pci_ss_info_$s\n";
- print "#define pci_ss_info_$s pci_ss_info_${vendor}_${device}_$s\n";
- if ($infofile && !$video{$vendor} && $video{$vid}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- }
- }
- if ($post) {
- print $post;
- undef($post);
- }
-}
-
-# Next, the list of per vendor+device subsystem arrays
-
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- } else {
- undef($pre);
- undef($post);
- }
- foreach $device (sort keys %{$devices{$vendor}}) {
- if (scalar(keys %{$devsubsystems{$vendor}{$device}}) > 0) {
- if ($pre) {
- print $pre;
- undef($pre);
- $post = "#endif\n";
- }
- print "static const pciSubsystemInfo *pci_ss_list_${vendor}_${device}[] = {\n";
- foreach $sub (sort keys %{$devsubsystems{$vendor}{$device}}) {
- $sub =~ s/-/_/;
- print "\t&pci_ss_info_${vendor}_${device}_${sub},\n";
- }
- print "\tNULL\n};\n";
- } else {
- print "#define pci_ss_list_${vendor}_${device} NULL\n";
- }
- }
- if ($post) {
- print $post;
- undef($post);
- }
-}
-
-# Next, the list of per vendor subsystem arrays
-
-print "#ifdef INIT_VENDOR_SUBSYS_INFO\n";
-foreach $vendor (sort keys %vendors) {
- if (scalar(keys %{$subsystems{$vendor}}) > 0) {
- if ($infofile && !$video{$vendor}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- print "static const pciSubsystemInfo *pci_ss_list_${vendor}[] = {\n";
- foreach $sub (sort keys %{$subsystems{$vendor}}) {
- print "\t&pci_ss_info_${vendor}_${sub},\n";
- }
- print "\tNULL\n};\n";
- if ($infofile && !$video{$vendor}) {
- print "#endif\n";
- }
- } else {
- print "#define pci_ss_list_${vendor} NULL\n";
- }
-}
-print "#endif /* INIT_VENDOR_SUBSYS_INFO */\n";
-print "#endif /* INIT_SUBSYS_INFO */\n";
-
-# Next the device structures
-
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- } else {
- undef($pre);
- undef($post);
- }
- foreach $device (sort keys %{$devices{$vendor}}) {
- if ($pre) {
- print $pre;
- undef($pre);
- $post = "#endif\n";
- }
- if ($classes{$vendor}{$device}) {
- $class = "0x$classes{$vendor}{$device}";
- } else {
- $class = "0";
- }
- print "static const pciDeviceInfo " .
- "pci_dev_info_${vendor}_${device} = {\n";
- print "\t0x$device, pci_device_${vendor}_${device},\n";
- print "#ifdef INIT_SUBSYS_INFO\n";
- print "\tpci_ss_list_${vendor}_${device},\n";
- print "#else\n";
- print "\tNULL,\n";
- print "#endif\n";
- print "\t$class\n};\n";
- }
- if ($post) {
- print $post;
- undef($post);
- }
-}
-
-# Next, the list of per vendor device arrays
-
-foreach $vendor (sort keys %vendors) {
- if (scalar(keys %{$devices{$vendor}}) > 0) {
- if ($infofile && !$video{$vendor}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- print "static const pciDeviceInfo *pci_dev_list_${vendor}[] = {\n";
- foreach $device (sort keys %{$devices{$vendor}}) {
- print "\t&pci_dev_info_${vendor}_${device},\n";
- }
- print "\tNULL\n};\n";
- if ($infofile && !$video{$vendor}) {
- print "#endif\n";
- }
- } else {
- print "#define pci_dev_list_${vendor} NULL\n";
- }
-}
-
-# Next, the main vendor list
-
-print "
-static const pciVendorInfo pciVendorInfoList[] = {
-";
-
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- print "\t{0x$vendor, pci_vendor_$vendor, pci_dev_list_$vendor},\n";
- if ($infofile && !$video{$vendor}) {
- print "#endif\n";
- }
-}
-print "\t{0x0000, NULL, NULL}\n};\n";
-
-# Finally, the main vendor/subsystem list
-
-print "
-#if defined(INIT_VENDOR_SUBSYS_INFO) && defined(INIT_SUBSYS_INFO)
-static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
-";
-
-foreach $vendor (sort keys %vendors) {
- if ($infofile && !$video{$vendor}) {
- print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
- }
- print "\t{0x$vendor, pci_vendor_$vendor, pci_ss_list_$vendor},\n";
- if ($infofile && !$video{$vendor}) {
- print "#endif\n";
- }
-}
-print "\t{0x0000, NULL, NULL}\n};\n";
-print "#endif\n";
diff --git a/hw/xfree86/scanpci/xf86PciData.h b/hw/xfree86/scanpci/xf86PciData.h
deleted file mode 100644
index 2253de8e5..000000000
--- a/hw/xfree86/scanpci/xf86PciData.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
-
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef PCI_DATA_H_
-#define PCI_DATA_H_
-
-#define NOVENDOR 0xFFFF
-#define NODEVICE 0xFFFF
-#define NOSUBSYS 0xFFFF
-
-typedef Bool (*ScanPciSetupProcPtr)(void);
-typedef void (*ScanPciCloseProcPtr)(void);
-typedef int (*ScanPciFindByDeviceProcPtr)(
- unsigned short vendor, unsigned short device,
- unsigned short svendor, unsigned short subsys,
- const char **vname, const char **dname,
- const char **svname, const char **sname);
-typedef int (*ScanPciFindBySubsysProcPtr)(
- unsigned short svendor, unsigned short subsys,
- const char **svname, const char **sname);
-typedef CARD32 (*ScanPciFindClassBySubsysProcPtr)(
- unsigned short vendor, unsigned short subsystem);
-typedef CARD32 (*ScanPciFindClassByDeviceProcPtr)(
- unsigned short vendor, unsigned short device);
-
-/*
- * Whoever loads this module needs to define these and initialise them
- * after loading.
- */
-extern ScanPciSetupProcPtr xf86SetupPciIds;
-extern ScanPciCloseProcPtr xf86ClosePciIds;
-extern ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice;
-extern ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys;
-extern ScanPciFindClassBySubsysProcPtr xf86FindPciClassBySubsys;
-extern ScanPciFindClassByDeviceProcPtr xf86FindPciClassByDevice;
-
-Bool ScanPciSetupPciIds(void);
-void ScanPciClosePciIds(void);
-int ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
- unsigned short svendor, unsigned short subsys,
- const char **vname, const char **dname,
- const char **svname, const char **sname);
-int ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
- const char **svname, const char **sname);
-CARD32 ScanPciFindPciClassBySubsys(unsigned short vendor,
- unsigned short subsystem);
-CARD32 ScanPciFindPciClassByDevice(unsigned short vendor,
- unsigned short device);
-
-#endif
diff --git a/hw/xfree86/scanpci/xf86PciStdIds.h b/hw/xfree86/scanpci/xf86PciStdIds.h
deleted file mode 100644
index ff8f3d14a..000000000
--- a/hw/xfree86/scanpci/xf86PciStdIds.h
+++ /dev/null
@@ -1,82421 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.14 2003/10/30 15:26:34 tsi Exp $ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
- *
- * It is generated by pciid2c.pl using data from the following files:
- *
- * ../etc/pci.ids
- * ../etc/extrapci.ids
- * ../common/xf86PciInfo.h
- */
-
-/*
- * Copyright © 2002 by the XFree86 Project, Inc.
- *
- * The pci.ids file and the data it contains are from the Linux PCI ID's
- * Project (http://pciids.sf.net/). It is maintained by Martin Mares
- * <mj@ucw.cz> and other volunteers. The pci.ids file contains no
- * copyright notice.
- */
-
-#include "xf86PciInfo.h"
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0000[] = "Gammagraphx, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_001a[] = "Ascend Communications, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0033[] = "Paradyne corp.";
-#endif
-static const char pci_vendor_003d[] = "Lockheed Martin-Marietta Corp";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0059[] = "Tiger Jet Network Inc. (Wrong ID)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0070[] = "Hauppauge computer works Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0100[] = "Ncipher Corp Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0675[] = "Dynalink";
-static const char pci_device_0675_1700[] = "IS64PH ISDN Adapter";
-static const char pci_device_0675_1702[] = "IS64PH ISDN Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0925[] = "VIA Technologies, Inc. (Wrong ID)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_09c1[] = "Arris";
-static const char pci_device_09c1_0704[] = "CM 200E Cable Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0a89[] = "BREA Technologies Inc";
-#endif
-static const char pci_vendor_0e11[] = "Compaq Computer Corporation";
-static const char pci_device_0e11_0001[] = "PCI to EISA Bridge";
-static const char pci_device_0e11_0002[] = "PCI to ISA Bridge";
-static const char pci_device_0e11_0049[] = "NC7132 Gigabit Upgrade Module";
-static const char pci_device_0e11_004a[] = "NC6136 Gigabit Server Adapter";
-static const char pci_device_0e11_0508[] = "Netelligent 4/16 Token Ring";
-static const char pci_device_0e11_1000[] = "Triflex/Pentium Bridge, Model 1000";
-static const char pci_device_0e11_2000[] = "Triflex/Pentium Bridge, Model 2000";
-static const char pci_device_0e11_3032[] = "QVision 1280/p";
-static const char pci_device_0e11_3033[] = "QVision 1280/p";
-static const char pci_device_0e11_3034[] = "QVision 1280/p";
-static const char pci_device_0e11_4000[] = "4000 [Triflex]";
-static const char pci_device_0e11_6010[] = "HotPlug PCI Bridge 6010";
-static const char pci_device_0e11_7020[] = "USB Controller";
-static const char pci_device_0e11_a0ec[] = "Fibre Channel Host Controller";
-static const char pci_device_0e11_a0f0[] = "Advanced System Management Controller";
-static const char pci_device_0e11_a0f3[] = "Triflex PCI to ISA Bridge";
-static const char pci_device_0e11_a0f7[] = "PCI Hotplug Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_a0f7_8086_002a[] = "PCI Hotplug Controller A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_a0f7_8086_002b[] = "PCI Hotplug Controller B";
-#endif
-static const char pci_device_0e11_a0f8[] = "ZFMicro Chipset USB";
-static const char pci_device_0e11_a0fc[] = "Fibre Channel Host Controller";
-static const char pci_device_0e11_ae10[] = "Smart-2/P RAID Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_ae10_0e11_4030[] = "Smart-2/P Array Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_ae10_0e11_4031[] = "Smart-2SL Array Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_ae10_0e11_4032[] = "Smart Array Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_0e11_ae10_0e11_4033[] = "Smart 3100ES Array Controller";
-#endif
-static const char pci_device_0e11_ae29[] = "MIS-L";
-static const char pci_device_0e11_ae2a[] = "MPC";
-static const char pci_device_0e11_ae2b[] = "MIS-E";
-static const char pci_device_0e11_ae31[] = "System Management Controller";
-static const char pci_device_0e11_ae32[] = "Netelligent 10/100";
-static const char pci_device_0e11_ae33[] = "Triflex Dual EIDE Controller";
-static const char pci_device_0e11_ae34[] = "Netelligent 10";
-static const char pci_device_0e11_ae35[] = "Integrated NetFlex-3/P";
-static const char pci_device_0e11_ae40[] = "Netelligent 10/100 Dual";
-static const char pci_device_0e11_ae43[] = "ProLiant Integrated Netelligent 10/100";
-static const char pci_device_0e11_ae69[] = "CETUS-L";
-static const char pci_device_0e11_ae6c[] = "Northstar";
-static const char pci_device_0e11_ae6d[] = "NorthStar CPU to PCI Bridge";
-static const char pci_device_0e11_b011[] = "Integrated Netelligent 10/100";
-static const char pci_device_0e11_b012[] = "Netelligent 10 T/2";
-static const char pci_device_0e11_b01e[] = "NC3120 Fast Ethernet NIC";
-static const char pci_device_0e11_b01f[] = "NC3122 Fast Ethernet NIC";
-static const char pci_device_0e11_b02f[] = "NC1120 Ethernet NIC";
-static const char pci_device_0e11_b030[] = "Netelligent WS 5100";
-static const char pci_device_0e11_b04a[] = "10/100 TX PCI Intel WOL UTP Controller";
-static const char pci_device_0e11_b060[] = "Smart Array 5300 Controller";
-static const char pci_device_0e11_b0c6[] = "NC3161 Fast Ethernet NIC";
-static const char pci_device_0e11_b0c7[] = "NC3160 Fast Ethernet NIC";
-static const char pci_device_0e11_b0d7[] = "NC3121 Fast Ethernet NIC";
-static const char pci_device_0e11_b0dd[] = "NC3131 Fast Ethernet NIC";
-static const char pci_device_0e11_b0de[] = "NC3132 Fast Ethernet Module";
-static const char pci_device_0e11_b0df[] = "NC6132 Gigabit Module";
-static const char pci_device_0e11_b0e0[] = "NC6133 Gigabit Module";
-static const char pci_device_0e11_b0e1[] = "NC3133 Fast Ethernet Module";
-static const char pci_device_0e11_b123[] = "NC6134 Gigabit NIC";
-static const char pci_device_0e11_b134[] = "NC3163 Fast Ethernet NIC";
-static const char pci_device_0e11_b13c[] = "NC3162 Fast Ethernet NIC";
-static const char pci_device_0e11_b144[] = "NC3123 Fast Ethernet NIC";
-static const char pci_device_0e11_b163[] = "NC3134 Fast Ethernet NIC";
-static const char pci_device_0e11_b164[] = "NC3165 Fast Ethernet Upgrade Module";
-static const char pci_device_0e11_b178[] = "Smart Array 5i/532";
-static const char pci_device_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
-static const char pci_device_0e11_f130[] = "NetFlex-3/P ThunderLAN 1.0";
-static const char pci_device_0e11_f150[] = "NetFlex-3/P ThunderLAN 2.3";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_0e55[] = "HaSoTec GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1000[] = "LSI Logic / Symbios Logic";
-static const char pci_device_1000_0001[] = "53c810";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0001_1000_1000[] = "8100S";
-#endif
-static const char pci_device_1000_0002[] = "53c820";
-static const char pci_device_1000_0003[] = "53c825";
-static const char pci_device_1000_0004[] = "53c815";
-static const char pci_device_1000_0005[] = "53c810AP";
-static const char pci_device_1000_0006[] = "53c860";
-static const char pci_device_1000_000a[] = "53c1510";
-static const char pci_device_1000_000b[] = "53c896";
-static const char pci_device_1000_000c[] = "53c895";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_000c_1de1_3907[] = "DC-390U2W";
-#endif
-static const char pci_device_1000_000d[] = "53c885";
-static const char pci_device_1000_000f[] = "53c875";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_000f_0e11_7004[] = "Embedded Ultra Wide SCSI Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_000f_1092_8760[] = "FirePort 40 Dual SCSI Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_000f_1de1_3904[] = "DC390F Ultra Wide SCSI Controller";
-#endif
-static const char pci_device_1000_0010[] = "53c895";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0010_0e11_4040[] = "Integrated Array Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0010_0e11_4048[] = "Integrated Array Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1000_0012[] = "53c895a";
-static const char pci_device_1000_0013[] = "53c875a";
-static const char pci_device_1000_0020[] = "53c1010 Ultra3 SCSI Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0020_1de1_1020[] = "DC-390U3W";
-#endif
-static const char pci_device_1000_0021[] = "53c1010 66MHz Ultra3 SCSI Adapter";
-static const char pci_device_1000_0030[] = "53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0030_1028_1010[] = "LSI U320 SCSI Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1000_0040[] = "53c1035";
-static const char pci_device_1000_008f[] = "53c875J";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_008f_1092_8000[] = "FirePort 40 SCSI Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_008f_1092_8760[] = "FirePort 40 Dual SCSI Host Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1000_0621[] = "FC909";
-static const char pci_device_1000_0622[] = "FC929";
-static const char pci_device_1000_0623[] = "FC929 LAN";
-static const char pci_device_1000_0624[] = "FC919";
-static const char pci_device_1000_0625[] = "FC919 LAN";
-static const char pci_device_1000_0626[] = "FC929X";
-static const char pci_device_1000_0627[] = "FC929X LAN";
-static const char pci_device_1000_0628[] = "FC919X";
-static const char pci_device_1000_0629[] = "FC919X LAN";
-static const char pci_device_1000_0701[] = "83C885 NT50 DigitalScape Fast Ethernet";
-static const char pci_device_1000_0702[] = "Yellowfin G-NIC gigabit ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_0702_1318_0000[] = "PEI100X";
-#endif
-static const char pci_device_1000_0901[] = "61C102";
-static const char pci_device_1000_1000[] = "63C815";
-static const char pci_device_1000_1960[] = "PowerEdge Expandable RAID Controller 4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_1960_1028_0518[] = "PowerEdge Expandable RAID Controller 4/DC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_1960_1028_0520[] = "PowerEdge Expandable RAID Controller 4/SC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1000_1960_1028_0531[] = "PowerEdge Expandable RAID Controller 4/QC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1001[] = "Kolter Electronic";
-static const char pci_device_1001_0010[] = "PCI 1616 Measurement card with 32 digital I/O lines";
-static const char pci_device_1001_0011[] = "OPTO-PCI Opto-Isolated digital I/O board";
-static const char pci_device_1001_0012[] = "PCI-AD/DA Analogue I/O board";
-static const char pci_device_1001_0013[] = "PCI-OPTO-RELAIS Digital I/O board with relay outputs";
-static const char pci_device_1001_0014[] = "PCI-Counter/Timer Counter Timer board";
-static const char pci_device_1001_0015[] = "PCI-DAC416 Analogue output board";
-static const char pci_device_1001_0016[] = "PCI-MFB Analogue I/O board";
-static const char pci_device_1001_0017[] = "PROTO-3 PCI Prototyping board";
-static const char pci_device_1001_9100[] = "INI-9100/9100W SCSI Host";
-#endif
-static const char pci_vendor_1002[] = "ATI Technologies Inc";
-static const char pci_device_1002_4136[] = "Radeon IGP 320 M";
-static const char pci_device_1002_4144[] = "Radeon R300 AD [Radeon 9500 Pro]";
-static const char pci_device_1002_4145[] = "Radeon R300 AE [Radeon 9500 Pro]";
-static const char pci_device_1002_4146[] = "Radeon R300 AF [Radeon 9500 Pro]";
-static const char pci_device_1002_4147[] = "Radeon R300 AG [FireGL Z1/X1]";
-static const char pci_device_1002_4158[] = "68800AX [Mach32]";
-static const char pci_device_1002_4242[] = "Radeon R200 BB [Radeon All in Wonder 8500DV]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4242_1002_02aa[] = "Radeon 8500 AIW DV Edition";
-#endif
-static const char pci_device_1002_4336[] = "Radeon Mobility U1";
-static const char pci_device_1002_4337[] = "Radeon IGP 340M";
-static const char pci_device_1002_4354[] = "215CT [Mach64 CT]";
-static const char pci_device_1002_4358[] = "210888CX [Mach64 CX]";
-static const char pci_device_1002_4554[] = "210888ET [Mach64 ET]";
-static const char pci_device_1002_4654[] = "Mach64 VT";
-static const char pci_device_1002_4742[] = "3D Rage Pro AGP 1X/2X";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0040[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0044[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0061[] = "Rage Pro AIW AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0062[] = "Rage Pro AIW AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0063[] = "Rage Pro AIW AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0080[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_0084[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_4742[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1002_8001[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1028_0082[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1028_4082[] = "Optiplex GX1 Onboard Display Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1028_8082[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_1028_c082[] = "Rage Pro Turbo AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_8086_4152[] = "Xpert 98D AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4742_8086_464a[] = "Rage Pro Turbo AGP 2X";
-#endif
-static const char pci_device_1002_4744[] = "3D Rage Pro AGP 1X";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4744_1002_4744[] = "Rage Pro Turbo AGP";
-#endif
-static const char pci_device_1002_4747[] = "3D Rage Pro";
-static const char pci_device_1002_4749[] = "3D Rage Pro";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4749_1002_0061[] = "Rage Pro AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4749_1002_0062[] = "Rage Pro AIW";
-#endif
-static const char pci_device_1002_474c[] = "Rage XC";
-static const char pci_device_1002_474d[] = "Rage XL AGP 2X";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1002_0004[] = "Xpert 98 RXL AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1002_0008[] = "Xpert 98 RXL AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1002_0080[] = "Rage XL AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1002_0084[] = "Xpert 98 AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1002_474d[] = "Rage XL AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474d_1033_806a[] = "Rage XL AGP";
-#endif
-static const char pci_device_1002_474e[] = "Rage XC AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474e_1002_474e[] = "Rage XC AGP";
-#endif
-static const char pci_device_1002_474f[] = "Rage XL";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474f_1002_0008[] = "Rage XL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_474f_1002_474f[] = "Rage XL";
-#endif
-static const char pci_device_1002_4750[] = "3D Rage Pro 215GP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4750_1002_0040[] = "Rage Pro Turbo";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4750_1002_0044[] = "Rage Pro Turbo";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4750_1002_0080[] = "Rage Pro Turbo";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4750_1002_0084[] = "Rage Pro Turbo";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4750_1002_4750[] = "Rage Pro Turbo";
-#endif
-static const char pci_device_1002_4751[] = "3D Rage Pro 215GQ";
-static const char pci_device_1002_4752[] = "Rage XL";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4752_1002_0008[] = "Rage XL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4752_1002_4752[] = "Rage XL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4752_1002_8008[] = "Rage XL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4752_1028_00d1[] = "PowerEdge 2550";
-#endif
-static const char pci_device_1002_4753[] = "Rage XC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4753_1002_4753[] = "Rage XC";
-#endif
-static const char pci_device_1002_4754[] = "3D Rage I/II 215GT [Mach64 GT]";
-static const char pci_device_1002_4755[] = "3D Rage II+ 215GTB [Mach64 GTB]";
-static const char pci_device_1002_4756[] = "3D Rage IIC 215IIC [Mach64 GT IIC]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4756_1002_4756[] = "Rage IIC";
-#endif
-static const char pci_device_1002_4757[] = "3D Rage IIC AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4757_1002_4757[] = "Rage IIC AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4757_1028_0089[] = "Rage 3D IIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4757_1028_4082[] = "Rage 3D IIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4757_1028_8082[] = "Rage 3D IIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4757_1028_c082[] = "Rage 3D IIC";
-#endif
-static const char pci_device_1002_4758[] = "210888GX [Mach64 GX]";
-static const char pci_device_1002_4759[] = "3D Rage IIC";
-static const char pci_device_1002_475a[] = "3D Rage IIC AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_475a_1002_0087[] = "Rage 3D IIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_475a_1002_475a[] = "Rage IIC AGP";
-#endif
-static const char pci_device_1002_4964[] = "Radeon R250 Id [Radeon 9000]";
-static const char pci_device_1002_4965[] = "Radeon R250 Ie [Radeon 9000]";
-static const char pci_device_1002_4966[] = "Radeon R250 If [Radeon 9000]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_10f1_0002[] = "R250 If [Tachyon G9000 PRO]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_148c_2039[] = "R250 If [Radeon 9000 Pro Evil Commando]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_1509_9a00[] = "R250 If [Radeon 9000 AT009]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_1681_0040[] = "R250 If [3D prophet 9000]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_174b_7176[] = "R250 If [Sapphire Radeon 9000 Pro]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_174b_7192[] = "R250 If [Radeon 9000 Atlantis]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_17af_2005[] = "R250 If [Excalibur Radeon 9000 Pro]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4966_17af_2006[] = "R250 If [Excalibur Radeon 9000]";
-#endif
-static const char pci_device_1002_4967[] = "Radeon R250 Ig [Radeon 9000]";
-static const char pci_device_1002_496e[] = "Radeon R250 [Radeon 9000] (Secondary)";
-static const char pci_device_1002_4c42[] = "3D Rage LT Pro AGP-133";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_0e11_b0e8[] = "Rage 3D LT Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_0e11_b10e[] = "3D Rage LT Pro (Compaq Armada 1750)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_1002_0040[] = "Rage LT Pro AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_1002_0044[] = "Rage LT Pro AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_1002_4c42[] = "Rage LT Pro AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_1002_8001[] = "Rage LT Pro AGP 2X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c42_1028_0085[] = "Rage 3D LT Pro";
-#endif
-static const char pci_device_1002_4c44[] = "3D Rage LT Pro AGP-66";
-static const char pci_device_1002_4c45[] = "Rage Mobility M3 AGP";
-static const char pci_device_1002_4c46[] = "Rage Mobility M3 AGP 2x";
-static const char pci_device_1002_4c47[] = "3D Rage LT-G 215LG";
-static const char pci_device_1002_4c49[] = "3D Rage LT Pro";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c49_1002_0004[] = "Rage LT Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c49_1002_0040[] = "Rage LT Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c49_1002_0044[] = "Rage LT Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c49_1002_4c49[] = "Rage LT Pro";
-#endif
-static const char pci_device_1002_4c4d[] = "Rage Mobility P/M AGP 2x";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c4d_0e11_b111[] = "Armada M700";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c4d_1002_0084[] = "Xpert 98 AGP 2X (Mobility)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c4d_1014_0154[] = "ThinkPad A20m";
-#endif
-static const char pci_device_1002_4c4e[] = "Rage Mobility L AGP 2x";
-static const char pci_device_1002_4c50[] = "3D Rage LT Pro";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c50_1002_4c50[] = "Rage LT Pro";
-#endif
-static const char pci_device_1002_4c51[] = "3D Rage LT Pro";
-static const char pci_device_1002_4c52[] = "Rage Mobility P/M";
-static const char pci_device_1002_4c53[] = "Rage Mobility L";
-static const char pci_device_1002_4c54[] = "264LT [Mach64 LT]";
-static const char pci_device_1002_4c57[] = "Radeon Mobility M7 LW [Radeon Mobility 7500]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c57_1014_0517[] = "ThinkPad T30";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c57_1028_00e6[] = "Radeon Mobility M7 LW (Dell Inspiron 8100)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c57_144d_c006[] = "Radeon Mobility M7 LW in vpr Matrix 170B4";
-#endif
-static const char pci_device_1002_4c58[] = "Radeon RV200 LX [Mobility FireGL 7800 M7]";
-static const char pci_device_1002_4c59[] = "Radeon Mobility M6 LY";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c59_1014_0235[] = "ThinkPad A30p (2653-64G)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c59_1014_0239[] = "ThinkPad X22/X23/X24";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4c59_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-static const char pci_device_1002_4c5a[] = "Radeon Mobility M6 LZ";
-static const char pci_device_1002_4c64[] = "Radeon R250 Ld [Radeon Mobility 9000 M9]";
-static const char pci_device_1002_4c65[] = "Radeon R250 Le [Radeon Mobility 9000 M9]";
-static const char pci_device_1002_4c66[] = "Radeon R250 Lf [Radeon Mobility 9000 M9]";
-static const char pci_device_1002_4c67[] = "Radeon R250 Lg [Radeon Mobility 9000 M9]";
-static const char pci_device_1002_4d46[] = "Rage Mobility M4 AGP";
-static const char pci_device_1002_4d4c[] = "Rage Mobility M4 AGP";
-static const char pci_device_1002_4e44[] = "Radeon R300 ND [Radeon 9700 Pro]";
-static const char pci_device_1002_4e45[] = "Radeon R300 NE [Radeon 9500 Pro]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_4e45_1002_0002[] = "Radeon R300 NE [Radeon 9500 Pro]";
-#endif
-static const char pci_device_1002_4e46[] = "Radeon R300 NF [Radeon 9700]";
-static const char pci_device_1002_4e47[] = "Radeon R300 NG [FireGL X1]";
-static const char pci_device_1002_4e48[] = "Radeon R350 [Radeon 9800]";
-static const char pci_device_1002_4e64[] = "Radeon R300 [Radeon 9700 Pro] (Secondary)";
-static const char pci_device_1002_4e65[] = "Radeon R300 [Radeon 9500 Pro] (Secondary)";
-static const char pci_device_1002_4e66[] = "Radeon R300 [Radeon 9700] (Secondary)";
-static const char pci_device_1002_4e67[] = "Radeon R300 [FireGL X1] (Secondary)";
-static const char pci_device_1002_4e68[] = "Radeon R350 [Radeon 9800] (Secondary)";
-static const char pci_device_1002_5041[] = "Rage 128 PA/PRO";
-static const char pci_device_1002_5042[] = "Rage 128 PB/PRO AGP 2x";
-static const char pci_device_1002_5043[] = "Rage 128 PC/PRO AGP 4x";
-static const char pci_device_1002_5044[] = "Rage 128 PD/PRO TMDS";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5044_1002_0028[] = "Rage 128 AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5044_1002_0029[] = "Rage 128 AIW";
-#endif
-static const char pci_device_1002_5045[] = "Rage 128 PE/PRO AGP 2x TMDS";
-static const char pci_device_1002_5046[] = "Rage 128 PF/PRO AGP 4x TMDS";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0004[] = "Rage Fury Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0008[] = "Rage Fury Pro/Xpert 2000 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0014[] = "Rage Fury Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0018[] = "Rage Fury Pro/Xpert 2000 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0028[] = "Rage 128 Pro AIW AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_002a[] = "Rage 128 Pro AIW AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_0048[] = "Rage Fury Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_2000[] = "Rage Fury MAXX AGP 4x (TMDS) (VGA device)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5046_1002_2001[] = "Rage Fury MAXX AGP 4x (TMDS) (Extra device?!)";
-#endif
-static const char pci_device_1002_5047[] = "Rage 128 PG/PRO";
-static const char pci_device_1002_5048[] = "Rage 128 PH/PRO AGP 2x";
-static const char pci_device_1002_5049[] = "Rage 128 PI/PRO AGP 4x";
-static const char pci_device_1002_504a[] = "Rage 128 PJ/PRO TMDS";
-static const char pci_device_1002_504b[] = "Rage 128 PK/PRO AGP 2x TMDS";
-static const char pci_device_1002_504c[] = "Rage 128 PL/PRO AGP 4x TMDS";
-static const char pci_device_1002_504d[] = "Rage 128 PM/PRO";
-static const char pci_device_1002_504e[] = "Rage 128 PN/PRO AGP 2x";
-static const char pci_device_1002_504f[] = "Rage 128 PO/PRO AGP 4x";
-static const char pci_device_1002_5050[] = "Rage 128 PP/PRO TMDS [Xpert 128]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5050_1002_0008[] = "Xpert 128";
-#endif
-static const char pci_device_1002_5051[] = "Rage 128 PQ/PRO AGP 2x TMDS";
-static const char pci_device_1002_5052[] = "Rage 128 PR/PRO AGP 4x TMDS";
-static const char pci_device_1002_5053[] = "Rage 128 PS/PRO";
-static const char pci_device_1002_5054[] = "Rage 128 PT/PRO AGP 2x";
-static const char pci_device_1002_5055[] = "Rage 128 PU/PRO AGP 4x";
-static const char pci_device_1002_5056[] = "Rage 128 PV/PRO TMDS";
-static const char pci_device_1002_5057[] = "Rage 128 PW/PRO AGP 2x TMDS";
-static const char pci_device_1002_5058[] = "Rage 128 PX/PRO AGP 4x TMDS";
-static const char pci_device_1002_5144[] = "Radeon R100 QD [Radeon 7200]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0008[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0009[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_000a[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_001a[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0029[] = "Radeon AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0038[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0039[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_008a[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_00ba[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_0139[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_028a[] = "Radeon 7000/Radeon";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_02aa[] = "Radeon AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5144_1002_053a[] = "Radeon 7000/Radeon";
-#endif
-static const char pci_device_1002_5145[] = "Radeon R100 QE";
-static const char pci_device_1002_5146[] = "Radeon R100 QF";
-static const char pci_device_1002_5147[] = "Radeon R100 QG";
-static const char pci_device_1002_5148[] = "Radeon R200 QH [Radeon 8500]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5148_1002_010a[] = "FireGL 8800 64Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5148_1002_0152[] = "FireGL 8800 128Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5148_1002_0162[] = "FireGL 8700 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5148_1002_0172[] = "FireGL 8700 64Mb";
-#endif
-static const char pci_device_1002_5149[] = "Radeon R200 QI";
-static const char pci_device_1002_514a[] = "Radeon R200 QJ";
-static const char pci_device_1002_514b[] = "Radeon R200 QK";
-static const char pci_device_1002_514c[] = "Radeon R200 QL [Radeon 8500 LE]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_514c_1002_003a[] = "Radeon R200 QL [Radeon 8500 LE]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_514c_1002_013a[] = "Radeon 8500";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_514c_148c_2026[] = "R200 QL [Radeon 8500 Evil Master II Multi Display Edition]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_514c_174b_7149[] = "Radeon R200 QL [Sapphire Radeon 8500 LE]";
-#endif
-static const char pci_device_1002_514d[] = "Radeon R200 QM [Radeon 9100]";
-static const char pci_device_1002_514e[] = "Radeon R200 QN [Radeon 8500LE]";
-static const char pci_device_1002_514f[] = "Radeon R200 QO [Radeon 8500LE]";
-static const char pci_device_1002_5157[] = "Radeon RV200 QW [Radeon 7500]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_1002_013a[] = "Radeon 7500";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_1458_4000[] = "RV200 QW [RADEON 7500 PRO MAYA AR]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_148c_2024[] = "RV200 QW [Radeon 7500LE Dual Display]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_148c_2025[] = "RV200 QW [Radeon 7500 Evil Master Multi Display Edition]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_148c_2036[] = "RV200 QW [Radeon 7500 PCI Dual Display]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_174b_7147[] = "RV200 QW [Sapphire Radeon 7500LE]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_174b_7161[] = "Radeon RV200 QW [Radeon 7500 LE]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5157_17af_0202[] = "RV200 QW [Excalibur Radeon 7500LE]";
-#endif
-static const char pci_device_1002_5158[] = "Radeon RV200 QX [Radeon 7500]";
-static const char pci_device_1002_5159[] = "Radeon RV100 QY [Radeon 7000/VE]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_000a[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_000b[] = "Radeon 7000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_0038[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_003a[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_00ba[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1002_013a[] = "Radeon 7000/Radeon VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1458_4002[] = "RV100 QY [RADEON 7000 PRO MAYA AV Series]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_148c_2003[] = "RV100 QY [Radeon 7000 Multi-Display Edition]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_148c_2023[] = "RV100 QY [Radeon 7000 Evil Master Multi-Display]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_174b_7112[] = "RV100 QY [Sapphire Radeon VE 7000]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5159_1787_0202[] = "RV100 QY [Excalibur Radeon 7000]";
-#endif
-static const char pci_device_1002_515a[] = "Radeon RV100 QZ [Radeon 7000/VE]";
-static const char pci_device_1002_5168[] = "Radeon R200 Qh";
-static const char pci_device_1002_5169[] = "Radeon R200 Qi";
-static const char pci_device_1002_516a[] = "Radeon R200 Qj";
-static const char pci_device_1002_516b[] = "Radeon R200 Qk";
-static const char pci_device_1002_516c[] = "Radeon R200 Ql";
-static const char pci_device_1002_5245[] = "Rage 128 RE/SG";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5245_1002_0008[] = "Xpert 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5245_1002_0028[] = "Rage 128 AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5245_1002_0029[] = "Rage 128 AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5245_1002_0068[] = "Rage 128 AIW";
-#endif
-static const char pci_device_1002_5246[] = "Rage 128 RF/SG AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0004[] = "Magnum/Xpert 128/Xpert 99";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0008[] = "Magnum/Xpert128/X99/Xpert2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0028[] = "Rage 128 AIW AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0044[] = "Rage Fury/Xpert 128/Xpert 2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0068[] = "Rage 128 AIW AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5246_1002_0448[] = "Rage Fury";
-#endif
-static const char pci_device_1002_5247[] = "Rage 128 RG";
-static const char pci_device_1002_524b[] = "Rage 128 RK/VR";
-static const char pci_device_1002_524c[] = "Rage 128 RL/VR AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_524c_1002_0008[] = "Xpert 99/Xpert 2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_524c_1002_0088[] = "Xpert 99";
-#endif
-static const char pci_device_1002_5345[] = "Rage 128 SE/4x";
-static const char pci_device_1002_5346[] = "Rage 128 SF/4x AGP 2x";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5346_1002_0048[] = "RAGE 128 16MB VGA TVOUT AMC PAL";
-#endif
-static const char pci_device_1002_5347[] = "Rage 128 SG/4x AGP 4x";
-static const char pci_device_1002_5348[] = "Rage 128 SH";
-static const char pci_device_1002_534b[] = "Rage 128 SK/4x";
-static const char pci_device_1002_534c[] = "Rage 128 SL/4x AGP 2x";
-static const char pci_device_1002_534d[] = "Rage 128 SM/4x AGP 4x";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_534d_1002_0008[] = "Xpert 99/Xpert 2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_534d_1002_0018[] = "Xpert 2000";
-#endif
-static const char pci_device_1002_534e[] = "Rage 128 4x";
-static const char pci_device_1002_5354[] = "Mach 64 VT";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5354_1002_5654[] = "Mach 64 reference";
-#endif
-static const char pci_device_1002_5446[] = "Rage 128 Pro Ultra TF";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0004[] = "Rage Fury Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0008[] = "Rage Fury Pro/Xpert 2000 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0018[] = "Rage Fury Pro/Xpert 2000 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0028[] = "Rage 128 AIW Pro AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0029[] = "Rage 128 AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_002a[] = "Rage 128 AIW Pro AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_002b[] = "Rage 128 AIW";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5446_1002_0048[] = "Xpert 2000 Pro";
-#endif
-static const char pci_device_1002_544c[] = "Rage 128 Pro Ultra TL";
-static const char pci_device_1002_5452[] = "Rage 128 Pro Ultra TR";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5452_1002_001c[] = "Rage 128 Pro 4XL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5452_103c_1279[] = "Rage 128 Pro 4XL";
-#endif
-static const char pci_device_1002_5453[] = "Rage 128 Pro Ultra TS";
-static const char pci_device_1002_5454[] = "Rage 128 Pro Ultra TT";
-static const char pci_device_1002_5455[] = "Rage 128 Pro Ultra TU";
-static const char pci_device_1002_5654[] = "264VT [Mach64 VT]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1002_5654_1002_5654[] = "Mach64VT Reference";
-#endif
-static const char pci_device_1002_5655[] = "264VT3 [Mach64 VT3]";
-static const char pci_device_1002_5656[] = "264VT4 [Mach64 VT4]";
-static const char pci_device_1002_700f[] = "PCI Bridge [IGP 320M]";
-static const char pci_device_1002_7010[] = "PCI Bridge [IGP 340M]";
-static const char pci_device_1002_cab2[] = "RS200/RS200M AGP Bridge [IGP 340M]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1003[] = "ULSI Systems";
-static const char pci_device_1003_0201[] = "US201";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1004[] = "VLSI Technology Inc";
-static const char pci_device_1004_0005[] = "82C592-FC1";
-static const char pci_device_1004_0006[] = "82C593-FC1";
-static const char pci_device_1004_0007[] = "82C594-AFC2";
-static const char pci_device_1004_0008[] = "82C596/7 [Wildcat]";
-static const char pci_device_1004_0009[] = "82C597-AFC2";
-static const char pci_device_1004_000c[] = "82C541 [Lynx]";
-static const char pci_device_1004_000d[] = "82C543 [Lynx]";
-static const char pci_device_1004_0101[] = "82C532";
-static const char pci_device_1004_0102[] = "82C534 [Eagle]";
-static const char pci_device_1004_0103[] = "82C538";
-static const char pci_device_1004_0104[] = "82C535";
-static const char pci_device_1004_0105[] = "82C147";
-static const char pci_device_1004_0200[] = "82C975";
-static const char pci_device_1004_0280[] = "82C925";
-static const char pci_device_1004_0304[] = "QSound ThunderBird PCI Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0304_1004_0304[] = "QSound ThunderBird PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0304_122d_1206[] = "DSP368 Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0304_1483_5020[] = "XWave Thunder 3D Audio";
-#endif
-static const char pci_device_1004_0305[] = "QSound ThunderBird PCI Audio Gameport";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0305_1004_0305[] = "QSound ThunderBird PCI Audio Gameport";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0305_122d_1207[] = "DSP368 Audio Gameport";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0305_1483_5021[] = "XWave Thunder 3D Audio Gameport";
-#endif
-static const char pci_device_1004_0306[] = "QSound ThunderBird PCI Audio Support Registers";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0306_1004_0306[] = "QSound ThunderBird PCI Audio Support Registers";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0306_122d_1208[] = "DSP368 Audio Support Registers";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1004_0306_1483_5022[] = "XWave Thunder 3D Audio Support Registers";
-#endif
-static const char pci_device_1004_0307[] = "Thunderbird";
-static const char pci_device_1004_0308[] = "Thunderbird";
-static const char pci_device_1004_0702[] = "VAS96011 [Golden Gate II]";
-static const char pci_device_1004_0703[] = "Tollgate";
-#endif
-static const char pci_vendor_1005[] = "Avance Logic Inc. [ALI]";
-static const char pci_device_1005_2064[] = "ALG2032/2064";
-static const char pci_device_1005_2128[] = "ALG2364A";
-static const char pci_device_1005_2301[] = "ALG2301";
-static const char pci_device_1005_2302[] = "ALG2302";
-static const char pci_device_1005_2364[] = "ALG2364";
-static const char pci_device_1005_2464[] = "ALG2364A";
-static const char pci_device_1005_2501[] = "ALG2564A/25128A";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1006[] = "Reply Group";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1007[] = "NetFrame Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1008[] = "Epson";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_100a[] = "Phoenix Technologies";
-#endif
-static const char pci_vendor_100b[] = "National Semiconductor Corporation";
-static const char pci_device_100b_0001[] = "DP83810";
-static const char pci_device_100b_0002[] = "87415/87560 IDE";
-static const char pci_device_100b_000e[] = "87560 Legacy I/O";
-static const char pci_device_100b_000f[] = "FireWire Controller";
-static const char pci_device_100b_0011[] = "NS87560 National PCI System I/O";
-static const char pci_device_100b_0012[] = "USB Controller";
-static const char pci_device_100b_0020[] = "DP83815 (MacPhyter) Ethernet Controller";
-static const char pci_device_100b_0022[] = "DP83820 10/100/1000 Ethernet Controller";
-static const char pci_device_100b_0500[] = "SCx200 Bridge";
-static const char pci_device_100b_0501[] = "SCx200 SMI";
-static const char pci_device_100b_0502[] = "SCx200 IDE";
-static const char pci_device_100b_0503[] = "SCx200 Audio";
-static const char pci_device_100b_0504[] = "SCx200 Video";
-static const char pci_device_100b_0505[] = "SCx200 XBus";
-static const char pci_device_100b_d001[] = "87410 IDE";
-static const char pci_vendor_100c[] = "Tseng Labs Inc";
-static const char pci_device_100c_3202[] = "ET4000/W32p rev A";
-static const char pci_device_100c_3205[] = "ET4000/W32p rev B";
-static const char pci_device_100c_3206[] = "ET4000/W32p rev C";
-static const char pci_device_100c_3207[] = "ET4000/W32p rev D";
-static const char pci_device_100c_3208[] = "ET6000";
-static const char pci_device_100c_4702[] = "ET6300";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_100d[] = "AST Research Inc";
-#endif
-static const char pci_vendor_100e[] = "Weitek";
-static const char pci_device_100e_9000[] = "P9000 Viper";
-static const char pci_device_100e_9001[] = "P9000 Viper";
-static const char pci_device_100e_9002[] = "P9000 Viper";
-static const char pci_device_100e_9100[] = "P9100 Viper Pro/SE";
-static const char pci_vendor_1010[] = "Video Logic, Ltd.";
-static const char pci_vendor_1011[] = "Digital Equipment Corporation";
-static const char pci_device_1011_0001[] = "DECchip 21050";
-static const char pci_device_1011_0002[] = "DECchip 21040 [Tulip]";
-static const char pci_device_1011_0004[] = "DECchip 21030 [TGA]";
-static const char pci_device_1011_0007[] = "NVRAM [Zephyr NVRAM]";
-static const char pci_device_1011_0008[] = "KZPSA [KZPSA]";
-static const char pci_device_1011_0009[] = "DECchip 21140 [FasterNet]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1025_0310[] = "21140 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_10b8_2001[] = "SMC9332BDT EtherPower 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_10b8_2002[] = "SMC9332BVT EtherPower T4 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_10b8_2003[] = "SMC9334BDT EtherPower 10/100 (1-port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1109_2400[] = "ANA-6944A/TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1112_2300[] = "RNS2300 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1112_2320[] = "RNS2320 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1112_2340[] = "RNS2340 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1113_1207[] = "EN-1207-TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1186_1100[] = "DFE-500TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1186_1112[] = "DFE-570TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1186_1140[] = "DFE-660 Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1186_1142[] = "DFE-660 Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_11f6_0503[] = "Freedomline Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1282_9100[] = "AEF-380TXD Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_1385_1100[] = "FA310TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0009_2646_0001[] = "KNE100TX Fast Ethernet";
-#endif
-static const char pci_device_1011_000a[] = "21230 Video Codec";
-static const char pci_device_1011_000d[] = "PBXGB [TGA2]";
-static const char pci_device_1011_000f[] = "DEFPA";
-static const char pci_device_1011_0014[] = "DECchip 21041 [Tulip Pass 3]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0014_1186_0100[] = "DE-530+";
-#endif
-static const char pci_device_1011_0016[] = "DGLPB [OPPO]";
-static const char pci_device_1011_0017[] = "PV-PCI Graphics Controller (ZLXp-L)";
-static const char pci_device_1011_0019[] = "DECchip 21142/43";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1011_500a[] = "DE500A Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1011_500b[] = "DE500B Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1014_0001[] = "10/100 EtherJet Cardbus";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1025_0315[] = "ALN315 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1033_800c[] = "PC-9821-CS01 100BASE-TX Interface Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1033_800d[] = "PC-9821NR-B06 100BASE-TX Interface Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_108d_0016[] = "Rapidfire 2327 10/100 Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_108d_0017[] = "GoCard 2250 Ethernet 10/100 Cardbus";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_10b8_2005[] = "SMC8032DT Extreme Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_10b8_8034[] = "SMC8034 Extreme Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_10ef_8169[] = "Cardbus Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1109_2a00[] = "ANA-6911A/TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1109_2b00[] = "ANA-6911A/TXC Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1109_3000[] = "ANA-6922/TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1113_1207[] = "Cheetah Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1113_2220[] = "Cardbus Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_115d_0002[] = "Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1179_0203[] = "Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1179_0204[] = "Cardbus Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1186_1100[] = "DFE-500TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1186_1101[] = "DFE-500TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1186_1102[] = "DFE-500TX Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1259_2800[] = "AT-2800Tx Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1266_0004[] = "Eagle Fast EtherMAX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_12af_0019[] = "NetFlyer Cardbus Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1374_0001[] = "Cardbus Ethernet Card 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1374_0002[] = "Cardbus Ethernet Card 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1374_0007[] = "Cardbus Ethernet Card 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1374_0008[] = "Cardbus Ethernet Card 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1385_2100[] = "FA510";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_1395_0001[] = "10/100 Ethernet CardBus PC Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_13d1_ab01[] = "EtherFast 10/100 Cardbus (PCMPC200)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0019_8086_0001[] = "EtherExpress PRO/100 Mobile CardBus 32";
-#endif
-static const char pci_device_1011_001a[] = "Farallon PN9000SX";
-static const char pci_device_1011_0021[] = "DECchip 21052";
-static const char pci_device_1011_0022[] = "DECchip 21150";
-static const char pci_device_1011_0023[] = "DECchip 21150";
-static const char pci_device_1011_0024[] = "DECchip 21152";
-static const char pci_device_1011_0025[] = "DECchip 21153";
-static const char pci_device_1011_0026[] = "DECchip 21154";
-static const char pci_device_1011_0034[] = "56k Modem Cardbus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0034_1374_0003[] = "56k Modem Cardbus";
-#endif
-static const char pci_device_1011_0045[] = "DECchip 21553";
-static const char pci_device_1011_0046[] = "DECchip 21554";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_0e11_4050[] = "Integrated Smart Array";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_0e11_4051[] = "Integrated Smart Array";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_0e11_4058[] = "Integrated Smart Array";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_103c_10c2[] = "Hewlett-Packard NetRAID-4M";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_12d9_000a[] = "VoIP PCI Gateway";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_9005_0365[] = "Adaptec 5400S";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_9005_1364[] = "Dell PowerEdge RAID Controller 2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_9005_1365[] = "Dell PowerEdge RAID Controller 2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_0046_e4bf_1000[] = "CC8-1-BLUES";
-#endif
-static const char pci_device_1011_1065[] = "StrongARM DC21285";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1011_1065_1069_0020[] = "DAC960P / DAC1164P";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1012[] = "Micronics Computers Inc";
-#endif
-static const char pci_vendor_1013[] = "Cirrus Logic";
-static const char pci_device_1013_0038[] = "GD 7548";
-static const char pci_device_1013_0040[] = "GD 7555 Flat Panel GUI Accelerator";
-static const char pci_device_1013_004c[] = "GD 7556 Video/Graphics LCD/CRT Ctrlr";
-static const char pci_device_1013_00a0[] = "GD 5430/40 [Alpine]";
-static const char pci_device_1013_00a2[] = "GD 5432 [Alpine]";
-static const char pci_device_1013_00a4[] = "GD 5434-4 [Alpine]";
-static const char pci_device_1013_00a8[] = "GD 5434-8 [Alpine]";
-static const char pci_device_1013_00ac[] = "GD 5436 [Alpine]";
-static const char pci_device_1013_00b0[] = "GD 5440";
-static const char pci_device_1013_00b8[] = "GD 5446";
-static const char pci_device_1013_00bc[] = "GD 5480";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_00bc_1013_00bc[] = "CL-GD5480";
-#endif
-static const char pci_device_1013_00d0[] = "GD 5462";
-static const char pci_device_1013_00d2[] = "GD 5462 [Laguna I]";
-static const char pci_device_1013_00d4[] = "GD 5464 [Laguna]";
-static const char pci_device_1013_00d5[] = "GD 5464 BD [Laguna]";
-static const char pci_device_1013_00d6[] = "GD 5465 [Laguna]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_00d6_13ce_8031[] = "Barco Metheus 2 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_00d6_13cf_8031[] = "Barco Metheus 2 Megapixel, Dual Head";
-#endif
-static const char pci_device_1013_00e8[] = "GD 5436U";
-static const char pci_device_1013_1100[] = "CL 6729";
-static const char pci_device_1013_1110[] = "PD 6832 PCMCIA/CardBus Ctrlr";
-static const char pci_device_1013_1112[] = "PD 6834 PCMCIA/CardBus Ctrlr";
-static const char pci_device_1013_1113[] = "PD 6833 PCMCIA/CardBus Ctrlr";
-static const char pci_device_1013_1200[] = "GD 7542 [Nordic]";
-static const char pci_device_1013_1202[] = "GD 7543 [Viking]";
-static const char pci_device_1013_1204[] = "GD 7541 [Nordic Light]";
-static const char pci_device_1013_4400[] = "CD 4400";
-static const char pci_device_1013_6001[] = "CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6001_1014_1010[] = "CS4610 SoundFusion Audio Accelerator";
-#endif
-static const char pci_device_1013_6003[] = "CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6003_1013_4280[] = "Crystal SoundFusion PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6003_1681_0050[] = "Game Theater XP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6003_1681_a011[] = "Fortissimo III 7.1";
-#endif
-static const char pci_device_1013_6004[] = "CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]";
-static const char pci_device_1013_6005[] = "Crystal CS4281 PCI Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_1013_4281[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10a8[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10a9[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10aa[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10ab[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10ac[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10ad[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_10cf_10b4[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_1179_0001[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1013_6005_14c0_000c[] = "Crystal CS4281 PCI Audio";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1014[] = "IBM";
-static const char pci_device_1014_0002[] = "PCI to MCA Bridge";
-static const char pci_device_1014_0005[] = "Alta Lite";
-static const char pci_device_1014_0007[] = "Alta MP";
-static const char pci_device_1014_000a[] = "Fire Coral";
-static const char pci_device_1014_0017[] = "CPU to PCI Bridge";
-static const char pci_device_1014_0018[] = "TR Auto LANstreamer";
-static const char pci_device_1014_001b[] = "GXT-150P";
-static const char pci_device_1014_001c[] = "Carrera";
-static const char pci_device_1014_001d[] = "82G2675";
-static const char pci_device_1014_0020[] = "MCA";
-static const char pci_device_1014_0022[] = "IBM27-82351";
-static const char pci_device_1014_002d[] = "Python";
-static const char pci_device_1014_002e[] = "ServeRAID Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_002e_1014_002e[] = "ServeRAID-3x";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_002e_1014_022e[] = "ServeRAID-4H";
-#endif
-static const char pci_device_1014_0036[] = "Miami";
-static const char pci_device_1014_003a[] = "CPU to PCI Bridge";
-static const char pci_device_1014_003e[] = "16/4 Token ring UTP/STP controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_003e[] = "Token-Ring Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_00cd[] = "Token-Ring Adapter + Wake-On-LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_00ce[] = "16/4 Token-Ring Adapter 2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_00cf[] = "16/4 Token-Ring Adapter Special";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_00e4[] = "High-Speed 100/16/4 Token-Ring Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_00e5[] = "16/4 Token-Ring Adapter 2 + Wake-On-LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_003e_1014_016d[] = "iSeries 2744 Card";
-#endif
-static const char pci_device_1014_0045[] = "SSA Adapter";
-static const char pci_device_1014_0046[] = "MPIC interrupt controller";
-static const char pci_device_1014_0047[] = "PCI to PCI Bridge";
-static const char pci_device_1014_0048[] = "PCI to PCI Bridge";
-static const char pci_device_1014_0049[] = "Warhead SCSI Controller";
-static const char pci_device_1014_004e[] = "ATM Controller (14104e00)";
-static const char pci_device_1014_004f[] = "ATM Controller (14104f00)";
-static const char pci_device_1014_0050[] = "ATM Controller (14105000)";
-static const char pci_device_1014_0053[] = "25 MBit ATM Controller";
-static const char pci_device_1014_0057[] = "MPEG PCI Bridge";
-static const char pci_device_1014_005c[] = "i82557B 10/100";
-static const char pci_device_1014_007c[] = "ATM Controller (14107c00)";
-static const char pci_device_1014_007d[] = "3780IDSP [MWave]";
-static const char pci_device_1014_0090[] = "GXT 3000P";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0090_1014_008e[] = "GXT-3000P";
-#endif
-static const char pci_device_1014_0095[] = "20H2999 PCI Docking Bridge";
-static const char pci_device_1014_0096[] = "Chukar chipset SCSI controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0096_1014_0097[] = "iSeries 2778 DASD IOA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0096_1014_0098[] = "iSeries 2763 DASD IOA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0096_1014_0099[] = "iSeries 2748 DASD IOA";
-#endif
-static const char pci_device_1014_00a5[] = "ATM Controller (1410a500)";
-static const char pci_device_1014_00a6[] = "ATM 155MBPS MM Controller (1410a600)";
-static const char pci_device_1014_00b7[] = "256-bit Graphics Rasterizer [Fire GL1]";
-static const char pci_device_1014_00be[] = "ATM 622MBPS Controller (1410be00)";
-static const char pci_device_1014_00dc[] = "Advanced Systems Management Adapter (ASMA)";
-static const char pci_device_1014_00fc[] = "CPC710 Dual Bridge and Memory Controller (PCI-64)";
-static const char pci_device_1014_0105[] = "CPC710 Dual Bridge and Memory Controller (PCI-32)";
-static const char pci_device_1014_010f[] = "Remote Supervisor Adapter (RSA)";
-static const char pci_device_1014_0142[] = "Yotta Video Compositor Input";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0142_1014_0143[] = "Yotta Input Controller (ytin)";
-#endif
-static const char pci_device_1014_0144[] = "Yotta Video Compositor Output";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_0144_1014_0145[] = "Yotta Output Controller (ytout)";
-#endif
-static const char pci_device_1014_0156[] = "405GP PLB to PCI Bridge";
-static const char pci_device_1014_01a7[] = "PCI-X to PCI-X Bridge";
-static const char pci_device_1014_01bd[] = "ServeRAID Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_01be[] = "ServeRAID-4M";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_01bf[] = "ServeRAID-4L";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_0208[] = "ServeRAID-4Mx";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_020e[] = "ServeRAID-4Lx";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_022e[] = "ServeRAID-4H";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_0258[] = "ServeRAID-5i";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1014_01bd_1014_0259[] = "ServeRAID-5i";
-#endif
-static const char pci_device_1014_0302[] = "XA-32 chipset [Summit]";
-static const char pci_device_1014_ffff[] = "MPIC-2 interrupt controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1015[] = "LSI Logic Corp of Canada";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1016[] = "ICL Personal Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1017[] = "SPEA Software AG";
-static const char pci_device_1017_5343[] = "SPEA 3D Accelerator";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1018[] = "Unisys Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1019[] = "Elitegroup Computer Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_101a[] = "AT&T GIS (NCR)";
-static const char pci_device_101a_0005[] = "100VG ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_101b[] = "Vitesse Semiconductor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_101c[] = "Western Digital";
-static const char pci_device_101c_0193[] = "33C193A";
-static const char pci_device_101c_0196[] = "33C196A";
-static const char pci_device_101c_0197[] = "33C197A";
-static const char pci_device_101c_0296[] = "33C296A";
-static const char pci_device_101c_3193[] = "7193";
-static const char pci_device_101c_3197[] = "7197";
-static const char pci_device_101c_3296[] = "33C296A";
-static const char pci_device_101c_4296[] = "34C296";
-static const char pci_device_101c_9710[] = "Pipeline 9710";
-static const char pci_device_101c_9712[] = "Pipeline 9712";
-static const char pci_device_101c_c24a[] = "90C";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_101e[] = "American Megatrends Inc.";
-static const char pci_device_101e_1960[] = "MegaRAID";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_101e_0471[] = "MegaRAID 471 Enterprise 1600 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_101e_0475[] = "MegaRAID 475 Express 500 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_101e_0493[] = "MegaRAID 493 Elite 1600 RAID Controller";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_1028_0471[] = "PowerEdge RAID Controller 3/QC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_1028_0475[] = "PowerEdge RAID Controller 3/SC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_1028_0493[] = "PowerEdge RAID Controller 3/DC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_1960_1028_0511[] = "PowerEdge Cost Effective RAID Controller ATA100/4Ch";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_101e_9010[] = "MegaRAID 428 Ultra RAID Controller";
-static const char pci_device_101e_9030[] = "EIDE Controller";
-static const char pci_device_101e_9031[] = "EIDE Controller";
-static const char pci_device_101e_9032[] = "EIDE & SCSI Controller";
-static const char pci_device_101e_9033[] = "SCSI Controller";
-static const char pci_device_101e_9040[] = "Multimedia card";
-static const char pci_device_101e_9060[] = "MegaRAID 434 Ultra GT RAID Controller";
-static const char pci_device_101e_9063[] = "MegaRAC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_101e_9063_101e_0767[] = "Dell Remote Assistant Card 2";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_101f[] = "PictureTel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1020[] = "Hitachi Computer Products";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1021[] = "OKI Electric Industry Co. Ltd.";
-#endif
-static const char pci_vendor_1022[] = "Advanced Micro Devices [AMD]";
-static const char pci_device_1022_1100[] = "K8 NorthBridge";
-static const char pci_device_1022_1101[] = "K8 NorthBridge";
-static const char pci_device_1022_1102[] = "K8 NorthBridge";
-static const char pci_device_1022_1103[] = "K8 NorthBridge";
-static const char pci_device_1022_2000[] = "79c970 [PCnet32 LANCE]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1014_2000[] = "NetFinity 10/100 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_104c[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_1064[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_1065[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_106c[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_106e[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_103c_10ea[] = "Ethernet with LAN remote power Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1113_1220[] = "EN1220 10/100 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1259_2450[] = "AT-2450 10/100 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1259_2454[] = "AT-2450v4 10Mb Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1259_2700[] = "AT-2700TX 10/100 Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2000_1259_2701[] = "AT-2700FX 100Mb Ethernet";
-#endif
-static const char pci_device_1022_2001[] = "79c978 [HomePNA]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2001_1092_0a78[] = "Multimedia Home Network Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_2001_1668_0299[] = "ActionLink Home Network Adapter";
-#endif
-static const char pci_device_1022_2020[] = "53c974 [PCscsi]";
-static const char pci_device_1022_2040[] = "79c974";
-static const char pci_device_1022_3000[] = "ELanSC520 Microcontroller";
-static const char pci_device_1022_7006[] = "AMD-751 [Irongate] System Controller";
-static const char pci_device_1022_7007[] = "AMD-751 [Irongate] AGP Bridge";
-static const char pci_device_1022_700c[] = "AMD-760 MP [IGD4-2P] System Controller";
-static const char pci_device_1022_700d[] = "AMD-760 MP [IGD4-2P] AGP Bridge";
-static const char pci_device_1022_700e[] = "AMD-760 [IGD4-1P] System Controller";
-static const char pci_device_1022_700f[] = "AMD-760 [IGD4-1P] AGP Bridge";
-static const char pci_device_1022_7400[] = "AMD-755 [Cobra] ISA";
-static const char pci_device_1022_7401[] = "AMD-755 [Cobra] IDE";
-static const char pci_device_1022_7403[] = "AMD-755 [Cobra] ACPI";
-static const char pci_device_1022_7404[] = "AMD-755 [Cobra] USB";
-static const char pci_device_1022_7408[] = "AMD-756 [Viper] ISA";
-static const char pci_device_1022_7409[] = "AMD-756 [Viper] IDE";
-static const char pci_device_1022_740b[] = "AMD-756 [Viper] ACPI";
-static const char pci_device_1022_740c[] = "AMD-756 [Viper] USB";
-static const char pci_device_1022_7410[] = "AMD-766 [ViperPlus] ISA";
-static const char pci_device_1022_7411[] = "AMD-766 [ViperPlus] IDE";
-static const char pci_device_1022_7413[] = "AMD-766 [ViperPlus] ACPI";
-static const char pci_device_1022_7414[] = "AMD-766 [ViperPlus] USB";
-static const char pci_device_1022_7440[] = "AMD-768 [Opus] ISA";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_7440_1043_8044[] = "A7M-D Mainboard";
-#endif
-static const char pci_device_1022_7441[] = "AMD-768 [Opus] IDE";
-static const char pci_device_1022_7443[] = "AMD-768 [Opus] ACPI";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1022_7443_1043_8044[] = "A7M-D Mainboard";
-#endif
-static const char pci_device_1022_7445[] = "AMD-768 [Opus] Audio";
-static const char pci_device_1022_7446[] = "AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible)";
-static const char pci_device_1022_7448[] = "AMD-768 [Opus] PCI";
-static const char pci_device_1022_7449[] = "AMD-768 [Opus] USB";
-static const char pci_device_1022_7450[] = "AMD-8131 PCI-X Bridge";
-static const char pci_device_1022_7451[] = "AMD-8131 PCI-X APIC";
-static const char pci_device_1022_7454[] = "AMD-8151 System Controller";
-static const char pci_device_1022_7455[] = "AMD-8151 AGP Bridge";
-static const char pci_device_1022_7460[] = "AMD-8111 PCI";
-static const char pci_device_1022_7461[] = "AMD-8111 USB";
-static const char pci_device_1022_7462[] = "AMD-8111 Ethernet";
-static const char pci_device_1022_7464[] = "AMD-8111 USB";
-static const char pci_device_1022_7468[] = "AMD-8111 LPC";
-static const char pci_device_1022_7469[] = "AMD-8111 IDE";
-static const char pci_device_1022_746a[] = "AMD-8111 SMBus 2.0";
-static const char pci_device_1022_746b[] = "AMD-8111 ACPI";
-static const char pci_device_1022_746d[] = "AMD-8111 AC97 Audio";
-static const char pci_device_1022_746e[] = "AMD-8111 MC97 Modem";
-static const char pci_vendor_1023[] = "Trident Microsystems";
-static const char pci_device_1023_0194[] = "82C194";
-static const char pci_device_1023_2000[] = "4DWave DX";
-static const char pci_device_1023_2001[] = "4DWave NX";
-static const char pci_device_1023_8400[] = "CyberBlade/i7";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_8400_1023_8400[] = "CyberBlade i7 AGP";
-#endif
-static const char pci_device_1023_8420[] = "CyberBlade/i7d";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_8420_0e11_b15a[] = "CyberBlade i7 AGP";
-#endif
-static const char pci_device_1023_8500[] = "CyberBlade/i1";
-static const char pci_device_1023_8520[] = "CyberBlade i1";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_8520_0e11_b16e[] = "CyberBlade i1 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_8520_1023_8520[] = "CyberBlade i1 AGP";
-#endif
-static const char pci_device_1023_8620[] = "CyberBlade/i1";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_8620_1014_0502[] = "ThinkPad T30";
-#endif
-static const char pci_device_1023_8820[] = "CyberBlade XPAi1";
-static const char pci_device_1023_9320[] = "TGUI 9320";
-static const char pci_device_1023_9350[] = "GUI Accelerator";
-static const char pci_device_1023_9360[] = "Flat panel GUI Accelerator";
-static const char pci_device_1023_9382[] = "Cyber 9382 [Reference design]";
-static const char pci_device_1023_9383[] = "Cyber 9383 [Reference design]";
-static const char pci_device_1023_9385[] = "Cyber 9385 [Reference design]";
-static const char pci_device_1023_9386[] = "Cyber 9386";
-static const char pci_device_1023_9388[] = "Cyber 9388";
-static const char pci_device_1023_9397[] = "Cyber 9397";
-static const char pci_device_1023_939a[] = "Cyber 9397DVD";
-static const char pci_device_1023_9420[] = "TGUI 9420";
-static const char pci_device_1023_9430[] = "TGUI 9430";
-static const char pci_device_1023_9440[] = "TGUI 9440";
-static const char pci_device_1023_9460[] = "TGUI 9460";
-static const char pci_device_1023_9470[] = "TGUI 9470";
-static const char pci_device_1023_9520[] = "Cyber 9520";
-static const char pci_device_1023_9525[] = "Cyber 9525";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_9525_10cf_1094[] = "Lifebook C6155";
-#endif
-static const char pci_device_1023_9540[] = "Cyber 9540";
-static const char pci_device_1023_9660[] = "TGUI 9660/938x/968x";
-static const char pci_device_1023_9680[] = "TGUI 9680";
-static const char pci_device_1023_9682[] = "TGUI 9682";
-static const char pci_device_1023_9683[] = "TGUI 9683";
-static const char pci_device_1023_9685[] = "ProVIDIA 9685";
-static const char pci_device_1023_9750[] = "3DImage 9750";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_9750_1014_9750[] = "3DImage 9750";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_9750_1023_9750[] = "3DImage 9750";
-#endif
-static const char pci_device_1023_9753[] = "TGUI 9753";
-static const char pci_device_1023_9754[] = "TGUI 9754";
-static const char pci_device_1023_9759[] = "TGUI 975";
-static const char pci_device_1023_9783[] = "TGUI 9783";
-static const char pci_device_1023_9785[] = "TGUI 9785";
-static const char pci_device_1023_9850[] = "3DImage 9850";
-static const char pci_device_1023_9880[] = "Blade 3D PCI/AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1023_9880_1023_9880[] = "Blade 3D";
-#endif
-static const char pci_device_1023_9910[] = "CyberBlade/XP";
-static const char pci_device_1023_9930[] = "CyberBlade/XPm";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1024[] = "Zenith Data Systems";
-#endif
-static const char pci_vendor_1025[] = "Acer Incorporated [ALI]";
-static const char pci_device_1025_1435[] = "M1435";
-static const char pci_device_1025_1445[] = "M1445";
-static const char pci_device_1025_1449[] = "M1449";
-static const char pci_device_1025_1451[] = "M1451";
-static const char pci_device_1025_1461[] = "M1461";
-static const char pci_device_1025_1489[] = "M1489";
-static const char pci_device_1025_1511[] = "M1511";
-static const char pci_device_1025_1512[] = "ALI M1512 Aladdin";
-static const char pci_device_1025_1513[] = "M1513";
-static const char pci_device_1025_1521[] = "ALI M1521 Aladdin III CPU Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1025_1521_10b9_1521[] = "ALI M1521 Aladdin III CPU Bridge";
-#endif
-static const char pci_device_1025_1523[] = "ALI M1523 ISA Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1025_1523_10b9_1523[] = "ALI M1523 ISA Bridge";
-#endif
-static const char pci_device_1025_1531[] = "M1531 Northbridge [Aladdin IV/IV+]";
-static const char pci_device_1025_1533[] = "M1533 PCI-to-ISA Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1025_1533_10b9_1533[] = "ALI M1533 Aladdin IV/V ISA South Bridge";
-#endif
-static const char pci_device_1025_1535[] = "M1535 PCI Bridge + Super I/O + FIR";
-static const char pci_device_1025_1541[] = "M1541 Northbridge [Aladdin V]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1025_1541_10b9_1541[] = "ALI M1541 Aladdin V/V+ AGP+PCI North Bridge";
-#endif
-static const char pci_device_1025_1542[] = "M1542 Northbridge [Aladdin V]";
-static const char pci_device_1025_1543[] = "M1543 PCI-to-ISA Bridge + Super I/O + FIR";
-static const char pci_device_1025_1561[] = "M1561 Northbridge [Aladdin 7]";
-static const char pci_device_1025_1621[] = "M1621 Northbridge [Aladdin-Pro II]";
-static const char pci_device_1025_1631[] = "M1631 Northbridge+3D Graphics [Aladdin TNT2]";
-static const char pci_device_1025_1641[] = "M1641 Northbridge [Aladdin-Pro IV]";
-static const char pci_device_1025_1647[] = "M1647 [MaGiK1] PCI North Bridge";
-static const char pci_device_1025_3141[] = "M3141";
-static const char pci_device_1025_3143[] = "M3143";
-static const char pci_device_1025_3145[] = "M3145";
-static const char pci_device_1025_3147[] = "M3147";
-static const char pci_device_1025_3149[] = "M3149";
-static const char pci_device_1025_3151[] = "M3151";
-static const char pci_device_1025_3307[] = "M3307 MPEG-I Video Controller";
-static const char pci_device_1025_3309[] = "M3309 MPEG-II Video w/ Software Audio Decoder";
-static const char pci_device_1025_3321[] = "M3321 MPEG-II Audio/Video Decoder";
-static const char pci_device_1025_5212[] = "M4803";
-static const char pci_device_1025_5215[] = "ALI PCI EIDE Controller";
-static const char pci_device_1025_5217[] = "M5217H";
-static const char pci_device_1025_5219[] = "M5219";
-static const char pci_device_1025_5225[] = "M5225";
-static const char pci_device_1025_5229[] = "M5229";
-static const char pci_device_1025_5235[] = "M5235";
-static const char pci_device_1025_5237[] = "M5237 PCI USB Host Controller";
-static const char pci_device_1025_5240[] = "EIDE Controller";
-static const char pci_device_1025_5241[] = "PCMCIA Bridge";
-static const char pci_device_1025_5242[] = "General Purpose Controller";
-static const char pci_device_1025_5243[] = "PCI to PCI Bridge Controller";
-static const char pci_device_1025_5244[] = "Floppy Disk Controller";
-static const char pci_device_1025_5247[] = "M1541 PCI to PCI Bridge";
-static const char pci_device_1025_5251[] = "M5251 P1394 Controller";
-static const char pci_device_1025_5427[] = "PCI to AGP Bridge";
-static const char pci_device_1025_5451[] = "M5451 PCI AC-Link Controller Audio Device";
-static const char pci_device_1025_5453[] = "M5453 PCI AC-Link Controller Modem Device";
-static const char pci_device_1025_7101[] = "M7101 PCI PMU Power Management Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1025_7101_10b9_7101[] = "M7101 PCI PMU Power Management Controller";
-#endif
-static const char pci_vendor_1028[] = "Dell Computer Corporation";
-static const char pci_device_1028_0001[] = "PowerEdge Expandable RAID Controller 2/Si";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0001_1028_0001[] = "PowerEdge Expandable RAID Controller 2/Si";
-#endif
-static const char pci_device_1028_0002[] = "PowerEdge Expandable RAID Controller 3";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0002_1028_0002[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0002_1028_00d1[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0002_1028_00d9[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-static const char pci_device_1028_0003[] = "PowerEdge Expandable RAID Controller 3/Si";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0003_1028_0003[] = "PowerEdge Expandable RAID Controller 3/Si";
-#endif
-static const char pci_device_1028_0004[] = "PowerEdge Expandable RAID Controller 3/Si";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_0004_1028_00d0[] = "PowerEdge Expandable RAID Controller 3/Si";
-#endif
-static const char pci_device_1028_0005[] = "PowerEdge Expandable RAID Controller 3/Di";
-static const char pci_device_1028_0006[] = "PowerEdge Expandable RAID Controller 3/Di";
-static const char pci_device_1028_0007[] = "Remote Access Controller:DRAC III";
-static const char pci_device_1028_0008[] = "Remote Access Controller";
-static const char pci_device_1028_0009[] = "BMC/SMIC device not present";
-static const char pci_device_1028_000a[] = "PowerEdge Expandable RAID Controller 3";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_000a_1028_0106[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_000a_1028_011b[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1028_000a_1028_0121[] = "PowerEdge Expandable RAID Controller 3/Di";
-#endif
-static const char pci_device_1028_000c[] = "Remote Access Controller:ERA or ERA/O";
-static const char pci_device_1028_000d[] = "BMC/SMIC device";
-static const char pci_device_1028_000e[] = "PowerEdge Expandable RAID Controller";
-static const char pci_device_1028_000f[] = "PowerEdge Expandable RAID Controller 4/Di";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1029[] = "Siemens Nixdorf IS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_102a[] = "LSI Logic";
-static const char pci_device_102a_0000[] = "HYDRA";
-static const char pci_device_102a_0010[] = "ASPEN";
-#endif
-static const char pci_vendor_102b[] = "Matrox Graphics, Inc.";
-static const char pci_device_102b_0010[] = "MGA-I [Impression?]";
-static const char pci_device_102b_0100[] = "MGA 1064SG [Mystique]";
-static const char pci_device_102b_0518[] = "MGA-II [Athena]";
-static const char pci_device_102b_0519[] = "MGA 2064W [Millennium]";
-static const char pci_device_102b_051a[] = "MGA 1064SG [Mystique]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051a_102b_0100[] = "MGA-1064SG Mystique";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051a_102b_1100[] = "MGA-1084SG Mystique";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051a_102b_1200[] = "MGA-1084SG Mystique";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051a_1100_102b[] = "MGA-1084SG Mystique";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051a_110a_0018[] = "Scenic Pro C5 (D1025)";
-#endif
-static const char pci_device_102b_051b[] = "MGA 2164W [Millennium II]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051b_102b_051b[] = "MGA-2164W Millennium II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051b_102b_1100[] = "MGA-2164W Millennium II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_051b_102b_1200[] = "MGA-2164W Millennium II";
-#endif
-static const char pci_device_102b_051e[] = "MGA 1064SG [Mystique] AGP";
-static const char pci_device_102b_051f[] = "MGA 2164W [Millennium II] AGP";
-static const char pci_device_102b_0520[] = "MGA G200";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_dbc2[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_dbc8[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_dbe2[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_dbe8[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_ff03[] = "Millennium G200 SD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0520_102b_ff04[] = "Marvel G200";
-#endif
-static const char pci_device_102b_0521[] = "MGA G200 AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_1014_ff03[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_48e9[] = "Mystique G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_48f8[] = "Millennium G200 SD AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_4a60[] = "Millennium G200 LE AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_4a64[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_c93c[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_c9b0[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_c9bc[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ca60[] = "Millennium G250 LE AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ca6c[] = "Millennium G250 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbbc[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbc2[] = "Millennium G200 MMS (Dual G200)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbc3[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbc8[] = "Millennium G200 MMS (Dual G200)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd2[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd3[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd4[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd5[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd8[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbd9[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbe2[] = "Millennium G200 MMS (Quad G200)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbe3[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbe8[] = "Millennium G200 MMS (Quad G200)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf2[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf3[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf4[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf5[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf8[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_dbf9[] = "G200 Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_f806[] = "Mystique G200 Video AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ff00[] = "MGA-G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ff02[] = "Mystique G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ff03[] = "Millennium G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_102b_ff04[] = "Marvel G200 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0521_110a_0032[] = "MGA-G200 AGP";
-#endif
-static const char pci_device_102b_0525[] = "MGA G400 AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_0e11_b16f[] = "MGA-G400 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0328[] = "Millennium G400 16Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0338[] = "Millennium G400 16Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0378[] = "Millennium G400 32Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0541[] = "Millennium G450 Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0542[] = "Millennium G450 Dual Head LX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0543[] = "Millennium G450 Single Head LX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0641[] = "Millennium G450 32Mb SDRAM Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0642[] = "Millennium G450 32Mb SDRAM Dual Head LX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0643[] = "Millennium G450 32Mb SDRAM Single Head LX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_07c0[] = "Millennium G450 Dual Head LE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_07c1[] = "Millennium G450 SDR Dual Head LE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0d41[] = "Millennium G450 Dual Head PCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0d42[] = "Millennium G450 Dual Head LX PCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0e00[] = "Marvel G450 eTV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0e01[] = "Marvel G450 eTV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0e02[] = "Marvel G450 eTV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0e03[] = "Marvel G450 eTV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0f80[] = "Millennium G450 Low Profile";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0f81[] = "Millennium G450 Low Profile";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0f82[] = "Millennium G450 Low Profile DVI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_0f83[] = "Millennium G450 Low Profile DVI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_19d8[] = "Millennium G400 16Mb SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_19f8[] = "Millennium G400 32Mb SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_2159[] = "Millennium G400 Dual Head 16Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_2179[] = "Millennium G400 MAX/Dual Head 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_217d[] = "Millennium G400 Dual Head Max";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_23c0[] = "Millennium G450";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_23c1[] = "Millennium G450";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_23c2[] = "Millennium G450 DVI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_23c3[] = "Millennium G450 DVI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_2f58[] = "Millennium G400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_2f78[] = "Millennium G400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_3693[] = "Marvel G400 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_5dd0[] = "4Sight II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_5f50[] = "4Sight II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_5f51[] = "4Sight II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_5f52[] = "4Sight II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_102b_9010[] = "Millennium G400 Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_1458_0400[] = "GA-G400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_1705_0001[] = "Millennium G450 32MB SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_1705_0002[] = "Millennium G450 16MB SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_1705_0003[] = "Millennium G450 32MB";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0525_1705_0004[] = "Millennium G450 16MB";
-#endif
-static const char pci_device_102b_0527[] = "MGA Parhelia AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_0527_102b_0840[] = "Parhelia 128Mb";
-#endif
-static const char pci_device_102b_0d10[] = "MGA Ultima/Impression";
-static const char pci_device_102b_1000[] = "MGA G100 [Productiva]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1000_102b_ff01[] = "Productiva G100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1000_102b_ff05[] = "Productiva G100 Multi-Monitor";
-#endif
-static const char pci_device_102b_1001[] = "MGA G100 [Productiva] AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_1001[] = "MGA-G100 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_ff00[] = "MGA-G100 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_ff01[] = "MGA-G100 Productiva AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_ff03[] = "Millennium G100 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_ff04[] = "MGA-G100 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_102b_ff05[] = "MGA-G100 Productiva AGP Multi-Monitor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_1001_110a_001e[] = "MGA-G100 AGP";
-#endif
-static const char pci_device_102b_2007[] = "MGA Mistral";
-static const char pci_device_102b_2527[] = "MGA G550 AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_2527_102b_0f83[] = "Millennium G550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_2527_102b_0f84[] = "Millennium G550 Dual Head DDR 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102b_2527_102b_1e41[] = "Millennium G550";
-#endif
-static const char pci_device_102b_4536[] = "VIA Framegrabber";
-static const char pci_device_102b_6573[] = "Shark 10/100 Multiport SwitchNIC";
-static const char pci_vendor_102c[] = "Chips and Technologies";
-static const char pci_device_102c_00b8[] = "F64310";
-static const char pci_device_102c_00c0[] = "F69000 HiQVideo";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102c_00c0_102c_00c0[] = "F69000 HiQVideo";
-#endif
-static const char pci_device_102c_00d0[] = "F65545";
-static const char pci_device_102c_00d8[] = "F65545";
-static const char pci_device_102c_00dc[] = "F65548";
-static const char pci_device_102c_00e0[] = "F65550";
-static const char pci_device_102c_00e4[] = "F65554";
-static const char pci_device_102c_00e5[] = "F65555 HiQVPro";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102c_00e5_0e11_b049[] = "Armada 1700 Laptop Display Controller";
-#endif
-static const char pci_device_102c_00f0[] = "F68554";
-static const char pci_device_102c_00f4[] = "F68554 HiQVision";
-static const char pci_device_102c_00f5[] = "F68555";
-static const char pci_device_102c_0c30[] = "F69030";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_102d[] = "Wyse Technology Inc.";
-static const char pci_device_102d_50dc[] = "3328 Audio";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_102e[] = "Olivetti Advanced Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_102f[] = "Toshiba America";
-static const char pci_device_102f_0009[] = "r4x00";
-static const char pci_device_102f_0020[] = "ATM Meteor 155";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_102f_0020_102f_00f8[] = "ATM Meteor 155";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1030[] = "TMC Research";
-#endif
-static const char pci_vendor_1031[] = "Miro Computer Products AG";
-static const char pci_device_1031_5601[] = "DC20 ASIC";
-static const char pci_device_1031_5607[] = "Video I/O & motion JPEG compressor";
-static const char pci_device_1031_5631[] = "Media 3D";
-static const char pci_device_1031_6057[] = "MiroVideo DC10/DC30+";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1032[] = "Compaq";
-#endif
-static const char pci_vendor_1033[] = "NEC Corporation";
-static const char pci_device_1033_0001[] = "PCI to 486-like bus Bridge";
-static const char pci_device_1033_0002[] = "PCI to VL98 Bridge";
-static const char pci_device_1033_0003[] = "ATM Controller";
-static const char pci_device_1033_0004[] = "R4000 PCI Bridge";
-static const char pci_device_1033_0005[] = "PCI to 486-like bus Bridge";
-static const char pci_device_1033_0006[] = "PC-9800 Graphic Accelerator";
-static const char pci_device_1033_0007[] = "PCI to UX-Bus Bridge";
-static const char pci_device_1033_0008[] = "PC-9800 Graphic Accelerator";
-static const char pci_device_1033_0009[] = "PCI to PC9800 Core-Graph Bridge";
-static const char pci_device_1033_0016[] = "PCI to VL Bridge";
-static const char pci_device_1033_001a[] = "[Nile II]";
-static const char pci_device_1033_0021[] = "Vrc4373 [Nile I]";
-static const char pci_device_1033_0029[] = "PowerVR PCX1";
-static const char pci_device_1033_002a[] = "PowerVR 3D";
-static const char pci_device_1033_002c[] = "Star Alpha 2";
-static const char pci_device_1033_002d[] = "PCI to C-bus Bridge";
-static const char pci_device_1033_0035[] = "USB";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0035_1179_0001[] = "USB";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0035_12ee_7000[] = "Root Hub";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0035_1799_0001[] = "Root Hub";
-#endif
-static const char pci_device_1033_003b[] = "PCI to C-bus Bridge";
-static const char pci_device_1033_003e[] = "NAPCCARD Cardbus Controller";
-static const char pci_device_1033_0046[] = "PowerVR PCX2 [midas]";
-static const char pci_device_1033_005a[] = "Vrc5074 [Nile 4]";
-static const char pci_device_1033_0063[] = "Firewarden";
-static const char pci_device_1033_0067[] = "PowerVR Neon 250 Chipset";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0020[] = "PowerVR Neon 250 AGP 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0080[] = "PowerVR Neon 250 AGP 16Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0088[] = "PowerVR Neon 250 16Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0090[] = "PowerVR Neon 250 AGP 16Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0098[] = "PowerVR Neon 250 16Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_00a0[] = "PowerVR Neon 250 AGP 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_00a8[] = "PowerVR Neon 250 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0067_1010_0120[] = "PowerVR Neon 250 AGP 32Mb";
-#endif
-static const char pci_device_1033_0074[] = "56k Voice Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_0074_1033_8014[] = "RCV56ACF 56k Voice Modem";
-#endif
-static const char pci_device_1033_009b[] = "Vrc5476";
-static const char pci_device_1033_00a6[] = "VRC5477 AC97";
-static const char pci_device_1033_00cd[] = "IEEE 1394 [OrangeLink] Host Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_00cd_12ee_8011[] = "Root hub";
-#endif
-static const char pci_device_1033_00e0[] = "USB 2.0";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_00e0_12ee_7001[] = "Root hub";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1033_00e0_1799_0002[] = "Root Hub";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1034[] = "Framatome Connectors USA Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1035[] = "Comp. & Comm. Research Lab";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1036[] = "Future Domain Corp.";
-static const char pci_device_1036_0000[] = "TMC-18C30 [36C70]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1037[] = "Hitachi Micro Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1038[] = "AMP, Inc";
-#endif
-static const char pci_vendor_1039[] = "Silicon Integrated Systems [SiS]";
-static const char pci_device_1039_0001[] = "SiS 530 Virtual PCI-to-PCI bridge (AGP)";
-static const char pci_device_1039_0002[] = "SG86C202";
-static const char pci_device_1039_0006[] = "85C501/2/3";
-static const char pci_device_1039_0008[] = "85C503/5513";
-static const char pci_device_1039_0009[] = "ACPI";
-static const char pci_device_1039_0018[] = "SiS85C503/5513 (LPC Bridge)";
-static const char pci_device_1039_0200[] = "5597/5598/6326 VGA";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_0200_1039_0000[] = "SiS5597 SVGA (Shared RAM)";
-#endif
-static const char pci_device_1039_0204[] = "82C204";
-static const char pci_device_1039_0205[] = "SG86C205";
-static const char pci_device_1039_0300[] = "SiS300/305 PCI/AGP VGA Display Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_0300_107d_2720[] = "Leadtek WinFast VR300";
-#endif
-static const char pci_device_1039_0310[] = "SiS315H PCI/AGP VGA Display Adapter";
-static const char pci_device_1039_0315[] = "SiS315 PCI/AGP VGA Display Adapter";
-static const char pci_device_1039_0325[] = "SiS315PRO PCI/AGP VGA Display Adapter";
-static const char pci_device_1039_0330[] = "SiS330 [Xabre] PCI/AGP VGA Display Adapter";
-static const char pci_device_1039_0406[] = "85C501/2";
-static const char pci_device_1039_0496[] = "85C496";
-static const char pci_device_1039_0530[] = "530 Host";
-static const char pci_device_1039_0540[] = "540 Host";
-static const char pci_device_1039_0597[] = "5513C";
-static const char pci_device_1039_0601[] = "85C601";
-static const char pci_device_1039_0620[] = "620 Host";
-static const char pci_device_1039_0630[] = "630 Host";
-static const char pci_device_1039_0633[] = "633 Host";
-static const char pci_device_1039_0635[] = "635 Host";
-static const char pci_device_1039_0645[] = "SiS645 Host & Memory & AGP Controller";
-static const char pci_device_1039_0646[] = "SiS645DX Host & Memory & AGP Controller";
-static const char pci_device_1039_0648[] = "SiS 645xx";
-static const char pci_device_1039_0650[] = "650 Host";
-static const char pci_device_1039_0651[] = "SiS651 Host";
-static const char pci_device_1039_0730[] = "730 Host";
-static const char pci_device_1039_0733[] = "733 Host";
-static const char pci_device_1039_0735[] = "735 Host";
-static const char pci_device_1039_0740[] = "740 Host";
-static const char pci_device_1039_0745[] = "745 Host";
-static const char pci_device_1039_0755[] = "SiS 755 Host Bridge";
-static const char pci_device_1039_0900[] = "SiS900 10/100 Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_0900_1039_0900[] = "SiS900 10/100 Ethernet Adapter";
-#endif
-static const char pci_device_1039_0961[] = "SiS961 [MuTIOL Media IO]";
-static const char pci_device_1039_0962[] = "SiS962 [MuTIOL Media IO]";
-static const char pci_device_1039_3602[] = "83C602";
-static const char pci_device_1039_5107[] = "5107";
-static const char pci_device_1039_5300[] = "SiS540 PCI Display Adapter";
-static const char pci_device_1039_5315[] = "SiS550 AGP/VGA VGA Display Adapter";
-static const char pci_device_1039_5401[] = "486 PCI Chipset";
-static const char pci_device_1039_5511[] = "5511/5512";
-static const char pci_device_1039_5513[] = "5513 [IDE]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_5513_1019_0970[] = "P6STP-FL motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_5513_1039_5513[] = "SiS5513 EIDE Controller (A,B step)";
-#endif
-static const char pci_device_1039_5517[] = "5517";
-static const char pci_device_1039_5571[] = "5571";
-static const char pci_device_1039_5581[] = "5581 Pentium Chipset";
-static const char pci_device_1039_5582[] = "5582";
-static const char pci_device_1039_5591[] = "5591/5592 Host";
-static const char pci_device_1039_5596[] = "5596 Pentium Chipset";
-static const char pci_device_1039_5597[] = "5597 [SiS5582]";
-static const char pci_device_1039_5600[] = "5600 Host";
-static const char pci_device_1039_6204[] = "Video decoder & MPEG interface";
-static const char pci_device_1039_6205[] = "VGA Controller";
-static const char pci_device_1039_6236[] = "6236 3D-AGP";
-static const char pci_device_1039_6300[] = "SiS630 GUI Accelerator+3D";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6300_1019_0970[] = "P6STP-FL motherboard";
-#endif
-static const char pci_device_1039_6306[] = "SiS530 3D PCI/AGP";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6306_1039_6306[] = "SiS530,620 GUI Accelerator+3D";
-#endif
-static const char pci_device_1039_6325[] = "SiS650/651/M650/740 PCI/AGP VGA Display Adapter";
-static const char pci_device_1039_6326[] = "86C326 5598/6326";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1039_6326[] = "SiS6326 GUI Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1092_0a50[] = "SpeedStar A50";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1092_0a70[] = "SpeedStar A70";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1092_4910[] = "SpeedStar A70";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1092_4920[] = "SpeedStar A70";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_6326_1569_6326[] = "SiS6326 GUI Accelerator";
-#endif
-static const char pci_device_1039_7001[] = "USB 1.0 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7001_1039_7000[] = "Onboard USB Controller";
-#endif
-static const char pci_device_1039_7002[] = "USB 2.0 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7002_1509_7002[] = "Onboard USB Controller";
-#endif
-static const char pci_device_1039_7007[] = "FireWire Controller";
-static const char pci_device_1039_7012[] = "Sound Controller";
-static const char pci_device_1039_7013[] = "Intel 537 [56k Winmodem]";
-static const char pci_device_1039_7016[] = "10/100 Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7016_1039_7016[] = "SiS7016 10/100 Ethernet Adapter";
-#endif
-static const char pci_device_1039_7018[] = "SiS PCI Audio Accelerator";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1014_01b6[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1014_01b7[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1019_7018[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1025_000e[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1025_0018[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1039_7018[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1043_800b[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1054_7018[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_107d_5330[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_107d_5350[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1170_3209[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1462_400a[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_14a4_2089[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_14cd_2194[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_14ff_1100[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_152d_8808[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1558_1103[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1558_2200[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_1563_7018[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_15c5_0111[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_270f_a171[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1039_7018_a0a0_0022[] = "SiS PCI Audio Accelerator";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_103a[] = "Seiko Epson Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_103b[] = "Tatung Co. of America";
-#endif
-static const char pci_vendor_103c[] = "Hewlett-Packard Company";
-static const char pci_device_103c_1005[] = "A4977A Visualize EG";
-static const char pci_device_103c_1006[] = "Visualize FX6";
-static const char pci_device_103c_1008[] = "Visualize FX4";
-static const char pci_device_103c_100a[] = "Visualize FX2";
-static const char pci_device_103c_1028[] = "Tach TL Fibre Channel Host Adapter";
-static const char pci_device_103c_1029[] = "Tach XL2 Fibre Channel Host Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1029_107e_000f[] = "Interphase 5560 Fibre Channel Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1029_9004_9210[] = "1Gb/2Gb Family Fibre Channel Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1029_9004_9211[] = "1Gb/2Gb Family Fibre Channel Controller";
-#endif
-static const char pci_device_103c_102a[] = "Tach TS Fibre Channel Host Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_102a_107e_000e[] = "Interphase 5540/5541 Fibre Channel Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_102a_9004_9110[] = "1Gb/2Gb Family Fibre Channel Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_102a_9004_9111[] = "1Gb/2Gb Family Fibre Channel Controller";
-#endif
-static const char pci_device_103c_1030[] = "J2585A DeskDirect 10/100VG NIC";
-static const char pci_device_103c_1031[] = "J2585B HP 10/100VG PCI LAN Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1031_103c_1040[] = "J2973A DeskDirect 10BaseT NIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1031_103c_1041[] = "J2585B DeskDirect 10/100VG NIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1031_103c_1042[] = "J2970A DeskDirect 10BaseT/2 NIC";
-#endif
-static const char pci_device_103c_1040[] = "J2973A DeskDirect 10BaseT NIC";
-static const char pci_device_103c_1041[] = "J2585B DeskDirect 10/100 NIC";
-static const char pci_device_103c_1042[] = "J2970A DeskDirect 10BaseT/2 NIC";
-static const char pci_device_103c_1048[] = "Diva Serial [GSP] Multiport UART";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_1049[] = "Tosca Console";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_104a[] = "Tosca Secondary";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_104b[] = "Maestro SP2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_1223[] = "Halfdome Console";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_1226[] = "Keystone SP2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_1227[] = "Powerbar SP2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_103c_1048_103c_1282[] = "Everest SP2";
-#endif
-static const char pci_device_103c_1064[] = "79C970 PCnet Ethernet Controller";
-static const char pci_device_103c_108b[] = "Visualize FXe";
-static const char pci_device_103c_10c1[] = "NetServer Smart IRQ Router";
-static const char pci_device_103c_10ed[] = "TopTools Remote Control";
-static const char pci_device_103c_1200[] = "82557B 10/100 NIC";
-static const char pci_device_103c_1219[] = "NetServer PCI Hot-Plug Controller";
-static const char pci_device_103c_121a[] = "NetServer SMIC Controller";
-static const char pci_device_103c_121b[] = "NetServer Legacy COM Port Decoder";
-static const char pci_device_103c_121c[] = "NetServer PCI COM Port Decoder";
-static const char pci_device_103c_1229[] = "zx1 System Bus Adapter";
-static const char pci_device_103c_122a[] = "zx1 I/O Controller";
-static const char pci_device_103c_122e[] = "zx1 Local Bus Adapter";
-static const char pci_device_103c_1290[] = "Auxiliary Diva Serial Port";
-static const char pci_device_103c_12b4[] = "zx1 QuickSilver AGP8x LBA";
-static const char pci_device_103c_2910[] = "E2910A PCIBus Exerciser";
-static const char pci_device_103c_2925[] = "E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_103e[] = "Solliday Engineering";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_103f[] = "Synopsys/Logic Modeling Group";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1040[] = "Accelgraphics Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1041[] = "Computrend";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1042[] = "Micron";
-static const char pci_device_1042_1000[] = "PC Tech RZ1000";
-static const char pci_device_1042_1001[] = "PC Tech RZ1001";
-static const char pci_device_1042_3000[] = "Samurai_0";
-static const char pci_device_1042_3010[] = "Samurai_1";
-static const char pci_device_1042_3020[] = "Samurai_IDE";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1043[] = "Asustek Computer, Inc.";
-static const char pci_device_1043_0675[] = "ISDNLink P-IN100-ST-D";
-static const char pci_device_1043_4021[] = "v7100 Combo Deluxe [GeForce2 MX + TV tuner]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1044[] = "Distributed Processing Technology";
-static const char pci_device_1044_1012[] = "Domino RAID Engine";
-static const char pci_device_1044_a400[] = "SmartCache/Raid I-IV Controller";
-static const char pci_device_1044_a500[] = "PCI Bridge";
-static const char pci_device_1044_a501[] = "SmartRAID V Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c001[] = "PM1554U2 Ultra2 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c002[] = "PM1654U2 Ultra2 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c003[] = "PM1564U3 Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c004[] = "PM1564U3 Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c005[] = "PM1554U2 Ultra2 Single Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00a[] = "PM2554U2 Ultra2 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00b[] = "PM2654U2 Ultra2 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00c[] = "PM2664U3 Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00d[] = "PM2664U3 Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00e[] = "PM2554U2 Ultra2 Single Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c00f[] = "PM2654U2 Ultra2 Single Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c014[] = "PM3754U2 Ultra2 Single Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c015[] = "PM3755U2B Ultra2 Single Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c016[] = "PM3755F Fibre Channel (NON ACPI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c01e[] = "PM3757U2 Ultra2 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c01f[] = "PM3757U2 Ultra2 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c020[] = "PM3767U3 Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c021[] = "PM3767U3 Ultra3 Quad Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c028[] = "PM2865U3 Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c029[] = "PM2865U3 Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c02a[] = "PM2865F Fibre Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c03c[] = "2000S Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c03d[] = "2000S Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c03e[] = "2000F Fibre Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c046[] = "3000S Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c047[] = "3000S Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c048[] = "3000F Fibre Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c050[] = "5000S Ultra3 Single Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c051[] = "5000S Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c052[] = "5000F Fibre Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c05a[] = "2400A UDMA Four Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c05b[] = "2400A UDMA Four Channel DAC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c064[] = "3010S Ultra3 Dual Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c065[] = "3010S Ultra3 Four Channel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1044_a501_1044_c066[] = "3010S Fibre Channel";
-#endif
-static const char pci_device_1044_a511[] = "SmartRAID V Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1045[] = "OPTi Inc.";
-static const char pci_device_1045_a0f8[] = "82C750 [Vendetta] USB Controller";
-static const char pci_device_1045_c101[] = "92C264";
-static const char pci_device_1045_c178[] = "92C178";
-static const char pci_device_1045_c556[] = "82X556 [Viper]";
-static const char pci_device_1045_c557[] = "82C557 [Viper-M]";
-static const char pci_device_1045_c558[] = "82C558 [Viper-M ISA+IDE]";
-static const char pci_device_1045_c567[] = "82C750 [Vendetta], device 0";
-static const char pci_device_1045_c568[] = "82C750 [Vendetta], device 1";
-static const char pci_device_1045_c569[] = "82C579 [Viper XPress+ Chipset]";
-static const char pci_device_1045_c621[] = "82C621 [Viper-M/N+]";
-static const char pci_device_1045_c700[] = "82C700 [FireStar]";
-static const char pci_device_1045_c701[] = "82C701 [FireStar Plus]";
-static const char pci_device_1045_c814[] = "82C814 [Firebridge 1]";
-static const char pci_device_1045_c822[] = "82C822";
-static const char pci_device_1045_c824[] = "82C824";
-static const char pci_device_1045_c825[] = "82C825 [Firebridge 2]";
-static const char pci_device_1045_c832[] = "82C832";
-static const char pci_device_1045_c861[] = "82C861";
-static const char pci_device_1045_c895[] = "82C895";
-static const char pci_device_1045_c935[] = "EV1935 ECTIVA MachOne PCI Audio";
-static const char pci_device_1045_d568[] = "82C825 [Firebridge 2]";
-static const char pci_device_1045_d721[] = "IDE [FireStar]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1046[] = "IPC Corporation, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1047[] = "Genoa Systems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1048[] = "Elsa AG";
-static const char pci_device_1048_0d22[] = "Quadro4 900XGL [ELSA GLoria4 900XGL]";
-static const char pci_device_1048_1000[] = "QuickStep 1000";
-static const char pci_device_1048_3000[] = "QuickStep 3000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1049[] = "Fountain Technologies, Inc.";
-#endif
-static const char pci_vendor_104a[] = "SGS Thomson Microelectronics";
-static const char pci_device_104a_0008[] = "STG 2000X";
-static const char pci_device_104a_0009[] = "STG 1764X";
-static const char pci_device_104a_0010[] = "STG4000 [3D Prophet Kyro Series]";
-static const char pci_device_104a_0210[] = "STPC Atlas ISA Bridge";
-static const char pci_device_104a_0981[] = "DEC-Tulip compatible 10/100 Ethernet";
-static const char pci_device_104a_1746[] = "STG 1764X";
-static const char pci_device_104a_2774[] = "DEC-Tulip compatible 10/100 Ethernet";
-static const char pci_device_104a_3520[] = "MPEG-II decoder card";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_104b[] = "BusLogic";
-static const char pci_device_104b_0140[] = "BT-946C (old) [multimaster 01]";
-static const char pci_device_104b_1040[] = "BT-946C (BA80C30) [MultiMaster 10]";
-static const char pci_device_104b_8130[] = "Flashpoint LT";
-#endif
-static const char pci_vendor_104c[] = "Texas Instruments";
-static const char pci_device_104c_0500[] = "100 MBit LAN Controller";
-static const char pci_device_104c_0508[] = "TMS380C2X Compressor Interface";
-static const char pci_device_104c_1000[] = "Eagle i/f AS";
-static const char pci_device_104c_104c[] = "PCI1510 PC card Cardbus Controller";
-static const char pci_device_104c_3d04[] = "TVP4010 [Permedia]";
-static const char pci_device_104c_3d07[] = "TVP4020 [Permedia 2]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1011_4d10[] = "Comet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1040_000f[] = "AccelStar II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1040_0011[] = "AccelStar II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1048_0a31[] = "WINNER 2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1048_0a32[] = "GLoria Synergy";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1048_0a35[] = "GLoria Synergy";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_107d_2633[] = "WinFast 3D L2300";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0127[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0136[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0141[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0146[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0148[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0149[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0152[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0154[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0155[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0156[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1092_0157[] = "FIRE GL 1000 PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1097_3d01[] = "Jeronimo Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_1102_100f[] = "Graphics Blaster Extreme";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_3d07_3d3d_0100[] = "Reference Permedia 2 3D";
-#endif
-static const char pci_device_104c_8000[] = "PCILynx/PCILynx2 IEEE 1394 Link Layer Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8000_e4bf_1010[] = "CF1-1-SNARE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8000_e4bf_1020[] = "CF1-2-SNARE";
-#endif
-static const char pci_device_104c_8009[] = "FireWire Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8009_104d_8032[] = "8032 OHCI i.LINK (IEEE 1394) Controller";
-#endif
-static const char pci_device_104c_8017[] = "PCI4410 FireWire Controller";
-static const char pci_device_104c_8019[] = "TSB12LV23 IEEE-1394 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8019_11bd_000a[] = "Studio DV500-1394";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8019_11bd_000e[] = "Studio DV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8019_e4bf_1010[] = "CF2-1-CYMBAL";
-#endif
-static const char pci_device_104c_8020[] = "TSB12LV26 IEEE-1394 Controller (Link)";
-static const char pci_device_104c_8021[] = "TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8021_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8021_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-static const char pci_device_104c_8022[] = "TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)";
-static const char pci_device_104c_8023[] = "TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)";
-static const char pci_device_104c_8024[] = "TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)";
-static const char pci_device_104c_8026[] = "TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)";
-static const char pci_device_104c_8027[] = "PCI4451 IEEE-1394 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_8027_1028_00e6[] = "PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)";
-#endif
-static const char pci_device_104c_8400[] = "ACX 100 22Mbps Wireless Interface";
-static const char pci_device_104c_a001[] = "TDC1570";
-static const char pci_device_104c_a100[] = "TDC1561";
-static const char pci_device_104c_a102[] = "TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f";
-static const char pci_device_104c_a106[] = "TMS320C6205";
-static const char pci_device_104c_ac10[] = "PCI1050";
-static const char pci_device_104c_ac11[] = "PCI1053";
-static const char pci_device_104c_ac12[] = "PCI1130";
-static const char pci_device_104c_ac13[] = "PCI1031";
-static const char pci_device_104c_ac15[] = "PCI1131";
-static const char pci_device_104c_ac16[] = "PCI1250";
-static const char pci_device_104c_ac17[] = "PCI1220";
-static const char pci_device_104c_ac18[] = "PCI1260";
-static const char pci_device_104c_ac19[] = "PCI1221";
-static const char pci_device_104c_ac1a[] = "PCI1210";
-static const char pci_device_104c_ac1b[] = "PCI1450";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac1b_0e11_b113[] = "Armada M700";
-#endif
-static const char pci_device_104c_ac1c[] = "PCI1225";
-static const char pci_device_104c_ac1d[] = "PCI1251A";
-static const char pci_device_104c_ac1e[] = "PCI1211";
-static const char pci_device_104c_ac1f[] = "PCI1251B";
-static const char pci_device_104c_ac20[] = "TI 2030";
-static const char pci_device_104c_ac21[] = "PCI2031";
-static const char pci_device_104c_ac22[] = "PCI2032 PCI Docking Bridge";
-static const char pci_device_104c_ac23[] = "PCI2250 PCI-to-PCI Bridge";
-static const char pci_device_104c_ac28[] = "PCI2050 PCI-to-PCI Bridge";
-static const char pci_device_104c_ac30[] = "PCI1260 PC card Cardbus Controller";
-static const char pci_device_104c_ac40[] = "PCI4450 PC card Cardbus Controller";
-static const char pci_device_104c_ac41[] = "PCI4410 PC card Cardbus Controller";
-static const char pci_device_104c_ac42[] = "PCI4451 PC card Cardbus Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac42_1028_00e6[] = "PCI4451 PC card CardBus Controller (Dell Inspiron 8100)";
-#endif
-static const char pci_device_104c_ac50[] = "PCI1410 PC card Cardbus Controller";
-static const char pci_device_104c_ac51[] = "PCI1420";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac51_1014_023b[] = "ThinkPad T23 (2647-4MG)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac51_10cf_1095[] = "Lifebook C6155";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac51_e4bf_1000[] = "CP2-2-HIPHOP";
-#endif
-static const char pci_device_104c_ac52[] = "PCI1451 PC card Cardbus Controller";
-static const char pci_device_104c_ac53[] = "PCI1421 PC card Cardbus Controller";
-static const char pci_device_104c_ac55[] = "PCI1250 PC card Cardbus Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_104c_ac55_1014_0512[] = "ThinkPad T30";
-#endif
-static const char pci_device_104c_ac56[] = "PCI1510 PC card Cardbus Controller";
-static const char pci_device_104c_ac60[] = "PCI2040 PCI to DSP Bridge Controller";
-static const char pci_device_104c_fe00[] = "FireWire Host Controller";
-static const char pci_device_104c_fe03[] = "12C01A FireWire Host Controller";
-static const char pci_vendor_104d[] = "Sony Corporation";
-static const char pci_device_104d_8009[] = "CXD1947Q i.LINK Controller";
-static const char pci_device_104d_8039[] = "CXD3222 i.LINK Controller";
-static const char pci_device_104d_8056[] = "Rockwell HCF 56K modem";
-static const char pci_device_104d_808a[] = "Memory Stick Controller";
-static const char pci_vendor_104e[] = "Oak Technology, Inc";
-static const char pci_device_104e_0017[] = "OTI-64017";
-static const char pci_device_104e_0107[] = "OTI-107 [Spitfire]";
-static const char pci_device_104e_0109[] = "Video Adapter";
-static const char pci_device_104e_0111[] = "OTI-64111 [Spitfire]";
-static const char pci_device_104e_0217[] = "OTI-64217";
-static const char pci_device_104e_0317[] = "OTI-64317";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_104f[] = "Co-time Computer Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1050[] = "Winbond Electronics Corp";
-static const char pci_device_1050_0000[] = "NE2000";
-static const char pci_device_1050_0001[] = "W83769F";
-static const char pci_device_1050_0105[] = "W82C105";
-static const char pci_device_1050_0840[] = "W89C840";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1050_0840_1050_0001[] = "W89C840 Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1050_0840_1050_0840[] = "W89C840 Ethernet Adapter";
-#endif
-static const char pci_device_1050_0940[] = "W89C940";
-static const char pci_device_1050_5a5a[] = "W89C940F";
-static const char pci_device_1050_6692[] = "W6692";
-static const char pci_device_1050_9970[] = "W9970CF";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1051[] = "Anigma, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1052[] = "?Young Micro Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1053[] = "Young Micro Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1054[] = "Hitachi, Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1055[] = "Efar Microsystems";
-static const char pci_device_1055_9130[] = "SLC90E66 [Victory66] IDE";
-static const char pci_device_1055_9460[] = "SLC90E66 [Victory66] ISA";
-static const char pci_device_1055_9462[] = "SLC90E66 [Victory66] USB";
-static const char pci_device_1055_9463[] = "SLC90E66 [Victory66] ACPI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1056[] = "ICL";
-#endif
-static const char pci_vendor_1057[] = "Motorola";
-static const char pci_device_1057_0001[] = "MPC105 [Eagle]";
-static const char pci_device_1057_0002[] = "MPC106 [Grackle]";
-static const char pci_device_1057_0003[] = "MPC8240 [Kahlua]";
-static const char pci_device_1057_0004[] = "MPC107";
-static const char pci_device_1057_0006[] = "MPC8245 [Unity]";
-static const char pci_device_1057_0100[] = "MC145575 [HFC-PCI]";
-static const char pci_device_1057_0431[] = "KTI829c 100VG";
-static const char pci_device_1057_1801[] = "Audio I/O Controller (MIDI)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_1801_ecc0_0030[] = "Layla";
-#endif
-static const char pci_device_1057_18c0[] = "MPC8265A/MPC8266";
-static const char pci_device_1057_4801[] = "Raven";
-static const char pci_device_1057_4802[] = "Falcon";
-static const char pci_device_1057_4803[] = "Hawk";
-static const char pci_device_1057_4806[] = "CPX8216";
-static const char pci_device_1057_4d68[] = "20268";
-static const char pci_device_1057_5600[] = "SM56 PCI Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1057_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1057_0301[] = "SM56 PCI Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1057_0302[] = "SM56 PCI Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1057_5600[] = "SM56 PCI Voice modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_13d2_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_13d2_0301[] = "SM56 PCI Voice modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_13d2_0302[] = "SM56 PCI Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1436_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1436_0301[] = "SM56 PCI Voice modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1436_0302[] = "SM56 PCI Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_144f_100c[] = "SM56 PCI Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1494_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1494_0301[] = "SM56 PCI Voice modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_14c8_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_14c8_0302[] = "SM56 PCI Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1668_0300[] = "SM56 PCI Speakerphone Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1057_5600_1668_0302[] = "SM56 PCI Fax Modem";
-#endif
-static const char pci_device_1057_6400[] = "MPC190 Security Processor (S1 family, encryption)";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1058[] = "Electronics & Telecommunications RSH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1059[] = "Teknor Industrial Computers Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_105a[] = "Promise Technology, Inc.";
-static const char pci_device_105a_0d30[] = "20265";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_0d30_105a_4d33[] = "Ultra100";
-#endif
-static const char pci_device_105a_0d38[] = "20263";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_0d38_105a_4d39[] = "Fasttrak66";
-#endif
-static const char pci_device_105a_1275[] = "20275";
-static const char pci_device_105a_3376[] = "PDC20376";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_3376_1043_809e[] = "A7V8X motherboard";
-#endif
-static const char pci_device_105a_4d30[] = "20267";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d30_105a_4d33[] = "Ultra100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d30_105a_4d39[] = "Fasttrak100";
-#endif
-static const char pci_device_105a_4d33[] = "20246";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d33_105a_4d33[] = "20246 IDE Controller";
-#endif
-static const char pci_device_105a_4d38[] = "20262";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d38_105a_4d30[] = "Ultra Device on SuperTrak";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d38_105a_4d33[] = "Ultra66";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d38_105a_4d39[] = "Fasttrak66";
-#endif
-static const char pci_device_105a_4d68[] = "20268";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d68_105a_4d68[] = "Ultra100TX2";
-#endif
-static const char pci_device_105a_4d69[] = "20269";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_4d69_105a_4d68[] = "Ultra133TX2";
-#endif
-static const char pci_device_105a_5275[] = "PDC20276 IDE";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_5275_105a_0275[] = "SuperTrak SX6000 IDE";
-#endif
-static const char pci_device_105a_5300[] = "DC5300";
-static const char pci_device_105a_6268[] = "20268R";
-static const char pci_device_105a_6269[] = "PDC20271";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105a_6269_105a_6269[] = "FastTrak TX2/TX2000";
-#endif
-static const char pci_device_105a_6621[] = "PDC20621 [SX4000] 4 Channel IDE RAID Controller";
-static const char pci_device_105a_7275[] = "PDC20277";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_105b[] = "Foxconn International, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_105c[] = "Wipro Infotech Limited";
-#endif
-static const char pci_vendor_105d[] = "Number 9 Computer Company";
-static const char pci_device_105d_2309[] = "Imagine 128";
-static const char pci_device_105d_2339[] = "Imagine 128-II";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0000[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0001[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0002[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0003[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0004[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0005[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0006[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0007[] = "Imagine 128 series 2 4Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0008[] = "Imagine 128 series 2e 4Mb DRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_0009[] = "Imagine 128 series 2e 4Mb DRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_000a[] = "Imagine 128 series 2 8Mb VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_105d_000b[] = "Imagine 128 series 2 8Mb H-VRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_11a4_000a[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0000[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0004[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0005[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0006[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0008[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_0009[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_000a[] = "Barco Metheus 5 Megapixel";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_2339_13cc_000c[] = "Barco Metheus 5 Megapixel";
-#endif
-static const char pci_device_105d_493d[] = "Imagine 128 T2R [Ticket to Ride]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_11a4_000a[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_11a4_000b[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_0002[] = "Barco Metheus 4 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_0003[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_0007[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_0008[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_0009[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_493d_13cc_000a[] = "Barco Metheus 5 Megapixel, Dual Head";
-#endif
-static const char pci_device_105d_5348[] = "Revolution 4";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_105d_5348_105d_0037[] = "Revolution IV-FP AGP (For SGI 1600SW)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_105e[] = "Vtech Computers Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_105f[] = "Infotronic America Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1060[] = "United Microelectronics [UMC]";
-static const char pci_device_1060_0001[] = "UM82C881";
-static const char pci_device_1060_0002[] = "UM82C886";
-static const char pci_device_1060_0101[] = "UM8673F";
-static const char pci_device_1060_0881[] = "UM8881";
-static const char pci_device_1060_0886[] = "UM8886F";
-static const char pci_device_1060_0891[] = "UM8891A";
-static const char pci_device_1060_1001[] = "UM886A";
-static const char pci_device_1060_673a[] = "UM8886BF";
-static const char pci_device_1060_673b[] = "EIDE Master/DMA";
-static const char pci_device_1060_8710[] = "UM8710";
-static const char pci_device_1060_886a[] = "UM8886A";
-static const char pci_device_1060_8881[] = "UM8881F";
-static const char pci_device_1060_8886[] = "UM8886F";
-static const char pci_device_1060_888a[] = "UM8886A";
-static const char pci_device_1060_8891[] = "UM8891A";
-static const char pci_device_1060_9017[] = "UM9017F";
-static const char pci_device_1060_9018[] = "UM9018";
-static const char pci_device_1060_9026[] = "UM9026";
-static const char pci_device_1060_e881[] = "UM8881N";
-static const char pci_device_1060_e886[] = "UM8886N";
-static const char pci_device_1060_e88a[] = "UM8886N";
-static const char pci_device_1060_e891[] = "UM8891N";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1061[] = "I.I.T.";
-static const char pci_device_1061_0001[] = "AGX016";
-static const char pci_device_1061_0002[] = "IIT3204/3501";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1062[] = "Maspar Computer Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1063[] = "Ocean Office Automation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1064[] = "Alcatel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1065[] = "Texas Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1066[] = "PicoPower Technology";
-static const char pci_device_1066_0000[] = "PT80C826";
-static const char pci_device_1066_0001[] = "PT86C521 [Vesuvius v1] Host Bridge";
-static const char pci_device_1066_0002[] = "PT86C523 [Vesuvius v3] PCI-ISA Bridge Master";
-static const char pci_device_1066_0003[] = "PT86C524 [Nile] PCI-to-PCI Bridge";
-static const char pci_device_1066_0004[] = "PT86C525 [Nile-II] PCI-to-PCI Bridge";
-static const char pci_device_1066_0005[] = "National PC87550 System Controller";
-static const char pci_device_1066_8002[] = "PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1067[] = "Mitsubishi Electric";
-static const char pci_device_1067_1002[] = "VG500 [VolumePro Volume Rendering Accelerator]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1068[] = "Diversified Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1069[] = "Mylex Corporation";
-static const char pci_device_1069_0001[] = "DAC960P";
-static const char pci_device_1069_0002[] = "DAC960PD";
-static const char pci_device_1069_0010[] = "DAC960PX";
-static const char pci_device_1069_0050[] = "AcceleRAID 352/170/160 support Device";
-static const char pci_device_1069_ba55[] = "eXtremeRAID 1100 support Device";
-static const char pci_device_1069_ba56[] = "eXtremeRAID 2000/3000 support Device";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106a[] = "Aten Research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106b[] = "Apple Computer Inc.";
-static const char pci_device_106b_0001[] = "Bandit PowerPC host bridge";
-static const char pci_device_106b_0002[] = "Grand Central I/O";
-static const char pci_device_106b_0003[] = "Control Video";
-static const char pci_device_106b_0004[] = "PlanB Video-In";
-static const char pci_device_106b_0007[] = "O'Hare I/O";
-static const char pci_device_106b_000e[] = "Hydra Mac I/O";
-static const char pci_device_106b_0010[] = "Heathrow Mac I/O";
-static const char pci_device_106b_0017[] = "Paddington Mac I/O";
-static const char pci_device_106b_0018[] = "UniNorth FireWire";
-static const char pci_device_106b_0019[] = "KeyLargo USB";
-static const char pci_device_106b_001e[] = "UniNorth Internal PCI";
-static const char pci_device_106b_001f[] = "UniNorth PCI";
-static const char pci_device_106b_0020[] = "UniNorth AGP";
-static const char pci_device_106b_0021[] = "UniNorth GMAC (Sun GEM)";
-static const char pci_device_106b_0022[] = "KeyLargo Mac I/O";
-static const char pci_device_106b_0024[] = "UniNorth/Pangea GMAC (Sun GEM)";
-static const char pci_device_106b_0025[] = "KeyLargo/Pangea Mac I/O";
-static const char pci_device_106b_0026[] = "KeyLargo/Pangea USB";
-static const char pci_device_106b_0027[] = "UniNorth/Pangea AGP";
-static const char pci_device_106b_0028[] = "UniNorth/Pangea PCI";
-static const char pci_device_106b_0029[] = "UniNorth/Pangea Internal PCI";
-static const char pci_device_106b_002d[] = "UniNorth 1.5 AGP";
-static const char pci_device_106b_002e[] = "UniNorth 1.5 PCI";
-static const char pci_device_106b_002f[] = "UniNorth 1.5 Internal PCI";
-static const char pci_device_106b_0030[] = "UniNorth/Pangea FireWire";
-static const char pci_device_106b_0031[] = "UniNorth 2 FireWire";
-static const char pci_device_106b_0032[] = "UniNorth 2 GMAC (Sun GEM)";
-static const char pci_device_106b_0033[] = "UniNorth 2 ATA/100";
-static const char pci_device_106b_0034[] = "UniNorth 2 AGP";
-static const char pci_device_106b_1645[] = "Tigon3 Gigabit Ethernet NIC (BCM5701)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106c[] = "Hyundai Electronics America";
-static const char pci_device_106c_8801[] = "Dual Pentium ISA/PCI Motherboard";
-static const char pci_device_106c_8802[] = "PowerPC ISA/PCI Motherboard";
-static const char pci_device_106c_8803[] = "Dual Window Graphics Accelerator";
-static const char pci_device_106c_8804[] = "LAN Controller";
-static const char pci_device_106c_8805[] = "100-BaseT LAN";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106d[] = "Sequent Computer Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106e[] = "DFI, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_106f[] = "City Gate Development Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1070[] = "Daewoo Telecom Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1071[] = "Mitac";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1072[] = "GIT Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1073[] = "Yamaha Corporation";
-static const char pci_device_1073_0001[] = "3D GUI Accelerator";
-static const char pci_device_1073_0002[] = "YGV615 [RPA3 3D-Graphics Controller]";
-static const char pci_device_1073_0003[] = "YMF-740";
-static const char pci_device_1073_0004[] = "YMF-724";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0004_1073_0004[] = "YMF724-Based PCI Audio Adapter";
-#endif
-static const char pci_device_1073_0005[] = "DS1 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0005_1073_0005[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_0006[] = "DS1 Audio";
-static const char pci_device_1073_0008[] = "DS1 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0008_1073_0008[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_000a[] = "DS1L Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_000a_1073_0004[] = "DS-XG PCI Audio CODEC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_000a_1073_000a[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_000c[] = "YMF-740C [DS-1L Audio Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_000c_107a_000c[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_000d[] = "YMF-724F [DS-1 Audio Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_000d_1073_000d[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_0010[] = "YMF-744B [DS-1S Audio Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0010_1073_0006[] = "DS-XG PCI Audio CODEC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0010_1073_0010[] = "DS-XG PCI Audio CODEC";
-#endif
-static const char pci_device_1073_0012[] = "YMF-754 [DS-1E Audio Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_0012_1073_0012[] = "DS-XG PCI Audio Codec";
-#endif
-static const char pci_device_1073_0020[] = "DS-1 Audio";
-static const char pci_device_1073_2000[] = "DS2416 Digital Mixing Card";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1073_2000_1073_2000[] = "DS2416 Digital Mixing Card";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1074[] = "NexGen Microsystems";
-static const char pci_device_1074_4e78[] = "82c500/1";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1075[] = "Advanced Integrations Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1076[] = "Chaintech Computer Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1077[] = "QLogic Corp.";
-static const char pci_device_1077_1016[] = "ISP10160 Single Channel Ultra3 SCSI Processor";
-static const char pci_device_1077_1020[] = "ISP1020 Fast-wide SCSI";
-static const char pci_device_1077_1022[] = "ISP1022 Fast-wide SCSI";
-static const char pci_device_1077_1080[] = "ISP1080 SCSI Host Adapter";
-static const char pci_device_1077_1216[] = "ISP12160 Dual Channel Ultra3 SCSI Processor";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1077_1216_101e_8471[] = "QLA12160 on AMI MegaRAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1077_1216_101e_8493[] = "QLA12160 on AMI MegaRAID";
-#endif
-static const char pci_device_1077_1240[] = "ISP1240 SCSI Host Adapter";
-static const char pci_device_1077_1280[] = "ISP1280";
-static const char pci_device_1077_2020[] = "ISP2020A Fast!SCSI Basic Adapter";
-static const char pci_device_1077_2100[] = "QLA2100 64-bit Fibre Channel Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1077_2100_1077_0001[] = "QLA2100 64-bit Fibre Channel Adapter";
-#endif
-static const char pci_device_1077_2200[] = "QLA2200";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1077_2200_1077_0002[] = "QLA2200";
-#endif
-static const char pci_device_1077_2300[] = "QLA2300 64-bit FC-AL Adapter";
-static const char pci_device_1077_2312[] = "QLA2312 Fibre Channel Adapter";
-#endif
-static const char pci_vendor_1078[] = "Cyrix Corporation";
-static const char pci_device_1078_0000[] = "5510 [Grappa]";
-static const char pci_device_1078_0001[] = "PCI Master";
-static const char pci_device_1078_0002[] = "5520 [Cognac]";
-static const char pci_device_1078_0100[] = "5530 Legacy [Kahlua]";
-static const char pci_device_1078_0101[] = "5530 SMI [Kahlua]";
-static const char pci_device_1078_0102[] = "5530 IDE [Kahlua]";
-static const char pci_device_1078_0103[] = "5530 Audio [Kahlua]";
-static const char pci_device_1078_0104[] = "5530 Video [Kahlua]";
-static const char pci_device_1078_0400[] = "ZFMicro PCI Bridge";
-static const char pci_device_1078_0401[] = "ZFMicro Chipset SMI";
-static const char pci_device_1078_0402[] = "ZFMicro Chipset IDE";
-static const char pci_device_1078_0403[] = "ZFMicro Expansion Bus";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1079[] = "I-Bus";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107a[] = "NetWorth";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107b[] = "Gateway 2000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107c[] = "LG Electronics [Lucky Goldstar Co. Ltd]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107d[] = "LeadTek Research Inc.";
-static const char pci_device_107d_0000[] = "P86C850";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107e[] = "Interphase Corporation";
-static const char pci_device_107e_0001[] = "5515 ATM Adapter [Flipper]";
-static const char pci_device_107e_0002[] = "100 VG AnyLan Controller";
-static const char pci_device_107e_0004[] = "5526 Fibre Channel Host Adapter";
-static const char pci_device_107e_0005[] = "x526 Fibre Channel Host Adapter";
-static const char pci_device_107e_0008[] = "5525/5575 ATM Adapter (155 Mbit) [Atlantic]";
-static const char pci_device_107e_9003[] = "5535-4P-BRI-ST";
-static const char pci_device_107e_9007[] = "5535-4P-BRI-U";
-static const char pci_device_107e_9008[] = "5535-1P-SR";
-static const char pci_device_107e_900c[] = "5535-1P-SR-ST";
-static const char pci_device_107e_900e[] = "5535-1P-SR-U";
-static const char pci_device_107e_9011[] = "5535-1P-PRI";
-static const char pci_device_107e_9013[] = "5535-2P-PRI";
-static const char pci_device_107e_9023[] = "5536-4P-BRI-ST";
-static const char pci_device_107e_9027[] = "5536-4P-BRI-U";
-static const char pci_device_107e_9031[] = "5536-1P-PRI";
-static const char pci_device_107e_9033[] = "5536-2P-PRI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_107f[] = "Data Technology Corporation";
-static const char pci_device_107f_0802[] = "SL82C105";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1080[] = "Contaq Microsystems";
-static const char pci_device_1080_0600[] = "82C599";
-static const char pci_device_1080_c691[] = "Cypress CY82C691";
-static const char pci_device_1080_c693[] = "82c693";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1081[] = "Supermac Technology";
-static const char pci_device_1081_0d47[] = "Radius PCI to NuBUS Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1082[] = "EFA Corporation of America";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1083[] = "Forex Computer Corporation";
-static const char pci_device_1083_0001[] = "FR710";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1084[] = "Parador";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1085[] = "Tulip Computers Int.B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1086[] = "J. Bond Computer Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1087[] = "Cache Computer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1088[] = "Microcomputer Systems (M) Son";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1089[] = "Data General Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_108a[] = "SBS Technologies";
-static const char pci_device_108a_0001[] = "VME Bridge Model 617";
-static const char pci_device_108a_0010[] = "VME Bridge Model 618";
-static const char pci_device_108a_0040[] = "dataBLIZZARD";
-static const char pci_device_108a_3000[] = "VME Bridge Model 2706";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_108c[] = "Oakleigh Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_108d[] = "Olicom";
-static const char pci_device_108d_0001[] = "Token-Ring 16/4 PCI Adapter (3136/3137)";
-static const char pci_device_108d_0002[] = "16/4 Token Ring";
-static const char pci_device_108d_0004[] = "RapidFire 3139 Token-Ring 16/4 PCI Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_108d_0004_108d_0004[] = "OC-3139/3140 RapidFire Token-Ring 16/4 Adapter";
-#endif
-static const char pci_device_108d_0005[] = "GoCard 3250 Token-Ring 16/4 CardBus PC Card";
-static const char pci_device_108d_0006[] = "OC-3530 RapidFire Token-Ring 100";
-static const char pci_device_108d_0007[] = "RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_108d_0007_108d_0007[] = "OC-3141 RapidFire Token-Ring 16/4 Adapter";
-#endif
-static const char pci_device_108d_0008[] = "RapidFire 3540 HSTR 100/16/4 PCI Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_108d_0008_108d_0008[] = "OC-3540 RapidFire HSTR 100/16/4 Adapter";
-#endif
-static const char pci_device_108d_0011[] = "OC-2315";
-static const char pci_device_108d_0012[] = "OC-2325";
-static const char pci_device_108d_0013[] = "OC-2183/2185";
-static const char pci_device_108d_0014[] = "OC-2326";
-static const char pci_device_108d_0019[] = "OC-2327/2250 10/100 Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_108d_0019_108d_0016[] = "OC-2327 Rapidfire 10/100 Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_108d_0019_108d_0017[] = "OC-2250 GoCard 10/100 Ethernet Adapter";
-#endif
-static const char pci_device_108d_0021[] = "OC-6151/6152 [RapidFire ATM 155]";
-static const char pci_device_108d_0022[] = "ATM Adapter";
-#endif
-static const char pci_vendor_108e[] = "Sun Microsystems Computer Corp.";
-static const char pci_device_108e_0001[] = "EBUS";
-static const char pci_device_108e_1000[] = "EBUS";
-static const char pci_device_108e_1001[] = "Happy Meal";
-static const char pci_device_108e_1100[] = "RIO EBUS";
-static const char pci_device_108e_1101[] = "RIO GEM";
-static const char pci_device_108e_1102[] = "RIO 1394";
-static const char pci_device_108e_1103[] = "RIO USB";
-static const char pci_device_108e_2bad[] = "GEM";
-static const char pci_device_108e_5000[] = "Simba Advanced PCI Bridge";
-static const char pci_device_108e_5043[] = "SunPCI Co-processor";
-static const char pci_device_108e_8000[] = "Psycho PCI Bus Module";
-static const char pci_device_108e_8001[] = "Schizo PCI Bus Module";
-static const char pci_device_108e_a000[] = "Ultra IIi";
-static const char pci_device_108e_a001[] = "Ultra IIe";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_108f[] = "Systemsoft";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1090[] = "Encore Computer Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1091[] = "Intergraph Corporation";
-static const char pci_device_1091_0020[] = "3D graphics processor";
-static const char pci_device_1091_0021[] = "3D graphics processor w/Texturing";
-static const char pci_device_1091_0040[] = "3D graphics frame buffer";
-static const char pci_device_1091_0041[] = "3D graphics frame buffer";
-static const char pci_device_1091_0060[] = "Proprietary bus bridge";
-static const char pci_device_1091_00e4[] = "Powerstorm 4D50T";
-static const char pci_device_1091_0720[] = "Motion JPEG codec";
-#endif
-static const char pci_vendor_1092[] = "Diamond Multimedia Systems";
-static const char pci_device_1092_00a0[] = "Speedstar Pro SE";
-static const char pci_device_1092_00a8[] = "Speedstar 64";
-static const char pci_device_1092_0550[] = "Viper V550";
-static const char pci_device_1092_08d4[] = "Supra 2260 Modem";
-static const char pci_device_1092_094c[] = "SupraExpress 56i Pro";
-static const char pci_device_1092_1092[] = "Viper V330";
-static const char pci_device_1092_6120[] = "Maximum DVD";
-static const char pci_device_1092_8810[] = "Stealth SE";
-static const char pci_device_1092_8811[] = "Stealth 64/SE";
-static const char pci_device_1092_8880[] = "Stealth";
-static const char pci_device_1092_8881[] = "Stealth";
-static const char pci_device_1092_88b0[] = "Stealth 64";
-static const char pci_device_1092_88b1[] = "Stealth 64";
-static const char pci_device_1092_88c0[] = "Stealth 64";
-static const char pci_device_1092_88c1[] = "Stealth 64";
-static const char pci_device_1092_88d0[] = "Stealth 64";
-static const char pci_device_1092_88d1[] = "Stealth 64";
-static const char pci_device_1092_88f0[] = "Stealth 64";
-static const char pci_device_1092_88f1[] = "Stealth 64";
-static const char pci_device_1092_9999[] = "DMD-I0928-1 Monster sound sound chip";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1093[] = "National Instruments";
-static const char pci_device_1093_0160[] = "PCI-DIO-96";
-static const char pci_device_1093_0162[] = "PCI-MIO-16XE-50";
-static const char pci_device_1093_1170[] = "PCI-MIO-16XE-10";
-static const char pci_device_1093_1180[] = "PCI-MIO-16E-1";
-static const char pci_device_1093_1190[] = "PCI-MIO-16E-4";
-static const char pci_device_1093_1330[] = "PCI-6031E";
-static const char pci_device_1093_1350[] = "PCI-6071E";
-static const char pci_device_1093_2a60[] = "PCI-6023E";
-static const char pci_device_1093_b001[] = "IMAQ-PCI-1408";
-static const char pci_device_1093_b011[] = "IMAQ-PXI-1408";
-static const char pci_device_1093_b021[] = "IMAQ-PCI-1424";
-static const char pci_device_1093_b031[] = "IMAQ-PCI-1413";
-static const char pci_device_1093_b041[] = "IMAQ-PCI-1407";
-static const char pci_device_1093_b051[] = "IMAQ-PXI-1407";
-static const char pci_device_1093_b061[] = "IMAQ-PCI-1411";
-static const char pci_device_1093_b071[] = "IMAQ-PCI-1422";
-static const char pci_device_1093_b081[] = "IMAQ-PXI-1422";
-static const char pci_device_1093_b091[] = "IMAQ-PXI-1411";
-static const char pci_device_1093_c801[] = "PCI-GPIB";
-static const char pci_device_1093_c831[] = "PCI-GPIB bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1094[] = "First International Computers [FIC]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1095[] = "CMD Technology Inc";
-static const char pci_device_1095_0240[] = "Adaptec AAR-1210SA SATA HostRAID Controller";
-static const char pci_device_1095_0640[] = "PCI0640";
-static const char pci_device_1095_0643[] = "PCI0643";
-static const char pci_device_1095_0646[] = "PCI0646";
-static const char pci_device_1095_0647[] = "PCI0647";
-static const char pci_device_1095_0648[] = "PCI0648";
-static const char pci_device_1095_0649[] = "PCI0649";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1095_0649_0e11_005d[] = "Integrated Ultra ATA-100 Dual Channel Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1095_0649_0e11_007e[] = "Integrated Ultra ATA-100 IDE RAID Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1095_0649_101e_0649[] = "AMI MegaRAID IDE 100 Controller";
-#endif
-static const char pci_device_1095_0650[] = "PBC0650A";
-static const char pci_device_1095_0670[] = "USB0670";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1095_0670_1095_0670[] = "USB0670";
-#endif
-static const char pci_device_1095_0673[] = "USB0673";
-static const char pci_device_1095_0680[] = "PCI0680";
-static const char pci_device_1095_3112[] = "Silicon Image SiI 3112 SATARaid Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1096[] = "Alacron";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1097[] = "Appian Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1098[] = "Quantum Designs (H.K.) Ltd";
-static const char pci_device_1098_0001[] = "QD-8500";
-static const char pci_device_1098_0002[] = "QD-8580";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1099[] = "Samsung Electronics Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_109a[] = "Packard Bell";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_109b[] = "Gemlight Computer Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_109c[] = "Megachips Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_109d[] = "Zida Technologies Ltd.";
-#endif
-static const char pci_vendor_109e[] = "Brooktree Corporation";
-static const char pci_device_109e_0350[] = "Bt848 Video Capture";
-static const char pci_device_109e_0351[] = "Bt849A Video capture";
-static const char pci_device_109e_0369[] = "Bt878 Video Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0369_1002_0001[] = "TV-Wonder";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0369_1002_0003[] = "TV-Wonder/VE";
-#endif
-static const char pci_device_109e_036c[] = "Bt879(?) Video Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036c_13e9_0070[] = "Win/TV (Video Section)";
-#endif
-static const char pci_device_109e_036e[] = "Bt878 Video Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_0070_13eb[] = "WinTV Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_0070_ff01[] = "Viewcast Osprey 200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_107d_6606[] = "WinFast TV 2000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_11bd_0012[] = "PCTV pro (TV + FM stereo receiver)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_11bd_001c[] = "PCTV Sat (DBC receiver)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_127a_0001[] = "Bt878 Mediastream Controller NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_127a_0002[] = "Bt878 Mediastream Controller PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_127a_0003[] = "Bt878a Mediastream Controller PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_127a_0048[] = "Bt878/832 Mediastream Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_144f_3000[] = "MagicTView CPH060 - Video";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_1461_0004[] = "AVerTV WDM Video Capture";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_14f1_0001[] = "Bt878 Mediastream Controller NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_14f1_0002[] = "Bt878 Mediastream Controller PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_14f1_0003[] = "Bt878a Mediastream Controller PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_14f1_0048[] = "Bt878/832 Mediastream Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_1851_1850[] = "FlyVideo'98 - Video";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_1851_1851[] = "FlyVideo II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_1852_1852[] = "FlyVideo'98 - Video (with FM Tuner)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036e_bd11_1200[] = "PCTV pro (TV + FM stereo receiver)";
-#endif
-static const char pci_device_109e_036f[] = "Bt879 Video Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0044[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0122[] = "Bt879 Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0144[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0222[] = "Bt879 Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0244[] = "Bt879a Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0322[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_0422[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1122[] = "Bt879 Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1222[] = "Bt879 Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1322[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1522[] = "Bt879a Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1622[] = "Bt879a Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_127a_1722[] = "Bt879a Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0044[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0122[] = "Bt879 Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0144[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0222[] = "Bt879 Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0244[] = "Bt879a Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0322[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_0422[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1122[] = "Bt879 Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1222[] = "Bt879 Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1322[] = "Bt879 Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1522[] = "Bt879a Video Capture PAL I";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1622[] = "Bt879a Video Capture PAL BG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_14f1_1722[] = "Bt879a Video Capture NTSC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_1851_1850[] = "FlyVideo'98 - Video";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_1851_1851[] = "FlyVideo II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_036f_1852_1852[] = "FlyVideo'98 - Video (with FM Tuner)";
-#endif
-static const char pci_device_109e_0370[] = "Bt880 Video Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0370_1851_1850[] = "FlyVideo'98";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0370_1851_1851[] = "FlyVideo'98 EZ - video";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0370_1852_1852[] = "FlyVideo'98 (with FM Tuner)";
-#endif
-static const char pci_device_109e_0878[] = "Bt878 Audio Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_0070_13eb[] = "WinTV Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_0070_ff01[] = "Viewcast Osprey 200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_1002_0001[] = "TV-Wonder";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_1002_0003[] = "TV-Wonder/VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_11bd_0012[] = "PCTV pro (TV + FM stereo receiver, audio section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_11bd_001c[] = "PCTV Sat (DBC receiver)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_127a_0001[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_127a_0002[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_127a_0003[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_127a_0048[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_13e9_0070[] = "Win/TV (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_144f_3000[] = "MagicTView CPH060 - Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_1461_0004[] = "AVerTV WDM Audio Capture";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_14f1_0001[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_14f1_0002[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_14f1_0003[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_14f1_0048[] = "Bt878 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0878_bd11_1200[] = "PCTV pro (TV + FM stereo receiver, audio section)";
-#endif
-static const char pci_device_109e_0879[] = "Bt879 Audio Capture";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0044[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0122[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0144[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0222[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0244[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0322[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_0422[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1122[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1222[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1322[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1522[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1622[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_127a_1722[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0044[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0122[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0144[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0222[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0244[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0322[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_0422[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1122[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1222[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1322[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1522[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1622[] = "Bt879 Video Capture (Audio Section)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_109e_0879_14f1_1722[] = "Bt879 Video Capture (Audio Section)";
-#endif
-static const char pci_device_109e_0880[] = "Bt880 Audio Capture";
-static const char pci_device_109e_2115[] = "BtV 2115 Mediastream controller";
-static const char pci_device_109e_2125[] = "BtV 2125 Mediastream controller";
-static const char pci_device_109e_2164[] = "BtV 2164";
-static const char pci_device_109e_2165[] = "BtV 2165";
-static const char pci_device_109e_8230[] = "Bt8230 ATM Segment/Reassembly Ctrlr (SRC)";
-static const char pci_device_109e_8472[] = "Bt8472";
-static const char pci_device_109e_8474[] = "Bt8474";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_109f[] = "Trigem Computer Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a0[] = "Meidensha Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a1[] = "Juko Electronics Ind. Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a2[] = "Quantum Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a3[] = "Everex Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a4[] = "Globe Manufacturing Sales";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a5[] = "Smart Link Ltd.";
-static const char pci_device_10a5_3052[] = "SmartPCI562 56K Modem";
-static const char pci_device_10a5_5449[] = "SmartPCI561 modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a6[] = "Informtech Industrial Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a7[] = "Benchmarq Microelectronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a8[] = "Sierra Semiconductor";
-static const char pci_device_10a8_0000[] = "STB Horizon 64";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10a9[] = "Silicon Graphics, Inc.";
-static const char pci_device_10a9_0001[] = "Crosstalk to PCI Bridge";
-static const char pci_device_10a9_0002[] = "Linc I/O controller";
-static const char pci_device_10a9_0003[] = "IOC3 I/O controller";
-static const char pci_device_10a9_0004[] = "O2 MACE";
-static const char pci_device_10a9_0005[] = "RAD Audio";
-static const char pci_device_10a9_0006[] = "HPCEX";
-static const char pci_device_10a9_0007[] = "RPCEX";
-static const char pci_device_10a9_0008[] = "DiVO VIP";
-static const char pci_device_10a9_0009[] = "Alteon Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10a9_0009_10a9_8002[] = "Acenic Gigabit Ethernet";
-#endif
-static const char pci_device_10a9_0010[] = "AMP Video I/O";
-static const char pci_device_10a9_0011[] = "GRIP";
-static const char pci_device_10a9_0012[] = "SGH PSHAC GSN";
-static const char pci_device_10a9_1001[] = "Magic Carpet";
-static const char pci_device_10a9_1002[] = "Lithium";
-static const char pci_device_10a9_1003[] = "Dual JPEG 1";
-static const char pci_device_10a9_1004[] = "Dual JPEG 2";
-static const char pci_device_10a9_1005[] = "Dual JPEG 3";
-static const char pci_device_10a9_1006[] = "Dual JPEG 4";
-static const char pci_device_10a9_1007[] = "Dual JPEG 5";
-static const char pci_device_10a9_1008[] = "Cesium";
-static const char pci_device_10a9_100a[] = "IOC4 I/O controller";
-static const char pci_device_10a9_2001[] = "Fibre Channel";
-static const char pci_device_10a9_2002[] = "ASDE";
-static const char pci_device_10a9_8001[] = "O2 1394";
-static const char pci_device_10a9_8002[] = "G-net NT";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10aa[] = "ACC Microelectronics";
-static const char pci_device_10aa_0000[] = "ACCM 2188";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ab[] = "Digicom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ac[] = "Honeywell IAC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ad[] = "Symphony Labs";
-static const char pci_device_10ad_0001[] = "W83769F";
-static const char pci_device_10ad_0003[] = "SL82C103";
-static const char pci_device_10ad_0005[] = "SL82C105";
-static const char pci_device_10ad_0103[] = "SL82c103";
-static const char pci_device_10ad_0105[] = "SL82c105";
-static const char pci_device_10ad_0565[] = "W83C553";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ae[] = "Cornerstone Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10af[] = "Micro Computer Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b0[] = "CardExpert Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b1[] = "Cabletron Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b2[] = "Raytheon Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b3[] = "Databook Inc";
-static const char pci_device_10b3_3106[] = "DB87144";
-static const char pci_device_10b3_b106[] = "DB87144";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b4[] = "STB Systems Inc";
-static const char pci_device_10b4_1b1d[] = "Velocity 128 3D";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b4_1b1d_10b4_237e[] = "Velocity 4400";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b5[] = "PLX Technology, Inc.";
-static const char pci_device_10b5_0001[] = "i960 PCI bus interface";
-static const char pci_device_10b5_1076[] = "VScom 800 8 port serial adaptor";
-static const char pci_device_10b5_1077[] = "VScom 400 4 port serial adaptor";
-static const char pci_device_10b5_1078[] = "VScom 210 2 port serial and 1 port parallel adaptor";
-static const char pci_device_10b5_1103[] = "VScom 200 2 port serial adaptor";
-static const char pci_device_10b5_1146[] = "VScom 010 1 port parallel adaptor";
-static const char pci_device_10b5_1147[] = "VScom 020 2 port parallel adaptor";
-static const char pci_device_10b5_2724[] = "Thales PCSM Security Card";
-static const char pci_device_10b5_9030[] = "PCI <-> IOBus Bridge Hot Swap";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9030_15ed_1002[] = "MCCS 8-port Serial Hot Swap";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9030_15ed_1003[] = "MCCS 16-port Serial Hot Swap";
-#endif
-static const char pci_device_10b5_9036[] = "9036";
-static const char pci_device_10b5_9050[] = "PCI <-> IOBus Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_10b5_2036[] = "SatPak GPS";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_10b5_2273[] = "SH-ARC SoHard ARCnet card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_10b5_9050[] = "MP9050";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0001[] = "RockForce 4 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0002[] = "RockForce 2 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0003[] = "RockForce 6 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0004[] = "RockForce 8 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0010[] = "RockForce2000 4 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_1522_0020[] = "RockForce2000 2 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_15ed_1000[] = "Macrolink MCCS 8-port Serial";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_15ed_1001[] = "Macrolink MCCS 16-port Serial";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_15ed_1002[] = "Macrolink MCCS 8-port Serial Hot Swap";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_15ed_1003[] = "Macrolink MCCS 16-port Serial Hot Swap";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_5654_5634[] = "OpenLine4 Telephony Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d531_c002[] = "PCIntelliCAN 2xSJA1000 CAN bus";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4006[] = "EX-4006 1P";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4008[] = "EX-4008 1P EPP/ECP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4014[] = "EX-4014 2P";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4018[] = "EX-4018 3P EPP/ECP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4025[] = "EX-4025 1S(16C550) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4027[] = "EX-4027 1S(16C650) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4028[] = "EX-4028 1S(16C850) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4036[] = "EX-4036 2S(16C650) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4037[] = "EX-4037 2S(16C650) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4038[] = "EX-4038 2S(16C850) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4052[] = "EX-4052 1S(16C550) RS-422/485";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4053[] = "EX-4053 2S(16C550) RS-422/485";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4055[] = "EX-4055 4S(16C550) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4058[] = "EX-4055 4S(16C650) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4065[] = "EX-4065 8S(16C550) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4068[] = "EX-4068 8S(16C650) RS-232";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9050_d84d_4078[] = "EX-4078 2S(16C552) RS-232+1P";
-#endif
-static const char pci_device_10b5_9054[] = "PCI <-> IOBus Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9054_10b5_2455[] = "Wessex Techology PHIL-PCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9054_12d9_0002[] = "PCI Prosody Card rev 1.5";
-#endif
-static const char pci_device_10b5_9060[] = "9060";
-static const char pci_device_10b5_906d[] = "9060SD";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_906d_125c_0640[] = "Aries 16000P";
-#endif
-static const char pci_device_10b5_906e[] = "9060ES";
-static const char pci_device_10b5_9080[] = "9080";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9080_10b5_9080[] = "9080 [real subsystem ID not set]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9080_129d_0002[] = "Aculab PCI Prosidy card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b5_9080_12d9_0002[] = "PCI Prosody Card";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b6[] = "Madge Networks";
-static const char pci_device_10b6_0001[] = "Smart 16/4 PCI Ringnode";
-static const char pci_device_10b6_0002[] = "Smart 16/4 PCI Ringnode Mk2";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0002_10b6_0002[] = "Smart 16/4 PCI Ringnode Mk2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0002_10b6_0006[] = "16/4 CardBus Adapter";
-#endif
-static const char pci_device_10b6_0003[] = "Smart 16/4 PCI Ringnode Mk3";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0003_0e11_b0fd[] = "Compaq NC4621 PCI, 4/16, WOL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0003_10b6_0003[] = "Smart 16/4 PCI Ringnode Mk3";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0003_10b6_0007[] = "Presto PCI Plus Adapter";
-#endif
-static const char pci_device_10b6_0004[] = "Smart 16/4 PCI Ringnode Mk1";
-static const char pci_device_10b6_0006[] = "16/4 Cardbus Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0006_10b6_0006[] = "16/4 CardBus Adapter";
-#endif
-static const char pci_device_10b6_0007[] = "Presto PCI Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0007_10b6_0007[] = "Presto PCI";
-#endif
-static const char pci_device_10b6_0009[] = "Smart 100/16/4 PCI-HS Ringnode";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_0009_10b6_0009[] = "Smart 100/16/4 PCI-HS Ringnode";
-#endif
-static const char pci_device_10b6_000a[] = "Smart 100/16/4 PCI Ringnode";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_000a_10b6_000a[] = "Smart 100/16/4 PCI Ringnode";
-#endif
-static const char pci_device_10b6_000b[] = "16/4 CardBus Adapter Mk2";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_000b_10b6_0008[] = "16/4 CardBus Adapter Mk2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_000b_10b6_000b[] = "16/4 Cardbus Adapter Mk2";
-#endif
-static const char pci_device_10b6_000c[] = "RapidFire 3140V2 16/4 TR Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b6_000c_10b6_000c[] = "RapidFire 3140V2 16/4 TR Adapter";
-#endif
-static const char pci_device_10b6_1000[] = "Collage 25/155 ATM Client Adapter";
-static const char pci_device_10b6_1001[] = "Collage 155 ATM Server Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b7[] = "3Com Corporation";
-static const char pci_device_10b7_0001[] = "3c985 1000BaseSX (SX/TX)";
-static const char pci_device_10b7_0910[] = "3C910-A01";
-static const char pci_device_10b7_1006[] = "MINI PCI type 3B Data Fax Modem";
-static const char pci_device_10b7_1007[] = "Mini PCI 56k Winmodem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_1007_10b7_615c[] = "Mini PCI 56K Modem";
-#endif
-static const char pci_device_10b7_3390[] = "3c339 TokenLink Velocity";
-static const char pci_device_10b7_3590[] = "3c359 TokenLink Velocity XL";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_3590_10b7_3590[] = "TokenLink Velocity XL Adapter (3C359/359B)";
-#endif
-static const char pci_device_10b7_4500[] = "3c450 Cyclone/unknown";
-static const char pci_device_10b7_5055[] = "3c555 Laptop Hurricane";
-static const char pci_device_10b7_5057[] = "3c575 [Megahertz] 10/100 LAN CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_5057_10b7_5a57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
-#endif
-static const char pci_device_10b7_5157[] = "3c575 [Megahertz] 10/100 LAN CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_5157_10b7_5b57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
-#endif
-static const char pci_device_10b7_5257[] = "3CCFE575CT Cyclone CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_5257_10b7_5c57[] = "FE575C-3Com 10/100 LAN CardBus-Fast Ethernet";
-#endif
-static const char pci_device_10b7_5900[] = "3c590 10BaseT [Vortex]";
-static const char pci_device_10b7_5920[] = "3c592 EISA 10mbps Demon/Vortex";
-static const char pci_device_10b7_5950[] = "3c595 100BaseTX [Vortex]";
-static const char pci_device_10b7_5951[] = "3c595 100BaseT4 [Vortex]";
-static const char pci_device_10b7_5952[] = "3c595 100Base-MII [Vortex]";
-static const char pci_device_10b7_5970[] = "3c597 EISA Fast Demon/Vortex";
-static const char pci_device_10b7_5b57[] = "3c595 [Megahertz] 10/100 LAN CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_5b57_10b7_5b57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
-#endif
-static const char pci_device_10b7_6055[] = "3c556 Hurricane CardBus";
-static const char pci_device_10b7_6056[] = "3c556B Hurricane CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_6056_10b7_6556[] = "10/100 Mini PCI Ethernet Adapter";
-#endif
-static const char pci_device_10b7_6560[] = "3CCFE656 Cyclone CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_6560_10b7_656a[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
-#endif
-static const char pci_device_10b7_6561[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_6561_10b7_656b[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
-#endif
-static const char pci_device_10b7_6562[] = "3CCFEM656 [id 6562] Cyclone CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_6562_10b7_656b[] = "3CCFEM656B 10/100 LAN+56K Modem CardBus";
-#endif
-static const char pci_device_10b7_6563[] = "3CCFEM656B 10/100 LAN+56K Modem CardBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_6563_10b7_656b[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
-#endif
-static const char pci_device_10b7_6564[] = "3CCFEM656 [id 6564] Cyclone CardBus";
-static const char pci_device_10b7_7646[] = "3cSOHO100-TX Hurricane";
-static const char pci_device_10b7_7940[] = "3c803 FDDILink UTP Controller";
-static const char pci_device_10b7_7980[] = "3c804 FDDILink SAS Controller";
-static const char pci_device_10b7_7990[] = "3c805 FDDILink DAS Controller";
-static const char pci_device_10b7_8811[] = "Token ring";
-static const char pci_device_10b7_9000[] = "3c900 10BaseT [Boomerang]";
-static const char pci_device_10b7_9001[] = "3c900 Combo [Boomerang]";
-static const char pci_device_10b7_9004[] = "3c900B-TPO [Etherlink XL TPO]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9004_10b7_9004[] = "3C900B-TPO Etherlink XL TPO 10Mb";
-#endif
-static const char pci_device_10b7_9005[] = "3c900B-Combo [Etherlink XL Combo]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9005_10b7_9005[] = "3C900B-Combo Etherlink XL Combo";
-#endif
-static const char pci_device_10b7_9006[] = "3c900B-TPC [Etherlink XL TPC]";
-static const char pci_device_10b7_900a[] = "3c900B-FL [Etherlink XL FL]";
-static const char pci_device_10b7_9050[] = "3c905 100BaseTX [Boomerang]";
-static const char pci_device_10b7_9051[] = "3c905 100BaseT4 [Boomerang]";
-static const char pci_device_10b7_9055[] = "3c905B 100BaseTX [Cyclone]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0080[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0081[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0082[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0083[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0084[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0085[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0086[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0087[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0088[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0089[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0090[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0091[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0092[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0093[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0094[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0095[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0096[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0097[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0098[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_1028_0099[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9055_10b7_9055[] = "3C905B Fast Etherlink XL 10/100";
-#endif
-static const char pci_device_10b7_9056[] = "3c905B-T4 [Fast EtherLink XL 10/100]";
-static const char pci_device_10b7_9058[] = "3c905B-Combo [Deluxe Etherlink XL 10/100]";
-static const char pci_device_10b7_905a[] = "3c905B-FX [Fast Etherlink XL FX 10/100]";
-static const char pci_device_10b7_9200[] = "3c905C-TX/TX-M [Tornado]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9200_1028_0095[] = "Integrated 3C905C-TX Fast Etherlink for PC Management NIC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9200_10b7_1000[] = "3C905C-TX Fast Etherlink for PC Management NIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9200_10b7_7000[] = "10/100 Mini PCI Ethernet Adapter";
-#endif
-static const char pci_device_10b7_9201[] = "3C920B-EMB Integrated Fast Ethernet Controller";
-static const char pci_device_10b7_9300[] = "3CSOHO100B-TX [910-A01]";
-static const char pci_device_10b7_9800[] = "3c980-TX [Fast Etherlink XL Server Adapter]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9800_10b7_9800[] = "3c980-TX Fast Etherlink XL Server Adapter";
-#endif
-static const char pci_device_10b7_9805[] = "3c980-TX 10/100baseTX NIC [Python-T]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9805_10b7_1201[] = "3c982-TXM 10/100baseTX Dual Port A [Hydra]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9805_10b7_1202[] = "3c982-TXM 10/100baseTX Dual Port B [Hydra]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9805_10b7_9805[] = "3c980 10/100baseTX NIC [Python-T]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9805_10f1_2462[] = "Thunder K7 S2462";
-#endif
-static const char pci_device_10b7_9900[] = "3C990-TX [Typhoon]";
-static const char pci_device_10b7_9902[] = "3CR990-TX-95 [Typhoon 56-bit]";
-static const char pci_device_10b7_9903[] = "3CR990-TX-97 [Typhoon 168-bit]";
-static const char pci_device_10b7_9904[] = "3C990B-TX-M/3C990BSVR [Typhoon2]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9904_10b7_1000[] = "3CR990B-TX-M [Typhoon2]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9904_10b7_2000[] = "3CR990BSVR [Typhoon2 Server]";
-#endif
-static const char pci_device_10b7_9905[] = "3CR990-FX-95/97/95 [Typhon Fiber]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9905_10b7_1101[] = "3CR990-FX-95 [Typhoon Fiber 56-bit]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9905_10b7_1102[] = "3CR990-FX-97 [Typhoon Fiber 168-bit]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9905_10b7_2101[] = "3CR990-FX-95 Server [Typhoon Fiber 56-bit]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b7_9905_10b7_2102[] = "3CR990-FX-97 Server [Typhoon Fiber 168-bit]";
-#endif
-static const char pci_device_10b7_9908[] = "3CR990SVR95 [Typhoon Server 56-bit]";
-static const char pci_device_10b7_9909[] = "3CR990SVR97 [Typhoon Server 168-bit]";
-static const char pci_device_10b7_990b[] = "3C990SVR [Typhoon Server]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b8[] = "Standard Microsystems Corp [SMC]";
-static const char pci_device_10b8_0005[] = "83C170QF";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_1055_e000[] = "LANEPIC 10/100 [EVB171Q-PCI]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_1055_e002[] = "LANEPIC 10/100 [EVB171G-PCI]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_10b8_a011[] = "EtherPower II 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_10b8_a014[] = "EtherPower II 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_10b8_a015[] = "EtherPower II 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_10b8_a016[] = "EtherPower II 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0005_10b8_a017[] = "EtherPower II 10/100";
-#endif
-static const char pci_device_10b8_0006[] = "LANEPIC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_1055_e100[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_1055_e102[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_1055_e300[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_1055_e302[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_10b8_a012[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_13a2_8002[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b8_0006_13a2_8006[] = "LANEPIC Cardbus Fast Ethernet Adapter";
-#endif
-static const char pci_device_10b8_1000[] = "FDC 37c665";
-static const char pci_device_10b8_1001[] = "FDC 37C922";
-static const char pci_device_10b8_a011[] = "83C170QF";
-static const char pci_device_10b8_b106[] = "SMC34C90";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10b9[] = "ALi Corporation";
-static const char pci_device_10b9_0111[] = "C-Media CMI8738/C3DX Audio Device (OEM)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_0111_10b9_0111[] = "C-Media CMI8738/C3DX Audio Device (OEM)";
-#endif
-static const char pci_device_10b9_1435[] = "M1435";
-static const char pci_device_10b9_1445[] = "M1445";
-static const char pci_device_10b9_1449[] = "M1449";
-static const char pci_device_10b9_1451[] = "M1451";
-static const char pci_device_10b9_1461[] = "M1461";
-static const char pci_device_10b9_1489[] = "M1489";
-static const char pci_device_10b9_1511[] = "M1511 [Aladdin]";
-static const char pci_device_10b9_1512[] = "M1512 [Aladdin]";
-static const char pci_device_10b9_1513[] = "M1513 [Aladdin]";
-static const char pci_device_10b9_1521[] = "M1521 [Aladdin III]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_1521_10b9_1521[] = "ALI M1521 Aladdin III CPU Bridge";
-#endif
-static const char pci_device_10b9_1523[] = "M1523";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_1523_10b9_1523[] = "ALI M1523 ISA Bridge";
-#endif
-static const char pci_device_10b9_1531[] = "M1531 [Aladdin IV]";
-static const char pci_device_10b9_1533[] = "M1533 PCI to ISA Bridge [Aladdin IV]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_1533_10b9_1533[] = "ALI M1533 Aladdin IV ISA Bridge";
-#endif
-static const char pci_device_10b9_1541[] = "M1541";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_1541_10b9_1541[] = "ALI M1541 Aladdin V/V+ AGP System Controller";
-#endif
-static const char pci_device_10b9_1543[] = "M1543";
-static const char pci_device_10b9_1563[] = "M1563 HyperTransport South Bridge";
-static const char pci_device_10b9_1621[] = "M1621";
-static const char pci_device_10b9_1631[] = "ALI M1631 PCI North Bridge Aladdin Pro III";
-static const char pci_device_10b9_1632[] = "M1632M Northbridge+Trident";
-static const char pci_device_10b9_1641[] = "ALI M1641 PCI North Bridge Aladdin Pro IV";
-static const char pci_device_10b9_1644[] = "M1644/M1644T Northbridge+Trident";
-static const char pci_device_10b9_1646[] = "M1646 Northbridge+Trident";
-static const char pci_device_10b9_1647[] = "M1647 Northbridge [MAGiK 1 / MobileMAGiK 1]";
-static const char pci_device_10b9_1651[] = "M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM]";
-static const char pci_device_10b9_1671[] = "M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]";
-static const char pci_device_10b9_1681[] = "M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR]";
-static const char pci_device_10b9_1687[] = "M1687 K8 Northbridge [AGP8X and HyperTransport]";
-static const char pci_device_10b9_3141[] = "M3141";
-static const char pci_device_10b9_3143[] = "M3143";
-static const char pci_device_10b9_3145[] = "M3145";
-static const char pci_device_10b9_3147[] = "M3147";
-static const char pci_device_10b9_3149[] = "M3149";
-static const char pci_device_10b9_3151[] = "M3151";
-static const char pci_device_10b9_3307[] = "M3307";
-static const char pci_device_10b9_3309[] = "M3309";
-static const char pci_device_10b9_5212[] = "M4803";
-static const char pci_device_10b9_5215[] = "MS4803";
-static const char pci_device_10b9_5217[] = "M5217H";
-static const char pci_device_10b9_5219[] = "M5219";
-static const char pci_device_10b9_5225[] = "M5225";
-static const char pci_device_10b9_5229[] = "M5229 IDE";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_5229_1043_8053[] = "A7A266 Motherboard IDE";
-#endif
-static const char pci_device_10b9_5235[] = "M5225";
-static const char pci_device_10b9_5237[] = "USB 1.1 Controller";
-static const char pci_device_10b9_5239[] = "USB 2.0 Controller";
-static const char pci_device_10b9_5243[] = "M1541 PCI to AGP Controller";
-static const char pci_device_10b9_5247[] = "PCI to AGP Controller";
-static const char pci_device_10b9_5249[] = "M5249 HTT to PCI Bridge";
-static const char pci_device_10b9_5251[] = "M5251 P1394 OHCI 1.0 Controller";
-static const char pci_device_10b9_5253[] = "M5253 P1394 OHCI 1.1 Controller";
-static const char pci_device_10b9_5261[] = "M5261 Ethernet Controller";
-static const char pci_device_10b9_5450[] = "Lucent Technologies Soft Modem AMR";
-static const char pci_device_10b9_5451[] = "M5451 PCI AC-Link Controller Audio Device";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_5451_1014_0506[] = "ThinkPad R30";
-#endif
-static const char pci_device_10b9_5453[] = "M5453 PCI AC-Link Controller Modem Device";
-static const char pci_device_10b9_5455[] = "M5455 PCI AC-Link Controller Audio Device";
-static const char pci_device_10b9_5457[] = "Intel 537 [M5457 AC-Link Modem]";
-static const char pci_device_10b9_5459[] = "SmartLink SmartPCI561 56K Modem";
-static const char pci_device_10b9_545a[] = "SmartLink SmartPCI563 56K Modem";
-static const char pci_device_10b9_5471[] = "M5471 Memory Stick Controller";
-static const char pci_device_10b9_5473[] = "M5473 SD-MMC Controller";
-static const char pci_device_10b9_7101[] = "M7101 PMU";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10b9_7101_10b9_7101[] = "ALI M7101 Power Management Controller";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ba[] = "Mitsubishi Electric Corp.";
-static const char pci_device_10ba_0301[] = "AccelGraphics AccelECLIPSE";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10bb[] = "Dapha Electronics Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10bc[] = "Advanced Logic Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10bd[] = "Surecom Technology";
-static const char pci_device_10bd_0e34[] = "NE-34";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10be[] = "Tseng Labs International Co.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10bf[] = "Most Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c0[] = "Boca Research Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c1[] = "ICM Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c2[] = "Auspex Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c3[] = "Samsung Semiconductors, Inc.";
-static const char pci_device_10c3_1100[] = "Smartether100 SC1100 LAN Adapter (i82557B)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c4[] = "Award Software International Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c5[] = "Xerox Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c6[] = "Rambus Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c7[] = "Media Vision";
-#endif
-static const char pci_vendor_10c8[] = "Neomagic Corporation";
-static const char pci_device_10c8_0001[] = "NM2070 [MagicGraph 128]";
-static const char pci_device_10c8_0002[] = "NM2090 [MagicGraph 128V]";
-static const char pci_device_10c8_0003[] = "NM2093 [MagicGraph 128ZV]";
-static const char pci_device_10c8_0004[] = "NM2160 [MagicGraph 128XD]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1014_00ba[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1025_1007[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1028_0074[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1028_0075[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1028_007d[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1028_007e[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_1033_802f[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_104d_801b[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_104d_802f[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_104d_830b[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10ba_0e00[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10c8_0004[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10cf_1029[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10f7_8308[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10f7_8309[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10f7_830b[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10f7_830d[] = "MagicGraph 128XD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0004_10f7_8312[] = "MagicGraph 128XD";
-#endif
-static const char pci_device_10c8_0005[] = "NM2200 [MagicGraph 256AV]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0005_1014_00dd[] = "ThinkPad 570";
-#endif
-static const char pci_device_10c8_0006[] = "NM2360 [MagicMedia 256ZX]";
-static const char pci_device_10c8_0016[] = "NM2380 [MagicMedia 256XL+]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_0016_10c8_0016[] = "MagicMedia 256XL+";
-#endif
-static const char pci_device_10c8_0025[] = "NM2230 [MagicGraph 256AV+]";
-static const char pci_device_10c8_0083[] = "NM2093 [MagicGraph 128ZV+]";
-static const char pci_device_10c8_8005[] = "NM2200 [MagicMedia 256AV Audio]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_0e11_b0d1[] = "MagicMedia 256AV Audio Device on Discovery";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_0e11_b126[] = "MagicMedia 256AV Audio Device on Durango";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_1014_00dd[] = "MagicMedia 256AV Audio Device on BlackTip Thinkpad";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_1025_1003[] = "MagicMedia 256AV Audio Device on TravelMate 720";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_1028_008f[] = "MagicMedia 256AV Audio Device on Colorado Inspiron";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_103c_0007[] = "MagicMedia 256AV Audio Device on Voyager II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_103c_0008[] = "MagicMedia 256AV Audio Device on Voyager III";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_103c_000d[] = "MagicMedia 256AV Audio Device on Omnibook 900";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_10c8_8005[] = "MagicMedia 256AV Audio Device on FireAnt";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_110a_8005[] = "MagicMedia 256AV Audio Device";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10c8_8005_14c0_0004[] = "MagicMedia 256AV Audio Device";
-#endif
-static const char pci_device_10c8_8006[] = "NM2360 [MagicMedia 256ZX Audio]";
-static const char pci_device_10c8_8016[] = "NM2380 [MagicMedia 256XL+ Audio]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10c9[] = "Dataexpert Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ca[] = "Fujitsu Microelectr., Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10cb[] = "Omron Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10cc[] = "Mentor ARC Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10cd[] = "Advanced System Products, Inc";
-static const char pci_device_10cd_1100[] = "ASC1100";
-static const char pci_device_10cd_1200[] = "ASC1200 [(abp940) Fast SCSI-II]";
-static const char pci_device_10cd_1300[] = "ABP940-U / ABP960-U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10cd_1300_10cd_1310[] = "ASC1300 SCSI Adapter";
-#endif
-static const char pci_device_10cd_2300[] = "ABP940-UW";
-static const char pci_device_10cd_2500[] = "ABP940-U2W";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ce[] = "Radius";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10cf[] = "Citicorp TTI";
-static const char pci_device_10cf_2001[] = "mb86605";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d0[] = "Fujitsu Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d1[] = "FuturePlus Systems Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d2[] = "Molex Incorporated";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d3[] = "Jabil Circuit Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d4[] = "Hualon Microelectronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d5[] = "Autologic Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d6[] = "Cetia";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d7[] = "BCM Advanced Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d8[] = "Advanced Peripherals Labs";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10d9[] = "Macronix, Inc. [MXIC]";
-static const char pci_device_10d9_0512[] = "MX98713";
-static const char pci_device_10d9_0531[] = "MX987x5";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10d9_0531_1186_1200[] = "DFE-540TX ProFAST 10/100 Adapter";
-#endif
-static const char pci_device_10d9_8625[] = "MX86250";
-static const char pci_device_10d9_8888[] = "MX86200";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10da[] = "Compaq IPG-Austin";
-static const char pci_device_10da_0508[] = "TC4048 Token Ring 4/16";
-static const char pci_device_10da_3390[] = "Tl3c3x9";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10db[] = "Rohm LSI Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10dc[] = "CERN/ECP/EDU";
-static const char pci_device_10dc_0001[] = "STAR/RD24 SCI-PCI (PMC)";
-static const char pci_device_10dc_0002[] = "TAR/RD24 SCI-PCI (PMC)";
-static const char pci_device_10dc_0021[] = "HIPPI destination";
-static const char pci_device_10dc_0022[] = "HIPPI source";
-static const char pci_device_10dc_10dc[] = "ATT2C15-3 FPGA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10dd[] = "Evans & Sutherland";
-#endif
-static const char pci_vendor_10de[] = "nVidia Corporation";
-static const char pci_device_10de_0008[] = "NV1 [EDGE 3D]";
-static const char pci_device_10de_0009[] = "NV1 [EDGE 3D]";
-static const char pci_device_10de_0010[] = "NV2 [Mutara V08]";
-static const char pci_device_10de_0020[] = "NV4 [RIVA TNT]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1043_0200[] = "V3400 TNT";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1048_0c18[] = "Erazor II SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1048_0c1b[] = "Erazor II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_0550[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_0552[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4804[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4808[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4810[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4812[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4815[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4820[] = "Viper V550 with TV out";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4822[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4904[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_4914[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1092_8225[] = "Viper V550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_10b4_273d[] = "Velocity 4400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_10b4_273e[] = "Velocity 4400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_10b4_2740[] = "Velocity 4400";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_10de_0020[] = "Riva TNT";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1102_1015[] = "Graphics Blaster CT6710";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0020_1102_1016[] = "Graphics Blaster RIVA TNT";
-#endif
-static const char pci_device_10de_0028[] = "NV5 [RIVA TNT2/TNT2 Pro]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1043_0200[] = "AGP-V3800 SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1043_0201[] = "AGP-V3800 SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1043_0205[] = "PCI-V3800";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1043_4000[] = "AGP-V3800PRO";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1048_0c21[] = "Synergy II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_4804[] = "Viper V770";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_4a00[] = "Viper V770";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_4a02[] = "Viper V770 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_5a00[] = "RIVA TNT2/TNT2 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_6a02[] = "Viper V770 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1092_7a02[] = "Viper V770 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_10de_0005[] = "RIVA TNT2 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_10de_000f[] = "Compaq NVIDIA TNT2 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1102_1020[] = "3D Blaster RIVA TNT2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_1102_1026[] = "3D Blaster RIVA TNT2 Digital";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0028_14af_5810[] = "Maxi Gamer Xentor";
-#endif
-static const char pci_device_10de_0029[] = "NV5 [RIVA TNT2 Ultra]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1043_0200[] = "AGP-V3800 Deluxe";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1043_0201[] = "AGP-V3800 Ultra SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1043_0205[] = "PCI-V3800 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1102_1021[] = "3D Blaster RIVA TNT2 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1102_1029[] = "3D Blaster RIVA TNT2 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_1102_102f[] = "3D Blaster RIVA TNT2 Ultra";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0029_14af_5820[] = "Maxi Gamer Xentor 32";
-#endif
-static const char pci_device_10de_002a[] = "NV5 [Riva TnT2]";
-static const char pci_device_10de_002b[] = "NV5 [Riva TnT2]";
-static const char pci_device_10de_002c[] = "NV6 [Vanta/Vanta LT]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_1043_0200[] = "AGP-V3800 Combat SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_1043_0201[] = "AGP-V3800 Combat";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_1092_6820[] = "Viper V730";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_1102_1031[] = "CT6938 VANTA 8MB";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_1102_1034[] = "CT6894 VANTA 16MB";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002c_14af_5008[] = "Maxi Gamer Phoenix 2";
-#endif
-static const char pci_device_10de_002d[] = "NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1043_0200[] = "AGP-V3800M";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1043_0201[] = "AGP-V3800M";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1048_0c3a[] = "Erazor III LT";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_10de_001e[] = "M64 AGP4x";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1102_1023[] = "CT6892 RIVA TNT2 Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1102_1024[] = "CT6932 RIVA TNT2 Value 32Mb";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1102_102c[] = "CT6931 RIVA TNT2 Value [Jumper]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1462_8808[] = "MSI-8808";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_002d_1554_1041[] = "PixelView RIVA TNT2 M64 32MB";
-#endif
-static const char pci_device_10de_002e[] = "NV6 [Vanta]";
-static const char pci_device_10de_002f[] = "NV6 [Vanta]";
-static const char pci_device_10de_0060[] = "nForce2 ISA Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0060_1043_80ad[] = "A7N8X Mainboard";
-#endif
-static const char pci_device_10de_0064[] = "nForce2 SMBus (MCP)";
-static const char pci_device_10de_0065[] = "nForce2 IDE";
-static const char pci_device_10de_0066[] = "nForce2 Ethernet Controller";
-static const char pci_device_10de_0067[] = "nForce2 USB Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0067_1043_0c11[] = "A7N8X Mainboard";
-#endif
-static const char pci_device_10de_0068[] = "nForce2 USB Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0068_1043_0c11[] = "A7N8X Mainboard";
-#endif
-static const char pci_device_10de_006a[] = "nForce2 AC97 Audio Controler (MCP)";
-static const char pci_device_10de_006b[] = "nForce MultiMedia audio [Via VT82C686B]";
-static const char pci_device_10de_006e[] = "nForce2 FireWire (IEEE 1394) Controller";
-static const char pci_device_10de_00a0[] = "NV5 [Aladdin TNT2]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_00a0_14af_5810[] = "Maxi Gamer Xentor";
-#endif
-static const char pci_device_10de_0100[] = "NV10 [GeForce 256 SDR]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_1043_0200[] = "AGP-V6600 SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_1043_0201[] = "AGP-V6600 SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_1043_4008[] = "AGP-V6600 SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_1043_4009[] = "AGP-V6600 SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_1102_102d[] = "CT6941 GeForce 256";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0100_14af_5022[] = "3D Prophet SE";
-#endif
-static const char pci_device_10de_0101[] = "NV10DDR [GeForce 256 DDR]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0101_1043_0202[] = "AGP-V6800 DDR";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0101_1043_400a[] = "AGP-V6800 DDR SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0101_1043_400b[] = "AGP-V6800 DDR SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0101_1102_102e[] = "CT6971 GeForce 256 DDR";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0101_14af_5021[] = "3D Prophet DDR-DVI";
-#endif
-static const char pci_device_10de_0103[] = "NV10GL [Quadro]";
-static const char pci_device_10de_0110[] = "NV11 [GeForce2 MX/MX 400]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0110_1043_4015[] = "AGP-V7100 Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0110_1043_4031[] = "V7100 Pro with TV output";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0110_1462_8817[] = "MSI GeForce2 MX400 Pro32S [MS-8817]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0110_14af_7102[] = "3D Prophet II MX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0110_14af_7103[] = "3D Prophet II MX Dual-Display";
-#endif
-static const char pci_device_10de_0111[] = "NV11DDR [GeForce2 MX 100 DDR/200 DDR]";
-static const char pci_device_10de_0112[] = "NV11 [GeForce2 Go]";
-static const char pci_device_10de_0113[] = "NV11GL [Quadro2 MXR/EX]";
-static const char pci_device_10de_0150[] = "NV15 [GeForce2 GTS/Pro]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0150_1043_4016[] = "V7700 AGP Video Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0150_107d_2840[] = "WinFast GeForce2 GTS with TV output";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0150_1462_8831[] = "Creative GeForce2 Pro";
-#endif
-static const char pci_device_10de_0151[] = "NV15DDR [GeForce2 Ti]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0151_1043_405f[] = "V7700Ti";
-#endif
-static const char pci_device_10de_0152[] = "NV15BR [GeForce2 Ultra, Bladerunner]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0152_1048_0c56[] = "GLADIAC Ultra";
-#endif
-static const char pci_device_10de_0153[] = "NV15GL [Quadro2 Pro]";
-static const char pci_device_10de_0170[] = "NV17 [GeForce4 MX 460]";
-static const char pci_device_10de_0171[] = "NV17 [GeForce4 MX 440]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0171_10b0_0002[] = "Gainward Pro/600 TV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0171_1462_8661[] = "G4MX440-VTP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0171_1462_8730[] = "MX440SES-T (MS-8873)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0171_147b_8f00[] = "Abit Siluro GeForce4MX440";
-#endif
-static const char pci_device_10de_0172[] = "NV17 [GeForce4 MX 420]";
-static const char pci_device_10de_0173[] = "NV17 [GeForce4 MX 440-SE]";
-static const char pci_device_10de_0174[] = "NV17 [GeForce4 440 Go]";
-static const char pci_device_10de_0175[] = "NV17 [GeForce4 420 Go]";
-static const char pci_device_10de_0176[] = "NV17 [GeForce4 420 Go 32M]";
-static const char pci_device_10de_0178[] = "NV17GL [Quadro4 550 XGL]";
-static const char pci_device_10de_0179[] = "NV17 [GeForce4 440 Go 64M]";
-static const char pci_device_10de_017a[] = "NV17GL [Quadro4 200/400 NVS]";
-static const char pci_device_10de_017b[] = "NV17GL [Quadro4 550 XGL]";
-static const char pci_device_10de_017c[] = "NV17GL [Quadro4 550 GoGL]";
-static const char pci_device_10de_0181[] = "NV18 [GeForce4 MX 440 AGP 8x]";
-static const char pci_device_10de_0182[] = "NV18 [GeForce4 MX 440SE AGP 8x]";
-static const char pci_device_10de_0183[] = "NV18 [GeForce4 MX 420 AGP 8x]";
-static const char pci_device_10de_0188[] = "NV18GL [Quadro4 580 XGL]";
-static const char pci_device_10de_018a[] = "NV18GL [Quadro4 NVS]";
-static const char pci_device_10de_018b[] = "NV18GL [Quadro4 380 XGL]";
-static const char pci_device_10de_01a0[] = "NV15 [GeForce2 - nForce GPU]";
-static const char pci_device_10de_01a4[] = "nForce CPU bridge";
-static const char pci_device_10de_01ab[] = "nForce 420 Memory Controller (DDR)";
-static const char pci_device_10de_01ac[] = "nForce 220/420 Memory Controller";
-static const char pci_device_10de_01ad[] = "nForce 220/420 Memory Controller";
-static const char pci_device_10de_01b1[] = "nForce Audio";
-static const char pci_device_10de_01b2[] = "nForce ISA Bridge";
-static const char pci_device_10de_01b4[] = "nForce PCI System Management";
-static const char pci_device_10de_01b7[] = "nForce AGP to PCI Bridge";
-static const char pci_device_10de_01b8[] = "nForce PCI-to-PCI bridge";
-static const char pci_device_10de_01bc[] = "nForce IDE";
-static const char pci_device_10de_01c1[] = "Intel 537 [nForce MC97 Modem]";
-static const char pci_device_10de_01c2[] = "nForce USB Controller";
-static const char pci_device_10de_01c3[] = "nForce Ethernet Controller";
-static const char pci_device_10de_01e8[] = "nForce2 AGP";
-static const char pci_device_10de_01f0[] = "NV18 [GeForce4 MX - nForce GPU]";
-static const char pci_device_10de_0200[] = "NV20 [GeForce3]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0200_1043_402f[] = "AGP-V8200 DDR";
-#endif
-static const char pci_device_10de_0201[] = "NV20 [GeForce3 Ti 200]";
-static const char pci_device_10de_0202[] = "NV20 [GeForce3 Ti 500]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0202_1043_405b[] = "V8200 T5";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0202_1545_002f[] = "Xtasy 6964";
-#endif
-static const char pci_device_10de_0203[] = "NV20DCC [Quadro DCC]";
-static const char pci_device_10de_0250[] = "NV25 [GeForce4 Ti 4600]";
-static const char pci_device_10de_0251[] = "NV25 [GeForce4 Ti 4400]";
-static const char pci_device_10de_0252[] = "NV25 [GeForce4 Ti]";
-static const char pci_device_10de_0253[] = "NV25 [GeForce4 Ti 4200]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0253_107d_2896[] = "WinFast A250 LE TD (Dual VGA/TV-out/DVI)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10de_0253_147b_8f09[] = "Siluro (Dual VGA/TV-out/DVI)";
-#endif
-static const char pci_device_10de_0258[] = "NV25GL [Quadro4 900 XGL]";
-static const char pci_device_10de_0259[] = "NV25GL [Quadro4 750 XGL]";
-static const char pci_device_10de_025b[] = "NV25GL [Quadro4 700 XGL]";
-static const char pci_device_10de_0280[] = "NV28 [GeForce4 Ti 4800]";
-static const char pci_device_10de_0281[] = "NV28 [GeForce4 Ti 4200 AGP 8x]";
-static const char pci_device_10de_0282[] = "NV28 [GeForce4 Ti 4800 SE]";
-static const char pci_device_10de_0288[] = "NV28GL [Quadro4 980 XGL]";
-static const char pci_device_10de_0289[] = "NV28GL [Quadro4 780 XGL]";
-static const char pci_device_10de_0300[] = "NV30 [GeForce FX]";
-static const char pci_device_10de_0301[] = "NV30 [GeForce FX 5800 Ultra]";
-static const char pci_device_10de_0302[] = "NV30 [GeForce FX 5800]";
-static const char pci_device_10de_0308[] = "NV30GL [Quadro FX 2000]";
-static const char pci_device_10de_0309[] = "NV30GL [Quadro FX 1000]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10df[] = "Emulex Corporation";
-static const char pci_device_10df_1ae5[] = "LP6000 Fibre Channel Host Adapter";
-static const char pci_device_10df_f085[] = "LP850 Fibre Channel Adapter";
-static const char pci_device_10df_f095[] = "LP952 Fibre Channel Adapter";
-static const char pci_device_10df_f098[] = "LP982 Fibre Channel Adapter";
-static const char pci_device_10df_f700[] = "LP7000 Fibre Channel Host Adapter";
-static const char pci_device_10df_f800[] = "LP8000 Fibre Channel Host Adapter";
-static const char pci_device_10df_f900[] = "LP9000 Fibre Channel Host Adapter";
-static const char pci_device_10df_f980[] = "LP9802 Fibre Channel Adapter";
-#endif
-static const char pci_vendor_10e0[] = "Integrated Micro Solutions Inc.";
-static const char pci_device_10e0_5026[] = "IMS5026/27/28";
-static const char pci_device_10e0_5027[] = "IMS5027";
-static const char pci_device_10e0_5028[] = "IMS5028";
-static const char pci_device_10e0_8849[] = "IMS8849";
-static const char pci_device_10e0_8853[] = "IMS8853";
-static const char pci_device_10e0_9128[] = "IMS9128 [Twin turbo 128]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e1[] = "Tekram Technology Co.,Ltd.";
-static const char pci_device_10e1_0391[] = "TRM-S1040";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10e1_0391_10e1_0391[] = "DC-315U SCSI-3 Host Adapter";
-#endif
-static const char pci_device_10e1_690c[] = "DC-690c";
-static const char pci_device_10e1_dc29[] = "DC-290";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e2[] = "Aptix Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e3[] = "Tundra Semiconductor Corp.";
-static const char pci_device_10e3_0000[] = "CA91C042 [Universe]";
-static const char pci_device_10e3_0860[] = "CA91C860 [QSpan]";
-static const char pci_device_10e3_0862[] = "CA91C862A [QSpan-II]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e4[] = "Tandem Computers";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e5[] = "Micro Industries Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e6[] = "Gainbery Computer Products Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e7[] = "Vadem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e8[] = "Applied Micro Circuits Corp.";
-static const char pci_device_10e8_2011[] = "Q-Motion Video Capture/Edit board";
-static const char pci_device_10e8_4750[] = "S5930 [Matchmaker]";
-static const char pci_device_10e8_5920[] = "S5920";
-static const char pci_device_10e8_8043[] = "LANai4.x [Myrinet LANai interface chip]";
-static const char pci_device_10e8_8062[] = "S5933_PARASTATION";
-static const char pci_device_10e8_807d[] = "S5933 [Matchmaker]";
-static const char pci_device_10e8_8088[] = "Kongsberg Spacetec Format Synchronizer";
-static const char pci_device_10e8_8089[] = "Kongsberg Spacetec Serial Output Board";
-static const char pci_device_10e8_809c[] = "S5933_HEPC3";
-static const char pci_device_10e8_80d7[] = "PCI-9112";
-static const char pci_device_10e8_80d9[] = "PCI-9118";
-static const char pci_device_10e8_80da[] = "PCI-9812";
-static const char pci_device_10e8_811a[] = "PCI-IEEE1355-DS-DE Interface";
-static const char pci_device_10e8_8170[] = "S5933 [Matchmaker] (Chipset Development Tool)";
-static const char pci_device_10e8_82db[] = "AJA HDNTV HD SDI Framestore";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10e9[] = "Alps Electric Co., Ltd.";
-#endif
-static const char pci_vendor_10ea[] = "Intergraphics Systems";
-static const char pci_device_10ea_1680[] = "IGA-1680";
-static const char pci_device_10ea_1682[] = "IGA-1682";
-static const char pci_device_10ea_1683[] = "IGA-1683";
-static const char pci_device_10ea_2000[] = "CyberPro 2000";
-static const char pci_device_10ea_2010[] = "CyberPro 2000A";
-static const char pci_device_10ea_5000[] = "CyberPro 5000";
-static const char pci_device_10ea_5050[] = "CyberPro 5050";
-static const char pci_device_10ea_5202[] = "CyberPro 5202";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10eb[] = "Artists Graphics";
-static const char pci_device_10eb_0101[] = "3GA";
-static const char pci_device_10eb_8111[] = "Twist3 Frame Grabber";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ec[] = "Realtek Semiconductor Co., Ltd.";
-static const char pci_device_10ec_8029[] = "RTL-8029(AS)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8029_10b8_2011[] = "EZ-Card (SMC1208)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8029_10ec_8029[] = "RTL-8029(AS)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8029_1113_1208[] = "EN1208";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8029_1186_0300[] = "DE-528";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8029_1259_2400[] = "AT-2400";
-#endif
-static const char pci_device_10ec_8129[] = "RTL-8129";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8129_10ec_8129[] = "RT8129 Fast Ethernet Adapter";
-#endif
-static const char pci_device_10ec_8138[] = "RT8139 (B/C) Cardbus Fast Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8138_10ec_8138[] = "RT8139 (B/C) Fast Ethernet Adapter";
-#endif
-static const char pci_device_10ec_8139[] = "RTL-8139/8139C/8139C+";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1025_8920[] = "ALN-325";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1025_8921[] = "ALN-325";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_10bd_0320[] = "EP-320X-R";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_10ec_8139[] = "RT8139";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1186_1300[] = "DFE-538TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1186_1320[] = "SN5200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1186_8139[] = "DRN-32TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_11f6_8139[] = "FN22-3(A) LinxPRO Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1259_2500[] = "AT-2500TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1259_2503[] = "AT-2500TX/ACPI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1429_d010[] = "ND010";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1432_9130[] = "EN-9130TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1436_8139[] = "RT8139";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_146c_1439[] = "FE-1439TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1489_6001[] = "GF100TXRII";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_1489_6002[] = "GF100TXRA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_149c_139a[] = "LFE-8139ATX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_149c_8139[] = "LFE-8139TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_2646_0001[] = "EtheRx";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_8e2e_7000[] = "KF-230TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_8e2e_7100[] = "KF-230TX/2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8139_a0a0_0007[] = "ALN-325C";
-#endif
-static const char pci_device_10ec_8169[] = "RTL-8169";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_10ec_8169_1371_434e[] = "ProG-2000L";
-#endif
-static const char pci_device_10ec_8197[] = "SmartLAN56 56K Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ed[] = "Ascii Corporation";
-static const char pci_device_10ed_7310[] = "V7310";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ee[] = "Xilinx Corporation";
-static const char pci_device_10ee_3fc0[] = "RME Digi96";
-static const char pci_device_10ee_3fc1[] = "RME Digi96/8";
-static const char pci_device_10ee_3fc2[] = "RME Digi96/8 Pro";
-static const char pci_device_10ee_3fc3[] = "RME Digi96/8 Pad";
-static const char pci_device_10ee_3fc4[] = "RME Digi9652 (Hammerfall)";
-static const char pci_device_10ee_3fc5[] = "RME Hammerfall DSP";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ef[] = "Racore Computer Products, Inc.";
-static const char pci_device_10ef_8154[] = "M815x Token Ring Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f0[] = "Peritek Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f1[] = "Tyan Computer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f2[] = "Achme Computer, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f3[] = "Alaris, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f4[] = "S-MOS Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f5[] = "NKK Corporation";
-static const char pci_device_10f5_a001[] = "NDR4000 [NR4600 Bridge]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f6[] = "Creative Electronic Systems SA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f7[] = "Matsushita Electric Industrial Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f8[] = "Altos India Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10f9[] = "PC Direct";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10fa[] = "Truevision";
-static const char pci_device_10fa_000c[] = "TARGA 1000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10fb[] = "Thesys Gesellschaft für Mikroelektronik mbH";
-static const char pci_device_10fb_186f[] = "TH 6255";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10fc[] = "I-O Data Device, Inc.";
-static const char pci_device_10fc_0003[] = "Cardbus IDE Controller";
-static const char pci_device_10fc_0005[] = "Cardbus SCSI CBSC II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10fd[] = "Soyo Computer, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10fe[] = "Fast Multimedia AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_10ff[] = "NCube";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1100[] = "Jazz Multimedia";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1101[] = "Initio Corporation";
-static const char pci_device_1101_1060[] = "INI-A100U2W";
-static const char pci_device_1101_9100[] = "INI-9100/9100W";
-static const char pci_device_1101_9400[] = "INI-940";
-static const char pci_device_1101_9401[] = "INI-950";
-static const char pci_device_1101_9500[] = "360P";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1102[] = "Creative Labs";
-static const char pci_device_1102_0002[] = "SB Live! EMU10k1";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_0020[] = "CT4850 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_0021[] = "CT4620 SBLive!";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_002f[] = "SBLive! mainboard implementation";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_4001[] = "E-mu APS";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8022[] = "CT4780 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8023[] = "CT4790 SoundBlaster PCI512";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8024[] = "CT4760 SBLive!";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8025[] = "SBLive! Mainboard Implementation";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8026[] = "CT4830 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8027[] = "CT4832 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8028[] = "CT4760 SBLive! OEM version";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8031[] = "CT4831 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8040[] = "CT4760 SBLive!";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8051[] = "CT4850 SBLive! Value";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8061[] = "SBLive! Player 5.1";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8064[] = "SB Live! 5.1 Model SB0100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0002_1102_8065[] = "SBLive! 5.1 Digital Model SB0220";
-#endif
-static const char pci_device_1102_0004[] = "SB Audigy";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0004_1102_0051[] = "SB0090 Audigy Player";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_0004_1102_0053[] = "SB0090 Audigy Player/OEM";
-#endif
-static const char pci_device_1102_0006[] = "[SB Live! Value] EMU10k1X";
-static const char pci_device_1102_4001[] = "SB Audigy FireWire Port";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_4001_1102_0010[] = "SB Audigy FireWire Port";
-#endif
-static const char pci_device_1102_7002[] = "SB Live! MIDI/Game Port";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_7002_1102_0020[] = "Gameport Joystick";
-#endif
-static const char pci_device_1102_7003[] = "SB Audigy MIDI/Game port";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1102_7003_1102_0040[] = "SB Audigy MIDI/Game Port";
-#endif
-static const char pci_device_1102_7004[] = "[SB Live! Value] Input device controller";
-static const char pci_device_1102_8064[] = "SB0100 [SBLive! 5.1 OEM]";
-static const char pci_device_1102_8938[] = "Ectiva EV1938";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1103[] = "Triones Technologies, Inc.";
-static const char pci_device_1103_0003[] = "HPT343";
-static const char pci_device_1103_0004[] = "HPT366/368/370/370A/372";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1103_0004_1103_0001[] = "HPT370A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1103_0004_1103_0005[] = "HPT370 UDMA100";
-#endif
-static const char pci_device_1103_0005[] = "HPT372A";
-static const char pci_device_1103_0006[] = "HPT302";
-static const char pci_device_1103_0007[] = "HPT371";
-static const char pci_device_1103_0008[] = "HPT374";
-static const char pci_device_1103_0009[] = "HPT372N";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1104[] = "RasterOps Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1105[] = "Sigma Designs, Inc.";
-static const char pci_device_1105_1105[] = "REALmagic Xcard MPEG 1/2/3/4 DVD Decoder";
-static const char pci_device_1105_8300[] = "REALmagic Hollywood Plus DVD Decoder";
-static const char pci_device_1105_8400[] = "EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1106[] = "VIA Technologies, Inc.";
-static const char pci_device_1106_0102[] = "Embedded VIA Ethernet Controller";
-static const char pci_device_1106_0130[] = "VT6305 1394.A Controller";
-static const char pci_device_1106_0305[] = "VT8363/8365 [KT133/KM133]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0305_1043_8033[] = "A7V Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0305_1043_803e[] = "A7V-E Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0305_1043_8042[] = "A7V133/A7V133-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0305_147b_a401[] = "KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard";
-#endif
-static const char pci_device_1106_0391[] = "VT8371 [KX133]";
-static const char pci_device_1106_0501[] = "VT8501 [Apollo MVP4]";
-static const char pci_device_1106_0505[] = "VT82C505";
-static const char pci_device_1106_0561[] = "VT82C576MV";
-static const char pci_device_1106_0571[] = "VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1043_8052[] = "VT8233A Bus Master ATA100/66/33 IDE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1043_808c[] = "A7V8X motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1106_0571[] = "VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1179_0001[] = "Magnia Z310";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0571_1458_5002[] = "GA-7VAX Mainboard";
-#endif
-static const char pci_device_1106_0576[] = "VT82C576 3V [Apollo Master]";
-static const char pci_device_1106_0585[] = "VT82C585VP [Apollo VP1/VPX]";
-static const char pci_device_1106_0586[] = "VT82C586/A/B PCI-to-ISA [Apollo VP]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0586_1106_0000[] = "MVP3 ISA Bridge";
-#endif
-static const char pci_device_1106_0595[] = "VT82C595 [Apollo VP2]";
-static const char pci_device_1106_0596[] = "VT82C596 ISA [Mobile South]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0596_1106_0000[] = "VT82C596/A/B PCI to ISA Bridge";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0596_1458_0596[] = "VT82C596/A/B PCI to ISA Bridge";
-#endif
-static const char pci_device_1106_0597[] = "VT82C597 [Apollo VP3]";
-static const char pci_device_1106_0598[] = "VT82C598 [Apollo MVP3]";
-static const char pci_device_1106_0601[] = "VT8601 [Apollo ProMedia]";
-static const char pci_device_1106_0605[] = "VT8605 [ProSavage PM133]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0605_1043_802c[] = "CUV4X mainboard";
-#endif
-static const char pci_device_1106_0680[] = "VT82C680 [Apollo P6]";
-static const char pci_device_1106_0686[] = "VT82C686 [Apollo Super South]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1043_802c[] = "CUV4X mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1043_8033[] = "A7V Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1043_803e[] = "A7V-E Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1043_8040[] = "A7M266 Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1043_8042[] = "A7V133/A7V133-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1106_0000[] = "VT82C686/A PCI to ISA Bridge";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1106_0686[] = "VT82C686/A PCI to ISA Bridge";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_1179_0001[] = "Magnia Z310";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0686_147b_a702[] = "KG7-Lite Mainboard";
-#endif
-static const char pci_device_1106_0691[] = "VT82C693A/694x [Apollo PRO133x]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0691_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0691_1179_0001[] = "Magnia Z310";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_0691_1458_0691[] = "VT82C691 Apollo Pro System Controller";
-#endif
-static const char pci_device_1106_0693[] = "VT82C693 [Apollo Pro Plus]";
-static const char pci_device_1106_0698[] = "VT82C693A [Apollo Pro133 AGP]";
-static const char pci_device_1106_0926[] = "VT82C926 [Amazon]";
-static const char pci_device_1106_1000[] = "VT82C570MV";
-static const char pci_device_1106_1106[] = "VT82C570MV";
-static const char pci_device_1106_1571[] = "VT82C576M/VT82C586";
-static const char pci_device_1106_1595[] = "VT82C595/97 [Apollo VP2/97]";
-static const char pci_device_1106_3038[] = "USB";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3038_0925_1234[] = "USB Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3038_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3038_1043_808c[] = "A7V8X motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3038_1179_0001[] = "Magnia Z310";
-#endif
-static const char pci_device_1106_3040[] = "VT82C586B ACPI";
-static const char pci_device_1106_3043[] = "VT86C100A [Rhine]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3043_10bd_0000[] = "VT86C100A Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3043_1106_0100[] = "VT86C100A Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3043_1186_1400[] = "DFE-530TX rev A";
-#endif
-static const char pci_device_1106_3044[] = "IEEE 1394 Host Controller";
-static const char pci_device_1106_3050[] = "VT82C596 Power Management";
-static const char pci_device_1106_3051[] = "VT82C596 Power Management";
-static const char pci_device_1106_3057[] = "VT82C686 [Apollo Super ACPI]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1043_8033[] = "A7V Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1043_803e[] = "A7V-E Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1043_8040[] = "A7M266 Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1043_8042[] = "A7V133/A7V133-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3057_1179_0001[] = "Magnia Z310";
-#endif
-static const char pci_device_1106_3058[] = "VT82C686 AC97 Audio Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_0e11_b194[] = "Soundmax integrated digital audio";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_1019_0985[] = "P6VXA Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_1106_4511[] = "Onboard Audio on EP7KXA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_1458_7600[] = "Onboard Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_1462_3091[] = "MS-6309 Onboard Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3058_15dd_7609[] = "Onboard Audio";
-#endif
-static const char pci_device_1106_3059[] = "VT8233/A/8235 AC97 Audio Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3059_1043_8095[] = "A7V8X Motherboard (Realtek ALC650 codec)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3059_1458_a002[] = "GA-7VAX Onboard Audio (Realtek ALC650)";
-#endif
-static const char pci_device_1106_3065[] = "VT6102 [Rhine-II]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3065_1106_0102[] = "VT6102 [Rhine II] Embeded Ethernet Controller on VT8235";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3065_1186_1400[] = "DFE-530TX rev A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3065_1186_1401[] = "DFE-530TX rev B";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3065_13b9_1421[] = "LD-10/100AL PCI Fast Ethernet Adapter (rev.B)";
-#endif
-static const char pci_device_1106_3068[] = "Intel 537 [AC97 Modem]";
-static const char pci_device_1106_3074[] = "VT8233 PCI to ISA Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3074_1043_8052[] = "VT8233A";
-#endif
-static const char pci_device_1106_3091[] = "VT8633 [Apollo Pro266]";
-static const char pci_device_1106_3099[] = "VT8366/A/7 [Apollo KT266/A/333]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3099_1043_8064[] = "A7V266-E Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3099_1043_807f[] = "A7V333 Mainboard";
-#endif
-static const char pci_device_1106_3101[] = "VT8653 Host Bridge";
-static const char pci_device_1106_3102[] = "VT8662 Host Bridge";
-static const char pci_device_1106_3103[] = "VT8615 Host Bridge";
-static const char pci_device_1106_3104[] = "USB 2.0";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3104_1043_808c[] = "A7V8X motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3104_1458_5004[] = "GA-7VAX Mainboard";
-#endif
-static const char pci_device_1106_3106[] = "VT6105 [Rhine-III]";
-static const char pci_device_1106_3109[] = "VT8233C PCI to ISA Bridge";
-static const char pci_device_1106_3112[] = "VT8361 [KLE133] Host Bridge";
-static const char pci_device_1106_3116[] = "VT8375 [KM266/KL266] Host Bridge";
-static const char pci_device_1106_3122[] = "VT8623 [Apollo CLE266] integrated CastleRock graphics";
-static const char pci_device_1106_3123[] = "VT8623 [Apollo CLE266]";
-static const char pci_device_1106_3128[] = "VT8753 [P4X266 AGP]";
-static const char pci_device_1106_3133[] = "VT3133 Host Bridge";
-static const char pci_device_1106_3147[] = "VT8233A ISA Bridge";
-static const char pci_device_1106_3148[] = "P4M266 Host Bridge";
-static const char pci_device_1106_3156[] = "P/KN266 Host Bridge";
-static const char pci_device_1106_3168[] = "VT8374 P4X400 Host Controller/AGP Bridge";
-static const char pci_device_1106_3177[] = "VT8235 ISA Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3177_1043_808c[] = "A7V8X motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3177_1458_5001[] = "GA-7VAX Mainboard";
-#endif
-static const char pci_device_1106_3189[] = "VT8377 [KT400 AGP] Host Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3189_1043_807f[] = "A7V8X motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_3189_1458_5000[] = "GA-7VAX Mainboard";
-#endif
-static const char pci_device_1106_5030[] = "VT82C596 ACPI [Apollo PRO]";
-static const char pci_device_1106_6100[] = "VT85C100A [Rhine II]";
-static const char pci_device_1106_8231[] = "VT8231 [PCI-to-ISA Bridge]";
-static const char pci_device_1106_8235[] = "VT8235 ACPI";
-static const char pci_device_1106_8305[] = "VT8363/8365 [KT133/KM133 AGP]";
-static const char pci_device_1106_8391[] = "VT8371 [KX133 AGP]";
-static const char pci_device_1106_8501[] = "VT8501 [Apollo MVP4 AGP]";
-static const char pci_device_1106_8596[] = "VT82C596 [Apollo PRO AGP]";
-static const char pci_device_1106_8597[] = "VT82C597 [Apollo VP3 AGP]";
-static const char pci_device_1106_8598[] = "VT82C598/694x [Apollo MVP3/Pro133x AGP]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1106_8598_1019_0985[] = "P6VXA Motherboard";
-#endif
-static const char pci_device_1106_8601[] = "VT8601 [Apollo ProMedia AGP]";
-static const char pci_device_1106_8605[] = "VT8605 [PM133 AGP]";
-static const char pci_device_1106_8691[] = "VT82C691 [Apollo Pro]";
-static const char pci_device_1106_8693[] = "VT82C693 [Apollo Pro Plus] PCI Bridge";
-static const char pci_device_1106_b091[] = "VT8633 [Apollo Pro266 AGP]";
-static const char pci_device_1106_b099[] = "VT8366/A/7 [Apollo KT266/A/333 AGP]";
-static const char pci_device_1106_b101[] = "VT8653 AGP Bridge";
-static const char pci_device_1106_b102[] = "VT8362 AGP Bridge";
-static const char pci_device_1106_b103[] = "VT8615 AGP Bridge";
-static const char pci_device_1106_b112[] = "VT8361 [KLE133] AGP Bridge";
-static const char pci_device_1106_b168[] = "VT8235 PCI Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1107[] = "Stratus Computers";
-static const char pci_device_1107_0576[] = "VIA VT82C570MV [Apollo] (Wrong vendor ID!)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1108[] = "Proteon, Inc.";
-static const char pci_device_1108_0100[] = "p1690plus_AA";
-static const char pci_device_1108_0101[] = "p1690plus_AB";
-static const char pci_device_1108_0105[] = "P1690Plus";
-static const char pci_device_1108_0108[] = "P1690Plus";
-static const char pci_device_1108_0138[] = "P1690Plus";
-static const char pci_device_1108_0139[] = "P1690Plus";
-static const char pci_device_1108_013c[] = "P1690Plus";
-static const char pci_device_1108_013d[] = "P1690Plus";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1109[] = "Cogent Data Technologies, Inc.";
-static const char pci_device_1109_1400[] = "EM110TX [EX110TX]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110a[] = "Siemens Nixdorf AG";
-static const char pci_device_110a_0002[] = "Pirahna 2-port";
-static const char pci_device_110a_0005[] = "Tulip controller, power management, switch extender";
-static const char pci_device_110a_0006[] = "FSC PINC (I/O-APIC)";
-static const char pci_device_110a_0015[] = "FSC Multiprocessor Interrupt Controller";
-static const char pci_device_110a_001d[] = "FSC Copernicus Management Controller";
-static const char pci_device_110a_007b[] = "FSC Remote Service Controller, mailbox device";
-static const char pci_device_110a_007c[] = "FSC Remote Service Controller, shared memory device";
-static const char pci_device_110a_007d[] = "FSC Remote Service Controller, SMIC device";
-static const char pci_device_110a_2102[] = "DSCC4 WAN adapter";
-static const char pci_device_110a_4942[] = "FPGA I-Bus Tracer for MBD";
-static const char pci_device_110a_6120[] = "SZB6120";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110b[] = "Chromatic Research Inc.";
-static const char pci_device_110b_0001[] = "Mpact Media Processor";
-static const char pci_device_110b_0004[] = "Mpact 2";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110c[] = "Mini-Max Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110d[] = "Znyx Advanced Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110e[] = "CPU Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_110f[] = "Ross Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1110[] = "Powerhouse Systems";
-static const char pci_device_1110_6037[] = "Firepower Powerized SMP I/O ASIC";
-static const char pci_device_1110_6073[] = "Firepower Powerized SMP I/O ASIC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1111[] = "Santa Cruz Operation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1112[] = "Osicom Technologies Inc";
-static const char pci_device_1112_2200[] = "FDDI Adapter";
-static const char pci_device_1112_2300[] = "Fast Ethernet Adapter";
-static const char pci_device_1112_2340[] = "4 Port Fast Ethernet Adapter";
-static const char pci_device_1112_2400[] = "ATM Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1113[] = "Accton Technology Corporation";
-static const char pci_device_1113_1211[] = "SMC2-1211TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1113_1211_103c_1207[] = "EN-1207D Fast Ethernet Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1113_1211_1113_1211[] = "EN-1207D Fast Ethernet Adapter";
-#endif
-static const char pci_device_1113_1216[] = "EN-1216 Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1113_1216_111a_1020[] = "SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]";
-#endif
-static const char pci_device_1113_1217[] = "EN-1217 Ethernet Adapter";
-static const char pci_device_1113_5105[] = "10Mbps Network card";
-static const char pci_device_1113_9211[] = "EN-1207D Fast Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1113_9211_1113_9211[] = "EN-1207D Fast Ethernet Adapter";
-#endif
-static const char pci_device_1113_9511[] = "Fast Ethernet Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1114[] = "Atmel Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1115[] = "3D Labs";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1116[] = "Data Translation";
-static const char pci_device_1116_0022[] = "DT3001";
-static const char pci_device_1116_0023[] = "DT3002";
-static const char pci_device_1116_0024[] = "DT3003";
-static const char pci_device_1116_0025[] = "DT3004";
-static const char pci_device_1116_0026[] = "DT3005";
-static const char pci_device_1116_0027[] = "DT3001-PGL";
-static const char pci_device_1116_0028[] = "DT3003-PGL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1117[] = "Datacube, Inc";
-static const char pci_device_1117_9500[] = "Max-1C SVGA card";
-static const char pci_device_1117_9501[] = "Max-1C image processing";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1118[] = "Berg Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1119[] = "ICP Vortex Computersysteme GmbH";
-static const char pci_device_1119_0000[] = "GDT 6000/6020/6050";
-static const char pci_device_1119_0001[] = "GDT 6000B/6010";
-static const char pci_device_1119_0002[] = "GDT 6110/6510";
-static const char pci_device_1119_0003[] = "GDT 6120/6520";
-static const char pci_device_1119_0004[] = "GDT 6530";
-static const char pci_device_1119_0005[] = "GDT 6550";
-static const char pci_device_1119_0006[] = "GDT 6x17";
-static const char pci_device_1119_0007[] = "GDT 6x27";
-static const char pci_device_1119_0008[] = "GDT 6537";
-static const char pci_device_1119_0009[] = "GDT 6557";
-static const char pci_device_1119_000a[] = "GDT 6115/6515";
-static const char pci_device_1119_000b[] = "GDT 6125/6525";
-static const char pci_device_1119_000c[] = "GDT 6535";
-static const char pci_device_1119_000d[] = "GDT 6555";
-static const char pci_device_1119_0100[] = "GDT 6117RP/6517RP";
-static const char pci_device_1119_0101[] = "GDT 6127RP/6527RP";
-static const char pci_device_1119_0102[] = "GDT 6537RP";
-static const char pci_device_1119_0103[] = "GDT 6557RP";
-static const char pci_device_1119_0104[] = "GDT 6111RP/6511RP";
-static const char pci_device_1119_0105[] = "GDT 6121RP/6521RP";
-static const char pci_device_1119_0110[] = "GDT 6117RD/6517RD";
-static const char pci_device_1119_0111[] = "GDT 6127RD/6527RD";
-static const char pci_device_1119_0112[] = "GDT 6537RD";
-static const char pci_device_1119_0113[] = "GDT 6557RD";
-static const char pci_device_1119_0114[] = "GDT 6111RD/6511RD";
-static const char pci_device_1119_0115[] = "GDT 6121RD/6521RD";
-static const char pci_device_1119_0118[] = "GDT 6118RD/6518RD/6618RD";
-static const char pci_device_1119_0119[] = "GDT 6128RD/6528RD/6628RD";
-static const char pci_device_1119_011a[] = "GDT 6538RD/6638RD";
-static const char pci_device_1119_011b[] = "GDT 6558RD/6658RD";
-static const char pci_device_1119_0120[] = "GDT 6117RP2/6517RP2";
-static const char pci_device_1119_0121[] = "GDT 6127RP2/6527RP2";
-static const char pci_device_1119_0122[] = "GDT 6537RP2";
-static const char pci_device_1119_0123[] = "GDT 6557RP2";
-static const char pci_device_1119_0124[] = "GDT 6111RP2/6511RP2";
-static const char pci_device_1119_0125[] = "GDT 6121RP2/6521RP2";
-static const char pci_device_1119_0136[] = "GDT 6113RS/6513RS";
-static const char pci_device_1119_0137[] = "GDT 6123RS/6523RS";
-static const char pci_device_1119_0138[] = "GDT 6118RS/6518RS/6618RS";
-static const char pci_device_1119_0139[] = "GDT 6128RS/6528RS/6628RS";
-static const char pci_device_1119_013a[] = "GDT 6538RS/6638RS";
-static const char pci_device_1119_013b[] = "GDT 6558RS/6658RS";
-static const char pci_device_1119_013c[] = "GDT 6533RS/6633RS";
-static const char pci_device_1119_013d[] = "GDT 6543RS/6643RS";
-static const char pci_device_1119_013e[] = "GDT 6553RS/6653RS";
-static const char pci_device_1119_013f[] = "GDT 6563RS/6663RS";
-static const char pci_device_1119_0166[] = "GDT 7113RN/7513RN/7613RN";
-static const char pci_device_1119_0167[] = "GDT 7123RN/7523RN/7623RN";
-static const char pci_device_1119_0168[] = "GDT 7118RN/7518RN/7518RN";
-static const char pci_device_1119_0169[] = "GDT 7128RN/7528RN/7628RN";
-static const char pci_device_1119_016a[] = "GDT 7538RN/7638RN";
-static const char pci_device_1119_016b[] = "GDT 7558RN/7658RN";
-static const char pci_device_1119_016c[] = "GDT 7533RN/7633RN";
-static const char pci_device_1119_016d[] = "GDT 7543RN/7643RN";
-static const char pci_device_1119_016e[] = "GDT 7553RN/7653RN";
-static const char pci_device_1119_016f[] = "GDT 7563RN/7663RN";
-static const char pci_device_1119_01d6[] = "GDT 4x13RZ";
-static const char pci_device_1119_01d7[] = "GDT 4x23RZ";
-static const char pci_device_1119_01f6[] = "GDT 8x13RZ";
-static const char pci_device_1119_01f7[] = "GDT 8x23RZ";
-static const char pci_device_1119_01fc[] = "GDT 8x33RZ";
-static const char pci_device_1119_01fd[] = "GDT 8x43RZ";
-static const char pci_device_1119_01fe[] = "GDT 8x53RZ";
-static const char pci_device_1119_01ff[] = "GDT 8x63RZ";
-static const char pci_device_1119_0210[] = "GDT 6519RD/6619RD";
-static const char pci_device_1119_0211[] = "GDT 6529RD/6629RD";
-static const char pci_device_1119_0260[] = "GDT 7519RN/7619RN";
-static const char pci_device_1119_0261[] = "GDT 7529RN/7629RN";
-static const char pci_device_1119_0300[] = "GDT Raid Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111a[] = "Efficient Networks, Inc";
-static const char pci_device_111a_0000[] = "155P-MF1 (FPGA)";
-static const char pci_device_111a_0002[] = "155P-MF1 (ASIC)";
-static const char pci_device_111a_0003[] = "ENI-25P ATM";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0003_111a_0000[] = "ENI-25p Miniport ATM Adapter";
-#endif
-static const char pci_device_111a_0005[] = "SpeedStream (LANAI)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0001[] = "ENI-3010 ATM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0009[] = "ENI-3060 ADSL (VPI=0)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0101[] = "ENI-3010 ATM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0109[] = "ENI-3060CO ADSL (VPI=0)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0809[] = "ENI-3060 ADSL (VPI=0 or 8)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0909[] = "ENI-3060CO ADSL (VPI=0 or 8)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0005_111a_0a09[] = "ENI-3060 ADSL (VPI=<0..15>)";
-#endif
-static const char pci_device_111a_0007[] = "SpeedStream ADSL";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_111a_0007_111a_1001[] = "ENI-3061 ADSL [ASIC]";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111b[] = "Teledyne Electronic Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111c[] = "Tricord Systems Inc.";
-static const char pci_device_111c_0001[] = "Powerbis Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111d[] = "Integrated Device Tech";
-static const char pci_device_111d_0001[] = "IDT77211 ATM Adapter";
-static const char pci_device_111d_0003[] = "IDT77252 ATM network controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111e[] = "Eldec";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_111f[] = "Precision Digital Images";
-static const char pci_device_111f_4a47[] = "Precision MX Video engine interface";
-static const char pci_device_111f_5243[] = "Frame capture bus interface";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1120[] = "EMC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1121[] = "Zilog";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1122[] = "Multi-tech Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1123[] = "Excellent Design, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1124[] = "Leutron Vision AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1125[] = "Eurocore";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1126[] = "Vigra";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1127[] = "FORE Systems Inc";
-static const char pci_device_1127_0200[] = "ForeRunner PCA-200 ATM";
-static const char pci_device_1127_0210[] = "PCA-200PC";
-static const char pci_device_1127_0250[] = "ATM";
-static const char pci_device_1127_0300[] = "ForeRunner PCA-200EPC ATM";
-static const char pci_device_1127_0310[] = "ATM";
-static const char pci_device_1127_0400[] = "ForeRunnerHE ATM Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1127_0400_1127_0400[] = "ForeRunnerHE ATM";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1129[] = "Firmworks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112a[] = "Hermes Electronics Company, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112b[] = "Linotype - Hell AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112c[] = "Zenith Data Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112d[] = "Ravicad";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112e[] = "Infomedia Microelectronics Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_112f[] = "Imaging Technology Inc";
-static const char pci_device_112f_0000[] = "MVC IC-PCI";
-static const char pci_device_112f_0001[] = "MVC IM-PCI Video frame grabber/processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1130[] = "Computervision";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1131[] = "Philips Semiconductors";
-static const char pci_device_1131_1561[] = "USB 1.1 Host Controller";
-static const char pci_device_1131_1562[] = "USB 2.0 Host Controller";
-static const char pci_device_1131_3400[] = "SmartPCI56(UCB1500) 56K Modem";
-static const char pci_device_1131_7130[] = "SAA7130 Video Broadcast Decoder";
-static const char pci_device_1131_7133[] = "SAA7133 Audio+video broadcast decoder";
-static const char pci_device_1131_7134[] = "SAA7134";
-static const char pci_device_1131_7135[] = "SAA7135 Audio+video broadcast decoder";
-static const char pci_device_1131_7145[] = "SAA7145";
-static const char pci_device_1131_7146[] = "SAA7146";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1131_7146_114b_2003[] = "DVRaptor Video Edit/Capture Card";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1131_7146_11bd_0006[] = "DV500 Overlay";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1131_7146_11bd_000a[] = "DV500 Overlay";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1132[] = "Mitel Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1133[] = "Eicon Technology Corporation";
-static const char pci_device_1133_7901[] = "EiconCard S90";
-static const char pci_device_1133_7902[] = "EiconCard S90";
-static const char pci_device_1133_7911[] = "EiconCard S91";
-static const char pci_device_1133_7912[] = "EiconCard S91";
-static const char pci_device_1133_7941[] = "EiconCard S94";
-static const char pci_device_1133_7942[] = "EiconCard S94";
-static const char pci_device_1133_7943[] = "EiconCard S94";
-static const char pci_device_1133_7944[] = "EiconCard S94";
-static const char pci_device_1133_b921[] = "EiconCard P92";
-static const char pci_device_1133_b922[] = "EiconCard P92";
-static const char pci_device_1133_b923[] = "EiconCard P92";
-static const char pci_device_1133_e001[] = "DIVA 20PRO";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e001_1133_e001[] = "DIVA Pro 2.0 S/T";
-#endif
-static const char pci_device_1133_e002[] = "DIVA 20";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e002_1133_e002[] = "DIVA 2.0 S/T";
-#endif
-static const char pci_device_1133_e003[] = "DIVA 20PRO_U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e003_1133_e003[] = "DIVA Pro 2.0 U";
-#endif
-static const char pci_device_1133_e004[] = "DIVA 20_U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e004_1133_e004[] = "DIVA 2.0 U";
-#endif
-static const char pci_device_1133_e005[] = "DIVA LOW";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e005_1133_e005[] = "DIVA 2.01 S/T";
-#endif
-static const char pci_device_1133_e00b[] = "DIVA 2.02";
-static const char pci_device_1133_e010[] = "DIVA Server BRI-2M";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e010_1133_e010[] = "DIVA Server BRI-2M";
-#endif
-static const char pci_device_1133_e012[] = "DIVA Server BRI-8M";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e012_1133_e012[] = "DIVA Server BRI-8M";
-#endif
-static const char pci_device_1133_e014[] = "DIVA Server PRI-30M";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1133_e014_1133_e014[] = "DIVA Server PRI-30M";
-#endif
-static const char pci_device_1133_e018[] = "DIVA Server BRI-2M/-2F";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1134[] = "Mercury Computer Systems";
-static const char pci_device_1134_0001[] = "Raceway Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1135[] = "Fuji Xerox Co Ltd";
-static const char pci_device_1135_0001[] = "Printer controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1136[] = "Momentum Data Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1137[] = "Cisco Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1138[] = "Ziatech Corporation";
-static const char pci_device_1138_8905[] = "8905 [STD 32 Bridge]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1139[] = "Dynamic Pictures, Inc";
-static const char pci_device_1139_0001[] = "VGA Compatable 3D Graphics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113a[] = "FWB Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113b[] = "Network Computing Devices";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113c[] = "Cyclone Microsystems, Inc.";
-static const char pci_device_113c_0000[] = "PCI-9060 i960 Bridge";
-static const char pci_device_113c_0001[] = "PCI-SDK [PCI i960 Evaluation Platform]";
-static const char pci_device_113c_0911[] = "PCI-911 [i960Jx-based Intelligent I/O Controller]";
-static const char pci_device_113c_0912[] = "PCI-912 [i960CF-based Intelligent I/O Controller]";
-static const char pci_device_113c_0913[] = "PCI-913";
-static const char pci_device_113c_0914[] = "PCI-914 [I/O Controller w/ secondary PCI bus]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113d[] = "Leading Edge Products Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113e[] = "Sanyo Electric Co - Computer Engineering Dept";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_113f[] = "Equinox Systems, Inc.";
-static const char pci_device_113f_0808[] = "SST-64P Adapter";
-static const char pci_device_113f_1010[] = "SST-128P Adapter";
-static const char pci_device_113f_80c0[] = "SST-16P DB Adapter";
-static const char pci_device_113f_80c4[] = "SST-16P RJ Adapter";
-static const char pci_device_113f_80c8[] = "SST-16P Adapter";
-static const char pci_device_113f_8888[] = "SST-4P Adapter";
-static const char pci_device_113f_9090[] = "SST-8P Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1140[] = "Intervoice Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1141[] = "Crest Microsystem Inc";
-#endif
-static const char pci_vendor_1142[] = "Alliance Semiconductor Corporation";
-static const char pci_device_1142_3210[] = "AP6410";
-static const char pci_device_1142_6422[] = "ProVideo 6422";
-static const char pci_device_1142_6424[] = "ProVideo 6424";
-static const char pci_device_1142_6425[] = "ProMotion AT25";
-static const char pci_device_1142_643d[] = "ProMotion AT3D";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1143[] = "NetPower, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1144[] = "Cincinnati Milacron";
-static const char pci_device_1144_0001[] = "Noservo controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1145[] = "Workbit Corporation";
-static const char pci_device_1145_8007[] = "NinjaSCSI-32 Workbit";
-static const char pci_device_1145_f007[] = "NinjaSCSI-32 KME";
-static const char pci_device_1145_f010[] = "NinjaSCSI-32 Workbit";
-static const char pci_device_1145_f012[] = "NinjaSCSI-32 Logitec";
-static const char pci_device_1145_f013[] = "NinjaSCSI-32 Logitec";
-static const char pci_device_1145_f015[] = "NinjaSCSI-32 Melco";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1146[] = "Force Computers";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1147[] = "Interface Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1148[] = "Syskonnect (Schneider & Koch)";
-static const char pci_device_1148_4000[] = "FDDI Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_0e11_b03b[] = "Netelligent 100 FDDI DAS Fibre SC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_0e11_b03c[] = "Netelligent 100 FDDI SAS Fibre SC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_0e11_b03d[] = "Netelligent 100 FDDI DAS UTP";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_0e11_b03e[] = "Netelligent 100 FDDI SAS UTP";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_0e11_b03f[] = "Netelligent 100 FDDI SAS Fibre MIC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5521[] = "FDDI SK-5521 (SK-NET FDDI-UP)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5522[] = "FDDI SK-5522 (SK-NET FDDI-UP DAS)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5541[] = "FDDI SK-5541 (SK-NET FDDI-FP)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5543[] = "FDDI SK-5543 (SK-NET FDDI-LP)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5544[] = "FDDI SK-5544 (SK-NET FDDI-LP DAS)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5821[] = "FDDI SK-5821 (SK-NET FDDI-UP64)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5822[] = "FDDI SK-5822 (SK-NET FDDI-UP64 DAS)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5841[] = "FDDI SK-5841 (SK-NET FDDI-FP64)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5843[] = "FDDI SK-5843 (SK-NET FDDI-LP64)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4000_1148_5844[] = "FDDI SK-5844 (SK-NET FDDI-LP64 DAS)";
-#endif
-static const char pci_device_1148_4200[] = "Token Ring adapter";
-static const char pci_device_1148_4300[] = "Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9821[] = "SK-9821 (1000Base-T single link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9822[] = "SK-9822 (1000Base-T dual link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9841[] = "SK-9841 (1000Base-LX single link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9842[] = "SK-9842 (1000Base-LX dual link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9843[] = "SK-9843 (1000Base-SX single link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9844[] = "SK-9844 (1000Base-SX dual link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9861[] = "SK-9861 (1000Base-SX VF45 single link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9862[] = "SK-9862 (1000Base-SX VF45 dual link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9871[] = "SK-9871 (1000Base-ZX single link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1148_9872[] = "SK-9872 (1000Base-ZX dual link)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1259_2970[] = "AT-2970SX [Allied Telesyn]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1259_2972[] = "AT-2970T [Allied Telesyn]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1259_2975[] = "AT-2970SX [Allied Telesyn]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4300_1259_2977[] = "AT-2970T [Allied Telesyn]";
-#endif
-static const char pci_device_1148_4320[] = "SK-98xx Gigabit Ethernet Server Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5021[] = "SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5041[] = "SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5043[] = "SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5051[] = "SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5061[] = "SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_5071[] = "SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1148_4320_1148_9521[] = "SK-9521 10/100/1000Base-T Adapter";
-#endif
-static const char pci_device_1148_4400[] = "Gigabit Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1149[] = "Win System Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114a[] = "VMIC";
-static const char pci_device_114a_5579[] = "VMIPCI-5579 (Reflective Memory Card)";
-static const char pci_device_114a_5587[] = "VMIPCI-5587 (Reflective Memory Card)";
-static const char pci_device_114a_6504[] = "VMIC PCI 7755 FPGA";
-static const char pci_device_114a_7587[] = "VMIVME-7587";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114b[] = "Canopus Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114c[] = "Annabooks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114d[] = "IC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114e[] = "Nikon Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_114f[] = "Digi International";
-static const char pci_device_114f_0002[] = "AccelePort EPC";
-static const char pci_device_114f_0003[] = "RightSwitch SE-6";
-static const char pci_device_114f_0004[] = "AccelePort Xem";
-static const char pci_device_114f_0005[] = "AccelePort Xr";
-static const char pci_device_114f_0006[] = "AccelePort Xr,C/X";
-static const char pci_device_114f_0009[] = "AccelePort Xr/J";
-static const char pci_device_114f_000a[] = "AccelePort EPC/J";
-static const char pci_device_114f_000c[] = "DataFirePRIme T1 (1-port)";
-static const char pci_device_114f_000d[] = "SyncPort 2-Port (x.25/FR)";
-static const char pci_device_114f_0011[] = "AccelePort 8r EIA-232 (IBM)";
-static const char pci_device_114f_0012[] = "AccelePort 8r EIA-422";
-static const char pci_device_114f_0013[] = "AccelePort Xr";
-static const char pci_device_114f_0014[] = "AccelePort 8r EIA-422";
-static const char pci_device_114f_0015[] = "AccelePort Xem";
-static const char pci_device_114f_0016[] = "AccelePort EPC/X";
-static const char pci_device_114f_0017[] = "AccelePort C/X";
-static const char pci_device_114f_001a[] = "DataFirePRIme E1 (1-port)";
-static const char pci_device_114f_001b[] = "AccelePort C/X (IBM)";
-static const char pci_device_114f_001d[] = "DataFire RAS T1/E1/PRI";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_001d_114f_0050[] = "DataFire RAS E1 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_001d_114f_0051[] = "DataFire RAS Dual E1 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_001d_114f_0052[] = "DataFire RAS T1 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_001d_114f_0053[] = "DataFire RAS Dual T1 Adapter";
-#endif
-static const char pci_device_114f_0023[] = "AccelePort RAS";
-static const char pci_device_114f_0024[] = "DataFire RAS B4 ST/U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_0024_114f_0030[] = "DataFire RAS BRI U Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_114f_0024_114f_0031[] = "DataFire RAS BRI S/T Adapter";
-#endif
-static const char pci_device_114f_0026[] = "AccelePort 4r 920";
-static const char pci_device_114f_0027[] = "AccelePort Xr 920";
-static const char pci_device_114f_0034[] = "AccelePort 2r 920";
-static const char pci_device_114f_0035[] = "DataFire DSP T1/E1/PRI cPCI";
-static const char pci_device_114f_0040[] = "AccelePort Xp";
-static const char pci_device_114f_0042[] = "AccelePort 2p PCI";
-static const char pci_device_114f_0070[] = "Datafire Micro V IOM2 (Europe)";
-static const char pci_device_114f_0071[] = "Datafire Micro V (Europe)";
-static const char pci_device_114f_0072[] = "Datafire Micro V IOM2 (North America)";
-static const char pci_device_114f_0073[] = "Datafire Micro V (North America)";
-static const char pci_device_114f_6001[] = "Avanstar";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1150[] = "Thinking Machines Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1151[] = "JAE Electronics Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1152[] = "Megatek";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1153[] = "Land Win Electronic Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1154[] = "Melco Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1155[] = "Pine Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1156[] = "Periscope Engineering";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1157[] = "Avsys Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1158[] = "Voarx R & D Inc";
-static const char pci_device_1158_3011[] = "Tokenet/vg 1001/10m anylan";
-static const char pci_device_1158_9050[] = "Lanfleet/Truevalue";
-static const char pci_device_1158_9051[] = "Lanfleet/Truevalue";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1159[] = "Mutech Corp";
-static const char pci_device_1159_0001[] = "MV-1000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115a[] = "Harlequin Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115b[] = "Parallax Graphics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115c[] = "Photron Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115d[] = "Xircom";
-static const char pci_device_115d_0003[] = "Cardbus Ethernet 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_1014_0181[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_1014_1181[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_1014_8181[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_1014_9181[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_115d_0181[] = "Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_115d_1181[] = "Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_1179_0181[] = "Cardbus Ethernet 10/100";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_8086_8181[] = "EtherExpress PRO/100 Mobile CardBus 32 Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0003_8086_9181[] = "EtherExpress PRO/100 Mobile CardBus 32 Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_115d_0005[] = "Cardbus Ethernet 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0005_1014_0182[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0005_1014_1182[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0005_115d_0182[] = "Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0005_115d_1182[] = "Cardbus Ethernet 10/100";
-#endif
-static const char pci_device_115d_0007[] = "Cardbus Ethernet 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0007_1014_0182[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0007_1014_1182[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0007_115d_0182[] = "Cardbus Ethernet 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0007_115d_1182[] = "Cardbus Ethernet 10/100";
-#endif
-static const char pci_device_115d_000b[] = "Cardbus Ethernet 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_000b_1014_0183[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_000b_115d_0183[] = "Cardbus Ethernet 10/100";
-#endif
-static const char pci_device_115d_000c[] = "Mini-PCI V.90 56k Modem";
-static const char pci_device_115d_000f[] = "Cardbus Ethernet 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_000f_1014_0183[] = "10/100 EtherJet Cardbus Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_000f_115d_0183[] = "Cardbus Ethernet 10/100";
-#endif
-static const char pci_device_115d_0101[] = "Cardbus 56k modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0101_115d_1081[] = "Cardbus 56k Modem";
-#endif
-static const char pci_device_115d_0103[] = "Cardbus Ethernet + 56k Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0103_1014_9181[] = "Cardbus 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0103_1115_1181[] = "Cardbus Ethernet 100 + 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0103_115d_1181[] = "CBEM56G-100 Ethernet + 56k Modem";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_115d_0103_8086_9181[] = "PRO/100 LAN + Modem56 CardBus";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115e[] = "Peer Protocols Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_115f[] = "Maxtor Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1160[] = "Megasoft Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1161[] = "PFU Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1162[] = "OA Laboratory Co Ltd";
-#endif
-static const char pci_vendor_1163[] = "Rendition";
-static const char pci_device_1163_0001[] = "Verite 1000";
-static const char pci_device_1163_2000[] = "Verite V2000/V2100/V2200";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1163_2000_1092_2000[] = "Stealth II S220";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1164[] = "Advanced Peripherals Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1165[] = "Imagraph Corporation";
-static const char pci_device_1165_0001[] = "Motion TPEG Recorder/Player with audio";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1166[] = "ServerWorks";
-static const char pci_device_1166_0005[] = "CNB20-LE Host Bridge";
-static const char pci_device_1166_0006[] = "CNB20HE Host Bridge";
-static const char pci_device_1166_0007[] = "CNB20-LE Host Bridge";
-static const char pci_device_1166_0008[] = "CNB20HE Host Bridge";
-static const char pci_device_1166_0009[] = "CNB20LE Host Bridge";
-static const char pci_device_1166_0010[] = "CIOB30";
-static const char pci_device_1166_0011[] = "CMIC-HE";
-static const char pci_device_1166_0012[] = "CMIC-LE";
-static const char pci_device_1166_0013[] = "CNB20-HE Host Bridge";
-static const char pci_device_1166_0014[] = "CNB20-HE Host Bridge";
-static const char pci_device_1166_0015[] = "CMIC-GC Host Bridge";
-static const char pci_device_1166_0016[] = "CMIC-GC Host Bridge";
-static const char pci_device_1166_0017[] = "GCNB-LE Host Bridge";
-static const char pci_device_1166_0200[] = "OSB4 South Bridge";
-static const char pci_device_1166_0201[] = "CSB5 South Bridge";
-static const char pci_device_1166_0203[] = "CSB6 South Bridge";
-static const char pci_device_1166_0211[] = "OSB4 IDE Controller";
-static const char pci_device_1166_0212[] = "CSB5 IDE Controller";
-static const char pci_device_1166_0213[] = "CSB6 RAID/IDE Controller";
-static const char pci_device_1166_0220[] = "OSB4/CSB5 OHCI USB Controller";
-static const char pci_device_1166_0221[] = "CSB6 OHCI USB Controller";
-static const char pci_device_1166_0225[] = "GCLE Host Bridge";
-static const char pci_device_1166_0227[] = "GCLE-2 Host Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1167[] = "Mutoh Industries Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1168[] = "Thine Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1169[] = "Centre for Development of Advanced Computing";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116a[] = "Polaris Communications";
-static const char pci_device_116a_6100[] = "Bus/Tag Channel";
-static const char pci_device_116a_6800[] = "Escon Channel";
-static const char pci_device_116a_7100[] = "Bus/Tag Channel";
-static const char pci_device_116a_7800[] = "Escon Channel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116b[] = "Connectware Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116c[] = "Intelligent Resources Integrated Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116d[] = "Martin-Marietta";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116e[] = "Electronics for Imaging";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_116f[] = "Workstation Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1170[] = "Inventec Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1171[] = "Loughborough Sound Images Plc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1172[] = "Altera Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1173[] = "Adobe Systems, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1174[] = "Bridgeport Machines";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1175[] = "Mitron Computer Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1176[] = "SBE Incorporated";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1177[] = "Silicon Engineering";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1178[] = "Alfa, Inc.";
-static const char pci_device_1178_afa1[] = "Fast Ethernet Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1179[] = "Toshiba America Info Systems";
-static const char pci_device_1179_0103[] = "EX-IDE Type-B";
-static const char pci_device_1179_0404[] = "DVD Decoder card";
-static const char pci_device_1179_0406[] = "Tecra Video Capture device";
-static const char pci_device_1179_0407[] = "DVD Decoder card (Version 2)";
-static const char pci_device_1179_0601[] = "601";
-static const char pci_device_1179_0603[] = "ToPIC95 PCI to CardBus Bridge for Notebooks";
-static const char pci_device_1179_060a[] = "ToPIC95";
-static const char pci_device_1179_060f[] = "ToPIC97";
-static const char pci_device_1179_0617[] = "ToPIC95 PCI to Cardbus Bridge with ZV Support";
-static const char pci_device_1179_0618[] = "CPU to PCI and PCI to ISA bridge";
-static const char pci_device_1179_0701[] = "FIR Port";
-static const char pci_device_1179_0804[] = "TC6371AF SmartMedia Controller";
-static const char pci_device_1179_0805[] = "SD TypA Controller";
-static const char pci_device_1179_0d01[] = "FIR Port Type-DO";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1179_0d01_1179_0001[] = "FIR Port Type-DO";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117a[] = "A-Trend Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117b[] = "L G Electronics, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117c[] = "Atto Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117d[] = "Becton & Dickinson";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117e[] = "T/R Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_117f[] = "Integrated Circuit Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1180[] = "Ricoh Co Ltd";
-static const char pci_device_1180_0465[] = "RL5c465";
-static const char pci_device_1180_0466[] = "RL5c466";
-static const char pci_device_1180_0475[] = "RL5c475";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0475_144d_c006[] = "vpr Matrix 170B4 CardBus bridge";
-#endif
-static const char pci_device_1180_0476[] = "RL5c476 II";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0476_1014_0185[] = "ThinkPad A/T/X Series";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0476_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0476_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1180_0477[] = "RL5c477";
-static const char pci_device_1180_0478[] = "RL5c478";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0478_1014_0184[] = "ThinkPad A30p (2653-64G)";
-#endif
-static const char pci_device_1180_0522[] = "R5C522 IEEE 1394 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0522_1014_01cf[] = "ThinkPad A30p (2653-64G)";
-#endif
-static const char pci_device_1180_0551[] = "R5C551 IEEE 1394 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0551_144d_c006[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_1180_0552[] = "R5C552 IEEE 1394 Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1180_0552_1014_0511[] = "ThinkPad A/T/X Series";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1181[] = "Telmatics International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1183[] = "Fujikura Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1184[] = "Forks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1185[] = "Dataworld International Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1186[] = "D-Link System Inc";
-static const char pci_device_1186_0100[] = "DC21041";
-static const char pci_device_1186_1002[] = "DL10050 Sundance Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1186_1002_1186_1002[] = "DFE-550TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1186_1002_1186_1012[] = "DFE-580TX";
-#endif
-static const char pci_device_1186_1300[] = "RTL8139 Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1186_1300_1186_1300[] = "DFE-538TX 10/100 Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1186_1300_1186_1301[] = "DFE-530TX+ 10/100 Ethernet Adapter";
-#endif
-static const char pci_device_1186_1340[] = "DFE-690TXD CardBus PC Card";
-static const char pci_device_1186_1561[] = "DRP-32TXD Cardbus PC Card";
-static const char pci_device_1186_4000[] = "DL2K Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1187[] = "Advanced Technology Laboratories, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1188[] = "Shima Seiki Manufacturing Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1189[] = "Matsushita Electronics Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118a[] = "Hilevel Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118b[] = "Hypertec Pty Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118c[] = "Corollary, Inc";
-static const char pci_device_118c_0014[] = "PCIB [C-bus II to PCI bus host bridge chip]";
-static const char pci_device_118c_1117[] = "Intel 8-way XEON Profusion Chipset [Cache Coherency Filter]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118d[] = "BitFlow Inc";
-static const char pci_device_118d_0001[] = "Raptor-PCI framegrabber";
-static const char pci_device_118d_0012[] = "Model 12 Road Runner Frame Grabber";
-static const char pci_device_118d_0014[] = "Model 14 Road Runner Frame Grabber";
-static const char pci_device_118d_0024[] = "Model 24 Road Runner Frame Grabber";
-static const char pci_device_118d_0044[] = "Model 44 Road Runner Frame Grabber";
-static const char pci_device_118d_0112[] = "Model 12 Road Runner Frame Grabber";
-static const char pci_device_118d_0114[] = "Model 14 Road Runner Frame Grabber";
-static const char pci_device_118d_0124[] = "Model 24 Road Runner Frame Grabber";
-static const char pci_device_118d_0144[] = "Model 44 Road Runner Frame Grabber";
-static const char pci_device_118d_0212[] = "Model 12 Road Runner Frame Grabber";
-static const char pci_device_118d_0214[] = "Model 14 Road Runner Frame Grabber";
-static const char pci_device_118d_0224[] = "Model 24 Road Runner Frame Grabber";
-static const char pci_device_118d_0244[] = "Model 44 Road Runner Frame Grabber";
-static const char pci_device_118d_0312[] = "Model 12 Road Runner Frame Grabber";
-static const char pci_device_118d_0314[] = "Model 14 Road Runner Frame Grabber";
-static const char pci_device_118d_0324[] = "Model 24 Road Runner Frame Grabber";
-static const char pci_device_118d_0344[] = "Model 44 Road Runner Frame Grabber";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118e[] = "Hermstedt GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_118f[] = "Green Logic";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1190[] = "Tripace";
-static const char pci_device_1190_c731[] = "TP-910/920/940 PCI Ultra(Wide) SCSI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1191[] = "Artop Electronic Corp";
-static const char pci_device_1191_0003[] = "SCSI Cache Host Adapter";
-static const char pci_device_1191_0004[] = "ATP8400";
-static const char pci_device_1191_0005[] = "ATP850UF";
-static const char pci_device_1191_0006[] = "ATP860 NO-BIOS";
-static const char pci_device_1191_0007[] = "ATP860";
-static const char pci_device_1191_0008[] = "ATP865 NO-ROM";
-static const char pci_device_1191_0009[] = "ATP865";
-static const char pci_device_1191_8002[] = "AEC6710 SCSI-2 Host Adapter";
-static const char pci_device_1191_8010[] = "AEC6712UW SCSI";
-static const char pci_device_1191_8020[] = "AEC6712U SCSI";
-static const char pci_device_1191_8030[] = "AEC6712S SCSI";
-static const char pci_device_1191_8040[] = "AEC6712D SCSI";
-static const char pci_device_1191_8050[] = "AEC6712SUW SCSI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1192[] = "Densan Company Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1193[] = "Zeitnet Inc.";
-static const char pci_device_1193_0001[] = "1221";
-static const char pci_device_1193_0002[] = "1225";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1194[] = "Toucan Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1195[] = "Ratoc System Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1196[] = "Hytec Electronics Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1197[] = "Gage Applied Sciences, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1198[] = "Lambda Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1199[] = "Attachmate Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119a[] = "Mind Share, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119b[] = "Omega Micro Inc.";
-static const char pci_device_119b_1221[] = "82C092G";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119c[] = "Information Technology Inst.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119d[] = "Bug, Inc. Sapporo Japan";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119e[] = "Fujitsu Microelectronics Ltd.";
-static const char pci_device_119e_0001[] = "FireStream 155";
-static const char pci_device_119e_0003[] = "FireStream 50";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_119f[] = "Bull HN Information Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a0[] = "Convex Computer Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a1[] = "Hamamatsu Photonics K.K.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a2[] = "Sierra Research and Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a3[] = "Deuretzbacher GmbH & Co. Eng. KG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a4[] = "Barco Graphics NV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a5[] = "Microunity Systems Eng. Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a6[] = "Pure Data Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a7[] = "Power Computing Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a8[] = "Systech Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11a9[] = "InnoSys Inc.";
-static const char pci_device_11a9_4240[] = "AMCC S933Q Intelligent Serial Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11aa[] = "Actel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ab[] = "Galileo Technology Ltd.";
-static const char pci_device_11ab_0146[] = "GT-64010/64010A System Controller";
-static const char pci_device_11ab_4611[] = "GT-64115 System Controller";
-static const char pci_device_11ab_4620[] = "GT-64120/64120A/64121A System Controller";
-static const char pci_device_11ab_4801[] = "GT-48001";
-static const char pci_device_11ab_f003[] = "GT-64010 Primary Image Piranha Image Generator";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ac[] = "Canon Information Systems Research Aust.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ad[] = "Lite-On Communications Inc";
-static const char pci_device_11ad_0002[] = "LNE100TX";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_0002_11ad_0002[] = "LNE100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_0002_11ad_0003[] = "LNE100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_0002_11ad_f003[] = "LNE100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_0002_11ad_ffff[] = "LNE100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_0002_1385_f004[] = "FA310TX";
-#endif
-static const char pci_device_11ad_c115[] = "LNE100TX [Linksys EtherFast 10/100]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11ad_c115_11ad_c001[] = "LNE100TX [ver 2.0]";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ae[] = "Aztech System Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11af[] = "Avid Technology Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b0[] = "V3 Semiconductor Inc.";
-static const char pci_device_11b0_0002[] = "V300PSC";
-static const char pci_device_11b0_0292[] = "V292PBC [Am29030/40 Bridge]";
-static const char pci_device_11b0_0960[] = "V96xPBC";
-static const char pci_device_11b0_c960[] = "V96DPC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b1[] = "Apricot Computers";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b2[] = "Eastman Kodak";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b3[] = "Barr Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b4[] = "Leitch Technology International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b5[] = "Radstone Technology Plc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b6[] = "United Video Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b7[] = "Motorola";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b8[] = "XPoint Technologies, Inc";
-static const char pci_device_11b8_0001[] = "Quad PeerMaster";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11b9[] = "Pathlight Technology Inc.";
-static const char pci_device_11b9_c0ed[] = "SSA Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ba[] = "Videotron Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11bb[] = "Pyramid Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11bc[] = "Network Peripherals Inc";
-static const char pci_device_11bc_0001[] = "NP-PCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11bd[] = "Pinnacle Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11be[] = "International Microcircuits Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11bf[] = "Astrodesign, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c0[] = "Hewlett Packard";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c1[] = "Lucent Microelectronics";
-static const char pci_device_11c1_0440[] = "56k WinModem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_1033_8015[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_1033_8047[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_1033_804f[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_10cf_102c[] = "LB LT Modem V.90 56k";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_10cf_104a[] = "BIBLO LT Modem 56k";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_10cf_105f[] = "LB2 LT Modem V.90 56k";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_1179_0001[] = "Internal V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_11c1_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_122d_4101[] = "MDP7800-U Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_122d_4102[] = "MDP7800SP-U Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_0040[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_0441[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_0450[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_f100[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_13e0_f101[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_144d_2101[] = "LT56PV Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0440_149f_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-static const char pci_device_11c1_0441[] = "56k WinModem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1033_804d[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1033_8065[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1092_0440[] = "Supra 56i";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1179_0001[] = "Internal V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_11c1_0440[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_11c1_0441[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_122d_4100[] = "MDP7800-U Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0040[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0100[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0410[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0420[] = "TelePath Internet 56k WinModem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0440[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_0443[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_13e0_f102[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1416_9804[] = "CommWave 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_141d_0440[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_144f_0441[] = "Lucent 56k V.90 DF Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_144f_0449[] = "Lucent 56k V.90 DF Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_144f_110d[] = "Lucent Win Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1468_0441[] = "Presario 56k V.90 DF Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0441_1668_0440[] = "Lucent Win Modem";
-#endif
-static const char pci_device_11c1_0442[] = "56k WinModem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_11c1_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_11c1_0442[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_13e0_0412[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_13e0_0442[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_13fc_2471[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_144d_2104[] = "LT56PT Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_144f_1104[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_149f_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0442_1668_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-static const char pci_device_11c1_0443[] = "LT WinModem";
-static const char pci_device_11c1_0444[] = "LT WinModem";
-static const char pci_device_11c1_0445[] = "LT WinModem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0445_8086_2203[] = "PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_11c1_0446[] = "LT WinModem";
-static const char pci_device_11c1_0447[] = "LT WinModem";
-static const char pci_device_11c1_0448[] = "WinModem 56k";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0448_1014_0131[] = "Lucent Win Modem";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0448_1033_8066[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0448_13e0_0030[] = "56k Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0448_13e0_0040[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0448_1668_2400[] = "LT WinModem 56k (MiniPCI Ethernet+Modem)";
-#endif
-static const char pci_device_11c1_0449[] = "WinModem 56k";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_0e11_b14d[] = "56k V.90 Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_13e0_0020[] = "LT WinModem 56k Data+Fax";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_13e0_0041[] = "TelePath Internet 56k WinModem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_1436_0440[] = "Lucent Win Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_144f_0449[] = "Lucent 56k V.90 DFi Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_1468_0410[] = "IBM ThinkPad T23 (2647-4MG)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_1468_0440[] = "Lucent Win Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0449_1468_0449[] = "Presario 56k V.90 DFi Modem";
-#endif
-static const char pci_device_11c1_044a[] = "F-1156IV WinModem (V90, 56KFlex)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_044a_10cf_1072[] = "LB Global LT Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_044a_13e0_0012[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_044a_13e0_0042[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_044a_144f_1005[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
-#endif
-static const char pci_device_11c1_044b[] = "LT WinModem";
-static const char pci_device_11c1_044c[] = "LT WinModem";
-static const char pci_device_11c1_044d[] = "LT WinModem";
-static const char pci_device_11c1_044e[] = "LT WinModem";
-static const char pci_device_11c1_044f[] = "V90 WildWire Modem";
-static const char pci_device_11c1_0450[] = "LT WinModem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_0450_144f_4005[] = "Magnia SG20";
-#endif
-static const char pci_device_11c1_0451[] = "LT WinModem";
-static const char pci_device_11c1_0452[] = "LT WinModem";
-static const char pci_device_11c1_0453[] = "LT WinModem";
-static const char pci_device_11c1_0454[] = "LT WinModem";
-static const char pci_device_11c1_0455[] = "LT WinModem";
-static const char pci_device_11c1_0456[] = "LT WinModem";
-static const char pci_device_11c1_0457[] = "LT WinModem";
-static const char pci_device_11c1_0458[] = "LT WinModem";
-static const char pci_device_11c1_0459[] = "LT WinModem";
-static const char pci_device_11c1_045a[] = "LT WinModem";
-static const char pci_device_11c1_045c[] = "LT WinModem";
-static const char pci_device_11c1_0461[] = "V90 WildWire Modem";
-static const char pci_device_11c1_0462[] = "V90 WildWire Modem";
-static const char pci_device_11c1_0480[] = "Venus Modem (V90, 56KFlex)";
-static const char pci_device_11c1_5801[] = "USB";
-static const char pci_device_11c1_5802[] = "USS-312 USB Controller";
-static const char pci_device_11c1_5803[] = "USS-344S USB Controller";
-static const char pci_device_11c1_5811[] = "FW323";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11c1_5811_dead_0800[] = "FireWire Host Bus Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c2[] = "Sand Microelectronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c3[] = "NEC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c4[] = "Document Technologies, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c5[] = "Shiva Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c6[] = "Dainippon Screen Mfg. Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c7[] = "D.C.M. Data Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c8[] = "Dolphin Interconnect Solutions AS";
-static const char pci_device_11c8_0658[] = "PSB32 SCI-Adapter D31x";
-static const char pci_device_11c8_d665[] = "PSB64 SCI-Adapter D32x";
-static const char pci_device_11c8_d667[] = "PSB66 SCI-Adapter D33x";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11c9[] = "Magma";
-static const char pci_device_11c9_0010[] = "16-line serial port w/- DMA";
-static const char pci_device_11c9_0011[] = "4-line serial port w/- DMA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ca[] = "LSI Systems, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11cb[] = "Specialix Research Ltd.";
-static const char pci_device_11cb_2000[] = "PCI_9050";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11cb_2000_11cb_0200[] = "SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11cb_2000_11cb_b008[] = "I/O8+";
-#endif
-static const char pci_device_11cb_4000[] = "SUPI_1";
-static const char pci_device_11cb_8000[] = "T225";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11cc[] = "Michels & Kleberhoff Computer GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11cd[] = "HAL Computer Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ce[] = "Netaccess";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11cf[] = "Pioneer Electronic Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d0[] = "Lockheed Martin Federal Systems-Manassas";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d1[] = "Auravision";
-static const char pci_device_11d1_01f7[] = "VxP524";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d2[] = "Intercom Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d3[] = "Trancell Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d4[] = "Analog Devices";
-static const char pci_device_11d4_1805[] = "SM56 PCI modem";
-static const char pci_device_11d4_1889[] = "AD1889 sound chip";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d5[] = "Ikon Corporation";
-static const char pci_device_11d5_0115[] = "10115";
-static const char pci_device_11d5_0117[] = "10117";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d6[] = "Tekelec Telecom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d7[] = "Trenton Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d8[] = "Image Technologies Development";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11d9[] = "TEC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11da[] = "Novell";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11db[] = "Sega Enterprises Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11dc[] = "Questra Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11dd[] = "Crosfield Electronics Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11de[] = "Zoran Corporation";
-static const char pci_device_11de_6057[] = "ZR36057PQC Video cutting chipset";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11de_6057_1031_7efe[] = "DC10 Plus";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11de_6057_1031_fc00[] = "MiroVIDEO DC50, Motion JPEG Capture/CODEC Board";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11de_6057_13ca_4231[] = "JPEG/TV Card";
-#endif
-static const char pci_device_11de_6120[] = "ZR36120";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11de_6120_1328_f001[] = "Cinemaster C DVD Decoder";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11df[] = "New Wave PDG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e0[] = "Cray Communications A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e1[] = "GEC Plessey Semi Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e2[] = "Samsung Information Systems America";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e3[] = "Quicklogic Corporation";
-static const char pci_device_11e3_5030[] = "PC Watchdog";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e4[] = "Second Wave Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e5[] = "IIX Consulting";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e6[] = "Mitsui-Zosen System Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e7[] = "Toshiba America, Elec. Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e8[] = "Digital Processing Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11e9[] = "Highwater Designs Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ea[] = "Elsag Bailey";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11eb[] = "Formation Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ec[] = "Coreco Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ed[] = "Mediamatics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ee[] = "Dome Imaging Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ef[] = "Nicolet Technologies B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f0[] = "Compu-Shack";
-static const char pci_device_11f0_4231[] = "FDDI";
-static const char pci_device_11f0_4232[] = "FASTline UTP Quattro";
-static const char pci_device_11f0_4233[] = "FASTline FO";
-static const char pci_device_11f0_4234[] = "FASTline UTP";
-static const char pci_device_11f0_4235[] = "FASTline-II UTP";
-static const char pci_device_11f0_4236[] = "FASTline-II FO";
-static const char pci_device_11f0_4731[] = "GIGAline";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f1[] = "Symbios Logic Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f2[] = "Picture Tel Japan K.K.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f3[] = "Keithley Metrabyte";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f4[] = "Kinetic Systems Corporation";
-static const char pci_device_11f4_2915[] = "CAMAC controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f5[] = "Computing Devices International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f6[] = "Compex";
-static const char pci_device_11f6_0112[] = "ENet100VG4";
-static const char pci_device_11f6_0113[] = "FreedomLine 100";
-static const char pci_device_11f6_1401[] = "ReadyLink 2000";
-static const char pci_device_11f6_2011[] = "RL100-ATX 10/100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11f6_2011_11f6_2011[] = "RL100-ATX";
-#endif
-static const char pci_device_11f6_2201[] = "ReadyLink 100TX (Winbond W89C840)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_11f6_2201_11f6_2011[] = "ReadyLink 100TX";
-#endif
-static const char pci_device_11f6_9881[] = "RL100TX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f7[] = "Scientific Atlanta";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f8[] = "PMC-Sierra Inc.";
-static const char pci_device_11f8_7375[] = "PM7375 [LASAR-155 ATM SAR]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11f9[] = "I-Cube Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11fa[] = "Kasan Electronics Company, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11fb[] = "Datel Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11fc[] = "Silicon Magic";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11fd[] = "High Street Consultants";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11fe[] = "Comtrol Corporation";
-static const char pci_device_11fe_0001[] = "RocketPort 8 Oct";
-static const char pci_device_11fe_0002[] = "RocketPort 8 Intf";
-static const char pci_device_11fe_0003[] = "RocketPort 16 Intf";
-static const char pci_device_11fe_0004[] = "RocketPort 32 Intf";
-static const char pci_device_11fe_0005[] = "RocketPort Octacable";
-static const char pci_device_11fe_0006[] = "RocketPort 8J";
-static const char pci_device_11fe_0007[] = "RocketPort 4-port";
-static const char pci_device_11fe_0008[] = "RocketPort 8-port";
-static const char pci_device_11fe_0009[] = "RocketPort 16-port";
-static const char pci_device_11fe_000a[] = "RocketPort Plus Quadcable";
-static const char pci_device_11fe_000b[] = "RocketPort Plus Octacable";
-static const char pci_device_11fe_000c[] = "RocketPort 8-port Modem";
-static const char pci_device_11fe_8015[] = "RocketPort 4-port UART 16954";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_11ff[] = "Scion Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1200[] = "CSS Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1201[] = "Vista Controls Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1202[] = "Network General Corp.";
-static const char pci_device_1202_4300[] = "Gigabit Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1202_4300_1202_9841[] = "SK-9841 LX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1202_4300_1202_9842[] = "SK-9841 LX dual link";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1202_4300_1202_9843[] = "SK-9843 SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1202_4300_1202_9844[] = "SK-9843 SX dual link";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1203[] = "Bayer Corporation, Agfa Division";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1204[] = "Lattice Semiconductor Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1205[] = "Array Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1206[] = "Amdahl Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1208[] = "Parsytec GmbH";
-static const char pci_device_1208_4853[] = "HS-Link Device";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1209[] = "SCI Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120a[] = "Synaptel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120b[] = "Adaptive Solutions";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120c[] = "Technical Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120d[] = "Compression Labs, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120e[] = "Cyclades Corporation";
-static const char pci_device_120e_0100[] = "Cyclom-Y below first megabyte";
-static const char pci_device_120e_0101[] = "Cyclom-Y above first megabyte";
-static const char pci_device_120e_0102[] = "Cyclom-4Y below first megabyte";
-static const char pci_device_120e_0103[] = "Cyclom-4Y above first megabyte";
-static const char pci_device_120e_0104[] = "Cyclom-8Y below first megabyte";
-static const char pci_device_120e_0105[] = "Cyclom-8Y above first megabyte";
-static const char pci_device_120e_0200[] = "Cyclades-Z below first megabyte";
-static const char pci_device_120e_0201[] = "Cyclades-Z above first megabyte";
-static const char pci_device_120e_0300[] = "PC300/RSV or /X21 (2 ports)";
-static const char pci_device_120e_0301[] = "PC300/RSV or /X21 (1 port)";
-static const char pci_device_120e_0310[] = "PC300/TE (2 ports)";
-static const char pci_device_120e_0311[] = "PC300/TE (1 port)";
-static const char pci_device_120e_0320[] = "PC300/TE-M (2 ports)";
-static const char pci_device_120e_0321[] = "PC300/TE-M (1 port)";
-static const char pci_device_120e_0400[] = "PC400";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_120f[] = "Essential Communications";
-static const char pci_device_120f_0001[] = "Roadrunner serial HIPPI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1210[] = "Hyperparallel Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1211[] = "Braintech Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1212[] = "Kingston Technology Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1213[] = "Applied Intelligent Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1214[] = "Performance Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1215[] = "Interware Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1216[] = "Purup Prepress A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1217[] = "O2 Micro, Inc.";
-static const char pci_device_1217_6729[] = "OZ6729";
-static const char pci_device_1217_673a[] = "OZ6730";
-static const char pci_device_1217_6832[] = "OZ6832/6833 Cardbus Controller";
-static const char pci_device_1217_6836[] = "OZ6836/6860 Cardbus Controller";
-static const char pci_device_1217_6872[] = "OZ6812 Cardbus Controller";
-static const char pci_device_1217_6925[] = "OZ6922 Cardbus Controller";
-static const char pci_device_1217_6933[] = "OZ6933 Cardbus Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1217_6933_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1217_6972[] = "OZ6912 Cardbus Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1217_6972_1179_0001[] = "Magnia Z310";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1218[] = "Hybricon Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1219[] = "First Virtual Corporation";
-#endif
-static const char pci_vendor_121a[] = "3Dfx Interactive, Inc.";
-static const char pci_device_121a_0001[] = "Voodoo";
-static const char pci_device_121a_0002[] = "Voodoo 2";
-static const char pci_device_121a_0003[] = "Voodoo Banshee";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_0003[] = "Monster Fusion";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_4000[] = "Monster Fusion";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_4002[] = "Monster Fusion";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_4801[] = "Monster Fusion AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_4803[] = "Monster Fusion AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_8030[] = "Monster Fusion";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1092_8035[] = "Monster Fusion AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_10b0_0001[] = "Dragon 4000";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_1102_1018[] = "3D Blaster Banshee VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_121a_0001[] = "Voodoo Banshee AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_121a_0003[] = "Voodoo Banshee AGP SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_121a_0004[] = "Voodoo Banshee";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_139c_0016[] = "Raven";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_139c_0017[] = "Raven";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0003_14af_0002[] = "Maxi Gamer Phoenix";
-#endif
-static const char pci_device_121a_0004[] = "Voodoo Banshee [Velocity 100]";
-static const char pci_device_121a_0005[] = "Voodoo 3";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0004[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0030[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0031[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0034[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0036[] = "Voodoo3";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0037[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0038[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_003a[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0044[] = "Voodoo3";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_004b[] = "Velocity 100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_004c[] = "Velocity 200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_004d[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_004e[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0051[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0052[] = "Voodoo3 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0060[] = "Voodoo3 3500 TV (NTSC)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0061[] = "Voodoo3 3500 TV (PAL)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0005_121a_0062[] = "Voodoo3 3500 TV (SECAM)";
-#endif
-static const char pci_device_121a_0009[] = "Voodoo 4 / Voodoo 5";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_121a_0009_121a_0009[] = "Voodoo5 AGP 5500/6000";
-#endif
-static const char pci_device_121a_0057[] = "Voodoo 3/3000 [Avenger]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_121b[] = "Advanced Telecommunications Modules";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_121c[] = "Nippon Texaco., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_121d[] = "Lippert Automationstechnik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_121e[] = "CSPI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_121f[] = "Arcus Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1220[] = "Ariel Corporation";
-static const char pci_device_1220_1220[] = "AMCC 5933 TMS320C80 DSP/Imaging board";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1221[] = "Contec Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1222[] = "Ancor Communications, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1223[] = "Artesyn Communication Products";
-static const char pci_device_1223_0003[] = "PM/Link";
-static const char pci_device_1223_0004[] = "PM/T1";
-static const char pci_device_1223_0005[] = "PM/E1";
-static const char pci_device_1223_0008[] = "PM/SLS";
-static const char pci_device_1223_0009[] = "BajaSpan Resource Target";
-static const char pci_device_1223_000a[] = "BajaSpan Section 0";
-static const char pci_device_1223_000b[] = "BajaSpan Section 1";
-static const char pci_device_1223_000c[] = "BajaSpan Section 2";
-static const char pci_device_1223_000d[] = "BajaSpan Section 3";
-static const char pci_device_1223_000e[] = "PM/PPC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1224[] = "Interactive Images";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1225[] = "Power I/O, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1227[] = "Tech-Source";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1228[] = "Norsk Elektro Optikk A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1229[] = "Data Kinesis Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122a[] = "Integrated Telecom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122b[] = "LG Industrial Systems Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122c[] = "Sican GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122d[] = "Aztech System Ltd";
-static const char pci_device_122d_1206[] = "368DSP";
-static const char pci_device_122d_50dc[] = "3328 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_122d_50dc_122d_0001[] = "3328 Audio";
-#endif
-static const char pci_device_122d_80da[] = "3328 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_122d_80da_122d_0001[] = "3328 Audio";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122e[] = "Xyratex";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_122f[] = "Andrew Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1230[] = "Fishcamp Engineering";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1231[] = "Woodward McCoach, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1232[] = "GPT Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1233[] = "Bus-Tech, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1234[] = "Technical Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1235[] = "Risq Modular Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1236[] = "Sigma Designs Corporation";
-static const char pci_device_1236_0000[] = "RealMagic64/GX";
-static const char pci_device_1236_6401[] = "REALmagic 64/GX (SD 6425)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1237[] = "Alta Technology Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1238[] = "Adtran";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1239[] = "3DO Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123a[] = "Visicom Laboratories, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123b[] = "Seeq Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123c[] = "Century Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123d[] = "Engineering Design Team, Inc.";
-static const char pci_device_123d_0000[] = "EasyConnect 8/32";
-static const char pci_device_123d_0002[] = "EasyConnect 8/64";
-static const char pci_device_123d_0003[] = "EasyIO";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123e[] = "Simutech, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_123f[] = "C-Cube Microsystems";
-static const char pci_device_123f_00e4[] = "MPEG";
-static const char pci_device_123f_8120[] = "E4?";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_123f_8120_11bd_0006[] = "DV500 E4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_123f_8120_11bd_000a[] = "DV500 E4";
-#endif
-static const char pci_device_123f_8888[] = "Cinemaster C 3.0 DVD Decoder";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_123f_8888_1002_0001[] = "Cinemaster C 3.0 DVD Decoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_123f_8888_1002_0002[] = "Cinemaster C 3.0 DVD Decoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_123f_8888_1328_0001[] = "Cinemaster C 3.0 DVD Decoder";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1240[] = "Marathon Technologies Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1241[] = "DSC Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1242[] = "JNI Corporation";
-static const char pci_device_1242_1560[] = "JNIC-1560 PCI-X Fibre Channel Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1242_1560_1242_6562[] = "FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1242_1560_1242_656a[] = "FCX-6562 PCI-X Fibre Channel Adapter";
-#endif
-static const char pci_device_1242_4643[] = "FCI-1063 Fibre Channel Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1243[] = "Delphax";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1244[] = "AVM Audiovisuelles MKTG & Computer System GmbH";
-static const char pci_device_1244_0700[] = "B1 ISDN";
-static const char pci_device_1244_0800[] = "C4 ISDN";
-static const char pci_device_1244_0a00[] = "A1 ISDN [Fritz]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1244_0a00_1244_0a00[] = "FRITZ!Card ISDN Controller";
-#endif
-static const char pci_device_1244_0e00[] = "Fritz!PCI v2.0 ISDN";
-static const char pci_device_1244_1100[] = "C2 ISDN";
-static const char pci_device_1244_1200[] = "T1 ISDN";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1245[] = "A.P.D., S.A.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1246[] = "Dipix Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1247[] = "Xylon Research, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1248[] = "Central Data Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1249[] = "Samsung Electronics Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124a[] = "AEG Electrocom GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124b[] = "SBS/Greenspring Modular I/O";
-static const char pci_device_124b_0040[] = "PCI-40A or cPCI-200 Quad IndustryPack carrier";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_124b_0040_124b_9080[] = "PCI9080 Bridge";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124c[] = "Solitron Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124d[] = "Stallion Technologies, Inc.";
-static const char pci_device_124d_0000[] = "EasyConnection 8/32";
-static const char pci_device_124d_0002[] = "EasyConnection 8/64";
-static const char pci_device_124d_0003[] = "EasyIO";
-static const char pci_device_124d_0004[] = "EasyConnection/RA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124e[] = "Cylink";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_124f[] = "Infotrend Technology, Inc.";
-static const char pci_device_124f_0041[] = "IFT-2000 Series RAID Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1250[] = "Hitachi Microcomputer System Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1251[] = "VLSI Solutions Oy";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1253[] = "Guzik Technical Enterprises";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1254[] = "Linear Systems Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1255[] = "Optibase Ltd";
-static const char pci_device_1255_1110[] = "MPEG Forge";
-static const char pci_device_1255_1210[] = "MPEG Fusion";
-static const char pci_device_1255_2110[] = "VideoPlex";
-static const char pci_device_1255_2120[] = "VideoPlex CC";
-static const char pci_device_1255_2130[] = "VideoQuest";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1256[] = "Perceptive Solutions, Inc.";
-static const char pci_device_1256_4201[] = "PCI-2220I";
-static const char pci_device_1256_4401[] = "PCI-2240I";
-static const char pci_device_1256_5201[] = "PCI-2000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1257[] = "Vertex Networks, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1258[] = "Gilbarco, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1259[] = "Allied Telesyn International";
-static const char pci_device_1259_2560[] = "AT-2560 Fast Ethernet Adapter (i82557B)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125a[] = "ABB Power Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125b[] = "Asix Electronics Corporation";
-static const char pci_device_125b_1400[] = "ALFA GFC2204";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125c[] = "Aurora Technologies, Inc.";
-static const char pci_device_125c_0640[] = "Aries 16000P";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125d[] = "ESS Technology";
-static const char pci_device_125d_0000[] = "ES336H Fax Modem (Early Model)";
-static const char pci_device_125d_1948[] = "Solo?";
-static const char pci_device_125d_1968[] = "ES1968 Maestro 2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1968_1028_0085[] = "ES1968 Maestro-2 PCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1968_1033_8051[] = "ES1968 Maestro-2 Audiodrive";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_125d_1969[] = "ES1969 Solo-1 Audiodrive";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1969_1014_0166[] = "ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1969_125d_8888[] = "Solo-1 Audio Adapter";
-#endif
-static const char pci_device_125d_1978[] = "ES1978 Maestro 2E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1978_0e11_b112[] = "Armada M700";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1978_1033_803c[] = "ES1978 Maestro-2E Audiodrive";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1978_1033_8058[] = "ES1978 Maestro-2E Audiodrive";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1978_1092_4000[] = "Monster Sound MX400";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1978_1179_0001[] = "ES1978 Maestro-2E Audiodrive";
-#endif
-static const char pci_device_125d_1988[] = "ES1988 Allegro-1";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1988_1092_4100[] = "Sonic Impact S100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1988_125d_1988[] = "ESS Allegro-1 Audiodrive";
-#endif
-static const char pci_device_125d_1989[] = "ESS Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1989_125d_1989[] = "ESS Modem";
-#endif
-static const char pci_device_125d_1998[] = "ES1983S Maestro-3i PCI Audio Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_1998_1028_00e6[] = "ES1983S Maestro-3i (Dell Inspiron 8100)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_125d_1999[] = "ES1983S Maestro-3i PCI Modem Accelerator";
-static const char pci_device_125d_199a[] = "ES1983S Maestro-3i PCI Audio Accelerator";
-static const char pci_device_125d_199b[] = "ES1983S Maestro-3i PCI Modem Accelerator";
-static const char pci_device_125d_2808[] = "ES336H Fax Modem (Later Model)";
-static const char pci_device_125d_2838[] = "ES2838/2839 SuperLink Modem";
-static const char pci_device_125d_2898[] = "ES2898 Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0424[] = "ES56-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0425[] = "ES56T-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0426[] = "ES56V-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0427[] = "VW-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0428[] = "ES56ST-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_125d_0429[] = "ES56SV-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_147a_c001[] = "ES56-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_14fe_0428[] = "ES56-PI Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_125d_2898_14fe_0429[] = "ES56-PI Data Fax Modem";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125e[] = "Specialvideo Engineering SRL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_125f[] = "Concurrent Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1260[] = "Harris Semiconductor";
-static const char pci_device_1260_3873[] = "Prism 2.5 Wavelan chipset";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1260_3873_1186_3501[] = "DWL-520 Wireless PCI Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1260_3873_1668_0414[] = "HWP01170-01 802.11b PCI Wireless Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1260_3873_1737_3874[] = "WMP11 Wireless 802.11b PCI Adapter";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1260_3873_8086_2513[] = "Wireless 802.11b MiniPCI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1260_3890[] = "D-Links DWL-g650 A1";
-static const char pci_device_1260_8130[] = "HMP8130 NTSC/PAL Video Decoder";
-static const char pci_device_1260_8131[] = "HMP8131 NTSC/PAL Video Decoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1261[] = "Matsushita-Kotobuki Electronics Industries, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1262[] = "ES Computer Company, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1263[] = "Sonic Solutions";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1264[] = "Aval Nagasaki Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1265[] = "Casio Computer Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1266[] = "Microdyne Corporation";
-static const char pci_device_1266_0001[] = "NE10/100 Adapter (i82557B)";
-static const char pci_device_1266_1910[] = "NE2000Plus (RT8029) Ethernet Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1266_1910_1266_1910[] = "NE2000Plus Ethernet Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1267[] = "S. A. Telecommunications";
-static const char pci_device_1267_5352[] = "PCR2101";
-static const char pci_device_1267_5a4b[] = "Telsat Turbo";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1268[] = "Tektronix";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1269[] = "Thomson-CSF/TTM";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_126a[] = "Lexmark International, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_126b[] = "Adax, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_126c[] = "Northern Telecom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_126d[] = "Splash Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_126e[] = "Sumitomo Metal Industries, Ltd.";
-#endif
-static const char pci_vendor_126f[] = "Silicon Motion, Inc.";
-static const char pci_device_126f_0710[] = "SM710 LynxEM";
-static const char pci_device_126f_0712[] = "SM712 LynxEM+";
-static const char pci_device_126f_0720[] = "SM720 Lynx3DM";
-static const char pci_device_126f_0730[] = "SM731 Cougar3DR";
-static const char pci_device_126f_0810[] = "SM810 LynxE";
-static const char pci_device_126f_0811[] = "SM811 LynxE";
-static const char pci_device_126f_0820[] = "SM820 Lynx3D";
-static const char pci_device_126f_0910[] = "SM910";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1270[] = "Olympus Optical Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1271[] = "GW Instruments";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1272[] = "Telematics International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1273[] = "Hughes Network Systems";
-static const char pci_device_1273_0002[] = "DirecPC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1274[] = "Ensoniq";
-static const char pci_device_1274_1171[] = "ES1373 [AudioPCI] (also Creative Labs CT5803)";
-static const char pci_device_1274_1371[] = "ES1371 [AudioPCI-97]";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_0e11_0024[] = "AudioPCI on Motherboard Compaq Deskpro";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_0e11_b1a7[] = "ES1371, ES1373 AudioPCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1033_80ac[] = "ES1371, ES1373 AudioPCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1042_1854[] = "Tazer";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_107b_8054[] = "Tabor2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1274_1371[] = "Creative Sound Blaster AudioPCI64V, AudioPCI128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6470[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6560[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6630[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6631[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6632[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6633[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6820[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6822[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6830[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6880[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6900[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6910[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6191";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6930[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6193";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6990[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1462_6991[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_14a4_2077[] = "ES1371, ES1373 AudioPCI On Motherboard KR639";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_14a4_2105[] = "ES1371, ES1373 AudioPCI On Motherboard MR800";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_14a4_2107[] = "ES1371, ES1373 AudioPCI On Motherboard MR801";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_14a4_2172[] = "ES1371, ES1373 AudioPCI On Motherboard DR739";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1509_9902[] = "ES1371, ES1373 AudioPCI On Motherboard KW11";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1509_9903[] = "ES1371, ES1373 AudioPCI On Motherboard KW31";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1509_9904[] = "ES1371, ES1373 AudioPCI On Motherboard KA11";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_1509_9905[] = "ES1371, ES1373 AudioPCI On Motherboard KC13";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_152d_8801[] = "ES1371, ES1373 AudioPCI On Motherboard CP810E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_152d_8802[] = "ES1371, ES1373 AudioPCI On Motherboard CP810";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_152d_8803[] = "ES1371, ES1373 AudioPCI On Motherboard P3810E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_152d_8804[] = "ES1371, ES1373 AudioPCI On Motherboard P3810-S";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_152d_8805[] = "ES1371, ES1373 AudioPCI On Motherboard P3820-S";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_2001[] = "ES1371, ES1373 AudioPCI On Motherboard 6CTR";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_2200[] = "ES1371, ES1373 AudioPCI On Motherboard 6WTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_3000[] = "ES1371, ES1373 AudioPCI On Motherboard 6WSV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_3100[] = "ES1371, ES1373 AudioPCI On Motherboard 6WIV2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_3102[] = "ES1371, ES1373 AudioPCI On Motherboard 6WIV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_270f_7060[] = "ES1371, ES1373 AudioPCI On Motherboard 6ASA2";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4249[] = "ES1371, ES1373 AudioPCI On Motherboard BI440ZX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_424c[] = "ES1371, ES1373 AudioPCI On Motherboard BL440ZX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_425a[] = "ES1371, ES1373 AudioPCI On Motherboard BZ440ZX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4341[] = "ES1371, ES1373 AudioPCI On Motherboard Cayman";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4343[] = "ES1371, ES1373 AudioPCI On Motherboard Cape Cod";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4649[] = "ES1371, ES1373 AudioPCI On Motherboard Fire Island";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_464a[] = "ES1371, ES1373 AudioPCI On Motherboard FJ440ZX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4d4f[] = "ES1371, ES1373 AudioPCI On Motherboard Montreal";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_4f43[] = "ES1371, ES1373 AudioPCI On Motherboard OC440LX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_5243[] = "ES1371, ES1373 AudioPCI On Motherboard RC440BX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_5352[] = "ES1371, ES1373 AudioPCI On Motherboard SunRiver";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_5643[] = "ES1371, ES1373 AudioPCI On Motherboard Vancouver";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_1371_8086_5753[] = "ES1371, ES1373 AudioPCI On Motherboard WS440BX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_1274_5000[] = "ES1370 [AudioPCI]";
-static const char pci_device_1274_5880[] = "5880 AudioPCI";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_1274_2000[] = "Creative Sound Blaster AudioPCI128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_1274_2003[] = "Creative SoundBlaster AudioPCI 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_1274_5880[] = "Creative Sound Blaster AudioPCI128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_1458_a000[] = "5880 AudioPCI On Motherboard 6OXET";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_1462_6880[] = "5880 AudioPCI On Motherboard MS-6188 1.00";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_270f_2001[] = "5880 AudioPCI On Motherboard 6CTR";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_270f_2200[] = "5880 AudioPCI On Motherboard 6WTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1274_5880_270f_7040[] = "5880 AudioPCI On Motherboard 6ATA4";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1275[] = "Network Appliance Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1276[] = "Switched Network Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1277[] = "Comstream";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1278[] = "Transtech Parallel Systems Ltd.";
-static const char pci_device_1278_0701[] = "TPE3/TM3 PowerPC Node";
-static const char pci_device_1278_0710[] = "TPE5 PowerPC PCI board";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1279[] = "Transmeta Corporation";
-static const char pci_device_1279_0295[] = "Northbridge";
-static const char pci_device_1279_0395[] = "LongRun Northbridge";
-static const char pci_device_1279_0396[] = "SDRAM controller";
-static const char pci_device_1279_0397[] = "BIOS scratchpad";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127a[] = "Rockwell International";
-static const char pci_device_127a_1002[] = "HCF 56k Data/Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_1092_094c[] = "SupraExpress 56i PRO [Diamond SUP2380]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4002[] = "HPG / MDP3858-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4005[] = "MDP3858-E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4007[] = "MDP3858-A/-NZ";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4012[] = "MDP3858-SA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4017[] = "MDP3858-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_122d_4018[] = "MDP3858-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1002_127a_1002[] = "Rockwell 56K D/F HCF Modem";
-#endif
-static const char pci_device_127a_1003[] = "HCF 56k Data/Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_0e11_b0bc[] = "229-DF Zephyr";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_0e11_b114[] = "229-DF Cheetah";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_1033_802b[] = "229-DF";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13df_1003[] = "PCI56RX Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13e0_0117[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13e0_0147[] = "IBM F-1156IV+/R3 Spain V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13e0_0197[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13e0_01c7[] = "IBM F-1156IV+/R3 WW V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_13e0_01f7[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_1436_1003[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_1436_1103[] = "IBM 5614PM3G V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1003_1436_1602[] = "Compaq 229-DF Ducati";
-#endif
-static const char pci_device_127a_1004[] = "HCF 56k Data/Fax/Voice Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1004_1048_1500[] = "MicroLink 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1004_10cf_1059[] = "Fujitsu 229-DFRT";
-#endif
-static const char pci_device_127a_1005[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_1033_8029[] = "229-DFSV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_1033_8054[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_10cf_103c[] = "Fujitsu";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_10cf_1055[] = "Fujitsu 229-DFSV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_10cf_1056[] = "Fujitsu 229-DFSV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4003[] = "MDP3858SP-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4006[] = "Packard Bell MDP3858V-E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4008[] = "MDP3858SP-A/SP-NZ";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4009[] = "MDP3858SP-E";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4010[] = "MDP3858V-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4011[] = "MDP3858SP-SA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4013[] = "MDP3858V-A/V-NZ";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4015[] = "MDP3858SP-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4016[] = "MDP3858V-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_122d_4019[] = "MDP3858V-SA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_13df_1005[] = "PCI56RVP Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_13e0_0187[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_13e0_01a7[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_13e0_01b7[] = "IBM DF-1156IV+/R3 Spain V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_13e0_01d7[] = "IBM DF-1156IV+/R3 WW V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_1436_1005[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_1436_1105[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1005_1437_1105[] = "IBM 5614PS3G V.90 Modem";
-#endif
-static const char pci_device_127a_1022[] = "HCF 56k Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1022_1436_1303[] = "M3-5614PM3G V.90 Modem";
-#endif
-static const char pci_device_127a_1023[] = "HCF 56k Data/Fax Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_122d_4020[] = "Packard Bell MDP3858-WE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_122d_4023[] = "MDP3858-UE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_13e0_0247[] = "IBM F-1156IV+/R6 Spain V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_13e0_0297[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_13e0_02c7[] = "IBM F-1156IV+/R6 WW V.90 Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_1436_1203[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1023_1436_1303[] = "IBM";
-#endif
-static const char pci_device_127a_1024[] = "HCF 56k Data/Fax/Voice Modem";
-static const char pci_device_127a_1025[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1025_10cf_106a[] = "Fujitsu 235-DFSV";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1025_122d_4021[] = "Packard Bell MDP3858V-WE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1025_122d_4022[] = "MDP3858SP-WE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1025_122d_4024[] = "MDP3858V-UE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_1025_122d_4025[] = "MDP3858SP-UE";
-#endif
-static const char pci_device_127a_1026[] = "HCF 56k PCI Speakerphone Modem";
-static const char pci_device_127a_1032[] = "HCF 56k Modem";
-static const char pci_device_127a_1033[] = "HCF 56k Modem";
-static const char pci_device_127a_1034[] = "HCF 56k Modem";
-static const char pci_device_127a_1035[] = "HCF 56k PCI Speakerphone Modem";
-static const char pci_device_127a_1036[] = "HCF 56k Modem";
-static const char pci_device_127a_1085[] = "HCF 56k Volcano PCI Modem";
-static const char pci_device_127a_2005[] = "HCF 56k Data/Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_8044[] = "229-DFSV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_8045[] = "229-DFSV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_8055[] = "PBE/Aztech 235W-DFSV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_8056[] = "235-DFSV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_805a[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_805f[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2005_104d_8074[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_127a_2013[] = "HSF 56k Data/Fax Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2013_1179_0001[] = "Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2013_1179_ff00[] = "Modem";
-#endif
-static const char pci_device_127a_2014[] = "HSF 56k Data/Fax/Voice Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2014_10cf_1057[] = "Fujitsu Citicorp III";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2014_122d_4050[] = "MSP3880-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2014_122d_4055[] = "MSP3880-W";
-#endif
-static const char pci_device_127a_2015[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2015_10cf_1063[] = "Fujitsu";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2015_10cf_1064[] = "Fujitsu";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2015_1468_2015[] = "Fujitsu";
-#endif
-static const char pci_device_127a_2016[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2016_122d_4051[] = "MSP3880V-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2016_122d_4052[] = "MSP3880SP-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2016_122d_4054[] = "MSP3880V-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2016_122d_4056[] = "MSP3880SP-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_2016_122d_4057[] = "MSP3880SP-A";
-#endif
-static const char pci_device_127a_4311[] = "Riptide HSF 56k PCI Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4311_127a_4311[] = "Ring Modular? Riptide HSF RT HP Dom";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4311_13e0_0210[] = "HP-GVC";
-#endif
-static const char pci_device_127a_4320[] = "Riptide PCI Audio Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4320_1235_4320[] = "Riptide PCI Audio Controller";
-#endif
-static const char pci_device_127a_4321[] = "Riptide HCF 56k PCI Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4321_1235_4321[] = "Hewlett Packard DF";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4321_1235_4324[] = "Hewlett Packard DF";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4321_13e0_0210[] = "Hewlett Packard DF";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4321_144d_2321[] = "Riptide";
-#endif
-static const char pci_device_127a_4322[] = "Riptide PCI Game Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_4322_1235_4322[] = "Riptide PCI Game Controller";
-#endif
-static const char pci_device_127a_8234[] = "RapidFire 616X ATM155 Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_8234_108d_0022[] = "RapidFire 616X ATM155 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_127a_8234_108d_0027[] = "RapidFire 616X ATM155 Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127b[] = "Pixera Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127c[] = "Crosspoint Solutions, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127d[] = "Vela Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127e[] = "Winnov, L.P.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_127f[] = "Fujifilm";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1280[] = "Photoscript Group Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1281[] = "Yokogawa Electric Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1282[] = "Davicom Semiconductor, Inc.";
-static const char pci_device_1282_9009[] = "Ethernet 100/10 MBit";
-static const char pci_device_1282_9100[] = "Ethernet 100/10 MBit";
-static const char pci_device_1282_9102[] = "Ethernet 100/10 MBit";
-static const char pci_device_1282_9132[] = "Ethernet 100/10 MBit";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1283[] = "Integrated Technology Express, Inc.";
-static const char pci_device_1283_673a[] = "IT8330G";
-static const char pci_device_1283_8330[] = "IT8330G";
-static const char pci_device_1283_8888[] = "IT8888F PCI to ISA Bridge with SMB";
-static const char pci_device_1283_8889[] = "IT8889F PCI to ISA Bridge";
-static const char pci_device_1283_e886[] = "IT8330G";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1284[] = "Sahara Networks, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1285[] = "Platform Technologies, Inc.";
-static const char pci_device_1285_0100[] = "AGOGO sound chip (aka ESS Maestro 1)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1286[] = "Mazet GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1287[] = "M-Pact, Inc.";
-static const char pci_device_1287_001e[] = "LS220D DVD Decoder";
-static const char pci_device_1287_001f[] = "LS220C DVD Decoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1288[] = "Timestep Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1289[] = "AVC Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128a[] = "Asante Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128b[] = "Transwitch Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128c[] = "Retix Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128d[] = "G2 Networks, Inc.";
-static const char pci_device_128d_0021[] = "ATM155 Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128e[] = "Hoontech Corporation/Samho Multi Tech Ltd.";
-static const char pci_device_128e_0008[] = "ST128 WSS/SB";
-static const char pci_device_128e_0009[] = "ST128 SAM9407";
-static const char pci_device_128e_000a[] = "ST128 Game Port";
-static const char pci_device_128e_000b[] = "ST128 MPU Port";
-static const char pci_device_128e_000c[] = "ST128 Ctrl Port";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_128f[] = "Tateno Dennou, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1290[] = "Sord Computer Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1291[] = "NCS Computer Italia";
-#endif
-static const char pci_vendor_1292[] = "Tritech Microelectronics Inc";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1293[] = "Media Reality Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1294[] = "Rhetorex, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1295[] = "Imagenation Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1296[] = "Kofax Image Products";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1297[] = "Holco Enterprise Co, Ltd/Shuttle Computer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1298[] = "Spellcaster Telecommunications Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1299[] = "Knowledge Technology Lab.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129a[] = "VMetro, inc.";
-static const char pci_device_129a_0615[] = "PBT-615 PCI-X Bus Analyzer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129b[] = "Image Access";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129c[] = "Jaycor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129d[] = "Compcore Multimedia, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129e[] = "Victor Company of Japan, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_129f[] = "OEC Medical Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a0[] = "Allen-Bradley Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a1[] = "Simpact Associates, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a2[] = "Newgen Systems Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a3[] = "Lucent Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a4[] = "NTT Electronics Technology Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a5[] = "Vision Dynamics Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a6[] = "Scalable Networks, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a7[] = "AMO GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a8[] = "News Datacom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12a9[] = "Xiotech Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12aa[] = "SDL Communications, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ab[] = "Yuan Yuan Enterprise Co., Ltd.";
-static const char pci_device_12ab_3000[] = "MPG-200C PCI DVD Decoder Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ac[] = "Measurex Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ad[] = "Multidata GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ae[] = "Alteon Networks Inc.";
-static const char pci_device_12ae_0001[] = "AceNIC Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12ae_0001_12ae_0001[] = "Gigabit Ethernet-SX (Universal)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12ae_0001_1410_0104[] = "Gigabit Ethernet-SX PCI Adapter";
-#endif
-static const char pci_device_12ae_0002[] = "AceNIC Gigabit Ethernet (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12ae_0002_10a9_8002[] = "Acenic Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12ae_0002_12ae_0002[] = "Gigabit Ethernet-T (3C986-T)";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12af[] = "TDK USA Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b0[] = "Jorge Scientific Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b1[] = "GammaLink";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b2[] = "General Signal Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b3[] = "Inter-Face Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b4[] = "FutureTel Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b5[] = "Granite Systems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b6[] = "Natural Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b7[] = "Cognex Modular Vision Systems Div. - Acumen Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b8[] = "Korg";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12b9[] = "US Robotics/3Com";
-static const char pci_device_12b9_1006[] = "WinModem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_005c[] = "USR 56k Internal Voice WinModem (Model 3472)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_005e[] = "USR 56k Internal WinModem (Models 662975)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_0062[] = "USR 56k Internal Voice WinModem (Model 662978)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_0068[] = "USR 56k Internal Voice WinModem (Model 5690)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_007a[] = "USR 56k Internal Voice WinModem (Model 662974)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_007f[] = "USR 56k Internal WinModem (Models 5698, 5699)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_0080[] = "USR 56k Internal WinModem (Models 2975, 3528)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_0081[] = "USR 56k Internal Voice WinModem (Models 2974, 3529)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1006_12b9_0091[] = "USR 56k Internal Voice WinModem (Model 2978)";
-#endif
-static const char pci_device_12b9_1007[] = "USR 56k Internal WinModem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1007_12b9_00a3[] = "USR 56k Internal WinModem (Model 3595)";
-#endif
-static const char pci_device_12b9_1008[] = "56K FaxModem Model 5610";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1008_12b9_00a2[] = "USR 56k Internal FAX Modem (Model 2977)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1008_12b9_00aa[] = "USR 56k Internal Voice Modem (Model 2976)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1008_12b9_00ab[] = "USR 56k Internal Voice Modem (Model 5609)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1008_12b9_00ac[] = "USR 56k Internal Voice Modem (Model 3298)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12b9_1008_12b9_00ad[] = "USR 56k Internal FAX Modem (Model 5610)";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ba[] = "BittWare, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12bb[] = "Nippon Unisoft Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12bc[] = "Array Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12bd[] = "Computerm Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12be[] = "Anchor Chips Inc.";
-static const char pci_device_12be_3041[] = "AN3041Q CO-MEM";
-static const char pci_device_12be_3042[] = "AN3042Q CO-MEM Lite";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12be_3042_12be_3042[] = "Anchor Chips Lite Evaluation Board";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12bf[] = "Fujifilm Microdevices";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c0[] = "Infimed";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c1[] = "GMM Research Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c2[] = "Mentec Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c3[] = "Holtek Microelectronics Inc";
-static const char pci_device_12c3_0058[] = "PCI NE2K Ethernet";
-static const char pci_device_12c3_5598[] = "PCI NE2K Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c4[] = "Connect Tech Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c5[] = "Picture Elements Incorporated";
-static const char pci_device_12c5_007e[] = "Imaging/Scanning Subsystem Engine";
-static const char pci_device_12c5_007f[] = "Imaging/Scanning Subsystem Engine";
-static const char pci_device_12c5_0081[] = "PCIVST [Grayscale Thresholding Engine]";
-static const char pci_device_12c5_0085[] = "Video Simulator/Sender";
-static const char pci_device_12c5_0086[] = "THR2 Multi-scale Thresholder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c6[] = "Mitani Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c7[] = "Dialogic Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c8[] = "G Force Co, Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12c9[] = "Gigi Operations";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ca[] = "Integrated Computing Engines";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12cb[] = "Antex Electronics Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12cc[] = "Pluto Technologies International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12cd[] = "Aims Lab";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ce[] = "Netspeed Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12cf[] = "Prophet Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d0[] = "GDE Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d1[] = "PSITech";
-#endif
-static const char pci_vendor_12d2[] = "NVidia / SGS Thomson (Joint Venture)";
-static const char pci_device_12d2_0008[] = "NV1";
-static const char pci_device_12d2_0009[] = "DAC64";
-static const char pci_device_12d2_0018[] = "Riva128";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_1048_0c10[] = "VICTORY Erazor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_107b_8030[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_1092_0350[] = "Viper V330";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_1092_1092[] = "Viper V330";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b1b[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b1d[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b1e[] = "STB Velocity 128, PAL TV-Out";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b20[] = "STB Velocity 128 Sapphire";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b21[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b22[] = "STB Velocity 128 AGP, NTSC TV-Out";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b23[] = "STB Velocity 128 AGP, PAL TV-Out";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b27[] = "STB Velocity 128 DVD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_1b88[] = "MVP Pro 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_222a[] = "STB Velocity 128 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_2230[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_2232[] = "STB Velocity 128";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_10b4_2235[] = "STB Velocity 128 AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12d2_0018_2a15_54a3[] = "3DVision-SAGP / 3DexPlorer 3000";
-#endif
-static const char pci_device_12d2_0019[] = "Riva128ZX";
-static const char pci_device_12d2_0020[] = "TNT";
-static const char pci_device_12d2_0028[] = "TNT2";
-static const char pci_device_12d2_0029[] = "UTNT2";
-static const char pci_device_12d2_002c[] = "VTNT2";
-static const char pci_device_12d2_00a0[] = "ITNT2";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d3[] = "Vingmed Sound A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d4[] = "Ulticom (Formerly DGM&S)";
-static const char pci_device_12d4_0200[] = "T1 Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d5[] = "Equator Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d6[] = "Analogic Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d7[] = "Biotronic SRL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d8[] = "Pericom Semiconductor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12d9[] = "Aculab PLC";
-static const char pci_device_12d9_0002[] = "PCI Prosody";
-static const char pci_device_12d9_0004[] = "cPCI Prosody";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12da[] = "True Time Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12db[] = "Annapolis Micro Systems, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12dc[] = "Symicron Computer Communication Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12dd[] = "Management Graphics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12de[] = "Rainbow Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12df[] = "SBS Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e0[] = "Chase Research";
-static const char pci_device_12e0_0010[] = "ST16C654 Quad UART";
-static const char pci_device_12e0_0020[] = "ST16C654 Quad UART";
-static const char pci_device_12e0_0030[] = "ST16C654 Quad UART";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e1[] = "Nintendo Co, Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e2[] = "Datum Inc. Bancomm-Timing Division";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e3[] = "Imation Corp - Medical Imaging Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e4[] = "Brooktrout Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e5[] = "Apex Semiconductor Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e6[] = "Cirel Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e7[] = "Sunsgroup Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e8[] = "Crisc Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12e9[] = "GE Spacenet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ea[] = "Zuken";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12eb[] = "Aureal Semiconductor";
-static const char pci_device_12eb_0001[] = "Vortex 1";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_104d_8036[] = "AU8820 Vortex Digital Audio Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_1092_2000[] = "Sonic Impact A3D";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_1092_2100[] = "Sonic Impact A3D";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_1092_2110[] = "Sonic Impact A3D";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_1092_2200[] = "Sonic Impact A3D";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_122d_1002[] = "AU8820 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_12eb_0001[] = "AU8820 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0001_5053_3355[] = "Montego";
-#endif
-static const char pci_device_12eb_0002[] = "Vortex 2";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_104d_8049[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_104d_807b[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_1092_3000[] = "Monster Sound II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_1092_3001[] = "Monster Sound II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_1092_3002[] = "Monster Sound II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_1092_3003[] = "Monster Sound II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_1092_3004[] = "Monster Sound II";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_12eb_0001[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_12eb_0002[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_12eb_0088[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_144d_3510[] = "AU8830 Vortex 3D Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0002_5053_3356[] = "Montego II";
-#endif
-static const char pci_device_12eb_0003[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_104d_8049[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_104d_8077[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_109f_1000[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_12eb_0003[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_1462_6780[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_14a4_2073[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_14a4_2091[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_14a4_2104[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_0003_14a4_2106[] = "AU8810 Vortex Digital Audio Processor";
-#endif
-static const char pci_device_12eb_8803[] = "Vortex 56k Software Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_12eb_8803_12eb_8803[] = "Vortex 56k Software Modem";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ec[] = "3A International, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ed[] = "Optivision Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ee[] = "Orange Micro";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ef[] = "Vienna Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f0[] = "Pentek";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f1[] = "Sorenson Vision Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f2[] = "Gammagraphx, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f3[] = "Radstone Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f4[] = "Megatel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f5[] = "Forks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f6[] = "Dawson France";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f7[] = "Cognex";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f8[] = "Electronic Design GmbH";
-static const char pci_device_12f8_0002[] = "VideoMaker";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12f9[] = "Four Fold Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12fb[] = "Spectrum Signal Processing";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12fc[] = "Capital Equipment Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12fd[] = "I2S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12fe[] = "ESD Electronic System Design GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_12ff[] = "Lexicon";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1300[] = "Harman International Industries Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1302[] = "Computer Sciences Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1303[] = "Innovative Integration";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1304[] = "Juniper Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1305[] = "Netphone, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1306[] = "Duet Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1307[] = "Computer Boards";
-static const char pci_device_1307_0001[] = "PCI-DAS1602/16";
-static const char pci_device_1307_000b[] = "PCI-DIO48H";
-static const char pci_device_1307_000c[] = "PCI-PDISO8";
-static const char pci_device_1307_000d[] = "PCI-PDISO16";
-static const char pci_device_1307_000f[] = "PCI-DAS1200";
-static const char pci_device_1307_0010[] = "PCI-DAS1602/12";
-static const char pci_device_1307_0014[] = "PCI-DIO24H";
-static const char pci_device_1307_0015[] = "PCI-DIO24H/CTR3";
-static const char pci_device_1307_0016[] = "PCI-DIO48H/CTR15";
-static const char pci_device_1307_0017[] = "PCI-DIO96H";
-static const char pci_device_1307_0018[] = "PCI-CTR05";
-static const char pci_device_1307_0019[] = "PCI-DAS1200/JR";
-static const char pci_device_1307_001a[] = "PCI-DAS1001";
-static const char pci_device_1307_001b[] = "PCI-DAS1002";
-static const char pci_device_1307_001c[] = "PCI-DAS1602JR/16";
-static const char pci_device_1307_001d[] = "PCI-DAS6402/16";
-static const char pci_device_1307_001e[] = "PCI-DAS6402/12";
-static const char pci_device_1307_001f[] = "PCI-DAS16/M1";
-static const char pci_device_1307_0020[] = "PCI-DDA02/12";
-static const char pci_device_1307_0021[] = "PCI-DDA04/12";
-static const char pci_device_1307_0022[] = "PCI-DDA08/12";
-static const char pci_device_1307_0023[] = "PCI-DDA02/16";
-static const char pci_device_1307_0024[] = "PCI-DDA04/16";
-static const char pci_device_1307_0025[] = "PCI-DDA08/16";
-static const char pci_device_1307_0026[] = "PCI-DAC04/12-HS";
-static const char pci_device_1307_0027[] = "PCI-DAC04/16-HS";
-static const char pci_device_1307_0028[] = "PCI-DIO24";
-static const char pci_device_1307_0029[] = "PCI-DAS08";
-static const char pci_device_1307_002c[] = "PCI-INT32";
-static const char pci_device_1307_0033[] = "PCI-DUAL-AC5";
-static const char pci_device_1307_0034[] = "PCI-DAS-TC";
-static const char pci_device_1307_0035[] = "PCI-DAS64/M1/16";
-static const char pci_device_1307_0036[] = "PCI-DAS64/M2/16";
-static const char pci_device_1307_0037[] = "PCI-DAS64/M3/16";
-static const char pci_device_1307_004c[] = "PCI-DAS1000";
-static const char pci_device_1307_004d[] = "PCI-QUAD04";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1308[] = "Jato Technologies Inc.";
-static const char pci_device_1308_0001[] = "NetCelerator Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1308_0001_1308_0001[] = "NetCelerator Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1309[] = "AB Semiconductor Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130a[] = "Mitsubishi Electric Microcomputer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130b[] = "Colorgraphic Communications Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130c[] = "Ambex Technologies, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130d[] = "Accelerix Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130e[] = "Yamatake-Honeywell Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_130f[] = "Advanet Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1310[] = "Gespac";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1311[] = "Videoserver, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1312[] = "Acuity Imaging, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1313[] = "Yaskawa Electric Co.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1316[] = "Teradyne Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1317[] = "Linksys";
-static const char pci_device_1317_0981[] = "Fast Ethernet 10/100";
-static const char pci_device_1317_0985[] = "Network Everywhere Fast Ethernet 10/100 model NC100";
-static const char pci_device_1317_1985[] = "Fast Ethernet 10/100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1318[] = "Packet Engines Inc.";
-static const char pci_device_1318_0911[] = "PCI Ethernet Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1319[] = "Fortemedia, Inc";
-static const char pci_device_1319_0801[] = "Xwave QS3000A [FM801]";
-static const char pci_device_1319_0802[] = "Xwave QS3000A [FM801 game port]";
-static const char pci_device_1319_1000[] = "FM801 PCI Audio";
-static const char pci_device_1319_1001[] = "FM801 PCI Joystick";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_131a[] = "Finisar Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_131c[] = "Nippon Electro-Sensory Devices Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_131d[] = "Sysmic, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_131e[] = "Xinex Networks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_131f[] = "Siig Inc";
-static const char pci_device_131f_1000[] = "CyberSerial (1-port) 16550";
-static const char pci_device_131f_1001[] = "CyberSerial (1-port) 16650";
-static const char pci_device_131f_1002[] = "CyberSerial (1-port) 16850";
-static const char pci_device_131f_1010[] = "Duet 1S(16550)+1P";
-static const char pci_device_131f_1011[] = "Duet 1S(16650)+1P";
-static const char pci_device_131f_1012[] = "Duet 1S(16850)+1P";
-static const char pci_device_131f_1020[] = "CyberParallel (1-port)";
-static const char pci_device_131f_1021[] = "CyberParallel (2-port)";
-static const char pci_device_131f_1030[] = "CyberSerial (2-port) 16550";
-static const char pci_device_131f_1031[] = "CyberSerial (2-port) 16650";
-static const char pci_device_131f_1032[] = "CyberSerial (2-port) 16850";
-static const char pci_device_131f_1034[] = "Trio 2S(16550)+1P";
-static const char pci_device_131f_1035[] = "Trio 2S(16650)+1P";
-static const char pci_device_131f_1036[] = "Trio 2S(16850)+1P";
-static const char pci_device_131f_1050[] = "CyberSerial (4-port) 16550";
-static const char pci_device_131f_1051[] = "CyberSerial (4-port) 16650";
-static const char pci_device_131f_1052[] = "CyberSerial (4-port) 16850";
-static const char pci_device_131f_2000[] = "CyberSerial (1-port) 16550";
-static const char pci_device_131f_2001[] = "CyberSerial (1-port) 16650";
-static const char pci_device_131f_2002[] = "CyberSerial (1-port) 16850";
-static const char pci_device_131f_2010[] = "Duet 1S(16550)+1P";
-static const char pci_device_131f_2011[] = "Duet 1S(16650)+1P";
-static const char pci_device_131f_2012[] = "Duet 1S(16850)+1P";
-static const char pci_device_131f_2020[] = "CyberParallel (1-port)";
-static const char pci_device_131f_2021[] = "CyberParallel (2-port)";
-static const char pci_device_131f_2030[] = "CyberSerial (2-port) 16550";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_131f_2030_131f_2030[] = "PCI Serial Card";
-#endif
-static const char pci_device_131f_2031[] = "CyberSerial (2-port) 16650";
-static const char pci_device_131f_2032[] = "CyberSerial (2-port) 16850";
-static const char pci_device_131f_2040[] = "Trio 1S(16550)+2P";
-static const char pci_device_131f_2041[] = "Trio 1S(16650)+2P";
-static const char pci_device_131f_2042[] = "Trio 1S(16850)+2P";
-static const char pci_device_131f_2050[] = "CyberSerial (4-port) 16550";
-static const char pci_device_131f_2051[] = "CyberSerial (4-port) 16650";
-static const char pci_device_131f_2052[] = "CyberSerial (4-port) 16850";
-static const char pci_device_131f_2060[] = "Trio 2S(16550)+1P";
-static const char pci_device_131f_2061[] = "Trio 2S(16650)+1P";
-static const char pci_device_131f_2062[] = "Trio 2S(16850)+1P";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1320[] = "Crypto AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1321[] = "Arcobel Graphics BV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1322[] = "MTT Co., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1323[] = "Dome Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1324[] = "Sphere Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1325[] = "Salix Technologies, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1326[] = "Seachange international";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1327[] = "Voss scientific";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1328[] = "quadrant international";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1329[] = "Productivity Enhancement";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_132a[] = "Microcom Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_132b[] = "Broadband Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_132c[] = "Micrel Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_132d[] = "Integrated Silicon Solution, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1330[] = "MMC Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1331[] = "Radisys Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1332[] = "Micro Memory";
-static const char pci_device_1332_5415[] = "MM-5415CN PCI Memory Module with Battery Backup";
-static const char pci_device_1332_5425[] = "MM-5425CN PCI 64/66 Memory Module with Battery Backup";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1334[] = "Redcreek Communications, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1335[] = "Videomail, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1337[] = "Third Planet Publishing";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1338[] = "BT Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133a[] = "Vtel Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133b[] = "Softcom Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133c[] = "Holontech Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133d[] = "SS Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133e[] = "Virtual Computer Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_133f[] = "SCM Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1340[] = "Atalla Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1341[] = "Kyoto Microcomputer Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1342[] = "Promax Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1343[] = "Phylon Communications Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1344[] = "Crucial Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1345[] = "Arescom Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1347[] = "Odetics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1349[] = "Sumitomo Electric Industries, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134a[] = "DTC Technology Corp.";
-static const char pci_device_134a_0001[] = "Domex 536";
-static const char pci_device_134a_0002[] = "Domex DMX3194UP SCSI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134b[] = "ARK Research Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134c[] = "Chori Joho System Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134d[] = "PCTel Inc";
-static const char pci_device_134d_7890[] = "HSP MicroModem 56";
-static const char pci_device_134d_7891[] = "HSP MicroModem 56";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_134d_7891_134d_0001[] = "HSP MicroModem 56";
-#endif
-static const char pci_device_134d_7892[] = "HSP MicroModem 56";
-static const char pci_device_134d_7893[] = "HSP MicroModem 56";
-static const char pci_device_134d_7894[] = "HSP MicroModem 56";
-static const char pci_device_134d_7895[] = "HSP MicroModem 56";
-static const char pci_device_134d_7896[] = "HSP MicroModem 56";
-static const char pci_device_134d_7897[] = "HSP MicroModem 56";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134e[] = "CSTI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_134f[] = "Algo System Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1350[] = "Systec Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1351[] = "Sonix Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1353[] = "Thales Idatys";
-static const char pci_device_1353_0002[] = "Proserver";
-static const char pci_device_1353_0003[] = "PCI-FUT";
-static const char pci_device_1353_0004[] = "PCI-S0";
-static const char pci_device_1353_0005[] = "PCI-FUT-S0";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1354[] = "Dwave System Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1355[] = "Kratos Analytical Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1356[] = "The Logical Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1359[] = "Prisa Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135a[] = "Brain Boxes";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135b[] = "Giganet Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135c[] = "Quatech Inc";
-static const char pci_device_135c_0010[] = "QSC-100";
-static const char pci_device_135c_0020[] = "DSC-100";
-static const char pci_device_135c_0030[] = "DSC-200/300";
-static const char pci_device_135c_0040[] = "QSC-200/300";
-static const char pci_device_135c_0050[] = "ESC-100D";
-static const char pci_device_135c_0060[] = "ESC-100M";
-static const char pci_device_135c_00f0[] = "MPAC-100 Syncronous Serial Card (Zilog 85230)";
-static const char pci_device_135c_0170[] = "QSCLP-100";
-static const char pci_device_135c_0180[] = "DSCLP-100";
-static const char pci_device_135c_0190[] = "SSCLP-100";
-static const char pci_device_135c_01a0[] = "QSCLP-200/300";
-static const char pci_device_135c_01b0[] = "DSCLP-200/300";
-static const char pci_device_135c_01c0[] = "SSCLP-200/300";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135d[] = "ABB Network Partner AB";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135e[] = "Sealevel Systems Inc";
-static const char pci_device_135e_7101[] = "Single Port RS-232/422/485/530";
-static const char pci_device_135e_7201[] = "Dual Port RS-232/422/485 Interface";
-static const char pci_device_135e_7202[] = "Dual Port RS-232 Interface";
-static const char pci_device_135e_7401[] = "Four Port RS-232 Interface";
-static const char pci_device_135e_7402[] = "Four Port RS-422/485 Interface";
-static const char pci_device_135e_7801[] = "Eight Port RS-232 Interface";
-static const char pci_device_135e_8001[] = "8001 Digital I/O Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_135f[] = "I-Data International A-S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1360[] = "Meinberg Funkuhren";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1361[] = "Soliton Systems K.K.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1362[] = "Fujifacom Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1363[] = "Phoenix Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1364[] = "ATM Communications Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1365[] = "Hypercope GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1366[] = "Teijin Seiki Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1367[] = "Hitachi Zosen Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1368[] = "Skyware Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1369[] = "Digigram";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_136a[] = "High Soft Tech";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_136b[] = "Kawasaki Steel Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_136c[] = "Adtek System Science Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_136d[] = "Gigalabs Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_136f[] = "Applied Magic Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1370[] = "ATL Products";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1371[] = "CNet Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1373[] = "Silicon Vision Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1374[] = "Silicom Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1375[] = "Argosystems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1376[] = "LMC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1377[] = "Electronic Equipment Production & Distribution GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1378[] = "Telemann Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1379[] = "Asahi Kasei Microsystems Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137a[] = "Mark of the Unicorn Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137b[] = "PPT Vision";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137c[] = "Iwatsu Electric Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137d[] = "Dynachip Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137e[] = "Patriot Scientific Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_137f[] = "Japan Satellite Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1380[] = "Sanritz Automation Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1381[] = "Brains Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1382[] = "Marian - Electronic & Software";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1383[] = "Controlnet Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1384[] = "Reality Simulation Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1385[] = "Netgear";
-static const char pci_device_1385_4100[] = "802.11b Wireless Adapter (MA301)";
-static const char pci_device_1385_4105[] = "MA311 802.11b wireless adapter";
-static const char pci_device_1385_620a[] = "GA620";
-static const char pci_device_1385_622a[] = "GA622";
-static const char pci_device_1385_630a[] = "GA630";
-static const char pci_device_1385_f311[] = "FA311";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1386[] = "Video Domain Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1387[] = "Systran Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1388[] = "Hitachi Information Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1389[] = "Applicom International";
-static const char pci_device_1389_0001[] = "PCI1500PFB [Intelligent fieldbus adaptor]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138a[] = "Fusion Micromedia Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138b[] = "Tokimec Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138c[] = "Silicon Reality";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138d[] = "Future Techno Designs pte Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138e[] = "Basler GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_138f[] = "Patapsco Designs Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1390[] = "Concept Development Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1391[] = "Development Concepts Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1392[] = "Medialight Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1393[] = "Moxa Technologies Co Ltd";
-static const char pci_device_1393_1040[] = "Smartio C104H/PCI";
-static const char pci_device_1393_1680[] = "Smartio C168H/PCI";
-static const char pci_device_1393_2040[] = "Intellio CP-204J";
-static const char pci_device_1393_2180[] = "Intellio C218 Turbo PCI";
-static const char pci_device_1393_3200[] = "Intellio C320 Turbo PCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1394[] = "Level One Communications";
-static const char pci_device_1394_0001[] = "LXT1001 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1394_0001_1394_0001[] = "NetCelerator Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1395[] = "Ambicom Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1396[] = "Cipher Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1397[] = "Cologne Chip Designs GmbH";
-static const char pci_device_1397_2bd0[] = "ISDN network controller [HFC-PCI]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1397_2bd0_1397_2bd0[] = "ISDN Board";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1397_2bd0_e4bf_1000[] = "CI1-1-Harp";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1398[] = "Clarion co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1399[] = "Rios systems Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139a[] = "Alacritech Inc";
-static const char pci_device_139a_0001[] = "Quad Port 10/100 Server Accelerator";
-static const char pci_device_139a_0003[] = "Single Port 10/100 Server Accelerator";
-static const char pci_device_139a_0005[] = "Single Port Gigabit Server Accelerator";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139b[] = "Mediasonic Multimedia Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139c[] = "Quantum 3d Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139d[] = "EPL limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139e[] = "Media4";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_139f[] = "Aethra s.r.l.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a0[] = "Crystal Group Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a1[] = "Kawasaki Heavy Industries Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a2[] = "Ositech Communications Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a3[] = "Hifn Inc.";
-static const char pci_device_13a3_0005[] = "7751 Security Processor";
-static const char pci_device_13a3_0006[] = "6500 Public Key Processor";
-static const char pci_device_13a3_0007[] = "7811 Security Processor";
-static const char pci_device_13a3_0012[] = "7951 Security Processor";
-static const char pci_device_13a3_0014[] = "78XX Security Processor";
-static const char pci_device_13a3_0016[] = "8065 Security Processor";
-static const char pci_device_13a3_0017[] = "8165 Security Processor";
-static const char pci_device_13a3_0018[] = "8154 Security Processor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a4[] = "Rascom Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a5[] = "Audio Digital Imaging Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a6[] = "Videonics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a7[] = "Teles AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a8[] = "Exar Corp.";
-static const char pci_device_13a8_0158[] = "XR17C158 Octal UART";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13a9[] = "Siemens Medical Systems, Ultrasound Group";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13aa[] = "Broadband Networks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ab[] = "Arcom Control Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ac[] = "Motion Media Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ad[] = "Nexus Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ae[] = "ALD Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13af[] = "T.Sqware";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b0[] = "Maxspeed Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b1[] = "Tamura corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b2[] = "Techno Chips Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b3[] = "Lanart Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b4[] = "Wellbean Co Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b5[] = "ARM";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b6[] = "Dlog GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b7[] = "Logic Devices Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b8[] = "Nokia Telecommunications oy";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13b9[] = "Elecom Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ba[] = "Oxford Instruments";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13bb[] = "Sanyo Technosound Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13bc[] = "Bitran Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13bd[] = "Sharp corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13be[] = "Miroku Jyoho Service Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13bf[] = "Sharewave Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c0[] = "Microgate Corporation";
-static const char pci_device_13c0_0010[] = "SyncLink WAN Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c1[] = "3ware Inc";
-static const char pci_device_13c1_1000[] = "3ware ATA-RAID";
-static const char pci_device_13c1_1001[] = "3ware 7000-series ATA-RAID";
-static const char pci_device_13c1_1002[] = "3ware ATA-RAID";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c2[] = "Technotrend Systemtechnik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c3[] = "Janz Computer AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c4[] = "Phase Metrics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c5[] = "Alphi Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c6[] = "Condor Engineering Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c7[] = "Blue Chip Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c8[] = "Apptech Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13c9[] = "Eaton Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ca[] = "Iomega Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13cb[] = "Yano Electric Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13cc[] = "Metheus Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13cd[] = "Compatible Systems Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ce[] = "Cocom A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13cf[] = "Studio Audio & Video Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d0[] = "Techsan Electronics Co Ltd";
-static const char pci_device_13d0_2103[] = "B2C2 Sky2PC PCI [SkyStar2]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d1[] = "Abocom Systems Inc";
-static const char pci_device_13d1_ab02[] = "ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter";
-static const char pci_device_13d1_ab06[] = "RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d2[] = "Shark Multimedia Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d3[] = "IMC Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d4[] = "Graphics Microsystems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d5[] = "Media 100 Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d6[] = "K.I. Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d7[] = "Toshiba Engineering Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d8[] = "Phobos corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13d9[] = "Apex PC Solutions Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13da[] = "Intresource Systems pte Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13db[] = "Janich & Klass Computertechnik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13dc[] = "Netboost Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13dd[] = "Multimedia Bundle Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13de[] = "ABB Robotics Products AB";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13df[] = "E-Tech Inc";
-static const char pci_device_13df_0001[] = "PCI56RVP Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13df_0001_13df_0001[] = "PCI56RVP Modem";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e0[] = "GVC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e1[] = "Silicom Multimedia Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e2[] = "Dynamics Research Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e3[] = "Nest Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e4[] = "Calculex Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e5[] = "Telesoft Design Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e6[] = "Argosy research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e7[] = "NAC Incorporated";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e8[] = "Chip Express Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e9[] = "Intraserver Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ea[] = "Dallas Semiconductor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13eb[] = "Hauppauge Computer Works Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ec[] = "Zydacron Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ed[] = "Raytheion E-Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ee[] = "Hayes Microcomputer Products Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ef[] = "Coppercom Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f0[] = "Sundance Technology Inc";
-static const char pci_device_13f0_0201[] = "ST201 Sundance Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f1[] = "Oce' - Technologies B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f2[] = "Ford Microelectronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f3[] = "Mcdata Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f4[] = "Troika Networks, Inc.";
-static const char pci_device_13f4_1401[] = "Zentai Fibre Channel Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f5[] = "Kansai Electric Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f6[] = "C-Media Electronics Inc";
-static const char pci_device_13f6_0100[] = "CM8338A";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0100_13f6_ffff[] = "CMI8338/C3DX PCI Audio Device";
-#endif
-static const char pci_device_13f6_0101[] = "CM8338B";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0101_13f6_0101[] = "CMI8338-031 PCI Audio Device";
-#endif
-static const char pci_device_13f6_0111[] = "CM8738";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0111_1019_0970[] = "P6STP-FL motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0111_1043_8077[] = "CMI8738 6-channel audio controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0111_1043_80e2[] = "CMI8738 6ch-MX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0111_13f6_0111[] = "CMI8738/C3DX PCI Audio Device";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_13f6_0111_1681_a000[] = "Gamesurround MUSE XL";
-#endif
-static const char pci_device_13f6_0211[] = "CM8738";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f7[] = "Wildfire Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f8[] = "Ad Lib Multimedia Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13f9[] = "NTT Advanced Technology Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13fa[] = "Pentland Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13fb[] = "Aydin Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13fc[] = "Computer Peripherals International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13fd[] = "Micro Science Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13fe[] = "Advantech Co. Ltd";
-static const char pci_device_13fe_1756[] = "PCI-1756";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13ff[] = "Silicon Spice Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1400[] = "Artx Inc";
-static const char pci_device_1400_1401[] = "9432 TX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1401[] = "CR-Systems A/S";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1402[] = "Meilhaus Electronic GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1403[] = "Ascor Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1404[] = "Fundamental Software Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1405[] = "Excalibur Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1406[] = "Oce' Printing Systems GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1407[] = "Lava Computer mfg Inc";
-static const char pci_device_1407_0100[] = "Lava Dual Serial";
-static const char pci_device_1407_0101[] = "Lava Quatro A";
-static const char pci_device_1407_0102[] = "Lava Quatro B";
-static const char pci_device_1407_0200[] = "Lava Port Plus";
-static const char pci_device_1407_0201[] = "Lava Quad A";
-static const char pci_device_1407_0202[] = "Lava Quad B";
-static const char pci_device_1407_0500[] = "Lava Single Serial";
-static const char pci_device_1407_0600[] = "Lava Port 650";
-static const char pci_device_1407_8000[] = "Lava Parallel";
-static const char pci_device_1407_8001[] = "Dual parallel port controller A";
-static const char pci_device_1407_8002[] = "Lava Dual Parallel port A";
-static const char pci_device_1407_8003[] = "Lava Dual Parallel port B";
-static const char pci_device_1407_8800[] = "BOCA Research IOPPAR";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1408[] = "Aloka Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1409[] = "Timedia Technology Co Ltd";
-static const char pci_device_1409_7168[] = "PCI2S550 (Dual 16550 UART)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140a[] = "DSP Research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140b[] = "Ramix Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140c[] = "Elmic Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140d[] = "Matsushita Electric Works Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140e[] = "Goepel Electronic GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_140f[] = "Salient Systems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1410[] = "Midas lab Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1411[] = "Ikos Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1412[] = "IC Ensemble Inc";
-static const char pci_device_1412_1712[] = "ICE1712 [Envy24]";
-static const char pci_device_1412_1724[] = "ICE1724 [Envy24HT]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1413[] = "Addonics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1414[] = "Microsoft Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1415[] = "Oxford Semiconductor Ltd";
-static const char pci_device_1415_8403[] = "VScom 011H-EP1 1 port parallel adaptor";
-static const char pci_device_1415_9501[] = "OX16PCI954 (Quad 16950 UART) function 0";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1415_9501_15ed_2000[] = "MCCR Serial p0-3 of 8";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1415_9501_15ed_2001[] = "MCCR Serial p0-3 of 16";
-#endif
-static const char pci_device_1415_950a[] = "EXSYS EX-41092 Dual 16950 Serial adapter";
-static const char pci_device_1415_950b[] = "OXCB950 Cardbus 16950 UART";
-static const char pci_device_1415_9511[] = "OX16PCI954 (Quad 16950 UART) function 1";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1415_9511_15ed_2000[] = "MCCR Serial p4-7 of 8";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1415_9511_15ed_2001[] = "MCCR Serial p4-15 of 16";
-#endif
-static const char pci_device_1415_9521[] = "OX16PCI952 (Dual 16950 UART)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1416[] = "Multiwave Innovation pte Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1417[] = "Convergenet Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1418[] = "Kyushu electronics systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1419[] = "Excel Switching Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_141a[] = "Apache Micro Peripherals Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_141b[] = "Zoom Telephonics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_141d[] = "Digitan Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_141e[] = "Fanuc Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_141f[] = "Visiontech Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1420[] = "Psion Dacom plc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1421[] = "Ads Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1422[] = "Ygrec Systems Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1423[] = "Custom Technology Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1424[] = "Videoserver Connections";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1425[] = "ASIC Designers Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1426[] = "Storage Technology Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1427[] = "Better On-Line Solutions";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1428[] = "Edec Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1429[] = "Unex Technology Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142a[] = "Kingmax Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142b[] = "Radiolan";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142c[] = "Minton Optic Industry Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142d[] = "Pix stream Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142e[] = "Vitec Multimedia";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_142f[] = "Radicom Research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1430[] = "ITT Aerospace/Communications Division";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1431[] = "Gilat Satellite Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1432[] = "Edimax Computer Co.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1433[] = "Eltec Elektronik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1435[] = "Real Time Devices US Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1436[] = "CIS Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1437[] = "Nissin Inc Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1438[] = "Atmel-dream";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1439[] = "Outsource Engineering & Mfg. Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143a[] = "Stargate Solutions Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143b[] = "Canon Research Center, America";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143c[] = "Amlogic Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143d[] = "Tamarack Microelectronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143e[] = "Jones Futurex Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_143f[] = "Lightwell Co Ltd - Zax Division";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1440[] = "ALGOL Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1441[] = "AGIE Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1442[] = "Phoenix Contact GmbH & Co.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1443[] = "Unibrain S.A.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1444[] = "TRW";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1445[] = "Logical DO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1446[] = "Graphin Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1447[] = "AIM GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1448[] = "Alesis Studio Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1449[] = "TUT Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144a[] = "Adlink Technology";
-static const char pci_device_144a_7296[] = "PCI-7296";
-static const char pci_device_144a_7432[] = "PCI-7432";
-static const char pci_device_144a_7433[] = "PCI-7433";
-static const char pci_device_144a_7434[] = "PCI-7434";
-static const char pci_device_144a_7841[] = "PCI-7841";
-static const char pci_device_144a_8133[] = "PCI-8133";
-static const char pci_device_144a_8554[] = "PCI-8554";
-static const char pci_device_144a_9111[] = "PCI-9111";
-static const char pci_device_144a_9113[] = "PCI-9113";
-static const char pci_device_144a_9114[] = "PCI-9114";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144b[] = "Loronix Information Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144c[] = "Catalina Research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144d[] = "Samsung Electronics Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144e[] = "OLITEC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_144f[] = "Askey Computer Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1450[] = "Octave Communications Ind.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1451[] = "SP3D Chip Design GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1453[] = "MYCOM Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1454[] = "Altiga Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1455[] = "Logic Plus Plus Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1456[] = "Advanced Hardware Architectures";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1457[] = "Nuera Communications Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1458[] = "Giga-byte Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1459[] = "DOOIN Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145a[] = "Escalate Networks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145b[] = "PRAIM SRL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145c[] = "Cryptek";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145d[] = "Gallant Computer Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145e[] = "Aashima Technology B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_145f[] = "Baldor Electric Company";
-static const char pci_device_145f_0001[] = "NextMove PCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1460[] = "DYNARC INC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1461[] = "Avermedia Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1462[] = "Micro-Star International Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1463[] = "Fast Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1464[] = "Interactive Circuits & Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1465[] = "GN NETTEST Telecom DIV.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1466[] = "Designpro Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1467[] = "DIGICOM SPA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1468[] = "AMBIT Microsystem Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1469[] = "Cleveland Motion Controls";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146a[] = "IFR";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146b[] = "Parascan Technologies Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146c[] = "Ruby Tech Corp.";
-static const char pci_device_146c_1430[] = "FE-1430TX Fast Ethernet PCI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146d[] = "Tachyon, INC.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146e[] = "Williams Electronics Games, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_146f[] = "Multi Dimensional Consulting Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1470[] = "Bay Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1471[] = "Integrated Telecom Express Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1472[] = "DAIKIN Industries, Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1473[] = "ZAPEX Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1474[] = "Doug Carson & Associates";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1475[] = "PICAZO Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1476[] = "MORTARA Instrument Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1477[] = "Net Insight";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1478[] = "DIATREND Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1479[] = "TORAY Industries Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147a[] = "FORMOSA Industrial Computing";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147b[] = "ABIT Computer Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147c[] = "AWARE, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147d[] = "Interworks Computer Products";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147e[] = "Matsushita Graphic Communication Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_147f[] = "NIHON UNISYS, Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1480[] = "SCII Telecom";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1481[] = "BIOPAC Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1482[] = "ISYTEC - Integrierte Systemtechnik GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1483[] = "LABWAY Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1484[] = "Logic Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1485[] = "ERMA - Electronic GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1486[] = "L3 Communications Telemetry & Instrumentation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1487[] = "MARQUETTE Medical Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1488[] = "KONTRON Electronik GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1489[] = "KYE Systems Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148a[] = "OPTO";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148b[] = "INNOMEDIALOGIC Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148c[] = "C.P. Technology Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148d[] = "DIGICOM Systems, Inc.";
-static const char pci_device_148d_1003[] = "HCF 56k Data/Fax Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148e[] = "OSI Plus Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_148f[] = "Plant Equipment, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1490[] = "Stone Microsystems PTY Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1491[] = "ZEAL Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1492[] = "Time Logic Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1493[] = "MAKER Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1494[] = "WINTOP Technology, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1495[] = "TOKAI Communications Industry Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1496[] = "JOYTECH Computer Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1497[] = "SMA Regelsysteme GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1498[] = "TEWS Datentechnik GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1499[] = "EMTEC CO., Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149a[] = "ANDOR Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149b[] = "SEIKO Instruments Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149c[] = "OVISLINK Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149d[] = "NEWTEK Inc";
-static const char pci_device_149d_0001[] = "Video Toaster for PC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149e[] = "Mapletree Networks Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_149f[] = "LECTRON Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a0[] = "SOFTING GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a1[] = "Systembase Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a2[] = "Millennium Engineering Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a3[] = "Maverick Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a4[] = "GVC/BCM Advanced Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a5[] = "XIONICS Document Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a6[] = "INOVA Computers GmBH & Co KG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a7[] = "MYTHOS Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a8[] = "FEATRON Technologies Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14a9[] = "HIVERTEC Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14aa[] = "Advanced MOS Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ab[] = "Mentor Graphics Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ac[] = "Novaweb Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ad[] = "Time Space Radio AB";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ae[] = "CTI, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14af[] = "Guillemot Corporation";
-static const char pci_device_14af_7102[] = "3D Prophet II MX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b0[] = "BST Communication Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b1[] = "Nextcom K.K.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b2[] = "ENNOVATE Networks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b3[] = "XPEED Inc";
-static const char pci_device_14b3_0000[] = "DSL NIC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b4[] = "PHILIPS Business Electronics B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b5[] = "Creamware GmBH";
-static const char pci_device_14b5_0200[] = "Scope";
-static const char pci_device_14b5_0300[] = "Pulsar";
-static const char pci_device_14b5_0400[] = "Pulsar2";
-static const char pci_device_14b5_0600[] = "Pulsar2";
-static const char pci_device_14b5_0800[] = "DSP-Board";
-static const char pci_device_14b5_0900[] = "DSP-Board";
-static const char pci_device_14b5_0a00[] = "DSP-Board";
-static const char pci_device_14b5_0b00[] = "DSP-Board";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b6[] = "Quantum Data Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b7[] = "PROXIM Inc";
-static const char pci_device_14b7_0001[] = "Symphony 4110";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b8[] = "Techsoft Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14b9[] = "AIRONET Wireless Communications";
-static const char pci_device_14b9_0001[] = "PC4800";
-static const char pci_device_14b9_0340[] = "PC4800";
-static const char pci_device_14b9_0350[] = "PC4800";
-static const char pci_device_14b9_4500[] = "PC4500";
-static const char pci_device_14b9_4800[] = "PC4800";
-static const char pci_device_14b9_a504[] = "Cisco Aironet Wireless 802.11b";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ba[] = "INTERNIX Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14bb[] = "SEMTECH Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14bc[] = "Globespan Semiconductor Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14bd[] = "CARDIO Control N.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14be[] = "L3 Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14bf[] = "SPIDER Communications Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c0[] = "COMPAL Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c1[] = "MYRICOM Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c2[] = "DTK Computer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c3[] = "MEDIATEK Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c4[] = "IWASAKI Information Systems Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c5[] = "Automation Products AB";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c6[] = "Data Race Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c7[] = "Modular Technology Holdings Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c8[] = "Turbocomm Tech. Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14c9[] = "ODIN Telesystems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ca[] = "PE Logic Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14cb[] = "Billionton Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14cc[] = "NAKAYO Telecommunications Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14cd[] = "Universal Scientific Ind.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ce[] = "Whistle Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14cf[] = "TEK Microsystems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d0[] = "Ericsson Axe R & D";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d1[] = "Computer Hi-Tech Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d2[] = "Titan Electronics Inc";
-static const char pci_device_14d2_8001[] = "VScom 010L 1 port parallel adaptor";
-static const char pci_device_14d2_8002[] = "VScom 020L 2 port parallel adaptor";
-static const char pci_device_14d2_8010[] = "VScom 100L 1 port serial adaptor";
-static const char pci_device_14d2_8011[] = "VScom 110L 1 port serial and 1 port parallel adaptor";
-static const char pci_device_14d2_8020[] = "VScom 200L 1 port serial adaptor";
-static const char pci_device_14d2_8021[] = "VScom 210L 2 port serial and 1 port parallel adaptor";
-static const char pci_device_14d2_8040[] = "VScom 400L 4 port serial adaptor";
-static const char pci_device_14d2_8080[] = "VScom 800L 8 port serial adaptor";
-static const char pci_device_14d2_a000[] = "VScom 010H 1 port parallel adaptor";
-static const char pci_device_14d2_a001[] = "VScom 100H 1 port serial adaptor";
-static const char pci_device_14d2_a003[] = "VScom 400H 4 port serial adaptor";
-static const char pci_device_14d2_a004[] = "VScom 400HF1 4 port serial adaptor";
-static const char pci_device_14d2_a005[] = "VScom 200H 2 port serial adaptor";
-static const char pci_device_14d2_e001[] = "VScom 010HV2 1 port parallel adaptor";
-static const char pci_device_14d2_e010[] = "VScom 100HV2 1 port serial adaptor";
-static const char pci_device_14d2_e020[] = "VScom 200HV2 2 port serial adaptor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d3[] = "CIRTECH (UK) Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d4[] = "Panacom Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d5[] = "Nitsuko Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d6[] = "Accusys Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d7[] = "Hirakawa Hewtech Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d8[] = "HOPF Elektronik GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14d9[] = "Alpha Processor Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14da[] = "National Aerospace Laboratories";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14db[] = "AFAVLAB Technology Inc";
-static const char pci_device_14db_2120[] = "TK9902";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14dc[] = "Amplicon Liveline Ltd";
-static const char pci_device_14dc_0000[] = "PCI230";
-static const char pci_device_14dc_0001[] = "PCI242";
-static const char pci_device_14dc_0002[] = "PCI244";
-static const char pci_device_14dc_0003[] = "PCI247";
-static const char pci_device_14dc_0004[] = "PCI248";
-static const char pci_device_14dc_0005[] = "PCI249";
-static const char pci_device_14dc_0006[] = "PCI260";
-static const char pci_device_14dc_0007[] = "PCI224";
-static const char pci_device_14dc_0008[] = "PCI234";
-static const char pci_device_14dc_0009[] = "PCI236";
-static const char pci_device_14dc_000a[] = "PCI272";
-static const char pci_device_14dc_000b[] = "PCI215";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14dd[] = "Boulder Design Labs Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14de[] = "Applied Integration Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14df[] = "ASIC Communications Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e1[] = "INVERTEX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e2[] = "INFOLIBRIA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e3[] = "AMTELCO";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e4[] = "Broadcom Corporation";
-static const char pci_device_14e4_1644[] = "NetXtreme BCM5700 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_1014_0277[] = "Broadcom Vigil B5700 1000Base-T";
-#endif
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_1028_00d1[] = "Broadcom BCM5700";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_1028_0106[] = "Broadcom BCM5700";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_1028_0109[] = "Broadcom BCM5700 1000Base-T";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_1028_010a[] = "Broadcom BCM5700 1000BaseTX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1000[] = "3C996-T 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1001[] = "3C996B-T 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1002[] = "3C996C-T 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1003[] = "3C997-T 1000Base-T Dual Port";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1004[] = "3C996-SX 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1005[] = "3C997-SX 1000Base-SX Dual Port";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_10b7_1008[] = "3C942 Gigabit LOM (31X31)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_14e4_0002[] = "NetXtreme 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_14e4_0003[] = "NetXtreme 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_14e4_0004[] = "NetXtreme 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_14e4_1028[] = "NetXtreme 1000BaseTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1644_14e4_1644[] = "BCM5700 1000Base-T";
-#endif
-static const char pci_device_14e4_1645[] = "NetXtreme BCM5701 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_007c[] = "NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_007d[] = "NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_0085[] = "NC7780 Gigabit Server Adapter (embedded, WOL)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_0099[] = "NC7780 Gigabit Server Adapter (embedded, WOL)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_009a[] = "NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_0e11_00c1[] = "NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_1028_0121[] = "Broadcom BCM5701 1000Base-T";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10a9_8011[] = "SGI Gigabit Ethernet (Copper)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10a9_8012[] = "SGI Gigabit Ethernet (Fiber)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10b7_1004[] = "3C996-SX 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10b7_1006[] = "3C996B-T 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10b7_1007[] = "3C1000-T 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_10b7_1008[] = "3C940-BR01 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_0001[] = "BCM5701 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_0005[] = "BCM5701 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_0006[] = "BCM5701 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_0007[] = "BCM5701 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_0008[] = "BCM5701 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1645_14e4_8008[] = "BCM5701 1000Base-T";
-#endif
-static const char pci_device_14e4_1646[] = "NetXtreme BCM5702 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1646_0e11_00bb[] = "NC7760 1000BaseTX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1646_1028_0126[] = "Broadcom BCM5702 1000BaseTX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1646_14e4_8009[] = "BCM5702 1000BaseTX";
-#endif
-static const char pci_device_14e4_1647[] = "NetXtreme BCM5703 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_0e11_0099[] = "NC7780 1000BaseTX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_0e11_009a[] = "NC7770 1000BaseTX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_14e4_0009[] = "BCM5703 1000BaseTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_14e4_000a[] = "BCM5703 1000BaseSX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_14e4_000b[] = "BCM5703 1000BaseTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_14e4_8009[] = "BCM5703 1000BaseTX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1647_14e4_800a[] = "BCM5703 1000BaseTX";
-#endif
-static const char pci_device_14e4_1648[] = "NetXtreme BCM5704 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_0e11_00cf[] = "NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_0e11_00d0[] = "NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_0e11_00d1[] = "NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_10b7_2000[] = "3C998-T Dual Port 10/100/1000 PCI-X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_10b7_3000[] = "3C999-T Quad Port 10/100/1000 PCI-X";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1648_1166_1648[] = "NetXtreme CIOB-E 1000Base-T";
-#endif
-static const char pci_device_14e4_164d[] = "NetXtreme BCM5702FE Gigabit Ethernet";
-static const char pci_device_14e4_1653[] = "NetXtreme BCM5705 Gigabit Ethernet";
-static const char pci_device_14e4_165d[] = "NetXtreme BCM5705M Gigabit Ethernet";
-static const char pci_device_14e4_1696[] = "NetXtreme BCM5782 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_1696_14e4_000d[] = "NetXtreme BCM5782 1000Base-T";
-#endif
-static const char pci_device_14e4_169c[] = "NetXtreme BCM5788 Gigabit Ethernet";
-static const char pci_device_14e4_16a6[] = "NetXtreme BCM5702 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a6_0e11_00bb[] = "NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a6_1028_0126[] = "BCM5702 1000Base-T";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a6_14e4_000c[] = "BCM5702 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a6_14e4_8009[] = "BCM5702 1000Base-T";
-#endif
-static const char pci_device_14e4_16a7[] = "NetXtreme BCM5703 Gigabit Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_0e11_00ca[] = "NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_0e11_00cb[] = "NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_14e4_0009[] = "NetXtreme BCM5703 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_14e4_000a[] = "NetXtreme BCM5703 1000Base-SX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_14e4_000b[] = "NetXtreme BCM5703 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a7_14e4_800a[] = "NetXtreme BCM5703 1000Base-T";
-#endif
-static const char pci_device_14e4_16a8[] = "NetXtreme BCM5704S Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16a8_10b7_2001[] = "3C998-SX Dual Port 1000-SX PCI-X";
-#endif
-static const char pci_device_14e4_16c6[] = "NetXtreme BCM5702 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16c6_10b7_1100[] = "3C1000B-T 10/100/1000 PCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16c6_14e4_000c[] = "BCM5702 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16c6_14e4_8009[] = "BCM5702 1000Base-T";
-#endif
-static const char pci_device_14e4_16c7[] = "NetXtreme BCM5703 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16c7_14e4_0009[] = "NetXtreme BCM5703 1000Base-T";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_16c7_14e4_000a[] = "NetXtreme BCM5703 1000Base-SX";
-#endif
-static const char pci_device_14e4_4210[] = "BCM4210 iLine10 HomePNA 2.0";
-static const char pci_device_14e4_4211[] = "BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem";
-static const char pci_device_14e4_4212[] = "BCM4212 v.90 56k modem";
-static const char pci_device_14e4_4301[] = "BCM4301 802.11b";
-static const char pci_device_14e4_4320[] = "BCM94306 802.11g";
-static const char pci_device_14e4_4401[] = "BCM4401 100Base-T";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14e4_4401_1043_80a8[] = "A7V8X motherboard";
-#endif
-static const char pci_device_14e4_4402[] = "BCM4402 Integrated 10/100BaseT";
-static const char pci_device_14e4_4410[] = "BCM4413 iLine32 HomePNA 2.0";
-static const char pci_device_14e4_4411[] = "BCM4413 V.90 56k modem";
-static const char pci_device_14e4_4412[] = "BCM4413 10/100BaseT";
-static const char pci_device_14e4_5820[] = "BCM5820 Crypto Accelerator";
-static const char pci_device_14e4_5821[] = "BCM5821 Crypto Accelerator";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e5[] = "Pixelfusion Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e6[] = "SHINING Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e7[] = "3CX";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e8[] = "RAYCER Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14e9[] = "GARNETS System CO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ea[] = "Planex Communications, Inc";
-static const char pci_device_14ea_ab06[] = "FNW-3603-TX CardBus Fast Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14eb[] = "SEIKO EPSON Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ec[] = "ACQIRIS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ed[] = "DATAKINETICS Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ee[] = "MASPRO KENKOH Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ef[] = "CARRY Computer ENG. CO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f0[] = "CANON RESEACH CENTRE FRANCE";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f1[] = "Conexant";
-static const char pci_device_14f1_1002[] = "HCF 56k Modem";
-static const char pci_device_14f1_1003[] = "HCF 56k Modem";
-static const char pci_device_14f1_1004[] = "HCF 56k Modem";
-static const char pci_device_14f1_1005[] = "HCF 56k Modem";
-static const char pci_device_14f1_1006[] = "HCF 56k Modem";
-static const char pci_device_14f1_1022[] = "HCF 56k Modem";
-static const char pci_device_14f1_1023[] = "HCF 56k Modem";
-static const char pci_device_14f1_1024[] = "HCF 56k Modem";
-static const char pci_device_14f1_1025[] = "HCF 56k Modem";
-static const char pci_device_14f1_1026[] = "HCF 56k Modem";
-static const char pci_device_14f1_1032[] = "HCF 56k Modem";
-static const char pci_device_14f1_1033[] = "HCF 56k Data/Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_1033_8077[] = "NEC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_122d_4027[] = "Dell Zeus - MDP3880-W(B) Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_122d_4030[] = "Dell Mercury - MDP3880-U(B) Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_122d_4034[] = "Dell Thor - MDP3880-W(U) Data Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_020d[] = "Dell Copper";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_020e[] = "Dell Silver";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_0261[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_0290[] = "Compaq Goldwing";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_02a0[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_02b0[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_02c0[] = "Compaq Scooter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_13e0_02d0[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_144f_1500[] = "IBM P85-DF (1)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_144f_1501[] = "IBM P85-DF (2)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_144f_150a[] = "IBM P85-DF (3)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_144f_150b[] = "IBM P85-DF Low Profile (1)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1033_144f_1510[] = "IBM P85-DF Low Profile (2)";
-#endif
-static const char pci_device_14f1_1034[] = "HCF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_1035[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1035_10cf_1098[] = "Fujitsu P85-DFSV";
-#endif
-static const char pci_device_14f1_1036[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_104d_8067[] = "HCF 56k Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_122d_4029[] = "MDP3880SP-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_122d_4031[] = "MDP3880SP-U";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_13e0_0209[] = "Dell Titanium";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_13e0_020a[] = "Dell Graphite";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_13e0_0260[] = "Gateway Red Owl";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1036_13e0_0270[] = "Gateway White Horse";
-#endif
-static const char pci_device_14f1_1052[] = "HCF 56k Data/Fax Modem (Worldwide)";
-static const char pci_device_14f1_1053[] = "HCF 56k Data/Fax Modem (Worldwide)";
-static const char pci_device_14f1_1054[] = "HCF 56k Data/Fax/Voice Modem (Worldwide)";
-static const char pci_device_14f1_1055[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide)";
-static const char pci_device_14f1_1056[] = "HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)";
-static const char pci_device_14f1_1057[] = "HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)";
-static const char pci_device_14f1_1059[] = "HCF 56k Data/Fax/Voice Modem (Worldwide)";
-static const char pci_device_14f1_1063[] = "HCF 56k Data/Fax Modem";
-static const char pci_device_14f1_1064[] = "HCF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_1065[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-static const char pci_device_14f1_1066[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1066_122d_4033[] = "Dell Athena - MDP3900V-U";
-#endif
-static const char pci_device_14f1_1433[] = "HCF 56k Data/Fax Modem";
-static const char pci_device_14f1_1434[] = "HCF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_1435[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-static const char pci_device_14f1_1436[] = "HCF 56k Data/Fax Modem";
-static const char pci_device_14f1_1453[] = "HCF 56k Data/Fax Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1453_13e0_0240[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1453_13e0_0250[] = "IBM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1453_144f_1502[] = "IBM P95-DF (1)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1453_144f_1503[] = "IBM P95-DF (2)";
-#endif
-static const char pci_device_14f1_1454[] = "HCF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_1455[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-static const char pci_device_14f1_1456[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1456_122d_4035[] = "Dell Europa - MDP3900V-W";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1456_122d_4302[] = "Dell MP3930V-W(C) MiniPCI";
-#endif
-static const char pci_device_14f1_1610[] = "ADSL AccessRunner PCI Arbitration Device";
-static const char pci_device_14f1_1611[] = "AccessRunner PCI ADSL Interface Device";
-static const char pci_device_14f1_1620[] = "ADSL AccessRunner V2 PCI Arbitration Device";
-static const char pci_device_14f1_1621[] = "AccessRunner V2 PCI ADSL Interface Device";
-static const char pci_device_14f1_1622[] = "AccessRunner V2 PCI ADSL Yukon WAN Adapter";
-static const char pci_device_14f1_1803[] = "HCF 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1803_0e11_0023[] = "623-LAN Grizzly";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1803_0e11_0043[] = "623-LAN Yogi";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_14f1_1815[] = "HCF 56k Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1815_0e11_0022[] = "Grizzly";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_1815_0e11_0042[] = "Yogi";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_14f1_2003[] = "HSF 56k Data/Fax Modem";
-static const char pci_device_14f1_2004[] = "HSF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_2005[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-static const char pci_device_14f1_2006[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
-static const char pci_device_14f1_2013[] = "HSF 56k Data/Fax Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_0e11_b195[] = "Bear";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_0e11_b196[] = "Seminole 1";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_0e11_b1be[] = "Seminole 2";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_1025_8013[] = "Acer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_1033_809d[] = "NEC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_1033_80bc[] = "NEC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_155d_6793[] = "HP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2013_155d_8850[] = "E Machines";
-#endif
-static const char pci_device_14f1_2014[] = "HSF 56k Data/Fax/Voice Modem";
-static const char pci_device_14f1_2015[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
-static const char pci_device_14f1_2016[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
-static const char pci_device_14f1_2043[] = "HSF 56k Data/Fax Modem (WorldW SmartDAA)";
-static const char pci_device_14f1_2044[] = "HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)";
-static const char pci_device_14f1_2045[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)";
-static const char pci_device_14f1_2046[] = "HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)";
-static const char pci_device_14f1_2063[] = "HSF 56k Data/Fax Modem (SmartDAA)";
-static const char pci_device_14f1_2064[] = "HSF 56k Data/Fax/Voice Modem (SmartDAA)";
-static const char pci_device_14f1_2065[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)";
-static const char pci_device_14f1_2066[] = "HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)";
-static const char pci_device_14f1_2093[] = "HSF 56k Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2093_155d_2f07[] = "Legend";
-#endif
-static const char pci_device_14f1_2143[] = "HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2144[] = "HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2145[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2146[] = "HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2163[] = "HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2164[] = "HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2165[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2166[] = "HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2343[] = "HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2344[] = "HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2345[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2346[] = "HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2363[] = "HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2364[] = "HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2365[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2366[] = "HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2443[] = "HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2443_104d_8075[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2443_104d_8083[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2443_104d_8097[] = "Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_14f1_2444[] = "HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2445[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2446[] = "HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)";
-static const char pci_device_14f1_2463[] = "HSF 56k Data/Fax Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2464[] = "HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2465[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2466[] = "HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)";
-static const char pci_device_14f1_2f00[] = "HSF 56k HSFi Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2f00_13e0_8d84[] = "IBM HSFi V.90";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2f00_13e0_8d85[] = "Compaq Stinger";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_14f1_2f00_14f1_2004[] = "Dynalink 56PMi";
-#endif
-static const char pci_device_14f1_8234[] = "RS8234 ATM SAR Controller [ServiceSAR Plus]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f2[] = "MOBILITY Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f3[] = "BROADLOGIC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f4[] = "TOKYO Electronic Industry CO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f5[] = "SOPAC Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f6[] = "COYOTE Technologies LLC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f7[] = "WOLF Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f8[] = "AUDIOCODES Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14f9[] = "AG COMMUNICATIONS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14fa[] = "WANDEL & GOCHERMANN";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14fb[] = "TRANSAS MARINE (UK) Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14fc[] = "QUADRICS Supercomputers World";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14fd[] = "JAPAN Computer Industry Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14fe[] = "ARCHTEK TELECOM Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_14ff[] = "TWINHEAD INTERNATIONAL Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1500[] = "DELTA Electronics, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1501[] = "BANKSOFT CANADA Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1502[] = "MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1503[] = "KAWASAKI LSI USA Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1504[] = "KAISER Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1505[] = "ITA INGENIEURBURO FUR TESTAUFGABEN GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1506[] = "CHAMELEON Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1507[] = "Motorola ? / HTEC";
-static const char pci_device_1507_0001[] = "MPC105 [Eagle]";
-static const char pci_device_1507_0002[] = "MPC106 [Grackle]";
-static const char pci_device_1507_0003[] = "MPC8240 [Kahlua]";
-static const char pci_device_1507_0100[] = "MC145575 [HFC-PCI]";
-static const char pci_device_1507_0431[] = "KTI829c 100VG";
-static const char pci_device_1507_4801[] = "Raven";
-static const char pci_device_1507_4802[] = "Falcon";
-static const char pci_device_1507_4803[] = "Hawk";
-static const char pci_device_1507_4806[] = "CPX8216";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1508[] = "HONDA CONNECTORS/MHOTRONICS Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1509[] = "FIRST INTERNATIONAL Computer Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150a[] = "FORVUS RESEARCH Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150b[] = "YAMASHITA Systems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150c[] = "KYOPAL CO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150d[] = "WARPSPPED Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150e[] = "C-PORT Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_150f[] = "INTEC GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1510[] = "BEHAVIOR TECH Computer Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1511[] = "CENTILLIUM Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1512[] = "ROSUN Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1513[] = "Raychem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1514[] = "TFL LAN Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1515[] = "Advent design";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1516[] = "MYSON Technology Inc";
-static const char pci_device_1516_0803[] = "SURECOM EP-320X-S 100/10M Ethernet PCI Adapter";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1516_0803_1320_10bd[] = "SURECOM EP-320X-S 100/10M Ethernet PCI Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1517[] = "ECHOTEK Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1518[] = "PEP MODULAR Computers GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1519[] = "TELEFON AKTIEBOLAGET LM Ericsson";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151a[] = "Globetek";
-static const char pci_device_151a_1002[] = "PCI-1002";
-static const char pci_device_151a_1004[] = "PCI-1004";
-static const char pci_device_151a_1008[] = "PCI-1008";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151b[] = "COMBOX Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151c[] = "DIGITAL AUDIO LABS Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151d[] = "Fujitsu Computer Products Of America";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151e[] = "MATRIX Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_151f[] = "TOPIC SEMICONDUCTOR Corp";
-static const char pci_device_151f_0000[] = "TP560 Data/Fax/Voice 56k modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1520[] = "CHAPLET System Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1521[] = "BELL Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1522[] = "MainPine Ltd";
-static const char pci_device_1522_0100[] = "PCI <-> IOBus Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0200[] = "RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0300[] = "RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0400[] = "RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0500[] = "RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0600[] = "RockForce+ 2 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0700[] = "RockForce+ 4 Port V.90 Data/Fax/Voice Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1522_0100_1522_0800[] = "RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1523[] = "MUSIC Semiconductors";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1524[] = "ENE Technology Inc";
-static const char pci_device_1524_1211[] = "CB1211 Cardbus Controller";
-static const char pci_device_1524_1225[] = "CB1225 Cardbus Controller";
-static const char pci_device_1524_1410[] = "CB1410 Cardbus Controller";
-static const char pci_device_1524_1420[] = "CB1420 Cardbus Controller";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1525[] = "IMPACT Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1526[] = "ISS, Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1527[] = "SOLECTRON";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1528[] = "ACKSYS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1529[] = "AMERICAN MICROSystems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152a[] = "QUICKTURN DESIGN Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152b[] = "FLYTECH Technology CO Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152c[] = "MACRAIGOR Systems LLC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152d[] = "QUANTA Computer Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152e[] = "MELEC Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_152f[] = "PHILIPS - CRYPTO";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1530[] = "ACQIS Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1531[] = "CHRYON Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1532[] = "ECHELON Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1533[] = "BALTIMORE";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1534[] = "ROAD Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1535[] = "EVERGREEN Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1537[] = "DATALEX COMMUNCATIONS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1538[] = "ARALION Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1539[] = "ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153a[] = "ONO SOKKI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153b[] = "TERRATEC Electronic GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153c[] = "ANTAL Electronic";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153d[] = "FILANET Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153e[] = "TECHWELL Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_153f[] = "MIPS DENMARK";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1540[] = "PROVIDEO MULTIMEDIA Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1541[] = "MACHONE Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1542[] = "VIVID Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1543[] = "SILICON Laboratories";
-static const char pci_device_1543_3052[] = "Intel 537 [Winmodem]";
-static const char pci_device_1543_4c22[] = "Si3036 MC'97 DAA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1544[] = "DCM DATA Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1545[] = "VISIONTEK";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1546[] = "IOI Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1547[] = "MITUTOYO Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1548[] = "JET PROPULSION Laboratory";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1549[] = "INTERCONNECT Systems Solutions";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154a[] = "MAX Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154b[] = "COMPUTEX Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154c[] = "VISUAL Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154d[] = "PAN INTERNATIONAL Industrial Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154e[] = "SERVOTEST Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_154f[] = "STRATABEAM Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1550[] = "OPEN NETWORK Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1551[] = "SMART Electronic DEVELOPMENT GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1552[] = "RACAL AIRTECH Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1553[] = "CHICONY Electronics Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1554[] = "PROLINK Microsystems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1555[] = "GESYTEC GmBH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1556[] = "PLD APPLICATIONS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1557[] = "MEDIASTAR Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1558[] = "CLEVO/KAPOK Computer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1559[] = "SI LOGIC Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155a[] = "INNOMEDIA Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155b[] = "PROTAC INTERNATIONAL Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155c[] = "Cemax-Icon Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155d[] = "Mac System Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155e[] = "LP Elektronik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_155f[] = "Perle Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1560[] = "Terayon Communications Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1561[] = "Viewgraphics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1562[] = "Symbol Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1563[] = "A-Trend Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1564[] = "Yamakatsu Electronics Industry Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1565[] = "Biostar Microtech Int'l Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1566[] = "Ardent Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1567[] = "Jungsoft";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1568[] = "DDK Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1569[] = "Palit Microsystems Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156a[] = "Avtec Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156b[] = "2wire Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156c[] = "Vidac Electronics GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156d[] = "Alpha-Top Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156e[] = "Alfa Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_156f[] = "M-Systems Flash Disk Pioneers Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1570[] = "Lecroy Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1571[] = "Contemporary Controls";
-static const char pci_device_1571_a001[] = "CCSI PCI20-485 ARCnet";
-static const char pci_device_1571_a002[] = "CCSI PCI20-485D ARCnet";
-static const char pci_device_1571_a003[] = "CCSI PCI20-485X ARCnet";
-static const char pci_device_1571_a004[] = "CCSI PCI20-CXB ARCnet";
-static const char pci_device_1571_a005[] = "CCSI PCI20-CXS ARCnet";
-static const char pci_device_1571_a006[] = "CCSI PCI20-FOG-SMA ARCnet";
-static const char pci_device_1571_a007[] = "CCSI PCI20-FOG-ST ARCnet";
-static const char pci_device_1571_a008[] = "CCSI PCI20-TB5 ARCnet";
-static const char pci_device_1571_a009[] = "CCSI PCI20-5-485 5Mbit ARCnet";
-static const char pci_device_1571_a00a[] = "CCSI PCI20-5-485D 5Mbit ARCnet";
-static const char pci_device_1571_a00b[] = "CCSI PCI20-5-485X 5Mbit ARCnet";
-static const char pci_device_1571_a00c[] = "CCSI PCI20-5-FOG-ST 5Mbit ARCnet";
-static const char pci_device_1571_a00d[] = "CCSI PCI20-5-FOG-SMA 5Mbit ARCnet";
-static const char pci_device_1571_a201[] = "CCSI PCI22-485 10Mbit ARCnet";
-static const char pci_device_1571_a202[] = "CCSI PCI22-485D 10Mbit ARCnet";
-static const char pci_device_1571_a203[] = "CCSI PCI22-485X 10Mbit ARCnet";
-static const char pci_device_1571_a204[] = "CCSI PCI22-CHB 10Mbit ARCnet";
-static const char pci_device_1571_a205[] = "CCSI PCI22-FOG_ST 10Mbit ARCnet";
-static const char pci_device_1571_a206[] = "CCSI PCI22-THB 10Mbit ARCnet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1572[] = "Otis Elevator Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1573[] = "Lattice - Vantis";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1574[] = "Fairchild Semiconductor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1575[] = "Voltaire Advanced Data Security Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1576[] = "Viewcast COM";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1578[] = "HITT";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1579[] = "Dual Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157a[] = "Japan Elecronics Ind Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157b[] = "Star Multimedia Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157c[] = "Eurosoft (UK)";
-static const char pci_device_157c_8001[] = "Fix2000 PCI Y2K Compliance Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157d[] = "Gemflex Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157e[] = "Transition Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_157f[] = "PX Instruments Technology Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1580[] = "Primex Aerospace Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1581[] = "SEH Computertechnik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1582[] = "Cytec Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1583[] = "Inet Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1584[] = "Uniwill Computer Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1585[] = "Logitron";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1586[] = "Lancast Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1587[] = "Konica Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1588[] = "Solidum Systems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1589[] = "Atlantek Microsystems Pty Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158a[] = "Digalog Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158b[] = "Allied Data Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158c[] = "Hitachi Semiconductor & Devices Sales Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158d[] = "Point Multimedia Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158e[] = "Lara Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_158f[] = "Ditect Coop";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1590[] = "3pardata Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1591[] = "ARN";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1592[] = "Syba Tech Ltd";
-static const char pci_device_1592_0781[] = "Multi-IO Card";
-static const char pci_device_1592_0782[] = "Parallel Port Card 2xEPP";
-static const char pci_device_1592_0783[] = "Multi-IO Card";
-static const char pci_device_1592_0785[] = "Multi-IO Card";
-static const char pci_device_1592_0786[] = "Multi-IO Card";
-static const char pci_device_1592_0787[] = "Multi-IO Card";
-static const char pci_device_1592_0788[] = "Multi-IO Card";
-static const char pci_device_1592_078a[] = "Multi-IO Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1593[] = "Bops Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1594[] = "Netgame Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1595[] = "Diva Systems Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1596[] = "Folsom Research Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1597[] = "Memec Design Services";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1598[] = "Granite Microsystems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1599[] = "Delta Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159a[] = "General Instrument";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159b[] = "Faraday Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159c[] = "Stratus Computer Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159d[] = "Ningbo Harrison Electronics Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159e[] = "A-Max Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_159f[] = "Galea Network Security";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a0[] = "Compumaster SRL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a1[] = "Geocast Network Systems";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a2[] = "Catalyst Enterprises Inc";
-static const char pci_device_15a2_0001[] = "TA700 PCI Bus Analyzer/Exerciser";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a3[] = "Italtel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a4[] = "X-Net OY";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a5[] = "Toyota Macs Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a6[] = "Sunlight Ultrasound Technologies Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a7[] = "SSE Telecom Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15a8[] = "Shanghai Communications Technologies Center";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15aa[] = "Moreton Bay";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ab[] = "Bluesteel Networks Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ac[] = "North Atlantic Instruments";
-#endif
-static const char pci_vendor_15ad[] = "VMWare Inc";
-static const char pci_device_15ad_0710[] = "Virtual SVGA";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ae[] = "Amersham Pharmacia Biotech";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b0[] = "Zoltrix International Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b1[] = "Source Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b2[] = "Mosaid Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b3[] = "Mellanox Technology";
-static const char pci_device_15b3_5274[] = "MT21108 InfiniBridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b4[] = "CCI/TRIAD";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b5[] = "Cimetrics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b6[] = "Texas Memory Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b7[] = "Sandisk Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b8[] = "ADDI-DATA GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15b9[] = "Maestro Digital Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ba[] = "Impacct Technology Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15bb[] = "Portwell Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15bc[] = "Agilent Technologies";
-static const char pci_device_15bc_2929[] = "E2929A PCI/PCI-X Bus Analyzer";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15bd[] = "DFI Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15be[] = "Sola Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15bf[] = "High Tech Computer Corp (HTC)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c0[] = "BVM Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c1[] = "Quantel";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c2[] = "Newer Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c3[] = "Taiwan Mycomp Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c4[] = "EVSX Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c5[] = "Procomp Informatics Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c6[] = "Technical University of Budapest";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c7[] = "Tateyama System Laboratory Co Ltd";
-static const char pci_device_15c7_0349[] = "Tateyama C-PCI PLC/NC card Rev.01A";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c8[] = "Penta Media Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15c9[] = "Serome Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ca[] = "Bitboys OY";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15cb[] = "AG Electronics Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15cc[] = "Hotrail Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15cd[] = "Dreamtech Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ce[] = "Genrad Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15cf[] = "Hilscher GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d1[] = "Infineon Technologies AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d2[] = "FIC (First International Computer Inc)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d3[] = "NDS Technologies Israel Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d4[] = "Iwill Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d5[] = "Tatung Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d6[] = "Entridia Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d7[] = "Rockwell-Collins Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d8[] = "Cybernetics Technology Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15d9[] = "Super Micro Computer Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15da[] = "Cyberfirm Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15db[] = "Applied Computing Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15dc[] = "Litronic Inc";
-static const char pci_device_15dc_0001[] = "Argus 300 PCI Cryptography Module";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15dd[] = "Sigmatel Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15de[] = "Malleable Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15df[] = "Infinilink Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e0[] = "Cacheflow Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e1[] = "Voice Technologies Group Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e2[] = "Quicknet Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e3[] = "Networth Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e4[] = "VSN Systemen BV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e5[] = "Valley technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e6[] = "Agere Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e7[] = "Get Engineering Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e8[] = "National Datacomm Corp";
-static const char pci_device_15e8_0130[] = "Wireless PCI Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15e9[] = "Pacific Digital Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ea[] = "Tokyo Denshi Sekei K.K.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15eb[] = "Drsearch GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ec[] = "Beckhoff GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ed[] = "Macrolink Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ee[] = "In Win Development Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ef[] = "Intelligent Paradigm Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f0[] = "B-Tree Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f1[] = "Times N Systems Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f2[] = "Diagnostic Instruments Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f3[] = "Digitmedia Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f4[] = "Valuesoft";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f5[] = "Power Micro Research";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f6[] = "Extreme Packet Device Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f7[] = "Banctec";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f8[] = "Koga Electronics Co";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15f9[] = "Zenith Electronics Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15fa[] = "J.P. Axzam Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15fb[] = "Zilog Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15fc[] = "Techsan Electronics Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15fd[] = "N-CUBED.NET";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15fe[] = "Kinpo Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_15ff[] = "Fastpoint Technologies Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1600[] = "Northrop Grumman - Canada Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1601[] = "Tenta Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1602[] = "Prosys-tec Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1603[] = "Nokia Wireless Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1604[] = "Central System Research Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1605[] = "Pairgain Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1606[] = "Europop AG";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1607[] = "Lava Semiconductor Manufacturing Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1608[] = "Automated Wagering International";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1609[] = "Scimetric Instruments Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1612[] = "Telesynergy Research Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1619[] = "FarSite Communications Ltd";
-static const char pci_device_1619_0400[] = "FarSync T2P (2 port X.21/V.35/V.24)";
-static const char pci_device_1619_0440[] = "FarSync T4P (4 port X.21/V.35/V.24)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1629[] = "Kongsberg Spacetec AS";
-static const char pci_device_1629_1003[] = "Format synchronizer v3.0";
-static const char pci_device_1629_2002[] = "Fast Universal Data Output";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1638[] = "Standard Microsystems Corp [SMC]";
-static const char pci_device_1638_1100[] = "SMC2602W EZConnect / Addtron AWA-100";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_163c[] = "Smart Link Ltd.";
-static const char pci_device_163c_3052[] = "SmartLink SmartPCI562 56K Modem";
-static const char pci_device_163c_5449[] = "SmartPCI561 Modem";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1657[] = "Brocade Communications Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_165a[] = "Epix Inc";
-static const char pci_device_165a_c100[] = "PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232]";
-static const char pci_device_165a_d200[] = "PIXCI(R) D2X Digital Video Capture Board [custom QL5232]";
-static const char pci_device_165a_d300[] = "PIXCI(R) D3X Digital Video Capture Board [custom QL5232]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_165d[] = "Hsing Tech. Enterprise Co., Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1661[] = "Worldspace Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1668[] = "Actiontec Electronics Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1681[] = "Hercules";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_16ab[] = "Global Sun Technology Inc";
-static const char pci_device_16ab_1102[] = "PCMCIA-to-PCI Wireless Network Bridge";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_16be[] = "Creatix Polymedia GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_16ca[] = "CENATEK Inc";
-static const char pci_device_16ca_0001[] = "Rocket Drive DL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_16ec[] = "U.S. Robotics";
-static const char pci_device_16ec_3685[] = "Wireless Access PCI Adapter Model 022415";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_16f6[] = "VideoTele.com, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1705[] = "Digital First, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_170b[] = "NetOctave Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_170c[] = "YottaYotta Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_172a[] = "Accelerated Encryption";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1737[] = "Linksys";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_173b[] = "Altima (nee Broadcom)";
-static const char pci_device_173b_03e8[] = "AC1000 Gigabit Ethernet";
-static const char pci_device_173b_03ea[] = "AC9100 Gigabit Ethernet";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_173b_03ea_173b_0001[] = "AC1002";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1743[] = "Peppercon AG";
-static const char pci_device_1743_8139[] = "ROL/F-100 Fast Ethernet Adapter with ROL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_174b[] = "PC Partner Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_175e[] = "Sanera Systems, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1787[] = "Hightech Information System Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1796[] = "Research Centre Juelich";
-static const char pci_device_1796_0001[] = "SIS1100 [Gigabit link]";
-static const char pci_device_1796_0002[] = "HOTlink";
-static const char pci_device_1796_0003[] = "Counter Timer";
-static const char pci_device_1796_0004[] = "CAMAC Controller";
-static const char pci_device_1796_0005[] = "PROFIBUS";
-static const char pci_device_1796_0006[] = "AMCC HOTlink";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1799[] = "Belkin";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_17af[] = "Hightech Information System Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_17cc[] = "NetChip Technology, Inc";
-static const char pci_device_17cc_2280[] = "USB 2.0";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1813[] = "Ambient Technologies Inc";
-static const char pci_device_1813_4000[] = "HaM controllerless modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1813_4000_16be_0001[] = "V9x HAM Data Fax Modem";
-#endif
-static const char pci_device_1813_4100[] = "HaM plus Data Fax Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_1813_4100_16be_0002[] = "V9x HAM 1394";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1851[] = "Microtune, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1852[] = "Anritsu Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1888[] = "Varisys Ltd";
-static const char pci_device_1888_0301[] = "VMFX1 FPGA PMC module";
-static const char pci_device_1888_0601[] = "VSM2 dual PMC carrier";
-static const char pci_device_1888_0710[] = "VS14x series PowerPC PCI board";
-static const char pci_device_1888_0720[] = "VS24x series PowerPC PCI board";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1a08[] = "Sierra semiconductor";
-static const char pci_device_1a08_0000[] = "SC15064";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1b13[] = "Jaton Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1c1c[] = "Symphony";
-static const char pci_device_1c1c_0001[] = "82C101";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1d44[] = "DPT";
-static const char pci_device_1d44_a400[] = "PM2x24/PM3224";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1de1[] = "Tekram Technology Co.,Ltd.";
-static const char pci_device_1de1_0391[] = "TRM-S1040";
-static const char pci_device_1de1_2020[] = "DC-390";
-static const char pci_device_1de1_690c[] = "690c";
-static const char pci_device_1de1_dc29[] = "DC290";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_1fc0[] = "Tumsan Oy";
-static const char pci_device_1fc0_0300[] = "E2200 Dual E1/Rawpipe Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2000[] = "Smart Link Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2001[] = "Temporal Research Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2003[] = "Smart Link Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2004[] = "Smart Link Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_21c3[] = "21st Century Computer Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2348[] = "Racore";
-static const char pci_device_2348_2010[] = "8142 100VG/AnyLAN";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2646[] = "Kingston Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_270b[] = "Xantel Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_270f[] = "Chaintech Computer Co. Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2711[] = "AVID Technology Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_2a15[] = "3D Vision(?)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_3000[] = "Hansol Electronics Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_3142[] = "Post Impression Systems.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_3388[] = "Hint Corp";
-static const char pci_device_3388_0013[] = "HiNT HC4 PCI to ISDN bridge, Multimedia audio controller";
-static const char pci_device_3388_0014[] = "HiNT HC4 PCI to ISDN bridge, Network controller";
-static const char pci_device_3388_0021[] = "HB1-SE33 PCI-PCI Bridge";
-static const char pci_device_3388_101a[] = "E.Band [AudioTrak Inca88]";
-static const char pci_device_3388_101b[] = "E.Band [AudioTrak Inca88]";
-static const char pci_device_3388_8011[] = "VXPro II Chipset";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3388_8011_3388_8011[] = "VXPro II Chipset CPU to PCI Bridge";
-#endif
-static const char pci_device_3388_8012[] = "VXPro II Chipset";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3388_8012_3388_8012[] = "VXPro II Chipset PCI to ISA Bridge";
-#endif
-static const char pci_device_3388_8013[] = "VXPro II IDE";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3388_8013_3388_8013[] = "VXPro II Chipset EIDE Controller";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_3411[] = "Quantum Designs (H.K.) Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_3513[] = "ARCOM Control Systems Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_38ef[] = "4Links";
-#endif
-static const char pci_vendor_3d3d[] = "3DLabs";
-static const char pci_device_3d3d_0001[] = "GLINT 300SX";
-static const char pci_device_3d3d_0002[] = "GLINT 500TX";
-static const char pci_device_3d3d_0003[] = "GLINT Delta";
-static const char pci_device_3d3d_0004[] = "Permedia";
-static const char pci_device_3d3d_0005[] = "Permedia";
-static const char pci_device_3d3d_0006[] = "GLINT MX";
-static const char pci_device_3d3d_0007[] = "3D Extreme";
-static const char pci_device_3d3d_0008[] = "GLINT Gamma G1";
-static const char pci_device_3d3d_0009[] = "Permedia II 2D+3D";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_1040_0011[] = "AccelStar II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0100[] = "AccelStar II 3D Accelerator";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0111[] = "Permedia 3:16";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0114[] = "Santa Ana";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0116[] = "Oxygen GVX1";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0119[] = "Scirocco";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0120[] = "Santa Ana PCL";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0125[] = "Oxygen VX1";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_0009_3d3d_0127[] = "Permedia3 Create!";
-#endif
-static const char pci_device_3d3d_000a[] = "GLINT R3";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_000a_3d3d_0121[] = "Oxygen VX1";
-#endif
-static const char pci_device_3d3d_000c[] = "GLINT R3 [Oxygen VX1]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_3d3d_000c_3d3d_0144[] = "Oxygen VX1-4X AGP [Permedia 4]";
-#endif
-static const char pci_device_3d3d_0100[] = "Permedia II 2D+3D";
-static const char pci_device_3d3d_1004[] = "Permedia";
-static const char pci_device_3d3d_3d04[] = "Permedia";
-static const char pci_device_3d3d_ffff[] = "Glint VGA";
-static const char pci_vendor_4005[] = "Avance Logic Inc.";
-static const char pci_device_4005_0300[] = "ALS300 PCI Audio Device";
-static const char pci_device_4005_0308[] = "ALS300+ PCI Audio Device";
-static const char pci_device_4005_0309[] = "PCI Input Controller";
-static const char pci_device_4005_1064[] = "ALG-2064";
-static const char pci_device_4005_2064[] = "ALG-2064i";
-static const char pci_device_4005_2128[] = "ALG-2364A GUI Accelerator";
-static const char pci_device_4005_2301[] = "ALG-2301";
-static const char pci_device_4005_2302[] = "ALG-2302";
-static const char pci_device_4005_2303[] = "AVG-2302 GUI Accelerator";
-static const char pci_device_4005_2364[] = "ALG-2364A";
-static const char pci_device_4005_2464[] = "ALG-2464";
-static const char pci_device_4005_2501[] = "ALG-2564A/25128A";
-static const char pci_device_4005_4000[] = "ALS4000 Audio Chipset";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_4005_4000_4005_4000[] = "ALS4000 Audio Chipset";
-#endif
-static const char pci_device_4005_4710[] = "ALC200/200P";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4033[] = "Addtron Technology Co, Inc.";
-static const char pci_device_4033_1360[] = "RTL8139 Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4143[] = "Digital Equipment Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_416c[] = "Aladdin Knowledge Systems";
-static const char pci_device_416c_0100[] = "AladdinCARD";
-static const char pci_device_416c_0200[] = "CPC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4444[] = "Internext Compression Inc";
-static const char pci_device_4444_0803[] = "iTVC15 MPEG-2 Encoder";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4468[] = "Bridgeport machines";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4594[] = "Cogetec Informatique Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_45fb[] = "Baldor Electric Company";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4680[] = "Umax Computer Corp";
-#endif
-static const char pci_vendor_4843[] = "Hercules Computer Technology Inc";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4916[] = "RedCreek Communications Inc";
-static const char pci_device_4916_1960[] = "RedCreek PCI adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4943[] = "Growth Networks";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4978[] = "Axil Computer Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4a14[] = "NetVin";
-static const char pci_device_4a14_5000[] = "NV5000SC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_4a14_5000_4a14_5000[] = "RT8029-Based Ethernet Adapter";
-#endif
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4b10[] = "Buslogic Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4c48[] = "LUNG HWA Electronics";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4c53[] = "SBS Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4ca1[] = "Seanix Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4d51[] = "MediaQ Inc.";
-static const char pci_device_4d51_0200[] = "MQ-200";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4d54[] = "Microtechnica Co Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_4ddc[] = "ILC Data Device Corp";
-static const char pci_device_4ddc_0100[] = "DD-42924I5-300 (ARINC 429 Data Bus)";
-static const char pci_device_4ddc_0801[] = "BU-65570I1 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0802[] = "BU-65570I2 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0811[] = "BU-65572I1 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0812[] = "BU-65572I2 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0881[] = "BU-65570T1 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0882[] = "BU-65570T2 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0891[] = "BU-65572T1 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0892[] = "BU-65572T2 MIL-STD-1553 Test and Simulation";
-static const char pci_device_4ddc_0901[] = "BU-65565C1 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0902[] = "BU-65565C2 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0903[] = "BU-65565C3 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0904[] = "BU-65565C4 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0b01[] = "BU-65569I1 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0b02[] = "BU-65569I2 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0b03[] = "BU-65569I3 MIL-STD-1553 Data Bus";
-static const char pci_device_4ddc_0b04[] = "BU-65569I4 MIL-STD-1553 Data Bus";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5046[] = "GemTek Technology Corporation";
-static const char pci_device_5046_1001[] = "PCI Radio";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5053[] = "Voyetra Technologies";
-static const char pci_device_5053_2010[] = "Daytona Audio Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5136[] = "S S Technologies";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5143[] = "Qualcomm Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5145[] = "Ensoniq (Old)";
-static const char pci_device_5145_3031[] = "Concert AudioPCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5168[] = "Animation Technologies Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5301[] = "Alliance Semiconductor Corp.";
-static const char pci_device_5301_0001[] = "ProMotion aT3D";
-#endif
-static const char pci_vendor_5333[] = "S3 Inc.";
-static const char pci_device_5333_0551[] = "Plato/PX (system)";
-static const char pci_device_5333_5631[] = "86c325 [ViRGE]";
-static const char pci_device_5333_8800[] = "86c866 [Vision 866]";
-static const char pci_device_5333_8801[] = "86c964 [Vision 964]";
-static const char pci_device_5333_8810[] = "86c764_0 [Trio 32 vers 0]";
-static const char pci_device_5333_8811[] = "86c764/765 [Trio32/64/64V+]";
-static const char pci_device_5333_8812[] = "86cM65 [Aurora64V+]";
-static const char pci_device_5333_8813[] = "86c764_3 [Trio 32/64 vers 3]";
-static const char pci_device_5333_8814[] = "86c767 [Trio 64UV+]";
-static const char pci_device_5333_8815[] = "86cM65 [Aurora 128]";
-static const char pci_device_5333_883d[] = "86c988 [ViRGE/VX]";
-static const char pci_device_5333_8870[] = "FireGL";
-static const char pci_device_5333_8880[] = "86c868 [Vision 868 VRAM] vers 0";
-static const char pci_device_5333_8881[] = "86c868 [Vision 868 VRAM] vers 1";
-static const char pci_device_5333_8882[] = "86c868 [Vision 868 VRAM] vers 2";
-static const char pci_device_5333_8883[] = "86c868 [Vision 868 VRAM] vers 3";
-static const char pci_device_5333_88b0[] = "86c928 [Vision 928 VRAM] vers 0";
-static const char pci_device_5333_88b1[] = "86c928 [Vision 928 VRAM] vers 1";
-static const char pci_device_5333_88b2[] = "86c928 [Vision 928 VRAM] vers 2";
-static const char pci_device_5333_88b3[] = "86c928 [Vision 928 VRAM] vers 3";
-static const char pci_device_5333_88c0[] = "86c864 [Vision 864 DRAM] vers 0";
-static const char pci_device_5333_88c1[] = "86c864 [Vision 864 DRAM] vers 1";
-static const char pci_device_5333_88c2[] = "86c864 [Vision 864-P DRAM] vers 2";
-static const char pci_device_5333_88c3[] = "86c864 [Vision 864-P DRAM] vers 3";
-static const char pci_device_5333_88d0[] = "86c964 [Vision 964 VRAM] vers 0";
-static const char pci_device_5333_88d1[] = "86c964 [Vision 964 VRAM] vers 1";
-static const char pci_device_5333_88d2[] = "86c964 [Vision 964-P VRAM] vers 2";
-static const char pci_device_5333_88d3[] = "86c964 [Vision 964-P VRAM] vers 3";
-static const char pci_device_5333_88f0[] = "86c968 [Vision 968 VRAM] rev 0";
-static const char pci_device_5333_88f1[] = "86c968 [Vision 968 VRAM] rev 1";
-static const char pci_device_5333_88f2[] = "86c968 [Vision 968 VRAM] rev 2";
-static const char pci_device_5333_88f3[] = "86c968 [Vision 968 VRAM] rev 3";
-static const char pci_device_5333_8900[] = "86c755 [Trio 64V2/DX]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8900_5333_8900[] = "86C775 Trio64V2/DX";
-#endif
-static const char pci_device_5333_8901[] = "86c775/86c785 [Trio 64V2/DX or /GX]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8901_5333_8901[] = "86C775 Trio64V2/DX, 86C785 Trio64V2/GX";
-#endif
-static const char pci_device_5333_8902[] = "Plato/PX";
-static const char pci_device_5333_8903[] = "Trio 3D business multimedia";
-static const char pci_device_5333_8904[] = "Trio 64 3D";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8904_1014_00db[] = "Integrated Trio3D";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8904_5333_8904[] = "86C365 Trio3D AGP";
-#endif
-static const char pci_device_5333_8905[] = "Trio 64V+ family";
-static const char pci_device_5333_8906[] = "Trio 64V+ family";
-static const char pci_device_5333_8907[] = "Trio 64V+ family";
-static const char pci_device_5333_8908[] = "Trio 64V+ family";
-static const char pci_device_5333_8909[] = "Trio 64V+ family";
-static const char pci_device_5333_890a[] = "Trio 64V+ family";
-static const char pci_device_5333_890b[] = "Trio 64V+ family";
-static const char pci_device_5333_890c[] = "Trio 64V+ family";
-static const char pci_device_5333_890d[] = "Trio 64V+ family";
-static const char pci_device_5333_890e[] = "Trio 64V+ family";
-static const char pci_device_5333_890f[] = "Trio 64V+ family";
-static const char pci_device_5333_8a01[] = "ViRGE/DX or /GX";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a01_0e11_b032[] = "ViRGE/GX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a01_10b4_1617[] = "Nitro 3D";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a01_10b4_1717[] = "Nitro 3D";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a01_5333_8a01[] = "ViRGE/DX";
-#endif
-static const char pci_device_5333_8a10[] = "ViRGE/GX2";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a10_1092_8a10[] = "Stealth 3D 4000";
-#endif
-static const char pci_device_5333_8a13[] = "86c368 [Trio 3D/2X]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a13_5333_8a13[] = "Trio3D/2X";
-#endif
-static const char pci_device_5333_8a20[] = "86c794 [Savage 3D]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a20_5333_8a20[] = "86C391 Savage3D";
-#endif
-static const char pci_device_5333_8a21[] = "86c390 [Savage 3D/MV]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a21_5333_8a21[] = "86C390 Savage3D/MV";
-#endif
-static const char pci_device_5333_8a22[] = "Savage 4";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1033_8068[] = "Savage 4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1033_8069[] = "Savage 4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_105d_0018[] = "SR9 8Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_105d_002a[] = "SR9 Pro 16Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_105d_003a[] = "SR9 Pro 32Mb SDRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_105d_092f[] = "SR9 Pro+ 16Mb SGRAM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4207[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4800[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4807[] = "SpeedStar A90";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4808[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4809[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_480e[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4904[] = "Stealth III S520";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4905[] = "SpeedStar A200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4a09[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4a0b[] = "Stealth III S540 Xtreme";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4a0f[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1092_4e01[] = "Stealth III S540";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1102_101d[] = "3d Blaster Savage 4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_1102_101e[] = "3d Blaster Savage 4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8100[] = "86C394-397 Savage4 SDRAM 100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8110[] = "86C394-397 Savage4 SDRAM 110";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8125[] = "86C394-397 Savage4 SDRAM 125";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8143[] = "86C394-397 Savage4 SDRAM 143";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8a22[] = "86C394-397 Savage4";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_8a2e[] = "86C394-397 Savage4 32bit";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_9125[] = "86C394-397 Savage4 SGRAM 125";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8a22_5333_9143[] = "86C394-397 Savage4 SGRAM 143";
-#endif
-static const char pci_device_5333_8a23[] = "Savage 4";
-static const char pci_device_5333_8a25[] = "ProSavage PM133";
-static const char pci_device_5333_8a26[] = "ProSavage KM133";
-static const char pci_device_5333_8c00[] = "ViRGE/M3";
-static const char pci_device_5333_8c01[] = "ViRGE/MX";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8c01_1179_0001[] = "ViRGE/MX";
-#endif
-static const char pci_device_5333_8c02[] = "ViRGE/MX+";
-static const char pci_device_5333_8c03[] = "ViRGE/MX+MV";
-static const char pci_device_5333_8c10[] = "86C270-294 Savage/MX-MV";
-static const char pci_device_5333_8c11[] = "82C270-294 Savage/MX";
-static const char pci_device_5333_8c12[] = "86C270-294 Savage/IX-MV";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8c12_1014_017f[] = "ThinkPad T20";
-#endif
-static const char pci_device_5333_8c13[] = "86C270-294 Savage/IX";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8c13_1179_0001[] = "Magnia Z310";
-#endif
-static const char pci_device_5333_8c22[] = "SuperSavage MX/128";
-static const char pci_device_5333_8c24[] = "SuperSavage MX/64";
-static const char pci_device_5333_8c26[] = "SuperSavage MX/64C";
-static const char pci_device_5333_8c2a[] = "SuperSavage IX/128 SDR";
-static const char pci_device_5333_8c2b[] = "SuperSavage IX/128 DDR";
-static const char pci_device_5333_8c2c[] = "SuperSavage IX/64 SDR";
-static const char pci_device_5333_8c2d[] = "SuperSavage IX/64 DDR";
-static const char pci_device_5333_8c2e[] = "SuperSavage IX/C SDR";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_8c2e_1014_01fc[] = "ThinkPad T23 (2647-4MG)";
-#endif
-static const char pci_device_5333_8c2f[] = "SuperSavage IX/C DDR";
-static const char pci_device_5333_8d01[] = "86C380 [ProSavageDDR K4M266]";
-static const char pci_device_5333_8d02[] = "VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)";
-static const char pci_device_5333_8d03[] = "VT8751 [ProSavageDDR P4M266]";
-static const char pci_device_5333_8d04[] = "VT8375 [ProSavage8 KM266/KL266]";
-static const char pci_device_5333_9102[] = "86C410 Savage 2000";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5932[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5934[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5952[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5954[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5a35[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5a37[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5a55[] = "Viper II Z200";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_5333_9102_1092_5a57[] = "Viper II Z200";
-#endif
-static const char pci_device_5333_ca00[] = "SonicVibes";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_544c[] = "Teralogic Inc";
-static const char pci_device_544c_0350[] = "TL880-based HDTV/ATSC tuner";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5455[] = "Technische University Berlin";
-static const char pci_device_5455_4458[] = "S5933";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5519[] = "Cnet Technologies, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5544[] = "Dunord Technologies";
-static const char pci_device_5544_0001[] = "I-30xx Scanner Interface";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5555[] = "Genroco, Inc";
-static const char pci_device_5555_0003[] = "TURBOstor HFP-832 [HiPPI NIC]";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5654[] = "VoiceTronix Pty Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_5700[] = "Netpower";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_6356[] = "UltraStor";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_6374[] = "c't Magazin für Computertechnik";
-static const char pci_device_6374_6773[] = "GPPCI";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_6409[] = "Logitec Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_6666[] = "Decision Computer International Co.";
-static const char pci_device_6666_0001[] = "PCCOM4";
-static const char pci_device_6666_0002[] = "PCCOM8";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_7604[] = "O.N. Electronic Co Ltd.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_7bde[] = "MIDAC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_7fed[] = "PowerTV";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8008[] = "Quancom Electronic GmbH";
-static const char pci_device_8008_0010[] = "WDOG1 [PCI-Watchdog 1]";
-static const char pci_device_8008_0011[] = "PWDOG2 [PCI-Watchdog 2]";
-#endif
-static const char pci_vendor_8086[] = "Intel Corp.";
-static const char pci_device_8086_0007[] = "82379AB";
-static const char pci_device_8086_0008[] = "Extended Express System Support Controller";
-static const char pci_device_8086_0039[] = "21145";
-static const char pci_device_8086_0122[] = "82437FX";
-static const char pci_device_8086_0482[] = "82375EB";
-static const char pci_device_8086_0483[] = "82424ZX [Saturn]";
-static const char pci_device_8086_0484[] = "82378IB [SIO ISA Bridge]";
-static const char pci_device_8086_0486[] = "82430ZX [Aries]";
-static const char pci_device_8086_04a3[] = "82434LX [Mercury/Neptune]";
-static const char pci_device_8086_04d0[] = "82437FX [Triton FX]";
-static const char pci_device_8086_0600[] = "RAID Controller";
-static const char pci_device_8086_0960[] = "80960RP [i960 RP Microprocessor/Bridge]";
-static const char pci_device_8086_0962[] = "80960RM [i960RM Bridge]";
-static const char pci_device_8086_0964[] = "80960RP [i960 RP Microprocessor/Bridge]";
-static const char pci_device_8086_1000[] = "82542 Gigabit Ethernet Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1000_0e11_b0df[] = "NC1632 Gigabit Ethernet Adapter (1000-SX)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1000_0e11_b0e0[] = "NC1633 Gigabit Ethernet Adapter (1000-LX)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1000_0e11_b123[] = "NC1634 Gigabit Ethernet Adapter (1000-SX)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1000_1014_0119[] = "Netfinity Gigabit Ethernet SX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1000_8086_1000[] = "PRO/1000 Gigabit Server Adapter";
-#endif
-static const char pci_device_8086_1001[] = "82543GC Gigabit Ethernet Controller (Fiber)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1001_0e11_004a[] = "NC6136 Gigabit Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1001_1014_01ea[] = "Netfinity Gigabit Ethernet SX Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1001_8086_1003[] = "PRO/1000 F Server Adapter";
-#endif
-static const char pci_device_8086_1002[] = "Pro 100 LAN+Modem 56 Cardbus II";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1002_8086_200e[] = "Pro 100 LAN+Modem 56 Cardbus II";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1002_8086_2013[] = "Pro 100 SR Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1002_8086_2017[] = "Pro 100 S Combo Mobile Adapter";
-#endif
-static const char pci_device_8086_1004[] = "82543GC Gigabit Ethernet Controller (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1004_0e11_0049[] = "NC7132 Gigabit Upgrade Module";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1004_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1004_1014_10f2[] = "Gigabit Ethernet Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1004_8086_1004[] = "PRO/1000 T Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1004_8086_2004[] = "PRO/1000 T Server Adapter";
-#endif
-static const char pci_device_8086_1008[] = "82544EI Gigabit Ethernet Controller (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1008_8086_1107[] = "PRO/1000 XT Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1008_8086_2107[] = "PRO/1000 XT Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1008_8086_2110[] = "PRO/1000 XT Server Adapter";
-#endif
-static const char pci_device_8086_1009[] = "82544EI Gigabit Ethernet Controller (Fiber)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1009_8086_1109[] = "PRO/1000 XF Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1009_8086_2109[] = "PRO/1000 XF Server Adapter";
-#endif
-static const char pci_device_8086_100c[] = "82544GC Gigabit Ethernet Controller (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_100c_8086_1112[] = "PRO/1000 T Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_100c_8086_2112[] = "PRO/1000 T Desktop Adapter";
-#endif
-static const char pci_device_8086_100d[] = "82544GC Gigabit Ethernet Controller (LOM)";
-static const char pci_device_8086_100e[] = "82540EM Gigabit Ethernet Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_100e_8086_001e[] = "PRO/1000 MT Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_100e_8086_002e[] = "PRO/1000 MT Desktop Adapter";
-#endif
-static const char pci_device_8086_100f[] = "82545EM Gigabit Ethernet Controller (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_100f_8086_1001[] = "PRO/1000 MT Server Adapter";
-#endif
-static const char pci_device_8086_1010[] = "82546EB Gigabit Ethernet Controller (Copper)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1010_8086_1011[] = "PRO/1000 MT Dual Port Server Adapter";
-#endif
-static const char pci_device_8086_1011[] = "82545EM Gigabit Ethernet Controller (Fiber)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1011_8086_1002[] = "PRO/1000 MF Server Adapter";
-#endif
-static const char pci_device_8086_1012[] = "82546EB Gigabit Ethernet Controller (Fiber)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1012_8086_1012[] = "PRO/1000 MF Dual Port Server Adapter";
-#endif
-static const char pci_device_8086_1015[] = "82540EM Gigabit Ethernet Controller (LOM)";
-static const char pci_device_8086_1029[] = "82559 Ethernet Controller";
-static const char pci_device_8086_1030[] = "82559 InBusiness 10/100";
-static const char pci_device_8086_1031[] = "82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_1014_0209[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_104d_80e7[] = "Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_107b_5350[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_1179_0001[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_144d_c000[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_144d_c001[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_144d_c003[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1031_144d_c006[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_1032[] = "82801CAM (ICH3) PRO/100 VE Ethernet Controller";
-static const char pci_device_8086_1033[] = "82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller";
-static const char pci_device_8086_1034[] = "82801CAM (ICH3) PRO/100 VM Ethernet Controller";
-static const char pci_device_8086_1035[] = "82801CAM (ICH3)/82562EH (LOM) Ethernet Controller";
-static const char pci_device_8086_1036[] = "82801CAM (ICH3) 82562EH Ethernet Controller";
-static const char pci_device_8086_1037[] = "82801CAM (ICH3) Chipset Ethernet Controller";
-static const char pci_device_8086_1038[] = "82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller";
-static const char pci_device_8086_1039[] = "82801BD PRO/100 VE (LOM) Ethernet Controller";
-static const char pci_device_8086_103a[] = "82801BD PRO/100 VE (CNR) Ethernet Controller";
-static const char pci_device_8086_103b[] = "82801BD PRO/100 VM (LOM) Ethernet Controller";
-static const char pci_device_8086_103c[] = "82801BD PRO/100 VM (CNR) Ethernet Controller";
-static const char pci_device_8086_103d[] = "82801BD PRO/100 VE (MOB) Ethernet Controller";
-static const char pci_device_8086_103e[] = "82801BD PRO/100 VM (MOB) Ethernet Controller";
-static const char pci_device_8086_1040[] = "536EP Data Fax Modem";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1040_16be_1040[] = "V.9X DSP Data Fax Modem";
-#endif
-static const char pci_device_8086_1043[] = "PRO/Wireless LAN 2100 3B Mini PCI Adapter";
-static const char pci_device_8086_1059[] = "82551QM Ethernet Controller";
-static const char pci_device_8086_1130[] = "82815 815 Chipset Host Bridge and Memory Controller Hub";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1130_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1130_1043_8027[] = "TUSL2-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1130_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1130_8086_4532[] = "D815EEA2 mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1130_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_1131[] = "82815 815 Chipset AGP Bridge";
-static const char pci_device_8086_1132[] = "82815 CGC [Chipset Graphics Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1132_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1132_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1132_8086_4532[] = "D815EEA2 Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1132_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_1161[] = "82806AA PCI64 Hub Advanced Programmable Interrupt Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1161_8086_1161[] = "82806AA PCI64 Hub APIC";
-#endif
-static const char pci_device_8086_1162[] = "Xscale 80200 Big Endian Companion Chip";
-static const char pci_device_8086_1200[] = "Intel IXP1200 Network Processor";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1200_172a_0000[] = "AEP SSL Accelerator";
-#endif
-static const char pci_device_8086_1209[] = "82559ER";
-static const char pci_device_8086_1221[] = "82092AA_0";
-static const char pci_device_8086_1222[] = "82092AA_1";
-static const char pci_device_8086_1223[] = "SAA7116";
-static const char pci_device_8086_1225[] = "82452KX/GX [Orion]";
-static const char pci_device_8086_1226[] = "82596 PRO/10 PCI";
-static const char pci_device_8086_1227[] = "82865 EtherExpress PRO/100A";
-static const char pci_device_8086_1228[] = "82556 EtherExpress PRO/100 Smart";
-static const char pci_device_8086_1229[] = "82557/8/9 [Ethernet Pro 100]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3001[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3002[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3003[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3004[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3005[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3006[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_3007[] = "82559 Fast Ethernet LOM with Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b01e[] = "NC3120 Fast Ethernet NIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b01f[] = "NC3122 Fast Ethernet NIC (dual port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b02f[] = "NC1120 Ethernet NIC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b04a[] = "Netelligent 10/100TX NIC with Wake on LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0c6[] = "NC3161 Fast Ethernet NIC (embedded, WOL)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0c7[] = "NC3160 Fast Ethernet NIC (embedded)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0d7[] = "NC3121 Fast Ethernet NIC (WOL)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0dd[] = "NC3131 Fast Ethernet NIC (dual port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0de[] = "NC3132 Fast Ethernet Module (dual port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b0e1[] = "NC3133 Fast Ethernet Module (100-FX)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b134[] = "NC3163 Fast Ethernet NIC (embedded, WOL)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b13c[] = "NC3162 Fast Ethernet NIC (embedded)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b144[] = "NC3123 Fast Ethernet NIC (WOL)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b163[] = "NC3134 Fast Ethernet NIC (dual port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b164[] = "NC3135 Fast Ethernet Upgrade Module (dual port)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_005c[] = "82558B Ethernet Pro 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_01bc[] = "82559 Fast Ethernet LAN On Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_01f1[] = "10/100 Ethernet Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_01f2[] = "10/100 Ethernet Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_0207[] = "Ethernet Pro/100 S";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_0232[] = "10/100 Dual Port Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_023a[] = "ThinkPad R30";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_105c[] = "Netfinity 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_2205[] = "ThinkPad A22p";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_305c[] = "10/100 EtherJet Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_405c[] = "10/100 EtherJet Adapter with Alert on LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_505c[] = "10/100 EtherJet Secure Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_605c[] = "10/100 EtherJet Secure Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_705c[] = "10/100 Netfinity 10/100 Ethernet Security Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1014_805c[] = "10/100 Netfinity 10/100 Ethernet Security Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1028_009b[] = "PowerEdge 2550";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_8000[] = "PC-9821X-B06";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_8016[] = "PK-UG-X006";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_801f[] = "PK-UG-X006";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_8026[] = "PK-UG-X006";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_8063[] = "82559-based Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1033_8064[] = "82559-based Fast Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10c0[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10c3[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10ca[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10cb[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10e3[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_10e4[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_103c_1200[] = "NetServer 10/100TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_10c3_1100[] = "SmartEther100 SC1100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_10cf_1115[] = "8255x-based Ethernet Adapter (10/100)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_10cf_1143[] = "8255x-based Ethernet Adapter (10/100)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1179_0001[] = "8255x-based Ethernet Adapter (10/100)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1179_0002[] = "PCI FastEther LAN on Docker";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1179_0003[] = "8255x-based Fast Ethernet";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1259_2560[] = "AT-2560 100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1259_2561[] = "AT-2560 100 FX Ethernet Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1266_0001[] = "NE10/100 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_144d_2501[] = "SEM-2000 MiniPCI LAN Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_144d_2502[] = "SEM-2100IL MiniPCI LAN Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_1668_1100[] = "EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0001[] = "EtherExpress PRO/100B (TX)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0002[] = "EtherExpress PRO/100B (T4)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0003[] = "EtherExpress PRO/10+";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0004[] = "EtherExpress PRO/100 WfM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0005[] = "82557 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0006[] = "82557 10/100 with Wake on LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0007[] = "82558 10/100 Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0008[] = "82558 10/100 with Wake on LAN";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0009[] = "EtherExpress PRO/100+";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000a[] = "EtherExpress PRO/100+ Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000b[] = "EtherExpress PRO/100+";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000c[] = "EtherExpress PRO/100+ Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000d[] = "EtherExpress PRO/100+ Alert On LAN II* Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000e[] = "EtherExpress PRO/100+ Management Adapter with Alert On LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_000f[] = "EtherExpress PRO/100 Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0010[] = "EtherExpress PRO/100 S Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0011[] = "EtherExpress PRO/100 S Management Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0012[] = "EtherExpress PRO/100 S Advanced Management Adapter (D)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0013[] = "EtherExpress PRO/100 S Advanced Management Adapter (E)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0030[] = "EtherExpress PRO/100 Management Adapter with Alert On LAN* GC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0031[] = "EtherExpress PRO/100 Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0040[] = "EtherExpress PRO/100 S Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0041[] = "EtherExpress PRO/100 S Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0042[] = "EtherExpress PRO/100 Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_0050[] = "EtherExpress PRO/100 S Desktop Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1009[] = "EtherExpress PRO/100+ Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_100c[] = "EtherExpress PRO/100+ Server Adapter (PILA8470B)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1012[] = "EtherExpress PRO/100 S Server Adapter (D)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1013[] = "EtherExpress PRO/100 S Server Adapter (E)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1015[] = "EtherExpress PRO/100 S Dual Port Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1017[] = "EtherExpress PRO/100+ Dual Port Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1030[] = "EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1040[] = "EtherExpress PRO/100 S Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1041[] = "EtherExpress PRO/100 S Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1042[] = "EtherExpress PRO/100 Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1050[] = "EtherExpress PRO/100 S Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1051[] = "EtherExpress PRO/100 Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_1052[] = "EtherExpress PRO/100 Server Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_10f0[] = "EtherExpress PRO/100+ Dual Port Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2009[] = "EtherExpress PRO/100 S Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_200d[] = "EtherExpress PRO/100 Cardbus";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_200e[] = "EtherExpress PRO/100 LAN+V90 Cardbus Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_200f[] = "EtherExpress PRO/100 SR Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2010[] = "EtherExpress PRO/100 S Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2013[] = "EtherExpress PRO/100 SR Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2016[] = "EtherExpress PRO/100 S Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2017[] = "EtherExpress PRO/100 S Combo Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2018[] = "EtherExpress PRO/100 SR Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2019[] = "EtherExpress PRO/100 SR Combo Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2101[] = "EtherExpress PRO/100 P Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2102[] = "EtherExpress PRO/100 SP Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2103[] = "EtherExpress PRO/100 SP Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2104[] = "EtherExpress PRO/100 SP Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2105[] = "EtherExpress PRO/100 SP Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2106[] = "EtherExpress PRO/100 P Mobile Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2107[] = "EtherExpress PRO/100 Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2108[] = "EtherExpress PRO/100 Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2200[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2201[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2202[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2203[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2204[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2205[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2206[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2207[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2208[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2402[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2407[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2408[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2409[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_240f[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2410[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2411[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2412[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_2413[] = "EtherExpress PRO/100+ MiniPCI";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3000[] = "82559 Fast Ethernet LAN on Motherboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3001[] = "82559 Fast Ethernet LOM with Basic Alert on LAN*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3002[] = "82559 Fast Ethernet LOM with Alert on LAN II*";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3006[] = "EtherExpress PRO/100 S Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3007[] = "EtherExpress PRO/100 S Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3008[] = "EtherExpress PRO/100 Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3010[] = "EtherExpress PRO/100 S Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3011[] = "EtherExpress PRO/100 S Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1229_8086_3012[] = "EtherExpress PRO/100 Network Connection";
-#endif
-static const char pci_device_8086_122d[] = "430FX - 82437FX TSC [Triton I]";
-static const char pci_device_8086_122e[] = "82371FB PIIX ISA [Triton I]";
-static const char pci_device_8086_1230[] = "82371FB PIIX IDE [Triton I]";
-static const char pci_device_8086_1231[] = "DSVD Modem";
-static const char pci_device_8086_1234[] = "430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)";
-static const char pci_device_8086_1235[] = "430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)";
-static const char pci_device_8086_1237[] = "440FX - 82441FX PMC [Natoma]";
-static const char pci_device_8086_1239[] = "82371FB";
-static const char pci_device_8086_123b[] = "82380PB";
-static const char pci_device_8086_123c[] = "82380AB";
-static const char pci_device_8086_123d[] = "683053 Programmable Interrupt Device";
-static const char pci_device_8086_123f[] = "82466GX Integrated Hot-Plug Controller (IHPC)";
-static const char pci_device_8086_1240[] = "752 AGP";
-static const char pci_device_8086_124b[] = "82380FB";
-static const char pci_device_8086_1250[] = "430HX - 82439HX TXC [Triton II]";
-static const char pci_device_8086_1360[] = "82806AA PCI64 Hub PCI Bridge";
-static const char pci_device_8086_1361[] = "82806AA PCI64 Hub Controller (HRes)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1361_8086_1361[] = "82806AA PCI64 Hub Controller (HRes)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1361_8086_8000[] = "82806AA PCI64 Hub Controller (HRes)";
-#endif
-static const char pci_device_8086_1460[] = "82870P2 P64H2 Hub PCI Bridge";
-static const char pci_device_8086_1461[] = "82870P2 P64H2 I/OxAPIC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1461_15d9_3480[] = "P4DP6";
-#endif
-static const char pci_device_8086_1462[] = "82870P2 P64H2 Hot Plug Controller";
-static const char pci_device_8086_1960[] = "80960RP [i960RP Microprocessor]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0431[] = "MegaRAID 431 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0438[] = "MegaRAID 438 Ultra2 LVD RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0466[] = "MegaRAID 466 Express Plus RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0467[] = "MegaRAID 467 Enterprise 1500 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0490[] = "MegaRAID 490 Express 300 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_0762[] = "MegaRAID 762 Express RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_101e_09a0[] = "PowerEdge Expandable RAID Controller 2/SC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_1028_0467[] = "PowerEdge Expandable RAID Controller 2/DC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_1028_1111[] = "PowerEdge Expandable RAID Controller 2/SC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_103c_03a2[] = "MegaRAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_103c_10c6[] = "MegaRAID 438, HP NetRAID-3Si";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_103c_10c7[] = "MegaRAID T5, Integrated HP NetRAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_103c_10cc[] = "MegaRAID, Integrated HP NetRAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_103c_10cd[] = "HP NetRAID-1Si";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_105a_0000[] = "SuperTrak";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_105a_2168[] = "SuperTrak Pro";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_105a_5168[] = "SuperTrak66/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_1111_1111[] = "MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_1111_1112[] = "PowerEdge Expandable RAID Controller 2/SC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1960_113c_03a2[] = "MegaRAID";
-#endif
-static const char pci_device_8086_1962[] = "80960RM [i960RM Microprocessor]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_1962_105a_0000[] = "SuperTrak SX6000 I2O CPU";
-#endif
-static const char pci_device_8086_1a21[] = "82840 840 (Carmel) Chipset Host Bridge (Hub A)";
-static const char pci_device_8086_1a23[] = "82840 840 (Carmel) Chipset AGP Bridge";
-static const char pci_device_8086_1a24[] = "82840 840 (Carmel) Chipset PCI Bridge (Hub B)";
-static const char pci_device_8086_1a30[] = "82845 845 (Brookdale) Chipset Host Bridge";
-static const char pci_device_8086_1a31[] = "82845 845 (Brookdale) Chipset AGP Bridge";
-static const char pci_device_8086_2410[] = "82801AA ISA Bridge (LPC)";
-static const char pci_device_8086_2411[] = "82801AA IDE";
-static const char pci_device_8086_2412[] = "82801AA USB";
-static const char pci_device_8086_2413[] = "82801AA SMBus";
-static const char pci_device_8086_2415[] = "82801AA AC'97 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2415_1028_0095[] = "Precision Workstation 220 Integrated Digital Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2415_11d4_0040[] = "SoundMAX Integrated Digital Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2415_11d4_0048[] = "SoundMAX Integrated Digital Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2415_11d4_5340[] = "SoundMAX Integrated Digital Audio";
-#endif
-static const char pci_device_8086_2416[] = "82801AA AC'97 Modem";
-static const char pci_device_8086_2418[] = "82801AA PCI Bridge";
-static const char pci_device_8086_2420[] = "82801AB ISA Bridge (LPC)";
-static const char pci_device_8086_2421[] = "82801AB IDE";
-static const char pci_device_8086_2422[] = "82801AB USB";
-static const char pci_device_8086_2423[] = "82801AB SMBus";
-static const char pci_device_8086_2425[] = "82801AB AC'97 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2425_11d4_0040[] = "SoundMAX Integrated Digital Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2425_11d4_0048[] = "SoundMAX Integrated Digital Audio";
-#endif
-static const char pci_device_8086_2426[] = "82801AB AC'97 Modem";
-static const char pci_device_8086_2428[] = "82801AB PCI Bridge";
-static const char pci_device_8086_2440[] = "82801BA ISA Bridge (LPC)";
-static const char pci_device_8086_2442[] = "82801BA/BAM USB (Hub #1)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_1014_01c6[] = "Netvista A40/A40p";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_147b_0507[] = "TH7II-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_8086_4532[] = "D815EEA2 mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2442_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_2443[] = "82801BA/BAM SMBus";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_1014_01c6[] = "Netvista A40/A40p";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_1043_8027[] = "TUSL2-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_147b_0507[] = "TH7II-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_8086_4532[] = "D815EEA2 mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2443_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_2444[] = "82801BA/BAM USB (Hub #2)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2444_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2444_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2444_147b_0507[] = "TH7II-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2444_8086_4532[] = "D815EEA2 mainboard";
-#endif
-static const char pci_device_8086_2445[] = "82801BA/BAM AC'97 Audio";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_1014_01c6[] = "Netvista A40/A40p";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_104d_80df[] = "Vaio PCG-FX403";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_1462_3370[] = "STAC9721 AC";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_147b_0507[] = "TH7II-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2445_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_2446[] = "Intel 537 [82801BA/BAM AC'97 Modem]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2446_1025_1016[] = "Travelmate 612 TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2446_104d_80df[] = "Vaio PCG-FX403";
-#endif
-static const char pci_device_8086_2448[] = "82801BAM/CAM PCI Bridge";
-static const char pci_device_8086_2449[] = "82801BA/BAM/CA/CAM Ethernet Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_0e11_0012[] = "EtherExpress PRO/100 VM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_0e11_0091[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_01ce[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_01dc[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_01eb[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_01ec[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0202[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0205[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0217[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0234[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_023d[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0244[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0245[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0265[] = "PRO/100 VE Desktop Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_0267[] = "PRO/100 VE Desktop Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1014_026a[] = "PRO/100 VE Desktop Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_109f_315d[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_109f_3181[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1179_ff01[] = "PRO/100 VE Network Connection";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_1186_7801[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_144d_2602[] = "HomePNA 1M CNR";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3010[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3011[] = "EtherExpress PRO/100 VM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3012[] = "82562EH based Phoneline";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3013[] = "EtherExpress PRO/100 VE";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3014[] = "EtherExpress PRO/100 VM";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3015[] = "82562EH based Phoneline";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3016[] = "EtherExpress PRO/100 P Mobile Combo";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3017[] = "EtherExpress PRO/100 P Mobile";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2449_8086_3018[] = "EtherExpress PRO/100";
-#endif
-static const char pci_device_8086_244a[] = "82801BAM IDE U100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244a_1025_1016[] = "Travelmate 612TX";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244a_104d_80df[] = "Vaio PCG-FX403";
-#endif
-static const char pci_device_8086_244b[] = "82801BA IDE U100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244b_1014_01c6[] = "Netvista A40/A40p";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244b_1043_8027[] = "TUSL2-C Mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244b_147b_0507[] = "TH7II-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244b_8086_4532[] = "D815EEA2 mainboard";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_244b_8086_4557[] = "D815EGEW Mainboard";
-#endif
-static const char pci_device_8086_244c[] = "82801BAM ISA Bridge (LPC)";
-static const char pci_device_8086_244e[] = "82801BA/CA/DB/EB PCI Bridge";
-static const char pci_device_8086_2450[] = "82801E ISA Bridge (LPC)";
-static const char pci_device_8086_2452[] = "82801E USB";
-static const char pci_device_8086_2453[] = "82801E SMBus";
-static const char pci_device_8086_2459[] = "82801E Ethernet Controller 0";
-static const char pci_device_8086_245b[] = "82801E IDE U100";
-static const char pci_device_8086_245d[] = "82801E Ethernet Controller 1";
-static const char pci_device_8086_245e[] = "82801E PCI Bridge";
-static const char pci_device_8086_2480[] = "82801CA LPC Interface Controller";
-static const char pci_device_8086_2482[] = "82801CA/CAM USB (Hub #1)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2482_1014_0220[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2482_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2482_15d9_3480[] = "P4DP6";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2482_8086_1958[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_2483[] = "82801CA/CAM SMBus Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2483_1014_0220[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2483_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2483_15d9_3480[] = "P4DP6";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2483_8086_1958[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_2484[] = "82801CA/CAM USB (Hub #2)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2484_1014_0220[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2484_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2484_15d9_3480[] = "P4DP6";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2484_8086_1958[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_2485[] = "82801CA/CAM AC'97 Audio Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2485_1014_0222[] = "ThinkPad T23 (2647-4MG) or A30p (2653-64G)";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2485_1014_0508[] = "ThinkPad T30";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2485_1014_051c[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2485_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2485_144d_c006[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_2486[] = "82801CA/CAM AC'97 Modem Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_1014_0223[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_1014_0503[] = "ThinkPad R31 2656BBG";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_1014_051a[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_1179_0001[] = "Toshiba Satellite 1110 Z15 internal Modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_134d_4c21[] = "Dell Inspiron 2100 internal modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_144d_2115[] = "vpr Matrix 170B4 internal modem";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2486_14f1_5421[] = "MD56ORD V.92 MDC Modem";
-#endif
-static const char pci_device_8086_2487[] = "82801CA/CAM USB (Hub #3)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2487_1014_0220[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2487_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2487_15d9_3480[] = "P4DP6";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2487_8086_1958[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_248a[] = "82801CAM IDE U100";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_248a_1014_0220[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_248a_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_248a_8086_1958[] = "vpr Matrix 170B4";
-#endif
-static const char pci_device_8086_248b[] = "82801CA Ultra ATA Storage Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_248b_15d9_3480[] = "P4DP6";
-#endif
-static const char pci_device_8086_248c[] = "82801CAM ISA Bridge (LPC)";
-static const char pci_device_8086_24c0[] = "82801DB LPC Interface Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c0_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24c2[] = "82801DB USB (Hub #1)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c2_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24c3[] = "82801DB/DBM SMBus Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c3_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24c4[] = "82801DB USB (Hub #2)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c4_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24c5[] = "82801DB AC'97 Audio Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c5_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24c6[] = "82801DB AC'97 Modem Controller";
-static const char pci_device_8086_24c7[] = "82801DB USB (Hub #3)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24c7_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24ca[] = "82801DBM Ultra ATA Storage Controller";
-static const char pci_device_8086_24cb[] = "82801DB Ultra ATA Storage Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24cb_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_24cc[] = "82801DBM LPC Interface Controller";
-static const char pci_device_8086_24cd[] = "82801DB USB2";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_24cd_1462_3981[] = "845PE Max (MS-6580) Onboard USB EHCI Controller";
-#endif
-static const char pci_device_8086_24d0[] = "82801EB LPC Interface Controller";
-static const char pci_device_8086_24d1[] = "82801EB Ultra ATA Storage Controller";
-static const char pci_device_8086_24d2[] = "82801EB USB";
-static const char pci_device_8086_24d3[] = "82801EB SMBus Controller";
-static const char pci_device_8086_24d4[] = "82801EB USB";
-static const char pci_device_8086_24d5[] = "82801EB AC'97 Audio Controller";
-static const char pci_device_8086_24d6[] = "82801EB AC'97 Modem Controller";
-static const char pci_device_8086_24d7[] = "82801EB USB";
-static const char pci_device_8086_24db[] = "82801EB Ultra ATA Storage Controller";
-static const char pci_device_8086_24dc[] = "82801EB LPC Interface Controller";
-static const char pci_device_8086_24dd[] = "82801EB USB2";
-static const char pci_device_8086_24de[] = "82801EB USB";
-static const char pci_device_8086_2500[] = "82820 820 (Camino) Chipset Host Bridge (MCH)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2500_1028_0095[] = "Precision Workstation 220 Chipset";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2500_1043_801c[] = "P3C-2000 system chipset";
-#endif
-static const char pci_device_8086_2501[] = "82820 820 (Camino) Chipset Host Bridge (MCH)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2501_1043_801c[] = "P3C-2000 system chipset";
-#endif
-static const char pci_device_8086_250b[] = "82820 820 (Camino) Chipset Host Bridge";
-static const char pci_device_8086_250f[] = "82820 820 (Camino) Chipset AGP Bridge";
-static const char pci_device_8086_2520[] = "82805AA MTH Memory Translator Hub";
-static const char pci_device_8086_2521[] = "82804AA MRH-S Memory Repeater Hub for SDRAM";
-static const char pci_device_8086_2530[] = "82850 850 (Tehama) Chipset Host Bridge (MCH)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2530_147b_0507[] = "TH7II-RAID";
-#endif
-static const char pci_device_8086_2531[] = "82860 860 (Wombat) Chipset Host Bridge (MCH)";
-static const char pci_device_8086_2532[] = "82850 850 (Tehama) Chipset AGP Bridge";
-static const char pci_device_8086_2533[] = "82860 860 (Wombat) Chipset AGP Bridge";
-static const char pci_device_8086_2534[] = "82860 860 (Wombat) Chipset PCI Bridge";
-static const char pci_device_8086_2540[] = "E7500 Memory Controller Hub";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2540_15d9_3480[] = "P4DP6";
-#endif
-static const char pci_device_8086_2541[] = "E7000 Series Host RASUM Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2541_15d9_3480[] = "P4DP6";
-#endif
-static const char pci_device_8086_2543[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge";
-static const char pci_device_8086_2544[] = "E7000 Series Hub Interface B RASUM Controller";
-static const char pci_device_8086_2545[] = "E7000 Series Hub Interface C PCI-to-PCI Bridge";
-static const char pci_device_8086_2546[] = "E7000 Series Hub Interface C RASUM Controller";
-static const char pci_device_8086_2547[] = "E7000 Series Hub Interface D PCI-to-PCI Bridge";
-static const char pci_device_8086_2548[] = "E7000 Series Hub Interface D RASUM Controller";
-static const char pci_device_8086_254c[] = "E7501 Memory Controller Hub";
-static const char pci_device_8086_2550[] = "E7505 Memory Controller Hub";
-static const char pci_device_8086_2551[] = "E7000 Series RAS Controller";
-static const char pci_device_8086_2552[] = "E7000 Series Processor to AGP Controller";
-static const char pci_device_8086_2553[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge";
-static const char pci_device_8086_2554[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller";
-static const char pci_device_8086_255d[] = "E7205 Memory Controller Hub";
-static const char pci_device_8086_2560[] = "82845G/GL [Brookdale-G] Chipset Host Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_2560_1462_5800[] = "845PE Max (MS-6580)";
-#endif
-static const char pci_device_8086_2561[] = "82845G/GL [Brookdale-G] Chipset AGP Bridge";
-static const char pci_device_8086_2562[] = "82845G/GL [Brookdale-G] Chipset Integrated Graphics Device";
-static const char pci_device_8086_2570[] = "82865G/PE/P Processor to I/O Controller";
-static const char pci_device_8086_2571[] = "82865G/PE/P Processor to AGP Controller";
-static const char pci_device_8086_2572[] = "82865G Integrated Graphics Device";
-static const char pci_device_8086_2573[] = "82865G/PE/P Processor to PCI to CSA Bridge";
-static const char pci_device_8086_2576[] = "82864G/PE/P Processor to I/O Memory Interface";
-static const char pci_device_8086_2578[] = "82875P Memory Controller Hub";
-static const char pci_device_8086_2579[] = "82875P Processor to AGP Controller";
-static const char pci_device_8086_257b[] = "82875P Processor to PCI to CSA Bridge";
-static const char pci_device_8086_257e[] = "82875P Processor to I/O Memory Interface";
-static const char pci_device_8086_3092[] = "Integrated RAID";
-static const char pci_device_8086_3340[] = "82855PM Processor to I/O Controller";
-static const char pci_device_8086_3341[] = "82855PM Processor to AGP Controller";
-static const char pci_device_8086_3575[] = "82830 830 Chipset Host Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_3575_1014_021d[] = "ThinkPad A/T/X Series";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_3575_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
-#endif
-static const char pci_device_8086_3576[] = "82830 830 Chipset AGP Bridge";
-static const char pci_device_8086_3577[] = "82830 CGC [Chipset Graphics Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_3577_1014_0513[] = "ThinkPad A/T/X Series";
-#endif
-static const char pci_device_8086_3578[] = "82830 830 Chipset Host Bridge";
-static const char pci_device_8086_3580[] = "82852/855GM Host Bridge";
-static const char pci_device_8086_3582[] = "82852/855GM Integrated Graphics Device";
-static const char pci_device_8086_5200[] = "EtherExpress PRO/100 Intelligent Server";
-static const char pci_device_8086_5201[] = "EtherExpress PRO/100 Intelligent Server";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_5201_8086_0001[] = "EtherExpress PRO/100 Server Ethernet Adapter";
-#endif
-static const char pci_device_8086_530d[] = "80310 IOP [IO Processor]";
-static const char pci_device_8086_7000[] = "82371SB PIIX3 ISA [Natoma/Triton II]";
-static const char pci_device_8086_7010[] = "82371SB PIIX3 IDE [Natoma/Triton II]";
-static const char pci_device_8086_7020[] = "82371SB PIIX3 USB [Natoma/Triton II]";
-static const char pci_device_8086_7030[] = "430VX - 82437VX TVX [Triton VX]";
-static const char pci_device_8086_7100[] = "430TX - 82439TX MTXC";
-static const char pci_device_8086_7110[] = "82371AB/EB/MB PIIX4 ISA";
-static const char pci_device_8086_7111[] = "82371AB/EB/MB PIIX4 IDE";
-static const char pci_device_8086_7112[] = "82371AB/EB/MB PIIX4 USB";
-static const char pci_device_8086_7113[] = "82371AB/EB/MB PIIX4 ACPI";
-static const char pci_device_8086_7120[] = "82810 GMCH [Graphics Memory Controller Hub]";
-static const char pci_device_8086_7121[] = "82810 CGC [Chipset Graphics Controller]";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7121_8086_4341[] = "Cayman (CA810) Mainboard";
-#endif
-static const char pci_device_8086_7122[] = "82810 DC-100 GMCH [Graphics Memory Controller Hub]";
-static const char pci_device_8086_7123[] = "82810 DC-100 CGC [Chipset Graphics Controller]";
-static const char pci_device_8086_7124[] = "82810E DC-133 GMCH [Graphics Memory Controller Hub]";
-static const char pci_device_8086_7125[] = "82810E DC-133 CGC [Chipset Graphics Controller]";
-static const char pci_device_8086_7126[] = "82810 DC-133 System and Graphics Controller";
-static const char pci_device_8086_7128[] = "82810-M DC-100 System and Graphics Controller";
-static const char pci_device_8086_712a[] = "82810-M DC-133 System and Graphics Controller";
-static const char pci_device_8086_7180[] = "440LX/EX - 82443LX/EX Host bridge";
-static const char pci_device_8086_7181[] = "440LX/EX - 82443LX/EX AGP bridge";
-static const char pci_device_8086_7190[] = "440BX/ZX/DX - 82443BX/ZX/DX Host bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7190_0e11_0500[] = "Armada 1750 Laptop System Chipset";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7190_0e11_b110[] = "Armada M700";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7190_1179_0001[] = "Toshiba Tecra 8100 Laptop System Chipset";
-#endif
-static const char pci_device_8086_7191[] = "440BX/ZX/DX - 82443BX/ZX/DX AGP bridge";
-static const char pci_device_8086_7192[] = "440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7192_0e11_0460[] = "Armada 1700 Laptop System Chipset";
-#endif
-static const char pci_device_8086_7194[] = "82440MX Host Bridge";
-static const char pci_device_8086_7195[] = "82440MX AC'97 Audio Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7195_10cf_1099[] = "QSound_SigmaTel Stac97 PCI Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7195_11d4_0040[] = "SoundMAX Integrated Digital Audio";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7195_11d4_0048[] = "SoundMAX Integrated Digital Audio";
-#endif
-static const char pci_device_8086_7196[] = "82440MX AC'97 Modem Controller";
-static const char pci_device_8086_7198[] = "82440MX ISA Bridge";
-static const char pci_device_8086_7199[] = "82440MX EIDE Controller";
-static const char pci_device_8086_719a[] = "82440MX USB Universal Host Controller";
-static const char pci_device_8086_719b[] = "82440MX Power Management Controller";
-static const char pci_device_8086_71a0[] = "440GX - 82443GX Host bridge";
-static const char pci_device_8086_71a1[] = "440GX - 82443GX AGP bridge";
-static const char pci_device_8086_71a2[] = "440GX - 82443GX Host bridge (AGP disabled)";
-static const char pci_device_8086_7600[] = "82372FB PIIX5 ISA";
-static const char pci_device_8086_7601[] = "82372FB PIIX5 IDE";
-static const char pci_device_8086_7602[] = "82372FB PIIX5 USB";
-static const char pci_device_8086_7603[] = "82372FB PIIX5 SMBus";
-static const char pci_device_8086_7800[] = "i740";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_003d_0008[] = "Starfighter AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_003d_000b[] = "Starfighter AGP";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_1092_0100[] = "Stealth II G460";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_10b4_201a[] = "Lightspeed 740";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_10b4_202f[] = "Lightspeed 740";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_8086_0000[] = "Terminator 2x/i";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_7800_8086_0100[] = "Intel740 Graphics Accelerator";
-#endif
-static const char pci_device_8086_84c4[] = "450KX/GX [Orion] - 82454KX/GX PCI bridge";
-static const char pci_device_8086_84c5[] = "450KX/GX [Orion] - 82453KX/GX Memory controller";
-static const char pci_device_8086_84ca[] = "450NX - 82451NX Memory & I/O Controller";
-static const char pci_device_8086_84cb[] = "450NX - 82454NX/84460GX PCI Expander Bridge";
-static const char pci_device_8086_84e0[] = "460GX - 84460GX System Address Controller (SAC)";
-static const char pci_device_8086_84e1[] = "460GX - 84460GX System Data Controller (SDC)";
-static const char pci_device_8086_84e2[] = "460GX - 84460GX AGP Bridge (GXB function 2)";
-static const char pci_device_8086_84e3[] = "460GX - 84460GX Memory Address Controller (MAC)";
-static const char pci_device_8086_84e4[] = "460GX - 84460GX Memory Data Controller (MDC)";
-static const char pci_device_8086_84e6[] = "460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)";
-static const char pci_device_8086_84ea[] = "460GX - 84460GX AGP Bridge (GXB function 1)";
-static const char pci_device_8086_9621[] = "Integrated RAID";
-static const char pci_device_8086_9622[] = "Integrated RAID";
-static const char pci_device_8086_9641[] = "Integrated RAID";
-static const char pci_device_8086_96a1[] = "Integrated RAID";
-static const char pci_device_8086_b152[] = "21152 PCI-to-PCI Bridge";
-static const char pci_device_8086_b154[] = "21154 PCI-to-PCI Bridge";
-static const char pci_device_8086_b555[] = "21555 Non transparent PCI-to-PCI Bridge";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_8086_b555_e4bf_1000[] = "CC8-1-BLUES";
-#endif
-static const char pci_device_8086_ffff[] = "450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8800[] = "Trigem Computer Inc.";
-static const char pci_device_8800_2008[] = "Video assistent component";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8866[] = "T-Square Design Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8888[] = "Silicon Magic";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8e0e[] = "Computone Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_8e2e[] = "KTI";
-static const char pci_device_8e2e_3000[] = "ET32P2";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_9004[] = "Adaptec";
-static const char pci_device_9004_1078[] = "AIC-7810";
-static const char pci_device_9004_1160[] = "AIC-1160 [Family Fibre Channel Adapter]";
-static const char pci_device_9004_2178[] = "AIC-7821";
-static const char pci_device_9004_3860[] = "AHA-2930CU";
-static const char pci_device_9004_3b78[] = "AHA-4844W/4844UW";
-static const char pci_device_9004_5075[] = "AIC-755x";
-static const char pci_device_9004_5078[] = "AHA-7850";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_5078_9004_7850[] = "AHA-2904/Integrated AIC-7850";
-#endif
-static const char pci_device_9004_5175[] = "AIC-755x";
-static const char pci_device_9004_5178[] = "AIC-7851";
-static const char pci_device_9004_5275[] = "AIC-755x";
-static const char pci_device_9004_5278[] = "AIC-7852";
-static const char pci_device_9004_5375[] = "AIC-755x";
-static const char pci_device_9004_5378[] = "AIC-7850";
-static const char pci_device_9004_5475[] = "AIC-755x";
-static const char pci_device_9004_5478[] = "AIC-7850";
-static const char pci_device_9004_5575[] = "AVA-2930";
-static const char pci_device_9004_5578[] = "AIC-7855";
-static const char pci_device_9004_5675[] = "AIC-755x";
-static const char pci_device_9004_5678[] = "AIC-7856";
-static const char pci_device_9004_5775[] = "AIC-755x";
-static const char pci_device_9004_5778[] = "AIC-7850";
-static const char pci_device_9004_5800[] = "AIC-5800";
-static const char pci_device_9004_5900[] = "ANA-5910/5930/5940 ATM155 & 25 LAN Adapter";
-static const char pci_device_9004_5905[] = "ANA-5910A/5930A/5940A ATM Adapter";
-static const char pci_device_9004_6038[] = "AIC-3860";
-static const char pci_device_9004_6075[] = "AIC-1480 / APA-1480";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6075_9004_7560[] = "AIC-1480 / APA-1480 Cardbus";
-#endif
-static const char pci_device_9004_6078[] = "AIC-7860";
-static const char pci_device_9004_6178[] = "AIC-7861";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6178_9004_7861[] = "AHA-2940AU Single";
-#endif
-static const char pci_device_9004_6278[] = "AIC-7860";
-static const char pci_device_9004_6378[] = "AIC-7860";
-static const char pci_device_9004_6478[] = "AIC-786x";
-static const char pci_device_9004_6578[] = "AIC-786x";
-static const char pci_device_9004_6678[] = "AIC-786x";
-static const char pci_device_9004_6778[] = "AIC-786x";
-static const char pci_device_9004_6915[] = "ANA620xx/ANA69011A";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0008[] = "ANA69011A/TX 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0009[] = "ANA69011A/TX 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0010[] = "ANA62022 2-port 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0018[] = "ANA62044 4-port 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0019[] = "ANA62044 4-port 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0020[] = "ANA62022 2-port 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_0028[] = "ANA69011A/TX 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8008[] = "ANA69011A/TX 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8009[] = "ANA69011A/TX 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8010[] = "ANA62022 2-port 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8018[] = "ANA62044 4-port 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8019[] = "ANA62044 4-port 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8020[] = "ANA62022 2-port 64 bit 10/100";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_6915_9004_8028[] = "ANA69011A/TX 64 bit 10/100";
-#endif
-static const char pci_device_9004_7078[] = "AHA-294x / AIC-7870";
-static const char pci_device_9004_7178[] = "AHA-2940/2940W / AIC-7871";
-static const char pci_device_9004_7278[] = "AHA-3940/3940W / AIC-7872";
-static const char pci_device_9004_7378[] = "AHA-3985 / AIC-7873";
-static const char pci_device_9004_7478[] = "AHA-2944/2944W / AIC-7874";
-static const char pci_device_9004_7578[] = "AHA-3944/3944W / AIC-7875";
-static const char pci_device_9004_7678[] = "AHA-4944W/UW / AIC-7876";
-static const char pci_device_9004_7710[] = "ANA-7711F Network Accelerator Card (NAC) - Optical";
-static const char pci_device_9004_7711[] = "ANA-7711C Network Accelerator Card (NAC) - Copper";
-static const char pci_device_9004_7778[] = "AIC-787x";
-static const char pci_device_9004_7810[] = "AIC-7810";
-static const char pci_device_9004_7815[] = "AIC-7815 RAID+Memory Controller IC";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7815_9004_7815[] = "ARO-1130U2 RAID Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7815_9004_7840[] = "AIC-7815 RAID+Memory Controller IC";
-#endif
-static const char pci_device_9004_7850[] = "AIC-7850";
-static const char pci_device_9004_7855[] = "AHA-2930";
-static const char pci_device_9004_7860[] = "AIC-7860";
-static const char pci_device_9004_7870[] = "AIC-7870";
-static const char pci_device_9004_7871[] = "AHA-2940";
-static const char pci_device_9004_7872[] = "AHA-3940";
-static const char pci_device_9004_7873[] = "AHA-3980";
-static const char pci_device_9004_7874[] = "AHA-2944";
-static const char pci_device_9004_7880[] = "AIC-7880P";
-static const char pci_device_9004_7890[] = "AIC-7890";
-static const char pci_device_9004_7891[] = "AIC-789x";
-static const char pci_device_9004_7892[] = "AIC-789x";
-static const char pci_device_9004_7893[] = "AIC-789x";
-static const char pci_device_9004_7894[] = "AIC-789x";
-static const char pci_device_9004_7895[] = "AHA-2940U/UW / AHA-39xx / AIC-7895";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7890[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7891[] = "AHA-2940U/2940UW Dual";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7892[] = "AHA-3940AU/AUW/AUWD/UWD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7894[] = "AHA-3944AUWD";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7895[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7896[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_7895_9004_7897[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
-#endif
-static const char pci_device_9004_7896[] = "AIC-789x";
-static const char pci_device_9004_7897[] = "AIC-789x";
-static const char pci_device_9004_8078[] = "AIC-7880U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_8078_9004_7880[] = "AIC-7880P Ultra/Ultra Wide SCSI Chipset";
-#endif
-static const char pci_device_9004_8178[] = "AHA-2940U/UW/D / AIC-7881U";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_8178_9004_7881[] = "AHA-2940UW SCSI Host Adapter";
-#endif
-static const char pci_device_9004_8278[] = "AHA-3940U/UW/UWD / AIC-7882U";
-static const char pci_device_9004_8378[] = "AHA-3940U/UW / AIC-7883U";
-static const char pci_device_9004_8478[] = "AHA-2944UW / AIC-7884U";
-static const char pci_device_9004_8578[] = "AHA-3944U/UWD / AIC-7885";
-static const char pci_device_9004_8678[] = "AHA-4944UW / AIC-7886";
-static const char pci_device_9004_8778[] = "AHA-2940UW Pro / AIC-788x";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_8778_9004_7887[] = "2940UW Pro Ultra-Wide SCSI Controller";
-#endif
-static const char pci_device_9004_8878[] = "AHA-2930UW / AIC-7888";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9004_8878_9004_7888[] = "AHA-2930UW SCSI Controller";
-#endif
-static const char pci_device_9004_8b78[] = "ABA-1030";
-static const char pci_device_9004_ec78[] = "AHA-4944W/UW";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_9005[] = "Adaptec";
-static const char pci_device_9005_0010[] = "AHA-2940U2/U2W";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0010_9005_2180[] = "AHA-2940U2 SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0010_9005_8100[] = "AHA-2940U2B SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0010_9005_a180[] = "AHA-2940U2W SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0010_9005_e100[] = "AHA-2950U2B SCSI Controller";
-#endif
-static const char pci_device_9005_0011[] = "AHA-2930U2";
-static const char pci_device_9005_0013[] = "78902";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0013_9005_0003[] = "AAA-131U2 Array1000 1 Channel RAID Controller";
-#endif
-static const char pci_device_9005_001f[] = "AHA-2940U2/U2W / 7890/7891";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_001f_9005_000f[] = "2940U2W SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_001f_9005_a180[] = "2940U2W SCSI Controller";
-#endif
-static const char pci_device_9005_0020[] = "AIC-7890";
-static const char pci_device_9005_002f[] = "AIC-7890";
-static const char pci_device_9005_0030[] = "AIC-7890";
-static const char pci_device_9005_003f[] = "AIC-7890";
-static const char pci_device_9005_0050[] = "AHA-3940U2x/395U2x";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0050_9005_f500[] = "AHA-3950U2B";
-#endif
-static const char pci_device_9005_0051[] = "AHA-3950U2D";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0051_9005_b500[] = "AHA-3950U2D";
-#endif
-static const char pci_device_9005_0053[] = "AIC-7896 SCSI Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0053_9005_ffff[] = "AIC-7896 SCSI Controller mainboard implementation";
-#endif
-static const char pci_device_9005_005f[] = "AIC-7896U2/7897U2";
-static const char pci_device_9005_0080[] = "AIC-7892A U160/m";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0080_0e11_e2a0[] = "Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0080_9005_62a0[] = "29160N Ultra160 SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0080_9005_e220[] = "29160LP Low Profile Ultra160 SCSI Controller";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0080_9005_e2a0[] = "29160 Ultra160 SCSI Controller";
-#endif
-static const char pci_device_9005_0081[] = "AIC-7892B U160/m";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0081_9005_62a1[] = "19160 Ultra160 SCSI Controller";
-#endif
-static const char pci_device_9005_0083[] = "AIC-7892D U160/m";
-static const char pci_device_9005_008f[] = "AIC-7892P U160/m";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_008f_1179_0001[] = "Magnia Z310";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_008f_15d9_9005[] = "Onboard SCSI Host Adapter";
-#endif
-static const char pci_device_9005_00c0[] = "AHA-3960D / AIC-7899A U160/m";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00c0_0e11_f620[] = "Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00c0_9005_f620[] = "AHA-3960D U160/m";
-#endif
-static const char pci_device_9005_00c1[] = "AIC-7899B U160/m";
-static const char pci_device_9005_00c3[] = "AIC-7899D U160/m";
-static const char pci_device_9005_00c5[] = "RAID subsystem HBA";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00c5_1028_00c5[] = "PowerEdge 2550";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_9005_00cf[] = "AIC-7899P U160/m";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00cf_1028_00d1[] = "PowerEdge 2550";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00cf_10f1_2462[] = "Thunder K7 S2462";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_00cf_15d9_9005[] = "Onboard SCSI Host Adapter";
-#endif
-static const char pci_device_9005_0250[] = "ServeRAID Controller";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0250_1014_0279[] = "ServeRAID-xx";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0250_1014_028c[] = "ServeRAID-xx";
-#endif
-static const char pci_device_9005_0285[] = "AAC-RAID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_0285_1028_0287[] = "PowerEdge Expandable RAID Controller 320/DC";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_device_9005_8000[] = "ASC-29320A U320";
-static const char pci_device_9005_800f[] = "AIC-7901 U320";
-static const char pci_device_9005_8010[] = "ASC-39320 U320";
-static const char pci_device_9005_8011[] = "ASC-32320D U320";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_8011_0e11_00ac[] = "U320";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_9005_8011_9005_0041[] = "ASC-39320D U320";
-#endif
-static const char pci_device_9005_8012[] = "ASC-29320 U320";
-static const char pci_device_9005_8013[] = "ASC-29320B U320";
-static const char pci_device_9005_8014[] = "ASC-29320LP U320";
-static const char pci_device_9005_801e[] = "AIC-7901A U320";
-static const char pci_device_9005_801f[] = "AIC-7902 U320";
-static const char pci_device_9005_8080[] = "ASC-29320A U320 w/HostRAID";
-static const char pci_device_9005_808f[] = "AIC-7901 U320 w/HostRAID";
-static const char pci_device_9005_8090[] = "ASC-39320 U320 w/HostRAID";
-static const char pci_device_9005_8091[] = "ASC-39320D U320 w/HostRAID";
-static const char pci_device_9005_8092[] = "ASC-29320 U320 w/HostRAID";
-static const char pci_device_9005_8093[] = "ASC-29320B U320 w/HostRAID";
-static const char pci_device_9005_8094[] = "ASC-29320LP U320 w/HostRAID";
-static const char pci_device_9005_8095[] = "ASC-39320(B) U320 w/HostRAID";
-static const char pci_device_9005_8096[] = "ASC-39320A U320 w/HostRAID";
-static const char pci_device_9005_8097[] = "ASC-29320ALP U320 w/HostRAID";
-static const char pci_device_9005_809c[] = "ASC-39320D(B) U320 w/HostRAID";
-static const char pci_device_9005_809d[] = "AIC-7902(B) U320 w/HostRAID";
-static const char pci_device_9005_809e[] = "AIC-7901A U320 w/HostRAID";
-static const char pci_device_9005_809f[] = "AIC-7902 U320 w/HostRAID";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_907f[] = "Atronics";
-static const char pci_device_907f_2015[] = "IDE-2015PL";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_919a[] = "Gigapixel Corp";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_9412[] = "Holtek";
-static const char pci_device_9412_6565[] = "6565";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_9699[] = "Omni Media Technology Inc";
-static const char pci_device_9699_6565[] = "6565";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_9710[] = "NetMos Technology";
-static const char pci_device_9710_9815[] = "VScom 021H-EP2 2 port parallel adaptor";
-static const char pci_device_9710_9835[] = "222N-2 I/O Card (2S+1P)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a0a0[] = "AOPEN Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a0f1[] = "UNISYS Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a200[] = "NEC Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a259[] = "Hewlett Packard";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a25b[] = "Hewlett Packard GmbH PL24-MKT";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a304[] = "Sony";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_a727[] = "3Com Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_aa42[] = "Scitex Digital Video";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ac1e[] = "Digital Receiver Technology Inc";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_b1b3[] = "Shiva Europe Limited";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_bd11[] = "Pinnacle Systems, Inc. (Wrong ID)";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_c001[] = "TSI Telsys";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_c0a9[] = "Micron/Crucial Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_c0de[] = "Motorola";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_c0fe[] = "Motion Engineering, Inc.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ca50[] = "Varian Australia Pty Ltd";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_cafe[] = "Chrysalis-ITS";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_cccc[] = "Catapult Communications";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_cddd[] = "Tyzx, Inc.";
-static const char pci_device_cddd_0101[] = "DeepSea 1 High Speed Stereo Vision Frame Grabber";
-static const char pci_device_cddd_0200[] = "DeepSea 2 High Speed Stereo Vision Frame Grabber";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_d4d4[] = "Dy4 Systems Inc";
-static const char pci_device_d4d4_0601[] = "PCI Mezzanine Card";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_d531[] = "I+ME ACTIA GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_d84d[] = "Exsys";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_dead[] = "Indigita Corporation";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_e000[] = "Winbond";
-static const char pci_device_e000_e000[] = "W89C940";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_e159[] = "Tiger Jet Network Inc.";
-static const char pci_device_e159_0001[] = "Intel 537";
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_e159_0001_0059_0001[] = "128k ISDN-S/T Adapter";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const char pci_subsys_e159_0001_0059_0003[] = "128k ISDN-U Adapter";
-#endif
-static const char pci_device_e159_0002[] = "Tiger100APC ISDN chipset";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_e4bf[] = "EKF Elektronik GmbH";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ea01[] = "Eagle Technology";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ea60[] = "RME";
-static const char pci_device_ea60_9896[] = "Digi32";
-static const char pci_device_ea60_9897[] = "Digi32 Pro";
-static const char pci_device_ea60_9898[] = "Digi32/8";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_eabb[] = "Aashima Technology B.V.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_eace[] = "Endace Measurement Systems, Ltd";
-static const char pci_device_eace_3100[] = "DAG 3.10 OC-3/OC-12";
-static const char pci_device_eace_3200[] = "DAG 3.2x OC-3/OC-12";
-static const char pci_device_eace_320e[] = "DAG 3.2E Fast Ethernet";
-static const char pci_device_eace_340e[] = "DAG 3.4E Fast Ethernet";
-static const char pci_device_eace_341e[] = "DAG 3.41E Fast Ethernet";
-static const char pci_device_eace_3500[] = "DAG 3.5 OC-3/OC-12";
-static const char pci_device_eace_351c[] = "DAG 3.5ECM Fast Ethernet";
-static const char pci_device_eace_4100[] = "DAG 4.10 OC-48";
-static const char pci_device_eace_4110[] = "DAG 4.11 OC-48";
-static const char pci_device_eace_4220[] = "DAG 4.2 OC-48";
-static const char pci_device_eace_422e[] = "DAG 4.2E Dual Gigabit Ethernet";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ec80[] = "Belkin Corporation";
-static const char pci_device_ec80_ec00[] = "F5D6000";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ecc0[] = "Echo Digital Audio Corporation";
-static const char pci_device_ecc0_0050[] = "Gina24_301";
-static const char pci_device_ecc0_0051[] = "Gina24_361";
-static const char pci_device_ecc0_0060[] = "Layla24";
-static const char pci_device_ecc0_0070[] = "Mona_301_80";
-static const char pci_device_ecc0_0071[] = "Mona_301_66";
-static const char pci_device_ecc0_0072[] = "Mona_361";
-static const char pci_device_ecc0_0080[] = "Mia";
-#endif
-static const char pci_vendor_edd8[] = "ARK Logic Inc";
-static const char pci_device_edd8_a091[] = "1000PV [Stingray]";
-static const char pci_device_edd8_a099[] = "2000PV [Stingray]";
-static const char pci_device_edd8_a0a1[] = "2000MT";
-static const char pci_device_edd8_a0a9[] = "2000MI";
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_f1d0[] = "AJA Video";
-static const char pci_device_f1d0_cafe[] = "KONA SD SMPTE 259M I/O";
-static const char pci_device_f1d0_efac[] = "KONA SD SMPTE 259M I/O";
-static const char pci_device_f1d0_facd[] = "KONA HD SMPTE 292M I/O";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_fa57[] = "Fast Search & Transfer ASA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_febd[] = "Ultraview Corp.";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_feda[] = "Broadcom Inc (nee Epigram)";
-static const char pci_device_feda_a0fa[] = "BCM4210 iLine10 HomePNA 2.0";
-static const char pci_device_feda_a10e[] = "BCM4230 iLine10 HomePNA 2.0";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_fffe[] = "VMWare Inc";
-static const char pci_device_fffe_0710[] = "Virtual SVGA";
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_ffff[] = "Illegal Vendor ID";
-#endif
-#ifdef INIT_SUBSYS_INFO
-static const pciSubsystemInfo pci_ss_info_0e11_a0f7_8086_002a =
- {0x8086, 0x002a, pci_subsys_0e11_a0f7_8086_002a, 0};
-#undef pci_ss_info_8086_002a
-#define pci_ss_info_8086_002a pci_ss_info_0e11_a0f7_8086_002a
-static const pciSubsystemInfo pci_ss_info_0e11_a0f7_8086_002b =
- {0x8086, 0x002b, pci_subsys_0e11_a0f7_8086_002b, 0};
-#undef pci_ss_info_8086_002b
-#define pci_ss_info_8086_002b pci_ss_info_0e11_a0f7_8086_002b
-static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4030 =
- {0x0e11, 0x4030, pci_subsys_0e11_ae10_0e11_4030, 0};
-#undef pci_ss_info_0e11_4030
-#define pci_ss_info_0e11_4030 pci_ss_info_0e11_ae10_0e11_4030
-static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4031 =
- {0x0e11, 0x4031, pci_subsys_0e11_ae10_0e11_4031, 0};
-#undef pci_ss_info_0e11_4031
-#define pci_ss_info_0e11_4031 pci_ss_info_0e11_ae10_0e11_4031
-static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4032 =
- {0x0e11, 0x4032, pci_subsys_0e11_ae10_0e11_4032, 0};
-#undef pci_ss_info_0e11_4032
-#define pci_ss_info_0e11_4032 pci_ss_info_0e11_ae10_0e11_4032
-static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4033 =
- {0x0e11, 0x4033, pci_subsys_0e11_ae10_0e11_4033, 0};
-#undef pci_ss_info_0e11_4033
-#define pci_ss_info_0e11_4033 pci_ss_info_0e11_ae10_0e11_4033
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1000_0001_1000_1000 =
- {0x1000, 0x1000, pci_subsys_1000_0001_1000_1000, 0};
-#undef pci_ss_info_1000_1000
-#define pci_ss_info_1000_1000 pci_ss_info_1000_0001_1000_1000
-static const pciSubsystemInfo pci_ss_info_1000_000c_1de1_3907 =
- {0x1de1, 0x3907, pci_subsys_1000_000c_1de1_3907, 0};
-#undef pci_ss_info_1de1_3907
-#define pci_ss_info_1de1_3907 pci_ss_info_1000_000c_1de1_3907
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_000f_0e11_7004 =
- {0x0e11, 0x7004, pci_subsys_1000_000f_0e11_7004, 0};
-#undef pci_ss_info_0e11_7004
-#define pci_ss_info_0e11_7004 pci_ss_info_1000_000f_0e11_7004
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_000f_1092_8760 =
- {0x1092, 0x8760, pci_subsys_1000_000f_1092_8760, 0};
-#undef pci_ss_info_1092_8760
-#define pci_ss_info_1092_8760 pci_ss_info_1000_000f_1092_8760
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1000_000f_1de1_3904 =
- {0x1de1, 0x3904, pci_subsys_1000_000f_1de1_3904, 0};
-#undef pci_ss_info_1de1_3904
-#define pci_ss_info_1de1_3904 pci_ss_info_1000_000f_1de1_3904
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_0010_0e11_4040 =
- {0x0e11, 0x4040, pci_subsys_1000_0010_0e11_4040, 0};
-#undef pci_ss_info_0e11_4040
-#define pci_ss_info_0e11_4040 pci_ss_info_1000_0010_0e11_4040
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_0010_0e11_4048 =
- {0x0e11, 0x4048, pci_subsys_1000_0010_0e11_4048, 0};
-#undef pci_ss_info_0e11_4048
-#define pci_ss_info_0e11_4048 pci_ss_info_1000_0010_0e11_4048
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1000_0020_1de1_1020 =
- {0x1de1, 0x1020, pci_subsys_1000_0020_1de1_1020, 0};
-#undef pci_ss_info_1de1_1020
-#define pci_ss_info_1de1_1020 pci_ss_info_1000_0020_1de1_1020
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_0030_1028_1010 =
- {0x1028, 0x1010, pci_subsys_1000_0030_1028_1010, 0};
-#undef pci_ss_info_1028_1010
-#define pci_ss_info_1028_1010 pci_ss_info_1000_0030_1028_1010
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_008f_1092_8000 =
- {0x1092, 0x8000, pci_subsys_1000_008f_1092_8000, 0};
-#undef pci_ss_info_1092_8000
-#define pci_ss_info_1092_8000 pci_ss_info_1000_008f_1092_8000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_008f_1092_8760 =
- {0x1092, 0x8760, pci_subsys_1000_008f_1092_8760, 0};
-#undef pci_ss_info_1092_8760
-#define pci_ss_info_1092_8760 pci_ss_info_1000_008f_1092_8760
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1000_0702_1318_0000 =
- {0x1318, 0x0000, pci_subsys_1000_0702_1318_0000, 0};
-#undef pci_ss_info_1318_0000
-#define pci_ss_info_1318_0000 pci_ss_info_1000_0702_1318_0000
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0518 =
- {0x1028, 0x0518, pci_subsys_1000_1960_1028_0518, 0};
-#undef pci_ss_info_1028_0518
-#define pci_ss_info_1028_0518 pci_ss_info_1000_1960_1028_0518
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0520 =
- {0x1028, 0x0520, pci_subsys_1000_1960_1028_0520, 0};
-#undef pci_ss_info_1028_0520
-#define pci_ss_info_1028_0520 pci_ss_info_1000_1960_1028_0520
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0531 =
- {0x1028, 0x0531, pci_subsys_1000_1960_1028_0531, 0};
-#undef pci_ss_info_1028_0531
-#define pci_ss_info_1028_0531 pci_ss_info_1000_1960_1028_0531
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1002_4242_1002_02aa =
- {0x1002, 0x02aa, pci_subsys_1002_4242_1002_02aa, 0};
-#undef pci_ss_info_1002_02aa
-#define pci_ss_info_1002_02aa pci_ss_info_1002_4242_1002_02aa
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0040 =
- {0x1002, 0x0040, pci_subsys_1002_4742_1002_0040, 0};
-#undef pci_ss_info_1002_0040
-#define pci_ss_info_1002_0040 pci_ss_info_1002_4742_1002_0040
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0044 =
- {0x1002, 0x0044, pci_subsys_1002_4742_1002_0044, 0};
-#undef pci_ss_info_1002_0044
-#define pci_ss_info_1002_0044 pci_ss_info_1002_4742_1002_0044
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0061 =
- {0x1002, 0x0061, pci_subsys_1002_4742_1002_0061, 0};
-#undef pci_ss_info_1002_0061
-#define pci_ss_info_1002_0061 pci_ss_info_1002_4742_1002_0061
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0062 =
- {0x1002, 0x0062, pci_subsys_1002_4742_1002_0062, 0};
-#undef pci_ss_info_1002_0062
-#define pci_ss_info_1002_0062 pci_ss_info_1002_4742_1002_0062
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0063 =
- {0x1002, 0x0063, pci_subsys_1002_4742_1002_0063, 0};
-#undef pci_ss_info_1002_0063
-#define pci_ss_info_1002_0063 pci_ss_info_1002_4742_1002_0063
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0080 =
- {0x1002, 0x0080, pci_subsys_1002_4742_1002_0080, 0};
-#undef pci_ss_info_1002_0080
-#define pci_ss_info_1002_0080 pci_ss_info_1002_4742_1002_0080
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0084 =
- {0x1002, 0x0084, pci_subsys_1002_4742_1002_0084, 0};
-#undef pci_ss_info_1002_0084
-#define pci_ss_info_1002_0084 pci_ss_info_1002_4742_1002_0084
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_4742 =
- {0x1002, 0x4742, pci_subsys_1002_4742_1002_4742, 0};
-#undef pci_ss_info_1002_4742
-#define pci_ss_info_1002_4742 pci_ss_info_1002_4742_1002_4742
-static const pciSubsystemInfo pci_ss_info_1002_4742_1002_8001 =
- {0x1002, 0x8001, pci_subsys_1002_4742_1002_8001, 0};
-#undef pci_ss_info_1002_8001
-#define pci_ss_info_1002_8001 pci_ss_info_1002_4742_1002_8001
-static const pciSubsystemInfo pci_ss_info_1002_4742_1028_0082 =
- {0x1028, 0x0082, pci_subsys_1002_4742_1028_0082, 0};
-#undef pci_ss_info_1028_0082
-#define pci_ss_info_1028_0082 pci_ss_info_1002_4742_1028_0082
-static const pciSubsystemInfo pci_ss_info_1002_4742_1028_4082 =
- {0x1028, 0x4082, pci_subsys_1002_4742_1028_4082, 0};
-#undef pci_ss_info_1028_4082
-#define pci_ss_info_1028_4082 pci_ss_info_1002_4742_1028_4082
-static const pciSubsystemInfo pci_ss_info_1002_4742_1028_8082 =
- {0x1028, 0x8082, pci_subsys_1002_4742_1028_8082, 0};
-#undef pci_ss_info_1028_8082
-#define pci_ss_info_1028_8082 pci_ss_info_1002_4742_1028_8082
-static const pciSubsystemInfo pci_ss_info_1002_4742_1028_c082 =
- {0x1028, 0xc082, pci_subsys_1002_4742_1028_c082, 0};
-#undef pci_ss_info_1028_c082
-#define pci_ss_info_1028_c082 pci_ss_info_1002_4742_1028_c082
-static const pciSubsystemInfo pci_ss_info_1002_4742_8086_4152 =
- {0x8086, 0x4152, pci_subsys_1002_4742_8086_4152, 0};
-#undef pci_ss_info_8086_4152
-#define pci_ss_info_8086_4152 pci_ss_info_1002_4742_8086_4152
-static const pciSubsystemInfo pci_ss_info_1002_4742_8086_464a =
- {0x8086, 0x464a, pci_subsys_1002_4742_8086_464a, 0};
-#undef pci_ss_info_8086_464a
-#define pci_ss_info_8086_464a pci_ss_info_1002_4742_8086_464a
-static const pciSubsystemInfo pci_ss_info_1002_4744_1002_4744 =
- {0x1002, 0x4744, pci_subsys_1002_4744_1002_4744, 0};
-#undef pci_ss_info_1002_4744
-#define pci_ss_info_1002_4744 pci_ss_info_1002_4744_1002_4744
-static const pciSubsystemInfo pci_ss_info_1002_4749_1002_0061 =
- {0x1002, 0x0061, pci_subsys_1002_4749_1002_0061, 0};
-#undef pci_ss_info_1002_0061
-#define pci_ss_info_1002_0061 pci_ss_info_1002_4749_1002_0061
-static const pciSubsystemInfo pci_ss_info_1002_4749_1002_0062 =
- {0x1002, 0x0062, pci_subsys_1002_4749_1002_0062, 0};
-#undef pci_ss_info_1002_0062
-#define pci_ss_info_1002_0062 pci_ss_info_1002_4749_1002_0062
-static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0004 =
- {0x1002, 0x0004, pci_subsys_1002_474d_1002_0004, 0};
-#undef pci_ss_info_1002_0004
-#define pci_ss_info_1002_0004 pci_ss_info_1002_474d_1002_0004
-static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_474d_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_474d_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0080 =
- {0x1002, 0x0080, pci_subsys_1002_474d_1002_0080, 0};
-#undef pci_ss_info_1002_0080
-#define pci_ss_info_1002_0080 pci_ss_info_1002_474d_1002_0080
-static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0084 =
- {0x1002, 0x0084, pci_subsys_1002_474d_1002_0084, 0};
-#undef pci_ss_info_1002_0084
-#define pci_ss_info_1002_0084 pci_ss_info_1002_474d_1002_0084
-static const pciSubsystemInfo pci_ss_info_1002_474d_1002_474d =
- {0x1002, 0x474d, pci_subsys_1002_474d_1002_474d, 0};
-#undef pci_ss_info_1002_474d
-#define pci_ss_info_1002_474d pci_ss_info_1002_474d_1002_474d
-static const pciSubsystemInfo pci_ss_info_1002_474d_1033_806a =
- {0x1033, 0x806a, pci_subsys_1002_474d_1033_806a, 0};
-#undef pci_ss_info_1033_806a
-#define pci_ss_info_1033_806a pci_ss_info_1002_474d_1033_806a
-static const pciSubsystemInfo pci_ss_info_1002_474e_1002_474e =
- {0x1002, 0x474e, pci_subsys_1002_474e_1002_474e, 0};
-#undef pci_ss_info_1002_474e
-#define pci_ss_info_1002_474e pci_ss_info_1002_474e_1002_474e
-static const pciSubsystemInfo pci_ss_info_1002_474f_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_474f_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_474f_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_474f_1002_474f =
- {0x1002, 0x474f, pci_subsys_1002_474f_1002_474f, 0};
-#undef pci_ss_info_1002_474f
-#define pci_ss_info_1002_474f pci_ss_info_1002_474f_1002_474f
-static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0040 =
- {0x1002, 0x0040, pci_subsys_1002_4750_1002_0040, 0};
-#undef pci_ss_info_1002_0040
-#define pci_ss_info_1002_0040 pci_ss_info_1002_4750_1002_0040
-static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0044 =
- {0x1002, 0x0044, pci_subsys_1002_4750_1002_0044, 0};
-#undef pci_ss_info_1002_0044
-#define pci_ss_info_1002_0044 pci_ss_info_1002_4750_1002_0044
-static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0080 =
- {0x1002, 0x0080, pci_subsys_1002_4750_1002_0080, 0};
-#undef pci_ss_info_1002_0080
-#define pci_ss_info_1002_0080 pci_ss_info_1002_4750_1002_0080
-static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0084 =
- {0x1002, 0x0084, pci_subsys_1002_4750_1002_0084, 0};
-#undef pci_ss_info_1002_0084
-#define pci_ss_info_1002_0084 pci_ss_info_1002_4750_1002_0084
-static const pciSubsystemInfo pci_ss_info_1002_4750_1002_4750 =
- {0x1002, 0x4750, pci_subsys_1002_4750_1002_4750, 0};
-#undef pci_ss_info_1002_4750
-#define pci_ss_info_1002_4750 pci_ss_info_1002_4750_1002_4750
-static const pciSubsystemInfo pci_ss_info_1002_4752_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_4752_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_4752_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_4752_1002_4752 =
- {0x1002, 0x4752, pci_subsys_1002_4752_1002_4752, 0};
-#undef pci_ss_info_1002_4752
-#define pci_ss_info_1002_4752 pci_ss_info_1002_4752_1002_4752
-static const pciSubsystemInfo pci_ss_info_1002_4752_1002_8008 =
- {0x1002, 0x8008, pci_subsys_1002_4752_1002_8008, 0};
-#undef pci_ss_info_1002_8008
-#define pci_ss_info_1002_8008 pci_ss_info_1002_4752_1002_8008
-static const pciSubsystemInfo pci_ss_info_1002_4752_1028_00d1 =
- {0x1028, 0x00d1, pci_subsys_1002_4752_1028_00d1, 0};
-#undef pci_ss_info_1028_00d1
-#define pci_ss_info_1028_00d1 pci_ss_info_1002_4752_1028_00d1
-static const pciSubsystemInfo pci_ss_info_1002_4753_1002_4753 =
- {0x1002, 0x4753, pci_subsys_1002_4753_1002_4753, 0};
-#undef pci_ss_info_1002_4753
-#define pci_ss_info_1002_4753 pci_ss_info_1002_4753_1002_4753
-static const pciSubsystemInfo pci_ss_info_1002_4756_1002_4756 =
- {0x1002, 0x4756, pci_subsys_1002_4756_1002_4756, 0};
-#undef pci_ss_info_1002_4756
-#define pci_ss_info_1002_4756 pci_ss_info_1002_4756_1002_4756
-static const pciSubsystemInfo pci_ss_info_1002_4757_1002_4757 =
- {0x1002, 0x4757, pci_subsys_1002_4757_1002_4757, 0};
-#undef pci_ss_info_1002_4757
-#define pci_ss_info_1002_4757 pci_ss_info_1002_4757_1002_4757
-static const pciSubsystemInfo pci_ss_info_1002_4757_1028_0089 =
- {0x1028, 0x0089, pci_subsys_1002_4757_1028_0089, 0};
-#undef pci_ss_info_1028_0089
-#define pci_ss_info_1028_0089 pci_ss_info_1002_4757_1028_0089
-static const pciSubsystemInfo pci_ss_info_1002_4757_1028_4082 =
- {0x1028, 0x4082, pci_subsys_1002_4757_1028_4082, 0};
-#undef pci_ss_info_1028_4082
-#define pci_ss_info_1028_4082 pci_ss_info_1002_4757_1028_4082
-static const pciSubsystemInfo pci_ss_info_1002_4757_1028_8082 =
- {0x1028, 0x8082, pci_subsys_1002_4757_1028_8082, 0};
-#undef pci_ss_info_1028_8082
-#define pci_ss_info_1028_8082 pci_ss_info_1002_4757_1028_8082
-static const pciSubsystemInfo pci_ss_info_1002_4757_1028_c082 =
- {0x1028, 0xc082, pci_subsys_1002_4757_1028_c082, 0};
-#undef pci_ss_info_1028_c082
-#define pci_ss_info_1028_c082 pci_ss_info_1002_4757_1028_c082
-static const pciSubsystemInfo pci_ss_info_1002_475a_1002_0087 =
- {0x1002, 0x0087, pci_subsys_1002_475a_1002_0087, 0};
-#undef pci_ss_info_1002_0087
-#define pci_ss_info_1002_0087 pci_ss_info_1002_475a_1002_0087
-static const pciSubsystemInfo pci_ss_info_1002_475a_1002_475a =
- {0x1002, 0x475a, pci_subsys_1002_475a_1002_475a, 0};
-#undef pci_ss_info_1002_475a
-#define pci_ss_info_1002_475a pci_ss_info_1002_475a_1002_475a
-static const pciSubsystemInfo pci_ss_info_1002_4966_10f1_0002 =
- {0x10f1, 0x0002, pci_subsys_1002_4966_10f1_0002, 0};
-#undef pci_ss_info_10f1_0002
-#define pci_ss_info_10f1_0002 pci_ss_info_1002_4966_10f1_0002
-static const pciSubsystemInfo pci_ss_info_1002_4966_148c_2039 =
- {0x148c, 0x2039, pci_subsys_1002_4966_148c_2039, 0};
-#undef pci_ss_info_148c_2039
-#define pci_ss_info_148c_2039 pci_ss_info_1002_4966_148c_2039
-static const pciSubsystemInfo pci_ss_info_1002_4966_1509_9a00 =
- {0x1509, 0x9a00, pci_subsys_1002_4966_1509_9a00, 0};
-#undef pci_ss_info_1509_9a00
-#define pci_ss_info_1509_9a00 pci_ss_info_1002_4966_1509_9a00
-static const pciSubsystemInfo pci_ss_info_1002_4966_1681_0040 =
- {0x1681, 0x0040, pci_subsys_1002_4966_1681_0040, 0};
-#undef pci_ss_info_1681_0040
-#define pci_ss_info_1681_0040 pci_ss_info_1002_4966_1681_0040
-static const pciSubsystemInfo pci_ss_info_1002_4966_174b_7176 =
- {0x174b, 0x7176, pci_subsys_1002_4966_174b_7176, 0};
-#undef pci_ss_info_174b_7176
-#define pci_ss_info_174b_7176 pci_ss_info_1002_4966_174b_7176
-static const pciSubsystemInfo pci_ss_info_1002_4966_174b_7192 =
- {0x174b, 0x7192, pci_subsys_1002_4966_174b_7192, 0};
-#undef pci_ss_info_174b_7192
-#define pci_ss_info_174b_7192 pci_ss_info_1002_4966_174b_7192
-static const pciSubsystemInfo pci_ss_info_1002_4966_17af_2005 =
- {0x17af, 0x2005, pci_subsys_1002_4966_17af_2005, 0};
-#undef pci_ss_info_17af_2005
-#define pci_ss_info_17af_2005 pci_ss_info_1002_4966_17af_2005
-static const pciSubsystemInfo pci_ss_info_1002_4966_17af_2006 =
- {0x17af, 0x2006, pci_subsys_1002_4966_17af_2006, 0};
-#undef pci_ss_info_17af_2006
-#define pci_ss_info_17af_2006 pci_ss_info_1002_4966_17af_2006
-static const pciSubsystemInfo pci_ss_info_1002_4c42_0e11_b0e8 =
- {0x0e11, 0xb0e8, pci_subsys_1002_4c42_0e11_b0e8, 0};
-#undef pci_ss_info_0e11_b0e8
-#define pci_ss_info_0e11_b0e8 pci_ss_info_1002_4c42_0e11_b0e8
-static const pciSubsystemInfo pci_ss_info_1002_4c42_0e11_b10e =
- {0x0e11, 0xb10e, pci_subsys_1002_4c42_0e11_b10e, 0};
-#undef pci_ss_info_0e11_b10e
-#define pci_ss_info_0e11_b10e pci_ss_info_1002_4c42_0e11_b10e
-static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_0040 =
- {0x1002, 0x0040, pci_subsys_1002_4c42_1002_0040, 0};
-#undef pci_ss_info_1002_0040
-#define pci_ss_info_1002_0040 pci_ss_info_1002_4c42_1002_0040
-static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_0044 =
- {0x1002, 0x0044, pci_subsys_1002_4c42_1002_0044, 0};
-#undef pci_ss_info_1002_0044
-#define pci_ss_info_1002_0044 pci_ss_info_1002_4c42_1002_0044
-static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_4c42 =
- {0x1002, 0x4c42, pci_subsys_1002_4c42_1002_4c42, 0};
-#undef pci_ss_info_1002_4c42
-#define pci_ss_info_1002_4c42 pci_ss_info_1002_4c42_1002_4c42
-static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_8001 =
- {0x1002, 0x8001, pci_subsys_1002_4c42_1002_8001, 0};
-#undef pci_ss_info_1002_8001
-#define pci_ss_info_1002_8001 pci_ss_info_1002_4c42_1002_8001
-static const pciSubsystemInfo pci_ss_info_1002_4c42_1028_0085 =
- {0x1028, 0x0085, pci_subsys_1002_4c42_1028_0085, 0};
-#undef pci_ss_info_1028_0085
-#define pci_ss_info_1028_0085 pci_ss_info_1002_4c42_1028_0085
-static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0004 =
- {0x1002, 0x0004, pci_subsys_1002_4c49_1002_0004, 0};
-#undef pci_ss_info_1002_0004
-#define pci_ss_info_1002_0004 pci_ss_info_1002_4c49_1002_0004
-static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0040 =
- {0x1002, 0x0040, pci_subsys_1002_4c49_1002_0040, 0};
-#undef pci_ss_info_1002_0040
-#define pci_ss_info_1002_0040 pci_ss_info_1002_4c49_1002_0040
-static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0044 =
- {0x1002, 0x0044, pci_subsys_1002_4c49_1002_0044, 0};
-#undef pci_ss_info_1002_0044
-#define pci_ss_info_1002_0044 pci_ss_info_1002_4c49_1002_0044
-static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_4c49 =
- {0x1002, 0x4c49, pci_subsys_1002_4c49_1002_4c49, 0};
-#undef pci_ss_info_1002_4c49
-#define pci_ss_info_1002_4c49 pci_ss_info_1002_4c49_1002_4c49
-static const pciSubsystemInfo pci_ss_info_1002_4c4d_0e11_b111 =
- {0x0e11, 0xb111, pci_subsys_1002_4c4d_0e11_b111, 0};
-#undef pci_ss_info_0e11_b111
-#define pci_ss_info_0e11_b111 pci_ss_info_1002_4c4d_0e11_b111
-static const pciSubsystemInfo pci_ss_info_1002_4c4d_1002_0084 =
- {0x1002, 0x0084, pci_subsys_1002_4c4d_1002_0084, 0};
-#undef pci_ss_info_1002_0084
-#define pci_ss_info_1002_0084 pci_ss_info_1002_4c4d_1002_0084
-static const pciSubsystemInfo pci_ss_info_1002_4c4d_1014_0154 =
- {0x1014, 0x0154, pci_subsys_1002_4c4d_1014_0154, 0};
-#undef pci_ss_info_1014_0154
-#define pci_ss_info_1014_0154 pci_ss_info_1002_4c4d_1014_0154
-static const pciSubsystemInfo pci_ss_info_1002_4c50_1002_4c50 =
- {0x1002, 0x4c50, pci_subsys_1002_4c50_1002_4c50, 0};
-#undef pci_ss_info_1002_4c50
-#define pci_ss_info_1002_4c50 pci_ss_info_1002_4c50_1002_4c50
-static const pciSubsystemInfo pci_ss_info_1002_4c57_1014_0517 =
- {0x1014, 0x0517, pci_subsys_1002_4c57_1014_0517, 0};
-#undef pci_ss_info_1014_0517
-#define pci_ss_info_1014_0517 pci_ss_info_1002_4c57_1014_0517
-static const pciSubsystemInfo pci_ss_info_1002_4c57_1028_00e6 =
- {0x1028, 0x00e6, pci_subsys_1002_4c57_1028_00e6, 0};
-#undef pci_ss_info_1028_00e6
-#define pci_ss_info_1028_00e6 pci_ss_info_1002_4c57_1028_00e6
-static const pciSubsystemInfo pci_ss_info_1002_4c57_144d_c006 =
- {0x144d, 0xc006, pci_subsys_1002_4c57_144d_c006, 0};
-#undef pci_ss_info_144d_c006
-#define pci_ss_info_144d_c006 pci_ss_info_1002_4c57_144d_c006
-static const pciSubsystemInfo pci_ss_info_1002_4c59_1014_0235 =
- {0x1014, 0x0235, pci_subsys_1002_4c59_1014_0235, 0};
-#undef pci_ss_info_1014_0235
-#define pci_ss_info_1014_0235 pci_ss_info_1002_4c59_1014_0235
-static const pciSubsystemInfo pci_ss_info_1002_4c59_1014_0239 =
- {0x1014, 0x0239, pci_subsys_1002_4c59_1014_0239, 0};
-#undef pci_ss_info_1014_0239
-#define pci_ss_info_1014_0239 pci_ss_info_1002_4c59_1014_0239
-static const pciSubsystemInfo pci_ss_info_1002_4c59_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_1002_4c59_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_1002_4c59_104d_80e7
-static const pciSubsystemInfo pci_ss_info_1002_4e45_1002_0002 =
- {0x1002, 0x0002, pci_subsys_1002_4e45_1002_0002, 0};
-#undef pci_ss_info_1002_0002
-#define pci_ss_info_1002_0002 pci_ss_info_1002_4e45_1002_0002
-static const pciSubsystemInfo pci_ss_info_1002_5044_1002_0028 =
- {0x1002, 0x0028, pci_subsys_1002_5044_1002_0028, 0};
-#undef pci_ss_info_1002_0028
-#define pci_ss_info_1002_0028 pci_ss_info_1002_5044_1002_0028
-static const pciSubsystemInfo pci_ss_info_1002_5044_1002_0029 =
- {0x1002, 0x0029, pci_subsys_1002_5044_1002_0029, 0};
-#undef pci_ss_info_1002_0029
-#define pci_ss_info_1002_0029 pci_ss_info_1002_5044_1002_0029
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0004 =
- {0x1002, 0x0004, pci_subsys_1002_5046_1002_0004, 0};
-#undef pci_ss_info_1002_0004
-#define pci_ss_info_1002_0004 pci_ss_info_1002_5046_1002_0004
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5046_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5046_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0014 =
- {0x1002, 0x0014, pci_subsys_1002_5046_1002_0014, 0};
-#undef pci_ss_info_1002_0014
-#define pci_ss_info_1002_0014 pci_ss_info_1002_5046_1002_0014
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0018 =
- {0x1002, 0x0018, pci_subsys_1002_5046_1002_0018, 0};
-#undef pci_ss_info_1002_0018
-#define pci_ss_info_1002_0018 pci_ss_info_1002_5046_1002_0018
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0028 =
- {0x1002, 0x0028, pci_subsys_1002_5046_1002_0028, 0};
-#undef pci_ss_info_1002_0028
-#define pci_ss_info_1002_0028 pci_ss_info_1002_5046_1002_0028
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_002a =
- {0x1002, 0x002a, pci_subsys_1002_5046_1002_002a, 0};
-#undef pci_ss_info_1002_002a
-#define pci_ss_info_1002_002a pci_ss_info_1002_5046_1002_002a
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0048 =
- {0x1002, 0x0048, pci_subsys_1002_5046_1002_0048, 0};
-#undef pci_ss_info_1002_0048
-#define pci_ss_info_1002_0048 pci_ss_info_1002_5046_1002_0048
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_2000 =
- {0x1002, 0x2000, pci_subsys_1002_5046_1002_2000, 0};
-#undef pci_ss_info_1002_2000
-#define pci_ss_info_1002_2000 pci_ss_info_1002_5046_1002_2000
-static const pciSubsystemInfo pci_ss_info_1002_5046_1002_2001 =
- {0x1002, 0x2001, pci_subsys_1002_5046_1002_2001, 0};
-#undef pci_ss_info_1002_2001
-#define pci_ss_info_1002_2001 pci_ss_info_1002_5046_1002_2001
-static const pciSubsystemInfo pci_ss_info_1002_5050_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5050_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5050_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5144_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5144_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0009 =
- {0x1002, 0x0009, pci_subsys_1002_5144_1002_0009, 0};
-#undef pci_ss_info_1002_0009
-#define pci_ss_info_1002_0009 pci_ss_info_1002_5144_1002_0009
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_000a =
- {0x1002, 0x000a, pci_subsys_1002_5144_1002_000a, 0};
-#undef pci_ss_info_1002_000a
-#define pci_ss_info_1002_000a pci_ss_info_1002_5144_1002_000a
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_001a =
- {0x1002, 0x001a, pci_subsys_1002_5144_1002_001a, 0};
-#undef pci_ss_info_1002_001a
-#define pci_ss_info_1002_001a pci_ss_info_1002_5144_1002_001a
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0029 =
- {0x1002, 0x0029, pci_subsys_1002_5144_1002_0029, 0};
-#undef pci_ss_info_1002_0029
-#define pci_ss_info_1002_0029 pci_ss_info_1002_5144_1002_0029
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0038 =
- {0x1002, 0x0038, pci_subsys_1002_5144_1002_0038, 0};
-#undef pci_ss_info_1002_0038
-#define pci_ss_info_1002_0038 pci_ss_info_1002_5144_1002_0038
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0039 =
- {0x1002, 0x0039, pci_subsys_1002_5144_1002_0039, 0};
-#undef pci_ss_info_1002_0039
-#define pci_ss_info_1002_0039 pci_ss_info_1002_5144_1002_0039
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_008a =
- {0x1002, 0x008a, pci_subsys_1002_5144_1002_008a, 0};
-#undef pci_ss_info_1002_008a
-#define pci_ss_info_1002_008a pci_ss_info_1002_5144_1002_008a
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_00ba =
- {0x1002, 0x00ba, pci_subsys_1002_5144_1002_00ba, 0};
-#undef pci_ss_info_1002_00ba
-#define pci_ss_info_1002_00ba pci_ss_info_1002_5144_1002_00ba
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0139 =
- {0x1002, 0x0139, pci_subsys_1002_5144_1002_0139, 0};
-#undef pci_ss_info_1002_0139
-#define pci_ss_info_1002_0139 pci_ss_info_1002_5144_1002_0139
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_028a =
- {0x1002, 0x028a, pci_subsys_1002_5144_1002_028a, 0};
-#undef pci_ss_info_1002_028a
-#define pci_ss_info_1002_028a pci_ss_info_1002_5144_1002_028a
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_02aa =
- {0x1002, 0x02aa, pci_subsys_1002_5144_1002_02aa, 0};
-#undef pci_ss_info_1002_02aa
-#define pci_ss_info_1002_02aa pci_ss_info_1002_5144_1002_02aa
-static const pciSubsystemInfo pci_ss_info_1002_5144_1002_053a =
- {0x1002, 0x053a, pci_subsys_1002_5144_1002_053a, 0};
-#undef pci_ss_info_1002_053a
-#define pci_ss_info_1002_053a pci_ss_info_1002_5144_1002_053a
-static const pciSubsystemInfo pci_ss_info_1002_5148_1002_010a =
- {0x1002, 0x010a, pci_subsys_1002_5148_1002_010a, 0};
-#undef pci_ss_info_1002_010a
-#define pci_ss_info_1002_010a pci_ss_info_1002_5148_1002_010a
-static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0152 =
- {0x1002, 0x0152, pci_subsys_1002_5148_1002_0152, 0};
-#undef pci_ss_info_1002_0152
-#define pci_ss_info_1002_0152 pci_ss_info_1002_5148_1002_0152
-static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0162 =
- {0x1002, 0x0162, pci_subsys_1002_5148_1002_0162, 0};
-#undef pci_ss_info_1002_0162
-#define pci_ss_info_1002_0162 pci_ss_info_1002_5148_1002_0162
-static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0172 =
- {0x1002, 0x0172, pci_subsys_1002_5148_1002_0172, 0};
-#undef pci_ss_info_1002_0172
-#define pci_ss_info_1002_0172 pci_ss_info_1002_5148_1002_0172
-static const pciSubsystemInfo pci_ss_info_1002_514c_1002_003a =
- {0x1002, 0x003a, pci_subsys_1002_514c_1002_003a, 0};
-#undef pci_ss_info_1002_003a
-#define pci_ss_info_1002_003a pci_ss_info_1002_514c_1002_003a
-static const pciSubsystemInfo pci_ss_info_1002_514c_1002_013a =
- {0x1002, 0x013a, pci_subsys_1002_514c_1002_013a, 0};
-#undef pci_ss_info_1002_013a
-#define pci_ss_info_1002_013a pci_ss_info_1002_514c_1002_013a
-static const pciSubsystemInfo pci_ss_info_1002_514c_148c_2026 =
- {0x148c, 0x2026, pci_subsys_1002_514c_148c_2026, 0};
-#undef pci_ss_info_148c_2026
-#define pci_ss_info_148c_2026 pci_ss_info_1002_514c_148c_2026
-static const pciSubsystemInfo pci_ss_info_1002_514c_174b_7149 =
- {0x174b, 0x7149, pci_subsys_1002_514c_174b_7149, 0};
-#undef pci_ss_info_174b_7149
-#define pci_ss_info_174b_7149 pci_ss_info_1002_514c_174b_7149
-static const pciSubsystemInfo pci_ss_info_1002_5157_1002_013a =
- {0x1002, 0x013a, pci_subsys_1002_5157_1002_013a, 0};
-#undef pci_ss_info_1002_013a
-#define pci_ss_info_1002_013a pci_ss_info_1002_5157_1002_013a
-static const pciSubsystemInfo pci_ss_info_1002_5157_1458_4000 =
- {0x1458, 0x4000, pci_subsys_1002_5157_1458_4000, 0};
-#undef pci_ss_info_1458_4000
-#define pci_ss_info_1458_4000 pci_ss_info_1002_5157_1458_4000
-static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2024 =
- {0x148c, 0x2024, pci_subsys_1002_5157_148c_2024, 0};
-#undef pci_ss_info_148c_2024
-#define pci_ss_info_148c_2024 pci_ss_info_1002_5157_148c_2024
-static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2025 =
- {0x148c, 0x2025, pci_subsys_1002_5157_148c_2025, 0};
-#undef pci_ss_info_148c_2025
-#define pci_ss_info_148c_2025 pci_ss_info_1002_5157_148c_2025
-static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2036 =
- {0x148c, 0x2036, pci_subsys_1002_5157_148c_2036, 0};
-#undef pci_ss_info_148c_2036
-#define pci_ss_info_148c_2036 pci_ss_info_1002_5157_148c_2036
-static const pciSubsystemInfo pci_ss_info_1002_5157_174b_7147 =
- {0x174b, 0x7147, pci_subsys_1002_5157_174b_7147, 0};
-#undef pci_ss_info_174b_7147
-#define pci_ss_info_174b_7147 pci_ss_info_1002_5157_174b_7147
-static const pciSubsystemInfo pci_ss_info_1002_5157_174b_7161 =
- {0x174b, 0x7161, pci_subsys_1002_5157_174b_7161, 0};
-#undef pci_ss_info_174b_7161
-#define pci_ss_info_174b_7161 pci_ss_info_1002_5157_174b_7161
-static const pciSubsystemInfo pci_ss_info_1002_5157_17af_0202 =
- {0x17af, 0x0202, pci_subsys_1002_5157_17af_0202, 0};
-#undef pci_ss_info_17af_0202
-#define pci_ss_info_17af_0202 pci_ss_info_1002_5157_17af_0202
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_000a =
- {0x1002, 0x000a, pci_subsys_1002_5159_1002_000a, 0};
-#undef pci_ss_info_1002_000a
-#define pci_ss_info_1002_000a pci_ss_info_1002_5159_1002_000a
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_000b =
- {0x1002, 0x000b, pci_subsys_1002_5159_1002_000b, 0};
-#undef pci_ss_info_1002_000b
-#define pci_ss_info_1002_000b pci_ss_info_1002_5159_1002_000b
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_0038 =
- {0x1002, 0x0038, pci_subsys_1002_5159_1002_0038, 0};
-#undef pci_ss_info_1002_0038
-#define pci_ss_info_1002_0038 pci_ss_info_1002_5159_1002_0038
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_003a =
- {0x1002, 0x003a, pci_subsys_1002_5159_1002_003a, 0};
-#undef pci_ss_info_1002_003a
-#define pci_ss_info_1002_003a pci_ss_info_1002_5159_1002_003a
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_00ba =
- {0x1002, 0x00ba, pci_subsys_1002_5159_1002_00ba, 0};
-#undef pci_ss_info_1002_00ba
-#define pci_ss_info_1002_00ba pci_ss_info_1002_5159_1002_00ba
-static const pciSubsystemInfo pci_ss_info_1002_5159_1002_013a =
- {0x1002, 0x013a, pci_subsys_1002_5159_1002_013a, 0};
-#undef pci_ss_info_1002_013a
-#define pci_ss_info_1002_013a pci_ss_info_1002_5159_1002_013a
-static const pciSubsystemInfo pci_ss_info_1002_5159_1458_4002 =
- {0x1458, 0x4002, pci_subsys_1002_5159_1458_4002, 0};
-#undef pci_ss_info_1458_4002
-#define pci_ss_info_1458_4002 pci_ss_info_1002_5159_1458_4002
-static const pciSubsystemInfo pci_ss_info_1002_5159_148c_2003 =
- {0x148c, 0x2003, pci_subsys_1002_5159_148c_2003, 0};
-#undef pci_ss_info_148c_2003
-#define pci_ss_info_148c_2003 pci_ss_info_1002_5159_148c_2003
-static const pciSubsystemInfo pci_ss_info_1002_5159_148c_2023 =
- {0x148c, 0x2023, pci_subsys_1002_5159_148c_2023, 0};
-#undef pci_ss_info_148c_2023
-#define pci_ss_info_148c_2023 pci_ss_info_1002_5159_148c_2023
-static const pciSubsystemInfo pci_ss_info_1002_5159_174b_7112 =
- {0x174b, 0x7112, pci_subsys_1002_5159_174b_7112, 0};
-#undef pci_ss_info_174b_7112
-#define pci_ss_info_174b_7112 pci_ss_info_1002_5159_174b_7112
-static const pciSubsystemInfo pci_ss_info_1002_5159_1787_0202 =
- {0x1787, 0x0202, pci_subsys_1002_5159_1787_0202, 0};
-#undef pci_ss_info_1787_0202
-#define pci_ss_info_1787_0202 pci_ss_info_1002_5159_1787_0202
-static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5245_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5245_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0028 =
- {0x1002, 0x0028, pci_subsys_1002_5245_1002_0028, 0};
-#undef pci_ss_info_1002_0028
-#define pci_ss_info_1002_0028 pci_ss_info_1002_5245_1002_0028
-static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0029 =
- {0x1002, 0x0029, pci_subsys_1002_5245_1002_0029, 0};
-#undef pci_ss_info_1002_0029
-#define pci_ss_info_1002_0029 pci_ss_info_1002_5245_1002_0029
-static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0068 =
- {0x1002, 0x0068, pci_subsys_1002_5245_1002_0068, 0};
-#undef pci_ss_info_1002_0068
-#define pci_ss_info_1002_0068 pci_ss_info_1002_5245_1002_0068
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0004 =
- {0x1002, 0x0004, pci_subsys_1002_5246_1002_0004, 0};
-#undef pci_ss_info_1002_0004
-#define pci_ss_info_1002_0004 pci_ss_info_1002_5246_1002_0004
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5246_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5246_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0028 =
- {0x1002, 0x0028, pci_subsys_1002_5246_1002_0028, 0};
-#undef pci_ss_info_1002_0028
-#define pci_ss_info_1002_0028 pci_ss_info_1002_5246_1002_0028
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0044 =
- {0x1002, 0x0044, pci_subsys_1002_5246_1002_0044, 0};
-#undef pci_ss_info_1002_0044
-#define pci_ss_info_1002_0044 pci_ss_info_1002_5246_1002_0044
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0068 =
- {0x1002, 0x0068, pci_subsys_1002_5246_1002_0068, 0};
-#undef pci_ss_info_1002_0068
-#define pci_ss_info_1002_0068 pci_ss_info_1002_5246_1002_0068
-static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0448 =
- {0x1002, 0x0448, pci_subsys_1002_5246_1002_0448, 0};
-#undef pci_ss_info_1002_0448
-#define pci_ss_info_1002_0448 pci_ss_info_1002_5246_1002_0448
-static const pciSubsystemInfo pci_ss_info_1002_524c_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_524c_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_524c_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_524c_1002_0088 =
- {0x1002, 0x0088, pci_subsys_1002_524c_1002_0088, 0};
-#undef pci_ss_info_1002_0088
-#define pci_ss_info_1002_0088 pci_ss_info_1002_524c_1002_0088
-static const pciSubsystemInfo pci_ss_info_1002_5346_1002_0048 =
- {0x1002, 0x0048, pci_subsys_1002_5346_1002_0048, 0};
-#undef pci_ss_info_1002_0048
-#define pci_ss_info_1002_0048 pci_ss_info_1002_5346_1002_0048
-static const pciSubsystemInfo pci_ss_info_1002_534d_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_534d_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_534d_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_534d_1002_0018 =
- {0x1002, 0x0018, pci_subsys_1002_534d_1002_0018, 0};
-#undef pci_ss_info_1002_0018
-#define pci_ss_info_1002_0018 pci_ss_info_1002_534d_1002_0018
-static const pciSubsystemInfo pci_ss_info_1002_5354_1002_5654 =
- {0x1002, 0x5654, pci_subsys_1002_5354_1002_5654, 0};
-#undef pci_ss_info_1002_5654
-#define pci_ss_info_1002_5654 pci_ss_info_1002_5354_1002_5654
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0004 =
- {0x1002, 0x0004, pci_subsys_1002_5446_1002_0004, 0};
-#undef pci_ss_info_1002_0004
-#define pci_ss_info_1002_0004 pci_ss_info_1002_5446_1002_0004
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0008 =
- {0x1002, 0x0008, pci_subsys_1002_5446_1002_0008, 0};
-#undef pci_ss_info_1002_0008
-#define pci_ss_info_1002_0008 pci_ss_info_1002_5446_1002_0008
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0018 =
- {0x1002, 0x0018, pci_subsys_1002_5446_1002_0018, 0};
-#undef pci_ss_info_1002_0018
-#define pci_ss_info_1002_0018 pci_ss_info_1002_5446_1002_0018
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0028 =
- {0x1002, 0x0028, pci_subsys_1002_5446_1002_0028, 0};
-#undef pci_ss_info_1002_0028
-#define pci_ss_info_1002_0028 pci_ss_info_1002_5446_1002_0028
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0029 =
- {0x1002, 0x0029, pci_subsys_1002_5446_1002_0029, 0};
-#undef pci_ss_info_1002_0029
-#define pci_ss_info_1002_0029 pci_ss_info_1002_5446_1002_0029
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_002a =
- {0x1002, 0x002a, pci_subsys_1002_5446_1002_002a, 0};
-#undef pci_ss_info_1002_002a
-#define pci_ss_info_1002_002a pci_ss_info_1002_5446_1002_002a
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_002b =
- {0x1002, 0x002b, pci_subsys_1002_5446_1002_002b, 0};
-#undef pci_ss_info_1002_002b
-#define pci_ss_info_1002_002b pci_ss_info_1002_5446_1002_002b
-static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0048 =
- {0x1002, 0x0048, pci_subsys_1002_5446_1002_0048, 0};
-#undef pci_ss_info_1002_0048
-#define pci_ss_info_1002_0048 pci_ss_info_1002_5446_1002_0048
-static const pciSubsystemInfo pci_ss_info_1002_5452_1002_001c =
- {0x1002, 0x001c, pci_subsys_1002_5452_1002_001c, 0};
-#undef pci_ss_info_1002_001c
-#define pci_ss_info_1002_001c pci_ss_info_1002_5452_1002_001c
-static const pciSubsystemInfo pci_ss_info_1002_5452_103c_1279 =
- {0x103c, 0x1279, pci_subsys_1002_5452_103c_1279, 0};
-#undef pci_ss_info_103c_1279
-#define pci_ss_info_103c_1279 pci_ss_info_1002_5452_103c_1279
-static const pciSubsystemInfo pci_ss_info_1002_5654_1002_5654 =
- {0x1002, 0x5654, pci_subsys_1002_5654_1002_5654, 0};
-#undef pci_ss_info_1002_5654
-#define pci_ss_info_1002_5654 pci_ss_info_1002_5654_1002_5654
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1004_0304_1004_0304 =
- {0x1004, 0x0304, pci_subsys_1004_0304_1004_0304, 0};
-#undef pci_ss_info_1004_0304
-#define pci_ss_info_1004_0304 pci_ss_info_1004_0304_1004_0304
-static const pciSubsystemInfo pci_ss_info_1004_0304_122d_1206 =
- {0x122d, 0x1206, pci_subsys_1004_0304_122d_1206, 0};
-#undef pci_ss_info_122d_1206
-#define pci_ss_info_122d_1206 pci_ss_info_1004_0304_122d_1206
-static const pciSubsystemInfo pci_ss_info_1004_0304_1483_5020 =
- {0x1483, 0x5020, pci_subsys_1004_0304_1483_5020, 0};
-#undef pci_ss_info_1483_5020
-#define pci_ss_info_1483_5020 pci_ss_info_1004_0304_1483_5020
-static const pciSubsystemInfo pci_ss_info_1004_0305_1004_0305 =
- {0x1004, 0x0305, pci_subsys_1004_0305_1004_0305, 0};
-#undef pci_ss_info_1004_0305
-#define pci_ss_info_1004_0305 pci_ss_info_1004_0305_1004_0305
-static const pciSubsystemInfo pci_ss_info_1004_0305_122d_1207 =
- {0x122d, 0x1207, pci_subsys_1004_0305_122d_1207, 0};
-#undef pci_ss_info_122d_1207
-#define pci_ss_info_122d_1207 pci_ss_info_1004_0305_122d_1207
-static const pciSubsystemInfo pci_ss_info_1004_0305_1483_5021 =
- {0x1483, 0x5021, pci_subsys_1004_0305_1483_5021, 0};
-#undef pci_ss_info_1483_5021
-#define pci_ss_info_1483_5021 pci_ss_info_1004_0305_1483_5021
-static const pciSubsystemInfo pci_ss_info_1004_0306_1004_0306 =
- {0x1004, 0x0306, pci_subsys_1004_0306_1004_0306, 0};
-#undef pci_ss_info_1004_0306
-#define pci_ss_info_1004_0306 pci_ss_info_1004_0306_1004_0306
-static const pciSubsystemInfo pci_ss_info_1004_0306_122d_1208 =
- {0x122d, 0x1208, pci_subsys_1004_0306_122d_1208, 0};
-#undef pci_ss_info_122d_1208
-#define pci_ss_info_122d_1208 pci_ss_info_1004_0306_122d_1208
-static const pciSubsystemInfo pci_ss_info_1004_0306_1483_5022 =
- {0x1483, 0x5022, pci_subsys_1004_0306_1483_5022, 0};
-#undef pci_ss_info_1483_5022
-#define pci_ss_info_1483_5022 pci_ss_info_1004_0306_1483_5022
-#endif
-static const pciSubsystemInfo pci_ss_info_1011_0009_1025_0310 =
- {0x1025, 0x0310, pci_subsys_1011_0009_1025_0310, 0};
-#undef pci_ss_info_1025_0310
-#define pci_ss_info_1025_0310 pci_ss_info_1011_0009_1025_0310
-static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2001 =
- {0x10b8, 0x2001, pci_subsys_1011_0009_10b8_2001, 0};
-#undef pci_ss_info_10b8_2001
-#define pci_ss_info_10b8_2001 pci_ss_info_1011_0009_10b8_2001
-static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2002 =
- {0x10b8, 0x2002, pci_subsys_1011_0009_10b8_2002, 0};
-#undef pci_ss_info_10b8_2002
-#define pci_ss_info_10b8_2002 pci_ss_info_1011_0009_10b8_2002
-static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2003 =
- {0x10b8, 0x2003, pci_subsys_1011_0009_10b8_2003, 0};
-#undef pci_ss_info_10b8_2003
-#define pci_ss_info_10b8_2003 pci_ss_info_1011_0009_10b8_2003
-static const pciSubsystemInfo pci_ss_info_1011_0009_1109_2400 =
- {0x1109, 0x2400, pci_subsys_1011_0009_1109_2400, 0};
-#undef pci_ss_info_1109_2400
-#define pci_ss_info_1109_2400 pci_ss_info_1011_0009_1109_2400
-static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2300 =
- {0x1112, 0x2300, pci_subsys_1011_0009_1112_2300, 0};
-#undef pci_ss_info_1112_2300
-#define pci_ss_info_1112_2300 pci_ss_info_1011_0009_1112_2300
-static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2320 =
- {0x1112, 0x2320, pci_subsys_1011_0009_1112_2320, 0};
-#undef pci_ss_info_1112_2320
-#define pci_ss_info_1112_2320 pci_ss_info_1011_0009_1112_2320
-static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2340 =
- {0x1112, 0x2340, pci_subsys_1011_0009_1112_2340, 0};
-#undef pci_ss_info_1112_2340
-#define pci_ss_info_1112_2340 pci_ss_info_1011_0009_1112_2340
-static const pciSubsystemInfo pci_ss_info_1011_0009_1113_1207 =
- {0x1113, 0x1207, pci_subsys_1011_0009_1113_1207, 0};
-#undef pci_ss_info_1113_1207
-#define pci_ss_info_1113_1207 pci_ss_info_1011_0009_1113_1207
-static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1100 =
- {0x1186, 0x1100, pci_subsys_1011_0009_1186_1100, 0};
-#undef pci_ss_info_1186_1100
-#define pci_ss_info_1186_1100 pci_ss_info_1011_0009_1186_1100
-static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1112 =
- {0x1186, 0x1112, pci_subsys_1011_0009_1186_1112, 0};
-#undef pci_ss_info_1186_1112
-#define pci_ss_info_1186_1112 pci_ss_info_1011_0009_1186_1112
-static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1140 =
- {0x1186, 0x1140, pci_subsys_1011_0009_1186_1140, 0};
-#undef pci_ss_info_1186_1140
-#define pci_ss_info_1186_1140 pci_ss_info_1011_0009_1186_1140
-static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1142 =
- {0x1186, 0x1142, pci_subsys_1011_0009_1186_1142, 0};
-#undef pci_ss_info_1186_1142
-#define pci_ss_info_1186_1142 pci_ss_info_1011_0009_1186_1142
-static const pciSubsystemInfo pci_ss_info_1011_0009_11f6_0503 =
- {0x11f6, 0x0503, pci_subsys_1011_0009_11f6_0503, 0};
-#undef pci_ss_info_11f6_0503
-#define pci_ss_info_11f6_0503 pci_ss_info_1011_0009_11f6_0503
-static const pciSubsystemInfo pci_ss_info_1011_0009_1282_9100 =
- {0x1282, 0x9100, pci_subsys_1011_0009_1282_9100, 0};
-#undef pci_ss_info_1282_9100
-#define pci_ss_info_1282_9100 pci_ss_info_1011_0009_1282_9100
-static const pciSubsystemInfo pci_ss_info_1011_0009_1385_1100 =
- {0x1385, 0x1100, pci_subsys_1011_0009_1385_1100, 0};
-#undef pci_ss_info_1385_1100
-#define pci_ss_info_1385_1100 pci_ss_info_1011_0009_1385_1100
-static const pciSubsystemInfo pci_ss_info_1011_0009_2646_0001 =
- {0x2646, 0x0001, pci_subsys_1011_0009_2646_0001, 0};
-#undef pci_ss_info_2646_0001
-#define pci_ss_info_2646_0001 pci_ss_info_1011_0009_2646_0001
-static const pciSubsystemInfo pci_ss_info_1011_0014_1186_0100 =
- {0x1186, 0x0100, pci_subsys_1011_0014_1186_0100, 0};
-#undef pci_ss_info_1186_0100
-#define pci_ss_info_1186_0100 pci_ss_info_1011_0014_1186_0100
-static const pciSubsystemInfo pci_ss_info_1011_0019_1011_500a =
- {0x1011, 0x500a, pci_subsys_1011_0019_1011_500a, 0};
-#undef pci_ss_info_1011_500a
-#define pci_ss_info_1011_500a pci_ss_info_1011_0019_1011_500a
-static const pciSubsystemInfo pci_ss_info_1011_0019_1011_500b =
- {0x1011, 0x500b, pci_subsys_1011_0019_1011_500b, 0};
-#undef pci_ss_info_1011_500b
-#define pci_ss_info_1011_500b pci_ss_info_1011_0019_1011_500b
-static const pciSubsystemInfo pci_ss_info_1011_0019_1014_0001 =
- {0x1014, 0x0001, pci_subsys_1011_0019_1014_0001, 0};
-#undef pci_ss_info_1014_0001
-#define pci_ss_info_1014_0001 pci_ss_info_1011_0019_1014_0001
-static const pciSubsystemInfo pci_ss_info_1011_0019_1025_0315 =
- {0x1025, 0x0315, pci_subsys_1011_0019_1025_0315, 0};
-#undef pci_ss_info_1025_0315
-#define pci_ss_info_1025_0315 pci_ss_info_1011_0019_1025_0315
-static const pciSubsystemInfo pci_ss_info_1011_0019_1033_800c =
- {0x1033, 0x800c, pci_subsys_1011_0019_1033_800c, 0};
-#undef pci_ss_info_1033_800c
-#define pci_ss_info_1033_800c pci_ss_info_1011_0019_1033_800c
-static const pciSubsystemInfo pci_ss_info_1011_0019_1033_800d =
- {0x1033, 0x800d, pci_subsys_1011_0019_1033_800d, 0};
-#undef pci_ss_info_1033_800d
-#define pci_ss_info_1033_800d pci_ss_info_1011_0019_1033_800d
-static const pciSubsystemInfo pci_ss_info_1011_0019_108d_0016 =
- {0x108d, 0x0016, pci_subsys_1011_0019_108d_0016, 0};
-#undef pci_ss_info_108d_0016
-#define pci_ss_info_108d_0016 pci_ss_info_1011_0019_108d_0016
-static const pciSubsystemInfo pci_ss_info_1011_0019_108d_0017 =
- {0x108d, 0x0017, pci_subsys_1011_0019_108d_0017, 0};
-#undef pci_ss_info_108d_0017
-#define pci_ss_info_108d_0017 pci_ss_info_1011_0019_108d_0017
-static const pciSubsystemInfo pci_ss_info_1011_0019_10b8_2005 =
- {0x10b8, 0x2005, pci_subsys_1011_0019_10b8_2005, 0};
-#undef pci_ss_info_10b8_2005
-#define pci_ss_info_10b8_2005 pci_ss_info_1011_0019_10b8_2005
-static const pciSubsystemInfo pci_ss_info_1011_0019_10b8_8034 =
- {0x10b8, 0x8034, pci_subsys_1011_0019_10b8_8034, 0};
-#undef pci_ss_info_10b8_8034
-#define pci_ss_info_10b8_8034 pci_ss_info_1011_0019_10b8_8034
-static const pciSubsystemInfo pci_ss_info_1011_0019_10ef_8169 =
- {0x10ef, 0x8169, pci_subsys_1011_0019_10ef_8169, 0};
-#undef pci_ss_info_10ef_8169
-#define pci_ss_info_10ef_8169 pci_ss_info_1011_0019_10ef_8169
-static const pciSubsystemInfo pci_ss_info_1011_0019_1109_2a00 =
- {0x1109, 0x2a00, pci_subsys_1011_0019_1109_2a00, 0};
-#undef pci_ss_info_1109_2a00
-#define pci_ss_info_1109_2a00 pci_ss_info_1011_0019_1109_2a00
-static const pciSubsystemInfo pci_ss_info_1011_0019_1109_2b00 =
- {0x1109, 0x2b00, pci_subsys_1011_0019_1109_2b00, 0};
-#undef pci_ss_info_1109_2b00
-#define pci_ss_info_1109_2b00 pci_ss_info_1011_0019_1109_2b00
-static const pciSubsystemInfo pci_ss_info_1011_0019_1109_3000 =
- {0x1109, 0x3000, pci_subsys_1011_0019_1109_3000, 0};
-#undef pci_ss_info_1109_3000
-#define pci_ss_info_1109_3000 pci_ss_info_1011_0019_1109_3000
-static const pciSubsystemInfo pci_ss_info_1011_0019_1113_1207 =
- {0x1113, 0x1207, pci_subsys_1011_0019_1113_1207, 0};
-#undef pci_ss_info_1113_1207
-#define pci_ss_info_1113_1207 pci_ss_info_1011_0019_1113_1207
-static const pciSubsystemInfo pci_ss_info_1011_0019_1113_2220 =
- {0x1113, 0x2220, pci_subsys_1011_0019_1113_2220, 0};
-#undef pci_ss_info_1113_2220
-#define pci_ss_info_1113_2220 pci_ss_info_1011_0019_1113_2220
-static const pciSubsystemInfo pci_ss_info_1011_0019_115d_0002 =
- {0x115d, 0x0002, pci_subsys_1011_0019_115d_0002, 0};
-#undef pci_ss_info_115d_0002
-#define pci_ss_info_115d_0002 pci_ss_info_1011_0019_115d_0002
-static const pciSubsystemInfo pci_ss_info_1011_0019_1179_0203 =
- {0x1179, 0x0203, pci_subsys_1011_0019_1179_0203, 0};
-#undef pci_ss_info_1179_0203
-#define pci_ss_info_1179_0203 pci_ss_info_1011_0019_1179_0203
-static const pciSubsystemInfo pci_ss_info_1011_0019_1179_0204 =
- {0x1179, 0x0204, pci_subsys_1011_0019_1179_0204, 0};
-#undef pci_ss_info_1179_0204
-#define pci_ss_info_1179_0204 pci_ss_info_1011_0019_1179_0204
-static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1100 =
- {0x1186, 0x1100, pci_subsys_1011_0019_1186_1100, 0};
-#undef pci_ss_info_1186_1100
-#define pci_ss_info_1186_1100 pci_ss_info_1011_0019_1186_1100
-static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1101 =
- {0x1186, 0x1101, pci_subsys_1011_0019_1186_1101, 0};
-#undef pci_ss_info_1186_1101
-#define pci_ss_info_1186_1101 pci_ss_info_1011_0019_1186_1101
-static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1102 =
- {0x1186, 0x1102, pci_subsys_1011_0019_1186_1102, 0};
-#undef pci_ss_info_1186_1102
-#define pci_ss_info_1186_1102 pci_ss_info_1011_0019_1186_1102
-static const pciSubsystemInfo pci_ss_info_1011_0019_1259_2800 =
- {0x1259, 0x2800, pci_subsys_1011_0019_1259_2800, 0};
-#undef pci_ss_info_1259_2800
-#define pci_ss_info_1259_2800 pci_ss_info_1011_0019_1259_2800
-static const pciSubsystemInfo pci_ss_info_1011_0019_1266_0004 =
- {0x1266, 0x0004, pci_subsys_1011_0019_1266_0004, 0};
-#undef pci_ss_info_1266_0004
-#define pci_ss_info_1266_0004 pci_ss_info_1011_0019_1266_0004
-static const pciSubsystemInfo pci_ss_info_1011_0019_12af_0019 =
- {0x12af, 0x0019, pci_subsys_1011_0019_12af_0019, 0};
-#undef pci_ss_info_12af_0019
-#define pci_ss_info_12af_0019 pci_ss_info_1011_0019_12af_0019
-static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0001 =
- {0x1374, 0x0001, pci_subsys_1011_0019_1374_0001, 0};
-#undef pci_ss_info_1374_0001
-#define pci_ss_info_1374_0001 pci_ss_info_1011_0019_1374_0001
-static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0002 =
- {0x1374, 0x0002, pci_subsys_1011_0019_1374_0002, 0};
-#undef pci_ss_info_1374_0002
-#define pci_ss_info_1374_0002 pci_ss_info_1011_0019_1374_0002
-static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0007 =
- {0x1374, 0x0007, pci_subsys_1011_0019_1374_0007, 0};
-#undef pci_ss_info_1374_0007
-#define pci_ss_info_1374_0007 pci_ss_info_1011_0019_1374_0007
-static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0008 =
- {0x1374, 0x0008, pci_subsys_1011_0019_1374_0008, 0};
-#undef pci_ss_info_1374_0008
-#define pci_ss_info_1374_0008 pci_ss_info_1011_0019_1374_0008
-static const pciSubsystemInfo pci_ss_info_1011_0019_1385_2100 =
- {0x1385, 0x2100, pci_subsys_1011_0019_1385_2100, 0};
-#undef pci_ss_info_1385_2100
-#define pci_ss_info_1385_2100 pci_ss_info_1011_0019_1385_2100
-static const pciSubsystemInfo pci_ss_info_1011_0019_1395_0001 =
- {0x1395, 0x0001, pci_subsys_1011_0019_1395_0001, 0};
-#undef pci_ss_info_1395_0001
-#define pci_ss_info_1395_0001 pci_ss_info_1011_0019_1395_0001
-static const pciSubsystemInfo pci_ss_info_1011_0019_13d1_ab01 =
- {0x13d1, 0xab01, pci_subsys_1011_0019_13d1_ab01, 0};
-#undef pci_ss_info_13d1_ab01
-#define pci_ss_info_13d1_ab01 pci_ss_info_1011_0019_13d1_ab01
-static const pciSubsystemInfo pci_ss_info_1011_0019_8086_0001 =
- {0x8086, 0x0001, pci_subsys_1011_0019_8086_0001, 0};
-#undef pci_ss_info_8086_0001
-#define pci_ss_info_8086_0001 pci_ss_info_1011_0019_8086_0001
-static const pciSubsystemInfo pci_ss_info_1011_0034_1374_0003 =
- {0x1374, 0x0003, pci_subsys_1011_0034_1374_0003, 0};
-#undef pci_ss_info_1374_0003
-#define pci_ss_info_1374_0003 pci_ss_info_1011_0034_1374_0003
-static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4050 =
- {0x0e11, 0x4050, pci_subsys_1011_0046_0e11_4050, 0};
-#undef pci_ss_info_0e11_4050
-#define pci_ss_info_0e11_4050 pci_ss_info_1011_0046_0e11_4050
-static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4051 =
- {0x0e11, 0x4051, pci_subsys_1011_0046_0e11_4051, 0};
-#undef pci_ss_info_0e11_4051
-#define pci_ss_info_0e11_4051 pci_ss_info_1011_0046_0e11_4051
-static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4058 =
- {0x0e11, 0x4058, pci_subsys_1011_0046_0e11_4058, 0};
-#undef pci_ss_info_0e11_4058
-#define pci_ss_info_0e11_4058 pci_ss_info_1011_0046_0e11_4058
-static const pciSubsystemInfo pci_ss_info_1011_0046_103c_10c2 =
- {0x103c, 0x10c2, pci_subsys_1011_0046_103c_10c2, 0};
-#undef pci_ss_info_103c_10c2
-#define pci_ss_info_103c_10c2 pci_ss_info_1011_0046_103c_10c2
-static const pciSubsystemInfo pci_ss_info_1011_0046_12d9_000a =
- {0x12d9, 0x000a, pci_subsys_1011_0046_12d9_000a, 0};
-#undef pci_ss_info_12d9_000a
-#define pci_ss_info_12d9_000a pci_ss_info_1011_0046_12d9_000a
-static const pciSubsystemInfo pci_ss_info_1011_0046_9005_0365 =
- {0x9005, 0x0365, pci_subsys_1011_0046_9005_0365, 0};
-#undef pci_ss_info_9005_0365
-#define pci_ss_info_9005_0365 pci_ss_info_1011_0046_9005_0365
-static const pciSubsystemInfo pci_ss_info_1011_0046_9005_1364 =
- {0x9005, 0x1364, pci_subsys_1011_0046_9005_1364, 0};
-#undef pci_ss_info_9005_1364
-#define pci_ss_info_9005_1364 pci_ss_info_1011_0046_9005_1364
-static const pciSubsystemInfo pci_ss_info_1011_0046_9005_1365 =
- {0x9005, 0x1365, pci_subsys_1011_0046_9005_1365, 0};
-#undef pci_ss_info_9005_1365
-#define pci_ss_info_9005_1365 pci_ss_info_1011_0046_9005_1365
-static const pciSubsystemInfo pci_ss_info_1011_0046_e4bf_1000 =
- {0xe4bf, 0x1000, pci_subsys_1011_0046_e4bf_1000, 0};
-#undef pci_ss_info_e4bf_1000
-#define pci_ss_info_e4bf_1000 pci_ss_info_1011_0046_e4bf_1000
-static const pciSubsystemInfo pci_ss_info_1011_1065_1069_0020 =
- {0x1069, 0x0020, pci_subsys_1011_1065_1069_0020, 0};
-#undef pci_ss_info_1069_0020
-#define pci_ss_info_1069_0020 pci_ss_info_1011_1065_1069_0020
-static const pciSubsystemInfo pci_ss_info_1013_00bc_1013_00bc =
- {0x1013, 0x00bc, pci_subsys_1013_00bc_1013_00bc, 0};
-#undef pci_ss_info_1013_00bc
-#define pci_ss_info_1013_00bc pci_ss_info_1013_00bc_1013_00bc
-static const pciSubsystemInfo pci_ss_info_1013_00d6_13ce_8031 =
- {0x13ce, 0x8031, pci_subsys_1013_00d6_13ce_8031, 0};
-#undef pci_ss_info_13ce_8031
-#define pci_ss_info_13ce_8031 pci_ss_info_1013_00d6_13ce_8031
-static const pciSubsystemInfo pci_ss_info_1013_00d6_13cf_8031 =
- {0x13cf, 0x8031, pci_subsys_1013_00d6_13cf_8031, 0};
-#undef pci_ss_info_13cf_8031
-#define pci_ss_info_13cf_8031 pci_ss_info_1013_00d6_13cf_8031
-static const pciSubsystemInfo pci_ss_info_1013_6001_1014_1010 =
- {0x1014, 0x1010, pci_subsys_1013_6001_1014_1010, 0};
-#undef pci_ss_info_1014_1010
-#define pci_ss_info_1014_1010 pci_ss_info_1013_6001_1014_1010
-static const pciSubsystemInfo pci_ss_info_1013_6003_1013_4280 =
- {0x1013, 0x4280, pci_subsys_1013_6003_1013_4280, 0};
-#undef pci_ss_info_1013_4280
-#define pci_ss_info_1013_4280 pci_ss_info_1013_6003_1013_4280
-static const pciSubsystemInfo pci_ss_info_1013_6003_1681_0050 =
- {0x1681, 0x0050, pci_subsys_1013_6003_1681_0050, 0};
-#undef pci_ss_info_1681_0050
-#define pci_ss_info_1681_0050 pci_ss_info_1013_6003_1681_0050
-static const pciSubsystemInfo pci_ss_info_1013_6003_1681_a011 =
- {0x1681, 0xa011, pci_subsys_1013_6003_1681_a011, 0};
-#undef pci_ss_info_1681_a011
-#define pci_ss_info_1681_a011 pci_ss_info_1013_6003_1681_a011
-static const pciSubsystemInfo pci_ss_info_1013_6005_1013_4281 =
- {0x1013, 0x4281, pci_subsys_1013_6005_1013_4281, 0};
-#undef pci_ss_info_1013_4281
-#define pci_ss_info_1013_4281 pci_ss_info_1013_6005_1013_4281
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10a8 =
- {0x10cf, 0x10a8, pci_subsys_1013_6005_10cf_10a8, 0};
-#undef pci_ss_info_10cf_10a8
-#define pci_ss_info_10cf_10a8 pci_ss_info_1013_6005_10cf_10a8
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10a9 =
- {0x10cf, 0x10a9, pci_subsys_1013_6005_10cf_10a9, 0};
-#undef pci_ss_info_10cf_10a9
-#define pci_ss_info_10cf_10a9 pci_ss_info_1013_6005_10cf_10a9
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10aa =
- {0x10cf, 0x10aa, pci_subsys_1013_6005_10cf_10aa, 0};
-#undef pci_ss_info_10cf_10aa
-#define pci_ss_info_10cf_10aa pci_ss_info_1013_6005_10cf_10aa
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ab =
- {0x10cf, 0x10ab, pci_subsys_1013_6005_10cf_10ab, 0};
-#undef pci_ss_info_10cf_10ab
-#define pci_ss_info_10cf_10ab pci_ss_info_1013_6005_10cf_10ab
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ac =
- {0x10cf, 0x10ac, pci_subsys_1013_6005_10cf_10ac, 0};
-#undef pci_ss_info_10cf_10ac
-#define pci_ss_info_10cf_10ac pci_ss_info_1013_6005_10cf_10ac
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ad =
- {0x10cf, 0x10ad, pci_subsys_1013_6005_10cf_10ad, 0};
-#undef pci_ss_info_10cf_10ad
-#define pci_ss_info_10cf_10ad pci_ss_info_1013_6005_10cf_10ad
-static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10b4 =
- {0x10cf, 0x10b4, pci_subsys_1013_6005_10cf_10b4, 0};
-#undef pci_ss_info_10cf_10b4
-#define pci_ss_info_10cf_10b4 pci_ss_info_1013_6005_10cf_10b4
-static const pciSubsystemInfo pci_ss_info_1013_6005_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1013_6005_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1013_6005_1179_0001
-static const pciSubsystemInfo pci_ss_info_1013_6005_14c0_000c =
- {0x14c0, 0x000c, pci_subsys_1013_6005_14c0_000c, 0};
-#undef pci_ss_info_14c0_000c
-#define pci_ss_info_14c0_000c pci_ss_info_1013_6005_14c0_000c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1014_002e_1014_002e =
- {0x1014, 0x002e, pci_subsys_1014_002e_1014_002e, 0};
-#undef pci_ss_info_1014_002e
-#define pci_ss_info_1014_002e pci_ss_info_1014_002e_1014_002e
-static const pciSubsystemInfo pci_ss_info_1014_002e_1014_022e =
- {0x1014, 0x022e, pci_subsys_1014_002e_1014_022e, 0};
-#undef pci_ss_info_1014_022e
-#define pci_ss_info_1014_022e pci_ss_info_1014_002e_1014_022e
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_003e =
- {0x1014, 0x003e, pci_subsys_1014_003e_1014_003e, 0};
-#undef pci_ss_info_1014_003e
-#define pci_ss_info_1014_003e pci_ss_info_1014_003e_1014_003e
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00cd =
- {0x1014, 0x00cd, pci_subsys_1014_003e_1014_00cd, 0};
-#undef pci_ss_info_1014_00cd
-#define pci_ss_info_1014_00cd pci_ss_info_1014_003e_1014_00cd
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00ce =
- {0x1014, 0x00ce, pci_subsys_1014_003e_1014_00ce, 0};
-#undef pci_ss_info_1014_00ce
-#define pci_ss_info_1014_00ce pci_ss_info_1014_003e_1014_00ce
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00cf =
- {0x1014, 0x00cf, pci_subsys_1014_003e_1014_00cf, 0};
-#undef pci_ss_info_1014_00cf
-#define pci_ss_info_1014_00cf pci_ss_info_1014_003e_1014_00cf
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00e4 =
- {0x1014, 0x00e4, pci_subsys_1014_003e_1014_00e4, 0};
-#undef pci_ss_info_1014_00e4
-#define pci_ss_info_1014_00e4 pci_ss_info_1014_003e_1014_00e4
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00e5 =
- {0x1014, 0x00e5, pci_subsys_1014_003e_1014_00e5, 0};
-#undef pci_ss_info_1014_00e5
-#define pci_ss_info_1014_00e5 pci_ss_info_1014_003e_1014_00e5
-static const pciSubsystemInfo pci_ss_info_1014_003e_1014_016d =
- {0x1014, 0x016d, pci_subsys_1014_003e_1014_016d, 0};
-#undef pci_ss_info_1014_016d
-#define pci_ss_info_1014_016d pci_ss_info_1014_003e_1014_016d
-static const pciSubsystemInfo pci_ss_info_1014_0090_1014_008e =
- {0x1014, 0x008e, pci_subsys_1014_0090_1014_008e, 0};
-#undef pci_ss_info_1014_008e
-#define pci_ss_info_1014_008e pci_ss_info_1014_0090_1014_008e
-static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0097 =
- {0x1014, 0x0097, pci_subsys_1014_0096_1014_0097, 0};
-#undef pci_ss_info_1014_0097
-#define pci_ss_info_1014_0097 pci_ss_info_1014_0096_1014_0097
-static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0098 =
- {0x1014, 0x0098, pci_subsys_1014_0096_1014_0098, 0};
-#undef pci_ss_info_1014_0098
-#define pci_ss_info_1014_0098 pci_ss_info_1014_0096_1014_0098
-static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0099 =
- {0x1014, 0x0099, pci_subsys_1014_0096_1014_0099, 0};
-#undef pci_ss_info_1014_0099
-#define pci_ss_info_1014_0099 pci_ss_info_1014_0096_1014_0099
-static const pciSubsystemInfo pci_ss_info_1014_0142_1014_0143 =
- {0x1014, 0x0143, pci_subsys_1014_0142_1014_0143, 0};
-#undef pci_ss_info_1014_0143
-#define pci_ss_info_1014_0143 pci_ss_info_1014_0142_1014_0143
-static const pciSubsystemInfo pci_ss_info_1014_0144_1014_0145 =
- {0x1014, 0x0145, pci_subsys_1014_0144_1014_0145, 0};
-#undef pci_ss_info_1014_0145
-#define pci_ss_info_1014_0145 pci_ss_info_1014_0144_1014_0145
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_01be =
- {0x1014, 0x01be, pci_subsys_1014_01bd_1014_01be, 0};
-#undef pci_ss_info_1014_01be
-#define pci_ss_info_1014_01be pci_ss_info_1014_01bd_1014_01be
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_01bf =
- {0x1014, 0x01bf, pci_subsys_1014_01bd_1014_01bf, 0};
-#undef pci_ss_info_1014_01bf
-#define pci_ss_info_1014_01bf pci_ss_info_1014_01bd_1014_01bf
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0208 =
- {0x1014, 0x0208, pci_subsys_1014_01bd_1014_0208, 0};
-#undef pci_ss_info_1014_0208
-#define pci_ss_info_1014_0208 pci_ss_info_1014_01bd_1014_0208
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_020e =
- {0x1014, 0x020e, pci_subsys_1014_01bd_1014_020e, 0};
-#undef pci_ss_info_1014_020e
-#define pci_ss_info_1014_020e pci_ss_info_1014_01bd_1014_020e
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_022e =
- {0x1014, 0x022e, pci_subsys_1014_01bd_1014_022e, 0};
-#undef pci_ss_info_1014_022e
-#define pci_ss_info_1014_022e pci_ss_info_1014_01bd_1014_022e
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0258 =
- {0x1014, 0x0258, pci_subsys_1014_01bd_1014_0258, 0};
-#undef pci_ss_info_1014_0258
-#define pci_ss_info_1014_0258 pci_ss_info_1014_01bd_1014_0258
-static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0259 =
- {0x1014, 0x0259, pci_subsys_1014_01bd_1014_0259, 0};
-#undef pci_ss_info_1014_0259
-#define pci_ss_info_1014_0259 pci_ss_info_1014_01bd_1014_0259
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0471 =
- {0x101e, 0x0471, pci_subsys_101e_1960_101e_0471, 0};
-#undef pci_ss_info_101e_0471
-#define pci_ss_info_101e_0471 pci_ss_info_101e_1960_101e_0471
-static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0475 =
- {0x101e, 0x0475, pci_subsys_101e_1960_101e_0475, 0};
-#undef pci_ss_info_101e_0475
-#define pci_ss_info_101e_0475 pci_ss_info_101e_1960_101e_0475
-static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0493 =
- {0x101e, 0x0493, pci_subsys_101e_1960_101e_0493, 0};
-#undef pci_ss_info_101e_0493
-#define pci_ss_info_101e_0493 pci_ss_info_101e_1960_101e_0493
-#endif
-static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0471 =
- {0x1028, 0x0471, pci_subsys_101e_1960_1028_0471, 0};
-#undef pci_ss_info_1028_0471
-#define pci_ss_info_1028_0471 pci_ss_info_101e_1960_1028_0471
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0475 =
- {0x1028, 0x0475, pci_subsys_101e_1960_1028_0475, 0};
-#undef pci_ss_info_1028_0475
-#define pci_ss_info_1028_0475 pci_ss_info_101e_1960_1028_0475
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0493 =
- {0x1028, 0x0493, pci_subsys_101e_1960_1028_0493, 0};
-#undef pci_ss_info_1028_0493
-#define pci_ss_info_1028_0493 pci_ss_info_101e_1960_1028_0493
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0511 =
- {0x1028, 0x0511, pci_subsys_101e_1960_1028_0511, 0};
-#undef pci_ss_info_1028_0511
-#define pci_ss_info_1028_0511 pci_ss_info_101e_1960_1028_0511
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_101e_9063_101e_0767 =
- {0x101e, 0x0767, pci_subsys_101e_9063_101e_0767, 0};
-#undef pci_ss_info_101e_0767
-#define pci_ss_info_101e_0767 pci_ss_info_101e_9063_101e_0767
-#endif
-static const pciSubsystemInfo pci_ss_info_1022_2000_1014_2000 =
- {0x1014, 0x2000, pci_subsys_1022_2000_1014_2000, 0};
-#undef pci_ss_info_1014_2000
-#define pci_ss_info_1014_2000 pci_ss_info_1022_2000_1014_2000
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_104c =
- {0x103c, 0x104c, pci_subsys_1022_2000_103c_104c, 0};
-#undef pci_ss_info_103c_104c
-#define pci_ss_info_103c_104c pci_ss_info_1022_2000_103c_104c
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_1064 =
- {0x103c, 0x1064, pci_subsys_1022_2000_103c_1064, 0};
-#undef pci_ss_info_103c_1064
-#define pci_ss_info_103c_1064 pci_ss_info_1022_2000_103c_1064
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_1065 =
- {0x103c, 0x1065, pci_subsys_1022_2000_103c_1065, 0};
-#undef pci_ss_info_103c_1065
-#define pci_ss_info_103c_1065 pci_ss_info_1022_2000_103c_1065
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_106c =
- {0x103c, 0x106c, pci_subsys_1022_2000_103c_106c, 0};
-#undef pci_ss_info_103c_106c
-#define pci_ss_info_103c_106c pci_ss_info_1022_2000_103c_106c
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_106e =
- {0x103c, 0x106e, pci_subsys_1022_2000_103c_106e, 0};
-#undef pci_ss_info_103c_106e
-#define pci_ss_info_103c_106e pci_ss_info_1022_2000_103c_106e
-static const pciSubsystemInfo pci_ss_info_1022_2000_103c_10ea =
- {0x103c, 0x10ea, pci_subsys_1022_2000_103c_10ea, 0};
-#undef pci_ss_info_103c_10ea
-#define pci_ss_info_103c_10ea pci_ss_info_1022_2000_103c_10ea
-static const pciSubsystemInfo pci_ss_info_1022_2000_1113_1220 =
- {0x1113, 0x1220, pci_subsys_1022_2000_1113_1220, 0};
-#undef pci_ss_info_1113_1220
-#define pci_ss_info_1113_1220 pci_ss_info_1022_2000_1113_1220
-static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2450 =
- {0x1259, 0x2450, pci_subsys_1022_2000_1259_2450, 0};
-#undef pci_ss_info_1259_2450
-#define pci_ss_info_1259_2450 pci_ss_info_1022_2000_1259_2450
-static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2454 =
- {0x1259, 0x2454, pci_subsys_1022_2000_1259_2454, 0};
-#undef pci_ss_info_1259_2454
-#define pci_ss_info_1259_2454 pci_ss_info_1022_2000_1259_2454
-static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2700 =
- {0x1259, 0x2700, pci_subsys_1022_2000_1259_2700, 0};
-#undef pci_ss_info_1259_2700
-#define pci_ss_info_1259_2700 pci_ss_info_1022_2000_1259_2700
-static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2701 =
- {0x1259, 0x2701, pci_subsys_1022_2000_1259_2701, 0};
-#undef pci_ss_info_1259_2701
-#define pci_ss_info_1259_2701 pci_ss_info_1022_2000_1259_2701
-static const pciSubsystemInfo pci_ss_info_1022_2001_1092_0a78 =
- {0x1092, 0x0a78, pci_subsys_1022_2001_1092_0a78, 0};
-#undef pci_ss_info_1092_0a78
-#define pci_ss_info_1092_0a78 pci_ss_info_1022_2001_1092_0a78
-static const pciSubsystemInfo pci_ss_info_1022_2001_1668_0299 =
- {0x1668, 0x0299, pci_subsys_1022_2001_1668_0299, 0};
-#undef pci_ss_info_1668_0299
-#define pci_ss_info_1668_0299 pci_ss_info_1022_2001_1668_0299
-static const pciSubsystemInfo pci_ss_info_1022_7440_1043_8044 =
- {0x1043, 0x8044, pci_subsys_1022_7440_1043_8044, 0};
-#undef pci_ss_info_1043_8044
-#define pci_ss_info_1043_8044 pci_ss_info_1022_7440_1043_8044
-static const pciSubsystemInfo pci_ss_info_1022_7443_1043_8044 =
- {0x1043, 0x8044, pci_subsys_1022_7443_1043_8044, 0};
-#undef pci_ss_info_1043_8044
-#define pci_ss_info_1043_8044 pci_ss_info_1022_7443_1043_8044
-static const pciSubsystemInfo pci_ss_info_1023_8400_1023_8400 =
- {0x1023, 0x8400, pci_subsys_1023_8400_1023_8400, 0};
-#undef pci_ss_info_1023_8400
-#define pci_ss_info_1023_8400 pci_ss_info_1023_8400_1023_8400
-static const pciSubsystemInfo pci_ss_info_1023_8420_0e11_b15a =
- {0x0e11, 0xb15a, pci_subsys_1023_8420_0e11_b15a, 0};
-#undef pci_ss_info_0e11_b15a
-#define pci_ss_info_0e11_b15a pci_ss_info_1023_8420_0e11_b15a
-static const pciSubsystemInfo pci_ss_info_1023_8520_0e11_b16e =
- {0x0e11, 0xb16e, pci_subsys_1023_8520_0e11_b16e, 0};
-#undef pci_ss_info_0e11_b16e
-#define pci_ss_info_0e11_b16e pci_ss_info_1023_8520_0e11_b16e
-static const pciSubsystemInfo pci_ss_info_1023_8520_1023_8520 =
- {0x1023, 0x8520, pci_subsys_1023_8520_1023_8520, 0};
-#undef pci_ss_info_1023_8520
-#define pci_ss_info_1023_8520 pci_ss_info_1023_8520_1023_8520
-static const pciSubsystemInfo pci_ss_info_1023_8620_1014_0502 =
- {0x1014, 0x0502, pci_subsys_1023_8620_1014_0502, 0};
-#undef pci_ss_info_1014_0502
-#define pci_ss_info_1014_0502 pci_ss_info_1023_8620_1014_0502
-static const pciSubsystemInfo pci_ss_info_1023_9525_10cf_1094 =
- {0x10cf, 0x1094, pci_subsys_1023_9525_10cf_1094, 0};
-#undef pci_ss_info_10cf_1094
-#define pci_ss_info_10cf_1094 pci_ss_info_1023_9525_10cf_1094
-static const pciSubsystemInfo pci_ss_info_1023_9750_1014_9750 =
- {0x1014, 0x9750, pci_subsys_1023_9750_1014_9750, 0};
-#undef pci_ss_info_1014_9750
-#define pci_ss_info_1014_9750 pci_ss_info_1023_9750_1014_9750
-static const pciSubsystemInfo pci_ss_info_1023_9750_1023_9750 =
- {0x1023, 0x9750, pci_subsys_1023_9750_1023_9750, 0};
-#undef pci_ss_info_1023_9750
-#define pci_ss_info_1023_9750 pci_ss_info_1023_9750_1023_9750
-static const pciSubsystemInfo pci_ss_info_1023_9880_1023_9880 =
- {0x1023, 0x9880, pci_subsys_1023_9880_1023_9880, 0};
-#undef pci_ss_info_1023_9880
-#define pci_ss_info_1023_9880 pci_ss_info_1023_9880_1023_9880
-static const pciSubsystemInfo pci_ss_info_1025_1521_10b9_1521 =
- {0x10b9, 0x1521, pci_subsys_1025_1521_10b9_1521, 0};
-#undef pci_ss_info_10b9_1521
-#define pci_ss_info_10b9_1521 pci_ss_info_1025_1521_10b9_1521
-static const pciSubsystemInfo pci_ss_info_1025_1523_10b9_1523 =
- {0x10b9, 0x1523, pci_subsys_1025_1523_10b9_1523, 0};
-#undef pci_ss_info_10b9_1523
-#define pci_ss_info_10b9_1523 pci_ss_info_1025_1523_10b9_1523
-static const pciSubsystemInfo pci_ss_info_1025_1533_10b9_1533 =
- {0x10b9, 0x1533, pci_subsys_1025_1533_10b9_1533, 0};
-#undef pci_ss_info_10b9_1533
-#define pci_ss_info_10b9_1533 pci_ss_info_1025_1533_10b9_1533
-static const pciSubsystemInfo pci_ss_info_1025_1541_10b9_1541 =
- {0x10b9, 0x1541, pci_subsys_1025_1541_10b9_1541, 0};
-#undef pci_ss_info_10b9_1541
-#define pci_ss_info_10b9_1541 pci_ss_info_1025_1541_10b9_1541
-static const pciSubsystemInfo pci_ss_info_1025_7101_10b9_7101 =
- {0x10b9, 0x7101, pci_subsys_1025_7101_10b9_7101, 0};
-#undef pci_ss_info_10b9_7101
-#define pci_ss_info_10b9_7101 pci_ss_info_1025_7101_10b9_7101
-static const pciSubsystemInfo pci_ss_info_1028_0001_1028_0001 =
- {0x1028, 0x0001, pci_subsys_1028_0001_1028_0001, 0};
-#undef pci_ss_info_1028_0001
-#define pci_ss_info_1028_0001 pci_ss_info_1028_0001_1028_0001
-static const pciSubsystemInfo pci_ss_info_1028_0002_1028_0002 =
- {0x1028, 0x0002, pci_subsys_1028_0002_1028_0002, 0};
-#undef pci_ss_info_1028_0002
-#define pci_ss_info_1028_0002 pci_ss_info_1028_0002_1028_0002
-static const pciSubsystemInfo pci_ss_info_1028_0002_1028_00d1 =
- {0x1028, 0x00d1, pci_subsys_1028_0002_1028_00d1, 0};
-#undef pci_ss_info_1028_00d1
-#define pci_ss_info_1028_00d1 pci_ss_info_1028_0002_1028_00d1
-static const pciSubsystemInfo pci_ss_info_1028_0002_1028_00d9 =
- {0x1028, 0x00d9, pci_subsys_1028_0002_1028_00d9, 0};
-#undef pci_ss_info_1028_00d9
-#define pci_ss_info_1028_00d9 pci_ss_info_1028_0002_1028_00d9
-static const pciSubsystemInfo pci_ss_info_1028_0003_1028_0003 =
- {0x1028, 0x0003, pci_subsys_1028_0003_1028_0003, 0};
-#undef pci_ss_info_1028_0003
-#define pci_ss_info_1028_0003 pci_ss_info_1028_0003_1028_0003
-static const pciSubsystemInfo pci_ss_info_1028_0004_1028_00d0 =
- {0x1028, 0x00d0, pci_subsys_1028_0004_1028_00d0, 0};
-#undef pci_ss_info_1028_00d0
-#define pci_ss_info_1028_00d0 pci_ss_info_1028_0004_1028_00d0
-static const pciSubsystemInfo pci_ss_info_1028_000a_1028_0106 =
- {0x1028, 0x0106, pci_subsys_1028_000a_1028_0106, 0};
-#undef pci_ss_info_1028_0106
-#define pci_ss_info_1028_0106 pci_ss_info_1028_000a_1028_0106
-static const pciSubsystemInfo pci_ss_info_1028_000a_1028_011b =
- {0x1028, 0x011b, pci_subsys_1028_000a_1028_011b, 0};
-#undef pci_ss_info_1028_011b
-#define pci_ss_info_1028_011b pci_ss_info_1028_000a_1028_011b
-static const pciSubsystemInfo pci_ss_info_1028_000a_1028_0121 =
- {0x1028, 0x0121, pci_subsys_1028_000a_1028_0121, 0};
-#undef pci_ss_info_1028_0121
-#define pci_ss_info_1028_0121 pci_ss_info_1028_000a_1028_0121
-static const pciSubsystemInfo pci_ss_info_102b_051a_102b_0100 =
- {0x102b, 0x0100, pci_subsys_102b_051a_102b_0100, 0};
-#undef pci_ss_info_102b_0100
-#define pci_ss_info_102b_0100 pci_ss_info_102b_051a_102b_0100
-static const pciSubsystemInfo pci_ss_info_102b_051a_102b_1100 =
- {0x102b, 0x1100, pci_subsys_102b_051a_102b_1100, 0};
-#undef pci_ss_info_102b_1100
-#define pci_ss_info_102b_1100 pci_ss_info_102b_051a_102b_1100
-static const pciSubsystemInfo pci_ss_info_102b_051a_102b_1200 =
- {0x102b, 0x1200, pci_subsys_102b_051a_102b_1200, 0};
-#undef pci_ss_info_102b_1200
-#define pci_ss_info_102b_1200 pci_ss_info_102b_051a_102b_1200
-static const pciSubsystemInfo pci_ss_info_102b_051a_1100_102b =
- {0x1100, 0x102b, pci_subsys_102b_051a_1100_102b, 0};
-#undef pci_ss_info_1100_102b
-#define pci_ss_info_1100_102b pci_ss_info_102b_051a_1100_102b
-static const pciSubsystemInfo pci_ss_info_102b_051a_110a_0018 =
- {0x110a, 0x0018, pci_subsys_102b_051a_110a_0018, 0};
-#undef pci_ss_info_110a_0018
-#define pci_ss_info_110a_0018 pci_ss_info_102b_051a_110a_0018
-static const pciSubsystemInfo pci_ss_info_102b_051b_102b_051b =
- {0x102b, 0x051b, pci_subsys_102b_051b_102b_051b, 0};
-#undef pci_ss_info_102b_051b
-#define pci_ss_info_102b_051b pci_ss_info_102b_051b_102b_051b
-static const pciSubsystemInfo pci_ss_info_102b_051b_102b_1100 =
- {0x102b, 0x1100, pci_subsys_102b_051b_102b_1100, 0};
-#undef pci_ss_info_102b_1100
-#define pci_ss_info_102b_1100 pci_ss_info_102b_051b_102b_1100
-static const pciSubsystemInfo pci_ss_info_102b_051b_102b_1200 =
- {0x102b, 0x1200, pci_subsys_102b_051b_102b_1200, 0};
-#undef pci_ss_info_102b_1200
-#define pci_ss_info_102b_1200 pci_ss_info_102b_051b_102b_1200
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbc2 =
- {0x102b, 0xdbc2, pci_subsys_102b_0520_102b_dbc2, 0};
-#undef pci_ss_info_102b_dbc2
-#define pci_ss_info_102b_dbc2 pci_ss_info_102b_0520_102b_dbc2
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbc8 =
- {0x102b, 0xdbc8, pci_subsys_102b_0520_102b_dbc8, 0};
-#undef pci_ss_info_102b_dbc8
-#define pci_ss_info_102b_dbc8 pci_ss_info_102b_0520_102b_dbc8
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbe2 =
- {0x102b, 0xdbe2, pci_subsys_102b_0520_102b_dbe2, 0};
-#undef pci_ss_info_102b_dbe2
-#define pci_ss_info_102b_dbe2 pci_ss_info_102b_0520_102b_dbe2
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbe8 =
- {0x102b, 0xdbe8, pci_subsys_102b_0520_102b_dbe8, 0};
-#undef pci_ss_info_102b_dbe8
-#define pci_ss_info_102b_dbe8 pci_ss_info_102b_0520_102b_dbe8
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_ff03 =
- {0x102b, 0xff03, pci_subsys_102b_0520_102b_ff03, 0};
-#undef pci_ss_info_102b_ff03
-#define pci_ss_info_102b_ff03 pci_ss_info_102b_0520_102b_ff03
-static const pciSubsystemInfo pci_ss_info_102b_0520_102b_ff04 =
- {0x102b, 0xff04, pci_subsys_102b_0520_102b_ff04, 0};
-#undef pci_ss_info_102b_ff04
-#define pci_ss_info_102b_ff04 pci_ss_info_102b_0520_102b_ff04
-static const pciSubsystemInfo pci_ss_info_102b_0521_1014_ff03 =
- {0x1014, 0xff03, pci_subsys_102b_0521_1014_ff03, 0};
-#undef pci_ss_info_1014_ff03
-#define pci_ss_info_1014_ff03 pci_ss_info_102b_0521_1014_ff03
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_48e9 =
- {0x102b, 0x48e9, pci_subsys_102b_0521_102b_48e9, 0};
-#undef pci_ss_info_102b_48e9
-#define pci_ss_info_102b_48e9 pci_ss_info_102b_0521_102b_48e9
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_48f8 =
- {0x102b, 0x48f8, pci_subsys_102b_0521_102b_48f8, 0};
-#undef pci_ss_info_102b_48f8
-#define pci_ss_info_102b_48f8 pci_ss_info_102b_0521_102b_48f8
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_4a60 =
- {0x102b, 0x4a60, pci_subsys_102b_0521_102b_4a60, 0};
-#undef pci_ss_info_102b_4a60
-#define pci_ss_info_102b_4a60 pci_ss_info_102b_0521_102b_4a60
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_4a64 =
- {0x102b, 0x4a64, pci_subsys_102b_0521_102b_4a64, 0};
-#undef pci_ss_info_102b_4a64
-#define pci_ss_info_102b_4a64 pci_ss_info_102b_0521_102b_4a64
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c93c =
- {0x102b, 0xc93c, pci_subsys_102b_0521_102b_c93c, 0};
-#undef pci_ss_info_102b_c93c
-#define pci_ss_info_102b_c93c pci_ss_info_102b_0521_102b_c93c
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c9b0 =
- {0x102b, 0xc9b0, pci_subsys_102b_0521_102b_c9b0, 0};
-#undef pci_ss_info_102b_c9b0
-#define pci_ss_info_102b_c9b0 pci_ss_info_102b_0521_102b_c9b0
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c9bc =
- {0x102b, 0xc9bc, pci_subsys_102b_0521_102b_c9bc, 0};
-#undef pci_ss_info_102b_c9bc
-#define pci_ss_info_102b_c9bc pci_ss_info_102b_0521_102b_c9bc
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ca60 =
- {0x102b, 0xca60, pci_subsys_102b_0521_102b_ca60, 0};
-#undef pci_ss_info_102b_ca60
-#define pci_ss_info_102b_ca60 pci_ss_info_102b_0521_102b_ca60
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ca6c =
- {0x102b, 0xca6c, pci_subsys_102b_0521_102b_ca6c, 0};
-#undef pci_ss_info_102b_ca6c
-#define pci_ss_info_102b_ca6c pci_ss_info_102b_0521_102b_ca6c
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbbc =
- {0x102b, 0xdbbc, pci_subsys_102b_0521_102b_dbbc, 0};
-#undef pci_ss_info_102b_dbbc
-#define pci_ss_info_102b_dbbc pci_ss_info_102b_0521_102b_dbbc
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc2 =
- {0x102b, 0xdbc2, pci_subsys_102b_0521_102b_dbc2, 0};
-#undef pci_ss_info_102b_dbc2
-#define pci_ss_info_102b_dbc2 pci_ss_info_102b_0521_102b_dbc2
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc3 =
- {0x102b, 0xdbc3, pci_subsys_102b_0521_102b_dbc3, 0};
-#undef pci_ss_info_102b_dbc3
-#define pci_ss_info_102b_dbc3 pci_ss_info_102b_0521_102b_dbc3
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc8 =
- {0x102b, 0xdbc8, pci_subsys_102b_0521_102b_dbc8, 0};
-#undef pci_ss_info_102b_dbc8
-#define pci_ss_info_102b_dbc8 pci_ss_info_102b_0521_102b_dbc8
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd2 =
- {0x102b, 0xdbd2, pci_subsys_102b_0521_102b_dbd2, 0};
-#undef pci_ss_info_102b_dbd2
-#define pci_ss_info_102b_dbd2 pci_ss_info_102b_0521_102b_dbd2
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd3 =
- {0x102b, 0xdbd3, pci_subsys_102b_0521_102b_dbd3, 0};
-#undef pci_ss_info_102b_dbd3
-#define pci_ss_info_102b_dbd3 pci_ss_info_102b_0521_102b_dbd3
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd4 =
- {0x102b, 0xdbd4, pci_subsys_102b_0521_102b_dbd4, 0};
-#undef pci_ss_info_102b_dbd4
-#define pci_ss_info_102b_dbd4 pci_ss_info_102b_0521_102b_dbd4
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd5 =
- {0x102b, 0xdbd5, pci_subsys_102b_0521_102b_dbd5, 0};
-#undef pci_ss_info_102b_dbd5
-#define pci_ss_info_102b_dbd5 pci_ss_info_102b_0521_102b_dbd5
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd8 =
- {0x102b, 0xdbd8, pci_subsys_102b_0521_102b_dbd8, 0};
-#undef pci_ss_info_102b_dbd8
-#define pci_ss_info_102b_dbd8 pci_ss_info_102b_0521_102b_dbd8
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd9 =
- {0x102b, 0xdbd9, pci_subsys_102b_0521_102b_dbd9, 0};
-#undef pci_ss_info_102b_dbd9
-#define pci_ss_info_102b_dbd9 pci_ss_info_102b_0521_102b_dbd9
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe2 =
- {0x102b, 0xdbe2, pci_subsys_102b_0521_102b_dbe2, 0};
-#undef pci_ss_info_102b_dbe2
-#define pci_ss_info_102b_dbe2 pci_ss_info_102b_0521_102b_dbe2
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe3 =
- {0x102b, 0xdbe3, pci_subsys_102b_0521_102b_dbe3, 0};
-#undef pci_ss_info_102b_dbe3
-#define pci_ss_info_102b_dbe3 pci_ss_info_102b_0521_102b_dbe3
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe8 =
- {0x102b, 0xdbe8, pci_subsys_102b_0521_102b_dbe8, 0};
-#undef pci_ss_info_102b_dbe8
-#define pci_ss_info_102b_dbe8 pci_ss_info_102b_0521_102b_dbe8
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf2 =
- {0x102b, 0xdbf2, pci_subsys_102b_0521_102b_dbf2, 0};
-#undef pci_ss_info_102b_dbf2
-#define pci_ss_info_102b_dbf2 pci_ss_info_102b_0521_102b_dbf2
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf3 =
- {0x102b, 0xdbf3, pci_subsys_102b_0521_102b_dbf3, 0};
-#undef pci_ss_info_102b_dbf3
-#define pci_ss_info_102b_dbf3 pci_ss_info_102b_0521_102b_dbf3
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf4 =
- {0x102b, 0xdbf4, pci_subsys_102b_0521_102b_dbf4, 0};
-#undef pci_ss_info_102b_dbf4
-#define pci_ss_info_102b_dbf4 pci_ss_info_102b_0521_102b_dbf4
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf5 =
- {0x102b, 0xdbf5, pci_subsys_102b_0521_102b_dbf5, 0};
-#undef pci_ss_info_102b_dbf5
-#define pci_ss_info_102b_dbf5 pci_ss_info_102b_0521_102b_dbf5
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf8 =
- {0x102b, 0xdbf8, pci_subsys_102b_0521_102b_dbf8, 0};
-#undef pci_ss_info_102b_dbf8
-#define pci_ss_info_102b_dbf8 pci_ss_info_102b_0521_102b_dbf8
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf9 =
- {0x102b, 0xdbf9, pci_subsys_102b_0521_102b_dbf9, 0};
-#undef pci_ss_info_102b_dbf9
-#define pci_ss_info_102b_dbf9 pci_ss_info_102b_0521_102b_dbf9
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_f806 =
- {0x102b, 0xf806, pci_subsys_102b_0521_102b_f806, 0};
-#undef pci_ss_info_102b_f806
-#define pci_ss_info_102b_f806 pci_ss_info_102b_0521_102b_f806
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff00 =
- {0x102b, 0xff00, pci_subsys_102b_0521_102b_ff00, 0};
-#undef pci_ss_info_102b_ff00
-#define pci_ss_info_102b_ff00 pci_ss_info_102b_0521_102b_ff00
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff02 =
- {0x102b, 0xff02, pci_subsys_102b_0521_102b_ff02, 0};
-#undef pci_ss_info_102b_ff02
-#define pci_ss_info_102b_ff02 pci_ss_info_102b_0521_102b_ff02
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff03 =
- {0x102b, 0xff03, pci_subsys_102b_0521_102b_ff03, 0};
-#undef pci_ss_info_102b_ff03
-#define pci_ss_info_102b_ff03 pci_ss_info_102b_0521_102b_ff03
-static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff04 =
- {0x102b, 0xff04, pci_subsys_102b_0521_102b_ff04, 0};
-#undef pci_ss_info_102b_ff04
-#define pci_ss_info_102b_ff04 pci_ss_info_102b_0521_102b_ff04
-static const pciSubsystemInfo pci_ss_info_102b_0521_110a_0032 =
- {0x110a, 0x0032, pci_subsys_102b_0521_110a_0032, 0};
-#undef pci_ss_info_110a_0032
-#define pci_ss_info_110a_0032 pci_ss_info_102b_0521_110a_0032
-static const pciSubsystemInfo pci_ss_info_102b_0525_0e11_b16f =
- {0x0e11, 0xb16f, pci_subsys_102b_0525_0e11_b16f, 0};
-#undef pci_ss_info_0e11_b16f
-#define pci_ss_info_0e11_b16f pci_ss_info_102b_0525_0e11_b16f
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0328 =
- {0x102b, 0x0328, pci_subsys_102b_0525_102b_0328, 0};
-#undef pci_ss_info_102b_0328
-#define pci_ss_info_102b_0328 pci_ss_info_102b_0525_102b_0328
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0338 =
- {0x102b, 0x0338, pci_subsys_102b_0525_102b_0338, 0};
-#undef pci_ss_info_102b_0338
-#define pci_ss_info_102b_0338 pci_ss_info_102b_0525_102b_0338
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0378 =
- {0x102b, 0x0378, pci_subsys_102b_0525_102b_0378, 0};
-#undef pci_ss_info_102b_0378
-#define pci_ss_info_102b_0378 pci_ss_info_102b_0525_102b_0378
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0541 =
- {0x102b, 0x0541, pci_subsys_102b_0525_102b_0541, 0};
-#undef pci_ss_info_102b_0541
-#define pci_ss_info_102b_0541 pci_ss_info_102b_0525_102b_0541
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0542 =
- {0x102b, 0x0542, pci_subsys_102b_0525_102b_0542, 0};
-#undef pci_ss_info_102b_0542
-#define pci_ss_info_102b_0542 pci_ss_info_102b_0525_102b_0542
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0543 =
- {0x102b, 0x0543, pci_subsys_102b_0525_102b_0543, 0};
-#undef pci_ss_info_102b_0543
-#define pci_ss_info_102b_0543 pci_ss_info_102b_0525_102b_0543
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0641 =
- {0x102b, 0x0641, pci_subsys_102b_0525_102b_0641, 0};
-#undef pci_ss_info_102b_0641
-#define pci_ss_info_102b_0641 pci_ss_info_102b_0525_102b_0641
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0642 =
- {0x102b, 0x0642, pci_subsys_102b_0525_102b_0642, 0};
-#undef pci_ss_info_102b_0642
-#define pci_ss_info_102b_0642 pci_ss_info_102b_0525_102b_0642
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0643 =
- {0x102b, 0x0643, pci_subsys_102b_0525_102b_0643, 0};
-#undef pci_ss_info_102b_0643
-#define pci_ss_info_102b_0643 pci_ss_info_102b_0525_102b_0643
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_07c0 =
- {0x102b, 0x07c0, pci_subsys_102b_0525_102b_07c0, 0};
-#undef pci_ss_info_102b_07c0
-#define pci_ss_info_102b_07c0 pci_ss_info_102b_0525_102b_07c0
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_07c1 =
- {0x102b, 0x07c1, pci_subsys_102b_0525_102b_07c1, 0};
-#undef pci_ss_info_102b_07c1
-#define pci_ss_info_102b_07c1 pci_ss_info_102b_0525_102b_07c1
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0d41 =
- {0x102b, 0x0d41, pci_subsys_102b_0525_102b_0d41, 0};
-#undef pci_ss_info_102b_0d41
-#define pci_ss_info_102b_0d41 pci_ss_info_102b_0525_102b_0d41
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0d42 =
- {0x102b, 0x0d42, pci_subsys_102b_0525_102b_0d42, 0};
-#undef pci_ss_info_102b_0d42
-#define pci_ss_info_102b_0d42 pci_ss_info_102b_0525_102b_0d42
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e00 =
- {0x102b, 0x0e00, pci_subsys_102b_0525_102b_0e00, 0};
-#undef pci_ss_info_102b_0e00
-#define pci_ss_info_102b_0e00 pci_ss_info_102b_0525_102b_0e00
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e01 =
- {0x102b, 0x0e01, pci_subsys_102b_0525_102b_0e01, 0};
-#undef pci_ss_info_102b_0e01
-#define pci_ss_info_102b_0e01 pci_ss_info_102b_0525_102b_0e01
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e02 =
- {0x102b, 0x0e02, pci_subsys_102b_0525_102b_0e02, 0};
-#undef pci_ss_info_102b_0e02
-#define pci_ss_info_102b_0e02 pci_ss_info_102b_0525_102b_0e02
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e03 =
- {0x102b, 0x0e03, pci_subsys_102b_0525_102b_0e03, 0};
-#undef pci_ss_info_102b_0e03
-#define pci_ss_info_102b_0e03 pci_ss_info_102b_0525_102b_0e03
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f80 =
- {0x102b, 0x0f80, pci_subsys_102b_0525_102b_0f80, 0};
-#undef pci_ss_info_102b_0f80
-#define pci_ss_info_102b_0f80 pci_ss_info_102b_0525_102b_0f80
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f81 =
- {0x102b, 0x0f81, pci_subsys_102b_0525_102b_0f81, 0};
-#undef pci_ss_info_102b_0f81
-#define pci_ss_info_102b_0f81 pci_ss_info_102b_0525_102b_0f81
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f82 =
- {0x102b, 0x0f82, pci_subsys_102b_0525_102b_0f82, 0};
-#undef pci_ss_info_102b_0f82
-#define pci_ss_info_102b_0f82 pci_ss_info_102b_0525_102b_0f82
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f83 =
- {0x102b, 0x0f83, pci_subsys_102b_0525_102b_0f83, 0};
-#undef pci_ss_info_102b_0f83
-#define pci_ss_info_102b_0f83 pci_ss_info_102b_0525_102b_0f83
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_19d8 =
- {0x102b, 0x19d8, pci_subsys_102b_0525_102b_19d8, 0};
-#undef pci_ss_info_102b_19d8
-#define pci_ss_info_102b_19d8 pci_ss_info_102b_0525_102b_19d8
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_19f8 =
- {0x102b, 0x19f8, pci_subsys_102b_0525_102b_19f8, 0};
-#undef pci_ss_info_102b_19f8
-#define pci_ss_info_102b_19f8 pci_ss_info_102b_0525_102b_19f8
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2159 =
- {0x102b, 0x2159, pci_subsys_102b_0525_102b_2159, 0};
-#undef pci_ss_info_102b_2159
-#define pci_ss_info_102b_2159 pci_ss_info_102b_0525_102b_2159
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2179 =
- {0x102b, 0x2179, pci_subsys_102b_0525_102b_2179, 0};
-#undef pci_ss_info_102b_2179
-#define pci_ss_info_102b_2179 pci_ss_info_102b_0525_102b_2179
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_217d =
- {0x102b, 0x217d, pci_subsys_102b_0525_102b_217d, 0};
-#undef pci_ss_info_102b_217d
-#define pci_ss_info_102b_217d pci_ss_info_102b_0525_102b_217d
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c0 =
- {0x102b, 0x23c0, pci_subsys_102b_0525_102b_23c0, 0};
-#undef pci_ss_info_102b_23c0
-#define pci_ss_info_102b_23c0 pci_ss_info_102b_0525_102b_23c0
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c1 =
- {0x102b, 0x23c1, pci_subsys_102b_0525_102b_23c1, 0};
-#undef pci_ss_info_102b_23c1
-#define pci_ss_info_102b_23c1 pci_ss_info_102b_0525_102b_23c1
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c2 =
- {0x102b, 0x23c2, pci_subsys_102b_0525_102b_23c2, 0};
-#undef pci_ss_info_102b_23c2
-#define pci_ss_info_102b_23c2 pci_ss_info_102b_0525_102b_23c2
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c3 =
- {0x102b, 0x23c3, pci_subsys_102b_0525_102b_23c3, 0};
-#undef pci_ss_info_102b_23c3
-#define pci_ss_info_102b_23c3 pci_ss_info_102b_0525_102b_23c3
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2f58 =
- {0x102b, 0x2f58, pci_subsys_102b_0525_102b_2f58, 0};
-#undef pci_ss_info_102b_2f58
-#define pci_ss_info_102b_2f58 pci_ss_info_102b_0525_102b_2f58
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2f78 =
- {0x102b, 0x2f78, pci_subsys_102b_0525_102b_2f78, 0};
-#undef pci_ss_info_102b_2f78
-#define pci_ss_info_102b_2f78 pci_ss_info_102b_0525_102b_2f78
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_3693 =
- {0x102b, 0x3693, pci_subsys_102b_0525_102b_3693, 0};
-#undef pci_ss_info_102b_3693
-#define pci_ss_info_102b_3693 pci_ss_info_102b_0525_102b_3693
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5dd0 =
- {0x102b, 0x5dd0, pci_subsys_102b_0525_102b_5dd0, 0};
-#undef pci_ss_info_102b_5dd0
-#define pci_ss_info_102b_5dd0 pci_ss_info_102b_0525_102b_5dd0
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f50 =
- {0x102b, 0x5f50, pci_subsys_102b_0525_102b_5f50, 0};
-#undef pci_ss_info_102b_5f50
-#define pci_ss_info_102b_5f50 pci_ss_info_102b_0525_102b_5f50
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f51 =
- {0x102b, 0x5f51, pci_subsys_102b_0525_102b_5f51, 0};
-#undef pci_ss_info_102b_5f51
-#define pci_ss_info_102b_5f51 pci_ss_info_102b_0525_102b_5f51
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f52 =
- {0x102b, 0x5f52, pci_subsys_102b_0525_102b_5f52, 0};
-#undef pci_ss_info_102b_5f52
-#define pci_ss_info_102b_5f52 pci_ss_info_102b_0525_102b_5f52
-static const pciSubsystemInfo pci_ss_info_102b_0525_102b_9010 =
- {0x102b, 0x9010, pci_subsys_102b_0525_102b_9010, 0};
-#undef pci_ss_info_102b_9010
-#define pci_ss_info_102b_9010 pci_ss_info_102b_0525_102b_9010
-static const pciSubsystemInfo pci_ss_info_102b_0525_1458_0400 =
- {0x1458, 0x0400, pci_subsys_102b_0525_1458_0400, 0};
-#undef pci_ss_info_1458_0400
-#define pci_ss_info_1458_0400 pci_ss_info_102b_0525_1458_0400
-static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0001 =
- {0x1705, 0x0001, pci_subsys_102b_0525_1705_0001, 0};
-#undef pci_ss_info_1705_0001
-#define pci_ss_info_1705_0001 pci_ss_info_102b_0525_1705_0001
-static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0002 =
- {0x1705, 0x0002, pci_subsys_102b_0525_1705_0002, 0};
-#undef pci_ss_info_1705_0002
-#define pci_ss_info_1705_0002 pci_ss_info_102b_0525_1705_0002
-static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0003 =
- {0x1705, 0x0003, pci_subsys_102b_0525_1705_0003, 0};
-#undef pci_ss_info_1705_0003
-#define pci_ss_info_1705_0003 pci_ss_info_102b_0525_1705_0003
-static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0004 =
- {0x1705, 0x0004, pci_subsys_102b_0525_1705_0004, 0};
-#undef pci_ss_info_1705_0004
-#define pci_ss_info_1705_0004 pci_ss_info_102b_0525_1705_0004
-static const pciSubsystemInfo pci_ss_info_102b_0527_102b_0840 =
- {0x102b, 0x0840, pci_subsys_102b_0527_102b_0840, 0};
-#undef pci_ss_info_102b_0840
-#define pci_ss_info_102b_0840 pci_ss_info_102b_0527_102b_0840
-static const pciSubsystemInfo pci_ss_info_102b_1000_102b_ff01 =
- {0x102b, 0xff01, pci_subsys_102b_1000_102b_ff01, 0};
-#undef pci_ss_info_102b_ff01
-#define pci_ss_info_102b_ff01 pci_ss_info_102b_1000_102b_ff01
-static const pciSubsystemInfo pci_ss_info_102b_1000_102b_ff05 =
- {0x102b, 0xff05, pci_subsys_102b_1000_102b_ff05, 0};
-#undef pci_ss_info_102b_ff05
-#define pci_ss_info_102b_ff05 pci_ss_info_102b_1000_102b_ff05
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_1001 =
- {0x102b, 0x1001, pci_subsys_102b_1001_102b_1001, 0};
-#undef pci_ss_info_102b_1001
-#define pci_ss_info_102b_1001 pci_ss_info_102b_1001_102b_1001
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff00 =
- {0x102b, 0xff00, pci_subsys_102b_1001_102b_ff00, 0};
-#undef pci_ss_info_102b_ff00
-#define pci_ss_info_102b_ff00 pci_ss_info_102b_1001_102b_ff00
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff01 =
- {0x102b, 0xff01, pci_subsys_102b_1001_102b_ff01, 0};
-#undef pci_ss_info_102b_ff01
-#define pci_ss_info_102b_ff01 pci_ss_info_102b_1001_102b_ff01
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff03 =
- {0x102b, 0xff03, pci_subsys_102b_1001_102b_ff03, 0};
-#undef pci_ss_info_102b_ff03
-#define pci_ss_info_102b_ff03 pci_ss_info_102b_1001_102b_ff03
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff04 =
- {0x102b, 0xff04, pci_subsys_102b_1001_102b_ff04, 0};
-#undef pci_ss_info_102b_ff04
-#define pci_ss_info_102b_ff04 pci_ss_info_102b_1001_102b_ff04
-static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff05 =
- {0x102b, 0xff05, pci_subsys_102b_1001_102b_ff05, 0};
-#undef pci_ss_info_102b_ff05
-#define pci_ss_info_102b_ff05 pci_ss_info_102b_1001_102b_ff05
-static const pciSubsystemInfo pci_ss_info_102b_1001_110a_001e =
- {0x110a, 0x001e, pci_subsys_102b_1001_110a_001e, 0};
-#undef pci_ss_info_110a_001e
-#define pci_ss_info_110a_001e pci_ss_info_102b_1001_110a_001e
-static const pciSubsystemInfo pci_ss_info_102b_2527_102b_0f83 =
- {0x102b, 0x0f83, pci_subsys_102b_2527_102b_0f83, 0};
-#undef pci_ss_info_102b_0f83
-#define pci_ss_info_102b_0f83 pci_ss_info_102b_2527_102b_0f83
-static const pciSubsystemInfo pci_ss_info_102b_2527_102b_0f84 =
- {0x102b, 0x0f84, pci_subsys_102b_2527_102b_0f84, 0};
-#undef pci_ss_info_102b_0f84
-#define pci_ss_info_102b_0f84 pci_ss_info_102b_2527_102b_0f84
-static const pciSubsystemInfo pci_ss_info_102b_2527_102b_1e41 =
- {0x102b, 0x1e41, pci_subsys_102b_2527_102b_1e41, 0};
-#undef pci_ss_info_102b_1e41
-#define pci_ss_info_102b_1e41 pci_ss_info_102b_2527_102b_1e41
-static const pciSubsystemInfo pci_ss_info_102c_00c0_102c_00c0 =
- {0x102c, 0x00c0, pci_subsys_102c_00c0_102c_00c0, 0};
-#undef pci_ss_info_102c_00c0
-#define pci_ss_info_102c_00c0 pci_ss_info_102c_00c0_102c_00c0
-static const pciSubsystemInfo pci_ss_info_102c_00e5_0e11_b049 =
- {0x0e11, 0xb049, pci_subsys_102c_00e5_0e11_b049, 0};
-#undef pci_ss_info_0e11_b049
-#define pci_ss_info_0e11_b049 pci_ss_info_102c_00e5_0e11_b049
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_102f_0020_102f_00f8 =
- {0x102f, 0x00f8, pci_subsys_102f_0020_102f_00f8, 0};
-#undef pci_ss_info_102f_00f8
-#define pci_ss_info_102f_00f8 pci_ss_info_102f_0020_102f_00f8
-#endif
-static const pciSubsystemInfo pci_ss_info_1033_0035_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1033_0035_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1033_0035_1179_0001
-static const pciSubsystemInfo pci_ss_info_1033_0035_12ee_7000 =
- {0x12ee, 0x7000, pci_subsys_1033_0035_12ee_7000, 0};
-#undef pci_ss_info_12ee_7000
-#define pci_ss_info_12ee_7000 pci_ss_info_1033_0035_12ee_7000
-static const pciSubsystemInfo pci_ss_info_1033_0035_1799_0001 =
- {0x1799, 0x0001, pci_subsys_1033_0035_1799_0001, 0};
-#undef pci_ss_info_1799_0001
-#define pci_ss_info_1799_0001 pci_ss_info_1033_0035_1799_0001
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0020 =
- {0x1010, 0x0020, pci_subsys_1033_0067_1010_0020, 0};
-#undef pci_ss_info_1010_0020
-#define pci_ss_info_1010_0020 pci_ss_info_1033_0067_1010_0020
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0080 =
- {0x1010, 0x0080, pci_subsys_1033_0067_1010_0080, 0};
-#undef pci_ss_info_1010_0080
-#define pci_ss_info_1010_0080 pci_ss_info_1033_0067_1010_0080
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0088 =
- {0x1010, 0x0088, pci_subsys_1033_0067_1010_0088, 0};
-#undef pci_ss_info_1010_0088
-#define pci_ss_info_1010_0088 pci_ss_info_1033_0067_1010_0088
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0090 =
- {0x1010, 0x0090, pci_subsys_1033_0067_1010_0090, 0};
-#undef pci_ss_info_1010_0090
-#define pci_ss_info_1010_0090 pci_ss_info_1033_0067_1010_0090
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0098 =
- {0x1010, 0x0098, pci_subsys_1033_0067_1010_0098, 0};
-#undef pci_ss_info_1010_0098
-#define pci_ss_info_1010_0098 pci_ss_info_1033_0067_1010_0098
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_00a0 =
- {0x1010, 0x00a0, pci_subsys_1033_0067_1010_00a0, 0};
-#undef pci_ss_info_1010_00a0
-#define pci_ss_info_1010_00a0 pci_ss_info_1033_0067_1010_00a0
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_00a8 =
- {0x1010, 0x00a8, pci_subsys_1033_0067_1010_00a8, 0};
-#undef pci_ss_info_1010_00a8
-#define pci_ss_info_1010_00a8 pci_ss_info_1033_0067_1010_00a8
-static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0120 =
- {0x1010, 0x0120, pci_subsys_1033_0067_1010_0120, 0};
-#undef pci_ss_info_1010_0120
-#define pci_ss_info_1010_0120 pci_ss_info_1033_0067_1010_0120
-static const pciSubsystemInfo pci_ss_info_1033_0074_1033_8014 =
- {0x1033, 0x8014, pci_subsys_1033_0074_1033_8014, 0};
-#undef pci_ss_info_1033_8014
-#define pci_ss_info_1033_8014 pci_ss_info_1033_0074_1033_8014
-static const pciSubsystemInfo pci_ss_info_1033_00cd_12ee_8011 =
- {0x12ee, 0x8011, pci_subsys_1033_00cd_12ee_8011, 0};
-#undef pci_ss_info_12ee_8011
-#define pci_ss_info_12ee_8011 pci_ss_info_1033_00cd_12ee_8011
-static const pciSubsystemInfo pci_ss_info_1033_00e0_12ee_7001 =
- {0x12ee, 0x7001, pci_subsys_1033_00e0_12ee_7001, 0};
-#undef pci_ss_info_12ee_7001
-#define pci_ss_info_12ee_7001 pci_ss_info_1033_00e0_12ee_7001
-static const pciSubsystemInfo pci_ss_info_1033_00e0_1799_0002 =
- {0x1799, 0x0002, pci_subsys_1033_00e0_1799_0002, 0};
-#undef pci_ss_info_1799_0002
-#define pci_ss_info_1799_0002 pci_ss_info_1033_00e0_1799_0002
-static const pciSubsystemInfo pci_ss_info_1039_0200_1039_0000 =
- {0x1039, 0x0000, pci_subsys_1039_0200_1039_0000, 0};
-#undef pci_ss_info_1039_0000
-#define pci_ss_info_1039_0000 pci_ss_info_1039_0200_1039_0000
-static const pciSubsystemInfo pci_ss_info_1039_0300_107d_2720 =
- {0x107d, 0x2720, pci_subsys_1039_0300_107d_2720, 0};
-#undef pci_ss_info_107d_2720
-#define pci_ss_info_107d_2720 pci_ss_info_1039_0300_107d_2720
-static const pciSubsystemInfo pci_ss_info_1039_0900_1039_0900 =
- {0x1039, 0x0900, pci_subsys_1039_0900_1039_0900, 0};
-#undef pci_ss_info_1039_0900
-#define pci_ss_info_1039_0900 pci_ss_info_1039_0900_1039_0900
-static const pciSubsystemInfo pci_ss_info_1039_5513_1019_0970 =
- {0x1019, 0x0970, pci_subsys_1039_5513_1019_0970, 0};
-#undef pci_ss_info_1019_0970
-#define pci_ss_info_1019_0970 pci_ss_info_1039_5513_1019_0970
-static const pciSubsystemInfo pci_ss_info_1039_5513_1039_5513 =
- {0x1039, 0x5513, pci_subsys_1039_5513_1039_5513, 0};
-#undef pci_ss_info_1039_5513
-#define pci_ss_info_1039_5513 pci_ss_info_1039_5513_1039_5513
-static const pciSubsystemInfo pci_ss_info_1039_6300_1019_0970 =
- {0x1019, 0x0970, pci_subsys_1039_6300_1019_0970, 0};
-#undef pci_ss_info_1019_0970
-#define pci_ss_info_1019_0970 pci_ss_info_1039_6300_1019_0970
-static const pciSubsystemInfo pci_ss_info_1039_6306_1039_6306 =
- {0x1039, 0x6306, pci_subsys_1039_6306_1039_6306, 0};
-#undef pci_ss_info_1039_6306
-#define pci_ss_info_1039_6306 pci_ss_info_1039_6306_1039_6306
-static const pciSubsystemInfo pci_ss_info_1039_6326_1039_6326 =
- {0x1039, 0x6326, pci_subsys_1039_6326_1039_6326, 0};
-#undef pci_ss_info_1039_6326
-#define pci_ss_info_1039_6326 pci_ss_info_1039_6326_1039_6326
-static const pciSubsystemInfo pci_ss_info_1039_6326_1092_0a50 =
- {0x1092, 0x0a50, pci_subsys_1039_6326_1092_0a50, 0};
-#undef pci_ss_info_1092_0a50
-#define pci_ss_info_1092_0a50 pci_ss_info_1039_6326_1092_0a50
-static const pciSubsystemInfo pci_ss_info_1039_6326_1092_0a70 =
- {0x1092, 0x0a70, pci_subsys_1039_6326_1092_0a70, 0};
-#undef pci_ss_info_1092_0a70
-#define pci_ss_info_1092_0a70 pci_ss_info_1039_6326_1092_0a70
-static const pciSubsystemInfo pci_ss_info_1039_6326_1092_4910 =
- {0x1092, 0x4910, pci_subsys_1039_6326_1092_4910, 0};
-#undef pci_ss_info_1092_4910
-#define pci_ss_info_1092_4910 pci_ss_info_1039_6326_1092_4910
-static const pciSubsystemInfo pci_ss_info_1039_6326_1092_4920 =
- {0x1092, 0x4920, pci_subsys_1039_6326_1092_4920, 0};
-#undef pci_ss_info_1092_4920
-#define pci_ss_info_1092_4920 pci_ss_info_1039_6326_1092_4920
-static const pciSubsystemInfo pci_ss_info_1039_6326_1569_6326 =
- {0x1569, 0x6326, pci_subsys_1039_6326_1569_6326, 0};
-#undef pci_ss_info_1569_6326
-#define pci_ss_info_1569_6326 pci_ss_info_1039_6326_1569_6326
-static const pciSubsystemInfo pci_ss_info_1039_7001_1039_7000 =
- {0x1039, 0x7000, pci_subsys_1039_7001_1039_7000, 0};
-#undef pci_ss_info_1039_7000
-#define pci_ss_info_1039_7000 pci_ss_info_1039_7001_1039_7000
-static const pciSubsystemInfo pci_ss_info_1039_7002_1509_7002 =
- {0x1509, 0x7002, pci_subsys_1039_7002_1509_7002, 0};
-#undef pci_ss_info_1509_7002
-#define pci_ss_info_1509_7002 pci_ss_info_1039_7002_1509_7002
-static const pciSubsystemInfo pci_ss_info_1039_7016_1039_7016 =
- {0x1039, 0x7016, pci_subsys_1039_7016_1039_7016, 0};
-#undef pci_ss_info_1039_7016
-#define pci_ss_info_1039_7016 pci_ss_info_1039_7016_1039_7016
-static const pciSubsystemInfo pci_ss_info_1039_7018_1014_01b6 =
- {0x1014, 0x01b6, pci_subsys_1039_7018_1014_01b6, 0};
-#undef pci_ss_info_1014_01b6
-#define pci_ss_info_1014_01b6 pci_ss_info_1039_7018_1014_01b6
-static const pciSubsystemInfo pci_ss_info_1039_7018_1014_01b7 =
- {0x1014, 0x01b7, pci_subsys_1039_7018_1014_01b7, 0};
-#undef pci_ss_info_1014_01b7
-#define pci_ss_info_1014_01b7 pci_ss_info_1039_7018_1014_01b7
-static const pciSubsystemInfo pci_ss_info_1039_7018_1019_7018 =
- {0x1019, 0x7018, pci_subsys_1039_7018_1019_7018, 0};
-#undef pci_ss_info_1019_7018
-#define pci_ss_info_1019_7018 pci_ss_info_1039_7018_1019_7018
-static const pciSubsystemInfo pci_ss_info_1039_7018_1025_000e =
- {0x1025, 0x000e, pci_subsys_1039_7018_1025_000e, 0};
-#undef pci_ss_info_1025_000e
-#define pci_ss_info_1025_000e pci_ss_info_1039_7018_1025_000e
-static const pciSubsystemInfo pci_ss_info_1039_7018_1025_0018 =
- {0x1025, 0x0018, pci_subsys_1039_7018_1025_0018, 0};
-#undef pci_ss_info_1025_0018
-#define pci_ss_info_1025_0018 pci_ss_info_1039_7018_1025_0018
-static const pciSubsystemInfo pci_ss_info_1039_7018_1039_7018 =
- {0x1039, 0x7018, pci_subsys_1039_7018_1039_7018, 0};
-#undef pci_ss_info_1039_7018
-#define pci_ss_info_1039_7018 pci_ss_info_1039_7018_1039_7018
-static const pciSubsystemInfo pci_ss_info_1039_7018_1043_800b =
- {0x1043, 0x800b, pci_subsys_1039_7018_1043_800b, 0};
-#undef pci_ss_info_1043_800b
-#define pci_ss_info_1043_800b pci_ss_info_1039_7018_1043_800b
-static const pciSubsystemInfo pci_ss_info_1039_7018_1054_7018 =
- {0x1054, 0x7018, pci_subsys_1039_7018_1054_7018, 0};
-#undef pci_ss_info_1054_7018
-#define pci_ss_info_1054_7018 pci_ss_info_1039_7018_1054_7018
-static const pciSubsystemInfo pci_ss_info_1039_7018_107d_5330 =
- {0x107d, 0x5330, pci_subsys_1039_7018_107d_5330, 0};
-#undef pci_ss_info_107d_5330
-#define pci_ss_info_107d_5330 pci_ss_info_1039_7018_107d_5330
-static const pciSubsystemInfo pci_ss_info_1039_7018_107d_5350 =
- {0x107d, 0x5350, pci_subsys_1039_7018_107d_5350, 0};
-#undef pci_ss_info_107d_5350
-#define pci_ss_info_107d_5350 pci_ss_info_1039_7018_107d_5350
-static const pciSubsystemInfo pci_ss_info_1039_7018_1170_3209 =
- {0x1170, 0x3209, pci_subsys_1039_7018_1170_3209, 0};
-#undef pci_ss_info_1170_3209
-#define pci_ss_info_1170_3209 pci_ss_info_1039_7018_1170_3209
-static const pciSubsystemInfo pci_ss_info_1039_7018_1462_400a =
- {0x1462, 0x400a, pci_subsys_1039_7018_1462_400a, 0};
-#undef pci_ss_info_1462_400a
-#define pci_ss_info_1462_400a pci_ss_info_1039_7018_1462_400a
-static const pciSubsystemInfo pci_ss_info_1039_7018_14a4_2089 =
- {0x14a4, 0x2089, pci_subsys_1039_7018_14a4_2089, 0};
-#undef pci_ss_info_14a4_2089
-#define pci_ss_info_14a4_2089 pci_ss_info_1039_7018_14a4_2089
-static const pciSubsystemInfo pci_ss_info_1039_7018_14cd_2194 =
- {0x14cd, 0x2194, pci_subsys_1039_7018_14cd_2194, 0};
-#undef pci_ss_info_14cd_2194
-#define pci_ss_info_14cd_2194 pci_ss_info_1039_7018_14cd_2194
-static const pciSubsystemInfo pci_ss_info_1039_7018_14ff_1100 =
- {0x14ff, 0x1100, pci_subsys_1039_7018_14ff_1100, 0};
-#undef pci_ss_info_14ff_1100
-#define pci_ss_info_14ff_1100 pci_ss_info_1039_7018_14ff_1100
-static const pciSubsystemInfo pci_ss_info_1039_7018_152d_8808 =
- {0x152d, 0x8808, pci_subsys_1039_7018_152d_8808, 0};
-#undef pci_ss_info_152d_8808
-#define pci_ss_info_152d_8808 pci_ss_info_1039_7018_152d_8808
-static const pciSubsystemInfo pci_ss_info_1039_7018_1558_1103 =
- {0x1558, 0x1103, pci_subsys_1039_7018_1558_1103, 0};
-#undef pci_ss_info_1558_1103
-#define pci_ss_info_1558_1103 pci_ss_info_1039_7018_1558_1103
-static const pciSubsystemInfo pci_ss_info_1039_7018_1558_2200 =
- {0x1558, 0x2200, pci_subsys_1039_7018_1558_2200, 0};
-#undef pci_ss_info_1558_2200
-#define pci_ss_info_1558_2200 pci_ss_info_1039_7018_1558_2200
-static const pciSubsystemInfo pci_ss_info_1039_7018_1563_7018 =
- {0x1563, 0x7018, pci_subsys_1039_7018_1563_7018, 0};
-#undef pci_ss_info_1563_7018
-#define pci_ss_info_1563_7018 pci_ss_info_1039_7018_1563_7018
-static const pciSubsystemInfo pci_ss_info_1039_7018_15c5_0111 =
- {0x15c5, 0x0111, pci_subsys_1039_7018_15c5_0111, 0};
-#undef pci_ss_info_15c5_0111
-#define pci_ss_info_15c5_0111 pci_ss_info_1039_7018_15c5_0111
-static const pciSubsystemInfo pci_ss_info_1039_7018_270f_a171 =
- {0x270f, 0xa171, pci_subsys_1039_7018_270f_a171, 0};
-#undef pci_ss_info_270f_a171
-#define pci_ss_info_270f_a171 pci_ss_info_1039_7018_270f_a171
-static const pciSubsystemInfo pci_ss_info_1039_7018_a0a0_0022 =
- {0xa0a0, 0x0022, pci_subsys_1039_7018_a0a0_0022, 0};
-#undef pci_ss_info_a0a0_0022
-#define pci_ss_info_a0a0_0022 pci_ss_info_1039_7018_a0a0_0022
-static const pciSubsystemInfo pci_ss_info_103c_1029_107e_000f =
- {0x107e, 0x000f, pci_subsys_103c_1029_107e_000f, 0};
-#undef pci_ss_info_107e_000f
-#define pci_ss_info_107e_000f pci_ss_info_103c_1029_107e_000f
-static const pciSubsystemInfo pci_ss_info_103c_1029_9004_9210 =
- {0x9004, 0x9210, pci_subsys_103c_1029_9004_9210, 0};
-#undef pci_ss_info_9004_9210
-#define pci_ss_info_9004_9210 pci_ss_info_103c_1029_9004_9210
-static const pciSubsystemInfo pci_ss_info_103c_1029_9004_9211 =
- {0x9004, 0x9211, pci_subsys_103c_1029_9004_9211, 0};
-#undef pci_ss_info_9004_9211
-#define pci_ss_info_9004_9211 pci_ss_info_103c_1029_9004_9211
-static const pciSubsystemInfo pci_ss_info_103c_102a_107e_000e =
- {0x107e, 0x000e, pci_subsys_103c_102a_107e_000e, 0};
-#undef pci_ss_info_107e_000e
-#define pci_ss_info_107e_000e pci_ss_info_103c_102a_107e_000e
-static const pciSubsystemInfo pci_ss_info_103c_102a_9004_9110 =
- {0x9004, 0x9110, pci_subsys_103c_102a_9004_9110, 0};
-#undef pci_ss_info_9004_9110
-#define pci_ss_info_9004_9110 pci_ss_info_103c_102a_9004_9110
-static const pciSubsystemInfo pci_ss_info_103c_102a_9004_9111 =
- {0x9004, 0x9111, pci_subsys_103c_102a_9004_9111, 0};
-#undef pci_ss_info_9004_9111
-#define pci_ss_info_9004_9111 pci_ss_info_103c_102a_9004_9111
-static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1040 =
- {0x103c, 0x1040, pci_subsys_103c_1031_103c_1040, 0};
-#undef pci_ss_info_103c_1040
-#define pci_ss_info_103c_1040 pci_ss_info_103c_1031_103c_1040
-static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1041 =
- {0x103c, 0x1041, pci_subsys_103c_1031_103c_1041, 0};
-#undef pci_ss_info_103c_1041
-#define pci_ss_info_103c_1041 pci_ss_info_103c_1031_103c_1041
-static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1042 =
- {0x103c, 0x1042, pci_subsys_103c_1031_103c_1042, 0};
-#undef pci_ss_info_103c_1042
-#define pci_ss_info_103c_1042 pci_ss_info_103c_1031_103c_1042
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1049 =
- {0x103c, 0x1049, pci_subsys_103c_1048_103c_1049, 0};
-#undef pci_ss_info_103c_1049
-#define pci_ss_info_103c_1049 pci_ss_info_103c_1048_103c_1049
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_104a =
- {0x103c, 0x104a, pci_subsys_103c_1048_103c_104a, 0};
-#undef pci_ss_info_103c_104a
-#define pci_ss_info_103c_104a pci_ss_info_103c_1048_103c_104a
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_104b =
- {0x103c, 0x104b, pci_subsys_103c_1048_103c_104b, 0};
-#undef pci_ss_info_103c_104b
-#define pci_ss_info_103c_104b pci_ss_info_103c_1048_103c_104b
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1223 =
- {0x103c, 0x1223, pci_subsys_103c_1048_103c_1223, 0};
-#undef pci_ss_info_103c_1223
-#define pci_ss_info_103c_1223 pci_ss_info_103c_1048_103c_1223
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1226 =
- {0x103c, 0x1226, pci_subsys_103c_1048_103c_1226, 0};
-#undef pci_ss_info_103c_1226
-#define pci_ss_info_103c_1226 pci_ss_info_103c_1048_103c_1226
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1227 =
- {0x103c, 0x1227, pci_subsys_103c_1048_103c_1227, 0};
-#undef pci_ss_info_103c_1227
-#define pci_ss_info_103c_1227 pci_ss_info_103c_1048_103c_1227
-static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1282 =
- {0x103c, 0x1282, pci_subsys_103c_1048_103c_1282, 0};
-#undef pci_ss_info_103c_1282
-#define pci_ss_info_103c_1282 pci_ss_info_103c_1048_103c_1282
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c001 =
- {0x1044, 0xc001, pci_subsys_1044_a501_1044_c001, 0};
-#undef pci_ss_info_1044_c001
-#define pci_ss_info_1044_c001 pci_ss_info_1044_a501_1044_c001
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c002 =
- {0x1044, 0xc002, pci_subsys_1044_a501_1044_c002, 0};
-#undef pci_ss_info_1044_c002
-#define pci_ss_info_1044_c002 pci_ss_info_1044_a501_1044_c002
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c003 =
- {0x1044, 0xc003, pci_subsys_1044_a501_1044_c003, 0};
-#undef pci_ss_info_1044_c003
-#define pci_ss_info_1044_c003 pci_ss_info_1044_a501_1044_c003
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c004 =
- {0x1044, 0xc004, pci_subsys_1044_a501_1044_c004, 0};
-#undef pci_ss_info_1044_c004
-#define pci_ss_info_1044_c004 pci_ss_info_1044_a501_1044_c004
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c005 =
- {0x1044, 0xc005, pci_subsys_1044_a501_1044_c005, 0};
-#undef pci_ss_info_1044_c005
-#define pci_ss_info_1044_c005 pci_ss_info_1044_a501_1044_c005
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00a =
- {0x1044, 0xc00a, pci_subsys_1044_a501_1044_c00a, 0};
-#undef pci_ss_info_1044_c00a
-#define pci_ss_info_1044_c00a pci_ss_info_1044_a501_1044_c00a
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00b =
- {0x1044, 0xc00b, pci_subsys_1044_a501_1044_c00b, 0};
-#undef pci_ss_info_1044_c00b
-#define pci_ss_info_1044_c00b pci_ss_info_1044_a501_1044_c00b
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00c =
- {0x1044, 0xc00c, pci_subsys_1044_a501_1044_c00c, 0};
-#undef pci_ss_info_1044_c00c
-#define pci_ss_info_1044_c00c pci_ss_info_1044_a501_1044_c00c
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00d =
- {0x1044, 0xc00d, pci_subsys_1044_a501_1044_c00d, 0};
-#undef pci_ss_info_1044_c00d
-#define pci_ss_info_1044_c00d pci_ss_info_1044_a501_1044_c00d
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00e =
- {0x1044, 0xc00e, pci_subsys_1044_a501_1044_c00e, 0};
-#undef pci_ss_info_1044_c00e
-#define pci_ss_info_1044_c00e pci_ss_info_1044_a501_1044_c00e
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00f =
- {0x1044, 0xc00f, pci_subsys_1044_a501_1044_c00f, 0};
-#undef pci_ss_info_1044_c00f
-#define pci_ss_info_1044_c00f pci_ss_info_1044_a501_1044_c00f
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c014 =
- {0x1044, 0xc014, pci_subsys_1044_a501_1044_c014, 0};
-#undef pci_ss_info_1044_c014
-#define pci_ss_info_1044_c014 pci_ss_info_1044_a501_1044_c014
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c015 =
- {0x1044, 0xc015, pci_subsys_1044_a501_1044_c015, 0};
-#undef pci_ss_info_1044_c015
-#define pci_ss_info_1044_c015 pci_ss_info_1044_a501_1044_c015
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c016 =
- {0x1044, 0xc016, pci_subsys_1044_a501_1044_c016, 0};
-#undef pci_ss_info_1044_c016
-#define pci_ss_info_1044_c016 pci_ss_info_1044_a501_1044_c016
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c01e =
- {0x1044, 0xc01e, pci_subsys_1044_a501_1044_c01e, 0};
-#undef pci_ss_info_1044_c01e
-#define pci_ss_info_1044_c01e pci_ss_info_1044_a501_1044_c01e
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c01f =
- {0x1044, 0xc01f, pci_subsys_1044_a501_1044_c01f, 0};
-#undef pci_ss_info_1044_c01f
-#define pci_ss_info_1044_c01f pci_ss_info_1044_a501_1044_c01f
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c020 =
- {0x1044, 0xc020, pci_subsys_1044_a501_1044_c020, 0};
-#undef pci_ss_info_1044_c020
-#define pci_ss_info_1044_c020 pci_ss_info_1044_a501_1044_c020
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c021 =
- {0x1044, 0xc021, pci_subsys_1044_a501_1044_c021, 0};
-#undef pci_ss_info_1044_c021
-#define pci_ss_info_1044_c021 pci_ss_info_1044_a501_1044_c021
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c028 =
- {0x1044, 0xc028, pci_subsys_1044_a501_1044_c028, 0};
-#undef pci_ss_info_1044_c028
-#define pci_ss_info_1044_c028 pci_ss_info_1044_a501_1044_c028
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c029 =
- {0x1044, 0xc029, pci_subsys_1044_a501_1044_c029, 0};
-#undef pci_ss_info_1044_c029
-#define pci_ss_info_1044_c029 pci_ss_info_1044_a501_1044_c029
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c02a =
- {0x1044, 0xc02a, pci_subsys_1044_a501_1044_c02a, 0};
-#undef pci_ss_info_1044_c02a
-#define pci_ss_info_1044_c02a pci_ss_info_1044_a501_1044_c02a
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03c =
- {0x1044, 0xc03c, pci_subsys_1044_a501_1044_c03c, 0};
-#undef pci_ss_info_1044_c03c
-#define pci_ss_info_1044_c03c pci_ss_info_1044_a501_1044_c03c
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03d =
- {0x1044, 0xc03d, pci_subsys_1044_a501_1044_c03d, 0};
-#undef pci_ss_info_1044_c03d
-#define pci_ss_info_1044_c03d pci_ss_info_1044_a501_1044_c03d
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03e =
- {0x1044, 0xc03e, pci_subsys_1044_a501_1044_c03e, 0};
-#undef pci_ss_info_1044_c03e
-#define pci_ss_info_1044_c03e pci_ss_info_1044_a501_1044_c03e
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c046 =
- {0x1044, 0xc046, pci_subsys_1044_a501_1044_c046, 0};
-#undef pci_ss_info_1044_c046
-#define pci_ss_info_1044_c046 pci_ss_info_1044_a501_1044_c046
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c047 =
- {0x1044, 0xc047, pci_subsys_1044_a501_1044_c047, 0};
-#undef pci_ss_info_1044_c047
-#define pci_ss_info_1044_c047 pci_ss_info_1044_a501_1044_c047
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c048 =
- {0x1044, 0xc048, pci_subsys_1044_a501_1044_c048, 0};
-#undef pci_ss_info_1044_c048
-#define pci_ss_info_1044_c048 pci_ss_info_1044_a501_1044_c048
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c050 =
- {0x1044, 0xc050, pci_subsys_1044_a501_1044_c050, 0};
-#undef pci_ss_info_1044_c050
-#define pci_ss_info_1044_c050 pci_ss_info_1044_a501_1044_c050
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c051 =
- {0x1044, 0xc051, pci_subsys_1044_a501_1044_c051, 0};
-#undef pci_ss_info_1044_c051
-#define pci_ss_info_1044_c051 pci_ss_info_1044_a501_1044_c051
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c052 =
- {0x1044, 0xc052, pci_subsys_1044_a501_1044_c052, 0};
-#undef pci_ss_info_1044_c052
-#define pci_ss_info_1044_c052 pci_ss_info_1044_a501_1044_c052
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c05a =
- {0x1044, 0xc05a, pci_subsys_1044_a501_1044_c05a, 0};
-#undef pci_ss_info_1044_c05a
-#define pci_ss_info_1044_c05a pci_ss_info_1044_a501_1044_c05a
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c05b =
- {0x1044, 0xc05b, pci_subsys_1044_a501_1044_c05b, 0};
-#undef pci_ss_info_1044_c05b
-#define pci_ss_info_1044_c05b pci_ss_info_1044_a501_1044_c05b
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c064 =
- {0x1044, 0xc064, pci_subsys_1044_a501_1044_c064, 0};
-#undef pci_ss_info_1044_c064
-#define pci_ss_info_1044_c064 pci_ss_info_1044_a501_1044_c064
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c065 =
- {0x1044, 0xc065, pci_subsys_1044_a501_1044_c065, 0};
-#undef pci_ss_info_1044_c065
-#define pci_ss_info_1044_c065 pci_ss_info_1044_a501_1044_c065
-static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c066 =
- {0x1044, 0xc066, pci_subsys_1044_a501_1044_c066, 0};
-#undef pci_ss_info_1044_c066
-#define pci_ss_info_1044_c066 pci_ss_info_1044_a501_1044_c066
-#endif
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1011_4d10 =
- {0x1011, 0x4d10, pci_subsys_104c_3d07_1011_4d10, 0};
-#undef pci_ss_info_1011_4d10
-#define pci_ss_info_1011_4d10 pci_ss_info_104c_3d07_1011_4d10
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1040_000f =
- {0x1040, 0x000f, pci_subsys_104c_3d07_1040_000f, 0};
-#undef pci_ss_info_1040_000f
-#define pci_ss_info_1040_000f pci_ss_info_104c_3d07_1040_000f
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1040_0011 =
- {0x1040, 0x0011, pci_subsys_104c_3d07_1040_0011, 0};
-#undef pci_ss_info_1040_0011
-#define pci_ss_info_1040_0011 pci_ss_info_104c_3d07_1040_0011
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a31 =
- {0x1048, 0x0a31, pci_subsys_104c_3d07_1048_0a31, 0};
-#undef pci_ss_info_1048_0a31
-#define pci_ss_info_1048_0a31 pci_ss_info_104c_3d07_1048_0a31
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a32 =
- {0x1048, 0x0a32, pci_subsys_104c_3d07_1048_0a32, 0};
-#undef pci_ss_info_1048_0a32
-#define pci_ss_info_1048_0a32 pci_ss_info_104c_3d07_1048_0a32
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a35 =
- {0x1048, 0x0a35, pci_subsys_104c_3d07_1048_0a35, 0};
-#undef pci_ss_info_1048_0a35
-#define pci_ss_info_1048_0a35 pci_ss_info_104c_3d07_1048_0a35
-static const pciSubsystemInfo pci_ss_info_104c_3d07_107d_2633 =
- {0x107d, 0x2633, pci_subsys_104c_3d07_107d_2633, 0};
-#undef pci_ss_info_107d_2633
-#define pci_ss_info_107d_2633 pci_ss_info_104c_3d07_107d_2633
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0127 =
- {0x1092, 0x0127, pci_subsys_104c_3d07_1092_0127, 0};
-#undef pci_ss_info_1092_0127
-#define pci_ss_info_1092_0127 pci_ss_info_104c_3d07_1092_0127
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0136 =
- {0x1092, 0x0136, pci_subsys_104c_3d07_1092_0136, 0};
-#undef pci_ss_info_1092_0136
-#define pci_ss_info_1092_0136 pci_ss_info_104c_3d07_1092_0136
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0141 =
- {0x1092, 0x0141, pci_subsys_104c_3d07_1092_0141, 0};
-#undef pci_ss_info_1092_0141
-#define pci_ss_info_1092_0141 pci_ss_info_104c_3d07_1092_0141
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0146 =
- {0x1092, 0x0146, pci_subsys_104c_3d07_1092_0146, 0};
-#undef pci_ss_info_1092_0146
-#define pci_ss_info_1092_0146 pci_ss_info_104c_3d07_1092_0146
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0148 =
- {0x1092, 0x0148, pci_subsys_104c_3d07_1092_0148, 0};
-#undef pci_ss_info_1092_0148
-#define pci_ss_info_1092_0148 pci_ss_info_104c_3d07_1092_0148
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0149 =
- {0x1092, 0x0149, pci_subsys_104c_3d07_1092_0149, 0};
-#undef pci_ss_info_1092_0149
-#define pci_ss_info_1092_0149 pci_ss_info_104c_3d07_1092_0149
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0152 =
- {0x1092, 0x0152, pci_subsys_104c_3d07_1092_0152, 0};
-#undef pci_ss_info_1092_0152
-#define pci_ss_info_1092_0152 pci_ss_info_104c_3d07_1092_0152
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0154 =
- {0x1092, 0x0154, pci_subsys_104c_3d07_1092_0154, 0};
-#undef pci_ss_info_1092_0154
-#define pci_ss_info_1092_0154 pci_ss_info_104c_3d07_1092_0154
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0155 =
- {0x1092, 0x0155, pci_subsys_104c_3d07_1092_0155, 0};
-#undef pci_ss_info_1092_0155
-#define pci_ss_info_1092_0155 pci_ss_info_104c_3d07_1092_0155
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0156 =
- {0x1092, 0x0156, pci_subsys_104c_3d07_1092_0156, 0};
-#undef pci_ss_info_1092_0156
-#define pci_ss_info_1092_0156 pci_ss_info_104c_3d07_1092_0156
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0157 =
- {0x1092, 0x0157, pci_subsys_104c_3d07_1092_0157, 0};
-#undef pci_ss_info_1092_0157
-#define pci_ss_info_1092_0157 pci_ss_info_104c_3d07_1092_0157
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1097_3d01 =
- {0x1097, 0x3d01, pci_subsys_104c_3d07_1097_3d01, 0};
-#undef pci_ss_info_1097_3d01
-#define pci_ss_info_1097_3d01 pci_ss_info_104c_3d07_1097_3d01
-static const pciSubsystemInfo pci_ss_info_104c_3d07_1102_100f =
- {0x1102, 0x100f, pci_subsys_104c_3d07_1102_100f, 0};
-#undef pci_ss_info_1102_100f
-#define pci_ss_info_1102_100f pci_ss_info_104c_3d07_1102_100f
-static const pciSubsystemInfo pci_ss_info_104c_3d07_3d3d_0100 =
- {0x3d3d, 0x0100, pci_subsys_104c_3d07_3d3d_0100, 0};
-#undef pci_ss_info_3d3d_0100
-#define pci_ss_info_3d3d_0100 pci_ss_info_104c_3d07_3d3d_0100
-static const pciSubsystemInfo pci_ss_info_104c_8000_e4bf_1010 =
- {0xe4bf, 0x1010, pci_subsys_104c_8000_e4bf_1010, 0};
-#undef pci_ss_info_e4bf_1010
-#define pci_ss_info_e4bf_1010 pci_ss_info_104c_8000_e4bf_1010
-static const pciSubsystemInfo pci_ss_info_104c_8000_e4bf_1020 =
- {0xe4bf, 0x1020, pci_subsys_104c_8000_e4bf_1020, 0};
-#undef pci_ss_info_e4bf_1020
-#define pci_ss_info_e4bf_1020 pci_ss_info_104c_8000_e4bf_1020
-static const pciSubsystemInfo pci_ss_info_104c_8009_104d_8032 =
- {0x104d, 0x8032, pci_subsys_104c_8009_104d_8032, 0};
-#undef pci_ss_info_104d_8032
-#define pci_ss_info_104d_8032 pci_ss_info_104c_8009_104d_8032
-static const pciSubsystemInfo pci_ss_info_104c_8019_11bd_000a =
- {0x11bd, 0x000a, pci_subsys_104c_8019_11bd_000a, 0};
-#undef pci_ss_info_11bd_000a
-#define pci_ss_info_11bd_000a pci_ss_info_104c_8019_11bd_000a
-static const pciSubsystemInfo pci_ss_info_104c_8019_11bd_000e =
- {0x11bd, 0x000e, pci_subsys_104c_8019_11bd_000e, 0};
-#undef pci_ss_info_11bd_000e
-#define pci_ss_info_11bd_000e pci_ss_info_104c_8019_11bd_000e
-static const pciSubsystemInfo pci_ss_info_104c_8019_e4bf_1010 =
- {0xe4bf, 0x1010, pci_subsys_104c_8019_e4bf_1010, 0};
-#undef pci_ss_info_e4bf_1010
-#define pci_ss_info_e4bf_1010 pci_ss_info_104c_8019_e4bf_1010
-static const pciSubsystemInfo pci_ss_info_104c_8021_104d_80df =
- {0x104d, 0x80df, pci_subsys_104c_8021_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_104c_8021_104d_80df
-static const pciSubsystemInfo pci_ss_info_104c_8021_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_104c_8021_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_104c_8021_104d_80e7
-static const pciSubsystemInfo pci_ss_info_104c_8027_1028_00e6 =
- {0x1028, 0x00e6, pci_subsys_104c_8027_1028_00e6, 0};
-#undef pci_ss_info_1028_00e6
-#define pci_ss_info_1028_00e6 pci_ss_info_104c_8027_1028_00e6
-static const pciSubsystemInfo pci_ss_info_104c_ac1b_0e11_b113 =
- {0x0e11, 0xb113, pci_subsys_104c_ac1b_0e11_b113, 0};
-#undef pci_ss_info_0e11_b113
-#define pci_ss_info_0e11_b113 pci_ss_info_104c_ac1b_0e11_b113
-static const pciSubsystemInfo pci_ss_info_104c_ac42_1028_00e6 =
- {0x1028, 0x00e6, pci_subsys_104c_ac42_1028_00e6, 0};
-#undef pci_ss_info_1028_00e6
-#define pci_ss_info_1028_00e6 pci_ss_info_104c_ac42_1028_00e6
-static const pciSubsystemInfo pci_ss_info_104c_ac51_1014_023b =
- {0x1014, 0x023b, pci_subsys_104c_ac51_1014_023b, 0};
-#undef pci_ss_info_1014_023b
-#define pci_ss_info_1014_023b pci_ss_info_104c_ac51_1014_023b
-static const pciSubsystemInfo pci_ss_info_104c_ac51_10cf_1095 =
- {0x10cf, 0x1095, pci_subsys_104c_ac51_10cf_1095, 0};
-#undef pci_ss_info_10cf_1095
-#define pci_ss_info_10cf_1095 pci_ss_info_104c_ac51_10cf_1095
-static const pciSubsystemInfo pci_ss_info_104c_ac51_e4bf_1000 =
- {0xe4bf, 0x1000, pci_subsys_104c_ac51_e4bf_1000, 0};
-#undef pci_ss_info_e4bf_1000
-#define pci_ss_info_e4bf_1000 pci_ss_info_104c_ac51_e4bf_1000
-static const pciSubsystemInfo pci_ss_info_104c_ac55_1014_0512 =
- {0x1014, 0x0512, pci_subsys_104c_ac55_1014_0512, 0};
-#undef pci_ss_info_1014_0512
-#define pci_ss_info_1014_0512 pci_ss_info_104c_ac55_1014_0512
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1050_0840_1050_0001 =
- {0x1050, 0x0001, pci_subsys_1050_0840_1050_0001, 0};
-#undef pci_ss_info_1050_0001
-#define pci_ss_info_1050_0001 pci_ss_info_1050_0840_1050_0001
-static const pciSubsystemInfo pci_ss_info_1050_0840_1050_0840 =
- {0x1050, 0x0840, pci_subsys_1050_0840_1050_0840, 0};
-#undef pci_ss_info_1050_0840
-#define pci_ss_info_1050_0840 pci_ss_info_1050_0840_1050_0840
-#endif
-static const pciSubsystemInfo pci_ss_info_1057_1801_ecc0_0030 =
- {0xecc0, 0x0030, pci_subsys_1057_1801_ecc0_0030, 0};
-#undef pci_ss_info_ecc0_0030
-#define pci_ss_info_ecc0_0030 pci_ss_info_1057_1801_ecc0_0030
-static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0300 =
- {0x1057, 0x0300, pci_subsys_1057_5600_1057_0300, 0};
-#undef pci_ss_info_1057_0300
-#define pci_ss_info_1057_0300 pci_ss_info_1057_5600_1057_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0301 =
- {0x1057, 0x0301, pci_subsys_1057_5600_1057_0301, 0};
-#undef pci_ss_info_1057_0301
-#define pci_ss_info_1057_0301 pci_ss_info_1057_5600_1057_0301
-static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0302 =
- {0x1057, 0x0302, pci_subsys_1057_5600_1057_0302, 0};
-#undef pci_ss_info_1057_0302
-#define pci_ss_info_1057_0302 pci_ss_info_1057_5600_1057_0302
-static const pciSubsystemInfo pci_ss_info_1057_5600_1057_5600 =
- {0x1057, 0x5600, pci_subsys_1057_5600_1057_5600, 0};
-#undef pci_ss_info_1057_5600
-#define pci_ss_info_1057_5600 pci_ss_info_1057_5600_1057_5600
-static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0300 =
- {0x13d2, 0x0300, pci_subsys_1057_5600_13d2_0300, 0};
-#undef pci_ss_info_13d2_0300
-#define pci_ss_info_13d2_0300 pci_ss_info_1057_5600_13d2_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0301 =
- {0x13d2, 0x0301, pci_subsys_1057_5600_13d2_0301, 0};
-#undef pci_ss_info_13d2_0301
-#define pci_ss_info_13d2_0301 pci_ss_info_1057_5600_13d2_0301
-static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0302 =
- {0x13d2, 0x0302, pci_subsys_1057_5600_13d2_0302, 0};
-#undef pci_ss_info_13d2_0302
-#define pci_ss_info_13d2_0302 pci_ss_info_1057_5600_13d2_0302
-static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0300 =
- {0x1436, 0x0300, pci_subsys_1057_5600_1436_0300, 0};
-#undef pci_ss_info_1436_0300
-#define pci_ss_info_1436_0300 pci_ss_info_1057_5600_1436_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0301 =
- {0x1436, 0x0301, pci_subsys_1057_5600_1436_0301, 0};
-#undef pci_ss_info_1436_0301
-#define pci_ss_info_1436_0301 pci_ss_info_1057_5600_1436_0301
-static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0302 =
- {0x1436, 0x0302, pci_subsys_1057_5600_1436_0302, 0};
-#undef pci_ss_info_1436_0302
-#define pci_ss_info_1436_0302 pci_ss_info_1057_5600_1436_0302
-static const pciSubsystemInfo pci_ss_info_1057_5600_144f_100c =
- {0x144f, 0x100c, pci_subsys_1057_5600_144f_100c, 0};
-#undef pci_ss_info_144f_100c
-#define pci_ss_info_144f_100c pci_ss_info_1057_5600_144f_100c
-static const pciSubsystemInfo pci_ss_info_1057_5600_1494_0300 =
- {0x1494, 0x0300, pci_subsys_1057_5600_1494_0300, 0};
-#undef pci_ss_info_1494_0300
-#define pci_ss_info_1494_0300 pci_ss_info_1057_5600_1494_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_1494_0301 =
- {0x1494, 0x0301, pci_subsys_1057_5600_1494_0301, 0};
-#undef pci_ss_info_1494_0301
-#define pci_ss_info_1494_0301 pci_ss_info_1057_5600_1494_0301
-static const pciSubsystemInfo pci_ss_info_1057_5600_14c8_0300 =
- {0x14c8, 0x0300, pci_subsys_1057_5600_14c8_0300, 0};
-#undef pci_ss_info_14c8_0300
-#define pci_ss_info_14c8_0300 pci_ss_info_1057_5600_14c8_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_14c8_0302 =
- {0x14c8, 0x0302, pci_subsys_1057_5600_14c8_0302, 0};
-#undef pci_ss_info_14c8_0302
-#define pci_ss_info_14c8_0302 pci_ss_info_1057_5600_14c8_0302
-static const pciSubsystemInfo pci_ss_info_1057_5600_1668_0300 =
- {0x1668, 0x0300, pci_subsys_1057_5600_1668_0300, 0};
-#undef pci_ss_info_1668_0300
-#define pci_ss_info_1668_0300 pci_ss_info_1057_5600_1668_0300
-static const pciSubsystemInfo pci_ss_info_1057_5600_1668_0302 =
- {0x1668, 0x0302, pci_subsys_1057_5600_1668_0302, 0};
-#undef pci_ss_info_1668_0302
-#define pci_ss_info_1668_0302 pci_ss_info_1057_5600_1668_0302
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_105a_0d30_105a_4d33 =
- {0x105a, 0x4d33, pci_subsys_105a_0d30_105a_4d33, 0};
-#undef pci_ss_info_105a_4d33
-#define pci_ss_info_105a_4d33 pci_ss_info_105a_0d30_105a_4d33
-static const pciSubsystemInfo pci_ss_info_105a_0d38_105a_4d39 =
- {0x105a, 0x4d39, pci_subsys_105a_0d38_105a_4d39, 0};
-#undef pci_ss_info_105a_4d39
-#define pci_ss_info_105a_4d39 pci_ss_info_105a_0d38_105a_4d39
-static const pciSubsystemInfo pci_ss_info_105a_3376_1043_809e =
- {0x1043, 0x809e, pci_subsys_105a_3376_1043_809e, 0};
-#undef pci_ss_info_1043_809e
-#define pci_ss_info_1043_809e pci_ss_info_105a_3376_1043_809e
-static const pciSubsystemInfo pci_ss_info_105a_4d30_105a_4d33 =
- {0x105a, 0x4d33, pci_subsys_105a_4d30_105a_4d33, 0};
-#undef pci_ss_info_105a_4d33
-#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d30_105a_4d33
-static const pciSubsystemInfo pci_ss_info_105a_4d30_105a_4d39 =
- {0x105a, 0x4d39, pci_subsys_105a_4d30_105a_4d39, 0};
-#undef pci_ss_info_105a_4d39
-#define pci_ss_info_105a_4d39 pci_ss_info_105a_4d30_105a_4d39
-static const pciSubsystemInfo pci_ss_info_105a_4d33_105a_4d33 =
- {0x105a, 0x4d33, pci_subsys_105a_4d33_105a_4d33, 0};
-#undef pci_ss_info_105a_4d33
-#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d33_105a_4d33
-static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d30 =
- {0x105a, 0x4d30, pci_subsys_105a_4d38_105a_4d30, 0};
-#undef pci_ss_info_105a_4d30
-#define pci_ss_info_105a_4d30 pci_ss_info_105a_4d38_105a_4d30
-static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d33 =
- {0x105a, 0x4d33, pci_subsys_105a_4d38_105a_4d33, 0};
-#undef pci_ss_info_105a_4d33
-#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d38_105a_4d33
-static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d39 =
- {0x105a, 0x4d39, pci_subsys_105a_4d38_105a_4d39, 0};
-#undef pci_ss_info_105a_4d39
-#define pci_ss_info_105a_4d39 pci_ss_info_105a_4d38_105a_4d39
-static const pciSubsystemInfo pci_ss_info_105a_4d68_105a_4d68 =
- {0x105a, 0x4d68, pci_subsys_105a_4d68_105a_4d68, 0};
-#undef pci_ss_info_105a_4d68
-#define pci_ss_info_105a_4d68 pci_ss_info_105a_4d68_105a_4d68
-static const pciSubsystemInfo pci_ss_info_105a_4d69_105a_4d68 =
- {0x105a, 0x4d68, pci_subsys_105a_4d69_105a_4d68, 0};
-#undef pci_ss_info_105a_4d68
-#define pci_ss_info_105a_4d68 pci_ss_info_105a_4d69_105a_4d68
-static const pciSubsystemInfo pci_ss_info_105a_5275_105a_0275 =
- {0x105a, 0x0275, pci_subsys_105a_5275_105a_0275, 0};
-#undef pci_ss_info_105a_0275
-#define pci_ss_info_105a_0275 pci_ss_info_105a_5275_105a_0275
-static const pciSubsystemInfo pci_ss_info_105a_6269_105a_6269 =
- {0x105a, 0x6269, pci_subsys_105a_6269_105a_6269, 0};
-#undef pci_ss_info_105a_6269
-#define pci_ss_info_105a_6269 pci_ss_info_105a_6269_105a_6269
-#endif
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0000 =
- {0x105d, 0x0000, pci_subsys_105d_2339_105d_0000, 0};
-#undef pci_ss_info_105d_0000
-#define pci_ss_info_105d_0000 pci_ss_info_105d_2339_105d_0000
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0001 =
- {0x105d, 0x0001, pci_subsys_105d_2339_105d_0001, 0};
-#undef pci_ss_info_105d_0001
-#define pci_ss_info_105d_0001 pci_ss_info_105d_2339_105d_0001
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0002 =
- {0x105d, 0x0002, pci_subsys_105d_2339_105d_0002, 0};
-#undef pci_ss_info_105d_0002
-#define pci_ss_info_105d_0002 pci_ss_info_105d_2339_105d_0002
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0003 =
- {0x105d, 0x0003, pci_subsys_105d_2339_105d_0003, 0};
-#undef pci_ss_info_105d_0003
-#define pci_ss_info_105d_0003 pci_ss_info_105d_2339_105d_0003
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0004 =
- {0x105d, 0x0004, pci_subsys_105d_2339_105d_0004, 0};
-#undef pci_ss_info_105d_0004
-#define pci_ss_info_105d_0004 pci_ss_info_105d_2339_105d_0004
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0005 =
- {0x105d, 0x0005, pci_subsys_105d_2339_105d_0005, 0};
-#undef pci_ss_info_105d_0005
-#define pci_ss_info_105d_0005 pci_ss_info_105d_2339_105d_0005
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0006 =
- {0x105d, 0x0006, pci_subsys_105d_2339_105d_0006, 0};
-#undef pci_ss_info_105d_0006
-#define pci_ss_info_105d_0006 pci_ss_info_105d_2339_105d_0006
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0007 =
- {0x105d, 0x0007, pci_subsys_105d_2339_105d_0007, 0};
-#undef pci_ss_info_105d_0007
-#define pci_ss_info_105d_0007 pci_ss_info_105d_2339_105d_0007
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0008 =
- {0x105d, 0x0008, pci_subsys_105d_2339_105d_0008, 0};
-#undef pci_ss_info_105d_0008
-#define pci_ss_info_105d_0008 pci_ss_info_105d_2339_105d_0008
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0009 =
- {0x105d, 0x0009, pci_subsys_105d_2339_105d_0009, 0};
-#undef pci_ss_info_105d_0009
-#define pci_ss_info_105d_0009 pci_ss_info_105d_2339_105d_0009
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_000a =
- {0x105d, 0x000a, pci_subsys_105d_2339_105d_000a, 0};
-#undef pci_ss_info_105d_000a
-#define pci_ss_info_105d_000a pci_ss_info_105d_2339_105d_000a
-static const pciSubsystemInfo pci_ss_info_105d_2339_105d_000b =
- {0x105d, 0x000b, pci_subsys_105d_2339_105d_000b, 0};
-#undef pci_ss_info_105d_000b
-#define pci_ss_info_105d_000b pci_ss_info_105d_2339_105d_000b
-static const pciSubsystemInfo pci_ss_info_105d_2339_11a4_000a =
- {0x11a4, 0x000a, pci_subsys_105d_2339_11a4_000a, 0};
-#undef pci_ss_info_11a4_000a
-#define pci_ss_info_11a4_000a pci_ss_info_105d_2339_11a4_000a
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0000 =
- {0x13cc, 0x0000, pci_subsys_105d_2339_13cc_0000, 0};
-#undef pci_ss_info_13cc_0000
-#define pci_ss_info_13cc_0000 pci_ss_info_105d_2339_13cc_0000
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0004 =
- {0x13cc, 0x0004, pci_subsys_105d_2339_13cc_0004, 0};
-#undef pci_ss_info_13cc_0004
-#define pci_ss_info_13cc_0004 pci_ss_info_105d_2339_13cc_0004
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0005 =
- {0x13cc, 0x0005, pci_subsys_105d_2339_13cc_0005, 0};
-#undef pci_ss_info_13cc_0005
-#define pci_ss_info_13cc_0005 pci_ss_info_105d_2339_13cc_0005
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0006 =
- {0x13cc, 0x0006, pci_subsys_105d_2339_13cc_0006, 0};
-#undef pci_ss_info_13cc_0006
-#define pci_ss_info_13cc_0006 pci_ss_info_105d_2339_13cc_0006
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0008 =
- {0x13cc, 0x0008, pci_subsys_105d_2339_13cc_0008, 0};
-#undef pci_ss_info_13cc_0008
-#define pci_ss_info_13cc_0008 pci_ss_info_105d_2339_13cc_0008
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0009 =
- {0x13cc, 0x0009, pci_subsys_105d_2339_13cc_0009, 0};
-#undef pci_ss_info_13cc_0009
-#define pci_ss_info_13cc_0009 pci_ss_info_105d_2339_13cc_0009
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_000a =
- {0x13cc, 0x000a, pci_subsys_105d_2339_13cc_000a, 0};
-#undef pci_ss_info_13cc_000a
-#define pci_ss_info_13cc_000a pci_ss_info_105d_2339_13cc_000a
-static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_000c =
- {0x13cc, 0x000c, pci_subsys_105d_2339_13cc_000c, 0};
-#undef pci_ss_info_13cc_000c
-#define pci_ss_info_13cc_000c pci_ss_info_105d_2339_13cc_000c
-static const pciSubsystemInfo pci_ss_info_105d_493d_11a4_000a =
- {0x11a4, 0x000a, pci_subsys_105d_493d_11a4_000a, 0};
-#undef pci_ss_info_11a4_000a
-#define pci_ss_info_11a4_000a pci_ss_info_105d_493d_11a4_000a
-static const pciSubsystemInfo pci_ss_info_105d_493d_11a4_000b =
- {0x11a4, 0x000b, pci_subsys_105d_493d_11a4_000b, 0};
-#undef pci_ss_info_11a4_000b
-#define pci_ss_info_11a4_000b pci_ss_info_105d_493d_11a4_000b
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0002 =
- {0x13cc, 0x0002, pci_subsys_105d_493d_13cc_0002, 0};
-#undef pci_ss_info_13cc_0002
-#define pci_ss_info_13cc_0002 pci_ss_info_105d_493d_13cc_0002
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0003 =
- {0x13cc, 0x0003, pci_subsys_105d_493d_13cc_0003, 0};
-#undef pci_ss_info_13cc_0003
-#define pci_ss_info_13cc_0003 pci_ss_info_105d_493d_13cc_0003
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0007 =
- {0x13cc, 0x0007, pci_subsys_105d_493d_13cc_0007, 0};
-#undef pci_ss_info_13cc_0007
-#define pci_ss_info_13cc_0007 pci_ss_info_105d_493d_13cc_0007
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0008 =
- {0x13cc, 0x0008, pci_subsys_105d_493d_13cc_0008, 0};
-#undef pci_ss_info_13cc_0008
-#define pci_ss_info_13cc_0008 pci_ss_info_105d_493d_13cc_0008
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0009 =
- {0x13cc, 0x0009, pci_subsys_105d_493d_13cc_0009, 0};
-#undef pci_ss_info_13cc_0009
-#define pci_ss_info_13cc_0009 pci_ss_info_105d_493d_13cc_0009
-static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_000a =
- {0x13cc, 0x000a, pci_subsys_105d_493d_13cc_000a, 0};
-#undef pci_ss_info_13cc_000a
-#define pci_ss_info_13cc_000a pci_ss_info_105d_493d_13cc_000a
-static const pciSubsystemInfo pci_ss_info_105d_5348_105d_0037 =
- {0x105d, 0x0037, pci_subsys_105d_5348_105d_0037, 0};
-#undef pci_ss_info_105d_0037
-#define pci_ss_info_105d_0037 pci_ss_info_105d_5348_105d_0037
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1073_0004_1073_0004 =
- {0x1073, 0x0004, pci_subsys_1073_0004_1073_0004, 0};
-#undef pci_ss_info_1073_0004
-#define pci_ss_info_1073_0004 pci_ss_info_1073_0004_1073_0004
-static const pciSubsystemInfo pci_ss_info_1073_0005_1073_0005 =
- {0x1073, 0x0005, pci_subsys_1073_0005_1073_0005, 0};
-#undef pci_ss_info_1073_0005
-#define pci_ss_info_1073_0005 pci_ss_info_1073_0005_1073_0005
-static const pciSubsystemInfo pci_ss_info_1073_0008_1073_0008 =
- {0x1073, 0x0008, pci_subsys_1073_0008_1073_0008, 0};
-#undef pci_ss_info_1073_0008
-#define pci_ss_info_1073_0008 pci_ss_info_1073_0008_1073_0008
-static const pciSubsystemInfo pci_ss_info_1073_000a_1073_0004 =
- {0x1073, 0x0004, pci_subsys_1073_000a_1073_0004, 0};
-#undef pci_ss_info_1073_0004
-#define pci_ss_info_1073_0004 pci_ss_info_1073_000a_1073_0004
-static const pciSubsystemInfo pci_ss_info_1073_000a_1073_000a =
- {0x1073, 0x000a, pci_subsys_1073_000a_1073_000a, 0};
-#undef pci_ss_info_1073_000a
-#define pci_ss_info_1073_000a pci_ss_info_1073_000a_1073_000a
-static const pciSubsystemInfo pci_ss_info_1073_000c_107a_000c =
- {0x107a, 0x000c, pci_subsys_1073_000c_107a_000c, 0};
-#undef pci_ss_info_107a_000c
-#define pci_ss_info_107a_000c pci_ss_info_1073_000c_107a_000c
-static const pciSubsystemInfo pci_ss_info_1073_000d_1073_000d =
- {0x1073, 0x000d, pci_subsys_1073_000d_1073_000d, 0};
-#undef pci_ss_info_1073_000d
-#define pci_ss_info_1073_000d pci_ss_info_1073_000d_1073_000d
-static const pciSubsystemInfo pci_ss_info_1073_0010_1073_0006 =
- {0x1073, 0x0006, pci_subsys_1073_0010_1073_0006, 0};
-#undef pci_ss_info_1073_0006
-#define pci_ss_info_1073_0006 pci_ss_info_1073_0010_1073_0006
-static const pciSubsystemInfo pci_ss_info_1073_0010_1073_0010 =
- {0x1073, 0x0010, pci_subsys_1073_0010_1073_0010, 0};
-#undef pci_ss_info_1073_0010
-#define pci_ss_info_1073_0010 pci_ss_info_1073_0010_1073_0010
-static const pciSubsystemInfo pci_ss_info_1073_0012_1073_0012 =
- {0x1073, 0x0012, pci_subsys_1073_0012_1073_0012, 0};
-#undef pci_ss_info_1073_0012
-#define pci_ss_info_1073_0012 pci_ss_info_1073_0012_1073_0012
-static const pciSubsystemInfo pci_ss_info_1073_2000_1073_2000 =
- {0x1073, 0x2000, pci_subsys_1073_2000_1073_2000, 0};
-#undef pci_ss_info_1073_2000
-#define pci_ss_info_1073_2000 pci_ss_info_1073_2000_1073_2000
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1077_1216_101e_8471 =
- {0x101e, 0x8471, pci_subsys_1077_1216_101e_8471, 0};
-#undef pci_ss_info_101e_8471
-#define pci_ss_info_101e_8471 pci_ss_info_1077_1216_101e_8471
-static const pciSubsystemInfo pci_ss_info_1077_1216_101e_8493 =
- {0x101e, 0x8493, pci_subsys_1077_1216_101e_8493, 0};
-#undef pci_ss_info_101e_8493
-#define pci_ss_info_101e_8493 pci_ss_info_1077_1216_101e_8493
-static const pciSubsystemInfo pci_ss_info_1077_2100_1077_0001 =
- {0x1077, 0x0001, pci_subsys_1077_2100_1077_0001, 0};
-#undef pci_ss_info_1077_0001
-#define pci_ss_info_1077_0001 pci_ss_info_1077_2100_1077_0001
-static const pciSubsystemInfo pci_ss_info_1077_2200_1077_0002 =
- {0x1077, 0x0002, pci_subsys_1077_2200_1077_0002, 0};
-#undef pci_ss_info_1077_0002
-#define pci_ss_info_1077_0002 pci_ss_info_1077_2200_1077_0002
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_108d_0004_108d_0004 =
- {0x108d, 0x0004, pci_subsys_108d_0004_108d_0004, 0};
-#undef pci_ss_info_108d_0004
-#define pci_ss_info_108d_0004 pci_ss_info_108d_0004_108d_0004
-static const pciSubsystemInfo pci_ss_info_108d_0007_108d_0007 =
- {0x108d, 0x0007, pci_subsys_108d_0007_108d_0007, 0};
-#undef pci_ss_info_108d_0007
-#define pci_ss_info_108d_0007 pci_ss_info_108d_0007_108d_0007
-static const pciSubsystemInfo pci_ss_info_108d_0008_108d_0008 =
- {0x108d, 0x0008, pci_subsys_108d_0008_108d_0008, 0};
-#undef pci_ss_info_108d_0008
-#define pci_ss_info_108d_0008 pci_ss_info_108d_0008_108d_0008
-static const pciSubsystemInfo pci_ss_info_108d_0019_108d_0016 =
- {0x108d, 0x0016, pci_subsys_108d_0019_108d_0016, 0};
-#undef pci_ss_info_108d_0016
-#define pci_ss_info_108d_0016 pci_ss_info_108d_0019_108d_0016
-static const pciSubsystemInfo pci_ss_info_108d_0019_108d_0017 =
- {0x108d, 0x0017, pci_subsys_108d_0019_108d_0017, 0};
-#undef pci_ss_info_108d_0017
-#define pci_ss_info_108d_0017 pci_ss_info_108d_0019_108d_0017
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1095_0649_0e11_005d =
- {0x0e11, 0x005d, pci_subsys_1095_0649_0e11_005d, 0};
-#undef pci_ss_info_0e11_005d
-#define pci_ss_info_0e11_005d pci_ss_info_1095_0649_0e11_005d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1095_0649_0e11_007e =
- {0x0e11, 0x007e, pci_subsys_1095_0649_0e11_007e, 0};
-#undef pci_ss_info_0e11_007e
-#define pci_ss_info_0e11_007e pci_ss_info_1095_0649_0e11_007e
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1095_0649_101e_0649 =
- {0x101e, 0x0649, pci_subsys_1095_0649_101e_0649, 0};
-#undef pci_ss_info_101e_0649
-#define pci_ss_info_101e_0649 pci_ss_info_1095_0649_101e_0649
-static const pciSubsystemInfo pci_ss_info_1095_0670_1095_0670 =
- {0x1095, 0x0670, pci_subsys_1095_0670_1095_0670, 0};
-#undef pci_ss_info_1095_0670
-#define pci_ss_info_1095_0670 pci_ss_info_1095_0670_1095_0670
-#endif
-static const pciSubsystemInfo pci_ss_info_109e_0369_1002_0001 =
- {0x1002, 0x0001, pci_subsys_109e_0369_1002_0001, 0};
-#undef pci_ss_info_1002_0001
-#define pci_ss_info_1002_0001 pci_ss_info_109e_0369_1002_0001
-static const pciSubsystemInfo pci_ss_info_109e_0369_1002_0003 =
- {0x1002, 0x0003, pci_subsys_109e_0369_1002_0003, 0};
-#undef pci_ss_info_1002_0003
-#define pci_ss_info_1002_0003 pci_ss_info_109e_0369_1002_0003
-static const pciSubsystemInfo pci_ss_info_109e_036c_13e9_0070 =
- {0x13e9, 0x0070, pci_subsys_109e_036c_13e9_0070, 0};
-#undef pci_ss_info_13e9_0070
-#define pci_ss_info_13e9_0070 pci_ss_info_109e_036c_13e9_0070
-static const pciSubsystemInfo pci_ss_info_109e_036e_0070_13eb =
- {0x0070, 0x13eb, pci_subsys_109e_036e_0070_13eb, 0};
-#undef pci_ss_info_0070_13eb
-#define pci_ss_info_0070_13eb pci_ss_info_109e_036e_0070_13eb
-static const pciSubsystemInfo pci_ss_info_109e_036e_0070_ff01 =
- {0x0070, 0xff01, pci_subsys_109e_036e_0070_ff01, 0};
-#undef pci_ss_info_0070_ff01
-#define pci_ss_info_0070_ff01 pci_ss_info_109e_036e_0070_ff01
-static const pciSubsystemInfo pci_ss_info_109e_036e_107d_6606 =
- {0x107d, 0x6606, pci_subsys_109e_036e_107d_6606, 0};
-#undef pci_ss_info_107d_6606
-#define pci_ss_info_107d_6606 pci_ss_info_109e_036e_107d_6606
-static const pciSubsystemInfo pci_ss_info_109e_036e_11bd_0012 =
- {0x11bd, 0x0012, pci_subsys_109e_036e_11bd_0012, 0};
-#undef pci_ss_info_11bd_0012
-#define pci_ss_info_11bd_0012 pci_ss_info_109e_036e_11bd_0012
-static const pciSubsystemInfo pci_ss_info_109e_036e_11bd_001c =
- {0x11bd, 0x001c, pci_subsys_109e_036e_11bd_001c, 0};
-#undef pci_ss_info_11bd_001c
-#define pci_ss_info_11bd_001c pci_ss_info_109e_036e_11bd_001c
-static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0001 =
- {0x127a, 0x0001, pci_subsys_109e_036e_127a_0001, 0};
-#undef pci_ss_info_127a_0001
-#define pci_ss_info_127a_0001 pci_ss_info_109e_036e_127a_0001
-static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0002 =
- {0x127a, 0x0002, pci_subsys_109e_036e_127a_0002, 0};
-#undef pci_ss_info_127a_0002
-#define pci_ss_info_127a_0002 pci_ss_info_109e_036e_127a_0002
-static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0003 =
- {0x127a, 0x0003, pci_subsys_109e_036e_127a_0003, 0};
-#undef pci_ss_info_127a_0003
-#define pci_ss_info_127a_0003 pci_ss_info_109e_036e_127a_0003
-static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0048 =
- {0x127a, 0x0048, pci_subsys_109e_036e_127a_0048, 0};
-#undef pci_ss_info_127a_0048
-#define pci_ss_info_127a_0048 pci_ss_info_109e_036e_127a_0048
-static const pciSubsystemInfo pci_ss_info_109e_036e_144f_3000 =
- {0x144f, 0x3000, pci_subsys_109e_036e_144f_3000, 0};
-#undef pci_ss_info_144f_3000
-#define pci_ss_info_144f_3000 pci_ss_info_109e_036e_144f_3000
-static const pciSubsystemInfo pci_ss_info_109e_036e_1461_0004 =
- {0x1461, 0x0004, pci_subsys_109e_036e_1461_0004, 0};
-#undef pci_ss_info_1461_0004
-#define pci_ss_info_1461_0004 pci_ss_info_109e_036e_1461_0004
-static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0001 =
- {0x14f1, 0x0001, pci_subsys_109e_036e_14f1_0001, 0};
-#undef pci_ss_info_14f1_0001
-#define pci_ss_info_14f1_0001 pci_ss_info_109e_036e_14f1_0001
-static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0002 =
- {0x14f1, 0x0002, pci_subsys_109e_036e_14f1_0002, 0};
-#undef pci_ss_info_14f1_0002
-#define pci_ss_info_14f1_0002 pci_ss_info_109e_036e_14f1_0002
-static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0003 =
- {0x14f1, 0x0003, pci_subsys_109e_036e_14f1_0003, 0};
-#undef pci_ss_info_14f1_0003
-#define pci_ss_info_14f1_0003 pci_ss_info_109e_036e_14f1_0003
-static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0048 =
- {0x14f1, 0x0048, pci_subsys_109e_036e_14f1_0048, 0};
-#undef pci_ss_info_14f1_0048
-#define pci_ss_info_14f1_0048 pci_ss_info_109e_036e_14f1_0048
-static const pciSubsystemInfo pci_ss_info_109e_036e_1851_1850 =
- {0x1851, 0x1850, pci_subsys_109e_036e_1851_1850, 0};
-#undef pci_ss_info_1851_1850
-#define pci_ss_info_1851_1850 pci_ss_info_109e_036e_1851_1850
-static const pciSubsystemInfo pci_ss_info_109e_036e_1851_1851 =
- {0x1851, 0x1851, pci_subsys_109e_036e_1851_1851, 0};
-#undef pci_ss_info_1851_1851
-#define pci_ss_info_1851_1851 pci_ss_info_109e_036e_1851_1851
-static const pciSubsystemInfo pci_ss_info_109e_036e_1852_1852 =
- {0x1852, 0x1852, pci_subsys_109e_036e_1852_1852, 0};
-#undef pci_ss_info_1852_1852
-#define pci_ss_info_1852_1852 pci_ss_info_109e_036e_1852_1852
-static const pciSubsystemInfo pci_ss_info_109e_036e_bd11_1200 =
- {0xbd11, 0x1200, pci_subsys_109e_036e_bd11_1200, 0};
-#undef pci_ss_info_bd11_1200
-#define pci_ss_info_bd11_1200 pci_ss_info_109e_036e_bd11_1200
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0044 =
- {0x127a, 0x0044, pci_subsys_109e_036f_127a_0044, 0};
-#undef pci_ss_info_127a_0044
-#define pci_ss_info_127a_0044 pci_ss_info_109e_036f_127a_0044
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0122 =
- {0x127a, 0x0122, pci_subsys_109e_036f_127a_0122, 0};
-#undef pci_ss_info_127a_0122
-#define pci_ss_info_127a_0122 pci_ss_info_109e_036f_127a_0122
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0144 =
- {0x127a, 0x0144, pci_subsys_109e_036f_127a_0144, 0};
-#undef pci_ss_info_127a_0144
-#define pci_ss_info_127a_0144 pci_ss_info_109e_036f_127a_0144
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0222 =
- {0x127a, 0x0222, pci_subsys_109e_036f_127a_0222, 0};
-#undef pci_ss_info_127a_0222
-#define pci_ss_info_127a_0222 pci_ss_info_109e_036f_127a_0222
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0244 =
- {0x127a, 0x0244, pci_subsys_109e_036f_127a_0244, 0};
-#undef pci_ss_info_127a_0244
-#define pci_ss_info_127a_0244 pci_ss_info_109e_036f_127a_0244
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0322 =
- {0x127a, 0x0322, pci_subsys_109e_036f_127a_0322, 0};
-#undef pci_ss_info_127a_0322
-#define pci_ss_info_127a_0322 pci_ss_info_109e_036f_127a_0322
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0422 =
- {0x127a, 0x0422, pci_subsys_109e_036f_127a_0422, 0};
-#undef pci_ss_info_127a_0422
-#define pci_ss_info_127a_0422 pci_ss_info_109e_036f_127a_0422
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1122 =
- {0x127a, 0x1122, pci_subsys_109e_036f_127a_1122, 0};
-#undef pci_ss_info_127a_1122
-#define pci_ss_info_127a_1122 pci_ss_info_109e_036f_127a_1122
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1222 =
- {0x127a, 0x1222, pci_subsys_109e_036f_127a_1222, 0};
-#undef pci_ss_info_127a_1222
-#define pci_ss_info_127a_1222 pci_ss_info_109e_036f_127a_1222
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1322 =
- {0x127a, 0x1322, pci_subsys_109e_036f_127a_1322, 0};
-#undef pci_ss_info_127a_1322
-#define pci_ss_info_127a_1322 pci_ss_info_109e_036f_127a_1322
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1522 =
- {0x127a, 0x1522, pci_subsys_109e_036f_127a_1522, 0};
-#undef pci_ss_info_127a_1522
-#define pci_ss_info_127a_1522 pci_ss_info_109e_036f_127a_1522
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1622 =
- {0x127a, 0x1622, pci_subsys_109e_036f_127a_1622, 0};
-#undef pci_ss_info_127a_1622
-#define pci_ss_info_127a_1622 pci_ss_info_109e_036f_127a_1622
-static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1722 =
- {0x127a, 0x1722, pci_subsys_109e_036f_127a_1722, 0};
-#undef pci_ss_info_127a_1722
-#define pci_ss_info_127a_1722 pci_ss_info_109e_036f_127a_1722
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0044 =
- {0x14f1, 0x0044, pci_subsys_109e_036f_14f1_0044, 0};
-#undef pci_ss_info_14f1_0044
-#define pci_ss_info_14f1_0044 pci_ss_info_109e_036f_14f1_0044
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0122 =
- {0x14f1, 0x0122, pci_subsys_109e_036f_14f1_0122, 0};
-#undef pci_ss_info_14f1_0122
-#define pci_ss_info_14f1_0122 pci_ss_info_109e_036f_14f1_0122
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0144 =
- {0x14f1, 0x0144, pci_subsys_109e_036f_14f1_0144, 0};
-#undef pci_ss_info_14f1_0144
-#define pci_ss_info_14f1_0144 pci_ss_info_109e_036f_14f1_0144
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0222 =
- {0x14f1, 0x0222, pci_subsys_109e_036f_14f1_0222, 0};
-#undef pci_ss_info_14f1_0222
-#define pci_ss_info_14f1_0222 pci_ss_info_109e_036f_14f1_0222
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0244 =
- {0x14f1, 0x0244, pci_subsys_109e_036f_14f1_0244, 0};
-#undef pci_ss_info_14f1_0244
-#define pci_ss_info_14f1_0244 pci_ss_info_109e_036f_14f1_0244
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0322 =
- {0x14f1, 0x0322, pci_subsys_109e_036f_14f1_0322, 0};
-#undef pci_ss_info_14f1_0322
-#define pci_ss_info_14f1_0322 pci_ss_info_109e_036f_14f1_0322
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0422 =
- {0x14f1, 0x0422, pci_subsys_109e_036f_14f1_0422, 0};
-#undef pci_ss_info_14f1_0422
-#define pci_ss_info_14f1_0422 pci_ss_info_109e_036f_14f1_0422
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1122 =
- {0x14f1, 0x1122, pci_subsys_109e_036f_14f1_1122, 0};
-#undef pci_ss_info_14f1_1122
-#define pci_ss_info_14f1_1122 pci_ss_info_109e_036f_14f1_1122
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1222 =
- {0x14f1, 0x1222, pci_subsys_109e_036f_14f1_1222, 0};
-#undef pci_ss_info_14f1_1222
-#define pci_ss_info_14f1_1222 pci_ss_info_109e_036f_14f1_1222
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1322 =
- {0x14f1, 0x1322, pci_subsys_109e_036f_14f1_1322, 0};
-#undef pci_ss_info_14f1_1322
-#define pci_ss_info_14f1_1322 pci_ss_info_109e_036f_14f1_1322
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1522 =
- {0x14f1, 0x1522, pci_subsys_109e_036f_14f1_1522, 0};
-#undef pci_ss_info_14f1_1522
-#define pci_ss_info_14f1_1522 pci_ss_info_109e_036f_14f1_1522
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1622 =
- {0x14f1, 0x1622, pci_subsys_109e_036f_14f1_1622, 0};
-#undef pci_ss_info_14f1_1622
-#define pci_ss_info_14f1_1622 pci_ss_info_109e_036f_14f1_1622
-static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1722 =
- {0x14f1, 0x1722, pci_subsys_109e_036f_14f1_1722, 0};
-#undef pci_ss_info_14f1_1722
-#define pci_ss_info_14f1_1722 pci_ss_info_109e_036f_14f1_1722
-static const pciSubsystemInfo pci_ss_info_109e_036f_1851_1850 =
- {0x1851, 0x1850, pci_subsys_109e_036f_1851_1850, 0};
-#undef pci_ss_info_1851_1850
-#define pci_ss_info_1851_1850 pci_ss_info_109e_036f_1851_1850
-static const pciSubsystemInfo pci_ss_info_109e_036f_1851_1851 =
- {0x1851, 0x1851, pci_subsys_109e_036f_1851_1851, 0};
-#undef pci_ss_info_1851_1851
-#define pci_ss_info_1851_1851 pci_ss_info_109e_036f_1851_1851
-static const pciSubsystemInfo pci_ss_info_109e_036f_1852_1852 =
- {0x1852, 0x1852, pci_subsys_109e_036f_1852_1852, 0};
-#undef pci_ss_info_1852_1852
-#define pci_ss_info_1852_1852 pci_ss_info_109e_036f_1852_1852
-static const pciSubsystemInfo pci_ss_info_109e_0370_1851_1850 =
- {0x1851, 0x1850, pci_subsys_109e_0370_1851_1850, 0};
-#undef pci_ss_info_1851_1850
-#define pci_ss_info_1851_1850 pci_ss_info_109e_0370_1851_1850
-static const pciSubsystemInfo pci_ss_info_109e_0370_1851_1851 =
- {0x1851, 0x1851, pci_subsys_109e_0370_1851_1851, 0};
-#undef pci_ss_info_1851_1851
-#define pci_ss_info_1851_1851 pci_ss_info_109e_0370_1851_1851
-static const pciSubsystemInfo pci_ss_info_109e_0370_1852_1852 =
- {0x1852, 0x1852, pci_subsys_109e_0370_1852_1852, 0};
-#undef pci_ss_info_1852_1852
-#define pci_ss_info_1852_1852 pci_ss_info_109e_0370_1852_1852
-static const pciSubsystemInfo pci_ss_info_109e_0878_0070_13eb =
- {0x0070, 0x13eb, pci_subsys_109e_0878_0070_13eb, 0};
-#undef pci_ss_info_0070_13eb
-#define pci_ss_info_0070_13eb pci_ss_info_109e_0878_0070_13eb
-static const pciSubsystemInfo pci_ss_info_109e_0878_0070_ff01 =
- {0x0070, 0xff01, pci_subsys_109e_0878_0070_ff01, 0};
-#undef pci_ss_info_0070_ff01
-#define pci_ss_info_0070_ff01 pci_ss_info_109e_0878_0070_ff01
-static const pciSubsystemInfo pci_ss_info_109e_0878_1002_0001 =
- {0x1002, 0x0001, pci_subsys_109e_0878_1002_0001, 0};
-#undef pci_ss_info_1002_0001
-#define pci_ss_info_1002_0001 pci_ss_info_109e_0878_1002_0001
-static const pciSubsystemInfo pci_ss_info_109e_0878_1002_0003 =
- {0x1002, 0x0003, pci_subsys_109e_0878_1002_0003, 0};
-#undef pci_ss_info_1002_0003
-#define pci_ss_info_1002_0003 pci_ss_info_109e_0878_1002_0003
-static const pciSubsystemInfo pci_ss_info_109e_0878_11bd_0012 =
- {0x11bd, 0x0012, pci_subsys_109e_0878_11bd_0012, 0};
-#undef pci_ss_info_11bd_0012
-#define pci_ss_info_11bd_0012 pci_ss_info_109e_0878_11bd_0012
-static const pciSubsystemInfo pci_ss_info_109e_0878_11bd_001c =
- {0x11bd, 0x001c, pci_subsys_109e_0878_11bd_001c, 0};
-#undef pci_ss_info_11bd_001c
-#define pci_ss_info_11bd_001c pci_ss_info_109e_0878_11bd_001c
-static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0001 =
- {0x127a, 0x0001, pci_subsys_109e_0878_127a_0001, 0};
-#undef pci_ss_info_127a_0001
-#define pci_ss_info_127a_0001 pci_ss_info_109e_0878_127a_0001
-static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0002 =
- {0x127a, 0x0002, pci_subsys_109e_0878_127a_0002, 0};
-#undef pci_ss_info_127a_0002
-#define pci_ss_info_127a_0002 pci_ss_info_109e_0878_127a_0002
-static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0003 =
- {0x127a, 0x0003, pci_subsys_109e_0878_127a_0003, 0};
-#undef pci_ss_info_127a_0003
-#define pci_ss_info_127a_0003 pci_ss_info_109e_0878_127a_0003
-static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0048 =
- {0x127a, 0x0048, pci_subsys_109e_0878_127a_0048, 0};
-#undef pci_ss_info_127a_0048
-#define pci_ss_info_127a_0048 pci_ss_info_109e_0878_127a_0048
-static const pciSubsystemInfo pci_ss_info_109e_0878_13e9_0070 =
- {0x13e9, 0x0070, pci_subsys_109e_0878_13e9_0070, 0};
-#undef pci_ss_info_13e9_0070
-#define pci_ss_info_13e9_0070 pci_ss_info_109e_0878_13e9_0070
-static const pciSubsystemInfo pci_ss_info_109e_0878_144f_3000 =
- {0x144f, 0x3000, pci_subsys_109e_0878_144f_3000, 0};
-#undef pci_ss_info_144f_3000
-#define pci_ss_info_144f_3000 pci_ss_info_109e_0878_144f_3000
-static const pciSubsystemInfo pci_ss_info_109e_0878_1461_0004 =
- {0x1461, 0x0004, pci_subsys_109e_0878_1461_0004, 0};
-#undef pci_ss_info_1461_0004
-#define pci_ss_info_1461_0004 pci_ss_info_109e_0878_1461_0004
-static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0001 =
- {0x14f1, 0x0001, pci_subsys_109e_0878_14f1_0001, 0};
-#undef pci_ss_info_14f1_0001
-#define pci_ss_info_14f1_0001 pci_ss_info_109e_0878_14f1_0001
-static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0002 =
- {0x14f1, 0x0002, pci_subsys_109e_0878_14f1_0002, 0};
-#undef pci_ss_info_14f1_0002
-#define pci_ss_info_14f1_0002 pci_ss_info_109e_0878_14f1_0002
-static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0003 =
- {0x14f1, 0x0003, pci_subsys_109e_0878_14f1_0003, 0};
-#undef pci_ss_info_14f1_0003
-#define pci_ss_info_14f1_0003 pci_ss_info_109e_0878_14f1_0003
-static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0048 =
- {0x14f1, 0x0048, pci_subsys_109e_0878_14f1_0048, 0};
-#undef pci_ss_info_14f1_0048
-#define pci_ss_info_14f1_0048 pci_ss_info_109e_0878_14f1_0048
-static const pciSubsystemInfo pci_ss_info_109e_0878_bd11_1200 =
- {0xbd11, 0x1200, pci_subsys_109e_0878_bd11_1200, 0};
-#undef pci_ss_info_bd11_1200
-#define pci_ss_info_bd11_1200 pci_ss_info_109e_0878_bd11_1200
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0044 =
- {0x127a, 0x0044, pci_subsys_109e_0879_127a_0044, 0};
-#undef pci_ss_info_127a_0044
-#define pci_ss_info_127a_0044 pci_ss_info_109e_0879_127a_0044
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0122 =
- {0x127a, 0x0122, pci_subsys_109e_0879_127a_0122, 0};
-#undef pci_ss_info_127a_0122
-#define pci_ss_info_127a_0122 pci_ss_info_109e_0879_127a_0122
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0144 =
- {0x127a, 0x0144, pci_subsys_109e_0879_127a_0144, 0};
-#undef pci_ss_info_127a_0144
-#define pci_ss_info_127a_0144 pci_ss_info_109e_0879_127a_0144
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0222 =
- {0x127a, 0x0222, pci_subsys_109e_0879_127a_0222, 0};
-#undef pci_ss_info_127a_0222
-#define pci_ss_info_127a_0222 pci_ss_info_109e_0879_127a_0222
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0244 =
- {0x127a, 0x0244, pci_subsys_109e_0879_127a_0244, 0};
-#undef pci_ss_info_127a_0244
-#define pci_ss_info_127a_0244 pci_ss_info_109e_0879_127a_0244
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0322 =
- {0x127a, 0x0322, pci_subsys_109e_0879_127a_0322, 0};
-#undef pci_ss_info_127a_0322
-#define pci_ss_info_127a_0322 pci_ss_info_109e_0879_127a_0322
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0422 =
- {0x127a, 0x0422, pci_subsys_109e_0879_127a_0422, 0};
-#undef pci_ss_info_127a_0422
-#define pci_ss_info_127a_0422 pci_ss_info_109e_0879_127a_0422
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1122 =
- {0x127a, 0x1122, pci_subsys_109e_0879_127a_1122, 0};
-#undef pci_ss_info_127a_1122
-#define pci_ss_info_127a_1122 pci_ss_info_109e_0879_127a_1122
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1222 =
- {0x127a, 0x1222, pci_subsys_109e_0879_127a_1222, 0};
-#undef pci_ss_info_127a_1222
-#define pci_ss_info_127a_1222 pci_ss_info_109e_0879_127a_1222
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1322 =
- {0x127a, 0x1322, pci_subsys_109e_0879_127a_1322, 0};
-#undef pci_ss_info_127a_1322
-#define pci_ss_info_127a_1322 pci_ss_info_109e_0879_127a_1322
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1522 =
- {0x127a, 0x1522, pci_subsys_109e_0879_127a_1522, 0};
-#undef pci_ss_info_127a_1522
-#define pci_ss_info_127a_1522 pci_ss_info_109e_0879_127a_1522
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1622 =
- {0x127a, 0x1622, pci_subsys_109e_0879_127a_1622, 0};
-#undef pci_ss_info_127a_1622
-#define pci_ss_info_127a_1622 pci_ss_info_109e_0879_127a_1622
-static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1722 =
- {0x127a, 0x1722, pci_subsys_109e_0879_127a_1722, 0};
-#undef pci_ss_info_127a_1722
-#define pci_ss_info_127a_1722 pci_ss_info_109e_0879_127a_1722
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0044 =
- {0x14f1, 0x0044, pci_subsys_109e_0879_14f1_0044, 0};
-#undef pci_ss_info_14f1_0044
-#define pci_ss_info_14f1_0044 pci_ss_info_109e_0879_14f1_0044
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0122 =
- {0x14f1, 0x0122, pci_subsys_109e_0879_14f1_0122, 0};
-#undef pci_ss_info_14f1_0122
-#define pci_ss_info_14f1_0122 pci_ss_info_109e_0879_14f1_0122
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0144 =
- {0x14f1, 0x0144, pci_subsys_109e_0879_14f1_0144, 0};
-#undef pci_ss_info_14f1_0144
-#define pci_ss_info_14f1_0144 pci_ss_info_109e_0879_14f1_0144
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0222 =
- {0x14f1, 0x0222, pci_subsys_109e_0879_14f1_0222, 0};
-#undef pci_ss_info_14f1_0222
-#define pci_ss_info_14f1_0222 pci_ss_info_109e_0879_14f1_0222
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0244 =
- {0x14f1, 0x0244, pci_subsys_109e_0879_14f1_0244, 0};
-#undef pci_ss_info_14f1_0244
-#define pci_ss_info_14f1_0244 pci_ss_info_109e_0879_14f1_0244
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0322 =
- {0x14f1, 0x0322, pci_subsys_109e_0879_14f1_0322, 0};
-#undef pci_ss_info_14f1_0322
-#define pci_ss_info_14f1_0322 pci_ss_info_109e_0879_14f1_0322
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0422 =
- {0x14f1, 0x0422, pci_subsys_109e_0879_14f1_0422, 0};
-#undef pci_ss_info_14f1_0422
-#define pci_ss_info_14f1_0422 pci_ss_info_109e_0879_14f1_0422
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1122 =
- {0x14f1, 0x1122, pci_subsys_109e_0879_14f1_1122, 0};
-#undef pci_ss_info_14f1_1122
-#define pci_ss_info_14f1_1122 pci_ss_info_109e_0879_14f1_1122
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1222 =
- {0x14f1, 0x1222, pci_subsys_109e_0879_14f1_1222, 0};
-#undef pci_ss_info_14f1_1222
-#define pci_ss_info_14f1_1222 pci_ss_info_109e_0879_14f1_1222
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1322 =
- {0x14f1, 0x1322, pci_subsys_109e_0879_14f1_1322, 0};
-#undef pci_ss_info_14f1_1322
-#define pci_ss_info_14f1_1322 pci_ss_info_109e_0879_14f1_1322
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1522 =
- {0x14f1, 0x1522, pci_subsys_109e_0879_14f1_1522, 0};
-#undef pci_ss_info_14f1_1522
-#define pci_ss_info_14f1_1522 pci_ss_info_109e_0879_14f1_1522
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1622 =
- {0x14f1, 0x1622, pci_subsys_109e_0879_14f1_1622, 0};
-#undef pci_ss_info_14f1_1622
-#define pci_ss_info_14f1_1622 pci_ss_info_109e_0879_14f1_1622
-static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1722 =
- {0x14f1, 0x1722, pci_subsys_109e_0879_14f1_1722, 0};
-#undef pci_ss_info_14f1_1722
-#define pci_ss_info_14f1_1722 pci_ss_info_109e_0879_14f1_1722
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10a9_0009_10a9_8002 =
- {0x10a9, 0x8002, pci_subsys_10a9_0009_10a9_8002, 0};
-#undef pci_ss_info_10a9_8002
-#define pci_ss_info_10a9_8002 pci_ss_info_10a9_0009_10a9_8002
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b4_1b1d_10b4_237e =
- {0x10b4, 0x237e, pci_subsys_10b4_1b1d_10b4_237e, 0};
-#undef pci_ss_info_10b4_237e
-#define pci_ss_info_10b4_237e pci_ss_info_10b4_1b1d_10b4_237e
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b5_9030_15ed_1002 =
- {0x15ed, 0x1002, pci_subsys_10b5_9030_15ed_1002, 0};
-#undef pci_ss_info_15ed_1002
-#define pci_ss_info_15ed_1002 pci_ss_info_10b5_9030_15ed_1002
-static const pciSubsystemInfo pci_ss_info_10b5_9030_15ed_1003 =
- {0x15ed, 0x1003, pci_subsys_10b5_9030_15ed_1003, 0};
-#undef pci_ss_info_15ed_1003
-#define pci_ss_info_15ed_1003 pci_ss_info_10b5_9030_15ed_1003
-static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_2036 =
- {0x10b5, 0x2036, pci_subsys_10b5_9050_10b5_2036, 0};
-#undef pci_ss_info_10b5_2036
-#define pci_ss_info_10b5_2036 pci_ss_info_10b5_9050_10b5_2036
-static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_2273 =
- {0x10b5, 0x2273, pci_subsys_10b5_9050_10b5_2273, 0};
-#undef pci_ss_info_10b5_2273
-#define pci_ss_info_10b5_2273 pci_ss_info_10b5_9050_10b5_2273
-static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_9050 =
- {0x10b5, 0x9050, pci_subsys_10b5_9050_10b5_9050, 0};
-#undef pci_ss_info_10b5_9050
-#define pci_ss_info_10b5_9050 pci_ss_info_10b5_9050_10b5_9050
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0001 =
- {0x1522, 0x0001, pci_subsys_10b5_9050_1522_0001, 0};
-#undef pci_ss_info_1522_0001
-#define pci_ss_info_1522_0001 pci_ss_info_10b5_9050_1522_0001
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0002 =
- {0x1522, 0x0002, pci_subsys_10b5_9050_1522_0002, 0};
-#undef pci_ss_info_1522_0002
-#define pci_ss_info_1522_0002 pci_ss_info_10b5_9050_1522_0002
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0003 =
- {0x1522, 0x0003, pci_subsys_10b5_9050_1522_0003, 0};
-#undef pci_ss_info_1522_0003
-#define pci_ss_info_1522_0003 pci_ss_info_10b5_9050_1522_0003
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0004 =
- {0x1522, 0x0004, pci_subsys_10b5_9050_1522_0004, 0};
-#undef pci_ss_info_1522_0004
-#define pci_ss_info_1522_0004 pci_ss_info_10b5_9050_1522_0004
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0010 =
- {0x1522, 0x0010, pci_subsys_10b5_9050_1522_0010, 0};
-#undef pci_ss_info_1522_0010
-#define pci_ss_info_1522_0010 pci_ss_info_10b5_9050_1522_0010
-static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0020 =
- {0x1522, 0x0020, pci_subsys_10b5_9050_1522_0020, 0};
-#undef pci_ss_info_1522_0020
-#define pci_ss_info_1522_0020 pci_ss_info_10b5_9050_1522_0020
-static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1000 =
- {0x15ed, 0x1000, pci_subsys_10b5_9050_15ed_1000, 0};
-#undef pci_ss_info_15ed_1000
-#define pci_ss_info_15ed_1000 pci_ss_info_10b5_9050_15ed_1000
-static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1001 =
- {0x15ed, 0x1001, pci_subsys_10b5_9050_15ed_1001, 0};
-#undef pci_ss_info_15ed_1001
-#define pci_ss_info_15ed_1001 pci_ss_info_10b5_9050_15ed_1001
-static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1002 =
- {0x15ed, 0x1002, pci_subsys_10b5_9050_15ed_1002, 0};
-#undef pci_ss_info_15ed_1002
-#define pci_ss_info_15ed_1002 pci_ss_info_10b5_9050_15ed_1002
-static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1003 =
- {0x15ed, 0x1003, pci_subsys_10b5_9050_15ed_1003, 0};
-#undef pci_ss_info_15ed_1003
-#define pci_ss_info_15ed_1003 pci_ss_info_10b5_9050_15ed_1003
-static const pciSubsystemInfo pci_ss_info_10b5_9050_5654_5634 =
- {0x5654, 0x5634, pci_subsys_10b5_9050_5654_5634, 0};
-#undef pci_ss_info_5654_5634
-#define pci_ss_info_5654_5634 pci_ss_info_10b5_9050_5654_5634
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d531_c002 =
- {0xd531, 0xc002, pci_subsys_10b5_9050_d531_c002, 0};
-#undef pci_ss_info_d531_c002
-#define pci_ss_info_d531_c002 pci_ss_info_10b5_9050_d531_c002
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4006 =
- {0xd84d, 0x4006, pci_subsys_10b5_9050_d84d_4006, 0};
-#undef pci_ss_info_d84d_4006
-#define pci_ss_info_d84d_4006 pci_ss_info_10b5_9050_d84d_4006
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4008 =
- {0xd84d, 0x4008, pci_subsys_10b5_9050_d84d_4008, 0};
-#undef pci_ss_info_d84d_4008
-#define pci_ss_info_d84d_4008 pci_ss_info_10b5_9050_d84d_4008
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4014 =
- {0xd84d, 0x4014, pci_subsys_10b5_9050_d84d_4014, 0};
-#undef pci_ss_info_d84d_4014
-#define pci_ss_info_d84d_4014 pci_ss_info_10b5_9050_d84d_4014
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4018 =
- {0xd84d, 0x4018, pci_subsys_10b5_9050_d84d_4018, 0};
-#undef pci_ss_info_d84d_4018
-#define pci_ss_info_d84d_4018 pci_ss_info_10b5_9050_d84d_4018
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4025 =
- {0xd84d, 0x4025, pci_subsys_10b5_9050_d84d_4025, 0};
-#undef pci_ss_info_d84d_4025
-#define pci_ss_info_d84d_4025 pci_ss_info_10b5_9050_d84d_4025
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4027 =
- {0xd84d, 0x4027, pci_subsys_10b5_9050_d84d_4027, 0};
-#undef pci_ss_info_d84d_4027
-#define pci_ss_info_d84d_4027 pci_ss_info_10b5_9050_d84d_4027
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4028 =
- {0xd84d, 0x4028, pci_subsys_10b5_9050_d84d_4028, 0};
-#undef pci_ss_info_d84d_4028
-#define pci_ss_info_d84d_4028 pci_ss_info_10b5_9050_d84d_4028
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4036 =
- {0xd84d, 0x4036, pci_subsys_10b5_9050_d84d_4036, 0};
-#undef pci_ss_info_d84d_4036
-#define pci_ss_info_d84d_4036 pci_ss_info_10b5_9050_d84d_4036
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4037 =
- {0xd84d, 0x4037, pci_subsys_10b5_9050_d84d_4037, 0};
-#undef pci_ss_info_d84d_4037
-#define pci_ss_info_d84d_4037 pci_ss_info_10b5_9050_d84d_4037
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4038 =
- {0xd84d, 0x4038, pci_subsys_10b5_9050_d84d_4038, 0};
-#undef pci_ss_info_d84d_4038
-#define pci_ss_info_d84d_4038 pci_ss_info_10b5_9050_d84d_4038
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4052 =
- {0xd84d, 0x4052, pci_subsys_10b5_9050_d84d_4052, 0};
-#undef pci_ss_info_d84d_4052
-#define pci_ss_info_d84d_4052 pci_ss_info_10b5_9050_d84d_4052
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4053 =
- {0xd84d, 0x4053, pci_subsys_10b5_9050_d84d_4053, 0};
-#undef pci_ss_info_d84d_4053
-#define pci_ss_info_d84d_4053 pci_ss_info_10b5_9050_d84d_4053
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4055 =
- {0xd84d, 0x4055, pci_subsys_10b5_9050_d84d_4055, 0};
-#undef pci_ss_info_d84d_4055
-#define pci_ss_info_d84d_4055 pci_ss_info_10b5_9050_d84d_4055
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4058 =
- {0xd84d, 0x4058, pci_subsys_10b5_9050_d84d_4058, 0};
-#undef pci_ss_info_d84d_4058
-#define pci_ss_info_d84d_4058 pci_ss_info_10b5_9050_d84d_4058
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4065 =
- {0xd84d, 0x4065, pci_subsys_10b5_9050_d84d_4065, 0};
-#undef pci_ss_info_d84d_4065
-#define pci_ss_info_d84d_4065 pci_ss_info_10b5_9050_d84d_4065
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4068 =
- {0xd84d, 0x4068, pci_subsys_10b5_9050_d84d_4068, 0};
-#undef pci_ss_info_d84d_4068
-#define pci_ss_info_d84d_4068 pci_ss_info_10b5_9050_d84d_4068
-static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4078 =
- {0xd84d, 0x4078, pci_subsys_10b5_9050_d84d_4078, 0};
-#undef pci_ss_info_d84d_4078
-#define pci_ss_info_d84d_4078 pci_ss_info_10b5_9050_d84d_4078
-static const pciSubsystemInfo pci_ss_info_10b5_9054_10b5_2455 =
- {0x10b5, 0x2455, pci_subsys_10b5_9054_10b5_2455, 0};
-#undef pci_ss_info_10b5_2455
-#define pci_ss_info_10b5_2455 pci_ss_info_10b5_9054_10b5_2455
-static const pciSubsystemInfo pci_ss_info_10b5_9054_12d9_0002 =
- {0x12d9, 0x0002, pci_subsys_10b5_9054_12d9_0002, 0};
-#undef pci_ss_info_12d9_0002
-#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9054_12d9_0002
-static const pciSubsystemInfo pci_ss_info_10b5_906d_125c_0640 =
- {0x125c, 0x0640, pci_subsys_10b5_906d_125c_0640, 0};
-#undef pci_ss_info_125c_0640
-#define pci_ss_info_125c_0640 pci_ss_info_10b5_906d_125c_0640
-static const pciSubsystemInfo pci_ss_info_10b5_9080_10b5_9080 =
- {0x10b5, 0x9080, pci_subsys_10b5_9080_10b5_9080, 0};
-#undef pci_ss_info_10b5_9080
-#define pci_ss_info_10b5_9080 pci_ss_info_10b5_9080_10b5_9080
-static const pciSubsystemInfo pci_ss_info_10b5_9080_129d_0002 =
- {0x129d, 0x0002, pci_subsys_10b5_9080_129d_0002, 0};
-#undef pci_ss_info_129d_0002
-#define pci_ss_info_129d_0002 pci_ss_info_10b5_9080_129d_0002
-static const pciSubsystemInfo pci_ss_info_10b5_9080_12d9_0002 =
- {0x12d9, 0x0002, pci_subsys_10b5_9080_12d9_0002, 0};
-#undef pci_ss_info_12d9_0002
-#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9080_12d9_0002
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0002 =
- {0x10b6, 0x0002, pci_subsys_10b6_0002_10b6_0002, 0};
-#undef pci_ss_info_10b6_0002
-#define pci_ss_info_10b6_0002 pci_ss_info_10b6_0002_10b6_0002
-static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0006 =
- {0x10b6, 0x0006, pci_subsys_10b6_0002_10b6_0006, 0};
-#undef pci_ss_info_10b6_0006
-#define pci_ss_info_10b6_0006 pci_ss_info_10b6_0002_10b6_0006
-#endif
-static const pciSubsystemInfo pci_ss_info_10b6_0003_0e11_b0fd =
- {0x0e11, 0xb0fd, pci_subsys_10b6_0003_0e11_b0fd, 0};
-#undef pci_ss_info_0e11_b0fd
-#define pci_ss_info_0e11_b0fd pci_ss_info_10b6_0003_0e11_b0fd
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b6_0003_10b6_0003 =
- {0x10b6, 0x0003, pci_subsys_10b6_0003_10b6_0003, 0};
-#undef pci_ss_info_10b6_0003
-#define pci_ss_info_10b6_0003 pci_ss_info_10b6_0003_10b6_0003
-static const pciSubsystemInfo pci_ss_info_10b6_0003_10b6_0007 =
- {0x10b6, 0x0007, pci_subsys_10b6_0003_10b6_0007, 0};
-#undef pci_ss_info_10b6_0007
-#define pci_ss_info_10b6_0007 pci_ss_info_10b6_0003_10b6_0007
-static const pciSubsystemInfo pci_ss_info_10b6_0006_10b6_0006 =
- {0x10b6, 0x0006, pci_subsys_10b6_0006_10b6_0006, 0};
-#undef pci_ss_info_10b6_0006
-#define pci_ss_info_10b6_0006 pci_ss_info_10b6_0006_10b6_0006
-static const pciSubsystemInfo pci_ss_info_10b6_0007_10b6_0007 =
- {0x10b6, 0x0007, pci_subsys_10b6_0007_10b6_0007, 0};
-#undef pci_ss_info_10b6_0007
-#define pci_ss_info_10b6_0007 pci_ss_info_10b6_0007_10b6_0007
-static const pciSubsystemInfo pci_ss_info_10b6_0009_10b6_0009 =
- {0x10b6, 0x0009, pci_subsys_10b6_0009_10b6_0009, 0};
-#undef pci_ss_info_10b6_0009
-#define pci_ss_info_10b6_0009 pci_ss_info_10b6_0009_10b6_0009
-static const pciSubsystemInfo pci_ss_info_10b6_000a_10b6_000a =
- {0x10b6, 0x000a, pci_subsys_10b6_000a_10b6_000a, 0};
-#undef pci_ss_info_10b6_000a
-#define pci_ss_info_10b6_000a pci_ss_info_10b6_000a_10b6_000a
-static const pciSubsystemInfo pci_ss_info_10b6_000b_10b6_0008 =
- {0x10b6, 0x0008, pci_subsys_10b6_000b_10b6_0008, 0};
-#undef pci_ss_info_10b6_0008
-#define pci_ss_info_10b6_0008 pci_ss_info_10b6_000b_10b6_0008
-static const pciSubsystemInfo pci_ss_info_10b6_000b_10b6_000b =
- {0x10b6, 0x000b, pci_subsys_10b6_000b_10b6_000b, 0};
-#undef pci_ss_info_10b6_000b
-#define pci_ss_info_10b6_000b pci_ss_info_10b6_000b_10b6_000b
-static const pciSubsystemInfo pci_ss_info_10b6_000c_10b6_000c =
- {0x10b6, 0x000c, pci_subsys_10b6_000c_10b6_000c, 0};
-#undef pci_ss_info_10b6_000c
-#define pci_ss_info_10b6_000c pci_ss_info_10b6_000c_10b6_000c
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b7_1007_10b7_615c =
- {0x10b7, 0x615c, pci_subsys_10b7_1007_10b7_615c, 0};
-#undef pci_ss_info_10b7_615c
-#define pci_ss_info_10b7_615c pci_ss_info_10b7_1007_10b7_615c
-static const pciSubsystemInfo pci_ss_info_10b7_3590_10b7_3590 =
- {0x10b7, 0x3590, pci_subsys_10b7_3590_10b7_3590, 0};
-#undef pci_ss_info_10b7_3590
-#define pci_ss_info_10b7_3590 pci_ss_info_10b7_3590_10b7_3590
-static const pciSubsystemInfo pci_ss_info_10b7_5057_10b7_5a57 =
- {0x10b7, 0x5a57, pci_subsys_10b7_5057_10b7_5a57, 0};
-#undef pci_ss_info_10b7_5a57
-#define pci_ss_info_10b7_5a57 pci_ss_info_10b7_5057_10b7_5a57
-static const pciSubsystemInfo pci_ss_info_10b7_5157_10b7_5b57 =
- {0x10b7, 0x5b57, pci_subsys_10b7_5157_10b7_5b57, 0};
-#undef pci_ss_info_10b7_5b57
-#define pci_ss_info_10b7_5b57 pci_ss_info_10b7_5157_10b7_5b57
-static const pciSubsystemInfo pci_ss_info_10b7_5257_10b7_5c57 =
- {0x10b7, 0x5c57, pci_subsys_10b7_5257_10b7_5c57, 0};
-#undef pci_ss_info_10b7_5c57
-#define pci_ss_info_10b7_5c57 pci_ss_info_10b7_5257_10b7_5c57
-static const pciSubsystemInfo pci_ss_info_10b7_5b57_10b7_5b57 =
- {0x10b7, 0x5b57, pci_subsys_10b7_5b57_10b7_5b57, 0};
-#undef pci_ss_info_10b7_5b57
-#define pci_ss_info_10b7_5b57 pci_ss_info_10b7_5b57_10b7_5b57
-static const pciSubsystemInfo pci_ss_info_10b7_6056_10b7_6556 =
- {0x10b7, 0x6556, pci_subsys_10b7_6056_10b7_6556, 0};
-#undef pci_ss_info_10b7_6556
-#define pci_ss_info_10b7_6556 pci_ss_info_10b7_6056_10b7_6556
-static const pciSubsystemInfo pci_ss_info_10b7_6560_10b7_656a =
- {0x10b7, 0x656a, pci_subsys_10b7_6560_10b7_656a, 0};
-#undef pci_ss_info_10b7_656a
-#define pci_ss_info_10b7_656a pci_ss_info_10b7_6560_10b7_656a
-static const pciSubsystemInfo pci_ss_info_10b7_6561_10b7_656b =
- {0x10b7, 0x656b, pci_subsys_10b7_6561_10b7_656b, 0};
-#undef pci_ss_info_10b7_656b
-#define pci_ss_info_10b7_656b pci_ss_info_10b7_6561_10b7_656b
-static const pciSubsystemInfo pci_ss_info_10b7_6562_10b7_656b =
- {0x10b7, 0x656b, pci_subsys_10b7_6562_10b7_656b, 0};
-#undef pci_ss_info_10b7_656b
-#define pci_ss_info_10b7_656b pci_ss_info_10b7_6562_10b7_656b
-static const pciSubsystemInfo pci_ss_info_10b7_6563_10b7_656b =
- {0x10b7, 0x656b, pci_subsys_10b7_6563_10b7_656b, 0};
-#undef pci_ss_info_10b7_656b
-#define pci_ss_info_10b7_656b pci_ss_info_10b7_6563_10b7_656b
-static const pciSubsystemInfo pci_ss_info_10b7_9004_10b7_9004 =
- {0x10b7, 0x9004, pci_subsys_10b7_9004_10b7_9004, 0};
-#undef pci_ss_info_10b7_9004
-#define pci_ss_info_10b7_9004 pci_ss_info_10b7_9004_10b7_9004
-static const pciSubsystemInfo pci_ss_info_10b7_9005_10b7_9005 =
- {0x10b7, 0x9005, pci_subsys_10b7_9005_10b7_9005, 0};
-#undef pci_ss_info_10b7_9005
-#define pci_ss_info_10b7_9005 pci_ss_info_10b7_9005_10b7_9005
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0080 =
- {0x1028, 0x0080, pci_subsys_10b7_9055_1028_0080, 0};
-#undef pci_ss_info_1028_0080
-#define pci_ss_info_1028_0080 pci_ss_info_10b7_9055_1028_0080
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0081 =
- {0x1028, 0x0081, pci_subsys_10b7_9055_1028_0081, 0};
-#undef pci_ss_info_1028_0081
-#define pci_ss_info_1028_0081 pci_ss_info_10b7_9055_1028_0081
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0082 =
- {0x1028, 0x0082, pci_subsys_10b7_9055_1028_0082, 0};
-#undef pci_ss_info_1028_0082
-#define pci_ss_info_1028_0082 pci_ss_info_10b7_9055_1028_0082
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0083 =
- {0x1028, 0x0083, pci_subsys_10b7_9055_1028_0083, 0};
-#undef pci_ss_info_1028_0083
-#define pci_ss_info_1028_0083 pci_ss_info_10b7_9055_1028_0083
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0084 =
- {0x1028, 0x0084, pci_subsys_10b7_9055_1028_0084, 0};
-#undef pci_ss_info_1028_0084
-#define pci_ss_info_1028_0084 pci_ss_info_10b7_9055_1028_0084
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0085 =
- {0x1028, 0x0085, pci_subsys_10b7_9055_1028_0085, 0};
-#undef pci_ss_info_1028_0085
-#define pci_ss_info_1028_0085 pci_ss_info_10b7_9055_1028_0085
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0086 =
- {0x1028, 0x0086, pci_subsys_10b7_9055_1028_0086, 0};
-#undef pci_ss_info_1028_0086
-#define pci_ss_info_1028_0086 pci_ss_info_10b7_9055_1028_0086
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0087 =
- {0x1028, 0x0087, pci_subsys_10b7_9055_1028_0087, 0};
-#undef pci_ss_info_1028_0087
-#define pci_ss_info_1028_0087 pci_ss_info_10b7_9055_1028_0087
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0088 =
- {0x1028, 0x0088, pci_subsys_10b7_9055_1028_0088, 0};
-#undef pci_ss_info_1028_0088
-#define pci_ss_info_1028_0088 pci_ss_info_10b7_9055_1028_0088
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0089 =
- {0x1028, 0x0089, pci_subsys_10b7_9055_1028_0089, 0};
-#undef pci_ss_info_1028_0089
-#define pci_ss_info_1028_0089 pci_ss_info_10b7_9055_1028_0089
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0090 =
- {0x1028, 0x0090, pci_subsys_10b7_9055_1028_0090, 0};
-#undef pci_ss_info_1028_0090
-#define pci_ss_info_1028_0090 pci_ss_info_10b7_9055_1028_0090
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0091 =
- {0x1028, 0x0091, pci_subsys_10b7_9055_1028_0091, 0};
-#undef pci_ss_info_1028_0091
-#define pci_ss_info_1028_0091 pci_ss_info_10b7_9055_1028_0091
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0092 =
- {0x1028, 0x0092, pci_subsys_10b7_9055_1028_0092, 0};
-#undef pci_ss_info_1028_0092
-#define pci_ss_info_1028_0092 pci_ss_info_10b7_9055_1028_0092
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0093 =
- {0x1028, 0x0093, pci_subsys_10b7_9055_1028_0093, 0};
-#undef pci_ss_info_1028_0093
-#define pci_ss_info_1028_0093 pci_ss_info_10b7_9055_1028_0093
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0094 =
- {0x1028, 0x0094, pci_subsys_10b7_9055_1028_0094, 0};
-#undef pci_ss_info_1028_0094
-#define pci_ss_info_1028_0094 pci_ss_info_10b7_9055_1028_0094
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0095 =
- {0x1028, 0x0095, pci_subsys_10b7_9055_1028_0095, 0};
-#undef pci_ss_info_1028_0095
-#define pci_ss_info_1028_0095 pci_ss_info_10b7_9055_1028_0095
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0096 =
- {0x1028, 0x0096, pci_subsys_10b7_9055_1028_0096, 0};
-#undef pci_ss_info_1028_0096
-#define pci_ss_info_1028_0096 pci_ss_info_10b7_9055_1028_0096
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0097 =
- {0x1028, 0x0097, pci_subsys_10b7_9055_1028_0097, 0};
-#undef pci_ss_info_1028_0097
-#define pci_ss_info_1028_0097 pci_ss_info_10b7_9055_1028_0097
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0098 =
- {0x1028, 0x0098, pci_subsys_10b7_9055_1028_0098, 0};
-#undef pci_ss_info_1028_0098
-#define pci_ss_info_1028_0098 pci_ss_info_10b7_9055_1028_0098
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0099 =
- {0x1028, 0x0099, pci_subsys_10b7_9055_1028_0099, 0};
-#undef pci_ss_info_1028_0099
-#define pci_ss_info_1028_0099 pci_ss_info_10b7_9055_1028_0099
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b7_9055_10b7_9055 =
- {0x10b7, 0x9055, pci_subsys_10b7_9055_10b7_9055, 0};
-#undef pci_ss_info_10b7_9055
-#define pci_ss_info_10b7_9055 pci_ss_info_10b7_9055_10b7_9055
-#endif
-static const pciSubsystemInfo pci_ss_info_10b7_9200_1028_0095 =
- {0x1028, 0x0095, pci_subsys_10b7_9200_1028_0095, 0};
-#undef pci_ss_info_1028_0095
-#define pci_ss_info_1028_0095 pci_ss_info_10b7_9200_1028_0095
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b7_9200_10b7_1000 =
- {0x10b7, 0x1000, pci_subsys_10b7_9200_10b7_1000, 0};
-#undef pci_ss_info_10b7_1000
-#define pci_ss_info_10b7_1000 pci_ss_info_10b7_9200_10b7_1000
-static const pciSubsystemInfo pci_ss_info_10b7_9200_10b7_7000 =
- {0x10b7, 0x7000, pci_subsys_10b7_9200_10b7_7000, 0};
-#undef pci_ss_info_10b7_7000
-#define pci_ss_info_10b7_7000 pci_ss_info_10b7_9200_10b7_7000
-static const pciSubsystemInfo pci_ss_info_10b7_9800_10b7_9800 =
- {0x10b7, 0x9800, pci_subsys_10b7_9800_10b7_9800, 0};
-#undef pci_ss_info_10b7_9800
-#define pci_ss_info_10b7_9800 pci_ss_info_10b7_9800_10b7_9800
-static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_1201 =
- {0x10b7, 0x1201, pci_subsys_10b7_9805_10b7_1201, 0};
-#undef pci_ss_info_10b7_1201
-#define pci_ss_info_10b7_1201 pci_ss_info_10b7_9805_10b7_1201
-static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_1202 =
- {0x10b7, 0x1202, pci_subsys_10b7_9805_10b7_1202, 0};
-#undef pci_ss_info_10b7_1202
-#define pci_ss_info_10b7_1202 pci_ss_info_10b7_9805_10b7_1202
-static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_9805 =
- {0x10b7, 0x9805, pci_subsys_10b7_9805_10b7_9805, 0};
-#undef pci_ss_info_10b7_9805
-#define pci_ss_info_10b7_9805 pci_ss_info_10b7_9805_10b7_9805
-static const pciSubsystemInfo pci_ss_info_10b7_9805_10f1_2462 =
- {0x10f1, 0x2462, pci_subsys_10b7_9805_10f1_2462, 0};
-#undef pci_ss_info_10f1_2462
-#define pci_ss_info_10f1_2462 pci_ss_info_10b7_9805_10f1_2462
-static const pciSubsystemInfo pci_ss_info_10b7_9904_10b7_1000 =
- {0x10b7, 0x1000, pci_subsys_10b7_9904_10b7_1000, 0};
-#undef pci_ss_info_10b7_1000
-#define pci_ss_info_10b7_1000 pci_ss_info_10b7_9904_10b7_1000
-static const pciSubsystemInfo pci_ss_info_10b7_9904_10b7_2000 =
- {0x10b7, 0x2000, pci_subsys_10b7_9904_10b7_2000, 0};
-#undef pci_ss_info_10b7_2000
-#define pci_ss_info_10b7_2000 pci_ss_info_10b7_9904_10b7_2000
-static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_1101 =
- {0x10b7, 0x1101, pci_subsys_10b7_9905_10b7_1101, 0};
-#undef pci_ss_info_10b7_1101
-#define pci_ss_info_10b7_1101 pci_ss_info_10b7_9905_10b7_1101
-static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_1102 =
- {0x10b7, 0x1102, pci_subsys_10b7_9905_10b7_1102, 0};
-#undef pci_ss_info_10b7_1102
-#define pci_ss_info_10b7_1102 pci_ss_info_10b7_9905_10b7_1102
-static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_2101 =
- {0x10b7, 0x2101, pci_subsys_10b7_9905_10b7_2101, 0};
-#undef pci_ss_info_10b7_2101
-#define pci_ss_info_10b7_2101 pci_ss_info_10b7_9905_10b7_2101
-static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_2102 =
- {0x10b7, 0x2102, pci_subsys_10b7_9905_10b7_2102, 0};
-#undef pci_ss_info_10b7_2102
-#define pci_ss_info_10b7_2102 pci_ss_info_10b7_9905_10b7_2102
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b8_0005_1055_e000 =
- {0x1055, 0xe000, pci_subsys_10b8_0005_1055_e000, 0};
-#undef pci_ss_info_1055_e000
-#define pci_ss_info_1055_e000 pci_ss_info_10b8_0005_1055_e000
-static const pciSubsystemInfo pci_ss_info_10b8_0005_1055_e002 =
- {0x1055, 0xe002, pci_subsys_10b8_0005_1055_e002, 0};
-#undef pci_ss_info_1055_e002
-#define pci_ss_info_1055_e002 pci_ss_info_10b8_0005_1055_e002
-static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a011 =
- {0x10b8, 0xa011, pci_subsys_10b8_0005_10b8_a011, 0};
-#undef pci_ss_info_10b8_a011
-#define pci_ss_info_10b8_a011 pci_ss_info_10b8_0005_10b8_a011
-static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a014 =
- {0x10b8, 0xa014, pci_subsys_10b8_0005_10b8_a014, 0};
-#undef pci_ss_info_10b8_a014
-#define pci_ss_info_10b8_a014 pci_ss_info_10b8_0005_10b8_a014
-static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a015 =
- {0x10b8, 0xa015, pci_subsys_10b8_0005_10b8_a015, 0};
-#undef pci_ss_info_10b8_a015
-#define pci_ss_info_10b8_a015 pci_ss_info_10b8_0005_10b8_a015
-static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a016 =
- {0x10b8, 0xa016, pci_subsys_10b8_0005_10b8_a016, 0};
-#undef pci_ss_info_10b8_a016
-#define pci_ss_info_10b8_a016 pci_ss_info_10b8_0005_10b8_a016
-static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a017 =
- {0x10b8, 0xa017, pci_subsys_10b8_0005_10b8_a017, 0};
-#undef pci_ss_info_10b8_a017
-#define pci_ss_info_10b8_a017 pci_ss_info_10b8_0005_10b8_a017
-static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e100 =
- {0x1055, 0xe100, pci_subsys_10b8_0006_1055_e100, 0};
-#undef pci_ss_info_1055_e100
-#define pci_ss_info_1055_e100 pci_ss_info_10b8_0006_1055_e100
-static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e102 =
- {0x1055, 0xe102, pci_subsys_10b8_0006_1055_e102, 0};
-#undef pci_ss_info_1055_e102
-#define pci_ss_info_1055_e102 pci_ss_info_10b8_0006_1055_e102
-static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e300 =
- {0x1055, 0xe300, pci_subsys_10b8_0006_1055_e300, 0};
-#undef pci_ss_info_1055_e300
-#define pci_ss_info_1055_e300 pci_ss_info_10b8_0006_1055_e300
-static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e302 =
- {0x1055, 0xe302, pci_subsys_10b8_0006_1055_e302, 0};
-#undef pci_ss_info_1055_e302
-#define pci_ss_info_1055_e302 pci_ss_info_10b8_0006_1055_e302
-static const pciSubsystemInfo pci_ss_info_10b8_0006_10b8_a012 =
- {0x10b8, 0xa012, pci_subsys_10b8_0006_10b8_a012, 0};
-#undef pci_ss_info_10b8_a012
-#define pci_ss_info_10b8_a012 pci_ss_info_10b8_0006_10b8_a012
-static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8002 =
- {0x13a2, 0x8002, pci_subsys_10b8_0006_13a2_8002, 0};
-#undef pci_ss_info_13a2_8002
-#define pci_ss_info_13a2_8002 pci_ss_info_10b8_0006_13a2_8002
-static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8006 =
- {0x13a2, 0x8006, pci_subsys_10b8_0006_13a2_8006, 0};
-#undef pci_ss_info_13a2_8006
-#define pci_ss_info_13a2_8006 pci_ss_info_10b8_0006_13a2_8006
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10b9_0111_10b9_0111 =
- {0x10b9, 0x0111, pci_subsys_10b9_0111_10b9_0111, 0};
-#undef pci_ss_info_10b9_0111
-#define pci_ss_info_10b9_0111 pci_ss_info_10b9_0111_10b9_0111
-static const pciSubsystemInfo pci_ss_info_10b9_1521_10b9_1521 =
- {0x10b9, 0x1521, pci_subsys_10b9_1521_10b9_1521, 0};
-#undef pci_ss_info_10b9_1521
-#define pci_ss_info_10b9_1521 pci_ss_info_10b9_1521_10b9_1521
-static const pciSubsystemInfo pci_ss_info_10b9_1523_10b9_1523 =
- {0x10b9, 0x1523, pci_subsys_10b9_1523_10b9_1523, 0};
-#undef pci_ss_info_10b9_1523
-#define pci_ss_info_10b9_1523 pci_ss_info_10b9_1523_10b9_1523
-static const pciSubsystemInfo pci_ss_info_10b9_1533_10b9_1533 =
- {0x10b9, 0x1533, pci_subsys_10b9_1533_10b9_1533, 0};
-#undef pci_ss_info_10b9_1533
-#define pci_ss_info_10b9_1533 pci_ss_info_10b9_1533_10b9_1533
-static const pciSubsystemInfo pci_ss_info_10b9_1541_10b9_1541 =
- {0x10b9, 0x1541, pci_subsys_10b9_1541_10b9_1541, 0};
-#undef pci_ss_info_10b9_1541
-#define pci_ss_info_10b9_1541 pci_ss_info_10b9_1541_10b9_1541
-static const pciSubsystemInfo pci_ss_info_10b9_5229_1043_8053 =
- {0x1043, 0x8053, pci_subsys_10b9_5229_1043_8053, 0};
-#undef pci_ss_info_1043_8053
-#define pci_ss_info_1043_8053 pci_ss_info_10b9_5229_1043_8053
-static const pciSubsystemInfo pci_ss_info_10b9_5451_1014_0506 =
- {0x1014, 0x0506, pci_subsys_10b9_5451_1014_0506, 0};
-#undef pci_ss_info_1014_0506
-#define pci_ss_info_1014_0506 pci_ss_info_10b9_5451_1014_0506
-static const pciSubsystemInfo pci_ss_info_10b9_7101_10b9_7101 =
- {0x10b9, 0x7101, pci_subsys_10b9_7101_10b9_7101, 0};
-#undef pci_ss_info_10b9_7101
-#define pci_ss_info_10b9_7101 pci_ss_info_10b9_7101_10b9_7101
-#endif
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1014_00ba =
- {0x1014, 0x00ba, pci_subsys_10c8_0004_1014_00ba, 0};
-#undef pci_ss_info_1014_00ba
-#define pci_ss_info_1014_00ba pci_ss_info_10c8_0004_1014_00ba
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1025_1007 =
- {0x1025, 0x1007, pci_subsys_10c8_0004_1025_1007, 0};
-#undef pci_ss_info_1025_1007
-#define pci_ss_info_1025_1007 pci_ss_info_10c8_0004_1025_1007
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_0074 =
- {0x1028, 0x0074, pci_subsys_10c8_0004_1028_0074, 0};
-#undef pci_ss_info_1028_0074
-#define pci_ss_info_1028_0074 pci_ss_info_10c8_0004_1028_0074
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_0075 =
- {0x1028, 0x0075, pci_subsys_10c8_0004_1028_0075, 0};
-#undef pci_ss_info_1028_0075
-#define pci_ss_info_1028_0075 pci_ss_info_10c8_0004_1028_0075
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_007d =
- {0x1028, 0x007d, pci_subsys_10c8_0004_1028_007d, 0};
-#undef pci_ss_info_1028_007d
-#define pci_ss_info_1028_007d pci_ss_info_10c8_0004_1028_007d
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_007e =
- {0x1028, 0x007e, pci_subsys_10c8_0004_1028_007e, 0};
-#undef pci_ss_info_1028_007e
-#define pci_ss_info_1028_007e pci_ss_info_10c8_0004_1028_007e
-static const pciSubsystemInfo pci_ss_info_10c8_0004_1033_802f =
- {0x1033, 0x802f, pci_subsys_10c8_0004_1033_802f, 0};
-#undef pci_ss_info_1033_802f
-#define pci_ss_info_1033_802f pci_ss_info_10c8_0004_1033_802f
-static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_801b =
- {0x104d, 0x801b, pci_subsys_10c8_0004_104d_801b, 0};
-#undef pci_ss_info_104d_801b
-#define pci_ss_info_104d_801b pci_ss_info_10c8_0004_104d_801b
-static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_802f =
- {0x104d, 0x802f, pci_subsys_10c8_0004_104d_802f, 0};
-#undef pci_ss_info_104d_802f
-#define pci_ss_info_104d_802f pci_ss_info_10c8_0004_104d_802f
-static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_830b =
- {0x104d, 0x830b, pci_subsys_10c8_0004_104d_830b, 0};
-#undef pci_ss_info_104d_830b
-#define pci_ss_info_104d_830b pci_ss_info_10c8_0004_104d_830b
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10ba_0e00 =
- {0x10ba, 0x0e00, pci_subsys_10c8_0004_10ba_0e00, 0};
-#undef pci_ss_info_10ba_0e00
-#define pci_ss_info_10ba_0e00 pci_ss_info_10c8_0004_10ba_0e00
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10c8_0004 =
- {0x10c8, 0x0004, pci_subsys_10c8_0004_10c8_0004, 0};
-#undef pci_ss_info_10c8_0004
-#define pci_ss_info_10c8_0004 pci_ss_info_10c8_0004_10c8_0004
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10cf_1029 =
- {0x10cf, 0x1029, pci_subsys_10c8_0004_10cf_1029, 0};
-#undef pci_ss_info_10cf_1029
-#define pci_ss_info_10cf_1029 pci_ss_info_10c8_0004_10cf_1029
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8308 =
- {0x10f7, 0x8308, pci_subsys_10c8_0004_10f7_8308, 0};
-#undef pci_ss_info_10f7_8308
-#define pci_ss_info_10f7_8308 pci_ss_info_10c8_0004_10f7_8308
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8309 =
- {0x10f7, 0x8309, pci_subsys_10c8_0004_10f7_8309, 0};
-#undef pci_ss_info_10f7_8309
-#define pci_ss_info_10f7_8309 pci_ss_info_10c8_0004_10f7_8309
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_830b =
- {0x10f7, 0x830b, pci_subsys_10c8_0004_10f7_830b, 0};
-#undef pci_ss_info_10f7_830b
-#define pci_ss_info_10f7_830b pci_ss_info_10c8_0004_10f7_830b
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_830d =
- {0x10f7, 0x830d, pci_subsys_10c8_0004_10f7_830d, 0};
-#undef pci_ss_info_10f7_830d
-#define pci_ss_info_10f7_830d pci_ss_info_10c8_0004_10f7_830d
-static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8312 =
- {0x10f7, 0x8312, pci_subsys_10c8_0004_10f7_8312, 0};
-#undef pci_ss_info_10f7_8312
-#define pci_ss_info_10f7_8312 pci_ss_info_10c8_0004_10f7_8312
-static const pciSubsystemInfo pci_ss_info_10c8_0005_1014_00dd =
- {0x1014, 0x00dd, pci_subsys_10c8_0005_1014_00dd, 0};
-#undef pci_ss_info_1014_00dd
-#define pci_ss_info_1014_00dd pci_ss_info_10c8_0005_1014_00dd
-static const pciSubsystemInfo pci_ss_info_10c8_0016_10c8_0016 =
- {0x10c8, 0x0016, pci_subsys_10c8_0016_10c8_0016, 0};
-#undef pci_ss_info_10c8_0016
-#define pci_ss_info_10c8_0016 pci_ss_info_10c8_0016_10c8_0016
-static const pciSubsystemInfo pci_ss_info_10c8_8005_0e11_b0d1 =
- {0x0e11, 0xb0d1, pci_subsys_10c8_8005_0e11_b0d1, 0};
-#undef pci_ss_info_0e11_b0d1
-#define pci_ss_info_0e11_b0d1 pci_ss_info_10c8_8005_0e11_b0d1
-static const pciSubsystemInfo pci_ss_info_10c8_8005_0e11_b126 =
- {0x0e11, 0xb126, pci_subsys_10c8_8005_0e11_b126, 0};
-#undef pci_ss_info_0e11_b126
-#define pci_ss_info_0e11_b126 pci_ss_info_10c8_8005_0e11_b126
-static const pciSubsystemInfo pci_ss_info_10c8_8005_1014_00dd =
- {0x1014, 0x00dd, pci_subsys_10c8_8005_1014_00dd, 0};
-#undef pci_ss_info_1014_00dd
-#define pci_ss_info_1014_00dd pci_ss_info_10c8_8005_1014_00dd
-static const pciSubsystemInfo pci_ss_info_10c8_8005_1025_1003 =
- {0x1025, 0x1003, pci_subsys_10c8_8005_1025_1003, 0};
-#undef pci_ss_info_1025_1003
-#define pci_ss_info_1025_1003 pci_ss_info_10c8_8005_1025_1003
-static const pciSubsystemInfo pci_ss_info_10c8_8005_1028_008f =
- {0x1028, 0x008f, pci_subsys_10c8_8005_1028_008f, 0};
-#undef pci_ss_info_1028_008f
-#define pci_ss_info_1028_008f pci_ss_info_10c8_8005_1028_008f
-static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_0007 =
- {0x103c, 0x0007, pci_subsys_10c8_8005_103c_0007, 0};
-#undef pci_ss_info_103c_0007
-#define pci_ss_info_103c_0007 pci_ss_info_10c8_8005_103c_0007
-static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_0008 =
- {0x103c, 0x0008, pci_subsys_10c8_8005_103c_0008, 0};
-#undef pci_ss_info_103c_0008
-#define pci_ss_info_103c_0008 pci_ss_info_10c8_8005_103c_0008
-static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_000d =
- {0x103c, 0x000d, pci_subsys_10c8_8005_103c_000d, 0};
-#undef pci_ss_info_103c_000d
-#define pci_ss_info_103c_000d pci_ss_info_10c8_8005_103c_000d
-static const pciSubsystemInfo pci_ss_info_10c8_8005_10c8_8005 =
- {0x10c8, 0x8005, pci_subsys_10c8_8005_10c8_8005, 0};
-#undef pci_ss_info_10c8_8005
-#define pci_ss_info_10c8_8005 pci_ss_info_10c8_8005_10c8_8005
-static const pciSubsystemInfo pci_ss_info_10c8_8005_110a_8005 =
- {0x110a, 0x8005, pci_subsys_10c8_8005_110a_8005, 0};
-#undef pci_ss_info_110a_8005
-#define pci_ss_info_110a_8005 pci_ss_info_10c8_8005_110a_8005
-static const pciSubsystemInfo pci_ss_info_10c8_8005_14c0_0004 =
- {0x14c0, 0x0004, pci_subsys_10c8_8005_14c0_0004, 0};
-#undef pci_ss_info_14c0_0004
-#define pci_ss_info_14c0_0004 pci_ss_info_10c8_8005_14c0_0004
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10cd_1300_10cd_1310 =
- {0x10cd, 0x1310, pci_subsys_10cd_1300_10cd_1310, 0};
-#undef pci_ss_info_10cd_1310
-#define pci_ss_info_10cd_1310 pci_ss_info_10cd_1300_10cd_1310
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10d9_0531_1186_1200 =
- {0x1186, 0x1200, pci_subsys_10d9_0531_1186_1200, 0};
-#undef pci_ss_info_1186_1200
-#define pci_ss_info_1186_1200 pci_ss_info_10d9_0531_1186_1200
-#endif
-static const pciSubsystemInfo pci_ss_info_10de_0020_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_0020_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_0020_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_0020_1048_0c18 =
- {0x1048, 0x0c18, pci_subsys_10de_0020_1048_0c18, 0};
-#undef pci_ss_info_1048_0c18
-#define pci_ss_info_1048_0c18 pci_ss_info_10de_0020_1048_0c18
-static const pciSubsystemInfo pci_ss_info_10de_0020_1048_0c1b =
- {0x1048, 0x0c1b, pci_subsys_10de_0020_1048_0c1b, 0};
-#undef pci_ss_info_1048_0c1b
-#define pci_ss_info_1048_0c1b pci_ss_info_10de_0020_1048_0c1b
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_0550 =
- {0x1092, 0x0550, pci_subsys_10de_0020_1092_0550, 0};
-#undef pci_ss_info_1092_0550
-#define pci_ss_info_1092_0550 pci_ss_info_10de_0020_1092_0550
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_0552 =
- {0x1092, 0x0552, pci_subsys_10de_0020_1092_0552, 0};
-#undef pci_ss_info_1092_0552
-#define pci_ss_info_1092_0552 pci_ss_info_10de_0020_1092_0552
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4804 =
- {0x1092, 0x4804, pci_subsys_10de_0020_1092_4804, 0};
-#undef pci_ss_info_1092_4804
-#define pci_ss_info_1092_4804 pci_ss_info_10de_0020_1092_4804
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4808 =
- {0x1092, 0x4808, pci_subsys_10de_0020_1092_4808, 0};
-#undef pci_ss_info_1092_4808
-#define pci_ss_info_1092_4808 pci_ss_info_10de_0020_1092_4808
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4810 =
- {0x1092, 0x4810, pci_subsys_10de_0020_1092_4810, 0};
-#undef pci_ss_info_1092_4810
-#define pci_ss_info_1092_4810 pci_ss_info_10de_0020_1092_4810
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4812 =
- {0x1092, 0x4812, pci_subsys_10de_0020_1092_4812, 0};
-#undef pci_ss_info_1092_4812
-#define pci_ss_info_1092_4812 pci_ss_info_10de_0020_1092_4812
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4815 =
- {0x1092, 0x4815, pci_subsys_10de_0020_1092_4815, 0};
-#undef pci_ss_info_1092_4815
-#define pci_ss_info_1092_4815 pci_ss_info_10de_0020_1092_4815
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4820 =
- {0x1092, 0x4820, pci_subsys_10de_0020_1092_4820, 0};
-#undef pci_ss_info_1092_4820
-#define pci_ss_info_1092_4820 pci_ss_info_10de_0020_1092_4820
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4822 =
- {0x1092, 0x4822, pci_subsys_10de_0020_1092_4822, 0};
-#undef pci_ss_info_1092_4822
-#define pci_ss_info_1092_4822 pci_ss_info_10de_0020_1092_4822
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4904 =
- {0x1092, 0x4904, pci_subsys_10de_0020_1092_4904, 0};
-#undef pci_ss_info_1092_4904
-#define pci_ss_info_1092_4904 pci_ss_info_10de_0020_1092_4904
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4914 =
- {0x1092, 0x4914, pci_subsys_10de_0020_1092_4914, 0};
-#undef pci_ss_info_1092_4914
-#define pci_ss_info_1092_4914 pci_ss_info_10de_0020_1092_4914
-static const pciSubsystemInfo pci_ss_info_10de_0020_1092_8225 =
- {0x1092, 0x8225, pci_subsys_10de_0020_1092_8225, 0};
-#undef pci_ss_info_1092_8225
-#define pci_ss_info_1092_8225 pci_ss_info_10de_0020_1092_8225
-static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_273d =
- {0x10b4, 0x273d, pci_subsys_10de_0020_10b4_273d, 0};
-#undef pci_ss_info_10b4_273d
-#define pci_ss_info_10b4_273d pci_ss_info_10de_0020_10b4_273d
-static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_273e =
- {0x10b4, 0x273e, pci_subsys_10de_0020_10b4_273e, 0};
-#undef pci_ss_info_10b4_273e
-#define pci_ss_info_10b4_273e pci_ss_info_10de_0020_10b4_273e
-static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_2740 =
- {0x10b4, 0x2740, pci_subsys_10de_0020_10b4_2740, 0};
-#undef pci_ss_info_10b4_2740
-#define pci_ss_info_10b4_2740 pci_ss_info_10de_0020_10b4_2740
-static const pciSubsystemInfo pci_ss_info_10de_0020_10de_0020 =
- {0x10de, 0x0020, pci_subsys_10de_0020_10de_0020, 0};
-#undef pci_ss_info_10de_0020
-#define pci_ss_info_10de_0020 pci_ss_info_10de_0020_10de_0020
-static const pciSubsystemInfo pci_ss_info_10de_0020_1102_1015 =
- {0x1102, 0x1015, pci_subsys_10de_0020_1102_1015, 0};
-#undef pci_ss_info_1102_1015
-#define pci_ss_info_1102_1015 pci_ss_info_10de_0020_1102_1015
-static const pciSubsystemInfo pci_ss_info_10de_0020_1102_1016 =
- {0x1102, 0x1016, pci_subsys_10de_0020_1102_1016, 0};
-#undef pci_ss_info_1102_1016
-#define pci_ss_info_1102_1016 pci_ss_info_10de_0020_1102_1016
-static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_0028_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_0028_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0201 =
- {0x1043, 0x0201, pci_subsys_10de_0028_1043_0201, 0};
-#undef pci_ss_info_1043_0201
-#define pci_ss_info_1043_0201 pci_ss_info_10de_0028_1043_0201
-static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0205 =
- {0x1043, 0x0205, pci_subsys_10de_0028_1043_0205, 0};
-#undef pci_ss_info_1043_0205
-#define pci_ss_info_1043_0205 pci_ss_info_10de_0028_1043_0205
-static const pciSubsystemInfo pci_ss_info_10de_0028_1043_4000 =
- {0x1043, 0x4000, pci_subsys_10de_0028_1043_4000, 0};
-#undef pci_ss_info_1043_4000
-#define pci_ss_info_1043_4000 pci_ss_info_10de_0028_1043_4000
-static const pciSubsystemInfo pci_ss_info_10de_0028_1048_0c21 =
- {0x1048, 0x0c21, pci_subsys_10de_0028_1048_0c21, 0};
-#undef pci_ss_info_1048_0c21
-#define pci_ss_info_1048_0c21 pci_ss_info_10de_0028_1048_0c21
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4804 =
- {0x1092, 0x4804, pci_subsys_10de_0028_1092_4804, 0};
-#undef pci_ss_info_1092_4804
-#define pci_ss_info_1092_4804 pci_ss_info_10de_0028_1092_4804
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4a00 =
- {0x1092, 0x4a00, pci_subsys_10de_0028_1092_4a00, 0};
-#undef pci_ss_info_1092_4a00
-#define pci_ss_info_1092_4a00 pci_ss_info_10de_0028_1092_4a00
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4a02 =
- {0x1092, 0x4a02, pci_subsys_10de_0028_1092_4a02, 0};
-#undef pci_ss_info_1092_4a02
-#define pci_ss_info_1092_4a02 pci_ss_info_10de_0028_1092_4a02
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_5a00 =
- {0x1092, 0x5a00, pci_subsys_10de_0028_1092_5a00, 0};
-#undef pci_ss_info_1092_5a00
-#define pci_ss_info_1092_5a00 pci_ss_info_10de_0028_1092_5a00
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_6a02 =
- {0x1092, 0x6a02, pci_subsys_10de_0028_1092_6a02, 0};
-#undef pci_ss_info_1092_6a02
-#define pci_ss_info_1092_6a02 pci_ss_info_10de_0028_1092_6a02
-static const pciSubsystemInfo pci_ss_info_10de_0028_1092_7a02 =
- {0x1092, 0x7a02, pci_subsys_10de_0028_1092_7a02, 0};
-#undef pci_ss_info_1092_7a02
-#define pci_ss_info_1092_7a02 pci_ss_info_10de_0028_1092_7a02
-static const pciSubsystemInfo pci_ss_info_10de_0028_10de_0005 =
- {0x10de, 0x0005, pci_subsys_10de_0028_10de_0005, 0};
-#undef pci_ss_info_10de_0005
-#define pci_ss_info_10de_0005 pci_ss_info_10de_0028_10de_0005
-static const pciSubsystemInfo pci_ss_info_10de_0028_10de_000f =
- {0x10de, 0x000f, pci_subsys_10de_0028_10de_000f, 0};
-#undef pci_ss_info_10de_000f
-#define pci_ss_info_10de_000f pci_ss_info_10de_0028_10de_000f
-static const pciSubsystemInfo pci_ss_info_10de_0028_1102_1020 =
- {0x1102, 0x1020, pci_subsys_10de_0028_1102_1020, 0};
-#undef pci_ss_info_1102_1020
-#define pci_ss_info_1102_1020 pci_ss_info_10de_0028_1102_1020
-static const pciSubsystemInfo pci_ss_info_10de_0028_1102_1026 =
- {0x1102, 0x1026, pci_subsys_10de_0028_1102_1026, 0};
-#undef pci_ss_info_1102_1026
-#define pci_ss_info_1102_1026 pci_ss_info_10de_0028_1102_1026
-static const pciSubsystemInfo pci_ss_info_10de_0028_14af_5810 =
- {0x14af, 0x5810, pci_subsys_10de_0028_14af_5810, 0};
-#undef pci_ss_info_14af_5810
-#define pci_ss_info_14af_5810 pci_ss_info_10de_0028_14af_5810
-static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_0029_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_0029_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0201 =
- {0x1043, 0x0201, pci_subsys_10de_0029_1043_0201, 0};
-#undef pci_ss_info_1043_0201
-#define pci_ss_info_1043_0201 pci_ss_info_10de_0029_1043_0201
-static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0205 =
- {0x1043, 0x0205, pci_subsys_10de_0029_1043_0205, 0};
-#undef pci_ss_info_1043_0205
-#define pci_ss_info_1043_0205 pci_ss_info_10de_0029_1043_0205
-static const pciSubsystemInfo pci_ss_info_10de_0029_1102_1021 =
- {0x1102, 0x1021, pci_subsys_10de_0029_1102_1021, 0};
-#undef pci_ss_info_1102_1021
-#define pci_ss_info_1102_1021 pci_ss_info_10de_0029_1102_1021
-static const pciSubsystemInfo pci_ss_info_10de_0029_1102_1029 =
- {0x1102, 0x1029, pci_subsys_10de_0029_1102_1029, 0};
-#undef pci_ss_info_1102_1029
-#define pci_ss_info_1102_1029 pci_ss_info_10de_0029_1102_1029
-static const pciSubsystemInfo pci_ss_info_10de_0029_1102_102f =
- {0x1102, 0x102f, pci_subsys_10de_0029_1102_102f, 0};
-#undef pci_ss_info_1102_102f
-#define pci_ss_info_1102_102f pci_ss_info_10de_0029_1102_102f
-static const pciSubsystemInfo pci_ss_info_10de_0029_14af_5820 =
- {0x14af, 0x5820, pci_subsys_10de_0029_14af_5820, 0};
-#undef pci_ss_info_14af_5820
-#define pci_ss_info_14af_5820 pci_ss_info_10de_0029_14af_5820
-static const pciSubsystemInfo pci_ss_info_10de_002c_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_002c_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_002c_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_002c_1043_0201 =
- {0x1043, 0x0201, pci_subsys_10de_002c_1043_0201, 0};
-#undef pci_ss_info_1043_0201
-#define pci_ss_info_1043_0201 pci_ss_info_10de_002c_1043_0201
-static const pciSubsystemInfo pci_ss_info_10de_002c_1092_6820 =
- {0x1092, 0x6820, pci_subsys_10de_002c_1092_6820, 0};
-#undef pci_ss_info_1092_6820
-#define pci_ss_info_1092_6820 pci_ss_info_10de_002c_1092_6820
-static const pciSubsystemInfo pci_ss_info_10de_002c_1102_1031 =
- {0x1102, 0x1031, pci_subsys_10de_002c_1102_1031, 0};
-#undef pci_ss_info_1102_1031
-#define pci_ss_info_1102_1031 pci_ss_info_10de_002c_1102_1031
-static const pciSubsystemInfo pci_ss_info_10de_002c_1102_1034 =
- {0x1102, 0x1034, pci_subsys_10de_002c_1102_1034, 0};
-#undef pci_ss_info_1102_1034
-#define pci_ss_info_1102_1034 pci_ss_info_10de_002c_1102_1034
-static const pciSubsystemInfo pci_ss_info_10de_002c_14af_5008 =
- {0x14af, 0x5008, pci_subsys_10de_002c_14af_5008, 0};
-#undef pci_ss_info_14af_5008
-#define pci_ss_info_14af_5008 pci_ss_info_10de_002c_14af_5008
-static const pciSubsystemInfo pci_ss_info_10de_002d_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_002d_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_002d_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_002d_1043_0201 =
- {0x1043, 0x0201, pci_subsys_10de_002d_1043_0201, 0};
-#undef pci_ss_info_1043_0201
-#define pci_ss_info_1043_0201 pci_ss_info_10de_002d_1043_0201
-static const pciSubsystemInfo pci_ss_info_10de_002d_1048_0c3a =
- {0x1048, 0x0c3a, pci_subsys_10de_002d_1048_0c3a, 0};
-#undef pci_ss_info_1048_0c3a
-#define pci_ss_info_1048_0c3a pci_ss_info_10de_002d_1048_0c3a
-static const pciSubsystemInfo pci_ss_info_10de_002d_10de_001e =
- {0x10de, 0x001e, pci_subsys_10de_002d_10de_001e, 0};
-#undef pci_ss_info_10de_001e
-#define pci_ss_info_10de_001e pci_ss_info_10de_002d_10de_001e
-static const pciSubsystemInfo pci_ss_info_10de_002d_1102_1023 =
- {0x1102, 0x1023, pci_subsys_10de_002d_1102_1023, 0};
-#undef pci_ss_info_1102_1023
-#define pci_ss_info_1102_1023 pci_ss_info_10de_002d_1102_1023
-static const pciSubsystemInfo pci_ss_info_10de_002d_1102_1024 =
- {0x1102, 0x1024, pci_subsys_10de_002d_1102_1024, 0};
-#undef pci_ss_info_1102_1024
-#define pci_ss_info_1102_1024 pci_ss_info_10de_002d_1102_1024
-static const pciSubsystemInfo pci_ss_info_10de_002d_1102_102c =
- {0x1102, 0x102c, pci_subsys_10de_002d_1102_102c, 0};
-#undef pci_ss_info_1102_102c
-#define pci_ss_info_1102_102c pci_ss_info_10de_002d_1102_102c
-static const pciSubsystemInfo pci_ss_info_10de_002d_1462_8808 =
- {0x1462, 0x8808, pci_subsys_10de_002d_1462_8808, 0};
-#undef pci_ss_info_1462_8808
-#define pci_ss_info_1462_8808 pci_ss_info_10de_002d_1462_8808
-static const pciSubsystemInfo pci_ss_info_10de_002d_1554_1041 =
- {0x1554, 0x1041, pci_subsys_10de_002d_1554_1041, 0};
-#undef pci_ss_info_1554_1041
-#define pci_ss_info_1554_1041 pci_ss_info_10de_002d_1554_1041
-static const pciSubsystemInfo pci_ss_info_10de_0060_1043_80ad =
- {0x1043, 0x80ad, pci_subsys_10de_0060_1043_80ad, 0};
-#undef pci_ss_info_1043_80ad
-#define pci_ss_info_1043_80ad pci_ss_info_10de_0060_1043_80ad
-static const pciSubsystemInfo pci_ss_info_10de_0067_1043_0c11 =
- {0x1043, 0x0c11, pci_subsys_10de_0067_1043_0c11, 0};
-#undef pci_ss_info_1043_0c11
-#define pci_ss_info_1043_0c11 pci_ss_info_10de_0067_1043_0c11
-static const pciSubsystemInfo pci_ss_info_10de_0068_1043_0c11 =
- {0x1043, 0x0c11, pci_subsys_10de_0068_1043_0c11, 0};
-#undef pci_ss_info_1043_0c11
-#define pci_ss_info_1043_0c11 pci_ss_info_10de_0068_1043_0c11
-static const pciSubsystemInfo pci_ss_info_10de_00a0_14af_5810 =
- {0x14af, 0x5810, pci_subsys_10de_00a0_14af_5810, 0};
-#undef pci_ss_info_14af_5810
-#define pci_ss_info_14af_5810 pci_ss_info_10de_00a0_14af_5810
-static const pciSubsystemInfo pci_ss_info_10de_0100_1043_0200 =
- {0x1043, 0x0200, pci_subsys_10de_0100_1043_0200, 0};
-#undef pci_ss_info_1043_0200
-#define pci_ss_info_1043_0200 pci_ss_info_10de_0100_1043_0200
-static const pciSubsystemInfo pci_ss_info_10de_0100_1043_0201 =
- {0x1043, 0x0201, pci_subsys_10de_0100_1043_0201, 0};
-#undef pci_ss_info_1043_0201
-#define pci_ss_info_1043_0201 pci_ss_info_10de_0100_1043_0201
-static const pciSubsystemInfo pci_ss_info_10de_0100_1043_4008 =
- {0x1043, 0x4008, pci_subsys_10de_0100_1043_4008, 0};
-#undef pci_ss_info_1043_4008
-#define pci_ss_info_1043_4008 pci_ss_info_10de_0100_1043_4008
-static const pciSubsystemInfo pci_ss_info_10de_0100_1043_4009 =
- {0x1043, 0x4009, pci_subsys_10de_0100_1043_4009, 0};
-#undef pci_ss_info_1043_4009
-#define pci_ss_info_1043_4009 pci_ss_info_10de_0100_1043_4009
-static const pciSubsystemInfo pci_ss_info_10de_0100_1102_102d =
- {0x1102, 0x102d, pci_subsys_10de_0100_1102_102d, 0};
-#undef pci_ss_info_1102_102d
-#define pci_ss_info_1102_102d pci_ss_info_10de_0100_1102_102d
-static const pciSubsystemInfo pci_ss_info_10de_0100_14af_5022 =
- {0x14af, 0x5022, pci_subsys_10de_0100_14af_5022, 0};
-#undef pci_ss_info_14af_5022
-#define pci_ss_info_14af_5022 pci_ss_info_10de_0100_14af_5022
-static const pciSubsystemInfo pci_ss_info_10de_0101_1043_0202 =
- {0x1043, 0x0202, pci_subsys_10de_0101_1043_0202, 0};
-#undef pci_ss_info_1043_0202
-#define pci_ss_info_1043_0202 pci_ss_info_10de_0101_1043_0202
-static const pciSubsystemInfo pci_ss_info_10de_0101_1043_400a =
- {0x1043, 0x400a, pci_subsys_10de_0101_1043_400a, 0};
-#undef pci_ss_info_1043_400a
-#define pci_ss_info_1043_400a pci_ss_info_10de_0101_1043_400a
-static const pciSubsystemInfo pci_ss_info_10de_0101_1043_400b =
- {0x1043, 0x400b, pci_subsys_10de_0101_1043_400b, 0};
-#undef pci_ss_info_1043_400b
-#define pci_ss_info_1043_400b pci_ss_info_10de_0101_1043_400b
-static const pciSubsystemInfo pci_ss_info_10de_0101_1102_102e =
- {0x1102, 0x102e, pci_subsys_10de_0101_1102_102e, 0};
-#undef pci_ss_info_1102_102e
-#define pci_ss_info_1102_102e pci_ss_info_10de_0101_1102_102e
-static const pciSubsystemInfo pci_ss_info_10de_0101_14af_5021 =
- {0x14af, 0x5021, pci_subsys_10de_0101_14af_5021, 0};
-#undef pci_ss_info_14af_5021
-#define pci_ss_info_14af_5021 pci_ss_info_10de_0101_14af_5021
-static const pciSubsystemInfo pci_ss_info_10de_0110_1043_4015 =
- {0x1043, 0x4015, pci_subsys_10de_0110_1043_4015, 0};
-#undef pci_ss_info_1043_4015
-#define pci_ss_info_1043_4015 pci_ss_info_10de_0110_1043_4015
-static const pciSubsystemInfo pci_ss_info_10de_0110_1043_4031 =
- {0x1043, 0x4031, pci_subsys_10de_0110_1043_4031, 0};
-#undef pci_ss_info_1043_4031
-#define pci_ss_info_1043_4031 pci_ss_info_10de_0110_1043_4031
-static const pciSubsystemInfo pci_ss_info_10de_0110_1462_8817 =
- {0x1462, 0x8817, pci_subsys_10de_0110_1462_8817, 0};
-#undef pci_ss_info_1462_8817
-#define pci_ss_info_1462_8817 pci_ss_info_10de_0110_1462_8817
-static const pciSubsystemInfo pci_ss_info_10de_0110_14af_7102 =
- {0x14af, 0x7102, pci_subsys_10de_0110_14af_7102, 0};
-#undef pci_ss_info_14af_7102
-#define pci_ss_info_14af_7102 pci_ss_info_10de_0110_14af_7102
-static const pciSubsystemInfo pci_ss_info_10de_0110_14af_7103 =
- {0x14af, 0x7103, pci_subsys_10de_0110_14af_7103, 0};
-#undef pci_ss_info_14af_7103
-#define pci_ss_info_14af_7103 pci_ss_info_10de_0110_14af_7103
-static const pciSubsystemInfo pci_ss_info_10de_0150_1043_4016 =
- {0x1043, 0x4016, pci_subsys_10de_0150_1043_4016, 0};
-#undef pci_ss_info_1043_4016
-#define pci_ss_info_1043_4016 pci_ss_info_10de_0150_1043_4016
-static const pciSubsystemInfo pci_ss_info_10de_0150_107d_2840 =
- {0x107d, 0x2840, pci_subsys_10de_0150_107d_2840, 0};
-#undef pci_ss_info_107d_2840
-#define pci_ss_info_107d_2840 pci_ss_info_10de_0150_107d_2840
-static const pciSubsystemInfo pci_ss_info_10de_0150_1462_8831 =
- {0x1462, 0x8831, pci_subsys_10de_0150_1462_8831, 0};
-#undef pci_ss_info_1462_8831
-#define pci_ss_info_1462_8831 pci_ss_info_10de_0150_1462_8831
-static const pciSubsystemInfo pci_ss_info_10de_0151_1043_405f =
- {0x1043, 0x405f, pci_subsys_10de_0151_1043_405f, 0};
-#undef pci_ss_info_1043_405f
-#define pci_ss_info_1043_405f pci_ss_info_10de_0151_1043_405f
-static const pciSubsystemInfo pci_ss_info_10de_0152_1048_0c56 =
- {0x1048, 0x0c56, pci_subsys_10de_0152_1048_0c56, 0};
-#undef pci_ss_info_1048_0c56
-#define pci_ss_info_1048_0c56 pci_ss_info_10de_0152_1048_0c56
-static const pciSubsystemInfo pci_ss_info_10de_0171_10b0_0002 =
- {0x10b0, 0x0002, pci_subsys_10de_0171_10b0_0002, 0};
-#undef pci_ss_info_10b0_0002
-#define pci_ss_info_10b0_0002 pci_ss_info_10de_0171_10b0_0002
-static const pciSubsystemInfo pci_ss_info_10de_0171_1462_8661 =
- {0x1462, 0x8661, pci_subsys_10de_0171_1462_8661, 0};
-#undef pci_ss_info_1462_8661
-#define pci_ss_info_1462_8661 pci_ss_info_10de_0171_1462_8661
-static const pciSubsystemInfo pci_ss_info_10de_0171_1462_8730 =
- {0x1462, 0x8730, pci_subsys_10de_0171_1462_8730, 0};
-#undef pci_ss_info_1462_8730
-#define pci_ss_info_1462_8730 pci_ss_info_10de_0171_1462_8730
-static const pciSubsystemInfo pci_ss_info_10de_0171_147b_8f00 =
- {0x147b, 0x8f00, pci_subsys_10de_0171_147b_8f00, 0};
-#undef pci_ss_info_147b_8f00
-#define pci_ss_info_147b_8f00 pci_ss_info_10de_0171_147b_8f00
-static const pciSubsystemInfo pci_ss_info_10de_0200_1043_402f =
- {0x1043, 0x402f, pci_subsys_10de_0200_1043_402f, 0};
-#undef pci_ss_info_1043_402f
-#define pci_ss_info_1043_402f pci_ss_info_10de_0200_1043_402f
-static const pciSubsystemInfo pci_ss_info_10de_0202_1043_405b =
- {0x1043, 0x405b, pci_subsys_10de_0202_1043_405b, 0};
-#undef pci_ss_info_1043_405b
-#define pci_ss_info_1043_405b pci_ss_info_10de_0202_1043_405b
-static const pciSubsystemInfo pci_ss_info_10de_0202_1545_002f =
- {0x1545, 0x002f, pci_subsys_10de_0202_1545_002f, 0};
-#undef pci_ss_info_1545_002f
-#define pci_ss_info_1545_002f pci_ss_info_10de_0202_1545_002f
-static const pciSubsystemInfo pci_ss_info_10de_0253_107d_2896 =
- {0x107d, 0x2896, pci_subsys_10de_0253_107d_2896, 0};
-#undef pci_ss_info_107d_2896
-#define pci_ss_info_107d_2896 pci_ss_info_10de_0253_107d_2896
-static const pciSubsystemInfo pci_ss_info_10de_0253_147b_8f09 =
- {0x147b, 0x8f09, pci_subsys_10de_0253_147b_8f09, 0};
-#undef pci_ss_info_147b_8f09
-#define pci_ss_info_147b_8f09 pci_ss_info_10de_0253_147b_8f09
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10e1_0391_10e1_0391 =
- {0x10e1, 0x0391, pci_subsys_10e1_0391_10e1_0391, 0};
-#undef pci_ss_info_10e1_0391
-#define pci_ss_info_10e1_0391 pci_ss_info_10e1_0391_10e1_0391
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10ec_8029_10b8_2011 =
- {0x10b8, 0x2011, pci_subsys_10ec_8029_10b8_2011, 0};
-#undef pci_ss_info_10b8_2011
-#define pci_ss_info_10b8_2011 pci_ss_info_10ec_8029_10b8_2011
-static const pciSubsystemInfo pci_ss_info_10ec_8029_10ec_8029 =
- {0x10ec, 0x8029, pci_subsys_10ec_8029_10ec_8029, 0};
-#undef pci_ss_info_10ec_8029
-#define pci_ss_info_10ec_8029 pci_ss_info_10ec_8029_10ec_8029
-static const pciSubsystemInfo pci_ss_info_10ec_8029_1113_1208 =
- {0x1113, 0x1208, pci_subsys_10ec_8029_1113_1208, 0};
-#undef pci_ss_info_1113_1208
-#define pci_ss_info_1113_1208 pci_ss_info_10ec_8029_1113_1208
-static const pciSubsystemInfo pci_ss_info_10ec_8029_1186_0300 =
- {0x1186, 0x0300, pci_subsys_10ec_8029_1186_0300, 0};
-#undef pci_ss_info_1186_0300
-#define pci_ss_info_1186_0300 pci_ss_info_10ec_8029_1186_0300
-static const pciSubsystemInfo pci_ss_info_10ec_8029_1259_2400 =
- {0x1259, 0x2400, pci_subsys_10ec_8029_1259_2400, 0};
-#undef pci_ss_info_1259_2400
-#define pci_ss_info_1259_2400 pci_ss_info_10ec_8029_1259_2400
-static const pciSubsystemInfo pci_ss_info_10ec_8129_10ec_8129 =
- {0x10ec, 0x8129, pci_subsys_10ec_8129_10ec_8129, 0};
-#undef pci_ss_info_10ec_8129
-#define pci_ss_info_10ec_8129 pci_ss_info_10ec_8129_10ec_8129
-static const pciSubsystemInfo pci_ss_info_10ec_8138_10ec_8138 =
- {0x10ec, 0x8138, pci_subsys_10ec_8138_10ec_8138, 0};
-#undef pci_ss_info_10ec_8138
-#define pci_ss_info_10ec_8138 pci_ss_info_10ec_8138_10ec_8138
-#endif
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1025_8920 =
- {0x1025, 0x8920, pci_subsys_10ec_8139_1025_8920, 0};
-#undef pci_ss_info_1025_8920
-#define pci_ss_info_1025_8920 pci_ss_info_10ec_8139_1025_8920
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1025_8921 =
- {0x1025, 0x8921, pci_subsys_10ec_8139_1025_8921, 0};
-#undef pci_ss_info_1025_8921
-#define pci_ss_info_1025_8921 pci_ss_info_10ec_8139_1025_8921
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_10ec_8139_10bd_0320 =
- {0x10bd, 0x0320, pci_subsys_10ec_8139_10bd_0320, 0};
-#undef pci_ss_info_10bd_0320
-#define pci_ss_info_10bd_0320 pci_ss_info_10ec_8139_10bd_0320
-static const pciSubsystemInfo pci_ss_info_10ec_8139_10ec_8139 =
- {0x10ec, 0x8139, pci_subsys_10ec_8139_10ec_8139, 0};
-#undef pci_ss_info_10ec_8139
-#define pci_ss_info_10ec_8139 pci_ss_info_10ec_8139_10ec_8139
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_1300 =
- {0x1186, 0x1300, pci_subsys_10ec_8139_1186_1300, 0};
-#undef pci_ss_info_1186_1300
-#define pci_ss_info_1186_1300 pci_ss_info_10ec_8139_1186_1300
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_1320 =
- {0x1186, 0x1320, pci_subsys_10ec_8139_1186_1320, 0};
-#undef pci_ss_info_1186_1320
-#define pci_ss_info_1186_1320 pci_ss_info_10ec_8139_1186_1320
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_8139 =
- {0x1186, 0x8139, pci_subsys_10ec_8139_1186_8139, 0};
-#undef pci_ss_info_1186_8139
-#define pci_ss_info_1186_8139 pci_ss_info_10ec_8139_1186_8139
-static const pciSubsystemInfo pci_ss_info_10ec_8139_11f6_8139 =
- {0x11f6, 0x8139, pci_subsys_10ec_8139_11f6_8139, 0};
-#undef pci_ss_info_11f6_8139
-#define pci_ss_info_11f6_8139 pci_ss_info_10ec_8139_11f6_8139
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1259_2500 =
- {0x1259, 0x2500, pci_subsys_10ec_8139_1259_2500, 0};
-#undef pci_ss_info_1259_2500
-#define pci_ss_info_1259_2500 pci_ss_info_10ec_8139_1259_2500
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1259_2503 =
- {0x1259, 0x2503, pci_subsys_10ec_8139_1259_2503, 0};
-#undef pci_ss_info_1259_2503
-#define pci_ss_info_1259_2503 pci_ss_info_10ec_8139_1259_2503
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1429_d010 =
- {0x1429, 0xd010, pci_subsys_10ec_8139_1429_d010, 0};
-#undef pci_ss_info_1429_d010
-#define pci_ss_info_1429_d010 pci_ss_info_10ec_8139_1429_d010
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1432_9130 =
- {0x1432, 0x9130, pci_subsys_10ec_8139_1432_9130, 0};
-#undef pci_ss_info_1432_9130
-#define pci_ss_info_1432_9130 pci_ss_info_10ec_8139_1432_9130
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1436_8139 =
- {0x1436, 0x8139, pci_subsys_10ec_8139_1436_8139, 0};
-#undef pci_ss_info_1436_8139
-#define pci_ss_info_1436_8139 pci_ss_info_10ec_8139_1436_8139
-static const pciSubsystemInfo pci_ss_info_10ec_8139_146c_1439 =
- {0x146c, 0x1439, pci_subsys_10ec_8139_146c_1439, 0};
-#undef pci_ss_info_146c_1439
-#define pci_ss_info_146c_1439 pci_ss_info_10ec_8139_146c_1439
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1489_6001 =
- {0x1489, 0x6001, pci_subsys_10ec_8139_1489_6001, 0};
-#undef pci_ss_info_1489_6001
-#define pci_ss_info_1489_6001 pci_ss_info_10ec_8139_1489_6001
-static const pciSubsystemInfo pci_ss_info_10ec_8139_1489_6002 =
- {0x1489, 0x6002, pci_subsys_10ec_8139_1489_6002, 0};
-#undef pci_ss_info_1489_6002
-#define pci_ss_info_1489_6002 pci_ss_info_10ec_8139_1489_6002
-static const pciSubsystemInfo pci_ss_info_10ec_8139_149c_139a =
- {0x149c, 0x139a, pci_subsys_10ec_8139_149c_139a, 0};
-#undef pci_ss_info_149c_139a
-#define pci_ss_info_149c_139a pci_ss_info_10ec_8139_149c_139a
-static const pciSubsystemInfo pci_ss_info_10ec_8139_149c_8139 =
- {0x149c, 0x8139, pci_subsys_10ec_8139_149c_8139, 0};
-#undef pci_ss_info_149c_8139
-#define pci_ss_info_149c_8139 pci_ss_info_10ec_8139_149c_8139
-static const pciSubsystemInfo pci_ss_info_10ec_8139_2646_0001 =
- {0x2646, 0x0001, pci_subsys_10ec_8139_2646_0001, 0};
-#undef pci_ss_info_2646_0001
-#define pci_ss_info_2646_0001 pci_ss_info_10ec_8139_2646_0001
-static const pciSubsystemInfo pci_ss_info_10ec_8139_8e2e_7000 =
- {0x8e2e, 0x7000, pci_subsys_10ec_8139_8e2e_7000, 0};
-#undef pci_ss_info_8e2e_7000
-#define pci_ss_info_8e2e_7000 pci_ss_info_10ec_8139_8e2e_7000
-static const pciSubsystemInfo pci_ss_info_10ec_8139_8e2e_7100 =
- {0x8e2e, 0x7100, pci_subsys_10ec_8139_8e2e_7100, 0};
-#undef pci_ss_info_8e2e_7100
-#define pci_ss_info_8e2e_7100 pci_ss_info_10ec_8139_8e2e_7100
-static const pciSubsystemInfo pci_ss_info_10ec_8139_a0a0_0007 =
- {0xa0a0, 0x0007, pci_subsys_10ec_8139_a0a0_0007, 0};
-#undef pci_ss_info_a0a0_0007
-#define pci_ss_info_a0a0_0007 pci_ss_info_10ec_8139_a0a0_0007
-static const pciSubsystemInfo pci_ss_info_10ec_8169_1371_434e =
- {0x1371, 0x434e, pci_subsys_10ec_8169_1371_434e, 0};
-#undef pci_ss_info_1371_434e
-#define pci_ss_info_1371_434e pci_ss_info_10ec_8169_1371_434e
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_0020 =
- {0x1102, 0x0020, pci_subsys_1102_0002_1102_0020, 0};
-#undef pci_ss_info_1102_0020
-#define pci_ss_info_1102_0020 pci_ss_info_1102_0002_1102_0020
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_0021 =
- {0x1102, 0x0021, pci_subsys_1102_0002_1102_0021, 0};
-#undef pci_ss_info_1102_0021
-#define pci_ss_info_1102_0021 pci_ss_info_1102_0002_1102_0021
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_002f =
- {0x1102, 0x002f, pci_subsys_1102_0002_1102_002f, 0};
-#undef pci_ss_info_1102_002f
-#define pci_ss_info_1102_002f pci_ss_info_1102_0002_1102_002f
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_4001 =
- {0x1102, 0x4001, pci_subsys_1102_0002_1102_4001, 0};
-#undef pci_ss_info_1102_4001
-#define pci_ss_info_1102_4001 pci_ss_info_1102_0002_1102_4001
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8022 =
- {0x1102, 0x8022, pci_subsys_1102_0002_1102_8022, 0};
-#undef pci_ss_info_1102_8022
-#define pci_ss_info_1102_8022 pci_ss_info_1102_0002_1102_8022
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8023 =
- {0x1102, 0x8023, pci_subsys_1102_0002_1102_8023, 0};
-#undef pci_ss_info_1102_8023
-#define pci_ss_info_1102_8023 pci_ss_info_1102_0002_1102_8023
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8024 =
- {0x1102, 0x8024, pci_subsys_1102_0002_1102_8024, 0};
-#undef pci_ss_info_1102_8024
-#define pci_ss_info_1102_8024 pci_ss_info_1102_0002_1102_8024
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8025 =
- {0x1102, 0x8025, pci_subsys_1102_0002_1102_8025, 0};
-#undef pci_ss_info_1102_8025
-#define pci_ss_info_1102_8025 pci_ss_info_1102_0002_1102_8025
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8026 =
- {0x1102, 0x8026, pci_subsys_1102_0002_1102_8026, 0};
-#undef pci_ss_info_1102_8026
-#define pci_ss_info_1102_8026 pci_ss_info_1102_0002_1102_8026
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8027 =
- {0x1102, 0x8027, pci_subsys_1102_0002_1102_8027, 0};
-#undef pci_ss_info_1102_8027
-#define pci_ss_info_1102_8027 pci_ss_info_1102_0002_1102_8027
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8028 =
- {0x1102, 0x8028, pci_subsys_1102_0002_1102_8028, 0};
-#undef pci_ss_info_1102_8028
-#define pci_ss_info_1102_8028 pci_ss_info_1102_0002_1102_8028
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8031 =
- {0x1102, 0x8031, pci_subsys_1102_0002_1102_8031, 0};
-#undef pci_ss_info_1102_8031
-#define pci_ss_info_1102_8031 pci_ss_info_1102_0002_1102_8031
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8040 =
- {0x1102, 0x8040, pci_subsys_1102_0002_1102_8040, 0};
-#undef pci_ss_info_1102_8040
-#define pci_ss_info_1102_8040 pci_ss_info_1102_0002_1102_8040
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8051 =
- {0x1102, 0x8051, pci_subsys_1102_0002_1102_8051, 0};
-#undef pci_ss_info_1102_8051
-#define pci_ss_info_1102_8051 pci_ss_info_1102_0002_1102_8051
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8061 =
- {0x1102, 0x8061, pci_subsys_1102_0002_1102_8061, 0};
-#undef pci_ss_info_1102_8061
-#define pci_ss_info_1102_8061 pci_ss_info_1102_0002_1102_8061
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8064 =
- {0x1102, 0x8064, pci_subsys_1102_0002_1102_8064, 0};
-#undef pci_ss_info_1102_8064
-#define pci_ss_info_1102_8064 pci_ss_info_1102_0002_1102_8064
-static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8065 =
- {0x1102, 0x8065, pci_subsys_1102_0002_1102_8065, 0};
-#undef pci_ss_info_1102_8065
-#define pci_ss_info_1102_8065 pci_ss_info_1102_0002_1102_8065
-static const pciSubsystemInfo pci_ss_info_1102_0004_1102_0051 =
- {0x1102, 0x0051, pci_subsys_1102_0004_1102_0051, 0};
-#undef pci_ss_info_1102_0051
-#define pci_ss_info_1102_0051 pci_ss_info_1102_0004_1102_0051
-static const pciSubsystemInfo pci_ss_info_1102_0004_1102_0053 =
- {0x1102, 0x0053, pci_subsys_1102_0004_1102_0053, 0};
-#undef pci_ss_info_1102_0053
-#define pci_ss_info_1102_0053 pci_ss_info_1102_0004_1102_0053
-static const pciSubsystemInfo pci_ss_info_1102_4001_1102_0010 =
- {0x1102, 0x0010, pci_subsys_1102_4001_1102_0010, 0};
-#undef pci_ss_info_1102_0010
-#define pci_ss_info_1102_0010 pci_ss_info_1102_4001_1102_0010
-static const pciSubsystemInfo pci_ss_info_1102_7002_1102_0020 =
- {0x1102, 0x0020, pci_subsys_1102_7002_1102_0020, 0};
-#undef pci_ss_info_1102_0020
-#define pci_ss_info_1102_0020 pci_ss_info_1102_7002_1102_0020
-static const pciSubsystemInfo pci_ss_info_1102_7003_1102_0040 =
- {0x1102, 0x0040, pci_subsys_1102_7003_1102_0040, 0};
-#undef pci_ss_info_1102_0040
-#define pci_ss_info_1102_0040 pci_ss_info_1102_7003_1102_0040
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0001 =
- {0x1103, 0x0001, pci_subsys_1103_0004_1103_0001, 0};
-#undef pci_ss_info_1103_0001
-#define pci_ss_info_1103_0001 pci_ss_info_1103_0004_1103_0001
-static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0005 =
- {0x1103, 0x0005, pci_subsys_1103_0004_1103_0005, 0};
-#undef pci_ss_info_1103_0005
-#define pci_ss_info_1103_0005 pci_ss_info_1103_0004_1103_0005
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1106_0305_1043_8033 =
- {0x1043, 0x8033, pci_subsys_1106_0305_1043_8033, 0};
-#undef pci_ss_info_1043_8033
-#define pci_ss_info_1043_8033 pci_ss_info_1106_0305_1043_8033
-static const pciSubsystemInfo pci_ss_info_1106_0305_1043_803e =
- {0x1043, 0x803e, pci_subsys_1106_0305_1043_803e, 0};
-#undef pci_ss_info_1043_803e
-#define pci_ss_info_1043_803e pci_ss_info_1106_0305_1043_803e
-static const pciSubsystemInfo pci_ss_info_1106_0305_1043_8042 =
- {0x1043, 0x8042, pci_subsys_1106_0305_1043_8042, 0};
-#undef pci_ss_info_1043_8042
-#define pci_ss_info_1043_8042 pci_ss_info_1106_0305_1043_8042
-static const pciSubsystemInfo pci_ss_info_1106_0305_147b_a401 =
- {0x147b, 0xa401, pci_subsys_1106_0305_147b_a401, 0};
-#undef pci_ss_info_147b_a401
-#define pci_ss_info_147b_a401 pci_ss_info_1106_0305_147b_a401
-static const pciSubsystemInfo pci_ss_info_1106_0571_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_0571_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_0571_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_0571_1043_8052 =
- {0x1043, 0x8052, pci_subsys_1106_0571_1043_8052, 0};
-#undef pci_ss_info_1043_8052
-#define pci_ss_info_1043_8052 pci_ss_info_1106_0571_1043_8052
-static const pciSubsystemInfo pci_ss_info_1106_0571_1043_808c =
- {0x1043, 0x808c, pci_subsys_1106_0571_1043_808c, 0};
-#undef pci_ss_info_1043_808c
-#define pci_ss_info_1043_808c pci_ss_info_1106_0571_1043_808c
-static const pciSubsystemInfo pci_ss_info_1106_0571_1106_0571 =
- {0x1106, 0x0571, pci_subsys_1106_0571_1106_0571, 0};
-#undef pci_ss_info_1106_0571
-#define pci_ss_info_1106_0571 pci_ss_info_1106_0571_1106_0571
-static const pciSubsystemInfo pci_ss_info_1106_0571_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1106_0571_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1106_0571_1179_0001
-static const pciSubsystemInfo pci_ss_info_1106_0571_1458_5002 =
- {0x1458, 0x5002, pci_subsys_1106_0571_1458_5002, 0};
-#undef pci_ss_info_1458_5002
-#define pci_ss_info_1458_5002 pci_ss_info_1106_0571_1458_5002
-static const pciSubsystemInfo pci_ss_info_1106_0586_1106_0000 =
- {0x1106, 0x0000, pci_subsys_1106_0586_1106_0000, 0};
-#undef pci_ss_info_1106_0000
-#define pci_ss_info_1106_0000 pci_ss_info_1106_0586_1106_0000
-static const pciSubsystemInfo pci_ss_info_1106_0596_1106_0000 =
- {0x1106, 0x0000, pci_subsys_1106_0596_1106_0000, 0};
-#undef pci_ss_info_1106_0000
-#define pci_ss_info_1106_0000 pci_ss_info_1106_0596_1106_0000
-static const pciSubsystemInfo pci_ss_info_1106_0596_1458_0596 =
- {0x1458, 0x0596, pci_subsys_1106_0596_1458_0596, 0};
-#undef pci_ss_info_1458_0596
-#define pci_ss_info_1458_0596 pci_ss_info_1106_0596_1458_0596
-static const pciSubsystemInfo pci_ss_info_1106_0605_1043_802c =
- {0x1043, 0x802c, pci_subsys_1106_0605_1043_802c, 0};
-#undef pci_ss_info_1043_802c
-#define pci_ss_info_1043_802c pci_ss_info_1106_0605_1043_802c
-static const pciSubsystemInfo pci_ss_info_1106_0686_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_0686_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_0686_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_0686_1043_802c =
- {0x1043, 0x802c, pci_subsys_1106_0686_1043_802c, 0};
-#undef pci_ss_info_1043_802c
-#define pci_ss_info_1043_802c pci_ss_info_1106_0686_1043_802c
-static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8033 =
- {0x1043, 0x8033, pci_subsys_1106_0686_1043_8033, 0};
-#undef pci_ss_info_1043_8033
-#define pci_ss_info_1043_8033 pci_ss_info_1106_0686_1043_8033
-static const pciSubsystemInfo pci_ss_info_1106_0686_1043_803e =
- {0x1043, 0x803e, pci_subsys_1106_0686_1043_803e, 0};
-#undef pci_ss_info_1043_803e
-#define pci_ss_info_1043_803e pci_ss_info_1106_0686_1043_803e
-static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8040 =
- {0x1043, 0x8040, pci_subsys_1106_0686_1043_8040, 0};
-#undef pci_ss_info_1043_8040
-#define pci_ss_info_1043_8040 pci_ss_info_1106_0686_1043_8040
-static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8042 =
- {0x1043, 0x8042, pci_subsys_1106_0686_1043_8042, 0};
-#undef pci_ss_info_1043_8042
-#define pci_ss_info_1043_8042 pci_ss_info_1106_0686_1043_8042
-static const pciSubsystemInfo pci_ss_info_1106_0686_1106_0000 =
- {0x1106, 0x0000, pci_subsys_1106_0686_1106_0000, 0};
-#undef pci_ss_info_1106_0000
-#define pci_ss_info_1106_0000 pci_ss_info_1106_0686_1106_0000
-static const pciSubsystemInfo pci_ss_info_1106_0686_1106_0686 =
- {0x1106, 0x0686, pci_subsys_1106_0686_1106_0686, 0};
-#undef pci_ss_info_1106_0686
-#define pci_ss_info_1106_0686 pci_ss_info_1106_0686_1106_0686
-static const pciSubsystemInfo pci_ss_info_1106_0686_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1106_0686_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1106_0686_1179_0001
-static const pciSubsystemInfo pci_ss_info_1106_0686_147b_a702 =
- {0x147b, 0xa702, pci_subsys_1106_0686_147b_a702, 0};
-#undef pci_ss_info_147b_a702
-#define pci_ss_info_147b_a702 pci_ss_info_1106_0686_147b_a702
-static const pciSubsystemInfo pci_ss_info_1106_0691_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_0691_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_0691_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_0691_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1106_0691_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1106_0691_1179_0001
-static const pciSubsystemInfo pci_ss_info_1106_0691_1458_0691 =
- {0x1458, 0x0691, pci_subsys_1106_0691_1458_0691, 0};
-#undef pci_ss_info_1458_0691
-#define pci_ss_info_1458_0691 pci_ss_info_1106_0691_1458_0691
-static const pciSubsystemInfo pci_ss_info_1106_3038_0925_1234 =
- {0x0925, 0x1234, pci_subsys_1106_3038_0925_1234, 0};
-#undef pci_ss_info_0925_1234
-#define pci_ss_info_0925_1234 pci_ss_info_1106_3038_0925_1234
-static const pciSubsystemInfo pci_ss_info_1106_3038_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_3038_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_3038_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_3038_1043_808c =
- {0x1043, 0x808c, pci_subsys_1106_3038_1043_808c, 0};
-#undef pci_ss_info_1043_808c
-#define pci_ss_info_1043_808c pci_ss_info_1106_3038_1043_808c
-static const pciSubsystemInfo pci_ss_info_1106_3038_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1106_3038_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1106_3038_1179_0001
-static const pciSubsystemInfo pci_ss_info_1106_3043_10bd_0000 =
- {0x10bd, 0x0000, pci_subsys_1106_3043_10bd_0000, 0};
-#undef pci_ss_info_10bd_0000
-#define pci_ss_info_10bd_0000 pci_ss_info_1106_3043_10bd_0000
-static const pciSubsystemInfo pci_ss_info_1106_3043_1106_0100 =
- {0x1106, 0x0100, pci_subsys_1106_3043_1106_0100, 0};
-#undef pci_ss_info_1106_0100
-#define pci_ss_info_1106_0100 pci_ss_info_1106_3043_1106_0100
-static const pciSubsystemInfo pci_ss_info_1106_3043_1186_1400 =
- {0x1186, 0x1400, pci_subsys_1106_3043_1186_1400, 0};
-#undef pci_ss_info_1186_1400
-#define pci_ss_info_1186_1400 pci_ss_info_1106_3043_1186_1400
-static const pciSubsystemInfo pci_ss_info_1106_3057_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_3057_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_3057_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8033 =
- {0x1043, 0x8033, pci_subsys_1106_3057_1043_8033, 0};
-#undef pci_ss_info_1043_8033
-#define pci_ss_info_1043_8033 pci_ss_info_1106_3057_1043_8033
-static const pciSubsystemInfo pci_ss_info_1106_3057_1043_803e =
- {0x1043, 0x803e, pci_subsys_1106_3057_1043_803e, 0};
-#undef pci_ss_info_1043_803e
-#define pci_ss_info_1043_803e pci_ss_info_1106_3057_1043_803e
-static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8040 =
- {0x1043, 0x8040, pci_subsys_1106_3057_1043_8040, 0};
-#undef pci_ss_info_1043_8040
-#define pci_ss_info_1043_8040 pci_ss_info_1106_3057_1043_8040
-static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8042 =
- {0x1043, 0x8042, pci_subsys_1106_3057_1043_8042, 0};
-#undef pci_ss_info_1043_8042
-#define pci_ss_info_1043_8042 pci_ss_info_1106_3057_1043_8042
-static const pciSubsystemInfo pci_ss_info_1106_3057_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1106_3057_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1106_3057_1179_0001
-#endif
-static const pciSubsystemInfo pci_ss_info_1106_3058_0e11_b194 =
- {0x0e11, 0xb194, pci_subsys_1106_3058_0e11_b194, 0};
-#undef pci_ss_info_0e11_b194
-#define pci_ss_info_0e11_b194 pci_ss_info_1106_3058_0e11_b194
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1106_3058_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_3058_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_3058_1019_0985
-static const pciSubsystemInfo pci_ss_info_1106_3058_1106_4511 =
- {0x1106, 0x4511, pci_subsys_1106_3058_1106_4511, 0};
-#undef pci_ss_info_1106_4511
-#define pci_ss_info_1106_4511 pci_ss_info_1106_3058_1106_4511
-static const pciSubsystemInfo pci_ss_info_1106_3058_1458_7600 =
- {0x1458, 0x7600, pci_subsys_1106_3058_1458_7600, 0};
-#undef pci_ss_info_1458_7600
-#define pci_ss_info_1458_7600 pci_ss_info_1106_3058_1458_7600
-static const pciSubsystemInfo pci_ss_info_1106_3058_1462_3091 =
- {0x1462, 0x3091, pci_subsys_1106_3058_1462_3091, 0};
-#undef pci_ss_info_1462_3091
-#define pci_ss_info_1462_3091 pci_ss_info_1106_3058_1462_3091
-static const pciSubsystemInfo pci_ss_info_1106_3058_15dd_7609 =
- {0x15dd, 0x7609, pci_subsys_1106_3058_15dd_7609, 0};
-#undef pci_ss_info_15dd_7609
-#define pci_ss_info_15dd_7609 pci_ss_info_1106_3058_15dd_7609
-static const pciSubsystemInfo pci_ss_info_1106_3059_1043_8095 =
- {0x1043, 0x8095, pci_subsys_1106_3059_1043_8095, 0};
-#undef pci_ss_info_1043_8095
-#define pci_ss_info_1043_8095 pci_ss_info_1106_3059_1043_8095
-static const pciSubsystemInfo pci_ss_info_1106_3059_1458_a002 =
- {0x1458, 0xa002, pci_subsys_1106_3059_1458_a002, 0};
-#undef pci_ss_info_1458_a002
-#define pci_ss_info_1458_a002 pci_ss_info_1106_3059_1458_a002
-static const pciSubsystemInfo pci_ss_info_1106_3065_1106_0102 =
- {0x1106, 0x0102, pci_subsys_1106_3065_1106_0102, 0};
-#undef pci_ss_info_1106_0102
-#define pci_ss_info_1106_0102 pci_ss_info_1106_3065_1106_0102
-static const pciSubsystemInfo pci_ss_info_1106_3065_1186_1400 =
- {0x1186, 0x1400, pci_subsys_1106_3065_1186_1400, 0};
-#undef pci_ss_info_1186_1400
-#define pci_ss_info_1186_1400 pci_ss_info_1106_3065_1186_1400
-static const pciSubsystemInfo pci_ss_info_1106_3065_1186_1401 =
- {0x1186, 0x1401, pci_subsys_1106_3065_1186_1401, 0};
-#undef pci_ss_info_1186_1401
-#define pci_ss_info_1186_1401 pci_ss_info_1106_3065_1186_1401
-static const pciSubsystemInfo pci_ss_info_1106_3065_13b9_1421 =
- {0x13b9, 0x1421, pci_subsys_1106_3065_13b9_1421, 0};
-#undef pci_ss_info_13b9_1421
-#define pci_ss_info_13b9_1421 pci_ss_info_1106_3065_13b9_1421
-static const pciSubsystemInfo pci_ss_info_1106_3074_1043_8052 =
- {0x1043, 0x8052, pci_subsys_1106_3074_1043_8052, 0};
-#undef pci_ss_info_1043_8052
-#define pci_ss_info_1043_8052 pci_ss_info_1106_3074_1043_8052
-static const pciSubsystemInfo pci_ss_info_1106_3099_1043_8064 =
- {0x1043, 0x8064, pci_subsys_1106_3099_1043_8064, 0};
-#undef pci_ss_info_1043_8064
-#define pci_ss_info_1043_8064 pci_ss_info_1106_3099_1043_8064
-static const pciSubsystemInfo pci_ss_info_1106_3099_1043_807f =
- {0x1043, 0x807f, pci_subsys_1106_3099_1043_807f, 0};
-#undef pci_ss_info_1043_807f
-#define pci_ss_info_1043_807f pci_ss_info_1106_3099_1043_807f
-static const pciSubsystemInfo pci_ss_info_1106_3104_1043_808c =
- {0x1043, 0x808c, pci_subsys_1106_3104_1043_808c, 0};
-#undef pci_ss_info_1043_808c
-#define pci_ss_info_1043_808c pci_ss_info_1106_3104_1043_808c
-static const pciSubsystemInfo pci_ss_info_1106_3104_1458_5004 =
- {0x1458, 0x5004, pci_subsys_1106_3104_1458_5004, 0};
-#undef pci_ss_info_1458_5004
-#define pci_ss_info_1458_5004 pci_ss_info_1106_3104_1458_5004
-static const pciSubsystemInfo pci_ss_info_1106_3177_1043_808c =
- {0x1043, 0x808c, pci_subsys_1106_3177_1043_808c, 0};
-#undef pci_ss_info_1043_808c
-#define pci_ss_info_1043_808c pci_ss_info_1106_3177_1043_808c
-static const pciSubsystemInfo pci_ss_info_1106_3177_1458_5001 =
- {0x1458, 0x5001, pci_subsys_1106_3177_1458_5001, 0};
-#undef pci_ss_info_1458_5001
-#define pci_ss_info_1458_5001 pci_ss_info_1106_3177_1458_5001
-static const pciSubsystemInfo pci_ss_info_1106_3189_1043_807f =
- {0x1043, 0x807f, pci_subsys_1106_3189_1043_807f, 0};
-#undef pci_ss_info_1043_807f
-#define pci_ss_info_1043_807f pci_ss_info_1106_3189_1043_807f
-static const pciSubsystemInfo pci_ss_info_1106_3189_1458_5000 =
- {0x1458, 0x5000, pci_subsys_1106_3189_1458_5000, 0};
-#undef pci_ss_info_1458_5000
-#define pci_ss_info_1458_5000 pci_ss_info_1106_3189_1458_5000
-static const pciSubsystemInfo pci_ss_info_1106_8598_1019_0985 =
- {0x1019, 0x0985, pci_subsys_1106_8598_1019_0985, 0};
-#undef pci_ss_info_1019_0985
-#define pci_ss_info_1019_0985 pci_ss_info_1106_8598_1019_0985
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1113_1211_103c_1207 =
- {0x103c, 0x1207, pci_subsys_1113_1211_103c_1207, 0};
-#undef pci_ss_info_103c_1207
-#define pci_ss_info_103c_1207 pci_ss_info_1113_1211_103c_1207
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1113_1211_1113_1211 =
- {0x1113, 0x1211, pci_subsys_1113_1211_1113_1211, 0};
-#undef pci_ss_info_1113_1211
-#define pci_ss_info_1113_1211 pci_ss_info_1113_1211_1113_1211
-static const pciSubsystemInfo pci_ss_info_1113_1216_111a_1020 =
- {0x111a, 0x1020, pci_subsys_1113_1216_111a_1020, 0};
-#undef pci_ss_info_111a_1020
-#define pci_ss_info_111a_1020 pci_ss_info_1113_1216_111a_1020
-static const pciSubsystemInfo pci_ss_info_1113_9211_1113_9211 =
- {0x1113, 0x9211, pci_subsys_1113_9211_1113_9211, 0};
-#undef pci_ss_info_1113_9211
-#define pci_ss_info_1113_9211 pci_ss_info_1113_9211_1113_9211
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_111a_0003_111a_0000 =
- {0x111a, 0x0000, pci_subsys_111a_0003_111a_0000, 0};
-#undef pci_ss_info_111a_0000
-#define pci_ss_info_111a_0000 pci_ss_info_111a_0003_111a_0000
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0001 =
- {0x111a, 0x0001, pci_subsys_111a_0005_111a_0001, 0};
-#undef pci_ss_info_111a_0001
-#define pci_ss_info_111a_0001 pci_ss_info_111a_0005_111a_0001
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0009 =
- {0x111a, 0x0009, pci_subsys_111a_0005_111a_0009, 0};
-#undef pci_ss_info_111a_0009
-#define pci_ss_info_111a_0009 pci_ss_info_111a_0005_111a_0009
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0101 =
- {0x111a, 0x0101, pci_subsys_111a_0005_111a_0101, 0};
-#undef pci_ss_info_111a_0101
-#define pci_ss_info_111a_0101 pci_ss_info_111a_0005_111a_0101
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0109 =
- {0x111a, 0x0109, pci_subsys_111a_0005_111a_0109, 0};
-#undef pci_ss_info_111a_0109
-#define pci_ss_info_111a_0109 pci_ss_info_111a_0005_111a_0109
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0809 =
- {0x111a, 0x0809, pci_subsys_111a_0005_111a_0809, 0};
-#undef pci_ss_info_111a_0809
-#define pci_ss_info_111a_0809 pci_ss_info_111a_0005_111a_0809
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0909 =
- {0x111a, 0x0909, pci_subsys_111a_0005_111a_0909, 0};
-#undef pci_ss_info_111a_0909
-#define pci_ss_info_111a_0909 pci_ss_info_111a_0005_111a_0909
-static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0a09 =
- {0x111a, 0x0a09, pci_subsys_111a_0005_111a_0a09, 0};
-#undef pci_ss_info_111a_0a09
-#define pci_ss_info_111a_0a09 pci_ss_info_111a_0005_111a_0a09
-static const pciSubsystemInfo pci_ss_info_111a_0007_111a_1001 =
- {0x111a, 0x1001, pci_subsys_111a_0007_111a_1001, 0};
-#undef pci_ss_info_111a_1001
-#define pci_ss_info_111a_1001 pci_ss_info_111a_0007_111a_1001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1127_0400_1127_0400 =
- {0x1127, 0x0400, pci_subsys_1127_0400_1127_0400, 0};
-#undef pci_ss_info_1127_0400
-#define pci_ss_info_1127_0400 pci_ss_info_1127_0400_1127_0400
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1131_7146_114b_2003 =
- {0x114b, 0x2003, pci_subsys_1131_7146_114b_2003, 0};
-#undef pci_ss_info_114b_2003
-#define pci_ss_info_114b_2003 pci_ss_info_1131_7146_114b_2003
-static const pciSubsystemInfo pci_ss_info_1131_7146_11bd_0006 =
- {0x11bd, 0x0006, pci_subsys_1131_7146_11bd_0006, 0};
-#undef pci_ss_info_11bd_0006
-#define pci_ss_info_11bd_0006 pci_ss_info_1131_7146_11bd_0006
-static const pciSubsystemInfo pci_ss_info_1131_7146_11bd_000a =
- {0x11bd, 0x000a, pci_subsys_1131_7146_11bd_000a, 0};
-#undef pci_ss_info_11bd_000a
-#define pci_ss_info_11bd_000a pci_ss_info_1131_7146_11bd_000a
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1133_e001_1133_e001 =
- {0x1133, 0xe001, pci_subsys_1133_e001_1133_e001, 0};
-#undef pci_ss_info_1133_e001
-#define pci_ss_info_1133_e001 pci_ss_info_1133_e001_1133_e001
-static const pciSubsystemInfo pci_ss_info_1133_e002_1133_e002 =
- {0x1133, 0xe002, pci_subsys_1133_e002_1133_e002, 0};
-#undef pci_ss_info_1133_e002
-#define pci_ss_info_1133_e002 pci_ss_info_1133_e002_1133_e002
-static const pciSubsystemInfo pci_ss_info_1133_e003_1133_e003 =
- {0x1133, 0xe003, pci_subsys_1133_e003_1133_e003, 0};
-#undef pci_ss_info_1133_e003
-#define pci_ss_info_1133_e003 pci_ss_info_1133_e003_1133_e003
-static const pciSubsystemInfo pci_ss_info_1133_e004_1133_e004 =
- {0x1133, 0xe004, pci_subsys_1133_e004_1133_e004, 0};
-#undef pci_ss_info_1133_e004
-#define pci_ss_info_1133_e004 pci_ss_info_1133_e004_1133_e004
-static const pciSubsystemInfo pci_ss_info_1133_e005_1133_e005 =
- {0x1133, 0xe005, pci_subsys_1133_e005_1133_e005, 0};
-#undef pci_ss_info_1133_e005
-#define pci_ss_info_1133_e005 pci_ss_info_1133_e005_1133_e005
-static const pciSubsystemInfo pci_ss_info_1133_e010_1133_e010 =
- {0x1133, 0xe010, pci_subsys_1133_e010_1133_e010, 0};
-#undef pci_ss_info_1133_e010
-#define pci_ss_info_1133_e010 pci_ss_info_1133_e010_1133_e010
-static const pciSubsystemInfo pci_ss_info_1133_e012_1133_e012 =
- {0x1133, 0xe012, pci_subsys_1133_e012_1133_e012, 0};
-#undef pci_ss_info_1133_e012
-#define pci_ss_info_1133_e012 pci_ss_info_1133_e012_1133_e012
-static const pciSubsystemInfo pci_ss_info_1133_e014_1133_e014 =
- {0x1133, 0xe014, pci_subsys_1133_e014_1133_e014, 0};
-#undef pci_ss_info_1133_e014
-#define pci_ss_info_1133_e014 pci_ss_info_1133_e014_1133_e014
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03b =
- {0x0e11, 0xb03b, pci_subsys_1148_4000_0e11_b03b, 0};
-#undef pci_ss_info_0e11_b03b
-#define pci_ss_info_0e11_b03b pci_ss_info_1148_4000_0e11_b03b
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03c =
- {0x0e11, 0xb03c, pci_subsys_1148_4000_0e11_b03c, 0};
-#undef pci_ss_info_0e11_b03c
-#define pci_ss_info_0e11_b03c pci_ss_info_1148_4000_0e11_b03c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03d =
- {0x0e11, 0xb03d, pci_subsys_1148_4000_0e11_b03d, 0};
-#undef pci_ss_info_0e11_b03d
-#define pci_ss_info_0e11_b03d pci_ss_info_1148_4000_0e11_b03d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03e =
- {0x0e11, 0xb03e, pci_subsys_1148_4000_0e11_b03e, 0};
-#undef pci_ss_info_0e11_b03e
-#define pci_ss_info_0e11_b03e pci_ss_info_1148_4000_0e11_b03e
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03f =
- {0x0e11, 0xb03f, pci_subsys_1148_4000_0e11_b03f, 0};
-#undef pci_ss_info_0e11_b03f
-#define pci_ss_info_0e11_b03f pci_ss_info_1148_4000_0e11_b03f
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5521 =
- {0x1148, 0x5521, pci_subsys_1148_4000_1148_5521, 0};
-#undef pci_ss_info_1148_5521
-#define pci_ss_info_1148_5521 pci_ss_info_1148_4000_1148_5521
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5522 =
- {0x1148, 0x5522, pci_subsys_1148_4000_1148_5522, 0};
-#undef pci_ss_info_1148_5522
-#define pci_ss_info_1148_5522 pci_ss_info_1148_4000_1148_5522
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5541 =
- {0x1148, 0x5541, pci_subsys_1148_4000_1148_5541, 0};
-#undef pci_ss_info_1148_5541
-#define pci_ss_info_1148_5541 pci_ss_info_1148_4000_1148_5541
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5543 =
- {0x1148, 0x5543, pci_subsys_1148_4000_1148_5543, 0};
-#undef pci_ss_info_1148_5543
-#define pci_ss_info_1148_5543 pci_ss_info_1148_4000_1148_5543
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5544 =
- {0x1148, 0x5544, pci_subsys_1148_4000_1148_5544, 0};
-#undef pci_ss_info_1148_5544
-#define pci_ss_info_1148_5544 pci_ss_info_1148_4000_1148_5544
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5821 =
- {0x1148, 0x5821, pci_subsys_1148_4000_1148_5821, 0};
-#undef pci_ss_info_1148_5821
-#define pci_ss_info_1148_5821 pci_ss_info_1148_4000_1148_5821
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5822 =
- {0x1148, 0x5822, pci_subsys_1148_4000_1148_5822, 0};
-#undef pci_ss_info_1148_5822
-#define pci_ss_info_1148_5822 pci_ss_info_1148_4000_1148_5822
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5841 =
- {0x1148, 0x5841, pci_subsys_1148_4000_1148_5841, 0};
-#undef pci_ss_info_1148_5841
-#define pci_ss_info_1148_5841 pci_ss_info_1148_4000_1148_5841
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5843 =
- {0x1148, 0x5843, pci_subsys_1148_4000_1148_5843, 0};
-#undef pci_ss_info_1148_5843
-#define pci_ss_info_1148_5843 pci_ss_info_1148_4000_1148_5843
-static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5844 =
- {0x1148, 0x5844, pci_subsys_1148_4000_1148_5844, 0};
-#undef pci_ss_info_1148_5844
-#define pci_ss_info_1148_5844 pci_ss_info_1148_4000_1148_5844
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9821 =
- {0x1148, 0x9821, pci_subsys_1148_4300_1148_9821, 0};
-#undef pci_ss_info_1148_9821
-#define pci_ss_info_1148_9821 pci_ss_info_1148_4300_1148_9821
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9822 =
- {0x1148, 0x9822, pci_subsys_1148_4300_1148_9822, 0};
-#undef pci_ss_info_1148_9822
-#define pci_ss_info_1148_9822 pci_ss_info_1148_4300_1148_9822
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9841 =
- {0x1148, 0x9841, pci_subsys_1148_4300_1148_9841, 0};
-#undef pci_ss_info_1148_9841
-#define pci_ss_info_1148_9841 pci_ss_info_1148_4300_1148_9841
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9842 =
- {0x1148, 0x9842, pci_subsys_1148_4300_1148_9842, 0};
-#undef pci_ss_info_1148_9842
-#define pci_ss_info_1148_9842 pci_ss_info_1148_4300_1148_9842
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9843 =
- {0x1148, 0x9843, pci_subsys_1148_4300_1148_9843, 0};
-#undef pci_ss_info_1148_9843
-#define pci_ss_info_1148_9843 pci_ss_info_1148_4300_1148_9843
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9844 =
- {0x1148, 0x9844, pci_subsys_1148_4300_1148_9844, 0};
-#undef pci_ss_info_1148_9844
-#define pci_ss_info_1148_9844 pci_ss_info_1148_4300_1148_9844
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9861 =
- {0x1148, 0x9861, pci_subsys_1148_4300_1148_9861, 0};
-#undef pci_ss_info_1148_9861
-#define pci_ss_info_1148_9861 pci_ss_info_1148_4300_1148_9861
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9862 =
- {0x1148, 0x9862, pci_subsys_1148_4300_1148_9862, 0};
-#undef pci_ss_info_1148_9862
-#define pci_ss_info_1148_9862 pci_ss_info_1148_4300_1148_9862
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9871 =
- {0x1148, 0x9871, pci_subsys_1148_4300_1148_9871, 0};
-#undef pci_ss_info_1148_9871
-#define pci_ss_info_1148_9871 pci_ss_info_1148_4300_1148_9871
-static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9872 =
- {0x1148, 0x9872, pci_subsys_1148_4300_1148_9872, 0};
-#undef pci_ss_info_1148_9872
-#define pci_ss_info_1148_9872 pci_ss_info_1148_4300_1148_9872
-static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2970 =
- {0x1259, 0x2970, pci_subsys_1148_4300_1259_2970, 0};
-#undef pci_ss_info_1259_2970
-#define pci_ss_info_1259_2970 pci_ss_info_1148_4300_1259_2970
-static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2972 =
- {0x1259, 0x2972, pci_subsys_1148_4300_1259_2972, 0};
-#undef pci_ss_info_1259_2972
-#define pci_ss_info_1259_2972 pci_ss_info_1148_4300_1259_2972
-static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2975 =
- {0x1259, 0x2975, pci_subsys_1148_4300_1259_2975, 0};
-#undef pci_ss_info_1259_2975
-#define pci_ss_info_1259_2975 pci_ss_info_1148_4300_1259_2975
-static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2977 =
- {0x1259, 0x2977, pci_subsys_1148_4300_1259_2977, 0};
-#undef pci_ss_info_1259_2977
-#define pci_ss_info_1259_2977 pci_ss_info_1148_4300_1259_2977
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5021 =
- {0x1148, 0x5021, pci_subsys_1148_4320_1148_5021, 0};
-#undef pci_ss_info_1148_5021
-#define pci_ss_info_1148_5021 pci_ss_info_1148_4320_1148_5021
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5041 =
- {0x1148, 0x5041, pci_subsys_1148_4320_1148_5041, 0};
-#undef pci_ss_info_1148_5041
-#define pci_ss_info_1148_5041 pci_ss_info_1148_4320_1148_5041
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5043 =
- {0x1148, 0x5043, pci_subsys_1148_4320_1148_5043, 0};
-#undef pci_ss_info_1148_5043
-#define pci_ss_info_1148_5043 pci_ss_info_1148_4320_1148_5043
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5051 =
- {0x1148, 0x5051, pci_subsys_1148_4320_1148_5051, 0};
-#undef pci_ss_info_1148_5051
-#define pci_ss_info_1148_5051 pci_ss_info_1148_4320_1148_5051
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5061 =
- {0x1148, 0x5061, pci_subsys_1148_4320_1148_5061, 0};
-#undef pci_ss_info_1148_5061
-#define pci_ss_info_1148_5061 pci_ss_info_1148_4320_1148_5061
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5071 =
- {0x1148, 0x5071, pci_subsys_1148_4320_1148_5071, 0};
-#undef pci_ss_info_1148_5071
-#define pci_ss_info_1148_5071 pci_ss_info_1148_4320_1148_5071
-static const pciSubsystemInfo pci_ss_info_1148_4320_1148_9521 =
- {0x1148, 0x9521, pci_subsys_1148_4320_1148_9521, 0};
-#undef pci_ss_info_1148_9521
-#define pci_ss_info_1148_9521 pci_ss_info_1148_4320_1148_9521
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0050 =
- {0x114f, 0x0050, pci_subsys_114f_001d_114f_0050, 0};
-#undef pci_ss_info_114f_0050
-#define pci_ss_info_114f_0050 pci_ss_info_114f_001d_114f_0050
-static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0051 =
- {0x114f, 0x0051, pci_subsys_114f_001d_114f_0051, 0};
-#undef pci_ss_info_114f_0051
-#define pci_ss_info_114f_0051 pci_ss_info_114f_001d_114f_0051
-static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0052 =
- {0x114f, 0x0052, pci_subsys_114f_001d_114f_0052, 0};
-#undef pci_ss_info_114f_0052
-#define pci_ss_info_114f_0052 pci_ss_info_114f_001d_114f_0052
-static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0053 =
- {0x114f, 0x0053, pci_subsys_114f_001d_114f_0053, 0};
-#undef pci_ss_info_114f_0053
-#define pci_ss_info_114f_0053 pci_ss_info_114f_001d_114f_0053
-static const pciSubsystemInfo pci_ss_info_114f_0024_114f_0030 =
- {0x114f, 0x0030, pci_subsys_114f_0024_114f_0030, 0};
-#undef pci_ss_info_114f_0030
-#define pci_ss_info_114f_0030 pci_ss_info_114f_0024_114f_0030
-static const pciSubsystemInfo pci_ss_info_114f_0024_114f_0031 =
- {0x114f, 0x0031, pci_subsys_114f_0024_114f_0031, 0};
-#undef pci_ss_info_114f_0031
-#define pci_ss_info_114f_0031 pci_ss_info_114f_0024_114f_0031
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_115d_0003_1014_0181 =
- {0x1014, 0x0181, pci_subsys_115d_0003_1014_0181, 0};
-#undef pci_ss_info_1014_0181
-#define pci_ss_info_1014_0181 pci_ss_info_115d_0003_1014_0181
-static const pciSubsystemInfo pci_ss_info_115d_0003_1014_1181 =
- {0x1014, 0x1181, pci_subsys_115d_0003_1014_1181, 0};
-#undef pci_ss_info_1014_1181
-#define pci_ss_info_1014_1181 pci_ss_info_115d_0003_1014_1181
-static const pciSubsystemInfo pci_ss_info_115d_0003_1014_8181 =
- {0x1014, 0x8181, pci_subsys_115d_0003_1014_8181, 0};
-#undef pci_ss_info_1014_8181
-#define pci_ss_info_1014_8181 pci_ss_info_115d_0003_1014_8181
-static const pciSubsystemInfo pci_ss_info_115d_0003_1014_9181 =
- {0x1014, 0x9181, pci_subsys_115d_0003_1014_9181, 0};
-#undef pci_ss_info_1014_9181
-#define pci_ss_info_1014_9181 pci_ss_info_115d_0003_1014_9181
-static const pciSubsystemInfo pci_ss_info_115d_0003_115d_0181 =
- {0x115d, 0x0181, pci_subsys_115d_0003_115d_0181, 0};
-#undef pci_ss_info_115d_0181
-#define pci_ss_info_115d_0181 pci_ss_info_115d_0003_115d_0181
-static const pciSubsystemInfo pci_ss_info_115d_0003_115d_1181 =
- {0x115d, 0x1181, pci_subsys_115d_0003_115d_1181, 0};
-#undef pci_ss_info_115d_1181
-#define pci_ss_info_115d_1181 pci_ss_info_115d_0003_115d_1181
-static const pciSubsystemInfo pci_ss_info_115d_0003_1179_0181 =
- {0x1179, 0x0181, pci_subsys_115d_0003_1179_0181, 0};
-#undef pci_ss_info_1179_0181
-#define pci_ss_info_1179_0181 pci_ss_info_115d_0003_1179_0181
-#endif
-static const pciSubsystemInfo pci_ss_info_115d_0003_8086_8181 =
- {0x8086, 0x8181, pci_subsys_115d_0003_8086_8181, 0};
-#undef pci_ss_info_8086_8181
-#define pci_ss_info_8086_8181 pci_ss_info_115d_0003_8086_8181
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_115d_0003_8086_9181 =
- {0x8086, 0x9181, pci_subsys_115d_0003_8086_9181, 0};
-#undef pci_ss_info_8086_9181
-#define pci_ss_info_8086_9181 pci_ss_info_115d_0003_8086_9181
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_115d_0005_1014_0182 =
- {0x1014, 0x0182, pci_subsys_115d_0005_1014_0182, 0};
-#undef pci_ss_info_1014_0182
-#define pci_ss_info_1014_0182 pci_ss_info_115d_0005_1014_0182
-static const pciSubsystemInfo pci_ss_info_115d_0005_1014_1182 =
- {0x1014, 0x1182, pci_subsys_115d_0005_1014_1182, 0};
-#undef pci_ss_info_1014_1182
-#define pci_ss_info_1014_1182 pci_ss_info_115d_0005_1014_1182
-static const pciSubsystemInfo pci_ss_info_115d_0005_115d_0182 =
- {0x115d, 0x0182, pci_subsys_115d_0005_115d_0182, 0};
-#undef pci_ss_info_115d_0182
-#define pci_ss_info_115d_0182 pci_ss_info_115d_0005_115d_0182
-static const pciSubsystemInfo pci_ss_info_115d_0005_115d_1182 =
- {0x115d, 0x1182, pci_subsys_115d_0005_115d_1182, 0};
-#undef pci_ss_info_115d_1182
-#define pci_ss_info_115d_1182 pci_ss_info_115d_0005_115d_1182
-static const pciSubsystemInfo pci_ss_info_115d_0007_1014_0182 =
- {0x1014, 0x0182, pci_subsys_115d_0007_1014_0182, 0};
-#undef pci_ss_info_1014_0182
-#define pci_ss_info_1014_0182 pci_ss_info_115d_0007_1014_0182
-static const pciSubsystemInfo pci_ss_info_115d_0007_1014_1182 =
- {0x1014, 0x1182, pci_subsys_115d_0007_1014_1182, 0};
-#undef pci_ss_info_1014_1182
-#define pci_ss_info_1014_1182 pci_ss_info_115d_0007_1014_1182
-static const pciSubsystemInfo pci_ss_info_115d_0007_115d_0182 =
- {0x115d, 0x0182, pci_subsys_115d_0007_115d_0182, 0};
-#undef pci_ss_info_115d_0182
-#define pci_ss_info_115d_0182 pci_ss_info_115d_0007_115d_0182
-static const pciSubsystemInfo pci_ss_info_115d_0007_115d_1182 =
- {0x115d, 0x1182, pci_subsys_115d_0007_115d_1182, 0};
-#undef pci_ss_info_115d_1182
-#define pci_ss_info_115d_1182 pci_ss_info_115d_0007_115d_1182
-static const pciSubsystemInfo pci_ss_info_115d_000b_1014_0183 =
- {0x1014, 0x0183, pci_subsys_115d_000b_1014_0183, 0};
-#undef pci_ss_info_1014_0183
-#define pci_ss_info_1014_0183 pci_ss_info_115d_000b_1014_0183
-static const pciSubsystemInfo pci_ss_info_115d_000b_115d_0183 =
- {0x115d, 0x0183, pci_subsys_115d_000b_115d_0183, 0};
-#undef pci_ss_info_115d_0183
-#define pci_ss_info_115d_0183 pci_ss_info_115d_000b_115d_0183
-static const pciSubsystemInfo pci_ss_info_115d_000f_1014_0183 =
- {0x1014, 0x0183, pci_subsys_115d_000f_1014_0183, 0};
-#undef pci_ss_info_1014_0183
-#define pci_ss_info_1014_0183 pci_ss_info_115d_000f_1014_0183
-static const pciSubsystemInfo pci_ss_info_115d_000f_115d_0183 =
- {0x115d, 0x0183, pci_subsys_115d_000f_115d_0183, 0};
-#undef pci_ss_info_115d_0183
-#define pci_ss_info_115d_0183 pci_ss_info_115d_000f_115d_0183
-static const pciSubsystemInfo pci_ss_info_115d_0101_115d_1081 =
- {0x115d, 0x1081, pci_subsys_115d_0101_115d_1081, 0};
-#undef pci_ss_info_115d_1081
-#define pci_ss_info_115d_1081 pci_ss_info_115d_0101_115d_1081
-static const pciSubsystemInfo pci_ss_info_115d_0103_1014_9181 =
- {0x1014, 0x9181, pci_subsys_115d_0103_1014_9181, 0};
-#undef pci_ss_info_1014_9181
-#define pci_ss_info_1014_9181 pci_ss_info_115d_0103_1014_9181
-static const pciSubsystemInfo pci_ss_info_115d_0103_1115_1181 =
- {0x1115, 0x1181, pci_subsys_115d_0103_1115_1181, 0};
-#undef pci_ss_info_1115_1181
-#define pci_ss_info_1115_1181 pci_ss_info_115d_0103_1115_1181
-static const pciSubsystemInfo pci_ss_info_115d_0103_115d_1181 =
- {0x115d, 0x1181, pci_subsys_115d_0103_115d_1181, 0};
-#undef pci_ss_info_115d_1181
-#define pci_ss_info_115d_1181 pci_ss_info_115d_0103_115d_1181
-#endif
-static const pciSubsystemInfo pci_ss_info_115d_0103_8086_9181 =
- {0x8086, 0x9181, pci_subsys_115d_0103_8086_9181, 0};
-#undef pci_ss_info_8086_9181
-#define pci_ss_info_8086_9181 pci_ss_info_115d_0103_8086_9181
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1163_2000_1092_2000 =
- {0x1092, 0x2000, pci_subsys_1163_2000_1092_2000, 0};
-#undef pci_ss_info_1092_2000
-#define pci_ss_info_1092_2000 pci_ss_info_1163_2000_1092_2000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1179_0d01_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1179_0d01_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1179_0d01_1179_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1180_0475_144d_c006 =
- {0x144d, 0xc006, pci_subsys_1180_0475_144d_c006, 0};
-#undef pci_ss_info_144d_c006
-#define pci_ss_info_144d_c006 pci_ss_info_1180_0475_144d_c006
-static const pciSubsystemInfo pci_ss_info_1180_0476_1014_0185 =
- {0x1014, 0x0185, pci_subsys_1180_0476_1014_0185, 0};
-#undef pci_ss_info_1014_0185
-#define pci_ss_info_1014_0185 pci_ss_info_1180_0476_1014_0185
-#endif
-static const pciSubsystemInfo pci_ss_info_1180_0476_104d_80df =
- {0x104d, 0x80df, pci_subsys_1180_0476_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_1180_0476_104d_80df
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1180_0476_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_1180_0476_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_1180_0476_104d_80e7
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1180_0478_1014_0184 =
- {0x1014, 0x0184, pci_subsys_1180_0478_1014_0184, 0};
-#undef pci_ss_info_1014_0184
-#define pci_ss_info_1014_0184 pci_ss_info_1180_0478_1014_0184
-static const pciSubsystemInfo pci_ss_info_1180_0522_1014_01cf =
- {0x1014, 0x01cf, pci_subsys_1180_0522_1014_01cf, 0};
-#undef pci_ss_info_1014_01cf
-#define pci_ss_info_1014_01cf pci_ss_info_1180_0522_1014_01cf
-static const pciSubsystemInfo pci_ss_info_1180_0551_144d_c006 =
- {0x144d, 0xc006, pci_subsys_1180_0551_144d_c006, 0};
-#undef pci_ss_info_144d_c006
-#define pci_ss_info_144d_c006 pci_ss_info_1180_0551_144d_c006
-static const pciSubsystemInfo pci_ss_info_1180_0552_1014_0511 =
- {0x1014, 0x0511, pci_subsys_1180_0552_1014_0511, 0};
-#undef pci_ss_info_1014_0511
-#define pci_ss_info_1014_0511 pci_ss_info_1180_0552_1014_0511
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1186_1002_1186_1002 =
- {0x1186, 0x1002, pci_subsys_1186_1002_1186_1002, 0};
-#undef pci_ss_info_1186_1002
-#define pci_ss_info_1186_1002 pci_ss_info_1186_1002_1186_1002
-static const pciSubsystemInfo pci_ss_info_1186_1002_1186_1012 =
- {0x1186, 0x1012, pci_subsys_1186_1002_1186_1012, 0};
-#undef pci_ss_info_1186_1012
-#define pci_ss_info_1186_1012 pci_ss_info_1186_1002_1186_1012
-static const pciSubsystemInfo pci_ss_info_1186_1300_1186_1300 =
- {0x1186, 0x1300, pci_subsys_1186_1300_1186_1300, 0};
-#undef pci_ss_info_1186_1300
-#define pci_ss_info_1186_1300 pci_ss_info_1186_1300_1186_1300
-static const pciSubsystemInfo pci_ss_info_1186_1300_1186_1301 =
- {0x1186, 0x1301, pci_subsys_1186_1300_1186_1301, 0};
-#undef pci_ss_info_1186_1301
-#define pci_ss_info_1186_1301 pci_ss_info_1186_1300_1186_1301
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_0002 =
- {0x11ad, 0x0002, pci_subsys_11ad_0002_11ad_0002, 0};
-#undef pci_ss_info_11ad_0002
-#define pci_ss_info_11ad_0002 pci_ss_info_11ad_0002_11ad_0002
-static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_0003 =
- {0x11ad, 0x0003, pci_subsys_11ad_0002_11ad_0003, 0};
-#undef pci_ss_info_11ad_0003
-#define pci_ss_info_11ad_0003 pci_ss_info_11ad_0002_11ad_0003
-static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_f003 =
- {0x11ad, 0xf003, pci_subsys_11ad_0002_11ad_f003, 0};
-#undef pci_ss_info_11ad_f003
-#define pci_ss_info_11ad_f003 pci_ss_info_11ad_0002_11ad_f003
-static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_ffff =
- {0x11ad, 0xffff, pci_subsys_11ad_0002_11ad_ffff, 0};
-#undef pci_ss_info_11ad_ffff
-#define pci_ss_info_11ad_ffff pci_ss_info_11ad_0002_11ad_ffff
-static const pciSubsystemInfo pci_ss_info_11ad_0002_1385_f004 =
- {0x1385, 0xf004, pci_subsys_11ad_0002_1385_f004, 0};
-#undef pci_ss_info_1385_f004
-#define pci_ss_info_1385_f004 pci_ss_info_11ad_0002_1385_f004
-static const pciSubsystemInfo pci_ss_info_11ad_c115_11ad_c001 =
- {0x11ad, 0xc001, pci_subsys_11ad_c115_11ad_c001, 0};
-#undef pci_ss_info_11ad_c001
-#define pci_ss_info_11ad_c001 pci_ss_info_11ad_c115_11ad_c001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_8015 =
- {0x1033, 0x8015, pci_subsys_11c1_0440_1033_8015, 0};
-#undef pci_ss_info_1033_8015
-#define pci_ss_info_1033_8015 pci_ss_info_11c1_0440_1033_8015
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_8047 =
- {0x1033, 0x8047, pci_subsys_11c1_0440_1033_8047, 0};
-#undef pci_ss_info_1033_8047
-#define pci_ss_info_1033_8047 pci_ss_info_11c1_0440_1033_8047
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_804f =
- {0x1033, 0x804f, pci_subsys_11c1_0440_1033_804f, 0};
-#undef pci_ss_info_1033_804f
-#define pci_ss_info_1033_804f pci_ss_info_11c1_0440_1033_804f
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_102c =
- {0x10cf, 0x102c, pci_subsys_11c1_0440_10cf_102c, 0};
-#undef pci_ss_info_10cf_102c
-#define pci_ss_info_10cf_102c pci_ss_info_11c1_0440_10cf_102c
-static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_104a =
- {0x10cf, 0x104a, pci_subsys_11c1_0440_10cf_104a, 0};
-#undef pci_ss_info_10cf_104a
-#define pci_ss_info_10cf_104a pci_ss_info_11c1_0440_10cf_104a
-static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_105f =
- {0x10cf, 0x105f, pci_subsys_11c1_0440_10cf_105f, 0};
-#undef pci_ss_info_10cf_105f
-#define pci_ss_info_10cf_105f pci_ss_info_11c1_0440_10cf_105f
-static const pciSubsystemInfo pci_ss_info_11c1_0440_1179_0001 =
- {0x1179, 0x0001, pci_subsys_11c1_0440_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_11c1_0440_1179_0001
-static const pciSubsystemInfo pci_ss_info_11c1_0440_11c1_0440 =
- {0x11c1, 0x0440, pci_subsys_11c1_0440_11c1_0440, 0};
-#undef pci_ss_info_11c1_0440
-#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0440_11c1_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0440_122d_4101 =
- {0x122d, 0x4101, pci_subsys_11c1_0440_122d_4101, 0};
-#undef pci_ss_info_122d_4101
-#define pci_ss_info_122d_4101 pci_ss_info_11c1_0440_122d_4101
-static const pciSubsystemInfo pci_ss_info_11c1_0440_122d_4102 =
- {0x122d, 0x4102, pci_subsys_11c1_0440_122d_4102, 0};
-#undef pci_ss_info_122d_4102
-#define pci_ss_info_122d_4102 pci_ss_info_11c1_0440_122d_4102
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0040 =
- {0x13e0, 0x0040, pci_subsys_11c1_0440_13e0_0040, 0};
-#undef pci_ss_info_13e0_0040
-#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0440_13e0_0040
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0440 =
- {0x13e0, 0x0440, pci_subsys_11c1_0440_13e0_0440, 0};
-#undef pci_ss_info_13e0_0440
-#define pci_ss_info_13e0_0440 pci_ss_info_11c1_0440_13e0_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0441 =
- {0x13e0, 0x0441, pci_subsys_11c1_0440_13e0_0441, 0};
-#undef pci_ss_info_13e0_0441
-#define pci_ss_info_13e0_0441 pci_ss_info_11c1_0440_13e0_0441
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0450 =
- {0x13e0, 0x0450, pci_subsys_11c1_0440_13e0_0450, 0};
-#undef pci_ss_info_13e0_0450
-#define pci_ss_info_13e0_0450 pci_ss_info_11c1_0440_13e0_0450
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_f100 =
- {0x13e0, 0xf100, pci_subsys_11c1_0440_13e0_f100, 0};
-#undef pci_ss_info_13e0_f100
-#define pci_ss_info_13e0_f100 pci_ss_info_11c1_0440_13e0_f100
-static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_f101 =
- {0x13e0, 0xf101, pci_subsys_11c1_0440_13e0_f101, 0};
-#undef pci_ss_info_13e0_f101
-#define pci_ss_info_13e0_f101 pci_ss_info_11c1_0440_13e0_f101
-static const pciSubsystemInfo pci_ss_info_11c1_0440_144d_2101 =
- {0x144d, 0x2101, pci_subsys_11c1_0440_144d_2101, 0};
-#undef pci_ss_info_144d_2101
-#define pci_ss_info_144d_2101 pci_ss_info_11c1_0440_144d_2101
-static const pciSubsystemInfo pci_ss_info_11c1_0440_149f_0440 =
- {0x149f, 0x0440, pci_subsys_11c1_0440_149f_0440, 0};
-#undef pci_ss_info_149f_0440
-#define pci_ss_info_149f_0440 pci_ss_info_11c1_0440_149f_0440
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1033_804d =
- {0x1033, 0x804d, pci_subsys_11c1_0441_1033_804d, 0};
-#undef pci_ss_info_1033_804d
-#define pci_ss_info_1033_804d pci_ss_info_11c1_0441_1033_804d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1033_8065 =
- {0x1033, 0x8065, pci_subsys_11c1_0441_1033_8065, 0};
-#undef pci_ss_info_1033_8065
-#define pci_ss_info_1033_8065 pci_ss_info_11c1_0441_1033_8065
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1092_0440 =
- {0x1092, 0x0440, pci_subsys_11c1_0441_1092_0440, 0};
-#undef pci_ss_info_1092_0440
-#define pci_ss_info_1092_0440 pci_ss_info_11c1_0441_1092_0440
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1179_0001 =
- {0x1179, 0x0001, pci_subsys_11c1_0441_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_11c1_0441_1179_0001
-static const pciSubsystemInfo pci_ss_info_11c1_0441_11c1_0440 =
- {0x11c1, 0x0440, pci_subsys_11c1_0441_11c1_0440, 0};
-#undef pci_ss_info_11c1_0440
-#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0441_11c1_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0441_11c1_0441 =
- {0x11c1, 0x0441, pci_subsys_11c1_0441_11c1_0441, 0};
-#undef pci_ss_info_11c1_0441
-#define pci_ss_info_11c1_0441 pci_ss_info_11c1_0441_11c1_0441
-static const pciSubsystemInfo pci_ss_info_11c1_0441_122d_4100 =
- {0x122d, 0x4100, pci_subsys_11c1_0441_122d_4100, 0};
-#undef pci_ss_info_122d_4100
-#define pci_ss_info_122d_4100 pci_ss_info_11c1_0441_122d_4100
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0040 =
- {0x13e0, 0x0040, pci_subsys_11c1_0441_13e0_0040, 0};
-#undef pci_ss_info_13e0_0040
-#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0441_13e0_0040
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0100 =
- {0x13e0, 0x0100, pci_subsys_11c1_0441_13e0_0100, 0};
-#undef pci_ss_info_13e0_0100
-#define pci_ss_info_13e0_0100 pci_ss_info_11c1_0441_13e0_0100
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0410 =
- {0x13e0, 0x0410, pci_subsys_11c1_0441_13e0_0410, 0};
-#undef pci_ss_info_13e0_0410
-#define pci_ss_info_13e0_0410 pci_ss_info_11c1_0441_13e0_0410
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0420 =
- {0x13e0, 0x0420, pci_subsys_11c1_0441_13e0_0420, 0};
-#undef pci_ss_info_13e0_0420
-#define pci_ss_info_13e0_0420 pci_ss_info_11c1_0441_13e0_0420
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0440 =
- {0x13e0, 0x0440, pci_subsys_11c1_0441_13e0_0440, 0};
-#undef pci_ss_info_13e0_0440
-#define pci_ss_info_13e0_0440 pci_ss_info_11c1_0441_13e0_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0443 =
- {0x13e0, 0x0443, pci_subsys_11c1_0441_13e0_0443, 0};
-#undef pci_ss_info_13e0_0443
-#define pci_ss_info_13e0_0443 pci_ss_info_11c1_0441_13e0_0443
-static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_f102 =
- {0x13e0, 0xf102, pci_subsys_11c1_0441_13e0_f102, 0};
-#undef pci_ss_info_13e0_f102
-#define pci_ss_info_13e0_f102 pci_ss_info_11c1_0441_13e0_f102
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1416_9804 =
- {0x1416, 0x9804, pci_subsys_11c1_0441_1416_9804, 0};
-#undef pci_ss_info_1416_9804
-#define pci_ss_info_1416_9804 pci_ss_info_11c1_0441_1416_9804
-static const pciSubsystemInfo pci_ss_info_11c1_0441_141d_0440 =
- {0x141d, 0x0440, pci_subsys_11c1_0441_141d_0440, 0};
-#undef pci_ss_info_141d_0440
-#define pci_ss_info_141d_0440 pci_ss_info_11c1_0441_141d_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_0441 =
- {0x144f, 0x0441, pci_subsys_11c1_0441_144f_0441, 0};
-#undef pci_ss_info_144f_0441
-#define pci_ss_info_144f_0441 pci_ss_info_11c1_0441_144f_0441
-static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_0449 =
- {0x144f, 0x0449, pci_subsys_11c1_0441_144f_0449, 0};
-#undef pci_ss_info_144f_0449
-#define pci_ss_info_144f_0449 pci_ss_info_11c1_0441_144f_0449
-static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_110d =
- {0x144f, 0x110d, pci_subsys_11c1_0441_144f_110d, 0};
-#undef pci_ss_info_144f_110d
-#define pci_ss_info_144f_110d pci_ss_info_11c1_0441_144f_110d
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1468_0441 =
- {0x1468, 0x0441, pci_subsys_11c1_0441_1468_0441, 0};
-#undef pci_ss_info_1468_0441
-#define pci_ss_info_1468_0441 pci_ss_info_11c1_0441_1468_0441
-static const pciSubsystemInfo pci_ss_info_11c1_0441_1668_0440 =
- {0x1668, 0x0440, pci_subsys_11c1_0441_1668_0440, 0};
-#undef pci_ss_info_1668_0440
-#define pci_ss_info_1668_0440 pci_ss_info_11c1_0441_1668_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0442_11c1_0440 =
- {0x11c1, 0x0440, pci_subsys_11c1_0442_11c1_0440, 0};
-#undef pci_ss_info_11c1_0440
-#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0442_11c1_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0442_11c1_0442 =
- {0x11c1, 0x0442, pci_subsys_11c1_0442_11c1_0442, 0};
-#undef pci_ss_info_11c1_0442
-#define pci_ss_info_11c1_0442 pci_ss_info_11c1_0442_11c1_0442
-static const pciSubsystemInfo pci_ss_info_11c1_0442_13e0_0412 =
- {0x13e0, 0x0412, pci_subsys_11c1_0442_13e0_0412, 0};
-#undef pci_ss_info_13e0_0412
-#define pci_ss_info_13e0_0412 pci_ss_info_11c1_0442_13e0_0412
-static const pciSubsystemInfo pci_ss_info_11c1_0442_13e0_0442 =
- {0x13e0, 0x0442, pci_subsys_11c1_0442_13e0_0442, 0};
-#undef pci_ss_info_13e0_0442
-#define pci_ss_info_13e0_0442 pci_ss_info_11c1_0442_13e0_0442
-static const pciSubsystemInfo pci_ss_info_11c1_0442_13fc_2471 =
- {0x13fc, 0x2471, pci_subsys_11c1_0442_13fc_2471, 0};
-#undef pci_ss_info_13fc_2471
-#define pci_ss_info_13fc_2471 pci_ss_info_11c1_0442_13fc_2471
-static const pciSubsystemInfo pci_ss_info_11c1_0442_144d_2104 =
- {0x144d, 0x2104, pci_subsys_11c1_0442_144d_2104, 0};
-#undef pci_ss_info_144d_2104
-#define pci_ss_info_144d_2104 pci_ss_info_11c1_0442_144d_2104
-static const pciSubsystemInfo pci_ss_info_11c1_0442_144f_1104 =
- {0x144f, 0x1104, pci_subsys_11c1_0442_144f_1104, 0};
-#undef pci_ss_info_144f_1104
-#define pci_ss_info_144f_1104 pci_ss_info_11c1_0442_144f_1104
-static const pciSubsystemInfo pci_ss_info_11c1_0442_149f_0440 =
- {0x149f, 0x0440, pci_subsys_11c1_0442_149f_0440, 0};
-#undef pci_ss_info_149f_0440
-#define pci_ss_info_149f_0440 pci_ss_info_11c1_0442_149f_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0442_1668_0440 =
- {0x1668, 0x0440, pci_subsys_11c1_0442_1668_0440, 0};
-#undef pci_ss_info_1668_0440
-#define pci_ss_info_1668_0440 pci_ss_info_11c1_0442_1668_0440
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0445_8086_2203 =
- {0x8086, 0x2203, pci_subsys_11c1_0445_8086_2203, 0};
-#undef pci_ss_info_8086_2203
-#define pci_ss_info_8086_2203 pci_ss_info_11c1_0445_8086_2203
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11c1_0448_1014_0131 =
- {0x1014, 0x0131, pci_subsys_11c1_0448_1014_0131, 0};
-#undef pci_ss_info_1014_0131
-#define pci_ss_info_1014_0131 pci_ss_info_11c1_0448_1014_0131
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0448_1033_8066 =
- {0x1033, 0x8066, pci_subsys_11c1_0448_1033_8066, 0};
-#undef pci_ss_info_1033_8066
-#define pci_ss_info_1033_8066 pci_ss_info_11c1_0448_1033_8066
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11c1_0448_13e0_0030 =
- {0x13e0, 0x0030, pci_subsys_11c1_0448_13e0_0030, 0};
-#undef pci_ss_info_13e0_0030
-#define pci_ss_info_13e0_0030 pci_ss_info_11c1_0448_13e0_0030
-static const pciSubsystemInfo pci_ss_info_11c1_0448_13e0_0040 =
- {0x13e0, 0x0040, pci_subsys_11c1_0448_13e0_0040, 0};
-#undef pci_ss_info_13e0_0040
-#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0448_13e0_0040
-static const pciSubsystemInfo pci_ss_info_11c1_0448_1668_2400 =
- {0x1668, 0x2400, pci_subsys_11c1_0448_1668_2400, 0};
-#undef pci_ss_info_1668_2400
-#define pci_ss_info_1668_2400 pci_ss_info_11c1_0448_1668_2400
-#endif
-static const pciSubsystemInfo pci_ss_info_11c1_0449_0e11_b14d =
- {0x0e11, 0xb14d, pci_subsys_11c1_0449_0e11_b14d, 0};
-#undef pci_ss_info_0e11_b14d
-#define pci_ss_info_0e11_b14d pci_ss_info_11c1_0449_0e11_b14d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11c1_0449_13e0_0020 =
- {0x13e0, 0x0020, pci_subsys_11c1_0449_13e0_0020, 0};
-#undef pci_ss_info_13e0_0020
-#define pci_ss_info_13e0_0020 pci_ss_info_11c1_0449_13e0_0020
-static const pciSubsystemInfo pci_ss_info_11c1_0449_13e0_0041 =
- {0x13e0, 0x0041, pci_subsys_11c1_0449_13e0_0041, 0};
-#undef pci_ss_info_13e0_0041
-#define pci_ss_info_13e0_0041 pci_ss_info_11c1_0449_13e0_0041
-static const pciSubsystemInfo pci_ss_info_11c1_0449_1436_0440 =
- {0x1436, 0x0440, pci_subsys_11c1_0449_1436_0440, 0};
-#undef pci_ss_info_1436_0440
-#define pci_ss_info_1436_0440 pci_ss_info_11c1_0449_1436_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0449_144f_0449 =
- {0x144f, 0x0449, pci_subsys_11c1_0449_144f_0449, 0};
-#undef pci_ss_info_144f_0449
-#define pci_ss_info_144f_0449 pci_ss_info_11c1_0449_144f_0449
-static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0410 =
- {0x1468, 0x0410, pci_subsys_11c1_0449_1468_0410, 0};
-#undef pci_ss_info_1468_0410
-#define pci_ss_info_1468_0410 pci_ss_info_11c1_0449_1468_0410
-static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0440 =
- {0x1468, 0x0440, pci_subsys_11c1_0449_1468_0440, 0};
-#undef pci_ss_info_1468_0440
-#define pci_ss_info_1468_0440 pci_ss_info_11c1_0449_1468_0440
-static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0449 =
- {0x1468, 0x0449, pci_subsys_11c1_0449_1468_0449, 0};
-#undef pci_ss_info_1468_0449
-#define pci_ss_info_1468_0449 pci_ss_info_11c1_0449_1468_0449
-static const pciSubsystemInfo pci_ss_info_11c1_044a_10cf_1072 =
- {0x10cf, 0x1072, pci_subsys_11c1_044a_10cf_1072, 0};
-#undef pci_ss_info_10cf_1072
-#define pci_ss_info_10cf_1072 pci_ss_info_11c1_044a_10cf_1072
-static const pciSubsystemInfo pci_ss_info_11c1_044a_13e0_0012 =
- {0x13e0, 0x0012, pci_subsys_11c1_044a_13e0_0012, 0};
-#undef pci_ss_info_13e0_0012
-#define pci_ss_info_13e0_0012 pci_ss_info_11c1_044a_13e0_0012
-static const pciSubsystemInfo pci_ss_info_11c1_044a_13e0_0042 =
- {0x13e0, 0x0042, pci_subsys_11c1_044a_13e0_0042, 0};
-#undef pci_ss_info_13e0_0042
-#define pci_ss_info_13e0_0042 pci_ss_info_11c1_044a_13e0_0042
-static const pciSubsystemInfo pci_ss_info_11c1_044a_144f_1005 =
- {0x144f, 0x1005, pci_subsys_11c1_044a_144f_1005, 0};
-#undef pci_ss_info_144f_1005
-#define pci_ss_info_144f_1005 pci_ss_info_11c1_044a_144f_1005
-static const pciSubsystemInfo pci_ss_info_11c1_0450_144f_4005 =
- {0x144f, 0x4005, pci_subsys_11c1_0450_144f_4005, 0};
-#undef pci_ss_info_144f_4005
-#define pci_ss_info_144f_4005 pci_ss_info_11c1_0450_144f_4005
-static const pciSubsystemInfo pci_ss_info_11c1_5811_dead_0800 =
- {0xdead, 0x0800, pci_subsys_11c1_5811_dead_0800, 0};
-#undef pci_ss_info_dead_0800
-#define pci_ss_info_dead_0800 pci_ss_info_11c1_5811_dead_0800
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11cb_2000_11cb_0200 =
- {0x11cb, 0x0200, pci_subsys_11cb_2000_11cb_0200, 0};
-#undef pci_ss_info_11cb_0200
-#define pci_ss_info_11cb_0200 pci_ss_info_11cb_2000_11cb_0200
-static const pciSubsystemInfo pci_ss_info_11cb_2000_11cb_b008 =
- {0x11cb, 0xb008, pci_subsys_11cb_2000_11cb_b008, 0};
-#undef pci_ss_info_11cb_b008
-#define pci_ss_info_11cb_b008 pci_ss_info_11cb_2000_11cb_b008
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11de_6057_1031_7efe =
- {0x1031, 0x7efe, pci_subsys_11de_6057_1031_7efe, 0};
-#undef pci_ss_info_1031_7efe
-#define pci_ss_info_1031_7efe pci_ss_info_11de_6057_1031_7efe
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_11de_6057_1031_fc00 =
- {0x1031, 0xfc00, pci_subsys_11de_6057_1031_fc00, 0};
-#undef pci_ss_info_1031_fc00
-#define pci_ss_info_1031_fc00 pci_ss_info_11de_6057_1031_fc00
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11de_6057_13ca_4231 =
- {0x13ca, 0x4231, pci_subsys_11de_6057_13ca_4231, 0};
-#undef pci_ss_info_13ca_4231
-#define pci_ss_info_13ca_4231 pci_ss_info_11de_6057_13ca_4231
-static const pciSubsystemInfo pci_ss_info_11de_6120_1328_f001 =
- {0x1328, 0xf001, pci_subsys_11de_6120_1328_f001, 0};
-#undef pci_ss_info_1328_f001
-#define pci_ss_info_1328_f001 pci_ss_info_11de_6120_1328_f001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_11f6_2011_11f6_2011 =
- {0x11f6, 0x2011, pci_subsys_11f6_2011_11f6_2011, 0};
-#undef pci_ss_info_11f6_2011
-#define pci_ss_info_11f6_2011 pci_ss_info_11f6_2011_11f6_2011
-static const pciSubsystemInfo pci_ss_info_11f6_2201_11f6_2011 =
- {0x11f6, 0x2011, pci_subsys_11f6_2201_11f6_2011, 0};
-#undef pci_ss_info_11f6_2011
-#define pci_ss_info_11f6_2011 pci_ss_info_11f6_2201_11f6_2011
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9841 =
- {0x1202, 0x9841, pci_subsys_1202_4300_1202_9841, 0};
-#undef pci_ss_info_1202_9841
-#define pci_ss_info_1202_9841 pci_ss_info_1202_4300_1202_9841
-static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9842 =
- {0x1202, 0x9842, pci_subsys_1202_4300_1202_9842, 0};
-#undef pci_ss_info_1202_9842
-#define pci_ss_info_1202_9842 pci_ss_info_1202_4300_1202_9842
-static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9843 =
- {0x1202, 0x9843, pci_subsys_1202_4300_1202_9843, 0};
-#undef pci_ss_info_1202_9843
-#define pci_ss_info_1202_9843 pci_ss_info_1202_4300_1202_9843
-static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9844 =
- {0x1202, 0x9844, pci_subsys_1202_4300_1202_9844, 0};
-#undef pci_ss_info_1202_9844
-#define pci_ss_info_1202_9844 pci_ss_info_1202_4300_1202_9844
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1217_6933_1025_1016 =
- {0x1025, 0x1016, pci_subsys_1217_6933_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_1217_6933_1025_1016
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1217_6972_1179_0001 =
- {0x1179, 0x0001, pci_subsys_1217_6972_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_1217_6972_1179_0001
-#endif
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_0003 =
- {0x1092, 0x0003, pci_subsys_121a_0003_1092_0003, 0};
-#undef pci_ss_info_1092_0003
-#define pci_ss_info_1092_0003 pci_ss_info_121a_0003_1092_0003
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4000 =
- {0x1092, 0x4000, pci_subsys_121a_0003_1092_4000, 0};
-#undef pci_ss_info_1092_4000
-#define pci_ss_info_1092_4000 pci_ss_info_121a_0003_1092_4000
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4002 =
- {0x1092, 0x4002, pci_subsys_121a_0003_1092_4002, 0};
-#undef pci_ss_info_1092_4002
-#define pci_ss_info_1092_4002 pci_ss_info_121a_0003_1092_4002
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4801 =
- {0x1092, 0x4801, pci_subsys_121a_0003_1092_4801, 0};
-#undef pci_ss_info_1092_4801
-#define pci_ss_info_1092_4801 pci_ss_info_121a_0003_1092_4801
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4803 =
- {0x1092, 0x4803, pci_subsys_121a_0003_1092_4803, 0};
-#undef pci_ss_info_1092_4803
-#define pci_ss_info_1092_4803 pci_ss_info_121a_0003_1092_4803
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_8030 =
- {0x1092, 0x8030, pci_subsys_121a_0003_1092_8030, 0};
-#undef pci_ss_info_1092_8030
-#define pci_ss_info_1092_8030 pci_ss_info_121a_0003_1092_8030
-static const pciSubsystemInfo pci_ss_info_121a_0003_1092_8035 =
- {0x1092, 0x8035, pci_subsys_121a_0003_1092_8035, 0};
-#undef pci_ss_info_1092_8035
-#define pci_ss_info_1092_8035 pci_ss_info_121a_0003_1092_8035
-static const pciSubsystemInfo pci_ss_info_121a_0003_10b0_0001 =
- {0x10b0, 0x0001, pci_subsys_121a_0003_10b0_0001, 0};
-#undef pci_ss_info_10b0_0001
-#define pci_ss_info_10b0_0001 pci_ss_info_121a_0003_10b0_0001
-static const pciSubsystemInfo pci_ss_info_121a_0003_1102_1018 =
- {0x1102, 0x1018, pci_subsys_121a_0003_1102_1018, 0};
-#undef pci_ss_info_1102_1018
-#define pci_ss_info_1102_1018 pci_ss_info_121a_0003_1102_1018
-static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0001 =
- {0x121a, 0x0001, pci_subsys_121a_0003_121a_0001, 0};
-#undef pci_ss_info_121a_0001
-#define pci_ss_info_121a_0001 pci_ss_info_121a_0003_121a_0001
-static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0003 =
- {0x121a, 0x0003, pci_subsys_121a_0003_121a_0003, 0};
-#undef pci_ss_info_121a_0003
-#define pci_ss_info_121a_0003 pci_ss_info_121a_0003_121a_0003
-static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0004 =
- {0x121a, 0x0004, pci_subsys_121a_0003_121a_0004, 0};
-#undef pci_ss_info_121a_0004
-#define pci_ss_info_121a_0004 pci_ss_info_121a_0003_121a_0004
-static const pciSubsystemInfo pci_ss_info_121a_0003_139c_0016 =
- {0x139c, 0x0016, pci_subsys_121a_0003_139c_0016, 0};
-#undef pci_ss_info_139c_0016
-#define pci_ss_info_139c_0016 pci_ss_info_121a_0003_139c_0016
-static const pciSubsystemInfo pci_ss_info_121a_0003_139c_0017 =
- {0x139c, 0x0017, pci_subsys_121a_0003_139c_0017, 0};
-#undef pci_ss_info_139c_0017
-#define pci_ss_info_139c_0017 pci_ss_info_121a_0003_139c_0017
-static const pciSubsystemInfo pci_ss_info_121a_0003_14af_0002 =
- {0x14af, 0x0002, pci_subsys_121a_0003_14af_0002, 0};
-#undef pci_ss_info_14af_0002
-#define pci_ss_info_14af_0002 pci_ss_info_121a_0003_14af_0002
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0004 =
- {0x121a, 0x0004, pci_subsys_121a_0005_121a_0004, 0};
-#undef pci_ss_info_121a_0004
-#define pci_ss_info_121a_0004 pci_ss_info_121a_0005_121a_0004
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0030 =
- {0x121a, 0x0030, pci_subsys_121a_0005_121a_0030, 0};
-#undef pci_ss_info_121a_0030
-#define pci_ss_info_121a_0030 pci_ss_info_121a_0005_121a_0030
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0031 =
- {0x121a, 0x0031, pci_subsys_121a_0005_121a_0031, 0};
-#undef pci_ss_info_121a_0031
-#define pci_ss_info_121a_0031 pci_ss_info_121a_0005_121a_0031
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0034 =
- {0x121a, 0x0034, pci_subsys_121a_0005_121a_0034, 0};
-#undef pci_ss_info_121a_0034
-#define pci_ss_info_121a_0034 pci_ss_info_121a_0005_121a_0034
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0036 =
- {0x121a, 0x0036, pci_subsys_121a_0005_121a_0036, 0};
-#undef pci_ss_info_121a_0036
-#define pci_ss_info_121a_0036 pci_ss_info_121a_0005_121a_0036
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0037 =
- {0x121a, 0x0037, pci_subsys_121a_0005_121a_0037, 0};
-#undef pci_ss_info_121a_0037
-#define pci_ss_info_121a_0037 pci_ss_info_121a_0005_121a_0037
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0038 =
- {0x121a, 0x0038, pci_subsys_121a_0005_121a_0038, 0};
-#undef pci_ss_info_121a_0038
-#define pci_ss_info_121a_0038 pci_ss_info_121a_0005_121a_0038
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_003a =
- {0x121a, 0x003a, pci_subsys_121a_0005_121a_003a, 0};
-#undef pci_ss_info_121a_003a
-#define pci_ss_info_121a_003a pci_ss_info_121a_0005_121a_003a
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0044 =
- {0x121a, 0x0044, pci_subsys_121a_0005_121a_0044, 0};
-#undef pci_ss_info_121a_0044
-#define pci_ss_info_121a_0044 pci_ss_info_121a_0005_121a_0044
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004b =
- {0x121a, 0x004b, pci_subsys_121a_0005_121a_004b, 0};
-#undef pci_ss_info_121a_004b
-#define pci_ss_info_121a_004b pci_ss_info_121a_0005_121a_004b
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004c =
- {0x121a, 0x004c, pci_subsys_121a_0005_121a_004c, 0};
-#undef pci_ss_info_121a_004c
-#define pci_ss_info_121a_004c pci_ss_info_121a_0005_121a_004c
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004d =
- {0x121a, 0x004d, pci_subsys_121a_0005_121a_004d, 0};
-#undef pci_ss_info_121a_004d
-#define pci_ss_info_121a_004d pci_ss_info_121a_0005_121a_004d
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004e =
- {0x121a, 0x004e, pci_subsys_121a_0005_121a_004e, 0};
-#undef pci_ss_info_121a_004e
-#define pci_ss_info_121a_004e pci_ss_info_121a_0005_121a_004e
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0051 =
- {0x121a, 0x0051, pci_subsys_121a_0005_121a_0051, 0};
-#undef pci_ss_info_121a_0051
-#define pci_ss_info_121a_0051 pci_ss_info_121a_0005_121a_0051
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0052 =
- {0x121a, 0x0052, pci_subsys_121a_0005_121a_0052, 0};
-#undef pci_ss_info_121a_0052
-#define pci_ss_info_121a_0052 pci_ss_info_121a_0005_121a_0052
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0060 =
- {0x121a, 0x0060, pci_subsys_121a_0005_121a_0060, 0};
-#undef pci_ss_info_121a_0060
-#define pci_ss_info_121a_0060 pci_ss_info_121a_0005_121a_0060
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0061 =
- {0x121a, 0x0061, pci_subsys_121a_0005_121a_0061, 0};
-#undef pci_ss_info_121a_0061
-#define pci_ss_info_121a_0061 pci_ss_info_121a_0005_121a_0061
-static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0062 =
- {0x121a, 0x0062, pci_subsys_121a_0005_121a_0062, 0};
-#undef pci_ss_info_121a_0062
-#define pci_ss_info_121a_0062 pci_ss_info_121a_0005_121a_0062
-static const pciSubsystemInfo pci_ss_info_121a_0009_121a_0009 =
- {0x121a, 0x0009, pci_subsys_121a_0009_121a_0009, 0};
-#undef pci_ss_info_121a_0009
-#define pci_ss_info_121a_0009 pci_ss_info_121a_0009_121a_0009
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_122d_50dc_122d_0001 =
- {0x122d, 0x0001, pci_subsys_122d_50dc_122d_0001, 0};
-#undef pci_ss_info_122d_0001
-#define pci_ss_info_122d_0001 pci_ss_info_122d_50dc_122d_0001
-static const pciSubsystemInfo pci_ss_info_122d_80da_122d_0001 =
- {0x122d, 0x0001, pci_subsys_122d_80da_122d_0001, 0};
-#undef pci_ss_info_122d_0001
-#define pci_ss_info_122d_0001 pci_ss_info_122d_80da_122d_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_123f_8120_11bd_0006 =
- {0x11bd, 0x0006, pci_subsys_123f_8120_11bd_0006, 0};
-#undef pci_ss_info_11bd_0006
-#define pci_ss_info_11bd_0006 pci_ss_info_123f_8120_11bd_0006
-static const pciSubsystemInfo pci_ss_info_123f_8120_11bd_000a =
- {0x11bd, 0x000a, pci_subsys_123f_8120_11bd_000a, 0};
-#undef pci_ss_info_11bd_000a
-#define pci_ss_info_11bd_000a pci_ss_info_123f_8120_11bd_000a
-#endif
-static const pciSubsystemInfo pci_ss_info_123f_8888_1002_0001 =
- {0x1002, 0x0001, pci_subsys_123f_8888_1002_0001, 0};
-#undef pci_ss_info_1002_0001
-#define pci_ss_info_1002_0001 pci_ss_info_123f_8888_1002_0001
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_123f_8888_1002_0002 =
- {0x1002, 0x0002, pci_subsys_123f_8888_1002_0002, 0};
-#undef pci_ss_info_1002_0002
-#define pci_ss_info_1002_0002 pci_ss_info_123f_8888_1002_0002
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_123f_8888_1328_0001 =
- {0x1328, 0x0001, pci_subsys_123f_8888_1328_0001, 0};
-#undef pci_ss_info_1328_0001
-#define pci_ss_info_1328_0001 pci_ss_info_123f_8888_1328_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1242_1560_1242_6562 =
- {0x1242, 0x6562, pci_subsys_1242_1560_1242_6562, 0};
-#undef pci_ss_info_1242_6562
-#define pci_ss_info_1242_6562 pci_ss_info_1242_1560_1242_6562
-static const pciSubsystemInfo pci_ss_info_1242_1560_1242_656a =
- {0x1242, 0x656a, pci_subsys_1242_1560_1242_656a, 0};
-#undef pci_ss_info_1242_656a
-#define pci_ss_info_1242_656a pci_ss_info_1242_1560_1242_656a
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1244_0a00_1244_0a00 =
- {0x1244, 0x0a00, pci_subsys_1244_0a00_1244_0a00, 0};
-#undef pci_ss_info_1244_0a00
-#define pci_ss_info_1244_0a00 pci_ss_info_1244_0a00_1244_0a00
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_124b_0040_124b_9080 =
- {0x124b, 0x9080, pci_subsys_124b_0040_124b_9080, 0};
-#undef pci_ss_info_124b_9080
-#define pci_ss_info_124b_9080 pci_ss_info_124b_0040_124b_9080
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1968_1028_0085 =
- {0x1028, 0x0085, pci_subsys_125d_1968_1028_0085, 0};
-#undef pci_ss_info_1028_0085
-#define pci_ss_info_1028_0085 pci_ss_info_125d_1968_1028_0085
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1968_1033_8051 =
- {0x1033, 0x8051, pci_subsys_125d_1968_1033_8051, 0};
-#undef pci_ss_info_1033_8051
-#define pci_ss_info_1033_8051 pci_ss_info_125d_1968_1033_8051
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_125d_1969_1014_0166 =
- {0x1014, 0x0166, pci_subsys_125d_1969_1014_0166, 0};
-#undef pci_ss_info_1014_0166
-#define pci_ss_info_1014_0166 pci_ss_info_125d_1969_1014_0166
-static const pciSubsystemInfo pci_ss_info_125d_1969_125d_8888 =
- {0x125d, 0x8888, pci_subsys_125d_1969_125d_8888, 0};
-#undef pci_ss_info_125d_8888
-#define pci_ss_info_125d_8888 pci_ss_info_125d_1969_125d_8888
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1978_0e11_b112 =
- {0x0e11, 0xb112, pci_subsys_125d_1978_0e11_b112, 0};
-#undef pci_ss_info_0e11_b112
-#define pci_ss_info_0e11_b112 pci_ss_info_125d_1978_0e11_b112
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1978_1033_803c =
- {0x1033, 0x803c, pci_subsys_125d_1978_1033_803c, 0};
-#undef pci_ss_info_1033_803c
-#define pci_ss_info_1033_803c pci_ss_info_125d_1978_1033_803c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1978_1033_8058 =
- {0x1033, 0x8058, pci_subsys_125d_1978_1033_8058, 0};
-#undef pci_ss_info_1033_8058
-#define pci_ss_info_1033_8058 pci_ss_info_125d_1978_1033_8058
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1978_1092_4000 =
- {0x1092, 0x4000, pci_subsys_125d_1978_1092_4000, 0};
-#undef pci_ss_info_1092_4000
-#define pci_ss_info_1092_4000 pci_ss_info_125d_1978_1092_4000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_125d_1978_1179_0001 =
- {0x1179, 0x0001, pci_subsys_125d_1978_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_125d_1978_1179_0001
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1988_1092_4100 =
- {0x1092, 0x4100, pci_subsys_125d_1988_1092_4100, 0};
-#undef pci_ss_info_1092_4100
-#define pci_ss_info_1092_4100 pci_ss_info_125d_1988_1092_4100
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_125d_1988_125d_1988 =
- {0x125d, 0x1988, pci_subsys_125d_1988_125d_1988, 0};
-#undef pci_ss_info_125d_1988
-#define pci_ss_info_125d_1988 pci_ss_info_125d_1988_125d_1988
-static const pciSubsystemInfo pci_ss_info_125d_1989_125d_1989 =
- {0x125d, 0x1989, pci_subsys_125d_1989_125d_1989, 0};
-#undef pci_ss_info_125d_1989
-#define pci_ss_info_125d_1989 pci_ss_info_125d_1989_125d_1989
-#endif
-static const pciSubsystemInfo pci_ss_info_125d_1998_1028_00e6 =
- {0x1028, 0x00e6, pci_subsys_125d_1998_1028_00e6, 0};
-#undef pci_ss_info_1028_00e6
-#define pci_ss_info_1028_00e6 pci_ss_info_125d_1998_1028_00e6
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0424 =
- {0x125d, 0x0424, pci_subsys_125d_2898_125d_0424, 0};
-#undef pci_ss_info_125d_0424
-#define pci_ss_info_125d_0424 pci_ss_info_125d_2898_125d_0424
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0425 =
- {0x125d, 0x0425, pci_subsys_125d_2898_125d_0425, 0};
-#undef pci_ss_info_125d_0425
-#define pci_ss_info_125d_0425 pci_ss_info_125d_2898_125d_0425
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0426 =
- {0x125d, 0x0426, pci_subsys_125d_2898_125d_0426, 0};
-#undef pci_ss_info_125d_0426
-#define pci_ss_info_125d_0426 pci_ss_info_125d_2898_125d_0426
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0427 =
- {0x125d, 0x0427, pci_subsys_125d_2898_125d_0427, 0};
-#undef pci_ss_info_125d_0427
-#define pci_ss_info_125d_0427 pci_ss_info_125d_2898_125d_0427
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0428 =
- {0x125d, 0x0428, pci_subsys_125d_2898_125d_0428, 0};
-#undef pci_ss_info_125d_0428
-#define pci_ss_info_125d_0428 pci_ss_info_125d_2898_125d_0428
-static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0429 =
- {0x125d, 0x0429, pci_subsys_125d_2898_125d_0429, 0};
-#undef pci_ss_info_125d_0429
-#define pci_ss_info_125d_0429 pci_ss_info_125d_2898_125d_0429
-static const pciSubsystemInfo pci_ss_info_125d_2898_147a_c001 =
- {0x147a, 0xc001, pci_subsys_125d_2898_147a_c001, 0};
-#undef pci_ss_info_147a_c001
-#define pci_ss_info_147a_c001 pci_ss_info_125d_2898_147a_c001
-static const pciSubsystemInfo pci_ss_info_125d_2898_14fe_0428 =
- {0x14fe, 0x0428, pci_subsys_125d_2898_14fe_0428, 0};
-#undef pci_ss_info_14fe_0428
-#define pci_ss_info_14fe_0428 pci_ss_info_125d_2898_14fe_0428
-static const pciSubsystemInfo pci_ss_info_125d_2898_14fe_0429 =
- {0x14fe, 0x0429, pci_subsys_125d_2898_14fe_0429, 0};
-#undef pci_ss_info_14fe_0429
-#define pci_ss_info_14fe_0429 pci_ss_info_125d_2898_14fe_0429
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1260_3873_1186_3501 =
- {0x1186, 0x3501, pci_subsys_1260_3873_1186_3501, 0};
-#undef pci_ss_info_1186_3501
-#define pci_ss_info_1186_3501 pci_ss_info_1260_3873_1186_3501
-static const pciSubsystemInfo pci_ss_info_1260_3873_1668_0414 =
- {0x1668, 0x0414, pci_subsys_1260_3873_1668_0414, 0};
-#undef pci_ss_info_1668_0414
-#define pci_ss_info_1668_0414 pci_ss_info_1260_3873_1668_0414
-static const pciSubsystemInfo pci_ss_info_1260_3873_1737_3874 =
- {0x1737, 0x3874, pci_subsys_1260_3873_1737_3874, 0};
-#undef pci_ss_info_1737_3874
-#define pci_ss_info_1737_3874 pci_ss_info_1260_3873_1737_3874
-#endif
-static const pciSubsystemInfo pci_ss_info_1260_3873_8086_2513 =
- {0x8086, 0x2513, pci_subsys_1260_3873_8086_2513, 0};
-#undef pci_ss_info_8086_2513
-#define pci_ss_info_8086_2513 pci_ss_info_1260_3873_8086_2513
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1266_1910_1266_1910 =
- {0x1266, 0x1910, pci_subsys_1266_1910_1266_1910, 0};
-#undef pci_ss_info_1266_1910
-#define pci_ss_info_1266_1910 pci_ss_info_1266_1910_1266_1910
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_0e11_0024 =
- {0x0e11, 0x0024, pci_subsys_1274_1371_0e11_0024, 0};
-#undef pci_ss_info_0e11_0024
-#define pci_ss_info_0e11_0024 pci_ss_info_1274_1371_0e11_0024
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_0e11_b1a7 =
- {0x0e11, 0xb1a7, pci_subsys_1274_1371_0e11_b1a7, 0};
-#undef pci_ss_info_0e11_b1a7
-#define pci_ss_info_0e11_b1a7 pci_ss_info_1274_1371_0e11_b1a7
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_1033_80ac =
- {0x1033, 0x80ac, pci_subsys_1274_1371_1033_80ac, 0};
-#undef pci_ss_info_1033_80ac
-#define pci_ss_info_1033_80ac pci_ss_info_1274_1371_1033_80ac
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1274_1371_1042_1854 =
- {0x1042, 0x1854, pci_subsys_1274_1371_1042_1854, 0};
-#undef pci_ss_info_1042_1854
-#define pci_ss_info_1042_1854 pci_ss_info_1274_1371_1042_1854
-static const pciSubsystemInfo pci_ss_info_1274_1371_107b_8054 =
- {0x107b, 0x8054, pci_subsys_1274_1371_107b_8054, 0};
-#undef pci_ss_info_107b_8054
-#define pci_ss_info_107b_8054 pci_ss_info_1274_1371_107b_8054
-static const pciSubsystemInfo pci_ss_info_1274_1371_1274_1371 =
- {0x1274, 0x1371, pci_subsys_1274_1371_1274_1371, 0};
-#undef pci_ss_info_1274_1371
-#define pci_ss_info_1274_1371 pci_ss_info_1274_1371_1274_1371
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6470 =
- {0x1462, 0x6470, pci_subsys_1274_1371_1462_6470, 0};
-#undef pci_ss_info_1462_6470
-#define pci_ss_info_1462_6470 pci_ss_info_1274_1371_1462_6470
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6560 =
- {0x1462, 0x6560, pci_subsys_1274_1371_1462_6560, 0};
-#undef pci_ss_info_1462_6560
-#define pci_ss_info_1462_6560 pci_ss_info_1274_1371_1462_6560
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6630 =
- {0x1462, 0x6630, pci_subsys_1274_1371_1462_6630, 0};
-#undef pci_ss_info_1462_6630
-#define pci_ss_info_1462_6630 pci_ss_info_1274_1371_1462_6630
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6631 =
- {0x1462, 0x6631, pci_subsys_1274_1371_1462_6631, 0};
-#undef pci_ss_info_1462_6631
-#define pci_ss_info_1462_6631 pci_ss_info_1274_1371_1462_6631
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6632 =
- {0x1462, 0x6632, pci_subsys_1274_1371_1462_6632, 0};
-#undef pci_ss_info_1462_6632
-#define pci_ss_info_1462_6632 pci_ss_info_1274_1371_1462_6632
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6633 =
- {0x1462, 0x6633, pci_subsys_1274_1371_1462_6633, 0};
-#undef pci_ss_info_1462_6633
-#define pci_ss_info_1462_6633 pci_ss_info_1274_1371_1462_6633
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6820 =
- {0x1462, 0x6820, pci_subsys_1274_1371_1462_6820, 0};
-#undef pci_ss_info_1462_6820
-#define pci_ss_info_1462_6820 pci_ss_info_1274_1371_1462_6820
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6822 =
- {0x1462, 0x6822, pci_subsys_1274_1371_1462_6822, 0};
-#undef pci_ss_info_1462_6822
-#define pci_ss_info_1462_6822 pci_ss_info_1274_1371_1462_6822
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6830 =
- {0x1462, 0x6830, pci_subsys_1274_1371_1462_6830, 0};
-#undef pci_ss_info_1462_6830
-#define pci_ss_info_1462_6830 pci_ss_info_1274_1371_1462_6830
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6880 =
- {0x1462, 0x6880, pci_subsys_1274_1371_1462_6880, 0};
-#undef pci_ss_info_1462_6880
-#define pci_ss_info_1462_6880 pci_ss_info_1274_1371_1462_6880
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6900 =
- {0x1462, 0x6900, pci_subsys_1274_1371_1462_6900, 0};
-#undef pci_ss_info_1462_6900
-#define pci_ss_info_1462_6900 pci_ss_info_1274_1371_1462_6900
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6910 =
- {0x1462, 0x6910, pci_subsys_1274_1371_1462_6910, 0};
-#undef pci_ss_info_1462_6910
-#define pci_ss_info_1462_6910 pci_ss_info_1274_1371_1462_6910
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6930 =
- {0x1462, 0x6930, pci_subsys_1274_1371_1462_6930, 0};
-#undef pci_ss_info_1462_6930
-#define pci_ss_info_1462_6930 pci_ss_info_1274_1371_1462_6930
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6990 =
- {0x1462, 0x6990, pci_subsys_1274_1371_1462_6990, 0};
-#undef pci_ss_info_1462_6990
-#define pci_ss_info_1462_6990 pci_ss_info_1274_1371_1462_6990
-static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6991 =
- {0x1462, 0x6991, pci_subsys_1274_1371_1462_6991, 0};
-#undef pci_ss_info_1462_6991
-#define pci_ss_info_1462_6991 pci_ss_info_1274_1371_1462_6991
-static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2077 =
- {0x14a4, 0x2077, pci_subsys_1274_1371_14a4_2077, 0};
-#undef pci_ss_info_14a4_2077
-#define pci_ss_info_14a4_2077 pci_ss_info_1274_1371_14a4_2077
-static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2105 =
- {0x14a4, 0x2105, pci_subsys_1274_1371_14a4_2105, 0};
-#undef pci_ss_info_14a4_2105
-#define pci_ss_info_14a4_2105 pci_ss_info_1274_1371_14a4_2105
-static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2107 =
- {0x14a4, 0x2107, pci_subsys_1274_1371_14a4_2107, 0};
-#undef pci_ss_info_14a4_2107
-#define pci_ss_info_14a4_2107 pci_ss_info_1274_1371_14a4_2107
-static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2172 =
- {0x14a4, 0x2172, pci_subsys_1274_1371_14a4_2172, 0};
-#undef pci_ss_info_14a4_2172
-#define pci_ss_info_14a4_2172 pci_ss_info_1274_1371_14a4_2172
-static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9902 =
- {0x1509, 0x9902, pci_subsys_1274_1371_1509_9902, 0};
-#undef pci_ss_info_1509_9902
-#define pci_ss_info_1509_9902 pci_ss_info_1274_1371_1509_9902
-static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9903 =
- {0x1509, 0x9903, pci_subsys_1274_1371_1509_9903, 0};
-#undef pci_ss_info_1509_9903
-#define pci_ss_info_1509_9903 pci_ss_info_1274_1371_1509_9903
-static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9904 =
- {0x1509, 0x9904, pci_subsys_1274_1371_1509_9904, 0};
-#undef pci_ss_info_1509_9904
-#define pci_ss_info_1509_9904 pci_ss_info_1274_1371_1509_9904
-static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9905 =
- {0x1509, 0x9905, pci_subsys_1274_1371_1509_9905, 0};
-#undef pci_ss_info_1509_9905
-#define pci_ss_info_1509_9905 pci_ss_info_1274_1371_1509_9905
-static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8801 =
- {0x152d, 0x8801, pci_subsys_1274_1371_152d_8801, 0};
-#undef pci_ss_info_152d_8801
-#define pci_ss_info_152d_8801 pci_ss_info_1274_1371_152d_8801
-static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8802 =
- {0x152d, 0x8802, pci_subsys_1274_1371_152d_8802, 0};
-#undef pci_ss_info_152d_8802
-#define pci_ss_info_152d_8802 pci_ss_info_1274_1371_152d_8802
-static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8803 =
- {0x152d, 0x8803, pci_subsys_1274_1371_152d_8803, 0};
-#undef pci_ss_info_152d_8803
-#define pci_ss_info_152d_8803 pci_ss_info_1274_1371_152d_8803
-static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8804 =
- {0x152d, 0x8804, pci_subsys_1274_1371_152d_8804, 0};
-#undef pci_ss_info_152d_8804
-#define pci_ss_info_152d_8804 pci_ss_info_1274_1371_152d_8804
-static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8805 =
- {0x152d, 0x8805, pci_subsys_1274_1371_152d_8805, 0};
-#undef pci_ss_info_152d_8805
-#define pci_ss_info_152d_8805 pci_ss_info_1274_1371_152d_8805
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_2001 =
- {0x270f, 0x2001, pci_subsys_1274_1371_270f_2001, 0};
-#undef pci_ss_info_270f_2001
-#define pci_ss_info_270f_2001 pci_ss_info_1274_1371_270f_2001
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_2200 =
- {0x270f, 0x2200, pci_subsys_1274_1371_270f_2200, 0};
-#undef pci_ss_info_270f_2200
-#define pci_ss_info_270f_2200 pci_ss_info_1274_1371_270f_2200
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3000 =
- {0x270f, 0x3000, pci_subsys_1274_1371_270f_3000, 0};
-#undef pci_ss_info_270f_3000
-#define pci_ss_info_270f_3000 pci_ss_info_1274_1371_270f_3000
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3100 =
- {0x270f, 0x3100, pci_subsys_1274_1371_270f_3100, 0};
-#undef pci_ss_info_270f_3100
-#define pci_ss_info_270f_3100 pci_ss_info_1274_1371_270f_3100
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3102 =
- {0x270f, 0x3102, pci_subsys_1274_1371_270f_3102, 0};
-#undef pci_ss_info_270f_3102
-#define pci_ss_info_270f_3102 pci_ss_info_1274_1371_270f_3102
-static const pciSubsystemInfo pci_ss_info_1274_1371_270f_7060 =
- {0x270f, 0x7060, pci_subsys_1274_1371_270f_7060, 0};
-#undef pci_ss_info_270f_7060
-#define pci_ss_info_270f_7060 pci_ss_info_1274_1371_270f_7060
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4249 =
- {0x8086, 0x4249, pci_subsys_1274_1371_8086_4249, 0};
-#undef pci_ss_info_8086_4249
-#define pci_ss_info_8086_4249 pci_ss_info_1274_1371_8086_4249
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_424c =
- {0x8086, 0x424c, pci_subsys_1274_1371_8086_424c, 0};
-#undef pci_ss_info_8086_424c
-#define pci_ss_info_8086_424c pci_ss_info_1274_1371_8086_424c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_425a =
- {0x8086, 0x425a, pci_subsys_1274_1371_8086_425a, 0};
-#undef pci_ss_info_8086_425a
-#define pci_ss_info_8086_425a pci_ss_info_1274_1371_8086_425a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4341 =
- {0x8086, 0x4341, pci_subsys_1274_1371_8086_4341, 0};
-#undef pci_ss_info_8086_4341
-#define pci_ss_info_8086_4341 pci_ss_info_1274_1371_8086_4341
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4343 =
- {0x8086, 0x4343, pci_subsys_1274_1371_8086_4343, 0};
-#undef pci_ss_info_8086_4343
-#define pci_ss_info_8086_4343 pci_ss_info_1274_1371_8086_4343
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4649 =
- {0x8086, 0x4649, pci_subsys_1274_1371_8086_4649, 0};
-#undef pci_ss_info_8086_4649
-#define pci_ss_info_8086_4649 pci_ss_info_1274_1371_8086_4649
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_464a =
- {0x8086, 0x464a, pci_subsys_1274_1371_8086_464a, 0};
-#undef pci_ss_info_8086_464a
-#define pci_ss_info_8086_464a pci_ss_info_1274_1371_8086_464a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4d4f =
- {0x8086, 0x4d4f, pci_subsys_1274_1371_8086_4d4f, 0};
-#undef pci_ss_info_8086_4d4f
-#define pci_ss_info_8086_4d4f pci_ss_info_1274_1371_8086_4d4f
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4f43 =
- {0x8086, 0x4f43, pci_subsys_1274_1371_8086_4f43, 0};
-#undef pci_ss_info_8086_4f43
-#define pci_ss_info_8086_4f43 pci_ss_info_1274_1371_8086_4f43
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5243 =
- {0x8086, 0x5243, pci_subsys_1274_1371_8086_5243, 0};
-#undef pci_ss_info_8086_5243
-#define pci_ss_info_8086_5243 pci_ss_info_1274_1371_8086_5243
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5352 =
- {0x8086, 0x5352, pci_subsys_1274_1371_8086_5352, 0};
-#undef pci_ss_info_8086_5352
-#define pci_ss_info_8086_5352 pci_ss_info_1274_1371_8086_5352
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5643 =
- {0x8086, 0x5643, pci_subsys_1274_1371_8086_5643, 0};
-#undef pci_ss_info_8086_5643
-#define pci_ss_info_8086_5643 pci_ss_info_1274_1371_8086_5643
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5753 =
- {0x8086, 0x5753, pci_subsys_1274_1371_8086_5753, 0};
-#undef pci_ss_info_8086_5753
-#define pci_ss_info_8086_5753 pci_ss_info_1274_1371_8086_5753
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1274_5880_1274_2000 =
- {0x1274, 0x2000, pci_subsys_1274_5880_1274_2000, 0};
-#undef pci_ss_info_1274_2000
-#define pci_ss_info_1274_2000 pci_ss_info_1274_5880_1274_2000
-static const pciSubsystemInfo pci_ss_info_1274_5880_1274_2003 =
- {0x1274, 0x2003, pci_subsys_1274_5880_1274_2003, 0};
-#undef pci_ss_info_1274_2003
-#define pci_ss_info_1274_2003 pci_ss_info_1274_5880_1274_2003
-static const pciSubsystemInfo pci_ss_info_1274_5880_1274_5880 =
- {0x1274, 0x5880, pci_subsys_1274_5880_1274_5880, 0};
-#undef pci_ss_info_1274_5880
-#define pci_ss_info_1274_5880 pci_ss_info_1274_5880_1274_5880
-static const pciSubsystemInfo pci_ss_info_1274_5880_1458_a000 =
- {0x1458, 0xa000, pci_subsys_1274_5880_1458_a000, 0};
-#undef pci_ss_info_1458_a000
-#define pci_ss_info_1458_a000 pci_ss_info_1274_5880_1458_a000
-static const pciSubsystemInfo pci_ss_info_1274_5880_1462_6880 =
- {0x1462, 0x6880, pci_subsys_1274_5880_1462_6880, 0};
-#undef pci_ss_info_1462_6880
-#define pci_ss_info_1462_6880 pci_ss_info_1274_5880_1462_6880
-static const pciSubsystemInfo pci_ss_info_1274_5880_270f_2001 =
- {0x270f, 0x2001, pci_subsys_1274_5880_270f_2001, 0};
-#undef pci_ss_info_270f_2001
-#define pci_ss_info_270f_2001 pci_ss_info_1274_5880_270f_2001
-static const pciSubsystemInfo pci_ss_info_1274_5880_270f_2200 =
- {0x270f, 0x2200, pci_subsys_1274_5880_270f_2200, 0};
-#undef pci_ss_info_270f_2200
-#define pci_ss_info_270f_2200 pci_ss_info_1274_5880_270f_2200
-static const pciSubsystemInfo pci_ss_info_1274_5880_270f_7040 =
- {0x270f, 0x7040, pci_subsys_1274_5880_270f_7040, 0};
-#undef pci_ss_info_270f_7040
-#define pci_ss_info_270f_7040 pci_ss_info_1274_5880_270f_7040
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1002_1092_094c =
- {0x1092, 0x094c, pci_subsys_127a_1002_1092_094c, 0};
-#undef pci_ss_info_1092_094c
-#define pci_ss_info_1092_094c pci_ss_info_127a_1002_1092_094c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4002 =
- {0x122d, 0x4002, pci_subsys_127a_1002_122d_4002, 0};
-#undef pci_ss_info_122d_4002
-#define pci_ss_info_122d_4002 pci_ss_info_127a_1002_122d_4002
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4005 =
- {0x122d, 0x4005, pci_subsys_127a_1002_122d_4005, 0};
-#undef pci_ss_info_122d_4005
-#define pci_ss_info_122d_4005 pci_ss_info_127a_1002_122d_4005
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4007 =
- {0x122d, 0x4007, pci_subsys_127a_1002_122d_4007, 0};
-#undef pci_ss_info_122d_4007
-#define pci_ss_info_122d_4007 pci_ss_info_127a_1002_122d_4007
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4012 =
- {0x122d, 0x4012, pci_subsys_127a_1002_122d_4012, 0};
-#undef pci_ss_info_122d_4012
-#define pci_ss_info_122d_4012 pci_ss_info_127a_1002_122d_4012
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4017 =
- {0x122d, 0x4017, pci_subsys_127a_1002_122d_4017, 0};
-#undef pci_ss_info_122d_4017
-#define pci_ss_info_122d_4017 pci_ss_info_127a_1002_122d_4017
-static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4018 =
- {0x122d, 0x4018, pci_subsys_127a_1002_122d_4018, 0};
-#undef pci_ss_info_122d_4018
-#define pci_ss_info_122d_4018 pci_ss_info_127a_1002_122d_4018
-static const pciSubsystemInfo pci_ss_info_127a_1002_127a_1002 =
- {0x127a, 0x1002, pci_subsys_127a_1002_127a_1002, 0};
-#undef pci_ss_info_127a_1002
-#define pci_ss_info_127a_1002 pci_ss_info_127a_1002_127a_1002
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1003_0e11_b0bc =
- {0x0e11, 0xb0bc, pci_subsys_127a_1003_0e11_b0bc, 0};
-#undef pci_ss_info_0e11_b0bc
-#define pci_ss_info_0e11_b0bc pci_ss_info_127a_1003_0e11_b0bc
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1003_0e11_b114 =
- {0x0e11, 0xb114, pci_subsys_127a_1003_0e11_b114, 0};
-#undef pci_ss_info_0e11_b114
-#define pci_ss_info_0e11_b114 pci_ss_info_127a_1003_0e11_b114
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1003_1033_802b =
- {0x1033, 0x802b, pci_subsys_127a_1003_1033_802b, 0};
-#undef pci_ss_info_1033_802b
-#define pci_ss_info_1033_802b pci_ss_info_127a_1003_1033_802b
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_127a_1003_13df_1003 =
- {0x13df, 0x1003, pci_subsys_127a_1003_13df_1003, 0};
-#undef pci_ss_info_13df_1003
-#define pci_ss_info_13df_1003 pci_ss_info_127a_1003_13df_1003
-static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0117 =
- {0x13e0, 0x0117, pci_subsys_127a_1003_13e0_0117, 0};
-#undef pci_ss_info_13e0_0117
-#define pci_ss_info_13e0_0117 pci_ss_info_127a_1003_13e0_0117
-static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0147 =
- {0x13e0, 0x0147, pci_subsys_127a_1003_13e0_0147, 0};
-#undef pci_ss_info_13e0_0147
-#define pci_ss_info_13e0_0147 pci_ss_info_127a_1003_13e0_0147
-static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0197 =
- {0x13e0, 0x0197, pci_subsys_127a_1003_13e0_0197, 0};
-#undef pci_ss_info_13e0_0197
-#define pci_ss_info_13e0_0197 pci_ss_info_127a_1003_13e0_0197
-static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_01c7 =
- {0x13e0, 0x01c7, pci_subsys_127a_1003_13e0_01c7, 0};
-#undef pci_ss_info_13e0_01c7
-#define pci_ss_info_13e0_01c7 pci_ss_info_127a_1003_13e0_01c7
-static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_01f7 =
- {0x13e0, 0x01f7, pci_subsys_127a_1003_13e0_01f7, 0};
-#undef pci_ss_info_13e0_01f7
-#define pci_ss_info_13e0_01f7 pci_ss_info_127a_1003_13e0_01f7
-static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1003 =
- {0x1436, 0x1003, pci_subsys_127a_1003_1436_1003, 0};
-#undef pci_ss_info_1436_1003
-#define pci_ss_info_1436_1003 pci_ss_info_127a_1003_1436_1003
-static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1103 =
- {0x1436, 0x1103, pci_subsys_127a_1003_1436_1103, 0};
-#undef pci_ss_info_1436_1103
-#define pci_ss_info_1436_1103 pci_ss_info_127a_1003_1436_1103
-static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1602 =
- {0x1436, 0x1602, pci_subsys_127a_1003_1436_1602, 0};
-#undef pci_ss_info_1436_1602
-#define pci_ss_info_1436_1602 pci_ss_info_127a_1003_1436_1602
-static const pciSubsystemInfo pci_ss_info_127a_1004_1048_1500 =
- {0x1048, 0x1500, pci_subsys_127a_1004_1048_1500, 0};
-#undef pci_ss_info_1048_1500
-#define pci_ss_info_1048_1500 pci_ss_info_127a_1004_1048_1500
-static const pciSubsystemInfo pci_ss_info_127a_1004_10cf_1059 =
- {0x10cf, 0x1059, pci_subsys_127a_1004_10cf_1059, 0};
-#undef pci_ss_info_10cf_1059
-#define pci_ss_info_10cf_1059 pci_ss_info_127a_1004_10cf_1059
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1005_1033_8029 =
- {0x1033, 0x8029, pci_subsys_127a_1005_1033_8029, 0};
-#undef pci_ss_info_1033_8029
-#define pci_ss_info_1033_8029 pci_ss_info_127a_1005_1033_8029
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_1005_1033_8054 =
- {0x1033, 0x8054, pci_subsys_127a_1005_1033_8054, 0};
-#undef pci_ss_info_1033_8054
-#define pci_ss_info_1033_8054 pci_ss_info_127a_1005_1033_8054
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_103c =
- {0x10cf, 0x103c, pci_subsys_127a_1005_10cf_103c, 0};
-#undef pci_ss_info_10cf_103c
-#define pci_ss_info_10cf_103c pci_ss_info_127a_1005_10cf_103c
-static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_1055 =
- {0x10cf, 0x1055, pci_subsys_127a_1005_10cf_1055, 0};
-#undef pci_ss_info_10cf_1055
-#define pci_ss_info_10cf_1055 pci_ss_info_127a_1005_10cf_1055
-static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_1056 =
- {0x10cf, 0x1056, pci_subsys_127a_1005_10cf_1056, 0};
-#undef pci_ss_info_10cf_1056
-#define pci_ss_info_10cf_1056 pci_ss_info_127a_1005_10cf_1056
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4003 =
- {0x122d, 0x4003, pci_subsys_127a_1005_122d_4003, 0};
-#undef pci_ss_info_122d_4003
-#define pci_ss_info_122d_4003 pci_ss_info_127a_1005_122d_4003
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4006 =
- {0x122d, 0x4006, pci_subsys_127a_1005_122d_4006, 0};
-#undef pci_ss_info_122d_4006
-#define pci_ss_info_122d_4006 pci_ss_info_127a_1005_122d_4006
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4008 =
- {0x122d, 0x4008, pci_subsys_127a_1005_122d_4008, 0};
-#undef pci_ss_info_122d_4008
-#define pci_ss_info_122d_4008 pci_ss_info_127a_1005_122d_4008
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4009 =
- {0x122d, 0x4009, pci_subsys_127a_1005_122d_4009, 0};
-#undef pci_ss_info_122d_4009
-#define pci_ss_info_122d_4009 pci_ss_info_127a_1005_122d_4009
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4010 =
- {0x122d, 0x4010, pci_subsys_127a_1005_122d_4010, 0};
-#undef pci_ss_info_122d_4010
-#define pci_ss_info_122d_4010 pci_ss_info_127a_1005_122d_4010
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4011 =
- {0x122d, 0x4011, pci_subsys_127a_1005_122d_4011, 0};
-#undef pci_ss_info_122d_4011
-#define pci_ss_info_122d_4011 pci_ss_info_127a_1005_122d_4011
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4013 =
- {0x122d, 0x4013, pci_subsys_127a_1005_122d_4013, 0};
-#undef pci_ss_info_122d_4013
-#define pci_ss_info_122d_4013 pci_ss_info_127a_1005_122d_4013
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4015 =
- {0x122d, 0x4015, pci_subsys_127a_1005_122d_4015, 0};
-#undef pci_ss_info_122d_4015
-#define pci_ss_info_122d_4015 pci_ss_info_127a_1005_122d_4015
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4016 =
- {0x122d, 0x4016, pci_subsys_127a_1005_122d_4016, 0};
-#undef pci_ss_info_122d_4016
-#define pci_ss_info_122d_4016 pci_ss_info_127a_1005_122d_4016
-static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4019 =
- {0x122d, 0x4019, pci_subsys_127a_1005_122d_4019, 0};
-#undef pci_ss_info_122d_4019
-#define pci_ss_info_122d_4019 pci_ss_info_127a_1005_122d_4019
-static const pciSubsystemInfo pci_ss_info_127a_1005_13df_1005 =
- {0x13df, 0x1005, pci_subsys_127a_1005_13df_1005, 0};
-#undef pci_ss_info_13df_1005
-#define pci_ss_info_13df_1005 pci_ss_info_127a_1005_13df_1005
-static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_0187 =
- {0x13e0, 0x0187, pci_subsys_127a_1005_13e0_0187, 0};
-#undef pci_ss_info_13e0_0187
-#define pci_ss_info_13e0_0187 pci_ss_info_127a_1005_13e0_0187
-static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01a7 =
- {0x13e0, 0x01a7, pci_subsys_127a_1005_13e0_01a7, 0};
-#undef pci_ss_info_13e0_01a7
-#define pci_ss_info_13e0_01a7 pci_ss_info_127a_1005_13e0_01a7
-static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01b7 =
- {0x13e0, 0x01b7, pci_subsys_127a_1005_13e0_01b7, 0};
-#undef pci_ss_info_13e0_01b7
-#define pci_ss_info_13e0_01b7 pci_ss_info_127a_1005_13e0_01b7
-static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01d7 =
- {0x13e0, 0x01d7, pci_subsys_127a_1005_13e0_01d7, 0};
-#undef pci_ss_info_13e0_01d7
-#define pci_ss_info_13e0_01d7 pci_ss_info_127a_1005_13e0_01d7
-static const pciSubsystemInfo pci_ss_info_127a_1005_1436_1005 =
- {0x1436, 0x1005, pci_subsys_127a_1005_1436_1005, 0};
-#undef pci_ss_info_1436_1005
-#define pci_ss_info_1436_1005 pci_ss_info_127a_1005_1436_1005
-static const pciSubsystemInfo pci_ss_info_127a_1005_1436_1105 =
- {0x1436, 0x1105, pci_subsys_127a_1005_1436_1105, 0};
-#undef pci_ss_info_1436_1105
-#define pci_ss_info_1436_1105 pci_ss_info_127a_1005_1436_1105
-static const pciSubsystemInfo pci_ss_info_127a_1005_1437_1105 =
- {0x1437, 0x1105, pci_subsys_127a_1005_1437_1105, 0};
-#undef pci_ss_info_1437_1105
-#define pci_ss_info_1437_1105 pci_ss_info_127a_1005_1437_1105
-static const pciSubsystemInfo pci_ss_info_127a_1022_1436_1303 =
- {0x1436, 0x1303, pci_subsys_127a_1022_1436_1303, 0};
-#undef pci_ss_info_1436_1303
-#define pci_ss_info_1436_1303 pci_ss_info_127a_1022_1436_1303
-static const pciSubsystemInfo pci_ss_info_127a_1023_122d_4020 =
- {0x122d, 0x4020, pci_subsys_127a_1023_122d_4020, 0};
-#undef pci_ss_info_122d_4020
-#define pci_ss_info_122d_4020 pci_ss_info_127a_1023_122d_4020
-static const pciSubsystemInfo pci_ss_info_127a_1023_122d_4023 =
- {0x122d, 0x4023, pci_subsys_127a_1023_122d_4023, 0};
-#undef pci_ss_info_122d_4023
-#define pci_ss_info_122d_4023 pci_ss_info_127a_1023_122d_4023
-static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_0247 =
- {0x13e0, 0x0247, pci_subsys_127a_1023_13e0_0247, 0};
-#undef pci_ss_info_13e0_0247
-#define pci_ss_info_13e0_0247 pci_ss_info_127a_1023_13e0_0247
-static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_0297 =
- {0x13e0, 0x0297, pci_subsys_127a_1023_13e0_0297, 0};
-#undef pci_ss_info_13e0_0297
-#define pci_ss_info_13e0_0297 pci_ss_info_127a_1023_13e0_0297
-static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_02c7 =
- {0x13e0, 0x02c7, pci_subsys_127a_1023_13e0_02c7, 0};
-#undef pci_ss_info_13e0_02c7
-#define pci_ss_info_13e0_02c7 pci_ss_info_127a_1023_13e0_02c7
-static const pciSubsystemInfo pci_ss_info_127a_1023_1436_1203 =
- {0x1436, 0x1203, pci_subsys_127a_1023_1436_1203, 0};
-#undef pci_ss_info_1436_1203
-#define pci_ss_info_1436_1203 pci_ss_info_127a_1023_1436_1203
-static const pciSubsystemInfo pci_ss_info_127a_1023_1436_1303 =
- {0x1436, 0x1303, pci_subsys_127a_1023_1436_1303, 0};
-#undef pci_ss_info_1436_1303
-#define pci_ss_info_1436_1303 pci_ss_info_127a_1023_1436_1303
-static const pciSubsystemInfo pci_ss_info_127a_1025_10cf_106a =
- {0x10cf, 0x106a, pci_subsys_127a_1025_10cf_106a, 0};
-#undef pci_ss_info_10cf_106a
-#define pci_ss_info_10cf_106a pci_ss_info_127a_1025_10cf_106a
-static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4021 =
- {0x122d, 0x4021, pci_subsys_127a_1025_122d_4021, 0};
-#undef pci_ss_info_122d_4021
-#define pci_ss_info_122d_4021 pci_ss_info_127a_1025_122d_4021
-static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4022 =
- {0x122d, 0x4022, pci_subsys_127a_1025_122d_4022, 0};
-#undef pci_ss_info_122d_4022
-#define pci_ss_info_122d_4022 pci_ss_info_127a_1025_122d_4022
-static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4024 =
- {0x122d, 0x4024, pci_subsys_127a_1025_122d_4024, 0};
-#undef pci_ss_info_122d_4024
-#define pci_ss_info_122d_4024 pci_ss_info_127a_1025_122d_4024
-static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4025 =
- {0x122d, 0x4025, pci_subsys_127a_1025_122d_4025, 0};
-#undef pci_ss_info_122d_4025
-#define pci_ss_info_122d_4025 pci_ss_info_127a_1025_122d_4025
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8044 =
- {0x104d, 0x8044, pci_subsys_127a_2005_104d_8044, 0};
-#undef pci_ss_info_104d_8044
-#define pci_ss_info_104d_8044 pci_ss_info_127a_2005_104d_8044
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8045 =
- {0x104d, 0x8045, pci_subsys_127a_2005_104d_8045, 0};
-#undef pci_ss_info_104d_8045
-#define pci_ss_info_104d_8045 pci_ss_info_127a_2005_104d_8045
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8055 =
- {0x104d, 0x8055, pci_subsys_127a_2005_104d_8055, 0};
-#undef pci_ss_info_104d_8055
-#define pci_ss_info_104d_8055 pci_ss_info_127a_2005_104d_8055
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8056 =
- {0x104d, 0x8056, pci_subsys_127a_2005_104d_8056, 0};
-#undef pci_ss_info_104d_8056
-#define pci_ss_info_104d_8056 pci_ss_info_127a_2005_104d_8056
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_805a =
- {0x104d, 0x805a, pci_subsys_127a_2005_104d_805a, 0};
-#undef pci_ss_info_104d_805a
-#define pci_ss_info_104d_805a pci_ss_info_127a_2005_104d_805a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_805f =
- {0x104d, 0x805f, pci_subsys_127a_2005_104d_805f, 0};
-#undef pci_ss_info_104d_805f
-#define pci_ss_info_104d_805f pci_ss_info_127a_2005_104d_805f
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8074 =
- {0x104d, 0x8074, pci_subsys_127a_2005_104d_8074, 0};
-#undef pci_ss_info_104d_8074
-#define pci_ss_info_104d_8074 pci_ss_info_127a_2005_104d_8074
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_127a_2013_1179_0001 =
- {0x1179, 0x0001, pci_subsys_127a_2013_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_127a_2013_1179_0001
-static const pciSubsystemInfo pci_ss_info_127a_2013_1179_ff00 =
- {0x1179, 0xff00, pci_subsys_127a_2013_1179_ff00, 0};
-#undef pci_ss_info_1179_ff00
-#define pci_ss_info_1179_ff00 pci_ss_info_127a_2013_1179_ff00
-static const pciSubsystemInfo pci_ss_info_127a_2014_10cf_1057 =
- {0x10cf, 0x1057, pci_subsys_127a_2014_10cf_1057, 0};
-#undef pci_ss_info_10cf_1057
-#define pci_ss_info_10cf_1057 pci_ss_info_127a_2014_10cf_1057
-static const pciSubsystemInfo pci_ss_info_127a_2014_122d_4050 =
- {0x122d, 0x4050, pci_subsys_127a_2014_122d_4050, 0};
-#undef pci_ss_info_122d_4050
-#define pci_ss_info_122d_4050 pci_ss_info_127a_2014_122d_4050
-static const pciSubsystemInfo pci_ss_info_127a_2014_122d_4055 =
- {0x122d, 0x4055, pci_subsys_127a_2014_122d_4055, 0};
-#undef pci_ss_info_122d_4055
-#define pci_ss_info_122d_4055 pci_ss_info_127a_2014_122d_4055
-static const pciSubsystemInfo pci_ss_info_127a_2015_10cf_1063 =
- {0x10cf, 0x1063, pci_subsys_127a_2015_10cf_1063, 0};
-#undef pci_ss_info_10cf_1063
-#define pci_ss_info_10cf_1063 pci_ss_info_127a_2015_10cf_1063
-static const pciSubsystemInfo pci_ss_info_127a_2015_10cf_1064 =
- {0x10cf, 0x1064, pci_subsys_127a_2015_10cf_1064, 0};
-#undef pci_ss_info_10cf_1064
-#define pci_ss_info_10cf_1064 pci_ss_info_127a_2015_10cf_1064
-static const pciSubsystemInfo pci_ss_info_127a_2015_1468_2015 =
- {0x1468, 0x2015, pci_subsys_127a_2015_1468_2015, 0};
-#undef pci_ss_info_1468_2015
-#define pci_ss_info_1468_2015 pci_ss_info_127a_2015_1468_2015
-static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4051 =
- {0x122d, 0x4051, pci_subsys_127a_2016_122d_4051, 0};
-#undef pci_ss_info_122d_4051
-#define pci_ss_info_122d_4051 pci_ss_info_127a_2016_122d_4051
-static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4052 =
- {0x122d, 0x4052, pci_subsys_127a_2016_122d_4052, 0};
-#undef pci_ss_info_122d_4052
-#define pci_ss_info_122d_4052 pci_ss_info_127a_2016_122d_4052
-static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4054 =
- {0x122d, 0x4054, pci_subsys_127a_2016_122d_4054, 0};
-#undef pci_ss_info_122d_4054
-#define pci_ss_info_122d_4054 pci_ss_info_127a_2016_122d_4054
-static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4056 =
- {0x122d, 0x4056, pci_subsys_127a_2016_122d_4056, 0};
-#undef pci_ss_info_122d_4056
-#define pci_ss_info_122d_4056 pci_ss_info_127a_2016_122d_4056
-static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4057 =
- {0x122d, 0x4057, pci_subsys_127a_2016_122d_4057, 0};
-#undef pci_ss_info_122d_4057
-#define pci_ss_info_122d_4057 pci_ss_info_127a_2016_122d_4057
-static const pciSubsystemInfo pci_ss_info_127a_4311_127a_4311 =
- {0x127a, 0x4311, pci_subsys_127a_4311_127a_4311, 0};
-#undef pci_ss_info_127a_4311
-#define pci_ss_info_127a_4311 pci_ss_info_127a_4311_127a_4311
-static const pciSubsystemInfo pci_ss_info_127a_4311_13e0_0210 =
- {0x13e0, 0x0210, pci_subsys_127a_4311_13e0_0210, 0};
-#undef pci_ss_info_13e0_0210
-#define pci_ss_info_13e0_0210 pci_ss_info_127a_4311_13e0_0210
-static const pciSubsystemInfo pci_ss_info_127a_4320_1235_4320 =
- {0x1235, 0x4320, pci_subsys_127a_4320_1235_4320, 0};
-#undef pci_ss_info_1235_4320
-#define pci_ss_info_1235_4320 pci_ss_info_127a_4320_1235_4320
-static const pciSubsystemInfo pci_ss_info_127a_4321_1235_4321 =
- {0x1235, 0x4321, pci_subsys_127a_4321_1235_4321, 0};
-#undef pci_ss_info_1235_4321
-#define pci_ss_info_1235_4321 pci_ss_info_127a_4321_1235_4321
-static const pciSubsystemInfo pci_ss_info_127a_4321_1235_4324 =
- {0x1235, 0x4324, pci_subsys_127a_4321_1235_4324, 0};
-#undef pci_ss_info_1235_4324
-#define pci_ss_info_1235_4324 pci_ss_info_127a_4321_1235_4324
-static const pciSubsystemInfo pci_ss_info_127a_4321_13e0_0210 =
- {0x13e0, 0x0210, pci_subsys_127a_4321_13e0_0210, 0};
-#undef pci_ss_info_13e0_0210
-#define pci_ss_info_13e0_0210 pci_ss_info_127a_4321_13e0_0210
-static const pciSubsystemInfo pci_ss_info_127a_4321_144d_2321 =
- {0x144d, 0x2321, pci_subsys_127a_4321_144d_2321, 0};
-#undef pci_ss_info_144d_2321
-#define pci_ss_info_144d_2321 pci_ss_info_127a_4321_144d_2321
-static const pciSubsystemInfo pci_ss_info_127a_4322_1235_4322 =
- {0x1235, 0x4322, pci_subsys_127a_4322_1235_4322, 0};
-#undef pci_ss_info_1235_4322
-#define pci_ss_info_1235_4322 pci_ss_info_127a_4322_1235_4322
-static const pciSubsystemInfo pci_ss_info_127a_8234_108d_0022 =
- {0x108d, 0x0022, pci_subsys_127a_8234_108d_0022, 0};
-#undef pci_ss_info_108d_0022
-#define pci_ss_info_108d_0022 pci_ss_info_127a_8234_108d_0022
-static const pciSubsystemInfo pci_ss_info_127a_8234_108d_0027 =
- {0x108d, 0x0027, pci_subsys_127a_8234_108d_0027, 0};
-#undef pci_ss_info_108d_0027
-#define pci_ss_info_108d_0027 pci_ss_info_127a_8234_108d_0027
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12ae_0001_12ae_0001 =
- {0x12ae, 0x0001, pci_subsys_12ae_0001_12ae_0001, 0};
-#undef pci_ss_info_12ae_0001
-#define pci_ss_info_12ae_0001 pci_ss_info_12ae_0001_12ae_0001
-static const pciSubsystemInfo pci_ss_info_12ae_0001_1410_0104 =
- {0x1410, 0x0104, pci_subsys_12ae_0001_1410_0104, 0};
-#undef pci_ss_info_1410_0104
-#define pci_ss_info_1410_0104 pci_ss_info_12ae_0001_1410_0104
-static const pciSubsystemInfo pci_ss_info_12ae_0002_10a9_8002 =
- {0x10a9, 0x8002, pci_subsys_12ae_0002_10a9_8002, 0};
-#undef pci_ss_info_10a9_8002
-#define pci_ss_info_10a9_8002 pci_ss_info_12ae_0002_10a9_8002
-static const pciSubsystemInfo pci_ss_info_12ae_0002_12ae_0002 =
- {0x12ae, 0x0002, pci_subsys_12ae_0002_12ae_0002, 0};
-#undef pci_ss_info_12ae_0002
-#define pci_ss_info_12ae_0002 pci_ss_info_12ae_0002_12ae_0002
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_005c =
- {0x12b9, 0x005c, pci_subsys_12b9_1006_12b9_005c, 0};
-#undef pci_ss_info_12b9_005c
-#define pci_ss_info_12b9_005c pci_ss_info_12b9_1006_12b9_005c
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_005e =
- {0x12b9, 0x005e, pci_subsys_12b9_1006_12b9_005e, 0};
-#undef pci_ss_info_12b9_005e
-#define pci_ss_info_12b9_005e pci_ss_info_12b9_1006_12b9_005e
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0062 =
- {0x12b9, 0x0062, pci_subsys_12b9_1006_12b9_0062, 0};
-#undef pci_ss_info_12b9_0062
-#define pci_ss_info_12b9_0062 pci_ss_info_12b9_1006_12b9_0062
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0068 =
- {0x12b9, 0x0068, pci_subsys_12b9_1006_12b9_0068, 0};
-#undef pci_ss_info_12b9_0068
-#define pci_ss_info_12b9_0068 pci_ss_info_12b9_1006_12b9_0068
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_007a =
- {0x12b9, 0x007a, pci_subsys_12b9_1006_12b9_007a, 0};
-#undef pci_ss_info_12b9_007a
-#define pci_ss_info_12b9_007a pci_ss_info_12b9_1006_12b9_007a
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_007f =
- {0x12b9, 0x007f, pci_subsys_12b9_1006_12b9_007f, 0};
-#undef pci_ss_info_12b9_007f
-#define pci_ss_info_12b9_007f pci_ss_info_12b9_1006_12b9_007f
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0080 =
- {0x12b9, 0x0080, pci_subsys_12b9_1006_12b9_0080, 0};
-#undef pci_ss_info_12b9_0080
-#define pci_ss_info_12b9_0080 pci_ss_info_12b9_1006_12b9_0080
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0081 =
- {0x12b9, 0x0081, pci_subsys_12b9_1006_12b9_0081, 0};
-#undef pci_ss_info_12b9_0081
-#define pci_ss_info_12b9_0081 pci_ss_info_12b9_1006_12b9_0081
-static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0091 =
- {0x12b9, 0x0091, pci_subsys_12b9_1006_12b9_0091, 0};
-#undef pci_ss_info_12b9_0091
-#define pci_ss_info_12b9_0091 pci_ss_info_12b9_1006_12b9_0091
-static const pciSubsystemInfo pci_ss_info_12b9_1007_12b9_00a3 =
- {0x12b9, 0x00a3, pci_subsys_12b9_1007_12b9_00a3, 0};
-#undef pci_ss_info_12b9_00a3
-#define pci_ss_info_12b9_00a3 pci_ss_info_12b9_1007_12b9_00a3
-static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00a2 =
- {0x12b9, 0x00a2, pci_subsys_12b9_1008_12b9_00a2, 0};
-#undef pci_ss_info_12b9_00a2
-#define pci_ss_info_12b9_00a2 pci_ss_info_12b9_1008_12b9_00a2
-static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00aa =
- {0x12b9, 0x00aa, pci_subsys_12b9_1008_12b9_00aa, 0};
-#undef pci_ss_info_12b9_00aa
-#define pci_ss_info_12b9_00aa pci_ss_info_12b9_1008_12b9_00aa
-static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ab =
- {0x12b9, 0x00ab, pci_subsys_12b9_1008_12b9_00ab, 0};
-#undef pci_ss_info_12b9_00ab
-#define pci_ss_info_12b9_00ab pci_ss_info_12b9_1008_12b9_00ab
-static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ac =
- {0x12b9, 0x00ac, pci_subsys_12b9_1008_12b9_00ac, 0};
-#undef pci_ss_info_12b9_00ac
-#define pci_ss_info_12b9_00ac pci_ss_info_12b9_1008_12b9_00ac
-static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ad =
- {0x12b9, 0x00ad, pci_subsys_12b9_1008_12b9_00ad, 0};
-#undef pci_ss_info_12b9_00ad
-#define pci_ss_info_12b9_00ad pci_ss_info_12b9_1008_12b9_00ad
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12be_3042_12be_3042 =
- {0x12be, 0x3042, pci_subsys_12be_3042_12be_3042, 0};
-#undef pci_ss_info_12be_3042
-#define pci_ss_info_12be_3042 pci_ss_info_12be_3042_12be_3042
-#endif
-static const pciSubsystemInfo pci_ss_info_12d2_0018_1048_0c10 =
- {0x1048, 0x0c10, pci_subsys_12d2_0018_1048_0c10, 0};
-#undef pci_ss_info_1048_0c10
-#define pci_ss_info_1048_0c10 pci_ss_info_12d2_0018_1048_0c10
-static const pciSubsystemInfo pci_ss_info_12d2_0018_107b_8030 =
- {0x107b, 0x8030, pci_subsys_12d2_0018_107b_8030, 0};
-#undef pci_ss_info_107b_8030
-#define pci_ss_info_107b_8030 pci_ss_info_12d2_0018_107b_8030
-static const pciSubsystemInfo pci_ss_info_12d2_0018_1092_0350 =
- {0x1092, 0x0350, pci_subsys_12d2_0018_1092_0350, 0};
-#undef pci_ss_info_1092_0350
-#define pci_ss_info_1092_0350 pci_ss_info_12d2_0018_1092_0350
-static const pciSubsystemInfo pci_ss_info_12d2_0018_1092_1092 =
- {0x1092, 0x1092, pci_subsys_12d2_0018_1092_1092, 0};
-#undef pci_ss_info_1092_1092
-#define pci_ss_info_1092_1092 pci_ss_info_12d2_0018_1092_1092
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1b =
- {0x10b4, 0x1b1b, pci_subsys_12d2_0018_10b4_1b1b, 0};
-#undef pci_ss_info_10b4_1b1b
-#define pci_ss_info_10b4_1b1b pci_ss_info_12d2_0018_10b4_1b1b
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1d =
- {0x10b4, 0x1b1d, pci_subsys_12d2_0018_10b4_1b1d, 0};
-#undef pci_ss_info_10b4_1b1d
-#define pci_ss_info_10b4_1b1d pci_ss_info_12d2_0018_10b4_1b1d
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1e =
- {0x10b4, 0x1b1e, pci_subsys_12d2_0018_10b4_1b1e, 0};
-#undef pci_ss_info_10b4_1b1e
-#define pci_ss_info_10b4_1b1e pci_ss_info_12d2_0018_10b4_1b1e
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b20 =
- {0x10b4, 0x1b20, pci_subsys_12d2_0018_10b4_1b20, 0};
-#undef pci_ss_info_10b4_1b20
-#define pci_ss_info_10b4_1b20 pci_ss_info_12d2_0018_10b4_1b20
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b21 =
- {0x10b4, 0x1b21, pci_subsys_12d2_0018_10b4_1b21, 0};
-#undef pci_ss_info_10b4_1b21
-#define pci_ss_info_10b4_1b21 pci_ss_info_12d2_0018_10b4_1b21
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b22 =
- {0x10b4, 0x1b22, pci_subsys_12d2_0018_10b4_1b22, 0};
-#undef pci_ss_info_10b4_1b22
-#define pci_ss_info_10b4_1b22 pci_ss_info_12d2_0018_10b4_1b22
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b23 =
- {0x10b4, 0x1b23, pci_subsys_12d2_0018_10b4_1b23, 0};
-#undef pci_ss_info_10b4_1b23
-#define pci_ss_info_10b4_1b23 pci_ss_info_12d2_0018_10b4_1b23
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b27 =
- {0x10b4, 0x1b27, pci_subsys_12d2_0018_10b4_1b27, 0};
-#undef pci_ss_info_10b4_1b27
-#define pci_ss_info_10b4_1b27 pci_ss_info_12d2_0018_10b4_1b27
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b88 =
- {0x10b4, 0x1b88, pci_subsys_12d2_0018_10b4_1b88, 0};
-#undef pci_ss_info_10b4_1b88
-#define pci_ss_info_10b4_1b88 pci_ss_info_12d2_0018_10b4_1b88
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_222a =
- {0x10b4, 0x222a, pci_subsys_12d2_0018_10b4_222a, 0};
-#undef pci_ss_info_10b4_222a
-#define pci_ss_info_10b4_222a pci_ss_info_12d2_0018_10b4_222a
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2230 =
- {0x10b4, 0x2230, pci_subsys_12d2_0018_10b4_2230, 0};
-#undef pci_ss_info_10b4_2230
-#define pci_ss_info_10b4_2230 pci_ss_info_12d2_0018_10b4_2230
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2232 =
- {0x10b4, 0x2232, pci_subsys_12d2_0018_10b4_2232, 0};
-#undef pci_ss_info_10b4_2232
-#define pci_ss_info_10b4_2232 pci_ss_info_12d2_0018_10b4_2232
-static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2235 =
- {0x10b4, 0x2235, pci_subsys_12d2_0018_10b4_2235, 0};
-#undef pci_ss_info_10b4_2235
-#define pci_ss_info_10b4_2235 pci_ss_info_12d2_0018_10b4_2235
-static const pciSubsystemInfo pci_ss_info_12d2_0018_2a15_54a3 =
- {0x2a15, 0x54a3, pci_subsys_12d2_0018_2a15_54a3, 0};
-#undef pci_ss_info_2a15_54a3
-#define pci_ss_info_2a15_54a3 pci_ss_info_12d2_0018_2a15_54a3
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0001_104d_8036 =
- {0x104d, 0x8036, pci_subsys_12eb_0001_104d_8036, 0};
-#undef pci_ss_info_104d_8036
-#define pci_ss_info_104d_8036 pci_ss_info_12eb_0001_104d_8036
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2000 =
- {0x1092, 0x2000, pci_subsys_12eb_0001_1092_2000, 0};
-#undef pci_ss_info_1092_2000
-#define pci_ss_info_1092_2000 pci_ss_info_12eb_0001_1092_2000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2100 =
- {0x1092, 0x2100, pci_subsys_12eb_0001_1092_2100, 0};
-#undef pci_ss_info_1092_2100
-#define pci_ss_info_1092_2100 pci_ss_info_12eb_0001_1092_2100
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2110 =
- {0x1092, 0x2110, pci_subsys_12eb_0001_1092_2110, 0};
-#undef pci_ss_info_1092_2110
-#define pci_ss_info_1092_2110 pci_ss_info_12eb_0001_1092_2110
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2200 =
- {0x1092, 0x2200, pci_subsys_12eb_0001_1092_2200, 0};
-#undef pci_ss_info_1092_2200
-#define pci_ss_info_1092_2200 pci_ss_info_12eb_0001_1092_2200
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12eb_0001_122d_1002 =
- {0x122d, 0x1002, pci_subsys_12eb_0001_122d_1002, 0};
-#undef pci_ss_info_122d_1002
-#define pci_ss_info_122d_1002 pci_ss_info_12eb_0001_122d_1002
-static const pciSubsystemInfo pci_ss_info_12eb_0001_12eb_0001 =
- {0x12eb, 0x0001, pci_subsys_12eb_0001_12eb_0001, 0};
-#undef pci_ss_info_12eb_0001
-#define pci_ss_info_12eb_0001 pci_ss_info_12eb_0001_12eb_0001
-static const pciSubsystemInfo pci_ss_info_12eb_0001_5053_3355 =
- {0x5053, 0x3355, pci_subsys_12eb_0001_5053_3355, 0};
-#undef pci_ss_info_5053_3355
-#define pci_ss_info_5053_3355 pci_ss_info_12eb_0001_5053_3355
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_104d_8049 =
- {0x104d, 0x8049, pci_subsys_12eb_0002_104d_8049, 0};
-#undef pci_ss_info_104d_8049
-#define pci_ss_info_104d_8049 pci_ss_info_12eb_0002_104d_8049
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_104d_807b =
- {0x104d, 0x807b, pci_subsys_12eb_0002_104d_807b, 0};
-#undef pci_ss_info_104d_807b
-#define pci_ss_info_104d_807b pci_ss_info_12eb_0002_104d_807b
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3000 =
- {0x1092, 0x3000, pci_subsys_12eb_0002_1092_3000, 0};
-#undef pci_ss_info_1092_3000
-#define pci_ss_info_1092_3000 pci_ss_info_12eb_0002_1092_3000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3001 =
- {0x1092, 0x3001, pci_subsys_12eb_0002_1092_3001, 0};
-#undef pci_ss_info_1092_3001
-#define pci_ss_info_1092_3001 pci_ss_info_12eb_0002_1092_3001
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3002 =
- {0x1092, 0x3002, pci_subsys_12eb_0002_1092_3002, 0};
-#undef pci_ss_info_1092_3002
-#define pci_ss_info_1092_3002 pci_ss_info_12eb_0002_1092_3002
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3003 =
- {0x1092, 0x3003, pci_subsys_12eb_0002_1092_3003, 0};
-#undef pci_ss_info_1092_3003
-#define pci_ss_info_1092_3003 pci_ss_info_12eb_0002_1092_3003
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3004 =
- {0x1092, 0x3004, pci_subsys_12eb_0002_1092_3004, 0};
-#undef pci_ss_info_1092_3004
-#define pci_ss_info_1092_3004 pci_ss_info_12eb_0002_1092_3004
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0001 =
- {0x12eb, 0x0001, pci_subsys_12eb_0002_12eb_0001, 0};
-#undef pci_ss_info_12eb_0001
-#define pci_ss_info_12eb_0001 pci_ss_info_12eb_0002_12eb_0001
-static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0002 =
- {0x12eb, 0x0002, pci_subsys_12eb_0002_12eb_0002, 0};
-#undef pci_ss_info_12eb_0002
-#define pci_ss_info_12eb_0002 pci_ss_info_12eb_0002_12eb_0002
-static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0088 =
- {0x12eb, 0x0088, pci_subsys_12eb_0002_12eb_0088, 0};
-#undef pci_ss_info_12eb_0088
-#define pci_ss_info_12eb_0088 pci_ss_info_12eb_0002_12eb_0088
-static const pciSubsystemInfo pci_ss_info_12eb_0002_144d_3510 =
- {0x144d, 0x3510, pci_subsys_12eb_0002_144d_3510, 0};
-#undef pci_ss_info_144d_3510
-#define pci_ss_info_144d_3510 pci_ss_info_12eb_0002_144d_3510
-static const pciSubsystemInfo pci_ss_info_12eb_0002_5053_3356 =
- {0x5053, 0x3356, pci_subsys_12eb_0002_5053_3356, 0};
-#undef pci_ss_info_5053_3356
-#define pci_ss_info_5053_3356 pci_ss_info_12eb_0002_5053_3356
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0003_104d_8049 =
- {0x104d, 0x8049, pci_subsys_12eb_0003_104d_8049, 0};
-#undef pci_ss_info_104d_8049
-#define pci_ss_info_104d_8049 pci_ss_info_12eb_0003_104d_8049
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_12eb_0003_104d_8077 =
- {0x104d, 0x8077, pci_subsys_12eb_0003_104d_8077, 0};
-#undef pci_ss_info_104d_8077
-#define pci_ss_info_104d_8077 pci_ss_info_12eb_0003_104d_8077
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_12eb_0003_109f_1000 =
- {0x109f, 0x1000, pci_subsys_12eb_0003_109f_1000, 0};
-#undef pci_ss_info_109f_1000
-#define pci_ss_info_109f_1000 pci_ss_info_12eb_0003_109f_1000
-static const pciSubsystemInfo pci_ss_info_12eb_0003_12eb_0003 =
- {0x12eb, 0x0003, pci_subsys_12eb_0003_12eb_0003, 0};
-#undef pci_ss_info_12eb_0003
-#define pci_ss_info_12eb_0003 pci_ss_info_12eb_0003_12eb_0003
-static const pciSubsystemInfo pci_ss_info_12eb_0003_1462_6780 =
- {0x1462, 0x6780, pci_subsys_12eb_0003_1462_6780, 0};
-#undef pci_ss_info_1462_6780
-#define pci_ss_info_1462_6780 pci_ss_info_12eb_0003_1462_6780
-static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2073 =
- {0x14a4, 0x2073, pci_subsys_12eb_0003_14a4_2073, 0};
-#undef pci_ss_info_14a4_2073
-#define pci_ss_info_14a4_2073 pci_ss_info_12eb_0003_14a4_2073
-static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2091 =
- {0x14a4, 0x2091, pci_subsys_12eb_0003_14a4_2091, 0};
-#undef pci_ss_info_14a4_2091
-#define pci_ss_info_14a4_2091 pci_ss_info_12eb_0003_14a4_2091
-static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2104 =
- {0x14a4, 0x2104, pci_subsys_12eb_0003_14a4_2104, 0};
-#undef pci_ss_info_14a4_2104
-#define pci_ss_info_14a4_2104 pci_ss_info_12eb_0003_14a4_2104
-static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2106 =
- {0x14a4, 0x2106, pci_subsys_12eb_0003_14a4_2106, 0};
-#undef pci_ss_info_14a4_2106
-#define pci_ss_info_14a4_2106 pci_ss_info_12eb_0003_14a4_2106
-static const pciSubsystemInfo pci_ss_info_12eb_8803_12eb_8803 =
- {0x12eb, 0x8803, pci_subsys_12eb_8803_12eb_8803, 0};
-#undef pci_ss_info_12eb_8803
-#define pci_ss_info_12eb_8803 pci_ss_info_12eb_8803_12eb_8803
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1308_0001_1308_0001 =
- {0x1308, 0x0001, pci_subsys_1308_0001_1308_0001, 0};
-#undef pci_ss_info_1308_0001
-#define pci_ss_info_1308_0001 pci_ss_info_1308_0001_1308_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_131f_2030_131f_2030 =
- {0x131f, 0x2030, pci_subsys_131f_2030_131f_2030, 0};
-#undef pci_ss_info_131f_2030
-#define pci_ss_info_131f_2030 pci_ss_info_131f_2030_131f_2030
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_134d_7891_134d_0001 =
- {0x134d, 0x0001, pci_subsys_134d_7891_134d_0001, 0};
-#undef pci_ss_info_134d_0001
-#define pci_ss_info_134d_0001 pci_ss_info_134d_7891_134d_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1394_0001_1394_0001 =
- {0x1394, 0x0001, pci_subsys_1394_0001_1394_0001, 0};
-#undef pci_ss_info_1394_0001
-#define pci_ss_info_1394_0001 pci_ss_info_1394_0001_1394_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1397_2bd0_1397_2bd0 =
- {0x1397, 0x2bd0, pci_subsys_1397_2bd0_1397_2bd0, 0};
-#undef pci_ss_info_1397_2bd0
-#define pci_ss_info_1397_2bd0 pci_ss_info_1397_2bd0_1397_2bd0
-static const pciSubsystemInfo pci_ss_info_1397_2bd0_e4bf_1000 =
- {0xe4bf, 0x1000, pci_subsys_1397_2bd0_e4bf_1000, 0};
-#undef pci_ss_info_e4bf_1000
-#define pci_ss_info_e4bf_1000 pci_ss_info_1397_2bd0_e4bf_1000
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_13df_0001_13df_0001 =
- {0x13df, 0x0001, pci_subsys_13df_0001_13df_0001, 0};
-#undef pci_ss_info_13df_0001
-#define pci_ss_info_13df_0001 pci_ss_info_13df_0001_13df_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_13f6_0100_13f6_ffff =
- {0x13f6, 0xffff, pci_subsys_13f6_0100_13f6_ffff, 0};
-#undef pci_ss_info_13f6_ffff
-#define pci_ss_info_13f6_ffff pci_ss_info_13f6_0100_13f6_ffff
-static const pciSubsystemInfo pci_ss_info_13f6_0101_13f6_0101 =
- {0x13f6, 0x0101, pci_subsys_13f6_0101_13f6_0101, 0};
-#undef pci_ss_info_13f6_0101
-#define pci_ss_info_13f6_0101 pci_ss_info_13f6_0101_13f6_0101
-static const pciSubsystemInfo pci_ss_info_13f6_0111_1019_0970 =
- {0x1019, 0x0970, pci_subsys_13f6_0111_1019_0970, 0};
-#undef pci_ss_info_1019_0970
-#define pci_ss_info_1019_0970 pci_ss_info_13f6_0111_1019_0970
-static const pciSubsystemInfo pci_ss_info_13f6_0111_1043_8077 =
- {0x1043, 0x8077, pci_subsys_13f6_0111_1043_8077, 0};
-#undef pci_ss_info_1043_8077
-#define pci_ss_info_1043_8077 pci_ss_info_13f6_0111_1043_8077
-static const pciSubsystemInfo pci_ss_info_13f6_0111_1043_80e2 =
- {0x1043, 0x80e2, pci_subsys_13f6_0111_1043_80e2, 0};
-#undef pci_ss_info_1043_80e2
-#define pci_ss_info_1043_80e2 pci_ss_info_13f6_0111_1043_80e2
-static const pciSubsystemInfo pci_ss_info_13f6_0111_13f6_0111 =
- {0x13f6, 0x0111, pci_subsys_13f6_0111_13f6_0111, 0};
-#undef pci_ss_info_13f6_0111
-#define pci_ss_info_13f6_0111 pci_ss_info_13f6_0111_13f6_0111
-static const pciSubsystemInfo pci_ss_info_13f6_0111_1681_a000 =
- {0x1681, 0xa000, pci_subsys_13f6_0111_1681_a000, 0};
-#undef pci_ss_info_1681_a000
-#define pci_ss_info_1681_a000 pci_ss_info_13f6_0111_1681_a000
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2000 =
- {0x15ed, 0x2000, pci_subsys_1415_9501_15ed_2000, 0};
-#undef pci_ss_info_15ed_2000
-#define pci_ss_info_15ed_2000 pci_ss_info_1415_9501_15ed_2000
-static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2001 =
- {0x15ed, 0x2001, pci_subsys_1415_9501_15ed_2001, 0};
-#undef pci_ss_info_15ed_2001
-#define pci_ss_info_15ed_2001 pci_ss_info_1415_9501_15ed_2001
-static const pciSubsystemInfo pci_ss_info_1415_9511_15ed_2000 =
- {0x15ed, 0x2000, pci_subsys_1415_9511_15ed_2000, 0};
-#undef pci_ss_info_15ed_2000
-#define pci_ss_info_15ed_2000 pci_ss_info_1415_9511_15ed_2000
-static const pciSubsystemInfo pci_ss_info_1415_9511_15ed_2001 =
- {0x15ed, 0x2001, pci_subsys_1415_9511_15ed_2001, 0};
-#undef pci_ss_info_15ed_2001
-#define pci_ss_info_15ed_2001 pci_ss_info_1415_9511_15ed_2001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1644_1014_0277 =
- {0x1014, 0x0277, pci_subsys_14e4_1644_1014_0277, 0};
-#undef pci_ss_info_1014_0277
-#define pci_ss_info_1014_0277 pci_ss_info_14e4_1644_1014_0277
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_00d1 =
- {0x1028, 0x00d1, pci_subsys_14e4_1644_1028_00d1, 0};
-#undef pci_ss_info_1028_00d1
-#define pci_ss_info_1028_00d1 pci_ss_info_14e4_1644_1028_00d1
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_0106 =
- {0x1028, 0x0106, pci_subsys_14e4_1644_1028_0106, 0};
-#undef pci_ss_info_1028_0106
-#define pci_ss_info_1028_0106 pci_ss_info_14e4_1644_1028_0106
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_0109 =
- {0x1028, 0x0109, pci_subsys_14e4_1644_1028_0109, 0};
-#undef pci_ss_info_1028_0109
-#define pci_ss_info_1028_0109 pci_ss_info_14e4_1644_1028_0109
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_010a =
- {0x1028, 0x010a, pci_subsys_14e4_1644_1028_010a, 0};
-#undef pci_ss_info_1028_010a
-#define pci_ss_info_1028_010a pci_ss_info_14e4_1644_1028_010a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1000 =
- {0x10b7, 0x1000, pci_subsys_14e4_1644_10b7_1000, 0};
-#undef pci_ss_info_10b7_1000
-#define pci_ss_info_10b7_1000 pci_ss_info_14e4_1644_10b7_1000
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1001 =
- {0x10b7, 0x1001, pci_subsys_14e4_1644_10b7_1001, 0};
-#undef pci_ss_info_10b7_1001
-#define pci_ss_info_10b7_1001 pci_ss_info_14e4_1644_10b7_1001
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1002 =
- {0x10b7, 0x1002, pci_subsys_14e4_1644_10b7_1002, 0};
-#undef pci_ss_info_10b7_1002
-#define pci_ss_info_10b7_1002 pci_ss_info_14e4_1644_10b7_1002
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1003 =
- {0x10b7, 0x1003, pci_subsys_14e4_1644_10b7_1003, 0};
-#undef pci_ss_info_10b7_1003
-#define pci_ss_info_10b7_1003 pci_ss_info_14e4_1644_10b7_1003
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1004 =
- {0x10b7, 0x1004, pci_subsys_14e4_1644_10b7_1004, 0};
-#undef pci_ss_info_10b7_1004
-#define pci_ss_info_10b7_1004 pci_ss_info_14e4_1644_10b7_1004
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1005 =
- {0x10b7, 0x1005, pci_subsys_14e4_1644_10b7_1005, 0};
-#undef pci_ss_info_10b7_1005
-#define pci_ss_info_10b7_1005 pci_ss_info_14e4_1644_10b7_1005
-static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1008 =
- {0x10b7, 0x1008, pci_subsys_14e4_1644_10b7_1008, 0};
-#undef pci_ss_info_10b7_1008
-#define pci_ss_info_10b7_1008 pci_ss_info_14e4_1644_10b7_1008
-static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0002 =
- {0x14e4, 0x0002, pci_subsys_14e4_1644_14e4_0002, 0};
-#undef pci_ss_info_14e4_0002
-#define pci_ss_info_14e4_0002 pci_ss_info_14e4_1644_14e4_0002
-static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0003 =
- {0x14e4, 0x0003, pci_subsys_14e4_1644_14e4_0003, 0};
-#undef pci_ss_info_14e4_0003
-#define pci_ss_info_14e4_0003 pci_ss_info_14e4_1644_14e4_0003
-static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0004 =
- {0x14e4, 0x0004, pci_subsys_14e4_1644_14e4_0004, 0};
-#undef pci_ss_info_14e4_0004
-#define pci_ss_info_14e4_0004 pci_ss_info_14e4_1644_14e4_0004
-static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_1028 =
- {0x14e4, 0x1028, pci_subsys_14e4_1644_14e4_1028, 0};
-#undef pci_ss_info_14e4_1028
-#define pci_ss_info_14e4_1028 pci_ss_info_14e4_1644_14e4_1028
-static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_1644 =
- {0x14e4, 0x1644, pci_subsys_14e4_1644_14e4_1644, 0};
-#undef pci_ss_info_14e4_1644
-#define pci_ss_info_14e4_1644 pci_ss_info_14e4_1644_14e4_1644
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_007c =
- {0x0e11, 0x007c, pci_subsys_14e4_1645_0e11_007c, 0};
-#undef pci_ss_info_0e11_007c
-#define pci_ss_info_0e11_007c pci_ss_info_14e4_1645_0e11_007c
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_007d =
- {0x0e11, 0x007d, pci_subsys_14e4_1645_0e11_007d, 0};
-#undef pci_ss_info_0e11_007d
-#define pci_ss_info_0e11_007d pci_ss_info_14e4_1645_0e11_007d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_0085 =
- {0x0e11, 0x0085, pci_subsys_14e4_1645_0e11_0085, 0};
-#undef pci_ss_info_0e11_0085
-#define pci_ss_info_0e11_0085 pci_ss_info_14e4_1645_0e11_0085
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_0099 =
- {0x0e11, 0x0099, pci_subsys_14e4_1645_0e11_0099, 0};
-#undef pci_ss_info_0e11_0099
-#define pci_ss_info_0e11_0099 pci_ss_info_14e4_1645_0e11_0099
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_009a =
- {0x0e11, 0x009a, pci_subsys_14e4_1645_0e11_009a, 0};
-#undef pci_ss_info_0e11_009a
-#define pci_ss_info_0e11_009a pci_ss_info_14e4_1645_0e11_009a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_00c1 =
- {0x0e11, 0x00c1, pci_subsys_14e4_1645_0e11_00c1, 0};
-#undef pci_ss_info_0e11_00c1
-#define pci_ss_info_0e11_00c1 pci_ss_info_14e4_1645_0e11_00c1
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1645_1028_0121 =
- {0x1028, 0x0121, pci_subsys_14e4_1645_1028_0121, 0};
-#undef pci_ss_info_1028_0121
-#define pci_ss_info_1028_0121 pci_ss_info_14e4_1645_1028_0121
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8010 =
- {0x10a9, 0x8010, pci_subsys_14e4_1645_10a9_8010, 0};
-#undef pci_ss_info_10a9_8010
-#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1645_10a9_8010
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8011 =
- {0x10a9, 0x8011, pci_subsys_14e4_1645_10a9_8011, 0};
-#undef pci_ss_info_10a9_8011
-#define pci_ss_info_10a9_8011 pci_ss_info_14e4_1645_10a9_8011
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8012 =
- {0x10a9, 0x8012, pci_subsys_14e4_1645_10a9_8012, 0};
-#undef pci_ss_info_10a9_8012
-#define pci_ss_info_10a9_8012 pci_ss_info_14e4_1645_10a9_8012
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1004 =
- {0x10b7, 0x1004, pci_subsys_14e4_1645_10b7_1004, 0};
-#undef pci_ss_info_10b7_1004
-#define pci_ss_info_10b7_1004 pci_ss_info_14e4_1645_10b7_1004
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1006 =
- {0x10b7, 0x1006, pci_subsys_14e4_1645_10b7_1006, 0};
-#undef pci_ss_info_10b7_1006
-#define pci_ss_info_10b7_1006 pci_ss_info_14e4_1645_10b7_1006
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1007 =
- {0x10b7, 0x1007, pci_subsys_14e4_1645_10b7_1007, 0};
-#undef pci_ss_info_10b7_1007
-#define pci_ss_info_10b7_1007 pci_ss_info_14e4_1645_10b7_1007
-static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1008 =
- {0x10b7, 0x1008, pci_subsys_14e4_1645_10b7_1008, 0};
-#undef pci_ss_info_10b7_1008
-#define pci_ss_info_10b7_1008 pci_ss_info_14e4_1645_10b7_1008
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0001 =
- {0x14e4, 0x0001, pci_subsys_14e4_1645_14e4_0001, 0};
-#undef pci_ss_info_14e4_0001
-#define pci_ss_info_14e4_0001 pci_ss_info_14e4_1645_14e4_0001
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0005 =
- {0x14e4, 0x0005, pci_subsys_14e4_1645_14e4_0005, 0};
-#undef pci_ss_info_14e4_0005
-#define pci_ss_info_14e4_0005 pci_ss_info_14e4_1645_14e4_0005
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0006 =
- {0x14e4, 0x0006, pci_subsys_14e4_1645_14e4_0006, 0};
-#undef pci_ss_info_14e4_0006
-#define pci_ss_info_14e4_0006 pci_ss_info_14e4_1645_14e4_0006
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0007 =
- {0x14e4, 0x0007, pci_subsys_14e4_1645_14e4_0007, 0};
-#undef pci_ss_info_14e4_0007
-#define pci_ss_info_14e4_0007 pci_ss_info_14e4_1645_14e4_0007
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0008 =
- {0x14e4, 0x0008, pci_subsys_14e4_1645_14e4_0008, 0};
-#undef pci_ss_info_14e4_0008
-#define pci_ss_info_14e4_0008 pci_ss_info_14e4_1645_14e4_0008
-static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_8008 =
- {0x14e4, 0x8008, pci_subsys_14e4_1645_14e4_8008, 0};
-#undef pci_ss_info_14e4_8008
-#define pci_ss_info_14e4_8008 pci_ss_info_14e4_1645_14e4_8008
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1646_0e11_00bb =
- {0x0e11, 0x00bb, pci_subsys_14e4_1646_0e11_00bb, 0};
-#undef pci_ss_info_0e11_00bb
-#define pci_ss_info_0e11_00bb pci_ss_info_14e4_1646_0e11_00bb
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1646_1028_0126 =
- {0x1028, 0x0126, pci_subsys_14e4_1646_1028_0126, 0};
-#undef pci_ss_info_1028_0126
-#define pci_ss_info_1028_0126 pci_ss_info_14e4_1646_1028_0126
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1646_14e4_8009 =
- {0x14e4, 0x8009, pci_subsys_14e4_1646_14e4_8009, 0};
-#undef pci_ss_info_14e4_8009
-#define pci_ss_info_14e4_8009 pci_ss_info_14e4_1646_14e4_8009
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_0099 =
- {0x0e11, 0x0099, pci_subsys_14e4_1647_0e11_0099, 0};
-#undef pci_ss_info_0e11_0099
-#define pci_ss_info_0e11_0099 pci_ss_info_14e4_1647_0e11_0099
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_009a =
- {0x0e11, 0x009a, pci_subsys_14e4_1647_0e11_009a, 0};
-#undef pci_ss_info_0e11_009a
-#define pci_ss_info_0e11_009a pci_ss_info_14e4_1647_0e11_009a
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1647_10a9_8010 =
- {0x10a9, 0x8010, pci_subsys_14e4_1647_10a9_8010, 0};
-#undef pci_ss_info_10a9_8010
-#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1647_10a9_8010
-static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_0009 =
- {0x14e4, 0x0009, pci_subsys_14e4_1647_14e4_0009, 0};
-#undef pci_ss_info_14e4_0009
-#define pci_ss_info_14e4_0009 pci_ss_info_14e4_1647_14e4_0009
-static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_000a =
- {0x14e4, 0x000a, pci_subsys_14e4_1647_14e4_000a, 0};
-#undef pci_ss_info_14e4_000a
-#define pci_ss_info_14e4_000a pci_ss_info_14e4_1647_14e4_000a
-static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_000b =
- {0x14e4, 0x000b, pci_subsys_14e4_1647_14e4_000b, 0};
-#undef pci_ss_info_14e4_000b
-#define pci_ss_info_14e4_000b pci_ss_info_14e4_1647_14e4_000b
-static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_8009 =
- {0x14e4, 0x8009, pci_subsys_14e4_1647_14e4_8009, 0};
-#undef pci_ss_info_14e4_8009
-#define pci_ss_info_14e4_8009 pci_ss_info_14e4_1647_14e4_8009
-static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_800a =
- {0x14e4, 0x800a, pci_subsys_14e4_1647_14e4_800a, 0};
-#undef pci_ss_info_14e4_800a
-#define pci_ss_info_14e4_800a pci_ss_info_14e4_1647_14e4_800a
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00cf =
- {0x0e11, 0x00cf, pci_subsys_14e4_1648_0e11_00cf, 0};
-#undef pci_ss_info_0e11_00cf
-#define pci_ss_info_0e11_00cf pci_ss_info_14e4_1648_0e11_00cf
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00d0 =
- {0x0e11, 0x00d0, pci_subsys_14e4_1648_0e11_00d0, 0};
-#undef pci_ss_info_0e11_00d0
-#define pci_ss_info_0e11_00d0 pci_ss_info_14e4_1648_0e11_00d0
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00d1 =
- {0x0e11, 0x00d1, pci_subsys_14e4_1648_0e11_00d1, 0};
-#undef pci_ss_info_0e11_00d1
-#define pci_ss_info_0e11_00d1 pci_ss_info_14e4_1648_0e11_00d1
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_1648_10b7_2000 =
- {0x10b7, 0x2000, pci_subsys_14e4_1648_10b7_2000, 0};
-#undef pci_ss_info_10b7_2000
-#define pci_ss_info_10b7_2000 pci_ss_info_14e4_1648_10b7_2000
-static const pciSubsystemInfo pci_ss_info_14e4_1648_10b7_3000 =
- {0x10b7, 0x3000, pci_subsys_14e4_1648_10b7_3000, 0};
-#undef pci_ss_info_10b7_3000
-#define pci_ss_info_10b7_3000 pci_ss_info_14e4_1648_10b7_3000
-static const pciSubsystemInfo pci_ss_info_14e4_1648_1166_1648 =
- {0x1166, 0x1648, pci_subsys_14e4_1648_1166_1648, 0};
-#undef pci_ss_info_1166_1648
-#define pci_ss_info_1166_1648 pci_ss_info_14e4_1648_1166_1648
-static const pciSubsystemInfo pci_ss_info_14e4_1696_14e4_000d =
- {0x14e4, 0x000d, pci_subsys_14e4_1696_14e4_000d, 0};
-#undef pci_ss_info_14e4_000d
-#define pci_ss_info_14e4_000d pci_ss_info_14e4_1696_14e4_000d
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_16a6_0e11_00bb =
- {0x0e11, 0x00bb, pci_subsys_14e4_16a6_0e11_00bb, 0};
-#undef pci_ss_info_0e11_00bb
-#define pci_ss_info_0e11_00bb pci_ss_info_14e4_16a6_0e11_00bb
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_16a6_1028_0126 =
- {0x1028, 0x0126, pci_subsys_14e4_16a6_1028_0126, 0};
-#undef pci_ss_info_1028_0126
-#define pci_ss_info_1028_0126 pci_ss_info_14e4_16a6_1028_0126
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_16a6_14e4_000c =
- {0x14e4, 0x000c, pci_subsys_14e4_16a6_14e4_000c, 0};
-#undef pci_ss_info_14e4_000c
-#define pci_ss_info_14e4_000c pci_ss_info_14e4_16a6_14e4_000c
-static const pciSubsystemInfo pci_ss_info_14e4_16a6_14e4_8009 =
- {0x14e4, 0x8009, pci_subsys_14e4_16a6_14e4_8009, 0};
-#undef pci_ss_info_14e4_8009
-#define pci_ss_info_14e4_8009 pci_ss_info_14e4_16a6_14e4_8009
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_0e11_00ca =
- {0x0e11, 0x00ca, pci_subsys_14e4_16a7_0e11_00ca, 0};
-#undef pci_ss_info_0e11_00ca
-#define pci_ss_info_0e11_00ca pci_ss_info_14e4_16a7_0e11_00ca
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_0e11_00cb =
- {0x0e11, 0x00cb, pci_subsys_14e4_16a7_0e11_00cb, 0};
-#undef pci_ss_info_0e11_00cb
-#define pci_ss_info_0e11_00cb pci_ss_info_14e4_16a7_0e11_00cb
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_0009 =
- {0x14e4, 0x0009, pci_subsys_14e4_16a7_14e4_0009, 0};
-#undef pci_ss_info_14e4_0009
-#define pci_ss_info_14e4_0009 pci_ss_info_14e4_16a7_14e4_0009
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_000a =
- {0x14e4, 0x000a, pci_subsys_14e4_16a7_14e4_000a, 0};
-#undef pci_ss_info_14e4_000a
-#define pci_ss_info_14e4_000a pci_ss_info_14e4_16a7_14e4_000a
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_000b =
- {0x14e4, 0x000b, pci_subsys_14e4_16a7_14e4_000b, 0};
-#undef pci_ss_info_14e4_000b
-#define pci_ss_info_14e4_000b pci_ss_info_14e4_16a7_14e4_000b
-static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_800a =
- {0x14e4, 0x800a, pci_subsys_14e4_16a7_14e4_800a, 0};
-#undef pci_ss_info_14e4_800a
-#define pci_ss_info_14e4_800a pci_ss_info_14e4_16a7_14e4_800a
-static const pciSubsystemInfo pci_ss_info_14e4_16a8_10b7_2001 =
- {0x10b7, 0x2001, pci_subsys_14e4_16a8_10b7_2001, 0};
-#undef pci_ss_info_10b7_2001
-#define pci_ss_info_10b7_2001 pci_ss_info_14e4_16a8_10b7_2001
-static const pciSubsystemInfo pci_ss_info_14e4_16c6_10b7_1100 =
- {0x10b7, 0x1100, pci_subsys_14e4_16c6_10b7_1100, 0};
-#undef pci_ss_info_10b7_1100
-#define pci_ss_info_10b7_1100 pci_ss_info_14e4_16c6_10b7_1100
-static const pciSubsystemInfo pci_ss_info_14e4_16c6_14e4_000c =
- {0x14e4, 0x000c, pci_subsys_14e4_16c6_14e4_000c, 0};
-#undef pci_ss_info_14e4_000c
-#define pci_ss_info_14e4_000c pci_ss_info_14e4_16c6_14e4_000c
-static const pciSubsystemInfo pci_ss_info_14e4_16c6_14e4_8009 =
- {0x14e4, 0x8009, pci_subsys_14e4_16c6_14e4_8009, 0};
-#undef pci_ss_info_14e4_8009
-#define pci_ss_info_14e4_8009 pci_ss_info_14e4_16c6_14e4_8009
-static const pciSubsystemInfo pci_ss_info_14e4_16c7_14e4_0009 =
- {0x14e4, 0x0009, pci_subsys_14e4_16c7_14e4_0009, 0};
-#undef pci_ss_info_14e4_0009
-#define pci_ss_info_14e4_0009 pci_ss_info_14e4_16c7_14e4_0009
-static const pciSubsystemInfo pci_ss_info_14e4_16c7_14e4_000a =
- {0x14e4, 0x000a, pci_subsys_14e4_16c7_14e4_000a, 0};
-#undef pci_ss_info_14e4_000a
-#define pci_ss_info_14e4_000a pci_ss_info_14e4_16c7_14e4_000a
-static const pciSubsystemInfo pci_ss_info_14e4_4401_1043_80a8 =
- {0x1043, 0x80a8, pci_subsys_14e4_4401_1043_80a8, 0};
-#undef pci_ss_info_1043_80a8
-#define pci_ss_info_1043_80a8 pci_ss_info_14e4_4401_1043_80a8
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1033_1033_8077 =
- {0x1033, 0x8077, pci_subsys_14f1_1033_1033_8077, 0};
-#undef pci_ss_info_1033_8077
-#define pci_ss_info_1033_8077 pci_ss_info_14f1_1033_1033_8077
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4027 =
- {0x122d, 0x4027, pci_subsys_14f1_1033_122d_4027, 0};
-#undef pci_ss_info_122d_4027
-#define pci_ss_info_122d_4027 pci_ss_info_14f1_1033_122d_4027
-static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4030 =
- {0x122d, 0x4030, pci_subsys_14f1_1033_122d_4030, 0};
-#undef pci_ss_info_122d_4030
-#define pci_ss_info_122d_4030 pci_ss_info_14f1_1033_122d_4030
-static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4034 =
- {0x122d, 0x4034, pci_subsys_14f1_1033_122d_4034, 0};
-#undef pci_ss_info_122d_4034
-#define pci_ss_info_122d_4034 pci_ss_info_14f1_1033_122d_4034
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_020d =
- {0x13e0, 0x020d, pci_subsys_14f1_1033_13e0_020d, 0};
-#undef pci_ss_info_13e0_020d
-#define pci_ss_info_13e0_020d pci_ss_info_14f1_1033_13e0_020d
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_020e =
- {0x13e0, 0x020e, pci_subsys_14f1_1033_13e0_020e, 0};
-#undef pci_ss_info_13e0_020e
-#define pci_ss_info_13e0_020e pci_ss_info_14f1_1033_13e0_020e
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_0261 =
- {0x13e0, 0x0261, pci_subsys_14f1_1033_13e0_0261, 0};
-#undef pci_ss_info_13e0_0261
-#define pci_ss_info_13e0_0261 pci_ss_info_14f1_1033_13e0_0261
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_0290 =
- {0x13e0, 0x0290, pci_subsys_14f1_1033_13e0_0290, 0};
-#undef pci_ss_info_13e0_0290
-#define pci_ss_info_13e0_0290 pci_ss_info_14f1_1033_13e0_0290
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02a0 =
- {0x13e0, 0x02a0, pci_subsys_14f1_1033_13e0_02a0, 0};
-#undef pci_ss_info_13e0_02a0
-#define pci_ss_info_13e0_02a0 pci_ss_info_14f1_1033_13e0_02a0
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02b0 =
- {0x13e0, 0x02b0, pci_subsys_14f1_1033_13e0_02b0, 0};
-#undef pci_ss_info_13e0_02b0
-#define pci_ss_info_13e0_02b0 pci_ss_info_14f1_1033_13e0_02b0
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02c0 =
- {0x13e0, 0x02c0, pci_subsys_14f1_1033_13e0_02c0, 0};
-#undef pci_ss_info_13e0_02c0
-#define pci_ss_info_13e0_02c0 pci_ss_info_14f1_1033_13e0_02c0
-static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02d0 =
- {0x13e0, 0x02d0, pci_subsys_14f1_1033_13e0_02d0, 0};
-#undef pci_ss_info_13e0_02d0
-#define pci_ss_info_13e0_02d0 pci_ss_info_14f1_1033_13e0_02d0
-static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1500 =
- {0x144f, 0x1500, pci_subsys_14f1_1033_144f_1500, 0};
-#undef pci_ss_info_144f_1500
-#define pci_ss_info_144f_1500 pci_ss_info_14f1_1033_144f_1500
-static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1501 =
- {0x144f, 0x1501, pci_subsys_14f1_1033_144f_1501, 0};
-#undef pci_ss_info_144f_1501
-#define pci_ss_info_144f_1501 pci_ss_info_14f1_1033_144f_1501
-static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_150a =
- {0x144f, 0x150a, pci_subsys_14f1_1033_144f_150a, 0};
-#undef pci_ss_info_144f_150a
-#define pci_ss_info_144f_150a pci_ss_info_14f1_1033_144f_150a
-static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_150b =
- {0x144f, 0x150b, pci_subsys_14f1_1033_144f_150b, 0};
-#undef pci_ss_info_144f_150b
-#define pci_ss_info_144f_150b pci_ss_info_14f1_1033_144f_150b
-static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1510 =
- {0x144f, 0x1510, pci_subsys_14f1_1033_144f_1510, 0};
-#undef pci_ss_info_144f_1510
-#define pci_ss_info_144f_1510 pci_ss_info_14f1_1033_144f_1510
-static const pciSubsystemInfo pci_ss_info_14f1_1035_10cf_1098 =
- {0x10cf, 0x1098, pci_subsys_14f1_1035_10cf_1098, 0};
-#undef pci_ss_info_10cf_1098
-#define pci_ss_info_10cf_1098 pci_ss_info_14f1_1035_10cf_1098
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1036_104d_8067 =
- {0x104d, 0x8067, pci_subsys_14f1_1036_104d_8067, 0};
-#undef pci_ss_info_104d_8067
-#define pci_ss_info_104d_8067 pci_ss_info_14f1_1036_104d_8067
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14f1_1036_122d_4029 =
- {0x122d, 0x4029, pci_subsys_14f1_1036_122d_4029, 0};
-#undef pci_ss_info_122d_4029
-#define pci_ss_info_122d_4029 pci_ss_info_14f1_1036_122d_4029
-static const pciSubsystemInfo pci_ss_info_14f1_1036_122d_4031 =
- {0x122d, 0x4031, pci_subsys_14f1_1036_122d_4031, 0};
-#undef pci_ss_info_122d_4031
-#define pci_ss_info_122d_4031 pci_ss_info_14f1_1036_122d_4031
-static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0209 =
- {0x13e0, 0x0209, pci_subsys_14f1_1036_13e0_0209, 0};
-#undef pci_ss_info_13e0_0209
-#define pci_ss_info_13e0_0209 pci_ss_info_14f1_1036_13e0_0209
-static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_020a =
- {0x13e0, 0x020a, pci_subsys_14f1_1036_13e0_020a, 0};
-#undef pci_ss_info_13e0_020a
-#define pci_ss_info_13e0_020a pci_ss_info_14f1_1036_13e0_020a
-static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0260 =
- {0x13e0, 0x0260, pci_subsys_14f1_1036_13e0_0260, 0};
-#undef pci_ss_info_13e0_0260
-#define pci_ss_info_13e0_0260 pci_ss_info_14f1_1036_13e0_0260
-static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0270 =
- {0x13e0, 0x0270, pci_subsys_14f1_1036_13e0_0270, 0};
-#undef pci_ss_info_13e0_0270
-#define pci_ss_info_13e0_0270 pci_ss_info_14f1_1036_13e0_0270
-static const pciSubsystemInfo pci_ss_info_14f1_1066_122d_4033 =
- {0x122d, 0x4033, pci_subsys_14f1_1066_122d_4033, 0};
-#undef pci_ss_info_122d_4033
-#define pci_ss_info_122d_4033 pci_ss_info_14f1_1066_122d_4033
-static const pciSubsystemInfo pci_ss_info_14f1_1453_13e0_0240 =
- {0x13e0, 0x0240, pci_subsys_14f1_1453_13e0_0240, 0};
-#undef pci_ss_info_13e0_0240
-#define pci_ss_info_13e0_0240 pci_ss_info_14f1_1453_13e0_0240
-static const pciSubsystemInfo pci_ss_info_14f1_1453_13e0_0250 =
- {0x13e0, 0x0250, pci_subsys_14f1_1453_13e0_0250, 0};
-#undef pci_ss_info_13e0_0250
-#define pci_ss_info_13e0_0250 pci_ss_info_14f1_1453_13e0_0250
-static const pciSubsystemInfo pci_ss_info_14f1_1453_144f_1502 =
- {0x144f, 0x1502, pci_subsys_14f1_1453_144f_1502, 0};
-#undef pci_ss_info_144f_1502
-#define pci_ss_info_144f_1502 pci_ss_info_14f1_1453_144f_1502
-static const pciSubsystemInfo pci_ss_info_14f1_1453_144f_1503 =
- {0x144f, 0x1503, pci_subsys_14f1_1453_144f_1503, 0};
-#undef pci_ss_info_144f_1503
-#define pci_ss_info_144f_1503 pci_ss_info_14f1_1453_144f_1503
-static const pciSubsystemInfo pci_ss_info_14f1_1456_122d_4035 =
- {0x122d, 0x4035, pci_subsys_14f1_1456_122d_4035, 0};
-#undef pci_ss_info_122d_4035
-#define pci_ss_info_122d_4035 pci_ss_info_14f1_1456_122d_4035
-static const pciSubsystemInfo pci_ss_info_14f1_1456_122d_4302 =
- {0x122d, 0x4302, pci_subsys_14f1_1456_122d_4302, 0};
-#undef pci_ss_info_122d_4302
-#define pci_ss_info_122d_4302 pci_ss_info_14f1_1456_122d_4302
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1803_0e11_0023 =
- {0x0e11, 0x0023, pci_subsys_14f1_1803_0e11_0023, 0};
-#undef pci_ss_info_0e11_0023
-#define pci_ss_info_0e11_0023 pci_ss_info_14f1_1803_0e11_0023
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1803_0e11_0043 =
- {0x0e11, 0x0043, pci_subsys_14f1_1803_0e11_0043, 0};
-#undef pci_ss_info_0e11_0043
-#define pci_ss_info_0e11_0043 pci_ss_info_14f1_1803_0e11_0043
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1815_0e11_0022 =
- {0x0e11, 0x0022, pci_subsys_14f1_1815_0e11_0022, 0};
-#undef pci_ss_info_0e11_0022
-#define pci_ss_info_0e11_0022 pci_ss_info_14f1_1815_0e11_0022
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_1815_0e11_0042 =
- {0x0e11, 0x0042, pci_subsys_14f1_1815_0e11_0042, 0};
-#undef pci_ss_info_0e11_0042
-#define pci_ss_info_0e11_0042 pci_ss_info_14f1_1815_0e11_0042
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b195 =
- {0x0e11, 0xb195, pci_subsys_14f1_2013_0e11_b195, 0};
-#undef pci_ss_info_0e11_b195
-#define pci_ss_info_0e11_b195 pci_ss_info_14f1_2013_0e11_b195
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b196 =
- {0x0e11, 0xb196, pci_subsys_14f1_2013_0e11_b196, 0};
-#undef pci_ss_info_0e11_b196
-#define pci_ss_info_0e11_b196 pci_ss_info_14f1_2013_0e11_b196
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b1be =
- {0x0e11, 0xb1be, pci_subsys_14f1_2013_0e11_b1be, 0};
-#undef pci_ss_info_0e11_b1be
-#define pci_ss_info_0e11_b1be pci_ss_info_14f1_2013_0e11_b1be
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_1025_8013 =
- {0x1025, 0x8013, pci_subsys_14f1_2013_1025_8013, 0};
-#undef pci_ss_info_1025_8013
-#define pci_ss_info_1025_8013 pci_ss_info_14f1_2013_1025_8013
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_1033_809d =
- {0x1033, 0x809d, pci_subsys_14f1_2013_1033_809d, 0};
-#undef pci_ss_info_1033_809d
-#define pci_ss_info_1033_809d pci_ss_info_14f1_2013_1033_809d
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2013_1033_80bc =
- {0x1033, 0x80bc, pci_subsys_14f1_2013_1033_80bc, 0};
-#undef pci_ss_info_1033_80bc
-#define pci_ss_info_1033_80bc pci_ss_info_14f1_2013_1033_80bc
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14f1_2013_155d_6793 =
- {0x155d, 0x6793, pci_subsys_14f1_2013_155d_6793, 0};
-#undef pci_ss_info_155d_6793
-#define pci_ss_info_155d_6793 pci_ss_info_14f1_2013_155d_6793
-static const pciSubsystemInfo pci_ss_info_14f1_2013_155d_8850 =
- {0x155d, 0x8850, pci_subsys_14f1_2013_155d_8850, 0};
-#undef pci_ss_info_155d_8850
-#define pci_ss_info_155d_8850 pci_ss_info_14f1_2013_155d_8850
-static const pciSubsystemInfo pci_ss_info_14f1_2093_155d_2f07 =
- {0x155d, 0x2f07, pci_subsys_14f1_2093_155d_2f07, 0};
-#undef pci_ss_info_155d_2f07
-#define pci_ss_info_155d_2f07 pci_ss_info_14f1_2093_155d_2f07
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8075 =
- {0x104d, 0x8075, pci_subsys_14f1_2443_104d_8075, 0};
-#undef pci_ss_info_104d_8075
-#define pci_ss_info_104d_8075 pci_ss_info_14f1_2443_104d_8075
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8083 =
- {0x104d, 0x8083, pci_subsys_14f1_2443_104d_8083, 0};
-#undef pci_ss_info_104d_8083
-#define pci_ss_info_104d_8083 pci_ss_info_14f1_2443_104d_8083
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8097 =
- {0x104d, 0x8097, pci_subsys_14f1_2443_104d_8097, 0};
-#undef pci_ss_info_104d_8097
-#define pci_ss_info_104d_8097 pci_ss_info_14f1_2443_104d_8097
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_14f1_2f00_13e0_8d84 =
- {0x13e0, 0x8d84, pci_subsys_14f1_2f00_13e0_8d84, 0};
-#undef pci_ss_info_13e0_8d84
-#define pci_ss_info_13e0_8d84 pci_ss_info_14f1_2f00_13e0_8d84
-static const pciSubsystemInfo pci_ss_info_14f1_2f00_13e0_8d85 =
- {0x13e0, 0x8d85, pci_subsys_14f1_2f00_13e0_8d85, 0};
-#undef pci_ss_info_13e0_8d85
-#define pci_ss_info_13e0_8d85 pci_ss_info_14f1_2f00_13e0_8d85
-static const pciSubsystemInfo pci_ss_info_14f1_2f00_14f1_2004 =
- {0x14f1, 0x2004, pci_subsys_14f1_2f00_14f1_2004, 0};
-#undef pci_ss_info_14f1_2004
-#define pci_ss_info_14f1_2004 pci_ss_info_14f1_2f00_14f1_2004
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1516_0803_1320_10bd =
- {0x1320, 0x10bd, pci_subsys_1516_0803_1320_10bd, 0};
-#undef pci_ss_info_1320_10bd
-#define pci_ss_info_1320_10bd pci_ss_info_1516_0803_1320_10bd
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0200 =
- {0x1522, 0x0200, pci_subsys_1522_0100_1522_0200, 0};
-#undef pci_ss_info_1522_0200
-#define pci_ss_info_1522_0200 pci_ss_info_1522_0100_1522_0200
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0300 =
- {0x1522, 0x0300, pci_subsys_1522_0100_1522_0300, 0};
-#undef pci_ss_info_1522_0300
-#define pci_ss_info_1522_0300 pci_ss_info_1522_0100_1522_0300
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0400 =
- {0x1522, 0x0400, pci_subsys_1522_0100_1522_0400, 0};
-#undef pci_ss_info_1522_0400
-#define pci_ss_info_1522_0400 pci_ss_info_1522_0100_1522_0400
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0500 =
- {0x1522, 0x0500, pci_subsys_1522_0100_1522_0500, 0};
-#undef pci_ss_info_1522_0500
-#define pci_ss_info_1522_0500 pci_ss_info_1522_0100_1522_0500
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0600 =
- {0x1522, 0x0600, pci_subsys_1522_0100_1522_0600, 0};
-#undef pci_ss_info_1522_0600
-#define pci_ss_info_1522_0600 pci_ss_info_1522_0100_1522_0600
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0700 =
- {0x1522, 0x0700, pci_subsys_1522_0100_1522_0700, 0};
-#undef pci_ss_info_1522_0700
-#define pci_ss_info_1522_0700 pci_ss_info_1522_0100_1522_0700
-static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0800 =
- {0x1522, 0x0800, pci_subsys_1522_0100_1522_0800, 0};
-#undef pci_ss_info_1522_0800
-#define pci_ss_info_1522_0800 pci_ss_info_1522_0100_1522_0800
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_173b_03ea_173b_0001 =
- {0x173b, 0x0001, pci_subsys_173b_03ea_173b_0001, 0};
-#undef pci_ss_info_173b_0001
-#define pci_ss_info_173b_0001 pci_ss_info_173b_03ea_173b_0001
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_1813_4000_16be_0001 =
- {0x16be, 0x0001, pci_subsys_1813_4000_16be_0001, 0};
-#undef pci_ss_info_16be_0001
-#define pci_ss_info_16be_0001 pci_ss_info_1813_4000_16be_0001
-static const pciSubsystemInfo pci_ss_info_1813_4100_16be_0002 =
- {0x16be, 0x0002, pci_subsys_1813_4100_16be_0002, 0};
-#undef pci_ss_info_16be_0002
-#define pci_ss_info_16be_0002 pci_ss_info_1813_4100_16be_0002
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_3388_8011_3388_8011 =
- {0x3388, 0x8011, pci_subsys_3388_8011_3388_8011, 0};
-#undef pci_ss_info_3388_8011
-#define pci_ss_info_3388_8011 pci_ss_info_3388_8011_3388_8011
-static const pciSubsystemInfo pci_ss_info_3388_8012_3388_8012 =
- {0x3388, 0x8012, pci_subsys_3388_8012_3388_8012, 0};
-#undef pci_ss_info_3388_8012
-#define pci_ss_info_3388_8012 pci_ss_info_3388_8012_3388_8012
-static const pciSubsystemInfo pci_ss_info_3388_8013_3388_8013 =
- {0x3388, 0x8013, pci_subsys_3388_8013_3388_8013, 0};
-#undef pci_ss_info_3388_8013
-#define pci_ss_info_3388_8013 pci_ss_info_3388_8013_3388_8013
-#endif
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_1040_0011 =
- {0x1040, 0x0011, pci_subsys_3d3d_0009_1040_0011, 0};
-#undef pci_ss_info_1040_0011
-#define pci_ss_info_1040_0011 pci_ss_info_3d3d_0009_1040_0011
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0100 =
- {0x3d3d, 0x0100, pci_subsys_3d3d_0009_3d3d_0100, 0};
-#undef pci_ss_info_3d3d_0100
-#define pci_ss_info_3d3d_0100 pci_ss_info_3d3d_0009_3d3d_0100
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0111 =
- {0x3d3d, 0x0111, pci_subsys_3d3d_0009_3d3d_0111, 0};
-#undef pci_ss_info_3d3d_0111
-#define pci_ss_info_3d3d_0111 pci_ss_info_3d3d_0009_3d3d_0111
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0114 =
- {0x3d3d, 0x0114, pci_subsys_3d3d_0009_3d3d_0114, 0};
-#undef pci_ss_info_3d3d_0114
-#define pci_ss_info_3d3d_0114 pci_ss_info_3d3d_0009_3d3d_0114
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0116 =
- {0x3d3d, 0x0116, pci_subsys_3d3d_0009_3d3d_0116, 0};
-#undef pci_ss_info_3d3d_0116
-#define pci_ss_info_3d3d_0116 pci_ss_info_3d3d_0009_3d3d_0116
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0119 =
- {0x3d3d, 0x0119, pci_subsys_3d3d_0009_3d3d_0119, 0};
-#undef pci_ss_info_3d3d_0119
-#define pci_ss_info_3d3d_0119 pci_ss_info_3d3d_0009_3d3d_0119
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0120 =
- {0x3d3d, 0x0120, pci_subsys_3d3d_0009_3d3d_0120, 0};
-#undef pci_ss_info_3d3d_0120
-#define pci_ss_info_3d3d_0120 pci_ss_info_3d3d_0009_3d3d_0120
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0125 =
- {0x3d3d, 0x0125, pci_subsys_3d3d_0009_3d3d_0125, 0};
-#undef pci_ss_info_3d3d_0125
-#define pci_ss_info_3d3d_0125 pci_ss_info_3d3d_0009_3d3d_0125
-static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0127 =
- {0x3d3d, 0x0127, pci_subsys_3d3d_0009_3d3d_0127, 0};
-#undef pci_ss_info_3d3d_0127
-#define pci_ss_info_3d3d_0127 pci_ss_info_3d3d_0009_3d3d_0127
-static const pciSubsystemInfo pci_ss_info_3d3d_000a_3d3d_0121 =
- {0x3d3d, 0x0121, pci_subsys_3d3d_000a_3d3d_0121, 0};
-#undef pci_ss_info_3d3d_0121
-#define pci_ss_info_3d3d_0121 pci_ss_info_3d3d_000a_3d3d_0121
-static const pciSubsystemInfo pci_ss_info_3d3d_000c_3d3d_0144 =
- {0x3d3d, 0x0144, pci_subsys_3d3d_000c_3d3d_0144, 0};
-#undef pci_ss_info_3d3d_0144
-#define pci_ss_info_3d3d_0144 pci_ss_info_3d3d_000c_3d3d_0144
-static const pciSubsystemInfo pci_ss_info_4005_4000_4005_4000 =
- {0x4005, 0x4000, pci_subsys_4005_4000_4005_4000, 0};
-#undef pci_ss_info_4005_4000
-#define pci_ss_info_4005_4000 pci_ss_info_4005_4000_4005_4000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_4a14_5000_4a14_5000 =
- {0x4a14, 0x5000, pci_subsys_4a14_5000_4a14_5000, 0};
-#undef pci_ss_info_4a14_5000
-#define pci_ss_info_4a14_5000 pci_ss_info_4a14_5000_4a14_5000
-#endif
-static const pciSubsystemInfo pci_ss_info_5333_8900_5333_8900 =
- {0x5333, 0x8900, pci_subsys_5333_8900_5333_8900, 0};
-#undef pci_ss_info_5333_8900
-#define pci_ss_info_5333_8900 pci_ss_info_5333_8900_5333_8900
-static const pciSubsystemInfo pci_ss_info_5333_8901_5333_8901 =
- {0x5333, 0x8901, pci_subsys_5333_8901_5333_8901, 0};
-#undef pci_ss_info_5333_8901
-#define pci_ss_info_5333_8901 pci_ss_info_5333_8901_5333_8901
-static const pciSubsystemInfo pci_ss_info_5333_8904_1014_00db =
- {0x1014, 0x00db, pci_subsys_5333_8904_1014_00db, 0};
-#undef pci_ss_info_1014_00db
-#define pci_ss_info_1014_00db pci_ss_info_5333_8904_1014_00db
-static const pciSubsystemInfo pci_ss_info_5333_8904_5333_8904 =
- {0x5333, 0x8904, pci_subsys_5333_8904_5333_8904, 0};
-#undef pci_ss_info_5333_8904
-#define pci_ss_info_5333_8904 pci_ss_info_5333_8904_5333_8904
-static const pciSubsystemInfo pci_ss_info_5333_8a01_0e11_b032 =
- {0x0e11, 0xb032, pci_subsys_5333_8a01_0e11_b032, 0};
-#undef pci_ss_info_0e11_b032
-#define pci_ss_info_0e11_b032 pci_ss_info_5333_8a01_0e11_b032
-static const pciSubsystemInfo pci_ss_info_5333_8a01_10b4_1617 =
- {0x10b4, 0x1617, pci_subsys_5333_8a01_10b4_1617, 0};
-#undef pci_ss_info_10b4_1617
-#define pci_ss_info_10b4_1617 pci_ss_info_5333_8a01_10b4_1617
-static const pciSubsystemInfo pci_ss_info_5333_8a01_10b4_1717 =
- {0x10b4, 0x1717, pci_subsys_5333_8a01_10b4_1717, 0};
-#undef pci_ss_info_10b4_1717
-#define pci_ss_info_10b4_1717 pci_ss_info_5333_8a01_10b4_1717
-static const pciSubsystemInfo pci_ss_info_5333_8a01_5333_8a01 =
- {0x5333, 0x8a01, pci_subsys_5333_8a01_5333_8a01, 0};
-#undef pci_ss_info_5333_8a01
-#define pci_ss_info_5333_8a01 pci_ss_info_5333_8a01_5333_8a01
-static const pciSubsystemInfo pci_ss_info_5333_8a10_1092_8a10 =
- {0x1092, 0x8a10, pci_subsys_5333_8a10_1092_8a10, 0};
-#undef pci_ss_info_1092_8a10
-#define pci_ss_info_1092_8a10 pci_ss_info_5333_8a10_1092_8a10
-static const pciSubsystemInfo pci_ss_info_5333_8a13_5333_8a13 =
- {0x5333, 0x8a13, pci_subsys_5333_8a13_5333_8a13, 0};
-#undef pci_ss_info_5333_8a13
-#define pci_ss_info_5333_8a13 pci_ss_info_5333_8a13_5333_8a13
-static const pciSubsystemInfo pci_ss_info_5333_8a20_5333_8a20 =
- {0x5333, 0x8a20, pci_subsys_5333_8a20_5333_8a20, 0};
-#undef pci_ss_info_5333_8a20
-#define pci_ss_info_5333_8a20 pci_ss_info_5333_8a20_5333_8a20
-static const pciSubsystemInfo pci_ss_info_5333_8a21_5333_8a21 =
- {0x5333, 0x8a21, pci_subsys_5333_8a21_5333_8a21, 0};
-#undef pci_ss_info_5333_8a21
-#define pci_ss_info_5333_8a21 pci_ss_info_5333_8a21_5333_8a21
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1033_8068 =
- {0x1033, 0x8068, pci_subsys_5333_8a22_1033_8068, 0};
-#undef pci_ss_info_1033_8068
-#define pci_ss_info_1033_8068 pci_ss_info_5333_8a22_1033_8068
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1033_8069 =
- {0x1033, 0x8069, pci_subsys_5333_8a22_1033_8069, 0};
-#undef pci_ss_info_1033_8069
-#define pci_ss_info_1033_8069 pci_ss_info_5333_8a22_1033_8069
-static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_0018 =
- {0x105d, 0x0018, pci_subsys_5333_8a22_105d_0018, 0};
-#undef pci_ss_info_105d_0018
-#define pci_ss_info_105d_0018 pci_ss_info_5333_8a22_105d_0018
-static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_002a =
- {0x105d, 0x002a, pci_subsys_5333_8a22_105d_002a, 0};
-#undef pci_ss_info_105d_002a
-#define pci_ss_info_105d_002a pci_ss_info_5333_8a22_105d_002a
-static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_003a =
- {0x105d, 0x003a, pci_subsys_5333_8a22_105d_003a, 0};
-#undef pci_ss_info_105d_003a
-#define pci_ss_info_105d_003a pci_ss_info_5333_8a22_105d_003a
-static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_092f =
- {0x105d, 0x092f, pci_subsys_5333_8a22_105d_092f, 0};
-#undef pci_ss_info_105d_092f
-#define pci_ss_info_105d_092f pci_ss_info_5333_8a22_105d_092f
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4207 =
- {0x1092, 0x4207, pci_subsys_5333_8a22_1092_4207, 0};
-#undef pci_ss_info_1092_4207
-#define pci_ss_info_1092_4207 pci_ss_info_5333_8a22_1092_4207
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4800 =
- {0x1092, 0x4800, pci_subsys_5333_8a22_1092_4800, 0};
-#undef pci_ss_info_1092_4800
-#define pci_ss_info_1092_4800 pci_ss_info_5333_8a22_1092_4800
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4807 =
- {0x1092, 0x4807, pci_subsys_5333_8a22_1092_4807, 0};
-#undef pci_ss_info_1092_4807
-#define pci_ss_info_1092_4807 pci_ss_info_5333_8a22_1092_4807
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4808 =
- {0x1092, 0x4808, pci_subsys_5333_8a22_1092_4808, 0};
-#undef pci_ss_info_1092_4808
-#define pci_ss_info_1092_4808 pci_ss_info_5333_8a22_1092_4808
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4809 =
- {0x1092, 0x4809, pci_subsys_5333_8a22_1092_4809, 0};
-#undef pci_ss_info_1092_4809
-#define pci_ss_info_1092_4809 pci_ss_info_5333_8a22_1092_4809
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_480e =
- {0x1092, 0x480e, pci_subsys_5333_8a22_1092_480e, 0};
-#undef pci_ss_info_1092_480e
-#define pci_ss_info_1092_480e pci_ss_info_5333_8a22_1092_480e
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4904 =
- {0x1092, 0x4904, pci_subsys_5333_8a22_1092_4904, 0};
-#undef pci_ss_info_1092_4904
-#define pci_ss_info_1092_4904 pci_ss_info_5333_8a22_1092_4904
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4905 =
- {0x1092, 0x4905, pci_subsys_5333_8a22_1092_4905, 0};
-#undef pci_ss_info_1092_4905
-#define pci_ss_info_1092_4905 pci_ss_info_5333_8a22_1092_4905
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a09 =
- {0x1092, 0x4a09, pci_subsys_5333_8a22_1092_4a09, 0};
-#undef pci_ss_info_1092_4a09
-#define pci_ss_info_1092_4a09 pci_ss_info_5333_8a22_1092_4a09
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a0b =
- {0x1092, 0x4a0b, pci_subsys_5333_8a22_1092_4a0b, 0};
-#undef pci_ss_info_1092_4a0b
-#define pci_ss_info_1092_4a0b pci_ss_info_5333_8a22_1092_4a0b
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a0f =
- {0x1092, 0x4a0f, pci_subsys_5333_8a22_1092_4a0f, 0};
-#undef pci_ss_info_1092_4a0f
-#define pci_ss_info_1092_4a0f pci_ss_info_5333_8a22_1092_4a0f
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4e01 =
- {0x1092, 0x4e01, pci_subsys_5333_8a22_1092_4e01, 0};
-#undef pci_ss_info_1092_4e01
-#define pci_ss_info_1092_4e01 pci_ss_info_5333_8a22_1092_4e01
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1102_101d =
- {0x1102, 0x101d, pci_subsys_5333_8a22_1102_101d, 0};
-#undef pci_ss_info_1102_101d
-#define pci_ss_info_1102_101d pci_ss_info_5333_8a22_1102_101d
-static const pciSubsystemInfo pci_ss_info_5333_8a22_1102_101e =
- {0x1102, 0x101e, pci_subsys_5333_8a22_1102_101e, 0};
-#undef pci_ss_info_1102_101e
-#define pci_ss_info_1102_101e pci_ss_info_5333_8a22_1102_101e
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8100 =
- {0x5333, 0x8100, pci_subsys_5333_8a22_5333_8100, 0};
-#undef pci_ss_info_5333_8100
-#define pci_ss_info_5333_8100 pci_ss_info_5333_8a22_5333_8100
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8110 =
- {0x5333, 0x8110, pci_subsys_5333_8a22_5333_8110, 0};
-#undef pci_ss_info_5333_8110
-#define pci_ss_info_5333_8110 pci_ss_info_5333_8a22_5333_8110
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8125 =
- {0x5333, 0x8125, pci_subsys_5333_8a22_5333_8125, 0};
-#undef pci_ss_info_5333_8125
-#define pci_ss_info_5333_8125 pci_ss_info_5333_8a22_5333_8125
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8143 =
- {0x5333, 0x8143, pci_subsys_5333_8a22_5333_8143, 0};
-#undef pci_ss_info_5333_8143
-#define pci_ss_info_5333_8143 pci_ss_info_5333_8a22_5333_8143
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8a22 =
- {0x5333, 0x8a22, pci_subsys_5333_8a22_5333_8a22, 0};
-#undef pci_ss_info_5333_8a22
-#define pci_ss_info_5333_8a22 pci_ss_info_5333_8a22_5333_8a22
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8a2e =
- {0x5333, 0x8a2e, pci_subsys_5333_8a22_5333_8a2e, 0};
-#undef pci_ss_info_5333_8a2e
-#define pci_ss_info_5333_8a2e pci_ss_info_5333_8a22_5333_8a2e
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_9125 =
- {0x5333, 0x9125, pci_subsys_5333_8a22_5333_9125, 0};
-#undef pci_ss_info_5333_9125
-#define pci_ss_info_5333_9125 pci_ss_info_5333_8a22_5333_9125
-static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_9143 =
- {0x5333, 0x9143, pci_subsys_5333_8a22_5333_9143, 0};
-#undef pci_ss_info_5333_9143
-#define pci_ss_info_5333_9143 pci_ss_info_5333_8a22_5333_9143
-static const pciSubsystemInfo pci_ss_info_5333_8c01_1179_0001 =
- {0x1179, 0x0001, pci_subsys_5333_8c01_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_5333_8c01_1179_0001
-static const pciSubsystemInfo pci_ss_info_5333_8c12_1014_017f =
- {0x1014, 0x017f, pci_subsys_5333_8c12_1014_017f, 0};
-#undef pci_ss_info_1014_017f
-#define pci_ss_info_1014_017f pci_ss_info_5333_8c12_1014_017f
-static const pciSubsystemInfo pci_ss_info_5333_8c13_1179_0001 =
- {0x1179, 0x0001, pci_subsys_5333_8c13_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_5333_8c13_1179_0001
-static const pciSubsystemInfo pci_ss_info_5333_8c2e_1014_01fc =
- {0x1014, 0x01fc, pci_subsys_5333_8c2e_1014_01fc, 0};
-#undef pci_ss_info_1014_01fc
-#define pci_ss_info_1014_01fc pci_ss_info_5333_8c2e_1014_01fc
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5932 =
- {0x1092, 0x5932, pci_subsys_5333_9102_1092_5932, 0};
-#undef pci_ss_info_1092_5932
-#define pci_ss_info_1092_5932 pci_ss_info_5333_9102_1092_5932
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5934 =
- {0x1092, 0x5934, pci_subsys_5333_9102_1092_5934, 0};
-#undef pci_ss_info_1092_5934
-#define pci_ss_info_1092_5934 pci_ss_info_5333_9102_1092_5934
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5952 =
- {0x1092, 0x5952, pci_subsys_5333_9102_1092_5952, 0};
-#undef pci_ss_info_1092_5952
-#define pci_ss_info_1092_5952 pci_ss_info_5333_9102_1092_5952
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5954 =
- {0x1092, 0x5954, pci_subsys_5333_9102_1092_5954, 0};
-#undef pci_ss_info_1092_5954
-#define pci_ss_info_1092_5954 pci_ss_info_5333_9102_1092_5954
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a35 =
- {0x1092, 0x5a35, pci_subsys_5333_9102_1092_5a35, 0};
-#undef pci_ss_info_1092_5a35
-#define pci_ss_info_1092_5a35 pci_ss_info_5333_9102_1092_5a35
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a37 =
- {0x1092, 0x5a37, pci_subsys_5333_9102_1092_5a37, 0};
-#undef pci_ss_info_1092_5a37
-#define pci_ss_info_1092_5a37 pci_ss_info_5333_9102_1092_5a37
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a55 =
- {0x1092, 0x5a55, pci_subsys_5333_9102_1092_5a55, 0};
-#undef pci_ss_info_1092_5a55
-#define pci_ss_info_1092_5a55 pci_ss_info_5333_9102_1092_5a55
-static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a57 =
- {0x1092, 0x5a57, pci_subsys_5333_9102_1092_5a57, 0};
-#undef pci_ss_info_1092_5a57
-#define pci_ss_info_1092_5a57 pci_ss_info_5333_9102_1092_5a57
-static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b0df =
- {0x0e11, 0xb0df, pci_subsys_8086_1000_0e11_b0df, 0};
-#undef pci_ss_info_0e11_b0df
-#define pci_ss_info_0e11_b0df pci_ss_info_8086_1000_0e11_b0df
-static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b0e0 =
- {0x0e11, 0xb0e0, pci_subsys_8086_1000_0e11_b0e0, 0};
-#undef pci_ss_info_0e11_b0e0
-#define pci_ss_info_0e11_b0e0 pci_ss_info_8086_1000_0e11_b0e0
-static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b123 =
- {0x0e11, 0xb123, pci_subsys_8086_1000_0e11_b123, 0};
-#undef pci_ss_info_0e11_b123
-#define pci_ss_info_0e11_b123 pci_ss_info_8086_1000_0e11_b123
-static const pciSubsystemInfo pci_ss_info_8086_1000_1014_0119 =
- {0x1014, 0x0119, pci_subsys_8086_1000_1014_0119, 0};
-#undef pci_ss_info_1014_0119
-#define pci_ss_info_1014_0119 pci_ss_info_8086_1000_1014_0119
-static const pciSubsystemInfo pci_ss_info_8086_1000_8086_1000 =
- {0x8086, 0x1000, pci_subsys_8086_1000_8086_1000, 0};
-#undef pci_ss_info_8086_1000
-#define pci_ss_info_8086_1000 pci_ss_info_8086_1000_8086_1000
-static const pciSubsystemInfo pci_ss_info_8086_1001_0e11_004a =
- {0x0e11, 0x004a, pci_subsys_8086_1001_0e11_004a, 0};
-#undef pci_ss_info_0e11_004a
-#define pci_ss_info_0e11_004a pci_ss_info_8086_1001_0e11_004a
-static const pciSubsystemInfo pci_ss_info_8086_1001_1014_01ea =
- {0x1014, 0x01ea, pci_subsys_8086_1001_1014_01ea, 0};
-#undef pci_ss_info_1014_01ea
-#define pci_ss_info_1014_01ea pci_ss_info_8086_1001_1014_01ea
-static const pciSubsystemInfo pci_ss_info_8086_1001_8086_1003 =
- {0x8086, 0x1003, pci_subsys_8086_1001_8086_1003, 0};
-#undef pci_ss_info_8086_1003
-#define pci_ss_info_8086_1003 pci_ss_info_8086_1001_8086_1003
-static const pciSubsystemInfo pci_ss_info_8086_1002_8086_200e =
- {0x8086, 0x200e, pci_subsys_8086_1002_8086_200e, 0};
-#undef pci_ss_info_8086_200e
-#define pci_ss_info_8086_200e pci_ss_info_8086_1002_8086_200e
-static const pciSubsystemInfo pci_ss_info_8086_1002_8086_2013 =
- {0x8086, 0x2013, pci_subsys_8086_1002_8086_2013, 0};
-#undef pci_ss_info_8086_2013
-#define pci_ss_info_8086_2013 pci_ss_info_8086_1002_8086_2013
-static const pciSubsystemInfo pci_ss_info_8086_1002_8086_2017 =
- {0x8086, 0x2017, pci_subsys_8086_1002_8086_2017, 0};
-#undef pci_ss_info_8086_2017
-#define pci_ss_info_8086_2017 pci_ss_info_8086_1002_8086_2017
-static const pciSubsystemInfo pci_ss_info_8086_1004_0e11_0049 =
- {0x0e11, 0x0049, pci_subsys_8086_1004_0e11_0049, 0};
-#undef pci_ss_info_0e11_0049
-#define pci_ss_info_0e11_0049 pci_ss_info_8086_1004_0e11_0049
-static const pciSubsystemInfo pci_ss_info_8086_1004_0e11_b1a4 =
- {0x0e11, 0xb1a4, pci_subsys_8086_1004_0e11_b1a4, 0};
-#undef pci_ss_info_0e11_b1a4
-#define pci_ss_info_0e11_b1a4 pci_ss_info_8086_1004_0e11_b1a4
-static const pciSubsystemInfo pci_ss_info_8086_1004_1014_10f2 =
- {0x1014, 0x10f2, pci_subsys_8086_1004_1014_10f2, 0};
-#undef pci_ss_info_1014_10f2
-#define pci_ss_info_1014_10f2 pci_ss_info_8086_1004_1014_10f2
-static const pciSubsystemInfo pci_ss_info_8086_1004_8086_1004 =
- {0x8086, 0x1004, pci_subsys_8086_1004_8086_1004, 0};
-#undef pci_ss_info_8086_1004
-#define pci_ss_info_8086_1004 pci_ss_info_8086_1004_8086_1004
-static const pciSubsystemInfo pci_ss_info_8086_1004_8086_2004 =
- {0x8086, 0x2004, pci_subsys_8086_1004_8086_2004, 0};
-#undef pci_ss_info_8086_2004
-#define pci_ss_info_8086_2004 pci_ss_info_8086_1004_8086_2004
-static const pciSubsystemInfo pci_ss_info_8086_1008_8086_1107 =
- {0x8086, 0x1107, pci_subsys_8086_1008_8086_1107, 0};
-#undef pci_ss_info_8086_1107
-#define pci_ss_info_8086_1107 pci_ss_info_8086_1008_8086_1107
-static const pciSubsystemInfo pci_ss_info_8086_1008_8086_2107 =
- {0x8086, 0x2107, pci_subsys_8086_1008_8086_2107, 0};
-#undef pci_ss_info_8086_2107
-#define pci_ss_info_8086_2107 pci_ss_info_8086_1008_8086_2107
-static const pciSubsystemInfo pci_ss_info_8086_1008_8086_2110 =
- {0x8086, 0x2110, pci_subsys_8086_1008_8086_2110, 0};
-#undef pci_ss_info_8086_2110
-#define pci_ss_info_8086_2110 pci_ss_info_8086_1008_8086_2110
-static const pciSubsystemInfo pci_ss_info_8086_1009_8086_1109 =
- {0x8086, 0x1109, pci_subsys_8086_1009_8086_1109, 0};
-#undef pci_ss_info_8086_1109
-#define pci_ss_info_8086_1109 pci_ss_info_8086_1009_8086_1109
-static const pciSubsystemInfo pci_ss_info_8086_1009_8086_2109 =
- {0x8086, 0x2109, pci_subsys_8086_1009_8086_2109, 0};
-#undef pci_ss_info_8086_2109
-#define pci_ss_info_8086_2109 pci_ss_info_8086_1009_8086_2109
-static const pciSubsystemInfo pci_ss_info_8086_100c_8086_1112 =
- {0x8086, 0x1112, pci_subsys_8086_100c_8086_1112, 0};
-#undef pci_ss_info_8086_1112
-#define pci_ss_info_8086_1112 pci_ss_info_8086_100c_8086_1112
-static const pciSubsystemInfo pci_ss_info_8086_100c_8086_2112 =
- {0x8086, 0x2112, pci_subsys_8086_100c_8086_2112, 0};
-#undef pci_ss_info_8086_2112
-#define pci_ss_info_8086_2112 pci_ss_info_8086_100c_8086_2112
-static const pciSubsystemInfo pci_ss_info_8086_100e_8086_001e =
- {0x8086, 0x001e, pci_subsys_8086_100e_8086_001e, 0};
-#undef pci_ss_info_8086_001e
-#define pci_ss_info_8086_001e pci_ss_info_8086_100e_8086_001e
-static const pciSubsystemInfo pci_ss_info_8086_100e_8086_002e =
- {0x8086, 0x002e, pci_subsys_8086_100e_8086_002e, 0};
-#undef pci_ss_info_8086_002e
-#define pci_ss_info_8086_002e pci_ss_info_8086_100e_8086_002e
-static const pciSubsystemInfo pci_ss_info_8086_100f_8086_1001 =
- {0x8086, 0x1001, pci_subsys_8086_100f_8086_1001, 0};
-#undef pci_ss_info_8086_1001
-#define pci_ss_info_8086_1001 pci_ss_info_8086_100f_8086_1001
-static const pciSubsystemInfo pci_ss_info_8086_1010_8086_1011 =
- {0x8086, 0x1011, pci_subsys_8086_1010_8086_1011, 0};
-#undef pci_ss_info_8086_1011
-#define pci_ss_info_8086_1011 pci_ss_info_8086_1010_8086_1011
-static const pciSubsystemInfo pci_ss_info_8086_1011_8086_1002 =
- {0x8086, 0x1002, pci_subsys_8086_1011_8086_1002, 0};
-#undef pci_ss_info_8086_1002
-#define pci_ss_info_8086_1002 pci_ss_info_8086_1011_8086_1002
-static const pciSubsystemInfo pci_ss_info_8086_1012_8086_1012 =
- {0x8086, 0x1012, pci_subsys_8086_1012_8086_1012, 0};
-#undef pci_ss_info_8086_1012
-#define pci_ss_info_8086_1012 pci_ss_info_8086_1012_8086_1012
-static const pciSubsystemInfo pci_ss_info_8086_1031_1014_0209 =
- {0x1014, 0x0209, pci_subsys_8086_1031_1014_0209, 0};
-#undef pci_ss_info_1014_0209
-#define pci_ss_info_1014_0209 pci_ss_info_8086_1031_1014_0209
-static const pciSubsystemInfo pci_ss_info_8086_1031_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_1031_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_1031_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_1031_107b_5350 =
- {0x107b, 0x5350, pci_subsys_8086_1031_107b_5350, 0};
-#undef pci_ss_info_107b_5350
-#define pci_ss_info_107b_5350 pci_ss_info_8086_1031_107b_5350
-static const pciSubsystemInfo pci_ss_info_8086_1031_1179_0001 =
- {0x1179, 0x0001, pci_subsys_8086_1031_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_8086_1031_1179_0001
-static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c000 =
- {0x144d, 0xc000, pci_subsys_8086_1031_144d_c000, 0};
-#undef pci_ss_info_144d_c000
-#define pci_ss_info_144d_c000 pci_ss_info_8086_1031_144d_c000
-static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c001 =
- {0x144d, 0xc001, pci_subsys_8086_1031_144d_c001, 0};
-#undef pci_ss_info_144d_c001
-#define pci_ss_info_144d_c001 pci_ss_info_8086_1031_144d_c001
-static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c003 =
- {0x144d, 0xc003, pci_subsys_8086_1031_144d_c003, 0};
-#undef pci_ss_info_144d_c003
-#define pci_ss_info_144d_c003 pci_ss_info_8086_1031_144d_c003
-static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c006 =
- {0x144d, 0xc006, pci_subsys_8086_1031_144d_c006, 0};
-#undef pci_ss_info_144d_c006
-#define pci_ss_info_144d_c006 pci_ss_info_8086_1031_144d_c006
-static const pciSubsystemInfo pci_ss_info_8086_1040_16be_1040 =
- {0x16be, 0x1040, pci_subsys_8086_1040_16be_1040, 0};
-#undef pci_ss_info_16be_1040
-#define pci_ss_info_16be_1040 pci_ss_info_8086_1040_16be_1040
-static const pciSubsystemInfo pci_ss_info_8086_1130_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_1130_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_1130_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_1130_1043_8027 =
- {0x1043, 0x8027, pci_subsys_8086_1130_1043_8027, 0};
-#undef pci_ss_info_1043_8027
-#define pci_ss_info_1043_8027 pci_ss_info_8086_1130_1043_8027
-static const pciSubsystemInfo pci_ss_info_8086_1130_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_1130_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_1130_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_1130_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_1130_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_1130_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_1130_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_1130_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_1130_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_1132_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_1132_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_1132_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_1132_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_1132_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_1132_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_1132_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_1132_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_1132_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_1132_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_1132_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_1132_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_1161_8086_1161 =
- {0x8086, 0x1161, pci_subsys_8086_1161_8086_1161, 0};
-#undef pci_ss_info_8086_1161
-#define pci_ss_info_8086_1161 pci_ss_info_8086_1161_8086_1161
-static const pciSubsystemInfo pci_ss_info_8086_1200_172a_0000 =
- {0x172a, 0x0000, pci_subsys_8086_1200_172a_0000, 0};
-#undef pci_ss_info_172a_0000
-#define pci_ss_info_172a_0000 pci_ss_info_8086_1200_172a_0000
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3001 =
- {0x0e11, 0x3001, pci_subsys_8086_1229_0e11_3001, 0};
-#undef pci_ss_info_0e11_3001
-#define pci_ss_info_0e11_3001 pci_ss_info_8086_1229_0e11_3001
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3002 =
- {0x0e11, 0x3002, pci_subsys_8086_1229_0e11_3002, 0};
-#undef pci_ss_info_0e11_3002
-#define pci_ss_info_0e11_3002 pci_ss_info_8086_1229_0e11_3002
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3003 =
- {0x0e11, 0x3003, pci_subsys_8086_1229_0e11_3003, 0};
-#undef pci_ss_info_0e11_3003
-#define pci_ss_info_0e11_3003 pci_ss_info_8086_1229_0e11_3003
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3004 =
- {0x0e11, 0x3004, pci_subsys_8086_1229_0e11_3004, 0};
-#undef pci_ss_info_0e11_3004
-#define pci_ss_info_0e11_3004 pci_ss_info_8086_1229_0e11_3004
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3005 =
- {0x0e11, 0x3005, pci_subsys_8086_1229_0e11_3005, 0};
-#undef pci_ss_info_0e11_3005
-#define pci_ss_info_0e11_3005 pci_ss_info_8086_1229_0e11_3005
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3006 =
- {0x0e11, 0x3006, pci_subsys_8086_1229_0e11_3006, 0};
-#undef pci_ss_info_0e11_3006
-#define pci_ss_info_0e11_3006 pci_ss_info_8086_1229_0e11_3006
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3007 =
- {0x0e11, 0x3007, pci_subsys_8086_1229_0e11_3007, 0};
-#undef pci_ss_info_0e11_3007
-#define pci_ss_info_0e11_3007 pci_ss_info_8086_1229_0e11_3007
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b01e =
- {0x0e11, 0xb01e, pci_subsys_8086_1229_0e11_b01e, 0};
-#undef pci_ss_info_0e11_b01e
-#define pci_ss_info_0e11_b01e pci_ss_info_8086_1229_0e11_b01e
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b01f =
- {0x0e11, 0xb01f, pci_subsys_8086_1229_0e11_b01f, 0};
-#undef pci_ss_info_0e11_b01f
-#define pci_ss_info_0e11_b01f pci_ss_info_8086_1229_0e11_b01f
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b02f =
- {0x0e11, 0xb02f, pci_subsys_8086_1229_0e11_b02f, 0};
-#undef pci_ss_info_0e11_b02f
-#define pci_ss_info_0e11_b02f pci_ss_info_8086_1229_0e11_b02f
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b04a =
- {0x0e11, 0xb04a, pci_subsys_8086_1229_0e11_b04a, 0};
-#undef pci_ss_info_0e11_b04a
-#define pci_ss_info_0e11_b04a pci_ss_info_8086_1229_0e11_b04a
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0c6 =
- {0x0e11, 0xb0c6, pci_subsys_8086_1229_0e11_b0c6, 0};
-#undef pci_ss_info_0e11_b0c6
-#define pci_ss_info_0e11_b0c6 pci_ss_info_8086_1229_0e11_b0c6
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0c7 =
- {0x0e11, 0xb0c7, pci_subsys_8086_1229_0e11_b0c7, 0};
-#undef pci_ss_info_0e11_b0c7
-#define pci_ss_info_0e11_b0c7 pci_ss_info_8086_1229_0e11_b0c7
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0d7 =
- {0x0e11, 0xb0d7, pci_subsys_8086_1229_0e11_b0d7, 0};
-#undef pci_ss_info_0e11_b0d7
-#define pci_ss_info_0e11_b0d7 pci_ss_info_8086_1229_0e11_b0d7
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0dd =
- {0x0e11, 0xb0dd, pci_subsys_8086_1229_0e11_b0dd, 0};
-#undef pci_ss_info_0e11_b0dd
-#define pci_ss_info_0e11_b0dd pci_ss_info_8086_1229_0e11_b0dd
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0de =
- {0x0e11, 0xb0de, pci_subsys_8086_1229_0e11_b0de, 0};
-#undef pci_ss_info_0e11_b0de
-#define pci_ss_info_0e11_b0de pci_ss_info_8086_1229_0e11_b0de
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0e1 =
- {0x0e11, 0xb0e1, pci_subsys_8086_1229_0e11_b0e1, 0};
-#undef pci_ss_info_0e11_b0e1
-#define pci_ss_info_0e11_b0e1 pci_ss_info_8086_1229_0e11_b0e1
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b134 =
- {0x0e11, 0xb134, pci_subsys_8086_1229_0e11_b134, 0};
-#undef pci_ss_info_0e11_b134
-#define pci_ss_info_0e11_b134 pci_ss_info_8086_1229_0e11_b134
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b13c =
- {0x0e11, 0xb13c, pci_subsys_8086_1229_0e11_b13c, 0};
-#undef pci_ss_info_0e11_b13c
-#define pci_ss_info_0e11_b13c pci_ss_info_8086_1229_0e11_b13c
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b144 =
- {0x0e11, 0xb144, pci_subsys_8086_1229_0e11_b144, 0};
-#undef pci_ss_info_0e11_b144
-#define pci_ss_info_0e11_b144 pci_ss_info_8086_1229_0e11_b144
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b163 =
- {0x0e11, 0xb163, pci_subsys_8086_1229_0e11_b163, 0};
-#undef pci_ss_info_0e11_b163
-#define pci_ss_info_0e11_b163 pci_ss_info_8086_1229_0e11_b163
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b164 =
- {0x0e11, 0xb164, pci_subsys_8086_1229_0e11_b164, 0};
-#undef pci_ss_info_0e11_b164
-#define pci_ss_info_0e11_b164 pci_ss_info_8086_1229_0e11_b164
-static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b1a4 =
- {0x0e11, 0xb1a4, pci_subsys_8086_1229_0e11_b1a4, 0};
-#undef pci_ss_info_0e11_b1a4
-#define pci_ss_info_0e11_b1a4 pci_ss_info_8086_1229_0e11_b1a4
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_005c =
- {0x1014, 0x005c, pci_subsys_8086_1229_1014_005c, 0};
-#undef pci_ss_info_1014_005c
-#define pci_ss_info_1014_005c pci_ss_info_8086_1229_1014_005c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01bc =
- {0x1014, 0x01bc, pci_subsys_8086_1229_1014_01bc, 0};
-#undef pci_ss_info_1014_01bc
-#define pci_ss_info_1014_01bc pci_ss_info_8086_1229_1014_01bc
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01f1 =
- {0x1014, 0x01f1, pci_subsys_8086_1229_1014_01f1, 0};
-#undef pci_ss_info_1014_01f1
-#define pci_ss_info_1014_01f1 pci_ss_info_8086_1229_1014_01f1
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01f2 =
- {0x1014, 0x01f2, pci_subsys_8086_1229_1014_01f2, 0};
-#undef pci_ss_info_1014_01f2
-#define pci_ss_info_1014_01f2 pci_ss_info_8086_1229_1014_01f2
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_0207 =
- {0x1014, 0x0207, pci_subsys_8086_1229_1014_0207, 0};
-#undef pci_ss_info_1014_0207
-#define pci_ss_info_1014_0207 pci_ss_info_8086_1229_1014_0207
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_0232 =
- {0x1014, 0x0232, pci_subsys_8086_1229_1014_0232, 0};
-#undef pci_ss_info_1014_0232
-#define pci_ss_info_1014_0232 pci_ss_info_8086_1229_1014_0232
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_023a =
- {0x1014, 0x023a, pci_subsys_8086_1229_1014_023a, 0};
-#undef pci_ss_info_1014_023a
-#define pci_ss_info_1014_023a pci_ss_info_8086_1229_1014_023a
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_105c =
- {0x1014, 0x105c, pci_subsys_8086_1229_1014_105c, 0};
-#undef pci_ss_info_1014_105c
-#define pci_ss_info_1014_105c pci_ss_info_8086_1229_1014_105c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_2205 =
- {0x1014, 0x2205, pci_subsys_8086_1229_1014_2205, 0};
-#undef pci_ss_info_1014_2205
-#define pci_ss_info_1014_2205 pci_ss_info_8086_1229_1014_2205
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_305c =
- {0x1014, 0x305c, pci_subsys_8086_1229_1014_305c, 0};
-#undef pci_ss_info_1014_305c
-#define pci_ss_info_1014_305c pci_ss_info_8086_1229_1014_305c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_405c =
- {0x1014, 0x405c, pci_subsys_8086_1229_1014_405c, 0};
-#undef pci_ss_info_1014_405c
-#define pci_ss_info_1014_405c pci_ss_info_8086_1229_1014_405c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_505c =
- {0x1014, 0x505c, pci_subsys_8086_1229_1014_505c, 0};
-#undef pci_ss_info_1014_505c
-#define pci_ss_info_1014_505c pci_ss_info_8086_1229_1014_505c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_605c =
- {0x1014, 0x605c, pci_subsys_8086_1229_1014_605c, 0};
-#undef pci_ss_info_1014_605c
-#define pci_ss_info_1014_605c pci_ss_info_8086_1229_1014_605c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_705c =
- {0x1014, 0x705c, pci_subsys_8086_1229_1014_705c, 0};
-#undef pci_ss_info_1014_705c
-#define pci_ss_info_1014_705c pci_ss_info_8086_1229_1014_705c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1014_805c =
- {0x1014, 0x805c, pci_subsys_8086_1229_1014_805c, 0};
-#undef pci_ss_info_1014_805c
-#define pci_ss_info_1014_805c pci_ss_info_8086_1229_1014_805c
-static const pciSubsystemInfo pci_ss_info_8086_1229_1028_009b =
- {0x1028, 0x009b, pci_subsys_8086_1229_1028_009b, 0};
-#undef pci_ss_info_1028_009b
-#define pci_ss_info_1028_009b pci_ss_info_8086_1229_1028_009b
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8000 =
- {0x1033, 0x8000, pci_subsys_8086_1229_1033_8000, 0};
-#undef pci_ss_info_1033_8000
-#define pci_ss_info_1033_8000 pci_ss_info_8086_1229_1033_8000
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8016 =
- {0x1033, 0x8016, pci_subsys_8086_1229_1033_8016, 0};
-#undef pci_ss_info_1033_8016
-#define pci_ss_info_1033_8016 pci_ss_info_8086_1229_1033_8016
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_801f =
- {0x1033, 0x801f, pci_subsys_8086_1229_1033_801f, 0};
-#undef pci_ss_info_1033_801f
-#define pci_ss_info_1033_801f pci_ss_info_8086_1229_1033_801f
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8026 =
- {0x1033, 0x8026, pci_subsys_8086_1229_1033_8026, 0};
-#undef pci_ss_info_1033_8026
-#define pci_ss_info_1033_8026 pci_ss_info_8086_1229_1033_8026
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8063 =
- {0x1033, 0x8063, pci_subsys_8086_1229_1033_8063, 0};
-#undef pci_ss_info_1033_8063
-#define pci_ss_info_1033_8063 pci_ss_info_8086_1229_1033_8063
-static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8064 =
- {0x1033, 0x8064, pci_subsys_8086_1229_1033_8064, 0};
-#undef pci_ss_info_1033_8064
-#define pci_ss_info_1033_8064 pci_ss_info_8086_1229_1033_8064
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10c0 =
- {0x103c, 0x10c0, pci_subsys_8086_1229_103c_10c0, 0};
-#undef pci_ss_info_103c_10c0
-#define pci_ss_info_103c_10c0 pci_ss_info_8086_1229_103c_10c0
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10c3 =
- {0x103c, 0x10c3, pci_subsys_8086_1229_103c_10c3, 0};
-#undef pci_ss_info_103c_10c3
-#define pci_ss_info_103c_10c3 pci_ss_info_8086_1229_103c_10c3
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10ca =
- {0x103c, 0x10ca, pci_subsys_8086_1229_103c_10ca, 0};
-#undef pci_ss_info_103c_10ca
-#define pci_ss_info_103c_10ca pci_ss_info_8086_1229_103c_10ca
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10cb =
- {0x103c, 0x10cb, pci_subsys_8086_1229_103c_10cb, 0};
-#undef pci_ss_info_103c_10cb
-#define pci_ss_info_103c_10cb pci_ss_info_8086_1229_103c_10cb
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10e3 =
- {0x103c, 0x10e3, pci_subsys_8086_1229_103c_10e3, 0};
-#undef pci_ss_info_103c_10e3
-#define pci_ss_info_103c_10e3 pci_ss_info_8086_1229_103c_10e3
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10e4 =
- {0x103c, 0x10e4, pci_subsys_8086_1229_103c_10e4, 0};
-#undef pci_ss_info_103c_10e4
-#define pci_ss_info_103c_10e4 pci_ss_info_8086_1229_103c_10e4
-static const pciSubsystemInfo pci_ss_info_8086_1229_103c_1200 =
- {0x103c, 0x1200, pci_subsys_8086_1229_103c_1200, 0};
-#undef pci_ss_info_103c_1200
-#define pci_ss_info_103c_1200 pci_ss_info_8086_1229_103c_1200
-static const pciSubsystemInfo pci_ss_info_8086_1229_10c3_1100 =
- {0x10c3, 0x1100, pci_subsys_8086_1229_10c3_1100, 0};
-#undef pci_ss_info_10c3_1100
-#define pci_ss_info_10c3_1100 pci_ss_info_8086_1229_10c3_1100
-static const pciSubsystemInfo pci_ss_info_8086_1229_10cf_1115 =
- {0x10cf, 0x1115, pci_subsys_8086_1229_10cf_1115, 0};
-#undef pci_ss_info_10cf_1115
-#define pci_ss_info_10cf_1115 pci_ss_info_8086_1229_10cf_1115
-static const pciSubsystemInfo pci_ss_info_8086_1229_10cf_1143 =
- {0x10cf, 0x1143, pci_subsys_8086_1229_10cf_1143, 0};
-#undef pci_ss_info_10cf_1143
-#define pci_ss_info_10cf_1143 pci_ss_info_8086_1229_10cf_1143
-static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0001 =
- {0x1179, 0x0001, pci_subsys_8086_1229_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_8086_1229_1179_0001
-static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0002 =
- {0x1179, 0x0002, pci_subsys_8086_1229_1179_0002, 0};
-#undef pci_ss_info_1179_0002
-#define pci_ss_info_1179_0002 pci_ss_info_8086_1229_1179_0002
-static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0003 =
- {0x1179, 0x0003, pci_subsys_8086_1229_1179_0003, 0};
-#undef pci_ss_info_1179_0003
-#define pci_ss_info_1179_0003 pci_ss_info_8086_1229_1179_0003
-static const pciSubsystemInfo pci_ss_info_8086_1229_1259_2560 =
- {0x1259, 0x2560, pci_subsys_8086_1229_1259_2560, 0};
-#undef pci_ss_info_1259_2560
-#define pci_ss_info_1259_2560 pci_ss_info_8086_1229_1259_2560
-static const pciSubsystemInfo pci_ss_info_8086_1229_1259_2561 =
- {0x1259, 0x2561, pci_subsys_8086_1229_1259_2561, 0};
-#undef pci_ss_info_1259_2561
-#define pci_ss_info_1259_2561 pci_ss_info_8086_1229_1259_2561
-static const pciSubsystemInfo pci_ss_info_8086_1229_1266_0001 =
- {0x1266, 0x0001, pci_subsys_8086_1229_1266_0001, 0};
-#undef pci_ss_info_1266_0001
-#define pci_ss_info_1266_0001 pci_ss_info_8086_1229_1266_0001
-static const pciSubsystemInfo pci_ss_info_8086_1229_144d_2501 =
- {0x144d, 0x2501, pci_subsys_8086_1229_144d_2501, 0};
-#undef pci_ss_info_144d_2501
-#define pci_ss_info_144d_2501 pci_ss_info_8086_1229_144d_2501
-static const pciSubsystemInfo pci_ss_info_8086_1229_144d_2502 =
- {0x144d, 0x2502, pci_subsys_8086_1229_144d_2502, 0};
-#undef pci_ss_info_144d_2502
-#define pci_ss_info_144d_2502 pci_ss_info_8086_1229_144d_2502
-static const pciSubsystemInfo pci_ss_info_8086_1229_1668_1100 =
- {0x1668, 0x1100, pci_subsys_8086_1229_1668_1100, 0};
-#undef pci_ss_info_1668_1100
-#define pci_ss_info_1668_1100 pci_ss_info_8086_1229_1668_1100
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0001 =
- {0x8086, 0x0001, pci_subsys_8086_1229_8086_0001, 0};
-#undef pci_ss_info_8086_0001
-#define pci_ss_info_8086_0001 pci_ss_info_8086_1229_8086_0001
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0002 =
- {0x8086, 0x0002, pci_subsys_8086_1229_8086_0002, 0};
-#undef pci_ss_info_8086_0002
-#define pci_ss_info_8086_0002 pci_ss_info_8086_1229_8086_0002
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0003 =
- {0x8086, 0x0003, pci_subsys_8086_1229_8086_0003, 0};
-#undef pci_ss_info_8086_0003
-#define pci_ss_info_8086_0003 pci_ss_info_8086_1229_8086_0003
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0004 =
- {0x8086, 0x0004, pci_subsys_8086_1229_8086_0004, 0};
-#undef pci_ss_info_8086_0004
-#define pci_ss_info_8086_0004 pci_ss_info_8086_1229_8086_0004
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0005 =
- {0x8086, 0x0005, pci_subsys_8086_1229_8086_0005, 0};
-#undef pci_ss_info_8086_0005
-#define pci_ss_info_8086_0005 pci_ss_info_8086_1229_8086_0005
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0006 =
- {0x8086, 0x0006, pci_subsys_8086_1229_8086_0006, 0};
-#undef pci_ss_info_8086_0006
-#define pci_ss_info_8086_0006 pci_ss_info_8086_1229_8086_0006
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0007 =
- {0x8086, 0x0007, pci_subsys_8086_1229_8086_0007, 0};
-#undef pci_ss_info_8086_0007
-#define pci_ss_info_8086_0007 pci_ss_info_8086_1229_8086_0007
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0008 =
- {0x8086, 0x0008, pci_subsys_8086_1229_8086_0008, 0};
-#undef pci_ss_info_8086_0008
-#define pci_ss_info_8086_0008 pci_ss_info_8086_1229_8086_0008
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0009 =
- {0x8086, 0x0009, pci_subsys_8086_1229_8086_0009, 0};
-#undef pci_ss_info_8086_0009
-#define pci_ss_info_8086_0009 pci_ss_info_8086_1229_8086_0009
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000a =
- {0x8086, 0x000a, pci_subsys_8086_1229_8086_000a, 0};
-#undef pci_ss_info_8086_000a
-#define pci_ss_info_8086_000a pci_ss_info_8086_1229_8086_000a
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000b =
- {0x8086, 0x000b, pci_subsys_8086_1229_8086_000b, 0};
-#undef pci_ss_info_8086_000b
-#define pci_ss_info_8086_000b pci_ss_info_8086_1229_8086_000b
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000c =
- {0x8086, 0x000c, pci_subsys_8086_1229_8086_000c, 0};
-#undef pci_ss_info_8086_000c
-#define pci_ss_info_8086_000c pci_ss_info_8086_1229_8086_000c
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000d =
- {0x8086, 0x000d, pci_subsys_8086_1229_8086_000d, 0};
-#undef pci_ss_info_8086_000d
-#define pci_ss_info_8086_000d pci_ss_info_8086_1229_8086_000d
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000e =
- {0x8086, 0x000e, pci_subsys_8086_1229_8086_000e, 0};
-#undef pci_ss_info_8086_000e
-#define pci_ss_info_8086_000e pci_ss_info_8086_1229_8086_000e
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000f =
- {0x8086, 0x000f, pci_subsys_8086_1229_8086_000f, 0};
-#undef pci_ss_info_8086_000f
-#define pci_ss_info_8086_000f pci_ss_info_8086_1229_8086_000f
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0010 =
- {0x8086, 0x0010, pci_subsys_8086_1229_8086_0010, 0};
-#undef pci_ss_info_8086_0010
-#define pci_ss_info_8086_0010 pci_ss_info_8086_1229_8086_0010
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0011 =
- {0x8086, 0x0011, pci_subsys_8086_1229_8086_0011, 0};
-#undef pci_ss_info_8086_0011
-#define pci_ss_info_8086_0011 pci_ss_info_8086_1229_8086_0011
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0012 =
- {0x8086, 0x0012, pci_subsys_8086_1229_8086_0012, 0};
-#undef pci_ss_info_8086_0012
-#define pci_ss_info_8086_0012 pci_ss_info_8086_1229_8086_0012
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0013 =
- {0x8086, 0x0013, pci_subsys_8086_1229_8086_0013, 0};
-#undef pci_ss_info_8086_0013
-#define pci_ss_info_8086_0013 pci_ss_info_8086_1229_8086_0013
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0030 =
- {0x8086, 0x0030, pci_subsys_8086_1229_8086_0030, 0};
-#undef pci_ss_info_8086_0030
-#define pci_ss_info_8086_0030 pci_ss_info_8086_1229_8086_0030
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0031 =
- {0x8086, 0x0031, pci_subsys_8086_1229_8086_0031, 0};
-#undef pci_ss_info_8086_0031
-#define pci_ss_info_8086_0031 pci_ss_info_8086_1229_8086_0031
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0040 =
- {0x8086, 0x0040, pci_subsys_8086_1229_8086_0040, 0};
-#undef pci_ss_info_8086_0040
-#define pci_ss_info_8086_0040 pci_ss_info_8086_1229_8086_0040
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0041 =
- {0x8086, 0x0041, pci_subsys_8086_1229_8086_0041, 0};
-#undef pci_ss_info_8086_0041
-#define pci_ss_info_8086_0041 pci_ss_info_8086_1229_8086_0041
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0042 =
- {0x8086, 0x0042, pci_subsys_8086_1229_8086_0042, 0};
-#undef pci_ss_info_8086_0042
-#define pci_ss_info_8086_0042 pci_ss_info_8086_1229_8086_0042
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0050 =
- {0x8086, 0x0050, pci_subsys_8086_1229_8086_0050, 0};
-#undef pci_ss_info_8086_0050
-#define pci_ss_info_8086_0050 pci_ss_info_8086_1229_8086_0050
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1009 =
- {0x8086, 0x1009, pci_subsys_8086_1229_8086_1009, 0};
-#undef pci_ss_info_8086_1009
-#define pci_ss_info_8086_1009 pci_ss_info_8086_1229_8086_1009
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_100c =
- {0x8086, 0x100c, pci_subsys_8086_1229_8086_100c, 0};
-#undef pci_ss_info_8086_100c
-#define pci_ss_info_8086_100c pci_ss_info_8086_1229_8086_100c
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1012 =
- {0x8086, 0x1012, pci_subsys_8086_1229_8086_1012, 0};
-#undef pci_ss_info_8086_1012
-#define pci_ss_info_8086_1012 pci_ss_info_8086_1229_8086_1012
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1013 =
- {0x8086, 0x1013, pci_subsys_8086_1229_8086_1013, 0};
-#undef pci_ss_info_8086_1013
-#define pci_ss_info_8086_1013 pci_ss_info_8086_1229_8086_1013
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1015 =
- {0x8086, 0x1015, pci_subsys_8086_1229_8086_1015, 0};
-#undef pci_ss_info_8086_1015
-#define pci_ss_info_8086_1015 pci_ss_info_8086_1229_8086_1015
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1017 =
- {0x8086, 0x1017, pci_subsys_8086_1229_8086_1017, 0};
-#undef pci_ss_info_8086_1017
-#define pci_ss_info_8086_1017 pci_ss_info_8086_1229_8086_1017
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1030 =
- {0x8086, 0x1030, pci_subsys_8086_1229_8086_1030, 0};
-#undef pci_ss_info_8086_1030
-#define pci_ss_info_8086_1030 pci_ss_info_8086_1229_8086_1030
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1040 =
- {0x8086, 0x1040, pci_subsys_8086_1229_8086_1040, 0};
-#undef pci_ss_info_8086_1040
-#define pci_ss_info_8086_1040 pci_ss_info_8086_1229_8086_1040
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1041 =
- {0x8086, 0x1041, pci_subsys_8086_1229_8086_1041, 0};
-#undef pci_ss_info_8086_1041
-#define pci_ss_info_8086_1041 pci_ss_info_8086_1229_8086_1041
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1042 =
- {0x8086, 0x1042, pci_subsys_8086_1229_8086_1042, 0};
-#undef pci_ss_info_8086_1042
-#define pci_ss_info_8086_1042 pci_ss_info_8086_1229_8086_1042
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1050 =
- {0x8086, 0x1050, pci_subsys_8086_1229_8086_1050, 0};
-#undef pci_ss_info_8086_1050
-#define pci_ss_info_8086_1050 pci_ss_info_8086_1229_8086_1050
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1051 =
- {0x8086, 0x1051, pci_subsys_8086_1229_8086_1051, 0};
-#undef pci_ss_info_8086_1051
-#define pci_ss_info_8086_1051 pci_ss_info_8086_1229_8086_1051
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1052 =
- {0x8086, 0x1052, pci_subsys_8086_1229_8086_1052, 0};
-#undef pci_ss_info_8086_1052
-#define pci_ss_info_8086_1052 pci_ss_info_8086_1229_8086_1052
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_10f0 =
- {0x8086, 0x10f0, pci_subsys_8086_1229_8086_10f0, 0};
-#undef pci_ss_info_8086_10f0
-#define pci_ss_info_8086_10f0 pci_ss_info_8086_1229_8086_10f0
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2009 =
- {0x8086, 0x2009, pci_subsys_8086_1229_8086_2009, 0};
-#undef pci_ss_info_8086_2009
-#define pci_ss_info_8086_2009 pci_ss_info_8086_1229_8086_2009
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200d =
- {0x8086, 0x200d, pci_subsys_8086_1229_8086_200d, 0};
-#undef pci_ss_info_8086_200d
-#define pci_ss_info_8086_200d pci_ss_info_8086_1229_8086_200d
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200e =
- {0x8086, 0x200e, pci_subsys_8086_1229_8086_200e, 0};
-#undef pci_ss_info_8086_200e
-#define pci_ss_info_8086_200e pci_ss_info_8086_1229_8086_200e
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200f =
- {0x8086, 0x200f, pci_subsys_8086_1229_8086_200f, 0};
-#undef pci_ss_info_8086_200f
-#define pci_ss_info_8086_200f pci_ss_info_8086_1229_8086_200f
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2010 =
- {0x8086, 0x2010, pci_subsys_8086_1229_8086_2010, 0};
-#undef pci_ss_info_8086_2010
-#define pci_ss_info_8086_2010 pci_ss_info_8086_1229_8086_2010
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2013 =
- {0x8086, 0x2013, pci_subsys_8086_1229_8086_2013, 0};
-#undef pci_ss_info_8086_2013
-#define pci_ss_info_8086_2013 pci_ss_info_8086_1229_8086_2013
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2016 =
- {0x8086, 0x2016, pci_subsys_8086_1229_8086_2016, 0};
-#undef pci_ss_info_8086_2016
-#define pci_ss_info_8086_2016 pci_ss_info_8086_1229_8086_2016
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2017 =
- {0x8086, 0x2017, pci_subsys_8086_1229_8086_2017, 0};
-#undef pci_ss_info_8086_2017
-#define pci_ss_info_8086_2017 pci_ss_info_8086_1229_8086_2017
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2018 =
- {0x8086, 0x2018, pci_subsys_8086_1229_8086_2018, 0};
-#undef pci_ss_info_8086_2018
-#define pci_ss_info_8086_2018 pci_ss_info_8086_1229_8086_2018
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2019 =
- {0x8086, 0x2019, pci_subsys_8086_1229_8086_2019, 0};
-#undef pci_ss_info_8086_2019
-#define pci_ss_info_8086_2019 pci_ss_info_8086_1229_8086_2019
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2101 =
- {0x8086, 0x2101, pci_subsys_8086_1229_8086_2101, 0};
-#undef pci_ss_info_8086_2101
-#define pci_ss_info_8086_2101 pci_ss_info_8086_1229_8086_2101
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2102 =
- {0x8086, 0x2102, pci_subsys_8086_1229_8086_2102, 0};
-#undef pci_ss_info_8086_2102
-#define pci_ss_info_8086_2102 pci_ss_info_8086_1229_8086_2102
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2103 =
- {0x8086, 0x2103, pci_subsys_8086_1229_8086_2103, 0};
-#undef pci_ss_info_8086_2103
-#define pci_ss_info_8086_2103 pci_ss_info_8086_1229_8086_2103
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2104 =
- {0x8086, 0x2104, pci_subsys_8086_1229_8086_2104, 0};
-#undef pci_ss_info_8086_2104
-#define pci_ss_info_8086_2104 pci_ss_info_8086_1229_8086_2104
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2105 =
- {0x8086, 0x2105, pci_subsys_8086_1229_8086_2105, 0};
-#undef pci_ss_info_8086_2105
-#define pci_ss_info_8086_2105 pci_ss_info_8086_1229_8086_2105
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2106 =
- {0x8086, 0x2106, pci_subsys_8086_1229_8086_2106, 0};
-#undef pci_ss_info_8086_2106
-#define pci_ss_info_8086_2106 pci_ss_info_8086_1229_8086_2106
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2107 =
- {0x8086, 0x2107, pci_subsys_8086_1229_8086_2107, 0};
-#undef pci_ss_info_8086_2107
-#define pci_ss_info_8086_2107 pci_ss_info_8086_1229_8086_2107
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2108 =
- {0x8086, 0x2108, pci_subsys_8086_1229_8086_2108, 0};
-#undef pci_ss_info_8086_2108
-#define pci_ss_info_8086_2108 pci_ss_info_8086_1229_8086_2108
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2200 =
- {0x8086, 0x2200, pci_subsys_8086_1229_8086_2200, 0};
-#undef pci_ss_info_8086_2200
-#define pci_ss_info_8086_2200 pci_ss_info_8086_1229_8086_2200
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2201 =
- {0x8086, 0x2201, pci_subsys_8086_1229_8086_2201, 0};
-#undef pci_ss_info_8086_2201
-#define pci_ss_info_8086_2201 pci_ss_info_8086_1229_8086_2201
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2202 =
- {0x8086, 0x2202, pci_subsys_8086_1229_8086_2202, 0};
-#undef pci_ss_info_8086_2202
-#define pci_ss_info_8086_2202 pci_ss_info_8086_1229_8086_2202
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2203 =
- {0x8086, 0x2203, pci_subsys_8086_1229_8086_2203, 0};
-#undef pci_ss_info_8086_2203
-#define pci_ss_info_8086_2203 pci_ss_info_8086_1229_8086_2203
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2204 =
- {0x8086, 0x2204, pci_subsys_8086_1229_8086_2204, 0};
-#undef pci_ss_info_8086_2204
-#define pci_ss_info_8086_2204 pci_ss_info_8086_1229_8086_2204
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2205 =
- {0x8086, 0x2205, pci_subsys_8086_1229_8086_2205, 0};
-#undef pci_ss_info_8086_2205
-#define pci_ss_info_8086_2205 pci_ss_info_8086_1229_8086_2205
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2206 =
- {0x8086, 0x2206, pci_subsys_8086_1229_8086_2206, 0};
-#undef pci_ss_info_8086_2206
-#define pci_ss_info_8086_2206 pci_ss_info_8086_1229_8086_2206
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2207 =
- {0x8086, 0x2207, pci_subsys_8086_1229_8086_2207, 0};
-#undef pci_ss_info_8086_2207
-#define pci_ss_info_8086_2207 pci_ss_info_8086_1229_8086_2207
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2208 =
- {0x8086, 0x2208, pci_subsys_8086_1229_8086_2208, 0};
-#undef pci_ss_info_8086_2208
-#define pci_ss_info_8086_2208 pci_ss_info_8086_1229_8086_2208
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2402 =
- {0x8086, 0x2402, pci_subsys_8086_1229_8086_2402, 0};
-#undef pci_ss_info_8086_2402
-#define pci_ss_info_8086_2402 pci_ss_info_8086_1229_8086_2402
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2407 =
- {0x8086, 0x2407, pci_subsys_8086_1229_8086_2407, 0};
-#undef pci_ss_info_8086_2407
-#define pci_ss_info_8086_2407 pci_ss_info_8086_1229_8086_2407
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2408 =
- {0x8086, 0x2408, pci_subsys_8086_1229_8086_2408, 0};
-#undef pci_ss_info_8086_2408
-#define pci_ss_info_8086_2408 pci_ss_info_8086_1229_8086_2408
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2409 =
- {0x8086, 0x2409, pci_subsys_8086_1229_8086_2409, 0};
-#undef pci_ss_info_8086_2409
-#define pci_ss_info_8086_2409 pci_ss_info_8086_1229_8086_2409
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_240f =
- {0x8086, 0x240f, pci_subsys_8086_1229_8086_240f, 0};
-#undef pci_ss_info_8086_240f
-#define pci_ss_info_8086_240f pci_ss_info_8086_1229_8086_240f
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2410 =
- {0x8086, 0x2410, pci_subsys_8086_1229_8086_2410, 0};
-#undef pci_ss_info_8086_2410
-#define pci_ss_info_8086_2410 pci_ss_info_8086_1229_8086_2410
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2411 =
- {0x8086, 0x2411, pci_subsys_8086_1229_8086_2411, 0};
-#undef pci_ss_info_8086_2411
-#define pci_ss_info_8086_2411 pci_ss_info_8086_1229_8086_2411
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2412 =
- {0x8086, 0x2412, pci_subsys_8086_1229_8086_2412, 0};
-#undef pci_ss_info_8086_2412
-#define pci_ss_info_8086_2412 pci_ss_info_8086_1229_8086_2412
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2413 =
- {0x8086, 0x2413, pci_subsys_8086_1229_8086_2413, 0};
-#undef pci_ss_info_8086_2413
-#define pci_ss_info_8086_2413 pci_ss_info_8086_1229_8086_2413
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3000 =
- {0x8086, 0x3000, pci_subsys_8086_1229_8086_3000, 0};
-#undef pci_ss_info_8086_3000
-#define pci_ss_info_8086_3000 pci_ss_info_8086_1229_8086_3000
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3001 =
- {0x8086, 0x3001, pci_subsys_8086_1229_8086_3001, 0};
-#undef pci_ss_info_8086_3001
-#define pci_ss_info_8086_3001 pci_ss_info_8086_1229_8086_3001
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3002 =
- {0x8086, 0x3002, pci_subsys_8086_1229_8086_3002, 0};
-#undef pci_ss_info_8086_3002
-#define pci_ss_info_8086_3002 pci_ss_info_8086_1229_8086_3002
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3006 =
- {0x8086, 0x3006, pci_subsys_8086_1229_8086_3006, 0};
-#undef pci_ss_info_8086_3006
-#define pci_ss_info_8086_3006 pci_ss_info_8086_1229_8086_3006
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3007 =
- {0x8086, 0x3007, pci_subsys_8086_1229_8086_3007, 0};
-#undef pci_ss_info_8086_3007
-#define pci_ss_info_8086_3007 pci_ss_info_8086_1229_8086_3007
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3008 =
- {0x8086, 0x3008, pci_subsys_8086_1229_8086_3008, 0};
-#undef pci_ss_info_8086_3008
-#define pci_ss_info_8086_3008 pci_ss_info_8086_1229_8086_3008
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3010 =
- {0x8086, 0x3010, pci_subsys_8086_1229_8086_3010, 0};
-#undef pci_ss_info_8086_3010
-#define pci_ss_info_8086_3010 pci_ss_info_8086_1229_8086_3010
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3011 =
- {0x8086, 0x3011, pci_subsys_8086_1229_8086_3011, 0};
-#undef pci_ss_info_8086_3011
-#define pci_ss_info_8086_3011 pci_ss_info_8086_1229_8086_3011
-static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3012 =
- {0x8086, 0x3012, pci_subsys_8086_1229_8086_3012, 0};
-#undef pci_ss_info_8086_3012
-#define pci_ss_info_8086_3012 pci_ss_info_8086_1229_8086_3012
-static const pciSubsystemInfo pci_ss_info_8086_1361_8086_1361 =
- {0x8086, 0x1361, pci_subsys_8086_1361_8086_1361, 0};
-#undef pci_ss_info_8086_1361
-#define pci_ss_info_8086_1361 pci_ss_info_8086_1361_8086_1361
-static const pciSubsystemInfo pci_ss_info_8086_1361_8086_8000 =
- {0x8086, 0x8000, pci_subsys_8086_1361_8086_8000, 0};
-#undef pci_ss_info_8086_8000
-#define pci_ss_info_8086_8000 pci_ss_info_8086_1361_8086_8000
-static const pciSubsystemInfo pci_ss_info_8086_1461_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_1461_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_1461_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0431 =
- {0x101e, 0x0431, pci_subsys_8086_1960_101e_0431, 0};
-#undef pci_ss_info_101e_0431
-#define pci_ss_info_101e_0431 pci_ss_info_8086_1960_101e_0431
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0438 =
- {0x101e, 0x0438, pci_subsys_8086_1960_101e_0438, 0};
-#undef pci_ss_info_101e_0438
-#define pci_ss_info_101e_0438 pci_ss_info_8086_1960_101e_0438
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0466 =
- {0x101e, 0x0466, pci_subsys_8086_1960_101e_0466, 0};
-#undef pci_ss_info_101e_0466
-#define pci_ss_info_101e_0466 pci_ss_info_8086_1960_101e_0466
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0467 =
- {0x101e, 0x0467, pci_subsys_8086_1960_101e_0467, 0};
-#undef pci_ss_info_101e_0467
-#define pci_ss_info_101e_0467 pci_ss_info_8086_1960_101e_0467
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0490 =
- {0x101e, 0x0490, pci_subsys_8086_1960_101e_0490, 0};
-#undef pci_ss_info_101e_0490
-#define pci_ss_info_101e_0490 pci_ss_info_8086_1960_101e_0490
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0762 =
- {0x101e, 0x0762, pci_subsys_8086_1960_101e_0762, 0};
-#undef pci_ss_info_101e_0762
-#define pci_ss_info_101e_0762 pci_ss_info_8086_1960_101e_0762
-static const pciSubsystemInfo pci_ss_info_8086_1960_101e_09a0 =
- {0x101e, 0x09a0, pci_subsys_8086_1960_101e_09a0, 0};
-#undef pci_ss_info_101e_09a0
-#define pci_ss_info_101e_09a0 pci_ss_info_8086_1960_101e_09a0
-static const pciSubsystemInfo pci_ss_info_8086_1960_1028_0467 =
- {0x1028, 0x0467, pci_subsys_8086_1960_1028_0467, 0};
-#undef pci_ss_info_1028_0467
-#define pci_ss_info_1028_0467 pci_ss_info_8086_1960_1028_0467
-static const pciSubsystemInfo pci_ss_info_8086_1960_1028_1111 =
- {0x1028, 0x1111, pci_subsys_8086_1960_1028_1111, 0};
-#undef pci_ss_info_1028_1111
-#define pci_ss_info_1028_1111 pci_ss_info_8086_1960_1028_1111
-static const pciSubsystemInfo pci_ss_info_8086_1960_103c_03a2 =
- {0x103c, 0x03a2, pci_subsys_8086_1960_103c_03a2, 0};
-#undef pci_ss_info_103c_03a2
-#define pci_ss_info_103c_03a2 pci_ss_info_8086_1960_103c_03a2
-static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10c6 =
- {0x103c, 0x10c6, pci_subsys_8086_1960_103c_10c6, 0};
-#undef pci_ss_info_103c_10c6
-#define pci_ss_info_103c_10c6 pci_ss_info_8086_1960_103c_10c6
-static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10c7 =
- {0x103c, 0x10c7, pci_subsys_8086_1960_103c_10c7, 0};
-#undef pci_ss_info_103c_10c7
-#define pci_ss_info_103c_10c7 pci_ss_info_8086_1960_103c_10c7
-static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10cc =
- {0x103c, 0x10cc, pci_subsys_8086_1960_103c_10cc, 0};
-#undef pci_ss_info_103c_10cc
-#define pci_ss_info_103c_10cc pci_ss_info_8086_1960_103c_10cc
-static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10cd =
- {0x103c, 0x10cd, pci_subsys_8086_1960_103c_10cd, 0};
-#undef pci_ss_info_103c_10cd
-#define pci_ss_info_103c_10cd pci_ss_info_8086_1960_103c_10cd
-static const pciSubsystemInfo pci_ss_info_8086_1960_105a_0000 =
- {0x105a, 0x0000, pci_subsys_8086_1960_105a_0000, 0};
-#undef pci_ss_info_105a_0000
-#define pci_ss_info_105a_0000 pci_ss_info_8086_1960_105a_0000
-static const pciSubsystemInfo pci_ss_info_8086_1960_105a_2168 =
- {0x105a, 0x2168, pci_subsys_8086_1960_105a_2168, 0};
-#undef pci_ss_info_105a_2168
-#define pci_ss_info_105a_2168 pci_ss_info_8086_1960_105a_2168
-static const pciSubsystemInfo pci_ss_info_8086_1960_105a_5168 =
- {0x105a, 0x5168, pci_subsys_8086_1960_105a_5168, 0};
-#undef pci_ss_info_105a_5168
-#define pci_ss_info_105a_5168 pci_ss_info_8086_1960_105a_5168
-static const pciSubsystemInfo pci_ss_info_8086_1960_1111_1111 =
- {0x1111, 0x1111, pci_subsys_8086_1960_1111_1111, 0};
-#undef pci_ss_info_1111_1111
-#define pci_ss_info_1111_1111 pci_ss_info_8086_1960_1111_1111
-static const pciSubsystemInfo pci_ss_info_8086_1960_1111_1112 =
- {0x1111, 0x1112, pci_subsys_8086_1960_1111_1112, 0};
-#undef pci_ss_info_1111_1112
-#define pci_ss_info_1111_1112 pci_ss_info_8086_1960_1111_1112
-static const pciSubsystemInfo pci_ss_info_8086_1960_113c_03a2 =
- {0x113c, 0x03a2, pci_subsys_8086_1960_113c_03a2, 0};
-#undef pci_ss_info_113c_03a2
-#define pci_ss_info_113c_03a2 pci_ss_info_8086_1960_113c_03a2
-static const pciSubsystemInfo pci_ss_info_8086_1962_105a_0000 =
- {0x105a, 0x0000, pci_subsys_8086_1962_105a_0000, 0};
-#undef pci_ss_info_105a_0000
-#define pci_ss_info_105a_0000 pci_ss_info_8086_1962_105a_0000
-static const pciSubsystemInfo pci_ss_info_8086_2415_1028_0095 =
- {0x1028, 0x0095, pci_subsys_8086_2415_1028_0095, 0};
-#undef pci_ss_info_1028_0095
-#define pci_ss_info_1028_0095 pci_ss_info_8086_2415_1028_0095
-static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_0040 =
- {0x11d4, 0x0040, pci_subsys_8086_2415_11d4_0040, 0};
-#undef pci_ss_info_11d4_0040
-#define pci_ss_info_11d4_0040 pci_ss_info_8086_2415_11d4_0040
-static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_0048 =
- {0x11d4, 0x0048, pci_subsys_8086_2415_11d4_0048, 0};
-#undef pci_ss_info_11d4_0048
-#define pci_ss_info_11d4_0048 pci_ss_info_8086_2415_11d4_0048
-static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_5340 =
- {0x11d4, 0x5340, pci_subsys_8086_2415_11d4_5340, 0};
-#undef pci_ss_info_11d4_5340
-#define pci_ss_info_11d4_5340 pci_ss_info_8086_2415_11d4_5340
-static const pciSubsystemInfo pci_ss_info_8086_2425_11d4_0040 =
- {0x11d4, 0x0040, pci_subsys_8086_2425_11d4_0040, 0};
-#undef pci_ss_info_11d4_0040
-#define pci_ss_info_11d4_0040 pci_ss_info_8086_2425_11d4_0040
-static const pciSubsystemInfo pci_ss_info_8086_2425_11d4_0048 =
- {0x11d4, 0x0048, pci_subsys_8086_2425_11d4_0048, 0};
-#undef pci_ss_info_11d4_0048
-#define pci_ss_info_11d4_0048 pci_ss_info_8086_2425_11d4_0048
-static const pciSubsystemInfo pci_ss_info_8086_2442_1014_01c6 =
- {0x1014, 0x01c6, pci_subsys_8086_2442_1014_01c6, 0};
-#undef pci_ss_info_1014_01c6
-#define pci_ss_info_1014_01c6 pci_ss_info_8086_2442_1014_01c6
-static const pciSubsystemInfo pci_ss_info_8086_2442_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_2442_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_2442_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_2442_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_2442_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_2442_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_2442_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_2442_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_2442_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_2442_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_2442_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_2442_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_2442_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_2442_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_2442_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_2443_1014_01c6 =
- {0x1014, 0x01c6, pci_subsys_8086_2443_1014_01c6, 0};
-#undef pci_ss_info_1014_01c6
-#define pci_ss_info_1014_01c6 pci_ss_info_8086_2443_1014_01c6
-static const pciSubsystemInfo pci_ss_info_8086_2443_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_2443_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_2443_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_2443_1043_8027 =
- {0x1043, 0x8027, pci_subsys_8086_2443_1043_8027, 0};
-#undef pci_ss_info_1043_8027
-#define pci_ss_info_1043_8027 pci_ss_info_8086_2443_1043_8027
-static const pciSubsystemInfo pci_ss_info_8086_2443_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_2443_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_2443_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_2443_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_2443_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_2443_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_2443_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_2443_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_2443_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_2443_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_2443_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_2443_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_2444_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_2444_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_2444_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_2444_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_2444_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_2444_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_2444_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_2444_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_2444_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_2444_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_2444_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_2444_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_2445_1014_01c6 =
- {0x1014, 0x01c6, pci_subsys_8086_2445_1014_01c6, 0};
-#undef pci_ss_info_1014_01c6
-#define pci_ss_info_1014_01c6 pci_ss_info_8086_2445_1014_01c6
-static const pciSubsystemInfo pci_ss_info_8086_2445_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_2445_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_2445_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_2445_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_2445_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_2445_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_2445_1462_3370 =
- {0x1462, 0x3370, pci_subsys_8086_2445_1462_3370, 0};
-#undef pci_ss_info_1462_3370
-#define pci_ss_info_1462_3370 pci_ss_info_8086_2445_1462_3370
-static const pciSubsystemInfo pci_ss_info_8086_2445_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_2445_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_2445_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_2445_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_2445_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_2445_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_2446_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_2446_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_2446_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_2446_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_2446_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_2446_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_2449_0e11_0012 =
- {0x0e11, 0x0012, pci_subsys_8086_2449_0e11_0012, 0};
-#undef pci_ss_info_0e11_0012
-#define pci_ss_info_0e11_0012 pci_ss_info_8086_2449_0e11_0012
-static const pciSubsystemInfo pci_ss_info_8086_2449_0e11_0091 =
- {0x0e11, 0x0091, pci_subsys_8086_2449_0e11_0091, 0};
-#undef pci_ss_info_0e11_0091
-#define pci_ss_info_0e11_0091 pci_ss_info_8086_2449_0e11_0091
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01ce =
- {0x1014, 0x01ce, pci_subsys_8086_2449_1014_01ce, 0};
-#undef pci_ss_info_1014_01ce
-#define pci_ss_info_1014_01ce pci_ss_info_8086_2449_1014_01ce
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01dc =
- {0x1014, 0x01dc, pci_subsys_8086_2449_1014_01dc, 0};
-#undef pci_ss_info_1014_01dc
-#define pci_ss_info_1014_01dc pci_ss_info_8086_2449_1014_01dc
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01eb =
- {0x1014, 0x01eb, pci_subsys_8086_2449_1014_01eb, 0};
-#undef pci_ss_info_1014_01eb
-#define pci_ss_info_1014_01eb pci_ss_info_8086_2449_1014_01eb
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01ec =
- {0x1014, 0x01ec, pci_subsys_8086_2449_1014_01ec, 0};
-#undef pci_ss_info_1014_01ec
-#define pci_ss_info_1014_01ec pci_ss_info_8086_2449_1014_01ec
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0202 =
- {0x1014, 0x0202, pci_subsys_8086_2449_1014_0202, 0};
-#undef pci_ss_info_1014_0202
-#define pci_ss_info_1014_0202 pci_ss_info_8086_2449_1014_0202
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0205 =
- {0x1014, 0x0205, pci_subsys_8086_2449_1014_0205, 0};
-#undef pci_ss_info_1014_0205
-#define pci_ss_info_1014_0205 pci_ss_info_8086_2449_1014_0205
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0217 =
- {0x1014, 0x0217, pci_subsys_8086_2449_1014_0217, 0};
-#undef pci_ss_info_1014_0217
-#define pci_ss_info_1014_0217 pci_ss_info_8086_2449_1014_0217
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0234 =
- {0x1014, 0x0234, pci_subsys_8086_2449_1014_0234, 0};
-#undef pci_ss_info_1014_0234
-#define pci_ss_info_1014_0234 pci_ss_info_8086_2449_1014_0234
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_023d =
- {0x1014, 0x023d, pci_subsys_8086_2449_1014_023d, 0};
-#undef pci_ss_info_1014_023d
-#define pci_ss_info_1014_023d pci_ss_info_8086_2449_1014_023d
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0244 =
- {0x1014, 0x0244, pci_subsys_8086_2449_1014_0244, 0};
-#undef pci_ss_info_1014_0244
-#define pci_ss_info_1014_0244 pci_ss_info_8086_2449_1014_0244
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0245 =
- {0x1014, 0x0245, pci_subsys_8086_2449_1014_0245, 0};
-#undef pci_ss_info_1014_0245
-#define pci_ss_info_1014_0245 pci_ss_info_8086_2449_1014_0245
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0265 =
- {0x1014, 0x0265, pci_subsys_8086_2449_1014_0265, 0};
-#undef pci_ss_info_1014_0265
-#define pci_ss_info_1014_0265 pci_ss_info_8086_2449_1014_0265
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0267 =
- {0x1014, 0x0267, pci_subsys_8086_2449_1014_0267, 0};
-#undef pci_ss_info_1014_0267
-#define pci_ss_info_1014_0267 pci_ss_info_8086_2449_1014_0267
-static const pciSubsystemInfo pci_ss_info_8086_2449_1014_026a =
- {0x1014, 0x026a, pci_subsys_8086_2449_1014_026a, 0};
-#undef pci_ss_info_1014_026a
-#define pci_ss_info_1014_026a pci_ss_info_8086_2449_1014_026a
-static const pciSubsystemInfo pci_ss_info_8086_2449_109f_315d =
- {0x109f, 0x315d, pci_subsys_8086_2449_109f_315d, 0};
-#undef pci_ss_info_109f_315d
-#define pci_ss_info_109f_315d pci_ss_info_8086_2449_109f_315d
-static const pciSubsystemInfo pci_ss_info_8086_2449_109f_3181 =
- {0x109f, 0x3181, pci_subsys_8086_2449_109f_3181, 0};
-#undef pci_ss_info_109f_3181
-#define pci_ss_info_109f_3181 pci_ss_info_8086_2449_109f_3181
-static const pciSubsystemInfo pci_ss_info_8086_2449_1179_ff01 =
- {0x1179, 0xff01, pci_subsys_8086_2449_1179_ff01, 0};
-#undef pci_ss_info_1179_ff01
-#define pci_ss_info_1179_ff01 pci_ss_info_8086_2449_1179_ff01
-static const pciSubsystemInfo pci_ss_info_8086_2449_1186_7801 =
- {0x1186, 0x7801, pci_subsys_8086_2449_1186_7801, 0};
-#undef pci_ss_info_1186_7801
-#define pci_ss_info_1186_7801 pci_ss_info_8086_2449_1186_7801
-static const pciSubsystemInfo pci_ss_info_8086_2449_144d_2602 =
- {0x144d, 0x2602, pci_subsys_8086_2449_144d_2602, 0};
-#undef pci_ss_info_144d_2602
-#define pci_ss_info_144d_2602 pci_ss_info_8086_2449_144d_2602
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3010 =
- {0x8086, 0x3010, pci_subsys_8086_2449_8086_3010, 0};
-#undef pci_ss_info_8086_3010
-#define pci_ss_info_8086_3010 pci_ss_info_8086_2449_8086_3010
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3011 =
- {0x8086, 0x3011, pci_subsys_8086_2449_8086_3011, 0};
-#undef pci_ss_info_8086_3011
-#define pci_ss_info_8086_3011 pci_ss_info_8086_2449_8086_3011
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3012 =
- {0x8086, 0x3012, pci_subsys_8086_2449_8086_3012, 0};
-#undef pci_ss_info_8086_3012
-#define pci_ss_info_8086_3012 pci_ss_info_8086_2449_8086_3012
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3013 =
- {0x8086, 0x3013, pci_subsys_8086_2449_8086_3013, 0};
-#undef pci_ss_info_8086_3013
-#define pci_ss_info_8086_3013 pci_ss_info_8086_2449_8086_3013
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3014 =
- {0x8086, 0x3014, pci_subsys_8086_2449_8086_3014, 0};
-#undef pci_ss_info_8086_3014
-#define pci_ss_info_8086_3014 pci_ss_info_8086_2449_8086_3014
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3015 =
- {0x8086, 0x3015, pci_subsys_8086_2449_8086_3015, 0};
-#undef pci_ss_info_8086_3015
-#define pci_ss_info_8086_3015 pci_ss_info_8086_2449_8086_3015
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3016 =
- {0x8086, 0x3016, pci_subsys_8086_2449_8086_3016, 0};
-#undef pci_ss_info_8086_3016
-#define pci_ss_info_8086_3016 pci_ss_info_8086_2449_8086_3016
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3017 =
- {0x8086, 0x3017, pci_subsys_8086_2449_8086_3017, 0};
-#undef pci_ss_info_8086_3017
-#define pci_ss_info_8086_3017 pci_ss_info_8086_2449_8086_3017
-static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3018 =
- {0x8086, 0x3018, pci_subsys_8086_2449_8086_3018, 0};
-#undef pci_ss_info_8086_3018
-#define pci_ss_info_8086_3018 pci_ss_info_8086_2449_8086_3018
-static const pciSubsystemInfo pci_ss_info_8086_244a_1025_1016 =
- {0x1025, 0x1016, pci_subsys_8086_244a_1025_1016, 0};
-#undef pci_ss_info_1025_1016
-#define pci_ss_info_1025_1016 pci_ss_info_8086_244a_1025_1016
-static const pciSubsystemInfo pci_ss_info_8086_244a_104d_80df =
- {0x104d, 0x80df, pci_subsys_8086_244a_104d_80df, 0};
-#undef pci_ss_info_104d_80df
-#define pci_ss_info_104d_80df pci_ss_info_8086_244a_104d_80df
-static const pciSubsystemInfo pci_ss_info_8086_244b_1014_01c6 =
- {0x1014, 0x01c6, pci_subsys_8086_244b_1014_01c6, 0};
-#undef pci_ss_info_1014_01c6
-#define pci_ss_info_1014_01c6 pci_ss_info_8086_244b_1014_01c6
-static const pciSubsystemInfo pci_ss_info_8086_244b_1043_8027 =
- {0x1043, 0x8027, pci_subsys_8086_244b_1043_8027, 0};
-#undef pci_ss_info_1043_8027
-#define pci_ss_info_1043_8027 pci_ss_info_8086_244b_1043_8027
-static const pciSubsystemInfo pci_ss_info_8086_244b_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_244b_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_244b_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_244b_8086_4532 =
- {0x8086, 0x4532, pci_subsys_8086_244b_8086_4532, 0};
-#undef pci_ss_info_8086_4532
-#define pci_ss_info_8086_4532 pci_ss_info_8086_244b_8086_4532
-static const pciSubsystemInfo pci_ss_info_8086_244b_8086_4557 =
- {0x8086, 0x4557, pci_subsys_8086_244b_8086_4557, 0};
-#undef pci_ss_info_8086_4557
-#define pci_ss_info_8086_4557 pci_ss_info_8086_244b_8086_4557
-static const pciSubsystemInfo pci_ss_info_8086_2482_1014_0220 =
- {0x1014, 0x0220, pci_subsys_8086_2482_1014_0220, 0};
-#undef pci_ss_info_1014_0220
-#define pci_ss_info_1014_0220 pci_ss_info_8086_2482_1014_0220
-static const pciSubsystemInfo pci_ss_info_8086_2482_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2482_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2482_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2482_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2482_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2482_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2482_8086_1958 =
- {0x8086, 0x1958, pci_subsys_8086_2482_8086_1958, 0};
-#undef pci_ss_info_8086_1958
-#define pci_ss_info_8086_1958 pci_ss_info_8086_2482_8086_1958
-static const pciSubsystemInfo pci_ss_info_8086_2483_1014_0220 =
- {0x1014, 0x0220, pci_subsys_8086_2483_1014_0220, 0};
-#undef pci_ss_info_1014_0220
-#define pci_ss_info_1014_0220 pci_ss_info_8086_2483_1014_0220
-static const pciSubsystemInfo pci_ss_info_8086_2483_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2483_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2483_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2483_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2483_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2483_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2483_8086_1958 =
- {0x8086, 0x1958, pci_subsys_8086_2483_8086_1958, 0};
-#undef pci_ss_info_8086_1958
-#define pci_ss_info_8086_1958 pci_ss_info_8086_2483_8086_1958
-static const pciSubsystemInfo pci_ss_info_8086_2484_1014_0220 =
- {0x1014, 0x0220, pci_subsys_8086_2484_1014_0220, 0};
-#undef pci_ss_info_1014_0220
-#define pci_ss_info_1014_0220 pci_ss_info_8086_2484_1014_0220
-static const pciSubsystemInfo pci_ss_info_8086_2484_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2484_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2484_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2484_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2484_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2484_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2484_8086_1958 =
- {0x8086, 0x1958, pci_subsys_8086_2484_8086_1958, 0};
-#undef pci_ss_info_8086_1958
-#define pci_ss_info_8086_1958 pci_ss_info_8086_2484_8086_1958
-static const pciSubsystemInfo pci_ss_info_8086_2485_1014_0222 =
- {0x1014, 0x0222, pci_subsys_8086_2485_1014_0222, 0};
-#undef pci_ss_info_1014_0222
-#define pci_ss_info_1014_0222 pci_ss_info_8086_2485_1014_0222
-static const pciSubsystemInfo pci_ss_info_8086_2485_1014_0508 =
- {0x1014, 0x0508, pci_subsys_8086_2485_1014_0508, 0};
-#undef pci_ss_info_1014_0508
-#define pci_ss_info_1014_0508 pci_ss_info_8086_2485_1014_0508
-static const pciSubsystemInfo pci_ss_info_8086_2485_1014_051c =
- {0x1014, 0x051c, pci_subsys_8086_2485_1014_051c, 0};
-#undef pci_ss_info_1014_051c
-#define pci_ss_info_1014_051c pci_ss_info_8086_2485_1014_051c
-static const pciSubsystemInfo pci_ss_info_8086_2485_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2485_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2485_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2485_144d_c006 =
- {0x144d, 0xc006, pci_subsys_8086_2485_144d_c006, 0};
-#undef pci_ss_info_144d_c006
-#define pci_ss_info_144d_c006 pci_ss_info_8086_2485_144d_c006
-static const pciSubsystemInfo pci_ss_info_8086_2486_1014_0223 =
- {0x1014, 0x0223, pci_subsys_8086_2486_1014_0223, 0};
-#undef pci_ss_info_1014_0223
-#define pci_ss_info_1014_0223 pci_ss_info_8086_2486_1014_0223
-static const pciSubsystemInfo pci_ss_info_8086_2486_1014_0503 =
- {0x1014, 0x0503, pci_subsys_8086_2486_1014_0503, 0};
-#undef pci_ss_info_1014_0503
-#define pci_ss_info_1014_0503 pci_ss_info_8086_2486_1014_0503
-static const pciSubsystemInfo pci_ss_info_8086_2486_1014_051a =
- {0x1014, 0x051a, pci_subsys_8086_2486_1014_051a, 0};
-#undef pci_ss_info_1014_051a
-#define pci_ss_info_1014_051a pci_ss_info_8086_2486_1014_051a
-static const pciSubsystemInfo pci_ss_info_8086_2486_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2486_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2486_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2486_1179_0001 =
- {0x1179, 0x0001, pci_subsys_8086_2486_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_8086_2486_1179_0001
-static const pciSubsystemInfo pci_ss_info_8086_2486_134d_4c21 =
- {0x134d, 0x4c21, pci_subsys_8086_2486_134d_4c21, 0};
-#undef pci_ss_info_134d_4c21
-#define pci_ss_info_134d_4c21 pci_ss_info_8086_2486_134d_4c21
-static const pciSubsystemInfo pci_ss_info_8086_2486_144d_2115 =
- {0x144d, 0x2115, pci_subsys_8086_2486_144d_2115, 0};
-#undef pci_ss_info_144d_2115
-#define pci_ss_info_144d_2115 pci_ss_info_8086_2486_144d_2115
-static const pciSubsystemInfo pci_ss_info_8086_2486_14f1_5421 =
- {0x14f1, 0x5421, pci_subsys_8086_2486_14f1_5421, 0};
-#undef pci_ss_info_14f1_5421
-#define pci_ss_info_14f1_5421 pci_ss_info_8086_2486_14f1_5421
-static const pciSubsystemInfo pci_ss_info_8086_2487_1014_0220 =
- {0x1014, 0x0220, pci_subsys_8086_2487_1014_0220, 0};
-#undef pci_ss_info_1014_0220
-#define pci_ss_info_1014_0220 pci_ss_info_8086_2487_1014_0220
-static const pciSubsystemInfo pci_ss_info_8086_2487_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_2487_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_2487_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_2487_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2487_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2487_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2487_8086_1958 =
- {0x8086, 0x1958, pci_subsys_8086_2487_8086_1958, 0};
-#undef pci_ss_info_8086_1958
-#define pci_ss_info_8086_1958 pci_ss_info_8086_2487_8086_1958
-static const pciSubsystemInfo pci_ss_info_8086_248a_1014_0220 =
- {0x1014, 0x0220, pci_subsys_8086_248a_1014_0220, 0};
-#undef pci_ss_info_1014_0220
-#define pci_ss_info_1014_0220 pci_ss_info_8086_248a_1014_0220
-static const pciSubsystemInfo pci_ss_info_8086_248a_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_248a_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_248a_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_248a_8086_1958 =
- {0x8086, 0x1958, pci_subsys_8086_248a_8086_1958, 0};
-#undef pci_ss_info_8086_1958
-#define pci_ss_info_8086_1958 pci_ss_info_8086_248a_8086_1958
-static const pciSubsystemInfo pci_ss_info_8086_248b_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_248b_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_248b_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_24c0_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c0_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c0_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24c2_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c2_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c2_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24c3_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c3_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c3_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24c4_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c4_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c4_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24c5_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c5_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c5_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24c7_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24c7_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24c7_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24cb_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_24cb_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_24cb_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_24cd_1462_3981 =
- {0x1462, 0x3981, pci_subsys_8086_24cd_1462_3981, 0};
-#undef pci_ss_info_1462_3981
-#define pci_ss_info_1462_3981 pci_ss_info_8086_24cd_1462_3981
-static const pciSubsystemInfo pci_ss_info_8086_2500_1028_0095 =
- {0x1028, 0x0095, pci_subsys_8086_2500_1028_0095, 0};
-#undef pci_ss_info_1028_0095
-#define pci_ss_info_1028_0095 pci_ss_info_8086_2500_1028_0095
-static const pciSubsystemInfo pci_ss_info_8086_2500_1043_801c =
- {0x1043, 0x801c, pci_subsys_8086_2500_1043_801c, 0};
-#undef pci_ss_info_1043_801c
-#define pci_ss_info_1043_801c pci_ss_info_8086_2500_1043_801c
-static const pciSubsystemInfo pci_ss_info_8086_2501_1043_801c =
- {0x1043, 0x801c, pci_subsys_8086_2501_1043_801c, 0};
-#undef pci_ss_info_1043_801c
-#define pci_ss_info_1043_801c pci_ss_info_8086_2501_1043_801c
-static const pciSubsystemInfo pci_ss_info_8086_2530_147b_0507 =
- {0x147b, 0x0507, pci_subsys_8086_2530_147b_0507, 0};
-#undef pci_ss_info_147b_0507
-#define pci_ss_info_147b_0507 pci_ss_info_8086_2530_147b_0507
-static const pciSubsystemInfo pci_ss_info_8086_2540_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2540_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2540_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2541_15d9_3480 =
- {0x15d9, 0x3480, pci_subsys_8086_2541_15d9_3480, 0};
-#undef pci_ss_info_15d9_3480
-#define pci_ss_info_15d9_3480 pci_ss_info_8086_2541_15d9_3480
-static const pciSubsystemInfo pci_ss_info_8086_2560_1462_5800 =
- {0x1462, 0x5800, pci_subsys_8086_2560_1462_5800, 0};
-#undef pci_ss_info_1462_5800
-#define pci_ss_info_1462_5800 pci_ss_info_8086_2560_1462_5800
-static const pciSubsystemInfo pci_ss_info_8086_3575_1014_021d =
- {0x1014, 0x021d, pci_subsys_8086_3575_1014_021d, 0};
-#undef pci_ss_info_1014_021d
-#define pci_ss_info_1014_021d pci_ss_info_8086_3575_1014_021d
-static const pciSubsystemInfo pci_ss_info_8086_3575_104d_80e7 =
- {0x104d, 0x80e7, pci_subsys_8086_3575_104d_80e7, 0};
-#undef pci_ss_info_104d_80e7
-#define pci_ss_info_104d_80e7 pci_ss_info_8086_3575_104d_80e7
-static const pciSubsystemInfo pci_ss_info_8086_3577_1014_0513 =
- {0x1014, 0x0513, pci_subsys_8086_3577_1014_0513, 0};
-#undef pci_ss_info_1014_0513
-#define pci_ss_info_1014_0513 pci_ss_info_8086_3577_1014_0513
-static const pciSubsystemInfo pci_ss_info_8086_5201_8086_0001 =
- {0x8086, 0x0001, pci_subsys_8086_5201_8086_0001, 0};
-#undef pci_ss_info_8086_0001
-#define pci_ss_info_8086_0001 pci_ss_info_8086_5201_8086_0001
-static const pciSubsystemInfo pci_ss_info_8086_7121_8086_4341 =
- {0x8086, 0x4341, pci_subsys_8086_7121_8086_4341, 0};
-#undef pci_ss_info_8086_4341
-#define pci_ss_info_8086_4341 pci_ss_info_8086_7121_8086_4341
-static const pciSubsystemInfo pci_ss_info_8086_7190_0e11_0500 =
- {0x0e11, 0x0500, pci_subsys_8086_7190_0e11_0500, 0};
-#undef pci_ss_info_0e11_0500
-#define pci_ss_info_0e11_0500 pci_ss_info_8086_7190_0e11_0500
-static const pciSubsystemInfo pci_ss_info_8086_7190_0e11_b110 =
- {0x0e11, 0xb110, pci_subsys_8086_7190_0e11_b110, 0};
-#undef pci_ss_info_0e11_b110
-#define pci_ss_info_0e11_b110 pci_ss_info_8086_7190_0e11_b110
-static const pciSubsystemInfo pci_ss_info_8086_7190_1179_0001 =
- {0x1179, 0x0001, pci_subsys_8086_7190_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_8086_7190_1179_0001
-static const pciSubsystemInfo pci_ss_info_8086_7192_0e11_0460 =
- {0x0e11, 0x0460, pci_subsys_8086_7192_0e11_0460, 0};
-#undef pci_ss_info_0e11_0460
-#define pci_ss_info_0e11_0460 pci_ss_info_8086_7192_0e11_0460
-static const pciSubsystemInfo pci_ss_info_8086_7195_10cf_1099 =
- {0x10cf, 0x1099, pci_subsys_8086_7195_10cf_1099, 0};
-#undef pci_ss_info_10cf_1099
-#define pci_ss_info_10cf_1099 pci_ss_info_8086_7195_10cf_1099
-static const pciSubsystemInfo pci_ss_info_8086_7195_11d4_0040 =
- {0x11d4, 0x0040, pci_subsys_8086_7195_11d4_0040, 0};
-#undef pci_ss_info_11d4_0040
-#define pci_ss_info_11d4_0040 pci_ss_info_8086_7195_11d4_0040
-static const pciSubsystemInfo pci_ss_info_8086_7195_11d4_0048 =
- {0x11d4, 0x0048, pci_subsys_8086_7195_11d4_0048, 0};
-#undef pci_ss_info_11d4_0048
-#define pci_ss_info_11d4_0048 pci_ss_info_8086_7195_11d4_0048
-static const pciSubsystemInfo pci_ss_info_8086_7800_003d_0008 =
- {0x003d, 0x0008, pci_subsys_8086_7800_003d_0008, 0};
-#undef pci_ss_info_003d_0008
-#define pci_ss_info_003d_0008 pci_ss_info_8086_7800_003d_0008
-static const pciSubsystemInfo pci_ss_info_8086_7800_003d_000b =
- {0x003d, 0x000b, pci_subsys_8086_7800_003d_000b, 0};
-#undef pci_ss_info_003d_000b
-#define pci_ss_info_003d_000b pci_ss_info_8086_7800_003d_000b
-static const pciSubsystemInfo pci_ss_info_8086_7800_1092_0100 =
- {0x1092, 0x0100, pci_subsys_8086_7800_1092_0100, 0};
-#undef pci_ss_info_1092_0100
-#define pci_ss_info_1092_0100 pci_ss_info_8086_7800_1092_0100
-static const pciSubsystemInfo pci_ss_info_8086_7800_10b4_201a =
- {0x10b4, 0x201a, pci_subsys_8086_7800_10b4_201a, 0};
-#undef pci_ss_info_10b4_201a
-#define pci_ss_info_10b4_201a pci_ss_info_8086_7800_10b4_201a
-static const pciSubsystemInfo pci_ss_info_8086_7800_10b4_202f =
- {0x10b4, 0x202f, pci_subsys_8086_7800_10b4_202f, 0};
-#undef pci_ss_info_10b4_202f
-#define pci_ss_info_10b4_202f pci_ss_info_8086_7800_10b4_202f
-static const pciSubsystemInfo pci_ss_info_8086_7800_8086_0000 =
- {0x8086, 0x0000, pci_subsys_8086_7800_8086_0000, 0};
-#undef pci_ss_info_8086_0000
-#define pci_ss_info_8086_0000 pci_ss_info_8086_7800_8086_0000
-static const pciSubsystemInfo pci_ss_info_8086_7800_8086_0100 =
- {0x8086, 0x0100, pci_subsys_8086_7800_8086_0100, 0};
-#undef pci_ss_info_8086_0100
-#define pci_ss_info_8086_0100 pci_ss_info_8086_7800_8086_0100
-static const pciSubsystemInfo pci_ss_info_8086_b555_e4bf_1000 =
- {0xe4bf, 0x1000, pci_subsys_8086_b555_e4bf_1000, 0};
-#undef pci_ss_info_e4bf_1000
-#define pci_ss_info_e4bf_1000 pci_ss_info_8086_b555_e4bf_1000
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9004_5078_9004_7850 =
- {0x9004, 0x7850, pci_subsys_9004_5078_9004_7850, 0};
-#undef pci_ss_info_9004_7850
-#define pci_ss_info_9004_7850 pci_ss_info_9004_5078_9004_7850
-static const pciSubsystemInfo pci_ss_info_9004_6075_9004_7560 =
- {0x9004, 0x7560, pci_subsys_9004_6075_9004_7560, 0};
-#undef pci_ss_info_9004_7560
-#define pci_ss_info_9004_7560 pci_ss_info_9004_6075_9004_7560
-static const pciSubsystemInfo pci_ss_info_9004_6178_9004_7861 =
- {0x9004, 0x7861, pci_subsys_9004_6178_9004_7861, 0};
-#undef pci_ss_info_9004_7861
-#define pci_ss_info_9004_7861 pci_ss_info_9004_6178_9004_7861
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0008 =
- {0x9004, 0x0008, pci_subsys_9004_6915_9004_0008, 0};
-#undef pci_ss_info_9004_0008
-#define pci_ss_info_9004_0008 pci_ss_info_9004_6915_9004_0008
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0009 =
- {0x9004, 0x0009, pci_subsys_9004_6915_9004_0009, 0};
-#undef pci_ss_info_9004_0009
-#define pci_ss_info_9004_0009 pci_ss_info_9004_6915_9004_0009
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0010 =
- {0x9004, 0x0010, pci_subsys_9004_6915_9004_0010, 0};
-#undef pci_ss_info_9004_0010
-#define pci_ss_info_9004_0010 pci_ss_info_9004_6915_9004_0010
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0018 =
- {0x9004, 0x0018, pci_subsys_9004_6915_9004_0018, 0};
-#undef pci_ss_info_9004_0018
-#define pci_ss_info_9004_0018 pci_ss_info_9004_6915_9004_0018
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0019 =
- {0x9004, 0x0019, pci_subsys_9004_6915_9004_0019, 0};
-#undef pci_ss_info_9004_0019
-#define pci_ss_info_9004_0019 pci_ss_info_9004_6915_9004_0019
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0020 =
- {0x9004, 0x0020, pci_subsys_9004_6915_9004_0020, 0};
-#undef pci_ss_info_9004_0020
-#define pci_ss_info_9004_0020 pci_ss_info_9004_6915_9004_0020
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0028 =
- {0x9004, 0x0028, pci_subsys_9004_6915_9004_0028, 0};
-#undef pci_ss_info_9004_0028
-#define pci_ss_info_9004_0028 pci_ss_info_9004_6915_9004_0028
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8008 =
- {0x9004, 0x8008, pci_subsys_9004_6915_9004_8008, 0};
-#undef pci_ss_info_9004_8008
-#define pci_ss_info_9004_8008 pci_ss_info_9004_6915_9004_8008
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8009 =
- {0x9004, 0x8009, pci_subsys_9004_6915_9004_8009, 0};
-#undef pci_ss_info_9004_8009
-#define pci_ss_info_9004_8009 pci_ss_info_9004_6915_9004_8009
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8010 =
- {0x9004, 0x8010, pci_subsys_9004_6915_9004_8010, 0};
-#undef pci_ss_info_9004_8010
-#define pci_ss_info_9004_8010 pci_ss_info_9004_6915_9004_8010
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8018 =
- {0x9004, 0x8018, pci_subsys_9004_6915_9004_8018, 0};
-#undef pci_ss_info_9004_8018
-#define pci_ss_info_9004_8018 pci_ss_info_9004_6915_9004_8018
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8019 =
- {0x9004, 0x8019, pci_subsys_9004_6915_9004_8019, 0};
-#undef pci_ss_info_9004_8019
-#define pci_ss_info_9004_8019 pci_ss_info_9004_6915_9004_8019
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8020 =
- {0x9004, 0x8020, pci_subsys_9004_6915_9004_8020, 0};
-#undef pci_ss_info_9004_8020
-#define pci_ss_info_9004_8020 pci_ss_info_9004_6915_9004_8020
-static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8028 =
- {0x9004, 0x8028, pci_subsys_9004_6915_9004_8028, 0};
-#undef pci_ss_info_9004_8028
-#define pci_ss_info_9004_8028 pci_ss_info_9004_6915_9004_8028
-static const pciSubsystemInfo pci_ss_info_9004_7815_9004_7815 =
- {0x9004, 0x7815, pci_subsys_9004_7815_9004_7815, 0};
-#undef pci_ss_info_9004_7815
-#define pci_ss_info_9004_7815 pci_ss_info_9004_7815_9004_7815
-static const pciSubsystemInfo pci_ss_info_9004_7815_9004_7840 =
- {0x9004, 0x7840, pci_subsys_9004_7815_9004_7840, 0};
-#undef pci_ss_info_9004_7840
-#define pci_ss_info_9004_7840 pci_ss_info_9004_7815_9004_7840
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7890 =
- {0x9004, 0x7890, pci_subsys_9004_7895_9004_7890, 0};
-#undef pci_ss_info_9004_7890
-#define pci_ss_info_9004_7890 pci_ss_info_9004_7895_9004_7890
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7891 =
- {0x9004, 0x7891, pci_subsys_9004_7895_9004_7891, 0};
-#undef pci_ss_info_9004_7891
-#define pci_ss_info_9004_7891 pci_ss_info_9004_7895_9004_7891
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7892 =
- {0x9004, 0x7892, pci_subsys_9004_7895_9004_7892, 0};
-#undef pci_ss_info_9004_7892
-#define pci_ss_info_9004_7892 pci_ss_info_9004_7895_9004_7892
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7894 =
- {0x9004, 0x7894, pci_subsys_9004_7895_9004_7894, 0};
-#undef pci_ss_info_9004_7894
-#define pci_ss_info_9004_7894 pci_ss_info_9004_7895_9004_7894
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7895 =
- {0x9004, 0x7895, pci_subsys_9004_7895_9004_7895, 0};
-#undef pci_ss_info_9004_7895
-#define pci_ss_info_9004_7895 pci_ss_info_9004_7895_9004_7895
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7896 =
- {0x9004, 0x7896, pci_subsys_9004_7895_9004_7896, 0};
-#undef pci_ss_info_9004_7896
-#define pci_ss_info_9004_7896 pci_ss_info_9004_7895_9004_7896
-static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7897 =
- {0x9004, 0x7897, pci_subsys_9004_7895_9004_7897, 0};
-#undef pci_ss_info_9004_7897
-#define pci_ss_info_9004_7897 pci_ss_info_9004_7895_9004_7897
-static const pciSubsystemInfo pci_ss_info_9004_8078_9004_7880 =
- {0x9004, 0x7880, pci_subsys_9004_8078_9004_7880, 0};
-#undef pci_ss_info_9004_7880
-#define pci_ss_info_9004_7880 pci_ss_info_9004_8078_9004_7880
-static const pciSubsystemInfo pci_ss_info_9004_8178_9004_7881 =
- {0x9004, 0x7881, pci_subsys_9004_8178_9004_7881, 0};
-#undef pci_ss_info_9004_7881
-#define pci_ss_info_9004_7881 pci_ss_info_9004_8178_9004_7881
-static const pciSubsystemInfo pci_ss_info_9004_8778_9004_7887 =
- {0x9004, 0x7887, pci_subsys_9004_8778_9004_7887, 0};
-#undef pci_ss_info_9004_7887
-#define pci_ss_info_9004_7887 pci_ss_info_9004_8778_9004_7887
-static const pciSubsystemInfo pci_ss_info_9004_8878_9004_7888 =
- {0x9004, 0x7888, pci_subsys_9004_8878_9004_7888, 0};
-#undef pci_ss_info_9004_7888
-#define pci_ss_info_9004_7888 pci_ss_info_9004_8878_9004_7888
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9005_0010_9005_2180 =
- {0x9005, 0x2180, pci_subsys_9005_0010_9005_2180, 0};
-#undef pci_ss_info_9005_2180
-#define pci_ss_info_9005_2180 pci_ss_info_9005_0010_9005_2180
-static const pciSubsystemInfo pci_ss_info_9005_0010_9005_8100 =
- {0x9005, 0x8100, pci_subsys_9005_0010_9005_8100, 0};
-#undef pci_ss_info_9005_8100
-#define pci_ss_info_9005_8100 pci_ss_info_9005_0010_9005_8100
-static const pciSubsystemInfo pci_ss_info_9005_0010_9005_a180 =
- {0x9005, 0xa180, pci_subsys_9005_0010_9005_a180, 0};
-#undef pci_ss_info_9005_a180
-#define pci_ss_info_9005_a180 pci_ss_info_9005_0010_9005_a180
-static const pciSubsystemInfo pci_ss_info_9005_0010_9005_e100 =
- {0x9005, 0xe100, pci_subsys_9005_0010_9005_e100, 0};
-#undef pci_ss_info_9005_e100
-#define pci_ss_info_9005_e100 pci_ss_info_9005_0010_9005_e100
-static const pciSubsystemInfo pci_ss_info_9005_0013_9005_0003 =
- {0x9005, 0x0003, pci_subsys_9005_0013_9005_0003, 0};
-#undef pci_ss_info_9005_0003
-#define pci_ss_info_9005_0003 pci_ss_info_9005_0013_9005_0003
-static const pciSubsystemInfo pci_ss_info_9005_001f_9005_000f =
- {0x9005, 0x000f, pci_subsys_9005_001f_9005_000f, 0};
-#undef pci_ss_info_9005_000f
-#define pci_ss_info_9005_000f pci_ss_info_9005_001f_9005_000f
-static const pciSubsystemInfo pci_ss_info_9005_001f_9005_a180 =
- {0x9005, 0xa180, pci_subsys_9005_001f_9005_a180, 0};
-#undef pci_ss_info_9005_a180
-#define pci_ss_info_9005_a180 pci_ss_info_9005_001f_9005_a180
-static const pciSubsystemInfo pci_ss_info_9005_0050_9005_f500 =
- {0x9005, 0xf500, pci_subsys_9005_0050_9005_f500, 0};
-#undef pci_ss_info_9005_f500
-#define pci_ss_info_9005_f500 pci_ss_info_9005_0050_9005_f500
-static const pciSubsystemInfo pci_ss_info_9005_0051_9005_b500 =
- {0x9005, 0xb500, pci_subsys_9005_0051_9005_b500, 0};
-#undef pci_ss_info_9005_b500
-#define pci_ss_info_9005_b500 pci_ss_info_9005_0051_9005_b500
-static const pciSubsystemInfo pci_ss_info_9005_0053_9005_ffff =
- {0x9005, 0xffff, pci_subsys_9005_0053_9005_ffff, 0};
-#undef pci_ss_info_9005_ffff
-#define pci_ss_info_9005_ffff pci_ss_info_9005_0053_9005_ffff
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_0080_0e11_e2a0 =
- {0x0e11, 0xe2a0, pci_subsys_9005_0080_0e11_e2a0, 0};
-#undef pci_ss_info_0e11_e2a0
-#define pci_ss_info_0e11_e2a0 pci_ss_info_9005_0080_0e11_e2a0
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9005_0080_9005_62a0 =
- {0x9005, 0x62a0, pci_subsys_9005_0080_9005_62a0, 0};
-#undef pci_ss_info_9005_62a0
-#define pci_ss_info_9005_62a0 pci_ss_info_9005_0080_9005_62a0
-static const pciSubsystemInfo pci_ss_info_9005_0080_9005_e220 =
- {0x9005, 0xe220, pci_subsys_9005_0080_9005_e220, 0};
-#undef pci_ss_info_9005_e220
-#define pci_ss_info_9005_e220 pci_ss_info_9005_0080_9005_e220
-static const pciSubsystemInfo pci_ss_info_9005_0080_9005_e2a0 =
- {0x9005, 0xe2a0, pci_subsys_9005_0080_9005_e2a0, 0};
-#undef pci_ss_info_9005_e2a0
-#define pci_ss_info_9005_e2a0 pci_ss_info_9005_0080_9005_e2a0
-static const pciSubsystemInfo pci_ss_info_9005_0081_9005_62a1 =
- {0x9005, 0x62a1, pci_subsys_9005_0081_9005_62a1, 0};
-#undef pci_ss_info_9005_62a1
-#define pci_ss_info_9005_62a1 pci_ss_info_9005_0081_9005_62a1
-static const pciSubsystemInfo pci_ss_info_9005_008f_1179_0001 =
- {0x1179, 0x0001, pci_subsys_9005_008f_1179_0001, 0};
-#undef pci_ss_info_1179_0001
-#define pci_ss_info_1179_0001 pci_ss_info_9005_008f_1179_0001
-static const pciSubsystemInfo pci_ss_info_9005_008f_15d9_9005 =
- {0x15d9, 0x9005, pci_subsys_9005_008f_15d9_9005, 0};
-#undef pci_ss_info_15d9_9005
-#define pci_ss_info_15d9_9005 pci_ss_info_9005_008f_15d9_9005
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_00c0_0e11_f620 =
- {0x0e11, 0xf620, pci_subsys_9005_00c0_0e11_f620, 0};
-#undef pci_ss_info_0e11_f620
-#define pci_ss_info_0e11_f620 pci_ss_info_9005_00c0_0e11_f620
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9005_00c0_9005_f620 =
- {0x9005, 0xf620, pci_subsys_9005_00c0_9005_f620, 0};
-#undef pci_ss_info_9005_f620
-#define pci_ss_info_9005_f620 pci_ss_info_9005_00c0_9005_f620
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_00c5_1028_00c5 =
- {0x1028, 0x00c5, pci_subsys_9005_00c5_1028_00c5, 0};
-#undef pci_ss_info_1028_00c5
-#define pci_ss_info_1028_00c5 pci_ss_info_9005_00c5_1028_00c5
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_00cf_1028_00d1 =
- {0x1028, 0x00d1, pci_subsys_9005_00cf_1028_00d1, 0};
-#undef pci_ss_info_1028_00d1
-#define pci_ss_info_1028_00d1 pci_ss_info_9005_00cf_1028_00d1
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9005_00cf_10f1_2462 =
- {0x10f1, 0x2462, pci_subsys_9005_00cf_10f1_2462, 0};
-#undef pci_ss_info_10f1_2462
-#define pci_ss_info_10f1_2462 pci_ss_info_9005_00cf_10f1_2462
-static const pciSubsystemInfo pci_ss_info_9005_00cf_15d9_9005 =
- {0x15d9, 0x9005, pci_subsys_9005_00cf_15d9_9005, 0};
-#undef pci_ss_info_15d9_9005
-#define pci_ss_info_15d9_9005 pci_ss_info_9005_00cf_15d9_9005
-static const pciSubsystemInfo pci_ss_info_9005_0250_1014_0279 =
- {0x1014, 0x0279, pci_subsys_9005_0250_1014_0279, 0};
-#undef pci_ss_info_1014_0279
-#define pci_ss_info_1014_0279 pci_ss_info_9005_0250_1014_0279
-static const pciSubsystemInfo pci_ss_info_9005_0250_1014_028c =
- {0x1014, 0x028c, pci_subsys_9005_0250_1014_028c, 0};
-#undef pci_ss_info_1014_028c
-#define pci_ss_info_1014_028c pci_ss_info_9005_0250_1014_028c
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_0285_1028_0287 =
- {0x1028, 0x0287, pci_subsys_9005_0285_1028_0287, 0};
-#undef pci_ss_info_1028_0287
-#define pci_ss_info_1028_0287 pci_ss_info_9005_0285_1028_0287
-#ifdef VENDOR_INCLUDE_NONVIDEO
-#endif
-static const pciSubsystemInfo pci_ss_info_9005_8011_0e11_00ac =
- {0x0e11, 0x00ac, pci_subsys_9005_8011_0e11_00ac, 0};
-#undef pci_ss_info_0e11_00ac
-#define pci_ss_info_0e11_00ac pci_ss_info_9005_8011_0e11_00ac
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_9005_8011_9005_0041 =
- {0x9005, 0x0041, pci_subsys_9005_8011_9005_0041, 0};
-#undef pci_ss_info_9005_0041
-#define pci_ss_info_9005_0041 pci_ss_info_9005_8011_9005_0041
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo pci_ss_info_e159_0001_0059_0001 =
- {0x0059, 0x0001, pci_subsys_e159_0001_0059_0001, 0};
-#undef pci_ss_info_0059_0001
-#define pci_ss_info_0059_0001 pci_ss_info_e159_0001_0059_0001
-static const pciSubsystemInfo pci_ss_info_e159_0001_0059_0003 =
- {0x0059, 0x0003, pci_subsys_e159_0001_0059_0003, 0};
-#undef pci_ss_info_0059_0003
-#define pci_ss_info_0059_0003 pci_ss_info_e159_0001_0059_0003
-#endif
-#define pci_ss_list_0675_1700 NULL
-#define pci_ss_list_0675_1702 NULL
-#define pci_ss_list_09c1_0704 NULL
-#define pci_ss_list_0e11_0001 NULL
-#define pci_ss_list_0e11_0002 NULL
-#define pci_ss_list_0e11_0049 NULL
-#define pci_ss_list_0e11_004a NULL
-#define pci_ss_list_0e11_0508 NULL
-#define pci_ss_list_0e11_1000 NULL
-#define pci_ss_list_0e11_2000 NULL
-#define pci_ss_list_0e11_3032 NULL
-#define pci_ss_list_0e11_3033 NULL
-#define pci_ss_list_0e11_3034 NULL
-#define pci_ss_list_0e11_4000 NULL
-#define pci_ss_list_0e11_6010 NULL
-#define pci_ss_list_0e11_7020 NULL
-#define pci_ss_list_0e11_a0ec NULL
-#define pci_ss_list_0e11_a0f0 NULL
-#define pci_ss_list_0e11_a0f3 NULL
-static const pciSubsystemInfo *pci_ss_list_0e11_a0f7[] = {
- &pci_ss_info_0e11_a0f7_8086_002a,
- &pci_ss_info_0e11_a0f7_8086_002b,
- NULL
-};
-#define pci_ss_list_0e11_a0f8 NULL
-#define pci_ss_list_0e11_a0fc NULL
-static const pciSubsystemInfo *pci_ss_list_0e11_ae10[] = {
- &pci_ss_info_0e11_ae10_0e11_4030,
- &pci_ss_info_0e11_ae10_0e11_4031,
- &pci_ss_info_0e11_ae10_0e11_4032,
- &pci_ss_info_0e11_ae10_0e11_4033,
- NULL
-};
-#define pci_ss_list_0e11_ae29 NULL
-#define pci_ss_list_0e11_ae2a NULL
-#define pci_ss_list_0e11_ae2b NULL
-#define pci_ss_list_0e11_ae31 NULL
-#define pci_ss_list_0e11_ae32 NULL
-#define pci_ss_list_0e11_ae33 NULL
-#define pci_ss_list_0e11_ae34 NULL
-#define pci_ss_list_0e11_ae35 NULL
-#define pci_ss_list_0e11_ae40 NULL
-#define pci_ss_list_0e11_ae43 NULL
-#define pci_ss_list_0e11_ae69 NULL
-#define pci_ss_list_0e11_ae6c NULL
-#define pci_ss_list_0e11_ae6d NULL
-#define pci_ss_list_0e11_b011 NULL
-#define pci_ss_list_0e11_b012 NULL
-#define pci_ss_list_0e11_b01e NULL
-#define pci_ss_list_0e11_b01f NULL
-#define pci_ss_list_0e11_b02f NULL
-#define pci_ss_list_0e11_b030 NULL
-#define pci_ss_list_0e11_b04a NULL
-#define pci_ss_list_0e11_b060 NULL
-#define pci_ss_list_0e11_b0c6 NULL
-#define pci_ss_list_0e11_b0c7 NULL
-#define pci_ss_list_0e11_b0d7 NULL
-#define pci_ss_list_0e11_b0dd NULL
-#define pci_ss_list_0e11_b0de NULL
-#define pci_ss_list_0e11_b0df NULL
-#define pci_ss_list_0e11_b0e0 NULL
-#define pci_ss_list_0e11_b0e1 NULL
-#define pci_ss_list_0e11_b123 NULL
-#define pci_ss_list_0e11_b134 NULL
-#define pci_ss_list_0e11_b13c NULL
-#define pci_ss_list_0e11_b144 NULL
-#define pci_ss_list_0e11_b163 NULL
-#define pci_ss_list_0e11_b164 NULL
-#define pci_ss_list_0e11_b178 NULL
-#define pci_ss_list_0e11_b1a4 NULL
-#define pci_ss_list_0e11_f130 NULL
-#define pci_ss_list_0e11_f150 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1000_0001[] = {
- &pci_ss_info_1000_0001_1000_1000,
- NULL
-};
-#define pci_ss_list_1000_0002 NULL
-#define pci_ss_list_1000_0003 NULL
-#define pci_ss_list_1000_0004 NULL
-#define pci_ss_list_1000_0005 NULL
-#define pci_ss_list_1000_0006 NULL
-#define pci_ss_list_1000_000a NULL
-#define pci_ss_list_1000_000b NULL
-static const pciSubsystemInfo *pci_ss_list_1000_000c[] = {
- &pci_ss_info_1000_000c_1de1_3907,
- NULL
-};
-#define pci_ss_list_1000_000d NULL
-static const pciSubsystemInfo *pci_ss_list_1000_000f[] = {
- &pci_ss_info_1000_000f_0e11_7004,
- &pci_ss_info_1000_000f_1092_8760,
- &pci_ss_info_1000_000f_1de1_3904,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1000_0010[] = {
- &pci_ss_info_1000_0010_0e11_4040,
- &pci_ss_info_1000_0010_0e11_4048,
- NULL
-};
-#define pci_ss_list_1000_0012 NULL
-#define pci_ss_list_1000_0013 NULL
-static const pciSubsystemInfo *pci_ss_list_1000_0020[] = {
- &pci_ss_info_1000_0020_1de1_1020,
- NULL
-};
-#define pci_ss_list_1000_0021 NULL
-static const pciSubsystemInfo *pci_ss_list_1000_0030[] = {
- &pci_ss_info_1000_0030_1028_1010,
- NULL
-};
-#define pci_ss_list_1000_0040 NULL
-static const pciSubsystemInfo *pci_ss_list_1000_008f[] = {
- &pci_ss_info_1000_008f_1092_8000,
- &pci_ss_info_1000_008f_1092_8760,
- NULL
-};
-#define pci_ss_list_1000_0621 NULL
-#define pci_ss_list_1000_0622 NULL
-#define pci_ss_list_1000_0623 NULL
-#define pci_ss_list_1000_0624 NULL
-#define pci_ss_list_1000_0625 NULL
-#define pci_ss_list_1000_0626 NULL
-#define pci_ss_list_1000_0627 NULL
-#define pci_ss_list_1000_0628 NULL
-#define pci_ss_list_1000_0629 NULL
-#define pci_ss_list_1000_0701 NULL
-static const pciSubsystemInfo *pci_ss_list_1000_0702[] = {
- &pci_ss_info_1000_0702_1318_0000,
- NULL
-};
-#define pci_ss_list_1000_0901 NULL
-#define pci_ss_list_1000_1000 NULL
-static const pciSubsystemInfo *pci_ss_list_1000_1960[] = {
- &pci_ss_info_1000_1960_1028_0518,
- &pci_ss_info_1000_1960_1028_0520,
- &pci_ss_info_1000_1960_1028_0531,
- NULL
-};
-#endif
-#define pci_ss_list_1001_0010 NULL
-#define pci_ss_list_1001_0011 NULL
-#define pci_ss_list_1001_0012 NULL
-#define pci_ss_list_1001_0013 NULL
-#define pci_ss_list_1001_0014 NULL
-#define pci_ss_list_1001_0015 NULL
-#define pci_ss_list_1001_0016 NULL
-#define pci_ss_list_1001_0017 NULL
-#define pci_ss_list_1001_9100 NULL
-#define pci_ss_list_1002_4136 NULL
-#define pci_ss_list_1002_4144 NULL
-#define pci_ss_list_1002_4145 NULL
-#define pci_ss_list_1002_4146 NULL
-#define pci_ss_list_1002_4147 NULL
-#define pci_ss_list_1002_4158 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4242[] = {
- &pci_ss_info_1002_4242_1002_02aa,
- NULL
-};
-#define pci_ss_list_1002_4336 NULL
-#define pci_ss_list_1002_4337 NULL
-#define pci_ss_list_1002_4354 NULL
-#define pci_ss_list_1002_4358 NULL
-#define pci_ss_list_1002_4554 NULL
-#define pci_ss_list_1002_4654 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4742[] = {
- &pci_ss_info_1002_4742_1002_0040,
- &pci_ss_info_1002_4742_1002_0044,
- &pci_ss_info_1002_4742_1002_0061,
- &pci_ss_info_1002_4742_1002_0062,
- &pci_ss_info_1002_4742_1002_0063,
- &pci_ss_info_1002_4742_1002_0080,
- &pci_ss_info_1002_4742_1002_0084,
- &pci_ss_info_1002_4742_1002_4742,
- &pci_ss_info_1002_4742_1002_8001,
- &pci_ss_info_1002_4742_1028_0082,
- &pci_ss_info_1002_4742_1028_4082,
- &pci_ss_info_1002_4742_1028_8082,
- &pci_ss_info_1002_4742_1028_c082,
- &pci_ss_info_1002_4742_8086_4152,
- &pci_ss_info_1002_4742_8086_464a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_4744[] = {
- &pci_ss_info_1002_4744_1002_4744,
- NULL
-};
-#define pci_ss_list_1002_4747 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4749[] = {
- &pci_ss_info_1002_4749_1002_0061,
- &pci_ss_info_1002_4749_1002_0062,
- NULL
-};
-#define pci_ss_list_1002_474c NULL
-static const pciSubsystemInfo *pci_ss_list_1002_474d[] = {
- &pci_ss_info_1002_474d_1002_0004,
- &pci_ss_info_1002_474d_1002_0008,
- &pci_ss_info_1002_474d_1002_0080,
- &pci_ss_info_1002_474d_1002_0084,
- &pci_ss_info_1002_474d_1002_474d,
- &pci_ss_info_1002_474d_1033_806a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_474e[] = {
- &pci_ss_info_1002_474e_1002_474e,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_474f[] = {
- &pci_ss_info_1002_474f_1002_0008,
- &pci_ss_info_1002_474f_1002_474f,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_4750[] = {
- &pci_ss_info_1002_4750_1002_0040,
- &pci_ss_info_1002_4750_1002_0044,
- &pci_ss_info_1002_4750_1002_0080,
- &pci_ss_info_1002_4750_1002_0084,
- &pci_ss_info_1002_4750_1002_4750,
- NULL
-};
-#define pci_ss_list_1002_4751 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4752[] = {
- &pci_ss_info_1002_4752_1002_0008,
- &pci_ss_info_1002_4752_1002_4752,
- &pci_ss_info_1002_4752_1002_8008,
- &pci_ss_info_1002_4752_1028_00d1,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_4753[] = {
- &pci_ss_info_1002_4753_1002_4753,
- NULL
-};
-#define pci_ss_list_1002_4754 NULL
-#define pci_ss_list_1002_4755 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4756[] = {
- &pci_ss_info_1002_4756_1002_4756,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_4757[] = {
- &pci_ss_info_1002_4757_1002_4757,
- &pci_ss_info_1002_4757_1028_0089,
- &pci_ss_info_1002_4757_1028_4082,
- &pci_ss_info_1002_4757_1028_8082,
- &pci_ss_info_1002_4757_1028_c082,
- NULL
-};
-#define pci_ss_list_1002_4758 NULL
-#define pci_ss_list_1002_4759 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_475a[] = {
- &pci_ss_info_1002_475a_1002_0087,
- &pci_ss_info_1002_475a_1002_475a,
- NULL
-};
-#define pci_ss_list_1002_4964 NULL
-#define pci_ss_list_1002_4965 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4966[] = {
- &pci_ss_info_1002_4966_10f1_0002,
- &pci_ss_info_1002_4966_148c_2039,
- &pci_ss_info_1002_4966_1509_9a00,
- &pci_ss_info_1002_4966_1681_0040,
- &pci_ss_info_1002_4966_174b_7176,
- &pci_ss_info_1002_4966_174b_7192,
- &pci_ss_info_1002_4966_17af_2005,
- &pci_ss_info_1002_4966_17af_2006,
- NULL
-};
-#define pci_ss_list_1002_4967 NULL
-#define pci_ss_list_1002_496e NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4c42[] = {
- &pci_ss_info_1002_4c42_0e11_b0e8,
- &pci_ss_info_1002_4c42_0e11_b10e,
- &pci_ss_info_1002_4c42_1002_0040,
- &pci_ss_info_1002_4c42_1002_0044,
- &pci_ss_info_1002_4c42_1002_4c42,
- &pci_ss_info_1002_4c42_1002_8001,
- &pci_ss_info_1002_4c42_1028_0085,
- NULL
-};
-#define pci_ss_list_1002_4c44 NULL
-#define pci_ss_list_1002_4c45 NULL
-#define pci_ss_list_1002_4c46 NULL
-#define pci_ss_list_1002_4c47 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4c49[] = {
- &pci_ss_info_1002_4c49_1002_0004,
- &pci_ss_info_1002_4c49_1002_0040,
- &pci_ss_info_1002_4c49_1002_0044,
- &pci_ss_info_1002_4c49_1002_4c49,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_4c4d[] = {
- &pci_ss_info_1002_4c4d_0e11_b111,
- &pci_ss_info_1002_4c4d_1002_0084,
- &pci_ss_info_1002_4c4d_1014_0154,
- NULL
-};
-#define pci_ss_list_1002_4c4e NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4c50[] = {
- &pci_ss_info_1002_4c50_1002_4c50,
- NULL
-};
-#define pci_ss_list_1002_4c51 NULL
-#define pci_ss_list_1002_4c52 NULL
-#define pci_ss_list_1002_4c53 NULL
-#define pci_ss_list_1002_4c54 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4c57[] = {
- &pci_ss_info_1002_4c57_1014_0517,
- &pci_ss_info_1002_4c57_1028_00e6,
- &pci_ss_info_1002_4c57_144d_c006,
- NULL
-};
-#define pci_ss_list_1002_4c58 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4c59[] = {
- &pci_ss_info_1002_4c59_1014_0235,
- &pci_ss_info_1002_4c59_1014_0239,
- &pci_ss_info_1002_4c59_104d_80e7,
- NULL
-};
-#define pci_ss_list_1002_4c5a NULL
-#define pci_ss_list_1002_4c64 NULL
-#define pci_ss_list_1002_4c65 NULL
-#define pci_ss_list_1002_4c66 NULL
-#define pci_ss_list_1002_4c67 NULL
-#define pci_ss_list_1002_4d46 NULL
-#define pci_ss_list_1002_4d4c NULL
-#define pci_ss_list_1002_4e44 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_4e45[] = {
- &pci_ss_info_1002_4e45_1002_0002,
- NULL
-};
-#define pci_ss_list_1002_4e46 NULL
-#define pci_ss_list_1002_4e47 NULL
-#define pci_ss_list_1002_4e48 NULL
-#define pci_ss_list_1002_4e64 NULL
-#define pci_ss_list_1002_4e65 NULL
-#define pci_ss_list_1002_4e66 NULL
-#define pci_ss_list_1002_4e67 NULL
-#define pci_ss_list_1002_4e68 NULL
-#define pci_ss_list_1002_5041 NULL
-#define pci_ss_list_1002_5042 NULL
-#define pci_ss_list_1002_5043 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5044[] = {
- &pci_ss_info_1002_5044_1002_0028,
- &pci_ss_info_1002_5044_1002_0029,
- NULL
-};
-#define pci_ss_list_1002_5045 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5046[] = {
- &pci_ss_info_1002_5046_1002_0004,
- &pci_ss_info_1002_5046_1002_0008,
- &pci_ss_info_1002_5046_1002_0014,
- &pci_ss_info_1002_5046_1002_0018,
- &pci_ss_info_1002_5046_1002_0028,
- &pci_ss_info_1002_5046_1002_002a,
- &pci_ss_info_1002_5046_1002_0048,
- &pci_ss_info_1002_5046_1002_2000,
- &pci_ss_info_1002_5046_1002_2001,
- NULL
-};
-#define pci_ss_list_1002_5047 NULL
-#define pci_ss_list_1002_5048 NULL
-#define pci_ss_list_1002_5049 NULL
-#define pci_ss_list_1002_504a NULL
-#define pci_ss_list_1002_504b NULL
-#define pci_ss_list_1002_504c NULL
-#define pci_ss_list_1002_504d NULL
-#define pci_ss_list_1002_504e NULL
-#define pci_ss_list_1002_504f NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5050[] = {
- &pci_ss_info_1002_5050_1002_0008,
- NULL
-};
-#define pci_ss_list_1002_5051 NULL
-#define pci_ss_list_1002_5052 NULL
-#define pci_ss_list_1002_5053 NULL
-#define pci_ss_list_1002_5054 NULL
-#define pci_ss_list_1002_5055 NULL
-#define pci_ss_list_1002_5056 NULL
-#define pci_ss_list_1002_5057 NULL
-#define pci_ss_list_1002_5058 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5144[] = {
- &pci_ss_info_1002_5144_1002_0008,
- &pci_ss_info_1002_5144_1002_0009,
- &pci_ss_info_1002_5144_1002_000a,
- &pci_ss_info_1002_5144_1002_001a,
- &pci_ss_info_1002_5144_1002_0029,
- &pci_ss_info_1002_5144_1002_0038,
- &pci_ss_info_1002_5144_1002_0039,
- &pci_ss_info_1002_5144_1002_008a,
- &pci_ss_info_1002_5144_1002_00ba,
- &pci_ss_info_1002_5144_1002_0139,
- &pci_ss_info_1002_5144_1002_028a,
- &pci_ss_info_1002_5144_1002_02aa,
- &pci_ss_info_1002_5144_1002_053a,
- NULL
-};
-#define pci_ss_list_1002_5145 NULL
-#define pci_ss_list_1002_5146 NULL
-#define pci_ss_list_1002_5147 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5148[] = {
- &pci_ss_info_1002_5148_1002_010a,
- &pci_ss_info_1002_5148_1002_0152,
- &pci_ss_info_1002_5148_1002_0162,
- &pci_ss_info_1002_5148_1002_0172,
- NULL
-};
-#define pci_ss_list_1002_5149 NULL
-#define pci_ss_list_1002_514a NULL
-#define pci_ss_list_1002_514b NULL
-static const pciSubsystemInfo *pci_ss_list_1002_514c[] = {
- &pci_ss_info_1002_514c_1002_003a,
- &pci_ss_info_1002_514c_1002_013a,
- &pci_ss_info_1002_514c_148c_2026,
- &pci_ss_info_1002_514c_174b_7149,
- NULL
-};
-#define pci_ss_list_1002_514d NULL
-#define pci_ss_list_1002_514e NULL
-#define pci_ss_list_1002_514f NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5157[] = {
- &pci_ss_info_1002_5157_1002_013a,
- &pci_ss_info_1002_5157_1458_4000,
- &pci_ss_info_1002_5157_148c_2024,
- &pci_ss_info_1002_5157_148c_2025,
- &pci_ss_info_1002_5157_148c_2036,
- &pci_ss_info_1002_5157_174b_7147,
- &pci_ss_info_1002_5157_174b_7161,
- &pci_ss_info_1002_5157_17af_0202,
- NULL
-};
-#define pci_ss_list_1002_5158 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5159[] = {
- &pci_ss_info_1002_5159_1002_000a,
- &pci_ss_info_1002_5159_1002_000b,
- &pci_ss_info_1002_5159_1002_0038,
- &pci_ss_info_1002_5159_1002_003a,
- &pci_ss_info_1002_5159_1002_00ba,
- &pci_ss_info_1002_5159_1002_013a,
- &pci_ss_info_1002_5159_1458_4002,
- &pci_ss_info_1002_5159_148c_2003,
- &pci_ss_info_1002_5159_148c_2023,
- &pci_ss_info_1002_5159_174b_7112,
- &pci_ss_info_1002_5159_1787_0202,
- NULL
-};
-#define pci_ss_list_1002_515a NULL
-#define pci_ss_list_1002_5168 NULL
-#define pci_ss_list_1002_5169 NULL
-#define pci_ss_list_1002_516a NULL
-#define pci_ss_list_1002_516b NULL
-#define pci_ss_list_1002_516c NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5245[] = {
- &pci_ss_info_1002_5245_1002_0008,
- &pci_ss_info_1002_5245_1002_0028,
- &pci_ss_info_1002_5245_1002_0029,
- &pci_ss_info_1002_5245_1002_0068,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_5246[] = {
- &pci_ss_info_1002_5246_1002_0004,
- &pci_ss_info_1002_5246_1002_0008,
- &pci_ss_info_1002_5246_1002_0028,
- &pci_ss_info_1002_5246_1002_0044,
- &pci_ss_info_1002_5246_1002_0068,
- &pci_ss_info_1002_5246_1002_0448,
- NULL
-};
-#define pci_ss_list_1002_5247 NULL
-#define pci_ss_list_1002_524b NULL
-static const pciSubsystemInfo *pci_ss_list_1002_524c[] = {
- &pci_ss_info_1002_524c_1002_0008,
- &pci_ss_info_1002_524c_1002_0088,
- NULL
-};
-#define pci_ss_list_1002_5345 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5346[] = {
- &pci_ss_info_1002_5346_1002_0048,
- NULL
-};
-#define pci_ss_list_1002_5347 NULL
-#define pci_ss_list_1002_5348 NULL
-#define pci_ss_list_1002_534b NULL
-#define pci_ss_list_1002_534c NULL
-static const pciSubsystemInfo *pci_ss_list_1002_534d[] = {
- &pci_ss_info_1002_534d_1002_0008,
- &pci_ss_info_1002_534d_1002_0018,
- NULL
-};
-#define pci_ss_list_1002_534e NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5354[] = {
- &pci_ss_info_1002_5354_1002_5654,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1002_5446[] = {
- &pci_ss_info_1002_5446_1002_0004,
- &pci_ss_info_1002_5446_1002_0008,
- &pci_ss_info_1002_5446_1002_0018,
- &pci_ss_info_1002_5446_1002_0028,
- &pci_ss_info_1002_5446_1002_0029,
- &pci_ss_info_1002_5446_1002_002a,
- &pci_ss_info_1002_5446_1002_002b,
- &pci_ss_info_1002_5446_1002_0048,
- NULL
-};
-#define pci_ss_list_1002_544c NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5452[] = {
- &pci_ss_info_1002_5452_1002_001c,
- &pci_ss_info_1002_5452_103c_1279,
- NULL
-};
-#define pci_ss_list_1002_5453 NULL
-#define pci_ss_list_1002_5454 NULL
-#define pci_ss_list_1002_5455 NULL
-static const pciSubsystemInfo *pci_ss_list_1002_5654[] = {
- &pci_ss_info_1002_5654_1002_5654,
- NULL
-};
-#define pci_ss_list_1002_5655 NULL
-#define pci_ss_list_1002_5656 NULL
-#define pci_ss_list_1002_700f NULL
-#define pci_ss_list_1002_7010 NULL
-#define pci_ss_list_1002_cab2 NULL
-#define pci_ss_list_1003_0201 NULL
-#define pci_ss_list_1004_0005 NULL
-#define pci_ss_list_1004_0006 NULL
-#define pci_ss_list_1004_0007 NULL
-#define pci_ss_list_1004_0008 NULL
-#define pci_ss_list_1004_0009 NULL
-#define pci_ss_list_1004_000c NULL
-#define pci_ss_list_1004_000d NULL
-#define pci_ss_list_1004_0101 NULL
-#define pci_ss_list_1004_0102 NULL
-#define pci_ss_list_1004_0103 NULL
-#define pci_ss_list_1004_0104 NULL
-#define pci_ss_list_1004_0105 NULL
-#define pci_ss_list_1004_0200 NULL
-#define pci_ss_list_1004_0280 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1004_0304[] = {
- &pci_ss_info_1004_0304_1004_0304,
- &pci_ss_info_1004_0304_122d_1206,
- &pci_ss_info_1004_0304_1483_5020,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1004_0305[] = {
- &pci_ss_info_1004_0305_1004_0305,
- &pci_ss_info_1004_0305_122d_1207,
- &pci_ss_info_1004_0305_1483_5021,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1004_0306[] = {
- &pci_ss_info_1004_0306_1004_0306,
- &pci_ss_info_1004_0306_122d_1208,
- &pci_ss_info_1004_0306_1483_5022,
- NULL
-};
-#define pci_ss_list_1004_0307 NULL
-#define pci_ss_list_1004_0308 NULL
-#define pci_ss_list_1004_0702 NULL
-#define pci_ss_list_1004_0703 NULL
-#endif
-#define pci_ss_list_1005_2064 NULL
-#define pci_ss_list_1005_2128 NULL
-#define pci_ss_list_1005_2301 NULL
-#define pci_ss_list_1005_2302 NULL
-#define pci_ss_list_1005_2364 NULL
-#define pci_ss_list_1005_2464 NULL
-#define pci_ss_list_1005_2501 NULL
-#define pci_ss_list_100b_0001 NULL
-#define pci_ss_list_100b_0002 NULL
-#define pci_ss_list_100b_000e NULL
-#define pci_ss_list_100b_000f NULL
-#define pci_ss_list_100b_0011 NULL
-#define pci_ss_list_100b_0012 NULL
-#define pci_ss_list_100b_0020 NULL
-#define pci_ss_list_100b_0022 NULL
-#define pci_ss_list_100b_0500 NULL
-#define pci_ss_list_100b_0501 NULL
-#define pci_ss_list_100b_0502 NULL
-#define pci_ss_list_100b_0503 NULL
-#define pci_ss_list_100b_0504 NULL
-#define pci_ss_list_100b_0505 NULL
-#define pci_ss_list_100b_d001 NULL
-#define pci_ss_list_100c_3202 NULL
-#define pci_ss_list_100c_3205 NULL
-#define pci_ss_list_100c_3206 NULL
-#define pci_ss_list_100c_3207 NULL
-#define pci_ss_list_100c_3208 NULL
-#define pci_ss_list_100c_4702 NULL
-#define pci_ss_list_100e_9000 NULL
-#define pci_ss_list_100e_9001 NULL
-#define pci_ss_list_100e_9002 NULL
-#define pci_ss_list_100e_9100 NULL
-#define pci_ss_list_1011_0001 NULL
-#define pci_ss_list_1011_0002 NULL
-#define pci_ss_list_1011_0004 NULL
-#define pci_ss_list_1011_0007 NULL
-#define pci_ss_list_1011_0008 NULL
-static const pciSubsystemInfo *pci_ss_list_1011_0009[] = {
- &pci_ss_info_1011_0009_1025_0310,
- &pci_ss_info_1011_0009_10b8_2001,
- &pci_ss_info_1011_0009_10b8_2002,
- &pci_ss_info_1011_0009_10b8_2003,
- &pci_ss_info_1011_0009_1109_2400,
- &pci_ss_info_1011_0009_1112_2300,
- &pci_ss_info_1011_0009_1112_2320,
- &pci_ss_info_1011_0009_1112_2340,
- &pci_ss_info_1011_0009_1113_1207,
- &pci_ss_info_1011_0009_1186_1100,
- &pci_ss_info_1011_0009_1186_1112,
- &pci_ss_info_1011_0009_1186_1140,
- &pci_ss_info_1011_0009_1186_1142,
- &pci_ss_info_1011_0009_11f6_0503,
- &pci_ss_info_1011_0009_1282_9100,
- &pci_ss_info_1011_0009_1385_1100,
- &pci_ss_info_1011_0009_2646_0001,
- NULL
-};
-#define pci_ss_list_1011_000a NULL
-#define pci_ss_list_1011_000d NULL
-#define pci_ss_list_1011_000f NULL
-static const pciSubsystemInfo *pci_ss_list_1011_0014[] = {
- &pci_ss_info_1011_0014_1186_0100,
- NULL
-};
-#define pci_ss_list_1011_0016 NULL
-#define pci_ss_list_1011_0017 NULL
-static const pciSubsystemInfo *pci_ss_list_1011_0019[] = {
- &pci_ss_info_1011_0019_1011_500a,
- &pci_ss_info_1011_0019_1011_500b,
- &pci_ss_info_1011_0019_1014_0001,
- &pci_ss_info_1011_0019_1025_0315,
- &pci_ss_info_1011_0019_1033_800c,
- &pci_ss_info_1011_0019_1033_800d,
- &pci_ss_info_1011_0019_108d_0016,
- &pci_ss_info_1011_0019_108d_0017,
- &pci_ss_info_1011_0019_10b8_2005,
- &pci_ss_info_1011_0019_10b8_8034,
- &pci_ss_info_1011_0019_10ef_8169,
- &pci_ss_info_1011_0019_1109_2a00,
- &pci_ss_info_1011_0019_1109_2b00,
- &pci_ss_info_1011_0019_1109_3000,
- &pci_ss_info_1011_0019_1113_1207,
- &pci_ss_info_1011_0019_1113_2220,
- &pci_ss_info_1011_0019_115d_0002,
- &pci_ss_info_1011_0019_1179_0203,
- &pci_ss_info_1011_0019_1179_0204,
- &pci_ss_info_1011_0019_1186_1100,
- &pci_ss_info_1011_0019_1186_1101,
- &pci_ss_info_1011_0019_1186_1102,
- &pci_ss_info_1011_0019_1259_2800,
- &pci_ss_info_1011_0019_1266_0004,
- &pci_ss_info_1011_0019_12af_0019,
- &pci_ss_info_1011_0019_1374_0001,
- &pci_ss_info_1011_0019_1374_0002,
- &pci_ss_info_1011_0019_1374_0007,
- &pci_ss_info_1011_0019_1374_0008,
- &pci_ss_info_1011_0019_1385_2100,
- &pci_ss_info_1011_0019_1395_0001,
- &pci_ss_info_1011_0019_13d1_ab01,
- &pci_ss_info_1011_0019_8086_0001,
- NULL
-};
-#define pci_ss_list_1011_001a NULL
-#define pci_ss_list_1011_0021 NULL
-#define pci_ss_list_1011_0022 NULL
-#define pci_ss_list_1011_0023 NULL
-#define pci_ss_list_1011_0024 NULL
-#define pci_ss_list_1011_0025 NULL
-#define pci_ss_list_1011_0026 NULL
-static const pciSubsystemInfo *pci_ss_list_1011_0034[] = {
- &pci_ss_info_1011_0034_1374_0003,
- NULL
-};
-#define pci_ss_list_1011_0045 NULL
-static const pciSubsystemInfo *pci_ss_list_1011_0046[] = {
- &pci_ss_info_1011_0046_0e11_4050,
- &pci_ss_info_1011_0046_0e11_4051,
- &pci_ss_info_1011_0046_0e11_4058,
- &pci_ss_info_1011_0046_103c_10c2,
- &pci_ss_info_1011_0046_12d9_000a,
- &pci_ss_info_1011_0046_9005_0365,
- &pci_ss_info_1011_0046_9005_1364,
- &pci_ss_info_1011_0046_9005_1365,
- &pci_ss_info_1011_0046_e4bf_1000,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1011_1065[] = {
- &pci_ss_info_1011_1065_1069_0020,
- NULL
-};
-#define pci_ss_list_1013_0038 NULL
-#define pci_ss_list_1013_0040 NULL
-#define pci_ss_list_1013_004c NULL
-#define pci_ss_list_1013_00a0 NULL
-#define pci_ss_list_1013_00a2 NULL
-#define pci_ss_list_1013_00a4 NULL
-#define pci_ss_list_1013_00a8 NULL
-#define pci_ss_list_1013_00ac NULL
-#define pci_ss_list_1013_00b0 NULL
-#define pci_ss_list_1013_00b8 NULL
-static const pciSubsystemInfo *pci_ss_list_1013_00bc[] = {
- &pci_ss_info_1013_00bc_1013_00bc,
- NULL
-};
-#define pci_ss_list_1013_00d0 NULL
-#define pci_ss_list_1013_00d2 NULL
-#define pci_ss_list_1013_00d4 NULL
-#define pci_ss_list_1013_00d5 NULL
-static const pciSubsystemInfo *pci_ss_list_1013_00d6[] = {
- &pci_ss_info_1013_00d6_13ce_8031,
- &pci_ss_info_1013_00d6_13cf_8031,
- NULL
-};
-#define pci_ss_list_1013_00e8 NULL
-#define pci_ss_list_1013_1100 NULL
-#define pci_ss_list_1013_1110 NULL
-#define pci_ss_list_1013_1112 NULL
-#define pci_ss_list_1013_1113 NULL
-#define pci_ss_list_1013_1200 NULL
-#define pci_ss_list_1013_1202 NULL
-#define pci_ss_list_1013_1204 NULL
-#define pci_ss_list_1013_4400 NULL
-static const pciSubsystemInfo *pci_ss_list_1013_6001[] = {
- &pci_ss_info_1013_6001_1014_1010,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1013_6003[] = {
- &pci_ss_info_1013_6003_1013_4280,
- &pci_ss_info_1013_6003_1681_0050,
- &pci_ss_info_1013_6003_1681_a011,
- NULL
-};
-#define pci_ss_list_1013_6004 NULL
-static const pciSubsystemInfo *pci_ss_list_1013_6005[] = {
- &pci_ss_info_1013_6005_1013_4281,
- &pci_ss_info_1013_6005_10cf_10a8,
- &pci_ss_info_1013_6005_10cf_10a9,
- &pci_ss_info_1013_6005_10cf_10aa,
- &pci_ss_info_1013_6005_10cf_10ab,
- &pci_ss_info_1013_6005_10cf_10ac,
- &pci_ss_info_1013_6005_10cf_10ad,
- &pci_ss_info_1013_6005_10cf_10b4,
- &pci_ss_info_1013_6005_1179_0001,
- &pci_ss_info_1013_6005_14c0_000c,
- NULL
-};
-#define pci_ss_list_1014_0002 NULL
-#define pci_ss_list_1014_0005 NULL
-#define pci_ss_list_1014_0007 NULL
-#define pci_ss_list_1014_000a NULL
-#define pci_ss_list_1014_0017 NULL
-#define pci_ss_list_1014_0018 NULL
-#define pci_ss_list_1014_001b NULL
-#define pci_ss_list_1014_001c NULL
-#define pci_ss_list_1014_001d NULL
-#define pci_ss_list_1014_0020 NULL
-#define pci_ss_list_1014_0022 NULL
-#define pci_ss_list_1014_002d NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1014_002e[] = {
- &pci_ss_info_1014_002e_1014_002e,
- &pci_ss_info_1014_002e_1014_022e,
- NULL
-};
-#define pci_ss_list_1014_0036 NULL
-#define pci_ss_list_1014_003a NULL
-static const pciSubsystemInfo *pci_ss_list_1014_003e[] = {
- &pci_ss_info_1014_003e_1014_003e,
- &pci_ss_info_1014_003e_1014_00cd,
- &pci_ss_info_1014_003e_1014_00ce,
- &pci_ss_info_1014_003e_1014_00cf,
- &pci_ss_info_1014_003e_1014_00e4,
- &pci_ss_info_1014_003e_1014_00e5,
- &pci_ss_info_1014_003e_1014_016d,
- NULL
-};
-#define pci_ss_list_1014_0045 NULL
-#define pci_ss_list_1014_0046 NULL
-#define pci_ss_list_1014_0047 NULL
-#define pci_ss_list_1014_0048 NULL
-#define pci_ss_list_1014_0049 NULL
-#define pci_ss_list_1014_004e NULL
-#define pci_ss_list_1014_004f NULL
-#define pci_ss_list_1014_0050 NULL
-#define pci_ss_list_1014_0053 NULL
-#define pci_ss_list_1014_0057 NULL
-#define pci_ss_list_1014_005c NULL
-#define pci_ss_list_1014_007c NULL
-#define pci_ss_list_1014_007d NULL
-static const pciSubsystemInfo *pci_ss_list_1014_0090[] = {
- &pci_ss_info_1014_0090_1014_008e,
- NULL
-};
-#define pci_ss_list_1014_0095 NULL
-static const pciSubsystemInfo *pci_ss_list_1014_0096[] = {
- &pci_ss_info_1014_0096_1014_0097,
- &pci_ss_info_1014_0096_1014_0098,
- &pci_ss_info_1014_0096_1014_0099,
- NULL
-};
-#define pci_ss_list_1014_00a5 NULL
-#define pci_ss_list_1014_00a6 NULL
-#define pci_ss_list_1014_00b7 NULL
-#define pci_ss_list_1014_00be NULL
-#define pci_ss_list_1014_00dc NULL
-#define pci_ss_list_1014_00fc NULL
-#define pci_ss_list_1014_0105 NULL
-#define pci_ss_list_1014_010f NULL
-static const pciSubsystemInfo *pci_ss_list_1014_0142[] = {
- &pci_ss_info_1014_0142_1014_0143,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1014_0144[] = {
- &pci_ss_info_1014_0144_1014_0145,
- NULL
-};
-#define pci_ss_list_1014_0156 NULL
-#define pci_ss_list_1014_01a7 NULL
-static const pciSubsystemInfo *pci_ss_list_1014_01bd[] = {
- &pci_ss_info_1014_01bd_1014_01be,
- &pci_ss_info_1014_01bd_1014_01bf,
- &pci_ss_info_1014_01bd_1014_0208,
- &pci_ss_info_1014_01bd_1014_020e,
- &pci_ss_info_1014_01bd_1014_022e,
- &pci_ss_info_1014_01bd_1014_0258,
- &pci_ss_info_1014_01bd_1014_0259,
- NULL
-};
-#define pci_ss_list_1014_0302 NULL
-#define pci_ss_list_1014_ffff NULL
-#endif
-#define pci_ss_list_1017_5343 NULL
-#define pci_ss_list_101a_0005 NULL
-#define pci_ss_list_101c_0193 NULL
-#define pci_ss_list_101c_0196 NULL
-#define pci_ss_list_101c_0197 NULL
-#define pci_ss_list_101c_0296 NULL
-#define pci_ss_list_101c_3193 NULL
-#define pci_ss_list_101c_3197 NULL
-#define pci_ss_list_101c_3296 NULL
-#define pci_ss_list_101c_4296 NULL
-#define pci_ss_list_101c_9710 NULL
-#define pci_ss_list_101c_9712 NULL
-#define pci_ss_list_101c_c24a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_101e_1960[] = {
- &pci_ss_info_101e_1960_101e_0471,
- &pci_ss_info_101e_1960_101e_0475,
- &pci_ss_info_101e_1960_101e_0493,
- &pci_ss_info_101e_1960_1028_0471,
- &pci_ss_info_101e_1960_1028_0475,
- &pci_ss_info_101e_1960_1028_0493,
- &pci_ss_info_101e_1960_1028_0511,
- NULL
-};
-#define pci_ss_list_101e_9010 NULL
-#define pci_ss_list_101e_9030 NULL
-#define pci_ss_list_101e_9031 NULL
-#define pci_ss_list_101e_9032 NULL
-#define pci_ss_list_101e_9033 NULL
-#define pci_ss_list_101e_9040 NULL
-#define pci_ss_list_101e_9060 NULL
-static const pciSubsystemInfo *pci_ss_list_101e_9063[] = {
- &pci_ss_info_101e_9063_101e_0767,
- NULL
-};
-#endif
-#define pci_ss_list_1022_1100 NULL
-#define pci_ss_list_1022_1101 NULL
-#define pci_ss_list_1022_1102 NULL
-#define pci_ss_list_1022_1103 NULL
-static const pciSubsystemInfo *pci_ss_list_1022_2000[] = {
- &pci_ss_info_1022_2000_1014_2000,
- &pci_ss_info_1022_2000_103c_104c,
- &pci_ss_info_1022_2000_103c_1064,
- &pci_ss_info_1022_2000_103c_1065,
- &pci_ss_info_1022_2000_103c_106c,
- &pci_ss_info_1022_2000_103c_106e,
- &pci_ss_info_1022_2000_103c_10ea,
- &pci_ss_info_1022_2000_1113_1220,
- &pci_ss_info_1022_2000_1259_2450,
- &pci_ss_info_1022_2000_1259_2454,
- &pci_ss_info_1022_2000_1259_2700,
- &pci_ss_info_1022_2000_1259_2701,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1022_2001[] = {
- &pci_ss_info_1022_2001_1092_0a78,
- &pci_ss_info_1022_2001_1668_0299,
- NULL
-};
-#define pci_ss_list_1022_2020 NULL
-#define pci_ss_list_1022_2040 NULL
-#define pci_ss_list_1022_3000 NULL
-#define pci_ss_list_1022_7006 NULL
-#define pci_ss_list_1022_7007 NULL
-#define pci_ss_list_1022_700c NULL
-#define pci_ss_list_1022_700d NULL
-#define pci_ss_list_1022_700e NULL
-#define pci_ss_list_1022_700f NULL
-#define pci_ss_list_1022_7400 NULL
-#define pci_ss_list_1022_7401 NULL
-#define pci_ss_list_1022_7403 NULL
-#define pci_ss_list_1022_7404 NULL
-#define pci_ss_list_1022_7408 NULL
-#define pci_ss_list_1022_7409 NULL
-#define pci_ss_list_1022_740b NULL
-#define pci_ss_list_1022_740c NULL
-#define pci_ss_list_1022_7410 NULL
-#define pci_ss_list_1022_7411 NULL
-#define pci_ss_list_1022_7413 NULL
-#define pci_ss_list_1022_7414 NULL
-static const pciSubsystemInfo *pci_ss_list_1022_7440[] = {
- &pci_ss_info_1022_7440_1043_8044,
- NULL
-};
-#define pci_ss_list_1022_7441 NULL
-static const pciSubsystemInfo *pci_ss_list_1022_7443[] = {
- &pci_ss_info_1022_7443_1043_8044,
- NULL
-};
-#define pci_ss_list_1022_7445 NULL
-#define pci_ss_list_1022_7446 NULL
-#define pci_ss_list_1022_7448 NULL
-#define pci_ss_list_1022_7449 NULL
-#define pci_ss_list_1022_7450 NULL
-#define pci_ss_list_1022_7451 NULL
-#define pci_ss_list_1022_7454 NULL
-#define pci_ss_list_1022_7455 NULL
-#define pci_ss_list_1022_7460 NULL
-#define pci_ss_list_1022_7461 NULL
-#define pci_ss_list_1022_7462 NULL
-#define pci_ss_list_1022_7464 NULL
-#define pci_ss_list_1022_7468 NULL
-#define pci_ss_list_1022_7469 NULL
-#define pci_ss_list_1022_746a NULL
-#define pci_ss_list_1022_746b NULL
-#define pci_ss_list_1022_746d NULL
-#define pci_ss_list_1022_746e NULL
-#define pci_ss_list_1023_0194 NULL
-#define pci_ss_list_1023_2000 NULL
-#define pci_ss_list_1023_2001 NULL
-static const pciSubsystemInfo *pci_ss_list_1023_8400[] = {
- &pci_ss_info_1023_8400_1023_8400,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1023_8420[] = {
- &pci_ss_info_1023_8420_0e11_b15a,
- NULL
-};
-#define pci_ss_list_1023_8500 NULL
-static const pciSubsystemInfo *pci_ss_list_1023_8520[] = {
- &pci_ss_info_1023_8520_0e11_b16e,
- &pci_ss_info_1023_8520_1023_8520,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1023_8620[] = {
- &pci_ss_info_1023_8620_1014_0502,
- NULL
-};
-#define pci_ss_list_1023_8820 NULL
-#define pci_ss_list_1023_9320 NULL
-#define pci_ss_list_1023_9350 NULL
-#define pci_ss_list_1023_9360 NULL
-#define pci_ss_list_1023_9382 NULL
-#define pci_ss_list_1023_9383 NULL
-#define pci_ss_list_1023_9385 NULL
-#define pci_ss_list_1023_9386 NULL
-#define pci_ss_list_1023_9388 NULL
-#define pci_ss_list_1023_9397 NULL
-#define pci_ss_list_1023_939a NULL
-#define pci_ss_list_1023_9420 NULL
-#define pci_ss_list_1023_9430 NULL
-#define pci_ss_list_1023_9440 NULL
-#define pci_ss_list_1023_9460 NULL
-#define pci_ss_list_1023_9470 NULL
-#define pci_ss_list_1023_9520 NULL
-static const pciSubsystemInfo *pci_ss_list_1023_9525[] = {
- &pci_ss_info_1023_9525_10cf_1094,
- NULL
-};
-#define pci_ss_list_1023_9540 NULL
-#define pci_ss_list_1023_9660 NULL
-#define pci_ss_list_1023_9680 NULL
-#define pci_ss_list_1023_9682 NULL
-#define pci_ss_list_1023_9683 NULL
-#define pci_ss_list_1023_9685 NULL
-static const pciSubsystemInfo *pci_ss_list_1023_9750[] = {
- &pci_ss_info_1023_9750_1014_9750,
- &pci_ss_info_1023_9750_1023_9750,
- NULL
-};
-#define pci_ss_list_1023_9753 NULL
-#define pci_ss_list_1023_9754 NULL
-#define pci_ss_list_1023_9759 NULL
-#define pci_ss_list_1023_9783 NULL
-#define pci_ss_list_1023_9785 NULL
-#define pci_ss_list_1023_9850 NULL
-static const pciSubsystemInfo *pci_ss_list_1023_9880[] = {
- &pci_ss_info_1023_9880_1023_9880,
- NULL
-};
-#define pci_ss_list_1023_9910 NULL
-#define pci_ss_list_1023_9930 NULL
-#define pci_ss_list_1025_1435 NULL
-#define pci_ss_list_1025_1445 NULL
-#define pci_ss_list_1025_1449 NULL
-#define pci_ss_list_1025_1451 NULL
-#define pci_ss_list_1025_1461 NULL
-#define pci_ss_list_1025_1489 NULL
-#define pci_ss_list_1025_1511 NULL
-#define pci_ss_list_1025_1512 NULL
-#define pci_ss_list_1025_1513 NULL
-static const pciSubsystemInfo *pci_ss_list_1025_1521[] = {
- &pci_ss_info_1025_1521_10b9_1521,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1025_1523[] = {
- &pci_ss_info_1025_1523_10b9_1523,
- NULL
-};
-#define pci_ss_list_1025_1531 NULL
-static const pciSubsystemInfo *pci_ss_list_1025_1533[] = {
- &pci_ss_info_1025_1533_10b9_1533,
- NULL
-};
-#define pci_ss_list_1025_1535 NULL
-static const pciSubsystemInfo *pci_ss_list_1025_1541[] = {
- &pci_ss_info_1025_1541_10b9_1541,
- NULL
-};
-#define pci_ss_list_1025_1542 NULL
-#define pci_ss_list_1025_1543 NULL
-#define pci_ss_list_1025_1561 NULL
-#define pci_ss_list_1025_1621 NULL
-#define pci_ss_list_1025_1631 NULL
-#define pci_ss_list_1025_1641 NULL
-#define pci_ss_list_1025_1647 NULL
-#define pci_ss_list_1025_3141 NULL
-#define pci_ss_list_1025_3143 NULL
-#define pci_ss_list_1025_3145 NULL
-#define pci_ss_list_1025_3147 NULL
-#define pci_ss_list_1025_3149 NULL
-#define pci_ss_list_1025_3151 NULL
-#define pci_ss_list_1025_3307 NULL
-#define pci_ss_list_1025_3309 NULL
-#define pci_ss_list_1025_3321 NULL
-#define pci_ss_list_1025_5212 NULL
-#define pci_ss_list_1025_5215 NULL
-#define pci_ss_list_1025_5217 NULL
-#define pci_ss_list_1025_5219 NULL
-#define pci_ss_list_1025_5225 NULL
-#define pci_ss_list_1025_5229 NULL
-#define pci_ss_list_1025_5235 NULL
-#define pci_ss_list_1025_5237 NULL
-#define pci_ss_list_1025_5240 NULL
-#define pci_ss_list_1025_5241 NULL
-#define pci_ss_list_1025_5242 NULL
-#define pci_ss_list_1025_5243 NULL
-#define pci_ss_list_1025_5244 NULL
-#define pci_ss_list_1025_5247 NULL
-#define pci_ss_list_1025_5251 NULL
-#define pci_ss_list_1025_5427 NULL
-#define pci_ss_list_1025_5451 NULL
-#define pci_ss_list_1025_5453 NULL
-static const pciSubsystemInfo *pci_ss_list_1025_7101[] = {
- &pci_ss_info_1025_7101_10b9_7101,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1028_0001[] = {
- &pci_ss_info_1028_0001_1028_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1028_0002[] = {
- &pci_ss_info_1028_0002_1028_0002,
- &pci_ss_info_1028_0002_1028_00d1,
- &pci_ss_info_1028_0002_1028_00d9,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1028_0003[] = {
- &pci_ss_info_1028_0003_1028_0003,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1028_0004[] = {
- &pci_ss_info_1028_0004_1028_00d0,
- NULL
-};
-#define pci_ss_list_1028_0005 NULL
-#define pci_ss_list_1028_0006 NULL
-#define pci_ss_list_1028_0007 NULL
-#define pci_ss_list_1028_0008 NULL
-#define pci_ss_list_1028_0009 NULL
-static const pciSubsystemInfo *pci_ss_list_1028_000a[] = {
- &pci_ss_info_1028_000a_1028_0106,
- &pci_ss_info_1028_000a_1028_011b,
- &pci_ss_info_1028_000a_1028_0121,
- NULL
-};
-#define pci_ss_list_1028_000c NULL
-#define pci_ss_list_1028_000d NULL
-#define pci_ss_list_1028_000e NULL
-#define pci_ss_list_1028_000f NULL
-#define pci_ss_list_102a_0000 NULL
-#define pci_ss_list_102a_0010 NULL
-#define pci_ss_list_102b_0010 NULL
-#define pci_ss_list_102b_0100 NULL
-#define pci_ss_list_102b_0518 NULL
-#define pci_ss_list_102b_0519 NULL
-static const pciSubsystemInfo *pci_ss_list_102b_051a[] = {
- &pci_ss_info_102b_051a_102b_0100,
- &pci_ss_info_102b_051a_102b_1100,
- &pci_ss_info_102b_051a_102b_1200,
- &pci_ss_info_102b_051a_1100_102b,
- &pci_ss_info_102b_051a_110a_0018,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102b_051b[] = {
- &pci_ss_info_102b_051b_102b_051b,
- &pci_ss_info_102b_051b_102b_1100,
- &pci_ss_info_102b_051b_102b_1200,
- NULL
-};
-#define pci_ss_list_102b_051e NULL
-#define pci_ss_list_102b_051f NULL
-static const pciSubsystemInfo *pci_ss_list_102b_0520[] = {
- &pci_ss_info_102b_0520_102b_dbc2,
- &pci_ss_info_102b_0520_102b_dbc8,
- &pci_ss_info_102b_0520_102b_dbe2,
- &pci_ss_info_102b_0520_102b_dbe8,
- &pci_ss_info_102b_0520_102b_ff03,
- &pci_ss_info_102b_0520_102b_ff04,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102b_0521[] = {
- &pci_ss_info_102b_0521_1014_ff03,
- &pci_ss_info_102b_0521_102b_48e9,
- &pci_ss_info_102b_0521_102b_48f8,
- &pci_ss_info_102b_0521_102b_4a60,
- &pci_ss_info_102b_0521_102b_4a64,
- &pci_ss_info_102b_0521_102b_c93c,
- &pci_ss_info_102b_0521_102b_c9b0,
- &pci_ss_info_102b_0521_102b_c9bc,
- &pci_ss_info_102b_0521_102b_ca60,
- &pci_ss_info_102b_0521_102b_ca6c,
- &pci_ss_info_102b_0521_102b_dbbc,
- &pci_ss_info_102b_0521_102b_dbc2,
- &pci_ss_info_102b_0521_102b_dbc3,
- &pci_ss_info_102b_0521_102b_dbc8,
- &pci_ss_info_102b_0521_102b_dbd2,
- &pci_ss_info_102b_0521_102b_dbd3,
- &pci_ss_info_102b_0521_102b_dbd4,
- &pci_ss_info_102b_0521_102b_dbd5,
- &pci_ss_info_102b_0521_102b_dbd8,
- &pci_ss_info_102b_0521_102b_dbd9,
- &pci_ss_info_102b_0521_102b_dbe2,
- &pci_ss_info_102b_0521_102b_dbe3,
- &pci_ss_info_102b_0521_102b_dbe8,
- &pci_ss_info_102b_0521_102b_dbf2,
- &pci_ss_info_102b_0521_102b_dbf3,
- &pci_ss_info_102b_0521_102b_dbf4,
- &pci_ss_info_102b_0521_102b_dbf5,
- &pci_ss_info_102b_0521_102b_dbf8,
- &pci_ss_info_102b_0521_102b_dbf9,
- &pci_ss_info_102b_0521_102b_f806,
- &pci_ss_info_102b_0521_102b_ff00,
- &pci_ss_info_102b_0521_102b_ff02,
- &pci_ss_info_102b_0521_102b_ff03,
- &pci_ss_info_102b_0521_102b_ff04,
- &pci_ss_info_102b_0521_110a_0032,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102b_0525[] = {
- &pci_ss_info_102b_0525_0e11_b16f,
- &pci_ss_info_102b_0525_102b_0328,
- &pci_ss_info_102b_0525_102b_0338,
- &pci_ss_info_102b_0525_102b_0378,
- &pci_ss_info_102b_0525_102b_0541,
- &pci_ss_info_102b_0525_102b_0542,
- &pci_ss_info_102b_0525_102b_0543,
- &pci_ss_info_102b_0525_102b_0641,
- &pci_ss_info_102b_0525_102b_0642,
- &pci_ss_info_102b_0525_102b_0643,
- &pci_ss_info_102b_0525_102b_07c0,
- &pci_ss_info_102b_0525_102b_07c1,
- &pci_ss_info_102b_0525_102b_0d41,
- &pci_ss_info_102b_0525_102b_0d42,
- &pci_ss_info_102b_0525_102b_0e00,
- &pci_ss_info_102b_0525_102b_0e01,
- &pci_ss_info_102b_0525_102b_0e02,
- &pci_ss_info_102b_0525_102b_0e03,
- &pci_ss_info_102b_0525_102b_0f80,
- &pci_ss_info_102b_0525_102b_0f81,
- &pci_ss_info_102b_0525_102b_0f82,
- &pci_ss_info_102b_0525_102b_0f83,
- &pci_ss_info_102b_0525_102b_19d8,
- &pci_ss_info_102b_0525_102b_19f8,
- &pci_ss_info_102b_0525_102b_2159,
- &pci_ss_info_102b_0525_102b_2179,
- &pci_ss_info_102b_0525_102b_217d,
- &pci_ss_info_102b_0525_102b_23c0,
- &pci_ss_info_102b_0525_102b_23c1,
- &pci_ss_info_102b_0525_102b_23c2,
- &pci_ss_info_102b_0525_102b_23c3,
- &pci_ss_info_102b_0525_102b_2f58,
- &pci_ss_info_102b_0525_102b_2f78,
- &pci_ss_info_102b_0525_102b_3693,
- &pci_ss_info_102b_0525_102b_5dd0,
- &pci_ss_info_102b_0525_102b_5f50,
- &pci_ss_info_102b_0525_102b_5f51,
- &pci_ss_info_102b_0525_102b_5f52,
- &pci_ss_info_102b_0525_102b_9010,
- &pci_ss_info_102b_0525_1458_0400,
- &pci_ss_info_102b_0525_1705_0001,
- &pci_ss_info_102b_0525_1705_0002,
- &pci_ss_info_102b_0525_1705_0003,
- &pci_ss_info_102b_0525_1705_0004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102b_0527[] = {
- &pci_ss_info_102b_0527_102b_0840,
- NULL
-};
-#define pci_ss_list_102b_0d10 NULL
-static const pciSubsystemInfo *pci_ss_list_102b_1000[] = {
- &pci_ss_info_102b_1000_102b_ff01,
- &pci_ss_info_102b_1000_102b_ff05,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102b_1001[] = {
- &pci_ss_info_102b_1001_102b_1001,
- &pci_ss_info_102b_1001_102b_ff00,
- &pci_ss_info_102b_1001_102b_ff01,
- &pci_ss_info_102b_1001_102b_ff03,
- &pci_ss_info_102b_1001_102b_ff04,
- &pci_ss_info_102b_1001_102b_ff05,
- &pci_ss_info_102b_1001_110a_001e,
- NULL
-};
-#define pci_ss_list_102b_2007 NULL
-static const pciSubsystemInfo *pci_ss_list_102b_2527[] = {
- &pci_ss_info_102b_2527_102b_0f83,
- &pci_ss_info_102b_2527_102b_0f84,
- &pci_ss_info_102b_2527_102b_1e41,
- NULL
-};
-#define pci_ss_list_102b_4536 NULL
-#define pci_ss_list_102b_6573 NULL
-#define pci_ss_list_102c_00b8 NULL
-static const pciSubsystemInfo *pci_ss_list_102c_00c0[] = {
- &pci_ss_info_102c_00c0_102c_00c0,
- NULL
-};
-#define pci_ss_list_102c_00d0 NULL
-#define pci_ss_list_102c_00d8 NULL
-#define pci_ss_list_102c_00dc NULL
-#define pci_ss_list_102c_00e0 NULL
-#define pci_ss_list_102c_00e4 NULL
-static const pciSubsystemInfo *pci_ss_list_102c_00e5[] = {
- &pci_ss_info_102c_00e5_0e11_b049,
- NULL
-};
-#define pci_ss_list_102c_00f0 NULL
-#define pci_ss_list_102c_00f4 NULL
-#define pci_ss_list_102c_00f5 NULL
-#define pci_ss_list_102c_0c30 NULL
-#define pci_ss_list_102d_50dc NULL
-#define pci_ss_list_102f_0009 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_102f_0020[] = {
- &pci_ss_info_102f_0020_102f_00f8,
- NULL
-};
-#endif
-#define pci_ss_list_1031_5601 NULL
-#define pci_ss_list_1031_5607 NULL
-#define pci_ss_list_1031_5631 NULL
-#define pci_ss_list_1031_6057 NULL
-#define pci_ss_list_1033_0001 NULL
-#define pci_ss_list_1033_0002 NULL
-#define pci_ss_list_1033_0003 NULL
-#define pci_ss_list_1033_0004 NULL
-#define pci_ss_list_1033_0005 NULL
-#define pci_ss_list_1033_0006 NULL
-#define pci_ss_list_1033_0007 NULL
-#define pci_ss_list_1033_0008 NULL
-#define pci_ss_list_1033_0009 NULL
-#define pci_ss_list_1033_0016 NULL
-#define pci_ss_list_1033_001a NULL
-#define pci_ss_list_1033_0021 NULL
-#define pci_ss_list_1033_0029 NULL
-#define pci_ss_list_1033_002a NULL
-#define pci_ss_list_1033_002c NULL
-#define pci_ss_list_1033_002d NULL
-static const pciSubsystemInfo *pci_ss_list_1033_0035[] = {
- &pci_ss_info_1033_0035_1179_0001,
- &pci_ss_info_1033_0035_12ee_7000,
- &pci_ss_info_1033_0035_1799_0001,
- NULL
-};
-#define pci_ss_list_1033_003b NULL
-#define pci_ss_list_1033_003e NULL
-#define pci_ss_list_1033_0046 NULL
-#define pci_ss_list_1033_005a NULL
-#define pci_ss_list_1033_0063 NULL
-static const pciSubsystemInfo *pci_ss_list_1033_0067[] = {
- &pci_ss_info_1033_0067_1010_0020,
- &pci_ss_info_1033_0067_1010_0080,
- &pci_ss_info_1033_0067_1010_0088,
- &pci_ss_info_1033_0067_1010_0090,
- &pci_ss_info_1033_0067_1010_0098,
- &pci_ss_info_1033_0067_1010_00a0,
- &pci_ss_info_1033_0067_1010_00a8,
- &pci_ss_info_1033_0067_1010_0120,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1033_0074[] = {
- &pci_ss_info_1033_0074_1033_8014,
- NULL
-};
-#define pci_ss_list_1033_009b NULL
-#define pci_ss_list_1033_00a6 NULL
-static const pciSubsystemInfo *pci_ss_list_1033_00cd[] = {
- &pci_ss_info_1033_00cd_12ee_8011,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1033_00e0[] = {
- &pci_ss_info_1033_00e0_12ee_7001,
- &pci_ss_info_1033_00e0_1799_0002,
- NULL
-};
-#define pci_ss_list_1036_0000 NULL
-#define pci_ss_list_1039_0001 NULL
-#define pci_ss_list_1039_0002 NULL
-#define pci_ss_list_1039_0006 NULL
-#define pci_ss_list_1039_0008 NULL
-#define pci_ss_list_1039_0009 NULL
-#define pci_ss_list_1039_0018 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_0200[] = {
- &pci_ss_info_1039_0200_1039_0000,
- NULL
-};
-#define pci_ss_list_1039_0204 NULL
-#define pci_ss_list_1039_0205 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_0300[] = {
- &pci_ss_info_1039_0300_107d_2720,
- NULL
-};
-#define pci_ss_list_1039_0310 NULL
-#define pci_ss_list_1039_0315 NULL
-#define pci_ss_list_1039_0325 NULL
-#define pci_ss_list_1039_0330 NULL
-#define pci_ss_list_1039_0406 NULL
-#define pci_ss_list_1039_0496 NULL
-#define pci_ss_list_1039_0530 NULL
-#define pci_ss_list_1039_0540 NULL
-#define pci_ss_list_1039_0597 NULL
-#define pci_ss_list_1039_0601 NULL
-#define pci_ss_list_1039_0620 NULL
-#define pci_ss_list_1039_0630 NULL
-#define pci_ss_list_1039_0633 NULL
-#define pci_ss_list_1039_0635 NULL
-#define pci_ss_list_1039_0645 NULL
-#define pci_ss_list_1039_0646 NULL
-#define pci_ss_list_1039_0648 NULL
-#define pci_ss_list_1039_0650 NULL
-#define pci_ss_list_1039_0651 NULL
-#define pci_ss_list_1039_0730 NULL
-#define pci_ss_list_1039_0733 NULL
-#define pci_ss_list_1039_0735 NULL
-#define pci_ss_list_1039_0740 NULL
-#define pci_ss_list_1039_0745 NULL
-#define pci_ss_list_1039_0755 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_0900[] = {
- &pci_ss_info_1039_0900_1039_0900,
- NULL
-};
-#define pci_ss_list_1039_0961 NULL
-#define pci_ss_list_1039_0962 NULL
-#define pci_ss_list_1039_3602 NULL
-#define pci_ss_list_1039_5107 NULL
-#define pci_ss_list_1039_5300 NULL
-#define pci_ss_list_1039_5315 NULL
-#define pci_ss_list_1039_5401 NULL
-#define pci_ss_list_1039_5511 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_5513[] = {
- &pci_ss_info_1039_5513_1019_0970,
- &pci_ss_info_1039_5513_1039_5513,
- NULL
-};
-#define pci_ss_list_1039_5517 NULL
-#define pci_ss_list_1039_5571 NULL
-#define pci_ss_list_1039_5581 NULL
-#define pci_ss_list_1039_5582 NULL
-#define pci_ss_list_1039_5591 NULL
-#define pci_ss_list_1039_5596 NULL
-#define pci_ss_list_1039_5597 NULL
-#define pci_ss_list_1039_5600 NULL
-#define pci_ss_list_1039_6204 NULL
-#define pci_ss_list_1039_6205 NULL
-#define pci_ss_list_1039_6236 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_6300[] = {
- &pci_ss_info_1039_6300_1019_0970,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1039_6306[] = {
- &pci_ss_info_1039_6306_1039_6306,
- NULL
-};
-#define pci_ss_list_1039_6325 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_6326[] = {
- &pci_ss_info_1039_6326_1039_6326,
- &pci_ss_info_1039_6326_1092_0a50,
- &pci_ss_info_1039_6326_1092_0a70,
- &pci_ss_info_1039_6326_1092_4910,
- &pci_ss_info_1039_6326_1092_4920,
- &pci_ss_info_1039_6326_1569_6326,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1039_7001[] = {
- &pci_ss_info_1039_7001_1039_7000,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1039_7002[] = {
- &pci_ss_info_1039_7002_1509_7002,
- NULL
-};
-#define pci_ss_list_1039_7007 NULL
-#define pci_ss_list_1039_7012 NULL
-#define pci_ss_list_1039_7013 NULL
-static const pciSubsystemInfo *pci_ss_list_1039_7016[] = {
- &pci_ss_info_1039_7016_1039_7016,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1039_7018[] = {
- &pci_ss_info_1039_7018_1014_01b6,
- &pci_ss_info_1039_7018_1014_01b7,
- &pci_ss_info_1039_7018_1019_7018,
- &pci_ss_info_1039_7018_1025_000e,
- &pci_ss_info_1039_7018_1025_0018,
- &pci_ss_info_1039_7018_1039_7018,
- &pci_ss_info_1039_7018_1043_800b,
- &pci_ss_info_1039_7018_1054_7018,
- &pci_ss_info_1039_7018_107d_5330,
- &pci_ss_info_1039_7018_107d_5350,
- &pci_ss_info_1039_7018_1170_3209,
- &pci_ss_info_1039_7018_1462_400a,
- &pci_ss_info_1039_7018_14a4_2089,
- &pci_ss_info_1039_7018_14cd_2194,
- &pci_ss_info_1039_7018_14ff_1100,
- &pci_ss_info_1039_7018_152d_8808,
- &pci_ss_info_1039_7018_1558_1103,
- &pci_ss_info_1039_7018_1558_2200,
- &pci_ss_info_1039_7018_1563_7018,
- &pci_ss_info_1039_7018_15c5_0111,
- &pci_ss_info_1039_7018_270f_a171,
- &pci_ss_info_1039_7018_a0a0_0022,
- NULL
-};
-#define pci_ss_list_103c_1005 NULL
-#define pci_ss_list_103c_1006 NULL
-#define pci_ss_list_103c_1008 NULL
-#define pci_ss_list_103c_100a NULL
-#define pci_ss_list_103c_1028 NULL
-static const pciSubsystemInfo *pci_ss_list_103c_1029[] = {
- &pci_ss_info_103c_1029_107e_000f,
- &pci_ss_info_103c_1029_9004_9210,
- &pci_ss_info_103c_1029_9004_9211,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_103c_102a[] = {
- &pci_ss_info_103c_102a_107e_000e,
- &pci_ss_info_103c_102a_9004_9110,
- &pci_ss_info_103c_102a_9004_9111,
- NULL
-};
-#define pci_ss_list_103c_1030 NULL
-static const pciSubsystemInfo *pci_ss_list_103c_1031[] = {
- &pci_ss_info_103c_1031_103c_1040,
- &pci_ss_info_103c_1031_103c_1041,
- &pci_ss_info_103c_1031_103c_1042,
- NULL
-};
-#define pci_ss_list_103c_1040 NULL
-#define pci_ss_list_103c_1041 NULL
-#define pci_ss_list_103c_1042 NULL
-static const pciSubsystemInfo *pci_ss_list_103c_1048[] = {
- &pci_ss_info_103c_1048_103c_1049,
- &pci_ss_info_103c_1048_103c_104a,
- &pci_ss_info_103c_1048_103c_104b,
- &pci_ss_info_103c_1048_103c_1223,
- &pci_ss_info_103c_1048_103c_1226,
- &pci_ss_info_103c_1048_103c_1227,
- &pci_ss_info_103c_1048_103c_1282,
- NULL
-};
-#define pci_ss_list_103c_1064 NULL
-#define pci_ss_list_103c_108b NULL
-#define pci_ss_list_103c_10c1 NULL
-#define pci_ss_list_103c_10ed NULL
-#define pci_ss_list_103c_1200 NULL
-#define pci_ss_list_103c_1219 NULL
-#define pci_ss_list_103c_121a NULL
-#define pci_ss_list_103c_121b NULL
-#define pci_ss_list_103c_121c NULL
-#define pci_ss_list_103c_1229 NULL
-#define pci_ss_list_103c_122a NULL
-#define pci_ss_list_103c_122e NULL
-#define pci_ss_list_103c_1290 NULL
-#define pci_ss_list_103c_12b4 NULL
-#define pci_ss_list_103c_2910 NULL
-#define pci_ss_list_103c_2925 NULL
-#define pci_ss_list_1042_1000 NULL
-#define pci_ss_list_1042_1001 NULL
-#define pci_ss_list_1042_3000 NULL
-#define pci_ss_list_1042_3010 NULL
-#define pci_ss_list_1042_3020 NULL
-#define pci_ss_list_1043_0675 NULL
-#define pci_ss_list_1043_4021 NULL
-#define pci_ss_list_1044_1012 NULL
-#define pci_ss_list_1044_a400 NULL
-#define pci_ss_list_1044_a500 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1044_a501[] = {
- &pci_ss_info_1044_a501_1044_c001,
- &pci_ss_info_1044_a501_1044_c002,
- &pci_ss_info_1044_a501_1044_c003,
- &pci_ss_info_1044_a501_1044_c004,
- &pci_ss_info_1044_a501_1044_c005,
- &pci_ss_info_1044_a501_1044_c00a,
- &pci_ss_info_1044_a501_1044_c00b,
- &pci_ss_info_1044_a501_1044_c00c,
- &pci_ss_info_1044_a501_1044_c00d,
- &pci_ss_info_1044_a501_1044_c00e,
- &pci_ss_info_1044_a501_1044_c00f,
- &pci_ss_info_1044_a501_1044_c014,
- &pci_ss_info_1044_a501_1044_c015,
- &pci_ss_info_1044_a501_1044_c016,
- &pci_ss_info_1044_a501_1044_c01e,
- &pci_ss_info_1044_a501_1044_c01f,
- &pci_ss_info_1044_a501_1044_c020,
- &pci_ss_info_1044_a501_1044_c021,
- &pci_ss_info_1044_a501_1044_c028,
- &pci_ss_info_1044_a501_1044_c029,
- &pci_ss_info_1044_a501_1044_c02a,
- &pci_ss_info_1044_a501_1044_c03c,
- &pci_ss_info_1044_a501_1044_c03d,
- &pci_ss_info_1044_a501_1044_c03e,
- &pci_ss_info_1044_a501_1044_c046,
- &pci_ss_info_1044_a501_1044_c047,
- &pci_ss_info_1044_a501_1044_c048,
- &pci_ss_info_1044_a501_1044_c050,
- &pci_ss_info_1044_a501_1044_c051,
- &pci_ss_info_1044_a501_1044_c052,
- &pci_ss_info_1044_a501_1044_c05a,
- &pci_ss_info_1044_a501_1044_c05b,
- &pci_ss_info_1044_a501_1044_c064,
- &pci_ss_info_1044_a501_1044_c065,
- &pci_ss_info_1044_a501_1044_c066,
- NULL
-};
-#define pci_ss_list_1044_a511 NULL
-#endif
-#define pci_ss_list_1045_a0f8 NULL
-#define pci_ss_list_1045_c101 NULL
-#define pci_ss_list_1045_c178 NULL
-#define pci_ss_list_1045_c556 NULL
-#define pci_ss_list_1045_c557 NULL
-#define pci_ss_list_1045_c558 NULL
-#define pci_ss_list_1045_c567 NULL
-#define pci_ss_list_1045_c568 NULL
-#define pci_ss_list_1045_c569 NULL
-#define pci_ss_list_1045_c621 NULL
-#define pci_ss_list_1045_c700 NULL
-#define pci_ss_list_1045_c701 NULL
-#define pci_ss_list_1045_c814 NULL
-#define pci_ss_list_1045_c822 NULL
-#define pci_ss_list_1045_c824 NULL
-#define pci_ss_list_1045_c825 NULL
-#define pci_ss_list_1045_c832 NULL
-#define pci_ss_list_1045_c861 NULL
-#define pci_ss_list_1045_c895 NULL
-#define pci_ss_list_1045_c935 NULL
-#define pci_ss_list_1045_d568 NULL
-#define pci_ss_list_1045_d721 NULL
-#define pci_ss_list_1048_0d22 NULL
-#define pci_ss_list_1048_1000 NULL
-#define pci_ss_list_1048_3000 NULL
-#define pci_ss_list_104a_0008 NULL
-#define pci_ss_list_104a_0009 NULL
-#define pci_ss_list_104a_0010 NULL
-#define pci_ss_list_104a_0210 NULL
-#define pci_ss_list_104a_0981 NULL
-#define pci_ss_list_104a_1746 NULL
-#define pci_ss_list_104a_2774 NULL
-#define pci_ss_list_104a_3520 NULL
-#define pci_ss_list_104b_0140 NULL
-#define pci_ss_list_104b_1040 NULL
-#define pci_ss_list_104b_8130 NULL
-#define pci_ss_list_104c_0500 NULL
-#define pci_ss_list_104c_0508 NULL
-#define pci_ss_list_104c_1000 NULL
-#define pci_ss_list_104c_104c NULL
-#define pci_ss_list_104c_3d04 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_3d07[] = {
- &pci_ss_info_104c_3d07_1011_4d10,
- &pci_ss_info_104c_3d07_1040_000f,
- &pci_ss_info_104c_3d07_1040_0011,
- &pci_ss_info_104c_3d07_1048_0a31,
- &pci_ss_info_104c_3d07_1048_0a32,
- &pci_ss_info_104c_3d07_1048_0a35,
- &pci_ss_info_104c_3d07_107d_2633,
- &pci_ss_info_104c_3d07_1092_0127,
- &pci_ss_info_104c_3d07_1092_0136,
- &pci_ss_info_104c_3d07_1092_0141,
- &pci_ss_info_104c_3d07_1092_0146,
- &pci_ss_info_104c_3d07_1092_0148,
- &pci_ss_info_104c_3d07_1092_0149,
- &pci_ss_info_104c_3d07_1092_0152,
- &pci_ss_info_104c_3d07_1092_0154,
- &pci_ss_info_104c_3d07_1092_0155,
- &pci_ss_info_104c_3d07_1092_0156,
- &pci_ss_info_104c_3d07_1092_0157,
- &pci_ss_info_104c_3d07_1097_3d01,
- &pci_ss_info_104c_3d07_1102_100f,
- &pci_ss_info_104c_3d07_3d3d_0100,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_104c_8000[] = {
- &pci_ss_info_104c_8000_e4bf_1010,
- &pci_ss_info_104c_8000_e4bf_1020,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_104c_8009[] = {
- &pci_ss_info_104c_8009_104d_8032,
- NULL
-};
-#define pci_ss_list_104c_8017 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_8019[] = {
- &pci_ss_info_104c_8019_11bd_000a,
- &pci_ss_info_104c_8019_11bd_000e,
- &pci_ss_info_104c_8019_e4bf_1010,
- NULL
-};
-#define pci_ss_list_104c_8020 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_8021[] = {
- &pci_ss_info_104c_8021_104d_80df,
- &pci_ss_info_104c_8021_104d_80e7,
- NULL
-};
-#define pci_ss_list_104c_8022 NULL
-#define pci_ss_list_104c_8023 NULL
-#define pci_ss_list_104c_8024 NULL
-#define pci_ss_list_104c_8026 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_8027[] = {
- &pci_ss_info_104c_8027_1028_00e6,
- NULL
-};
-#define pci_ss_list_104c_8400 NULL
-#define pci_ss_list_104c_a001 NULL
-#define pci_ss_list_104c_a100 NULL
-#define pci_ss_list_104c_a102 NULL
-#define pci_ss_list_104c_a106 NULL
-#define pci_ss_list_104c_ac10 NULL
-#define pci_ss_list_104c_ac11 NULL
-#define pci_ss_list_104c_ac12 NULL
-#define pci_ss_list_104c_ac13 NULL
-#define pci_ss_list_104c_ac15 NULL
-#define pci_ss_list_104c_ac16 NULL
-#define pci_ss_list_104c_ac17 NULL
-#define pci_ss_list_104c_ac18 NULL
-#define pci_ss_list_104c_ac19 NULL
-#define pci_ss_list_104c_ac1a NULL
-static const pciSubsystemInfo *pci_ss_list_104c_ac1b[] = {
- &pci_ss_info_104c_ac1b_0e11_b113,
- NULL
-};
-#define pci_ss_list_104c_ac1c NULL
-#define pci_ss_list_104c_ac1d NULL
-#define pci_ss_list_104c_ac1e NULL
-#define pci_ss_list_104c_ac1f NULL
-#define pci_ss_list_104c_ac20 NULL
-#define pci_ss_list_104c_ac21 NULL
-#define pci_ss_list_104c_ac22 NULL
-#define pci_ss_list_104c_ac23 NULL
-#define pci_ss_list_104c_ac28 NULL
-#define pci_ss_list_104c_ac30 NULL
-#define pci_ss_list_104c_ac40 NULL
-#define pci_ss_list_104c_ac41 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_ac42[] = {
- &pci_ss_info_104c_ac42_1028_00e6,
- NULL
-};
-#define pci_ss_list_104c_ac50 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_ac51[] = {
- &pci_ss_info_104c_ac51_1014_023b,
- &pci_ss_info_104c_ac51_10cf_1095,
- &pci_ss_info_104c_ac51_e4bf_1000,
- NULL
-};
-#define pci_ss_list_104c_ac52 NULL
-#define pci_ss_list_104c_ac53 NULL
-static const pciSubsystemInfo *pci_ss_list_104c_ac55[] = {
- &pci_ss_info_104c_ac55_1014_0512,
- NULL
-};
-#define pci_ss_list_104c_ac56 NULL
-#define pci_ss_list_104c_ac60 NULL
-#define pci_ss_list_104c_fe00 NULL
-#define pci_ss_list_104c_fe03 NULL
-#define pci_ss_list_104d_8009 NULL
-#define pci_ss_list_104d_8039 NULL
-#define pci_ss_list_104d_8056 NULL
-#define pci_ss_list_104d_808a NULL
-#define pci_ss_list_104e_0017 NULL
-#define pci_ss_list_104e_0107 NULL
-#define pci_ss_list_104e_0109 NULL
-#define pci_ss_list_104e_0111 NULL
-#define pci_ss_list_104e_0217 NULL
-#define pci_ss_list_104e_0317 NULL
-#define pci_ss_list_1050_0000 NULL
-#define pci_ss_list_1050_0001 NULL
-#define pci_ss_list_1050_0105 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1050_0840[] = {
- &pci_ss_info_1050_0840_1050_0001,
- &pci_ss_info_1050_0840_1050_0840,
- NULL
-};
-#define pci_ss_list_1050_0940 NULL
-#define pci_ss_list_1050_5a5a NULL
-#define pci_ss_list_1050_6692 NULL
-#define pci_ss_list_1050_9970 NULL
-#endif
-#define pci_ss_list_1055_9130 NULL
-#define pci_ss_list_1055_9460 NULL
-#define pci_ss_list_1055_9462 NULL
-#define pci_ss_list_1055_9463 NULL
-#define pci_ss_list_1057_0001 NULL
-#define pci_ss_list_1057_0002 NULL
-#define pci_ss_list_1057_0003 NULL
-#define pci_ss_list_1057_0004 NULL
-#define pci_ss_list_1057_0006 NULL
-#define pci_ss_list_1057_0100 NULL
-#define pci_ss_list_1057_0431 NULL
-static const pciSubsystemInfo *pci_ss_list_1057_1801[] = {
- &pci_ss_info_1057_1801_ecc0_0030,
- NULL
-};
-#define pci_ss_list_1057_18c0 NULL
-#define pci_ss_list_1057_4801 NULL
-#define pci_ss_list_1057_4802 NULL
-#define pci_ss_list_1057_4803 NULL
-#define pci_ss_list_1057_4806 NULL
-#define pci_ss_list_1057_4d68 NULL
-static const pciSubsystemInfo *pci_ss_list_1057_5600[] = {
- &pci_ss_info_1057_5600_1057_0300,
- &pci_ss_info_1057_5600_1057_0301,
- &pci_ss_info_1057_5600_1057_0302,
- &pci_ss_info_1057_5600_1057_5600,
- &pci_ss_info_1057_5600_13d2_0300,
- &pci_ss_info_1057_5600_13d2_0301,
- &pci_ss_info_1057_5600_13d2_0302,
- &pci_ss_info_1057_5600_1436_0300,
- &pci_ss_info_1057_5600_1436_0301,
- &pci_ss_info_1057_5600_1436_0302,
- &pci_ss_info_1057_5600_144f_100c,
- &pci_ss_info_1057_5600_1494_0300,
- &pci_ss_info_1057_5600_1494_0301,
- &pci_ss_info_1057_5600_14c8_0300,
- &pci_ss_info_1057_5600_14c8_0302,
- &pci_ss_info_1057_5600_1668_0300,
- &pci_ss_info_1057_5600_1668_0302,
- NULL
-};
-#define pci_ss_list_1057_6400 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_105a_0d30[] = {
- &pci_ss_info_105a_0d30_105a_4d33,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_0d38[] = {
- &pci_ss_info_105a_0d38_105a_4d39,
- NULL
-};
-#define pci_ss_list_105a_1275 NULL
-static const pciSubsystemInfo *pci_ss_list_105a_3376[] = {
- &pci_ss_info_105a_3376_1043_809e,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_4d30[] = {
- &pci_ss_info_105a_4d30_105a_4d33,
- &pci_ss_info_105a_4d30_105a_4d39,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_4d33[] = {
- &pci_ss_info_105a_4d33_105a_4d33,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_4d38[] = {
- &pci_ss_info_105a_4d38_105a_4d30,
- &pci_ss_info_105a_4d38_105a_4d33,
- &pci_ss_info_105a_4d38_105a_4d39,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_4d68[] = {
- &pci_ss_info_105a_4d68_105a_4d68,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_4d69[] = {
- &pci_ss_info_105a_4d69_105a_4d68,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105a_5275[] = {
- &pci_ss_info_105a_5275_105a_0275,
- NULL
-};
-#define pci_ss_list_105a_5300 NULL
-#define pci_ss_list_105a_6268 NULL
-static const pciSubsystemInfo *pci_ss_list_105a_6269[] = {
- &pci_ss_info_105a_6269_105a_6269,
- NULL
-};
-#define pci_ss_list_105a_6621 NULL
-#define pci_ss_list_105a_7275 NULL
-#endif
-#define pci_ss_list_105d_2309 NULL
-static const pciSubsystemInfo *pci_ss_list_105d_2339[] = {
- &pci_ss_info_105d_2339_105d_0000,
- &pci_ss_info_105d_2339_105d_0001,
- &pci_ss_info_105d_2339_105d_0002,
- &pci_ss_info_105d_2339_105d_0003,
- &pci_ss_info_105d_2339_105d_0004,
- &pci_ss_info_105d_2339_105d_0005,
- &pci_ss_info_105d_2339_105d_0006,
- &pci_ss_info_105d_2339_105d_0007,
- &pci_ss_info_105d_2339_105d_0008,
- &pci_ss_info_105d_2339_105d_0009,
- &pci_ss_info_105d_2339_105d_000a,
- &pci_ss_info_105d_2339_105d_000b,
- &pci_ss_info_105d_2339_11a4_000a,
- &pci_ss_info_105d_2339_13cc_0000,
- &pci_ss_info_105d_2339_13cc_0004,
- &pci_ss_info_105d_2339_13cc_0005,
- &pci_ss_info_105d_2339_13cc_0006,
- &pci_ss_info_105d_2339_13cc_0008,
- &pci_ss_info_105d_2339_13cc_0009,
- &pci_ss_info_105d_2339_13cc_000a,
- &pci_ss_info_105d_2339_13cc_000c,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105d_493d[] = {
- &pci_ss_info_105d_493d_11a4_000a,
- &pci_ss_info_105d_493d_11a4_000b,
- &pci_ss_info_105d_493d_13cc_0002,
- &pci_ss_info_105d_493d_13cc_0003,
- &pci_ss_info_105d_493d_13cc_0007,
- &pci_ss_info_105d_493d_13cc_0008,
- &pci_ss_info_105d_493d_13cc_0009,
- &pci_ss_info_105d_493d_13cc_000a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_105d_5348[] = {
- &pci_ss_info_105d_5348_105d_0037,
- NULL
-};
-#define pci_ss_list_1060_0001 NULL
-#define pci_ss_list_1060_0002 NULL
-#define pci_ss_list_1060_0101 NULL
-#define pci_ss_list_1060_0881 NULL
-#define pci_ss_list_1060_0886 NULL
-#define pci_ss_list_1060_0891 NULL
-#define pci_ss_list_1060_1001 NULL
-#define pci_ss_list_1060_673a NULL
-#define pci_ss_list_1060_673b NULL
-#define pci_ss_list_1060_8710 NULL
-#define pci_ss_list_1060_886a NULL
-#define pci_ss_list_1060_8881 NULL
-#define pci_ss_list_1060_8886 NULL
-#define pci_ss_list_1060_888a NULL
-#define pci_ss_list_1060_8891 NULL
-#define pci_ss_list_1060_9017 NULL
-#define pci_ss_list_1060_9018 NULL
-#define pci_ss_list_1060_9026 NULL
-#define pci_ss_list_1060_e881 NULL
-#define pci_ss_list_1060_e886 NULL
-#define pci_ss_list_1060_e88a NULL
-#define pci_ss_list_1060_e891 NULL
-#define pci_ss_list_1061_0001 NULL
-#define pci_ss_list_1061_0002 NULL
-#define pci_ss_list_1066_0000 NULL
-#define pci_ss_list_1066_0001 NULL
-#define pci_ss_list_1066_0002 NULL
-#define pci_ss_list_1066_0003 NULL
-#define pci_ss_list_1066_0004 NULL
-#define pci_ss_list_1066_0005 NULL
-#define pci_ss_list_1066_8002 NULL
-#define pci_ss_list_1067_1002 NULL
-#define pci_ss_list_1069_0001 NULL
-#define pci_ss_list_1069_0002 NULL
-#define pci_ss_list_1069_0010 NULL
-#define pci_ss_list_1069_0050 NULL
-#define pci_ss_list_1069_ba55 NULL
-#define pci_ss_list_1069_ba56 NULL
-#define pci_ss_list_106b_0001 NULL
-#define pci_ss_list_106b_0002 NULL
-#define pci_ss_list_106b_0003 NULL
-#define pci_ss_list_106b_0004 NULL
-#define pci_ss_list_106b_0007 NULL
-#define pci_ss_list_106b_000e NULL
-#define pci_ss_list_106b_0010 NULL
-#define pci_ss_list_106b_0017 NULL
-#define pci_ss_list_106b_0018 NULL
-#define pci_ss_list_106b_0019 NULL
-#define pci_ss_list_106b_001e NULL
-#define pci_ss_list_106b_001f NULL
-#define pci_ss_list_106b_0020 NULL
-#define pci_ss_list_106b_0021 NULL
-#define pci_ss_list_106b_0022 NULL
-#define pci_ss_list_106b_0024 NULL
-#define pci_ss_list_106b_0025 NULL
-#define pci_ss_list_106b_0026 NULL
-#define pci_ss_list_106b_0027 NULL
-#define pci_ss_list_106b_0028 NULL
-#define pci_ss_list_106b_0029 NULL
-#define pci_ss_list_106b_002d NULL
-#define pci_ss_list_106b_002e NULL
-#define pci_ss_list_106b_002f NULL
-#define pci_ss_list_106b_0030 NULL
-#define pci_ss_list_106b_0031 NULL
-#define pci_ss_list_106b_0032 NULL
-#define pci_ss_list_106b_0033 NULL
-#define pci_ss_list_106b_0034 NULL
-#define pci_ss_list_106b_1645 NULL
-#define pci_ss_list_106c_8801 NULL
-#define pci_ss_list_106c_8802 NULL
-#define pci_ss_list_106c_8803 NULL
-#define pci_ss_list_106c_8804 NULL
-#define pci_ss_list_106c_8805 NULL
-#define pci_ss_list_1073_0001 NULL
-#define pci_ss_list_1073_0002 NULL
-#define pci_ss_list_1073_0003 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1073_0004[] = {
- &pci_ss_info_1073_0004_1073_0004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_0005[] = {
- &pci_ss_info_1073_0005_1073_0005,
- NULL
-};
-#define pci_ss_list_1073_0006 NULL
-static const pciSubsystemInfo *pci_ss_list_1073_0008[] = {
- &pci_ss_info_1073_0008_1073_0008,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_000a[] = {
- &pci_ss_info_1073_000a_1073_0004,
- &pci_ss_info_1073_000a_1073_000a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_000c[] = {
- &pci_ss_info_1073_000c_107a_000c,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_000d[] = {
- &pci_ss_info_1073_000d_1073_000d,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_0010[] = {
- &pci_ss_info_1073_0010_1073_0006,
- &pci_ss_info_1073_0010_1073_0010,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1073_0012[] = {
- &pci_ss_info_1073_0012_1073_0012,
- NULL
-};
-#define pci_ss_list_1073_0020 NULL
-static const pciSubsystemInfo *pci_ss_list_1073_2000[] = {
- &pci_ss_info_1073_2000_1073_2000,
- NULL
-};
-#endif
-#define pci_ss_list_1074_4e78 NULL
-#define pci_ss_list_1077_1016 NULL
-#define pci_ss_list_1077_1020 NULL
-#define pci_ss_list_1077_1022 NULL
-#define pci_ss_list_1077_1080 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1077_1216[] = {
- &pci_ss_info_1077_1216_101e_8471,
- &pci_ss_info_1077_1216_101e_8493,
- NULL
-};
-#define pci_ss_list_1077_1240 NULL
-#define pci_ss_list_1077_1280 NULL
-#define pci_ss_list_1077_2020 NULL
-static const pciSubsystemInfo *pci_ss_list_1077_2100[] = {
- &pci_ss_info_1077_2100_1077_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1077_2200[] = {
- &pci_ss_info_1077_2200_1077_0002,
- NULL
-};
-#define pci_ss_list_1077_2300 NULL
-#define pci_ss_list_1077_2312 NULL
-#endif
-#define pci_ss_list_1078_0000 NULL
-#define pci_ss_list_1078_0001 NULL
-#define pci_ss_list_1078_0002 NULL
-#define pci_ss_list_1078_0100 NULL
-#define pci_ss_list_1078_0101 NULL
-#define pci_ss_list_1078_0102 NULL
-#define pci_ss_list_1078_0103 NULL
-#define pci_ss_list_1078_0104 NULL
-#define pci_ss_list_1078_0400 NULL
-#define pci_ss_list_1078_0401 NULL
-#define pci_ss_list_1078_0402 NULL
-#define pci_ss_list_1078_0403 NULL
-#define pci_ss_list_107d_0000 NULL
-#define pci_ss_list_107e_0001 NULL
-#define pci_ss_list_107e_0002 NULL
-#define pci_ss_list_107e_0004 NULL
-#define pci_ss_list_107e_0005 NULL
-#define pci_ss_list_107e_0008 NULL
-#define pci_ss_list_107e_9003 NULL
-#define pci_ss_list_107e_9007 NULL
-#define pci_ss_list_107e_9008 NULL
-#define pci_ss_list_107e_900c NULL
-#define pci_ss_list_107e_900e NULL
-#define pci_ss_list_107e_9011 NULL
-#define pci_ss_list_107e_9013 NULL
-#define pci_ss_list_107e_9023 NULL
-#define pci_ss_list_107e_9027 NULL
-#define pci_ss_list_107e_9031 NULL
-#define pci_ss_list_107e_9033 NULL
-#define pci_ss_list_107f_0802 NULL
-#define pci_ss_list_1080_0600 NULL
-#define pci_ss_list_1080_c691 NULL
-#define pci_ss_list_1080_c693 NULL
-#define pci_ss_list_1081_0d47 NULL
-#define pci_ss_list_1083_0001 NULL
-#define pci_ss_list_108a_0001 NULL
-#define pci_ss_list_108a_0010 NULL
-#define pci_ss_list_108a_0040 NULL
-#define pci_ss_list_108a_3000 NULL
-#define pci_ss_list_108d_0001 NULL
-#define pci_ss_list_108d_0002 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_108d_0004[] = {
- &pci_ss_info_108d_0004_108d_0004,
- NULL
-};
-#define pci_ss_list_108d_0005 NULL
-#define pci_ss_list_108d_0006 NULL
-static const pciSubsystemInfo *pci_ss_list_108d_0007[] = {
- &pci_ss_info_108d_0007_108d_0007,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_108d_0008[] = {
- &pci_ss_info_108d_0008_108d_0008,
- NULL
-};
-#define pci_ss_list_108d_0011 NULL
-#define pci_ss_list_108d_0012 NULL
-#define pci_ss_list_108d_0013 NULL
-#define pci_ss_list_108d_0014 NULL
-static const pciSubsystemInfo *pci_ss_list_108d_0019[] = {
- &pci_ss_info_108d_0019_108d_0016,
- &pci_ss_info_108d_0019_108d_0017,
- NULL
-};
-#define pci_ss_list_108d_0021 NULL
-#define pci_ss_list_108d_0022 NULL
-#endif
-#define pci_ss_list_108e_0001 NULL
-#define pci_ss_list_108e_1000 NULL
-#define pci_ss_list_108e_1001 NULL
-#define pci_ss_list_108e_1100 NULL
-#define pci_ss_list_108e_1101 NULL
-#define pci_ss_list_108e_1102 NULL
-#define pci_ss_list_108e_1103 NULL
-#define pci_ss_list_108e_2bad NULL
-#define pci_ss_list_108e_5000 NULL
-#define pci_ss_list_108e_5043 NULL
-#define pci_ss_list_108e_8000 NULL
-#define pci_ss_list_108e_8001 NULL
-#define pci_ss_list_108e_a000 NULL
-#define pci_ss_list_108e_a001 NULL
-#define pci_ss_list_1091_0020 NULL
-#define pci_ss_list_1091_0021 NULL
-#define pci_ss_list_1091_0040 NULL
-#define pci_ss_list_1091_0041 NULL
-#define pci_ss_list_1091_0060 NULL
-#define pci_ss_list_1091_00e4 NULL
-#define pci_ss_list_1091_0720 NULL
-#define pci_ss_list_1092_00a0 NULL
-#define pci_ss_list_1092_00a8 NULL
-#define pci_ss_list_1092_0550 NULL
-#define pci_ss_list_1092_08d4 NULL
-#define pci_ss_list_1092_094c NULL
-#define pci_ss_list_1092_1092 NULL
-#define pci_ss_list_1092_6120 NULL
-#define pci_ss_list_1092_8810 NULL
-#define pci_ss_list_1092_8811 NULL
-#define pci_ss_list_1092_8880 NULL
-#define pci_ss_list_1092_8881 NULL
-#define pci_ss_list_1092_88b0 NULL
-#define pci_ss_list_1092_88b1 NULL
-#define pci_ss_list_1092_88c0 NULL
-#define pci_ss_list_1092_88c1 NULL
-#define pci_ss_list_1092_88d0 NULL
-#define pci_ss_list_1092_88d1 NULL
-#define pci_ss_list_1092_88f0 NULL
-#define pci_ss_list_1092_88f1 NULL
-#define pci_ss_list_1092_9999 NULL
-#define pci_ss_list_1093_0160 NULL
-#define pci_ss_list_1093_0162 NULL
-#define pci_ss_list_1093_1170 NULL
-#define pci_ss_list_1093_1180 NULL
-#define pci_ss_list_1093_1190 NULL
-#define pci_ss_list_1093_1330 NULL
-#define pci_ss_list_1093_1350 NULL
-#define pci_ss_list_1093_2a60 NULL
-#define pci_ss_list_1093_b001 NULL
-#define pci_ss_list_1093_b011 NULL
-#define pci_ss_list_1093_b021 NULL
-#define pci_ss_list_1093_b031 NULL
-#define pci_ss_list_1093_b041 NULL
-#define pci_ss_list_1093_b051 NULL
-#define pci_ss_list_1093_b061 NULL
-#define pci_ss_list_1093_b071 NULL
-#define pci_ss_list_1093_b081 NULL
-#define pci_ss_list_1093_b091 NULL
-#define pci_ss_list_1093_c801 NULL
-#define pci_ss_list_1093_c831 NULL
-#define pci_ss_list_1095_0240 NULL
-#define pci_ss_list_1095_0640 NULL
-#define pci_ss_list_1095_0643 NULL
-#define pci_ss_list_1095_0646 NULL
-#define pci_ss_list_1095_0647 NULL
-#define pci_ss_list_1095_0648 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1095_0649[] = {
- &pci_ss_info_1095_0649_0e11_005d,
- &pci_ss_info_1095_0649_0e11_007e,
- &pci_ss_info_1095_0649_101e_0649,
- NULL
-};
-#define pci_ss_list_1095_0650 NULL
-static const pciSubsystemInfo *pci_ss_list_1095_0670[] = {
- &pci_ss_info_1095_0670_1095_0670,
- NULL
-};
-#define pci_ss_list_1095_0673 NULL
-#define pci_ss_list_1095_0680 NULL
-#define pci_ss_list_1095_3112 NULL
-#endif
-#define pci_ss_list_1098_0001 NULL
-#define pci_ss_list_1098_0002 NULL
-#define pci_ss_list_109e_0350 NULL
-#define pci_ss_list_109e_0351 NULL
-static const pciSubsystemInfo *pci_ss_list_109e_0369[] = {
- &pci_ss_info_109e_0369_1002_0001,
- &pci_ss_info_109e_0369_1002_0003,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_036c[] = {
- &pci_ss_info_109e_036c_13e9_0070,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_036e[] = {
- &pci_ss_info_109e_036e_0070_13eb,
- &pci_ss_info_109e_036e_0070_ff01,
- &pci_ss_info_109e_036e_107d_6606,
- &pci_ss_info_109e_036e_11bd_0012,
- &pci_ss_info_109e_036e_11bd_001c,
- &pci_ss_info_109e_036e_127a_0001,
- &pci_ss_info_109e_036e_127a_0002,
- &pci_ss_info_109e_036e_127a_0003,
- &pci_ss_info_109e_036e_127a_0048,
- &pci_ss_info_109e_036e_144f_3000,
- &pci_ss_info_109e_036e_1461_0004,
- &pci_ss_info_109e_036e_14f1_0001,
- &pci_ss_info_109e_036e_14f1_0002,
- &pci_ss_info_109e_036e_14f1_0003,
- &pci_ss_info_109e_036e_14f1_0048,
- &pci_ss_info_109e_036e_1851_1850,
- &pci_ss_info_109e_036e_1851_1851,
- &pci_ss_info_109e_036e_1852_1852,
- &pci_ss_info_109e_036e_bd11_1200,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_036f[] = {
- &pci_ss_info_109e_036f_127a_0044,
- &pci_ss_info_109e_036f_127a_0122,
- &pci_ss_info_109e_036f_127a_0144,
- &pci_ss_info_109e_036f_127a_0222,
- &pci_ss_info_109e_036f_127a_0244,
- &pci_ss_info_109e_036f_127a_0322,
- &pci_ss_info_109e_036f_127a_0422,
- &pci_ss_info_109e_036f_127a_1122,
- &pci_ss_info_109e_036f_127a_1222,
- &pci_ss_info_109e_036f_127a_1322,
- &pci_ss_info_109e_036f_127a_1522,
- &pci_ss_info_109e_036f_127a_1622,
- &pci_ss_info_109e_036f_127a_1722,
- &pci_ss_info_109e_036f_14f1_0044,
- &pci_ss_info_109e_036f_14f1_0122,
- &pci_ss_info_109e_036f_14f1_0144,
- &pci_ss_info_109e_036f_14f1_0222,
- &pci_ss_info_109e_036f_14f1_0244,
- &pci_ss_info_109e_036f_14f1_0322,
- &pci_ss_info_109e_036f_14f1_0422,
- &pci_ss_info_109e_036f_14f1_1122,
- &pci_ss_info_109e_036f_14f1_1222,
- &pci_ss_info_109e_036f_14f1_1322,
- &pci_ss_info_109e_036f_14f1_1522,
- &pci_ss_info_109e_036f_14f1_1622,
- &pci_ss_info_109e_036f_14f1_1722,
- &pci_ss_info_109e_036f_1851_1850,
- &pci_ss_info_109e_036f_1851_1851,
- &pci_ss_info_109e_036f_1852_1852,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_0370[] = {
- &pci_ss_info_109e_0370_1851_1850,
- &pci_ss_info_109e_0370_1851_1851,
- &pci_ss_info_109e_0370_1852_1852,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_0878[] = {
- &pci_ss_info_109e_0878_0070_13eb,
- &pci_ss_info_109e_0878_0070_ff01,
- &pci_ss_info_109e_0878_1002_0001,
- &pci_ss_info_109e_0878_1002_0003,
- &pci_ss_info_109e_0878_11bd_0012,
- &pci_ss_info_109e_0878_11bd_001c,
- &pci_ss_info_109e_0878_127a_0001,
- &pci_ss_info_109e_0878_127a_0002,
- &pci_ss_info_109e_0878_127a_0003,
- &pci_ss_info_109e_0878_127a_0048,
- &pci_ss_info_109e_0878_13e9_0070,
- &pci_ss_info_109e_0878_144f_3000,
- &pci_ss_info_109e_0878_1461_0004,
- &pci_ss_info_109e_0878_14f1_0001,
- &pci_ss_info_109e_0878_14f1_0002,
- &pci_ss_info_109e_0878_14f1_0003,
- &pci_ss_info_109e_0878_14f1_0048,
- &pci_ss_info_109e_0878_bd11_1200,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_109e_0879[] = {
- &pci_ss_info_109e_0879_127a_0044,
- &pci_ss_info_109e_0879_127a_0122,
- &pci_ss_info_109e_0879_127a_0144,
- &pci_ss_info_109e_0879_127a_0222,
- &pci_ss_info_109e_0879_127a_0244,
- &pci_ss_info_109e_0879_127a_0322,
- &pci_ss_info_109e_0879_127a_0422,
- &pci_ss_info_109e_0879_127a_1122,
- &pci_ss_info_109e_0879_127a_1222,
- &pci_ss_info_109e_0879_127a_1322,
- &pci_ss_info_109e_0879_127a_1522,
- &pci_ss_info_109e_0879_127a_1622,
- &pci_ss_info_109e_0879_127a_1722,
- &pci_ss_info_109e_0879_14f1_0044,
- &pci_ss_info_109e_0879_14f1_0122,
- &pci_ss_info_109e_0879_14f1_0144,
- &pci_ss_info_109e_0879_14f1_0222,
- &pci_ss_info_109e_0879_14f1_0244,
- &pci_ss_info_109e_0879_14f1_0322,
- &pci_ss_info_109e_0879_14f1_0422,
- &pci_ss_info_109e_0879_14f1_1122,
- &pci_ss_info_109e_0879_14f1_1222,
- &pci_ss_info_109e_0879_14f1_1322,
- &pci_ss_info_109e_0879_14f1_1522,
- &pci_ss_info_109e_0879_14f1_1622,
- &pci_ss_info_109e_0879_14f1_1722,
- NULL
-};
-#define pci_ss_list_109e_0880 NULL
-#define pci_ss_list_109e_2115 NULL
-#define pci_ss_list_109e_2125 NULL
-#define pci_ss_list_109e_2164 NULL
-#define pci_ss_list_109e_2165 NULL
-#define pci_ss_list_109e_8230 NULL
-#define pci_ss_list_109e_8472 NULL
-#define pci_ss_list_109e_8474 NULL
-#define pci_ss_list_10a5_3052 NULL
-#define pci_ss_list_10a5_5449 NULL
-#define pci_ss_list_10a8_0000 NULL
-#define pci_ss_list_10a9_0001 NULL
-#define pci_ss_list_10a9_0002 NULL
-#define pci_ss_list_10a9_0003 NULL
-#define pci_ss_list_10a9_0004 NULL
-#define pci_ss_list_10a9_0005 NULL
-#define pci_ss_list_10a9_0006 NULL
-#define pci_ss_list_10a9_0007 NULL
-#define pci_ss_list_10a9_0008 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10a9_0009[] = {
- &pci_ss_info_10a9_0009_10a9_8002,
- NULL
-};
-#define pci_ss_list_10a9_0010 NULL
-#define pci_ss_list_10a9_0011 NULL
-#define pci_ss_list_10a9_0012 NULL
-#define pci_ss_list_10a9_1001 NULL
-#define pci_ss_list_10a9_1002 NULL
-#define pci_ss_list_10a9_1003 NULL
-#define pci_ss_list_10a9_1004 NULL
-#define pci_ss_list_10a9_1005 NULL
-#define pci_ss_list_10a9_1006 NULL
-#define pci_ss_list_10a9_1007 NULL
-#define pci_ss_list_10a9_1008 NULL
-#define pci_ss_list_10a9_100a NULL
-#define pci_ss_list_10a9_2001 NULL
-#define pci_ss_list_10a9_2002 NULL
-#define pci_ss_list_10a9_8001 NULL
-#define pci_ss_list_10a9_8002 NULL
-#endif
-#define pci_ss_list_10aa_0000 NULL
-#define pci_ss_list_10ad_0001 NULL
-#define pci_ss_list_10ad_0003 NULL
-#define pci_ss_list_10ad_0005 NULL
-#define pci_ss_list_10ad_0103 NULL
-#define pci_ss_list_10ad_0105 NULL
-#define pci_ss_list_10ad_0565 NULL
-#define pci_ss_list_10b3_3106 NULL
-#define pci_ss_list_10b3_b106 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b4_1b1d[] = {
- &pci_ss_info_10b4_1b1d_10b4_237e,
- NULL
-};
-#endif
-#define pci_ss_list_10b5_0001 NULL
-#define pci_ss_list_10b5_1076 NULL
-#define pci_ss_list_10b5_1077 NULL
-#define pci_ss_list_10b5_1078 NULL
-#define pci_ss_list_10b5_1103 NULL
-#define pci_ss_list_10b5_1146 NULL
-#define pci_ss_list_10b5_1147 NULL
-#define pci_ss_list_10b5_2724 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b5_9030[] = {
- &pci_ss_info_10b5_9030_15ed_1002,
- &pci_ss_info_10b5_9030_15ed_1003,
- NULL
-};
-#define pci_ss_list_10b5_9036 NULL
-static const pciSubsystemInfo *pci_ss_list_10b5_9050[] = {
- &pci_ss_info_10b5_9050_10b5_2036,
- &pci_ss_info_10b5_9050_10b5_2273,
- &pci_ss_info_10b5_9050_10b5_9050,
- &pci_ss_info_10b5_9050_1522_0001,
- &pci_ss_info_10b5_9050_1522_0002,
- &pci_ss_info_10b5_9050_1522_0003,
- &pci_ss_info_10b5_9050_1522_0004,
- &pci_ss_info_10b5_9050_1522_0010,
- &pci_ss_info_10b5_9050_1522_0020,
- &pci_ss_info_10b5_9050_15ed_1000,
- &pci_ss_info_10b5_9050_15ed_1001,
- &pci_ss_info_10b5_9050_15ed_1002,
- &pci_ss_info_10b5_9050_15ed_1003,
- &pci_ss_info_10b5_9050_5654_5634,
- &pci_ss_info_10b5_9050_d531_c002,
- &pci_ss_info_10b5_9050_d84d_4006,
- &pci_ss_info_10b5_9050_d84d_4008,
- &pci_ss_info_10b5_9050_d84d_4014,
- &pci_ss_info_10b5_9050_d84d_4018,
- &pci_ss_info_10b5_9050_d84d_4025,
- &pci_ss_info_10b5_9050_d84d_4027,
- &pci_ss_info_10b5_9050_d84d_4028,
- &pci_ss_info_10b5_9050_d84d_4036,
- &pci_ss_info_10b5_9050_d84d_4037,
- &pci_ss_info_10b5_9050_d84d_4038,
- &pci_ss_info_10b5_9050_d84d_4052,
- &pci_ss_info_10b5_9050_d84d_4053,
- &pci_ss_info_10b5_9050_d84d_4055,
- &pci_ss_info_10b5_9050_d84d_4058,
- &pci_ss_info_10b5_9050_d84d_4065,
- &pci_ss_info_10b5_9050_d84d_4068,
- &pci_ss_info_10b5_9050_d84d_4078,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b5_9054[] = {
- &pci_ss_info_10b5_9054_10b5_2455,
- &pci_ss_info_10b5_9054_12d9_0002,
- NULL
-};
-#define pci_ss_list_10b5_9060 NULL
-static const pciSubsystemInfo *pci_ss_list_10b5_906d[] = {
- &pci_ss_info_10b5_906d_125c_0640,
- NULL
-};
-#define pci_ss_list_10b5_906e NULL
-static const pciSubsystemInfo *pci_ss_list_10b5_9080[] = {
- &pci_ss_info_10b5_9080_10b5_9080,
- &pci_ss_info_10b5_9080_129d_0002,
- &pci_ss_info_10b5_9080_12d9_0002,
- NULL
-};
-#endif
-#define pci_ss_list_10b6_0001 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b6_0002[] = {
- &pci_ss_info_10b6_0002_10b6_0002,
- &pci_ss_info_10b6_0002_10b6_0006,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_0003[] = {
- &pci_ss_info_10b6_0003_0e11_b0fd,
- &pci_ss_info_10b6_0003_10b6_0003,
- &pci_ss_info_10b6_0003_10b6_0007,
- NULL
-};
-#define pci_ss_list_10b6_0004 NULL
-static const pciSubsystemInfo *pci_ss_list_10b6_0006[] = {
- &pci_ss_info_10b6_0006_10b6_0006,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_0007[] = {
- &pci_ss_info_10b6_0007_10b6_0007,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_0009[] = {
- &pci_ss_info_10b6_0009_10b6_0009,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_000a[] = {
- &pci_ss_info_10b6_000a_10b6_000a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_000b[] = {
- &pci_ss_info_10b6_000b_10b6_0008,
- &pci_ss_info_10b6_000b_10b6_000b,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b6_000c[] = {
- &pci_ss_info_10b6_000c_10b6_000c,
- NULL
-};
-#define pci_ss_list_10b6_1000 NULL
-#define pci_ss_list_10b6_1001 NULL
-#endif
-#define pci_ss_list_10b7_0001 NULL
-#define pci_ss_list_10b7_0910 NULL
-#define pci_ss_list_10b7_1006 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b7_1007[] = {
- &pci_ss_info_10b7_1007_10b7_615c,
- NULL
-};
-#define pci_ss_list_10b7_3390 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_3590[] = {
- &pci_ss_info_10b7_3590_10b7_3590,
- NULL
-};
-#define pci_ss_list_10b7_4500 NULL
-#define pci_ss_list_10b7_5055 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_5057[] = {
- &pci_ss_info_10b7_5057_10b7_5a57,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_5157[] = {
- &pci_ss_info_10b7_5157_10b7_5b57,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_5257[] = {
- &pci_ss_info_10b7_5257_10b7_5c57,
- NULL
-};
-#define pci_ss_list_10b7_5900 NULL
-#define pci_ss_list_10b7_5920 NULL
-#define pci_ss_list_10b7_5950 NULL
-#define pci_ss_list_10b7_5951 NULL
-#define pci_ss_list_10b7_5952 NULL
-#define pci_ss_list_10b7_5970 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_5b57[] = {
- &pci_ss_info_10b7_5b57_10b7_5b57,
- NULL
-};
-#define pci_ss_list_10b7_6055 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_6056[] = {
- &pci_ss_info_10b7_6056_10b7_6556,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_6560[] = {
- &pci_ss_info_10b7_6560_10b7_656a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_6561[] = {
- &pci_ss_info_10b7_6561_10b7_656b,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_6562[] = {
- &pci_ss_info_10b7_6562_10b7_656b,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_6563[] = {
- &pci_ss_info_10b7_6563_10b7_656b,
- NULL
-};
-#define pci_ss_list_10b7_6564 NULL
-#define pci_ss_list_10b7_7646 NULL
-#define pci_ss_list_10b7_7940 NULL
-#define pci_ss_list_10b7_7980 NULL
-#define pci_ss_list_10b7_7990 NULL
-#define pci_ss_list_10b7_8811 NULL
-#define pci_ss_list_10b7_9000 NULL
-#define pci_ss_list_10b7_9001 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_9004[] = {
- &pci_ss_info_10b7_9004_10b7_9004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_9005[] = {
- &pci_ss_info_10b7_9005_10b7_9005,
- NULL
-};
-#define pci_ss_list_10b7_9006 NULL
-#define pci_ss_list_10b7_900a NULL
-#define pci_ss_list_10b7_9050 NULL
-#define pci_ss_list_10b7_9051 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_9055[] = {
- &pci_ss_info_10b7_9055_1028_0080,
- &pci_ss_info_10b7_9055_1028_0081,
- &pci_ss_info_10b7_9055_1028_0082,
- &pci_ss_info_10b7_9055_1028_0083,
- &pci_ss_info_10b7_9055_1028_0084,
- &pci_ss_info_10b7_9055_1028_0085,
- &pci_ss_info_10b7_9055_1028_0086,
- &pci_ss_info_10b7_9055_1028_0087,
- &pci_ss_info_10b7_9055_1028_0088,
- &pci_ss_info_10b7_9055_1028_0089,
- &pci_ss_info_10b7_9055_1028_0090,
- &pci_ss_info_10b7_9055_1028_0091,
- &pci_ss_info_10b7_9055_1028_0092,
- &pci_ss_info_10b7_9055_1028_0093,
- &pci_ss_info_10b7_9055_1028_0094,
- &pci_ss_info_10b7_9055_1028_0095,
- &pci_ss_info_10b7_9055_1028_0096,
- &pci_ss_info_10b7_9055_1028_0097,
- &pci_ss_info_10b7_9055_1028_0098,
- &pci_ss_info_10b7_9055_1028_0099,
- &pci_ss_info_10b7_9055_10b7_9055,
- NULL
-};
-#define pci_ss_list_10b7_9056 NULL
-#define pci_ss_list_10b7_9058 NULL
-#define pci_ss_list_10b7_905a NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_9200[] = {
- &pci_ss_info_10b7_9200_1028_0095,
- &pci_ss_info_10b7_9200_10b7_1000,
- &pci_ss_info_10b7_9200_10b7_7000,
- NULL
-};
-#define pci_ss_list_10b7_9201 NULL
-#define pci_ss_list_10b7_9300 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_9800[] = {
- &pci_ss_info_10b7_9800_10b7_9800,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_9805[] = {
- &pci_ss_info_10b7_9805_10b7_1201,
- &pci_ss_info_10b7_9805_10b7_1202,
- &pci_ss_info_10b7_9805_10b7_9805,
- &pci_ss_info_10b7_9805_10f1_2462,
- NULL
-};
-#define pci_ss_list_10b7_9900 NULL
-#define pci_ss_list_10b7_9902 NULL
-#define pci_ss_list_10b7_9903 NULL
-static const pciSubsystemInfo *pci_ss_list_10b7_9904[] = {
- &pci_ss_info_10b7_9904_10b7_1000,
- &pci_ss_info_10b7_9904_10b7_2000,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b7_9905[] = {
- &pci_ss_info_10b7_9905_10b7_1101,
- &pci_ss_info_10b7_9905_10b7_1102,
- &pci_ss_info_10b7_9905_10b7_2101,
- &pci_ss_info_10b7_9905_10b7_2102,
- NULL
-};
-#define pci_ss_list_10b7_9908 NULL
-#define pci_ss_list_10b7_9909 NULL
-#define pci_ss_list_10b7_990b NULL
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b8_0005[] = {
- &pci_ss_info_10b8_0005_1055_e000,
- &pci_ss_info_10b8_0005_1055_e002,
- &pci_ss_info_10b8_0005_10b8_a011,
- &pci_ss_info_10b8_0005_10b8_a014,
- &pci_ss_info_10b8_0005_10b8_a015,
- &pci_ss_info_10b8_0005_10b8_a016,
- &pci_ss_info_10b8_0005_10b8_a017,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b8_0006[] = {
- &pci_ss_info_10b8_0006_1055_e100,
- &pci_ss_info_10b8_0006_1055_e102,
- &pci_ss_info_10b8_0006_1055_e300,
- &pci_ss_info_10b8_0006_1055_e302,
- &pci_ss_info_10b8_0006_10b8_a012,
- &pci_ss_info_10b8_0006_13a2_8002,
- &pci_ss_info_10b8_0006_13a2_8006,
- NULL
-};
-#define pci_ss_list_10b8_1000 NULL
-#define pci_ss_list_10b8_1001 NULL
-#define pci_ss_list_10b8_a011 NULL
-#define pci_ss_list_10b8_b106 NULL
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b9_0111[] = {
- &pci_ss_info_10b9_0111_10b9_0111,
- NULL
-};
-#define pci_ss_list_10b9_1435 NULL
-#define pci_ss_list_10b9_1445 NULL
-#define pci_ss_list_10b9_1449 NULL
-#define pci_ss_list_10b9_1451 NULL
-#define pci_ss_list_10b9_1461 NULL
-#define pci_ss_list_10b9_1489 NULL
-#define pci_ss_list_10b9_1511 NULL
-#define pci_ss_list_10b9_1512 NULL
-#define pci_ss_list_10b9_1513 NULL
-static const pciSubsystemInfo *pci_ss_list_10b9_1521[] = {
- &pci_ss_info_10b9_1521_10b9_1521,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b9_1523[] = {
- &pci_ss_info_10b9_1523_10b9_1523,
- NULL
-};
-#define pci_ss_list_10b9_1531 NULL
-static const pciSubsystemInfo *pci_ss_list_10b9_1533[] = {
- &pci_ss_info_10b9_1533_10b9_1533,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10b9_1541[] = {
- &pci_ss_info_10b9_1541_10b9_1541,
- NULL
-};
-#define pci_ss_list_10b9_1543 NULL
-#define pci_ss_list_10b9_1563 NULL
-#define pci_ss_list_10b9_1621 NULL
-#define pci_ss_list_10b9_1631 NULL
-#define pci_ss_list_10b9_1632 NULL
-#define pci_ss_list_10b9_1641 NULL
-#define pci_ss_list_10b9_1644 NULL
-#define pci_ss_list_10b9_1646 NULL
-#define pci_ss_list_10b9_1647 NULL
-#define pci_ss_list_10b9_1651 NULL
-#define pci_ss_list_10b9_1671 NULL
-#define pci_ss_list_10b9_1681 NULL
-#define pci_ss_list_10b9_1687 NULL
-#define pci_ss_list_10b9_3141 NULL
-#define pci_ss_list_10b9_3143 NULL
-#define pci_ss_list_10b9_3145 NULL
-#define pci_ss_list_10b9_3147 NULL
-#define pci_ss_list_10b9_3149 NULL
-#define pci_ss_list_10b9_3151 NULL
-#define pci_ss_list_10b9_3307 NULL
-#define pci_ss_list_10b9_3309 NULL
-#define pci_ss_list_10b9_5212 NULL
-#define pci_ss_list_10b9_5215 NULL
-#define pci_ss_list_10b9_5217 NULL
-#define pci_ss_list_10b9_5219 NULL
-#define pci_ss_list_10b9_5225 NULL
-static const pciSubsystemInfo *pci_ss_list_10b9_5229[] = {
- &pci_ss_info_10b9_5229_1043_8053,
- NULL
-};
-#define pci_ss_list_10b9_5235 NULL
-#define pci_ss_list_10b9_5237 NULL
-#define pci_ss_list_10b9_5239 NULL
-#define pci_ss_list_10b9_5243 NULL
-#define pci_ss_list_10b9_5247 NULL
-#define pci_ss_list_10b9_5249 NULL
-#define pci_ss_list_10b9_5251 NULL
-#define pci_ss_list_10b9_5253 NULL
-#define pci_ss_list_10b9_5261 NULL
-#define pci_ss_list_10b9_5450 NULL
-static const pciSubsystemInfo *pci_ss_list_10b9_5451[] = {
- &pci_ss_info_10b9_5451_1014_0506,
- NULL
-};
-#define pci_ss_list_10b9_5453 NULL
-#define pci_ss_list_10b9_5455 NULL
-#define pci_ss_list_10b9_5457 NULL
-#define pci_ss_list_10b9_5459 NULL
-#define pci_ss_list_10b9_545a NULL
-#define pci_ss_list_10b9_5471 NULL
-#define pci_ss_list_10b9_5473 NULL
-static const pciSubsystemInfo *pci_ss_list_10b9_7101[] = {
- &pci_ss_info_10b9_7101_10b9_7101,
- NULL
-};
-#endif
-#define pci_ss_list_10ba_0301 NULL
-#define pci_ss_list_10bd_0e34 NULL
-#define pci_ss_list_10c3_1100 NULL
-#define pci_ss_list_10c8_0001 NULL
-#define pci_ss_list_10c8_0002 NULL
-#define pci_ss_list_10c8_0003 NULL
-static const pciSubsystemInfo *pci_ss_list_10c8_0004[] = {
- &pci_ss_info_10c8_0004_1014_00ba,
- &pci_ss_info_10c8_0004_1025_1007,
- &pci_ss_info_10c8_0004_1028_0074,
- &pci_ss_info_10c8_0004_1028_0075,
- &pci_ss_info_10c8_0004_1028_007d,
- &pci_ss_info_10c8_0004_1028_007e,
- &pci_ss_info_10c8_0004_1033_802f,
- &pci_ss_info_10c8_0004_104d_801b,
- &pci_ss_info_10c8_0004_104d_802f,
- &pci_ss_info_10c8_0004_104d_830b,
- &pci_ss_info_10c8_0004_10ba_0e00,
- &pci_ss_info_10c8_0004_10c8_0004,
- &pci_ss_info_10c8_0004_10cf_1029,
- &pci_ss_info_10c8_0004_10f7_8308,
- &pci_ss_info_10c8_0004_10f7_8309,
- &pci_ss_info_10c8_0004_10f7_830b,
- &pci_ss_info_10c8_0004_10f7_830d,
- &pci_ss_info_10c8_0004_10f7_8312,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10c8_0005[] = {
- &pci_ss_info_10c8_0005_1014_00dd,
- NULL
-};
-#define pci_ss_list_10c8_0006 NULL
-static const pciSubsystemInfo *pci_ss_list_10c8_0016[] = {
- &pci_ss_info_10c8_0016_10c8_0016,
- NULL
-};
-#define pci_ss_list_10c8_0025 NULL
-#define pci_ss_list_10c8_0083 NULL
-static const pciSubsystemInfo *pci_ss_list_10c8_8005[] = {
- &pci_ss_info_10c8_8005_0e11_b0d1,
- &pci_ss_info_10c8_8005_0e11_b126,
- &pci_ss_info_10c8_8005_1014_00dd,
- &pci_ss_info_10c8_8005_1025_1003,
- &pci_ss_info_10c8_8005_1028_008f,
- &pci_ss_info_10c8_8005_103c_0007,
- &pci_ss_info_10c8_8005_103c_0008,
- &pci_ss_info_10c8_8005_103c_000d,
- &pci_ss_info_10c8_8005_10c8_8005,
- &pci_ss_info_10c8_8005_110a_8005,
- &pci_ss_info_10c8_8005_14c0_0004,
- NULL
-};
-#define pci_ss_list_10c8_8006 NULL
-#define pci_ss_list_10c8_8016 NULL
-#define pci_ss_list_10cd_1100 NULL
-#define pci_ss_list_10cd_1200 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10cd_1300[] = {
- &pci_ss_info_10cd_1300_10cd_1310,
- NULL
-};
-#define pci_ss_list_10cd_2300 NULL
-#define pci_ss_list_10cd_2500 NULL
-#endif
-#define pci_ss_list_10cf_2001 NULL
-#define pci_ss_list_10d9_0512 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10d9_0531[] = {
- &pci_ss_info_10d9_0531_1186_1200,
- NULL
-};
-#define pci_ss_list_10d9_8625 NULL
-#define pci_ss_list_10d9_8888 NULL
-#endif
-#define pci_ss_list_10da_0508 NULL
-#define pci_ss_list_10da_3390 NULL
-#define pci_ss_list_10dc_0001 NULL
-#define pci_ss_list_10dc_0002 NULL
-#define pci_ss_list_10dc_0021 NULL
-#define pci_ss_list_10dc_0022 NULL
-#define pci_ss_list_10dc_10dc NULL
-#define pci_ss_list_10de_0008 NULL
-#define pci_ss_list_10de_0009 NULL
-#define pci_ss_list_10de_0010 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0020[] = {
- &pci_ss_info_10de_0020_1043_0200,
- &pci_ss_info_10de_0020_1048_0c18,
- &pci_ss_info_10de_0020_1048_0c1b,
- &pci_ss_info_10de_0020_1092_0550,
- &pci_ss_info_10de_0020_1092_0552,
- &pci_ss_info_10de_0020_1092_4804,
- &pci_ss_info_10de_0020_1092_4808,
- &pci_ss_info_10de_0020_1092_4810,
- &pci_ss_info_10de_0020_1092_4812,
- &pci_ss_info_10de_0020_1092_4815,
- &pci_ss_info_10de_0020_1092_4820,
- &pci_ss_info_10de_0020_1092_4822,
- &pci_ss_info_10de_0020_1092_4904,
- &pci_ss_info_10de_0020_1092_4914,
- &pci_ss_info_10de_0020_1092_8225,
- &pci_ss_info_10de_0020_10b4_273d,
- &pci_ss_info_10de_0020_10b4_273e,
- &pci_ss_info_10de_0020_10b4_2740,
- &pci_ss_info_10de_0020_10de_0020,
- &pci_ss_info_10de_0020_1102_1015,
- &pci_ss_info_10de_0020_1102_1016,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0028[] = {
- &pci_ss_info_10de_0028_1043_0200,
- &pci_ss_info_10de_0028_1043_0201,
- &pci_ss_info_10de_0028_1043_0205,
- &pci_ss_info_10de_0028_1043_4000,
- &pci_ss_info_10de_0028_1048_0c21,
- &pci_ss_info_10de_0028_1092_4804,
- &pci_ss_info_10de_0028_1092_4a00,
- &pci_ss_info_10de_0028_1092_4a02,
- &pci_ss_info_10de_0028_1092_5a00,
- &pci_ss_info_10de_0028_1092_6a02,
- &pci_ss_info_10de_0028_1092_7a02,
- &pci_ss_info_10de_0028_10de_0005,
- &pci_ss_info_10de_0028_10de_000f,
- &pci_ss_info_10de_0028_1102_1020,
- &pci_ss_info_10de_0028_1102_1026,
- &pci_ss_info_10de_0028_14af_5810,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0029[] = {
- &pci_ss_info_10de_0029_1043_0200,
- &pci_ss_info_10de_0029_1043_0201,
- &pci_ss_info_10de_0029_1043_0205,
- &pci_ss_info_10de_0029_1102_1021,
- &pci_ss_info_10de_0029_1102_1029,
- &pci_ss_info_10de_0029_1102_102f,
- &pci_ss_info_10de_0029_14af_5820,
- NULL
-};
-#define pci_ss_list_10de_002a NULL
-#define pci_ss_list_10de_002b NULL
-static const pciSubsystemInfo *pci_ss_list_10de_002c[] = {
- &pci_ss_info_10de_002c_1043_0200,
- &pci_ss_info_10de_002c_1043_0201,
- &pci_ss_info_10de_002c_1092_6820,
- &pci_ss_info_10de_002c_1102_1031,
- &pci_ss_info_10de_002c_1102_1034,
- &pci_ss_info_10de_002c_14af_5008,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_002d[] = {
- &pci_ss_info_10de_002d_1043_0200,
- &pci_ss_info_10de_002d_1043_0201,
- &pci_ss_info_10de_002d_1048_0c3a,
- &pci_ss_info_10de_002d_10de_001e,
- &pci_ss_info_10de_002d_1102_1023,
- &pci_ss_info_10de_002d_1102_1024,
- &pci_ss_info_10de_002d_1102_102c,
- &pci_ss_info_10de_002d_1462_8808,
- &pci_ss_info_10de_002d_1554_1041,
- NULL
-};
-#define pci_ss_list_10de_002e NULL
-#define pci_ss_list_10de_002f NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0060[] = {
- &pci_ss_info_10de_0060_1043_80ad,
- NULL
-};
-#define pci_ss_list_10de_0064 NULL
-#define pci_ss_list_10de_0065 NULL
-#define pci_ss_list_10de_0066 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0067[] = {
- &pci_ss_info_10de_0067_1043_0c11,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0068[] = {
- &pci_ss_info_10de_0068_1043_0c11,
- NULL
-};
-#define pci_ss_list_10de_006a NULL
-#define pci_ss_list_10de_006b NULL
-#define pci_ss_list_10de_006e NULL
-static const pciSubsystemInfo *pci_ss_list_10de_00a0[] = {
- &pci_ss_info_10de_00a0_14af_5810,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0100[] = {
- &pci_ss_info_10de_0100_1043_0200,
- &pci_ss_info_10de_0100_1043_0201,
- &pci_ss_info_10de_0100_1043_4008,
- &pci_ss_info_10de_0100_1043_4009,
- &pci_ss_info_10de_0100_1102_102d,
- &pci_ss_info_10de_0100_14af_5022,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0101[] = {
- &pci_ss_info_10de_0101_1043_0202,
- &pci_ss_info_10de_0101_1043_400a,
- &pci_ss_info_10de_0101_1043_400b,
- &pci_ss_info_10de_0101_1102_102e,
- &pci_ss_info_10de_0101_14af_5021,
- NULL
-};
-#define pci_ss_list_10de_0103 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0110[] = {
- &pci_ss_info_10de_0110_1043_4015,
- &pci_ss_info_10de_0110_1043_4031,
- &pci_ss_info_10de_0110_1462_8817,
- &pci_ss_info_10de_0110_14af_7102,
- &pci_ss_info_10de_0110_14af_7103,
- NULL
-};
-#define pci_ss_list_10de_0111 NULL
-#define pci_ss_list_10de_0112 NULL
-#define pci_ss_list_10de_0113 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0150[] = {
- &pci_ss_info_10de_0150_1043_4016,
- &pci_ss_info_10de_0150_107d_2840,
- &pci_ss_info_10de_0150_1462_8831,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0151[] = {
- &pci_ss_info_10de_0151_1043_405f,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10de_0152[] = {
- &pci_ss_info_10de_0152_1048_0c56,
- NULL
-};
-#define pci_ss_list_10de_0153 NULL
-#define pci_ss_list_10de_0170 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0171[] = {
- &pci_ss_info_10de_0171_10b0_0002,
- &pci_ss_info_10de_0171_1462_8661,
- &pci_ss_info_10de_0171_1462_8730,
- &pci_ss_info_10de_0171_147b_8f00,
- NULL
-};
-#define pci_ss_list_10de_0172 NULL
-#define pci_ss_list_10de_0173 NULL
-#define pci_ss_list_10de_0174 NULL
-#define pci_ss_list_10de_0175 NULL
-#define pci_ss_list_10de_0176 NULL
-#define pci_ss_list_10de_0178 NULL
-#define pci_ss_list_10de_0179 NULL
-#define pci_ss_list_10de_017a NULL
-#define pci_ss_list_10de_017b NULL
-#define pci_ss_list_10de_017c NULL
-#define pci_ss_list_10de_0181 NULL
-#define pci_ss_list_10de_0182 NULL
-#define pci_ss_list_10de_0183 NULL
-#define pci_ss_list_10de_0188 NULL
-#define pci_ss_list_10de_018a NULL
-#define pci_ss_list_10de_018b NULL
-#define pci_ss_list_10de_01a0 NULL
-#define pci_ss_list_10de_01a4 NULL
-#define pci_ss_list_10de_01ab NULL
-#define pci_ss_list_10de_01ac NULL
-#define pci_ss_list_10de_01ad NULL
-#define pci_ss_list_10de_01b1 NULL
-#define pci_ss_list_10de_01b2 NULL
-#define pci_ss_list_10de_01b4 NULL
-#define pci_ss_list_10de_01b7 NULL
-#define pci_ss_list_10de_01b8 NULL
-#define pci_ss_list_10de_01bc NULL
-#define pci_ss_list_10de_01c1 NULL
-#define pci_ss_list_10de_01c2 NULL
-#define pci_ss_list_10de_01c3 NULL
-#define pci_ss_list_10de_01e8 NULL
-#define pci_ss_list_10de_01f0 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0200[] = {
- &pci_ss_info_10de_0200_1043_402f,
- NULL
-};
-#define pci_ss_list_10de_0201 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0202[] = {
- &pci_ss_info_10de_0202_1043_405b,
- &pci_ss_info_10de_0202_1545_002f,
- NULL
-};
-#define pci_ss_list_10de_0203 NULL
-#define pci_ss_list_10de_0250 NULL
-#define pci_ss_list_10de_0251 NULL
-#define pci_ss_list_10de_0252 NULL
-static const pciSubsystemInfo *pci_ss_list_10de_0253[] = {
- &pci_ss_info_10de_0253_107d_2896,
- &pci_ss_info_10de_0253_147b_8f09,
- NULL
-};
-#define pci_ss_list_10de_0258 NULL
-#define pci_ss_list_10de_0259 NULL
-#define pci_ss_list_10de_025b NULL
-#define pci_ss_list_10de_0280 NULL
-#define pci_ss_list_10de_0281 NULL
-#define pci_ss_list_10de_0282 NULL
-#define pci_ss_list_10de_0288 NULL
-#define pci_ss_list_10de_0289 NULL
-#define pci_ss_list_10de_0300 NULL
-#define pci_ss_list_10de_0301 NULL
-#define pci_ss_list_10de_0302 NULL
-#define pci_ss_list_10de_0308 NULL
-#define pci_ss_list_10de_0309 NULL
-#define pci_ss_list_10df_1ae5 NULL
-#define pci_ss_list_10df_f085 NULL
-#define pci_ss_list_10df_f095 NULL
-#define pci_ss_list_10df_f098 NULL
-#define pci_ss_list_10df_f700 NULL
-#define pci_ss_list_10df_f800 NULL
-#define pci_ss_list_10df_f900 NULL
-#define pci_ss_list_10df_f980 NULL
-#define pci_ss_list_10e0_5026 NULL
-#define pci_ss_list_10e0_5027 NULL
-#define pci_ss_list_10e0_5028 NULL
-#define pci_ss_list_10e0_8849 NULL
-#define pci_ss_list_10e0_8853 NULL
-#define pci_ss_list_10e0_9128 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10e1_0391[] = {
- &pci_ss_info_10e1_0391_10e1_0391,
- NULL
-};
-#define pci_ss_list_10e1_690c NULL
-#define pci_ss_list_10e1_dc29 NULL
-#endif
-#define pci_ss_list_10e3_0000 NULL
-#define pci_ss_list_10e3_0860 NULL
-#define pci_ss_list_10e3_0862 NULL
-#define pci_ss_list_10e8_2011 NULL
-#define pci_ss_list_10e8_4750 NULL
-#define pci_ss_list_10e8_5920 NULL
-#define pci_ss_list_10e8_8043 NULL
-#define pci_ss_list_10e8_8062 NULL
-#define pci_ss_list_10e8_807d NULL
-#define pci_ss_list_10e8_8088 NULL
-#define pci_ss_list_10e8_8089 NULL
-#define pci_ss_list_10e8_809c NULL
-#define pci_ss_list_10e8_80d7 NULL
-#define pci_ss_list_10e8_80d9 NULL
-#define pci_ss_list_10e8_80da NULL
-#define pci_ss_list_10e8_811a NULL
-#define pci_ss_list_10e8_8170 NULL
-#define pci_ss_list_10e8_82db NULL
-#define pci_ss_list_10ea_1680 NULL
-#define pci_ss_list_10ea_1682 NULL
-#define pci_ss_list_10ea_1683 NULL
-#define pci_ss_list_10ea_2000 NULL
-#define pci_ss_list_10ea_2010 NULL
-#define pci_ss_list_10ea_5000 NULL
-#define pci_ss_list_10ea_5050 NULL
-#define pci_ss_list_10ea_5202 NULL
-#define pci_ss_list_10eb_0101 NULL
-#define pci_ss_list_10eb_8111 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10ec_8029[] = {
- &pci_ss_info_10ec_8029_10b8_2011,
- &pci_ss_info_10ec_8029_10ec_8029,
- &pci_ss_info_10ec_8029_1113_1208,
- &pci_ss_info_10ec_8029_1186_0300,
- &pci_ss_info_10ec_8029_1259_2400,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10ec_8129[] = {
- &pci_ss_info_10ec_8129_10ec_8129,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10ec_8138[] = {
- &pci_ss_info_10ec_8138_10ec_8138,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10ec_8139[] = {
- &pci_ss_info_10ec_8139_1025_8920,
- &pci_ss_info_10ec_8139_1025_8921,
- &pci_ss_info_10ec_8139_10bd_0320,
- &pci_ss_info_10ec_8139_10ec_8139,
- &pci_ss_info_10ec_8139_1186_1300,
- &pci_ss_info_10ec_8139_1186_1320,
- &pci_ss_info_10ec_8139_1186_8139,
- &pci_ss_info_10ec_8139_11f6_8139,
- &pci_ss_info_10ec_8139_1259_2500,
- &pci_ss_info_10ec_8139_1259_2503,
- &pci_ss_info_10ec_8139_1429_d010,
- &pci_ss_info_10ec_8139_1432_9130,
- &pci_ss_info_10ec_8139_1436_8139,
- &pci_ss_info_10ec_8139_146c_1439,
- &pci_ss_info_10ec_8139_1489_6001,
- &pci_ss_info_10ec_8139_1489_6002,
- &pci_ss_info_10ec_8139_149c_139a,
- &pci_ss_info_10ec_8139_149c_8139,
- &pci_ss_info_10ec_8139_2646_0001,
- &pci_ss_info_10ec_8139_8e2e_7000,
- &pci_ss_info_10ec_8139_8e2e_7100,
- &pci_ss_info_10ec_8139_a0a0_0007,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_10ec_8169[] = {
- &pci_ss_info_10ec_8169_1371_434e,
- NULL
-};
-#define pci_ss_list_10ec_8197 NULL
-#endif
-#define pci_ss_list_10ed_7310 NULL
-#define pci_ss_list_10ee_3fc0 NULL
-#define pci_ss_list_10ee_3fc1 NULL
-#define pci_ss_list_10ee_3fc2 NULL
-#define pci_ss_list_10ee_3fc3 NULL
-#define pci_ss_list_10ee_3fc4 NULL
-#define pci_ss_list_10ee_3fc5 NULL
-#define pci_ss_list_10ef_8154 NULL
-#define pci_ss_list_10f5_a001 NULL
-#define pci_ss_list_10fa_000c NULL
-#define pci_ss_list_10fb_186f NULL
-#define pci_ss_list_10fc_0003 NULL
-#define pci_ss_list_10fc_0005 NULL
-#define pci_ss_list_1101_1060 NULL
-#define pci_ss_list_1101_9100 NULL
-#define pci_ss_list_1101_9400 NULL
-#define pci_ss_list_1101_9401 NULL
-#define pci_ss_list_1101_9500 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1102_0002[] = {
- &pci_ss_info_1102_0002_1102_0020,
- &pci_ss_info_1102_0002_1102_0021,
- &pci_ss_info_1102_0002_1102_002f,
- &pci_ss_info_1102_0002_1102_4001,
- &pci_ss_info_1102_0002_1102_8022,
- &pci_ss_info_1102_0002_1102_8023,
- &pci_ss_info_1102_0002_1102_8024,
- &pci_ss_info_1102_0002_1102_8025,
- &pci_ss_info_1102_0002_1102_8026,
- &pci_ss_info_1102_0002_1102_8027,
- &pci_ss_info_1102_0002_1102_8028,
- &pci_ss_info_1102_0002_1102_8031,
- &pci_ss_info_1102_0002_1102_8040,
- &pci_ss_info_1102_0002_1102_8051,
- &pci_ss_info_1102_0002_1102_8061,
- &pci_ss_info_1102_0002_1102_8064,
- &pci_ss_info_1102_0002_1102_8065,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1102_0004[] = {
- &pci_ss_info_1102_0004_1102_0051,
- &pci_ss_info_1102_0004_1102_0053,
- NULL
-};
-#define pci_ss_list_1102_0006 NULL
-static const pciSubsystemInfo *pci_ss_list_1102_4001[] = {
- &pci_ss_info_1102_4001_1102_0010,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1102_7002[] = {
- &pci_ss_info_1102_7002_1102_0020,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1102_7003[] = {
- &pci_ss_info_1102_7003_1102_0040,
- NULL
-};
-#define pci_ss_list_1102_7004 NULL
-#define pci_ss_list_1102_8064 NULL
-#define pci_ss_list_1102_8938 NULL
-#endif
-#define pci_ss_list_1103_0003 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1103_0004[] = {
- &pci_ss_info_1103_0004_1103_0001,
- &pci_ss_info_1103_0004_1103_0005,
- NULL
-};
-#define pci_ss_list_1103_0005 NULL
-#define pci_ss_list_1103_0006 NULL
-#define pci_ss_list_1103_0007 NULL
-#define pci_ss_list_1103_0008 NULL
-#define pci_ss_list_1103_0009 NULL
-#endif
-#define pci_ss_list_1105_1105 NULL
-#define pci_ss_list_1105_8300 NULL
-#define pci_ss_list_1105_8400 NULL
-#define pci_ss_list_1106_0102 NULL
-#define pci_ss_list_1106_0130 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1106_0305[] = {
- &pci_ss_info_1106_0305_1043_8033,
- &pci_ss_info_1106_0305_1043_803e,
- &pci_ss_info_1106_0305_1043_8042,
- &pci_ss_info_1106_0305_147b_a401,
- NULL
-};
-#define pci_ss_list_1106_0391 NULL
-#define pci_ss_list_1106_0501 NULL
-#define pci_ss_list_1106_0505 NULL
-#define pci_ss_list_1106_0561 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_0571[] = {
- &pci_ss_info_1106_0571_1019_0985,
- &pci_ss_info_1106_0571_1043_8052,
- &pci_ss_info_1106_0571_1043_808c,
- &pci_ss_info_1106_0571_1106_0571,
- &pci_ss_info_1106_0571_1179_0001,
- &pci_ss_info_1106_0571_1458_5002,
- NULL
-};
-#define pci_ss_list_1106_0576 NULL
-#define pci_ss_list_1106_0585 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_0586[] = {
- &pci_ss_info_1106_0586_1106_0000,
- NULL
-};
-#define pci_ss_list_1106_0595 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_0596[] = {
- &pci_ss_info_1106_0596_1106_0000,
- &pci_ss_info_1106_0596_1458_0596,
- NULL
-};
-#define pci_ss_list_1106_0597 NULL
-#define pci_ss_list_1106_0598 NULL
-#define pci_ss_list_1106_0601 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_0605[] = {
- &pci_ss_info_1106_0605_1043_802c,
- NULL
-};
-#define pci_ss_list_1106_0680 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_0686[] = {
- &pci_ss_info_1106_0686_1019_0985,
- &pci_ss_info_1106_0686_1043_802c,
- &pci_ss_info_1106_0686_1043_8033,
- &pci_ss_info_1106_0686_1043_803e,
- &pci_ss_info_1106_0686_1043_8040,
- &pci_ss_info_1106_0686_1043_8042,
- &pci_ss_info_1106_0686_1106_0000,
- &pci_ss_info_1106_0686_1106_0686,
- &pci_ss_info_1106_0686_1179_0001,
- &pci_ss_info_1106_0686_147b_a702,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1106_0691[] = {
- &pci_ss_info_1106_0691_1019_0985,
- &pci_ss_info_1106_0691_1179_0001,
- &pci_ss_info_1106_0691_1458_0691,
- NULL
-};
-#define pci_ss_list_1106_0693 NULL
-#define pci_ss_list_1106_0698 NULL
-#define pci_ss_list_1106_0926 NULL
-#define pci_ss_list_1106_1000 NULL
-#define pci_ss_list_1106_1106 NULL
-#define pci_ss_list_1106_1571 NULL
-#define pci_ss_list_1106_1595 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3038[] = {
- &pci_ss_info_1106_3038_0925_1234,
- &pci_ss_info_1106_3038_1019_0985,
- &pci_ss_info_1106_3038_1043_808c,
- &pci_ss_info_1106_3038_1179_0001,
- NULL
-};
-#define pci_ss_list_1106_3040 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3043[] = {
- &pci_ss_info_1106_3043_10bd_0000,
- &pci_ss_info_1106_3043_1106_0100,
- &pci_ss_info_1106_3043_1186_1400,
- NULL
-};
-#define pci_ss_list_1106_3044 NULL
-#define pci_ss_list_1106_3050 NULL
-#define pci_ss_list_1106_3051 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3057[] = {
- &pci_ss_info_1106_3057_1019_0985,
- &pci_ss_info_1106_3057_1043_8033,
- &pci_ss_info_1106_3057_1043_803e,
- &pci_ss_info_1106_3057_1043_8040,
- &pci_ss_info_1106_3057_1043_8042,
- &pci_ss_info_1106_3057_1179_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1106_3058[] = {
- &pci_ss_info_1106_3058_0e11_b194,
- &pci_ss_info_1106_3058_1019_0985,
- &pci_ss_info_1106_3058_1106_4511,
- &pci_ss_info_1106_3058_1458_7600,
- &pci_ss_info_1106_3058_1462_3091,
- &pci_ss_info_1106_3058_15dd_7609,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1106_3059[] = {
- &pci_ss_info_1106_3059_1043_8095,
- &pci_ss_info_1106_3059_1458_a002,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1106_3065[] = {
- &pci_ss_info_1106_3065_1106_0102,
- &pci_ss_info_1106_3065_1186_1400,
- &pci_ss_info_1106_3065_1186_1401,
- &pci_ss_info_1106_3065_13b9_1421,
- NULL
-};
-#define pci_ss_list_1106_3068 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3074[] = {
- &pci_ss_info_1106_3074_1043_8052,
- NULL
-};
-#define pci_ss_list_1106_3091 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3099[] = {
- &pci_ss_info_1106_3099_1043_8064,
- &pci_ss_info_1106_3099_1043_807f,
- NULL
-};
-#define pci_ss_list_1106_3101 NULL
-#define pci_ss_list_1106_3102 NULL
-#define pci_ss_list_1106_3103 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3104[] = {
- &pci_ss_info_1106_3104_1043_808c,
- &pci_ss_info_1106_3104_1458_5004,
- NULL
-};
-#define pci_ss_list_1106_3106 NULL
-#define pci_ss_list_1106_3109 NULL
-#define pci_ss_list_1106_3112 NULL
-#define pci_ss_list_1106_3116 NULL
-#define pci_ss_list_1106_3122 NULL
-#define pci_ss_list_1106_3123 NULL
-#define pci_ss_list_1106_3128 NULL
-#define pci_ss_list_1106_3133 NULL
-#define pci_ss_list_1106_3147 NULL
-#define pci_ss_list_1106_3148 NULL
-#define pci_ss_list_1106_3156 NULL
-#define pci_ss_list_1106_3168 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_3177[] = {
- &pci_ss_info_1106_3177_1043_808c,
- &pci_ss_info_1106_3177_1458_5001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
- &pci_ss_info_1106_3189_1043_807f,
- &pci_ss_info_1106_3189_1458_5000,
- NULL
-};
-#define pci_ss_list_1106_5030 NULL
-#define pci_ss_list_1106_6100 NULL
-#define pci_ss_list_1106_8231 NULL
-#define pci_ss_list_1106_8235 NULL
-#define pci_ss_list_1106_8305 NULL
-#define pci_ss_list_1106_8391 NULL
-#define pci_ss_list_1106_8501 NULL
-#define pci_ss_list_1106_8596 NULL
-#define pci_ss_list_1106_8597 NULL
-static const pciSubsystemInfo *pci_ss_list_1106_8598[] = {
- &pci_ss_info_1106_8598_1019_0985,
- NULL
-};
-#define pci_ss_list_1106_8601 NULL
-#define pci_ss_list_1106_8605 NULL
-#define pci_ss_list_1106_8691 NULL
-#define pci_ss_list_1106_8693 NULL
-#define pci_ss_list_1106_b091 NULL
-#define pci_ss_list_1106_b099 NULL
-#define pci_ss_list_1106_b101 NULL
-#define pci_ss_list_1106_b102 NULL
-#define pci_ss_list_1106_b103 NULL
-#define pci_ss_list_1106_b112 NULL
-#define pci_ss_list_1106_b168 NULL
-#endif
-#define pci_ss_list_1107_0576 NULL
-#define pci_ss_list_1108_0100 NULL
-#define pci_ss_list_1108_0101 NULL
-#define pci_ss_list_1108_0105 NULL
-#define pci_ss_list_1108_0108 NULL
-#define pci_ss_list_1108_0138 NULL
-#define pci_ss_list_1108_0139 NULL
-#define pci_ss_list_1108_013c NULL
-#define pci_ss_list_1108_013d NULL
-#define pci_ss_list_1109_1400 NULL
-#define pci_ss_list_110a_0002 NULL
-#define pci_ss_list_110a_0005 NULL
-#define pci_ss_list_110a_0006 NULL
-#define pci_ss_list_110a_0015 NULL
-#define pci_ss_list_110a_001d NULL
-#define pci_ss_list_110a_007b NULL
-#define pci_ss_list_110a_007c NULL
-#define pci_ss_list_110a_007d NULL
-#define pci_ss_list_110a_2102 NULL
-#define pci_ss_list_110a_4942 NULL
-#define pci_ss_list_110a_6120 NULL
-#define pci_ss_list_110b_0001 NULL
-#define pci_ss_list_110b_0004 NULL
-#define pci_ss_list_1110_6037 NULL
-#define pci_ss_list_1110_6073 NULL
-#define pci_ss_list_1112_2200 NULL
-#define pci_ss_list_1112_2300 NULL
-#define pci_ss_list_1112_2340 NULL
-#define pci_ss_list_1112_2400 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1113_1211[] = {
- &pci_ss_info_1113_1211_103c_1207,
- &pci_ss_info_1113_1211_1113_1211,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1113_1216[] = {
- &pci_ss_info_1113_1216_111a_1020,
- NULL
-};
-#define pci_ss_list_1113_1217 NULL
-#define pci_ss_list_1113_5105 NULL
-static const pciSubsystemInfo *pci_ss_list_1113_9211[] = {
- &pci_ss_info_1113_9211_1113_9211,
- NULL
-};
-#define pci_ss_list_1113_9511 NULL
-#endif
-#define pci_ss_list_1116_0022 NULL
-#define pci_ss_list_1116_0023 NULL
-#define pci_ss_list_1116_0024 NULL
-#define pci_ss_list_1116_0025 NULL
-#define pci_ss_list_1116_0026 NULL
-#define pci_ss_list_1116_0027 NULL
-#define pci_ss_list_1116_0028 NULL
-#define pci_ss_list_1117_9500 NULL
-#define pci_ss_list_1117_9501 NULL
-#define pci_ss_list_1119_0000 NULL
-#define pci_ss_list_1119_0001 NULL
-#define pci_ss_list_1119_0002 NULL
-#define pci_ss_list_1119_0003 NULL
-#define pci_ss_list_1119_0004 NULL
-#define pci_ss_list_1119_0005 NULL
-#define pci_ss_list_1119_0006 NULL
-#define pci_ss_list_1119_0007 NULL
-#define pci_ss_list_1119_0008 NULL
-#define pci_ss_list_1119_0009 NULL
-#define pci_ss_list_1119_000a NULL
-#define pci_ss_list_1119_000b NULL
-#define pci_ss_list_1119_000c NULL
-#define pci_ss_list_1119_000d NULL
-#define pci_ss_list_1119_0100 NULL
-#define pci_ss_list_1119_0101 NULL
-#define pci_ss_list_1119_0102 NULL
-#define pci_ss_list_1119_0103 NULL
-#define pci_ss_list_1119_0104 NULL
-#define pci_ss_list_1119_0105 NULL
-#define pci_ss_list_1119_0110 NULL
-#define pci_ss_list_1119_0111 NULL
-#define pci_ss_list_1119_0112 NULL
-#define pci_ss_list_1119_0113 NULL
-#define pci_ss_list_1119_0114 NULL
-#define pci_ss_list_1119_0115 NULL
-#define pci_ss_list_1119_0118 NULL
-#define pci_ss_list_1119_0119 NULL
-#define pci_ss_list_1119_011a NULL
-#define pci_ss_list_1119_011b NULL
-#define pci_ss_list_1119_0120 NULL
-#define pci_ss_list_1119_0121 NULL
-#define pci_ss_list_1119_0122 NULL
-#define pci_ss_list_1119_0123 NULL
-#define pci_ss_list_1119_0124 NULL
-#define pci_ss_list_1119_0125 NULL
-#define pci_ss_list_1119_0136 NULL
-#define pci_ss_list_1119_0137 NULL
-#define pci_ss_list_1119_0138 NULL
-#define pci_ss_list_1119_0139 NULL
-#define pci_ss_list_1119_013a NULL
-#define pci_ss_list_1119_013b NULL
-#define pci_ss_list_1119_013c NULL
-#define pci_ss_list_1119_013d NULL
-#define pci_ss_list_1119_013e NULL
-#define pci_ss_list_1119_013f NULL
-#define pci_ss_list_1119_0166 NULL
-#define pci_ss_list_1119_0167 NULL
-#define pci_ss_list_1119_0168 NULL
-#define pci_ss_list_1119_0169 NULL
-#define pci_ss_list_1119_016a NULL
-#define pci_ss_list_1119_016b NULL
-#define pci_ss_list_1119_016c NULL
-#define pci_ss_list_1119_016d NULL
-#define pci_ss_list_1119_016e NULL
-#define pci_ss_list_1119_016f NULL
-#define pci_ss_list_1119_01d6 NULL
-#define pci_ss_list_1119_01d7 NULL
-#define pci_ss_list_1119_01f6 NULL
-#define pci_ss_list_1119_01f7 NULL
-#define pci_ss_list_1119_01fc NULL
-#define pci_ss_list_1119_01fd NULL
-#define pci_ss_list_1119_01fe NULL
-#define pci_ss_list_1119_01ff NULL
-#define pci_ss_list_1119_0210 NULL
-#define pci_ss_list_1119_0211 NULL
-#define pci_ss_list_1119_0260 NULL
-#define pci_ss_list_1119_0261 NULL
-#define pci_ss_list_1119_0300 NULL
-#define pci_ss_list_111a_0000 NULL
-#define pci_ss_list_111a_0002 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_111a_0003[] = {
- &pci_ss_info_111a_0003_111a_0000,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_111a_0005[] = {
- &pci_ss_info_111a_0005_111a_0001,
- &pci_ss_info_111a_0005_111a_0009,
- &pci_ss_info_111a_0005_111a_0101,
- &pci_ss_info_111a_0005_111a_0109,
- &pci_ss_info_111a_0005_111a_0809,
- &pci_ss_info_111a_0005_111a_0909,
- &pci_ss_info_111a_0005_111a_0a09,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_111a_0007[] = {
- &pci_ss_info_111a_0007_111a_1001,
- NULL
-};
-#endif
-#define pci_ss_list_111c_0001 NULL
-#define pci_ss_list_111d_0001 NULL
-#define pci_ss_list_111d_0003 NULL
-#define pci_ss_list_111f_4a47 NULL
-#define pci_ss_list_111f_5243 NULL
-#define pci_ss_list_1127_0200 NULL
-#define pci_ss_list_1127_0210 NULL
-#define pci_ss_list_1127_0250 NULL
-#define pci_ss_list_1127_0300 NULL
-#define pci_ss_list_1127_0310 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1127_0400[] = {
- &pci_ss_info_1127_0400_1127_0400,
- NULL
-};
-#endif
-#define pci_ss_list_112f_0000 NULL
-#define pci_ss_list_112f_0001 NULL
-#define pci_ss_list_1131_1561 NULL
-#define pci_ss_list_1131_1562 NULL
-#define pci_ss_list_1131_3400 NULL
-#define pci_ss_list_1131_7130 NULL
-#define pci_ss_list_1131_7133 NULL
-#define pci_ss_list_1131_7134 NULL
-#define pci_ss_list_1131_7135 NULL
-#define pci_ss_list_1131_7145 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1131_7146[] = {
- &pci_ss_info_1131_7146_114b_2003,
- &pci_ss_info_1131_7146_11bd_0006,
- &pci_ss_info_1131_7146_11bd_000a,
- NULL
-};
-#endif
-#define pci_ss_list_1133_7901 NULL
-#define pci_ss_list_1133_7902 NULL
-#define pci_ss_list_1133_7911 NULL
-#define pci_ss_list_1133_7912 NULL
-#define pci_ss_list_1133_7941 NULL
-#define pci_ss_list_1133_7942 NULL
-#define pci_ss_list_1133_7943 NULL
-#define pci_ss_list_1133_7944 NULL
-#define pci_ss_list_1133_b921 NULL
-#define pci_ss_list_1133_b922 NULL
-#define pci_ss_list_1133_b923 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1133_e001[] = {
- &pci_ss_info_1133_e001_1133_e001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e002[] = {
- &pci_ss_info_1133_e002_1133_e002,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e003[] = {
- &pci_ss_info_1133_e003_1133_e003,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e004[] = {
- &pci_ss_info_1133_e004_1133_e004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e005[] = {
- &pci_ss_info_1133_e005_1133_e005,
- NULL
-};
-#define pci_ss_list_1133_e00b NULL
-static const pciSubsystemInfo *pci_ss_list_1133_e010[] = {
- &pci_ss_info_1133_e010_1133_e010,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e012[] = {
- &pci_ss_info_1133_e012_1133_e012,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1133_e014[] = {
- &pci_ss_info_1133_e014_1133_e014,
- NULL
-};
-#define pci_ss_list_1133_e018 NULL
-#endif
-#define pci_ss_list_1134_0001 NULL
-#define pci_ss_list_1135_0001 NULL
-#define pci_ss_list_1138_8905 NULL
-#define pci_ss_list_1139_0001 NULL
-#define pci_ss_list_113c_0000 NULL
-#define pci_ss_list_113c_0001 NULL
-#define pci_ss_list_113c_0911 NULL
-#define pci_ss_list_113c_0912 NULL
-#define pci_ss_list_113c_0913 NULL
-#define pci_ss_list_113c_0914 NULL
-#define pci_ss_list_113f_0808 NULL
-#define pci_ss_list_113f_1010 NULL
-#define pci_ss_list_113f_80c0 NULL
-#define pci_ss_list_113f_80c4 NULL
-#define pci_ss_list_113f_80c8 NULL
-#define pci_ss_list_113f_8888 NULL
-#define pci_ss_list_113f_9090 NULL
-#define pci_ss_list_1142_3210 NULL
-#define pci_ss_list_1142_6422 NULL
-#define pci_ss_list_1142_6424 NULL
-#define pci_ss_list_1142_6425 NULL
-#define pci_ss_list_1142_643d NULL
-#define pci_ss_list_1144_0001 NULL
-#define pci_ss_list_1145_8007 NULL
-#define pci_ss_list_1145_f007 NULL
-#define pci_ss_list_1145_f010 NULL
-#define pci_ss_list_1145_f012 NULL
-#define pci_ss_list_1145_f013 NULL
-#define pci_ss_list_1145_f015 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1148_4000[] = {
- &pci_ss_info_1148_4000_0e11_b03b,
- &pci_ss_info_1148_4000_0e11_b03c,
- &pci_ss_info_1148_4000_0e11_b03d,
- &pci_ss_info_1148_4000_0e11_b03e,
- &pci_ss_info_1148_4000_0e11_b03f,
- &pci_ss_info_1148_4000_1148_5521,
- &pci_ss_info_1148_4000_1148_5522,
- &pci_ss_info_1148_4000_1148_5541,
- &pci_ss_info_1148_4000_1148_5543,
- &pci_ss_info_1148_4000_1148_5544,
- &pci_ss_info_1148_4000_1148_5821,
- &pci_ss_info_1148_4000_1148_5822,
- &pci_ss_info_1148_4000_1148_5841,
- &pci_ss_info_1148_4000_1148_5843,
- &pci_ss_info_1148_4000_1148_5844,
- NULL
-};
-#define pci_ss_list_1148_4200 NULL
-static const pciSubsystemInfo *pci_ss_list_1148_4300[] = {
- &pci_ss_info_1148_4300_1148_9821,
- &pci_ss_info_1148_4300_1148_9822,
- &pci_ss_info_1148_4300_1148_9841,
- &pci_ss_info_1148_4300_1148_9842,
- &pci_ss_info_1148_4300_1148_9843,
- &pci_ss_info_1148_4300_1148_9844,
- &pci_ss_info_1148_4300_1148_9861,
- &pci_ss_info_1148_4300_1148_9862,
- &pci_ss_info_1148_4300_1148_9871,
- &pci_ss_info_1148_4300_1148_9872,
- &pci_ss_info_1148_4300_1259_2970,
- &pci_ss_info_1148_4300_1259_2972,
- &pci_ss_info_1148_4300_1259_2975,
- &pci_ss_info_1148_4300_1259_2977,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1148_4320[] = {
- &pci_ss_info_1148_4320_1148_5021,
- &pci_ss_info_1148_4320_1148_5041,
- &pci_ss_info_1148_4320_1148_5043,
- &pci_ss_info_1148_4320_1148_5051,
- &pci_ss_info_1148_4320_1148_5061,
- &pci_ss_info_1148_4320_1148_5071,
- &pci_ss_info_1148_4320_1148_9521,
- NULL
-};
-#define pci_ss_list_1148_4400 NULL
-#endif
-#define pci_ss_list_114a_5579 NULL
-#define pci_ss_list_114a_5587 NULL
-#define pci_ss_list_114a_6504 NULL
-#define pci_ss_list_114a_7587 NULL
-#define pci_ss_list_114f_0002 NULL
-#define pci_ss_list_114f_0003 NULL
-#define pci_ss_list_114f_0004 NULL
-#define pci_ss_list_114f_0005 NULL
-#define pci_ss_list_114f_0006 NULL
-#define pci_ss_list_114f_0009 NULL
-#define pci_ss_list_114f_000a NULL
-#define pci_ss_list_114f_000c NULL
-#define pci_ss_list_114f_000d NULL
-#define pci_ss_list_114f_0011 NULL
-#define pci_ss_list_114f_0012 NULL
-#define pci_ss_list_114f_0013 NULL
-#define pci_ss_list_114f_0014 NULL
-#define pci_ss_list_114f_0015 NULL
-#define pci_ss_list_114f_0016 NULL
-#define pci_ss_list_114f_0017 NULL
-#define pci_ss_list_114f_001a NULL
-#define pci_ss_list_114f_001b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_114f_001d[] = {
- &pci_ss_info_114f_001d_114f_0050,
- &pci_ss_info_114f_001d_114f_0051,
- &pci_ss_info_114f_001d_114f_0052,
- &pci_ss_info_114f_001d_114f_0053,
- NULL
-};
-#define pci_ss_list_114f_0023 NULL
-static const pciSubsystemInfo *pci_ss_list_114f_0024[] = {
- &pci_ss_info_114f_0024_114f_0030,
- &pci_ss_info_114f_0024_114f_0031,
- NULL
-};
-#define pci_ss_list_114f_0026 NULL
-#define pci_ss_list_114f_0027 NULL
-#define pci_ss_list_114f_0034 NULL
-#define pci_ss_list_114f_0035 NULL
-#define pci_ss_list_114f_0040 NULL
-#define pci_ss_list_114f_0042 NULL
-#define pci_ss_list_114f_0070 NULL
-#define pci_ss_list_114f_0071 NULL
-#define pci_ss_list_114f_0072 NULL
-#define pci_ss_list_114f_0073 NULL
-#define pci_ss_list_114f_6001 NULL
-#endif
-#define pci_ss_list_1158_3011 NULL
-#define pci_ss_list_1158_9050 NULL
-#define pci_ss_list_1158_9051 NULL
-#define pci_ss_list_1159_0001 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_115d_0003[] = {
- &pci_ss_info_115d_0003_1014_0181,
- &pci_ss_info_115d_0003_1014_1181,
- &pci_ss_info_115d_0003_1014_8181,
- &pci_ss_info_115d_0003_1014_9181,
- &pci_ss_info_115d_0003_115d_0181,
- &pci_ss_info_115d_0003_115d_1181,
- &pci_ss_info_115d_0003_1179_0181,
- &pci_ss_info_115d_0003_8086_8181,
- &pci_ss_info_115d_0003_8086_9181,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_115d_0005[] = {
- &pci_ss_info_115d_0005_1014_0182,
- &pci_ss_info_115d_0005_1014_1182,
- &pci_ss_info_115d_0005_115d_0182,
- &pci_ss_info_115d_0005_115d_1182,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_115d_0007[] = {
- &pci_ss_info_115d_0007_1014_0182,
- &pci_ss_info_115d_0007_1014_1182,
- &pci_ss_info_115d_0007_115d_0182,
- &pci_ss_info_115d_0007_115d_1182,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_115d_000b[] = {
- &pci_ss_info_115d_000b_1014_0183,
- &pci_ss_info_115d_000b_115d_0183,
- NULL
-};
-#define pci_ss_list_115d_000c NULL
-static const pciSubsystemInfo *pci_ss_list_115d_000f[] = {
- &pci_ss_info_115d_000f_1014_0183,
- &pci_ss_info_115d_000f_115d_0183,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_115d_0101[] = {
- &pci_ss_info_115d_0101_115d_1081,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_115d_0103[] = {
- &pci_ss_info_115d_0103_1014_9181,
- &pci_ss_info_115d_0103_1115_1181,
- &pci_ss_info_115d_0103_115d_1181,
- &pci_ss_info_115d_0103_8086_9181,
- NULL
-};
-#endif
-#define pci_ss_list_1163_0001 NULL
-static const pciSubsystemInfo *pci_ss_list_1163_2000[] = {
- &pci_ss_info_1163_2000_1092_2000,
- NULL
-};
-#define pci_ss_list_1165_0001 NULL
-#define pci_ss_list_1166_0005 NULL
-#define pci_ss_list_1166_0006 NULL
-#define pci_ss_list_1166_0007 NULL
-#define pci_ss_list_1166_0008 NULL
-#define pci_ss_list_1166_0009 NULL
-#define pci_ss_list_1166_0010 NULL
-#define pci_ss_list_1166_0011 NULL
-#define pci_ss_list_1166_0012 NULL
-#define pci_ss_list_1166_0013 NULL
-#define pci_ss_list_1166_0014 NULL
-#define pci_ss_list_1166_0015 NULL
-#define pci_ss_list_1166_0016 NULL
-#define pci_ss_list_1166_0017 NULL
-#define pci_ss_list_1166_0200 NULL
-#define pci_ss_list_1166_0201 NULL
-#define pci_ss_list_1166_0203 NULL
-#define pci_ss_list_1166_0211 NULL
-#define pci_ss_list_1166_0212 NULL
-#define pci_ss_list_1166_0213 NULL
-#define pci_ss_list_1166_0220 NULL
-#define pci_ss_list_1166_0221 NULL
-#define pci_ss_list_1166_0225 NULL
-#define pci_ss_list_1166_0227 NULL
-#define pci_ss_list_116a_6100 NULL
-#define pci_ss_list_116a_6800 NULL
-#define pci_ss_list_116a_7100 NULL
-#define pci_ss_list_116a_7800 NULL
-#define pci_ss_list_1178_afa1 NULL
-#define pci_ss_list_1179_0103 NULL
-#define pci_ss_list_1179_0404 NULL
-#define pci_ss_list_1179_0406 NULL
-#define pci_ss_list_1179_0407 NULL
-#define pci_ss_list_1179_0601 NULL
-#define pci_ss_list_1179_0603 NULL
-#define pci_ss_list_1179_060a NULL
-#define pci_ss_list_1179_060f NULL
-#define pci_ss_list_1179_0617 NULL
-#define pci_ss_list_1179_0618 NULL
-#define pci_ss_list_1179_0701 NULL
-#define pci_ss_list_1179_0804 NULL
-#define pci_ss_list_1179_0805 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1179_0d01[] = {
- &pci_ss_info_1179_0d01_1179_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1180_0465 NULL
-#define pci_ss_list_1180_0466 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1180_0475[] = {
- &pci_ss_info_1180_0475_144d_c006,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1180_0476[] = {
- &pci_ss_info_1180_0476_1014_0185,
- &pci_ss_info_1180_0476_104d_80df,
- &pci_ss_info_1180_0476_104d_80e7,
- NULL
-};
-#define pci_ss_list_1180_0477 NULL
-static const pciSubsystemInfo *pci_ss_list_1180_0478[] = {
- &pci_ss_info_1180_0478_1014_0184,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1180_0522[] = {
- &pci_ss_info_1180_0522_1014_01cf,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1180_0551[] = {
- &pci_ss_info_1180_0551_144d_c006,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1180_0552[] = {
- &pci_ss_info_1180_0552_1014_0511,
- NULL
-};
-#endif
-#define pci_ss_list_1186_0100 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1186_1002[] = {
- &pci_ss_info_1186_1002_1186_1002,
- &pci_ss_info_1186_1002_1186_1012,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1186_1300[] = {
- &pci_ss_info_1186_1300_1186_1300,
- &pci_ss_info_1186_1300_1186_1301,
- NULL
-};
-#define pci_ss_list_1186_1340 NULL
-#define pci_ss_list_1186_1561 NULL
-#define pci_ss_list_1186_4000 NULL
-#endif
-#define pci_ss_list_118c_0014 NULL
-#define pci_ss_list_118c_1117 NULL
-#define pci_ss_list_118d_0001 NULL
-#define pci_ss_list_118d_0012 NULL
-#define pci_ss_list_118d_0014 NULL
-#define pci_ss_list_118d_0024 NULL
-#define pci_ss_list_118d_0044 NULL
-#define pci_ss_list_118d_0112 NULL
-#define pci_ss_list_118d_0114 NULL
-#define pci_ss_list_118d_0124 NULL
-#define pci_ss_list_118d_0144 NULL
-#define pci_ss_list_118d_0212 NULL
-#define pci_ss_list_118d_0214 NULL
-#define pci_ss_list_118d_0224 NULL
-#define pci_ss_list_118d_0244 NULL
-#define pci_ss_list_118d_0312 NULL
-#define pci_ss_list_118d_0314 NULL
-#define pci_ss_list_118d_0324 NULL
-#define pci_ss_list_118d_0344 NULL
-#define pci_ss_list_1190_c731 NULL
-#define pci_ss_list_1191_0003 NULL
-#define pci_ss_list_1191_0004 NULL
-#define pci_ss_list_1191_0005 NULL
-#define pci_ss_list_1191_0006 NULL
-#define pci_ss_list_1191_0007 NULL
-#define pci_ss_list_1191_0008 NULL
-#define pci_ss_list_1191_0009 NULL
-#define pci_ss_list_1191_8002 NULL
-#define pci_ss_list_1191_8010 NULL
-#define pci_ss_list_1191_8020 NULL
-#define pci_ss_list_1191_8030 NULL
-#define pci_ss_list_1191_8040 NULL
-#define pci_ss_list_1191_8050 NULL
-#define pci_ss_list_1193_0001 NULL
-#define pci_ss_list_1193_0002 NULL
-#define pci_ss_list_119b_1221 NULL
-#define pci_ss_list_119e_0001 NULL
-#define pci_ss_list_119e_0003 NULL
-#define pci_ss_list_11a9_4240 NULL
-#define pci_ss_list_11ab_0146 NULL
-#define pci_ss_list_11ab_4611 NULL
-#define pci_ss_list_11ab_4620 NULL
-#define pci_ss_list_11ab_4801 NULL
-#define pci_ss_list_11ab_f003 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11ad_0002[] = {
- &pci_ss_info_11ad_0002_11ad_0002,
- &pci_ss_info_11ad_0002_11ad_0003,
- &pci_ss_info_11ad_0002_11ad_f003,
- &pci_ss_info_11ad_0002_11ad_ffff,
- &pci_ss_info_11ad_0002_1385_f004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11ad_c115[] = {
- &pci_ss_info_11ad_c115_11ad_c001,
- NULL
-};
-#endif
-#define pci_ss_list_11b0_0002 NULL
-#define pci_ss_list_11b0_0292 NULL
-#define pci_ss_list_11b0_0960 NULL
-#define pci_ss_list_11b0_c960 NULL
-#define pci_ss_list_11b8_0001 NULL
-#define pci_ss_list_11b9_c0ed NULL
-#define pci_ss_list_11bc_0001 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11c1_0440[] = {
- &pci_ss_info_11c1_0440_1033_8015,
- &pci_ss_info_11c1_0440_1033_8047,
- &pci_ss_info_11c1_0440_1033_804f,
- &pci_ss_info_11c1_0440_10cf_102c,
- &pci_ss_info_11c1_0440_10cf_104a,
- &pci_ss_info_11c1_0440_10cf_105f,
- &pci_ss_info_11c1_0440_1179_0001,
- &pci_ss_info_11c1_0440_11c1_0440,
- &pci_ss_info_11c1_0440_122d_4101,
- &pci_ss_info_11c1_0440_122d_4102,
- &pci_ss_info_11c1_0440_13e0_0040,
- &pci_ss_info_11c1_0440_13e0_0440,
- &pci_ss_info_11c1_0440_13e0_0441,
- &pci_ss_info_11c1_0440_13e0_0450,
- &pci_ss_info_11c1_0440_13e0_f100,
- &pci_ss_info_11c1_0440_13e0_f101,
- &pci_ss_info_11c1_0440_144d_2101,
- &pci_ss_info_11c1_0440_149f_0440,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11c1_0441[] = {
- &pci_ss_info_11c1_0441_1033_804d,
- &pci_ss_info_11c1_0441_1033_8065,
- &pci_ss_info_11c1_0441_1092_0440,
- &pci_ss_info_11c1_0441_1179_0001,
- &pci_ss_info_11c1_0441_11c1_0440,
- &pci_ss_info_11c1_0441_11c1_0441,
- &pci_ss_info_11c1_0441_122d_4100,
- &pci_ss_info_11c1_0441_13e0_0040,
- &pci_ss_info_11c1_0441_13e0_0100,
- &pci_ss_info_11c1_0441_13e0_0410,
- &pci_ss_info_11c1_0441_13e0_0420,
- &pci_ss_info_11c1_0441_13e0_0440,
- &pci_ss_info_11c1_0441_13e0_0443,
- &pci_ss_info_11c1_0441_13e0_f102,
- &pci_ss_info_11c1_0441_1416_9804,
- &pci_ss_info_11c1_0441_141d_0440,
- &pci_ss_info_11c1_0441_144f_0441,
- &pci_ss_info_11c1_0441_144f_0449,
- &pci_ss_info_11c1_0441_144f_110d,
- &pci_ss_info_11c1_0441_1468_0441,
- &pci_ss_info_11c1_0441_1668_0440,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11c1_0442[] = {
- &pci_ss_info_11c1_0442_11c1_0440,
- &pci_ss_info_11c1_0442_11c1_0442,
- &pci_ss_info_11c1_0442_13e0_0412,
- &pci_ss_info_11c1_0442_13e0_0442,
- &pci_ss_info_11c1_0442_13fc_2471,
- &pci_ss_info_11c1_0442_144d_2104,
- &pci_ss_info_11c1_0442_144f_1104,
- &pci_ss_info_11c1_0442_149f_0440,
- &pci_ss_info_11c1_0442_1668_0440,
- NULL
-};
-#define pci_ss_list_11c1_0443 NULL
-#define pci_ss_list_11c1_0444 NULL
-static const pciSubsystemInfo *pci_ss_list_11c1_0445[] = {
- &pci_ss_info_11c1_0445_8086_2203,
- NULL
-};
-#define pci_ss_list_11c1_0446 NULL
-#define pci_ss_list_11c1_0447 NULL
-static const pciSubsystemInfo *pci_ss_list_11c1_0448[] = {
- &pci_ss_info_11c1_0448_1014_0131,
- &pci_ss_info_11c1_0448_1033_8066,
- &pci_ss_info_11c1_0448_13e0_0030,
- &pci_ss_info_11c1_0448_13e0_0040,
- &pci_ss_info_11c1_0448_1668_2400,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11c1_0449[] = {
- &pci_ss_info_11c1_0449_0e11_b14d,
- &pci_ss_info_11c1_0449_13e0_0020,
- &pci_ss_info_11c1_0449_13e0_0041,
- &pci_ss_info_11c1_0449_1436_0440,
- &pci_ss_info_11c1_0449_144f_0449,
- &pci_ss_info_11c1_0449_1468_0410,
- &pci_ss_info_11c1_0449_1468_0440,
- &pci_ss_info_11c1_0449_1468_0449,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11c1_044a[] = {
- &pci_ss_info_11c1_044a_10cf_1072,
- &pci_ss_info_11c1_044a_13e0_0012,
- &pci_ss_info_11c1_044a_13e0_0042,
- &pci_ss_info_11c1_044a_144f_1005,
- NULL
-};
-#define pci_ss_list_11c1_044b NULL
-#define pci_ss_list_11c1_044c NULL
-#define pci_ss_list_11c1_044d NULL
-#define pci_ss_list_11c1_044e NULL
-#define pci_ss_list_11c1_044f NULL
-static const pciSubsystemInfo *pci_ss_list_11c1_0450[] = {
- &pci_ss_info_11c1_0450_144f_4005,
- NULL
-};
-#define pci_ss_list_11c1_0451 NULL
-#define pci_ss_list_11c1_0452 NULL
-#define pci_ss_list_11c1_0453 NULL
-#define pci_ss_list_11c1_0454 NULL
-#define pci_ss_list_11c1_0455 NULL
-#define pci_ss_list_11c1_0456 NULL
-#define pci_ss_list_11c1_0457 NULL
-#define pci_ss_list_11c1_0458 NULL
-#define pci_ss_list_11c1_0459 NULL
-#define pci_ss_list_11c1_045a NULL
-#define pci_ss_list_11c1_045c NULL
-#define pci_ss_list_11c1_0461 NULL
-#define pci_ss_list_11c1_0462 NULL
-#define pci_ss_list_11c1_0480 NULL
-#define pci_ss_list_11c1_5801 NULL
-#define pci_ss_list_11c1_5802 NULL
-#define pci_ss_list_11c1_5803 NULL
-static const pciSubsystemInfo *pci_ss_list_11c1_5811[] = {
- &pci_ss_info_11c1_5811_dead_0800,
- NULL
-};
-#endif
-#define pci_ss_list_11c8_0658 NULL
-#define pci_ss_list_11c8_d665 NULL
-#define pci_ss_list_11c8_d667 NULL
-#define pci_ss_list_11c9_0010 NULL
-#define pci_ss_list_11c9_0011 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11cb_2000[] = {
- &pci_ss_info_11cb_2000_11cb_0200,
- &pci_ss_info_11cb_2000_11cb_b008,
- NULL
-};
-#define pci_ss_list_11cb_4000 NULL
-#define pci_ss_list_11cb_8000 NULL
-#endif
-#define pci_ss_list_11d1_01f7 NULL
-#define pci_ss_list_11d4_1805 NULL
-#define pci_ss_list_11d4_1889 NULL
-#define pci_ss_list_11d5_0115 NULL
-#define pci_ss_list_11d5_0117 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11de_6057[] = {
- &pci_ss_info_11de_6057_1031_7efe,
- &pci_ss_info_11de_6057_1031_fc00,
- &pci_ss_info_11de_6057_13ca_4231,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11de_6120[] = {
- &pci_ss_info_11de_6120_1328_f001,
- NULL
-};
-#endif
-#define pci_ss_list_11e3_5030 NULL
-#define pci_ss_list_11f0_4231 NULL
-#define pci_ss_list_11f0_4232 NULL
-#define pci_ss_list_11f0_4233 NULL
-#define pci_ss_list_11f0_4234 NULL
-#define pci_ss_list_11f0_4235 NULL
-#define pci_ss_list_11f0_4236 NULL
-#define pci_ss_list_11f0_4731 NULL
-#define pci_ss_list_11f4_2915 NULL
-#define pci_ss_list_11f6_0112 NULL
-#define pci_ss_list_11f6_0113 NULL
-#define pci_ss_list_11f6_1401 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11f6_2011[] = {
- &pci_ss_info_11f6_2011_11f6_2011,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_11f6_2201[] = {
- &pci_ss_info_11f6_2201_11f6_2011,
- NULL
-};
-#define pci_ss_list_11f6_9881 NULL
-#endif
-#define pci_ss_list_11f8_7375 NULL
-#define pci_ss_list_11fe_0001 NULL
-#define pci_ss_list_11fe_0002 NULL
-#define pci_ss_list_11fe_0003 NULL
-#define pci_ss_list_11fe_0004 NULL
-#define pci_ss_list_11fe_0005 NULL
-#define pci_ss_list_11fe_0006 NULL
-#define pci_ss_list_11fe_0007 NULL
-#define pci_ss_list_11fe_0008 NULL
-#define pci_ss_list_11fe_0009 NULL
-#define pci_ss_list_11fe_000a NULL
-#define pci_ss_list_11fe_000b NULL
-#define pci_ss_list_11fe_000c NULL
-#define pci_ss_list_11fe_8015 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1202_4300[] = {
- &pci_ss_info_1202_4300_1202_9841,
- &pci_ss_info_1202_4300_1202_9842,
- &pci_ss_info_1202_4300_1202_9843,
- &pci_ss_info_1202_4300_1202_9844,
- NULL
-};
-#endif
-#define pci_ss_list_1208_4853 NULL
-#define pci_ss_list_120e_0100 NULL
-#define pci_ss_list_120e_0101 NULL
-#define pci_ss_list_120e_0102 NULL
-#define pci_ss_list_120e_0103 NULL
-#define pci_ss_list_120e_0104 NULL
-#define pci_ss_list_120e_0105 NULL
-#define pci_ss_list_120e_0200 NULL
-#define pci_ss_list_120e_0201 NULL
-#define pci_ss_list_120e_0300 NULL
-#define pci_ss_list_120e_0301 NULL
-#define pci_ss_list_120e_0310 NULL
-#define pci_ss_list_120e_0311 NULL
-#define pci_ss_list_120e_0320 NULL
-#define pci_ss_list_120e_0321 NULL
-#define pci_ss_list_120e_0400 NULL
-#define pci_ss_list_120f_0001 NULL
-#define pci_ss_list_1217_6729 NULL
-#define pci_ss_list_1217_673a NULL
-#define pci_ss_list_1217_6832 NULL
-#define pci_ss_list_1217_6836 NULL
-#define pci_ss_list_1217_6872 NULL
-#define pci_ss_list_1217_6925 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1217_6933[] = {
- &pci_ss_info_1217_6933_1025_1016,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1217_6972[] = {
- &pci_ss_info_1217_6972_1179_0001,
- NULL
-};
-#endif
-#define pci_ss_list_121a_0001 NULL
-#define pci_ss_list_121a_0002 NULL
-static const pciSubsystemInfo *pci_ss_list_121a_0003[] = {
- &pci_ss_info_121a_0003_1092_0003,
- &pci_ss_info_121a_0003_1092_4000,
- &pci_ss_info_121a_0003_1092_4002,
- &pci_ss_info_121a_0003_1092_4801,
- &pci_ss_info_121a_0003_1092_4803,
- &pci_ss_info_121a_0003_1092_8030,
- &pci_ss_info_121a_0003_1092_8035,
- &pci_ss_info_121a_0003_10b0_0001,
- &pci_ss_info_121a_0003_1102_1018,
- &pci_ss_info_121a_0003_121a_0001,
- &pci_ss_info_121a_0003_121a_0003,
- &pci_ss_info_121a_0003_121a_0004,
- &pci_ss_info_121a_0003_139c_0016,
- &pci_ss_info_121a_0003_139c_0017,
- &pci_ss_info_121a_0003_14af_0002,
- NULL
-};
-#define pci_ss_list_121a_0004 NULL
-static const pciSubsystemInfo *pci_ss_list_121a_0005[] = {
- &pci_ss_info_121a_0005_121a_0004,
- &pci_ss_info_121a_0005_121a_0030,
- &pci_ss_info_121a_0005_121a_0031,
- &pci_ss_info_121a_0005_121a_0034,
- &pci_ss_info_121a_0005_121a_0036,
- &pci_ss_info_121a_0005_121a_0037,
- &pci_ss_info_121a_0005_121a_0038,
- &pci_ss_info_121a_0005_121a_003a,
- &pci_ss_info_121a_0005_121a_0044,
- &pci_ss_info_121a_0005_121a_004b,
- &pci_ss_info_121a_0005_121a_004c,
- &pci_ss_info_121a_0005_121a_004d,
- &pci_ss_info_121a_0005_121a_004e,
- &pci_ss_info_121a_0005_121a_0051,
- &pci_ss_info_121a_0005_121a_0052,
- &pci_ss_info_121a_0005_121a_0060,
- &pci_ss_info_121a_0005_121a_0061,
- &pci_ss_info_121a_0005_121a_0062,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_121a_0009[] = {
- &pci_ss_info_121a_0009_121a_0009,
- NULL
-};
-#define pci_ss_list_121a_0057 NULL
-#define pci_ss_list_1220_1220 NULL
-#define pci_ss_list_1223_0003 NULL
-#define pci_ss_list_1223_0004 NULL
-#define pci_ss_list_1223_0005 NULL
-#define pci_ss_list_1223_0008 NULL
-#define pci_ss_list_1223_0009 NULL
-#define pci_ss_list_1223_000a NULL
-#define pci_ss_list_1223_000b NULL
-#define pci_ss_list_1223_000c NULL
-#define pci_ss_list_1223_000d NULL
-#define pci_ss_list_1223_000e NULL
-#define pci_ss_list_122d_1206 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_122d_50dc[] = {
- &pci_ss_info_122d_50dc_122d_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_122d_80da[] = {
- &pci_ss_info_122d_80da_122d_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1236_0000 NULL
-#define pci_ss_list_1236_6401 NULL
-#define pci_ss_list_123d_0000 NULL
-#define pci_ss_list_123d_0002 NULL
-#define pci_ss_list_123d_0003 NULL
-#define pci_ss_list_123f_00e4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_123f_8120[] = {
- &pci_ss_info_123f_8120_11bd_0006,
- &pci_ss_info_123f_8120_11bd_000a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_123f_8888[] = {
- &pci_ss_info_123f_8888_1002_0001,
- &pci_ss_info_123f_8888_1002_0002,
- &pci_ss_info_123f_8888_1328_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1242_1560[] = {
- &pci_ss_info_1242_1560_1242_6562,
- &pci_ss_info_1242_1560_1242_656a,
- NULL
-};
-#define pci_ss_list_1242_4643 NULL
-#endif
-#define pci_ss_list_1244_0700 NULL
-#define pci_ss_list_1244_0800 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1244_0a00[] = {
- &pci_ss_info_1244_0a00_1244_0a00,
- NULL
-};
-#define pci_ss_list_1244_0e00 NULL
-#define pci_ss_list_1244_1100 NULL
-#define pci_ss_list_1244_1200 NULL
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_124b_0040[] = {
- &pci_ss_info_124b_0040_124b_9080,
- NULL
-};
-#endif
-#define pci_ss_list_124d_0000 NULL
-#define pci_ss_list_124d_0002 NULL
-#define pci_ss_list_124d_0003 NULL
-#define pci_ss_list_124d_0004 NULL
-#define pci_ss_list_124f_0041 NULL
-#define pci_ss_list_1255_1110 NULL
-#define pci_ss_list_1255_1210 NULL
-#define pci_ss_list_1255_2110 NULL
-#define pci_ss_list_1255_2120 NULL
-#define pci_ss_list_1255_2130 NULL
-#define pci_ss_list_1256_4201 NULL
-#define pci_ss_list_1256_4401 NULL
-#define pci_ss_list_1256_5201 NULL
-#define pci_ss_list_1259_2560 NULL
-#define pci_ss_list_125b_1400 NULL
-#define pci_ss_list_125c_0640 NULL
-#define pci_ss_list_125d_0000 NULL
-#define pci_ss_list_125d_1948 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_125d_1968[] = {
- &pci_ss_info_125d_1968_1028_0085,
- &pci_ss_info_125d_1968_1033_8051,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_125d_1969[] = {
- &pci_ss_info_125d_1969_1014_0166,
- &pci_ss_info_125d_1969_125d_8888,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_125d_1978[] = {
- &pci_ss_info_125d_1978_0e11_b112,
- &pci_ss_info_125d_1978_1033_803c,
- &pci_ss_info_125d_1978_1033_8058,
- &pci_ss_info_125d_1978_1092_4000,
- &pci_ss_info_125d_1978_1179_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_125d_1988[] = {
- &pci_ss_info_125d_1988_1092_4100,
- &pci_ss_info_125d_1988_125d_1988,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_125d_1989[] = {
- &pci_ss_info_125d_1989_125d_1989,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_125d_1998[] = {
- &pci_ss_info_125d_1998_1028_00e6,
- NULL
-};
-#define pci_ss_list_125d_1999 NULL
-#define pci_ss_list_125d_199a NULL
-#define pci_ss_list_125d_199b NULL
-#define pci_ss_list_125d_2808 NULL
-#define pci_ss_list_125d_2838 NULL
-static const pciSubsystemInfo *pci_ss_list_125d_2898[] = {
- &pci_ss_info_125d_2898_125d_0424,
- &pci_ss_info_125d_2898_125d_0425,
- &pci_ss_info_125d_2898_125d_0426,
- &pci_ss_info_125d_2898_125d_0427,
- &pci_ss_info_125d_2898_125d_0428,
- &pci_ss_info_125d_2898_125d_0429,
- &pci_ss_info_125d_2898_147a_c001,
- &pci_ss_info_125d_2898_14fe_0428,
- &pci_ss_info_125d_2898_14fe_0429,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1260_3873[] = {
- &pci_ss_info_1260_3873_1186_3501,
- &pci_ss_info_1260_3873_1668_0414,
- &pci_ss_info_1260_3873_1737_3874,
- &pci_ss_info_1260_3873_8086_2513,
- NULL
-};
-#define pci_ss_list_1260_3890 NULL
-#define pci_ss_list_1260_8130 NULL
-#define pci_ss_list_1260_8131 NULL
-#endif
-#define pci_ss_list_1266_0001 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1266_1910[] = {
- &pci_ss_info_1266_1910_1266_1910,
- NULL
-};
-#endif
-#define pci_ss_list_1267_5352 NULL
-#define pci_ss_list_1267_5a4b NULL
-#define pci_ss_list_126f_0710 NULL
-#define pci_ss_list_126f_0712 NULL
-#define pci_ss_list_126f_0720 NULL
-#define pci_ss_list_126f_0730 NULL
-#define pci_ss_list_126f_0810 NULL
-#define pci_ss_list_126f_0811 NULL
-#define pci_ss_list_126f_0820 NULL
-#define pci_ss_list_126f_0910 NULL
-#define pci_ss_list_1273_0002 NULL
-#define pci_ss_list_1274_1171 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1274_1371[] = {
- &pci_ss_info_1274_1371_0e11_0024,
- &pci_ss_info_1274_1371_0e11_b1a7,
- &pci_ss_info_1274_1371_1033_80ac,
- &pci_ss_info_1274_1371_1042_1854,
- &pci_ss_info_1274_1371_107b_8054,
- &pci_ss_info_1274_1371_1274_1371,
- &pci_ss_info_1274_1371_1462_6470,
- &pci_ss_info_1274_1371_1462_6560,
- &pci_ss_info_1274_1371_1462_6630,
- &pci_ss_info_1274_1371_1462_6631,
- &pci_ss_info_1274_1371_1462_6632,
- &pci_ss_info_1274_1371_1462_6633,
- &pci_ss_info_1274_1371_1462_6820,
- &pci_ss_info_1274_1371_1462_6822,
- &pci_ss_info_1274_1371_1462_6830,
- &pci_ss_info_1274_1371_1462_6880,
- &pci_ss_info_1274_1371_1462_6900,
- &pci_ss_info_1274_1371_1462_6910,
- &pci_ss_info_1274_1371_1462_6930,
- &pci_ss_info_1274_1371_1462_6990,
- &pci_ss_info_1274_1371_1462_6991,
- &pci_ss_info_1274_1371_14a4_2077,
- &pci_ss_info_1274_1371_14a4_2105,
- &pci_ss_info_1274_1371_14a4_2107,
- &pci_ss_info_1274_1371_14a4_2172,
- &pci_ss_info_1274_1371_1509_9902,
- &pci_ss_info_1274_1371_1509_9903,
- &pci_ss_info_1274_1371_1509_9904,
- &pci_ss_info_1274_1371_1509_9905,
- &pci_ss_info_1274_1371_152d_8801,
- &pci_ss_info_1274_1371_152d_8802,
- &pci_ss_info_1274_1371_152d_8803,
- &pci_ss_info_1274_1371_152d_8804,
- &pci_ss_info_1274_1371_152d_8805,
- &pci_ss_info_1274_1371_270f_2001,
- &pci_ss_info_1274_1371_270f_2200,
- &pci_ss_info_1274_1371_270f_3000,
- &pci_ss_info_1274_1371_270f_3100,
- &pci_ss_info_1274_1371_270f_3102,
- &pci_ss_info_1274_1371_270f_7060,
- &pci_ss_info_1274_1371_8086_4249,
- &pci_ss_info_1274_1371_8086_424c,
- &pci_ss_info_1274_1371_8086_425a,
- &pci_ss_info_1274_1371_8086_4341,
- &pci_ss_info_1274_1371_8086_4343,
- &pci_ss_info_1274_1371_8086_4649,
- &pci_ss_info_1274_1371_8086_464a,
- &pci_ss_info_1274_1371_8086_4d4f,
- &pci_ss_info_1274_1371_8086_4f43,
- &pci_ss_info_1274_1371_8086_5243,
- &pci_ss_info_1274_1371_8086_5352,
- &pci_ss_info_1274_1371_8086_5643,
- &pci_ss_info_1274_1371_8086_5753,
- NULL
-};
-#define pci_ss_list_1274_5000 NULL
-static const pciSubsystemInfo *pci_ss_list_1274_5880[] = {
- &pci_ss_info_1274_5880_1274_2000,
- &pci_ss_info_1274_5880_1274_2003,
- &pci_ss_info_1274_5880_1274_5880,
- &pci_ss_info_1274_5880_1458_a000,
- &pci_ss_info_1274_5880_1462_6880,
- &pci_ss_info_1274_5880_270f_2001,
- &pci_ss_info_1274_5880_270f_2200,
- &pci_ss_info_1274_5880_270f_7040,
- NULL
-};
-#endif
-#define pci_ss_list_1278_0701 NULL
-#define pci_ss_list_1278_0710 NULL
-#define pci_ss_list_1279_0295 NULL
-#define pci_ss_list_1279_0395 NULL
-#define pci_ss_list_1279_0396 NULL
-#define pci_ss_list_1279_0397 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_127a_1002[] = {
- &pci_ss_info_127a_1002_1092_094c,
- &pci_ss_info_127a_1002_122d_4002,
- &pci_ss_info_127a_1002_122d_4005,
- &pci_ss_info_127a_1002_122d_4007,
- &pci_ss_info_127a_1002_122d_4012,
- &pci_ss_info_127a_1002_122d_4017,
- &pci_ss_info_127a_1002_122d_4018,
- &pci_ss_info_127a_1002_127a_1002,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_1003[] = {
- &pci_ss_info_127a_1003_0e11_b0bc,
- &pci_ss_info_127a_1003_0e11_b114,
- &pci_ss_info_127a_1003_1033_802b,
- &pci_ss_info_127a_1003_13df_1003,
- &pci_ss_info_127a_1003_13e0_0117,
- &pci_ss_info_127a_1003_13e0_0147,
- &pci_ss_info_127a_1003_13e0_0197,
- &pci_ss_info_127a_1003_13e0_01c7,
- &pci_ss_info_127a_1003_13e0_01f7,
- &pci_ss_info_127a_1003_1436_1003,
- &pci_ss_info_127a_1003_1436_1103,
- &pci_ss_info_127a_1003_1436_1602,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_1004[] = {
- &pci_ss_info_127a_1004_1048_1500,
- &pci_ss_info_127a_1004_10cf_1059,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_1005[] = {
- &pci_ss_info_127a_1005_1033_8029,
- &pci_ss_info_127a_1005_1033_8054,
- &pci_ss_info_127a_1005_10cf_103c,
- &pci_ss_info_127a_1005_10cf_1055,
- &pci_ss_info_127a_1005_10cf_1056,
- &pci_ss_info_127a_1005_122d_4003,
- &pci_ss_info_127a_1005_122d_4006,
- &pci_ss_info_127a_1005_122d_4008,
- &pci_ss_info_127a_1005_122d_4009,
- &pci_ss_info_127a_1005_122d_4010,
- &pci_ss_info_127a_1005_122d_4011,
- &pci_ss_info_127a_1005_122d_4013,
- &pci_ss_info_127a_1005_122d_4015,
- &pci_ss_info_127a_1005_122d_4016,
- &pci_ss_info_127a_1005_122d_4019,
- &pci_ss_info_127a_1005_13df_1005,
- &pci_ss_info_127a_1005_13e0_0187,
- &pci_ss_info_127a_1005_13e0_01a7,
- &pci_ss_info_127a_1005_13e0_01b7,
- &pci_ss_info_127a_1005_13e0_01d7,
- &pci_ss_info_127a_1005_1436_1005,
- &pci_ss_info_127a_1005_1436_1105,
- &pci_ss_info_127a_1005_1437_1105,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_1022[] = {
- &pci_ss_info_127a_1022_1436_1303,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_1023[] = {
- &pci_ss_info_127a_1023_122d_4020,
- &pci_ss_info_127a_1023_122d_4023,
- &pci_ss_info_127a_1023_13e0_0247,
- &pci_ss_info_127a_1023_13e0_0297,
- &pci_ss_info_127a_1023_13e0_02c7,
- &pci_ss_info_127a_1023_1436_1203,
- &pci_ss_info_127a_1023_1436_1303,
- NULL
-};
-#define pci_ss_list_127a_1024 NULL
-static const pciSubsystemInfo *pci_ss_list_127a_1025[] = {
- &pci_ss_info_127a_1025_10cf_106a,
- &pci_ss_info_127a_1025_122d_4021,
- &pci_ss_info_127a_1025_122d_4022,
- &pci_ss_info_127a_1025_122d_4024,
- &pci_ss_info_127a_1025_122d_4025,
- NULL
-};
-#define pci_ss_list_127a_1026 NULL
-#define pci_ss_list_127a_1032 NULL
-#define pci_ss_list_127a_1033 NULL
-#define pci_ss_list_127a_1034 NULL
-#define pci_ss_list_127a_1035 NULL
-#define pci_ss_list_127a_1036 NULL
-#define pci_ss_list_127a_1085 NULL
-static const pciSubsystemInfo *pci_ss_list_127a_2005[] = {
- &pci_ss_info_127a_2005_104d_8044,
- &pci_ss_info_127a_2005_104d_8045,
- &pci_ss_info_127a_2005_104d_8055,
- &pci_ss_info_127a_2005_104d_8056,
- &pci_ss_info_127a_2005_104d_805a,
- &pci_ss_info_127a_2005_104d_805f,
- &pci_ss_info_127a_2005_104d_8074,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_2013[] = {
- &pci_ss_info_127a_2013_1179_0001,
- &pci_ss_info_127a_2013_1179_ff00,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_2014[] = {
- &pci_ss_info_127a_2014_10cf_1057,
- &pci_ss_info_127a_2014_122d_4050,
- &pci_ss_info_127a_2014_122d_4055,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_2015[] = {
- &pci_ss_info_127a_2015_10cf_1063,
- &pci_ss_info_127a_2015_10cf_1064,
- &pci_ss_info_127a_2015_1468_2015,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_2016[] = {
- &pci_ss_info_127a_2016_122d_4051,
- &pci_ss_info_127a_2016_122d_4052,
- &pci_ss_info_127a_2016_122d_4054,
- &pci_ss_info_127a_2016_122d_4056,
- &pci_ss_info_127a_2016_122d_4057,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_4311[] = {
- &pci_ss_info_127a_4311_127a_4311,
- &pci_ss_info_127a_4311_13e0_0210,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_4320[] = {
- &pci_ss_info_127a_4320_1235_4320,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_4321[] = {
- &pci_ss_info_127a_4321_1235_4321,
- &pci_ss_info_127a_4321_1235_4324,
- &pci_ss_info_127a_4321_13e0_0210,
- &pci_ss_info_127a_4321_144d_2321,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_4322[] = {
- &pci_ss_info_127a_4322_1235_4322,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_127a_8234[] = {
- &pci_ss_info_127a_8234_108d_0022,
- &pci_ss_info_127a_8234_108d_0027,
- NULL
-};
-#endif
-#define pci_ss_list_1282_9009 NULL
-#define pci_ss_list_1282_9100 NULL
-#define pci_ss_list_1282_9102 NULL
-#define pci_ss_list_1282_9132 NULL
-#define pci_ss_list_1283_673a NULL
-#define pci_ss_list_1283_8330 NULL
-#define pci_ss_list_1283_8888 NULL
-#define pci_ss_list_1283_8889 NULL
-#define pci_ss_list_1283_e886 NULL
-#define pci_ss_list_1285_0100 NULL
-#define pci_ss_list_1287_001e NULL
-#define pci_ss_list_1287_001f NULL
-#define pci_ss_list_128d_0021 NULL
-#define pci_ss_list_128e_0008 NULL
-#define pci_ss_list_128e_0009 NULL
-#define pci_ss_list_128e_000a NULL
-#define pci_ss_list_128e_000b NULL
-#define pci_ss_list_128e_000c NULL
-#define pci_ss_list_129a_0615 NULL
-#define pci_ss_list_12ab_3000 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12ae_0001[] = {
- &pci_ss_info_12ae_0001_12ae_0001,
- &pci_ss_info_12ae_0001_1410_0104,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12ae_0002[] = {
- &pci_ss_info_12ae_0002_10a9_8002,
- &pci_ss_info_12ae_0002_12ae_0002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12b9_1006[] = {
- &pci_ss_info_12b9_1006_12b9_005c,
- &pci_ss_info_12b9_1006_12b9_005e,
- &pci_ss_info_12b9_1006_12b9_0062,
- &pci_ss_info_12b9_1006_12b9_0068,
- &pci_ss_info_12b9_1006_12b9_007a,
- &pci_ss_info_12b9_1006_12b9_007f,
- &pci_ss_info_12b9_1006_12b9_0080,
- &pci_ss_info_12b9_1006_12b9_0081,
- &pci_ss_info_12b9_1006_12b9_0091,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12b9_1007[] = {
- &pci_ss_info_12b9_1007_12b9_00a3,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12b9_1008[] = {
- &pci_ss_info_12b9_1008_12b9_00a2,
- &pci_ss_info_12b9_1008_12b9_00aa,
- &pci_ss_info_12b9_1008_12b9_00ab,
- &pci_ss_info_12b9_1008_12b9_00ac,
- &pci_ss_info_12b9_1008_12b9_00ad,
- NULL
-};
-#endif
-#define pci_ss_list_12be_3041 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12be_3042[] = {
- &pci_ss_info_12be_3042_12be_3042,
- NULL
-};
-#endif
-#define pci_ss_list_12c3_0058 NULL
-#define pci_ss_list_12c3_5598 NULL
-#define pci_ss_list_12c5_007e NULL
-#define pci_ss_list_12c5_007f NULL
-#define pci_ss_list_12c5_0081 NULL
-#define pci_ss_list_12c5_0085 NULL
-#define pci_ss_list_12c5_0086 NULL
-#define pci_ss_list_12d2_0008 NULL
-#define pci_ss_list_12d2_0009 NULL
-static const pciSubsystemInfo *pci_ss_list_12d2_0018[] = {
- &pci_ss_info_12d2_0018_1048_0c10,
- &pci_ss_info_12d2_0018_107b_8030,
- &pci_ss_info_12d2_0018_1092_0350,
- &pci_ss_info_12d2_0018_1092_1092,
- &pci_ss_info_12d2_0018_10b4_1b1b,
- &pci_ss_info_12d2_0018_10b4_1b1d,
- &pci_ss_info_12d2_0018_10b4_1b1e,
- &pci_ss_info_12d2_0018_10b4_1b20,
- &pci_ss_info_12d2_0018_10b4_1b21,
- &pci_ss_info_12d2_0018_10b4_1b22,
- &pci_ss_info_12d2_0018_10b4_1b23,
- &pci_ss_info_12d2_0018_10b4_1b27,
- &pci_ss_info_12d2_0018_10b4_1b88,
- &pci_ss_info_12d2_0018_10b4_222a,
- &pci_ss_info_12d2_0018_10b4_2230,
- &pci_ss_info_12d2_0018_10b4_2232,
- &pci_ss_info_12d2_0018_10b4_2235,
- &pci_ss_info_12d2_0018_2a15_54a3,
- NULL
-};
-#define pci_ss_list_12d2_0019 NULL
-#define pci_ss_list_12d2_0020 NULL
-#define pci_ss_list_12d2_0028 NULL
-#define pci_ss_list_12d2_0029 NULL
-#define pci_ss_list_12d2_002c NULL
-#define pci_ss_list_12d2_00a0 NULL
-#define pci_ss_list_12d4_0200 NULL
-#define pci_ss_list_12d9_0002 NULL
-#define pci_ss_list_12d9_0004 NULL
-#define pci_ss_list_12e0_0010 NULL
-#define pci_ss_list_12e0_0020 NULL
-#define pci_ss_list_12e0_0030 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12eb_0001[] = {
- &pci_ss_info_12eb_0001_104d_8036,
- &pci_ss_info_12eb_0001_1092_2000,
- &pci_ss_info_12eb_0001_1092_2100,
- &pci_ss_info_12eb_0001_1092_2110,
- &pci_ss_info_12eb_0001_1092_2200,
- &pci_ss_info_12eb_0001_122d_1002,
- &pci_ss_info_12eb_0001_12eb_0001,
- &pci_ss_info_12eb_0001_5053_3355,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12eb_0002[] = {
- &pci_ss_info_12eb_0002_104d_8049,
- &pci_ss_info_12eb_0002_104d_807b,
- &pci_ss_info_12eb_0002_1092_3000,
- &pci_ss_info_12eb_0002_1092_3001,
- &pci_ss_info_12eb_0002_1092_3002,
- &pci_ss_info_12eb_0002_1092_3003,
- &pci_ss_info_12eb_0002_1092_3004,
- &pci_ss_info_12eb_0002_12eb_0001,
- &pci_ss_info_12eb_0002_12eb_0002,
- &pci_ss_info_12eb_0002_12eb_0088,
- &pci_ss_info_12eb_0002_144d_3510,
- &pci_ss_info_12eb_0002_5053_3356,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12eb_0003[] = {
- &pci_ss_info_12eb_0003_104d_8049,
- &pci_ss_info_12eb_0003_104d_8077,
- &pci_ss_info_12eb_0003_109f_1000,
- &pci_ss_info_12eb_0003_12eb_0003,
- &pci_ss_info_12eb_0003_1462_6780,
- &pci_ss_info_12eb_0003_14a4_2073,
- &pci_ss_info_12eb_0003_14a4_2091,
- &pci_ss_info_12eb_0003_14a4_2104,
- &pci_ss_info_12eb_0003_14a4_2106,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_12eb_8803[] = {
- &pci_ss_info_12eb_8803_12eb_8803,
- NULL
-};
-#endif
-#define pci_ss_list_12f8_0002 NULL
-#define pci_ss_list_1307_0001 NULL
-#define pci_ss_list_1307_000b NULL
-#define pci_ss_list_1307_000c NULL
-#define pci_ss_list_1307_000d NULL
-#define pci_ss_list_1307_000f NULL
-#define pci_ss_list_1307_0010 NULL
-#define pci_ss_list_1307_0014 NULL
-#define pci_ss_list_1307_0015 NULL
-#define pci_ss_list_1307_0016 NULL
-#define pci_ss_list_1307_0017 NULL
-#define pci_ss_list_1307_0018 NULL
-#define pci_ss_list_1307_0019 NULL
-#define pci_ss_list_1307_001a NULL
-#define pci_ss_list_1307_001b NULL
-#define pci_ss_list_1307_001c NULL
-#define pci_ss_list_1307_001d NULL
-#define pci_ss_list_1307_001e NULL
-#define pci_ss_list_1307_001f NULL
-#define pci_ss_list_1307_0020 NULL
-#define pci_ss_list_1307_0021 NULL
-#define pci_ss_list_1307_0022 NULL
-#define pci_ss_list_1307_0023 NULL
-#define pci_ss_list_1307_0024 NULL
-#define pci_ss_list_1307_0025 NULL
-#define pci_ss_list_1307_0026 NULL
-#define pci_ss_list_1307_0027 NULL
-#define pci_ss_list_1307_0028 NULL
-#define pci_ss_list_1307_0029 NULL
-#define pci_ss_list_1307_002c NULL
-#define pci_ss_list_1307_0033 NULL
-#define pci_ss_list_1307_0034 NULL
-#define pci_ss_list_1307_0035 NULL
-#define pci_ss_list_1307_0036 NULL
-#define pci_ss_list_1307_0037 NULL
-#define pci_ss_list_1307_004c NULL
-#define pci_ss_list_1307_004d NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1308_0001[] = {
- &pci_ss_info_1308_0001_1308_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1317_0981 NULL
-#define pci_ss_list_1317_0985 NULL
-#define pci_ss_list_1317_1985 NULL
-#define pci_ss_list_1318_0911 NULL
-#define pci_ss_list_1319_0801 NULL
-#define pci_ss_list_1319_0802 NULL
-#define pci_ss_list_1319_1000 NULL
-#define pci_ss_list_1319_1001 NULL
-#define pci_ss_list_131f_1000 NULL
-#define pci_ss_list_131f_1001 NULL
-#define pci_ss_list_131f_1002 NULL
-#define pci_ss_list_131f_1010 NULL
-#define pci_ss_list_131f_1011 NULL
-#define pci_ss_list_131f_1012 NULL
-#define pci_ss_list_131f_1020 NULL
-#define pci_ss_list_131f_1021 NULL
-#define pci_ss_list_131f_1030 NULL
-#define pci_ss_list_131f_1031 NULL
-#define pci_ss_list_131f_1032 NULL
-#define pci_ss_list_131f_1034 NULL
-#define pci_ss_list_131f_1035 NULL
-#define pci_ss_list_131f_1036 NULL
-#define pci_ss_list_131f_1050 NULL
-#define pci_ss_list_131f_1051 NULL
-#define pci_ss_list_131f_1052 NULL
-#define pci_ss_list_131f_2000 NULL
-#define pci_ss_list_131f_2001 NULL
-#define pci_ss_list_131f_2002 NULL
-#define pci_ss_list_131f_2010 NULL
-#define pci_ss_list_131f_2011 NULL
-#define pci_ss_list_131f_2012 NULL
-#define pci_ss_list_131f_2020 NULL
-#define pci_ss_list_131f_2021 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_131f_2030[] = {
- &pci_ss_info_131f_2030_131f_2030,
- NULL
-};
-#define pci_ss_list_131f_2031 NULL
-#define pci_ss_list_131f_2032 NULL
-#define pci_ss_list_131f_2040 NULL
-#define pci_ss_list_131f_2041 NULL
-#define pci_ss_list_131f_2042 NULL
-#define pci_ss_list_131f_2050 NULL
-#define pci_ss_list_131f_2051 NULL
-#define pci_ss_list_131f_2052 NULL
-#define pci_ss_list_131f_2060 NULL
-#define pci_ss_list_131f_2061 NULL
-#define pci_ss_list_131f_2062 NULL
-#endif
-#define pci_ss_list_1332_5415 NULL
-#define pci_ss_list_1332_5425 NULL
-#define pci_ss_list_134a_0001 NULL
-#define pci_ss_list_134a_0002 NULL
-#define pci_ss_list_134d_7890 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_134d_7891[] = {
- &pci_ss_info_134d_7891_134d_0001,
- NULL
-};
-#define pci_ss_list_134d_7892 NULL
-#define pci_ss_list_134d_7893 NULL
-#define pci_ss_list_134d_7894 NULL
-#define pci_ss_list_134d_7895 NULL
-#define pci_ss_list_134d_7896 NULL
-#define pci_ss_list_134d_7897 NULL
-#endif
-#define pci_ss_list_1353_0002 NULL
-#define pci_ss_list_1353_0003 NULL
-#define pci_ss_list_1353_0004 NULL
-#define pci_ss_list_1353_0005 NULL
-#define pci_ss_list_135c_0010 NULL
-#define pci_ss_list_135c_0020 NULL
-#define pci_ss_list_135c_0030 NULL
-#define pci_ss_list_135c_0040 NULL
-#define pci_ss_list_135c_0050 NULL
-#define pci_ss_list_135c_0060 NULL
-#define pci_ss_list_135c_00f0 NULL
-#define pci_ss_list_135c_0170 NULL
-#define pci_ss_list_135c_0180 NULL
-#define pci_ss_list_135c_0190 NULL
-#define pci_ss_list_135c_01a0 NULL
-#define pci_ss_list_135c_01b0 NULL
-#define pci_ss_list_135c_01c0 NULL
-#define pci_ss_list_135e_7101 NULL
-#define pci_ss_list_135e_7201 NULL
-#define pci_ss_list_135e_7202 NULL
-#define pci_ss_list_135e_7401 NULL
-#define pci_ss_list_135e_7402 NULL
-#define pci_ss_list_135e_7801 NULL
-#define pci_ss_list_135e_8001 NULL
-#define pci_ss_list_1385_4100 NULL
-#define pci_ss_list_1385_4105 NULL
-#define pci_ss_list_1385_620a NULL
-#define pci_ss_list_1385_622a NULL
-#define pci_ss_list_1385_630a NULL
-#define pci_ss_list_1385_f311 NULL
-#define pci_ss_list_1389_0001 NULL
-#define pci_ss_list_1393_1040 NULL
-#define pci_ss_list_1393_1680 NULL
-#define pci_ss_list_1393_2040 NULL
-#define pci_ss_list_1393_2180 NULL
-#define pci_ss_list_1393_3200 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1394_0001[] = {
- &pci_ss_info_1394_0001_1394_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1397_2bd0[] = {
- &pci_ss_info_1397_2bd0_1397_2bd0,
- &pci_ss_info_1397_2bd0_e4bf_1000,
- NULL
-};
-#endif
-#define pci_ss_list_139a_0001 NULL
-#define pci_ss_list_139a_0003 NULL
-#define pci_ss_list_139a_0005 NULL
-#define pci_ss_list_13a3_0005 NULL
-#define pci_ss_list_13a3_0006 NULL
-#define pci_ss_list_13a3_0007 NULL
-#define pci_ss_list_13a3_0012 NULL
-#define pci_ss_list_13a3_0014 NULL
-#define pci_ss_list_13a3_0016 NULL
-#define pci_ss_list_13a3_0017 NULL
-#define pci_ss_list_13a3_0018 NULL
-#define pci_ss_list_13a8_0158 NULL
-#define pci_ss_list_13c0_0010 NULL
-#define pci_ss_list_13c1_1000 NULL
-#define pci_ss_list_13c1_1001 NULL
-#define pci_ss_list_13c1_1002 NULL
-#define pci_ss_list_13d0_2103 NULL
-#define pci_ss_list_13d1_ab02 NULL
-#define pci_ss_list_13d1_ab06 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13df_0001[] = {
- &pci_ss_info_13df_0001_13df_0001,
- NULL
-};
-#endif
-#define pci_ss_list_13f0_0201 NULL
-#define pci_ss_list_13f4_1401 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13f6_0100[] = {
- &pci_ss_info_13f6_0100_13f6_ffff,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_13f6_0101[] = {
- &pci_ss_info_13f6_0101_13f6_0101,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_13f6_0111[] = {
- &pci_ss_info_13f6_0111_1019_0970,
- &pci_ss_info_13f6_0111_1043_8077,
- &pci_ss_info_13f6_0111_1043_80e2,
- &pci_ss_info_13f6_0111_13f6_0111,
- &pci_ss_info_13f6_0111_1681_a000,
- NULL
-};
-#define pci_ss_list_13f6_0211 NULL
-#endif
-#define pci_ss_list_13fe_1756 NULL
-#define pci_ss_list_1400_1401 NULL
-#define pci_ss_list_1407_0100 NULL
-#define pci_ss_list_1407_0101 NULL
-#define pci_ss_list_1407_0102 NULL
-#define pci_ss_list_1407_0200 NULL
-#define pci_ss_list_1407_0201 NULL
-#define pci_ss_list_1407_0202 NULL
-#define pci_ss_list_1407_0500 NULL
-#define pci_ss_list_1407_0600 NULL
-#define pci_ss_list_1407_8000 NULL
-#define pci_ss_list_1407_8001 NULL
-#define pci_ss_list_1407_8002 NULL
-#define pci_ss_list_1407_8003 NULL
-#define pci_ss_list_1407_8800 NULL
-#define pci_ss_list_1409_7168 NULL
-#define pci_ss_list_1412_1712 NULL
-#define pci_ss_list_1412_1724 NULL
-#define pci_ss_list_1415_8403 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1415_9501[] = {
- &pci_ss_info_1415_9501_15ed_2000,
- &pci_ss_info_1415_9501_15ed_2001,
- NULL
-};
-#define pci_ss_list_1415_950a NULL
-#define pci_ss_list_1415_950b NULL
-static const pciSubsystemInfo *pci_ss_list_1415_9511[] = {
- &pci_ss_info_1415_9511_15ed_2000,
- &pci_ss_info_1415_9511_15ed_2001,
- NULL
-};
-#define pci_ss_list_1415_9521 NULL
-#endif
-#define pci_ss_list_144a_7296 NULL
-#define pci_ss_list_144a_7432 NULL
-#define pci_ss_list_144a_7433 NULL
-#define pci_ss_list_144a_7434 NULL
-#define pci_ss_list_144a_7841 NULL
-#define pci_ss_list_144a_8133 NULL
-#define pci_ss_list_144a_8554 NULL
-#define pci_ss_list_144a_9111 NULL
-#define pci_ss_list_144a_9113 NULL
-#define pci_ss_list_144a_9114 NULL
-#define pci_ss_list_145f_0001 NULL
-#define pci_ss_list_146c_1430 NULL
-#define pci_ss_list_148d_1003 NULL
-#define pci_ss_list_149d_0001 NULL
-#define pci_ss_list_14af_7102 NULL
-#define pci_ss_list_14b3_0000 NULL
-#define pci_ss_list_14b5_0200 NULL
-#define pci_ss_list_14b5_0300 NULL
-#define pci_ss_list_14b5_0400 NULL
-#define pci_ss_list_14b5_0600 NULL
-#define pci_ss_list_14b5_0800 NULL
-#define pci_ss_list_14b5_0900 NULL
-#define pci_ss_list_14b5_0a00 NULL
-#define pci_ss_list_14b5_0b00 NULL
-#define pci_ss_list_14b7_0001 NULL
-#define pci_ss_list_14b9_0001 NULL
-#define pci_ss_list_14b9_0340 NULL
-#define pci_ss_list_14b9_0350 NULL
-#define pci_ss_list_14b9_4500 NULL
-#define pci_ss_list_14b9_4800 NULL
-#define pci_ss_list_14b9_a504 NULL
-#define pci_ss_list_14d2_8001 NULL
-#define pci_ss_list_14d2_8002 NULL
-#define pci_ss_list_14d2_8010 NULL
-#define pci_ss_list_14d2_8011 NULL
-#define pci_ss_list_14d2_8020 NULL
-#define pci_ss_list_14d2_8021 NULL
-#define pci_ss_list_14d2_8040 NULL
-#define pci_ss_list_14d2_8080 NULL
-#define pci_ss_list_14d2_a000 NULL
-#define pci_ss_list_14d2_a001 NULL
-#define pci_ss_list_14d2_a003 NULL
-#define pci_ss_list_14d2_a004 NULL
-#define pci_ss_list_14d2_a005 NULL
-#define pci_ss_list_14d2_e001 NULL
-#define pci_ss_list_14d2_e010 NULL
-#define pci_ss_list_14d2_e020 NULL
-#define pci_ss_list_14db_2120 NULL
-#define pci_ss_list_14dc_0000 NULL
-#define pci_ss_list_14dc_0001 NULL
-#define pci_ss_list_14dc_0002 NULL
-#define pci_ss_list_14dc_0003 NULL
-#define pci_ss_list_14dc_0004 NULL
-#define pci_ss_list_14dc_0005 NULL
-#define pci_ss_list_14dc_0006 NULL
-#define pci_ss_list_14dc_0007 NULL
-#define pci_ss_list_14dc_0008 NULL
-#define pci_ss_list_14dc_0009 NULL
-#define pci_ss_list_14dc_000a NULL
-#define pci_ss_list_14dc_000b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14e4_1644[] = {
- &pci_ss_info_14e4_1644_1014_0277,
- &pci_ss_info_14e4_1644_1028_00d1,
- &pci_ss_info_14e4_1644_1028_0106,
- &pci_ss_info_14e4_1644_1028_0109,
- &pci_ss_info_14e4_1644_1028_010a,
- &pci_ss_info_14e4_1644_10b7_1000,
- &pci_ss_info_14e4_1644_10b7_1001,
- &pci_ss_info_14e4_1644_10b7_1002,
- &pci_ss_info_14e4_1644_10b7_1003,
- &pci_ss_info_14e4_1644_10b7_1004,
- &pci_ss_info_14e4_1644_10b7_1005,
- &pci_ss_info_14e4_1644_10b7_1008,
- &pci_ss_info_14e4_1644_14e4_0002,
- &pci_ss_info_14e4_1644_14e4_0003,
- &pci_ss_info_14e4_1644_14e4_0004,
- &pci_ss_info_14e4_1644_14e4_1028,
- &pci_ss_info_14e4_1644_14e4_1644,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_1645[] = {
- &pci_ss_info_14e4_1645_0e11_007c,
- &pci_ss_info_14e4_1645_0e11_007d,
- &pci_ss_info_14e4_1645_0e11_0085,
- &pci_ss_info_14e4_1645_0e11_0099,
- &pci_ss_info_14e4_1645_0e11_009a,
- &pci_ss_info_14e4_1645_0e11_00c1,
- &pci_ss_info_14e4_1645_1028_0121,
- &pci_ss_info_14e4_1645_10a9_8010,
- &pci_ss_info_14e4_1645_10a9_8011,
- &pci_ss_info_14e4_1645_10a9_8012,
- &pci_ss_info_14e4_1645_10b7_1004,
- &pci_ss_info_14e4_1645_10b7_1006,
- &pci_ss_info_14e4_1645_10b7_1007,
- &pci_ss_info_14e4_1645_10b7_1008,
- &pci_ss_info_14e4_1645_14e4_0001,
- &pci_ss_info_14e4_1645_14e4_0005,
- &pci_ss_info_14e4_1645_14e4_0006,
- &pci_ss_info_14e4_1645_14e4_0007,
- &pci_ss_info_14e4_1645_14e4_0008,
- &pci_ss_info_14e4_1645_14e4_8008,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_1646[] = {
- &pci_ss_info_14e4_1646_0e11_00bb,
- &pci_ss_info_14e4_1646_1028_0126,
- &pci_ss_info_14e4_1646_14e4_8009,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_1647[] = {
- &pci_ss_info_14e4_1647_0e11_0099,
- &pci_ss_info_14e4_1647_0e11_009a,
- &pci_ss_info_14e4_1647_10a9_8010,
- &pci_ss_info_14e4_1647_14e4_0009,
- &pci_ss_info_14e4_1647_14e4_000a,
- &pci_ss_info_14e4_1647_14e4_000b,
- &pci_ss_info_14e4_1647_14e4_8009,
- &pci_ss_info_14e4_1647_14e4_800a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_1648[] = {
- &pci_ss_info_14e4_1648_0e11_00cf,
- &pci_ss_info_14e4_1648_0e11_00d0,
- &pci_ss_info_14e4_1648_0e11_00d1,
- &pci_ss_info_14e4_1648_10b7_2000,
- &pci_ss_info_14e4_1648_10b7_3000,
- &pci_ss_info_14e4_1648_1166_1648,
- NULL
-};
-#define pci_ss_list_14e4_164d NULL
-#define pci_ss_list_14e4_1653 NULL
-#define pci_ss_list_14e4_165d NULL
-static const pciSubsystemInfo *pci_ss_list_14e4_1696[] = {
- &pci_ss_info_14e4_1696_14e4_000d,
- NULL
-};
-#define pci_ss_list_14e4_169c NULL
-static const pciSubsystemInfo *pci_ss_list_14e4_16a6[] = {
- &pci_ss_info_14e4_16a6_0e11_00bb,
- &pci_ss_info_14e4_16a6_1028_0126,
- &pci_ss_info_14e4_16a6_14e4_000c,
- &pci_ss_info_14e4_16a6_14e4_8009,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_16a7[] = {
- &pci_ss_info_14e4_16a7_0e11_00ca,
- &pci_ss_info_14e4_16a7_0e11_00cb,
- &pci_ss_info_14e4_16a7_14e4_0009,
- &pci_ss_info_14e4_16a7_14e4_000a,
- &pci_ss_info_14e4_16a7_14e4_000b,
- &pci_ss_info_14e4_16a7_14e4_800a,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_16a8[] = {
- &pci_ss_info_14e4_16a8_10b7_2001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_16c6[] = {
- &pci_ss_info_14e4_16c6_10b7_1100,
- &pci_ss_info_14e4_16c6_14e4_000c,
- &pci_ss_info_14e4_16c6_14e4_8009,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14e4_16c7[] = {
- &pci_ss_info_14e4_16c7_14e4_0009,
- &pci_ss_info_14e4_16c7_14e4_000a,
- NULL
-};
-#define pci_ss_list_14e4_4210 NULL
-#define pci_ss_list_14e4_4211 NULL
-#define pci_ss_list_14e4_4212 NULL
-#define pci_ss_list_14e4_4301 NULL
-#define pci_ss_list_14e4_4320 NULL
-static const pciSubsystemInfo *pci_ss_list_14e4_4401[] = {
- &pci_ss_info_14e4_4401_1043_80a8,
- NULL
-};
-#define pci_ss_list_14e4_4402 NULL
-#define pci_ss_list_14e4_4410 NULL
-#define pci_ss_list_14e4_4411 NULL
-#define pci_ss_list_14e4_4412 NULL
-#define pci_ss_list_14e4_5820 NULL
-#define pci_ss_list_14e4_5821 NULL
-#endif
-#define pci_ss_list_14ea_ab06 NULL
-#define pci_ss_list_14f1_1002 NULL
-#define pci_ss_list_14f1_1003 NULL
-#define pci_ss_list_14f1_1004 NULL
-#define pci_ss_list_14f1_1005 NULL
-#define pci_ss_list_14f1_1006 NULL
-#define pci_ss_list_14f1_1022 NULL
-#define pci_ss_list_14f1_1023 NULL
-#define pci_ss_list_14f1_1024 NULL
-#define pci_ss_list_14f1_1025 NULL
-#define pci_ss_list_14f1_1026 NULL
-#define pci_ss_list_14f1_1032 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14f1_1033[] = {
- &pci_ss_info_14f1_1033_1033_8077,
- &pci_ss_info_14f1_1033_122d_4027,
- &pci_ss_info_14f1_1033_122d_4030,
- &pci_ss_info_14f1_1033_122d_4034,
- &pci_ss_info_14f1_1033_13e0_020d,
- &pci_ss_info_14f1_1033_13e0_020e,
- &pci_ss_info_14f1_1033_13e0_0261,
- &pci_ss_info_14f1_1033_13e0_0290,
- &pci_ss_info_14f1_1033_13e0_02a0,
- &pci_ss_info_14f1_1033_13e0_02b0,
- &pci_ss_info_14f1_1033_13e0_02c0,
- &pci_ss_info_14f1_1033_13e0_02d0,
- &pci_ss_info_14f1_1033_144f_1500,
- &pci_ss_info_14f1_1033_144f_1501,
- &pci_ss_info_14f1_1033_144f_150a,
- &pci_ss_info_14f1_1033_144f_150b,
- &pci_ss_info_14f1_1033_144f_1510,
- NULL
-};
-#define pci_ss_list_14f1_1034 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_1035[] = {
- &pci_ss_info_14f1_1035_10cf_1098,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14f1_1036[] = {
- &pci_ss_info_14f1_1036_104d_8067,
- &pci_ss_info_14f1_1036_122d_4029,
- &pci_ss_info_14f1_1036_122d_4031,
- &pci_ss_info_14f1_1036_13e0_0209,
- &pci_ss_info_14f1_1036_13e0_020a,
- &pci_ss_info_14f1_1036_13e0_0260,
- &pci_ss_info_14f1_1036_13e0_0270,
- NULL
-};
-#define pci_ss_list_14f1_1052 NULL
-#define pci_ss_list_14f1_1053 NULL
-#define pci_ss_list_14f1_1054 NULL
-#define pci_ss_list_14f1_1055 NULL
-#define pci_ss_list_14f1_1056 NULL
-#define pci_ss_list_14f1_1057 NULL
-#define pci_ss_list_14f1_1059 NULL
-#define pci_ss_list_14f1_1063 NULL
-#define pci_ss_list_14f1_1064 NULL
-#define pci_ss_list_14f1_1065 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_1066[] = {
- &pci_ss_info_14f1_1066_122d_4033,
- NULL
-};
-#define pci_ss_list_14f1_1433 NULL
-#define pci_ss_list_14f1_1434 NULL
-#define pci_ss_list_14f1_1435 NULL
-#define pci_ss_list_14f1_1436 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_1453[] = {
- &pci_ss_info_14f1_1453_13e0_0240,
- &pci_ss_info_14f1_1453_13e0_0250,
- &pci_ss_info_14f1_1453_144f_1502,
- &pci_ss_info_14f1_1453_144f_1503,
- NULL
-};
-#define pci_ss_list_14f1_1454 NULL
-#define pci_ss_list_14f1_1455 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_1456[] = {
- &pci_ss_info_14f1_1456_122d_4035,
- &pci_ss_info_14f1_1456_122d_4302,
- NULL
-};
-#define pci_ss_list_14f1_1610 NULL
-#define pci_ss_list_14f1_1611 NULL
-#define pci_ss_list_14f1_1620 NULL
-#define pci_ss_list_14f1_1621 NULL
-#define pci_ss_list_14f1_1622 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_1803[] = {
- &pci_ss_info_14f1_1803_0e11_0023,
- &pci_ss_info_14f1_1803_0e11_0043,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_14f1_1815[] = {
- &pci_ss_info_14f1_1815_0e11_0022,
- &pci_ss_info_14f1_1815_0e11_0042,
- NULL
-};
-#define pci_ss_list_14f1_2003 NULL
-#define pci_ss_list_14f1_2004 NULL
-#define pci_ss_list_14f1_2005 NULL
-#define pci_ss_list_14f1_2006 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_2013[] = {
- &pci_ss_info_14f1_2013_0e11_b195,
- &pci_ss_info_14f1_2013_0e11_b196,
- &pci_ss_info_14f1_2013_0e11_b1be,
- &pci_ss_info_14f1_2013_1025_8013,
- &pci_ss_info_14f1_2013_1033_809d,
- &pci_ss_info_14f1_2013_1033_80bc,
- &pci_ss_info_14f1_2013_155d_6793,
- &pci_ss_info_14f1_2013_155d_8850,
- NULL
-};
-#define pci_ss_list_14f1_2014 NULL
-#define pci_ss_list_14f1_2015 NULL
-#define pci_ss_list_14f1_2016 NULL
-#define pci_ss_list_14f1_2043 NULL
-#define pci_ss_list_14f1_2044 NULL
-#define pci_ss_list_14f1_2045 NULL
-#define pci_ss_list_14f1_2046 NULL
-#define pci_ss_list_14f1_2063 NULL
-#define pci_ss_list_14f1_2064 NULL
-#define pci_ss_list_14f1_2065 NULL
-#define pci_ss_list_14f1_2066 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_2093[] = {
- &pci_ss_info_14f1_2093_155d_2f07,
- NULL
-};
-#define pci_ss_list_14f1_2143 NULL
-#define pci_ss_list_14f1_2144 NULL
-#define pci_ss_list_14f1_2145 NULL
-#define pci_ss_list_14f1_2146 NULL
-#define pci_ss_list_14f1_2163 NULL
-#define pci_ss_list_14f1_2164 NULL
-#define pci_ss_list_14f1_2165 NULL
-#define pci_ss_list_14f1_2166 NULL
-#define pci_ss_list_14f1_2343 NULL
-#define pci_ss_list_14f1_2344 NULL
-#define pci_ss_list_14f1_2345 NULL
-#define pci_ss_list_14f1_2346 NULL
-#define pci_ss_list_14f1_2363 NULL
-#define pci_ss_list_14f1_2364 NULL
-#define pci_ss_list_14f1_2365 NULL
-#define pci_ss_list_14f1_2366 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_2443[] = {
- &pci_ss_info_14f1_2443_104d_8075,
- &pci_ss_info_14f1_2443_104d_8083,
- &pci_ss_info_14f1_2443_104d_8097,
- NULL
-};
-#define pci_ss_list_14f1_2444 NULL
-#define pci_ss_list_14f1_2445 NULL
-#define pci_ss_list_14f1_2446 NULL
-#define pci_ss_list_14f1_2463 NULL
-#define pci_ss_list_14f1_2464 NULL
-#define pci_ss_list_14f1_2465 NULL
-#define pci_ss_list_14f1_2466 NULL
-static const pciSubsystemInfo *pci_ss_list_14f1_2f00[] = {
- &pci_ss_info_14f1_2f00_13e0_8d84,
- &pci_ss_info_14f1_2f00_13e0_8d85,
- &pci_ss_info_14f1_2f00_14f1_2004,
- NULL
-};
-#define pci_ss_list_14f1_8234 NULL
-#endif
-#define pci_ss_list_1507_0001 NULL
-#define pci_ss_list_1507_0002 NULL
-#define pci_ss_list_1507_0003 NULL
-#define pci_ss_list_1507_0100 NULL
-#define pci_ss_list_1507_0431 NULL
-#define pci_ss_list_1507_4801 NULL
-#define pci_ss_list_1507_4802 NULL
-#define pci_ss_list_1507_4803 NULL
-#define pci_ss_list_1507_4806 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1516_0803[] = {
- &pci_ss_info_1516_0803_1320_10bd,
- NULL
-};
-#endif
-#define pci_ss_list_151a_1002 NULL
-#define pci_ss_list_151a_1004 NULL
-#define pci_ss_list_151a_1008 NULL
-#define pci_ss_list_151f_0000 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1522_0100[] = {
- &pci_ss_info_1522_0100_1522_0200,
- &pci_ss_info_1522_0100_1522_0300,
- &pci_ss_info_1522_0100_1522_0400,
- &pci_ss_info_1522_0100_1522_0500,
- &pci_ss_info_1522_0100_1522_0600,
- &pci_ss_info_1522_0100_1522_0700,
- &pci_ss_info_1522_0100_1522_0800,
- NULL
-};
-#endif
-#define pci_ss_list_1524_1211 NULL
-#define pci_ss_list_1524_1225 NULL
-#define pci_ss_list_1524_1410 NULL
-#define pci_ss_list_1524_1420 NULL
-#define pci_ss_list_1543_3052 NULL
-#define pci_ss_list_1543_4c22 NULL
-#define pci_ss_list_1571_a001 NULL
-#define pci_ss_list_1571_a002 NULL
-#define pci_ss_list_1571_a003 NULL
-#define pci_ss_list_1571_a004 NULL
-#define pci_ss_list_1571_a005 NULL
-#define pci_ss_list_1571_a006 NULL
-#define pci_ss_list_1571_a007 NULL
-#define pci_ss_list_1571_a008 NULL
-#define pci_ss_list_1571_a009 NULL
-#define pci_ss_list_1571_a00a NULL
-#define pci_ss_list_1571_a00b NULL
-#define pci_ss_list_1571_a00c NULL
-#define pci_ss_list_1571_a00d NULL
-#define pci_ss_list_1571_a201 NULL
-#define pci_ss_list_1571_a202 NULL
-#define pci_ss_list_1571_a203 NULL
-#define pci_ss_list_1571_a204 NULL
-#define pci_ss_list_1571_a205 NULL
-#define pci_ss_list_1571_a206 NULL
-#define pci_ss_list_157c_8001 NULL
-#define pci_ss_list_1592_0781 NULL
-#define pci_ss_list_1592_0782 NULL
-#define pci_ss_list_1592_0783 NULL
-#define pci_ss_list_1592_0785 NULL
-#define pci_ss_list_1592_0786 NULL
-#define pci_ss_list_1592_0787 NULL
-#define pci_ss_list_1592_0788 NULL
-#define pci_ss_list_1592_078a NULL
-#define pci_ss_list_15a2_0001 NULL
-#define pci_ss_list_15ad_0710 NULL
-#define pci_ss_list_15b3_5274 NULL
-#define pci_ss_list_15bc_2929 NULL
-#define pci_ss_list_15c7_0349 NULL
-#define pci_ss_list_15dc_0001 NULL
-#define pci_ss_list_15e8_0130 NULL
-#define pci_ss_list_1619_0400 NULL
-#define pci_ss_list_1619_0440 NULL
-#define pci_ss_list_1629_1003 NULL
-#define pci_ss_list_1629_2002 NULL
-#define pci_ss_list_1638_1100 NULL
-#define pci_ss_list_163c_3052 NULL
-#define pci_ss_list_163c_5449 NULL
-#define pci_ss_list_165a_c100 NULL
-#define pci_ss_list_165a_d200 NULL
-#define pci_ss_list_165a_d300 NULL
-#define pci_ss_list_16ab_1102 NULL
-#define pci_ss_list_16ca_0001 NULL
-#define pci_ss_list_16ec_3685 NULL
-#define pci_ss_list_173b_03e8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_173b_03ea[] = {
- &pci_ss_info_173b_03ea_173b_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1743_8139 NULL
-#define pci_ss_list_1796_0001 NULL
-#define pci_ss_list_1796_0002 NULL
-#define pci_ss_list_1796_0003 NULL
-#define pci_ss_list_1796_0004 NULL
-#define pci_ss_list_1796_0005 NULL
-#define pci_ss_list_1796_0006 NULL
-#define pci_ss_list_17cc_2280 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1813_4000[] = {
- &pci_ss_info_1813_4000_16be_0001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1813_4100[] = {
- &pci_ss_info_1813_4100_16be_0002,
- NULL
-};
-#endif
-#define pci_ss_list_1888_0301 NULL
-#define pci_ss_list_1888_0601 NULL
-#define pci_ss_list_1888_0710 NULL
-#define pci_ss_list_1888_0720 NULL
-#define pci_ss_list_1a08_0000 NULL
-#define pci_ss_list_1c1c_0001 NULL
-#define pci_ss_list_1d44_a400 NULL
-#define pci_ss_list_1de1_0391 NULL
-#define pci_ss_list_1de1_2020 NULL
-#define pci_ss_list_1de1_690c NULL
-#define pci_ss_list_1de1_dc29 NULL
-#define pci_ss_list_1fc0_0300 NULL
-#define pci_ss_list_2348_2010 NULL
-#define pci_ss_list_3388_0013 NULL
-#define pci_ss_list_3388_0014 NULL
-#define pci_ss_list_3388_0021 NULL
-#define pci_ss_list_3388_101a NULL
-#define pci_ss_list_3388_101b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_3388_8011[] = {
- &pci_ss_info_3388_8011_3388_8011,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_3388_8012[] = {
- &pci_ss_info_3388_8012_3388_8012,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_3388_8013[] = {
- &pci_ss_info_3388_8013_3388_8013,
- NULL
-};
-#endif
-#define pci_ss_list_3d3d_0001 NULL
-#define pci_ss_list_3d3d_0002 NULL
-#define pci_ss_list_3d3d_0003 NULL
-#define pci_ss_list_3d3d_0004 NULL
-#define pci_ss_list_3d3d_0005 NULL
-#define pci_ss_list_3d3d_0006 NULL
-#define pci_ss_list_3d3d_0007 NULL
-#define pci_ss_list_3d3d_0008 NULL
-static const pciSubsystemInfo *pci_ss_list_3d3d_0009[] = {
- &pci_ss_info_3d3d_0009_1040_0011,
- &pci_ss_info_3d3d_0009_3d3d_0100,
- &pci_ss_info_3d3d_0009_3d3d_0111,
- &pci_ss_info_3d3d_0009_3d3d_0114,
- &pci_ss_info_3d3d_0009_3d3d_0116,
- &pci_ss_info_3d3d_0009_3d3d_0119,
- &pci_ss_info_3d3d_0009_3d3d_0120,
- &pci_ss_info_3d3d_0009_3d3d_0125,
- &pci_ss_info_3d3d_0009_3d3d_0127,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_3d3d_000a[] = {
- &pci_ss_info_3d3d_000a_3d3d_0121,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_3d3d_000c[] = {
- &pci_ss_info_3d3d_000c_3d3d_0144,
- NULL
-};
-#define pci_ss_list_3d3d_0100 NULL
-#define pci_ss_list_3d3d_1004 NULL
-#define pci_ss_list_3d3d_3d04 NULL
-#define pci_ss_list_3d3d_ffff NULL
-#define pci_ss_list_4005_0300 NULL
-#define pci_ss_list_4005_0308 NULL
-#define pci_ss_list_4005_0309 NULL
-#define pci_ss_list_4005_1064 NULL
-#define pci_ss_list_4005_2064 NULL
-#define pci_ss_list_4005_2128 NULL
-#define pci_ss_list_4005_2301 NULL
-#define pci_ss_list_4005_2302 NULL
-#define pci_ss_list_4005_2303 NULL
-#define pci_ss_list_4005_2364 NULL
-#define pci_ss_list_4005_2464 NULL
-#define pci_ss_list_4005_2501 NULL
-static const pciSubsystemInfo *pci_ss_list_4005_4000[] = {
- &pci_ss_info_4005_4000_4005_4000,
- NULL
-};
-#define pci_ss_list_4005_4710 NULL
-#define pci_ss_list_4033_1360 NULL
-#define pci_ss_list_416c_0100 NULL
-#define pci_ss_list_416c_0200 NULL
-#define pci_ss_list_4444_0803 NULL
-#define pci_ss_list_4916_1960 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_4a14_5000[] = {
- &pci_ss_info_4a14_5000_4a14_5000,
- NULL
-};
-#endif
-#define pci_ss_list_4d51_0200 NULL
-#define pci_ss_list_4ddc_0100 NULL
-#define pci_ss_list_4ddc_0801 NULL
-#define pci_ss_list_4ddc_0802 NULL
-#define pci_ss_list_4ddc_0811 NULL
-#define pci_ss_list_4ddc_0812 NULL
-#define pci_ss_list_4ddc_0881 NULL
-#define pci_ss_list_4ddc_0882 NULL
-#define pci_ss_list_4ddc_0891 NULL
-#define pci_ss_list_4ddc_0892 NULL
-#define pci_ss_list_4ddc_0901 NULL
-#define pci_ss_list_4ddc_0902 NULL
-#define pci_ss_list_4ddc_0903 NULL
-#define pci_ss_list_4ddc_0904 NULL
-#define pci_ss_list_4ddc_0b01 NULL
-#define pci_ss_list_4ddc_0b02 NULL
-#define pci_ss_list_4ddc_0b03 NULL
-#define pci_ss_list_4ddc_0b04 NULL
-#define pci_ss_list_5046_1001 NULL
-#define pci_ss_list_5053_2010 NULL
-#define pci_ss_list_5145_3031 NULL
-#define pci_ss_list_5301_0001 NULL
-#define pci_ss_list_5333_0551 NULL
-#define pci_ss_list_5333_5631 NULL
-#define pci_ss_list_5333_8800 NULL
-#define pci_ss_list_5333_8801 NULL
-#define pci_ss_list_5333_8810 NULL
-#define pci_ss_list_5333_8811 NULL
-#define pci_ss_list_5333_8812 NULL
-#define pci_ss_list_5333_8813 NULL
-#define pci_ss_list_5333_8814 NULL
-#define pci_ss_list_5333_8815 NULL
-#define pci_ss_list_5333_883d NULL
-#define pci_ss_list_5333_8870 NULL
-#define pci_ss_list_5333_8880 NULL
-#define pci_ss_list_5333_8881 NULL
-#define pci_ss_list_5333_8882 NULL
-#define pci_ss_list_5333_8883 NULL
-#define pci_ss_list_5333_88b0 NULL
-#define pci_ss_list_5333_88b1 NULL
-#define pci_ss_list_5333_88b2 NULL
-#define pci_ss_list_5333_88b3 NULL
-#define pci_ss_list_5333_88c0 NULL
-#define pci_ss_list_5333_88c1 NULL
-#define pci_ss_list_5333_88c2 NULL
-#define pci_ss_list_5333_88c3 NULL
-#define pci_ss_list_5333_88d0 NULL
-#define pci_ss_list_5333_88d1 NULL
-#define pci_ss_list_5333_88d2 NULL
-#define pci_ss_list_5333_88d3 NULL
-#define pci_ss_list_5333_88f0 NULL
-#define pci_ss_list_5333_88f1 NULL
-#define pci_ss_list_5333_88f2 NULL
-#define pci_ss_list_5333_88f3 NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8900[] = {
- &pci_ss_info_5333_8900_5333_8900,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8901[] = {
- &pci_ss_info_5333_8901_5333_8901,
- NULL
-};
-#define pci_ss_list_5333_8902 NULL
-#define pci_ss_list_5333_8903 NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8904[] = {
- &pci_ss_info_5333_8904_1014_00db,
- &pci_ss_info_5333_8904_5333_8904,
- NULL
-};
-#define pci_ss_list_5333_8905 NULL
-#define pci_ss_list_5333_8906 NULL
-#define pci_ss_list_5333_8907 NULL
-#define pci_ss_list_5333_8908 NULL
-#define pci_ss_list_5333_8909 NULL
-#define pci_ss_list_5333_890a NULL
-#define pci_ss_list_5333_890b NULL
-#define pci_ss_list_5333_890c NULL
-#define pci_ss_list_5333_890d NULL
-#define pci_ss_list_5333_890e NULL
-#define pci_ss_list_5333_890f NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8a01[] = {
- &pci_ss_info_5333_8a01_0e11_b032,
- &pci_ss_info_5333_8a01_10b4_1617,
- &pci_ss_info_5333_8a01_10b4_1717,
- &pci_ss_info_5333_8a01_5333_8a01,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8a10[] = {
- &pci_ss_info_5333_8a10_1092_8a10,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8a13[] = {
- &pci_ss_info_5333_8a13_5333_8a13,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8a20[] = {
- &pci_ss_info_5333_8a20_5333_8a20,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8a21[] = {
- &pci_ss_info_5333_8a21_5333_8a21,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8a22[] = {
- &pci_ss_info_5333_8a22_1033_8068,
- &pci_ss_info_5333_8a22_1033_8069,
- &pci_ss_info_5333_8a22_105d_0018,
- &pci_ss_info_5333_8a22_105d_002a,
- &pci_ss_info_5333_8a22_105d_003a,
- &pci_ss_info_5333_8a22_105d_092f,
- &pci_ss_info_5333_8a22_1092_4207,
- &pci_ss_info_5333_8a22_1092_4800,
- &pci_ss_info_5333_8a22_1092_4807,
- &pci_ss_info_5333_8a22_1092_4808,
- &pci_ss_info_5333_8a22_1092_4809,
- &pci_ss_info_5333_8a22_1092_480e,
- &pci_ss_info_5333_8a22_1092_4904,
- &pci_ss_info_5333_8a22_1092_4905,
- &pci_ss_info_5333_8a22_1092_4a09,
- &pci_ss_info_5333_8a22_1092_4a0b,
- &pci_ss_info_5333_8a22_1092_4a0f,
- &pci_ss_info_5333_8a22_1092_4e01,
- &pci_ss_info_5333_8a22_1102_101d,
- &pci_ss_info_5333_8a22_1102_101e,
- &pci_ss_info_5333_8a22_5333_8100,
- &pci_ss_info_5333_8a22_5333_8110,
- &pci_ss_info_5333_8a22_5333_8125,
- &pci_ss_info_5333_8a22_5333_8143,
- &pci_ss_info_5333_8a22_5333_8a22,
- &pci_ss_info_5333_8a22_5333_8a2e,
- &pci_ss_info_5333_8a22_5333_9125,
- &pci_ss_info_5333_8a22_5333_9143,
- NULL
-};
-#define pci_ss_list_5333_8a23 NULL
-#define pci_ss_list_5333_8a25 NULL
-#define pci_ss_list_5333_8a26 NULL
-#define pci_ss_list_5333_8c00 NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8c01[] = {
- &pci_ss_info_5333_8c01_1179_0001,
- NULL
-};
-#define pci_ss_list_5333_8c02 NULL
-#define pci_ss_list_5333_8c03 NULL
-#define pci_ss_list_5333_8c10 NULL
-#define pci_ss_list_5333_8c11 NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8c12[] = {
- &pci_ss_info_5333_8c12_1014_017f,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_5333_8c13[] = {
- &pci_ss_info_5333_8c13_1179_0001,
- NULL
-};
-#define pci_ss_list_5333_8c22 NULL
-#define pci_ss_list_5333_8c24 NULL
-#define pci_ss_list_5333_8c26 NULL
-#define pci_ss_list_5333_8c2a NULL
-#define pci_ss_list_5333_8c2b NULL
-#define pci_ss_list_5333_8c2c NULL
-#define pci_ss_list_5333_8c2d NULL
-static const pciSubsystemInfo *pci_ss_list_5333_8c2e[] = {
- &pci_ss_info_5333_8c2e_1014_01fc,
- NULL
-};
-#define pci_ss_list_5333_8c2f NULL
-#define pci_ss_list_5333_8d01 NULL
-#define pci_ss_list_5333_8d02 NULL
-#define pci_ss_list_5333_8d03 NULL
-#define pci_ss_list_5333_8d04 NULL
-static const pciSubsystemInfo *pci_ss_list_5333_9102[] = {
- &pci_ss_info_5333_9102_1092_5932,
- &pci_ss_info_5333_9102_1092_5934,
- &pci_ss_info_5333_9102_1092_5952,
- &pci_ss_info_5333_9102_1092_5954,
- &pci_ss_info_5333_9102_1092_5a35,
- &pci_ss_info_5333_9102_1092_5a37,
- &pci_ss_info_5333_9102_1092_5a55,
- &pci_ss_info_5333_9102_1092_5a57,
- NULL
-};
-#define pci_ss_list_5333_ca00 NULL
-#define pci_ss_list_544c_0350 NULL
-#define pci_ss_list_5455_4458 NULL
-#define pci_ss_list_5544_0001 NULL
-#define pci_ss_list_5555_0003 NULL
-#define pci_ss_list_6374_6773 NULL
-#define pci_ss_list_6666_0001 NULL
-#define pci_ss_list_6666_0002 NULL
-#define pci_ss_list_8008_0010 NULL
-#define pci_ss_list_8008_0011 NULL
-#define pci_ss_list_8086_0007 NULL
-#define pci_ss_list_8086_0008 NULL
-#define pci_ss_list_8086_0039 NULL
-#define pci_ss_list_8086_0122 NULL
-#define pci_ss_list_8086_0482 NULL
-#define pci_ss_list_8086_0483 NULL
-#define pci_ss_list_8086_0484 NULL
-#define pci_ss_list_8086_0486 NULL
-#define pci_ss_list_8086_04a3 NULL
-#define pci_ss_list_8086_04d0 NULL
-#define pci_ss_list_8086_0600 NULL
-#define pci_ss_list_8086_0960 NULL
-#define pci_ss_list_8086_0962 NULL
-#define pci_ss_list_8086_0964 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1000[] = {
- &pci_ss_info_8086_1000_0e11_b0df,
- &pci_ss_info_8086_1000_0e11_b0e0,
- &pci_ss_info_8086_1000_0e11_b123,
- &pci_ss_info_8086_1000_1014_0119,
- &pci_ss_info_8086_1000_8086_1000,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1001[] = {
- &pci_ss_info_8086_1001_0e11_004a,
- &pci_ss_info_8086_1001_1014_01ea,
- &pci_ss_info_8086_1001_8086_1003,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1002[] = {
- &pci_ss_info_8086_1002_8086_200e,
- &pci_ss_info_8086_1002_8086_2013,
- &pci_ss_info_8086_1002_8086_2017,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1004[] = {
- &pci_ss_info_8086_1004_0e11_0049,
- &pci_ss_info_8086_1004_0e11_b1a4,
- &pci_ss_info_8086_1004_1014_10f2,
- &pci_ss_info_8086_1004_8086_1004,
- &pci_ss_info_8086_1004_8086_2004,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1008[] = {
- &pci_ss_info_8086_1008_8086_1107,
- &pci_ss_info_8086_1008_8086_2107,
- &pci_ss_info_8086_1008_8086_2110,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1009[] = {
- &pci_ss_info_8086_1009_8086_1109,
- &pci_ss_info_8086_1009_8086_2109,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_100c[] = {
- &pci_ss_info_8086_100c_8086_1112,
- &pci_ss_info_8086_100c_8086_2112,
- NULL
-};
-#define pci_ss_list_8086_100d NULL
-static const pciSubsystemInfo *pci_ss_list_8086_100e[] = {
- &pci_ss_info_8086_100e_8086_001e,
- &pci_ss_info_8086_100e_8086_002e,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_100f[] = {
- &pci_ss_info_8086_100f_8086_1001,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1010[] = {
- &pci_ss_info_8086_1010_8086_1011,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1011[] = {
- &pci_ss_info_8086_1011_8086_1002,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1012[] = {
- &pci_ss_info_8086_1012_8086_1012,
- NULL
-};
-#define pci_ss_list_8086_1015 NULL
-#define pci_ss_list_8086_1029 NULL
-#define pci_ss_list_8086_1030 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1031[] = {
- &pci_ss_info_8086_1031_1014_0209,
- &pci_ss_info_8086_1031_104d_80e7,
- &pci_ss_info_8086_1031_107b_5350,
- &pci_ss_info_8086_1031_1179_0001,
- &pci_ss_info_8086_1031_144d_c000,
- &pci_ss_info_8086_1031_144d_c001,
- &pci_ss_info_8086_1031_144d_c003,
- &pci_ss_info_8086_1031_144d_c006,
- NULL
-};
-#define pci_ss_list_8086_1032 NULL
-#define pci_ss_list_8086_1033 NULL
-#define pci_ss_list_8086_1034 NULL
-#define pci_ss_list_8086_1035 NULL
-#define pci_ss_list_8086_1036 NULL
-#define pci_ss_list_8086_1037 NULL
-#define pci_ss_list_8086_1038 NULL
-#define pci_ss_list_8086_1039 NULL
-#define pci_ss_list_8086_103a NULL
-#define pci_ss_list_8086_103b NULL
-#define pci_ss_list_8086_103c NULL
-#define pci_ss_list_8086_103d NULL
-#define pci_ss_list_8086_103e NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1040[] = {
- &pci_ss_info_8086_1040_16be_1040,
- NULL
-};
-#define pci_ss_list_8086_1043 NULL
-#define pci_ss_list_8086_1059 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1130[] = {
- &pci_ss_info_8086_1130_1025_1016,
- &pci_ss_info_8086_1130_1043_8027,
- &pci_ss_info_8086_1130_104d_80df,
- &pci_ss_info_8086_1130_8086_4532,
- &pci_ss_info_8086_1130_8086_4557,
- NULL
-};
-#define pci_ss_list_8086_1131 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1132[] = {
- &pci_ss_info_8086_1132_1025_1016,
- &pci_ss_info_8086_1132_104d_80df,
- &pci_ss_info_8086_1132_8086_4532,
- &pci_ss_info_8086_1132_8086_4557,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1161[] = {
- &pci_ss_info_8086_1161_8086_1161,
- NULL
-};
-#define pci_ss_list_8086_1162 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1200[] = {
- &pci_ss_info_8086_1200_172a_0000,
- NULL
-};
-#define pci_ss_list_8086_1209 NULL
-#define pci_ss_list_8086_1221 NULL
-#define pci_ss_list_8086_1222 NULL
-#define pci_ss_list_8086_1223 NULL
-#define pci_ss_list_8086_1225 NULL
-#define pci_ss_list_8086_1226 NULL
-#define pci_ss_list_8086_1227 NULL
-#define pci_ss_list_8086_1228 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1229[] = {
- &pci_ss_info_8086_1229_0e11_3001,
- &pci_ss_info_8086_1229_0e11_3002,
- &pci_ss_info_8086_1229_0e11_3003,
- &pci_ss_info_8086_1229_0e11_3004,
- &pci_ss_info_8086_1229_0e11_3005,
- &pci_ss_info_8086_1229_0e11_3006,
- &pci_ss_info_8086_1229_0e11_3007,
- &pci_ss_info_8086_1229_0e11_b01e,
- &pci_ss_info_8086_1229_0e11_b01f,
- &pci_ss_info_8086_1229_0e11_b02f,
- &pci_ss_info_8086_1229_0e11_b04a,
- &pci_ss_info_8086_1229_0e11_b0c6,
- &pci_ss_info_8086_1229_0e11_b0c7,
- &pci_ss_info_8086_1229_0e11_b0d7,
- &pci_ss_info_8086_1229_0e11_b0dd,
- &pci_ss_info_8086_1229_0e11_b0de,
- &pci_ss_info_8086_1229_0e11_b0e1,
- &pci_ss_info_8086_1229_0e11_b134,
- &pci_ss_info_8086_1229_0e11_b13c,
- &pci_ss_info_8086_1229_0e11_b144,
- &pci_ss_info_8086_1229_0e11_b163,
- &pci_ss_info_8086_1229_0e11_b164,
- &pci_ss_info_8086_1229_0e11_b1a4,
- &pci_ss_info_8086_1229_1014_005c,
- &pci_ss_info_8086_1229_1014_01bc,
- &pci_ss_info_8086_1229_1014_01f1,
- &pci_ss_info_8086_1229_1014_01f2,
- &pci_ss_info_8086_1229_1014_0207,
- &pci_ss_info_8086_1229_1014_0232,
- &pci_ss_info_8086_1229_1014_023a,
- &pci_ss_info_8086_1229_1014_105c,
- &pci_ss_info_8086_1229_1014_2205,
- &pci_ss_info_8086_1229_1014_305c,
- &pci_ss_info_8086_1229_1014_405c,
- &pci_ss_info_8086_1229_1014_505c,
- &pci_ss_info_8086_1229_1014_605c,
- &pci_ss_info_8086_1229_1014_705c,
- &pci_ss_info_8086_1229_1014_805c,
- &pci_ss_info_8086_1229_1028_009b,
- &pci_ss_info_8086_1229_1033_8000,
- &pci_ss_info_8086_1229_1033_8016,
- &pci_ss_info_8086_1229_1033_801f,
- &pci_ss_info_8086_1229_1033_8026,
- &pci_ss_info_8086_1229_1033_8063,
- &pci_ss_info_8086_1229_1033_8064,
- &pci_ss_info_8086_1229_103c_10c0,
- &pci_ss_info_8086_1229_103c_10c3,
- &pci_ss_info_8086_1229_103c_10ca,
- &pci_ss_info_8086_1229_103c_10cb,
- &pci_ss_info_8086_1229_103c_10e3,
- &pci_ss_info_8086_1229_103c_10e4,
- &pci_ss_info_8086_1229_103c_1200,
- &pci_ss_info_8086_1229_10c3_1100,
- &pci_ss_info_8086_1229_10cf_1115,
- &pci_ss_info_8086_1229_10cf_1143,
- &pci_ss_info_8086_1229_1179_0001,
- &pci_ss_info_8086_1229_1179_0002,
- &pci_ss_info_8086_1229_1179_0003,
- &pci_ss_info_8086_1229_1259_2560,
- &pci_ss_info_8086_1229_1259_2561,
- &pci_ss_info_8086_1229_1266_0001,
- &pci_ss_info_8086_1229_144d_2501,
- &pci_ss_info_8086_1229_144d_2502,
- &pci_ss_info_8086_1229_1668_1100,
- &pci_ss_info_8086_1229_8086_0001,
- &pci_ss_info_8086_1229_8086_0002,
- &pci_ss_info_8086_1229_8086_0003,
- &pci_ss_info_8086_1229_8086_0004,
- &pci_ss_info_8086_1229_8086_0005,
- &pci_ss_info_8086_1229_8086_0006,
- &pci_ss_info_8086_1229_8086_0007,
- &pci_ss_info_8086_1229_8086_0008,
- &pci_ss_info_8086_1229_8086_0009,
- &pci_ss_info_8086_1229_8086_000a,
- &pci_ss_info_8086_1229_8086_000b,
- &pci_ss_info_8086_1229_8086_000c,
- &pci_ss_info_8086_1229_8086_000d,
- &pci_ss_info_8086_1229_8086_000e,
- &pci_ss_info_8086_1229_8086_000f,
- &pci_ss_info_8086_1229_8086_0010,
- &pci_ss_info_8086_1229_8086_0011,
- &pci_ss_info_8086_1229_8086_0012,
- &pci_ss_info_8086_1229_8086_0013,
- &pci_ss_info_8086_1229_8086_0030,
- &pci_ss_info_8086_1229_8086_0031,
- &pci_ss_info_8086_1229_8086_0040,
- &pci_ss_info_8086_1229_8086_0041,
- &pci_ss_info_8086_1229_8086_0042,
- &pci_ss_info_8086_1229_8086_0050,
- &pci_ss_info_8086_1229_8086_1009,
- &pci_ss_info_8086_1229_8086_100c,
- &pci_ss_info_8086_1229_8086_1012,
- &pci_ss_info_8086_1229_8086_1013,
- &pci_ss_info_8086_1229_8086_1015,
- &pci_ss_info_8086_1229_8086_1017,
- &pci_ss_info_8086_1229_8086_1030,
- &pci_ss_info_8086_1229_8086_1040,
- &pci_ss_info_8086_1229_8086_1041,
- &pci_ss_info_8086_1229_8086_1042,
- &pci_ss_info_8086_1229_8086_1050,
- &pci_ss_info_8086_1229_8086_1051,
- &pci_ss_info_8086_1229_8086_1052,
- &pci_ss_info_8086_1229_8086_10f0,
- &pci_ss_info_8086_1229_8086_2009,
- &pci_ss_info_8086_1229_8086_200d,
- &pci_ss_info_8086_1229_8086_200e,
- &pci_ss_info_8086_1229_8086_200f,
- &pci_ss_info_8086_1229_8086_2010,
- &pci_ss_info_8086_1229_8086_2013,
- &pci_ss_info_8086_1229_8086_2016,
- &pci_ss_info_8086_1229_8086_2017,
- &pci_ss_info_8086_1229_8086_2018,
- &pci_ss_info_8086_1229_8086_2019,
- &pci_ss_info_8086_1229_8086_2101,
- &pci_ss_info_8086_1229_8086_2102,
- &pci_ss_info_8086_1229_8086_2103,
- &pci_ss_info_8086_1229_8086_2104,
- &pci_ss_info_8086_1229_8086_2105,
- &pci_ss_info_8086_1229_8086_2106,
- &pci_ss_info_8086_1229_8086_2107,
- &pci_ss_info_8086_1229_8086_2108,
- &pci_ss_info_8086_1229_8086_2200,
- &pci_ss_info_8086_1229_8086_2201,
- &pci_ss_info_8086_1229_8086_2202,
- &pci_ss_info_8086_1229_8086_2203,
- &pci_ss_info_8086_1229_8086_2204,
- &pci_ss_info_8086_1229_8086_2205,
- &pci_ss_info_8086_1229_8086_2206,
- &pci_ss_info_8086_1229_8086_2207,
- &pci_ss_info_8086_1229_8086_2208,
- &pci_ss_info_8086_1229_8086_2402,
- &pci_ss_info_8086_1229_8086_2407,
- &pci_ss_info_8086_1229_8086_2408,
- &pci_ss_info_8086_1229_8086_2409,
- &pci_ss_info_8086_1229_8086_240f,
- &pci_ss_info_8086_1229_8086_2410,
- &pci_ss_info_8086_1229_8086_2411,
- &pci_ss_info_8086_1229_8086_2412,
- &pci_ss_info_8086_1229_8086_2413,
- &pci_ss_info_8086_1229_8086_3000,
- &pci_ss_info_8086_1229_8086_3001,
- &pci_ss_info_8086_1229_8086_3002,
- &pci_ss_info_8086_1229_8086_3006,
- &pci_ss_info_8086_1229_8086_3007,
- &pci_ss_info_8086_1229_8086_3008,
- &pci_ss_info_8086_1229_8086_3010,
- &pci_ss_info_8086_1229_8086_3011,
- &pci_ss_info_8086_1229_8086_3012,
- NULL
-};
-#define pci_ss_list_8086_122d NULL
-#define pci_ss_list_8086_122e NULL
-#define pci_ss_list_8086_1230 NULL
-#define pci_ss_list_8086_1231 NULL
-#define pci_ss_list_8086_1234 NULL
-#define pci_ss_list_8086_1235 NULL
-#define pci_ss_list_8086_1237 NULL
-#define pci_ss_list_8086_1239 NULL
-#define pci_ss_list_8086_123b NULL
-#define pci_ss_list_8086_123c NULL
-#define pci_ss_list_8086_123d NULL
-#define pci_ss_list_8086_123f NULL
-#define pci_ss_list_8086_1240 NULL
-#define pci_ss_list_8086_124b NULL
-#define pci_ss_list_8086_1250 NULL
-#define pci_ss_list_8086_1360 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1361[] = {
- &pci_ss_info_8086_1361_8086_1361,
- &pci_ss_info_8086_1361_8086_8000,
- NULL
-};
-#define pci_ss_list_8086_1460 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1461[] = {
- &pci_ss_info_8086_1461_15d9_3480,
- NULL
-};
-#define pci_ss_list_8086_1462 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_1960[] = {
- &pci_ss_info_8086_1960_101e_0431,
- &pci_ss_info_8086_1960_101e_0438,
- &pci_ss_info_8086_1960_101e_0466,
- &pci_ss_info_8086_1960_101e_0467,
- &pci_ss_info_8086_1960_101e_0490,
- &pci_ss_info_8086_1960_101e_0762,
- &pci_ss_info_8086_1960_101e_09a0,
- &pci_ss_info_8086_1960_1028_0467,
- &pci_ss_info_8086_1960_1028_1111,
- &pci_ss_info_8086_1960_103c_03a2,
- &pci_ss_info_8086_1960_103c_10c6,
- &pci_ss_info_8086_1960_103c_10c7,
- &pci_ss_info_8086_1960_103c_10cc,
- &pci_ss_info_8086_1960_103c_10cd,
- &pci_ss_info_8086_1960_105a_0000,
- &pci_ss_info_8086_1960_105a_2168,
- &pci_ss_info_8086_1960_105a_5168,
- &pci_ss_info_8086_1960_1111_1111,
- &pci_ss_info_8086_1960_1111_1112,
- &pci_ss_info_8086_1960_113c_03a2,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_1962[] = {
- &pci_ss_info_8086_1962_105a_0000,
- NULL
-};
-#define pci_ss_list_8086_1a21 NULL
-#define pci_ss_list_8086_1a23 NULL
-#define pci_ss_list_8086_1a24 NULL
-#define pci_ss_list_8086_1a30 NULL
-#define pci_ss_list_8086_1a31 NULL
-#define pci_ss_list_8086_2410 NULL
-#define pci_ss_list_8086_2411 NULL
-#define pci_ss_list_8086_2412 NULL
-#define pci_ss_list_8086_2413 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2415[] = {
- &pci_ss_info_8086_2415_1028_0095,
- &pci_ss_info_8086_2415_11d4_0040,
- &pci_ss_info_8086_2415_11d4_0048,
- &pci_ss_info_8086_2415_11d4_5340,
- NULL
-};
-#define pci_ss_list_8086_2416 NULL
-#define pci_ss_list_8086_2418 NULL
-#define pci_ss_list_8086_2420 NULL
-#define pci_ss_list_8086_2421 NULL
-#define pci_ss_list_8086_2422 NULL
-#define pci_ss_list_8086_2423 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2425[] = {
- &pci_ss_info_8086_2425_11d4_0040,
- &pci_ss_info_8086_2425_11d4_0048,
- NULL
-};
-#define pci_ss_list_8086_2426 NULL
-#define pci_ss_list_8086_2428 NULL
-#define pci_ss_list_8086_2440 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2442[] = {
- &pci_ss_info_8086_2442_1014_01c6,
- &pci_ss_info_8086_2442_1025_1016,
- &pci_ss_info_8086_2442_104d_80df,
- &pci_ss_info_8086_2442_147b_0507,
- &pci_ss_info_8086_2442_8086_4532,
- &pci_ss_info_8086_2442_8086_4557,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2443[] = {
- &pci_ss_info_8086_2443_1014_01c6,
- &pci_ss_info_8086_2443_1025_1016,
- &pci_ss_info_8086_2443_1043_8027,
- &pci_ss_info_8086_2443_104d_80df,
- &pci_ss_info_8086_2443_147b_0507,
- &pci_ss_info_8086_2443_8086_4532,
- &pci_ss_info_8086_2443_8086_4557,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2444[] = {
- &pci_ss_info_8086_2444_1025_1016,
- &pci_ss_info_8086_2444_104d_80df,
- &pci_ss_info_8086_2444_147b_0507,
- &pci_ss_info_8086_2444_8086_4532,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2445[] = {
- &pci_ss_info_8086_2445_1014_01c6,
- &pci_ss_info_8086_2445_1025_1016,
- &pci_ss_info_8086_2445_104d_80df,
- &pci_ss_info_8086_2445_1462_3370,
- &pci_ss_info_8086_2445_147b_0507,
- &pci_ss_info_8086_2445_8086_4557,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2446[] = {
- &pci_ss_info_8086_2446_1025_1016,
- &pci_ss_info_8086_2446_104d_80df,
- NULL
-};
-#define pci_ss_list_8086_2448 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2449[] = {
- &pci_ss_info_8086_2449_0e11_0012,
- &pci_ss_info_8086_2449_0e11_0091,
- &pci_ss_info_8086_2449_1014_01ce,
- &pci_ss_info_8086_2449_1014_01dc,
- &pci_ss_info_8086_2449_1014_01eb,
- &pci_ss_info_8086_2449_1014_01ec,
- &pci_ss_info_8086_2449_1014_0202,
- &pci_ss_info_8086_2449_1014_0205,
- &pci_ss_info_8086_2449_1014_0217,
- &pci_ss_info_8086_2449_1014_0234,
- &pci_ss_info_8086_2449_1014_023d,
- &pci_ss_info_8086_2449_1014_0244,
- &pci_ss_info_8086_2449_1014_0245,
- &pci_ss_info_8086_2449_1014_0265,
- &pci_ss_info_8086_2449_1014_0267,
- &pci_ss_info_8086_2449_1014_026a,
- &pci_ss_info_8086_2449_109f_315d,
- &pci_ss_info_8086_2449_109f_3181,
- &pci_ss_info_8086_2449_1179_ff01,
- &pci_ss_info_8086_2449_1186_7801,
- &pci_ss_info_8086_2449_144d_2602,
- &pci_ss_info_8086_2449_8086_3010,
- &pci_ss_info_8086_2449_8086_3011,
- &pci_ss_info_8086_2449_8086_3012,
- &pci_ss_info_8086_2449_8086_3013,
- &pci_ss_info_8086_2449_8086_3014,
- &pci_ss_info_8086_2449_8086_3015,
- &pci_ss_info_8086_2449_8086_3016,
- &pci_ss_info_8086_2449_8086_3017,
- &pci_ss_info_8086_2449_8086_3018,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_244a[] = {
- &pci_ss_info_8086_244a_1025_1016,
- &pci_ss_info_8086_244a_104d_80df,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_244b[] = {
- &pci_ss_info_8086_244b_1014_01c6,
- &pci_ss_info_8086_244b_1043_8027,
- &pci_ss_info_8086_244b_147b_0507,
- &pci_ss_info_8086_244b_8086_4532,
- &pci_ss_info_8086_244b_8086_4557,
- NULL
-};
-#define pci_ss_list_8086_244c NULL
-#define pci_ss_list_8086_244e NULL
-#define pci_ss_list_8086_2450 NULL
-#define pci_ss_list_8086_2452 NULL
-#define pci_ss_list_8086_2453 NULL
-#define pci_ss_list_8086_2459 NULL
-#define pci_ss_list_8086_245b NULL
-#define pci_ss_list_8086_245d NULL
-#define pci_ss_list_8086_245e NULL
-#define pci_ss_list_8086_2480 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2482[] = {
- &pci_ss_info_8086_2482_1014_0220,
- &pci_ss_info_8086_2482_104d_80e7,
- &pci_ss_info_8086_2482_15d9_3480,
- &pci_ss_info_8086_2482_8086_1958,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2483[] = {
- &pci_ss_info_8086_2483_1014_0220,
- &pci_ss_info_8086_2483_104d_80e7,
- &pci_ss_info_8086_2483_15d9_3480,
- &pci_ss_info_8086_2483_8086_1958,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2484[] = {
- &pci_ss_info_8086_2484_1014_0220,
- &pci_ss_info_8086_2484_104d_80e7,
- &pci_ss_info_8086_2484_15d9_3480,
- &pci_ss_info_8086_2484_8086_1958,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2485[] = {
- &pci_ss_info_8086_2485_1014_0222,
- &pci_ss_info_8086_2485_1014_0508,
- &pci_ss_info_8086_2485_1014_051c,
- &pci_ss_info_8086_2485_104d_80e7,
- &pci_ss_info_8086_2485_144d_c006,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2486[] = {
- &pci_ss_info_8086_2486_1014_0223,
- &pci_ss_info_8086_2486_1014_0503,
- &pci_ss_info_8086_2486_1014_051a,
- &pci_ss_info_8086_2486_104d_80e7,
- &pci_ss_info_8086_2486_1179_0001,
- &pci_ss_info_8086_2486_134d_4c21,
- &pci_ss_info_8086_2486_144d_2115,
- &pci_ss_info_8086_2486_14f1_5421,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2487[] = {
- &pci_ss_info_8086_2487_1014_0220,
- &pci_ss_info_8086_2487_104d_80e7,
- &pci_ss_info_8086_2487_15d9_3480,
- &pci_ss_info_8086_2487_8086_1958,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_248a[] = {
- &pci_ss_info_8086_248a_1014_0220,
- &pci_ss_info_8086_248a_104d_80e7,
- &pci_ss_info_8086_248a_8086_1958,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_248b[] = {
- &pci_ss_info_8086_248b_15d9_3480,
- NULL
-};
-#define pci_ss_list_8086_248c NULL
-static const pciSubsystemInfo *pci_ss_list_8086_24c0[] = {
- &pci_ss_info_8086_24c0_1462_5800,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_24c2[] = {
- &pci_ss_info_8086_24c2_1462_5800,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_24c3[] = {
- &pci_ss_info_8086_24c3_1462_5800,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_24c4[] = {
- &pci_ss_info_8086_24c4_1462_5800,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_24c5[] = {
- &pci_ss_info_8086_24c5_1462_5800,
- NULL
-};
-#define pci_ss_list_8086_24c6 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = {
- &pci_ss_info_8086_24c7_1462_5800,
- NULL
-};
-#define pci_ss_list_8086_24ca NULL
-static const pciSubsystemInfo *pci_ss_list_8086_24cb[] = {
- &pci_ss_info_8086_24cb_1462_5800,
- NULL
-};
-#define pci_ss_list_8086_24cc NULL
-static const pciSubsystemInfo *pci_ss_list_8086_24cd[] = {
- &pci_ss_info_8086_24cd_1462_3981,
- NULL
-};
-#define pci_ss_list_8086_24d0 NULL
-#define pci_ss_list_8086_24d1 NULL
-#define pci_ss_list_8086_24d2 NULL
-#define pci_ss_list_8086_24d3 NULL
-#define pci_ss_list_8086_24d4 NULL
-#define pci_ss_list_8086_24d5 NULL
-#define pci_ss_list_8086_24d6 NULL
-#define pci_ss_list_8086_24d7 NULL
-#define pci_ss_list_8086_24db NULL
-#define pci_ss_list_8086_24dc NULL
-#define pci_ss_list_8086_24dd NULL
-#define pci_ss_list_8086_24de NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2500[] = {
- &pci_ss_info_8086_2500_1028_0095,
- &pci_ss_info_8086_2500_1043_801c,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2501[] = {
- &pci_ss_info_8086_2501_1043_801c,
- NULL
-};
-#define pci_ss_list_8086_250b NULL
-#define pci_ss_list_8086_250f NULL
-#define pci_ss_list_8086_2520 NULL
-#define pci_ss_list_8086_2521 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2530[] = {
- &pci_ss_info_8086_2530_147b_0507,
- NULL
-};
-#define pci_ss_list_8086_2531 NULL
-#define pci_ss_list_8086_2532 NULL
-#define pci_ss_list_8086_2533 NULL
-#define pci_ss_list_8086_2534 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2540[] = {
- &pci_ss_info_8086_2540_15d9_3480,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_8086_2541[] = {
- &pci_ss_info_8086_2541_15d9_3480,
- NULL
-};
-#define pci_ss_list_8086_2543 NULL
-#define pci_ss_list_8086_2544 NULL
-#define pci_ss_list_8086_2545 NULL
-#define pci_ss_list_8086_2546 NULL
-#define pci_ss_list_8086_2547 NULL
-#define pci_ss_list_8086_2548 NULL
-#define pci_ss_list_8086_254c NULL
-#define pci_ss_list_8086_2550 NULL
-#define pci_ss_list_8086_2551 NULL
-#define pci_ss_list_8086_2552 NULL
-#define pci_ss_list_8086_2553 NULL
-#define pci_ss_list_8086_2554 NULL
-#define pci_ss_list_8086_255d NULL
-static const pciSubsystemInfo *pci_ss_list_8086_2560[] = {
- &pci_ss_info_8086_2560_1462_5800,
- NULL
-};
-#define pci_ss_list_8086_2561 NULL
-#define pci_ss_list_8086_2562 NULL
-#define pci_ss_list_8086_2570 NULL
-#define pci_ss_list_8086_2571 NULL
-#define pci_ss_list_8086_2572 NULL
-#define pci_ss_list_8086_2573 NULL
-#define pci_ss_list_8086_2576 NULL
-#define pci_ss_list_8086_2578 NULL
-#define pci_ss_list_8086_2579 NULL
-#define pci_ss_list_8086_257b NULL
-#define pci_ss_list_8086_257e NULL
-#define pci_ss_list_8086_3092 NULL
-#define pci_ss_list_8086_3340 NULL
-#define pci_ss_list_8086_3341 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_3575[] = {
- &pci_ss_info_8086_3575_1014_021d,
- &pci_ss_info_8086_3575_104d_80e7,
- NULL
-};
-#define pci_ss_list_8086_3576 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_3577[] = {
- &pci_ss_info_8086_3577_1014_0513,
- NULL
-};
-#define pci_ss_list_8086_3578 NULL
-#define pci_ss_list_8086_3580 NULL
-#define pci_ss_list_8086_3582 NULL
-#define pci_ss_list_8086_5200 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_5201[] = {
- &pci_ss_info_8086_5201_8086_0001,
- NULL
-};
-#define pci_ss_list_8086_530d NULL
-#define pci_ss_list_8086_7000 NULL
-#define pci_ss_list_8086_7010 NULL
-#define pci_ss_list_8086_7020 NULL
-#define pci_ss_list_8086_7030 NULL
-#define pci_ss_list_8086_7100 NULL
-#define pci_ss_list_8086_7110 NULL
-#define pci_ss_list_8086_7111 NULL
-#define pci_ss_list_8086_7112 NULL
-#define pci_ss_list_8086_7113 NULL
-#define pci_ss_list_8086_7120 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_7121[] = {
- &pci_ss_info_8086_7121_8086_4341,
- NULL
-};
-#define pci_ss_list_8086_7122 NULL
-#define pci_ss_list_8086_7123 NULL
-#define pci_ss_list_8086_7124 NULL
-#define pci_ss_list_8086_7125 NULL
-#define pci_ss_list_8086_7126 NULL
-#define pci_ss_list_8086_7128 NULL
-#define pci_ss_list_8086_712a NULL
-#define pci_ss_list_8086_7180 NULL
-#define pci_ss_list_8086_7181 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_7190[] = {
- &pci_ss_info_8086_7190_0e11_0500,
- &pci_ss_info_8086_7190_0e11_b110,
- &pci_ss_info_8086_7190_1179_0001,
- NULL
-};
-#define pci_ss_list_8086_7191 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_7192[] = {
- &pci_ss_info_8086_7192_0e11_0460,
- NULL
-};
-#define pci_ss_list_8086_7194 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_7195[] = {
- &pci_ss_info_8086_7195_10cf_1099,
- &pci_ss_info_8086_7195_11d4_0040,
- &pci_ss_info_8086_7195_11d4_0048,
- NULL
-};
-#define pci_ss_list_8086_7196 NULL
-#define pci_ss_list_8086_7198 NULL
-#define pci_ss_list_8086_7199 NULL
-#define pci_ss_list_8086_719a NULL
-#define pci_ss_list_8086_719b NULL
-#define pci_ss_list_8086_71a0 NULL
-#define pci_ss_list_8086_71a1 NULL
-#define pci_ss_list_8086_71a2 NULL
-#define pci_ss_list_8086_7600 NULL
-#define pci_ss_list_8086_7601 NULL
-#define pci_ss_list_8086_7602 NULL
-#define pci_ss_list_8086_7603 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_7800[] = {
- &pci_ss_info_8086_7800_003d_0008,
- &pci_ss_info_8086_7800_003d_000b,
- &pci_ss_info_8086_7800_1092_0100,
- &pci_ss_info_8086_7800_10b4_201a,
- &pci_ss_info_8086_7800_10b4_202f,
- &pci_ss_info_8086_7800_8086_0000,
- &pci_ss_info_8086_7800_8086_0100,
- NULL
-};
-#define pci_ss_list_8086_84c4 NULL
-#define pci_ss_list_8086_84c5 NULL
-#define pci_ss_list_8086_84ca NULL
-#define pci_ss_list_8086_84cb NULL
-#define pci_ss_list_8086_84e0 NULL
-#define pci_ss_list_8086_84e1 NULL
-#define pci_ss_list_8086_84e2 NULL
-#define pci_ss_list_8086_84e3 NULL
-#define pci_ss_list_8086_84e4 NULL
-#define pci_ss_list_8086_84e6 NULL
-#define pci_ss_list_8086_84ea NULL
-#define pci_ss_list_8086_9621 NULL
-#define pci_ss_list_8086_9622 NULL
-#define pci_ss_list_8086_9641 NULL
-#define pci_ss_list_8086_96a1 NULL
-#define pci_ss_list_8086_b152 NULL
-#define pci_ss_list_8086_b154 NULL
-static const pciSubsystemInfo *pci_ss_list_8086_b555[] = {
- &pci_ss_info_8086_b555_e4bf_1000,
- NULL
-};
-#define pci_ss_list_8086_ffff NULL
-#define pci_ss_list_8800_2008 NULL
-#define pci_ss_list_8e2e_3000 NULL
-#define pci_ss_list_9004_1078 NULL
-#define pci_ss_list_9004_1160 NULL
-#define pci_ss_list_9004_2178 NULL
-#define pci_ss_list_9004_3860 NULL
-#define pci_ss_list_9004_3b78 NULL
-#define pci_ss_list_9004_5075 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_9004_5078[] = {
- &pci_ss_info_9004_5078_9004_7850,
- NULL
-};
-#define pci_ss_list_9004_5175 NULL
-#define pci_ss_list_9004_5178 NULL
-#define pci_ss_list_9004_5275 NULL
-#define pci_ss_list_9004_5278 NULL
-#define pci_ss_list_9004_5375 NULL
-#define pci_ss_list_9004_5378 NULL
-#define pci_ss_list_9004_5475 NULL
-#define pci_ss_list_9004_5478 NULL
-#define pci_ss_list_9004_5575 NULL
-#define pci_ss_list_9004_5578 NULL
-#define pci_ss_list_9004_5675 NULL
-#define pci_ss_list_9004_5678 NULL
-#define pci_ss_list_9004_5775 NULL
-#define pci_ss_list_9004_5778 NULL
-#define pci_ss_list_9004_5800 NULL
-#define pci_ss_list_9004_5900 NULL
-#define pci_ss_list_9004_5905 NULL
-#define pci_ss_list_9004_6038 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_6075[] = {
- &pci_ss_info_9004_6075_9004_7560,
- NULL
-};
-#define pci_ss_list_9004_6078 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_6178[] = {
- &pci_ss_info_9004_6178_9004_7861,
- NULL
-};
-#define pci_ss_list_9004_6278 NULL
-#define pci_ss_list_9004_6378 NULL
-#define pci_ss_list_9004_6478 NULL
-#define pci_ss_list_9004_6578 NULL
-#define pci_ss_list_9004_6678 NULL
-#define pci_ss_list_9004_6778 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_6915[] = {
- &pci_ss_info_9004_6915_9004_0008,
- &pci_ss_info_9004_6915_9004_0009,
- &pci_ss_info_9004_6915_9004_0010,
- &pci_ss_info_9004_6915_9004_0018,
- &pci_ss_info_9004_6915_9004_0019,
- &pci_ss_info_9004_6915_9004_0020,
- &pci_ss_info_9004_6915_9004_0028,
- &pci_ss_info_9004_6915_9004_8008,
- &pci_ss_info_9004_6915_9004_8009,
- &pci_ss_info_9004_6915_9004_8010,
- &pci_ss_info_9004_6915_9004_8018,
- &pci_ss_info_9004_6915_9004_8019,
- &pci_ss_info_9004_6915_9004_8020,
- &pci_ss_info_9004_6915_9004_8028,
- NULL
-};
-#define pci_ss_list_9004_7078 NULL
-#define pci_ss_list_9004_7178 NULL
-#define pci_ss_list_9004_7278 NULL
-#define pci_ss_list_9004_7378 NULL
-#define pci_ss_list_9004_7478 NULL
-#define pci_ss_list_9004_7578 NULL
-#define pci_ss_list_9004_7678 NULL
-#define pci_ss_list_9004_7710 NULL
-#define pci_ss_list_9004_7711 NULL
-#define pci_ss_list_9004_7778 NULL
-#define pci_ss_list_9004_7810 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_7815[] = {
- &pci_ss_info_9004_7815_9004_7815,
- &pci_ss_info_9004_7815_9004_7840,
- NULL
-};
-#define pci_ss_list_9004_7850 NULL
-#define pci_ss_list_9004_7855 NULL
-#define pci_ss_list_9004_7860 NULL
-#define pci_ss_list_9004_7870 NULL
-#define pci_ss_list_9004_7871 NULL
-#define pci_ss_list_9004_7872 NULL
-#define pci_ss_list_9004_7873 NULL
-#define pci_ss_list_9004_7874 NULL
-#define pci_ss_list_9004_7880 NULL
-#define pci_ss_list_9004_7890 NULL
-#define pci_ss_list_9004_7891 NULL
-#define pci_ss_list_9004_7892 NULL
-#define pci_ss_list_9004_7893 NULL
-#define pci_ss_list_9004_7894 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_7895[] = {
- &pci_ss_info_9004_7895_9004_7890,
- &pci_ss_info_9004_7895_9004_7891,
- &pci_ss_info_9004_7895_9004_7892,
- &pci_ss_info_9004_7895_9004_7894,
- &pci_ss_info_9004_7895_9004_7895,
- &pci_ss_info_9004_7895_9004_7896,
- &pci_ss_info_9004_7895_9004_7897,
- NULL
-};
-#define pci_ss_list_9004_7896 NULL
-#define pci_ss_list_9004_7897 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_8078[] = {
- &pci_ss_info_9004_8078_9004_7880,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9004_8178[] = {
- &pci_ss_info_9004_8178_9004_7881,
- NULL
-};
-#define pci_ss_list_9004_8278 NULL
-#define pci_ss_list_9004_8378 NULL
-#define pci_ss_list_9004_8478 NULL
-#define pci_ss_list_9004_8578 NULL
-#define pci_ss_list_9004_8678 NULL
-static const pciSubsystemInfo *pci_ss_list_9004_8778[] = {
- &pci_ss_info_9004_8778_9004_7887,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9004_8878[] = {
- &pci_ss_info_9004_8878_9004_7888,
- NULL
-};
-#define pci_ss_list_9004_8b78 NULL
-#define pci_ss_list_9004_ec78 NULL
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_9005_0010[] = {
- &pci_ss_info_9005_0010_9005_2180,
- &pci_ss_info_9005_0010_9005_8100,
- &pci_ss_info_9005_0010_9005_a180,
- &pci_ss_info_9005_0010_9005_e100,
- NULL
-};
-#define pci_ss_list_9005_0011 NULL
-static const pciSubsystemInfo *pci_ss_list_9005_0013[] = {
- &pci_ss_info_9005_0013_9005_0003,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_001f[] = {
- &pci_ss_info_9005_001f_9005_000f,
- &pci_ss_info_9005_001f_9005_a180,
- NULL
-};
-#define pci_ss_list_9005_0020 NULL
-#define pci_ss_list_9005_002f NULL
-#define pci_ss_list_9005_0030 NULL
-#define pci_ss_list_9005_003f NULL
-static const pciSubsystemInfo *pci_ss_list_9005_0050[] = {
- &pci_ss_info_9005_0050_9005_f500,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_0051[] = {
- &pci_ss_info_9005_0051_9005_b500,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_0053[] = {
- &pci_ss_info_9005_0053_9005_ffff,
- NULL
-};
-#define pci_ss_list_9005_005f NULL
-static const pciSubsystemInfo *pci_ss_list_9005_0080[] = {
- &pci_ss_info_9005_0080_0e11_e2a0,
- &pci_ss_info_9005_0080_9005_62a0,
- &pci_ss_info_9005_0080_9005_e220,
- &pci_ss_info_9005_0080_9005_e2a0,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_0081[] = {
- &pci_ss_info_9005_0081_9005_62a1,
- NULL
-};
-#define pci_ss_list_9005_0083 NULL
-static const pciSubsystemInfo *pci_ss_list_9005_008f[] = {
- &pci_ss_info_9005_008f_1179_0001,
- &pci_ss_info_9005_008f_15d9_9005,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_00c0[] = {
- &pci_ss_info_9005_00c0_0e11_f620,
- &pci_ss_info_9005_00c0_9005_f620,
- NULL
-};
-#define pci_ss_list_9005_00c1 NULL
-#define pci_ss_list_9005_00c3 NULL
-static const pciSubsystemInfo *pci_ss_list_9005_00c5[] = {
- &pci_ss_info_9005_00c5_1028_00c5,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_00cf[] = {
- &pci_ss_info_9005_00cf_1028_00d1,
- &pci_ss_info_9005_00cf_10f1_2462,
- &pci_ss_info_9005_00cf_15d9_9005,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_0250[] = {
- &pci_ss_info_9005_0250_1014_0279,
- &pci_ss_info_9005_0250_1014_028c,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_9005_0285[] = {
- &pci_ss_info_9005_0285_1028_0287,
- NULL
-};
-#define pci_ss_list_9005_8000 NULL
-#define pci_ss_list_9005_800f NULL
-#define pci_ss_list_9005_8010 NULL
-static const pciSubsystemInfo *pci_ss_list_9005_8011[] = {
- &pci_ss_info_9005_8011_0e11_00ac,
- &pci_ss_info_9005_8011_9005_0041,
- NULL
-};
-#define pci_ss_list_9005_8012 NULL
-#define pci_ss_list_9005_8013 NULL
-#define pci_ss_list_9005_8014 NULL
-#define pci_ss_list_9005_801e NULL
-#define pci_ss_list_9005_801f NULL
-#define pci_ss_list_9005_8080 NULL
-#define pci_ss_list_9005_808f NULL
-#define pci_ss_list_9005_8090 NULL
-#define pci_ss_list_9005_8091 NULL
-#define pci_ss_list_9005_8092 NULL
-#define pci_ss_list_9005_8093 NULL
-#define pci_ss_list_9005_8094 NULL
-#define pci_ss_list_9005_8095 NULL
-#define pci_ss_list_9005_8096 NULL
-#define pci_ss_list_9005_8097 NULL
-#define pci_ss_list_9005_809c NULL
-#define pci_ss_list_9005_809d NULL
-#define pci_ss_list_9005_809e NULL
-#define pci_ss_list_9005_809f NULL
-#endif
-#define pci_ss_list_907f_2015 NULL
-#define pci_ss_list_9412_6565 NULL
-#define pci_ss_list_9699_6565 NULL
-#define pci_ss_list_9710_9815 NULL
-#define pci_ss_list_9710_9835 NULL
-#define pci_ss_list_cddd_0101 NULL
-#define pci_ss_list_cddd_0200 NULL
-#define pci_ss_list_d4d4_0601 NULL
-#define pci_ss_list_e000_e000 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_e159_0001[] = {
- &pci_ss_info_e159_0001_0059_0001,
- &pci_ss_info_e159_0001_0059_0003,
- NULL
-};
-#define pci_ss_list_e159_0002 NULL
-#endif
-#define pci_ss_list_ea60_9896 NULL
-#define pci_ss_list_ea60_9897 NULL
-#define pci_ss_list_ea60_9898 NULL
-#define pci_ss_list_eace_3100 NULL
-#define pci_ss_list_eace_3200 NULL
-#define pci_ss_list_eace_320e NULL
-#define pci_ss_list_eace_340e NULL
-#define pci_ss_list_eace_341e NULL
-#define pci_ss_list_eace_3500 NULL
-#define pci_ss_list_eace_351c NULL
-#define pci_ss_list_eace_4100 NULL
-#define pci_ss_list_eace_4110 NULL
-#define pci_ss_list_eace_4220 NULL
-#define pci_ss_list_eace_422e NULL
-#define pci_ss_list_ec80_ec00 NULL
-#define pci_ss_list_ecc0_0050 NULL
-#define pci_ss_list_ecc0_0051 NULL
-#define pci_ss_list_ecc0_0060 NULL
-#define pci_ss_list_ecc0_0070 NULL
-#define pci_ss_list_ecc0_0071 NULL
-#define pci_ss_list_ecc0_0072 NULL
-#define pci_ss_list_ecc0_0080 NULL
-#define pci_ss_list_edd8_a091 NULL
-#define pci_ss_list_edd8_a099 NULL
-#define pci_ss_list_edd8_a0a1 NULL
-#define pci_ss_list_edd8_a0a9 NULL
-#define pci_ss_list_f1d0_cafe NULL
-#define pci_ss_list_f1d0_efac NULL
-#define pci_ss_list_f1d0_facd NULL
-#define pci_ss_list_feda_a0fa NULL
-#define pci_ss_list_feda_a10e NULL
-#define pci_ss_list_fffe_0710 NULL
-#ifdef INIT_VENDOR_SUBSYS_INFO
-#define pci_ss_list_0000 NULL
-#define pci_ss_list_001a NULL
-#define pci_ss_list_0033 NULL
-static const pciSubsystemInfo *pci_ss_list_003d[] = {
- &pci_ss_info_003d_0008,
- &pci_ss_info_003d_000b,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_0059[] = {
- &pci_ss_info_0059_0001,
- &pci_ss_info_0059_0003,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_0070[] = {
- &pci_ss_info_0070_13eb,
- &pci_ss_info_0070_ff01,
- NULL
-};
-#endif
-#define pci_ss_list_0100 NULL
-#define pci_ss_list_0675 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_0925[] = {
- &pci_ss_info_0925_1234,
- NULL
-};
-#endif
-#define pci_ss_list_09c1 NULL
-#define pci_ss_list_0a89 NULL
-static const pciSubsystemInfo *pci_ss_list_0e11[] = {
- &pci_ss_info_0e11_0012,
- &pci_ss_info_0e11_0022,
- &pci_ss_info_0e11_0023,
- &pci_ss_info_0e11_0024,
- &pci_ss_info_0e11_0042,
- &pci_ss_info_0e11_0043,
- &pci_ss_info_0e11_0049,
- &pci_ss_info_0e11_004a,
- &pci_ss_info_0e11_005d,
- &pci_ss_info_0e11_007c,
- &pci_ss_info_0e11_007d,
- &pci_ss_info_0e11_007e,
- &pci_ss_info_0e11_0085,
- &pci_ss_info_0e11_0091,
- &pci_ss_info_0e11_0099,
- &pci_ss_info_0e11_009a,
- &pci_ss_info_0e11_00ac,
- &pci_ss_info_0e11_00bb,
- &pci_ss_info_0e11_00c1,
- &pci_ss_info_0e11_00ca,
- &pci_ss_info_0e11_00cb,
- &pci_ss_info_0e11_00cf,
- &pci_ss_info_0e11_00d0,
- &pci_ss_info_0e11_00d1,
- &pci_ss_info_0e11_0460,
- &pci_ss_info_0e11_0500,
- &pci_ss_info_0e11_3001,
- &pci_ss_info_0e11_3002,
- &pci_ss_info_0e11_3003,
- &pci_ss_info_0e11_3004,
- &pci_ss_info_0e11_3005,
- &pci_ss_info_0e11_3006,
- &pci_ss_info_0e11_3007,
- &pci_ss_info_0e11_4030,
- &pci_ss_info_0e11_4031,
- &pci_ss_info_0e11_4032,
- &pci_ss_info_0e11_4033,
- &pci_ss_info_0e11_4040,
- &pci_ss_info_0e11_4048,
- &pci_ss_info_0e11_4050,
- &pci_ss_info_0e11_4051,
- &pci_ss_info_0e11_4058,
- &pci_ss_info_0e11_7004,
- &pci_ss_info_0e11_b01e,
- &pci_ss_info_0e11_b01f,
- &pci_ss_info_0e11_b02f,
- &pci_ss_info_0e11_b032,
- &pci_ss_info_0e11_b03b,
- &pci_ss_info_0e11_b03c,
- &pci_ss_info_0e11_b03d,
- &pci_ss_info_0e11_b03e,
- &pci_ss_info_0e11_b03f,
- &pci_ss_info_0e11_b049,
- &pci_ss_info_0e11_b04a,
- &pci_ss_info_0e11_b0bc,
- &pci_ss_info_0e11_b0c6,
- &pci_ss_info_0e11_b0c7,
- &pci_ss_info_0e11_b0d1,
- &pci_ss_info_0e11_b0d7,
- &pci_ss_info_0e11_b0dd,
- &pci_ss_info_0e11_b0de,
- &pci_ss_info_0e11_b0df,
- &pci_ss_info_0e11_b0e0,
- &pci_ss_info_0e11_b0e1,
- &pci_ss_info_0e11_b0e8,
- &pci_ss_info_0e11_b0fd,
- &pci_ss_info_0e11_b10e,
- &pci_ss_info_0e11_b110,
- &pci_ss_info_0e11_b111,
- &pci_ss_info_0e11_b112,
- &pci_ss_info_0e11_b113,
- &pci_ss_info_0e11_b114,
- &pci_ss_info_0e11_b123,
- &pci_ss_info_0e11_b126,
- &pci_ss_info_0e11_b134,
- &pci_ss_info_0e11_b13c,
- &pci_ss_info_0e11_b144,
- &pci_ss_info_0e11_b14d,
- &pci_ss_info_0e11_b15a,
- &pci_ss_info_0e11_b163,
- &pci_ss_info_0e11_b164,
- &pci_ss_info_0e11_b16e,
- &pci_ss_info_0e11_b16f,
- &pci_ss_info_0e11_b194,
- &pci_ss_info_0e11_b195,
- &pci_ss_info_0e11_b196,
- &pci_ss_info_0e11_b1a4,
- &pci_ss_info_0e11_b1a7,
- &pci_ss_info_0e11_b1be,
- &pci_ss_info_0e11_e2a0,
- &pci_ss_info_0e11_f620,
- NULL
-};
-#define pci_ss_list_0e55 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1000[] = {
- &pci_ss_info_1000_1000,
- NULL
-};
-#endif
-#define pci_ss_list_1001 NULL
-static const pciSubsystemInfo *pci_ss_list_1002[] = {
- &pci_ss_info_1002_0001,
- &pci_ss_info_1002_0002,
- &pci_ss_info_1002_0003,
- &pci_ss_info_1002_0004,
- &pci_ss_info_1002_0008,
- &pci_ss_info_1002_0009,
- &pci_ss_info_1002_000a,
- &pci_ss_info_1002_000b,
- &pci_ss_info_1002_0014,
- &pci_ss_info_1002_0018,
- &pci_ss_info_1002_001a,
- &pci_ss_info_1002_001c,
- &pci_ss_info_1002_0028,
- &pci_ss_info_1002_0029,
- &pci_ss_info_1002_002a,
- &pci_ss_info_1002_002b,
- &pci_ss_info_1002_0038,
- &pci_ss_info_1002_0039,
- &pci_ss_info_1002_003a,
- &pci_ss_info_1002_0040,
- &pci_ss_info_1002_0044,
- &pci_ss_info_1002_0048,
- &pci_ss_info_1002_0061,
- &pci_ss_info_1002_0062,
- &pci_ss_info_1002_0063,
- &pci_ss_info_1002_0068,
- &pci_ss_info_1002_0080,
- &pci_ss_info_1002_0084,
- &pci_ss_info_1002_0087,
- &pci_ss_info_1002_0088,
- &pci_ss_info_1002_008a,
- &pci_ss_info_1002_00ba,
- &pci_ss_info_1002_010a,
- &pci_ss_info_1002_0139,
- &pci_ss_info_1002_013a,
- &pci_ss_info_1002_0152,
- &pci_ss_info_1002_0162,
- &pci_ss_info_1002_0172,
- &pci_ss_info_1002_028a,
- &pci_ss_info_1002_02aa,
- &pci_ss_info_1002_0448,
- &pci_ss_info_1002_053a,
- &pci_ss_info_1002_2000,
- &pci_ss_info_1002_2001,
- &pci_ss_info_1002_4742,
- &pci_ss_info_1002_4744,
- &pci_ss_info_1002_474d,
- &pci_ss_info_1002_474e,
- &pci_ss_info_1002_474f,
- &pci_ss_info_1002_4750,
- &pci_ss_info_1002_4752,
- &pci_ss_info_1002_4753,
- &pci_ss_info_1002_4756,
- &pci_ss_info_1002_4757,
- &pci_ss_info_1002_475a,
- &pci_ss_info_1002_4c42,
- &pci_ss_info_1002_4c49,
- &pci_ss_info_1002_4c50,
- &pci_ss_info_1002_5654,
- &pci_ss_info_1002_8001,
- &pci_ss_info_1002_8008,
- NULL
-};
-#define pci_ss_list_1003 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1004[] = {
- &pci_ss_info_1004_0304,
- &pci_ss_info_1004_0305,
- &pci_ss_info_1004_0306,
- NULL
-};
-#endif
-#define pci_ss_list_1005 NULL
-#define pci_ss_list_1006 NULL
-#define pci_ss_list_1007 NULL
-#define pci_ss_list_1008 NULL
-#define pci_ss_list_100a NULL
-#define pci_ss_list_100b NULL
-#define pci_ss_list_100c NULL
-#define pci_ss_list_100d NULL
-#define pci_ss_list_100e NULL
-static const pciSubsystemInfo *pci_ss_list_1010[] = {
- &pci_ss_info_1010_0020,
- &pci_ss_info_1010_0080,
- &pci_ss_info_1010_0088,
- &pci_ss_info_1010_0090,
- &pci_ss_info_1010_0098,
- &pci_ss_info_1010_00a0,
- &pci_ss_info_1010_00a8,
- &pci_ss_info_1010_0120,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1011[] = {
- &pci_ss_info_1011_4d10,
- &pci_ss_info_1011_500a,
- &pci_ss_info_1011_500b,
- NULL
-};
-#define pci_ss_list_1012 NULL
-static const pciSubsystemInfo *pci_ss_list_1013[] = {
- &pci_ss_info_1013_00bc,
- &pci_ss_info_1013_4280,
- &pci_ss_info_1013_4281,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1014[] = {
- &pci_ss_info_1014_0001,
- &pci_ss_info_1014_002e,
- &pci_ss_info_1014_003e,
- &pci_ss_info_1014_005c,
- &pci_ss_info_1014_008e,
- &pci_ss_info_1014_0097,
- &pci_ss_info_1014_0098,
- &pci_ss_info_1014_0099,
- &pci_ss_info_1014_00ba,
- &pci_ss_info_1014_00cd,
- &pci_ss_info_1014_00ce,
- &pci_ss_info_1014_00cf,
- &pci_ss_info_1014_00db,
- &pci_ss_info_1014_00dd,
- &pci_ss_info_1014_00e4,
- &pci_ss_info_1014_00e5,
- &pci_ss_info_1014_0119,
- &pci_ss_info_1014_0131,
- &pci_ss_info_1014_0143,
- &pci_ss_info_1014_0145,
- &pci_ss_info_1014_0154,
- &pci_ss_info_1014_0166,
- &pci_ss_info_1014_016d,
- &pci_ss_info_1014_017f,
- &pci_ss_info_1014_0181,
- &pci_ss_info_1014_0182,
- &pci_ss_info_1014_0183,
- &pci_ss_info_1014_0184,
- &pci_ss_info_1014_0185,
- &pci_ss_info_1014_01b6,
- &pci_ss_info_1014_01b7,
- &pci_ss_info_1014_01bc,
- &pci_ss_info_1014_01be,
- &pci_ss_info_1014_01bf,
- &pci_ss_info_1014_01c6,
- &pci_ss_info_1014_01ce,
- &pci_ss_info_1014_01cf,
- &pci_ss_info_1014_01dc,
- &pci_ss_info_1014_01ea,
- &pci_ss_info_1014_01eb,
- &pci_ss_info_1014_01ec,
- &pci_ss_info_1014_01f1,
- &pci_ss_info_1014_01f2,
- &pci_ss_info_1014_01fc,
- &pci_ss_info_1014_0202,
- &pci_ss_info_1014_0205,
- &pci_ss_info_1014_0207,
- &pci_ss_info_1014_0208,
- &pci_ss_info_1014_0209,
- &pci_ss_info_1014_020e,
- &pci_ss_info_1014_0217,
- &pci_ss_info_1014_021d,
- &pci_ss_info_1014_0220,
- &pci_ss_info_1014_0222,
- &pci_ss_info_1014_0223,
- &pci_ss_info_1014_022e,
- &pci_ss_info_1014_0232,
- &pci_ss_info_1014_0234,
- &pci_ss_info_1014_0235,
- &pci_ss_info_1014_0239,
- &pci_ss_info_1014_023a,
- &pci_ss_info_1014_023b,
- &pci_ss_info_1014_023d,
- &pci_ss_info_1014_0244,
- &pci_ss_info_1014_0245,
- &pci_ss_info_1014_0258,
- &pci_ss_info_1014_0259,
- &pci_ss_info_1014_0265,
- &pci_ss_info_1014_0267,
- &pci_ss_info_1014_026a,
- &pci_ss_info_1014_0277,
- &pci_ss_info_1014_0279,
- &pci_ss_info_1014_028c,
- &pci_ss_info_1014_0502,
- &pci_ss_info_1014_0503,
- &pci_ss_info_1014_0506,
- &pci_ss_info_1014_0508,
- &pci_ss_info_1014_0511,
- &pci_ss_info_1014_0512,
- &pci_ss_info_1014_0513,
- &pci_ss_info_1014_0517,
- &pci_ss_info_1014_051a,
- &pci_ss_info_1014_051c,
- &pci_ss_info_1014_1010,
- &pci_ss_info_1014_105c,
- &pci_ss_info_1014_10f2,
- &pci_ss_info_1014_1181,
- &pci_ss_info_1014_1182,
- &pci_ss_info_1014_2000,
- &pci_ss_info_1014_2205,
- &pci_ss_info_1014_305c,
- &pci_ss_info_1014_405c,
- &pci_ss_info_1014_505c,
- &pci_ss_info_1014_605c,
- &pci_ss_info_1014_705c,
- &pci_ss_info_1014_805c,
- &pci_ss_info_1014_8181,
- &pci_ss_info_1014_9181,
- &pci_ss_info_1014_9750,
- &pci_ss_info_1014_ff03,
- NULL
-};
-#endif
-#define pci_ss_list_1015 NULL
-#define pci_ss_list_1016 NULL
-#define pci_ss_list_1017 NULL
-#define pci_ss_list_1018 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1019[] = {
- &pci_ss_info_1019_0970,
- &pci_ss_info_1019_0985,
- &pci_ss_info_1019_7018,
- NULL
-};
-#endif
-#define pci_ss_list_101a NULL
-#define pci_ss_list_101b NULL
-#define pci_ss_list_101c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_101e[] = {
- &pci_ss_info_101e_0431,
- &pci_ss_info_101e_0438,
- &pci_ss_info_101e_0466,
- &pci_ss_info_101e_0467,
- &pci_ss_info_101e_0471,
- &pci_ss_info_101e_0475,
- &pci_ss_info_101e_0490,
- &pci_ss_info_101e_0493,
- &pci_ss_info_101e_0649,
- &pci_ss_info_101e_0762,
- &pci_ss_info_101e_0767,
- &pci_ss_info_101e_09a0,
- &pci_ss_info_101e_8471,
- &pci_ss_info_101e_8493,
- NULL
-};
-#endif
-#define pci_ss_list_101f NULL
-#define pci_ss_list_1020 NULL
-#define pci_ss_list_1021 NULL
-#define pci_ss_list_1022 NULL
-static const pciSubsystemInfo *pci_ss_list_1023[] = {
- &pci_ss_info_1023_8400,
- &pci_ss_info_1023_8520,
- &pci_ss_info_1023_9750,
- &pci_ss_info_1023_9880,
- NULL
-};
-#define pci_ss_list_1024 NULL
-static const pciSubsystemInfo *pci_ss_list_1025[] = {
- &pci_ss_info_1025_000e,
- &pci_ss_info_1025_0018,
- &pci_ss_info_1025_0310,
- &pci_ss_info_1025_0315,
- &pci_ss_info_1025_1003,
- &pci_ss_info_1025_1007,
- &pci_ss_info_1025_1016,
- &pci_ss_info_1025_8013,
- &pci_ss_info_1025_8920,
- &pci_ss_info_1025_8921,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_1028[] = {
- &pci_ss_info_1028_0001,
- &pci_ss_info_1028_0002,
- &pci_ss_info_1028_0003,
- &pci_ss_info_1028_0074,
- &pci_ss_info_1028_0075,
- &pci_ss_info_1028_007d,
- &pci_ss_info_1028_007e,
- &pci_ss_info_1028_0080,
- &pci_ss_info_1028_0081,
- &pci_ss_info_1028_0082,
- &pci_ss_info_1028_0083,
- &pci_ss_info_1028_0084,
- &pci_ss_info_1028_0085,
- &pci_ss_info_1028_0086,
- &pci_ss_info_1028_0087,
- &pci_ss_info_1028_0088,
- &pci_ss_info_1028_0089,
- &pci_ss_info_1028_008f,
- &pci_ss_info_1028_0090,
- &pci_ss_info_1028_0091,
- &pci_ss_info_1028_0092,
- &pci_ss_info_1028_0093,
- &pci_ss_info_1028_0094,
- &pci_ss_info_1028_0095,
- &pci_ss_info_1028_0096,
- &pci_ss_info_1028_0097,
- &pci_ss_info_1028_0098,
- &pci_ss_info_1028_0099,
- &pci_ss_info_1028_009b,
- &pci_ss_info_1028_00c5,
- &pci_ss_info_1028_00d0,
- &pci_ss_info_1028_00d1,
- &pci_ss_info_1028_00d9,
- &pci_ss_info_1028_00e6,
- &pci_ss_info_1028_0106,
- &pci_ss_info_1028_0109,
- &pci_ss_info_1028_010a,
- &pci_ss_info_1028_011b,
- &pci_ss_info_1028_0121,
- &pci_ss_info_1028_0126,
- &pci_ss_info_1028_0287,
- &pci_ss_info_1028_0467,
- &pci_ss_info_1028_0471,
- &pci_ss_info_1028_0475,
- &pci_ss_info_1028_0493,
- &pci_ss_info_1028_0511,
- &pci_ss_info_1028_0518,
- &pci_ss_info_1028_0520,
- &pci_ss_info_1028_0531,
- &pci_ss_info_1028_1010,
- &pci_ss_info_1028_1111,
- &pci_ss_info_1028_4082,
- &pci_ss_info_1028_8082,
- &pci_ss_info_1028_c082,
- NULL
-};
-#define pci_ss_list_1029 NULL
-#define pci_ss_list_102a NULL
-static const pciSubsystemInfo *pci_ss_list_102b[] = {
- &pci_ss_info_102b_0100,
- &pci_ss_info_102b_0328,
- &pci_ss_info_102b_0338,
- &pci_ss_info_102b_0378,
- &pci_ss_info_102b_051b,
- &pci_ss_info_102b_0541,
- &pci_ss_info_102b_0542,
- &pci_ss_info_102b_0543,
- &pci_ss_info_102b_0641,
- &pci_ss_info_102b_0642,
- &pci_ss_info_102b_0643,
- &pci_ss_info_102b_07c0,
- &pci_ss_info_102b_07c1,
- &pci_ss_info_102b_0840,
- &pci_ss_info_102b_0d41,
- &pci_ss_info_102b_0d42,
- &pci_ss_info_102b_0e00,
- &pci_ss_info_102b_0e01,
- &pci_ss_info_102b_0e02,
- &pci_ss_info_102b_0e03,
- &pci_ss_info_102b_0f80,
- &pci_ss_info_102b_0f81,
- &pci_ss_info_102b_0f82,
- &pci_ss_info_102b_0f83,
- &pci_ss_info_102b_0f84,
- &pci_ss_info_102b_1001,
- &pci_ss_info_102b_1100,
- &pci_ss_info_102b_1200,
- &pci_ss_info_102b_19d8,
- &pci_ss_info_102b_19f8,
- &pci_ss_info_102b_1e41,
- &pci_ss_info_102b_2159,
- &pci_ss_info_102b_2179,
- &pci_ss_info_102b_217d,
- &pci_ss_info_102b_23c0,
- &pci_ss_info_102b_23c1,
- &pci_ss_info_102b_23c2,
- &pci_ss_info_102b_23c3,
- &pci_ss_info_102b_2f58,
- &pci_ss_info_102b_2f78,
- &pci_ss_info_102b_3693,
- &pci_ss_info_102b_48e9,
- &pci_ss_info_102b_48f8,
- &pci_ss_info_102b_4a60,
- &pci_ss_info_102b_4a64,
- &pci_ss_info_102b_5dd0,
- &pci_ss_info_102b_5f50,
- &pci_ss_info_102b_5f51,
- &pci_ss_info_102b_5f52,
- &pci_ss_info_102b_9010,
- &pci_ss_info_102b_c93c,
- &pci_ss_info_102b_c9b0,
- &pci_ss_info_102b_c9bc,
- &pci_ss_info_102b_ca60,
- &pci_ss_info_102b_ca6c,
- &pci_ss_info_102b_dbbc,
- &pci_ss_info_102b_dbc2,
- &pci_ss_info_102b_dbc3,
- &pci_ss_info_102b_dbc8,
- &pci_ss_info_102b_dbd2,
- &pci_ss_info_102b_dbd3,
- &pci_ss_info_102b_dbd4,
- &pci_ss_info_102b_dbd5,
- &pci_ss_info_102b_dbd8,
- &pci_ss_info_102b_dbd9,
- &pci_ss_info_102b_dbe2,
- &pci_ss_info_102b_dbe3,
- &pci_ss_info_102b_dbe8,
- &pci_ss_info_102b_dbf2,
- &pci_ss_info_102b_dbf3,
- &pci_ss_info_102b_dbf4,
- &pci_ss_info_102b_dbf5,
- &pci_ss_info_102b_dbf8,
- &pci_ss_info_102b_dbf9,
- &pci_ss_info_102b_f806,
- &pci_ss_info_102b_ff00,
- &pci_ss_info_102b_ff01,
- &pci_ss_info_102b_ff02,
- &pci_ss_info_102b_ff03,
- &pci_ss_info_102b_ff04,
- &pci_ss_info_102b_ff05,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_102c[] = {
- &pci_ss_info_102c_00c0,
- NULL
-};
-#define pci_ss_list_102d NULL
-#define pci_ss_list_102e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_102f[] = {
- &pci_ss_info_102f_00f8,
- NULL
-};
-#endif
-#define pci_ss_list_1030 NULL
-static const pciSubsystemInfo *pci_ss_list_1031[] = {
- &pci_ss_info_1031_7efe,
- &pci_ss_info_1031_fc00,
- NULL
-};
-#define pci_ss_list_1032 NULL
-static const pciSubsystemInfo *pci_ss_list_1033[] = {
- &pci_ss_info_1033_8000,
- &pci_ss_info_1033_800c,
- &pci_ss_info_1033_800d,
- &pci_ss_info_1033_8014,
- &pci_ss_info_1033_8015,
- &pci_ss_info_1033_8016,
- &pci_ss_info_1033_801f,
- &pci_ss_info_1033_8026,
- &pci_ss_info_1033_8029,
- &pci_ss_info_1033_802b,
- &pci_ss_info_1033_802f,
- &pci_ss_info_1033_803c,
- &pci_ss_info_1033_8047,
- &pci_ss_info_1033_804d,
- &pci_ss_info_1033_804f,
- &pci_ss_info_1033_8051,
- &pci_ss_info_1033_8054,
- &pci_ss_info_1033_8058,
- &pci_ss_info_1033_8063,
- &pci_ss_info_1033_8064,
- &pci_ss_info_1033_8065,
- &pci_ss_info_1033_8066,
- &pci_ss_info_1033_8068,
- &pci_ss_info_1033_8069,
- &pci_ss_info_1033_806a,
- &pci_ss_info_1033_8077,
- &pci_ss_info_1033_809d,
- &pci_ss_info_1033_80ac,
- &pci_ss_info_1033_80bc,
- NULL
-};
-#define pci_ss_list_1034 NULL
-#define pci_ss_list_1035 NULL
-#define pci_ss_list_1036 NULL
-#define pci_ss_list_1037 NULL
-#define pci_ss_list_1038 NULL
-static const pciSubsystemInfo *pci_ss_list_1039[] = {
- &pci_ss_info_1039_0000,
- &pci_ss_info_1039_0900,
- &pci_ss_info_1039_5513,
- &pci_ss_info_1039_6306,
- &pci_ss_info_1039_6326,
- &pci_ss_info_1039_7000,
- &pci_ss_info_1039_7016,
- &pci_ss_info_1039_7018,
- NULL
-};
-#define pci_ss_list_103a NULL
-#define pci_ss_list_103b NULL
-static const pciSubsystemInfo *pci_ss_list_103c[] = {
- &pci_ss_info_103c_0007,
- &pci_ss_info_103c_0008,
- &pci_ss_info_103c_000d,
- &pci_ss_info_103c_03a2,
- &pci_ss_info_103c_1040,
- &pci_ss_info_103c_1041,
- &pci_ss_info_103c_1042,
- &pci_ss_info_103c_1049,
- &pci_ss_info_103c_104a,
- &pci_ss_info_103c_104b,
- &pci_ss_info_103c_104c,
- &pci_ss_info_103c_1064,
- &pci_ss_info_103c_1065,
- &pci_ss_info_103c_106c,
- &pci_ss_info_103c_106e,
- &pci_ss_info_103c_10c0,
- &pci_ss_info_103c_10c2,
- &pci_ss_info_103c_10c3,
- &pci_ss_info_103c_10c6,
- &pci_ss_info_103c_10c7,
- &pci_ss_info_103c_10ca,
- &pci_ss_info_103c_10cb,
- &pci_ss_info_103c_10cc,
- &pci_ss_info_103c_10cd,
- &pci_ss_info_103c_10e3,
- &pci_ss_info_103c_10e4,
- &pci_ss_info_103c_10ea,
- &pci_ss_info_103c_1200,
- &pci_ss_info_103c_1207,
- &pci_ss_info_103c_1223,
- &pci_ss_info_103c_1226,
- &pci_ss_info_103c_1227,
- &pci_ss_info_103c_1279,
- &pci_ss_info_103c_1282,
- NULL
-};
-#define pci_ss_list_103e NULL
-#define pci_ss_list_103f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1040[] = {
- &pci_ss_info_1040_000f,
- &pci_ss_info_1040_0011,
- NULL
-};
-#endif
-#define pci_ss_list_1041 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1042[] = {
- &pci_ss_info_1042_1854,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1043[] = {
- &pci_ss_info_1043_0200,
- &pci_ss_info_1043_0201,
- &pci_ss_info_1043_0202,
- &pci_ss_info_1043_0205,
- &pci_ss_info_1043_0c11,
- &pci_ss_info_1043_4000,
- &pci_ss_info_1043_4008,
- &pci_ss_info_1043_4009,
- &pci_ss_info_1043_400a,
- &pci_ss_info_1043_400b,
- &pci_ss_info_1043_4015,
- &pci_ss_info_1043_4016,
- &pci_ss_info_1043_402f,
- &pci_ss_info_1043_4031,
- &pci_ss_info_1043_405b,
- &pci_ss_info_1043_405f,
- &pci_ss_info_1043_800b,
- &pci_ss_info_1043_801c,
- &pci_ss_info_1043_8027,
- &pci_ss_info_1043_802c,
- &pci_ss_info_1043_8033,
- &pci_ss_info_1043_803e,
- &pci_ss_info_1043_8040,
- &pci_ss_info_1043_8042,
- &pci_ss_info_1043_8044,
- &pci_ss_info_1043_8052,
- &pci_ss_info_1043_8053,
- &pci_ss_info_1043_8064,
- &pci_ss_info_1043_8077,
- &pci_ss_info_1043_807f,
- &pci_ss_info_1043_808c,
- &pci_ss_info_1043_8095,
- &pci_ss_info_1043_809e,
- &pci_ss_info_1043_80a8,
- &pci_ss_info_1043_80ad,
- &pci_ss_info_1043_80e2,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1044[] = {
- &pci_ss_info_1044_c001,
- &pci_ss_info_1044_c002,
- &pci_ss_info_1044_c003,
- &pci_ss_info_1044_c004,
- &pci_ss_info_1044_c005,
- &pci_ss_info_1044_c00a,
- &pci_ss_info_1044_c00b,
- &pci_ss_info_1044_c00c,
- &pci_ss_info_1044_c00d,
- &pci_ss_info_1044_c00e,
- &pci_ss_info_1044_c00f,
- &pci_ss_info_1044_c014,
- &pci_ss_info_1044_c015,
- &pci_ss_info_1044_c016,
- &pci_ss_info_1044_c01e,
- &pci_ss_info_1044_c01f,
- &pci_ss_info_1044_c020,
- &pci_ss_info_1044_c021,
- &pci_ss_info_1044_c028,
- &pci_ss_info_1044_c029,
- &pci_ss_info_1044_c02a,
- &pci_ss_info_1044_c03c,
- &pci_ss_info_1044_c03d,
- &pci_ss_info_1044_c03e,
- &pci_ss_info_1044_c046,
- &pci_ss_info_1044_c047,
- &pci_ss_info_1044_c048,
- &pci_ss_info_1044_c050,
- &pci_ss_info_1044_c051,
- &pci_ss_info_1044_c052,
- &pci_ss_info_1044_c05a,
- &pci_ss_info_1044_c05b,
- &pci_ss_info_1044_c064,
- &pci_ss_info_1044_c065,
- &pci_ss_info_1044_c066,
- NULL
-};
-#endif
-#define pci_ss_list_1045 NULL
-#define pci_ss_list_1046 NULL
-#define pci_ss_list_1047 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1048[] = {
- &pci_ss_info_1048_0a31,
- &pci_ss_info_1048_0a32,
- &pci_ss_info_1048_0a35,
- &pci_ss_info_1048_0c10,
- &pci_ss_info_1048_0c18,
- &pci_ss_info_1048_0c1b,
- &pci_ss_info_1048_0c21,
- &pci_ss_info_1048_0c3a,
- &pci_ss_info_1048_0c56,
- &pci_ss_info_1048_1500,
- NULL
-};
-#endif
-#define pci_ss_list_1049 NULL
-#define pci_ss_list_104a NULL
-#define pci_ss_list_104b NULL
-#define pci_ss_list_104c NULL
-static const pciSubsystemInfo *pci_ss_list_104d[] = {
- &pci_ss_info_104d_801b,
- &pci_ss_info_104d_802f,
- &pci_ss_info_104d_8032,
- &pci_ss_info_104d_8036,
- &pci_ss_info_104d_8044,
- &pci_ss_info_104d_8045,
- &pci_ss_info_104d_8049,
- &pci_ss_info_104d_8055,
- &pci_ss_info_104d_8056,
- &pci_ss_info_104d_805a,
- &pci_ss_info_104d_805f,
- &pci_ss_info_104d_8067,
- &pci_ss_info_104d_8074,
- &pci_ss_info_104d_8075,
- &pci_ss_info_104d_8077,
- &pci_ss_info_104d_807b,
- &pci_ss_info_104d_8083,
- &pci_ss_info_104d_8097,
- &pci_ss_info_104d_80df,
- &pci_ss_info_104d_80e7,
- &pci_ss_info_104d_830b,
- NULL
-};
-#define pci_ss_list_104e NULL
-#define pci_ss_list_104f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1050[] = {
- &pci_ss_info_1050_0001,
- &pci_ss_info_1050_0840,
- NULL
-};
-#endif
-#define pci_ss_list_1051 NULL
-#define pci_ss_list_1052 NULL
-#define pci_ss_list_1053 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1054[] = {
- &pci_ss_info_1054_7018,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1055[] = {
- &pci_ss_info_1055_e000,
- &pci_ss_info_1055_e002,
- &pci_ss_info_1055_e100,
- &pci_ss_info_1055_e102,
- &pci_ss_info_1055_e300,
- &pci_ss_info_1055_e302,
- NULL
-};
-#endif
-#define pci_ss_list_1056 NULL
-static const pciSubsystemInfo *pci_ss_list_1057[] = {
- &pci_ss_info_1057_0300,
- &pci_ss_info_1057_0301,
- &pci_ss_info_1057_0302,
- &pci_ss_info_1057_5600,
- NULL
-};
-#define pci_ss_list_1058 NULL
-#define pci_ss_list_1059 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_105a[] = {
- &pci_ss_info_105a_0000,
- &pci_ss_info_105a_0275,
- &pci_ss_info_105a_2168,
- &pci_ss_info_105a_4d30,
- &pci_ss_info_105a_4d33,
- &pci_ss_info_105a_4d39,
- &pci_ss_info_105a_4d68,
- &pci_ss_info_105a_5168,
- &pci_ss_info_105a_6269,
- NULL
-};
-#endif
-#define pci_ss_list_105b NULL
-#define pci_ss_list_105c NULL
-static const pciSubsystemInfo *pci_ss_list_105d[] = {
- &pci_ss_info_105d_0000,
- &pci_ss_info_105d_0001,
- &pci_ss_info_105d_0002,
- &pci_ss_info_105d_0003,
- &pci_ss_info_105d_0004,
- &pci_ss_info_105d_0005,
- &pci_ss_info_105d_0006,
- &pci_ss_info_105d_0007,
- &pci_ss_info_105d_0008,
- &pci_ss_info_105d_0009,
- &pci_ss_info_105d_000a,
- &pci_ss_info_105d_000b,
- &pci_ss_info_105d_0018,
- &pci_ss_info_105d_002a,
- &pci_ss_info_105d_0037,
- &pci_ss_info_105d_003a,
- &pci_ss_info_105d_092f,
- NULL
-};
-#define pci_ss_list_105e NULL
-#define pci_ss_list_105f NULL
-#define pci_ss_list_1060 NULL
-#define pci_ss_list_1061 NULL
-#define pci_ss_list_1062 NULL
-#define pci_ss_list_1063 NULL
-#define pci_ss_list_1064 NULL
-#define pci_ss_list_1065 NULL
-#define pci_ss_list_1066 NULL
-#define pci_ss_list_1067 NULL
-#define pci_ss_list_1068 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1069[] = {
- &pci_ss_info_1069_0020,
- NULL
-};
-#endif
-#define pci_ss_list_106a NULL
-#define pci_ss_list_106b NULL
-#define pci_ss_list_106c NULL
-#define pci_ss_list_106d NULL
-#define pci_ss_list_106e NULL
-#define pci_ss_list_106f NULL
-#define pci_ss_list_1070 NULL
-#define pci_ss_list_1071 NULL
-#define pci_ss_list_1072 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1073[] = {
- &pci_ss_info_1073_0004,
- &pci_ss_info_1073_0005,
- &pci_ss_info_1073_0006,
- &pci_ss_info_1073_0008,
- &pci_ss_info_1073_000a,
- &pci_ss_info_1073_000d,
- &pci_ss_info_1073_0010,
- &pci_ss_info_1073_0012,
- &pci_ss_info_1073_2000,
- NULL
-};
-#endif
-#define pci_ss_list_1074 NULL
-#define pci_ss_list_1075 NULL
-#define pci_ss_list_1076 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1077[] = {
- &pci_ss_info_1077_0001,
- &pci_ss_info_1077_0002,
- NULL
-};
-#endif
-#define pci_ss_list_1078 NULL
-#define pci_ss_list_1079 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_107a[] = {
- &pci_ss_info_107a_000c,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_107b[] = {
- &pci_ss_info_107b_5350,
- &pci_ss_info_107b_8030,
- &pci_ss_info_107b_8054,
- NULL
-};
-#endif
-#define pci_ss_list_107c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_107d[] = {
- &pci_ss_info_107d_2633,
- &pci_ss_info_107d_2720,
- &pci_ss_info_107d_2840,
- &pci_ss_info_107d_2896,
- &pci_ss_info_107d_5330,
- &pci_ss_info_107d_5350,
- &pci_ss_info_107d_6606,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_107e[] = {
- &pci_ss_info_107e_000e,
- &pci_ss_info_107e_000f,
- NULL
-};
-#endif
-#define pci_ss_list_107f NULL
-#define pci_ss_list_1080 NULL
-#define pci_ss_list_1081 NULL
-#define pci_ss_list_1082 NULL
-#define pci_ss_list_1083 NULL
-#define pci_ss_list_1084 NULL
-#define pci_ss_list_1085 NULL
-#define pci_ss_list_1086 NULL
-#define pci_ss_list_1087 NULL
-#define pci_ss_list_1088 NULL
-#define pci_ss_list_1089 NULL
-#define pci_ss_list_108a NULL
-#define pci_ss_list_108c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_108d[] = {
- &pci_ss_info_108d_0004,
- &pci_ss_info_108d_0007,
- &pci_ss_info_108d_0008,
- &pci_ss_info_108d_0016,
- &pci_ss_info_108d_0017,
- &pci_ss_info_108d_0022,
- &pci_ss_info_108d_0027,
- NULL
-};
-#endif
-#define pci_ss_list_108e NULL
-#define pci_ss_list_108f NULL
-#define pci_ss_list_1090 NULL
-#define pci_ss_list_1091 NULL
-static const pciSubsystemInfo *pci_ss_list_1092[] = {
- &pci_ss_info_1092_0003,
- &pci_ss_info_1092_0100,
- &pci_ss_info_1092_0127,
- &pci_ss_info_1092_0136,
- &pci_ss_info_1092_0141,
- &pci_ss_info_1092_0146,
- &pci_ss_info_1092_0148,
- &pci_ss_info_1092_0149,
- &pci_ss_info_1092_0152,
- &pci_ss_info_1092_0154,
- &pci_ss_info_1092_0155,
- &pci_ss_info_1092_0156,
- &pci_ss_info_1092_0157,
- &pci_ss_info_1092_0350,
- &pci_ss_info_1092_0440,
- &pci_ss_info_1092_0550,
- &pci_ss_info_1092_0552,
- &pci_ss_info_1092_094c,
- &pci_ss_info_1092_0a50,
- &pci_ss_info_1092_0a70,
- &pci_ss_info_1092_0a78,
- &pci_ss_info_1092_1092,
- &pci_ss_info_1092_2000,
- &pci_ss_info_1092_2100,
- &pci_ss_info_1092_2110,
- &pci_ss_info_1092_2200,
- &pci_ss_info_1092_3000,
- &pci_ss_info_1092_3001,
- &pci_ss_info_1092_3002,
- &pci_ss_info_1092_3003,
- &pci_ss_info_1092_3004,
- &pci_ss_info_1092_4000,
- &pci_ss_info_1092_4002,
- &pci_ss_info_1092_4100,
- &pci_ss_info_1092_4207,
- &pci_ss_info_1092_4800,
- &pci_ss_info_1092_4801,
- &pci_ss_info_1092_4803,
- &pci_ss_info_1092_4804,
- &pci_ss_info_1092_4807,
- &pci_ss_info_1092_4808,
- &pci_ss_info_1092_4809,
- &pci_ss_info_1092_480e,
- &pci_ss_info_1092_4810,
- &pci_ss_info_1092_4812,
- &pci_ss_info_1092_4815,
- &pci_ss_info_1092_4820,
- &pci_ss_info_1092_4822,
- &pci_ss_info_1092_4904,
- &pci_ss_info_1092_4905,
- &pci_ss_info_1092_4910,
- &pci_ss_info_1092_4914,
- &pci_ss_info_1092_4920,
- &pci_ss_info_1092_4a00,
- &pci_ss_info_1092_4a02,
- &pci_ss_info_1092_4a09,
- &pci_ss_info_1092_4a0b,
- &pci_ss_info_1092_4a0f,
- &pci_ss_info_1092_4e01,
- &pci_ss_info_1092_5932,
- &pci_ss_info_1092_5934,
- &pci_ss_info_1092_5952,
- &pci_ss_info_1092_5954,
- &pci_ss_info_1092_5a00,
- &pci_ss_info_1092_5a35,
- &pci_ss_info_1092_5a37,
- &pci_ss_info_1092_5a55,
- &pci_ss_info_1092_5a57,
- &pci_ss_info_1092_6820,
- &pci_ss_info_1092_6a02,
- &pci_ss_info_1092_7a02,
- &pci_ss_info_1092_8000,
- &pci_ss_info_1092_8030,
- &pci_ss_info_1092_8035,
- &pci_ss_info_1092_8225,
- &pci_ss_info_1092_8760,
- &pci_ss_info_1092_8a10,
- NULL
-};
-#define pci_ss_list_1093 NULL
-#define pci_ss_list_1094 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1095[] = {
- &pci_ss_info_1095_0670,
- NULL
-};
-#endif
-#define pci_ss_list_1096 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1097[] = {
- &pci_ss_info_1097_3d01,
- NULL
-};
-#endif
-#define pci_ss_list_1098 NULL
-#define pci_ss_list_1099 NULL
-#define pci_ss_list_109a NULL
-#define pci_ss_list_109b NULL
-#define pci_ss_list_109c NULL
-#define pci_ss_list_109d NULL
-#define pci_ss_list_109e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_109f[] = {
- &pci_ss_info_109f_1000,
- &pci_ss_info_109f_315d,
- &pci_ss_info_109f_3181,
- NULL
-};
-#endif
-#define pci_ss_list_10a0 NULL
-#define pci_ss_list_10a1 NULL
-#define pci_ss_list_10a2 NULL
-#define pci_ss_list_10a3 NULL
-#define pci_ss_list_10a4 NULL
-#define pci_ss_list_10a5 NULL
-#define pci_ss_list_10a6 NULL
-#define pci_ss_list_10a7 NULL
-#define pci_ss_list_10a8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10a9[] = {
- &pci_ss_info_10a9_8002,
- &pci_ss_info_10a9_8010,
- &pci_ss_info_10a9_8011,
- &pci_ss_info_10a9_8012,
- NULL
-};
-#endif
-#define pci_ss_list_10aa NULL
-#define pci_ss_list_10ab NULL
-#define pci_ss_list_10ac NULL
-#define pci_ss_list_10ad NULL
-#define pci_ss_list_10ae NULL
-#define pci_ss_list_10af NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b0[] = {
- &pci_ss_info_10b0_0001,
- &pci_ss_info_10b0_0002,
- NULL
-};
-#endif
-#define pci_ss_list_10b1 NULL
-#define pci_ss_list_10b2 NULL
-#define pci_ss_list_10b3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b4[] = {
- &pci_ss_info_10b4_1617,
- &pci_ss_info_10b4_1717,
- &pci_ss_info_10b4_1b1b,
- &pci_ss_info_10b4_1b1d,
- &pci_ss_info_10b4_1b1e,
- &pci_ss_info_10b4_1b20,
- &pci_ss_info_10b4_1b21,
- &pci_ss_info_10b4_1b22,
- &pci_ss_info_10b4_1b23,
- &pci_ss_info_10b4_1b27,
- &pci_ss_info_10b4_1b88,
- &pci_ss_info_10b4_201a,
- &pci_ss_info_10b4_202f,
- &pci_ss_info_10b4_222a,
- &pci_ss_info_10b4_2230,
- &pci_ss_info_10b4_2232,
- &pci_ss_info_10b4_2235,
- &pci_ss_info_10b4_237e,
- &pci_ss_info_10b4_273d,
- &pci_ss_info_10b4_273e,
- &pci_ss_info_10b4_2740,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b5[] = {
- &pci_ss_info_10b5_2036,
- &pci_ss_info_10b5_2273,
- &pci_ss_info_10b5_2455,
- &pci_ss_info_10b5_9050,
- &pci_ss_info_10b5_9080,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b6[] = {
- &pci_ss_info_10b6_0002,
- &pci_ss_info_10b6_0003,
- &pci_ss_info_10b6_0006,
- &pci_ss_info_10b6_0007,
- &pci_ss_info_10b6_0008,
- &pci_ss_info_10b6_0009,
- &pci_ss_info_10b6_000a,
- &pci_ss_info_10b6_000b,
- &pci_ss_info_10b6_000c,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b7[] = {
- &pci_ss_info_10b7_1000,
- &pci_ss_info_10b7_1001,
- &pci_ss_info_10b7_1002,
- &pci_ss_info_10b7_1003,
- &pci_ss_info_10b7_1004,
- &pci_ss_info_10b7_1005,
- &pci_ss_info_10b7_1006,
- &pci_ss_info_10b7_1007,
- &pci_ss_info_10b7_1008,
- &pci_ss_info_10b7_1100,
- &pci_ss_info_10b7_1101,
- &pci_ss_info_10b7_1102,
- &pci_ss_info_10b7_1201,
- &pci_ss_info_10b7_1202,
- &pci_ss_info_10b7_2000,
- &pci_ss_info_10b7_2001,
- &pci_ss_info_10b7_2101,
- &pci_ss_info_10b7_2102,
- &pci_ss_info_10b7_3000,
- &pci_ss_info_10b7_3590,
- &pci_ss_info_10b7_5a57,
- &pci_ss_info_10b7_5b57,
- &pci_ss_info_10b7_5c57,
- &pci_ss_info_10b7_615c,
- &pci_ss_info_10b7_6556,
- &pci_ss_info_10b7_656a,
- &pci_ss_info_10b7_656b,
- &pci_ss_info_10b7_7000,
- &pci_ss_info_10b7_9004,
- &pci_ss_info_10b7_9005,
- &pci_ss_info_10b7_9055,
- &pci_ss_info_10b7_9800,
- &pci_ss_info_10b7_9805,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b8[] = {
- &pci_ss_info_10b8_2001,
- &pci_ss_info_10b8_2002,
- &pci_ss_info_10b8_2003,
- &pci_ss_info_10b8_2005,
- &pci_ss_info_10b8_2011,
- &pci_ss_info_10b8_8034,
- &pci_ss_info_10b8_a011,
- &pci_ss_info_10b8_a012,
- &pci_ss_info_10b8_a014,
- &pci_ss_info_10b8_a015,
- &pci_ss_info_10b8_a016,
- &pci_ss_info_10b8_a017,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10b9[] = {
- &pci_ss_info_10b9_0111,
- &pci_ss_info_10b9_1521,
- &pci_ss_info_10b9_1523,
- &pci_ss_info_10b9_1533,
- &pci_ss_info_10b9_1541,
- &pci_ss_info_10b9_7101,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10ba[] = {
- &pci_ss_info_10ba_0e00,
- NULL
-};
-#endif
-#define pci_ss_list_10bb NULL
-#define pci_ss_list_10bc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10bd[] = {
- &pci_ss_info_10bd_0000,
- &pci_ss_info_10bd_0320,
- NULL
-};
-#endif
-#define pci_ss_list_10be NULL
-#define pci_ss_list_10bf NULL
-#define pci_ss_list_10c0 NULL
-#define pci_ss_list_10c1 NULL
-#define pci_ss_list_10c2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10c3[] = {
- &pci_ss_info_10c3_1100,
- NULL
-};
-#endif
-#define pci_ss_list_10c4 NULL
-#define pci_ss_list_10c5 NULL
-#define pci_ss_list_10c6 NULL
-#define pci_ss_list_10c7 NULL
-static const pciSubsystemInfo *pci_ss_list_10c8[] = {
- &pci_ss_info_10c8_0004,
- &pci_ss_info_10c8_0016,
- &pci_ss_info_10c8_8005,
- NULL
-};
-#define pci_ss_list_10c9 NULL
-#define pci_ss_list_10ca NULL
-#define pci_ss_list_10cb NULL
-#define pci_ss_list_10cc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10cd[] = {
- &pci_ss_info_10cd_1310,
- NULL
-};
-#endif
-#define pci_ss_list_10ce NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10cf[] = {
- &pci_ss_info_10cf_1029,
- &pci_ss_info_10cf_102c,
- &pci_ss_info_10cf_103c,
- &pci_ss_info_10cf_104a,
- &pci_ss_info_10cf_1055,
- &pci_ss_info_10cf_1056,
- &pci_ss_info_10cf_1057,
- &pci_ss_info_10cf_1059,
- &pci_ss_info_10cf_105f,
- &pci_ss_info_10cf_1063,
- &pci_ss_info_10cf_1064,
- &pci_ss_info_10cf_106a,
- &pci_ss_info_10cf_1072,
- &pci_ss_info_10cf_1094,
- &pci_ss_info_10cf_1095,
- &pci_ss_info_10cf_1098,
- &pci_ss_info_10cf_1099,
- &pci_ss_info_10cf_10a8,
- &pci_ss_info_10cf_10a9,
- &pci_ss_info_10cf_10aa,
- &pci_ss_info_10cf_10ab,
- &pci_ss_info_10cf_10ac,
- &pci_ss_info_10cf_10ad,
- &pci_ss_info_10cf_10b4,
- &pci_ss_info_10cf_1115,
- &pci_ss_info_10cf_1143,
- NULL
-};
-#endif
-#define pci_ss_list_10d0 NULL
-#define pci_ss_list_10d1 NULL
-#define pci_ss_list_10d2 NULL
-#define pci_ss_list_10d3 NULL
-#define pci_ss_list_10d4 NULL
-#define pci_ss_list_10d5 NULL
-#define pci_ss_list_10d6 NULL
-#define pci_ss_list_10d7 NULL
-#define pci_ss_list_10d8 NULL
-#define pci_ss_list_10d9 NULL
-#define pci_ss_list_10da NULL
-#define pci_ss_list_10db NULL
-#define pci_ss_list_10dc NULL
-#define pci_ss_list_10dd NULL
-static const pciSubsystemInfo *pci_ss_list_10de[] = {
- &pci_ss_info_10de_0005,
- &pci_ss_info_10de_000f,
- &pci_ss_info_10de_001e,
- &pci_ss_info_10de_0020,
- NULL
-};
-#define pci_ss_list_10df NULL
-#define pci_ss_list_10e0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10e1[] = {
- &pci_ss_info_10e1_0391,
- NULL
-};
-#endif
-#define pci_ss_list_10e2 NULL
-#define pci_ss_list_10e3 NULL
-#define pci_ss_list_10e4 NULL
-#define pci_ss_list_10e5 NULL
-#define pci_ss_list_10e6 NULL
-#define pci_ss_list_10e7 NULL
-#define pci_ss_list_10e8 NULL
-#define pci_ss_list_10e9 NULL
-#define pci_ss_list_10ea NULL
-#define pci_ss_list_10eb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10ec[] = {
- &pci_ss_info_10ec_8029,
- &pci_ss_info_10ec_8129,
- &pci_ss_info_10ec_8138,
- &pci_ss_info_10ec_8139,
- NULL
-};
-#endif
-#define pci_ss_list_10ed NULL
-#define pci_ss_list_10ee NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10ef[] = {
- &pci_ss_info_10ef_8169,
- NULL
-};
-#endif
-#define pci_ss_list_10f0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10f1[] = {
- &pci_ss_info_10f1_0002,
- &pci_ss_info_10f1_2462,
- NULL
-};
-#endif
-#define pci_ss_list_10f2 NULL
-#define pci_ss_list_10f3 NULL
-#define pci_ss_list_10f4 NULL
-#define pci_ss_list_10f5 NULL
-#define pci_ss_list_10f6 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_10f7[] = {
- &pci_ss_info_10f7_8308,
- &pci_ss_info_10f7_8309,
- &pci_ss_info_10f7_830b,
- &pci_ss_info_10f7_830d,
- &pci_ss_info_10f7_8312,
- NULL
-};
-#endif
-#define pci_ss_list_10f8 NULL
-#define pci_ss_list_10f9 NULL
-#define pci_ss_list_10fa NULL
-#define pci_ss_list_10fb NULL
-#define pci_ss_list_10fc NULL
-#define pci_ss_list_10fd NULL
-#define pci_ss_list_10fe NULL
-#define pci_ss_list_10ff NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1100[] = {
- &pci_ss_info_1100_102b,
- NULL
-};
-#endif
-#define pci_ss_list_1101 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1102[] = {
- &pci_ss_info_1102_0010,
- &pci_ss_info_1102_0020,
- &pci_ss_info_1102_0021,
- &pci_ss_info_1102_002f,
- &pci_ss_info_1102_0040,
- &pci_ss_info_1102_0051,
- &pci_ss_info_1102_0053,
- &pci_ss_info_1102_100f,
- &pci_ss_info_1102_1015,
- &pci_ss_info_1102_1016,
- &pci_ss_info_1102_1018,
- &pci_ss_info_1102_101d,
- &pci_ss_info_1102_101e,
- &pci_ss_info_1102_1020,
- &pci_ss_info_1102_1021,
- &pci_ss_info_1102_1023,
- &pci_ss_info_1102_1024,
- &pci_ss_info_1102_1026,
- &pci_ss_info_1102_1029,
- &pci_ss_info_1102_102c,
- &pci_ss_info_1102_102d,
- &pci_ss_info_1102_102e,
- &pci_ss_info_1102_102f,
- &pci_ss_info_1102_1031,
- &pci_ss_info_1102_1034,
- &pci_ss_info_1102_4001,
- &pci_ss_info_1102_8022,
- &pci_ss_info_1102_8023,
- &pci_ss_info_1102_8024,
- &pci_ss_info_1102_8025,
- &pci_ss_info_1102_8026,
- &pci_ss_info_1102_8027,
- &pci_ss_info_1102_8028,
- &pci_ss_info_1102_8031,
- &pci_ss_info_1102_8040,
- &pci_ss_info_1102_8051,
- &pci_ss_info_1102_8061,
- &pci_ss_info_1102_8064,
- &pci_ss_info_1102_8065,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1103[] = {
- &pci_ss_info_1103_0001,
- &pci_ss_info_1103_0005,
- NULL
-};
-#endif
-#define pci_ss_list_1104 NULL
-#define pci_ss_list_1105 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1106[] = {
- &pci_ss_info_1106_0000,
- &pci_ss_info_1106_0100,
- &pci_ss_info_1106_0102,
- &pci_ss_info_1106_0571,
- &pci_ss_info_1106_0686,
- &pci_ss_info_1106_4511,
- NULL
-};
-#endif
-#define pci_ss_list_1107 NULL
-#define pci_ss_list_1108 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1109[] = {
- &pci_ss_info_1109_2400,
- &pci_ss_info_1109_2a00,
- &pci_ss_info_1109_2b00,
- &pci_ss_info_1109_3000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_110a[] = {
- &pci_ss_info_110a_0018,
- &pci_ss_info_110a_001e,
- &pci_ss_info_110a_0032,
- &pci_ss_info_110a_8005,
- NULL
-};
-#endif
-#define pci_ss_list_110b NULL
-#define pci_ss_list_110c NULL
-#define pci_ss_list_110d NULL
-#define pci_ss_list_110e NULL
-#define pci_ss_list_110f NULL
-#define pci_ss_list_1110 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1111[] = {
- &pci_ss_info_1111_1111,
- &pci_ss_info_1111_1112,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1112[] = {
- &pci_ss_info_1112_2300,
- &pci_ss_info_1112_2320,
- &pci_ss_info_1112_2340,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1113[] = {
- &pci_ss_info_1113_1207,
- &pci_ss_info_1113_1208,
- &pci_ss_info_1113_1211,
- &pci_ss_info_1113_1220,
- &pci_ss_info_1113_2220,
- &pci_ss_info_1113_9211,
- NULL
-};
-#endif
-#define pci_ss_list_1114 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1115[] = {
- &pci_ss_info_1115_1181,
- NULL
-};
-#endif
-#define pci_ss_list_1116 NULL
-#define pci_ss_list_1117 NULL
-#define pci_ss_list_1118 NULL
-#define pci_ss_list_1119 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_111a[] = {
- &pci_ss_info_111a_0000,
- &pci_ss_info_111a_0001,
- &pci_ss_info_111a_0009,
- &pci_ss_info_111a_0101,
- &pci_ss_info_111a_0109,
- &pci_ss_info_111a_0809,
- &pci_ss_info_111a_0909,
- &pci_ss_info_111a_0a09,
- &pci_ss_info_111a_1001,
- &pci_ss_info_111a_1020,
- NULL
-};
-#endif
-#define pci_ss_list_111b NULL
-#define pci_ss_list_111c NULL
-#define pci_ss_list_111d NULL
-#define pci_ss_list_111e NULL
-#define pci_ss_list_111f NULL
-#define pci_ss_list_1120 NULL
-#define pci_ss_list_1121 NULL
-#define pci_ss_list_1122 NULL
-#define pci_ss_list_1123 NULL
-#define pci_ss_list_1124 NULL
-#define pci_ss_list_1125 NULL
-#define pci_ss_list_1126 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1127[] = {
- &pci_ss_info_1127_0400,
- NULL
-};
-#endif
-#define pci_ss_list_1129 NULL
-#define pci_ss_list_112a NULL
-#define pci_ss_list_112b NULL
-#define pci_ss_list_112c NULL
-#define pci_ss_list_112d NULL
-#define pci_ss_list_112e NULL
-#define pci_ss_list_112f NULL
-#define pci_ss_list_1130 NULL
-#define pci_ss_list_1131 NULL
-#define pci_ss_list_1132 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1133[] = {
- &pci_ss_info_1133_e001,
- &pci_ss_info_1133_e002,
- &pci_ss_info_1133_e003,
- &pci_ss_info_1133_e004,
- &pci_ss_info_1133_e005,
- &pci_ss_info_1133_e010,
- &pci_ss_info_1133_e012,
- &pci_ss_info_1133_e014,
- NULL
-};
-#endif
-#define pci_ss_list_1134 NULL
-#define pci_ss_list_1135 NULL
-#define pci_ss_list_1136 NULL
-#define pci_ss_list_1137 NULL
-#define pci_ss_list_1138 NULL
-#define pci_ss_list_1139 NULL
-#define pci_ss_list_113a NULL
-#define pci_ss_list_113b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_113c[] = {
- &pci_ss_info_113c_03a2,
- NULL
-};
-#endif
-#define pci_ss_list_113d NULL
-#define pci_ss_list_113e NULL
-#define pci_ss_list_113f NULL
-#define pci_ss_list_1140 NULL
-#define pci_ss_list_1141 NULL
-#define pci_ss_list_1142 NULL
-#define pci_ss_list_1143 NULL
-#define pci_ss_list_1144 NULL
-#define pci_ss_list_1145 NULL
-#define pci_ss_list_1146 NULL
-#define pci_ss_list_1147 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1148[] = {
- &pci_ss_info_1148_5021,
- &pci_ss_info_1148_5041,
- &pci_ss_info_1148_5043,
- &pci_ss_info_1148_5051,
- &pci_ss_info_1148_5061,
- &pci_ss_info_1148_5071,
- &pci_ss_info_1148_5521,
- &pci_ss_info_1148_5522,
- &pci_ss_info_1148_5541,
- &pci_ss_info_1148_5543,
- &pci_ss_info_1148_5544,
- &pci_ss_info_1148_5821,
- &pci_ss_info_1148_5822,
- &pci_ss_info_1148_5841,
- &pci_ss_info_1148_5843,
- &pci_ss_info_1148_5844,
- &pci_ss_info_1148_9521,
- &pci_ss_info_1148_9821,
- &pci_ss_info_1148_9822,
- &pci_ss_info_1148_9841,
- &pci_ss_info_1148_9842,
- &pci_ss_info_1148_9843,
- &pci_ss_info_1148_9844,
- &pci_ss_info_1148_9861,
- &pci_ss_info_1148_9862,
- &pci_ss_info_1148_9871,
- &pci_ss_info_1148_9872,
- NULL
-};
-#endif
-#define pci_ss_list_1149 NULL
-#define pci_ss_list_114a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_114b[] = {
- &pci_ss_info_114b_2003,
- NULL
-};
-#endif
-#define pci_ss_list_114c NULL
-#define pci_ss_list_114d NULL
-#define pci_ss_list_114e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_114f[] = {
- &pci_ss_info_114f_0030,
- &pci_ss_info_114f_0031,
- &pci_ss_info_114f_0050,
- &pci_ss_info_114f_0051,
- &pci_ss_info_114f_0052,
- &pci_ss_info_114f_0053,
- NULL
-};
-#endif
-#define pci_ss_list_1150 NULL
-#define pci_ss_list_1151 NULL
-#define pci_ss_list_1152 NULL
-#define pci_ss_list_1153 NULL
-#define pci_ss_list_1154 NULL
-#define pci_ss_list_1155 NULL
-#define pci_ss_list_1156 NULL
-#define pci_ss_list_1157 NULL
-#define pci_ss_list_1158 NULL
-#define pci_ss_list_1159 NULL
-#define pci_ss_list_115a NULL
-#define pci_ss_list_115b NULL
-#define pci_ss_list_115c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_115d[] = {
- &pci_ss_info_115d_0002,
- &pci_ss_info_115d_0181,
- &pci_ss_info_115d_0182,
- &pci_ss_info_115d_0183,
- &pci_ss_info_115d_1081,
- &pci_ss_info_115d_1181,
- &pci_ss_info_115d_1182,
- NULL
-};
-#endif
-#define pci_ss_list_115e NULL
-#define pci_ss_list_115f NULL
-#define pci_ss_list_1160 NULL
-#define pci_ss_list_1161 NULL
-#define pci_ss_list_1162 NULL
-#define pci_ss_list_1163 NULL
-#define pci_ss_list_1164 NULL
-#define pci_ss_list_1165 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1166[] = {
- &pci_ss_info_1166_1648,
- NULL
-};
-#endif
-#define pci_ss_list_1167 NULL
-#define pci_ss_list_1168 NULL
-#define pci_ss_list_1169 NULL
-#define pci_ss_list_116a NULL
-#define pci_ss_list_116b NULL
-#define pci_ss_list_116c NULL
-#define pci_ss_list_116d NULL
-#define pci_ss_list_116e NULL
-#define pci_ss_list_116f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1170[] = {
- &pci_ss_info_1170_3209,
- NULL
-};
-#endif
-#define pci_ss_list_1171 NULL
-#define pci_ss_list_1172 NULL
-#define pci_ss_list_1173 NULL
-#define pci_ss_list_1174 NULL
-#define pci_ss_list_1175 NULL
-#define pci_ss_list_1176 NULL
-#define pci_ss_list_1177 NULL
-#define pci_ss_list_1178 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1179[] = {
- &pci_ss_info_1179_0001,
- &pci_ss_info_1179_0002,
- &pci_ss_info_1179_0003,
- &pci_ss_info_1179_0181,
- &pci_ss_info_1179_0203,
- &pci_ss_info_1179_0204,
- &pci_ss_info_1179_ff00,
- &pci_ss_info_1179_ff01,
- NULL
-};
-#endif
-#define pci_ss_list_117a NULL
-#define pci_ss_list_117b NULL
-#define pci_ss_list_117c NULL
-#define pci_ss_list_117d NULL
-#define pci_ss_list_117e NULL
-#define pci_ss_list_117f NULL
-#define pci_ss_list_1180 NULL
-#define pci_ss_list_1181 NULL
-#define pci_ss_list_1183 NULL
-#define pci_ss_list_1184 NULL
-#define pci_ss_list_1185 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1186[] = {
- &pci_ss_info_1186_0100,
- &pci_ss_info_1186_0300,
- &pci_ss_info_1186_1002,
- &pci_ss_info_1186_1012,
- &pci_ss_info_1186_1100,
- &pci_ss_info_1186_1101,
- &pci_ss_info_1186_1102,
- &pci_ss_info_1186_1112,
- &pci_ss_info_1186_1140,
- &pci_ss_info_1186_1142,
- &pci_ss_info_1186_1200,
- &pci_ss_info_1186_1300,
- &pci_ss_info_1186_1301,
- &pci_ss_info_1186_1320,
- &pci_ss_info_1186_1400,
- &pci_ss_info_1186_1401,
- &pci_ss_info_1186_3501,
- &pci_ss_info_1186_7801,
- &pci_ss_info_1186_8139,
- NULL
-};
-#endif
-#define pci_ss_list_1187 NULL
-#define pci_ss_list_1188 NULL
-#define pci_ss_list_1189 NULL
-#define pci_ss_list_118a NULL
-#define pci_ss_list_118b NULL
-#define pci_ss_list_118c NULL
-#define pci_ss_list_118d NULL
-#define pci_ss_list_118e NULL
-#define pci_ss_list_118f NULL
-#define pci_ss_list_1190 NULL
-#define pci_ss_list_1191 NULL
-#define pci_ss_list_1192 NULL
-#define pci_ss_list_1193 NULL
-#define pci_ss_list_1194 NULL
-#define pci_ss_list_1195 NULL
-#define pci_ss_list_1196 NULL
-#define pci_ss_list_1197 NULL
-#define pci_ss_list_1198 NULL
-#define pci_ss_list_1199 NULL
-#define pci_ss_list_119a NULL
-#define pci_ss_list_119b NULL
-#define pci_ss_list_119c NULL
-#define pci_ss_list_119d NULL
-#define pci_ss_list_119e NULL
-#define pci_ss_list_119f NULL
-#define pci_ss_list_11a0 NULL
-#define pci_ss_list_11a1 NULL
-#define pci_ss_list_11a2 NULL
-#define pci_ss_list_11a3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11a4[] = {
- &pci_ss_info_11a4_000a,
- &pci_ss_info_11a4_000b,
- NULL
-};
-#endif
-#define pci_ss_list_11a5 NULL
-#define pci_ss_list_11a6 NULL
-#define pci_ss_list_11a7 NULL
-#define pci_ss_list_11a8 NULL
-#define pci_ss_list_11a9 NULL
-#define pci_ss_list_11aa NULL
-#define pci_ss_list_11ab NULL
-#define pci_ss_list_11ac NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11ad[] = {
- &pci_ss_info_11ad_0002,
- &pci_ss_info_11ad_0003,
- &pci_ss_info_11ad_c001,
- &pci_ss_info_11ad_f003,
- &pci_ss_info_11ad_ffff,
- NULL
-};
-#endif
-#define pci_ss_list_11ae NULL
-#define pci_ss_list_11af NULL
-#define pci_ss_list_11b0 NULL
-#define pci_ss_list_11b1 NULL
-#define pci_ss_list_11b2 NULL
-#define pci_ss_list_11b3 NULL
-#define pci_ss_list_11b4 NULL
-#define pci_ss_list_11b5 NULL
-#define pci_ss_list_11b6 NULL
-#define pci_ss_list_11b7 NULL
-#define pci_ss_list_11b8 NULL
-#define pci_ss_list_11b9 NULL
-#define pci_ss_list_11ba NULL
-#define pci_ss_list_11bb NULL
-#define pci_ss_list_11bc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11bd[] = {
- &pci_ss_info_11bd_0006,
- &pci_ss_info_11bd_000a,
- &pci_ss_info_11bd_000e,
- &pci_ss_info_11bd_0012,
- &pci_ss_info_11bd_001c,
- NULL
-};
-#endif
-#define pci_ss_list_11be NULL
-#define pci_ss_list_11bf NULL
-#define pci_ss_list_11c0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11c1[] = {
- &pci_ss_info_11c1_0440,
- &pci_ss_info_11c1_0441,
- &pci_ss_info_11c1_0442,
- NULL
-};
-#endif
-#define pci_ss_list_11c2 NULL
-#define pci_ss_list_11c3 NULL
-#define pci_ss_list_11c4 NULL
-#define pci_ss_list_11c5 NULL
-#define pci_ss_list_11c6 NULL
-#define pci_ss_list_11c7 NULL
-#define pci_ss_list_11c8 NULL
-#define pci_ss_list_11c9 NULL
-#define pci_ss_list_11ca NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11cb[] = {
- &pci_ss_info_11cb_0200,
- &pci_ss_info_11cb_b008,
- NULL
-};
-#endif
-#define pci_ss_list_11cc NULL
-#define pci_ss_list_11cd NULL
-#define pci_ss_list_11ce NULL
-#define pci_ss_list_11cf NULL
-#define pci_ss_list_11d0 NULL
-#define pci_ss_list_11d1 NULL
-#define pci_ss_list_11d2 NULL
-#define pci_ss_list_11d3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11d4[] = {
- &pci_ss_info_11d4_0040,
- &pci_ss_info_11d4_0048,
- &pci_ss_info_11d4_5340,
- NULL
-};
-#endif
-#define pci_ss_list_11d5 NULL
-#define pci_ss_list_11d6 NULL
-#define pci_ss_list_11d7 NULL
-#define pci_ss_list_11d8 NULL
-#define pci_ss_list_11d9 NULL
-#define pci_ss_list_11da NULL
-#define pci_ss_list_11db NULL
-#define pci_ss_list_11dc NULL
-#define pci_ss_list_11dd NULL
-#define pci_ss_list_11de NULL
-#define pci_ss_list_11df NULL
-#define pci_ss_list_11e0 NULL
-#define pci_ss_list_11e1 NULL
-#define pci_ss_list_11e2 NULL
-#define pci_ss_list_11e3 NULL
-#define pci_ss_list_11e4 NULL
-#define pci_ss_list_11e5 NULL
-#define pci_ss_list_11e6 NULL
-#define pci_ss_list_11e7 NULL
-#define pci_ss_list_11e8 NULL
-#define pci_ss_list_11e9 NULL
-#define pci_ss_list_11ea NULL
-#define pci_ss_list_11eb NULL
-#define pci_ss_list_11ec NULL
-#define pci_ss_list_11ed NULL
-#define pci_ss_list_11ee NULL
-#define pci_ss_list_11ef NULL
-#define pci_ss_list_11f0 NULL
-#define pci_ss_list_11f1 NULL
-#define pci_ss_list_11f2 NULL
-#define pci_ss_list_11f3 NULL
-#define pci_ss_list_11f4 NULL
-#define pci_ss_list_11f5 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_11f6[] = {
- &pci_ss_info_11f6_0503,
- &pci_ss_info_11f6_2011,
- &pci_ss_info_11f6_8139,
- NULL
-};
-#endif
-#define pci_ss_list_11f7 NULL
-#define pci_ss_list_11f8 NULL
-#define pci_ss_list_11f9 NULL
-#define pci_ss_list_11fa NULL
-#define pci_ss_list_11fb NULL
-#define pci_ss_list_11fc NULL
-#define pci_ss_list_11fd NULL
-#define pci_ss_list_11fe NULL
-#define pci_ss_list_11ff NULL
-#define pci_ss_list_1200 NULL
-#define pci_ss_list_1201 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1202[] = {
- &pci_ss_info_1202_9841,
- &pci_ss_info_1202_9842,
- &pci_ss_info_1202_9843,
- &pci_ss_info_1202_9844,
- NULL
-};
-#endif
-#define pci_ss_list_1203 NULL
-#define pci_ss_list_1204 NULL
-#define pci_ss_list_1205 NULL
-#define pci_ss_list_1206 NULL
-#define pci_ss_list_1208 NULL
-#define pci_ss_list_1209 NULL
-#define pci_ss_list_120a NULL
-#define pci_ss_list_120b NULL
-#define pci_ss_list_120c NULL
-#define pci_ss_list_120d NULL
-#define pci_ss_list_120e NULL
-#define pci_ss_list_120f NULL
-#define pci_ss_list_1210 NULL
-#define pci_ss_list_1211 NULL
-#define pci_ss_list_1212 NULL
-#define pci_ss_list_1213 NULL
-#define pci_ss_list_1214 NULL
-#define pci_ss_list_1215 NULL
-#define pci_ss_list_1216 NULL
-#define pci_ss_list_1217 NULL
-#define pci_ss_list_1218 NULL
-#define pci_ss_list_1219 NULL
-static const pciSubsystemInfo *pci_ss_list_121a[] = {
- &pci_ss_info_121a_0001,
- &pci_ss_info_121a_0003,
- &pci_ss_info_121a_0004,
- &pci_ss_info_121a_0009,
- &pci_ss_info_121a_0030,
- &pci_ss_info_121a_0031,
- &pci_ss_info_121a_0034,
- &pci_ss_info_121a_0036,
- &pci_ss_info_121a_0037,
- &pci_ss_info_121a_0038,
- &pci_ss_info_121a_003a,
- &pci_ss_info_121a_0044,
- &pci_ss_info_121a_004b,
- &pci_ss_info_121a_004c,
- &pci_ss_info_121a_004d,
- &pci_ss_info_121a_004e,
- &pci_ss_info_121a_0051,
- &pci_ss_info_121a_0052,
- &pci_ss_info_121a_0060,
- &pci_ss_info_121a_0061,
- &pci_ss_info_121a_0062,
- NULL
-};
-#define pci_ss_list_121b NULL
-#define pci_ss_list_121c NULL
-#define pci_ss_list_121d NULL
-#define pci_ss_list_121e NULL
-#define pci_ss_list_121f NULL
-#define pci_ss_list_1220 NULL
-#define pci_ss_list_1221 NULL
-#define pci_ss_list_1222 NULL
-#define pci_ss_list_1223 NULL
-#define pci_ss_list_1224 NULL
-#define pci_ss_list_1225 NULL
-#define pci_ss_list_1227 NULL
-#define pci_ss_list_1228 NULL
-#define pci_ss_list_1229 NULL
-#define pci_ss_list_122a NULL
-#define pci_ss_list_122b NULL
-#define pci_ss_list_122c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_122d[] = {
- &pci_ss_info_122d_0001,
- &pci_ss_info_122d_1002,
- &pci_ss_info_122d_1206,
- &pci_ss_info_122d_1207,
- &pci_ss_info_122d_1208,
- &pci_ss_info_122d_4002,
- &pci_ss_info_122d_4003,
- &pci_ss_info_122d_4005,
- &pci_ss_info_122d_4006,
- &pci_ss_info_122d_4007,
- &pci_ss_info_122d_4008,
- &pci_ss_info_122d_4009,
- &pci_ss_info_122d_4010,
- &pci_ss_info_122d_4011,
- &pci_ss_info_122d_4012,
- &pci_ss_info_122d_4013,
- &pci_ss_info_122d_4015,
- &pci_ss_info_122d_4016,
- &pci_ss_info_122d_4017,
- &pci_ss_info_122d_4018,
- &pci_ss_info_122d_4019,
- &pci_ss_info_122d_4020,
- &pci_ss_info_122d_4021,
- &pci_ss_info_122d_4022,
- &pci_ss_info_122d_4023,
- &pci_ss_info_122d_4024,
- &pci_ss_info_122d_4025,
- &pci_ss_info_122d_4027,
- &pci_ss_info_122d_4029,
- &pci_ss_info_122d_4030,
- &pci_ss_info_122d_4031,
- &pci_ss_info_122d_4033,
- &pci_ss_info_122d_4034,
- &pci_ss_info_122d_4035,
- &pci_ss_info_122d_4050,
- &pci_ss_info_122d_4051,
- &pci_ss_info_122d_4052,
- &pci_ss_info_122d_4054,
- &pci_ss_info_122d_4055,
- &pci_ss_info_122d_4056,
- &pci_ss_info_122d_4057,
- &pci_ss_info_122d_4100,
- &pci_ss_info_122d_4101,
- &pci_ss_info_122d_4102,
- &pci_ss_info_122d_4302,
- NULL
-};
-#endif
-#define pci_ss_list_122e NULL
-#define pci_ss_list_122f NULL
-#define pci_ss_list_1230 NULL
-#define pci_ss_list_1231 NULL
-#define pci_ss_list_1232 NULL
-#define pci_ss_list_1233 NULL
-#define pci_ss_list_1234 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1235[] = {
- &pci_ss_info_1235_4320,
- &pci_ss_info_1235_4321,
- &pci_ss_info_1235_4322,
- &pci_ss_info_1235_4324,
- NULL
-};
-#endif
-#define pci_ss_list_1236 NULL
-#define pci_ss_list_1237 NULL
-#define pci_ss_list_1238 NULL
-#define pci_ss_list_1239 NULL
-#define pci_ss_list_123a NULL
-#define pci_ss_list_123b NULL
-#define pci_ss_list_123c NULL
-#define pci_ss_list_123d NULL
-#define pci_ss_list_123e NULL
-#define pci_ss_list_123f NULL
-#define pci_ss_list_1240 NULL
-#define pci_ss_list_1241 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1242[] = {
- &pci_ss_info_1242_6562,
- &pci_ss_info_1242_656a,
- NULL
-};
-#endif
-#define pci_ss_list_1243 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1244[] = {
- &pci_ss_info_1244_0a00,
- NULL
-};
-#endif
-#define pci_ss_list_1245 NULL
-#define pci_ss_list_1246 NULL
-#define pci_ss_list_1247 NULL
-#define pci_ss_list_1248 NULL
-#define pci_ss_list_1249 NULL
-#define pci_ss_list_124a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_124b[] = {
- &pci_ss_info_124b_9080,
- NULL
-};
-#endif
-#define pci_ss_list_124c NULL
-#define pci_ss_list_124d NULL
-#define pci_ss_list_124e NULL
-#define pci_ss_list_124f NULL
-#define pci_ss_list_1250 NULL
-#define pci_ss_list_1251 NULL
-#define pci_ss_list_1253 NULL
-#define pci_ss_list_1254 NULL
-#define pci_ss_list_1255 NULL
-#define pci_ss_list_1256 NULL
-#define pci_ss_list_1257 NULL
-#define pci_ss_list_1258 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1259[] = {
- &pci_ss_info_1259_2400,
- &pci_ss_info_1259_2450,
- &pci_ss_info_1259_2454,
- &pci_ss_info_1259_2500,
- &pci_ss_info_1259_2503,
- &pci_ss_info_1259_2560,
- &pci_ss_info_1259_2561,
- &pci_ss_info_1259_2700,
- &pci_ss_info_1259_2701,
- &pci_ss_info_1259_2800,
- &pci_ss_info_1259_2970,
- &pci_ss_info_1259_2972,
- &pci_ss_info_1259_2975,
- &pci_ss_info_1259_2977,
- NULL
-};
-#endif
-#define pci_ss_list_125a NULL
-#define pci_ss_list_125b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_125c[] = {
- &pci_ss_info_125c_0640,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_125d[] = {
- &pci_ss_info_125d_0424,
- &pci_ss_info_125d_0425,
- &pci_ss_info_125d_0426,
- &pci_ss_info_125d_0427,
- &pci_ss_info_125d_0428,
- &pci_ss_info_125d_0429,
- &pci_ss_info_125d_1988,
- &pci_ss_info_125d_1989,
- &pci_ss_info_125d_8888,
- NULL
-};
-#endif
-#define pci_ss_list_125e NULL
-#define pci_ss_list_125f NULL
-#define pci_ss_list_1260 NULL
-#define pci_ss_list_1261 NULL
-#define pci_ss_list_1262 NULL
-#define pci_ss_list_1263 NULL
-#define pci_ss_list_1264 NULL
-#define pci_ss_list_1265 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1266[] = {
- &pci_ss_info_1266_0001,
- &pci_ss_info_1266_0004,
- &pci_ss_info_1266_1910,
- NULL
-};
-#endif
-#define pci_ss_list_1267 NULL
-#define pci_ss_list_1268 NULL
-#define pci_ss_list_1269 NULL
-#define pci_ss_list_126a NULL
-#define pci_ss_list_126b NULL
-#define pci_ss_list_126c NULL
-#define pci_ss_list_126d NULL
-#define pci_ss_list_126e NULL
-#define pci_ss_list_126f NULL
-#define pci_ss_list_1270 NULL
-#define pci_ss_list_1271 NULL
-#define pci_ss_list_1272 NULL
-#define pci_ss_list_1273 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1274[] = {
- &pci_ss_info_1274_1371,
- &pci_ss_info_1274_2000,
- &pci_ss_info_1274_2003,
- &pci_ss_info_1274_5880,
- NULL
-};
-#endif
-#define pci_ss_list_1275 NULL
-#define pci_ss_list_1276 NULL
-#define pci_ss_list_1277 NULL
-#define pci_ss_list_1278 NULL
-#define pci_ss_list_1279 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_127a[] = {
- &pci_ss_info_127a_0001,
- &pci_ss_info_127a_0002,
- &pci_ss_info_127a_0003,
- &pci_ss_info_127a_0044,
- &pci_ss_info_127a_0048,
- &pci_ss_info_127a_0122,
- &pci_ss_info_127a_0144,
- &pci_ss_info_127a_0222,
- &pci_ss_info_127a_0244,
- &pci_ss_info_127a_0322,
- &pci_ss_info_127a_0422,
- &pci_ss_info_127a_1002,
- &pci_ss_info_127a_1122,
- &pci_ss_info_127a_1222,
- &pci_ss_info_127a_1322,
- &pci_ss_info_127a_1522,
- &pci_ss_info_127a_1622,
- &pci_ss_info_127a_1722,
- &pci_ss_info_127a_4311,
- NULL
-};
-#endif
-#define pci_ss_list_127b NULL
-#define pci_ss_list_127c NULL
-#define pci_ss_list_127d NULL
-#define pci_ss_list_127e NULL
-#define pci_ss_list_127f NULL
-#define pci_ss_list_1280 NULL
-#define pci_ss_list_1281 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1282[] = {
- &pci_ss_info_1282_9100,
- NULL
-};
-#endif
-#define pci_ss_list_1283 NULL
-#define pci_ss_list_1284 NULL
-#define pci_ss_list_1285 NULL
-#define pci_ss_list_1286 NULL
-#define pci_ss_list_1287 NULL
-#define pci_ss_list_1288 NULL
-#define pci_ss_list_1289 NULL
-#define pci_ss_list_128a NULL
-#define pci_ss_list_128b NULL
-#define pci_ss_list_128c NULL
-#define pci_ss_list_128d NULL
-#define pci_ss_list_128e NULL
-#define pci_ss_list_128f NULL
-#define pci_ss_list_1290 NULL
-#define pci_ss_list_1291 NULL
-#define pci_ss_list_1292 NULL
-#define pci_ss_list_1293 NULL
-#define pci_ss_list_1294 NULL
-#define pci_ss_list_1295 NULL
-#define pci_ss_list_1296 NULL
-#define pci_ss_list_1297 NULL
-#define pci_ss_list_1298 NULL
-#define pci_ss_list_1299 NULL
-#define pci_ss_list_129a NULL
-#define pci_ss_list_129b NULL
-#define pci_ss_list_129c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_129d[] = {
- &pci_ss_info_129d_0002,
- NULL
-};
-#endif
-#define pci_ss_list_129e NULL
-#define pci_ss_list_129f NULL
-#define pci_ss_list_12a0 NULL
-#define pci_ss_list_12a1 NULL
-#define pci_ss_list_12a2 NULL
-#define pci_ss_list_12a3 NULL
-#define pci_ss_list_12a4 NULL
-#define pci_ss_list_12a5 NULL
-#define pci_ss_list_12a6 NULL
-#define pci_ss_list_12a7 NULL
-#define pci_ss_list_12a8 NULL
-#define pci_ss_list_12a9 NULL
-#define pci_ss_list_12aa NULL
-#define pci_ss_list_12ab NULL
-#define pci_ss_list_12ac NULL
-#define pci_ss_list_12ad NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12ae[] = {
- &pci_ss_info_12ae_0001,
- &pci_ss_info_12ae_0002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12af[] = {
- &pci_ss_info_12af_0019,
- NULL
-};
-#endif
-#define pci_ss_list_12b0 NULL
-#define pci_ss_list_12b1 NULL
-#define pci_ss_list_12b2 NULL
-#define pci_ss_list_12b3 NULL
-#define pci_ss_list_12b4 NULL
-#define pci_ss_list_12b5 NULL
-#define pci_ss_list_12b6 NULL
-#define pci_ss_list_12b7 NULL
-#define pci_ss_list_12b8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12b9[] = {
- &pci_ss_info_12b9_005c,
- &pci_ss_info_12b9_005e,
- &pci_ss_info_12b9_0062,
- &pci_ss_info_12b9_0068,
- &pci_ss_info_12b9_007a,
- &pci_ss_info_12b9_007f,
- &pci_ss_info_12b9_0080,
- &pci_ss_info_12b9_0081,
- &pci_ss_info_12b9_0091,
- &pci_ss_info_12b9_00a2,
- &pci_ss_info_12b9_00a3,
- &pci_ss_info_12b9_00aa,
- &pci_ss_info_12b9_00ab,
- &pci_ss_info_12b9_00ac,
- &pci_ss_info_12b9_00ad,
- NULL
-};
-#endif
-#define pci_ss_list_12ba NULL
-#define pci_ss_list_12bb NULL
-#define pci_ss_list_12bc NULL
-#define pci_ss_list_12bd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12be[] = {
- &pci_ss_info_12be_3042,
- NULL
-};
-#endif
-#define pci_ss_list_12bf NULL
-#define pci_ss_list_12c0 NULL
-#define pci_ss_list_12c1 NULL
-#define pci_ss_list_12c2 NULL
-#define pci_ss_list_12c3 NULL
-#define pci_ss_list_12c4 NULL
-#define pci_ss_list_12c5 NULL
-#define pci_ss_list_12c6 NULL
-#define pci_ss_list_12c7 NULL
-#define pci_ss_list_12c8 NULL
-#define pci_ss_list_12c9 NULL
-#define pci_ss_list_12ca NULL
-#define pci_ss_list_12cb NULL
-#define pci_ss_list_12cc NULL
-#define pci_ss_list_12cd NULL
-#define pci_ss_list_12ce NULL
-#define pci_ss_list_12cf NULL
-#define pci_ss_list_12d0 NULL
-#define pci_ss_list_12d1 NULL
-#define pci_ss_list_12d2 NULL
-#define pci_ss_list_12d3 NULL
-#define pci_ss_list_12d4 NULL
-#define pci_ss_list_12d5 NULL
-#define pci_ss_list_12d6 NULL
-#define pci_ss_list_12d7 NULL
-#define pci_ss_list_12d8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12d9[] = {
- &pci_ss_info_12d9_0002,
- &pci_ss_info_12d9_000a,
- NULL
-};
-#endif
-#define pci_ss_list_12da NULL
-#define pci_ss_list_12db NULL
-#define pci_ss_list_12dc NULL
-#define pci_ss_list_12dd NULL
-#define pci_ss_list_12de NULL
-#define pci_ss_list_12df NULL
-#define pci_ss_list_12e0 NULL
-#define pci_ss_list_12e1 NULL
-#define pci_ss_list_12e2 NULL
-#define pci_ss_list_12e3 NULL
-#define pci_ss_list_12e4 NULL
-#define pci_ss_list_12e5 NULL
-#define pci_ss_list_12e6 NULL
-#define pci_ss_list_12e7 NULL
-#define pci_ss_list_12e8 NULL
-#define pci_ss_list_12e9 NULL
-#define pci_ss_list_12ea NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12eb[] = {
- &pci_ss_info_12eb_0001,
- &pci_ss_info_12eb_0002,
- &pci_ss_info_12eb_0003,
- &pci_ss_info_12eb_0088,
- &pci_ss_info_12eb_8803,
- NULL
-};
-#endif
-#define pci_ss_list_12ec NULL
-#define pci_ss_list_12ed NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_12ee[] = {
- &pci_ss_info_12ee_7000,
- &pci_ss_info_12ee_7001,
- &pci_ss_info_12ee_8011,
- NULL
-};
-#endif
-#define pci_ss_list_12ef NULL
-#define pci_ss_list_12f0 NULL
-#define pci_ss_list_12f1 NULL
-#define pci_ss_list_12f2 NULL
-#define pci_ss_list_12f3 NULL
-#define pci_ss_list_12f4 NULL
-#define pci_ss_list_12f5 NULL
-#define pci_ss_list_12f6 NULL
-#define pci_ss_list_12f7 NULL
-#define pci_ss_list_12f8 NULL
-#define pci_ss_list_12f9 NULL
-#define pci_ss_list_12fb NULL
-#define pci_ss_list_12fc NULL
-#define pci_ss_list_12fd NULL
-#define pci_ss_list_12fe NULL
-#define pci_ss_list_12ff NULL
-#define pci_ss_list_1300 NULL
-#define pci_ss_list_1302 NULL
-#define pci_ss_list_1303 NULL
-#define pci_ss_list_1304 NULL
-#define pci_ss_list_1305 NULL
-#define pci_ss_list_1306 NULL
-#define pci_ss_list_1307 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1308[] = {
- &pci_ss_info_1308_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1309 NULL
-#define pci_ss_list_130a NULL
-#define pci_ss_list_130b NULL
-#define pci_ss_list_130c NULL
-#define pci_ss_list_130d NULL
-#define pci_ss_list_130e NULL
-#define pci_ss_list_130f NULL
-#define pci_ss_list_1310 NULL
-#define pci_ss_list_1311 NULL
-#define pci_ss_list_1312 NULL
-#define pci_ss_list_1313 NULL
-#define pci_ss_list_1316 NULL
-#define pci_ss_list_1317 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1318[] = {
- &pci_ss_info_1318_0000,
- NULL
-};
-#endif
-#define pci_ss_list_1319 NULL
-#define pci_ss_list_131a NULL
-#define pci_ss_list_131c NULL
-#define pci_ss_list_131d NULL
-#define pci_ss_list_131e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_131f[] = {
- &pci_ss_info_131f_2030,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1320[] = {
- &pci_ss_info_1320_10bd,
- NULL
-};
-#endif
-#define pci_ss_list_1321 NULL
-#define pci_ss_list_1322 NULL
-#define pci_ss_list_1323 NULL
-#define pci_ss_list_1324 NULL
-#define pci_ss_list_1325 NULL
-#define pci_ss_list_1326 NULL
-#define pci_ss_list_1327 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1328[] = {
- &pci_ss_info_1328_0001,
- &pci_ss_info_1328_f001,
- NULL
-};
-#endif
-#define pci_ss_list_1329 NULL
-#define pci_ss_list_132a NULL
-#define pci_ss_list_132b NULL
-#define pci_ss_list_132c NULL
-#define pci_ss_list_132d NULL
-#define pci_ss_list_1330 NULL
-#define pci_ss_list_1331 NULL
-#define pci_ss_list_1332 NULL
-#define pci_ss_list_1334 NULL
-#define pci_ss_list_1335 NULL
-#define pci_ss_list_1337 NULL
-#define pci_ss_list_1338 NULL
-#define pci_ss_list_133a NULL
-#define pci_ss_list_133b NULL
-#define pci_ss_list_133c NULL
-#define pci_ss_list_133d NULL
-#define pci_ss_list_133e NULL
-#define pci_ss_list_133f NULL
-#define pci_ss_list_1340 NULL
-#define pci_ss_list_1341 NULL
-#define pci_ss_list_1342 NULL
-#define pci_ss_list_1343 NULL
-#define pci_ss_list_1344 NULL
-#define pci_ss_list_1345 NULL
-#define pci_ss_list_1347 NULL
-#define pci_ss_list_1349 NULL
-#define pci_ss_list_134a NULL
-#define pci_ss_list_134b NULL
-#define pci_ss_list_134c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_134d[] = {
- &pci_ss_info_134d_0001,
- &pci_ss_info_134d_4c21,
- NULL
-};
-#endif
-#define pci_ss_list_134e NULL
-#define pci_ss_list_134f NULL
-#define pci_ss_list_1350 NULL
-#define pci_ss_list_1351 NULL
-#define pci_ss_list_1353 NULL
-#define pci_ss_list_1354 NULL
-#define pci_ss_list_1355 NULL
-#define pci_ss_list_1356 NULL
-#define pci_ss_list_1359 NULL
-#define pci_ss_list_135a NULL
-#define pci_ss_list_135b NULL
-#define pci_ss_list_135c NULL
-#define pci_ss_list_135d NULL
-#define pci_ss_list_135e NULL
-#define pci_ss_list_135f NULL
-#define pci_ss_list_1360 NULL
-#define pci_ss_list_1361 NULL
-#define pci_ss_list_1362 NULL
-#define pci_ss_list_1363 NULL
-#define pci_ss_list_1364 NULL
-#define pci_ss_list_1365 NULL
-#define pci_ss_list_1366 NULL
-#define pci_ss_list_1367 NULL
-#define pci_ss_list_1368 NULL
-#define pci_ss_list_1369 NULL
-#define pci_ss_list_136a NULL
-#define pci_ss_list_136b NULL
-#define pci_ss_list_136c NULL
-#define pci_ss_list_136d NULL
-#define pci_ss_list_136f NULL
-#define pci_ss_list_1370 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1371[] = {
- &pci_ss_info_1371_434e,
- NULL
-};
-#endif
-#define pci_ss_list_1373 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1374[] = {
- &pci_ss_info_1374_0001,
- &pci_ss_info_1374_0002,
- &pci_ss_info_1374_0003,
- &pci_ss_info_1374_0007,
- &pci_ss_info_1374_0008,
- NULL
-};
-#endif
-#define pci_ss_list_1375 NULL
-#define pci_ss_list_1376 NULL
-#define pci_ss_list_1377 NULL
-#define pci_ss_list_1378 NULL
-#define pci_ss_list_1379 NULL
-#define pci_ss_list_137a NULL
-#define pci_ss_list_137b NULL
-#define pci_ss_list_137c NULL
-#define pci_ss_list_137d NULL
-#define pci_ss_list_137e NULL
-#define pci_ss_list_137f NULL
-#define pci_ss_list_1380 NULL
-#define pci_ss_list_1381 NULL
-#define pci_ss_list_1382 NULL
-#define pci_ss_list_1383 NULL
-#define pci_ss_list_1384 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1385[] = {
- &pci_ss_info_1385_1100,
- &pci_ss_info_1385_2100,
- &pci_ss_info_1385_f004,
- NULL
-};
-#endif
-#define pci_ss_list_1386 NULL
-#define pci_ss_list_1387 NULL
-#define pci_ss_list_1388 NULL
-#define pci_ss_list_1389 NULL
-#define pci_ss_list_138a NULL
-#define pci_ss_list_138b NULL
-#define pci_ss_list_138c NULL
-#define pci_ss_list_138d NULL
-#define pci_ss_list_138e NULL
-#define pci_ss_list_138f NULL
-#define pci_ss_list_1390 NULL
-#define pci_ss_list_1391 NULL
-#define pci_ss_list_1392 NULL
-#define pci_ss_list_1393 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1394[] = {
- &pci_ss_info_1394_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1395[] = {
- &pci_ss_info_1395_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1396 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1397[] = {
- &pci_ss_info_1397_2bd0,
- NULL
-};
-#endif
-#define pci_ss_list_1398 NULL
-#define pci_ss_list_1399 NULL
-#define pci_ss_list_139a NULL
-#define pci_ss_list_139b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_139c[] = {
- &pci_ss_info_139c_0016,
- &pci_ss_info_139c_0017,
- NULL
-};
-#endif
-#define pci_ss_list_139d NULL
-#define pci_ss_list_139e NULL
-#define pci_ss_list_139f NULL
-#define pci_ss_list_13a0 NULL
-#define pci_ss_list_13a1 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13a2[] = {
- &pci_ss_info_13a2_8002,
- &pci_ss_info_13a2_8006,
- NULL
-};
-#endif
-#define pci_ss_list_13a3 NULL
-#define pci_ss_list_13a4 NULL
-#define pci_ss_list_13a5 NULL
-#define pci_ss_list_13a6 NULL
-#define pci_ss_list_13a7 NULL
-#define pci_ss_list_13a8 NULL
-#define pci_ss_list_13a9 NULL
-#define pci_ss_list_13aa NULL
-#define pci_ss_list_13ab NULL
-#define pci_ss_list_13ac NULL
-#define pci_ss_list_13ad NULL
-#define pci_ss_list_13ae NULL
-#define pci_ss_list_13af NULL
-#define pci_ss_list_13b0 NULL
-#define pci_ss_list_13b1 NULL
-#define pci_ss_list_13b2 NULL
-#define pci_ss_list_13b3 NULL
-#define pci_ss_list_13b4 NULL
-#define pci_ss_list_13b5 NULL
-#define pci_ss_list_13b6 NULL
-#define pci_ss_list_13b7 NULL
-#define pci_ss_list_13b8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13b9[] = {
- &pci_ss_info_13b9_1421,
- NULL
-};
-#endif
-#define pci_ss_list_13ba NULL
-#define pci_ss_list_13bb NULL
-#define pci_ss_list_13bc NULL
-#define pci_ss_list_13bd NULL
-#define pci_ss_list_13be NULL
-#define pci_ss_list_13bf NULL
-#define pci_ss_list_13c0 NULL
-#define pci_ss_list_13c1 NULL
-#define pci_ss_list_13c2 NULL
-#define pci_ss_list_13c3 NULL
-#define pci_ss_list_13c4 NULL
-#define pci_ss_list_13c5 NULL
-#define pci_ss_list_13c6 NULL
-#define pci_ss_list_13c7 NULL
-#define pci_ss_list_13c8 NULL
-#define pci_ss_list_13c9 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13ca[] = {
- &pci_ss_info_13ca_4231,
- NULL
-};
-#endif
-#define pci_ss_list_13cb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13cc[] = {
- &pci_ss_info_13cc_0000,
- &pci_ss_info_13cc_0002,
- &pci_ss_info_13cc_0003,
- &pci_ss_info_13cc_0004,
- &pci_ss_info_13cc_0005,
- &pci_ss_info_13cc_0006,
- &pci_ss_info_13cc_0007,
- &pci_ss_info_13cc_0008,
- &pci_ss_info_13cc_0009,
- &pci_ss_info_13cc_000a,
- &pci_ss_info_13cc_000c,
- NULL
-};
-#endif
-#define pci_ss_list_13cd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13ce[] = {
- &pci_ss_info_13ce_8031,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13cf[] = {
- &pci_ss_info_13cf_8031,
- NULL
-};
-#endif
-#define pci_ss_list_13d0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13d1[] = {
- &pci_ss_info_13d1_ab01,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13d2[] = {
- &pci_ss_info_13d2_0300,
- &pci_ss_info_13d2_0301,
- &pci_ss_info_13d2_0302,
- NULL
-};
-#endif
-#define pci_ss_list_13d3 NULL
-#define pci_ss_list_13d4 NULL
-#define pci_ss_list_13d5 NULL
-#define pci_ss_list_13d6 NULL
-#define pci_ss_list_13d7 NULL
-#define pci_ss_list_13d8 NULL
-#define pci_ss_list_13d9 NULL
-#define pci_ss_list_13da NULL
-#define pci_ss_list_13db NULL
-#define pci_ss_list_13dc NULL
-#define pci_ss_list_13dd NULL
-#define pci_ss_list_13de NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13df[] = {
- &pci_ss_info_13df_0001,
- &pci_ss_info_13df_1003,
- &pci_ss_info_13df_1005,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13e0[] = {
- &pci_ss_info_13e0_0012,
- &pci_ss_info_13e0_0020,
- &pci_ss_info_13e0_0030,
- &pci_ss_info_13e0_0040,
- &pci_ss_info_13e0_0041,
- &pci_ss_info_13e0_0042,
- &pci_ss_info_13e0_0100,
- &pci_ss_info_13e0_0117,
- &pci_ss_info_13e0_0147,
- &pci_ss_info_13e0_0187,
- &pci_ss_info_13e0_0197,
- &pci_ss_info_13e0_01a7,
- &pci_ss_info_13e0_01b7,
- &pci_ss_info_13e0_01c7,
- &pci_ss_info_13e0_01d7,
- &pci_ss_info_13e0_01f7,
- &pci_ss_info_13e0_0209,
- &pci_ss_info_13e0_020a,
- &pci_ss_info_13e0_020d,
- &pci_ss_info_13e0_020e,
- &pci_ss_info_13e0_0210,
- &pci_ss_info_13e0_0240,
- &pci_ss_info_13e0_0247,
- &pci_ss_info_13e0_0250,
- &pci_ss_info_13e0_0260,
- &pci_ss_info_13e0_0261,
- &pci_ss_info_13e0_0270,
- &pci_ss_info_13e0_0290,
- &pci_ss_info_13e0_0297,
- &pci_ss_info_13e0_02a0,
- &pci_ss_info_13e0_02b0,
- &pci_ss_info_13e0_02c0,
- &pci_ss_info_13e0_02c7,
- &pci_ss_info_13e0_02d0,
- &pci_ss_info_13e0_0410,
- &pci_ss_info_13e0_0412,
- &pci_ss_info_13e0_0420,
- &pci_ss_info_13e0_0440,
- &pci_ss_info_13e0_0441,
- &pci_ss_info_13e0_0442,
- &pci_ss_info_13e0_0443,
- &pci_ss_info_13e0_0450,
- &pci_ss_info_13e0_8d84,
- &pci_ss_info_13e0_8d85,
- &pci_ss_info_13e0_f100,
- &pci_ss_info_13e0_f101,
- &pci_ss_info_13e0_f102,
- NULL
-};
-#endif
-#define pci_ss_list_13e1 NULL
-#define pci_ss_list_13e2 NULL
-#define pci_ss_list_13e3 NULL
-#define pci_ss_list_13e4 NULL
-#define pci_ss_list_13e5 NULL
-#define pci_ss_list_13e6 NULL
-#define pci_ss_list_13e7 NULL
-#define pci_ss_list_13e8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13e9[] = {
- &pci_ss_info_13e9_0070,
- NULL
-};
-#endif
-#define pci_ss_list_13ea NULL
-#define pci_ss_list_13eb NULL
-#define pci_ss_list_13ec NULL
-#define pci_ss_list_13ed NULL
-#define pci_ss_list_13ee NULL
-#define pci_ss_list_13ef NULL
-#define pci_ss_list_13f0 NULL
-#define pci_ss_list_13f1 NULL
-#define pci_ss_list_13f2 NULL
-#define pci_ss_list_13f3 NULL
-#define pci_ss_list_13f4 NULL
-#define pci_ss_list_13f5 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13f6[] = {
- &pci_ss_info_13f6_0101,
- &pci_ss_info_13f6_0111,
- &pci_ss_info_13f6_ffff,
- NULL
-};
-#endif
-#define pci_ss_list_13f7 NULL
-#define pci_ss_list_13f8 NULL
-#define pci_ss_list_13f9 NULL
-#define pci_ss_list_13fa NULL
-#define pci_ss_list_13fb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_13fc[] = {
- &pci_ss_info_13fc_2471,
- NULL
-};
-#endif
-#define pci_ss_list_13fd NULL
-#define pci_ss_list_13fe NULL
-#define pci_ss_list_13ff NULL
-#define pci_ss_list_1400 NULL
-#define pci_ss_list_1401 NULL
-#define pci_ss_list_1402 NULL
-#define pci_ss_list_1403 NULL
-#define pci_ss_list_1404 NULL
-#define pci_ss_list_1405 NULL
-#define pci_ss_list_1406 NULL
-#define pci_ss_list_1407 NULL
-#define pci_ss_list_1408 NULL
-#define pci_ss_list_1409 NULL
-#define pci_ss_list_140a NULL
-#define pci_ss_list_140b NULL
-#define pci_ss_list_140c NULL
-#define pci_ss_list_140d NULL
-#define pci_ss_list_140e NULL
-#define pci_ss_list_140f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1410[] = {
- &pci_ss_info_1410_0104,
- NULL
-};
-#endif
-#define pci_ss_list_1411 NULL
-#define pci_ss_list_1412 NULL
-#define pci_ss_list_1413 NULL
-#define pci_ss_list_1414 NULL
-#define pci_ss_list_1415 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1416[] = {
- &pci_ss_info_1416_9804,
- NULL
-};
-#endif
-#define pci_ss_list_1417 NULL
-#define pci_ss_list_1418 NULL
-#define pci_ss_list_1419 NULL
-#define pci_ss_list_141a NULL
-#define pci_ss_list_141b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_141d[] = {
- &pci_ss_info_141d_0440,
- NULL
-};
-#endif
-#define pci_ss_list_141e NULL
-#define pci_ss_list_141f NULL
-#define pci_ss_list_1420 NULL
-#define pci_ss_list_1421 NULL
-#define pci_ss_list_1422 NULL
-#define pci_ss_list_1423 NULL
-#define pci_ss_list_1424 NULL
-#define pci_ss_list_1425 NULL
-#define pci_ss_list_1426 NULL
-#define pci_ss_list_1427 NULL
-#define pci_ss_list_1428 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1429[] = {
- &pci_ss_info_1429_d010,
- NULL
-};
-#endif
-#define pci_ss_list_142a NULL
-#define pci_ss_list_142b NULL
-#define pci_ss_list_142c NULL
-#define pci_ss_list_142d NULL
-#define pci_ss_list_142e NULL
-#define pci_ss_list_142f NULL
-#define pci_ss_list_1430 NULL
-#define pci_ss_list_1431 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1432[] = {
- &pci_ss_info_1432_9130,
- NULL
-};
-#endif
-#define pci_ss_list_1433 NULL
-#define pci_ss_list_1435 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1436[] = {
- &pci_ss_info_1436_0300,
- &pci_ss_info_1436_0301,
- &pci_ss_info_1436_0302,
- &pci_ss_info_1436_0440,
- &pci_ss_info_1436_1003,
- &pci_ss_info_1436_1005,
- &pci_ss_info_1436_1103,
- &pci_ss_info_1436_1105,
- &pci_ss_info_1436_1203,
- &pci_ss_info_1436_1303,
- &pci_ss_info_1436_1602,
- &pci_ss_info_1436_8139,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1437[] = {
- &pci_ss_info_1437_1105,
- NULL
-};
-#endif
-#define pci_ss_list_1438 NULL
-#define pci_ss_list_1439 NULL
-#define pci_ss_list_143a NULL
-#define pci_ss_list_143b NULL
-#define pci_ss_list_143c NULL
-#define pci_ss_list_143d NULL
-#define pci_ss_list_143e NULL
-#define pci_ss_list_143f NULL
-#define pci_ss_list_1440 NULL
-#define pci_ss_list_1441 NULL
-#define pci_ss_list_1442 NULL
-#define pci_ss_list_1443 NULL
-#define pci_ss_list_1444 NULL
-#define pci_ss_list_1445 NULL
-#define pci_ss_list_1446 NULL
-#define pci_ss_list_1447 NULL
-#define pci_ss_list_1448 NULL
-#define pci_ss_list_1449 NULL
-#define pci_ss_list_144a NULL
-#define pci_ss_list_144b NULL
-#define pci_ss_list_144c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_144d[] = {
- &pci_ss_info_144d_2101,
- &pci_ss_info_144d_2104,
- &pci_ss_info_144d_2115,
- &pci_ss_info_144d_2321,
- &pci_ss_info_144d_2501,
- &pci_ss_info_144d_2502,
- &pci_ss_info_144d_2602,
- &pci_ss_info_144d_3510,
- &pci_ss_info_144d_c000,
- &pci_ss_info_144d_c001,
- &pci_ss_info_144d_c003,
- &pci_ss_info_144d_c006,
- NULL
-};
-#endif
-#define pci_ss_list_144e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_144f[] = {
- &pci_ss_info_144f_0441,
- &pci_ss_info_144f_0449,
- &pci_ss_info_144f_1005,
- &pci_ss_info_144f_100c,
- &pci_ss_info_144f_1104,
- &pci_ss_info_144f_110d,
- &pci_ss_info_144f_1500,
- &pci_ss_info_144f_1501,
- &pci_ss_info_144f_1502,
- &pci_ss_info_144f_1503,
- &pci_ss_info_144f_150a,
- &pci_ss_info_144f_150b,
- &pci_ss_info_144f_1510,
- &pci_ss_info_144f_3000,
- &pci_ss_info_144f_4005,
- NULL
-};
-#endif
-#define pci_ss_list_1450 NULL
-#define pci_ss_list_1451 NULL
-#define pci_ss_list_1453 NULL
-#define pci_ss_list_1454 NULL
-#define pci_ss_list_1455 NULL
-#define pci_ss_list_1456 NULL
-#define pci_ss_list_1457 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1458[] = {
- &pci_ss_info_1458_0400,
- &pci_ss_info_1458_0596,
- &pci_ss_info_1458_0691,
- &pci_ss_info_1458_4000,
- &pci_ss_info_1458_4002,
- &pci_ss_info_1458_5000,
- &pci_ss_info_1458_5001,
- &pci_ss_info_1458_5002,
- &pci_ss_info_1458_5004,
- &pci_ss_info_1458_7600,
- &pci_ss_info_1458_a000,
- &pci_ss_info_1458_a002,
- NULL
-};
-#endif
-#define pci_ss_list_1459 NULL
-#define pci_ss_list_145a NULL
-#define pci_ss_list_145b NULL
-#define pci_ss_list_145c NULL
-#define pci_ss_list_145d NULL
-#define pci_ss_list_145e NULL
-#define pci_ss_list_145f NULL
-#define pci_ss_list_1460 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1461[] = {
- &pci_ss_info_1461_0004,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1462[] = {
- &pci_ss_info_1462_3091,
- &pci_ss_info_1462_3370,
- &pci_ss_info_1462_3981,
- &pci_ss_info_1462_400a,
- &pci_ss_info_1462_5800,
- &pci_ss_info_1462_6470,
- &pci_ss_info_1462_6560,
- &pci_ss_info_1462_6630,
- &pci_ss_info_1462_6631,
- &pci_ss_info_1462_6632,
- &pci_ss_info_1462_6633,
- &pci_ss_info_1462_6780,
- &pci_ss_info_1462_6820,
- &pci_ss_info_1462_6822,
- &pci_ss_info_1462_6830,
- &pci_ss_info_1462_6880,
- &pci_ss_info_1462_6900,
- &pci_ss_info_1462_6910,
- &pci_ss_info_1462_6930,
- &pci_ss_info_1462_6990,
- &pci_ss_info_1462_6991,
- &pci_ss_info_1462_8661,
- &pci_ss_info_1462_8730,
- &pci_ss_info_1462_8808,
- &pci_ss_info_1462_8817,
- &pci_ss_info_1462_8831,
- NULL
-};
-#endif
-#define pci_ss_list_1463 NULL
-#define pci_ss_list_1464 NULL
-#define pci_ss_list_1465 NULL
-#define pci_ss_list_1466 NULL
-#define pci_ss_list_1467 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1468[] = {
- &pci_ss_info_1468_0410,
- &pci_ss_info_1468_0440,
- &pci_ss_info_1468_0441,
- &pci_ss_info_1468_0449,
- &pci_ss_info_1468_2015,
- NULL
-};
-#endif
-#define pci_ss_list_1469 NULL
-#define pci_ss_list_146a NULL
-#define pci_ss_list_146b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_146c[] = {
- &pci_ss_info_146c_1439,
- NULL
-};
-#endif
-#define pci_ss_list_146d NULL
-#define pci_ss_list_146e NULL
-#define pci_ss_list_146f NULL
-#define pci_ss_list_1470 NULL
-#define pci_ss_list_1471 NULL
-#define pci_ss_list_1472 NULL
-#define pci_ss_list_1473 NULL
-#define pci_ss_list_1474 NULL
-#define pci_ss_list_1475 NULL
-#define pci_ss_list_1476 NULL
-#define pci_ss_list_1477 NULL
-#define pci_ss_list_1478 NULL
-#define pci_ss_list_1479 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_147a[] = {
- &pci_ss_info_147a_c001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_147b[] = {
- &pci_ss_info_147b_0507,
- &pci_ss_info_147b_8f00,
- &pci_ss_info_147b_8f09,
- &pci_ss_info_147b_a401,
- &pci_ss_info_147b_a702,
- NULL
-};
-#endif
-#define pci_ss_list_147c NULL
-#define pci_ss_list_147d NULL
-#define pci_ss_list_147e NULL
-#define pci_ss_list_147f NULL
-#define pci_ss_list_1480 NULL
-#define pci_ss_list_1481 NULL
-#define pci_ss_list_1482 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1483[] = {
- &pci_ss_info_1483_5020,
- &pci_ss_info_1483_5021,
- &pci_ss_info_1483_5022,
- NULL
-};
-#endif
-#define pci_ss_list_1484 NULL
-#define pci_ss_list_1485 NULL
-#define pci_ss_list_1486 NULL
-#define pci_ss_list_1487 NULL
-#define pci_ss_list_1488 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1489[] = {
- &pci_ss_info_1489_6001,
- &pci_ss_info_1489_6002,
- NULL
-};
-#endif
-#define pci_ss_list_148a NULL
-#define pci_ss_list_148b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_148c[] = {
- &pci_ss_info_148c_2003,
- &pci_ss_info_148c_2023,
- &pci_ss_info_148c_2024,
- &pci_ss_info_148c_2025,
- &pci_ss_info_148c_2026,
- &pci_ss_info_148c_2036,
- &pci_ss_info_148c_2039,
- NULL
-};
-#endif
-#define pci_ss_list_148d NULL
-#define pci_ss_list_148e NULL
-#define pci_ss_list_148f NULL
-#define pci_ss_list_1490 NULL
-#define pci_ss_list_1491 NULL
-#define pci_ss_list_1492 NULL
-#define pci_ss_list_1493 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1494[] = {
- &pci_ss_info_1494_0300,
- &pci_ss_info_1494_0301,
- NULL
-};
-#endif
-#define pci_ss_list_1495 NULL
-#define pci_ss_list_1496 NULL
-#define pci_ss_list_1497 NULL
-#define pci_ss_list_1498 NULL
-#define pci_ss_list_1499 NULL
-#define pci_ss_list_149a NULL
-#define pci_ss_list_149b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_149c[] = {
- &pci_ss_info_149c_139a,
- &pci_ss_info_149c_8139,
- NULL
-};
-#endif
-#define pci_ss_list_149d NULL
-#define pci_ss_list_149e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_149f[] = {
- &pci_ss_info_149f_0440,
- NULL
-};
-#endif
-#define pci_ss_list_14a0 NULL
-#define pci_ss_list_14a1 NULL
-#define pci_ss_list_14a2 NULL
-#define pci_ss_list_14a3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14a4[] = {
- &pci_ss_info_14a4_2073,
- &pci_ss_info_14a4_2077,
- &pci_ss_info_14a4_2089,
- &pci_ss_info_14a4_2091,
- &pci_ss_info_14a4_2104,
- &pci_ss_info_14a4_2105,
- &pci_ss_info_14a4_2106,
- &pci_ss_info_14a4_2107,
- &pci_ss_info_14a4_2172,
- NULL
-};
-#endif
-#define pci_ss_list_14a5 NULL
-#define pci_ss_list_14a6 NULL
-#define pci_ss_list_14a7 NULL
-#define pci_ss_list_14a8 NULL
-#define pci_ss_list_14a9 NULL
-#define pci_ss_list_14aa NULL
-#define pci_ss_list_14ab NULL
-#define pci_ss_list_14ac NULL
-#define pci_ss_list_14ad NULL
-#define pci_ss_list_14ae NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14af[] = {
- &pci_ss_info_14af_0002,
- &pci_ss_info_14af_5008,
- &pci_ss_info_14af_5021,
- &pci_ss_info_14af_5022,
- &pci_ss_info_14af_5810,
- &pci_ss_info_14af_5820,
- &pci_ss_info_14af_7102,
- &pci_ss_info_14af_7103,
- NULL
-};
-#endif
-#define pci_ss_list_14b0 NULL
-#define pci_ss_list_14b1 NULL
-#define pci_ss_list_14b2 NULL
-#define pci_ss_list_14b3 NULL
-#define pci_ss_list_14b4 NULL
-#define pci_ss_list_14b5 NULL
-#define pci_ss_list_14b6 NULL
-#define pci_ss_list_14b7 NULL
-#define pci_ss_list_14b8 NULL
-#define pci_ss_list_14b9 NULL
-#define pci_ss_list_14ba NULL
-#define pci_ss_list_14bb NULL
-#define pci_ss_list_14bc NULL
-#define pci_ss_list_14bd NULL
-#define pci_ss_list_14be NULL
-#define pci_ss_list_14bf NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14c0[] = {
- &pci_ss_info_14c0_0004,
- &pci_ss_info_14c0_000c,
- NULL
-};
-#endif
-#define pci_ss_list_14c1 NULL
-#define pci_ss_list_14c2 NULL
-#define pci_ss_list_14c3 NULL
-#define pci_ss_list_14c4 NULL
-#define pci_ss_list_14c5 NULL
-#define pci_ss_list_14c6 NULL
-#define pci_ss_list_14c7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14c8[] = {
- &pci_ss_info_14c8_0300,
- &pci_ss_info_14c8_0302,
- NULL
-};
-#endif
-#define pci_ss_list_14c9 NULL
-#define pci_ss_list_14ca NULL
-#define pci_ss_list_14cb NULL
-#define pci_ss_list_14cc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14cd[] = {
- &pci_ss_info_14cd_2194,
- NULL
-};
-#endif
-#define pci_ss_list_14ce NULL
-#define pci_ss_list_14cf NULL
-#define pci_ss_list_14d0 NULL
-#define pci_ss_list_14d1 NULL
-#define pci_ss_list_14d2 NULL
-#define pci_ss_list_14d3 NULL
-#define pci_ss_list_14d4 NULL
-#define pci_ss_list_14d5 NULL
-#define pci_ss_list_14d6 NULL
-#define pci_ss_list_14d7 NULL
-#define pci_ss_list_14d8 NULL
-#define pci_ss_list_14d9 NULL
-#define pci_ss_list_14da NULL
-#define pci_ss_list_14db NULL
-#define pci_ss_list_14dc NULL
-#define pci_ss_list_14dd NULL
-#define pci_ss_list_14de NULL
-#define pci_ss_list_14df NULL
-#define pci_ss_list_14e1 NULL
-#define pci_ss_list_14e2 NULL
-#define pci_ss_list_14e3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14e4[] = {
- &pci_ss_info_14e4_0001,
- &pci_ss_info_14e4_0002,
- &pci_ss_info_14e4_0003,
- &pci_ss_info_14e4_0004,
- &pci_ss_info_14e4_0005,
- &pci_ss_info_14e4_0006,
- &pci_ss_info_14e4_0007,
- &pci_ss_info_14e4_0008,
- &pci_ss_info_14e4_0009,
- &pci_ss_info_14e4_000a,
- &pci_ss_info_14e4_000b,
- &pci_ss_info_14e4_000c,
- &pci_ss_info_14e4_000d,
- &pci_ss_info_14e4_1028,
- &pci_ss_info_14e4_1644,
- &pci_ss_info_14e4_8008,
- &pci_ss_info_14e4_8009,
- &pci_ss_info_14e4_800a,
- NULL
-};
-#endif
-#define pci_ss_list_14e5 NULL
-#define pci_ss_list_14e6 NULL
-#define pci_ss_list_14e7 NULL
-#define pci_ss_list_14e8 NULL
-#define pci_ss_list_14e9 NULL
-#define pci_ss_list_14ea NULL
-#define pci_ss_list_14eb NULL
-#define pci_ss_list_14ec NULL
-#define pci_ss_list_14ed NULL
-#define pci_ss_list_14ee NULL
-#define pci_ss_list_14ef NULL
-#define pci_ss_list_14f0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14f1[] = {
- &pci_ss_info_14f1_0001,
- &pci_ss_info_14f1_0002,
- &pci_ss_info_14f1_0003,
- &pci_ss_info_14f1_0044,
- &pci_ss_info_14f1_0048,
- &pci_ss_info_14f1_0122,
- &pci_ss_info_14f1_0144,
- &pci_ss_info_14f1_0222,
- &pci_ss_info_14f1_0244,
- &pci_ss_info_14f1_0322,
- &pci_ss_info_14f1_0422,
- &pci_ss_info_14f1_1122,
- &pci_ss_info_14f1_1222,
- &pci_ss_info_14f1_1322,
- &pci_ss_info_14f1_1522,
- &pci_ss_info_14f1_1622,
- &pci_ss_info_14f1_1722,
- &pci_ss_info_14f1_2004,
- &pci_ss_info_14f1_5421,
- NULL
-};
-#endif
-#define pci_ss_list_14f2 NULL
-#define pci_ss_list_14f3 NULL
-#define pci_ss_list_14f4 NULL
-#define pci_ss_list_14f5 NULL
-#define pci_ss_list_14f6 NULL
-#define pci_ss_list_14f7 NULL
-#define pci_ss_list_14f8 NULL
-#define pci_ss_list_14f9 NULL
-#define pci_ss_list_14fa NULL
-#define pci_ss_list_14fb NULL
-#define pci_ss_list_14fc NULL
-#define pci_ss_list_14fd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14fe[] = {
- &pci_ss_info_14fe_0428,
- &pci_ss_info_14fe_0429,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_14ff[] = {
- &pci_ss_info_14ff_1100,
- NULL
-};
-#endif
-#define pci_ss_list_1500 NULL
-#define pci_ss_list_1501 NULL
-#define pci_ss_list_1502 NULL
-#define pci_ss_list_1503 NULL
-#define pci_ss_list_1504 NULL
-#define pci_ss_list_1505 NULL
-#define pci_ss_list_1506 NULL
-#define pci_ss_list_1507 NULL
-#define pci_ss_list_1508 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1509[] = {
- &pci_ss_info_1509_7002,
- &pci_ss_info_1509_9902,
- &pci_ss_info_1509_9903,
- &pci_ss_info_1509_9904,
- &pci_ss_info_1509_9905,
- &pci_ss_info_1509_9a00,
- NULL
-};
-#endif
-#define pci_ss_list_150a NULL
-#define pci_ss_list_150b NULL
-#define pci_ss_list_150c NULL
-#define pci_ss_list_150d NULL
-#define pci_ss_list_150e NULL
-#define pci_ss_list_150f NULL
-#define pci_ss_list_1510 NULL
-#define pci_ss_list_1511 NULL
-#define pci_ss_list_1512 NULL
-#define pci_ss_list_1513 NULL
-#define pci_ss_list_1514 NULL
-#define pci_ss_list_1515 NULL
-#define pci_ss_list_1516 NULL
-#define pci_ss_list_1517 NULL
-#define pci_ss_list_1518 NULL
-#define pci_ss_list_1519 NULL
-#define pci_ss_list_151a NULL
-#define pci_ss_list_151b NULL
-#define pci_ss_list_151c NULL
-#define pci_ss_list_151d NULL
-#define pci_ss_list_151e NULL
-#define pci_ss_list_151f NULL
-#define pci_ss_list_1520 NULL
-#define pci_ss_list_1521 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1522[] = {
- &pci_ss_info_1522_0001,
- &pci_ss_info_1522_0002,
- &pci_ss_info_1522_0003,
- &pci_ss_info_1522_0004,
- &pci_ss_info_1522_0010,
- &pci_ss_info_1522_0020,
- &pci_ss_info_1522_0200,
- &pci_ss_info_1522_0300,
- &pci_ss_info_1522_0400,
- &pci_ss_info_1522_0500,
- &pci_ss_info_1522_0600,
- &pci_ss_info_1522_0700,
- &pci_ss_info_1522_0800,
- NULL
-};
-#endif
-#define pci_ss_list_1523 NULL
-#define pci_ss_list_1524 NULL
-#define pci_ss_list_1525 NULL
-#define pci_ss_list_1526 NULL
-#define pci_ss_list_1527 NULL
-#define pci_ss_list_1528 NULL
-#define pci_ss_list_1529 NULL
-#define pci_ss_list_152a NULL
-#define pci_ss_list_152b NULL
-#define pci_ss_list_152c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_152d[] = {
- &pci_ss_info_152d_8801,
- &pci_ss_info_152d_8802,
- &pci_ss_info_152d_8803,
- &pci_ss_info_152d_8804,
- &pci_ss_info_152d_8805,
- &pci_ss_info_152d_8808,
- NULL
-};
-#endif
-#define pci_ss_list_152e NULL
-#define pci_ss_list_152f NULL
-#define pci_ss_list_1530 NULL
-#define pci_ss_list_1531 NULL
-#define pci_ss_list_1532 NULL
-#define pci_ss_list_1533 NULL
-#define pci_ss_list_1534 NULL
-#define pci_ss_list_1535 NULL
-#define pci_ss_list_1537 NULL
-#define pci_ss_list_1538 NULL
-#define pci_ss_list_1539 NULL
-#define pci_ss_list_153a NULL
-#define pci_ss_list_153b NULL
-#define pci_ss_list_153c NULL
-#define pci_ss_list_153d NULL
-#define pci_ss_list_153e NULL
-#define pci_ss_list_153f NULL
-#define pci_ss_list_1540 NULL
-#define pci_ss_list_1541 NULL
-#define pci_ss_list_1542 NULL
-#define pci_ss_list_1543 NULL
-#define pci_ss_list_1544 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1545[] = {
- &pci_ss_info_1545_002f,
- NULL
-};
-#endif
-#define pci_ss_list_1546 NULL
-#define pci_ss_list_1547 NULL
-#define pci_ss_list_1548 NULL
-#define pci_ss_list_1549 NULL
-#define pci_ss_list_154a NULL
-#define pci_ss_list_154b NULL
-#define pci_ss_list_154c NULL
-#define pci_ss_list_154d NULL
-#define pci_ss_list_154e NULL
-#define pci_ss_list_154f NULL
-#define pci_ss_list_1550 NULL
-#define pci_ss_list_1551 NULL
-#define pci_ss_list_1552 NULL
-#define pci_ss_list_1553 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1554[] = {
- &pci_ss_info_1554_1041,
- NULL
-};
-#endif
-#define pci_ss_list_1555 NULL
-#define pci_ss_list_1556 NULL
-#define pci_ss_list_1557 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1558[] = {
- &pci_ss_info_1558_1103,
- &pci_ss_info_1558_2200,
- NULL
-};
-#endif
-#define pci_ss_list_1559 NULL
-#define pci_ss_list_155a NULL
-#define pci_ss_list_155b NULL
-#define pci_ss_list_155c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_155d[] = {
- &pci_ss_info_155d_2f07,
- &pci_ss_info_155d_6793,
- &pci_ss_info_155d_8850,
- NULL
-};
-#endif
-#define pci_ss_list_155e NULL
-#define pci_ss_list_155f NULL
-#define pci_ss_list_1560 NULL
-#define pci_ss_list_1561 NULL
-#define pci_ss_list_1562 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1563[] = {
- &pci_ss_info_1563_7018,
- NULL
-};
-#endif
-#define pci_ss_list_1564 NULL
-#define pci_ss_list_1565 NULL
-#define pci_ss_list_1566 NULL
-#define pci_ss_list_1567 NULL
-#define pci_ss_list_1568 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1569[] = {
- &pci_ss_info_1569_6326,
- NULL
-};
-#endif
-#define pci_ss_list_156a NULL
-#define pci_ss_list_156b NULL
-#define pci_ss_list_156c NULL
-#define pci_ss_list_156d NULL
-#define pci_ss_list_156e NULL
-#define pci_ss_list_156f NULL
-#define pci_ss_list_1570 NULL
-#define pci_ss_list_1571 NULL
-#define pci_ss_list_1572 NULL
-#define pci_ss_list_1573 NULL
-#define pci_ss_list_1574 NULL
-#define pci_ss_list_1575 NULL
-#define pci_ss_list_1576 NULL
-#define pci_ss_list_1578 NULL
-#define pci_ss_list_1579 NULL
-#define pci_ss_list_157a NULL
-#define pci_ss_list_157b NULL
-#define pci_ss_list_157c NULL
-#define pci_ss_list_157d NULL
-#define pci_ss_list_157e NULL
-#define pci_ss_list_157f NULL
-#define pci_ss_list_1580 NULL
-#define pci_ss_list_1581 NULL
-#define pci_ss_list_1582 NULL
-#define pci_ss_list_1583 NULL
-#define pci_ss_list_1584 NULL
-#define pci_ss_list_1585 NULL
-#define pci_ss_list_1586 NULL
-#define pci_ss_list_1587 NULL
-#define pci_ss_list_1588 NULL
-#define pci_ss_list_1589 NULL
-#define pci_ss_list_158a NULL
-#define pci_ss_list_158b NULL
-#define pci_ss_list_158c NULL
-#define pci_ss_list_158d NULL
-#define pci_ss_list_158e NULL
-#define pci_ss_list_158f NULL
-#define pci_ss_list_1590 NULL
-#define pci_ss_list_1591 NULL
-#define pci_ss_list_1592 NULL
-#define pci_ss_list_1593 NULL
-#define pci_ss_list_1594 NULL
-#define pci_ss_list_1595 NULL
-#define pci_ss_list_1596 NULL
-#define pci_ss_list_1597 NULL
-#define pci_ss_list_1598 NULL
-#define pci_ss_list_1599 NULL
-#define pci_ss_list_159a NULL
-#define pci_ss_list_159b NULL
-#define pci_ss_list_159c NULL
-#define pci_ss_list_159d NULL
-#define pci_ss_list_159e NULL
-#define pci_ss_list_159f NULL
-#define pci_ss_list_15a0 NULL
-#define pci_ss_list_15a1 NULL
-#define pci_ss_list_15a2 NULL
-#define pci_ss_list_15a3 NULL
-#define pci_ss_list_15a4 NULL
-#define pci_ss_list_15a5 NULL
-#define pci_ss_list_15a6 NULL
-#define pci_ss_list_15a7 NULL
-#define pci_ss_list_15a8 NULL
-#define pci_ss_list_15aa NULL
-#define pci_ss_list_15ab NULL
-#define pci_ss_list_15ac NULL
-#define pci_ss_list_15ad NULL
-#define pci_ss_list_15ae NULL
-#define pci_ss_list_15b0 NULL
-#define pci_ss_list_15b1 NULL
-#define pci_ss_list_15b2 NULL
-#define pci_ss_list_15b3 NULL
-#define pci_ss_list_15b4 NULL
-#define pci_ss_list_15b5 NULL
-#define pci_ss_list_15b6 NULL
-#define pci_ss_list_15b7 NULL
-#define pci_ss_list_15b8 NULL
-#define pci_ss_list_15b9 NULL
-#define pci_ss_list_15ba NULL
-#define pci_ss_list_15bb NULL
-#define pci_ss_list_15bc NULL
-#define pci_ss_list_15bd NULL
-#define pci_ss_list_15be NULL
-#define pci_ss_list_15bf NULL
-#define pci_ss_list_15c0 NULL
-#define pci_ss_list_15c1 NULL
-#define pci_ss_list_15c2 NULL
-#define pci_ss_list_15c3 NULL
-#define pci_ss_list_15c4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_15c5[] = {
- &pci_ss_info_15c5_0111,
- NULL
-};
-#endif
-#define pci_ss_list_15c6 NULL
-#define pci_ss_list_15c7 NULL
-#define pci_ss_list_15c8 NULL
-#define pci_ss_list_15c9 NULL
-#define pci_ss_list_15ca NULL
-#define pci_ss_list_15cb NULL
-#define pci_ss_list_15cc NULL
-#define pci_ss_list_15cd NULL
-#define pci_ss_list_15ce NULL
-#define pci_ss_list_15cf NULL
-#define pci_ss_list_15d1 NULL
-#define pci_ss_list_15d2 NULL
-#define pci_ss_list_15d3 NULL
-#define pci_ss_list_15d4 NULL
-#define pci_ss_list_15d5 NULL
-#define pci_ss_list_15d6 NULL
-#define pci_ss_list_15d7 NULL
-#define pci_ss_list_15d8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_15d9[] = {
- &pci_ss_info_15d9_3480,
- &pci_ss_info_15d9_9005,
- NULL
-};
-#endif
-#define pci_ss_list_15da NULL
-#define pci_ss_list_15db NULL
-#define pci_ss_list_15dc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_15dd[] = {
- &pci_ss_info_15dd_7609,
- NULL
-};
-#endif
-#define pci_ss_list_15de NULL
-#define pci_ss_list_15df NULL
-#define pci_ss_list_15e0 NULL
-#define pci_ss_list_15e1 NULL
-#define pci_ss_list_15e2 NULL
-#define pci_ss_list_15e3 NULL
-#define pci_ss_list_15e4 NULL
-#define pci_ss_list_15e5 NULL
-#define pci_ss_list_15e6 NULL
-#define pci_ss_list_15e7 NULL
-#define pci_ss_list_15e8 NULL
-#define pci_ss_list_15e9 NULL
-#define pci_ss_list_15ea NULL
-#define pci_ss_list_15eb NULL
-#define pci_ss_list_15ec NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_15ed[] = {
- &pci_ss_info_15ed_1000,
- &pci_ss_info_15ed_1001,
- &pci_ss_info_15ed_1002,
- &pci_ss_info_15ed_1003,
- &pci_ss_info_15ed_2000,
- &pci_ss_info_15ed_2001,
- NULL
-};
-#endif
-#define pci_ss_list_15ee NULL
-#define pci_ss_list_15ef NULL
-#define pci_ss_list_15f0 NULL
-#define pci_ss_list_15f1 NULL
-#define pci_ss_list_15f2 NULL
-#define pci_ss_list_15f3 NULL
-#define pci_ss_list_15f4 NULL
-#define pci_ss_list_15f5 NULL
-#define pci_ss_list_15f6 NULL
-#define pci_ss_list_15f7 NULL
-#define pci_ss_list_15f8 NULL
-#define pci_ss_list_15f9 NULL
-#define pci_ss_list_15fa NULL
-#define pci_ss_list_15fb NULL
-#define pci_ss_list_15fc NULL
-#define pci_ss_list_15fd NULL
-#define pci_ss_list_15fe NULL
-#define pci_ss_list_15ff NULL
-#define pci_ss_list_1600 NULL
-#define pci_ss_list_1601 NULL
-#define pci_ss_list_1602 NULL
-#define pci_ss_list_1603 NULL
-#define pci_ss_list_1604 NULL
-#define pci_ss_list_1605 NULL
-#define pci_ss_list_1606 NULL
-#define pci_ss_list_1607 NULL
-#define pci_ss_list_1608 NULL
-#define pci_ss_list_1609 NULL
-#define pci_ss_list_1612 NULL
-#define pci_ss_list_1619 NULL
-#define pci_ss_list_1629 NULL
-#define pci_ss_list_1638 NULL
-#define pci_ss_list_163c NULL
-#define pci_ss_list_1657 NULL
-#define pci_ss_list_165a NULL
-#define pci_ss_list_165d NULL
-#define pci_ss_list_1661 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1668[] = {
- &pci_ss_info_1668_0299,
- &pci_ss_info_1668_0300,
- &pci_ss_info_1668_0302,
- &pci_ss_info_1668_0414,
- &pci_ss_info_1668_0440,
- &pci_ss_info_1668_1100,
- &pci_ss_info_1668_2400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1681[] = {
- &pci_ss_info_1681_0040,
- &pci_ss_info_1681_0050,
- &pci_ss_info_1681_a000,
- &pci_ss_info_1681_a011,
- NULL
-};
-#endif
-#define pci_ss_list_16ab NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_16be[] = {
- &pci_ss_info_16be_0001,
- &pci_ss_info_16be_0002,
- &pci_ss_info_16be_1040,
- NULL
-};
-#endif
-#define pci_ss_list_16ca NULL
-#define pci_ss_list_16ec NULL
-#define pci_ss_list_16f6 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1705[] = {
- &pci_ss_info_1705_0001,
- &pci_ss_info_1705_0002,
- &pci_ss_info_1705_0003,
- &pci_ss_info_1705_0004,
- NULL
-};
-#endif
-#define pci_ss_list_170b NULL
-#define pci_ss_list_170c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_172a[] = {
- &pci_ss_info_172a_0000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1737[] = {
- &pci_ss_info_1737_3874,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_173b[] = {
- &pci_ss_info_173b_0001,
- NULL
-};
-#endif
-#define pci_ss_list_1743 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_174b[] = {
- &pci_ss_info_174b_7112,
- &pci_ss_info_174b_7147,
- &pci_ss_info_174b_7149,
- &pci_ss_info_174b_7161,
- &pci_ss_info_174b_7176,
- &pci_ss_info_174b_7192,
- NULL
-};
-#endif
-#define pci_ss_list_175e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1787[] = {
- &pci_ss_info_1787_0202,
- NULL
-};
-#endif
-#define pci_ss_list_1796 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1799[] = {
- &pci_ss_info_1799_0001,
- &pci_ss_info_1799_0002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_17af[] = {
- &pci_ss_info_17af_0202,
- &pci_ss_info_17af_2005,
- &pci_ss_info_17af_2006,
- NULL
-};
-#endif
-#define pci_ss_list_17cc NULL
-#define pci_ss_list_1813 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1851[] = {
- &pci_ss_info_1851_1850,
- &pci_ss_info_1851_1851,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1852[] = {
- &pci_ss_info_1852_1852,
- NULL
-};
-#endif
-#define pci_ss_list_1888 NULL
-#define pci_ss_list_1a08 NULL
-#define pci_ss_list_1b13 NULL
-#define pci_ss_list_1c1c NULL
-#define pci_ss_list_1d44 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_1de1[] = {
- &pci_ss_info_1de1_1020,
- &pci_ss_info_1de1_3904,
- &pci_ss_info_1de1_3907,
- NULL
-};
-#endif
-#define pci_ss_list_1fc0 NULL
-#define pci_ss_list_2000 NULL
-#define pci_ss_list_2001 NULL
-#define pci_ss_list_2003 NULL
-#define pci_ss_list_2004 NULL
-#define pci_ss_list_21c3 NULL
-#define pci_ss_list_2348 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_2646[] = {
- &pci_ss_info_2646_0001,
- NULL
-};
-#endif
-#define pci_ss_list_270b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_270f[] = {
- &pci_ss_info_270f_2001,
- &pci_ss_info_270f_2200,
- &pci_ss_info_270f_3000,
- &pci_ss_info_270f_3100,
- &pci_ss_info_270f_3102,
- &pci_ss_info_270f_7040,
- &pci_ss_info_270f_7060,
- &pci_ss_info_270f_a171,
- NULL
-};
-#endif
-#define pci_ss_list_2711 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_2a15[] = {
- &pci_ss_info_2a15_54a3,
- NULL
-};
-#endif
-#define pci_ss_list_3000 NULL
-#define pci_ss_list_3142 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_3388[] = {
- &pci_ss_info_3388_8011,
- &pci_ss_info_3388_8012,
- &pci_ss_info_3388_8013,
- NULL
-};
-#endif
-#define pci_ss_list_3411 NULL
-#define pci_ss_list_3513 NULL
-#define pci_ss_list_38ef NULL
-static const pciSubsystemInfo *pci_ss_list_3d3d[] = {
- &pci_ss_info_3d3d_0100,
- &pci_ss_info_3d3d_0111,
- &pci_ss_info_3d3d_0114,
- &pci_ss_info_3d3d_0116,
- &pci_ss_info_3d3d_0119,
- &pci_ss_info_3d3d_0120,
- &pci_ss_info_3d3d_0121,
- &pci_ss_info_3d3d_0125,
- &pci_ss_info_3d3d_0127,
- &pci_ss_info_3d3d_0144,
- NULL
-};
-static const pciSubsystemInfo *pci_ss_list_4005[] = {
- &pci_ss_info_4005_4000,
- NULL
-};
-#define pci_ss_list_4033 NULL
-#define pci_ss_list_4143 NULL
-#define pci_ss_list_416c NULL
-#define pci_ss_list_4444 NULL
-#define pci_ss_list_4468 NULL
-#define pci_ss_list_4594 NULL
-#define pci_ss_list_45fb NULL
-#define pci_ss_list_4680 NULL
-#define pci_ss_list_4843 NULL
-#define pci_ss_list_4916 NULL
-#define pci_ss_list_4943 NULL
-#define pci_ss_list_4978 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_4a14[] = {
- &pci_ss_info_4a14_5000,
- NULL
-};
-#endif
-#define pci_ss_list_4b10 NULL
-#define pci_ss_list_4c48 NULL
-#define pci_ss_list_4c53 NULL
-#define pci_ss_list_4ca1 NULL
-#define pci_ss_list_4d51 NULL
-#define pci_ss_list_4d54 NULL
-#define pci_ss_list_4ddc NULL
-#define pci_ss_list_5046 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_5053[] = {
- &pci_ss_info_5053_3355,
- &pci_ss_info_5053_3356,
- NULL
-};
-#endif
-#define pci_ss_list_5136 NULL
-#define pci_ss_list_5143 NULL
-#define pci_ss_list_5145 NULL
-#define pci_ss_list_5168 NULL
-#define pci_ss_list_5301 NULL
-static const pciSubsystemInfo *pci_ss_list_5333[] = {
- &pci_ss_info_5333_8100,
- &pci_ss_info_5333_8110,
- &pci_ss_info_5333_8125,
- &pci_ss_info_5333_8143,
- &pci_ss_info_5333_8900,
- &pci_ss_info_5333_8901,
- &pci_ss_info_5333_8904,
- &pci_ss_info_5333_8a01,
- &pci_ss_info_5333_8a13,
- &pci_ss_info_5333_8a20,
- &pci_ss_info_5333_8a21,
- &pci_ss_info_5333_8a22,
- &pci_ss_info_5333_8a2e,
- &pci_ss_info_5333_9125,
- &pci_ss_info_5333_9143,
- NULL
-};
-#define pci_ss_list_544c NULL
-#define pci_ss_list_5455 NULL
-#define pci_ss_list_5519 NULL
-#define pci_ss_list_5544 NULL
-#define pci_ss_list_5555 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_5654[] = {
- &pci_ss_info_5654_5634,
- NULL
-};
-#endif
-#define pci_ss_list_5700 NULL
-#define pci_ss_list_6356 NULL
-#define pci_ss_list_6374 NULL
-#define pci_ss_list_6409 NULL
-#define pci_ss_list_6666 NULL
-#define pci_ss_list_7604 NULL
-#define pci_ss_list_7bde NULL
-#define pci_ss_list_7fed NULL
-#define pci_ss_list_8008 NULL
-static const pciSubsystemInfo *pci_ss_list_8086[] = {
- &pci_ss_info_8086_0000,
- &pci_ss_info_8086_0001,
- &pci_ss_info_8086_0002,
- &pci_ss_info_8086_0003,
- &pci_ss_info_8086_0004,
- &pci_ss_info_8086_0005,
- &pci_ss_info_8086_0006,
- &pci_ss_info_8086_0007,
- &pci_ss_info_8086_0008,
- &pci_ss_info_8086_0009,
- &pci_ss_info_8086_000a,
- &pci_ss_info_8086_000b,
- &pci_ss_info_8086_000c,
- &pci_ss_info_8086_000d,
- &pci_ss_info_8086_000e,
- &pci_ss_info_8086_000f,
- &pci_ss_info_8086_0010,
- &pci_ss_info_8086_0011,
- &pci_ss_info_8086_0012,
- &pci_ss_info_8086_0013,
- &pci_ss_info_8086_001e,
- &pci_ss_info_8086_002a,
- &pci_ss_info_8086_002b,
- &pci_ss_info_8086_002e,
- &pci_ss_info_8086_0030,
- &pci_ss_info_8086_0031,
- &pci_ss_info_8086_0040,
- &pci_ss_info_8086_0041,
- &pci_ss_info_8086_0042,
- &pci_ss_info_8086_0050,
- &pci_ss_info_8086_0100,
- &pci_ss_info_8086_1000,
- &pci_ss_info_8086_1001,
- &pci_ss_info_8086_1002,
- &pci_ss_info_8086_1003,
- &pci_ss_info_8086_1004,
- &pci_ss_info_8086_1009,
- &pci_ss_info_8086_100c,
- &pci_ss_info_8086_1011,
- &pci_ss_info_8086_1012,
- &pci_ss_info_8086_1013,
- &pci_ss_info_8086_1015,
- &pci_ss_info_8086_1017,
- &pci_ss_info_8086_1030,
- &pci_ss_info_8086_1040,
- &pci_ss_info_8086_1041,
- &pci_ss_info_8086_1042,
- &pci_ss_info_8086_1050,
- &pci_ss_info_8086_1051,
- &pci_ss_info_8086_1052,
- &pci_ss_info_8086_10f0,
- &pci_ss_info_8086_1107,
- &pci_ss_info_8086_1109,
- &pci_ss_info_8086_1112,
- &pci_ss_info_8086_1161,
- &pci_ss_info_8086_1361,
- &pci_ss_info_8086_1958,
- &pci_ss_info_8086_2004,
- &pci_ss_info_8086_2009,
- &pci_ss_info_8086_200d,
- &pci_ss_info_8086_200e,
- &pci_ss_info_8086_200f,
- &pci_ss_info_8086_2010,
- &pci_ss_info_8086_2013,
- &pci_ss_info_8086_2016,
- &pci_ss_info_8086_2017,
- &pci_ss_info_8086_2018,
- &pci_ss_info_8086_2019,
- &pci_ss_info_8086_2101,
- &pci_ss_info_8086_2102,
- &pci_ss_info_8086_2103,
- &pci_ss_info_8086_2104,
- &pci_ss_info_8086_2105,
- &pci_ss_info_8086_2106,
- &pci_ss_info_8086_2107,
- &pci_ss_info_8086_2108,
- &pci_ss_info_8086_2109,
- &pci_ss_info_8086_2110,
- &pci_ss_info_8086_2112,
- &pci_ss_info_8086_2200,
- &pci_ss_info_8086_2201,
- &pci_ss_info_8086_2202,
- &pci_ss_info_8086_2203,
- &pci_ss_info_8086_2204,
- &pci_ss_info_8086_2205,
- &pci_ss_info_8086_2206,
- &pci_ss_info_8086_2207,
- &pci_ss_info_8086_2208,
- &pci_ss_info_8086_2402,
- &pci_ss_info_8086_2407,
- &pci_ss_info_8086_2408,
- &pci_ss_info_8086_2409,
- &pci_ss_info_8086_240f,
- &pci_ss_info_8086_2410,
- &pci_ss_info_8086_2411,
- &pci_ss_info_8086_2412,
- &pci_ss_info_8086_2413,
- &pci_ss_info_8086_2513,
- &pci_ss_info_8086_3000,
- &pci_ss_info_8086_3001,
- &pci_ss_info_8086_3002,
- &pci_ss_info_8086_3006,
- &pci_ss_info_8086_3007,
- &pci_ss_info_8086_3008,
- &pci_ss_info_8086_3010,
- &pci_ss_info_8086_3011,
- &pci_ss_info_8086_3012,
- &pci_ss_info_8086_3013,
- &pci_ss_info_8086_3014,
- &pci_ss_info_8086_3015,
- &pci_ss_info_8086_3016,
- &pci_ss_info_8086_3017,
- &pci_ss_info_8086_3018,
- &pci_ss_info_8086_4152,
- &pci_ss_info_8086_4249,
- &pci_ss_info_8086_424c,
- &pci_ss_info_8086_425a,
- &pci_ss_info_8086_4341,
- &pci_ss_info_8086_4343,
- &pci_ss_info_8086_4532,
- &pci_ss_info_8086_4557,
- &pci_ss_info_8086_4649,
- &pci_ss_info_8086_464a,
- &pci_ss_info_8086_4d4f,
- &pci_ss_info_8086_4f43,
- &pci_ss_info_8086_5243,
- &pci_ss_info_8086_5352,
- &pci_ss_info_8086_5643,
- &pci_ss_info_8086_5753,
- &pci_ss_info_8086_8000,
- &pci_ss_info_8086_8181,
- &pci_ss_info_8086_9181,
- NULL
-};
-#define pci_ss_list_8800 NULL
-#define pci_ss_list_8866 NULL
-#define pci_ss_list_8888 NULL
-#define pci_ss_list_8e0e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_8e2e[] = {
- &pci_ss_info_8e2e_7000,
- &pci_ss_info_8e2e_7100,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_9004[] = {
- &pci_ss_info_9004_0008,
- &pci_ss_info_9004_0009,
- &pci_ss_info_9004_0010,
- &pci_ss_info_9004_0018,
- &pci_ss_info_9004_0019,
- &pci_ss_info_9004_0020,
- &pci_ss_info_9004_0028,
- &pci_ss_info_9004_7560,
- &pci_ss_info_9004_7815,
- &pci_ss_info_9004_7840,
- &pci_ss_info_9004_7850,
- &pci_ss_info_9004_7861,
- &pci_ss_info_9004_7880,
- &pci_ss_info_9004_7881,
- &pci_ss_info_9004_7887,
- &pci_ss_info_9004_7888,
- &pci_ss_info_9004_7890,
- &pci_ss_info_9004_7891,
- &pci_ss_info_9004_7892,
- &pci_ss_info_9004_7894,
- &pci_ss_info_9004_7895,
- &pci_ss_info_9004_7896,
- &pci_ss_info_9004_7897,
- &pci_ss_info_9004_8008,
- &pci_ss_info_9004_8009,
- &pci_ss_info_9004_8010,
- &pci_ss_info_9004_8018,
- &pci_ss_info_9004_8019,
- &pci_ss_info_9004_8020,
- &pci_ss_info_9004_8028,
- &pci_ss_info_9004_9110,
- &pci_ss_info_9004_9111,
- &pci_ss_info_9004_9210,
- &pci_ss_info_9004_9211,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_9005[] = {
- &pci_ss_info_9005_0003,
- &pci_ss_info_9005_000f,
- &pci_ss_info_9005_0041,
- &pci_ss_info_9005_0365,
- &pci_ss_info_9005_1364,
- &pci_ss_info_9005_1365,
- &pci_ss_info_9005_2180,
- &pci_ss_info_9005_62a0,
- &pci_ss_info_9005_62a1,
- &pci_ss_info_9005_8100,
- &pci_ss_info_9005_a180,
- &pci_ss_info_9005_b500,
- &pci_ss_info_9005_e100,
- &pci_ss_info_9005_e220,
- &pci_ss_info_9005_e2a0,
- &pci_ss_info_9005_f500,
- &pci_ss_info_9005_f620,
- &pci_ss_info_9005_ffff,
- NULL
-};
-#endif
-#define pci_ss_list_907f NULL
-#define pci_ss_list_919a NULL
-#define pci_ss_list_9412 NULL
-#define pci_ss_list_9699 NULL
-#define pci_ss_list_9710 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_a0a0[] = {
- &pci_ss_info_a0a0_0007,
- &pci_ss_info_a0a0_0022,
- NULL
-};
-#endif
-#define pci_ss_list_a0f1 NULL
-#define pci_ss_list_a200 NULL
-#define pci_ss_list_a259 NULL
-#define pci_ss_list_a25b NULL
-#define pci_ss_list_a304 NULL
-#define pci_ss_list_a727 NULL
-#define pci_ss_list_aa42 NULL
-#define pci_ss_list_ac1e NULL
-#define pci_ss_list_b1b3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_bd11[] = {
- &pci_ss_info_bd11_1200,
- NULL
-};
-#endif
-#define pci_ss_list_c001 NULL
-#define pci_ss_list_c0a9 NULL
-#define pci_ss_list_c0de NULL
-#define pci_ss_list_c0fe NULL
-#define pci_ss_list_ca50 NULL
-#define pci_ss_list_cafe NULL
-#define pci_ss_list_cccc NULL
-#define pci_ss_list_cddd NULL
-#define pci_ss_list_d4d4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_d531[] = {
- &pci_ss_info_d531_c002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_d84d[] = {
- &pci_ss_info_d84d_4006,
- &pci_ss_info_d84d_4008,
- &pci_ss_info_d84d_4014,
- &pci_ss_info_d84d_4018,
- &pci_ss_info_d84d_4025,
- &pci_ss_info_d84d_4027,
- &pci_ss_info_d84d_4028,
- &pci_ss_info_d84d_4036,
- &pci_ss_info_d84d_4037,
- &pci_ss_info_d84d_4038,
- &pci_ss_info_d84d_4052,
- &pci_ss_info_d84d_4053,
- &pci_ss_info_d84d_4055,
- &pci_ss_info_d84d_4058,
- &pci_ss_info_d84d_4065,
- &pci_ss_info_d84d_4068,
- &pci_ss_info_d84d_4078,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_dead[] = {
- &pci_ss_info_dead_0800,
- NULL
-};
-#endif
-#define pci_ss_list_e000 NULL
-#define pci_ss_list_e159 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_e4bf[] = {
- &pci_ss_info_e4bf_1000,
- &pci_ss_info_e4bf_1010,
- &pci_ss_info_e4bf_1020,
- NULL
-};
-#endif
-#define pci_ss_list_ea01 NULL
-#define pci_ss_list_ea60 NULL
-#define pci_ss_list_eabb NULL
-#define pci_ss_list_eace NULL
-#define pci_ss_list_ec80 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciSubsystemInfo *pci_ss_list_ecc0[] = {
- &pci_ss_info_ecc0_0030,
- NULL
-};
-#endif
-#define pci_ss_list_edd8 NULL
-#define pci_ss_list_f1d0 NULL
-#define pci_ss_list_fa57 NULL
-#define pci_ss_list_febd NULL
-#define pci_ss_list_feda NULL
-#define pci_ss_list_fffe NULL
-#define pci_ss_list_ffff NULL
-#endif /* INIT_VENDOR_SUBSYS_INFO */
-#endif /* INIT_SUBSYS_INFO */
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_0675_1700 = {
- 0x1700, pci_device_0675_1700,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0675_1700,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0675_1702 = {
- 0x1702, pci_device_0675_1702,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0675_1702,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_09c1_0704 = {
- 0x0704, pci_device_09c1_0704,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_09c1_0704,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_0e11_0001 = {
- 0x0001, pci_device_0e11_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_0002 = {
- 0x0002, pci_device_0e11_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_0049 = {
- 0x0049, pci_device_0e11_0049,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_0049,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_004a = {
- 0x004a, pci_device_0e11_004a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_004a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_0508 = {
- 0x0508, pci_device_0e11_0508,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_0508,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_1000 = {
- 0x1000, pci_device_0e11_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_2000 = {
- 0x2000, pci_device_0e11_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_3032 = {
- 0x3032, pci_device_0e11_3032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_3032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_3033 = {
- 0x3033, pci_device_0e11_3033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_3033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_3034 = {
- 0x3034, pci_device_0e11_3034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_3034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_4000 = {
- 0x4000, pci_device_0e11_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_4000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_6010 = {
- 0x6010, pci_device_0e11_6010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_6010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_7020 = {
- 0x7020, pci_device_0e11_7020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_7020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0ec = {
- 0xa0ec, pci_device_0e11_a0ec,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0ec,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0f0 = {
- 0xa0f0, pci_device_0e11_a0f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0f3 = {
- 0xa0f3, pci_device_0e11_a0f3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0f3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0f7 = {
- 0xa0f7, pci_device_0e11_a0f7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0f7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0f8 = {
- 0xa0f8, pci_device_0e11_a0f8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0f8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_a0fc = {
- 0xa0fc, pci_device_0e11_a0fc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_a0fc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae10 = {
- 0xae10, pci_device_0e11_ae10,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae10,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae29 = {
- 0xae29, pci_device_0e11_ae29,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae29,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae2a = {
- 0xae2a, pci_device_0e11_ae2a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae2a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae2b = {
- 0xae2b, pci_device_0e11_ae2b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae2b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae31 = {
- 0xae31, pci_device_0e11_ae31,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae31,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae32 = {
- 0xae32, pci_device_0e11_ae32,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae32,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae33 = {
- 0xae33, pci_device_0e11_ae33,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae33,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae34 = {
- 0xae34, pci_device_0e11_ae34,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae34,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae35 = {
- 0xae35, pci_device_0e11_ae35,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae35,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae40 = {
- 0xae40, pci_device_0e11_ae40,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae40,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae43 = {
- 0xae43, pci_device_0e11_ae43,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae43,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae69 = {
- 0xae69, pci_device_0e11_ae69,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae69,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae6c = {
- 0xae6c, pci_device_0e11_ae6c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae6c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_ae6d = {
- 0xae6d, pci_device_0e11_ae6d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_ae6d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b011 = {
- 0xb011, pci_device_0e11_b011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b012 = {
- 0xb012, pci_device_0e11_b012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b01e = {
- 0xb01e, pci_device_0e11_b01e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b01e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b01f = {
- 0xb01f, pci_device_0e11_b01f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b01f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b02f = {
- 0xb02f, pci_device_0e11_b02f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b02f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b030 = {
- 0xb030, pci_device_0e11_b030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b04a = {
- 0xb04a, pci_device_0e11_b04a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b04a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b060 = {
- 0xb060, pci_device_0e11_b060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0c6 = {
- 0xb0c6, pci_device_0e11_b0c6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0c6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0c7 = {
- 0xb0c7, pci_device_0e11_b0c7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0c7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0d7 = {
- 0xb0d7, pci_device_0e11_b0d7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0d7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0dd = {
- 0xb0dd, pci_device_0e11_b0dd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0dd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0de = {
- 0xb0de, pci_device_0e11_b0de,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0de,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0df = {
- 0xb0df, pci_device_0e11_b0df,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0df,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0e0 = {
- 0xb0e0, pci_device_0e11_b0e0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0e0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b0e1 = {
- 0xb0e1, pci_device_0e11_b0e1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b0e1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b123 = {
- 0xb123, pci_device_0e11_b123,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b123,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b134 = {
- 0xb134, pci_device_0e11_b134,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b134,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b13c = {
- 0xb13c, pci_device_0e11_b13c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b13c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b144 = {
- 0xb144, pci_device_0e11_b144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b163 = {
- 0xb163, pci_device_0e11_b163,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b163,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b164 = {
- 0xb164, pci_device_0e11_b164,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b164,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b178 = {
- 0xb178, pci_device_0e11_b178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_b1a4 = {
- 0xb1a4, pci_device_0e11_b1a4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_b1a4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_f130 = {
- 0xf130, pci_device_0e11_f130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_f130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_0e11_f150 = {
- 0xf150, pci_device_0e11_f150,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_0e11_f150,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1000_0001 = {
- 0x0001, pci_device_1000_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0002 = {
- 0x0002, pci_device_1000_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0003 = {
- 0x0003, pci_device_1000_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0004 = {
- 0x0004, pci_device_1000_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0005 = {
- 0x0005, pci_device_1000_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0006 = {
- 0x0006, pci_device_1000_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_000a = {
- 0x000a, pci_device_1000_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_000b = {
- 0x000b, pci_device_1000_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_000c = {
- 0x000c, pci_device_1000_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_000d = {
- 0x000d, pci_device_1000_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_000f = {
- 0x000f, pci_device_1000_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_000f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0010 = {
- 0x0010, pci_device_1000_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0012 = {
- 0x0012, pci_device_1000_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0013 = {
- 0x0013, pci_device_1000_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0020 = {
- 0x0020, pci_device_1000_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0021 = {
- 0x0021, pci_device_1000_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0030 = {
- 0x0030, pci_device_1000_0030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0040 = {
- 0x0040, pci_device_1000_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_008f = {
- 0x008f, pci_device_1000_008f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_008f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0621 = {
- 0x0621, pci_device_1000_0621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0622 = {
- 0x0622, pci_device_1000_0622,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0622,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0623 = {
- 0x0623, pci_device_1000_0623,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0623,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0624 = {
- 0x0624, pci_device_1000_0624,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0624,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0625 = {
- 0x0625, pci_device_1000_0625,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0625,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0626 = {
- 0x0626, pci_device_1000_0626,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0626,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0627 = {
- 0x0627, pci_device_1000_0627,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0627,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0628 = {
- 0x0628, pci_device_1000_0628,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0628,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0629 = {
- 0x0629, pci_device_1000_0629,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0629,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0701 = {
- 0x0701, pci_device_1000_0701,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0701,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0702 = {
- 0x0702, pci_device_1000_0702,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0702,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_0901 = {
- 0x0901, pci_device_1000_0901,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_0901,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_1000 = {
- 0x1000, pci_device_1000_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1000_1960 = {
- 0x1960, pci_device_1000_1960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1000_1960,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1001_0010 = {
- 0x0010, pci_device_1001_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0011 = {
- 0x0011, pci_device_1001_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0012 = {
- 0x0012, pci_device_1001_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0013 = {
- 0x0013, pci_device_1001_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0014 = {
- 0x0014, pci_device_1001_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0015 = {
- 0x0015, pci_device_1001_0015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0016 = {
- 0x0016, pci_device_1001_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_0017 = {
- 0x0017, pci_device_1001_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1001_9100 = {
- 0x9100, pci_device_1001_9100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1001_9100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1002_4136 = {
- 0x4136, pci_device_1002_4136,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4136,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4144 = {
- 0x4144, pci_device_1002_4144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4145 = {
- 0x4145, pci_device_1002_4145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4146 = {
- 0x4146, pci_device_1002_4146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4146,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4147 = {
- 0x4147, pci_device_1002_4147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4158 = {
- 0x4158, pci_device_1002_4158,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4158,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4242 = {
- 0x4242, pci_device_1002_4242,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4242,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4336 = {
- 0x4336, pci_device_1002_4336,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4336,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4337 = {
- 0x4337, pci_device_1002_4337,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4337,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4354 = {
- 0x4354, pci_device_1002_4354,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4354,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4358 = {
- 0x4358, pci_device_1002_4358,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4358,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4554 = {
- 0x4554, pci_device_1002_4554,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4554,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4654 = {
- 0x4654, pci_device_1002_4654,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4654,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4742 = {
- 0x4742, pci_device_1002_4742,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4742,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4744 = {
- 0x4744, pci_device_1002_4744,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4744,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4747 = {
- 0x4747, pci_device_1002_4747,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4747,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4749 = {
- 0x4749, pci_device_1002_4749,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4749,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_474c = {
- 0x474c, pci_device_1002_474c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_474c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_474d = {
- 0x474d, pci_device_1002_474d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_474d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_474e = {
- 0x474e, pci_device_1002_474e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_474e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_474f = {
- 0x474f, pci_device_1002_474f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_474f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4750 = {
- 0x4750, pci_device_1002_4750,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4750,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4751 = {
- 0x4751, pci_device_1002_4751,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4751,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4752 = {
- 0x4752, pci_device_1002_4752,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4752,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4753 = {
- 0x4753, pci_device_1002_4753,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4753,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4754 = {
- 0x4754, pci_device_1002_4754,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4754,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4755 = {
- 0x4755, pci_device_1002_4755,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4755,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4756 = {
- 0x4756, pci_device_1002_4756,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4756,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4757 = {
- 0x4757, pci_device_1002_4757,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4757,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4758 = {
- 0x4758, pci_device_1002_4758,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4758,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4759 = {
- 0x4759, pci_device_1002_4759,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4759,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_475a = {
- 0x475a, pci_device_1002_475a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_475a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4964 = {
- 0x4964, pci_device_1002_4964,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4964,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4965 = {
- 0x4965, pci_device_1002_4965,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4965,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4966 = {
- 0x4966, pci_device_1002_4966,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4966,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4967 = {
- 0x4967, pci_device_1002_4967,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4967,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_496e = {
- 0x496e, pci_device_1002_496e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_496e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c42 = {
- 0x4c42, pci_device_1002_4c42,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c42,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c44 = {
- 0x4c44, pci_device_1002_4c44,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c44,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c45 = {
- 0x4c45, pci_device_1002_4c45,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c45,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c46 = {
- 0x4c46, pci_device_1002_4c46,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c46,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c47 = {
- 0x4c47, pci_device_1002_4c47,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c47,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c49 = {
- 0x4c49, pci_device_1002_4c49,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c49,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c4d = {
- 0x4c4d, pci_device_1002_4c4d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c4d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c4e = {
- 0x4c4e, pci_device_1002_4c4e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c4e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c50 = {
- 0x4c50, pci_device_1002_4c50,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c50,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c51 = {
- 0x4c51, pci_device_1002_4c51,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c51,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c52 = {
- 0x4c52, pci_device_1002_4c52,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c52,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c53 = {
- 0x4c53, pci_device_1002_4c53,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c53,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c54 = {
- 0x4c54, pci_device_1002_4c54,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c54,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c57 = {
- 0x4c57, pci_device_1002_4c57,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c57,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c58 = {
- 0x4c58, pci_device_1002_4c58,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c58,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c59 = {
- 0x4c59, pci_device_1002_4c59,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c59,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c5a = {
- 0x4c5a, pci_device_1002_4c5a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c5a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c64 = {
- 0x4c64, pci_device_1002_4c64,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c64,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c65 = {
- 0x4c65, pci_device_1002_4c65,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c65,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c66 = {
- 0x4c66, pci_device_1002_4c66,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c66,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4c67 = {
- 0x4c67, pci_device_1002_4c67,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4c67,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4d46 = {
- 0x4d46, pci_device_1002_4d46,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4d46,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4d4c = {
- 0x4d4c, pci_device_1002_4d4c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4d4c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e44 = {
- 0x4e44, pci_device_1002_4e44,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e44,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e45 = {
- 0x4e45, pci_device_1002_4e45,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e45,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e46 = {
- 0x4e46, pci_device_1002_4e46,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e46,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e47 = {
- 0x4e47, pci_device_1002_4e47,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e47,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e48 = {
- 0x4e48, pci_device_1002_4e48,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e48,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e64 = {
- 0x4e64, pci_device_1002_4e64,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e64,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e65 = {
- 0x4e65, pci_device_1002_4e65,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e65,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e66 = {
- 0x4e66, pci_device_1002_4e66,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e66,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e67 = {
- 0x4e67, pci_device_1002_4e67,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e67,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_4e68 = {
- 0x4e68, pci_device_1002_4e68,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_4e68,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5041 = {
- 0x5041, pci_device_1002_5041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5042 = {
- 0x5042, pci_device_1002_5042,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5042,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5043 = {
- 0x5043, pci_device_1002_5043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5044 = {
- 0x5044, pci_device_1002_5044,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5044,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5045 = {
- 0x5045, pci_device_1002_5045,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5045,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5046 = {
- 0x5046, pci_device_1002_5046,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5046,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5047 = {
- 0x5047, pci_device_1002_5047,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5047,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5048 = {
- 0x5048, pci_device_1002_5048,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5048,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5049 = {
- 0x5049, pci_device_1002_5049,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5049,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504a = {
- 0x504a, pci_device_1002_504a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504b = {
- 0x504b, pci_device_1002_504b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504c = {
- 0x504c, pci_device_1002_504c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504d = {
- 0x504d, pci_device_1002_504d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504e = {
- 0x504e, pci_device_1002_504e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_504f = {
- 0x504f, pci_device_1002_504f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_504f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5050 = {
- 0x5050, pci_device_1002_5050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5051 = {
- 0x5051, pci_device_1002_5051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5052 = {
- 0x5052, pci_device_1002_5052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5053 = {
- 0x5053, pci_device_1002_5053,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5053,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5054 = {
- 0x5054, pci_device_1002_5054,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5054,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5055 = {
- 0x5055, pci_device_1002_5055,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5055,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5056 = {
- 0x5056, pci_device_1002_5056,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5056,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5057 = {
- 0x5057, pci_device_1002_5057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5058 = {
- 0x5058, pci_device_1002_5058,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5058,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5144 = {
- 0x5144, pci_device_1002_5144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5145 = {
- 0x5145, pci_device_1002_5145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5146 = {
- 0x5146, pci_device_1002_5146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5146,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5147 = {
- 0x5147, pci_device_1002_5147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5148 = {
- 0x5148, pci_device_1002_5148,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5148,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5149 = {
- 0x5149, pci_device_1002_5149,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5149,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514a = {
- 0x514a, pci_device_1002_514a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514b = {
- 0x514b, pci_device_1002_514b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514c = {
- 0x514c, pci_device_1002_514c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514d = {
- 0x514d, pci_device_1002_514d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514e = {
- 0x514e, pci_device_1002_514e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_514f = {
- 0x514f, pci_device_1002_514f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_514f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5157 = {
- 0x5157, pci_device_1002_5157,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5157,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5158 = {
- 0x5158, pci_device_1002_5158,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5158,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5159 = {
- 0x5159, pci_device_1002_5159,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5159,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_515a = {
- 0x515a, pci_device_1002_515a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_515a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5168 = {
- 0x5168, pci_device_1002_5168,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5168,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5169 = {
- 0x5169, pci_device_1002_5169,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5169,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_516a = {
- 0x516a, pci_device_1002_516a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_516a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_516b = {
- 0x516b, pci_device_1002_516b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_516b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_516c = {
- 0x516c, pci_device_1002_516c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_516c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5245 = {
- 0x5245, pci_device_1002_5245,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5245,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5246 = {
- 0x5246, pci_device_1002_5246,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5246,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5247 = {
- 0x5247, pci_device_1002_5247,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5247,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_524b = {
- 0x524b, pci_device_1002_524b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_524b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_524c = {
- 0x524c, pci_device_1002_524c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_524c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5345 = {
- 0x5345, pci_device_1002_5345,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5345,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5346 = {
- 0x5346, pci_device_1002_5346,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5346,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5347 = {
- 0x5347, pci_device_1002_5347,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5347,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5348 = {
- 0x5348, pci_device_1002_5348,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5348,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_534b = {
- 0x534b, pci_device_1002_534b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_534b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_534c = {
- 0x534c, pci_device_1002_534c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_534c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_534d = {
- 0x534d, pci_device_1002_534d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_534d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_534e = {
- 0x534e, pci_device_1002_534e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_534e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5354 = {
- 0x5354, pci_device_1002_5354,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5354,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5446 = {
- 0x5446, pci_device_1002_5446,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5446,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_544c = {
- 0x544c, pci_device_1002_544c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_544c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5452 = {
- 0x5452, pci_device_1002_5452,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5452,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5453 = {
- 0x5453, pci_device_1002_5453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5454 = {
- 0x5454, pci_device_1002_5454,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5454,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5455 = {
- 0x5455, pci_device_1002_5455,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5455,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5654 = {
- 0x5654, pci_device_1002_5654,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5654,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5655 = {
- 0x5655, pci_device_1002_5655,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5655,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_5656 = {
- 0x5656, pci_device_1002_5656,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_5656,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_700f = {
- 0x700f, pci_device_1002_700f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_700f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_7010 = {
- 0x7010, pci_device_1002_7010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_7010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1002_cab2 = {
- 0xcab2, pci_device_1002_cab2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1002_cab2,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1003_0201 = {
- 0x0201, pci_device_1003_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1003_0201,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1004_0005 = {
- 0x0005, pci_device_1004_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0006 = {
- 0x0006, pci_device_1004_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0007 = {
- 0x0007, pci_device_1004_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0008 = {
- 0x0008, pci_device_1004_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0009 = {
- 0x0009, pci_device_1004_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_000c = {
- 0x000c, pci_device_1004_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_000d = {
- 0x000d, pci_device_1004_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0101 = {
- 0x0101, pci_device_1004_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0102 = {
- 0x0102, pci_device_1004_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0103 = {
- 0x0103, pci_device_1004_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0104 = {
- 0x0104, pci_device_1004_0104,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0104,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0105 = {
- 0x0105, pci_device_1004_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0200 = {
- 0x0200, pci_device_1004_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0280 = {
- 0x0280, pci_device_1004_0280,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0280,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0304 = {
- 0x0304, pci_device_1004_0304,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0304,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0305 = {
- 0x0305, pci_device_1004_0305,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0305,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0306 = {
- 0x0306, pci_device_1004_0306,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0306,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0307 = {
- 0x0307, pci_device_1004_0307,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0307,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0308 = {
- 0x0308, pci_device_1004_0308,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0308,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0702 = {
- 0x0702, pci_device_1004_0702,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0702,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1004_0703 = {
- 0x0703, pci_device_1004_0703,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1004_0703,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1005_2064 = {
- 0x2064, pci_device_1005_2064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2128 = {
- 0x2128, pci_device_1005_2128,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2128,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2301 = {
- 0x2301, pci_device_1005_2301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2302 = {
- 0x2302, pci_device_1005_2302,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2302,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2364 = {
- 0x2364, pci_device_1005_2364,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2364,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2464 = {
- 0x2464, pci_device_1005_2464,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2464,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1005_2501 = {
- 0x2501, pci_device_1005_2501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1005_2501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0001 = {
- 0x0001, pci_device_100b_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0002 = {
- 0x0002, pci_device_100b_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_000e = {
- 0x000e, pci_device_100b_000e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_000e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_000f = {
- 0x000f, pci_device_100b_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_000f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0011 = {
- 0x0011, pci_device_100b_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0012 = {
- 0x0012, pci_device_100b_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0020 = {
- 0x0020, pci_device_100b_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0022 = {
- 0x0022, pci_device_100b_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0500 = {
- 0x0500, pci_device_100b_0500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0501 = {
- 0x0501, pci_device_100b_0501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0502 = {
- 0x0502, pci_device_100b_0502,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0502,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0503 = {
- 0x0503, pci_device_100b_0503,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0503,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0504 = {
- 0x0504, pci_device_100b_0504,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0504,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_0505 = {
- 0x0505, pci_device_100b_0505,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_0505,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100b_d001 = {
- 0xd001, pci_device_100b_d001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100b_d001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_3202 = {
- 0x3202, pci_device_100c_3202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_3202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_3205 = {
- 0x3205, pci_device_100c_3205,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_3205,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_3206 = {
- 0x3206, pci_device_100c_3206,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_3206,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_3207 = {
- 0x3207, pci_device_100c_3207,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_3207,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_3208 = {
- 0x3208, pci_device_100c_3208,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_3208,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100c_4702 = {
- 0x4702, pci_device_100c_4702,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100c_4702,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100e_9000 = {
- 0x9000, pci_device_100e_9000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100e_9000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100e_9001 = {
- 0x9001, pci_device_100e_9001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100e_9001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100e_9002 = {
- 0x9002, pci_device_100e_9002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100e_9002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_100e_9100 = {
- 0x9100, pci_device_100e_9100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_100e_9100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0001 = {
- 0x0001, pci_device_1011_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0002 = {
- 0x0002, pci_device_1011_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0004 = {
- 0x0004, pci_device_1011_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0007 = {
- 0x0007, pci_device_1011_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0008 = {
- 0x0008, pci_device_1011_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0009 = {
- 0x0009, pci_device_1011_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_000a = {
- 0x000a, pci_device_1011_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_000d = {
- 0x000d, pci_device_1011_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_000f = {
- 0x000f, pci_device_1011_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_000f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0014 = {
- 0x0014, pci_device_1011_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0016 = {
- 0x0016, pci_device_1011_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0017 = {
- 0x0017, pci_device_1011_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0019 = {
- 0x0019, pci_device_1011_0019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_001a = {
- 0x001a, pci_device_1011_001a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_001a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0021 = {
- 0x0021, pci_device_1011_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0022 = {
- 0x0022, pci_device_1011_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0023 = {
- 0x0023, pci_device_1011_0023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0024 = {
- 0x0024, pci_device_1011_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0025 = {
- 0x0025, pci_device_1011_0025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0026 = {
- 0x0026, pci_device_1011_0026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0034 = {
- 0x0034, pci_device_1011_0034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0045 = {
- 0x0045, pci_device_1011_0045,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0045,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_0046 = {
- 0x0046, pci_device_1011_0046,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_0046,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1011_1065 = {
- 0x1065, pci_device_1011_1065,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1011_1065,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_0038 = {
- 0x0038, pci_device_1013_0038,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_0038,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_0040 = {
- 0x0040, pci_device_1013_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_004c = {
- 0x004c, pci_device_1013_004c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_004c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00a0 = {
- 0x00a0, pci_device_1013_00a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00a2 = {
- 0x00a2, pci_device_1013_00a2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00a2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00a4 = {
- 0x00a4, pci_device_1013_00a4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00a4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00a8 = {
- 0x00a8, pci_device_1013_00a8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00a8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00ac = {
- 0x00ac, pci_device_1013_00ac,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00ac,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00b0 = {
- 0x00b0, pci_device_1013_00b0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00b0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00b8 = {
- 0x00b8, pci_device_1013_00b8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00b8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00bc = {
- 0x00bc, pci_device_1013_00bc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00bc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00d0 = {
- 0x00d0, pci_device_1013_00d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00d2 = {
- 0x00d2, pci_device_1013_00d2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00d2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00d4 = {
- 0x00d4, pci_device_1013_00d4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00d4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00d5 = {
- 0x00d5, pci_device_1013_00d5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00d5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00d6 = {
- 0x00d6, pci_device_1013_00d6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00d6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_00e8 = {
- 0x00e8, pci_device_1013_00e8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_00e8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1100 = {
- 0x1100, pci_device_1013_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1110 = {
- 0x1110, pci_device_1013_1110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1112 = {
- 0x1112, pci_device_1013_1112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1113 = {
- 0x1113, pci_device_1013_1113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1200 = {
- 0x1200, pci_device_1013_1200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1202 = {
- 0x1202, pci_device_1013_1202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_1204 = {
- 0x1204, pci_device_1013_1204,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_1204,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_4400 = {
- 0x4400, pci_device_1013_4400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_4400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_6001 = {
- 0x6001, pci_device_1013_6001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_6001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_6003 = {
- 0x6003, pci_device_1013_6003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_6003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_6004 = {
- 0x6004, pci_device_1013_6004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_6004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1013_6005 = {
- 0x6005, pci_device_1013_6005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1013_6005,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1014_0002 = {
- 0x0002, pci_device_1014_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0005 = {
- 0x0005, pci_device_1014_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0007 = {
- 0x0007, pci_device_1014_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_000a = {
- 0x000a, pci_device_1014_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0017 = {
- 0x0017, pci_device_1014_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0018 = {
- 0x0018, pci_device_1014_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_001b = {
- 0x001b, pci_device_1014_001b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_001b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_001c = {
- 0x001c, pci_device_1014_001c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_001c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_001d = {
- 0x001d, pci_device_1014_001d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_001d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0020 = {
- 0x0020, pci_device_1014_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0022 = {
- 0x0022, pci_device_1014_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_002d = {
- 0x002d, pci_device_1014_002d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_002d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_002e = {
- 0x002e, pci_device_1014_002e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_002e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0036 = {
- 0x0036, pci_device_1014_0036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_003a = {
- 0x003a, pci_device_1014_003a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_003a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_003e = {
- 0x003e, pci_device_1014_003e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_003e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0045 = {
- 0x0045, pci_device_1014_0045,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0045,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0046 = {
- 0x0046, pci_device_1014_0046,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0046,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0047 = {
- 0x0047, pci_device_1014_0047,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0047,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0048 = {
- 0x0048, pci_device_1014_0048,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0048,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0049 = {
- 0x0049, pci_device_1014_0049,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0049,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_004e = {
- 0x004e, pci_device_1014_004e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_004e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_004f = {
- 0x004f, pci_device_1014_004f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_004f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0050 = {
- 0x0050, pci_device_1014_0050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0053 = {
- 0x0053, pci_device_1014_0053,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0053,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0057 = {
- 0x0057, pci_device_1014_0057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_005c = {
- 0x005c, pci_device_1014_005c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_005c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_007c = {
- 0x007c, pci_device_1014_007c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_007c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_007d = {
- 0x007d, pci_device_1014_007d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_007d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0090 = {
- 0x0090, pci_device_1014_0090,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0090,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0095 = {
- 0x0095, pci_device_1014_0095,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0095,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0096 = {
- 0x0096, pci_device_1014_0096,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0096,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00a5 = {
- 0x00a5, pci_device_1014_00a5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00a5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00a6 = {
- 0x00a6, pci_device_1014_00a6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00a6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00b7 = {
- 0x00b7, pci_device_1014_00b7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00b7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00be = {
- 0x00be, pci_device_1014_00be,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00be,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00dc = {
- 0x00dc, pci_device_1014_00dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00dc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_00fc = {
- 0x00fc, pci_device_1014_00fc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_00fc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0105 = {
- 0x0105, pci_device_1014_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_010f = {
- 0x010f, pci_device_1014_010f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_010f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0142 = {
- 0x0142, pci_device_1014_0142,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0142,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0144 = {
- 0x0144, pci_device_1014_0144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0156 = {
- 0x0156, pci_device_1014_0156,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0156,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_01a7 = {
- 0x01a7, pci_device_1014_01a7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_01a7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_01bd = {
- 0x01bd, pci_device_1014_01bd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_01bd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_0302 = {
- 0x0302, pci_device_1014_0302,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_0302,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1014_ffff = {
- 0xffff, pci_device_1014_ffff,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1014_ffff,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1017_5343 = {
- 0x5343, pci_device_1017_5343,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1017_5343,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_101a_0005 = {
- 0x0005, pci_device_101a_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101a_0005,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_101c_0193 = {
- 0x0193, pci_device_101c_0193,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_0193,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_0196 = {
- 0x0196, pci_device_101c_0196,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_0196,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_0197 = {
- 0x0197, pci_device_101c_0197,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_0197,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_0296 = {
- 0x0296, pci_device_101c_0296,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_0296,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_3193 = {
- 0x3193, pci_device_101c_3193,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_3193,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_3197 = {
- 0x3197, pci_device_101c_3197,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_3197,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_3296 = {
- 0x3296, pci_device_101c_3296,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_3296,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_4296 = {
- 0x4296, pci_device_101c_4296,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_4296,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_9710 = {
- 0x9710, pci_device_101c_9710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_9710,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_9712 = {
- 0x9712, pci_device_101c_9712,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_9712,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101c_c24a = {
- 0xc24a, pci_device_101c_c24a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101c_c24a,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_101e_1960 = {
- 0x1960, pci_device_101e_1960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_1960,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9010 = {
- 0x9010, pci_device_101e_9010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9030 = {
- 0x9030, pci_device_101e_9030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9031 = {
- 0x9031, pci_device_101e_9031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9032 = {
- 0x9032, pci_device_101e_9032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9033 = {
- 0x9033, pci_device_101e_9033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9040 = {
- 0x9040, pci_device_101e_9040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9060 = {
- 0x9060, pci_device_101e_9060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_101e_9063 = {
- 0x9063, pci_device_101e_9063,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_101e_9063,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1022_1100 = {
- 0x1100, pci_device_1022_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_1100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_1101 = {
- 0x1101, pci_device_1022_1101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_1101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_1102 = {
- 0x1102, pci_device_1022_1102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_1102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_1103 = {
- 0x1103, pci_device_1022_1103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_1103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_2000 = {
- 0x2000, pci_device_1022_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_2001 = {
- 0x2001, pci_device_1022_2001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_2001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_2020 = {
- 0x2020, pci_device_1022_2020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_2020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_2040 = {
- 0x2040, pci_device_1022_2040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_2040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_3000 = {
- 0x3000, pci_device_1022_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_3000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7006 = {
- 0x7006, pci_device_1022_7006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7007 = {
- 0x7007, pci_device_1022_7007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_700c = {
- 0x700c, pci_device_1022_700c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_700c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_700d = {
- 0x700d, pci_device_1022_700d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_700d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_700e = {
- 0x700e, pci_device_1022_700e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_700e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_700f = {
- 0x700f, pci_device_1022_700f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_700f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7400 = {
- 0x7400, pci_device_1022_7400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7401 = {
- 0x7401, pci_device_1022_7401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7403 = {
- 0x7403, pci_device_1022_7403,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7403,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7404 = {
- 0x7404, pci_device_1022_7404,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7404,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7408 = {
- 0x7408, pci_device_1022_7408,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7408,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7409 = {
- 0x7409, pci_device_1022_7409,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7409,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_740b = {
- 0x740b, pci_device_1022_740b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_740b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_740c = {
- 0x740c, pci_device_1022_740c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_740c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7410 = {
- 0x7410, pci_device_1022_7410,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7410,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7411 = {
- 0x7411, pci_device_1022_7411,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7411,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7413 = {
- 0x7413, pci_device_1022_7413,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7413,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7414 = {
- 0x7414, pci_device_1022_7414,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7414,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7440 = {
- 0x7440, pci_device_1022_7440,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7440,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7441 = {
- 0x7441, pci_device_1022_7441,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7441,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7443 = {
- 0x7443, pci_device_1022_7443,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7443,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7445 = {
- 0x7445, pci_device_1022_7445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7446 = {
- 0x7446, pci_device_1022_7446,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7446,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7448 = {
- 0x7448, pci_device_1022_7448,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7448,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7449 = {
- 0x7449, pci_device_1022_7449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7449,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7450 = {
- 0x7450, pci_device_1022_7450,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7450,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7451 = {
- 0x7451, pci_device_1022_7451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7454 = {
- 0x7454, pci_device_1022_7454,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7454,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7455 = {
- 0x7455, pci_device_1022_7455,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7455,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7460 = {
- 0x7460, pci_device_1022_7460,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7460,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7461 = {
- 0x7461, pci_device_1022_7461,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7461,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7462 = {
- 0x7462, pci_device_1022_7462,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7462,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7464 = {
- 0x7464, pci_device_1022_7464,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7464,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7468 = {
- 0x7468, pci_device_1022_7468,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7468,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_7469 = {
- 0x7469, pci_device_1022_7469,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_7469,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_746a = {
- 0x746a, pci_device_1022_746a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_746a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_746b = {
- 0x746b, pci_device_1022_746b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_746b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_746d = {
- 0x746d, pci_device_1022_746d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_746d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1022_746e = {
- 0x746e, pci_device_1022_746e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1022_746e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_0194 = {
- 0x0194, pci_device_1023_0194,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_0194,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_2000 = {
- 0x2000, pci_device_1023_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_2001 = {
- 0x2001, pci_device_1023_2001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_2001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8400 = {
- 0x8400, pci_device_1023_8400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8420 = {
- 0x8420, pci_device_1023_8420,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8420,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8500 = {
- 0x8500, pci_device_1023_8500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8520 = {
- 0x8520, pci_device_1023_8520,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8520,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8620 = {
- 0x8620, pci_device_1023_8620,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8620,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_8820 = {
- 0x8820, pci_device_1023_8820,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_8820,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9320 = {
- 0x9320, pci_device_1023_9320,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9320,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9350 = {
- 0x9350, pci_device_1023_9350,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9350,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9360 = {
- 0x9360, pci_device_1023_9360,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9360,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9382 = {
- 0x9382, pci_device_1023_9382,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9382,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9383 = {
- 0x9383, pci_device_1023_9383,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9383,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9385 = {
- 0x9385, pci_device_1023_9385,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9385,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9386 = {
- 0x9386, pci_device_1023_9386,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9386,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9388 = {
- 0x9388, pci_device_1023_9388,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9388,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9397 = {
- 0x9397, pci_device_1023_9397,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9397,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_939a = {
- 0x939a, pci_device_1023_939a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_939a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9420 = {
- 0x9420, pci_device_1023_9420,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9420,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9430 = {
- 0x9430, pci_device_1023_9430,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9430,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9440 = {
- 0x9440, pci_device_1023_9440,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9440,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9460 = {
- 0x9460, pci_device_1023_9460,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9460,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9470 = {
- 0x9470, pci_device_1023_9470,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9470,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9520 = {
- 0x9520, pci_device_1023_9520,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9520,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9525 = {
- 0x9525, pci_device_1023_9525,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9525,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9540 = {
- 0x9540, pci_device_1023_9540,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9540,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9660 = {
- 0x9660, pci_device_1023_9660,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9660,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9680 = {
- 0x9680, pci_device_1023_9680,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9680,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9682 = {
- 0x9682, pci_device_1023_9682,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9682,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9683 = {
- 0x9683, pci_device_1023_9683,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9683,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9685 = {
- 0x9685, pci_device_1023_9685,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9685,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9750 = {
- 0x9750, pci_device_1023_9750,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9750,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9753 = {
- 0x9753, pci_device_1023_9753,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9753,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9754 = {
- 0x9754, pci_device_1023_9754,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9754,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9759 = {
- 0x9759, pci_device_1023_9759,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9759,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9783 = {
- 0x9783, pci_device_1023_9783,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9783,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9785 = {
- 0x9785, pci_device_1023_9785,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9785,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9850 = {
- 0x9850, pci_device_1023_9850,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9850,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9880 = {
- 0x9880, pci_device_1023_9880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9880,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9910 = {
- 0x9910, pci_device_1023_9910,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9910,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1023_9930 = {
- 0x9930, pci_device_1023_9930,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1023_9930,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1435 = {
- 0x1435, pci_device_1025_1435,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1435,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1445 = {
- 0x1445, pci_device_1025_1445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1449 = {
- 0x1449, pci_device_1025_1449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1449,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1451 = {
- 0x1451, pci_device_1025_1451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1461 = {
- 0x1461, pci_device_1025_1461,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1461,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1489 = {
- 0x1489, pci_device_1025_1489,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1489,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1511 = {
- 0x1511, pci_device_1025_1511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1511,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1512 = {
- 0x1512, pci_device_1025_1512,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1512,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1513 = {
- 0x1513, pci_device_1025_1513,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1513,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1521 = {
- 0x1521, pci_device_1025_1521,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1521,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1523 = {
- 0x1523, pci_device_1025_1523,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1523,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1531 = {
- 0x1531, pci_device_1025_1531,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1531,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1533 = {
- 0x1533, pci_device_1025_1533,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1533,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1535 = {
- 0x1535, pci_device_1025_1535,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1535,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1541 = {
- 0x1541, pci_device_1025_1541,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1541,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1542 = {
- 0x1542, pci_device_1025_1542,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1542,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1543 = {
- 0x1543, pci_device_1025_1543,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1543,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1561 = {
- 0x1561, pci_device_1025_1561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1621 = {
- 0x1621, pci_device_1025_1621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1631 = {
- 0x1631, pci_device_1025_1631,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1631,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1641 = {
- 0x1641, pci_device_1025_1641,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1641,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_1647 = {
- 0x1647, pci_device_1025_1647,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_1647,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3141 = {
- 0x3141, pci_device_1025_3141,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3141,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3143 = {
- 0x3143, pci_device_1025_3143,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3143,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3145 = {
- 0x3145, pci_device_1025_3145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3147 = {
- 0x3147, pci_device_1025_3147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3149 = {
- 0x3149, pci_device_1025_3149,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3149,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3151 = {
- 0x3151, pci_device_1025_3151,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3151,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3307 = {
- 0x3307, pci_device_1025_3307,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3307,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3309 = {
- 0x3309, pci_device_1025_3309,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3309,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_3321 = {
- 0x3321, pci_device_1025_3321,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_3321,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5212 = {
- 0x5212, pci_device_1025_5212,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5212,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5215 = {
- 0x5215, pci_device_1025_5215,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5215,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5217 = {
- 0x5217, pci_device_1025_5217,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5217,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5219 = {
- 0x5219, pci_device_1025_5219,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5219,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5225 = {
- 0x5225, pci_device_1025_5225,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5225,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5229 = {
- 0x5229, pci_device_1025_5229,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5229,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5235 = {
- 0x5235, pci_device_1025_5235,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5235,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5237 = {
- 0x5237, pci_device_1025_5237,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5237,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5240 = {
- 0x5240, pci_device_1025_5240,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5240,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5241 = {
- 0x5241, pci_device_1025_5241,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5241,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5242 = {
- 0x5242, pci_device_1025_5242,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5242,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5243 = {
- 0x5243, pci_device_1025_5243,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5243,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5244 = {
- 0x5244, pci_device_1025_5244,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5244,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5247 = {
- 0x5247, pci_device_1025_5247,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5247,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5251 = {
- 0x5251, pci_device_1025_5251,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5251,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5427 = {
- 0x5427, pci_device_1025_5427,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5427,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5451 = {
- 0x5451, pci_device_1025_5451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_5453 = {
- 0x5453, pci_device_1025_5453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_5453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1025_7101 = {
- 0x7101, pci_device_1025_7101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1025_7101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0001 = {
- 0x0001, pci_device_1028_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0002 = {
- 0x0002, pci_device_1028_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0003 = {
- 0x0003, pci_device_1028_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0004 = {
- 0x0004, pci_device_1028_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0005 = {
- 0x0005, pci_device_1028_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0006 = {
- 0x0006, pci_device_1028_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0007 = {
- 0x0007, pci_device_1028_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0008 = {
- 0x0008, pci_device_1028_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_0009 = {
- 0x0009, pci_device_1028_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_000a = {
- 0x000a, pci_device_1028_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_000c = {
- 0x000c, pci_device_1028_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_000d = {
- 0x000d, pci_device_1028_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_000e = {
- 0x000e, pci_device_1028_000e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_000e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1028_000f = {
- 0x000f, pci_device_1028_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1028_000f,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_102a_0000 = {
- 0x0000, pci_device_102a_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102a_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102a_0010 = {
- 0x0010, pci_device_102a_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102a_0010,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_102b_0010 = {
- 0x0010, pci_device_102b_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0100 = {
- 0x0100, pci_device_102b_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0518 = {
- 0x0518, pci_device_102b_0518,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0518,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0519 = {
- 0x0519, pci_device_102b_0519,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0519,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_051a = {
- 0x051a, pci_device_102b_051a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_051a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_051b = {
- 0x051b, pci_device_102b_051b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_051b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_051e = {
- 0x051e, pci_device_102b_051e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_051e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_051f = {
- 0x051f, pci_device_102b_051f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_051f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0520 = {
- 0x0520, pci_device_102b_0520,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0520,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0521 = {
- 0x0521, pci_device_102b_0521,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0521,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0525 = {
- 0x0525, pci_device_102b_0525,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0525,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0527 = {
- 0x0527, pci_device_102b_0527,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0527,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_0d10 = {
- 0x0d10, pci_device_102b_0d10,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_0d10,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_1000 = {
- 0x1000, pci_device_102b_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_1001 = {
- 0x1001, pci_device_102b_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_2007 = {
- 0x2007, pci_device_102b_2007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_2007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_2527 = {
- 0x2527, pci_device_102b_2527,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_2527,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_4536 = {
- 0x4536, pci_device_102b_4536,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_4536,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102b_6573 = {
- 0x6573, pci_device_102b_6573,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102b_6573,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00b8 = {
- 0x00b8, pci_device_102c_00b8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00b8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00c0 = {
- 0x00c0, pci_device_102c_00c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00d0 = {
- 0x00d0, pci_device_102c_00d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00d8 = {
- 0x00d8, pci_device_102c_00d8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00d8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00dc = {
- 0x00dc, pci_device_102c_00dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00dc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00e0 = {
- 0x00e0, pci_device_102c_00e0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00e0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00e4 = {
- 0x00e4, pci_device_102c_00e4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00e4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00e5 = {
- 0x00e5, pci_device_102c_00e5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00e5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00f0 = {
- 0x00f0, pci_device_102c_00f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00f4 = {
- 0x00f4, pci_device_102c_00f4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00f4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_00f5 = {
- 0x00f5, pci_device_102c_00f5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_00f5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102c_0c30 = {
- 0x0c30, pci_device_102c_0c30,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102c_0c30,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_102d_50dc = {
- 0x50dc, pci_device_102d_50dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102d_50dc,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_102f_0009 = {
- 0x0009, pci_device_102f_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102f_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_102f_0020 = {
- 0x0020, pci_device_102f_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_102f_0020,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1031_5601 = {
- 0x5601, pci_device_1031_5601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1031_5601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1031_5607 = {
- 0x5607, pci_device_1031_5607,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1031_5607,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1031_5631 = {
- 0x5631, pci_device_1031_5631,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1031_5631,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1031_6057 = {
- 0x6057, pci_device_1031_6057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1031_6057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0001 = {
- 0x0001, pci_device_1033_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0002 = {
- 0x0002, pci_device_1033_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0003 = {
- 0x0003, pci_device_1033_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0004 = {
- 0x0004, pci_device_1033_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0005 = {
- 0x0005, pci_device_1033_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0006 = {
- 0x0006, pci_device_1033_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0007 = {
- 0x0007, pci_device_1033_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0008 = {
- 0x0008, pci_device_1033_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0009 = {
- 0x0009, pci_device_1033_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0016 = {
- 0x0016, pci_device_1033_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_001a = {
- 0x001a, pci_device_1033_001a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_001a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0021 = {
- 0x0021, pci_device_1033_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0029 = {
- 0x0029, pci_device_1033_0029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_002a = {
- 0x002a, pci_device_1033_002a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_002a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_002c = {
- 0x002c, pci_device_1033_002c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_002c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_002d = {
- 0x002d, pci_device_1033_002d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_002d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0035 = {
- 0x0035, pci_device_1033_0035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_003b = {
- 0x003b, pci_device_1033_003b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_003b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_003e = {
- 0x003e, pci_device_1033_003e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_003e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0046 = {
- 0x0046, pci_device_1033_0046,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0046,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_005a = {
- 0x005a, pci_device_1033_005a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_005a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0063 = {
- 0x0063, pci_device_1033_0063,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0063,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0067 = {
- 0x0067, pci_device_1033_0067,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0067,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_0074 = {
- 0x0074, pci_device_1033_0074,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_0074,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_009b = {
- 0x009b, pci_device_1033_009b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_009b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_00a6 = {
- 0x00a6, pci_device_1033_00a6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_00a6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_00cd = {
- 0x00cd, pci_device_1033_00cd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_00cd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1033_00e0 = {
- 0x00e0, pci_device_1033_00e0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1033_00e0,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1036_0000 = {
- 0x0000, pci_device_1036_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1036_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1039_0001 = {
- 0x0001, pci_device_1039_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0002 = {
- 0x0002, pci_device_1039_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0006 = {
- 0x0006, pci_device_1039_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0008 = {
- 0x0008, pci_device_1039_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0009 = {
- 0x0009, pci_device_1039_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0018 = {
- 0x0018, pci_device_1039_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0200 = {
- 0x0200, pci_device_1039_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0204 = {
- 0x0204, pci_device_1039_0204,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0204,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0205 = {
- 0x0205, pci_device_1039_0205,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0205,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0300 = {
- 0x0300, pci_device_1039_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0310 = {
- 0x0310, pci_device_1039_0310,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0310,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0315 = {
- 0x0315, pci_device_1039_0315,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0315,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0325 = {
- 0x0325, pci_device_1039_0325,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0325,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0330 = {
- 0x0330, pci_device_1039_0330,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0330,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0406 = {
- 0x0406, pci_device_1039_0406,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0406,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0496 = {
- 0x0496, pci_device_1039_0496,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0496,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0530 = {
- 0x0530, pci_device_1039_0530,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0530,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0540 = {
- 0x0540, pci_device_1039_0540,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0540,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0597 = {
- 0x0597, pci_device_1039_0597,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0597,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0601 = {
- 0x0601, pci_device_1039_0601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0620 = {
- 0x0620, pci_device_1039_0620,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0620,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0630 = {
- 0x0630, pci_device_1039_0630,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0630,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0633 = {
- 0x0633, pci_device_1039_0633,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0633,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0635 = {
- 0x0635, pci_device_1039_0635,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0635,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0645 = {
- 0x0645, pci_device_1039_0645,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0645,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0646 = {
- 0x0646, pci_device_1039_0646,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0646,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0648 = {
- 0x0648, pci_device_1039_0648,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0648,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0650 = {
- 0x0650, pci_device_1039_0650,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0650,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0651 = {
- 0x0651, pci_device_1039_0651,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0651,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0730 = {
- 0x0730, pci_device_1039_0730,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0730,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0733 = {
- 0x0733, pci_device_1039_0733,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0733,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0735 = {
- 0x0735, pci_device_1039_0735,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0735,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0740 = {
- 0x0740, pci_device_1039_0740,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0740,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0745 = {
- 0x0745, pci_device_1039_0745,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0745,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0755 = {
- 0x0755, pci_device_1039_0755,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0755,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0900 = {
- 0x0900, pci_device_1039_0900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0961 = {
- 0x0961, pci_device_1039_0961,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0961,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_0962 = {
- 0x0962, pci_device_1039_0962,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_0962,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_3602 = {
- 0x3602, pci_device_1039_3602,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_3602,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5107 = {
- 0x5107, pci_device_1039_5107,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5107,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5300 = {
- 0x5300, pci_device_1039_5300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5315 = {
- 0x5315, pci_device_1039_5315,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5315,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5401 = {
- 0x5401, pci_device_1039_5401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5511 = {
- 0x5511, pci_device_1039_5511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5511,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5513 = {
- 0x5513, pci_device_1039_5513,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5513,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5517 = {
- 0x5517, pci_device_1039_5517,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5517,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5571 = {
- 0x5571, pci_device_1039_5571,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5571,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5581 = {
- 0x5581, pci_device_1039_5581,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5581,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5582 = {
- 0x5582, pci_device_1039_5582,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5582,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5591 = {
- 0x5591, pci_device_1039_5591,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5591,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5596 = {
- 0x5596, pci_device_1039_5596,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5596,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5597 = {
- 0x5597, pci_device_1039_5597,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5597,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_5600 = {
- 0x5600, pci_device_1039_5600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_5600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6204 = {
- 0x6204, pci_device_1039_6204,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6204,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6205 = {
- 0x6205, pci_device_1039_6205,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6205,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6236 = {
- 0x6236, pci_device_1039_6236,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6236,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6300 = {
- 0x6300, pci_device_1039_6300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6306 = {
- 0x6306, pci_device_1039_6306,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6306,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6325 = {
- 0x6325, pci_device_1039_6325,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6325,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_6326 = {
- 0x6326, pci_device_1039_6326,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_6326,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7001 = {
- 0x7001, pci_device_1039_7001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7002 = {
- 0x7002, pci_device_1039_7002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7007 = {
- 0x7007, pci_device_1039_7007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7012 = {
- 0x7012, pci_device_1039_7012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7013 = {
- 0x7013, pci_device_1039_7013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7016 = {
- 0x7016, pci_device_1039_7016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1039_7018 = {
- 0x7018, pci_device_1039_7018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1039_7018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1005 = {
- 0x1005, pci_device_103c_1005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1006 = {
- 0x1006, pci_device_103c_1006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1008 = {
- 0x1008, pci_device_103c_1008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_100a = {
- 0x100a, pci_device_103c_100a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_100a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1028 = {
- 0x1028, pci_device_103c_1028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1029 = {
- 0x1029, pci_device_103c_1029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_102a = {
- 0x102a, pci_device_103c_102a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_102a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1030 = {
- 0x1030, pci_device_103c_1030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1031 = {
- 0x1031, pci_device_103c_1031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1040 = {
- 0x1040, pci_device_103c_1040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1041 = {
- 0x1041, pci_device_103c_1041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1042 = {
- 0x1042, pci_device_103c_1042,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1042,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1048 = {
- 0x1048, pci_device_103c_1048,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1048,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1064 = {
- 0x1064, pci_device_103c_1064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_108b = {
- 0x108b, pci_device_103c_108b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_108b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_10c1 = {
- 0x10c1, pci_device_103c_10c1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_10c1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_10ed = {
- 0x10ed, pci_device_103c_10ed,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_10ed,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1200 = {
- 0x1200, pci_device_103c_1200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1219 = {
- 0x1219, pci_device_103c_1219,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1219,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_121a = {
- 0x121a, pci_device_103c_121a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_121a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_121b = {
- 0x121b, pci_device_103c_121b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_121b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_121c = {
- 0x121c, pci_device_103c_121c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_121c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1229 = {
- 0x1229, pci_device_103c_1229,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1229,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_122a = {
- 0x122a, pci_device_103c_122a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_122a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_122e = {
- 0x122e, pci_device_103c_122e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_122e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_1290 = {
- 0x1290, pci_device_103c_1290,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_1290,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_12b4 = {
- 0x12b4, pci_device_103c_12b4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_12b4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_2910 = {
- 0x2910, pci_device_103c_2910,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_2910,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_103c_2925 = {
- 0x2925, pci_device_103c_2925,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_103c_2925,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1042_1000 = {
- 0x1000, pci_device_1042_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1042_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1042_1001 = {
- 0x1001, pci_device_1042_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1042_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1042_3000 = {
- 0x3000, pci_device_1042_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1042_3000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1042_3010 = {
- 0x3010, pci_device_1042_3010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1042_3010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1042_3020 = {
- 0x3020, pci_device_1042_3020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1042_3020,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1043_0675 = {
- 0x0675, pci_device_1043_0675,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1043_0675,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1043_4021 = {
- 0x4021, pci_device_1043_4021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1043_4021,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1044_1012 = {
- 0x1012, pci_device_1044_1012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1044_1012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1044_a400 = {
- 0xa400, pci_device_1044_a400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1044_a400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1044_a500 = {
- 0xa500, pci_device_1044_a500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1044_a500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1044_a501 = {
- 0xa501, pci_device_1044_a501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1044_a501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1044_a511 = {
- 0xa511, pci_device_1044_a511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1044_a511,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1045_a0f8 = {
- 0xa0f8, pci_device_1045_a0f8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_a0f8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c101 = {
- 0xc101, pci_device_1045_c101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c178 = {
- 0xc178, pci_device_1045_c178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c556 = {
- 0xc556, pci_device_1045_c556,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c556,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c557 = {
- 0xc557, pci_device_1045_c557,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c557,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c558 = {
- 0xc558, pci_device_1045_c558,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c558,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c567 = {
- 0xc567, pci_device_1045_c567,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c567,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c568 = {
- 0xc568, pci_device_1045_c568,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c568,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c569 = {
- 0xc569, pci_device_1045_c569,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c569,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c621 = {
- 0xc621, pci_device_1045_c621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c700 = {
- 0xc700, pci_device_1045_c700,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c700,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c701 = {
- 0xc701, pci_device_1045_c701,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c701,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c814 = {
- 0xc814, pci_device_1045_c814,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c814,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c822 = {
- 0xc822, pci_device_1045_c822,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c822,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c824 = {
- 0xc824, pci_device_1045_c824,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c824,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c825 = {
- 0xc825, pci_device_1045_c825,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c825,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c832 = {
- 0xc832, pci_device_1045_c832,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c832,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c861 = {
- 0xc861, pci_device_1045_c861,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c861,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c895 = {
- 0xc895, pci_device_1045_c895,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c895,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_c935 = {
- 0xc935, pci_device_1045_c935,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_c935,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_d568 = {
- 0xd568, pci_device_1045_d568,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_d568,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1045_d721 = {
- 0xd721, pci_device_1045_d721,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1045_d721,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1048_0d22 = {
- 0x0d22, pci_device_1048_0d22,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1048_0d22,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1048_1000 = {
- 0x1000, pci_device_1048_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1048_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1048_3000 = {
- 0x3000, pci_device_1048_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1048_3000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_104a_0008 = {
- 0x0008, pci_device_104a_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_0009 = {
- 0x0009, pci_device_104a_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_0010 = {
- 0x0010, pci_device_104a_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_0210 = {
- 0x0210, pci_device_104a_0210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_0210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_0981 = {
- 0x0981, pci_device_104a_0981,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_0981,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_1746 = {
- 0x1746, pci_device_104a_1746,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_1746,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_2774 = {
- 0x2774, pci_device_104a_2774,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_2774,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104a_3520 = {
- 0x3520, pci_device_104a_3520,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104a_3520,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_104b_0140 = {
- 0x0140, pci_device_104b_0140,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104b_0140,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104b_1040 = {
- 0x1040, pci_device_104b_1040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104b_1040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104b_8130 = {
- 0x8130, pci_device_104b_8130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104b_8130,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_104c_0500 = {
- 0x0500, pci_device_104c_0500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_0500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_0508 = {
- 0x0508, pci_device_104c_0508,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_0508,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_1000 = {
- 0x1000, pci_device_104c_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_104c = {
- 0x104c, pci_device_104c_104c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_104c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_3d04 = {
- 0x3d04, pci_device_104c_3d04,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_3d04,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_3d07 = {
- 0x3d07, pci_device_104c_3d07,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_3d07,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8000 = {
- 0x8000, pci_device_104c_8000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8009 = {
- 0x8009, pci_device_104c_8009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8017 = {
- 0x8017, pci_device_104c_8017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8019 = {
- 0x8019, pci_device_104c_8019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8020 = {
- 0x8020, pci_device_104c_8020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8021 = {
- 0x8021, pci_device_104c_8021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8022 = {
- 0x8022, pci_device_104c_8022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8023 = {
- 0x8023, pci_device_104c_8023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8024 = {
- 0x8024, pci_device_104c_8024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8026 = {
- 0x8026, pci_device_104c_8026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8027 = {
- 0x8027, pci_device_104c_8027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_8400 = {
- 0x8400, pci_device_104c_8400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_8400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_a001 = {
- 0xa001, pci_device_104c_a001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_a001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_a100 = {
- 0xa100, pci_device_104c_a100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_a100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_a102 = {
- 0xa102, pci_device_104c_a102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_a102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_a106 = {
- 0xa106, pci_device_104c_a106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_a106,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac10 = {
- 0xac10, pci_device_104c_ac10,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac10,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac11 = {
- 0xac11, pci_device_104c_ac11,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac11,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac12 = {
- 0xac12, pci_device_104c_ac12,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac12,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac13 = {
- 0xac13, pci_device_104c_ac13,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac13,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac15 = {
- 0xac15, pci_device_104c_ac15,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac15,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac16 = {
- 0xac16, pci_device_104c_ac16,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac16,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac17 = {
- 0xac17, pci_device_104c_ac17,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac17,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac18 = {
- 0xac18, pci_device_104c_ac18,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac18,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac19 = {
- 0xac19, pci_device_104c_ac19,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac19,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1a = {
- 0xac1a, pci_device_104c_ac1a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1b = {
- 0xac1b, pci_device_104c_ac1b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1c = {
- 0xac1c, pci_device_104c_ac1c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1d = {
- 0xac1d, pci_device_104c_ac1d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1e = {
- 0xac1e, pci_device_104c_ac1e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac1f = {
- 0xac1f, pci_device_104c_ac1f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac1f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac20 = {
- 0xac20, pci_device_104c_ac20,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac20,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac21 = {
- 0xac21, pci_device_104c_ac21,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac21,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac22 = {
- 0xac22, pci_device_104c_ac22,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac22,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac23 = {
- 0xac23, pci_device_104c_ac23,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac23,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac28 = {
- 0xac28, pci_device_104c_ac28,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac28,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac30 = {
- 0xac30, pci_device_104c_ac30,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac30,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac40 = {
- 0xac40, pci_device_104c_ac40,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac40,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac41 = {
- 0xac41, pci_device_104c_ac41,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac41,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac42 = {
- 0xac42, pci_device_104c_ac42,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac42,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac50 = {
- 0xac50, pci_device_104c_ac50,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac50,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac51 = {
- 0xac51, pci_device_104c_ac51,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac51,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac52 = {
- 0xac52, pci_device_104c_ac52,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac52,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac53 = {
- 0xac53, pci_device_104c_ac53,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac53,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac55 = {
- 0xac55, pci_device_104c_ac55,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac55,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac56 = {
- 0xac56, pci_device_104c_ac56,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac56,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_ac60 = {
- 0xac60, pci_device_104c_ac60,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_ac60,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_fe00 = {
- 0xfe00, pci_device_104c_fe00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_fe00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104c_fe03 = {
- 0xfe03, pci_device_104c_fe03,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104c_fe03,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104d_8009 = {
- 0x8009, pci_device_104d_8009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104d_8009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104d_8039 = {
- 0x8039, pci_device_104d_8039,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104d_8039,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104d_8056 = {
- 0x8056, pci_device_104d_8056,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104d_8056,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104d_808a = {
- 0x808a, pci_device_104d_808a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104d_808a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0017 = {
- 0x0017, pci_device_104e_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0107 = {
- 0x0107, pci_device_104e_0107,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0107,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0109 = {
- 0x0109, pci_device_104e_0109,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0109,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0111 = {
- 0x0111, pci_device_104e_0111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0217 = {
- 0x0217, pci_device_104e_0217,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0217,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_104e_0317 = {
- 0x0317, pci_device_104e_0317,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_104e_0317,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1050_0000 = {
- 0x0000, pci_device_1050_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_0001 = {
- 0x0001, pci_device_1050_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_0105 = {
- 0x0105, pci_device_1050_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_0840 = {
- 0x0840, pci_device_1050_0840,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_0840,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_0940 = {
- 0x0940, pci_device_1050_0940,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_0940,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_5a5a = {
- 0x5a5a, pci_device_1050_5a5a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_5a5a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_6692 = {
- 0x6692, pci_device_1050_6692,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_6692,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1050_9970 = {
- 0x9970, pci_device_1050_9970,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1050_9970,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1055_9130 = {
- 0x9130, pci_device_1055_9130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1055_9130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1055_9460 = {
- 0x9460, pci_device_1055_9460,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1055_9460,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1055_9462 = {
- 0x9462, pci_device_1055_9462,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1055_9462,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1055_9463 = {
- 0x9463, pci_device_1055_9463,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1055_9463,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1057_0001 = {
- 0x0001, pci_device_1057_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0002 = {
- 0x0002, pci_device_1057_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0003 = {
- 0x0003, pci_device_1057_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0004 = {
- 0x0004, pci_device_1057_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0006 = {
- 0x0006, pci_device_1057_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0100 = {
- 0x0100, pci_device_1057_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_0431 = {
- 0x0431, pci_device_1057_0431,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_0431,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_1801 = {
- 0x1801, pci_device_1057_1801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_1801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_18c0 = {
- 0x18c0, pci_device_1057_18c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_18c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_4801 = {
- 0x4801, pci_device_1057_4801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_4801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_4802 = {
- 0x4802, pci_device_1057_4802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_4802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_4803 = {
- 0x4803, pci_device_1057_4803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_4803,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_4806 = {
- 0x4806, pci_device_1057_4806,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_4806,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_4d68 = {
- 0x4d68, pci_device_1057_4d68,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_4d68,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_5600 = {
- 0x5600, pci_device_1057_5600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_5600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1057_6400 = {
- 0x6400, pci_device_1057_6400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1057_6400,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_105a_0d30 = {
- 0x0d30, pci_device_105a_0d30,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_0d30,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_0d38 = {
- 0x0d38, pci_device_105a_0d38,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_0d38,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_1275 = {
- 0x1275, pci_device_105a_1275,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_1275,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_3376 = {
- 0x3376, pci_device_105a_3376,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_3376,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_4d30 = {
- 0x4d30, pci_device_105a_4d30,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_4d30,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_4d33 = {
- 0x4d33, pci_device_105a_4d33,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_4d33,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_4d38 = {
- 0x4d38, pci_device_105a_4d38,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_4d38,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_4d68 = {
- 0x4d68, pci_device_105a_4d68,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_4d68,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_4d69 = {
- 0x4d69, pci_device_105a_4d69,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_4d69,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_5275 = {
- 0x5275, pci_device_105a_5275,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_5275,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_5300 = {
- 0x5300, pci_device_105a_5300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_5300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_6268 = {
- 0x6268, pci_device_105a_6268,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_6268,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_6269 = {
- 0x6269, pci_device_105a_6269,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_6269,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_6621 = {
- 0x6621, pci_device_105a_6621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_6621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105a_7275 = {
- 0x7275, pci_device_105a_7275,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105a_7275,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_105d_2309 = {
- 0x2309, pci_device_105d_2309,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105d_2309,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105d_2339 = {
- 0x2339, pci_device_105d_2339,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105d_2339,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105d_493d = {
- 0x493d, pci_device_105d_493d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105d_493d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_105d_5348 = {
- 0x5348, pci_device_105d_5348,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_105d_5348,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1060_0001 = {
- 0x0001, pci_device_1060_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_0002 = {
- 0x0002, pci_device_1060_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_0101 = {
- 0x0101, pci_device_1060_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_0881 = {
- 0x0881, pci_device_1060_0881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_0886 = {
- 0x0886, pci_device_1060_0886,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0886,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_0891 = {
- 0x0891, pci_device_1060_0891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_0891,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_1001 = {
- 0x1001, pci_device_1060_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_673a = {
- 0x673a, pci_device_1060_673a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_673a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_673b = {
- 0x673b, pci_device_1060_673b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_673b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_8710 = {
- 0x8710, pci_device_1060_8710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_8710,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_886a = {
- 0x886a, pci_device_1060_886a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_886a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_8881 = {
- 0x8881, pci_device_1060_8881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_8881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_8886 = {
- 0x8886, pci_device_1060_8886,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_8886,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_888a = {
- 0x888a, pci_device_1060_888a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_888a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_8891 = {
- 0x8891, pci_device_1060_8891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_8891,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_9017 = {
- 0x9017, pci_device_1060_9017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_9017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_9018 = {
- 0x9018, pci_device_1060_9018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_9018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_9026 = {
- 0x9026, pci_device_1060_9026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_9026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_e881 = {
- 0xe881, pci_device_1060_e881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_e881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_e886 = {
- 0xe886, pci_device_1060_e886,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_e886,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_e88a = {
- 0xe88a, pci_device_1060_e88a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_e88a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1060_e891 = {
- 0xe891, pci_device_1060_e891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1060_e891,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1061_0001 = {
- 0x0001, pci_device_1061_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1061_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1061_0002 = {
- 0x0002, pci_device_1061_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1061_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1066_0000 = {
- 0x0000, pci_device_1066_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_0001 = {
- 0x0001, pci_device_1066_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_0002 = {
- 0x0002, pci_device_1066_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_0003 = {
- 0x0003, pci_device_1066_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_0004 = {
- 0x0004, pci_device_1066_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_0005 = {
- 0x0005, pci_device_1066_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1066_8002 = {
- 0x8002, pci_device_1066_8002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1066_8002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1067_1002 = {
- 0x1002, pci_device_1067_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1067_1002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1069_0001 = {
- 0x0001, pci_device_1069_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1069_0002 = {
- 0x0002, pci_device_1069_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1069_0010 = {
- 0x0010, pci_device_1069_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1069_0050 = {
- 0x0050, pci_device_1069_0050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_0050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1069_ba55 = {
- 0xba55, pci_device_1069_ba55,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_ba55,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1069_ba56 = {
- 0xba56, pci_device_1069_ba56,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1069_ba56,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_106b_0001 = {
- 0x0001, pci_device_106b_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0002 = {
- 0x0002, pci_device_106b_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0003 = {
- 0x0003, pci_device_106b_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0004 = {
- 0x0004, pci_device_106b_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0007 = {
- 0x0007, pci_device_106b_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_000e = {
- 0x000e, pci_device_106b_000e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_000e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0010 = {
- 0x0010, pci_device_106b_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0017 = {
- 0x0017, pci_device_106b_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0018 = {
- 0x0018, pci_device_106b_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0019 = {
- 0x0019, pci_device_106b_0019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_001e = {
- 0x001e, pci_device_106b_001e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_001e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_001f = {
- 0x001f, pci_device_106b_001f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_001f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0020 = {
- 0x0020, pci_device_106b_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0021 = {
- 0x0021, pci_device_106b_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0022 = {
- 0x0022, pci_device_106b_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0024 = {
- 0x0024, pci_device_106b_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0025 = {
- 0x0025, pci_device_106b_0025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0026 = {
- 0x0026, pci_device_106b_0026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0027 = {
- 0x0027, pci_device_106b_0027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0028 = {
- 0x0028, pci_device_106b_0028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0029 = {
- 0x0029, pci_device_106b_0029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_002d = {
- 0x002d, pci_device_106b_002d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_002d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_002e = {
- 0x002e, pci_device_106b_002e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_002e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_002f = {
- 0x002f, pci_device_106b_002f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_002f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0030 = {
- 0x0030, pci_device_106b_0030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0031 = {
- 0x0031, pci_device_106b_0031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0032 = {
- 0x0032, pci_device_106b_0032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0033 = {
- 0x0033, pci_device_106b_0033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_0034 = {
- 0x0034, pci_device_106b_0034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_0034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106b_1645 = {
- 0x1645, pci_device_106b_1645,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106b_1645,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_106c_8801 = {
- 0x8801, pci_device_106c_8801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106c_8801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106c_8802 = {
- 0x8802, pci_device_106c_8802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106c_8802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106c_8803 = {
- 0x8803, pci_device_106c_8803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106c_8803,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106c_8804 = {
- 0x8804, pci_device_106c_8804,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106c_8804,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_106c_8805 = {
- 0x8805, pci_device_106c_8805,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_106c_8805,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1073_0001 = {
- 0x0001, pci_device_1073_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0002 = {
- 0x0002, pci_device_1073_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0003 = {
- 0x0003, pci_device_1073_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0004 = {
- 0x0004, pci_device_1073_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0005 = {
- 0x0005, pci_device_1073_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0006 = {
- 0x0006, pci_device_1073_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0008 = {
- 0x0008, pci_device_1073_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_000a = {
- 0x000a, pci_device_1073_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_000c = {
- 0x000c, pci_device_1073_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_000d = {
- 0x000d, pci_device_1073_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0010 = {
- 0x0010, pci_device_1073_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0012 = {
- 0x0012, pci_device_1073_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_0020 = {
- 0x0020, pci_device_1073_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1073_2000 = {
- 0x2000, pci_device_1073_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1073_2000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1074_4e78 = {
- 0x4e78, pci_device_1074_4e78,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1074_4e78,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1077_1016 = {
- 0x1016, pci_device_1077_1016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1020 = {
- 0x1020, pci_device_1077_1020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1022 = {
- 0x1022, pci_device_1077_1022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1080 = {
- 0x1080, pci_device_1077_1080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1080,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1216 = {
- 0x1216, pci_device_1077_1216,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1216,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1240 = {
- 0x1240, pci_device_1077_1240,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1240,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_1280 = {
- 0x1280, pci_device_1077_1280,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_1280,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_2020 = {
- 0x2020, pci_device_1077_2020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_2020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_2100 = {
- 0x2100, pci_device_1077_2100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_2100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_2200 = {
- 0x2200, pci_device_1077_2200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_2200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_2300 = {
- 0x2300, pci_device_1077_2300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_2300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1077_2312 = {
- 0x2312, pci_device_1077_2312,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1077_2312,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1078_0000 = {
- 0x0000, pci_device_1078_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0001 = {
- 0x0001, pci_device_1078_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0002 = {
- 0x0002, pci_device_1078_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0100 = {
- 0x0100, pci_device_1078_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0101 = {
- 0x0101, pci_device_1078_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0102 = {
- 0x0102, pci_device_1078_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0103 = {
- 0x0103, pci_device_1078_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0104 = {
- 0x0104, pci_device_1078_0104,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0104,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0400 = {
- 0x0400, pci_device_1078_0400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0401 = {
- 0x0401, pci_device_1078_0401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0402 = {
- 0x0402, pci_device_1078_0402,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0402,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1078_0403 = {
- 0x0403, pci_device_1078_0403,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1078_0403,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_107d_0000 = {
- 0x0000, pci_device_107d_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107d_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_107e_0001 = {
- 0x0001, pci_device_107e_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_0002 = {
- 0x0002, pci_device_107e_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_0004 = {
- 0x0004, pci_device_107e_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_0005 = {
- 0x0005, pci_device_107e_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_0008 = {
- 0x0008, pci_device_107e_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9003 = {
- 0x9003, pci_device_107e_9003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9007 = {
- 0x9007, pci_device_107e_9007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9008 = {
- 0x9008, pci_device_107e_9008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_900c = {
- 0x900c, pci_device_107e_900c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_900c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_900e = {
- 0x900e, pci_device_107e_900e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_900e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9011 = {
- 0x9011, pci_device_107e_9011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9013 = {
- 0x9013, pci_device_107e_9013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9023 = {
- 0x9023, pci_device_107e_9023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9027 = {
- 0x9027, pci_device_107e_9027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9031 = {
- 0x9031, pci_device_107e_9031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_107e_9033 = {
- 0x9033, pci_device_107e_9033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107e_9033,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_107f_0802 = {
- 0x0802, pci_device_107f_0802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_107f_0802,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1080_0600 = {
- 0x0600, pci_device_1080_0600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1080_0600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1080_c691 = {
- 0xc691, pci_device_1080_c691,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1080_c691,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1080_c693 = {
- 0xc693, pci_device_1080_c693,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1080_c693,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1081_0d47 = {
- 0x0d47, pci_device_1081_0d47,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1081_0d47,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1083_0001 = {
- 0x0001, pci_device_1083_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1083_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_108a_0001 = {
- 0x0001, pci_device_108a_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108a_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108a_0010 = {
- 0x0010, pci_device_108a_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108a_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108a_0040 = {
- 0x0040, pci_device_108a_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108a_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108a_3000 = {
- 0x3000, pci_device_108a_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108a_3000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_108d_0001 = {
- 0x0001, pci_device_108d_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0002 = {
- 0x0002, pci_device_108d_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0004 = {
- 0x0004, pci_device_108d_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0005 = {
- 0x0005, pci_device_108d_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0006 = {
- 0x0006, pci_device_108d_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0007 = {
- 0x0007, pci_device_108d_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0008 = {
- 0x0008, pci_device_108d_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0011 = {
- 0x0011, pci_device_108d_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0012 = {
- 0x0012, pci_device_108d_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0013 = {
- 0x0013, pci_device_108d_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0014 = {
- 0x0014, pci_device_108d_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0019 = {
- 0x0019, pci_device_108d_0019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0021 = {
- 0x0021, pci_device_108d_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108d_0022 = {
- 0x0022, pci_device_108d_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108d_0022,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_108e_0001 = {
- 0x0001, pci_device_108e_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1000 = {
- 0x1000, pci_device_108e_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1001 = {
- 0x1001, pci_device_108e_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1100 = {
- 0x1100, pci_device_108e_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1101 = {
- 0x1101, pci_device_108e_1101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1102 = {
- 0x1102, pci_device_108e_1102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_1103 = {
- 0x1103, pci_device_108e_1103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_1103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_2bad = {
- 0x2bad, pci_device_108e_2bad,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_2bad,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_5000 = {
- 0x5000, pci_device_108e_5000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_5000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_5043 = {
- 0x5043, pci_device_108e_5043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_5043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_8000 = {
- 0x8000, pci_device_108e_8000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_8000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_8001 = {
- 0x8001, pci_device_108e_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_8001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_a000 = {
- 0xa000, pci_device_108e_a000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_a000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_108e_a001 = {
- 0xa001, pci_device_108e_a001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_108e_a001,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1091_0020 = {
- 0x0020, pci_device_1091_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_0021 = {
- 0x0021, pci_device_1091_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_0040 = {
- 0x0040, pci_device_1091_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_0041 = {
- 0x0041, pci_device_1091_0041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_0060 = {
- 0x0060, pci_device_1091_0060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_00e4 = {
- 0x00e4, pci_device_1091_00e4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_00e4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1091_0720 = {
- 0x0720, pci_device_1091_0720,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1091_0720,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1092_00a0 = {
- 0x00a0, pci_device_1092_00a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_00a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_00a8 = {
- 0x00a8, pci_device_1092_00a8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_00a8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_0550 = {
- 0x0550, pci_device_1092_0550,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_0550,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_08d4 = {
- 0x08d4, pci_device_1092_08d4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_08d4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_094c = {
- 0x094c, pci_device_1092_094c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_094c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_1092 = {
- 0x1092, pci_device_1092_1092,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_1092,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_6120 = {
- 0x6120, pci_device_1092_6120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_6120,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_8810 = {
- 0x8810, pci_device_1092_8810,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_8810,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_8811 = {
- 0x8811, pci_device_1092_8811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_8811,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_8880 = {
- 0x8880, pci_device_1092_8880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_8880,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_8881 = {
- 0x8881, pci_device_1092_8881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_8881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88b0 = {
- 0x88b0, pci_device_1092_88b0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88b0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88b1 = {
- 0x88b1, pci_device_1092_88b1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88b1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88c0 = {
- 0x88c0, pci_device_1092_88c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88c1 = {
- 0x88c1, pci_device_1092_88c1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88c1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88d0 = {
- 0x88d0, pci_device_1092_88d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88d1 = {
- 0x88d1, pci_device_1092_88d1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88d1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88f0 = {
- 0x88f0, pci_device_1092_88f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_88f1 = {
- 0x88f1, pci_device_1092_88f1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_88f1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1092_9999 = {
- 0x9999, pci_device_1092_9999,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1092_9999,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1093_0160 = {
- 0x0160, pci_device_1093_0160,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_0160,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_0162 = {
- 0x0162, pci_device_1093_0162,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_0162,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_1170 = {
- 0x1170, pci_device_1093_1170,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_1170,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_1180 = {
- 0x1180, pci_device_1093_1180,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_1180,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_1190 = {
- 0x1190, pci_device_1093_1190,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_1190,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_1330 = {
- 0x1330, pci_device_1093_1330,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_1330,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_1350 = {
- 0x1350, pci_device_1093_1350,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_1350,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_2a60 = {
- 0x2a60, pci_device_1093_2a60,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_2a60,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b001 = {
- 0xb001, pci_device_1093_b001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b011 = {
- 0xb011, pci_device_1093_b011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b021 = {
- 0xb021, pci_device_1093_b021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b031 = {
- 0xb031, pci_device_1093_b031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b041 = {
- 0xb041, pci_device_1093_b041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b051 = {
- 0xb051, pci_device_1093_b051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b061 = {
- 0xb061, pci_device_1093_b061,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b061,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b071 = {
- 0xb071, pci_device_1093_b071,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b071,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b081 = {
- 0xb081, pci_device_1093_b081,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b081,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_b091 = {
- 0xb091, pci_device_1093_b091,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_b091,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_c801 = {
- 0xc801, pci_device_1093_c801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_c801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1093_c831 = {
- 0xc831, pci_device_1093_c831,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1093_c831,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1095_0240 = {
- 0x0240, pci_device_1095_0240,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0240,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0640 = {
- 0x0640, pci_device_1095_0640,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0640,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0643 = {
- 0x0643, pci_device_1095_0643,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0643,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0646 = {
- 0x0646, pci_device_1095_0646,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0646,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0647 = {
- 0x0647, pci_device_1095_0647,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0647,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0648 = {
- 0x0648, pci_device_1095_0648,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0648,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0649 = {
- 0x0649, pci_device_1095_0649,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0649,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0650 = {
- 0x0650, pci_device_1095_0650,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0650,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0670 = {
- 0x0670, pci_device_1095_0670,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0670,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0673 = {
- 0x0673, pci_device_1095_0673,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0673,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_0680 = {
- 0x0680, pci_device_1095_0680,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_0680,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1095_3112 = {
- 0x3112, pci_device_1095_3112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1095_3112,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1098_0001 = {
- 0x0001, pci_device_1098_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1098_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1098_0002 = {
- 0x0002, pci_device_1098_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1098_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_109e_0350 = {
- 0x0350, pci_device_109e_0350,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0350,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0351 = {
- 0x0351, pci_device_109e_0351,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0351,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0369 = {
- 0x0369, pci_device_109e_0369,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0369,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_036c = {
- 0x036c, pci_device_109e_036c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_036c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_036e = {
- 0x036e, pci_device_109e_036e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_036e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_036f = {
- 0x036f, pci_device_109e_036f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_036f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0370 = {
- 0x0370, pci_device_109e_0370,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0370,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0878 = {
- 0x0878, pci_device_109e_0878,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0878,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0879 = {
- 0x0879, pci_device_109e_0879,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0879,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_0880 = {
- 0x0880, pci_device_109e_0880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_0880,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_2115 = {
- 0x2115, pci_device_109e_2115,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_2115,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_2125 = {
- 0x2125, pci_device_109e_2125,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_2125,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_2164 = {
- 0x2164, pci_device_109e_2164,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_2164,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_2165 = {
- 0x2165, pci_device_109e_2165,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_2165,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_8230 = {
- 0x8230, pci_device_109e_8230,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_8230,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_8472 = {
- 0x8472, pci_device_109e_8472,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_8472,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_109e_8474 = {
- 0x8474, pci_device_109e_8474,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_109e_8474,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10a5_3052 = {
- 0x3052, pci_device_10a5_3052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a5_3052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a5_5449 = {
- 0x5449, pci_device_10a5_5449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a5_5449,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10a8_0000 = {
- 0x0000, pci_device_10a8_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a8_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10a9_0001 = {
- 0x0001, pci_device_10a9_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0002 = {
- 0x0002, pci_device_10a9_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0003 = {
- 0x0003, pci_device_10a9_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0004 = {
- 0x0004, pci_device_10a9_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0005 = {
- 0x0005, pci_device_10a9_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0006 = {
- 0x0006, pci_device_10a9_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0007 = {
- 0x0007, pci_device_10a9_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0008 = {
- 0x0008, pci_device_10a9_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0009 = {
- 0x0009, pci_device_10a9_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0010 = {
- 0x0010, pci_device_10a9_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0011 = {
- 0x0011, pci_device_10a9_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_0012 = {
- 0x0012, pci_device_10a9_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1001 = {
- 0x1001, pci_device_10a9_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1002 = {
- 0x1002, pci_device_10a9_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1003 = {
- 0x1003, pci_device_10a9_1003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1004 = {
- 0x1004, pci_device_10a9_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1005 = {
- 0x1005, pci_device_10a9_1005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1006 = {
- 0x1006, pci_device_10a9_1006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1007 = {
- 0x1007, pci_device_10a9_1007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_1008 = {
- 0x1008, pci_device_10a9_1008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_1008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_100a = {
- 0x100a, pci_device_10a9_100a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_100a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_2001 = {
- 0x2001, pci_device_10a9_2001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_2001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_2002 = {
- 0x2002, pci_device_10a9_2002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_2002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_8001 = {
- 0x8001, pci_device_10a9_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_8001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10a9_8002 = {
- 0x8002, pci_device_10a9_8002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10a9_8002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10aa_0000 = {
- 0x0000, pci_device_10aa_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10aa_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ad_0001 = {
- 0x0001, pci_device_10ad_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ad_0003 = {
- 0x0003, pci_device_10ad_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ad_0005 = {
- 0x0005, pci_device_10ad_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ad_0103 = {
- 0x0103, pci_device_10ad_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ad_0105 = {
- 0x0105, pci_device_10ad_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ad_0565 = {
- 0x0565, pci_device_10ad_0565,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ad_0565,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b3_3106 = {
- 0x3106, pci_device_10b3_3106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b3_3106,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b3_b106 = {
- 0xb106, pci_device_10b3_b106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b3_b106,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b4_1b1d = {
- 0x1b1d, pci_device_10b4_1b1d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b4_1b1d,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b5_0001 = {
- 0x0001, pci_device_10b5_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1076 = {
- 0x1076, pci_device_10b5_1076,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1076,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1077 = {
- 0x1077, pci_device_10b5_1077,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1077,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1078 = {
- 0x1078, pci_device_10b5_1078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1103 = {
- 0x1103, pci_device_10b5_1103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1146 = {
- 0x1146, pci_device_10b5_1146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1146,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_1147 = {
- 0x1147, pci_device_10b5_1147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_1147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_2724 = {
- 0x2724, pci_device_10b5_2724,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_2724,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9030 = {
- 0x9030, pci_device_10b5_9030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9036 = {
- 0x9036, pci_device_10b5_9036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9050 = {
- 0x9050, pci_device_10b5_9050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9054 = {
- 0x9054, pci_device_10b5_9054,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9054,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9060 = {
- 0x9060, pci_device_10b5_9060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_906d = {
- 0x906d, pci_device_10b5_906d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_906d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_906e = {
- 0x906e, pci_device_10b5_906e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_906e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b5_9080 = {
- 0x9080, pci_device_10b5_9080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b5_9080,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b6_0001 = {
- 0x0001, pci_device_10b6_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0002 = {
- 0x0002, pci_device_10b6_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0003 = {
- 0x0003, pci_device_10b6_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0004 = {
- 0x0004, pci_device_10b6_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0006 = {
- 0x0006, pci_device_10b6_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0007 = {
- 0x0007, pci_device_10b6_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_0009 = {
- 0x0009, pci_device_10b6_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_000a = {
- 0x000a, pci_device_10b6_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_000b = {
- 0x000b, pci_device_10b6_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_000c = {
- 0x000c, pci_device_10b6_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_1000 = {
- 0x1000, pci_device_10b6_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b6_1001 = {
- 0x1001, pci_device_10b6_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b6_1001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b7_0001 = {
- 0x0001, pci_device_10b7_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_0910 = {
- 0x0910, pci_device_10b7_0910,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_0910,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_1006 = {
- 0x1006, pci_device_10b7_1006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_1006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_1007 = {
- 0x1007, pci_device_10b7_1007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_1007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_3390 = {
- 0x3390, pci_device_10b7_3390,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_3390,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_3590 = {
- 0x3590, pci_device_10b7_3590,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_3590,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_4500 = {
- 0x4500, pci_device_10b7_4500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_4500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5055 = {
- 0x5055, pci_device_10b7_5055,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5055,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5057 = {
- 0x5057, pci_device_10b7_5057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5157 = {
- 0x5157, pci_device_10b7_5157,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5157,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5257 = {
- 0x5257, pci_device_10b7_5257,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5257,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5900 = {
- 0x5900, pci_device_10b7_5900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5920 = {
- 0x5920, pci_device_10b7_5920,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5920,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5950 = {
- 0x5950, pci_device_10b7_5950,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5950,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5951 = {
- 0x5951, pci_device_10b7_5951,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5951,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5952 = {
- 0x5952, pci_device_10b7_5952,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5952,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5970 = {
- 0x5970, pci_device_10b7_5970,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5970,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_5b57 = {
- 0x5b57, pci_device_10b7_5b57,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_5b57,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6055 = {
- 0x6055, pci_device_10b7_6055,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6055,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6056 = {
- 0x6056, pci_device_10b7_6056,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6056,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6560 = {
- 0x6560, pci_device_10b7_6560,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6560,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6561 = {
- 0x6561, pci_device_10b7_6561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6562 = {
- 0x6562, pci_device_10b7_6562,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6562,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6563 = {
- 0x6563, pci_device_10b7_6563,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6563,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_6564 = {
- 0x6564, pci_device_10b7_6564,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_6564,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_7646 = {
- 0x7646, pci_device_10b7_7646,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_7646,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_7940 = {
- 0x7940, pci_device_10b7_7940,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_7940,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_7980 = {
- 0x7980, pci_device_10b7_7980,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_7980,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_7990 = {
- 0x7990, pci_device_10b7_7990,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_7990,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_8811 = {
- 0x8811, pci_device_10b7_8811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_8811,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9000 = {
- 0x9000, pci_device_10b7_9000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9001 = {
- 0x9001, pci_device_10b7_9001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9004 = {
- 0x9004, pci_device_10b7_9004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9005 = {
- 0x9005, pci_device_10b7_9005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9006 = {
- 0x9006, pci_device_10b7_9006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_900a = {
- 0x900a, pci_device_10b7_900a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_900a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9050 = {
- 0x9050, pci_device_10b7_9050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9051 = {
- 0x9051, pci_device_10b7_9051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9055 = {
- 0x9055, pci_device_10b7_9055,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9055,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9056 = {
- 0x9056, pci_device_10b7_9056,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9056,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9058 = {
- 0x9058, pci_device_10b7_9058,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9058,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_905a = {
- 0x905a, pci_device_10b7_905a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_905a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9200 = {
- 0x9200, pci_device_10b7_9200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9201 = {
- 0x9201, pci_device_10b7_9201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9300 = {
- 0x9300, pci_device_10b7_9300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9800 = {
- 0x9800, pci_device_10b7_9800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9805 = {
- 0x9805, pci_device_10b7_9805,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9805,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9900 = {
- 0x9900, pci_device_10b7_9900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9902 = {
- 0x9902, pci_device_10b7_9902,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9902,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9903 = {
- 0x9903, pci_device_10b7_9903,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9903,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9904 = {
- 0x9904, pci_device_10b7_9904,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9904,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9905 = {
- 0x9905, pci_device_10b7_9905,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9905,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9908 = {
- 0x9908, pci_device_10b7_9908,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9908,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_9909 = {
- 0x9909, pci_device_10b7_9909,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_9909,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b7_990b = {
- 0x990b, pci_device_10b7_990b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b7_990b,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b8_0005 = {
- 0x0005, pci_device_10b8_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b8_0006 = {
- 0x0006, pci_device_10b8_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b8_1000 = {
- 0x1000, pci_device_10b8_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b8_1001 = {
- 0x1001, pci_device_10b8_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b8_a011 = {
- 0xa011, pci_device_10b8_a011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_a011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b8_b106 = {
- 0xb106, pci_device_10b8_b106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b8_b106,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10b9_0111 = {
- 0x0111, pci_device_10b9_0111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_0111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1435 = {
- 0x1435, pci_device_10b9_1435,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1435,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1445 = {
- 0x1445, pci_device_10b9_1445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1449 = {
- 0x1449, pci_device_10b9_1449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1449,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1451 = {
- 0x1451, pci_device_10b9_1451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1461 = {
- 0x1461, pci_device_10b9_1461,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1461,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1489 = {
- 0x1489, pci_device_10b9_1489,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1489,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1511 = {
- 0x1511, pci_device_10b9_1511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1511,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1512 = {
- 0x1512, pci_device_10b9_1512,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1512,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1513 = {
- 0x1513, pci_device_10b9_1513,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1513,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1521 = {
- 0x1521, pci_device_10b9_1521,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1521,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1523 = {
- 0x1523, pci_device_10b9_1523,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1523,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1531 = {
- 0x1531, pci_device_10b9_1531,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1531,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1533 = {
- 0x1533, pci_device_10b9_1533,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1533,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1541 = {
- 0x1541, pci_device_10b9_1541,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1541,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1543 = {
- 0x1543, pci_device_10b9_1543,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1543,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1563 = {
- 0x1563, pci_device_10b9_1563,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1563,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1621 = {
- 0x1621, pci_device_10b9_1621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1631 = {
- 0x1631, pci_device_10b9_1631,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1631,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1632 = {
- 0x1632, pci_device_10b9_1632,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1632,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1641 = {
- 0x1641, pci_device_10b9_1641,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1641,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1644 = {
- 0x1644, pci_device_10b9_1644,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1644,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1646 = {
- 0x1646, pci_device_10b9_1646,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1646,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1647 = {
- 0x1647, pci_device_10b9_1647,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1647,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1651 = {
- 0x1651, pci_device_10b9_1651,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1651,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1671 = {
- 0x1671, pci_device_10b9_1671,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1671,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1681 = {
- 0x1681, pci_device_10b9_1681,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1681,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_1687 = {
- 0x1687, pci_device_10b9_1687,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_1687,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3141 = {
- 0x3141, pci_device_10b9_3141,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3141,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3143 = {
- 0x3143, pci_device_10b9_3143,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3143,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3145 = {
- 0x3145, pci_device_10b9_3145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3147 = {
- 0x3147, pci_device_10b9_3147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3149 = {
- 0x3149, pci_device_10b9_3149,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3149,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3151 = {
- 0x3151, pci_device_10b9_3151,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3151,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3307 = {
- 0x3307, pci_device_10b9_3307,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3307,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_3309 = {
- 0x3309, pci_device_10b9_3309,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_3309,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5212 = {
- 0x5212, pci_device_10b9_5212,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5212,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5215 = {
- 0x5215, pci_device_10b9_5215,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5215,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5217 = {
- 0x5217, pci_device_10b9_5217,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5217,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5219 = {
- 0x5219, pci_device_10b9_5219,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5219,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5225 = {
- 0x5225, pci_device_10b9_5225,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5225,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5229 = {
- 0x5229, pci_device_10b9_5229,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5229,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5235 = {
- 0x5235, pci_device_10b9_5235,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5235,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5237 = {
- 0x5237, pci_device_10b9_5237,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5237,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5239 = {
- 0x5239, pci_device_10b9_5239,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5239,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5243 = {
- 0x5243, pci_device_10b9_5243,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5243,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5247 = {
- 0x5247, pci_device_10b9_5247,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5247,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5249 = {
- 0x5249, pci_device_10b9_5249,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5249,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5251 = {
- 0x5251, pci_device_10b9_5251,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5251,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5253 = {
- 0x5253, pci_device_10b9_5253,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5253,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5261 = {
- 0x5261, pci_device_10b9_5261,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5261,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5450 = {
- 0x5450, pci_device_10b9_5450,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5450,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5451 = {
- 0x5451, pci_device_10b9_5451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5453 = {
- 0x5453, pci_device_10b9_5453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5455 = {
- 0x5455, pci_device_10b9_5455,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5455,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5457 = {
- 0x5457, pci_device_10b9_5457,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5457,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5459 = {
- 0x5459, pci_device_10b9_5459,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5459,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_545a = {
- 0x545a, pci_device_10b9_545a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_545a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5471 = {
- 0x5471, pci_device_10b9_5471,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5471,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_5473 = {
- 0x5473, pci_device_10b9_5473,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_5473,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10b9_7101 = {
- 0x7101, pci_device_10b9_7101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10b9_7101,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ba_0301 = {
- 0x0301, pci_device_10ba_0301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ba_0301,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10bd_0e34 = {
- 0x0e34, pci_device_10bd_0e34,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10bd_0e34,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10c3_1100 = {
- 0x1100, pci_device_10c3_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c3_1100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_10c8_0001 = {
- 0x0001, pci_device_10c8_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0002 = {
- 0x0002, pci_device_10c8_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0003 = {
- 0x0003, pci_device_10c8_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0004 = {
- 0x0004, pci_device_10c8_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0005 = {
- 0x0005, pci_device_10c8_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0006 = {
- 0x0006, pci_device_10c8_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0016 = {
- 0x0016, pci_device_10c8_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0025 = {
- 0x0025, pci_device_10c8_0025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_0083 = {
- 0x0083, pci_device_10c8_0083,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_0083,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_8005 = {
- 0x8005, pci_device_10c8_8005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_8005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_8006 = {
- 0x8006, pci_device_10c8_8006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_8006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10c8_8016 = {
- 0x8016, pci_device_10c8_8016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10c8_8016,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10cd_1100 = {
- 0x1100, pci_device_10cd_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cd_1100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10cd_1200 = {
- 0x1200, pci_device_10cd_1200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cd_1200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10cd_1300 = {
- 0x1300, pci_device_10cd_1300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cd_1300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10cd_2300 = {
- 0x2300, pci_device_10cd_2300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cd_2300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10cd_2500 = {
- 0x2500, pci_device_10cd_2500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cd_2500,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10cf_2001 = {
- 0x2001, pci_device_10cf_2001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10cf_2001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10d9_0512 = {
- 0x0512, pci_device_10d9_0512,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10d9_0512,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10d9_0531 = {
- 0x0531, pci_device_10d9_0531,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10d9_0531,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10d9_8625 = {
- 0x8625, pci_device_10d9_8625,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10d9_8625,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10d9_8888 = {
- 0x8888, pci_device_10d9_8888,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10d9_8888,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10da_0508 = {
- 0x0508, pci_device_10da_0508,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10da_0508,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10da_3390 = {
- 0x3390, pci_device_10da_3390,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10da_3390,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10dc_0001 = {
- 0x0001, pci_device_10dc_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10dc_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10dc_0002 = {
- 0x0002, pci_device_10dc_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10dc_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10dc_0021 = {
- 0x0021, pci_device_10dc_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10dc_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10dc_0022 = {
- 0x0022, pci_device_10dc_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10dc_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10dc_10dc = {
- 0x10dc, pci_device_10dc_10dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10dc_10dc,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_10de_0008 = {
- 0x0008, pci_device_10de_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0009 = {
- 0x0009, pci_device_10de_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0010 = {
- 0x0010, pci_device_10de_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0020 = {
- 0x0020, pci_device_10de_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0028 = {
- 0x0028, pci_device_10de_0028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0029 = {
- 0x0029, pci_device_10de_0029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002a = {
- 0x002a, pci_device_10de_002a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002b = {
- 0x002b, pci_device_10de_002b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002c = {
- 0x002c, pci_device_10de_002c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002d = {
- 0x002d, pci_device_10de_002d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002e = {
- 0x002e, pci_device_10de_002e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_002f = {
- 0x002f, pci_device_10de_002f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_002f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0060 = {
- 0x0060, pci_device_10de_0060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0064 = {
- 0x0064, pci_device_10de_0064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0065 = {
- 0x0065, pci_device_10de_0065,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0065,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0066 = {
- 0x0066, pci_device_10de_0066,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0066,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0067 = {
- 0x0067, pci_device_10de_0067,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0067,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0068 = {
- 0x0068, pci_device_10de_0068,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0068,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_006a = {
- 0x006a, pci_device_10de_006a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_006a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_006b = {
- 0x006b, pci_device_10de_006b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_006b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_006e = {
- 0x006e, pci_device_10de_006e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_006e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_00a0 = {
- 0x00a0, pci_device_10de_00a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_00a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0100 = {
- 0x0100, pci_device_10de_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0101 = {
- 0x0101, pci_device_10de_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0103 = {
- 0x0103, pci_device_10de_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0110 = {
- 0x0110, pci_device_10de_0110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0111 = {
- 0x0111, pci_device_10de_0111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0112 = {
- 0x0112, pci_device_10de_0112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0113 = {
- 0x0113, pci_device_10de_0113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0150 = {
- 0x0150, pci_device_10de_0150,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0150,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0151 = {
- 0x0151, pci_device_10de_0151,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0151,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0152 = {
- 0x0152, pci_device_10de_0152,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0152,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0153 = {
- 0x0153, pci_device_10de_0153,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0153,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0170 = {
- 0x0170, pci_device_10de_0170,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0170,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0171 = {
- 0x0171, pci_device_10de_0171,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0171,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0172 = {
- 0x0172, pci_device_10de_0172,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0172,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0173 = {
- 0x0173, pci_device_10de_0173,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0173,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0174 = {
- 0x0174, pci_device_10de_0174,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0174,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0175 = {
- 0x0175, pci_device_10de_0175,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0175,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0176 = {
- 0x0176, pci_device_10de_0176,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0176,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0178 = {
- 0x0178, pci_device_10de_0178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0179 = {
- 0x0179, pci_device_10de_0179,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0179,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_017a = {
- 0x017a, pci_device_10de_017a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_017a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_017b = {
- 0x017b, pci_device_10de_017b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_017b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_017c = {
- 0x017c, pci_device_10de_017c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_017c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0181 = {
- 0x0181, pci_device_10de_0181,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0181,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0182 = {
- 0x0182, pci_device_10de_0182,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0182,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0183 = {
- 0x0183, pci_device_10de_0183,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0183,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0188 = {
- 0x0188, pci_device_10de_0188,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0188,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_018a = {
- 0x018a, pci_device_10de_018a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_018a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_018b = {
- 0x018b, pci_device_10de_018b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_018b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01a0 = {
- 0x01a0, pci_device_10de_01a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01a4 = {
- 0x01a4, pci_device_10de_01a4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01a4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01ab = {
- 0x01ab, pci_device_10de_01ab,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01ab,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01ac = {
- 0x01ac, pci_device_10de_01ac,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01ac,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01ad = {
- 0x01ad, pci_device_10de_01ad,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01ad,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01b1 = {
- 0x01b1, pci_device_10de_01b1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01b1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01b2 = {
- 0x01b2, pci_device_10de_01b2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01b2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01b4 = {
- 0x01b4, pci_device_10de_01b4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01b4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01b7 = {
- 0x01b7, pci_device_10de_01b7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01b7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01b8 = {
- 0x01b8, pci_device_10de_01b8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01b8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01bc = {
- 0x01bc, pci_device_10de_01bc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01bc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01c1 = {
- 0x01c1, pci_device_10de_01c1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01c1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01c2 = {
- 0x01c2, pci_device_10de_01c2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01c2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01c3 = {
- 0x01c3, pci_device_10de_01c3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01c3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01e8 = {
- 0x01e8, pci_device_10de_01e8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01e8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_01f0 = {
- 0x01f0, pci_device_10de_01f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_01f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0200 = {
- 0x0200, pci_device_10de_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0201 = {
- 0x0201, pci_device_10de_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0202 = {
- 0x0202, pci_device_10de_0202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0203 = {
- 0x0203, pci_device_10de_0203,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0203,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0250 = {
- 0x0250, pci_device_10de_0250,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0250,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0251 = {
- 0x0251, pci_device_10de_0251,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0251,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0252 = {
- 0x0252, pci_device_10de_0252,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0252,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0253 = {
- 0x0253, pci_device_10de_0253,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0253,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0258 = {
- 0x0258, pci_device_10de_0258,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0258,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0259 = {
- 0x0259, pci_device_10de_0259,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0259,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_025b = {
- 0x025b, pci_device_10de_025b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_025b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0280 = {
- 0x0280, pci_device_10de_0280,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0280,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0281 = {
- 0x0281, pci_device_10de_0281,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0281,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0282 = {
- 0x0282, pci_device_10de_0282,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0282,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0288 = {
- 0x0288, pci_device_10de_0288,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0288,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0289 = {
- 0x0289, pci_device_10de_0289,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0289,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0300 = {
- 0x0300, pci_device_10de_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0301 = {
- 0x0301, pci_device_10de_0301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0302 = {
- 0x0302, pci_device_10de_0302,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0302,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0308 = {
- 0x0308, pci_device_10de_0308,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0308,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10de_0309 = {
- 0x0309, pci_device_10de_0309,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10de_0309,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10df_1ae5 = {
- 0x1ae5, pci_device_10df_1ae5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_1ae5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f085 = {
- 0xf085, pci_device_10df_f085,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f085,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f095 = {
- 0xf095, pci_device_10df_f095,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f095,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f098 = {
- 0xf098, pci_device_10df_f098,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f098,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f700 = {
- 0xf700, pci_device_10df_f700,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f700,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f800 = {
- 0xf800, pci_device_10df_f800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f900 = {
- 0xf900, pci_device_10df_f900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10df_f980 = {
- 0xf980, pci_device_10df_f980,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10df_f980,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_10e0_5026 = {
- 0x5026, pci_device_10e0_5026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_5026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e0_5027 = {
- 0x5027, pci_device_10e0_5027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_5027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e0_5028 = {
- 0x5028, pci_device_10e0_5028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_5028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e0_8849 = {
- 0x8849, pci_device_10e0_8849,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_8849,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e0_8853 = {
- 0x8853, pci_device_10e0_8853,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_8853,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e0_9128 = {
- 0x9128, pci_device_10e0_9128,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e0_9128,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10e1_0391 = {
- 0x0391, pci_device_10e1_0391,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e1_0391,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e1_690c = {
- 0x690c, pci_device_10e1_690c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e1_690c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e1_dc29 = {
- 0xdc29, pci_device_10e1_dc29,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e1_dc29,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10e3_0000 = {
- 0x0000, pci_device_10e3_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e3_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e3_0860 = {
- 0x0860, pci_device_10e3_0860,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e3_0860,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e3_0862 = {
- 0x0862, pci_device_10e3_0862,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e3_0862,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10e8_2011 = {
- 0x2011, pci_device_10e8_2011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_2011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_4750 = {
- 0x4750, pci_device_10e8_4750,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_4750,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_5920 = {
- 0x5920, pci_device_10e8_5920,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_5920,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_8043 = {
- 0x8043, pci_device_10e8_8043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_8043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_8062 = {
- 0x8062, pci_device_10e8_8062,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_8062,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_807d = {
- 0x807d, pci_device_10e8_807d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_807d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_8088 = {
- 0x8088, pci_device_10e8_8088,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_8088,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_8089 = {
- 0x8089, pci_device_10e8_8089,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_8089,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_809c = {
- 0x809c, pci_device_10e8_809c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_809c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_80d7 = {
- 0x80d7, pci_device_10e8_80d7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_80d7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_80d9 = {
- 0x80d9, pci_device_10e8_80d9,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_80d9,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_80da = {
- 0x80da, pci_device_10e8_80da,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_80da,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_811a = {
- 0x811a, pci_device_10e8_811a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_811a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_8170 = {
- 0x8170, pci_device_10e8_8170,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_8170,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10e8_82db = {
- 0x82db, pci_device_10e8_82db,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10e8_82db,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_10ea_1680 = {
- 0x1680, pci_device_10ea_1680,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_1680,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_1682 = {
- 0x1682, pci_device_10ea_1682,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_1682,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_1683 = {
- 0x1683, pci_device_10ea_1683,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_1683,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_2000 = {
- 0x2000, pci_device_10ea_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_2010 = {
- 0x2010, pci_device_10ea_2010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_2010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_5000 = {
- 0x5000, pci_device_10ea_5000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_5000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_5050 = {
- 0x5050, pci_device_10ea_5050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_5050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ea_5202 = {
- 0x5202, pci_device_10ea_5202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ea_5202,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10eb_0101 = {
- 0x0101, pci_device_10eb_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10eb_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10eb_8111 = {
- 0x8111, pci_device_10eb_8111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10eb_8111,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ec_8029 = {
- 0x8029, pci_device_10ec_8029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ec_8129 = {
- 0x8129, pci_device_10ec_8129,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8129,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ec_8138 = {
- 0x8138, pci_device_10ec_8138,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8138,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ec_8139 = {
- 0x8139, pci_device_10ec_8139,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8139,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ec_8169 = {
- 0x8169, pci_device_10ec_8169,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8169,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ec_8197 = {
- 0x8197, pci_device_10ec_8197,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ec_8197,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ed_7310 = {
- 0x7310, pci_device_10ed_7310,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ed_7310,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ee_3fc0 = {
- 0x3fc0, pci_device_10ee_3fc0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ee_3fc1 = {
- 0x3fc1, pci_device_10ee_3fc1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ee_3fc2 = {
- 0x3fc2, pci_device_10ee_3fc2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ee_3fc3 = {
- 0x3fc3, pci_device_10ee_3fc3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ee_3fc4 = {
- 0x3fc4, pci_device_10ee_3fc4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10ee_3fc5 = {
- 0x3fc5, pci_device_10ee_3fc5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ee_3fc5,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10ef_8154 = {
- 0x8154, pci_device_10ef_8154,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10ef_8154,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10f5_a001 = {
- 0xa001, pci_device_10f5_a001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10f5_a001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10fa_000c = {
- 0x000c, pci_device_10fa_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10fa_000c,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10fb_186f = {
- 0x186f, pci_device_10fb_186f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10fb_186f,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_10fc_0003 = {
- 0x0003, pci_device_10fc_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10fc_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_10fc_0005 = {
- 0x0005, pci_device_10fc_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_10fc_0005,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1101_1060 = {
- 0x1060, pci_device_1101_1060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1101_1060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1101_9100 = {
- 0x9100, pci_device_1101_9100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1101_9100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1101_9400 = {
- 0x9400, pci_device_1101_9400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1101_9400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1101_9401 = {
- 0x9401, pci_device_1101_9401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1101_9401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1101_9500 = {
- 0x9500, pci_device_1101_9500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1101_9500,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1102_0002 = {
- 0x0002, pci_device_1102_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_0002,
-#else
- NULL,
-#endif
- 0x0401
-};
-static const pciDeviceInfo pci_dev_info_1102_0004 = {
- 0x0004, pci_device_1102_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_0006 = {
- 0x0006, pci_device_1102_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_4001 = {
- 0x4001, pci_device_1102_4001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_4001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_7002 = {
- 0x7002, pci_device_1102_7002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_7002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_7003 = {
- 0x7003, pci_device_1102_7003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_7003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_7004 = {
- 0x7004, pci_device_1102_7004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_7004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_8064 = {
- 0x8064, pci_device_1102_8064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_8064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1102_8938 = {
- 0x8938, pci_device_1102_8938,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1102_8938,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1103_0003 = {
- 0x0003, pci_device_1103_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0004 = {
- 0x0004, pci_device_1103_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0005 = {
- 0x0005, pci_device_1103_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0006 = {
- 0x0006, pci_device_1103_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0007 = {
- 0x0007, pci_device_1103_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0008 = {
- 0x0008, pci_device_1103_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1103_0009 = {
- 0x0009, pci_device_1103_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1103_0009,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1105_1105 = {
- 0x1105, pci_device_1105_1105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1105_1105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1105_8300 = {
- 0x8300, pci_device_1105_8300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1105_8300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1105_8400 = {
- 0x8400, pci_device_1105_8400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1105_8400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1106_0102 = {
- 0x0102, pci_device_1106_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0130 = {
- 0x0130, pci_device_1106_0130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0305 = {
- 0x0305, pci_device_1106_0305,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0305,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0391 = {
- 0x0391, pci_device_1106_0391,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0391,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0501 = {
- 0x0501, pci_device_1106_0501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0505 = {
- 0x0505, pci_device_1106_0505,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0505,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0561 = {
- 0x0561, pci_device_1106_0561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0571 = {
- 0x0571, pci_device_1106_0571,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0571,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0576 = {
- 0x0576, pci_device_1106_0576,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0576,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0585 = {
- 0x0585, pci_device_1106_0585,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0585,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0586 = {
- 0x0586, pci_device_1106_0586,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0586,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0595 = {
- 0x0595, pci_device_1106_0595,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0595,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0596 = {
- 0x0596, pci_device_1106_0596,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0596,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0597 = {
- 0x0597, pci_device_1106_0597,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0597,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0598 = {
- 0x0598, pci_device_1106_0598,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0598,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0601 = {
- 0x0601, pci_device_1106_0601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0605 = {
- 0x0605, pci_device_1106_0605,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0605,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0680 = {
- 0x0680, pci_device_1106_0680,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0680,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0686 = {
- 0x0686, pci_device_1106_0686,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0686,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0691 = {
- 0x0691, pci_device_1106_0691,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0691,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0693 = {
- 0x0693, pci_device_1106_0693,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0693,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0698 = {
- 0x0698, pci_device_1106_0698,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0698,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_0926 = {
- 0x0926, pci_device_1106_0926,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_0926,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_1000 = {
- 0x1000, pci_device_1106_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_1106 = {
- 0x1106, pci_device_1106_1106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_1106,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_1571 = {
- 0x1571, pci_device_1106_1571,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_1571,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_1595 = {
- 0x1595, pci_device_1106_1595,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_1595,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3038 = {
- 0x3038, pci_device_1106_3038,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3038,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3040 = {
- 0x3040, pci_device_1106_3040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3043 = {
- 0x3043, pci_device_1106_3043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3044 = {
- 0x3044, pci_device_1106_3044,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3044,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3050 = {
- 0x3050, pci_device_1106_3050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3051 = {
- 0x3051, pci_device_1106_3051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3057 = {
- 0x3057, pci_device_1106_3057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3058 = {
- 0x3058, pci_device_1106_3058,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3058,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3059 = {
- 0x3059, pci_device_1106_3059,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3059,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3065 = {
- 0x3065, pci_device_1106_3065,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3065,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3068 = {
- 0x3068, pci_device_1106_3068,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3068,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3074 = {
- 0x3074, pci_device_1106_3074,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3074,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3091 = {
- 0x3091, pci_device_1106_3091,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3091,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3099 = {
- 0x3099, pci_device_1106_3099,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3099,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3101 = {
- 0x3101, pci_device_1106_3101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3102 = {
- 0x3102, pci_device_1106_3102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3103 = {
- 0x3103, pci_device_1106_3103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3104 = {
- 0x3104, pci_device_1106_3104,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3104,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3106 = {
- 0x3106, pci_device_1106_3106,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3106,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3109 = {
- 0x3109, pci_device_1106_3109,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3109,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3112 = {
- 0x3112, pci_device_1106_3112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3116 = {
- 0x3116, pci_device_1106_3116,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3116,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3122 = {
- 0x3122, pci_device_1106_3122,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3122,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3123 = {
- 0x3123, pci_device_1106_3123,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3123,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3128 = {
- 0x3128, pci_device_1106_3128,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3128,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3133 = {
- 0x3133, pci_device_1106_3133,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3133,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3147 = {
- 0x3147, pci_device_1106_3147,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3147,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3148 = {
- 0x3148, pci_device_1106_3148,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3148,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3156 = {
- 0x3156, pci_device_1106_3156,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3156,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3168 = {
- 0x3168, pci_device_1106_3168,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3168,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3177 = {
- 0x3177, pci_device_1106_3177,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3177,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_3189 = {
- 0x3189, pci_device_1106_3189,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_3189,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_5030 = {
- 0x5030, pci_device_1106_5030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_5030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_6100 = {
- 0x6100, pci_device_1106_6100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_6100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8231 = {
- 0x8231, pci_device_1106_8231,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8231,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8235 = {
- 0x8235, pci_device_1106_8235,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8235,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8305 = {
- 0x8305, pci_device_1106_8305,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8305,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8391 = {
- 0x8391, pci_device_1106_8391,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8391,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8501 = {
- 0x8501, pci_device_1106_8501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8596 = {
- 0x8596, pci_device_1106_8596,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8596,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8597 = {
- 0x8597, pci_device_1106_8597,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8597,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8598 = {
- 0x8598, pci_device_1106_8598,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8598,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8601 = {
- 0x8601, pci_device_1106_8601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8605 = {
- 0x8605, pci_device_1106_8605,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8605,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8691 = {
- 0x8691, pci_device_1106_8691,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8691,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_8693 = {
- 0x8693, pci_device_1106_8693,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_8693,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b091 = {
- 0xb091, pci_device_1106_b091,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b091,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b099 = {
- 0xb099, pci_device_1106_b099,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b099,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b101 = {
- 0xb101, pci_device_1106_b101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b102 = {
- 0xb102, pci_device_1106_b102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b103 = {
- 0xb103, pci_device_1106_b103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b112 = {
- 0xb112, pci_device_1106_b112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1106_b168 = {
- 0xb168, pci_device_1106_b168,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1106_b168,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1107_0576 = {
- 0x0576, pci_device_1107_0576,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1107_0576,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1108_0100 = {
- 0x0100, pci_device_1108_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_0101 = {
- 0x0101, pci_device_1108_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_0105 = {
- 0x0105, pci_device_1108_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_0108 = {
- 0x0108, pci_device_1108_0108,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0108,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_0138 = {
- 0x0138, pci_device_1108_0138,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0138,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_0139 = {
- 0x0139, pci_device_1108_0139,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_0139,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_013c = {
- 0x013c, pci_device_1108_013c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_013c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1108_013d = {
- 0x013d, pci_device_1108_013d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1108_013d,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1109_1400 = {
- 0x1400, pci_device_1109_1400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1109_1400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_110a_0002 = {
- 0x0002, pci_device_110a_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_0005 = {
- 0x0005, pci_device_110a_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_0006 = {
- 0x0006, pci_device_110a_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_0015 = {
- 0x0015, pci_device_110a_0015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_0015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_001d = {
- 0x001d, pci_device_110a_001d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_001d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_007b = {
- 0x007b, pci_device_110a_007b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_007b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_007c = {
- 0x007c, pci_device_110a_007c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_007c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_007d = {
- 0x007d, pci_device_110a_007d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_007d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_2102 = {
- 0x2102, pci_device_110a_2102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_2102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_4942 = {
- 0x4942, pci_device_110a_4942,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_4942,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110a_6120 = {
- 0x6120, pci_device_110a_6120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110a_6120,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_110b_0001 = {
- 0x0001, pci_device_110b_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110b_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_110b_0004 = {
- 0x0004, pci_device_110b_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_110b_0004,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1110_6037 = {
- 0x6037, pci_device_1110_6037,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1110_6037,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1110_6073 = {
- 0x6073, pci_device_1110_6073,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1110_6073,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1112_2200 = {
- 0x2200, pci_device_1112_2200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1112_2200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1112_2300 = {
- 0x2300, pci_device_1112_2300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1112_2300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1112_2340 = {
- 0x2340, pci_device_1112_2340,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1112_2340,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1112_2400 = {
- 0x2400, pci_device_1112_2400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1112_2400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1113_1211 = {
- 0x1211, pci_device_1113_1211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_1211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1113_1216 = {
- 0x1216, pci_device_1113_1216,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_1216,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1113_1217 = {
- 0x1217, pci_device_1113_1217,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_1217,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1113_5105 = {
- 0x5105, pci_device_1113_5105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_5105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1113_9211 = {
- 0x9211, pci_device_1113_9211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_9211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1113_9511 = {
- 0x9511, pci_device_1113_9511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1113_9511,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1116_0022 = {
- 0x0022, pci_device_1116_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0023 = {
- 0x0023, pci_device_1116_0023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0024 = {
- 0x0024, pci_device_1116_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0025 = {
- 0x0025, pci_device_1116_0025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0026 = {
- 0x0026, pci_device_1116_0026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0027 = {
- 0x0027, pci_device_1116_0027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1116_0028 = {
- 0x0028, pci_device_1116_0028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1116_0028,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1117_9500 = {
- 0x9500, pci_device_1117_9500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1117_9500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1117_9501 = {
- 0x9501, pci_device_1117_9501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1117_9501,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1119_0000 = {
- 0x0000, pci_device_1119_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0001 = {
- 0x0001, pci_device_1119_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0002 = {
- 0x0002, pci_device_1119_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0003 = {
- 0x0003, pci_device_1119_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0004 = {
- 0x0004, pci_device_1119_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0005 = {
- 0x0005, pci_device_1119_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0006 = {
- 0x0006, pci_device_1119_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0007 = {
- 0x0007, pci_device_1119_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0008 = {
- 0x0008, pci_device_1119_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0009 = {
- 0x0009, pci_device_1119_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_000a = {
- 0x000a, pci_device_1119_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_000b = {
- 0x000b, pci_device_1119_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_000c = {
- 0x000c, pci_device_1119_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_000d = {
- 0x000d, pci_device_1119_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0100 = {
- 0x0100, pci_device_1119_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0101 = {
- 0x0101, pci_device_1119_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0102 = {
- 0x0102, pci_device_1119_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0103 = {
- 0x0103, pci_device_1119_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0104 = {
- 0x0104, pci_device_1119_0104,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0104,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0105 = {
- 0x0105, pci_device_1119_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0110 = {
- 0x0110, pci_device_1119_0110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0111 = {
- 0x0111, pci_device_1119_0111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0112 = {
- 0x0112, pci_device_1119_0112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0113 = {
- 0x0113, pci_device_1119_0113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0114 = {
- 0x0114, pci_device_1119_0114,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0114,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0115 = {
- 0x0115, pci_device_1119_0115,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0115,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0118 = {
- 0x0118, pci_device_1119_0118,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0118,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0119 = {
- 0x0119, pci_device_1119_0119,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0119,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_011a = {
- 0x011a, pci_device_1119_011a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_011a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_011b = {
- 0x011b, pci_device_1119_011b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_011b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0120 = {
- 0x0120, pci_device_1119_0120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0120,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0121 = {
- 0x0121, pci_device_1119_0121,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0121,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0122 = {
- 0x0122, pci_device_1119_0122,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0122,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0123 = {
- 0x0123, pci_device_1119_0123,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0123,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0124 = {
- 0x0124, pci_device_1119_0124,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0124,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0125 = {
- 0x0125, pci_device_1119_0125,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0125,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0136 = {
- 0x0136, pci_device_1119_0136,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0136,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0137 = {
- 0x0137, pci_device_1119_0137,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0137,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0138 = {
- 0x0138, pci_device_1119_0138,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0138,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0139 = {
- 0x0139, pci_device_1119_0139,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0139,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013a = {
- 0x013a, pci_device_1119_013a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013b = {
- 0x013b, pci_device_1119_013b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013c = {
- 0x013c, pci_device_1119_013c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013d = {
- 0x013d, pci_device_1119_013d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013e = {
- 0x013e, pci_device_1119_013e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_013f = {
- 0x013f, pci_device_1119_013f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_013f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0166 = {
- 0x0166, pci_device_1119_0166,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0166,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0167 = {
- 0x0167, pci_device_1119_0167,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0167,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0168 = {
- 0x0168, pci_device_1119_0168,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0168,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0169 = {
- 0x0169, pci_device_1119_0169,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0169,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016a = {
- 0x016a, pci_device_1119_016a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016b = {
- 0x016b, pci_device_1119_016b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016c = {
- 0x016c, pci_device_1119_016c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016d = {
- 0x016d, pci_device_1119_016d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016e = {
- 0x016e, pci_device_1119_016e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_016f = {
- 0x016f, pci_device_1119_016f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_016f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01d6 = {
- 0x01d6, pci_device_1119_01d6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01d6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01d7 = {
- 0x01d7, pci_device_1119_01d7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01d7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01f6 = {
- 0x01f6, pci_device_1119_01f6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01f6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01f7 = {
- 0x01f7, pci_device_1119_01f7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01f7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01fc = {
- 0x01fc, pci_device_1119_01fc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01fc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01fd = {
- 0x01fd, pci_device_1119_01fd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01fd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01fe = {
- 0x01fe, pci_device_1119_01fe,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01fe,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_01ff = {
- 0x01ff, pci_device_1119_01ff,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_01ff,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0210 = {
- 0x0210, pci_device_1119_0210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0211 = {
- 0x0211, pci_device_1119_0211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0260 = {
- 0x0260, pci_device_1119_0260,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0260,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0261 = {
- 0x0261, pci_device_1119_0261,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0261,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1119_0300 = {
- 0x0300, pci_device_1119_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1119_0300,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_111a_0000 = {
- 0x0000, pci_device_111a_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111a_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111a_0002 = {
- 0x0002, pci_device_111a_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111a_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111a_0003 = {
- 0x0003, pci_device_111a_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111a_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111a_0005 = {
- 0x0005, pci_device_111a_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111a_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111a_0007 = {
- 0x0007, pci_device_111a_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111a_0007,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_111c_0001 = {
- 0x0001, pci_device_111c_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111c_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_111d_0001 = {
- 0x0001, pci_device_111d_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111d_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111d_0003 = {
- 0x0003, pci_device_111d_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111d_0003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_111f_4a47 = {
- 0x4a47, pci_device_111f_4a47,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111f_4a47,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_111f_5243 = {
- 0x5243, pci_device_111f_5243,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_111f_5243,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1127_0200 = {
- 0x0200, pci_device_1127_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1127_0210 = {
- 0x0210, pci_device_1127_0210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1127_0250 = {
- 0x0250, pci_device_1127_0250,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0250,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1127_0300 = {
- 0x0300, pci_device_1127_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1127_0310 = {
- 0x0310, pci_device_1127_0310,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0310,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1127_0400 = {
- 0x0400, pci_device_1127_0400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1127_0400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_112f_0000 = {
- 0x0000, pci_device_112f_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_112f_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_112f_0001 = {
- 0x0001, pci_device_112f_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_112f_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1131_1561 = {
- 0x1561, pci_device_1131_1561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_1561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_1562 = {
- 0x1562, pci_device_1131_1562,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_1562,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_3400 = {
- 0x3400, pci_device_1131_3400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_3400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7130 = {
- 0x7130, pci_device_1131_7130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7133 = {
- 0x7133, pci_device_1131_7133,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7133,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7134 = {
- 0x7134, pci_device_1131_7134,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7134,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7135 = {
- 0x7135, pci_device_1131_7135,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7135,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7145 = {
- 0x7145, pci_device_1131_7145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1131_7146 = {
- 0x7146, pci_device_1131_7146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1131_7146,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1133_7901 = {
- 0x7901, pci_device_1133_7901,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7901,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7902 = {
- 0x7902, pci_device_1133_7902,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7902,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7911 = {
- 0x7911, pci_device_1133_7911,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7911,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7912 = {
- 0x7912, pci_device_1133_7912,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7912,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7941 = {
- 0x7941, pci_device_1133_7941,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7941,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7942 = {
- 0x7942, pci_device_1133_7942,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7942,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7943 = {
- 0x7943, pci_device_1133_7943,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7943,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_7944 = {
- 0x7944, pci_device_1133_7944,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_7944,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_b921 = {
- 0xb921, pci_device_1133_b921,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_b921,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_b922 = {
- 0xb922, pci_device_1133_b922,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_b922,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_b923 = {
- 0xb923, pci_device_1133_b923,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_b923,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e001 = {
- 0xe001, pci_device_1133_e001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e002 = {
- 0xe002, pci_device_1133_e002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e003 = {
- 0xe003, pci_device_1133_e003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e004 = {
- 0xe004, pci_device_1133_e004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e005 = {
- 0xe005, pci_device_1133_e005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e00b = {
- 0xe00b, pci_device_1133_e00b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e00b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e010 = {
- 0xe010, pci_device_1133_e010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e012 = {
- 0xe012, pci_device_1133_e012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e014 = {
- 0xe014, pci_device_1133_e014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1133_e018 = {
- 0xe018, pci_device_1133_e018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1133_e018,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1134_0001 = {
- 0x0001, pci_device_1134_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1134_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1135_0001 = {
- 0x0001, pci_device_1135_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1135_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1138_8905 = {
- 0x8905, pci_device_1138_8905,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1138_8905,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1139_0001 = {
- 0x0001, pci_device_1139_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1139_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_113c_0000 = {
- 0x0000, pci_device_113c_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113c_0001 = {
- 0x0001, pci_device_113c_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113c_0911 = {
- 0x0911, pci_device_113c_0911,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0911,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113c_0912 = {
- 0x0912, pci_device_113c_0912,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0912,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113c_0913 = {
- 0x0913, pci_device_113c_0913,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0913,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113c_0914 = {
- 0x0914, pci_device_113c_0914,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113c_0914,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_113f_0808 = {
- 0x0808, pci_device_113f_0808,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_0808,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_1010 = {
- 0x1010, pci_device_113f_1010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_1010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_80c0 = {
- 0x80c0, pci_device_113f_80c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_80c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_80c4 = {
- 0x80c4, pci_device_113f_80c4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_80c4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_80c8 = {
- 0x80c8, pci_device_113f_80c8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_80c8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_8888 = {
- 0x8888, pci_device_113f_8888,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_8888,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_113f_9090 = {
- 0x9090, pci_device_113f_9090,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_113f_9090,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1142_3210 = {
- 0x3210, pci_device_1142_3210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1142_3210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1142_6422 = {
- 0x6422, pci_device_1142_6422,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1142_6422,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1142_6424 = {
- 0x6424, pci_device_1142_6424,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1142_6424,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1142_6425 = {
- 0x6425, pci_device_1142_6425,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1142_6425,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1142_643d = {
- 0x643d, pci_device_1142_643d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1142_643d,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1144_0001 = {
- 0x0001, pci_device_1144_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1144_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1145_8007 = {
- 0x8007, pci_device_1145_8007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_8007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1145_f007 = {
- 0xf007, pci_device_1145_f007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_f007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1145_f010 = {
- 0xf010, pci_device_1145_f010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_f010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1145_f012 = {
- 0xf012, pci_device_1145_f012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_f012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1145_f013 = {
- 0xf013, pci_device_1145_f013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_f013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1145_f015 = {
- 0xf015, pci_device_1145_f015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1145_f015,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1148_4000 = {
- 0x4000, pci_device_1148_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1148_4000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1148_4200 = {
- 0x4200, pci_device_1148_4200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1148_4200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1148_4300 = {
- 0x4300, pci_device_1148_4300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1148_4300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1148_4320 = {
- 0x4320, pci_device_1148_4320,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1148_4320,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1148_4400 = {
- 0x4400, pci_device_1148_4400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1148_4400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_114a_5579 = {
- 0x5579, pci_device_114a_5579,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114a_5579,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114a_5587 = {
- 0x5587, pci_device_114a_5587,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114a_5587,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114a_6504 = {
- 0x6504, pci_device_114a_6504,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114a_6504,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114a_7587 = {
- 0x7587, pci_device_114a_7587,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114a_7587,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_114f_0002 = {
- 0x0002, pci_device_114f_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0003 = {
- 0x0003, pci_device_114f_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0004 = {
- 0x0004, pci_device_114f_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0005 = {
- 0x0005, pci_device_114f_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0006 = {
- 0x0006, pci_device_114f_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0009 = {
- 0x0009, pci_device_114f_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_000a = {
- 0x000a, pci_device_114f_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_000c = {
- 0x000c, pci_device_114f_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_000d = {
- 0x000d, pci_device_114f_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0011 = {
- 0x0011, pci_device_114f_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0012 = {
- 0x0012, pci_device_114f_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0013 = {
- 0x0013, pci_device_114f_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0014 = {
- 0x0014, pci_device_114f_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0015 = {
- 0x0015, pci_device_114f_0015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0016 = {
- 0x0016, pci_device_114f_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0017 = {
- 0x0017, pci_device_114f_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_001a = {
- 0x001a, pci_device_114f_001a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_001a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_001b = {
- 0x001b, pci_device_114f_001b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_001b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_001d = {
- 0x001d, pci_device_114f_001d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_001d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0023 = {
- 0x0023, pci_device_114f_0023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0024 = {
- 0x0024, pci_device_114f_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0026 = {
- 0x0026, pci_device_114f_0026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0027 = {
- 0x0027, pci_device_114f_0027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0034 = {
- 0x0034, pci_device_114f_0034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0035 = {
- 0x0035, pci_device_114f_0035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0040 = {
- 0x0040, pci_device_114f_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0042 = {
- 0x0042, pci_device_114f_0042,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0042,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0070 = {
- 0x0070, pci_device_114f_0070,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0070,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0071 = {
- 0x0071, pci_device_114f_0071,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0071,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0072 = {
- 0x0072, pci_device_114f_0072,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0072,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_0073 = {
- 0x0073, pci_device_114f_0073,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_0073,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_114f_6001 = {
- 0x6001, pci_device_114f_6001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_114f_6001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1158_3011 = {
- 0x3011, pci_device_1158_3011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1158_3011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1158_9050 = {
- 0x9050, pci_device_1158_9050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1158_9050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1158_9051 = {
- 0x9051, pci_device_1158_9051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1158_9051,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1159_0001 = {
- 0x0001, pci_device_1159_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1159_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_115d_0003 = {
- 0x0003, pci_device_115d_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_0005 = {
- 0x0005, pci_device_115d_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_0007 = {
- 0x0007, pci_device_115d_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_000b = {
- 0x000b, pci_device_115d_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_000c = {
- 0x000c, pci_device_115d_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_000f = {
- 0x000f, pci_device_115d_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_000f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_0101 = {
- 0x0101, pci_device_115d_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_115d_0103 = {
- 0x0103, pci_device_115d_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_115d_0103,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_1163_0001 = {
- 0x0001, pci_device_1163_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1163_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1163_2000 = {
- 0x2000, pci_device_1163_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1163_2000,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1165_0001 = {
- 0x0001, pci_device_1165_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1165_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1166_0005 = {
- 0x0005, pci_device_1166_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0006 = {
- 0x0006, pci_device_1166_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0007 = {
- 0x0007, pci_device_1166_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0008 = {
- 0x0008, pci_device_1166_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0009 = {
- 0x0009, pci_device_1166_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0010 = {
- 0x0010, pci_device_1166_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0011 = {
- 0x0011, pci_device_1166_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0012 = {
- 0x0012, pci_device_1166_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0013 = {
- 0x0013, pci_device_1166_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0014 = {
- 0x0014, pci_device_1166_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0015 = {
- 0x0015, pci_device_1166_0015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0016 = {
- 0x0016, pci_device_1166_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0017 = {
- 0x0017, pci_device_1166_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0200 = {
- 0x0200, pci_device_1166_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0201 = {
- 0x0201, pci_device_1166_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0203 = {
- 0x0203, pci_device_1166_0203,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0203,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0211 = {
- 0x0211, pci_device_1166_0211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0212 = {
- 0x0212, pci_device_1166_0212,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0212,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0213 = {
- 0x0213, pci_device_1166_0213,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0213,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0220 = {
- 0x0220, pci_device_1166_0220,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0220,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0221 = {
- 0x0221, pci_device_1166_0221,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0221,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0225 = {
- 0x0225, pci_device_1166_0225,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0225,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1166_0227 = {
- 0x0227, pci_device_1166_0227,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1166_0227,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_116a_6100 = {
- 0x6100, pci_device_116a_6100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_116a_6100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_116a_6800 = {
- 0x6800, pci_device_116a_6800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_116a_6800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_116a_7100 = {
- 0x7100, pci_device_116a_7100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_116a_7100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_116a_7800 = {
- 0x7800, pci_device_116a_7800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_116a_7800,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1178_afa1 = {
- 0xafa1, pci_device_1178_afa1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1178_afa1,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1179_0103 = {
- 0x0103, pci_device_1179_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0404 = {
- 0x0404, pci_device_1179_0404,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0404,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0406 = {
- 0x0406, pci_device_1179_0406,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0406,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0407 = {
- 0x0407, pci_device_1179_0407,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0407,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0601 = {
- 0x0601, pci_device_1179_0601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0603 = {
- 0x0603, pci_device_1179_0603,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0603,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_060a = {
- 0x060a, pci_device_1179_060a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_060a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_060f = {
- 0x060f, pci_device_1179_060f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_060f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0617 = {
- 0x0617, pci_device_1179_0617,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0617,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0618 = {
- 0x0618, pci_device_1179_0618,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0618,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0701 = {
- 0x0701, pci_device_1179_0701,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0701,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0804 = {
- 0x0804, pci_device_1179_0804,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0804,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0805 = {
- 0x0805, pci_device_1179_0805,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0805,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1179_0d01 = {
- 0x0d01, pci_device_1179_0d01,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1179_0d01,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1180_0465 = {
- 0x0465, pci_device_1180_0465,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0465,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0466 = {
- 0x0466, pci_device_1180_0466,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0466,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0475 = {
- 0x0475, pci_device_1180_0475,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0475,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0476 = {
- 0x0476, pci_device_1180_0476,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0476,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0477 = {
- 0x0477, pci_device_1180_0477,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0477,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0478 = {
- 0x0478, pci_device_1180_0478,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0478,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0522 = {
- 0x0522, pci_device_1180_0522,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0522,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0551 = {
- 0x0551, pci_device_1180_0551,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0551,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1180_0552 = {
- 0x0552, pci_device_1180_0552,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1180_0552,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1186_0100 = {
- 0x0100, pci_device_1186_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1186_1002 = {
- 0x1002, pci_device_1186_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1186_1300 = {
- 0x1300, pci_device_1186_1300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_1300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1186_1340 = {
- 0x1340, pci_device_1186_1340,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_1340,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1186_1561 = {
- 0x1561, pci_device_1186_1561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_1561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1186_4000 = {
- 0x4000, pci_device_1186_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1186_4000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_118c_0014 = {
- 0x0014, pci_device_118c_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118c_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118c_1117 = {
- 0x1117, pci_device_118c_1117,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118c_1117,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_118d_0001 = {
- 0x0001, pci_device_118d_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0012 = {
- 0x0012, pci_device_118d_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0014 = {
- 0x0014, pci_device_118d_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0024 = {
- 0x0024, pci_device_118d_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0044 = {
- 0x0044, pci_device_118d_0044,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0044,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0112 = {
- 0x0112, pci_device_118d_0112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0114 = {
- 0x0114, pci_device_118d_0114,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0114,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0124 = {
- 0x0124, pci_device_118d_0124,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0124,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0144 = {
- 0x0144, pci_device_118d_0144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0212 = {
- 0x0212, pci_device_118d_0212,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0212,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0214 = {
- 0x0214, pci_device_118d_0214,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0214,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0224 = {
- 0x0224, pci_device_118d_0224,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0224,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0244 = {
- 0x0244, pci_device_118d_0244,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0244,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0312 = {
- 0x0312, pci_device_118d_0312,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0312,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0314 = {
- 0x0314, pci_device_118d_0314,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0314,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0324 = {
- 0x0324, pci_device_118d_0324,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0324,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_118d_0344 = {
- 0x0344, pci_device_118d_0344,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_118d_0344,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1190_c731 = {
- 0xc731, pci_device_1190_c731,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1190_c731,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1191_0003 = {
- 0x0003, pci_device_1191_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0004 = {
- 0x0004, pci_device_1191_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0005 = {
- 0x0005, pci_device_1191_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0006 = {
- 0x0006, pci_device_1191_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0007 = {
- 0x0007, pci_device_1191_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0008 = {
- 0x0008, pci_device_1191_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_0009 = {
- 0x0009, pci_device_1191_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8002 = {
- 0x8002, pci_device_1191_8002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8010 = {
- 0x8010, pci_device_1191_8010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8020 = {
- 0x8020, pci_device_1191_8020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8030 = {
- 0x8030, pci_device_1191_8030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8040 = {
- 0x8040, pci_device_1191_8040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1191_8050 = {
- 0x8050, pci_device_1191_8050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1191_8050,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1193_0001 = {
- 0x0001, pci_device_1193_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1193_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1193_0002 = {
- 0x0002, pci_device_1193_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1193_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_119b_1221 = {
- 0x1221, pci_device_119b_1221,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_119b_1221,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_119e_0001 = {
- 0x0001, pci_device_119e_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_119e_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_119e_0003 = {
- 0x0003, pci_device_119e_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_119e_0003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11a9_4240 = {
- 0x4240, pci_device_11a9_4240,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11a9_4240,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11ab_0146 = {
- 0x0146, pci_device_11ab_0146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ab_0146,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11ab_4611 = {
- 0x4611, pci_device_11ab_4611,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ab_4611,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11ab_4620 = {
- 0x4620, pci_device_11ab_4620,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ab_4620,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11ab_4801 = {
- 0x4801, pci_device_11ab_4801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ab_4801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11ab_f003 = {
- 0xf003, pci_device_11ab_f003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ab_f003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11ad_0002 = {
- 0x0002, pci_device_11ad_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ad_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11ad_c115 = {
- 0xc115, pci_device_11ad_c115,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11ad_c115,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11b0_0002 = {
- 0x0002, pci_device_11b0_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b0_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11b0_0292 = {
- 0x0292, pci_device_11b0_0292,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b0_0292,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11b0_0960 = {
- 0x0960, pci_device_11b0_0960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b0_0960,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11b0_c960 = {
- 0xc960, pci_device_11b0_c960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b0_c960,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11b8_0001 = {
- 0x0001, pci_device_11b8_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b8_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11b9_c0ed = {
- 0xc0ed, pci_device_11b9_c0ed,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11b9_c0ed,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11bc_0001 = {
- 0x0001, pci_device_11bc_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11bc_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11c1_0440 = {
- 0x0440, pci_device_11c1_0440,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0440,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0441 = {
- 0x0441, pci_device_11c1_0441,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0441,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0442 = {
- 0x0442, pci_device_11c1_0442,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0442,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0443 = {
- 0x0443, pci_device_11c1_0443,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0443,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0444 = {
- 0x0444, pci_device_11c1_0444,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0444,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0445 = {
- 0x0445, pci_device_11c1_0445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0446 = {
- 0x0446, pci_device_11c1_0446,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0446,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0447 = {
- 0x0447, pci_device_11c1_0447,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0447,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0448 = {
- 0x0448, pci_device_11c1_0448,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0448,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0449 = {
- 0x0449, pci_device_11c1_0449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0449,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044a = {
- 0x044a, pci_device_11c1_044a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044b = {
- 0x044b, pci_device_11c1_044b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044c = {
- 0x044c, pci_device_11c1_044c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044d = {
- 0x044d, pci_device_11c1_044d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044e = {
- 0x044e, pci_device_11c1_044e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_044f = {
- 0x044f, pci_device_11c1_044f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_044f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0450 = {
- 0x0450, pci_device_11c1_0450,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0450,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0451 = {
- 0x0451, pci_device_11c1_0451,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0451,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0452 = {
- 0x0452, pci_device_11c1_0452,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0452,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0453 = {
- 0x0453, pci_device_11c1_0453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0454 = {
- 0x0454, pci_device_11c1_0454,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0454,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0455 = {
- 0x0455, pci_device_11c1_0455,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0455,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0456 = {
- 0x0456, pci_device_11c1_0456,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0456,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0457 = {
- 0x0457, pci_device_11c1_0457,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0457,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0458 = {
- 0x0458, pci_device_11c1_0458,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0458,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0459 = {
- 0x0459, pci_device_11c1_0459,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0459,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_045a = {
- 0x045a, pci_device_11c1_045a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_045a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_045c = {
- 0x045c, pci_device_11c1_045c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_045c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0461 = {
- 0x0461, pci_device_11c1_0461,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0461,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0462 = {
- 0x0462, pci_device_11c1_0462,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0462,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_0480 = {
- 0x0480, pci_device_11c1_0480,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_0480,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_5801 = {
- 0x5801, pci_device_11c1_5801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_5801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_5802 = {
- 0x5802, pci_device_11c1_5802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_5802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_5803 = {
- 0x5803, pci_device_11c1_5803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_5803,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c1_5811 = {
- 0x5811, pci_device_11c1_5811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c1_5811,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11c8_0658 = {
- 0x0658, pci_device_11c8_0658,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c8_0658,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c8_d665 = {
- 0xd665, pci_device_11c8_d665,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c8_d665,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c8_d667 = {
- 0xd667, pci_device_11c8_d667,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c8_d667,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11c9_0010 = {
- 0x0010, pci_device_11c9_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c9_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11c9_0011 = {
- 0x0011, pci_device_11c9_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11c9_0011,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11cb_2000 = {
- 0x2000, pci_device_11cb_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11cb_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11cb_4000 = {
- 0x4000, pci_device_11cb_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11cb_4000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11cb_8000 = {
- 0x8000, pci_device_11cb_8000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11cb_8000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11d1_01f7 = {
- 0x01f7, pci_device_11d1_01f7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11d1_01f7,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11d4_1805 = {
- 0x1805, pci_device_11d4_1805,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11d4_1805,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11d4_1889 = {
- 0x1889, pci_device_11d4_1889,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11d4_1889,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11d5_0115 = {
- 0x0115, pci_device_11d5_0115,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11d5_0115,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11d5_0117 = {
- 0x0117, pci_device_11d5_0117,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11d5_0117,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11de_6057 = {
- 0x6057, pci_device_11de_6057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11de_6057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11de_6120 = {
- 0x6120, pci_device_11de_6120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11de_6120,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11e3_5030 = {
- 0x5030, pci_device_11e3_5030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11e3_5030,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11f0_4231 = {
- 0x4231, pci_device_11f0_4231,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4231,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4232 = {
- 0x4232, pci_device_11f0_4232,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4232,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4233 = {
- 0x4233, pci_device_11f0_4233,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4233,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4234 = {
- 0x4234, pci_device_11f0_4234,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4234,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4235 = {
- 0x4235, pci_device_11f0_4235,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4235,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4236 = {
- 0x4236, pci_device_11f0_4236,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4236,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f0_4731 = {
- 0x4731, pci_device_11f0_4731,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f0_4731,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11f4_2915 = {
- 0x2915, pci_device_11f4_2915,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f4_2915,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11f6_0112 = {
- 0x0112, pci_device_11f6_0112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_0112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f6_0113 = {
- 0x0113, pci_device_11f6_0113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_0113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f6_1401 = {
- 0x1401, pci_device_11f6_1401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_1401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f6_2011 = {
- 0x2011, pci_device_11f6_2011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_2011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f6_2201 = {
- 0x2201, pci_device_11f6_2201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_2201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11f6_9881 = {
- 0x9881, pci_device_11f6_9881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f6_9881,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11f8_7375 = {
- 0x7375, pci_device_11f8_7375,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11f8_7375,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_11fe_0001 = {
- 0x0001, pci_device_11fe_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0002 = {
- 0x0002, pci_device_11fe_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0003 = {
- 0x0003, pci_device_11fe_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0004 = {
- 0x0004, pci_device_11fe_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0005 = {
- 0x0005, pci_device_11fe_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0006 = {
- 0x0006, pci_device_11fe_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0007 = {
- 0x0007, pci_device_11fe_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0008 = {
- 0x0008, pci_device_11fe_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_0009 = {
- 0x0009, pci_device_11fe_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_000a = {
- 0x000a, pci_device_11fe_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_000b = {
- 0x000b, pci_device_11fe_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_000c = {
- 0x000c, pci_device_11fe_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_11fe_8015 = {
- 0x8015, pci_device_11fe_8015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_11fe_8015,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1202_4300 = {
- 0x4300, pci_device_1202_4300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1202_4300,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1208_4853 = {
- 0x4853, pci_device_1208_4853,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1208_4853,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_120e_0100 = {
- 0x0100, pci_device_120e_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0101 = {
- 0x0101, pci_device_120e_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0102 = {
- 0x0102, pci_device_120e_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0103 = {
- 0x0103, pci_device_120e_0103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0103,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0104 = {
- 0x0104, pci_device_120e_0104,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0104,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0105 = {
- 0x0105, pci_device_120e_0105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0200 = {
- 0x0200, pci_device_120e_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0201 = {
- 0x0201, pci_device_120e_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0300 = {
- 0x0300, pci_device_120e_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0301 = {
- 0x0301, pci_device_120e_0301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0310 = {
- 0x0310, pci_device_120e_0310,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0310,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0311 = {
- 0x0311, pci_device_120e_0311,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0311,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0320 = {
- 0x0320, pci_device_120e_0320,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0320,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0321 = {
- 0x0321, pci_device_120e_0321,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0321,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_120e_0400 = {
- 0x0400, pci_device_120e_0400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120e_0400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_120f_0001 = {
- 0x0001, pci_device_120f_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_120f_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1217_6729 = {
- 0x6729, pci_device_1217_6729,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6729,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_673a = {
- 0x673a, pci_device_1217_673a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_673a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6832 = {
- 0x6832, pci_device_1217_6832,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6832,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6836 = {
- 0x6836, pci_device_1217_6836,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6836,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6872 = {
- 0x6872, pci_device_1217_6872,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6872,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6925 = {
- 0x6925, pci_device_1217_6925,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6925,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6933 = {
- 0x6933, pci_device_1217_6933,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6933,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1217_6972 = {
- 0x6972, pci_device_1217_6972,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1217_6972,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_121a_0001 = {
- 0x0001, pci_device_121a_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0002 = {
- 0x0002, pci_device_121a_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0003 = {
- 0x0003, pci_device_121a_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0004 = {
- 0x0004, pci_device_121a_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0005 = {
- 0x0005, pci_device_121a_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0009 = {
- 0x0009, pci_device_121a_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_121a_0057 = {
- 0x0057, pci_device_121a_0057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_121a_0057,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1220_1220 = {
- 0x1220, pci_device_1220_1220,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1220_1220,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1223_0003 = {
- 0x0003, pci_device_1223_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_0004 = {
- 0x0004, pci_device_1223_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_0005 = {
- 0x0005, pci_device_1223_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_0008 = {
- 0x0008, pci_device_1223_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_0009 = {
- 0x0009, pci_device_1223_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_000a = {
- 0x000a, pci_device_1223_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_000b = {
- 0x000b, pci_device_1223_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_000c = {
- 0x000c, pci_device_1223_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_000d = {
- 0x000d, pci_device_1223_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1223_000e = {
- 0x000e, pci_device_1223_000e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1223_000e,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_122d_1206 = {
- 0x1206, pci_device_122d_1206,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_122d_1206,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_122d_50dc = {
- 0x50dc, pci_device_122d_50dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_122d_50dc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_122d_80da = {
- 0x80da, pci_device_122d_80da,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_122d_80da,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1236_0000 = {
- 0x0000, pci_device_1236_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1236_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1236_6401 = {
- 0x6401, pci_device_1236_6401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1236_6401,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_123d_0000 = {
- 0x0000, pci_device_123d_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123d_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_123d_0002 = {
- 0x0002, pci_device_123d_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123d_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_123d_0003 = {
- 0x0003, pci_device_123d_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123d_0003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_123f_00e4 = {
- 0x00e4, pci_device_123f_00e4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123f_00e4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_123f_8120 = {
- 0x8120, pci_device_123f_8120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123f_8120,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_123f_8888 = {
- 0x8888, pci_device_123f_8888,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_123f_8888,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1242_1560 = {
- 0x1560, pci_device_1242_1560,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1242_1560,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1242_4643 = {
- 0x4643, pci_device_1242_4643,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1242_4643,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1244_0700 = {
- 0x0700, pci_device_1244_0700,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_0700,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1244_0800 = {
- 0x0800, pci_device_1244_0800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_0800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1244_0a00 = {
- 0x0a00, pci_device_1244_0a00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_0a00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1244_0e00 = {
- 0x0e00, pci_device_1244_0e00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_0e00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1244_1100 = {
- 0x1100, pci_device_1244_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_1100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1244_1200 = {
- 0x1200, pci_device_1244_1200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1244_1200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_124b_0040 = {
- 0x0040, pci_device_124b_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124b_0040,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_124d_0000 = {
- 0x0000, pci_device_124d_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124d_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_124d_0002 = {
- 0x0002, pci_device_124d_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124d_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_124d_0003 = {
- 0x0003, pci_device_124d_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124d_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_124d_0004 = {
- 0x0004, pci_device_124d_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124d_0004,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_124f_0041 = {
- 0x0041, pci_device_124f_0041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_124f_0041,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1255_1110 = {
- 0x1110, pci_device_1255_1110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1255_1110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1255_1210 = {
- 0x1210, pci_device_1255_1210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1255_1210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1255_2110 = {
- 0x2110, pci_device_1255_2110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1255_2110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1255_2120 = {
- 0x2120, pci_device_1255_2120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1255_2120,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1255_2130 = {
- 0x2130, pci_device_1255_2130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1255_2130,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1256_4201 = {
- 0x4201, pci_device_1256_4201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1256_4201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1256_4401 = {
- 0x4401, pci_device_1256_4401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1256_4401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1256_5201 = {
- 0x5201, pci_device_1256_5201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1256_5201,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1259_2560 = {
- 0x2560, pci_device_1259_2560,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1259_2560,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_125b_1400 = {
- 0x1400, pci_device_125b_1400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125b_1400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_125c_0640 = {
- 0x0640, pci_device_125c_0640,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125c_0640,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_125d_0000 = {
- 0x0000, pci_device_125d_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1948 = {
- 0x1948, pci_device_125d_1948,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1948,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1968 = {
- 0x1968, pci_device_125d_1968,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1968,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1969 = {
- 0x1969, pci_device_125d_1969,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1969,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1978 = {
- 0x1978, pci_device_125d_1978,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1978,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1988 = {
- 0x1988, pci_device_125d_1988,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1988,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1989 = {
- 0x1989, pci_device_125d_1989,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1989,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1998 = {
- 0x1998, pci_device_125d_1998,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1998,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_1999 = {
- 0x1999, pci_device_125d_1999,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_1999,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_199a = {
- 0x199a, pci_device_125d_199a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_199a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_199b = {
- 0x199b, pci_device_125d_199b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_199b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_2808 = {
- 0x2808, pci_device_125d_2808,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_2808,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_2838 = {
- 0x2838, pci_device_125d_2838,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_2838,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_125d_2898 = {
- 0x2898, pci_device_125d_2898,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_125d_2898,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1260_3873 = {
- 0x3873, pci_device_1260_3873,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1260_3873,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1260_3890 = {
- 0x3890, pci_device_1260_3890,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1260_3890,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1260_8130 = {
- 0x8130, pci_device_1260_8130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1260_8130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1260_8131 = {
- 0x8131, pci_device_1260_8131,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1260_8131,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1266_0001 = {
- 0x0001, pci_device_1266_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1266_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1266_1910 = {
- 0x1910, pci_device_1266_1910,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1266_1910,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1267_5352 = {
- 0x5352, pci_device_1267_5352,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1267_5352,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1267_5a4b = {
- 0x5a4b, pci_device_1267_5a4b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1267_5a4b,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_126f_0710 = {
- 0x0710, pci_device_126f_0710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0710,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0712 = {
- 0x0712, pci_device_126f_0712,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0712,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0720 = {
- 0x0720, pci_device_126f_0720,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0720,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0730 = {
- 0x0730, pci_device_126f_0730,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0730,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0810 = {
- 0x0810, pci_device_126f_0810,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0810,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0811 = {
- 0x0811, pci_device_126f_0811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0811,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0820 = {
- 0x0820, pci_device_126f_0820,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0820,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_126f_0910 = {
- 0x0910, pci_device_126f_0910,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_126f_0910,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1273_0002 = {
- 0x0002, pci_device_1273_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1273_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1274_1171 = {
- 0x1171, pci_device_1274_1171,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1274_1171,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1274_1371 = {
- 0x1371, pci_device_1274_1371,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1274_1371,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1274_5000 = {
- 0x5000, pci_device_1274_5000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1274_5000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1274_5880 = {
- 0x5880, pci_device_1274_5880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1274_5880,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1278_0701 = {
- 0x0701, pci_device_1278_0701,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1278_0701,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1278_0710 = {
- 0x0710, pci_device_1278_0710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1278_0710,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1279_0295 = {
- 0x0295, pci_device_1279_0295,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1279_0295,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1279_0395 = {
- 0x0395, pci_device_1279_0395,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1279_0395,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1279_0396 = {
- 0x0396, pci_device_1279_0396,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1279_0396,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1279_0397 = {
- 0x0397, pci_device_1279_0397,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1279_0397,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_127a_1002 = {
- 0x1002, pci_device_127a_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1003 = {
- 0x1003, pci_device_127a_1003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1004 = {
- 0x1004, pci_device_127a_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1005 = {
- 0x1005, pci_device_127a_1005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1022 = {
- 0x1022, pci_device_127a_1022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1023 = {
- 0x1023, pci_device_127a_1023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1024 = {
- 0x1024, pci_device_127a_1024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1025 = {
- 0x1025, pci_device_127a_1025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1026 = {
- 0x1026, pci_device_127a_1026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1032 = {
- 0x1032, pci_device_127a_1032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1033 = {
- 0x1033, pci_device_127a_1033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1034 = {
- 0x1034, pci_device_127a_1034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1035 = {
- 0x1035, pci_device_127a_1035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1036 = {
- 0x1036, pci_device_127a_1036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_1085 = {
- 0x1085, pci_device_127a_1085,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_1085,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_2005 = {
- 0x2005, pci_device_127a_2005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_2005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_2013 = {
- 0x2013, pci_device_127a_2013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_2013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_2014 = {
- 0x2014, pci_device_127a_2014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_2014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_2015 = {
- 0x2015, pci_device_127a_2015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_2015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_2016 = {
- 0x2016, pci_device_127a_2016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_2016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_4311 = {
- 0x4311, pci_device_127a_4311,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_4311,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_4320 = {
- 0x4320, pci_device_127a_4320,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_4320,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_4321 = {
- 0x4321, pci_device_127a_4321,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_4321,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_4322 = {
- 0x4322, pci_device_127a_4322,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_4322,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_127a_8234 = {
- 0x8234, pci_device_127a_8234,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_127a_8234,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1282_9009 = {
- 0x9009, pci_device_1282_9009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1282_9009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1282_9100 = {
- 0x9100, pci_device_1282_9100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1282_9100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1282_9102 = {
- 0x9102, pci_device_1282_9102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1282_9102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1282_9132 = {
- 0x9132, pci_device_1282_9132,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1282_9132,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1283_673a = {
- 0x673a, pci_device_1283_673a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1283_673a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1283_8330 = {
- 0x8330, pci_device_1283_8330,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1283_8330,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1283_8888 = {
- 0x8888, pci_device_1283_8888,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1283_8888,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1283_8889 = {
- 0x8889, pci_device_1283_8889,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1283_8889,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1283_e886 = {
- 0xe886, pci_device_1283_e886,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1283_e886,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1285_0100 = {
- 0x0100, pci_device_1285_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1285_0100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1287_001e = {
- 0x001e, pci_device_1287_001e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1287_001e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1287_001f = {
- 0x001f, pci_device_1287_001f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1287_001f,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_128d_0021 = {
- 0x0021, pci_device_128d_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128d_0021,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_128e_0008 = {
- 0x0008, pci_device_128e_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128e_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_128e_0009 = {
- 0x0009, pci_device_128e_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128e_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_128e_000a = {
- 0x000a, pci_device_128e_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128e_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_128e_000b = {
- 0x000b, pci_device_128e_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128e_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_128e_000c = {
- 0x000c, pci_device_128e_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_128e_000c,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_129a_0615 = {
- 0x0615, pci_device_129a_0615,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_129a_0615,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12ab_3000 = {
- 0x3000, pci_device_12ab_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12ab_3000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12ae_0001 = {
- 0x0001, pci_device_12ae_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12ae_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12ae_0002 = {
- 0x0002, pci_device_12ae_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12ae_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12b9_1006 = {
- 0x1006, pci_device_12b9_1006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12b9_1006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12b9_1007 = {
- 0x1007, pci_device_12b9_1007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12b9_1007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12b9_1008 = {
- 0x1008, pci_device_12b9_1008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12b9_1008,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12be_3041 = {
- 0x3041, pci_device_12be_3041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12be_3041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12be_3042 = {
- 0x3042, pci_device_12be_3042,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12be_3042,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12c3_0058 = {
- 0x0058, pci_device_12c3_0058,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c3_0058,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12c3_5598 = {
- 0x5598, pci_device_12c3_5598,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c3_5598,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12c5_007e = {
- 0x007e, pci_device_12c5_007e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c5_007e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12c5_007f = {
- 0x007f, pci_device_12c5_007f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c5_007f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12c5_0081 = {
- 0x0081, pci_device_12c5_0081,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c5_0081,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12c5_0085 = {
- 0x0085, pci_device_12c5_0085,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c5_0085,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12c5_0086 = {
- 0x0086, pci_device_12c5_0086,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12c5_0086,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_12d2_0008 = {
- 0x0008, pci_device_12d2_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0009 = {
- 0x0009, pci_device_12d2_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0018 = {
- 0x0018, pci_device_12d2_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0019 = {
- 0x0019, pci_device_12d2_0019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0020 = {
- 0x0020, pci_device_12d2_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0028 = {
- 0x0028, pci_device_12d2_0028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_0029 = {
- 0x0029, pci_device_12d2_0029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_0029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_002c = {
- 0x002c, pci_device_12d2_002c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_002c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d2_00a0 = {
- 0x00a0, pci_device_12d2_00a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d2_00a0,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12d4_0200 = {
- 0x0200, pci_device_12d4_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d4_0200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12d9_0002 = {
- 0x0002, pci_device_12d9_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d9_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12d9_0004 = {
- 0x0004, pci_device_12d9_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12d9_0004,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12e0_0010 = {
- 0x0010, pci_device_12e0_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12e0_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12e0_0020 = {
- 0x0020, pci_device_12e0_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12e0_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12e0_0030 = {
- 0x0030, pci_device_12e0_0030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12e0_0030,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12eb_0001 = {
- 0x0001, pci_device_12eb_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12eb_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12eb_0002 = {
- 0x0002, pci_device_12eb_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12eb_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12eb_0003 = {
- 0x0003, pci_device_12eb_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12eb_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_12eb_8803 = {
- 0x8803, pci_device_12eb_8803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12eb_8803,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_12f8_0002 = {
- 0x0002, pci_device_12f8_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_12f8_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1307_0001 = {
- 0x0001, pci_device_1307_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_000b = {
- 0x000b, pci_device_1307_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_000b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_000c = {
- 0x000c, pci_device_1307_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_000d = {
- 0x000d, pci_device_1307_000d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_000d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_000f = {
- 0x000f, pci_device_1307_000f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_000f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0010 = {
- 0x0010, pci_device_1307_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0014 = {
- 0x0014, pci_device_1307_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0015 = {
- 0x0015, pci_device_1307_0015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0016 = {
- 0x0016, pci_device_1307_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0017 = {
- 0x0017, pci_device_1307_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0018 = {
- 0x0018, pci_device_1307_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0018,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0019 = {
- 0x0019, pci_device_1307_0019,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0019,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001a = {
- 0x001a, pci_device_1307_001a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001b = {
- 0x001b, pci_device_1307_001b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001c = {
- 0x001c, pci_device_1307_001c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001d = {
- 0x001d, pci_device_1307_001d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001e = {
- 0x001e, pci_device_1307_001e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_001f = {
- 0x001f, pci_device_1307_001f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_001f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0020 = {
- 0x0020, pci_device_1307_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0021 = {
- 0x0021, pci_device_1307_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0022 = {
- 0x0022, pci_device_1307_0022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0023 = {
- 0x0023, pci_device_1307_0023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0024 = {
- 0x0024, pci_device_1307_0024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0025 = {
- 0x0025, pci_device_1307_0025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0026 = {
- 0x0026, pci_device_1307_0026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0027 = {
- 0x0027, pci_device_1307_0027,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0027,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0028 = {
- 0x0028, pci_device_1307_0028,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0028,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0029 = {
- 0x0029, pci_device_1307_0029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_002c = {
- 0x002c, pci_device_1307_002c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_002c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0033 = {
- 0x0033, pci_device_1307_0033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0034 = {
- 0x0034, pci_device_1307_0034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0035 = {
- 0x0035, pci_device_1307_0035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0036 = {
- 0x0036, pci_device_1307_0036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_0037 = {
- 0x0037, pci_device_1307_0037,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_0037,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_004c = {
- 0x004c, pci_device_1307_004c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_004c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1307_004d = {
- 0x004d, pci_device_1307_004d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1307_004d,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1308_0001 = {
- 0x0001, pci_device_1308_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1308_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1317_0981 = {
- 0x0981, pci_device_1317_0981,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1317_0981,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1317_0985 = {
- 0x0985, pci_device_1317_0985,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1317_0985,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1317_1985 = {
- 0x1985, pci_device_1317_1985,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1317_1985,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1318_0911 = {
- 0x0911, pci_device_1318_0911,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1318_0911,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1319_0801 = {
- 0x0801, pci_device_1319_0801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1319_0801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1319_0802 = {
- 0x0802, pci_device_1319_0802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1319_0802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1319_1000 = {
- 0x1000, pci_device_1319_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1319_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1319_1001 = {
- 0x1001, pci_device_1319_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1319_1001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_131f_1000 = {
- 0x1000, pci_device_131f_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1001 = {
- 0x1001, pci_device_131f_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1002 = {
- 0x1002, pci_device_131f_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1010 = {
- 0x1010, pci_device_131f_1010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1011 = {
- 0x1011, pci_device_131f_1011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1012 = {
- 0x1012, pci_device_131f_1012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1020 = {
- 0x1020, pci_device_131f_1020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1021 = {
- 0x1021, pci_device_131f_1021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1030 = {
- 0x1030, pci_device_131f_1030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1031 = {
- 0x1031, pci_device_131f_1031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1032 = {
- 0x1032, pci_device_131f_1032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1034 = {
- 0x1034, pci_device_131f_1034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1035 = {
- 0x1035, pci_device_131f_1035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1036 = {
- 0x1036, pci_device_131f_1036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1050 = {
- 0x1050, pci_device_131f_1050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1051 = {
- 0x1051, pci_device_131f_1051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_1052 = {
- 0x1052, pci_device_131f_1052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_1052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2000 = {
- 0x2000, pci_device_131f_2000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2001 = {
- 0x2001, pci_device_131f_2001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2002 = {
- 0x2002, pci_device_131f_2002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2010 = {
- 0x2010, pci_device_131f_2010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2011 = {
- 0x2011, pci_device_131f_2011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2012 = {
- 0x2012, pci_device_131f_2012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2020 = {
- 0x2020, pci_device_131f_2020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2021 = {
- 0x2021, pci_device_131f_2021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2030 = {
- 0x2030, pci_device_131f_2030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2031 = {
- 0x2031, pci_device_131f_2031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2032 = {
- 0x2032, pci_device_131f_2032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2040 = {
- 0x2040, pci_device_131f_2040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2041 = {
- 0x2041, pci_device_131f_2041,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2041,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2042 = {
- 0x2042, pci_device_131f_2042,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2042,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2050 = {
- 0x2050, pci_device_131f_2050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2051 = {
- 0x2051, pci_device_131f_2051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2052 = {
- 0x2052, pci_device_131f_2052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2060 = {
- 0x2060, pci_device_131f_2060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2061 = {
- 0x2061, pci_device_131f_2061,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2061,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_131f_2062 = {
- 0x2062, pci_device_131f_2062,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_131f_2062,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1332_5415 = {
- 0x5415, pci_device_1332_5415,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1332_5415,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1332_5425 = {
- 0x5425, pci_device_1332_5425,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1332_5425,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_134a_0001 = {
- 0x0001, pci_device_134a_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134a_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134a_0002 = {
- 0x0002, pci_device_134a_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134a_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_134d_7890 = {
- 0x7890, pci_device_134d_7890,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7890,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7891 = {
- 0x7891, pci_device_134d_7891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7891,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7892 = {
- 0x7892, pci_device_134d_7892,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7892,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7893 = {
- 0x7893, pci_device_134d_7893,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7893,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7894 = {
- 0x7894, pci_device_134d_7894,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7894,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7895 = {
- 0x7895, pci_device_134d_7895,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7895,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7896 = {
- 0x7896, pci_device_134d_7896,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7896,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_134d_7897 = {
- 0x7897, pci_device_134d_7897,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_134d_7897,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1353_0002 = {
- 0x0002, pci_device_1353_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1353_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1353_0003 = {
- 0x0003, pci_device_1353_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1353_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1353_0004 = {
- 0x0004, pci_device_1353_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1353_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1353_0005 = {
- 0x0005, pci_device_1353_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1353_0005,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_135c_0010 = {
- 0x0010, pci_device_135c_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0020 = {
- 0x0020, pci_device_135c_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0030 = {
- 0x0030, pci_device_135c_0030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0040 = {
- 0x0040, pci_device_135c_0040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0050 = {
- 0x0050, pci_device_135c_0050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0060 = {
- 0x0060, pci_device_135c_0060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_00f0 = {
- 0x00f0, pci_device_135c_00f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_00f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0170 = {
- 0x0170, pci_device_135c_0170,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0170,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0180 = {
- 0x0180, pci_device_135c_0180,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0180,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_0190 = {
- 0x0190, pci_device_135c_0190,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_0190,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_01a0 = {
- 0x01a0, pci_device_135c_01a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_01a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_01b0 = {
- 0x01b0, pci_device_135c_01b0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_01b0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135c_01c0 = {
- 0x01c0, pci_device_135c_01c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135c_01c0,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_135e_7101 = {
- 0x7101, pci_device_135e_7101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_7201 = {
- 0x7201, pci_device_135e_7201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_7202 = {
- 0x7202, pci_device_135e_7202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_7401 = {
- 0x7401, pci_device_135e_7401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_7402 = {
- 0x7402, pci_device_135e_7402,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7402,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_7801 = {
- 0x7801, pci_device_135e_7801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_7801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_135e_8001 = {
- 0x8001, pci_device_135e_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_135e_8001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1385_4100 = {
- 0x4100, pci_device_1385_4100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_4100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1385_4105 = {
- 0x4105, pci_device_1385_4105,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_4105,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1385_620a = {
- 0x620a, pci_device_1385_620a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_620a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1385_622a = {
- 0x622a, pci_device_1385_622a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_622a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1385_630a = {
- 0x630a, pci_device_1385_630a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_630a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1385_f311 = {
- 0xf311, pci_device_1385_f311,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1385_f311,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1389_0001 = {
- 0x0001, pci_device_1389_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1389_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1393_1040 = {
- 0x1040, pci_device_1393_1040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1393_1040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1393_1680 = {
- 0x1680, pci_device_1393_1680,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1393_1680,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1393_2040 = {
- 0x2040, pci_device_1393_2040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1393_2040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1393_2180 = {
- 0x2180, pci_device_1393_2180,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1393_2180,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1393_3200 = {
- 0x3200, pci_device_1393_3200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1393_3200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1394_0001 = {
- 0x0001, pci_device_1394_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1394_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1397_2bd0 = {
- 0x2bd0, pci_device_1397_2bd0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1397_2bd0,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_139a_0001 = {
- 0x0001, pci_device_139a_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_139a_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_139a_0003 = {
- 0x0003, pci_device_139a_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_139a_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_139a_0005 = {
- 0x0005, pci_device_139a_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_139a_0005,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13a3_0005 = {
- 0x0005, pci_device_13a3_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0006 = {
- 0x0006, pci_device_13a3_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0007 = {
- 0x0007, pci_device_13a3_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0012 = {
- 0x0012, pci_device_13a3_0012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0014 = {
- 0x0014, pci_device_13a3_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0016 = {
- 0x0016, pci_device_13a3_0016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0017 = {
- 0x0017, pci_device_13a3_0017,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0017,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13a3_0018 = {
- 0x0018, pci_device_13a3_0018,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a3_0018,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13a8_0158 = {
- 0x0158, pci_device_13a8_0158,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13a8_0158,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13c0_0010 = {
- 0x0010, pci_device_13c0_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13c0_0010,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13c1_1000 = {
- 0x1000, pci_device_13c1_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13c1_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13c1_1001 = {
- 0x1001, pci_device_13c1_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13c1_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13c1_1002 = {
- 0x1002, pci_device_13c1_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13c1_1002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13d0_2103 = {
- 0x2103, pci_device_13d0_2103,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13d0_2103,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13d1_ab02 = {
- 0xab02, pci_device_13d1_ab02,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13d1_ab02,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13d1_ab06 = {
- 0xab06, pci_device_13d1_ab06,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13d1_ab06,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13df_0001 = {
- 0x0001, pci_device_13df_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13df_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13f0_0201 = {
- 0x0201, pci_device_13f0_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f0_0201,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13f4_1401 = {
- 0x1401, pci_device_13f4_1401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f4_1401,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13f6_0100 = {
- 0x0100, pci_device_13f6_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f6_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13f6_0101 = {
- 0x0101, pci_device_13f6_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f6_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13f6_0111 = {
- 0x0111, pci_device_13f6_0111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f6_0111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_13f6_0211 = {
- 0x0211, pci_device_13f6_0211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13f6_0211,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_13fe_1756 = {
- 0x1756, pci_device_13fe_1756,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_13fe_1756,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1400_1401 = {
- 0x1401, pci_device_1400_1401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1400_1401,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1407_0100 = {
- 0x0100, pci_device_1407_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0101 = {
- 0x0101, pci_device_1407_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0102 = {
- 0x0102, pci_device_1407_0102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0200 = {
- 0x0200, pci_device_1407_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0201 = {
- 0x0201, pci_device_1407_0201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0202 = {
- 0x0202, pci_device_1407_0202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0500 = {
- 0x0500, pci_device_1407_0500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_0600 = {
- 0x0600, pci_device_1407_0600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_0600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_8000 = {
- 0x8000, pci_device_1407_8000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_8000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_8001 = {
- 0x8001, pci_device_1407_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_8001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_8002 = {
- 0x8002, pci_device_1407_8002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_8002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_8003 = {
- 0x8003, pci_device_1407_8003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_8003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1407_8800 = {
- 0x8800, pci_device_1407_8800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1407_8800,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1409_7168 = {
- 0x7168, pci_device_1409_7168,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1409_7168,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1412_1712 = {
- 0x1712, pci_device_1412_1712,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1412_1712,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1412_1724 = {
- 0x1724, pci_device_1412_1724,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1412_1724,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1415_8403 = {
- 0x8403, pci_device_1415_8403,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_8403,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1415_9501 = {
- 0x9501, pci_device_1415_9501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_9501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1415_950a = {
- 0x950a, pci_device_1415_950a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_950a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1415_950b = {
- 0x950b, pci_device_1415_950b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_950b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1415_9511 = {
- 0x9511, pci_device_1415_9511,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_9511,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1415_9521 = {
- 0x9521, pci_device_1415_9521,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1415_9521,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_144a_7296 = {
- 0x7296, pci_device_144a_7296,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_7296,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_7432 = {
- 0x7432, pci_device_144a_7432,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_7432,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_7433 = {
- 0x7433, pci_device_144a_7433,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_7433,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_7434 = {
- 0x7434, pci_device_144a_7434,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_7434,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_7841 = {
- 0x7841, pci_device_144a_7841,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_7841,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_8133 = {
- 0x8133, pci_device_144a_8133,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_8133,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_8554 = {
- 0x8554, pci_device_144a_8554,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_8554,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_9111 = {
- 0x9111, pci_device_144a_9111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_9111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_9113 = {
- 0x9113, pci_device_144a_9113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_9113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_144a_9114 = {
- 0x9114, pci_device_144a_9114,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_144a_9114,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_145f_0001 = {
- 0x0001, pci_device_145f_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_145f_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_146c_1430 = {
- 0x1430, pci_device_146c_1430,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_146c_1430,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_148d_1003 = {
- 0x1003, pci_device_148d_1003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_148d_1003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_149d_0001 = {
- 0x0001, pci_device_149d_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_149d_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14af_7102 = {
- 0x7102, pci_device_14af_7102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14af_7102,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14b3_0000 = {
- 0x0000, pci_device_14b3_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b3_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14b5_0200 = {
- 0x0200, pci_device_14b5_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0300 = {
- 0x0300, pci_device_14b5_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0400 = {
- 0x0400, pci_device_14b5_0400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0600 = {
- 0x0600, pci_device_14b5_0600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0800 = {
- 0x0800, pci_device_14b5_0800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0900 = {
- 0x0900, pci_device_14b5_0900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0a00 = {
- 0x0a00, pci_device_14b5_0a00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0a00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b5_0b00 = {
- 0x0b00, pci_device_14b5_0b00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b5_0b00,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14b7_0001 = {
- 0x0001, pci_device_14b7_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b7_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14b9_0001 = {
- 0x0001, pci_device_14b9_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b9_0340 = {
- 0x0340, pci_device_14b9_0340,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_0340,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b9_0350 = {
- 0x0350, pci_device_14b9_0350,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_0350,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b9_4500 = {
- 0x4500, pci_device_14b9_4500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_4500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b9_4800 = {
- 0x4800, pci_device_14b9_4800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_4800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14b9_a504 = {
- 0xa504, pci_device_14b9_a504,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14b9_a504,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14d2_8001 = {
- 0x8001, pci_device_14d2_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8002 = {
- 0x8002, pci_device_14d2_8002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8010 = {
- 0x8010, pci_device_14d2_8010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8011 = {
- 0x8011, pci_device_14d2_8011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8020 = {
- 0x8020, pci_device_14d2_8020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8021 = {
- 0x8021, pci_device_14d2_8021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8040 = {
- 0x8040, pci_device_14d2_8040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_8080 = {
- 0x8080, pci_device_14d2_8080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_8080,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_a000 = {
- 0xa000, pci_device_14d2_a000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_a000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_a001 = {
- 0xa001, pci_device_14d2_a001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_a001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_a003 = {
- 0xa003, pci_device_14d2_a003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_a003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_a004 = {
- 0xa004, pci_device_14d2_a004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_a004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_a005 = {
- 0xa005, pci_device_14d2_a005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_a005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_e001 = {
- 0xe001, pci_device_14d2_e001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_e001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_e010 = {
- 0xe010, pci_device_14d2_e010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_e010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14d2_e020 = {
- 0xe020, pci_device_14d2_e020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14d2_e020,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14db_2120 = {
- 0x2120, pci_device_14db_2120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14db_2120,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14dc_0000 = {
- 0x0000, pci_device_14dc_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0001 = {
- 0x0001, pci_device_14dc_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0002 = {
- 0x0002, pci_device_14dc_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0003 = {
- 0x0003, pci_device_14dc_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0004 = {
- 0x0004, pci_device_14dc_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0005 = {
- 0x0005, pci_device_14dc_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0006 = {
- 0x0006, pci_device_14dc_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0007 = {
- 0x0007, pci_device_14dc_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0008 = {
- 0x0008, pci_device_14dc_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_0009 = {
- 0x0009, pci_device_14dc_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_000a = {
- 0x000a, pci_device_14dc_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14dc_000b = {
- 0x000b, pci_device_14dc_000b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14dc_000b,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14e4_1644 = {
- 0x1644, pci_device_14e4_1644,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1644,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1645 = {
- 0x1645, pci_device_14e4_1645,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1645,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1646 = {
- 0x1646, pci_device_14e4_1646,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1646,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1647 = {
- 0x1647, pci_device_14e4_1647,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1647,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1648 = {
- 0x1648, pci_device_14e4_1648,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1648,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_164d = {
- 0x164d, pci_device_14e4_164d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_164d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1653 = {
- 0x1653, pci_device_14e4_1653,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1653,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_165d = {
- 0x165d, pci_device_14e4_165d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_165d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_1696 = {
- 0x1696, pci_device_14e4_1696,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_1696,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_169c = {
- 0x169c, pci_device_14e4_169c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_169c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_16a6 = {
- 0x16a6, pci_device_14e4_16a6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_16a6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_16a7 = {
- 0x16a7, pci_device_14e4_16a7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_16a7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_16a8 = {
- 0x16a8, pci_device_14e4_16a8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_16a8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_16c6 = {
- 0x16c6, pci_device_14e4_16c6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_16c6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_16c7 = {
- 0x16c7, pci_device_14e4_16c7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_16c7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4210 = {
- 0x4210, pci_device_14e4_4210,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4210,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4211 = {
- 0x4211, pci_device_14e4_4211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4212 = {
- 0x4212, pci_device_14e4_4212,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4212,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4301 = {
- 0x4301, pci_device_14e4_4301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4320 = {
- 0x4320, pci_device_14e4_4320,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4320,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4401 = {
- 0x4401, pci_device_14e4_4401,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4401,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4402 = {
- 0x4402, pci_device_14e4_4402,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4402,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4410 = {
- 0x4410, pci_device_14e4_4410,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4410,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4411 = {
- 0x4411, pci_device_14e4_4411,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4411,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_4412 = {
- 0x4412, pci_device_14e4_4412,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_4412,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_5820 = {
- 0x5820, pci_device_14e4_5820,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_5820,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14e4_5821 = {
- 0x5821, pci_device_14e4_5821,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14e4_5821,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14ea_ab06 = {
- 0xab06, pci_device_14ea_ab06,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14ea_ab06,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_14f1_1002 = {
- 0x1002, pci_device_14f1_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1003 = {
- 0x1003, pci_device_14f1_1003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1004 = {
- 0x1004, pci_device_14f1_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1005 = {
- 0x1005, pci_device_14f1_1005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1006 = {
- 0x1006, pci_device_14f1_1006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1022 = {
- 0x1022, pci_device_14f1_1022,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1022,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1023 = {
- 0x1023, pci_device_14f1_1023,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1023,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1024 = {
- 0x1024, pci_device_14f1_1024,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1024,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1025 = {
- 0x1025, pci_device_14f1_1025,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1025,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1026 = {
- 0x1026, pci_device_14f1_1026,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1026,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1032 = {
- 0x1032, pci_device_14f1_1032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1033 = {
- 0x1033, pci_device_14f1_1033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1034 = {
- 0x1034, pci_device_14f1_1034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1035 = {
- 0x1035, pci_device_14f1_1035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1036 = {
- 0x1036, pci_device_14f1_1036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1052 = {
- 0x1052, pci_device_14f1_1052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1053 = {
- 0x1053, pci_device_14f1_1053,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1053,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1054 = {
- 0x1054, pci_device_14f1_1054,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1054,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1055 = {
- 0x1055, pci_device_14f1_1055,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1055,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1056 = {
- 0x1056, pci_device_14f1_1056,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1056,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1057 = {
- 0x1057, pci_device_14f1_1057,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1057,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1059 = {
- 0x1059, pci_device_14f1_1059,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1059,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1063 = {
- 0x1063, pci_device_14f1_1063,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1063,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1064 = {
- 0x1064, pci_device_14f1_1064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1065 = {
- 0x1065, pci_device_14f1_1065,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1065,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1066 = {
- 0x1066, pci_device_14f1_1066,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1066,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1433 = {
- 0x1433, pci_device_14f1_1433,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1433,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1434 = {
- 0x1434, pci_device_14f1_1434,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1434,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1435 = {
- 0x1435, pci_device_14f1_1435,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1435,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1436 = {
- 0x1436, pci_device_14f1_1436,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1436,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1453 = {
- 0x1453, pci_device_14f1_1453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1454 = {
- 0x1454, pci_device_14f1_1454,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1454,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1455 = {
- 0x1455, pci_device_14f1_1455,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1455,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1456 = {
- 0x1456, pci_device_14f1_1456,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1456,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1610 = {
- 0x1610, pci_device_14f1_1610,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1610,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1611 = {
- 0x1611, pci_device_14f1_1611,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1611,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1620 = {
- 0x1620, pci_device_14f1_1620,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1620,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1621 = {
- 0x1621, pci_device_14f1_1621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1622 = {
- 0x1622, pci_device_14f1_1622,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1622,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1803 = {
- 0x1803, pci_device_14f1_1803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1803,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_1815 = {
- 0x1815, pci_device_14f1_1815,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_1815,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2003 = {
- 0x2003, pci_device_14f1_2003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2004 = {
- 0x2004, pci_device_14f1_2004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2005 = {
- 0x2005, pci_device_14f1_2005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2006 = {
- 0x2006, pci_device_14f1_2006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2013 = {
- 0x2013, pci_device_14f1_2013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2014 = {
- 0x2014, pci_device_14f1_2014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2015 = {
- 0x2015, pci_device_14f1_2015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2016 = {
- 0x2016, pci_device_14f1_2016,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2016,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2043 = {
- 0x2043, pci_device_14f1_2043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2044 = {
- 0x2044, pci_device_14f1_2044,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2044,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2045 = {
- 0x2045, pci_device_14f1_2045,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2045,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2046 = {
- 0x2046, pci_device_14f1_2046,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2046,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2063 = {
- 0x2063, pci_device_14f1_2063,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2063,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2064 = {
- 0x2064, pci_device_14f1_2064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2065 = {
- 0x2065, pci_device_14f1_2065,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2065,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2066 = {
- 0x2066, pci_device_14f1_2066,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2066,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2093 = {
- 0x2093, pci_device_14f1_2093,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2093,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2143 = {
- 0x2143, pci_device_14f1_2143,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2143,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2144 = {
- 0x2144, pci_device_14f1_2144,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2144,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2145 = {
- 0x2145, pci_device_14f1_2145,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2145,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2146 = {
- 0x2146, pci_device_14f1_2146,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2146,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2163 = {
- 0x2163, pci_device_14f1_2163,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2163,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2164 = {
- 0x2164, pci_device_14f1_2164,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2164,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2165 = {
- 0x2165, pci_device_14f1_2165,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2165,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2166 = {
- 0x2166, pci_device_14f1_2166,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2166,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2343 = {
- 0x2343, pci_device_14f1_2343,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2343,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2344 = {
- 0x2344, pci_device_14f1_2344,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2344,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2345 = {
- 0x2345, pci_device_14f1_2345,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2345,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2346 = {
- 0x2346, pci_device_14f1_2346,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2346,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2363 = {
- 0x2363, pci_device_14f1_2363,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2363,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2364 = {
- 0x2364, pci_device_14f1_2364,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2364,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2365 = {
- 0x2365, pci_device_14f1_2365,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2365,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2366 = {
- 0x2366, pci_device_14f1_2366,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2366,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2443 = {
- 0x2443, pci_device_14f1_2443,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2443,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2444 = {
- 0x2444, pci_device_14f1_2444,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2444,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2445 = {
- 0x2445, pci_device_14f1_2445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2446 = {
- 0x2446, pci_device_14f1_2446,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2446,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2463 = {
- 0x2463, pci_device_14f1_2463,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2463,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2464 = {
- 0x2464, pci_device_14f1_2464,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2464,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2465 = {
- 0x2465, pci_device_14f1_2465,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2465,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2466 = {
- 0x2466, pci_device_14f1_2466,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2466,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_2f00 = {
- 0x2f00, pci_device_14f1_2f00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_2f00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_14f1_8234 = {
- 0x8234, pci_device_14f1_8234,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_14f1_8234,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1507_0001 = {
- 0x0001, pci_device_1507_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_0002 = {
- 0x0002, pci_device_1507_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_0003 = {
- 0x0003, pci_device_1507_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_0100 = {
- 0x0100, pci_device_1507_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_0431 = {
- 0x0431, pci_device_1507_0431,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_0431,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_4801 = {
- 0x4801, pci_device_1507_4801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_4801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_4802 = {
- 0x4802, pci_device_1507_4802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_4802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_4803 = {
- 0x4803, pci_device_1507_4803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_4803,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1507_4806 = {
- 0x4806, pci_device_1507_4806,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1507_4806,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1516_0803 = {
- 0x0803, pci_device_1516_0803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1516_0803,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_151a_1002 = {
- 0x1002, pci_device_151a_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_151a_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_151a_1004 = {
- 0x1004, pci_device_151a_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_151a_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_151a_1008 = {
- 0x1008, pci_device_151a_1008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_151a_1008,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_151f_0000 = {
- 0x0000, pci_device_151f_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_151f_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1522_0100 = {
- 0x0100, pci_device_1522_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1522_0100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1524_1211 = {
- 0x1211, pci_device_1524_1211,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1524_1211,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1524_1225 = {
- 0x1225, pci_device_1524_1225,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1524_1225,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1524_1410 = {
- 0x1410, pci_device_1524_1410,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1524_1410,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1524_1420 = {
- 0x1420, pci_device_1524_1420,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1524_1420,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1543_3052 = {
- 0x3052, pci_device_1543_3052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1543_3052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1543_4c22 = {
- 0x4c22, pci_device_1543_4c22,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1543_4c22,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1571_a001 = {
- 0xa001, pci_device_1571_a001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a002 = {
- 0xa002, pci_device_1571_a002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a003 = {
- 0xa003, pci_device_1571_a003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a004 = {
- 0xa004, pci_device_1571_a004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a005 = {
- 0xa005, pci_device_1571_a005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a006 = {
- 0xa006, pci_device_1571_a006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a007 = {
- 0xa007, pci_device_1571_a007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a008 = {
- 0xa008, pci_device_1571_a008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a009 = {
- 0xa009, pci_device_1571_a009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a00a = {
- 0xa00a, pci_device_1571_a00a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a00a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a00b = {
- 0xa00b, pci_device_1571_a00b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a00b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a00c = {
- 0xa00c, pci_device_1571_a00c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a00c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a00d = {
- 0xa00d, pci_device_1571_a00d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a00d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a201 = {
- 0xa201, pci_device_1571_a201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a202 = {
- 0xa202, pci_device_1571_a202,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a202,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a203 = {
- 0xa203, pci_device_1571_a203,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a203,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a204 = {
- 0xa204, pci_device_1571_a204,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a204,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a205 = {
- 0xa205, pci_device_1571_a205,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a205,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1571_a206 = {
- 0xa206, pci_device_1571_a206,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1571_a206,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_157c_8001 = {
- 0x8001, pci_device_157c_8001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_157c_8001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1592_0781 = {
- 0x0781, pci_device_1592_0781,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0781,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0782 = {
- 0x0782, pci_device_1592_0782,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0782,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0783 = {
- 0x0783, pci_device_1592_0783,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0783,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0785 = {
- 0x0785, pci_device_1592_0785,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0785,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0786 = {
- 0x0786, pci_device_1592_0786,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0786,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0787 = {
- 0x0787, pci_device_1592_0787,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0787,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_0788 = {
- 0x0788, pci_device_1592_0788,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_0788,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1592_078a = {
- 0x078a, pci_device_1592_078a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1592_078a,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15a2_0001 = {
- 0x0001, pci_device_15a2_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15a2_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_15ad_0710 = {
- 0x0710, pci_device_15ad_0710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15ad_0710,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15b3_5274 = {
- 0x5274, pci_device_15b3_5274,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15b3_5274,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15bc_2929 = {
- 0x2929, pci_device_15bc_2929,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15bc_2929,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15c7_0349 = {
- 0x0349, pci_device_15c7_0349,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15c7_0349,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15dc_0001 = {
- 0x0001, pci_device_15dc_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15dc_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_15e8_0130 = {
- 0x0130, pci_device_15e8_0130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_15e8_0130,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1619_0400 = {
- 0x0400, pci_device_1619_0400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1619_0400,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1619_0440 = {
- 0x0440, pci_device_1619_0440,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1619_0440,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1629_1003 = {
- 0x1003, pci_device_1629_1003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1629_1003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1629_2002 = {
- 0x2002, pci_device_1629_2002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1629_2002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1638_1100 = {
- 0x1100, pci_device_1638_1100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1638_1100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_163c_3052 = {
- 0x3052, pci_device_163c_3052,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_163c_3052,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_163c_5449 = {
- 0x5449, pci_device_163c_5449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_163c_5449,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_165a_c100 = {
- 0xc100, pci_device_165a_c100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_165a_c100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_165a_d200 = {
- 0xd200, pci_device_165a_d200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_165a_d200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_165a_d300 = {
- 0xd300, pci_device_165a_d300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_165a_d300,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_16ab_1102 = {
- 0x1102, pci_device_16ab_1102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_16ab_1102,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_16ca_0001 = {
- 0x0001, pci_device_16ca_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_16ca_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_16ec_3685 = {
- 0x3685, pci_device_16ec_3685,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_16ec_3685,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_173b_03e8 = {
- 0x03e8, pci_device_173b_03e8,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_173b_03e8,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_173b_03ea = {
- 0x03ea, pci_device_173b_03ea,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_173b_03ea,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1743_8139 = {
- 0x8139, pci_device_1743_8139,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1743_8139,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1796_0001 = {
- 0x0001, pci_device_1796_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1796_0002 = {
- 0x0002, pci_device_1796_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1796_0003 = {
- 0x0003, pci_device_1796_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1796_0004 = {
- 0x0004, pci_device_1796_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1796_0005 = {
- 0x0005, pci_device_1796_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1796_0006 = {
- 0x0006, pci_device_1796_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1796_0006,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_17cc_2280 = {
- 0x2280, pci_device_17cc_2280,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_17cc_2280,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1813_4000 = {
- 0x4000, pci_device_1813_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1813_4000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1813_4100 = {
- 0x4100, pci_device_1813_4100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1813_4100,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1888_0301 = {
- 0x0301, pci_device_1888_0301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1888_0301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1888_0601 = {
- 0x0601, pci_device_1888_0601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1888_0601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1888_0710 = {
- 0x0710, pci_device_1888_0710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1888_0710,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1888_0720 = {
- 0x0720, pci_device_1888_0720,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1888_0720,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1a08_0000 = {
- 0x0000, pci_device_1a08_0000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1a08_0000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1c1c_0001 = {
- 0x0001, pci_device_1c1c_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1c1c_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1d44_a400 = {
- 0xa400, pci_device_1d44_a400,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1d44_a400,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1de1_0391 = {
- 0x0391, pci_device_1de1_0391,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1de1_0391,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1de1_2020 = {
- 0x2020, pci_device_1de1_2020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1de1_2020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1de1_690c = {
- 0x690c, pci_device_1de1_690c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1de1_690c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_1de1_dc29 = {
- 0xdc29, pci_device_1de1_dc29,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1de1_dc29,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_1fc0_0300 = {
- 0x0300, pci_device_1fc0_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_1fc0_0300,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_2348_2010 = {
- 0x2010, pci_device_2348_2010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_2348_2010,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_3388_0013 = {
- 0x0013, pci_device_3388_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_0014 = {
- 0x0014, pci_device_3388_0014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_0014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_0021 = {
- 0x0021, pci_device_3388_0021,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_0021,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_101a = {
- 0x101a, pci_device_3388_101a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_101a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_101b = {
- 0x101b, pci_device_3388_101b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_101b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_8011 = {
- 0x8011, pci_device_3388_8011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_8011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_8012 = {
- 0x8012, pci_device_3388_8012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_8012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3388_8013 = {
- 0x8013, pci_device_3388_8013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3388_8013,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_3d3d_0001 = {
- 0x0001, pci_device_3d3d_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0002 = {
- 0x0002, pci_device_3d3d_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0003 = {
- 0x0003, pci_device_3d3d_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0003,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0004 = {
- 0x0004, pci_device_3d3d_0004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0005 = {
- 0x0005, pci_device_3d3d_0005,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0005,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0006 = {
- 0x0006, pci_device_3d3d_0006,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0006,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0007 = {
- 0x0007, pci_device_3d3d_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0008 = {
- 0x0008, pci_device_3d3d_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0009 = {
- 0x0009, pci_device_3d3d_0009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_000a = {
- 0x000a, pci_device_3d3d_000a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_000a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_000c = {
- 0x000c, pci_device_3d3d_000c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_000c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_0100 = {
- 0x0100, pci_device_3d3d_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_1004 = {
- 0x1004, pci_device_3d3d_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_3d04 = {
- 0x3d04, pci_device_3d3d_3d04,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_3d04,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_3d3d_ffff = {
- 0xffff, pci_device_3d3d_ffff,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_3d3d_ffff,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_0300 = {
- 0x0300, pci_device_4005_0300,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_0300,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_0308 = {
- 0x0308, pci_device_4005_0308,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_0308,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_0309 = {
- 0x0309, pci_device_4005_0309,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_0309,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_1064 = {
- 0x1064, pci_device_4005_1064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_1064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2064 = {
- 0x2064, pci_device_4005_2064,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2064,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2128 = {
- 0x2128, pci_device_4005_2128,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2128,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2301 = {
- 0x2301, pci_device_4005_2301,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2301,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2302 = {
- 0x2302, pci_device_4005_2302,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2302,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2303 = {
- 0x2303, pci_device_4005_2303,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2303,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2364 = {
- 0x2364, pci_device_4005_2364,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2364,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2464 = {
- 0x2464, pci_device_4005_2464,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2464,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_2501 = {
- 0x2501, pci_device_4005_2501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_2501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_4000 = {
- 0x4000, pci_device_4005_4000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_4000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4005_4710 = {
- 0x4710, pci_device_4005_4710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4005_4710,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4033_1360 = {
- 0x1360, pci_device_4033_1360,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4033_1360,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_416c_0100 = {
- 0x0100, pci_device_416c_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_416c_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_416c_0200 = {
- 0x0200, pci_device_416c_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_416c_0200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4444_0803 = {
- 0x0803, pci_device_4444_0803,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4444_0803,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4916_1960 = {
- 0x1960, pci_device_4916_1960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4916_1960,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4a14_5000 = {
- 0x5000, pci_device_4a14_5000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4a14_5000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4d51_0200 = {
- 0x0200, pci_device_4d51_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4d51_0200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_4ddc_0100 = {
- 0x0100, pci_device_4ddc_0100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0801 = {
- 0x0801, pci_device_4ddc_0801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0802 = {
- 0x0802, pci_device_4ddc_0802,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0802,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0811 = {
- 0x0811, pci_device_4ddc_0811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0811,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0812 = {
- 0x0812, pci_device_4ddc_0812,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0812,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0881 = {
- 0x0881, pci_device_4ddc_0881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0882 = {
- 0x0882, pci_device_4ddc_0882,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0882,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0891 = {
- 0x0891, pci_device_4ddc_0891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0891,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0892 = {
- 0x0892, pci_device_4ddc_0892,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0892,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0901 = {
- 0x0901, pci_device_4ddc_0901,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0901,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0902 = {
- 0x0902, pci_device_4ddc_0902,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0902,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0903 = {
- 0x0903, pci_device_4ddc_0903,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0903,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0904 = {
- 0x0904, pci_device_4ddc_0904,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0904,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0b01 = {
- 0x0b01, pci_device_4ddc_0b01,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0b01,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0b02 = {
- 0x0b02, pci_device_4ddc_0b02,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0b02,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0b03 = {
- 0x0b03, pci_device_4ddc_0b03,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0b03,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_4ddc_0b04 = {
- 0x0b04, pci_device_4ddc_0b04,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_4ddc_0b04,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5046_1001 = {
- 0x1001, pci_device_5046_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5046_1001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5053_2010 = {
- 0x2010, pci_device_5053_2010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5053_2010,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5145_3031 = {
- 0x3031, pci_device_5145_3031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5145_3031,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5301_0001 = {
- 0x0001, pci_device_5301_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5301_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_5333_0551 = {
- 0x0551, pci_device_5333_0551,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_0551,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_5631 = {
- 0x5631, pci_device_5333_5631,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_5631,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8800 = {
- 0x8800, pci_device_5333_8800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8801 = {
- 0x8801, pci_device_5333_8801,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8801,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8810 = {
- 0x8810, pci_device_5333_8810,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8810,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8811 = {
- 0x8811, pci_device_5333_8811,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8811,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8812 = {
- 0x8812, pci_device_5333_8812,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8812,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8813 = {
- 0x8813, pci_device_5333_8813,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8813,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8814 = {
- 0x8814, pci_device_5333_8814,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8814,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8815 = {
- 0x8815, pci_device_5333_8815,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8815,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_883d = {
- 0x883d, pci_device_5333_883d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_883d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8870 = {
- 0x8870, pci_device_5333_8870,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8870,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8880 = {
- 0x8880, pci_device_5333_8880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8880,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8881 = {
- 0x8881, pci_device_5333_8881,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8881,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8882 = {
- 0x8882, pci_device_5333_8882,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8882,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8883 = {
- 0x8883, pci_device_5333_8883,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8883,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88b0 = {
- 0x88b0, pci_device_5333_88b0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88b0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88b1 = {
- 0x88b1, pci_device_5333_88b1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88b1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88b2 = {
- 0x88b2, pci_device_5333_88b2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88b2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88b3 = {
- 0x88b3, pci_device_5333_88b3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88b3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88c0 = {
- 0x88c0, pci_device_5333_88c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88c1 = {
- 0x88c1, pci_device_5333_88c1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88c1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88c2 = {
- 0x88c2, pci_device_5333_88c2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88c2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88c3 = {
- 0x88c3, pci_device_5333_88c3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88c3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88d0 = {
- 0x88d0, pci_device_5333_88d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88d1 = {
- 0x88d1, pci_device_5333_88d1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88d1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88d2 = {
- 0x88d2, pci_device_5333_88d2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88d2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88d3 = {
- 0x88d3, pci_device_5333_88d3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88d3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88f0 = {
- 0x88f0, pci_device_5333_88f0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88f0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88f1 = {
- 0x88f1, pci_device_5333_88f1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88f1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88f2 = {
- 0x88f2, pci_device_5333_88f2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88f2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_88f3 = {
- 0x88f3, pci_device_5333_88f3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_88f3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8900 = {
- 0x8900, pci_device_5333_8900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8901 = {
- 0x8901, pci_device_5333_8901,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8901,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8902 = {
- 0x8902, pci_device_5333_8902,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8902,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8903 = {
- 0x8903, pci_device_5333_8903,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8903,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8904 = {
- 0x8904, pci_device_5333_8904,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8904,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8905 = {
- 0x8905, pci_device_5333_8905,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8905,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8906 = {
- 0x8906, pci_device_5333_8906,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8906,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8907 = {
- 0x8907, pci_device_5333_8907,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8907,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8908 = {
- 0x8908, pci_device_5333_8908,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8908,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8909 = {
- 0x8909, pci_device_5333_8909,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8909,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890a = {
- 0x890a, pci_device_5333_890a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890b = {
- 0x890b, pci_device_5333_890b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890c = {
- 0x890c, pci_device_5333_890c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890d = {
- 0x890d, pci_device_5333_890d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890e = {
- 0x890e, pci_device_5333_890e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_890f = {
- 0x890f, pci_device_5333_890f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_890f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a01 = {
- 0x8a01, pci_device_5333_8a01,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a01,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a10 = {
- 0x8a10, pci_device_5333_8a10,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a10,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a13 = {
- 0x8a13, pci_device_5333_8a13,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a13,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a20 = {
- 0x8a20, pci_device_5333_8a20,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a20,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a21 = {
- 0x8a21, pci_device_5333_8a21,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a21,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a22 = {
- 0x8a22, pci_device_5333_8a22,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a22,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a23 = {
- 0x8a23, pci_device_5333_8a23,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a23,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a25 = {
- 0x8a25, pci_device_5333_8a25,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a25,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8a26 = {
- 0x8a26, pci_device_5333_8a26,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8a26,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c00 = {
- 0x8c00, pci_device_5333_8c00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c00,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c01 = {
- 0x8c01, pci_device_5333_8c01,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c01,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c02 = {
- 0x8c02, pci_device_5333_8c02,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c02,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c03 = {
- 0x8c03, pci_device_5333_8c03,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c03,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c10 = {
- 0x8c10, pci_device_5333_8c10,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c10,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c11 = {
- 0x8c11, pci_device_5333_8c11,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c11,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c12 = {
- 0x8c12, pci_device_5333_8c12,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c12,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c13 = {
- 0x8c13, pci_device_5333_8c13,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c13,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c22 = {
- 0x8c22, pci_device_5333_8c22,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c22,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c24 = {
- 0x8c24, pci_device_5333_8c24,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c24,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c26 = {
- 0x8c26, pci_device_5333_8c26,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c26,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2a = {
- 0x8c2a, pci_device_5333_8c2a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2b = {
- 0x8c2b, pci_device_5333_8c2b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2c = {
- 0x8c2c, pci_device_5333_8c2c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2d = {
- 0x8c2d, pci_device_5333_8c2d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2e = {
- 0x8c2e, pci_device_5333_8c2e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8c2f = {
- 0x8c2f, pci_device_5333_8c2f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8c2f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8d01 = {
- 0x8d01, pci_device_5333_8d01,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8d01,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8d02 = {
- 0x8d02, pci_device_5333_8d02,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8d02,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8d03 = {
- 0x8d03, pci_device_5333_8d03,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8d03,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_8d04 = {
- 0x8d04, pci_device_5333_8d04,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_8d04,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_9102 = {
- 0x9102, pci_device_5333_9102,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_9102,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_5333_ca00 = {
- 0xca00, pci_device_5333_ca00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5333_ca00,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_544c_0350 = {
- 0x0350, pci_device_544c_0350,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_544c_0350,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5455_4458 = {
- 0x4458, pci_device_5455_4458,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5455_4458,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5544_0001 = {
- 0x0001, pci_device_5544_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5544_0001,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_5555_0003 = {
- 0x0003, pci_device_5555_0003,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_5555_0003,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_6374_6773 = {
- 0x6773, pci_device_6374_6773,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_6374_6773,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_6666_0001 = {
- 0x0001, pci_device_6666_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_6666_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_6666_0002 = {
- 0x0002, pci_device_6666_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_6666_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_8008_0010 = {
- 0x0010, pci_device_8008_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8008_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8008_0011 = {
- 0x0011, pci_device_8008_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8008_0011,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_8086_0007 = {
- 0x0007, pci_device_8086_0007,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0007,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0008 = {
- 0x0008, pci_device_8086_0008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0039 = {
- 0x0039, pci_device_8086_0039,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0039,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0122 = {
- 0x0122, pci_device_8086_0122,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0122,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0482 = {
- 0x0482, pci_device_8086_0482,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0482,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0483 = {
- 0x0483, pci_device_8086_0483,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0483,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0484 = {
- 0x0484, pci_device_8086_0484,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0484,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0486 = {
- 0x0486, pci_device_8086_0486,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0486,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_04a3 = {
- 0x04a3, pci_device_8086_04a3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_04a3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_04d0 = {
- 0x04d0, pci_device_8086_04d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_04d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0600 = {
- 0x0600, pci_device_8086_0600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0960 = {
- 0x0960, pci_device_8086_0960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0960,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0962 = {
- 0x0962, pci_device_8086_0962,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0962,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_0964 = {
- 0x0964, pci_device_8086_0964,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_0964,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1000 = {
- 0x1000, pci_device_8086_1000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1001 = {
- 0x1001, pci_device_8086_1001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1002 = {
- 0x1002, pci_device_8086_1002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1002,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1004 = {
- 0x1004, pci_device_8086_1004,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1004,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1008 = {
- 0x1008, pci_device_8086_1008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1008,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1009 = {
- 0x1009, pci_device_8086_1009,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1009,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_100c = {
- 0x100c, pci_device_8086_100c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_100c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_100d = {
- 0x100d, pci_device_8086_100d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_100d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_100e = {
- 0x100e, pci_device_8086_100e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_100e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_100f = {
- 0x100f, pci_device_8086_100f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_100f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1010 = {
- 0x1010, pci_device_8086_1010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1011 = {
- 0x1011, pci_device_8086_1011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1012 = {
- 0x1012, pci_device_8086_1012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1015 = {
- 0x1015, pci_device_8086_1015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1015,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1029 = {
- 0x1029, pci_device_8086_1029,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1029,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1030 = {
- 0x1030, pci_device_8086_1030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1031 = {
- 0x1031, pci_device_8086_1031,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1031,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1032 = {
- 0x1032, pci_device_8086_1032,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1032,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1033 = {
- 0x1033, pci_device_8086_1033,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1033,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1034 = {
- 0x1034, pci_device_8086_1034,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1034,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1035 = {
- 0x1035, pci_device_8086_1035,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1035,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1036 = {
- 0x1036, pci_device_8086_1036,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1036,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1037 = {
- 0x1037, pci_device_8086_1037,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1037,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1038 = {
- 0x1038, pci_device_8086_1038,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1038,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1039 = {
- 0x1039, pci_device_8086_1039,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1039,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_103a = {
- 0x103a, pci_device_8086_103a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_103a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_103b = {
- 0x103b, pci_device_8086_103b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_103b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_103c = {
- 0x103c, pci_device_8086_103c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_103c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_103d = {
- 0x103d, pci_device_8086_103d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_103d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_103e = {
- 0x103e, pci_device_8086_103e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_103e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1040 = {
- 0x1040, pci_device_8086_1040,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1040,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1043 = {
- 0x1043, pci_device_8086_1043,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1043,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1059 = {
- 0x1059, pci_device_8086_1059,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1059,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1130 = {
- 0x1130, pci_device_8086_1130,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1130,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1131 = {
- 0x1131, pci_device_8086_1131,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1131,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1132 = {
- 0x1132, pci_device_8086_1132,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1132,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1161 = {
- 0x1161, pci_device_8086_1161,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1161,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1162 = {
- 0x1162, pci_device_8086_1162,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1162,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1200 = {
- 0x1200, pci_device_8086_1200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1209 = {
- 0x1209, pci_device_8086_1209,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1209,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1221 = {
- 0x1221, pci_device_8086_1221,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1221,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1222 = {
- 0x1222, pci_device_8086_1222,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1222,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1223 = {
- 0x1223, pci_device_8086_1223,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1223,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1225 = {
- 0x1225, pci_device_8086_1225,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1225,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1226 = {
- 0x1226, pci_device_8086_1226,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1226,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1227 = {
- 0x1227, pci_device_8086_1227,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1227,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1228 = {
- 0x1228, pci_device_8086_1228,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1228,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1229 = {
- 0x1229, pci_device_8086_1229,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1229,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_122d = {
- 0x122d, pci_device_8086_122d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_122d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_122e = {
- 0x122e, pci_device_8086_122e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_122e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1230 = {
- 0x1230, pci_device_8086_1230,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1230,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1231 = {
- 0x1231, pci_device_8086_1231,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1231,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1234 = {
- 0x1234, pci_device_8086_1234,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1234,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1235 = {
- 0x1235, pci_device_8086_1235,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1235,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1237 = {
- 0x1237, pci_device_8086_1237,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1237,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1239 = {
- 0x1239, pci_device_8086_1239,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1239,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_123b = {
- 0x123b, pci_device_8086_123b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_123b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_123c = {
- 0x123c, pci_device_8086_123c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_123c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_123d = {
- 0x123d, pci_device_8086_123d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_123d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_123f = {
- 0x123f, pci_device_8086_123f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_123f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1240 = {
- 0x1240, pci_device_8086_1240,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1240,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_124b = {
- 0x124b, pci_device_8086_124b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_124b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1250 = {
- 0x1250, pci_device_8086_1250,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1250,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1360 = {
- 0x1360, pci_device_8086_1360,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1360,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1361 = {
- 0x1361, pci_device_8086_1361,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1361,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1460 = {
- 0x1460, pci_device_8086_1460,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1460,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1461 = {
- 0x1461, pci_device_8086_1461,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1461,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1462 = {
- 0x1462, pci_device_8086_1462,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1462,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1960 = {
- 0x1960, pci_device_8086_1960,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1960,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1962 = {
- 0x1962, pci_device_8086_1962,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1962,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1a21 = {
- 0x1a21, pci_device_8086_1a21,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1a21,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1a23 = {
- 0x1a23, pci_device_8086_1a23,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1a23,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1a24 = {
- 0x1a24, pci_device_8086_1a24,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1a24,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1a30 = {
- 0x1a30, pci_device_8086_1a30,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1a30,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_1a31 = {
- 0x1a31, pci_device_8086_1a31,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_1a31,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2410 = {
- 0x2410, pci_device_8086_2410,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2410,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2411 = {
- 0x2411, pci_device_8086_2411,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2411,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2412 = {
- 0x2412, pci_device_8086_2412,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2412,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2413 = {
- 0x2413, pci_device_8086_2413,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2413,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2415 = {
- 0x2415, pci_device_8086_2415,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2415,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2416 = {
- 0x2416, pci_device_8086_2416,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2416,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2418 = {
- 0x2418, pci_device_8086_2418,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2418,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2420 = {
- 0x2420, pci_device_8086_2420,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2420,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2421 = {
- 0x2421, pci_device_8086_2421,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2421,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2422 = {
- 0x2422, pci_device_8086_2422,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2422,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2423 = {
- 0x2423, pci_device_8086_2423,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2423,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2425 = {
- 0x2425, pci_device_8086_2425,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2425,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2426 = {
- 0x2426, pci_device_8086_2426,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2426,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2428 = {
- 0x2428, pci_device_8086_2428,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2428,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2440 = {
- 0x2440, pci_device_8086_2440,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2440,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2442 = {
- 0x2442, pci_device_8086_2442,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2442,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2443 = {
- 0x2443, pci_device_8086_2443,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2443,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2444 = {
- 0x2444, pci_device_8086_2444,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2444,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2445 = {
- 0x2445, pci_device_8086_2445,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2445,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2446 = {
- 0x2446, pci_device_8086_2446,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2446,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2448 = {
- 0x2448, pci_device_8086_2448,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2448,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2449 = {
- 0x2449, pci_device_8086_2449,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2449,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_244a = {
- 0x244a, pci_device_8086_244a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_244a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_244b = {
- 0x244b, pci_device_8086_244b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_244b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_244c = {
- 0x244c, pci_device_8086_244c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_244c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_244e = {
- 0x244e, pci_device_8086_244e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_244e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2450 = {
- 0x2450, pci_device_8086_2450,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2450,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2452 = {
- 0x2452, pci_device_8086_2452,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2452,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2453 = {
- 0x2453, pci_device_8086_2453,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2453,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2459 = {
- 0x2459, pci_device_8086_2459,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2459,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_245b = {
- 0x245b, pci_device_8086_245b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_245b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_245d = {
- 0x245d, pci_device_8086_245d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_245d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_245e = {
- 0x245e, pci_device_8086_245e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_245e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2480 = {
- 0x2480, pci_device_8086_2480,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2480,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2482 = {
- 0x2482, pci_device_8086_2482,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2482,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2483 = {
- 0x2483, pci_device_8086_2483,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2483,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2484 = {
- 0x2484, pci_device_8086_2484,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2484,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2485 = {
- 0x2485, pci_device_8086_2485,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2485,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2486 = {
- 0x2486, pci_device_8086_2486,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2486,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2487 = {
- 0x2487, pci_device_8086_2487,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2487,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_248a = {
- 0x248a, pci_device_8086_248a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_248a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_248b = {
- 0x248b, pci_device_8086_248b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_248b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_248c = {
- 0x248c, pci_device_8086_248c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_248c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c0 = {
- 0x24c0, pci_device_8086_24c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c2 = {
- 0x24c2, pci_device_8086_24c2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c3 = {
- 0x24c3, pci_device_8086_24c3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c4 = {
- 0x24c4, pci_device_8086_24c4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c5 = {
- 0x24c5, pci_device_8086_24c5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c6 = {
- 0x24c6, pci_device_8086_24c6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24c7 = {
- 0x24c7, pci_device_8086_24c7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24c7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24ca = {
- 0x24ca, pci_device_8086_24ca,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24ca,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24cb = {
- 0x24cb, pci_device_8086_24cb,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24cb,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24cc = {
- 0x24cc, pci_device_8086_24cc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24cc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24cd = {
- 0x24cd, pci_device_8086_24cd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24cd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d0 = {
- 0x24d0, pci_device_8086_24d0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d1 = {
- 0x24d1, pci_device_8086_24d1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d2 = {
- 0x24d2, pci_device_8086_24d2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d3 = {
- 0x24d3, pci_device_8086_24d3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d4 = {
- 0x24d4, pci_device_8086_24d4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d5 = {
- 0x24d5, pci_device_8086_24d5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d6 = {
- 0x24d6, pci_device_8086_24d6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24d7 = {
- 0x24d7, pci_device_8086_24d7,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24d7,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24db = {
- 0x24db, pci_device_8086_24db,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24db,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24dc = {
- 0x24dc, pci_device_8086_24dc,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24dc,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24dd = {
- 0x24dd, pci_device_8086_24dd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24dd,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_24de = {
- 0x24de, pci_device_8086_24de,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_24de,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2500 = {
- 0x2500, pci_device_8086_2500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2501 = {
- 0x2501, pci_device_8086_2501,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2501,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_250b = {
- 0x250b, pci_device_8086_250b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_250b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_250f = {
- 0x250f, pci_device_8086_250f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_250f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2520 = {
- 0x2520, pci_device_8086_2520,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2520,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2521 = {
- 0x2521, pci_device_8086_2521,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2521,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2530 = {
- 0x2530, pci_device_8086_2530,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2530,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2531 = {
- 0x2531, pci_device_8086_2531,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2531,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2532 = {
- 0x2532, pci_device_8086_2532,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2532,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2533 = {
- 0x2533, pci_device_8086_2533,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2533,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2534 = {
- 0x2534, pci_device_8086_2534,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2534,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2540 = {
- 0x2540, pci_device_8086_2540,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2540,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2541 = {
- 0x2541, pci_device_8086_2541,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2541,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2543 = {
- 0x2543, pci_device_8086_2543,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2543,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2544 = {
- 0x2544, pci_device_8086_2544,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2544,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2545 = {
- 0x2545, pci_device_8086_2545,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2545,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2546 = {
- 0x2546, pci_device_8086_2546,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2546,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2547 = {
- 0x2547, pci_device_8086_2547,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2547,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2548 = {
- 0x2548, pci_device_8086_2548,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2548,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_254c = {
- 0x254c, pci_device_8086_254c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_254c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2550 = {
- 0x2550, pci_device_8086_2550,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2550,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2551 = {
- 0x2551, pci_device_8086_2551,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2551,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2552 = {
- 0x2552, pci_device_8086_2552,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2552,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2553 = {
- 0x2553, pci_device_8086_2553,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2553,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2554 = {
- 0x2554, pci_device_8086_2554,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2554,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_255d = {
- 0x255d, pci_device_8086_255d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_255d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2560 = {
- 0x2560, pci_device_8086_2560,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2560,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2561 = {
- 0x2561, pci_device_8086_2561,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2561,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2562 = {
- 0x2562, pci_device_8086_2562,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2562,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2570 = {
- 0x2570, pci_device_8086_2570,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2570,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2571 = {
- 0x2571, pci_device_8086_2571,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2571,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2572 = {
- 0x2572, pci_device_8086_2572,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2572,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2573 = {
- 0x2573, pci_device_8086_2573,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2573,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2576 = {
- 0x2576, pci_device_8086_2576,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2576,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2578 = {
- 0x2578, pci_device_8086_2578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_2579 = {
- 0x2579, pci_device_8086_2579,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_2579,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_257b = {
- 0x257b, pci_device_8086_257b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_257b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_257e = {
- 0x257e, pci_device_8086_257e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_257e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3092 = {
- 0x3092, pci_device_8086_3092,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3092,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3340 = {
- 0x3340, pci_device_8086_3340,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3340,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3341 = {
- 0x3341, pci_device_8086_3341,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3341,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3575 = {
- 0x3575, pci_device_8086_3575,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3575,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3576 = {
- 0x3576, pci_device_8086_3576,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3576,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3577 = {
- 0x3577, pci_device_8086_3577,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3577,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3578 = {
- 0x3578, pci_device_8086_3578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3580 = {
- 0x3580, pci_device_8086_3580,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3580,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_3582 = {
- 0x3582, pci_device_8086_3582,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_3582,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_5200 = {
- 0x5200, pci_device_8086_5200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_5200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_5201 = {
- 0x5201, pci_device_8086_5201,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_5201,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_530d = {
- 0x530d, pci_device_8086_530d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_530d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7000 = {
- 0x7000, pci_device_8086_7000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7010 = {
- 0x7010, pci_device_8086_7010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7020 = {
- 0x7020, pci_device_8086_7020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7030 = {
- 0x7030, pci_device_8086_7030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7100 = {
- 0x7100, pci_device_8086_7100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7110 = {
- 0x7110, pci_device_8086_7110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7111 = {
- 0x7111, pci_device_8086_7111,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7111,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7112 = {
- 0x7112, pci_device_8086_7112,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7112,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7113 = {
- 0x7113, pci_device_8086_7113,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7113,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7120 = {
- 0x7120, pci_device_8086_7120,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7120,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7121 = {
- 0x7121, pci_device_8086_7121,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7121,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7122 = {
- 0x7122, pci_device_8086_7122,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7122,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7123 = {
- 0x7123, pci_device_8086_7123,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7123,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7124 = {
- 0x7124, pci_device_8086_7124,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7124,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7125 = {
- 0x7125, pci_device_8086_7125,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7125,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7126 = {
- 0x7126, pci_device_8086_7126,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7126,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7128 = {
- 0x7128, pci_device_8086_7128,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7128,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_712a = {
- 0x712a, pci_device_8086_712a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_712a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7180 = {
- 0x7180, pci_device_8086_7180,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7180,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7181 = {
- 0x7181, pci_device_8086_7181,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7181,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7190 = {
- 0x7190, pci_device_8086_7190,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7190,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7191 = {
- 0x7191, pci_device_8086_7191,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7191,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7192 = {
- 0x7192, pci_device_8086_7192,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7192,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7194 = {
- 0x7194, pci_device_8086_7194,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7194,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7195 = {
- 0x7195, pci_device_8086_7195,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7195,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7196 = {
- 0x7196, pci_device_8086_7196,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7196,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7198 = {
- 0x7198, pci_device_8086_7198,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7198,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7199 = {
- 0x7199, pci_device_8086_7199,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7199,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_719a = {
- 0x719a, pci_device_8086_719a,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_719a,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_719b = {
- 0x719b, pci_device_8086_719b,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_719b,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_71a0 = {
- 0x71a0, pci_device_8086_71a0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_71a0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_71a1 = {
- 0x71a1, pci_device_8086_71a1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_71a1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_71a2 = {
- 0x71a2, pci_device_8086_71a2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_71a2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7600 = {
- 0x7600, pci_device_8086_7600,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7600,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7601 = {
- 0x7601, pci_device_8086_7601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7601,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7602 = {
- 0x7602, pci_device_8086_7602,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7602,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7603 = {
- 0x7603, pci_device_8086_7603,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7603,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_7800 = {
- 0x7800, pci_device_8086_7800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_7800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84c4 = {
- 0x84c4, pci_device_8086_84c4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84c4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84c5 = {
- 0x84c5, pci_device_8086_84c5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84c5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84ca = {
- 0x84ca, pci_device_8086_84ca,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84ca,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84cb = {
- 0x84cb, pci_device_8086_84cb,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84cb,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e0 = {
- 0x84e0, pci_device_8086_84e0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e1 = {
- 0x84e1, pci_device_8086_84e1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e2 = {
- 0x84e2, pci_device_8086_84e2,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e2,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e3 = {
- 0x84e3, pci_device_8086_84e3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e4 = {
- 0x84e4, pci_device_8086_84e4,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e4,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84e6 = {
- 0x84e6, pci_device_8086_84e6,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84e6,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_84ea = {
- 0x84ea, pci_device_8086_84ea,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_84ea,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_9621 = {
- 0x9621, pci_device_8086_9621,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_9621,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_9622 = {
- 0x9622, pci_device_8086_9622,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_9622,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_9641 = {
- 0x9641, pci_device_8086_9641,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_9641,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_96a1 = {
- 0x96a1, pci_device_8086_96a1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_96a1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_b152 = {
- 0xb152, pci_device_8086_b152,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_b152,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_b154 = {
- 0xb154, pci_device_8086_b154,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_b154,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_b555 = {
- 0xb555, pci_device_8086_b555,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_b555,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_8086_ffff = {
- 0xffff, pci_device_8086_ffff,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8086_ffff,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_8800_2008 = {
- 0x2008, pci_device_8800_2008,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8800_2008,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_8e2e_3000 = {
- 0x3000, pci_device_8e2e_3000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_8e2e_3000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_9004_1078 = {
- 0x1078, pci_device_9004_1078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_1078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_1160 = {
- 0x1160, pci_device_9004_1160,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_1160,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_2178 = {
- 0x2178, pci_device_9004_2178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_2178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_3860 = {
- 0x3860, pci_device_9004_3860,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_3860,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_3b78 = {
- 0x3b78, pci_device_9004_3b78,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_3b78,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5075 = {
- 0x5075, pci_device_9004_5075,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5075,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5078 = {
- 0x5078, pci_device_9004_5078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5175 = {
- 0x5175, pci_device_9004_5175,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5175,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5178 = {
- 0x5178, pci_device_9004_5178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5275 = {
- 0x5275, pci_device_9004_5275,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5275,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5278 = {
- 0x5278, pci_device_9004_5278,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5278,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5375 = {
- 0x5375, pci_device_9004_5375,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5375,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5378 = {
- 0x5378, pci_device_9004_5378,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5378,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5475 = {
- 0x5475, pci_device_9004_5475,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5475,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5478 = {
- 0x5478, pci_device_9004_5478,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5478,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5575 = {
- 0x5575, pci_device_9004_5575,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5575,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5578 = {
- 0x5578, pci_device_9004_5578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5675 = {
- 0x5675, pci_device_9004_5675,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5675,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5678 = {
- 0x5678, pci_device_9004_5678,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5678,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5775 = {
- 0x5775, pci_device_9004_5775,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5775,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5778 = {
- 0x5778, pci_device_9004_5778,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5778,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5800 = {
- 0x5800, pci_device_9004_5800,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5800,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5900 = {
- 0x5900, pci_device_9004_5900,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5900,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_5905 = {
- 0x5905, pci_device_9004_5905,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_5905,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6038 = {
- 0x6038, pci_device_9004_6038,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6038,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6075 = {
- 0x6075, pci_device_9004_6075,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6075,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6078 = {
- 0x6078, pci_device_9004_6078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6178 = {
- 0x6178, pci_device_9004_6178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6278 = {
- 0x6278, pci_device_9004_6278,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6278,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6378 = {
- 0x6378, pci_device_9004_6378,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6378,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6478 = {
- 0x6478, pci_device_9004_6478,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6478,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6578 = {
- 0x6578, pci_device_9004_6578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6678 = {
- 0x6678, pci_device_9004_6678,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6678,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6778 = {
- 0x6778, pci_device_9004_6778,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6778,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_6915 = {
- 0x6915, pci_device_9004_6915,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_6915,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7078 = {
- 0x7078, pci_device_9004_7078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7178 = {
- 0x7178, pci_device_9004_7178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7278 = {
- 0x7278, pci_device_9004_7278,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7278,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7378 = {
- 0x7378, pci_device_9004_7378,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7378,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7478 = {
- 0x7478, pci_device_9004_7478,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7478,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7578 = {
- 0x7578, pci_device_9004_7578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7678 = {
- 0x7678, pci_device_9004_7678,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7678,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7710 = {
- 0x7710, pci_device_9004_7710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7710,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7711 = {
- 0x7711, pci_device_9004_7711,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7711,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7778 = {
- 0x7778, pci_device_9004_7778,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7778,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7810 = {
- 0x7810, pci_device_9004_7810,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7810,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7815 = {
- 0x7815, pci_device_9004_7815,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7815,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7850 = {
- 0x7850, pci_device_9004_7850,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7850,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7855 = {
- 0x7855, pci_device_9004_7855,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7855,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7860 = {
- 0x7860, pci_device_9004_7860,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7860,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7870 = {
- 0x7870, pci_device_9004_7870,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7870,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7871 = {
- 0x7871, pci_device_9004_7871,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7871,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7872 = {
- 0x7872, pci_device_9004_7872,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7872,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7873 = {
- 0x7873, pci_device_9004_7873,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7873,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7874 = {
- 0x7874, pci_device_9004_7874,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7874,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7880 = {
- 0x7880, pci_device_9004_7880,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7880,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7890 = {
- 0x7890, pci_device_9004_7890,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7890,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7891 = {
- 0x7891, pci_device_9004_7891,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7891,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7892 = {
- 0x7892, pci_device_9004_7892,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7892,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7893 = {
- 0x7893, pci_device_9004_7893,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7893,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7894 = {
- 0x7894, pci_device_9004_7894,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7894,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7895 = {
- 0x7895, pci_device_9004_7895,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7895,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7896 = {
- 0x7896, pci_device_9004_7896,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7896,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_7897 = {
- 0x7897, pci_device_9004_7897,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_7897,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8078 = {
- 0x8078, pci_device_9004_8078,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8078,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8178 = {
- 0x8178, pci_device_9004_8178,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8178,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8278 = {
- 0x8278, pci_device_9004_8278,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8278,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8378 = {
- 0x8378, pci_device_9004_8378,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8378,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8478 = {
- 0x8478, pci_device_9004_8478,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8478,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8578 = {
- 0x8578, pci_device_9004_8578,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8578,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8678 = {
- 0x8678, pci_device_9004_8678,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8678,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8778 = {
- 0x8778, pci_device_9004_8778,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8778,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8878 = {
- 0x8878, pci_device_9004_8878,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8878,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_8b78 = {
- 0x8b78, pci_device_9004_8b78,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_8b78,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9004_ec78 = {
- 0xec78, pci_device_9004_ec78,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9004_ec78,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_9005_0010 = {
- 0x0010, pci_device_9005_0010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0011 = {
- 0x0011, pci_device_9005_0011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0013 = {
- 0x0013, pci_device_9005_0013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_001f = {
- 0x001f, pci_device_9005_001f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_001f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0020 = {
- 0x0020, pci_device_9005_0020,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0020,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_002f = {
- 0x002f, pci_device_9005_002f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_002f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0030 = {
- 0x0030, pci_device_9005_0030,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0030,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_003f = {
- 0x003f, pci_device_9005_003f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_003f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0050 = {
- 0x0050, pci_device_9005_0050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0051 = {
- 0x0051, pci_device_9005_0051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0053 = {
- 0x0053, pci_device_9005_0053,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0053,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_005f = {
- 0x005f, pci_device_9005_005f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_005f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0080 = {
- 0x0080, pci_device_9005_0080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0080,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0081 = {
- 0x0081, pci_device_9005_0081,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0081,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0083 = {
- 0x0083, pci_device_9005_0083,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0083,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_008f = {
- 0x008f, pci_device_9005_008f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_008f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_00c0 = {
- 0x00c0, pci_device_9005_00c0,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_00c0,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_00c1 = {
- 0x00c1, pci_device_9005_00c1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_00c1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_00c3 = {
- 0x00c3, pci_device_9005_00c3,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_00c3,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_00c5 = {
- 0x00c5, pci_device_9005_00c5,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_00c5,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_00cf = {
- 0x00cf, pci_device_9005_00cf,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_00cf,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0250 = {
- 0x0250, pci_device_9005_0250,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0250,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_0285 = {
- 0x0285, pci_device_9005_0285,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_0285,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8000 = {
- 0x8000, pci_device_9005_8000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8000,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_800f = {
- 0x800f, pci_device_9005_800f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_800f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8010 = {
- 0x8010, pci_device_9005_8010,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8010,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8011 = {
- 0x8011, pci_device_9005_8011,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8011,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8012 = {
- 0x8012, pci_device_9005_8012,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8012,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8013 = {
- 0x8013, pci_device_9005_8013,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8013,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8014 = {
- 0x8014, pci_device_9005_8014,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8014,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_801e = {
- 0x801e, pci_device_9005_801e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_801e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_801f = {
- 0x801f, pci_device_9005_801f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_801f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8080 = {
- 0x8080, pci_device_9005_8080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8080,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_808f = {
- 0x808f, pci_device_9005_808f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_808f,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8090 = {
- 0x8090, pci_device_9005_8090,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8090,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8091 = {
- 0x8091, pci_device_9005_8091,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8091,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8092 = {
- 0x8092, pci_device_9005_8092,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8092,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8093 = {
- 0x8093, pci_device_9005_8093,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8093,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8094 = {
- 0x8094, pci_device_9005_8094,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8094,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8095 = {
- 0x8095, pci_device_9005_8095,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8095,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8096 = {
- 0x8096, pci_device_9005_8096,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8096,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_8097 = {
- 0x8097, pci_device_9005_8097,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_8097,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_809c = {
- 0x809c, pci_device_9005_809c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_809c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_809d = {
- 0x809d, pci_device_9005_809d,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_809d,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_809e = {
- 0x809e, pci_device_9005_809e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_809e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9005_809f = {
- 0x809f, pci_device_9005_809f,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9005_809f,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_907f_2015 = {
- 0x2015, pci_device_907f_2015,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_907f_2015,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_9412_6565 = {
- 0x6565, pci_device_9412_6565,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9412_6565,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_9699_6565 = {
- 0x6565, pci_device_9699_6565,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9699_6565,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_9710_9815 = {
- 0x9815, pci_device_9710_9815,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9710_9815,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_9710_9835 = {
- 0x9835, pci_device_9710_9835,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_9710_9835,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_cddd_0101 = {
- 0x0101, pci_device_cddd_0101,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_cddd_0101,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_cddd_0200 = {
- 0x0200, pci_device_cddd_0200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_cddd_0200,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_d4d4_0601 = {
- 0x0601, pci_device_d4d4_0601,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_d4d4_0601,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_e000_e000 = {
- 0xe000, pci_device_e000_e000,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_e000_e000,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_e159_0001 = {
- 0x0001, pci_device_e159_0001,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_e159_0001,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_e159_0002 = {
- 0x0002, pci_device_e159_0002,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_e159_0002,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_ea60_9896 = {
- 0x9896, pci_device_ea60_9896,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ea60_9896,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ea60_9897 = {
- 0x9897, pci_device_ea60_9897,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ea60_9897,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ea60_9898 = {
- 0x9898, pci_device_ea60_9898,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ea60_9898,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_eace_3100 = {
- 0x3100, pci_device_eace_3100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_3100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_3200 = {
- 0x3200, pci_device_eace_3200,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_3200,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_320e = {
- 0x320e, pci_device_eace_320e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_320e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_340e = {
- 0x340e, pci_device_eace_340e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_340e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_341e = {
- 0x341e, pci_device_eace_341e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_341e,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_3500 = {
- 0x3500, pci_device_eace_3500,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_3500,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_351c = {
- 0x351c, pci_device_eace_351c,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_351c,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_4100 = {
- 0x4100, pci_device_eace_4100,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_4100,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_4110 = {
- 0x4110, pci_device_eace_4110,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_4110,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_4220 = {
- 0x4220, pci_device_eace_4220,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_4220,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_eace_422e = {
- 0x422e, pci_device_eace_422e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_eace_422e,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_ec80_ec00 = {
- 0xec00, pci_device_ec80_ec00,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ec80_ec00,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_ecc0_0050 = {
- 0x0050, pci_device_ecc0_0050,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0050,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0051 = {
- 0x0051, pci_device_ecc0_0051,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0051,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0060 = {
- 0x0060, pci_device_ecc0_0060,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0060,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0070 = {
- 0x0070, pci_device_ecc0_0070,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0070,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0071 = {
- 0x0071, pci_device_ecc0_0071,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0071,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0072 = {
- 0x0072, pci_device_ecc0_0072,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0072,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_ecc0_0080 = {
- 0x0080, pci_device_ecc0_0080,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_ecc0_0080,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-static const pciDeviceInfo pci_dev_info_edd8_a091 = {
- 0xa091, pci_device_edd8_a091,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_edd8_a091,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_edd8_a099 = {
- 0xa099, pci_device_edd8_a099,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_edd8_a099,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_edd8_a0a1 = {
- 0xa0a1, pci_device_edd8_a0a1,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_edd8_a0a1,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_edd8_a0a9 = {
- 0xa0a9, pci_device_edd8_a0a9,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_edd8_a0a9,
-#else
- NULL,
-#endif
- 0
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_f1d0_cafe = {
- 0xcafe, pci_device_f1d0_cafe,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_f1d0_cafe,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_f1d0_efac = {
- 0xefac, pci_device_f1d0_efac,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_f1d0_efac,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_f1d0_facd = {
- 0xfacd, pci_device_f1d0_facd,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_f1d0_facd,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_feda_a0fa = {
- 0xa0fa, pci_device_feda_a0fa,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_feda_a0fa,
-#else
- NULL,
-#endif
- 0
-};
-static const pciDeviceInfo pci_dev_info_feda_a10e = {
- 0xa10e, pci_device_feda_a10e,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_feda_a10e,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo pci_dev_info_fffe_0710 = {
- 0x0710, pci_device_fffe_0710,
-#ifdef INIT_SUBSYS_INFO
- pci_ss_list_fffe_0710,
-#else
- NULL,
-#endif
- 0
-};
-#endif
-#define pci_dev_list_0000 NULL
-#define pci_dev_list_001a NULL
-#define pci_dev_list_0033 NULL
-#define pci_dev_list_003d NULL
-#define pci_dev_list_0059 NULL
-#define pci_dev_list_0070 NULL
-#define pci_dev_list_0100 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_0675[] = {
- &pci_dev_info_0675_1700,
- &pci_dev_info_0675_1702,
- NULL
-};
-#endif
-#define pci_dev_list_0925 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_09c1[] = {
- &pci_dev_info_09c1_0704,
- NULL
-};
-#endif
-#define pci_dev_list_0a89 NULL
-static const pciDeviceInfo *pci_dev_list_0e11[] = {
- &pci_dev_info_0e11_0001,
- &pci_dev_info_0e11_0002,
- &pci_dev_info_0e11_0049,
- &pci_dev_info_0e11_004a,
- &pci_dev_info_0e11_0508,
- &pci_dev_info_0e11_1000,
- &pci_dev_info_0e11_2000,
- &pci_dev_info_0e11_3032,
- &pci_dev_info_0e11_3033,
- &pci_dev_info_0e11_3034,
- &pci_dev_info_0e11_4000,
- &pci_dev_info_0e11_6010,
- &pci_dev_info_0e11_7020,
- &pci_dev_info_0e11_a0ec,
- &pci_dev_info_0e11_a0f0,
- &pci_dev_info_0e11_a0f3,
- &pci_dev_info_0e11_a0f7,
- &pci_dev_info_0e11_a0f8,
- &pci_dev_info_0e11_a0fc,
- &pci_dev_info_0e11_ae10,
- &pci_dev_info_0e11_ae29,
- &pci_dev_info_0e11_ae2a,
- &pci_dev_info_0e11_ae2b,
- &pci_dev_info_0e11_ae31,
- &pci_dev_info_0e11_ae32,
- &pci_dev_info_0e11_ae33,
- &pci_dev_info_0e11_ae34,
- &pci_dev_info_0e11_ae35,
- &pci_dev_info_0e11_ae40,
- &pci_dev_info_0e11_ae43,
- &pci_dev_info_0e11_ae69,
- &pci_dev_info_0e11_ae6c,
- &pci_dev_info_0e11_ae6d,
- &pci_dev_info_0e11_b011,
- &pci_dev_info_0e11_b012,
- &pci_dev_info_0e11_b01e,
- &pci_dev_info_0e11_b01f,
- &pci_dev_info_0e11_b02f,
- &pci_dev_info_0e11_b030,
- &pci_dev_info_0e11_b04a,
- &pci_dev_info_0e11_b060,
- &pci_dev_info_0e11_b0c6,
- &pci_dev_info_0e11_b0c7,
- &pci_dev_info_0e11_b0d7,
- &pci_dev_info_0e11_b0dd,
- &pci_dev_info_0e11_b0de,
- &pci_dev_info_0e11_b0df,
- &pci_dev_info_0e11_b0e0,
- &pci_dev_info_0e11_b0e1,
- &pci_dev_info_0e11_b123,
- &pci_dev_info_0e11_b134,
- &pci_dev_info_0e11_b13c,
- &pci_dev_info_0e11_b144,
- &pci_dev_info_0e11_b163,
- &pci_dev_info_0e11_b164,
- &pci_dev_info_0e11_b178,
- &pci_dev_info_0e11_b1a4,
- &pci_dev_info_0e11_f130,
- &pci_dev_info_0e11_f150,
- NULL
-};
-#define pci_dev_list_0e55 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1000[] = {
- &pci_dev_info_1000_0001,
- &pci_dev_info_1000_0002,
- &pci_dev_info_1000_0003,
- &pci_dev_info_1000_0004,
- &pci_dev_info_1000_0005,
- &pci_dev_info_1000_0006,
- &pci_dev_info_1000_000a,
- &pci_dev_info_1000_000b,
- &pci_dev_info_1000_000c,
- &pci_dev_info_1000_000d,
- &pci_dev_info_1000_000f,
- &pci_dev_info_1000_0010,
- &pci_dev_info_1000_0012,
- &pci_dev_info_1000_0013,
- &pci_dev_info_1000_0020,
- &pci_dev_info_1000_0021,
- &pci_dev_info_1000_0030,
- &pci_dev_info_1000_0040,
- &pci_dev_info_1000_008f,
- &pci_dev_info_1000_0621,
- &pci_dev_info_1000_0622,
- &pci_dev_info_1000_0623,
- &pci_dev_info_1000_0624,
- &pci_dev_info_1000_0625,
- &pci_dev_info_1000_0626,
- &pci_dev_info_1000_0627,
- &pci_dev_info_1000_0628,
- &pci_dev_info_1000_0629,
- &pci_dev_info_1000_0701,
- &pci_dev_info_1000_0702,
- &pci_dev_info_1000_0901,
- &pci_dev_info_1000_1000,
- &pci_dev_info_1000_1960,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1001[] = {
- &pci_dev_info_1001_0010,
- &pci_dev_info_1001_0011,
- &pci_dev_info_1001_0012,
- &pci_dev_info_1001_0013,
- &pci_dev_info_1001_0014,
- &pci_dev_info_1001_0015,
- &pci_dev_info_1001_0016,
- &pci_dev_info_1001_0017,
- &pci_dev_info_1001_9100,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_1002[] = {
- &pci_dev_info_1002_4136,
- &pci_dev_info_1002_4144,
- &pci_dev_info_1002_4145,
- &pci_dev_info_1002_4146,
- &pci_dev_info_1002_4147,
- &pci_dev_info_1002_4158,
- &pci_dev_info_1002_4242,
- &pci_dev_info_1002_4336,
- &pci_dev_info_1002_4337,
- &pci_dev_info_1002_4354,
- &pci_dev_info_1002_4358,
- &pci_dev_info_1002_4554,
- &pci_dev_info_1002_4654,
- &pci_dev_info_1002_4742,
- &pci_dev_info_1002_4744,
- &pci_dev_info_1002_4747,
- &pci_dev_info_1002_4749,
- &pci_dev_info_1002_474c,
- &pci_dev_info_1002_474d,
- &pci_dev_info_1002_474e,
- &pci_dev_info_1002_474f,
- &pci_dev_info_1002_4750,
- &pci_dev_info_1002_4751,
- &pci_dev_info_1002_4752,
- &pci_dev_info_1002_4753,
- &pci_dev_info_1002_4754,
- &pci_dev_info_1002_4755,
- &pci_dev_info_1002_4756,
- &pci_dev_info_1002_4757,
- &pci_dev_info_1002_4758,
- &pci_dev_info_1002_4759,
- &pci_dev_info_1002_475a,
- &pci_dev_info_1002_4964,
- &pci_dev_info_1002_4965,
- &pci_dev_info_1002_4966,
- &pci_dev_info_1002_4967,
- &pci_dev_info_1002_496e,
- &pci_dev_info_1002_4c42,
- &pci_dev_info_1002_4c44,
- &pci_dev_info_1002_4c45,
- &pci_dev_info_1002_4c46,
- &pci_dev_info_1002_4c47,
- &pci_dev_info_1002_4c49,
- &pci_dev_info_1002_4c4d,
- &pci_dev_info_1002_4c4e,
- &pci_dev_info_1002_4c50,
- &pci_dev_info_1002_4c51,
- &pci_dev_info_1002_4c52,
- &pci_dev_info_1002_4c53,
- &pci_dev_info_1002_4c54,
- &pci_dev_info_1002_4c57,
- &pci_dev_info_1002_4c58,
- &pci_dev_info_1002_4c59,
- &pci_dev_info_1002_4c5a,
- &pci_dev_info_1002_4c64,
- &pci_dev_info_1002_4c65,
- &pci_dev_info_1002_4c66,
- &pci_dev_info_1002_4c67,
- &pci_dev_info_1002_4d46,
- &pci_dev_info_1002_4d4c,
- &pci_dev_info_1002_4e44,
- &pci_dev_info_1002_4e45,
- &pci_dev_info_1002_4e46,
- &pci_dev_info_1002_4e47,
- &pci_dev_info_1002_4e48,
- &pci_dev_info_1002_4e64,
- &pci_dev_info_1002_4e65,
- &pci_dev_info_1002_4e66,
- &pci_dev_info_1002_4e67,
- &pci_dev_info_1002_4e68,
- &pci_dev_info_1002_5041,
- &pci_dev_info_1002_5042,
- &pci_dev_info_1002_5043,
- &pci_dev_info_1002_5044,
- &pci_dev_info_1002_5045,
- &pci_dev_info_1002_5046,
- &pci_dev_info_1002_5047,
- &pci_dev_info_1002_5048,
- &pci_dev_info_1002_5049,
- &pci_dev_info_1002_504a,
- &pci_dev_info_1002_504b,
- &pci_dev_info_1002_504c,
- &pci_dev_info_1002_504d,
- &pci_dev_info_1002_504e,
- &pci_dev_info_1002_504f,
- &pci_dev_info_1002_5050,
- &pci_dev_info_1002_5051,
- &pci_dev_info_1002_5052,
- &pci_dev_info_1002_5053,
- &pci_dev_info_1002_5054,
- &pci_dev_info_1002_5055,
- &pci_dev_info_1002_5056,
- &pci_dev_info_1002_5057,
- &pci_dev_info_1002_5058,
- &pci_dev_info_1002_5144,
- &pci_dev_info_1002_5145,
- &pci_dev_info_1002_5146,
- &pci_dev_info_1002_5147,
- &pci_dev_info_1002_5148,
- &pci_dev_info_1002_5149,
- &pci_dev_info_1002_514a,
- &pci_dev_info_1002_514b,
- &pci_dev_info_1002_514c,
- &pci_dev_info_1002_514d,
- &pci_dev_info_1002_514e,
- &pci_dev_info_1002_514f,
- &pci_dev_info_1002_5157,
- &pci_dev_info_1002_5158,
- &pci_dev_info_1002_5159,
- &pci_dev_info_1002_515a,
- &pci_dev_info_1002_5168,
- &pci_dev_info_1002_5169,
- &pci_dev_info_1002_516a,
- &pci_dev_info_1002_516b,
- &pci_dev_info_1002_516c,
- &pci_dev_info_1002_5245,
- &pci_dev_info_1002_5246,
- &pci_dev_info_1002_5247,
- &pci_dev_info_1002_524b,
- &pci_dev_info_1002_524c,
- &pci_dev_info_1002_5345,
- &pci_dev_info_1002_5346,
- &pci_dev_info_1002_5347,
- &pci_dev_info_1002_5348,
- &pci_dev_info_1002_534b,
- &pci_dev_info_1002_534c,
- &pci_dev_info_1002_534d,
- &pci_dev_info_1002_534e,
- &pci_dev_info_1002_5354,
- &pci_dev_info_1002_5446,
- &pci_dev_info_1002_544c,
- &pci_dev_info_1002_5452,
- &pci_dev_info_1002_5453,
- &pci_dev_info_1002_5454,
- &pci_dev_info_1002_5455,
- &pci_dev_info_1002_5654,
- &pci_dev_info_1002_5655,
- &pci_dev_info_1002_5656,
- &pci_dev_info_1002_700f,
- &pci_dev_info_1002_7010,
- &pci_dev_info_1002_cab2,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1003[] = {
- &pci_dev_info_1003_0201,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1004[] = {
- &pci_dev_info_1004_0005,
- &pci_dev_info_1004_0006,
- &pci_dev_info_1004_0007,
- &pci_dev_info_1004_0008,
- &pci_dev_info_1004_0009,
- &pci_dev_info_1004_000c,
- &pci_dev_info_1004_000d,
- &pci_dev_info_1004_0101,
- &pci_dev_info_1004_0102,
- &pci_dev_info_1004_0103,
- &pci_dev_info_1004_0104,
- &pci_dev_info_1004_0105,
- &pci_dev_info_1004_0200,
- &pci_dev_info_1004_0280,
- &pci_dev_info_1004_0304,
- &pci_dev_info_1004_0305,
- &pci_dev_info_1004_0306,
- &pci_dev_info_1004_0307,
- &pci_dev_info_1004_0308,
- &pci_dev_info_1004_0702,
- &pci_dev_info_1004_0703,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_1005[] = {
- &pci_dev_info_1005_2064,
- &pci_dev_info_1005_2128,
- &pci_dev_info_1005_2301,
- &pci_dev_info_1005_2302,
- &pci_dev_info_1005_2364,
- &pci_dev_info_1005_2464,
- &pci_dev_info_1005_2501,
- NULL
-};
-#define pci_dev_list_1006 NULL
-#define pci_dev_list_1007 NULL
-#define pci_dev_list_1008 NULL
-#define pci_dev_list_100a NULL
-static const pciDeviceInfo *pci_dev_list_100b[] = {
- &pci_dev_info_100b_0001,
- &pci_dev_info_100b_0002,
- &pci_dev_info_100b_000e,
- &pci_dev_info_100b_000f,
- &pci_dev_info_100b_0011,
- &pci_dev_info_100b_0012,
- &pci_dev_info_100b_0020,
- &pci_dev_info_100b_0022,
- &pci_dev_info_100b_0500,
- &pci_dev_info_100b_0501,
- &pci_dev_info_100b_0502,
- &pci_dev_info_100b_0503,
- &pci_dev_info_100b_0504,
- &pci_dev_info_100b_0505,
- &pci_dev_info_100b_d001,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_100c[] = {
- &pci_dev_info_100c_3202,
- &pci_dev_info_100c_3205,
- &pci_dev_info_100c_3206,
- &pci_dev_info_100c_3207,
- &pci_dev_info_100c_3208,
- &pci_dev_info_100c_4702,
- NULL
-};
-#define pci_dev_list_100d NULL
-static const pciDeviceInfo *pci_dev_list_100e[] = {
- &pci_dev_info_100e_9000,
- &pci_dev_info_100e_9001,
- &pci_dev_info_100e_9002,
- &pci_dev_info_100e_9100,
- NULL
-};
-#define pci_dev_list_1010 NULL
-static const pciDeviceInfo *pci_dev_list_1011[] = {
- &pci_dev_info_1011_0001,
- &pci_dev_info_1011_0002,
- &pci_dev_info_1011_0004,
- &pci_dev_info_1011_0007,
- &pci_dev_info_1011_0008,
- &pci_dev_info_1011_0009,
- &pci_dev_info_1011_000a,
- &pci_dev_info_1011_000d,
- &pci_dev_info_1011_000f,
- &pci_dev_info_1011_0014,
- &pci_dev_info_1011_0016,
- &pci_dev_info_1011_0017,
- &pci_dev_info_1011_0019,
- &pci_dev_info_1011_001a,
- &pci_dev_info_1011_0021,
- &pci_dev_info_1011_0022,
- &pci_dev_info_1011_0023,
- &pci_dev_info_1011_0024,
- &pci_dev_info_1011_0025,
- &pci_dev_info_1011_0026,
- &pci_dev_info_1011_0034,
- &pci_dev_info_1011_0045,
- &pci_dev_info_1011_0046,
- &pci_dev_info_1011_1065,
- NULL
-};
-#define pci_dev_list_1012 NULL
-static const pciDeviceInfo *pci_dev_list_1013[] = {
- &pci_dev_info_1013_0038,
- &pci_dev_info_1013_0040,
- &pci_dev_info_1013_004c,
- &pci_dev_info_1013_00a0,
- &pci_dev_info_1013_00a2,
- &pci_dev_info_1013_00a4,
- &pci_dev_info_1013_00a8,
- &pci_dev_info_1013_00ac,
- &pci_dev_info_1013_00b0,
- &pci_dev_info_1013_00b8,
- &pci_dev_info_1013_00bc,
- &pci_dev_info_1013_00d0,
- &pci_dev_info_1013_00d2,
- &pci_dev_info_1013_00d4,
- &pci_dev_info_1013_00d5,
- &pci_dev_info_1013_00d6,
- &pci_dev_info_1013_00e8,
- &pci_dev_info_1013_1100,
- &pci_dev_info_1013_1110,
- &pci_dev_info_1013_1112,
- &pci_dev_info_1013_1113,
- &pci_dev_info_1013_1200,
- &pci_dev_info_1013_1202,
- &pci_dev_info_1013_1204,
- &pci_dev_info_1013_4400,
- &pci_dev_info_1013_6001,
- &pci_dev_info_1013_6003,
- &pci_dev_info_1013_6004,
- &pci_dev_info_1013_6005,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1014[] = {
- &pci_dev_info_1014_0002,
- &pci_dev_info_1014_0005,
- &pci_dev_info_1014_0007,
- &pci_dev_info_1014_000a,
- &pci_dev_info_1014_0017,
- &pci_dev_info_1014_0018,
- &pci_dev_info_1014_001b,
- &pci_dev_info_1014_001c,
- &pci_dev_info_1014_001d,
- &pci_dev_info_1014_0020,
- &pci_dev_info_1014_0022,
- &pci_dev_info_1014_002d,
- &pci_dev_info_1014_002e,
- &pci_dev_info_1014_0036,
- &pci_dev_info_1014_003a,
- &pci_dev_info_1014_003e,
- &pci_dev_info_1014_0045,
- &pci_dev_info_1014_0046,
- &pci_dev_info_1014_0047,
- &pci_dev_info_1014_0048,
- &pci_dev_info_1014_0049,
- &pci_dev_info_1014_004e,
- &pci_dev_info_1014_004f,
- &pci_dev_info_1014_0050,
- &pci_dev_info_1014_0053,
- &pci_dev_info_1014_0057,
- &pci_dev_info_1014_005c,
- &pci_dev_info_1014_007c,
- &pci_dev_info_1014_007d,
- &pci_dev_info_1014_0090,
- &pci_dev_info_1014_0095,
- &pci_dev_info_1014_0096,
- &pci_dev_info_1014_00a5,
- &pci_dev_info_1014_00a6,
- &pci_dev_info_1014_00b7,
- &pci_dev_info_1014_00be,
- &pci_dev_info_1014_00dc,
- &pci_dev_info_1014_00fc,
- &pci_dev_info_1014_0105,
- &pci_dev_info_1014_010f,
- &pci_dev_info_1014_0142,
- &pci_dev_info_1014_0144,
- &pci_dev_info_1014_0156,
- &pci_dev_info_1014_01a7,
- &pci_dev_info_1014_01bd,
- &pci_dev_info_1014_0302,
- &pci_dev_info_1014_ffff,
- NULL
-};
-#endif
-#define pci_dev_list_1015 NULL
-#define pci_dev_list_1016 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1017[] = {
- &pci_dev_info_1017_5343,
- NULL
-};
-#endif
-#define pci_dev_list_1018 NULL
-#define pci_dev_list_1019 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_101a[] = {
- &pci_dev_info_101a_0005,
- NULL
-};
-#endif
-#define pci_dev_list_101b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_101c[] = {
- &pci_dev_info_101c_0193,
- &pci_dev_info_101c_0196,
- &pci_dev_info_101c_0197,
- &pci_dev_info_101c_0296,
- &pci_dev_info_101c_3193,
- &pci_dev_info_101c_3197,
- &pci_dev_info_101c_3296,
- &pci_dev_info_101c_4296,
- &pci_dev_info_101c_9710,
- &pci_dev_info_101c_9712,
- &pci_dev_info_101c_c24a,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_101e[] = {
- &pci_dev_info_101e_1960,
- &pci_dev_info_101e_9010,
- &pci_dev_info_101e_9030,
- &pci_dev_info_101e_9031,
- &pci_dev_info_101e_9032,
- &pci_dev_info_101e_9033,
- &pci_dev_info_101e_9040,
- &pci_dev_info_101e_9060,
- &pci_dev_info_101e_9063,
- NULL
-};
-#endif
-#define pci_dev_list_101f NULL
-#define pci_dev_list_1020 NULL
-#define pci_dev_list_1021 NULL
-static const pciDeviceInfo *pci_dev_list_1022[] = {
- &pci_dev_info_1022_1100,
- &pci_dev_info_1022_1101,
- &pci_dev_info_1022_1102,
- &pci_dev_info_1022_1103,
- &pci_dev_info_1022_2000,
- &pci_dev_info_1022_2001,
- &pci_dev_info_1022_2020,
- &pci_dev_info_1022_2040,
- &pci_dev_info_1022_3000,
- &pci_dev_info_1022_7006,
- &pci_dev_info_1022_7007,
- &pci_dev_info_1022_700c,
- &pci_dev_info_1022_700d,
- &pci_dev_info_1022_700e,
- &pci_dev_info_1022_700f,
- &pci_dev_info_1022_7400,
- &pci_dev_info_1022_7401,
- &pci_dev_info_1022_7403,
- &pci_dev_info_1022_7404,
- &pci_dev_info_1022_7408,
- &pci_dev_info_1022_7409,
- &pci_dev_info_1022_740b,
- &pci_dev_info_1022_740c,
- &pci_dev_info_1022_7410,
- &pci_dev_info_1022_7411,
- &pci_dev_info_1022_7413,
- &pci_dev_info_1022_7414,
- &pci_dev_info_1022_7440,
- &pci_dev_info_1022_7441,
- &pci_dev_info_1022_7443,
- &pci_dev_info_1022_7445,
- &pci_dev_info_1022_7446,
- &pci_dev_info_1022_7448,
- &pci_dev_info_1022_7449,
- &pci_dev_info_1022_7450,
- &pci_dev_info_1022_7451,
- &pci_dev_info_1022_7454,
- &pci_dev_info_1022_7455,
- &pci_dev_info_1022_7460,
- &pci_dev_info_1022_7461,
- &pci_dev_info_1022_7462,
- &pci_dev_info_1022_7464,
- &pci_dev_info_1022_7468,
- &pci_dev_info_1022_7469,
- &pci_dev_info_1022_746a,
- &pci_dev_info_1022_746b,
- &pci_dev_info_1022_746d,
- &pci_dev_info_1022_746e,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_1023[] = {
- &pci_dev_info_1023_0194,
- &pci_dev_info_1023_2000,
- &pci_dev_info_1023_2001,
- &pci_dev_info_1023_8400,
- &pci_dev_info_1023_8420,
- &pci_dev_info_1023_8500,
- &pci_dev_info_1023_8520,
- &pci_dev_info_1023_8620,
- &pci_dev_info_1023_8820,
- &pci_dev_info_1023_9320,
- &pci_dev_info_1023_9350,
- &pci_dev_info_1023_9360,
- &pci_dev_info_1023_9382,
- &pci_dev_info_1023_9383,
- &pci_dev_info_1023_9385,
- &pci_dev_info_1023_9386,
- &pci_dev_info_1023_9388,
- &pci_dev_info_1023_9397,
- &pci_dev_info_1023_939a,
- &pci_dev_info_1023_9420,
- &pci_dev_info_1023_9430,
- &pci_dev_info_1023_9440,
- &pci_dev_info_1023_9460,
- &pci_dev_info_1023_9470,
- &pci_dev_info_1023_9520,
- &pci_dev_info_1023_9525,
- &pci_dev_info_1023_9540,
- &pci_dev_info_1023_9660,
- &pci_dev_info_1023_9680,
- &pci_dev_info_1023_9682,
- &pci_dev_info_1023_9683,
- &pci_dev_info_1023_9685,
- &pci_dev_info_1023_9750,
- &pci_dev_info_1023_9753,
- &pci_dev_info_1023_9754,
- &pci_dev_info_1023_9759,
- &pci_dev_info_1023_9783,
- &pci_dev_info_1023_9785,
- &pci_dev_info_1023_9850,
- &pci_dev_info_1023_9880,
- &pci_dev_info_1023_9910,
- &pci_dev_info_1023_9930,
- NULL
-};
-#define pci_dev_list_1024 NULL
-static const pciDeviceInfo *pci_dev_list_1025[] = {
- &pci_dev_info_1025_1435,
- &pci_dev_info_1025_1445,
- &pci_dev_info_1025_1449,
- &pci_dev_info_1025_1451,
- &pci_dev_info_1025_1461,
- &pci_dev_info_1025_1489,
- &pci_dev_info_1025_1511,
- &pci_dev_info_1025_1512,
- &pci_dev_info_1025_1513,
- &pci_dev_info_1025_1521,
- &pci_dev_info_1025_1523,
- &pci_dev_info_1025_1531,
- &pci_dev_info_1025_1533,
- &pci_dev_info_1025_1535,
- &pci_dev_info_1025_1541,
- &pci_dev_info_1025_1542,
- &pci_dev_info_1025_1543,
- &pci_dev_info_1025_1561,
- &pci_dev_info_1025_1621,
- &pci_dev_info_1025_1631,
- &pci_dev_info_1025_1641,
- &pci_dev_info_1025_1647,
- &pci_dev_info_1025_3141,
- &pci_dev_info_1025_3143,
- &pci_dev_info_1025_3145,
- &pci_dev_info_1025_3147,
- &pci_dev_info_1025_3149,
- &pci_dev_info_1025_3151,
- &pci_dev_info_1025_3307,
- &pci_dev_info_1025_3309,
- &pci_dev_info_1025_3321,
- &pci_dev_info_1025_5212,
- &pci_dev_info_1025_5215,
- &pci_dev_info_1025_5217,
- &pci_dev_info_1025_5219,
- &pci_dev_info_1025_5225,
- &pci_dev_info_1025_5229,
- &pci_dev_info_1025_5235,
- &pci_dev_info_1025_5237,
- &pci_dev_info_1025_5240,
- &pci_dev_info_1025_5241,
- &pci_dev_info_1025_5242,
- &pci_dev_info_1025_5243,
- &pci_dev_info_1025_5244,
- &pci_dev_info_1025_5247,
- &pci_dev_info_1025_5251,
- &pci_dev_info_1025_5427,
- &pci_dev_info_1025_5451,
- &pci_dev_info_1025_5453,
- &pci_dev_info_1025_7101,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_1028[] = {
- &pci_dev_info_1028_0001,
- &pci_dev_info_1028_0002,
- &pci_dev_info_1028_0003,
- &pci_dev_info_1028_0004,
- &pci_dev_info_1028_0005,
- &pci_dev_info_1028_0006,
- &pci_dev_info_1028_0007,
- &pci_dev_info_1028_0008,
- &pci_dev_info_1028_0009,
- &pci_dev_info_1028_000a,
- &pci_dev_info_1028_000c,
- &pci_dev_info_1028_000d,
- &pci_dev_info_1028_000e,
- &pci_dev_info_1028_000f,
- NULL
-};
-#define pci_dev_list_1029 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_102a[] = {
- &pci_dev_info_102a_0000,
- &pci_dev_info_102a_0010,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_102b[] = {
- &pci_dev_info_102b_0010,
- &pci_dev_info_102b_0100,
- &pci_dev_info_102b_0518,
- &pci_dev_info_102b_0519,
- &pci_dev_info_102b_051a,
- &pci_dev_info_102b_051b,
- &pci_dev_info_102b_051e,
- &pci_dev_info_102b_051f,
- &pci_dev_info_102b_0520,
- &pci_dev_info_102b_0521,
- &pci_dev_info_102b_0525,
- &pci_dev_info_102b_0527,
- &pci_dev_info_102b_0d10,
- &pci_dev_info_102b_1000,
- &pci_dev_info_102b_1001,
- &pci_dev_info_102b_2007,
- &pci_dev_info_102b_2527,
- &pci_dev_info_102b_4536,
- &pci_dev_info_102b_6573,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_102c[] = {
- &pci_dev_info_102c_00b8,
- &pci_dev_info_102c_00c0,
- &pci_dev_info_102c_00d0,
- &pci_dev_info_102c_00d8,
- &pci_dev_info_102c_00dc,
- &pci_dev_info_102c_00e0,
- &pci_dev_info_102c_00e4,
- &pci_dev_info_102c_00e5,
- &pci_dev_info_102c_00f0,
- &pci_dev_info_102c_00f4,
- &pci_dev_info_102c_00f5,
- &pci_dev_info_102c_0c30,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_102d[] = {
- &pci_dev_info_102d_50dc,
- NULL
-};
-#endif
-#define pci_dev_list_102e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_102f[] = {
- &pci_dev_info_102f_0009,
- &pci_dev_info_102f_0020,
- NULL
-};
-#endif
-#define pci_dev_list_1030 NULL
-static const pciDeviceInfo *pci_dev_list_1031[] = {
- &pci_dev_info_1031_5601,
- &pci_dev_info_1031_5607,
- &pci_dev_info_1031_5631,
- &pci_dev_info_1031_6057,
- NULL
-};
-#define pci_dev_list_1032 NULL
-static const pciDeviceInfo *pci_dev_list_1033[] = {
- &pci_dev_info_1033_0001,
- &pci_dev_info_1033_0002,
- &pci_dev_info_1033_0003,
- &pci_dev_info_1033_0004,
- &pci_dev_info_1033_0005,
- &pci_dev_info_1033_0006,
- &pci_dev_info_1033_0007,
- &pci_dev_info_1033_0008,
- &pci_dev_info_1033_0009,
- &pci_dev_info_1033_0016,
- &pci_dev_info_1033_001a,
- &pci_dev_info_1033_0021,
- &pci_dev_info_1033_0029,
- &pci_dev_info_1033_002a,
- &pci_dev_info_1033_002c,
- &pci_dev_info_1033_002d,
- &pci_dev_info_1033_0035,
- &pci_dev_info_1033_003b,
- &pci_dev_info_1033_003e,
- &pci_dev_info_1033_0046,
- &pci_dev_info_1033_005a,
- &pci_dev_info_1033_0063,
- &pci_dev_info_1033_0067,
- &pci_dev_info_1033_0074,
- &pci_dev_info_1033_009b,
- &pci_dev_info_1033_00a6,
- &pci_dev_info_1033_00cd,
- &pci_dev_info_1033_00e0,
- NULL
-};
-#define pci_dev_list_1034 NULL
-#define pci_dev_list_1035 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1036[] = {
- &pci_dev_info_1036_0000,
- NULL
-};
-#endif
-#define pci_dev_list_1037 NULL
-#define pci_dev_list_1038 NULL
-static const pciDeviceInfo *pci_dev_list_1039[] = {
- &pci_dev_info_1039_0001,
- &pci_dev_info_1039_0002,
- &pci_dev_info_1039_0006,
- &pci_dev_info_1039_0008,
- &pci_dev_info_1039_0009,
- &pci_dev_info_1039_0018,
- &pci_dev_info_1039_0200,
- &pci_dev_info_1039_0204,
- &pci_dev_info_1039_0205,
- &pci_dev_info_1039_0300,
- &pci_dev_info_1039_0310,
- &pci_dev_info_1039_0315,
- &pci_dev_info_1039_0325,
- &pci_dev_info_1039_0330,
- &pci_dev_info_1039_0406,
- &pci_dev_info_1039_0496,
- &pci_dev_info_1039_0530,
- &pci_dev_info_1039_0540,
- &pci_dev_info_1039_0597,
- &pci_dev_info_1039_0601,
- &pci_dev_info_1039_0620,
- &pci_dev_info_1039_0630,
- &pci_dev_info_1039_0633,
- &pci_dev_info_1039_0635,
- &pci_dev_info_1039_0645,
- &pci_dev_info_1039_0646,
- &pci_dev_info_1039_0648,
- &pci_dev_info_1039_0650,
- &pci_dev_info_1039_0651,
- &pci_dev_info_1039_0730,
- &pci_dev_info_1039_0733,
- &pci_dev_info_1039_0735,
- &pci_dev_info_1039_0740,
- &pci_dev_info_1039_0745,
- &pci_dev_info_1039_0755,
- &pci_dev_info_1039_0900,
- &pci_dev_info_1039_0961,
- &pci_dev_info_1039_0962,
- &pci_dev_info_1039_3602,
- &pci_dev_info_1039_5107,
- &pci_dev_info_1039_5300,
- &pci_dev_info_1039_5315,
- &pci_dev_info_1039_5401,
- &pci_dev_info_1039_5511,
- &pci_dev_info_1039_5513,
- &pci_dev_info_1039_5517,
- &pci_dev_info_1039_5571,
- &pci_dev_info_1039_5581,
- &pci_dev_info_1039_5582,
- &pci_dev_info_1039_5591,
- &pci_dev_info_1039_5596,
- &pci_dev_info_1039_5597,
- &pci_dev_info_1039_5600,
- &pci_dev_info_1039_6204,
- &pci_dev_info_1039_6205,
- &pci_dev_info_1039_6236,
- &pci_dev_info_1039_6300,
- &pci_dev_info_1039_6306,
- &pci_dev_info_1039_6325,
- &pci_dev_info_1039_6326,
- &pci_dev_info_1039_7001,
- &pci_dev_info_1039_7002,
- &pci_dev_info_1039_7007,
- &pci_dev_info_1039_7012,
- &pci_dev_info_1039_7013,
- &pci_dev_info_1039_7016,
- &pci_dev_info_1039_7018,
- NULL
-};
-#define pci_dev_list_103a NULL
-#define pci_dev_list_103b NULL
-static const pciDeviceInfo *pci_dev_list_103c[] = {
- &pci_dev_info_103c_1005,
- &pci_dev_info_103c_1006,
- &pci_dev_info_103c_1008,
- &pci_dev_info_103c_100a,
- &pci_dev_info_103c_1028,
- &pci_dev_info_103c_1029,
- &pci_dev_info_103c_102a,
- &pci_dev_info_103c_1030,
- &pci_dev_info_103c_1031,
- &pci_dev_info_103c_1040,
- &pci_dev_info_103c_1041,
- &pci_dev_info_103c_1042,
- &pci_dev_info_103c_1048,
- &pci_dev_info_103c_1064,
- &pci_dev_info_103c_108b,
- &pci_dev_info_103c_10c1,
- &pci_dev_info_103c_10ed,
- &pci_dev_info_103c_1200,
- &pci_dev_info_103c_1219,
- &pci_dev_info_103c_121a,
- &pci_dev_info_103c_121b,
- &pci_dev_info_103c_121c,
- &pci_dev_info_103c_1229,
- &pci_dev_info_103c_122a,
- &pci_dev_info_103c_122e,
- &pci_dev_info_103c_1290,
- &pci_dev_info_103c_12b4,
- &pci_dev_info_103c_2910,
- &pci_dev_info_103c_2925,
- NULL
-};
-#define pci_dev_list_103e NULL
-#define pci_dev_list_103f NULL
-#define pci_dev_list_1040 NULL
-#define pci_dev_list_1041 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1042[] = {
- &pci_dev_info_1042_1000,
- &pci_dev_info_1042_1001,
- &pci_dev_info_1042_3000,
- &pci_dev_info_1042_3010,
- &pci_dev_info_1042_3020,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1043[] = {
- &pci_dev_info_1043_0675,
- &pci_dev_info_1043_4021,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1044[] = {
- &pci_dev_info_1044_1012,
- &pci_dev_info_1044_a400,
- &pci_dev_info_1044_a500,
- &pci_dev_info_1044_a501,
- &pci_dev_info_1044_a511,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1045[] = {
- &pci_dev_info_1045_a0f8,
- &pci_dev_info_1045_c101,
- &pci_dev_info_1045_c178,
- &pci_dev_info_1045_c556,
- &pci_dev_info_1045_c557,
- &pci_dev_info_1045_c558,
- &pci_dev_info_1045_c567,
- &pci_dev_info_1045_c568,
- &pci_dev_info_1045_c569,
- &pci_dev_info_1045_c621,
- &pci_dev_info_1045_c700,
- &pci_dev_info_1045_c701,
- &pci_dev_info_1045_c814,
- &pci_dev_info_1045_c822,
- &pci_dev_info_1045_c824,
- &pci_dev_info_1045_c825,
- &pci_dev_info_1045_c832,
- &pci_dev_info_1045_c861,
- &pci_dev_info_1045_c895,
- &pci_dev_info_1045_c935,
- &pci_dev_info_1045_d568,
- &pci_dev_info_1045_d721,
- NULL
-};
-#endif
-#define pci_dev_list_1046 NULL
-#define pci_dev_list_1047 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1048[] = {
- &pci_dev_info_1048_0d22,
- &pci_dev_info_1048_1000,
- &pci_dev_info_1048_3000,
- NULL
-};
-#endif
-#define pci_dev_list_1049 NULL
-static const pciDeviceInfo *pci_dev_list_104a[] = {
- &pci_dev_info_104a_0008,
- &pci_dev_info_104a_0009,
- &pci_dev_info_104a_0010,
- &pci_dev_info_104a_0210,
- &pci_dev_info_104a_0981,
- &pci_dev_info_104a_1746,
- &pci_dev_info_104a_2774,
- &pci_dev_info_104a_3520,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_104b[] = {
- &pci_dev_info_104b_0140,
- &pci_dev_info_104b_1040,
- &pci_dev_info_104b_8130,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_104c[] = {
- &pci_dev_info_104c_0500,
- &pci_dev_info_104c_0508,
- &pci_dev_info_104c_1000,
- &pci_dev_info_104c_104c,
- &pci_dev_info_104c_3d04,
- &pci_dev_info_104c_3d07,
- &pci_dev_info_104c_8000,
- &pci_dev_info_104c_8009,
- &pci_dev_info_104c_8017,
- &pci_dev_info_104c_8019,
- &pci_dev_info_104c_8020,
- &pci_dev_info_104c_8021,
- &pci_dev_info_104c_8022,
- &pci_dev_info_104c_8023,
- &pci_dev_info_104c_8024,
- &pci_dev_info_104c_8026,
- &pci_dev_info_104c_8027,
- &pci_dev_info_104c_8400,
- &pci_dev_info_104c_a001,
- &pci_dev_info_104c_a100,
- &pci_dev_info_104c_a102,
- &pci_dev_info_104c_a106,
- &pci_dev_info_104c_ac10,
- &pci_dev_info_104c_ac11,
- &pci_dev_info_104c_ac12,
- &pci_dev_info_104c_ac13,
- &pci_dev_info_104c_ac15,
- &pci_dev_info_104c_ac16,
- &pci_dev_info_104c_ac17,
- &pci_dev_info_104c_ac18,
- &pci_dev_info_104c_ac19,
- &pci_dev_info_104c_ac1a,
- &pci_dev_info_104c_ac1b,
- &pci_dev_info_104c_ac1c,
- &pci_dev_info_104c_ac1d,
- &pci_dev_info_104c_ac1e,
- &pci_dev_info_104c_ac1f,
- &pci_dev_info_104c_ac20,
- &pci_dev_info_104c_ac21,
- &pci_dev_info_104c_ac22,
- &pci_dev_info_104c_ac23,
- &pci_dev_info_104c_ac28,
- &pci_dev_info_104c_ac30,
- &pci_dev_info_104c_ac40,
- &pci_dev_info_104c_ac41,
- &pci_dev_info_104c_ac42,
- &pci_dev_info_104c_ac50,
- &pci_dev_info_104c_ac51,
- &pci_dev_info_104c_ac52,
- &pci_dev_info_104c_ac53,
- &pci_dev_info_104c_ac55,
- &pci_dev_info_104c_ac56,
- &pci_dev_info_104c_ac60,
- &pci_dev_info_104c_fe00,
- &pci_dev_info_104c_fe03,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_104d[] = {
- &pci_dev_info_104d_8009,
- &pci_dev_info_104d_8039,
- &pci_dev_info_104d_8056,
- &pci_dev_info_104d_808a,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_104e[] = {
- &pci_dev_info_104e_0017,
- &pci_dev_info_104e_0107,
- &pci_dev_info_104e_0109,
- &pci_dev_info_104e_0111,
- &pci_dev_info_104e_0217,
- &pci_dev_info_104e_0317,
- NULL
-};
-#define pci_dev_list_104f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1050[] = {
- &pci_dev_info_1050_0000,
- &pci_dev_info_1050_0001,
- &pci_dev_info_1050_0105,
- &pci_dev_info_1050_0840,
- &pci_dev_info_1050_0940,
- &pci_dev_info_1050_5a5a,
- &pci_dev_info_1050_6692,
- &pci_dev_info_1050_9970,
- NULL
-};
-#endif
-#define pci_dev_list_1051 NULL
-#define pci_dev_list_1052 NULL
-#define pci_dev_list_1053 NULL
-#define pci_dev_list_1054 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1055[] = {
- &pci_dev_info_1055_9130,
- &pci_dev_info_1055_9460,
- &pci_dev_info_1055_9462,
- &pci_dev_info_1055_9463,
- NULL
-};
-#endif
-#define pci_dev_list_1056 NULL
-static const pciDeviceInfo *pci_dev_list_1057[] = {
- &pci_dev_info_1057_0001,
- &pci_dev_info_1057_0002,
- &pci_dev_info_1057_0003,
- &pci_dev_info_1057_0004,
- &pci_dev_info_1057_0006,
- &pci_dev_info_1057_0100,
- &pci_dev_info_1057_0431,
- &pci_dev_info_1057_1801,
- &pci_dev_info_1057_18c0,
- &pci_dev_info_1057_4801,
- &pci_dev_info_1057_4802,
- &pci_dev_info_1057_4803,
- &pci_dev_info_1057_4806,
- &pci_dev_info_1057_4d68,
- &pci_dev_info_1057_5600,
- &pci_dev_info_1057_6400,
- NULL
-};
-#define pci_dev_list_1058 NULL
-#define pci_dev_list_1059 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_105a[] = {
- &pci_dev_info_105a_0d30,
- &pci_dev_info_105a_0d38,
- &pci_dev_info_105a_1275,
- &pci_dev_info_105a_3376,
- &pci_dev_info_105a_4d30,
- &pci_dev_info_105a_4d33,
- &pci_dev_info_105a_4d38,
- &pci_dev_info_105a_4d68,
- &pci_dev_info_105a_4d69,
- &pci_dev_info_105a_5275,
- &pci_dev_info_105a_5300,
- &pci_dev_info_105a_6268,
- &pci_dev_info_105a_6269,
- &pci_dev_info_105a_6621,
- &pci_dev_info_105a_7275,
- NULL
-};
-#endif
-#define pci_dev_list_105b NULL
-#define pci_dev_list_105c NULL
-static const pciDeviceInfo *pci_dev_list_105d[] = {
- &pci_dev_info_105d_2309,
- &pci_dev_info_105d_2339,
- &pci_dev_info_105d_493d,
- &pci_dev_info_105d_5348,
- NULL
-};
-#define pci_dev_list_105e NULL
-#define pci_dev_list_105f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1060[] = {
- &pci_dev_info_1060_0001,
- &pci_dev_info_1060_0002,
- &pci_dev_info_1060_0101,
- &pci_dev_info_1060_0881,
- &pci_dev_info_1060_0886,
- &pci_dev_info_1060_0891,
- &pci_dev_info_1060_1001,
- &pci_dev_info_1060_673a,
- &pci_dev_info_1060_673b,
- &pci_dev_info_1060_8710,
- &pci_dev_info_1060_886a,
- &pci_dev_info_1060_8881,
- &pci_dev_info_1060_8886,
- &pci_dev_info_1060_888a,
- &pci_dev_info_1060_8891,
- &pci_dev_info_1060_9017,
- &pci_dev_info_1060_9018,
- &pci_dev_info_1060_9026,
- &pci_dev_info_1060_e881,
- &pci_dev_info_1060_e886,
- &pci_dev_info_1060_e88a,
- &pci_dev_info_1060_e891,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1061[] = {
- &pci_dev_info_1061_0001,
- &pci_dev_info_1061_0002,
- NULL
-};
-#endif
-#define pci_dev_list_1062 NULL
-#define pci_dev_list_1063 NULL
-#define pci_dev_list_1064 NULL
-#define pci_dev_list_1065 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1066[] = {
- &pci_dev_info_1066_0000,
- &pci_dev_info_1066_0001,
- &pci_dev_info_1066_0002,
- &pci_dev_info_1066_0003,
- &pci_dev_info_1066_0004,
- &pci_dev_info_1066_0005,
- &pci_dev_info_1066_8002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1067[] = {
- &pci_dev_info_1067_1002,
- NULL
-};
-#endif
-#define pci_dev_list_1068 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1069[] = {
- &pci_dev_info_1069_0001,
- &pci_dev_info_1069_0002,
- &pci_dev_info_1069_0010,
- &pci_dev_info_1069_0050,
- &pci_dev_info_1069_ba55,
- &pci_dev_info_1069_ba56,
- NULL
-};
-#endif
-#define pci_dev_list_106a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_106b[] = {
- &pci_dev_info_106b_0001,
- &pci_dev_info_106b_0002,
- &pci_dev_info_106b_0003,
- &pci_dev_info_106b_0004,
- &pci_dev_info_106b_0007,
- &pci_dev_info_106b_000e,
- &pci_dev_info_106b_0010,
- &pci_dev_info_106b_0017,
- &pci_dev_info_106b_0018,
- &pci_dev_info_106b_0019,
- &pci_dev_info_106b_001e,
- &pci_dev_info_106b_001f,
- &pci_dev_info_106b_0020,
- &pci_dev_info_106b_0021,
- &pci_dev_info_106b_0022,
- &pci_dev_info_106b_0024,
- &pci_dev_info_106b_0025,
- &pci_dev_info_106b_0026,
- &pci_dev_info_106b_0027,
- &pci_dev_info_106b_0028,
- &pci_dev_info_106b_0029,
- &pci_dev_info_106b_002d,
- &pci_dev_info_106b_002e,
- &pci_dev_info_106b_002f,
- &pci_dev_info_106b_0030,
- &pci_dev_info_106b_0031,
- &pci_dev_info_106b_0032,
- &pci_dev_info_106b_0033,
- &pci_dev_info_106b_0034,
- &pci_dev_info_106b_1645,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_106c[] = {
- &pci_dev_info_106c_8801,
- &pci_dev_info_106c_8802,
- &pci_dev_info_106c_8803,
- &pci_dev_info_106c_8804,
- &pci_dev_info_106c_8805,
- NULL
-};
-#endif
-#define pci_dev_list_106d NULL
-#define pci_dev_list_106e NULL
-#define pci_dev_list_106f NULL
-#define pci_dev_list_1070 NULL
-#define pci_dev_list_1071 NULL
-#define pci_dev_list_1072 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1073[] = {
- &pci_dev_info_1073_0001,
- &pci_dev_info_1073_0002,
- &pci_dev_info_1073_0003,
- &pci_dev_info_1073_0004,
- &pci_dev_info_1073_0005,
- &pci_dev_info_1073_0006,
- &pci_dev_info_1073_0008,
- &pci_dev_info_1073_000a,
- &pci_dev_info_1073_000c,
- &pci_dev_info_1073_000d,
- &pci_dev_info_1073_0010,
- &pci_dev_info_1073_0012,
- &pci_dev_info_1073_0020,
- &pci_dev_info_1073_2000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1074[] = {
- &pci_dev_info_1074_4e78,
- NULL
-};
-#endif
-#define pci_dev_list_1075 NULL
-#define pci_dev_list_1076 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1077[] = {
- &pci_dev_info_1077_1016,
- &pci_dev_info_1077_1020,
- &pci_dev_info_1077_1022,
- &pci_dev_info_1077_1080,
- &pci_dev_info_1077_1216,
- &pci_dev_info_1077_1240,
- &pci_dev_info_1077_1280,
- &pci_dev_info_1077_2020,
- &pci_dev_info_1077_2100,
- &pci_dev_info_1077_2200,
- &pci_dev_info_1077_2300,
- &pci_dev_info_1077_2312,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_1078[] = {
- &pci_dev_info_1078_0000,
- &pci_dev_info_1078_0001,
- &pci_dev_info_1078_0002,
- &pci_dev_info_1078_0100,
- &pci_dev_info_1078_0101,
- &pci_dev_info_1078_0102,
- &pci_dev_info_1078_0103,
- &pci_dev_info_1078_0104,
- &pci_dev_info_1078_0400,
- &pci_dev_info_1078_0401,
- &pci_dev_info_1078_0402,
- &pci_dev_info_1078_0403,
- NULL
-};
-#define pci_dev_list_1079 NULL
-#define pci_dev_list_107a NULL
-#define pci_dev_list_107b NULL
-#define pci_dev_list_107c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_107d[] = {
- &pci_dev_info_107d_0000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_107e[] = {
- &pci_dev_info_107e_0001,
- &pci_dev_info_107e_0002,
- &pci_dev_info_107e_0004,
- &pci_dev_info_107e_0005,
- &pci_dev_info_107e_0008,
- &pci_dev_info_107e_9003,
- &pci_dev_info_107e_9007,
- &pci_dev_info_107e_9008,
- &pci_dev_info_107e_900c,
- &pci_dev_info_107e_900e,
- &pci_dev_info_107e_9011,
- &pci_dev_info_107e_9013,
- &pci_dev_info_107e_9023,
- &pci_dev_info_107e_9027,
- &pci_dev_info_107e_9031,
- &pci_dev_info_107e_9033,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_107f[] = {
- &pci_dev_info_107f_0802,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1080[] = {
- &pci_dev_info_1080_0600,
- &pci_dev_info_1080_c691,
- &pci_dev_info_1080_c693,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1081[] = {
- &pci_dev_info_1081_0d47,
- NULL
-};
-#endif
-#define pci_dev_list_1082 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1083[] = {
- &pci_dev_info_1083_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1084 NULL
-#define pci_dev_list_1085 NULL
-#define pci_dev_list_1086 NULL
-#define pci_dev_list_1087 NULL
-#define pci_dev_list_1088 NULL
-#define pci_dev_list_1089 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_108a[] = {
- &pci_dev_info_108a_0001,
- &pci_dev_info_108a_0010,
- &pci_dev_info_108a_0040,
- &pci_dev_info_108a_3000,
- NULL
-};
-#endif
-#define pci_dev_list_108c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_108d[] = {
- &pci_dev_info_108d_0001,
- &pci_dev_info_108d_0002,
- &pci_dev_info_108d_0004,
- &pci_dev_info_108d_0005,
- &pci_dev_info_108d_0006,
- &pci_dev_info_108d_0007,
- &pci_dev_info_108d_0008,
- &pci_dev_info_108d_0011,
- &pci_dev_info_108d_0012,
- &pci_dev_info_108d_0013,
- &pci_dev_info_108d_0014,
- &pci_dev_info_108d_0019,
- &pci_dev_info_108d_0021,
- &pci_dev_info_108d_0022,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_108e[] = {
- &pci_dev_info_108e_0001,
- &pci_dev_info_108e_1000,
- &pci_dev_info_108e_1001,
- &pci_dev_info_108e_1100,
- &pci_dev_info_108e_1101,
- &pci_dev_info_108e_1102,
- &pci_dev_info_108e_1103,
- &pci_dev_info_108e_2bad,
- &pci_dev_info_108e_5000,
- &pci_dev_info_108e_5043,
- &pci_dev_info_108e_8000,
- &pci_dev_info_108e_8001,
- &pci_dev_info_108e_a000,
- &pci_dev_info_108e_a001,
- NULL
-};
-#define pci_dev_list_108f NULL
-#define pci_dev_list_1090 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1091[] = {
- &pci_dev_info_1091_0020,
- &pci_dev_info_1091_0021,
- &pci_dev_info_1091_0040,
- &pci_dev_info_1091_0041,
- &pci_dev_info_1091_0060,
- &pci_dev_info_1091_00e4,
- &pci_dev_info_1091_0720,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_1092[] = {
- &pci_dev_info_1092_00a0,
- &pci_dev_info_1092_00a8,
- &pci_dev_info_1092_0550,
- &pci_dev_info_1092_08d4,
- &pci_dev_info_1092_094c,
- &pci_dev_info_1092_1092,
- &pci_dev_info_1092_6120,
- &pci_dev_info_1092_8810,
- &pci_dev_info_1092_8811,
- &pci_dev_info_1092_8880,
- &pci_dev_info_1092_8881,
- &pci_dev_info_1092_88b0,
- &pci_dev_info_1092_88b1,
- &pci_dev_info_1092_88c0,
- &pci_dev_info_1092_88c1,
- &pci_dev_info_1092_88d0,
- &pci_dev_info_1092_88d1,
- &pci_dev_info_1092_88f0,
- &pci_dev_info_1092_88f1,
- &pci_dev_info_1092_9999,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1093[] = {
- &pci_dev_info_1093_0160,
- &pci_dev_info_1093_0162,
- &pci_dev_info_1093_1170,
- &pci_dev_info_1093_1180,
- &pci_dev_info_1093_1190,
- &pci_dev_info_1093_1330,
- &pci_dev_info_1093_1350,
- &pci_dev_info_1093_2a60,
- &pci_dev_info_1093_b001,
- &pci_dev_info_1093_b011,
- &pci_dev_info_1093_b021,
- &pci_dev_info_1093_b031,
- &pci_dev_info_1093_b041,
- &pci_dev_info_1093_b051,
- &pci_dev_info_1093_b061,
- &pci_dev_info_1093_b071,
- &pci_dev_info_1093_b081,
- &pci_dev_info_1093_b091,
- &pci_dev_info_1093_c801,
- &pci_dev_info_1093_c831,
- NULL
-};
-#endif
-#define pci_dev_list_1094 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1095[] = {
- &pci_dev_info_1095_0240,
- &pci_dev_info_1095_0640,
- &pci_dev_info_1095_0643,
- &pci_dev_info_1095_0646,
- &pci_dev_info_1095_0647,
- &pci_dev_info_1095_0648,
- &pci_dev_info_1095_0649,
- &pci_dev_info_1095_0650,
- &pci_dev_info_1095_0670,
- &pci_dev_info_1095_0673,
- &pci_dev_info_1095_0680,
- &pci_dev_info_1095_3112,
- NULL
-};
-#endif
-#define pci_dev_list_1096 NULL
-#define pci_dev_list_1097 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1098[] = {
- &pci_dev_info_1098_0001,
- &pci_dev_info_1098_0002,
- NULL
-};
-#endif
-#define pci_dev_list_1099 NULL
-#define pci_dev_list_109a NULL
-#define pci_dev_list_109b NULL
-#define pci_dev_list_109c NULL
-#define pci_dev_list_109d NULL
-static const pciDeviceInfo *pci_dev_list_109e[] = {
- &pci_dev_info_109e_0350,
- &pci_dev_info_109e_0351,
- &pci_dev_info_109e_0369,
- &pci_dev_info_109e_036c,
- &pci_dev_info_109e_036e,
- &pci_dev_info_109e_036f,
- &pci_dev_info_109e_0370,
- &pci_dev_info_109e_0878,
- &pci_dev_info_109e_0879,
- &pci_dev_info_109e_0880,
- &pci_dev_info_109e_2115,
- &pci_dev_info_109e_2125,
- &pci_dev_info_109e_2164,
- &pci_dev_info_109e_2165,
- &pci_dev_info_109e_8230,
- &pci_dev_info_109e_8472,
- &pci_dev_info_109e_8474,
- NULL
-};
-#define pci_dev_list_109f NULL
-#define pci_dev_list_10a0 NULL
-#define pci_dev_list_10a1 NULL
-#define pci_dev_list_10a2 NULL
-#define pci_dev_list_10a3 NULL
-#define pci_dev_list_10a4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10a5[] = {
- &pci_dev_info_10a5_3052,
- &pci_dev_info_10a5_5449,
- NULL
-};
-#endif
-#define pci_dev_list_10a6 NULL
-#define pci_dev_list_10a7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10a8[] = {
- &pci_dev_info_10a8_0000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10a9[] = {
- &pci_dev_info_10a9_0001,
- &pci_dev_info_10a9_0002,
- &pci_dev_info_10a9_0003,
- &pci_dev_info_10a9_0004,
- &pci_dev_info_10a9_0005,
- &pci_dev_info_10a9_0006,
- &pci_dev_info_10a9_0007,
- &pci_dev_info_10a9_0008,
- &pci_dev_info_10a9_0009,
- &pci_dev_info_10a9_0010,
- &pci_dev_info_10a9_0011,
- &pci_dev_info_10a9_0012,
- &pci_dev_info_10a9_1001,
- &pci_dev_info_10a9_1002,
- &pci_dev_info_10a9_1003,
- &pci_dev_info_10a9_1004,
- &pci_dev_info_10a9_1005,
- &pci_dev_info_10a9_1006,
- &pci_dev_info_10a9_1007,
- &pci_dev_info_10a9_1008,
- &pci_dev_info_10a9_100a,
- &pci_dev_info_10a9_2001,
- &pci_dev_info_10a9_2002,
- &pci_dev_info_10a9_8001,
- &pci_dev_info_10a9_8002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10aa[] = {
- &pci_dev_info_10aa_0000,
- NULL
-};
-#endif
-#define pci_dev_list_10ab NULL
-#define pci_dev_list_10ac NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ad[] = {
- &pci_dev_info_10ad_0001,
- &pci_dev_info_10ad_0003,
- &pci_dev_info_10ad_0005,
- &pci_dev_info_10ad_0103,
- &pci_dev_info_10ad_0105,
- &pci_dev_info_10ad_0565,
- NULL
-};
-#endif
-#define pci_dev_list_10ae NULL
-#define pci_dev_list_10af NULL
-#define pci_dev_list_10b0 NULL
-#define pci_dev_list_10b1 NULL
-#define pci_dev_list_10b2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b3[] = {
- &pci_dev_info_10b3_3106,
- &pci_dev_info_10b3_b106,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b4[] = {
- &pci_dev_info_10b4_1b1d,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b5[] = {
- &pci_dev_info_10b5_0001,
- &pci_dev_info_10b5_1076,
- &pci_dev_info_10b5_1077,
- &pci_dev_info_10b5_1078,
- &pci_dev_info_10b5_1103,
- &pci_dev_info_10b5_1146,
- &pci_dev_info_10b5_1147,
- &pci_dev_info_10b5_2724,
- &pci_dev_info_10b5_9030,
- &pci_dev_info_10b5_9036,
- &pci_dev_info_10b5_9050,
- &pci_dev_info_10b5_9054,
- &pci_dev_info_10b5_9060,
- &pci_dev_info_10b5_906d,
- &pci_dev_info_10b5_906e,
- &pci_dev_info_10b5_9080,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b6[] = {
- &pci_dev_info_10b6_0001,
- &pci_dev_info_10b6_0002,
- &pci_dev_info_10b6_0003,
- &pci_dev_info_10b6_0004,
- &pci_dev_info_10b6_0006,
- &pci_dev_info_10b6_0007,
- &pci_dev_info_10b6_0009,
- &pci_dev_info_10b6_000a,
- &pci_dev_info_10b6_000b,
- &pci_dev_info_10b6_000c,
- &pci_dev_info_10b6_1000,
- &pci_dev_info_10b6_1001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b7[] = {
- &pci_dev_info_10b7_0001,
- &pci_dev_info_10b7_0910,
- &pci_dev_info_10b7_1006,
- &pci_dev_info_10b7_1007,
- &pci_dev_info_10b7_3390,
- &pci_dev_info_10b7_3590,
- &pci_dev_info_10b7_4500,
- &pci_dev_info_10b7_5055,
- &pci_dev_info_10b7_5057,
- &pci_dev_info_10b7_5157,
- &pci_dev_info_10b7_5257,
- &pci_dev_info_10b7_5900,
- &pci_dev_info_10b7_5920,
- &pci_dev_info_10b7_5950,
- &pci_dev_info_10b7_5951,
- &pci_dev_info_10b7_5952,
- &pci_dev_info_10b7_5970,
- &pci_dev_info_10b7_5b57,
- &pci_dev_info_10b7_6055,
- &pci_dev_info_10b7_6056,
- &pci_dev_info_10b7_6560,
- &pci_dev_info_10b7_6561,
- &pci_dev_info_10b7_6562,
- &pci_dev_info_10b7_6563,
- &pci_dev_info_10b7_6564,
- &pci_dev_info_10b7_7646,
- &pci_dev_info_10b7_7940,
- &pci_dev_info_10b7_7980,
- &pci_dev_info_10b7_7990,
- &pci_dev_info_10b7_8811,
- &pci_dev_info_10b7_9000,
- &pci_dev_info_10b7_9001,
- &pci_dev_info_10b7_9004,
- &pci_dev_info_10b7_9005,
- &pci_dev_info_10b7_9006,
- &pci_dev_info_10b7_900a,
- &pci_dev_info_10b7_9050,
- &pci_dev_info_10b7_9051,
- &pci_dev_info_10b7_9055,
- &pci_dev_info_10b7_9056,
- &pci_dev_info_10b7_9058,
- &pci_dev_info_10b7_905a,
- &pci_dev_info_10b7_9200,
- &pci_dev_info_10b7_9201,
- &pci_dev_info_10b7_9300,
- &pci_dev_info_10b7_9800,
- &pci_dev_info_10b7_9805,
- &pci_dev_info_10b7_9900,
- &pci_dev_info_10b7_9902,
- &pci_dev_info_10b7_9903,
- &pci_dev_info_10b7_9904,
- &pci_dev_info_10b7_9905,
- &pci_dev_info_10b7_9908,
- &pci_dev_info_10b7_9909,
- &pci_dev_info_10b7_990b,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b8[] = {
- &pci_dev_info_10b8_0005,
- &pci_dev_info_10b8_0006,
- &pci_dev_info_10b8_1000,
- &pci_dev_info_10b8_1001,
- &pci_dev_info_10b8_a011,
- &pci_dev_info_10b8_b106,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10b9[] = {
- &pci_dev_info_10b9_0111,
- &pci_dev_info_10b9_1435,
- &pci_dev_info_10b9_1445,
- &pci_dev_info_10b9_1449,
- &pci_dev_info_10b9_1451,
- &pci_dev_info_10b9_1461,
- &pci_dev_info_10b9_1489,
- &pci_dev_info_10b9_1511,
- &pci_dev_info_10b9_1512,
- &pci_dev_info_10b9_1513,
- &pci_dev_info_10b9_1521,
- &pci_dev_info_10b9_1523,
- &pci_dev_info_10b9_1531,
- &pci_dev_info_10b9_1533,
- &pci_dev_info_10b9_1541,
- &pci_dev_info_10b9_1543,
- &pci_dev_info_10b9_1563,
- &pci_dev_info_10b9_1621,
- &pci_dev_info_10b9_1631,
- &pci_dev_info_10b9_1632,
- &pci_dev_info_10b9_1641,
- &pci_dev_info_10b9_1644,
- &pci_dev_info_10b9_1646,
- &pci_dev_info_10b9_1647,
- &pci_dev_info_10b9_1651,
- &pci_dev_info_10b9_1671,
- &pci_dev_info_10b9_1681,
- &pci_dev_info_10b9_1687,
- &pci_dev_info_10b9_3141,
- &pci_dev_info_10b9_3143,
- &pci_dev_info_10b9_3145,
- &pci_dev_info_10b9_3147,
- &pci_dev_info_10b9_3149,
- &pci_dev_info_10b9_3151,
- &pci_dev_info_10b9_3307,
- &pci_dev_info_10b9_3309,
- &pci_dev_info_10b9_5212,
- &pci_dev_info_10b9_5215,
- &pci_dev_info_10b9_5217,
- &pci_dev_info_10b9_5219,
- &pci_dev_info_10b9_5225,
- &pci_dev_info_10b9_5229,
- &pci_dev_info_10b9_5235,
- &pci_dev_info_10b9_5237,
- &pci_dev_info_10b9_5239,
- &pci_dev_info_10b9_5243,
- &pci_dev_info_10b9_5247,
- &pci_dev_info_10b9_5249,
- &pci_dev_info_10b9_5251,
- &pci_dev_info_10b9_5253,
- &pci_dev_info_10b9_5261,
- &pci_dev_info_10b9_5450,
- &pci_dev_info_10b9_5451,
- &pci_dev_info_10b9_5453,
- &pci_dev_info_10b9_5455,
- &pci_dev_info_10b9_5457,
- &pci_dev_info_10b9_5459,
- &pci_dev_info_10b9_545a,
- &pci_dev_info_10b9_5471,
- &pci_dev_info_10b9_5473,
- &pci_dev_info_10b9_7101,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ba[] = {
- &pci_dev_info_10ba_0301,
- NULL
-};
-#endif
-#define pci_dev_list_10bb NULL
-#define pci_dev_list_10bc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10bd[] = {
- &pci_dev_info_10bd_0e34,
- NULL
-};
-#endif
-#define pci_dev_list_10be NULL
-#define pci_dev_list_10bf NULL
-#define pci_dev_list_10c0 NULL
-#define pci_dev_list_10c1 NULL
-#define pci_dev_list_10c2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10c3[] = {
- &pci_dev_info_10c3_1100,
- NULL
-};
-#endif
-#define pci_dev_list_10c4 NULL
-#define pci_dev_list_10c5 NULL
-#define pci_dev_list_10c6 NULL
-#define pci_dev_list_10c7 NULL
-static const pciDeviceInfo *pci_dev_list_10c8[] = {
- &pci_dev_info_10c8_0001,
- &pci_dev_info_10c8_0002,
- &pci_dev_info_10c8_0003,
- &pci_dev_info_10c8_0004,
- &pci_dev_info_10c8_0005,
- &pci_dev_info_10c8_0006,
- &pci_dev_info_10c8_0016,
- &pci_dev_info_10c8_0025,
- &pci_dev_info_10c8_0083,
- &pci_dev_info_10c8_8005,
- &pci_dev_info_10c8_8006,
- &pci_dev_info_10c8_8016,
- NULL
-};
-#define pci_dev_list_10c9 NULL
-#define pci_dev_list_10ca NULL
-#define pci_dev_list_10cb NULL
-#define pci_dev_list_10cc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10cd[] = {
- &pci_dev_info_10cd_1100,
- &pci_dev_info_10cd_1200,
- &pci_dev_info_10cd_1300,
- &pci_dev_info_10cd_2300,
- &pci_dev_info_10cd_2500,
- NULL
-};
-#endif
-#define pci_dev_list_10ce NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10cf[] = {
- &pci_dev_info_10cf_2001,
- NULL
-};
-#endif
-#define pci_dev_list_10d0 NULL
-#define pci_dev_list_10d1 NULL
-#define pci_dev_list_10d2 NULL
-#define pci_dev_list_10d3 NULL
-#define pci_dev_list_10d4 NULL
-#define pci_dev_list_10d5 NULL
-#define pci_dev_list_10d6 NULL
-#define pci_dev_list_10d7 NULL
-#define pci_dev_list_10d8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10d9[] = {
- &pci_dev_info_10d9_0512,
- &pci_dev_info_10d9_0531,
- &pci_dev_info_10d9_8625,
- &pci_dev_info_10d9_8888,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10da[] = {
- &pci_dev_info_10da_0508,
- &pci_dev_info_10da_3390,
- NULL
-};
-#endif
-#define pci_dev_list_10db NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10dc[] = {
- &pci_dev_info_10dc_0001,
- &pci_dev_info_10dc_0002,
- &pci_dev_info_10dc_0021,
- &pci_dev_info_10dc_0022,
- &pci_dev_info_10dc_10dc,
- NULL
-};
-#endif
-#define pci_dev_list_10dd NULL
-static const pciDeviceInfo *pci_dev_list_10de[] = {
- &pci_dev_info_10de_0008,
- &pci_dev_info_10de_0009,
- &pci_dev_info_10de_0010,
- &pci_dev_info_10de_0020,
- &pci_dev_info_10de_0028,
- &pci_dev_info_10de_0029,
- &pci_dev_info_10de_002a,
- &pci_dev_info_10de_002b,
- &pci_dev_info_10de_002c,
- &pci_dev_info_10de_002d,
- &pci_dev_info_10de_002e,
- &pci_dev_info_10de_002f,
- &pci_dev_info_10de_0060,
- &pci_dev_info_10de_0064,
- &pci_dev_info_10de_0065,
- &pci_dev_info_10de_0066,
- &pci_dev_info_10de_0067,
- &pci_dev_info_10de_0068,
- &pci_dev_info_10de_006a,
- &pci_dev_info_10de_006b,
- &pci_dev_info_10de_006e,
- &pci_dev_info_10de_00a0,
- &pci_dev_info_10de_0100,
- &pci_dev_info_10de_0101,
- &pci_dev_info_10de_0103,
- &pci_dev_info_10de_0110,
- &pci_dev_info_10de_0111,
- &pci_dev_info_10de_0112,
- &pci_dev_info_10de_0113,
- &pci_dev_info_10de_0150,
- &pci_dev_info_10de_0151,
- &pci_dev_info_10de_0152,
- &pci_dev_info_10de_0153,
- &pci_dev_info_10de_0170,
- &pci_dev_info_10de_0171,
- &pci_dev_info_10de_0172,
- &pci_dev_info_10de_0173,
- &pci_dev_info_10de_0174,
- &pci_dev_info_10de_0175,
- &pci_dev_info_10de_0176,
- &pci_dev_info_10de_0178,
- &pci_dev_info_10de_0179,
- &pci_dev_info_10de_017a,
- &pci_dev_info_10de_017b,
- &pci_dev_info_10de_017c,
- &pci_dev_info_10de_0181,
- &pci_dev_info_10de_0182,
- &pci_dev_info_10de_0183,
- &pci_dev_info_10de_0188,
- &pci_dev_info_10de_018a,
- &pci_dev_info_10de_018b,
- &pci_dev_info_10de_01a0,
- &pci_dev_info_10de_01a4,
- &pci_dev_info_10de_01ab,
- &pci_dev_info_10de_01ac,
- &pci_dev_info_10de_01ad,
- &pci_dev_info_10de_01b1,
- &pci_dev_info_10de_01b2,
- &pci_dev_info_10de_01b4,
- &pci_dev_info_10de_01b7,
- &pci_dev_info_10de_01b8,
- &pci_dev_info_10de_01bc,
- &pci_dev_info_10de_01c1,
- &pci_dev_info_10de_01c2,
- &pci_dev_info_10de_01c3,
- &pci_dev_info_10de_01e8,
- &pci_dev_info_10de_01f0,
- &pci_dev_info_10de_0200,
- &pci_dev_info_10de_0201,
- &pci_dev_info_10de_0202,
- &pci_dev_info_10de_0203,
- &pci_dev_info_10de_0250,
- &pci_dev_info_10de_0251,
- &pci_dev_info_10de_0252,
- &pci_dev_info_10de_0253,
- &pci_dev_info_10de_0258,
- &pci_dev_info_10de_0259,
- &pci_dev_info_10de_025b,
- &pci_dev_info_10de_0280,
- &pci_dev_info_10de_0281,
- &pci_dev_info_10de_0282,
- &pci_dev_info_10de_0288,
- &pci_dev_info_10de_0289,
- &pci_dev_info_10de_0300,
- &pci_dev_info_10de_0301,
- &pci_dev_info_10de_0302,
- &pci_dev_info_10de_0308,
- &pci_dev_info_10de_0309,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10df[] = {
- &pci_dev_info_10df_1ae5,
- &pci_dev_info_10df_f085,
- &pci_dev_info_10df_f095,
- &pci_dev_info_10df_f098,
- &pci_dev_info_10df_f700,
- &pci_dev_info_10df_f800,
- &pci_dev_info_10df_f900,
- &pci_dev_info_10df_f980,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_10e0[] = {
- &pci_dev_info_10e0_5026,
- &pci_dev_info_10e0_5027,
- &pci_dev_info_10e0_5028,
- &pci_dev_info_10e0_8849,
- &pci_dev_info_10e0_8853,
- &pci_dev_info_10e0_9128,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10e1[] = {
- &pci_dev_info_10e1_0391,
- &pci_dev_info_10e1_690c,
- &pci_dev_info_10e1_dc29,
- NULL
-};
-#endif
-#define pci_dev_list_10e2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10e3[] = {
- &pci_dev_info_10e3_0000,
- &pci_dev_info_10e3_0860,
- &pci_dev_info_10e3_0862,
- NULL
-};
-#endif
-#define pci_dev_list_10e4 NULL
-#define pci_dev_list_10e5 NULL
-#define pci_dev_list_10e6 NULL
-#define pci_dev_list_10e7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10e8[] = {
- &pci_dev_info_10e8_2011,
- &pci_dev_info_10e8_4750,
- &pci_dev_info_10e8_5920,
- &pci_dev_info_10e8_8043,
- &pci_dev_info_10e8_8062,
- &pci_dev_info_10e8_807d,
- &pci_dev_info_10e8_8088,
- &pci_dev_info_10e8_8089,
- &pci_dev_info_10e8_809c,
- &pci_dev_info_10e8_80d7,
- &pci_dev_info_10e8_80d9,
- &pci_dev_info_10e8_80da,
- &pci_dev_info_10e8_811a,
- &pci_dev_info_10e8_8170,
- &pci_dev_info_10e8_82db,
- NULL
-};
-#endif
-#define pci_dev_list_10e9 NULL
-static const pciDeviceInfo *pci_dev_list_10ea[] = {
- &pci_dev_info_10ea_1680,
- &pci_dev_info_10ea_1682,
- &pci_dev_info_10ea_1683,
- &pci_dev_info_10ea_2000,
- &pci_dev_info_10ea_2010,
- &pci_dev_info_10ea_5000,
- &pci_dev_info_10ea_5050,
- &pci_dev_info_10ea_5202,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10eb[] = {
- &pci_dev_info_10eb_0101,
- &pci_dev_info_10eb_8111,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ec[] = {
- &pci_dev_info_10ec_8029,
- &pci_dev_info_10ec_8129,
- &pci_dev_info_10ec_8138,
- &pci_dev_info_10ec_8139,
- &pci_dev_info_10ec_8169,
- &pci_dev_info_10ec_8197,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ed[] = {
- &pci_dev_info_10ed_7310,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ee[] = {
- &pci_dev_info_10ee_3fc0,
- &pci_dev_info_10ee_3fc1,
- &pci_dev_info_10ee_3fc2,
- &pci_dev_info_10ee_3fc3,
- &pci_dev_info_10ee_3fc4,
- &pci_dev_info_10ee_3fc5,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10ef[] = {
- &pci_dev_info_10ef_8154,
- NULL
-};
-#endif
-#define pci_dev_list_10f0 NULL
-#define pci_dev_list_10f1 NULL
-#define pci_dev_list_10f2 NULL
-#define pci_dev_list_10f3 NULL
-#define pci_dev_list_10f4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10f5[] = {
- &pci_dev_info_10f5_a001,
- NULL
-};
-#endif
-#define pci_dev_list_10f6 NULL
-#define pci_dev_list_10f7 NULL
-#define pci_dev_list_10f8 NULL
-#define pci_dev_list_10f9 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10fa[] = {
- &pci_dev_info_10fa_000c,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10fb[] = {
- &pci_dev_info_10fb_186f,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_10fc[] = {
- &pci_dev_info_10fc_0003,
- &pci_dev_info_10fc_0005,
- NULL
-};
-#endif
-#define pci_dev_list_10fd NULL
-#define pci_dev_list_10fe NULL
-#define pci_dev_list_10ff NULL
-#define pci_dev_list_1100 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1101[] = {
- &pci_dev_info_1101_1060,
- &pci_dev_info_1101_9100,
- &pci_dev_info_1101_9400,
- &pci_dev_info_1101_9401,
- &pci_dev_info_1101_9500,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1102[] = {
- &pci_dev_info_1102_0002,
- &pci_dev_info_1102_0004,
- &pci_dev_info_1102_0006,
- &pci_dev_info_1102_4001,
- &pci_dev_info_1102_7002,
- &pci_dev_info_1102_7003,
- &pci_dev_info_1102_7004,
- &pci_dev_info_1102_8064,
- &pci_dev_info_1102_8938,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1103[] = {
- &pci_dev_info_1103_0003,
- &pci_dev_info_1103_0004,
- &pci_dev_info_1103_0005,
- &pci_dev_info_1103_0006,
- &pci_dev_info_1103_0007,
- &pci_dev_info_1103_0008,
- &pci_dev_info_1103_0009,
- NULL
-};
-#endif
-#define pci_dev_list_1104 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1105[] = {
- &pci_dev_info_1105_1105,
- &pci_dev_info_1105_8300,
- &pci_dev_info_1105_8400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1106[] = {
- &pci_dev_info_1106_0102,
- &pci_dev_info_1106_0130,
- &pci_dev_info_1106_0305,
- &pci_dev_info_1106_0391,
- &pci_dev_info_1106_0501,
- &pci_dev_info_1106_0505,
- &pci_dev_info_1106_0561,
- &pci_dev_info_1106_0571,
- &pci_dev_info_1106_0576,
- &pci_dev_info_1106_0585,
- &pci_dev_info_1106_0586,
- &pci_dev_info_1106_0595,
- &pci_dev_info_1106_0596,
- &pci_dev_info_1106_0597,
- &pci_dev_info_1106_0598,
- &pci_dev_info_1106_0601,
- &pci_dev_info_1106_0605,
- &pci_dev_info_1106_0680,
- &pci_dev_info_1106_0686,
- &pci_dev_info_1106_0691,
- &pci_dev_info_1106_0693,
- &pci_dev_info_1106_0698,
- &pci_dev_info_1106_0926,
- &pci_dev_info_1106_1000,
- &pci_dev_info_1106_1106,
- &pci_dev_info_1106_1571,
- &pci_dev_info_1106_1595,
- &pci_dev_info_1106_3038,
- &pci_dev_info_1106_3040,
- &pci_dev_info_1106_3043,
- &pci_dev_info_1106_3044,
- &pci_dev_info_1106_3050,
- &pci_dev_info_1106_3051,
- &pci_dev_info_1106_3057,
- &pci_dev_info_1106_3058,
- &pci_dev_info_1106_3059,
- &pci_dev_info_1106_3065,
- &pci_dev_info_1106_3068,
- &pci_dev_info_1106_3074,
- &pci_dev_info_1106_3091,
- &pci_dev_info_1106_3099,
- &pci_dev_info_1106_3101,
- &pci_dev_info_1106_3102,
- &pci_dev_info_1106_3103,
- &pci_dev_info_1106_3104,
- &pci_dev_info_1106_3106,
- &pci_dev_info_1106_3109,
- &pci_dev_info_1106_3112,
- &pci_dev_info_1106_3116,
- &pci_dev_info_1106_3122,
- &pci_dev_info_1106_3123,
- &pci_dev_info_1106_3128,
- &pci_dev_info_1106_3133,
- &pci_dev_info_1106_3147,
- &pci_dev_info_1106_3148,
- &pci_dev_info_1106_3156,
- &pci_dev_info_1106_3168,
- &pci_dev_info_1106_3177,
- &pci_dev_info_1106_3189,
- &pci_dev_info_1106_5030,
- &pci_dev_info_1106_6100,
- &pci_dev_info_1106_8231,
- &pci_dev_info_1106_8235,
- &pci_dev_info_1106_8305,
- &pci_dev_info_1106_8391,
- &pci_dev_info_1106_8501,
- &pci_dev_info_1106_8596,
- &pci_dev_info_1106_8597,
- &pci_dev_info_1106_8598,
- &pci_dev_info_1106_8601,
- &pci_dev_info_1106_8605,
- &pci_dev_info_1106_8691,
- &pci_dev_info_1106_8693,
- &pci_dev_info_1106_b091,
- &pci_dev_info_1106_b099,
- &pci_dev_info_1106_b101,
- &pci_dev_info_1106_b102,
- &pci_dev_info_1106_b103,
- &pci_dev_info_1106_b112,
- &pci_dev_info_1106_b168,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1107[] = {
- &pci_dev_info_1107_0576,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1108[] = {
- &pci_dev_info_1108_0100,
- &pci_dev_info_1108_0101,
- &pci_dev_info_1108_0105,
- &pci_dev_info_1108_0108,
- &pci_dev_info_1108_0138,
- &pci_dev_info_1108_0139,
- &pci_dev_info_1108_013c,
- &pci_dev_info_1108_013d,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1109[] = {
- &pci_dev_info_1109_1400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_110a[] = {
- &pci_dev_info_110a_0002,
- &pci_dev_info_110a_0005,
- &pci_dev_info_110a_0006,
- &pci_dev_info_110a_0015,
- &pci_dev_info_110a_001d,
- &pci_dev_info_110a_007b,
- &pci_dev_info_110a_007c,
- &pci_dev_info_110a_007d,
- &pci_dev_info_110a_2102,
- &pci_dev_info_110a_4942,
- &pci_dev_info_110a_6120,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_110b[] = {
- &pci_dev_info_110b_0001,
- &pci_dev_info_110b_0004,
- NULL
-};
-#endif
-#define pci_dev_list_110c NULL
-#define pci_dev_list_110d NULL
-#define pci_dev_list_110e NULL
-#define pci_dev_list_110f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1110[] = {
- &pci_dev_info_1110_6037,
- &pci_dev_info_1110_6073,
- NULL
-};
-#endif
-#define pci_dev_list_1111 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1112[] = {
- &pci_dev_info_1112_2200,
- &pci_dev_info_1112_2300,
- &pci_dev_info_1112_2340,
- &pci_dev_info_1112_2400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1113[] = {
- &pci_dev_info_1113_1211,
- &pci_dev_info_1113_1216,
- &pci_dev_info_1113_1217,
- &pci_dev_info_1113_5105,
- &pci_dev_info_1113_9211,
- &pci_dev_info_1113_9511,
- NULL
-};
-#endif
-#define pci_dev_list_1114 NULL
-#define pci_dev_list_1115 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1116[] = {
- &pci_dev_info_1116_0022,
- &pci_dev_info_1116_0023,
- &pci_dev_info_1116_0024,
- &pci_dev_info_1116_0025,
- &pci_dev_info_1116_0026,
- &pci_dev_info_1116_0027,
- &pci_dev_info_1116_0028,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1117[] = {
- &pci_dev_info_1117_9500,
- &pci_dev_info_1117_9501,
- NULL
-};
-#endif
-#define pci_dev_list_1118 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1119[] = {
- &pci_dev_info_1119_0000,
- &pci_dev_info_1119_0001,
- &pci_dev_info_1119_0002,
- &pci_dev_info_1119_0003,
- &pci_dev_info_1119_0004,
- &pci_dev_info_1119_0005,
- &pci_dev_info_1119_0006,
- &pci_dev_info_1119_0007,
- &pci_dev_info_1119_0008,
- &pci_dev_info_1119_0009,
- &pci_dev_info_1119_000a,
- &pci_dev_info_1119_000b,
- &pci_dev_info_1119_000c,
- &pci_dev_info_1119_000d,
- &pci_dev_info_1119_0100,
- &pci_dev_info_1119_0101,
- &pci_dev_info_1119_0102,
- &pci_dev_info_1119_0103,
- &pci_dev_info_1119_0104,
- &pci_dev_info_1119_0105,
- &pci_dev_info_1119_0110,
- &pci_dev_info_1119_0111,
- &pci_dev_info_1119_0112,
- &pci_dev_info_1119_0113,
- &pci_dev_info_1119_0114,
- &pci_dev_info_1119_0115,
- &pci_dev_info_1119_0118,
- &pci_dev_info_1119_0119,
- &pci_dev_info_1119_011a,
- &pci_dev_info_1119_011b,
- &pci_dev_info_1119_0120,
- &pci_dev_info_1119_0121,
- &pci_dev_info_1119_0122,
- &pci_dev_info_1119_0123,
- &pci_dev_info_1119_0124,
- &pci_dev_info_1119_0125,
- &pci_dev_info_1119_0136,
- &pci_dev_info_1119_0137,
- &pci_dev_info_1119_0138,
- &pci_dev_info_1119_0139,
- &pci_dev_info_1119_013a,
- &pci_dev_info_1119_013b,
- &pci_dev_info_1119_013c,
- &pci_dev_info_1119_013d,
- &pci_dev_info_1119_013e,
- &pci_dev_info_1119_013f,
- &pci_dev_info_1119_0166,
- &pci_dev_info_1119_0167,
- &pci_dev_info_1119_0168,
- &pci_dev_info_1119_0169,
- &pci_dev_info_1119_016a,
- &pci_dev_info_1119_016b,
- &pci_dev_info_1119_016c,
- &pci_dev_info_1119_016d,
- &pci_dev_info_1119_016e,
- &pci_dev_info_1119_016f,
- &pci_dev_info_1119_01d6,
- &pci_dev_info_1119_01d7,
- &pci_dev_info_1119_01f6,
- &pci_dev_info_1119_01f7,
- &pci_dev_info_1119_01fc,
- &pci_dev_info_1119_01fd,
- &pci_dev_info_1119_01fe,
- &pci_dev_info_1119_01ff,
- &pci_dev_info_1119_0210,
- &pci_dev_info_1119_0211,
- &pci_dev_info_1119_0260,
- &pci_dev_info_1119_0261,
- &pci_dev_info_1119_0300,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_111a[] = {
- &pci_dev_info_111a_0000,
- &pci_dev_info_111a_0002,
- &pci_dev_info_111a_0003,
- &pci_dev_info_111a_0005,
- &pci_dev_info_111a_0007,
- NULL
-};
-#endif
-#define pci_dev_list_111b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_111c[] = {
- &pci_dev_info_111c_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_111d[] = {
- &pci_dev_info_111d_0001,
- &pci_dev_info_111d_0003,
- NULL
-};
-#endif
-#define pci_dev_list_111e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_111f[] = {
- &pci_dev_info_111f_4a47,
- &pci_dev_info_111f_5243,
- NULL
-};
-#endif
-#define pci_dev_list_1120 NULL
-#define pci_dev_list_1121 NULL
-#define pci_dev_list_1122 NULL
-#define pci_dev_list_1123 NULL
-#define pci_dev_list_1124 NULL
-#define pci_dev_list_1125 NULL
-#define pci_dev_list_1126 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1127[] = {
- &pci_dev_info_1127_0200,
- &pci_dev_info_1127_0210,
- &pci_dev_info_1127_0250,
- &pci_dev_info_1127_0300,
- &pci_dev_info_1127_0310,
- &pci_dev_info_1127_0400,
- NULL
-};
-#endif
-#define pci_dev_list_1129 NULL
-#define pci_dev_list_112a NULL
-#define pci_dev_list_112b NULL
-#define pci_dev_list_112c NULL
-#define pci_dev_list_112d NULL
-#define pci_dev_list_112e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_112f[] = {
- &pci_dev_info_112f_0000,
- &pci_dev_info_112f_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1130 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1131[] = {
- &pci_dev_info_1131_1561,
- &pci_dev_info_1131_1562,
- &pci_dev_info_1131_3400,
- &pci_dev_info_1131_7130,
- &pci_dev_info_1131_7133,
- &pci_dev_info_1131_7134,
- &pci_dev_info_1131_7135,
- &pci_dev_info_1131_7145,
- &pci_dev_info_1131_7146,
- NULL
-};
-#endif
-#define pci_dev_list_1132 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1133[] = {
- &pci_dev_info_1133_7901,
- &pci_dev_info_1133_7902,
- &pci_dev_info_1133_7911,
- &pci_dev_info_1133_7912,
- &pci_dev_info_1133_7941,
- &pci_dev_info_1133_7942,
- &pci_dev_info_1133_7943,
- &pci_dev_info_1133_7944,
- &pci_dev_info_1133_b921,
- &pci_dev_info_1133_b922,
- &pci_dev_info_1133_b923,
- &pci_dev_info_1133_e001,
- &pci_dev_info_1133_e002,
- &pci_dev_info_1133_e003,
- &pci_dev_info_1133_e004,
- &pci_dev_info_1133_e005,
- &pci_dev_info_1133_e00b,
- &pci_dev_info_1133_e010,
- &pci_dev_info_1133_e012,
- &pci_dev_info_1133_e014,
- &pci_dev_info_1133_e018,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1134[] = {
- &pci_dev_info_1134_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1135[] = {
- &pci_dev_info_1135_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1136 NULL
-#define pci_dev_list_1137 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1138[] = {
- &pci_dev_info_1138_8905,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1139[] = {
- &pci_dev_info_1139_0001,
- NULL
-};
-#endif
-#define pci_dev_list_113a NULL
-#define pci_dev_list_113b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_113c[] = {
- &pci_dev_info_113c_0000,
- &pci_dev_info_113c_0001,
- &pci_dev_info_113c_0911,
- &pci_dev_info_113c_0912,
- &pci_dev_info_113c_0913,
- &pci_dev_info_113c_0914,
- NULL
-};
-#endif
-#define pci_dev_list_113d NULL
-#define pci_dev_list_113e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_113f[] = {
- &pci_dev_info_113f_0808,
- &pci_dev_info_113f_1010,
- &pci_dev_info_113f_80c0,
- &pci_dev_info_113f_80c4,
- &pci_dev_info_113f_80c8,
- &pci_dev_info_113f_8888,
- &pci_dev_info_113f_9090,
- NULL
-};
-#endif
-#define pci_dev_list_1140 NULL
-#define pci_dev_list_1141 NULL
-static const pciDeviceInfo *pci_dev_list_1142[] = {
- &pci_dev_info_1142_3210,
- &pci_dev_info_1142_6422,
- &pci_dev_info_1142_6424,
- &pci_dev_info_1142_6425,
- &pci_dev_info_1142_643d,
- NULL
-};
-#define pci_dev_list_1143 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1144[] = {
- &pci_dev_info_1144_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1145[] = {
- &pci_dev_info_1145_8007,
- &pci_dev_info_1145_f007,
- &pci_dev_info_1145_f010,
- &pci_dev_info_1145_f012,
- &pci_dev_info_1145_f013,
- &pci_dev_info_1145_f015,
- NULL
-};
-#endif
-#define pci_dev_list_1146 NULL
-#define pci_dev_list_1147 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1148[] = {
- &pci_dev_info_1148_4000,
- &pci_dev_info_1148_4200,
- &pci_dev_info_1148_4300,
- &pci_dev_info_1148_4320,
- &pci_dev_info_1148_4400,
- NULL
-};
-#endif
-#define pci_dev_list_1149 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_114a[] = {
- &pci_dev_info_114a_5579,
- &pci_dev_info_114a_5587,
- &pci_dev_info_114a_6504,
- &pci_dev_info_114a_7587,
- NULL
-};
-#endif
-#define pci_dev_list_114b NULL
-#define pci_dev_list_114c NULL
-#define pci_dev_list_114d NULL
-#define pci_dev_list_114e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_114f[] = {
- &pci_dev_info_114f_0002,
- &pci_dev_info_114f_0003,
- &pci_dev_info_114f_0004,
- &pci_dev_info_114f_0005,
- &pci_dev_info_114f_0006,
- &pci_dev_info_114f_0009,
- &pci_dev_info_114f_000a,
- &pci_dev_info_114f_000c,
- &pci_dev_info_114f_000d,
- &pci_dev_info_114f_0011,
- &pci_dev_info_114f_0012,
- &pci_dev_info_114f_0013,
- &pci_dev_info_114f_0014,
- &pci_dev_info_114f_0015,
- &pci_dev_info_114f_0016,
- &pci_dev_info_114f_0017,
- &pci_dev_info_114f_001a,
- &pci_dev_info_114f_001b,
- &pci_dev_info_114f_001d,
- &pci_dev_info_114f_0023,
- &pci_dev_info_114f_0024,
- &pci_dev_info_114f_0026,
- &pci_dev_info_114f_0027,
- &pci_dev_info_114f_0034,
- &pci_dev_info_114f_0035,
- &pci_dev_info_114f_0040,
- &pci_dev_info_114f_0042,
- &pci_dev_info_114f_0070,
- &pci_dev_info_114f_0071,
- &pci_dev_info_114f_0072,
- &pci_dev_info_114f_0073,
- &pci_dev_info_114f_6001,
- NULL
-};
-#endif
-#define pci_dev_list_1150 NULL
-#define pci_dev_list_1151 NULL
-#define pci_dev_list_1152 NULL
-#define pci_dev_list_1153 NULL
-#define pci_dev_list_1154 NULL
-#define pci_dev_list_1155 NULL
-#define pci_dev_list_1156 NULL
-#define pci_dev_list_1157 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1158[] = {
- &pci_dev_info_1158_3011,
- &pci_dev_info_1158_9050,
- &pci_dev_info_1158_9051,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1159[] = {
- &pci_dev_info_1159_0001,
- NULL
-};
-#endif
-#define pci_dev_list_115a NULL
-#define pci_dev_list_115b NULL
-#define pci_dev_list_115c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_115d[] = {
- &pci_dev_info_115d_0003,
- &pci_dev_info_115d_0005,
- &pci_dev_info_115d_0007,
- &pci_dev_info_115d_000b,
- &pci_dev_info_115d_000c,
- &pci_dev_info_115d_000f,
- &pci_dev_info_115d_0101,
- &pci_dev_info_115d_0103,
- NULL
-};
-#endif
-#define pci_dev_list_115e NULL
-#define pci_dev_list_115f NULL
-#define pci_dev_list_1160 NULL
-#define pci_dev_list_1161 NULL
-#define pci_dev_list_1162 NULL
-static const pciDeviceInfo *pci_dev_list_1163[] = {
- &pci_dev_info_1163_0001,
- &pci_dev_info_1163_2000,
- NULL
-};
-#define pci_dev_list_1164 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1165[] = {
- &pci_dev_info_1165_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1166[] = {
- &pci_dev_info_1166_0005,
- &pci_dev_info_1166_0006,
- &pci_dev_info_1166_0007,
- &pci_dev_info_1166_0008,
- &pci_dev_info_1166_0009,
- &pci_dev_info_1166_0010,
- &pci_dev_info_1166_0011,
- &pci_dev_info_1166_0012,
- &pci_dev_info_1166_0013,
- &pci_dev_info_1166_0014,
- &pci_dev_info_1166_0015,
- &pci_dev_info_1166_0016,
- &pci_dev_info_1166_0017,
- &pci_dev_info_1166_0200,
- &pci_dev_info_1166_0201,
- &pci_dev_info_1166_0203,
- &pci_dev_info_1166_0211,
- &pci_dev_info_1166_0212,
- &pci_dev_info_1166_0213,
- &pci_dev_info_1166_0220,
- &pci_dev_info_1166_0221,
- &pci_dev_info_1166_0225,
- &pci_dev_info_1166_0227,
- NULL
-};
-#endif
-#define pci_dev_list_1167 NULL
-#define pci_dev_list_1168 NULL
-#define pci_dev_list_1169 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_116a[] = {
- &pci_dev_info_116a_6100,
- &pci_dev_info_116a_6800,
- &pci_dev_info_116a_7100,
- &pci_dev_info_116a_7800,
- NULL
-};
-#endif
-#define pci_dev_list_116b NULL
-#define pci_dev_list_116c NULL
-#define pci_dev_list_116d NULL
-#define pci_dev_list_116e NULL
-#define pci_dev_list_116f NULL
-#define pci_dev_list_1170 NULL
-#define pci_dev_list_1171 NULL
-#define pci_dev_list_1172 NULL
-#define pci_dev_list_1173 NULL
-#define pci_dev_list_1174 NULL
-#define pci_dev_list_1175 NULL
-#define pci_dev_list_1176 NULL
-#define pci_dev_list_1177 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1178[] = {
- &pci_dev_info_1178_afa1,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1179[] = {
- &pci_dev_info_1179_0103,
- &pci_dev_info_1179_0404,
- &pci_dev_info_1179_0406,
- &pci_dev_info_1179_0407,
- &pci_dev_info_1179_0601,
- &pci_dev_info_1179_0603,
- &pci_dev_info_1179_060a,
- &pci_dev_info_1179_060f,
- &pci_dev_info_1179_0617,
- &pci_dev_info_1179_0618,
- &pci_dev_info_1179_0701,
- &pci_dev_info_1179_0804,
- &pci_dev_info_1179_0805,
- &pci_dev_info_1179_0d01,
- NULL
-};
-#endif
-#define pci_dev_list_117a NULL
-#define pci_dev_list_117b NULL
-#define pci_dev_list_117c NULL
-#define pci_dev_list_117d NULL
-#define pci_dev_list_117e NULL
-#define pci_dev_list_117f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1180[] = {
- &pci_dev_info_1180_0465,
- &pci_dev_info_1180_0466,
- &pci_dev_info_1180_0475,
- &pci_dev_info_1180_0476,
- &pci_dev_info_1180_0477,
- &pci_dev_info_1180_0478,
- &pci_dev_info_1180_0522,
- &pci_dev_info_1180_0551,
- &pci_dev_info_1180_0552,
- NULL
-};
-#endif
-#define pci_dev_list_1181 NULL
-#define pci_dev_list_1183 NULL
-#define pci_dev_list_1184 NULL
-#define pci_dev_list_1185 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1186[] = {
- &pci_dev_info_1186_0100,
- &pci_dev_info_1186_1002,
- &pci_dev_info_1186_1300,
- &pci_dev_info_1186_1340,
- &pci_dev_info_1186_1561,
- &pci_dev_info_1186_4000,
- NULL
-};
-#endif
-#define pci_dev_list_1187 NULL
-#define pci_dev_list_1188 NULL
-#define pci_dev_list_1189 NULL
-#define pci_dev_list_118a NULL
-#define pci_dev_list_118b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_118c[] = {
- &pci_dev_info_118c_0014,
- &pci_dev_info_118c_1117,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_118d[] = {
- &pci_dev_info_118d_0001,
- &pci_dev_info_118d_0012,
- &pci_dev_info_118d_0014,
- &pci_dev_info_118d_0024,
- &pci_dev_info_118d_0044,
- &pci_dev_info_118d_0112,
- &pci_dev_info_118d_0114,
- &pci_dev_info_118d_0124,
- &pci_dev_info_118d_0144,
- &pci_dev_info_118d_0212,
- &pci_dev_info_118d_0214,
- &pci_dev_info_118d_0224,
- &pci_dev_info_118d_0244,
- &pci_dev_info_118d_0312,
- &pci_dev_info_118d_0314,
- &pci_dev_info_118d_0324,
- &pci_dev_info_118d_0344,
- NULL
-};
-#endif
-#define pci_dev_list_118e NULL
-#define pci_dev_list_118f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1190[] = {
- &pci_dev_info_1190_c731,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1191[] = {
- &pci_dev_info_1191_0003,
- &pci_dev_info_1191_0004,
- &pci_dev_info_1191_0005,
- &pci_dev_info_1191_0006,
- &pci_dev_info_1191_0007,
- &pci_dev_info_1191_0008,
- &pci_dev_info_1191_0009,
- &pci_dev_info_1191_8002,
- &pci_dev_info_1191_8010,
- &pci_dev_info_1191_8020,
- &pci_dev_info_1191_8030,
- &pci_dev_info_1191_8040,
- &pci_dev_info_1191_8050,
- NULL
-};
-#endif
-#define pci_dev_list_1192 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1193[] = {
- &pci_dev_info_1193_0001,
- &pci_dev_info_1193_0002,
- NULL
-};
-#endif
-#define pci_dev_list_1194 NULL
-#define pci_dev_list_1195 NULL
-#define pci_dev_list_1196 NULL
-#define pci_dev_list_1197 NULL
-#define pci_dev_list_1198 NULL
-#define pci_dev_list_1199 NULL
-#define pci_dev_list_119a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_119b[] = {
- &pci_dev_info_119b_1221,
- NULL
-};
-#endif
-#define pci_dev_list_119c NULL
-#define pci_dev_list_119d NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_119e[] = {
- &pci_dev_info_119e_0001,
- &pci_dev_info_119e_0003,
- NULL
-};
-#endif
-#define pci_dev_list_119f NULL
-#define pci_dev_list_11a0 NULL
-#define pci_dev_list_11a1 NULL
-#define pci_dev_list_11a2 NULL
-#define pci_dev_list_11a3 NULL
-#define pci_dev_list_11a4 NULL
-#define pci_dev_list_11a5 NULL
-#define pci_dev_list_11a6 NULL
-#define pci_dev_list_11a7 NULL
-#define pci_dev_list_11a8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11a9[] = {
- &pci_dev_info_11a9_4240,
- NULL
-};
-#endif
-#define pci_dev_list_11aa NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11ab[] = {
- &pci_dev_info_11ab_0146,
- &pci_dev_info_11ab_4611,
- &pci_dev_info_11ab_4620,
- &pci_dev_info_11ab_4801,
- &pci_dev_info_11ab_f003,
- NULL
-};
-#endif
-#define pci_dev_list_11ac NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11ad[] = {
- &pci_dev_info_11ad_0002,
- &pci_dev_info_11ad_c115,
- NULL
-};
-#endif
-#define pci_dev_list_11ae NULL
-#define pci_dev_list_11af NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11b0[] = {
- &pci_dev_info_11b0_0002,
- &pci_dev_info_11b0_0292,
- &pci_dev_info_11b0_0960,
- &pci_dev_info_11b0_c960,
- NULL
-};
-#endif
-#define pci_dev_list_11b1 NULL
-#define pci_dev_list_11b2 NULL
-#define pci_dev_list_11b3 NULL
-#define pci_dev_list_11b4 NULL
-#define pci_dev_list_11b5 NULL
-#define pci_dev_list_11b6 NULL
-#define pci_dev_list_11b7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11b8[] = {
- &pci_dev_info_11b8_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11b9[] = {
- &pci_dev_info_11b9_c0ed,
- NULL
-};
-#endif
-#define pci_dev_list_11ba NULL
-#define pci_dev_list_11bb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11bc[] = {
- &pci_dev_info_11bc_0001,
- NULL
-};
-#endif
-#define pci_dev_list_11bd NULL
-#define pci_dev_list_11be NULL
-#define pci_dev_list_11bf NULL
-#define pci_dev_list_11c0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11c1[] = {
- &pci_dev_info_11c1_0440,
- &pci_dev_info_11c1_0441,
- &pci_dev_info_11c1_0442,
- &pci_dev_info_11c1_0443,
- &pci_dev_info_11c1_0444,
- &pci_dev_info_11c1_0445,
- &pci_dev_info_11c1_0446,
- &pci_dev_info_11c1_0447,
- &pci_dev_info_11c1_0448,
- &pci_dev_info_11c1_0449,
- &pci_dev_info_11c1_044a,
- &pci_dev_info_11c1_044b,
- &pci_dev_info_11c1_044c,
- &pci_dev_info_11c1_044d,
- &pci_dev_info_11c1_044e,
- &pci_dev_info_11c1_044f,
- &pci_dev_info_11c1_0450,
- &pci_dev_info_11c1_0451,
- &pci_dev_info_11c1_0452,
- &pci_dev_info_11c1_0453,
- &pci_dev_info_11c1_0454,
- &pci_dev_info_11c1_0455,
- &pci_dev_info_11c1_0456,
- &pci_dev_info_11c1_0457,
- &pci_dev_info_11c1_0458,
- &pci_dev_info_11c1_0459,
- &pci_dev_info_11c1_045a,
- &pci_dev_info_11c1_045c,
- &pci_dev_info_11c1_0461,
- &pci_dev_info_11c1_0462,
- &pci_dev_info_11c1_0480,
- &pci_dev_info_11c1_5801,
- &pci_dev_info_11c1_5802,
- &pci_dev_info_11c1_5803,
- &pci_dev_info_11c1_5811,
- NULL
-};
-#endif
-#define pci_dev_list_11c2 NULL
-#define pci_dev_list_11c3 NULL
-#define pci_dev_list_11c4 NULL
-#define pci_dev_list_11c5 NULL
-#define pci_dev_list_11c6 NULL
-#define pci_dev_list_11c7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11c8[] = {
- &pci_dev_info_11c8_0658,
- &pci_dev_info_11c8_d665,
- &pci_dev_info_11c8_d667,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11c9[] = {
- &pci_dev_info_11c9_0010,
- &pci_dev_info_11c9_0011,
- NULL
-};
-#endif
-#define pci_dev_list_11ca NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11cb[] = {
- &pci_dev_info_11cb_2000,
- &pci_dev_info_11cb_4000,
- &pci_dev_info_11cb_8000,
- NULL
-};
-#endif
-#define pci_dev_list_11cc NULL
-#define pci_dev_list_11cd NULL
-#define pci_dev_list_11ce NULL
-#define pci_dev_list_11cf NULL
-#define pci_dev_list_11d0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11d1[] = {
- &pci_dev_info_11d1_01f7,
- NULL
-};
-#endif
-#define pci_dev_list_11d2 NULL
-#define pci_dev_list_11d3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11d4[] = {
- &pci_dev_info_11d4_1805,
- &pci_dev_info_11d4_1889,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11d5[] = {
- &pci_dev_info_11d5_0115,
- &pci_dev_info_11d5_0117,
- NULL
-};
-#endif
-#define pci_dev_list_11d6 NULL
-#define pci_dev_list_11d7 NULL
-#define pci_dev_list_11d8 NULL
-#define pci_dev_list_11d9 NULL
-#define pci_dev_list_11da NULL
-#define pci_dev_list_11db NULL
-#define pci_dev_list_11dc NULL
-#define pci_dev_list_11dd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11de[] = {
- &pci_dev_info_11de_6057,
- &pci_dev_info_11de_6120,
- NULL
-};
-#endif
-#define pci_dev_list_11df NULL
-#define pci_dev_list_11e0 NULL
-#define pci_dev_list_11e1 NULL
-#define pci_dev_list_11e2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11e3[] = {
- &pci_dev_info_11e3_5030,
- NULL
-};
-#endif
-#define pci_dev_list_11e4 NULL
-#define pci_dev_list_11e5 NULL
-#define pci_dev_list_11e6 NULL
-#define pci_dev_list_11e7 NULL
-#define pci_dev_list_11e8 NULL
-#define pci_dev_list_11e9 NULL
-#define pci_dev_list_11ea NULL
-#define pci_dev_list_11eb NULL
-#define pci_dev_list_11ec NULL
-#define pci_dev_list_11ed NULL
-#define pci_dev_list_11ee NULL
-#define pci_dev_list_11ef NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11f0[] = {
- &pci_dev_info_11f0_4231,
- &pci_dev_info_11f0_4232,
- &pci_dev_info_11f0_4233,
- &pci_dev_info_11f0_4234,
- &pci_dev_info_11f0_4235,
- &pci_dev_info_11f0_4236,
- &pci_dev_info_11f0_4731,
- NULL
-};
-#endif
-#define pci_dev_list_11f1 NULL
-#define pci_dev_list_11f2 NULL
-#define pci_dev_list_11f3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11f4[] = {
- &pci_dev_info_11f4_2915,
- NULL
-};
-#endif
-#define pci_dev_list_11f5 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11f6[] = {
- &pci_dev_info_11f6_0112,
- &pci_dev_info_11f6_0113,
- &pci_dev_info_11f6_1401,
- &pci_dev_info_11f6_2011,
- &pci_dev_info_11f6_2201,
- &pci_dev_info_11f6_9881,
- NULL
-};
-#endif
-#define pci_dev_list_11f7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11f8[] = {
- &pci_dev_info_11f8_7375,
- NULL
-};
-#endif
-#define pci_dev_list_11f9 NULL
-#define pci_dev_list_11fa NULL
-#define pci_dev_list_11fb NULL
-#define pci_dev_list_11fc NULL
-#define pci_dev_list_11fd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_11fe[] = {
- &pci_dev_info_11fe_0001,
- &pci_dev_info_11fe_0002,
- &pci_dev_info_11fe_0003,
- &pci_dev_info_11fe_0004,
- &pci_dev_info_11fe_0005,
- &pci_dev_info_11fe_0006,
- &pci_dev_info_11fe_0007,
- &pci_dev_info_11fe_0008,
- &pci_dev_info_11fe_0009,
- &pci_dev_info_11fe_000a,
- &pci_dev_info_11fe_000b,
- &pci_dev_info_11fe_000c,
- &pci_dev_info_11fe_8015,
- NULL
-};
-#endif
-#define pci_dev_list_11ff NULL
-#define pci_dev_list_1200 NULL
-#define pci_dev_list_1201 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1202[] = {
- &pci_dev_info_1202_4300,
- NULL
-};
-#endif
-#define pci_dev_list_1203 NULL
-#define pci_dev_list_1204 NULL
-#define pci_dev_list_1205 NULL
-#define pci_dev_list_1206 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1208[] = {
- &pci_dev_info_1208_4853,
- NULL
-};
-#endif
-#define pci_dev_list_1209 NULL
-#define pci_dev_list_120a NULL
-#define pci_dev_list_120b NULL
-#define pci_dev_list_120c NULL
-#define pci_dev_list_120d NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_120e[] = {
- &pci_dev_info_120e_0100,
- &pci_dev_info_120e_0101,
- &pci_dev_info_120e_0102,
- &pci_dev_info_120e_0103,
- &pci_dev_info_120e_0104,
- &pci_dev_info_120e_0105,
- &pci_dev_info_120e_0200,
- &pci_dev_info_120e_0201,
- &pci_dev_info_120e_0300,
- &pci_dev_info_120e_0301,
- &pci_dev_info_120e_0310,
- &pci_dev_info_120e_0311,
- &pci_dev_info_120e_0320,
- &pci_dev_info_120e_0321,
- &pci_dev_info_120e_0400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_120f[] = {
- &pci_dev_info_120f_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1210 NULL
-#define pci_dev_list_1211 NULL
-#define pci_dev_list_1212 NULL
-#define pci_dev_list_1213 NULL
-#define pci_dev_list_1214 NULL
-#define pci_dev_list_1215 NULL
-#define pci_dev_list_1216 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1217[] = {
- &pci_dev_info_1217_6729,
- &pci_dev_info_1217_673a,
- &pci_dev_info_1217_6832,
- &pci_dev_info_1217_6836,
- &pci_dev_info_1217_6872,
- &pci_dev_info_1217_6925,
- &pci_dev_info_1217_6933,
- &pci_dev_info_1217_6972,
- NULL
-};
-#endif
-#define pci_dev_list_1218 NULL
-#define pci_dev_list_1219 NULL
-static const pciDeviceInfo *pci_dev_list_121a[] = {
- &pci_dev_info_121a_0001,
- &pci_dev_info_121a_0002,
- &pci_dev_info_121a_0003,
- &pci_dev_info_121a_0004,
- &pci_dev_info_121a_0005,
- &pci_dev_info_121a_0009,
- &pci_dev_info_121a_0057,
- NULL
-};
-#define pci_dev_list_121b NULL
-#define pci_dev_list_121c NULL
-#define pci_dev_list_121d NULL
-#define pci_dev_list_121e NULL
-#define pci_dev_list_121f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1220[] = {
- &pci_dev_info_1220_1220,
- NULL
-};
-#endif
-#define pci_dev_list_1221 NULL
-#define pci_dev_list_1222 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1223[] = {
- &pci_dev_info_1223_0003,
- &pci_dev_info_1223_0004,
- &pci_dev_info_1223_0005,
- &pci_dev_info_1223_0008,
- &pci_dev_info_1223_0009,
- &pci_dev_info_1223_000a,
- &pci_dev_info_1223_000b,
- &pci_dev_info_1223_000c,
- &pci_dev_info_1223_000d,
- &pci_dev_info_1223_000e,
- NULL
-};
-#endif
-#define pci_dev_list_1224 NULL
-#define pci_dev_list_1225 NULL
-#define pci_dev_list_1227 NULL
-#define pci_dev_list_1228 NULL
-#define pci_dev_list_1229 NULL
-#define pci_dev_list_122a NULL
-#define pci_dev_list_122b NULL
-#define pci_dev_list_122c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_122d[] = {
- &pci_dev_info_122d_1206,
- &pci_dev_info_122d_50dc,
- &pci_dev_info_122d_80da,
- NULL
-};
-#endif
-#define pci_dev_list_122e NULL
-#define pci_dev_list_122f NULL
-#define pci_dev_list_1230 NULL
-#define pci_dev_list_1231 NULL
-#define pci_dev_list_1232 NULL
-#define pci_dev_list_1233 NULL
-#define pci_dev_list_1234 NULL
-#define pci_dev_list_1235 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1236[] = {
- &pci_dev_info_1236_0000,
- &pci_dev_info_1236_6401,
- NULL
-};
-#endif
-#define pci_dev_list_1237 NULL
-#define pci_dev_list_1238 NULL
-#define pci_dev_list_1239 NULL
-#define pci_dev_list_123a NULL
-#define pci_dev_list_123b NULL
-#define pci_dev_list_123c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_123d[] = {
- &pci_dev_info_123d_0000,
- &pci_dev_info_123d_0002,
- &pci_dev_info_123d_0003,
- NULL
-};
-#endif
-#define pci_dev_list_123e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_123f[] = {
- &pci_dev_info_123f_00e4,
- &pci_dev_info_123f_8120,
- &pci_dev_info_123f_8888,
- NULL
-};
-#endif
-#define pci_dev_list_1240 NULL
-#define pci_dev_list_1241 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1242[] = {
- &pci_dev_info_1242_1560,
- &pci_dev_info_1242_4643,
- NULL
-};
-#endif
-#define pci_dev_list_1243 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1244[] = {
- &pci_dev_info_1244_0700,
- &pci_dev_info_1244_0800,
- &pci_dev_info_1244_0a00,
- &pci_dev_info_1244_0e00,
- &pci_dev_info_1244_1100,
- &pci_dev_info_1244_1200,
- NULL
-};
-#endif
-#define pci_dev_list_1245 NULL
-#define pci_dev_list_1246 NULL
-#define pci_dev_list_1247 NULL
-#define pci_dev_list_1248 NULL
-#define pci_dev_list_1249 NULL
-#define pci_dev_list_124a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_124b[] = {
- &pci_dev_info_124b_0040,
- NULL
-};
-#endif
-#define pci_dev_list_124c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_124d[] = {
- &pci_dev_info_124d_0000,
- &pci_dev_info_124d_0002,
- &pci_dev_info_124d_0003,
- &pci_dev_info_124d_0004,
- NULL
-};
-#endif
-#define pci_dev_list_124e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_124f[] = {
- &pci_dev_info_124f_0041,
- NULL
-};
-#endif
-#define pci_dev_list_1250 NULL
-#define pci_dev_list_1251 NULL
-#define pci_dev_list_1253 NULL
-#define pci_dev_list_1254 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1255[] = {
- &pci_dev_info_1255_1110,
- &pci_dev_info_1255_1210,
- &pci_dev_info_1255_2110,
- &pci_dev_info_1255_2120,
- &pci_dev_info_1255_2130,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1256[] = {
- &pci_dev_info_1256_4201,
- &pci_dev_info_1256_4401,
- &pci_dev_info_1256_5201,
- NULL
-};
-#endif
-#define pci_dev_list_1257 NULL
-#define pci_dev_list_1258 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1259[] = {
- &pci_dev_info_1259_2560,
- NULL
-};
-#endif
-#define pci_dev_list_125a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_125b[] = {
- &pci_dev_info_125b_1400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_125c[] = {
- &pci_dev_info_125c_0640,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_125d[] = {
- &pci_dev_info_125d_0000,
- &pci_dev_info_125d_1948,
- &pci_dev_info_125d_1968,
- &pci_dev_info_125d_1969,
- &pci_dev_info_125d_1978,
- &pci_dev_info_125d_1988,
- &pci_dev_info_125d_1989,
- &pci_dev_info_125d_1998,
- &pci_dev_info_125d_1999,
- &pci_dev_info_125d_199a,
- &pci_dev_info_125d_199b,
- &pci_dev_info_125d_2808,
- &pci_dev_info_125d_2838,
- &pci_dev_info_125d_2898,
- NULL
-};
-#endif
-#define pci_dev_list_125e NULL
-#define pci_dev_list_125f NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1260[] = {
- &pci_dev_info_1260_3873,
- &pci_dev_info_1260_3890,
- &pci_dev_info_1260_8130,
- &pci_dev_info_1260_8131,
- NULL
-};
-#endif
-#define pci_dev_list_1261 NULL
-#define pci_dev_list_1262 NULL
-#define pci_dev_list_1263 NULL
-#define pci_dev_list_1264 NULL
-#define pci_dev_list_1265 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1266[] = {
- &pci_dev_info_1266_0001,
- &pci_dev_info_1266_1910,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1267[] = {
- &pci_dev_info_1267_5352,
- &pci_dev_info_1267_5a4b,
- NULL
-};
-#endif
-#define pci_dev_list_1268 NULL
-#define pci_dev_list_1269 NULL
-#define pci_dev_list_126a NULL
-#define pci_dev_list_126b NULL
-#define pci_dev_list_126c NULL
-#define pci_dev_list_126d NULL
-#define pci_dev_list_126e NULL
-static const pciDeviceInfo *pci_dev_list_126f[] = {
- &pci_dev_info_126f_0710,
- &pci_dev_info_126f_0712,
- &pci_dev_info_126f_0720,
- &pci_dev_info_126f_0730,
- &pci_dev_info_126f_0810,
- &pci_dev_info_126f_0811,
- &pci_dev_info_126f_0820,
- &pci_dev_info_126f_0910,
- NULL
-};
-#define pci_dev_list_1270 NULL
-#define pci_dev_list_1271 NULL
-#define pci_dev_list_1272 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1273[] = {
- &pci_dev_info_1273_0002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1274[] = {
- &pci_dev_info_1274_1171,
- &pci_dev_info_1274_1371,
- &pci_dev_info_1274_5000,
- &pci_dev_info_1274_5880,
- NULL
-};
-#endif
-#define pci_dev_list_1275 NULL
-#define pci_dev_list_1276 NULL
-#define pci_dev_list_1277 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1278[] = {
- &pci_dev_info_1278_0701,
- &pci_dev_info_1278_0710,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1279[] = {
- &pci_dev_info_1279_0295,
- &pci_dev_info_1279_0395,
- &pci_dev_info_1279_0396,
- &pci_dev_info_1279_0397,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_127a[] = {
- &pci_dev_info_127a_1002,
- &pci_dev_info_127a_1003,
- &pci_dev_info_127a_1004,
- &pci_dev_info_127a_1005,
- &pci_dev_info_127a_1022,
- &pci_dev_info_127a_1023,
- &pci_dev_info_127a_1024,
- &pci_dev_info_127a_1025,
- &pci_dev_info_127a_1026,
- &pci_dev_info_127a_1032,
- &pci_dev_info_127a_1033,
- &pci_dev_info_127a_1034,
- &pci_dev_info_127a_1035,
- &pci_dev_info_127a_1036,
- &pci_dev_info_127a_1085,
- &pci_dev_info_127a_2005,
- &pci_dev_info_127a_2013,
- &pci_dev_info_127a_2014,
- &pci_dev_info_127a_2015,
- &pci_dev_info_127a_2016,
- &pci_dev_info_127a_4311,
- &pci_dev_info_127a_4320,
- &pci_dev_info_127a_4321,
- &pci_dev_info_127a_4322,
- &pci_dev_info_127a_8234,
- NULL
-};
-#endif
-#define pci_dev_list_127b NULL
-#define pci_dev_list_127c NULL
-#define pci_dev_list_127d NULL
-#define pci_dev_list_127e NULL
-#define pci_dev_list_127f NULL
-#define pci_dev_list_1280 NULL
-#define pci_dev_list_1281 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1282[] = {
- &pci_dev_info_1282_9009,
- &pci_dev_info_1282_9100,
- &pci_dev_info_1282_9102,
- &pci_dev_info_1282_9132,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1283[] = {
- &pci_dev_info_1283_673a,
- &pci_dev_info_1283_8330,
- &pci_dev_info_1283_8888,
- &pci_dev_info_1283_8889,
- &pci_dev_info_1283_e886,
- NULL
-};
-#endif
-#define pci_dev_list_1284 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1285[] = {
- &pci_dev_info_1285_0100,
- NULL
-};
-#endif
-#define pci_dev_list_1286 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1287[] = {
- &pci_dev_info_1287_001e,
- &pci_dev_info_1287_001f,
- NULL
-};
-#endif
-#define pci_dev_list_1288 NULL
-#define pci_dev_list_1289 NULL
-#define pci_dev_list_128a NULL
-#define pci_dev_list_128b NULL
-#define pci_dev_list_128c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_128d[] = {
- &pci_dev_info_128d_0021,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_128e[] = {
- &pci_dev_info_128e_0008,
- &pci_dev_info_128e_0009,
- &pci_dev_info_128e_000a,
- &pci_dev_info_128e_000b,
- &pci_dev_info_128e_000c,
- NULL
-};
-#endif
-#define pci_dev_list_128f NULL
-#define pci_dev_list_1290 NULL
-#define pci_dev_list_1291 NULL
-#define pci_dev_list_1292 NULL
-#define pci_dev_list_1293 NULL
-#define pci_dev_list_1294 NULL
-#define pci_dev_list_1295 NULL
-#define pci_dev_list_1296 NULL
-#define pci_dev_list_1297 NULL
-#define pci_dev_list_1298 NULL
-#define pci_dev_list_1299 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_129a[] = {
- &pci_dev_info_129a_0615,
- NULL
-};
-#endif
-#define pci_dev_list_129b NULL
-#define pci_dev_list_129c NULL
-#define pci_dev_list_129d NULL
-#define pci_dev_list_129e NULL
-#define pci_dev_list_129f NULL
-#define pci_dev_list_12a0 NULL
-#define pci_dev_list_12a1 NULL
-#define pci_dev_list_12a2 NULL
-#define pci_dev_list_12a3 NULL
-#define pci_dev_list_12a4 NULL
-#define pci_dev_list_12a5 NULL
-#define pci_dev_list_12a6 NULL
-#define pci_dev_list_12a7 NULL
-#define pci_dev_list_12a8 NULL
-#define pci_dev_list_12a9 NULL
-#define pci_dev_list_12aa NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12ab[] = {
- &pci_dev_info_12ab_3000,
- NULL
-};
-#endif
-#define pci_dev_list_12ac NULL
-#define pci_dev_list_12ad NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12ae[] = {
- &pci_dev_info_12ae_0001,
- &pci_dev_info_12ae_0002,
- NULL
-};
-#endif
-#define pci_dev_list_12af NULL
-#define pci_dev_list_12b0 NULL
-#define pci_dev_list_12b1 NULL
-#define pci_dev_list_12b2 NULL
-#define pci_dev_list_12b3 NULL
-#define pci_dev_list_12b4 NULL
-#define pci_dev_list_12b5 NULL
-#define pci_dev_list_12b6 NULL
-#define pci_dev_list_12b7 NULL
-#define pci_dev_list_12b8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12b9[] = {
- &pci_dev_info_12b9_1006,
- &pci_dev_info_12b9_1007,
- &pci_dev_info_12b9_1008,
- NULL
-};
-#endif
-#define pci_dev_list_12ba NULL
-#define pci_dev_list_12bb NULL
-#define pci_dev_list_12bc NULL
-#define pci_dev_list_12bd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12be[] = {
- &pci_dev_info_12be_3041,
- &pci_dev_info_12be_3042,
- NULL
-};
-#endif
-#define pci_dev_list_12bf NULL
-#define pci_dev_list_12c0 NULL
-#define pci_dev_list_12c1 NULL
-#define pci_dev_list_12c2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12c3[] = {
- &pci_dev_info_12c3_0058,
- &pci_dev_info_12c3_5598,
- NULL
-};
-#endif
-#define pci_dev_list_12c4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12c5[] = {
- &pci_dev_info_12c5_007e,
- &pci_dev_info_12c5_007f,
- &pci_dev_info_12c5_0081,
- &pci_dev_info_12c5_0085,
- &pci_dev_info_12c5_0086,
- NULL
-};
-#endif
-#define pci_dev_list_12c6 NULL
-#define pci_dev_list_12c7 NULL
-#define pci_dev_list_12c8 NULL
-#define pci_dev_list_12c9 NULL
-#define pci_dev_list_12ca NULL
-#define pci_dev_list_12cb NULL
-#define pci_dev_list_12cc NULL
-#define pci_dev_list_12cd NULL
-#define pci_dev_list_12ce NULL
-#define pci_dev_list_12cf NULL
-#define pci_dev_list_12d0 NULL
-#define pci_dev_list_12d1 NULL
-static const pciDeviceInfo *pci_dev_list_12d2[] = {
- &pci_dev_info_12d2_0008,
- &pci_dev_info_12d2_0009,
- &pci_dev_info_12d2_0018,
- &pci_dev_info_12d2_0019,
- &pci_dev_info_12d2_0020,
- &pci_dev_info_12d2_0028,
- &pci_dev_info_12d2_0029,
- &pci_dev_info_12d2_002c,
- &pci_dev_info_12d2_00a0,
- NULL
-};
-#define pci_dev_list_12d3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12d4[] = {
- &pci_dev_info_12d4_0200,
- NULL
-};
-#endif
-#define pci_dev_list_12d5 NULL
-#define pci_dev_list_12d6 NULL
-#define pci_dev_list_12d7 NULL
-#define pci_dev_list_12d8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12d9[] = {
- &pci_dev_info_12d9_0002,
- &pci_dev_info_12d9_0004,
- NULL
-};
-#endif
-#define pci_dev_list_12da NULL
-#define pci_dev_list_12db NULL
-#define pci_dev_list_12dc NULL
-#define pci_dev_list_12dd NULL
-#define pci_dev_list_12de NULL
-#define pci_dev_list_12df NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12e0[] = {
- &pci_dev_info_12e0_0010,
- &pci_dev_info_12e0_0020,
- &pci_dev_info_12e0_0030,
- NULL
-};
-#endif
-#define pci_dev_list_12e1 NULL
-#define pci_dev_list_12e2 NULL
-#define pci_dev_list_12e3 NULL
-#define pci_dev_list_12e4 NULL
-#define pci_dev_list_12e5 NULL
-#define pci_dev_list_12e6 NULL
-#define pci_dev_list_12e7 NULL
-#define pci_dev_list_12e8 NULL
-#define pci_dev_list_12e9 NULL
-#define pci_dev_list_12ea NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12eb[] = {
- &pci_dev_info_12eb_0001,
- &pci_dev_info_12eb_0002,
- &pci_dev_info_12eb_0003,
- &pci_dev_info_12eb_8803,
- NULL
-};
-#endif
-#define pci_dev_list_12ec NULL
-#define pci_dev_list_12ed NULL
-#define pci_dev_list_12ee NULL
-#define pci_dev_list_12ef NULL
-#define pci_dev_list_12f0 NULL
-#define pci_dev_list_12f1 NULL
-#define pci_dev_list_12f2 NULL
-#define pci_dev_list_12f3 NULL
-#define pci_dev_list_12f4 NULL
-#define pci_dev_list_12f5 NULL
-#define pci_dev_list_12f6 NULL
-#define pci_dev_list_12f7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_12f8[] = {
- &pci_dev_info_12f8_0002,
- NULL
-};
-#endif
-#define pci_dev_list_12f9 NULL
-#define pci_dev_list_12fb NULL
-#define pci_dev_list_12fc NULL
-#define pci_dev_list_12fd NULL
-#define pci_dev_list_12fe NULL
-#define pci_dev_list_12ff NULL
-#define pci_dev_list_1300 NULL
-#define pci_dev_list_1302 NULL
-#define pci_dev_list_1303 NULL
-#define pci_dev_list_1304 NULL
-#define pci_dev_list_1305 NULL
-#define pci_dev_list_1306 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1307[] = {
- &pci_dev_info_1307_0001,
- &pci_dev_info_1307_000b,
- &pci_dev_info_1307_000c,
- &pci_dev_info_1307_000d,
- &pci_dev_info_1307_000f,
- &pci_dev_info_1307_0010,
- &pci_dev_info_1307_0014,
- &pci_dev_info_1307_0015,
- &pci_dev_info_1307_0016,
- &pci_dev_info_1307_0017,
- &pci_dev_info_1307_0018,
- &pci_dev_info_1307_0019,
- &pci_dev_info_1307_001a,
- &pci_dev_info_1307_001b,
- &pci_dev_info_1307_001c,
- &pci_dev_info_1307_001d,
- &pci_dev_info_1307_001e,
- &pci_dev_info_1307_001f,
- &pci_dev_info_1307_0020,
- &pci_dev_info_1307_0021,
- &pci_dev_info_1307_0022,
- &pci_dev_info_1307_0023,
- &pci_dev_info_1307_0024,
- &pci_dev_info_1307_0025,
- &pci_dev_info_1307_0026,
- &pci_dev_info_1307_0027,
- &pci_dev_info_1307_0028,
- &pci_dev_info_1307_0029,
- &pci_dev_info_1307_002c,
- &pci_dev_info_1307_0033,
- &pci_dev_info_1307_0034,
- &pci_dev_info_1307_0035,
- &pci_dev_info_1307_0036,
- &pci_dev_info_1307_0037,
- &pci_dev_info_1307_004c,
- &pci_dev_info_1307_004d,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1308[] = {
- &pci_dev_info_1308_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1309 NULL
-#define pci_dev_list_130a NULL
-#define pci_dev_list_130b NULL
-#define pci_dev_list_130c NULL
-#define pci_dev_list_130d NULL
-#define pci_dev_list_130e NULL
-#define pci_dev_list_130f NULL
-#define pci_dev_list_1310 NULL
-#define pci_dev_list_1311 NULL
-#define pci_dev_list_1312 NULL
-#define pci_dev_list_1313 NULL
-#define pci_dev_list_1316 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1317[] = {
- &pci_dev_info_1317_0981,
- &pci_dev_info_1317_0985,
- &pci_dev_info_1317_1985,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1318[] = {
- &pci_dev_info_1318_0911,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1319[] = {
- &pci_dev_info_1319_0801,
- &pci_dev_info_1319_0802,
- &pci_dev_info_1319_1000,
- &pci_dev_info_1319_1001,
- NULL
-};
-#endif
-#define pci_dev_list_131a NULL
-#define pci_dev_list_131c NULL
-#define pci_dev_list_131d NULL
-#define pci_dev_list_131e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_131f[] = {
- &pci_dev_info_131f_1000,
- &pci_dev_info_131f_1001,
- &pci_dev_info_131f_1002,
- &pci_dev_info_131f_1010,
- &pci_dev_info_131f_1011,
- &pci_dev_info_131f_1012,
- &pci_dev_info_131f_1020,
- &pci_dev_info_131f_1021,
- &pci_dev_info_131f_1030,
- &pci_dev_info_131f_1031,
- &pci_dev_info_131f_1032,
- &pci_dev_info_131f_1034,
- &pci_dev_info_131f_1035,
- &pci_dev_info_131f_1036,
- &pci_dev_info_131f_1050,
- &pci_dev_info_131f_1051,
- &pci_dev_info_131f_1052,
- &pci_dev_info_131f_2000,
- &pci_dev_info_131f_2001,
- &pci_dev_info_131f_2002,
- &pci_dev_info_131f_2010,
- &pci_dev_info_131f_2011,
- &pci_dev_info_131f_2012,
- &pci_dev_info_131f_2020,
- &pci_dev_info_131f_2021,
- &pci_dev_info_131f_2030,
- &pci_dev_info_131f_2031,
- &pci_dev_info_131f_2032,
- &pci_dev_info_131f_2040,
- &pci_dev_info_131f_2041,
- &pci_dev_info_131f_2042,
- &pci_dev_info_131f_2050,
- &pci_dev_info_131f_2051,
- &pci_dev_info_131f_2052,
- &pci_dev_info_131f_2060,
- &pci_dev_info_131f_2061,
- &pci_dev_info_131f_2062,
- NULL
-};
-#endif
-#define pci_dev_list_1320 NULL
-#define pci_dev_list_1321 NULL
-#define pci_dev_list_1322 NULL
-#define pci_dev_list_1323 NULL
-#define pci_dev_list_1324 NULL
-#define pci_dev_list_1325 NULL
-#define pci_dev_list_1326 NULL
-#define pci_dev_list_1327 NULL
-#define pci_dev_list_1328 NULL
-#define pci_dev_list_1329 NULL
-#define pci_dev_list_132a NULL
-#define pci_dev_list_132b NULL
-#define pci_dev_list_132c NULL
-#define pci_dev_list_132d NULL
-#define pci_dev_list_1330 NULL
-#define pci_dev_list_1331 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1332[] = {
- &pci_dev_info_1332_5415,
- &pci_dev_info_1332_5425,
- NULL
-};
-#endif
-#define pci_dev_list_1334 NULL
-#define pci_dev_list_1335 NULL
-#define pci_dev_list_1337 NULL
-#define pci_dev_list_1338 NULL
-#define pci_dev_list_133a NULL
-#define pci_dev_list_133b NULL
-#define pci_dev_list_133c NULL
-#define pci_dev_list_133d NULL
-#define pci_dev_list_133e NULL
-#define pci_dev_list_133f NULL
-#define pci_dev_list_1340 NULL
-#define pci_dev_list_1341 NULL
-#define pci_dev_list_1342 NULL
-#define pci_dev_list_1343 NULL
-#define pci_dev_list_1344 NULL
-#define pci_dev_list_1345 NULL
-#define pci_dev_list_1347 NULL
-#define pci_dev_list_1349 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_134a[] = {
- &pci_dev_info_134a_0001,
- &pci_dev_info_134a_0002,
- NULL
-};
-#endif
-#define pci_dev_list_134b NULL
-#define pci_dev_list_134c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_134d[] = {
- &pci_dev_info_134d_7890,
- &pci_dev_info_134d_7891,
- &pci_dev_info_134d_7892,
- &pci_dev_info_134d_7893,
- &pci_dev_info_134d_7894,
- &pci_dev_info_134d_7895,
- &pci_dev_info_134d_7896,
- &pci_dev_info_134d_7897,
- NULL
-};
-#endif
-#define pci_dev_list_134e NULL
-#define pci_dev_list_134f NULL
-#define pci_dev_list_1350 NULL
-#define pci_dev_list_1351 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1353[] = {
- &pci_dev_info_1353_0002,
- &pci_dev_info_1353_0003,
- &pci_dev_info_1353_0004,
- &pci_dev_info_1353_0005,
- NULL
-};
-#endif
-#define pci_dev_list_1354 NULL
-#define pci_dev_list_1355 NULL
-#define pci_dev_list_1356 NULL
-#define pci_dev_list_1359 NULL
-#define pci_dev_list_135a NULL
-#define pci_dev_list_135b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_135c[] = {
- &pci_dev_info_135c_0010,
- &pci_dev_info_135c_0020,
- &pci_dev_info_135c_0030,
- &pci_dev_info_135c_0040,
- &pci_dev_info_135c_0050,
- &pci_dev_info_135c_0060,
- &pci_dev_info_135c_00f0,
- &pci_dev_info_135c_0170,
- &pci_dev_info_135c_0180,
- &pci_dev_info_135c_0190,
- &pci_dev_info_135c_01a0,
- &pci_dev_info_135c_01b0,
- &pci_dev_info_135c_01c0,
- NULL
-};
-#endif
-#define pci_dev_list_135d NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_135e[] = {
- &pci_dev_info_135e_7101,
- &pci_dev_info_135e_7201,
- &pci_dev_info_135e_7202,
- &pci_dev_info_135e_7401,
- &pci_dev_info_135e_7402,
- &pci_dev_info_135e_7801,
- &pci_dev_info_135e_8001,
- NULL
-};
-#endif
-#define pci_dev_list_135f NULL
-#define pci_dev_list_1360 NULL
-#define pci_dev_list_1361 NULL
-#define pci_dev_list_1362 NULL
-#define pci_dev_list_1363 NULL
-#define pci_dev_list_1364 NULL
-#define pci_dev_list_1365 NULL
-#define pci_dev_list_1366 NULL
-#define pci_dev_list_1367 NULL
-#define pci_dev_list_1368 NULL
-#define pci_dev_list_1369 NULL
-#define pci_dev_list_136a NULL
-#define pci_dev_list_136b NULL
-#define pci_dev_list_136c NULL
-#define pci_dev_list_136d NULL
-#define pci_dev_list_136f NULL
-#define pci_dev_list_1370 NULL
-#define pci_dev_list_1371 NULL
-#define pci_dev_list_1373 NULL
-#define pci_dev_list_1374 NULL
-#define pci_dev_list_1375 NULL
-#define pci_dev_list_1376 NULL
-#define pci_dev_list_1377 NULL
-#define pci_dev_list_1378 NULL
-#define pci_dev_list_1379 NULL
-#define pci_dev_list_137a NULL
-#define pci_dev_list_137b NULL
-#define pci_dev_list_137c NULL
-#define pci_dev_list_137d NULL
-#define pci_dev_list_137e NULL
-#define pci_dev_list_137f NULL
-#define pci_dev_list_1380 NULL
-#define pci_dev_list_1381 NULL
-#define pci_dev_list_1382 NULL
-#define pci_dev_list_1383 NULL
-#define pci_dev_list_1384 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1385[] = {
- &pci_dev_info_1385_4100,
- &pci_dev_info_1385_4105,
- &pci_dev_info_1385_620a,
- &pci_dev_info_1385_622a,
- &pci_dev_info_1385_630a,
- &pci_dev_info_1385_f311,
- NULL
-};
-#endif
-#define pci_dev_list_1386 NULL
-#define pci_dev_list_1387 NULL
-#define pci_dev_list_1388 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1389[] = {
- &pci_dev_info_1389_0001,
- NULL
-};
-#endif
-#define pci_dev_list_138a NULL
-#define pci_dev_list_138b NULL
-#define pci_dev_list_138c NULL
-#define pci_dev_list_138d NULL
-#define pci_dev_list_138e NULL
-#define pci_dev_list_138f NULL
-#define pci_dev_list_1390 NULL
-#define pci_dev_list_1391 NULL
-#define pci_dev_list_1392 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1393[] = {
- &pci_dev_info_1393_1040,
- &pci_dev_info_1393_1680,
- &pci_dev_info_1393_2040,
- &pci_dev_info_1393_2180,
- &pci_dev_info_1393_3200,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1394[] = {
- &pci_dev_info_1394_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1395 NULL
-#define pci_dev_list_1396 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1397[] = {
- &pci_dev_info_1397_2bd0,
- NULL
-};
-#endif
-#define pci_dev_list_1398 NULL
-#define pci_dev_list_1399 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_139a[] = {
- &pci_dev_info_139a_0001,
- &pci_dev_info_139a_0003,
- &pci_dev_info_139a_0005,
- NULL
-};
-#endif
-#define pci_dev_list_139b NULL
-#define pci_dev_list_139c NULL
-#define pci_dev_list_139d NULL
-#define pci_dev_list_139e NULL
-#define pci_dev_list_139f NULL
-#define pci_dev_list_13a0 NULL
-#define pci_dev_list_13a1 NULL
-#define pci_dev_list_13a2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13a3[] = {
- &pci_dev_info_13a3_0005,
- &pci_dev_info_13a3_0006,
- &pci_dev_info_13a3_0007,
- &pci_dev_info_13a3_0012,
- &pci_dev_info_13a3_0014,
- &pci_dev_info_13a3_0016,
- &pci_dev_info_13a3_0017,
- &pci_dev_info_13a3_0018,
- NULL
-};
-#endif
-#define pci_dev_list_13a4 NULL
-#define pci_dev_list_13a5 NULL
-#define pci_dev_list_13a6 NULL
-#define pci_dev_list_13a7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13a8[] = {
- &pci_dev_info_13a8_0158,
- NULL
-};
-#endif
-#define pci_dev_list_13a9 NULL
-#define pci_dev_list_13aa NULL
-#define pci_dev_list_13ab NULL
-#define pci_dev_list_13ac NULL
-#define pci_dev_list_13ad NULL
-#define pci_dev_list_13ae NULL
-#define pci_dev_list_13af NULL
-#define pci_dev_list_13b0 NULL
-#define pci_dev_list_13b1 NULL
-#define pci_dev_list_13b2 NULL
-#define pci_dev_list_13b3 NULL
-#define pci_dev_list_13b4 NULL
-#define pci_dev_list_13b5 NULL
-#define pci_dev_list_13b6 NULL
-#define pci_dev_list_13b7 NULL
-#define pci_dev_list_13b8 NULL
-#define pci_dev_list_13b9 NULL
-#define pci_dev_list_13ba NULL
-#define pci_dev_list_13bb NULL
-#define pci_dev_list_13bc NULL
-#define pci_dev_list_13bd NULL
-#define pci_dev_list_13be NULL
-#define pci_dev_list_13bf NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13c0[] = {
- &pci_dev_info_13c0_0010,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13c1[] = {
- &pci_dev_info_13c1_1000,
- &pci_dev_info_13c1_1001,
- &pci_dev_info_13c1_1002,
- NULL
-};
-#endif
-#define pci_dev_list_13c2 NULL
-#define pci_dev_list_13c3 NULL
-#define pci_dev_list_13c4 NULL
-#define pci_dev_list_13c5 NULL
-#define pci_dev_list_13c6 NULL
-#define pci_dev_list_13c7 NULL
-#define pci_dev_list_13c8 NULL
-#define pci_dev_list_13c9 NULL
-#define pci_dev_list_13ca NULL
-#define pci_dev_list_13cb NULL
-#define pci_dev_list_13cc NULL
-#define pci_dev_list_13cd NULL
-#define pci_dev_list_13ce NULL
-#define pci_dev_list_13cf NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13d0[] = {
- &pci_dev_info_13d0_2103,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13d1[] = {
- &pci_dev_info_13d1_ab02,
- &pci_dev_info_13d1_ab06,
- NULL
-};
-#endif
-#define pci_dev_list_13d2 NULL
-#define pci_dev_list_13d3 NULL
-#define pci_dev_list_13d4 NULL
-#define pci_dev_list_13d5 NULL
-#define pci_dev_list_13d6 NULL
-#define pci_dev_list_13d7 NULL
-#define pci_dev_list_13d8 NULL
-#define pci_dev_list_13d9 NULL
-#define pci_dev_list_13da NULL
-#define pci_dev_list_13db NULL
-#define pci_dev_list_13dc NULL
-#define pci_dev_list_13dd NULL
-#define pci_dev_list_13de NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13df[] = {
- &pci_dev_info_13df_0001,
- NULL
-};
-#endif
-#define pci_dev_list_13e0 NULL
-#define pci_dev_list_13e1 NULL
-#define pci_dev_list_13e2 NULL
-#define pci_dev_list_13e3 NULL
-#define pci_dev_list_13e4 NULL
-#define pci_dev_list_13e5 NULL
-#define pci_dev_list_13e6 NULL
-#define pci_dev_list_13e7 NULL
-#define pci_dev_list_13e8 NULL
-#define pci_dev_list_13e9 NULL
-#define pci_dev_list_13ea NULL
-#define pci_dev_list_13eb NULL
-#define pci_dev_list_13ec NULL
-#define pci_dev_list_13ed NULL
-#define pci_dev_list_13ee NULL
-#define pci_dev_list_13ef NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13f0[] = {
- &pci_dev_info_13f0_0201,
- NULL
-};
-#endif
-#define pci_dev_list_13f1 NULL
-#define pci_dev_list_13f2 NULL
-#define pci_dev_list_13f3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13f4[] = {
- &pci_dev_info_13f4_1401,
- NULL
-};
-#endif
-#define pci_dev_list_13f5 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13f6[] = {
- &pci_dev_info_13f6_0100,
- &pci_dev_info_13f6_0101,
- &pci_dev_info_13f6_0111,
- &pci_dev_info_13f6_0211,
- NULL
-};
-#endif
-#define pci_dev_list_13f7 NULL
-#define pci_dev_list_13f8 NULL
-#define pci_dev_list_13f9 NULL
-#define pci_dev_list_13fa NULL
-#define pci_dev_list_13fb NULL
-#define pci_dev_list_13fc NULL
-#define pci_dev_list_13fd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_13fe[] = {
- &pci_dev_info_13fe_1756,
- NULL
-};
-#endif
-#define pci_dev_list_13ff NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1400[] = {
- &pci_dev_info_1400_1401,
- NULL
-};
-#endif
-#define pci_dev_list_1401 NULL
-#define pci_dev_list_1402 NULL
-#define pci_dev_list_1403 NULL
-#define pci_dev_list_1404 NULL
-#define pci_dev_list_1405 NULL
-#define pci_dev_list_1406 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1407[] = {
- &pci_dev_info_1407_0100,
- &pci_dev_info_1407_0101,
- &pci_dev_info_1407_0102,
- &pci_dev_info_1407_0200,
- &pci_dev_info_1407_0201,
- &pci_dev_info_1407_0202,
- &pci_dev_info_1407_0500,
- &pci_dev_info_1407_0600,
- &pci_dev_info_1407_8000,
- &pci_dev_info_1407_8001,
- &pci_dev_info_1407_8002,
- &pci_dev_info_1407_8003,
- &pci_dev_info_1407_8800,
- NULL
-};
-#endif
-#define pci_dev_list_1408 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1409[] = {
- &pci_dev_info_1409_7168,
- NULL
-};
-#endif
-#define pci_dev_list_140a NULL
-#define pci_dev_list_140b NULL
-#define pci_dev_list_140c NULL
-#define pci_dev_list_140d NULL
-#define pci_dev_list_140e NULL
-#define pci_dev_list_140f NULL
-#define pci_dev_list_1410 NULL
-#define pci_dev_list_1411 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1412[] = {
- &pci_dev_info_1412_1712,
- &pci_dev_info_1412_1724,
- NULL
-};
-#endif
-#define pci_dev_list_1413 NULL
-#define pci_dev_list_1414 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1415[] = {
- &pci_dev_info_1415_8403,
- &pci_dev_info_1415_9501,
- &pci_dev_info_1415_950a,
- &pci_dev_info_1415_950b,
- &pci_dev_info_1415_9511,
- &pci_dev_info_1415_9521,
- NULL
-};
-#endif
-#define pci_dev_list_1416 NULL
-#define pci_dev_list_1417 NULL
-#define pci_dev_list_1418 NULL
-#define pci_dev_list_1419 NULL
-#define pci_dev_list_141a NULL
-#define pci_dev_list_141b NULL
-#define pci_dev_list_141d NULL
-#define pci_dev_list_141e NULL
-#define pci_dev_list_141f NULL
-#define pci_dev_list_1420 NULL
-#define pci_dev_list_1421 NULL
-#define pci_dev_list_1422 NULL
-#define pci_dev_list_1423 NULL
-#define pci_dev_list_1424 NULL
-#define pci_dev_list_1425 NULL
-#define pci_dev_list_1426 NULL
-#define pci_dev_list_1427 NULL
-#define pci_dev_list_1428 NULL
-#define pci_dev_list_1429 NULL
-#define pci_dev_list_142a NULL
-#define pci_dev_list_142b NULL
-#define pci_dev_list_142c NULL
-#define pci_dev_list_142d NULL
-#define pci_dev_list_142e NULL
-#define pci_dev_list_142f NULL
-#define pci_dev_list_1430 NULL
-#define pci_dev_list_1431 NULL
-#define pci_dev_list_1432 NULL
-#define pci_dev_list_1433 NULL
-#define pci_dev_list_1435 NULL
-#define pci_dev_list_1436 NULL
-#define pci_dev_list_1437 NULL
-#define pci_dev_list_1438 NULL
-#define pci_dev_list_1439 NULL
-#define pci_dev_list_143a NULL
-#define pci_dev_list_143b NULL
-#define pci_dev_list_143c NULL
-#define pci_dev_list_143d NULL
-#define pci_dev_list_143e NULL
-#define pci_dev_list_143f NULL
-#define pci_dev_list_1440 NULL
-#define pci_dev_list_1441 NULL
-#define pci_dev_list_1442 NULL
-#define pci_dev_list_1443 NULL
-#define pci_dev_list_1444 NULL
-#define pci_dev_list_1445 NULL
-#define pci_dev_list_1446 NULL
-#define pci_dev_list_1447 NULL
-#define pci_dev_list_1448 NULL
-#define pci_dev_list_1449 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_144a[] = {
- &pci_dev_info_144a_7296,
- &pci_dev_info_144a_7432,
- &pci_dev_info_144a_7433,
- &pci_dev_info_144a_7434,
- &pci_dev_info_144a_7841,
- &pci_dev_info_144a_8133,
- &pci_dev_info_144a_8554,
- &pci_dev_info_144a_9111,
- &pci_dev_info_144a_9113,
- &pci_dev_info_144a_9114,
- NULL
-};
-#endif
-#define pci_dev_list_144b NULL
-#define pci_dev_list_144c NULL
-#define pci_dev_list_144d NULL
-#define pci_dev_list_144e NULL
-#define pci_dev_list_144f NULL
-#define pci_dev_list_1450 NULL
-#define pci_dev_list_1451 NULL
-#define pci_dev_list_1453 NULL
-#define pci_dev_list_1454 NULL
-#define pci_dev_list_1455 NULL
-#define pci_dev_list_1456 NULL
-#define pci_dev_list_1457 NULL
-#define pci_dev_list_1458 NULL
-#define pci_dev_list_1459 NULL
-#define pci_dev_list_145a NULL
-#define pci_dev_list_145b NULL
-#define pci_dev_list_145c NULL
-#define pci_dev_list_145d NULL
-#define pci_dev_list_145e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_145f[] = {
- &pci_dev_info_145f_0001,
- NULL
-};
-#endif
-#define pci_dev_list_1460 NULL
-#define pci_dev_list_1461 NULL
-#define pci_dev_list_1462 NULL
-#define pci_dev_list_1463 NULL
-#define pci_dev_list_1464 NULL
-#define pci_dev_list_1465 NULL
-#define pci_dev_list_1466 NULL
-#define pci_dev_list_1467 NULL
-#define pci_dev_list_1468 NULL
-#define pci_dev_list_1469 NULL
-#define pci_dev_list_146a NULL
-#define pci_dev_list_146b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_146c[] = {
- &pci_dev_info_146c_1430,
- NULL
-};
-#endif
-#define pci_dev_list_146d NULL
-#define pci_dev_list_146e NULL
-#define pci_dev_list_146f NULL
-#define pci_dev_list_1470 NULL
-#define pci_dev_list_1471 NULL
-#define pci_dev_list_1472 NULL
-#define pci_dev_list_1473 NULL
-#define pci_dev_list_1474 NULL
-#define pci_dev_list_1475 NULL
-#define pci_dev_list_1476 NULL
-#define pci_dev_list_1477 NULL
-#define pci_dev_list_1478 NULL
-#define pci_dev_list_1479 NULL
-#define pci_dev_list_147a NULL
-#define pci_dev_list_147b NULL
-#define pci_dev_list_147c NULL
-#define pci_dev_list_147d NULL
-#define pci_dev_list_147e NULL
-#define pci_dev_list_147f NULL
-#define pci_dev_list_1480 NULL
-#define pci_dev_list_1481 NULL
-#define pci_dev_list_1482 NULL
-#define pci_dev_list_1483 NULL
-#define pci_dev_list_1484 NULL
-#define pci_dev_list_1485 NULL
-#define pci_dev_list_1486 NULL
-#define pci_dev_list_1487 NULL
-#define pci_dev_list_1488 NULL
-#define pci_dev_list_1489 NULL
-#define pci_dev_list_148a NULL
-#define pci_dev_list_148b NULL
-#define pci_dev_list_148c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_148d[] = {
- &pci_dev_info_148d_1003,
- NULL
-};
-#endif
-#define pci_dev_list_148e NULL
-#define pci_dev_list_148f NULL
-#define pci_dev_list_1490 NULL
-#define pci_dev_list_1491 NULL
-#define pci_dev_list_1492 NULL
-#define pci_dev_list_1493 NULL
-#define pci_dev_list_1494 NULL
-#define pci_dev_list_1495 NULL
-#define pci_dev_list_1496 NULL
-#define pci_dev_list_1497 NULL
-#define pci_dev_list_1498 NULL
-#define pci_dev_list_1499 NULL
-#define pci_dev_list_149a NULL
-#define pci_dev_list_149b NULL
-#define pci_dev_list_149c NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_149d[] = {
- &pci_dev_info_149d_0001,
- NULL
-};
-#endif
-#define pci_dev_list_149e NULL
-#define pci_dev_list_149f NULL
-#define pci_dev_list_14a0 NULL
-#define pci_dev_list_14a1 NULL
-#define pci_dev_list_14a2 NULL
-#define pci_dev_list_14a3 NULL
-#define pci_dev_list_14a4 NULL
-#define pci_dev_list_14a5 NULL
-#define pci_dev_list_14a6 NULL
-#define pci_dev_list_14a7 NULL
-#define pci_dev_list_14a8 NULL
-#define pci_dev_list_14a9 NULL
-#define pci_dev_list_14aa NULL
-#define pci_dev_list_14ab NULL
-#define pci_dev_list_14ac NULL
-#define pci_dev_list_14ad NULL
-#define pci_dev_list_14ae NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14af[] = {
- &pci_dev_info_14af_7102,
- NULL
-};
-#endif
-#define pci_dev_list_14b0 NULL
-#define pci_dev_list_14b1 NULL
-#define pci_dev_list_14b2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14b3[] = {
- &pci_dev_info_14b3_0000,
- NULL
-};
-#endif
-#define pci_dev_list_14b4 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14b5[] = {
- &pci_dev_info_14b5_0200,
- &pci_dev_info_14b5_0300,
- &pci_dev_info_14b5_0400,
- &pci_dev_info_14b5_0600,
- &pci_dev_info_14b5_0800,
- &pci_dev_info_14b5_0900,
- &pci_dev_info_14b5_0a00,
- &pci_dev_info_14b5_0b00,
- NULL
-};
-#endif
-#define pci_dev_list_14b6 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14b7[] = {
- &pci_dev_info_14b7_0001,
- NULL
-};
-#endif
-#define pci_dev_list_14b8 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14b9[] = {
- &pci_dev_info_14b9_0001,
- &pci_dev_info_14b9_0340,
- &pci_dev_info_14b9_0350,
- &pci_dev_info_14b9_4500,
- &pci_dev_info_14b9_4800,
- &pci_dev_info_14b9_a504,
- NULL
-};
-#endif
-#define pci_dev_list_14ba NULL
-#define pci_dev_list_14bb NULL
-#define pci_dev_list_14bc NULL
-#define pci_dev_list_14bd NULL
-#define pci_dev_list_14be NULL
-#define pci_dev_list_14bf NULL
-#define pci_dev_list_14c0 NULL
-#define pci_dev_list_14c1 NULL
-#define pci_dev_list_14c2 NULL
-#define pci_dev_list_14c3 NULL
-#define pci_dev_list_14c4 NULL
-#define pci_dev_list_14c5 NULL
-#define pci_dev_list_14c6 NULL
-#define pci_dev_list_14c7 NULL
-#define pci_dev_list_14c8 NULL
-#define pci_dev_list_14c9 NULL
-#define pci_dev_list_14ca NULL
-#define pci_dev_list_14cb NULL
-#define pci_dev_list_14cc NULL
-#define pci_dev_list_14cd NULL
-#define pci_dev_list_14ce NULL
-#define pci_dev_list_14cf NULL
-#define pci_dev_list_14d0 NULL
-#define pci_dev_list_14d1 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14d2[] = {
- &pci_dev_info_14d2_8001,
- &pci_dev_info_14d2_8002,
- &pci_dev_info_14d2_8010,
- &pci_dev_info_14d2_8011,
- &pci_dev_info_14d2_8020,
- &pci_dev_info_14d2_8021,
- &pci_dev_info_14d2_8040,
- &pci_dev_info_14d2_8080,
- &pci_dev_info_14d2_a000,
- &pci_dev_info_14d2_a001,
- &pci_dev_info_14d2_a003,
- &pci_dev_info_14d2_a004,
- &pci_dev_info_14d2_a005,
- &pci_dev_info_14d2_e001,
- &pci_dev_info_14d2_e010,
- &pci_dev_info_14d2_e020,
- NULL
-};
-#endif
-#define pci_dev_list_14d3 NULL
-#define pci_dev_list_14d4 NULL
-#define pci_dev_list_14d5 NULL
-#define pci_dev_list_14d6 NULL
-#define pci_dev_list_14d7 NULL
-#define pci_dev_list_14d8 NULL
-#define pci_dev_list_14d9 NULL
-#define pci_dev_list_14da NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14db[] = {
- &pci_dev_info_14db_2120,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14dc[] = {
- &pci_dev_info_14dc_0000,
- &pci_dev_info_14dc_0001,
- &pci_dev_info_14dc_0002,
- &pci_dev_info_14dc_0003,
- &pci_dev_info_14dc_0004,
- &pci_dev_info_14dc_0005,
- &pci_dev_info_14dc_0006,
- &pci_dev_info_14dc_0007,
- &pci_dev_info_14dc_0008,
- &pci_dev_info_14dc_0009,
- &pci_dev_info_14dc_000a,
- &pci_dev_info_14dc_000b,
- NULL
-};
-#endif
-#define pci_dev_list_14dd NULL
-#define pci_dev_list_14de NULL
-#define pci_dev_list_14df NULL
-#define pci_dev_list_14e1 NULL
-#define pci_dev_list_14e2 NULL
-#define pci_dev_list_14e3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14e4[] = {
- &pci_dev_info_14e4_1644,
- &pci_dev_info_14e4_1645,
- &pci_dev_info_14e4_1646,
- &pci_dev_info_14e4_1647,
- &pci_dev_info_14e4_1648,
- &pci_dev_info_14e4_164d,
- &pci_dev_info_14e4_1653,
- &pci_dev_info_14e4_165d,
- &pci_dev_info_14e4_1696,
- &pci_dev_info_14e4_169c,
- &pci_dev_info_14e4_16a6,
- &pci_dev_info_14e4_16a7,
- &pci_dev_info_14e4_16a8,
- &pci_dev_info_14e4_16c6,
- &pci_dev_info_14e4_16c7,
- &pci_dev_info_14e4_4210,
- &pci_dev_info_14e4_4211,
- &pci_dev_info_14e4_4212,
- &pci_dev_info_14e4_4301,
- &pci_dev_info_14e4_4320,
- &pci_dev_info_14e4_4401,
- &pci_dev_info_14e4_4402,
- &pci_dev_info_14e4_4410,
- &pci_dev_info_14e4_4411,
- &pci_dev_info_14e4_4412,
- &pci_dev_info_14e4_5820,
- &pci_dev_info_14e4_5821,
- NULL
-};
-#endif
-#define pci_dev_list_14e5 NULL
-#define pci_dev_list_14e6 NULL
-#define pci_dev_list_14e7 NULL
-#define pci_dev_list_14e8 NULL
-#define pci_dev_list_14e9 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14ea[] = {
- &pci_dev_info_14ea_ab06,
- NULL
-};
-#endif
-#define pci_dev_list_14eb NULL
-#define pci_dev_list_14ec NULL
-#define pci_dev_list_14ed NULL
-#define pci_dev_list_14ee NULL
-#define pci_dev_list_14ef NULL
-#define pci_dev_list_14f0 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_14f1[] = {
- &pci_dev_info_14f1_1002,
- &pci_dev_info_14f1_1003,
- &pci_dev_info_14f1_1004,
- &pci_dev_info_14f1_1005,
- &pci_dev_info_14f1_1006,
- &pci_dev_info_14f1_1022,
- &pci_dev_info_14f1_1023,
- &pci_dev_info_14f1_1024,
- &pci_dev_info_14f1_1025,
- &pci_dev_info_14f1_1026,
- &pci_dev_info_14f1_1032,
- &pci_dev_info_14f1_1033,
- &pci_dev_info_14f1_1034,
- &pci_dev_info_14f1_1035,
- &pci_dev_info_14f1_1036,
- &pci_dev_info_14f1_1052,
- &pci_dev_info_14f1_1053,
- &pci_dev_info_14f1_1054,
- &pci_dev_info_14f1_1055,
- &pci_dev_info_14f1_1056,
- &pci_dev_info_14f1_1057,
- &pci_dev_info_14f1_1059,
- &pci_dev_info_14f1_1063,
- &pci_dev_info_14f1_1064,
- &pci_dev_info_14f1_1065,
- &pci_dev_info_14f1_1066,
- &pci_dev_info_14f1_1433,
- &pci_dev_info_14f1_1434,
- &pci_dev_info_14f1_1435,
- &pci_dev_info_14f1_1436,
- &pci_dev_info_14f1_1453,
- &pci_dev_info_14f1_1454,
- &pci_dev_info_14f1_1455,
- &pci_dev_info_14f1_1456,
- &pci_dev_info_14f1_1610,
- &pci_dev_info_14f1_1611,
- &pci_dev_info_14f1_1620,
- &pci_dev_info_14f1_1621,
- &pci_dev_info_14f1_1622,
- &pci_dev_info_14f1_1803,
- &pci_dev_info_14f1_1815,
- &pci_dev_info_14f1_2003,
- &pci_dev_info_14f1_2004,
- &pci_dev_info_14f1_2005,
- &pci_dev_info_14f1_2006,
- &pci_dev_info_14f1_2013,
- &pci_dev_info_14f1_2014,
- &pci_dev_info_14f1_2015,
- &pci_dev_info_14f1_2016,
- &pci_dev_info_14f1_2043,
- &pci_dev_info_14f1_2044,
- &pci_dev_info_14f1_2045,
- &pci_dev_info_14f1_2046,
- &pci_dev_info_14f1_2063,
- &pci_dev_info_14f1_2064,
- &pci_dev_info_14f1_2065,
- &pci_dev_info_14f1_2066,
- &pci_dev_info_14f1_2093,
- &pci_dev_info_14f1_2143,
- &pci_dev_info_14f1_2144,
- &pci_dev_info_14f1_2145,
- &pci_dev_info_14f1_2146,
- &pci_dev_info_14f1_2163,
- &pci_dev_info_14f1_2164,
- &pci_dev_info_14f1_2165,
- &pci_dev_info_14f1_2166,
- &pci_dev_info_14f1_2343,
- &pci_dev_info_14f1_2344,
- &pci_dev_info_14f1_2345,
- &pci_dev_info_14f1_2346,
- &pci_dev_info_14f1_2363,
- &pci_dev_info_14f1_2364,
- &pci_dev_info_14f1_2365,
- &pci_dev_info_14f1_2366,
- &pci_dev_info_14f1_2443,
- &pci_dev_info_14f1_2444,
- &pci_dev_info_14f1_2445,
- &pci_dev_info_14f1_2446,
- &pci_dev_info_14f1_2463,
- &pci_dev_info_14f1_2464,
- &pci_dev_info_14f1_2465,
- &pci_dev_info_14f1_2466,
- &pci_dev_info_14f1_2f00,
- &pci_dev_info_14f1_8234,
- NULL
-};
-#endif
-#define pci_dev_list_14f2 NULL
-#define pci_dev_list_14f3 NULL
-#define pci_dev_list_14f4 NULL
-#define pci_dev_list_14f5 NULL
-#define pci_dev_list_14f6 NULL
-#define pci_dev_list_14f7 NULL
-#define pci_dev_list_14f8 NULL
-#define pci_dev_list_14f9 NULL
-#define pci_dev_list_14fa NULL
-#define pci_dev_list_14fb NULL
-#define pci_dev_list_14fc NULL
-#define pci_dev_list_14fd NULL
-#define pci_dev_list_14fe NULL
-#define pci_dev_list_14ff NULL
-#define pci_dev_list_1500 NULL
-#define pci_dev_list_1501 NULL
-#define pci_dev_list_1502 NULL
-#define pci_dev_list_1503 NULL
-#define pci_dev_list_1504 NULL
-#define pci_dev_list_1505 NULL
-#define pci_dev_list_1506 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1507[] = {
- &pci_dev_info_1507_0001,
- &pci_dev_info_1507_0002,
- &pci_dev_info_1507_0003,
- &pci_dev_info_1507_0100,
- &pci_dev_info_1507_0431,
- &pci_dev_info_1507_4801,
- &pci_dev_info_1507_4802,
- &pci_dev_info_1507_4803,
- &pci_dev_info_1507_4806,
- NULL
-};
-#endif
-#define pci_dev_list_1508 NULL
-#define pci_dev_list_1509 NULL
-#define pci_dev_list_150a NULL
-#define pci_dev_list_150b NULL
-#define pci_dev_list_150c NULL
-#define pci_dev_list_150d NULL
-#define pci_dev_list_150e NULL
-#define pci_dev_list_150f NULL
-#define pci_dev_list_1510 NULL
-#define pci_dev_list_1511 NULL
-#define pci_dev_list_1512 NULL
-#define pci_dev_list_1513 NULL
-#define pci_dev_list_1514 NULL
-#define pci_dev_list_1515 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1516[] = {
- &pci_dev_info_1516_0803,
- NULL
-};
-#endif
-#define pci_dev_list_1517 NULL
-#define pci_dev_list_1518 NULL
-#define pci_dev_list_1519 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_151a[] = {
- &pci_dev_info_151a_1002,
- &pci_dev_info_151a_1004,
- &pci_dev_info_151a_1008,
- NULL
-};
-#endif
-#define pci_dev_list_151b NULL
-#define pci_dev_list_151c NULL
-#define pci_dev_list_151d NULL
-#define pci_dev_list_151e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_151f[] = {
- &pci_dev_info_151f_0000,
- NULL
-};
-#endif
-#define pci_dev_list_1520 NULL
-#define pci_dev_list_1521 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1522[] = {
- &pci_dev_info_1522_0100,
- NULL
-};
-#endif
-#define pci_dev_list_1523 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1524[] = {
- &pci_dev_info_1524_1211,
- &pci_dev_info_1524_1225,
- &pci_dev_info_1524_1410,
- &pci_dev_info_1524_1420,
- NULL
-};
-#endif
-#define pci_dev_list_1525 NULL
-#define pci_dev_list_1526 NULL
-#define pci_dev_list_1527 NULL
-#define pci_dev_list_1528 NULL
-#define pci_dev_list_1529 NULL
-#define pci_dev_list_152a NULL
-#define pci_dev_list_152b NULL
-#define pci_dev_list_152c NULL
-#define pci_dev_list_152d NULL
-#define pci_dev_list_152e NULL
-#define pci_dev_list_152f NULL
-#define pci_dev_list_1530 NULL
-#define pci_dev_list_1531 NULL
-#define pci_dev_list_1532 NULL
-#define pci_dev_list_1533 NULL
-#define pci_dev_list_1534 NULL
-#define pci_dev_list_1535 NULL
-#define pci_dev_list_1537 NULL
-#define pci_dev_list_1538 NULL
-#define pci_dev_list_1539 NULL
-#define pci_dev_list_153a NULL
-#define pci_dev_list_153b NULL
-#define pci_dev_list_153c NULL
-#define pci_dev_list_153d NULL
-#define pci_dev_list_153e NULL
-#define pci_dev_list_153f NULL
-#define pci_dev_list_1540 NULL
-#define pci_dev_list_1541 NULL
-#define pci_dev_list_1542 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1543[] = {
- &pci_dev_info_1543_3052,
- &pci_dev_info_1543_4c22,
- NULL
-};
-#endif
-#define pci_dev_list_1544 NULL
-#define pci_dev_list_1545 NULL
-#define pci_dev_list_1546 NULL
-#define pci_dev_list_1547 NULL
-#define pci_dev_list_1548 NULL
-#define pci_dev_list_1549 NULL
-#define pci_dev_list_154a NULL
-#define pci_dev_list_154b NULL
-#define pci_dev_list_154c NULL
-#define pci_dev_list_154d NULL
-#define pci_dev_list_154e NULL
-#define pci_dev_list_154f NULL
-#define pci_dev_list_1550 NULL
-#define pci_dev_list_1551 NULL
-#define pci_dev_list_1552 NULL
-#define pci_dev_list_1553 NULL
-#define pci_dev_list_1554 NULL
-#define pci_dev_list_1555 NULL
-#define pci_dev_list_1556 NULL
-#define pci_dev_list_1557 NULL
-#define pci_dev_list_1558 NULL
-#define pci_dev_list_1559 NULL
-#define pci_dev_list_155a NULL
-#define pci_dev_list_155b NULL
-#define pci_dev_list_155c NULL
-#define pci_dev_list_155d NULL
-#define pci_dev_list_155e NULL
-#define pci_dev_list_155f NULL
-#define pci_dev_list_1560 NULL
-#define pci_dev_list_1561 NULL
-#define pci_dev_list_1562 NULL
-#define pci_dev_list_1563 NULL
-#define pci_dev_list_1564 NULL
-#define pci_dev_list_1565 NULL
-#define pci_dev_list_1566 NULL
-#define pci_dev_list_1567 NULL
-#define pci_dev_list_1568 NULL
-#define pci_dev_list_1569 NULL
-#define pci_dev_list_156a NULL
-#define pci_dev_list_156b NULL
-#define pci_dev_list_156c NULL
-#define pci_dev_list_156d NULL
-#define pci_dev_list_156e NULL
-#define pci_dev_list_156f NULL
-#define pci_dev_list_1570 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1571[] = {
- &pci_dev_info_1571_a001,
- &pci_dev_info_1571_a002,
- &pci_dev_info_1571_a003,
- &pci_dev_info_1571_a004,
- &pci_dev_info_1571_a005,
- &pci_dev_info_1571_a006,
- &pci_dev_info_1571_a007,
- &pci_dev_info_1571_a008,
- &pci_dev_info_1571_a009,
- &pci_dev_info_1571_a00a,
- &pci_dev_info_1571_a00b,
- &pci_dev_info_1571_a00c,
- &pci_dev_info_1571_a00d,
- &pci_dev_info_1571_a201,
- &pci_dev_info_1571_a202,
- &pci_dev_info_1571_a203,
- &pci_dev_info_1571_a204,
- &pci_dev_info_1571_a205,
- &pci_dev_info_1571_a206,
- NULL
-};
-#endif
-#define pci_dev_list_1572 NULL
-#define pci_dev_list_1573 NULL
-#define pci_dev_list_1574 NULL
-#define pci_dev_list_1575 NULL
-#define pci_dev_list_1576 NULL
-#define pci_dev_list_1578 NULL
-#define pci_dev_list_1579 NULL
-#define pci_dev_list_157a NULL
-#define pci_dev_list_157b NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_157c[] = {
- &pci_dev_info_157c_8001,
- NULL
-};
-#endif
-#define pci_dev_list_157d NULL
-#define pci_dev_list_157e NULL
-#define pci_dev_list_157f NULL
-#define pci_dev_list_1580 NULL
-#define pci_dev_list_1581 NULL
-#define pci_dev_list_1582 NULL
-#define pci_dev_list_1583 NULL
-#define pci_dev_list_1584 NULL
-#define pci_dev_list_1585 NULL
-#define pci_dev_list_1586 NULL
-#define pci_dev_list_1587 NULL
-#define pci_dev_list_1588 NULL
-#define pci_dev_list_1589 NULL
-#define pci_dev_list_158a NULL
-#define pci_dev_list_158b NULL
-#define pci_dev_list_158c NULL
-#define pci_dev_list_158d NULL
-#define pci_dev_list_158e NULL
-#define pci_dev_list_158f NULL
-#define pci_dev_list_1590 NULL
-#define pci_dev_list_1591 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1592[] = {
- &pci_dev_info_1592_0781,
- &pci_dev_info_1592_0782,
- &pci_dev_info_1592_0783,
- &pci_dev_info_1592_0785,
- &pci_dev_info_1592_0786,
- &pci_dev_info_1592_0787,
- &pci_dev_info_1592_0788,
- &pci_dev_info_1592_078a,
- NULL
-};
-#endif
-#define pci_dev_list_1593 NULL
-#define pci_dev_list_1594 NULL
-#define pci_dev_list_1595 NULL
-#define pci_dev_list_1596 NULL
-#define pci_dev_list_1597 NULL
-#define pci_dev_list_1598 NULL
-#define pci_dev_list_1599 NULL
-#define pci_dev_list_159a NULL
-#define pci_dev_list_159b NULL
-#define pci_dev_list_159c NULL
-#define pci_dev_list_159d NULL
-#define pci_dev_list_159e NULL
-#define pci_dev_list_159f NULL
-#define pci_dev_list_15a0 NULL
-#define pci_dev_list_15a1 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15a2[] = {
- &pci_dev_info_15a2_0001,
- NULL
-};
-#endif
-#define pci_dev_list_15a3 NULL
-#define pci_dev_list_15a4 NULL
-#define pci_dev_list_15a5 NULL
-#define pci_dev_list_15a6 NULL
-#define pci_dev_list_15a7 NULL
-#define pci_dev_list_15a8 NULL
-#define pci_dev_list_15aa NULL
-#define pci_dev_list_15ab NULL
-#define pci_dev_list_15ac NULL
-static const pciDeviceInfo *pci_dev_list_15ad[] = {
- &pci_dev_info_15ad_0710,
- NULL
-};
-#define pci_dev_list_15ae NULL
-#define pci_dev_list_15b0 NULL
-#define pci_dev_list_15b1 NULL
-#define pci_dev_list_15b2 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15b3[] = {
- &pci_dev_info_15b3_5274,
- NULL
-};
-#endif
-#define pci_dev_list_15b4 NULL
-#define pci_dev_list_15b5 NULL
-#define pci_dev_list_15b6 NULL
-#define pci_dev_list_15b7 NULL
-#define pci_dev_list_15b8 NULL
-#define pci_dev_list_15b9 NULL
-#define pci_dev_list_15ba NULL
-#define pci_dev_list_15bb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15bc[] = {
- &pci_dev_info_15bc_2929,
- NULL
-};
-#endif
-#define pci_dev_list_15bd NULL
-#define pci_dev_list_15be NULL
-#define pci_dev_list_15bf NULL
-#define pci_dev_list_15c0 NULL
-#define pci_dev_list_15c1 NULL
-#define pci_dev_list_15c2 NULL
-#define pci_dev_list_15c3 NULL
-#define pci_dev_list_15c4 NULL
-#define pci_dev_list_15c5 NULL
-#define pci_dev_list_15c6 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15c7[] = {
- &pci_dev_info_15c7_0349,
- NULL
-};
-#endif
-#define pci_dev_list_15c8 NULL
-#define pci_dev_list_15c9 NULL
-#define pci_dev_list_15ca NULL
-#define pci_dev_list_15cb NULL
-#define pci_dev_list_15cc NULL
-#define pci_dev_list_15cd NULL
-#define pci_dev_list_15ce NULL
-#define pci_dev_list_15cf NULL
-#define pci_dev_list_15d1 NULL
-#define pci_dev_list_15d2 NULL
-#define pci_dev_list_15d3 NULL
-#define pci_dev_list_15d4 NULL
-#define pci_dev_list_15d5 NULL
-#define pci_dev_list_15d6 NULL
-#define pci_dev_list_15d7 NULL
-#define pci_dev_list_15d8 NULL
-#define pci_dev_list_15d9 NULL
-#define pci_dev_list_15da NULL
-#define pci_dev_list_15db NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15dc[] = {
- &pci_dev_info_15dc_0001,
- NULL
-};
-#endif
-#define pci_dev_list_15dd NULL
-#define pci_dev_list_15de NULL
-#define pci_dev_list_15df NULL
-#define pci_dev_list_15e0 NULL
-#define pci_dev_list_15e1 NULL
-#define pci_dev_list_15e2 NULL
-#define pci_dev_list_15e3 NULL
-#define pci_dev_list_15e4 NULL
-#define pci_dev_list_15e5 NULL
-#define pci_dev_list_15e6 NULL
-#define pci_dev_list_15e7 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_15e8[] = {
- &pci_dev_info_15e8_0130,
- NULL
-};
-#endif
-#define pci_dev_list_15e9 NULL
-#define pci_dev_list_15ea NULL
-#define pci_dev_list_15eb NULL
-#define pci_dev_list_15ec NULL
-#define pci_dev_list_15ed NULL
-#define pci_dev_list_15ee NULL
-#define pci_dev_list_15ef NULL
-#define pci_dev_list_15f0 NULL
-#define pci_dev_list_15f1 NULL
-#define pci_dev_list_15f2 NULL
-#define pci_dev_list_15f3 NULL
-#define pci_dev_list_15f4 NULL
-#define pci_dev_list_15f5 NULL
-#define pci_dev_list_15f6 NULL
-#define pci_dev_list_15f7 NULL
-#define pci_dev_list_15f8 NULL
-#define pci_dev_list_15f9 NULL
-#define pci_dev_list_15fa NULL
-#define pci_dev_list_15fb NULL
-#define pci_dev_list_15fc NULL
-#define pci_dev_list_15fd NULL
-#define pci_dev_list_15fe NULL
-#define pci_dev_list_15ff NULL
-#define pci_dev_list_1600 NULL
-#define pci_dev_list_1601 NULL
-#define pci_dev_list_1602 NULL
-#define pci_dev_list_1603 NULL
-#define pci_dev_list_1604 NULL
-#define pci_dev_list_1605 NULL
-#define pci_dev_list_1606 NULL
-#define pci_dev_list_1607 NULL
-#define pci_dev_list_1608 NULL
-#define pci_dev_list_1609 NULL
-#define pci_dev_list_1612 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1619[] = {
- &pci_dev_info_1619_0400,
- &pci_dev_info_1619_0440,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1629[] = {
- &pci_dev_info_1629_1003,
- &pci_dev_info_1629_2002,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1638[] = {
- &pci_dev_info_1638_1100,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_163c[] = {
- &pci_dev_info_163c_3052,
- &pci_dev_info_163c_5449,
- NULL
-};
-#endif
-#define pci_dev_list_1657 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_165a[] = {
- &pci_dev_info_165a_c100,
- &pci_dev_info_165a_d200,
- &pci_dev_info_165a_d300,
- NULL
-};
-#endif
-#define pci_dev_list_165d NULL
-#define pci_dev_list_1661 NULL
-#define pci_dev_list_1668 NULL
-#define pci_dev_list_1681 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_16ab[] = {
- &pci_dev_info_16ab_1102,
- NULL
-};
-#endif
-#define pci_dev_list_16be NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_16ca[] = {
- &pci_dev_info_16ca_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_16ec[] = {
- &pci_dev_info_16ec_3685,
- NULL
-};
-#endif
-#define pci_dev_list_16f6 NULL
-#define pci_dev_list_1705 NULL
-#define pci_dev_list_170b NULL
-#define pci_dev_list_170c NULL
-#define pci_dev_list_172a NULL
-#define pci_dev_list_1737 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_173b[] = {
- &pci_dev_info_173b_03e8,
- &pci_dev_info_173b_03ea,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1743[] = {
- &pci_dev_info_1743_8139,
- NULL
-};
-#endif
-#define pci_dev_list_174b NULL
-#define pci_dev_list_175e NULL
-#define pci_dev_list_1787 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1796[] = {
- &pci_dev_info_1796_0001,
- &pci_dev_info_1796_0002,
- &pci_dev_info_1796_0003,
- &pci_dev_info_1796_0004,
- &pci_dev_info_1796_0005,
- &pci_dev_info_1796_0006,
- NULL
-};
-#endif
-#define pci_dev_list_1799 NULL
-#define pci_dev_list_17af NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_17cc[] = {
- &pci_dev_info_17cc_2280,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1813[] = {
- &pci_dev_info_1813_4000,
- &pci_dev_info_1813_4100,
- NULL
-};
-#endif
-#define pci_dev_list_1851 NULL
-#define pci_dev_list_1852 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1888[] = {
- &pci_dev_info_1888_0301,
- &pci_dev_info_1888_0601,
- &pci_dev_info_1888_0710,
- &pci_dev_info_1888_0720,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1a08[] = {
- &pci_dev_info_1a08_0000,
- NULL
-};
-#endif
-#define pci_dev_list_1b13 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1c1c[] = {
- &pci_dev_info_1c1c_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1d44[] = {
- &pci_dev_info_1d44_a400,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1de1[] = {
- &pci_dev_info_1de1_0391,
- &pci_dev_info_1de1_2020,
- &pci_dev_info_1de1_690c,
- &pci_dev_info_1de1_dc29,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_1fc0[] = {
- &pci_dev_info_1fc0_0300,
- NULL
-};
-#endif
-#define pci_dev_list_2000 NULL
-#define pci_dev_list_2001 NULL
-#define pci_dev_list_2003 NULL
-#define pci_dev_list_2004 NULL
-#define pci_dev_list_21c3 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_2348[] = {
- &pci_dev_info_2348_2010,
- NULL
-};
-#endif
-#define pci_dev_list_2646 NULL
-#define pci_dev_list_270b NULL
-#define pci_dev_list_270f NULL
-#define pci_dev_list_2711 NULL
-#define pci_dev_list_2a15 NULL
-#define pci_dev_list_3000 NULL
-#define pci_dev_list_3142 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_3388[] = {
- &pci_dev_info_3388_0013,
- &pci_dev_info_3388_0014,
- &pci_dev_info_3388_0021,
- &pci_dev_info_3388_101a,
- &pci_dev_info_3388_101b,
- &pci_dev_info_3388_8011,
- &pci_dev_info_3388_8012,
- &pci_dev_info_3388_8013,
- NULL
-};
-#endif
-#define pci_dev_list_3411 NULL
-#define pci_dev_list_3513 NULL
-#define pci_dev_list_38ef NULL
-static const pciDeviceInfo *pci_dev_list_3d3d[] = {
- &pci_dev_info_3d3d_0001,
- &pci_dev_info_3d3d_0002,
- &pci_dev_info_3d3d_0003,
- &pci_dev_info_3d3d_0004,
- &pci_dev_info_3d3d_0005,
- &pci_dev_info_3d3d_0006,
- &pci_dev_info_3d3d_0007,
- &pci_dev_info_3d3d_0008,
- &pci_dev_info_3d3d_0009,
- &pci_dev_info_3d3d_000a,
- &pci_dev_info_3d3d_000c,
- &pci_dev_info_3d3d_0100,
- &pci_dev_info_3d3d_1004,
- &pci_dev_info_3d3d_3d04,
- &pci_dev_info_3d3d_ffff,
- NULL
-};
-static const pciDeviceInfo *pci_dev_list_4005[] = {
- &pci_dev_info_4005_0300,
- &pci_dev_info_4005_0308,
- &pci_dev_info_4005_0309,
- &pci_dev_info_4005_1064,
- &pci_dev_info_4005_2064,
- &pci_dev_info_4005_2128,
- &pci_dev_info_4005_2301,
- &pci_dev_info_4005_2302,
- &pci_dev_info_4005_2303,
- &pci_dev_info_4005_2364,
- &pci_dev_info_4005_2464,
- &pci_dev_info_4005_2501,
- &pci_dev_info_4005_4000,
- &pci_dev_info_4005_4710,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4033[] = {
- &pci_dev_info_4033_1360,
- NULL
-};
-#endif
-#define pci_dev_list_4143 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_416c[] = {
- &pci_dev_info_416c_0100,
- &pci_dev_info_416c_0200,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4444[] = {
- &pci_dev_info_4444_0803,
- NULL
-};
-#endif
-#define pci_dev_list_4468 NULL
-#define pci_dev_list_4594 NULL
-#define pci_dev_list_45fb NULL
-#define pci_dev_list_4680 NULL
-#define pci_dev_list_4843 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4916[] = {
- &pci_dev_info_4916_1960,
- NULL
-};
-#endif
-#define pci_dev_list_4943 NULL
-#define pci_dev_list_4978 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4a14[] = {
- &pci_dev_info_4a14_5000,
- NULL
-};
-#endif
-#define pci_dev_list_4b10 NULL
-#define pci_dev_list_4c48 NULL
-#define pci_dev_list_4c53 NULL
-#define pci_dev_list_4ca1 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4d51[] = {
- &pci_dev_info_4d51_0200,
- NULL
-};
-#endif
-#define pci_dev_list_4d54 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_4ddc[] = {
- &pci_dev_info_4ddc_0100,
- &pci_dev_info_4ddc_0801,
- &pci_dev_info_4ddc_0802,
- &pci_dev_info_4ddc_0811,
- &pci_dev_info_4ddc_0812,
- &pci_dev_info_4ddc_0881,
- &pci_dev_info_4ddc_0882,
- &pci_dev_info_4ddc_0891,
- &pci_dev_info_4ddc_0892,
- &pci_dev_info_4ddc_0901,
- &pci_dev_info_4ddc_0902,
- &pci_dev_info_4ddc_0903,
- &pci_dev_info_4ddc_0904,
- &pci_dev_info_4ddc_0b01,
- &pci_dev_info_4ddc_0b02,
- &pci_dev_info_4ddc_0b03,
- &pci_dev_info_4ddc_0b04,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5046[] = {
- &pci_dev_info_5046_1001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5053[] = {
- &pci_dev_info_5053_2010,
- NULL
-};
-#endif
-#define pci_dev_list_5136 NULL
-#define pci_dev_list_5143 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5145[] = {
- &pci_dev_info_5145_3031,
- NULL
-};
-#endif
-#define pci_dev_list_5168 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5301[] = {
- &pci_dev_info_5301_0001,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_5333[] = {
- &pci_dev_info_5333_0551,
- &pci_dev_info_5333_5631,
- &pci_dev_info_5333_8800,
- &pci_dev_info_5333_8801,
- &pci_dev_info_5333_8810,
- &pci_dev_info_5333_8811,
- &pci_dev_info_5333_8812,
- &pci_dev_info_5333_8813,
- &pci_dev_info_5333_8814,
- &pci_dev_info_5333_8815,
- &pci_dev_info_5333_883d,
- &pci_dev_info_5333_8870,
- &pci_dev_info_5333_8880,
- &pci_dev_info_5333_8881,
- &pci_dev_info_5333_8882,
- &pci_dev_info_5333_8883,
- &pci_dev_info_5333_88b0,
- &pci_dev_info_5333_88b1,
- &pci_dev_info_5333_88b2,
- &pci_dev_info_5333_88b3,
- &pci_dev_info_5333_88c0,
- &pci_dev_info_5333_88c1,
- &pci_dev_info_5333_88c2,
- &pci_dev_info_5333_88c3,
- &pci_dev_info_5333_88d0,
- &pci_dev_info_5333_88d1,
- &pci_dev_info_5333_88d2,
- &pci_dev_info_5333_88d3,
- &pci_dev_info_5333_88f0,
- &pci_dev_info_5333_88f1,
- &pci_dev_info_5333_88f2,
- &pci_dev_info_5333_88f3,
- &pci_dev_info_5333_8900,
- &pci_dev_info_5333_8901,
- &pci_dev_info_5333_8902,
- &pci_dev_info_5333_8903,
- &pci_dev_info_5333_8904,
- &pci_dev_info_5333_8905,
- &pci_dev_info_5333_8906,
- &pci_dev_info_5333_8907,
- &pci_dev_info_5333_8908,
- &pci_dev_info_5333_8909,
- &pci_dev_info_5333_890a,
- &pci_dev_info_5333_890b,
- &pci_dev_info_5333_890c,
- &pci_dev_info_5333_890d,
- &pci_dev_info_5333_890e,
- &pci_dev_info_5333_890f,
- &pci_dev_info_5333_8a01,
- &pci_dev_info_5333_8a10,
- &pci_dev_info_5333_8a13,
- &pci_dev_info_5333_8a20,
- &pci_dev_info_5333_8a21,
- &pci_dev_info_5333_8a22,
- &pci_dev_info_5333_8a23,
- &pci_dev_info_5333_8a25,
- &pci_dev_info_5333_8a26,
- &pci_dev_info_5333_8c00,
- &pci_dev_info_5333_8c01,
- &pci_dev_info_5333_8c02,
- &pci_dev_info_5333_8c03,
- &pci_dev_info_5333_8c10,
- &pci_dev_info_5333_8c11,
- &pci_dev_info_5333_8c12,
- &pci_dev_info_5333_8c13,
- &pci_dev_info_5333_8c22,
- &pci_dev_info_5333_8c24,
- &pci_dev_info_5333_8c26,
- &pci_dev_info_5333_8c2a,
- &pci_dev_info_5333_8c2b,
- &pci_dev_info_5333_8c2c,
- &pci_dev_info_5333_8c2d,
- &pci_dev_info_5333_8c2e,
- &pci_dev_info_5333_8c2f,
- &pci_dev_info_5333_8d01,
- &pci_dev_info_5333_8d02,
- &pci_dev_info_5333_8d03,
- &pci_dev_info_5333_8d04,
- &pci_dev_info_5333_9102,
- &pci_dev_info_5333_ca00,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_544c[] = {
- &pci_dev_info_544c_0350,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5455[] = {
- &pci_dev_info_5455_4458,
- NULL
-};
-#endif
-#define pci_dev_list_5519 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5544[] = {
- &pci_dev_info_5544_0001,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_5555[] = {
- &pci_dev_info_5555_0003,
- NULL
-};
-#endif
-#define pci_dev_list_5654 NULL
-#define pci_dev_list_5700 NULL
-#define pci_dev_list_6356 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_6374[] = {
- &pci_dev_info_6374_6773,
- NULL
-};
-#endif
-#define pci_dev_list_6409 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_6666[] = {
- &pci_dev_info_6666_0001,
- &pci_dev_info_6666_0002,
- NULL
-};
-#endif
-#define pci_dev_list_7604 NULL
-#define pci_dev_list_7bde NULL
-#define pci_dev_list_7fed NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_8008[] = {
- &pci_dev_info_8008_0010,
- &pci_dev_info_8008_0011,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_8086[] = {
- &pci_dev_info_8086_0007,
- &pci_dev_info_8086_0008,
- &pci_dev_info_8086_0039,
- &pci_dev_info_8086_0122,
- &pci_dev_info_8086_0482,
- &pci_dev_info_8086_0483,
- &pci_dev_info_8086_0484,
- &pci_dev_info_8086_0486,
- &pci_dev_info_8086_04a3,
- &pci_dev_info_8086_04d0,
- &pci_dev_info_8086_0600,
- &pci_dev_info_8086_0960,
- &pci_dev_info_8086_0962,
- &pci_dev_info_8086_0964,
- &pci_dev_info_8086_1000,
- &pci_dev_info_8086_1001,
- &pci_dev_info_8086_1002,
- &pci_dev_info_8086_1004,
- &pci_dev_info_8086_1008,
- &pci_dev_info_8086_1009,
- &pci_dev_info_8086_100c,
- &pci_dev_info_8086_100d,
- &pci_dev_info_8086_100e,
- &pci_dev_info_8086_100f,
- &pci_dev_info_8086_1010,
- &pci_dev_info_8086_1011,
- &pci_dev_info_8086_1012,
- &pci_dev_info_8086_1015,
- &pci_dev_info_8086_1029,
- &pci_dev_info_8086_1030,
- &pci_dev_info_8086_1031,
- &pci_dev_info_8086_1032,
- &pci_dev_info_8086_1033,
- &pci_dev_info_8086_1034,
- &pci_dev_info_8086_1035,
- &pci_dev_info_8086_1036,
- &pci_dev_info_8086_1037,
- &pci_dev_info_8086_1038,
- &pci_dev_info_8086_1039,
- &pci_dev_info_8086_103a,
- &pci_dev_info_8086_103b,
- &pci_dev_info_8086_103c,
- &pci_dev_info_8086_103d,
- &pci_dev_info_8086_103e,
- &pci_dev_info_8086_1040,
- &pci_dev_info_8086_1043,
- &pci_dev_info_8086_1059,
- &pci_dev_info_8086_1130,
- &pci_dev_info_8086_1131,
- &pci_dev_info_8086_1132,
- &pci_dev_info_8086_1161,
- &pci_dev_info_8086_1162,
- &pci_dev_info_8086_1200,
- &pci_dev_info_8086_1209,
- &pci_dev_info_8086_1221,
- &pci_dev_info_8086_1222,
- &pci_dev_info_8086_1223,
- &pci_dev_info_8086_1225,
- &pci_dev_info_8086_1226,
- &pci_dev_info_8086_1227,
- &pci_dev_info_8086_1228,
- &pci_dev_info_8086_1229,
- &pci_dev_info_8086_122d,
- &pci_dev_info_8086_122e,
- &pci_dev_info_8086_1230,
- &pci_dev_info_8086_1231,
- &pci_dev_info_8086_1234,
- &pci_dev_info_8086_1235,
- &pci_dev_info_8086_1237,
- &pci_dev_info_8086_1239,
- &pci_dev_info_8086_123b,
- &pci_dev_info_8086_123c,
- &pci_dev_info_8086_123d,
- &pci_dev_info_8086_123f,
- &pci_dev_info_8086_1240,
- &pci_dev_info_8086_124b,
- &pci_dev_info_8086_1250,
- &pci_dev_info_8086_1360,
- &pci_dev_info_8086_1361,
- &pci_dev_info_8086_1460,
- &pci_dev_info_8086_1461,
- &pci_dev_info_8086_1462,
- &pci_dev_info_8086_1960,
- &pci_dev_info_8086_1962,
- &pci_dev_info_8086_1a21,
- &pci_dev_info_8086_1a23,
- &pci_dev_info_8086_1a24,
- &pci_dev_info_8086_1a30,
- &pci_dev_info_8086_1a31,
- &pci_dev_info_8086_2410,
- &pci_dev_info_8086_2411,
- &pci_dev_info_8086_2412,
- &pci_dev_info_8086_2413,
- &pci_dev_info_8086_2415,
- &pci_dev_info_8086_2416,
- &pci_dev_info_8086_2418,
- &pci_dev_info_8086_2420,
- &pci_dev_info_8086_2421,
- &pci_dev_info_8086_2422,
- &pci_dev_info_8086_2423,
- &pci_dev_info_8086_2425,
- &pci_dev_info_8086_2426,
- &pci_dev_info_8086_2428,
- &pci_dev_info_8086_2440,
- &pci_dev_info_8086_2442,
- &pci_dev_info_8086_2443,
- &pci_dev_info_8086_2444,
- &pci_dev_info_8086_2445,
- &pci_dev_info_8086_2446,
- &pci_dev_info_8086_2448,
- &pci_dev_info_8086_2449,
- &pci_dev_info_8086_244a,
- &pci_dev_info_8086_244b,
- &pci_dev_info_8086_244c,
- &pci_dev_info_8086_244e,
- &pci_dev_info_8086_2450,
- &pci_dev_info_8086_2452,
- &pci_dev_info_8086_2453,
- &pci_dev_info_8086_2459,
- &pci_dev_info_8086_245b,
- &pci_dev_info_8086_245d,
- &pci_dev_info_8086_245e,
- &pci_dev_info_8086_2480,
- &pci_dev_info_8086_2482,
- &pci_dev_info_8086_2483,
- &pci_dev_info_8086_2484,
- &pci_dev_info_8086_2485,
- &pci_dev_info_8086_2486,
- &pci_dev_info_8086_2487,
- &pci_dev_info_8086_248a,
- &pci_dev_info_8086_248b,
- &pci_dev_info_8086_248c,
- &pci_dev_info_8086_24c0,
- &pci_dev_info_8086_24c2,
- &pci_dev_info_8086_24c3,
- &pci_dev_info_8086_24c4,
- &pci_dev_info_8086_24c5,
- &pci_dev_info_8086_24c6,
- &pci_dev_info_8086_24c7,
- &pci_dev_info_8086_24ca,
- &pci_dev_info_8086_24cb,
- &pci_dev_info_8086_24cc,
- &pci_dev_info_8086_24cd,
- &pci_dev_info_8086_24d0,
- &pci_dev_info_8086_24d1,
- &pci_dev_info_8086_24d2,
- &pci_dev_info_8086_24d3,
- &pci_dev_info_8086_24d4,
- &pci_dev_info_8086_24d5,
- &pci_dev_info_8086_24d6,
- &pci_dev_info_8086_24d7,
- &pci_dev_info_8086_24db,
- &pci_dev_info_8086_24dc,
- &pci_dev_info_8086_24dd,
- &pci_dev_info_8086_24de,
- &pci_dev_info_8086_2500,
- &pci_dev_info_8086_2501,
- &pci_dev_info_8086_250b,
- &pci_dev_info_8086_250f,
- &pci_dev_info_8086_2520,
- &pci_dev_info_8086_2521,
- &pci_dev_info_8086_2530,
- &pci_dev_info_8086_2531,
- &pci_dev_info_8086_2532,
- &pci_dev_info_8086_2533,
- &pci_dev_info_8086_2534,
- &pci_dev_info_8086_2540,
- &pci_dev_info_8086_2541,
- &pci_dev_info_8086_2543,
- &pci_dev_info_8086_2544,
- &pci_dev_info_8086_2545,
- &pci_dev_info_8086_2546,
- &pci_dev_info_8086_2547,
- &pci_dev_info_8086_2548,
- &pci_dev_info_8086_254c,
- &pci_dev_info_8086_2550,
- &pci_dev_info_8086_2551,
- &pci_dev_info_8086_2552,
- &pci_dev_info_8086_2553,
- &pci_dev_info_8086_2554,
- &pci_dev_info_8086_255d,
- &pci_dev_info_8086_2560,
- &pci_dev_info_8086_2561,
- &pci_dev_info_8086_2562,
- &pci_dev_info_8086_2570,
- &pci_dev_info_8086_2571,
- &pci_dev_info_8086_2572,
- &pci_dev_info_8086_2573,
- &pci_dev_info_8086_2576,
- &pci_dev_info_8086_2578,
- &pci_dev_info_8086_2579,
- &pci_dev_info_8086_257b,
- &pci_dev_info_8086_257e,
- &pci_dev_info_8086_3092,
- &pci_dev_info_8086_3340,
- &pci_dev_info_8086_3341,
- &pci_dev_info_8086_3575,
- &pci_dev_info_8086_3576,
- &pci_dev_info_8086_3577,
- &pci_dev_info_8086_3578,
- &pci_dev_info_8086_3580,
- &pci_dev_info_8086_3582,
- &pci_dev_info_8086_5200,
- &pci_dev_info_8086_5201,
- &pci_dev_info_8086_530d,
- &pci_dev_info_8086_7000,
- &pci_dev_info_8086_7010,
- &pci_dev_info_8086_7020,
- &pci_dev_info_8086_7030,
- &pci_dev_info_8086_7100,
- &pci_dev_info_8086_7110,
- &pci_dev_info_8086_7111,
- &pci_dev_info_8086_7112,
- &pci_dev_info_8086_7113,
- &pci_dev_info_8086_7120,
- &pci_dev_info_8086_7121,
- &pci_dev_info_8086_7122,
- &pci_dev_info_8086_7123,
- &pci_dev_info_8086_7124,
- &pci_dev_info_8086_7125,
- &pci_dev_info_8086_7126,
- &pci_dev_info_8086_7128,
- &pci_dev_info_8086_712a,
- &pci_dev_info_8086_7180,
- &pci_dev_info_8086_7181,
- &pci_dev_info_8086_7190,
- &pci_dev_info_8086_7191,
- &pci_dev_info_8086_7192,
- &pci_dev_info_8086_7194,
- &pci_dev_info_8086_7195,
- &pci_dev_info_8086_7196,
- &pci_dev_info_8086_7198,
- &pci_dev_info_8086_7199,
- &pci_dev_info_8086_719a,
- &pci_dev_info_8086_719b,
- &pci_dev_info_8086_71a0,
- &pci_dev_info_8086_71a1,
- &pci_dev_info_8086_71a2,
- &pci_dev_info_8086_7600,
- &pci_dev_info_8086_7601,
- &pci_dev_info_8086_7602,
- &pci_dev_info_8086_7603,
- &pci_dev_info_8086_7800,
- &pci_dev_info_8086_84c4,
- &pci_dev_info_8086_84c5,
- &pci_dev_info_8086_84ca,
- &pci_dev_info_8086_84cb,
- &pci_dev_info_8086_84e0,
- &pci_dev_info_8086_84e1,
- &pci_dev_info_8086_84e2,
- &pci_dev_info_8086_84e3,
- &pci_dev_info_8086_84e4,
- &pci_dev_info_8086_84e6,
- &pci_dev_info_8086_84ea,
- &pci_dev_info_8086_9621,
- &pci_dev_info_8086_9622,
- &pci_dev_info_8086_9641,
- &pci_dev_info_8086_96a1,
- &pci_dev_info_8086_b152,
- &pci_dev_info_8086_b154,
- &pci_dev_info_8086_b555,
- &pci_dev_info_8086_ffff,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_8800[] = {
- &pci_dev_info_8800_2008,
- NULL
-};
-#endif
-#define pci_dev_list_8866 NULL
-#define pci_dev_list_8888 NULL
-#define pci_dev_list_8e0e NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_8e2e[] = {
- &pci_dev_info_8e2e_3000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_9004[] = {
- &pci_dev_info_9004_1078,
- &pci_dev_info_9004_1160,
- &pci_dev_info_9004_2178,
- &pci_dev_info_9004_3860,
- &pci_dev_info_9004_3b78,
- &pci_dev_info_9004_5075,
- &pci_dev_info_9004_5078,
- &pci_dev_info_9004_5175,
- &pci_dev_info_9004_5178,
- &pci_dev_info_9004_5275,
- &pci_dev_info_9004_5278,
- &pci_dev_info_9004_5375,
- &pci_dev_info_9004_5378,
- &pci_dev_info_9004_5475,
- &pci_dev_info_9004_5478,
- &pci_dev_info_9004_5575,
- &pci_dev_info_9004_5578,
- &pci_dev_info_9004_5675,
- &pci_dev_info_9004_5678,
- &pci_dev_info_9004_5775,
- &pci_dev_info_9004_5778,
- &pci_dev_info_9004_5800,
- &pci_dev_info_9004_5900,
- &pci_dev_info_9004_5905,
- &pci_dev_info_9004_6038,
- &pci_dev_info_9004_6075,
- &pci_dev_info_9004_6078,
- &pci_dev_info_9004_6178,
- &pci_dev_info_9004_6278,
- &pci_dev_info_9004_6378,
- &pci_dev_info_9004_6478,
- &pci_dev_info_9004_6578,
- &pci_dev_info_9004_6678,
- &pci_dev_info_9004_6778,
- &pci_dev_info_9004_6915,
- &pci_dev_info_9004_7078,
- &pci_dev_info_9004_7178,
- &pci_dev_info_9004_7278,
- &pci_dev_info_9004_7378,
- &pci_dev_info_9004_7478,
- &pci_dev_info_9004_7578,
- &pci_dev_info_9004_7678,
- &pci_dev_info_9004_7710,
- &pci_dev_info_9004_7711,
- &pci_dev_info_9004_7778,
- &pci_dev_info_9004_7810,
- &pci_dev_info_9004_7815,
- &pci_dev_info_9004_7850,
- &pci_dev_info_9004_7855,
- &pci_dev_info_9004_7860,
- &pci_dev_info_9004_7870,
- &pci_dev_info_9004_7871,
- &pci_dev_info_9004_7872,
- &pci_dev_info_9004_7873,
- &pci_dev_info_9004_7874,
- &pci_dev_info_9004_7880,
- &pci_dev_info_9004_7890,
- &pci_dev_info_9004_7891,
- &pci_dev_info_9004_7892,
- &pci_dev_info_9004_7893,
- &pci_dev_info_9004_7894,
- &pci_dev_info_9004_7895,
- &pci_dev_info_9004_7896,
- &pci_dev_info_9004_7897,
- &pci_dev_info_9004_8078,
- &pci_dev_info_9004_8178,
- &pci_dev_info_9004_8278,
- &pci_dev_info_9004_8378,
- &pci_dev_info_9004_8478,
- &pci_dev_info_9004_8578,
- &pci_dev_info_9004_8678,
- &pci_dev_info_9004_8778,
- &pci_dev_info_9004_8878,
- &pci_dev_info_9004_8b78,
- &pci_dev_info_9004_ec78,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_9005[] = {
- &pci_dev_info_9005_0010,
- &pci_dev_info_9005_0011,
- &pci_dev_info_9005_0013,
- &pci_dev_info_9005_001f,
- &pci_dev_info_9005_0020,
- &pci_dev_info_9005_002f,
- &pci_dev_info_9005_0030,
- &pci_dev_info_9005_003f,
- &pci_dev_info_9005_0050,
- &pci_dev_info_9005_0051,
- &pci_dev_info_9005_0053,
- &pci_dev_info_9005_005f,
- &pci_dev_info_9005_0080,
- &pci_dev_info_9005_0081,
- &pci_dev_info_9005_0083,
- &pci_dev_info_9005_008f,
- &pci_dev_info_9005_00c0,
- &pci_dev_info_9005_00c1,
- &pci_dev_info_9005_00c3,
- &pci_dev_info_9005_00c5,
- &pci_dev_info_9005_00cf,
- &pci_dev_info_9005_0250,
- &pci_dev_info_9005_0285,
- &pci_dev_info_9005_8000,
- &pci_dev_info_9005_800f,
- &pci_dev_info_9005_8010,
- &pci_dev_info_9005_8011,
- &pci_dev_info_9005_8012,
- &pci_dev_info_9005_8013,
- &pci_dev_info_9005_8014,
- &pci_dev_info_9005_801e,
- &pci_dev_info_9005_801f,
- &pci_dev_info_9005_8080,
- &pci_dev_info_9005_808f,
- &pci_dev_info_9005_8090,
- &pci_dev_info_9005_8091,
- &pci_dev_info_9005_8092,
- &pci_dev_info_9005_8093,
- &pci_dev_info_9005_8094,
- &pci_dev_info_9005_8095,
- &pci_dev_info_9005_8096,
- &pci_dev_info_9005_8097,
- &pci_dev_info_9005_809c,
- &pci_dev_info_9005_809d,
- &pci_dev_info_9005_809e,
- &pci_dev_info_9005_809f,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_907f[] = {
- &pci_dev_info_907f_2015,
- NULL
-};
-#endif
-#define pci_dev_list_919a NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_9412[] = {
- &pci_dev_info_9412_6565,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_9699[] = {
- &pci_dev_info_9699_6565,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_9710[] = {
- &pci_dev_info_9710_9815,
- &pci_dev_info_9710_9835,
- NULL
-};
-#endif
-#define pci_dev_list_a0a0 NULL
-#define pci_dev_list_a0f1 NULL
-#define pci_dev_list_a200 NULL
-#define pci_dev_list_a259 NULL
-#define pci_dev_list_a25b NULL
-#define pci_dev_list_a304 NULL
-#define pci_dev_list_a727 NULL
-#define pci_dev_list_aa42 NULL
-#define pci_dev_list_ac1e NULL
-#define pci_dev_list_b1b3 NULL
-#define pci_dev_list_bd11 NULL
-#define pci_dev_list_c001 NULL
-#define pci_dev_list_c0a9 NULL
-#define pci_dev_list_c0de NULL
-#define pci_dev_list_c0fe NULL
-#define pci_dev_list_ca50 NULL
-#define pci_dev_list_cafe NULL
-#define pci_dev_list_cccc NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_cddd[] = {
- &pci_dev_info_cddd_0101,
- &pci_dev_info_cddd_0200,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_d4d4[] = {
- &pci_dev_info_d4d4_0601,
- NULL
-};
-#endif
-#define pci_dev_list_d531 NULL
-#define pci_dev_list_d84d NULL
-#define pci_dev_list_dead NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_e000[] = {
- &pci_dev_info_e000_e000,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_e159[] = {
- &pci_dev_info_e159_0001,
- &pci_dev_info_e159_0002,
- NULL
-};
-#endif
-#define pci_dev_list_e4bf NULL
-#define pci_dev_list_ea01 NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_ea60[] = {
- &pci_dev_info_ea60_9896,
- &pci_dev_info_ea60_9897,
- &pci_dev_info_ea60_9898,
- NULL
-};
-#endif
-#define pci_dev_list_eabb NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_eace[] = {
- &pci_dev_info_eace_3100,
- &pci_dev_info_eace_3200,
- &pci_dev_info_eace_320e,
- &pci_dev_info_eace_340e,
- &pci_dev_info_eace_341e,
- &pci_dev_info_eace_3500,
- &pci_dev_info_eace_351c,
- &pci_dev_info_eace_4100,
- &pci_dev_info_eace_4110,
- &pci_dev_info_eace_4220,
- &pci_dev_info_eace_422e,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_ec80[] = {
- &pci_dev_info_ec80_ec00,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_ecc0[] = {
- &pci_dev_info_ecc0_0050,
- &pci_dev_info_ecc0_0051,
- &pci_dev_info_ecc0_0060,
- &pci_dev_info_ecc0_0070,
- &pci_dev_info_ecc0_0071,
- &pci_dev_info_ecc0_0072,
- &pci_dev_info_ecc0_0080,
- NULL
-};
-#endif
-static const pciDeviceInfo *pci_dev_list_edd8[] = {
- &pci_dev_info_edd8_a091,
- &pci_dev_info_edd8_a099,
- &pci_dev_info_edd8_a0a1,
- &pci_dev_info_edd8_a0a9,
- NULL
-};
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_f1d0[] = {
- &pci_dev_info_f1d0_cafe,
- &pci_dev_info_f1d0_efac,
- &pci_dev_info_f1d0_facd,
- NULL
-};
-#endif
-#define pci_dev_list_fa57 NULL
-#define pci_dev_list_febd NULL
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_feda[] = {
- &pci_dev_info_feda_a0fa,
- &pci_dev_info_feda_a10e,
- NULL
-};
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
-static const pciDeviceInfo *pci_dev_list_fffe[] = {
- &pci_dev_info_fffe_0710,
- NULL
-};
-#endif
-#define pci_dev_list_ffff NULL
-
-static const pciVendorInfo pciVendorInfoList[] = {
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0000, pci_vendor_0000, pci_dev_list_0000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x001a, pci_vendor_001a, pci_dev_list_001a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0033, pci_vendor_0033, pci_dev_list_0033},
-#endif
- {0x003d, pci_vendor_003d, pci_dev_list_003d},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0059, pci_vendor_0059, pci_dev_list_0059},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0070, pci_vendor_0070, pci_dev_list_0070},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0100, pci_vendor_0100, pci_dev_list_0100},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0675, pci_vendor_0675, pci_dev_list_0675},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0925, pci_vendor_0925, pci_dev_list_0925},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x09c1, pci_vendor_09c1, pci_dev_list_09c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0a89, pci_vendor_0a89, pci_dev_list_0a89},
-#endif
- {0x0e11, pci_vendor_0e11, pci_dev_list_0e11},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0e55, pci_vendor_0e55, pci_dev_list_0e55},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1000, pci_vendor_1000, pci_dev_list_1000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1001, pci_vendor_1001, pci_dev_list_1001},
-#endif
- {0x1002, pci_vendor_1002, pci_dev_list_1002},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1003, pci_vendor_1003, pci_dev_list_1003},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1004, pci_vendor_1004, pci_dev_list_1004},
-#endif
- {0x1005, pci_vendor_1005, pci_dev_list_1005},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1006, pci_vendor_1006, pci_dev_list_1006},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1007, pci_vendor_1007, pci_dev_list_1007},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1008, pci_vendor_1008, pci_dev_list_1008},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x100a, pci_vendor_100a, pci_dev_list_100a},
-#endif
- {0x100b, pci_vendor_100b, pci_dev_list_100b},
- {0x100c, pci_vendor_100c, pci_dev_list_100c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x100d, pci_vendor_100d, pci_dev_list_100d},
-#endif
- {0x100e, pci_vendor_100e, pci_dev_list_100e},
- {0x1010, pci_vendor_1010, pci_dev_list_1010},
- {0x1011, pci_vendor_1011, pci_dev_list_1011},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1012, pci_vendor_1012, pci_dev_list_1012},
-#endif
- {0x1013, pci_vendor_1013, pci_dev_list_1013},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1014, pci_vendor_1014, pci_dev_list_1014},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1015, pci_vendor_1015, pci_dev_list_1015},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1016, pci_vendor_1016, pci_dev_list_1016},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1017, pci_vendor_1017, pci_dev_list_1017},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1018, pci_vendor_1018, pci_dev_list_1018},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1019, pci_vendor_1019, pci_dev_list_1019},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101a, pci_vendor_101a, pci_dev_list_101a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101b, pci_vendor_101b, pci_dev_list_101b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101c, pci_vendor_101c, pci_dev_list_101c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101e, pci_vendor_101e, pci_dev_list_101e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101f, pci_vendor_101f, pci_dev_list_101f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1020, pci_vendor_1020, pci_dev_list_1020},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1021, pci_vendor_1021, pci_dev_list_1021},
-#endif
- {0x1022, pci_vendor_1022, pci_dev_list_1022},
- {0x1023, pci_vendor_1023, pci_dev_list_1023},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1024, pci_vendor_1024, pci_dev_list_1024},
-#endif
- {0x1025, pci_vendor_1025, pci_dev_list_1025},
- {0x1028, pci_vendor_1028, pci_dev_list_1028},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1029, pci_vendor_1029, pci_dev_list_1029},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102a, pci_vendor_102a, pci_dev_list_102a},
-#endif
- {0x102b, pci_vendor_102b, pci_dev_list_102b},
- {0x102c, pci_vendor_102c, pci_dev_list_102c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102d, pci_vendor_102d, pci_dev_list_102d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102e, pci_vendor_102e, pci_dev_list_102e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102f, pci_vendor_102f, pci_dev_list_102f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1030, pci_vendor_1030, pci_dev_list_1030},
-#endif
- {0x1031, pci_vendor_1031, pci_dev_list_1031},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1032, pci_vendor_1032, pci_dev_list_1032},
-#endif
- {0x1033, pci_vendor_1033, pci_dev_list_1033},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1034, pci_vendor_1034, pci_dev_list_1034},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1035, pci_vendor_1035, pci_dev_list_1035},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1036, pci_vendor_1036, pci_dev_list_1036},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1037, pci_vendor_1037, pci_dev_list_1037},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1038, pci_vendor_1038, pci_dev_list_1038},
-#endif
- {0x1039, pci_vendor_1039, pci_dev_list_1039},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103a, pci_vendor_103a, pci_dev_list_103a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103b, pci_vendor_103b, pci_dev_list_103b},
-#endif
- {0x103c, pci_vendor_103c, pci_dev_list_103c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103e, pci_vendor_103e, pci_dev_list_103e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103f, pci_vendor_103f, pci_dev_list_103f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1040, pci_vendor_1040, pci_dev_list_1040},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1041, pci_vendor_1041, pci_dev_list_1041},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1042, pci_vendor_1042, pci_dev_list_1042},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1043, pci_vendor_1043, pci_dev_list_1043},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1044, pci_vendor_1044, pci_dev_list_1044},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1045, pci_vendor_1045, pci_dev_list_1045},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1046, pci_vendor_1046, pci_dev_list_1046},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1047, pci_vendor_1047, pci_dev_list_1047},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1048, pci_vendor_1048, pci_dev_list_1048},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1049, pci_vendor_1049, pci_dev_list_1049},
-#endif
- {0x104a, pci_vendor_104a, pci_dev_list_104a},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x104b, pci_vendor_104b, pci_dev_list_104b},
-#endif
- {0x104c, pci_vendor_104c, pci_dev_list_104c},
- {0x104d, pci_vendor_104d, pci_dev_list_104d},
- {0x104e, pci_vendor_104e, pci_dev_list_104e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x104f, pci_vendor_104f, pci_dev_list_104f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1050, pci_vendor_1050, pci_dev_list_1050},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1051, pci_vendor_1051, pci_dev_list_1051},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1052, pci_vendor_1052, pci_dev_list_1052},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1053, pci_vendor_1053, pci_dev_list_1053},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1054, pci_vendor_1054, pci_dev_list_1054},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1055, pci_vendor_1055, pci_dev_list_1055},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1056, pci_vendor_1056, pci_dev_list_1056},
-#endif
- {0x1057, pci_vendor_1057, pci_dev_list_1057},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1058, pci_vendor_1058, pci_dev_list_1058},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1059, pci_vendor_1059, pci_dev_list_1059},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105a, pci_vendor_105a, pci_dev_list_105a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105b, pci_vendor_105b, pci_dev_list_105b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105c, pci_vendor_105c, pci_dev_list_105c},
-#endif
- {0x105d, pci_vendor_105d, pci_dev_list_105d},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105e, pci_vendor_105e, pci_dev_list_105e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105f, pci_vendor_105f, pci_dev_list_105f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1060, pci_vendor_1060, pci_dev_list_1060},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1061, pci_vendor_1061, pci_dev_list_1061},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1062, pci_vendor_1062, pci_dev_list_1062},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1063, pci_vendor_1063, pci_dev_list_1063},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1064, pci_vendor_1064, pci_dev_list_1064},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1065, pci_vendor_1065, pci_dev_list_1065},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1066, pci_vendor_1066, pci_dev_list_1066},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1067, pci_vendor_1067, pci_dev_list_1067},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1068, pci_vendor_1068, pci_dev_list_1068},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1069, pci_vendor_1069, pci_dev_list_1069},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106a, pci_vendor_106a, pci_dev_list_106a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106b, pci_vendor_106b, pci_dev_list_106b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106c, pci_vendor_106c, pci_dev_list_106c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106d, pci_vendor_106d, pci_dev_list_106d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106e, pci_vendor_106e, pci_dev_list_106e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106f, pci_vendor_106f, pci_dev_list_106f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1070, pci_vendor_1070, pci_dev_list_1070},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1071, pci_vendor_1071, pci_dev_list_1071},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1072, pci_vendor_1072, pci_dev_list_1072},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1073, pci_vendor_1073, pci_dev_list_1073},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1074, pci_vendor_1074, pci_dev_list_1074},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1075, pci_vendor_1075, pci_dev_list_1075},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1076, pci_vendor_1076, pci_dev_list_1076},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1077, pci_vendor_1077, pci_dev_list_1077},
-#endif
- {0x1078, pci_vendor_1078, pci_dev_list_1078},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1079, pci_vendor_1079, pci_dev_list_1079},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107a, pci_vendor_107a, pci_dev_list_107a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107b, pci_vendor_107b, pci_dev_list_107b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107c, pci_vendor_107c, pci_dev_list_107c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107d, pci_vendor_107d, pci_dev_list_107d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107e, pci_vendor_107e, pci_dev_list_107e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107f, pci_vendor_107f, pci_dev_list_107f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1080, pci_vendor_1080, pci_dev_list_1080},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1081, pci_vendor_1081, pci_dev_list_1081},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1082, pci_vendor_1082, pci_dev_list_1082},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1083, pci_vendor_1083, pci_dev_list_1083},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1084, pci_vendor_1084, pci_dev_list_1084},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1085, pci_vendor_1085, pci_dev_list_1085},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1086, pci_vendor_1086, pci_dev_list_1086},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1087, pci_vendor_1087, pci_dev_list_1087},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1088, pci_vendor_1088, pci_dev_list_1088},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1089, pci_vendor_1089, pci_dev_list_1089},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108a, pci_vendor_108a, pci_dev_list_108a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108c, pci_vendor_108c, pci_dev_list_108c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108d, pci_vendor_108d, pci_dev_list_108d},
-#endif
- {0x108e, pci_vendor_108e, pci_dev_list_108e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108f, pci_vendor_108f, pci_dev_list_108f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1090, pci_vendor_1090, pci_dev_list_1090},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1091, pci_vendor_1091, pci_dev_list_1091},
-#endif
- {0x1092, pci_vendor_1092, pci_dev_list_1092},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1093, pci_vendor_1093, pci_dev_list_1093},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1094, pci_vendor_1094, pci_dev_list_1094},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1095, pci_vendor_1095, pci_dev_list_1095},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1096, pci_vendor_1096, pci_dev_list_1096},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1097, pci_vendor_1097, pci_dev_list_1097},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1098, pci_vendor_1098, pci_dev_list_1098},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1099, pci_vendor_1099, pci_dev_list_1099},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109a, pci_vendor_109a, pci_dev_list_109a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109b, pci_vendor_109b, pci_dev_list_109b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109c, pci_vendor_109c, pci_dev_list_109c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109d, pci_vendor_109d, pci_dev_list_109d},
-#endif
- {0x109e, pci_vendor_109e, pci_dev_list_109e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109f, pci_vendor_109f, pci_dev_list_109f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a0, pci_vendor_10a0, pci_dev_list_10a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a1, pci_vendor_10a1, pci_dev_list_10a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a2, pci_vendor_10a2, pci_dev_list_10a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a3, pci_vendor_10a3, pci_dev_list_10a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a4, pci_vendor_10a4, pci_dev_list_10a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a5, pci_vendor_10a5, pci_dev_list_10a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a6, pci_vendor_10a6, pci_dev_list_10a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a7, pci_vendor_10a7, pci_dev_list_10a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a8, pci_vendor_10a8, pci_dev_list_10a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a9, pci_vendor_10a9, pci_dev_list_10a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10aa, pci_vendor_10aa, pci_dev_list_10aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ab, pci_vendor_10ab, pci_dev_list_10ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ac, pci_vendor_10ac, pci_dev_list_10ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ad, pci_vendor_10ad, pci_dev_list_10ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ae, pci_vendor_10ae, pci_dev_list_10ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10af, pci_vendor_10af, pci_dev_list_10af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b0, pci_vendor_10b0, pci_dev_list_10b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b1, pci_vendor_10b1, pci_dev_list_10b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b2, pci_vendor_10b2, pci_dev_list_10b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b3, pci_vendor_10b3, pci_dev_list_10b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b4, pci_vendor_10b4, pci_dev_list_10b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b5, pci_vendor_10b5, pci_dev_list_10b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b6, pci_vendor_10b6, pci_dev_list_10b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b7, pci_vendor_10b7, pci_dev_list_10b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b8, pci_vendor_10b8, pci_dev_list_10b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b9, pci_vendor_10b9, pci_dev_list_10b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ba, pci_vendor_10ba, pci_dev_list_10ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bb, pci_vendor_10bb, pci_dev_list_10bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bc, pci_vendor_10bc, pci_dev_list_10bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bd, pci_vendor_10bd, pci_dev_list_10bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10be, pci_vendor_10be, pci_dev_list_10be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bf, pci_vendor_10bf, pci_dev_list_10bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c0, pci_vendor_10c0, pci_dev_list_10c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c1, pci_vendor_10c1, pci_dev_list_10c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c2, pci_vendor_10c2, pci_dev_list_10c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c3, pci_vendor_10c3, pci_dev_list_10c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c4, pci_vendor_10c4, pci_dev_list_10c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c5, pci_vendor_10c5, pci_dev_list_10c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c6, pci_vendor_10c6, pci_dev_list_10c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c7, pci_vendor_10c7, pci_dev_list_10c7},
-#endif
- {0x10c8, pci_vendor_10c8, pci_dev_list_10c8},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c9, pci_vendor_10c9, pci_dev_list_10c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ca, pci_vendor_10ca, pci_dev_list_10ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cb, pci_vendor_10cb, pci_dev_list_10cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cc, pci_vendor_10cc, pci_dev_list_10cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cd, pci_vendor_10cd, pci_dev_list_10cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ce, pci_vendor_10ce, pci_dev_list_10ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cf, pci_vendor_10cf, pci_dev_list_10cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d0, pci_vendor_10d0, pci_dev_list_10d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d1, pci_vendor_10d1, pci_dev_list_10d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d2, pci_vendor_10d2, pci_dev_list_10d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d3, pci_vendor_10d3, pci_dev_list_10d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d4, pci_vendor_10d4, pci_dev_list_10d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d5, pci_vendor_10d5, pci_dev_list_10d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d6, pci_vendor_10d6, pci_dev_list_10d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d7, pci_vendor_10d7, pci_dev_list_10d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d8, pci_vendor_10d8, pci_dev_list_10d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d9, pci_vendor_10d9, pci_dev_list_10d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10da, pci_vendor_10da, pci_dev_list_10da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10db, pci_vendor_10db, pci_dev_list_10db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10dc, pci_vendor_10dc, pci_dev_list_10dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10dd, pci_vendor_10dd, pci_dev_list_10dd},
-#endif
- {0x10de, pci_vendor_10de, pci_dev_list_10de},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10df, pci_vendor_10df, pci_dev_list_10df},
-#endif
- {0x10e0, pci_vendor_10e0, pci_dev_list_10e0},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e1, pci_vendor_10e1, pci_dev_list_10e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e2, pci_vendor_10e2, pci_dev_list_10e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e3, pci_vendor_10e3, pci_dev_list_10e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e4, pci_vendor_10e4, pci_dev_list_10e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e5, pci_vendor_10e5, pci_dev_list_10e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e6, pci_vendor_10e6, pci_dev_list_10e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e7, pci_vendor_10e7, pci_dev_list_10e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e8, pci_vendor_10e8, pci_dev_list_10e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e9, pci_vendor_10e9, pci_dev_list_10e9},
-#endif
- {0x10ea, pci_vendor_10ea, pci_dev_list_10ea},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10eb, pci_vendor_10eb, pci_dev_list_10eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ec, pci_vendor_10ec, pci_dev_list_10ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ed, pci_vendor_10ed, pci_dev_list_10ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ee, pci_vendor_10ee, pci_dev_list_10ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ef, pci_vendor_10ef, pci_dev_list_10ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f0, pci_vendor_10f0, pci_dev_list_10f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f1, pci_vendor_10f1, pci_dev_list_10f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f2, pci_vendor_10f2, pci_dev_list_10f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f3, pci_vendor_10f3, pci_dev_list_10f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f4, pci_vendor_10f4, pci_dev_list_10f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f5, pci_vendor_10f5, pci_dev_list_10f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f6, pci_vendor_10f6, pci_dev_list_10f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f7, pci_vendor_10f7, pci_dev_list_10f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f8, pci_vendor_10f8, pci_dev_list_10f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f9, pci_vendor_10f9, pci_dev_list_10f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fa, pci_vendor_10fa, pci_dev_list_10fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fb, pci_vendor_10fb, pci_dev_list_10fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fc, pci_vendor_10fc, pci_dev_list_10fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fd, pci_vendor_10fd, pci_dev_list_10fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fe, pci_vendor_10fe, pci_dev_list_10fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ff, pci_vendor_10ff, pci_dev_list_10ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1100, pci_vendor_1100, pci_dev_list_1100},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1101, pci_vendor_1101, pci_dev_list_1101},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1102, pci_vendor_1102, pci_dev_list_1102},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1103, pci_vendor_1103, pci_dev_list_1103},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1104, pci_vendor_1104, pci_dev_list_1104},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1105, pci_vendor_1105, pci_dev_list_1105},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1106, pci_vendor_1106, pci_dev_list_1106},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1107, pci_vendor_1107, pci_dev_list_1107},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1108, pci_vendor_1108, pci_dev_list_1108},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1109, pci_vendor_1109, pci_dev_list_1109},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110a, pci_vendor_110a, pci_dev_list_110a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110b, pci_vendor_110b, pci_dev_list_110b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110c, pci_vendor_110c, pci_dev_list_110c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110d, pci_vendor_110d, pci_dev_list_110d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110e, pci_vendor_110e, pci_dev_list_110e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110f, pci_vendor_110f, pci_dev_list_110f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1110, pci_vendor_1110, pci_dev_list_1110},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1111, pci_vendor_1111, pci_dev_list_1111},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1112, pci_vendor_1112, pci_dev_list_1112},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1113, pci_vendor_1113, pci_dev_list_1113},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1114, pci_vendor_1114, pci_dev_list_1114},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1115, pci_vendor_1115, pci_dev_list_1115},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1116, pci_vendor_1116, pci_dev_list_1116},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1117, pci_vendor_1117, pci_dev_list_1117},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1118, pci_vendor_1118, pci_dev_list_1118},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1119, pci_vendor_1119, pci_dev_list_1119},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111a, pci_vendor_111a, pci_dev_list_111a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111b, pci_vendor_111b, pci_dev_list_111b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111c, pci_vendor_111c, pci_dev_list_111c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111d, pci_vendor_111d, pci_dev_list_111d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111e, pci_vendor_111e, pci_dev_list_111e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111f, pci_vendor_111f, pci_dev_list_111f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1120, pci_vendor_1120, pci_dev_list_1120},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1121, pci_vendor_1121, pci_dev_list_1121},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1122, pci_vendor_1122, pci_dev_list_1122},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1123, pci_vendor_1123, pci_dev_list_1123},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1124, pci_vendor_1124, pci_dev_list_1124},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1125, pci_vendor_1125, pci_dev_list_1125},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1126, pci_vendor_1126, pci_dev_list_1126},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1127, pci_vendor_1127, pci_dev_list_1127},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1129, pci_vendor_1129, pci_dev_list_1129},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112a, pci_vendor_112a, pci_dev_list_112a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112b, pci_vendor_112b, pci_dev_list_112b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112c, pci_vendor_112c, pci_dev_list_112c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112d, pci_vendor_112d, pci_dev_list_112d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112e, pci_vendor_112e, pci_dev_list_112e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112f, pci_vendor_112f, pci_dev_list_112f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1130, pci_vendor_1130, pci_dev_list_1130},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1131, pci_vendor_1131, pci_dev_list_1131},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1132, pci_vendor_1132, pci_dev_list_1132},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1133, pci_vendor_1133, pci_dev_list_1133},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1134, pci_vendor_1134, pci_dev_list_1134},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1135, pci_vendor_1135, pci_dev_list_1135},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1136, pci_vendor_1136, pci_dev_list_1136},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1137, pci_vendor_1137, pci_dev_list_1137},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1138, pci_vendor_1138, pci_dev_list_1138},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1139, pci_vendor_1139, pci_dev_list_1139},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113a, pci_vendor_113a, pci_dev_list_113a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113b, pci_vendor_113b, pci_dev_list_113b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113c, pci_vendor_113c, pci_dev_list_113c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113d, pci_vendor_113d, pci_dev_list_113d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113e, pci_vendor_113e, pci_dev_list_113e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113f, pci_vendor_113f, pci_dev_list_113f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1140, pci_vendor_1140, pci_dev_list_1140},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1141, pci_vendor_1141, pci_dev_list_1141},
-#endif
- {0x1142, pci_vendor_1142, pci_dev_list_1142},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1143, pci_vendor_1143, pci_dev_list_1143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1144, pci_vendor_1144, pci_dev_list_1144},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1145, pci_vendor_1145, pci_dev_list_1145},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1146, pci_vendor_1146, pci_dev_list_1146},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1147, pci_vendor_1147, pci_dev_list_1147},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1148, pci_vendor_1148, pci_dev_list_1148},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1149, pci_vendor_1149, pci_dev_list_1149},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114a, pci_vendor_114a, pci_dev_list_114a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114b, pci_vendor_114b, pci_dev_list_114b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114c, pci_vendor_114c, pci_dev_list_114c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114d, pci_vendor_114d, pci_dev_list_114d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114e, pci_vendor_114e, pci_dev_list_114e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114f, pci_vendor_114f, pci_dev_list_114f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1150, pci_vendor_1150, pci_dev_list_1150},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1151, pci_vendor_1151, pci_dev_list_1151},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1152, pci_vendor_1152, pci_dev_list_1152},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1153, pci_vendor_1153, pci_dev_list_1153},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1154, pci_vendor_1154, pci_dev_list_1154},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1155, pci_vendor_1155, pci_dev_list_1155},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1156, pci_vendor_1156, pci_dev_list_1156},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1157, pci_vendor_1157, pci_dev_list_1157},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1158, pci_vendor_1158, pci_dev_list_1158},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1159, pci_vendor_1159, pci_dev_list_1159},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115a, pci_vendor_115a, pci_dev_list_115a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115b, pci_vendor_115b, pci_dev_list_115b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115c, pci_vendor_115c, pci_dev_list_115c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115d, pci_vendor_115d, pci_dev_list_115d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115e, pci_vendor_115e, pci_dev_list_115e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115f, pci_vendor_115f, pci_dev_list_115f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1160, pci_vendor_1160, pci_dev_list_1160},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1161, pci_vendor_1161, pci_dev_list_1161},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1162, pci_vendor_1162, pci_dev_list_1162},
-#endif
- {0x1163, pci_vendor_1163, pci_dev_list_1163},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1164, pci_vendor_1164, pci_dev_list_1164},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1165, pci_vendor_1165, pci_dev_list_1165},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1166, pci_vendor_1166, pci_dev_list_1166},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1167, pci_vendor_1167, pci_dev_list_1167},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1168, pci_vendor_1168, pci_dev_list_1168},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1169, pci_vendor_1169, pci_dev_list_1169},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116a, pci_vendor_116a, pci_dev_list_116a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116b, pci_vendor_116b, pci_dev_list_116b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116c, pci_vendor_116c, pci_dev_list_116c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116d, pci_vendor_116d, pci_dev_list_116d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116e, pci_vendor_116e, pci_dev_list_116e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116f, pci_vendor_116f, pci_dev_list_116f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1170, pci_vendor_1170, pci_dev_list_1170},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1171, pci_vendor_1171, pci_dev_list_1171},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1172, pci_vendor_1172, pci_dev_list_1172},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1173, pci_vendor_1173, pci_dev_list_1173},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1174, pci_vendor_1174, pci_dev_list_1174},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1175, pci_vendor_1175, pci_dev_list_1175},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1176, pci_vendor_1176, pci_dev_list_1176},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1177, pci_vendor_1177, pci_dev_list_1177},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1178, pci_vendor_1178, pci_dev_list_1178},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1179, pci_vendor_1179, pci_dev_list_1179},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117a, pci_vendor_117a, pci_dev_list_117a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117b, pci_vendor_117b, pci_dev_list_117b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117c, pci_vendor_117c, pci_dev_list_117c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117d, pci_vendor_117d, pci_dev_list_117d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117e, pci_vendor_117e, pci_dev_list_117e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117f, pci_vendor_117f, pci_dev_list_117f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1180, pci_vendor_1180, pci_dev_list_1180},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1181, pci_vendor_1181, pci_dev_list_1181},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1183, pci_vendor_1183, pci_dev_list_1183},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1184, pci_vendor_1184, pci_dev_list_1184},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1185, pci_vendor_1185, pci_dev_list_1185},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1186, pci_vendor_1186, pci_dev_list_1186},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1187, pci_vendor_1187, pci_dev_list_1187},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1188, pci_vendor_1188, pci_dev_list_1188},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1189, pci_vendor_1189, pci_dev_list_1189},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118a, pci_vendor_118a, pci_dev_list_118a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118b, pci_vendor_118b, pci_dev_list_118b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118c, pci_vendor_118c, pci_dev_list_118c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118d, pci_vendor_118d, pci_dev_list_118d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118e, pci_vendor_118e, pci_dev_list_118e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118f, pci_vendor_118f, pci_dev_list_118f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1190, pci_vendor_1190, pci_dev_list_1190},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1191, pci_vendor_1191, pci_dev_list_1191},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1192, pci_vendor_1192, pci_dev_list_1192},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1193, pci_vendor_1193, pci_dev_list_1193},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1194, pci_vendor_1194, pci_dev_list_1194},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1195, pci_vendor_1195, pci_dev_list_1195},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1196, pci_vendor_1196, pci_dev_list_1196},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1197, pci_vendor_1197, pci_dev_list_1197},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1198, pci_vendor_1198, pci_dev_list_1198},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1199, pci_vendor_1199, pci_dev_list_1199},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119a, pci_vendor_119a, pci_dev_list_119a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119b, pci_vendor_119b, pci_dev_list_119b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119c, pci_vendor_119c, pci_dev_list_119c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119d, pci_vendor_119d, pci_dev_list_119d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119e, pci_vendor_119e, pci_dev_list_119e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119f, pci_vendor_119f, pci_dev_list_119f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a0, pci_vendor_11a0, pci_dev_list_11a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a1, pci_vendor_11a1, pci_dev_list_11a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a2, pci_vendor_11a2, pci_dev_list_11a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a3, pci_vendor_11a3, pci_dev_list_11a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a4, pci_vendor_11a4, pci_dev_list_11a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a5, pci_vendor_11a5, pci_dev_list_11a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a6, pci_vendor_11a6, pci_dev_list_11a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a7, pci_vendor_11a7, pci_dev_list_11a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a8, pci_vendor_11a8, pci_dev_list_11a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a9, pci_vendor_11a9, pci_dev_list_11a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11aa, pci_vendor_11aa, pci_dev_list_11aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ab, pci_vendor_11ab, pci_dev_list_11ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ac, pci_vendor_11ac, pci_dev_list_11ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ad, pci_vendor_11ad, pci_dev_list_11ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ae, pci_vendor_11ae, pci_dev_list_11ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11af, pci_vendor_11af, pci_dev_list_11af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b0, pci_vendor_11b0, pci_dev_list_11b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b1, pci_vendor_11b1, pci_dev_list_11b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b2, pci_vendor_11b2, pci_dev_list_11b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b3, pci_vendor_11b3, pci_dev_list_11b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b4, pci_vendor_11b4, pci_dev_list_11b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b5, pci_vendor_11b5, pci_dev_list_11b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b6, pci_vendor_11b6, pci_dev_list_11b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b7, pci_vendor_11b7, pci_dev_list_11b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b8, pci_vendor_11b8, pci_dev_list_11b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b9, pci_vendor_11b9, pci_dev_list_11b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ba, pci_vendor_11ba, pci_dev_list_11ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bb, pci_vendor_11bb, pci_dev_list_11bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bc, pci_vendor_11bc, pci_dev_list_11bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bd, pci_vendor_11bd, pci_dev_list_11bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11be, pci_vendor_11be, pci_dev_list_11be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bf, pci_vendor_11bf, pci_dev_list_11bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c0, pci_vendor_11c0, pci_dev_list_11c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c1, pci_vendor_11c1, pci_dev_list_11c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c2, pci_vendor_11c2, pci_dev_list_11c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c3, pci_vendor_11c3, pci_dev_list_11c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c4, pci_vendor_11c4, pci_dev_list_11c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c5, pci_vendor_11c5, pci_dev_list_11c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c6, pci_vendor_11c6, pci_dev_list_11c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c7, pci_vendor_11c7, pci_dev_list_11c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c8, pci_vendor_11c8, pci_dev_list_11c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c9, pci_vendor_11c9, pci_dev_list_11c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ca, pci_vendor_11ca, pci_dev_list_11ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cb, pci_vendor_11cb, pci_dev_list_11cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cc, pci_vendor_11cc, pci_dev_list_11cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cd, pci_vendor_11cd, pci_dev_list_11cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ce, pci_vendor_11ce, pci_dev_list_11ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cf, pci_vendor_11cf, pci_dev_list_11cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d0, pci_vendor_11d0, pci_dev_list_11d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d1, pci_vendor_11d1, pci_dev_list_11d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d2, pci_vendor_11d2, pci_dev_list_11d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d3, pci_vendor_11d3, pci_dev_list_11d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d4, pci_vendor_11d4, pci_dev_list_11d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d5, pci_vendor_11d5, pci_dev_list_11d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d6, pci_vendor_11d6, pci_dev_list_11d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d7, pci_vendor_11d7, pci_dev_list_11d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d8, pci_vendor_11d8, pci_dev_list_11d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d9, pci_vendor_11d9, pci_dev_list_11d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11da, pci_vendor_11da, pci_dev_list_11da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11db, pci_vendor_11db, pci_dev_list_11db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11dc, pci_vendor_11dc, pci_dev_list_11dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11dd, pci_vendor_11dd, pci_dev_list_11dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11de, pci_vendor_11de, pci_dev_list_11de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11df, pci_vendor_11df, pci_dev_list_11df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e0, pci_vendor_11e0, pci_dev_list_11e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e1, pci_vendor_11e1, pci_dev_list_11e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e2, pci_vendor_11e2, pci_dev_list_11e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e3, pci_vendor_11e3, pci_dev_list_11e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e4, pci_vendor_11e4, pci_dev_list_11e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e5, pci_vendor_11e5, pci_dev_list_11e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e6, pci_vendor_11e6, pci_dev_list_11e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e7, pci_vendor_11e7, pci_dev_list_11e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e8, pci_vendor_11e8, pci_dev_list_11e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e9, pci_vendor_11e9, pci_dev_list_11e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ea, pci_vendor_11ea, pci_dev_list_11ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11eb, pci_vendor_11eb, pci_dev_list_11eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ec, pci_vendor_11ec, pci_dev_list_11ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ed, pci_vendor_11ed, pci_dev_list_11ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ee, pci_vendor_11ee, pci_dev_list_11ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ef, pci_vendor_11ef, pci_dev_list_11ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f0, pci_vendor_11f0, pci_dev_list_11f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f1, pci_vendor_11f1, pci_dev_list_11f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f2, pci_vendor_11f2, pci_dev_list_11f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f3, pci_vendor_11f3, pci_dev_list_11f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f4, pci_vendor_11f4, pci_dev_list_11f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f5, pci_vendor_11f5, pci_dev_list_11f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f6, pci_vendor_11f6, pci_dev_list_11f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f7, pci_vendor_11f7, pci_dev_list_11f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f8, pci_vendor_11f8, pci_dev_list_11f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f9, pci_vendor_11f9, pci_dev_list_11f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fa, pci_vendor_11fa, pci_dev_list_11fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fb, pci_vendor_11fb, pci_dev_list_11fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fc, pci_vendor_11fc, pci_dev_list_11fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fd, pci_vendor_11fd, pci_dev_list_11fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fe, pci_vendor_11fe, pci_dev_list_11fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ff, pci_vendor_11ff, pci_dev_list_11ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1200, pci_vendor_1200, pci_dev_list_1200},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1201, pci_vendor_1201, pci_dev_list_1201},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1202, pci_vendor_1202, pci_dev_list_1202},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1203, pci_vendor_1203, pci_dev_list_1203},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1204, pci_vendor_1204, pci_dev_list_1204},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1205, pci_vendor_1205, pci_dev_list_1205},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1206, pci_vendor_1206, pci_dev_list_1206},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1208, pci_vendor_1208, pci_dev_list_1208},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1209, pci_vendor_1209, pci_dev_list_1209},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120a, pci_vendor_120a, pci_dev_list_120a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120b, pci_vendor_120b, pci_dev_list_120b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120c, pci_vendor_120c, pci_dev_list_120c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120d, pci_vendor_120d, pci_dev_list_120d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120e, pci_vendor_120e, pci_dev_list_120e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120f, pci_vendor_120f, pci_dev_list_120f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1210, pci_vendor_1210, pci_dev_list_1210},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1211, pci_vendor_1211, pci_dev_list_1211},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1212, pci_vendor_1212, pci_dev_list_1212},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1213, pci_vendor_1213, pci_dev_list_1213},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1214, pci_vendor_1214, pci_dev_list_1214},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1215, pci_vendor_1215, pci_dev_list_1215},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1216, pci_vendor_1216, pci_dev_list_1216},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1217, pci_vendor_1217, pci_dev_list_1217},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1218, pci_vendor_1218, pci_dev_list_1218},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1219, pci_vendor_1219, pci_dev_list_1219},
-#endif
- {0x121a, pci_vendor_121a, pci_dev_list_121a},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121b, pci_vendor_121b, pci_dev_list_121b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121c, pci_vendor_121c, pci_dev_list_121c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121d, pci_vendor_121d, pci_dev_list_121d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121e, pci_vendor_121e, pci_dev_list_121e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121f, pci_vendor_121f, pci_dev_list_121f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1220, pci_vendor_1220, pci_dev_list_1220},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1221, pci_vendor_1221, pci_dev_list_1221},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1222, pci_vendor_1222, pci_dev_list_1222},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1223, pci_vendor_1223, pci_dev_list_1223},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1224, pci_vendor_1224, pci_dev_list_1224},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1225, pci_vendor_1225, pci_dev_list_1225},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1227, pci_vendor_1227, pci_dev_list_1227},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1228, pci_vendor_1228, pci_dev_list_1228},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1229, pci_vendor_1229, pci_dev_list_1229},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122a, pci_vendor_122a, pci_dev_list_122a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122b, pci_vendor_122b, pci_dev_list_122b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122c, pci_vendor_122c, pci_dev_list_122c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122d, pci_vendor_122d, pci_dev_list_122d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122e, pci_vendor_122e, pci_dev_list_122e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122f, pci_vendor_122f, pci_dev_list_122f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1230, pci_vendor_1230, pci_dev_list_1230},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1231, pci_vendor_1231, pci_dev_list_1231},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1232, pci_vendor_1232, pci_dev_list_1232},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1233, pci_vendor_1233, pci_dev_list_1233},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1234, pci_vendor_1234, pci_dev_list_1234},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1235, pci_vendor_1235, pci_dev_list_1235},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1236, pci_vendor_1236, pci_dev_list_1236},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1237, pci_vendor_1237, pci_dev_list_1237},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1238, pci_vendor_1238, pci_dev_list_1238},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1239, pci_vendor_1239, pci_dev_list_1239},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123a, pci_vendor_123a, pci_dev_list_123a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123b, pci_vendor_123b, pci_dev_list_123b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123c, pci_vendor_123c, pci_dev_list_123c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123d, pci_vendor_123d, pci_dev_list_123d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123e, pci_vendor_123e, pci_dev_list_123e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123f, pci_vendor_123f, pci_dev_list_123f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1240, pci_vendor_1240, pci_dev_list_1240},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1241, pci_vendor_1241, pci_dev_list_1241},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1242, pci_vendor_1242, pci_dev_list_1242},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1243, pci_vendor_1243, pci_dev_list_1243},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1244, pci_vendor_1244, pci_dev_list_1244},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1245, pci_vendor_1245, pci_dev_list_1245},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1246, pci_vendor_1246, pci_dev_list_1246},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1247, pci_vendor_1247, pci_dev_list_1247},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1248, pci_vendor_1248, pci_dev_list_1248},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1249, pci_vendor_1249, pci_dev_list_1249},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124a, pci_vendor_124a, pci_dev_list_124a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124b, pci_vendor_124b, pci_dev_list_124b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124c, pci_vendor_124c, pci_dev_list_124c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124d, pci_vendor_124d, pci_dev_list_124d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124e, pci_vendor_124e, pci_dev_list_124e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124f, pci_vendor_124f, pci_dev_list_124f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1250, pci_vendor_1250, pci_dev_list_1250},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1251, pci_vendor_1251, pci_dev_list_1251},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1253, pci_vendor_1253, pci_dev_list_1253},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1254, pci_vendor_1254, pci_dev_list_1254},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1255, pci_vendor_1255, pci_dev_list_1255},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1256, pci_vendor_1256, pci_dev_list_1256},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1257, pci_vendor_1257, pci_dev_list_1257},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1258, pci_vendor_1258, pci_dev_list_1258},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1259, pci_vendor_1259, pci_dev_list_1259},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125a, pci_vendor_125a, pci_dev_list_125a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125b, pci_vendor_125b, pci_dev_list_125b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125c, pci_vendor_125c, pci_dev_list_125c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125d, pci_vendor_125d, pci_dev_list_125d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125e, pci_vendor_125e, pci_dev_list_125e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125f, pci_vendor_125f, pci_dev_list_125f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1260, pci_vendor_1260, pci_dev_list_1260},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1261, pci_vendor_1261, pci_dev_list_1261},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1262, pci_vendor_1262, pci_dev_list_1262},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1263, pci_vendor_1263, pci_dev_list_1263},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1264, pci_vendor_1264, pci_dev_list_1264},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1265, pci_vendor_1265, pci_dev_list_1265},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1266, pci_vendor_1266, pci_dev_list_1266},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1267, pci_vendor_1267, pci_dev_list_1267},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1268, pci_vendor_1268, pci_dev_list_1268},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1269, pci_vendor_1269, pci_dev_list_1269},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126a, pci_vendor_126a, pci_dev_list_126a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126b, pci_vendor_126b, pci_dev_list_126b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126c, pci_vendor_126c, pci_dev_list_126c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126d, pci_vendor_126d, pci_dev_list_126d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126e, pci_vendor_126e, pci_dev_list_126e},
-#endif
- {0x126f, pci_vendor_126f, pci_dev_list_126f},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1270, pci_vendor_1270, pci_dev_list_1270},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1271, pci_vendor_1271, pci_dev_list_1271},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1272, pci_vendor_1272, pci_dev_list_1272},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1273, pci_vendor_1273, pci_dev_list_1273},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1274, pci_vendor_1274, pci_dev_list_1274},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1275, pci_vendor_1275, pci_dev_list_1275},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1276, pci_vendor_1276, pci_dev_list_1276},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1277, pci_vendor_1277, pci_dev_list_1277},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1278, pci_vendor_1278, pci_dev_list_1278},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1279, pci_vendor_1279, pci_dev_list_1279},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127a, pci_vendor_127a, pci_dev_list_127a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127b, pci_vendor_127b, pci_dev_list_127b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127c, pci_vendor_127c, pci_dev_list_127c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127d, pci_vendor_127d, pci_dev_list_127d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127e, pci_vendor_127e, pci_dev_list_127e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127f, pci_vendor_127f, pci_dev_list_127f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1280, pci_vendor_1280, pci_dev_list_1280},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1281, pci_vendor_1281, pci_dev_list_1281},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1282, pci_vendor_1282, pci_dev_list_1282},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1283, pci_vendor_1283, pci_dev_list_1283},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1284, pci_vendor_1284, pci_dev_list_1284},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1285, pci_vendor_1285, pci_dev_list_1285},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1286, pci_vendor_1286, pci_dev_list_1286},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1287, pci_vendor_1287, pci_dev_list_1287},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1288, pci_vendor_1288, pci_dev_list_1288},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1289, pci_vendor_1289, pci_dev_list_1289},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128a, pci_vendor_128a, pci_dev_list_128a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128b, pci_vendor_128b, pci_dev_list_128b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128c, pci_vendor_128c, pci_dev_list_128c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128d, pci_vendor_128d, pci_dev_list_128d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128e, pci_vendor_128e, pci_dev_list_128e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128f, pci_vendor_128f, pci_dev_list_128f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1290, pci_vendor_1290, pci_dev_list_1290},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1291, pci_vendor_1291, pci_dev_list_1291},
-#endif
- {0x1292, pci_vendor_1292, pci_dev_list_1292},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1293, pci_vendor_1293, pci_dev_list_1293},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1294, pci_vendor_1294, pci_dev_list_1294},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1295, pci_vendor_1295, pci_dev_list_1295},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1296, pci_vendor_1296, pci_dev_list_1296},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1297, pci_vendor_1297, pci_dev_list_1297},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1298, pci_vendor_1298, pci_dev_list_1298},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1299, pci_vendor_1299, pci_dev_list_1299},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129a, pci_vendor_129a, pci_dev_list_129a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129b, pci_vendor_129b, pci_dev_list_129b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129c, pci_vendor_129c, pci_dev_list_129c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129d, pci_vendor_129d, pci_dev_list_129d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129e, pci_vendor_129e, pci_dev_list_129e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129f, pci_vendor_129f, pci_dev_list_129f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a0, pci_vendor_12a0, pci_dev_list_12a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a1, pci_vendor_12a1, pci_dev_list_12a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a2, pci_vendor_12a2, pci_dev_list_12a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a3, pci_vendor_12a3, pci_dev_list_12a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a4, pci_vendor_12a4, pci_dev_list_12a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a5, pci_vendor_12a5, pci_dev_list_12a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a6, pci_vendor_12a6, pci_dev_list_12a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a7, pci_vendor_12a7, pci_dev_list_12a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a8, pci_vendor_12a8, pci_dev_list_12a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a9, pci_vendor_12a9, pci_dev_list_12a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12aa, pci_vendor_12aa, pci_dev_list_12aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ab, pci_vendor_12ab, pci_dev_list_12ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ac, pci_vendor_12ac, pci_dev_list_12ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ad, pci_vendor_12ad, pci_dev_list_12ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ae, pci_vendor_12ae, pci_dev_list_12ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12af, pci_vendor_12af, pci_dev_list_12af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b0, pci_vendor_12b0, pci_dev_list_12b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b1, pci_vendor_12b1, pci_dev_list_12b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b2, pci_vendor_12b2, pci_dev_list_12b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b3, pci_vendor_12b3, pci_dev_list_12b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b4, pci_vendor_12b4, pci_dev_list_12b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b5, pci_vendor_12b5, pci_dev_list_12b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b6, pci_vendor_12b6, pci_dev_list_12b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b7, pci_vendor_12b7, pci_dev_list_12b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b8, pci_vendor_12b8, pci_dev_list_12b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b9, pci_vendor_12b9, pci_dev_list_12b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ba, pci_vendor_12ba, pci_dev_list_12ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bb, pci_vendor_12bb, pci_dev_list_12bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bc, pci_vendor_12bc, pci_dev_list_12bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bd, pci_vendor_12bd, pci_dev_list_12bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12be, pci_vendor_12be, pci_dev_list_12be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bf, pci_vendor_12bf, pci_dev_list_12bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c0, pci_vendor_12c0, pci_dev_list_12c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c1, pci_vendor_12c1, pci_dev_list_12c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c2, pci_vendor_12c2, pci_dev_list_12c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c3, pci_vendor_12c3, pci_dev_list_12c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c4, pci_vendor_12c4, pci_dev_list_12c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c5, pci_vendor_12c5, pci_dev_list_12c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c6, pci_vendor_12c6, pci_dev_list_12c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c7, pci_vendor_12c7, pci_dev_list_12c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c8, pci_vendor_12c8, pci_dev_list_12c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c9, pci_vendor_12c9, pci_dev_list_12c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ca, pci_vendor_12ca, pci_dev_list_12ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cb, pci_vendor_12cb, pci_dev_list_12cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cc, pci_vendor_12cc, pci_dev_list_12cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cd, pci_vendor_12cd, pci_dev_list_12cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ce, pci_vendor_12ce, pci_dev_list_12ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cf, pci_vendor_12cf, pci_dev_list_12cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d0, pci_vendor_12d0, pci_dev_list_12d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d1, pci_vendor_12d1, pci_dev_list_12d1},
-#endif
- {0x12d2, pci_vendor_12d2, pci_dev_list_12d2},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d3, pci_vendor_12d3, pci_dev_list_12d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d4, pci_vendor_12d4, pci_dev_list_12d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d5, pci_vendor_12d5, pci_dev_list_12d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d6, pci_vendor_12d6, pci_dev_list_12d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d7, pci_vendor_12d7, pci_dev_list_12d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d8, pci_vendor_12d8, pci_dev_list_12d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d9, pci_vendor_12d9, pci_dev_list_12d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12da, pci_vendor_12da, pci_dev_list_12da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12db, pci_vendor_12db, pci_dev_list_12db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12dc, pci_vendor_12dc, pci_dev_list_12dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12dd, pci_vendor_12dd, pci_dev_list_12dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12de, pci_vendor_12de, pci_dev_list_12de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12df, pci_vendor_12df, pci_dev_list_12df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e0, pci_vendor_12e0, pci_dev_list_12e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e1, pci_vendor_12e1, pci_dev_list_12e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e2, pci_vendor_12e2, pci_dev_list_12e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e3, pci_vendor_12e3, pci_dev_list_12e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e4, pci_vendor_12e4, pci_dev_list_12e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e5, pci_vendor_12e5, pci_dev_list_12e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e6, pci_vendor_12e6, pci_dev_list_12e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e7, pci_vendor_12e7, pci_dev_list_12e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e8, pci_vendor_12e8, pci_dev_list_12e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e9, pci_vendor_12e9, pci_dev_list_12e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ea, pci_vendor_12ea, pci_dev_list_12ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12eb, pci_vendor_12eb, pci_dev_list_12eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ec, pci_vendor_12ec, pci_dev_list_12ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ed, pci_vendor_12ed, pci_dev_list_12ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ee, pci_vendor_12ee, pci_dev_list_12ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ef, pci_vendor_12ef, pci_dev_list_12ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f0, pci_vendor_12f0, pci_dev_list_12f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f1, pci_vendor_12f1, pci_dev_list_12f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f2, pci_vendor_12f2, pci_dev_list_12f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f3, pci_vendor_12f3, pci_dev_list_12f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f4, pci_vendor_12f4, pci_dev_list_12f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f5, pci_vendor_12f5, pci_dev_list_12f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f6, pci_vendor_12f6, pci_dev_list_12f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f7, pci_vendor_12f7, pci_dev_list_12f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f8, pci_vendor_12f8, pci_dev_list_12f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f9, pci_vendor_12f9, pci_dev_list_12f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fb, pci_vendor_12fb, pci_dev_list_12fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fc, pci_vendor_12fc, pci_dev_list_12fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fd, pci_vendor_12fd, pci_dev_list_12fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fe, pci_vendor_12fe, pci_dev_list_12fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ff, pci_vendor_12ff, pci_dev_list_12ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1300, pci_vendor_1300, pci_dev_list_1300},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1302, pci_vendor_1302, pci_dev_list_1302},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1303, pci_vendor_1303, pci_dev_list_1303},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1304, pci_vendor_1304, pci_dev_list_1304},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1305, pci_vendor_1305, pci_dev_list_1305},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1306, pci_vendor_1306, pci_dev_list_1306},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1307, pci_vendor_1307, pci_dev_list_1307},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1308, pci_vendor_1308, pci_dev_list_1308},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1309, pci_vendor_1309, pci_dev_list_1309},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130a, pci_vendor_130a, pci_dev_list_130a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130b, pci_vendor_130b, pci_dev_list_130b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130c, pci_vendor_130c, pci_dev_list_130c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130d, pci_vendor_130d, pci_dev_list_130d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130e, pci_vendor_130e, pci_dev_list_130e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130f, pci_vendor_130f, pci_dev_list_130f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1310, pci_vendor_1310, pci_dev_list_1310},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1311, pci_vendor_1311, pci_dev_list_1311},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1312, pci_vendor_1312, pci_dev_list_1312},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1313, pci_vendor_1313, pci_dev_list_1313},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1316, pci_vendor_1316, pci_dev_list_1316},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1317, pci_vendor_1317, pci_dev_list_1317},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1318, pci_vendor_1318, pci_dev_list_1318},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1319, pci_vendor_1319, pci_dev_list_1319},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131a, pci_vendor_131a, pci_dev_list_131a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131c, pci_vendor_131c, pci_dev_list_131c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131d, pci_vendor_131d, pci_dev_list_131d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131e, pci_vendor_131e, pci_dev_list_131e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131f, pci_vendor_131f, pci_dev_list_131f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1320, pci_vendor_1320, pci_dev_list_1320},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1321, pci_vendor_1321, pci_dev_list_1321},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1322, pci_vendor_1322, pci_dev_list_1322},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1323, pci_vendor_1323, pci_dev_list_1323},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1324, pci_vendor_1324, pci_dev_list_1324},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1325, pci_vendor_1325, pci_dev_list_1325},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1326, pci_vendor_1326, pci_dev_list_1326},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1327, pci_vendor_1327, pci_dev_list_1327},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1328, pci_vendor_1328, pci_dev_list_1328},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1329, pci_vendor_1329, pci_dev_list_1329},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132a, pci_vendor_132a, pci_dev_list_132a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132b, pci_vendor_132b, pci_dev_list_132b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132c, pci_vendor_132c, pci_dev_list_132c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132d, pci_vendor_132d, pci_dev_list_132d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1330, pci_vendor_1330, pci_dev_list_1330},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1331, pci_vendor_1331, pci_dev_list_1331},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1332, pci_vendor_1332, pci_dev_list_1332},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1334, pci_vendor_1334, pci_dev_list_1334},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1335, pci_vendor_1335, pci_dev_list_1335},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1337, pci_vendor_1337, pci_dev_list_1337},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1338, pci_vendor_1338, pci_dev_list_1338},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133a, pci_vendor_133a, pci_dev_list_133a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133b, pci_vendor_133b, pci_dev_list_133b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133c, pci_vendor_133c, pci_dev_list_133c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133d, pci_vendor_133d, pci_dev_list_133d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133e, pci_vendor_133e, pci_dev_list_133e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133f, pci_vendor_133f, pci_dev_list_133f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1340, pci_vendor_1340, pci_dev_list_1340},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1341, pci_vendor_1341, pci_dev_list_1341},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1342, pci_vendor_1342, pci_dev_list_1342},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1343, pci_vendor_1343, pci_dev_list_1343},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1344, pci_vendor_1344, pci_dev_list_1344},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1345, pci_vendor_1345, pci_dev_list_1345},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1347, pci_vendor_1347, pci_dev_list_1347},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1349, pci_vendor_1349, pci_dev_list_1349},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134a, pci_vendor_134a, pci_dev_list_134a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134b, pci_vendor_134b, pci_dev_list_134b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134c, pci_vendor_134c, pci_dev_list_134c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134d, pci_vendor_134d, pci_dev_list_134d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134e, pci_vendor_134e, pci_dev_list_134e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134f, pci_vendor_134f, pci_dev_list_134f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1350, pci_vendor_1350, pci_dev_list_1350},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1351, pci_vendor_1351, pci_dev_list_1351},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1353, pci_vendor_1353, pci_dev_list_1353},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1354, pci_vendor_1354, pci_dev_list_1354},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1355, pci_vendor_1355, pci_dev_list_1355},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1356, pci_vendor_1356, pci_dev_list_1356},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1359, pci_vendor_1359, pci_dev_list_1359},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135a, pci_vendor_135a, pci_dev_list_135a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135b, pci_vendor_135b, pci_dev_list_135b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135c, pci_vendor_135c, pci_dev_list_135c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135d, pci_vendor_135d, pci_dev_list_135d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135e, pci_vendor_135e, pci_dev_list_135e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135f, pci_vendor_135f, pci_dev_list_135f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1360, pci_vendor_1360, pci_dev_list_1360},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1361, pci_vendor_1361, pci_dev_list_1361},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1362, pci_vendor_1362, pci_dev_list_1362},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1363, pci_vendor_1363, pci_dev_list_1363},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1364, pci_vendor_1364, pci_dev_list_1364},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1365, pci_vendor_1365, pci_dev_list_1365},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1366, pci_vendor_1366, pci_dev_list_1366},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1367, pci_vendor_1367, pci_dev_list_1367},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1368, pci_vendor_1368, pci_dev_list_1368},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1369, pci_vendor_1369, pci_dev_list_1369},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136a, pci_vendor_136a, pci_dev_list_136a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136b, pci_vendor_136b, pci_dev_list_136b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136c, pci_vendor_136c, pci_dev_list_136c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136d, pci_vendor_136d, pci_dev_list_136d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136f, pci_vendor_136f, pci_dev_list_136f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1370, pci_vendor_1370, pci_dev_list_1370},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1371, pci_vendor_1371, pci_dev_list_1371},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1373, pci_vendor_1373, pci_dev_list_1373},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1374, pci_vendor_1374, pci_dev_list_1374},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1375, pci_vendor_1375, pci_dev_list_1375},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1376, pci_vendor_1376, pci_dev_list_1376},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1377, pci_vendor_1377, pci_dev_list_1377},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1378, pci_vendor_1378, pci_dev_list_1378},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1379, pci_vendor_1379, pci_dev_list_1379},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137a, pci_vendor_137a, pci_dev_list_137a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137b, pci_vendor_137b, pci_dev_list_137b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137c, pci_vendor_137c, pci_dev_list_137c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137d, pci_vendor_137d, pci_dev_list_137d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137e, pci_vendor_137e, pci_dev_list_137e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137f, pci_vendor_137f, pci_dev_list_137f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1380, pci_vendor_1380, pci_dev_list_1380},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1381, pci_vendor_1381, pci_dev_list_1381},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1382, pci_vendor_1382, pci_dev_list_1382},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1383, pci_vendor_1383, pci_dev_list_1383},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1384, pci_vendor_1384, pci_dev_list_1384},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1385, pci_vendor_1385, pci_dev_list_1385},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1386, pci_vendor_1386, pci_dev_list_1386},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1387, pci_vendor_1387, pci_dev_list_1387},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1388, pci_vendor_1388, pci_dev_list_1388},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1389, pci_vendor_1389, pci_dev_list_1389},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138a, pci_vendor_138a, pci_dev_list_138a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138b, pci_vendor_138b, pci_dev_list_138b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138c, pci_vendor_138c, pci_dev_list_138c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138d, pci_vendor_138d, pci_dev_list_138d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138e, pci_vendor_138e, pci_dev_list_138e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138f, pci_vendor_138f, pci_dev_list_138f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1390, pci_vendor_1390, pci_dev_list_1390},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1391, pci_vendor_1391, pci_dev_list_1391},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1392, pci_vendor_1392, pci_dev_list_1392},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1393, pci_vendor_1393, pci_dev_list_1393},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1394, pci_vendor_1394, pci_dev_list_1394},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1395, pci_vendor_1395, pci_dev_list_1395},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1396, pci_vendor_1396, pci_dev_list_1396},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1397, pci_vendor_1397, pci_dev_list_1397},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1398, pci_vendor_1398, pci_dev_list_1398},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1399, pci_vendor_1399, pci_dev_list_1399},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139a, pci_vendor_139a, pci_dev_list_139a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139b, pci_vendor_139b, pci_dev_list_139b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139c, pci_vendor_139c, pci_dev_list_139c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139d, pci_vendor_139d, pci_dev_list_139d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139e, pci_vendor_139e, pci_dev_list_139e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139f, pci_vendor_139f, pci_dev_list_139f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a0, pci_vendor_13a0, pci_dev_list_13a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a1, pci_vendor_13a1, pci_dev_list_13a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a2, pci_vendor_13a2, pci_dev_list_13a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a3, pci_vendor_13a3, pci_dev_list_13a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a4, pci_vendor_13a4, pci_dev_list_13a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a5, pci_vendor_13a5, pci_dev_list_13a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a6, pci_vendor_13a6, pci_dev_list_13a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a7, pci_vendor_13a7, pci_dev_list_13a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a8, pci_vendor_13a8, pci_dev_list_13a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a9, pci_vendor_13a9, pci_dev_list_13a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13aa, pci_vendor_13aa, pci_dev_list_13aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ab, pci_vendor_13ab, pci_dev_list_13ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ac, pci_vendor_13ac, pci_dev_list_13ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ad, pci_vendor_13ad, pci_dev_list_13ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ae, pci_vendor_13ae, pci_dev_list_13ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13af, pci_vendor_13af, pci_dev_list_13af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b0, pci_vendor_13b0, pci_dev_list_13b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b1, pci_vendor_13b1, pci_dev_list_13b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b2, pci_vendor_13b2, pci_dev_list_13b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b3, pci_vendor_13b3, pci_dev_list_13b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b4, pci_vendor_13b4, pci_dev_list_13b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b5, pci_vendor_13b5, pci_dev_list_13b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b6, pci_vendor_13b6, pci_dev_list_13b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b7, pci_vendor_13b7, pci_dev_list_13b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b8, pci_vendor_13b8, pci_dev_list_13b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b9, pci_vendor_13b9, pci_dev_list_13b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ba, pci_vendor_13ba, pci_dev_list_13ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bb, pci_vendor_13bb, pci_dev_list_13bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bc, pci_vendor_13bc, pci_dev_list_13bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bd, pci_vendor_13bd, pci_dev_list_13bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13be, pci_vendor_13be, pci_dev_list_13be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bf, pci_vendor_13bf, pci_dev_list_13bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c0, pci_vendor_13c0, pci_dev_list_13c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c1, pci_vendor_13c1, pci_dev_list_13c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c2, pci_vendor_13c2, pci_dev_list_13c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c3, pci_vendor_13c3, pci_dev_list_13c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c4, pci_vendor_13c4, pci_dev_list_13c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c5, pci_vendor_13c5, pci_dev_list_13c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c6, pci_vendor_13c6, pci_dev_list_13c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c7, pci_vendor_13c7, pci_dev_list_13c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c8, pci_vendor_13c8, pci_dev_list_13c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c9, pci_vendor_13c9, pci_dev_list_13c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ca, pci_vendor_13ca, pci_dev_list_13ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cb, pci_vendor_13cb, pci_dev_list_13cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cc, pci_vendor_13cc, pci_dev_list_13cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cd, pci_vendor_13cd, pci_dev_list_13cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ce, pci_vendor_13ce, pci_dev_list_13ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cf, pci_vendor_13cf, pci_dev_list_13cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d0, pci_vendor_13d0, pci_dev_list_13d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d1, pci_vendor_13d1, pci_dev_list_13d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d2, pci_vendor_13d2, pci_dev_list_13d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d3, pci_vendor_13d3, pci_dev_list_13d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d4, pci_vendor_13d4, pci_dev_list_13d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d5, pci_vendor_13d5, pci_dev_list_13d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d6, pci_vendor_13d6, pci_dev_list_13d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d7, pci_vendor_13d7, pci_dev_list_13d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d8, pci_vendor_13d8, pci_dev_list_13d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d9, pci_vendor_13d9, pci_dev_list_13d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13da, pci_vendor_13da, pci_dev_list_13da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13db, pci_vendor_13db, pci_dev_list_13db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13dc, pci_vendor_13dc, pci_dev_list_13dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13dd, pci_vendor_13dd, pci_dev_list_13dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13de, pci_vendor_13de, pci_dev_list_13de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13df, pci_vendor_13df, pci_dev_list_13df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e0, pci_vendor_13e0, pci_dev_list_13e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e1, pci_vendor_13e1, pci_dev_list_13e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e2, pci_vendor_13e2, pci_dev_list_13e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e3, pci_vendor_13e3, pci_dev_list_13e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e4, pci_vendor_13e4, pci_dev_list_13e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e5, pci_vendor_13e5, pci_dev_list_13e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e6, pci_vendor_13e6, pci_dev_list_13e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e7, pci_vendor_13e7, pci_dev_list_13e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e8, pci_vendor_13e8, pci_dev_list_13e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e9, pci_vendor_13e9, pci_dev_list_13e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ea, pci_vendor_13ea, pci_dev_list_13ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13eb, pci_vendor_13eb, pci_dev_list_13eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ec, pci_vendor_13ec, pci_dev_list_13ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ed, pci_vendor_13ed, pci_dev_list_13ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ee, pci_vendor_13ee, pci_dev_list_13ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ef, pci_vendor_13ef, pci_dev_list_13ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f0, pci_vendor_13f0, pci_dev_list_13f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f1, pci_vendor_13f1, pci_dev_list_13f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f2, pci_vendor_13f2, pci_dev_list_13f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f3, pci_vendor_13f3, pci_dev_list_13f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f4, pci_vendor_13f4, pci_dev_list_13f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f5, pci_vendor_13f5, pci_dev_list_13f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f6, pci_vendor_13f6, pci_dev_list_13f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f7, pci_vendor_13f7, pci_dev_list_13f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f8, pci_vendor_13f8, pci_dev_list_13f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f9, pci_vendor_13f9, pci_dev_list_13f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fa, pci_vendor_13fa, pci_dev_list_13fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fb, pci_vendor_13fb, pci_dev_list_13fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fc, pci_vendor_13fc, pci_dev_list_13fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fd, pci_vendor_13fd, pci_dev_list_13fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fe, pci_vendor_13fe, pci_dev_list_13fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ff, pci_vendor_13ff, pci_dev_list_13ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1400, pci_vendor_1400, pci_dev_list_1400},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1401, pci_vendor_1401, pci_dev_list_1401},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1402, pci_vendor_1402, pci_dev_list_1402},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1403, pci_vendor_1403, pci_dev_list_1403},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1404, pci_vendor_1404, pci_dev_list_1404},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1405, pci_vendor_1405, pci_dev_list_1405},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1406, pci_vendor_1406, pci_dev_list_1406},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1407, pci_vendor_1407, pci_dev_list_1407},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1408, pci_vendor_1408, pci_dev_list_1408},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1409, pci_vendor_1409, pci_dev_list_1409},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140a, pci_vendor_140a, pci_dev_list_140a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140b, pci_vendor_140b, pci_dev_list_140b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140c, pci_vendor_140c, pci_dev_list_140c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140d, pci_vendor_140d, pci_dev_list_140d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140e, pci_vendor_140e, pci_dev_list_140e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140f, pci_vendor_140f, pci_dev_list_140f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1410, pci_vendor_1410, pci_dev_list_1410},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1411, pci_vendor_1411, pci_dev_list_1411},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1412, pci_vendor_1412, pci_dev_list_1412},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1413, pci_vendor_1413, pci_dev_list_1413},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1414, pci_vendor_1414, pci_dev_list_1414},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1415, pci_vendor_1415, pci_dev_list_1415},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1416, pci_vendor_1416, pci_dev_list_1416},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1417, pci_vendor_1417, pci_dev_list_1417},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1418, pci_vendor_1418, pci_dev_list_1418},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1419, pci_vendor_1419, pci_dev_list_1419},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141a, pci_vendor_141a, pci_dev_list_141a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141b, pci_vendor_141b, pci_dev_list_141b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141d, pci_vendor_141d, pci_dev_list_141d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141e, pci_vendor_141e, pci_dev_list_141e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141f, pci_vendor_141f, pci_dev_list_141f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1420, pci_vendor_1420, pci_dev_list_1420},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1421, pci_vendor_1421, pci_dev_list_1421},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1422, pci_vendor_1422, pci_dev_list_1422},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1423, pci_vendor_1423, pci_dev_list_1423},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1424, pci_vendor_1424, pci_dev_list_1424},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1425, pci_vendor_1425, pci_dev_list_1425},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1426, pci_vendor_1426, pci_dev_list_1426},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1427, pci_vendor_1427, pci_dev_list_1427},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1428, pci_vendor_1428, pci_dev_list_1428},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1429, pci_vendor_1429, pci_dev_list_1429},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142a, pci_vendor_142a, pci_dev_list_142a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142b, pci_vendor_142b, pci_dev_list_142b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142c, pci_vendor_142c, pci_dev_list_142c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142d, pci_vendor_142d, pci_dev_list_142d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142e, pci_vendor_142e, pci_dev_list_142e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142f, pci_vendor_142f, pci_dev_list_142f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1430, pci_vendor_1430, pci_dev_list_1430},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1431, pci_vendor_1431, pci_dev_list_1431},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1432, pci_vendor_1432, pci_dev_list_1432},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1433, pci_vendor_1433, pci_dev_list_1433},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1435, pci_vendor_1435, pci_dev_list_1435},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1436, pci_vendor_1436, pci_dev_list_1436},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1437, pci_vendor_1437, pci_dev_list_1437},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1438, pci_vendor_1438, pci_dev_list_1438},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1439, pci_vendor_1439, pci_dev_list_1439},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143a, pci_vendor_143a, pci_dev_list_143a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143b, pci_vendor_143b, pci_dev_list_143b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143c, pci_vendor_143c, pci_dev_list_143c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143d, pci_vendor_143d, pci_dev_list_143d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143e, pci_vendor_143e, pci_dev_list_143e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143f, pci_vendor_143f, pci_dev_list_143f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1440, pci_vendor_1440, pci_dev_list_1440},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1441, pci_vendor_1441, pci_dev_list_1441},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1442, pci_vendor_1442, pci_dev_list_1442},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1443, pci_vendor_1443, pci_dev_list_1443},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1444, pci_vendor_1444, pci_dev_list_1444},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1445, pci_vendor_1445, pci_dev_list_1445},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1446, pci_vendor_1446, pci_dev_list_1446},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1447, pci_vendor_1447, pci_dev_list_1447},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1448, pci_vendor_1448, pci_dev_list_1448},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1449, pci_vendor_1449, pci_dev_list_1449},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144a, pci_vendor_144a, pci_dev_list_144a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144b, pci_vendor_144b, pci_dev_list_144b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144c, pci_vendor_144c, pci_dev_list_144c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144d, pci_vendor_144d, pci_dev_list_144d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144e, pci_vendor_144e, pci_dev_list_144e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144f, pci_vendor_144f, pci_dev_list_144f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1450, pci_vendor_1450, pci_dev_list_1450},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1451, pci_vendor_1451, pci_dev_list_1451},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1453, pci_vendor_1453, pci_dev_list_1453},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1454, pci_vendor_1454, pci_dev_list_1454},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1455, pci_vendor_1455, pci_dev_list_1455},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1456, pci_vendor_1456, pci_dev_list_1456},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1457, pci_vendor_1457, pci_dev_list_1457},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1458, pci_vendor_1458, pci_dev_list_1458},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1459, pci_vendor_1459, pci_dev_list_1459},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145a, pci_vendor_145a, pci_dev_list_145a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145b, pci_vendor_145b, pci_dev_list_145b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145c, pci_vendor_145c, pci_dev_list_145c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145d, pci_vendor_145d, pci_dev_list_145d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145e, pci_vendor_145e, pci_dev_list_145e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145f, pci_vendor_145f, pci_dev_list_145f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1460, pci_vendor_1460, pci_dev_list_1460},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1461, pci_vendor_1461, pci_dev_list_1461},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1462, pci_vendor_1462, pci_dev_list_1462},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1463, pci_vendor_1463, pci_dev_list_1463},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1464, pci_vendor_1464, pci_dev_list_1464},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1465, pci_vendor_1465, pci_dev_list_1465},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1466, pci_vendor_1466, pci_dev_list_1466},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1467, pci_vendor_1467, pci_dev_list_1467},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1468, pci_vendor_1468, pci_dev_list_1468},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1469, pci_vendor_1469, pci_dev_list_1469},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146a, pci_vendor_146a, pci_dev_list_146a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146b, pci_vendor_146b, pci_dev_list_146b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146c, pci_vendor_146c, pci_dev_list_146c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146d, pci_vendor_146d, pci_dev_list_146d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146e, pci_vendor_146e, pci_dev_list_146e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146f, pci_vendor_146f, pci_dev_list_146f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1470, pci_vendor_1470, pci_dev_list_1470},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1471, pci_vendor_1471, pci_dev_list_1471},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1472, pci_vendor_1472, pci_dev_list_1472},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1473, pci_vendor_1473, pci_dev_list_1473},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1474, pci_vendor_1474, pci_dev_list_1474},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1475, pci_vendor_1475, pci_dev_list_1475},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1476, pci_vendor_1476, pci_dev_list_1476},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1477, pci_vendor_1477, pci_dev_list_1477},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1478, pci_vendor_1478, pci_dev_list_1478},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1479, pci_vendor_1479, pci_dev_list_1479},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147a, pci_vendor_147a, pci_dev_list_147a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147b, pci_vendor_147b, pci_dev_list_147b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147c, pci_vendor_147c, pci_dev_list_147c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147d, pci_vendor_147d, pci_dev_list_147d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147e, pci_vendor_147e, pci_dev_list_147e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147f, pci_vendor_147f, pci_dev_list_147f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1480, pci_vendor_1480, pci_dev_list_1480},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1481, pci_vendor_1481, pci_dev_list_1481},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1482, pci_vendor_1482, pci_dev_list_1482},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1483, pci_vendor_1483, pci_dev_list_1483},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1484, pci_vendor_1484, pci_dev_list_1484},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1485, pci_vendor_1485, pci_dev_list_1485},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1486, pci_vendor_1486, pci_dev_list_1486},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1487, pci_vendor_1487, pci_dev_list_1487},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1488, pci_vendor_1488, pci_dev_list_1488},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1489, pci_vendor_1489, pci_dev_list_1489},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148a, pci_vendor_148a, pci_dev_list_148a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148b, pci_vendor_148b, pci_dev_list_148b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148c, pci_vendor_148c, pci_dev_list_148c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148d, pci_vendor_148d, pci_dev_list_148d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148e, pci_vendor_148e, pci_dev_list_148e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148f, pci_vendor_148f, pci_dev_list_148f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1490, pci_vendor_1490, pci_dev_list_1490},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1491, pci_vendor_1491, pci_dev_list_1491},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1492, pci_vendor_1492, pci_dev_list_1492},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1493, pci_vendor_1493, pci_dev_list_1493},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1494, pci_vendor_1494, pci_dev_list_1494},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1495, pci_vendor_1495, pci_dev_list_1495},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1496, pci_vendor_1496, pci_dev_list_1496},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1497, pci_vendor_1497, pci_dev_list_1497},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1498, pci_vendor_1498, pci_dev_list_1498},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1499, pci_vendor_1499, pci_dev_list_1499},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149a, pci_vendor_149a, pci_dev_list_149a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149b, pci_vendor_149b, pci_dev_list_149b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149c, pci_vendor_149c, pci_dev_list_149c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149d, pci_vendor_149d, pci_dev_list_149d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149e, pci_vendor_149e, pci_dev_list_149e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149f, pci_vendor_149f, pci_dev_list_149f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a0, pci_vendor_14a0, pci_dev_list_14a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a1, pci_vendor_14a1, pci_dev_list_14a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a2, pci_vendor_14a2, pci_dev_list_14a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a3, pci_vendor_14a3, pci_dev_list_14a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a4, pci_vendor_14a4, pci_dev_list_14a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a5, pci_vendor_14a5, pci_dev_list_14a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a6, pci_vendor_14a6, pci_dev_list_14a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a7, pci_vendor_14a7, pci_dev_list_14a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a8, pci_vendor_14a8, pci_dev_list_14a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a9, pci_vendor_14a9, pci_dev_list_14a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14aa, pci_vendor_14aa, pci_dev_list_14aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ab, pci_vendor_14ab, pci_dev_list_14ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ac, pci_vendor_14ac, pci_dev_list_14ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ad, pci_vendor_14ad, pci_dev_list_14ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ae, pci_vendor_14ae, pci_dev_list_14ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14af, pci_vendor_14af, pci_dev_list_14af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b0, pci_vendor_14b0, pci_dev_list_14b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b1, pci_vendor_14b1, pci_dev_list_14b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b2, pci_vendor_14b2, pci_dev_list_14b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b3, pci_vendor_14b3, pci_dev_list_14b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b4, pci_vendor_14b4, pci_dev_list_14b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b5, pci_vendor_14b5, pci_dev_list_14b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b6, pci_vendor_14b6, pci_dev_list_14b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b7, pci_vendor_14b7, pci_dev_list_14b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b8, pci_vendor_14b8, pci_dev_list_14b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b9, pci_vendor_14b9, pci_dev_list_14b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ba, pci_vendor_14ba, pci_dev_list_14ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bb, pci_vendor_14bb, pci_dev_list_14bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bc, pci_vendor_14bc, pci_dev_list_14bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bd, pci_vendor_14bd, pci_dev_list_14bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14be, pci_vendor_14be, pci_dev_list_14be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bf, pci_vendor_14bf, pci_dev_list_14bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c0, pci_vendor_14c0, pci_dev_list_14c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c1, pci_vendor_14c1, pci_dev_list_14c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c2, pci_vendor_14c2, pci_dev_list_14c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c3, pci_vendor_14c3, pci_dev_list_14c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c4, pci_vendor_14c4, pci_dev_list_14c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c5, pci_vendor_14c5, pci_dev_list_14c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c6, pci_vendor_14c6, pci_dev_list_14c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c7, pci_vendor_14c7, pci_dev_list_14c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c8, pci_vendor_14c8, pci_dev_list_14c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c9, pci_vendor_14c9, pci_dev_list_14c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ca, pci_vendor_14ca, pci_dev_list_14ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cb, pci_vendor_14cb, pci_dev_list_14cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cc, pci_vendor_14cc, pci_dev_list_14cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cd, pci_vendor_14cd, pci_dev_list_14cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ce, pci_vendor_14ce, pci_dev_list_14ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cf, pci_vendor_14cf, pci_dev_list_14cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d0, pci_vendor_14d0, pci_dev_list_14d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d1, pci_vendor_14d1, pci_dev_list_14d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d2, pci_vendor_14d2, pci_dev_list_14d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d3, pci_vendor_14d3, pci_dev_list_14d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d4, pci_vendor_14d4, pci_dev_list_14d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d5, pci_vendor_14d5, pci_dev_list_14d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d6, pci_vendor_14d6, pci_dev_list_14d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d7, pci_vendor_14d7, pci_dev_list_14d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d8, pci_vendor_14d8, pci_dev_list_14d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d9, pci_vendor_14d9, pci_dev_list_14d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14da, pci_vendor_14da, pci_dev_list_14da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14db, pci_vendor_14db, pci_dev_list_14db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14dc, pci_vendor_14dc, pci_dev_list_14dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14dd, pci_vendor_14dd, pci_dev_list_14dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14de, pci_vendor_14de, pci_dev_list_14de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14df, pci_vendor_14df, pci_dev_list_14df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e1, pci_vendor_14e1, pci_dev_list_14e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e2, pci_vendor_14e2, pci_dev_list_14e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e3, pci_vendor_14e3, pci_dev_list_14e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e4, pci_vendor_14e4, pci_dev_list_14e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e5, pci_vendor_14e5, pci_dev_list_14e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e6, pci_vendor_14e6, pci_dev_list_14e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e7, pci_vendor_14e7, pci_dev_list_14e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e8, pci_vendor_14e8, pci_dev_list_14e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e9, pci_vendor_14e9, pci_dev_list_14e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ea, pci_vendor_14ea, pci_dev_list_14ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14eb, pci_vendor_14eb, pci_dev_list_14eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ec, pci_vendor_14ec, pci_dev_list_14ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ed, pci_vendor_14ed, pci_dev_list_14ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ee, pci_vendor_14ee, pci_dev_list_14ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ef, pci_vendor_14ef, pci_dev_list_14ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f0, pci_vendor_14f0, pci_dev_list_14f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f1, pci_vendor_14f1, pci_dev_list_14f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f2, pci_vendor_14f2, pci_dev_list_14f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f3, pci_vendor_14f3, pci_dev_list_14f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f4, pci_vendor_14f4, pci_dev_list_14f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f5, pci_vendor_14f5, pci_dev_list_14f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f6, pci_vendor_14f6, pci_dev_list_14f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f7, pci_vendor_14f7, pci_dev_list_14f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f8, pci_vendor_14f8, pci_dev_list_14f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f9, pci_vendor_14f9, pci_dev_list_14f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fa, pci_vendor_14fa, pci_dev_list_14fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fb, pci_vendor_14fb, pci_dev_list_14fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fc, pci_vendor_14fc, pci_dev_list_14fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fd, pci_vendor_14fd, pci_dev_list_14fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fe, pci_vendor_14fe, pci_dev_list_14fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ff, pci_vendor_14ff, pci_dev_list_14ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1500, pci_vendor_1500, pci_dev_list_1500},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1501, pci_vendor_1501, pci_dev_list_1501},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1502, pci_vendor_1502, pci_dev_list_1502},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1503, pci_vendor_1503, pci_dev_list_1503},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1504, pci_vendor_1504, pci_dev_list_1504},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1505, pci_vendor_1505, pci_dev_list_1505},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1506, pci_vendor_1506, pci_dev_list_1506},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1507, pci_vendor_1507, pci_dev_list_1507},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1508, pci_vendor_1508, pci_dev_list_1508},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1509, pci_vendor_1509, pci_dev_list_1509},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150a, pci_vendor_150a, pci_dev_list_150a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150b, pci_vendor_150b, pci_dev_list_150b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150c, pci_vendor_150c, pci_dev_list_150c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150d, pci_vendor_150d, pci_dev_list_150d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150e, pci_vendor_150e, pci_dev_list_150e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150f, pci_vendor_150f, pci_dev_list_150f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1510, pci_vendor_1510, pci_dev_list_1510},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1511, pci_vendor_1511, pci_dev_list_1511},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1512, pci_vendor_1512, pci_dev_list_1512},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1513, pci_vendor_1513, pci_dev_list_1513},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1514, pci_vendor_1514, pci_dev_list_1514},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1515, pci_vendor_1515, pci_dev_list_1515},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1516, pci_vendor_1516, pci_dev_list_1516},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1517, pci_vendor_1517, pci_dev_list_1517},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1518, pci_vendor_1518, pci_dev_list_1518},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1519, pci_vendor_1519, pci_dev_list_1519},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151a, pci_vendor_151a, pci_dev_list_151a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151b, pci_vendor_151b, pci_dev_list_151b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151c, pci_vendor_151c, pci_dev_list_151c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151d, pci_vendor_151d, pci_dev_list_151d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151e, pci_vendor_151e, pci_dev_list_151e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151f, pci_vendor_151f, pci_dev_list_151f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1520, pci_vendor_1520, pci_dev_list_1520},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1521, pci_vendor_1521, pci_dev_list_1521},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1522, pci_vendor_1522, pci_dev_list_1522},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1523, pci_vendor_1523, pci_dev_list_1523},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1524, pci_vendor_1524, pci_dev_list_1524},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1525, pci_vendor_1525, pci_dev_list_1525},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1526, pci_vendor_1526, pci_dev_list_1526},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1527, pci_vendor_1527, pci_dev_list_1527},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1528, pci_vendor_1528, pci_dev_list_1528},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1529, pci_vendor_1529, pci_dev_list_1529},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152a, pci_vendor_152a, pci_dev_list_152a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152b, pci_vendor_152b, pci_dev_list_152b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152c, pci_vendor_152c, pci_dev_list_152c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152d, pci_vendor_152d, pci_dev_list_152d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152e, pci_vendor_152e, pci_dev_list_152e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152f, pci_vendor_152f, pci_dev_list_152f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1530, pci_vendor_1530, pci_dev_list_1530},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1531, pci_vendor_1531, pci_dev_list_1531},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1532, pci_vendor_1532, pci_dev_list_1532},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1533, pci_vendor_1533, pci_dev_list_1533},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1534, pci_vendor_1534, pci_dev_list_1534},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1535, pci_vendor_1535, pci_dev_list_1535},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1537, pci_vendor_1537, pci_dev_list_1537},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1538, pci_vendor_1538, pci_dev_list_1538},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1539, pci_vendor_1539, pci_dev_list_1539},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153a, pci_vendor_153a, pci_dev_list_153a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153b, pci_vendor_153b, pci_dev_list_153b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153c, pci_vendor_153c, pci_dev_list_153c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153d, pci_vendor_153d, pci_dev_list_153d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153e, pci_vendor_153e, pci_dev_list_153e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153f, pci_vendor_153f, pci_dev_list_153f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1540, pci_vendor_1540, pci_dev_list_1540},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1541, pci_vendor_1541, pci_dev_list_1541},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1542, pci_vendor_1542, pci_dev_list_1542},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1543, pci_vendor_1543, pci_dev_list_1543},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1544, pci_vendor_1544, pci_dev_list_1544},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1545, pci_vendor_1545, pci_dev_list_1545},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1546, pci_vendor_1546, pci_dev_list_1546},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1547, pci_vendor_1547, pci_dev_list_1547},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1548, pci_vendor_1548, pci_dev_list_1548},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1549, pci_vendor_1549, pci_dev_list_1549},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154a, pci_vendor_154a, pci_dev_list_154a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154b, pci_vendor_154b, pci_dev_list_154b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154c, pci_vendor_154c, pci_dev_list_154c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154d, pci_vendor_154d, pci_dev_list_154d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154e, pci_vendor_154e, pci_dev_list_154e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154f, pci_vendor_154f, pci_dev_list_154f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1550, pci_vendor_1550, pci_dev_list_1550},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1551, pci_vendor_1551, pci_dev_list_1551},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1552, pci_vendor_1552, pci_dev_list_1552},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1553, pci_vendor_1553, pci_dev_list_1553},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1554, pci_vendor_1554, pci_dev_list_1554},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1555, pci_vendor_1555, pci_dev_list_1555},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1556, pci_vendor_1556, pci_dev_list_1556},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1557, pci_vendor_1557, pci_dev_list_1557},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1558, pci_vendor_1558, pci_dev_list_1558},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1559, pci_vendor_1559, pci_dev_list_1559},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155a, pci_vendor_155a, pci_dev_list_155a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155b, pci_vendor_155b, pci_dev_list_155b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155c, pci_vendor_155c, pci_dev_list_155c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155d, pci_vendor_155d, pci_dev_list_155d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155e, pci_vendor_155e, pci_dev_list_155e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155f, pci_vendor_155f, pci_dev_list_155f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1560, pci_vendor_1560, pci_dev_list_1560},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1561, pci_vendor_1561, pci_dev_list_1561},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1562, pci_vendor_1562, pci_dev_list_1562},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1563, pci_vendor_1563, pci_dev_list_1563},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1564, pci_vendor_1564, pci_dev_list_1564},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1565, pci_vendor_1565, pci_dev_list_1565},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1566, pci_vendor_1566, pci_dev_list_1566},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1567, pci_vendor_1567, pci_dev_list_1567},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1568, pci_vendor_1568, pci_dev_list_1568},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1569, pci_vendor_1569, pci_dev_list_1569},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156a, pci_vendor_156a, pci_dev_list_156a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156b, pci_vendor_156b, pci_dev_list_156b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156c, pci_vendor_156c, pci_dev_list_156c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156d, pci_vendor_156d, pci_dev_list_156d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156e, pci_vendor_156e, pci_dev_list_156e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156f, pci_vendor_156f, pci_dev_list_156f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1570, pci_vendor_1570, pci_dev_list_1570},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1571, pci_vendor_1571, pci_dev_list_1571},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1572, pci_vendor_1572, pci_dev_list_1572},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1573, pci_vendor_1573, pci_dev_list_1573},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1574, pci_vendor_1574, pci_dev_list_1574},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1575, pci_vendor_1575, pci_dev_list_1575},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1576, pci_vendor_1576, pci_dev_list_1576},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1578, pci_vendor_1578, pci_dev_list_1578},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1579, pci_vendor_1579, pci_dev_list_1579},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157a, pci_vendor_157a, pci_dev_list_157a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157b, pci_vendor_157b, pci_dev_list_157b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157c, pci_vendor_157c, pci_dev_list_157c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157d, pci_vendor_157d, pci_dev_list_157d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157e, pci_vendor_157e, pci_dev_list_157e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157f, pci_vendor_157f, pci_dev_list_157f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1580, pci_vendor_1580, pci_dev_list_1580},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1581, pci_vendor_1581, pci_dev_list_1581},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1582, pci_vendor_1582, pci_dev_list_1582},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1583, pci_vendor_1583, pci_dev_list_1583},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1584, pci_vendor_1584, pci_dev_list_1584},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1585, pci_vendor_1585, pci_dev_list_1585},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1586, pci_vendor_1586, pci_dev_list_1586},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1587, pci_vendor_1587, pci_dev_list_1587},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1588, pci_vendor_1588, pci_dev_list_1588},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1589, pci_vendor_1589, pci_dev_list_1589},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158a, pci_vendor_158a, pci_dev_list_158a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158b, pci_vendor_158b, pci_dev_list_158b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158c, pci_vendor_158c, pci_dev_list_158c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158d, pci_vendor_158d, pci_dev_list_158d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158e, pci_vendor_158e, pci_dev_list_158e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158f, pci_vendor_158f, pci_dev_list_158f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1590, pci_vendor_1590, pci_dev_list_1590},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1591, pci_vendor_1591, pci_dev_list_1591},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1592, pci_vendor_1592, pci_dev_list_1592},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1593, pci_vendor_1593, pci_dev_list_1593},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1594, pci_vendor_1594, pci_dev_list_1594},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1595, pci_vendor_1595, pci_dev_list_1595},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1596, pci_vendor_1596, pci_dev_list_1596},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1597, pci_vendor_1597, pci_dev_list_1597},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1598, pci_vendor_1598, pci_dev_list_1598},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1599, pci_vendor_1599, pci_dev_list_1599},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159a, pci_vendor_159a, pci_dev_list_159a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159b, pci_vendor_159b, pci_dev_list_159b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159c, pci_vendor_159c, pci_dev_list_159c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159d, pci_vendor_159d, pci_dev_list_159d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159e, pci_vendor_159e, pci_dev_list_159e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159f, pci_vendor_159f, pci_dev_list_159f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a0, pci_vendor_15a0, pci_dev_list_15a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a1, pci_vendor_15a1, pci_dev_list_15a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a2, pci_vendor_15a2, pci_dev_list_15a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a3, pci_vendor_15a3, pci_dev_list_15a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a4, pci_vendor_15a4, pci_dev_list_15a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a5, pci_vendor_15a5, pci_dev_list_15a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a6, pci_vendor_15a6, pci_dev_list_15a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a7, pci_vendor_15a7, pci_dev_list_15a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a8, pci_vendor_15a8, pci_dev_list_15a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15aa, pci_vendor_15aa, pci_dev_list_15aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ab, pci_vendor_15ab, pci_dev_list_15ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ac, pci_vendor_15ac, pci_dev_list_15ac},
-#endif
- {0x15ad, pci_vendor_15ad, pci_dev_list_15ad},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ae, pci_vendor_15ae, pci_dev_list_15ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b0, pci_vendor_15b0, pci_dev_list_15b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b1, pci_vendor_15b1, pci_dev_list_15b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b2, pci_vendor_15b2, pci_dev_list_15b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b3, pci_vendor_15b3, pci_dev_list_15b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b4, pci_vendor_15b4, pci_dev_list_15b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b5, pci_vendor_15b5, pci_dev_list_15b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b6, pci_vendor_15b6, pci_dev_list_15b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b7, pci_vendor_15b7, pci_dev_list_15b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b8, pci_vendor_15b8, pci_dev_list_15b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b9, pci_vendor_15b9, pci_dev_list_15b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ba, pci_vendor_15ba, pci_dev_list_15ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bb, pci_vendor_15bb, pci_dev_list_15bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bc, pci_vendor_15bc, pci_dev_list_15bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bd, pci_vendor_15bd, pci_dev_list_15bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15be, pci_vendor_15be, pci_dev_list_15be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bf, pci_vendor_15bf, pci_dev_list_15bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c0, pci_vendor_15c0, pci_dev_list_15c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c1, pci_vendor_15c1, pci_dev_list_15c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c2, pci_vendor_15c2, pci_dev_list_15c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c3, pci_vendor_15c3, pci_dev_list_15c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c4, pci_vendor_15c4, pci_dev_list_15c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c5, pci_vendor_15c5, pci_dev_list_15c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c6, pci_vendor_15c6, pci_dev_list_15c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c7, pci_vendor_15c7, pci_dev_list_15c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c8, pci_vendor_15c8, pci_dev_list_15c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c9, pci_vendor_15c9, pci_dev_list_15c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ca, pci_vendor_15ca, pci_dev_list_15ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cb, pci_vendor_15cb, pci_dev_list_15cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cc, pci_vendor_15cc, pci_dev_list_15cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cd, pci_vendor_15cd, pci_dev_list_15cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ce, pci_vendor_15ce, pci_dev_list_15ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cf, pci_vendor_15cf, pci_dev_list_15cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d1, pci_vendor_15d1, pci_dev_list_15d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d2, pci_vendor_15d2, pci_dev_list_15d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d3, pci_vendor_15d3, pci_dev_list_15d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d4, pci_vendor_15d4, pci_dev_list_15d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d5, pci_vendor_15d5, pci_dev_list_15d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d6, pci_vendor_15d6, pci_dev_list_15d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d7, pci_vendor_15d7, pci_dev_list_15d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d8, pci_vendor_15d8, pci_dev_list_15d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d9, pci_vendor_15d9, pci_dev_list_15d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15da, pci_vendor_15da, pci_dev_list_15da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15db, pci_vendor_15db, pci_dev_list_15db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15dc, pci_vendor_15dc, pci_dev_list_15dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15dd, pci_vendor_15dd, pci_dev_list_15dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15de, pci_vendor_15de, pci_dev_list_15de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15df, pci_vendor_15df, pci_dev_list_15df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e0, pci_vendor_15e0, pci_dev_list_15e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e1, pci_vendor_15e1, pci_dev_list_15e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e2, pci_vendor_15e2, pci_dev_list_15e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e3, pci_vendor_15e3, pci_dev_list_15e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e4, pci_vendor_15e4, pci_dev_list_15e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e5, pci_vendor_15e5, pci_dev_list_15e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e6, pci_vendor_15e6, pci_dev_list_15e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e7, pci_vendor_15e7, pci_dev_list_15e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e8, pci_vendor_15e8, pci_dev_list_15e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e9, pci_vendor_15e9, pci_dev_list_15e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ea, pci_vendor_15ea, pci_dev_list_15ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15eb, pci_vendor_15eb, pci_dev_list_15eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ec, pci_vendor_15ec, pci_dev_list_15ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ed, pci_vendor_15ed, pci_dev_list_15ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ee, pci_vendor_15ee, pci_dev_list_15ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ef, pci_vendor_15ef, pci_dev_list_15ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f0, pci_vendor_15f0, pci_dev_list_15f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f1, pci_vendor_15f1, pci_dev_list_15f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f2, pci_vendor_15f2, pci_dev_list_15f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f3, pci_vendor_15f3, pci_dev_list_15f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f4, pci_vendor_15f4, pci_dev_list_15f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f5, pci_vendor_15f5, pci_dev_list_15f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f6, pci_vendor_15f6, pci_dev_list_15f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f7, pci_vendor_15f7, pci_dev_list_15f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f8, pci_vendor_15f8, pci_dev_list_15f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f9, pci_vendor_15f9, pci_dev_list_15f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fa, pci_vendor_15fa, pci_dev_list_15fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fb, pci_vendor_15fb, pci_dev_list_15fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fc, pci_vendor_15fc, pci_dev_list_15fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fd, pci_vendor_15fd, pci_dev_list_15fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fe, pci_vendor_15fe, pci_dev_list_15fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ff, pci_vendor_15ff, pci_dev_list_15ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1600, pci_vendor_1600, pci_dev_list_1600},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1601, pci_vendor_1601, pci_dev_list_1601},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1602, pci_vendor_1602, pci_dev_list_1602},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1603, pci_vendor_1603, pci_dev_list_1603},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1604, pci_vendor_1604, pci_dev_list_1604},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1605, pci_vendor_1605, pci_dev_list_1605},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1606, pci_vendor_1606, pci_dev_list_1606},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1607, pci_vendor_1607, pci_dev_list_1607},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1608, pci_vendor_1608, pci_dev_list_1608},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1609, pci_vendor_1609, pci_dev_list_1609},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1612, pci_vendor_1612, pci_dev_list_1612},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1619, pci_vendor_1619, pci_dev_list_1619},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1629, pci_vendor_1629, pci_dev_list_1629},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1638, pci_vendor_1638, pci_dev_list_1638},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x163c, pci_vendor_163c, pci_dev_list_163c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1657, pci_vendor_1657, pci_dev_list_1657},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x165a, pci_vendor_165a, pci_dev_list_165a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x165d, pci_vendor_165d, pci_dev_list_165d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1661, pci_vendor_1661, pci_dev_list_1661},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1668, pci_vendor_1668, pci_dev_list_1668},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1681, pci_vendor_1681, pci_dev_list_1681},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ab, pci_vendor_16ab, pci_dev_list_16ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16be, pci_vendor_16be, pci_dev_list_16be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ca, pci_vendor_16ca, pci_dev_list_16ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ec, pci_vendor_16ec, pci_dev_list_16ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16f6, pci_vendor_16f6, pci_dev_list_16f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1705, pci_vendor_1705, pci_dev_list_1705},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x170b, pci_vendor_170b, pci_dev_list_170b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x170c, pci_vendor_170c, pci_dev_list_170c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x172a, pci_vendor_172a, pci_dev_list_172a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1737, pci_vendor_1737, pci_dev_list_1737},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x173b, pci_vendor_173b, pci_dev_list_173b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1743, pci_vendor_1743, pci_dev_list_1743},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x174b, pci_vendor_174b, pci_dev_list_174b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x175e, pci_vendor_175e, pci_dev_list_175e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1787, pci_vendor_1787, pci_dev_list_1787},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1796, pci_vendor_1796, pci_dev_list_1796},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1799, pci_vendor_1799, pci_dev_list_1799},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x17af, pci_vendor_17af, pci_dev_list_17af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x17cc, pci_vendor_17cc, pci_dev_list_17cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1813, pci_vendor_1813, pci_dev_list_1813},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1851, pci_vendor_1851, pci_dev_list_1851},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1852, pci_vendor_1852, pci_dev_list_1852},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1888, pci_vendor_1888, pci_dev_list_1888},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1a08, pci_vendor_1a08, pci_dev_list_1a08},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1b13, pci_vendor_1b13, pci_dev_list_1b13},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1c1c, pci_vendor_1c1c, pci_dev_list_1c1c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1d44, pci_vendor_1d44, pci_dev_list_1d44},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1de1, pci_vendor_1de1, pci_dev_list_1de1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1fc0, pci_vendor_1fc0, pci_dev_list_1fc0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2000, pci_vendor_2000, pci_dev_list_2000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2001, pci_vendor_2001, pci_dev_list_2001},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2003, pci_vendor_2003, pci_dev_list_2003},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2004, pci_vendor_2004, pci_dev_list_2004},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x21c3, pci_vendor_21c3, pci_dev_list_21c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2348, pci_vendor_2348, pci_dev_list_2348},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2646, pci_vendor_2646, pci_dev_list_2646},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x270b, pci_vendor_270b, pci_dev_list_270b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x270f, pci_vendor_270f, pci_dev_list_270f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2711, pci_vendor_2711, pci_dev_list_2711},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2a15, pci_vendor_2a15, pci_dev_list_2a15},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3000, pci_vendor_3000, pci_dev_list_3000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3142, pci_vendor_3142, pci_dev_list_3142},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3388, pci_vendor_3388, pci_dev_list_3388},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3411, pci_vendor_3411, pci_dev_list_3411},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3513, pci_vendor_3513, pci_dev_list_3513},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x38ef, pci_vendor_38ef, pci_dev_list_38ef},
-#endif
- {0x3d3d, pci_vendor_3d3d, pci_dev_list_3d3d},
- {0x4005, pci_vendor_4005, pci_dev_list_4005},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4033, pci_vendor_4033, pci_dev_list_4033},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4143, pci_vendor_4143, pci_dev_list_4143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x416c, pci_vendor_416c, pci_dev_list_416c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4444, pci_vendor_4444, pci_dev_list_4444},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4468, pci_vendor_4468, pci_dev_list_4468},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4594, pci_vendor_4594, pci_dev_list_4594},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x45fb, pci_vendor_45fb, pci_dev_list_45fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4680, pci_vendor_4680, pci_dev_list_4680},
-#endif
- {0x4843, pci_vendor_4843, pci_dev_list_4843},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4916, pci_vendor_4916, pci_dev_list_4916},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4943, pci_vendor_4943, pci_dev_list_4943},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4978, pci_vendor_4978, pci_dev_list_4978},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4a14, pci_vendor_4a14, pci_dev_list_4a14},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4b10, pci_vendor_4b10, pci_dev_list_4b10},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4c48, pci_vendor_4c48, pci_dev_list_4c48},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4c53, pci_vendor_4c53, pci_dev_list_4c53},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4ca1, pci_vendor_4ca1, pci_dev_list_4ca1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4d51, pci_vendor_4d51, pci_dev_list_4d51},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4d54, pci_vendor_4d54, pci_dev_list_4d54},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4ddc, pci_vendor_4ddc, pci_dev_list_4ddc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5046, pci_vendor_5046, pci_dev_list_5046},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5053, pci_vendor_5053, pci_dev_list_5053},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5136, pci_vendor_5136, pci_dev_list_5136},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5143, pci_vendor_5143, pci_dev_list_5143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5145, pci_vendor_5145, pci_dev_list_5145},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5168, pci_vendor_5168, pci_dev_list_5168},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5301, pci_vendor_5301, pci_dev_list_5301},
-#endif
- {0x5333, pci_vendor_5333, pci_dev_list_5333},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x544c, pci_vendor_544c, pci_dev_list_544c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5455, pci_vendor_5455, pci_dev_list_5455},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5519, pci_vendor_5519, pci_dev_list_5519},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5544, pci_vendor_5544, pci_dev_list_5544},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5555, pci_vendor_5555, pci_dev_list_5555},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5654, pci_vendor_5654, pci_dev_list_5654},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5700, pci_vendor_5700, pci_dev_list_5700},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6356, pci_vendor_6356, pci_dev_list_6356},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6374, pci_vendor_6374, pci_dev_list_6374},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6409, pci_vendor_6409, pci_dev_list_6409},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6666, pci_vendor_6666, pci_dev_list_6666},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7604, pci_vendor_7604, pci_dev_list_7604},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7bde, pci_vendor_7bde, pci_dev_list_7bde},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7fed, pci_vendor_7fed, pci_dev_list_7fed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8008, pci_vendor_8008, pci_dev_list_8008},
-#endif
- {0x8086, pci_vendor_8086, pci_dev_list_8086},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8800, pci_vendor_8800, pci_dev_list_8800},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8866, pci_vendor_8866, pci_dev_list_8866},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8888, pci_vendor_8888, pci_dev_list_8888},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8e0e, pci_vendor_8e0e, pci_dev_list_8e0e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8e2e, pci_vendor_8e2e, pci_dev_list_8e2e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9004, pci_vendor_9004, pci_dev_list_9004},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9005, pci_vendor_9005, pci_dev_list_9005},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x907f, pci_vendor_907f, pci_dev_list_907f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x919a, pci_vendor_919a, pci_dev_list_919a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9412, pci_vendor_9412, pci_dev_list_9412},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9699, pci_vendor_9699, pci_dev_list_9699},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9710, pci_vendor_9710, pci_dev_list_9710},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa0a0, pci_vendor_a0a0, pci_dev_list_a0a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa0f1, pci_vendor_a0f1, pci_dev_list_a0f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa200, pci_vendor_a200, pci_dev_list_a200},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa259, pci_vendor_a259, pci_dev_list_a259},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa25b, pci_vendor_a25b, pci_dev_list_a25b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa304, pci_vendor_a304, pci_dev_list_a304},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa727, pci_vendor_a727, pci_dev_list_a727},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xaa42, pci_vendor_aa42, pci_dev_list_aa42},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xac1e, pci_vendor_ac1e, pci_dev_list_ac1e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xb1b3, pci_vendor_b1b3, pci_dev_list_b1b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xbd11, pci_vendor_bd11, pci_dev_list_bd11},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc001, pci_vendor_c001, pci_dev_list_c001},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0a9, pci_vendor_c0a9, pci_dev_list_c0a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0de, pci_vendor_c0de, pci_dev_list_c0de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0fe, pci_vendor_c0fe, pci_dev_list_c0fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xca50, pci_vendor_ca50, pci_dev_list_ca50},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcafe, pci_vendor_cafe, pci_dev_list_cafe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcccc, pci_vendor_cccc, pci_dev_list_cccc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcddd, pci_vendor_cddd, pci_dev_list_cddd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd4d4, pci_vendor_d4d4, pci_dev_list_d4d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd531, pci_vendor_d531, pci_dev_list_d531},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd84d, pci_vendor_d84d, pci_dev_list_d84d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xdead, pci_vendor_dead, pci_dev_list_dead},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe000, pci_vendor_e000, pci_dev_list_e000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe159, pci_vendor_e159, pci_dev_list_e159},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe4bf, pci_vendor_e4bf, pci_dev_list_e4bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xea01, pci_vendor_ea01, pci_dev_list_ea01},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xea60, pci_vendor_ea60, pci_dev_list_ea60},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xeabb, pci_vendor_eabb, pci_dev_list_eabb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xeace, pci_vendor_eace, pci_dev_list_eace},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xec80, pci_vendor_ec80, pci_dev_list_ec80},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xecc0, pci_vendor_ecc0, pci_dev_list_ecc0},
-#endif
- {0xedd8, pci_vendor_edd8, pci_dev_list_edd8},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xf1d0, pci_vendor_f1d0, pci_dev_list_f1d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfa57, pci_vendor_fa57, pci_dev_list_fa57},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfebd, pci_vendor_febd, pci_dev_list_febd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfeda, pci_vendor_feda, pci_dev_list_feda},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfffe, pci_vendor_fffe, pci_dev_list_fffe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xffff, pci_vendor_ffff, pci_dev_list_ffff},
-#endif
- {0x0000, NULL, NULL}
-};
-
-#if defined(INIT_VENDOR_SUBSYS_INFO) && defined(INIT_SUBSYS_INFO)
-static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0000, pci_vendor_0000, pci_ss_list_0000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x001a, pci_vendor_001a, pci_ss_list_001a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0033, pci_vendor_0033, pci_ss_list_0033},
-#endif
- {0x003d, pci_vendor_003d, pci_ss_list_003d},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0059, pci_vendor_0059, pci_ss_list_0059},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0070, pci_vendor_0070, pci_ss_list_0070},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0100, pci_vendor_0100, pci_ss_list_0100},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0675, pci_vendor_0675, pci_ss_list_0675},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0925, pci_vendor_0925, pci_ss_list_0925},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x09c1, pci_vendor_09c1, pci_ss_list_09c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0a89, pci_vendor_0a89, pci_ss_list_0a89},
-#endif
- {0x0e11, pci_vendor_0e11, pci_ss_list_0e11},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x0e55, pci_vendor_0e55, pci_ss_list_0e55},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1000, pci_vendor_1000, pci_ss_list_1000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1001, pci_vendor_1001, pci_ss_list_1001},
-#endif
- {0x1002, pci_vendor_1002, pci_ss_list_1002},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1003, pci_vendor_1003, pci_ss_list_1003},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1004, pci_vendor_1004, pci_ss_list_1004},
-#endif
- {0x1005, pci_vendor_1005, pci_ss_list_1005},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1006, pci_vendor_1006, pci_ss_list_1006},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1007, pci_vendor_1007, pci_ss_list_1007},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1008, pci_vendor_1008, pci_ss_list_1008},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x100a, pci_vendor_100a, pci_ss_list_100a},
-#endif
- {0x100b, pci_vendor_100b, pci_ss_list_100b},
- {0x100c, pci_vendor_100c, pci_ss_list_100c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x100d, pci_vendor_100d, pci_ss_list_100d},
-#endif
- {0x100e, pci_vendor_100e, pci_ss_list_100e},
- {0x1010, pci_vendor_1010, pci_ss_list_1010},
- {0x1011, pci_vendor_1011, pci_ss_list_1011},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1012, pci_vendor_1012, pci_ss_list_1012},
-#endif
- {0x1013, pci_vendor_1013, pci_ss_list_1013},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1014, pci_vendor_1014, pci_ss_list_1014},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1015, pci_vendor_1015, pci_ss_list_1015},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1016, pci_vendor_1016, pci_ss_list_1016},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1017, pci_vendor_1017, pci_ss_list_1017},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1018, pci_vendor_1018, pci_ss_list_1018},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1019, pci_vendor_1019, pci_ss_list_1019},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101a, pci_vendor_101a, pci_ss_list_101a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101b, pci_vendor_101b, pci_ss_list_101b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101c, pci_vendor_101c, pci_ss_list_101c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101e, pci_vendor_101e, pci_ss_list_101e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x101f, pci_vendor_101f, pci_ss_list_101f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1020, pci_vendor_1020, pci_ss_list_1020},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1021, pci_vendor_1021, pci_ss_list_1021},
-#endif
- {0x1022, pci_vendor_1022, pci_ss_list_1022},
- {0x1023, pci_vendor_1023, pci_ss_list_1023},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1024, pci_vendor_1024, pci_ss_list_1024},
-#endif
- {0x1025, pci_vendor_1025, pci_ss_list_1025},
- {0x1028, pci_vendor_1028, pci_ss_list_1028},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1029, pci_vendor_1029, pci_ss_list_1029},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102a, pci_vendor_102a, pci_ss_list_102a},
-#endif
- {0x102b, pci_vendor_102b, pci_ss_list_102b},
- {0x102c, pci_vendor_102c, pci_ss_list_102c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102d, pci_vendor_102d, pci_ss_list_102d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102e, pci_vendor_102e, pci_ss_list_102e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x102f, pci_vendor_102f, pci_ss_list_102f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1030, pci_vendor_1030, pci_ss_list_1030},
-#endif
- {0x1031, pci_vendor_1031, pci_ss_list_1031},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1032, pci_vendor_1032, pci_ss_list_1032},
-#endif
- {0x1033, pci_vendor_1033, pci_ss_list_1033},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1034, pci_vendor_1034, pci_ss_list_1034},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1035, pci_vendor_1035, pci_ss_list_1035},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1036, pci_vendor_1036, pci_ss_list_1036},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1037, pci_vendor_1037, pci_ss_list_1037},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1038, pci_vendor_1038, pci_ss_list_1038},
-#endif
- {0x1039, pci_vendor_1039, pci_ss_list_1039},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103a, pci_vendor_103a, pci_ss_list_103a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103b, pci_vendor_103b, pci_ss_list_103b},
-#endif
- {0x103c, pci_vendor_103c, pci_ss_list_103c},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103e, pci_vendor_103e, pci_ss_list_103e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x103f, pci_vendor_103f, pci_ss_list_103f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1040, pci_vendor_1040, pci_ss_list_1040},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1041, pci_vendor_1041, pci_ss_list_1041},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1042, pci_vendor_1042, pci_ss_list_1042},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1043, pci_vendor_1043, pci_ss_list_1043},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1044, pci_vendor_1044, pci_ss_list_1044},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1045, pci_vendor_1045, pci_ss_list_1045},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1046, pci_vendor_1046, pci_ss_list_1046},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1047, pci_vendor_1047, pci_ss_list_1047},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1048, pci_vendor_1048, pci_ss_list_1048},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1049, pci_vendor_1049, pci_ss_list_1049},
-#endif
- {0x104a, pci_vendor_104a, pci_ss_list_104a},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x104b, pci_vendor_104b, pci_ss_list_104b},
-#endif
- {0x104c, pci_vendor_104c, pci_ss_list_104c},
- {0x104d, pci_vendor_104d, pci_ss_list_104d},
- {0x104e, pci_vendor_104e, pci_ss_list_104e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x104f, pci_vendor_104f, pci_ss_list_104f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1050, pci_vendor_1050, pci_ss_list_1050},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1051, pci_vendor_1051, pci_ss_list_1051},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1052, pci_vendor_1052, pci_ss_list_1052},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1053, pci_vendor_1053, pci_ss_list_1053},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1054, pci_vendor_1054, pci_ss_list_1054},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1055, pci_vendor_1055, pci_ss_list_1055},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1056, pci_vendor_1056, pci_ss_list_1056},
-#endif
- {0x1057, pci_vendor_1057, pci_ss_list_1057},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1058, pci_vendor_1058, pci_ss_list_1058},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1059, pci_vendor_1059, pci_ss_list_1059},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105a, pci_vendor_105a, pci_ss_list_105a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105b, pci_vendor_105b, pci_ss_list_105b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105c, pci_vendor_105c, pci_ss_list_105c},
-#endif
- {0x105d, pci_vendor_105d, pci_ss_list_105d},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105e, pci_vendor_105e, pci_ss_list_105e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x105f, pci_vendor_105f, pci_ss_list_105f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1060, pci_vendor_1060, pci_ss_list_1060},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1061, pci_vendor_1061, pci_ss_list_1061},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1062, pci_vendor_1062, pci_ss_list_1062},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1063, pci_vendor_1063, pci_ss_list_1063},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1064, pci_vendor_1064, pci_ss_list_1064},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1065, pci_vendor_1065, pci_ss_list_1065},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1066, pci_vendor_1066, pci_ss_list_1066},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1067, pci_vendor_1067, pci_ss_list_1067},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1068, pci_vendor_1068, pci_ss_list_1068},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1069, pci_vendor_1069, pci_ss_list_1069},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106a, pci_vendor_106a, pci_ss_list_106a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106b, pci_vendor_106b, pci_ss_list_106b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106c, pci_vendor_106c, pci_ss_list_106c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106d, pci_vendor_106d, pci_ss_list_106d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106e, pci_vendor_106e, pci_ss_list_106e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x106f, pci_vendor_106f, pci_ss_list_106f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1070, pci_vendor_1070, pci_ss_list_1070},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1071, pci_vendor_1071, pci_ss_list_1071},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1072, pci_vendor_1072, pci_ss_list_1072},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1073, pci_vendor_1073, pci_ss_list_1073},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1074, pci_vendor_1074, pci_ss_list_1074},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1075, pci_vendor_1075, pci_ss_list_1075},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1076, pci_vendor_1076, pci_ss_list_1076},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1077, pci_vendor_1077, pci_ss_list_1077},
-#endif
- {0x1078, pci_vendor_1078, pci_ss_list_1078},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1079, pci_vendor_1079, pci_ss_list_1079},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107a, pci_vendor_107a, pci_ss_list_107a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107b, pci_vendor_107b, pci_ss_list_107b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107c, pci_vendor_107c, pci_ss_list_107c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107d, pci_vendor_107d, pci_ss_list_107d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107e, pci_vendor_107e, pci_ss_list_107e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x107f, pci_vendor_107f, pci_ss_list_107f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1080, pci_vendor_1080, pci_ss_list_1080},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1081, pci_vendor_1081, pci_ss_list_1081},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1082, pci_vendor_1082, pci_ss_list_1082},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1083, pci_vendor_1083, pci_ss_list_1083},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1084, pci_vendor_1084, pci_ss_list_1084},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1085, pci_vendor_1085, pci_ss_list_1085},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1086, pci_vendor_1086, pci_ss_list_1086},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1087, pci_vendor_1087, pci_ss_list_1087},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1088, pci_vendor_1088, pci_ss_list_1088},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1089, pci_vendor_1089, pci_ss_list_1089},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108a, pci_vendor_108a, pci_ss_list_108a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108c, pci_vendor_108c, pci_ss_list_108c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108d, pci_vendor_108d, pci_ss_list_108d},
-#endif
- {0x108e, pci_vendor_108e, pci_ss_list_108e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x108f, pci_vendor_108f, pci_ss_list_108f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1090, pci_vendor_1090, pci_ss_list_1090},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1091, pci_vendor_1091, pci_ss_list_1091},
-#endif
- {0x1092, pci_vendor_1092, pci_ss_list_1092},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1093, pci_vendor_1093, pci_ss_list_1093},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1094, pci_vendor_1094, pci_ss_list_1094},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1095, pci_vendor_1095, pci_ss_list_1095},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1096, pci_vendor_1096, pci_ss_list_1096},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1097, pci_vendor_1097, pci_ss_list_1097},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1098, pci_vendor_1098, pci_ss_list_1098},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1099, pci_vendor_1099, pci_ss_list_1099},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109a, pci_vendor_109a, pci_ss_list_109a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109b, pci_vendor_109b, pci_ss_list_109b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109c, pci_vendor_109c, pci_ss_list_109c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109d, pci_vendor_109d, pci_ss_list_109d},
-#endif
- {0x109e, pci_vendor_109e, pci_ss_list_109e},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x109f, pci_vendor_109f, pci_ss_list_109f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a0, pci_vendor_10a0, pci_ss_list_10a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a1, pci_vendor_10a1, pci_ss_list_10a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a2, pci_vendor_10a2, pci_ss_list_10a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a3, pci_vendor_10a3, pci_ss_list_10a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a4, pci_vendor_10a4, pci_ss_list_10a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a5, pci_vendor_10a5, pci_ss_list_10a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a6, pci_vendor_10a6, pci_ss_list_10a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a7, pci_vendor_10a7, pci_ss_list_10a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a8, pci_vendor_10a8, pci_ss_list_10a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10a9, pci_vendor_10a9, pci_ss_list_10a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10aa, pci_vendor_10aa, pci_ss_list_10aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ab, pci_vendor_10ab, pci_ss_list_10ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ac, pci_vendor_10ac, pci_ss_list_10ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ad, pci_vendor_10ad, pci_ss_list_10ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ae, pci_vendor_10ae, pci_ss_list_10ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10af, pci_vendor_10af, pci_ss_list_10af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b0, pci_vendor_10b0, pci_ss_list_10b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b1, pci_vendor_10b1, pci_ss_list_10b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b2, pci_vendor_10b2, pci_ss_list_10b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b3, pci_vendor_10b3, pci_ss_list_10b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b4, pci_vendor_10b4, pci_ss_list_10b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b5, pci_vendor_10b5, pci_ss_list_10b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b6, pci_vendor_10b6, pci_ss_list_10b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b7, pci_vendor_10b7, pci_ss_list_10b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b8, pci_vendor_10b8, pci_ss_list_10b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10b9, pci_vendor_10b9, pci_ss_list_10b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ba, pci_vendor_10ba, pci_ss_list_10ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bb, pci_vendor_10bb, pci_ss_list_10bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bc, pci_vendor_10bc, pci_ss_list_10bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bd, pci_vendor_10bd, pci_ss_list_10bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10be, pci_vendor_10be, pci_ss_list_10be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10bf, pci_vendor_10bf, pci_ss_list_10bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c0, pci_vendor_10c0, pci_ss_list_10c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c1, pci_vendor_10c1, pci_ss_list_10c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c2, pci_vendor_10c2, pci_ss_list_10c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c3, pci_vendor_10c3, pci_ss_list_10c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c4, pci_vendor_10c4, pci_ss_list_10c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c5, pci_vendor_10c5, pci_ss_list_10c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c6, pci_vendor_10c6, pci_ss_list_10c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c7, pci_vendor_10c7, pci_ss_list_10c7},
-#endif
- {0x10c8, pci_vendor_10c8, pci_ss_list_10c8},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10c9, pci_vendor_10c9, pci_ss_list_10c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ca, pci_vendor_10ca, pci_ss_list_10ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cb, pci_vendor_10cb, pci_ss_list_10cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cc, pci_vendor_10cc, pci_ss_list_10cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cd, pci_vendor_10cd, pci_ss_list_10cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ce, pci_vendor_10ce, pci_ss_list_10ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10cf, pci_vendor_10cf, pci_ss_list_10cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d0, pci_vendor_10d0, pci_ss_list_10d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d1, pci_vendor_10d1, pci_ss_list_10d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d2, pci_vendor_10d2, pci_ss_list_10d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d3, pci_vendor_10d3, pci_ss_list_10d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d4, pci_vendor_10d4, pci_ss_list_10d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d5, pci_vendor_10d5, pci_ss_list_10d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d6, pci_vendor_10d6, pci_ss_list_10d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d7, pci_vendor_10d7, pci_ss_list_10d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d8, pci_vendor_10d8, pci_ss_list_10d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10d9, pci_vendor_10d9, pci_ss_list_10d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10da, pci_vendor_10da, pci_ss_list_10da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10db, pci_vendor_10db, pci_ss_list_10db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10dc, pci_vendor_10dc, pci_ss_list_10dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10dd, pci_vendor_10dd, pci_ss_list_10dd},
-#endif
- {0x10de, pci_vendor_10de, pci_ss_list_10de},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10df, pci_vendor_10df, pci_ss_list_10df},
-#endif
- {0x10e0, pci_vendor_10e0, pci_ss_list_10e0},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e1, pci_vendor_10e1, pci_ss_list_10e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e2, pci_vendor_10e2, pci_ss_list_10e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e3, pci_vendor_10e3, pci_ss_list_10e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e4, pci_vendor_10e4, pci_ss_list_10e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e5, pci_vendor_10e5, pci_ss_list_10e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e6, pci_vendor_10e6, pci_ss_list_10e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e7, pci_vendor_10e7, pci_ss_list_10e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e8, pci_vendor_10e8, pci_ss_list_10e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10e9, pci_vendor_10e9, pci_ss_list_10e9},
-#endif
- {0x10ea, pci_vendor_10ea, pci_ss_list_10ea},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10eb, pci_vendor_10eb, pci_ss_list_10eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ec, pci_vendor_10ec, pci_ss_list_10ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ed, pci_vendor_10ed, pci_ss_list_10ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ee, pci_vendor_10ee, pci_ss_list_10ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ef, pci_vendor_10ef, pci_ss_list_10ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f0, pci_vendor_10f0, pci_ss_list_10f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f1, pci_vendor_10f1, pci_ss_list_10f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f2, pci_vendor_10f2, pci_ss_list_10f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f3, pci_vendor_10f3, pci_ss_list_10f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f4, pci_vendor_10f4, pci_ss_list_10f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f5, pci_vendor_10f5, pci_ss_list_10f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f6, pci_vendor_10f6, pci_ss_list_10f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f7, pci_vendor_10f7, pci_ss_list_10f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f8, pci_vendor_10f8, pci_ss_list_10f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10f9, pci_vendor_10f9, pci_ss_list_10f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fa, pci_vendor_10fa, pci_ss_list_10fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fb, pci_vendor_10fb, pci_ss_list_10fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fc, pci_vendor_10fc, pci_ss_list_10fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fd, pci_vendor_10fd, pci_ss_list_10fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10fe, pci_vendor_10fe, pci_ss_list_10fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x10ff, pci_vendor_10ff, pci_ss_list_10ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1100, pci_vendor_1100, pci_ss_list_1100},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1101, pci_vendor_1101, pci_ss_list_1101},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1102, pci_vendor_1102, pci_ss_list_1102},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1103, pci_vendor_1103, pci_ss_list_1103},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1104, pci_vendor_1104, pci_ss_list_1104},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1105, pci_vendor_1105, pci_ss_list_1105},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1106, pci_vendor_1106, pci_ss_list_1106},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1107, pci_vendor_1107, pci_ss_list_1107},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1108, pci_vendor_1108, pci_ss_list_1108},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1109, pci_vendor_1109, pci_ss_list_1109},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110a, pci_vendor_110a, pci_ss_list_110a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110b, pci_vendor_110b, pci_ss_list_110b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110c, pci_vendor_110c, pci_ss_list_110c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110d, pci_vendor_110d, pci_ss_list_110d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110e, pci_vendor_110e, pci_ss_list_110e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x110f, pci_vendor_110f, pci_ss_list_110f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1110, pci_vendor_1110, pci_ss_list_1110},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1111, pci_vendor_1111, pci_ss_list_1111},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1112, pci_vendor_1112, pci_ss_list_1112},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1113, pci_vendor_1113, pci_ss_list_1113},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1114, pci_vendor_1114, pci_ss_list_1114},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1115, pci_vendor_1115, pci_ss_list_1115},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1116, pci_vendor_1116, pci_ss_list_1116},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1117, pci_vendor_1117, pci_ss_list_1117},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1118, pci_vendor_1118, pci_ss_list_1118},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1119, pci_vendor_1119, pci_ss_list_1119},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111a, pci_vendor_111a, pci_ss_list_111a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111b, pci_vendor_111b, pci_ss_list_111b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111c, pci_vendor_111c, pci_ss_list_111c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111d, pci_vendor_111d, pci_ss_list_111d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111e, pci_vendor_111e, pci_ss_list_111e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x111f, pci_vendor_111f, pci_ss_list_111f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1120, pci_vendor_1120, pci_ss_list_1120},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1121, pci_vendor_1121, pci_ss_list_1121},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1122, pci_vendor_1122, pci_ss_list_1122},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1123, pci_vendor_1123, pci_ss_list_1123},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1124, pci_vendor_1124, pci_ss_list_1124},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1125, pci_vendor_1125, pci_ss_list_1125},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1126, pci_vendor_1126, pci_ss_list_1126},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1127, pci_vendor_1127, pci_ss_list_1127},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1129, pci_vendor_1129, pci_ss_list_1129},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112a, pci_vendor_112a, pci_ss_list_112a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112b, pci_vendor_112b, pci_ss_list_112b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112c, pci_vendor_112c, pci_ss_list_112c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112d, pci_vendor_112d, pci_ss_list_112d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112e, pci_vendor_112e, pci_ss_list_112e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x112f, pci_vendor_112f, pci_ss_list_112f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1130, pci_vendor_1130, pci_ss_list_1130},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1131, pci_vendor_1131, pci_ss_list_1131},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1132, pci_vendor_1132, pci_ss_list_1132},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1133, pci_vendor_1133, pci_ss_list_1133},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1134, pci_vendor_1134, pci_ss_list_1134},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1135, pci_vendor_1135, pci_ss_list_1135},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1136, pci_vendor_1136, pci_ss_list_1136},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1137, pci_vendor_1137, pci_ss_list_1137},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1138, pci_vendor_1138, pci_ss_list_1138},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1139, pci_vendor_1139, pci_ss_list_1139},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113a, pci_vendor_113a, pci_ss_list_113a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113b, pci_vendor_113b, pci_ss_list_113b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113c, pci_vendor_113c, pci_ss_list_113c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113d, pci_vendor_113d, pci_ss_list_113d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113e, pci_vendor_113e, pci_ss_list_113e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x113f, pci_vendor_113f, pci_ss_list_113f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1140, pci_vendor_1140, pci_ss_list_1140},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1141, pci_vendor_1141, pci_ss_list_1141},
-#endif
- {0x1142, pci_vendor_1142, pci_ss_list_1142},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1143, pci_vendor_1143, pci_ss_list_1143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1144, pci_vendor_1144, pci_ss_list_1144},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1145, pci_vendor_1145, pci_ss_list_1145},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1146, pci_vendor_1146, pci_ss_list_1146},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1147, pci_vendor_1147, pci_ss_list_1147},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1148, pci_vendor_1148, pci_ss_list_1148},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1149, pci_vendor_1149, pci_ss_list_1149},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114a, pci_vendor_114a, pci_ss_list_114a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114b, pci_vendor_114b, pci_ss_list_114b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114c, pci_vendor_114c, pci_ss_list_114c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114d, pci_vendor_114d, pci_ss_list_114d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114e, pci_vendor_114e, pci_ss_list_114e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x114f, pci_vendor_114f, pci_ss_list_114f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1150, pci_vendor_1150, pci_ss_list_1150},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1151, pci_vendor_1151, pci_ss_list_1151},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1152, pci_vendor_1152, pci_ss_list_1152},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1153, pci_vendor_1153, pci_ss_list_1153},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1154, pci_vendor_1154, pci_ss_list_1154},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1155, pci_vendor_1155, pci_ss_list_1155},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1156, pci_vendor_1156, pci_ss_list_1156},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1157, pci_vendor_1157, pci_ss_list_1157},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1158, pci_vendor_1158, pci_ss_list_1158},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1159, pci_vendor_1159, pci_ss_list_1159},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115a, pci_vendor_115a, pci_ss_list_115a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115b, pci_vendor_115b, pci_ss_list_115b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115c, pci_vendor_115c, pci_ss_list_115c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115d, pci_vendor_115d, pci_ss_list_115d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115e, pci_vendor_115e, pci_ss_list_115e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x115f, pci_vendor_115f, pci_ss_list_115f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1160, pci_vendor_1160, pci_ss_list_1160},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1161, pci_vendor_1161, pci_ss_list_1161},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1162, pci_vendor_1162, pci_ss_list_1162},
-#endif
- {0x1163, pci_vendor_1163, pci_ss_list_1163},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1164, pci_vendor_1164, pci_ss_list_1164},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1165, pci_vendor_1165, pci_ss_list_1165},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1166, pci_vendor_1166, pci_ss_list_1166},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1167, pci_vendor_1167, pci_ss_list_1167},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1168, pci_vendor_1168, pci_ss_list_1168},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1169, pci_vendor_1169, pci_ss_list_1169},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116a, pci_vendor_116a, pci_ss_list_116a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116b, pci_vendor_116b, pci_ss_list_116b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116c, pci_vendor_116c, pci_ss_list_116c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116d, pci_vendor_116d, pci_ss_list_116d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116e, pci_vendor_116e, pci_ss_list_116e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x116f, pci_vendor_116f, pci_ss_list_116f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1170, pci_vendor_1170, pci_ss_list_1170},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1171, pci_vendor_1171, pci_ss_list_1171},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1172, pci_vendor_1172, pci_ss_list_1172},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1173, pci_vendor_1173, pci_ss_list_1173},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1174, pci_vendor_1174, pci_ss_list_1174},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1175, pci_vendor_1175, pci_ss_list_1175},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1176, pci_vendor_1176, pci_ss_list_1176},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1177, pci_vendor_1177, pci_ss_list_1177},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1178, pci_vendor_1178, pci_ss_list_1178},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1179, pci_vendor_1179, pci_ss_list_1179},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117a, pci_vendor_117a, pci_ss_list_117a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117b, pci_vendor_117b, pci_ss_list_117b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117c, pci_vendor_117c, pci_ss_list_117c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117d, pci_vendor_117d, pci_ss_list_117d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117e, pci_vendor_117e, pci_ss_list_117e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x117f, pci_vendor_117f, pci_ss_list_117f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1180, pci_vendor_1180, pci_ss_list_1180},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1181, pci_vendor_1181, pci_ss_list_1181},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1183, pci_vendor_1183, pci_ss_list_1183},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1184, pci_vendor_1184, pci_ss_list_1184},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1185, pci_vendor_1185, pci_ss_list_1185},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1186, pci_vendor_1186, pci_ss_list_1186},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1187, pci_vendor_1187, pci_ss_list_1187},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1188, pci_vendor_1188, pci_ss_list_1188},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1189, pci_vendor_1189, pci_ss_list_1189},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118a, pci_vendor_118a, pci_ss_list_118a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118b, pci_vendor_118b, pci_ss_list_118b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118c, pci_vendor_118c, pci_ss_list_118c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118d, pci_vendor_118d, pci_ss_list_118d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118e, pci_vendor_118e, pci_ss_list_118e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x118f, pci_vendor_118f, pci_ss_list_118f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1190, pci_vendor_1190, pci_ss_list_1190},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1191, pci_vendor_1191, pci_ss_list_1191},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1192, pci_vendor_1192, pci_ss_list_1192},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1193, pci_vendor_1193, pci_ss_list_1193},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1194, pci_vendor_1194, pci_ss_list_1194},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1195, pci_vendor_1195, pci_ss_list_1195},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1196, pci_vendor_1196, pci_ss_list_1196},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1197, pci_vendor_1197, pci_ss_list_1197},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1198, pci_vendor_1198, pci_ss_list_1198},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1199, pci_vendor_1199, pci_ss_list_1199},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119a, pci_vendor_119a, pci_ss_list_119a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119b, pci_vendor_119b, pci_ss_list_119b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119c, pci_vendor_119c, pci_ss_list_119c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119d, pci_vendor_119d, pci_ss_list_119d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119e, pci_vendor_119e, pci_ss_list_119e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x119f, pci_vendor_119f, pci_ss_list_119f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a0, pci_vendor_11a0, pci_ss_list_11a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a1, pci_vendor_11a1, pci_ss_list_11a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a2, pci_vendor_11a2, pci_ss_list_11a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a3, pci_vendor_11a3, pci_ss_list_11a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a4, pci_vendor_11a4, pci_ss_list_11a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a5, pci_vendor_11a5, pci_ss_list_11a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a6, pci_vendor_11a6, pci_ss_list_11a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a7, pci_vendor_11a7, pci_ss_list_11a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a8, pci_vendor_11a8, pci_ss_list_11a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11a9, pci_vendor_11a9, pci_ss_list_11a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11aa, pci_vendor_11aa, pci_ss_list_11aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ab, pci_vendor_11ab, pci_ss_list_11ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ac, pci_vendor_11ac, pci_ss_list_11ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ad, pci_vendor_11ad, pci_ss_list_11ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ae, pci_vendor_11ae, pci_ss_list_11ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11af, pci_vendor_11af, pci_ss_list_11af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b0, pci_vendor_11b0, pci_ss_list_11b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b1, pci_vendor_11b1, pci_ss_list_11b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b2, pci_vendor_11b2, pci_ss_list_11b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b3, pci_vendor_11b3, pci_ss_list_11b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b4, pci_vendor_11b4, pci_ss_list_11b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b5, pci_vendor_11b5, pci_ss_list_11b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b6, pci_vendor_11b6, pci_ss_list_11b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b7, pci_vendor_11b7, pci_ss_list_11b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b8, pci_vendor_11b8, pci_ss_list_11b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11b9, pci_vendor_11b9, pci_ss_list_11b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ba, pci_vendor_11ba, pci_ss_list_11ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bb, pci_vendor_11bb, pci_ss_list_11bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bc, pci_vendor_11bc, pci_ss_list_11bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bd, pci_vendor_11bd, pci_ss_list_11bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11be, pci_vendor_11be, pci_ss_list_11be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11bf, pci_vendor_11bf, pci_ss_list_11bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c0, pci_vendor_11c0, pci_ss_list_11c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c1, pci_vendor_11c1, pci_ss_list_11c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c2, pci_vendor_11c2, pci_ss_list_11c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c3, pci_vendor_11c3, pci_ss_list_11c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c4, pci_vendor_11c4, pci_ss_list_11c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c5, pci_vendor_11c5, pci_ss_list_11c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c6, pci_vendor_11c6, pci_ss_list_11c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c7, pci_vendor_11c7, pci_ss_list_11c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c8, pci_vendor_11c8, pci_ss_list_11c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11c9, pci_vendor_11c9, pci_ss_list_11c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ca, pci_vendor_11ca, pci_ss_list_11ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cb, pci_vendor_11cb, pci_ss_list_11cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cc, pci_vendor_11cc, pci_ss_list_11cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cd, pci_vendor_11cd, pci_ss_list_11cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ce, pci_vendor_11ce, pci_ss_list_11ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11cf, pci_vendor_11cf, pci_ss_list_11cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d0, pci_vendor_11d0, pci_ss_list_11d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d1, pci_vendor_11d1, pci_ss_list_11d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d2, pci_vendor_11d2, pci_ss_list_11d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d3, pci_vendor_11d3, pci_ss_list_11d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d4, pci_vendor_11d4, pci_ss_list_11d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d5, pci_vendor_11d5, pci_ss_list_11d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d6, pci_vendor_11d6, pci_ss_list_11d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d7, pci_vendor_11d7, pci_ss_list_11d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d8, pci_vendor_11d8, pci_ss_list_11d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11d9, pci_vendor_11d9, pci_ss_list_11d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11da, pci_vendor_11da, pci_ss_list_11da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11db, pci_vendor_11db, pci_ss_list_11db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11dc, pci_vendor_11dc, pci_ss_list_11dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11dd, pci_vendor_11dd, pci_ss_list_11dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11de, pci_vendor_11de, pci_ss_list_11de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11df, pci_vendor_11df, pci_ss_list_11df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e0, pci_vendor_11e0, pci_ss_list_11e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e1, pci_vendor_11e1, pci_ss_list_11e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e2, pci_vendor_11e2, pci_ss_list_11e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e3, pci_vendor_11e3, pci_ss_list_11e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e4, pci_vendor_11e4, pci_ss_list_11e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e5, pci_vendor_11e5, pci_ss_list_11e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e6, pci_vendor_11e6, pci_ss_list_11e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e7, pci_vendor_11e7, pci_ss_list_11e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e8, pci_vendor_11e8, pci_ss_list_11e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11e9, pci_vendor_11e9, pci_ss_list_11e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ea, pci_vendor_11ea, pci_ss_list_11ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11eb, pci_vendor_11eb, pci_ss_list_11eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ec, pci_vendor_11ec, pci_ss_list_11ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ed, pci_vendor_11ed, pci_ss_list_11ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ee, pci_vendor_11ee, pci_ss_list_11ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ef, pci_vendor_11ef, pci_ss_list_11ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f0, pci_vendor_11f0, pci_ss_list_11f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f1, pci_vendor_11f1, pci_ss_list_11f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f2, pci_vendor_11f2, pci_ss_list_11f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f3, pci_vendor_11f3, pci_ss_list_11f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f4, pci_vendor_11f4, pci_ss_list_11f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f5, pci_vendor_11f5, pci_ss_list_11f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f6, pci_vendor_11f6, pci_ss_list_11f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f7, pci_vendor_11f7, pci_ss_list_11f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f8, pci_vendor_11f8, pci_ss_list_11f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11f9, pci_vendor_11f9, pci_ss_list_11f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fa, pci_vendor_11fa, pci_ss_list_11fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fb, pci_vendor_11fb, pci_ss_list_11fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fc, pci_vendor_11fc, pci_ss_list_11fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fd, pci_vendor_11fd, pci_ss_list_11fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11fe, pci_vendor_11fe, pci_ss_list_11fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x11ff, pci_vendor_11ff, pci_ss_list_11ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1200, pci_vendor_1200, pci_ss_list_1200},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1201, pci_vendor_1201, pci_ss_list_1201},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1202, pci_vendor_1202, pci_ss_list_1202},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1203, pci_vendor_1203, pci_ss_list_1203},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1204, pci_vendor_1204, pci_ss_list_1204},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1205, pci_vendor_1205, pci_ss_list_1205},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1206, pci_vendor_1206, pci_ss_list_1206},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1208, pci_vendor_1208, pci_ss_list_1208},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1209, pci_vendor_1209, pci_ss_list_1209},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120a, pci_vendor_120a, pci_ss_list_120a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120b, pci_vendor_120b, pci_ss_list_120b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120c, pci_vendor_120c, pci_ss_list_120c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120d, pci_vendor_120d, pci_ss_list_120d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120e, pci_vendor_120e, pci_ss_list_120e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x120f, pci_vendor_120f, pci_ss_list_120f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1210, pci_vendor_1210, pci_ss_list_1210},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1211, pci_vendor_1211, pci_ss_list_1211},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1212, pci_vendor_1212, pci_ss_list_1212},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1213, pci_vendor_1213, pci_ss_list_1213},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1214, pci_vendor_1214, pci_ss_list_1214},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1215, pci_vendor_1215, pci_ss_list_1215},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1216, pci_vendor_1216, pci_ss_list_1216},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1217, pci_vendor_1217, pci_ss_list_1217},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1218, pci_vendor_1218, pci_ss_list_1218},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1219, pci_vendor_1219, pci_ss_list_1219},
-#endif
- {0x121a, pci_vendor_121a, pci_ss_list_121a},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121b, pci_vendor_121b, pci_ss_list_121b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121c, pci_vendor_121c, pci_ss_list_121c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121d, pci_vendor_121d, pci_ss_list_121d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121e, pci_vendor_121e, pci_ss_list_121e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x121f, pci_vendor_121f, pci_ss_list_121f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1220, pci_vendor_1220, pci_ss_list_1220},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1221, pci_vendor_1221, pci_ss_list_1221},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1222, pci_vendor_1222, pci_ss_list_1222},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1223, pci_vendor_1223, pci_ss_list_1223},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1224, pci_vendor_1224, pci_ss_list_1224},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1225, pci_vendor_1225, pci_ss_list_1225},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1227, pci_vendor_1227, pci_ss_list_1227},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1228, pci_vendor_1228, pci_ss_list_1228},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1229, pci_vendor_1229, pci_ss_list_1229},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122a, pci_vendor_122a, pci_ss_list_122a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122b, pci_vendor_122b, pci_ss_list_122b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122c, pci_vendor_122c, pci_ss_list_122c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122d, pci_vendor_122d, pci_ss_list_122d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122e, pci_vendor_122e, pci_ss_list_122e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x122f, pci_vendor_122f, pci_ss_list_122f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1230, pci_vendor_1230, pci_ss_list_1230},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1231, pci_vendor_1231, pci_ss_list_1231},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1232, pci_vendor_1232, pci_ss_list_1232},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1233, pci_vendor_1233, pci_ss_list_1233},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1234, pci_vendor_1234, pci_ss_list_1234},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1235, pci_vendor_1235, pci_ss_list_1235},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1236, pci_vendor_1236, pci_ss_list_1236},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1237, pci_vendor_1237, pci_ss_list_1237},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1238, pci_vendor_1238, pci_ss_list_1238},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1239, pci_vendor_1239, pci_ss_list_1239},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123a, pci_vendor_123a, pci_ss_list_123a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123b, pci_vendor_123b, pci_ss_list_123b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123c, pci_vendor_123c, pci_ss_list_123c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123d, pci_vendor_123d, pci_ss_list_123d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123e, pci_vendor_123e, pci_ss_list_123e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x123f, pci_vendor_123f, pci_ss_list_123f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1240, pci_vendor_1240, pci_ss_list_1240},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1241, pci_vendor_1241, pci_ss_list_1241},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1242, pci_vendor_1242, pci_ss_list_1242},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1243, pci_vendor_1243, pci_ss_list_1243},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1244, pci_vendor_1244, pci_ss_list_1244},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1245, pci_vendor_1245, pci_ss_list_1245},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1246, pci_vendor_1246, pci_ss_list_1246},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1247, pci_vendor_1247, pci_ss_list_1247},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1248, pci_vendor_1248, pci_ss_list_1248},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1249, pci_vendor_1249, pci_ss_list_1249},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124a, pci_vendor_124a, pci_ss_list_124a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124b, pci_vendor_124b, pci_ss_list_124b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124c, pci_vendor_124c, pci_ss_list_124c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124d, pci_vendor_124d, pci_ss_list_124d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124e, pci_vendor_124e, pci_ss_list_124e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x124f, pci_vendor_124f, pci_ss_list_124f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1250, pci_vendor_1250, pci_ss_list_1250},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1251, pci_vendor_1251, pci_ss_list_1251},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1253, pci_vendor_1253, pci_ss_list_1253},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1254, pci_vendor_1254, pci_ss_list_1254},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1255, pci_vendor_1255, pci_ss_list_1255},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1256, pci_vendor_1256, pci_ss_list_1256},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1257, pci_vendor_1257, pci_ss_list_1257},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1258, pci_vendor_1258, pci_ss_list_1258},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1259, pci_vendor_1259, pci_ss_list_1259},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125a, pci_vendor_125a, pci_ss_list_125a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125b, pci_vendor_125b, pci_ss_list_125b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125c, pci_vendor_125c, pci_ss_list_125c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125d, pci_vendor_125d, pci_ss_list_125d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125e, pci_vendor_125e, pci_ss_list_125e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x125f, pci_vendor_125f, pci_ss_list_125f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1260, pci_vendor_1260, pci_ss_list_1260},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1261, pci_vendor_1261, pci_ss_list_1261},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1262, pci_vendor_1262, pci_ss_list_1262},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1263, pci_vendor_1263, pci_ss_list_1263},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1264, pci_vendor_1264, pci_ss_list_1264},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1265, pci_vendor_1265, pci_ss_list_1265},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1266, pci_vendor_1266, pci_ss_list_1266},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1267, pci_vendor_1267, pci_ss_list_1267},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1268, pci_vendor_1268, pci_ss_list_1268},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1269, pci_vendor_1269, pci_ss_list_1269},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126a, pci_vendor_126a, pci_ss_list_126a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126b, pci_vendor_126b, pci_ss_list_126b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126c, pci_vendor_126c, pci_ss_list_126c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126d, pci_vendor_126d, pci_ss_list_126d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x126e, pci_vendor_126e, pci_ss_list_126e},
-#endif
- {0x126f, pci_vendor_126f, pci_ss_list_126f},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1270, pci_vendor_1270, pci_ss_list_1270},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1271, pci_vendor_1271, pci_ss_list_1271},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1272, pci_vendor_1272, pci_ss_list_1272},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1273, pci_vendor_1273, pci_ss_list_1273},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1274, pci_vendor_1274, pci_ss_list_1274},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1275, pci_vendor_1275, pci_ss_list_1275},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1276, pci_vendor_1276, pci_ss_list_1276},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1277, pci_vendor_1277, pci_ss_list_1277},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1278, pci_vendor_1278, pci_ss_list_1278},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1279, pci_vendor_1279, pci_ss_list_1279},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127a, pci_vendor_127a, pci_ss_list_127a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127b, pci_vendor_127b, pci_ss_list_127b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127c, pci_vendor_127c, pci_ss_list_127c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127d, pci_vendor_127d, pci_ss_list_127d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127e, pci_vendor_127e, pci_ss_list_127e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x127f, pci_vendor_127f, pci_ss_list_127f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1280, pci_vendor_1280, pci_ss_list_1280},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1281, pci_vendor_1281, pci_ss_list_1281},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1282, pci_vendor_1282, pci_ss_list_1282},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1283, pci_vendor_1283, pci_ss_list_1283},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1284, pci_vendor_1284, pci_ss_list_1284},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1285, pci_vendor_1285, pci_ss_list_1285},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1286, pci_vendor_1286, pci_ss_list_1286},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1287, pci_vendor_1287, pci_ss_list_1287},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1288, pci_vendor_1288, pci_ss_list_1288},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1289, pci_vendor_1289, pci_ss_list_1289},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128a, pci_vendor_128a, pci_ss_list_128a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128b, pci_vendor_128b, pci_ss_list_128b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128c, pci_vendor_128c, pci_ss_list_128c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128d, pci_vendor_128d, pci_ss_list_128d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128e, pci_vendor_128e, pci_ss_list_128e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x128f, pci_vendor_128f, pci_ss_list_128f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1290, pci_vendor_1290, pci_ss_list_1290},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1291, pci_vendor_1291, pci_ss_list_1291},
-#endif
- {0x1292, pci_vendor_1292, pci_ss_list_1292},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1293, pci_vendor_1293, pci_ss_list_1293},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1294, pci_vendor_1294, pci_ss_list_1294},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1295, pci_vendor_1295, pci_ss_list_1295},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1296, pci_vendor_1296, pci_ss_list_1296},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1297, pci_vendor_1297, pci_ss_list_1297},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1298, pci_vendor_1298, pci_ss_list_1298},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1299, pci_vendor_1299, pci_ss_list_1299},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129a, pci_vendor_129a, pci_ss_list_129a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129b, pci_vendor_129b, pci_ss_list_129b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129c, pci_vendor_129c, pci_ss_list_129c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129d, pci_vendor_129d, pci_ss_list_129d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129e, pci_vendor_129e, pci_ss_list_129e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x129f, pci_vendor_129f, pci_ss_list_129f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a0, pci_vendor_12a0, pci_ss_list_12a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a1, pci_vendor_12a1, pci_ss_list_12a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a2, pci_vendor_12a2, pci_ss_list_12a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a3, pci_vendor_12a3, pci_ss_list_12a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a4, pci_vendor_12a4, pci_ss_list_12a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a5, pci_vendor_12a5, pci_ss_list_12a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a6, pci_vendor_12a6, pci_ss_list_12a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a7, pci_vendor_12a7, pci_ss_list_12a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a8, pci_vendor_12a8, pci_ss_list_12a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12a9, pci_vendor_12a9, pci_ss_list_12a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12aa, pci_vendor_12aa, pci_ss_list_12aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ab, pci_vendor_12ab, pci_ss_list_12ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ac, pci_vendor_12ac, pci_ss_list_12ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ad, pci_vendor_12ad, pci_ss_list_12ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ae, pci_vendor_12ae, pci_ss_list_12ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12af, pci_vendor_12af, pci_ss_list_12af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b0, pci_vendor_12b0, pci_ss_list_12b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b1, pci_vendor_12b1, pci_ss_list_12b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b2, pci_vendor_12b2, pci_ss_list_12b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b3, pci_vendor_12b3, pci_ss_list_12b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b4, pci_vendor_12b4, pci_ss_list_12b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b5, pci_vendor_12b5, pci_ss_list_12b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b6, pci_vendor_12b6, pci_ss_list_12b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b7, pci_vendor_12b7, pci_ss_list_12b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b8, pci_vendor_12b8, pci_ss_list_12b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12b9, pci_vendor_12b9, pci_ss_list_12b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ba, pci_vendor_12ba, pci_ss_list_12ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bb, pci_vendor_12bb, pci_ss_list_12bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bc, pci_vendor_12bc, pci_ss_list_12bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bd, pci_vendor_12bd, pci_ss_list_12bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12be, pci_vendor_12be, pci_ss_list_12be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12bf, pci_vendor_12bf, pci_ss_list_12bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c0, pci_vendor_12c0, pci_ss_list_12c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c1, pci_vendor_12c1, pci_ss_list_12c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c2, pci_vendor_12c2, pci_ss_list_12c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c3, pci_vendor_12c3, pci_ss_list_12c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c4, pci_vendor_12c4, pci_ss_list_12c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c5, pci_vendor_12c5, pci_ss_list_12c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c6, pci_vendor_12c6, pci_ss_list_12c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c7, pci_vendor_12c7, pci_ss_list_12c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c8, pci_vendor_12c8, pci_ss_list_12c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12c9, pci_vendor_12c9, pci_ss_list_12c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ca, pci_vendor_12ca, pci_ss_list_12ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cb, pci_vendor_12cb, pci_ss_list_12cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cc, pci_vendor_12cc, pci_ss_list_12cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cd, pci_vendor_12cd, pci_ss_list_12cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ce, pci_vendor_12ce, pci_ss_list_12ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12cf, pci_vendor_12cf, pci_ss_list_12cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d0, pci_vendor_12d0, pci_ss_list_12d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d1, pci_vendor_12d1, pci_ss_list_12d1},
-#endif
- {0x12d2, pci_vendor_12d2, pci_ss_list_12d2},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d3, pci_vendor_12d3, pci_ss_list_12d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d4, pci_vendor_12d4, pci_ss_list_12d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d5, pci_vendor_12d5, pci_ss_list_12d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d6, pci_vendor_12d6, pci_ss_list_12d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d7, pci_vendor_12d7, pci_ss_list_12d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d8, pci_vendor_12d8, pci_ss_list_12d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12d9, pci_vendor_12d9, pci_ss_list_12d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12da, pci_vendor_12da, pci_ss_list_12da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12db, pci_vendor_12db, pci_ss_list_12db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12dc, pci_vendor_12dc, pci_ss_list_12dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12dd, pci_vendor_12dd, pci_ss_list_12dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12de, pci_vendor_12de, pci_ss_list_12de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12df, pci_vendor_12df, pci_ss_list_12df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e0, pci_vendor_12e0, pci_ss_list_12e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e1, pci_vendor_12e1, pci_ss_list_12e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e2, pci_vendor_12e2, pci_ss_list_12e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e3, pci_vendor_12e3, pci_ss_list_12e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e4, pci_vendor_12e4, pci_ss_list_12e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e5, pci_vendor_12e5, pci_ss_list_12e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e6, pci_vendor_12e6, pci_ss_list_12e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e7, pci_vendor_12e7, pci_ss_list_12e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e8, pci_vendor_12e8, pci_ss_list_12e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12e9, pci_vendor_12e9, pci_ss_list_12e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ea, pci_vendor_12ea, pci_ss_list_12ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12eb, pci_vendor_12eb, pci_ss_list_12eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ec, pci_vendor_12ec, pci_ss_list_12ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ed, pci_vendor_12ed, pci_ss_list_12ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ee, pci_vendor_12ee, pci_ss_list_12ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ef, pci_vendor_12ef, pci_ss_list_12ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f0, pci_vendor_12f0, pci_ss_list_12f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f1, pci_vendor_12f1, pci_ss_list_12f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f2, pci_vendor_12f2, pci_ss_list_12f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f3, pci_vendor_12f3, pci_ss_list_12f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f4, pci_vendor_12f4, pci_ss_list_12f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f5, pci_vendor_12f5, pci_ss_list_12f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f6, pci_vendor_12f6, pci_ss_list_12f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f7, pci_vendor_12f7, pci_ss_list_12f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f8, pci_vendor_12f8, pci_ss_list_12f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12f9, pci_vendor_12f9, pci_ss_list_12f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fb, pci_vendor_12fb, pci_ss_list_12fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fc, pci_vendor_12fc, pci_ss_list_12fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fd, pci_vendor_12fd, pci_ss_list_12fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12fe, pci_vendor_12fe, pci_ss_list_12fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x12ff, pci_vendor_12ff, pci_ss_list_12ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1300, pci_vendor_1300, pci_ss_list_1300},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1302, pci_vendor_1302, pci_ss_list_1302},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1303, pci_vendor_1303, pci_ss_list_1303},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1304, pci_vendor_1304, pci_ss_list_1304},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1305, pci_vendor_1305, pci_ss_list_1305},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1306, pci_vendor_1306, pci_ss_list_1306},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1307, pci_vendor_1307, pci_ss_list_1307},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1308, pci_vendor_1308, pci_ss_list_1308},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1309, pci_vendor_1309, pci_ss_list_1309},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130a, pci_vendor_130a, pci_ss_list_130a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130b, pci_vendor_130b, pci_ss_list_130b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130c, pci_vendor_130c, pci_ss_list_130c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130d, pci_vendor_130d, pci_ss_list_130d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130e, pci_vendor_130e, pci_ss_list_130e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x130f, pci_vendor_130f, pci_ss_list_130f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1310, pci_vendor_1310, pci_ss_list_1310},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1311, pci_vendor_1311, pci_ss_list_1311},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1312, pci_vendor_1312, pci_ss_list_1312},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1313, pci_vendor_1313, pci_ss_list_1313},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1316, pci_vendor_1316, pci_ss_list_1316},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1317, pci_vendor_1317, pci_ss_list_1317},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1318, pci_vendor_1318, pci_ss_list_1318},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1319, pci_vendor_1319, pci_ss_list_1319},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131a, pci_vendor_131a, pci_ss_list_131a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131c, pci_vendor_131c, pci_ss_list_131c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131d, pci_vendor_131d, pci_ss_list_131d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131e, pci_vendor_131e, pci_ss_list_131e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x131f, pci_vendor_131f, pci_ss_list_131f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1320, pci_vendor_1320, pci_ss_list_1320},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1321, pci_vendor_1321, pci_ss_list_1321},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1322, pci_vendor_1322, pci_ss_list_1322},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1323, pci_vendor_1323, pci_ss_list_1323},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1324, pci_vendor_1324, pci_ss_list_1324},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1325, pci_vendor_1325, pci_ss_list_1325},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1326, pci_vendor_1326, pci_ss_list_1326},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1327, pci_vendor_1327, pci_ss_list_1327},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1328, pci_vendor_1328, pci_ss_list_1328},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1329, pci_vendor_1329, pci_ss_list_1329},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132a, pci_vendor_132a, pci_ss_list_132a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132b, pci_vendor_132b, pci_ss_list_132b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132c, pci_vendor_132c, pci_ss_list_132c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x132d, pci_vendor_132d, pci_ss_list_132d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1330, pci_vendor_1330, pci_ss_list_1330},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1331, pci_vendor_1331, pci_ss_list_1331},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1332, pci_vendor_1332, pci_ss_list_1332},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1334, pci_vendor_1334, pci_ss_list_1334},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1335, pci_vendor_1335, pci_ss_list_1335},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1337, pci_vendor_1337, pci_ss_list_1337},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1338, pci_vendor_1338, pci_ss_list_1338},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133a, pci_vendor_133a, pci_ss_list_133a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133b, pci_vendor_133b, pci_ss_list_133b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133c, pci_vendor_133c, pci_ss_list_133c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133d, pci_vendor_133d, pci_ss_list_133d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133e, pci_vendor_133e, pci_ss_list_133e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x133f, pci_vendor_133f, pci_ss_list_133f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1340, pci_vendor_1340, pci_ss_list_1340},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1341, pci_vendor_1341, pci_ss_list_1341},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1342, pci_vendor_1342, pci_ss_list_1342},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1343, pci_vendor_1343, pci_ss_list_1343},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1344, pci_vendor_1344, pci_ss_list_1344},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1345, pci_vendor_1345, pci_ss_list_1345},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1347, pci_vendor_1347, pci_ss_list_1347},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1349, pci_vendor_1349, pci_ss_list_1349},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134a, pci_vendor_134a, pci_ss_list_134a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134b, pci_vendor_134b, pci_ss_list_134b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134c, pci_vendor_134c, pci_ss_list_134c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134d, pci_vendor_134d, pci_ss_list_134d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134e, pci_vendor_134e, pci_ss_list_134e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x134f, pci_vendor_134f, pci_ss_list_134f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1350, pci_vendor_1350, pci_ss_list_1350},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1351, pci_vendor_1351, pci_ss_list_1351},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1353, pci_vendor_1353, pci_ss_list_1353},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1354, pci_vendor_1354, pci_ss_list_1354},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1355, pci_vendor_1355, pci_ss_list_1355},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1356, pci_vendor_1356, pci_ss_list_1356},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1359, pci_vendor_1359, pci_ss_list_1359},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135a, pci_vendor_135a, pci_ss_list_135a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135b, pci_vendor_135b, pci_ss_list_135b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135c, pci_vendor_135c, pci_ss_list_135c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135d, pci_vendor_135d, pci_ss_list_135d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135e, pci_vendor_135e, pci_ss_list_135e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x135f, pci_vendor_135f, pci_ss_list_135f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1360, pci_vendor_1360, pci_ss_list_1360},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1361, pci_vendor_1361, pci_ss_list_1361},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1362, pci_vendor_1362, pci_ss_list_1362},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1363, pci_vendor_1363, pci_ss_list_1363},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1364, pci_vendor_1364, pci_ss_list_1364},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1365, pci_vendor_1365, pci_ss_list_1365},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1366, pci_vendor_1366, pci_ss_list_1366},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1367, pci_vendor_1367, pci_ss_list_1367},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1368, pci_vendor_1368, pci_ss_list_1368},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1369, pci_vendor_1369, pci_ss_list_1369},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136a, pci_vendor_136a, pci_ss_list_136a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136b, pci_vendor_136b, pci_ss_list_136b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136c, pci_vendor_136c, pci_ss_list_136c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136d, pci_vendor_136d, pci_ss_list_136d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x136f, pci_vendor_136f, pci_ss_list_136f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1370, pci_vendor_1370, pci_ss_list_1370},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1371, pci_vendor_1371, pci_ss_list_1371},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1373, pci_vendor_1373, pci_ss_list_1373},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1374, pci_vendor_1374, pci_ss_list_1374},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1375, pci_vendor_1375, pci_ss_list_1375},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1376, pci_vendor_1376, pci_ss_list_1376},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1377, pci_vendor_1377, pci_ss_list_1377},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1378, pci_vendor_1378, pci_ss_list_1378},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1379, pci_vendor_1379, pci_ss_list_1379},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137a, pci_vendor_137a, pci_ss_list_137a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137b, pci_vendor_137b, pci_ss_list_137b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137c, pci_vendor_137c, pci_ss_list_137c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137d, pci_vendor_137d, pci_ss_list_137d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137e, pci_vendor_137e, pci_ss_list_137e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x137f, pci_vendor_137f, pci_ss_list_137f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1380, pci_vendor_1380, pci_ss_list_1380},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1381, pci_vendor_1381, pci_ss_list_1381},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1382, pci_vendor_1382, pci_ss_list_1382},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1383, pci_vendor_1383, pci_ss_list_1383},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1384, pci_vendor_1384, pci_ss_list_1384},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1385, pci_vendor_1385, pci_ss_list_1385},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1386, pci_vendor_1386, pci_ss_list_1386},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1387, pci_vendor_1387, pci_ss_list_1387},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1388, pci_vendor_1388, pci_ss_list_1388},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1389, pci_vendor_1389, pci_ss_list_1389},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138a, pci_vendor_138a, pci_ss_list_138a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138b, pci_vendor_138b, pci_ss_list_138b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138c, pci_vendor_138c, pci_ss_list_138c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138d, pci_vendor_138d, pci_ss_list_138d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138e, pci_vendor_138e, pci_ss_list_138e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x138f, pci_vendor_138f, pci_ss_list_138f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1390, pci_vendor_1390, pci_ss_list_1390},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1391, pci_vendor_1391, pci_ss_list_1391},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1392, pci_vendor_1392, pci_ss_list_1392},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1393, pci_vendor_1393, pci_ss_list_1393},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1394, pci_vendor_1394, pci_ss_list_1394},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1395, pci_vendor_1395, pci_ss_list_1395},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1396, pci_vendor_1396, pci_ss_list_1396},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1397, pci_vendor_1397, pci_ss_list_1397},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1398, pci_vendor_1398, pci_ss_list_1398},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1399, pci_vendor_1399, pci_ss_list_1399},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139a, pci_vendor_139a, pci_ss_list_139a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139b, pci_vendor_139b, pci_ss_list_139b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139c, pci_vendor_139c, pci_ss_list_139c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139d, pci_vendor_139d, pci_ss_list_139d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139e, pci_vendor_139e, pci_ss_list_139e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x139f, pci_vendor_139f, pci_ss_list_139f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a0, pci_vendor_13a0, pci_ss_list_13a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a1, pci_vendor_13a1, pci_ss_list_13a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a2, pci_vendor_13a2, pci_ss_list_13a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a3, pci_vendor_13a3, pci_ss_list_13a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a4, pci_vendor_13a4, pci_ss_list_13a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a5, pci_vendor_13a5, pci_ss_list_13a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a6, pci_vendor_13a6, pci_ss_list_13a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a7, pci_vendor_13a7, pci_ss_list_13a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a8, pci_vendor_13a8, pci_ss_list_13a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13a9, pci_vendor_13a9, pci_ss_list_13a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13aa, pci_vendor_13aa, pci_ss_list_13aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ab, pci_vendor_13ab, pci_ss_list_13ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ac, pci_vendor_13ac, pci_ss_list_13ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ad, pci_vendor_13ad, pci_ss_list_13ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ae, pci_vendor_13ae, pci_ss_list_13ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13af, pci_vendor_13af, pci_ss_list_13af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b0, pci_vendor_13b0, pci_ss_list_13b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b1, pci_vendor_13b1, pci_ss_list_13b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b2, pci_vendor_13b2, pci_ss_list_13b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b3, pci_vendor_13b3, pci_ss_list_13b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b4, pci_vendor_13b4, pci_ss_list_13b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b5, pci_vendor_13b5, pci_ss_list_13b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b6, pci_vendor_13b6, pci_ss_list_13b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b7, pci_vendor_13b7, pci_ss_list_13b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b8, pci_vendor_13b8, pci_ss_list_13b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13b9, pci_vendor_13b9, pci_ss_list_13b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ba, pci_vendor_13ba, pci_ss_list_13ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bb, pci_vendor_13bb, pci_ss_list_13bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bc, pci_vendor_13bc, pci_ss_list_13bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bd, pci_vendor_13bd, pci_ss_list_13bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13be, pci_vendor_13be, pci_ss_list_13be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13bf, pci_vendor_13bf, pci_ss_list_13bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c0, pci_vendor_13c0, pci_ss_list_13c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c1, pci_vendor_13c1, pci_ss_list_13c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c2, pci_vendor_13c2, pci_ss_list_13c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c3, pci_vendor_13c3, pci_ss_list_13c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c4, pci_vendor_13c4, pci_ss_list_13c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c5, pci_vendor_13c5, pci_ss_list_13c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c6, pci_vendor_13c6, pci_ss_list_13c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c7, pci_vendor_13c7, pci_ss_list_13c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c8, pci_vendor_13c8, pci_ss_list_13c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13c9, pci_vendor_13c9, pci_ss_list_13c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ca, pci_vendor_13ca, pci_ss_list_13ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cb, pci_vendor_13cb, pci_ss_list_13cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cc, pci_vendor_13cc, pci_ss_list_13cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cd, pci_vendor_13cd, pci_ss_list_13cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ce, pci_vendor_13ce, pci_ss_list_13ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13cf, pci_vendor_13cf, pci_ss_list_13cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d0, pci_vendor_13d0, pci_ss_list_13d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d1, pci_vendor_13d1, pci_ss_list_13d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d2, pci_vendor_13d2, pci_ss_list_13d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d3, pci_vendor_13d3, pci_ss_list_13d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d4, pci_vendor_13d4, pci_ss_list_13d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d5, pci_vendor_13d5, pci_ss_list_13d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d6, pci_vendor_13d6, pci_ss_list_13d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d7, pci_vendor_13d7, pci_ss_list_13d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d8, pci_vendor_13d8, pci_ss_list_13d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13d9, pci_vendor_13d9, pci_ss_list_13d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13da, pci_vendor_13da, pci_ss_list_13da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13db, pci_vendor_13db, pci_ss_list_13db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13dc, pci_vendor_13dc, pci_ss_list_13dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13dd, pci_vendor_13dd, pci_ss_list_13dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13de, pci_vendor_13de, pci_ss_list_13de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13df, pci_vendor_13df, pci_ss_list_13df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e0, pci_vendor_13e0, pci_ss_list_13e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e1, pci_vendor_13e1, pci_ss_list_13e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e2, pci_vendor_13e2, pci_ss_list_13e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e3, pci_vendor_13e3, pci_ss_list_13e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e4, pci_vendor_13e4, pci_ss_list_13e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e5, pci_vendor_13e5, pci_ss_list_13e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e6, pci_vendor_13e6, pci_ss_list_13e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e7, pci_vendor_13e7, pci_ss_list_13e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e8, pci_vendor_13e8, pci_ss_list_13e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13e9, pci_vendor_13e9, pci_ss_list_13e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ea, pci_vendor_13ea, pci_ss_list_13ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13eb, pci_vendor_13eb, pci_ss_list_13eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ec, pci_vendor_13ec, pci_ss_list_13ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ed, pci_vendor_13ed, pci_ss_list_13ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ee, pci_vendor_13ee, pci_ss_list_13ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ef, pci_vendor_13ef, pci_ss_list_13ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f0, pci_vendor_13f0, pci_ss_list_13f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f1, pci_vendor_13f1, pci_ss_list_13f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f2, pci_vendor_13f2, pci_ss_list_13f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f3, pci_vendor_13f3, pci_ss_list_13f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f4, pci_vendor_13f4, pci_ss_list_13f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f5, pci_vendor_13f5, pci_ss_list_13f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f6, pci_vendor_13f6, pci_ss_list_13f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f7, pci_vendor_13f7, pci_ss_list_13f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f8, pci_vendor_13f8, pci_ss_list_13f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13f9, pci_vendor_13f9, pci_ss_list_13f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fa, pci_vendor_13fa, pci_ss_list_13fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fb, pci_vendor_13fb, pci_ss_list_13fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fc, pci_vendor_13fc, pci_ss_list_13fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fd, pci_vendor_13fd, pci_ss_list_13fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13fe, pci_vendor_13fe, pci_ss_list_13fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x13ff, pci_vendor_13ff, pci_ss_list_13ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1400, pci_vendor_1400, pci_ss_list_1400},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1401, pci_vendor_1401, pci_ss_list_1401},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1402, pci_vendor_1402, pci_ss_list_1402},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1403, pci_vendor_1403, pci_ss_list_1403},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1404, pci_vendor_1404, pci_ss_list_1404},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1405, pci_vendor_1405, pci_ss_list_1405},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1406, pci_vendor_1406, pci_ss_list_1406},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1407, pci_vendor_1407, pci_ss_list_1407},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1408, pci_vendor_1408, pci_ss_list_1408},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1409, pci_vendor_1409, pci_ss_list_1409},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140a, pci_vendor_140a, pci_ss_list_140a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140b, pci_vendor_140b, pci_ss_list_140b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140c, pci_vendor_140c, pci_ss_list_140c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140d, pci_vendor_140d, pci_ss_list_140d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140e, pci_vendor_140e, pci_ss_list_140e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x140f, pci_vendor_140f, pci_ss_list_140f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1410, pci_vendor_1410, pci_ss_list_1410},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1411, pci_vendor_1411, pci_ss_list_1411},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1412, pci_vendor_1412, pci_ss_list_1412},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1413, pci_vendor_1413, pci_ss_list_1413},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1414, pci_vendor_1414, pci_ss_list_1414},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1415, pci_vendor_1415, pci_ss_list_1415},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1416, pci_vendor_1416, pci_ss_list_1416},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1417, pci_vendor_1417, pci_ss_list_1417},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1418, pci_vendor_1418, pci_ss_list_1418},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1419, pci_vendor_1419, pci_ss_list_1419},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141a, pci_vendor_141a, pci_ss_list_141a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141b, pci_vendor_141b, pci_ss_list_141b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141d, pci_vendor_141d, pci_ss_list_141d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141e, pci_vendor_141e, pci_ss_list_141e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x141f, pci_vendor_141f, pci_ss_list_141f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1420, pci_vendor_1420, pci_ss_list_1420},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1421, pci_vendor_1421, pci_ss_list_1421},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1422, pci_vendor_1422, pci_ss_list_1422},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1423, pci_vendor_1423, pci_ss_list_1423},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1424, pci_vendor_1424, pci_ss_list_1424},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1425, pci_vendor_1425, pci_ss_list_1425},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1426, pci_vendor_1426, pci_ss_list_1426},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1427, pci_vendor_1427, pci_ss_list_1427},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1428, pci_vendor_1428, pci_ss_list_1428},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1429, pci_vendor_1429, pci_ss_list_1429},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142a, pci_vendor_142a, pci_ss_list_142a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142b, pci_vendor_142b, pci_ss_list_142b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142c, pci_vendor_142c, pci_ss_list_142c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142d, pci_vendor_142d, pci_ss_list_142d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142e, pci_vendor_142e, pci_ss_list_142e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x142f, pci_vendor_142f, pci_ss_list_142f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1430, pci_vendor_1430, pci_ss_list_1430},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1431, pci_vendor_1431, pci_ss_list_1431},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1432, pci_vendor_1432, pci_ss_list_1432},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1433, pci_vendor_1433, pci_ss_list_1433},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1435, pci_vendor_1435, pci_ss_list_1435},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1436, pci_vendor_1436, pci_ss_list_1436},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1437, pci_vendor_1437, pci_ss_list_1437},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1438, pci_vendor_1438, pci_ss_list_1438},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1439, pci_vendor_1439, pci_ss_list_1439},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143a, pci_vendor_143a, pci_ss_list_143a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143b, pci_vendor_143b, pci_ss_list_143b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143c, pci_vendor_143c, pci_ss_list_143c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143d, pci_vendor_143d, pci_ss_list_143d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143e, pci_vendor_143e, pci_ss_list_143e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x143f, pci_vendor_143f, pci_ss_list_143f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1440, pci_vendor_1440, pci_ss_list_1440},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1441, pci_vendor_1441, pci_ss_list_1441},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1442, pci_vendor_1442, pci_ss_list_1442},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1443, pci_vendor_1443, pci_ss_list_1443},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1444, pci_vendor_1444, pci_ss_list_1444},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1445, pci_vendor_1445, pci_ss_list_1445},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1446, pci_vendor_1446, pci_ss_list_1446},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1447, pci_vendor_1447, pci_ss_list_1447},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1448, pci_vendor_1448, pci_ss_list_1448},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1449, pci_vendor_1449, pci_ss_list_1449},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144a, pci_vendor_144a, pci_ss_list_144a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144b, pci_vendor_144b, pci_ss_list_144b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144c, pci_vendor_144c, pci_ss_list_144c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144d, pci_vendor_144d, pci_ss_list_144d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144e, pci_vendor_144e, pci_ss_list_144e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x144f, pci_vendor_144f, pci_ss_list_144f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1450, pci_vendor_1450, pci_ss_list_1450},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1451, pci_vendor_1451, pci_ss_list_1451},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1453, pci_vendor_1453, pci_ss_list_1453},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1454, pci_vendor_1454, pci_ss_list_1454},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1455, pci_vendor_1455, pci_ss_list_1455},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1456, pci_vendor_1456, pci_ss_list_1456},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1457, pci_vendor_1457, pci_ss_list_1457},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1458, pci_vendor_1458, pci_ss_list_1458},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1459, pci_vendor_1459, pci_ss_list_1459},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145a, pci_vendor_145a, pci_ss_list_145a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145b, pci_vendor_145b, pci_ss_list_145b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145c, pci_vendor_145c, pci_ss_list_145c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145d, pci_vendor_145d, pci_ss_list_145d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145e, pci_vendor_145e, pci_ss_list_145e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x145f, pci_vendor_145f, pci_ss_list_145f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1460, pci_vendor_1460, pci_ss_list_1460},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1461, pci_vendor_1461, pci_ss_list_1461},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1462, pci_vendor_1462, pci_ss_list_1462},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1463, pci_vendor_1463, pci_ss_list_1463},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1464, pci_vendor_1464, pci_ss_list_1464},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1465, pci_vendor_1465, pci_ss_list_1465},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1466, pci_vendor_1466, pci_ss_list_1466},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1467, pci_vendor_1467, pci_ss_list_1467},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1468, pci_vendor_1468, pci_ss_list_1468},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1469, pci_vendor_1469, pci_ss_list_1469},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146a, pci_vendor_146a, pci_ss_list_146a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146b, pci_vendor_146b, pci_ss_list_146b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146c, pci_vendor_146c, pci_ss_list_146c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146d, pci_vendor_146d, pci_ss_list_146d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146e, pci_vendor_146e, pci_ss_list_146e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x146f, pci_vendor_146f, pci_ss_list_146f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1470, pci_vendor_1470, pci_ss_list_1470},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1471, pci_vendor_1471, pci_ss_list_1471},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1472, pci_vendor_1472, pci_ss_list_1472},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1473, pci_vendor_1473, pci_ss_list_1473},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1474, pci_vendor_1474, pci_ss_list_1474},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1475, pci_vendor_1475, pci_ss_list_1475},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1476, pci_vendor_1476, pci_ss_list_1476},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1477, pci_vendor_1477, pci_ss_list_1477},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1478, pci_vendor_1478, pci_ss_list_1478},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1479, pci_vendor_1479, pci_ss_list_1479},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147a, pci_vendor_147a, pci_ss_list_147a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147b, pci_vendor_147b, pci_ss_list_147b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147c, pci_vendor_147c, pci_ss_list_147c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147d, pci_vendor_147d, pci_ss_list_147d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147e, pci_vendor_147e, pci_ss_list_147e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x147f, pci_vendor_147f, pci_ss_list_147f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1480, pci_vendor_1480, pci_ss_list_1480},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1481, pci_vendor_1481, pci_ss_list_1481},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1482, pci_vendor_1482, pci_ss_list_1482},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1483, pci_vendor_1483, pci_ss_list_1483},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1484, pci_vendor_1484, pci_ss_list_1484},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1485, pci_vendor_1485, pci_ss_list_1485},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1486, pci_vendor_1486, pci_ss_list_1486},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1487, pci_vendor_1487, pci_ss_list_1487},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1488, pci_vendor_1488, pci_ss_list_1488},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1489, pci_vendor_1489, pci_ss_list_1489},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148a, pci_vendor_148a, pci_ss_list_148a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148b, pci_vendor_148b, pci_ss_list_148b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148c, pci_vendor_148c, pci_ss_list_148c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148d, pci_vendor_148d, pci_ss_list_148d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148e, pci_vendor_148e, pci_ss_list_148e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x148f, pci_vendor_148f, pci_ss_list_148f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1490, pci_vendor_1490, pci_ss_list_1490},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1491, pci_vendor_1491, pci_ss_list_1491},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1492, pci_vendor_1492, pci_ss_list_1492},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1493, pci_vendor_1493, pci_ss_list_1493},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1494, pci_vendor_1494, pci_ss_list_1494},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1495, pci_vendor_1495, pci_ss_list_1495},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1496, pci_vendor_1496, pci_ss_list_1496},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1497, pci_vendor_1497, pci_ss_list_1497},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1498, pci_vendor_1498, pci_ss_list_1498},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1499, pci_vendor_1499, pci_ss_list_1499},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149a, pci_vendor_149a, pci_ss_list_149a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149b, pci_vendor_149b, pci_ss_list_149b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149c, pci_vendor_149c, pci_ss_list_149c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149d, pci_vendor_149d, pci_ss_list_149d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149e, pci_vendor_149e, pci_ss_list_149e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x149f, pci_vendor_149f, pci_ss_list_149f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a0, pci_vendor_14a0, pci_ss_list_14a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a1, pci_vendor_14a1, pci_ss_list_14a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a2, pci_vendor_14a2, pci_ss_list_14a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a3, pci_vendor_14a3, pci_ss_list_14a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a4, pci_vendor_14a4, pci_ss_list_14a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a5, pci_vendor_14a5, pci_ss_list_14a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a6, pci_vendor_14a6, pci_ss_list_14a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a7, pci_vendor_14a7, pci_ss_list_14a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a8, pci_vendor_14a8, pci_ss_list_14a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14a9, pci_vendor_14a9, pci_ss_list_14a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14aa, pci_vendor_14aa, pci_ss_list_14aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ab, pci_vendor_14ab, pci_ss_list_14ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ac, pci_vendor_14ac, pci_ss_list_14ac},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ad, pci_vendor_14ad, pci_ss_list_14ad},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ae, pci_vendor_14ae, pci_ss_list_14ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14af, pci_vendor_14af, pci_ss_list_14af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b0, pci_vendor_14b0, pci_ss_list_14b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b1, pci_vendor_14b1, pci_ss_list_14b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b2, pci_vendor_14b2, pci_ss_list_14b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b3, pci_vendor_14b3, pci_ss_list_14b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b4, pci_vendor_14b4, pci_ss_list_14b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b5, pci_vendor_14b5, pci_ss_list_14b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b6, pci_vendor_14b6, pci_ss_list_14b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b7, pci_vendor_14b7, pci_ss_list_14b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b8, pci_vendor_14b8, pci_ss_list_14b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14b9, pci_vendor_14b9, pci_ss_list_14b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ba, pci_vendor_14ba, pci_ss_list_14ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bb, pci_vendor_14bb, pci_ss_list_14bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bc, pci_vendor_14bc, pci_ss_list_14bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bd, pci_vendor_14bd, pci_ss_list_14bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14be, pci_vendor_14be, pci_ss_list_14be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14bf, pci_vendor_14bf, pci_ss_list_14bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c0, pci_vendor_14c0, pci_ss_list_14c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c1, pci_vendor_14c1, pci_ss_list_14c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c2, pci_vendor_14c2, pci_ss_list_14c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c3, pci_vendor_14c3, pci_ss_list_14c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c4, pci_vendor_14c4, pci_ss_list_14c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c5, pci_vendor_14c5, pci_ss_list_14c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c6, pci_vendor_14c6, pci_ss_list_14c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c7, pci_vendor_14c7, pci_ss_list_14c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c8, pci_vendor_14c8, pci_ss_list_14c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14c9, pci_vendor_14c9, pci_ss_list_14c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ca, pci_vendor_14ca, pci_ss_list_14ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cb, pci_vendor_14cb, pci_ss_list_14cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cc, pci_vendor_14cc, pci_ss_list_14cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cd, pci_vendor_14cd, pci_ss_list_14cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ce, pci_vendor_14ce, pci_ss_list_14ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14cf, pci_vendor_14cf, pci_ss_list_14cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d0, pci_vendor_14d0, pci_ss_list_14d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d1, pci_vendor_14d1, pci_ss_list_14d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d2, pci_vendor_14d2, pci_ss_list_14d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d3, pci_vendor_14d3, pci_ss_list_14d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d4, pci_vendor_14d4, pci_ss_list_14d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d5, pci_vendor_14d5, pci_ss_list_14d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d6, pci_vendor_14d6, pci_ss_list_14d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d7, pci_vendor_14d7, pci_ss_list_14d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d8, pci_vendor_14d8, pci_ss_list_14d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14d9, pci_vendor_14d9, pci_ss_list_14d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14da, pci_vendor_14da, pci_ss_list_14da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14db, pci_vendor_14db, pci_ss_list_14db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14dc, pci_vendor_14dc, pci_ss_list_14dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14dd, pci_vendor_14dd, pci_ss_list_14dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14de, pci_vendor_14de, pci_ss_list_14de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14df, pci_vendor_14df, pci_ss_list_14df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e1, pci_vendor_14e1, pci_ss_list_14e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e2, pci_vendor_14e2, pci_ss_list_14e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e3, pci_vendor_14e3, pci_ss_list_14e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e4, pci_vendor_14e4, pci_ss_list_14e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e5, pci_vendor_14e5, pci_ss_list_14e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e6, pci_vendor_14e6, pci_ss_list_14e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e7, pci_vendor_14e7, pci_ss_list_14e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e8, pci_vendor_14e8, pci_ss_list_14e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14e9, pci_vendor_14e9, pci_ss_list_14e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ea, pci_vendor_14ea, pci_ss_list_14ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14eb, pci_vendor_14eb, pci_ss_list_14eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ec, pci_vendor_14ec, pci_ss_list_14ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ed, pci_vendor_14ed, pci_ss_list_14ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ee, pci_vendor_14ee, pci_ss_list_14ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ef, pci_vendor_14ef, pci_ss_list_14ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f0, pci_vendor_14f0, pci_ss_list_14f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f1, pci_vendor_14f1, pci_ss_list_14f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f2, pci_vendor_14f2, pci_ss_list_14f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f3, pci_vendor_14f3, pci_ss_list_14f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f4, pci_vendor_14f4, pci_ss_list_14f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f5, pci_vendor_14f5, pci_ss_list_14f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f6, pci_vendor_14f6, pci_ss_list_14f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f7, pci_vendor_14f7, pci_ss_list_14f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f8, pci_vendor_14f8, pci_ss_list_14f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14f9, pci_vendor_14f9, pci_ss_list_14f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fa, pci_vendor_14fa, pci_ss_list_14fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fb, pci_vendor_14fb, pci_ss_list_14fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fc, pci_vendor_14fc, pci_ss_list_14fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fd, pci_vendor_14fd, pci_ss_list_14fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14fe, pci_vendor_14fe, pci_ss_list_14fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x14ff, pci_vendor_14ff, pci_ss_list_14ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1500, pci_vendor_1500, pci_ss_list_1500},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1501, pci_vendor_1501, pci_ss_list_1501},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1502, pci_vendor_1502, pci_ss_list_1502},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1503, pci_vendor_1503, pci_ss_list_1503},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1504, pci_vendor_1504, pci_ss_list_1504},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1505, pci_vendor_1505, pci_ss_list_1505},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1506, pci_vendor_1506, pci_ss_list_1506},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1507, pci_vendor_1507, pci_ss_list_1507},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1508, pci_vendor_1508, pci_ss_list_1508},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1509, pci_vendor_1509, pci_ss_list_1509},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150a, pci_vendor_150a, pci_ss_list_150a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150b, pci_vendor_150b, pci_ss_list_150b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150c, pci_vendor_150c, pci_ss_list_150c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150d, pci_vendor_150d, pci_ss_list_150d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150e, pci_vendor_150e, pci_ss_list_150e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x150f, pci_vendor_150f, pci_ss_list_150f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1510, pci_vendor_1510, pci_ss_list_1510},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1511, pci_vendor_1511, pci_ss_list_1511},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1512, pci_vendor_1512, pci_ss_list_1512},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1513, pci_vendor_1513, pci_ss_list_1513},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1514, pci_vendor_1514, pci_ss_list_1514},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1515, pci_vendor_1515, pci_ss_list_1515},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1516, pci_vendor_1516, pci_ss_list_1516},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1517, pci_vendor_1517, pci_ss_list_1517},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1518, pci_vendor_1518, pci_ss_list_1518},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1519, pci_vendor_1519, pci_ss_list_1519},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151a, pci_vendor_151a, pci_ss_list_151a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151b, pci_vendor_151b, pci_ss_list_151b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151c, pci_vendor_151c, pci_ss_list_151c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151d, pci_vendor_151d, pci_ss_list_151d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151e, pci_vendor_151e, pci_ss_list_151e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x151f, pci_vendor_151f, pci_ss_list_151f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1520, pci_vendor_1520, pci_ss_list_1520},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1521, pci_vendor_1521, pci_ss_list_1521},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1522, pci_vendor_1522, pci_ss_list_1522},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1523, pci_vendor_1523, pci_ss_list_1523},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1524, pci_vendor_1524, pci_ss_list_1524},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1525, pci_vendor_1525, pci_ss_list_1525},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1526, pci_vendor_1526, pci_ss_list_1526},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1527, pci_vendor_1527, pci_ss_list_1527},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1528, pci_vendor_1528, pci_ss_list_1528},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1529, pci_vendor_1529, pci_ss_list_1529},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152a, pci_vendor_152a, pci_ss_list_152a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152b, pci_vendor_152b, pci_ss_list_152b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152c, pci_vendor_152c, pci_ss_list_152c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152d, pci_vendor_152d, pci_ss_list_152d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152e, pci_vendor_152e, pci_ss_list_152e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x152f, pci_vendor_152f, pci_ss_list_152f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1530, pci_vendor_1530, pci_ss_list_1530},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1531, pci_vendor_1531, pci_ss_list_1531},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1532, pci_vendor_1532, pci_ss_list_1532},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1533, pci_vendor_1533, pci_ss_list_1533},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1534, pci_vendor_1534, pci_ss_list_1534},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1535, pci_vendor_1535, pci_ss_list_1535},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1537, pci_vendor_1537, pci_ss_list_1537},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1538, pci_vendor_1538, pci_ss_list_1538},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1539, pci_vendor_1539, pci_ss_list_1539},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153a, pci_vendor_153a, pci_ss_list_153a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153b, pci_vendor_153b, pci_ss_list_153b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153c, pci_vendor_153c, pci_ss_list_153c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153d, pci_vendor_153d, pci_ss_list_153d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153e, pci_vendor_153e, pci_ss_list_153e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x153f, pci_vendor_153f, pci_ss_list_153f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1540, pci_vendor_1540, pci_ss_list_1540},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1541, pci_vendor_1541, pci_ss_list_1541},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1542, pci_vendor_1542, pci_ss_list_1542},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1543, pci_vendor_1543, pci_ss_list_1543},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1544, pci_vendor_1544, pci_ss_list_1544},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1545, pci_vendor_1545, pci_ss_list_1545},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1546, pci_vendor_1546, pci_ss_list_1546},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1547, pci_vendor_1547, pci_ss_list_1547},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1548, pci_vendor_1548, pci_ss_list_1548},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1549, pci_vendor_1549, pci_ss_list_1549},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154a, pci_vendor_154a, pci_ss_list_154a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154b, pci_vendor_154b, pci_ss_list_154b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154c, pci_vendor_154c, pci_ss_list_154c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154d, pci_vendor_154d, pci_ss_list_154d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154e, pci_vendor_154e, pci_ss_list_154e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x154f, pci_vendor_154f, pci_ss_list_154f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1550, pci_vendor_1550, pci_ss_list_1550},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1551, pci_vendor_1551, pci_ss_list_1551},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1552, pci_vendor_1552, pci_ss_list_1552},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1553, pci_vendor_1553, pci_ss_list_1553},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1554, pci_vendor_1554, pci_ss_list_1554},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1555, pci_vendor_1555, pci_ss_list_1555},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1556, pci_vendor_1556, pci_ss_list_1556},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1557, pci_vendor_1557, pci_ss_list_1557},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1558, pci_vendor_1558, pci_ss_list_1558},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1559, pci_vendor_1559, pci_ss_list_1559},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155a, pci_vendor_155a, pci_ss_list_155a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155b, pci_vendor_155b, pci_ss_list_155b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155c, pci_vendor_155c, pci_ss_list_155c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155d, pci_vendor_155d, pci_ss_list_155d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155e, pci_vendor_155e, pci_ss_list_155e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x155f, pci_vendor_155f, pci_ss_list_155f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1560, pci_vendor_1560, pci_ss_list_1560},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1561, pci_vendor_1561, pci_ss_list_1561},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1562, pci_vendor_1562, pci_ss_list_1562},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1563, pci_vendor_1563, pci_ss_list_1563},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1564, pci_vendor_1564, pci_ss_list_1564},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1565, pci_vendor_1565, pci_ss_list_1565},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1566, pci_vendor_1566, pci_ss_list_1566},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1567, pci_vendor_1567, pci_ss_list_1567},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1568, pci_vendor_1568, pci_ss_list_1568},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1569, pci_vendor_1569, pci_ss_list_1569},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156a, pci_vendor_156a, pci_ss_list_156a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156b, pci_vendor_156b, pci_ss_list_156b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156c, pci_vendor_156c, pci_ss_list_156c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156d, pci_vendor_156d, pci_ss_list_156d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156e, pci_vendor_156e, pci_ss_list_156e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x156f, pci_vendor_156f, pci_ss_list_156f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1570, pci_vendor_1570, pci_ss_list_1570},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1571, pci_vendor_1571, pci_ss_list_1571},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1572, pci_vendor_1572, pci_ss_list_1572},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1573, pci_vendor_1573, pci_ss_list_1573},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1574, pci_vendor_1574, pci_ss_list_1574},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1575, pci_vendor_1575, pci_ss_list_1575},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1576, pci_vendor_1576, pci_ss_list_1576},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1578, pci_vendor_1578, pci_ss_list_1578},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1579, pci_vendor_1579, pci_ss_list_1579},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157a, pci_vendor_157a, pci_ss_list_157a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157b, pci_vendor_157b, pci_ss_list_157b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157c, pci_vendor_157c, pci_ss_list_157c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157d, pci_vendor_157d, pci_ss_list_157d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157e, pci_vendor_157e, pci_ss_list_157e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x157f, pci_vendor_157f, pci_ss_list_157f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1580, pci_vendor_1580, pci_ss_list_1580},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1581, pci_vendor_1581, pci_ss_list_1581},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1582, pci_vendor_1582, pci_ss_list_1582},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1583, pci_vendor_1583, pci_ss_list_1583},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1584, pci_vendor_1584, pci_ss_list_1584},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1585, pci_vendor_1585, pci_ss_list_1585},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1586, pci_vendor_1586, pci_ss_list_1586},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1587, pci_vendor_1587, pci_ss_list_1587},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1588, pci_vendor_1588, pci_ss_list_1588},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1589, pci_vendor_1589, pci_ss_list_1589},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158a, pci_vendor_158a, pci_ss_list_158a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158b, pci_vendor_158b, pci_ss_list_158b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158c, pci_vendor_158c, pci_ss_list_158c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158d, pci_vendor_158d, pci_ss_list_158d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158e, pci_vendor_158e, pci_ss_list_158e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x158f, pci_vendor_158f, pci_ss_list_158f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1590, pci_vendor_1590, pci_ss_list_1590},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1591, pci_vendor_1591, pci_ss_list_1591},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1592, pci_vendor_1592, pci_ss_list_1592},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1593, pci_vendor_1593, pci_ss_list_1593},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1594, pci_vendor_1594, pci_ss_list_1594},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1595, pci_vendor_1595, pci_ss_list_1595},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1596, pci_vendor_1596, pci_ss_list_1596},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1597, pci_vendor_1597, pci_ss_list_1597},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1598, pci_vendor_1598, pci_ss_list_1598},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1599, pci_vendor_1599, pci_ss_list_1599},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159a, pci_vendor_159a, pci_ss_list_159a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159b, pci_vendor_159b, pci_ss_list_159b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159c, pci_vendor_159c, pci_ss_list_159c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159d, pci_vendor_159d, pci_ss_list_159d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159e, pci_vendor_159e, pci_ss_list_159e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x159f, pci_vendor_159f, pci_ss_list_159f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a0, pci_vendor_15a0, pci_ss_list_15a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a1, pci_vendor_15a1, pci_ss_list_15a1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a2, pci_vendor_15a2, pci_ss_list_15a2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a3, pci_vendor_15a3, pci_ss_list_15a3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a4, pci_vendor_15a4, pci_ss_list_15a4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a5, pci_vendor_15a5, pci_ss_list_15a5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a6, pci_vendor_15a6, pci_ss_list_15a6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a7, pci_vendor_15a7, pci_ss_list_15a7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15a8, pci_vendor_15a8, pci_ss_list_15a8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15aa, pci_vendor_15aa, pci_ss_list_15aa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ab, pci_vendor_15ab, pci_ss_list_15ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ac, pci_vendor_15ac, pci_ss_list_15ac},
-#endif
- {0x15ad, pci_vendor_15ad, pci_ss_list_15ad},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ae, pci_vendor_15ae, pci_ss_list_15ae},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b0, pci_vendor_15b0, pci_ss_list_15b0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b1, pci_vendor_15b1, pci_ss_list_15b1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b2, pci_vendor_15b2, pci_ss_list_15b2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b3, pci_vendor_15b3, pci_ss_list_15b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b4, pci_vendor_15b4, pci_ss_list_15b4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b5, pci_vendor_15b5, pci_ss_list_15b5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b6, pci_vendor_15b6, pci_ss_list_15b6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b7, pci_vendor_15b7, pci_ss_list_15b7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b8, pci_vendor_15b8, pci_ss_list_15b8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15b9, pci_vendor_15b9, pci_ss_list_15b9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ba, pci_vendor_15ba, pci_ss_list_15ba},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bb, pci_vendor_15bb, pci_ss_list_15bb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bc, pci_vendor_15bc, pci_ss_list_15bc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bd, pci_vendor_15bd, pci_ss_list_15bd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15be, pci_vendor_15be, pci_ss_list_15be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15bf, pci_vendor_15bf, pci_ss_list_15bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c0, pci_vendor_15c0, pci_ss_list_15c0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c1, pci_vendor_15c1, pci_ss_list_15c1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c2, pci_vendor_15c2, pci_ss_list_15c2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c3, pci_vendor_15c3, pci_ss_list_15c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c4, pci_vendor_15c4, pci_ss_list_15c4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c5, pci_vendor_15c5, pci_ss_list_15c5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c6, pci_vendor_15c6, pci_ss_list_15c6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c7, pci_vendor_15c7, pci_ss_list_15c7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c8, pci_vendor_15c8, pci_ss_list_15c8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15c9, pci_vendor_15c9, pci_ss_list_15c9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ca, pci_vendor_15ca, pci_ss_list_15ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cb, pci_vendor_15cb, pci_ss_list_15cb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cc, pci_vendor_15cc, pci_ss_list_15cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cd, pci_vendor_15cd, pci_ss_list_15cd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ce, pci_vendor_15ce, pci_ss_list_15ce},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15cf, pci_vendor_15cf, pci_ss_list_15cf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d1, pci_vendor_15d1, pci_ss_list_15d1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d2, pci_vendor_15d2, pci_ss_list_15d2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d3, pci_vendor_15d3, pci_ss_list_15d3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d4, pci_vendor_15d4, pci_ss_list_15d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d5, pci_vendor_15d5, pci_ss_list_15d5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d6, pci_vendor_15d6, pci_ss_list_15d6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d7, pci_vendor_15d7, pci_ss_list_15d7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d8, pci_vendor_15d8, pci_ss_list_15d8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15d9, pci_vendor_15d9, pci_ss_list_15d9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15da, pci_vendor_15da, pci_ss_list_15da},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15db, pci_vendor_15db, pci_ss_list_15db},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15dc, pci_vendor_15dc, pci_ss_list_15dc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15dd, pci_vendor_15dd, pci_ss_list_15dd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15de, pci_vendor_15de, pci_ss_list_15de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15df, pci_vendor_15df, pci_ss_list_15df},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e0, pci_vendor_15e0, pci_ss_list_15e0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e1, pci_vendor_15e1, pci_ss_list_15e1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e2, pci_vendor_15e2, pci_ss_list_15e2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e3, pci_vendor_15e3, pci_ss_list_15e3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e4, pci_vendor_15e4, pci_ss_list_15e4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e5, pci_vendor_15e5, pci_ss_list_15e5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e6, pci_vendor_15e6, pci_ss_list_15e6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e7, pci_vendor_15e7, pci_ss_list_15e7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e8, pci_vendor_15e8, pci_ss_list_15e8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15e9, pci_vendor_15e9, pci_ss_list_15e9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ea, pci_vendor_15ea, pci_ss_list_15ea},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15eb, pci_vendor_15eb, pci_ss_list_15eb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ec, pci_vendor_15ec, pci_ss_list_15ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ed, pci_vendor_15ed, pci_ss_list_15ed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ee, pci_vendor_15ee, pci_ss_list_15ee},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ef, pci_vendor_15ef, pci_ss_list_15ef},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f0, pci_vendor_15f0, pci_ss_list_15f0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f1, pci_vendor_15f1, pci_ss_list_15f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f2, pci_vendor_15f2, pci_ss_list_15f2},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f3, pci_vendor_15f3, pci_ss_list_15f3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f4, pci_vendor_15f4, pci_ss_list_15f4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f5, pci_vendor_15f5, pci_ss_list_15f5},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f6, pci_vendor_15f6, pci_ss_list_15f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f7, pci_vendor_15f7, pci_ss_list_15f7},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f8, pci_vendor_15f8, pci_ss_list_15f8},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15f9, pci_vendor_15f9, pci_ss_list_15f9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fa, pci_vendor_15fa, pci_ss_list_15fa},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fb, pci_vendor_15fb, pci_ss_list_15fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fc, pci_vendor_15fc, pci_ss_list_15fc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fd, pci_vendor_15fd, pci_ss_list_15fd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15fe, pci_vendor_15fe, pci_ss_list_15fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x15ff, pci_vendor_15ff, pci_ss_list_15ff},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1600, pci_vendor_1600, pci_ss_list_1600},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1601, pci_vendor_1601, pci_ss_list_1601},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1602, pci_vendor_1602, pci_ss_list_1602},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1603, pci_vendor_1603, pci_ss_list_1603},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1604, pci_vendor_1604, pci_ss_list_1604},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1605, pci_vendor_1605, pci_ss_list_1605},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1606, pci_vendor_1606, pci_ss_list_1606},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1607, pci_vendor_1607, pci_ss_list_1607},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1608, pci_vendor_1608, pci_ss_list_1608},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1609, pci_vendor_1609, pci_ss_list_1609},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1612, pci_vendor_1612, pci_ss_list_1612},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1619, pci_vendor_1619, pci_ss_list_1619},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1629, pci_vendor_1629, pci_ss_list_1629},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1638, pci_vendor_1638, pci_ss_list_1638},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x163c, pci_vendor_163c, pci_ss_list_163c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1657, pci_vendor_1657, pci_ss_list_1657},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x165a, pci_vendor_165a, pci_ss_list_165a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x165d, pci_vendor_165d, pci_ss_list_165d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1661, pci_vendor_1661, pci_ss_list_1661},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1668, pci_vendor_1668, pci_ss_list_1668},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1681, pci_vendor_1681, pci_ss_list_1681},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ab, pci_vendor_16ab, pci_ss_list_16ab},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16be, pci_vendor_16be, pci_ss_list_16be},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ca, pci_vendor_16ca, pci_ss_list_16ca},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16ec, pci_vendor_16ec, pci_ss_list_16ec},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x16f6, pci_vendor_16f6, pci_ss_list_16f6},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1705, pci_vendor_1705, pci_ss_list_1705},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x170b, pci_vendor_170b, pci_ss_list_170b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x170c, pci_vendor_170c, pci_ss_list_170c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x172a, pci_vendor_172a, pci_ss_list_172a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1737, pci_vendor_1737, pci_ss_list_1737},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x173b, pci_vendor_173b, pci_ss_list_173b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1743, pci_vendor_1743, pci_ss_list_1743},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x174b, pci_vendor_174b, pci_ss_list_174b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x175e, pci_vendor_175e, pci_ss_list_175e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1787, pci_vendor_1787, pci_ss_list_1787},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1796, pci_vendor_1796, pci_ss_list_1796},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1799, pci_vendor_1799, pci_ss_list_1799},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x17af, pci_vendor_17af, pci_ss_list_17af},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x17cc, pci_vendor_17cc, pci_ss_list_17cc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1813, pci_vendor_1813, pci_ss_list_1813},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1851, pci_vendor_1851, pci_ss_list_1851},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1852, pci_vendor_1852, pci_ss_list_1852},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1888, pci_vendor_1888, pci_ss_list_1888},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1a08, pci_vendor_1a08, pci_ss_list_1a08},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1b13, pci_vendor_1b13, pci_ss_list_1b13},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1c1c, pci_vendor_1c1c, pci_ss_list_1c1c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1d44, pci_vendor_1d44, pci_ss_list_1d44},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1de1, pci_vendor_1de1, pci_ss_list_1de1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x1fc0, pci_vendor_1fc0, pci_ss_list_1fc0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2000, pci_vendor_2000, pci_ss_list_2000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2001, pci_vendor_2001, pci_ss_list_2001},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2003, pci_vendor_2003, pci_ss_list_2003},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2004, pci_vendor_2004, pci_ss_list_2004},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x21c3, pci_vendor_21c3, pci_ss_list_21c3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2348, pci_vendor_2348, pci_ss_list_2348},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2646, pci_vendor_2646, pci_ss_list_2646},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x270b, pci_vendor_270b, pci_ss_list_270b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x270f, pci_vendor_270f, pci_ss_list_270f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2711, pci_vendor_2711, pci_ss_list_2711},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x2a15, pci_vendor_2a15, pci_ss_list_2a15},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3000, pci_vendor_3000, pci_ss_list_3000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3142, pci_vendor_3142, pci_ss_list_3142},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3388, pci_vendor_3388, pci_ss_list_3388},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3411, pci_vendor_3411, pci_ss_list_3411},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x3513, pci_vendor_3513, pci_ss_list_3513},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x38ef, pci_vendor_38ef, pci_ss_list_38ef},
-#endif
- {0x3d3d, pci_vendor_3d3d, pci_ss_list_3d3d},
- {0x4005, pci_vendor_4005, pci_ss_list_4005},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4033, pci_vendor_4033, pci_ss_list_4033},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4143, pci_vendor_4143, pci_ss_list_4143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x416c, pci_vendor_416c, pci_ss_list_416c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4444, pci_vendor_4444, pci_ss_list_4444},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4468, pci_vendor_4468, pci_ss_list_4468},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4594, pci_vendor_4594, pci_ss_list_4594},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x45fb, pci_vendor_45fb, pci_ss_list_45fb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4680, pci_vendor_4680, pci_ss_list_4680},
-#endif
- {0x4843, pci_vendor_4843, pci_ss_list_4843},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4916, pci_vendor_4916, pci_ss_list_4916},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4943, pci_vendor_4943, pci_ss_list_4943},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4978, pci_vendor_4978, pci_ss_list_4978},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4a14, pci_vendor_4a14, pci_ss_list_4a14},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4b10, pci_vendor_4b10, pci_ss_list_4b10},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4c48, pci_vendor_4c48, pci_ss_list_4c48},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4c53, pci_vendor_4c53, pci_ss_list_4c53},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4ca1, pci_vendor_4ca1, pci_ss_list_4ca1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4d51, pci_vendor_4d51, pci_ss_list_4d51},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4d54, pci_vendor_4d54, pci_ss_list_4d54},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x4ddc, pci_vendor_4ddc, pci_ss_list_4ddc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5046, pci_vendor_5046, pci_ss_list_5046},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5053, pci_vendor_5053, pci_ss_list_5053},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5136, pci_vendor_5136, pci_ss_list_5136},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5143, pci_vendor_5143, pci_ss_list_5143},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5145, pci_vendor_5145, pci_ss_list_5145},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5168, pci_vendor_5168, pci_ss_list_5168},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5301, pci_vendor_5301, pci_ss_list_5301},
-#endif
- {0x5333, pci_vendor_5333, pci_ss_list_5333},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x544c, pci_vendor_544c, pci_ss_list_544c},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5455, pci_vendor_5455, pci_ss_list_5455},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5519, pci_vendor_5519, pci_ss_list_5519},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5544, pci_vendor_5544, pci_ss_list_5544},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5555, pci_vendor_5555, pci_ss_list_5555},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5654, pci_vendor_5654, pci_ss_list_5654},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x5700, pci_vendor_5700, pci_ss_list_5700},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6356, pci_vendor_6356, pci_ss_list_6356},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6374, pci_vendor_6374, pci_ss_list_6374},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6409, pci_vendor_6409, pci_ss_list_6409},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x6666, pci_vendor_6666, pci_ss_list_6666},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7604, pci_vendor_7604, pci_ss_list_7604},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7bde, pci_vendor_7bde, pci_ss_list_7bde},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x7fed, pci_vendor_7fed, pci_ss_list_7fed},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8008, pci_vendor_8008, pci_ss_list_8008},
-#endif
- {0x8086, pci_vendor_8086, pci_ss_list_8086},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8800, pci_vendor_8800, pci_ss_list_8800},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8866, pci_vendor_8866, pci_ss_list_8866},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8888, pci_vendor_8888, pci_ss_list_8888},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8e0e, pci_vendor_8e0e, pci_ss_list_8e0e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x8e2e, pci_vendor_8e2e, pci_ss_list_8e2e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9004, pci_vendor_9004, pci_ss_list_9004},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9005, pci_vendor_9005, pci_ss_list_9005},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x907f, pci_vendor_907f, pci_ss_list_907f},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x919a, pci_vendor_919a, pci_ss_list_919a},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9412, pci_vendor_9412, pci_ss_list_9412},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9699, pci_vendor_9699, pci_ss_list_9699},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0x9710, pci_vendor_9710, pci_ss_list_9710},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa0a0, pci_vendor_a0a0, pci_ss_list_a0a0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa0f1, pci_vendor_a0f1, pci_ss_list_a0f1},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa200, pci_vendor_a200, pci_ss_list_a200},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa259, pci_vendor_a259, pci_ss_list_a259},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa25b, pci_vendor_a25b, pci_ss_list_a25b},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa304, pci_vendor_a304, pci_ss_list_a304},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xa727, pci_vendor_a727, pci_ss_list_a727},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xaa42, pci_vendor_aa42, pci_ss_list_aa42},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xac1e, pci_vendor_ac1e, pci_ss_list_ac1e},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xb1b3, pci_vendor_b1b3, pci_ss_list_b1b3},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xbd11, pci_vendor_bd11, pci_ss_list_bd11},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc001, pci_vendor_c001, pci_ss_list_c001},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0a9, pci_vendor_c0a9, pci_ss_list_c0a9},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0de, pci_vendor_c0de, pci_ss_list_c0de},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xc0fe, pci_vendor_c0fe, pci_ss_list_c0fe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xca50, pci_vendor_ca50, pci_ss_list_ca50},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcafe, pci_vendor_cafe, pci_ss_list_cafe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcccc, pci_vendor_cccc, pci_ss_list_cccc},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xcddd, pci_vendor_cddd, pci_ss_list_cddd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd4d4, pci_vendor_d4d4, pci_ss_list_d4d4},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd531, pci_vendor_d531, pci_ss_list_d531},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xd84d, pci_vendor_d84d, pci_ss_list_d84d},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xdead, pci_vendor_dead, pci_ss_list_dead},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe000, pci_vendor_e000, pci_ss_list_e000},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe159, pci_vendor_e159, pci_ss_list_e159},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xe4bf, pci_vendor_e4bf, pci_ss_list_e4bf},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xea01, pci_vendor_ea01, pci_ss_list_ea01},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xea60, pci_vendor_ea60, pci_ss_list_ea60},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xeabb, pci_vendor_eabb, pci_ss_list_eabb},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xeace, pci_vendor_eace, pci_ss_list_eace},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xec80, pci_vendor_ec80, pci_ss_list_ec80},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xecc0, pci_vendor_ecc0, pci_ss_list_ecc0},
-#endif
- {0xedd8, pci_vendor_edd8, pci_ss_list_edd8},
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xf1d0, pci_vendor_f1d0, pci_ss_list_f1d0},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfa57, pci_vendor_fa57, pci_ss_list_fa57},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfebd, pci_vendor_febd, pci_ss_list_febd},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfeda, pci_vendor_feda, pci_ss_list_feda},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xfffe, pci_vendor_fffe, pci_ss_list_fffe},
-#endif
-#ifdef VENDOR_INCLUDE_NONVIDEO
- {0xffff, pci_vendor_ffff, pci_ss_list_ffff},
-#endif
- {0x0000, NULL, NULL}
-};
-#endif
diff --git a/hw/xfree86/scanpci/xf86PciStr.h b/hw/xfree86/scanpci/xf86PciStr.h
deleted file mode 100644
index bb36d510a..000000000
--- a/hw/xfree86/scanpci/xf86PciStr.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.2 2003/08/24 17:37:10 dawes Exp $ */
-/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * Structs used to hold the pre-parsed pci.ids data. These are private
- * to the scanpci and pcidata modules.
- */
-
-#ifndef _XF86_PCISTR_H
-#define _XF86_PCISTR_H
-
-typedef struct {
- unsigned short VendorID;
- unsigned short SubsystemID;
- const char *SubsystemName;
- unsigned short class;
-} pciSubsystemInfo;
-
-typedef struct {
- unsigned short DeviceID;
- const char *DeviceName;
- const pciSubsystemInfo **Subsystem;
- unsigned short class;
-} pciDeviceInfo;
-
-typedef struct {
- unsigned short VendorID;
- const char *VendorName;
- const pciDeviceInfo **Device;
-} pciVendorInfo;
-
-typedef struct {
- unsigned short VendorID;
- const char *VendorName;
- const pciSubsystemInfo **Subsystem;
-} pciVendorSubsysInfo;
-
-#endif /* _XF86_PCISTR_H */
diff --git a/hw/xfree86/scanpci/xf86ScanPci.c b/hw/xfree86/scanpci/xf86ScanPci.c
deleted file mode 100644
index 534c8973f..000000000
--- a/hw/xfree86/scanpci/xf86ScanPci.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.14 2003/09/23 05:21:46 dawes Exp $ */
-/*
- * Display the Subsystem Vendor Id and Subsystem Id in order to identify
- * the cards installed in this computer
- *
- * A lot of this comes from Robin Cutshaw's scanpci
- *
- */
-/*
- * Copyright (c) 1995-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file is used to build both the scanpci and pcidata modules.
- * The interfaces have changed compared with XFree86 4.2.0 and earlier.
- * The data is no longer exported directly. Lookup functions are provided.
- * This means that the data format can change in the future without affecting
- * the exported interfaces.
- *
- * The namespaces for pcidata and scanpci clash, so both modules can't be
- * loaded at the same time. The X server should only load the scanpci module
- * when run with the '-scanpci' flag. The main difference between the
- * two modules is size. pcidata only holds the subset of data that is
- * "interesting" to the X server. "Interesting" is determined by the
- * PCI_VENDOR_* defines in ../common/xf86PciInfo.h.
- */
-
-
-/* XXX This is including a lot of stuff that modules should not include! */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Pci.h"
-#include "xf86_OSproc.h"
-
-#ifndef IN_MODULE
-#include <ctype.h>
-#include <stdlib.h>
-#else
-#include <xf86_ansic.h>
-#endif
-
-#ifndef PCIDATA
-#define VENDOR_INCLUDE_NONVIDEO
-#endif
-#define INIT_SUBSYS_INFO
-#define INIT_VENDOR_SUBSYS_INFO
-
-#include "xf86PciStr.h"
-#include "xf86PciIds.h"
-#include "xf86ScanPci.h"
-
-/*
- * PCI classes that have messages printed always. The others are only
- * have a message printed when the vendor/dev IDs are recognised.
- */
-#define PCIALWAYSPRINTCLASSES(b,s) \
- (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
- ((b) == PCI_CLASS_DISPLAY) || \
- ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO))
-
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-#ifdef PCIDATA
-
-static XF86ModuleVersionInfo pciDataVersRec = {
- "pcidata",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- NULL,
- {0, 0, 0, 0}
-};
-
-XF86ModuleData pcidataModuleData = { &pciDataVersRec, NULL, NULL };
-
-#else
-
-static XF86ModuleVersionInfo scanPciVersRec = {
- "scanpci",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- NULL,
- {0, 0, 0, 0}
-};
-
-XF86ModuleData scanpciModuleData = { &scanPciVersRec, NULL, NULL };
-
-#endif /* PCIDATA */
-
-#endif /* XFree86LOADER */
-
-/* Initialisation/Close hooks, in case they're ever needed. */
-Bool
-ScanPciSetupPciIds(void)
-{
- return TRUE;
-}
-
-void
-ScanPciClosePciIds(void)
-{
- return;
-}
-
-/*
- * The return value is the number of strings found, or -1 for an error.
- * Requested strings that aren't found are set to NULL.
- */
-
-int
-ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
- unsigned short svendor, unsigned short subsys,
- const char **vname, const char **dname,
- const char **svname, const char **sname)
-{
- int i, j, k;
- const pciDeviceInfo **pDev;
- const pciSubsystemInfo **pSub;
-
- /* It's an error to not provide the Vendor */
- if (vendor == NOVENDOR)
- return -1;
-
- /* Initialise returns requested/provided to NULL */
- if (vname)
- *vname = NULL;
- if (device != NODEVICE && dname)
- *dname = NULL;
- if (svendor != NOVENDOR && svname)
- *svname = NULL;
- if (subsys != NOSUBSYS && sname)
- *sname = NULL;
-
- for (i = 0; pciVendorInfoList[i].VendorName; i++) {
- if (vendor == pciVendorInfoList[i].VendorID) {
- if (vname) {
- *vname = pciVendorInfoList[i].VendorName;
- }
- if (device == NODEVICE) {
- return 1;
- }
- pDev = pciVendorInfoList[i].Device;
- if (!pDev) {
- return 1;
- }
- for (j = 0; pDev[j]; j++) {
- if (device == pDev[j]->DeviceID) {
- if (dname) {
- *dname = pDev[j]->DeviceName;
- }
- if (svendor == NOVENDOR) {
- return 2;
- }
- for (k = 0; pciVendorInfoList[k].VendorName; k++) {
- if (svendor &&
- svendor == pciVendorInfoList[k].VendorID) {
- if (svname) {
- *svname = pciVendorInfoList[k].VendorName;
- }
- if (subsys == NOSUBSYS) {
- return 3;
- }
- break;
- }
- }
- if (!pciVendorInfoList[k].VendorName) {
- return 2;
- }
- pSub = pDev[j]->Subsystem;
- if (!pSub) {
- return 3;
- }
- for (k = 0; pSub[k]; k++) {
- if (svendor == pSub[k]->VendorID &&
- subsys == pSub[k]->SubsystemID) {
- if (sname)
- *sname = pSub[k]->SubsystemName;
- return 4;
- }
- }
- /* No vendor/subsys match */
- return 3;
- }
- }
- /* No device match */
- return 1;
- }
- }
- /* No vendor match */
- return 0;
-}
-
-Bool
-ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
- const char **svname, const char **sname)
-{
- int i, j;
- const pciSubsystemInfo **pSub;
-
- /* It's an error to not provide the Vendor */
- if (svendor == NOVENDOR)
- return -1;
-
- /* Initialise returns requested/provided to NULL */
- if (svname)
- *svname = NULL;
- if (subsys != NOSUBSYS && sname)
- *sname = NULL;
-
- for (i = 0; pciVendorSubsysInfoList[i].VendorName; i++) {
- if (svendor == pciVendorSubsysInfoList[i].VendorID) {
- if (svname) {
- *svname = pciVendorSubsysInfoList[i].VendorName;
- }
- if (subsys == NOSUBSYS) {
- return 1;
- }
- pSub = pciVendorSubsysInfoList[i].Subsystem;
- if (!pSub) {
- return 1;
- }
- for (j = 0; pSub[j]; j++) {
- if (subsys == pSub[j]->SubsystemID) {
- if (sname) {
- *sname = pSub[j]->SubsystemName;
- }
- }
- }
- /* No subsys match */
- return 1;
- }
- }
- /* No vendor match */
- return 0;
-}
-
-CARD32
-ScanPciFindPciClassBySubsys(unsigned short vendor, unsigned short subsys)
-{
- int i, j;
- const pciSubsystemInfo **pSub;
-
- if (vendor == NOVENDOR || subsys == NOSUBSYS)
- return 0;
-
- for (i = 0; pciVendorSubsysInfoList[i].VendorName; i++) {
- if (vendor == pciVendorSubsysInfoList[i].VendorID) {
- pSub = pciVendorSubsysInfoList[i].Subsystem;
- if (!pSub) {
- return 0;
- }
- for (j = 0; pSub[j]; j++) {
- if (subsys == pSub[j]->SubsystemID) {
- return pSub[j]->class;
- }
- }
- break;
- }
- }
- return 0;
-}
-
-CARD32
-ScanPciFindPciClassByDevice(unsigned short vendor, unsigned short device)
-{
- int i, j;
- const pciDeviceInfo **pDev;
-
- if (vendor == NOVENDOR || device == NODEVICE)
- return 0;
-
- for (i = 0; pciVendorInfoList[i].VendorName; i++) {
- if (vendor == pciVendorInfoList[i].VendorID) {
- pDev = pciVendorInfoList[i].Device;
- if (!pDev) {
- return 0;
- }
- for (j = 0; pDev[j]; j++) {
- if (device == pDev[j]->DeviceID) {
- return pDev[j]->class;
- }
- }
- break;
- }
- }
- return 0;
-}
-
-#ifndef PCIDATA
-void
-ScanPciDisplayPCICardInfo(int verbosity)
-{
- pciConfigPtr pcrp, *pcrpp;
- int i;
-
- xf86EnableIO();
- pcrpp = xf86scanpci(0);
-
- if (pcrpp == NULL) {
- xf86MsgVerb(X_NONE,0,"No PCI info available\n");
- return;
- }
- xf86MsgVerb(X_NONE,0,"Probing for PCI devices (Bus:Device:Function)\n\n");
- for (i = 0; (pcrp = pcrpp[i]); i++) {
- const char *svendorname = NULL, *subsysname = NULL;
- const char *vendorname = NULL, *devicename = NULL;
- Bool noCard = FALSE;
- const char *prefix1 = "", *prefix2 = "";
-
- xf86MsgVerb(X_NONE, -verbosity, "(%d:%d:%d) ",
- pcrp->busnum, pcrp->devnum, pcrp->funcnum);
-
- /*
- * Lookup as much as we can about the device.
- */
- if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
- ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
- NOVENDOR, NOSUBSYS,
- &vendorname, &devicename, NULL, NULL);
- } else {
- ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
- pcrp->pci_subsys_vendor,
- pcrp->pci_subsys_card,
- &vendorname, &devicename,
- &svendorname, &subsysname);
- }
-
- if (svendorname)
- xf86MsgVerb(X_NONE, -verbosity, "%s ", svendorname);
- if (subsysname)
- xf86MsgVerb(X_NONE, -verbosity, "%s ", subsysname);
- if (svendorname && !subsysname) {
- if (pcrp->pci_subsys_card && pcrp->pci_subsys_card != NOSUBSYS) {
- xf86MsgVerb(X_NONE, -verbosity, "unknown card (0x%04x) ",
- pcrp->pci_subsys_card);
- } else {
- xf86MsgVerb(X_NONE, -verbosity, "card ");
- }
- }
- if (!svendorname && !subsysname) {
- /*
- * We didn't find a text representation of the information
- * about the card.
- */
- if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
- /*
- * If there was information and we just couldn't interpret
- * it, print it out as unknown, anyway.
- */
- xf86MsgVerb(X_NONE, -verbosity,
- "unknown card (0x%04x/0x%04x) ",
- pcrp->pci_subsys_vendor, pcrp->pci_subsys_card);
- } else
- noCard = TRUE;
- }
- if (!noCard) {
- prefix1 = "using a ";
- prefix2 = "using an ";
- }
- if (vendorname && devicename) {
- xf86MsgVerb(X_NONE, -verbosity,"%s%s %s\n", prefix1, vendorname,
- devicename);
- } else if (vendorname) {
- xf86MsgVerb(X_NONE, -verbosity,
- "%sunknown chip (DeviceId 0x%04x) from %s\n",
- prefix2, pcrp->pci_device, vendorname);
- } else {
- xf86MsgVerb(X_NONE, -verbosity,
- "%sunknown chipset(0x%04x/0x%04x)\n",
- prefix2, pcrp->pci_vendor, pcrp->pci_device);
- }
- }
-}
-#endif
-
diff --git a/hw/xfree86/scanpci/xf86ScanPci.h b/hw/xfree86/scanpci/xf86ScanPci.h
deleted file mode 100644
index 3a154174a..000000000
--- a/hw/xfree86/scanpci/xf86ScanPci.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
-/*
- * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifndef SCANPCI_H_
-#define SCANPCI_H_
-
-#include "xf86PciData.h"
-
-typedef void (*ScanPciDisplayCardInfoProcPtr)(int verbosity);
-
-/*
- * Whoever loads this module needs to define these and initialise them
- * after loading.
- */
-
-extern ScanPciDisplayCardInfoProcPtr xf86DisplayPCICardInfo;
-
-void ScanPciDisplayPCICardInfo(int verbosity);
-
-#endif
diff --git a/hw/xfree86/shadowfb/sfbmodule.c b/hw/xfree86/shadowfb/sfbmodule.c
deleted file mode 100644
index 3bb14b0a9..000000000
--- a/hw/xfree86/shadowfb/sfbmodule.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/sfbmodule.c,v 1.2 1999/02/01 12:08:45 dawes Exp $ */
-
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-static XF86ModuleVersionInfo VersRec =
-{
- "shadowfb",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData shadowfbModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
deleted file mode 100644
index 093f35b30..000000000
--- a/hw/xfree86/shadowfb/shadow.c
+++ /dev/null
@@ -1,1834 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
-
- Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-
- Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan@vmware.com)
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadow.c,v 1.21 2003/11/10 18:22:38 tsi Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "pixmapstr.h"
-#include "input.h"
-#include "font.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "xf86.h"
-#include "xf86str.h"
-#include "shadowfb.h"
-
-#ifdef RENDER
-# include "picturestr.h"
-#endif
-
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
-static Bool ShadowCloseScreen (int i, ScreenPtr pScreen);
-static void ShadowRestoreAreas (
- PixmapPtr pPixmap,
- RegionPtr prgn,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-static void ShadowPaintWindow (
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-);
-static void ShadowCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgn
-);
-static Bool ShadowCreateGC(GCPtr pGC);
-static Bool ShadowModifyPixmapHeader(
- PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData
-);
-
-static Bool ShadowEnterVT(int index, int flags);
-static void ShadowLeaveVT(int index, int flags);
-
-#ifdef RENDER
-static void ShadowComposite(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height
-);
-#endif /* RENDER */
-
-
-typedef struct {
- ScrnInfoPtr pScrn;
- RefreshAreaFuncPtr preRefresh;
- RefreshAreaFuncPtr postRefresh;
- CloseScreenProcPtr CloseScreen;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- CreateGCProcPtr CreateGC;
- BackingStoreRestoreAreasProcPtr RestoreAreas;
- ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
-#ifdef RENDER
- CompositeProcPtr Composite;
-#endif /* RENDER */
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- Bool vtSema;
-} ShadowScreenRec, *ShadowScreenPtr;
-
-typedef struct {
- GCOps *ops;
- GCFuncs *funcs;
-} ShadowGCRec, *ShadowGCPtr;
-
-
-static int ShadowScreenIndex = -1;
-static int ShadowGCIndex = -1;
-static unsigned long ShadowGeneration = 0;
-
-#define GET_SCREEN_PRIVATE(pScreen) \
- (ShadowScreenPtr)((pScreen)->devPrivates[ShadowScreenIndex].ptr)
-#define GET_GC_PRIVATE(pGC) \
- (ShadowGCPtr)((pGC)->devPrivates[ShadowGCIndex].ptr)
-
-#define SHADOW_GC_FUNC_PROLOGUE(pGC)\
- ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\
- (pGC)->funcs = pGCPriv->funcs;\
- if(pGCPriv->ops)\
- (pGC)->ops = pGCPriv->ops
-
-#define SHADOW_GC_FUNC_EPILOGUE(pGC)\
- pGCPriv->funcs = (pGC)->funcs;\
- (pGC)->funcs = &ShadowGCFuncs;\
- if(pGCPriv->ops) {\
- pGCPriv->ops = (pGC)->ops;\
- (pGC)->ops = &ShadowGCOps;\
- }
-
-#define SHADOW_GC_OP_PROLOGUE(pGC)\
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pGC->pScreen); \
- ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\
- GCFuncs *oldFuncs = pGC->funcs;\
- pGC->funcs = pGCPriv->funcs;\
- pGC->ops = pGCPriv->ops
-
-
-#define SHADOW_GC_OP_EPILOGUE(pGC)\
- pGCPriv->ops = pGC->ops;\
- pGC->funcs = oldFuncs;\
- pGC->ops = &ShadowGCOps
-
-#define IS_VISIBLE(pWin) (pPriv->vtSema && \
- (((WindowPtr)pWin)->visibility != VisibilityFullyObscured))
-
-#define TRIM_BOX(box, pGC) { \
- BoxPtr extents = &pGC->pCompositeClip->extents;\
- if(box.x1 < extents->x1) box.x1 = extents->x1; \
- if(box.x2 > extents->x2) box.x2 = extents->x2; \
- if(box.y1 < extents->y1) box.y1 = extents->y1; \
- if(box.y2 > extents->y2) box.y2 = extents->y2; \
- }
-
-#define TRANSLATE_BOX(box, pDraw) { \
- box.x1 += pDraw->x; \
- box.x2 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.y2 += pDraw->y; \
- }
-
-#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
- TRANSLATE_BOX(box, pDraw); \
- TRIM_BOX(box, pGC); \
- }
-
-#define BOX_NOT_EMPTY(box) \
- (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
-
-
-
-Bool
-ShadowFBInit2 (
- ScreenPtr pScreen,
- RefreshAreaFuncPtr preRefreshArea,
- RefreshAreaFuncPtr postRefreshArea
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- ShadowScreenPtr pPriv;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif /* RENDER */
-
- if(!preRefreshArea && !postRefreshArea) return FALSE;
-
- if (ShadowGeneration != serverGeneration) {
- if(((ShadowScreenIndex = AllocateScreenPrivateIndex ()) < 0) ||
- ((ShadowGCIndex = AllocateGCPrivateIndex()) < 0))
- return FALSE;
- ShadowGeneration = serverGeneration;
- }
-
- if(!AllocateGCPrivate(pScreen, ShadowGCIndex, sizeof(ShadowGCRec)))
- return FALSE;
-
- if(!(pPriv = (ShadowScreenPtr)xalloc(sizeof(ShadowScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[ShadowScreenIndex].ptr = (pointer)pPriv;
-
- pPriv->pScrn = pScrn;
- pPriv->preRefresh = preRefreshArea;
- pPriv->postRefresh = postRefreshArea;
- pPriv->vtSema = TRUE;
-
- pPriv->CloseScreen = pScreen->CloseScreen;
- pPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
- pPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
- pPriv->CopyWindow = pScreen->CopyWindow;
- pPriv->CreateGC = pScreen->CreateGC;
- pPriv->RestoreAreas = pScreen->BackingStoreFuncs.RestoreAreas;
- pPriv->ModifyPixmapHeader = pScreen->ModifyPixmapHeader;
-
- pPriv->EnterVT = pScrn->EnterVT;
- pPriv->LeaveVT = pScrn->LeaveVT;
-
- pScreen->CloseScreen = ShadowCloseScreen;
- pScreen->PaintWindowBackground = ShadowPaintWindow;
- pScreen->PaintWindowBorder = ShadowPaintWindow;
- pScreen->CopyWindow = ShadowCopyWindow;
- pScreen->CreateGC = ShadowCreateGC;
- pScreen->BackingStoreFuncs.RestoreAreas = ShadowRestoreAreas;
- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
-
- pScrn->EnterVT = ShadowEnterVT;
- pScrn->LeaveVT = ShadowLeaveVT;
-
-#ifdef RENDER
- if(ps) {
- pPriv->Composite = ps->Composite;
- ps->Composite = ShadowComposite;
- }
-#endif /* RENDER */
-
- return TRUE;
-}
-
-Bool
-ShadowFBInit (
- ScreenPtr pScreen,
- RefreshAreaFuncPtr refreshArea
-){
- return ShadowFBInit2(pScreen, NULL, refreshArea);
-}
-
-/**********************************************************/
-
-static Bool
-ShadowEnterVT(int index, int flags)
-{
- ScrnInfoPtr pScrn = xf86Screens[index];
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen);
-
- if((*pPriv->EnterVT)(index, flags)) {
- pPriv->vtSema = TRUE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-ShadowLeaveVT(int index, int flags)
-{
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen);
-
- pPriv->vtSema = FALSE;
-
- (*pPriv->LeaveVT)(index, flags);
-}
-
-/**********************************************************/
-
-
-static Bool
-ShadowCloseScreen (int i, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif /* RENDER */
-
- pScreen->CloseScreen = pPriv->CloseScreen;
- pScreen->PaintWindowBackground = pPriv->PaintWindowBackground;
- pScreen->PaintWindowBorder = pPriv->PaintWindowBorder;
- pScreen->CopyWindow = pPriv->CopyWindow;
- pScreen->CreateGC = pPriv->CreateGC;
- pScreen->BackingStoreFuncs.RestoreAreas = pPriv->RestoreAreas;
- pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
-
- pScrn->EnterVT = pPriv->EnterVT;
- pScrn->LeaveVT = pPriv->LeaveVT;
-
-#ifdef RENDER
- if(ps) {
- ps->Composite = pPriv->Composite;
- }
-#endif /* RENDER */
-
- xfree((pointer)pPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-
-static void
-ShadowRestoreAreas (
- PixmapPtr pPixmap,
- RegionPtr prgn,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
- int num = 0;
-
- if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn)))
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
-
- pScreen->BackingStoreFuncs.RestoreAreas = pPriv->RestoreAreas;
- (*pScreen->BackingStoreFuncs.RestoreAreas) (
- pPixmap, prgn, xorg, yorg, pWin);
- pScreen->BackingStoreFuncs.RestoreAreas = ShadowRestoreAreas;
-
- if(num && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
-}
-
-
-static void
-ShadowPaintWindow(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
- int num = 0;
-
- if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn)))
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
-
- if(what == PW_BACKGROUND) {
- pScreen->PaintWindowBackground = pPriv->PaintWindowBackground;
- (*pScreen->PaintWindowBackground) (pWin, prgn, what);
- pScreen->PaintWindowBackground = ShadowPaintWindow;
- } else {
- pScreen->PaintWindowBorder = pPriv->PaintWindowBorder;
- (*pScreen->PaintWindowBorder) (pWin, prgn, what);
- pScreen->PaintWindowBorder = ShadowPaintWindow;
- }
-
- if(num && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
-}
-
-
-static void
-ShadowCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgn
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
- int num = 0;
- RegionRec rgnDst;
-
- if (pPriv->vtSema) {
- REGION_NULL(pWin->drawable.pScreen, &rgnDst);
- REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn);
-
- REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst,
- pWin->drawable.x - ptOldOrg.x,
- pWin->drawable.y - ptOldOrg.y);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, &rgnDst);
- if ((num = REGION_NUM_RECTS(&rgnDst))) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
- } else {
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- }
- }
-
- pScreen->CopyWindow = pPriv->CopyWindow;
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgn);
- pScreen->CopyWindow = ShadowCopyWindow;
-
- if (num) {
- if (pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- }
-}
-
-static Bool
-ShadowModifyPixmapHeader(
- PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData
-)
-{
- ScreenPtr pScreen;
- ScrnInfoPtr pScrn;
- ShadowScreenPtr pPriv;
- Bool retval;
- PixmapPtr pScreenPix;
-
- if (!pPixmap)
- return FALSE;
-
- pScreen = pPixmap->drawable.pScreen;
- pScrn = xf86Screens[pScreen->myNum];
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- if (pPixmap == pScreenPix && !pScrn->vtSema)
- pScreenPix->devPrivate = pScrn->pixmapPrivate;
-
- pPriv = GET_SCREEN_PRIVATE(pScreen);
-
- pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
- retval = (*pScreen->ModifyPixmapHeader)(pPixmap,
- width, height, depth, bitsPerPixel, devKind, pPixData);
- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
-
- if (pPixmap == pScreenPix && !pScrn->vtSema)
- {
- pScrn->pixmapPrivate = pScreenPix->devPrivate;
- pScreenPix->devPrivate.ptr = 0;
- }
- return retval;
-}
-
-#ifdef RENDER
-static void
-ShadowComposite(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height
-){
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- BoxRec box;
- BoxPtr extents;
- Bool boxNotEmpty = FALSE;
-
- if (pPriv->vtSema
- && pDst->pDrawable->type == DRAWABLE_WINDOW) {
-
- box.x1 = pDst->pDrawable->x + xDst;
- box.y1 = pDst->pDrawable->y + yDst;
- box.x2 = box.x1 + width;
- box.y2 = box.y1 + height;
-
- extents = &pDst->pCompositeClip->extents;
- if(box.x1 < extents->x1) box.x1 = extents->x1;
- if(box.x2 > extents->x2) box.x2 = extents->x2;
- if(box.y1 < extents->y1) box.y1 = extents->y1;
- if(box.y2 > extents->y2) box.y2 = extents->y2;
-
- if (BOX_NOT_EMPTY(box)) {
- if (pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- ps->Composite = pPriv->Composite;
- (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height);
- ps->Composite = ShadowComposite;
-
- if (pPriv->postRefresh && boxNotEmpty) {
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- }
-}
-#endif /* RENDER */
-
-/**********************************************************/
-
-static void ShadowValidateGC(GCPtr, unsigned long, DrawablePtr);
-static void ShadowChangeGC(GCPtr, unsigned long);
-static void ShadowCopyGC(GCPtr, unsigned long, GCPtr);
-static void ShadowDestroyGC(GCPtr);
-static void ShadowChangeClip(GCPtr, int, pointer, int);
-static void ShadowDestroyClip(GCPtr);
-static void ShadowCopyClip(GCPtr, GCPtr);
-
-GCFuncs ShadowGCFuncs = {
- ShadowValidateGC, ShadowChangeGC, ShadowCopyGC, ShadowDestroyGC,
- ShadowChangeClip, ShadowDestroyClip, ShadowCopyClip
-};
-
-
-extern GCOps ShadowGCOps;
-
-static Bool
-ShadowCreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
- ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);
- Bool ret;
-
- pScreen->CreateGC = pPriv->CreateGC;
- if((ret = (*pScreen->CreateGC) (pGC))) {
- pGCPriv->ops = NULL;
- pGCPriv->funcs = pGC->funcs;
- pGC->funcs = &ShadowGCFuncs;
- }
- pScreen->CreateGC = ShadowCreateGC;
-
- return ret;
-}
-
-
-static void
-ShadowValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
- if(pDraw->type == DRAWABLE_WINDOW)
- pGCPriv->ops = pGC->ops; /* just so it's not NULL */
- else
- pGCPriv->ops = NULL;
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-static void
-ShadowDestroyGC(GCPtr pGC)
-{
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->DestroyGC)(pGC);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-ShadowChangeGC (
- GCPtr pGC,
- unsigned long mask
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-ShadowCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-){
- SHADOW_GC_FUNC_PROLOGUE (pGCDst);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- SHADOW_GC_FUNC_EPILOGUE (pGCDst);
-}
-
-static void
-ShadowChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-ShadowCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- SHADOW_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- SHADOW_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-ShadowDestroyClip(GCPtr pGC)
-{
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-
-
-/**********************************************************/
-
-
-static void
-ShadowFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nInit) {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nInit;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidth++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
-
- box.y2++;
-
- if(!pGC->miTranslate) {
- TRANSLATE_BOX(box, pDraw);
- }
- TRIM_BOX(box, pGC);
-
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
-
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- } else
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowSetSpans(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int nspans,
- int fSorted
-){
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nspans) {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nspans;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidth++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
-
- box.y2++;
-
- if(!pGC->miTranslate) {
- TRANSLATE_BOX(box, pDraw);
- }
- TRIM_BOX(box, pGC);
-
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
-
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
- pwidthInit, nspans, fSorted);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- } else
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
- pwidthInit, nspans, fSorted);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw)) {
- box.x1 = x + pDraw->x;
- box.x2 = box.x1 + w;
- box.y1 = y + pDraw->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
-}
-
-static RegionPtr
-ShadowCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- RegionPtr ret;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDst)) {
- box.x1 = dstx + pDst->x;
- box.x2 = box.x1 + width;
- box.y1 = dsty + pDst->y;
- box.y2 = box.y1 + height;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
- return ret;
-}
-
-static RegionPtr
-ShadowCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- RegionPtr ret;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDst)) {
- box.x1 = dstx + pDst->x;
- box.x2 = box.x1 + width;
- box.y1 = dsty + pDst->y;
- box.y2 = box.y1 + height;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
- return ret;
-}
-
-static void
-ShadowPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int nptInit,
- xPoint *pptInit
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nptInit) {
- xPoint *ppt = pptInit;
- int npt = nptInit;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- /* this could be slow if the points were spread out */
-
- while(--npt) {
- ppt++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- else if(box.x2 < ppt->x) box.x2 = ppt->x;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, nptInit, pptInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int nptInit,
- DDXPointPtr pptInit
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nptInit) {
- DDXPointPtr ppt = pptInit;
- int npt = nptInit;
- int extra = pGC->lineWidth >> 1;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- if(npt > 1) {
- if(pGC->joinStyle == JoinMiter)
- extra = 6 * pGC->lineWidth;
- else if(pGC->capStyle == CapProjecting)
- extra = pGC->lineWidth;
- }
-
- if(mode == CoordModePrevious) {
- int x = box.x1;
- int y = box.y1;
- while(--npt) {
- ppt++;
- x += ppt->x;
- y += ppt->y;
- if(box.x1 > x) box.x1 = x;
- else if(box.x2 < x) box.x2 = x;
- if(box.y1 > y) box.y1 = y;
- else if(box.y2 < y) box.y2 = y;
- }
- } else {
- while(--npt) {
- ppt++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- else if(box.x2 < ppt->x) box.x2 = ppt->x;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->Polylines)(pDraw, pGC, mode, nptInit, pptInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nsegInit,
- xSegment *pSegInit
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nsegInit) {
- int extra = pGC->lineWidth;
- xSegment *pSeg = pSegInit;
- int nseg = nsegInit;
-
- if(pGC->capStyle != CapProjecting)
- extra >>= 1;
-
- if(pSeg->x2 > pSeg->x1) {
- box.x1 = pSeg->x1;
- box.x2 = pSeg->x2;
- } else {
- box.x2 = pSeg->x1;
- box.x1 = pSeg->x2;
- }
-
- if(pSeg->y2 > pSeg->y1) {
- box.y1 = pSeg->y1;
- box.y2 = pSeg->y2;
- } else {
- box.y2 = pSeg->y1;
- box.y1 = pSeg->y2;
- }
-
- while(--nseg) {
- pSeg++;
- if(pSeg->x2 > pSeg->x1) {
- if(pSeg->x1 < box.x1) box.x1 = pSeg->x1;
- if(pSeg->x2 > box.x2) box.x2 = pSeg->x2;
- } else {
- if(pSeg->x2 < box.x1) box.x1 = pSeg->x2;
- if(pSeg->x1 > box.x2) box.x2 = pSeg->x1;
- }
- if(pSeg->y2 > pSeg->y1) {
- if(pSeg->y1 < box.y1) box.y1 = pSeg->y1;
- if(pSeg->y2 > box.y2) box.y2 = pSeg->y2;
- } else {
- if(pSeg->y2 < box.y1) box.y1 = pSeg->y2;
- if(pSeg->y1 > box.y2) box.y2 = pSeg->y1;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PolySegment)(pDraw, pGC, nsegInit, pSegInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- BoxRec box;
- BoxPtr pBoxInit = NULL;
- Bool boxNotEmpty = FALSE;
- int num = 0;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nRectsInit) {
- xRectangle *pRects = pRectsInit;
- int nRects = nRectsInit;
-
- if(nRects >= 32) {
- int extra = pGC->lineWidth >> 1;
-
- box.x1 = pRects->x;
- box.x2 = box.x1 + pRects->width;
- box.y1 = pRects->y;
- box.y2 = box.y1 + pRects->height;
-
- while(--nRects) {
- pRects++;
- if(box.x1 > pRects->x) box.x1 = pRects->x;
- if(box.x2 < (pRects->x + pRects->width))
- box.x2 = pRects->x + pRects->width;
- if(box.y1 > pRects->y) box.y1 = pRects->y;
- if(box.y2 < (pRects->y + pRects->height))
- box.y2 = pRects->y + pRects->height;
- }
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- } else {
- BoxPtr pbox;
- int offset1, offset2, offset3;
-
- offset2 = pGC->lineWidth;
- if(!offset2) offset2 = 1;
- offset1 = offset2 >> 1;
- offset3 = offset2 - offset1;
-
- pBoxInit = (BoxPtr)ALLOCATE_LOCAL(nRects * 4 * sizeof(BoxRec));
- pbox = pBoxInit;
-
- while(nRects--) {
- pbox->x1 = pRects->x - offset1;
- pbox->y1 = pRects->y - offset1;
- pbox->x2 = pbox->x1 + pRects->width + offset2;
- pbox->y2 = pbox->y1 + offset2;
- TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
- if(BOX_NOT_EMPTY((*pbox))) {
- num++;
- pbox++;
- }
-
- pbox->x1 = pRects->x - offset1;
- pbox->y1 = pRects->y + offset3;
- pbox->x2 = pbox->x1 + offset2;
- pbox->y2 = pbox->y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
- if(BOX_NOT_EMPTY((*pbox))) {
- num++;
- pbox++;
- }
-
- pbox->x1 = pRects->x + pRects->width - offset1;
- pbox->y1 = pRects->y + offset3;
- pbox->x2 = pbox->x1 + offset2;
- pbox->y2 = pbox->y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
- if(BOX_NOT_EMPTY((*pbox))) {
- num++;
- pbox++;
- }
-
- pbox->x1 = pRects->x - offset1;
- pbox->y1 = pRects->y + pRects->height - offset1;
- pbox->x2 = pbox->x1 + pRects->width + offset2;
- pbox->y2 = pbox->y1 + offset2;
- TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
- if(BOX_NOT_EMPTY((*pbox))) {
- num++;
- pbox++;
- }
-
- pRects++;
- }
-
- if(num) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, num, pBoxInit);
- } else {
- DEALLOCATE_LOCAL(pBoxInit);
- }
- }
- }
-
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
-
- if(boxNotEmpty && pPriv->postRefresh) {
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- } else if(num) {
- if(pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, num, pBoxInit);
- DEALLOCATE_LOCAL(pBoxInit);
- }
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
-}
-
-static void
-ShadowPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcsInit,
- xArc *parcsInit
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && narcsInit) {
- int narcs = narcsInit;
- xArc *parcs = parcsInit;
- int extra = pGC->lineWidth >> 1;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x) box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y) box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PolyArc)(pDraw, pGC, narcsInit, parcsInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
-}
-
-static void
-ShadowFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr pptInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && (count > 2)) {
- DDXPointPtr ppt = pptInit;
- int i = count;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- box.x2 = box.x1 = ppt->x;
- box.y2 = box.y1 = ppt->y;
-
- if(mode != CoordModeOrigin) {
- int x = box.x1;
- int y = box.y1;
- while(--i) {
- ppt++;
- x += ppt->x;
- y += ppt->y;
- if(box.x1 > x) box.x1 = x;
- else if(box.x2 < x) box.x2 = x;
- if(box.y1 > y) box.y1 = y;
- else if(box.y2 < y) box.y2 = y;
- }
- } else {
- while(--i) {
- ppt++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- else if(box.x2 < ppt->x) box.x2 = ppt->x;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
-
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- } else
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-ShadowPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nRectsInit) {
- BoxRec box;
- Bool boxNotEmpty = FALSE;
- xRectangle *pRects = pRectsInit;
- int nRects = nRectsInit;
-
- box.x1 = pRects->x;
- box.x2 = box.x1 + pRects->width;
- box.y1 = pRects->y;
- box.y2 = box.y1 + pRects->height;
-
- while(--nRects) {
- pRects++;
- if(box.x1 > pRects->x) box.x1 = pRects->x;
- if(box.x2 < (pRects->x + pRects->width))
- box.x2 = pRects->x + pRects->width;
- if(box.y1 > pRects->y) box.y1 = pRects->y;
- if(box.y2 < (pRects->y + pRects->height))
- box.y2 = pRects->y + pRects->height;
- }
-
- /* cfb messes with the pRectsInit so we have to do our
- calculations first */
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
-
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
- } else
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-ShadowPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcsInit,
- xArc *parcsInit
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && narcsInit) {
- xArc *parcs = parcsInit;
- int narcs = narcsInit;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x) box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y) box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcsInit, parcsInit);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowTextExtent(FontPtr pFont, int count, char* chars,
- FontEncoding fontEncoding, BoxPtr box)
-{
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pFont, (unsigned long)count, (unsigned char *)chars,
- fontEncoding, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) {
- w += charinfo[i]->metrics.characterWidth;
- }
- if (i) {
- w += charinfo[i - 1]->metrics.rightSideBearing;
- }
-
- box->x1 = 0;
- if (n) {
- if (charinfo[0]->metrics.leftSideBearing < 0) {
- box->x1 = charinfo[0]->metrics.leftSideBearing;
- }
- }
- box->x2 = w;
- box->y1 = -FONTMAXBOUNDS(pFont,ascent);
- box->y2 = FONTMAXBOUNDS(pFont,descent);
-}
-
-
-
-static void
-ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- int count, char *chars, int wide)
-{
- FontPtr pFont;
-
- pFont = pGC->font;
- if (pFont->info.constantWidth) {
- int ascent, descent, left, right = 0;
-
- ascent = MAX(pFont->info.fontAscent, pFont->info.maxbounds.ascent);
- descent = MAX(pFont->info.fontDescent, pFont->info.maxbounds.descent);
- left = pFont->info.maxbounds.leftSideBearing;
- if (count > 0) {
- right = (count - 1) * pFont->info.maxbounds.characterWidth;
- }
- right += pFont->info.maxbounds.rightSideBearing;
- BB->x1 =
- MAX(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->x1);
- BB->y1 =
- MAX(pDrawable->y + y - ascent,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->y1);
- BB->x2 =
- MIN(pDrawable->x + x + right,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->x2);
- BB->y2 =
- MIN(pDrawable->y + y + descent,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->y2);
- } else {
- ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
- ? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
- BB->x1 =
- MAX(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->x1);
- BB->y1 =
- MAX(pDrawable->y + y + BB->y1,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->y1);
- BB->x2 =
- MIN(pDrawable->x + x + BB->x2,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->x2);
- BB->y2 =
- MIN(pDrawable->y + y + BB->y2,
- (REGION_EXTENTS(pGC->pScreen,
- &((WindowPtr) pDrawable)->winSize))->y2);
- }
-}
-
-static int
-ShadowPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int width;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw)) {
- ShadowFontToBox(&box, pDraw, pGC, x, y, count, chars, 0);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- width = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
- return width;
-}
-
-static int
-ShadowPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int width;
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw)) {
- ShadowFontToBox(&box, pDraw, pGC, x, y, count, (char*)chars, 1);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- width = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-
- return width;
-}
-
-static void
-ShadowImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && count) {
- int top, bot, Min, Max;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = pDraw->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-static void
-ShadowImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && count) {
- int top, bot, Min, Max;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = pDraw->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-ShadowImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyphInit,
- CharInfoPtr *ppciInit,
- pointer pglyphBase
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nglyphInit) {
- CharInfoPtr *ppci = ppciInit;
- unsigned int nglyph = nglyphInit;
- int top, bot, width = 0;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- box.x1 = ppci[0]->metrics.leftSideBearing;
- if(box.x1 > 0) box.x1 = 0;
- box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing -
- ppci[nglyph - 1]->metrics.characterWidth;
- if(box.x2 < 0) box.x2 = 0;
-
- box.x2 += pDraw->x + x;
- box.x1 += pDraw->x + x;
-
- while(nglyph--) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0)
- box.x2 += width;
- else
- box.x1 += width;
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, nglyphInit,
- ppciInit, pglyphBase);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyphInit,
- CharInfoPtr *ppciInit,
- pointer pglyphBase
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw) && nglyphInit) {
- CharInfoPtr *ppci = ppciInit;
- unsigned int nglyph = nglyphInit;
-
- /* ugh */
- box.x1 = pDraw->x + x + ppci[0]->metrics.leftSideBearing;
- box.x2 = pDraw->x + x + ppci[nglyph - 1]->metrics.rightSideBearing;
-
- if(nglyph > 1) {
- int width = 0;
-
- while(--nglyph) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, nglyphInit,
- ppciInit, pglyphBase);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-ShadowPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- BoxRec box;
- Bool boxNotEmpty = FALSE;
-
- SHADOW_GC_OP_PROLOGUE(pGC);
-
- if(IS_VISIBLE(pDraw)) {
- box.x1 = xOrg;
- box.y1 = yOrg;
-
- if(!pGC->miTranslate) {
- box.x1 += pDraw->x;
- box.y1 += pDraw->y;
- }
-
- box.x2 = box.x1 + dx;
- box.y2 = box.y1 + dy;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box)) {
- if(pPriv->preRefresh)
- (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
- boxNotEmpty = TRUE;
- }
- }
-
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-
- if(boxNotEmpty && pPriv->postRefresh)
- (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
-
- SHADOW_GC_OP_EPILOGUE(pGC);
-}
-
-
-GCOps ShadowGCOps = {
- ShadowFillSpans, ShadowSetSpans,
- ShadowPutImage, ShadowCopyArea,
- ShadowCopyPlane, ShadowPolyPoint,
- ShadowPolylines, ShadowPolySegment,
- ShadowPolyRectangle, ShadowPolyArc,
- ShadowFillPolygon, ShadowPolyFillRect,
- ShadowPolyFillArc, ShadowPolyText8,
- ShadowPolyText16, ShadowImageText8,
- ShadowImageText16, ShadowImageGlyphBlt,
- ShadowPolyGlyphBlt, ShadowPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
diff --git a/hw/xfree86/shadowfb/shadowfb.h b/hw/xfree86/shadowfb/shadowfb.h
deleted file mode 100644
index d028980bd..000000000
--- a/hw/xfree86/shadowfb/shadowfb.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadowfb.h,v 1.4 2003/02/18 19:10:35 alanh Exp $ */
-
-#ifndef _SHADOWFB_H
-#define _SHADOWFB_H
-
-#include "xf86str.h"
-
-/*
- * User defined callback function. Passed a pointer to the ScrnInfo struct,
- * the number of dirty rectangles, and a pointer to the first dirty rectangle
- * in the array.
- */
-typedef void (*RefreshAreaFuncPtr)(ScrnInfoPtr, int, BoxPtr);
-
-/*
- * ShadowFBInit initializes the shadowfb subsystem. refreshArea is a pointer
- * to a user supplied callback function. This function will be called after
- * any operation that modifies the framebuffer. The newly dirtied rectangles
- * are passed to the callback.
- *
- * Returns FALSE in the event of an error.
- */
-Bool
-ShadowFBInit (
- ScreenPtr pScreen,
- RefreshAreaFuncPtr refreshArea
-);
-
-/*
- * ShadowFBInit2 is a more featureful refinement of the original shadowfb.
- * ShadowFBInit2 allows you to specify two callbacks, one to be called
- * immediately before an operation that modifies the framebuffer, and another
- * to be called immediately after.
- *
- * Returns FALSE in the event of an error
- */
-Bool
-ShadowFBInit2 (
- ScreenPtr pScreen,
- RefreshAreaFuncPtr preRefreshArea,
- RefreshAreaFuncPtr postRefreshArea
-);
-
-#endif /* _SHADOWFB_H */
diff --git a/hw/xfree86/utils/gtf/gtf.c b/hw/xfree86/utils/gtf/gtf.c
deleted file mode 100644
index b0d9de058..000000000
--- a/hw/xfree86/utils/gtf/gtf.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/* gtf.c Generate mode timings using the GTF Timing Standard
- *
- * gcc gtf.c -o gtf -lm -Wall
- *
- * Copyright (c) 2001, Andy Ritger aritger@nvidia.com
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * o Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * o Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * o Neither the name of NVIDIA nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- *
- *
- * This program is based on the Generalized Timing Formula(GTF TM)
- * Standard Version: 1.0, Revision: 1.0
- *
- * The GTF Document contains the following Copyright information:
- *
- * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards
- * Association. Duplication of this document within VESA member
- * companies for review purposes is permitted. All other rights
- * reserved.
- *
- * While every precaution has been taken in the preparation
- * of this standard, the Video Electronics Standards Association and
- * its contributors assume no responsibility for errors or omissions,
- * and make no warranties, expressed or implied, of functionality
- * of suitability for any purpose. The sample code contained within
- * this standard may be used without restriction.
- *
- *
- *
- * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive)
- * implementation of the GTF Timing Standard, is available at:
- *
- * ftp://ftp.vesa.org/pub/GTF/GTF_V1R1.xls
- *
- *
- *
- * This program takes a desired resolution and vertical refresh rate,
- * and computes mode timings according to the GTF Timing Standard.
- * These mode timings can then be formatted as an XFree86 modeline
- * or a mode description for use by fbset(8).
- *
- *
- *
- * NOTES:
- *
- * The GTF allows for computation of "margins" (the visible border
- * surrounding the addressable video); on most non-overscan type
- * systems, the margin period is zero. I've implemented the margin
- * computations but not enabled it because 1) I don't really have
- * any experience with this, and 2) neither XFree86 modelines nor
- * fbset fb.modes provide an obvious way for margin timings to be
- * included in their mode descriptions (needs more investigation).
- *
- * The GTF provides for computation of interlaced mode timings;
- * I've implemented the computations but not enabled them, yet.
- * I should probably enable and test this at some point.
- *
- *
- *
- * TODO:
- *
- * o Add support for interlaced modes.
- *
- * o Implement the other portions of the GTF: compute mode timings
- * given either the desired pixel clock or the desired horizontal
- * frequency.
- *
- * o It would be nice if this were more general purpose to do things
- * outside the scope of the GTF: like generate double scan mode
- * timings, for example.
- *
- * o Printing digits to the right of the decimal point when the
- * digits are 0 annoys me.
- *
- * o Error checking.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/gtf.c,v 1.3 2002/12/21 02:35:20 dawes Exp $ */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-#if defined(__Lynx__)
-#define rint(x) floor(x)
-#endif
-
-#define MARGIN_PERCENT 1.8 /* % of active vertical image */
-#define CELL_GRAN 8.0 /* assumed character cell granularity */
-#define MIN_PORCH 1 /* minimum front porch */
-#define V_SYNC_RQD 3 /* width of vsync in lines */
-#define H_SYNC_PERCENT 8.0 /* width of hsync as % of total line */
-#define MIN_VSYNC_PLUS_BP 550.0 /* min time of vsync + back porch (microsec) */
-#define M 600.0 /* blanking formula gradient */
-#define C 40.0 /* blanking formula offset */
-#define K 128.0 /* blanking formula scaling factor */
-#define J 20.0 /* blanking formula scaling factor */
-
-/* C' and M' are part of the Blanking Duty Cycle computation */
-
-#define C_PRIME (((C - J) * K/256.0) + J)
-#define M_PRIME (K/256.0 * M)
-
-
-/* struct definitions */
-
-typedef struct __mode
-{
- int hr, hss, hse, hfl;
- int vr, vss, vse, vfl;
- float pclk, h_freq, v_freq;
-} mode;
-
-
-typedef struct __options
-{
- int x, y;
- int xf86mode, fbmode;
- float v_freq;
-} options;
-
-
-
-
-/* prototypes */
-
-void print_value(int n, char *name, float val);
-void print_xf86_mode (mode *m);
-void print_fb_mode (mode *m);
-mode *vert_refresh (int h_pixels, int v_lines, float freq,
- int interlaced, int margins);
-options *parse_command_line (int argc, char *argv[]);
-
-
-
-
-/*
- * print_value() - print the result of the named computation; this is
- * useful when comparing against the GTF EXCEL spreadsheet.
- */
-
-int global_verbose = 0;
-
-void print_value(int n, char *name, float val)
-{
- if (global_verbose) {
- printf("%2d: %-27s: %15f\n", n, name, val);
- }
-}
-
-
-
-/* print_xf86_mode() - print the XFree86 modeline, given mode timings. */
-
-void print_xf86_mode (mode *m)
-{
- printf ("\n");
- printf (" # %dx%d @ %.2f Hz (GTF) hsync: %.2f kHz; pclk: %.2f MHz\n",
- m->hr, m->vr, m->v_freq, m->h_freq, m->pclk);
-
- printf (" Modeline \"%dx%d_%.2f\" %.2f"
- " %d %d %d %d"
- " %d %d %d %d"
- " -HSync +Vsync\n\n",
- m->hr, m->vr, m->v_freq, m->pclk,
- m->hr, m->hss, m->hse, m->hfl,
- m->vr, m->vss, m->vse, m->vfl);
-
-}
-
-
-
-/*
- * print_fb_mode() - print a mode description in fbset(8) format;
- * see the fb.modes(8) manpage. The timing description used in
- * this is rather odd; they use "left and right margin" to refer
- * to the portion of the hblank before and after the sync pulse
- * by conceptually wrapping the portion of the blank after the pulse
- * to infront of the visible region; ie:
- *
- *
- * Timing description I'm accustomed to:
- *
- *
- *
- * <--------1--------> <--2--> <--3--> <--4-->
- * _________
- * |-------------------|_______| |_______
- *
- * R SS SE FL
- *
- * 1: visible image
- * 2: blank before sync (aka front porch)
- * 3: sync pulse
- * 4: blank after sync (aka back porch)
- * R: Resolution
- * SS: Sync Start
- * SE: Sync End
- * FL: Frame Length
- *
- *
- * But the fb.modes format is:
- *
- *
- * <--4--> <--------1--------> <--2--> <--3-->
- * _________
- * _______|-------------------|_______| |
- *
- * The fb.modes(8) manpage refers to <4> and <2> as the left and
- * right "margin" (as well as upper and lower margin in the vertical
- * direction) -- note that this has nothing to do with the term
- * "margin" used in the GTF Timing Standard.
- *
- * XXX always prints the 32 bit mode -- should I provide a command
- * line option to specify the bpp? It's simple enough for a user
- * to edit the mode description after it's generated.
- */
-
-void print_fb_mode (mode *m)
-{
- printf ("\n");
- printf ("mode \"%dx%d %.2fHz 32bit (GTF)\"\n",
- m->hr, m->vr, m->v_freq);
- printf (" # PCLK: %.2f MHz, H: %.2f kHz, V: %.2f Hz\n",
- m->pclk, m->h_freq, m->v_freq);
- printf (" geometry %d %d %d %d 32\n",
- m->hr, m->vr, m->hr, m->vr);
- printf (" timings %d %d %d %d %d %d %d\n",
- (int) rint(1000000.0/m->pclk),/* pixclock in picoseconds */
- m->hfl - m->hse, /* left margin (in pixels) */
- m->hss - m->hr, /* right margin (in pixels) */
- m->vfl - m->vse, /* upper margin (in pixel lines) */
- m->vss - m->vr, /* lower margin (in pixel lines) */
- m->hse - m->hss, /* horizontal sync length (pixels) */
- m->vse - m->vss); /* vert sync length (pixel lines) */
- printf (" hsync low\n");
- printf (" vsync high\n");
- printf ("endmode\n\n");
-
-}
-
-
-
-
-/*
- * vert_refresh() - as defined by the GTF Timing Standard, compute the
- * Stage 1 Parameters using the vertical refresh frequency. In other
- * words: input a desired resolution and desired refresh rate, and
- * output the GTF mode timings.
- *
- * XXX All the code is in place to compute interlaced modes, but I don't
- * feel like testing it right now.
- *
- * XXX margin computations are implemented but not tested (nor used by
- * XFree86 of fbset mode descriptions, from what I can tell).
- */
-
-mode *vert_refresh (int h_pixels, int v_lines, float freq,
- int interlaced, int margins)
-{
- float h_pixels_rnd;
- float v_lines_rnd;
- float v_field_rate_rqd;
- float top_margin;
- float bottom_margin;
- float interlace;
- float h_period_est;
- float vsync_plus_bp;
- float v_back_porch;
- float total_v_lines;
- float v_field_rate_est;
- float h_period;
- float v_field_rate;
- float v_frame_rate;
- float left_margin;
- float right_margin;
- float total_active_pixels;
- float ideal_duty_cycle;
- float h_blank;
- float total_pixels;
- float pixel_freq;
- float h_freq;
-
- float h_sync;
- float h_front_porch;
- float v_odd_front_porch_lines;
-
- mode *m = (mode*) malloc (sizeof (mode));
-
-
- /* 1. In order to give correct results, the number of horizontal
- * pixels requested is first processed to ensure that it is divisible
- * by the character size, by rounding it to the nearest character
- * cell boundary:
- *
- * [H PIXELS RND] = ((ROUND([H PIXELS]/[CELL GRAN RND],0))*[CELLGRAN RND])
- */
-
- h_pixels_rnd = rint((float) h_pixels / CELL_GRAN) * CELL_GRAN;
-
- print_value(1, "[H PIXELS RND]", h_pixels_rnd);
-
-
- /* 2. If interlace is requested, the number of vertical lines assumed
- * by the calculation must be halved, as the computation calculates
- * the number of vertical lines per field. In either case, the
- * number of lines is rounded to the nearest integer.
- *
- * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0),
- * ROUND([V LINES],0))
- */
-
- v_lines_rnd = interlaced ?
- rint((float) v_lines) / 2.0 :
- rint((float) v_lines);
-
- print_value(2, "[V LINES RND]", v_lines_rnd);
-
-
- /* 3. Find the frame rate required:
- *
- * [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2,
- * [I/P FREQ RQD])
- */
-
- v_field_rate_rqd = interlaced ? (freq * 2.0) : (freq);
-
- print_value(3, "[V FIELD RATE RQD]", v_field_rate_rqd);
-
-
- /* 4. Find number of lines in Top margin:
- *
- * [TOP MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
- * ROUND(([MARGIN%]/100*[V LINES RND]),0),
- * 0)
- */
-
- top_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0);
-
- print_value(4, "[TOP MARGIN (LINES)]", top_margin);
-
-
- /* 5. Find number of lines in Bottom margin:
- *
- * [BOT MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
- * ROUND(([MARGIN%]/100*[V LINES RND]),0),
- * 0)
- */
-
- bottom_margin = margins ? rint(MARGIN_PERCENT/100.0 * v_lines_rnd) : (0.0);
-
- print_value(5, "[BOT MARGIN (LINES)]", bottom_margin);
-
-
- /* 6. If interlace is required, then set variable [INTERLACE]=0.5:
- *
- * [INTERLACE]=(IF([INT RQD?]="y",0.5,0))
- */
-
- interlace = interlaced ? 0.5 : 0.0;
-
- print_value(6, "[INTERLACE]", interlace);
-
-
- /* 7. Estimate the Horizontal period
- *
- * [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) /
- * ([V LINES RND] + (2*[TOP MARGIN (LINES)]) +
- * [MIN PORCH RND]+[INTERLACE]) * 1000000
- */
-
- h_period_est = (((1.0/v_field_rate_rqd) - (MIN_VSYNC_PLUS_BP/1000000.0))
- / (v_lines_rnd + (2*top_margin) + MIN_PORCH + interlace)
- * 1000000.0);
-
- print_value(7, "[H PERIOD EST]", h_period_est);
-
-
- /* 8. Find the number of lines in V sync + back porch:
- *
- * [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0)
- */
-
- vsync_plus_bp = rint(MIN_VSYNC_PLUS_BP/h_period_est);
-
- print_value(8, "[V SYNC+BP]", vsync_plus_bp);
-
-
- /* 9. Find the number of lines in V back porch alone:
- *
- * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND]
- *
- * XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]?
- */
-
- v_back_porch = vsync_plus_bp - V_SYNC_RQD;
-
- print_value(9, "[V BACK PORCH]", v_back_porch);
-
-
- /* 10. Find the total number of lines in Vertical field period:
- *
- * [TOTAL V LINES] = [V LINES RND] + [TOP MARGIN (LINES)] +
- * [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] +
- * [MIN PORCH RND]
- */
-
- total_v_lines = v_lines_rnd + top_margin + bottom_margin + vsync_plus_bp +
- interlace + MIN_PORCH;
-
- print_value(10, "[TOTAL V LINES]", total_v_lines);
-
-
- /* 11. Estimate the Vertical field frequency:
- *
- * [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000
- */
-
- v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0;
-
- print_value(11, "[V FIELD RATE EST]", v_field_rate_est);
-
-
- /* 12. Find the actual horizontal period:
- *
- * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST])
- */
-
- h_period = h_period_est / (v_field_rate_rqd / v_field_rate_est);
-
- print_value(12, "[H PERIOD]", h_period);
-
-
- /* 13. Find the actual Vertical field frequency:
- *
- * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000
- */
-
- v_field_rate = 1.0 / h_period / total_v_lines * 1000000.0;
-
- print_value(13, "[V FIELD RATE]", v_field_rate);
-
-
- /* 14. Find the Vertical frame frequency:
- *
- * [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE]))
- */
-
- v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate;
-
- print_value(14, "[V FRAME RATE]", v_frame_rate);
-
-
- /* 15. Find number of pixels in left margin:
- *
- * [LEFT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
- * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
- * [CELL GRAN RND]),0)) * [CELL GRAN RND],
- * 0))
- */
-
- left_margin = margins ?
- rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
- 0.0;
-
- print_value(15, "[LEFT MARGIN (PIXELS)]", left_margin);
-
-
- /* 16. Find number of pixels in right margin:
- *
- * [RIGHT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
- * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
- * [CELL GRAN RND]),0)) * [CELL GRAN RND],
- * 0))
- */
-
- right_margin = margins ?
- rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
- 0.0;
-
- print_value(16, "[RIGHT MARGIN (PIXELS)]", right_margin);
-
-
- /* 17. Find total number of active pixels in image and left and right
- * margins:
- *
- * [TOTAL ACTIVE PIXELS] = [H PIXELS RND] + [LEFT MARGIN (PIXELS)] +
- * [RIGHT MARGIN (PIXELS)]
- */
-
- total_active_pixels = h_pixels_rnd + left_margin + right_margin;
-
- print_value(17, "[TOTAL ACTIVE PIXELS]", total_active_pixels);
-
-
- /* 18. Find the ideal blanking duty cycle from the blanking duty cycle
- * equation:
- *
- * [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000)
- */
-
- ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0);
-
- print_value(18, "[IDEAL DUTY CYCLE]", ideal_duty_cycle);
-
-
- /* 19. Find the number of pixels in the blanking time to the nearest
- * double character cell:
- *
- * [H BLANK (PIXELS)] = (ROUND(([TOTAL ACTIVE PIXELS] *
- * [IDEAL DUTY CYCLE] /
- * (100-[IDEAL DUTY CYCLE]) /
- * (2*[CELL GRAN RND])), 0))
- * * (2*[CELL GRAN RND])
- */
-
- h_blank = rint(total_active_pixels *
- ideal_duty_cycle /
- (100.0 - ideal_duty_cycle) /
- (2.0 * CELL_GRAN)) * (2.0 * CELL_GRAN);
-
- print_value(19, "[H BLANK (PIXELS)]", h_blank);
-
-
- /* 20. Find total number of pixels:
- *
- * [TOTAL PIXELS] = [TOTAL ACTIVE PIXELS] + [H BLANK (PIXELS)]
- */
-
- total_pixels = total_active_pixels + h_blank;
-
- print_value(20, "[TOTAL PIXELS]", total_pixels);
-
-
- /* 21. Find pixel clock frequency:
- *
- * [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD]
- */
-
- pixel_freq = total_pixels / h_period;
-
- print_value(21, "[PIXEL FREQ]", pixel_freq);
-
-
- /* 22. Find horizontal frequency:
- *
- * [H FREQ] = 1000 / [H PERIOD]
- */
-
- h_freq = 1000.0 / h_period;
-
- print_value(22, "[H FREQ]", h_freq);
-
-
-
- /* Stage 1 computations are now complete; I should really pass
- the results to another function and do the Stage 2
- computations, but I only need a few more values so I'll just
- append the computations here for now */
-
-
-
- /* 17. Find the number of pixels in the horizontal sync period:
- *
- * [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] /
- * [CELL GRAN RND]),0))*[CELL GRAN RND]
- */
-
- h_sync = rint(H_SYNC_PERCENT/100.0 * total_pixels / CELL_GRAN) * CELL_GRAN;
-
- print_value(17, "[H SYNC (PIXELS)]", h_sync);
-
-
- /* 18. Find the number of pixels in the horizontal front porch period:
- *
- * [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)]
- */
-
- h_front_porch = (h_blank / 2.0) - h_sync;
-
- print_value(18, "[H FRONT PORCH (PIXELS)]", h_front_porch);
-
-
- /* 36. Find the number of lines in the odd front porch period:
- *
- * [V ODD FRONT PORCH(LINES)]=([MIN PORCH RND]+[INTERLACE])
- */
-
- v_odd_front_porch_lines = MIN_PORCH + interlace;
-
- print_value(36, "[V ODD FRONT PORCH(LINES)]", v_odd_front_porch_lines);
-
-
- /* finally, pack the results in the mode struct */
-
- m->hr = (int) (h_pixels_rnd);
- m->hss = (int) (h_pixels_rnd + h_front_porch);
- m->hse = (int) (h_pixels_rnd + h_front_porch + h_sync);
- m->hfl = (int) (total_pixels);
-
- m->vr = (int) (v_lines_rnd);
- m->vss = (int) (v_lines_rnd + v_odd_front_porch_lines);
- m->vse = (int) (int) (v_lines_rnd + v_odd_front_porch_lines + V_SYNC_RQD);
- m->vfl = (int) (total_v_lines);
-
- m->pclk = pixel_freq;
- m->h_freq = h_freq;
- m->v_freq = freq;
-
- return (m);
-
-}
-
-
-
-
-/*
- * parse_command_line() - parse the command line and return an
- * alloced structure containing the results. On error print usage
- * and return NULL.
- */
-
-options *parse_command_line (int argc, char *argv[])
-{
- int n;
-
- options *o = (options *) calloc (1, sizeof (options));
-
- if (argc < 4) goto bad_option;
-
- o->x = atoi (argv[1]);
- o->y = atoi (argv[2]);
- o->v_freq = atof (argv[3]);
-
- /* XXX should check for errors in the above */
-
- n = 4;
-
- while (n < argc) {
- if ((strcmp (argv[n], "-v") == 0) ||
- (strcmp (argv[n], "--verbose") == 0)) {
- global_verbose = 1;
- } else if ((strcmp (argv[n], "-f") == 0) ||
- (strcmp (argv[n], "--fbmode") == 0)) {
- o->fbmode = 1;
- } else if ((strcmp (argv[n], "-x") == 0) ||
- (strcmp (argv[n], "--xf86mode") == 0)) {
- o->xf86mode = 1;
- } else {
- goto bad_option;
- }
-
- n++;
- }
-
- /* if neither xf86mode nor fbmode were requested, default to
- xf86mode */
-
- if (!o->fbmode && !o->xf86mode) o->xf86mode = 1;
-
- return (o);
-
- bad_option:
-
- fprintf (stderr, "\n");
- fprintf (stderr, "usage: %s x y refresh [-v|--verbose] "
- "[-f|--fbmode] [-x|-xf86mode]\n", argv[0]);
-
- fprintf (stderr, "\n");
-
- fprintf (stderr, " x : the desired horizontal "
- "resolution (required)\n");
- fprintf (stderr, " y : the desired vertical "
- "resolution (required)\n");
- fprintf (stderr, " refresh : the desired refresh "
- "rate (required)\n");
- fprintf (stderr, " -v|--verbose : enable verbose printouts "
- "(traces each step of the computation)\n");
- fprintf (stderr, " -f|--fbmode : output an fbset(8)-style mode "
- "description\n");
- fprintf (stderr, " -x|-xf86mode : output an XFree86-style mode "
- "description (this is the default\n"
- " if no mode description is requested)\n");
-
- fprintf (stderr, "\n");
-
- free (o);
- return (NULL);
-
-}
-
-
-
-int main (int argc, char *argv[])
-{
- mode *m;
- options *o;
-
- o = parse_command_line (argc, argv);
- if (!o) exit (1);
-
- m = vert_refresh (o->x, o->y, o->v_freq, 0, 0);
- if (!m) exit (1);
-
- if (o->xf86mode)
- print_xf86_mode(m);
-
- if (o->fbmode)
- print_fb_mode(m);
-
- return 0;
-
-}
diff --git a/hw/xfree86/utils/gtf/gtf.man.pre b/hw/xfree86/utils/gtf/gtf.man.pre
deleted file mode 100644
index f2d2ae9ec..000000000
--- a/hw/xfree86/utils/gtf/gtf.man.pre
+++ /dev/null
@@ -1,45 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/gtf.man,v 1.1 2002/11/12 01:31:23 dawes Exp $
-.TH GTF 1 __vendorversion__
-.SH NAME
-gtf - calculate VESA GTF mode lines
-.SH SYNOPSIS
-.B gtf
-.I h-resolution
-.I v-resolution
-.I refresh
-.RB [ \-v | \-\-verbose ]
-.RB [ \-f | \-\-fbmode ]
-.RB [ \-x | \-\-xf86mode ]
-.SH DESCRIPTION
-.I Gtf
-is a utility for calculating VESA GTF modes. Given the desired
-horizontal and vertical resolutions and refresh rate (in Hz), the parameters
-for a matching VESA GTF mode are printed out. Two output formats are
-supported: mode lines suitable for the XFree86
-.B XF86Config(__filemansuffix__)
-file, and mode parameters suitable for the Linux
-.B fbset(8)
-utility.
-
-.SH OPTIONS
-.TP 8
-.BR \-v | \-\-verbose
-Enable verbose printouts This shows a trace for each step of the
-computation.
-.TP 8
-.BR \-x | \-\-xf86mode
-Print the mode parameters as XFree86-style mode lines. This is the
-default format.
-.TP 8
-.BR \-f | \-\-fbset
-Print the mode parameters in a format suitable for
-.BR fbset(8) .
-.SH "SEE ALSO"
-XF86Config(__filemansuffix__)
-.SH AUTHOR
-Andy Ritger.
-.PP
-This program is based on the Generalized Timing Formula (GTF(TM)) Standard
-Version: 1.0, Revsion: 1.0. The GTF Excel(TM) spreadsheet, a sample
-(and the definitive) implementation of the GTF Timing Standard is
-available at <ftp://ftp.vesa.org/pub/GTF/VTF_V1R1.xls>.
diff --git a/hw/xfree86/utils/ioport/ioport.c b/hw/xfree86/utils/ioport/ioport.c
deleted file mode 100644
index 4bb20ef1b..000000000
--- a/hw/xfree86/utils/ioport/ioport.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/ioport.c,v 1.4 2003/01/01 19:16:41 tsi Exp $ */
-/*
- * Copyright 2002 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "compiler.h"
-#include "xf86_OSproc.h"
-
-#include <errno.h>
-
-static char *MyName;
-static int Port = -1, Index = -1;
-static unsigned int Value;
-
-static void
-inb_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "inb [-i <index>] <port>\n");
-}
-
-static void
-inw_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "inw [-i <index>] <port>\n");
-}
-
-static void
-inl_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "inl [-i <index>] <port>\n");
-}
-
-
-static void
-outb_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "outb [-i <index>] <port> <value>\n");
-}
-
-static void
-outw_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "outw [-i <index>] <port> <value>\n");
-}
-
-static void
-outl_usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- fprintf(stderr, "outl [-i <index>] <port> <value>\n");
-}
-
-static int
-#ifdef __STDC__
-parse_number
-(
- const char *String,
- void (* Usage)(void),
- unsigned int Maximum)
-#else
-parse_number(String, Usage, Maximum)
- const char *String;
- void (* Usage)();
- unsigned int Maximum;
-#endif
-{
- char *BadString = (char *)0;
- unsigned int Number = strtoul(String, &BadString, 0);
- if ((Number > Maximum) || errno ||
- (BadString && *BadString))
- {
- (*Usage)();
- exit(1);
- }
-
- return (Number);
-}
-
-static void
-#ifdef __STDC__
-input_parse
-(
- int argc,
- char **argv,
- void (* Usage)(void))
-#else
-input_parse(argc, argv, Usage)
- int argc;
- char **argv;
- void (* Usage)();
-#endif
-{
- if ((argc < 2) || (argc > 4))
- {
- (*Usage)();
- exit(1);
- }
-
- for(; (++argv, --argc); )
- {
- if ((Index < 0) &&
- (argv[0][0] == '-') &&
- (argv[0][1] == 'i'))
- {
- if ((++argv[0], *(++argv[0])) || (++argv, --argc))
- Index = parse_number(argv[0], Usage, 0xFFU);
- else
- {
- (*Usage)();
- exit(1);
- }
- }
- else if (Port < 0)
- {
- Port = parse_number(argv[0], Usage, 0xFFFFU);
- }
- else
- {
- (*Usage)();
- exit(1);
- }
- }
-}
-
-static void
-#ifdef __STDC__
-output_parse
-(
- int argc,
- char **argv,
- void (* Usage)(void),
- unsigned int Maximum
-)
-#else
-output_parse(argc, argv, Usage, Maximum)
- int argc;
- char **argv;
- void (* Usage)();
- unsigned int Maximum;
-#endif
-{
- char ValueSpecified = 0;
-
- if ((argc < 3) || (argc > 5))
- {
- (*Usage)();
- exit(1);
- }
-
- for (; (++argv, --argc); )
- {
- if ((Index < 0) &&
- (argv[0][0] == '-') &&
- (argv[0][1] == 'i'))
- {
- if ((++argv[0], *(++argv[0])) || (++argv, --argc))
- Index = parse_number(argv[0], Usage, 0xFFU);
- else
- {
- (*Usage)();
- exit(1);
- }
- }
- else if (Port < 0)
- {
- Port = parse_number(argv[0], Usage, 0xFFFFU);
- }
- else if (!ValueSpecified)
- {
- Value = parse_number(argv[0], Usage, Maximum);
- ValueSpecified = 1;
- }
- else
- {
- (*Usage)();
- exit(1);
- }
- }
-
- if (!ValueSpecified)
- {
- (*Usage)();
- exit(1);
- }
-}
-
-static void
-#ifdef __STDC__
-do_inb
-(
- int argc,
- char **argv
-)
-#else
-do_inb(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- input_parse(argc, argv, inb_usage);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- if (Port == 0x03C0U)
- { /* Attribute Controller is different */
- unsigned short gens1;
-
- gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
- (void) inb(gens1);
- Index = (Index & 0x1FU) | 0x20U;
- }
- outb(Port, Index);
- Port++;
- }
- Value = inb(Port);
-
- xf86DisableIO();
-
- printf("0x%02X\n", Value);
-}
-
-static void
-#ifdef __STDC__
-do_inw
-(
- int argc,
- char **argv
-)
-#else
-do_inw(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- input_parse(argc, argv, inw_usage);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- outb(Port, Index);
- Port++;
- }
- Value = inw(Port);
-
- xf86DisableIO();
-
- printf("0x%04X\n", Value);
-}
-
-static void
-#ifdef __STDC__
-do_inl
-(
- int argc,
- char **argv
-)
-#else
-do_inl(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- input_parse(argc, argv, inl_usage);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- outb(Port, Index);
- Port++;
- }
- Value = inl(Port);
-
- xf86DisableIO();
-
- printf("0x%08X\n", Value);
-}
-
-static void
-#ifdef __STDC__
-do_outb
-(
- int argc,
- char **argv
-)
-#else
-do_outb(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- output_parse(argc, argv, outb_usage, 0xFFU);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- if (Port == 0x03C0U)
- { /* Attribute controller is different */
- unsigned short gens1;
-
- gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
- (void) inb(gens1);
- outb(0x03C0U, (Index & 0x1FU) | 0x20U);
- }
- else
- {
- outb(Port, Index);
- Port++;
- }
- }
- outb(Port, Value);
-
- xf86DisableIO();
-
-}
-
-static void
-#ifdef __STDC__
-do_outw
-(
- int argc,
- char **argv
-)
-#else
-do_outw(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- output_parse(argc, argv, outw_usage, 0xFFFFU);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- outb(Port, Index);
- Port++;
- }
- outw(Port, Value);
-
- xf86DisableIO();
-
-}
-
-static void
-#ifdef __STDC__
-do_outl
-(
- int argc,
- char **argv
-)
-#else
-do_outl(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- output_parse(argc, argv, outl_usage, 0xFFFFFFFFU);
-
- xf86EnableIO();
-
- if (Index >= 0)
- {
- outb(Port, Index);
- Port++;
- }
- outl(Port, Value);
-
- xf86DisableIO();
-
-}
-
-static void
-usage
-(
-#ifdef __STDC__
- void
-#endif
-)
-{
- inb_usage();
- inw_usage();
- inl_usage();
- outb_usage();
- outw_usage();
- outl_usage();
- exit(1);
-}
-
-int
-#ifdef __STDC__
-main
-(
- int argc,
- char **argv
-)
-#else
-main(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- struct
- {
- char *Name;
-#ifdef __STDC__
- void (* Function)(int, char **);
-#else
- void (* Function)();
-#endif
- }
- *Function_Entry, Function_Table[] =
- {
- {"inb", do_inb},
- {"inw", do_inw},
- {"inl", do_inl},
- {"outb", do_outb},
- {"outw", do_outw},
- {"outl", do_outl},
-#ifdef __STDC__
- {(char *)0, (void (*)(int, char **))usage}
-#else
- {(char *)0, usage}
-#endif
- };
-
- /* Get name by which we were invoked */
- for (MyName = argv[0]; argv[0][0]; )
- if (*(argv[0]++) == '/')
- MyName = argv[0];
-
- /* Look up name in table and call corresponding function */
- for (Function_Entry = Function_Table;
- Function_Entry->Name &&
- strcmp(MyName, Function_Entry->Name);
- Function_Entry++);
- (*Function_Entry->Function)(argc, argv);
-
- return (0);
-}
-
-#include "xf86getpagesize.c"
diff --git a/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.c b/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.c
deleted file mode 100644
index f7d07eb79..000000000
--- a/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/kbd_mode.c,v 3.6 1998/07/26 09:56:17 dawes Exp $ */
-
-
-/* Keyboard mode control program for 386BSD */
-
-
-/* $XConsortium: kbd_mode.c /main/7 1996/03/11 10:46:12 kaleb $ */
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "X.h"
-#include "input.h"
-#include "scrnintstr.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static int fd;
-
-void
-msg (char* s)
-{
- perror (s);
- close (fd);
- exit (-1);
-}
-
-int
-main(int argc, char** argv)
-{
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)
- vtmode_t vtmode;
-#endif
- Bool syscons = FALSE;
-
- if ((fd = open("/dev/vga",O_RDONLY,0)) <0)
- msg ("Cannot open /dev/vga");
-
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)
- /* Check if syscons */
- if (ioctl(fd, VT_GETMODE, &vtmode) >= 0)
- syscons = TRUE;
-#endif
-
- if (0 == strcmp (argv[1], "-u"))
- {
- if (syscons)
- {
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)
- ioctl (fd, KDSKBMODE, K_RAW);
-#endif
- }
- else
- {
- if (ioctl (fd, CONSOLE_X_MODE_ON, 0) < 0)
- {
- close (fd);
- exit (0); /* Assume codrv, so nothing to do */
- }
- }
- }
- else if (0 == strcmp (argv[1], "-a"))
- {
- if (syscons)
- {
-#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)
- ioctl (fd, KDSKBMODE, K_XLATE);
-#endif
- }
- else
- {
- if (ioctl (fd, CONSOLE_X_MODE_OFF, 0) < 0)
- {
- close (fd);
- exit (0); /* Assume codrv, so nothing to do */
- }
- }
- }
- else
- {
- close (fd);
- fprintf (stderr,"Usage: %s [-u|-a]\n",argv[0]);
- fprintf (stderr,"-u for sending up down key events in x mode.\n");
- fprintf (stderr,"-a for sending ascii keys in normal use.\n");
- exit (-1);
- }
- close (fd);
- exit (0);
-}
diff --git a/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.man.pre b/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.man.pre
deleted file mode 100644
index 677663d7e..000000000
--- a/hw/xfree86/utils/kbd_mode/bsd-kbd_mode.man.pre
+++ /dev/null
@@ -1,36 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/kbd_mode.man,v 3.5 2001/01/27 18:20:56 dawes Exp $
-.TH KBD_MODE 1 __vendorversion__
-.SH NAME
-kbd_mode \- recover the PC console keyboard
-.SH SYNOPSIS
-.B kbd_mode
-[ -a -u ]
-.SH DESCRIPTION
-.I Kbd_mode
-resets the PC console keyboard to a rational state.
-.SH OPTIONS
-The following options are supported:
-.TP 8
-.B \-a
-Set the keyboard so that ASCII characters are read from the console.
-.TP 8
-.B \-u
-Set the keyboard so that undecoded keyboard values are read from the
-console.
-.SH EXAMPLES
-If the server crashes or otherwise fails to put the keyboard back in
-ascii mode when it exits, it can leave your keyboard dead. If you are
-able to login remotely, you can reset it typing:
-.sp
- kbd_mode -a
-.sp
-.PP
-Conversely, changing the keyboard to ascii mode while the server is
-running will make the keyboard appear to be dead while the the mouse
-continues to work. Again, if you are able to login remotely, you can
-reset it typing:
-.sp
- kbd_mode -u
-.sp
-
-.\" $TOG: kbd_mode.man /main/6 1997/07/19 10:37:14 kaleb $
diff --git a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c
deleted file mode 100644
index e70fb2db7..000000000
--- a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Xorg: kbd_mode.c,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or The Open Group
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and The Open Group make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.12 2003/10/07 21:39:43 herrb Exp $ */
-
-/*
-static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13";
- */
-
-/*
- * Copyright 1986 by Sun Microsystems, Inc.
- *
- * kbd_mode: set keyboard encoding mode
- */
-
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#if defined(SVR4) || defined(__bsdi__)
-#include <fcntl.h>
-#ifndef __bsdi__
-#include <sys/kbio.h>
-#include <sys/kbd.h>
-#else
-#include <unistd.h>
-#include </sys/sparc/dev/kbio.h>
-#include </sys/sparc/dev/kbd.h>
-#endif
-#else
-#ifndef CSRG_BASED
-#include <sundev/kbio.h>
-#include <sundev/kbd.h>
-#else
-#include <machine/kbio.h>
-#include <machine/kbd.h>
-#endif
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-static void die(char*);
-static void usage(void);
-static int kbd_fd;
-
-int
-main(argc, argv)
- int argc;
- char** argv;
-{
- int code = 0, translate, direct = -1;
- char led;
- int click;
-
- if ((kbd_fd = open("/dev/kbd", O_RDONLY, 0)) < 0) {
- die("Couldn't open /dev/kbd");
- }
- argc--; argv++;
- if (argc-- && **argv == '-') {
- code = *(++*argv);
- } else {
- usage();
- }
- switch (code) {
- case 'a':
- case 'A':
- translate = TR_ASCII;
- direct = 0;
- break;
- case 'e':
- case 'E':
- translate = TR_EVENT;
- break;
- case 'n':
- case 'N':
- translate = TR_NONE;
- break;
- case 'u':
- case 'U':
- translate = TR_UNTRANS_EVENT;
- break;
- default:
- usage();
- }
-#ifdef KIOCSLED
- led = 0;
- if (ioctl(kbd_fd, KIOCSLED, &led))
- die("Couldn't set LEDs");
-#endif
-#ifdef KIOCCMD
- click = KBD_CMD_NOCLICK;
- if (ioctl(kbd_fd, KIOCCMD, &click))
- die("Couldn't set click");
-#endif
- if (ioctl(kbd_fd, KIOCTRANS, (caddr_t) &translate))
- die("Couldn't set translation");
- if (direct != -1 && ioctl(kbd_fd, KIOCSDIRECT, (caddr_t) &direct))
- die("Couldn't set redirect");
- return 0;
-}
-
-static void
-die(char *msg)
-{
- fprintf(stderr, "%s\n", msg);
- exit(1);
-}
-
-static void
-usage(void)
-{
- int translate;
-
- if (ioctl(kbd_fd, KIOCGTRANS, (caddr_t) &translate)) {
- die("Couldn't inquire current translation");
- }
- fprintf(stderr, "kbd_mode {-a | -e | -n | -u }\n");
- fprintf(stderr, "\tfor ascii, encoded (normal) SunView events,\n");
- fprintf(stderr, " \tnon-encoded, or unencoded SunView events, resp.\n");
- fprintf(stderr, "Current mode is %s.\n",
- ( translate == 0 ? "n (non-translated bytes)" :
- ( translate == 1 ? "a (ascii bytes)" :
- ( translate == 2 ? "e (encoded events)" :
- /* translate == 3 */ "u (unencoded events)"))));
- exit(1);
-}
-
-
diff --git a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.man.pre b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.man.pre
deleted file mode 100644
index 528ed12f0..000000000
--- a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.man.pre
+++ /dev/null
@@ -1,53 +0,0 @@
-.\" $Xorg: kbd_mode.man,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $
-.\" Copyright 1987 Sun Microsystems, Inc.
-.\" Copyright 1993, 1998 The Open Group
-.\"
-.\" Permission to use, copy, modify, distribute, and sell this software and its
-.\" documentation for any purpose is hereby granted without fee, provided that
-.\" the above copyright notice appear in all copies and that both that
-.\" copyright notice and this permission notice appear in supporting
-.\" documentation.
-.\"
-.\" The above copyright notice and this permission notice shall be included
-.\" in all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-.\" OTHER DEALINGS IN THE SOFTWARE.
-.\"
-.\" Except as contained in this notice, the name of The Open Group shall
-.\" not be used in advertising or otherwise to promote the sale, use or
-.\" other dealings in this Software without prior written authorization
-.\" from The Open Group.
-.\"
-.\" $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.man,v 1.7 2001/12/14 19:59:42 dawes Exp $
-.\"
-.TH KBD_MODE 1 __xorgversion__
-.SH NAME
-kbd_mode \- recover the Sun console keyboard
-.SH SYNOPSIS
-.B kbd_mode
-[ -a -e -n -u ]
-.SH DESCRIPTION
-.I Kbd_mode
-resets the Sun console keyboard to a rational state.
-.SH OPTIONS
-The following options are supported, see \fIkb(4S)\fP for details:
-.TP 8
-.B \-a
-Causes ASCII to be reported.
-.TP 8
-.B \-e
-Causes \fIFirm_events\fP to be reported.
-.TP 8
-.B \-n
-Causes up/down key codes to be reported.
-.TP 8
-.B \-u
-Causes undecoded keyboard values to be reported.
-.SH SEE ALSO
-kb(4S)
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.c b/hw/xfree86/utils/pcitweak/pcitweak.c
deleted file mode 100644
index 7ef1150b0..000000000
--- a/hw/xfree86/utils/pcitweak/pcitweak.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.17 2003/08/24 17:37:01 dawes Exp $ */
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * pcitweak.c
- *
- * Author: David Dawes <dawes@xfree86.org>
- */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSproc.h"
-#include "xf86Pci.h"
-
-#ifdef __CYGWIN__
-#include <getopt.h>
-#endif
-
-#include <stdarg.h>
-#include <stdlib.h>
-#ifdef __linux__
-/* to get getopt on Linux */
-#ifndef __USE_POSIX2
-#define __USE_POSIX2
-#endif
-#endif
-#include <unistd.h>
-#if defined(ISC) || defined(Lynx)
-extern char *optarg;
-extern int optind, opterr;
-#endif
-
-pciVideoPtr *xf86PciVideoInfo = NULL;
-
-static void usage(void);
-static Bool parsePciBusString(const char *id, int *bus, int *device, int *func);
-static char *myname = NULL;
-
-int
-main(int argc, char *argv[])
-{
- int c;
- PCITAG tag;
- int bus, device, func;
- Bool list = FALSE, rd = FALSE, wr = FALSE;
- Bool byte = FALSE, halfword = FALSE;
- int offset = 0;
- CARD32 value = 0;
- char *id = NULL, *end;
-
- myname = argv[0];
- while ((c = getopt(argc, argv, "bhlr:w:")) != -1) {
- switch (c) {
- case 'b':
- byte = TRUE;
- break;
- case 'h':
- halfword = TRUE;
- break;
- case 'l':
- list = TRUE;
- break;
- case 'r':
- rd = TRUE;
- id = optarg;
- break;
- case 'w':
- wr = TRUE;
- id = optarg;
- break;
- case '?':
- default:
- usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- if (list) {
- xf86Verbose = 2;
- xf86EnableIO();
- xf86scanpci(0);
- xf86DisableIO();
- exit(0);
- }
-
- if (rd && wr)
- usage();
- if (wr && argc != 2)
- usage();
- if (rd && argc != 1)
- usage();
- if (byte && halfword)
- usage();
-
- if (rd || wr) {
- if (!parsePciBusString(id, &bus, &device, &func)) {
- fprintf(stderr, "%s: Bad PCI ID string\n", myname);
- usage();
- }
- offset = strtoul(argv[0], &end, 0);
- if (*end != '\0') {
- fprintf(stderr, "%s: Bad offset\n", myname);
- usage();
- }
- if (halfword) {
- if (offset % 2) {
- fprintf(stderr, "%s: offset must be a multiple of two\n",
- myname);
- exit(1);
- }
- } else if (!byte) {
- if (offset % 4) {
- fprintf(stderr, "%s: offset must be a multiple of four\n",
- myname);
- exit(1);
- }
- }
- } else {
- usage();
- }
-
- if (wr) {
- value = strtoul(argv[1], &end, 0);
- if (*end != '\0') {
- fprintf(stderr, "%s: Bad value\n", myname);
- usage();
- }
- }
-
- xf86EnableIO();
-
- /*
- * This is needed to setup all the buses. Otherwise secondary buses
- * can't be accessed.
- */
- xf86scanpci(0);
-
- tag = pciTag(bus, device, func);
- if (rd) {
- if (byte) {
- printf("0x%02x\n", (unsigned int)pciReadByte(tag, offset) & 0xFF);
- } else if (halfword) {
- printf("0x%04x\n", (unsigned int)pciReadWord(tag, offset) & 0xFFFF);
- } else {
- printf("0x%08lx\n", (unsigned long)pciReadLong(tag, offset));
- }
- } else if (wr) {
- if (byte) {
- pciWriteByte(tag, offset, value & 0xFF);
- } else if (halfword) {
- pciWriteWord(tag, offset, value & 0xFFFF);
- } else {
- pciWriteLong(tag, offset, value);
- }
- }
-
- xf86DisableIO();
- exit(0);
-}
-
-static void
-usage()
-{
- fprintf(stderr, "usage:\tpcitweak -l\n"
- "\tpcitweak -r ID [-b | -h] offset\n"
- "\tpcitweak -w ID [-b | -h] offset value\n"
- "\n"
- "\t\t-l -- list\n"
- "\t\t-r -- read\n"
- "\t\t-w -- write\n"
- "\t\t-b -- read/write a single byte\n"
- "\t\t-h -- read/write a single halfword (16 bit)\n"
- "\t\tID -- PCI ID string in form bus:dev:func "
- "(all in hex)\n");
-
- exit(1);
-}
-
-Bool
-parsePciBusString(const char *busID, int *bus, int *device, int *func)
-{
- /*
- * The format is assumed to be "bus:device:func", where bus, device
- * and func are hexadecimal integers. func may be omitted and assumed to
- * be zero, although it doing this isn't encouraged.
- */
-
- char *p, *s, *end;
-
- s = strdup(busID);
- p = strtok(s, ":");
- if (p == NULL || *p == 0)
- return FALSE;
- *bus = strtoul(p, &end, 16);
- if (*end != '\0')
- return FALSE;
- p = strtok(NULL, ":");
- if (p == NULL || *p == 0)
- return FALSE;
- *device = strtoul(p, &end, 16);
- if (*end != '\0')
- return FALSE;
- *func = 0;
- p = strtok(NULL, ":");
- if (p == NULL || *p == 0)
- return TRUE;
- *func = strtoul(p, &end, 16);
- if (*end != '\0')
- return FALSE;
- return TRUE;
-}
-
-#include "xf86getpagesize.c"
-
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.man.pre b/hw/xfree86/utils/pcitweak/pcitweak.man.pre
deleted file mode 100644
index 14cfa885f..000000000
--- a/hw/xfree86/utils/pcitweak/pcitweak.man.pre
+++ /dev/null
@@ -1,64 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.4 2003/05/29 21:48:09 herrb Exp $
-.TH PCITWEAK 1 __vendorversion__
-.SH NAME
-pcitweak - read/write PCI config space
-.SH SYNOPSIS
-.B pcitweak
-.B \-l
-.br
-.B pcitweak
-.B \-r
-.I PCI-ID
-.RB [ \-b | \-h ]
-.I offset
-.br
-.B pcitweak
-.B \-w
-.I PCI-ID
-.RB [ \-b | \-h ]
-.I offset
-.I value
-.SH DESCRIPTION
-.I Pcitweak
-is a utility that can be used to examine or change registers in the PCI
-configuration space. On most platforms
-.I pcitweak
-can only be run by the root user.
-.SH OPTIONS
-.TP 8
-.B \-l
-Probe the PCI buses and print a line for each detected device. Each line
-contains the bus location (bus:device:function), chip vendor/device, card
-(subsystem) vendor/card, revision, class and header type. All values
-printed are in hexadecimal.
-.TP 8
-.BI "\-r " PCI-ID
-Read the PCI configuration space register at
-.I offset
-for the PCI device at bus location
-.IR PCI-ID .
-.I PCI-ID
-should be given in the form bus:device:function, with each value in
-hexadecimal. By default, a 32-bit register is read.
-.TP 8
-.BI "\-w " PCI-ID
-Write
-.I value
-to the PCI configuration space register at
-.I offset
-for the PCI device at bus location
-.IR PCI-ID .
-.I PCI-ID
-should be given in the form bus:device:function, with each value in
-hexadecimal. By default, a 32-bit register is written.
-.TP 8
-.B \-b
-Read or write an 8-bit value (byte).
-.TP 8
-.B \-h
-Read or write a 16-bit value (halfword).
-.SH "SEE ALSO"
-scanpci(1)
-.SH AUTHORS
-David Dawes
-.RI ( dawes@xfree86.org ).
diff --git a/hw/xfree86/utils/scanpci/scanpci.c b/hw/xfree86/utils/scanpci/scanpci.c
deleted file mode 100644
index 6093bd31a..000000000
--- a/hw/xfree86/utils/scanpci/scanpci.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/*
- * Copyright 2000 by Egbert Eich
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- * Copyright 2002 by David Dawes
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.92 2003/02/13 12:17:14 tsi Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSproc.h"
-#include "xf86Pci.h"
-#include "xf86PciInfo.h"
-#include "xf86ScanPci.h"
-#include "dummylib.h"
-
-#include <stdarg.h>
-#include <stdlib.h>
-#ifdef __linux__
-/* to get getopt on Linux */
-#ifndef __USE_POSIX2
-#define __USE_POSIX2
-#endif
-#endif
-#include <unistd.h>
-
-#if defined(ISC) || defined(Lynx)
-extern char *optarg;
-extern int optind, opterr;
-#endif
-
-pciVideoPtr *xf86PciVideoInfo = NULL;
-
-static void usage(void);
-static void identify_card(pciConfigPtr pcr, int verbose);
-static void print_default_class(pciConfigPtr pcr);
-static void print_bridge_pci_class(pciConfigPtr pcr);
-static void print_mach64(pciConfigPtr pcr);
-static void print_i128(pciConfigPtr pcr);
-static void print_dc21050(pciConfigPtr pcr);
-static void print_simba(pciConfigPtr pcr);
-static void print_460gx_sac(pciConfigPtr pcr);
-static void print_460gx_pxb(pciConfigPtr pcr);
-static void print_460gx_gxb(pciConfigPtr pcr);
-
-#define MAX_DEV_PER_VENDOR 40
-
-typedef struct {
- unsigned int Vendor;
- struct {
- int DeviceID;
- void(*func)(pciConfigPtr);
- } Device[MAX_DEV_PER_VENDOR];
-} pciVendorDevFuncInfo;
-
-static pciVendorDevFuncInfo vendorDeviceFuncInfo[] = {
- { PCI_VENDOR_ATI, {
- { PCI_CHIP_MACH64CT, print_mach64 },
- { PCI_CHIP_MACH64CX, print_mach64 },
- { PCI_CHIP_MACH64ET, print_mach64 },
- { PCI_CHIP_MACH64GB, print_mach64 },
- { PCI_CHIP_MACH64GD, print_mach64 },
- { PCI_CHIP_MACH64GI, print_mach64 },
- { PCI_CHIP_MACH64GL, print_mach64 },
- { PCI_CHIP_MACH64GM, print_mach64 },
- { PCI_CHIP_MACH64GN, print_mach64 },
- { PCI_CHIP_MACH64GO, print_mach64 },
- { PCI_CHIP_MACH64GP, print_mach64 },
- { PCI_CHIP_MACH64GQ, print_mach64 },
- { PCI_CHIP_MACH64GR, print_mach64 },
- { PCI_CHIP_MACH64GS, print_mach64 },
- { PCI_CHIP_MACH64GT, print_mach64 },
- { PCI_CHIP_MACH64GU, print_mach64 },
- { PCI_CHIP_MACH64GV, print_mach64 },
- { PCI_CHIP_MACH64GW, print_mach64 },
- { PCI_CHIP_MACH64GX, print_mach64 },
- { PCI_CHIP_MACH64GY, print_mach64 },
- { PCI_CHIP_MACH64GZ, print_mach64 },
- { PCI_CHIP_MACH64LB, print_mach64 },
- { PCI_CHIP_MACH64LD, print_mach64 },
- { PCI_CHIP_MACH64LG, print_mach64 },
- { PCI_CHIP_MACH64LI, print_mach64 },
- { PCI_CHIP_MACH64LM, print_mach64 },
- { PCI_CHIP_MACH64LN, print_mach64 },
- { PCI_CHIP_MACH64LP, print_mach64 },
- { PCI_CHIP_MACH64LQ, print_mach64 },
- { PCI_CHIP_MACH64LR, print_mach64 },
- { PCI_CHIP_MACH64LS, print_mach64 },
- { PCI_CHIP_MACH64VT, print_mach64 },
- { PCI_CHIP_MACH64VU, print_mach64 },
- { PCI_CHIP_MACH64VV, print_mach64 },
- { 0x0000, NULL } } },
- { PCI_VENDOR_DIGITAL, {
- { PCI_CHIP_DC21050, print_dc21050},
- { 0x0000, NULL } } },
- { PCI_VENDOR_NUMNINE, {
- { PCI_CHIP_I128, print_i128 },
- { PCI_CHIP_I128_2, print_i128 },
- { PCI_CHIP_I128_T2R, print_i128 },
- { PCI_CHIP_I128_T2R4, print_i128 },
- { 0x0000, NULL } } },
- { PCI_VENDOR_SUN, {
- { PCI_CHIP_SIMBA, print_simba },
- { 0x0000, NULL } } },
- { PCI_VENDOR_INTEL, {
- { PCI_CHIP_460GX_SAC, print_460gx_sac },
- { PCI_CHIP_460GX_PXB, print_460gx_pxb },
- { PCI_CHIP_460GX_GXB_1, print_460gx_gxb },
- { PCI_CHIP_460GX_WXB, print_460gx_pxb }, /* Uncertain */
- { 0x0000, NULL } } },
- { 0x0000, {
- { 0x0000, NULL } } }
-};
-
-static void
-usage(void)
-{
- printf("Usage: scanpci [-v12OfV]\n");
- printf(" -v print config space\n");
- printf(" -1 config type 1\n");
- printf(" -2 config type 2\n");
- printf(" -O use OS config support\n");
- printf(" -f force config type\n");
- printf(" -V set message verbosity level\n");
-}
-
-int
-main(int argc, char *argv[])
-{
- pciConfigPtr *pcrpp = NULL;
- int Verbose = 0;
- int i = 0;
- int force = 0;
- int c;
-
- xf86Info.pciFlags = PCIProbe1;
-
- while ((c = getopt(argc, argv, "?v12OfV:")) != -1)
- switch(c) {
- case 'v':
- Verbose = 1;
- break;
- case '1':
- xf86Info.pciFlags = PCIProbe1;
- break;
- case '2':
- xf86Info.pciFlags = PCIProbe2;
- break;
- case 'O':
- xf86Info.pciFlags = PCIOsConfig;
- break;
- case 'f':
- force = 1;
- break;
- case 'V':
- xf86Verbose = atoi(optarg);
- break;
- case '?':
- default:
- usage();
- exit (1);
- break;
- }
-
- if (force)
- switch (xf86Info.pciFlags) {
- case PCIProbe1:
- xf86Info.pciFlags = PCIForceConfig1;
- break;
- case PCIProbe2:
- xf86Info.pciFlags = PCIForceConfig2;
- break;
- default:
- break;
- }
-
- xf86EnableIO();
- pcrpp = xf86scanpci(0);
-
- if (!pcrpp) {
- printf("No PCI devices found\n");
- xf86DisableIO();
- exit (1);
- }
-
- while (pcrpp[i])
- identify_card(pcrpp[i++],Verbose);
-
- xf86DisableIO();
- exit(0);
-}
-
-static void
-identify_card(pciConfigPtr pcr, int verbose)
-{
- int i, j;
- int foundit = 0;
- int foundvendor = 0;
- const char *vname, *dname, *svname, *sname;
-
- pciVendorDevFuncInfo *vdf = vendorDeviceFuncInfo;
-
- if (!ScanPciSetupPciIds()) {
- fprintf(stderr, "xf86SetupPciIds() failed\n");
- exit(1);
- }
-
- printf("\npci bus 0x%04x cardnum 0x%02x function 0x%02x:"
- " vendor 0x%04x device 0x%04x\n",
- pcr->busnum, pcr->devnum, pcr->funcnum,
- pcr->pci_vendor, pcr->pci_device);
-
- ScanPciFindPciNamesByDevice(pcr->pci_vendor, pcr->pci_device,
- pcr->pci_subsys_vendor, pcr->pci_subsys_card,
- &vname, &dname, &svname, &sname);
-
- if (vname) {
- printf(" %s ", vname);
- if (dname) {
- printf("%s", dname);
- foundit = 1;
- }
- }
-
- if (!foundit)
- printf(" Device unknown\n");
- else {
- printf("\n");
- if (verbose) {
- for (i = 0; vdf[i].Vendor; i++) {
- if (vdf[i].Vendor == pcr->pci_vendor) {
- for (j = 0; vdf[i].Device[j].DeviceID; j++) {
- if (vdf[i].Device[j].DeviceID == pcr->pci_device) {
- (*vdf[i].Device[j].func)(pcr);
- return;
- }
- }
- break;
- }
- }
- }
- }
-
- if (verbose && !(pcr->pci_header_type & 0x7f) &&
- (pcr->pci_subsys_vendor != 0 || pcr->pci_subsys_card != 0) &&
- (pcr->pci_vendor != pcr->pci_subsys_vendor ||
- pcr->pci_device != pcr->pci_subsys_card)) {
- foundit = 0;
- foundvendor = 0;
- printf(" CardVendor 0x%04x card 0x%04x",
- pcr->pci_subsys_vendor, pcr->pci_subsys_card);
- if (svname) {
- printf(" (%s", svname);
- foundvendor = 1;
- if (sname) {
- printf(" %s)", sname);
- foundit = 1;
- }
- }
-
- if (!foundit) {
- if (!foundvendor)
- printf(" (");
- else
- printf(", ");
- printf("Card unknown)");
- }
- printf("\n");
- }
-
- if (verbose) {
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
- if ((pcr->pci_base_class == PCI_CLASS_BRIDGE) &&
- (pcr->pci_sub_class == PCI_SUBCLASS_BRIDGE_PCI))
- print_bridge_pci_class(pcr);
- else
- print_default_class(pcr);
- }
-}
-
-static void
-print_default_class(pciConfigPtr pcr)
-{
- printf(" BIST 0x%02x HEADER 0x%02x LATENCY 0x%02x CACHE 0x%02x\n",
- pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
- pcr->pci_cache_line_size);
- if (pcr->pci_base0) {
- if ((pcr->pci_base0 & 0x7) == 0x4) {
- printf(" BASE0 0x%08x%08x addr 0x%08x%08x MEM%s 64BIT\n",
- (int)pcr->pci_base1, (int)pcr->pci_base0,
- (int)pcr->pci_base1,
- (int)(pcr->pci_base0 &
- (pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base0 & 0x8) ? " PREFETCHABLE" :"");
- } else {
- printf(" BASE0 0x%08x addr 0x%08x %s%s\n",
- (int)pcr->pci_base0,
- (int)(pcr->pci_base0 &
- (pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base0 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base0 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
- }
- }
- if ((pcr->pci_base1) && ((pcr->pci_base0 & 0x7) != 0x4)) {
- if ((pcr->pci_base1 & 0x7) == 0x4) {
- printf(" BASE1 0x%08x%08x addr 0x%08x%08x MEM%s 64BIT\n",
- (int)pcr->pci_base2, (int)pcr->pci_base1,
- (int)pcr->pci_base2,
- (int)(pcr->pci_base1 &
- (pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base1 & 0x8) ? " PREFETCHABLE" :"");
- } else {
- printf(" BASE1 0x%08x addr 0x%08x %s%s\n",
- (int)pcr->pci_base1,
- (int)(pcr->pci_base1 &
- (pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base1 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base1 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
- }
- }
- if ((pcr->pci_base2) && ((pcr->pci_base1 & 0x7) != 0x4)) {
- if ((pcr->pci_base2 & 0x7) == 0x4) {
- printf(" BASE2 0x%08x%08x addr 0x%08x%08x MEM%s 64BIT\n",
- (int)pcr->pci_base3, (int)pcr->pci_base2,
- (int)pcr->pci_base3,
- (int)(pcr->pci_base2 &
- (pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base2 & 0x8) ? " PREFETCHABLE" :"");
- } else {
- printf(" BASE2 0x%08x addr 0x%08x %s%s\n",
- (int)pcr->pci_base2,
- (int)(pcr->pci_base2 &
- (pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base2 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base2 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
- }
- }
- if ((pcr->pci_base3) && ((pcr->pci_base2 & 0x7) != 0x4)) {
- if ((pcr->pci_base3 & 0x7) == 0x4) {
- printf(" BASE3 0x%08x%08x addr 0x%08x%08x MEM%s 64BIT\n",
- (int)pcr->pci_base4, (int)pcr->pci_base3,
- (int)pcr->pci_base4,
- (int)(pcr->pci_base3 &
- (pcr->pci_base3 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base3 & 0x8) ? " PREFETCHABLE" :"");
- } else {
- printf(" BASE3 0x%08x addr 0x%08x %s%s\n",
- (int)pcr->pci_base3,
- (int)(pcr->pci_base3 &
- (pcr->pci_base3 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base3 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base3 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
- }
- }
- if ((pcr->pci_base4) && ((pcr->pci_base3 & 0x7) != 0x4)) {
- if ((pcr->pci_base4 & 0x7) == 0x4) {
- printf(" BASE4 0x%08x%08x addr 0x%08x%08x MEM%s 64BIT\n",
- (int)pcr->pci_base5, (int)pcr->pci_base4,
- (int)pcr->pci_base5,
- (int)(pcr->pci_base4 &
- (pcr->pci_base4 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base4 & 0x8) ? " PREFETCHABLE" :"");
- } else {
- printf(" BASE4 0x%08x addr 0x%08x %s%s\n",
- (int)pcr->pci_base4,
- (int)(pcr->pci_base4 &
- (pcr->pci_base4 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base4 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base4 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
- }
- }
- if ((pcr->pci_base5) && ((pcr->pci_base4 & 0x7) != 0x4)) {
- printf(" BASE5 0x%08x addr 0x%08x %s%s%s\n",
- (int)pcr->pci_base5,
- (int)(pcr->pci_base5 &
- (pcr->pci_base5 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
- (pcr->pci_base5 & 0x1) ? "I/O" : "MEM",
- ((pcr->pci_base5 & 0x9) == 0x8) ? " PREFETCHABLE" :"",
- ((pcr->pci_base5 & 0x7) == 0x4) ? " 64BIT" : "");
- }
- if (pcr->pci_baserom)
- printf(" BASEROM 0x%08x addr 0x%08x %sdecode-enabled\n",
- (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
- pcr->pci_baserom & 0x1 ? "" : "not-");
- if (pcr->pci_max_min_ipin_iline)
- printf(" MAX_LAT 0x%02x MIN_GNT 0x%02x"
- " INT_PIN 0x%02x INT_LINE 0x%02x\n",
- pcr->pci_max_lat, pcr->pci_min_gnt,
- pcr->pci_int_pin, pcr->pci_int_line);
- if (pcr->pci_user_config)
- printf(" BYTE_0 0x%02x BYTE_1 0x%02x"
- " BYTE_2 0x%02x BYTE_3 0x%02x\n",
- (int)pcr->pci_user_config_0, (int)pcr->pci_user_config_1,
- (int)pcr->pci_user_config_2, (int)pcr->pci_user_config_3);
-}
-
-#define PCI_B_FAST_B_B 0x80
-#define PCI_B_SB_RESET 0x40
-#define PCI_B_M_ABORT 0x20
-#define PCI_B_VGA_EN 0x08
-#define PCI_B_ISA_EN 0x04
-#define PCI_B_SERR_EN 0x02
-#define PCI_B_P_ERR 0x01
-
-static void
-print_bridge_pci_class(pciConfigPtr pcr)
-{
- printf(" HEADER 0x%02x LATENCY 0x%02x\n",
- pcr->pci_header_type, pcr->pci_latency_timer);
- printf(" PRIBUS 0x%02x SECBUS 0x%02x SUBBUS 0x%02x\n",
- pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
- pcr->pci_subordinate_bus_number);
- printf(" SECLT 0x%02x SECSTATUS 0x%04x\n",
- pcr->pci_secondary_latency_timer, pcr->pci_secondary_status);
-
- if (pcr->pci_io_base || pcr->pci_io_limit ||
- pcr->pci_upper_io_base || pcr->pci_upper_io_limit) {
- if (((pcr->pci_io_base & 0x0f) == 0x01) ||
- ((pcr->pci_io_limit & 0x0f) == 0x01)) {
- printf(" IOBASE 0x%04x%04x IOLIM 0x%04x%04x\n",
- pcr->pci_upper_io_base, (pcr->pci_io_base & 0x00f0) << 8,
- pcr->pci_upper_io_limit, (pcr->pci_io_limit << 8) | 0x0fff);
- } else {
- printf(" IOBASE 0x%04x IOLIM 0x%04x\n",
- (pcr->pci_io_base & 0x00f0) << 8,
- (pcr->pci_io_limit << 8) | 0x0fff);
- }
- }
-
- if (pcr->pci_mem_base || pcr->pci_mem_limit)
- printf(" NOPREFETCH_MEMBASE 0x%08x MEMLIM 0x%08x\n",
- (pcr->pci_mem_base & 0x00fff0) << 16,
- (pcr->pci_mem_limit << 16) | 0x0fffff);
-
- if (pcr->pci_prefetch_mem_base || pcr->pci_prefetch_mem_limit ||
- pcr->pci_prefetch_upper_mem_base ||
- pcr->pci_prefetch_upper_mem_limit) {
- if (((pcr->pci_prefetch_mem_base & 0x0f) == 0x01) ||
- ((pcr->pci_prefetch_mem_limit & 0x0f) == 0x01)) {
- printf(" PREFETCH_MEMBASE 0x%08x%08x MEMLIM 0x%08x%08x\n",
- (int)pcr->pci_prefetch_upper_mem_base,
- (pcr->pci_prefetch_mem_base & 0x00fff0) << 16,
- (int)pcr->pci_prefetch_upper_mem_limit,
- (pcr->pci_prefetch_mem_limit << 16) | 0x0fffff);
- } else {
- printf(" PREFETCH_MEMBASE 0x%08x MEMLIM 0x%08x\n",
- (pcr->pci_prefetch_mem_base & 0x00fff0) << 16,
- (pcr->pci_prefetch_mem_limit << 16) | 0x0fffff);
- }
- }
-
- printf(" %sFAST_B2B %sSEC_BUS_RST %sM_ABRT %sVGA_EN %sISA_EN"
- " %sSERR_EN %sPERR_EN\n",
- (pcr->pci_bridge_control & PCI_B_FAST_B_B) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_SB_RESET) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_M_ABORT) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_VGA_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_ISA_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_SERR_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_P_ERR) ? "" : "NO_");
-}
-
-static void
-print_mach64(pciConfigPtr pcr)
-{
- CARD32 sparse_io = 0;
-
- printf(" CardVendor 0x%04x card 0x%04x\n",
- pcr->pci_subsys_vendor, pcr->pci_subsys_card);
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class,
- pcr->pci_prog_if, pcr->pci_rev_id);
- printf(" BIST 0x%02x HEADER 0x%02x LATENCY 0x%02x CACHE 0x%02x\n",
- pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
- pcr->pci_cache_line_size);
- if (pcr->pci_base0)
- printf(" APBASE 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base0, (int)(pcr->pci_base0 &
- (pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
- if (pcr->pci_base1)
- printf(" BLOCKIO 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base1, (int)(pcr->pci_base1 &
- (pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
- if (pcr->pci_base2)
- printf(" REGBASE 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base2, (int)(pcr->pci_base2 &
- (pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
- if (pcr->pci_baserom)
- printf(" BASEROM 0x%08x addr 0x%08x %sdecode-enabled\n",
- (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
- pcr->pci_baserom & 0x1 ? "" : "not-");
- if (pcr->pci_max_min_ipin_iline)
- printf(" MAX_LAT 0x%02x MIN_GNT 0x%02x"
- " INT_PIN 0x%02x INT_LINE 0x%02x\n",
- pcr->pci_max_lat, pcr->pci_min_gnt,
- pcr->pci_int_pin, pcr->pci_int_line);
- switch (pcr->pci_user_config_0 & 0x03) {
- case 0:
- sparse_io = 0x2ec;
- break;
- case 1:
- sparse_io = 0x1cc;
- break;
- case 2:
- sparse_io = 0x1c8;
- break;
- }
- printf(" SPARSEIO 0x%03x %s IO enabled %sable 0x46E8\n",
- (int)sparse_io, pcr->pci_user_config_0 & 0x04 ? "Block" : "Sparse",
- pcr->pci_user_config_0 & 0x08 ? "Dis" : "En");
-}
-
-static void
-print_i128(pciConfigPtr pcr)
-{
- printf(" CardVendor 0x%04x card 0x%04x\n",
- pcr->pci_subsys_vendor, pcr->pci_subsys_card);
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
- printf(" BIST 0x%02x HEADER 0x%02x LATENCY 0x%02x CACHE 0x%02x\n",
- pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
- pcr->pci_cache_line_size);
- printf(" MW0_AD 0x%08x addr 0x%08x %spre-fetchable\n",
- (int)pcr->pci_base0, (int)(pcr->pci_base0 & 0xFFC00000),
- pcr->pci_base0 & 0x8 ? "" : "not-");
- printf(" MW1_AD 0x%08x addr 0x%08x %spre-fetchable\n",
- (int)pcr->pci_base1, (int)(pcr->pci_base1 & 0xFFC00000),
- pcr->pci_base1 & 0x8 ? "" : "not-");
- printf(" XYW_AD(A) 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base2, (int)(pcr->pci_base2 & 0xFFC00000));
- printf(" XYW_AD(B) 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base3, (int)(pcr->pci_base3 & 0xFFC00000));
- printf(" RBASE_G 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base4, (int)(pcr->pci_base4 & 0xFFFF0000));
- printf(" IO 0x%08x addr 0x%08x\n",
- (int)pcr->pci_base5, (int)(pcr->pci_base5 & 0xFFFFFF00));
- printf(" RBASE_E 0x%08x addr 0x%08x %sdecode-enabled\n",
- (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
- pcr->pci_baserom & 0x1 ? "" : "not-");
- if (pcr->pci_max_min_ipin_iline)
- printf(" MAX_LAT 0x%02x MIN_GNT 0x%02x"
- " INT_PIN 0x%02x INT_LINE 0x%02x\n",
- pcr->pci_max_lat, pcr->pci_min_gnt,
- pcr->pci_int_pin, pcr->pci_int_line);
-}
-
-static void
-print_dc21050(pciConfigPtr pcr)
-{
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
- printf(" BIST 0x%02x HEADER 0x%02x LATENCY 0x%02x CACHE 0x%02x\n",
- pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
- pcr->pci_cache_line_size);
- printf(" PRIBUS 0x%02x SECBUS 0x%02x SUBBUS 0x%02x SECLT 0x%02x\n",
- pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
- pcr->pci_subordinate_bus_number, pcr->pci_secondary_latency_timer);
- printf(" IOBASE 0x%02x IOLIM 0x%02x SECSTATUS 0x%04x\n",
- pcr->pci_io_base << 8, (pcr->pci_io_limit << 8) | 0xfff,
- pcr->pci_secondary_status);
- printf(" NOPREFETCH_MEMBASE 0x%08x MEMLIM 0x%08x\n",
- pcr->pci_mem_base << 16, (pcr->pci_mem_limit << 16) | 0xfffff);
- printf(" PREFETCH_MEMBASE 0x%08x MEMLIM 0x%08x\n",
- pcr->pci_prefetch_mem_base << 16,
- (pcr->pci_prefetch_mem_limit << 16) | 0xfffff);
- printf(" RBASE_E 0x%08x addr 0x%08x %sdecode-enabled\n",
- (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
- pcr->pci_baserom & 0x1 ? "" : "not-");
- if (pcr->pci_max_min_ipin_iline)
- printf(" MAX_LAT 0x%02x MIN_GNT 0x%02x"
- " INT_PIN 0x%02x INT_LINE 0x%02x\n",
- pcr->pci_max_lat, pcr->pci_min_gnt,
- pcr->pci_int_pin, pcr->pci_int_line);
-}
-
-static void
-print_simba(pciConfigPtr pcr)
-{
- int i;
- CARD8 io, mem;
-
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
- printf(" HEADER 0x%02x LATENCY 0x%02x CACHE 0x%02x\n",
- pcr->pci_header_type, pcr->pci_latency_timer,
- pcr->pci_cache_line_size);
- printf(" PRIBUS 0x%02x SECBUS 0x%02x SUBBUS 0x%02x SECLT 0x%02x\n",
- pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
- pcr->pci_subordinate_bus_number, pcr->pci_secondary_latency_timer);
- printf(" SECSTATUS 0x%04x\n",
- pcr->pci_secondary_status);
- printf(" %sFAST_B2B %sSEC_BUS_RST %sM_ABRT %sVGA_EN %sISA_EN"
- " %sSERR_EN %sPERR_EN\n",
- (pcr->pci_bridge_control & PCI_B_FAST_B_B) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_SB_RESET) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_M_ABORT) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_VGA_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_ISA_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_SERR_EN) ? "" : "NO_",
- (pcr->pci_bridge_control & PCI_B_P_ERR) ? "" : "NO_");
- printf(" TICK 0x%08lx SECCNTL 0x%02x\n", (long)
- pciReadLong(pcr->tag, 0x00b0), pciReadByte(pcr->tag, 0x00dd));
- printf(" MASTER RETRIES: PRIMARY 0x%02x, SECONDARY 0x%02x\n",
- pciReadByte(pcr->tag, 0x00c0), pciReadByte(pcr->tag, 0x00dc));
- printf(" TARGET RETRIES: PIO 0x%02x, DMA 0x%02x\n",
- pciReadByte(pcr->tag, 0x00d8), pciReadByte(pcr->tag, 0x00da));
- printf(" TARGET LATENCY: PIO 0x%02x, DMA 0x%02x\n",
- pciReadByte(pcr->tag, 0x00d9), pciReadByte(pcr->tag, 0x00db));
- printf(" DMA AFSR 0x%08lx%08lx AFAR 0x%08lx%08lx\n",
- (long)pciReadLong(pcr->tag, 0x00cc),
- (long)pciReadLong(pcr->tag, 0x00c8),
- (long)pciReadLong(pcr->tag, 0x00d4),
- (long)pciReadLong(pcr->tag, 0x00d0));
- printf(" PIO AFSR 0x%08lx%08lx AFAR 0x%08lx%08lx\n",
- (long)pciReadLong(pcr->tag, 0x00ec),
- (long)pciReadLong(pcr->tag, 0x00e8),
- (long)pciReadLong(pcr->tag, 0x00f4),
- (long)pciReadLong(pcr->tag, 0x00f0));
- printf(" PCI CNTL 0x%08lx%08lx DIAG 0x%08lx%08lx\n",
- (long)pciReadLong(pcr->tag, 0x00e4),
- (long)pciReadLong(pcr->tag, 0x00e0),
- (long)pciReadLong(pcr->tag, 0x00fc),
- (long)pciReadLong(pcr->tag, 0x00f8));
- printf(" MAPS: I/O 0x%02x, MEM 0x%02x\n",
- (io = pciReadByte(pcr->tag, 0x00de)),
- (mem = pciReadByte(pcr->tag, 0x00df)));
- for (i = 0; i < 8; i++)
- if (io & (1 << i))
- printf(" BUS I/O 0x%06x-0x%06x\n", i << 21, ((i + 1) << 21) - 1);
- for (i = 0; i < 8; i++)
- if (mem & (1 << i))
- printf(" BUS MEM 0x%08x-0x%08x\n", i << 29, ((i + 1) << 29) - 1);
-}
-
-static int cbn_460gx = -1;
-
-static void
-print_460gx_sac(pciConfigPtr pcr)
-{
- CARD32 tmp;
-
- /* Print generalities */
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
-
- tmp = pcr->pci_user_config;
- pcr->pci_user_config = 0;
- print_default_class(pcr);
- pcr->pci_user_config = tmp;
-
- /* Only print what XFree86 might be interested in */
- if (pcr->busnum == 0) {
- if ((pcr->devnum != 0x10) || (pcr->funcnum != 0))
- return;
-
- /* Get Chipset Bus Number */
- cbn_460gx = (unsigned int)pciReadByte(pcr->tag, 0x0040);
- printf(" CBN 0x%02x CBUSES 0x%02x\n",
- cbn_460gx, pciReadByte(pcr->tag, 0x0044));
-
- return;
- }
-
- if ((pcr->busnum != cbn_460gx) || (pcr->funcnum != 0))
- return;
-
- switch (pcr->devnum) {
- case 0:
- printf(" F16NUM 0x%02x F16CPL 0x%02x DEVNPRES 0x%08lx\n",
- pciReadByte(pcr->tag, 0x0060), pciReadByte(pcr->tag, 0x0078),
- (long)pciReadLong(pcr->tag, 0x0070));
-
- return;
-
- case 0x10:
- printf(" TOM 0x%04x IORD 0x%04x\n",
- pciReadWord(pcr->tag, 0x0050), pciReadWord(pcr->tag, 0x008E));
- /* Fall through */
-
- case 0x11: case 0x12: case 0x13:
- case 0x14: case 0x15: case 0x16: case 0x17:
- printf(" BUSNO 0x%02x SUBNO 0x%02x\n",
- pciReadByte(pcr->tag, 0x0048), pciReadByte(pcr->tag, 0x0049));
- printf(" VGASE 0x%02x PCIS 0x%02x IOR 0x%02x\n",
- pciReadByte(pcr->tag, 0x0080), pciReadByte(pcr->tag, 0x0084),
- pciReadByte(pcr->tag, 0x008C));
- /* Fall through */
-
- default:
- return;
- }
-}
-
-static void
-print_460gx_pxb(pciConfigPtr pcr)
-{
- CARD32 tmp;
-
- /* Print generalities */
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
-
- tmp = pcr->pci_user_config;
- pcr->pci_user_config = 0;
- print_default_class(pcr);
- pcr->pci_user_config = tmp;
-
- /* Only print what XFree86 might be interested in */
- printf(" ERRCMD 0x%02x GAPEN 0x%02x\n",
- pciReadByte(pcr->tag, 0x0046), pciReadByte(pcr->tag, 0x0060));
-}
-
-static void
-print_460gx_gxb(pciConfigPtr pcr)
-{
- CARD32 tmp;
-
- /* Print generalities */
- printf(" STATUS 0x%04x COMMAND 0x%04x\n",
- pcr->pci_status, pcr->pci_command);
- printf(" CLASS 0x%02x 0x%02x 0x%02x REVISION 0x%02x\n",
- pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
- pcr->pci_rev_id);
-
- tmp = pcr->pci_user_config;
- pcr->pci_user_config = 0;
- print_default_class(pcr);
- pcr->pci_user_config = tmp;
-
- /* Only print what XFree86 might be interested in */
- printf(" BAPBASE 0x%08lx%08lx AGPSIZ 0x%02x VGAGE 0x%02x\n",
- (long)pciReadLong(pcr->tag, 0x009C),
- (long)pciReadLong(pcr->tag, 0x0098),
- pciReadByte(pcr->tag, 0x00A2), pciReadByte(pcr->tag, 0x0060));
-}
-
-#include "xf86getpagesize.c"
diff --git a/hw/xfree86/utils/scanpci/scanpci.man.pre b/hw/xfree86/utils/scanpci/scanpci.man.pre
deleted file mode 100644
index baf231603..000000000
--- a/hw/xfree86/utils/scanpci/scanpci.man.pre
+++ /dev/null
@@ -1,42 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
-.TH SCANPCI 1 __vendorversion__
-.SH NAME
-scanpci - scan/probe PCI buses
-.SH SYNOPSIS
-.B scanpci
-.RB [ \-v12OfV ]
-.SH DESCRIPTION
-.I Scanpci
-is a utility that can be used to scan PCI buses and report information
-about the configuration space settings for each PCI device.
-On most platforms,
-.I scanpci
-can only be run by the root user.
-.SH OPTIONS
-.TP 8
-.B \-v
-Print the configuration space information for each device in a verbose
-format. Without this option, only a brief description is printed for
-each device.
-.TP 8
-.B \-1
-Use PCI config type 1.
-.TP 8
-.B \-2
-Use PCI config type 2.
-.TP 8
-.B \-f
-Used in conjunction with the above two options, this forces the specified
-configuration type to be used for config space access.
-.TP 8
-.B \-O
-Use the OS's PCI config space access mechanism to access the PCI config
-space (when available).
-.TP 8
-.BI "\-V " n
-Set the verbosity level to
-.I n
-for the internal PCI scanner. This is primarily for debugging use.
-.SH "SEE ALSO"
-pcitweak(1)
-.SH AUTHORS
diff --git a/hw/xfree86/utils/xorgcfg/TODO b/hw/xfree86/utils/xorgcfg/TODO
deleted file mode 100644
index 75fe91b95..000000000
--- a/hw/xfree86/utils/xorgcfg/TODO
+++ /dev/null
@@ -1,33 +0,0 @@
-$XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/TODO,v 1.1 2001/07/04 16:09:14 paulo Exp $
-
-o Have code to fetch the SymTabRec chipset list from a video driver.
- This is mostly useful for the testing tool/interface, so that the
- Cards file "uptodate" state can also be verified.
- Probably it is better to forgot about the Cards file, and
- either parse the output of scanpci, or link libscanpci.a
- (and whatever else be required) in xf86cfg.
-
-o Check if a module is "certified", there was some talk about a
- certification process in the past.
-
-o Rewrite mouse driver to use the same code as video drivers, so that
- it is possible to store all available options in a single place.
- This would also require rewriting all existing input device modules.
- (Probably most of this can be made with cpp macros).
-
-o Create a protocol to allow 3rd part xf86cfg modules.
-
-o Write an interface for testing extensions/accel, maybe a frontend to
- xdpyinfo, x11perf, glxinfo, etc.
-
-o Write a "wizard" mode, as several users find the graphical interface
- too complicated, but find the text one easier to user.
-
-o Write code to use a Monitors database, either update the old Monitors
- file or use RedHat MonitorsDB.
- Chris Morgan is writting code to use MonitorsDB.
- If xf86cfg could be changed to ddcprobe (in all supported platforms),
- it would be even be a better solution than using a database.
-
-o Add interface to allow changing comments without the need of editing
- XF86Config with a text editor.
diff --git a/hw/xfree86/utils/xorgcfg/accessx.c b/hw/xfree86/utils/xorgcfg/accessx.c
deleted file mode 100644
index 40727ff62..000000000
--- a/hw/xfree86/utils/xorgcfg/accessx.c
+++ /dev/null
@@ -1,682 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c,v 1.10 2002/12/05 19:31:18 paulo Exp $
- */
-
-#include "config.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <X11/XKBlib.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/Scrollbar.h>
-#include <X11/Xaw/Toggle.h>
-#include "keyboard-cfg.h"
-
-#define MAX_TIMEOUT 20
-#define MAX_MOUSE_SPEED 500
-#define MAX_MOUSE_TIME 4
-#define MAX_MOUSE_DELAY 2.09
-#define MAX_REPEAT_RATE 8.04
-#define MAX_REPEAT_DELAY 6.04
-#define MAX_SLOW_TIME 4
-#define MAX_BOUNCE_TIME 4
-
-/*
- * Types
- */
-typedef struct {
- Widget label, number, scroller;
- double min, max, value, resolution;
- Bool integer;
-} Scale;
-
-/*
- * Initialization
- */
-static Widget shell, accessx, enable, timeoutToggle, form, apply;
-static Widget sticky, stickyAuto, stickyBeep;
-static Widget mouse;
-static Widget repeat;
-static Widget slowToggle, slowPressed, slowAccepted;
-static Widget bounceToggle;
-static Scale *timeout, *mouseSpeed, *mouseTime, *mouseDelay, *slow,
- *repeatRate, *repeatDelay, *bounce;
-extern Widget work;
-
-/*
- * Prototypes
- */
-static void CreateAccessXHelpDialog(void);
-static void EnableCallback(Widget, XtPointer, XtPointer);
-static void ScaleEnableCallback(Widget, XtPointer, XtPointer);
-static void ScaleJumpCallback(Widget, XtPointer, XtPointer);
-
-static void ApplyCallback(Widget, XtPointer, XtPointer);
-static void AccessXInitialize(void);
-
-void CloseAccessXAction(Widget, XEvent*, String*, Cardinal*);
-void AccessXConfigureStart(void);
-void AccessXConfigureEnd(void);
-
-/*
- * Implementation
- */
-void
-startaccessx(void)
-{
- InitializeKeyboard();
-
- if (xkb_info->xkb) {
- XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
- if (xkb_info->xkb->ctrls == NULL)
- xkb_info->xkb->ctrls = (XkbControlsPtr)
- XtCalloc(1, sizeof(XkbControlsRec));
-
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
- XkbMouseKeysAccelMask;
- xkb_info->xkb->ctrls->mk_delay = 40;
- xkb_info->xkb->ctrls->mk_interval = 10;
- xkb_info->xkb->ctrls->mk_time_to_max = 1000;
- xkb_info->xkb->ctrls->mk_max_speed = 500;
- xkb_info->xkb->ctrls->mk_curve = 0;
- XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
- (void)UpdateKeyboard(True);
- CreateAccessXHelpDialog();
- }
-}
-
-void
-CreateAccessXHelpDialog()
-{
- Widget form;
-
- shell = XtVaCreatePopupShell("accessx", transientShellWidgetClass, toplevel,
- XtNx, toplevel->core.x + toplevel->core.width,
- XtNy, toplevel->core.y, NULL, 0);
- form = XtCreateManagedWidget("form", formWidgetClass, shell, NULL, 0);
- XtCreateManagedWidget("label", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("lock", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("div", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("mul", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("minus", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("7", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("8", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("9", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("plus", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("4", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("5", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("6", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("1", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("2", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("3", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("enter", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("0", labelWidgetClass, form, NULL, 0);
- XtCreateManagedWidget("del", labelWidgetClass, form, NULL, 0);
-
- XtRealizeWidget(shell);
- XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
- XtPopup(shell, XtGrabNone);
-}
-
-/*ARGSUSED*/
-void
-CloseAccessXAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- XtPopdown(shell);
-}
-
-static void
-AccessXInitialize(void)
-{
- static int first = 1;
- Arg args[1];
- Boolean state;
- Widget stickyForm, mouseForm, repeatForm, slowForm, bounceForm;
- float val, tmp;
-
- if (!first)
- return;
- first = 0;
-
- InitializeKeyboard();
-
- XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
- if (xkb_info->xkb->ctrls == NULL)
- xkb_info->xkb->ctrls = (XkbControlsPtr)
- XtCalloc(1, sizeof(XkbControlsRec));
-
- timeout = XtNew(Scale);
- accessx = XtCreateWidget("accessxForm", formWidgetClass, work, NULL, 0);
- enable = XtVaCreateManagedWidget("enable", toggleWidgetClass, accessx,
- XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- (XkbAccessXKeysMask | XkbStickyKeysMask |
- XkbSlowKeysMask | XkbBounceKeysMask)) != 0, NULL, 0);
-
- apply = XtCreateManagedWidget("apply", commandWidgetClass, accessx, NULL, 0);
- XtAddCallback(apply, XtNcallback, ApplyCallback, NULL);
-
- form = XtCreateManagedWidget("Accessx", formWidgetClass, accessx, NULL, 0);
- timeoutToggle = XtVaCreateManagedWidget("timeoutToggle", toggleWidgetClass,
- form, XtNstate,
- xkb_info->xkb->ctrls->ax_timeout > 60
- && xkb_info->xkb->ctrls->ax_timeout
- < 30000, NULL, 0);
- XtAddCallback(timeoutToggle, XtNcallback, ScaleEnableCallback,
- (XtPointer)timeout);
- timeout->label = XtCreateManagedWidget("timeoutLabel", labelWidgetClass,
- form, NULL, 0);
- timeout->number = XtCreateManagedWidget("timeoutNumber", labelWidgetClass,
- form, NULL, 0);
- timeout->scroller = XtCreateManagedWidget("timeoutScroller",
- scrollbarWidgetClass,
- form, NULL, 0);
- XtAddCallback(timeout->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)timeout);
- timeout->min = 1;
- timeout->max = MAX_TIMEOUT;
- timeout->resolution = 1;
- timeout->integer = True;
-
- sticky = XtVaCreateManagedWidget("sticky", toggleWidgetClass, form,
- XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- XkbStickyKeysMask) != 0, NULL, 0);
- stickyForm = XtCreateManagedWidget("stickyForm", formWidgetClass,
- form, NULL, 0);
- XtAddCallback(sticky, XtNcallback, EnableCallback, (XtPointer)stickyForm);
- stickyAuto = XtVaCreateManagedWidget("auto", toggleWidgetClass, stickyForm,
- XtNstate,
- (xkb_info->xkb->ctrls->ax_options &
- XkbAX_LatchToLockMask) == 0, NULL, 0);
- stickyBeep = XtVaCreateManagedWidget("beep", toggleWidgetClass, stickyForm,
- XtNstate,
- (xkb_info->xkb->ctrls->ax_options &
- XkbAX_StickyKeysFBMask) != 0, NULL, 0);
-
- mouse = XtVaCreateManagedWidget("mouseKeys", toggleWidgetClass, form,
- XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- (XkbMouseKeysMask | XkbMouseKeysAccelMask))
- != 0, NULL, 0);
- mouseForm = XtCreateManagedWidget("mouseForm", formWidgetClass,
- form, NULL, 0);
- XtAddCallback(mouse, XtNcallback, EnableCallback, (XtPointer)mouseForm);
- mouseSpeed = XtNew(Scale);
- mouseSpeed->label = XtCreateManagedWidget("speedLabel", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseSpeed->number = XtCreateManagedWidget("speedNumber", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseSpeed->scroller = XtCreateManagedWidget("speedScroller",
- scrollbarWidgetClass,
- mouseForm, NULL, 0);
- XtAddCallback(mouseSpeed->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)mouseSpeed);
- mouseSpeed->min = 10;
- mouseSpeed->max = MAX_MOUSE_SPEED;
- mouseSpeed->resolution = 10;
- mouseSpeed->integer = True;
- mouseTime = XtNew(Scale);
- mouseTime->label = XtCreateManagedWidget("timeLabel", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseTime->number = XtCreateManagedWidget("timeNumber", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseTime->scroller = XtCreateManagedWidget("timeScroller",
- scrollbarWidgetClass,
- mouseForm, NULL, 0);
- XtAddCallback(mouseTime->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)mouseTime);
- mouseTime->min = .1;
- mouseTime->max = MAX_MOUSE_TIME;
- mouseTime->resolution = .1;
- mouseTime->integer = False;
- mouseDelay = XtNew(Scale);
- mouseDelay->label = XtCreateManagedWidget("delayLabel", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseDelay->number = XtCreateManagedWidget("delayNumber", labelWidgetClass,
- mouseForm, NULL, 0);
- mouseDelay->scroller = XtCreateManagedWidget("delayScroller",
- scrollbarWidgetClass,
- mouseForm, NULL, 0);
- XtAddCallback(mouseDelay->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)mouseDelay);
- mouseDelay->min = .1;
- mouseDelay->max = MAX_MOUSE_DELAY;
- mouseDelay->resolution = .1;
- mouseDelay->integer = False;
-
- repeat = XtVaCreateManagedWidget("repeatKeys", toggleWidgetClass, form,
- XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- XkbRepeatKeysMask) != 0, NULL, 0);
- repeatForm = XtCreateManagedWidget("repeatForm", formWidgetClass,
- form, NULL, 0);
- XtAddCallback(repeat, XtNcallback, EnableCallback, (XtPointer)repeatForm);
- repeatRate = XtNew(Scale);
- repeatRate->label = XtCreateManagedWidget("rateLabel", labelWidgetClass,
- repeatForm, NULL, 0);
- repeatRate->number = XtCreateManagedWidget("rateNumber", labelWidgetClass,
- repeatForm, NULL, 0);
- repeatRate->scroller = XtCreateManagedWidget("rateScroller",
- scrollbarWidgetClass,
- repeatForm, NULL, 0);
- XtAddCallback(repeatRate->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)repeatRate);
- repeatRate->min = .05;
- repeatRate->max = MAX_REPEAT_RATE;
- repeatRate->resolution = .05;
- repeatRate->integer = False;
- repeatDelay = XtNew(Scale);
- repeatDelay->label = XtCreateManagedWidget("delayLabel", labelWidgetClass,
- repeatForm, NULL, 0);
- repeatDelay->number = XtCreateManagedWidget("delayNumber", labelWidgetClass,
- repeatForm, NULL, 0);
- repeatDelay->scroller = XtCreateManagedWidget("delayScroller",
- scrollbarWidgetClass,
- repeatForm, NULL, 0);
- XtAddCallback(repeatDelay->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)repeatDelay);
- repeatDelay->min = .05;
- repeatDelay->max = MAX_REPEAT_DELAY;
- repeatDelay->resolution = .05;
- repeatDelay->integer = False;
-
- slowToggle = XtVaCreateManagedWidget("slow", toggleWidgetClass,
- form, XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- XkbSlowKeysMask) != 0, NULL, 0);
- slowForm = XtCreateManagedWidget("slowForm", formWidgetClass,
- form, NULL, 0);
- XtAddCallback(slowToggle, XtNcallback, EnableCallback, (XtPointer)slowForm);
- XtCreateManagedWidget("beep", labelWidgetClass, slowForm, NULL, 0);
- slowPressed = XtVaCreateManagedWidget("pressed", toggleWidgetClass,
- slowForm, XtNstate,
- (xkb_info->xkb->ctrls->ax_options &
- XkbAX_SKPressFBMask) != 0,
- NULL, 0);
- slowAccepted = XtVaCreateManagedWidget("accepted", toggleWidgetClass,
- slowForm, XtNstate,
- (xkb_info->xkb->ctrls->ax_options &
- XkbAX_SKAcceptFBMask) != 0,
- NULL, 0);
- slow = XtNew(Scale);
- slow->label = XtCreateManagedWidget("slowLabel", labelWidgetClass,
- slowForm, NULL, 0);
- slow->number = XtCreateManagedWidget("slowNumber", labelWidgetClass,
- slowForm, NULL, 0);
- slow->scroller = XtCreateManagedWidget("slowScroller",
- scrollbarWidgetClass,
- slowForm, NULL, 0);
- XtAddCallback(slow->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)slow);
- slow->min = 0.1;
- slow->max = MAX_SLOW_TIME;
- slow->resolution = 0.1;
- slow->integer = False;
-
- bounceToggle = XtVaCreateManagedWidget("bounce", toggleWidgetClass,
- form, XtNstate,
- (xkb_info->xkb->ctrls->enabled_ctrls &
- XkbBounceKeysMask) != 0,
- NULL, 0);
- bounceForm = XtCreateManagedWidget("bounceForm", formWidgetClass,
- form, NULL, 0);
- XtAddCallback(bounceToggle, XtNcallback, EnableCallback, (XtPointer)bounceForm);
- bounce = XtNew(Scale);
- bounce->label = XtCreateManagedWidget("bounceLabel", labelWidgetClass,
- bounceForm, NULL, 0);
- bounce->number = XtCreateManagedWidget("bounceNumber", labelWidgetClass,
- bounceForm, NULL, 0);
- bounce->scroller = XtCreateManagedWidget("bounceScroller",
- scrollbarWidgetClass,
- bounceForm, NULL, 0);
- XtAddCallback(bounce->scroller, XtNjumpProc, ScaleJumpCallback,
- (XtPointer)bounce);
- bounce->min = 0.1;
- bounce->max = MAX_BOUNCE_TIME;
- bounce->resolution = 0.1;
- bounce->integer = False;
-
- XtRealizeWidget(accessx);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(timeoutToggle, args, 1);
- ScaleEnableCallback(enable, (XtPointer)timeout, (XtPointer)(long)state);
- if (xkb_info->xkb->ctrls->ax_timeout > 60)
- val = (float)(xkb_info->xkb->ctrls->ax_timeout - 60) /
- (float)(MAX_TIMEOUT * 60);
- else
- val = 0;
- ScaleJumpCallback(timeout->scroller, (XtPointer)timeout, (XtPointer)&val);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(sticky, args, 1);
- EnableCallback(sticky, (XtPointer)stickyForm, (XtPointer)(long)state);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(mouse, args, 1);
- EnableCallback(mouse, (XtPointer)mouseForm, (XtPointer)(long)state);
- if (xkb_info->xkb->ctrls->mk_time_to_max > 10)
- val = (float)((xkb_info->xkb->ctrls->mk_time_to_max * (40. / 10.))) /
- (float)(MAX_MOUSE_TIME * 100);
- else
- val = 10.0 / (float)(MAX_MOUSE_TIME * 100);
- ScaleJumpCallback(mouseTime->scroller, (XtPointer)mouseTime,
- (XtPointer)&val);
- tmp = mouseTime->value;
- if (xkb_info->xkb->ctrls->mk_max_speed != 0)
- val = (float)(xkb_info->xkb->ctrls->mk_max_speed / tmp - 10) /
- (float)MAX_MOUSE_SPEED;
- else
- val = 10.0 / (float)MAX_MOUSE_SPEED;
- ScaleJumpCallback(mouseSpeed->scroller, (XtPointer)mouseSpeed,
- (XtPointer)&val);
- if (xkb_info->xkb->ctrls->mk_delay > 10)
- val = (float)(xkb_info->xkb->ctrls->mk_delay - 10) /
- (float)(MAX_MOUSE_DELAY * 100);
- else
- val = 10.0 / (float)(MAX_MOUSE_DELAY * 100);
- ScaleJumpCallback(mouseDelay->scroller, (XtPointer)mouseDelay,
- (XtPointer)&val);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(repeat, args, 1);
- EnableCallback(repeat, (XtPointer)repeatForm, (XtPointer)(long)state);
- if (xkb_info->xkb->ctrls->repeat_interval > 5)
- val = (float)(xkb_info->xkb->ctrls->repeat_interval - 5) /
- (float)(MAX_REPEAT_RATE * 1000);
- else
- val = 5.0 / (float)(MAX_REPEAT_RATE * 1000);
- ScaleJumpCallback(repeatRate->scroller, (XtPointer)repeatRate,
- (XtPointer)&val);
- if (xkb_info->xkb->ctrls->repeat_delay > 5)
- val = (float)(xkb_info->xkb->ctrls->repeat_delay - 5) /
- (float)(MAX_REPEAT_DELAY * 1000);
- else
- val = 5.0 / (float)(MAX_REPEAT_DELAY * 1000);
- ScaleJumpCallback(repeatDelay->scroller, (XtPointer)repeatDelay,
- (XtPointer)&val);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowToggle, args, 1);
- EnableCallback(slowToggle, (XtPointer)slowForm, (XtPointer)(long)state);
- if (xkb_info->xkb->ctrls->slow_keys_delay > 10)
- val = (float)(xkb_info->xkb->ctrls->repeat_delay - 10) /
- (float)(MAX_SLOW_TIME * 1000);
- else
- val = 10.0 / (float)(MAX_SLOW_TIME * 1000);
- ScaleJumpCallback(slow->scroller, (XtPointer)slow, (XtPointer)&val);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(bounceToggle, args, 1);
- EnableCallback(bounceToggle, (XtPointer)bounceForm, (XtPointer)(long)state);
- if (xkb_info->xkb->ctrls->debounce_delay > 10)
- val = (float)(xkb_info->xkb->ctrls->debounce_delay - 10) /
- (float)(MAX_BOUNCE_TIME * 1000);
- else
- val = 10.0 / (float)(MAX_BOUNCE_TIME * 1000);
- ScaleJumpCallback(bounce->scroller, (XtPointer)bounce, (XtPointer)&val);
-
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(enable, args, 1);
-}
-
-void
-AccessXConfigureStart(void)
-{
- AccessXInitialize();
-
- XtMapWidget(accessx);
-}
-
-void
-AccessXConfigureEnd(void)
-{
- XtUnmapWidget(accessx);
-}
-
-/*ARGSUSED*/
-static void
-EnableCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtSetSensitive((Widget)user_data, (long)call_data);
-}
-
-/*ARGSUSED*/
-static void
-ScaleEnableCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Scale *scale = (Scale*)user_data;
-
- XtSetSensitive(scale->label, (long)call_data);
- XtSetSensitive(scale->number, (long)call_data);
- XtSetSensitive(scale->scroller, (long)call_data);
-}
-
-static void
-ScaleJumpCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Scale *scale = (Scale*)user_data;
- float percent = *(float *)call_data, timeout = percent * scale->max;
- int x;
- char str[8];
- Arg args[1];
-
- if (timeout >= scale->max - scale->min)
- timeout = scale->max - scale->min;
-
- if (scale->integer) {
- int tm = timeout + scale->min;
-
- tm -= tm % (int)scale->resolution;
- XmuSnprintf(str, sizeof(str), "%i", tm);
- scale->value = tm;
- }
- else {
- long tm = (timeout + scale->min) * 1e+6;
-
- tm -= tm % (long)(scale->resolution * 1e+6);
- scale->value = (double)tm / 1e+6;
- XmuSnprintf(str, sizeof(str), "%f", scale->value);
- }
-
- XtSetArg(args[0], XtNlabel, str);
- XtSetValues(scale->number, args, 1);
- x = w->core.x + w->core.border_width;
- x += ((double)(w->core.width - scale->number->core.width) / scale->max) * timeout;
- XtMoveWidget(scale->number, x, scale->number->core.y);
- XawScrollbarSetThumb(w, timeout / (scale->max - scale->min),
- scale->resolution / (scale->max - scale->min));
-}
-
-/*ARGSUSED*/
-static void
-ApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- Boolean state;
-
- XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
-
- /* Enable AccessX */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(enable, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbAccessXKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbAccessXKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbAccessXKeysMask;
- }
-
- /* Timeout */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(timeoutToggle, args, 1);
- if (state)
- xkb_info->config.ax_timeout =
- xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60;
- else
- xkb_info->config.ax_timeout =
- xkb_info->xkb->ctrls->ax_timeout = 65535;
-
- /* Enable StickyKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(sticky, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbStickyKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(stickyAuto, args, 1);
- if (state) {
- xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
- xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
- xkb_info->config.initial_opts |= XkbAX_LatchToLockMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(stickyBeep, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask;
- }
-
- /* Enable MouseKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(mouse, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbMouseKeysAccelMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
- XkbMouseKeysAccelMask;
- xkb_info->config.mk_delay =
- xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100;
- xkb_info->config.mk_interval =
- xkb_info->xkb->ctrls->mk_interval = 40;
- xkb_info->config.mk_time_to_max =
- xkb_info->xkb->ctrls->mk_time_to_max =
- (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval;
- xkb_info->config.mk_max_speed =
- xkb_info->xkb->ctrls->mk_max_speed =
- mouseSpeed->value * mouseTime->value;
- xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0;
- }
- else {
- xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask |
- XkbMouseKeysAccelMask);
- xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask |
- XkbMouseKeysAccelMask);
- }
-
- /* Enable RepeatKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(repeat, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbRepeatKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask;
- xkb_info->config.repeat_interval =
- xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000;
- xkb_info->config.repeat_delay =
- xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask;
- }
-
- /* Enable SlowKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowToggle, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbSlowKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask;
- xkb_info->config.slow_keys_delay =
- xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowPressed, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_SKPressFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask;
- }
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(slowAccepted, args, 1);
- if (state) {
- xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask;
- xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask;
- }
- else {
- xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask;
- xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask;
- }
-
- /* Enable BounceKeys */
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(bounceToggle, args, 1);
- if (state) {
- xkb_info->config.initial_ctrls |= XkbBounceKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask;
- xkb_info->config.debounce_delay =
- xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000;
- }
- else {
- xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask;
- xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask;
- }
-
- XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
- XSync(DPY, False);
- (void)UpdateKeyboard(True);
-}
diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.c b/hw/xfree86/utils/xorgcfg/card-cfg.c
deleted file mode 100644
index 5299025f1..000000000
--- a/hw/xfree86/utils/xorgcfg/card-cfg.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include "xf86config.h"
-#include "mouse-cfg.h"
-#include "cards.h"
-#include "card-cfg.h"
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/Viewport.h>
-#ifdef USE_MODULES
-#include "loader.h"
-#endif
-
-/*
- * Prototypes
- */
-static Bool CardConfigCheck(void);
-static void CardModelCallback(Widget, XtPointer, XtPointer);
-#ifdef USE_MODULES
-static void DriverCallback(Widget, XtPointer, XtPointer);
-#endif
-
-/*
- * Initialization
- */
-static CardsEntry *card_entry;
-static XF86ConfDevicePtr current_device;
-static Widget filter, list, driver, busid;
-static char **cards = NULL;
-static int ncards;
-#ifdef USE_MODULES
-static char *driver_str;
-#endif
-
-/*
- * Implementation
- */
-/*ARGSUSED*/
-XtPointer
-CardConfig(XtPointer config)
-{
- XF86ConfDevicePtr card = (XF86ConfDevicePtr)config;
-/* XF86OptionPtr option;*/
- char card_name[32];
- Arg args[1];
- char *bus, *drv_nam;
-
- xf86info.cur_list = CARD;
- XtSetSensitive(back, xf86info.lists[CARD].cur_function > 0);
- XtSetSensitive(next, xf86info.lists[CARD].cur_function <
- xf86info.lists[CARD].num_functions - 1);
- (xf86info.lists[CARD].functions[xf86info.lists[CARD].cur_function])
- (&xf86info);
-
- card_entry = NULL;
- current_device = card;
- XawListUnhighlight(list);
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(filter, args, 1);
-
- if (card != NULL) {
- if (card->dev_card != NULL) {
- int i;
-
- for (i = 0; i < ncards; i++) {
- if (strcasecmp(cards[i], card->dev_card) == 0) {
- card_entry = LookupCard(cards[i]);
- XawListHighlight(list, i);
- XtSetArg(args[0], XtNstring, cards[i]);
- XtSetValues(filter, args, 1);
- break;
- }
- }
- }
- XtSetArg(args[0], XtNstring, card->dev_identifier);
- XtSetValues(ident_widget, args, 1);
- XtSetArg(args[0], XtNstring, card->dev_busid);
- XtSetValues(busid, args, 1);
-#ifdef USE_MODULES
- if (!nomodules)
- XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver));
- else
-#endif
- XtSetArg(args[0], XtNstring, card->dev_driver);
- XtSetValues(driver, args, 1);
- }
- else {
- XF86ConfDevicePtr device = XF86Config->conf_device_lst;
- int ndevices = 0;
-
- while (device != NULL) {
- ++ndevices;
- device = (XF86ConfDevicePtr)(device->list.next);
- }
- do {
- XmuSnprintf(card_name, sizeof(card_name), "Card%d", ndevices);
- ++ndevices;
- } while (xf86findDevice(card_name,
- XF86Config->conf_device_lst));
-
- XtSetArg(args[0], XtNstring, card_name);
- XtSetValues(ident_widget, args, 1);
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(busid, args, 1);
-#ifdef USE_MODULES
- if (!nomodules)
- XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga"));
- else
-#endif
- XtSetArg(args[0], XtNstring, "vga");
- XtSetValues(driver, args, 1);
- }
-
- if (ConfigLoop(CardConfigCheck) == True) {
- if (card_entry != NULL && card_entry->driver == NULL) {
- fprintf(stderr, "No driver field in Cards database.\n"
- "Please make sure you have the correct files installed.\n");
- exit(1);
- }
- if (card == NULL) {
- card = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
- card->dev_identifier = XtNewString(ident_string);
- if (card_entry) {
- card->dev_driver = XtNewString(card_entry->driver);
- card->dev_card = XtNewString(card_entry->name);
- if (card_entry->chipset)
- card->dev_chipset = XtNewString(card_entry->chipset);
- if (card_entry->ramdac)
- card->dev_ramdac = XtNewString(card_entry->ramdac);
- if (card_entry->clockchip)
- card->dev_clockchip = XtNewString(card_entry->clockchip);
- }
- /* else will fallback to "vga" */
- }
- else if (card_entry != NULL) {
- XtFree(card->dev_driver);
- card->dev_driver = XtNewString(card_entry->driver);
- if (card_entry->chipset) {
- XtFree(card->dev_chipset);
- card->dev_chipset = XtNewString(card_entry->chipset);
- }
- if (card_entry->ramdac) {
- XtFree(card->dev_ramdac);
- card->dev_ramdac = XtNewString(card_entry->ramdac);
- }
- if (card_entry->clockchip) {
- XtFree(card->dev_clockchip);
- card->dev_clockchip = XtNewString(card_entry->clockchip);
- }
- }
- if (strcasecmp(card->dev_identifier, ident_string))
- xf86renameDevice(XF86Config, card, ident_string);
- XtSetArg(args[0], XtNstring, &bus);
- XtGetValues(busid, args, 1);
- XtFree(card->dev_busid);
- card->dev_busid = XtNewString(bus);
-
-#ifdef USE_MODULES
- if (!nomodules)
- drv_nam = driver_str;
- else
-#endif
- {
- XtSetArg(args[0], XtNstring, &drv_nam);
- XtGetValues(driver, args, 1);
- }
-
- XtFree(card->dev_driver);
- card->dev_driver = XtNewString(drv_nam);
-
-#ifdef USE_MODULES
- if (!nomodules)
- XtFree(driver_str);
-#endif
-
- return ((XtPointer)card);
- }
-#ifdef USE_MODULES
- if (!nomodules)
- XtFree(driver_str);
-#endif
-
- return (NULL);
-}
-
-static Bool
-CardConfigCheck(void)
-{
- XF86ConfDevicePtr device = XF86Config->conf_device_lst;
- char *drv_nam;
-
-#ifdef USE_MODULES
- if (!nomodules)
- drv_nam = driver_str;
- else
-#endif
- {
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, &drv_nam);
- XtGetValues(driver, args, 1);
- }
-
- if (ident_string == NULL || strlen(ident_string) == 0 ||
-#if 0
- /* not all available cards are in the Cards database */
- (current_device == NULL && card_entry == NULL) ||
-#endif
- drv_nam == NULL || *drv_nam == '\0')
- return (False);
-
- while (device != NULL) {
- if (device != current_device &&
- strcasecmp(ident_string, device->dev_identifier) == 0)
- return (False);
- device = (XF86ConfDevicePtr)(device->list.next);
- }
-
- return (True);
-}
-
-static void
-CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
- char tip[4096];
- int len;
-
- XtSetArg(args[0], XtNstring, info->string);
- XtSetValues(filter, args, 1);
- card_entry = LookupCard(info->string);
-
- if (card_entry == NULL)
- return;
-
- len = XmuSnprintf(tip, sizeof(tip), "Name: %s\n", card_entry->name);
- if (card_entry->flags & F_UNSUPPORTED)
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "**THIS CARD IS UNSUPPORTED**\n");
- if (card_entry->chipset != NULL)
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "Chipset: %s\n", card_entry->chipset);
- if (card_entry->driver != NULL) {
-#ifdef USE_MODULES
- if (!nomodules) {
- XtFree(driver_str);
- driver_str = XtNewString(card_entry->driver);
- XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0);
- }
-#endif
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "Driver: %s\n", card_entry->driver);
- }
- if (card_entry->ramdac != NULL)
- len += XmuSnprintf(tip + len, sizeof(tip),
- "Ramdac: %s\n", card_entry->ramdac);
- if (card_entry->clockchip != NULL)
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "Clockchip: %s\n", card_entry->clockchip);
- if (card_entry->dacspeed != NULL)
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "Dacspeed: %s\n", card_entry->dacspeed);
- if (card_entry->lines != NULL)
- len += XmuSnprintf(tip + len, sizeof(tip) - len,
- "\n%s\n", card_entry->lines);
-
-#ifndef USE_MODULES
- XtSetArg(args[0], XtNstring,
- card_entry->driver ? card_entry->driver : "vga");
- XtSetValues(driver, args, 1);
-#endif
-
- XtSetArg(args[0], XtNtip, tip);
- XtSetValues(filter, args, 1);
-}
-
-/*ARGSUSED*/
-void
-CardFilterAction(Widget w, XEvent *ev, String *params, Cardinal *num_params)
-{
- char **cards, *pattern, **old_cards;
- int ncards, old_ncards;
- Arg args[2];
-
- XtSetArg(args[0], XtNstring, &pattern);
- XtGetValues(w, args, 1);
-
- XtSetArg(args[0], XtNlist, &old_cards);
- XtSetArg(args[1], XtNnumberStrings, &old_ncards);
- XtGetValues(list, args, 2);
-
- cards = FilterCardNames(pattern, &ncards);
-
- if (ncards == 0) {
- cards = (char**)XtMalloc(sizeof(char*));
- cards[0] = XtNewString("");
- ncards = 1;
- }
-
- XtSetArg(args[0], XtNlist, cards);
- XtSetArg(args[1], XtNnumberStrings, ncards);
- XtSetValues(list, args, 2);
-
- if (old_ncards > 1 || (XtName(list) != old_cards[0])) {
- while (--old_ncards > -1)
- XtFree(old_cards[old_ncards]);
- XtFree((char*)old_cards);
- }
-
- /* force relayout */
- XtUnmanageChild(list);
- XtManageChild(list);
-}
-
-#ifdef USE_MODULES
-/*ARGSUSED*/
-static void
-DriverCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
-
- XtFree(driver_str);
- driver_str = XtNewString(XtName(w));
- XtSetArg(args[0], XtNlabel, driver_str);
- XtSetValues(driver, args, 1);
-}
-#endif
-
-void
-CardModel(XF86SetupInfo *info)
-{
- static int first = 1;
- static Widget model;
-
- if (first) {
- Widget viewport;
-
- first = 0;
-
- cards = GetCardNames(&ncards);
-
- model = XtCreateWidget("cardModel", formWidgetClass,
- configp, NULL, 0);
- (void) XtCreateManagedWidget("label", labelWidgetClass,
- model, NULL, 0);
- filter = XtVaCreateManagedWidget("filter", asciiTextWidgetClass,
- model,
- XtNeditType, XawtextEdit,
- NULL, 0);
- viewport = XtCreateManagedWidget("viewport", viewportWidgetClass,
- model, NULL, 0);
- list = XtVaCreateManagedWidget("list", listWidgetClass,
- viewport,
- XtNlist, cards,
- XtNnumberStrings, ncards,
- NULL, 0);
- XtAddCallback(list, XtNcallback, CardModelCallback,
- (XtPointer)info);
- XtCreateManagedWidget("driverL", labelWidgetClass, model, NULL, 0);
-#ifdef USE_MODULES
- if (!nomodules) {
- driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass,
- model,
- XtNmenuName, "driverM",
- NULL, 0);
- {
- Widget menu, sme;
- xf86cfgModuleOptions *opts = module_options;
-
- menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass,
- driver, NULL, 0);
- while (opts) {
- if (opts->type == VideoModule) {
- sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass,
- menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, DriverCallback, NULL);
- }
- opts = opts->next;
- }
- }
- }
- else
-#endif
- driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass,
- model,
- XtNeditType, XawtextEdit,
- NULL, 0);
-
- XtCreateManagedWidget("busidL", labelWidgetClass, model, NULL, 0);
- busid = XtVaCreateManagedWidget("busid", asciiTextWidgetClass,
- model,
- XtNeditType, XawtextEdit,
- NULL, 0);
-
- XtRealizeWidget(model);
- }
- XtChangeManagedSet(&current, 1, NULL, NULL, &model, 1);
- current = model;
-}
diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.h b/hw/xfree86/utils/xorgcfg/card-cfg.h
deleted file mode 100644
index 14411440d..000000000
--- a/hw/xfree86/utils/xorgcfg/card-cfg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.h,v 1.1 2000/04/04 22:36:57 dawes Exp $
- */
-
-#include "config.h"
-
-#ifndef _xf86cfg_card_h
-#define _xf86cfg_card_h
-
-/*
- * Prototypes
- */
-XtPointer CardConfig(XtPointer);
-void CardModel(XF86SetupInfo*);
-void CardFilterAction(Widget, XEvent*, String*, Cardinal*);
-
-#endif /* _xf86cfg_card_h */
diff --git a/hw/xfree86/utils/xorgcfg/card.xbm b/hw/xfree86/utils/xorgcfg/card.xbm
deleted file mode 100644
index b3cbba322..000000000
--- a/hw/xfree86/utils/xorgcfg/card.xbm
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card.xbm,v 1.1 2000/04/04 22:36:57 dawes Exp $
- */
-#define card_width 50
-#define card_height 44
-static unsigned char card_bits[] = {
- 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfd, 0xff, 0xff, 0xff, 0x07,
- 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x07, 0x00, 0x00,
- 0x00, 0x1c, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x01,
- 0x00, 0x00, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x00, 0x00, 0xf8, 0x19, 0x00,
- 0x80, 0xf9, 0xf8, 0x7f, 0x98, 0x19, 0x00, 0x80, 0x01, 0xf8, 0x7f, 0x98,
- 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x18,
- 0x60, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x18, 0x60, 0x00, 0x18, 0x00, 0x80,
- 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19,
- 0x00, 0x80, 0xf9, 0x18, 0x60, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x18, 0x60,
- 0x98, 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0x01,
- 0xf8, 0x7f, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0xf8, 0x7f, 0x00, 0x18, 0x00,
- 0x80, 0xf9, 0x00, 0x00, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x00, 0x00, 0xf8,
- 0x19, 0x00, 0x80, 0x01, 0x30, 0x33, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x30,
- 0x33, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x30, 0x33, 0xf8, 0x19, 0x00, 0x80,
- 0x01, 0x30, 0x33, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18,
- 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x80, 0xff, 0x07, 0x00,
- 0x80, 0x0f, 0x00, 0x80, 0xfd, 0x0f, 0x00, 0xc0, 0x07, 0x00, 0x80, 0x01,
- 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x80, 0x01, 0xcc, 0xcc, 0xcc, 0x00, 0x00,
- 0x80, 0x01, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x80, 0x01, 0xcc, 0xcc, 0xcc,
- 0x00, 0x00, 0x80, 0x01, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x80, 0x01, 0xf8,
- 0xff, 0x7f, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/card.xpm b/hw/xfree86/utils/xorgcfg/card.xpm
deleted file mode 100644
index d68257469..000000000
--- a/hw/xfree86/utils/xorgcfg/card.xpm
+++ /dev/null
@@ -1,81 +0,0 @@
-/* XPM */
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card.xpm,v 1.1 2000/04/04 22:36:57 dawes Exp $
- */
-static char * card_xpm[] = {
-"41 40 8 1",
-" c none",
-"A c #B6DABAEAB6DA",
-"X c #0000AAAA0000",
-"o c #000071C60000",
-"O c #000041030000",
-"+ c #618561856185",
-"@ c #186118611861",
-"# c #CF3CA2892081",
-"AAA ",
-" A ",
-" A ",
-" A ",
-" A ",
-" A ",
-" A ",
-" AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ",
-" AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooOOOOOOOOOOOOO",
-" AooooooooooooooooooAoAoAoAooAAAAAAA+oO",
-" AooooooooooooooooooAoAoAoAooA++++++@oO",
-" AooooooooooooooooooAoAoAoAooA+oooo+@oO",
-" AoooooooooooooooooooooooooooA+AAAA+@oO",
-" AoooooooooooooooooooooooooooA+oooo+@oO",
-" AoooooooooooooooooooooooooooA++++++@oO",
-" Aooooooooooooooooooooooooooo+@@@@@@@oO",
-" AooooooooooooooooooooooooooooooooooooO",
-" AoooooooooooooooooooooooooooAAAAAAA+oO",
-" +AoooooooooooooooooAAAAAAAA@oA++++++@oO",
-" AoooooooooooooooooA+++++++@oA+oooo+@oO",
-" AoooooooooooooooooA+++++++@oA+AAAA+@oO",
-" ++AoooooooooooooooooA+++++++@oA+oooo+@oO",
-" ++AoooooooooooooooooA+++++++@oA++++++@oO",
-" ++Aooooooooooooooooo@@@@@@@@@o+@@@@@@@oO",
-" ++AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooooooooooooooO",
-" +AooooooooooooooooooooooooooooooooooooO",
-" AooooooooooooooooooooooooooooooooooooO",
-" AoooOOOOooooooooooooooooooooOoooooOOO ",
-" AooO X#o#o#o#o#o#o#o#o#oO X#o#O ",
-" AOO X#o#o#o#o#o#o#o#o#oO X#o#O ",
-" A X#o#o#o#o#o#o#o#o#oO X#o#O ",
-" A X#o#o#o#o#o#o#o#o#oO X#o#O ",
-" A OOOOOOOOOOOOOOOOOO OOO ",
-" A ",
-" A "};
diff --git a/hw/xfree86/utils/xorgcfg/cards.c b/hw/xfree86/utils/xorgcfg/cards.c
deleted file mode 100644
index d5805fa98..000000000
--- a/hw/xfree86/utils/xorgcfg/cards.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/cards.c,v 1.15 2003/02/15 05:37:58 paulo Exp $
- */
-
-#define CARDS_PRIVATE
-#include "cards.h"
-
-#undef SERVER /* defined in config.h, but of no use here */
-
-/* return values from ReadCardsLine. */
-#define ERROR -3
-#define UNKNOWN -2
-#define END -1
-#define NOTUSEFUL 0
-#define NAME 1
-#define CHIPSET 2
-#define SERVER 3
-#define DRIVER 4
-#define RAMDAC 5
-#define CLOCKCHIP 6
-#define DACSPEED 7
-#define NOCLOCKPROBE 8
-#define UNSUPPORTED 9
-#define SEE 10
-#define LINE 11
-
-/*
- * Prototypes
- */
-static int ReadCardsLine(FILE*, char*); /* must have 256 bytes */
-static int CompareCards(_Xconst void *left, _Xconst void *right);
-static int BCompareCards(_Xconst void *left, _Xconst void *right);
-static void DoReadCardsDatabase(void);
-static char **DoFilterCardNames(char *pattern, int *result);
-
-#ifdef USE_MODULES
-
-typedef struct {
- int ivendor;
- unsigned short vendor;
- unsigned short valid_vendor;
- char *chipsets;
- int num_chipsets;
-} chipset_check;
-#endif
-
-/*
- * Initialization
- */
-static int linenum = 0;
-static char *Cards = "lib/X11/Cards";
-CardsEntry **CardsDB;
-int NumCardsEntry;
-
-/*
- * Implementation
- */
-#ifdef USE_MODULES
-const pciVendorInfo *xf86PCIVendorInfo;
-#endif
-
-#ifdef USE_MODULES
-void
-InitializePciInfo(void)
-{
- xf86PCIVendorInfo = pciVendorInfoList;
-}
-
-void
-CheckChipsets(xf86cfgModuleOptions *opts, int *err)
-{
- int i, j, ichk, ivnd = 0, vendor = -1, device;
- const pciDeviceInfo **pDev;
- SymTabPtr chips = opts->chipsets;
- chipset_check *check = NULL;
- int num_check = 0;
-
- if (!chips) {
- CheckMsg(CHECKER_NO_CHIPSETS, "WARNING No chipsets specified.\n");
- ++*err;
- return;
- }
-
- while (chips->name) {
- device = chips->token & 0xffff;
- vendor = (chips->token & 0xffff0000) >> 16;
- if (vendor == 0)
- vendor = opts->vendor;
-
- for (ichk = 0; ichk < num_check; ichk++)
- if (check[ichk].vendor == vendor)
- break;
- if (ichk >= num_check) {
- check = (chipset_check*)
- XtRealloc((XtPointer)check,
- sizeof(chipset_check) * (num_check + 1));
- check[num_check].vendor = vendor;
- memset(&check[num_check], 0, sizeof(chipset_check));
- ++num_check;
- }
-
- /* Search for vendor in xf86PCIVendorInfo */
- if (xf86PCIVendorInfo) {
- for (ivnd = 0; xf86PCIVendorInfo[ivnd].VendorID; ivnd++)
- if (vendor == xf86PCIVendorInfo[ivnd].VendorID)
- break;
- }
- if (xf86PCIVendorInfo && xf86PCIVendorInfo[ivnd].VendorID) {
- check[ichk].valid_vendor = 1;
- check[ichk].ivendor = ivnd;
- }
- else {
- CheckMsg(CHECKER_CANNOT_VERIFY_CHIPSET,
- "WARNING Cannot verify chipset \"%s\" (0x%x)\n",
- chips->name, device);
- ++*err;
- ++chips;
- continue;
- }
-
- if (xf86PCIVendorInfo &&
- (pDev = xf86PCIVendorInfo[ivnd].Device) != NULL) {
- if (check[ichk].chipsets == NULL) {
- for (j = 0; pDev[j]; j++)
- ;
- check[ichk].chipsets = (char*)XtCalloc(1, j);
- }
- for (j = 0; pDev[j]; j++) {
- if (device == pDev[j]->DeviceID) {
- if (strcmp(chips->name, pDev[j]->DeviceName)) {
- CheckMsg(CHECKER_NOMATCH_CHIPSET_STRINGS,
- "WARNING chipset strings don't match: \"%s\" \"%s\" (0x%x)\n",
- chips->name, xf86PCIVendorInfo[ivnd].Device[j]->DeviceName,
- device);
- ++*err;
- }
- break;
- }
- }
- if (!pDev[j]) {
- CheckMsg(CHECKER_CHIPSET_NOT_LISTED,
- "WARNING chipset \"%s\" (0x%x) not in list.\n", chips->name, device);
- ++*err;
- }
- else
- check[ichk].chipsets[j] = 1;
- }
- ++chips;
- }
-
- for (i = 0; i < num_check; i++) {
- if (!check[i].valid_vendor) {
- CheckMsg(CHECKER_CHIPSET_NO_VENDOR,
- "WARNING No such vendor 0x%x\n", vendor);
- ++*err;
- }
- for (j = 0; j < check[i].num_chipsets; j++) {
- if (xf86PCIVendorInfo && !check[i].chipsets[j]) {
- CheckMsg(CHECKER_CHIPSET_NOT_SUPPORTED,
- "NOTICE chipset \"%s\" (0x%x) not listed as supported.\n",
- xf86PCIVendorInfo[check[i].ivendor].Device[j]->DeviceName,
- xf86PCIVendorInfo[check[i].ivendor].Device[j]->DeviceID);
- }
- }
- XtFree(check[i].chipsets);
- }
-
- XtFree((XtPointer)check);
-}
-#endif
-
-void
-ReadCardsDatabase(void)
-{
-#ifdef USE_MODULES
- if (!nomodules) {
- int i, j, ivendor, idevice;
- char name[256];
- _Xconst char *vendor, *device;
- CardsEntry *entry = NULL, *tmp;
- xf86cfgModuleOptions *opts = module_options;
- const pciDeviceInfo **pDev;
-
- /* Only list cards that have a driver installed */
- while (opts) {
- if (opts->chipsets) {
- SymTabPtr chips = opts->chipsets;
-
- while (chips->name) {
- vendor = opts->name;
- device = chips->name;
- ivendor = (chips->token & 0xffff0000) >> 16;
- idevice = chips->token & 0xffff0;
- if (ivendor == 0)
- ivendor = opts->vendor;
-
- if (xf86PCIVendorInfo) {
- for (i = 0; xf86PCIVendorInfo[i].VendorName; i++)
- if (ivendor == xf86PCIVendorInfo[i].VendorID) {
- vendor = xf86PCIVendorInfo[i].VendorName;
- break;
- }
- if (xf86PCIVendorInfo[i].VendorName) {
- if ((pDev = xf86PCIVendorInfo[i].Device)) {
- for (j = 0; pDev[j]; j++)
- if (idevice == pDev[j]->DeviceID) {
- device = pDev[j]->DeviceName;
- break;
- }
- }
- }
- }
-
- /* Since frequently there is more than one driver for a
- * single vendor, it is required to avoid duplicates.
- */
- XmuSnprintf(name, sizeof(name), "%s %s", vendor, device);
- tmp = LookupCard(name);
-
- if (tmp == NULL || strcmp(tmp->chipset, chips->name) ||
- strcmp(tmp->driver, opts->name)) {
- entry = (CardsEntry*)XtCalloc(1, sizeof(CardsEntry));
- if (NumCardsEntry % 16 == 0) {
- CardsDB = (CardsEntry**)XtRealloc((XtPointer)CardsDB,
- sizeof(CardsEntry*) * (NumCardsEntry + 16));
- }
- CardsDB[NumCardsEntry++] = entry;
- entry->name = XtNewString(name);
-
- /* XXX no private copy of strings */
- entry->chipset = (char*)chips->name;
- entry->driver = opts->name;
-
- /* better than linear searchs to find duplicates */
- qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*),
- CompareCards);
- }
- ++chips;
- }
- }
- opts = opts->next;
- }
-
- /* fix entries with the same name */
- for (i = 0; i < NumCardsEntry - 2;) {
- for (j = i + 1; j < NumCardsEntry - 1 &&
- strcmp(CardsDB[i]->name, CardsDB[j]->name) == 0; j++)
- ;
-
- if (i + 1 != j) {
- while (i < j) {
- char *str;
-
- if (strcmp(CardsDB[i]->chipset, CardsDB[j]->chipset))
- str = CardsDB[i]->chipset;
- else
- str = CardsDB[i]->driver;
-
- XmuSnprintf(name, sizeof(name), "%s (%s)",
- CardsDB[i]->name, str);
- XtFree(CardsDB[i]->name);
- CardsDB[i]->name = XtNewString(name);
-
- ++i;
- }
- }
- else
- ++i;
- }
-
- /* make sure data is valid to bsearch in */
- qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*), CompareCards);
- }
- else
-#endif
- DoReadCardsDatabase();
-}
-
-static void
-DoReadCardsDatabase(void)
-{
- char buffer[256];
- FILE *fp = fopen(Cards, "r");
- int i, result;
- CardsEntry *entry = NULL;
- static char *CardsError = "Error reading Cards database, at line %d (%s).\n";
-
- if (fp == NULL) {
- fprintf(stderr, "Cannot open Cards database.\n");
- exit(1);
- }
-
- while ((result = ReadCardsLine(fp, buffer)) != END) {
- switch (result) {
- case ERROR:
- fprintf(stderr, CardsError, linenum, buffer);
- break;
- case UNKNOWN:
- fprintf(stderr,
- "Unknown field type in Cards database, at line %d (%s).\n",
- linenum, buffer);
- break;
- case NAME:
- entry = calloc(1, sizeof(CardsEntry));
- if (NumCardsEntry % 16 == 0) {
- CardsDB = realloc(CardsDB, sizeof(CardsEntry*) *
- (NumCardsEntry + 16));
- if (CardsDB == NULL) {
- fprintf(stderr, "Out of memory reading Cards database.\n");
- exit(1);
- }
- }
- CardsDB[NumCardsEntry++] = entry;
- entry->name = strdup(buffer);
- break;
- case CHIPSET:
- if (entry == NULL || entry->chipset != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
-#if 0
- else
- entry->chipset = strdup(buffer);
-#endif
- break;
- case SERVER:
- if (entry == NULL || entry->server != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->server = strdup(buffer);
- break;
- case DRIVER:
- if (entry == NULL || entry->driver != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->driver = strdup(buffer);
- break;
- case RAMDAC:
- if (entry == NULL || entry->ramdac != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->ramdac = strdup(buffer);
- break;
- case CLOCKCHIP:
- if (entry == NULL || entry->clockchip != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->clockchip = strdup(buffer);
- break;
- case DACSPEED:
- if (entry == NULL || entry->dacspeed != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->dacspeed = strdup(buffer);
- break;
- case NOCLOCKPROBE:
- if (entry == NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->flags |= F_NOCLOCKPROBE;
- break;
- case UNSUPPORTED:
- if (entry == NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->flags |= F_UNSUPPORTED;
- break;
- case SEE:
- if (entry == NULL || entry->see != NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else
- entry->see = strdup(buffer);
- break;
- case LINE:
- if (entry == NULL) {
- fprintf(stderr, CardsError, linenum, buffer);
- }
- else if (entry->lines == NULL)
- entry->lines = strdup(buffer);
- else {
- char *str = malloc(strlen(entry->lines) + strlen(buffer) + 2);
-
- sprintf(str, "%s\n%s", entry->lines, buffer);
- free(entry->lines);
- entry->lines = str;
- }
- break;
- }
- }
-
- fclose(fp);
-
- qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*), CompareCards);
-
-#ifdef DEBUG
- for (i = 0; i < NumCardsEntry - 1; i++) {
- if (strcmp(CardsDB[i]->name, CardsDB[i+1]->name) == 0)
- fprintf(stderr, "Duplicate entry in Cards database: (%s).\n",
- CardsDB[i]->name);
- }
-#endif
-
- for (i = 0; i < NumCardsEntry - 1; i++) {
- if (CardsDB[i]->see != NULL) {
- if ((entry = LookupCard(CardsDB[i]->see)) == NULL) {
- fprintf(stderr, "Cannot find card '%s' for filling defaults.\n",
- CardsDB[i]->see);
- continue;
- }
- if (CardsDB[i]->chipset == NULL && entry->chipset != NULL)
- CardsDB[i]->chipset = strdup(entry->chipset);
- if (CardsDB[i]->server == NULL && entry->server != NULL)
- CardsDB[i]->server = strdup(entry->server);
- if (CardsDB[i]->driver == NULL && entry->driver != NULL)
- CardsDB[i]->driver = strdup(entry->driver);
- if (CardsDB[i]->ramdac == NULL && entry->ramdac != NULL)
- CardsDB[i]->ramdac = strdup(entry->ramdac);
- if (CardsDB[i]->clockchip == NULL && entry->clockchip != NULL)
- CardsDB[i]->clockchip = strdup(entry->clockchip);
- if (CardsDB[i]->dacspeed == NULL && entry->dacspeed != NULL)
- CardsDB[i]->dacspeed = strdup(entry->dacspeed);
- if (CardsDB[i]->flags & F_NOCLOCKPROBE)
- CardsDB[i]->flags |= F_NOCLOCKPROBE;
- if (CardsDB[i]->flags & F_UNSUPPORTED)
- CardsDB[i]->flags |= F_UNSUPPORTED;
- if (entry->lines != NULL) {
- if (CardsDB[i]->lines == NULL)
- CardsDB[i]->lines = strdup(entry->lines);
- else {
- char *str = malloc(strlen(entry->lines) +
- strlen(CardsDB[i]->lines) + 2);
-
- sprintf(str, "%s\n%s", CardsDB[i]->lines, entry->lines);
- free(CardsDB[i]->lines);
- CardsDB[i]->lines = str;
- }
- }
- if (entry->see != NULL) {
-#ifdef DEBUG
- fprintf(stderr, "Nested SEE entry: %s -> %s -> %s\n",
- CardsDB[i]->name, CardsDB[i]->see, entry->see);
-#endif
- CardsDB[i]->see = strdup(entry->see);
- --i;
- continue;
- }
- free(CardsDB[i]->see);
- CardsDB[i]->see = NULL;
- }
- }
-}
-
-CardsEntry *
-LookupCard(char *name)
-{
- CardsEntry **ptr;
-
- ptr = (CardsEntry**)bsearch(name, CardsDB, NumCardsEntry,
- sizeof(CardsEntry*), BCompareCards);
-
- return (ptr != NULL ? *ptr : NULL);
-}
-
-char **
-GetCardNames(int *result)
-{
- char **cards = NULL;
- int ncards;
-
- for (ncards = 0; ncards < NumCardsEntry; ncards++) {
- if (ncards % 16 == 0) {
- if ((cards = (char**)realloc(cards, sizeof(char*) *
- (ncards + 16))) == NULL) {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- }
- cards[ncards] = strdup(CardsDB[ncards]->name);
- }
-
- *result = ncards;
-
- return (cards);
-}
-
-char **
-FilterCardNames(char *pattern, int *result)
-{
-#ifdef USE_MODULES
- if (!nomodules) {
- char **cards = NULL;
- int i, ncards = 0;
-
- for (i = 0; i < NumCardsEntry; i++) {
- if (strstr(CardsDB[i]->name, pattern) == NULL)
- continue;
- if (ncards % 16 == 0) {
- if ((cards = (char**)realloc(cards, sizeof(char*) *
- (ncards + 16))) == NULL) {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- }
- cards[ncards] = strdup(CardsDB[i]->name);
- ++ncards;
- }
-
- *result = ncards;
-
- return (cards);
- }
-#endif
- return (DoFilterCardNames(pattern, result));
-}
-
-static char **
-DoFilterCardNames(char *pattern, int *result)
-{
- FILE *fp;
- char **cards = NULL;
- int len, ncards = 0;
- char *cmd, *ptr, buffer[256];
-
- cmd = malloc(32 + (strlen(pattern) * 2) + strlen(Cards));
-
- strcpy(cmd, "egrep -i '^NAME\\ .*");
- len = strlen(cmd);
- ptr = pattern;
- while (*ptr) {
- if (!isalnum(*ptr)) {
- cmd[len++] = '\\';
- }
- cmd[len++] = *ptr++;
- }
- cmd[len] = '\0';
- strcat(cmd, ".*$' ");
- strcat(cmd, Cards);
- strcat(cmd, " | sort");
- /*sprintf(cmd, "egrep -i '^NAME\\ .*%s.*$' %s | sort", pattern, Cards);*/
-
- if ((fp = popen(cmd, "r")) == NULL) {
- fprintf(stderr, "Cannot read Cards database.\n");
- exit(1);
- }
- while (fgets(buffer, sizeof(buffer), fp) != NULL) {
- ptr = buffer + strlen(buffer) - 1;
- while (isspace(*ptr) && ptr > buffer)
- --ptr;
- if (!isspace(*ptr) && ptr > buffer)
- ptr[1] = '\0';
- ptr = buffer;
- while (!isspace(*ptr) && *ptr) /* skip NAME */
- ++ptr;
- while (isspace(*ptr) && *ptr)
- ++ptr;
- if (ncards % 16 == 0) {
- if ((cards = (char**)realloc(cards, sizeof(char*) *
- (ncards + 16))) == NULL) {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- }
- cards[ncards++] = strdup(ptr);
- }
- free(cmd);
-
- *result = ncards;
-
- return (cards);
-}
-
-static int
-ReadCardsLine(FILE *fp, char *value)
-{
- char name[32], buffer[256], *ptr, *end;
- int result = NOTUSEFUL;
-
- ++linenum;
-
- if (fgets(buffer, sizeof(buffer), fp) == NULL)
- return (END);
-
- ptr = buffer;
- /* skip initial spaces; should'nt bother about this.. */
- while (isspace(*ptr) && *ptr)
- ++ptr;
-
- if (*ptr == '#' || *ptr == '\0')
- return (NOTUSEFUL);
-
- end = ptr;
- while (!isspace(*end) && *end)
- ++end;
- if (end - ptr > sizeof(buffer) - 1) {
- strncpy(value, buffer, 255);
- value[255] = '\0';
- return (ERROR);
- }
- strncpy(name, ptr, end - ptr);
- name[end - ptr] = '\0';
-
- /* read the optional arguments */
- ptr = end;
- while (isspace(*ptr) && *ptr)
- ++ptr;
-
- end = ptr + strlen(ptr) - 1;
- while (isspace(*end) && end > ptr)
- --end;
- if (!isspace(*end))
- ++end;
- *end = '\0';
-
- if (strcmp(name, "NAME") == 0)
- result = NAME;
- else if (strcmp(name, "CHIPSET") == 0)
- result = CHIPSET;
- else if (strcmp(name, "SERVER") == 0)
- result = SERVER;
- else if (strcmp(name, "DRIVER") == 0)
- result = DRIVER;
- else if (strcmp(name, "RAMDAC") == 0)
- result = RAMDAC;
- else if (strcmp(name, "CLOCKCHIP") == 0)
- result = CLOCKCHIP;
- else if (strcmp(name, "DACSPEED") == 0)
- result = DACSPEED;
- else if (strcmp(name, "NOCLOCKPROBE") == 0)
- result = NOCLOCKPROBE;
- else if (strcmp(name, "UNSUPPORTED") == 0)
- result = UNSUPPORTED;
- else if (strcmp(name, "SEE") == 0)
- result = SEE;
- else if (strcmp(name, "LINE") == 0)
- result = LINE;
- else if (strcmp(name, "END") == 0)
- result = END;
- else {
- strcpy(value, name);
- return (UNKNOWN);
- }
-
- /* value *must* have at least 256 bytes */
- strcpy(value, ptr);
-
- return (result);
-}
-
-static int
-CompareCards(_Xconst void *left, _Xconst void *right)
-{
- return strcasecmp((*(CardsEntry**)left)->name, (*(CardsEntry**)right)->name);
-}
-
-static int
-BCompareCards(_Xconst void *name, _Xconst void *card)
-{
- return (strcasecmp((char*)name, (*(CardsEntry**)card)->name));
-}
diff --git a/hw/xfree86/utils/xorgcfg/cards.h b/hw/xfree86/utils/xorgcfg/cards.h
deleted file mode 100644
index 0e5ee328f..000000000
--- a/hw/xfree86/utils/xorgcfg/cards.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/cards.h,v 1.3 2002/07/15 20:46:04 dawes Exp $
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <X11/Xfuncproto.h>
-#include <X11/Xmd.h>
-#include <X11/Intrinsic.h>
-#include <X11/Xmu/SysUtil.h>
-
-#ifndef _xf86cfg_cards_h
-#define _xf86cfg_cards_h
-
-#ifdef USE_MODULES
-#ifdef CARDS_PRIVATE
-#include "loader.h"
-
-#include "xf86PciStr.h"
-#include "xf86PciIds.h"
-#endif /* CARDS_PRIVATE */
-#endif /* USE_MODULES */
-
-/* Flags in CardsEntry */
-#define F_NOCLOCKPROBE 0x1 /* Never probe clocks of the card. */
-#define F_UNSUPPORTED 0x2 /* Card is not supported (only VGA). */
-
-/*
- * Types
- */
-typedef struct {
- char *name; /* Name of the card. */
- char *chipset; /* Chipset (decriptive). */
- char *server; /* Server identifier. */
- char *driver; /* Driver identifier. */
- char *ramdac; /* Ramdac identifier. */
- char *clockchip; /* Clockchip identifier. */
- char *dacspeed; /* DAC speed rating. */
- int flags;
- char *lines; /* Additional Device section lines. */
- char *see; /* Must resolve in a last step.
- * Allow more than one SEE entry? */
-} CardsEntry;
-
-extern CardsEntry **CardsDB;
-extern int NumCardsEntry;
-
-/*
- * Prototypes
- */
-void ReadCardsDatabase(void);
-CardsEntry *LookupCard(char*);
-char **GetCardNames(int*);
-char **FilterCardNames(char*, int*);
-#ifdef USE_MODULES
-void InitializePciInfo(void);
-typedef struct _xf86cfgModuleOptions *xf86cfgModuleOptionsPtr;
-void CheckChipsets(xf86cfgModuleOptionsPtr, int*);
-#endif
-
-#endif /* _xf86cfg_cards_h */
diff --git a/hw/xfree86/utils/xorgcfg/computer.xpm b/hw/xfree86/utils/xorgcfg/computer.xpm
deleted file mode 100644
index 75fc85b26..000000000
--- a/hw/xfree86/utils/xorgcfg/computer.xpm
+++ /dev/null
@@ -1,91 +0,0 @@
-/* XPM */
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/computer.xpm,v 1.1 2000/04/04 22:36:58 dawes Exp $
- */
-static char * computer_xpm[] = {
-"30 50 8 1",
-" c none",
-". c #CF3CCF3CCF3C",
-"X c #B6DABAEAB6DA",
-"o c #8E388E388E38",
-"O c #FFFFFFFFFFFF",
-"+ c #FFFF00000000",
-"@ c #514451445144",
-"# c #0000FFFF0000",
-" ............................ ",
-"..XXXXXXXXXXXXXXXXXXXXXXXXXXXo",
-".XXXXXXXXXXXXXXXXXXXXXXXXXXXXo",
-".XXooooooooooooooooooooooooXXo",
-".XXo.......................XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XX....XXXXXXXXXXXOoXo.XXo",
-".XXo.XXooooXXXXXXXXXXXooXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.......................XXo",
-".XXooooooooooooooooooooooooXXo",
-".XXo.......................XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXooooooooooooooooooooooo.XXo",
-".XXo.......................XXo",
-".XXoooooooooooooo.XXXXXXXo.XXo",
-".XXo..............XXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXX.XX.O.XXo.XXo",
-".XXo.oooooooooooX.XXO+OXXo.XXo",
-".XXo.XXXXXXXXXOOX.XX.O.XXo.XXo",
-".XXo.XXXXXXXXXXXX.XXXXXXXo.XXo",
-".XXo..............XXXXXXXo.XXo",
-".XXooooooooooooooooooooooo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXX@@@@@@@@@XXX...XXo.XXo",
-".XXo.XX@@+@@@@@#@@X.OXXoXo.XXo",
-".XXo.XXX@@@@@@@@@XXXoooXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXX..XXXo.XXo",
-".XXo.XXXXXXXXXXXXXX.OXoXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXooXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
-".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
-".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
-".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
-".XXXo.oXXXoXXXoXXXoXXXoXo.XXXo",
-".XXXXo.XXXXXXXXXXXXXXXXo.XXXXo",
-".XXXXo..oXXXoXXXoXXoXXoo.XXXXo",
-".XXXXXoo..XXXXXXXXXXoo..XXXXXo",
-".XXXXXXXoo......oooo..XXXXXXXo",
-".XXXXXXXXXoooooo....XXXXXXXXXo",
-".XXXXXXXXXXXXXXXXXXXXXXXXXXXXo",
-".XXXXXXXXXXXXXXXXXXXXXXXXXXXoo",
-" oooooooooooooooooooooooooooo "};
diff --git a/hw/xfree86/utils/xorgcfg/config.c b/hw/xfree86/utils/xorgcfg/config.c
deleted file mode 100644
index 8c2da3d9b..000000000
--- a/hw/xfree86/utils/xorgcfg/config.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.9 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include "config.h"
-#include "mouse-cfg.h"
-#include "keyboard-cfg.h"
-#include "card-cfg.h"
-#include "monitor-cfg.h"
-#include "screen-cfg.h"
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Shell.h>
-
-/*
- * Prototypes
- */
-void BackCallback(Widget, XtPointer, XtPointer);
-void NextCallback(Widget, XtPointer, XtPointer);
-void ApplyCallback(Widget, XtPointer, XtPointer);
-void CloseCallback(Widget, XtPointer, XtPointer);
-void ErrorCallback(Widget, XtPointer, XtPointer);
-
-/*
- * Initialization
- */
-XF86SetupFunction mouse_functions[] = {
- MouseDeviceAndProtocol,
-};
-
-XF86SetupFunction keyboard_functions[] = {
- KeyboardModelAndLayout,
-};
-
-XF86SetupFunction card_functions[] = {
- CardModel,
-};
-
-XF86SetupFunction monitor_functions[] = {
- MonitorLayout,
-};
-
-XF86SetupFunction screen_functions[] = {
- ScreenDialog,
-};
-
-XF86SetupFunctionList function_lists[] = {
- {mouse_functions, sizeof(mouse_functions) / sizeof(mouse_functions[0]),},
- {keyboard_functions, sizeof(keyboard_functions) / sizeof(keyboard_functions[0]),},
- {card_functions, sizeof(card_functions) / sizeof(card_functions[0]),},
- {monitor_functions, sizeof(monitor_functions) / sizeof(monitor_functions[0]),},
- {screen_functions, sizeof(screen_functions) / sizeof(screen_functions[0]),},
-};
-
-XF86SetupInfo xf86info = {
- sizeof(function_lists) / sizeof(function_lists[0]),
- MOUSE,
- function_lists,
-};
-
-Widget configp, current, ok, back, next;
-static Widget shell, errcurrent, oldcurrent;
-
-static int config_status, config_popped;
-
-static ConfigCheckFunction config_function;
-
-Widget ident_widget;
-char *ident_string;
-XF86ConfigPtr XF86Config;
-
-/*
- * Implementation
- */
-void
-StartConfig(void)
-{
- static int first = 1;
- Widget pane, top, bottom, cancel;
- const char *filename;
-
- if (!first)
- return;
- first = 0;
-
- /* Read initial configuration */
- if ((filename = xf86openConfigFile(getuid() == 0 ? CONFPATH : USER_CONFPATH,
- XF86Config_path, NULL)) == NULL) {
- int length = XF86Config_path ? strlen(XF86Config_path) : -1;
-
- if (length > 2 &&
- XF86Config_path[length - 2] == '-' &&
- XF86Config_path[length - 1] == '4') {
- XF86Config_path[length - 2] = '\0';
- filename = xf86openConfigFile(getuid() == 0 ?
- CONFPATH : USER_CONFPATH,
- XF86Config_path, NULL);
- }
-
- if (filename == NULL) {
- fprintf(stderr, "Cannot open config file.\n");
- exit(1);
- }
- }
- XF86Config_path = (char *)filename;
- if ((XF86Config = xf86readConfigFile()) == NULL) {
- fprintf(stderr, "Problem when parsing config file\n");
- exit(1);
- }
-
- shell = XtCreatePopupShell("config", transientShellWidgetClass,
- toplevel, NULL, 0);
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
- shell, NULL, 0);
- top = XtCreateManagedWidget("top", formWidgetClass,
- pane, NULL, 0);
- (void) XtCreateManagedWidget("label", labelWidgetClass,
- top, NULL, 0);
- ident_widget = XtVaCreateManagedWidget("identifier", asciiTextWidgetClass,
- top,
- XtNeditType, XawtextEdit,
- NULL, 0);
- configp = XtCreateManagedWidget("work", formWidgetClass,
- pane, NULL, 0);
- current = XtCreateManagedWidget("wellcome", labelWidgetClass,
- configp, NULL, 0);
- bottom = XtCreateManagedWidget("bottom", formWidgetClass,
- pane, NULL, 0);
- back = XtCreateManagedWidget("back", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(back, XtNcallback, BackCallback, (XtPointer)&xf86info);
- next = XtCreateManagedWidget("next", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(next, XtNcallback, NextCallback, (XtPointer)&xf86info);
- ok = XtCreateManagedWidget("ok", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(ok, XtNcallback, ApplyCallback, (XtPointer)NULL);
- cancel = XtCreateManagedWidget("cancel", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(cancel, XtNcallback, CloseCallback, (XtPointer)NULL);
-
- XtRealizeWidget(shell);
-
- XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
-}
-
-/*ARGSUSED*/
-Bool
-ConfigLoop(ConfigCheckFunction config_fn)
-{
- Arg args[1];
- config_popped = True;
- XtPopup(shell, XtGrabExclusive);
-
- config_function = config_fn;
- while (config_popped)
- XtAppProcessEvent(XtWidgetToApplicationContext(shell), XtIMAll);
-
- XtSetArg(args[0], XtNstring, &ident_string);
- XtGetValues(ident_widget, args, 1);
-
- return (config_status);
-}
-
-/*ARGSUSED*/
-void
-ConfigError(void)
-{
- static int first = 1;
-
- if (first) {
- Widget command;
-
- errcurrent = XtCreateWidget("error", formWidgetClass,
- configp, NULL, 0);
- (void) XtCreateManagedWidget("label", labelWidgetClass,
- errcurrent, NULL, 0);
- command = XtCreateManagedWidget("command", commandWidgetClass,
- errcurrent, NULL, 0);
- XtAddCallback(command, XtNcallback, ErrorCallback, NULL);
-
- XtRealizeWidget(errcurrent);
- }
-
- oldcurrent = current;
- XtChangeManagedSet(&current, 1, NULL, NULL, &errcurrent, 1);
- current = errcurrent;
-
- XtSetSensitive(ok, False);
-}
-
-/*ARGSUSED*/
-void
-ErrorCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtChangeManagedSet(&errcurrent, 1, NULL, NULL, &oldcurrent, 1);
- current = oldcurrent;
-
- XtSetSensitive(ok, True);
-}
-
-/*ARGSUSED*/
-void
-BackCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XF86SetupInfo *info = (XF86SetupInfo*)user_data;
- int idx = info->lists[info->cur_list].cur_function - 1;
-
- if (idx >= 0 && info->lists[info->cur_list].num_functions > 0) {
- info->lists[info->cur_list].cur_function = idx;
- if (idx - 1 == -1)
- XtSetSensitive(back, False);
- if (!XtIsSensitive(next))
- XtSetSensitive(next, True);
- (info->lists[info->cur_list].functions[idx])(info);
- }
-}
-
-/*ARGSUSED*/
-void
-NextCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XF86SetupInfo *info = (XF86SetupInfo*)user_data;
- int idx = info->lists[info->cur_list].cur_function + 1;
-
- if (idx < info->lists[info->cur_list].num_functions) {
- info->lists[info->cur_list].cur_function = idx;
- if (idx + 1 == info->lists[info->cur_list].num_functions)
- XtSetSensitive(next, False);
- if (!XtIsSensitive(back))
- XtSetSensitive(back, True);
- (info->lists[info->cur_list].functions[idx])(info);
- }
-}
-
-/*ARGSUSED*/
-void
-CloseCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtPopdown(shell);
- config_popped = False;
- config_status = False;
- /* make sure it is sensitive */
- XtSetSensitive(ok, True);
- xf86info.lists[xf86info.cur_list].cur_function = 0;
-}
-
-/*ARGSUSED*/
-void
-ApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, &ident_string);
- XtGetValues(ident_widget, args, 1);
-
- if (config_function == NULL || (*config_function)()) {
- XtPopdown(shell);
- config_popped = False;
- config_status = True;
- xf86info.lists[xf86info.cur_list].cur_function = 0;
- }
- else
- ConfigError();
-}
-
-/*ARGSUSED*/
-void
-ConfigCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- CloseCallback(w, NULL, NULL);
-}
diff --git a/hw/xfree86/utils/xorgcfg/config.h b/hw/xfree86/utils/xorgcfg/config.h
deleted file mode 100644
index 6d1193a3d..000000000
--- a/hw/xfree86/utils/xorgcfg/config.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.17 2003/06/10 17:03:55 dawes Exp $
- */
-
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <X11/Xmu/SysUtil.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <dirent.h>
-#include <string.h>
-#include <unistd.h>
-#if defined(sun) && defined(SVR4)
-#include <strings.h>
-#endif
-
-#include <stdarg.h>
-
-#ifdef __UNIXOS2__
-#define strcasecmp stricmp
-#define setenv putenv
-#define PATH_MAX 260
-#endif
-
-/* Get PATH_MAX */
-#ifndef PATH_MAX
-# if defined(_POSIX_SOURCE)
-# include <limits.h>
-# else
-# define _POSIX_SOURCE
-# include <limits.h>
-# undef _POSIX_SOURCE
-# endif
-# ifndef PATH_MAX
-# ifdef MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
-# endif
-#endif
-
-#include <xf86Parser.h>
-#include <X11/XKBlib.h>
-#include <X11/extensions/XKBgeom.h>
-#include <X11/extensions/XKM.h>
-#include <X11/extensions/XKBfile.h>
-#include <X11/extensions/XKBui.h>
-#include <X11/extensions/XKBrules.h>
-
-#ifndef _xf86cfg_config_h
-#define _xf86cfg_config_h
-
-/* Must match the offset in the xf86info structure at config.c,
- * and is used also by interface.c
- */
-#define MOUSE 0
-#define KEYBOARD 1
-#define CARD 2
-#define MONITOR 3
-#define SCREEN 4
-#define SERVER 5
-
-#define UNUSED 0
-#define USED 1
-
-#define CONFIG_LAYOUT 0
-#define CONFIG_SCREEN 1
-#define CONFIG_MODELINE 2
-#define CONFIG_ACCESSX 3
-extern int config_mode;
-
-#ifndef __UNIXOS2__
-#define CONFPATH "%A," "%R," \
- "/etc/X11/%R," "%P/etc/X11/%R," \
- "%E," "%F," \
- "/etc/X11/%F," "%P/etc/X11/%F," \
- "%D/%X," \
- "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#define USER_CONFPATH "/etc/X11/%S," "%P/etc/X11/%S," \
- "/etc/X11/%G," "%P/etc/X11/%G," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#else
-#define CONFPATH "%&"XF86CONFIGDIR"/%R," "%&"XF86CONFIGDIR"/%X," \
- "%A," "%R," \
- "/etc/X11/%R," "%P/etc/X11/%R," \
- "%E," "%F," \
- "/etc/X11/%F," "%P/etc/X11/%F," \
- "%D/%X," \
- "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#define USER_CONFPATH "%&"XF86CONFIGDIR"/%X," "%&"XF86CONFIGDIR"/%X," \
- "/etc/X11/%S," "%P/etc/X11/%S," \
- "/etc/X11/%G," "%P/etc/X11/%G," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#endif
-
-/*
- * Types
- */
-typedef struct _XF86SetupInfo XF86SetupInfo;
-typedef void (*XF86SetupFunction)(XF86SetupInfo*);
-
-typedef struct _XF86SetupFunctionList {
- XF86SetupFunction *functions;
- int num_functions;
- int cur_function;
-} XF86SetupFunctionList;
-
-struct _XF86SetupInfo {
- int num_lists;
- int cur_list;
- XF86SetupFunctionList *lists;
-};
-
-typedef Bool (*ConfigCheckFunction)(void);
-
-typedef struct _xf86cfgDevice xf86cfgDevice;
-
-struct _xf86cfgDevice {
- XtPointer config;
- Widget widget;
- int type, state, refcount;
-};
-
-typedef struct {
- XF86ConfScreenPtr screen;
- Widget widget;
- int type, state, refcount;
- xf86cfgDevice *card;
- xf86cfgDevice *monitor;
- short row, column;
- XRectangle rect;
- short rotate;
-} xf86cfgScreen;
-
-/* this structure is used just to restore
- properly the monitors layout in the
- screen window configuration.
- */
-typedef struct {
- XF86ConfLayoutPtr layout;
- xf86cfgScreen **screen;
- XPoint *position;
- int num_layouts;
-} xf86cfgLayout;
-
-/* The vidmode extension usage is controlled by this structure.
- * The information is read at startup, and added monitors cannot
- * be configured, since they are not attached to a particular screen.
- */
-typedef struct _xf86cfgVidMode xf86cfgVidmode;
-
-typedef struct {
- XF86ConfLayoutPtr layout; /* current layout */
- Widget cpu;
- xf86cfgLayout **layouts;
- Cardinal num_layouts;
- xf86cfgScreen **screens;
- Cardinal num_screens;
- xf86cfgDevice **devices;
- Cardinal num_devices;
- xf86cfgVidmode **vidmodes;
- Cardinal num_vidmodes;
-} xf86cfgComputer;
-
-/*
- * Prototypes
- */
-void StartConfig(void);
-Bool ConfigLoop(ConfigCheckFunction);
-void ConfigError(void);
-void ChangeScreen(XF86ConfMonitorPtr, XF86ConfMonitorPtr,
- XF86ConfDevicePtr, XF86ConfDevicePtr);
-void SetTip(xf86cfgDevice*);
-Bool startx(void);
-void endx(void);
-void startaccessx(void);
-void ConfigCancelAction(Widget, XEvent*, String*, Cardinal*);
-void ExpertConfigureStart(void);
-void ExpertConfigureEnd(void);
-void ExpertCloseAction(Widget, XEvent*, String*, Cardinal*);
-void ExpertCallback(Widget, XtPointer, XtPointer);
-
-/*
- * Initialization
- */
-extern Widget toplevel, configp, current, back, next;
-extern XtAppContext appcon;
-extern XF86SetupInfo xf86info;
-extern Widget ident_widget;
-extern char *ident_string;
-extern XF86ConfigPtr XF86Config;
-extern char *XF86Config_path;
-extern char *XF86Module_path;
-extern char *XFree86_path;
-extern char *XF86Font_path;
-extern char *XF86RGB_path;
-extern char *XFree86Dir;
-extern xf86cfgComputer computer;
-extern Atom wm_delete_window;
-extern Display *DPY;
-extern Pixmap menuPixmap;
-#ifdef USE_MODULES
-extern int nomodules;
-#endif
-
-#endif /* _xf86cfg_config_h */
diff --git a/hw/xfree86/utils/xorgcfg/down.xbm b/hw/xfree86/utils/xorgcfg/down.xbm
deleted file mode 100644
index 742adf202..000000000
--- a/hw/xfree86/utils/xorgcfg/down.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define down_width 19
-#define down_height 19
-static unsigned char down_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00,
- 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00,
- 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00,
- 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c
deleted file mode 100644
index a3dfcbe2d..000000000
--- a/hw/xfree86/utils/xorgcfg/expert.c
+++ /dev/null
@@ -1,4858 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.15 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include "config.h"
-#include "xf86config.h"
-#include "options.h"
-#include "screen.h"
-#include "vidmode.h"
-#include "monitor-cfg.h"
-#include <X11/Shell.h>
-#include <X11/CompositeP.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Box.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/Panner.h>
-#include <X11/Xaw/Porthole.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/Toggle.h>
-#include <X11/Xaw/Tree.h>
-#include <ctype.h>
-
-/*
- * Types
- */
-typedef struct _TreeNode TreeNode;
-typedef union _TreeData TreeData;
-typedef void (*NodeDeleteFunc)(TreeNode*);
-typedef void (*NodeUpdateFunc)(TreeNode*);
-
-union _TreeData {
- struct {
- Widget text;
- } files;
- struct {
- Widget text;
- XF86LoadPtr load;
- } module;
- struct {
- Widget text;
- XF86ConfModesPtr modes;
- } modes;
- struct {
- Widget text, value;
- XF86ConfModeLinePtr modeline;
- } modeline;
- struct {
- Widget text, vendor, board, busid, driver;
- XF86ConfVideoAdaptorPtr video;
- } video;
- struct {
- Widget text;
- XF86ConfVideoPortPtr port;
- } port;
- struct {
- Widget text, vendor, model, width, height, hsync, vrefresh,
- gammaRed, gammaGreen, gammaBlue;
- XF86ConfMonitorPtr monitor;
- } monitor;
- struct {
- Widget menu;
- XF86ConfModesLinkPtr modeslink;
- } modeslink;
- struct {
- Widget text, vendor, board, chipset, busid, card, driver, ramdac,
- dacSpeed, videoRam, textClockFreq, biosBase, memBase, ioBase,
- clockChip, devClock, chipId, chipRev, irq, screen;
- XF86ConfDevicePtr device;
- } device;
- struct {
- Widget text, defaultDepth, defaultBpp, defaultFbBpp,
- monitor, device;
- XF86ConfScreenPtr screen;
- } screen;
- struct {
- Widget menu;
- XF86ConfAdaptorLinkPtr adaptorlink;
- } adaptorlink;
- struct {
- Widget viewport, c_virtual, depth, bpp, visual, weight, black, white;
- XF86ConfDisplayPtr display;
- } display;
- struct {
- Widget text;
- XF86ModePtr mode;
- } mode;
- struct {
- Widget text;
- XF86ConfInputPtr input;
- } input;
- struct {
- Widget text;
- XF86ConfLayoutPtr layout;
- } layout;
- struct {
- Widget menu, button, scrnum, adjx, adjy;
- XF86ConfScreenPtr screen;
- XF86ConfAdjacencyPtr adjacency;
- } adjacency;
- struct {
- Widget menu;
- XF86ConfInputrefPtr inputref;
- } inputref;
- struct {
- Widget text;
- XF86ConfVendorPtr vendor;
- } vendor;
- struct {
- Widget text;
- XF86ConfVendSubPtr vendsub;
- } vendsub;
- struct {
- Widget name, group, mode;
- XF86ConfDRIPtr dri;
- } dri;
- struct {
- Widget count, size, flags;
- XF86ConfBuffersPtr buffers;
- } buffers;
-};
-
-struct _TreeNode {
- Widget node, toggle, treeParent;
- TreeNode *parent, *child, *next;
- TreeData *data;
- NodeDeleteFunc destroy;
- NodeUpdateFunc update;
-};
-
-/*
- * Prototypes
- */
-static Bool ExpertInitialize(void);
-static TreeNode *NewNode(TreeNode*, Widget, Widget, Widget, TreeData*);
-static void DeleteNode(TreeNode*);
-static void DestroyCallback(Widget, XtPointer, XtPointer);
-static void PannerCallback(Widget, XtPointer, XtPointer);
-static void PortholeCallback(Widget, XtPointer, XtPointer);
-static void ToggleCallback(Widget, XtPointer, XtPointer);
-static void ToggleNode(TreeNode*, Bool);
-static void ToggleNodeRecursive(TreeNode*);
-static void OptionsCallback(Widget, XtPointer, XtPointer);
-static void RelayoutTree(void);
-static void PopdownCallback(Widget, XtPointer, XtPointer);
-static void UpdateConfig(TreeNode*);
-static void DestroyTree(TreeNode*);
-
-static void CreateFiles(TreeNode*);
-static void CreateFilesField(TreeNode*, char*, char*);
-static void UpdateFiles(TreeNode*);
-
-static void CreateFontPath(TreeNode*, char*);
-static Widget CreateFontPathField(TreeNode*, char*, Bool);
-static void FontPathChanged(TreeNode*);
-static void NewFontPathCallback(Widget, XtPointer, XtPointer);
-static void FontPathCallback(Widget, XtPointer, XtPointer);
-
-static void CreateModulePath(TreeNode*, char*);
-static Widget CreateModulePathField(TreeNode*, char*, Bool);
-static void ModulePathChanged(TreeNode*);
-static void NewModulePathCallback(Widget, XtPointer, XtPointer);
-
-static void CreateModule(TreeNode*, XF86LoadPtr);
-static void CreateModuleField(TreeNode*, Bool);
-static void ModuleDestroy(TreeNode*);
-static void NewModuleCallback(Widget, XtPointer, XtPointer);
-
-static void CreateModes(TreeNode*, XF86ConfModesPtr);
-static void CreateModesField(TreeNode*, Bool);
-static void ModesDestroy(TreeNode*);
-static void NewModesCallback(Widget, XtPointer, XtPointer);
-static void CreateModesModeLine(TreeNode*, XF86ConfModeLinePtr);
-static void ModesModeLineDestroy(TreeNode*);
-static void NewModesModeLineCallback(Widget, XtPointer, XtPointer);
-
-static void CreateModeLineField(TreeNode*, Bool, Bool);
-static XF86ConfModeLinePtr ParseModeLine(char*, char*);
-
-static void CreateVideoAdaptor(TreeNode*, XF86ConfVideoAdaptorPtr);
-static void CreateVideoAdaptorField(TreeNode*, Bool);
-static void VideoAdaptorDestroy(TreeNode*);
-static void NewVideoAdaptorCallback(Widget, XtPointer, XtPointer);
-static void VideoAdaptorUpdate(TreeNode*);
-static void CreateVideoPort(TreeNode*, XF86ConfVideoPortPtr);
-static void CreateVideoPortField(TreeNode*, Bool);
-static void VideoPortDestroy(TreeNode*);
-static void NewVideoPortCallback(Widget, XtPointer, XtPointer);
-
-static void CreateMonitor(TreeNode*, XF86ConfMonitorPtr);
-static void CreateMonitorField(TreeNode*, Bool);
-static void MonitorDestroy(TreeNode*);
-static void NewMonitorCallback(Widget, XtPointer, XtPointer);
-static void MonitorUpdate(TreeNode*);
-static void CreateMonitorModeLine(TreeNode*, XF86ConfModeLinePtr);
-static void MonitorModeLineDestroy(TreeNode*);
-static void NewMonitorModeLineCallback(Widget, XtPointer, XtPointer);
-static void CreateMonitorModes(TreeNode*, XF86ConfModesLinkPtr);
-static void CreateMonitorModesField(TreeNode*, Bool);
-static void MonitorModesLinkDestroy(TreeNode*);
-static void NewMonitorModesCallback(Widget, XtPointer, XtPointer);
-
-static void CreateDevice(TreeNode*, XF86ConfDevicePtr);
-static void CreateDeviceField(TreeNode*, Bool);
-static void NewDeviceCallback(Widget, XtPointer, XtPointer);
-static void DeviceDestroy(TreeNode*);
-static void DeviceUpdate(TreeNode*);
-
-static void CreateScreen(TreeNode*, XF86ConfScreenPtr);
-static void CreateScreenField(TreeNode*, Bool);
-static void NewScreenCallback(Widget, XtPointer, XtPointer);
-static void ScreenDestroy(TreeNode*);
-static void ScreenUpdate(TreeNode*);
-static void CreateScreenAdaptor(TreeNode*, XF86ConfAdaptorLinkPtr);
-static void CreateScreenAdaptorField(TreeNode*, Bool);
-static void NewScreenAdaptorCallback(Widget, XtPointer, XtPointer);
-static void ScreenAdaptorDestroy(TreeNode*);
-static void CreateScreenDisplay(TreeNode*, XF86ConfDisplayPtr);
-static void CreateScreenDisplayField(TreeNode*, Bool);
-static void NewScreenDisplayCallback(Widget, XtPointer, XtPointer);
-static void ScreenDisplayDestroy(TreeNode*);
-static void ScreenDisplayUpdate(TreeNode*);
-static void CreateDisplayMode(TreeNode*, XF86ModePtr);
-static void CreateDisplayModeField(TreeNode*, Bool);
-static void NewDisplayModeCallback(Widget, XtPointer, XtPointer);
-static void DisplayModeDestroy(TreeNode*);
-
-static void CreateInput(TreeNode*, XF86ConfInputPtr);
-static void CreateInputField(TreeNode*, Bool);
-static void InputDestroy(TreeNode*);
-static void NewInputCallback(Widget, XtPointer, XtPointer);
-static void InputUpdate(TreeNode*);
-
-static void CreateLayout(TreeNode*, XF86ConfLayoutPtr);
-static void CreateLayoutField(TreeNode*, Bool);
-static void LayoutDestroy(TreeNode*);
-static void NewLayoutCallback(Widget, XtPointer, XtPointer);
-static void CreateAdjacency(TreeNode*, XF86ConfAdjacencyPtr);
-static void CreateAdjacencyField(TreeNode*, Bool);
-static void AdjacencyDestroy(TreeNode*);
-static void NewAdjacencyCallback(Widget, XtPointer, XtPointer);
-static void AdjacencyMenuCallback(Widget, XtPointer, XtPointer);
-static void AdjacencyToggleCallback(Widget, XtPointer, XtPointer);
-static void CreateInputref(TreeNode*, XF86ConfInputrefPtr);
-static void CreateInputrefField(TreeNode*, Bool);
-static void InputrefDestroy(TreeNode*);
-static void NewInputrefCallback(Widget, XtPointer, XtPointer);
-
-static void CreateVendor(TreeNode*, XF86ConfVendorPtr);
-static void CreateVendorField(TreeNode*, Bool);
-static void VendorDestroy(TreeNode*);
-static void NewVendorCallback(Widget, XtPointer, XtPointer);
-static void CreateVendorSub(TreeNode*, XF86ConfVendSubPtr);
-static void CreateVendorSubField(TreeNode*, Bool);
-static void NewVendorSubCallback(Widget, XtPointer, XtPointer);
-static void VendorSubDestroy(TreeNode*);
-static void VendorSubUpdate(TreeNode*);
-
-static void CreateDRI(TreeNode*, XF86ConfDRIPtr);
-static void CreateDRIField(TreeNode*);
-static void DRIUpdate(TreeNode*);
-
-static void CreateBuffers(TreeNode*, XF86ConfBuffersPtr);
-static void CreateBuffersField(TreeNode*, Bool);
-static void BuffersDestroy(TreeNode*);
-static void NewBuffersCallback(Widget, XtPointer, XtPointer);
-static void BuffersUpdate(TreeNode*);
-
-extern void RemoveDeviceCallback(Widget, XtPointer, XtPointer);
-
-/* interface.c */
-extern void InitializeDevices(void);
-extern void SelectLayoutCallback(Widget, XtPointer, XtPointer);
-extern void UpdateMenuDeviceList(int);
-extern void SetConfigModeCallback(Widget, XtPointer, XtPointer);
-extern void DefaultLayoutCallback(Widget, XtPointer, XtPointer);
-extern void RemoveLayoutCallback(Widget, XtPointer, XtPointer);
-
-/*
- * Initialization
- */
-static Widget shell, expert, tree, panner;
-extern Widget work, optionsShell, config, layoutp, topMenu;
-extern xf86cfgDevice cpu_device;
-static TreeNode *mainNode, *monitorTree, *screenTree, *layoutTree;
-
-/*
- * Implementation
- */
-void
-ExpertConfigureStart(void)
-{
- ExpertInitialize();
-
- XtPopup(shell, XtGrabExclusive);
- if (optionsShell == NULL)
- CreateOptionsShell();
- XtVaSetValues(optionsShell, XtNtransientFor, shell, NULL, 0);
-}
-
-void
-ExpertConfigureEnd(void)
-{
- int i, save_config_mode = config_mode;
- Widget sme, layopt, layoutsme = NULL;
- XF86ConfLayoutPtr lay;
-
- XtVaSetValues(optionsShell, XtNtransientFor, toplevel, NULL, 0);
- XtPopdown(shell);
-
- /* Need to do this to avoid all code elsewhere needing to update the
- * "expert" widget tree
- */
- UpdateConfig(mainNode);
- DestroyTree(mainNode);
- XtDestroyWidget(shell);
- expert = NULL;
-
- if (save_config_mode != CONFIG_LAYOUT)
- SetConfigModeCallback(topMenu, (XtPointer)CONFIG_LAYOUT, NULL);
-
- /* Reset everything as the "expert" interface can do almost anything
- * to the configuration.
- */
- for (i = 0; i < computer.num_screens; i++) {
- XtDestroyWidget(computer.screens[i]->widget);
- XtFree((XtPointer)computer.screens[i]);
- }
- XtFree((XtPointer)computer.screens);
- computer.screens = NULL;
- computer.num_screens = 0;
-
- for (i = 0; i < computer.num_devices; i++) {
- XtDestroyWidget(computer.devices[i]->widget);
- XtFree((XtPointer)computer.devices[i]);
- }
- XtFree((XtPointer)computer.devices);
- computer.devices = NULL;
- computer.num_devices = 0;
-
- for (i = 0; i < computer.num_layouts; i++) {
- XtFree((XtPointer)computer.layouts[i]->position);
- XtFree((XtPointer)computer.layouts[i]);
- }
- XtFree((XtPointer)computer.layouts);
- computer.layouts = NULL;
- computer.num_layouts = 0;
-
- for (i = 0; i < computer.num_vidmodes; i++)
- XtFree((XtPointer)computer.vidmodes[i]);
- XtFree((XtPointer)computer.vidmodes);
- computer.vidmodes = NULL;
- computer.num_vidmodes = 0;
-
- /* Reinitialize devices/screens */
- InitializeDevices();
- UpdateMenuDeviceList(MOUSE);
- UpdateMenuDeviceList(KEYBOARD);
- UpdateMenuDeviceList(CARD);
- UpdateMenuDeviceList(MONITOR);
-
- /* Update layout menu */
- /* first entry is "New server layout" */
- for (i = 1; i < ((CompositeWidget)layoutp)->composite.num_children; i++)
- XtDestroyWidget(((CompositeWidget)layoutp)->composite.children[i]);
- for (i = 0; i < layoutp->core.num_popups; i++)
- XtDestroyWidget(layoutp->core.popup_list[i]);
- lay = XF86Config->conf_layout_lst;
- while (lay != NULL) {
- sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
- layoutp,
- XtNlabel, lay->lay_identifier,
- XtNmenuName, lay->lay_identifier,
- XtNleftBitmap, menuPixmap,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
- if (layoutsme == NULL)
- layoutsme = sme;
- layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
- layoutp, NULL, 0);
- sme = XtCreateManagedWidget("default", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
- sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
- XtRealizeWidget(layopt);
-
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
- computer.layout = NULL;
- SelectLayoutCallback(layoutsme,
- XF86Config->conf_layout_lst, NULL);
-
-
- if (XF86Config->conf_flags && XF86Config->conf_flags->flg_option_lst)
- SetTip(&cpu_device);
- for (i = 0; i < computer.num_devices; i++)
- SetTip(computer.devices[i]);
-
- /* Reinitialize vidmodes */
- InitializeVidmodes();
-
- if (save_config_mode != CONFIG_LAYOUT)
- SetConfigModeCallback(topMenu, (XtPointer)(long)save_config_mode, NULL);
-}
-
-/*ARGSUSED*/
-void
-ExpertCloseAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- ExpertConfigureEnd();
-}
-
-/*ARGSUSED*/
-void
-ExpertCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- ExpertConfigureStart();
-}
-
-/*ARGSUSED*/
-static void
-PopdownCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- ExpertConfigureEnd();
-}
-
-/* Files */
-static void
-CreateFiles(TreeNode *files)
-{
- XF86ConfFilesPtr file = XF86Config->conf_files;
- TreeNode *node, *fontpath, *modulepath;
- Widget w;
- char *value;
-
- value = file->file_logfile ? file->file_logfile : "";
- node = NewNode(files, NULL, NULL, files->node,
- (TreeData*)XtCalloc(1, sizeof(TreeData)));
- CreateFilesField(node, "LogFile", value);
- files->child = node;
- files->update = UpdateFiles;
-
- if (XF86RGB_path)
- value = XF86RGB_path;
- else
- value = file->file_rgbpath ? file->file_rgbpath : "";
- node->next = NewNode(files, NULL, NULL, files->node,
- (TreeData*)XtCalloc(1, sizeof(TreeData)));
- node = node->next;
- CreateFilesField(node, "RgbPath", value);
-
- w = XtVaCreateManagedWidget("ModulePath", toggleWidgetClass, tree,
- XtNtreeParent, files->node, NULL, 0);
- node->next = modulepath = NewNode(files, w, w, files->node, NULL);
- node = node->next;
- CreateModulePath(modulepath, NULL);
-
- w = XtVaCreateManagedWidget("FontPath", toggleWidgetClass, tree,
- XtNtreeParent, files->node, NULL, 0);
- node->next = fontpath = NewNode(files, w, w, files->node, NULL);
- node = node->next;
- CreateFontPath(fontpath, NULL);
-}
-
-static void
-CreateFilesField(TreeNode *node, char *name, char *value)
-{
- Widget box, text;
-
- box = XtVaCreateManagedWidget(name, boxWidgetClass, tree,
- XtNtreeParent, node->node, NULL, 0);
- node->node = box;
- (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, name, NULL, 0);
- text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring, value,
- NULL, 0);
- node->data->files.text = text;
-}
-
-static void
-UpdateFiles(TreeNode *files)
-{
- char *str;
-
- /* LogFile */
- files = files->child;
- XtVaGetValues(files->data->files.text, XtNstring, &str, NULL, 0);
- XtFree(XF86Config->conf_files->file_logfile);
- if (*str)
- XF86Config->conf_files->file_logfile = XtNewString(str);
- else
- XF86Config->conf_files->file_logfile = NULL;
-
- /* LogFile */
- files = files->next;
- XtVaGetValues(files->data->files.text, XtNstring, &str, NULL, 0);
- XtFree(XF86Config->conf_files->file_rgbpath);
- if (*str)
- XF86Config->conf_files->file_rgbpath = XtNewString(str);
- else
- XF86Config->conf_files->file_rgbpath = NULL;
-}
-
-/* FontPath */
-/* Don't need to set the update tree field, as it is already set
- * as the destroy field */
-static void
-CreateFontPath(TreeNode *fontpath, char *path)
-{
- TreeNode *prev = NULL, *node;
-
- if (path == NULL) {
- if (XF86Font_path) {
- path = XtNewString(XF86Font_path);
- if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath) {
- XtFree(XF86Config->conf_files->file_fontpath);
- XF86Config->conf_files->file_fontpath = XtNewString(path);
- }
- }
- else if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath)
- path = XtNewString(XF86Config->conf_files->file_fontpath);
- }
- else {
- path = XtNewString(path);
- if ((prev = fontpath->child) != NULL)
- while (prev->next)
- prev = prev->next;
- }
-
- if (path) {
- char *s;
-
- for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) {
- node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL);
- node->destroy = FontPathChanged;
- (void) CreateFontPathField(node, s, False);
- if (fontpath->child == NULL)
- fontpath->child = node;
- else
- prev->next = node;
- prev = node;
- }
- XtFree(path);
- }
-
- node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL);
- (void) CreateFontPathField(node, "", True);
- if (fontpath->child == NULL)
- fontpath->child = node;
- else
- prev->next = node;
-}
-
-static Widget
-CreateFontPathField(TreeNode *fontpath, char *value, Bool addnew)
-{
- Widget box, command, text;
- TreeData *data;
-
- box = XtVaCreateWidget("fontpath", formWidgetClass, tree,
- XtNtreeParent, fontpath->treeParent, NULL, 0);
- fontpath->node = box;
- if (!addnew) {
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback,
- (XtPointer)fontpath);
- command = XtCreateManagedWidget("up", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, FontPathCallback,
- (XtPointer)fontpath);
- command = XtCreateManagedWidget("down", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, FontPathCallback,
- (XtPointer)fontpath);
- text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, value, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, NewFontPathCallback,
- (XtPointer)fontpath);
- text = XtVaCreateManagedWidget("valueNew", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, value, NULL, 0);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->files.text = text;
- fontpath->data = data;
-
- if (fontpath->treeParent && XtIsRealized(fontpath->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-
- return (box);
-}
-
-static void
-FontPathChanged(TreeNode *node)
-{
- TreeNode *parent = node->parent;
- char *fontpath = NULL, *str;
- Arg args[1];
- int pos = 0, len;
-
- /* last node is the "new" */
- for (node = parent->child; node->next != NULL; node = node->next) {
- if (pos)
- fontpath[pos++] = ',';
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(node->data->files.text, args, 1);
- len = strlen(str) + 2;
- fontpath = XtRealloc(fontpath, pos + len);
- strcpy(fontpath + pos, str);
- pos += len - 2;
- }
-
- if (XF86Config->conf_files->file_fontpath)
- XtFree(XF86Config->conf_files->file_fontpath);
- XF86Config->conf_files->file_fontpath = fontpath;
-}
-
-static void
-NewFontPathCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *fontpath, *node = (TreeNode*)user_data;
- Arg args[1];
- char *str;
-
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(node->data->files.text, args, 1);
- if (*str == '\0')
- return;
-
- fontpath = node->parent;
- DeleteNode(node);
- CreateFontPath(fontpath, str);
-
- FontPathChanged(fontpath->child);
- RelayoutTree();
-}
-
-/*ARGSUSED*/
-static void
-FontPathCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node, *fontpath = (TreeNode*)user_data;
- char *t1, *t2;
- Widget w1, w2;
-
- parent = fontpath->parent;
- node = parent->child;
- if (!node->next->next)
- return;
- if (strcmp(XtName(w), "up") == 0) {
- if (node == fontpath)
- while (node->next->next)
- node = node->next;
- else
- while (node && node->next != fontpath)
- node = node->next;
- }
- else {
- if (fontpath->next->next)
- node = fontpath->next;
- /* else is already correct */
- }
-
- w1 = node->data->files.text;
- w2 = fontpath->data->files.text;
-
- XtVaGetValues(w1, XtNstring, &t1, NULL);
- XtVaGetValues(w2, XtNstring, &t2, NULL);
- t1 = XtNewString(t1);
- XtVaSetValues(w1, XtNstring, t2, NULL);
- XtVaSetValues(w2, XtNstring, t1, NULL);
- XtFree(t1);
-}
-
-
-/* ModulePath */
-/* Don't need to set the update tree field, as it is already set
- * as the destroy field */
-static void
-CreateModulePath(TreeNode *modulepath, char *path)
-{
- TreeNode *prev = NULL, *node;
-
- if (path == NULL) {
- if (XF86Module_path) {
- path = XtNewString(XF86Module_path);
- if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath) {
- XtFree(XF86Config->conf_files->file_modulepath);
- XF86Config->conf_files->file_modulepath = XtNewString(path);
- }
- }
- else if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath)
- path = XtNewString(XF86Config->conf_files->file_modulepath);
- }
- else {
- path = XtNewString(path);
- if ((prev = modulepath->child) != NULL)
- while (prev->next)
- prev = prev->next;
- }
-
- if (path) {
- char *s;
-
- for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) {
- node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL);
- node->destroy = ModulePathChanged;
- (void) CreateModulePathField(node, s, False);
- if (modulepath->child == NULL)
- modulepath->child = node;
- else
- prev->next = node;
- prev = node;
- }
- XtFree(path);
- }
-
- node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL);
- (void) CreateModulePathField(node, "", True);
- if (modulepath->child == NULL)
- modulepath->child = node;
- else
- prev->next = node;
-}
-
-static Widget
-CreateModulePathField(TreeNode *modulepath, char *value, Bool addnew)
-{
- Widget box, command, text;
- TreeData *data;
-
- box = XtVaCreateWidget("modulepath", formWidgetClass, tree,
- XtNtreeParent, modulepath->treeParent, NULL, 0);
- modulepath->node = box;
- if (!addnew) {
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback,
- (XtPointer)modulepath);
- text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, value, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, NewModulePathCallback,
- (XtPointer)modulepath);
- text = XtVaCreateManagedWidget("valueNew", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, value, NULL, 0);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->files.text = text;
- modulepath->data = data;
-
- if (modulepath->treeParent && XtIsRealized(modulepath->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-
- return (box);
-}
-
-static void
-ModulePathChanged(TreeNode *node)
-{
- TreeNode *parent = node->parent;
- char *modulepath = NULL, *str;
- Arg args[1];
- int pos = 0, len;
-
- /* last node is the "new" */
- for (node = parent->child; node->next != NULL; node = node->next) {
- if (pos)
- modulepath[pos++] = ',';
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(node->data->files.text, args, 1);
- len = strlen(str) + 2;
- modulepath = XtRealloc(modulepath, pos + len);
- strcpy(modulepath + pos, str);
- pos += len - 2;
- }
-
- if (XF86Config->conf_files->file_modulepath)
- XtFree(XF86Config->conf_files->file_modulepath);
- XF86Config->conf_files->file_modulepath = modulepath;
-}
-
-static void
-NewModulePathCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *modulepath, *node = (TreeNode*)user_data;
- Arg args[1];
- char *str;
-
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(node->data->files.text, args, 1);
- if (*str == '\0')
- return;
-
- modulepath = node->parent;
- DeleteNode(node);
- CreateModulePath(modulepath, str);
-
- ModulePathChanged(modulepath->child);
- RelayoutTree();
-}
-
-/* Module */
-static void
-CreateModule(TreeNode *module, XF86LoadPtr load)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = module->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (load) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->module.load = load;
- node = NewNode(module, NULL, NULL, module->node, data);
- node->destroy = ModuleDestroy;
- CreateModuleField(node, False);
- if (module->child == NULL)
- module->child = node;
- else
- prev->next = node;
- prev = node;
- load = (XF86LoadPtr)(load->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(module, NULL, NULL, module->node, data);
- CreateModuleField(node, True);
- if (module->child == NULL)
- module->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateModuleField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("module", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86OptionPtr *options;
- XF86LoadPtr load = node->data->module.load;
-
- options = &(load->load_opt);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, load->load_name, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewModuleCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->module.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-ModuleDestroy(TreeNode *node)
-{
- if (node->data->module.load)
- xf86removeModule(XF86Config, node->data->module.load);
-}
-
-/*ARGSUSED*/
-static void
-NewModuleCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *module, *node = (TreeNode*)user_data;
- XF86LoadPtr load;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->module.text, args, 1);
- if (*label == '\0')
- return;
-
- module = node->parent;
- DeleteNode(node);
- load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec));
- load->load_name = XtNewString(label);
- XF86Config->conf_modules->mod_load_lst =
- xf86addModule(XF86Config->conf_modules->mod_load_lst, load);
-
- CreateModule(module, load);
- RelayoutTree();
-}
-
-/* Modes */
-static void
-CreateModes(TreeNode *parent, XF86ConfModesPtr modes)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (modes) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->modes.modes = modes;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = ModesDestroy;
- CreateModesField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
-
- modes = (XF86ConfModesPtr)(modes->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateModesField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateModesField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("modes", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86ConfModesPtr modes = node->data->modes.modes;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("mode", toggleWidgetClass, box,
- XtNlabel, modes->modes_identifier,
- XtNstate, True,
- NULL, 0);
- node->toggle = label;
- XtAddCallback(label, XtNcallback, ToggleCallback, (XtPointer)node);
- CreateModesModeLine(node, node->data->modes.modes->mon_modeline_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewModesCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->modes.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-ModesDestroy(TreeNode *node)
-{
- if (node->data->modes.modes) {
- int i;
- TreeNode *mon = monitorTree->child;
-
- /* last one is the "new" entry */
- while (mon && mon->next) {
- /* UseModes is the second entry */
- TreeNode *mod = mon->child->next->child;
- CompositeWidget composite;
-
- while (mod && mod->next) {
- TreeNode *next = mod->next;
-
- if (mod && strcmp(mod->data->modeslink.modeslink->ml_modes_str,
- node->data->modes.modes->modes_identifier) == 0)
- /* Needs to do string comparison because may be deleting
- * a "test" Modes section, with no Modelines.
- */
- DeleteNode(mod);
- mod = next;
- }
- composite = (CompositeWidget)mod->data->modeslink.menu;
-
- for (i = 0; i < composite->composite.num_children; ++i)
- if (strcmp(XtName(composite->composite.children[i]),
- node->data->modes.modes->modes_identifier) == 0)
- XtDestroyWidget(composite->composite.children[i]);
-
- mon = mon->next;
- }
-
- xf86removeModes(XF86Config, node->data->modes.modes);
- }
-}
-
-/*ARGSUSED*/
-static void
-NewModesCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfModesPtr modes;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->modes.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- modes = (XF86ConfModesPtr)XtCalloc(1, sizeof(XF86ConfModesRec));
- modes->modes_identifier = XtNewString(label);
- XF86Config->conf_modes_lst =
- xf86addModes(XF86Config->conf_modes_lst, modes);
-
- {
- TreeNode *mon = monitorTree->child;
- Widget sme;
-
- /* last one is the "new" entry */
- while (mon && mon->next) {
- /* UseModes is the second entry */
- TreeNode *mod = mon->child->next->child;
-
- while (mod && mod->next)
- mod = mod->next;
-
- sme = XtCreateManagedWidget(modes->modes_identifier,
- smeBSBObjectClass,
- mod->data->modeslink.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewMonitorModesCallback,
- (XtPointer)mod);
-
- mon = mon->next;
- }
- }
-
- CreateModes(parent, modes);
- RelayoutTree();
-}
-
-static void
-CreateModesModeLine(TreeNode *parent, XF86ConfModeLinePtr modeline)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (modeline) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->modeline.modeline = modeline;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = ModesModeLineDestroy;
- CreateModeLineField(node, False, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- modeline = (XF86ConfModeLinePtr)(modeline->list.next);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateModeLineField(node, True, False);
-}
-
-/* This function should allow creating modelines for the
- Mode and Monitor section */
-static void
-CreateModeLineField(TreeNode *node, Bool addnew, Bool monitor)
-{
- Widget box, command;
- char buf[512], tmp[32];
-
- box = XtVaCreateWidget("modeline", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86ConfModeLinePtr mod = node->data->modeline.modeline;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass,
- box, NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, mod->ml_identifier, NULL, 0);
-
- XmuSnprintf(buf, sizeof(buf), "%g %d %d %d %d %d %d %d %d",
- mod->ml_clock / 1000., mod->ml_hdisplay, mod->ml_hsyncstart,
- mod->ml_hsyncend, mod->ml_htotal, mod->ml_vdisplay,
- mod->ml_vsyncstart, mod->ml_vsyncend, mod->ml_vtotal);
- if (mod->ml_flags & XF86CONF_INTERLACE)
- strcat(buf, " interlace");
- if (mod->ml_flags & XF86CONF_PHSYNC)
- strcat(buf, " +hsync");
- if (mod->ml_flags & XF86CONF_NHSYNC)
- strcat(buf, " -hsync");
- if (mod->ml_flags & XF86CONF_PVSYNC)
- strcat(buf, " +vsync");
- if (mod->ml_flags & XF86CONF_NVSYNC)
- strcat(buf, " -vsync");
- if (mod->ml_flags & XF86CONF_CSYNC)
- strcat(buf, " composite");
- if (mod->ml_flags & XF86CONF_PCSYNC)
- strcat(buf, " +csync");
- if (mod->ml_flags & XF86CONF_NCSYNC)
- strcat(buf, " -csync");
- if (mod->ml_flags & XF86CONF_DBLSCAN)
- strcat(buf, " doublescan");
- if (mod->ml_flags & XF86CONF_BCAST)
- strcat(buf, " bcast");
- if (mod->ml_flags & XF86CONF_HSKEW) {
- XmuSnprintf(tmp, sizeof(tmp), " hskew %d", mod->ml_hskew);
- strcat(buf, tmp);
- }
- if (mod->ml_flags & XF86CONF_VSCAN) {
- XmuSnprintf(tmp, sizeof(tmp), " vscan %d", mod->ml_vscan);
- strcat(buf, tmp);
- }
- if (mod->ml_flags & XF86CONF_CUSTOM)
- strcat(buf, " custom");
- node->data->modeline.value =
- XtVaCreateManagedWidget("modeline", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
- }
- else {
- *buf = '\0';
- command = XtCreateManagedWidget("new", commandWidgetClass,
- box, NULL, 0);
- XtAddCallback(command, XtNcallback, monitor ?
- NewMonitorModeLineCallback : NewModesModeLineCallback,
- (XtPointer)node);
- node->data->modeline.text =
- XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- node->data->modeline.value =
- XtVaCreateManagedWidget("modelineNew", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-ModesModeLineDestroy(TreeNode *node)
-{
- if (node->data->modeline.modeline)
- xf86removeModesModeLine(node->parent->data->modes.modes,
- node->data->modeline.modeline);
-}
-
-/*ARGSUSED*/
-static void
-NewModesModeLineCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfModeLinePtr modeline;
- Arg args[1];
- char *ident, *value;
-
- XtSetArg(args[0], XtNstring, &ident);
- XtGetValues(node->data->modeline.text, args, 1);
- XtSetArg(args[0], XtNstring, &value);
- XtGetValues(node->data->modeline.value, args, 1);
- if (*ident == '\0' || *value == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- modeline = ParseModeLine(ident, value);
- parent->data->modes.modes->mon_modeline_lst =
- xf86addModeLine(parent->data->modes.modes->mon_modeline_lst, modeline);
-
- CreateModesModeLine(parent, modeline);
- RelayoutTree();
-}
-
-static XF86ConfModeLinePtr
-ParseModeLine(char *identifier, char *modeline)
-{
- XF86ConfModeLinePtr ml = (XF86ConfModeLinePtr)
- XtCalloc(1, sizeof(XF86ConfModeLineRec));
- char *s, *ptr = modeline;
-
- /* Identifier */
- ml->ml_identifier = XtNewString(identifier);
-
- ml->ml_clock = (int)(strtod(ptr, &ptr) * 1000.0 + 0.5);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_hdisplay = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_hsyncstart = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_hsyncend = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_htotal = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_vdisplay = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_vsyncstart = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_vsyncend = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- ml->ml_vtotal = strtol(ptr, &ptr, 10);
- while (*ptr && isspace(*ptr)) ++ptr;
-
- s = ptr;
- while (*s) {
- *s = tolower(*s);
- ++s;
- }
- s = ptr;
-
- while (*ptr) {
- while (*s && isspace(*s))
- s++;
- ptr = s;
- while (*s && !isspace(*s))
- s++;
-
- if (s != ptr) {
- Bool done = *s == '\0';
-
- *s = '\0';
- if (strcmp(ptr, "interlace") == 0)
- ml->ml_flags |= XF86CONF_INTERLACE;
- else if (strcmp(ptr, "+hsync") == 0)
- ml->ml_flags |= XF86CONF_PHSYNC;
- else if (strcmp(ptr, "-hsync") == 0)
- ml->ml_flags |= XF86CONF_NHSYNC;
- else if (strcmp(ptr, "+vsync") == 0)
- ml->ml_flags |= XF86CONF_PVSYNC;
- else if (strcmp(ptr, "-vsync") == 0)
- ml->ml_flags |= XF86CONF_NVSYNC;
- else if (strcmp(ptr, "composite") == 0)
- ml->ml_flags |= XF86CONF_CSYNC;
- else if (strcmp(ptr, "+csync") == 0)
- ml->ml_flags |= XF86CONF_PCSYNC;
- else if (strcmp(ptr, "-csync") == 0)
- ml->ml_flags |= XF86CONF_NCSYNC;
- else if (strcmp(ptr, "doublescan") == 0)
- ml->ml_flags |= XF86CONF_DBLSCAN;
- else if (strcmp(ptr, "bcast") == 0)
- ml->ml_flags |= XF86CONF_BCAST;
- else if (strcmp(ptr, "hskew") == 0) {
- ++s;
- while (*s && isspace(*s))
- ++s;
- ptr = s;
- while (*s && !isspace(*s))
- ++s;
- if (ptr != s) {
- ml->ml_hskew = strtol(ptr, &s, 10);
- ml->ml_flags |= XF86CONF_HSKEW;
- --s;
- }
- }
- else if (strcmp(ptr, "vscan") == 0) {
- ++s;
- while (*s && isspace(*s))
- ++s;
- ptr = s;
- while (*s && !isspace(*s))
- ++s;
- if (ptr != s) {
- ml->ml_vscan = strtol(ptr, &s, 10);
- ml->ml_flags |= XF86CONF_VSCAN;
- --s;
- }
- }
- else if (strcmp(ptr, "custom") == 0)
- ml->ml_flags |= XF86CONF_CUSTOM;
- ++s;
- if (done)
- break;
- ptr = s;
- }
- }
-
- return (ml);
-}
-
-/* VideoAdpator */
-static void
-CreateVideoAdaptor(TreeNode *parent, XF86ConfVideoAdaptorPtr video)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (video) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->video.video = video;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = VideoAdaptorDestroy;
- node->update = VideoAdaptorUpdate;
- CreateVideoAdaptorField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
-
- video = (XF86ConfVideoAdaptorPtr)(video->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateVideoAdaptorField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateVideoAdaptorField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("video", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char *str;
- TreeNode *port;
- XF86ConfVideoAdaptorPtr video = node->data->video.video;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback,
- (XtPointer)&(video->va_option_lst));
- label = XtVaCreateManagedWidget("adaptor", labelWidgetClass, box,
- XtNlabel, video->va_identifier,
- NULL, 0);
-
- XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
- str = video->va_vendor ? video->va_vendor : "";
- node->data->video.vendor =
- XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("boardL", labelWidgetClass, box, NULL, 0);
- str = video->va_board ? video->va_board : "";
- node->data->video.board =
- XtVaCreateManagedWidget("board", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("busidL", labelWidgetClass, box, NULL, 0);
- str = video->va_busid ? video->va_busid : "";
- node->data->video.busid =
- XtVaCreateManagedWidget("busid", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
- str = video->va_driver ? video->va_driver : "";
- node->data->video.driver =
- XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- label = XtVaCreateManagedWidget("VideoPort", toggleWidgetClass, tree,
- XtNstate, True,
- XtNtreeParent, box,
- NULL, 0);
- port = NewNode(node, label, label, node->node, NULL);
- node->child = port;
- CreateVideoPort(port, video->va_port_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewVideoAdaptorCallback,
- (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->video.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-VideoAdaptorDestroy(TreeNode *node)
-{
- if (node->data->video.video) {
- int i;
- TreeNode *scrn = screenTree->child;
-
- /* last one is the "new" entry */
- while (scrn && scrn->next) {
- /* VideoAdator is the first entry */
- TreeNode *ad = scrn->child->child;
- CompositeWidget composite;
-
- while (ad && ad->next) {
- TreeNode *next = ad->next;
-
- if (ad && strcmp(ad->data->adaptorlink.adaptorlink->al_adaptor_str,
- node->data->video.video->va_identifier) == 0)
- DeleteNode(ad);
- ad = next;
- }
- composite = (CompositeWidget)ad->data->adaptorlink.menu;
-
- for (i = 0; i < composite->composite.num_children; ++i)
- if (strcmp(XtName(composite->composite.children[i]),
- node->data->video.video->va_identifier) == 0)
- XtDestroyWidget(composite->composite.children[i]);
-
- scrn = scrn->next;
- }
-
- xf86removeVideoAdaptor(XF86Config, node->data->video.video);
- }
-}
-
-/*ARGSUSED*/
-static void
-NewVideoAdaptorCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfVideoAdaptorPtr video;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->video.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- video = (XF86ConfVideoAdaptorPtr)
- XtCalloc(1, sizeof(XF86ConfVideoAdaptorRec));
- video->va_identifier = XtNewString(label);
- XF86Config->conf_videoadaptor_lst =
- xf86addVideoAdaptor(XF86Config->conf_videoadaptor_lst, video);
-
- {
- TreeNode *scrn = screenTree->child;
- Widget sme;
-
- /* last one is the "new" entry */
- while (scrn && scrn->next) {
- /* VideoAdaptor is the first entry */
- TreeNode *ad = scrn->child->child;
-
- while (ad && ad->next)
- ad = ad->next;
-
- sme = XtCreateManagedWidget(video->va_identifier,
- smeBSBObjectClass,
- ad->data->adaptorlink.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewScreenAdaptorCallback,
- (XtPointer)ad);
-
- scrn = scrn->next;
- }
- }
-
- CreateVideoAdaptor(parent, video);
- RelayoutTree();
-}
-
-static void
-VideoAdaptorUpdate(TreeNode *node)
-{
- char *str;
-
- /* vendor */
- XtVaGetValues(node->data->video.vendor, XtNstring, &str, NULL, 0);
- XtFree(node->data->video.video->va_vendor);
- if (*str)
- node->data->video.video->va_vendor = XtNewString(str);
- else
- node->data->video.video->va_vendor = NULL;
-
- /* board */
- XtVaGetValues(node->data->video.board, XtNstring, &str, NULL, 0);
- XtFree(node->data->video.video->va_board);
- if (*str)
- node->data->video.video->va_board = XtNewString(str);
- else
- node->data->video.video->va_board = NULL;
-
- /* busid */
- XtVaGetValues(node->data->video.busid, XtNstring, &str, NULL, 0);
- XtFree(node->data->video.video->va_busid);
- if (*str)
- node->data->video.video->va_busid = XtNewString(str);
- else
- node->data->video.video->va_busid = NULL;
-
- /* driver */
- XtVaGetValues(node->data->video.driver, XtNstring, &str, NULL, 0);
- XtFree(node->data->video.video->va_driver);
- if (*str)
- node->data->video.video->va_driver = XtNewString(str);
- else
- node->data->video.video->va_driver = NULL;
-}
-
-static void
-CreateVideoPort(TreeNode *parent, XF86ConfVideoPortPtr port)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (port) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->port.port = port;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = VideoPortDestroy;
- CreateVideoPortField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- port = (XF86ConfVideoPortPtr)(port->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateVideoPortField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateVideoPortField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("port", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86OptionPtr *options;
- XF86ConfVideoPortPtr port = node->data->port.port;
-
- options = &(port->vp_option_lst);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, port->vp_identifier, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewVideoPortCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->port.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-VideoPortDestroy(TreeNode *node)
-{
- if (node->data->port.port)
- xf86removeVideoPort(node->parent->parent->data->video.video,
- node->data->port.port);
-}
-
-/*ARGSUSED*/
-static void
-NewVideoPortCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *video, *node = (TreeNode*)user_data;
- XF86ConfVideoPortPtr port;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->port.text, args, 1);
- if (*label == '\0')
- return;
-
- video = node->parent->parent;
- DeleteNode(node);
- port = (XF86ConfVideoPortPtr)XtCalloc(1, sizeof(XF86ConfVideoPortRec));
- port->vp_identifier = XtNewString(label);
- video->data->video.video->va_port_lst =
- xf86addVideoPort(video->data->video.video->va_port_lst, port);
-
- CreateVideoPort(video, port);
- RelayoutTree();
-}
-
-/* Monitor */
-static void
-CreateMonitor(TreeNode *parent, XF86ConfMonitorPtr mon)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (mon) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->monitor.monitor = mon;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = MonitorDestroy;
- node->update = MonitorUpdate;
- CreateMonitorField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- mon = (XF86ConfMonitorPtr)(mon->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateMonitorField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateMonitorField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("monitor", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char *str, buf[256];
- XF86OptionPtr *options;
- XF86ConfMonitorPtr mon = node->data->monitor.monitor;
- Widget useModes;
- TreeNode *modeline, *modes, *prev;
-
- options = &(mon->mon_option_lst);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, mon->mon_identifier, NULL, 0);
-
- XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
- str = mon->mon_vendor ? mon->mon_vendor : "";
- node->data->monitor.vendor =
- XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("modelnameL", labelWidgetClass, box, NULL, 0);
- str = mon->mon_modelname ? mon->mon_modelname : "";
- node->data->monitor.model =
- XtVaCreateManagedWidget("modelname", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("widthL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_width)
- XmuSnprintf(buf, sizeof(buf), "%d", mon->mon_width);
- else
- *buf = '\0';
- node->data->monitor.width =
- XtVaCreateManagedWidget("width", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("heightL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_height)
- XmuSnprintf(buf, sizeof(buf), "%d", mon->mon_height);
- else
- *buf = '\0';
- node->data->monitor.height =
- XtVaCreateManagedWidget("height", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("hsyncL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_n_hsync > 0)
- parser_range_to_string(buf, &(mon->mon_hsync[0]),
- mon->mon_n_hsync);
- else
- *buf = '\0';
- node->data->monitor.hsync =
- XtVaCreateManagedWidget("hsync", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("vrefreshL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_n_vrefresh > 0)
- parser_range_to_string(buf, &(mon->mon_vrefresh[0]),
- mon->mon_n_vrefresh);
- else
- *buf = '\0';
- node->data->monitor.vrefresh =
- XtVaCreateManagedWidget("vrefresh", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("gammaRedL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_gamma_red)
- XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_red);
- else
- *buf = '\0';
- node->data->monitor.gammaRed =
- XtVaCreateManagedWidget("gammaRed", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("gammaGreenL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_gamma_green)
- XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_green);
- else
- *buf = '\0';
- node->data->monitor.gammaGreen =
- XtVaCreateManagedWidget("gammaGreen", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("gammaBlueL", labelWidgetClass, box, NULL, 0);
- if (mon->mon_gamma_blue)
- XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_blue);
- else
- *buf = '\0';
- node->data->monitor.gammaBlue =
- XtVaCreateManagedWidget("gammaBlue", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- if ((prev = node->child) != NULL)
- while (prev->next)
- prev = prev->next;
- command = XtVaCreateManagedWidget("ModeLine", toggleWidgetClass, tree,
- XtNstate, True,
- XtNtreeParent, box, NULL, 0);
- modeline = NewNode(node, command, command, node->node, NULL);
- CreateMonitorModeLine(modeline,
- node->data->monitor.monitor->mon_modeline_lst);
- if (prev == NULL)
- prev = node->child = modeline;
- else {
- prev->next = modeline;
- prev = prev->next;
- }
-
- useModes = XtVaCreateManagedWidget("UseModes", toggleWidgetClass, tree,
- XtNstate, True,
- XtNtreeParent, box, NULL, 0);
- prev->next = modes = NewNode(node, useModes, useModes, node->node, NULL);
- CreateMonitorModes(modes,
- node->data->monitor.monitor->mon_modes_sect_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewMonitorCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->monitor.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-MonitorDestroy(TreeNode *node)
-{
- int i;
- TreeNode *sc = screenTree;
-
- for (i = 0; i < computer.num_devices; i++)
- if ((XF86ConfMonitorPtr)(computer.devices[i]->config) ==
- node->data->monitor.monitor) {
- config = computer.devices[i]->widget;
- RemoveDeviceCallback(NULL, NULL, NULL);
- }
-
- if (sc) {
- TreeNode *prev;
-
- sc = prev = sc->child;
- while (sc->next) {
- TreeNode *next = sc->next;
-
- if (sc->data->screen.screen->scrn_monitor ==
- node->data->monitor.monitor) {
- XtDestroyWidget(sc->node);
-
- if (sc->child)
- DestroyTree(sc->child);
- if (sc->data)
- XtFree((XtPointer)sc->data);
- XtFree((XtPointer)sc);
-
- if (sc == screenTree->child)
- sc = prev = next = screenTree->child = next;
- else
- prev->next = sc = next;
- continue;
- }
- prev = sc;
- sc = next;
- }
- }
-}
-
-static void
-NewMonitorCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfMonitorPtr mon;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->monitor.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- mon = (XF86ConfMonitorPtr)XtCalloc(1, sizeof(XF86ConfMonitorRec));
- mon->mon_identifier = XtNewString(label);
- XF86Config->conf_monitor_lst =
- xf86addMonitor(XF86Config->conf_monitor_lst, mon);
-
- CreateMonitor(parent, mon);
-
- RelayoutTree();
-}
-
-static void
-MonitorUpdate(TreeNode *node)
-{
- char *str;
-
- /* vendor */
- XtVaGetValues(node->data->monitor.vendor, XtNstring, &str, NULL, 0);
- XtFree(node->data->monitor.monitor->mon_vendor);
- if (*str)
- node->data->monitor.monitor->mon_vendor = XtNewString(str);
- else
- node->data->monitor.monitor->mon_vendor = NULL;
-
- /* model */
- XtVaGetValues(node->data->monitor.model, XtNstring, &str, NULL, 0);
- XtFree(node->data->monitor.monitor->mon_modelname);
- if (*str)
- node->data->monitor.monitor->mon_modelname = XtNewString(str);
- else
- node->data->monitor.monitor->mon_modelname = NULL;
-
- /* width */
- XtVaGetValues(node->data->monitor.width, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_width = strtoul(str, NULL, 0);
-
- /* height */
- XtVaGetValues(node->data->monitor.height, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_height = strtoul(str, NULL, 0);
-
- /* hsync */
- XtVaGetValues(node->data->monitor.hsync, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_n_hsync =
- string_to_parser_range(str,
- &(node->data->monitor.monitor->mon_hsync[0]),
- CONF_MAX_HSYNC);
-
- /* vrefresh */
- XtVaGetValues(node->data->monitor.vrefresh, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_n_vrefresh =
- string_to_parser_range(str,
- &(node->data->monitor.monitor->mon_vrefresh[0]),
- CONF_MAX_VREFRESH);
-
- /* gammaRed */
- XtVaGetValues(node->data->monitor.gammaRed, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_gamma_red = strtod(str, NULL);
-
- /* gammaGreen */
- XtVaGetValues(node->data->monitor.gammaGreen, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_gamma_green = strtod(str, NULL);
-
- /* gammaBlue */
- XtVaGetValues(node->data->monitor.gammaBlue, XtNstring, &str, NULL, 0);
- node->data->monitor.monitor->mon_gamma_blue = strtod(str, NULL);
-}
-
-static void
-CreateMonitorModeLine(TreeNode *parent, XF86ConfModeLinePtr modeline)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (modeline) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->modeline.modeline = modeline;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = MonitorModeLineDestroy;
- CreateModeLineField(node, False, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- modeline = (XF86ConfModeLinePtr)(modeline->list.next);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateModeLineField(node, True, True);
-}
-
-/*ARGUSED*/
-static void
-MonitorModeLineDestroy(TreeNode *node)
-{
- if (node->data->modeline.modeline)
- xf86removeMonitorModeLine(node->parent->parent->data->monitor.monitor,
- node->data->modeline.modeline);
-}
-
-/*ARGSUSED*/
-static void
-NewMonitorModeLineCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfModeLinePtr modeline;
- Arg args[1];
- char *ident, *value;
-
- XtSetArg(args[0], XtNstring, &ident);
- XtGetValues(node->data->modeline.text, args, 1);
- XtSetArg(args[0], XtNstring, &value);
- XtGetValues(node->data->modeline.value, args, 1);
- if (*ident == '\0' || *value == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- modeline = ParseModeLine(ident, value);
- parent->parent->data->monitor.monitor->mon_modeline_lst =
- xf86addModeLine(parent->parent->data->monitor.monitor->mon_modeline_lst,
- modeline);
-
- CreateMonitorModeLine(parent, modeline);
- RelayoutTree();
-}
-
-static void
-CreateMonitorModes(TreeNode *parent, XF86ConfModesLinkPtr lnk)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (lnk) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->modeslink.modeslink = lnk;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = MonitorModesLinkDestroy;
- CreateMonitorModesField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- lnk = (XF86ConfModesLinkPtr)(lnk->list.next);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateMonitorModesField(node, True);
-}
-
-static void
-CreateMonitorModesField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("modes", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86ConfModesLinkPtr lnk = node->data->modeslink.modeslink;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- (void) XtVaCreateManagedWidget("mode", labelWidgetClass, box,
- XtNlabel, lnk->ml_modes_str, NULL, 0);
- }
- else {
- Widget sme;
- XF86ConfModesPtr ptr = XF86Config->conf_modes_lst;
-
- command = XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
- XtNmenuName, "modesMenu", NULL, 0);
- node->data->modeslink.menu =
- XtVaCreatePopupShell("modesMenu", simpleMenuWidgetClass, box,
- XtNleftMargin, 1, XtNrightMargin, 1,
- XtNtopMargin, 1, XtNbottomMargin, 1,
- NULL, 0);
- while (ptr) {
- sme = XtCreateManagedWidget(ptr->modes_identifier, smeBSBObjectClass,
- node->data->modeslink.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewMonitorModesCallback,
- (XtPointer)node);
- ptr = (XF86ConfModesPtr)(ptr->list.next);
- }
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-MonitorModesLinkDestroy(TreeNode *node)
-{
- if (node->data->modeslink.modeslink)
- xf86removeMonitorModesLink(node->parent->parent->data->monitor.monitor,
- node->data->modeslink.modeslink);
-}
-
-/*ARGSUSED*/
-static void
-NewMonitorModesCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfModesLinkPtr link;
- char *ident = XtName(w);
-
- parent = node->parent;
- DeleteNode(node);
- link = (XF86ConfModesLinkPtr)XtCalloc(1, sizeof(XF86ConfModesLinkRec));
- link->ml_modes_str = XtNewString(ident);
- parent->parent->data->monitor.monitor->mon_modes_sect_lst =
- xf86addModesLink(parent->parent->data->monitor.monitor->mon_modes_sect_lst,
- link);
-
- CreateMonitorModes(parent, link);
- RelayoutTree();
-}
-
-/* Device */
-static void
-CreateDevice(TreeNode *parent, XF86ConfDevicePtr dev)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (dev) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->device.device = dev;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = DeviceDestroy;
- node->update = DeviceUpdate;
- CreateDeviceField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- dev = (XF86ConfDevicePtr)(dev->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateDeviceField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateDeviceField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("device", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- int i, tmp, len;
- char buf[1024], *str;
- XF86OptionPtr *options;
- XF86ConfDevicePtr dev = node->data->device.device;
-
- options = &(dev->dev_option_lst);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, dev->dev_identifier, NULL, 0);
-
- XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_vendor ? dev->dev_vendor : "";
- node->data->device.vendor =
- XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("boardL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_board ? dev->dev_board : "";
- node->data->device.board =
- XtVaCreateManagedWidget("board", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("chipsetL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_chipset ? dev->dev_chipset : "";
- node->data->device.chipset =
- XtVaCreateManagedWidget("chipset", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("busidL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_busid ? dev->dev_busid : "";
- node->data->device.busid =
- XtVaCreateManagedWidget("busid", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("cardL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_card ? dev->dev_card : "";
- node->data->device.card =
- XtVaCreateManagedWidget("card", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_driver ? dev->dev_driver : "";
- node->data->device.driver =
- XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("ramdacL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_ramdac ? dev->dev_ramdac : "";
- node->data->device.ramdac =
- XtVaCreateManagedWidget("ramdac", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("dacSpeedL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_dacSpeeds[0] > 0) {
- for (i = len = 0; i < CONF_MAXDACSPEEDS &&
- dev->dev_dacSpeeds[i] > 0; i++) {
- tmp = XmuSnprintf(buf + len, sizeof(buf) - len, "%g ",
- dev->dev_dacSpeeds[i] / 1000.);
- len += tmp;
- }
- }
- else
- *buf = '\0';
- node->data->device.dacSpeed =
- XtVaCreateManagedWidget("dacSpeed", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("videoRamL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_videoram)
- XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_videoram);
- else
- *buf = '\0';
- node->data->device.videoRam =
- XtVaCreateManagedWidget("videoRam", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("textClockFreqL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_textclockfreq)
- XmuSnprintf(buf, sizeof(buf), "%.1f",
- (double)dev->dev_textclockfreq / 1000.0);
- else
- *buf = '\0';
- node->data->device.textClockFreq =
- XtVaCreateManagedWidget("textClockFreq", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("biosBaseL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_bios_base)
- XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_bios_base);
- else
- *buf = '\0';
- node->data->device.biosBase =
- XtVaCreateManagedWidget("biosBase", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("memBaseL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_mem_base)
- XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_mem_base);
- else
- *buf = '\0';
- node->data->device.memBase =
- XtVaCreateManagedWidget("memBase", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("ioBaseL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_io_base)
- XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_io_base);
- else
- *buf = '\0';
- node->data->device.ioBase =
- XtVaCreateManagedWidget("ioBase", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("clockChipL", labelWidgetClass, box, NULL, 0);
- str = dev->dev_clockchip ? dev->dev_clockchip : "";
- node->data->device.clockChip =
- XtVaCreateManagedWidget("clockChip", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- *buf = '\0';
- for (i = len = 0; i < dev->dev_clocks; i++) {
- tmp = XmuSnprintf(buf + len, sizeof(buf) - len, "%.1f ",
- (double)dev->dev_clock[i] / 1000.0);
- len += tmp;
- }
- XtCreateManagedWidget("devClockL", labelWidgetClass, box, NULL, 0);
- node->data->device.devClock =
- XtVaCreateManagedWidget("devClock", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("chipIdL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_chipid != -1)
- XmuSnprintf(buf, sizeof(buf), "0x%x", dev->dev_chipid);
- else
- *buf = '\0';
- node->data->device.chipId =
- XtVaCreateManagedWidget("chipId", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("chipRevL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_chiprev != -1)
- XmuSnprintf(buf, sizeof(buf), "0x%x", dev->dev_chiprev);
- else
- *buf = '\0';
- node->data->device.chipRev =
- XtVaCreateManagedWidget("chipRev", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("irqL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_irq != -1)
- XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_irq);
- else
- *buf = '\0';
- node->data->device.irq =
- XtVaCreateManagedWidget("irq", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("screenL", labelWidgetClass, box, NULL, 0);
- if (dev->dev_screen > 0)
- XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_screen);
- else
- *buf = '\0';
- node->data->device.screen =
- XtVaCreateManagedWidget("screen", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewDeviceCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->device.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-NewDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfDevicePtr dev;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->device.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- dev = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
- dev->dev_identifier = XtNewString(label);
- dev->dev_chipid = -1;
- dev->dev_chiprev = -1;
- dev->dev_irq = -1;
-
- XF86Config->conf_device_lst =
- xf86addDevice(XF86Config->conf_device_lst, dev);
-
- CreateDevice(parent, dev);
-
- RelayoutTree();
-}
-
-static void
-DeviceDestroy(TreeNode *node)
-{
- int i;
- TreeNode *sc = screenTree;
-
- for (i = 0; i < computer.num_devices; i++)
- if ((XF86ConfDevicePtr)(computer.devices[i]->config) ==
- node->data->device.device) {
- config = computer.devices[i]->widget;
- RemoveDeviceCallback(NULL, NULL, NULL);
- }
-
- if (sc) {
- TreeNode *prev;
-
- sc = prev = sc->child;
- while (sc->next) {
- TreeNode *next = sc->next;
-
- if (sc->data->screen.screen->scrn_monitor ==
- node->data->monitor.monitor) {
- XtDestroyWidget(sc->node);
-
- if (sc->child)
- DestroyTree(sc->child);
- if (sc->data)
- XtFree((XtPointer)sc->data);
- XtFree((XtPointer)sc);
-
- if (sc == screenTree->child)
- sc = prev = next = screenTree->child = next;
- else
- prev->next = sc = next;
- continue;
- }
- prev = sc;
- sc = next;
- }
- }
-}
-
-static void
-DeviceUpdate(TreeNode *node)
-{
- int i;
- char *str, *tmp;
-
- /* vendor */
- XtVaGetValues(node->data->device.vendor, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_vendor);
- if (*str)
- node->data->device.device->dev_vendor = XtNewString(str);
- else
- node->data->device.device->dev_vendor = NULL;
-
- /* board */
- XtVaGetValues(node->data->device.board, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_board);
- if (*str)
- node->data->device.device->dev_board = XtNewString(str);
- else
- node->data->device.device->dev_board = NULL;
-
- /* chipset */
- XtVaGetValues(node->data->device.chipset, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_chipset);
- if (*str)
- node->data->device.device->dev_chipset = XtNewString(str);
- else
- node->data->device.device->dev_chipset = NULL;
-
- /* busid */
- XtVaGetValues(node->data->device.busid, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_busid);
- if (*str)
- node->data->device.device->dev_busid = XtNewString(str);
- else
- node->data->device.device->dev_busid = NULL;
-
- /* card */
- XtVaGetValues(node->data->device.card, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_card);
- if (*str)
- node->data->device.device->dev_card = XtNewString(str);
- else
- node->data->device.device->dev_card = NULL;
-
- /* driver */
- XtVaGetValues(node->data->device.driver, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_driver);
- if (*str)
- node->data->device.device->dev_driver = XtNewString(str);
- else
- node->data->device.device->dev_driver = NULL;
-
- /* ramdac */
- XtVaGetValues(node->data->device.ramdac, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_ramdac);
- if (*str)
- node->data->device.device->dev_ramdac = XtNewString(str);
- else
- node->data->device.device->dev_ramdac = NULL;
-
- /* dacSpeed */
- tmp = NULL;
- XtVaGetValues(node->data->device.dacSpeed, XtNstring, &str, NULL, 0);
- for (i = 0; i < CONF_MAXDACSPEEDS && str != tmp; i++) {
- if ((node->data->device.device->dev_dacSpeeds[i] =
- (strtod(str, &tmp) * 1000. + .5)) == 0)
- break;
- str = tmp;
- while (isspace(*str))
- ++str;
- }
-
- /* videoRam */
- XtVaGetValues(node->data->device.videoRam, XtNstring, &str, NULL, 0);
- node->data->device.device->dev_videoram = strtoul(str, NULL, 0);
-
- /* textClockFreq */
- XtVaGetValues(node->data->device.textClockFreq, XtNstring, &str, NULL, 0);
- node->data->device.device->dev_textclockfreq =
- strtod(str, NULL) * 1000. + .5;
-
- /* biosBase */
- XtVaGetValues(node->data->device.biosBase, XtNstring, &str, NULL, 0);
- node->data->device.device->dev_bios_base = strtoul(str, NULL, 0);
-
- /* memBase */
- XtVaGetValues(node->data->device.memBase, XtNstring, &str, NULL, 0);
- node->data->device.device->dev_mem_base = strtoul(str, NULL, 0);
-
- /* ioBase */
- XtVaGetValues(node->data->device.ioBase, XtNstring, &str, NULL, 0);
- node->data->device.device->dev_io_base = strtoul(str, NULL, 0);
-
- /* clockChip */
- XtVaGetValues(node->data->device.clockChip, XtNstring, &str, NULL, 0);
- XtFree(node->data->device.device->dev_clockchip);
- if (*str)
- node->data->device.device->dev_clockchip = XtNewString(str);
- else
- node->data->device.device->dev_clockchip = NULL;
-
- /* devSpeed */
- tmp = NULL;
- XtVaGetValues(node->data->device.devClock, XtNstring, &str, NULL, 0);
- for (i = 0; i < CONF_MAXCLOCKS && str != tmp; i++) {
- if ((node->data->device.device->dev_clock[i] =
- (strtod(str, &tmp) * 1000. + .5)) == 0)
- break;
- str = tmp;
- while (isspace(*str))
- ++str;
- }
- node->data->device.device->dev_clocks = i;
-
- /* chipId */
- XtVaGetValues(node->data->device.chipId, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->device.device->dev_chipid = strtoul(str, NULL, 0);
- else
- node->data->device.device->dev_chipid = -1;
-
- /* chipRev */
- XtVaGetValues(node->data->device.chipRev, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->device.device->dev_chiprev = strtoul(str, NULL, 0);
- else
- node->data->device.device->dev_chiprev = -1;
-
- /* irq */
- XtVaGetValues(node->data->device.irq, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->device.device->dev_irq = strtoul(str, NULL, 0);
- else
- node->data->device.device->dev_irq = -1;
-
- /* screen */
- XtVaGetValues(node->data->device.screen, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->device.device->dev_screen = strtoul(str, NULL, 0);
- else
- node->data->device.device->dev_screen = -1;
-}
-
-/* Screen */
-static void
-CreateScreen(TreeNode *parent, XF86ConfScreenPtr scrn)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (scrn) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->screen.screen = scrn;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = ScreenDestroy;
- node->update = ScreenUpdate;
- CreateScreenField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- scrn = (XF86ConfScreenPtr)(scrn->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateScreenField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateScreenField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("screen", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char buf[256], *str;
- XF86OptionPtr *options;
- TreeNode *adaptor, *display;
- XF86ConfScreenPtr scrn = node->data->screen.screen;
-
- options = &(scrn->scrn_option_lst);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, scrn->scrn_identifier, NULL, 0);
-
- XtCreateManagedWidget("defaultDepthL", labelWidgetClass, box, NULL, 0);
- if (scrn->scrn_defaultdepth)
- XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultdepth);
- else
- *buf = '\0';
- node->data->screen.defaultDepth =
- XtVaCreateManagedWidget("defaultDepth", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("defaultBppL", labelWidgetClass, box, NULL, 0);
- if (scrn->scrn_defaultbpp)
- XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultbpp);
- else
- *buf = '\0';
- node->data->screen.defaultBpp =
- XtVaCreateManagedWidget("defaultBpp", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("defaultFbBppL", labelWidgetClass, box, NULL, 0);
- if (scrn->scrn_defaultfbbpp)
- XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultfbbpp);
- else
- *buf = '\0';
- node->data->screen.defaultFbBpp =
- XtVaCreateManagedWidget("defaultFbBpp", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("monitorL", labelWidgetClass, box, NULL, 0);
- str = scrn->scrn_monitor_str ? scrn->scrn_monitor_str : "";
- node->data->screen.monitor =
- XtVaCreateManagedWidget("monitor", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("deviceL", labelWidgetClass, box, NULL, 0);
- str = scrn->scrn_device_str ? scrn->scrn_device_str : "";
- node->data->screen.device =
- XtVaCreateManagedWidget("device", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str,
- NULL, 0);
-
- command = XtVaCreateManagedWidget("videoAdaptor", toggleWidgetClass,
- tree, XtNstate, True,
- XtNtreeParent, box, NULL, 0);
- adaptor = NewNode(node, command, command, node->node, NULL);
- CreateScreenAdaptor(adaptor, scrn->scrn_adaptor_lst);
- node->child = adaptor;
-
- command = XtVaCreateManagedWidget("Display", toggleWidgetClass,
- tree, XtNstate, True,
- XtNtreeParent, box, NULL, 0);
- display = NewNode(node, command, command, node->node, NULL);
- CreateScreenDisplay(display, scrn->scrn_display_lst);
- adaptor->next = display;
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewScreenCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->screen.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-NewScreenCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfScreenPtr scrn;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->screen.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- scrn = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
- scrn->scrn_identifier = XtNewString(label);
- XF86Config->conf_screen_lst =
- xf86addScreen(XF86Config->conf_screen_lst, scrn);
-
- {
- TreeNode *lay = layoutTree->child;
- Widget sme;
-
- /* last one is the "new" entry */
- while (lay && lay->next != NULL) {
- /* Adjacency is the first entry */
- TreeNode *adj = lay->child->child;
-
- while (adj != NULL) {
- sme = XtCreateManagedWidget(label, smeBSBObjectClass,
- adj->data->adjacency.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, adj->next != NULL ?
- AdjacencyMenuCallback : NewAdjacencyCallback,
- (XtPointer)adj);
- adj = adj->next;
- }
- lay = lay->next;
- }
- }
-
- CreateScreen(parent, scrn);
-
- RelayoutTree();
-}
-
-static void
-ScreenDestroy(TreeNode *node)
-{
- if (node->data->screen.screen) {
- int i;
- TreeNode *lay = layoutTree->child;
-
- /* last one is the "new" entry */
- while (lay && lay->next) {
- /* Adjacency is the first entry */
- TreeNode *adj = lay->child->child;
- CompositeWidget composite;
-
- while (adj) {
- TreeNode *next = adj->next;
-
- composite = (CompositeWidget)adj->data->adjacency.menu;
-
- for (i = 0; i < composite->composite.num_children; ++i)
- if (strcmp(XtName(composite->composite.children[i]),
- node->data->screen.screen->scrn_identifier) == 0) {
- XtDestroyWidget(composite->composite.children[i]);
- break;
- }
-
- if (adj->data->adjacency.screen == node->data->screen.screen)
- DeleteNode(adj);
-
- adj = next;
- }
-
- lay = lay->next;
- }
-
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == node->data->screen.screen) {
- config = computer.screens[i]->widget;
- RemoveDeviceCallback(NULL, NULL, NULL);
- }
-
- /* for the case of screens added and removed in the expert dialog */
- xf86removeScreen(XF86Config, node->data->screen.screen);
- }
-}
-
-static void
-ScreenUpdate(TreeNode *node)
-{
- char *str;
-
- /* defautDepth */
- XtVaGetValues(node->data->screen.defaultDepth, XtNstring, &str, NULL, 0);
- node->data->screen.screen->scrn_defaultdepth = strtoul(str, NULL, 0);
-
- /* defautBpp */
- XtVaGetValues(node->data->screen.defaultBpp, XtNstring, &str, NULL, 0);
- node->data->screen.screen->scrn_defaultbpp = strtoul(str, NULL, 0);
-
- /* defautFbBpp */
- XtVaGetValues(node->data->screen.defaultFbBpp, XtNstring, &str, NULL, 0);
- node->data->screen.screen->scrn_defaultfbbpp = strtoul(str, NULL, 0);
-
-
- /* XXX Monitor and Device should be changed to a menu interface */
- /* monitor */
- XtVaGetValues(node->data->screen.monitor, XtNstring, &str, NULL, 0);
- XtFree(node->data->screen.screen->scrn_monitor_str);
- if (*str)
- node->data->screen.screen->scrn_monitor_str = XtNewString(str);
- else
- node->data->screen.screen->scrn_monitor_str = NULL;
-
- /* XXX Monitor and Device should be changed to a menu interface */
- /* device */
- XtVaGetValues(node->data->screen.device, XtNstring, &str, NULL, 0);
- XtFree(node->data->screen.screen->scrn_device_str);
- if (*str)
- node->data->screen.screen->scrn_device_str = XtNewString(str);
- else
- node->data->screen.screen->scrn_device_str = NULL;
-}
-
-static void
-CreateScreenAdaptor(TreeNode *parent, XF86ConfAdaptorLinkPtr lnk)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (lnk) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->adaptorlink.adaptorlink = lnk;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = ScreenAdaptorDestroy;
- CreateScreenAdaptorField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- lnk = (XF86ConfAdaptorLinkPtr)(lnk->list.next);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateScreenAdaptorField(node, True);
-}
-
-static void
-CreateScreenAdaptorField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("adaptor", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86ConfAdaptorLinkPtr lnk = node->data->adaptorlink.adaptorlink;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, lnk->al_adaptor_str, NULL, 0);
- }
- else {
- Widget sme;
- XF86ConfVideoAdaptorPtr ptr = XF86Config->conf_videoadaptor_lst;
-
- command = XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
- XtNmenuName, "adaptorMenu", NULL, 0);
- node->data->adaptorlink.menu =
- XtVaCreatePopupShell("adaptorMenu", simpleMenuWidgetClass, box,
- XtNleftMargin, 1, XtNrightMargin, 1,
- XtNtopMargin, 1, XtNbottomMargin, 1,
- NULL, 0);
- while (ptr) {
- sme = XtCreateManagedWidget(ptr->va_identifier, smeBSBObjectClass,
- node->data->adaptorlink.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewScreenAdaptorCallback,
- (XtPointer)node);
- ptr = (XF86ConfVideoAdaptorPtr)(ptr->list.next);
- }
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGSUSED*/
-static void
-NewScreenAdaptorCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfAdaptorLinkPtr link;
- char *ident = XtName(w);
-
- parent = node->parent;
- DeleteNode(node);
- link = (XF86ConfAdaptorLinkPtr)XtCalloc(1, sizeof(XF86ConfAdaptorLinkRec));
- link->al_adaptor_str = XtNewString(ident);
- parent->parent->data->screen.screen->scrn_adaptor_lst =
- xf86addScreenAdaptor(parent->parent->data->screen.screen->scrn_adaptor_lst,
- link);
-
- CreateScreenAdaptor(parent, link);
- RelayoutTree();
-}
-
-/*ARGUSED*/
-static void
-ScreenAdaptorDestroy(TreeNode *node)
-{
- if (node->data->adaptorlink.adaptorlink)
- xf86removeScreenAdaptorLink(node->parent->parent->data->screen.screen,
- node->data->adaptorlink.adaptorlink);
-}
-
-static void
-CreateScreenDisplay(TreeNode *parent, XF86ConfDisplayPtr dsp)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (dsp) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->display.display = dsp;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = ScreenDisplayDestroy;
- node->update = ScreenDisplayUpdate;
- CreateScreenDisplayField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- dsp = (XF86ConfDisplayPtr)(dsp->list.next);
- }
- node = NewNode(parent, NULL, NULL, parent->node, NULL);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateScreenDisplayField(node, True);
-}
-
-static void
-CreateScreenDisplayField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("display", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char *str, buf[256];
- XF86OptionPtr *options;
- XF86ConfDisplayPtr dsp = node->data->display.display;
- TreeNode *modes;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- options = &(dsp->disp_option_lst);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
-
- XtCreateManagedWidget("viewportL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_frameX0 != 0 || dsp->disp_frameY0 != 0)
- XmuSnprintf(buf, sizeof(buf), "%d %d", dsp->disp_frameX0, dsp->disp_frameY0);
- else
- *buf = '\0';
- node->data->display.viewport =
- XtVaCreateManagedWidget("viewport", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("virtualL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_virtualX != 0 || dsp->disp_virtualY != 0)
- XmuSnprintf(buf, sizeof(buf), "%d %d", dsp->disp_virtualX, dsp->disp_virtualY);
- else
- *buf = '\0';
- node->data->display.c_virtual =
- XtVaCreateManagedWidget("virtual", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("depthL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_depth != 0)
- XmuSnprintf(buf, sizeof(buf), "%d", dsp->disp_depth);
- else
- *buf = '\0';
- node->data->display.depth =
- XtVaCreateManagedWidget("depth", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("bppL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_bpp != 0)
- XmuSnprintf(buf, sizeof(buf), "%d", dsp->disp_bpp);
- else
- *buf = '\0';
- node->data->display.bpp =
- XtVaCreateManagedWidget("bpp", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("visualL", labelWidgetClass, box, NULL, 0);
- str = dsp->disp_visual != NULL ? dsp->disp_visual : "";
- node->data->display.visual =
- XtVaCreateManagedWidget("visual", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str, NULL, 0);
-
- XtCreateManagedWidget("weightL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_weight.red > 0)
- XmuSnprintf(buf, sizeof(buf), "%d %d %d",
- dsp->disp_weight.red, dsp->disp_weight.green, dsp->disp_weight.blue);
- else
- *buf = '\0';
- node->data->display.weight =
- XtVaCreateManagedWidget("weight", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("blackL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_black.red >= 0)
- XmuSnprintf(buf, sizeof(buf), "0x%04x 0x%04x 0x%04x",
- dsp->disp_black.red, dsp->disp_black.green, dsp->disp_black.blue);
- else
- *buf = '\0';
- node->data->display.black =
- XtVaCreateManagedWidget("black", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("whiteL", labelWidgetClass, box, NULL, 0);
- if (dsp->disp_white.red >= 0)
- XmuSnprintf(buf, sizeof(buf), "0x%04x 0x%04x 0x%04x",
- dsp->disp_white.red, dsp->disp_white.green, dsp->disp_white.blue);
- else
- *buf = '\0';
- node->data->display.white =
- XtVaCreateManagedWidget("white", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- command = XtVaCreateManagedWidget("Modes", toggleWidgetClass, tree,
- XtNstate, True, XtNtreeParent, box,
- NULL, 0);
- modes = NewNode(node, command, command, node->node, NULL);
- node->child = modes;
- CreateDisplayMode(modes, dsp->disp_mode_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, NewScreenDisplayCallback,
- (XtPointer)node);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGSUSED*/
-static void
-NewScreenDisplayCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfDisplayPtr dsp;
-
- parent = node->parent;
- DeleteNode(node);
- dsp = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
- dsp->disp_black.red = dsp->disp_black.green = dsp->disp_black.blue =
- dsp->disp_white.red = dsp->disp_white.green = dsp->disp_white.blue = -1;
- parent->parent->data->screen.screen->scrn_display_lst =
- xf86addScreenDisplay(parent->parent->data->screen.screen->scrn_display_lst,
- dsp);
-
- CreateScreenDisplay(parent, dsp);
- RelayoutTree();
-}
-
-static void
-ScreenDisplayDestroy(TreeNode *node)
-{
- if (node->data->display.display)
- xf86removeScreenDisplay(node->parent->parent->data->screen.screen,
- node->data->display.display);
-}
-
-static void
-ScreenDisplayUpdate(TreeNode *node)
-{
- char *str, *tmp;
- int x, y;
-
- /* viewport */
- XtVaGetValues(node->data->display.viewport, XtNstring, &str, NULL, 0);
- if (sscanf(str, "%d %d", &x, &y) == 2) {
- node->data->display.display->disp_frameX0 = x;
- node->data->display.display->disp_frameY0 = y;
- }
-
- /* virtual */
- XtVaGetValues(node->data->display.c_virtual, XtNstring, &str, NULL, 0);
- if (sscanf(str, "%d %d", &x, &y) == 2) {
- node->data->display.display->disp_virtualX = x;
- node->data->display.display->disp_virtualY = y;
- }
-
- /* depth */
- XtVaGetValues(node->data->display.depth, XtNstring, &str, NULL, 0);
- node->data->display.display->disp_depth = strtoul(str, NULL, 0);
-
- /* bpp */
- XtVaGetValues(node->data->display.bpp, XtNstring, &str, NULL, 0);
- node->data->display.display->disp_bpp = strtoul(str, NULL, 0);
-
- /* visual */
- XtVaGetValues(node->data->display.visual, XtNstring, &str, NULL, 0);
- XtFree(node->data->display.display->disp_visual);
- if (*str)
- node->data->display.display->disp_visual = XtNewString(str);
- else
- node->data->display.display->disp_visual = NULL;
-
- /* weight */
- XtVaGetValues(node->data->display.weight, XtNstring, &str, NULL, 0);
- node->data->display.display->disp_weight.red = strtoul(str, &tmp, 0);
- if (str == tmp)
- node->data->display.display->disp_weight.red = 0;
- else {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_weight.green = strtoul(str, &tmp, 0);
- if (str != tmp) {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_weight.blue = strtoul(str, &tmp, 0);
- }
- }
-
- /* black */
- XtVaGetValues(node->data->display.black, XtNstring, &str, NULL, 0);
- node->data->display.display->disp_black.red = strtoul(str, &tmp, 0);
- if (str == tmp)
- node->data->display.display->disp_black.red = -1;
- else {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_black.green = strtoul(str, &tmp, 0);
- if (str != tmp) {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_black.blue = strtoul(str, &tmp, 0);
- }
- }
-
- /* white */
- XtVaGetValues(node->data->display.white, XtNstring, &str, NULL, 0);
- node->data->display.display->disp_white.red = strtoul(str, &tmp, 0);
- if (str == tmp)
- node->data->display.display->disp_white.red = -1;
- else {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_white.green = strtoul(str, &tmp, 0);
- if (str != tmp) {
- str = tmp;
- while (isspace(*str))
- ++str;
- node->data->display.display->disp_white.blue = strtoul(str, &tmp, 0);
- }
- }
-}
-
-static void
-CreateDisplayMode(TreeNode *parent, XF86ModePtr modes)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (modes) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->mode.mode = modes;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = DisplayModeDestroy;
- CreateDisplayModeField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- modes = (XF86ModePtr)(modes->list.next);
- }
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- CreateDisplayModeField(node, True);
-}
-
-static void
-CreateDisplayModeField(TreeNode *node, Bool addnew)
-{
- Widget box, command, text;
-
- box = XtVaCreateWidget("mode", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
- if (!addnew) {
- XF86ModePtr mode = node->data->mode.mode;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback,
- (XtPointer)node);
- text = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, mode->mode_name, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, NewDisplayModeCallback,
- (XtPointer)node);
- text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- }
- node->data->mode.text = text;
- if (node->treeParent && XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGSUSED*/
-static void
-NewDisplayModeCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ModePtr mode;
- Arg args[1];
- char *ident;
-
- XtSetArg(args[0], XtNstring, &ident);
- XtGetValues(node->data->mode.text, args, 1);
- if (*ident == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- mode = (XF86ModePtr)XtCalloc(1, sizeof(XF86ModeRec));
- mode->mode_name = XtNewString(ident);
- parent->parent->data->display.display->disp_mode_lst =
- xf86addDisplayMode(parent->parent->data->display.display->disp_mode_lst,
- mode);
-
- CreateDisplayMode(parent, mode);
- RelayoutTree();
-}
-
-/*ARGUSED*/
-static void
-DisplayModeDestroy(TreeNode *node)
-{
- if (node->data->mode.mode)
- xf86removeDisplayMode(node->parent->parent->data->display.display,
- node->data->mode.mode);
-}
-
-/* Input */
-static void
-CreateInput(TreeNode *parent, XF86ConfInputPtr input)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (input) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->input.input = input;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = InputDestroy;
- node->update = InputUpdate;
- CreateInputField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- input = (XF86ConfInputPtr)(input->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateInputField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateInputField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("input", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char *str;
- XF86OptionPtr *options;
- XF86ConfInputPtr inp = node->data->input.input;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- options = &(inp->inp_option_lst);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, inp->inp_identifier, NULL, 0);
-
- XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
- str = inp->inp_driver != NULL ? inp->inp_driver : "";
- node->data->input.text =
- XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, str, NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
- XtAddCallback(command, XtNcallback, NewInputCallback,
- (XtPointer)node);
- node->data->input.text =
- XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGSUSED*/
-static void
-NewInputCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfInputPtr input;
- Arg args[1];
- char *ident;
-
- XtSetArg(args[0], XtNstring, &ident);
- XtGetValues(node->data->input.text, args, 1);
- if (*ident == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
- input->inp_identifier = XtNewString(ident);
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config->conf_input_lst, input);
-
- {
- TreeNode *lay = layoutTree->child;
- Widget sme;
-
- /* last one is the "new" entry */
- while (lay && lay->next != NULL) {
- /* Inputref is the second entry */
- TreeNode *iref = lay->child->next->child;
-
- while (iref && iref->next)
- iref = iref->next;
- sme = XtCreateManagedWidget(ident, smeBSBObjectClass,
- iref->data->inputref.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewInputrefCallback,
- (XtPointer)iref);
- lay = lay->next;
- }
- }
-
- CreateInput(parent, input);
- RelayoutTree();
-}
-
-/*ARGUSED*/
-static void
-InputDestroy(TreeNode *node)
-{
- if (node->data->input.input) {
- int i;
- TreeNode *lay = layoutTree->child;
-
- /* last one is the "new" entry */
- while (lay && lay->next) {
- /* Inputref is the second entry */
- TreeNode *iref = lay->child->next->child;
- CompositeWidget composite;
-
- while (iref && iref->next) {
- TreeNode *next = iref->next;
-
- if (iref && strcmp(iref->data->inputref.inputref->iref_inputdev_str,
- node->data->input.input->inp_identifier) == 0)
- DeleteNode(iref);
- iref = next;
- }
-
- composite = (CompositeWidget)iref->data->inputref.menu;
-
- for (i = 0; i < composite->composite.num_children; ++i)
- if (strcmp(XtName(composite->composite.children[i]),
- node->data->input.input->inp_identifier) == 0)
- XtDestroyWidget(composite->composite.children[i]);
-
- lay = lay->next;
- }
-
- for (i = 0; i < computer.num_devices; i++)
- if ((XF86ConfInputPtr)(computer.devices[i]->config) ==
- node->data->input.input) {
- config = computer.devices[i]->widget;
- RemoveDeviceCallback(NULL, NULL, NULL);
- }
- }
-}
-
-static void
-InputUpdate(TreeNode *node)
-{
- char *str;
-
- /* vendor */
- XtVaGetValues(node->data->input.text, XtNstring, &str, NULL, 0);
- XtFree(node->data->input.input->inp_driver);
- if (*str)
- node->data->input.input->inp_driver = XtNewString(str);
- else
- node->data->input.input->inp_driver = NULL;
-}
-
-/* Layout */
-static void
-CreateLayout(TreeNode *parent, XF86ConfLayoutPtr lay)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (lay) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->layout.layout = lay;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = LayoutDestroy;
- CreateLayoutField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateLayoutField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateLayoutField(TreeNode *node, Bool addnew)
-{
- Widget box, command, label;
-
- box = XtVaCreateWidget("layout", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- TreeNode *adjacency, *inputref;
- XF86OptionPtr *options;
- XF86ConfLayoutPtr lay = node->data->layout.layout;
-
- options = &(lay->lay_option_lst);
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, lay->lay_identifier, NULL, 0);
-
- command = XtVaCreateManagedWidget("Adjacency", toggleWidgetClass, tree,
- XtNstate, True, XtNtreeParent, box,
- NULL, 0);
- adjacency = NewNode(node, command, command, box, NULL);
- node->child = adjacency;
- CreateAdjacency(adjacency, lay->lay_adjacency_lst);
-
- command = XtVaCreateManagedWidget("Inputref", toggleWidgetClass, tree,
- XtNstate, True, XtNtreeParent, box,
- NULL, 0);
- inputref = NewNode(node, command, command, box, NULL);
- adjacency->next = inputref;
- CreateInputref(inputref, lay->lay_input_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewLayoutCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- NULL, 0);
- node->data->layout.text = label;
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-LayoutDestroy(TreeNode *node)
-{
- if (node->data->layout.layout)
- xf86removeLayout(XF86Config, node->data->layout.layout);
-}
-
-/*ARGSUSED*/
-static void
-NewLayoutCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfLayoutPtr lay;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->layout.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- lay = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
- lay->lay_identifier = XtNewString(label);
- XF86Config->conf_layout_lst = xf86addLayout(XF86Config->conf_layout_lst, lay);
-
- CreateLayout(parent, lay);
- RelayoutTree();
-}
-
-static void
-CreateAdjacency(TreeNode *parent, XF86ConfAdjacencyPtr adj)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (adj) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->adjacency.screen = adj ? adj->adj_screen : NULL;
- data->adjacency.adjacency = adj;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = AdjacencyDestroy;
- CreateAdjacencyField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateAdjacencyField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateAdjacencyField(TreeNode *node, Bool addnew)
-{
- Widget box, command, sme;
- XF86ConfScreenPtr ptr = XF86Config->conf_screen_lst;
-
- box = XtVaCreateWidget("adjacency", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- node->data->adjacency.menu =
- XtVaCreatePopupShell("screenMenu", simpleMenuWidgetClass, box,
- XtNleftMargin, 1, XtNrightMargin, 1,
- XtNtopMargin, 1, XtNbottomMargin, 1,
- NULL, 0);
- while (ptr) {
- sme = XtCreateManagedWidget(ptr->scrn_identifier, smeBSBObjectClass,
- node->data->adjacency.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, !addnew ?
- AdjacencyMenuCallback : NewAdjacencyCallback,
- (XtPointer)node);
- ptr = (XF86ConfScreenPtr)(ptr->list.next);
- }
-
- if (!addnew) {
- char buf[32];
- Cardinal width, height;
- Widget left, right, above, below, relative, absolute;
- XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, adj->adj_screen->scrn_identifier,
- NULL, 0);
-
- XtCreateManagedWidget("scrnumL", labelWidgetClass, box, NULL, 0);
- if (adj->adj_scrnum >= 0)
- XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_scrnum);
- else
- *buf = 0;
- node->data->adjacency.scrnum =
- XtVaCreateManagedWidget("scrnum", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
- above = XtVaCreateManagedWidget("above", toggleWidgetClass, box,
- XtNstate, adj->adj_where == CONF_ADJ_ABOVE ?
- True : False, NULL, 0);
- XtAddCallback(above, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
- left = XtVaCreateManagedWidget("leftOf", toggleWidgetClass, box,
- XtNradioGroup, above,
- XtNstate, adj->adj_where == CONF_ADJ_LEFTOF ?
- True : False, NULL, 0);
- XtAddCallback(left, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
-
- node->data->adjacency.button =
- XtVaCreateManagedWidget("screen", menuButtonWidgetClass, box,
- XtNmenuName, "screenMenu", NULL, 0);
-
- right = XtVaCreateManagedWidget("rightOf", toggleWidgetClass, box,
- XtNradioGroup, left,
- XtNstate, adj->adj_where == CONF_ADJ_RIGHTOF ?
- True : False, NULL, 0);
- XtAddCallback(right, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
- below = XtVaCreateManagedWidget("below", toggleWidgetClass, box,
- XtNradioGroup, right,
- XtNstate, adj->adj_where == CONF_ADJ_BELOW ?
- True : False, NULL, 0);
- XtAddCallback(below, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
- relative = XtVaCreateManagedWidget("relative", toggleWidgetClass, box,
- XtNradioGroup, below,
- XtNstate, adj->adj_where == CONF_ADJ_RELATIVE ?
- True : False, NULL, 0);
- XtAddCallback(relative, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
- absolute = XtVaCreateManagedWidget("absolute", toggleWidgetClass, box,
- XtNradioGroup, relative,
- XtNstate, adj->adj_where == CONF_ADJ_ABSOLUTE ?
- True : False, NULL, 0);
- XtAddCallback(absolute, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
-
- XtCreateManagedWidget("adjxL", labelWidgetClass, box, NULL, 0);
- XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_x);
- node->data->adjacency.adjx =
- XtVaCreateManagedWidget("adjx", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtCreateManagedWidget("adjyL", labelWidgetClass, box, NULL, 0);
- XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_y);
- node->data->adjacency.adjy =
- XtVaCreateManagedWidget("adjy", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit,
- XtNstring, buf, NULL, 0);
-
- XtVaGetValues(node->data->adjacency.button, XtNwidth, &width,
- XtNheight, &height, NULL, 0);
- if (adj->adj_where > CONF_ADJ_ABSOLUTE &&
- adj->adj_where <= CONF_ADJ_RELATIVE)
- XtVaSetValues(node->data->adjacency.button, XtNlabel,
- adj->adj_refscreen, XtNwidth, width,
- XtNheight, height, NULL, 0);
- else
- XtVaSetValues(node->data->adjacency.button, XtNlabel, "",
- XtNwidth, width, XtNheight, height, NULL, 0);
- }
- else
- XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
- XtNmenuName, "screenMenu", NULL, 0);
-
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-AdjacencyDestroy(TreeNode *node)
-{
- if (node->data->adjacency.adjacency)
- xf86removeAdjacency(node->parent->parent->data->layout.layout,
- node->data->adjacency.adjacency);
-}
-
-/*ARGSUSED*/
-static void
-NewAdjacencyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfAdjacencyPtr adj;
- char *ident = XtName(w);
-
- parent = node->parent;
- DeleteNode(node);
- adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_screen = xf86findScreen(ident, XF86Config->conf_screen_lst);
- if (adj->adj_screen)
- adj->adj_screen_str = XtNewString(adj->adj_screen->scrn_identifier);
- parent->parent->data->layout.layout->lay_adjacency_lst =
- xf86addAdjacency(parent->parent->data->layout.layout->lay_adjacency_lst,
- adj);
-
- CreateAdjacency(parent, adj);
- RelayoutTree();
-}
-
-/*ARGUSED*/
-static void
-AdjacencyMenuCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *node = (TreeNode*)user_data;
- XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
-
- XtFree(adj->adj_refscreen);
- adj->adj_refscreen = XtNewString(XtName(w));
- XtVaSetValues(node->data->adjacency.button, XtNlabel, XtName(w), NULL, 0);
-}
-
-static void
-AdjacencyToggleCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *node = (TreeNode*)user_data;
- XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
- char *x, *y;
-
- if ((Bool)(long)call_data == False)
- return;
-
- XtVaGetValues(node->data->adjacency.adjx, XtNstring, &x, NULL, 0);
- XtVaGetValues(node->data->adjacency.adjy, XtNstring, &y, NULL, 0);
-
- adj->adj_x = strtol(x, NULL, 0);
- adj->adj_y = strtol(y, NULL, 0);
-
- if (strcmp(XtName(w), "absolute") == 0) {
- XtVaSetValues(node->data->adjacency.button, XtNlabel, "", NULL, 0);
- adj->adj_where = CONF_ADJ_ABSOLUTE;
- return;
- }
- if (strcmp(XtName(w), "relative") == 0)
- adj->adj_where = CONF_ADJ_RELATIVE;
- else if (strcmp(XtName(w), "leftOf") == 0)
- adj->adj_where = CONF_ADJ_LEFTOF;
- else if (strcmp(XtName(w), "rightOf") == 0)
- adj->adj_where = CONF_ADJ_RIGHTOF;
- else if (strcmp(XtName(w), "above") == 0)
- adj->adj_where = CONF_ADJ_ABOVE;
- else if (strcmp(XtName(w), "below") == 0)
- adj->adj_where = CONF_ADJ_BELOW;
-}
-
-/* Inputref */
-static void
-CreateInputref(TreeNode *parent, XF86ConfInputrefPtr input)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (input) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->inputref.inputref = input;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = InputrefDestroy;
- CreateInputrefField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- input = (XF86ConfInputrefPtr)(input->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateInputrefField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateInputrefField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("inputref", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86OptionPtr *options;
- XF86ConfInputrefPtr inp = node->data->inputref.inputref;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- options = &(inp->iref_option_lst);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, inp->iref_inputdev_str, NULL, 0);
- }
- else {
- Widget sme;
- XF86ConfInputPtr ptr = XF86Config->conf_input_lst;
-
- XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
- XtNmenuName, "inputMenu", NULL, 0);
- node->data->inputref.menu =
- XtVaCreatePopupShell("inputMenu", simpleMenuWidgetClass, box,
- XtNleftMargin, 1, XtNrightMargin, 1,
- XtNtopMargin, 1, XtNbottomMargin, 1,
- NULL, 0);
-
- while (ptr) {
- sme = XtCreateManagedWidget(ptr->inp_identifier, smeBSBObjectClass,
- node->data->inputref.menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, NewInputrefCallback,
- (XtPointer)node);
- ptr = (XF86ConfInputPtr)(ptr->list.next);
- }
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGSUSED*/
-static void
-NewInputrefCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfInputrefPtr input;
- char *ident = XtName(w);
-
- parent = node->parent;
- DeleteNode(node);
- input = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
- input->iref_inputdev_str = XtNewString(ident);
- parent->parent->data->layout.layout->lay_input_lst =
- xf86addInputref(parent->parent->data->layout.layout->lay_input_lst, input);
-
- CreateInputref(parent, input);
- RelayoutTree();
-}
-
-/*ARGUSED*/
-static void
-InputrefDestroy(TreeNode *node)
-{
- if (node->data->inputref.inputref)
- xf86removeInputRef(node->parent->parent->data->layout.layout, node->data->inputref.inputref->iref_inputdev);
-}
-
-/* Vendor */
-static void
-CreateVendor(TreeNode *parent, XF86ConfVendorPtr vendor)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (vendor) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->vendor.vendor = vendor;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = VendorDestroy;
- CreateVendorField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- vendor = (XF86ConfVendorPtr)(vendor->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateVendorField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateVendorField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("vendor", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- TreeNode *sub;
- XF86OptionPtr *options;
- XF86ConfVendorPtr vendor = node->data->vendor.vendor;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- options = &(vendor->vnd_option_lst);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, vendor->vnd_identifier, NULL, 0);
-
- command = XtVaCreateManagedWidget("VendSub", toggleWidgetClass, tree,
- XtNstate, True,
- XtNtreeParent, box,
- NULL, 0);
- sub = NewNode(node, command, command, box, NULL);
- node->child = sub;
- CreateVendorSub(sub, vendor->vnd_sub_lst);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewVendorCallback, (XtPointer)node);
- node->data->vendor.text =
- XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-VendorDestroy(TreeNode *node)
-{
- if (node->data->vendor.vendor)
- xf86removeVendor(XF86Config, node->data->vendor.vendor);
-}
-
-static void
-NewVendorCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfVendorPtr vnd;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->vendor.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- vnd = (XF86ConfVendorPtr)XtCalloc(1, sizeof(XF86ConfVendorRec));
- vnd->vnd_identifier = XtNewString(label);
- XF86Config->conf_vendor_lst = xf86addVendor(XF86Config->conf_vendor_lst, vnd);
-
- CreateVendor(parent, vnd);
- RelayoutTree();
-}
-
-/* VendorSub */
-static void
-CreateVendorSub(TreeNode *parent, XF86ConfVendSubPtr vendor)
-{
- TreeNode *prev, *node;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (vendor) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->vendsub.vendsub = vendor;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = VendorSubDestroy;
- node->update = VendorSubUpdate;
- CreateVendorSubField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
- vendor = (XF86ConfVendSubPtr)(vendor->list.next);
- }
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- node = NewNode(parent, NULL, NULL, parent->node, data);
- CreateVendorSubField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateVendorSubField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("vendorSub", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- XF86OptionPtr *options;
- XF86ConfVendSubPtr vendor = node->data->vendsub.vendsub;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- options = &(vendor->vs_option_lst);
- command = XtCreateManagedWidget("options", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
- XtVaCreateManagedWidget("label", labelWidgetClass, box,
- XtNlabel, vendor->vs_identifier, NULL, 0);
-
- XtCreateManagedWidget("nameL", labelWidgetClass, box, NULL, 0);
- node->data->vendsub.text =
- XtVaCreateManagedWidget("name", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring,
- vendor->vs_name ? vendor->vs_name : "",
- NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewVendorSubCallback, (XtPointer)node);
- node->data->vendsub.text =
- XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, NULL, 0);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-VendorSubDestroy(TreeNode *node)
-{
- if (node->data->vendsub.vendsub)
- xf86removeVendorSub(node->parent->parent->data->vendor.vendor,
- node->data->vendsub.vendsub);
-}
-
-static void
-VendorSubUpdate(TreeNode *node)
-{
- char *str;
-
- XtVaGetValues(node->data->vendsub.text, XtNstring, &str, NULL, 0);
- XtFree(node->data->vendsub.vendsub->vs_name);
- if (*str)
- node->data->vendsub.vendsub->vs_name = XtNewString(str);
- else
- node->data->vendsub.vendsub->vs_name = NULL;
-}
-
-static void
-NewVendorSubCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfVendSubPtr vnd;
- Arg args[1];
- char *label;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(node->data->vendsub.text, args, 1);
- if (*label == '\0')
- return;
-
- parent = node->parent;
- DeleteNode(node);
- vnd = (XF86ConfVendSubPtr)XtCalloc(1, sizeof(XF86ConfVendSubRec));
- vnd->vs_identifier = XtNewString(label);
- parent->parent->data->vendor.vendor->vnd_sub_lst =
- xf86addVendorSub(parent->parent->data->vendor.vendor->vnd_sub_lst, vnd);
-
- CreateVendorSub(parent, vnd);
- RelayoutTree();
-}
-
-/* DRI */
-static void
-CreateDRI(TreeNode *parent, XF86ConfDRIPtr dri)
-{
- TreeNode *node;
- TreeData *data;
-
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->dri.dri = dri;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- parent->child = node;
- node->update = DRIUpdate;
- CreateDRIField(node);
-}
-
-static void
-CreateDRIField(TreeNode *node)
-{
- Widget box, toggle;
- XF86ConfDRIPtr dri = node->data->dri.dri;
- TreeNode *buffers;
- char buf[32];
-
- box = XtVaCreateWidget("dri", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
- XtCreateManagedWidget("nameL", labelWidgetClass, box, NULL, 0);
- node->data->dri.name =
- XtVaCreateManagedWidget("name", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring,
- dri->dri_group_name ? dri->dri_group_name : "",
- NULL, 0);
-
- XtCreateManagedWidget("groupL", labelWidgetClass, box, NULL, 0);
- if (dri->dri_group >= 0)
- XmuSnprintf(buf, sizeof(buf), "%d", dri->dri_group);
- else
- *buf = '\0';
- node->data->dri.group =
- XtVaCreateManagedWidget("group", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring, buf,
- NULL, 0);
-
- XtCreateManagedWidget("modeL", labelWidgetClass, box, NULL, 0);
- if (dri->dri_mode > 0)
- XmuSnprintf(buf, sizeof(buf), "0%o", dri->dri_mode);
- else
- *buf = '\0';
- node->data->dri.mode =
- XtVaCreateManagedWidget("mode", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring, buf,
- NULL, 0);
-
- toggle = XtVaCreateManagedWidget("Buffers", toggleWidgetClass, tree,
- XtNstate, True, XtNtreeParent, box,
- NULL, 0);
- buffers = NewNode(node, toggle, toggle, box, NULL);
- node->child = buffers;
- CreateBuffers(buffers, dri->dri_buffers_lst);
-
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-static void
-DRIUpdate(TreeNode *node)
-{
- char *str;
-
- /* name */
- XtVaGetValues(node->data->dri.name, XtNstring, &str, NULL, 0);
- XtFree(node->data->dri.dri->dri_group_name);
- if (*str)
- node->data->dri.dri->dri_group_name = XtNewString(str);
- else
- node->data->dri.dri->dri_group_name = NULL;
-
- /* group */
- XtVaGetValues(node->data->dri.group, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->dri.dri->dri_group = strtoul(str, NULL, 0);
- else
- node->data->dri.dri->dri_group = -1;
-
- /* mode */
- XtVaGetValues(node->data->dri.mode, XtNstring, &str, NULL, 0);
- node->data->dri.dri->dri_mode = strtoul(str, NULL, 0);
-}
-
-/* Buffers */
-static void
-CreateBuffers(TreeNode *parent, XF86ConfBuffersPtr buf)
-{
- TreeNode *node, *prev;
- TreeData *data;
-
- if ((prev = parent->child) != NULL)
- while (prev->next)
- prev = prev->next;
-
- while (buf) {
- data = (TreeData*)XtCalloc(1, sizeof(TreeData));
- data->buffers.buffers = buf;
- node = NewNode(parent, NULL, NULL, parent->node, data);
- node->destroy = BuffersDestroy;
- node->update = BuffersUpdate;
- CreateBuffersField(node, False);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
- prev = node;
-
- buf = (XF86ConfBuffersPtr)(buf->list.next);
- }
- node = NewNode(parent, NULL, NULL, parent->node, NULL);
- CreateBuffersField(node, True);
- if (parent->child == NULL)
- parent->child = node;
- else
- prev->next = node;
-}
-
-static void
-CreateBuffersField(TreeNode *node, Bool addnew)
-{
- Widget box, command;
-
- box = XtVaCreateWidget("buffers", formWidgetClass, tree,
- XtNtreeParent, node->treeParent, NULL, 0);
- node->node = box;
-
- if (!addnew) {
- char str[32];
- XF86ConfBuffersPtr buf = node->data->buffers.buffers;
-
- command = XtCreateManagedWidget("remove", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
-
- XtCreateManagedWidget("countL", labelWidgetClass, box, NULL, 0);
- XmuSnprintf(str, sizeof(str), "%d", buf->buf_count);
- node->data->buffers.count =
- XtVaCreateManagedWidget("count", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("sizeL", labelWidgetClass, box, NULL, 0);
- XmuSnprintf(str, sizeof(str), "%d", buf->buf_size);
- node->data->buffers.size =
- XtVaCreateManagedWidget("size", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring, str,
- NULL, 0);
-
- XtCreateManagedWidget("flagsL", labelWidgetClass, box, NULL, 0);
- node->data->buffers.flags =
- XtVaCreateManagedWidget("flags", asciiTextWidgetClass, box,
- XtNeditType, XawtextEdit, XtNstring,
- buf->buf_flags ? buf->buf_flags : "",
- NULL, 0);
- }
- else {
- command = XtCreateManagedWidget("new", commandWidgetClass, box,
- NULL, 0);
- XtAddCallback(command, XtNcallback, NewBuffersCallback, (XtPointer)node);
- }
- if (XtIsRealized(node->treeParent))
- XtRealizeWidget(box);
- XtManageChild(box);
-}
-
-/*ARGUSED*/
-static void
-BuffersDestroy(TreeNode *node)
-{
- if (node->data->buffers.buffers)
- xf86removeBuffers(XF86Config->conf_dri, node->data->buffers.buffers);
-}
-
-/*ARGSUSED*/
-static void
-NewBuffersCallback(Widget unused, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *parent, *node = (TreeNode*)user_data;
- XF86ConfBuffersPtr buf;
-
- parent = node->parent;
- DeleteNode(node);
- buf = (XF86ConfBuffersPtr)XtCalloc(1, sizeof(XF86ConfBuffersRec));
- XF86Config->conf_dri->dri_buffers_lst =
- xf86addBuffers(XF86Config->conf_dri->dri_buffers_lst, buf);
-
- CreateBuffers(parent, buf);
- RelayoutTree();
-}
-
-static void
-BuffersUpdate(TreeNode *node)
-{
- char *str;
-
- /* count */
- XtVaGetValues(node->data->buffers.count, XtNstring, &str, NULL, 0);
- node->data->buffers.buffers->buf_count = strtoul(str, NULL, 0);
-
- /* size */
- XtVaGetValues(node->data->buffers.size, XtNstring, &str, NULL, 0);
- node->data->buffers.buffers->buf_size = strtoul(str, NULL, 0);
-
- /* flags */
- XtVaGetValues(node->data->buffers.flags, XtNstring, &str, NULL, 0);
- if (*str)
- node->data->buffers.buffers->buf_flags = XtNewString(str);
- else
- node->data->buffers.buffers->buf_flags = NULL;
-}
-
-static TreeNode *
-NewNode(TreeNode *parent, Widget node, Widget toggle, Widget treeParent,
- TreeData *data)
-{
- TreeNode *tree = (TreeNode*)XtCalloc(1, sizeof(TreeNode));
-
- tree->parent = parent;
- tree->node = node;
- if ((tree->toggle = toggle) != NULL)
- XtAddCallback(toggle, XtNcallback, ToggleCallback, (XtPointer)tree);
- tree->treeParent = treeParent;
- tree->data = data;
-
- return (tree);
-}
-
-static void
-DeleteNode(TreeNode *node)
-{
- TreeNode *ptr = node->child;
-
- while (ptr != NULL) {
- TreeNode *next = ptr->next;
-
- DeleteNode(ptr);
- ptr = next;
- }
-
- if (node->parent && node->parent->child == node)
- node->parent->child = node->next;
- else if (node->parent) {
- for (ptr = node->parent->child; ptr && ptr->next != node;
- ptr = ptr->next)
- ;
- if (ptr)
- ptr->next = node->next;
- }
-
- if (node->destroy)
- (node->destroy)(node);
- if (node->data)
- XtFree((XtPointer)node->data);
-
- /* sets treeParent to NULL so that RelayoutTree works correctly,
- * as the tree will properly calculate it's new size.
- */
- XtVaSetValues(node->node, XtNtreeParent, NULL, NULL, 0);
-
- XtDestroyWidget(node->node);
- XtFree((XtPointer)node);
-}
-
-/*ARGUSED*/
-static void
-DestroyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *node = (TreeNode*)user_data;
-
- DeleteNode(node);
- RelayoutTree();
-}
-
-static void
-ToggleNodeRecursive(TreeNode *node)
-{
- while (node) {
- if (!XtIsRealized(node->node))
- XtRealizeWidget(node->node);
- XtVaSetValues(node->node, XtNtreeParent, node->treeParent, NULL, 0);
- XtManageChild(node->node);
-
- if (node->child && !node->toggle)
- ToggleNodeRecursive(node->child);
-
- node = node->next;
- }
-}
-
-static void
-ToggleNode(TreeNode *node, Bool toggle)
-{
- while (node) {
- if (toggle) {
- if (!XtIsRealized(node->node))
- XtRealizeWidget(node->node);
- XtVaSetValues(node->node, XtNtreeParent, node->treeParent, NULL, 0);
- XtManageChild(node->node);
-
- if (node->child && !node->toggle)
- ToggleNodeRecursive(node->child);
- }
- else {
- if (node->child)
- ToggleNode(node->child, False);
- XtVaSetValues(node->node, XtNtreeParent, NULL, NULL, 0);
- XtUnmanageChild(node->node);
- if (node->toggle)
- XtVaSetValues(node->toggle, XtNstate, False, NULL, 0);
- }
- node = node->next;
- }
-}
-
-/*
- * XXX This callback can show side effects in the way it is called. If
- * the structure holding the XF86OptionPtr is reallocated, a bogus pointer
- * will be passed to this callback.
- */
-static void
-OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XF86OptionPtr *options = (XF86OptionPtr*)user_data;
-
-#ifdef USE_MODULES
- OptionsPopup(options, NULL, NULL);
-#else
- OptionsPopup(options);
-#endif
-}
-
-static void
-RelayoutTree(void)
-{
- Arg args[4];
- Dimension sliderWidth, sliderHeight, canvasWidth, canvasHeight;
-
- XtSetArg(args[0], XtNwidth, &sliderWidth);
- XtSetArg(args[1], XtNheight, &sliderHeight);
- XtGetValues(shell, args, 2);
-
- XtSetArg(args[2], XtNwidth, &canvasWidth);
- XtSetArg(args[3], XtNheight, &canvasHeight);
- XtGetValues(tree, args + 2, 2);
-
- XtSetArg(args[0], XtNsliderWidth, sliderWidth);
- XtSetArg(args[1], XtNsliderHeight, sliderHeight);
- XtSetArg(args[2], XtNcanvasWidth, canvasWidth);
- XtSetArg(args[3], XtNcanvasHeight, canvasHeight);
- XtSetValues(panner, args, 4);
-}
-
-static void
-ToggleCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- TreeNode *nodeParent = (TreeNode*)user_data;
-
- if (nodeParent->child) {
- if (XtIsRealized(tree))
- XtUnmapWidget(tree);
- ToggleNode(nodeParent->child, (Bool)(long)call_data);
- RelayoutTree();
- if (XtIsRealized(tree))
- XtMapWidget(tree);
- }
-}
-
-/*ARGSUSED*/
-static void
-PannerCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[2];
- XawPannerReport *rep = (XawPannerReport *)call_data;
-
- XtSetArg (args[0], XtNx, -rep->slider_x);
- XtSetArg (args[1], XtNy, -rep->slider_y);
- XtSetValues(tree, args, 2);
-}
-
-/*ARGSUSED*/
-static void
-PortholeCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawPannerReport *rep = (XawPannerReport*)call_data;
- Arg args[6];
- Cardinal n = 2;
-
- XtSetArg (args[0], XtNsliderX, rep->slider_x);
- XtSetArg (args[1], XtNsliderY, rep->slider_y);
- if (rep->changed != (XawPRSliderX | XawPRSliderY)) {
- XtSetArg (args[2], XtNsliderWidth, rep->slider_width);
- XtSetArg (args[3], XtNsliderHeight, rep->slider_height);
- XtSetArg (args[4], XtNcanvasWidth, rep->canvas_width);
- XtSetArg (args[5], XtNcanvasHeight, rep->canvas_height);
- n = 6;
- }
- XtSetValues(panner, args, n);
-}
-
-static void
-DestroyTree(TreeNode *node)
-{
- while (node) {
- TreeNode *next = node->next;
- if (node->child)
- DestroyTree(node->child);
-
- if (node->data)
- XtFree((XtPointer)node->data);
- XtFree((XtPointer)node);
-
- node = next;
- }
-}
-
-static void
-UpdateConfig(TreeNode *node)
-{
- while (node) {
- if (node->child)
- UpdateConfig(node->child);
- if (node->update)
- (node->update)(node);
- node = node->next;
- }
-}
-
-static Bool
-ExpertInitialize(void)
-{
- Widget paned, vpane, close, config, files, modules, flags, video, modes,
- monitor, device, screen, input, layout, vendor, dri;
- Arg args[4];
- Dimension width, height, canvasWidth, canvasHeight;
- TreeNode *node;
-
- if (expert != NULL)
- return (False);
-
- shell = XtCreatePopupShell("Expert", transientShellWidgetClass,
- toplevel, NULL, 0);
- paned = XtVaCreateManagedWidget("paned", panedWidgetClass, shell,
- XtNorientation, XtorientHorizontal, NULL, 0);
- vpane = XtCreateManagedWidget("vpane", panedWidgetClass, paned, NULL, 0);
- panner = XtCreateManagedWidget ("panner", pannerWidgetClass, vpane, NULL, 0);
- close = XtCreateManagedWidget("close", commandWidgetClass, vpane, NULL, 0);
- XtAddCallback(close, XtNcallback, PopdownCallback, NULL);
-
- expert = XtCreateManagedWidget("expert", portholeWidgetClass, paned, NULL, 0);
- XtAddCallback(expert, XtNreportCallback, PortholeCallback, NULL);
- XtAddCallback(panner, XtNreportCallback, PannerCallback, NULL);
- tree = XtCreateManagedWidget("tree", treeWidgetClass, expert, NULL, 0);
-
- config = XtVaCreateManagedWidget("XF86Config", toggleWidgetClass, tree,
- XtNstate, True, NULL, 0);
- mainNode = NewNode(NULL, config, config, NULL, NULL);
-
- files = XtVaCreateManagedWidget("Files", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node = NewNode(mainNode, files, files, config, NULL);
- mainNode->child = node;
- CreateFiles(node);
-
- modules = XtVaCreateManagedWidget("Module", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, modules, modules, config, NULL);
- node = node->next;
- CreateModule(node, XF86Config->conf_modules ?
- XF86Config->conf_modules->mod_load_lst : NULL);
-
- flags = XtVaCreateManagedWidget("ServerFlags", commandWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, flags, NULL, config, NULL);
- node = node->next;
- if (XF86Config->conf_flags == NULL)
- XF86Config->conf_flags = (XF86ConfFlagsPtr)
- XtCalloc(1, sizeof(XF86ConfFlagsRec));
- XtAddCallback(flags, XtNcallback, OptionsCallback,
- (XtPointer)&(XF86Config->conf_flags->flg_option_lst));
-
- video = XtVaCreateManagedWidget("VideoAdaptor", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, video, video, config, NULL);
- node = node->next;
- CreateVideoAdaptor(node, XF86Config->conf_videoadaptor_lst);
-
- modes = XtVaCreateManagedWidget("Mode", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, modes, modes, config, NULL);
- node = node->next;
- CreateModes(node, XF86Config->conf_modes_lst);
-
- monitor = XtVaCreateManagedWidget("Monitor", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, monitor, monitor, config, NULL);
- node = node->next;
- CreateMonitor(monitorTree = node, XF86Config->conf_monitor_lst);
-
- device = XtVaCreateManagedWidget("Device", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, device, device, config, NULL);
- node = node->next;
- CreateDevice(node, XF86Config->conf_device_lst);
-
- screen = XtVaCreateManagedWidget("Screen", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, screen, screen, config, NULL);
- node = node->next;
- CreateScreen(screenTree = node, XF86Config->conf_screen_lst);
-
- input = XtVaCreateManagedWidget("Input", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, input, input, config, NULL);
- node = node->next;
- CreateInput(node, XF86Config->conf_input_lst);
-
- layout = XtVaCreateManagedWidget("Layout", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, layout, layout, config, NULL);
- node = node->next;
- CreateLayout(layoutTree = node, XF86Config->conf_layout_lst);
-
- vendor = XtVaCreateManagedWidget("Vendor", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, vendor, vendor, config, NULL);
- node = node->next;
- CreateVendor(node, XF86Config->conf_vendor_lst);
-
- dri = XtVaCreateManagedWidget("DRI", toggleWidgetClass, tree,
- XtNtreeParent, config, NULL, 0);
- node->next = NewNode(mainNode, dri, dri, config, NULL);
- node = node->next;
- if (XF86Config->conf_dri == NULL)
- XF86Config->conf_dri = (XF86ConfDRIPtr)
- XtCalloc(1, sizeof(XF86ConfDRIRec));
- CreateDRI(node, XF86Config->conf_dri);
-
- XtRealizeWidget(shell);
-
- XtSetArg(args[0], XtNwidth, &width);
- XtSetArg(args[1], XtNheight, &height);
- XtGetValues(shell, args, 2);
- XtSetArg(args[0], XtNwidth, width);
- XtSetArg(args[1], XtNheight, height);
- XtSetValues(expert, args, 2);
-
- XtSetArg(args[0], XtNsliderWidth, width);
- XtSetArg(args[1], XtNsliderHeight, height);
- XtSetArg(args[2], XtNwidth, &canvasWidth);
- XtSetArg(args[3], XtNheight, &canvasHeight);
- XtGetValues(tree, args + 2, 2);
- XtSetArg(args[2], XtNcanvasWidth, canvasWidth);
- XtSetArg(args[3], XtNcanvasHeight, canvasHeight);
- XtSetValues(panner, args, 4);
-
- /* needs to do the apparently NOP code bellow to correctly layout the
- * tree widget */
-
- /* close all open entries */
- ToggleCallback(config, mainNode, (XtPointer)0);
- /* open first level */
- ToggleCallback(config, mainNode, (XtPointer)1);
-
- XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
-
- return (True);
-}
diff --git a/hw/xfree86/utils/xorgcfg/help.c b/hw/xfree86/utils/xorgcfg/help.c
deleted file mode 100644
index 2ae68a082..000000000
--- a/hw/xfree86/utils/xorgcfg/help.c
+++ /dev/null
@@ -1,1786 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.8 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Paned.h>
-
-#include <X11/Xaw/Text.h>
-#include <X11/Xaw/TextSinkP.h>
-#include <X11/Xaw/TextSrcP.h>
-#include <X11/Xmu/SysUtil.h>
-#include <X11/Xmu/Xmu.h>
-#include <stdlib.h> /* for bsearch() */
-#include <ctype.h>
-#include "help.h"
-#include "options.h"
-
-/*
- * Prototypes
- */
-static void CloseCallback(Widget, XtPointer, XtPointer);
-static void StartHelp(void);
-void Html_ModeStart(Widget);
-
-/*
- * Initialization
- */
-static Widget shell, text;
-static Bool popped_up = False;
-
-/*
- * Implementation
- */
-void
-Help(char *topic)
-{
- Widget source;
- char *str = NULL;
- Bool error = False;
- static char *def_text = "<h2>Help Error</h2>"
- "No help available for the topic <b>%s</b>.";
- XtResource resource = {
- NULL, "HelpMessage", XtRString, sizeof(char*),
- 0, XtRString, NULL
- };
-
- StartHelp();
- source = XawTextGetSource(text);
- XawTextSourceClearEntities(source, 0,
- XawTextSourceScan(source, 0, XawstAll,
- XawsdRight, 1, True));
- if (topic != NULL) {
- resource.resource_name = topic;
- XtGetApplicationResources(shell, (XtPointer)&str,
- &resource, 1, NULL, 0);
- }
- if (str == NULL) {
- int len;
-
- error = True;
- if (topic == NULL)
- topic = "(null argument)";
- str = XtMalloc(len = strlen(topic) + strlen(def_text) + 1);
- XmuSnprintf(str, len, def_text, topic);
- }
- XtVaSetValues(text, XtNstring, str, NULL, 0);
- if (error)
- XtFree(str);
-
- Html_ModeStart(source);
- _XawTextBuildLineTable((TextWidget)text,
- XawTextTopPosition(text), True);
- XawTextDisplay(text);
- if (popped_up == False) {
- popped_up = True;
- XtPopup(shell, XtGrabNone);
- XtSetKeyboardFocus(shell, text);
- }
-}
-
-static void
-StartHelp(void)
-{
- static XtResource resource = {
- "properties", "Properties", XtRString, sizeof(char*),
- 0, XtRString, NULL
- };
-
- if (shell == NULL) {
- Widget pane, commands, close;
- char *props;
- XawTextPropertyList *propl;
-
- shell = XtCreatePopupShell("help", transientShellWidgetClass,
- toplevel, NULL, 0);
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
- shell, NULL, 0);
- text = XtVaCreateManagedWidget("text", asciiTextWidgetClass,
- pane, XtNeditType, XawtextRead, NULL, 0);
- commands = XtCreateManagedWidget("commands", formWidgetClass, pane,
- NULL, 0);
- close = XtCreateManagedWidget("close", commandWidgetClass,
- commands, NULL, 0);
- XtAddCallback(close, XtNcallback, CloseCallback, NULL);
- XtRealizeWidget(shell);
- XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
- XtGetApplicationResources(text, (XtPointer)&props,
- &resource, 1, NULL, 0);
- propl = XawTextSinkConvertPropertyList("html", props,
- toplevel->core.screen,
- toplevel->core.colormap,
- toplevel->core.depth);
- XtVaSetValues(XawTextGetSink(text), XawNtextProperties, propl, NULL, 0);
- }
-}
-
-/*ARGSUSED*/
-static void
-CloseCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtPopdown(shell);
- popped_up = False;
-}
-
-/*ARGSUSED*/
-void
-HelpCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- CloseCallback(w, NULL, NULL);
-}
-
-
-/* bellow is a modified version of the html-mode.c I wrote for xedit
- * (at least) temporarily dead.
- */
-
-/*
- * Copyright (c) 1999 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- *
- * Author: Paulo César Pereira de Andrade
- */
-
-#define Html_Peek(parser) ((parser)->next)
-
-/*
- * Types
- */
-typedef struct _Html_Parser Html_Parser;
-typedef struct _Html_Item Html_Item;
-
-typedef struct _Html_TagInfo {
- char *name;
- unsigned int entity : 1; /* it changes the type of the text */
- unsigned int nest : 1; /* does not close tags automatically */
- unsigned int end : 1; /* need a close markup */
- unsigned int adnl : 1; /* add newline before/after tag contents */
- unsigned int para : 1; /* changes the paragraph formatting */
- unsigned long mask; /* enforce use of attributes of this tag-info */
- unsigned long xlfd_mask;
- void (*parse_args)(Html_Parser*, Html_Item*);
- XawTextProperty *override;
- XrmQuark ident;
-} Html_TagInfo;
-
-struct _Html_Item {
- XrmQuark ident;
- XawTextPosition start, end;
- Html_TagInfo *info;
-
- XawTextProperty *combine;
- Bool override;
- int li;
-
- XtPointer replace;
-
- Html_Item *parent, *child, *next;
-};
-
-struct _Html_Parser {
- Widget source;
- XawTextBlock block, replace;
- XawTextPosition position, offset, start, end, last;
- XrmQuark quark;
- int i, ch, next;
- Html_Item *item, *head;
- XmuScanline *mask;
- int space, pre, adnl, list, desc, column;
- Bool spc;
- XawTextBlock *entity;
-
- Pixel alink;
-};
-
-typedef struct _Html_SourceInfo Html_SourceInfo;
-struct _Html_SourceInfo {
- Widget source;
- XawTextBlock block;
- XawTextPosition last;
- Html_SourceInfo *next;
-};
-
-/*
- * Proptotypes
- */
-void Html_ModeEnd(Widget);
-static void Html_ModeInit(void);
-static void Html_ParseCallback(Widget, XtPointer, XtPointer);
-static Html_TagInfo *Html_GetInfo(char*);
-static int Html_Get(Html_Parser*);
-static int Html_Parse1(Html_Parser*);
-static int Html_Parse2(Html_Parser*);
-static void Html_ParseTag(Html_Parser*);
-static void Html_Commit(Html_Parser*);
-static void Html_AddEntities(Html_Parser*, Html_Item*);
-
-static int Html_Put(Html_Parser*, int);
-static void Html_Puts(Html_Parser*, char*);
-static int Html_Format1(Html_Parser*);
-static int Html_Format2(Html_Parser*);
-static int Html_Format3(Html_Parser*);
-static void Html_FormatTag(Html_Parser*);
-
-static void Html_AArgs(Html_Parser*, Html_Item*);
-static void Html_FontArgs(Html_Parser*, Html_Item*);
-
-/*
- * Initialization
- */
-static XrmQuark
- Qbr,
- Qdefault,
- Qdd,
- Qdl,
- Qdt,
- Qentity,
- Qetag,
- Qhide,
- Qli,
- Qol,
- Qp,
- Qpre,
- Qspace,
- Qtag,
- Qul;
-
-static Html_TagInfo tag_info[] = {
- {"a", 1, 0, 1, 0, 0,
- 0, 0,
- Html_AArgs},
- {"address", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_SLANT,
- },
- {"b", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_WEIGHT,
- },
- {"blockquote", 0, 1, 1, 1, 1,
- 0, 0,
- },
- {"body", 0, 0, 1, 0, 0,
- 0, 0,
- },
- {"br", 0, 0, 0, 0, 0,
- },
- {"code", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
- },
- {"dd", 0, 1, 1, 0, 1,
- 0, 0},
- {"dl", 0, 1, 1, 0, 0,
- 0, 0,
- },
- {"dt", 0, 0, 1, 0, 0,
- 0, 0},
- {"em", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_SLANT,
- },
- {"font", 1, 1, 1, 0, 0,
- 0, 0,
- Html_FontArgs},
- {"h1", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"h2", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"h3", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"h4", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"h5", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"h6", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
- },
- {"head", 0, 0, 1, 0, 0,
- 0, 0,
- },
- {"html", 0, 0, 1, 0, 0,
- 0, 0,
- },
- {"i", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_SLANT,
- },
- {"kbd", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
- },
- {"li", 0, 0, 0, 0, 0,
- 0, 0},
- {"ol", 0, 1, 1, 0, 1,
- 0, 0,
- },
- {"p", 0, 0, 0, 1, 0,
- },
- {"pre", 1, 0, 1, 1, 0,
- 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
- },
- {"samp", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
- },
- {"strong", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_WEIGHT,
- },
- {"tt", 1, 0, 1, 0, 0,
- 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
- },
- {"ul", 0, 1, 1, 0, 1,
- 0, 0,
- },
-};
-
-static char *pnl = "<p>\n", *nlpnl = "\n<p>\n";
-static Html_SourceInfo *source_info;
-
-/*
- * Implementation
- */
-static char *
-Html_GetText(Widget src, XawTextPosition position)
-{
- char *result, *tempResult;
- XawTextPosition offset = 0;
- XawTextBlock text;
-
- tempResult = result = XtMalloc((unsigned)(position + 1));
-
- while (offset < position) {
- offset = XawTextSourceRead(src, offset, &text, position - offset);
- if (!text.length)
- break;
- memcpy(tempResult, text.ptr, (unsigned)text.length);
- tempResult += text.length;
- }
-
- *tempResult = '\0';
-
- return (result);
-}
-
-void
-Html_ModeStart(Widget src)
-{
- Html_Parser *parser = XtNew(Html_Parser);
- Html_Item *next, *item;
- XColor color, exact;
- Html_SourceInfo *info = XtNew(Html_SourceInfo);
-
- if (XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap,
- "blue", &color, &exact))
- parser->alink = color.pixel;
- else
- parser->alink = 0L;
-
- XtVaSetValues(src, XtNeditType, XawtextEdit, NULL, 0);
-
- Html_ModeInit();
-
- /* initialize parser state */
- parser->source = src;
- parser->position = XawTextSourceRead(parser->source, 0,
- &parser->block, 4096);
- parser->replace.ptr = NULL;
- parser->replace.firstPos = 0;
- parser->replace.length = 0;
- parser->replace.format = FMT8BIT;
- parser->offset = -1;
- parser->quark = NULLQUARK;
- parser->i = 0;
- parser->i = parser->ch = parser->next = 0;
- parser->last = XawTextSourceScan(src, 0, XawstAll, XawsdRight, 1, 1);
- if (parser->block.length == 0)
- parser->ch = parser->next = EOF;
- else
- (void)Html_Get(parser);
- parser->pre = 0;
- parser->adnl = 1;
- parser->list = parser->desc = parser->column = 0;
- parser->spc = True;
-
- info->source = src;
- info->block.ptr = Html_GetText(src, parser->last);
- info->block.length = parser->last;
- info->block.format = FMT8BIT;
- info->block.firstPos = 0;
- info->next = NULL;
- if (source_info == NULL)
- source_info = info;
- else {
- Html_SourceInfo *tmp = source_info;
-
- while (tmp->next)
- tmp = tmp->next;
- tmp->next = info;
- }
-
- while (Html_Format1(parser) != EOF)
- ;
- XawTextSourceReplace(parser->source, 0, parser->last, &parser->replace);
- XtFree(parser->replace.ptr);
-
- /* re-initialize parser state */
- parser->position = XawTextSourceRead(parser->source, 0,
- &parser->block, 4096);
- parser->offset = -1;
- parser->quark = NULLQUARK;
- parser->i = parser->ch = parser->next = 0;
- parser->last = XawTextSourceScan(src, 0, XawstAll, XawsdRight, 1, 1);
- info->last = parser->last;
- if (parser->block.length == 0)
- parser->ch = parser->next = EOF;
- else
- (void)Html_Get(parser);
- parser->adnl = 1;
- parser->list = parser->desc = parser->column = 0;
- parser->spc = True;
- parser->head = parser->item = NULL;
-
- parser->mask = XmuNewScanline(0, 0, 0);
-
- /* build html structure information */
- while (Html_Parse1(parser) != EOF)
- ;
-
- /* create top level entity mask */
- (void)XmuScanlineNot(parser->mask, 0, parser->last);
-
- item = parser->item;
- while (item) {
- next = item->next;
- Html_AddEntities(parser, item);
- if (item->combine)
- XtFree((XtPointer)item->combine);
- XtFree((XtPointer)item);
- item = next;
- }
- XmuDestroyScanline(parser->mask);
-
- XtVaSetValues(src, XtNeditType, XawtextRead, NULL, 0);
-
- XtFree((XtPointer)parser);
-
- /* add callbacks for interactive changes */
- XtAddCallback(src, XtNpropertyCallback, Html_ParseCallback, NULL);
-}
-
-void
-Html_ModeEnd(Widget src)
-{
- Html_SourceInfo *info, *pinfo;
-
- XtRemoveCallback(src, XtNpropertyCallback, Html_ParseCallback, NULL);
- for (pinfo = info = source_info; info; pinfo = info, info = info->next)
- if (info->source == src)
- break;
-
- if (info == NULL)
- return;
-
- XawTextSourceClearEntities(src, 0, info->last);
- XtVaSetValues(src, XtNeditType, XawtextEdit, NULL, 0);
- XawTextSourceReplace(src, 0, info->last, &info->block);
- XtVaSetValues(src, XtNeditType, XawtextRead, NULL, 0);
-
- if (info == source_info)
- source_info = source_info->next;
- else
- pinfo->next = info->next;
- XtFree(info->block.ptr);
- XtFree((XtPointer)info);
-}
-
-static void
-Html_ParseCallback(Widget w, XtPointer client_data, XtPointer call_data)
-{
-}
-
-static int
-bcmp_tag_info(_Xconst void *left, _Xconst void *right)
-{
- return (strcmp((char*)left, ((Html_TagInfo*)right)->name));
-}
-
-static Html_TagInfo *
-Html_GetInfo(char *name)
-{
- return (bsearch(name, tag_info, sizeof(tag_info) / sizeof(tag_info[0]),
- sizeof(Html_TagInfo), bcmp_tag_info));
-}
-
-static int
-Html_Get(Html_Parser *parser)
-{
- if (parser->ch == EOF)
- return (EOF);
- if (parser->i >= parser->block.length) {
- parser->i = 0;
- parser->position = XawTextSourceRead(parser->source, parser->position,
- &parser->block, 4096);
- }
- parser->ch = parser->next;
- if (parser->block.length == 0)
- parser->next = EOF;
- else
- parser->next = (unsigned char)parser->block.ptr[parser->i++];
- parser->offset++;
-
- return (parser->ch);
-}
-
-static void
-Html_ModeInit(void)
-{
- static int initialized;
- int i;
-
- if (initialized)
- return;
-
- Qbr = XrmPermStringToQuark("br");
- Qdd = XrmPermStringToQuark("dd");
- Qdefault = XrmPermStringToQuark("default");
- Qdl = XrmPermStringToQuark("dl");
- Qdt = XrmPermStringToQuark("dt");
- Qentity = XrmPermStringToQuark("entity");
- Qetag = XrmPermStringToQuark("/tag");
- Qhide = XrmPermStringToQuark("hide");
- Qli = XrmPermStringToQuark("li");
- Qol = XrmPermStringToQuark("ol");
- Qp = XrmPermStringToQuark("p");
- Qpre = XrmPermStringToQuark("pre");
- Qspace = XrmPermStringToQuark("space");
- Qtag = XrmPermStringToQuark("tag");
- Qul = XrmPermStringToQuark("ul");
-
- for (i = 0; i < sizeof(tag_info) / sizeof(tag_info[0]); i++)
- tag_info[i].ident = XrmPermStringToQuark(tag_info[i].name);
-
- initialized = True;
-}
-
-/************************************************************************/
-/* PARSE */
-/************************************************************************/
-static void
-Html_AddEntities(Html_Parser *parser, Html_Item *item)
-{
- Html_Item *parent, *next, *child = item->child;
- XmuSegment segment, *ent;
- XmuScanline *mask = XmuNewScanline(0, 0, 0);
- XawTextProperty *tprop, *property = NULL;
- Widget sink;
- Bool changed = False;
-
- /* combine properties */
- if (item->info &&
- (item->info->entity ||
- (item->parent && item->parent->ident != item->parent->info->ident))) {
- sink = XawTextGetSink(text);
- parent = item->parent;
- property = XawTextSinkCopyProperty(sink, item->ident);
- property->mask = item->info->mask;
- property->xlfd_mask = item->info->xlfd_mask;
- if (parent) {
- (void)XawTextSinkCombineProperty(sink, property,
- XawTextSinkGetProperty(sink, parent->ident), False);
- if (item->combine && parent->combine)
- (void)XawTextSinkCombineProperty(sink, item->combine,
- parent->combine,
- item->override);
- }
- if (item->combine)
- XawTextSinkCombineProperty(sink, property, item->combine, True);
- tprop = property;
- property = XawTextSinkAddProperty(sink, property);
- XtFree((XtPointer)tprop);
- if (property && item->ident != property->identifier) {
- item->ident = property->identifier;
- changed = True;
- }
- }
-
- if (item->end < 0) {
- if (item->next)
- item->end = item->next->start;
- else if (item->parent)
- item->end = item->parent->end;
- else
- item->end = parser->last;
- }
-
- while (child) {
- next = child->next;
- segment.x1 = child->start;
- segment.x2 = child->end;
- (void)XmuScanlineOrSegment(mask, &segment);
- Html_AddEntities(parser, child);
- if (child->combine)
- XtFree((XtPointer)child->combine);
- XtFree((XtPointer)child);
- child = next;
- }
-
- /* build entity mask */
- (void)XmuScanlineNot(mask, item->start, item->end);
- (void)XmuScanlineAnd(mask, parser->mask);
-
- /* add entities */
- if (item->info && changed) {
- for (ent = mask->segment; ent; ent = ent->next)
- (void)XawTextSourceAddEntity(parser->source, 0, 0, NULL, ent->x1,
- ent->x2 - ent->x1, item->ident);
- }
- else if (item->info == NULL)
- (void)XawTextSourceAddEntity(parser->source, 0,
- XAW_TENTF_READ | XAW_TENTF_REPLACE,
- item->replace, item->start,
- item->end - item->start,
- item->parent->ident);
-
- /* set mask for parent entities */
- (void)XmuScanlineOr(parser->mask, mask);
- XmuDestroyScanline(mask);
-
-#if 0
- if (item->info && item->info->para) {
- XawTextSourceSetParagraph(parser->source, item->start, item->end,
- 40, /* arbitrary value, for testing */
- 0, 0);
- }
-#endif
-}
-
-static void
-Html_Commit(Html_Parser *parser)
-{
- XawTextPosition position;
- int length;
-
- position = parser->start;
- length = parser->end - parser->start;
- if (position < 0) {
- length += position;
- position = 0;
- }
- if (position + length > parser->last + 1)
- length -= (position + length) - parser->last + 1;
-
- if (parser->quark != Qdefault && parser->quark != NULLQUARK && length > 0) {
- XmuSegment segment;
- Html_Item *head = parser->head;
- XrmQuark quark = parser->quark;
-
- parser->quark = Qdefault;
-
- if (quark == Qli && head &&
- (head->info->ident == Qol || head->info->ident == Qul)) {
- if (parser->head == NULL || head->info->ident != Qol)
- XawTextSourceAddEntity(parser->source, 0, /*XAW_TENT_BULLET,*/
- XAW_TENTF_HIDE, NULL,
- position, length, Qli);
- else
- XawTextSourceAddEntity(parser->source, 0, /*XAW_TENT_LITEM,*/
- XAW_TENTF_HIDE,
- (XtPointer)(long)head->li++,
- position, length, Qli);
- }
- else if (quark == Qhide)
- XawTextSourceAddEntity(parser->source, 0, XAW_TENTF_HIDE, NULL,
- position, length, quark);
- else if (quark == Qentity) {
- if (head && head->end == -1) {
- Html_Item *item, *it;
-
- item = XtNew(Html_Item);
- item->ident = Qentity;
- item->start = position;
- item->end = position + length;
- item->info = NULL;
- item->combine = NULL;
- item->override = False;
- item->replace = (XtPointer)parser->entity;
- item->child = item->next = NULL;
-
- it = head->child;
-
- item->parent = head;
- if (it == NULL)
- head->child = item;
- else {
- while (it->next)
- it = it->next;
- it->next = item;
- }
-
- return;
- }
- XawTextSourceAddEntity(parser->source, 0,
- XAW_TENTF_READ | XAW_TENTF_REPLACE,
- (XtPointer)parser->entity,
- position, length, Qentity);
- }
-
- segment.x1 = position;
- segment.x2 = position + length;
- (void)XmuScanlineOrSegment(parser->mask, &segment);
- }
-}
-
-static void
-Html_ParseTag(Html_Parser *parser)
-{
- int ch, sz;
- char buf[32];
- Html_TagInfo *info;
- Html_Item *item = NULL;
- XawTextPosition offset = parser->offset - 1;
-
- switch (Html_Peek(parser)) {
- case '!':
- (void)Html_Get(parser); /* eat `!' */
- if (Html_Peek(parser) == '-') {
- /* comment */
- (void)Html_Get(parser); /* eat `-' */
- if (Html_Peek(parser) == '-') {
- int count = 0;
-
- (void)Html_Get(parser);
- while ((ch = Html_Peek(parser)) != EOF) {
- if (ch == '>' && count >= 2)
- break;
- else if (ch == '-')
- ++count;
- else
- count = 0;
- (void)Html_Get(parser);
- }
- }
- }
- break;
- case '?':
- break;
- case '/':
- (void)Html_Get(parser); /* eat `/' */
- sz = 0;
- while (isalnum(Html_Peek(parser)) &&
- sz <= sizeof(buf) + 1)
- buf[sz++] = tolower(Html_Get(parser));
- buf[sz] = '\0';
- if ((info = Html_GetInfo(buf)) != NULL) {
- if (parser->head) {
- Html_Item *it = parser->head;
-
- while (it) {
- if (it->info == info)
- break;
- it = it->parent;
- }
-
- if (it) {
- if (it == parser->head)
- parser->head->end = offset;
- else {
- it->end = offset;
- do {
- parser->head->end = offset;
- parser->head = parser->head->parent;
- } while (parser->head != it);
- }
- if (parser->head->parent)
- parser->head = parser->head->parent;
- else
- parser->head = parser->item;
- }
- }
- }
- break;
- default:
- sz = 0;
- while (isalnum(Html_Peek(parser)) &&
- sz <= sizeof(buf) + 1)
- buf[sz++] = tolower(Html_Get(parser));
- buf[sz] = '\0';
- if ((info = Html_GetInfo(buf)) != NULL) {
- if (info->end == False) {
- if (info->ident == Qli)
- parser->quark = Qli;
- if (!info->para)
- break; /* no more processing required */
- }
- item = XtNew(Html_Item);
- item->info = info;
- item->ident = item->info->ident;
- item->combine = NULL;
- item->override = False;
- item->start = item->end = -1;
- if (info->ident == Qol)
- item->li = 1;
- else
- item->li = 0;
- item->parent = item->child = item->next = NULL;
- if (parser->item == NULL)
- parser->item = parser->head = item;
- else if (parser->head->end == -1) {
- if (parser->head->info != item->info || info->nest) {
- Html_Item *it = parser->head;
-
- /* first, see if we need to close a long list of tags */
- if (info->ident == Qdd) {
- if (parser->head &&
- parser->head->info->ident == Qdt) {
- parser->head->end = offset;
- parser->head = parser->head->parent;
- }
- }
- else if (info->ident == Qdt) {
- if (parser->head &&
- parser->head->info->ident == Qdd) {
- parser->head->end = offset;
- parser->head = parser->head->parent;
- }
- }
- else if (!info->nest) {
- while (it) {
- if (it->info == info || it->info->end)
- break;
- it = it->parent;
- }
- if (it) {
- /* close the items */
- while (parser->head != it) {
- if (parser->head->info->ident == Qpre)
- --parser->pre;
- parser->head->end = offset;
- parser->head = parser->head->parent;
- }
- }
- }
-
- /* add child item */
- it = parser->head->child;
-
- item->parent = parser->head;
- if (it == NULL)
- parser->head->child = item;
- else {
- while (it->next)
- it = it->next;
- it->next = item;
- }
- parser->head = item;
- }
- else {
- /* close the `head' item and start a new one */
- Html_Item *it;
-
- parser->head->end = offset;
- if (parser->head->parent)
- parser->head = parser->head->parent;
- else
- parser->head = parser->item;
-
- if ((it = parser->head->child) != NULL) {
- item->parent = parser->head;
- while (it->next)
- it = it->next;
- it->next = item;
- parser->head = item;
- }
- else {
- parser->head->child = item;
- parser->head = item;
- }
- }
- }
- else {
- /* this is not common, but handle it */
- Html_Item *it = parser->item;
-
- while (it->next)
- it = it->next;
- it->next = item;
- parser->head = item;
- }
- if (info->parse_args)
- (info->parse_args)(parser, item);
- }
- break;
- }
-
- /* skip anything not processed */
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
- (void)Html_Get(parser);
- if (item && item->start == -1)
- item->start = parser->offset + 1;
-}
-
-/* tags */
-static int
-Html_Parse2(Html_Parser *parser)
-{
- int ch;
-
- for (;;) {
- if ((ch = Html_Get(parser)) == '<') {
- parser->end = parser->offset - 1;
- Html_Commit(parser);
- parser->quark = Qhide;
- parser->start = parser->end;
-
- Html_ParseTag(parser);
-
- (void)Html_Get(parser); /* eat `>' */
- parser->end = parser->offset;
- Html_Commit(parser);
- }
- else
- return (ch);
- }
- /*NOTREACHED*/
-}
-
-/* entities */
-static int
-Html_Parse1(Html_Parser *parser)
-{
- static XawTextBlock *entities[256];
- static char chars[256];
- int ch;
-
- for (;;) {
- if ((ch = Html_Parse2(parser)) == EOF)
- return (EOF);
-
- if (ch == '&') {
- unsigned char idx = '?';
- char buf[32];
- int sz = 0;
-
- /* the string comparisons need a big optmization! */
- parser->end = parser->offset - 1;
- Html_Commit(parser);
- parser->start = parser->end;
- while ((ch = Html_Peek(parser)) != ';'
- && ch != EOF && !isspace(ch)) {
- ch = Html_Get(parser);
- if (sz + 1 <= sizeof(buf))
- buf[sz++] = ch;
- }
- buf[sz] = '\0';
- if (ch == ';')
- (void)Html_Get(parser);
- if (sz == 0)
- idx = '&';
- else if (strcasecmp(buf, "lt") == 0)
- idx = '<';
- else if (strcasecmp(buf, "gt") == 0)
- idx = '>';
- else if (strcasecmp(buf, "nbsp") == 0)
- idx = ' ';
- else if (strcasecmp(buf, "amp") == 0)
- idx = '&';
- else if (strcasecmp(buf, "quot") == 0)
- idx = '"';
- else if (*buf == '#') {
- if (sz == 1)
- idx = '#';
- else {
- char *tmp;
-
- idx = strtol(buf + 1, &tmp, 10);
- if (*tmp)
- idx = '?';
- }
- }
- else if (strcmp(buf + 1, "acute") == 0) {
- switch (*buf) {
- case 'a': idx = 'á'; break; case 'e': idx = 'é'; break;
- case 'i': idx = 'í'; break; case 'o': idx = 'ó'; break;
- case 'u': idx = 'ú'; break; case 'A': idx = 'Á'; break;
- case 'E': idx = 'É'; break; case 'I': idx = 'Í'; break;
- case 'O': idx = 'Ó'; break; case 'U': idx = 'Ú'; break;
- case 'y': idx = 'ý'; break; case 'Y': idx = 'Ý'; break;
- }
- }
- else if (strcmp(buf + 1, "grave") == 0) {
- switch (*buf) {
- case 'a': idx = 'à'; break; case 'e': idx = 'è'; break;
- case 'i': idx = 'ì'; break; case 'o': idx = 'ò'; break;
- case 'u': idx = 'ù'; break; case 'A': idx = 'À'; break;
- case 'E': idx = 'È'; break; case 'I': idx = 'Ì'; break;
- case 'O': idx = 'Ò'; break; case 'U': idx = 'Ù'; break;
- }
- }
- else if (strcmp(buf + 1, "tilde") == 0) {
- switch (*buf) {
- case 'a': idx = 'ã'; break; case 'o': idx = 'õ'; break;
- case 'n': idx = 'ñ'; break; case 'A': idx = 'Ã'; break;
- case 'O': idx = 'Õ'; break; case 'N': idx = 'Ñ'; break;
- }
- }
- else if (strcmp(buf + 1, "circ") == 0) {
- switch (*buf) {
- case 'a': idx = 'â'; break; case 'e': idx = 'ê'; break;
- case 'i': idx = 'î'; break; case 'o': idx = 'ô'; break;
- case 'u': idx = 'û'; break; case 'A': idx = 'Â'; break;
- case 'E': idx = 'Ê'; break; case 'I': idx = 'Î'; break;
- case 'O': idx = 'Ô'; break; case 'U': idx = 'Û'; break;
- }
- }
- else if (strcmp(buf + 1, "uml") == 0) {
- switch (*buf) {
- case 'a': idx = 0xe4;break; case 'e': idx = 0xeb;break;
- case 'i': idx = 0xef;break; case 'o': idx = 0xf6;break;
- case 'u': idx = 'ü'; break; case 'A': idx = 0xc4;break;
- case 'E': idx = 0xcb;break; case 'I': idx = 0xfc;break;
- case 'O': idx = 0xd6;break; case 'U': idx = 'Ü'; break;
- case 'y': idx = 0xff;break;
- }
- }
- else if (strcmp(buf + 1, "cedil") == 0) {
- switch (*buf) {
- case 'c': idx = 'ç'; break; case 'C': idx = 'Ç'; break;
- }
- }
- else if (strcmp(buf + 1, "slash") == 0) {
- switch (*buf) {
- case 'o': idx = 0xf8; break;case 'O': idx = 0xd8; break;
- }
- }
- else if (strcmp(buf + 1, "ring") == 0) {
- switch (*buf) {
- case 'a': idx = 0xe5; break;case 'A': idx = 0xc5; break;
- }
- }
- else if (strcasecmp(buf, "iexcl") == 0)
- idx = 0xa1;
- else if (strcasecmp(buf, "cent") == 0)
- idx = 0xa2;
- else if (strcasecmp(buf, "pound") == 0)
- idx = 0xa3;
- else if (strcasecmp(buf, "curren") == 0)
- idx = 0xa4;
- else if (strcasecmp(buf, "yen") == 0)
- idx = 0xa5;
- else if (strcasecmp(buf, "brvbar") == 0)
- idx = 0xa6;
- else if (strcasecmp(buf, "sect") == 0)
- idx = 0xa7;
- else if (strcasecmp(buf, "uml") == 0)
- idx = 0xa8;
- else if (strcasecmp(buf, "copy") == 0)
- idx = 0xa9;
- else if (strcasecmp(buf, "ordf") == 0)
- idx = 'ª';
- else if (strcasecmp(buf, "laquo") == 0)
- idx = 0xab;
- else if (strcasecmp(buf, "not") == 0)
- idx = 0xac;
- else if (strcasecmp(buf, "shy") == 0)
- idx = 0xad;
- else if (strcasecmp(buf, "reg") == 0)
- idx = 0xae;
- else if (strcasecmp(buf, "macr") == 0)
- idx = 0xaf;
- else if (strcasecmp(buf, "deg") == 0)
- idx = '°';
- else if (strcasecmp(buf, "plusmn") == 0)
- idx = 0xb1;
- else if (strcasecmp(buf, "sup2") == 0)
- idx = '²';
- else if (strcasecmp(buf, "sup3") == 0)
- idx = '³';
- else if (strcasecmp(buf, "acute") == 0)
- idx = 0xb4;
- else if (strcasecmp(buf, "micro") == 0)
- idx = 0xb5;
- else if (strcasecmp(buf, "para") == 0)
- idx = 0xb6;
- else if (strcasecmp(buf, "middot") == 0)
- idx = 0xb7;
- else if (strcasecmp(buf, "cedil") == 0)
- idx = 0xb8;
- else if (strcasecmp(buf, "supl") == 0)
- idx = '¹';
- else if (strcasecmp(buf, "ordm") == 0)
- idx = 'º';
- else if (strcasecmp(buf, "raquo") == 0)
- idx = 0xbb;
- else if (strcasecmp(buf, "frac14") == 0)
- idx = 0xbc;
- else if (strcasecmp(buf, "frac12") == 0)
- idx = 0xbd;
- else if (strcasecmp(buf, "frac34") == 0)
- idx = 0xbe;
- else if (strcasecmp(buf, "iquest") == 0)
- idx = 0xbf;
- else if (strcasecmp(buf, "AElig") == 0)
- idx = 0xc6;
- else if (strcasecmp(buf, "ETH") == 0)
- idx = 0xd0;
- else if (strcasecmp(buf, "THORN") == 0)
- idx = 0xde;
- else if (strcasecmp(buf, "szlig") == 0)
- idx = 0xdf;
- else if (strcasecmp(buf, "aelig") == 0)
- idx = 0xe6;
- else if (strcasecmp(buf, "eth") == 0)
- idx = 0xf0;
- else if (strcasecmp(buf, "thorn") == 0)
- idx = 0xfe;
-
- parser->quark = Qentity;
- if (entities[idx] == NULL) {
- entities[idx] = XtNew(XawTextBlock);
- entities[idx]->firstPos = 0;
- entities[idx]->length = 1;
- entities[idx]->ptr = chars + idx;
- entities[idx]->format = FMT8BIT;
- chars[idx] = idx;
- }
- parser->entity = entities[idx];
- parser->end = parser->offset;
- Html_Commit(parser);
- parser->start = parser->end;
- }
- }
- /*NOTREACHED*/
-}
-
-/************************************************************************/
-/* FORMAT */
-/************************************************************************/
-static int
-Html_Put(Html_Parser *parser, int ch)
-{
- if (ch != '\r') {
- if (parser->replace.length % 4096 == 0)
- parser->replace.ptr = XtRealloc(parser->replace.ptr,
- parser->replace.length + 4096);
- parser->replace.ptr[parser->replace.length++] = ch;
- }
-
- return (ch);
-}
-
-static void
-Html_Puts(Html_Parser *parser, char *str)
-{
- int len = strlen(str);
-
- if (parser->replace.length % 4096 == 0 ||
- parser->replace.length + len > parser->replace.length +
- (4096 - (parser->replace.length % 4096)))
- parser->replace.ptr = XtRealloc(parser->replace.ptr,
- parser->replace.length + 4096);
- memcpy(parser->replace.ptr + parser->replace.length, str, len);
- parser->replace.length += len;
-}
-
-static void
-Html_FormatTag(Html_Parser *parser)
-{
- int ch = 0, sz = 0;
- char buf[32];
- Html_TagInfo *info = NULL;
-
- switch (Html_Peek(parser)) {
- case '!':
- Html_Put(parser, '<');
- Html_Put(parser, Html_Get(parser)); /* eat `!' */
- if (Html_Peek(parser) == '-') {
- /* comment */
- Html_Put(parser, Html_Get(parser)); /* eat `-' */
- if (Html_Peek(parser) == '-') {
- int count = 0;
-
- Html_Put(parser, Html_Get(parser));
- while ((ch = Html_Peek(parser)) != EOF) {
- if (ch == '>' && count >= 2)
- break;
- else if (ch == '-')
- ++count;
- else
- count = 0;
- Html_Put(parser, Html_Get(parser));
- }
- (void)Html_Get(parser); /* eat `>' */
- Html_Put(parser, '>');
- return;
- }
- }
- break;
- case '?':
- Html_Put(parser, '<');
- break;
- case '/':
- (void)Html_Get(parser); /* eat `/' */
- while (isalnum(Html_Peek(parser)) &&
- sz <= sizeof(buf) + 1)
- buf[sz++] = ch = tolower(Html_Get(parser));
- buf[sz] = '\0';
- if ((info = Html_GetInfo(buf)) != NULL && info->adnl) {
- if (info->ident == Qpre && parser->pre) {
- if (--parser->pre == 0)
- parser->column = 0;
- }
- parser->quark = Qetag;
- parser->spc = True;
- if (info->ident == Qp) {
- while ((ch = Html_Peek(parser) != '>' && ch != EOF))
- (void)Html_Get(parser);
- (void)Html_Get(parser); /* eat '>' */
- return;
- }
- }
- else if (info) {
- if (info->ident == Qol || info->ident == Qul) {
- if (parser->list && --parser->list == 0 &&
- parser->desc == 0) {
- parser->quark = Qetag;
- Html_Put(parser, '\n');
- ++parser->adnl;
- parser->column = 0;
- }
- }
- else if (info->ident == Qdl) {
- if (parser->desc && --parser->desc == 0 &&
- parser->list == 0) {
- parser->quark = Qetag;
- Html_Put(parser, '\n');
- ++parser->adnl;
- parser->column = 0;
- }
- }
- }
- Html_Puts(parser, "</");
- Html_Puts(parser, buf);
- break;
- default:
- while (isalnum(Html_Peek(parser)) &&
- sz <= sizeof(buf) + 1)
- buf[sz++] = tolower(Html_Get(parser));
- buf[sz] = '\0';
- if ((info = Html_GetInfo(buf)) != NULL && info->adnl) {
- if (info->ident == Qpre)
- ++parser->pre;
- if (parser->quark != Qtag) {
- if (parser->adnl < 2) {
- Html_Puts(parser, parser->adnl ? pnl : nlpnl);
- parser->adnl = 2;
- parser->spc = True;
- parser->column = 0;
- }
- }
- parser->quark = Qtag;
- if (info->ident == Qp) {
- while ((ch = Html_Peek(parser) != '>' && ch != EOF))
- (void)Html_Get(parser);
- (void)Html_Get(parser); /* eat '>' */
- return;
- }
- }
- else if (info) {
- if (info->ident == Qol || info->ident == Qul) {
- if (++parser->list == 1 && !parser->desc) {
- if (parser->adnl < 2) {
- Html_Puts(parser, parser->adnl ? pnl : nlpnl);
- parser->adnl = 2;
- parser->column = 0;
- }
- }
- else if (parser->adnl == 0) {
- Html_Put(parser, '\n');
- parser->adnl = 1;
- parser->column = 0;
- }
- parser->spc = True;
- }
- else if (info->ident == Qli) {
- if (parser->adnl == 0) {
- Html_Put(parser, '\n');
- parser->adnl = 1;
- parser->column = 0;
- }
- }
-
- else if (info->ident == Qdl) {
- if (++parser->desc == 1 && !parser->list) {
- if (parser->adnl < 2) {
- Html_Puts(parser, parser->adnl ? pnl : nlpnl);
- parser->adnl = 2;
- parser->column = 0;
- }
- }
- else if (parser->adnl == 0) {
- Html_Put(parser, '\n');
- parser->adnl = 1;
- parser->column = 0;
- }
- parser->spc = True;
- }
- else if (info->ident == Qdd) {
- if (parser->desc == 0) {
- if (parser->adnl < 2) {
- Html_Puts(parser, parser->adnl ? pnl : nlpnl);
- parser->adnl = 2;
- parser->column = 0;
- }
- }
- else if (parser->adnl == 0) {
- Html_Put(parser, '\n');
- parser->adnl = 1;
- parser->column = 0;
- }
- parser->spc = True;
- }
- else if (info->ident == Qdt) {
- if (parser->adnl == 0) {
- Html_Put(parser, '\n');
- parser->adnl = 1;
- parser->spc = True;
- parser->column = 0;
- }
- }
- }
- Html_Put(parser, '<');
- Html_Puts(parser, buf);
- break;
- }
-
- sz = 0;
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (isspace(ch)) {
- (void)Html_Get(parser);
- ++sz;
- continue;
- }
- else if (sz) {
- Html_Put(parser, ' ');
- sz = 0;
- }
- Html_Put(parser, Html_Get(parser));
- }
- Html_Put(parser, Html_Get(parser)); /* eat `>' */
- if (info && info->ident == Qbr) {
- ++parser->adnl;
- parser->spc = True;
- Html_Put(parser, '\n');
- parser->quark = info->ident;
- parser->column = 0;
- }
-}
-
-/* tags */
-static int
-Html_Format3(Html_Parser *parser)
-{
- int ch;
-
- for (;;) {
- if ((ch = Html_Get(parser)) == '<') {
- if (parser->quark == Qspace && parser->spc == False) {
- Html_Put(parser, ' ');
- parser->spc = True;
- }
-
-/* parser->quark = Qhide;*/
- Html_FormatTag(parser);
- }
- else
- return (ch);
- }
- /*NOTREACHED*/
-}
-
-/* entities */
-static int
-Html_Format2(Html_Parser *parser)
-{
- int ch;
-
- for (ch = Html_Format3(parser); ch == '&'; ch = Html_Format3(parser)) {
- Html_Put(parser, '&');
- while ((ch = Html_Peek(parser)) != ';') {
- if (isspace(ch) || ch == EOF)
- break;
- Html_Put(parser, Html_Get(parser));
- }
- if (ch != EOF)
- Html_Put(parser, Html_Get(parser));
- else
- break;
- if (parser->pre)
- ++parser->column;
- }
-
- return (ch);
-}
-
-/* spaces */
-static int
-Html_Format1(Html_Parser *parser)
-{
- int ch;
-
- for (;;) {
- if ((ch = Html_Format2(parser)) == EOF)
- return (ch);
-
- if (parser->quark == Qetag) {
- if (parser->adnl < 2) {
- Html_Puts(parser, parser->adnl ? pnl : nlpnl);
- parser->adnl = 2;
- parser->spc = True;
- }
- }
- else if (parser->quark == Qspace && parser->spc == False) {
- Html_Put(parser, ' ');
- parser->spc = True;
- }
-
- if (!parser->pre && isspace(ch))
- parser->quark = Qspace;
- else {
- if (parser->pre) {
- if (parser->spc) {
- /* did not yet see any non space character */
- if (isspace(ch)) {
- if (ch == '\n') {
- parser->column = 0;
- parser->spc = False;
- parser->adnl = 1;
- }
- else if (ch == '\t')
- parser->column += 8 - (parser->column % 8);
- else
- ++parser->column;
- continue;
- }
- else {
- int column = parser->column;
-
- while (column-- > 0)
- Html_Put(parser, ' ');
- parser->spc = False;
- parser->adnl = 0;
- }
- }
- else if (ch == '\n') {
- ++parser->adnl;
- parser->column = 0;
- }
- else if (ch == '\t') {
- int column = parser->column + (8 - (parser->column % 8));
-
- parser->adnl = 0;
- while (parser->column < column) {
- Html_Put(parser, ' ');
- ++parser->column;
- }
- continue;
- }
- else {
- parser->adnl = 0;
- ++parser->column;
- }
- }
- else
- parser->adnl = 0;
- Html_Put(parser, ch);
- parser->quark = Qdefault;
- parser->spc = False;
- }
- }
-}
-
-/************************************************************************/
-/* ARGUMENTS */
-/************************************************************************/
-static void
-Html_AArgs(Html_Parser *parser, Html_Item *item)
-{
- int ch, sz;
- char buf[32];
-
- /*CONSTCOND*/
- while (True) {
- sz = 0;
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (isalnum(ch))
- break;
- else
- (void)Html_Get(parser);
- }
-
- if (ch == '>' || ch == EOF)
- return;
- buf[sz++] = tolower(Html_Get(parser));
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
- if (isalnum(ch))
- buf[sz++] = tolower(Html_Get(parser));
- else
- break;
- buf[sz] = '\0';
- if (strcmp(buf, "href") == 0) {
- item->combine = XawTextSinkCopyProperty(XawTextGetSink(text),
- item->info->ident);
- item->override = True;
- item->combine->xlfd_mask = 0L;
- item->combine->mask = XAW_TPROP_UNDERLINE | XAW_TPROP_FOREGROUND;
- item->combine->foreground = parser->alink;
- return;
- }
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (isspace(ch))
- break;
- else
- (void)Html_Get(parser);
- }
- }
-}
-
-static void
-Html_FontArgs(Html_Parser *parser, Html_Item *item)
-{
- int ch, sz;
- char name[32], value[256], xlfd[128];
-
- item->combine = XawTextSinkCopyProperty(XawTextGetSink(text),
- Qdefault);
- item->override = True;
- item->combine->mask = item->combine->xlfd_mask = 0L;
-
- /*CONSTCOND*/
- while (True) {
- /* skip white spaces */
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (isalnum(ch))
- break;
- else
- (void)Html_Get(parser);
- }
-
- if (ch == '>' || ch == EOF)
- return;
-
- /* read option name */
- sz = 0;
- name[sz++] = tolower(Html_Get(parser));
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
- if (isalnum(ch) && sz + 1 <= sizeof(name))
- name[sz++] = tolower(Html_Get(parser));
- else
- break;
- name[sz] = '\0';
-
- if (ch != '=')
- continue;
- (void)Html_Get(parser); /* skip `=' */
- if (Html_Peek(parser) == '"')
- (void)Html_Get(parser);
-
- sz = 0;
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (!isspace(ch) && sz + 1 <= sizeof(value))
- value[sz++] = Html_Get(parser);
- else
- break;
- }
- value[sz] = '\0';
- if (sz > 0 && value[sz - 1] == '"')
- value[--sz] = '\0';
-
- if (strcmp(name, "color") == 0) {
- XColor color, exact;
-
- if (XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap,
- value, &color, &exact)) {
- item->combine->mask |= XAW_TPROP_FOREGROUND;
- item->combine->foreground = color.pixel;
- }
- }
- else if (strcmp(name, "face") == 0) {
- int count = 0;
- char *ptr, *family, **font_list;
-
- ptr = value;
- do {
- family = ptr;
- ptr = strchr(ptr, ',');
- if (ptr)
- *ptr++ = '\0';
- XmuSnprintf(xlfd, sizeof(xlfd), "-*-%s-*-*-*-*-*-*-*-*-*-*-*-*",
- family);
- font_list = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
- if (font_list)
- XFreeFontNames(font_list);
- if (count)
- break;
- } while (ptr);
- if (count) {
- item->combine->xlfd_mask |= XAW_TPROP_FAMILY;
- item->combine->family = XrmStringToQuark(family);
- }
- }
- else if (strcmp(name, "size") == 0) {
- int size, sign = 0;
-
- if (isalnum(*value)) {
- size = atoi(value);
- sign = 0;
- }
- else {
- char *str = XrmQuarkToString(item->combine->pixel_size);
-
- size = str ? atoi(str) : 12;
- if (*value == '+') {
- size += atoi(value + 1);
- sign = 1;
- }
- else if (*value == '-') {
- size -= atoi(value + 1);
- sign = -1;
- }
- }
-
- if (item->combine->xlfd != NULLQUARK) {
- int count, ucount, dcount, usize, dsize;
- char **current, **result, **up, **down;
-
- current = result = up = down = NULL;
- /* try to load an appropriate font */
- XmuSnprintf(value, sizeof(value),
- "-*-%s-%s-%s-*--%%d-*-*-*-*-*-%s-%s",
- XrmQuarkToString(item->combine->family),
- XrmQuarkToString(item->combine->weight),
- XrmQuarkToString(item->combine->slant),
- XrmQuarkToString(item->combine->registry),
- XrmQuarkToString(item->combine->encoding));
- XmuSnprintf(xlfd, sizeof(xlfd), value,
- atoi(XrmQuarkToString(item->combine->pixel_size)));
- current = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
- if (count) {
- ucount = dcount = usize = dsize = 0;
-
- XmuSnprintf(xlfd, sizeof(xlfd), value, size);
- result = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
- if (count == 0 || strstr(*result, "-0-")) {
- if (sign <= 0) {
- sz = dsize = size;
- while (dcount == 0 && --sz > size - 8 && sz > 1) {
- XmuSnprintf(xlfd, sizeof(xlfd), value, sz);
- down = XListFonts(XtDisplay(toplevel), xlfd,
- 1, &dcount);
- if (dcount && strstr(*down, "-0-") != NULL) {
- XFreeFontNames(down);
- down = NULL;
- dcount = 0;
- }
- }
- if (dcount)
- dsize = sz;
- }
- if (sign >= 0) {
- sz = usize = size;
- while (ucount == 0 && ++sz < size + 8) {
- XmuSnprintf(xlfd, sizeof(xlfd), value, sz);
- up = XListFonts(XtDisplay(toplevel), xlfd,
- 1, &ucount);
- if (ucount && strstr(*up, "-0-") != NULL) {
- XFreeFontNames(up);
- up = NULL;
- ucount = 0;
- }
- }
- if (ucount)
- usize = sz;
- }
- if (ucount && dcount)
- size = size - dsize < usize - size ? dsize : usize;
- else if (ucount)
- size = usize;
- else if (dcount)
- size = dsize;
- }
- if (current)
- XFreeFontNames(current);
- if (result)
- XFreeFontNames(result);
- if (up)
- XFreeFontNames(up);
- if (down)
- XFreeFontNames(down);
- }
- }
-
- XmuSnprintf(value, sizeof(value), "%d", size);
- item->combine->xlfd_mask |= XAW_TPROP_PIXELSIZE;
- item->combine->pixel_size = XrmStringToQuark(value);
- }
-
- while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
- if (isspace(ch))
- break;
- else
- (void)Html_Get(parser);
- }
- }
-}
diff --git a/hw/xfree86/utils/xorgcfg/help.h b/hw/xfree86/utils/xorgcfg/help.h
deleted file mode 100644
index f03e01b14..000000000
--- a/hw/xfree86/utils/xorgcfg/help.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.h,v 1.1 2000/06/13 23:15:51 dawes Exp $
- */
-
-/* help string definitions */
-#define HELP_DEVICES "helpDevices" /* Configure Layout */
-#define HELP_SCREEN "helpScreen" /* Configure Screen */
-#define HELP_MODELINE "helpModeline" /* Configure Modeline */
-#define HELP_ACCESSX "helpAccessX" /* Configure AccessX */
-
-/*
- * Prototypes
- */
-void Help(char*);
-void HelpCancelAction(Widget, XEvent*, String*, Cardinal*);
diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c
deleted file mode 100644
index 68a1873ed..000000000
--- a/hw/xfree86/utils/xorgcfg/interface.c
+++ /dev/null
@@ -1,2280 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.37 2002/10/21 04:18:36 paulo Exp $
- */
-
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <X11/Composite.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Simple.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/SmeLine.h>
-#include <X11/Xaw/SimpleMenP.h>
-#include <X11/Xaw/Dialog.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include "xf86config.h"
-#include "mouse-cfg.h"
-#include "keyboard-cfg.h"
-#include "card-cfg.h"
-#include "monitor-cfg.h"
-#include "screen-cfg.h"
-#include "screen.h"
-#include "cards.h"
-#include "options.h"
-#include "vidmode.h"
-#include "help.h"
-#include "stubs.h"
-
-#define randomize() srand((unsigned)time((time_t*)NULL))
-#ifdef PROJECT_ROOT
-#define DefaultXFree86Dir PROJECT_ROOT
-#else
-#define DefaultXFree86Dir "/usr/X11R6"
-#endif
-
-/*
- * Prototypes
- */
-void DrawCables(void);
-static void DrawCable(Display*, Window, int, int, int, int);
-static void ComputerEventHandler(Widget, XtPointer, XEvent*, Boolean*);
-void SelectDeviceAction(Widget, XEvent*, String*, Cardinal*);
-void MoveDeviceAction(Widget, XEvent*, String*, Cardinal*);
-void UnselectDeviceAction(Widget, XEvent*, String*, Cardinal*);
-void RenameLayoutAction(Widget, XEvent*, String*, Cardinal*);
-void DevicePopupMenu(Widget, XEvent*, String*, Cardinal*);
-void DevicePopdownMenu(Widget, XEvent*, String*, Cardinal*);
-void AddDeviceCallback(Widget, XtPointer, XtPointer);
-void QuitCallback(Widget, XtPointer, XtPointer);
-void SmeConfigureDeviceCallback(Widget, XtPointer, XtPointer);
-void ConfigureDeviceCallback(Widget, XtPointer, XtPointer);
-void EnableDeviceCallback(Widget, XtPointer, XtPointer);
-void DisableDeviceCallback(Widget, XtPointer, XtPointer);
-void RemoveDeviceCallback(Widget, XtPointer, XtPointer);
-void InitializeDevices(void);
-void SetConfigModeCallback(Widget, XtPointer, XtPointer);
-void SelectLayoutCallback(Widget, XtPointer, XtPointer);
-void DefaultLayoutCallback(Widget, XtPointer, XtPointer);
-void RemoveLayoutCallback(Widget, XtPointer, XtPointer);
-void OptionsCallback(Widget, XtPointer, XtPointer);
-xf86cfgDevice *AddDevice(int, XtPointer, int, int);
-static Bool AskConfig(void);
-void WriteConfigAction(Widget, XEvent*, String*, Cardinal*);
-static void ScreenSetup(Bool);
-void QuitAction(Widget, XEvent*, String*, Cardinal*);
-void PopdownErrorCallback(Widget, XtPointer, XtPointer);
-static void ErrorCancelAction(Widget, XEvent*, String*, Cardinal*);
-static void QuitCancelAction(Widget, XEvent*, String*, Cardinal*);
-static void HelpCallback(Widget, XtPointer, XtPointer);
-void UpdateMenuDeviceList(int);
-
-extern void AccessXConfigureStart(void);
-extern void AccessXConfigureEnd(void);
-extern void CloseAccessXAction(Widget, XEvent*, String*, Cardinal*);
-
-#ifdef HAS_NCURSES
-extern void TextMode(void);
-#endif
-
-static void Usage(void);
-
-/*
- * Initialization
- */
-Widget toplevel, work, config, layout, layoutsme, layoutp, topMenu;
-XtAppContext appcon;
-
-Pixmap menuPixmap;
-
-char *XF86Config_path = NULL;
-char *XF86Module_path = NULL;
-char *XFree86_path = NULL;
-char *XF86Font_path = NULL;
-char *XF86RGB_path = NULL;
-char *XkbConfig_path = NULL;
-char *XFree86Dir;
-static char XF86Config_path_static[1024];
-static char XkbConfig_path_static[1024];
-Bool xf86config_set = False;
-
-int textmode = False;
-#ifdef USE_MODULES
-int nomodules = False;
-#endif
-int noverify = False;
-
-xf86cfgComputer computer;
-xf86cfgDevice cpu_device;
-Cursor no_cursor;
-static Widget device, layoutm, popup, commands;
-static int xpos, ypos;
-int sxpos, sypos;
-static char no_cursor_data[] = { 0,0,0,0, 0,0,0,0 };
-static GC cablegc, cablegcshadow;
-Atom wm_delete_window;
-static Bool config_set = False;
-static Widget mouseSme, mouseMenu, keyboardSme, keyboardMenu,
- cardSme, cardMenu, monitorSme, monitorMenu;
-
-int config_mode = CONFIG_LAYOUT;
-
-static XtActionsRec actions[] = {
- {"filter-card", CardFilterAction},
- {"select-device", SelectDeviceAction},
- {"move-device", MoveDeviceAction},
- {"unselect-device", UnselectDeviceAction},
- {"device-popup", DevicePopupMenu},
- {"device-popdown", DevicePopdownMenu},
- {"rename-layout", RenameLayoutAction},
- {"write-config", WriteConfigAction},
- {"quit", QuitAction},
- {"vidmode-restore", VidmodeRestoreAction},
- {"config-cancel", ConfigCancelAction},
- {"options-cancel", OptionsCancelAction},
- {"error-cancel", ErrorCancelAction},
- {"quit-cancel", QuitCancelAction},
- {"addmode-cancel", CancelAddModeAction},
- {"accessx-close", CloseAccessXAction},
- {"testmode-cancel", CancelTestModeAction},
- {"help-close", HelpCancelAction},
- {"expert-close", ExpertCloseAction},
-#ifdef USE_MODULES
- {"module-options-close", ModuleOptionsCancelAction},
-#endif
-};
-
-static char *device_names[] = {
-/* MOUSE */
- "mouse",
-/* KEYBOARD */
- "keyboard",
-/* CARD */
- "card",
-/* MONITOR */
- "monitor",
-/* SCREEN */
- "screen",
-};
-
-static XtResource appResources[] = {
-#if 0
- {"xf86config", "XF86Config", XtRString, sizeof(char*),
- 0, XtRString, "/etc/X11/XF86Config"},
-#endif
- {"menuBitmap", "MenuBitmap", XtRString, sizeof(char*),
- 0, XtRString, "menu10"},
-};
-
-static void
-Usage(void)
-{
- fprintf(stderr,
-"Usage:\n"
-" xf86cfg [-option ...]\n"
-"\n"
-"Options:\n"
-" -xf86config <XF86Config> Alternate configuration file.\n"
-" -modulepath <module-path> XFree86 modules location.\n"
-" -serverpath <server-path> X server to start (if $DISPLAY is not defined).\n"
-" -fontpath <font-path> Font path for fonts.\n"
-" -rgbpath <rgb-path> Where the rgb.txt file is located.\n"
-#ifdef HAS_NCURSES
-" -textmode Use this option for the text only interface.\n"
-#endif
-#ifdef USE_MODULES
-" -nomodules Use this option if xf86cfg is slow to start.\n"
-" -verbose <number> Verbosity used in the loader (default 1).\n"
-#endif
-" -verify Verify modules/options integrity.\n"
-);
-
- exit(1);
-}
-
-/*
- * Implementation
- */
-int
-main(int argc, char *argv[])
-{
- Widget pane, hpane, expert, popup, mouse, keyboard, card, monitor;
- Widget bottom, sme, smemodeline, help, quit, layopt;
- XColor color, tmp;
- Pixmap pixmap;
- XGCValues values;
- XF86ConfLayoutPtr lay;
- int i, startedx;
- char *menuPixmapPath = NULL;
- XrmValue from, to;
-
- if ((XFree86Dir = getenv("XWINHOME")) == NULL)
- XFree86Dir = DefaultXFree86Dir;
-
- chdir(XFree86Dir);
-
-#ifdef USE_MODULES
- xf86Verbose = 1;
-#endif
- noverify = True;
-
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-xf86config") == 0) {
- if (i + 1 < argc) {
- XF86Config_path = argv[++i];
- config_set = True;
- }
- } else if (strcmp(argv[i], "-modulepath") == 0) {
- if (i + 1 < argc)
- XF86Module_path = argv[++i];
- } else if (strcmp(argv[i], "-serverpath") == 0) {
- if (i + 1 < argc)
- XFree86_path = argv[++i];
- } else if (strcmp(argv[i], "-fontpath") == 0) {
- if (i + 1 < argc)
- XF86Font_path = argv[++i];
- } else if (strcmp(argv[i], "-rgbpath") == 0) {
- if (i + 1 < argc)
- XF86RGB_path = argv[++i];
- }
-#ifdef HAS_NCURSES
- else if (strcmp(argv[i], "-textmode") == 0)
- textmode = True;
-#endif
-#ifdef USE_MODULES
- else if (strcmp(argv[i], "-nomodules") == 0)
- nomodules = True;
- else if (strcmp(argv[i], "-verbose") == 0) {
- if (i + 1 < argc)
- xf86Verbose = atoi(argv[++i]);
- }
-#endif
- else if (strcmp(argv[i], "-verify") == 0)
- noverify = False;
- else
- Usage();
- }
-
-#ifdef HAS_NCURSES
- if (textmode) {
- TextMode();
- exit(0);
- }
-#endif
-
- startedx = startx();
- if (XF86Config_path == NULL)
- XF86Config_path = XtNewString("XF86Config-4");
- if (XkbConfig_path == NULL) {
- XmuSnprintf(XkbConfig_path_static, sizeof(XkbConfig_path_static),
- "%s/%s%s", XFree86Dir, XkbConfigDir, XkbConfigFile);
- XkbConfig_path = XkbConfig_path_static;
- }
- toplevel = XtAppInitialize(&appcon, "XF86Cfg",
- NULL, 0,
- &argc, argv,
- NULL, NULL, 0);
- if (DPY == NULL)
- DPY = XtDisplay(toplevel);
-
- XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath,
- appResources, XtNumber(appResources), NULL, 0);
- if (menuPixmapPath && strlen(menuPixmapPath)) {
- from.size = strlen(menuPixmapPath);
- from.addr = menuPixmapPath;
- to.size = sizeof(Pixmap);
- to.addr = (XtPointer)&(menuPixmap);
- XtConvertAndStore(toplevel, XtRString, &from, XtRBitmap, &to);
- }
-
- XtAppAddActions(appcon, actions, XtNumber(actions));
-
- XawSimpleMenuAddGlobalActions(appcon);
- XtRegisterGrabAction(DevicePopupMenu, True,
- ButtonPressMask | ButtonReleaseMask,
- GrabModeAsync, GrabModeAsync);
-
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
- toplevel, NULL, 0);
- hpane = XtVaCreateManagedWidget("hpane", panedWidgetClass, pane,
- XtNorientation, XtorientHorizontal, NULL, 0);
- topMenu = XtCreateManagedWidget("topM", menuButtonWidgetClass,
- hpane, NULL, 0);
- expert = XtCreateManagedWidget("expert", commandWidgetClass, hpane, NULL, 0);
- XtAddCallback(expert, XtNcallback, ExpertCallback, NULL);
- popup = XtCreatePopupShell("menu", simpleMenuWidgetClass,
- topMenu, NULL, 0);
- sme = XtCreateManagedWidget("layout", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
- (XtPointer)CONFIG_LAYOUT);
- sme = XtCreateManagedWidget("screen", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
- (XtPointer)CONFIG_SCREEN);
- smemodeline = XtCreateManagedWidget("modeline", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(smemodeline, XtNcallback, SetConfigModeCallback,
- (XtPointer)CONFIG_MODELINE);
- sme = XtCreateManagedWidget("accessx", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
- (XtPointer)CONFIG_ACCESSX);
-
- commands = XtCreateManagedWidget("commands", formWidgetClass,
- pane, NULL, 0);
-
- mouse = XtVaCreateManagedWidget("mouse", menuButtonWidgetClass,
- commands, XtNmenuName, "mouseP", NULL, 0);
- popup = XtCreatePopupShell("mouseP", simpleMenuWidgetClass,
- mouse, NULL, 0);
- sme = XtCreateManagedWidget("new", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)MOUSE);
- mouseSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(mouseSme, XtNcallback, SmeConfigureDeviceCallback,
- (XtPointer)MOUSE);
-
- keyboard = XtVaCreateManagedWidget("keyboard", menuButtonWidgetClass,
- commands, XtNmenuName, "keyboardP", NULL, 0);
- popup = XtCreatePopupShell("keyboardP", simpleMenuWidgetClass,
- keyboard, NULL, 0);
- sme = XtCreateManagedWidget("new", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)KEYBOARD);
- keyboardSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(keyboardSme, XtNcallback, SmeConfigureDeviceCallback,
- (XtPointer)KEYBOARD);
-
- card = XtVaCreateManagedWidget("card", menuButtonWidgetClass,
- commands, XtNmenuName, "cardP", NULL, 0);
- popup = XtCreatePopupShell("cardP", simpleMenuWidgetClass,
- card, NULL, 0);
- sme = XtCreateManagedWidget("new", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)CARD);
- cardSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(cardSme, XtNcallback, SmeConfigureDeviceCallback,
- (XtPointer)CARD);
-
- monitor = XtVaCreateManagedWidget("monitor", menuButtonWidgetClass,
- commands, XtNmenuName, "monitorP", NULL, 0);
- popup = XtCreatePopupShell("monitorP", simpleMenuWidgetClass,
- monitor, NULL, 0);
- sme = XtCreateManagedWidget("new", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)MONITOR);
- monitorSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(monitorSme, XtNcallback, SmeConfigureDeviceCallback,
- (XtPointer)MONITOR);
-
- work = XtCreateManagedWidget("work", compositeWidgetClass,
- pane, NULL, 0);
-
- bottom = XtCreateManagedWidget("bottom", formWidgetClass,
- pane, NULL, 0);
- layoutm = XtCreateManagedWidget("select", menuButtonWidgetClass,
- bottom, NULL, 0);
- layout = XtVaCreateManagedWidget("layout", asciiTextWidgetClass,
- bottom,
- XtNeditType, XawtextEdit,
- NULL, 0);
- layoutp = XtCreatePopupShell("menu", simpleMenuWidgetClass,
- bottom, NULL, 0);
- sme = XtCreateManagedWidget("new", smeBSBObjectClass, layoutp,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, SelectLayoutCallback, NULL);
- help = XtCreateManagedWidget("help", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(help, XtNcallback, HelpCallback, NULL);
- quit = XtCreateManagedWidget("quit", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(quit, XtNcallback, QuitCallback, NULL);
-
- XtRealizeWidget(toplevel);
- XtRealizeWidget(topMenu);
-
- pixmap = XCreateBitmapFromData(XtDisplay(toplevel), XtWindow(toplevel),
- no_cursor_data, 8, 8);
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "black",
- &color, &tmp);
- no_cursor = XCreatePixmapCursor(XtDisplay(toplevel), pixmap, pixmap,
- &color, &color, 0, 0);
-
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray55",
- &color, &tmp);
- values.line_width = 3;
- values.foreground = color.pixel;
- cablegcshadow = XCreateGC(XtDisplay(toplevel), XtWindow(toplevel),
- GCForeground | GCLineWidth, &values);
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray85",
- &color, &tmp);
- values.line_width = 1;
- values.foreground = color.pixel;
- cablegc = XCreateGC(XtDisplay(toplevel), XtWindow(toplevel),
- GCForeground | GCLineWidth, &values);
-
- computer.cpu = XtCreateManagedWidget("cpu", simpleWidgetClass,
- work, NULL, 0);
- cpu_device.widget = computer.cpu;
- cpu_device.type = SERVER;
-
- XtAddEventHandler(work, ExposureMask, False,
- ComputerEventHandler, (XtPointer)NULL);
-
- wm_delete_window = XInternAtom(DPY, "WM_DELETE_WINDOW", False);
- XSetWMProtocols(DPY, XtWindow(toplevel), &wm_delete_window, 1);
-
- StartConfig();
- InitializeDevices();
- UpdateMenuDeviceList(MOUSE);
- UpdateMenuDeviceList(KEYBOARD);
- UpdateMenuDeviceList(CARD);
- UpdateMenuDeviceList(MONITOR);
- XtSetSensitive(smemodeline, VideoModeInitialize());
-
- lay = XF86Config->conf_layout_lst;
- while (lay != NULL) {
- sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
- layoutp,
- XtNlabel, lay->lay_identifier,
- XtNmenuName, lay->lay_identifier,
- XtNleftBitmap, menuPixmap,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
- if (layoutsme == NULL)
- layoutsme = sme;
- layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
- layoutp, NULL, 0);
- sme = XtCreateManagedWidget("default", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
- sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
- XtRealizeWidget(layopt);
-
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
- SelectLayoutCallback(layoutsme,
- XF86Config->conf_layout_lst, NULL);
-
- startaccessx();
- if (startedx) {
- switch (fork()) {
- case 0: {
- char path[PATH_MAX];
-
- XmuSnprintf(path, sizeof(path), "%s/bin/twm", XFree86Dir);
- execl(path, "twm", (void *)NULL);
- exit(-127);
- } break;
- case -1:
- fprintf(stderr, "Cannot fork.\n");
- exit(1);
- break;
- default:
- break;
- }
- }
-
-#ifdef USE_MODULES
- if (!nomodules)
- LoaderInitializeOptions();
-#endif
-
- /* ReadCardsDatabase() must be called after LoaderInitializeOptions() */
- ReadCardsDatabase();
-
- if (!config_set && startedx) {
- XtFree(XF86Config_path);
-#ifdef XF86CONFIG
-# ifdef XF86CONFIGDIR
- XF86Config_path = XtNewString(XF86CONFIGDIR "/" XF86CONFIG);
-# else
- XF86Config_path = XtNewString("/etc/X11/" XF86CONFIG);
-# endif
-#else
-# ifdef XF86CONFIGDIR
- XF86Config_path = XtNewString(XF86CONFIGDIR "/XF86Config-4");
-# else
- XF86Config_path = XtNewString("/etc/X11/XF86Config-4");
-# endif
-#endif
- }
- XtAppMainLoop(appcon);
- if (startedx)
- endx();
-
- return (0);
-}
-
-static Widget shell_cf;
-static int write_cf, asking_cf;
-static int cf_state = 0;
-#define CF_XF86Config 1
-#define CF_XKBConfig 2
-#define CF_First CF_XF86Config
-#define CF_Last CF_XKBConfig
-
-/*ARGSUSED*/
-static void
-WriteConfig(Widget w, XtPointer user_data, XtPointer call_data)
-{
- asking_cf = 0;
- XtPopdown(shell_cf);
- write_cf = (long)user_data;
-}
-
-/*ARGSUSED*/
-void
-QuitCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- WriteConfig(w, (XtPointer)-1, NULL);
-}
-
-/*ARGSUSED*/
-void
-WriteConfigAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- WriteConfig(w, (XtPointer)True, NULL);
-}
-
-static Bool
-AskConfig(void)
-{
- static Widget dialog;
-
- if (shell_cf == NULL) {
- Arg args[1];
- char *l, *label;
- int len;
-
- shell_cf = XtCreatePopupShell("quit", transientShellWidgetClass,
- toplevel, NULL, 0);
- dialog = XtVaCreateManagedWidget("ask", dialogWidgetClass, shell_cf,
- XtNvalue, XF86Config_path, NULL, 0);
- XawDialogAddButton(dialog, "yes", WriteConfig, (XtPointer)1);
- XawDialogAddButton(dialog, "no", WriteConfig, (XtPointer)0);
- XawDialogAddButton(dialog, "cancel", WriteConfig, (XtPointer)-1);
- XtRealizeWidget(shell_cf);
- XSetWMProtocols(DPY, XtWindow(shell_cf), &wm_delete_window, 1);
- XtSetArg(args[0], XtNlabel, &l);
- XtGetValues(dialog, args, 1);
- label = XtMalloc(len = (strlen(l) + strlen(XF86CONFIG) + 2));
- XmuSnprintf(label, len, "%s\n", XF86CONFIG);
- strcat(label, l);
- XtSetArg(args[0], XtNlabel, label);
- XtSetValues(dialog, args, 1);
- XtFree(label);
- }
- else {
- Arg args[2];
- Cardinal num_args = 0;
- char *l, *label = NULL, *str = "";
-
- XtSetArg(args[0], XtNlabel, &l);
- XtGetValues(dialog, args, 1);
- switch (cf_state) {
- case CF_XF86Config:
- str = XF86CONFIG;
- XtSetArg(args[num_args], XtNvalue, XF86Config_path);
- ++num_args;
- break;
- case CF_XKBConfig:
- str = "XKB";
- XtSetArg(args[num_args], XtNvalue, XkbConfig_path);
- ++num_args;
- break;
- }
- l = strchr(l, '\n');
- if (l != NULL) {
- label = XtMalloc(strlen(str) + strlen(l) + 1);
- strcpy(label, str);
- strcat(label, l);
- XtSetArg(args[num_args], XtNlabel, label);
- ++num_args;
- }
- XtSetValues(dialog, args, num_args);
- if (l != NULL)
- XtFree(label);
- }
-
- asking_cf = 1;
-
- XtPopup(shell_cf, XtGrabExclusive);
- while (asking_cf)
- XtAppProcessEvent(XtWidgetToApplicationContext(shell_cf), XtIMAll);
-
- if (write_cf > 0) {
- switch (cf_state) {
- case CF_XF86Config:
- XF86Config_path = XawDialogGetValueString(dialog);
- XmuSnprintf(XF86Config_path_static,
- sizeof(XF86Config_path_static),
- "%s", XF86Config_path);
- XF86Config_path = XF86Config_path_static;
- break;
- case CF_XKBConfig:
- XkbConfig_path = XawDialogGetValueString(dialog);
- XmuSnprintf(XkbConfig_path_static,
- sizeof(XkbConfig_path_static),
- "%s", XkbConfig_path);
- XkbConfig_path = XkbConfig_path_static;
- break;
- }
- }
-
- return (write_cf);
-}
-
-/*ARGSUSED*/
-void
-PopdownErrorCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtPopdown((Widget)user_data);
-}
-
-/*ARGSUSED*/
-void
-ErrorCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- XtPopdown((Widget)w);
-}
-
-/*ARGSUSED*/
-void
-QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- QuitCallback(w, NULL, NULL);
-}
-
-/*ARGSUSED*/
-void
-QuitCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- for (cf_state = CF_First; cf_state <= CF_Last; cf_state++) {
- if (cf_state == CF_XKBConfig && xkb_info == NULL)
- continue;
-
- switch (AskConfig()) {
- case 0:
- break;
- case 1:
- if ((cf_state == CF_XF86Config &&
- !xf86writeConfigFile(XF86Config_path, XF86Config)) ||
- (cf_state == CF_XKBConfig &&
- !WriteXKBConfiguration(XkbConfig_path,
- &xkb_info->config))) {
- static Widget shell;
-
- if (shell == NULL) {
- Widget dialog;
-
- shell = XtCreatePopupShell("error",
- transientShellWidgetClass,
- toplevel, NULL, 0);
- dialog = XtVaCreateManagedWidget("notice",
- dialogWidgetClass,
- shell, XtNvalue, NULL,
- NULL, 0);
- XawDialogAddButton(dialog, "ok", PopdownErrorCallback,
- (XtPointer)shell);
- XtRealizeWidget(shell);
- XSetWMProtocols(DPY, XtWindow(shell),
- &wm_delete_window, 1);
- }
- XtPopup(shell, XtGrabExclusive);
- return;
- }
- break;
- default:
- return;
- }
- }
-
- endx();
- exit(0);
-}
-
-void
-InitializeDevices(void)
-{
- xf86cfgDevice *device;
- int mouse_x, mouse_y, keyboard_x, keyboard_y,
- card_x, card_y, monitor_x, monitor_y, len;
- XF86ConfInputPtr input = XF86Config->conf_input_lst;
- XF86ConfDevicePtr card = XF86Config->conf_device_lst;
- XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
- XF86OptionPtr flags = NULL;
- char buffer[4096], *tip;
- Arg args[1];
-
- if (XF86Config->conf_flags != NULL)
- flags = XF86Config->conf_flags->flg_option_lst;
-
- len = 0;
- while (flags && len < sizeof(buffer) - 1) {
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- "Option \"%s\"",
- flags->opt_name);
- if (flags->opt_val != NULL)
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- " \"%s\"\n",
- flags->opt_val);
- else
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- "%s", "\n");
- flags = (XF86OptionPtr)(flags->list.next);
- }
-
- if (len) {
- tip = XtNewString(buffer);
- XtSetArg(args[0], XtNtip, tip);
- XtSetValues(computer.cpu, args, 1);
- }
-
-#define DEFAULT_MOUSE_WIDTH 30
-#define DEFAULT_MOUSE_HEIGHT 40
-#define DEFAULT_KEYBOARD_WIDTH 48
-#define DEFAULT_KEYBOARD_HEIGHT 36
- mouse_x = work->core.width - (work->core.width >> 2);
- mouse_y = work->core.height - DEFAULT_MOUSE_HEIGHT;
- keyboard_x = 6;
- keyboard_y = work->core.height - DEFAULT_KEYBOARD_HEIGHT;
-
- while (input != NULL) {
- if (input->inp_driver) {
- if (strcasecmp(input->inp_driver, "mouse") == 0) {
- device = AddDevice(MOUSE, (XtPointer)input, mouse_x, mouse_y);
- SetTip(device);
- if ((mouse_x += DEFAULT_MOUSE_WIDTH) > work->core.width) {
- if ((mouse_y -= DEFAULT_MOUSE_HEIGHT) < (work->core.height >> 1))
- mouse_y = work->core.height >> 1;
- mouse_x = work->core.width - (work->core.width >> 2);
- }
- }
- else if (strcasecmp(input->inp_driver, "keyboard") == 0) {
- device = AddDevice(KEYBOARD, (XtPointer)input, keyboard_x, keyboard_y);
- SetTip(device);
- if ((keyboard_x += DEFAULT_KEYBOARD_WIDTH) >
- work->core.width - (work->core.width >> 2)) {
- if ((keyboard_y -= DEFAULT_KEYBOARD_HEIGHT) < (work->core.height >> 1))
- keyboard_y = work->core.height >> 1;
- keyboard_x = 6;
- }
- }
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
-
-#define DEFAULT_CARD_WIDTH 45
-#define DEFAULT_CARD_HEIGHT 46
- card_x = 6;
- card_y = (work->core.height >> 1) - 20 - DEFAULT_CARD_HEIGHT;
- while (card != NULL) {
- device = AddDevice(CARD, (XtPointer)card, card_x, card_y);
- SetTip(device);
- if ((card_x += DEFAULT_CARD_WIDTH) > work->core.width) {
- if ((card_y -= DEFAULT_CARD_HEIGHT) < (work->core.height >> 2))
- card_y = work->core.height >> 2;
- card_x = 6;
- }
- card = (XF86ConfDevicePtr)(card->list.next);
- }
-
-#define DEFAULT_MONITOR_WIDTH 48
-#define DEFAULT_MONITOR_HEIGHT 48
- monitor_x = 6;
- monitor_y = 6;
- while (monitor != NULL) {
- XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
-
- device = AddDevice(MONITOR, (XtPointer)monitor, monitor_x, monitor_y);
- SetTip(device);
- if ((monitor_x += DEFAULT_MONITOR_WIDTH) > work->core.width) {
- if ((monitor_y += DEFAULT_MONITOR_HEIGHT) >
- (work->core.height >> 2) - DEFAULT_MONITOR_HEIGHT)
- monitor_y = (work->core.height >> 2) - DEFAULT_MONITOR_HEIGHT;
- monitor_x = 6;
- }
-
- while (screen != NULL) {
- if (screen->scrn_monitor == monitor) {
- card = XF86Config->conf_device_lst;
- while (card != NULL) {
- if (screen->scrn_device == card) {
- xf86cfgScreen *scr = (xf86cfgScreen*)
- XtCalloc(1, sizeof(xf86cfgScreen));
- int i;
-
- for (i = 0; i < computer.num_devices; i++)
- if ((XF86ConfDevicePtr)(computer.devices[i]->config)
- == card)
- break;
- scr->screen = screen;
- scr->card = computer.devices[i];
- scr->monitor = device;
- scr->refcount = 0;
- ++scr->card->refcount;
- ++scr->monitor->refcount;
- computer.screens = (xf86cfgScreen**)
- XtRealloc((XtPointer)computer.screens,
- sizeof(xf86cfgScreen*) *
- (computer.num_screens + 1));
- CreateScreenWidget(scr);
- scr->type = SCREEN;
- computer.screens[computer.num_screens++] = scr;
- SetTip((xf86cfgDevice*)scr);
- break;
- }
- card = (XF86ConfDevicePtr)(card->list.next);
- }
- device->state = USED;
- }
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
-
- monitor = (XF86ConfMonitorPtr)(monitor->list.next);
- }
-}
-
-xf86cfgDevice *
-AddDevice(int type, XtPointer config, int x, int y)
-{
- switch (type) {
- case MOUSE:
- case KEYBOARD:
- case CARD:
- case MONITOR:
- computer.devices = (xf86cfgDevice**)
- XtRealloc((XtPointer)computer.devices,
- sizeof(xf86cfgDevice*) * (computer.num_devices + 1));
- computer.devices[computer.num_devices] = (xf86cfgDevice*)
- XtCalloc(1, sizeof(xf86cfgDevice));
- computer.devices[computer.num_devices]->config = config;
- computer.devices[computer.num_devices]->widget =
- XtVaCreateManagedWidget(device_names[type], simpleWidgetClass,
- work,
- XtNx, x,
- XtNy, y,
- XtNtip, NULL,
- NULL, 0);
- computer.devices[computer.num_devices]->type = type;
- computer.devices[computer.num_devices]->state = UNUSED;
- computer.devices[computer.num_devices]->refcount = 0;
- ++computer.num_devices;
- break;
- default:
- fprintf(stderr, "Bad argument to AddDevice.\n");
- exit(1);
- return (NULL);
- }
-
- UpdateMenuDeviceList(type);
-
- return (computer.devices[computer.num_devices - 1]);
-}
-
-/*ARGSUSED*/
-static void
-HelpCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- char *topic = NULL;
-
- switch (config_mode) {
- case CONFIG_LAYOUT:
- topic = HELP_DEVICES;
- break;
- case CONFIG_SCREEN:
- topic = HELP_SCREEN;
- break;
- case CONFIG_MODELINE:
- topic = HELP_MODELINE;
- break;
- case CONFIG_ACCESSX:
- topic = HELP_ACCESSX;
- break;
- }
- Help(topic);
-}
-
-void
-SelectLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i, j;
- XF86ConfLayoutPtr lay = (XF86ConfLayoutPtr)user_data;
- XF86ConfInputrefPtr input;
- XF86ConfAdjacencyPtr adj;
- Widget sme, layopt;
- Arg args[1];
- char *str;
-
- /* XXX Needs to check computer.layout,
- * because this function should also create
- * a new layout...
- */
- if (lay == computer.layout && computer.layout)
- return;
-
- if (computer.layout != NULL) {
- for (i = 0; i < computer.num_layouts; i++) {
- if (computer.layouts[i]->layout == computer.layout)
- break;
- }
- if (i < computer.num_layouts) {
- XtFree((XtPointer)computer.layouts[i]->screen);
- XtFree((XtPointer)computer.layouts[i]->position);
- }
- else {
- computer.layouts = (xf86cfgLayout**)
- XtRealloc((XtPointer)computer.layouts, sizeof(xf86cfgLayout*) *
- (computer.num_layouts + 1));
- ++computer.num_layouts;
- }
- computer.layouts[i] = (xf86cfgLayout*)XtCalloc(1, sizeof(xf86cfgLayout));
- computer.layouts[i]->layout = computer.layout;
- computer.layouts[i]->num_layouts = computer.num_screens;
- computer.layouts[i]->screen = (xf86cfgScreen**)
- XtMalloc(sizeof(xf86cfgScreen*) * computer.num_screens);
- computer.layouts[i]->position = (XPoint*)
- XtMalloc(sizeof(XPoint) * computer.num_screens);
- for (j = 0; j < computer.num_screens; j++) {
- computer.layouts[i]->screen[j] = computer.screens[j];
- computer.layouts[i]->position[j].x = computer.screens[j]->widget->core.x;
- computer.layouts[i]->position[j].y = computer.screens[j]->widget->core.y;
- }
- }
-
- if (lay != NULL) {
- for (i = 0; i < computer.num_layouts; i++)
- if (computer.layouts[i]->layout == lay) {
- for (j = 0; j < computer.layouts[i]->num_layouts; j++) {
- int k;
-
- for (k = 0; k < computer.num_screens; k++)
- if (computer.screens[k] == computer.layouts[i]->screen[j]) {
- XtMoveWidget(computer.screens[k]->widget,
- computer.layouts[i]->position[j].x,
- computer.layouts[i]->position[j].y);
- }
- }
- break;
- }
-
- layoutsme = w;
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(w, args, 1);
- XtSetArg(args[0], XtNstring, str);
- XtSetValues(layout, args, 1);
- }
-
- computer.layout = lay;
-
- for (i = 0; i < computer.num_devices; i++)
- computer.devices[i]->state = UNUSED;
- for (i = 0; i < computer.num_screens; i++)
- computer.screens[i]->state = UNUSED;
-
- if (lay == NULL) {
- char name[64];
- XF86ConfLayoutPtr l;
- int num_layouts = 0;
-
- l = XF86Config->conf_layout_lst;
- while (l != NULL) {
- if (l->lay_adjacency_lst == NULL &&
- l->lay_inactive_lst == NULL &&
- l->lay_input_lst == NULL &&
- l->lay_option_lst == NULL &&
- l->lay_comment == NULL) {
- for (i = 0;
- i < ((CompositeWidget)layout)->composite.num_children; i++)
- if (strcmp(XtName(((CompositeWidget)layout)->composite.
- children[i]), l->lay_identifier) == 0) {
- layoutsme = ((CompositeWidget)layout)->composite.children[i];
- }
- computer.layout = l;
- XtSetArg(args[0], XtNstring, l->lay_identifier);
- XtSetValues(layout, args, 1);
- if (config_mode == CONFIG_LAYOUT)
- DrawCables();
- if (config_mode == CONFIG_SCREEN)
- ScreenSetup(True);
- return;
- }
- ++num_layouts;
- l = (XF86ConfLayoutPtr)(l->list.next);
- }
- do {
- XmuSnprintf(name, sizeof(name), "Layout%d", num_layouts);
- ++num_layouts;
- } while (xf86findLayout(name,
- XF86Config->conf_layout_lst) != NULL);
- l = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
-
- l->lay_identifier = XtNewString(name);
- XF86Config->conf_layout_lst =
- xf86addLayout(XF86Config->conf_layout_lst, l);
- layoutsme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
- layoutp,
- XtNlabel, name,
- XtNmenuName, l->lay_identifier,
- XtNleftBitmap, menuPixmap,
- NULL, 0);
- XtAddCallback(layoutsme, XtNcallback,
- SelectLayoutCallback, (XtPointer)l);
-
- layopt = XtCreatePopupShell(l->lay_identifier, simpleMenuWidgetClass,
- layoutp, NULL, 0);
- sme = XtCreateManagedWidget("default", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
- sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
- XtRealizeWidget(layopt);
-
- computer.layout = l;
- XtSetArg(args[0], XtNstring, name);
- XtSetValues(layout, args, 1);
- if (config_mode == CONFIG_LAYOUT)
- DrawCables();
- if (config_mode == CONFIG_SCREEN)
- ScreenSetup(True);
- return;
- }
-
- input = lay->lay_input_lst;
- adj = lay->lay_adjacency_lst;
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->config != NULL &&
- (computer.devices[i]->type == MOUSE ||
- computer.devices[i]->type == KEYBOARD)) {
- while (input != NULL) {
- if (strcmp(input->iref_inputdev_str, ((XF86ConfInputPtr)
- (computer.devices[i]->config))->inp_identifier) == 0) {
- computer.devices[i]->state = USED;
- break;
- }
- input = (XF86ConfInputrefPtr)(input->list.next);
- }
- input = lay->lay_input_lst;
- }
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->type == CARD) {
- while (adj != NULL) {
- XF86ConfScreenPtr screen = adj->adj_screen;
-
- if (computer.devices[i]->config != NULL &&
- strcmp(screen->scrn_device_str, ((XF86ConfDevicePtr)
- (computer.devices[i]->config))->dev_identifier) == 0) {
- int j;
-
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->card == computer.devices[i])
- break;
- computer.screens[j]->card->state = USED;
- if (computer.screens[j]->monitor != NULL)
- computer.screens[j]->monitor->state = USED;
- computer.screens[j]->state = USED;
- }
-
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- adj = lay->lay_adjacency_lst;
- }
-
- if (config_mode == CONFIG_LAYOUT)
- DrawCables();
- else if (config_mode == CONFIG_SCREEN)
- ScreenSetup(True);
-}
-
-/*ARGSUSED*/
-void
-DefaultLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Widget layopt, sme;
- int i;
- char *str;
- XF86ConfLayoutPtr prev, tmp, lay;
-
- str = w && XtParent(w) ? XtName(XtParent(w)) : NULL;
- if (str == NULL)
- return;
-
- prev = XF86Config->conf_layout_lst;
- lay = xf86findLayout(str, prev);
- if (prev == lay)
- return;
-
- tmp = prev;
- while (tmp != NULL) {
- if (tmp == lay)
- break;
- prev = tmp;
- tmp = (XF86ConfLayoutPtr)(tmp->list.next);
- }
-
- for (i = 1; i < ((CompositeWidget)layoutp)->composite.num_children; i++)
- XtDestroyWidget(((CompositeWidget)layoutp)->composite.children[i]);
- for (i = 0; i < layoutp->core.num_popups; i++)
- XtDestroyWidget(layoutp->core.popup_list[i]);
-
- prev->list.next = lay->list.next;
- lay->list.next = XF86Config->conf_layout_lst;
- XF86Config->conf_layout_lst = lay;
-
- layoutsme = NULL;
- lay = XF86Config->conf_layout_lst;
- while (lay != NULL) {
- sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
- layoutp,
- XtNlabel, lay->lay_identifier,
- XtNmenuName, lay->lay_identifier,
- XtNleftBitmap, menuPixmap,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
- if (layoutsme == NULL)
- layoutsme = sme;
- layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
- layoutp, NULL, 0);
- sme = XtCreateManagedWidget("default", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
- sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
- layopt, NULL, 0);
- XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
- XtRealizeWidget(layopt);
-
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
- SelectLayoutCallback(layoutsme,
- XF86Config->conf_layout_lst, NULL);
-}
-
-/*ARGSUSED*/
-void
-RemoveLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XF86ConfLayoutPtr prev, tmp, lay, rem;
- Widget sme = NULL;
- int i;
- char *str;
- Arg args[1];
-
- str = w && XtParent(w) ? XtName(XtParent(w)) : NULL;
- if (str == NULL)
- return;
-
- prev = XF86Config->conf_layout_lst;
- lay = xf86findLayout(str, prev);
- tmp = prev;
- while (tmp != NULL) {
- if (tmp == lay)
- break;
- prev = tmp;
- tmp = (XF86ConfLayoutPtr)(tmp->list.next);
- }
-
- rem = lay;
- if (tmp != NULL)
- lay = (XF86ConfLayoutPtr)(tmp->list.next);
- if (lay == NULL && prev != tmp)
- lay = prev;
-
- if (lay != NULL) {
- int i;
-
- for (i = 0; i < ((CompositeWidget)layoutp)->composite.num_children;
- i++) {
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(((CompositeWidget)layoutp)->composite.children[i],
- args, 1);
- if (strcmp(lay->lay_identifier, str) == 0) {
- layoutsme = ((CompositeWidget)layoutp)->composite.children[i];
- break;
- }
- }
- SelectLayoutCallback(layoutsme, lay, NULL);
- }
- else {
- computer.layout = NULL;
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(layout, args, 1);
-
- for (i = 0; i < computer.num_devices; i++)
- computer.devices[i]->state = UNUSED;
- DrawCables();
- }
-
- for (i = 0; i < ((CompositeWidget)layoutp)->composite.num_children; i++) {
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(((CompositeWidget)layoutp)->composite.children[i], args, 1);
- if (strcmp(rem->lay_identifier, str) == 0) {
- sme = ((CompositeWidget)layoutp)->composite.children[i];
- break;
- }
- }
-
- xf86removeLayout(XF86Config, rem);
- if (sme)
- XtDestroyWidget(sme);
-}
-
-void
-SetTip(xf86cfgDevice *device)
-{
- XF86OptionPtr option = NULL;
- char *tip, buffer[4096];
- Arg args[1];
- int len = 0;
-
- XtSetArg(args[0], XtNtip, &tip);
- XtGetValues(device->widget, args, 1);
-
- switch (device->type) {
- case MOUSE: {
- XF86ConfInputPtr mouse = (XF86ConfInputPtr)device->config;
-
- if (mouse == NULL)
- return;
- len = XmuSnprintf(buffer, sizeof(buffer),
- "Identifier \"%s\"\n"
- "Driver \"mouse\"\n",
- mouse->inp_identifier);
- option = mouse->inp_option_lst;
- } break;
- case KEYBOARD: {
- XF86ConfInputPtr keyboard = (XF86ConfInputPtr)device->config;
-
- if (keyboard == NULL)
- return;
- len = XmuSnprintf(buffer, sizeof(buffer),
- "Identifier \"%s\"\n"
- "Driver \"keyboard\"\n",
- keyboard->inp_identifier);
- option = keyboard->inp_option_lst;
- } break;
- case CARD: {
- XF86ConfDevicePtr card = (XF86ConfDevicePtr)device->config;
-
- if (card == NULL)
- return;
- len = XmuSnprintf(buffer, sizeof(buffer),
- "Identifier \"%s\"\n"
- "Driver \"%s\"\n",
- card->dev_identifier,
- card->dev_driver);
- option = card->dev_option_lst;
- } break;
- case MONITOR: {
- XF86ConfMonitorPtr monitor = (XF86ConfMonitorPtr)device->config;
-
- if (monitor == NULL)
- return;
- len = XmuSnprintf(buffer, sizeof(buffer),
- "Identifier \"%s\"\n"
- "Vendor \"%s\"\n",
- monitor->mon_identifier,
- monitor->mon_vendor);
- option = monitor->mon_option_lst;
- } break;
- case SCREEN: {
- XF86ConfScreenPtr screen = (XF86ConfScreenPtr)device->config;
-
- if (screen == NULL)
- return;
- len = XmuSnprintf(buffer, sizeof(buffer),
- "Identifier \"%s\"\n",
- screen->scrn_identifier);
- if (screen->scrn_device_str != NULL)
- len += XmuSnprintf(buffer + len, sizeof(buffer),
- "Device \"%s\"\n",
- screen->scrn_device_str);
- if (screen->scrn_monitor_str != NULL)
- len += XmuSnprintf(buffer + len, sizeof(buffer),
- "Monitor \"%s\"\n",
- screen->scrn_monitor_str);
- option = screen->scrn_option_lst;
- } break;
- case SERVER: {
- len = XmuSnprintf(buffer, sizeof(buffer),
- "%s\n", "Server Flags");
- option = XF86Config->conf_flags->flg_option_lst;
- } break;
- }
-
- while (option && len < sizeof(buffer) - 1) {
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- "Option \"%s\"",
- option->opt_name);
- if (option->opt_val != NULL)
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- " \"%s\"\n",
- option->opt_val);
- else
- len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
- "%s", "\n");
- option = (XF86OptionPtr)(option->list.next);
- }
-
- tip = buffer;
- XtSetArg(args[0], XtNtip, tip);
- XtSetValues(device->widget, args, 1);
-}
-
-/*ARGSUSED*/
-void
-AddDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- AddDevice((long)user_data, NULL, 6, 6);
-}
-
-void
-SmeConfigureDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
-
- switch ((long)user_data) {
- case MOUSE:
- case KEYBOARD:
- case CARD:
- case MONITOR:
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->type == (long)user_data) {
- config = computer.devices[i]->widget;
- ConfigureDeviceCallback(w, NULL, NULL);
- }
- break;
-
- /* hack for newly added devices */
- case -(MOUSE + 100):
- case -(KEYBOARD + 100):
- case -(CARD + 100):
- case -(MONITOR + 100):
- for (i = 0; i < computer.num_devices; i++)
- if (-(computer.devices[i]->type + 100) == (long)user_data &&
- computer.devices[i]->config == NULL) {
- config = computer.devices[i]->widget;
- ConfigureDeviceCallback(w, NULL, NULL);
- }
- break;
-
- default:
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->config == user_data) {
- config = computer.devices[i]->widget;
- ConfigureDeviceCallback(w, NULL, NULL);
- }
- break;
- }
-}
-
-void
-ConfigureDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i, j;
-
- if (config_mode == CONFIG_LAYOUT) {
- for (i = 0; i < computer.num_devices; i++) {
- if (computer.devices[i]->widget == config) {
- switch (computer.devices[i]->type) {
- case MOUSE: {
- XF86ConfInputPtr mouse =
- MouseConfig(computer.devices[i]->config);
-
- if (mouse != NULL && computer.devices[i]->config == NULL) {
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config->conf_input_lst,
- mouse);
- computer.devices[i]->config = (XtPointer)mouse;
- }
- SetTip(computer.devices[i]);
- } break;
- case KEYBOARD: {
- XF86ConfInputPtr keyboard =
- KeyboardConfig(computer.devices[i]->config);
-
- if (keyboard != NULL && computer.devices[i]->config == NULL) {
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config->conf_input_lst,
- keyboard);
- computer.devices[i]->config = (XtPointer)keyboard;
- }
- SetTip(computer.devices[i]);
- } break;
- case CARD: {
- XF86ConfDevicePtr card =
- CardConfig(computer.devices[i]->config);
-
- if (card != NULL && computer.devices[i]->config == NULL) {
- XF86Config->conf_device_lst =
- xf86addDevice(XF86Config->conf_device_lst,
- card);
- computer.devices[i]->config = (XtPointer)card;
- }
- SetTip(computer.devices[i]);
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->card->widget == config)
- SetTip((xf86cfgDevice*)computer.screens[j]);
- } break;
- case MONITOR: {
- XF86ConfMonitorPtr monitor =
- MonitorConfig(computer.devices[i]->config);
-
- if (monitor != NULL && computer.devices[i]->config == NULL) {
- XF86Config->conf_monitor_lst =
- xf86addMonitor(XF86Config->conf_monitor_lst,
- monitor);
- computer.devices[i]->config = (XtPointer)monitor;
- }
- SetTip(computer.devices[i]);
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->monitor->widget == config)
- SetTip((xf86cfgDevice*)computer.screens[j]);
- } break;
- }
- /* Need to update because it may have been renamed */
- UpdateMenuDeviceList(computer.devices[i]->type);
- break;
- }
- }
- }
- else if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == config) {
- if (ScreenConfig(computer.screens[i]->screen) != NULL)
- SetTip((xf86cfgDevice*)computer.screens[i]);
- }
- }
-}
-
-void
-OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
- XF86OptionPtr *options = NULL;
-#ifdef USE_MODULES
- xf86cfgModuleOptions *drv_opts = NULL;
-#endif
-
- if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == config) {
- options = &(computer.screens[i]->screen->scrn_option_lst);
- break;
- }
- }
- else {
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->widget == config)
- break;
-
- if (i >= computer.num_devices) {
- if (XF86Config->conf_flags == NULL)
- XF86Config->conf_flags = (XF86ConfFlagsPtr)
- XtCalloc(1, sizeof(XF86ConfFlagsRec));
- options = &(XF86Config->conf_flags->flg_option_lst);
- }
- else {
- switch (computer.devices[i]->type) {
- case MOUSE:
- case KEYBOARD:
- options = (XF86OptionPtr*)&(((XF86ConfInputPtr)
- (computer.devices[i]->config))->inp_option_lst);
-#ifdef USE_MODULES
- if (!nomodules) {
- char *drv = ((XF86ConfInputPtr)
- (computer.devices[i]->config))->inp_driver;
-
- if (drv) {
- drv_opts = module_options;
- while (drv_opts) {
- if (drv_opts->type == InputModule &&
- strcmp(drv_opts->name, drv) == 0)
- break;
- drv_opts = drv_opts->next;
- }
- }
- }
-#endif
-
- break;
- case CARD:
- options = (XF86OptionPtr*)&(((XF86ConfDevicePtr)
- (computer.devices[i]->config))->dev_option_lst);
-#ifdef USE_MODULES
- if (!nomodules) {
- char *drv = ((XF86ConfDevicePtr)
- (computer.devices[i]->config))->dev_driver;
-
- if (drv) {
- drv_opts = module_options;
- while (drv_opts) {
- if (drv_opts->type == VideoModule &&
- strcmp(drv_opts->name, drv) == 0)
- break;
- drv_opts = drv_opts->next;
- }
- }
- }
-#endif
- break;
- case MONITOR:
- options = (XF86OptionPtr*)&(((XF86ConfMonitorPtr)
- (computer.devices[i]->config))->mon_option_lst);
- break;
- }
- }
- }
-
-#ifdef USE_MODULES
- OptionsPopup(options, drv_opts ? drv_opts->name : NULL,
- drv_opts ? drv_opts->option : NULL);
-#else
- OptionsPopup(options);
-#endif
- if (config_mode == CONFIG_SCREEN) {
- XF86OptionPtr option, options;
- int rotate = 0;
-
- options = computer.screens[i]->screen->scrn_option_lst;
- if ((option = xf86findOption(options, "Rotate")) != NULL) {
- if (option->opt_val != NULL)
- rotate = strcasecmp(option->opt_val, "CW") == 0 ? 1 :
- strcasecmp(option->opt_val, "CCW") == 0 ? -1 : 0;
- XtFree(option->opt_val);
- option->opt_val = XtNewString(rotate > 0 ? "CW" : "CCW");
- computer.screens[i]->rotate = rotate;
- }
- else
- computer.screens[i]->rotate = 0;
- UpdateScreenUI();
- AdjustScreenUI();
- SetTip((xf86cfgDevice*)computer.screens[i]);
- }
- else {
- if (i >= computer.num_devices)
- SetTip(&cpu_device);
- else
- SetTip(computer.devices[i]);
- }
-}
-
-void
-EnableDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
-
- if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == config) {
- computer.screens[i]->state = USED;
- computer.screens[i]->card->state = USED;
- ScreenSetup(False);
- return;
- }
- }
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->widget == config) {
- if (computer.devices[i]->state == USED)
- return;
- computer.devices[i]->state = USED;
- DrawCables();
- break;
- }
- if (i >= computer.num_devices || computer.layout == NULL)
- return;
- switch (computer.devices[i]->type) {
- case MOUSE:
- case KEYBOARD: {
- int nmouses = 0, nkeyboards = 0;
- XF86ConfInputPtr input = (XF86ConfInputPtr)
- (computer.devices[i]->config);
- XF86ConfInputrefPtr nex, iref = computer.layout->lay_input_lst;
- XF86OptionPtr option;
-
- nex = iref;
- while (nex != NULL) {
- if (strcasecmp(nex->iref_inputdev->inp_driver, "mouse") == 0)
- ++nmouses;
- else if (strcasecmp(nex->iref_inputdev->inp_driver,
- "keyboard") == 0)
- ++nkeyboards;
- iref = nex;
- nex = (XF86ConfInputrefPtr)(nex->list.next);
- }
- nex = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
- nex->list.next = NULL;
- nex->iref_inputdev = input;
- nex->iref_inputdev_str = XtNewString(input->inp_identifier);
- if (nmouses == 0 && computer.devices[i]->type == MOUSE)
- option = xf86newOption(XtNewString("CorePointer"), NULL);
- else if (nkeyboards == 0 && computer.devices[i]->type == KEYBOARD)
- option = xf86newOption(XtNewString("CoreKeyboard"), NULL);
- else
- option = xf86newOption(XtNewString("SendCoreEvents"), NULL);
- nex->iref_option_lst = option;
- computer.layout->lay_input_lst =
- xf86addInputref(computer.layout->lay_input_lst, nex);
- } break;
- case CARD:
- for (i = 0; i < computer.num_screens; i++) {
- if (computer.screens[i]->card->widget == config &&
- computer.screens[i]->state != USED) {
- XF86ConfAdjacencyPtr adj;
-
- adj = (XF86ConfAdjacencyPtr)
- XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_screen = computer.screens[i]->screen;
- adj->adj_screen_str = XtNewString(computer.screens[i]->
- screen->scrn_identifier);
- computer.layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
- xf86addListItem((GenericListPtr)computer.layout->
- lay_adjacency_lst, (GenericListPtr)adj);
- computer.screens[i]->state = USED;
- }
- }
- break;
- case MONITOR:
- break;
- }
-}
-
-void
-DisableDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
-
- if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == config) {
- computer.screens[i]->state = UNUSED;
- computer.screens[i]->card->state = UNUSED;
- ScreenSetup(False);
- return;
- }
- }
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->widget == config) {
- if (computer.devices[i]->state == UNUSED)
- return;
- computer.devices[i]->state = UNUSED;
- DrawCables();
- break;
- }
- if (i >= computer.num_devices || computer.layout == NULL)
- return;
- switch (computer.devices[i]->type) {
- case MOUSE:
- case KEYBOARD:
- xf86removeInputRef(computer.layout,
- (XF86ConfInputPtr)(computer.devices[i]->config));
- break;
- case CARD: {
- XF86ConfAdjacencyPtr adj;
- int j;
-
- if (computer.layout == NULL)
- break;
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->card->widget == config) {
- adj = computer.layout->lay_adjacency_lst;
- while (adj != NULL) {
- if (adj->adj_screen == computer.screens[j]->screen) {
- xf86removeAdjacency(computer.layout, adj);
- break;
- }
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- computer.screens[j]->state = UNUSED;
- break;
- }
- } break;
- case MONITOR:
- break;
- }
-}
-
-/* ARGSUSED */
-void
-RemoveDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i, j;
-
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == config) {
- RemoveScreen(computer.screens[i]->monitor,
- computer.screens[i]->card);
- ScreenSetup(False);
- return;
- }
-
- for (i = 0; i < computer.num_devices; i++) {
- if (computer.devices[i]->widget == config) {
- switch (computer.devices[i]->type) {
- case MOUSE:
- case KEYBOARD:
- xf86removeInput(XF86Config,
- (XF86ConfInputPtr)(computer.devices[i]->config));
- break;
- case CARD:
- case MONITOR:
- break;
- }
-
- if (computer.devices[i]->type == CARD) {
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->card == computer.devices[i]) {
- RemoveScreen(computer.screens[j]->monitor,
- computer.devices[i]);
- --j;
- }
- if (computer.devices[i]->refcount <= 0)
- xf86removeDevice(XF86Config,
- (XF86ConfDevicePtr)(computer.devices[i]->config));
- }
- else if (computer.devices[i]->type == MONITOR) {
- for (j = 0; j < computer.num_screens; j++)
- if (computer.screens[j]->monitor == computer.devices[i]) {
- RemoveScreen(computer.devices[i],
- computer.screens[j]->card);
- --j;
- }
- if (computer.devices[i]->refcount <= 0)
- xf86removeMonitor(XF86Config,
- (XF86ConfMonitorPtr)(computer.devices[i]->config));
- }
-
- if (computer.devices[i]->refcount <= 0) {
- int type = computer.devices[i]->type;
-
- XtDestroyWidget(computer.devices[i]->widget);
- XtFree((XtPointer)computer.devices[i]);
- if (--computer.num_devices > i)
- memmove(&computer.devices[i], &computer.devices[i + 1],
- (computer.num_devices - i) * sizeof(xf86cfgDevice*));
-
- DrawCables();
- UpdateMenuDeviceList(type);
- }
-
- break;
- }
- }
-}
-
-void
-UpdateMenuDeviceList(int type)
-{
- Widget sme = NULL, menu = NULL;
- int i, count;
- static char *mouseM = "mouseM", *keyboardM = "keyboardM",
- *cardM = "cardM", *monitorM = "monitorM";
-
- for (i = count = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->type == type)
- ++count;
-
- switch (type) {
- case MOUSE:
- sme = mouseSme;
- menu = mouseMenu;
- break;
- case KEYBOARD:
- sme = keyboardSme;
- menu = keyboardMenu;
- break;
- case CARD:
- sme = cardSme;
- menu = cardMenu;
- break;
- case MONITOR:
- sme = monitorSme;
- menu = monitorMenu;
- break;
- }
-
- if (menu)
- for (i = ((CompositeWidget)menu)->composite.num_children - 1; i >= 0; i--)
- XtDestroyWidget(((CompositeWidget)menu)->composite.children[i]);
-
- if (count < 2) {
- XtVaSetValues(sme, XtNmenuName, NULL, XtNleftBitmap, None, NULL);
- return;
- }
-
- switch (type) {
- case MOUSE:
- if (mouseMenu == NULL)
- menu = mouseMenu =
- XtCreatePopupShell(mouseM, simpleMenuWidgetClass,
- XtParent(mouseSme), NULL, 0);
- XtVaSetValues(mouseSme, XtNmenuName, mouseM,
- XtNleftBitmap, menuPixmap, NULL);
- break;
- case KEYBOARD:
- if (keyboardMenu == NULL)
- menu = keyboardMenu =
- XtCreatePopupShell(keyboardM, simpleMenuWidgetClass,
- XtParent(keyboardSme), NULL, 0);
- XtVaSetValues(keyboardSme, XtNmenuName, keyboardM,
- XtNleftBitmap, menuPixmap, NULL);
- break;
- case CARD:
- if (cardMenu == NULL)
- menu = cardMenu =
- XtCreatePopupShell(cardM, simpleMenuWidgetClass,
- XtParent(cardSme), NULL, 0);
- XtVaSetValues(cardSme, XtNmenuName, cardM,
- XtNleftBitmap, menuPixmap, NULL);
- break;
- case MONITOR:
- if (monitorMenu == NULL)
- menu = monitorMenu =
- XtCreatePopupShell(monitorM, simpleMenuWidgetClass,
- XtParent(monitorSme), NULL, 0);
- XtVaSetValues(monitorSme, XtNmenuName, monitorM,
- XtNleftBitmap, menuPixmap, NULL);
- break;
- }
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->type == type) {
- char *label = NULL;
-
- if (computer.devices[i]->config) {
- switch (type) {
- case MOUSE:
- case KEYBOARD:
- label = ((XF86ConfInputPtr)computer.devices[i]->config)
- ->inp_identifier;
- break;
- case CARD:
- label = ((XF86ConfDevicePtr)computer.devices[i]->config)
- ->dev_identifier;
- break;
- case MONITOR:
- label = ((XF86ConfMonitorPtr)computer.devices[i]->config)
- ->mon_identifier;
- break;
- }
- }
- else {
- switch (type) {
- case MOUSE:
- label = "newMouse";
- break;
- case KEYBOARD:
- label = "newKeyboard";
- break;
- case CARD:
- label = "newCard";
- break;
- case MONITOR:
- label = "newMonitor";
- break;
- }
- }
-
- sme = XtCreateManagedWidget(label, smeBSBObjectClass, menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, SmeConfigureDeviceCallback,
- computer.devices[i]->config ?
- computer.devices[i]->config :
- (XtPointer) (-((long)type + 100)));
- }
-}
-
-/*ARGSUSED*/
-void
-SelectDeviceAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- device = w;
- xpos = event->xbutton.x_root;
- ypos = event->xbutton.y_root;
- XDefineCursor(XtDisplay(device), XtWindow(device), no_cursor);
-
- if (config_mode == CONFIG_SCREEN) {
- sxpos = device->core.x;
- sypos = device->core.y;
- }
-}
-
-/*ARGSUSED*/
-void
-MoveDeviceAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- int dx, dy, x, y, oldx, oldy;
-
- if (device == NULL || device != w)
- return;
-
- dx = event->xbutton.x_root - xpos;
- dy = event->xbutton.y_root - ypos;
-
- oldx = device->core.x;
- oldy = device->core.y;
- x = device->core.x + dx;
- y = device->core.y + dy;
-
- if (x < 0)
- x = 0;
- else if (x + device->core.width > XtParent(device)->core.width)
- x = XtParent(device)->core.width - device->core.width;
- if (y < 0)
- y = 0;
- else if (y + device->core.height > XtParent(device)->core.height)
- y = XtParent(device)->core.height - device->core.height;
-
- dx = x - oldx;
- dy = y - oldy;
-
- XRaiseWindow(XtDisplay(device), XtWindow(device));
- XtMoveWidget(device, x, y);
-
- xpos += dx;
- ypos += dy;
-}
-
-/*ARGSUSED*/
-void
-UnselectDeviceAction(Widget w, XEvent *ev, String *params, Cardinal *num_params)
-{
- if (device != NULL) {
- XUndefineCursor(XtDisplay(device), XtWindow(device));
-
- if (config_mode == CONFIG_SCREEN)
- ScreenSetup(False);
- device = NULL;
- }
-}
-
-/*ARGSUSED*/
-void
-DevicePopupMenu(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- static Widget configure, options, enable, disable, remove;
- static int first = 1;
- int i;
- xf86cfgDevice *dev;
-
- if (first) {
- first = 0;
-
- popup = XtCreatePopupShell("popup", simpleMenuWidgetClass,
- toplevel, NULL, 0);
- configure = XtCreateManagedWidget("configure", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(configure, XtNcallback, ConfigureDeviceCallback, NULL);
- options = XtCreateManagedWidget("options", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(options, XtNcallback, OptionsCallback, NULL);
- XtCreateManagedWidget("line", smeLineObjectClass,
- popup, NULL, 0);
- enable = XtCreateManagedWidget("enable", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(enable, XtNcallback, EnableDeviceCallback, NULL);
- disable = XtCreateManagedWidget("disable", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(disable, XtNcallback, DisableDeviceCallback, NULL);
- XtCreateManagedWidget("line", smeLineObjectClass,
- popup, NULL, 0);
- remove = XtCreateManagedWidget("remove", smeBSBObjectClass,
- popup, NULL, 0);
- XtAddCallback(remove, XtNcallback, RemoveDeviceCallback, NULL);
-
- XtRealizeWidget(popup);
- }
-
- dev = NULL;
- if (config_mode == CONFIG_LAYOUT) {
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->widget == w) {
- dev = computer.devices[i];
- break;
- }
- if (i >= computer.num_devices && strcmp(XtName(w), "cpu"))
- return;
- if (dev == NULL)
- dev = &cpu_device;
- }
- else if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->widget == w) {
- dev = (xf86cfgDevice*)computer.screens[i];
- break;
- }
- }
- if (dev == NULL)
- return;
-
- config = w;
-
- if (dev->type != SERVER) {
- XtSetSensitive(configure, True);
- XtSetSensitive(remove, True);
- XtSetSensitive(options, dev->config != NULL);
- if (computer.layout == NULL || dev->config == NULL ||
- dev->type == MONITOR) {
- XtSetSensitive(enable, False);
- XtSetSensitive(disable, False);
- }
- else if (dev->state == USED) {
- XtSetSensitive(enable, False);
- XtSetSensitive(disable, True);
- }
- else {
- XtSetSensitive(enable, True);
- XtSetSensitive(disable, False);
- }
- }
- else {
- XtSetSensitive(configure, False);
- XtSetSensitive(options, True);
- XtSetSensitive(enable, False);
- XtSetSensitive(disable, False);
- XtSetSensitive(remove, False);
- }
-
- XtMoveWidget(popup, event->xbutton.x_root, event->xbutton.y_root);
- XtPopup(popup, XtGrabNone);
-}
-
-/*ARGSUSED*/
-void
-DevicePopdownMenu(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- if (popup && XtIsRealized(popup))
- XtPopdown(popup);
-}
-
-void RenameLayoutAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- XF86ConfLayoutPtr lay = XF86Config->conf_layout_lst;
- Arg args[1];
- char *name;
-
- XtSetArg(args[0], XtNstring, &name);
- XtGetValues(layout, args, 1);
-
- if (computer.layout == NULL || (computer.layout &&
- strcasecmp(name, computer.layout->lay_identifier)) == 0)
- return;
-
- if (name == NULL && *name == '\0') {
- /* tell user about error */
- return;
- }
-
- while (lay) {
- if (strcasecmp(name, lay->lay_identifier) == 0)
- /* tell user about error */
- return;
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- XtSetArg(args[0], XtNlabel, name);
- XtSetValues(layoutsme, args, 1);
- xf86renameLayout(XF86Config, computer.layout, name);
-}
-
-/*ARGSUSED*/
-static void
-ComputerEventHandler(Widget w, XtPointer closure,
- XEvent *event, Boolean *continue_to_dispatch)
-{
- if (event->xexpose.count > 1)
- return;
-
- if (config_mode == CONFIG_LAYOUT)
- DrawCables();
-}
-
-void
-DrawCables(void)
-{
- Display *display;
- Window window;
- int ox, oy, i;
- xf86cfgScreen **scr = computer.screens;
-
- if (config_mode != CONFIG_LAYOUT)
- return;
-
- ox = computer.cpu->core.x + (computer.cpu->core.width >> 1);
- oy = computer.cpu->core.y + (computer.cpu->core.height >> 1);
-
- display = XtDisplay(work);
- window = XtWindow(work);
- XClearWindow(display, window);
-
- for (i = 0; i < computer.num_devices; i++) {
- if (computer.devices[i]->state == USED &&
- computer.devices[i]->type != MONITOR)
- DrawCable(display, window, ox, oy,
- computer.devices[i]->widget->core.x +
- (computer.devices[i]->widget->core.width>>1),
- computer.devices[i]->widget->core.y +
- (computer.devices[i]->widget->core.height>>1));
-
- }
- for (i = 0; i < computer.num_screens; i++) {
- if (scr[i]->monitor != NULL)
- DrawCable(display, window,
- scr[i]->card->widget->core.x +
- (scr[i]->card->widget->core.width>>1),
- scr[i]->card->widget->core.y +
- (scr[i]->card->widget->core.height>>1),
- scr[i]->monitor->widget->core.x +
- (scr[i]->monitor->widget->core.width>>1),
- scr[i]->monitor->widget->core.y +
- (scr[i]->monitor->widget->core.height>>1));
- }
-}
-
-static void
-DrawCable(Display *display, Window window, int o_x, int o_y, int d_x, int d_y)
-{
- XDrawLine(display, window, cablegcshadow, o_x, o_y, d_x, d_y);
- XDrawLine(display, window, cablegc, o_x, o_y, d_x, d_y);
-}
-
-/*ARGSUSED*/
-void
-SetConfigModeCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i, mode = (long)user_data;
- Arg args[3];
- char *ptr;
- static Dimension height;
-
- if (mode == config_mode)
- return;
- XtSetArg(args[0], XtNlabel, &ptr);
- XtGetValues(w, args, 1);
- XtSetArg(args[0], XtNlabel, ptr);
- XtSetValues(topMenu, args, 1);
-
- if (config_mode == CONFIG_LAYOUT) {
- XtSetArg(args[0], XtNheight, &height);
- XtGetValues(commands, args, 1);
- for (i = 0; i < computer.num_devices; i++)
- XtUnmapWidget(computer.devices[i]->widget);
- XtUnmapWidget(commands);
- XtUnmapWidget(computer.cpu);
- XtSetSensitive(commands, False);
- XtSetArg(args[0], XtNheight, 1);
- XtSetArg(args[1], XtNmin, 1);
- XtSetArg(args[2], XtNmax, 1);
- XtSetValues(commands, args, 3);
- }
- else if (config_mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- XtUnmapWidget(computer.screens[i]->widget);
- }
- else if (config_mode == CONFIG_MODELINE) {
- VideoModeConfigureEnd();
- XtSetSensitive(layout, True);
- XtSetSensitive(layoutm, True);
- }
- else if (config_mode == CONFIG_ACCESSX) {
- AccessXConfigureEnd();
- XtSetSensitive(layout, True);
- XtSetSensitive(layoutm, True);
- }
-
- config_mode = mode;
- XClearWindow(XtDisplay(work), XtWindow(work));
- if (mode == CONFIG_LAYOUT) {
- for (i = 0; i < computer.num_devices; i++)
- XtMapWidget(computer.devices[i]->widget);
- XtSetArg(args[0], XtNheight, height);
- XtSetArg(args[1], XtNmin, height);
- XtSetArg(args[2], XtNmax, height);
- XtSetValues(commands, args, 3);
- XtMapWidget(commands);
- XtMapWidget(computer.cpu);
- XtSetSensitive(commands, True);
- DrawCables();
- }
- else if (mode == CONFIG_SCREEN) {
- for (i = 0; i < computer.num_screens; i++)
- XtMapWidget(computer.screens[i]->widget);
- ScreenSetup(True);
- }
- else if (mode == CONFIG_MODELINE) {
- VideoModeConfigureStart();
- XtSetSensitive(layout, False);
- XtSetSensitive(layoutm, False);
- }
- else if (mode == CONFIG_ACCESSX) {
- AccessXConfigureStart();
- XtSetSensitive(layout, False);
- XtSetSensitive(layoutm, False);
- }
-}
-
-static void
-ScreenSetup(Bool check)
-{
- if (check) {
- int i;
-
- for (i = 0; i < computer.num_layouts; i++)
- if (computer.layouts[i]->layout == computer.layout)
- break;
-
- /* Just to put the screens in the correct positions */
- if (i >= computer.num_layouts)
- AdjustScreenUI();
- }
-
- UpdateScreenUI();
- AdjustScreenUI();
-}
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.c b/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
deleted file mode 100644
index 87989fdc2..000000000
--- a/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
+++ /dev/null
@@ -1,1379 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c,v 1.22 2003/01/01 19:22:24 paulo Exp $
- */
-
-#include "xf86config.h"
-#include "keyboard-cfg.h"
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/SmeBSB.h>
-
-/*
- * Types
- */
-typedef struct {
- char *rules;
- XkbRF_RulesPtr list;
- XF86XkbDescInfo model;
- XF86XkbDescInfo layout;
- XF86XkbDescInfo variant;
- XF86XkbDescInfo option;
-} XF86XkbRulesDescInfo;
-
-/*
- * Prototypes
- */
-static void KeyboardRulesCallback(Widget, XtPointer, XtPointer);
-static void KeyboardModelCallback(Widget, XtPointer, XtPointer);
-static void KeyboardLayoutCallback(Widget, XtPointer, XtPointer);
-static void KeyboardVariantCallback(Widget, XtPointer, XtPointer);
-static void KeyboardOptionsCallback(Widget, XtPointer, XtPointer);
-static void KeyboardApplyCallback(Widget, XtPointer, XtPointer);
-static Bool KeyboardConfigCheck(void);
-static void XkbUIEventHandler(Widget, XtPointer, XEvent*, Boolean*);
-static XF86XkbRulesDescInfo *GetXkbRulesDesc(char*);
-static void UpdateRulesPopups(void);
-
-/*
- * Initialization
- */
-static XF86XkbRulesDescInfo **xkb_desc, *xkb_rules;
-static int num_xkb_desc;
-static char *XkbRulesDir = "lib/X11/xkb/rules/";
-#ifdef XFREE98_XKB
-static char *XkbRulesFile = "xfree98";
-#else
-static char *XkbRulesFile = "xfree86";
-#endif
-static XF86ConfInputPtr current_input;
-
-static char *rules, *model, *layout, *variant, *options;
-static Widget kbd, rulesb, modelb, layoutb, variantb, optionsb,
- modelp, layoutp, variantp, optionsp;
-static XkbInfo **xkb_infos;
-static int num_xkb_infos;
-XkbInfo *xkb_info;
-
-static Widget apply;
-
-/*
- * Implementation
- */
-/*ARGSUSED*/
-XtPointer
-KeyboardConfig(XtPointer config)
-{
- XF86ConfInputPtr keyboard = (XF86ConfInputPtr)config;
- XF86OptionPtr option;
- Arg args[1];
- static char *XkbRules = "XkbRules", *XkbModel = "XkbModel",
- *XkbLayout = "XkbLayout", *XkbVariant = "XkbVariant",
- *XkbOptions = "XkbOptions";
- XF86XkbRulesDescInfo *info;
- char *omodel, *olayout, *ovariant, *ooptions;
-
- InitializeKeyboard();
- rules = xkb_rules->rules;
- if (xkb_info->config.rules_file == NULL)
- xkb_info->config.rules_file = rules;
-
- if (options)
- XtFree(options);
- options = NULL;
-
- if (xkb_info->conf == NULL)
- xkb_info->conf = keyboard;
-
- if (xkb_info->conf != keyboard) {
- int i;
-
- for (i = 0; i < num_xkb_infos; i++)
- if (xkb_infos[i]->conf == keyboard) {
- xkb_info = xkb_infos[i];
- break;
- }
-
- if (i >= num_xkb_infos) {
- int timeout = 10;
-
- xkb_info = (XkbInfo*)XtCalloc(1, sizeof(XkbInfo));
- xkb_info->conf = keyboard;
- xkb_infos = (XkbInfo**)
- XtRealloc((XtPointer)xkb_infos, sizeof(XkbInfo*) *
- (num_xkb_infos + 1));
- xkb_infos[num_xkb_infos++] = xkb_info;
-
- xkb_info->conf = keyboard;
- bzero((char*)&(xkb_info->defs), sizeof(XkbRF_VarDefsRec));
- while (timeout > 0) {
- xkb_info->xkb =
- XkbGetKeyboard(XtDisplay(configp),
- XkbGBN_AllComponentsMask, XkbUseCoreKbd);
- if (xkb_info->xkb == NULL) {
- timeout -= 1;
- sleep(1);
- }
- else
- break;
- }
- if (timeout <= 0) {
- fprintf(stderr, "Couldn't get keyboard\n");
- }
- if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
- xkb_info->xkb->names->geometry == 0)
- xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
- }
-
- /* check for removed devices */
- for (i = 0; i < num_xkb_infos; i++) {
- XF86ConfInputPtr key = XF86Config->conf_input_lst;
-
- while (key != NULL) {
- if (strcasecmp(key->inp_driver, "keyboard") == 0 &&
- xkb_infos[i]->conf == key)
- break;
- key = (XF86ConfInputPtr)(key->list.next);
- }
- if (xkb_infos[i]->conf != NULL && key == NULL) {
- XkbFreeKeyboard(xkb_infos[i]->xkb, 0, False);
- XtFree((XtPointer)xkb_infos[i]);
- if (--num_xkb_infos > i)
- memmove(&xkb_infos[i], &xkb_infos[i + 1],
- (num_xkb_infos - i) * sizeof(XkbInfo*));
- }
- }
- }
-
- current_input = keyboard;
-
- if (keyboard != NULL) {
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbRules)) != NULL) {
- if (strcmp(rules, option->opt_val)) {
- XF86XkbRulesDescInfo *info = GetXkbRulesDesc(option->opt_val);
-
- if (info) {
- rules = info->rules;
- UpdateRulesPopups();
- }
- }
- }
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbModel)) != NULL)
- xkb_info->defs.model = model = option->opt_val;
- else
- xkb_info->defs.model = model = xkb_rules->model.name[0];
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbLayout)) != NULL)
- xkb_info->defs.layout = layout = option->opt_val;
- else
- xkb_info->defs.layout = layout = xkb_rules->layout.name[0];
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbVariant)) != NULL)
- xkb_info->defs.variant = variant = option->opt_val;
- else
- xkb_info->defs.variant = variant = NULL;
-
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbOptions)) != NULL)
- xkb_info->defs.options = options = XtNewString(option->opt_val);
- else
- xkb_info->defs.options = options = NULL;
-
- XtSetArg(args[0], XtNstring, keyboard->inp_identifier);
- XtSetValues(ident_widget, args, 1);
-
- (void)UpdateKeyboard(False);
- }
- else {
- XF86ConfInputPtr input = XF86Config->conf_input_lst;
- char keyboard_name[48];
- int nkeyboards = 0;
-
- while (input != NULL) {
- if (strcasecmp(input->inp_driver, "keyboard") == 0)
- ++nkeyboards;
- input = (XF86ConfInputPtr)(input->list.next);
- }
- do {
- XmuSnprintf(keyboard_name, sizeof(keyboard_name),
- "Keyboard%d", nkeyboards);
- ++nkeyboards;
- } while (xf86findInput(keyboard_name,
- XF86Config->conf_input_lst));
-
- model = xkb_rules->model.name[0];
- layout = xkb_rules->layout.name[0];
- variant = "";
- options = XtNewString("");
- XtSetArg(args[0], XtNstring, keyboard_name);
- XtSetValues(ident_widget, args, 1);
- }
-
- info = xkb_rules;
- omodel = model;
- olayout = layout;
- ovariant = variant;
- ooptions = options ? XtNewString(options) : NULL;
-
- xf86info.cur_list = KEYBOARD;
- XtSetSensitive(back, xf86info.lists[KEYBOARD].cur_function > 0);
- XtSetSensitive(next, xf86info.lists[KEYBOARD].cur_function <
- xf86info.lists[KEYBOARD].num_functions - 1);
- (xf86info.lists[KEYBOARD].functions[xf86info.lists[KEYBOARD].cur_function])
- (&xf86info);
-
- if (ConfigLoop(KeyboardConfigCheck) == True) {
- if (keyboard == NULL) {
- keyboard = XtNew(XF86ConfInputRec);
- keyboard->list.next = NULL;
- keyboard->inp_identifier = XtNewString(ident_string);
- keyboard->inp_driver = XtNewString("keyboard");
- keyboard->inp_option_lst = xf86newOption(XtNewString(XkbRules),
- XtNewString(rules));
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbModel), XtNewString(model));
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbLayout), XtNewString(layout));
- if (variant && *variant)
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbVariant), XtNewString(variant));
- if (options && *options) {
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbOptions), options);
- options = NULL;
- }
- keyboard->inp_comment = NULL;
- }
- else {
- int i;
- char *str;
-
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(modelb, args, 1);
- for (i = 0; i < xkb_rules->model.nelem; i++)
- if (strcmp(xkb_rules->model.desc[i], str) == 0) {
- model = xkb_rules->model.name[i];
- break;
- }
-
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(layoutb, args, 1);
- for (i = 0; i < xkb_rules->layout.nelem; i++)
- if (strcmp(xkb_rules->layout.desc[i], str) == 0) {
- layout = xkb_rules->layout.name[i];
- break;
- }
-
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbRules))
- != NULL) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(rules);
- XtFree(option->opt_comment);
- option->opt_comment = NULL;
- }
- else
- keyboard->inp_option_lst =
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbRules), XtNewString(rules));
-
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbModel))
- != NULL) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(model);
- XtFree(option->opt_comment);
- option->opt_comment = NULL;
- }
- else
- keyboard->inp_option_lst =
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbModel), XtNewString(model));
- XtFree(xkb_info->config.model);
- xkb_info->config.model = XtNewString(model);
-
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbLayout))
- != NULL) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(layout);
- }
- else
- keyboard->inp_option_lst =
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbLayout), XtNewString(layout));
- XtFree(xkb_info->config.layout);
- xkb_info->config.layout = XtNewString(layout);
-
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbVariant))
- != NULL) {
- if (variant && *variant) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(variant);
- }
- else
- xf86removeOption(&keyboard->inp_option_lst, XkbVariant);
- }
- else if (variant && *variant)
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbVariant), XtNewString(variant));
- XtFree(xkb_info->config.variant);
- xkb_info->config.variant = variant && *variant ?
- XtNewString(variant) : NULL;
-
- XtFree(xkb_info->config.options);
- xkb_info->config.options = options && *options ?
- XtNewString(options) : NULL;
- if ((option = xf86findOption(keyboard->inp_option_lst, XkbOptions))
- != NULL) {
- if (options && *options) {
- XtFree(option->opt_val);
- option->opt_val = options;
- options = NULL;
- }
- else
- xf86removeOption(&keyboard->inp_option_lst, XkbOptions);
- }
- else if (options && *options) {
- xf86addNewOption(keyboard->inp_option_lst,
- XtNewString(XkbOptions), options);
- options = NULL;
- }
- }
- if (strcasecmp(keyboard->inp_identifier, ident_string))
- xf86renameInput(XF86Config, keyboard, ident_string);
-
- xkb_info->conf = keyboard;
- xkb_info->config.rules_file = rules;
-
- return ((XtPointer)keyboard);
- }
-
- xkb_rules = info;
- rules = info->rules;
- model = omodel;
- layout = olayout;
- variant = ovariant;
- XtFree(options);
- options = ooptions;
-
- return (NULL);
-}
-
-static Bool
-KeyboardConfigCheck(void)
-{
- XF86ConfInputPtr keyboard = XF86Config->conf_input_lst;
-
- while (keyboard != NULL) {
- if (keyboard != current_input &&
- strcasecmp(ident_string, keyboard->inp_identifier) == 0)
- return (False);
- keyboard = (XF86ConfInputPtr)(keyboard->list.next);
- }
-
- return (True);
-}
-
-/*ARGSUSED*/
-static void
-XkbUIEventHandler(Widget w, XtPointer closure,
- XEvent *event, Boolean *continue_to_dispatch)
-{
- XkbUI_ViewOptsRec opts;
- XkbUI_ViewPtr view;
- int width, height, bd;
-
- if (event->xexpose.count > 1)
- return;
-
- bzero((char *)&opts, sizeof(opts));
- bd = 1;
- opts.present = XkbUI_SizeMask | XkbUI_ColormapMask |
- XkbUI_MarginMask | XkbUI_OffsetMask;
- opts.margin_width = opts.margin_height = 0;
- opts.viewport.x = opts.viewport.y = bd;
- width = opts.viewport.width = w->core.width - 2 * bd;
- height = opts.viewport.height = w->core.height - 2 * bd;
- opts.cmap = w->core.colormap;
-
- if ((view = XkbUI_Init(XtDisplay(w), XtWindow(w), width, height,
- xkb_info->xkb, &opts)) != NULL) {
- XkbUI_DrawRegion(view, NULL);
- free(view);
- }
-}
-
-void
-InitializeKeyboard(void)
-{
- int major, minor, op, event, error;
- static int first = 1;
- int timeout = 5;
- XF86ConfInputPtr keyboard = XF86Config->conf_input_lst;
- XF86OptionPtr option;
- char name[PATH_MAX];
- FILE *file;
-
- if (!first)
- return;
- first = 0;
-
- major = XkbMajorVersion;
- minor = XkbMinorVersion;
- if (XkbQueryExtension(DPY, &op, &event, &error, &major, &minor) == 0) {
- fprintf(stderr, "Unable to initialize XKEYBOARD extension");
- exit(1);
- }
-
- xkb_info = (XkbInfo *)XtCalloc(1, sizeof(XkbInfo));
- xkb_info->conf = NULL;
- xkb_infos = (XkbInfo**)XtCalloc(1, sizeof(XkbInfo*));
- num_xkb_infos = 1;
- xkb_infos[0] = xkb_info;
- bzero((char*)&(xkb_info->defs), sizeof(XkbRF_VarDefsRec));
-
- while (timeout > 0) {
- xkb_info->xkb =
- XkbGetKeyboard(DPY, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
- if (xkb_info->xkb == NULL) {
- timeout -= 1;
- sleep(1);
- }
- else
- break;
- }
- if (timeout <= 0) {
- fprintf(stderr, "Couldn't get keyboard\n");
- }
- if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
- xkb_info->xkb->names->geometry == 0)
- xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
-
- /* Load configuration */
- XmuSnprintf(name, sizeof(name), "%s%s", XkbConfigDir, XkbConfigFile);
- file = fopen(name, "r");
- if (file != NULL) {
- if (XkbCFParse(file, XkbCFDflts, xkb_info->xkb, &xkb_info->config) == 0) {
- fprintf(stderr, "Error parsing config file: ");
- XkbCFReportError(stderr, name, xkb_info->config.error,
- xkb_info->config.line);
- }
- fclose(file);
- }
-
- xkb_rules = GetXkbRulesDesc(xkb_info->config.rules_file != NULL ?
- xkb_info->config.rules_file : XkbRulesFile);
- if (xkb_rules == NULL)
- /* error message was printed */
- exit(1);
-
- /* XXX Assumes the first keyboard is the core keyboard */
- while (keyboard != NULL) {
- if (strcasecmp(keyboard->inp_driver, "keyboard") == 0)
- break;
- keyboard = (XF86ConfInputPtr)(keyboard->list.next);
- }
- if (keyboard == NULL)
- return;
-
- if (xkb_info->config.rules_file != NULL)
- rules = xkb_info->config.rules_file;
- else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbRules"))
- != NULL)
- rules = option->opt_val;
- else
- rules = XkbRulesFile;
-
- if (strcmp(rules, xkb_rules->rules)) {
- xkb_rules = GetXkbRulesDesc(rules);
- if (xkb_rules == NULL)
- /* error message was printed */
- exit(1);
- }
- {
- FILE *fp;
- char filename[1024];
-
- XmuSnprintf(filename, sizeof(filename), "%s%s",
- XkbRulesDir, xkb_rules->rules);
- if ((fp = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "Can't open rules file\n");
- exit(1);
- }
-
- if (!XkbRF_LoadRules(fp, xkb_rules->list)) {
- fclose(fp);
- fprintf(stderr, "Can't load rules\n");
- exit(1);
- }
- fclose(fp);
- }
-
- if (xkb_info->config.rules_file == NULL)
- xkb_info->config.rules_file = xkb_rules->rules;
-
- if (xkb_info->config.model != NULL)
- xkb_info->defs.model = xkb_info->config.model;
- else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbModel"))
- != NULL)
- xkb_info->defs.model = option->opt_val;
- else
- xkb_info->defs.model = xkb_rules->model.name[0];
-
- if (xkb_info->config.layout != NULL)
- xkb_info->defs.layout = xkb_info->config.layout;
- else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbLayout"))
- != NULL)
- xkb_info->defs.layout = option->opt_val;
- else
- xkb_info->defs.layout = xkb_rules->layout.name[0];
-
- if (xkb_info->config.variant != NULL)
- xkb_info->defs.variant = xkb_info->config.variant;
- else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbVariant"))
- != NULL)
- xkb_info->defs.variant = option->opt_val;
- else
- xkb_info->defs.variant = NULL;
-
- if (xkb_info->config.options != NULL)
- xkb_info->defs.options = xkb_info->config.options;
- else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbOptions"))
- != NULL)
- xkb_info->defs.options = option->opt_val;
- else
- xkb_info->defs.options = NULL;
-
- if (xkb_info->xkb == NULL) {
- /* Try again */
- XkbComponentNamesRec comps;
-
- bzero((char*)&comps, sizeof(XkbComponentNamesRec));
- XkbRF_GetComponents(xkb_rules->list, &(xkb_info->defs), &comps);
-
- xkb_info->xkb = XkbGetKeyboardByName(DPY, XkbUseCoreKbd, &comps,
- XkbGBN_AllComponentsMask, 0, 0);
- }
-}
-
-static XF86XkbRulesDescInfo *
-GetXkbRulesDesc(char *rules)
-{
- int i;
- XkbRF_RulesPtr list;
- char filename[1024];
- XF86XkbRulesDescInfo *info;
-
- if (rules == NULL)
- return (NULL);
-
- for (i = 0; i < num_xkb_desc; i++)
- if (strcmp(rules, xkb_desc[i]->rules) == 0)
- return (xkb_desc[i]);
-
- XmuSnprintf(filename, sizeof(filename), "%s%s", XkbRulesDir, rules);
- if ((list = XkbRF_Create(0, 0)) == NULL ||
- !XkbRF_LoadDescriptionsByName(filename, NULL, list)) {
- fprintf(stderr, "Can't create rules structure\n");
- return (NULL);
- }
-
- info = (XF86XkbRulesDescInfo*)XtCalloc(1, sizeof(XF86XkbRulesDescInfo));
- xkb_desc = (XF86XkbRulesDescInfo**)
- XtRealloc((XtPointer)xkb_desc,
- sizeof(XF86XkbRulesDescInfo*) * (num_xkb_desc + 1));
- xkb_desc[num_xkb_desc++] = info;
- info->rules = XtNewString(rules);
- for (i = 0; i < list->models.num_desc; i++) {
- if (i % 16 == 0) {
- info->model.name = (char**)XtRealloc((XtPointer)info->model.name,
- (i + 16) * sizeof(char*));
- info->model.desc = (char**)XtRealloc((XtPointer)info->model.desc,
- (i + 16) * sizeof(char*));
- }
- info->model.name[i] = XtNewString(list->models.desc[i].name);
- info->model.desc[i] = XtNewString(list->models.desc[i].desc);
- }
- info->model.nelem = i;
-
- for (i = 0; i < list->layouts.num_desc; i++) {
- if (i % 16 == 0) {
- info->layout.name = (char**)XtRealloc((XtPointer)info->layout.name,
- (i + 16) * sizeof(char*));
- info->layout.desc = (char**)XtRealloc((XtPointer)info->layout.desc,
- (i + 16) * sizeof(char*));
- }
- info->layout.name[i] = XtNewString(list->layouts.desc[i].name);
- info->layout.desc[i] = XtNewString(list->layouts.desc[i].desc);
- }
- info->layout.nelem = i;
-
- for (i = 0; i < list->variants.num_desc; i++) {
- if (i % 16 == 0) {
- info->variant.name = (char**)XtRealloc((XtPointer)info->variant.name,
- (i + 16) * sizeof(char*));
- info->variant.desc = (char**)XtRealloc((XtPointer)info->variant.desc,
- (i + 16) * sizeof(char*));
- }
- info->variant.name[i] = XtNewString(list->variants.desc[i].name);
- info->variant.desc[i] = XtNewString(list->variants.desc[i].desc);
- }
- info->variant.nelem = i;
-
- for (i = 0; i < list->options.num_desc; i++) {
- if (i % 16 == 0) {
- info->option.name = (char**)XtRealloc((XtPointer)info->option.name,
- (i + 16) * sizeof(char*));
- info->option.desc = (char**)XtRealloc((XtPointer)info->option.desc,
- (i + 16) * sizeof(char*));
- }
- info->option.name[i] = XtNewString(list->options.desc[i].name);
- info->option.desc[i] = XtNewString(list->options.desc[i].desc);
- }
- info->option.nelem = i;
- info->list = list;
-
- return (info);
-}
-
-static xf86ConfigSymTabRec ax_controls[] =
-{
- {XkbRepeatKeysMask, "RepeatKeys"},
- {XkbSlowKeysMask, "SlowKeys"},
- {XkbBounceKeysMask, "BounceKeys"},
- {XkbStickyKeysMask, "StickyKeys"},
- {XkbMouseKeysMask, "MouseKeys"},
- {XkbMouseKeysAccelMask, "MouseKeysAccel"},
- {XkbAccessXKeysMask, "AccessxKeys"},
- {XkbAccessXTimeoutMask, "AccessxTimeout"},
- {XkbAccessXFeedbackMask, "AccessxFeedback"},
- {XkbAudibleBellMask, "AudibleBell"},
- {XkbOverlay1Mask, "Overlay1"},
- {XkbOverlay2Mask, "Overlay2"},
- {XkbIgnoreGroupLockMask, "IgnoreGroupLock"},
- {-1, ""},
-};
-
-static xf86ConfigSymTabRec ax_feedback[] =
-{
- {XkbAX_SKPressFBMask, "SlowKeysPress"},
- {XkbAX_SKAcceptFBMask, "SlowKeysAccept"},
- {XkbAX_FeatureFBMask, "Feature"},
- {XkbAX_SlowWarnFBMask, "SlowWarn"},
- {XkbAX_IndicatorFBMask, "Indicator"},
- {XkbAX_StickyKeysFBMask, "StickyKeys"},
- {XkbAX_TwoKeysMask, "TwoKeys"},
- {XkbAX_LatchToLockMask, "LatchToLock"},
- {XkbAX_SKReleaseFBMask, "SlowKeysRelease"},
- {XkbAX_SKRejectFBMask, "SlowkeysReject"},
- {XkbAX_BKRejectFBMask, "BounceKeysReject"},
- {XkbAX_DumbBellFBMask, "DumbBell"},
- {-1, ""},
-};
-
-Bool
-WriteXKBConfiguration(char *filename, XkbConfigRtrnPtr conf)
-{
- FILE *fp;
- int i, count;
-
- if (filename == NULL || conf == NULL ||
- (fp = fopen(filename, "w")) == NULL)
- return (False);
-
- if (conf->rules_file != NULL)
- fprintf(fp, "Rules = \"%s\"\n",
- conf->rules_file);
- if (conf->model != NULL)
- fprintf(fp, "Model = \"%s\"\n",
- conf->model);
- if (conf->layout != NULL)
- fprintf(fp, "Layout = \"%s\"\n",
- conf->layout);
- if (conf->variant != NULL)
- fprintf(fp, "Variant = \"%s\"\n",
- conf->variant);
- if (conf->options != NULL)
- fprintf(fp, "Options = \"%s\"\n",
- conf->options);
- if (conf->keymap != NULL)
- fprintf(fp, "Keymap = %s\n",
- conf->keymap);
- if (conf->keycodes != NULL)
- fprintf(fp, "Keycodes = %s\n",
- conf->keycodes);
- if (conf->geometry != NULL)
- fprintf(fp, "Geometry = %s\n",
- conf->geometry);
- if (conf->phys_symbols != NULL)
- fprintf(fp, "RealSymbols = %s\n",
- conf->phys_symbols);
- if (conf->symbols != NULL)
- fprintf(fp, "Symbols = %s\n",
- conf->symbols);
- if (conf->types != NULL)
- fprintf(fp, "Types = %s\n",
- conf->types);
- if (conf->compat != NULL)
- fprintf(fp, "Compat = %s\n",
- conf->compat);
-
- if (conf->click_volume > 0)
- fprintf(fp, "ClickVolume = %d\n",
- conf->click_volume);
- if (conf->bell_volume > 0)
- fprintf(fp, "BellVolume = %d\n",
- conf->bell_volume);
- if (conf->bell_pitch > 0)
- fprintf(fp, "BellPitch = %d\n",
- conf->bell_pitch);
- if (conf->bell_duration > 0)
- fprintf(fp, "BellDuration = %d\n",
- conf->bell_duration);
-
- if (conf->repeat_delay > 0)
- fprintf(fp, "RepeatDelay = %d\n",
- conf->repeat_delay);
- if (conf->repeat_interval > 0)
- fprintf(fp, "RepeatInterval = %d\n",
- conf->repeat_interval);
-
- if (conf->slow_keys_delay > 0)
- fprintf(fp, "SlowKeysDelay = %d\n",
- conf->slow_keys_delay);
-
- if (conf->debounce_delay > 0)
- fprintf(fp, "DebounceDelay = %d\n",
- conf->debounce_delay);
-
- if (conf->mk_delay > 0)
- fprintf(fp, "MouseKeysDelay = %d\n",
- conf->mk_delay);
- if (conf->mk_interval > 0)
- fprintf(fp, "MouseKeysInterval = %d\n",
- conf->mk_interval);
- if (conf->mk_time_to_max > 0)
- fprintf(fp, "MouseKeysTimeToMax = %d\n",
- conf->mk_time_to_max);
- if (conf->mk_max_speed > 0)
- fprintf(fp, "MouseKeysMaxSpeed = %d\n",
- conf->mk_max_speed);
- fprintf(fp, "MouseKeysCurve = %d\n", conf->mk_curve);
-
- if (conf->ax_timeout)
- fprintf(fp, "AccessXTimeout = %d\n",
- conf->ax_timeout);
- if (conf->initial_ctrls != 0) {
- fprintf(fp, "Controls %c= ",
- conf->replace_initial_ctrls ? ' ' : '+');
- for (i = count = 0; *ax_controls[i].name; i++)
- if ((conf->initial_ctrls & ax_controls[i].token)
- == ax_controls[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_controls[i].name);
- fprintf(fp, "\n");
- }
- if (conf->axt_ctrls_on != 0) {
- fprintf(fp, "AcessXTimeoutCtrlsOn %c= ",
- conf->replace_axt_ctrls_on ? ' ' : '+');
- for (i = count = 0; *ax_controls[i].name; i++)
- if ((conf->axt_ctrls_on & ax_controls[i].token)
- == ax_controls[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_controls[i].name);
- fprintf(fp, "\n");
- }
- if (conf->axt_ctrls_off != 0) {
- fprintf(fp, "AcessXTimeoutCtrlsOff %c= ",
- conf->replace_axt_ctrls_off ? ' ' : '-');
- for (i = count = 0; *ax_controls[i].name; i++)
- if ((conf->axt_ctrls_off & ax_controls[i].token)
- == ax_controls[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_controls[i].name);
- fprintf(fp, "\n");
- }
-
- if (conf->initial_opts != 0) {
- fprintf(fp, "Feedback %c= ",
- conf->replace_initial_opts ? ' ' : '+');
- for (i = count = 0; *ax_feedback[i].name; i++)
- if ((conf->initial_opts & ax_feedback[i].token)
- == ax_feedback[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_feedback[i].name);
- fprintf(fp, "\n");
- }
- if (conf->axt_opts_on != 0) {
- fprintf(fp, "AcessXTimeoutFeedbackOn %c= ",
- conf->replace_axt_opts_on ? ' ' : '+');
- for (i = count = 0; *ax_controls[i].name; i++)
- if ((conf->axt_opts_on & ax_feedback[i].token)
- == ax_feedback[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_feedback[i].name);
- fprintf(fp, "\n");
- }
- if (conf->axt_opts_off != 0) {
- fprintf(fp, "AcessXTimeoutFeedbackOff%c= ",
- conf->replace_axt_opts_off ? ' ' : '-');
- for (i = count = 0; *ax_feedback[i].name; i++)
- if ((conf->axt_opts_off & ax_feedback[i].token)
- == ax_feedback[i].token)
- fprintf(fp, "%s%s", count++ ? " + " : "",
- ax_feedback[i].name);
- fprintf(fp, "\n");
- }
-
- fclose(fp);
-
- return (True);
-}
-
-Bool
-UpdateKeyboard(Bool load)
-{
- XkbComponentNamesRec comps;
- XkbDescPtr xkb;
-
- bzero((char*)&comps, sizeof(XkbComponentNamesRec));
- XkbRF_GetComponents(xkb_rules->list, &(xkb_info->defs), &comps);
-
- xkb = XkbGetKeyboardByName(DPY, XkbUseCoreKbd, &comps,
- XkbGBN_AllComponentsMask, 0, load);
-
- if (xkb == NULL || xkb->geom == NULL) {
- fprintf(stderr, "Couldn't get keyboard\n");
- return (False);
- }
- if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
- xkb_info->xkb->names->geometry == 0)
- xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
-
- XkbFreeKeyboard(xkb_info->xkb, 0, False);
-
- xkb_info->xkb = xkb;
-
- XtFree(comps.keymap);
- XtFree(comps.keycodes);
- XtFree(comps.compat);
- XtFree(comps.types);
- XtFree(comps.symbols);
- XtFree(comps.geometry);
-
- if (kbd != NULL)
- XClearArea(XtDisplay(configp), XtWindow(kbd), 0, 0, 0, 0, True);
-
- return (True);
-}
-
-static void
-KeyboardRulesCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
- FILE *fp;
- Arg args[1];
- char filename[1024], *omodel, *olayout, *ovariant, *ooptions,
- *dmodel, *dlayout, *dvariant;
- XF86XkbRulesDescInfo *oxkb_rules, *info = GetXkbRulesDesc(XtName(w));
-
- if (strcmp(XtName(w), rules) == 0 || info == NULL)
- /* a error message was printed */
- return;
-
- XmuSnprintf(filename, sizeof(filename), "%s%s",
- XkbRulesDir, info->rules);
- if ((fp = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "Can't open rules file\n");
- return;
- }
-
- if (!XkbRF_LoadRules(fp, info->list)) {
- fclose(fp);
- fprintf(stderr, "Can't load rules\n");
- return;
- }
- fclose(fp);
-
- oxkb_rules = xkb_rules;
- omodel = xkb_info->defs.model;
- olayout = xkb_info->defs.layout;
- ovariant = xkb_info->defs.variant;
- ooptions = xkb_info->defs.options;
-
- if (omodel) {
- for (i = 0; i < info->model.nelem; i++) {
- if (strcmp(omodel, info->model.name[i]) == 0)
- break;
- }
- }
- else
- i = 0;
- model = xkb_info->defs.model = info->model.name
- [i < info->model.nelem ? i : 0];
- dmodel = info->model.desc[i < info->model.nelem ? i : 0];
-
- if (olayout) {
- for (i = 0; i < info->layout.nelem; i++) {
- if (strcmp(olayout, info->layout.name[i]) == 0)
- break;
- }
- }
- else
- i = 0;
- layout = xkb_info->defs.layout = info->layout.name
- [i < info->layout.nelem ? i : 0];
- dlayout = info->layout.desc[i < info->layout.nelem ? i : 0];
-
- if (ovariant) {
- for (i = 0; i < info->variant.nelem; i++) {
- if (strcmp(ovariant, info->variant.name[i]) == 0)
- break;
- }
- }
- else
- i = info->variant.nelem;
- variant = xkb_info->defs.variant = i < info->variant.nelem ?
- info->variant.name[i] : NULL;
- dvariant = i < info->variant.nelem ?
- info->variant.desc[i] : NULL;
-
- if (ooptions) {
- char *ptr, *tmp = XtNewString(options);
-
- for (ptr = strtok(tmp, ","); ptr != NULL; ptr = strtok(NULL, ",")) {
- if (strchr(ptr, ':') == NULL)
- continue;
-
- for (i = 0; i < xkb_rules->option.nelem; i++)
- if (strcmp(xkb_rules->option.name[i], ptr) == 0)
- break;
-
- if (i == xkb_rules->option.nelem) {
- XtFree(options);
- options = NULL;
- /* no option with the same name */
- break;
- }
- }
- XtFree(tmp);
- }
- else {
- XtFree(options);
- options = NULL;
- }
-
- oxkb_rules = xkb_rules;
- xkb_rules = info;
- rules = info->rules;
-
- if (!UpdateKeyboard(False)) {
- model = xkb_info->defs.model = omodel;
- layout = xkb_info->defs.layout = olayout;
- variant = xkb_info->defs.variant = ovariant;
- options = XtNewString(xkb_info->defs.options = ooptions);
- xkb_rules = oxkb_rules;
- rules = xkb_rules->rules;
-
- XmuSnprintf(filename, sizeof(filename), "%s%s",
- XkbRulesDir, rules);
- if ((fp = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "Can't open rules file\n");
- return;
- }
-
- if (!XkbRF_LoadRules(fp, xkb_rules->list)) {
- fclose(fp);
- fprintf(stderr, "Can't load rules\n");
- }
- fclose(fp);
-
- return;
- }
-
- UpdateRulesPopups();
-
- XtSetArg(args[0], XtNlabel, rules);
- XtSetValues(rulesb, args, 1);
-
- XtSetArg(args[0], XtNlabel, dmodel);
- XtSetValues(modelb, args, 1);
-
- XtSetArg(args[0], XtNlabel, dlayout);
- XtSetValues(layoutb, args, 1);
-
- XtSetArg(args[0], XtNlabel, dvariant ? dvariant : "");
- XtSetValues(variantb, args, 1);
-
- XtSetArg(args[0], XtNlabel, options ? options : "");
- XtSetValues(variantb, args, 1);
-}
-
-static void
-KeyboardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- int i;
- char *oldval = xkb_info->defs.model;
-
- for (i = 0; i < xkb_rules->model.nelem; i++)
- if (strcmp(XtName(w), xkb_rules->model.name[i]) == 0)
- break;
- model = xkb_info->defs.model = xkb_rules->model.name[i];
- if (!UpdateKeyboard(False))
- model = xkb_info->defs.model = oldval;
- else {
- XtSetArg(args[0], XtNlabel, xkb_rules->model.desc[i]);
- XtSetValues(modelb, args, 1);
- }
-}
-
-static void
-KeyboardLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- int i;
- char *oldval = xkb_info->defs.layout;
-
- for (i = 0; i < xkb_rules->layout.nelem; i++)
- if (strcmp(XtName(w), xkb_rules->layout.name[i]) == 0)
- break;
- layout = xkb_info->defs.layout = xkb_rules->layout.name[i];
- if (!UpdateKeyboard(False))
- layout = xkb_info->defs.layout = oldval;
- else {
- XtSetArg(args[0], XtNlabel, xkb_rules->layout.desc[i]);
- XtSetValues(layoutb, args, 1);
- }
-}
-
-static void
-KeyboardVariantCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- int i;
- char *label, *oldval = xkb_info->defs.variant;
-
- for (i = 0; i < xkb_rules->variant.nelem; i++)
- if (strcmp(XtName(w), xkb_rules->variant.name[i]) == 0)
- break;
- variant = i < xkb_rules->variant.nelem ? xkb_rules->variant.name[i] : "";
- xkb_info->defs.variant = variant && *variant ? variant : NULL;
-
- if (!UpdateKeyboard(False))
- xkb_info->defs.variant = variant = oldval;
- else {
- label = i < xkb_rules->variant.nelem ? xkb_rules->variant.desc[i] : "";
- XtSetArg(args[0], XtNlabel, label);
- XtSetValues(variantb, args, 1);
- }
-}
-
-static void
-KeyboardOptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- int i;
-
- for (i = 0; i < xkb_rules->option.nelem; i++)
- if (strcmp(XtName(w), xkb_rules->option.name[i]) == 0)
- break;
-
- if (i < xkb_rules->option.nelem) {
- char *delim, *ptr, str[256];
-
- /* remove old string, don't check if the same */
- if ((delim = strchr(XtName(w), ':')) != NULL) {
- if (delim - XtName(w) >= sizeof(str) - 2)
- return;
- strncpy(str, XtName(w), delim - XtName(w) + 1);
- str[delim - XtName(w) + 1] = '\0';
- }
- else
- XmuSnprintf(str, sizeof(str), "%s:", XtName(w));
- if (options && (delim = strstr(options, str)) != NULL) {
- if ((ptr = strchr(delim, ',')) != NULL) {
- *delim = *ptr = '\0';
- XmuSnprintf(str, sizeof(str), "%s%s", options, ptr + 1);
- XtFree(options);
- options = XtNewString(str);
- }
- else {
- if (delim > options)
- delim[-1] = '\0';
- else
- delim[0] = '\0';
- }
- }
-
- /* update string, if required */
- if ((delim = strchr(XtName(w), ':')) != NULL) {
- if (options && *options)
- XmuSnprintf(str, sizeof(str), "%s,%s", options, XtName(w));
- else
- XmuSnprintf(str, sizeof(str), "%s", XtName(w));
- XtFree(options);
- options = XtNewString(str);
- }
- }
- else {
- XtFree(options);
- options = XtNewString("");
- }
-
- if (options == NULL)
- options = XtNewString("");
-
- xkb_info->defs.options = options;
- if (!UpdateKeyboard(False)) {
- *options = '\0';
- xkb_info->defs.options = NULL;
- }
- XtSetArg(args[0], XtNlabel, options);
- XtSetValues(optionsb, args, 1);
- XtSetArg(args[0], XtNtip, options);
- XtSetValues(optionsb, args, 1);
-}
-
-/*ARGSUSED*/
-static void
-KeyboardApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- (void)UpdateKeyboard(True);
-}
-
-static void
-UpdateRulesPopups(void)
-{
- int i;
- char *optname;
- Widget sme, optpopup = NULL, optparent;
-
- /* MODEL */
- if (modelp)
- XtDestroyWidget(modelp);
- modelp = XtCreatePopupShell("modelP", simpleMenuWidgetClass,
- modelb, NULL, 0);
- for (i = 0; i < xkb_rules->model.nelem; i++) {
- sme = XtVaCreateManagedWidget(xkb_rules->model.name[i], smeBSBObjectClass,
- modelp,
- XtNlabel, xkb_rules->model.desc[i],
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardModelCallback, NULL);
- }
-
- /* LAYOUT */
- if (layoutp)
- XtDestroyWidget(layoutp);
- layoutp = XtCreatePopupShell("layoutP", simpleMenuWidgetClass,
- layoutb, NULL, 0);
- for (i = 0; i < xkb_rules->layout.nelem; i++) {
- sme = XtVaCreateManagedWidget(xkb_rules->layout.name[i], smeBSBObjectClass,
- layoutp,
- XtNlabel, xkb_rules->layout.desc[i],
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardLayoutCallback, NULL);
- }
-
- /* VARIANT */
- if (variantp)
- XtDestroyWidget(variantp);
- variantp = XtCreatePopupShell("variantP", simpleMenuWidgetClass,
- variantb, NULL, 0);
- sme = XtVaCreateManagedWidget("None", smeBSBObjectClass,
- variantp,
- XtNlabel, "None",
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardVariantCallback, NULL);
- for (i = 0; i < xkb_rules->variant.nelem; i++) {
- sme = XtVaCreateManagedWidget(xkb_rules->variant.name[i], smeBSBObjectClass,
- variantp,
- XtNlabel, xkb_rules->variant.desc[i],
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardVariantCallback, NULL);
- }
-
- /* OPTIONS */
- if (optionsp)
- XtDestroyWidget(optionsp);
- optionsp = XtCreatePopupShell("optionsP", simpleMenuWidgetClass,
- optionsb, NULL, 0);
- sme = XtVaCreateManagedWidget("None", smeBSBObjectClass,
- optionsp,
- XtNlabel, "None",
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
- optparent = optionsp;
- optname = NULL;
- for (i = 0; i < xkb_rules->option.nelem; i++) {
- if (!strchr(xkb_rules->option.name[i], ':')) {
- optpopup =
- XtCreatePopupShell(optname = xkb_rules->option.desc[i],
- simpleMenuWidgetClass,
- optparent = optionsp, NULL, 0);
- sme = XtVaCreateManagedWidget(xkb_rules->option.name[i],
- smeBSBObjectClass,
- optpopup,
- XtNlabel, "None",
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
- }
- else {
- optparent = optpopup;
- optname = NULL;
- }
- sme = XtVaCreateManagedWidget(xkb_rules->option.name[i], smeBSBObjectClass,
- optparent,
- XtNlabel, xkb_rules->option.desc[i],
- XtNmenuName, optname,
- XtNleftBitmap, optname ? menuPixmap : None,
- NULL, 0);
- if (optparent != optionsp)
- XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
- }
-}
-
-void
-KeyboardModelAndLayout(XF86SetupInfo *info)
-{
- static int first = 1;
- static Widget kbdml;
- Arg args[1];
- int i;
-
- if (first) {
- Widget popup, sme;
-
- first = 0;
-
- kbdml = XtCreateWidget("keyboardML", formWidgetClass,
- configp, NULL, 0);
-
- /* RULES */
- XtCreateManagedWidget("labelR", labelWidgetClass, kbdml, NULL, 0);
- rulesb = XtVaCreateManagedWidget("rules", menuButtonWidgetClass, kbdml,
- XtNmenuName, "rulesP",
- NULL, 0);
- popup = XtCreatePopupShell("rulesP", simpleMenuWidgetClass,
- rulesb, NULL, 0);
- {
- struct dirent *ent;
- DIR *dir;
-
- if ((dir = opendir(XkbRulesDir)) != NULL) {
- (void)readdir(dir);
- (void)readdir(dir);
- while ((ent = readdir(dir)) != NULL) {
- if (strchr(ent->d_name, '.'))
- continue;
-
- sme = XtVaCreateManagedWidget(ent->d_name, smeBSBObjectClass,
- popup,
- XtNlabel, ent->d_name,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, KeyboardRulesCallback, NULL);
- }
- closedir(dir);
- }
- }
-
- /* MODEL */
- XtCreateManagedWidget("labelM", labelWidgetClass, kbdml, NULL, 0);
- modelb = XtVaCreateManagedWidget("model", menuButtonWidgetClass, kbdml,
- XtNmenuName, "modelP",
- NULL, 0);
-
- /* LAYOUT */
- XtCreateManagedWidget("labelL", labelWidgetClass, kbdml, NULL, 0);
- layoutb = XtVaCreateManagedWidget("layout", menuButtonWidgetClass, kbdml,
- XtNmenuName, "layoutP",
- XtNlabel, xkb_rules->layout.desc[0],
- NULL, 0);
-
- /* VARIANT */
- XtCreateManagedWidget("labelV", labelWidgetClass, kbdml, NULL, 0);
- variantb = XtVaCreateManagedWidget("variant", menuButtonWidgetClass, kbdml,
- XtNmenuName, "variantP",
- XtNlabel, "",
- NULL, 0);
-
- /* OPTIONS */
- XtCreateManagedWidget("labelO", labelWidgetClass, kbdml, NULL, 0);
- optionsb = XtVaCreateManagedWidget("options", menuButtonWidgetClass, kbdml,
- XtNmenuName, "optionsP",
- XtNlabel, "",
- NULL, 0);
-
- UpdateRulesPopups();
-
- kbd = XtCreateManagedWidget("keyboard", coreWidgetClass,
- kbdml, NULL, 0);
-
- apply = XtCreateManagedWidget("apply", commandWidgetClass,
- kbdml, NULL, 0);
- XtAddCallback(apply, XtNcallback, KeyboardApplyCallback, NULL);
-
- XtRealizeWidget(kbdml);
-
- XtAddEventHandler(kbd, ExposureMask, False, XkbUIEventHandler, NULL);
- /* Force the first update */
- XClearArea(XtDisplay(kbd), XtWindow(kbd), 0, 0, 0, 0, True);
- }
-
- XtSetArg(args[0], XtNlabel, xkb_rules->rules);
- XtSetValues(rulesb, args, 1);
-
- for (i = 0; i < xkb_rules->model.nelem; i++)
- if (strcmp(model, xkb_rules->model.name[i]) == 0) {
- XtSetArg(args[0], XtNlabel, xkb_rules->model.desc[i]);
- XtSetValues(modelb, args, 1);
- break;
- }
-
- for (i = 0; i < xkb_rules->layout.nelem; i++)
- if (strcmp(layout, xkb_rules->layout.name[i]) == 0) {
- XtSetArg(args[0], XtNlabel, xkb_rules->layout.desc[i]);
- XtSetValues(layoutb, args, 1);
- break;
- }
-
- if (variant)
- for (i = 0; i < xkb_rules->variant.nelem; i++)
- if (strcmp(variant, xkb_rules->variant.name[i]) == 0) {
- XtSetArg(args[0], XtNlabel, xkb_rules->variant.desc[i]);
- XtSetValues(variantb, args, 1);
- break;
- }
-
- if (options) {
- XtSetArg(args[0], XtNlabel, options);
- XtSetValues(optionsb, args, 1);
- }
-
- XtChangeManagedSet(&current, 1, NULL, NULL, &kbdml, 1);
- current = kbdml;
-}
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.h b/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
deleted file mode 100644
index 6ff63c002..000000000
--- a/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.h,v 1.3 2001/03/02 22:39:27 paulo Exp $
- */
-
-#include "config.h"
-#include <X11/extensions/XKBconfig.h>
-
-#ifndef _xf86cfg_keyboard_h
-#define _xf86cfg_keyboard_h
-
-/*
- * All file names are from XProjectRoot or XWINHOME environment variable.
- */
-#define XkbConfigDir "lib/X11/xkb/"
-#define XkbConfigFile "X0-config.keyboard"
-
-/*
- * Types
- */
-typedef struct {
- char **name;
- char **desc;
- int nelem;
-} XF86XkbDescInfo;
-
-typedef struct {
- XF86ConfInputPtr conf;
- XkbDescPtr xkb;
- XkbRF_VarDefsRec defs;
- XkbConfigRtrnRec config;
-} XkbInfo;
-
-/*
- * Prototypes
- */
-XtPointer KeyboardConfig(XtPointer);
-void KeyboardModelAndLayout(XF86SetupInfo*);
-void InitializeKeyboard(void);
-Bool UpdateKeyboard(Bool);
-Bool WriteXKBConfiguration(char*, XkbConfigRtrnPtr);
-
-/*
- * Initialization
- */
-extern XkbInfo *xkb_info;
-
-#endif /* _xf86cfg_keyboard_h */
diff --git a/hw/xfree86/utils/xorgcfg/keyboard.xbm b/hw/xfree86/utils/xorgcfg/keyboard.xbm
deleted file mode 100644
index 69d4aac42..000000000
--- a/hw/xfree86/utils/xorgcfg/keyboard.xbm
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard.xbm,v 1.1 2000/04/04 22:36:59 dawes Exp $
- */
-#define keyboard_width 50
-#define keyboard_height 44
-static unsigned char keyboard_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0xff,
- 0xff, 0x1f, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x78, 0x9e,
- 0xe7, 0x3d, 0xef, 0x79, 0x00, 0x18, 0x9a, 0xa6, 0x35, 0xad, 0x61, 0x00,
- 0x18, 0x9e, 0xe7, 0x3d, 0xef, 0x61, 0x00, 0x18, 0x9e, 0xe7, 0x3d, 0xef,
- 0x61, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x18, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98,
- 0xd6, 0x5a, 0x6b, 0x2d, 0x66, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x66,
- 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x66, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x80, 0x66, 0x00, 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x66, 0x00, 0x98, 0x58,
- 0x6b, 0xad, 0xb5, 0x66, 0x00, 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x67, 0x00,
- 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x60, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98, 0xd6, 0x5a,
- 0x6b, 0x2d, 0x66, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98,
- 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60,
- 0x00, 0x98, 0xf7, 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x98, 0x96, 0x05, 0x96,
- 0xb5, 0x66, 0x00, 0x98, 0xf7, 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x98, 0xf7,
- 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
- 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/keyboard.xpm b/hw/xfree86/utils/xorgcfg/keyboard.xpm
deleted file mode 100644
index 5ef7b605d..000000000
--- a/hw/xfree86/utils/xorgcfg/keyboard.xpm
+++ /dev/null
@@ -1,66 +0,0 @@
-/* XPM */
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard.xpm,v 1.1 2000/04/04 22:36:59 dawes Exp $
- */
-static char * card_xpm[] = {
-"60 28 5 1",
-" c none",
-". c #AEBAAEBAAEBA",
-"X c #CF3CCF3CCF3C",
-"o c #8E388A288E38",
-"O c #69A671C669A6",
-" ........................ ",
-" .............................XXXXXXXXXXXXXXXXXXXXXXXX..... ",
-".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................XXXXoO",
-".X........................................................oO",
-".X........................................................oO",
-".X.Xo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.Xo.Xo..Xo.Xo.Xo..ooooooooooo.oO",
-".X.oo..oo.oo.oo..oo.oo.oo.oo.oo.oo..oo.oo.oo..XXXXXXXXXXX.oO",
-".X........................................................oO",
-".X........................................................oO",
-".X.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.o..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
-".X.oo.oo.oo.oo.oo.oo.oo.oo.oo.oo.o..oo.oo.oo..oo.oo.oo.oo.oO",
-".X........................................................oO",
-".X.XXo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.oXo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
-".X.ooo.oo.oo.oo.oo.oo.oo.oo.oo..Xo..oo.oo.oo..oo.oo.oo.Xo.oO",
-".X..............................Xo.....................Xo.oO",
-".X.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.XXXo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
-".X.oo.oo.oo.oo.oo.oo.oo.oo.oo.oooo..oo.oo.oo..oo.oo.oo.oo.oO",
-".X........................................................oO",
-".X.XXo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.XXo.....Xo.....Xo.Xo.Xo.Xo.oO",
-".X.ooo.oo.oo.oo.oo.oo.oo.oo.oo.ooo.....oo.....oo.oo.oo.Xo.oO",
-".X.....................................................Xo.oO",
-".X.Xo.Xo.Xo.XXXXXXXXXXXXo.Xo.Xo.Xo..Xo.Xo.Xo..XXXXo.Xo.Xo.oO",
-".X.oo.oo.oo.ooooooooooooo.oo.oo.oo..oo.oo.oo..ooooo.oo.oo.oO",
-".X........................................................oO",
-".X........................................................oO",
-".Xooooo.......................oooooooooooooooooooooooooooooO",
-" XOOOOOoooooooooooooooooooooooOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ",
-" OOOOOOOOOOOOOOOOOOOOOOO "};
diff --git a/hw/xfree86/utils/xorgcfg/left.xbm b/hw/xfree86/utils/xorgcfg/left.xbm
deleted file mode 100644
index bfb8f3ba8..000000000
--- a/hw/xfree86/utils/xorgcfg/left.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define left_width 19
-#define left_height 19
-static unsigned char left_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x07, 0x00, 0x80, 0x07, 0x00, 0xc0, 0x07, 0x00, 0xe0, 0xff, 0x01,
- 0xf0, 0xff, 0x01, 0xf8, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xe0, 0xff, 0x01,
- 0xc0, 0x07, 0x00, 0x80, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/loader.c b/hw/xfree86/utils/xorgcfg/loader.c
deleted file mode 100644
index ddfa2903f..000000000
--- a/hw/xfree86/utils/xorgcfg/loader.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.19 2002/06/06 21:03:32 paulo Exp $
- */
-
-#include "config.h"
-#include "cards.h"
-#include "options.h"
-#include "loader.h"
-#include "stubs.h"
-#include <X11/Xresource.h>
-
-#ifdef USE_MODULES
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <ctype.h>
-
-#include <stdarg.h>
-
-#ifndef SIGNALRETURNSINT
-void sig_handler(int);
-#else
-int sig_handler(int);
-#endif /* SIGNALRETURNSINT */
-
-static Bool EnumDatabase(XrmDatabase*, XrmBindingList, XrmQuarkList,
- XrmRepresentation*, XrmValue*, XPointer);
-
-static sigjmp_buf jmp;
-int signal_caught;
-int error_level;
-char *loaderPath, **loaderList, **ploaderList;
-extern XrmDatabase options_xrm;
-extern int noverify;
-extern ModuleType module_type;
-static OptionInfoPtr option;
-
-extern FontModule *font_module;
-extern int numFontModules;
-
-char **checkerLegend;
-int *checkerErrors;
-
-#ifndef SIGNALRETURNSINT
-void
-#else
-int
-#endif
-sig_handler(int sig)
-{
- char *str;
-
- switch (sig) {
- case SIGTRAP:
- str = "TRAP";
- break;
- case SIGBUS:
- str = "BUS";
- break;
- case SIGSEGV:
- str = "SEGV";
- break;
- case SIGILL:
- str = "ILL";
- break;
- case SIGFPE:
- str = "FPE";
- break;
- default:
- str = "???";
- break;
- }
-
- if (signal_caught == 1) {
- ErrorF(" ERROR I am dead.\n");
- exit(1);
- }
- else if (signal_caught == 2)
- abort();
- ++signal_caught;
- ErrorF(" ERROR SIG%s caught!\n", str);
- if (!noverify)
- error_level += 50;
- siglongjmp(jmp, 1);
- /*NOTREACHED*/
-}
-
-void
-CheckMsg(int code, char *fmt, ...)
-{
- va_list ap;
-
- ++checkerErrors[code];
- ErrorF("%3d ", code);
-
- va_start(ap, fmt);
- VErrorF(fmt, ap);
- va_end(ap);
-}
-
-static Bool
-EnumDatabase(XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
- XrmRepresentation *type, XrmValue *value, XPointer closure)
-{
- char *res = XrmQuarkToString(quarks[1]);
-
- if (res) {
- option = module_options->option;
- while (option->name) {
- if (strcasecmp(option->name, res) == 0)
- return (False);
- ++option;
- }
- CheckMsg(CHECKER_OPTION_UNUSED,
- "WARNING %s.%s is not used\n",
- XrmQuarkToString(quarks[0]), res);
- ++error_level;
- }
-
- return (False);
-}
-
-Bool
-LoaderInitializeOptions(void)
-{
- static int first = 1;
- static char *modules = "lib/modules";
- volatile Bool options_ok = False;
- char *ptr, query[256];
- char *ptr2, query2[256];
- char *type;
- XrmValue value;
- XrmQuark names[2];
- XrmQuark classes[2];
- volatile int i;
- static ModuleType module_types[] = {
- GenericModule, FontRendererModule, InputModule, VideoModule, NullModule
- };
-
- /* The offset in this vector must match loader.h:enum ModuleType values */
- static char *module_strs[] = {
- "Null Module", "Video Module", "Input Module", "Generic Module", "Font Module"
- };
-
- if (first) {
- checkerLegend = (char**)
- XtCalloc(1, sizeof(char*) * (CHECKER_LAST_MESSAGE + 1));
- checkerErrors = (int*)
- XtCalloc(1, sizeof(int) * (CHECKER_LAST_MESSAGE + 1));
- xf86cfgLoaderInit();
- first = 0;
-
- checkerLegend[CHECKER_OPTIONS_FILE_MISSING] =
- "The Options file, normally /usr/X11R6/lib/X11/Options was not found.\n"
- "In the sources, it is at xc/programs/Xserver/hw/xfree86/Options.";
- checkerLegend[CHECKER_OPTION_DESCRIPTION_MISSING] =
- "No description for the module option. The description should be in\n"
- "in the Options file, and using the sintax:\n"
- "Module.Option: any text describing the option";
- checkerLegend[CHECKER_LOAD_FAILED] =
- "Failed to load the module. Usually the loader will print a complete\n"
- "description for the reason the module was not loaded. Use the -verbose\n"
- "command line option if it is not printing any messages.";
- checkerLegend[CHECKER_RECOGNIZED_AS] =
- "This message means the module code did not follow what was expected\n"
- "by the checker. For video drivers, it did not call xf86AddDriver,\n"
- "a input module did not call xf86AddInputDriver and a font renderer\n"
- "module did not call LoadFont. This message can also be printed if\n"
- "the module is in the incorrect directory.";
- checkerLegend[CHECKER_NO_OPTIONS_AVAILABLE] =
- "The driver does not have an AvailableOptions function, or that\n"
- "function is returning NULL. If the driver is returning NULL, and\n"
- "really does not need any options from XF86Config, than the message\n"
- "can be ignored.";
- checkerLegend[CHECKER_NO_VENDOR_CHIPSET] =
- "The checker could not fetch the PCI chipset/vendor information from\n"
- "the module. The checker currently wraps xf86PrintChipsets and\n"
- "xf86MatchPciInstances to read the information from the module.";
- checkerLegend[CHECKER_CANNOT_VERIFY_CHIPSET] =
- "The vendor id was not found, so it is not possible to search the list\n"
- "of chipsets.";
- checkerLegend[CHECKER_OPTION_UNUSED] =
- "The option description is defined in the Options file, but the option\n"
- "was name not retrieved when calling the module AvailableOptions.";
- checkerLegend[CHECKER_NOMATCH_CHIPSET_STRINGS] =
- "The string specified in the module does not match the one in\n"
- "common/xf86PciInfo.h";
- checkerLegend[CHECKER_CHIPSET_NOT_LISTED] =
- "This means that common/xf86PciInfo.h does not have an entry for the\n"
- "given vendor and id.";
- checkerLegend[CHECKER_CHIPSET_NOT_SUPPORTED] =
- "The chipset is listed in common/xf86PciInfo.h, but the driver does\n"
- "not support it, or does not list it in the chipsets fetched by the checker.";
- checkerLegend[CHECKER_CHIPSET_NO_VENDOR] =
- "The vendor id specified to xf86MatchPciInstances is not defined in\n"
- "common/xf86PciInfo.h";
- checkerLegend[CHECKER_NO_CHIPSETS] =
- "No chipsets were passed to xf86MatchPciIntances.";
- checkerLegend[CHECKER_FILE_MODULE_NAME_MISMATCH] =
- "The module name string does not match the the modname field of the\n"
- "XF86ModuleVersionInfo structure. This generally is not an error, but\n"
- "to may be a good idea to use the same string to avoid confusion.";
- }
-
- if (XF86Module_path == NULL) {
- XF86Module_path = malloc(strlen(XFree86Dir) + strlen(modules) + 2);
- sprintf(XF86Module_path, "%s/%s", XFree86Dir, modules);
- }
-
- if (loaderPath == NULL || strcmp(XF86Module_path, loaderPath))
- loaderPath = strdup(XF86Module_path);
- else
- /* nothing new */
- return (True);
-
- if (!noverify) {
- options_ok = InitializeOptionsDatabase();
- InitializePciInfo();
- }
-
- for (i = 0; module_types[i] != NullModule; i++) {
- xf86cfgLoaderInitList(module_types[i]);
- if (!noverify)
- ErrorF("================= Checking modules of type \"%s\" =================\n",
- module_strs[module_types[i]]);
-
- if (loaderList) {
- for (ploaderList = loaderList; *ploaderList; ploaderList++) {
- signal_caught = 0;
- signal(SIGTRAP, sig_handler);
- signal(SIGBUS, sig_handler);
- signal(SIGSEGV, sig_handler);
- signal(SIGILL, sig_handler);
- signal(SIGFPE, sig_handler);
- if (sigsetjmp(jmp, 1) == 0) {
- if (!noverify) {
- int ok, nfont_modules;
-
- nfont_modules = numFontModules;
- error_level = 0;
- ErrorF("CHECK MODULE %s\n", *ploaderList);
- if ((ok = xf86cfgCheckModule()) == 0) {
- CheckMsg(CHECKER_LOAD_FAILED,
- "ERROR Failed to load module.\n");
- error_level += 50;
- }
- else if (module_type != module_types[i]) {
- CheckMsg(CHECKER_RECOGNIZED_AS,
- "WARNING %s recognized as a \"%s\"\n", *ploaderList,
- module_strs[module_type]);
- ++error_level;
- }
- if (ok) {
- if (options_ok) {
- if ((module_options == NULL || module_options->option == NULL) &&
- module_type != GenericModule) {
- CheckMsg(CHECKER_NO_OPTIONS_AVAILABLE,
- "WARNING Not a generic module, but no options available.\n");
- ++error_level;
- }
- else if (module_options && strcmp(module_options->name, *ploaderList) == 0) {
- ErrorF(" CHECK OPTIONS\n");
- option = module_options->option;
-
- while (option->name) {
- XmuSnprintf(query, sizeof(query), "%s.%s", *ploaderList, option->name);
- for (ptr = query, ptr2 = query2; *ptr; ptr++) {
- if (*ptr != '_' && *ptr != ' ' && *ptr != '\t')
- *ptr2 = tolower(*ptr);
- }
- *ptr2 = '\0';
- /* all resources are in lowercase */
- if (!XrmGetResource(options_xrm, query2, "Module.Option", &type, &value) ||
- value.addr == NULL) {
- CheckMsg(CHECKER_OPTION_DESCRIPTION_MISSING,
- "WARNING no description for %s\n", query);
- ++error_level;
- }
- ++option;
- }
-
- /* now do a linear search for Options file entries that are not
- * in the driver.
- */
- names[0] = XrmPermStringToQuark(module_options->name);
- classes[0] = XrmPermStringToQuark("Option");
- names[1] = classes[1] = NULLQUARK;
- (void)XrmEnumerateDatabase(options_xrm, (XrmNameList)&names, (XrmClassList)&classes,
- XrmEnumOneLevel, EnumDatabase, NULL);
- }
- }
- else {
- CheckMsg(CHECKER_OPTIONS_FILE_MISSING,
- "ERROR Options file missing.\n");
- error_level += 10;
- }
-
- if (module_type == VideoModule &&
- (module_options == NULL || module_options->vendor < 0 ||
- module_options->chipsets == NULL)) {
- CheckMsg(CHECKER_NO_VENDOR_CHIPSET,
- "WARNING No vendor/chipset information available.\n");
- ++error_level;
- }
- else if (module_type == VideoModule) {
- if (module_options == NULL) {
- /* No description for this, if this happen,
- * something really strange happened. */
- ErrorF(" ERROR No module_options!?!\n");
- error_level += 50;
- }
- else {
- ErrorF(" CHECK CHIPSETS\n");
- CheckChipsets(module_options, &error_level);
- }
- }
-
- /* font modules check */
- if (module_type == FontRendererModule) {
- if (strcmp(*ploaderList, font_module->name)) {
- /* not an error */
- ErrorF(" NOTICE FontModule->name specification mismatch: \"%s\" \"%s\"\n",
- *ploaderList, font_module->name);
- }
- if (nfont_modules + 1 != numFontModules) {
- /* not an error */
- ErrorF(" NOTICE font module \"%s\" loaded more than one font renderer.\n",
- *ploaderList);
- }
- }
- else if (nfont_modules != numFontModules) {
- ErrorF(" WARNING number of font modules changed from %d to %d.\n",
- nfont_modules, numFontModules);
- ++error_level;
- }
- }
- ErrorF(" SUMMARY error_level set to %d.\n\n", error_level);
- }
- else
- (void)xf86cfgCheckModule();
- }
- signal(SIGTRAP, SIG_DFL);
- signal(SIGBUS, SIG_DFL);
- signal(SIGSEGV, SIG_DFL);
- signal(SIGILL, SIG_DFL);
- signal(SIGFPE, SIG_DFL);
- }
- xf86cfgLoaderFreeList();
- }
- else
- ErrorF(" ERROR Failed to initialize module list.\n");
- }
-
- if (!noverify) {
- ErrorF("===================================== LEGEND ===============================\n");
- ErrorF("NOTICE lines are just informative.\n");
- ErrorF("WARNING lines add 1 to error_level.\n");
- ErrorF("ERROR lines add 2 or more (based on the severity of the error) to error_level.\n\n");
- for (i = 0; i <= CHECKER_LAST_MESSAGE; i++)
- if (checkerErrors[i]) {
- ErrorF("%3d\n%s\n\n", i, checkerLegend[i]);
- }
- }
-
- return (True);
-}
-#endif
diff --git a/hw/xfree86/utils/xorgcfg/loader.h b/hw/xfree86/utils/xorgcfg/loader.h
deleted file mode 100644
index f3f8490bc..000000000
--- a/hw/xfree86/utils/xorgcfg/loader.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.7 2001/07/09 23:45:24 paulo Exp $
- */
-
-#ifdef USE_MODULES
-#ifndef LOADER_PRIVATE
-#include "config.h"
-#include "stubs.h"
-
-#else
-
-#define XFree86LOADER /* not really */
-#define IN_LOADER
-
-#include "xf86.h"
-#include "xf86str.h"
-#include "xf86Opt.h"
-#include "xf86Module.h"
-
-#define XINPUT
-#include "xf86Xinput.h"
-
-#include "fontmod.h"
-#include "loaderProcs.h"
-
-#include <sym.h>
-#include <xf86_ansic.h>
-
-void LoaderDefaultFunc(void);
-#endif
-
-#ifndef _xf86cfg_loader_h
-#define _xf86cfg_loader_h
-
-void xf86cfgLoaderInit(void);
-void xf86cfgLoaderInitList(int);
-void xf86cfgLoaderFreeList(void);
-int xf86cfgCheckModule(void);
-
-#ifndef LOADER_PRIVATE
-/* common/xf86Opt.h */
-typedef struct {
- double freq;
- int units;
-} OptFrequency;
-
-typedef union {
- unsigned long num;
- char * str;
- double realnum;
- Bool bool;
- OptFrequency freq;
-} ValueUnion;
-
-typedef enum {
- OPTV_NONE = 0,
- OPTV_INTEGER,
- OPTV_STRING, /* a non-empty string */
- OPTV_ANYSTR, /* Any string, including an empty one */
- OPTV_REAL,
- OPTV_BOOLEAN,
- OPTV_FREQ
-} OptionValueType;
-
-typedef enum {
- OPTUNITS_HZ = 1,
- OPTUNITS_KHZ,
- OPTUNITS_MHZ
-} OptFreqUnits;
-
-typedef struct {
- int token;
- const char* name;
- OptionValueType type;
- ValueUnion value;
- Bool found;
-} OptionInfoRec, *OptionInfoPtr;
-
-/* fontmod.h */
-typedef void (*InitFont)(void);
-
-typedef struct {
- InitFont initFunc;
- char * name;
- void *module;
-} FontModule;
-
-extern FontModule *FontModuleList;
-
-typedef struct {
- int token; /* id of the token */
- const char * name; /* token name */
-} SymTabRec, *SymTabPtr;
-#endif /* !LOADER_PRIVATE */
-
-typedef enum {
- NullModule = 0,
- VideoModule,
- InputModule,
- GenericModule,
- FontRendererModule
-} ModuleType;
-
-typedef struct _xf86cfgModuleOptions {
- char *name;
- ModuleType type;
- OptionInfoPtr option;
- int vendor;
- SymTabPtr chipsets;
- struct _xf86cfgModuleOptions *next;
-} xf86cfgModuleOptions;
-
-extern xf86cfgModuleOptions *module_options;
-
-/* When adding a new code to the LEGEND, also update checkerLegend
- * in loader.c
- */
-extern char **checkerLegend;
-extern int *checkerErrors;
-#define CHECKER_OPTIONS_FILE_MISSING 1
-#define CHECKER_OPTION_DESCRIPTION_MISSING 2
-#define CHECKER_LOAD_FAILED 3
-#define CHECKER_RECOGNIZED_AS 4
-#define CHECKER_NO_OPTIONS_AVAILABLE 5
-#define CHECKER_NO_VENDOR_CHIPSET 6
-#define CHECKER_CANNOT_VERIFY_CHIPSET 7
-#define CHECKER_OPTION_UNUSED 8
-#define CHECKER_NOMATCH_CHIPSET_STRINGS 9
-#define CHECKER_CHIPSET_NOT_LISTED 10
-#define CHECKER_CHIPSET_NOT_SUPPORTED 11
-#define CHECKER_CHIPSET_NO_VENDOR 12
-#define CHECKER_NO_CHIPSETS 13
-#define CHECKER_FILE_MODULE_NAME_MISMATCH 14
-
-#define CHECKER_LAST_MESSAGE 14
-
-extern void CheckMsg(int, char*, ...);
-
-#ifndef LOADER_PRIVATE
-int LoaderInitializeOptions(void);
-#endif
-#endif /* USE_MODULES */
-
-#endif /* _xf86cfg_loader_h */
diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c
deleted file mode 100644
index e3f4e9f47..000000000
--- a/hw/xfree86/utils/xorgcfg/loadmod.c
+++ /dev/null
@@ -1,682 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.18 2003/06/12 14:12:38 eich Exp $
- */
-
-#ifdef USE_MODULES
-#include <setjmp.h>
-
-#ifndef HAS_GLIBC_SIGSETJMP
-#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
- (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
- ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
-#define HAS_GLIBC_SIGSETJMP 1
-#endif
-#endif
-
-#define LOADER_PRIVATE
-#include "loader.h"
-
-#define True 1
-#define False 0
-#define XtPointer char*
-#define XtMalloc malloc
-#define XtCalloc calloc
-#define XtRealloc realloc
-#define XtFree free
-#define XtNew(t) malloc(sizeof(t))
-#define XtNewString(s) ((s) ? strdup(s) : NULL)
-
-#define pointer void*
-
-/* XXX beware (or fix it) libc functions called here are the xf86 ones */
-
-static void AddModuleOptions(char*, const OptionInfoRec*);
-#if 0
-void xf86AddDriver(DriverPtr, void*, int);
-Bool xf86ServerIsOnlyDetecting(void);
-void xf86AddInputDriver(InputDriverPtr, pointer, int);
-void xf86AddModuleInfo(ModuleInfoPtr, void*);
-Bool xf86LoaderCheckSymbol(const char*);
-void xf86LoaderRefSymLists(const char **, ...);
-void xf86LoaderReqSymLists(const char **, ...);
-void xf86Msg(int, const char*, ...);
-void xf86MsgVerb(int, int, const char*, ...);
-void xf86PrintChipsets(const char*, const char*, SymTabPtr);
-void xf86ErrorFVerb(int verb, const char *format, ...);
-pciVideoPtr *xf86GetPciVideoInfo(void);
-int xf86MatchDevice(const char*, GDevPtr**);
-int xf86MatchPciInstances(const char*, int, SymTabPtr, PciChipsets*, GDevPtr*, int, DriverPtr,int**);
-int xf86MatchIsaInstances(const char*, SymTabPtr, pointer*, DriverPtr, pointer, GDevPtr*, int, int**);
-void *xf86LoadDrvSubModule(DriverPtr drv, const char*);
-void xf86DrvMsg(int, int, const char*, ...);
-pciConfigPtr *xf86GetPciConfigInfo(void);
-Bool xf86IsPrimaryPci(pcVideoPtr*);
-Bool xf86CheckPciSlot(int bus, int device, int func);
-#endif
-
-extern char *loaderPath, **loaderList, **ploaderList;
-xf86cfgModuleOptions *module_options;
-FontModule *font_module;
-int numFontModules;
-
-extern int noverify, error_level;
-
-int xf86ShowUnresolved = 1;
-
-LOOKUP miLookupTab[] = {{0,0}};
-LOOKUP dixLookupTab[] = {{0,0}};
-LOOKUP fontLookupTab[] = {{0,0}};
-LOOKUP extLookupTab[] = {{0,0}};
-LOOKUP xfree86LookupTab[] = {
- /* Loader functions */
- SYMFUNC(LoaderDefaultFunc)
- SYMFUNC(LoadSubModule)
- SYMFUNC(DuplicateModule)
- SYMFUNC(LoaderErrorMsg)
- SYMFUNC(LoaderCheckUnresolved)
- SYMFUNC(LoadExtension)
- SYMFUNC(LoadFont)
- SYMFUNC(LoaderReqSymbols)
- SYMFUNC(LoaderReqSymLists)
- SYMFUNC(LoaderRefSymbols)
- SYMFUNC(LoaderRefSymLists)
- SYMFUNC(UnloadSubModule)
- SYMFUNC(LoaderSymbol)
- SYMFUNC(LoaderListDirs)
- SYMFUNC(LoaderFreeDirList)
- SYMFUNC(LoaderGetOS)
-
- /*
- * these here are our own interfaces to libc functions
- */
- SYMFUNC(xf86abort)
- SYMFUNC(xf86abs)
- SYMFUNC(xf86acos)
- SYMFUNC(xf86asin)
- SYMFUNC(xf86atan)
- SYMFUNC(xf86atan2)
- SYMFUNC(xf86atof)
- SYMFUNC(xf86atoi)
- SYMFUNC(xf86atol)
- SYMFUNC(xf86bsearch)
- SYMFUNC(xf86ceil)
- SYMFUNC(xf86calloc)
- SYMFUNC(xf86clearerr)
- SYMFUNC(xf86close)
- SYMFUNC(xf86cos)
- SYMFUNC(xf86exit)
- SYMFUNC(xf86exp)
- SYMFUNC(xf86fabs)
- SYMFUNC(xf86fclose)
- SYMFUNC(xf86feof)
- SYMFUNC(xf86ferror)
- SYMFUNC(xf86fflush)
- SYMFUNC(xf86fgetc)
- SYMFUNC(xf86fgetpos)
- SYMFUNC(xf86fgets)
- SYMFUNC(xf86finite)
- SYMFUNC(xf86floor)
- SYMFUNC(xf86fmod)
- SYMFUNC(xf86fopen)
- SYMFUNC(xf86fprintf)
- SYMFUNC(xf86fputc)
- SYMFUNC(xf86fputs)
- SYMFUNC(xf86fread)
- SYMFUNC(xf86free)
- SYMFUNC(xf86freopen)
- SYMFUNC(xf86frexp)
- SYMFUNC(xf86fscanf)
- SYMFUNC(xf86fseek)
- SYMFUNC(xf86fsetpos)
- SYMFUNC(xf86ftell)
- SYMFUNC(xf86fwrite)
- SYMFUNC(xf86getc)
- SYMFUNC(xf86getenv)
- SYMFUNC(xf86getpagesize)
- SYMFUNC(xf86hypot)
- SYMFUNC(xf86ioctl)
- SYMFUNC(xf86isalnum)
- SYMFUNC(xf86isalpha)
- SYMFUNC(xf86iscntrl)
- SYMFUNC(xf86isdigit)
- SYMFUNC(xf86isgraph)
- SYMFUNC(xf86islower)
- SYMFUNC(xf86isprint)
- SYMFUNC(xf86ispunct)
- SYMFUNC(xf86isspace)
- SYMFUNC(xf86isupper)
- SYMFUNC(xf86isxdigit)
- SYMFUNC(xf86labs)
- SYMFUNC(xf86ldexp)
- SYMFUNC(xf86log)
- SYMFUNC(xf86log10)
- SYMFUNC(xf86lseek)
- SYMFUNC(xf86malloc)
- SYMFUNC(xf86memchr)
- SYMFUNC(xf86memcmp)
- SYMFUNC(xf86memcpy)
-#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__AMD64__)
- /*
- * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
- * structure copies. This causes a problem both here and in shared
- * libraries as there is no way to map the name of the call to the
- * correct function.
- */
- SYMFUNC(memcpy)
- /*
- * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle
- * aggregate initializations.
- */
- SYMFUNC(memset)
-#endif
- SYMFUNC(xf86memmove)
- SYMFUNC(xf86memset)
- SYMFUNC(xf86mmap)
- SYMFUNC(xf86modf)
- SYMFUNC(xf86munmap)
- SYMFUNC(xf86open)
- SYMFUNC(xf86perror)
- SYMFUNC(xf86pow)
- SYMFUNC(xf86printf)
- SYMFUNC(xf86qsort)
- SYMFUNC(xf86read)
- SYMFUNC(xf86realloc)
- SYMFUNC(xf86remove)
- SYMFUNC(xf86rename)
- SYMFUNC(xf86rewind)
- SYMFUNC(xf86setbuf)
- SYMFUNC(xf86setvbuf)
- SYMFUNC(xf86sin)
- SYMFUNC(xf86snprintf)
- SYMFUNC(xf86sprintf)
- SYMFUNC(xf86sqrt)
- SYMFUNC(xf86sscanf)
- SYMFUNC(xf86strcat)
- SYMFUNC(xf86strcmp)
- SYMFUNC(xf86strcasecmp)
- SYMFUNC(xf86strcpy)
- SYMFUNC(xf86strcspn)
- SYMFUNC(xf86strerror)
- SYMFUNC(xf86strlen)
- SYMFUNC(xf86strncmp)
- SYMFUNC(xf86strncasecmp)
- SYMFUNC(xf86strncpy)
- SYMFUNC(xf86strpbrk)
- SYMFUNC(xf86strchr)
- SYMFUNC(xf86strrchr)
- SYMFUNC(xf86strspn)
- SYMFUNC(xf86strstr)
- SYMFUNC(xf86strtod)
- SYMFUNC(xf86strtok)
- SYMFUNC(xf86strtol)
- SYMFUNC(xf86strtoul)
- SYMFUNC(xf86tan)
- SYMFUNC(xf86tmpfile)
- SYMFUNC(xf86tolower)
- SYMFUNC(xf86toupper)
- SYMFUNC(xf86ungetc)
- SYMFUNC(xf86vfprintf)
- SYMFUNC(xf86vsnprintf)
- SYMFUNC(xf86vsprintf)
- SYMFUNC(xf86write)
-
-/* non-ANSI C functions */
- SYMFUNC(xf86opendir)
- SYMFUNC(xf86closedir)
- SYMFUNC(xf86readdir)
- SYMFUNC(xf86rewinddir)
- SYMFUNC(xf86ffs)
- SYMFUNC(xf86strdup)
- SYMFUNC(xf86bzero)
- SYMFUNC(xf86usleep)
- SYMFUNC(xf86execl)
-
- SYMFUNC(xf86getsecs)
- SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
-
- SYMFUNC(xf86stat)
- SYMFUNC(xf86fstat)
- SYMFUNC(xf86access)
- SYMFUNC(xf86geteuid)
- SYMFUNC(xf86getegid)
- SYMFUNC(xf86getpid)
- SYMFUNC(xf86mknod)
- SYMFUNC(xf86chmod)
- SYMFUNC(xf86chown)
- SYMFUNC(xf86sleep)
- SYMFUNC(xf86mkdir)
- SYMFUNC(xf86shmget)
- SYMFUNC(xf86shmat)
- SYMFUNC(xf86shmdt)
- SYMFUNC(xf86shmctl)
-#ifdef HAS_GLIBC_SIGSETJMP
- SYMFUNC(xf86setjmp)
- SYMFUNC(xf86setjmp0)
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
- SYMFUNCALIAS("xf86setjmp1",__sigsetjmp)
-#else
- SYMFUNC(xf86setjmp1)
-#endif
-#else
- SYMFUNCALIAS("xf86setjmp",setjmp)
- SYMFUNCALIAS("xf86setjmp0",setjmp)
- SYMFUNC(xf86setjmp1)
-#endif
- SYMFUNCALIAS("xf86longjmp",longjmp)
- SYMFUNC(xf86getjmptype)
- SYMFUNC(xf86setjmp1_arg2)
- SYMFUNC(xf86setjmperror)
-
- SYMFUNC(xf86AddDriver)
- SYMFUNC(xf86ServerIsOnlyDetecting)
- SYMFUNC(xf86AddInputDriver)
- SYMFUNC(xf86AddModuleInfo)
- SYMFUNC(xf86LoaderCheckSymbol)
-
- SYMFUNC(xf86LoaderRefSymLists)
- SYMFUNC(xf86LoaderReqSymLists)
- SYMFUNC(xf86Msg)
- SYMFUNC(xf86MsgVerb)
- SYMFUNC(ErrorF)
- SYMFUNC(xf86PrintChipsets)
- SYMFUNC(xf86ErrorFVerb)
- SYMFUNC(xf86GetPciVideoInfo)
- SYMFUNC(xf86MatchDevice)
- SYMFUNC(xf86MatchPciInstances)
- SYMFUNC(xf86MatchIsaInstances)
- SYMFUNC(Xfree)
- SYMFUNC(xf86LoadDrvSubModule)
- SYMFUNC(xf86DrvMsg)
- SYMFUNC(xf86GetPciConfigInfo)
- SYMFUNC(xf86IsPrimaryPci)
- SYMFUNC(xf86CheckPciSlot)
- SYMFUNC(XNFalloc)
- SYMFUNC(XNFrealloc)
- SYMFUNC(XNFcalloc)
- {0,0}
-};
-
-static DriverPtr driver;
-static ModuleInfoPtr info;
-static SymTabPtr chips;
-static int vendor;
-ModuleType module_type = GenericModule;
-
-static void
-AddModuleOptions(char *name, const OptionInfoRec *option)
-{
- xf86cfgModuleOptions *ptr;
- const OptionInfoRec *tmp;
- SymTabPtr ctmp;
- int count;
-
- /* XXX If the module is already in the list, then it means that
- * it is now being properly loaded by xf86cfg and the "fake" entry
- * added in xf86cfgLoaderInitList() isn't required anymore.
- * Currently:
- * ati and vmware are known to fail. */
- for (ptr = module_options; ptr; ptr = ptr->next)
- if (strcmp(name, ptr->name) == 0) {
- fprintf(stderr, "Module %s already in list!\n", name);
- return;
- }
-
- ptr = XtNew(xf86cfgModuleOptions);
- ptr->name = XtNewString(name);
- ptr->type = module_type;
- if (option) {
- for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++)
- ;
- ++count;
- ptr->option = XtCalloc(1, count * sizeof(OptionInfoRec));
- for (count = 0, tmp = option; tmp->name != NULL; count++, tmp++) {
- memcpy(&ptr->option[count], tmp, sizeof(OptionInfoRec));
- ptr->option[count].name = XtNewString(tmp->name);
- if (tmp->type == OPTV_STRING || tmp->type == OPTV_ANYSTR)
- ptr->option[count].value.str = XtNewString(tmp->value.str);
- }
- }
- else
- ptr->option = NULL;
- if (vendor != -1 && chips) {
- ptr->vendor = vendor;
- for (count = 0, ctmp = chips; ctmp->name; ctmp++, count++)
- ;
- ++count;
- ptr->chipsets = XtCalloc(1, count * sizeof(SymTabRec));
- for (count = 0, ctmp = chips; ctmp->name != NULL; count++, ctmp++) {
- memcpy(&ptr->chipsets[count], ctmp, sizeof(SymTabRec));
- ptr->chipsets[count].name = XtNewString(ctmp->name);
- }
- }
- else
- ptr->chipsets = NULL;
-
- ptr->next = module_options;
- module_options = ptr;
-}
-
-extern void xf86WrapperInit(void);
-
-void
-xf86cfgLoaderInit(void)
-{
- LoaderInit();
- xf86WrapperInit();
-}
-
-void
-xf86cfgLoaderInitList(int type)
-{
- static const char *generic[] = {
- ".",
- NULL
- };
- static const char *video[] = {
- "drivers",
- NULL
- };
- static const char *input[] = {
- "input",
- NULL
- };
- static const char *font[] = {
- "fonts",
- NULL
- };
- const char **subdirs;
-
- switch (type) {
- case GenericModule:
- subdirs = generic;
- break;
- case VideoModule:
- subdirs = video;
- break;
- case InputModule:
- subdirs = input;
- break;
- case FontRendererModule:
- subdirs = font;
- break;
- default:
- fprintf(stderr, "Invalid value passed to xf86cfgLoaderInitList.\n");
- subdirs = generic;
- break;
- }
- LoaderSetPath(loaderPath);
- loaderList = LoaderListDirs(subdirs, NULL);
-
- /* XXX Xf86cfg isn't able to provide enough wrapper functions
- * to these drivers. Maybe the drivers could also be changed
- * to work better when being loaded "just for testing" */
- if (type == VideoModule) {
- module_type = VideoModule;
- AddModuleOptions("vmware", NULL);
- AddModuleOptions("ati", NULL);
- module_type = NullModule;
- }
-}
-
-void
-xf86cfgLoaderFreeList(void)
-{
- LoaderFreeDirList(loaderList);
-}
-
-int
-xf86cfgCheckModule(void)
-{
- int errmaj, errmin;
- ModuleDescPtr module;
- int nfonts;
- FontModule *fonts, *pfont_module;
-
- driver = NULL;
- chips = NULL;
- info = NULL;
- pfont_module = NULL;
- vendor = -1;
- module_type = GenericModule;
-
- if ((module = LoadModule(*ploaderList, NULL, NULL, NULL, NULL,
- NULL, &errmaj, &errmin)) == NULL) {
- LoaderErrorMsg(NULL, *ploaderList, errmaj, errmin);
- return (0);
- }
- else if (driver && driver->AvailableOptions) {
- /* at least fbdev does not call xf86MatchPciInstances in Probe */
- if (driver->Identify)
- (*driver->Identify)(-1);
- if (driver->Probe)
- (*driver->Probe)(driver, PROBE_DETECT);
- AddModuleOptions(*ploaderList, (*driver->AvailableOptions)(-1, -1));
- }
- else if (info && info->AvailableOptions)
- AddModuleOptions(*ploaderList, (*info->AvailableOptions)(NULL));
-
- if (!noverify) {
- XF86ModuleData *initdata = NULL;
- char *p;
-
- p = XtMalloc(strlen(*ploaderList) + strlen("ModuleData") + 1);
- strcpy(p, *ploaderList);
- strcat(p, "ModuleData");
- initdata = LoaderSymbol(p);
- if (initdata) {
- XF86ModuleVersionInfo *vers;
-
- vers = initdata->vers;
- if (vers && strcmp(*ploaderList, vers->modname)) {
- /* This was a problem at some time for some video drivers */
- CheckMsg(CHECKER_FILE_MODULE_NAME_MISMATCH,
- "WARNING file/module name mismatch: \"%s\" \"%s\"\n",
- *ploaderList, vers->modname);
- ++error_level;
- }
- }
- XtFree(p);
- }
-
- nfonts = numFontModules;
- numFontModules = 0;
- fonts = FontModuleList;
- if (fonts) {
- Bool dup = FALSE;
- while (fonts->name) {
- if (strcasecmp(fonts->name, *ploaderList) == 0) {
- pfont_module = fonts;
- /* HACK:
- * fonts->names points into modules.
- * Duplicate string of all remaining names to survive
- * unloading. Since new fonts are appended to list
- * this will only happen once per renderer.
- */
- dup = TRUE;
- }
- if (dup)
- fonts->name = strdup(fonts->name);
- ++numFontModules;
- ++fonts;
- }
- }
- if (pfont_module)
- module_type = FontRendererModule;
- else if (nfonts + 1 <= numFontModules) {
- /* loader.c will flag a warning if -noverify is not set */
- pfont_module = &FontModuleList[nfonts];
- module_type = FontRendererModule;
- }
-
- if (font_module) {
- XtFree((XtPointer)font_module->name);
- XtFree((XtPointer)font_module);
- font_module = NULL;
- }
- if (pfont_module) {
- font_module = XtNew(FontModule);
- memcpy(font_module, pfont_module, sizeof(FontModule));
- font_module->name = XtNewString(pfont_module->name);
- }
-
- UnloadModule(module);
-
- return (1);
-}
-
-void
-xf86AddDriver(DriverPtr drv, void *module, int flags)
-{
- driver = drv;
- if (driver)
- driver->module = module;
- module_type = VideoModule;
-}
-
-Bool
-xf86ServerIsOnlyDetecting(void)
-{
- return (True);
-}
-
-void
-xf86AddInputDriver(InputDriverPtr inp, void *module, int flags)
-{
- module_type = InputModule;
-}
-
-void
-xf86AddModuleInfo(ModuleInfoPtr inf, void *module)
-{
- info = inf;
-}
-
-Bool
-xf86LoaderCheckSymbol(const char *symbol)
-{
- return LoaderSymbol(symbol) != NULL;
-}
-
-void
-xf86LoaderRefSymLists(const char **list0, ...)
-{
-}
-
-void
-xf86LoaderReqSymLists(const char **list0, ...)
-{
-}
-
-#if 0
-void xf86Msg(int type, const char *format, ...)
-{
-}
-#endif
-
-/*ARGSUSED*/
-void
-xf86PrintChipsets(const char *name, const char *msg, SymTabPtr chipsets)
-{
- vendor = 0;
- chips = chipsets;
-}
-
-pciVideoPtr *
-xf86GetPciVideoInfo(void)
-{
- static pciVideoRec pci_video;
- static pciVideoPtr pci_video_ptr[2] = { &pci_video };
-
- memset(&pci_video, 0, sizeof(pciVideoRec));
-
- return (pci_video_ptr);
-}
-
-int
-xf86MatchDevice(const char *name, GDevPtr **gdev)
-{
- *gdev = NULL;
-
- return (1);
-}
-
-int
-xf86MatchPciInstances(const char *name, int VendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets,
- GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities)
-{
- vendor = VendorID;
- if (chips == NULL)
- chips = chipsets;
- *foundEntities = NULL;
-
- return (0);
-}
-
-int
-xf86MatchIsaInstances(const char *name, SymTabPtr chipsets, IsaChipsets *ISAchipsets, DriverPtr drvp,
- FindIsaDevProc FindIsaDevice, GDevPtr *devList, int numDevs, int **foundEntities)
-{
- *foundEntities = NULL;
-
- return (0);
-}
-
-/*ARGSUSED*/
-void *
-xf86LoadDrvSubModule(DriverPtr drv, const char *name)
-{
- pointer ret;
- int errmaj = 0, errmin = 0;
-
- ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL,
- &errmaj, &errmin);
- if (!ret)
- LoaderErrorMsg(NULL, name, errmaj, errmin);
- return (ret);
-}
-
-pciConfigPtr *
-xf86GetPciConfigInfo(void)
-{
- return (NULL);
-}
-
-Bool
-xf86IsPrimaryPci(pciVideoPtr pPci)
-{
- return (True);
-}
-
-Bool
-xf86CheckPciSlot(int bus, int device, int func)
-{
- return (False);
-}
-#endif
diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.c b/hw/xfree86/utils/xorgcfg/monitor-cfg.c
deleted file mode 100644
index 6ed095416..000000000
--- a/hw/xfree86/utils/xorgcfg/monitor-cfg.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.8 2003/09/11 10:08:38 eich Exp $
- */
-
-#include "xf86config.h"
-#include "monitor-cfg.h"
-#include "screen.h"
-#include <X11/extensions/xf86vmode.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Simple.h>
-
-#include <ctype.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/Viewport.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/SmeBSB.h>
-
-/*
- * Prototypes
- */
-static Bool MonitorConfigCheck(void);
-static void MonitorHsyncCallback(Widget, XtPointer, XtPointer);
-static void MonitorVsyncCallback(Widget, XtPointer, XtPointer);
-static void MonitorSelectCardCallback(Widget, XtPointer, XtPointer);
-
-extern void DrawCables(void);
-
-/*
- * Initialization
- */
-static char *hmodes[] = {
- "Standard VGA, 640x480 @ 60 Hz",
- "Super VGA, 800x600 @ 56 Hz",
- "1024x768 @ 87 Hz int. (no 800x600)",
- "1024x768 @ 87 Hz int., 800x600 @ 56 Hz",
- "800x600 @ 60 Hz, 640x480 @ 72 Hz",
- "1024x768 @ 60 Hz, 800x600 @ 72 Hz",
- "High Frequency SVGA, 1024x768 @ 70 Hz",
- "Monitor that can do 1280x1024 @ 60 Hz",
- "Monitor that can do 1280x1024 @ 74 Hz",
- "Monitor that can do 1280x1024 @ 76 Hz",
- "Monitor that can do 1280x1024 @ 85 Hz",
- "Monitor that can do 1600x1200 @ 85 Hz",
- "Monitor that can do 1920x1440 @ 85 Hz",
- "Monitor that can do 2048x1536 @ 85 Hz"
-};
-
-static char *hmodes_trans[] = {
- "31.5",
- "31.5 - 35.1",
- "31.5, 35.5",
- "31.5, 35.15, 35.5",
- "31.5 - 37.9",
- "31.5 - 48.5",
- "31.5 - 57.0",
- "31.5 - 64.3",
- "31.5 - 79.0",
- "31.5 - 82.0",
- "31.5 - 92.0",
- "31.5 - 108.0",
- "31.5 - 128.5",
- "31.5 - 137.0"
-};
-
-static char *vmodes [] = { "50 - 70", "50 - 90", "50 - 100", "40 - 150", };
-
-extern Widget config;
-static Widget hsync, vsync, hlist, vlist, cmenu;
-
-static parser_range mon_hsync[CONF_MAX_HSYNC];
-static parser_range mon_vrefresh[CONF_MAX_VREFRESH];
-static int mon_n_hsync, mon_n_vrefresh;
-static XF86ConfDevicePtr oldcard, card;
-static XF86ConfMonitorPtr current_monitor;
-
-/*
- * Implementation
- */
-XtPointer
-MonitorConfig(XtPointer conf)
-{
- XF86ConfMonitorPtr monitor = (XF86ConfMonitorPtr)conf;
- char monitor_name[48];
- Arg args[1];
-
- current_monitor = monitor;
-
- xf86info.cur_list = MONITOR;
- XtSetSensitive(back, xf86info.lists[MONITOR].cur_function > 0);
- XtSetSensitive(next, xf86info.lists[MONITOR].cur_function <
- xf86info.lists[MONITOR].num_functions - 1);
- (xf86info.lists[MONITOR].functions[xf86info.lists[MONITOR].cur_function])
- (&xf86info);
-
- XawListUnhighlight(hlist);
- XawListUnhighlight(vlist);
-
- if (monitor != NULL) {
- XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
- char str[PARSER_RANGE_SIZE];
-
- XtSetArg(args[0], XtNstring, monitor->mon_identifier);
- XtSetValues(ident_widget, args, 1);
-
- while (screen != NULL) {
- if (screen->scrn_monitor == monitor)
- break;
-
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
- if (screen != NULL) {
- oldcard = card = screen->scrn_device;
- XtSetArg(args[0], XtNlabel, card->dev_identifier);
- }
- else {
- oldcard = card = NULL;
- XtSetArg(args[0], XtNlabel, "");
- }
- XtSetValues(cmenu, args, 1);
-
- mon_n_hsync = monitor->mon_n_hsync;
- memcpy(mon_hsync, monitor->mon_hsync,
- sizeof(parser_range) * mon_n_hsync);
- *str = '\0';
- parser_range_to_string(str, mon_hsync, mon_n_hsync);
- XtSetArg(args[0], XtNstring, str);
- XtSetValues(hsync, args, 1);
-
- mon_n_vrefresh = monitor->mon_n_vrefresh;
- memcpy(mon_vrefresh, monitor->mon_vrefresh,
- sizeof(parser_range) * mon_n_vrefresh);
- *str = '\0';
- parser_range_to_string(str, mon_vrefresh, mon_n_vrefresh);
- XtSetArg(args[0], XtNstring, str);
- XtSetValues(vsync, args, 1);
- }
- else {
- XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
- int nmonitors = 0;
-
- oldcard = card = NULL;
- while (monitor != NULL) {
- ++nmonitors;
- monitor = (XF86ConfMonitorPtr)(monitor->list.next);
- }
- do {
- XmuSnprintf(monitor_name, sizeof(monitor_name),
- "Monitor%d", nmonitors);
- ++nmonitors;
- } while (xf86findMonitor(monitor_name,
- XF86Config->conf_monitor_lst));
-
- XtSetArg(args[0], XtNstring, monitor_name);
- XtSetValues(ident_widget, args, 1);
-
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(hsync, args, 1);
- XtSetValues(vsync, args, 1);
-
- XtSetArg(args[0], XtNlabel, "");
- XtSetValues(cmenu, args, 1);
- }
-
- if (ConfigLoop(MonitorConfigCheck) == True) {
- if (monitor == NULL) {
- monitor = (XF86ConfMonitorPtr)
- XtCalloc(1, sizeof(XF86ConfMonitorRec));
- monitor->mon_identifier = XtNewString(ident_string);
- }
-
- memcpy(monitor->mon_hsync, mon_hsync, sizeof(parser_range) *
- (monitor->mon_n_hsync = mon_n_hsync));
- memcpy(monitor->mon_vrefresh, mon_vrefresh, sizeof(parser_range) *
- (monitor->mon_n_vrefresh = mon_n_vrefresh));
-
- if (strcasecmp(monitor->mon_identifier, ident_string))
- xf86renameMonitor(XF86Config, monitor, ident_string);
-
- if (oldcard != card) {
- int i;
-
- for (i = 0; i < computer.num_devices; i++)
- if (computer.devices[i]->widget == config)
- break;
- if (computer.devices[i]->config == NULL)
- XF86Config->conf_monitor_lst =
- xf86addMonitor(XF86Config->conf_monitor_lst,
- monitor);
- computer.devices[i]->config = (XtPointer)monitor;
- ChangeScreen(monitor, monitor, card, oldcard);
- DrawCables();
- }
-
- return (monitor);
- }
-
- return (NULL);
-}
-
-static Bool
-MonitorConfigCheck(void)
-{
- char *str;
- Arg args[1];
- XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
-
- if (ident_string == NULL || strlen(ident_string) == 0)
- return (False);
-
- bzero(mon_hsync, sizeof(parser_range) * CONF_MAX_HSYNC);
- bzero(mon_vrefresh, sizeof(parser_range) * CONF_MAX_VREFRESH);
-
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(hsync, args, 1);
- if ((mon_n_hsync = string_to_parser_range(str, mon_hsync,
- CONF_MAX_HSYNC)) <= 0)
- return (False);
-
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(vsync, args, 1);
- if ((mon_n_vrefresh = string_to_parser_range(str, mon_vrefresh,
- CONF_MAX_VREFRESH)) <= 0)
- return (False);
-
- while (monitor != NULL) {
- if (monitor != current_monitor &&
- strcasecmp(ident_string, monitor->mon_identifier) == 0)
- return (False);
- monitor = (XF86ConfMonitorPtr)(monitor->list.next);
- }
-
- return (True);
-}
-
-int
-string_to_parser_range(char *str, parser_range *range, int nrange)
-{
- double val;
- int i = 0;
-
- if (str == NULL || *str == '\0' || range == NULL || nrange == 0)
- return (0);
-
- while (*str) {
- while (*str && isspace(*str))
- ++str;
- if (!isdigit(*str)) {
- ++str;
- continue;
- }
- val = strtod(str, &str);
- while (*str && isspace(*str))
- ++str;
- if (*str == ',' || *str == '\0') {
- if (*str)
- ++str;
- range[i].lo = range[i].hi = val;
- if (++i >= nrange || *str == '\0')
- break;
- continue;
- }
- else if (*str != '-')
- return (0);
- ++str;
- range[i].lo = val;
- while (*str && isspace(*str))
- ++str;
- if ((range[i].hi = strtod(str, &str)) < range[i].lo)
- return (0);
- if (++i >= nrange)
- break;
- }
-
- return (i);
-}
-
-int
-parser_range_to_string(char *str, parser_range *range, int nrange)
-{
- int i, len;
-
- if (str == NULL || range == NULL || nrange <= 0)
- return (0);
-
- for (i = len = 0; i < nrange; i++) {
- if (i > 0)
- len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%s",
- ", ");
- if (range[i].lo == range[i].hi)
- len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%g",
- range[i].lo);
- else if (range[i].lo < range[i].hi)
- len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%g - %g",
- range[i].lo, range[i].hi);
- else
- return (0);
- }
-
- return (i);
-}
-
-/*ARGSUSED*/
-static void
-MonitorHsyncCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, hmodes_trans[info->list_index]);
- XtSetValues(hsync, args, 1);
-}
-
-/*ARGSUSED*/
-static void
-MonitorVsyncCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, info->string);
- XtSetValues(vsync, args, 1);
-}
-
-/*ARGSUSED*/
-static void
-MonitorSelectCardCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
-
- card = (XF86ConfDevicePtr)user_data;
- XtSetArg(args[0], XtNlabel, card != NULL ? card->dev_identifier : "");
- XtSetValues(cmenu, args, 1);
-}
-
-void
-MonitorLayout(XF86SetupInfo *info)
-{
- static int first = 1, men;
- static Widget layout, menu;
- XF86ConfDevicePtr device = XF86Config->conf_device_lst;
- Widget sme;
- Arg args[1];
- char *menuname;
-
- if (first) {
- Widget viewport;
-
- first = 0;
-
- layout = XtCreateWidget("monitorl", formWidgetClass,
- configp, NULL, 0);
- XtCreateManagedWidget("hlabel", labelWidgetClass, layout, NULL, 0);
- hsync = XtVaCreateManagedWidget("hsync", asciiTextWidgetClass, layout,
- XtNeditType, XawtextEdit,
- NULL, 0);
- viewport = XtCreateManagedWidget("hviewport", viewportWidgetClass,
- layout, NULL, 0);
- hlist = XtVaCreateManagedWidget("hlist", listWidgetClass, viewport,
- XtNlist, hmodes,
- XtNnumberStrings, sizeof(hmodes) /
- sizeof(hmodes[0]), NULL, 0);
- XtAddCallback(hlist, XtNcallback, MonitorHsyncCallback, NULL);
-
- XtCreateManagedWidget("vlabel", labelWidgetClass, layout, NULL, 0);
- vsync = XtVaCreateManagedWidget("vsync", asciiTextWidgetClass, layout,
- XtNeditType, XawtextEdit,
- NULL, 0);
- viewport = XtCreateManagedWidget("vviewport", viewportWidgetClass,
- layout, NULL, 0);
- vlist = XtVaCreateManagedWidget("vlist", listWidgetClass, viewport,
- XtNlist, vmodes,
- XtNnumberStrings, sizeof(vmodes) /
- sizeof(vmodes[0]), NULL, 0);
- XtAddCallback(vlist, XtNcallback, MonitorVsyncCallback, NULL);
-
- XtCreateManagedWidget("clabel", labelWidgetClass, layout, NULL, 0);
- cmenu = XtCreateManagedWidget("cmenu", menuButtonWidgetClass,
- layout, NULL, 0);
-
- XtRealizeWidget(layout);
- }
-
- if (menu != NULL)
- XtDestroyWidget(menu);
-
- /*
- * swaps names because XtDestroyWidget will only really destroy it
- * when the code returns to XtAppMainLoop
- */
- menuname = men & 1 ? "mena" : "menb";
- menu = XtCreatePopupShell(menuname, simpleMenuWidgetClass,
- cmenu, NULL, 0);
- XtSetArg(args[0], XtNmenuName, menuname);
- XtSetValues(cmenu, args, 1);
- ++men;
- sme = XtVaCreateManagedWidget("none", smeBSBObjectClass, menu,
- NULL, 0);
- XtAddCallback(sme, XtNcallback, MonitorSelectCardCallback, NULL);
-
- while (device != NULL) {
- XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
- Widget sme;
- Bool sensitive = True;
-
- while (screen != NULL) {
- if (screen->scrn_device == device) {
- sensitive = screen->scrn_monitor == NULL ||
- screen->scrn_monitor == current_monitor;
- break;
- }
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
- sme = XtCreateManagedWidget(device->dev_identifier,
- smeBSBObjectClass, menu,
- NULL, 0);
- if (sensitive)
- XtAddCallback(sme, XtNcallback, MonitorSelectCardCallback, device);
- XtSetSensitive(sme, sensitive);
-
- device = (XF86ConfDevicePtr)(device->list.next);
- }
-
- XtRealizeWidget(menu);
-
- XtChangeManagedSet(&current, 1, NULL, NULL, &layout, 1);
- current = layout;
-}
diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.h b/hw/xfree86/utils/xorgcfg/monitor-cfg.h
deleted file mode 100644
index 03ca18a41..000000000
--- a/hw/xfree86/utils/xorgcfg/monitor-cfg.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.h,v 1.3 2000/11/30 20:55:18 paulo Exp $
- */
-
-#include "config.h"
-
-#ifndef _xf86cfg_monitor_h
-#define _xf86cfg_monitor_h
-
-/*
- * Prototypes
- */
-XtPointer MonitorConfig(XtPointer);
-void MonitorLayout(XF86SetupInfo*);
-void MonitorVidtune(XF86SetupInfo*);
-int string_to_parser_range(char*, parser_range*, int);
-#define PARSER_RANGE_SIZE 256
-/* string must have at least 256 bytes */
-int parser_range_to_string(char*, parser_range*, int);
-
-#endif /* _xf86cfg_monitor_h */
diff --git a/hw/xfree86/utils/xorgcfg/monitor.xbm b/hw/xfree86/utils/xorgcfg/monitor.xbm
deleted file mode 100644
index c4b01eb74..000000000
--- a/hw/xfree86/utils/xorgcfg/monitor.xbm
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor.xbm,v 1.1 2000/04/04 22:37:00 dawes Exp $
- */
-#define monitor_width 50
-#define monitor_height 44
-static unsigned char monitor_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0x01, 0x00,
- 0x00, 0x00, 0x1e, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x70,
- 0xfc, 0xff, 0xff, 0xff, 0x38, 0x00, 0x30, 0xfe, 0xff, 0xff, 0xff, 0x31,
- 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00,
- 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03,
- 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00,
- 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00,
- 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00,
- 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30,
- 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33,
- 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00,
- 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03,
- 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00,
- 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00,
- 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0xfe, 0xff,
- 0xff, 0xff, 0x31, 0x00, 0x70, 0xfc, 0xff, 0xff, 0xff, 0x38, 0x00, 0x60,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x1e,
- 0x00, 0xc0, 0x1f, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0xc0, 0x0f,
- 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x30, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0xf8, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/monitor.xpm b/hw/xfree86/utils/xorgcfg/monitor.xpm
deleted file mode 100644
index c694edf2e..000000000
--- a/hw/xfree86/utils/xorgcfg/monitor.xpm
+++ /dev/null
@@ -1,79 +0,0 @@
-/* XPM */
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor.xpm,v 1.1 2000/04/04 22:37:00 dawes Exp $
- */
-static char * monitor_xpm[] = {
-"47 40 6 1",
-" c none",
-"Z c #DF7DE38DDF7D",
-". c #BEFBBEFBBEFB",
-"X c #9E799A699E79",
-"o c #30C230C230C2",
-"O c #96589E799658",
-"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ..",
-"Z..............................................",
-"Z.............................................X",
-"Z.............................................X",
-"Z...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....X",
-"Z...Xooooooooooooooooooooooooooooooooooooo....X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
-"Z....oooooooooooooooooooooooooooooooooooooZ...X",
-"Z.....ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ...X",
-"Z.............................................X",
-"Z.............................................X",
-"..............................................X",
-"..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
-" OOOOOOOOOOOOOOOOOOOOOOOOOo ",
-" XXXXXXXXXXXXXXXXXXXXXXXXXX ",
-" OOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
-" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
-" ooooooooooooooooooooooooooooooooooooooo "};
diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.c b/hw/xfree86/utils/xorgcfg/mouse-cfg.c
deleted file mode 100644
index 17a1c0caf..000000000
--- a/hw/xfree86/utils/xorgcfg/mouse-cfg.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include "xf86config.h"
-#include "mouse-cfg.h"
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Toggle.h>
-#include <X11/Xaw/Viewport.h>
-#include <X11/extensions/xf86misc.h>
-
-/*
- * Prototypes
- */
-static void MouseDeviceCallback(Widget, XtPointer, XtPointer);
-static void MouseProtocolCallback(Widget, XtPointer, XtPointer);
-static void MouseEmulateCallback(Widget, XtPointer, XtPointer);
-static void MouseApplyCallback(Widget, XtPointer, XtPointer);
-static Bool MouseConfigCheck(void);
-
-/*
- * Initialization
- */
-static struct MouseProtocol {
- char *name;
- int type;
-} protocols[] = {
-#ifdef __UNIXOS2__
- {"OS2Mouse", MTYPE_AUTOMOUSE},
-#endif
-#ifdef SCO
- {"OsMouse", MTYPE_AUTOMOUSE},
-#endif
-#ifdef WSCONS_SUPPORT
- {"wsmouse", MTYPE_AUTOMOUSE},
-#endif
- {"Auto", MTYPE_AUTOMOUSE},
- {"SysMouse", MTYPE_SYSMOUSE},
- {"MouseSystems", MTYPE_MOUSESYS},
- {"BusMouse", MTYPE_BUSMOUSE},
- {"PS/2", MTYPE_PS_2},
- {"Microsoft", MTYPE_MICROSOFT},
-#ifndef __FreeBSD__
- {"ImPS/2", MTYPE_IMPS2},
- {"ExplorerPS/2", MTYPE_EXPPS2},
- {"GlidePointPS/2", MTYPE_GLIDEPOINTPS2},
- {"MouseManPlusPS/2", MTYPE_MMANPLUSPS2},
- {"NetMousePS/2", MTYPE_NETPS2},
- {"NetScrollPS/2", MTYPE_NETSCROLLPS2},
- {"ThinkingMousePS/2", MTYPE_THINKINGPS2},
-#endif
- {"AceCad", MTYPE_ACECAD},
- {"GlidePoint", MTYPE_GLIDEPOINT},
- {"IntelliMouse", MTYPE_IMSERIAL},
- {"Logitech", MTYPE_LOGITECH},
- {"MMHitTab", MTYPE_MMHIT},
- {"MMSeries", MTYPE_MMSERIES},
- {"MouseMan", MTYPE_LOGIMAN},
- {"ThinkingMouse", MTYPE_THINKING},
-};
-
-static Widget text;
-static char *device, *protocol;
-static Bool emulate;
-static XF86ConfInputPtr current_input;
-
-/*
- * Implementation
- */
-/*ARGSUSED*/
-XtPointer
-MouseConfig(XtPointer config)
-{
- XF86ConfInputPtr mouse = (XF86ConfInputPtr)config;
- XF86OptionPtr option;
- char mouse_name[32];
- Arg args[1];
-
- static char *Device = "Device", *Protocol = "Protocol",
- *Emulate3Buttons = "Emulate3Buttons",
- *Emulate3Timeout = "Emulate3Timeout";
-
- current_input = mouse;
-
- if (mouse != NULL) {
- emulate = xf86findOption(mouse->inp_option_lst,
- Emulate3Buttons) != NULL;
- if ((option = xf86findOption(mouse->inp_option_lst, Device)) != NULL)
- device = option->opt_val;
- else
- device = NULL;
- if ((option = xf86findOption(mouse->inp_option_lst, Protocol)) != NULL)
- protocol = option->opt_val;
- else
- protocol = NULL;
-
- XtSetArg(args[0], XtNstring, mouse->inp_identifier);
- XtSetValues(ident_widget, args, 1);
- }
- else {
- XF86ConfInputPtr input = XF86Config->conf_input_lst;
- int nmouses = 0;
-
- while (input != NULL) {
- if (strcasecmp(input->inp_driver, "mouse") == 0)
- ++nmouses;
- input = (XF86ConfInputPtr)(input->list.next);
- }
- do {
- XmuSnprintf(mouse_name, sizeof(mouse_name), "Mouse%d", nmouses);
- ++nmouses;
- } while (xf86findInput(mouse_name,
- XF86Config->conf_input_lst));
-
- XtSetArg(args[0], XtNstring, mouse_name);
- XtSetValues(ident_widget, args, 1);
-
- emulate = True;
- device = NULL;
- protocol = NULL;
- }
-
- xf86info.cur_list = MOUSE;
- XtSetSensitive(back, xf86info.lists[MOUSE].cur_function > 0);
- XtSetSensitive(next, xf86info.lists[MOUSE].cur_function <
- xf86info.lists[MOUSE].num_functions - 1);
- (xf86info.lists[MOUSE].functions[xf86info.lists[MOUSE].cur_function])
- (&xf86info);
-
- if (ConfigLoop(MouseConfigCheck) == True) {
- XtSetArg(args[0], XtNstring, &device);
- XtGetValues(text, args, 1);
- if (mouse == NULL) {
- mouse = XtNew(XF86ConfInputRec);
- mouse->list.next = NULL;
- mouse->inp_identifier = XtNewString(ident_string);
- mouse->inp_driver = XtNewString("mouse");
- mouse->inp_option_lst = xf86newOption(XtNewString(Device),
- XtNewString(device));
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Protocol), XtNewString(protocol));
- if (emulate) {
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Emulate3Buttons), NULL);
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Emulate3Timeout),
- XtNewString("50"));
- }
- mouse->inp_comment = NULL;
- }
- else {
- if ((option = xf86findOption(mouse->inp_option_lst, Device)) != NULL) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(device);
- XtFree(option->opt_comment);
- }
- else {
- if (mouse->inp_option_lst == NULL)
- mouse->inp_option_lst = xf86newOption(XtNewString(Device),
- XtNewString(device));
- else
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Device), XtNewString(device));
- }
-
- if ((option = xf86findOption(mouse->inp_option_lst, Protocol)) != NULL) {
- XtFree(option->opt_val);
- option->opt_val = XtNewString(protocol);
- XtFree(option->opt_comment);
- }
- else
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Protocol), XtNewString(protocol));
-
- if (emulate == False) {
- xf86removeOption(&(mouse->inp_option_lst), Emulate3Buttons);
- xf86removeOption(&(mouse->inp_option_lst), Emulate3Timeout);
- }
- else if (emulate) {
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Emulate3Buttons), NULL);
- xf86addNewOption(mouse->inp_option_lst,
- XtNewString(Emulate3Timeout), XtNewString("50"));
- }
- }
- if (strcasecmp(mouse->inp_identifier, ident_string))
- xf86renameInput(XF86Config, mouse, ident_string);
-
- return ((XtPointer)mouse);
- }
-
- return (NULL);
-}
-
-static Bool
-MouseConfigCheck(void)
-{
- Arg args[1];
- XF86ConfInputPtr mouse = XF86Config->conf_input_lst;
-
- XtSetArg(args[0], XtNstring, &device);
- XtGetValues(text, args, 1);
-
- if (ident_string == NULL || strlen(ident_string) == 0 ||
- device == NULL || strlen(device) == 0 || protocol == NULL)
- return (False);
- while (mouse != NULL) {
- if (mouse != current_input &&
- strcasecmp(ident_string, mouse->inp_identifier) == 0)
- return (False);
- mouse = (XF86ConfInputPtr)(mouse->list.next);
- }
-
- return (True);
-}
-
-static void
-MouseDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, info->string);
- XtSetValues((Widget)user_data, args, 1);
- XawTextSetInsertionPoint((Widget)user_data, strlen(info->string));
-}
-
-static void
-MouseProtocolCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
-
- protocol = info->string;
-}
-
-static void
-MouseEmulateCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- emulate = (Bool)(long)call_data;
-}
-
-static void
-MouseApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- int i;
- XF86MiscMouseSettings mouse;
-
- XF86MiscGetMouseSettings(XtDisplay(w), &mouse);
- XtFree(mouse.device);
-
- if (mouse.baudrate == 0 || mouse.baudrate < 0 || mouse.baudrate > 9600 ||
- mouse.baudrate % 1200)
- mouse.baudrate = 1200;
-
- mouse.type = MTYPE_AUTOMOUSE;
- for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++)
- if (strcmp(protocols[i].name, protocol) == 0) {
- mouse.type = protocols[i].type;
- break;
- }
-
- mouse.emulate3buttons = emulate;
- mouse.flags |= MF_REOPEN;
-
- mouse.device = device;
-
- XFlush(XtDisplay(w));
- XF86MiscSetMouseSettings(XtDisplay(w), &mouse);
-}
-
-void
-MouseDeviceAndProtocol(XF86SetupInfo *info)
-{
- static int first = 1, ndevices;
- static Widget mouse_dp, listD, listP, emul3, apply;
- static char **devices;
- static char *dirs[] = {
- "/dev",
-#ifdef __linux__
- "/dev/input"
-#endif
- };
- static char *patterns[] = {
-#ifdef WSCONS_SUPPORT
- "wsmouse",
-#endif
- "cuaa",
- "mice",
- "mouse",
- "ps",
- "sysmouse",
- "ttyS",
- };
- Arg args[2];
- int i;
-
- if (first) {
- Widget viewport;
- struct dirent *ent;
- DIR *dir;
- char **list;
- int count;
-
- first = 0;
-
- mouse_dp = XtCreateWidget("mouseDP", formWidgetClass,
- configp, NULL, 0);
-
- /* DEVICE */
- for (count = 0; count < sizeof(dirs) / sizeof(dirs[0]); count++) {
- if ((dir = opendir(dirs[count])) != NULL) {
- int i, len, xlen = strlen(dirs[count]) + 2;
-
- (void)readdir(dir);
- (void)readdir(dir);
- while ((ent = readdir(dir)) != NULL) {
- for (i = 0; i < sizeof(patterns) / sizeof(patterns[0]); i++) {
- len = strlen(patterns[i]);
-
- if (strncmp(patterns[i], ent->d_name, len) == 0) {
- len = strlen(ent->d_name) + xlen;
-
- devices = (char**)XtRealloc((XtPointer)devices,
- sizeof(char*) * ++ndevices);
- devices[ndevices - 1] = XtMalloc(len);
- XmuSnprintf(devices[ndevices - 1], len, "%s/%s",
- dirs[count], ent->d_name);
- }
- }
- }
- closedir(dir);
- }
- }
-
- (void) XtCreateManagedWidget("labelD", labelWidgetClass,
- mouse_dp, NULL, 0);
- text = XtVaCreateManagedWidget("device", asciiTextWidgetClass,
- mouse_dp,
- XtNeditType, XawtextEdit,
- NULL, 0);
- viewport = XtCreateManagedWidget("viewportD", viewportWidgetClass,
- mouse_dp, NULL, 0);
-
- listD = XtVaCreateManagedWidget("listD", listWidgetClass,
- viewport,
- XtNlist, devices,
- XtNnumberStrings, ndevices,
- NULL, 0);
- XtAddCallback(listD, XtNcallback, MouseDeviceCallback, (XtPointer)text);
-
- /* PROTOCOL */
- (void) XtCreateManagedWidget("labelP", labelWidgetClass,
- mouse_dp, NULL, 0);
- viewport = XtCreateManagedWidget("viewportP", viewportWidgetClass,
- mouse_dp, NULL, 0);
-
- list = (char**)XtMalloc(sizeof(char*) *
- sizeof(protocols)/sizeof(protocols[0]));
- for (count = 0; count < sizeof(protocols)/sizeof(protocols[0]); count++)
- list[count] = XtNewString(protocols[count].name);
- listP = XtVaCreateManagedWidget("listP", listWidgetClass,
- viewport,
- XtNlist, list,
- XtNnumberStrings, count,
- NULL, 0);
- XtAddCallback(listP, XtNcallback, MouseProtocolCallback, NULL);
-
- emul3 = XtVaCreateManagedWidget("emulate3", toggleWidgetClass,
- mouse_dp, XtNstate, True, NULL, 0);
- XtAddCallback(emul3, XtNcallback, MouseEmulateCallback, NULL);
- apply = XtCreateManagedWidget("apply", commandWidgetClass,
- mouse_dp, NULL, 0);
- XtAddCallback(apply, XtNcallback, MouseApplyCallback, NULL);
-
- XtRealizeWidget(mouse_dp);
- }
-
- if (device != NULL) {
- for (i = 0; i < ndevices; i++)
- if (strcmp(device, devices[i]) == 0) {
- XtSetArg(args[0], XtNstring, device);
- XtSetValues(text, args, 1);
- XawListHighlight(listD, i);
- break;
- }
-
- if (i >= ndevices) {
- devices = (char**)XtRealloc((XtPointer)devices,
- sizeof(char*) * ++ndevices);
- devices[ndevices - 1] = XtNewString(device);
- XawListHighlight(listD, ndevices - 1);
- XtSetArg(args[0], XtNlist, devices);
- XtSetArg(args[1], XtNnumberStrings, ndevices);
- XtSetValues(listD, args, 2);
- }
- device = devices[i];
- }
- else {
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(text, args, 1);
- XawListUnhighlight(listD);
- }
-
- if (protocol != NULL) {
- for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++)
- if (strcasecmp(protocol, protocols[i].name) == 0) {
- protocol = protocols[i].name;
- XawListHighlight(listP, i);
- break;
- }
- }
- else {
- /* "Auto" is the default */
- protocol = protocols[0].name;
- XawListHighlight(listP, 0);
- }
-
- XtSetArg(args[0], XtNstate, emulate);
- XtSetValues(emul3, args, 1);
-
- XtChangeManagedSet(&current, 1, NULL, NULL, &mouse_dp, 1);
- current = mouse_dp;
-}
diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.h b/hw/xfree86/utils/xorgcfg/mouse-cfg.h
deleted file mode 100644
index 249f50840..000000000
--- a/hw/xfree86/utils/xorgcfg/mouse-cfg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.h,v 1.1 2000/04/04 22:37:00 dawes Exp $
- */
-
-#include "config.h"
-
-#ifndef _xf86cfg_mouse_h
-#define _xf86cfg_mouse_h
-
-/*
- * Prototypes
- */
-XtPointer MouseConfig(XtPointer);
-void MouseDeviceAndProtocol(XF86SetupInfo*);
-
-#endif /* _xf86cfg_mouse_h */
-
diff --git a/hw/xfree86/utils/xorgcfg/mouse.xbm b/hw/xfree86/utils/xorgcfg/mouse.xbm
deleted file mode 100644
index 8577137e6..000000000
--- a/hw/xfree86/utils/xorgcfg/mouse.xbm
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse.xbm,v 1.1 2000/04/04 22:37:01 dawes Exp $
- */
-#define mouse_width 50
-#define mouse_height 44
-static unsigned char mouse_bits[] = {
- 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xcf, 0x03, 0x00,
- 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x79, 0x78,
- 0x1e, 0x00, 0x00, 0x00, 0x60, 0x38, 0x70, 0x18, 0x00, 0x00, 0x00, 0x70,
- 0x30, 0x30, 0x38, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30,
- 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
- 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
- 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30,
- 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
- 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x38,
- 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xe0, 0x01,
- 0x00, 0x1e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
- 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/mouse.xpm b/hw/xfree86/utils/xorgcfg/mouse.xpm
deleted file mode 100644
index 7ad21fb8f..000000000
--- a/hw/xfree86/utils/xorgcfg/mouse.xpm
+++ /dev/null
@@ -1,76 +0,0 @@
-/* XPM */
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse.xpm,v 1.1 2000/04/04 22:37:01 dawes Exp $
- */
-static char * mouse_xpm[] = {
-"26 35 8 1",
-" c none",
-". c #E79DE79DE79D",
-"X c #CF3CCF3CCF3C",
-"o c #BEFBBAEABEFB",
-"O c #8E3896588E38",
-"+ c #AEBAAAAAAEBA",
-"@ c #9E79AAAA9E79",
-"# c #A699A289A699",
-" .....XXXX. ",
-" X..o.XXXXXXXo... ",
-" X..XXo.XXXXXXXo.XX.X ",
-" X.XXXXo.XXXXXXXo.XXX.X ",
-" .XXXXXo.XXXXXXXo.XXXXoo ",
-" X.XXXXXo.XXXoXXXo.XXXXoXo",
-"oX.XXXXXo.XXXXXXXo.XXXXXoo",
-"oX.XoXoXo.XXoXoXXo.XXXXXoO",
-"oX.XXXXXo.XXXXXXXo.XXoXX+O",
-"oX.XXXoXo.XXoXoXXo.XXXXX+O",
-"oX.XXXXXo.XXXXXXXo.XX...+O",
-"ooooo...o........oooo@@@OO",
-"oX.XX#@@@@@@@@@@@@@@@XXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXXX+O",
-"oX.XXXXXXXXXXXXXXXXXXXX+oO",
-" #X.XXXXXXXXXXXXXXXXXXooO ",
-" #X.XXXXXXXXXXXXXXXXXXooO ",
-" #X.XXXXXXXXXXXXXXXXXX+oO ",
-" #X.XXXXXXXXXXXXXXXXXX+oO ",
-" #.XXXXXXXXXXXXXXXXX++O ",
-" #X..XXXXXXXXXXXXXXX+oO ",
-" #X.XXXXXXXXXXXXXX+oO ",
-" #.XXXXXXXXXXXXXX+O ",
-" #X..XXXXXXXXXo++oO ",
-" #XX..XXXXXoo+ooO ",
-" ##XXooooo+ooOO ",
-" ooooooooOO ",
-" oOOOOO "};
diff --git a/hw/xfree86/utils/xorgcfg/narrower.xbm b/hw/xfree86/utils/xorgcfg/narrower.xbm
deleted file mode 100644
index 0649ef8b4..000000000
--- a/hw/xfree86/utils/xorgcfg/narrower.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define narrower_width 19
-#define narrower_height 19
-static unsigned char narrower_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x00, 0x18, 0xc0, 0x00,
- 0x38, 0xe0, 0x00, 0x78, 0xf0, 0x00, 0xf8, 0xf8, 0x00, 0xff, 0xfd, 0x07,
- 0xff, 0xff, 0x07, 0xff, 0xff, 0x07, 0xff, 0xff, 0x07, 0xff, 0xfd, 0x07,
- 0xf8, 0xf8, 0x00, 0x78, 0xf0, 0x00, 0x38, 0xe0, 0x00, 0x18, 0xc0, 0x00,
- 0x08, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/options.c b/hw/xfree86/utils/xorgcfg/options.c
deleted file mode 100644
index 10828a94a..000000000
--- a/hw/xfree86/utils/xorgcfg/options.c
+++ /dev/null
@@ -1,788 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.12 2001/11/03 20:32:31 paulo Exp $
- */
-
-#include "options.h"
-#include "xf86config.h"
-#include <X11/Xresource.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/SimpleMenP.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/Viewport.h>
-#include <ctype.h>
-
-/*
- * Prototypes
- */
-static void PopdownCallback(Widget, XtPointer, XtPointer);
-static void SelectOptionCallback(Widget, XtPointer, XtPointer);
-static void AddOption(Widget, XtPointer, XtPointer);
-static void RemoveOption(Widget, XtPointer, XtPointer);
-static void UpdateOption(Widget, XtPointer, XtPointer);
-static void UpdateOptionList(void);
-#ifdef USE_MODULES
-static void AddDriverOption(Widget, XtPointer, XtPointer);
-static void SelectModuleCallback(Widget, XtPointer, XtPointer);
-static void SelectModuleOptionCallback(Widget, XtPointer, XtPointer);
-static void ModuleOptionsPopdown(Widget, XtPointer, XtPointer);
-#endif
-static Bool EnumDatabase(XrmDatabase*, XrmBindingList, XrmQuarkList,
- XrmRepresentation*, XrmValue*, XPointer);
-
-/*
- * Initialization
- */
-Widget optionsShell;
-static XF86OptionPtr *options;
-static Widget add, remov, update, list, name, value;
-static char *option_str;
-static int option_index, popped = False;
-static char *Options = "lib/X11/Options";
-XrmDatabase options_xrm;
-struct {
- char *string;
- int offset;
-} rebuild_xrm;
-#ifdef USE_MODULES
-static Widget modList, optList, desc, modOptionsShell, labelType;
-static char *module_sel;
-static char *types[] = {
- "none", "integer", "(non null) string", "string", "real",
- "boolean", "frequency",
-};
-#endif
-
-/*
- * Implementation
- */
-#ifdef USE_MODULES
-static int
-qcmp_str(_Xconst void *a, _Xconst void *b)
-{
- return (strcmp(*(char**)a, *(char**)b));
-}
-
-void
-ModuleOptionsPopup(Widget w, XtPointer user_data, XtPointer call_data)
-{
- xf86cfgModuleOptions *info = module_options;
-
- if (modOptionsShell == NULL) {
- char **ops;
- int nops;
- Widget pane, form, viewport, bottom, popdown;
-
- modOptionsShell = XtCreatePopupShell("moduleOptions",
- transientShellWidgetClass,
- optionsShell, NULL, 0);
-
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
- modOptionsShell, NULL, 0);
-
- form = XtCreateManagedWidget("descriptions", formWidgetClass,
- pane, NULL, 0);
- labelType = XtCreateManagedWidget("labelType", labelWidgetClass,
- form, NULL, 0);
- XtCreateManagedWidget("module", labelWidgetClass, form, NULL, 0);
- viewport = XtCreateManagedWidget("viewM", viewportWidgetClass,
- form, NULL, 0);
- ops = NULL;
- nops = 0;
- while (info) {
- ++nops;
- ops = (char**)XtRealloc((XtPointer)ops, sizeof(char*) * nops);
- ops[nops - 1] = XtNewString(info->name);
- info = info->next;
- }
- if (nops == 0) {
- ops = (char**)XtMalloc(sizeof(char*));
- ops[0] = XtNewString("");
- nops = 1;
- }
- else
- qsort(ops, nops, sizeof(char*), qcmp_str);
- modList = XtVaCreateManagedWidget("modL", listWidgetClass,
- viewport, XtNlist, ops,
- XtNnumberStrings, nops,
- NULL, 0);
- XtAddCallback(modList, XtNcallback, SelectModuleCallback, NULL);
- XtCreateManagedWidget("option", labelWidgetClass, form, NULL, 0);
- viewport = XtCreateManagedWidget("viewO", viewportWidgetClass,
- form, NULL, 0);
- ops = (char**)XtMalloc(sizeof(char*));
- ops[0] = XtNewString("");
- optList = XtVaCreateManagedWidget("optL", listWidgetClass,
- viewport, XtNlist, ops,
- XtNnumberStrings, 1, NULL, 0);
- XtAddCallback(optList, XtNcallback, SelectModuleOptionCallback, NULL);
- desc = XtVaCreateManagedWidget("desc", asciiTextWidgetClass,
- form, XtNeditType, XawtextRead,
- NULL, 0);
-
- bottom = XtCreateManagedWidget("bottom", formWidgetClass,
- pane, NULL, 0);
- popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
- bottom, NULL, 0);
- XtAddCallback(popdown, XtNcallback, ModuleOptionsPopdown, NULL);
- XtRealizeWidget(modOptionsShell);
- XSetWMProtocols(DPY, XtWindow(modOptionsShell), &wm_delete_window, 1);
-
- info = module_options;
- }
-
- if (module_sel && *module_sel) {
- XawListReturnStruct list; /* hack to call ballbacks */
- char **strs;
- int nstrs, idx = 0;
-
- XtVaGetValues(modList, XtNlist, &strs, XtNnumberStrings, &nstrs, NULL);
- for (idx = nstrs - 1; idx > 0; idx--)
- if (strcmp(module_sel, strs[idx]) == 0)
- break;
- while (info) {
- if (strcmp(module_sel, info->name) == 0)
- break;
- info = info->next;
- }
- if (info) {
- list.string = info->name;
- list.list_index = idx;
- XawListHighlight(modList, idx);
- SelectModuleCallback(modList, NULL, (XtPointer)&list);
- }
- if (option_str && *option_str) {
- OptionInfoPtr opts = info->option;
-
- idx = 0;
- while (opts && opts->name) {
- if (strcmp(opts->name, option_str) == 0)
- break;
- ++idx;
- ++opts;
- }
-
- if (opts && opts->name) {
- list.string = (char *)opts->name;
- list.list_index = idx;
- XawListHighlight(optList, idx);
- SelectModuleOptionCallback(optList, NULL, (XtPointer)&list);
- }
- }
- }
- XtPopup(modOptionsShell, XtGrabNone);
-}
-
-/*ARGSUSED*/
-static void
-ModuleOptionsPopdown(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtPopdown(modOptionsShell);
-}
-
-/*ARGSUSED*/
-void
-ModuleOptionsCancelAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- ModuleOptionsPopdown(w, NULL, NULL);
-}
-#endif
-
-void
-CreateOptionsShell(void)
-{
- optionsShell = XtCreatePopupShell("options", transientShellWidgetClass,
- toplevel, NULL, 0);
-}
-
-#ifdef USE_MODULES
-void
-OptionsPopup(XF86OptionPtr *opts, char *driver, OptionInfoPtr drv_opts)
-#else
-void
-OptionsPopup(XF86OptionPtr *opts)
-#endif
-{
- static int first = 1;
-#ifdef USE_MODULES
- static Widget button, menu;
- static char label[256], menuName[16];
- Widget sme;
- char buf[256];
- int i = 0;
- Arg args[1];
- static int menuN;
-#endif
-
- option_str = NULL;
- options = opts;
- if (first) {
- Widget pane, form, viewport, bottom, popdown;
-
- first = 0;
-
- if (optionsShell == NULL)
- CreateOptionsShell();
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
- optionsShell, NULL, 0);
-
- form = XtCreateManagedWidget("commands", formWidgetClass,
- pane, NULL, 0);
- add = XtCreateManagedWidget("add", commandWidgetClass,
- form, NULL, 0);
- XtAddCallback(add, XtNcallback, AddOption, NULL);
- remov = XtCreateManagedWidget("remove", commandWidgetClass,
- form, NULL, 0);
- XtAddCallback(remov, XtNcallback, RemoveOption, NULL);
- update = XtCreateManagedWidget("update", commandWidgetClass,
- form, NULL, 0);
- XtAddCallback(update, XtNcallback, UpdateOption, NULL);
-#ifdef USE_MODULES
- if (!nomodules) {
- Widget command;
-
- command = XtCreateManagedWidget("help", commandWidgetClass,
- form, NULL, 0);
- XtAddCallback(command, XtNcallback, ModuleOptionsPopup, NULL);
- }
-#endif
- form = XtCreateManagedWidget("form", formWidgetClass,
- pane, NULL, 0);
- XtVaCreateManagedWidget("label1", labelWidgetClass, form,
- XtNlabel, " Option \"",
- NULL, 0);
- name = XtVaCreateManagedWidget("name", asciiTextWidgetClass, form,
- XtNeditType, XawtextEdit,
- NULL, 0);
- XtVaCreateManagedWidget("label2", labelWidgetClass,
- form,
- XtNlabel, "\" \"",
- NULL, 0);
- value = XtVaCreateManagedWidget("value", asciiTextWidgetClass, form,
- XtNeditType, XawtextEdit,
- NULL, 0);
- XtVaCreateManagedWidget("label3", labelWidgetClass, form,
- XtNlabel, "\" ",
- NULL, 0);
- viewport = XtCreateManagedWidget("viewport", viewportWidgetClass,
- form, NULL, 0);
- list = XtCreateManagedWidget("list", listWidgetClass,
- viewport, NULL, 0);
- XtAddCallback(list, XtNcallback, SelectOptionCallback, NULL);
- bottom = XtCreateManagedWidget("bottom", formWidgetClass,
- pane, NULL, 0);
-#ifdef USE_MODULES
- if (!nomodules)
- button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass,
- bottom, NULL, 0);
-#endif
- popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
- bottom, NULL, 0);
-#ifdef USE_MODULES
- if (!nomodules)
- XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0);
-#endif
-
- XtAddCallback(popdown, XtNcallback, PopdownCallback, NULL);
- XtRealizeWidget(optionsShell);
- XSetWMProtocols(DPY, XtWindow(optionsShell), &wm_delete_window, 1);
-
-#ifdef USE_MODULES
- if (!nomodules) {
- char *str;
-
- XtSetArg(args[0], XtNlabel, &str);
- XtGetValues(button, args, 1);
- XmuSnprintf(label, sizeof(label), "%s", str);
- }
-#endif
- }
-
-#ifdef USE_MODULES
- if (!nomodules) {
- if (menu)
- XtDestroyWidget(menu);
- XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN);
- menuN = !menuN;
- menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button,
- NULL, 0);
- XtVaSetValues(button, XtNmenuName, menuName, NULL, 0);
- if (drv_opts) {
- int len, longest = 0;
- char fmt[32];
-
- for (i = 0; drv_opts[i].name != NULL; i++) {
- len = strlen(drv_opts[i].name);
- if (len > longest)
- longest = len;
- }
- XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest);
- for (; drv_opts->name != NULL; drv_opts++) {
- char *type;
-
- if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ)
- type = types[drv_opts->type];
- else
- type = "UNKNOWN";
-
- XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type);
- sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass,
- menu, XtNlabel, buf, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts);
- }
- }
- if (i) {
- xf86cfgModuleOptions *mod = module_options;
-
- while (mod) {
- if (strcmp(mod->name, driver) == 0) {
- /* don't assign to driver, as it may be a temp string */
- module_sel = mod->name;
- break;
- }
- mod = mod->next;
- }
- XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver);
- XtSetArg(args[0], XtNlabel, buf);
- XtSetValues(button, args, 1);
- XtMapWidget(button);
- }
- else
- XtUnmapWidget(button);
- }
-#endif
-
- UpdateOptionList();
- popped = True;
- XtPopup(optionsShell, XtGrabExclusive);
-
- while (popped)
- XtAppProcessEvent(XtWidgetToApplicationContext(optionsShell), XtIMAll);
-}
-
-static void
-UpdateOptionList(void)
-{
- Arg args[2];
- char **ops, **oldops;
- int nops, oldnops;
- XF86OptionPtr opt;
-
- ops = NULL;
- nops = 0;
- XawListUnhighlight(list);
- XtSetArg(args[0], XtNlist, &oldops);
- XtSetArg(args[1], XtNnumberStrings, &oldnops);
- XtGetValues(list, args, 2);
- opt = *options;
- while (opt != NULL) {
- if (nops % 16 == 0)
- ops = (char**)XtRealloc((XtPointer)ops, (nops + 16) *
- sizeof(char*));
- ops[nops++] = XtNewString(opt->opt_name);
- opt = (XF86OptionPtr)(opt->list.next);
- }
- if (nops == 0) {
- ops = (char**)XtMalloc(sizeof(char*));
- ops[0] = XtNewString("");
- nops = 1;
- }
- XtSetArg(args[0], XtNlist, ops);
- XtSetArg(args[1], XtNnumberStrings, nops);
- XtSetValues(list, args, 2);
- if (oldnops > 0 &&
- (oldnops != 1 || XtName(list) != oldops[0])) {
- while (--oldnops >= 0)
- XtFree(oldops[oldnops]);
- XtFree((XtPointer)oldops);
- }
-
- XtSetArg(args[0], XtNstring, "");
- XtSetValues(name, args, 1);
- XtSetValues(value, args, 1);
-
- /* force relayout */
- XtUnmanageChild(list);
- XtManageChild(list);
-
- XtSetSensitive(remov, False);
- XtSetSensitive(update, False);
-}
-
-/*ARGSUSED*/
-static void
-PopdownCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XtPopdown(optionsShell);
- popped = False;
-}
-
-/*ARGSUSED*/
-void
-OptionsCancelAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- PopdownCallback(w, NULL, NULL);
-}
-
-/*ARGSUSED*/
-static void
-SelectOptionCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- XF86OptionPtr option;
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
-
- option_str = info->string;
- option_index = info->list_index;
- if ((option = xf86findOption(*options, info->string)) != NULL) {
- XtSetArg(args[0], XtNstring, option->opt_name);
- XtSetValues(name, args, 1);
- XtSetArg(args[0], XtNstring,
- option->opt_val != NULL ? option->opt_val : "");
- XtSetValues(value, args, 1);
- }
- XtSetSensitive(remov, True);
- XtSetSensitive(update, True);
-}
-
-/*ARGSUSED*/
-static void
-AddOption(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- char *nam, *val;
-
- XtSetArg(args[0], XtNstring, &nam);
- XtGetValues(name, args, 1);
- XtSetArg(args[0], XtNstring, &val);
- XtGetValues(value, args, 1);
- if (xf86findOption(*options, nam) != NULL || strlen(nam) == 0)
- /* XXX xf86addNewOption will trash the option linked list if
- * the options being added already exists.
- */
- return;
- *options = xf86addNewOption(*options, XtNewString(nam),
- val && strlen(val) ? XtNewString(val) : NULL);
- UpdateOptionList();
-}
-
-#ifdef USE_MODULES
-/*ARGSUSED*/
-static void
-AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- OptionInfoPtr opt = (OptionInfoPtr)user_data;
- XF86OptionPtr option;
-
- option_str = (char *)opt->name;
- XtSetArg(args[0], XtNstring, opt->name);
- XtSetValues(name, args, 1);
- if ((option = xf86findOption(*options, opt->name)) == NULL)
- XtSetArg(args[0], XtNstring, "");
- else
- XtSetArg(args[0], XtNstring, option->opt_val);
- XtSetValues(value, args, 1);
-}
-
-/*ARGSUSED*/
-static void
-SelectModuleCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- xf86cfgModuleOptions *mod = module_options;
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
-
- while (mod) {
- if (strcmp(mod->name, info->string) == 0)
- break;
- mod = mod->next;
- }
-
- if (mod) {
- Arg args[2];
- char **list = NULL, **old;
- OptionInfoPtr opts = mod->option;
- int num = 0, oldnum;
-
- module_sel = mod->name;
- XtSetArg(args[0], XtNlist, &old);
- XtSetArg(args[1], XtNnumberStrings, &oldnum);
- XtGetValues(optList, args, 2);
- while (opts && opts->name) {
- ++num;
- list = (char**)XtRealloc((XtPointer)list, sizeof(char*) * num);
- list[num - 1] = XtNewString(opts->name);
- ++opts;
- }
- if (num == 0) {
- list = (char**)XtMalloc(sizeof(char*));
- list[0] = XtNewString("");
- num = 1;
- }
- XtSetArg(args[0], XtNlist, list);
- XtSetArg(args[1], XtNnumberStrings, num);
- XtSetValues(optList, args, 2);
- while (--oldnum >= 0)
- XtFree(old[oldnum]);
- XtFree((XtPointer)old);
-
- XtVaSetValues(desc, XtNstring, "", NULL);
- XawListUnhighlight(optList);
-
- /* force relayout */
- XtUnmanageChild(optList);
- XtManageChild(optList);
- }
-}
-
-static void
-SelectModuleOptionCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- xf86cfgModuleOptions *mod = module_options;
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
- char *description = NULL, *type = "undefined";
- char label[256];
-
- if (module_sel && info->string)
- description = GetOptionDescription(module_sel, info->string);
- if (description == NULL)
- description = "** NO DESCRIPTION AVAILABLE **";
-
- XtVaSetValues(desc, XtNstring, description, NULL);
-
- while (mod) {
- if (strcmp(module_sel, mod->name) == 0)
- break;
- mod = mod->next;
- }
- if (mod) {
- OptionInfoPtr opts = mod->option;
-
- while (opts && opts->name) {
- if (strcasecmp(opts->name, info->string) == 0)
- break;
- ++opts;
- }
- if (opts && opts->name && opts->type >= OPTV_NONE &&
- opts->type <= OPTV_FREQ)
- type = types[opts->type];
- }
-
- XmuSnprintf(label, sizeof(label), "%s.%s (%s)", module_sel, info->string,
- type);
- XtVaSetValues(labelType, XtNlabel, label, NULL);
-}
-#endif
-
-/*ARGSUSED*/
-static void
-RemoveOption(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[1];
- char *str;
-
- XtSetArg(args[0], XtNstring, &str);
- XtGetValues(name, args, 1);
- xf86removeOption(options, str);
- UpdateOptionList();
-}
-
-/*ARGSUSED*/
-static void
-UpdateOption(Widget w, XtPointer user_data, XtPointer call_data)
-{
-/* xf86removeOption(options, option_str);
- AddOption(w, user_data, call_data);
- UpdateOptionList();*/
-
- Arg args[1];
- char *nam, *val;
- XF86OptionPtr option;
-
- XtSetArg(args[0], XtNstring, &nam);
- XtGetValues(name, args, 1);
- XtSetArg(args[0], XtNstring, &val);
- XtGetValues(value, args, 1);
- if ((option = xf86findOption(*options, option_str)) == NULL)
- return;
- XtFree(option->opt_name);
- option->opt_name = option_str = XtNewString(nam);
- XtFree(option->opt_val);
- if (val && strlen(val))
- option->opt_val = XtNewString(val);
- else
- option->opt_val = NULL;
-
- UpdateOptionList();
- XawListHighlight(list, option_index);
- XtSetArg(args[0], XtNstring, option->opt_name);
- XtSetValues(name, args, 1);
- XtSetArg(args[0], XtNstring, option->opt_val);
- XtSetValues(value, args, 1);
-
- XtSetSensitive(remov, True);
- XtSetSensitive(update, True);
-}
-
-/*ARGUSED*/
-static Bool
-EnumDatabase(XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
- XrmRepresentation *type, XrmValue *value, XPointer closure)
-{
- char *module = XrmQuarkToString(quarks[0]),
- *option = XrmQuarkToString(quarks[1]);
-
- /* handle *.Option: value */
- if (module && option == NULL) {
- option = module;
- module = "*";
- }
-
- /*
- * NOTE: If the Options file is changed to support any other format than
- *
- * Module.Option: description text
- *
- * this code will also need to be updated.
- */
-
- if (module) {
- XrmValue xrm;
- char *type, *value, query[256];
-
- XmuSnprintf(query, sizeof(query), "%s.%s", module, option);
- if (XrmGetResource(options_xrm, query, "Module.Option", &type, &xrm))
- value = (char*)xrm.addr;
- else
- value = NULL;
-
- if (value) {
- char *norm;
- unsigned char *ptr;
- int position;
- int length = strlen(module) + strlen(option) + strlen(value) + 4;
-
- rebuild_xrm.string = XtRealloc(rebuild_xrm.string,
- rebuild_xrm.offset + length);
- position = rebuild_xrm.offset +
- sprintf(rebuild_xrm.string + rebuild_xrm.offset, "%s.%s:",
- module, option);
-
- /* removes underlines and spaces */
- norm = strchr(rebuild_xrm.string + rebuild_xrm.offset, '.') + 1;
- for (; *norm; norm++) {
- if (*norm == '_' || *norm == ' ' || *norm == '\t') {
- memmove(norm, norm + 1, strlen(norm) + 1);
- --position;
- --length;
- }
- }
-
- for (ptr = (unsigned char*)rebuild_xrm.string + rebuild_xrm.offset;
- *ptr; ptr++)
- *ptr = tolower(*ptr);
- sprintf(rebuild_xrm.string + position, "%s\n", value);
- rebuild_xrm.offset += length - 1;
- }
- }
-
- return (False);
-}
-
-Bool
-InitializeOptionsDatabase(void)
-{
- static int first = 1;
- static Bool result = True;
-
- if (first) {
- XrmQuark names[2];
- XrmQuark classes[2];
-
- first = 0;
- XrmInitialize();
- if ((options_xrm = XrmGetFileDatabase(Options)) == (XrmDatabase)0) {
- fprintf(stderr, "Cannot open '%s' database.\n", Options);
- return (False);
- }
-
- /* rebuild database, using only lowercase characters */
- names[0] = classes[0] = names[1] = classes[1] = NULLQUARK;
- (void)XrmEnumerateDatabase(options_xrm, (XrmNameList)&names,
- (XrmClassList)&classes, XrmEnumAllLevels,
- EnumDatabase, NULL);
-
- /* free previous database, as it is not guaranteed to be
- * "case insensitive" */
- XrmDestroyDatabase(options_xrm);
-
- /* create case insensitive database by making everything lowercase */
- if (rebuild_xrm.string == NULL ||
- (options_xrm = XrmGetStringDatabase(rebuild_xrm.string)) ==
- (XrmDatabase)0) {
- fprintf(stderr, "Cannot rebuild '%s' database.\n", Options);
- XtFree(rebuild_xrm.string);
- return (False);
- }
- XtFree(rebuild_xrm.string);
- }
-
- return (result);
-}
-
-char *
-GetOptionDescription(char *module, char *option)
-{
- char *type;
- XrmValue value;
- char query[256];
- unsigned char *ptr;
-
- InitializeOptionsDatabase();
-
- XmuSnprintf(query, sizeof(query), "%s.%s", module, option);
- ptr = (unsigned char*)strchr(query, '.') + 1;
- for (; *ptr; ptr++) {
- if (*ptr == '_' || *ptr == ' ' || *ptr == '\t')
- memmove(ptr, ptr + 1, strlen((char*)ptr) + 1);
- }
- for (ptr = (unsigned char*)query; *ptr; ptr++)
- *ptr = tolower(*ptr);
- if (XrmGetResource(options_xrm, query, "Module.Option", &type, &value))
- return ((char*)value.addr);
-
- return (NULL);
-}
diff --git a/hw/xfree86/utils/xorgcfg/options.h b/hw/xfree86/utils/xorgcfg/options.h
deleted file mode 100644
index a90072607..000000000
--- a/hw/xfree86/utils/xorgcfg/options.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.7 2001/07/06 02:04:10 paulo Exp $
- */
-
-#include "config.h"
-#ifdef USE_MODULES
-#include "loader.h"
-#endif
-
-/*
- * Prototypes
- */
-#ifdef USE_MODULES
-void OptionsPopup(XF86OptionPtr*, char*, OptionInfoPtr);
-void ModuleOptionsPopup(Widget, XtPointer, XtPointer);
-#else
-void OptionsPopup(XF86OptionPtr*);
-#endif
-void OptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
-void ModuleOptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
-char *GetOptionDescription(char *module, char *option);
-Bool InitializeOptionsDatabase(void);
-
-void CreateOptionsShell(void);
diff --git a/hw/xfree86/utils/xorgcfg/right.xbm b/hw/xfree86/utils/xorgcfg/right.xbm
deleted file mode 100644
index a2f2ce2d1..000000000
--- a/hw/xfree86/utils/xorgcfg/right.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define right_width 19
-#define right_height 19
-static unsigned char right_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x0e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0x7f, 0x00,
- 0xf8, 0xff, 0x00, 0xf8, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xf8, 0x7f, 0x00,
- 0x00, 0x3e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.c b/hw/xfree86/utils/xorgcfg/screen-cfg.c
deleted file mode 100644
index 9390afc6d..000000000
--- a/hw/xfree86/utils/xorgcfg/screen-cfg.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.14 2003/11/03 05:11:58 tsi Exp $
- */
-
-#include "xf86config.h"
-#include "screen-cfg.h"
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/Toggle.h>
-#include <X11/Xaw/Viewport.h>
-#ifdef USE_MODULES
-#include "loader.h"
-#endif
-
-#define CW 1
-#define CCW -1
-
-/*
- * Prototypes
- */
-static void DepthCallback(Widget, XtPointer, XtPointer);
-static void SelectIndexCallback(Widget, XtPointer, XtPointer);
-static void UnselectIndexCallback(Widget, XtPointer, XtPointer);
-static void SelectCallback(Widget, XtPointer, XtPointer);
-static void UnselectCallback(Widget, XtPointer, XtPointer);
-static void MoveCallback(Widget, XtPointer, XtPointer);
-static void RotateCallback(Widget, XtPointer, XtPointer);
-
-/*
- * Initialization
- */
-static char *standard_modes[] = {
- "640x400",
- "640x480",
- "800x600",
- "1024x768",
- "1280x960",
- "1280x1024",
- "320x200",
- "320x240",
- "400x300",
- "1152x864",
- "1600x1200",
- "1800x1400",
- "512x384",
- "1400x1050",
- "2048x1536",
- "1920x1440",
-};
-
-static char **modes;
-static int nmodes;
-static int default_depth, sel_index, unsel_index;
-static Widget listL, listR;
-static char **defmodes;
-static int ndefmodes;
-static XF86ConfScreenPtr screen;
-static int rotate;
-
-/*
- * Implementation
- */
-XtPointer
-ScreenConfig(XtPointer conf)
-{
- XF86ConfDisplayPtr disp;
- Arg args[2];
- int i, oldrotate;
-
- screen = (XF86ConfScreenPtr)conf;
- if (screen == NULL)
- return (NULL);
-
- XtSetArg(args[0], XtNstring, screen->scrn_identifier);
- XtSetValues(ident_widget, args, 1);
- if ((default_depth = screen->scrn_defaultdepth) <= 0)
- default_depth = 8;
- sel_index = unsel_index = -1;
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == screen) {
- SetScreenRotate(computer.screens[i]);
- rotate = computer.screens[i]->rotate;
- }
- oldrotate = rotate;
-
- ndefmodes = 0;
- disp = screen->scrn_display_lst;
- while (disp != NULL) {
- if (disp->disp_depth == default_depth) {
- XF86ModePtr mod = disp->disp_mode_lst;
-
- while (mod != NULL) {
- if (ndefmodes % 16 == 0)
- defmodes = (char**)
- XtRealloc((XtPointer)defmodes,
- (ndefmodes + 16) * sizeof(char*));
- defmodes[ndefmodes++] = XtNewString(mod->mode_name);
- mod = (XF86ModePtr)(mod->list.next);
- }
- break;
- }
- disp = (XF86ConfDisplayPtr)(disp->list.next);
- }
- if (ndefmodes == 0) {
- defmodes = (char**)XtMalloc(sizeof(char*));
- defmodes[0] = XtNewString("640x480");
- ndefmodes = 1;
- }
-
- if (listL != NULL) {
- XawListUnhighlight(listL);
- XawListUnhighlight(listR);
- }
-
- xf86info.cur_list = SCREEN;
- XtSetSensitive(back, xf86info.lists[SCREEN].cur_function > 0);
- XtSetSensitive(next, xf86info.lists[SCREEN].cur_function <
- xf86info.lists[SCREEN].num_functions - 1);
- (xf86info.lists[SCREEN].functions[xf86info.lists[SCREEN].cur_function])
- (&xf86info);
-
- if (ConfigLoop(NULL) == True) {
- XF86ModePtr prev = NULL, mod;
-
- /* user may have changed the default depth, read variables again */
- disp = screen->scrn_display_lst;
- while (disp != NULL) {
- if (disp->disp_depth == default_depth)
- break;
- disp = (XF86ConfDisplayPtr)(disp->list.next);
- }
-
- if (disp == NULL) {
- disp = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
- screen->scrn_display_lst = (XF86ConfDisplayPtr)
- xf86addListItem((GenericListPtr)(screen->scrn_display_lst),
- (GenericListPtr)(disp));
- disp->disp_depth = default_depth;
- }
-
- if (strcasecmp(screen->scrn_identifier, ident_string))
- xf86renameScreen(XF86Config, screen, ident_string);
-
- screen->scrn_defaultdepth = default_depth;
-
- XtSetArg(args[0], XtNlist, NULL);
- XtSetArg(args[1], XtNnumberStrings, 0);
- XtSetValues(listL, args, 2);
-
- XtSetArg(args[0], XtNlist, NULL);
- XtSetArg(args[1], XtNnumberStrings, 0);
- XtSetValues(listR, args, 2);
-
- mod = disp->disp_mode_lst;
- /* free all modes */
- while (mod != NULL) {
- prev = mod;
- mod = (XF86ModePtr)(mod->list.next);
- XtFree(prev->mode_name);
- XtFree((XtPointer)prev);
- }
- /* readd modes */
- for (i = 0; i < ndefmodes; i++) {
- mod = XtNew(XF86ModeRec);
- mod->mode_name = XtNewString(defmodes[i]);
- XtFree(defmodes[i]);
- if (i == 0)
- disp->disp_mode_lst = mod;
- else
- prev->list.next = mod;
- prev = mod;
- }
- if (i == 0)
- disp->disp_mode_lst = NULL;
- else
- mod->list.next = NULL;
-
- XtFree((XtPointer)defmodes);
- defmodes = NULL;
- ndefmodes = 0;
-
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == screen)
- computer.screens[i]->rotate = rotate;
-
- if (oldrotate != rotate) {
- static char *Rotate = "Rotate";
-
- if (screen->scrn_option_lst != NULL)
- xf86removeOption(&screen->scrn_option_lst, Rotate);
- if (rotate)
- screen->scrn_option_lst =
- xf86addNewOption(screen->scrn_option_lst,
- XtNewString(Rotate),
- XtNewString(rotate > 0 ? "CW" : "CCW"));
- UpdateScreenUI();
- AdjustScreenUI();
- }
-
- return ((XtPointer)screen);
- }
-
- XtSetArg(args[0], XtNlist, NULL);
- XtSetArg(args[1], XtNnumberStrings, 0);
- XtSetValues(listL, args, 2);
-
- XtSetArg(args[0], XtNlist, NULL);
- XtSetArg(args[1], XtNnumberStrings, 0);
- XtSetValues(listR, args, 2);
-
- for (i = 0; i < ndefmodes; i++)
- XtFree(defmodes[i]);
- XtFree((XtPointer)defmodes);
- defmodes = NULL;
- ndefmodes = 0;
-
- return (NULL);
-}
-
-/*ARGSUSED*/
-static void
-DepthCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- if (call_data != NULL)
- default_depth = (long)user_data;
-}
-
-/*ARGSUSED*/
-static void
-SelectIndexCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
-
- sel_index = info->list_index;
-}
-
-/*ARGSUSED*/
-static void
-UnselectIndexCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- XawListReturnStruct *info = (XawListReturnStruct *)call_data;
-
- unsel_index = info->list_index;
-}
-
-/*ARGSUSED*/
-static void
-SelectCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[2];
-
- if (sel_index < 0 || sel_index >= nmodes)
- return;
-
- if (ndefmodes == 1 && *defmodes[0] == '\0') {
- /* make sure tmp and defentries are not the same pointer */
- char **tmp = defmodes;
-
- XtFree(defmodes[0]);
- defmodes = (char**)XtMalloc(sizeof(char*));
- --ndefmodes;
- XtFree((char*)tmp);
- }
- else
- defmodes = (char**)XtRealloc((XtPointer)defmodes,
- sizeof(char*) * (ndefmodes + 1));
- defmodes[ndefmodes++] = XtNewString(modes[sel_index]);
-
- XtSetArg(args[0], XtNlist, defmodes);
- XtSetArg(args[1], XtNnumberStrings, ndefmodes);
- XtSetValues(listR, args, 2);
-
- XawListUnhighlight(listR);
- if (ndefmodes > 1 || (ndefmodes == 1 && *defmodes[0] != '\0')) {
- if (unsel_index >= ndefmodes)
- unsel_index = ndefmodes - 1;
- XawListHighlight(listR, unsel_index = ndefmodes - 1);
- }
- else
- unsel_index = -1;
-
- /* force realyout */
- XtUnmanageChild(listR);
- XtManageChild(listR);
-}
-
-/*ARGSUSED*/
-static void
-UnselectCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- Arg args[2];
- char **modes;
- Cardinal num_modes;
-
- if (unsel_index < 0 || unsel_index >= ndefmodes)
- return;
-
- XawListUnhighlight(listL);
- XtSetArg(args[0], XtNlist, &modes);
- XtSetArg(args[1], XtNnumberStrings, &num_modes);
- XtGetValues(listL, args, 2);
- if (modes) {
- for (sel_index = 0; sel_index < num_modes; sel_index++)
- if (strcmp(defmodes[unsel_index], modes[sel_index]) == 0)
- break;
- if (sel_index < num_modes)
- XawListHighlight(listL, sel_index);
- else
- sel_index = -1;
- }
-
- XtFree(defmodes[unsel_index]);
- if (--ndefmodes > unsel_index)
- memmove(&defmodes[unsel_index], &defmodes[unsel_index + 1],
- (ndefmodes - unsel_index) * sizeof(char*));
- if (ndefmodes == 0) {
- char **tmp = defmodes;
-
- defmodes = (char**)XtMalloc(sizeof(char*));
- defmodes[0] = XtNewString("");
- ndefmodes = 1;
- XtFree((char*)tmp);
- }
-
- XtSetArg(args[0], XtNlist, defmodes);
- XtSetArg(args[1], XtNnumberStrings, ndefmodes);
- XtSetValues(listR, args, 2);
-
- XawListUnhighlight(listR);
- if (ndefmodes > 1 || (ndefmodes == 1 && *defmodes[0] != '\0')) {
- if (unsel_index >= ndefmodes)
- unsel_index = ndefmodes - 1;
- XawListHighlight(listR, unsel_index);
- }
- else
- unsel_index = -1;
-}
-
-/*ARGSUSED*/
-static void
-MoveCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- char *tmp;
- Bool down = (long)user_data;
-
- if (unsel_index < 0 || unsel_index >= ndefmodes)
- return;
-
- if ((down && unsel_index + 1 >= ndefmodes) ||
- (!down && unsel_index - 1 < 0))
- return;
-
- tmp = defmodes[unsel_index];
- if (down) {
- defmodes[unsel_index] = defmodes[unsel_index + 1];
- unsel_index++;
- } else {
- defmodes[unsel_index] = defmodes[unsel_index - 1];
- unsel_index--;
- }
- defmodes[unsel_index] = tmp;
-
- XawListUnhighlight(listR);
- XawListHighlight(listR, unsel_index);
-}
-
-/*ARGSUSED*/
-void
-RotateCallback(Widget w, XtPointer user_data, XtPointer call_data)
-{
- if (call_data != NULL)
- rotate = (long)user_data;
- else
- rotate = 0;
-}
-
-void
-ScreenDialog(XF86SetupInfo *info)
-{
- static Widget dialog, d1, d4, d8, d16, d24, labelRotate, cw, ccw;
- Arg args[2];
- XF86ConfMonitorPtr mon = screen->scrn_monitor;
- XF86ConfModeLinePtr mline = mon != NULL ? mon->mon_modeline_lst : NULL;
- int i;
-#ifdef USE_MODULES
- xf86cfgModuleOptions *drv_opts = module_options;
- Bool foundRotate = False;
-#endif
-
- while (nmodes > 0)
- XtFree(modes[--nmodes]);
- XtFree((XtPointer)modes);
- modes = NULL;
- while (mline) {
- if (nmodes % 16 == 0)
- modes = (char**)XtRealloc((XtPointer)modes,
- sizeof(char*) * (nmodes + 16));
- modes[nmodes++] = XtNewString(mline->ml_identifier);
- mline = (XF86ConfModeLinePtr)(mline->list.next);
- }
- for (i = 0; i < sizeof(standard_modes) / sizeof(standard_modes[0]); i++) {
- if (nmodes % 16 == 0)
- modes = (char**)XtRealloc((XtPointer)modes,
- sizeof(char*) * (nmodes + 16));
- modes[nmodes++] = XtNewString(standard_modes[i]);
- }
-
- if (dialog == NULL) {
- Widget command, viewport;
-
- dialog = XtCreateWidget("screenD", formWidgetClass,
- configp, NULL, 0);
- XtCreateManagedWidget("depthL", labelWidgetClass,
- dialog, NULL, 0);
- d1 = XtCreateManagedWidget("1", toggleWidgetClass, dialog, NULL, 0);
- XtAddCallback(d1, XtNcallback, DepthCallback, (XtPointer)1);
- d4 = XtVaCreateManagedWidget("4", toggleWidgetClass, dialog,
- XtNradioGroup, d1, NULL, 0);
- XtAddCallback(d4, XtNcallback, DepthCallback, (XtPointer)4);
- d8 = XtVaCreateManagedWidget("8", toggleWidgetClass, dialog,
- XtNradioGroup, d4, NULL, 0);
- XtAddCallback(d8, XtNcallback, DepthCallback, (XtPointer)8);
- d16 = XtVaCreateManagedWidget("16", toggleWidgetClass, dialog,
- XtNradioGroup, d8, NULL, 0);
- XtAddCallback(d16, XtNcallback, DepthCallback, (XtPointer)16);
- d24 = XtVaCreateManagedWidget("24", toggleWidgetClass, dialog,
- XtNradioGroup, d16, NULL, 0);
- XtAddCallback(d24, XtNcallback, DepthCallback, (XtPointer)24);
-
- XtCreateManagedWidget("modeL", labelWidgetClass, dialog, NULL, 0);
- viewport = XtCreateManagedWidget("viewL", viewportWidgetClass, dialog,
- NULL, 0);
- listL = XtCreateManagedWidget("listLeft", listWidgetClass, viewport,
- NULL, 0);
- XtAddCallback(listL, XtNcallback, SelectIndexCallback, NULL);
- command = XtCreateManagedWidget("select", commandWidgetClass,
- dialog, NULL, 0);
- XtAddCallback(command, XtNcallback, SelectCallback, NULL);
- command = XtCreateManagedWidget("unselect", commandWidgetClass,
- dialog, NULL, 0);
- XtAddCallback(command, XtNcallback, UnselectCallback, NULL);
- command = XtCreateManagedWidget("up", commandWidgetClass,
- dialog, NULL, 0);
- XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)False);
- command = XtCreateManagedWidget("down", commandWidgetClass,
- dialog, NULL, 0);
- XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)True);
- viewport = XtCreateManagedWidget("viewR", viewportWidgetClass, dialog,
- NULL, 0);
- listR = XtCreateManagedWidget("listRight", listWidgetClass, viewport,
- NULL, 0);
- XtAddCallback(listR, XtNcallback, UnselectIndexCallback, NULL);
-
- labelRotate = XtCreateManagedWidget("rotate", labelWidgetClass,
- dialog, NULL, 0);
- cw = XtCreateManagedWidget("CW", toggleWidgetClass, dialog, NULL, 0);
- XtAddCallback(cw, XtNcallback, RotateCallback, (XtPointer)CW);
- ccw = XtVaCreateManagedWidget("CCW", toggleWidgetClass, dialog,
- XtNradioGroup, cw, NULL, 0);
- XtAddCallback(ccw, XtNcallback, RotateCallback, (XtPointer)CCW);
-
- XtRealizeWidget(dialog);
- }
-
-#ifdef USE_MODULES
- if (!nomodules) {
- while (drv_opts) {
- if (drv_opts->type == VideoModule &&
- strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) {
- OptionInfoPtr opts = drv_opts->option;
-
- while (opts->name) {
- if (xf86nameCompare(opts->name, "Rotate") == 0) {
- foundRotate = True;
- break;
- }
- opts++;
- }
- break;
- }
- drv_opts = drv_opts->next;
- }
-
- if (!foundRotate) {
- XtUnmapWidget(labelRotate);
- XtUnmapWidget(cw);
- XtUnmapWidget(ccw);
- }
- else {
- XtMapWidget(labelRotate);
- XtMapWidget(cw);
- XtMapWidget(ccw);
- }
- }
-#else
- (void)labelRotate;
-#endif
- if (rotate == CW) {
- XtVaSetValues(cw, XtNstate, True, NULL, 0);
- XtVaSetValues(ccw, XtNstate, False, NULL, 0);
- }
- else if (rotate == CCW) {
- XtVaSetValues(cw, XtNstate, False, NULL, 0);
- XtVaSetValues(ccw, XtNstate, True, NULL, 0);
- }
- else {
- XtVaSetValues(cw, XtNstate, False, NULL, 0);
- XtVaSetValues(ccw, XtNstate, False, NULL, 0);
- }
-
- XtSetArg(args[0], XtNlist, modes);
- XtSetArg(args[1], XtNnumberStrings, nmodes);
- XtSetValues(listL, args, 2);
-
- XtSetArg(args[0], XtNlist, defmodes);
- XtSetArg(args[1], XtNnumberStrings, ndefmodes);
- XtSetValues(listR, args, 2);
-
- XtSetArg(args[0], XtNstate, True);
- XtSetValues(default_depth == 1 ? d1 :
- default_depth == 4 ? d4 :
- default_depth == 16 ? d16 :
- default_depth == 24 ? d24 : d8, args, 1);
-
- XtChangeManagedSet(&current, 1, NULL, NULL, &dialog, 1);
- current = dialog;
-}
diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.h b/hw/xfree86/utils/xorgcfg/screen-cfg.h
deleted file mode 100644
index a152f6188..000000000
--- a/hw/xfree86/utils/xorgcfg/screen-cfg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.h,v 1.2 2000/05/18 16:29:59 dawes Exp $
- */
-
-#include "config.h"
-#include "screen.h"
-
-#ifndef _xf86cfg_screencfg_h
-#define _xf86cfg_screencfg_h
-
-/*
- * Prototypes
- */
-XtPointer ScreenConfig(XtPointer);
-void ScreenDialog(XF86SetupInfo*);
-
-#endif /* _xf86cfg_screencfg_h */
diff --git a/hw/xfree86/utils/xorgcfg/screen.c b/hw/xfree86/utils/xorgcfg/screen.c
deleted file mode 100644
index 25fd5f290..000000000
--- a/hw/xfree86/utils/xorgcfg/screen.c
+++ /dev/null
@@ -1,984 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen.c,v 1.9 2002/06/06 21:03:32 paulo Exp $
- */
-
-#include <X11/IntrinsicP.h>
-#include <X11/extensions/shape.h>
-#include <X11/Xaw/Simple.h>
-#include "screen.h"
-
-#define CW 1
-#define CCW -1
-
-/*
- * Prototypes
- */
-void ReshapeScreenWidget(xf86cfgScreen*);
-static int qcmp_screen(_Xconst void*, _Xconst void*);
-
-/*
- * Initialization
- */
-extern Widget work;
-
-static int rows, columns; /* number of rows/columns of monitors */
-
-static int mon_width, mon_height;
-static int *mon_widths, *mon_heights;
-
-/*
- * Implementation
- */
-void
-SetScreenRotate(xf86cfgScreen *screen)
-{
- static char *Rotate = "Rotate", *_CW = "CW", *_CCW = "CCW";
- int rotate = 0;
- XF86OptionPtr option, options;
-
- /* This is the only place where xf86cfg is intrusive, and deletes options
- * added by the user directly in the config file. The "Rotate" option
- * will be kept in the screen section.
- */
- if (screen->monitor != NULL) {
- options = ((XF86ConfMonitorPtr)(screen->monitor->config))->mon_option_lst;
- if ((option = xf86findOption(options, Rotate)) != NULL) {
- if (option->opt_val != NULL)
- rotate = strcasecmp(option->opt_val, _CW) == 0 ? CW :
- strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
- xf86removeOption(&((XF86ConfMonitorPtr)(screen->monitor->config))
- ->mon_option_lst, Rotate);
- }
- }
- if (screen->card != NULL) {
- options = ((XF86ConfDevicePtr)(screen->card->config))->dev_option_lst;
- if ((option = xf86findOption(options, Rotate)) != NULL) {
- if (option->opt_val != NULL)
- rotate += strcasecmp(option->opt_val, _CW) == 0 ? CW :
- strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
- xf86removeOption(&((XF86ConfDevicePtr)(screen->card->config))
- ->dev_option_lst, Rotate);
- }
- }
-
- options = screen->screen->scrn_option_lst;
- if ((option = xf86findOption(options, Rotate)) != NULL) {
- if (option->opt_val != NULL)
- rotate += strcasecmp(option->opt_val, _CW) == 0 ? CW :
- strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
- xf86removeOption(&screen->screen->scrn_option_lst, Rotate);
- }
-
- rotate = rotate > 0 ? CW : rotate < 0 ? CCW : 0;
- if (rotate)
- screen->screen->scrn_option_lst =
- xf86addNewOption(screen->screen->scrn_option_lst,
- XtNewString(Rotate),
- XtNewString(rotate > 0 ? _CW : _CCW));
- screen->rotate = rotate;
-}
-
-void
-CreateScreenWidget(xf86cfgScreen *screen)
-{
- Widget w = XtCreateWidget("screen", simpleWidgetClass,
- XtParent(computer.cpu), NULL, 0);
-
- SetScreenRotate(screen);
- XtRealizeWidget(w);
- screen->widget = w;
- screen->column = screen->row = -1;
-
- ReshapeScreenWidget(screen);
-}
-
-void
-ReshapeScreenWidget(xf86cfgScreen *screen)
-{
- Pixmap pixmap;
- XGCValues values;
- GC gc;
- int x = 0, y = 0, width = screen->rect.width, height = screen->rect.height;
- Widget w = screen->widget;
-
- if (screen->state == USED && screen->row >= 0) {
- if (screen->column == 0)
- x = w->core.width - width;
- else if (screen->column == columns - 1)
- x = w->core.width - mon_widths[screen->column];
- else
- x = (w->core.width - mon_widths[screen->column]) +
- ((mon_widths[screen->column] - width) >> 1);
-
- if (screen->row == 0)
- y = w->core.height - height;
- else if (screen->row == rows - 1)
- y = w->core.height - mon_heights[screen->row];
- else
- y = (w->core.height - mon_heights[screen->row]) +
- ((mon_heights[screen->row] - height) >> 1);
- }
- else if (screen->rect.width == 0) {
- width = w->core.width;
- height = w->core.height;
- }
-
- screen->rect.x = x;
- screen->rect.y = y;
- screen->rect.width = width;
- screen->rect.height = height;
- pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w),
- w->core.width, w->core.height, 1);
- values.foreground = 0;
- values.background = 1;
- gc = XCreateGC(XtDisplay(w), pixmap, GCForeground | GCBackground, &values);
- XFillRectangle(XtDisplay(w), pixmap, gc, 0, 0, w->core.width, w->core.height);
- XSetForeground(XtDisplay(w), gc, 1);
-
- DrawScreenMask(XtDisplay(w), pixmap, gc, x, y, x + width, y + height,
- screen->rotate);
- XShapeCombineMask(XtDisplay(w), XtWindow(w), ShapeBounding,
- 0, 0, pixmap, ShapeSet);
-
- /* Do not call XtSetValues, to avoid all extra code for caching pixmaps */
- XFreePixmap(XtDisplay(w), pixmap);
- if (XtIsRealized(w)) {
- pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w),
- w->core.width, w->core.height,
- DefaultDepthOfScreen(XtScreen(w)));
- DrawScreen(XtDisplay(w), pixmap, x, y, x + width, y + height,
- screen->state == USED ? True : False, screen->rotate);
- XSetWindowBackgroundPixmap(XtDisplay(w), XtWindow(w), pixmap);
- XClearWindow(XtDisplay(w), XtWindow(w));
- XFreePixmap(XtDisplay(w), pixmap);
- }
- XFreeGC(XtDisplay(w), gc);
-}
-
-void
-AddScreen(xf86cfgDevice *mon, xf86cfgDevice *dev)
-{
- int nscreens = 0;
- char screen_name[48];
- XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
- XF86ConfAdjacencyPtr adj;
-
- while (screen != NULL) {
- ++nscreens;
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
- do {
- XmuSnprintf(screen_name, sizeof(screen_name), "Screen%d",
- nscreens);
- ++nscreens;
- } while (xf86findScreen(screen_name,
- XF86Config->conf_screen_lst) != NULL);
-
- screen = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
- screen->scrn_identifier = XtNewString(screen_name);
- screen->scrn_device_str = XtNewString(((XF86ConfDevicePtr)(dev->config))->dev_identifier);
- screen->scrn_device = (XF86ConfDevicePtr)(dev->config);
- screen->scrn_monitor_str = XtNewString(((XF86ConfMonitorPtr)(mon->config))->mon_identifier);
- screen->scrn_monitor = (XF86ConfMonitorPtr)(mon->config);
- XF86Config->conf_screen_lst =
- xf86addScreen(XF86Config->conf_screen_lst, screen);
-
- adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_screen = screen;
- adj->adj_screen_str = XtNewString(screen_name);
- if (computer.layout == NULL)
- computer.layout = XF86Config->conf_layout_lst = (XF86ConfLayoutPtr)
- XtCalloc(1, sizeof(XF86ConfLayoutRec));
- computer.layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
- xf86addListItem((GenericListPtr)computer.layout->lay_adjacency_lst,
- (GenericListPtr)adj);
-
- computer.screens = (xf86cfgScreen**)
- XtRealloc((XtPointer)computer.screens, sizeof(xf86cfgScreen*) *
- (computer.num_screens + 1));
- computer.screens[computer.num_screens] =
- (xf86cfgScreen*)XtCalloc(1, sizeof(xf86cfgScreen));
- computer.screens[computer.num_screens]->screen = screen;
- computer.screens[computer.num_screens]->card = dev;
- computer.screens[computer.num_screens]->monitor = mon;
-
- ++dev->refcount;
- ++mon->refcount;
-
- CreateScreenWidget(computer.screens[computer.num_screens]);
- computer.screens[computer.num_screens]->type = SCREEN;
- SetTip((xf86cfgDevice*)computer.screens[computer.num_screens]);
-
- ++computer.num_screens;
-}
-
-void
-RemoveScreen(xf86cfgDevice *mon, xf86cfgDevice *dev)
-{
- XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
- int i;
-
- mon->state = dev->state = UNUSED;
- while (screen != NULL) {
- if ((XtPointer)screen->scrn_monitor == mon->config &&
- (XtPointer)screen->scrn_device == dev->config)
- break;
-
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
- --mon->refcount;
- --dev->refcount;
-
- for (i = 0; i < computer.num_screens; i++) {
- if (computer.screens[i]->screen == screen) {
- XtDestroyWidget(computer.screens[i]->widget);
- if (i < --computer.num_screens)
- memmove(&computer.screens[i], &computer.screens[i + 1],
- (computer.num_screens - i) * sizeof(xf86cfgScreen*));
- break;
- }
- }
-
- xf86removeScreen(XF86Config, screen);
-}
-
-void
-ChangeScreen(XF86ConfMonitorPtr mon, XF86ConfMonitorPtr oldmon,
- XF86ConfDevicePtr dev, XF86ConfDevicePtr olddev)
-{
- int ioldm, im, ioldc, ic;
-
- if (mon == oldmon && dev == olddev)
- return;
-
- if (mon != NULL) {
- for (im = 0; im < computer.num_devices; im++)
- if (computer.devices[im]->config == (XtPointer)mon)
- break;
- }
- else
- im = -1;
- if (oldmon != NULL) {
- for (ioldm = 0; ioldm < computer.num_devices; ioldm++)
- if (computer.devices[ioldm]->config == (XtPointer)oldmon)
- break;
- }
- else
- ioldm = -1;
-
- if (dev != NULL) {
- for (ic = 0; ic < computer.num_devices; ic++)
- if (computer.devices[ic]->config == (XtPointer)dev)
- break;
- }
- else
- ic = -1;
- if (olddev != NULL) {
- for (ioldc = 0; ioldc < computer.num_devices; ioldc++)
- if (computer.devices[ioldc]->config == (XtPointer)olddev)
- break;
- }
- else
- ioldc = -1;
-
- if (ioldm >= 0 && ioldc >= 0) {
- RemoveScreen(computer.devices[ioldm], computer.devices[ioldc]);
- computer.devices[ioldm]->state = UNUSED;
-/* computer.devices[ioldc]->state = UNUSED;*/
- }
-
- if (im >= 0 && ic >= 0) {
- AddScreen(computer.devices[im], computer.devices[ic]);
- computer.devices[im]->state = USED;
-/* computer.devices[ic]->state = USED;*/
- }
-}
-
-/*
-
-+------------------------------------------------+
-| |
-| +------------------------------------------+ |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| | | |
-| +------------------------------------------+ |
-| |
-+------------------------------------------------+
- | |
- +-------+ +-------+
- | |
- +----------------------------------------+
-
- */
-static double oxs = 0.0, oys = 0.0, oxe = 100.0, oye = 70.0;
-static double ixs = 7.0, iys = 7.0, ixe = 93.0, iye = 63.0;
-static double lin[] = { 25.0, 70.0, 25.0, 75.0, 5.0, 75.0, 5.0, 80.0,
- 95.0, 80.0, 95.0, 75.0, 75.0, 75.0, 75.0, 70.0 };
-
-void
-DrawScreen(Display *dpy, Drawable win, int xs, int ys, int xe, int ye,
- Bool active, int rotate)
-{
- double xfact, yfact;
- XPoint points[(sizeof(lin) / sizeof(lin[0])) >> 1];
- int i;
- static GC gray0, gray1, gray2, black, red;
-
- if (black == NULL) {
- XColor color, exact;
- XGCValues values;
-
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray95",
- &color, &exact);
- values.foreground = color.pixel;
- gray0 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray75",
- &color, &exact);
- values.foreground = color.pixel;
- gray1 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
-
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray60",
- &color, &exact);
- values.foreground = color.pixel;
- gray2 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
-
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray20",
- &color, &exact);
- values.foreground = color.pixel;
- black = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
-
- XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "red",
- &color, &exact);
- values.foreground = color.pixel;
- values.line_width = 4;
- values.cap_style = CapButt;
- red = XCreateGC(XtDisplay(toplevel), win,
- GCForeground | GCLineWidth | GCCapStyle, &values);
- }
-
- if (rotate) {
- xfact = (xe - xs) / 80.0;
- yfact = (ye - ys) / 100.0;
- if (rotate == CW) {
- /* outer rectangle */
- XFillRectangle(dpy, win, gray1,
- oxs * xfact + xs + .5,
- oys * yfact + ys + .5,
- (oye - oys) * xfact + .5,
- (oxe - oxs) * yfact + .5);
- XDrawLine(dpy, win, gray2,
- xs, ye - 1,
- 70 * xfact + xs - 1 + .5, ye - 1);
- XDrawLine(dpy, win, gray2,
- 70 * xfact + xs - 1 + .5, ye - 1,
- 70 * xfact + xs - 1 + .5, ys);
- /* inner rectangle */
- XFillRectangle(dpy, win, black,
- ixs * xfact + xs + .5,
- iys * yfact + ys + .5,
- (iye - iys) * xfact + .5,
- (ixe - ixs) * yfact + .5);
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = lin[(i<<1) + 1] * xfact + xs + .5;
- points[i].y = lin[(i<<1)] * yfact + ys + .5;
- }
- XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
- XDrawLine(dpy, win, gray0,
- (oxe - 10) * xfact + xs + .5, oys * yfact + ys + .5,
- xs, oys * yfact + ys + .5);
- XDrawLine(dpy, win, gray0,
- xs, ys,
- xs, xe);
- XDrawLine(dpy, win, black,
- lin[7] * xfact + xs - 1 + .5, lin[6] * yfact + ys + .5,
- lin[9] * xfact + xs - 1 + .5, lin[8] * yfact + ys - 1 + .5);
- XDrawLine(dpy, win, black,
- lin[9] * xfact + xs - 1 + .5, lin[8] * yfact + ys - 1 + .5,
- lin[11] * xfact + xs + .5, lin[10] * yfact + ys - 1 + .5);
- XDrawLine(dpy, win, black,
- lin[13] * xfact + xs + .5, lin[12] * yfact + ys - 1 + .5,
- lin[15] * xfact + xs + .5, lin[14] * yfact + ys - 1 + .5);
-
- if (!active) {
- XDrawLine(dpy, win, red,
- iys * xfact, ixs * yfact, iye * xfact, ixe * yfact);
- XDrawLine(dpy, win, red,
- iye * xfact, ixs * yfact, iys * xfact, ixe * yfact);
- }
- }
- else if (rotate == CCW) {
- /* outer rectangle */
- XFillRectangle(dpy, win, gray1,
- 10 * xfact + xs + .5,
- oys * yfact + ys + .5,
- (oye - oys) * xfact + .5,
- (oxe - oxs) * yfact + .5);
-
- XDrawLine(dpy, win, gray2,
- 10 * xfact + xs + .5, ye - 1,
- oxe * xfact + xs - 1 + .5, ye - 1);
- XDrawLine(dpy, win, gray2,
- xe - 1, ye - 1,
- xe - 1, ys);
- /* inner rectangle */
- XFillRectangle(dpy, win, black,
- (ixs + 10) * xfact + xs + .5,
- iys * yfact + ys + .5,
- (iye - iys) * xfact + .5,
- (ixe - ixs) * yfact + .5);
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = (-lin[(i<<1) + 1] + 80.0) * xfact + xs + .5;
- points[i].y = lin[(i<<1)] * yfact + ys + .5;
- }
- XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
- XDrawLine(dpy, win, gray0,
- oxe * xfact + xs + .5, oys * yfact + ys + .5,
- (oxs - 10) * xfact + xs + .5, oys * yfact + ys + .5);
- XDrawLine(dpy, win, gray0,
- (oxs + 10) * xfact + xs + .5, ys,
- (oxs + 10) * xfact + xs + .5, xe);
-
- XDrawLine(dpy, win, black,
- xs, lin[8] * yfact - 1 + ys + .5,
- 4 * xfact + xs + .5, lin[8] * yfact - 1 + ys + .5);
- XDrawLine(dpy, win, black,
- 4 * xfact + xs, lin[8] * yfact - 1 + ys + .5,
- 4 * xfact + xs, lin[3] * yfact - 1 + ys + .5);
- XDrawLine(dpy, win, black,
- 4 * xfact + xs + .5, lin[3] * yfact - 1 + ys + .5,
- 10 * xfact + xs + .5 - 1, lin[3] * yfact - 1 + ys + .5);
- XDrawLine(dpy, win, black,
- 4 * xfact + xs, lin[0] * yfact - 1 + ys + .5,
- 4 * xfact + xs, lin[4] * yfact - 1 + ys + .5);
-
- if (!active) {
- XDrawLine(dpy, win, red,
- (iys + 10) * xfact, ixs * yfact,
- (iye + 10) * xfact, ixe * yfact);
- XDrawLine(dpy, win, red,
- (iye + 10) * xfact, ixs * yfact,
- (iys + 10) * xfact, ixe * yfact);
- }
- }
- }
- else {
- xfact = (xe - xs) / 100.0;
- yfact = (ye - ys) / 80.0;
-
- /* outer rectangle */
- XFillRectangle(dpy, win, gray1,
- oxs * xfact + xs + .5,
- oys * yfact + ys + .5,
- (oxe - oxs) * xfact + .5,
- (oye - oys) * yfact + .5);
-
- XDrawLine(dpy, win, gray2,
- oxs * xfact + xs + .5, oye * yfact + ys - 1 + .5,
- oxe * xfact + xs - 1 + .5, oye * yfact + ys - 1 + .5);
- XDrawLine(dpy, win, gray2,
- oxe * xfact + xs - 1 + .5, oys * yfact + ys + .5,
- oxe * xfact + xs - 1 + .5, oye * yfact + ys - 1 + .5);
-
- /* inner rectangle */
- XFillRectangle(dpy, win, black,
- ixs * xfact + xs + .5,
- iys * yfact + ys + .5,
- (ixe - ixs) * xfact + .5,
- (iye - iys) * yfact + .5);
-
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = lin[i<<1] * xfact + xs + .5;
- points[i].y = lin[(i<<1) + 1] * yfact + ys + .5;
- }
-
- XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
-
- XDrawLine(dpy, win, black,
- lin[6] * xfact + xs + .5, lin[7] * yfact + ys - 1 + .5,
- lin[8] * xfact + xs - 1 + .5, lin[9] * yfact + ys - 1 + .5);
- XDrawLine(dpy, win, black,
- lin[8] * xfact + xs - 1 + .5, lin[9] * yfact + ys - 1 + .5,
- lin[10] * xfact + xs - 1 + .5, lin[11] * yfact + ys + .5);
- XDrawLine(dpy, win, black,
- lin[12] * xfact + xs - 1 + .5, lin[13] * yfact + ys + .5,
- lin[14] * xfact + xs - 1 + .5, lin[15] * yfact + ys + .5);
-
- XDrawLine(dpy, win, gray0,
- oxe * xfact + xs + .5, oys * yfact + ys + .5,
- oxs * xfact + xs + .5, oys * yfact + ys + .5);
- XDrawLine(dpy, win, gray0,
- oxs * xfact + xs + .5, oys * yfact + ys + .5,
- oxs * xfact + xs + .5, lin[1] * yfact + ys + .5);
-
- if (!active) {
- XDrawLine(dpy, win, red,
- ixs * xfact, iys * yfact, ixe * xfact, iye * yfact);
- XDrawLine(dpy, win, red,
- ixe * xfact, iys * yfact, ixs * xfact, iye * yfact);
- }
- }
-}
-
-void
-DrawScreenMask(Display *dpy, Drawable win, GC gc, int xs, int ys, int xe, int ye,
- int rotate)
-{
- double xfact, yfact;
- XPoint points[(sizeof(lin) / sizeof(lin[0])) >> 1];
- int i = 0, x = 0, y = 0, width, height;
-
- if (rotate) {
- xfact = (xe - xs) / 80.0;
- yfact = (ye - ys) / 100.0;
- width = (oye - oys) * xfact + .5;
- height = (oxe - oxs) * yfact + .5;
- if (rotate == CW) {
- x = oxs * xfact + xs + .5;
- y = oys * yfact + ys + .5;
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = lin[(i<<1) + 1] * xfact + xs + .5;
- points[i].y = lin[(i<<1)] * yfact + ys + .5;
- }
- }
- else if (rotate == CCW) {
- x = 10 * xfact + xs + .5;
- y = oys * yfact + ys + .5;
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = (-lin[(i<<1) + 1] + 80.0) * xfact + xs + .5;
- points[i].y = lin[(i<<1)] * yfact + ys + .5;
- }
- }
- }
- else {
- xfact = (xe - xs) / 100.0;
- yfact = (ye - ys) / 80.0;
- x = oxs * xfact + xs + .5;
- y = oys * yfact + ys + .5;
- width = (oxe - oxs) * xfact + .5;
- height = (oye - oys) * yfact + .5;
- for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
- points[i].x = lin[(i<<1)] * xfact + xs + .5;
- points[i].y = lin[(i<<1) + 1] * yfact + ys + .5;
- }
- }
-
- /* rectangle */
- XFillRectangle(dpy, win, gc, x, y, width, height);
-
-
- XFillPolygon(dpy, win, gc, points, i, Convex, CoordModeOrigin);
-}
-
-void
-AdjustScreenUI(void)
-{
- XF86ConfLayoutPtr lay = computer.layout;
- XF86ConfAdjacencyPtr adj;
- int i, dx, dy, x, y, w, h, base = -1;
- double xf, yf;
-
- if (lay == NULL)
- return;
-
- adj = lay->lay_adjacency_lst;
-
-#define USED1 -USED
-
- XtFree((XtPointer)mon_widths);
- XtFree((XtPointer)mon_heights);
- mon_widths = (int*)XtCalloc(1, sizeof(int) * columns);
- mon_heights = (int*)XtCalloc(1, sizeof(int) * rows);
-
- mon_width = mon_height = 0;
- for (i = 0; i < computer.num_screens; i++) {
- if (base == -1 && computer.screens[i]->state == USED)
- base = i;
- if (computer.screens[i]->screen->scrn_monitor->mon_width > mon_width)
- mon_width = computer.screens[i]->screen->scrn_monitor->mon_width;
- if (computer.screens[i]->screen->scrn_monitor->mon_height > mon_height)
- mon_height = computer.screens[i]->screen->scrn_monitor->mon_height;
- }
- if (base < 0) {
- for (i = 0; i < computer.num_screens; i++)
- ReshapeScreenWidget(computer.screens[i]);
- return;
- }
-
- if (mon_width == 0) {
- mon_width = 10;
- mon_height = 8;
- }
-
- XtUnmapWidget(work);
-
- while (adj) {
- xf86cfgScreen *scr = NULL,
- *topscr = NULL, *botscr = NULL, *lefscr = NULL, *rigscr = NULL;
-
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == adj->adj_screen)
- break;
- if (i < computer.num_screens)
- scr = computer.screens[i];
-
- if (adj->adj_top != NULL) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == adj->adj_top)
- break;
- if (i < computer.num_screens)
- topscr = computer.screens[i];
- }
-
- if (adj->adj_bottom != NULL) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == adj->adj_bottom)
- break;
- if (i < computer.num_screens)
- botscr = computer.screens[i];
- }
-
- if (adj->adj_left != NULL) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == adj->adj_left)
- break;
- if (i < computer.num_screens)
- lefscr = computer.screens[i];
- }
-
- if (adj->adj_right != NULL) {
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == adj->adj_right)
- break;
- if (i < computer.num_screens)
- rigscr = computer.screens[i];
- }
-
- if (lefscr == NULL && rigscr == NULL && topscr == NULL && lefscr == NULL) {
- XF86ConfScreenPtr s;
-
- if (adj->adj_where >= CONF_ADJ_RIGHTOF < adj->adj_where <= CONF_ADJ_BELOW) {
- s = xf86findScreen(adj->adj_refscreen, XF86Config->conf_screen_lst);
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->screen == s)
- break;
- if (i < computer.num_screens) {
- switch (adj->adj_where) {
- case CONF_ADJ_RIGHTOF:
- lefscr = computer.screens[i];
- break;
- case CONF_ADJ_LEFTOF:
- rigscr = computer.screens[i];
- break;
- case CONF_ADJ_ABOVE:
- botscr = computer.screens[i];
- break;
- case CONF_ADJ_BELOW:
- topscr = computer.screens[i];
- break;
- }
- }
- }
- }
-
- XtMoveWidget(scr->widget, 0, 0);
- scr->state = USED1;
- if (lefscr != NULL) {
- if (lefscr->state == USED1)
- XtMoveWidget(scr->widget,
- lefscr->widget->core.x + lefscr->widget->core.width,
- lefscr->widget->core.y);
- else
- XtMoveWidget(lefscr->widget,
- -(int)(lefscr->widget->core.width),
- scr->widget->core.y);
- }
-
- if (rigscr != NULL) {
- if (rigscr->state == USED1) {
- dx = rigscr->widget->core.x - scr->widget->core.width - scr->widget->core.x;
- dy = rigscr->widget->core.y - scr->widget->core.y;
-
- XtMoveWidget(scr->widget, scr->widget->core.x + dx,
- scr->widget->core.y + dy);
- if (lefscr != NULL && lefscr->state != USED1)
- XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
- lefscr->widget->core.y + dy);
- }
- else
- XtMoveWidget(rigscr->widget, scr->widget->core.width,
- scr->widget->core.y);
- }
-
- if (topscr != NULL) {
- if (topscr->state == USED1) {
- dx = topscr->widget->core.x - scr->widget->core.x;
- dy = topscr->widget->core.y + topscr->widget->core.height -
- scr->widget->core.y;
-
- XtMoveWidget(scr->widget, scr->widget->core.x + dx,
- scr->widget->core.y + dy);
- if (lefscr != NULL && lefscr->state != USED1)
- XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
- lefscr->widget->core.y + dy);
- if (rigscr != NULL && rigscr->state != USED1)
- XtMoveWidget(rigscr->widget, rigscr->widget->core.x + dx,
- rigscr->widget->core.y + dy);
- }
- else
- XtMoveWidget(topscr->widget, scr->widget->core.x,
- scr->widget->core.y - topscr->widget->core.height);
- }
-
- if (botscr != NULL) {
- if (botscr->state == USED1) {
- dx = botscr->widget->core.x - scr->widget->core.x;
- dy = botscr->widget->core.y - scr->widget->core.height - scr->widget->core.y;
-
- XtMoveWidget(scr->widget, scr->widget->core.x + dx,
- scr->widget->core.y + dy);
- if (lefscr != NULL && lefscr->state != USED1)
- XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
- lefscr->widget->core.y + dy);
- if (rigscr != NULL && rigscr->state != USED1)
- XtMoveWidget(rigscr->widget, rigscr->widget->core.x + dx,
- rigscr->widget->core.y + dy);
- if (botscr != NULL && botscr->state != USED1)
- XtMoveWidget(botscr->widget, botscr->widget->core.x + dx,
- botscr->widget->core.y + dy);
- }
- else
- XtMoveWidget(botscr->widget, scr->widget->core.x,
- scr->widget->core.y + scr->widget->core.height);
- }
-
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
-
- for (i = 0; i < computer.num_screens; i++)
- if (computer.screens[i]->state == USED1)
- computer.screens[i]->state = USED;
- else
- XLowerWindow(XtDisplay(computer.screens[i]->widget),
- XtWindow(computer.screens[i]->widget));
-
- w = work->core.width / (columns + 1) - 5;
- h = work->core.height / (rows + 1) - 5;
-
- if (w > h)
- w = h;
- else
- h = w;
-
- dx = (work->core.width - (columns * w)) >> 1;
- dy = (work->core.height - (rows * h)) >> 1;
-
- xf = (double)w / (double)computer.screens[0]->widget->core.width;
- yf = (double)h / (double)computer.screens[0]->widget->core.height;
-
- for (i = 0; i < computer.num_screens; i++) {
- Widget z = computer.screens[i]->widget;
-
- if (computer.screens[i]->state == USED)
- XtConfigureWidget(z, z->core.x * xf + dx,
- z->core.y * yf + dy, w, h, 0);
- else
- XtConfigureWidget(z, z->core.x, z->core.y, w, h, 0);
- }
-
- if (computer.screens[base]->row >= 0) {
- double xf, yf;
- int width, height;
-
- for (i = 0; i < computer.num_screens; i++) {
- width = computer.screens[i]->screen->scrn_monitor->mon_width;
- height = computer.screens[i]->screen->scrn_monitor->mon_height;
- if (width <= 0) {
- width = mon_width;
- height = mon_height;
- }
-
- if (computer.screens[i]->rotate) {
- xf = (double)width / (double)mon_width * 8. / 10.;
- yf = (double)height / (double)mon_height;
- }
- else {
- xf = (double)width / (double)mon_width;
- yf = (double)height / (double)mon_height * 8. / 10.;
- }
- width = computer.screens[i]->widget->core.width * xf;
- height = computer.screens[i]->widget->core.height * yf;
- if (computer.screens[i]->state == USED) {
- if (mon_widths[computer.screens[i]->column] < width)
- mon_widths[computer.screens[i]->column] = width;
- if (mon_heights[computer.screens[i]->row] < height)
- mon_heights[computer.screens[i]->row] = height;
- }
-
- /* do it here to avoid recalculation */
- computer.screens[i]->rect.width = width;
- computer.screens[i]->rect.height = height;
- }
- }
-
- for (i = 0; i < computer.num_screens; i++)
- ReshapeScreenWidget(computer.screens[i]);
-
- /* do a new pass, to avoid gaps if the monitors have different
- * sizes.
- */
- if (computer.screens[base]->row >= 0) {
- x = computer.screens[base]->widget->core.x;
- y = computer.screens[base]->widget->core.y;
-
- /* screens representations are already ordered */
- for (i = base; i < computer.num_screens; i++) {
- if (computer.screens[i]->state == UNUSED)
- continue;
- if (computer.screens[i]->column != 0)
- x += mon_widths[computer.screens[i]->column];
- else {
- x = computer.screens[base]->widget->core.x;
- if (i != base)
- y += mon_heights[computer.screens[i]->row];
- }
- XtMoveWidget(computer.screens[i]->widget, x, y);
- }
- }
- XtMapWidget(work);
-}
-
-static int
-qcmp_screen(_Xconst void *a, _Xconst void *b)
-{
- xf86cfgScreen *s1, *s2;
-
- s1 = *(xf86cfgScreen**)a;
- s2 = *(xf86cfgScreen**)b;
-
- if (s1->widget->core.x > s2->widget->core.x) {
- if (s2->widget->core.y >=
- s1->widget->core.y + (s1->widget->core.height >> 1))
- return (-1);
- return (1);
- }
- else {
- if (s1->widget->core.y >=
- s2->widget->core.y + (s2->widget->core.height >> 1))
- return (1);
- return (-1);
- }
- /*NOTREACHED*/
-}
-
-void
-UpdateScreenUI(void)
-{
- XF86ConfLayoutPtr lay = computer.layout;
- XF86ConfAdjacencyPtr adj, prev, left, base;
- int i, p, cols, scrno;
-
- if (lay == NULL)
- return;
-
- rows = columns = cols = 1;
-
- qsort(computer.screens, computer.num_screens, sizeof(xf86cfgScreen*),
- qcmp_screen);
-
- adj = prev = left = base = NULL;
- for (i = p = scrno = 0; i < computer.num_screens; i++) {
- XF86ConfScreenPtr scr = computer.screens[i]->screen;
-
- if (computer.screens[i]->state == UNUSED)
- continue;
-
- adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_scrnum = scrno++;
- adj->adj_screen = scr;
- adj->adj_screen_str = XtNewString(scr->scrn_identifier);
- if (base == NULL) {
- base = left = adj;
- computer.screens[i]->row = computer.screens[i]->column = 0;
- }
- else {
- int dy = computer.screens[i]->widget->core.y -
- computer.screens[p]->widget->core.y;
-
- prev->list.next = adj;
- if (dy > (computer.screens[i]->widget->core.height >> 1)) {
- adj->adj_where = CONF_ADJ_BELOW;
- adj->adj_refscreen = XtNewString(left->adj_screen_str);
- left = adj;
- computer.screens[i]->row = rows;
- computer.screens[i]->column = 0;
- cols = 1;
- ++rows;
- }
- else {
- computer.screens[i]->row = rows - 1;
- computer.screens[i]->column = cols;
- adj->adj_where = CONF_ADJ_RIGHTOF;
- if (++cols > columns)
- columns = cols;
- adj->adj_refscreen = XtNewString(prev->adj_screen_str);
- }
- }
- prev = adj;
- p = i;
- }
-
- adj = lay->lay_adjacency_lst;
-
- while (adj != NULL) {
- prev = adj;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- XtFree(prev->adj_screen_str);
- XtFree(prev->adj_right_str);
- XtFree(prev->adj_left_str);
- XtFree(prev->adj_top_str);
- XtFree(prev->adj_bottom_str);
- XtFree(prev->adj_refscreen);
- XtFree((char*)prev);
- }
-
- lay->lay_adjacency_lst = base;
-}
diff --git a/hw/xfree86/utils/xorgcfg/screen.h b/hw/xfree86/utils/xorgcfg/screen.h
deleted file mode 100644
index 7c3e2c75f..000000000
--- a/hw/xfree86/utils/xorgcfg/screen.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen.h,v 1.3 2000/12/01 18:31:07 paulo Exp $
- */
-
-#include "xf86config.h"
-#include "config.h"
-
-#ifndef _xf86cfg_screen_h
-#define _xf86cfg_screen_h
-
-/*
- * Prototypes
- */
-void AddScreen(xf86cfgDevice*, xf86cfgDevice*);
-void RemoveScreen(xf86cfgDevice*, xf86cfgDevice*);
-
-void DrawScreen(Display*, Drawable, int, int, int, int, Bool, int);
-void DrawScreenMask(Display*, Drawable, GC, int, int, int, int, int);
-void CreateScreenWidget(xf86cfgScreen*);
-void SetScreenRotate(xf86cfgScreen*);
-
-void AdjustScreenUI(void);
-void UpdateScreenUI(void);
-
-#endif /* _xf86cfg_screen_h */
diff --git a/hw/xfree86/utils/xorgcfg/shorter.xbm b/hw/xfree86/utils/xorgcfg/shorter.xbm
deleted file mode 100644
index 878f219d4..000000000
--- a/hw/xfree86/utils/xorgcfg/shorter.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define shorter_width 19
-#define shorter_height 19
-static unsigned char shorter_bits[] = {
- 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01,
- 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00,
- 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00,
- 0xe0, 0x3f, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01,
- 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/startx.c b/hw/xfree86/utils/xorgcfg/startx.c
deleted file mode 100644
index 23b0ecf5a..000000000
--- a/hw/xfree86/utils/xorgcfg/startx.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c,v 1.8 2002/10/19 20:04:21 herrb Exp $
- */
-
-#include "config.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-
-/*
- * Initialization
- */
-static int xpid;
-Display *DPY;
-
-/*
- * Implementation
- */
-Bool
-startx(void)
-{
- int timeout = 8;
-
- if (getenv("DISPLAY") != NULL)
- /* already running Xserver */
- return (False);
-
- if (XF86Config_path == NULL) {
- char *home, filename[PATH_MAX];
- char commandline[PATH_MAX * 4];
- int c_pos;
- int len;
- /*
- * The name of the 4.0 binary is XFree86. X might also
- * be the name of the 3.3 binary. Therefore don't change
- * name to 'X'.
- */
- if (XFree86_path)
- c_pos = XmuSnprintf(commandline, sizeof(commandline),
- "%s/XFree86 :8 -configure ",XFree86_path);
- else
- c_pos = XmuSnprintf(commandline, sizeof(commandline),
- "%s/bin/XFree86 :8 -configure ", XFree86Dir);
- if (XF86Module_path && ((len = sizeof(commandline) - c_pos) > 0))
- c_pos += XmuSnprintf(commandline + c_pos,len,
- " -modulepath %s",XF86Module_path);
- if (XF86Font_path && ((len = sizeof(commandline) - c_pos) > 0))
- c_pos += XmuSnprintf(commandline + c_pos,len,
- " -fontpath %s",XF86Font_path);
- if (XF86RGB_path && ((len = sizeof(commandline) - c_pos) > 0))
- c_pos += XmuSnprintf(commandline + c_pos,len,
- " -rgbpath %s",XF86RGB_path);
-
- if (system(commandline) != 0) {
- fprintf(stderr, "Failed to run \"X -configure\".\n");
- exit(1);
- }
-
- if ((home = getenv("HOME")) == NULL)
- home = "/";
-
-#ifndef QNX4
- XmuSnprintf(filename, sizeof(filename), "%s/XF86Config.new", home);
-#else
- XmuSnprintf(filename, sizeof(filename), "//%d%s/XF86Config.new",
- getnid(), home);
-#endif
-
- /* this memory is never released, even if the value of XF86Config_path is
- * changed.
- */
- XF86Config_path = XtNewString(filename);
- }
-
- putenv("DISPLAY=:8");
-
- switch (xpid = fork()) {
- case 0: {
- char path[PATH_MAX];
- /* Don't change to X! see above */
- if (XFree86_path)
- XmuSnprintf(path, sizeof(path), "%s/XFree86", XFree86_path);
- else
- XmuSnprintf(path, sizeof(path), "%s/bin/XFree86", XFree86Dir);
- execl(path, "X", ":8", /*"+xinerama",*/ "+accessx","-allowMouseOpenFail",
- "-xf86config", XF86Config_path, (void *)NULL);
- exit(-127);
- } break;
- case -1:
- fprintf(stderr, "Cannot fork.\n");
- exit(1);
- break;
- default:
- break;
- }
-
- while (timeout > 0) {
- int status;
-
- sleep(timeout -= 2);
- if (waitpid(xpid, &status, WNOHANG | WUNTRACED) == xpid)
- break;
- else {
- DPY = XOpenDisplay(NULL);
- if (DPY != NULL)
- break;
- }
- }
-
- if (DPY == NULL) {
- fprintf(stderr, "Cannot connect to X server.\n");
- exit(1);
- }
-
- return (True);
-}
-
-void
-endx(void)
-{
- if (xpid != 0)
- kill(xpid, SIGTERM);
-}
diff --git a/hw/xfree86/utils/xorgcfg/stubs.c b/hw/xfree86/utils/xorgcfg/stubs.c
deleted file mode 100644
index 6496bc868..000000000
--- a/hw/xfree86/utils/xorgcfg/stubs.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.c,v 1.4 2003/03/25 04:18:25 dawes Exp $
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "stubs.h"
-
-/*
- * Implementation
- */
-
-#ifdef __UNIXOS2__
-static char dummy;
-#endif
-
-#if !defined(USE_MODULES)
-/* these are defined in libdummy.a */
-int
-ErrorF(const char *fmt, ...)
-{
- int retval;
- va_list ap;
-
- va_start(ap, fmt);
- retval = vfprintf(stderr, fmt, ap);
-
- va_end(ap);
-
- return (retval);
-}
-
-int
-VErrorF(const char *fmt, va_list ap)
-{
- int retval;
-
- retval = vfprintf(stderr, fmt, ap);
-
- return (retval);
-}
-
-#endif /* !defined(USE_MODULES) */
diff --git a/hw/xfree86/utils/xorgcfg/stubs.h b/hw/xfree86/utils/xorgcfg/stubs.h
deleted file mode 100644
index d554ac17a..000000000
--- a/hw/xfree86/utils/xorgcfg/stubs.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.h,v 1.3 2001/08/01 00:44:57 tsi Exp $
- */
-
-#ifndef _xf86cfg_stubs_h
-#define _xf86cfg_stubs_h
-
-#include <stdarg.h>
-
-int ErrorF(const char*, ...);
-int VErrorF(const char*, va_list);
-#if defined(USE_MODULES)
-extern int xf86Verbose;
-#endif
-
-#endif /* _xf86cfg_stubs_h */
diff --git a/hw/xfree86/utils/xorgcfg/taller.xbm b/hw/xfree86/utils/xorgcfg/taller.xbm
deleted file mode 100644
index c779300ea..000000000
--- a/hw/xfree86/utils/xorgcfg/taller.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define taller_width 19
-#define taller_height 19
-static unsigned char taller_bits[] = {
- 0x00, 0x02, 0x00, 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00,
- 0xe0, 0x3f, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01,
- 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01,
- 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00,
- 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x02, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c
deleted file mode 100644
index 2011d1abd..000000000
--- a/hw/xfree86/utils/xorgcfg/text-mode.c
+++ /dev/null
@@ -1,3381 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.26 2003/11/14 02:40:22 dawes Exp $
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef _SCO_DS
-#include <curses.h>
-#else
-#include <ncurses.h>
-#endif
-#include <ctype.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/XKBstr.h>
-#include <X11/extensions/XKBrules.h>
-#include "cards.h"
-#include "config.h"
-#include "xf86config.h"
-#include "loader.h"
-
-#ifndef PROJECT_ROOT
-#define PROJECT_ROOT "/usr/X11R6"
-#endif
-
-#ifndef __UNIXOS2__
-#define XKB_RULES_DIR PROJECT_ROOT "/lib/X11/xkb/rules"
-#else
-#define XKB_RULES_DIR XF86CONFIGDIR "/xkb/rules"
-#endif
-
-#define CONTROL_A 1
-#define CONTROL_D 4
-#define CONTROL_E 5
-#define CONTROL_K 11
-#define TAB 9
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
-void TextMode(void);
-
-static void ClearScreen(void);
-static void PaintWindow(WINDOW*, char*, int, int, int, int);
-static void PaintBox(WINDOW*, int, int, int, int);
-static void PaintButton(WINDOW*, char*, int, int, int);
-static void PrintWrap(WINDOW*, char*, int, int, int);
-static int Dialog(char*, char*, int, int, char*, char*, int);
-static void PaintItem(WINDOW*, char*, int, int);
-static int DialogMenu(char*, char*, int, int, int, int, char**, char*, char*, int);
-static void PaintCheckItem(WINDOW*, char*, int, int, int);
-static int DialogCheckBox(char*, char*, int, int, int, int, char**, char*, char*, char*);
-static char *DialogInput(char*, char*, int, int, char*, char*, char*, int);
-static void PaintScroller(WINDOW*, int, int, int);
-
-static int MouseConfig(void);
-static int KeyboardConfig(void);
-static int MonitorConfig(void);
-static int CardConfig(void);
-static int ScreenConfig(void);
-static int LayoutConfig(void);
-static int WriteXF86Config(void);
-
-static XF86ConfLayoutPtr CopyLayout(XF86ConfLayoutPtr);
-static XF86ConfAdjacencyPtr CopyAdjacency(XF86ConfAdjacencyPtr);
-static XF86ConfInputrefPtr CopyInputref(XF86ConfInputrefPtr);
-static XF86ConfInactivePtr CopyInactive(XF86ConfInactivePtr);
-static void FreeLayout(XF86ConfLayoutPtr);
-
-extern int string_to_parser_range(char*, parser_range*, int);
-#define PARSER_RANGE_SIZE 256
-/* string must have at least 256 bytes */
-extern int parser_range_to_string(char*, parser_range*, int);
-
-static Bool newconfig;
-
-static chtype screen_attr = A_NORMAL;
-static chtype dialog_attr = A_REVERSE;
-static chtype highlight_border_attr = A_REVERSE;
-static chtype shadow_border_attr = A_REVERSE;
-static chtype title_attr = A_NORMAL;
-static chtype button_active_attr = A_NORMAL;
-static chtype button_inactive_attr = A_NORMAL;
-static int menu_width, item_x;
-static char Edit[] = "Edit ";
-
-static char *main_menu[] = {
-#define CONF_MOUSE 0
- "Configure mouse",
-#define CONF_KEYBOARD 1
- "Configure keyboard",
-#define CONF_MONITOR 2
- "Configure monitor",
-#define CONF_CARD 3
- "Configure card",
-#define CONF_SCREEN 4
- "Configure screen",
-#define CONF_LAYOUT 5
- "Configure layout",
-#define CONF_FINISH 6
- "Write XF86Config and quit",
-#define CONF_QUIT 7
- "Quit",
-};
-
-void
-TextMode(void)
-{
- static int first = 1;
- int i, choice = CONF_MOUSE;
-
-#ifdef USE_MODULES
- if (!nomodules)
- LoaderInitializeOptions();
-#endif
- initscr();
- noecho();
- nonl();
- keypad(stdscr, TRUE);
-
- if (first) {
- const char *filename;
-
- first = 0;
-
- if (has_colors()) {
- start_color();
- init_pair(1, COLOR_BLACK, COLOR_BLACK);
- screen_attr = A_BOLD | COLOR_PAIR(1);
-
- init_pair(2, COLOR_BLACK, COLOR_WHITE);
- dialog_attr = COLOR_PAIR(2);
-
- init_pair(3, COLOR_BLACK, COLOR_WHITE);
- shadow_border_attr = A_BOLD | COLOR_PAIR(3);
-
- init_pair(4, COLOR_WHITE, COLOR_WHITE);
- highlight_border_attr = A_BOLD | COLOR_PAIR(4);
-
- init_pair(5, COLOR_WHITE, COLOR_BLUE);
- title_attr = A_BOLD | COLOR_PAIR(5);
- button_active_attr = title_attr;
-
- init_pair(6, COLOR_WHITE, COLOR_BLACK);
- button_inactive_attr = A_BOLD | COLOR_PAIR(6);
- }
-
- if ((filename = xf86openConfigFile(getuid() == 0 ?
- CONFPATH : USER_CONFPATH,
- XF86Config_path, NULL)) != NULL) {
- XF86Config_path = (char *)filename;
- if ((XF86Config = xf86readConfigFile()) == NULL) {
- ClearScreen();
- refresh();
- Dialog("Configuration error",
- "Error parsing configuration file.",
- 7, 50, " Ok ", NULL, 0);
- }
- }
- if (XF86Config == NULL) {
- XF86Config = (XF86ConfigPtr)XtCalloc(1, sizeof(XF86ConfigRec));
- newconfig = True;
- }
- else
- newconfig = False;
- }
-
- ClearScreen();
- refresh();
-
- /*CONSTCOND*/
- while (1) {
- int cancel = FALSE;
-
- ClearScreen();
- refresh();
- if (Dialog("XFree86 Configuration",
- "This program will create the XF86Config file, based on "
- "menu selections you make.\n"
- "\n"
-#ifndef __UNIXOS2__
- "The XF86Config file usually resides in /usr/X11R6/etc/X11 "
-#else
- "The XF86Config file usually resides in "XF86CONFIGDIR" "
-#endif
- "or /etc/X11. A sample XF86Config file is supplied with "
- "XFree86; it is configured for a standard VGA card and "
- "monitor with 640x480 resolution. This program will ask for "
- "a pathname when it is ready to write the file.\n"
- "\n"
- "You can either take the sample XF86Config as a base and "
- "edit it for your configuration, or let this program "
- "produce a base XF86Config file for your configuration and "
- "fine-tune it.",
- 20, 60, " Ok ", " Cancel ", 0) != 0)
- break;
-
- while (!cancel) {
- ClearScreen();
- refresh();
- switch (DialogMenu("Main menu",
- "Choose one of the options:",
- 17, 60, 8, sizeof(main_menu) /
- sizeof(main_menu[0]), main_menu,
- " Ok ", " Cancel ", choice)) {
- case CONF_MOUSE:
- i = MouseConfig();
- if (i > 0 && choice == CONF_MOUSE)
- choice = CONF_KEYBOARD;
- else if (i == 0)
- choice = CONF_MOUSE;
- break;
- case CONF_KEYBOARD:
- i = KeyboardConfig();
- if (i > 0 && choice <= CONF_KEYBOARD)
- choice = CONF_MONITOR;
- else if (i == 0)
- choice = CONF_KEYBOARD;
- break;
- case CONF_MONITOR:
- i = MonitorConfig();
- if (i > 0 && choice <= CONF_MONITOR)
- choice = CONF_CARD;
- else if (i == 0)
- choice = CONF_MONITOR;
- break;
- case CONF_CARD:
- i = CardConfig();
- if (i > 0 && choice <= CONF_CARD)
- choice = CONF_SCREEN;
- else if (i == 0)
- choice = CONF_CARD;
- break;
- case CONF_SCREEN:
- i = ScreenConfig();
- if (i > 0 && choice <= CONF_SCREEN)
- choice = CONF_LAYOUT;
- else if (i == 0)
- choice = CONF_SCREEN;
- break;
- case CONF_LAYOUT:
- i = LayoutConfig();
- if (i > 0 && choice <= CONF_LAYOUT)
- choice = CONF_FINISH;
- else if (i == 0)
- choice = CONF_LAYOUT;
- break;
- case CONF_FINISH:
- if (WriteXF86Config() < 0)
- break;
- /*FALLTROUGH*/
- case CONF_QUIT:
- endwin();
- exit(0);
- default:
- cancel = TRUE;
- break;
- }
- }
- }
-
- endwin();
-}
-
-static int
-WriteXF86Config(void)
-{
- char *xf86config;
-
- ClearScreen();
- refresh();
- xf86config = DialogInput("Write XF86Config", "Write configuration to file:",
- 10, 60, XF86Config_path ? XF86Config_path :
-#ifndef __UNIXOS2__
- "/etc/X11/XF86Config", " Ok ", " Cancel ", 0);
-#else
- XF86CONFIGDIR"/XF86Config", " Ok ", " Cancel ", 0);
-#endif
-
- if (xf86config == NULL)
- return (-1);
-
- if (newconfig) {
- if (XF86Config->conf_modules == NULL) {
- static char *modules[] = {"extmod", "glx", "dri", "dbe",
- "record", "xtrap", "type1", "speedo"};
- XF86LoadPtr load;
- int i;
-
- XF86Config->conf_modules = (XF86ConfModulePtr)
- XtCalloc(1, sizeof(XF86ConfModuleRec));
-
- XF86Config->conf_modules->mod_comment =
- XtNewString("\tLoad \"freetype\"\n"
- "\t# Load \"xtt\"\n");
-
- for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
- load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec));
- load->load_name = XtNewString(modules[i]);
- XF86Config->conf_modules->mod_load_lst =
- xf86addModule(XF86Config->conf_modules->mod_load_lst, load);
- }
- }
- }
-
- if (!xf86writeConfigFile(xf86config, XF86Config)) {
- char msg[1024];
-
- XmuSnprintf(msg, sizeof(msg), "Failed to write configuration file %s.",
- xf86config);
- ClearScreen();
- refresh();
- (void)Dialog("Write failed!", msg, 8, 60, " Ok ", NULL, 0);
- XtFree(xf86config);
- return (-1);
- }
- XtFree(xf86config);
-
- return (1);
-}
-
-static char *protocols[] = {
-#ifdef __UNIXOS2__
- "OS2Mouse",
-#endif
-#ifdef SCO
- "OsMouse",
-#endif
-#ifdef WSCONS_SUPPORT
- "wsmouse",
-#endif
- "Auto",
- "SysMouse",
- "MouseSystems",
- "BusMouse",
- "PS/2",
- "Microsoft",
-#ifndef __FreeBSD__
- "ImPS/2",
- "ExplorerPS/2",
- "GlidePointPS/2",
- "MouseManPlusPS/2",
- "NetMousePS/2",
- "NetScrollPS/2",
- "ThinkingMousePS/2",
-#endif
- "AceCad",
- "GlidePoint",
- "IntelliMouse",
- "Logitech",
- "MMHitTab",
- "MMSeries",
- "MouseMan",
- "ThinkingMouse",
-};
-
-static int
-MouseConfig(void)
-{
- int i, nlist, def, proto, emul;
- char **list = NULL, *device, *str;
- XF86ConfInputPtr *inputs = NULL;
- XF86ConfInputPtr input = XF86Config->conf_input_lst;
- XF86OptionPtr option;
-
- nlist = 0;
- while (input) {
- if (strcmp(input->inp_driver, "mouse") == 0) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(input->inp_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, input->inp_identifier);
- inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) *
- sizeof(XF86ConfInputPtr));
- inputs[nlist] = input;
- ++nlist;
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
-
- input = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new mouse");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove mouse");
- ClearScreen();
- refresh();
- i = DialogMenu("Mouse configuration",
- "You can edit or remove a previously configured mouse, "
- "or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove mouse",
- "Select which mouse to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- return (-1);
- }
- input = inputs[i];
- }
- else
- input = inputs[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- xf86removeInput(XF86Config, input);
- return (0);
- }
- if (i < nlist - 2)
- input = inputs[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
-
- if (input == NULL) {
- char label[32];
-
- input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
- XmuSnprintf(label, sizeof(label), "Mouse%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- input->inp_identifier =
- DialogInput("Mouse identifier",
- "Enter an identifier for your mouse definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (input->inp_identifier == NULL) {
- XtFree((XtPointer)input);
- return (-1);
- }
- }
-
- def = 0;
- option = xf86findOption(input->inp_option_lst, "Protocol");
- if (option)
- for (i = 0; i < sizeof(protocols)/sizeof(protocols[0]); i++)
- if (strcasecmp(option->opt_val, protocols[i]) == 0) {
- def = i;
- break;
- }
-
- ClearScreen();
- refresh();
- i = DialogMenu("Select mouse protocol",
- "If you have a serial mouse, it probably will work with "
- "the \"Auto\" protocol. But, if it is an old serial "
- "mouse probably it is not PNP; in that case, most serial "
- "mouses understand the \"Microsoft\" protocol.",
- 19, 60, 7, sizeof(protocols) /
- sizeof(protocols[0]), protocols, " Next >>", " Cancel ", def);
- if (i < 0) {
- if (input->inp_driver == NULL) {
- XtFree(input->inp_driver);
- XtFree((XtPointer)input);
- }
- return (i);
- }
- proto = i;
-
- def = 0;
- if (input->inp_driver) {
- option = xf86findOption(input->inp_option_lst, "Emulate3Buttons");
- def = option ? 0 : 1;
- }
- ClearScreen();
- refresh();
- i = Dialog("Mouse 3 buttons emulation",
- "If your mouse has only two buttons, it is recommended that "
- "you enable Emulate3Buttons.\n"
- "\n"
- "Do you want to enable Emulate3Buttons?",
- 10, 60, " Yes ", " No ", def);
- if (i < 0)
- return (i);
- emul = !i;
-
- str = NULL;
- option = xf86findOption(input->inp_option_lst, "Device");
- if (option)
- str = option->opt_val;
- if (str == NULL)
-#ifdef WSCONS_SUPPORT
- str = "/dev/wsmouse";
-#elif defined(__FreeBSD__)
- str = "/dev/sysmouse";
-#elif defined(__UNIXOS2__)
- str = "mouse$";
-#else
- str = "/dev/mouse";
-#endif
-
- ClearScreen();
- refresh();
- device = DialogInput("Select mouse device",
- "Enter mouse device:", 10, 40, str,
- " Finish ", " Cancel ", 0);
- if (device == NULL) {
- if (input->inp_driver == NULL) {
- XtFree(input->inp_driver);
- XtFree((XtPointer)input);
- }
- return (-1);
- }
-
- /* Finish mouse configuration */
- option = xf86findOption(input->inp_option_lst, "Protocol");
- if (option) {
- XtFree((XtPointer)option->opt_val);
- option->opt_val = XtNewString(protocols[proto]);
- }
- else
- input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
- XtNewString("Protocol"), XtNewString(protocols[proto]));
-
- option = xf86findOption(input->inp_option_lst, "Emulate3Buttons");
- if (option && !emul) {
- xf86removeOption(&input->inp_option_lst, "Emulate3Buttons");
- }
- else if (option == NULL && emul)
- input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
- XtNewString("Emulate3Buttons"), NULL);
-
- option = xf86findOption(input->inp_option_lst, "Device");
- if (option) {
- XtFree((XtPointer)option->opt_val);
- option->opt_val = device;
- }
- else
- input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
- XtNewString("Device"), device);
-
- if (input->inp_driver == NULL) {
- input->inp_driver = XtNewString("mouse");
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config->conf_input_lst, input);
- }
-
- return (1);
-}
-
-static int
-KeyboardConfig(void)
-{
- int i;
- char *rulesfile;
- static int first = 1;
- static XkbRF_RulesPtr rules;
- static char **models, **layouts;
- XF86ConfInputPtr *inputs = NULL, input = XF86Config->conf_input_lst;
- char **list = NULL, *model, *layout;
- int nlist, def;
- XF86OptionPtr option;
-
- nlist = 0;
- while (input) {
- if (strcmp(input->inp_driver, "keyboard") == 0) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(input->inp_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, input->inp_identifier);
- inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) *
- sizeof(XF86ConfInputPtr));
- inputs[nlist] = input;
- ++nlist;
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
-
- input = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new keyboard");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove keyboard");
- ClearScreen();
- refresh();
- i = DialogMenu("Keyboard configuration",
- "You can edit or remove a previously configured "
- "keyboard, or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove keyboard",
- "Select which keyboard to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- return (-1);
- }
- input = inputs[i];
- }
- else
- input = inputs[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
- xf86removeInput(XF86Config, input);
- return (0);
- }
- if (i < nlist - 2)
- input = inputs[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)inputs);
-
- if (input == NULL) {
- char label[32];
-
- input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
- XmuSnprintf(label, sizeof(label), "Keyboard%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- input->inp_identifier =
- DialogInput("Keyboard identifier",
- "Enter an identifier for your keyboard definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (input->inp_identifier == NULL) {
- XtFree((XtPointer)input);
- return (-1);
- }
- }
-
- if (first) {
- first = 0;
-#ifdef XFREE98_XKB
- rulesfile = XKB_RULES_DIR "/xfree98";
-#else
- rulesfile = XKB_RULES_DIR "/xfree86";
-#endif
- rules = XkbRF_Load(rulesfile, "", True, False);
- if (rules == NULL) {
- ClearScreen();
- refresh();
- Dialog("Configuration error",
- "XKB rules file not found.\n"
- "\n"
- "Keyboard XKB options will be set to default values.",
- 10, 50, " Ok ", NULL, 0);
- if (input->inp_driver == NULL) {
- input->inp_option_lst =
- xf86addNewOption(input->inp_option_lst,
- XtNewString("XkbModel"), XtNewString("pc101"));
- input->inp_option_lst =
- xf86addNewOption(input->inp_option_lst,
- XtNewString("XkbLayout"), XtNewString("us"));
- input->inp_driver = XtNewString("keyboard");
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config, input);
- }
- return (0);
- }
- models = (char**)XtMalloc(sizeof(char*) * rules->models.num_desc);
- for (i = 0; i < rules->models.num_desc; i++)
- models[i] = XtNewString(rules->models.desc[i].desc);
- layouts = (char**)XtMalloc(sizeof(char*) * rules->layouts.num_desc);
- for (i = 0; i < rules->layouts.num_desc; i++)
- layouts[i] = XtNewString(rules->layouts.desc[i].desc);
- }
- else if (rules == NULL)
- return (-1);
-
- def = 0;
- option = xf86findOption(input->inp_option_lst, "XkbModel");
- if (option) {
- for (i = 0; i < rules->models.num_desc; i++)
- if (strcasecmp(option->opt_val, rules->models.desc[i].name) == 0) {
- def = i;
- break;
- }
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Keyboard model",
- "Please select one of the following keyboard types that is "
- "the better description of your keyboard. If nothing really "
- "matches, choose \"Generic 101-key PC\".\n",
- 20, 60, 9, rules->models.num_desc,
- models, " Next >>", " Cancel ", def);
- if (i < 0)
- return (i);
- model = rules->models.desc[i].name;
-
- def = 0;
- option = xf86findOption(input->inp_option_lst, "XkbLayout");
- if (option) {
- for (i = 0; i < rules->layouts.num_desc; i++)
- if (strcasecmp(option->opt_val, rules->layouts.desc[i].name) == 0) {
- def = i;
- break;
- }
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Keyboard layout",
- "Select keyboard layout:",
- 20, 60, 11, rules->layouts.num_desc,
- layouts, " Finish ", " Cancel ", def);
- if (i < 0)
- return (i);
- layout = rules->layouts.desc[i].name;
-
- /* Finish keyboard configuration */
- option = xf86findOption(input->inp_option_lst, "XkbModel");
- if (option) {
- XtFree((XtPointer)option->opt_val);
- option->opt_val = XtNewString(model);
- }
- else
- input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
- XtNewString("XkbModel"), XtNewString(model));
-
- option = xf86findOption(input->inp_option_lst, "XkbLayout");
- if (option) {
- XtFree((XtPointer)option->opt_val);
- option->opt_val = XtNewString(layout);
- }
- else
- input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
- XtNewString("XkbLayout"), XtNewString(layout));
-
- if (input->inp_driver == NULL) {
- input->inp_driver = XtNewString("keyboard");
- XF86Config->conf_input_lst =
- xf86addInput(XF86Config->conf_input_lst, input);
- }
-
- return (1);
-}
-
-static char *hsync[] = {
-#define CONF_MONITOR_HSYNC 0
- "Enter your own horizontal sync range",
- "31.5; Standard VGA, 640x480 @ 60 Hz",
- "31.5 - 35.1; Super VGA, 800x600 @ 56 Hz",
- "31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)",
- "31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz int., 800x600 @ 56 Hz",
- "31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz",
- "31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz",
- "31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz",
- "31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz",
- "31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz",
- "31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz",
- "31.5 - 92.0; Monitor that can do 1280x1024 @ 85 Hz",
- "31.5 - 108.0; Monitor that can do 1600x1200 @ 85 Hz",
- "31.5 - 128.5; Monitor that can do 1920x1440 @ 85 Hz",
- "31.5 - 137.0; Monitor that can do 2048x1536 @ 85 Hz"
-};
-
-static char *vrefresh[] = {
-#define CONF_MONITOR_VREFRESH 0
- "Enter your own vertical sync range",
- "50 - 70",
- "50 - 90",
- "50 - 100",
- "40 - 150",
-};
-
-static int
-MonitorConfig(void)
-{
- int i;
- XF86ConfMonitorPtr *monitors = NULL, monitor = XF86Config->conf_monitor_lst;
- char **list = NULL, *identifier = NULL, *tmp;
- int nlist, def;
- char hsync_str[256], vrefresh_str[256];
-
- hsync_str[0] = vrefresh_str[0] = '\0';
- nlist = 0;
- while (monitor) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(monitor->mon_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, monitor->mon_identifier);
- monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) *
- sizeof(XF86ConfMonitorPtr));
- monitors[nlist] = monitor;
- ++nlist;
- monitor = (XF86ConfMonitorPtr)(monitor->list.next);
- }
-
- monitor = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new monitor");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(monitors[0]->mon_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", monitors[0]->mon_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove monitor");
- ClearScreen();
- refresh();
- i = DialogMenu("Monitor configuration",
- "You can edit or remove a previously configured "
- "monitor, or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)monitors);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove monitor",
- "Select which monitor to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)monitors);
- return (-1);
- }
- monitor = monitors[i];
- }
- else
- monitor = monitors[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)monitors);
- xf86removeMonitor(XF86Config, monitor);
- return (0);
- }
- if (i < nlist - 2)
- monitor = monitors[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)monitors);
-
- if (monitor == NULL) {
- char label[32];
-
- monitor = (XF86ConfMonitorPtr)XtCalloc(1, sizeof(XF86ConfMonitorRec));
- XmuSnprintf(label, sizeof(label), "Monitor%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- identifier =
- DialogInput("Monitor identifier",
- "Enter an identifier for your monitor definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (identifier == NULL) {
- XtFree((XtPointer)monitor);
- return (-1);
- }
- }
-
- if (monitor->mon_identifier == NULL) {
- ClearScreen();
- refresh();
- i = Dialog("Monitor configuration",
- "Now we want to set the specifications of the monitor. The "
- "two critical parameters are the vertical refresh rate, which "
- "is the rate at which the whole screen is refreshed, and most "
- "importantly the horizontal sync rate, which is the rate at "
- "which scanlines are displayed.\n"
- "\n"
- "The valid range for horizontal sync and vertical sync should "
- "be documented in the manual of your monitor.",
- 15, 60, " Next >>", " Cancel ", 0);
- if (i != 0) {
- XtFree(identifier);
- XtFree((XtPointer)monitor);
- return (-1);
- }
- }
-
- def = 0;
- if (monitor->mon_identifier) {
- int len;
-
- parser_range_to_string(hsync_str, &(monitor->mon_hsync[0]),
- monitor->mon_n_hsync);
- len = strlen(hsync_str);
- for (i = 1; i < sizeof(hsync) / sizeof(hsync[0]); i++) {
- tmp = strchr(hsync[i], ';');
- if (strncmp(hsync_str, hsync[i], len) == 0) {
- def = i;
- break;
- }
- }
- }
- if (hsync_str[0] == '\0')
- strcpy(hsync_str, "31.5");
-
- ClearScreen();
- refresh();
- i = DialogMenu("Monitor HorizSync",
- "You must indicate the horizontal sync range of your "
- "monitor. You can either select one of the predefined "
- "ranges below that correspond to industry-standard monitor "
- "types, or give a specific range.",
- 22, 78, 11, sizeof(hsync) /
- sizeof(hsync[0]), hsync, " Next >>", " Cancel ", def);
- if (i < 0) {
- if (monitor->mon_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)monitor);
- }
- return (-1);
- }
- if (i == CONF_MONITOR_HSYNC) {
- ClearScreen();
- refresh();
- tmp = DialogInput("Monitor HorizSync",
- "Please enter the horizontal sync range of your "
- "monitor, in the format used in the table of monitor "
- "types above. You can either specify one or more "
- "continuous ranges (e.g. 15-25, 30-50), or one or more "
- "fixed sync frequencies.\n"
- "\n"
- "Horizontal sync range:", 16, 62, hsync_str,
- " Ok ", " Cancel ", def);
- if (tmp == NULL) {
- if (monitor->mon_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)monitor);
- }
- return (-1);
- }
- XmuSnprintf(hsync_str, sizeof(hsync_str), "%s", tmp);
- XtFree(tmp);
- }
- else {
- tmp = strchr(hsync[i], ';');
- strncpy(hsync_str, hsync[i], tmp - hsync[i]);
- hsync_str[tmp - hsync[i]] = '\0';
- }
-
- def = 0;
- if (monitor->mon_identifier) {
- parser_range_to_string(vrefresh_str, &(monitor->mon_vrefresh[0]),
- monitor->mon_n_vrefresh);
- for (i = 1; i < sizeof(vrefresh) / sizeof(vrefresh[0]); i++) {
- if (strcmp(vrefresh_str, vrefresh[i]) == 0) {
- def = i;
- break;
- }
- }
- }
- if (vrefresh_str[0] == '\0')
- strcpy(vrefresh_str, "50 - 70");
- ClearScreen();
- refresh();
- i = DialogMenu("Monitor VertRefresh",
- "You must indicate the vertical sync range of your monitor. "
- "You can either select one of the predefined ranges below "
- "that correspond to industry-standard monitor types, or "
- "give a specific range. For interlaced modes, the number "
- "that counts is the high one (e.g. 87 Hz rather than 43 Hz).",
- 19, 60, 5, sizeof(vrefresh) /
- sizeof(vrefresh[0]), vrefresh, " Finish ", " Cancel ", def);
- if (i < 0) {
- if (monitor->mon_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)monitor);
- }
- return (i);
- }
- if (i == CONF_MONITOR_VREFRESH) {
- ClearScreen();
- refresh();
- tmp = DialogInput("Monitor VertRefresh",
- "Vertical sync range:", 10, 50, vrefresh_str,
- " Done ", " Cancel ", 0);
- if (tmp == NULL) {
- if (monitor->mon_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)monitor);
- }
- return (-1);
- }
- XmuSnprintf(vrefresh_str, sizeof(vrefresh_str), "%s", tmp);
- XtFree(tmp);
- }
- else
- strcpy(vrefresh_str, vrefresh[i]);
-
- /* Finish monitor configuration */
- monitor->mon_n_hsync = string_to_parser_range(hsync_str,
- &(monitor->mon_hsync[0]), CONF_MAX_HSYNC);
- monitor->mon_n_vrefresh = string_to_parser_range(vrefresh_str,
- &(monitor->mon_vrefresh[0]), CONF_MAX_VREFRESH);
- if (monitor->mon_identifier == NULL) {
- monitor->mon_identifier = identifier;
- XF86Config->conf_monitor_lst =
- xf86addMonitor(XF86Config->conf_monitor_lst, monitor);
- }
-
- return (1);
-}
-
-static int
-CardConfig(void)
-{
- int i;
- XF86ConfDevicePtr *devices = NULL, device = XF86Config->conf_device_lst;
- char **list = NULL, *identifier = NULL, *driver, *busid, *tmp;
- int nlist, def;
- CardsEntry *entry = NULL;
- static char **drivers;
- static int ndrivers;
- static char *xdrivers[] = {
- "apm",
- "ark",
- "ati",
- "r128",
- "radeon",
- "chips",
- "cirrus",
- "cyrix",
- "fbdev",
- "glint",
- "i128",
- "i740",
- "i810",
- "imstt",
- "mga",
- "neomagic",
- "nv",
- "rendition",
- "s3",
- "s3virge",
- "savage",
- "siliconmotion",
- "sis",
- "tdfx",
- "tga",
- "trident",
- "tseng",
- "vmware",
- "vga",
- "vesa",
- };
-
-#ifdef USE_MODULES
- if (!nomodules) {
- xf86cfgModuleOptions *opts = module_options;
-
- drivers = NULL;
- ndrivers = 0;
- while (opts) {
- if (opts->type == VideoModule) {
- ++ndrivers;
- drivers = (char**)XtRealloc((XtPointer)drivers,
- ndrivers * sizeof(char*));
- /* XXX no private copy */
- drivers[ndrivers - 1] = opts->name;
- }
- opts = opts->next;
- }
- }
- else
-#endif
- {
- ndrivers = sizeof(xdrivers) / sizeof(xdrivers[0]);
- drivers = xdrivers;
- }
-
- nlist = 0;
- while (device) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(device->dev_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, device->dev_identifier);
- devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) *
- sizeof(XF86ConfDevicePtr));
- devices[nlist] = device;
- ++nlist;
- device = (XF86ConfDevicePtr)(device->list.next);
- }
-
- device = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new card");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(devices[0]->dev_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", devices[0]->dev_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove device");
- ClearScreen();
- refresh();
- i = DialogMenu("Card configuration",
- "You can edit or remove a previously configured "
- "card, or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)devices);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove card",
- "Select which card to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)devices);
- return (-1);
- }
- device = devices[i];
- }
- else
- device = devices[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)devices);
- xf86removeDevice(XF86Config, device);
- return (0);
- }
- if (i < nlist - 2)
- device = devices[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)devices);
-
- if (device == NULL) {
- char label[32];
-
- device = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
- device->dev_chipid = device->dev_chiprev = device->dev_irq = -1;
- XmuSnprintf(label, sizeof(label), "Card%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- identifier =
- DialogInput("Card identifier",
- "Enter an identifier for your card definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (identifier == NULL) {
- XtFree((XtPointer)device);
- return (-1);
- }
- }
-
- ClearScreen();
- refresh();
- if (Dialog("Card configuration",
- "Now we must configure video card specific settings. At this "
- "point you can choose to make a selection out of a database of "
- "video card definitions.\n"
- "\n"
- "The database entries include information about the chipset, "
- "what driver to run, the Ramdac and ClockChip, and comments "
- "that will be included in the Device section. However, a lot "
- "of definitions only hint about what driver to run (based on "
- "the chipset the card uses) and are untested.\n"
- "\n"
- "Do you want to look at the card database?",
- 18, 60, " Yes ", " No ", device->dev_identifier != NULL) == 0) {
- static char **cards;
- static int ncards;
-
- if (cards == NULL) {
- ReadCardsDatabase();
- cards = GetCardNames(&ncards);
- cards = (char**)XtRealloc((XtPointer)cards,
- (ncards + 1) * sizeof(char*));
- for (i = ncards; i > 0; i--)
- cards[i] = cards[i - 1];
- cards[0] = "** Unlisted card **";
- ++ncards;
- }
- if (device->dev_card)
- entry = LookupCard(device->dev_card);
- def = 0;
- if (entry) {
- for (i = 0; i < NumCardsEntry; i++)
- if (strcasecmp(CardsDB[i]->name, entry->name) == 0) {
- def = i + 1;
- break;
- }
- /* make sure entry is set to null again */
- entry = NULL;
- }
-
- i = DialogMenu("Card database",
- "Select name that better matches your card:",
- 20, 70, 11, ncards, cards, "Next >>", " Cancel ", def);
- if (i > 0)
- entry = LookupCard(cards[i]);
- }
-
- def = 0;
- tmp = device->dev_driver ? device->dev_driver : entry && entry->driver ?
- entry->driver : "vga";
- for (i = 0; i < ndrivers; i++)
- if (strcmp(drivers[i], tmp) == 0) {
- def = i;
- break;
- }
-
- ClearScreen();
- refresh();
- i = DialogMenu("Card driver",
- "You can select the driver for your card here, or just press "
- "Enter to use the default/current:", 20, 50, 9,
- ndrivers, drivers, " Ok ", " Cancel ", def);
- if (i < 0) {
- if (device->dev_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)device);
- }
- return (-1);
- }
- driver = ndrivers ? drivers[i] : "vga";
-
- ClearScreen();
- refresh();
- tmp = device->dev_busid ? device->dev_busid : "";
- busid = DialogInput("Card BusID",
- "You normally does not need to fill this field "
- "if you have only one video card:", 11, 50, tmp,
- " Finish ", " Cancel ", 0);
-
- /* Finish card configuration */
- if (entry) {
- XtFree(device->dev_card);
- device->dev_card = XtNewString(entry->name);
- if (entry->chipset) {
- XtFree(device->dev_chipset);
- device->dev_chipset = XtNewString(entry->chipset);
- }
- if (entry->ramdac) {
- XtFree(device->dev_ramdac);
- device->dev_ramdac = XtNewString(entry->ramdac);
- }
- if (entry->clockchip) {
- XtFree(entry->clockchip);
- device->dev_clockchip = XtNewString(entry->clockchip);
- }
- }
- if (busid) {
- XtFree(device->dev_busid);
- if (*busid)
- device->dev_busid = busid;
- else {
- device->dev_busid = NULL;
- XtFree(busid);
- }
- }
- XtFree(device->dev_driver);
- device->dev_driver = XtNewString(driver);
- if (device->dev_identifier == NULL) {
- device->dev_identifier = identifier;
- XF86Config->conf_device_lst =
- xf86addDevice(XF86Config->conf_device_lst, device);
- }
-
- return (1);
-}
-
-static char *depths[] = {
- "1 bit, monochrome",
- "4 bit, 16 colors",
- "8 bit, 256 colors",
- "15 bits, 32Kb colors",
- "16 bits, 65Kb colors",
- "24 bits, 16Mb colors",
-};
-
-static char *modes[] = {
- "2048x1536",
- "1920x1440",
- "1800x1400",
- "1600x1200",
- "1400x1050",
- "1280x1024",
- "1280x960",
- "1152x864",
- "1024x768",
- "800x600",
- "640x480",
- "640x400",
- "512x384",
- "400x300",
- "320x240",
- "320x200",
-};
-
-static int
-ScreenConfig(void)
-{
- int i, disp_allocated;
- XF86ConfScreenPtr *screens = NULL, screen = XF86Config->conf_screen_lst;
- char **list = NULL, *identifier = NULL;
- int nlist, def;
- XF86ConfDevicePtr device = NULL;
- XF86ConfMonitorPtr monitor = NULL;
- XF86ConfDisplayPtr display;
- XF86ModePtr mode, ptr = NULL;
- char *checks;
-
- nlist = 0;
- while (screen) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(screen->scrn_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, screen->scrn_identifier);
- screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens, (nlist + 1) *
- sizeof(XF86ConfScreenPtr));
- screens[nlist] = screen;
- ++nlist;
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
-
- screen = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new screen");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(screens[0]->scrn_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", screens[0]->scrn_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove screen");
- ClearScreen();
- refresh();
- i = DialogMenu("Screen configuration",
- "You can edit or remove a previously configured "
- "screen, or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove screen",
- "Select which screen to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
- return (-1);
- }
- screen = screens[i];
- }
- else
- screen = screens[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
- xf86removeScreen(XF86Config, screen);
- return (0);
- }
- if (i < nlist - 2)
- screen = screens[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
-
- if (screen == NULL) {
- char label[256];
- XF86ConfDevicePtr *devices = NULL;
- XF86ConfMonitorPtr *monitors = NULL;
-
- device = XF86Config->conf_device_lst;
- monitor = XF86Config->conf_monitor_lst;
-
- if (device == NULL || monitor == NULL) {
- ClearScreen();
- refresh();
- Dialog("Configuration error",
- "You need to configure (at least) one card and one "
- "monitor before creating a screen definition.",
- 9, 50, " Ok ", NULL, 0);
-
- return (-1);
- }
-
- XmuSnprintf(label, sizeof(label), "Screen%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- identifier =
- DialogInput("Screen identifier",
- "Enter an identifier for your screen definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (identifier == NULL)
- return (-1);
-
- nlist = 0;
- list = NULL;
- while (device) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtNewString(device->dev_identifier);
- devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) *
- sizeof(XF86ConfDevicePtr));
- devices[nlist] = device;
- ++nlist;
- device = (XF86ConfDevicePtr)(device->list.next);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Screen card", "Please select a video card:",
- 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0);
- for (def = 0; def < nlist; def++)
- XtFree(list[def]);
- XtFree((XtPointer)list);
- if (i < 0) {
- XtFree(identifier);
- XtFree((XtPointer)devices);
- return (-1);
- }
- device = devices[i];
- XtFree((XtPointer)devices);
-
- nlist = 0;
- list = NULL;
- while (monitor) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtNewString(monitor->mon_identifier);
- monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) *
- sizeof(XF86ConfMonitorPtr));
- monitors[nlist] = monitor;
- ++nlist;
- monitor = (XF86ConfMonitorPtr)(monitor->list.next);
- }
- XmuSnprintf(label, sizeof(label),
- "Select the monitor connected to \"%s\":",
- device->dev_identifier);
- ClearScreen();
- refresh();
- i = DialogMenu("Screen monitor", label,
- 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0);
- for (def = 0; def < nlist; def++)
- XtFree(list[def]);
- XtFree((XtPointer)list);
- if (i < 0) {
- XtFree(identifier);
- XtFree((XtPointer)monitors);
- return (-1);
- }
- monitor = monitors[i];
- XtFree((XtPointer)monitors);
-
- screen = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
- screen->scrn_device = device;
- screen->scrn_monitor = monitor;
- }
-
- if (screen->scrn_defaultdepth == 1)
- def = 0;
- else if (screen->scrn_defaultdepth == 4)
- def = 1;
- else if (screen->scrn_defaultdepth == 8)
- def = 2;
- else if (screen->scrn_defaultdepth == 15)
- def = 3;
- else if (screen->scrn_defaultdepth == 16)
- def = 4;
- else if (screen->scrn_defaultdepth == 24)
- def = 5;
- else {
- if (screen->scrn_device && screen->scrn_device->dev_driver &&
- strcmp(screen->scrn_device->dev_driver, "vga") == 0)
- def = 1; /* 4bpp */
- else
- def = 2; /* 8bpp */
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Screen depth",
- "Please specify which color depth you want to use by default:",
- 15, 60, 6, sizeof(depths) / sizeof(depths[0]), depths,
- " Next >>", " Cancel ", def);
- if (i < 0) {
- if (screen->scrn_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)screen);
- }
- return (-1);
- }
- else
- /* XXX depths must begin with the depth number */
- screen->scrn_defaultdepth = atoi(depths[i]);
-
- def = 0; /* use def to count how many modes are selected*/
- nlist = 0;
- list = NULL;
- checks = XtMalloc(sizeof(modes) / sizeof(modes[0]));
- /* XXX list fields in the code below are not allocated */
- disp_allocated = 0;
- display = screen->scrn_display_lst;
- while (display && display->disp_depth != screen->scrn_defaultdepth)
- display = (XF86ConfDisplayPtr)(display->list.next);
- if (display == NULL) {
- display = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
- display->disp_white.red = display->disp_black.red = -1;
- display->disp_depth = screen->scrn_defaultdepth;
- disp_allocated = 1;
- }
- else {
- mode = display->disp_mode_lst;
- while (mode) {
- for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
- if (strcmp(modes[i], mode->mode_name) == 0) {
- break;
- }
-
- if (i == sizeof(modes) / sizeof(modes[0])) {
- list = (char**)XtRealloc((XtPointer)list,
- (nlist + 1) * sizeof(char*));
- list[nlist] = mode->mode_name;
- checks = XtRealloc(checks, sizeof(modes) / sizeof(modes[0]) +
- nlist + 1);
- checks[nlist] = 1;
- ++def;
- nlist++;
- break;
- }
- mode = (XF86ModePtr)(mode->list.next);
- }
- }
-
- for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
- checks[i + nlist] = 0;
-
- mode = display->disp_mode_lst;
- while (mode) {
- for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
- if (strcmp(modes[i], mode->mode_name) == 0) {
- ++def;
- checks[i + nlist] = 1;
- break;
- }
- mode = (XF86ModePtr)(mode->list.next);
- }
-
- if (nlist == 0 && def == 0)
- checks[7] = 1; /* 640x480 */
- list = (char**)XtRealloc((XtPointer)list, (nlist + sizeof(modes) /
- sizeof(modes[0])) * sizeof(char*));
- for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
- list[i + nlist] = modes[i];
- nlist += sizeof(modes) / sizeof(modes[0]);
-
- ClearScreen();
- refresh();
- i = DialogCheckBox("Screen modes",
- "Select the video modes for this screen:",
- 17, 60, 8, sizeof(modes) / sizeof(modes[0]), modes,
- " Finish ", " Cancel ", checks);
- if (i < 0) {
- if (screen->scrn_identifier == NULL) {
- XtFree(identifier);
- XtFree((XtPointer)screen);
- XtFree((XtPointer)list);
- if (disp_allocated)
- XtFree((XtPointer)display);
- }
- return (-1);
- }
-
- mode = display->disp_mode_lst;
- while (mode) {
- ptr = (XF86ModePtr)(mode->list.next);
- XtFree(mode->mode_name);
- XtFree((XtPointer)mode);
- mode = ptr;
- }
- display->disp_mode_lst = NULL;
-
- for (i = 0; i < nlist; i++) {
- if (checks[i]) {
- mode = (XF86ModePtr)XtCalloc(1, sizeof(XF86ModeRec));
- mode->mode_name = XtNewString(list[i]);
- if (display->disp_mode_lst == NULL)
- display->disp_mode_lst = ptr = mode;
- else {
- ptr->list.next = mode;
- ptr = mode;
- }
- }
- }
- XtFree((XtPointer)list);
-
- if (disp_allocated) {
- display->list.next = NULL;
- if (screen->scrn_display_lst == NULL)
- screen->scrn_display_lst = display;
- else
- screen->scrn_display_lst->list.next = display;
- }
-
- if (screen->scrn_identifier == NULL) {
- screen->scrn_identifier = identifier;
- screen->scrn_monitor_str = XtNewString(monitor->mon_identifier);
- screen->scrn_device_str = XtNewString(device->dev_identifier);
- XF86Config->conf_screen_lst =
- xf86addScreen(XF86Config->conf_screen_lst, screen);
- }
-
- return (1);
-}
-
-static XF86ConfAdjacencyPtr
-CopyAdjacency(XF86ConfAdjacencyPtr ptr)
-{
- XF86ConfAdjacencyPtr adj = (XF86ConfAdjacencyPtr)
- XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
-
- adj->adj_scrnum = ptr->adj_scrnum;
- adj->adj_screen = ptr->adj_screen;
- adj->adj_screen_str = XtNewString(ptr->adj_screen_str);
- adj->adj_top = ptr->adj_top;
- if (ptr->adj_top_str)
- adj->adj_top_str = XtNewString(ptr->adj_top_str);
- adj->adj_bottom = ptr->adj_bottom;
- if (ptr->adj_bottom_str)
- adj->adj_bottom_str = XtNewString(ptr->adj_bottom_str);
- adj->adj_left = ptr->adj_left;
- if (ptr->adj_left_str)
- adj->adj_left_str = XtNewString(ptr->adj_left_str);
- adj->adj_right = ptr->adj_right;
- if (ptr->adj_right_str)
- adj->adj_right_str = XtNewString(ptr->adj_right_str);
- adj->adj_where = ptr->adj_where;
- adj->adj_x = ptr->adj_x;
- adj->adj_y = ptr->adj_y;
- if (ptr->adj_refscreen)
- adj->adj_refscreen = XtNewString(ptr->adj_refscreen);
-
- return (adj);
-}
-
-static XF86ConfInactivePtr
-CopyInactive(XF86ConfInactivePtr ptr)
-{
- XF86ConfInactivePtr inac = (XF86ConfInactivePtr)
- XtCalloc(1, sizeof(XF86ConfInactiveRec));
-
- inac->inactive_device = ptr->inactive_device;
- if (ptr->inactive_device_str)
- inac->inactive_device_str = XtNewString(ptr->inactive_device_str);
-
- return (inac);
-}
-
-static XF86ConfInputrefPtr
-CopyInputref(XF86ConfInputrefPtr ptr)
-{
- XF86ConfInputrefPtr iref = (XF86ConfInputrefPtr)
- XtCalloc(1, sizeof(XF86ConfInputrefRec));
- XF86OptionPtr opt = ptr->iref_option_lst;
-
- iref->iref_inputdev = ptr->iref_inputdev;
- if (ptr->iref_inputdev_str)
- iref->iref_inputdev_str = XtNewString(ptr->iref_inputdev_str);
- while (opt) {
- iref->iref_option_lst = xf86addNewOption(iref->iref_option_lst,
- XtNewString(opt->opt_name),
- opt->opt_val ? XtNewString(opt->opt_val) : NULL);
- opt = (XF86OptionPtr)(opt->list.next);
- }
-
- return (iref);
-}
-
-static XF86ConfLayoutPtr
-CopyLayout(XF86ConfLayoutPtr ptr)
-{
- XF86ConfLayoutPtr lay = (XF86ConfLayoutPtr)
- XtCalloc(1, sizeof(XF86ConfLayoutRec));
- XF86ConfAdjacencyPtr adj = ptr->lay_adjacency_lst, padj;
- XF86ConfInactivePtr inac = ptr->lay_inactive_lst, pinac;
- XF86ConfInputrefPtr iref = ptr->lay_input_lst, piref;
- XF86OptionPtr opt = ptr->lay_option_lst;
-
- if (ptr->lay_identifier)
- lay->lay_identifier = XtNewString(ptr->lay_identifier);
- if (adj) {
- padj = lay->lay_adjacency_lst = CopyAdjacency(adj);
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- while (adj) {
- padj->list.next = CopyAdjacency(adj);
- padj = (XF86ConfAdjacencyPtr)(padj->list.next);
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- }
- if (inac) {
- pinac = lay->lay_inactive_lst = CopyInactive(inac);
- inac = (XF86ConfInactivePtr)(inac->list.next);
- while (inac) {
- pinac->list.next = CopyInactive(inac);
- pinac = (XF86ConfInactivePtr)(pinac->list.next);
- inac = (XF86ConfInactivePtr)(inac->list.next);
- }
- }
- if (iref) {
- piref = lay->lay_input_lst = CopyInputref(iref);
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- while (iref) {
- piref->list.next = CopyInputref(iref);
- piref = (XF86ConfInputrefPtr)(piref->list.next);
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- }
-
- while (opt) {
- lay->lay_option_lst = xf86addNewOption(lay->lay_option_lst,
- XtNewString(opt->opt_name),
- opt->opt_val ? XtNewString(opt->opt_val) : NULL);
- opt = (XF86OptionPtr)(opt->list.next);
- }
-
- return (lay);
-}
-
-static void
-FreeLayout(XF86ConfLayoutPtr lay)
-{
- static XF86ConfigRec xf86config;
-
- xf86config.conf_layout_lst = lay;
- xf86removeLayout(&xf86config, lay);
-}
-
-static int
-LayoutConfig(void)
-{
- int i;
- XF86ConfLayoutPtr *layouts = NULL, rlayout = NULL,
- layout = XF86Config->conf_layout_lst;
- XF86ConfInputPtr input = XF86Config->conf_input_lst;
- char **list = NULL, *identifier = NULL;
- XF86ConfInputPtr *mouses = NULL, *keyboards = NULL, mouse, keyboard;
- XF86ConfInputrefPtr iref, piref, mref, kref;
- XF86ConfAdjacencyPtr adj, padj;
- int nmouses, nkeyboards;
- int nlist;
- XF86OptionPtr option;
- XF86ConfScreenPtr screen, *screens;
-
- nmouses = nkeyboards = 0;
- while (input) {
- if (strcmp(input->inp_driver, "mouse") == 0) {
- mouses = (XF86ConfInputPtr*)XtRealloc((XtPointer)mouses,
- (nmouses + 1) * sizeof(XF86ConfInputPtr));
- mouses[nmouses] = input;
- ++nmouses;
- }
- else if (strcmp(input->inp_driver, "keyboard") == 0) {
- keyboards = (XF86ConfInputPtr*)XtRealloc((XtPointer)keyboards,
- (nkeyboards + 1) * sizeof(XF86ConfInputPtr));
- keyboards[nkeyboards] = input;
- ++nkeyboards;
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
- if (XF86Config->conf_screen_lst == NULL ||
- nmouses == 0 || nkeyboards == 0) {
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- ClearScreen();
- refresh();
- Dialog("Configuration error",
- "You need to configure (at least) one screen, mouse "
- "and keyboard before creating a layout definition.",
- 9, 50, " Ok ", NULL, 0);
- return (-1);
- }
-
- nlist = 0;
- while (layout) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist] = XtMalloc(sizeof(Edit) +
- strlen(layout->lay_identifier) + 1);
- sprintf(list[nlist], "%s%s", Edit, layout->lay_identifier);
- layouts = (XF86ConfLayoutPtr*)XtRealloc((XtPointer)layouts, (nlist + 1) *
- sizeof(XF86ConfLayoutPtr));
- layouts[nlist] = layout;
- ++nlist;
- layout = (XF86ConfLayoutPtr)(layout->list.next);
- }
-
- layout = NULL;
-
- if (nlist) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
- list[nlist++] = XtNewString("Add new layout");
- if (nlist == 2) {
- i = strlen("Remove ") + strlen(layouts[0]->lay_identifier) + 1;
- list[nlist] = XtMalloc(i);
- XmuSnprintf(list[nlist], i, "Remove %s", layouts[0]->lay_identifier);
- ++nlist;
- }
- else
- list[nlist++] = XtNewString("Remove layout");
- ClearScreen();
- refresh();
- i = DialogMenu("Layout configuration",
- "You can edit or remove a previously configured "
- "layout, or add a new one.", 14, 60, 4, nlist, list,
- " Ok ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)layouts);
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- return (-1);
- }
- if (nlist > 2 && i == nlist - 1) {
- if (nlist > 3) {
- for (i = 0; i < nlist - 2; i++) {
- /* XXX Remove the "Edit " from list entries */
- memmove(list[i], list[i] + sizeof(Edit) - 1,
- strlen(list[i]) - sizeof(Edit) + 2);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Remove layout",
- "Select which layout to remove",
- 13, 60, 4, nlist - 2, list,
- " Remove ", " Cancel ", 0);
- if (i < 0) {
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)layouts);
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- return (-1);
- }
- layout = layouts[i];
- }
- else
- layout = layouts[0];
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)layouts);
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- xf86removeLayout(XF86Config, layout);
- return (0);
- }
- if (i < nlist - 2)
- layout = layouts[i];
- }
- for (i = 0; i < nlist; i++)
- XtFree(list[i]);
- XtFree((XtPointer)list);
- XtFree((XtPointer)layouts);
-
- if (layout == NULL) {
- char label[32];
-
- layout = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
- XmuSnprintf(label, sizeof(label), "Layout%d", nlist ? nlist - 2 : 0);
- ClearScreen();
- refresh();
- identifier =
- DialogInput("Layout identifier",
- "Enter an identifier for your layout definition:",
- 11, 40, label,
- " Next >>", " Cancel ", 0);
- if (identifier == NULL) {
- XtFree((XtPointer)layout);
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- return (-1);
- }
- }
- else {
- /* So that we can safely change it */
- rlayout = layout;
- layout = CopyLayout(rlayout);
- }
-
-
- mouse = keyboard = NULL;
-
- /* Mouse */
- piref = NULL;
- iref = layout->lay_input_lst;
- while (iref) {
- if (strcmp(iref->iref_inputdev->inp_driver, "mouse") == 0) {
- if (mouse == NULL)
- piref = iref;
- if (xf86findOption(iref->iref_option_lst, "CorePointer")) {
- mouse = iref->iref_inputdev;
- piref = iref;
- break;
- }
- }
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- if (mouse == NULL) {
- if (piref) {
- mref = piref;
- mouse = piref->iref_inputdev;
- piref->iref_option_lst =
- xf86addNewOption(piref->iref_option_lst,
- XtNewString("CorePointer"), NULL);
- }
- else {
- mouse = mouses[0];
- mref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
- iref->iref_inputdev_str = XtNewString(mouse->inp_identifier);
- iref->iref_inputdev = mouse;
- iref->iref_option_lst =
- xf86addNewOption(iref->iref_option_lst,
- XtNewString("CorePointer"), NULL);
- iref->list.next = layout->lay_input_lst;
- if (layout->lay_input_lst == NULL)
- layout->lay_input_lst = iref;
- else {
- iref->list.next = layout->lay_input_lst;
- layout->lay_input_lst = iref;
- }
- }
- }
- else
- mref = piref;
-
- /* XXX list fields are not allocated */
- if (nmouses > 1) {
- nlist = 0;
- list = (char**)XtMalloc(sizeof(char*));
- list[nlist++] = mouse->inp_identifier;
- input = XF86Config->conf_input_lst;
- while (input) {
- if (input != mouse && strcmp(input->inp_driver, "mouse") == 0) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist++] = input->inp_identifier;
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Select Core Pointer",
- "Select the mouse connected to you computer",
- 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0);
- if (i < 0) {
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- XtFree((XtPointer)list);
- if (layout->lay_identifier == NULL)
- XtFree(identifier);
- FreeLayout(layout);
- return (-1);
- }
- if (i > 0) {
- /* Did not select the default one */
- iref = layout->lay_input_lst;
- while (iref) {
- if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) {
- if ((option = xf86findOption(iref->iref_option_lst,
- "SendCoreEvents")) != NULL) {
- XtFree(option->opt_name);
- option->opt_name = XtNewString("CorePointer");
- }
- else
- iref->iref_option_lst =
- xf86addNewOption(iref->iref_option_lst,
- "CorePointer", NULL);
- option = xf86findOption(mref->iref_option_lst,
- "CorePointer");
- XtFree(option->opt_name);
- option->opt_name = XtNewString("SendCoreEvents");
- break;
- }
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- }
-
- /* XXX Write code to add/remove more mouses here */
- }
-
-
- /* Keyboard */
- piref = NULL;
- iref = layout->lay_input_lst;
- while (iref) {
- if (strcmp(iref->iref_inputdev->inp_driver, "keyboard") == 0) {
- if (keyboard == NULL)
- piref = iref;
- if (xf86findOption(iref->iref_option_lst, "CoreKeyboard")) {
- keyboard = iref->iref_inputdev;
- piref = iref;
- break;
- }
- }
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- if (keyboard == NULL) {
- if (piref) {
- kref = piref;
- keyboard = piref->iref_inputdev;
- piref->iref_option_lst =
- xf86addNewOption(piref->iref_option_lst,
- XtNewString("CoreKeyboard"), NULL);
- }
- else {
- keyboard = keyboards[0];
- kref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
- iref->iref_inputdev_str = XtNewString(keyboard->inp_identifier);
- iref->iref_inputdev = keyboard;
- iref->iref_option_lst =
- xf86addNewOption(iref->iref_option_lst,
- XtNewString("CoreKeyboard"), NULL);
- iref->list.next = layout->lay_input_lst;
- if (layout->lay_input_lst == NULL)
- layout->lay_input_lst = iref;
- else {
- iref->list.next = layout->lay_input_lst;
- layout->lay_input_lst = iref;
- }
- }
- }
- else
- kref = piref;
-
- /* XXX list fields are not allocated */
- if (nkeyboards > 1) {
- nlist = 0;
- list = (char**)XtMalloc(sizeof(char*));
- list[nlist++] = keyboard->inp_identifier;
- input = XF86Config->conf_input_lst;
- while (input) {
- if (input != keyboard && strcmp(input->inp_driver, "keyboard") == 0) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- list[nlist++] = input->inp_identifier;
- }
- input = (XF86ConfInputPtr)(input->list.next);
- }
- ClearScreen();
- refresh();
- i = DialogMenu("Select Core Keyboard",
- "Select the keyboard connected to you computer",
- 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0);
- if (i < 0) {
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
- XtFree((XtPointer)list);
- if (layout->lay_identifier == NULL)
- XtFree(identifier);
- FreeLayout(layout);
- return (-1);
- }
- if (i > 0) {
- /* Did not select the default one */
- iref = layout->lay_input_lst;
- while (iref) {
- if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) {
- if ((option = xf86findOption(iref->iref_option_lst,
- "SendCoreEvents")) != NULL) {
- XtFree(option->opt_name);
- option->opt_name = XtNewString("CoreKeyboard");
- }
- else
- iref->iref_option_lst =
- xf86addNewOption(iref->iref_option_lst,
- "CoreKeyboard", NULL);
- option = xf86findOption(kref->iref_option_lst,
- "CoreKeyboard");
- XtFree(option->opt_name);
- option->opt_name = XtNewString("SendCoreEvents");
- break;
- }
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- }
-
- /* XXX Write code to add/remove more keyboards here */
- }
-
- XtFree((XtPointer)mouses);
- XtFree((XtPointer)keyboards);
-
- /* Just one screen */
- if (XF86Config->conf_screen_lst->list.next == NULL) {
- ClearScreen();
- refresh();
- Dialog("Layout configuration",
- (nmouses > 1 || nkeyboards > 1) ?
- "As you have only one screen configured, I can now finish "
- "creating this Layout configuration."
- :
- "As you have only one screen, mouse and keyboard configured, "
- "I can now finish creating this Layout configuration.",
- 12, 60, " Finish ", NULL, 0);
-
- goto LayoutFinish;
- }
-
-
- /* The code below just adds a screen to the right of the last
- * one, or allows removing a screen.
- * Needs some review, and adding more options.
- */
-
- /*CONSTCOND*/
- while (1) {
- static char *screen_opts[] = {
- "Add a new screen to layout",
- "Remove screen from layout",
- "Finish layout configuration",
- };
-
- ClearScreen();
- refresh();
- i = DialogMenu("Layout configuration", "Please choose one option:",
- 12, 60, 3, sizeof(screen_opts) / sizeof(screen_opts[0]),
- screen_opts, " Done ", " Cancel all changes ", 2);
-
- /* cancel */
- if (i < 0) {
- XtFree(identifier);
- FreeLayout(layout);
- return (-1);
- }
-
- /* add new screen */
- else if (i == 0) {
- nlist = 0;
- list = NULL;
- screens = NULL;
- screen = XF86Config->conf_screen_lst;
- while (screen) {
- adj = layout->lay_adjacency_lst;
- while (adj) {
- if (adj->adj_screen == screen)
- break;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- if (adj == NULL) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens,
- (nlist + 1) * sizeof(XF86ConfScreenPtr));
- /* NOT duplicated */
- list[nlist] = screen->scrn_identifier;
- screens[nlist] = screen;
- ++nlist;
- }
- screen = (XF86ConfScreenPtr)(screen->list.next);
- }
-
- if (nlist == 0)
- continue;
-
- ClearScreen();
- refresh();
- i = DialogMenu("Layout add screen", "Choose screen to add:",
- 12, 60, 3, nlist, list,
- " Add ", " Cancel ", 0);
- if (i >= 0) {
- padj = layout->lay_adjacency_lst;
- adj = (XF86ConfAdjacencyPtr)
- XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_screen = screens[i];
- if (padj == NULL) {
- adj->adj_where = CONF_ADJ_ABSOLUTE;
- layout->lay_adjacency_lst = adj;
- }
- else {
- while (padj->list.next)
- padj = (XF86ConfAdjacencyPtr)(padj->list.next);
- padj->list.next = adj;
- adj->adj_where = CONF_ADJ_RIGHTOF;
- adj->adj_refscreen =
- XtNewString(padj->adj_screen->scrn_identifier);
- }
- }
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
- }
-
- /* remove a screen */
- else if (i == 1) {
- nlist = 0;
- list = NULL;
- screens = NULL;
- adj = layout->lay_adjacency_lst;
-
- while (adj) {
- list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
- screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens,
- (nlist + 1) * sizeof(XF86ConfScreenPtr));
- list[nlist] = adj->adj_screen->scrn_identifier;
- screens[nlist] = adj->adj_screen;
- ++nlist;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
-
- if (nlist == 0)
- continue;
-
- ClearScreen();
- refresh();
- i = DialogMenu("Layout remove screen", "Choose screen to remove:",
- 12, 60, 3, nlist, list,
- " Remove ", " Cancel ", 0);
-
- adj = padj = layout->lay_adjacency_lst;
- while (adj) {
- if (adj->adj_screen == screens[i]) {
- padj = (XF86ConfAdjacencyPtr)(padj->list.next);
- if (padj && adj->adj_where == CONF_ADJ_RIGHTOF &&
- padj->adj_where == CONF_ADJ_RIGHTOF) {
- XtFree(padj->adj_refscreen);
- padj->adj_refscreen = XtNewString(adj->adj_refscreen);
- }
- xf86removeAdjacency(layout, adj);
- break;
- }
- padj = adj;
- adj = (XF86ConfAdjacencyPtr)(padj->list.next);
- }
- XtFree((XtPointer)list);
- XtFree((XtPointer)screens);
- }
-
- /* finish screen configuration */
- else
- break;
- }
-
-LayoutFinish:
- if (layout->lay_adjacency_lst == NULL) {
- adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
- adj->adj_screen = XF86Config->conf_screen_lst;
- adj->adj_screen_str = XtNewString(XF86Config->conf_screen_lst->scrn_identifier);
- adj->adj_where = CONF_ADJ_ABSOLUTE;
- layout->lay_adjacency_lst = adj;
- }
- if (rlayout) {
- /* just edited this layout */
- if (nmouses > 1 || nkeyboards > 1) {
- XF86ConfAdjacencyPtr tadj = rlayout->lay_adjacency_lst;
- XF86ConfInactivePtr tinac = rlayout->lay_inactive_lst;
- XF86ConfInputrefPtr tinp = rlayout->lay_input_lst;
-
- rlayout->lay_adjacency_lst = layout->lay_adjacency_lst;
- rlayout->lay_inactive_lst = layout->lay_inactive_lst;
- rlayout->lay_input_lst = layout->lay_input_lst;
-
- layout->lay_adjacency_lst = tadj;
- layout->lay_inactive_lst = tinac;
- layout->lay_input_lst = tinp;
- FreeLayout(layout);
- }
- return (0);
- }
- else {
- layout->lay_identifier = identifier;
- XF86Config->conf_layout_lst =
- xf86addLayout(XF86Config->conf_layout_lst, layout);
- }
-
- return (1);
-}
-
-static void
-ClearScreen(void)
-{
- int i, j;
-
- wattrset(stdscr, screen_attr);
- for (i = 0; i < LINES; i++) {
- wmove(stdscr, i, 0);
- for (j = 0; j < COLS; j++)
- waddch(stdscr, ACS_PLUS);
- }
- touchwin(stdscr);
-}
-
-static int
-Dialog(char *title, char * prompt, int height, int width,
- char *label1, char *label2, int button)
-{
- int x, x1, x2, y, key, l1len, l2len;
- WINDOW *dialog;
-
- x = (COLS - width) / 2;
- y = (LINES - height) / 2;
-
- dialog = newwin(height, width, y, x);
- keypad(dialog, TRUE);
-
- PaintWindow(dialog, title, 0, 0, height, width);
- wattrset(dialog, dialog_attr);
- PrintWrap(dialog, prompt, width - 3, 2, 3);
-
- l1len = strlen(label1);
- if (label2)
- l2len = strlen(label2);
- else {
- l2len = button = 0;
- }
-
- x1 = (width - (l1len + l2len)) / (label2 ? 3 : 2);
- x2 = x1 + x1 + l1len;
- y = height - 3;
- if (!button) {
- if (label2)
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- }
- else {
- PaintButton(dialog, label1, y, x1, FALSE);
- if (label2)
- PaintButton(dialog, label2, y, x2, TRUE);
- }
- wrefresh(dialog);
-
- /*CONSTCOND*/
- while (1) {
- key = wgetch(dialog);
- switch (key) {
- case KEY_LEFT:
- case KEY_RIGHT:
- if (!button) {
- if (label2) {
- button = 1;
- PaintButton(dialog, label1, y, x1, FALSE);
- PaintButton(dialog, label2, y, x2, TRUE);
- }
-
- }
- else {
- if (label2) {
- button = 0;
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- }
- }
- wrefresh(dialog);
- break;
- case ' ':
- case '\r':
- case '\n':
- delwin(dialog);
- return button;
- }
- }
- /*NOTREACHED*/
-}
-
-static void
-PaintWindow(WINDOW *win, char *title_str, int y, int x, int height, int width)
-{
- int i, j;
-
- if (title_str != NULL) {
- j = (width - strlen(title_str)) / 2 - 1;
-
- wattrset(win, title_attr);
- wmove(win, x, y);
- for (i = 0; i < j; i++)
- waddch(win, ' ');
- waddstr(win, title_str);
- for (; i < width; i++)
- waddch(win, ' ');
- }
-
- wattrset(win, 0);
-
- for (i = 1; i < height; i++) {
- wmove(win, y + i, x);
- for (j = 0; j < width; j++)
- if (i == height - 1 && !j)
- waddch(win, highlight_border_attr | ACS_LLCORNER);
- else if (i == height - 1 && j == width - 1)
- waddch(win, shadow_border_attr | ACS_LRCORNER);
- else if (i == height - 1)
- waddch(win, shadow_border_attr | ACS_HLINE);
- else if (!j)
- waddch(win, highlight_border_attr | ACS_VLINE);
- else if (j == width - 1)
- waddch(win, shadow_border_attr | ACS_VLINE);
- else
- waddch(win, dialog_attr | ' ');
- }
-
-}
-
-static void
-PaintBox(WINDOW *win, int y, int x, int height, int width)
-{
- int i, j;
-
- wattrset(win, 0);
-
- for (i = 0; i < height; i++) {
- wmove(win, y + i, x);
- for (j = 0; j < width; j++)
- if (!i && !j)
- waddch(win, shadow_border_attr | ACS_ULCORNER);
- else if (i == height - 1 && !j)
- waddch(win, shadow_border_attr | ACS_LLCORNER);
- else if (!i && j == width-1)
- waddch(win, highlight_border_attr | ACS_URCORNER);
- else if (i == height - 1 && j == width - 1)
- waddch(win, highlight_border_attr | ACS_LRCORNER);
- else if (!i)
- waddch(win, shadow_border_attr | ACS_HLINE);
- else if (i == height - 1)
- waddch(win, highlight_border_attr | ACS_HLINE);
- else if (!j)
- waddch(win, shadow_border_attr | ACS_VLINE);
- else if (j == width - 1)
- waddch(win, highlight_border_attr | ACS_VLINE);
- else
- waddch(win, dialog_attr | ' ');
- }
-
-}
-
-static void
-PaintButton(WINDOW *win, char *label, int y, int x, int selected)
-{
- int i, temp;
-
- wmove(win, y, x);
- wattrset(win, selected ? button_active_attr : button_inactive_attr);
- waddstr(win, selected ? "[" : " ");
- temp = strspn(label, " ");
- label += temp;
- wattrset(win, selected ? button_active_attr : button_inactive_attr);
- for (i = 0; i < temp; i++)
- waddch(win, ' ');
- wattrset(win, selected ? button_active_attr : button_inactive_attr);
- waddch(win, label[0]);
- wattrset(win, selected ? button_active_attr : button_inactive_attr);
- waddstr(win, label + 1);
- wattrset(win, selected ? button_active_attr : button_inactive_attr);
- waddstr(win, selected ? "]" : " ");
- wmove(win, y, x + temp + 1);
-}
-
-static void
-PrintWrap(WINDOW *win, char *prompt, int width, int y, int x)
-{
- int cur_x, cur_y, len, yinc;
- char *word, *tempstr = XtMalloc(strlen(prompt) + 1);
-
- cur_x = x;
- cur_y = y;
-
- while (*prompt == '\n') {
- ++cur_y;
- ++prompt;
- }
-
- strcpy(tempstr, prompt);
-
- for (word = strtok(tempstr, " \n"); word != NULL; word = strtok(NULL, " \n")) {
- yinc = 0;
- len = strlen(word);
- while (prompt[word - tempstr + len + yinc] == '\n')
- ++yinc;
- if (cur_x + strlen(word) > width) {
- cur_y++;
- cur_x = x;
- }
- wmove(win, cur_y, cur_x);
- waddstr(win, word);
- getyx(win, cur_y, cur_x);
- if (yinc) {
- cur_y += yinc;
- cur_x = x;
- }
- else
- cur_x++;
- }
-
- free(tempstr);
-}
-
-static int
-DialogMenu(char *title, char *prompt, int height, int width, int menu_height,
- int item_no, char **items, char *label1, char *label2, int choice)
-{
- int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0,
- scrlx = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len;
- WINDOW *dialog, *menu;
-
- max_choice = MIN(menu_height, item_no);
- max_scroll = MAX(0, item_no - max_choice);
-
- x = (COLS - width) / 2;
- y = (LINES - height) / 2;
-
- dialog = newwin(height, width, y, x);
- keypad(dialog, TRUE);
-
- PaintWindow(dialog, title, 0, 0, height, width);
-
- wattrset(dialog, dialog_attr);
- PrintWrap(dialog, prompt, width - 3, 2, 3);
-
- l1len = strlen(label1);
- l2len = strlen(label2);
-
- x1 = (width - (l1len + l2len)) / 3;
- x2 = x1 + x1 + l1len;
-
- menu_width = width - 6;
- getyx(dialog, cur_y, cur_x);
- box_y = cur_y + 1;
- box_x = (width - menu_width) / 2 - 1;
-
- menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1);
- keypad(menu, TRUE);
-
- /* draw a box around the menu items */
- PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2);
-
- item_x = 3;
-
- if (choice > menu_height) {
- scrlx = MIN(max_scroll, choice);
- choice -= scrlx;
- }
-
- for (i = 0; i < max_choice; i++)
- PaintItem(menu, items[i + scrlx], i, i == choice);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
-
- x = width / 2 - 11;
- y = height - 3;
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wrefresh(dialog);
-
- /*CONSTCOND*/
- while (1) {
- i = choice;
- key = wgetch(dialog);
-
- if (menu_height > 1 && key == KEY_PPAGE) {
- if (!choice) {
- if (scrlx) {
- /* Scroll menu down */
- getyx(dialog, cur_y, cur_x);
-
- nscroll = max_choice > scrlx ? -scrlx : -max_choice;
- scrollok(menu, TRUE);
- wscrl(menu, nscroll);
- scrollok(menu, FALSE);
-
- PaintItem(menu, items[i = scrlx + nscroll], 0, TRUE);
- for (++i; i <= scrlx; i++)
- PaintItem(menu, items[i], i - (scrlx + nscroll), FALSE);
- scrlx += nscroll;
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- i = 0;
- }
- else if (menu_height > 1 && key == KEY_NPAGE) {
- if (choice == max_choice - 1) {
- if (scrlx < max_scroll) {
- /* Scroll menu up */
- getyx(dialog, cur_y, cur_x);
-
- nscroll = (scrlx + max_choice > max_scroll ?
- max_scroll : scrlx + max_choice) - scrlx;
- scrollok(menu, TRUE);
- wscrl(menu, nscroll);
- scrollok(menu, FALSE);
-
- scrlx += nscroll;
- for (i = 0; i < max_choice - 1; i++)
- PaintItem(menu, items[i + scrlx], i, FALSE);
- PaintItem(menu, items[i + scrlx], max_choice - 1, TRUE);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- i = max_choice - 1;
- }
- else if (key == KEY_UP) {
- if (!choice) {
- if (scrlx) {
- /* Scroll menu down */
- getyx(dialog, cur_y, cur_x);
- if (menu_height > 1) {
- PaintItem(menu, items[scrlx], 0, FALSE);
- scrollok(menu, TRUE);
- wscrl(menu, - 1);
- scrollok(menu, FALSE);
- }
- scrlx--;
- PaintItem(menu, items[scrlx], 0, TRUE);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- else
- i = choice - 1;
- }
- else if (key == KEY_DOWN) {
- if (choice == max_choice - 1) {
- if (scrlx + choice < item_no - 1) {
- /* Scroll menu up */
- getyx(dialog, cur_y, cur_x);
- if (menu_height > 1) {
- PaintItem(menu, items[scrlx + max_choice - 1], max_choice - 1, FALSE);
- scrollok(menu, TRUE);
- scroll(menu);
- scrollok(menu, FALSE);
- }
- scrlx++;
- PaintItem(menu, items[scrlx + max_choice - 1], max_choice - 1, TRUE);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- else
- i = MIN(choice + 1, item_no - 1);
- }
-
- if (i != choice) {
- getyx(dialog, cur_y, cur_x);
- PaintItem(menu, items[scrlx + choice], choice, FALSE);
-
- choice = i;
- PaintItem(menu, items[scrlx + choice], choice, TRUE);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wmove(dialog, cur_y, cur_x);
- wrefresh(dialog);
- continue;
- }
-
- switch (key) {
- case TAB:
- case KEY_LEFT:
- case KEY_RIGHT:
- if (!button) {
- button = 1;
- PaintButton(dialog, label1, y, x1, FALSE);
- PaintButton(dialog, label2, y, x2, TRUE);
- }
- else {
- button = 0;
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- }
- wrefresh(dialog);
- break;
- case ' ':
- case '\r':
- case '\n':
- delwin(dialog);
- return (!button ? scrlx + choice : -1);
- default:
- for (i = scrlx + choice + 1; i < item_no; i++)
- if (toupper(items[i][0]) == toupper(key))
- break;
- if (i == item_no) {
- for (i = 0; i < scrlx + choice; i++)
- if (toupper(items[i][0]) == toupper(key))
- break;
- }
- getyx(dialog, cur_y, cur_x);
- if (i < item_no && i != scrlx + choice) {
- if (i >= scrlx && i < scrlx + max_choice) {
- /* it is already visible */
- PaintItem(menu, items[scrlx + choice], choice, FALSE);
- choice = i - scrlx;
- }
- else {
- scrlx = MIN(i, max_scroll);
- choice = i - scrlx;
- for (i = 0; i < max_choice; i++)
- if (i != choice)
- PaintItem(menu, items[scrlx + i], i, FALSE);
- }
- PaintItem(menu, items[scrlx + choice], choice, TRUE);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wmove(dialog, cur_y, cur_x);
- wrefresh(dialog);
- }
- break;
- }
- }
- /*NOTREACHED*/
-}
-
-static void
-PaintItem(WINDOW *win, char *item, int choice, int selected)
-{
- int i;
-
- wattrset(win, selected ? title_attr : dialog_attr);
- wmove(win, choice, 1);
- for (i = 1; i < menu_width; i++)
- waddch(win, ' ');
- wmove(win, choice, item_x);
- wattrset(win, selected ? title_attr : dialog_attr);
- waddstr(win, item);
-}
-
-static void
-PaintScroller(WINDOW *win, int offset, int lenght, int visible)
-{
- int i, pos;
-
- if (lenght > visible)
- pos = (visible / (double)lenght) * offset;
- else
- pos = offset;
- wattrset(win, shadow_border_attr);
- for (i = 0; i < visible; i++) {
- wmove(win, i, 0);
- waddch(win, i == pos ? ACS_BLOCK : ACS_VLINE);
- }
-}
-
-static int
-DialogCheckBox(char *title, char *prompt, int height, int width, int menu_height,
- int item_no, char **items, char *label1, char *label2, char *checks)
-{
- int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0, choice = 0,
- scrlx = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len;
- WINDOW *dialog, *menu;
-
- max_choice = MIN(menu_height, item_no);
- max_scroll = MAX(0, item_no - max_choice);
-
- x = (COLS - width) / 2;
- y = (LINES - height) / 2;
-
- dialog = newwin(height, width, y, x);
- keypad(dialog, TRUE);
-
- PaintWindow(dialog, title, 0, 0, height, width);
-
- wattrset(dialog, dialog_attr);
- PrintWrap(dialog, prompt, width - 3, 2, 3);
-
- l1len = strlen(label1);
- l2len = strlen(label2);
-
- x1 = (width - (l1len + l2len)) / 3;
- x2 = x1 + x1 + l1len;
-
- menu_width = width - 6;
- getyx(dialog, cur_y, cur_x);
- box_y = cur_y + 1;
- box_x = (width - menu_width) / 2 - 1;
-
- menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1);
- keypad(menu, TRUE);
-
- /* draw a box around the menu items */
- PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2);
-
- item_x = 3;
-
- for (i = 0; i < max_choice; i++)
- PaintCheckItem(menu, items[i + scrlx], i, i == 0, checks[i + scrlx]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
-
- x = width / 2 - 11;
- y = height - 3;
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wrefresh(dialog);
-
- /*CONSTCOND*/
- while (1) {
- i = choice;
- key = wgetch(dialog);
-
- if (menu_height > 1 && key == KEY_PPAGE) {
- if (!choice) {
- if (scrlx) {
- /* Scroll menu down */
- getyx(dialog, cur_y, cur_x);
-
- nscroll = max_choice > scrlx ? -scrlx : -max_choice;
- scrollok(menu, TRUE);
- wscrl(menu, nscroll);
- scrollok(menu, FALSE);
-
- i = scrlx + nscroll;
- PaintCheckItem(menu, items[i], 0, TRUE, checks[i]);
- for (++i; i <= scrlx; i++)
- PaintCheckItem(menu, items[i], i - (scrlx + nscroll), FALSE, checks[i]);
- scrlx += nscroll;
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- i = 0;
- }
- else if (menu_height > 1 && key == KEY_NPAGE) {
- if (choice == max_choice - 1) {
- if (scrlx < max_scroll) {
- /* Scroll menu up */
- getyx(dialog, cur_y, cur_x);
-
- nscroll = (scrlx + max_choice > max_scroll ?
- max_scroll : scrlx + max_choice) - scrlx;
- scrollok(menu, TRUE);
- wscrl(menu, nscroll);
- scrollok(menu, FALSE);
-
- scrlx += nscroll;
- for (i = 0; i < max_choice - 1; i++)
- PaintCheckItem(menu, items[i + scrlx], i, FALSE, checks[i + scrlx]);
- PaintCheckItem(menu, items[i + scrlx], max_choice - 1, TRUE, checks[i + scrlx]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- i = max_choice - 1;
- }
- else if (key == KEY_UP) {
- if (!choice) {
- if (scrlx) {
- /* Scroll menu down */
- getyx(dialog, cur_y, cur_x);
- if (menu_height > 1) {
- PaintCheckItem(menu, items[scrlx], 0, FALSE, checks[scrlx]);
- scrollok(menu, TRUE);
- wscrl(menu, - 1);
- scrollok(menu, FALSE);
- }
- scrlx--;
- PaintCheckItem(menu, items[scrlx], 0, TRUE, checks[scrlx]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- else
- i = choice - 1;
- }
- else if (key == KEY_DOWN) {
- if (choice == max_choice - 1) {
- if (scrlx + choice < item_no - 1) {
- /* Scroll menu up */
- getyx(dialog, cur_y, cur_x);
- if (menu_height > 1) {
- PaintCheckItem(menu, items[scrlx + max_choice - 1], max_choice - 1, FALSE, checks[scrlx + max_choice - 1]);
- scrollok(menu, TRUE);
- scroll(menu);
- scrollok(menu, FALSE);
- }
- scrlx++;
- PaintCheckItem(menu, items[scrlx + max_choice - 1], max_choice - 1, TRUE, checks[scrlx + max_choice - 1]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wrefresh(dialog);
- continue;
- }
- }
- else
- i = MIN(choice + 1, item_no - 1);
- }
-
- if (i != choice) {
- getyx(dialog, cur_y, cur_x);
- PaintCheckItem(menu, items[scrlx + choice], choice, FALSE, checks[scrlx + choice]);
-
- choice = i;
- PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wmove(dialog, cur_y, cur_x);
- wrefresh(dialog);
- continue;
- }
-
- switch (key) {
- case TAB:
- case KEY_LEFT:
- case KEY_RIGHT:
- if (!button) {
- button = 1;
- PaintButton(dialog, label1, y, x1, FALSE);
- PaintButton(dialog, label2, y, x2, TRUE);
- }
- else {
- button = 0;
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- }
- wrefresh(dialog);
- break;
- case ' ':
- getyx(dialog, cur_y, cur_x);
- checks[scrlx + choice] = !checks[scrlx + choice];
- PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
- wmove(dialog, cur_y, cur_x);
- wnoutrefresh(menu);
- wrefresh(dialog);
- break;
- case '\r':
- case '\n':
- delwin(dialog);
- return (!button ? 0 : -1);
- default:
- for (i = scrlx + choice + 1; i < item_no; i++)
- if (toupper(items[i][0]) == toupper(key))
- break;
- if (i == item_no) {
- for (i = 0; i < scrlx + choice; i++)
- if (toupper(items[i][0]) == toupper(key))
- break;
- }
- getyx(dialog, cur_y, cur_x);
- if (i < item_no && i != scrlx + choice) {
- if (i >= scrlx && i < scrlx + max_choice) {
- /* it is already visible */
- PaintCheckItem(menu, items[scrlx + choice], choice, FALSE, checks[scrlx + choice]);
- choice = i - scrlx;
- }
- else {
- scrlx = MIN(i, max_scroll);
- choice = i - scrlx;
- for (i = 0; i < max_choice; i++)
- if (i != choice)
- PaintCheckItem(menu, items[scrlx + i], i, FALSE, checks[scrlx + i]);
- }
- PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
- PaintScroller(menu, scrlx + choice, item_no, menu_height);
- wnoutrefresh(menu);
- wmove(dialog, cur_y, cur_x);
- wrefresh(dialog);
- }
- break;
- }
- }
- /*NOTREACHED*/
-}
-
-static void
-PaintCheckItem(WINDOW *win, char *item, int choice, int selected, int checked)
-{
- int i;
-
- wattrset(win, selected ? title_attr : dialog_attr);
- wmove(win, choice, 1);
- for (i = 1; i < menu_width; i++)
- waddch(win, ' ');
- wmove(win, choice, item_x);
- wattrset(win, selected ? title_attr : dialog_attr);
- wprintw(win, "[%c] ", checked ? 'X' : ' ');
- waddstr(win, item);
-}
-
-static char *
-DialogInput(char *title, char *prompt, int height, int width, char *init,
- char *label1, char *label2, int def_button)
-{
- int i, x, y, box_y, box_x, box_width, len,
- input_x = 0, scrlx = 0, key = 0, button = -1, x1, x2, l1len, l2len;
- char instr[1024 + 1];
- WINDOW *dialog;
-
- x = (COLS - width) / 2;
- y = (LINES - height) / 2;
-
- dialog = newwin(height, width, y, x);
- keypad(dialog, TRUE);
-
- PaintWindow(dialog, title, 0, 0, height, width);
-
- wattrset(dialog, dialog_attr);
- PrintWrap(dialog, prompt, width - 3, 2, 3);
-
- l1len = strlen(label1);
- l2len = strlen(label2);
-
- x1 = (width - (l1len + l2len)) / 3;
- x2 = x1 + x1 + l1len;
-
- box_width = width - 6;
- getyx(dialog, y, x);
- box_y = y + 2;
- box_x = (width - box_width) / 2;
- PaintBox(dialog, y + 1, box_x - 1, 3, box_width + 2);
-
- x = width / 2 - 11;
- y = height - 3;
- PaintButton(dialog, label2, y, x2, def_button == 1);
- PaintButton(dialog, label1, y, x1, def_button == 0);
-
- memset(instr, '\0', sizeof(instr));
- wmove(dialog, box_y, box_x);
- wattrset(dialog, dialog_attr);
- if (init)
- strncpy(instr, init, sizeof(instr) - 2);
-
- input_x = len = strlen(instr);
- if (input_x >= box_width) {
- scrlx = input_x - box_width + 1;
- input_x = box_width - 1;
- for (i = 0; i < box_width - 1; i++)
- waddch(dialog, instr[scrlx + i]);
- }
- else
- waddstr(dialog, instr);
-
- wmove(dialog, box_y, box_x + input_x);
-
- wrefresh(dialog);
-
- while (1) {
- key = wgetch(dialog);
- if (button == -1) { /* Input box selected */
- switch (key) {
- case TAB:
- case KEY_UP:
- case KEY_DOWN:
- break;
- case KEY_LEFT:
- if (scrlx && !input_x) {
- --scrlx;
- wmove(dialog, box_y, box_x);
- for (i = 0; i < box_width; i++)
- waddch(dialog, instr[scrlx + input_x + i] ? instr[scrlx + input_x + i] : ' ');
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- else if (input_x) {
- wmove(dialog, box_y, --input_x + box_x);
- wrefresh(dialog);
- }
- continue;
- case KEY_RIGHT:
- if (input_x + scrlx < len) {
- if (input_x == box_width - 1) {
- ++scrlx;
- wmove(dialog, box_y, box_x);
- for (i = scrlx; i < scrlx + box_width; i++)
- waddch(dialog, instr[i] ? instr[i] : ' ');
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- else {
- wmove(dialog, box_y, ++input_x + box_x);
- wrefresh(dialog);
- }
- }
- continue;
- case KEY_BACKSPACE:
- case 0177:
- if (input_x || scrlx) {
- wattrset(dialog, dialog_attr);
-
- if (scrlx + input_x < len)
- memmove(instr + scrlx + input_x - 1,
- instr + scrlx + input_x,
- len - (scrlx + input_x));
- instr[--len] = '\0';
-
- if (!input_x) {
- scrlx = scrlx < box_width - 1 ? 0 : scrlx - (box_width - 1);
- wmove(dialog, box_y, box_x);
- for (i = 0; i < box_width; i++)
- waddch(dialog, instr[scrlx + input_x + i] ? instr[scrlx + input_x + i] : ' ');
- input_x = len - scrlx;
- }
- else {
- wmove(dialog, box_y, --input_x + box_x);
- for (i = scrlx + input_x; i < len &&
- i < scrlx + box_width; i++)
- waddch(dialog, instr[i]);
- if (i < scrlx + box_width)
- waddch(dialog, ' ');
- }
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- continue;
- case KEY_HOME:
- case CONTROL_A:
- wmove(dialog, box_y, box_x);
- if (scrlx != 0) {
- scrlx = 0;
- for (i = 0; i < box_width; i++)
- waddch(dialog, instr[i] ? instr[i] : ' ');
- }
- input_x = 0;
- wmove(dialog, box_y, box_x);
- wrefresh(dialog);
- break;
- case CONTROL_D:
- if (input_x + scrlx < len) {
- memmove(instr + scrlx + input_x,
- instr + scrlx + input_x + 1,
- len - (scrlx + input_x));
- instr[--len] = '\0';
- for (i = scrlx + input_x; i < len &&
- i < scrlx + box_width; i++)
- waddch(dialog, instr[i]);
- if (i < scrlx + box_width)
- waddch(dialog, ' ');
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- break;
- case CONTROL_E:
- case KEY_END:
- if (box_width + scrlx < len) {
- input_x = box_width - 1;
- scrlx = len - box_width + 1;
- wmove(dialog, box_y, box_x);
- for (i = scrlx; i < scrlx + box_width; i++)
- waddch(dialog, instr[i] ? instr[i] : ' ');
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- else {
- input_x = len - scrlx;
- wmove(dialog, box_y, input_x + box_x);
- wrefresh(dialog);
- }
- break;
- case CONTROL_K:
- if (len) {
- for (i = input_x; i < box_width; i++)
- waddch(dialog, ' ');
- for (i = scrlx + input_x; i < len; i++)
- instr[i] = '\0';
- len = scrlx + input_x;
- wmove(dialog, box_y, box_x + input_x);
- wrefresh(dialog);
- }
- break;
- default:
- if (key < 0x100 && isprint(key)) {
- if (scrlx + input_x < sizeof(instr) - 1) {
- wattrset(dialog, dialog_attr);
- if (scrlx + input_x < len) {
- memmove(instr + scrlx + input_x + 1,
- instr + scrlx + input_x,
- len - (scrlx + input_x));
- }
- instr[scrlx + input_x] = key;
- instr[++len] = '\0';
- if (input_x == box_width - 1) {
- scrlx++;
- wmove(dialog, box_y, box_x);
- for (i = 0; i < box_width - 1; i++)
- waddch(dialog, instr[scrlx + i]);
- }
- else {
- wmove(dialog, box_y, input_x++ + box_x);
- for (i = scrlx + input_x - 1; i < len &&
- i < scrlx + box_width; i++)
- waddch(dialog, instr[i]);
- wmove(dialog, box_y, input_x + box_x);
- }
- wrefresh(dialog);
- }
- else
- flash(); /* Alarm user about overflow */
- continue;
- }
- }
- }
-
- switch (key) {
- case KEY_UP:
- case KEY_LEFT:
- switch (button) {
- case -1:
- button = 1; /* Indicates "Cancel" button is selected */
- PaintButton(dialog, label1, y, x1, FALSE);
- PaintButton(dialog, label2, y, x2, TRUE);
- wrefresh(dialog);
- break;
- case 0:
- button = -1; /* Indicates input box is selected */
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wmove(dialog, box_y, box_x + input_x);
- wrefresh(dialog);
- break;
- case 1:
- button = 0; /* Indicates "OK" button is selected */
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wrefresh(dialog);
- break;
- }
- break;
- case TAB:
- case KEY_DOWN:
- case KEY_RIGHT:
- switch (button) {
- case -1:
- button = 0; /* Indicates "OK" button is selected */
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wrefresh(dialog);
- break;
- case 0:
- button = 1; /* Indicates "Cancel" button is selected */
- PaintButton(dialog, label1, y, x1, FALSE);
- PaintButton(dialog, label2, y, x2, TRUE);
- wrefresh(dialog);
- break;
- case 1:
- button = -1; /* Indicates input box is selected */
- PaintButton(dialog, label2, y, x2, FALSE);
- PaintButton(dialog, label1, y, x1, TRUE);
- wmove(dialog, box_y, box_x + input_x);
- wrefresh(dialog);
- break;
- }
- break;
- case ' ':
- case '\r':
- case '\n':
- delwin(dialog);
- return (button != 1 ? XtNewString(instr) : NULL);
- }
- }
-}
diff --git a/hw/xfree86/utils/xorgcfg/up.xbm b/hw/xfree86/utils/xorgcfg/up.xbm
deleted file mode 100644
index 64f8f9ec4..000000000
--- a/hw/xfree86/utils/xorgcfg/up.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define up_width 19
-#define up_height 19
-static unsigned char up_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00, 0xe0, 0x3f, 0x00,
- 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01, 0x80, 0x0f, 0x00,
- 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00,
- 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/vidmode.c b/hw/xfree86/utils/xorgcfg/vidmode.c
deleted file mode 100644
index 3a51310d9..000000000
--- a/hw/xfree86/utils/xorgcfg/vidmode.c
+++ /dev/null
@@ -1,1347 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.c,v 1.8 2003/11/03 05:11:58 tsi Exp $
- */
-
-/*
- * Most of the code here is based on the xvidtune code.
- */
-
-#include "vidmode.h"
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/Repeater.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Dialog.h>
-#include <X11/Xaw/SimpleMenP.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/Toggle.h>
-#include "xf86config.h"
-
-#define V_FLAG_MASK 0x1FF
-#define V_PHSYNC 0x001
-#define V_NHSYNC 0x002
-#define V_PVSYNC 0x004
-#define V_NVSYNC 0x008
-#define V_INTERLACE 0x010
-#define V_DBLSCAN 0x020
-#define V_CSYNC 0x040
-#define V_PCSYNC 0x080
-#define V_NCSYNC 0x100
-
-#define LEFT 0
-#define RIGHT 1
-#define UP 2
-#define DOWN 3
-#define WIDER 4
-#define TALLER 5
-#define NARROWER 6
-#define SHORTER 7
-
-#define HDISPLAY 0
-#define VDISPLAY 1
-#define HSYNCSTART 2
-#define HSYNCEND 3
-#define HTOTAL 4
-#define VSYNCSTART 5
-#define VSYNCEND 6
-#define VTOTAL 7
-#define FLAGS 8
-#define CLOCK 9
-#define HSYNC 10
-#define VSYNC 11
-
-#define MINMAJOR 2
-#define MINMINOR 0
-
-/*
- * Types
- */
-typedef struct {
- char *ident;
- XF86VidModeModeInfo info;
-} xf86cfgVesaModeInfo;
-
-/*
- * Prototypes
- */
-static Bool GetModeLine(Bool);
-static void StartAdjustMonitorCallback(Widget, XtPointer, XtPointer);
-static void AdjustMonitorCallback(Widget, XtPointer, XtPointer);
-static void EndAdjustMonitorCallback(Widget, XtPointer, XtPointer);
-static void SetLabel(int, int);
-static void UpdateSyncRates(Bool);
-static int VidmodeError(Display*, XErrorEvent*);
-static void CleanUp(Display*);
-static void ApplyCallback(Widget, XtPointer, XtPointer);
-static void AutoCallback(Widget, XtPointer, XtPointer);
-static void RestoreCallback(Widget, XtPointer, XtPointer);
-static void SelectCallback(Widget, XtPointer, XtPointer);
-static void SelectMonitorCallback(Widget, XtPointer, XtPointer);
-static void SwitchCallback(Widget, XtPointer, XtPointer);
-static void SetLabels(void);
-static void UpdateCallback(Widget, XtPointer, XtPointer);
-static void ChangeScreenCallback(Widget, XtPointer, XtPointer);
-static void SetLabelAndModeline(void);
-static void AddVesaModeCallback(Widget, XtPointer, XtPointer);
-static void GetModes(void);
-static void AddModeCallback(Widget, XtPointer, XtPointer);
-static void TestCallback(Widget, XtPointer, XtPointer);
-static void TestTimeout(XtPointer, XtIntervalId*);
-static void StopTestCallback(Widget, XtPointer, XtPointer);
-static int ForceAddMode(void);
-static int AddMode(void);
-/*
- * Initialization
- */
-extern Widget work;
-Widget vtune;
-static Widget apply, automatic, restore, mode, menu, screenb, screenp;
-static Bool autoflag;
-static xf86cfgVidmode *vidtune;
-static XF86VidModeModeLine modeline, orig_modeline;
-static int dot_clock, hsync_rate, vsync_rate, hitError;
-static int screenno;
-static int (*XtErrorFunc)(Display*, XErrorEvent*);
-static Widget values[VSYNC + 1], repeater, monitor,
- monitorb, add, text, vesap, forceshell, testshell, addshell;
-static int MajorVersion, MinorVersion, EventBase, ErrorBase;
-static XtIntervalId timeout;
-
-/* The information bellow is extracted from
- * xc/programs/Xserver/hw/xfree86/etc/vesamodes
- * If that file is changed, please update the table bellow also. Or even
- * better, write a script to generate the table.
- */
-static xf86cfgVesaModeInfo vesamodes[] = {
- {
- "640x350 @ 85Hz (VESA) hsync: 37.9kHz",
- {
- 31500, 640, 672, 736, 832, 0, 350, 382, 385, 445,
- V_PHSYNC | V_NVSYNC
- }
- },
- {
- "640x400 @ 85Hz (VESA) hsync: 37.9kHz",
- {
- 31500, 640, 672, 736, 832, 0, 400, 401, 404, 445,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "720x400 @ 85Hz (VESA) hsync: 37.9kHz",
- {
- 35500, 720, 756, 828, 936, 0, 400, 401, 404, 446,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "640x480 @ 60Hz (Industry standard) hsync: 31.5kHz",
- {
- 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "640x480 @ 72Hz (VESA) hsync: 37.9kHz",
- {
- 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "640x480 @ 75Hz (VESA) hsync: 37.5kHz",
- {
- 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "640x480 @ 85Hz (VESA) hsync: 43.3kHz",
- {
- 36000, 640, 696, 752, 832, 0, 480, 481, 484, 509,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "800x600 @ 56Hz (VESA) hsync: 35.2kHz",
- {
- 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "800x600 @ 60Hz (VESA) hsync: 37.9kHz",
- {
- 400000, 800, 840, 968, 1056, 0, 600, 601, 605, 628,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "800x600 @ 72Hz (VESA) hsync: 48.1kHz",
- {
- 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "800x600 @ 75Hz (VESA) hsync: 46.9kHz",
- {
- 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "800x600 @ 85Hz (VESA) hsync: 53.7kHz",
- {
- 563000, 800, 832, 896, 1048, 0, 600, 601, 604, 631,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1024x768i @ 43Hz (industry standard) hsync: 35.5kHz",
- {
- 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817,
- V_PHSYNC | V_PVSYNC | V_INTERLACE
- }
- },
- {
- "1024x768 @ 60Hz (VESA) hsync: 48.4kHz",
- {
- 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "1024x768 @ 70Hz (VESA) hsync: 56.5kHz",
- {
- 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806,
- V_NHSYNC | V_NVSYNC
- }
- },
- {
- "1024x768 @ 75Hz (VESA) hsync: 60.0kHz",
- {
- 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1024x768 @ 85Hz (VESA) hsync: 68.7kHz",
- {
- 94500, 1024, 1072, 1168, 1376, 0, 768, 769, 772, 808,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1152x864 @ 75Hz (VESA) hsync: 67.5kHz",
- {
- 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1280x960 @ 60Hz (VESA) hsync: 60.0kHz",
- {
- 108000, 1280, 1376, 1488, 1800, 0, 960, 961, 964, 1000,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1280x960 @ 85Hz (VESA) hsync: 85.9kHz",
- {
- 148500, 1280, 1344, 1504, 1728, 0, 960, 961, 964, 1011,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1280x1024 @ 60Hz (VESA) hsync: 64.0kHz",
- {
- 108000, 1280, 1328, 1440, 1688, 0, 1024, 1025, 1028, 1066,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1280x1024 @ 75Hz (VESA) hsync: 80.0kHz",
- {
- 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1280x1024 @ 85Hz (VESA) hsync: 91.1kHz",
- {
- 157500, 1280, 1344, 1504, 1728, 0, 1024, 1025, 1028, 1072,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1600x1200 @ 60Hz (VESA) hsync: 75.0kHz",
- {
- 162000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1600x1200 @ 65Hz (VESA) hsync: 81.3kHz",
- {
- 175500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1600x1200 @ 70Hz (VESA) hsync: 87.5kHz",
- {
- 189000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1600x1200 @ 75Hz (VESA) hsync: 93.8kHz",
- {
- 202500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1600x1200 @ 85Hz (VESA) hsync: 106.3kHz",
- {
- 229500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
- V_PHSYNC | V_PVSYNC
- }
- },
- {
- "1792x1344 @ 60Hz (VESA) hsync: 83.6kHz",
- {
- 204800, 1792, 1920, 2120, 2448, 0, 1344, 1345, 1348, 1394,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "1792x1344 @ 75Hz (VESA) hsync: 106.3kHz",
- {
- 261000, 1792, 1888, 2104, 2456, 0, 1344, 1345, 1348, 1417,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "1856x1392 @ 60Hz (VESA) hsync: 86.3kHz",
- {
- 218300, 1856, 1952, 2176, 2528, 0, 1392, 1393, 1396, 1439,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "1856x1392 @ 75Hz (VESA) hsync: 112.5kHz",
- {
- 288000, 1856, 1984, 2208, 2560, 0, 1392, 1393, 1396, 1500,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "1920x1440 @ 60Hz (VESA) hsync: 90.0kHz",
- {
- 234000, 1920, 2048, 2256, 2600, 0, 1440, 1441, 1444, 1500,
- V_NHSYNC | V_PVSYNC
- }
- },
- {
- "1920x1440 @ 75Hz (VESA) hsync: 112.5kHz",
- {
- 297000, 1920, 2064, 2288, 2640, 0, 1440, 1441, 1444, 1500,
- V_NHSYNC | V_PVSYNC
- }
- },
-};
-
-/*
- * Implementation
- */
-Bool
-VideoModeInitialize(void)
-{
- Widget form;
- char dispstr[128], *ptr, *tmp;
-
- static char *names[] = {
- NULL,
- NULL,
- "hsyncstart",
- "hsyncend",
- "htotal",
- "vsyncstart",
- "vsyncend",
- "vtotal",
- "flags",
- "clock",
- "hsync",
- "vsync",
- };
- static char *vnames[] = {
- NULL,
- NULL,
- "v-hsyncstart",
- "v-hsyncend",
- "v-htotal",
- "v-vsyncstart",
- "v-vsyncend",
- "v-vtotal",
- "v-flags",
- "v-clock",
- "v-hsync",
- "v-vsync",
- };
- Widget rep;
- int i;
-
- if (!XF86VidModeQueryVersion(XtDisplay(toplevel),
- &MajorVersion, &MinorVersion)) {
- fprintf(stderr, "Unable to query video extension version\n");
- return (False);
- }
- else if (!XF86VidModeQueryExtension(XtDisplay(toplevel),
- &EventBase, &ErrorBase)) {
- fprintf(stderr, "Unable to query video extension information\n");
- return (False);
- }
- else if (MajorVersion < MINMAJOR ||
- (MajorVersion == MINMAJOR && MinorVersion < MINMINOR)) {
- fprintf(stderr,
- "Xserver is running an old XFree86-VidModeExtension version"
- " (%d.%d)\n", MajorVersion, MinorVersion);
- fprintf(stderr, "Minimum required version is %d.%d\n",
- MINMAJOR, MINMINOR);
- return (False);
- }
- else
- InitializeVidmodes();
-
- vtune = XtCreateWidget("vidtune", formWidgetClass,
- work, NULL, 0);
-
- (void) XtVaCreateManagedWidget("vesaB", menuButtonWidgetClass, vtune,
- XtNmenuName, "vesaP", NULL, 0);
- vesap = XtCreatePopupShell("vesaP", simpleMenuWidgetClass, vtune, NULL, 0);
- for (i = 0; i < sizeof(vesamodes) / sizeof(vesamodes[0]); i++) {
- rep = XtCreateManagedWidget(vesamodes[i].ident, smeBSBObjectClass,
- vesap, NULL, 0);
- XtAddCallback(rep, XtNcallback, AddVesaModeCallback,
- (XtPointer)&vesamodes[i]);
- }
-
- rep = XtCreateManagedWidget("prev", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(rep, XtNcallback, SwitchCallback, (XtPointer)-1);
- mode = XtCreateManagedWidget("mode", menuButtonWidgetClass, vtune, NULL, 0);
- rep = XtCreateManagedWidget("next", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(rep, XtNcallback, SwitchCallback, (XtPointer)1);
-
- screenp = XtCreatePopupShell("screenP", simpleMenuWidgetClass, vtune,
- NULL, 0);
-
- XmuSnprintf(dispstr, sizeof(dispstr), "%s",
- DisplayString(XtDisplay(toplevel)));
- ptr = strrchr(dispstr, '.');
- tmp = strrchr(dispstr, ':');
- if (tmp != NULL && ptr != NULL && ptr > tmp)
- *ptr = '\0';
-
- for (i = 0; i < ScreenCount(XtDisplay(toplevel)); i++) {
- char name[128];
-
- XmuSnprintf(name, sizeof(name), "%s.%d", dispstr, i);
- rep = XtCreateManagedWidget(name, smeBSBObjectClass, screenp,
- NULL, 0);
- XtAddCallback(rep, XtNcallback, ChangeScreenCallback,
- (XtPointer)(long)i);
- if (i == 0) {
- screenb = XtVaCreateManagedWidget("screenB", menuButtonWidgetClass,
- vtune,
- XtNmenuName, "screenP",
- XtNlabel, name,
- NULL, 0);
- }
- }
- XtRealizeWidget(screenp);
-
- rep = XtCreateManagedWidget("up", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)UP);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("left", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)LEFT);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- XtCreateManagedWidget("monitor", simpleWidgetClass, vtune, NULL, 0);
- rep = XtCreateManagedWidget("right", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)RIGHT);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("down", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)DOWN);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("wider", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)WIDER);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("narrower", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)NARROWER);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("shorter", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)SHORTER);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
- rep = XtCreateManagedWidget("taller", repeaterWidgetClass,
- vtune, NULL, 0);
- XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
- XtAddCallback(rep, XtNcallback,
- AdjustMonitorCallback, (XtPointer)TALLER);
- XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
-
- automatic = XtCreateManagedWidget("auto", toggleWidgetClass, vtune, NULL, 0);
- XtAddCallback(automatic, XtNcallback, AutoCallback, NULL);
- apply = XtCreateManagedWidget("apply", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(apply, XtNcallback, ApplyCallback, NULL);
- restore = XtCreateManagedWidget("restore", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(restore, XtNcallback, RestoreCallback, NULL);
- rep = XtCreateManagedWidget("update", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(rep, XtNcallback, UpdateCallback, NULL);
- rep = XtCreateManagedWidget("test", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(rep, XtNcallback, TestCallback, NULL);
-
- form = XtCreateManagedWidget("form", formWidgetClass, vtune, NULL, 0);
- for (i = 2; i < VSYNC + 1; i++) {
- (void) XtCreateManagedWidget(names[i], labelWidgetClass,
- form, NULL, 0);
- values[i] = XtCreateManagedWidget(vnames[i], labelWidgetClass,
- form, NULL, 0);
- }
-
- add = XtCreateManagedWidget("add", commandWidgetClass, vtune, NULL, 0);
- XtAddCallback(add, XtNcallback, AddModeCallback, NULL);
- XtCreateManagedWidget("addto", labelWidgetClass, vtune, NULL, 0);
- monitorb = XtCreateManagedWidget("ident", menuButtonWidgetClass, vtune,
- NULL, 0);
- XtCreateManagedWidget("as", labelWidgetClass, vtune, NULL, 0);
- text = XtVaCreateManagedWidget("text", asciiTextWidgetClass, vtune,
- XtNeditType, XawtextEdit, NULL, 0);
-
- XtRealizeWidget(vtune);
-
- return (True);
-}
-
-void
-InitializeVidmodes(void)
-{
- int i;
- Display *display = XtDisplay(toplevel);
-
- computer.num_vidmodes = ScreenCount(display);
- computer.vidmodes = (xf86cfgVidmode**)
- XtMalloc(sizeof(xf86cfgVidmode*) * computer.num_vidmodes);
- for (i = 0; i < computer.num_vidmodes; i++) {
-
- computer.vidmodes[i] = (xf86cfgVidmode*)
- XtCalloc(1, sizeof(xf86cfgVidmode));
- computer.vidmodes[i]->screen = i;
- }
-}
-
-void
-VideoModeConfigureStart(void)
-{
- vidtune = computer.vidmodes[screenno];
-
- XtSetSensitive(vtune, vidtune != NULL);
- if (!XtIsManaged(vtune))
- XtManageChild(vtune);
- else
- XtMapWidget(vtune);
- if (vidtune != NULL) {
- Arg args[1];
- Boolean state;
- XF86ConfMonitorPtr mon;
- static char menuName[16];
- static int menuN;
-
- XtErrorFunc = XSetErrorHandler(VidmodeError);
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
- GetModeLine(True);
- GetModes();
-
- SetLabels();
- XtSetArg(args[0], XtNstate, &state);
- XtGetValues(automatic, args, 1);
- XtSetSensitive(apply, !state);
- autoflag = state;
-
- if (monitor)
- XtDestroyWidget(monitor);
- XmuSnprintf(menuName, sizeof(menuName), "menuP%d", menuN);
- menuN = !menuN;
- monitor = XtCreatePopupShell(menuName, simpleMenuWidgetClass,
- vtune, NULL, 0);
- XtVaSetValues(monitorb, XtNmenuName, menuName, NULL, 0);
-
- mon = XF86Config->conf_monitor_lst;
- while (mon != NULL) {
- Widget sme = XtCreateManagedWidget(mon->mon_identifier,
- smeBSBObjectClass,
- monitor, NULL, 0);
- XtAddCallback(sme, XtNcallback,
- SelectMonitorCallback, (XtPointer)mon);
-
- /* guess the monitor at a given screen and/or
- * updates configuration if a monitor was removed from the
- * configuration.
- */
- if (XF86Config->conf_layout_lst) {
- XF86ConfAdjacencyPtr adj = XF86Config->conf_layout_lst->
- lay_adjacency_lst;
-
- while (adj != NULL) {
- if (adj->adj_screen != NULL) {
- if (adj->adj_screen->scrn_monitor == mon &&
- adj->adj_scrnum >= 0 &&
- adj->adj_scrnum < ScreenCount(XtDisplay(toplevel))) {
- if (computer.vidmodes[adj->adj_scrnum]->monitor ==
- NULL || computer.vidmodes[adj->adj_scrnum]->
- monitor == adj->adj_screen->scrn_monitor) {
- computer.vidmodes[adj->adj_scrnum]->monitor =
- adj->adj_screen->scrn_monitor;
- break;
- }
- else
- computer.vidmodes[adj->adj_scrnum]->monitor =
- NULL;
- }
- }
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- }
- mon = (XF86ConfMonitorPtr)(mon->list.next);
- }
- SetLabelAndModeline();
- }
-}
-
-void
-VideoModeConfigureEnd(void)
-{
- XtUnmapWidget(vtune);
- if (vidtune != NULL) {
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
- XSetErrorHandler(XtErrorFunc);
- }
- vidtune = NULL;
-}
-
-static void
-SetLabelAndModeline(void)
-{
- if (vidtune->monitor != NULL) {
- char string[32];
-
- XtVaSetValues(monitorb, XtNlabel,
- vidtune->monitor->mon_identifier, NULL);
- XtSetSensitive(add, True);
-
- if (modeline.htotal && modeline.vtotal)
- XmuSnprintf(string, sizeof(string), "%dx%d@%d",
- modeline.hdisplay, modeline.vdisplay,
- (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
- (double)modeline.vtotal));
- else
- XmuSnprintf(string, sizeof(string), "%dx%d",
- modeline.hdisplay, modeline.vdisplay);
- XtVaSetValues(text, XtNstring, string, NULL);
- }
- else {
- XtVaSetValues(monitorb, XtNlabel, "", NULL);
- XtSetSensitive(add, False);
- XtVaSetValues(text, XtNstring, "", NULL);
- }
-}
-
-/*ARGSUSED*/
-void
-VidmodeRestoreAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- if (vidtune != NULL) {
- if (timeout != 0)
- StopTestCallback(w, NULL, NULL);
- else
- RestoreCallback(w, NULL, NULL);
- }
-}
-
-static void
-UpdateSyncRates(Bool update)
-{
- if (modeline.htotal && modeline.vtotal) {
- hsync_rate = (dot_clock * 1000) / modeline.htotal;
- vsync_rate = (hsync_rate * 1000) / modeline.vtotal;
- if (modeline.flags & V_INTERLACE)
- vsync_rate *= 2;
- else if (modeline.flags & V_DBLSCAN)
- vsync_rate /= 2;
- if (update) {
- SetLabel(HSYNC, hsync_rate);
- SetLabel(VSYNC, vsync_rate);
- }
- }
-}
-
-static void
-SetLabel(int ident, int value)
-{
- Arg args[1];
- char label[256];
-
- if (ident == FLAGS) {
- int len = 0;
-
- *label = '\0';
- if (value & V_PHSYNC)
- len += XmuSnprintf(label, sizeof(label), "%s", "+hsync");
- if (modeline.flags & V_NHSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "-hsync");
- if (value & V_PVSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "+vsync");
- if (value & V_NVSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "-vsync");
- if (value & V_INTERLACE)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "interlace");
- if (value & V_CSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "composite");
- if (value & V_PCSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "+csync");
- if (value & V_NCSYNC)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "-csync");
- if (value & V_DBLSCAN)
- len += XmuSnprintf(label + len, sizeof(label), "%s%s",
- len ? " " : "", "doublescan");
-
- }
- else if (ident == CLOCK || ident == HSYNC || ident == VSYNC)
- XmuSnprintf(label, sizeof(label), "%6.2f", (float)value / 1000.0);
- else
- XmuSnprintf(label, sizeof(label), "%d", value);
-
- XtSetArg(args[0], XtNlabel, label);
- XtSetValues(values[ident], args, 1);
-}
-
-/*ARGSUSED*/
-static void
-StartAdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
-{
- repeater = w;
-}
-
-static void
-AdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
-{
- if (repeater != w)
- return;
- switch ((long)client_data) {
- case LEFT:
- if (modeline.hsyncend + 4 < modeline.htotal) {
- modeline.hsyncstart += 4;
- modeline.hsyncend += 4;
- SetLabel(HSYNCSTART, modeline.hsyncstart);
- SetLabel(HSYNCEND, modeline.hsyncend);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- case RIGHT:
- if (modeline.hsyncstart - 4 > modeline.hdisplay) {
- modeline.hsyncstart -= 4;
- modeline.hsyncend -= 4;
- SetLabel(HSYNCSTART, modeline.hsyncstart);
- SetLabel(HSYNCEND, modeline.hsyncend);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- case NARROWER:
- modeline.htotal += 4;
- SetLabel(HTOTAL, modeline.htotal);
- UpdateSyncRates(True);
- break;
- case WIDER:
- if (modeline.htotal - 4 > modeline.hsyncend) {
- modeline.htotal -= 4;
- SetLabel(HTOTAL, modeline.htotal);
- UpdateSyncRates(True);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- case UP:
- if (modeline.vsyncend + 4 < modeline.vtotal) {
- modeline.vsyncstart += 4;
- modeline.vsyncend += 4;
- SetLabel(VSYNCSTART, modeline.vsyncstart);
- SetLabel(VSYNCEND, modeline.vsyncend);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- case DOWN:
- if (modeline.vsyncstart - 4 > modeline.vdisplay) {
- modeline.vsyncstart -= 4;
- modeline.vsyncend -= 4;
- SetLabel(VSYNCSTART, modeline.vsyncstart);
- SetLabel(VSYNCEND, modeline.vsyncend);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- case SHORTER:
- modeline.vtotal += 4;
- SetLabel(VTOTAL, modeline.vtotal);
- UpdateSyncRates(True);
- break;
- case TALLER:
- if (modeline.vtotal - 4 > modeline.vsyncend) {
- modeline.vtotal -= 4;
- SetLabel(VTOTAL, modeline.vtotal);
- UpdateSyncRates(True);
- }
- else
- XBell(XtDisplay(w), 80);
- break;
- }
-
- if (autoflag)
- ApplyCallback(w, call_data, client_data);
-}
-
-/*ARGSUSED*/
-static void
-EndAdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
-{
- repeater = NULL;
-}
-
-static Bool
-GetModeLine(Bool save)
-{
- if (XF86VidModeGetModeLine(XtDisplay(toplevel), vidtune->screen,
- &dot_clock, &modeline)) {
- if (save)
- memcpy(&orig_modeline, &modeline, sizeof(XF86VidModeModeLine));
- UpdateSyncRates(False);
- return (True);
- }
-
- return (False);
-}
-
-static void
-CleanUp(Display *display)
-{
- /* Make sure mode switching is not locked out at exit */
- XF86VidModeLockModeSwitch(display, vidtune->screen, False);
- XFlush(display);
-}
-
-static int
-VidmodeError(Display *display, XErrorEvent *error)
-{
- if ((error->error_code >= ErrorBase &&
- error->error_code < ErrorBase + XF86VidModeNumberErrors) ||
- error->error_code == BadValue) {
- hitError = 1;
- }
- else {
- CleanUp(display);
- if (XtErrorFunc)
- (*XtErrorFunc)(display, error);
- }
- return (0);
-}
-
-/*ARGSUSED*/
-static void
-ApplyCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- hitError = 0;
- XF86VidModeModModeLine(XtDisplay(w), vidtune->screen, &modeline);
- XSync(XtDisplay(w), False);
- if (hitError) {
- if (repeater != NULL) {
- XtCallActionProc(repeater, "unset", NULL, NULL, 0);
- XtCallActionProc(repeater, "stop", NULL, NULL, 0);
- repeater = NULL;
- }
- XBell(XtDisplay(w), 80);
- if (timeout)
- StopTestCallback(w, NULL, NULL);
- GetModeLine(False);
- SetLabels();
- }
-}
-
-/*ARGSUSED*/
-static void
-AutoCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- autoflag = (Bool)(long)client_data;
- XtSetSensitive(apply, !autoflag);
-}
-
-static void
-RestoreCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
- if (autoflag)
- ApplyCallback(w, call_data, client_data);
- SetLabels();
-}
-
-static void
-SelectCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- XF86VidModeModeInfo *info = (XF86VidModeModeInfo*)call_data;
- Arg args[1];
- Bool result;
-
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
- result = XF86VidModeSwitchToMode(XtDisplay(toplevel), vidtune->screen, info);
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
- if (!result)
- return;
-
- XtSetArg(args[0], XtNlabel, XtName(w));
- XtSetValues(mode, args, 1);
- UpdateCallback(w, call_data, client_data);
-}
-
-static void
-SwitchCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- int direction = (long)call_data;
- Arg args[1];
- Bool result;
- char label[32];
-
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
- result = XF86VidModeSwitchMode(XtDisplay(toplevel), vidtune->screen,
- direction);
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
- if (!result)
- return;
-
- UpdateCallback(w, call_data, client_data);
-
- if (modeline.htotal && modeline.vtotal)
- XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
- modeline.hdisplay, modeline.vdisplay,
- (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
- (double)modeline.vtotal));
- else
- XmuSnprintf(label, sizeof(label), "%dx%d",
- modeline.hdisplay, modeline.vdisplay);
- XtSetArg(args[0], XtNlabel, label);
- XtSetValues(mode, args, 1);
-}
-
-/*ARGSUSED*/
-static void
-UpdateCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- GetModeLine(True);
- SetLabels();
- SetLabelAndModeline();
-}
-
-static void
-SetLabels(void)
-{
- SetLabel(HSYNCSTART, modeline.hsyncstart);
- SetLabel(VSYNCSTART, modeline.vsyncstart);
- SetLabel(HSYNCEND, modeline.hsyncend);
- SetLabel(VSYNCEND, modeline.vsyncend);
- SetLabel(HTOTAL, modeline.htotal);
- SetLabel(VTOTAL, modeline.vtotal);
- SetLabel(FLAGS, modeline.flags);
- SetLabel(CLOCK, dot_clock);
- UpdateSyncRates(True);
-}
-
-/*ARGSUSED*/
-static void
-ChangeScreenCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- Arg args[1];
-
- screenno = (long)call_data;
- if (screenno > computer.num_vidmodes || screenno < 0 ||
- vidtune == computer.vidmodes[screenno])
- return;
-
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
- vidtune = computer.vidmodes[screenno];
- XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
- UpdateCallback(w, call_data, client_data);
- GetModes();
-
- XtSetArg(args[0], XtNlabel, XtName(w));
- XtSetValues(screenb, args, 1);
-
- SetLabelAndModeline();
-}
-
-/*ARGSUSED*/
-static void
-SelectMonitorCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- vidtune->monitor = (XF86ConfMonitorPtr)(call_data);
- SetLabelAndModeline();
-}
-
-/*ARGSUSED*/
-static void
-AddVesaModeCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- xf86cfgVesaModeInfo *vesa = (xf86cfgVesaModeInfo*)call_data;
- XF86VidModeModeInfo mode;
- int num_infos = vidtune->num_infos;
-
- memcpy(&mode, &vesa->info, sizeof(XF86VidModeModeInfo));
- if (XF86VidModeAddModeLine(XtDisplay(toplevel), vidtune->screen,
- &vesa->info, &mode)) {
- XSync(XtDisplay(toplevel), False);
- GetModes();
- }
- else {
- XBell(XtDisplayOfObject(w), 80);
- return;
- }
-
- if (vidtune && num_infos == vidtune->num_infos) {
- /* XF86VidModeAddModeLine returned True, but no modeline was added */
- XBell(XtDisplayOfObject(w), 80);
- if (vidtune->monitor && AddMode()) {
- XF86ConfModeLinePtr mode;
- char label[256], *ptr, *str;
-
- XmuSnprintf(label, sizeof(label), "%s", vesa->ident);
-
- /* format mode name to not have spaces */
- ptr = strchr(label, ')');
- if (ptr)
- *++ptr = '\0';
- ptr = str = label;
- while (*ptr) {
- if (*ptr != ' ')
- *str++ = *ptr;
- ++ptr;
- }
- *str = '\0';
-
- if (xf86findModeLine(label, vidtune->monitor->mon_modeline_lst)
- != NULL && !ForceAddMode())
- return;
-
- mode = (XF86ConfModeLinePtr)XtCalloc(1, sizeof(XF86ConfModeLineRec));
- mode->ml_identifier = XtNewString(label);
- mode->ml_clock = vesa->info.dotclock;
- mode->ml_hdisplay = vesa->info.hdisplay;
- mode->ml_hsyncstart = vesa->info.hsyncstart;
- mode->ml_hsyncend = vesa->info.hsyncend;
- mode->ml_htotal = vesa->info.htotal;
- mode->ml_vdisplay = vesa->info.vdisplay;
- mode->ml_vsyncstart = vesa->info.vsyncstart;
- mode->ml_vsyncend = vesa->info.vsyncend;
- mode->ml_vtotal = vesa->info.vtotal;
-/* mode->ml_vscan = ???;*/
- mode->ml_flags = vesa->info.flags;
- mode->ml_hskew = vesa->info.hskew;
- vidtune->monitor->mon_modeline_lst =
- xf86addModeLine(vidtune->monitor->mon_modeline_lst, mode);
- }
- }
-}
-
-static void
-GetModes(void)
-{
- int i;
- char label[32];
- Arg args[1];
- static char menuName[16];
- static int menuN;
-
- XFree(vidtune->infos);
- XF86VidModeGetAllModeLines(XtDisplay(toplevel), vidtune->screen,
- &vidtune->num_infos, &vidtune->infos);
-
- XmuSnprintf(menuName, sizeof(menuName), "menu%d", menuN);
- menuN = !menuN;
- if (menu)
- XtDestroyWidget(menu);
- menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, vtune, NULL, 0);
- XtVaSetValues(mode, XtNmenuName, menuName, NULL, 0);
- for (i = 0; i < vidtune->num_infos; i++) {
- Widget sme;
-
- if ((double)vidtune->infos[i]->htotal &&
- (double)vidtune->infos[i]->vtotal)
- XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
- vidtune->infos[i]->hdisplay,
- vidtune->infos[i]->vdisplay,
- (int)((double)vidtune->infos[i]->dotclock /
- (double)vidtune->infos[i]->htotal * 1000.0 /
- (double)vidtune->infos[i]->vtotal));
- else
- XmuSnprintf(label, sizeof(label), "%dx%d",
- vidtune->infos[i]->hdisplay,
- vidtune->infos[i]->vdisplay);
- sme = XtCreateManagedWidget(label, smeBSBObjectClass, menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, SelectCallback,
- (XtPointer)vidtune->infos[i]);
- }
-
- if (modeline.htotal && modeline.vtotal)
- XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
- modeline.hdisplay, modeline.vdisplay,
- (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
- (double)modeline.vtotal));
- else
- XmuSnprintf(label, sizeof(label), "%dx%d",
- modeline.hdisplay, modeline.vdisplay);
- XtSetArg(args[0], XtNlabel, label);
- XtSetValues(mode, args, 1);
-}
-
-static int do_force, asking_force;
-
-static void
-PopdownForce(Widget w, XtPointer user_data, XtPointer call_data)
-{
- asking_force = 0;
- XtPopdown(forceshell);
- do_force = (long)user_data;
-}
-
-static int
-ForceAddMode(void)
-{
- if (forceshell == NULL) {
- Widget dialog;
-
- forceshell = XtCreatePopupShell("force", transientShellWidgetClass,
- toplevel, NULL, 0);
- dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
- forceshell, XtNvalue, NULL, NULL, 0);
- XawDialogAddButton(dialog, "yes", PopdownForce, (XtPointer)True);
- XawDialogAddButton(dialog, "no", PopdownForce, (XtPointer)False);
- XtRealizeWidget(forceshell);
- XSetWMProtocols(DPY, XtWindow(forceshell), &wm_delete_window, 1);
- }
-
- asking_force = 1;
-
- XtPopup(forceshell, XtGrabExclusive);
- while (asking_force)
- XtAppProcessEvent(XtWidgetToApplicationContext(forceshell), XtIMAll);
-
- return (do_force);
-}
-
-static int do_add, asking_add;
-
-static void
-PopdownAdd(Widget w, XtPointer user_data, XtPointer call_data)
-{
- asking_add = 0;
- XtPopdown(addshell);
- do_add = (long)user_data;
-}
-
-void
-CancelAddModeAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- if (asking_force)
- PopdownForce(w, (XtPointer)False, NULL);
- else if (asking_add)
- PopdownAdd(w, (XtPointer)False, NULL);
-}
-
-static int
-AddMode(void)
-{
- if (addshell == NULL) {
- Widget dialog;
-
- addshell = XtCreatePopupShell("addMode", transientShellWidgetClass,
- toplevel, NULL, 0);
- dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
- addshell, XtNvalue, NULL, NULL, 0);
- XawDialogAddButton(dialog, "yes", PopdownAdd, (XtPointer)True);
- XawDialogAddButton(dialog, "no", PopdownAdd, (XtPointer)False);
- XtRealizeWidget(addshell);
- XSetWMProtocols(DPY, XtWindow(addshell), &wm_delete_window, 1);
- }
-
- asking_add = 1;
-
- XtPopup(addshell, XtGrabExclusive);
- while (asking_add)
- XtAppProcessEvent(XtWidgetToApplicationContext(addshell), XtIMAll);
-
- return (do_add);
-}
-
-/*ARGSUSED*/
-static void
-AddModeCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- if (vidtune && vidtune->monitor) {
- char *label;
- Arg args[1];
- XF86ConfModeLinePtr mode;
-
- XtSetArg(args[0], XtNstring, &label);
- XtGetValues(text, args, 1);
- if (*label == '\0') {
- XBell(XtDisplay(w), 80);
- return;
- }
- if (xf86findModeLine(label, vidtune->monitor->mon_modeline_lst)
- != NULL && !ForceAddMode())
- return;
-
- mode = (XF86ConfModeLinePtr)XtCalloc(1, sizeof(XF86ConfModeLineRec));
- mode->ml_identifier = XtNewString(label);
- mode->ml_clock = dot_clock;
- mode->ml_hdisplay = modeline.hdisplay;
- mode->ml_hsyncstart = modeline.hsyncstart;
- mode->ml_hsyncend = modeline.hsyncend;
- mode->ml_htotal = modeline.htotal;
- mode->ml_vdisplay = modeline.vdisplay;
- mode->ml_vsyncstart = modeline.vsyncstart;
- mode->ml_vsyncend = modeline.vsyncend;
- mode->ml_vtotal = modeline.vtotal;
-/* mode->ml_vscan = ???;*/
- mode->ml_flags = modeline.flags;
- mode->ml_hskew = modeline.hskew;
- vidtune->monitor->mon_modeline_lst =
- xf86addModeLine(vidtune->monitor->mon_modeline_lst, mode);
- }
- else
- XBell(XtDisplay(w), 80);
-}
-
-/*ARGSUSED*/
-static void
-StopTestCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- XtRemoveTimeOut(timeout);
- TestTimeout((XtPointer)w, NULL);
-}
-
-/*ARGSUSED*/
-void
-CancelTestModeAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
-{
- StopTestCallback(w, NULL, NULL);
-}
-
-static void
-TestTimeout(XtPointer client_data, XtIntervalId* id)
-{
- XF86VidModeModeLine mode;
-
- XtPopdown(testshell);
- timeout = 0;
- memcpy(&mode, &modeline, sizeof(XF86VidModeModeLine));
- memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
- ApplyCallback((Widget)client_data, NULL, NULL);
-/* if (hitError == 0)*/
- memcpy(&modeline, &mode, sizeof(XF86VidModeModeLine));
- SetLabels();
-}
-
-static void
-TestCallback(Widget w, XtPointer call_data, XtPointer client_data)
-{
- if (testshell == NULL) {
- Widget dialog;
-
- testshell = XtCreatePopupShell("test", transientShellWidgetClass,
- toplevel, NULL, 0);
- dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
- testshell, XtNvalue, NULL, NULL, 0);
- XawDialogAddButton(dialog, "stop", StopTestCallback, NULL);
- XtRealizeWidget(testshell);
- XSetWMProtocols(DPY, XtWindow(testshell), &wm_delete_window, 1);
- }
-
- XtPopup(testshell, XtGrabExclusive);
-
- XSync(XtDisplay(toplevel), False);
- timeout = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
- /* the timeout probably shoud be converted to a resource */
- 4000, TestTimeout, (XtPointer)w);
- ApplyCallback(w, call_data, client_data);
-}
diff --git a/hw/xfree86/utils/xorgcfg/vidmode.h b/hw/xfree86/utils/xorgcfg/vidmode.h
deleted file mode 100644
index e445517cd..000000000
--- a/hw/xfree86/utils/xorgcfg/vidmode.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.h,v 1.3 2001/07/07 23:00:43 paulo Exp $
- */
-
-#ifndef _xf86cfg_vidmode_h
-#define _xf86cfg_vidmode_h
-
-#include "xf86config.h"
-#include <X11/extensions/xf86vmode.h>
-
-/*
- * Types
- */
-struct _xf86cfgVidMode {
- XF86ConfMonitorPtr monitor;
- int screen;
- int num_infos;
- XF86VidModeModeInfo **infos;
-};
-
-/*
- * Prototypes
- */
-Bool VideoModeInitialize(void);
-void VideoModeConfigureStart(void);
-void VideoModeConfigureEnd(void);
-void VidmodeRestoreAction(Widget, XEvent*, String*, Cardinal*);
-void CancelAddModeAction(Widget, XEvent*, String*, Cardinal*);
-void CancelTestModeAction(Widget, XEvent*, String*, Cardinal*);
-void InitializeVidmodes(void);
-
-/*
- * Initialization
- */
-extern Widget vtune;
-
-#endif /* _xf86cfg_vidmode_h */
diff --git a/hw/xfree86/utils/xorgcfg/wider.xbm b/hw/xfree86/utils/xorgcfg/wider.xbm
deleted file mode 100644
index 5cf87f25a..000000000
--- a/hw/xfree86/utils/xorgcfg/wider.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define wider_width 19
-#define wider_height 19
-static unsigned char wider_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0xc0, 0x18, 0x00,
- 0xe0, 0x38, 0x00, 0xf0, 0x78, 0x00, 0xf8, 0xf8, 0x00, 0xfc, 0xff, 0x01,
- 0xfe, 0xff, 0x03, 0xff, 0xff, 0x07, 0xfe, 0xff, 0x03, 0xfc, 0xff, 0x01,
- 0xf8, 0xf8, 0x00, 0xf0, 0x78, 0x00, 0xe0, 0x38, 0x00, 0xc0, 0x18, 0x00,
- 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/xf86config.c b/hw/xfree86/utils/xorgcfg/xf86config.c
deleted file mode 100644
index cb4054a5e..000000000
--- a/hw/xfree86/utils/xorgcfg/xf86config.c
+++ /dev/null
@@ -1,983 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.c,v 1.6 2003/11/03 05:11:59 tsi Exp $
- */
-
-#include "xf86config.h"
-
-/*
- * Implementation
- */
-int
-xf86removeOption(XF86OptionPtr *options, char *name)
-{
- XF86OptionPtr opt = *options, prev = opt;
-
- while (opt) {
- if (strcasecmp(opt->opt_name, name) == 0) {
- XtFree(opt->opt_name);
- XtFree(opt->opt_val);
- XtFree(opt->opt_comment);
- if (opt == prev)
- *options = (XF86OptionPtr)(opt->list.next);
- else
- prev->list.next = opt->list.next;
- XtFree((XtPointer)opt);
-
- return (True);
- }
-
- prev = opt;
- opt = (XF86OptionPtr)(opt->list.next);
- }
-
- return (False);
-}
-
-int
-xf86removeInput(XF86ConfigPtr config, XF86ConfInputPtr input)
-{
- XF86ConfInputPtr prev, inp = config->conf_input_lst;
- XF86ConfLayoutPtr lay = config->conf_layout_lst;
-
- /* remove from main structure */
- prev = inp;
- while (inp != NULL) {
- if (inp == input) {
- if (inp == prev)
- config->conf_input_lst = (XF86ConfInputPtr)(inp->list.next);
- else
- prev->list.next = inp->list.next;
- break;
- }
- prev = inp;
- inp = (XF86ConfInputPtr)(inp->list.next);
- }
-
- if (inp == NULL)
- return (False);
-
- /* remove references */
- while (lay != NULL) {
- xf86removeInputRef(lay, inp);
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- XtFree(inp->inp_identifier);
- XtFree(inp->inp_driver);
- XtFree(inp->inp_comment);
- xf86optionListFree(inp->inp_option_lst);
- XtFree((XtPointer)inp);
-
- return (True);
-}
-
-int
-xf86removeInputRef(XF86ConfLayoutPtr layout, XF86ConfInputPtr input)
-{
- XF86ConfInputrefPtr prev, iref = layout->lay_input_lst;
-
- prev = iref;
- while (iref != NULL) {
- if (iref->iref_inputdev == input) {
- XtFree(iref->iref_inputdev_str);
- xf86optionListFree(iref->iref_option_lst);
- if (prev == iref)
- layout->lay_input_lst =
- (XF86ConfInputrefPtr)(iref->list.next);
- else
- prev->list.next = iref->list.next;
- XtFree((XtPointer)iref);
-
- return (True);
- }
- prev = iref;
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
-
- return (False);
-}
-
-int
-xf86removeDevice(XF86ConfigPtr config, XF86ConfDevicePtr device)
-{
- XF86ConfDevicePtr prev, dev = config->conf_device_lst;
- XF86ConfScreenPtr psc, scr = config->conf_screen_lst;
-
- /* remove from main structure */
- prev = dev;
- while (dev != NULL) {
- if (dev == device) {
- if (dev == prev)
- config->conf_device_lst = (XF86ConfDevicePtr)(dev->list.next);
- else
- prev->list.next = dev->list.next;
- break;
- }
- prev = dev;
- dev = (XF86ConfDevicePtr)(dev->list.next);
- }
-
- if (dev == NULL)
- return (False);
-
- /* remove references */
- psc = scr;
- while (scr != NULL) {
- if (scr->scrn_device == device) {
- xf86removeScreen(config, scr);
- if (scr == psc)
- scr = psc = config->conf_screen_lst;
- else
- scr = psc;
- continue;
- }
- psc = scr;
- scr = (XF86ConfScreenPtr)(scr->list.next);
- }
-
- XtFree(dev->dev_identifier);
- XtFree(dev->dev_vendor);
- XtFree(dev->dev_board);
- XtFree(dev->dev_chipset);
- XtFree(dev->dev_busid);
- XtFree(dev->dev_card);
- XtFree(dev->dev_driver);
- XtFree(dev->dev_ramdac);
- XtFree(dev->dev_clockchip);
- XtFree(dev->dev_comment);
- xf86optionListFree(dev->dev_option_lst);
- XtFree((XtPointer)dev);
-
- return (True);
-}
-
-int
-xf86removeMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr monitor)
-{
- XF86ConfMonitorPtr prev, mon = config->conf_monitor_lst;
- XF86ConfScreenPtr psc, scr = config->conf_screen_lst;
-
- /* remove from main structure */
- prev = mon;
- while (mon != NULL) {
- if (mon == monitor) {
- if (mon == prev)
- config->conf_monitor_lst = (XF86ConfMonitorPtr)(mon->list.next);
- else
- prev->list.next = mon->list.next;
- break;
- }
- prev = mon;
- mon = (XF86ConfMonitorPtr)(mon->list.next);
- }
-
- if (mon == NULL)
- return (False);
-
- /* remove references */
- psc = scr;
- while (scr != NULL) {
- if (scr->scrn_monitor == monitor) {
- xf86removeScreen(config, scr);
- if (scr == psc)
- scr = psc = config->conf_screen_lst;
- else
- scr = psc;
- continue;
- }
- psc = scr;
- scr = (XF86ConfScreenPtr)(scr->list.next);
- }
-
- XtFree(mon->mon_identifier);
- XtFree(mon->mon_vendor);
- XtFree(mon->mon_modelname);
- XtFree(mon->mon_comment);
- xf86optionListFree(mon->mon_option_lst);
- XtFree((XtPointer)mon);
-
- return (True);
-}
-
-int
-xf86removeScreen(XF86ConfigPtr config, XF86ConfScreenPtr screen)
-{
- XF86ConfScreenPtr prev, scrn;
- XF86ConfLayoutPtr lay;
-
- if (config == NULL || screen == NULL)
- return (False);
-
- lay = config->conf_layout_lst;
- prev = scrn = config->conf_screen_lst;
-
- while (scrn != NULL) {
- if (scrn == screen) {
- if (scrn == prev)
- config->conf_screen_lst = (XF86ConfScreenPtr)(scrn->list.next);
- else
- prev->list.next = scrn->list.next;
- break;
- }
- prev = scrn;
- scrn = (XF86ConfScreenPtr)(scrn->list.next);
- }
-
- if (scrn == NULL)
- return (False);
-
- while (lay != NULL) {
- XF86ConfAdjacencyPtr pad, ad = NULL, adj = lay->lay_adjacency_lst;
-
- pad = adj;
- while (adj) {
- if (adj->adj_screen == screen)
- ad = adj;
- else {
- if (adj->adj_top != NULL && adj->adj_top == screen) {
- XtFree(adj->adj_top_str);
- adj->adj_top_str = NULL;
- adj->adj_top = NULL;
- }
- else if (adj->adj_bottom != NULL && adj->adj_bottom == screen) {
- XtFree(adj->adj_bottom_str);
- adj->adj_bottom_str = NULL;
- adj->adj_bottom = NULL;
- }
- else if (adj->adj_left != NULL && adj->adj_left == screen) {
- XtFree(adj->adj_left_str);
- adj->adj_left_str = NULL;
- adj->adj_left = NULL;
- }
- else if (adj->adj_right != NULL && adj->adj_right == screen) {
- XtFree(adj->adj_right_str);
- adj->adj_right_str = NULL;
- adj->adj_right = NULL;
- }
- else if (adj->adj_refscreen != NULL &&
- strcasecmp(scrn->scrn_identifier,
- adj->adj_refscreen) == 0) {
- XtFree(adj->adj_refscreen);
- adj->adj_refscreen = NULL;
- adj->adj_where = CONF_ADJ_ABSOLUTE;
- adj->adj_x = adj->adj_y = 0;
- }
- }
- if (ad == NULL)
- pad = adj;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
-
- if (ad != NULL) {
- if (ad == lay->lay_adjacency_lst)
- lay->lay_adjacency_lst = (XF86ConfAdjacencyPtr)(ad->list.next);
- else
- pad->list.next = (XF86ConfAdjacencyPtr)(ad->list.next);
- XtFree(ad->adj_screen_str);
- XtFree(ad->adj_top_str);
- XtFree(ad->adj_bottom_str);
- XtFree(ad->adj_left_str);
- XtFree(ad->adj_right_str);
- XtFree(ad->adj_refscreen);
- XtFree((XtPointer)ad);
- }
-
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- xf86freeAdaptorLinkList(screen->scrn_adaptor_lst);
- xf86freeDisplayList(screen->scrn_display_lst);
-
- XtFree(screen->scrn_identifier);
- XtFree(screen->scrn_monitor_str);
- XtFree(screen->scrn_device_str);
- xf86optionListFree(screen->scrn_option_lst);
- XtFree((XtPointer)screen);
-
- return (True);
-}
-
-int
-xf86removeAdjacency(XF86ConfLayoutPtr layout, XF86ConfAdjacencyPtr adjacency)
-{
- XF86ConfAdjacencyPtr prev, adj = layout->lay_adjacency_lst;
-
- if (layout == NULL || adjacency == NULL)
- return (False);
-
- prev = adj;
- while (adj != NULL) {
- if (adj == adjacency)
- break;
- prev = adj;
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- if (adj == NULL)
- return (False);
-
- XtFree(adj->adj_screen_str);
- XtFree(adj->adj_top_str);
- XtFree(adj->adj_bottom_str);
- XtFree(adj->adj_left_str);
- XtFree(adj->adj_right_str);
- XtFree(adj->adj_refscreen);
- if (prev == adj)
- layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)(adj->list.next);
- else
- prev->list.next = adj->list.next;
- XtFree((XtPointer)adj);
-
- return (True);
-}
-
-int
-xf86removeInactive(XF86ConfLayoutPtr layout, XF86ConfInactivePtr inactive)
-{
- XF86ConfInactivePtr prev, inac = layout->lay_inactive_lst;
-
- if (layout == NULL || inactive == NULL)
- return (False);
-
- prev = inac;
- while (inac != NULL) {
- if (inac == inactive)
- break;
- prev = inac;
- inac = (XF86ConfInactivePtr)(inac->list.next);
- }
- if (inac == NULL)
- return (False);
-
- XtFree(inac->inactive_device_str);
- if (prev == inac)
- layout->lay_inactive_lst = (XF86ConfInactivePtr)(inac->list.next);
- else
- prev->list.next = inac->list.next;
- XtFree((XtPointer)inac);
-
- return (True);
-}
-
-int
-xf86removeLayout(XF86ConfigPtr config, XF86ConfLayoutPtr layout)
-{
- XF86ConfLayoutPtr prev, lay = config->conf_layout_lst;
- XF86ConfAdjacencyPtr adj, nadj;
- XF86ConfInactivePtr inac, ninac;
- XF86ConfInputrefPtr iref, niref;
-
- if (config == NULL || layout == NULL)
- return (False);
-
- prev = lay;
- while (lay != NULL) {
- if (lay == layout)
- break;
- prev = lay;
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- if (lay == NULL)
- return (False);
-
- adj = lay->lay_adjacency_lst;
- while (adj != NULL) {
- nadj = (XF86ConfAdjacencyPtr)(adj->list.next);
- xf86removeAdjacency(lay, adj);
- adj = nadj;
- }
-
- inac = lay->lay_inactive_lst;
- while (inac != NULL) {
- ninac = (XF86ConfInactivePtr)(inac->list.next);
- xf86removeInactive(lay, inac);
- inac = ninac;
- }
-
- iref = lay->lay_input_lst;
- while (iref != NULL) {
- niref = (XF86ConfInputrefPtr)(iref->list.next);
- xf86removeInputRef(lay, iref->iref_inputdev);
- iref = niref;
- }
-
- xf86optionListFree(lay->lay_option_lst);
-
- if (prev == lay)
- config->conf_layout_lst = (XF86ConfLayoutPtr)(lay->list.next);
- else
- prev->list.next = lay->list.next;
- XtFree(lay->lay_identifier);
- XtFree((XtPointer)lay);
-
- return (True);
-}
-
-int
-xf86removeModule(XF86ConfigPtr config, XF86LoadPtr load)
-{
- XF86LoadPtr prev, mod;
-
- if (config == NULL || config->conf_modules == NULL ||
- config->conf_modules->mod_load_lst == NULL)
- return (False);
-
- for (mod = prev = config->conf_modules->mod_load_lst;
- mod != NULL; prev = mod, mod = (XF86LoadPtr)(mod->list.next))
- if (load == mod) {
- if (mod == prev)
- config->conf_modules->mod_load_lst =
- (XF86LoadPtr)(mod->list.next);
- else
- prev->list.next = mod->list.next;
- XtFree(mod->load_name);
- xf86optionListFree(mod->load_opt);
-
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeModes(XF86ConfigPtr config, XF86ConfModesPtr modes)
-{
- XF86ConfModesPtr mod;
- XF86ConfModeLinePtr ml, next;
- XF86ConfMonitorPtr mon;
-
- if (config == NULL || modes == NULL)
- return (False);
-
- /* check if modes is in config */
- if ((mod = config->conf_modes_lst) == modes)
- config->conf_modes_lst = (XF86ConfModesPtr)(mod->list.next);
- else
- for (; mod != NULL; mod = (XF86ConfModesPtr)(mod->list.next))
- if ((XF86ConfModesPtr)(mod->list.next) == modes) {
- mod->list.next = modes->list.next;
- break;
- }
-
- if (mod == NULL)
- return (False);
-
- /* remove references in monitor sections */
- mon = config->conf_monitor_lst;
- while (mon) {
- XF86ConfModesLinkPtr m, p;
-
- m = p = mon->mon_modes_sect_lst;
- while (m) {
- if (m->ml_modes == modes) {
- XtFree(m->ml_modes_str);
- if (m == mon->mon_modes_sect_lst)
- p = mon->mon_modes_sect_lst =
- (XF86ConfModesLinkPtr)(m->list.next);
- else {
- p->list.next = m->list.next;
- p = p->list.next;
- }
- XtFree((XtPointer)m);
- m = p;
- continue;
- }
- p = m;
- m = (XF86ConfModesLinkPtr)(m->list.next);
- }
- mon = (XF86ConfMonitorPtr)(mon->list.next);
- }
-
- /* free modelines */
- ml = modes->mon_modeline_lst;
- while (ml) {
- next = (XF86ConfModeLinePtr)(ml->list.next);
- XtFree(ml->ml_identifier);
- XtFree((XtPointer)ml);
- ml = next;
- }
-
- /* free mode */
- XtFree(modes->modes_identifier);
- XtFree((XtPointer)modes);
-
- return (True);
-}
-
-int
-xf86removeModesModeLine(XF86ConfModesPtr modes, XF86ConfModeLinePtr modeline)
-{
- XF86ConfModeLinePtr ml, prev;
-
- if (modes == NULL || modeline == NULL || modes->mon_modeline_lst == NULL)
- return (False);
-
- for (ml = prev = modes->mon_modeline_lst; ml;
- prev = ml, ml = (XF86ConfModeLinePtr)(ml->list.next))
- if (ml == modeline) {
- if (prev == ml)
- modes->mon_modeline_lst = (XF86ConfModeLinePtr)(ml->list.next);
- else
- prev->list.next = ml->list.next;
- XtFree(modeline->ml_identifier);
- XtFree((XtPointer)modeline);
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeMonitorModeLine(XF86ConfMonitorPtr monitor, XF86ConfModeLinePtr modeline)
-{
- XF86ConfModeLinePtr ml, prev;
-
- if (monitor == NULL || modeline == NULL || monitor->mon_modeline_lst == NULL)
- return (False);
-
- for (ml = prev = monitor->mon_modeline_lst; ml;
- prev = ml, ml = (XF86ConfModeLinePtr)(ml->list.next))
- if (ml == modeline) {
- if (prev == ml)
- monitor->mon_modeline_lst = (XF86ConfModeLinePtr)(ml->list.next);
- else
- prev->list.next = ml->list.next;
- XtFree(modeline->ml_identifier);
- XtFree((XtPointer)modeline);
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeMonitorModesLink(XF86ConfMonitorPtr monitor, XF86ConfModesLinkPtr link)
-{
- XF86ConfModesLinkPtr lnk, prev;
-
- if (monitor == NULL || link == NULL || monitor->mon_modes_sect_lst == NULL)
- return (False);
-
- for (lnk = prev = monitor->mon_modes_sect_lst; lnk != NULL;
- prev = lnk, lnk = (XF86ConfModesLinkPtr)(lnk->list.next))
- if (lnk == link) {
- if (prev == lnk)
- monitor->mon_modes_sect_lst = (XF86ConfModesLinkPtr)(lnk->list.next);
- else
- prev->list.next = lnk->list.next;
- XtFree(link->ml_modes_str);
- XtFree((XtPointer)link);
-
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeScreenAdaptorLink(XF86ConfScreenPtr scrn, XF86ConfAdaptorLinkPtr link)
-{
- XF86ConfAdaptorLinkPtr lnk, prev;
-
- if (scrn == NULL || link == NULL || scrn->scrn_adaptor_lst == NULL)
- return (False);
-
- for (lnk = prev = scrn->scrn_adaptor_lst; lnk != NULL;
- prev = lnk, lnk = (XF86ConfAdaptorLinkPtr)(lnk->list.next))
- if (lnk == link) {
- if (prev == lnk)
- scrn->scrn_adaptor_lst =
- (XF86ConfAdaptorLinkPtr)(lnk->list.next);
- else
- prev->list.next = lnk->list.next;
- XtFree(link->al_adaptor_str);
- XtFree((XtPointer)link);
-
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeScreenDisplay(XF86ConfScreenPtr scrn, XF86ConfDisplayPtr display)
-{
- XF86ConfDisplayPtr dsp, prev;
-
- if (scrn == NULL || display == NULL || scrn->scrn_display_lst == NULL)
- return (False);
-
- for (dsp = prev = scrn->scrn_display_lst; dsp != NULL;
- prev = dsp, dsp = (XF86ConfDisplayPtr)(dsp->list.next))
- if (dsp == display) {
- if (prev == dsp)
- scrn->scrn_display_lst =
- (XF86ConfDisplayPtr)(dsp->list.next);
- else
- prev->list.next = dsp->list.next;
- xf86optionListFree(display->disp_option_lst);
- XtFree((XtPointer)display->disp_visual);
- xf86freeModeList(display->disp_mode_lst);
- XtFree((XtPointer)display);
-
- return (True);
- }
-
- return (False);
-}
-
-int
-xf86removeVideoAdaptor(XF86ConfigPtr config, XF86ConfVideoAdaptorPtr video)
-{
- XF86ConfVideoAdaptorPtr vid;
- XF86ConfScreenPtr scrn;
- XF86ConfVideoPortPtr vp, next;
-
- if (config == NULL || video == NULL)
- return (False);
-
- /* check if video is in config and update videoadaptor list */
- if ((vid = config->conf_videoadaptor_lst) == video)
- config->conf_videoadaptor_lst = (XF86ConfVideoAdaptorPtr)(vid->list.next);
- else
- for (; vid != NULL; vid = (XF86ConfVideoAdaptorPtr)(vid->list.next))
- if ((XF86ConfVideoAdaptorPtr)(vid->list.next) == video) {
- vid->list.next = video->list.next;
- break;
- }
-
- if (vid == NULL)
- return (False);
-
- /* remove references in screen sections */
- scrn = config->conf_screen_lst;
- while (scrn) {
- XF86ConfAdaptorLinkPtr v, p;
-
- v = p = scrn->scrn_adaptor_lst;
- while (v) {
- if (v->al_adaptor == video) {
- XtFree(v->al_adaptor_str);
- if (v == scrn->scrn_adaptor_lst)
- p = scrn->scrn_adaptor_lst =
- (XF86ConfAdaptorLinkPtr)(v->list.next);
- else {
- p->list.next = v->list.next;
- p = p->list.next;
- }
- XtFree((XtPointer)v);
- v = p;
- continue;
- }
- p = v;
- v = (XF86ConfAdaptorLinkPtr)(v->list.next);
- }
- scrn = (XF86ConfScreenPtr)(scrn->list.next);
- }
-
- /* free videoports */
- vp = video->va_port_lst;
- while (vp) {
- next = (XF86ConfVideoPortPtr)(vp->list.next);
- XtFree(vp->vp_identifier);
- xf86optionListFree(vp->vp_option_lst);
- XtFree((XtPointer)vp);
- vp = next;
- }
-
- /* free videoadaptor */
- XtFree(video->va_identifier);
- XtFree(video->va_vendor);
- XtFree(video->va_board);
- XtFree(video->va_busid);
- XtFree(video->va_driver);
- XtFree(video->va_fwdref);
- xf86optionListFree(video->va_option_lst);
- XtFree((XtPointer)video);
-
- return (True);
-}
-
-int
-xf86removeVideoPort(XF86ConfVideoAdaptorPtr va, XF86ConfVideoPortPtr vp)
-{
- XF86ConfVideoPortPtr prev;
-
- if (va == NULL || vp == NULL)
- return (False);
-
- if ((prev = va->va_port_lst) == vp)
- va->va_port_lst = (XF86ConfVideoPortPtr)(va->va_port_lst->list.next);
- else {
- while (prev && (XF86ConfVideoPortPtr)(prev->list.next) != vp)
- prev = (XF86ConfVideoPortPtr)(prev->list.next);
- if (prev == NULL)
- return (False);
- prev->list.next = vp->list.next;
- }
-
- xf86optionListFree(vp->vp_option_lst);
- XtFree((XtPointer)vp);
-
- return (True);
-}
-
-int
-xf86removeDisplayMode(XF86ConfDisplayPtr display, XF86ModePtr mode)
-{
- XF86ModePtr prev;
-
- if (display == NULL || mode == NULL)
- return (False);
-
- if ((prev = display->disp_mode_lst) == mode)
- display->disp_mode_lst = (XF86ModePtr)(display->disp_mode_lst->list.next);
- else {
- while (prev && (XF86ModePtr)(prev->list.next) != mode)
- prev = (XF86ModePtr)(prev->list.next);
- if (prev == NULL)
- return (False);
- prev->list.next = mode->list.next;
- }
-
- XtFree((XtPointer)mode);
-
- return (True);
-}
-
-int
-xf86removeVendor(XF86ConfigPtr config, XF86ConfVendorPtr vendor)
-{
- XF86ConfVendorPtr prev;
-
- if (config == NULL || vendor == NULL)
- return (False);
-
- if ((prev = config->conf_vendor_lst) == vendor)
- config->conf_vendor_lst = (XF86ConfVendorPtr)(config->conf_vendor_lst->list.next);
- else {
- while (prev && (XF86ConfVendorPtr)(prev->list.next) != vendor)
- prev = (XF86ConfVendorPtr)(prev->list.next);
- if (prev == NULL)
- return (False);
- prev->list.next = vendor->list.next;
- }
-
- xf86optionListFree(vendor->vnd_option_lst);
- xf86freeVendorSubList(vendor->vnd_sub_lst);
- XtFree(vendor->vnd_identifier);
- XtFree((XtPointer)vendor);
-
- return (True);
-}
-
-int
-xf86removeVendorSub(XF86ConfVendorPtr vendor, XF86ConfVendSubPtr sub)
-{
- XF86ConfVendSubPtr prev;
-
- if (vendor == NULL || sub == NULL)
- return (False);
-
- if ((prev = vendor->vnd_sub_lst) == sub)
- vendor->vnd_sub_lst = (XF86ConfVendSubPtr)(vendor->vnd_sub_lst->list.next);
- else {
- while (prev && (XF86ConfVendSubPtr)(prev->list.next) != sub)
- prev = (XF86ConfVendSubPtr)(prev->list.next);
- if (prev == NULL)
- return (False);
- prev->list.next = sub->list.next;
- }
-
- xf86optionListFree(sub->vs_option_lst);
- XtFree(sub->vs_name);
- XtFree(sub->vs_identifier);
- XtFree((XtPointer)sub);
-
- return (True);
-}
-
-int
-xf86removeBuffers(XF86ConfDRIPtr dri, XF86ConfBuffersPtr buf)
-{
- XF86ConfBuffersPtr prev;
-
- if (dri == NULL || buf == NULL)
- return (False);
-
- if ((prev = dri->dri_buffers_lst) == buf)
- dri->dri_buffers_lst = (XF86ConfBuffersPtr)(dri->dri_buffers_lst->list.next);
- else {
- while (prev && (XF86ConfBuffersPtr)(prev->list.next) != buf)
- prev = (XF86ConfBuffersPtr)(prev->list.next);
- if (prev == NULL)
- return (False);
- prev->list.next = buf->list.next;
- }
-
- XtFree(buf->buf_flags);
- XtFree((XtPointer)buf);
-
- return (True);
-}
-
-int
-xf86renameInput(XF86ConfigPtr config, XF86ConfInputPtr input, char *name)
-{
- XF86ConfLayoutPtr lay = config->conf_layout_lst;
-
- if (config == NULL || input == NULL || name == NULL || *name == '\0')
- return (False);
-
- while (lay != NULL) {
- XF86ConfInputrefPtr iref = lay->lay_input_lst;
-
- while (iref != NULL) {
- if (strcasecmp(input->inp_identifier, iref->iref_inputdev_str) == 0) {
- XtFree(iref->iref_inputdev_str);
- iref->iref_inputdev_str = XtNewString(name);
- }
- iref = (XF86ConfInputrefPtr)(iref->list.next);
- }
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- XtFree(input->inp_identifier);
- input->inp_identifier = XtNewString(name);
-
- return (True);
-}
-
-int
-xf86renameDevice(XF86ConfigPtr config, XF86ConfDevicePtr dev, char *name)
-{
- XF86ConfScreenPtr scr = config->conf_screen_lst;
-
- if (config == NULL || dev == NULL || name == NULL || *name == '\0')
- return (False);
-
- while (scr != NULL) {
- if (scr->scrn_device == dev) {
- XtFree(scr->scrn_device_str);
- scr->scrn_device_str = XtNewString(name);
- }
-
- scr = (XF86ConfScreenPtr)(scr->list.next);
- }
-
- XtFree(dev->dev_identifier);
- dev->dev_identifier = XtNewString(name);
-
- return (True);
-}
-
-int
-xf86renameMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr mon, char *name)
-{
- XF86ConfScreenPtr scr = config->conf_screen_lst;
-
- if (config == NULL || mon == NULL || name == NULL || *name == '\0')
- return (False);
-
- while (scr != NULL) {
- if (scr->scrn_monitor == mon) {
- XtFree(scr->scrn_monitor_str);
- scr->scrn_monitor_str = XtNewString(name);
- }
-
- scr = (XF86ConfScreenPtr)(scr->list.next);
- }
-
- XtFree(mon->mon_identifier);
- mon->mon_identifier = XtNewString(name);
-
- return (True);
-}
-
-int
-xf86renameLayout(XF86ConfigPtr config, XF86ConfLayoutPtr layout, char *name)
-{
- if (config == NULL || layout == NULL || name == NULL || *name == '\0')
- return (False);
-
- XtFree(layout->lay_identifier);
- layout->lay_identifier = XtNewString(name);
-
- return (True);
-}
-
-int
-xf86renameScreen(XF86ConfigPtr config, XF86ConfScreenPtr scrn, char *name)
-{
- XF86ConfLayoutPtr lay = config->conf_layout_lst;
-
- if (config == NULL || scrn == NULL || name == NULL || *name == '\0')
- return (False);
-
- while (lay != NULL) {
- XF86ConfAdjacencyPtr adj = lay->lay_adjacency_lst;
-
- while (adj != NULL) {
- if (adj->adj_screen == scrn) {
- XtFree(adj->adj_screen_str);
- adj->adj_screen_str = XtNewString(name);
- }
- else if (adj->adj_top == scrn) {
- XtFree(adj->adj_top_str);
- adj->adj_top_str = XtNewString(name);
- }
- else if (adj->adj_bottom == scrn) {
- XtFree(adj->adj_bottom_str);
- adj->adj_bottom_str = XtNewString(name);
- }
- else if (adj->adj_left == scrn) {
- XtFree(adj->adj_left_str);
- adj->adj_left_str = XtNewString(name);
- }
- else if (adj->adj_right == scrn) {
- XtFree(adj->adj_right_str);
- adj->adj_right_str = XtNewString(name);
- }
- else if (adj->adj_refscreen != NULL &&
- strcasecmp(adj->adj_refscreen, name) == 0) {
- XtFree(adj->adj_refscreen);
- adj->adj_refscreen = XtNewString(name);
- }
-
- adj = (XF86ConfAdjacencyPtr)(adj->list.next);
- }
- lay = (XF86ConfLayoutPtr)(lay->list.next);
- }
-
- XtFree(scrn->scrn_identifier);
- scrn->scrn_identifier = XtNewString(name);
-
- return (True);
-}
diff --git a/hw/xfree86/utils/xorgcfg/xf86config.h b/hw/xfree86/utils/xorgcfg/xf86config.h
deleted file mode 100644
index 575c3c9d0..000000000
--- a/hw/xfree86/utils/xorgcfg/xf86config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Conectiva Linux shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Conectiva Linux.
- *
- * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.h,v 1.4 2000/11/30 20:55:18 paulo Exp $
- */
-
-#include "config.h"
-
-#ifndef _xf86cfg_xf86config_h
-#define _xf86cfg_xf86config_h
-
-#define xf86addInput(head, ptr) \
- (XF86ConfInputPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addInputref(head, ptr) \
- (XF86ConfInputrefPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addDevice(head, ptr) \
- (XF86ConfDevicePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addDisplayMode(head, ptr) \
- (XF86ModePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addMonitor(head, ptr) \
- (XF86ConfMonitorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addScreen(head, ptr) \
- (XF86ConfScreenPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addLayout(head, ptr) \
- (XF86ConfLayoutPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addModeLine(head, ptr) \
- (XF86ConfModeLinePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addModes(head, ptr) \
- (XF86ConfModesPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addModesLink(head, ptr) \
- (XF86ConfModesLinkPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addModule(head, ptr) \
- (XF86LoadPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addScreenAdaptor(head, ptr) \
- (XF86ConfAdaptorLinkPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addScreenDisplay(head, ptr) \
- (XF86ConfDisplayPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addVideoAdaptor(head, ptr) \
- (XF86ConfVideoAdaptorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addVideoPort(head, ptr) \
- (XF86ConfVideoPortPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addAdjacency(head, ptr) \
- (XF86ConfAdjacencyPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addVendor(head, ptr) \
- (XF86ConfVendorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addVendorSub(head, ptr) \
- (XF86ConfVendSubPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-#define xf86addBuffers(head, ptr) \
- (XF86ConfBuffersPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
-
-
-int xf86removeOption(XF86OptionPtr*, char*);
-int xf86removeInput(XF86ConfigPtr, XF86ConfInputPtr);
-int xf86removeInputRef(XF86ConfLayoutPtr, XF86ConfInputPtr);
-int xf86removeDevice(XF86ConfigPtr, XF86ConfDevicePtr);
-int xf86removeDisplayMode(XF86ConfDisplayPtr, XF86ModePtr);
-int xf86removeMonitor(XF86ConfigPtr, XF86ConfMonitorPtr);
-int xf86removeScreen(XF86ConfigPtr, XF86ConfScreenPtr);
-int xf86removeAdjacency(XF86ConfLayoutPtr, XF86ConfAdjacencyPtr);
-int xf86removeInactive(XF86ConfLayoutPtr, XF86ConfInactivePtr);
-int xf86removeLayout(XF86ConfigPtr, XF86ConfLayoutPtr);
-int xf86removeModule(XF86ConfigPtr, XF86LoadPtr);
-int xf86removeModes(XF86ConfigPtr, XF86ConfModesPtr);
-int xf86removeModesModeLine(XF86ConfModesPtr, XF86ConfModeLinePtr);
-int xf86removeMonitorModeLine(XF86ConfMonitorPtr, XF86ConfModeLinePtr);
-int xf86removeMonitorModesLink(XF86ConfMonitorPtr, XF86ConfModesLinkPtr);
-int xf86removeScreenAdaptorLink(XF86ConfScreenPtr, XF86ConfAdaptorLinkPtr);
-int xf86removeScreenDisplay(XF86ConfScreenPtr, XF86ConfDisplayPtr);
-int xf86removeVideoAdaptor(XF86ConfigPtr, XF86ConfVideoAdaptorPtr);
-int xf86removeVideoPort(XF86ConfVideoAdaptorPtr, XF86ConfVideoPortPtr);
-int xf86removeVendor(XF86ConfigPtr, XF86ConfVendorPtr);
-int xf86removeVendorSub(XF86ConfVendorPtr, XF86ConfVendSubPtr);
-int xf86removeBuffers(XF86ConfDRIPtr, XF86ConfBuffersPtr);
-
-int xf86renameInput(XF86ConfigPtr, XF86ConfInputPtr, char*);
-int xf86renameDevice(XF86ConfigPtr, XF86ConfDevicePtr, char*);
-int xf86renameMonitor(XF86ConfigPtr, XF86ConfMonitorPtr, char*);
-int xf86renameLayout(XF86ConfigPtr, XF86ConfLayoutPtr, char*);
-int xf86renameScreen(XF86ConfigPtr, XF86ConfScreenPtr, char*);
-
-extern void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr);
-extern void xf86freeDisplayList(XF86ConfDisplayPtr);
-extern void xf86freeModeList(XF86ModePtr);
-extern void xf86freeVendorSubList(XF86ConfVendSubPtr);
-
-#endif /* _xf86cfg_xf86config_h */
diff --git a/hw/xfree86/utils/xorgconfig/Cards b/hw/xfree86/utils/xorgconfig/Cards
deleted file mode 100644
index 83d8840ea..000000000
--- a/hw/xfree86/utils/xorgconfig/Cards
+++ /dev/null
@@ -1,3130 +0,0 @@
-# $XConsortium: Cards /main/27 1996/10/28 05:43:53 kaleb $
-# This is the database of card definitions used by xf86config.
-# Each definition should have a NAME entry, CHIPSET (descriptive) and
-# SERVER (one of Mono, VGA16, SVGA, S3, 8514, Mach8, Mach32, Mach64, AGX,
-# P9000, W32, I128).
-# A reference to another definition is made with SEE (already defined
-# entries are not overridden).
-# Optional entries are RAMDAC (identifier), CLOCKCHIP (identifier),
-# DACSPEED, NOCLOCKPROBE (advises never to probe clocks), UNSUPPORTED
-# (indicates card that is not yet properly supported by a dedicated
-# server). A LINE entry adds a line of text to be included in the
-# Device section (can include options or comments).
-# There's no CLOCKS option (although a Clocks line can be included
-# with LINE), as it is very undesirable to have a Clocks line that
-# is incorrect. The idea is that the Clocks are probed for to be
-# sure (a commented suggested Clocks line can be included).
-#
-# The majority of entries are just a binding of a model name to a
-# chipset/server and untested.
-#
-# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards,v 3.80 2002/11/18 05:24:19 paulo Exp $
-
-# VGA
-
-NAME * Generic VGA compatible
-SERVER VGA16
-DRIVER vga
-
-NAME * Generic VESA compatible
-SERVER VGA16
-DRIVER vesa
-
-NAME * Unsupported VGA compatible
-SERVER VGA16
-DRIVER vga
-UNSUPPORTED
-
-
-# #
-# generic #
-# #
-
-NAME ** Alliance Pro Motion (generic) [apm]
-#CHIPSET apm
-SERVER SVGA
-DRIVER apm
-LINE #Option "no_accel"
-
-NAME ** Ark Logic (generic) [ark]
-#CHIPSET ark
-SERVER SVGA
-DRIVER ark
-
-NAME ** ATI (generic) [ati]
-#CHIPSET ati
-SERVER SVGA
-DRIVER ati
-
-NAME ** ATI Rage 128 based (generic) [r128]
-#CHIPSET r128
-SERVER SVGA
-DRIVER r128
-
-NAME ** ATI Radeon (generic) [radeon]
-#CHIPSET radeon
-SERVER SVGA
-DRIVER radeon
-
-NAME ** Chips and Technologies (generic) [chips]
-#CHIPSET chips
-SERVER SVGA
-DRIVER chips
-LINE # Option "suspend_hack"
-LINE # Option "STN"
-LINE # Option "no_stretch"
-LINE # Option "no_center"
-LINE # Option "use_modeline"
-LINE # Option "fix_panel_size"
-LINE # videoram 512
-LINE # Option "noaccel"
-LINE # Option "no_bitblt"
-LINE # Option "xaa_no_color_exp"
-LINE # Option "xaa_benchmark"
-LINE # Option "hw_cursor"
-LINE # Option "nolinear"
-LINE # MemBase 0x03b00000
-LINE # Option "hw_clocks"
-LINE # Textclockfreq 25.175
-
-NAME ** Cirrus Logic (generic) [cirrus]
-#CHIPSET cirrus
-SERVER SVGA
-DRIVER cirrus
-LINE # MemBase 0x00e00000 # ISA card that maps to 14Mb
-LINE # MemBase 0x04000000 # VLB card that maps to 64Mb
-LINE # MemBase 0x80000000 # VLB card that maps to 2048Mb
-LINE # MemBase 0x02000000 # VLB card that maps to 32Mb
-LINE # Option "linear"
-LINE # Option "fifo_conservative"
-
-NAME ** Cyrix MediaGX (generic) [cyrix]
-#CHIPSET cyrix
-SERVER SVGA
-DRIVER cyrix
-
-NAME ** Linux framebuffer (generic) [fbdev]
-#CHIPSET fbdev
-SERVER SVGA
-DRIVER fbdev
-
-NAME ** 3DLabs, TI (generic) [glint]
-#CHIPSET glint
-SERVER SVGA
-DRIVER glint
-LINE #Option "no_accel"
-
-NAME ** Number Nine I128 (generic) [i128]
-#CHIPSET i128
-SERVER SVGA
-DRIVER i128
-
-NAME ** Intel i740 (generic) [i740]
-#CHIPSET i740
-SERVER SVGA
-DRIVER i740
-
-NAME ** Intel i810 (generic) [i810]
-#CHIPSET i810
-SERVER SVGA
-DRIVER i810
-
-NAME ** Matrox Graphics (generic) [mga]
-#CHIPSET mga
-SERVER SVGA
-DRIVER mga
-LINE # Option "mga_sdram"
-
-NAME ** NeoMagic (generic) [neomagic]
-#CHIPSET neomagic
-SERVER SVGA
-DRIVER neomagic
-LINE # Chipset "NM2160"
-LINE # IOBase 0xfea00000
-LINE # MemBase 0xfd000000
-LINE # VideoRam 2048
-LINE # DacSpeed 90
-LINE # Option "linear"
-LINE # Option "nolinear"
-LINE # Option "sw_cursor"
-LINE # Option "hw_cursor"
-LINE # Option "no_accel"
-LINE # Option "intern_disp"
-LINE # Option "extern_disp"
-LINE # Option "mmio"
-LINE # Option "no_mmio"
-LINE # Option "lcd_center"
-LINE # Option "no_stretch"
-
-NAME ** NVIDIA (generic) [nv]
-#CHIPSET nv
-SERVER SVGA
-DRIVER nv
-
-NAME ** Rendition (generic) [rendition]
-#CHIPSET rendition
-SERVER SVGA
-DRIVER rendition
-LINE # Option "sw_cursor"
-
-NAME ** S3 (not ViRGE or Savage) (generic) [s3]
-#CHIPSET s3
-SERVER SVGA
-DRIVER s3
-
-NAME ** S3 ViRGE (generic) [s3virge]
-#CHIPSET s3virge
-SERVER SVGA
-DRIVER s3virge
-LINE # Option "xaa_benchmark"
-LINE # Option "fifo_moderate"
-LINE # Option "pci_burst_on"
-LINE # Option "pci_retry"
-LINE # Option "lcd_center"
-LINE # Set_LCDClk <pixel_clock_for_LCD>
-
-NAME ** S3 Savage (generic) [savage]
-#CHIPSET savage
-SERVER SVGA
-DRIVER savage
-
-NAME ** Silicon Motion (generic) [siliconmotion]
-#CHIPSET siliconmotion
-SERVER SVGA
-DRIVER siliconmotion
-
-NAME ** SiS (generic) [sis]
-#CHIPSET sis
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel"
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-LINE # Option "no_BitBlt"
-LINE # Option "fast_vram"
-LINE # Option "pci_burst_on"
-LINE # Option "xaa_benchmark"
-LINE # Option "ext_eng_queue"
-
-NAME ** 3Dfx (generic) [tdfx]
-#CHIPSET tdfx
-SERVER SVGA
-DRIVER tdfx
-
-NAME ** DEC TGA (generic) [tga]
-#CHIPSET tga
-SERVER SVGA
-DRIVER tga
-
-NAME ** Trident (generic) [trident]
-#CHIPSET trident
-SERVER SVGA
-DRIVER trident
-
-NAME ** Tseng Labs (generic) [tseng]
-#CHIPSET tseng
-SERVER SVGA
-DRIVER tseng
-LINE # Option "linear"
-LINE # Option "noaccel"
-LINE # Option "power_saver"
-LINE # Option "fast_dram"
-LINE # Option "pci_retry"
-LINE # Option "hibit_high"
-LINE # Option "hibit_low"
-LINE # MemBase 0x3C00000
-
-NAME ** VMWare guest OS (generic) [vmware]
-#CHIPSET vmware
-SERVER SVGA
-DRIVER vmware
-
-
-#Chips & Technologies
-
-#untested
-NAME Chips & Technologies CT65520
-CHIPSET ct65520
-SERVER SVGA
-DRIVER chips
-LINE # Device section for C&T cards.
-LINE # Option "suspend_hack"
-LINE # Option "STN"
-LINE # Option "no_stretch"
-LINE # Option "no_center"
-LINE # Option "use_modeline"
-LINE # Option "fix_panel_size"
-LINE # videoram 512
-
-NAME Chips & Technologies CT65525
-CHIPSET ct65525
-LINE # Option "nolinear"
-LINE # MemBase 0x03b00000
-SEE Chips & Technologies CT65520
-
-NAME Chips & Technologies CT65530
-CHIPSET ct65530
-SEE Chips & Technologies CT65525
-
-NAME Chips & Technologies CT65535
-CHIPSET ct65535
-NOCLOCKPROBE
-LINE # Option "hw_clocks"
-LINE # Textclockfreq 25.175
-SEE Chips & Technologies CT65530
-
-NAME Chips & Technologies CT65540
-CHIPSET ct65540
-NOCLOCKPROBE
-LINE # Option "use_18bit_bus"
-SEE Chips & Technologies CT65535
-
-NAME Chips & Technologies CT65545
-CHIPSET ct65545
-NOCLOCKPROBE
-LINE # Option "noaccel"
-LINE # Option "no_bitblt"
-LINE # Option "xaa_no_color_exp"
-LINE # Option "xaa_benchmark"
-LINE # Option "hw_cursor"
-LINE # Option "mmio"
-SEE Chips & Technologies CT65540
-
-NAME Chips & Technologies CT65546
-CHIPSET ct65546
-SEE Chips & Technologies CT65545
-
-NAME Chips & Technologies CT65548
-CHIPSET ct65548
-SEE Chips & Technologies CT65545
-
-NAME Chips & Technologies CT65550
-CHIPSET ct65550
-NOCLOCKPROBE
-LINE # Option "noaccel"
-LINE # Option "no_bitblt"
-LINE # Option "xaa_no_color_exp"
-LINE # Option "xaa_benchmark"
-LINE # Option "hw_cursor"
-LINE # Option "sync_on_green"
-LINE # Option "fast_dram"
-LINE # Option "use_vclk1"
-LINE # Textclockfreq 25.175
-SEE Chips & Technologies CT65530
-
-NAME Chips & Technologies CT65554
-CHIPSET ct65554
-SEE Chips & Technologies CT65550
-
-NAME Chips & Technologies CT65555
-CHIPSET ct65555
-SEE Chips & Technologies CT65550
-
-NAME Chips & Technologies CT68554
-CHIPSET ct68554
-SEE Chips & Technologies CT65550
-
-NAME Chips & Technologies CT69000
-CHIPSET ct69000
-SEE Chips & Technologies CT65550
-
-NAME Chips & Technologies CT69030
-CHIPSET ct69030
-SEE Chips & Technologies CT65550
-
-NAME Chips & Technologies CT64200
-CHIPSET ct64200
-SERVER SVGA
-DRIVER chips
-LINE # Device section for C&T cards.
-LINE # videoram 1024
-
-NAME Chips & Technologies CT64300
-CHIPSET ct64300
-SERVER SVGA
-DRIVER chips
-LINE # Option "noaccel"
-LINE # Option "no_bitblt"
-LINE # Option "xaa_no_color_exp"
-LINE # Option "xaa_benchmark"
-LINE # Option "hw_cursor"
-LINE # Option "nolinear"
-LINE # MemBase 0x03b00000
-LINE # Option "hw_clocks"
-LINE # Textclockfreq 25.175
-SEE Chips & Technologies CT64200
-
-# Cirrus Logic
-
-#tested
-NAME Cirrus Logic GD542x
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-LINE # Device section for Cirrus Logic GD5420/2/4/6/8/9-based cards.
-LINE #MemBase 0x00e00000
-LINE #MemBase 0x04e00000
-LINE #Option "linear"
-
-#tested
-NAME Cirrus Logic GD543x
-CHIPSET CL-GD5430/5434/5436
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE # Device section for Cirrus Logic GD5430/34-based cards.
-LINE #MemBase 0x00e00000 # ISA card that maps to 14Mb
-LINE #MemBase 0x04000000 # VLB card that maps to 64Mb
-LINE #MemBase 0x80000000 # VLB card that maps to 2048Mb
-LINE #MemBase 0x02000000 # VLB card that maps to 32Mb
-LINE #Option "linear"
-
-NAME Cirrus Logic GD544x
-CHIPSET CL-GD544x
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-
-NAME Creative Labs Graphics Blaster MA201
-SEE Cirrus Logic GD544x
-
-NAME Creative Labs Graphics Blaster MA202
-SEE Cirrus Logic GD544x
-
-#tested
-NAME Cirrus Logic GD5462
-CHIPSET CL-GD5462
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE #Option "fifo_conservative"
-
-#tested
-NAME Cirrus Logic GD5464
-CHIPSET CL-GD5464
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE #Option "fifo_conservative"
-
-#tested
-NAME Cirrus Logic GD5465
-CHIPSET CL-GD5465
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE #Option "fifo_conservative"
-
-NAME Creative Labs Graphics Blaster MA302
-CHIPSET CL-GD5462
-SEE Cirrus Logic GD5462
-
-NAME Creative Labs Graphics Blaster MA334
-CHIPSET CL-GD5464
-SEE Cirrus Logic GD5464
-
-NAME Creative Labs Graphics Blaster 3D
-CHIPSET CL-GD5464
-SEE Cirrus Logic GD5464
-
-#tested
-NAME Cirrus Logic GD5480
-CHIPSET CL-GD5480
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-
-#tested
-NAME Diamond SpeedStar 64
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME Diamond SpeedStar64 Graphics 2000/2200
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME Diamond SpeedStar Pro SE (CL-GD5430/5434)
-SEE Cirrus Logic GD543x
-
-NAME Diamond SpeedStar Pro 1100
-SEE Cirrus Logic GD542x
-
-NAME Orchid Kelvin 64 VLB Rev A
-CHIPSET CL-GD5434
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE # Device section for Orchid Kelvin 64 VLB Rev A
-LINE # Linear framebuffer maps at 2048Mb. Some motherboards make linear addressing
-LINE # impossible. Some cards map at 32Mb.
-LINE #MemBase 0x02000000 # VLB card that maps to 32Mb
-LINE #MemBase 0x04000000 # VLB card that maps to 64Mb
-LINE MemBase 0x80000000 # VLB card that maps to 2048Mb
-LINE #Option "linear"
-
-NAME Orchid Kelvin 64 VLB Rev B
-CHIPSET CL-GD5434
-SERVER SVGA
-DRIVER cirrus
-NOCLOCKPROBE
-LINE # Device section for Orchid Kelvin 64 VLB Rev B
-LINE # Linear framebuffer maps at 32Mb. Some motherboards make linear addressing
-LINE # impossible. Some cards map at 2048Mb.
-LINE MemBase 0x02000000 # VLB card that maps to 32Mb
-LINE #MemBase 0x04000000 # VLB card that maps to 64Mb
-LINE #MemBase 0x80000000 # VLB card that maps to 2048Mb
-LINE #Option "linear"
-
-NAME Orchid Kelvin 64
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME Intel 5430
-CHIPSET CL-GD5430
-SEE Cirrus Logic GD543x
-
-NAME STB Nitro (64)
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME STB Nitro 64 Video
-CHIPSET CL-GD5446
-SEE Cirrus Logic GD544x
-
-NAME STB Horizon
-CHIPSET CL-GD5426/28
-SEE Cirrus Logic GD542x
-
-NAME STB Horizon Video
-CHIPSET CL-GD5440
-SEE Cirrus Logic GD544x
-
-NAME Genoa 8500VL(-28)
-CHIPSET CL-GD5426/28
-SEE Cirrus Logic GD542x
-
-NAME Diamond SpeedStar Pro (not SE)
-CHIPSET CL-GD5426/28
-SEE Cirrus Logic GD542x
-
-NAME ALG-5434(E)
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME Actix ProStar
-CHIPSET CL-GD5426/5428
-SEE Cirrus Logic GD542x
-
-NAME Actix ProStar 64
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-#tested
-NAME Acumos AVGA3
-SEE Cirrus Logic GD542x
-
-NAME DFI-WG1000
-SEE Cirrus Logic GD542x
-
-NAME Spider VLB Plus
-CHIPSET CL-GD5428
-SEE Cirrus Logic GD542x
-
-NAME VI720
-CHIPSET CL-GD5434
-SEE Cirrus Logic GD543x
-
-NAME Cirrus Logic GD62xx (laptop)
-CHIPSET CL-GD6205/15/25/35
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Cirrus Logic GD64xx (laptop)
-CHIPSET CL-GD6420/6440
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Cirrus Logic GD754x (laptop)
-CHIPSET CL-GD7541/42/43/48
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Techworks Ultimate 3D
-CHIPSET CL-GD5464
-SEE Cirrus Logic GD5464
-
-NAME VideoLogic GrafixStar 550
-CHIPSET CL-GD5464
-SEE Cirrus Logic GD5464
-
-NAME Jaton Video-70P
-CHIPSET CL-GD5464
-SEE Cirrus Logic GD5464
-
-NAME PixelView Combo TV Pro (Prolink)
-CHIPSET CL-GD5480, 4MB
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE # COMMENT on card TV Tuner
-NOCLOCKPROBE
-
-NAME PixelView Combo TV 3D AGP (Prolink)
-CHIPSET CL-GD5465, 4MB
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE # COMMENT on card TV+FM Tuner
-NOCLOCKPROBE
-
-NAME Creative Labs Graphics Blaster Eclipse (OEM Model CT6510)
-SEE Cirrus Logic GD5465
-
-NAME VideoLogic GrafixStar 560 (PCI/AGP)
-SEE Cirrus Logic GD5465
-
-NAME Cirrus Logic GD5446 (noname card)
-CHIPSET CL-GD5446, 1MB (upgradable to 2MB).
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Octek VL-VGA-26
-CHIPSET CL-GD5426
-SEE Cirrus Logic GD542x
-
-NAME Octek VL-VGA-28
-CHIPSET CL-GD5428
-SEE Cirrus Logic GD542x
-
-NAME Octek Combo-26
-CHIPSET CL-GD5426
-SEE Cirrus Logic GD542x
-
-NAME Octek Combo-28
-CHIPSET CL-GD5428
-SEE Cirrus Logic GD542x
-
-NAME Octek AVGA-20
-SEE Cirrus Logic GD542x
-
-# S3 801/805
-
-NAME S3 801/805 (generic)
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME S3 86C801 (generic)
-SEE S3 801/805 (generic)
-
-NAME S3 86C805 (generic)
-SEE S3 801/805 (generic)
-
-#tested
-NAME S3 801/805 with ATT20c490 RAMDAC
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-LINE #Option "dac_8_bit" # Not supported by some 20c490 clones
-
-NAME S3 801/805 with SC1148{2,3,4} RAMDAC
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc11482
-
-NAME S3 801/805 with SC1148{5,7,9} RAMDAC
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc11485
-
-NAME S3 801/805 with S3 GenDAC
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC s3gendac
-CLOCKCHIP s3gendac
-
-NAME S3 801/805 with ATT20c490 RAMDAC and ICD2061A
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-CLOCKCHIP icd2061a
-LINE #Option "dac_8_bit" # Not supported by some 20c490 clones
-
-NAME S3 801/805 with Chrontel 8391
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-CLOCKCHIP ch8391
-LINE Option "dac_8_bit"
-
-#tested
-NAME Actix GE32+ 2MB
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-LINE #Option "dac_8_bit"
-
-NAME Actix GE32i
-CHIPSET S3 805i
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME Orchid Fahrenheit VA
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-
-NAME Orchid Fahrenheit 1280
-CHIPSET S3 801
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Probable clocks:
-LINE #Clocks 25.20 28.32 32.50 0.00 40.00 44.90 50.40 65.00
-LINE #Clocks 78.00 56.70 63.10 75.10 80.00 89.90 100.90 31.50
-
-NAME Orchid Fahrenheit-1280+
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20C490
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE #Option "nolinear" # VLB card may require this
-LINE #Probable clocks:
-LINE #Clocks 25.20 28.32 40.0 0.0 50.10 77.0 36.10 45.0
-LINE #Clocks 130.0 120.20 80.0 31.50 110.30 65.0 75.0 94.60
-
-NAME Diamond Stealth 24
-CHIPSET S3 801/805
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-LINE #Option "nolinear"
-LINE #Ramdac "att20c490" # The Diamond RAMDAC is reportedly compatible for 15bpp
-
-NAME Miro Crystal 8S
-SEE S3 801/805 (generic)
-
-NAME Miro Crystal 10SD with GenDAC
-SEE S3 801/805 with S3 GenDAC
-
-NAME Dell S3 805
-SEE S3 801/805 (generic)
-
-NAME STB Powergraph X-24
-SEE S3 801/805 with ATT20c490 RAMDAC and ICD2061A
-
-NAME JAX 8241
-SEE S3 801/805 with Chrontel 8391
-
-NAME VL-41
-SEE S3 801/805 with Chrontel 8391
-
-NAME SPEA Mirage
-SEE S3 801/805 with Chrontel 8391
-
-# S3 864/Trio64/Trio32/868
-
-NAME S3 864 (generic)
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME S3 86C864 (generic)
-SEE S3 864 (generic)
-
-NAME S3 Vision864 (generic)
-SEE S3 864 (generic)
-
-NAME S3 864 with SDAC (86C716)
-CHIPSET S3 864
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC s3_sdac
-CLOCKCHIP s3_sdac
-NOCLOCKPROBE
-
-NAME S3 864 with ATT 20C498 or 21C498
-CHIPSET S3 864
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c498
-
-NAME S3 864 with STG1703
-CHIPSET S3 864
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC stg1703
-NOCLOCKPROBE
-
-NAME S3 868 (generic)
-CHIPSET S3 868
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME S3 86C868 (generic)
-SEE S3 868 (generic)
-
-NAME S3 Vision868 (generic)
-SEE S3 868 (generic)
-
-NAME S3 868 with SDAC (86C716)
-CHIPSET S3 868
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 868 with ATT 20C498 or 21C498
-CHIPSET S3 868
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c498
-
-NAME S3 868 with ATT 20C409
-CHIPSET S3 868
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c409
-NOCLOCKPROBE
-
-NAME Number Nine FX Motion 531
-CLOCKCHIP icd2061a
-SEE S3 868 with ATT 20C498 or 21C498
-
-NAME S3 Trio64 (generic)
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 86C764 (generic)
-SEE S3 Trio64 (generic)
-
-NAME S3 Trio64V+ (generic)
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 86C765 (generic)
-SEE S3 Trio64V+ (generic)
-
-NAME S3 Trio32 (generic)
-CHIPSET S3 Trio32
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Genoa Phantom 64i with S3 SDAC
-DACSPEED 135
-SEE S3 864 with SDAC (86C716)
-
-NAME Number Nine GXE64
-CHIPSET S3 864
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-LINE Option "number_nine"
-
-NAME Number Nine GXE64 with S3 Trio64
-SEE S3 Trio64 (generic)
-
-NAME Diamond Stealth 64 DRAM with S3 SDAC
-DACSPEED 135
-SEE S3 864 with SDAC (86C716)
-
-NAME Diamond Stealth64 Graphics 2xx0 series (864 + SDAC)
-DACSPEED 135
-SEE S3 864 with SDAC (86C716)
-
-NAME Diamond Stealth 64 DRAM with S3 Trio64
-SEE S3 Trio64 (generic)
-
-NAME Diamond Stealth64 Graphics 2xx0 series (Trio64)
-SEE S3 Trio64 (generic)
-
-NAME Diamond Stealth 64 DRAM SE
-SEE S3 Trio32 (generic)
-
-NAME Diamond Stealth64 Video 2001 series (2121/2201)
-SEE S3 Trio64V+ (generic)
-
-NAME Actix GE64
-CLOCKCHIP icd2061a
-SEE S3 864 (generic)
-
-NAME ELSA Winner 1000PRO with S3 SDAC
-SEE S3 864 with SDAC (86C716)
-
-NAME ELSA Winner 1000PRO with STG1700 or AT&T RAMDAC
-CHIPSET S3 864
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-
-NAME ELSA Winner 1000PRO/X
-SEE S3 868 with SDAC (86C716)
-
-NAME ELSA Winner 1000ISA
-CHIPSET S3 805i
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-LINE Option "dac_8_bit"
-LINE # the following settings should be detected and set automatically by XF86_S3
-LINE # if the serial number of the ELSA card is printed correctly:
-LINE #ClockChip "icd2061a"
-
-NAME Cardex Trio64
-SEE S3 Trio64 (generic)
-
-NAME Cardex Trio64Pro
-SEE S3 Trio64 (generic)
-
-NAME Miro Crystal 12SD
-SEE S3 Trio32 (generic)
-
-NAME Miro Crystal 22SD
-SEE S3 Trio64 (generic)
-
-NAME Miro Crystal 20SD with ICS2494 (BIOS 1.xx)
-SEE S3 864 with ATT 20C498 or 21C498
-
-NAME Miro Crystal 20SD with ICD2061A (BIOS 2.xx)
-CLOCKCHIP icd2061a
-SEE S3 864 with ATT 20C498 or 21C498
-
-NAME Miro Crystal 20SD VLB with S3 SDAC (BIOS 3.xx)
-SEE S3 864 with SDAC (86C716)
-
-NAME Miro Crystal 20SD PCI with S3 SDAC
-SEE S3 868 with SDAC (86C716)
-
-NAME ELSA Winner 1000AVI (SDAC version)
-SEE S3 868 with SDAC (86C716)
-
-NAME ELSA Winner 1000AVI (AT&T 20C409 version)
-SEE S3 868 with ATT 20C409
-
-NAME Diamond Stealth Video DRAM
-SEE S3 868 with SDAC (86C716)
-
-NAME Diamond Stealth64 Video 2120/2200
-SEE S3 868 with SDAC (86C716)
-
-NAME SPEA/V7 Mirage P64
-CLOCKCHIP ics2595
-SEE S3 864 (generic)
-
-NAME SPEA/V7 Mirage P64 with S3 Trio64
-SEE S3 Trio64 (generic)
-
-NAME Number Nine FX Vision 330
-SEE S3 Trio64 (generic)
-
-NAME Number Nine FX Motion 331
-SEE S3 Trio64V+ (generic)
-
-NAME ASUS Video Magic PCI V864
-SEE S3 864 (generic)
-
-NAME ASUS Video Magic PCI VT64
-SEE S3 Trio64 (generic)
-
-NAME VidTech FastMax P20
-SEE S3 864 (generic)
-
-NAME VideoLogic GrafixStar 500
-SEE S3 868 with SDAC (86C716)
-
-NAME VideoLogic GrafixStar 400
-SEE S3 Trio64V+ (generic)
-
-NAME VideoLogic GrafixStar 300
-SEE S3 Trio64 (generic)
-
-NAME 2 the Max MAXColor S3 Trio64V+
-SEE S3 Trio64V+ (generic)
-
-NAME DataExpert DSV3365
-SEE S3 Trio64V+ (generic)
-
-NAME ExpertColor DSV3365
-SEE S3 Trio64V+ (generic)
-
-NAME DSV3326
-SEE S3 Trio64V+ (generic)
-
-# S3 Trio64V2
-
-NAME S3 Trio64V2 (generic)
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 Trio64V2/DX (generic)
-SEE S3 Trio64V2 (generic)
-
-NAME S3 Trio64V2/GX (generic)
-SEE S3 Trio64V2 (generic)
-
-NAME S3 86C775 (generic)
-SEE S3 Trio64V2/DX (generic)
-
-NAME S3 86C785 (generic)
-SEE S3 Trio64V2/GX (generic)
-
-NAME ELSA WINNER 1000/T2D
-SEE S3 Trio64V2/DX (generic)
-
-
-# S3 Aurora64V+
-
-NAME S3 Aurora64V+ (generic)
-CHIPSET S3 Aurora64V+
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-LINE # Option "lcd_center"
-LINE # Set_LCDClk <pixel_clock_for_LCD>
-
-NAME S3 86CM65
-SEE S3 Aurora64V+ (generic)
-
-NAME SHARP 9080
-SEE S3 Aurora64V+ (generic)
-
-NAME SHARP 9090
-SEE S3 Aurora64V+ (generic)
-
-NAME COMPAQ Armada 7730MT
-SEE S3 Aurora64V+ (generic)
-
-NAME COMPAQ Armada 7380DMT
-SEE S3 Aurora64V+ (generic)
-
-
-# S3 964/968
-
-NAME S3 964 (generic)
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 86C964 (generic)
-SEE S3 964 (generic)
-
-NAME S3 Vision964 (generic)
-SEE S3 964 (generic)
-
-NAME S3 968 (generic)
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME S3 86C968 (generic)
-SEE S3 968 (generic)
-
-NAME S3 Vision968 (generic)
-SEE S3 968 (generic)
-
-NAME Number Nine GXE64 Pro
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC ti3025
-LINE Option "number_nine"
-
-NAME Diamond Stealth 64 VRAM
-CLOCKCHIP icd2061a
-LINE #Option "slow_vram"
-SEE S3 964 (generic)
-
-NAME Diamond Stealth64 Video 3200
-CHIPSET S3 968
-LINE #Option "slow_vram"
-SEE S3 968 (generic)
-
-NAME Diamond Stealth 64 Video VRAM (TI RAMDAC)
-CHIPSET S3 968
-LINE #Option "slow_vram"
-LINE #DacSpeed 220
-SEE S3 968 (generic)
-
-NAME Diamond Stealth64 Video 3240/3400 (TI RAMDAC)
-CHIPSET S3 968
-LINE #Option "slow_vram"
-LINE #DacSpeed 220
-SEE S3 968 (generic)
-
-NAME Diamond Stealth64 Video 3240/3400 (IBM RAMDAC)
-CHIPSET S3 968
-LINE #Option "slow_vram"
-RAMDAC ibm_rgb526
-LINE DacSpeed 220
-SEE S3 968 (generic)
-
-NAME Genoa VideoBlitz III AV
-CHIPSET S3 968
-LINE #s3RefClk 50
-LINE #DACspeed 170
-SEE S3 968 (generic)
-
-NAME STB Velocity 64 Video
-CHIPSET S3 968
-LINE #s3RefClk 24
-LINE #DACspeed 220
-SEE S3 968 (generic)
-
-NAME STB Powergraph 64 Video
-SEE S3 Trio64V+ (generic)
-
-NAME STB Powergraph 64
-SEE S3 Trio64 (generic)
-
-NAME ELSA Winner 1000TRIO
-SEE S3 Trio64 (generic)
-
-NAME ELSA Winner 1000TRIO/V
-SEE S3 Trio64V+ (generic)
-
-NAME Hercules Graphite Terminator 64
-LINE Option "slow_vram"
-LINE #s3RefClk 50
-LINE #DACspeed 170
-SEE S3 964 (generic)
-
-NAME Hercules Terminator 64/Video
-SEE S3 Trio64V+ (generic)
-
-NAME Hercules Graphite Terminator 64/DRAM
-SEE S3 Trio64 (generic)
-
-NAME Hercules Graphite Terminator Pro 64
-LINE #s3RefClk 16
-LINE #DACspeed 220
-SEE S3 968 (generic)
-
-NAME Number Nine FX Motion 771
-LINE #s3RefClk 16
-SEE S3 968 (generic)
-
-NAME Spider Tarantula 64
-SEE S3 964 (generic)
-
-NAME Miro Crystal 20SV
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-
-NAME Miro Crystal 40SV
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP ti3025
-
-NAME Miro Crystal 80SV
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Miro Video 20SV
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c505
-LINE #DacSpeed 150
-CLOCKCHIP ics9161a
-
-NAME SPEA Mercury 64
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP ics9161a
-LINE #Option "spea_mercury"
-
-NAME ELSA Winner 2000PRO-2
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "ELSA_w2000pro"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000PRO-4
-CHIPSET S3 964
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "ELSA_w2000pro"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000PRO/X-2
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000PRO/X-4
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000PRO/X-8
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000AVI
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME ELSA Gloria-4
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME ELSA Gloria-8
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Option "sync_on_green"
-NOCLOCKPROBE
-
-NAME VideoLogic GrafixStar 700
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME LeadTek WinFast S430
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME WinFast S430
-SEE LeadTek WinFast S430
-
-NAME LeadTek WinFast S510
-CHIPSET S3 968
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME WinFast S510
-SEE LeadTek WinFast S510
-
-# S3 928
-
-NAME S3 928 (generic)
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME S3 86C928 (generic)
-SEE S3 928 (generic)
-
-NAME Actix Ultra
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-LINE #Option "dac_8_bit"
-
-NAME Diamond Stealth Pro
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-LINE #Ramdac "att20c490" # The Diamond RAMDAC is reportedly compatible for 15bpp
-LINE #Option "no_linear" # Some VLB machines may require this
-
-NAME ELSA Winner 1000VL
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE # the following settings should be detected and set automatically by XF86_S3
-LINE # if the serial number of the ELSA card is printed correctly:
-LINE #ClockChip "icd2061a"
-LINE #Membase 0xf8000000
-
-NAME ELSA Winner 1000TwinBus
-SEE ELSA Winner 1000VL
-
-NAME ELSA Winner 2000
-SEE S3 928 (generic)
-
-NAME Miro Crystal 16S
-SEE S3 928 (generic)
-
-NAME SPEA/V7 Mercury
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP sc11412
-LINE Option "spea_mercury"
-
-NAME STB Pegasus
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-RAMDAC bt485
-CLOCKCHIP icd2061a
-LINE Option "stb_pegasus"
-LINE #Option "sync_on_green"
-
-NAME Number Nine GXE Level 14/16
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-DACSPEED 200
-CLOCKCHIP icd2061a
-LINE Option "number_nine"
-LINE #Option "nolinear"
-LINE #Option "nomemaccess"
-
-NAME Number Nine GXE Level 10/11/12
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-LINE Option "number_nine"
-
-NAME 928Movie
-CHIPSET S3 928
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2595
-RAMDAC bt485
-LINE # pixel multiplexing not supported
-
-# S3 911/924
-
-NAME S3 911/924 (generic)
-CHIPSET S3 911/924
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-
-NAME S3 86C911 (generic)
-SEE S3 911/924 (generic)
-
-NAME S3 86C924 (generic)
-SEE S3 911/924 (generic)
-
-NAME Diamond Stealth VRAM
-CHIPSET S3 911/924
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-CLOCKCHIP icd2061a
-
-#NAME Orchid Fahrenheit 1280
-#SEE S3 911/924 (generic)
-
-NAME S3 924 with SC1148 DAC
-CHIPSET S3 924
-SERVER S3
-DRIVER vga
-UNSUPPORTED
-LINE #Probable clocks:
-LINE #Clocks 25.2 28.3 39.7 1.7 49.9 76.7 35.7 44
-LINE #Clocks 130.2 119.5 79.4 31.2 110.0 65.2 74.9 71.3
-
-# S3 ViRGE,/DX,/GX and ViRGE/VX
-
-NAME S3 ViRGE (old S3V server)
-CHIPSET S3 ViRGE
-SERVER S3V
-DRIVER s3virge
-NOCLOCKPROBE
-
-NAME S3 ViRGE (generic)
-CHIPSET S3 ViRGE
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-NAME S3 ViRGE/DX (generic)
-CHIPSET S3 ViRGE/DX
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-NAME S3 ViRGE/GX (generic)
-CHIPSET S3 ViRGE/GX
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-
-NAME S3 ViRGE/GX2 (generic)
-CHIPSET S3 ViRGE/GX2
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-NAME S3 ViRGE/MX (generic)
-CHIPSET S3 ViRGE/MX
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "lcd_center"
-LINE #Set_LCDClk <pixel_clock_for_LCD>
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-NAME S3 ViRGE/MX+ (generic)
-SEE S3 ViRGE/MX (generic)
-
-
-
-
-NAME S3 86C325 (generic)
-SEE S3 ViRGE (generic)
-
-NAME S3 86C375 (generic)
-SEE S3 ViRGE/DX (generic)
-
-NAME S3 86C385 (generic)
-SEE S3 ViRGE/GX (generic)
-
-NAME S3 86C357 (generic)
-SEE S3 ViRGE/GX2 (generic)
-
-NAME S3 86C260 (generic)
-SEE S3 ViRGE/MX (generic)
-
-NAME S3 86C280 (generic)
-SEE S3 ViRGE/MX+ (generic)
-
-
-NAME ELSA Victory 3D
-SEE S3 ViRGE (generic)
-
-NAME ELSA Victory 3DX
-SEE S3 ViRGE/DX (generic)
-
-NAME ELSA Winner 3000-S
-SEE S3 ViRGE (generic)
-
-NAME Number Nine Visual 9FX Reality 332
-SEE S3 ViRGE (generic)
-
-NAME Number Nine FX Motion 332
-SEE S3 ViRGE (generic)
-
-NAME Diamond Stealth 3D 2000
-SEE S3 ViRGE (generic)
-
-NAME Diamond Stealth 3D 2000 PRO
-SEE S3 ViRGE/DX (generic)
-
-NAME Diamond Multimedia Stealth 3D 2000
-SEE S3 ViRGE (generic)
-
-NAME Diamond Multimedia Stealth 3D 2000 PRO
-SEE S3 ViRGE/DX (generic)
-
-NAME Canopus Co. Power Window 3DV
-SEE S3 ViRGE (generic)
-
-NAME DataExpert DSV3325
-SEE S3 ViRGE (generic)
-
-NAME ExpertColor DSV3325
-SEE S3 ViRGE (generic)
-
-NAME DSV3325
-SEE S3 ViRGE (generic)
-
-NAME Hercules Terminator 64/3D
-SEE S3 ViRGE (generic)
-
-NAME Hercules Terminator 3D/DX
-SEE S3 ViRGE/DX (generic)
-
-NAME LeadTek WinFast 3D S600
-SEE S3 ViRGE (generic)
-
-NAME WinFast 3D S600
-SEE LeadTek WinFast 3D S600
-
-NAME LeadTek WinFast 3D S680
-SEE S3 ViRGE/GX2 (generic)
-
-NAME Miro MiroMedia 3D
-SEE S3 ViRGE (generic)
-
-NAME Orchid Technology Fahrenheit Video 3D
-SEE S3 ViRGE (generic)
-
-NAME STB Systems Powergraph 3D
-SEE S3 ViRGE (generic)
-
-NAME STB Nitro 3D
-CHIPSET S3 ViRGE/GX
-SEE S3 ViRGE/GX (generic)
-
-NAME MELCO WGP-VG4S
-LINE #DACSpeed 191 162 111 83
-LINE #SetMClck 75
-SEE S3 ViRGE (generic)
-
-
-
-NAME S3 ViRGE/VX (generic)
-CHIPSET S3 ViRGE/VX
-SERVER SVGA
-DRIVER s3virge
-NOCLOCKPROBE
-LINE #Option "xaa_benchmark"
-LINE #Option "fifo_moderate"
-LINE #Option "pci_burst_on"
-LINE #Option "pci_retry"
-
-
-NAME S3 86C988 (generic)
-SEE S3 ViRGE/VX (generic)
-
-NAME ELSA Winner 3000
-SEE S3 ViRGE/VX (generic)
-
-NAME ELSA Winner 3000-M-22
-SEE S3 ViRGE/VX (generic)
-
-NAME ELSA Winner 3000-L-42
-SEE S3 ViRGE/VX (generic)
-
-NAME ELSA Winner 2000AVI/3D
-SEE S3 ViRGE/VX (generic)
-
-NAME Diamond Stealth 3D 3000
-SEE S3 ViRGE/VX (generic)
-
-NAME STB Systems Velocity 3D
-SEE S3 ViRGE/VX (generic)
-
-NAME MELCO WGP-VX8
-SEE S3 ViRGE/VX (generic)
-
-NAME Diamond Stealth 3D 4000
-SEE S3 ViRGE/GX2 (generic)
-
-NAME Toshiba Tecra 750CDT
-SEE S3 ViRGE/MX (generic)
-
-NAME Toshiba Tecra 750DVD
-SEE S3 ViRGE/MX (generic)
-
-NAME Toshiba Tecra 540CDT
-SEE S3 ViRGE/MX (generic)
-
-NAME Toshiba Tecra 550CDT
-SEE S3 ViRGE/MX (generic)
-
-# currently unsupported S3
-
-NAME S3 86C365 (Trio3D)
-SEE * Unsupported VGA compatible
-
-NAME S3 86C391 (Savage3D)
-SEE * Unsupported VGA compatible
-
-NAME S3 Trio3D
-SEE * Unsupported VGA compatible
-
-NAME S3 Savage3D
-SEE * Unsupported VGA compatible
-
-NAME S3 Savage4
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-# ET4000/ET6000
-
-NAME ET3000 (generic)
-CHIPSET ET3000
-SERVER SVGA
-DRIVER tseng
-
-NAME Genoa 5400
-SEE ET3000 (generic)
-
-NAME ET4000 (generic)
-CHIPSET ET4000
-SERVER SVGA
-DRIVER tseng
-
-NAME ET4000/W32 (generic)
-CHIPSET ET4000/W32
-SERVER W32
-DRIVER tseng
-
-NAME ET4000 W32i, W32p (generic)
-CHIPSET ET4000/W32(i/p)
-SERVER SVGA
-DRIVER tseng
-LINE #Option "linear" # for linear mode at 8bpp
-LINE #Option "noaccel" # when problems with accelerator
-LINE #Option "power_saver" # enable VESA DPMS
-LINE #Option "fast_dram"
-LINE #Option "pci_retry" # faster, but problematic for ISA DMA
-LINE #Option "hibit_high" # see README.tseng -- most cards need this
-LINE #Option "hibit_low" # see README.tseng -- mostly for older ET4000 cards
-LINE #MemBase 0x3C00000 # when automatic MemBase detection doesn't work
-LINE # -- see README.tseng for more (important) information on MemBase
-
-NAME ET6000 (generic)
-CHIPSET ET6000
-SERVER SVGA
-DRIVER tseng
-NOCLOCKPROBE
-LINE #videoram 2304 # 2.25 MB, when memory probe is incorrect
-LINE #Option "linear" # for linear mode at 8bpp
-LINE #Option "noaccel" # when problems with accelerator
-LINE #Option "power_saver" # enable VESA DPMS
-LINE #Option "pci_retry" # faster, but problematic for ISA DMA
-LINE #Option "hw_cursor" # Use hardware cursor (see docs for limitations)
-LINE #Option "xaa_no_color_exp" # When text (or bitmap) is not rendered correctly
-
-NAME ET6100 (generic)
-CHIPSET ET6100
-SEE ET6000 (generic)
-
-NAME Diamond Stealth 32
-CLOCKCHIP icd2061a
-NOCLOCKPROBE
-SEE ET4000 W32i, W32p (generic)
-
-NAME Cardex Cobra
-SEE ET4000 W32i, W32p (generic)
-
-NAME Cardex Challenger (Pro)
-SEE ET4000 W32i, W32p (generic)
-
-NAME Colorgraphic Dual Lightning
-SEE ET4000 W32i, W32p (generic)
-
-NAME Dell onboard ET4000
-SEE ET4000 (generic)
-
-NAME DFI-WG5000
-SEE ET4000 W32i, W32p (generic)
-
-NAME Diamond SpeedStar (Plus)
-SEE ET4000 (generic)
-
-NAME Diamond SpeedStar 24
-SEE ET4000 (generic)
-
-NAME Diamond SpeedStar HiColor
-SEE ET4000 (generic)
-
-NAME Genoa 8900 Phantom 32i
-SEE ET4000 W32i, W32p (generic)
-
-NAME Hercules Dynamite
-SEE ET4000/W32 (generic)
-
-NAME Hercules Dynamite Power
-SEE ET4000 W32i, W32p (generic)
-
-NAME Hercules Dynamite Pro
-SEE ET4000 W32i, W32p (generic)
-
-NAME Integral FlashPoint
-SEE ET4000 W32i, W32p (generic)
-
-NAME LeadTek WinFast S200
-SEE ET4000 W32i, W32p (generic)
-
-NAME Matrox Comet
-SEE ET4000 W32i, W32p (generic)
-
-NAME Matrox Marvel II
-SEE ET4000 W32i, W32p (generic)
-
-NAME Miro MiroVideo 20TD
-SEE ET4000 W32i, W32p (generic)
-
-NAME WinFast S200
-SEE LeadTek WinFast S200
-
-NAME Sigma Concorde
-SEE ET4000/W32 (generic)
-
-NAME Sigma Legend
-SEE ET4000 (generic)
-
-NAME SPEA/V7 ShowTime Plus
-SEE ET4000 W32i, W32p (generic)
-
-NAME STB LightSpeed
-SEE ET4000 W32i, W32p (generic)
-
-NAME STB MVP-2
-SEE ET4000 (generic)
-
-NAME STB MVP-2 PCI
-SEE ET4000 W32i, W32p (generic)
-
-NAME STB MVP-2X
-SEE ET4000 W32i, W32p (generic)
-
-NAME STB MVP-4 PCI
-SEE ET4000 W32i, W32p (generic)
-
-NAME STB MVP-4X
-SEE ET4000 W32i, W32p (generic)
-
-NAME TechWorks Thunderbolt
-SEE ET4000/W32 (generic)
-
-NAME ViewTop PCI
-SEE ET4000 W32i, W32p (generic)
-
-NAME SNI PC5H W32
-CLOCKCHIP stg1703
-NOCLOCKPROBE
-SEE ET4000 W32i, W32p (generic)
-
-NAME SNI Scenic W32
-CLOCKCHIP stg1703
-NOCLOCKPROBE
-SEE ET4000 W32i, W32p (generic)
-
-NAME Hercules Dynamite 128/Video
-SEE ET6000 (generic)
-
-NAME STB LightSpeed 128
-SEE ET6000 (generic)
-
-NAME VideoLogic GrafixStar 600
-SEE ET6000 (generic)
-
-NAME Jazz Multimedia G-Force 128
-SEE ET6000 (generic)
-
-NAME Mirage Z-128
-SEE ET6000 (generic)
-
-NAME California Graphics SunTracer 6000
-SEE ET6000 (generic)
-
-NAME Binar Graphics AnyView
-SEE ET6000 (generic)
-
-NAME MediaVision Proaxcel 128
-SEE ET6000 (generic)
-
-NAME ATrend ATC-2165A
-SEE ET6000 (generic)
-
-NAME Interay PMC Viper
-SEE ET6000 (generic)
-
-NAME 2-the-Max MAXColor 6000
-SEE ET6000 (generic)
-
-NAME Gainward Challenger EV
-SEE ET6000 (generic)
-
-NAME MachSpeed VGA ET6000
-SEE ET6000 (generic)
-
-NAME KouTech KeyVision 128 EV
-SEE ET6000 (generic)
-
-NAME Jaton Video-58P
-SEE ET6000 (generic)
-
-# ATI
-
-NAME ATI Rage 128
-CHIPSET ati
-SERVER SVGA
-DRIVER ati
-
-NAME ATI 8514 Ultra (no VGA)
-CHIPSET ati
-SERVER Mach8
-DRIVER vga
-UNSUPPORTED
-
-NAME ATI Graphics Ultra
-CHIPSET ati
-SERVER Mach8
-DRIVER ati
-
-NAME ATI Graphics Ultra Pro
-CHIPSET ati
-SERVER Mach32
-DRIVER ati
-
-NAME ATI Wonder SVGA
-CHIPSET ati
-SERVER SVGA
-DRIVER ati
-
-NAME ATI Ultra Plus
-CHIPSET ati
-SERVER Mach32
-DRIVER ati
-
-NAME ATI Mach32
-CHIPSET ati
-SERVER Mach32
-DRIVER ati
-
-NAME ATI Mach64
-CHIPSET ati
-SERVER Mach64
-DRIVER ati
-NOCLOCKPROBE
-
-NAME ATI Mach64 CT (264CT)
-SEE ATI Mach64
-
-NAME ATI Mach64 VT (264VT)
-SEE ATI Mach64
-
-NAME ATI Mach64 GT (264GT), aka 3D RAGE
-SEE ATI Mach64
-
-NAME ATI Mach64 3D RAGE II
-SEE ATI Mach64
-
-NAME ATI Mach64 3D RAGE II+DVD
-SEE ATI Mach64
-
-NAME ATI Mach64 3D Rage IIC
-SEE ATI Mach64
-
-NAME ATI Mach64 3D Rage Pro
-SEE ATI Mach64
-
-NAME ATI 3D Pro Turbo
-SEE ATI Mach64
-
-NAME ATI 3D Pro Turbo PC2TV
-SEE ATI Mach64
-
-NAME ATI 3D Xpression
-SEE ATI Mach64
-
-NAME ATI 3D Xpression+
-SEE ATI Mach64
-
-NAME ATI 3D Xpression+ PC2TV
-SEE ATI Mach64
-
-NAME ATI All-in-Wonder
-SEE ATI Mach64
-
-NAME ATI All-in-Wonder Pro
-SEE ATI Mach64
-
-NAME ATI Graphics Pro Turbo
-SEE ATI Mach64
-
-NAME ATI Graphics Pro Turbo 1600
-SEE ATI Mach64
-
-NAME ATI Graphics Xpression
-SEE ATI Mach64
-
-NAME ATI Video Boost
-SEE ATI Mach64
-
-NAME ATI Video Charger
-SEE ATI Mach64
-
-NAME ATI Video Xpression
-SEE ATI Mach64
-
-NAME ATI Video Xpression+
-SEE ATI Mach64
-
-NAME ATI WinBoost
-SEE ATI Mach64
-
-NAME ATI WinCharger
-SEE ATI Mach64
-
-NAME ATI WinTurbo
-SEE ATI Mach64
-
-NAME ATI Xpert 98
-SEE ATI Mach64
-
-NAME ATI Xpert XL
-SEE ATI Mach64
-
-NAME ATI Xpert@Play
-SEE ATI Mach64
-
-NAME ATI Xpert@Play 98
-SEE ATI Mach64
-
-NAME ATI Xpert@Work
-SEE ATI Mach64
-
-NAME ATI integrated on Intel Maui MU440EX motherboard
-SEE ATI Mach64
-
-NAME ASUS PCI-V264CT
-SEE ATI Mach64
-
-NAME ASUS PCI-AV264CT
-SEE ATI Mach64
-
-# AGX
-
-NAME AGX (generic)
-CHIPSET AGX-014/15/16
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-
-NAME Boca Vortex (Sierra RAMDAC)
-CHIPSET AGX-015
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc15025
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-
-NAME EIZO (VRAM)
-SEE AGX (generic)
-
-NAME Orchid Celsius (AT&T RAMDAC)
-CHIPSET AGX-015
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC att20c490
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-
-NAME Orchid Celsius (Sierra RAMDAC)
-CHIPSET AGX-015
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc15025
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-
-
-NAME Spider Black Widow
-CHIPSET AGX-015
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc15025
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-
-
-NAME Spider Black Widow Plus
-CHIPSET AGX-016
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC sc15025
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-LINE #Option "fifo_aggressive" # 3x bus bw - may result in random pixels
-LINE #Probable clocks:
-LINE #Clocks 25.2 28.3 39.9 72.2 50.0 76.9 36.1 44.8
-LINE #Clocks 89.0 119.8 79.9 31.5 110.0 64.9 74.9 94.9
-
-NAME Hercules Graphite HG210
-CHIPSET AGX-014
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-RAMDAC bt482
-DACSPEED 85
-LINE Chipset "AGX-014"
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Probable clocks:
-LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0
-LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0
-
-NAME Hercules Graphite Pro
-CHIPSET AGX-015
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-# Card specific DAC, doesn't appear in ramdac menu
-LINE Ramdac "herc_dual_dac"
-LINE Chipset "AGX-015"
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-LINE #Probable clocks:
-LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0
-LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0
-
-NAME Hercules Graphite Power
-CHIPSET AGX-016
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-# Card specific DAC, doesn't appear in ramdac menu
-# The glue logic state machine for RAMDAC switching doesn't work as
-# documented, for now we're stuck with the small RAMDAC
-LINE Ramdac "herc_small_dac"
-LINE Chipset "AGX-016"
-LINE Option "dac_8_bit"
-LINE Option "no_wait_state"
-LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels
-LINE #Option "fifo_aggressive" # 3x bus bw - may result in random pixels
-LINE #Probable clocks:
-LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0
-LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0
-
-NAME XGA-2 (ISA bus)
-CHIPSET XGA-2
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-LINE #Instance 7 # XGA instance 0-7
-LINE #COPbase 0xC8F00 # XGA memory-mapped register address
-LINE #POSbase 0 # Disable probing if above are specified
-
-NAME XGA-1 (ISA bus)
-CHIPSET XGA-1
-SERVER AGX
-DRIVER vga
-UNSUPPORTED
-LINE #Instance 7 # XGA instance 0-7
-LINE #COPbase 0xC8F00 # XGA memory-mapped register address
-LINE #POSbase 0 # Disable probing if above are specified
-
-# WD
-
-NAME Paradise/WD 90CXX
-CHIPSET WD90CXX
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME DFI-WG6000
-CHIPSET WD90C33
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Diamond SpeedStar 24X (not fully supported)
-CHIPSET WD90C31
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME WD 90C24 (laptop)
-CHIPSET WD90C24
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE #Chipset "wd90c24"
-LINE #Option "noaccel" # Use this if acceleration is causing problems
-LINE #Clocks 25.175 28.322 65 36 # These are not programmable
-LINE #Clocks 29.979 77.408 62.195 59.957 # These are programmable
-LINE #Clocks 31.5 35.501 75.166 50.114 # These are not programmable
-LINE #Clocks 39.822 72.038 44.744 80.092 # These are programmable
-LINE #Clocks 44.297 # Must match Mclk
-
-
-NAME WD 90C24A or 90C24A2 (laptop)
-CHIPSET WD90C24A
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE #Chipset "wd90c24"
-LINE #Clocks 25.175 28.322 65 36 # These are not programmable
-LINE #Clocks 29.979 77.408 62.195 59.957 # These are programmable
-LINE #Clocks 31.5 35.501 75.166 50.114 # These are not programmable
-LINE #Clocks 39.822 72.038 44.744 80.092 # These are programmable
-LINE #Clocks 44.297 # Must match Mclk
-
-# Avance Logic
-
-NAME Avance Logic 2101
-CHIPSET Avance Logic
-LINE #chipset "al2101"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Avance Logic 2228
-CHIPSET Avance Logic
-LINE #chipset "ali2228"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Avance Logic 2301
-CHIPSET Avance Logic
-LINE #chipset "ali2301"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Avance Logic 2302
-CHIPSET Avance Logic
-LINE #chipset "ali2302"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Avance Logic 2308
-CHIPSET Avance Logic
-LINE #chipset "ali2308"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Avance Logic 2401
-CHIPSET Avance Logic
-LINE #chipset "ali2401"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Hercules Stingray
-CHIPSET ALG-2228/2301/2302
-LINE #chipset "ali2228"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME SPEA/V7 Mirage VEGA Plus
-CHIPSET ALG-2228
-LINE #chipset "ali2228"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-# ARK Logic
-
-NAME Ark Logic ARK1000PV (generic)
-CHIPSET ARK1000PV
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-# For now, treat the VL as a PV. This may be changed later
-NAME Ark Logic ARK1000VL (generic)
-CHIPSET ARK1000VL
-LINE Chipset "ark1000pv"
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Ark Logic ARK2000PV (generic)
-CHIPSET ARK1000PV
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Ark Logic ARK2000MT (generic)
-CHIPSET ARK1000MT
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Hercules Stingray Pro
-SEE Ark Logic ARK1000PV (generic)
-
-NAME Hercules Stingray Pro/V
-SEE Ark Logic ARK1000PV (generic)
-
-NAME Ocean (octek) VL-VGA-1000
-RAMDAC att20c490
-SEE Ark Logic ARK1000VL (generic)
-
-NAME Hercules Stingray 64/V with ZoomDAC
-SEE Ark Logic ARK2000PV (generic)
-
-NAME Hercules Stingray 64/V with ICS5342
-CHIPSET ARK2000MT
-RAMDAC ics5342
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Diamond Stealth64 Graphics 2001 series
-CHIPSET ARK2000PV
-RAMDAC ics5342
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-# Oak
-
-NAME Oak ISA Card (generic)
-CHIPSET Oak OTI-067/77
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Oak 87 VLB (generic)
-CHIPSET Oak OTI-087
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE Option "fifo_aggressive" # Comment this if you experience streaks.
-LINE Option "no_wait" # Comment this if you find problems.
-LINE #Option "enable_bitblt" # You may enable this and see if it works (see README.Oak file)
-
-NAME Oak 87 ISA (generic)
-CHIPSET Oak OTI-087
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE Option "noaccel" # ISA cards seem to have Color Expansion support broken
-LINE #Option "enable_bitblt" # This should work on ISA, but lets not make it default just in case.
-
-NAME Paradise Accelerator Value
-SEE Oak 87 ISA (generic)
-
-# P9000
-
-NAME Diamond Viper VLB 2Mb
-CHIPSET Weitek 9000
-SERVER P9000
-DRIVER vga
-UNSUPPORTED
-LINE #Clocks must match the mode clocks (XFree86 3.1 P9000 server)
-LINE #Versions later than 3.1 do not require a clocks line
-LINE Chipset "vipervlb" # Required for some cards which autodetect as PCI
-LINE Videoram 2048 # Required
-LINE Membase 0x80000000 # Optional (0x80000000 is default)
-NOCLOCKPROBE
-
-NAME Diamond Viper PCI 2Mb
-CHIPSET Weitek 9000
-SERVER P9000
-DRIVER vga
-UNSUPPORTED
-LINE #Clocks must match the mode clocks (XFree86 3.1 P9000 server)
-LINE #Versions later than 3.1 do not require a clocks line
-LINE Videoram 2048 # Required
-LINE #Membase 0x80000000 # Use scanpci to get the correct Membase
-NOCLOCKPROBE
-
-NAME Orchid P9000 VLB
-CHIPSET Weitek 9000
-SERVER P9000
-DRIVER vga
-UNSUPPORTED
-LINE Chipset "orchid_p9000"
-LINE Membase 0xE0000000
-NOCLOCKPROBE
-
-# P9100
-
-NAME Weitek P9100 (generic)
-CHIPSET Weitek P9100
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME Diamond Viper Pro Video
-SEE Weitek P9100 (generic)
-
-# Trident
-
-NAME Trident 8900/9000 (generic)
-CHIPSET TVGA8900/9000
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Trident 8900D (generic)
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Trident TVGA9200CXr (generic)
-CHIPSET TVGA9200CXr
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-NAME Trident TGUI9400CXi (generic)
-CHIPSET TGUI9400CXi
-SERVER SVGA
-DRIVER trident
-
-NAME Trident TGUI9420DGi (generic)
-CHIPSET TGUI9420DGi
-SERVER SVGA
-DRIVER trident
-
-NAME Trident TGUI9430DGi (generic)
-CHIPSET TGUI9430DGi
-SERVER SVGA
-DRIVER trident
-
-NAME Trident TGUI9420 (generic)
-CHIPSET TGUI9420
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TGUI9440 (generic)
-CHIPSET TGUI9440
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TGUI9660 (generic)
-CHIPSET TGUI9660
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TGUI9680 (generic)
-CHIPSET TGUI9680
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TGUI9682 (generic)
-CHIPSET TGUI9682
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TGUI9685 (generic)
-CHIPSET TGUI9685
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9320 (generic)
-CHIPSET Cyber9320
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9382 (generic)
-CHIPSET Cyber9382
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9385 (generic)
-CHIPSET Cyber9385
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9388 (generic)
-CHIPSET Cyber9388
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 939a (generic)
-CHIPSET Cyber939a
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9397 (generic)
-CHIPSET Cyber9397
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Cyber 9520 (generic)
-CHIPSET Cyber9520
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident 3DImage975 (generic)
-CHIPSET 3dimage975
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident 3DImage975 AGP (generic)
-CHIPSET 3dimage975
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident 3DImage985 (generic)
-CHIPSET 3dimage985
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Providia 9682 (generic)
-CHIPSET Providia9682
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Providia 9685 (generic)
-CHIPSET Providia9685
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident TVGA 8800BR
-SEE * Generic VGA compatible
-
-NAME Trident TVGA 8800CS
-SEE * Generic VGA compatible
-
-NAME Trident CyberBlade (generic)
-CHIPSET CyberBlade
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-NAME Trident Blade3D (generic)
-CHIPSET Blade3D
-SERVER SVGA
-DRIVER trident
-NOCLOCKPROBE
-
-# SiS
-
-NAME SiS 530
-CHIPSET SIS530
-SERVER SVGA
-DRIVER sis
-
-NAME SiS 620
-CHIPSET SIS620
-SERVER SVGA
-DRIVER sis
-
-NAME SiS SG86C201
-CHIPSET SIS86C201
-SERVER SVGA
-DRIVER sis
-
-NAME SiS SG86C205
-CHIPSET SIS86C205
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-NOCLOCKPROBE
-
-NAME SiS SG86C215
-CHIPSET SIS86C215
-SERVER SVGA
-DRIVER sis
-LINE # This is a cheap version of 86c205. I am not sure if acceleration works
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "no_BitBlt" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-NOCLOCKPROBE
-
-NAME SiS SG86C225
-CHIPSET SIS86C225
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-NOCLOCKPROBE
-
-NAME SiS 5597
-CHIPSET SiS5597
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-LINE # Option "fast_vram"
-LINE # Option "pci_burst_on"
-LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!!
-LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing
-LINE # errors, but gives some accel
-NOCLOCKPROBE
-
-NAME SiS 5598
-CHIPSET SIS5598
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-LINE # Option "fast_vram"
-LINE # Option "pci_burst_on"
-LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!!
-LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing
-LINE # errors, but gives some accel
-NOCLOCKPROBE
-
-NAME SiS 6326
-CHIPSET SiS6326
-SERVER SVGA
-DRIVER sis
-LINE # Option "no_accel" # Use this if acceleration is causing problems
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conserv"
-LINE # Option "fifo_aggressive"
-LINE # Option "fast_vram"
-LINE # Option "pci_burst_on"
-LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!!
-LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing
-LINE # errors, but gives some accel
-NOCLOCKPROBE
-
-NAME MSI MS-4417
-SEE SiS 6326
-
-NAME SiS 3D PRO AGP
-SEE SiS 6326
-
-NAME Miro Crystal DVD
-SEE SiS 6326
-
-NAME PC-Chips M567 Mainboard
-SEE SiS 5597
-
-NAME Diamond SpeedStar A50
-SEE SiS 6326
-
-# Cyrix
-
-NAME MediaGX
-CHIPSET mediagx
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-# Alliance ProMotion
-
-NAME Alliance ProMotion 6422
-CHIPSET AP6422
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-
-# Number 9 I128
-
-NAME Number Nine Imagine I-128
-CHIPSET I128
-SERVER I128
-DRIVER i128
-NOCLOCKPROBE
-
-NAME Number Nine Imagine I-128 Series 2
-CHIPSET I128
-SERVER I128
-DRIVER i128
-NOCLOCKPROBE
-
-NAME Number Nine Revolution 3D (T2R)
-CHIPSET I128
-SERVER I128
-DRIVER i128
-NOCLOCKPROBE
-
-NAME Number Nine Imagine-128 Revolution IV (T2R4)
-CHIPSET I128
-SERVER I128
-DRIVER i128
-NOCLOCKPROBE
-
-# Matrox
-
-NAME Matrox Millennium 2MB
-CHIPSET mga2064w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 2048
-NOCLOCKPROBE
-
-NAME Matrox Millennium 4MB
-CHIPSET mga2064w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-NOCLOCKPROBE
-
-NAME Matrox Millennium 8MB
-CHIPSET mga2064w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-NOCLOCKPROBE
-
-NAME Matrox Millennium II 4MB
-CHIPSET mga2164w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-NOCLOCKPROBE
-
-NAME Matrox Millennium II 8MB
-CHIPSET mga2164w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-NOCLOCKPROBE
-
-NAME Matrox Millennium II 16MB
-CHIPSET mga2164w
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 16384
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 4MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 8MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 16MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 16384
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 SD 4MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-LINE # Option "mga_sdram"
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 SD 8MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-LINE # Option "mga_sdram"
-NOCLOCKPROBE
-
-NAME Matrox Millennium G200 SD 16MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 16384
-LINE # Option "mga_sdram"
-NOCLOCKPROBE
-
-NAME Matrox Mystique
-CHIPSET mga1064sg
-SERVER SVGA
-DRIVER mga
-NOCLOCKPROBE
-
-NAME Matrox Mystique G200 4MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-NOCLOCKPROBE
-
-NAME Matrox Mystique G200 8MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-NOCLOCKPROBE
-
-NAME Matrox Millennium G400
-CHIPSET mgag400
-SERVER SVGA
-DRIVER mga
-NOCLOCKPROBE
-
-NAME Matrox Mystique G200 16MB
-CHIPSET mgag200
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 16384
-NOCLOCKPROBE
-
-NAME Matrox Productiva G100 4MB
-CHIPSET mgag100
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 4096
-NOCLOCKPROBE
-
-NAME Matrox Productiva G100 8MB
-CHIPSET mgag100
-SERVER SVGA
-DRIVER mga
-LINE VideoRam 8192
-NOCLOCKPROBE
-
-# NVIDIA
-
-NAME Diamond Edge 3D
-CHIPSET nv1
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-NOCLOCKPROBE
-
-NAME RIVA128
-CHIPSET RIVA128
-SERVER SVGA
-DRIVER nv
-NOCLOCKPROBE
-
-NAME RIVA TNT
-CHIPSET RIVATNT
-SERVER SVGA
-DRIVER nv
-NOCLOCKPROBE
-
-NAME RIVA TNT2
-CHIPSET RIVATNT2
-SERVER SVGA
-DRIVER nv
-NOCLOCKPROBE
-
-NAME NVIDIA GeForce
-CHIPSET GeForce
-SERVER SVGA
-DRIVER nv
-NOCLOCKPROBE
-
-NAME ELSA VICTORY ERAZOR
-SEE RIVA128
-
-NAME ELSA Winner 1000 R3D
-SEE RIVA128
-
-NAME ELSA ERAZOR II
-SEE RIVA TNT
-
-NAME Diamond Viper 330
-SEE RIVA128
-
-NAME Diamond Viper 550
-SEE RIVA TNT
-
-NAME Diamond Viper 770
-SEE RIVA TNT2
-
-NAME STB Velocity 128
-SEE RIVA128
-
-NAME STB nvidia 128
-SEE RIVA128
-
-NAME STB Velocity 4400
-SEE RIVA TNT
-
-NAME ASUS 3Dexplorer
-SEE RIVA128
-
-NAME Guillemot Maxi Gamer Xentor
-SEE RIVA TNT2
-
-NAME Guillemot Maxi Gamer Xentor 32
-SEE RIVA TNT2
-
-NAME Creative Graphics Blaster TNT
-SEE RIVA TNT
-
-NAME Creative Graphics Blaster TNT2
-SEE RIVA TNT2
-
-# 3Dfx
-NAME Voodoo Banshee (generic)
-SERVER SVGA
-CHIPSET Voodo Banshee
-DRIVER tdfx
-
-NAME Voodoo3 (generic)
-SERVER SVGA
-CHIPSET Voodoo3
-DRIVER tdfx
-
-NAME Elsa Victory II
-SEE Voodoo Banshee (generic)
-
-NAME Diamond Monster Fusion
-SEE Voodoo Banshee (generic)
-
-NAME AOpen PA2010
-SEE Voodoo Banshee (generic)
-
-NAME Chaintech Desperado 3F10
-SEE Voodoo Banshee (generic)
-
-# 3DLabs
-
-NAME ELSA GLoria-L/MX
-CHIPSET GLINT MX
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME ELSA GLoria-L
-CHIPSET GLINT 500TX
-SERVER 3DLabs
-DRIVER glint
-NOCLOCKPROBE
-
-NAME ELSA GLoria-XL
-CHIPSET GLINT MX
-SERVER 3DLabs
-DRIVER glint
-NOCLOCKPROBE
-
-NAME Diamond Fire GL 3000
-CHIPSET GLINT 500TX
-SERVER 3DLabs
-DRIVER glint
-LINE Option "firegl_3000"
-NOCLOCKPROBE
-
-NAME ELSA GLoria-S
-CHIPSET PERMEDIA
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-LINE #VideoRam 8192
-NOCLOCKPROBE
-
-NAME Diamond Fire GL 1000
-CHIPSET PERMEDIA
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-LINE #VideoRam 8192
-NOCLOCKPROBE
-
-NAME ELSA GLoria Synergy
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME ELSA Winner 2000/Office
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME Diamond Fire GL 1000 PRO
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME Creative Blaster Exxtreme
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME AccelStar Permedia II AGP
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME Leadtek WinFast 2300
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-NOCLOCKPROBE
-
-NAME 3DLabs Oxygen GMX
-CHIPSET PERMEDIA 2
-SERVER 3DLabs
-DRIVER glint
-LINE #Option "no_accel"
-NOCLOCKPROBE
-
-NAME Appian Jeronimo 2000
-CHIPSET PERMEDIA 3
-SERVER XFree86
-DRIVER glint
-NOCLOCKPROBE
-
-# Alliance Semiconductor
-
-NAME Diamond Stealth Video 2500
-CHIPSET Alliance AT24
-SERVER SVGA
-DRIVER apm
-NOCLOCKPROBE
-
-NAME AT3D
-CHIPSET Alliance AT3D
-SERVER SVGA
-DRIVER apm
-NOCLOCKPROBE
-LINE #Option "no_accel"
-
-NAME AT25
-SEE AT3D
-
-NAME Hercules Stingray 128 3D
-SEE AT3D
-
-# NeoMagic
-
-NAME NeoMagic (laptop/notebook)
-CHIPSET MagicGraph 128 series
-SERVER SVGA
-DRIVER neomagic
-LINE # Chipset "NM2160"
-LINE # IOBase 0xfea00000
-LINE # MemBase 0xfd000000
-LINE # VideoRam 2048
-LINE # DacSpeed 90
-LINE # Option "linear"
-LINE # Option "nolinear"
-LINE # Option "sw_cursor"
-LINE # Option "hw_cursor"
-LINE # Option "no_accel"
-LINE # Option "intern_disp"
-LINE # Option "extern_disp"
-LINE # Option "mmio"
-LINE # Option "no_mmio"
-LINE # Option "lcd_center"
-LINE # Option "no_stretch"
-
-# Epson SPC8110
-
-NAME EPSON SPC8110 (CardPC)
-CHIPSET SPC8110
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE # Chipset "spc8110"
-LINE # MemBase 0x03e00000
-LINE # VideoRam 1024
-LINE # Option "nolinear"
-LINE # Option "sw_cursor"
-LINE # Option "noaccel"
-LINE # Option "fifo_moderate"
-LINE # Option "fifo_conservative"
-
-# Silicon Motion, Inc.
-
-NAME Silicon Motion Lynx family
-CHIPSET Lynx
-SERVER SVGA
-DRIVER siliconmotion
-NOCLOCKPROBE
-
-# Rendition
-
-NAME Rendition Verite 1000
-CHIPSET Verite 1000
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE # Option "sw_cursor"
-
-NAME Rendition Verite 2x00
-CHIPSET Verite 2x00
-SERVER SVGA
-DRIVER vga
-UNSUPPORTED
-LINE # Option "sw_cursor"
-
-NAME Creative Labs 3D Blaster PCI (Verite 1000)
-SEE Rendition Verite 1000
-
-NAME Canopus Total-3D
-SEE Rendition Verite 1000
-
-NAME Sierra Screaming 3D
-SEE Rendition Verite 1000
-
-NAME Miro CRYSTAL VRX
-SEE Rendition Verite 1000
-
-NAME Diamond Stealth II S220
-CHIPSET Verite 2100
-SEE Rendition Verite 2x00
-
-NAME Hercules Thriller3D
-CHIPSET Verite 2200
-SEE Rendition Verite 2x00
-
-# Digital
-
-NAME Digital 8-plane TGA (UDB/Multia)
-CHIPSET TGA
-SERVER TGA
-DRIVER tga
-RAMDAC Bt485
-
-NAME Digital 8-plane TGA (ZLXp-E1)
-CHIPSET TGA
-SERVER TGA
-DRIVER tga
-RAMDAC Bt485
-
-NAME Digital 24-plane TGA (ZLXp-E2)
-CHIPSET TGA
-SERVER TGA
-DRIVER tga
-RAMDAC Bt463
-
-NAME Digital 24-plane+3D TGA (ZLXp-E3)
-CHIPSET TGA
-SERVER TGA
-DRIVER tga
-RAMDAC Bt463
-
-# i810
-
-NAME Intel 810
-SERVER SVGA
-DRIVER i810
-
-# i740
-
-NAME Intel 740 (generic)
-SERVER SVGA
-DRIVER i740
-
-# Misc
-
-END
diff --git a/hw/xfree86/utils/xorgconfig/Cards98 b/hw/xfree86/utils/xorgconfig/Cards98
deleted file mode 100644
index cfd96dc16..000000000
--- a/hw/xfree86/utils/xorgconfig/Cards98
+++ /dev/null
@@ -1,647 +0,0 @@
-# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards98,v 1.1 1999/07/11 10:50:41 dawes Exp $
-#
-#
-#
-# $XConsortium: Cards /main/27 1996/10/28 05:43:53 kaleb $
-# This is the database of card definitions used by xf86config.
-# Each definition should have a NAME entry, CHIPSET (descriptive) and
-# SERVER (one of EGC, GANBWAP, PEGC, NKVNEC, WABS, WABEP, WSNA, TGUI,
-# MGA, SVGA, NECS3, PWSKB, PWLB, GA968).
-# A reference to another definition is made with SEE (already defined
-# entries are not overridden).
-# Optional entries are RAMDAC (identifier), CLOCKCHIP (identifier),
-# DACSPEED, NOCLOCKPROBE (advises never to probe clocks), UNSUPPORTED
-# (indicates card that is not yet properly supported by a dedicated
-# server). A LINE entry adds a line of text to be included in the
-# Device section (can include options or comments).
-# There's no CLOCKS option (although a Clocks line can be included
-# with LINE), as it is very undesirable to have a Clocks line that
-# is incorrect. The idea is that the Clocks are probed for to be
-# sure (a commented suggested Clocks line can be included).
-#
-# The majority of entries are just a binding of a model name to a
-# chipset/server and untested.
-#
-
-# EGC
-
-NAME EGC16
-CHIPSET EGC
-SERVER EGC
-LINE Chipset "vga"
-
-# PEGC
-
-NAME PEGC
-CHIPSET PEGC
-SERVER PEGC
-LINE VideoRam 512
-LINE Clocks 31.5
-LINE # Virtual resolution for 640x400
-LINE # Clocks 28.322
-
-# GANBWAP
-
-NAME GA-98NBI
-CHIPSET CL-GD5434
-SERVER GANBWAP
-LINE ClockChip "cirrus"
-LINE Option "ga98nb1"
-LINE Option "no_mmio"
-LINE # Option "sw_cursor"
-
-NAME GA-98NBII
-CHIPSET CL-GD5434
-SERVER GANBWAP
-LINE ClockChip "cirrus"
-LINE Option "ga98nb2"
-LINE Option "no_mmio"
-LINE # Option "sw_cursor"
-
-NAME GA-98NBIV
-CHIPSET CL-GD5434
-SERVER GANBWAP
-LINE ClockChip "cirrus"
-LINE Option "ga98nb4"
-LINE Option "no_mmio"
-LINE # Option "sw_cursor"
-
-NAME WAP-2000/4000
-CHIPSET CL-GD5434
-SERVER GANBWAP
-LINE Option "wap"
-LINE Option "no_mmio"
-LINE # Option "epsonmemwin"
-
-# NKVNEC
-
-NAME PCNKV/PCNKV2/NEC_CIRRUS
-CHIPSET CL-GD5428/5429/5430
-SERVER NKVNEC
-LINE # Option "fast_dram"
-LINE VideoRam 1024
-
-NAME PC9821Bf/U8W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Bp/U8W/U7W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Bs/U7W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Be/U7W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821BA3/U2/W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821BX3/U2/W
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821BX4/U2
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cb
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Ce
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cf
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Ce2
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cs
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cs2
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cx
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Cx2
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Es
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Nd
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Ne2
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Nf
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Np
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Ns
-LINE Option "nec_cirrus"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V7/C
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V10/C,S
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V12/S
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V13/S
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V16/S
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V16/S5V,P
-LINE Chipset "clgd5446"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821V20/S7
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xb10
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xc13/S5
-LINE Chipset "clgd5446"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xc16/M,S
-LINE Chipset "clgd5446"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xc200/M,S
-LINE Chipset "clgd5446"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xa7e
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xe
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC9821Xe10
-LINE Chipset "clgd5430"
-LINE Option "nec_cirrus"
-LINE Option "no_mmio"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC486MR
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC486MS
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC486MU
-LINE Chipset "clgd5429"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC486MV
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC586MV
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-NAME PC586RV
-LINE Chipset "clgd5429"
-SEE PCNKV/PCNKV2/NEC_CIRRUS
-
-# WABS
-
-NAME WAB-S
-CHIPSET CL-GD5426/5428
-SERVER WABS
-LINE VideoRam 1024
-LINE # VideoRam 2048
-
-NAME WAB-1000/2000
-CHIPSET CL-GD5428
-SERVER WABS
-LINE VideoRam 1024
-LINE # VideoRam 2048
-
-NAME WSR-E/G
-SEE WAB-1000/2000
-
-# WABEP
-
-NAME WAB-EP
-CHIPSET CL-GD5428
-SERVER WABEP
-LINE Option "med_dram"
-
-# WSNA
-
-NAME WSN-A2F
-CHIPSET CL-GD5434
-SERVER WSNA
-LINE Option "no_mmio"
-LINE Option "med_dram"
-
-# TGUI
-
-NAME NEC Trident
-CHIPSET TGUI9680/9682
-SERVER TGUI
-LINE Option "xaa_no_color_exp"
-LINE # Option "noaccel"
-LINE # Option "Linear"
-LINE # Option "med_dram"
-LINE # Option "hw_cursor"
-
-NAME PC9821Ra20/N
-SEE NEC Trident
-
-NAME PC9821RaII23/N,W
-SEE NEC Trident
-
-NAME PC9821Ra266/N,W
-SEE NEC Trident
-
-NAME PC9821Rs20/B20
-SEE NEC Trident
-
-NAME PC9821RsII26/B40
-SEE NEC Trident
-
-NAME PC9821V13/M7
-SEE NEC Trident
-
-NAME PC9821V16/M7
-SEE NEC Trident
-
-NAME PC9821V20/M7
-SEE NEC Trident
-
-NAME PC9821Xa7/C,K
-SEE NEC Trident
-
-NAME PC9821Xa9/C,K
-SEE NEC Trident
-
-NAME PC9821Xa10/C,K
-SEE NEC Trident
-
-NAME PC9821Xa12/C,K
-SEE NEC Trident
-
-NAME PC9821Xa13/C,K,W
-SEE NEC Trident
-
-NAME PC9821Xa16/R,W
-SEE NEC Trident
-
-NAME PC9821Xa20/W
-SEE NEC Trident
-
-NAME PC9821Xc13/M,S
-SEE NEC Trident
-
-NAME PC9821Xv13/R
-SEE NEC Trident
-
-NAME GA-DRV/98
-CHIPSET TGUI9680
-SERVER TGUI
-LINE Option "noaccel"
-LINE # Option "med_dram"
-LINE # Option "hw_cursor"
-
-# MGA
-
-NAME MGA Millennium
-CHIPSET MGA2064W
-SERVER MGA
-
-NAME PC9821Xt13
-SEE MGA Millennium
-
-NAME PC9821Xt16
-SEE MGA Millennium
-
-NAME PC9821Xv13/W
-SEE MGA Millennium
-
-NAME PC9821Xv20/W
-SEE MGA Millennium
-
-NAME PC9821St15
-SEE MGA Millennium
-
-NAME PC9821St20
-SEE MGA Millennium
-
-NAME PC9821RvII26/N20
-SEE MGA Millennium
-
-NAME NEC FC-WAB-X2
-SEE MGA Millennium
-
-NAME MGA Mystique
-CHIPSET MGA1064SG
-SERVER MGA
-
-NAME PC9821V166/S
-LINE VideoRam 2048
-SEE MGA Mystique
-
-NAME PC9821V200/S
-LINE VideoRam 2048
-SEE MGA Mystique
-
-NAME PC9821V200/M
-LINE VideoRam 4096
-SEE MGA Mystique
-
-NAME PC9821V233/M7
-LINE VideoRam 2048
-SEE MGA Mystique
-
-NAME PC9821V233/M7V
-LINE VideoRam 4096
-SEE MGA Mystique
-
-# SVGA
-
-NAME NEC Cirrus 755x
-CHIPSET CL-GD7555
-LINE Chipset "clgd7555"
-LINE # VideoRam 2048
-LINE # Option "no_bitblt"
-LINE # Option "fast_dram"
-LINE Option "linear"
-LINE Option "noaccel"
-SERVER SVGA
-
-NAME PC9821Nr12
-SEE NEC Cirrus 755x
-
-NAME PC9821Nr13
-SEE NEC Cirrus 755x
-
-NAME PC9821La13
-SEE NEC Cirrus 755x
-
-NAME PC9821Ls12
-SEE NEC Cirrus 755x
-
-NAME PC9821Ls13
-SEE NEC Cirrus 755x
-
-NAME PC9821Ls150
-SEE NEC Cirrus 755x
-
-# NECS3
-
-NAME NEC WAB-A/B
-CHIPSET S3 928
-SERVER NECS3
-LINE Chipset "s3_generic"
-LINE Dacspeed 110
-LINE Ramdac "sc15025"
-LINE Option "dac_8_bit"
-LINE # Option "necwab"
-LINE # Option "nomemaccess"
-LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
-LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
-
-NAME NEC FC-WAB-A/B
-CHIPSET S3 928
-SERVER NECS3
-LINE Chipset "s3_generic"
-LINE Dacspeed 110
-LINE Ramdac "bt485"
-LINE Option "necwab"
-LINE Option "nomemaccess"
-LINE Option "noinit"
-LINE Option "nolinear"
-LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
-LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
-
-NAME PC9821Af/U9W E09?
-SEE NEC WAB-A/B
-
-NAME PC9821An/U8W
-SEE NEC WAB-A/B
-
-NAME PC9821Ap2/U8W/C9W
-SEE NEC WAB-A/B
-
-NAME PC9821As2/U7W/U8W
-SEE NEC WAB-A/B
-
-NAME NEC 864
-CHIPSET S3 864
-SERVER NECS3
-LINE Chipset "s3_generic"
-LINE Option "necwab"
-LINE Ramdac "s3_sdac"
-LINE ClockChip "s3_sdac"
-
-NAME PC9821Ap3
-SEE NEC 864
-
-NAME PC9821As3
-SEE NEC 864
-
-NAME PC9821Xp
-SEE NEC 864
-
-NAME PC9821Xs
-SEE NEC 864
-
-# PWSKB
-
-NAME PowerWindow 928/801
-CHIPSET S3 928
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE Ramdac "sc15025"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "epsonmemwin"
-LINE # Option "nomemaccess"
-LINE ClockChip "icd2061a"
-
-NAME PowerWindow 928II
-CHIPSET S3 928
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE Ramdac "att20c505"
-LINE # Ramdac "bt485"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "pw_mux"
-LINE Option "bt485_curs"
-LINE # Option "epsonmemwin"
-LINE # Option "nomemaccess"
-LINE ClockChip "icd2061a"
-
-NAME PowerWindow 805i
-CHIPSET S3 805
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE Ramdac "s3gendac"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "pw805i"
-LINE # Option "epsonmemwin"
-LINE # Option "nomemaccess"
-LINE ClockChip "s3_sdac"
-
-NAME PowerWindow 928G
-CHIPSET S3 928
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE Ramdac "sc15025"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "nomemaccess"
-LINE # Option "nolinear"
-LINE ClockChip "icd2061a"
-
-NAME PCSKB/PCSKB2
-CHIPSET S3 911/924
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE Ramdac "sc15025"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "nomemaccess"
-LINE Option "pcskb"
-LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
-LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
-
-NAME PCSKB3/PCSKB4/PCPKB4
-CHIPSET S3 928
-SERVER PWSKB
-LINE Chipset "s3_generic"
-LINE Ramdac "sc15025"
-LINE # Ramdac "att20c498"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE Option "nomemaccess"
-LINE Option "pcskb4"
-LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
-LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
-
-# PWLB
-
-NAME PowerWindow 928GLB
-CHIPSET S3 928
-SERVER PWLB
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE Ramdac "sc15025"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE # Option "pw_localbus"
-LINE # Option "nomemaccess"
-LINE # Option "nolinear"
-LINE ClockChip "icd2061a"
-
-NAME PowerWindow 928IILB
-CHIPSET S3 928
-SERVER PWLB
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE Ramdac "att20c505"
-LINE # Ramdac "bt485"
-LINE Dacspeed 110
-LINE Option "dac_8_bit"
-LINE Option "bt485_curs"
-LINE Option "pw_localbus"
-LINE # Option "pw_mux"
-LINE # Option "nomemaccess"
-LINE # Option "nolinear"
-LINE ClockChip "icd2061a"
-
-NAME PowerWindow 964LB
-CHIPSET S3 964
-SERVER PWLB
-LINE Chipset "s3_generic"
-LINE Option "pw_localbus"
-LINE Option "number_nine"
-LINE Ramdac "ti3025"
-LINE ClockChip "ti3025"
-LINE VideoRam 4096
-
-# GA968
-
-NAME GA-968V4/PCI
-CHIPSET S3 968
-SERVER GA968
-LINE Chipset "s3_generic"
-LINE # Chipset "mmio_928"
-LINE VideoRam 4096
diff --git a/hw/xfree86/utils/xorgconfig/cards.c b/hw/xfree86/utils/xorgconfig/cards.c
deleted file mode 100644
index 8aac06606..000000000
--- a/hw/xfree86/utils/xorgconfig/cards.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* $XConsortium: cards.c /main/9 1996/10/19 18:15:32 kaleb $ */
-
-
-
-
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/cards.c,v 3.17 2002/05/31 18:46:04 dawes Exp $ */
-
-/*
- * Functions to manipulate card database.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "cards.h"
-
-/*
- * Database format:
- *
- * NAME <name of card>
- * CHIPSET <chipset description>
- * SERVER <server name>
- * DRIVER <driver name>
- *
- * Optional keywords:
- * RAMDAC <ramdac identifier>
- * CLOCKCHIP <clockchip identifier>
- * DACSPEED <dacspeed>
- * NOCLOCKPROBE
- * UNSUPPORTED
- *
- * SEE <name of card> refers to another card definition; parameters that
- * are already defined are not overridden.
- *
- * <server name> is one of Mono, VGA16, SVGA, S3, Mach32, Mach8, 8514,
- * P9000, AGX, W32.
- *
- * A useful additional keywords may be CLOCKS.
- */
-
-
-
-/* Database vars. */
-
-int lastcard;
-
-Card card[MAX_CARDS];
-
-
-static int
-getnextline(FILE *f, char *l)
-{
- if (fgets(l, 128, f) == NULL)
- return -1;
-#ifdef __UNIXOS2__
- {
- char *p = strchr(l,'\r');
- if (p) {
- *p = '\n';
- *(p+1) = '\0';
- }
- }
-#endif
- return 0;
-}
-
-static void
-appendstring(char **destp, char *src)
-{
- char *newstr;
- newstr = malloc(strlen(*destp) + strlen(src) + 1);
- strcpy(newstr, *destp);
- strcat(newstr, src);
- if (strlen(*destp) > 0)
- free(*destp);
- *destp = newstr;
-}
-
-int
-lookupcard(char *name) {
- int i;
- for (i = 0; i <= lastcard; i++)
- if (strcmp(name, card[i].name) == 0)
- return i;
- return -1;
-}
-
-static char *s3_comment =
-"# Use Option \"nolinear\" if the server doesn't start up correctly\n"
-"# (this avoids the linear framebuffer probe). If that fails try\n"
-"# option \"nomemaccess\".\n"
-"#\n"
-"# Refer to /usr/X11R6/lib/doc/README.S3, and the XF86_S3 man page.\n";
-
-static char *cirrus_comment =
-"# Use Option \"no_bitblt\" if you have graphics problems. If that fails\n"
-"# try Option \"noaccel\".\n"
-"# Refer to /usr/X11R6/lib/doc/README.cirrus.\n"
-"# To allow linear addressing, uncomment the Option line and the\n"
-"# address that the card maps the framebuffer to.\n";
-
-int parse_database() {
- FILE *f;
- char buf[128];
- int i, lineno;
- char filename[128];
-
-#ifndef __UNIXOS2__
- strcpy(filename, CARD_DATABASE_FILE);
-#else
- strcpy(filename, (char*)__XOS2RedirRoot(CARD_DATABASE_FILE));
-#endif
- f = fopen(filename, "r");
- if (f == NULL)
- return -1;
-
- lastcard = -1;
- lineno = 0;
-
- for (;;) {
- if (getnextline(f, buf))
- break;
- lineno++;
- if (buf[0] == '#')
- /* Comment. */
- continue;
- if (strncmp(buf, "END", 3) == 0)
- /* End of database. */
- break;
- if (strncmp(buf, "LINE", 4) == 0 && lastcard>=0) {
- /* Line of Device comment. */
- /* Append to existing lines. */
- appendstring(&card[lastcard].lines, buf + 5);
- continue;
- }
- /*
- * The following keywords require the trailing newline
- * to be deleted.
- */
- i = strlen(buf);
- buf[--i] = '\0';
-
- /* remove trailing spaces or tabs */
- for(--i; i>=0 && (buf[i] == ' ' || buf[i] == '\011'); i--) ;
- if (i>=0)
- buf[i+1] = '\0';
- else
- continue; /* skip empty lines */
-
- if (strncmp(buf, "NAME", 4) == 0) {
- /* New entry. */
- lastcard++;
- card[lastcard].name = malloc(strlen(buf + 5) + 1);
- strcpy(card[lastcard].name, buf + 5);
- card[lastcard].chipset = NULL;
- card[lastcard].server = NULL;
- card[lastcard].driver = NULL;
- card[lastcard].ramdac = NULL;
- card[lastcard].clockchip = NULL;
- card[lastcard].dacspeed = NULL;
- card[lastcard].flags = 0;
- card[lastcard].lines = "";
- continue;
- }
- if (lastcard < 0) /* no NAME line found yet */
- continue;
- if (strncmp(buf, "SEE", 3) == 0) {
- /* Reference to another entry. */
- int i;
- i = lookupcard(buf + 4);
- if (i == -1) {
- printf("Error in database, invalid reference: %s.\n",
- buf + 4);
- free(card[lastcard].name);
- lastcard--;
- continue;
- }
- if (card[lastcard].chipset == NULL)
- card[lastcard].chipset = card[i].chipset;
- if (card[lastcard].server == NULL)
- card[lastcard].server = card[i].server;
- if (card[lastcard].driver == NULL)
- card[lastcard].driver = card[i].driver;
- if (card[lastcard].ramdac == NULL)
- card[lastcard].ramdac = card[i].ramdac;
- if (card[lastcard].clockchip == NULL)
- card[lastcard].clockchip = card[i].clockchip;
- if (card[lastcard].dacspeed == NULL)
- card[lastcard].dacspeed = card[i].dacspeed;
- card[lastcard].flags |= card[i].flags;
- appendstring(&card[lastcard].lines, card[i].lines);
- continue;
- }
- if (strncmp(buf, "CHIPSET", 7) == 0) {
- /* Chipset description. */
- card[lastcard].chipset = malloc(strlen(buf + 8) + 1);
- strcpy(card[lastcard].chipset, buf + 8);
- continue;
- }
- if (strncmp(buf, "SERVER", 6) == 0) {
- /* Server identifier. */
- card[lastcard].server = malloc(strlen(buf + 7) + 1);
- strcpy(card[lastcard].server, buf + 7);
- continue;
- }
- if (strncmp(buf, "DRIVER", 6) == 0) {
- /* Driver identifier. */
- card[lastcard].driver = malloc(strlen(buf + 7) + 1);
- strcpy(card[lastcard].driver, buf + 7);
- continue;
- }
- if (strncmp(buf, "RAMDAC", 6) == 0) {
- /* Ramdac indentifier. */
- card[lastcard].ramdac = malloc(strlen(buf + 7) + 1);
- strcpy(card[lastcard].ramdac, buf + 7);
- continue;
- }
- if (strncmp(buf, "CLOCKCHIP", 9) == 0) {
- /* Clockchip indentifier. */
- card[lastcard].clockchip = malloc(strlen(buf + 10) + 1);
- strcpy(card[lastcard].clockchip, buf + 10);
- card[lastcard].flags |= NOCLOCKPROBE;
- continue;
- }
- if (strncmp(buf, "DACSPEED", 8) == 0) {
- /* Clockchip indentifier. */
- card[lastcard].dacspeed = malloc(strlen(buf + 9) + 1);
- strcpy(card[lastcard].dacspeed, buf + 9);
- continue;
- }
- if (strncmp(buf, "NOCLOCKPROBE", 12) == 0) {
- card[lastcard].flags |= NOCLOCKPROBE;
- continue;
- }
- if (strncmp(buf, "UNSUPPORTED", 12) == 0) {
- card[lastcard].flags |= UNSUPPORTED;
- continue;
- }
- /* test for missing required fields */
- if (card[lastcard].driver == NULL) {
- fprintf(stderr, "Warning DRIVER specification missing "
- "in Card database entry %s (line %d).\n",
- card[lastcard].name, lineno);
- keypress();
- card[lastcard].driver = "unknown";
- }
- if (card[lastcard].chipset == NULL) {
- fprintf(stderr, "Warning CHIPSET specification missing "
- "in Card database entry %s (line %d).\n",
- card[lastcard].name, lineno);
- keypress();
- card[lastcard].chipset = "unknown";
- }
- }
-
- fclose(f);
-
- /*
- * Add general comments.
- */
- for (i = 0; i <= lastcard; i++) {
- if (card[i].server && strcmp(card[i].server, "S3") == 0)
- appendstring(&card[i].lines, s3_comment);
- if (card[i].chipset &&
- strncmp(card[i].chipset, "CL-GD", 5) == 0)
- appendstring(&card[i].lines, cirrus_comment);
- }
-
- sort_database();
-
- return 0;
-}
-
-static int
-compare_card(const void *e1, const void *e2)
-{
- return strcmp(((Card *)e1)->name, ((Card *)e2)->name);
-}
-
-void
-sort_database() {
- /* Each element is a bunch of words, but nothing too bad. */
- qsort(card, lastcard + 1, sizeof(Card), compare_card);
-}
diff --git a/hw/xfree86/utils/xorgconfig/cards.h b/hw/xfree86/utils/xorgconfig/cards.h
deleted file mode 100644
index c5299e899..000000000
--- a/hw/xfree86/utils/xorgconfig/cards.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/cards.h,v 3.5 1999/07/05 12:12:06 dawes Exp $ */
-
-
-
-
-
-/* $XConsortium: cards.h /main/3 1996/02/21 18:12:53 kaleb $ */
-
-#ifndef CARD_DATABASE_FILE
-#define CARD_DATABASE_FILE "Cards"
-#endif
-
-#define MAX_CARDS 1000
-
-typedef struct {
- char *name; /* Name of the card. */
- char *chipset; /* Chipset (decriptive). */
- char *server; /* Server identifier. */
- char *driver; /* Driver identifier. */
- char *ramdac; /* Ramdac identifier. */
- char *clockchip; /* Clockchip identifier. */
- char *dacspeed; /* DAC speed rating. */
- int flags;
- char *lines; /* Additional Device section lines. */
-} Card;
-
-/* Flags: */
-#define NOCLOCKPROBE 0x1 /* Never probe clocks of the card. */
-#define UNSUPPORTED 0x2 /* Card is not supported (only VGA). */
-
-extern int lastcard;
-
-extern Card card[MAX_CARDS];
-
-extern int lookupcard ( char *name );
-extern int parse_database ( void );
-extern void sort_database ( void );
-extern void keypress ( void );
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
deleted file mode 100644
index 07659d943..000000000
--- a/hw/xfree86/vbe/vbe.c
+++ /dev/null
@@ -1,1073 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.3 2003/11/03 05:11:53 tsi Exp $ */
-
-/*
- * XFree86 vbe module
- * Copyright 2000 Egbert Eich
- *
- * The mode query/save/set/restore functions from the vesa driver
- * have been moved here.
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- */
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "vbe.h"
-#include "Xarch.h"
-#define DPMS_SERVER
-#include "extensions/dpms.h"
-
-#define VERSION(x) VBE_VERSION_MAJOR(x),VBE_VERSION_MINOR(x)
-
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
-#define B_O16(x) (x)
-#define B_O32(x) (x)
-#else
-#define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8))
-#define B_O32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \
- | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24))
-#endif
-#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
-
-#define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff))
-#define R16(v) ((v) & 0xffff)
-
-static unsigned char * vbeReadEDID(vbeInfoPtr pVbe);
-static Bool vbeProbeDDC(vbeInfoPtr pVbe);
-
-const char *vbe_ddcSymbols[] = {
- "xf86InterpretEDID",
- NULL
-};
-
-static const char vbeVersionString[] = "VBE2";
-
-vbeInfoPtr
-VBEInit(xf86Int10InfoPtr pInt, int entityIndex)
-{
- return VBEExtendedInit(pInt, entityIndex, 0);
-}
-
-vbeInfoPtr
-VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags)
-{
- int RealOff;
- pointer page = NULL;
- ScrnInfoPtr pScrn = xf86FindScreenForEntity(entityIndex);
- vbeControllerInfoPtr vbe = NULL;
- Bool init_int10 = FALSE;
- vbeInfoPtr vip = NULL;
- int screen = pScrn->scrnIndex;
-
- if (!pInt) {
- if (!xf86LoadSubModule(pScrn, "int10"))
- goto error;
-
- xf86DrvMsg(screen,X_INFO,"initializing int10\n");
- pInt = xf86InitInt10(entityIndex);
- if (!pInt)
- goto error;
- init_int10 = TRUE;
- }
-
- page = xf86Int10AllocPages(pInt,1,&RealOff);
- if (!page) goto error;
- vbe = (vbeControllerInfoPtr) page;
- memcpy(vbe->VbeSignature,vbeVersionString,4);
-
- pInt->ax = 0x4F00;
- pInt->es = SEG_ADDR(RealOff);
- pInt->di = SEG_OFF(RealOff);
- pInt->num = 0x10;
-
- xf86ExecX86int10(pInt);
-
- if ((pInt->ax & 0xff) != 0x4f) {
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA BIOS not detected\n");
- goto error;
- }
-
- switch (pInt->ax & 0xff00) {
- case 0:
- xf86DrvMsg(screen,X_INFO,"VESA BIOS detected\n");
- break;
- case 0x100:
- xf86DrvMsg(screen,X_INFO,"VESA BIOS function failed\n");
- goto error;
- case 0x200:
- xf86DrvMsg(screen,X_INFO,"VESA BIOS not supported\n");
- goto error;
- case 0x300:
- xf86DrvMsg(screen,X_INFO,"VESA BIOS not supported in current mode\n");
- goto error;
- default:
- xf86DrvMsg(screen,X_INFO,"Invalid\n");
- goto error;
- }
-
- xf86DrvMsgVerb(screen, X_INFO, 4,
- "VbeVersion is %d, OemStringPtr is 0x%08lx,\n"
- "\tOemVendorNamePtr is 0x%08lx, OemProductNamePtr is 0x%08lx,\n"
- "\tOemProductRevPtr is 0x%08lx\n",
- vbe->VbeVersion, (unsigned long)vbe->OemStringPtr,
- (unsigned long)vbe->OemVendorNamePtr,
- (unsigned long)vbe->OemProductNamePtr,
- (unsigned long)vbe->OemProductRevPtr);
-
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Version %i.%i\n",
- VERSION(vbe->VbeVersion));
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Total Mem: %i kB\n",
- vbe->TotalMem * 64);
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM: %s\n",
- (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemStringPtr)));
-
- if (B_O16(vbe->VbeVersion) >= 0x200) {
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Software Rev: %i.%i\n",
- VERSION(vbe->OemSoftwareRev));
- if (vbe->OemVendorNamePtr)
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Vendor: %s\n",
- (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemVendorNamePtr)));
- if (vbe->OemProductNamePtr)
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Product: %s\n",
- (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemProductNamePtr)));
- if (vbe->OemProductRevPtr)
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Product Rev: %s\n",
- (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemProductRevPtr)));
- }
- vip = (vbeInfoPtr)xnfalloc(sizeof(vbeInfoRec));
- vip->version = B_O16(vbe->VbeVersion);
- vip->pInt10 = pInt;
- vip->ddc = DDC_UNCHECKED;
- vip->memory = page;
- vip->real_mode_base = RealOff;
- vip->num_pages = 1;
- vip->init_int10 = init_int10;
-
- return vip;
-
- error:
- if (page)
- xf86Int10FreePages(pInt, page, 1);
- if (init_int10)
- xf86FreeInt10(pInt);
- return NULL;
-}
-
-void
-vbeFree(vbeInfoPtr pVbe)
-{
- if (!pVbe)
- return;
-
- xf86Int10FreePages(pVbe->pInt10,pVbe->memory,pVbe->num_pages);
- /* If we have initalized int10 we ought to free it, too */
- if (pVbe->init_int10)
- xf86FreeInt10(pVbe->pInt10);
- xfree(pVbe);
- return;
-}
-
-static Bool
-vbeProbeDDC(vbeInfoPtr pVbe)
-{
- char *ddc_level;
- int screen = pVbe->pInt10->scrnIndex;
-
- if (!pVbe || (pVbe->ddc == DDC_NONE))
- return FALSE;
- if (pVbe->ddc != DDC_UNCHECKED)
- return TRUE;
-
- pVbe->pInt10->ax = 0x4F15;
- pVbe->pInt10->bx = 0;
- pVbe->pInt10->cx = 0;
- pVbe->pInt10->es = 0;
- pVbe->pInt10->di = 0;
- pVbe->pInt10->num = 0x10;
-
- xf86ExecX86int10(pVbe->pInt10);
-
- if ((pVbe->pInt10->ax & 0xff) != 0x4f) {
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC not supported\n");
- pVbe->ddc = DDC_NONE;
- return FALSE;
- }
-
- switch ((pVbe->pInt10->ax >> 8) & 0xff) {
- case 0:
- xf86DrvMsg(screen,X_INFO,"VESA VBE DDC supported\n");
- switch (pVbe->pInt10->bx & 0x3) {
- case 0:
- ddc_level = " none";
- pVbe->ddc = DDC_NONE;
- break;
- case 1:
- ddc_level = " 1";
- pVbe->ddc = DDC_1;
- break;
- case 2:
- ddc_level = " 2";
- pVbe->ddc = DDC_2;
- break;
- case 3:
- ddc_level = " 1 + 2";
- pVbe->ddc = DDC_1_2;
- break;
- default:
- ddc_level = "";
- pVbe->ddc = DDC_NONE;
- break;
- }
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC Level%s\n",ddc_level);
- if (pVbe->pInt10->bx & 0x4) {
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC Screen blanked"
- "for data transfer\n");
- pVbe->ddc_blank = TRUE;
- } else
- pVbe->ddc_blank = FALSE;
-
- xf86DrvMsgVerb(screen,X_INFO,3,
- "VESA VBE DDC transfer in appr. %x sec.\n",
- (pVbe->pInt10->bx >> 8) & 0xff);
- }
-
- return TRUE;
-}
-
-typedef enum {
- VBEOPT_NOVBE,
- VBEOPT_NODDC
-} VBEOpts;
-
-static const OptionInfoRec VBEOptions[] = {
- { VBEOPT_NOVBE, "NoVBE", OPTV_BOOLEAN, {0}, FALSE },
- { VBEOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-static unsigned char *
-vbeReadEDID(vbeInfoPtr pVbe)
-{
- int RealOff = pVbe->real_mode_base;
- pointer page = pVbe->memory;
- unsigned char *tmp = NULL;
- Bool novbe = FALSE;
- Bool noddc = FALSE;
- int screen = pVbe->pInt10->scrnIndex;
- OptionInfoPtr options;
-
- if (!page) return NULL;
-
- options = xnfalloc(sizeof(VBEOptions));
- (void)memcpy(options, VBEOptions, sizeof(VBEOptions));
- xf86ProcessOptions(screen, xf86Screens[screen]->options, options);
- xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe);
- xf86GetOptValBool(options, VBEOPT_NODDC, &noddc);
- xfree(options);
- if (novbe || noddc) return NULL;
-
- if (!vbeProbeDDC(pVbe)) goto error;
-
- memset(page,0,sizeof(vbeInfoPtr));
- strcpy(page,vbeVersionString);
-
- pVbe->pInt10->ax = 0x4F15;
- pVbe->pInt10->bx = 0x01;
- pVbe->pInt10->cx = 0;
- pVbe->pInt10->dx = 0;
- pVbe->pInt10->es = SEG_ADDR(RealOff);
- pVbe->pInt10->di = SEG_OFF(RealOff);
- pVbe->pInt10->num = 0x10;
-
- xf86ExecX86int10(pVbe->pInt10);
-
- if ((pVbe->pInt10->ax & 0xff) != 0x4f) {
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC invalid\n");
- goto error;
- }
- switch (pVbe->pInt10->ax & 0xff00) {
- case 0x0:
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read successfully\n");
- tmp = (unsigned char *)xnfalloc(128);
- memcpy(tmp,page,128);
- break;
- case 0x100:
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read failed\n");
- break;
- default:
- xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC unkown failure %i\n",
- pVbe->pInt10->ax & 0xff00);
- break;
- }
-
- error:
- return tmp;
-}
-
-xf86MonPtr
-vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
-{
- xf86MonPtr pMonitor;
- pointer pModule;
- unsigned char *DDC_data = NULL;
-
- if (!pVbe) return NULL;
- if (pVbe->version < 0x200)
- return NULL;
-
- if (!(pModule = pDDCModule)) {
- pModule =
- xf86LoadSubModule(xf86Screens[pVbe->pInt10->scrnIndex], "ddc");
- if (!pModule)
- return NULL;
-
- xf86LoaderReqSymLists(vbe_ddcSymbols, NULL);
- }
-
- DDC_data = vbeReadEDID(pVbe);
-
- if (!DDC_data)
- return NULL;
-
- pMonitor = xf86InterpretEDID(pVbe->pInt10->scrnIndex, DDC_data);
-
- if (!pDDCModule)
- xf86UnloadSubModule(pModule);
- return pMonitor;
-}
-
-
-VbeInfoBlock *
-VBEGetVBEInfo(vbeInfoPtr pVbe)
-{
- VbeInfoBlock *block = NULL;
- int i, pStr, pModes;
- char *str;
- CARD16 major, *modes;
-
- bzero(pVbe->memory, sizeof(VbeInfoBlock));
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 00h Return Super VGA information
- ES:DI := Pointer to buffer
-
- Output:
- AX := status
- (All other registers are preserved)
- */
-
- ((char*)pVbe->memory)[0] = 'V';
- ((char*)pVbe->memory)[1] = 'B';
- ((char*)pVbe->memory)[2] = 'E';
- ((char*)pVbe->memory)[3] = '2';
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f00;
- pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
- pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (NULL);
-
- block = xcalloc(sizeof(VbeInfoBlock), 1);
- block->VESASignature[0] = ((char*)pVbe->memory)[0];
- block->VESASignature[1] = ((char*)pVbe->memory)[1];
- block->VESASignature[2] = ((char*)pVbe->memory)[2];
- block->VESASignature[3] = ((char*)pVbe->memory)[3];
-
- block->VESAVersion = *(CARD16*)(((char*)pVbe->memory) + 4);
- major = (unsigned)block->VESAVersion >> 8;
-
- pStr = *(CARD32*)(((char*)pVbe->memory) + 6);
- str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
- block->OEMStringPtr = strdup(str);
-
- block->Capabilities[0] = ((char*)pVbe->memory)[10];
- block->Capabilities[1] = ((char*)pVbe->memory)[11];
- block->Capabilities[2] = ((char*)pVbe->memory)[12];
- block->Capabilities[3] = ((char*)pVbe->memory)[13];
-
- pModes = *(CARD32*)(((char*)pVbe->memory) + 14);
- modes = xf86int10Addr(pVbe->pInt10, FARP(pModes));
- i = 0;
- while (modes[i] != 0xffff)
- i++;
- block->VideoModePtr = xalloc(sizeof(CARD16) * i + 1);
- memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
- block->VideoModePtr[i] = 0xffff;
-
- block->TotalMemory = *(CARD16*)(((char*)pVbe->memory) + 18);
-
- if (major < 2)
- memcpy(&block->OemSoftwareRev, ((char*)pVbe->memory) + 20, 236);
- else {
- block->OemSoftwareRev = *(CARD16*)(((char*)pVbe->memory) + 20);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 22);
- str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
- block->OemVendorNamePtr = strdup(str);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 26);
- str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
- block->OemProductNamePtr = strdup(str);
- pStr = *(CARD32*)(((char*)pVbe->memory) + 30);
- str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
- block->OemProductRevPtr = strdup(str);
- memcpy(&block->Reserved, ((char*)pVbe->memory) + 34, 222);
- memcpy(&block->OemData, ((char*)pVbe->memory) + 256, 256);
- }
-
- return (block);
-}
-
-void
-VBEFreeVBEInfo(VbeInfoBlock *block)
-{
- xfree(block->OEMStringPtr);
- xfree(block->VideoModePtr);
- if (((unsigned)block->VESAVersion >> 8) >= 2) {
- xfree(block->OemVendorNamePtr);
- xfree(block->OemProductNamePtr);
- xfree(block->OemProductRevPtr);
- }
- xfree(block);
-}
-
-Bool
-VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *block)
-{
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 02h Set Super VGA video mode
- BX := Video mode
- D0-D8 := Mode number
- D9-D10 := Reserved (must be 0)
- D11 := 0 Use current default refresh rate
- := 1 Use user specified CRTC values for refresh rate
- D12-13 Reserved for VBE/AF (must be 0)
- D14 := 0 Use windowed frame buffer model
- := 1 Use linear/flat frame buffer model
- D15 := 0 Clear video memory
- := 1 Don't clear video memory
- ES:DI := Pointer to VbeCRTCInfoBlock structure
-
- Output: AX = Status
- (All other registers are preserved)
- */
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f02;
- pVbe->pInt10->bx = mode;
- if (block) {
- pVbe->pInt10->bx |= 1 << 11;
- memcpy(pVbe->memory, block, sizeof(VbeCRTCInfoBlock));
- pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
- pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
- }
-
- xf86ExecX86int10(pVbe->pInt10);
-
- return (R16(pVbe->pInt10->ax) == 0x4f);
-}
-
-Bool
-VBEGetVBEMode(vbeInfoPtr pVbe, int *mode)
-{
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 03h Return current video mode
-
- Output:
- AX := Status
- BX := Current video mode
- (All other registers are preserved)
- */
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f03;
-
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) == 0x4f) {
- *mode = R16(pVbe->pInt10->bx);
-
- return (TRUE);
- }
-
- return (FALSE);
-}
-
-VbeModeInfoBlock *
-VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
-{
- VbeModeInfoBlock *block = NULL;
-
- bzero(pVbe->memory, sizeof(VbeModeInfoBlock));
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 01h Return Super VGA mode information
- CX := Super VGA video mode
- (mode number must be one of those returned by Function 0)
- ES:DI := Pointer to buffer
-
- Output:
- AX := status
- (All other registers are preserved)
- */
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f01;
- pVbe->pInt10->cx = mode;
- pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
- pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
- xf86ExecX86int10(pVbe->pInt10);
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (NULL);
-
- block = xcalloc(sizeof(VbeModeInfoBlock), 1);
-
- block->ModeAttributes = *(CARD16*)pVbe->memory;
- block->WinAAttributes = ((char*)pVbe->memory)[2];
- block->WinBAttributes = ((char*)pVbe->memory)[3];
- block->WinGranularity = *(CARD16*)(((char*)pVbe->memory) + 4);
- block->WinSize = *(CARD16*)(((char*)pVbe->memory) + 6);
- block->WinASegment = *(CARD16*)(((char*)pVbe->memory) + 8);
- block->WinBSegment = *(CARD16*)(((char*)pVbe->memory) + 10);
- block->WinFuncPtr = *(CARD32*)(((char*)pVbe->memory) + 12);
- block->BytesPerScanline = *(CARD16*)(((char*)pVbe->memory) + 16);
-
- /* mandatory information for VBE 1.2 and above */
- block->XResolution = *(CARD16*)(((char*)pVbe->memory) + 18);
- block->YResolution = *(CARD16*)(((char*)pVbe->memory) + 20);
- block->XCharSize = ((char*)pVbe->memory)[22];
- block->YCharSize = ((char*)pVbe->memory)[23];
- block->NumberOfPlanes = ((char*)pVbe->memory)[24];
- block->BitsPerPixel = ((char*)pVbe->memory)[25];
- block->NumberOfBanks = ((char*)pVbe->memory)[26];
- block->MemoryModel = ((char*)pVbe->memory)[27];
- block->BankSize = ((char*)pVbe->memory)[28];
- block->NumberOfImages = ((char*)pVbe->memory)[29];
- block->Reserved = ((char*)pVbe->memory)[30];
-
- /* Direct color fields (required for direct/6 and YUV/7 memory models) */
- block->RedMaskSize = ((char*)pVbe->memory)[31];
- block->RedFieldPosition = ((char*)pVbe->memory)[32];
- block->GreenMaskSize = ((char*)pVbe->memory)[33];
- block->GreenFieldPosition = ((char*)pVbe->memory)[34];
- block->BlueMaskSize = ((char*)pVbe->memory)[35];
- block->BlueFieldPosition = ((char*)pVbe->memory)[36];
- block->RsvdMaskSize = ((char*)pVbe->memory)[37];
- block->RsvdFieldPosition = ((char*)pVbe->memory)[38];
- block->DirectColorModeInfo = ((char*)pVbe->memory)[39];
-
- /* Mandatory information for VBE 2.0 and above */
- if (pVbe->version >= 0x200) {
- block->PhysBasePtr = *(CARD32*)(((char*)pVbe->memory) + 40);
- block->Reserved32 = *(CARD32*)(((char*)pVbe->memory) + 44);
- block->Reserved16 = *(CARD16*)(((char*)pVbe->memory) + 48);
-
- /* Mandatory information for VBE 3.0 and above */
- if (pVbe->version >= 0x300) {
- block->LinBytesPerScanLine = *(CARD16*)(((char*)pVbe->memory) + 50);
- block->BnkNumberOfImagePages = ((char*)pVbe->memory)[52];
- block->LinNumberOfImagePages = ((char*)pVbe->memory)[53];
- block->LinRedMaskSize = ((char*)pVbe->memory)[54];
- block->LinRedFieldPosition = ((char*)pVbe->memory)[55];
- block->LinGreenMaskSize = ((char*)pVbe->memory)[56];
- block->LinGreenFieldPosition = ((char*)pVbe->memory)[57];
- block->LinBlueMaskSize = ((char*)pVbe->memory)[58];
- block->LinBlueFieldPosition = ((char*)pVbe->memory)[59];
- block->LinRsvdMaskSize = ((char*)pVbe->memory)[60];
- block->LinRsvdFieldPosition = ((char*)pVbe->memory)[61];
- block->MaxPixelClock = *(CARD32*)(((char*)pVbe->memory) + 62);
- memcpy(&block->Reserved2, ((char*)pVbe->memory) + 66, 188);
- }
- else
- memcpy(&block->LinBytesPerScanLine, ((char*)pVbe->memory) + 50, 206);
- }
- else
- memcpy(&block->PhysBasePtr, ((char*)pVbe->memory) + 40, 216);
-
- return (block);
-}
-
-void
-VBEFreeModeInfo(VbeModeInfoBlock *block)
-{
- xfree(block);
-}
-
-Bool
-VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function,
- pointer *memory, int *size, int *real_mode_pages)
-{
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 00h Return save/restore state buffer size
- CX := Requested states
- D0 = Save/restore video hardware state
- D1 = Save/restore video BIOS data state
- D2 = Save/restore video DAC state
- D3 = Save/restore Super VGA state
-
- Output:
- AX = Status
- BX = Number of 64-byte blocks to hold the state buffer
- (All other registers are preserved)
-
-
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 01h Save Super VGA video state
- CX := Requested states (see above)
- ES:BX := Pointer to buffer
-
- Output:
- AX := Status
- (All other registers are preserved)
-
-
- Input:
- AH := 4Fh Super VGA support
- AL := 04h Save/restore Super VGA video state
- DL := 02h Restore Super VGA video state
- CX := Requested states (see above)
- ES:BX := Pointer to buffer
-
- Output:
- AX := Status
- (All other registers are preserved)
- */
-
- if ((pVbe->version & 0xff00) > 0x100) {
- int screen = pVbe->pInt10->scrnIndex;
- if (function == MODE_QUERY ||
- (function == MODE_SAVE && !*memory)) {
- /* Query amount of memory to save state */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f04;
- pVbe->pInt10->dx = 0;
- pVbe->pInt10->cx = 0x000f;
- xf86ExecX86int10(pVbe->pInt10);
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (FALSE);
-
- if (function == MODE_SAVE) {
- int npages = (R16(pVbe->pInt10->bx) * 64) / 4096 + 1;
- if ((*memory = xf86Int10AllocPages(pVbe->pInt10, npages,
- real_mode_pages)) == NULL) {
- xf86DrvMsg(screen, X_ERROR,
- "Cannot allocate memory to save SVGA state.\n");
- return (FALSE);
- }
- }
- *size = pVbe->pInt10->bx * 64;
- }
-
- /* Save/Restore Super VGA state */
- if (function != MODE_QUERY) {
-
- if (!*memory) return FALSE;
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f04;
- switch (function) {
- case MODE_SAVE:
- pVbe->pInt10->dx = 1;
- break;
- case MODE_RESTORE:
- pVbe->pInt10->dx = 2;
- break;
- case MODE_QUERY:
- return FALSE;
- }
- pVbe->pInt10->cx = 0x000f;
-
- pVbe->pInt10->es = SEG_ADDR(*real_mode_pages);
- pVbe->pInt10->bx = SEG_OFF(*real_mode_pages);
- xf86ExecX86int10(pVbe->pInt10);
- return (R16(pVbe->pInt10->ax) == 0x4f);
-
- }
- }
- return TRUE;
-}
-
-Bool
-VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window)
-{
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 05h
-
- Output:
- */
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f05;
- pVbe->pInt10->bx = window;
- pVbe->pInt10->dx = iBank;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (FALSE);
-
- return (TRUE);
-}
-
-Bool
-VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command,
- int width, int *pixels, int *bytes, int *max)
-{
- if (command < SCANWID_SET || command > SCANWID_GET_MAX)
- return (FALSE);
-
- /*
- Input:
- AX := 4F06h VBE Set/Get Logical Scan Line Length
- BL := 00h Set Scan Line Length in Pixels
- := 01h Get Scan Line Length
- := 02h Set Scan Line Length in Bytes
- := 03h Get Maximum Scan Line Length
- CX := If BL=00h Desired Width in Pixels
- If BL=02h Desired Width in Bytes
- (Ignored for Get Functions)
-
- Output:
- AX := VBE Return Status
- BX := Bytes Per Scan Line
- CX := Actual Pixels Per Scan Line
- (truncated to nearest complete pixel)
- DX := Maximum Number of Scan Lines
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f06;
- pVbe->pInt10->bx = command;
- if (command == SCANWID_SET || command == SCANWID_SET_BYTES)
- pVbe->pInt10->cx = width;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (FALSE);
-
- if (command == SCANWID_GET || command == SCANWID_GET_MAX) {
- if (pixels)
- *pixels = R16(pVbe->pInt10->cx);
- if (bytes)
- *bytes = R16(pVbe->pInt10->bx);
- if (max)
- *max = R16(pVbe->pInt10->dx);
- }
-
- return (TRUE);
-}
-
-Bool
-VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace)
-{
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f07;
- pVbe->pInt10->bx = wait_retrace ? 0x80 : 0x00;
- pVbe->pInt10->cx = x;
- pVbe->pInt10->dx = y;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (FALSE);
-
- return (TRUE);
-}
-
-Bool
-VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y)
-{
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f07;
- pVbe->pInt10->bx = 0x01;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (FALSE);
-
- *x = pVbe->pInt10->cx;
- *y = pVbe->pInt10->dx;
-
- return (TRUE);
-}
-
-int
-VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits)
-{
- /*
- Input:
- AX := 4F08h VBE Set/Get Palette Format
- BL := 00h Set DAC Palette Format
- := 01h Get DAC Palette Format
- BH := Desired bits of color per primary
- (Set DAC Palette Format only)
-
- Output:
- AX := VBE Return Status
- BH := Current number of bits of color per primary
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f08;
- if (!bits)
- pVbe->pInt10->bx = 0x01;
- else
- pVbe->pInt10->bx = (bits & 0x00ff) << 8;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (0);
-
- return (bits != 0 ? bits : (pVbe->pInt10->bx >> 8) & 0x00ff);
-}
-
-CARD32 *
-VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
- CARD32 *data, Bool secondary, Bool wait_retrace)
-{
- /*
- Input:
- (16-bit)
- AX := 4F09h VBE Load/Unload Palette Data
- BL := 00h Set Palette Data
- := 01h Get Palette Data
- := 02h Set Secondary Palette Data
- := 03h Get Secondary Palette Data
- := 80h Set Palette Data during Vertical Retrace
- CX := Number of palette registers to update (to a maximum of 256)
- DX := First of the palette registers to update (start)
- ES:DI := Table of palette values (see below for format)
-
- Output:
- AX := VBE Return Status
-
-
- Input:
- (32-bit)
- BL := 00h Set Palette Data
- := 80h Set Palette Data during Vertical Retrace
- CX := Number of palette registers to update (to a maximum of 256)
- DX := First of the palette registers to update (start)
- ES:EDI := Table of palette values (see below for format)
- DS := Selector for memory mapped registers
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f09;
- if (!secondary)
- pVbe->pInt10->bx = set && wait_retrace ? 0x80 : set ? 0 : 1;
- else
- pVbe->pInt10->bx = set ? 2 : 3;
- pVbe->pInt10->cx = num;
- pVbe->pInt10->dx = first;
- pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
- pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
- if (set)
- memcpy(pVbe->memory, data, num * sizeof(CARD32));
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (NULL);
-
- if (set)
- return (data);
-
- data = xalloc(num * sizeof(CARD32));
- memcpy(data, pVbe->memory, num * sizeof(CARD32));
-
- return (data);
-}
-
-VBEpmi *
-VBEGetVBEpmi(vbeInfoPtr pVbe)
-{
- VBEpmi *pmi;
-
- /*
- Input:
- AH := 4Fh Super VGA support
- AL := 0Ah Protected Mode Interface
- BL := 00h Return Protected Mode Table
-
- Output:
- AX := Status
- ES := Real Mode Segment of Table
- DI := Offset of Table
- CX := Lenght of Table including protected mode code in bytes (for copying purposes)
- (All other registers are preserved)
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f0a;
- pVbe->pInt10->bx = 0;
- pVbe->pInt10->di = 0;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (NULL);
-
- pmi = xalloc(sizeof(VBEpmi));
- pmi->seg_tbl = R16(pVbe->pInt10->es);
- pmi->tbl_off = R16(pVbe->pInt10->di);
- pmi->tbl_len = R16(pVbe->pInt10->cx);
-
- return (pmi);
-}
-
-#if 0
-vbeModeInfoPtr
-VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock *vbe)
-{
- vbeModeInfoPtr ModeList = NULL;
-
- int i = 0;
- while (vbe->VideoModePtr[i] != 0xffff) {
- vbeModeInfoPtr m;
- VbeModeInfoBlock *mode;
- int id = vbe->VideoModePtr[i++];
- int bpp;
-
- if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
- continue;
-
- bpp = mode->BitsPerPixel;
-
- m = xnfcalloc(sizeof(vbeModeInfoRec),1);
- m->width = mode->XResolution;
- m->height = mode->YResolution;
- m->bpp = bpp;
- m->n = id;
- m->next = ModeList;
-
- xf86DrvMsgVerb(pVbe->pInt10->scrnIndex, X_PROBED, 3,
- "BIOS reported VESA mode 0x%x: x:%i y:%i bpp:%i\n",
- m->n, m->width, m->height, m->bpp);
-
- ModeList = m;
-
- VBEFreeModeInfo(mode);
- }
- return ModeList;
-}
-
-unsigned short
-VBECalcVbeModeIndex(vbeModeInfoPtr m, DisplayModePtr mode, int bpp)
-{
- while (m) {
- if (bpp == m->bpp
- && mode->HDisplay == m->width
- && mode->VDisplay == m->height)
- return m->n;
- m = m->next;
- }
- return 0;
-}
-#endif
-
-void
-VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
- vbeSaveRestoreFunction function)
-{
- Bool SaveSucc = FALSE;
-
- if (VBE_VERSION_MAJOR(pVbe->version) > 1
- && (function == MODE_SAVE || vbe_sr->pstate)) {
- if (function == MODE_RESTORE)
- memcpy(vbe_sr->state, vbe_sr->pstate, vbe_sr->stateSize);
- ErrorF("VBESaveRestore\n");
- if ((VBESaveRestore(pVbe,function,
- (pointer)&vbe_sr->state,
- &vbe_sr->stateSize,&vbe_sr->statePage))) {
- if (function == MODE_SAVE) {
- SaveSucc = TRUE;
- vbe_sr->stateMode = -1; /* invalidate */
- /* don't rely on the memory not being touched */
- if (vbe_sr->pstate == NULL)
- vbe_sr->pstate = xalloc(vbe_sr->stateSize);
- memcpy(vbe_sr->pstate, vbe_sr->state, vbe_sr->stateSize);
- }
- ErrorF("VBESaveRestore done with success\n");
- return;
- }
- ErrorF("VBESaveRestore done\n");
- }
-
- if (function == MODE_SAVE && !SaveSucc)
- (void)VBEGetVBEMode(pVbe, &vbe_sr->stateMode);
-
- if (function == MODE_RESTORE && vbe_sr->stateMode != -1)
- VBESetVBEMode(pVbe, vbe_sr->stateMode, NULL);
-
-}
-
-int
-VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int clock)
-{
- /*
- Input:
- AX := 4F0Bh VBE Get Pixel Clock
- BL := 01h Get Pixel Clock
- ECX := pixel clock in units of Hz
- DX := mode number
-
- Output:
- AX := VBE Return Status
- ECX := Closest pixel clock
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f0b;
- pVbe->pInt10->bx = 0x01;
- pVbe->pInt10->cx = clock;
- pVbe->pInt10->dx = mode;
- xf86ExecX86int10(pVbe->pInt10);
-
- if (R16(pVbe->pInt10->ax) != 0x4f)
- return (0);
-
- return (pVbe->pInt10->cx);
-}
-
-Bool
-VBEDPMSSet(vbeInfoPtr pVbe, int mode)
-{
- /*
- Input:
- AX := 4F10h DPMS
- BL := 01h Set Display Power State
- BH := requested power state
-
- Output:
- AX := VBE Return Status
- */
-
- pVbe->pInt10->num = 0x10;
- pVbe->pInt10->ax = 0x4f10;
- pVbe->pInt10->bx = 0x01;
- switch (mode) {
- case DPMSModeOn:
- break;
- case DPMSModeStandby:
- pVbe->pInt10->bx |= 0x100;
- break;
- case DPMSModeSuspend:
- pVbe->pInt10->bx |= 0x200;
- break;
- case DPMSModeOff:
- pVbe->pInt10->bx |= 0x400;
- break;
- }
- xf86ExecX86int10(pVbe->pInt10);
- return (R16(pVbe->pInt10->ax) == 0x4f);
-}
-
diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h
deleted file mode 100644
index 30756119d..000000000
--- a/hw/xfree86/vbe/vbe.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.3 2003/11/14 14:58:45 tsi Exp $ */
-
-/*
- * XFree86 vbe module
- * Copyright 2000 Egbert Eich
- *
- * The mode query/save/set/restore functions from the vesa driver
- * have been moved here.
- * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
- */
-
-#ifndef _VBE_H
-#define _VBE_H
-#include "xf86int10.h"
-#include "xf86DDC.h"
-
-typedef enum {
- DDC_UNCHECKED,
- DDC_NONE,
- DDC_1,
- DDC_2,
- DDC_1_2
-}
-ddc_lvl;
-
-typedef struct {
- xf86Int10InfoPtr pInt10;
- int version;
- pointer memory;
- int real_mode_base;
- int num_pages;
- Bool init_int10;
- ddc_lvl ddc;
- Bool ddc_blank;
-} vbeInfoRec, *vbeInfoPtr;
-
-#define VBE_VERSION_MAJOR(x) *((CARD8*)(&x) + 1)
-#define VBE_VERSION_MINOR(x) (CARD8)(x)
-
-vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex);
-vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags);
-void vbeFree(vbeInfoPtr pVbe);
-xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule);
-
-#pragma pack(1)
-
-typedef struct vbeControllerInfoBlock {
- CARD8 VbeSignature[4];
- CARD16 VbeVersion;
- CARD32 OemStringPtr;
- CARD8 Capabilities[4];
- CARD32 VideoModePtr;
- CARD16 TotalMem;
- CARD16 OemSoftwareRev;
- CARD32 OemVendorNamePtr;
- CARD32 OemProductNamePtr;
- CARD32 OemProductRevPtr;
- CARD8 Scratch[222];
- CARD8 OemData[256];
-} vbeControllerInfoRec, *vbeControllerInfoPtr;
-
-#ifdef __GNUC__
-#pragma pack() /* All GCC versions recognise this syntax */
-#else
-#pragma pack(0)
-#endif
-
-#ifndef __GNUC__
-#define __attribute__(a)
-#endif
-
-typedef struct _VbeInfoBlock VbeInfoBlock;
-typedef struct _VbeModeInfoBlock VbeModeInfoBlock;
-typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock;
-
-/*
- * INT 0
- */
-
-struct _VbeInfoBlock {
- /* VESA 1.2 fields */
- CARD8 VESASignature[4]; /* VESA */
- CARD16 VESAVersion; /* Higher byte major, lower byte minor */
- /*CARD32*/char *OEMStringPtr; /* Pointer to OEM string */
- CARD8 Capabilities[4]; /* Capabilities of the video environment */
-
- /*CARD32*/CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */
-
- CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
- /* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
-
- /* VESA 2 fields */
- CARD16 OemSoftwareRev; /* VBE implementation Software revision */
- /*CARD32*/char *OemVendorNamePtr; /* Pointer to Vendor Name String */
- /*CARD32*/char *OemProductNamePtr; /* Pointer to Product Name String */
- /*CARD32*/char *OemProductRevPtr; /* Pointer to Product Revision String */
- CARD8 Reserved[222]; /* Reserved for VBE implementation */
- CARD8 OemData[256]; /* Data Area for OEM Strings */
-} __attribute__((packed));
-
-/* Return Super VGA Information */
-VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe);
-void VBEFreeVBEInfo(VbeInfoBlock *block);
-
-/*
- * INT 1
- */
-
-struct _VbeModeInfoBlock {
- CARD16 ModeAttributes; /* mode attributes */
- CARD8 WinAAttributes; /* window A attributes */
- CARD8 WinBAttributes; /* window B attributes */
- CARD16 WinGranularity; /* window granularity */
- CARD16 WinSize; /* window size */
- CARD16 WinASegment; /* window A start segment */
- CARD16 WinBSegment; /* window B start segment */
- CARD32 WinFuncPtr; /* real mode pointer to window function */
- CARD16 BytesPerScanline; /* bytes per scanline */
-
- /* Mandatory information for VBE 1.2 and above */
- CARD16 XResolution; /* horizontal resolution in pixels or characters */
- CARD16 YResolution; /* vertical resolution in pixels or characters */
- CARD8 XCharSize; /* character cell width in pixels */
- CARD8 YCharSize; /* character cell height in pixels */
- CARD8 NumberOfPlanes; /* number of memory planes */
- CARD8 BitsPerPixel; /* bits per pixel */
- CARD8 NumberOfBanks; /* number of banks */
- CARD8 MemoryModel; /* memory model type */
- CARD8 BankSize; /* bank size in KB */
- CARD8 NumberOfImages; /* number of images */
- CARD8 Reserved; /* 1 */ /* reserved for page function */
-
- /* Direct color fields (required for direct/6 and YUV/7 memory models) */
- CARD8 RedMaskSize; /* size of direct color red mask in bits */
- CARD8 RedFieldPosition; /* bit position of lsb of red mask */
- CARD8 GreenMaskSize; /* size of direct color green mask in bits */
- CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
- CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
- CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
- CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
- CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
- CARD8 DirectColorModeInfo; /* direct color mode attributes */
-
- /* Mandatory information for VBE 2.0 and above */
- CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
- CARD32 Reserved32; /* 0 */ /* Reserved - always set to 0 */
- CARD16 Reserved16; /* 0 */ /* Reserved - always set to 0 */
-
- /* Mandatory information for VBE 3.0 and above */
- CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
- CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
- CARD8 LinNumberOfImagePages; /* number of images for linear modes */
- CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
- CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
- CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
- CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
- CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
- CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
- CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
- CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
- CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
- CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
-} __attribute__((packed));
-
-/* Return VBE Mode Information */
-VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode);
-void VBEFreeModeInfo(VbeModeInfoBlock *block);
-
-/*
- * INT2
- */
-
-#define CRTC_DBLSCAN (1<<0)
-#define CRTC_INTERLACE (1<<1)
-#define CRTC_NHSYNC (1<<2)
-#define CRTC_NVSYNC (1<<3)
-
-struct _VbeCRTCInfoBlock {
- CARD16 HorizontalTotal; /* Horizontal total in pixels */
- CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
- CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
- CARD16 VerticalTotal; /* Vertical total in lines */
- CARD16 VerticalSyncStart; /* Vertical sync start in lines */
- CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
- CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
- CARD32 PixelClock; /* Pixel clock in units of Hz */
- CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
- CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
-} __attribute__((packed));
-/* VbeCRTCInfoBlock is in the VESA 3.0 specs */
-
-Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *crtc);
-
-/*
- * INT 3
- */
-
-Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode);
-
-/*
- * INT 4
- */
-
-/* Save/Restore Super VGA video state */
-/* function values are (values stored in VESAPtr):
- * 0 := query & allocate amount of memory to save state
- * 1 := save state
- * 2 := restore state
- *
- * function 0 called automatically if function 1 called without
- * a previous call to function 0.
- */
-
-typedef enum {
- MODE_QUERY,
- MODE_SAVE,
- MODE_RESTORE
-} vbeSaveRestoreFunction;
-
-Bool
-VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction,
- pointer *memory, int *size, int *real_mode_pages);
-
-/*
- * INT 5
- */
-
-Bool
-VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
-
-/*
- * INT 6
- */
-
-typedef enum {
- SCANWID_SET,
- SCANWID_GET,
- SCANWID_SET_BYTES,
- SCANWID_GET_MAX
-} vbeScanwidthCommand;
-
-#define VBESetLogicalScanline(pVbe, width) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, width, \
- NULL, NULL, NULL)
-#define VBESetLogicalScanlineBytes(pVbe, width) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \
- NULL, NULL, NULL)
-#define VBEGetLogicalScanline(pVbe, pixels, bytes, max) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \
- pixels, bytes, max)
-#define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \
- pixels, bytes, max)
-Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
- vbeScanwidthCommand command, int width,
- int *pixels, int *bytes, int *max);
-
-/*
- * INT 7
- */
-
-/* 16 bit code */
-Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace);
-Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y);
-
-/*
- * INT 8
- */
-
-/* if bits is 0, then it is a GET */
-int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits);
-
-/*
- * INT 9
- */
-
-/*
- * If getting a palette, the data argument is not used. It will return
- * the data.
- * If setting a palette, it will return the pointer received on success,
- * NULL on failure.
- */
-CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
- CARD32 *data, Bool secondary, Bool wait_retrace);
-#define VBEFreePaletteData(data) xfree(data)
-
-/*
- * INT A
- */
-
-typedef struct _VBEpmi {
- int seg_tbl;
- int tbl_off;
- int tbl_len;
-} VBEpmi;
-
-VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe);
-#define VESAFreeVBEpmi(pmi) xfree(pmi)
-
-/* high level helper functions */
-
-typedef struct _vbeModeInfoRec {
- int width;
- int height;
- int bpp;
- int n;
- struct _vbeModeInfoRec *next;
-} vbeModeInfoRec, *vbeModeInfoPtr;
-
-vbeModeInfoPtr VBEBuildVbeModeList(vbeInfoPtr pVbe,
- VbeInfoBlock *vbe);
-
-unsigned short VBECalcVbeModeIndex(vbeModeInfoPtr m,
- DisplayModePtr mode, int bpp);
-
-typedef struct {
- CARD8 *state;
- CARD8 *pstate;
- int statePage;
- int stateSize;
- int stateMode;
-} vbeSaveRestoreRec, *vbeSaveRestorePtr;
-
-void
-VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
- vbeSaveRestoreFunction function);
-
-int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int Clock);
-Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode);
-
-#endif
diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c
deleted file mode 100644
index ae16d7b75..000000000
--- a/hw/xfree86/vbe/vbeModes.c
+++ /dev/null
@@ -1,477 +0,0 @@
-#define DEBUG_VERB 2
-/*
- * Copyright © 2002 David Dawes
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the author(s) shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * the author(s).
- *
- * Authors: David Dawes <dawes@xfree86.org>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.c,v 1.4 2003/11/06 18:38:14 tsi Exp $
- */
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "vbe.h"
-#include "vbeModes.h"
-
-static int
-GetDepthFlag(vbeInfoPtr pVbe, int id)
-{
- VbeModeInfoBlock *mode;
- int bpp;
-
- if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
- return 0;
-
- if (VBE_MODE_USABLE(mode, 0)) {
- int depth;
-
- if (VBE_MODE_COLOR(mode)) {
- depth = mode->RedMaskSize + mode->GreenMaskSize +
- mode->BlueMaskSize;
- } else {
- depth = 1;
- }
- bpp = mode->BitsPerPixel;
- VBEFreeModeInfo(mode);
- mode = NULL;
- switch (depth) {
- case 1:
- return V_DEPTH_1;
- case 4:
- return V_DEPTH_4;
- case 8:
- return V_DEPTH_8;
- case 15:
- return V_DEPTH_15;
- case 16:
- return V_DEPTH_16;
- case 24:
- switch (bpp) {
- case 24:
- return V_DEPTH_24_24;
- case 32:
- return V_DEPTH_24_32;
- }
- }
- }
- if (mode)
- VBEFreeModeInfo(mode);
- return 0;
-}
-
-/*
- * Find supported mode depths.
- */
-int
-VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock *vbe, int *flags24,
- int modeTypes)
-{
- int i = 0;
- int depths = 0;
-
- if (modeTypes & V_MODETYPE_VBE) {
- while (vbe->VideoModePtr[i] != 0xffff) {
- depths |= GetDepthFlag(pVbe, vbe->VideoModePtr[i++]);
- }
- }
-
- /*
- * XXX This possibly only works with VBE 3.0 and later.
- */
- if (modeTypes & V_MODETYPE_VGA) {
- for (i = 0; i < 0x7F; i++) {
- depths |= GetDepthFlag(pVbe, i);
- }
- }
-
- if (flags24) {
- if (depths & V_DEPTH_24_24)
- *flags24 |= Support24bppFb;
- if (depths & V_DEPTH_24_32)
- *flags24 |= Support32bppFb;
- }
-
- return depths;
-}
-
-static DisplayModePtr
-CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
- int flags)
-{
- CARD16 major;
- VbeModeInfoBlock *mode;
- DisplayModePtr pMode, p;
- VbeModeInfoData *data;
- Bool modeOK = FALSE;
- ModeStatus status = MODE_OK;
-
- major = (unsigned)(vbe->VESAVersion >> 8);
-
- if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
- return NULL;
-
- /* Does the mode match the depth/bpp? */
- /* Some BIOS's set BitsPerPixel to 15 instead of 16 for 15/16 */
- if (VBE_MODE_USABLE(mode, flags) &&
- ((pScrn->bitsPerPixel == 1 && !VBE_MODE_COLOR(mode)) ||
- (mode->BitsPerPixel > 8 &&
- (mode->RedMaskSize + mode->GreenMaskSize +
- mode->BlueMaskSize) == pScrn->depth &&
- mode->BitsPerPixel == pScrn->bitsPerPixel) ||
- (mode->BitsPerPixel == 15 && pScrn->depth == 15) ||
- (mode->BitsPerPixel <= 8 &&
- mode->BitsPerPixel == pScrn->bitsPerPixel))) {
- modeOK = TRUE;
- xf86ErrorFVerb(DEBUG_VERB, "*");
- }
-
- /*
- * Check if there's a valid monitor mode that this one can be matched
- * up with. The actual matching is done later.
- */
- if (modeOK) {
- Bool sizeMatch = FALSE;
- modeOK = FALSE;
- for (p = pScrn->monitor->Modes; p != NULL; p = p->next) {
- if ((p->HDisplay != mode->XResolution) ||
- (p->VDisplay != mode->YResolution) ||
- (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2)))
- continue;
- sizeMatch = TRUE;
- /* XXX could support the various V_ flags */
- status = xf86CheckModeForMonitor(p, pScrn->monitor);
- if (status == MODE_OK) {
- modeOK = TRUE;
- break;
- }
- }
- if (sizeMatch && !modeOK) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Not using built-in mode \"%dx%d\" (%s)\n",
- mode->XResolution, mode->YResolution,
- xf86ModeStatusToString(status));
- }
- }
-
- xf86ErrorFVerb(DEBUG_VERB,
- "Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution);
- xf86ErrorFVerb(DEBUG_VERB,
- " ModeAttributes: 0x%x\n", mode->ModeAttributes);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinAAttributes: 0x%x\n", mode->WinAAttributes);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinBAttributes: 0x%x\n", mode->WinBAttributes);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinGranularity: %d\n", mode->WinGranularity);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinSize: %d\n", mode->WinSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinASegment: 0x%x\n", mode->WinASegment);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinBSegment: 0x%x\n", mode->WinBSegment);
- xf86ErrorFVerb(DEBUG_VERB,
- " WinFuncPtr: 0x%lx\n", (unsigned long)mode->WinFuncPtr);
- xf86ErrorFVerb(DEBUG_VERB,
- " BytesPerScanline: %d\n", mode->BytesPerScanline);
- xf86ErrorFVerb(DEBUG_VERB,
- " XResolution: %d\n", mode->XResolution);
- xf86ErrorFVerb(DEBUG_VERB,
- " YResolution: %d\n", mode->YResolution);
- xf86ErrorFVerb(DEBUG_VERB,
- " XCharSize: %d\n", mode->XCharSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " YCharSize: %d\n", mode->YCharSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " NumberOfPlanes: %d\n", mode->NumberOfPlanes);
- xf86ErrorFVerb(DEBUG_VERB,
- " BitsPerPixel: %d\n", mode->BitsPerPixel);
- xf86ErrorFVerb(DEBUG_VERB,
- " NumberOfBanks: %d\n", mode->NumberOfBanks);
- xf86ErrorFVerb(DEBUG_VERB,
- " MemoryModel: %d\n", mode->MemoryModel);
- xf86ErrorFVerb(DEBUG_VERB,
- " BankSize: %d\n", mode->BankSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " NumberOfImages: %d\n", mode->NumberOfImages);
- xf86ErrorFVerb(DEBUG_VERB,
- " RedMaskSize: %d\n", mode->RedMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " RedFieldPosition: %d\n", mode->RedFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " GreenMaskSize: %d\n", mode->GreenMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " GreenFieldPosition: %d\n", mode->GreenFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " BlueMaskSize: %d\n", mode->BlueMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " BlueFieldPosition: %d\n", mode->BlueFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " RsvdMaskSize: %d\n", mode->RsvdMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " RsvdFieldPosition: %d\n", mode->RsvdFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " DirectColorModeInfo: %d\n", mode->DirectColorModeInfo);
- if (major >= 2) {
- xf86ErrorFVerb(DEBUG_VERB,
- " PhysBasePtr: 0x%lx\n",
- (unsigned long)mode->PhysBasePtr);
- if (major >= 3) {
- xf86ErrorFVerb(DEBUG_VERB,
- " LinBytesPerScanLine: %d\n", mode->LinBytesPerScanLine);
- xf86ErrorFVerb(DEBUG_VERB,
- " BnkNumberOfImagePages: %d\n", mode->BnkNumberOfImagePages);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinNumberOfImagePages: %d\n", mode->LinNumberOfImagePages);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinRedMaskSize: %d\n", mode->LinRedMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinRedFieldPosition: %d\n", mode->LinRedFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinGreenMaskSize: %d\n", mode->LinGreenMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinGreenFieldPosition: %d\n", mode->LinGreenFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinBlueMaskSize: %d\n", mode->LinBlueMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinBlueFieldPosition: %d\n", mode->LinBlueFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinRsvdMaskSize: %d\n", mode->LinRsvdMaskSize);
- xf86ErrorFVerb(DEBUG_VERB,
- " LinRsvdFieldPosition: %d\n", mode->LinRsvdFieldPosition);
- xf86ErrorFVerb(DEBUG_VERB,
- " MaxPixelClock: %ld\n", (unsigned long)mode->MaxPixelClock);
- }
- }
-
- if (!modeOK) {
- VBEFreeModeInfo(mode);
- return NULL;
- }
- pMode = xnfcalloc(sizeof(DisplayModeRec), 1);
-
- pMode->status = MODE_OK;
- pMode->type = M_T_BUILTIN;
-
- /* for adjust frame */
- pMode->HDisplay = mode->XResolution;
- pMode->VDisplay = mode->YResolution;
-
- data = xnfcalloc(sizeof(VbeModeInfoData), 1);
- data->mode = id;
- data->data = mode;
- pMode->PrivSize = sizeof(VbeModeInfoData);
- pMode->Private = (INT32*)data;
- pMode->next = NULL;
- return pMode;
-}
-
-/*
- * Check the available BIOS modes, and extract those that match the
- * requirements into the modePool. Note: modePool is a NULL-terminated
- * list.
- */
-
-DisplayModePtr
-VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe,
- int modeTypes)
-{
- DisplayModePtr pMode, p = NULL, modePool = NULL;
- int i = 0;
-
- if (modeTypes & V_MODETYPE_VBE) {
- while (vbe->VideoModePtr[i] != 0xffff) {
- int id = vbe->VideoModePtr[i++];
-
- if ((pMode = CheckMode(pScrn, pVbe, vbe, id, modeTypes)) != NULL) {
- ModeStatus status = MODE_OK;
-
- /* Check the mode against a specified virtual size (if any) */
- if (pScrn->display->virtualX > 0 &&
- pMode->HDisplay > pScrn->display->virtualX) {
- status = MODE_VIRTUAL_X;
- }
- if (pScrn->display->virtualY > 0 &&
- pMode->VDisplay > pScrn->display->virtualY) {
- status = MODE_VIRTUAL_Y;
- }
- if (status != MODE_OK) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Not using mode \"%dx%d\" (%s)\n",
- pMode->HDisplay, pMode->VDisplay,
- xf86ModeStatusToString(status));
- } else {
- if (p == NULL) {
- modePool = pMode;
- } else {
- p->next = pMode;
- }
- pMode->prev = NULL;
- p = pMode;
- }
- }
- }
- }
- if (modeTypes & V_MODETYPE_VGA) {
- for (i = 0; i < 0x7F; i++) {
- if ((pMode = CheckMode(pScrn, pVbe, vbe, i, modeTypes)) != NULL) {
- ModeStatus status = MODE_OK;
-
- /* Check the mode against a specified virtual size (if any) */
- if (pScrn->display->virtualX > 0 &&
- pMode->HDisplay > pScrn->display->virtualX) {
- status = MODE_VIRTUAL_X;
- }
- if (pScrn->display->virtualY > 0 &&
- pMode->VDisplay > pScrn->display->virtualY) {
- status = MODE_VIRTUAL_Y;
- }
- if (status != MODE_OK) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Not using mode \"%dx%d\" (%s)\n",
- pMode->HDisplay, pMode->VDisplay,
- xf86ModeStatusToString(status));
- } else {
- if (p == NULL) {
- modePool = pMode;
- } else {
- p->next = pMode;
- }
- pMode->prev = NULL;
- p = pMode;
- }
- }
- }
- }
- return modePool;
-}
-
-void
-VBESetModeNames(DisplayModePtr pMode)
-{
- if (!pMode)
- return;
-
- do {
- if (!pMode->name) {
- /* Catch "bad" modes. */
- if (pMode->HDisplay > 10000 || pMode->HDisplay < 0 ||
- pMode->VDisplay > 10000 || pMode->VDisplay < 0) {
- pMode->name = strdup("BADMODE");
- } else {
- pMode->name = xnfalloc(4 + 1 + 4 + 1);
- sprintf(pMode->name, "%dx%d", pMode->HDisplay, pMode->VDisplay);
- }
- }
- pMode = pMode->next;
- } while (pMode);
-}
-
-/*
- * Go through the monitor modes and selecting the best set of
- * parameters for each BIOS mode. Note: This is only supported in
- * VBE version 3.0 or later.
- */
-void
-VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe)
-{
- DisplayModePtr pMode;
- VbeModeInfoData *data;
-
- pMode = pScrn->modes;
- do {
- DisplayModePtr p, best = NULL;
- ModeStatus status;
-
- for (p = pScrn->monitor->Modes; p != NULL; p = p->next) {
- if ((p->HDisplay != pMode->HDisplay) ||
- (p->VDisplay != pMode->VDisplay) ||
- (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2)))
- continue;
- /* XXX could support the various V_ flags */
- status = xf86CheckModeForMonitor(p, pScrn->monitor);
- if (status != MODE_OK)
- continue;
- if (!best || (p->Clock > best->Clock))
- best = p;
- }
-
- if (best) {
- int clock;
-
- data = (VbeModeInfoData*)pMode->Private;
- pMode->HSync = (float)best->Clock * 1000.0 / best->HTotal + 0.5;
- pMode->VRefresh = pMode->HSync / best->VTotal + 0.5;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Attempting to use %dHz refresh for mode \"%s\" (%x)\n",
- (int)pMode->VRefresh, pMode->name, data->mode);
- data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1);
- data->block->HorizontalTotal = best->HTotal;
- data->block->HorizontalSyncStart = best->HSyncStart;
- data->block->HorizontalSyncEnd = best->HSyncEnd;
- data->block->VerticalTotal = best->VTotal;
- data->block->VerticalSyncStart = best->VSyncStart;
- data->block->VerticalSyncEnd = best->VSyncEnd;
- data->block->Flags = ((best->Flags & V_NHSYNC) ? CRTC_NHSYNC : 0) |
- ((best->Flags & V_NVSYNC) ? CRTC_NVSYNC : 0);
- data->block->PixelClock = best->Clock * 1000;
- /* XXX May not have this. */
- clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock);
-#ifdef DEBUG
- ErrorF("Setting clock %.2fMHz, closest is %.2fMHz\n",
- (double)data->block->PixelClock / 1000000.0,
- (double)clock / 1000000.0);
-#endif
- if (clock)
- data->block->PixelClock = clock;
- data->mode |= (1 << 11);
- data->block->RefreshRate = ((double)(data->block->PixelClock) /
- (double)(best->HTotal * best->VTotal)) * 100;
- }
- pMode = pMode->next;
- } while (pMode != pScrn->modes);
-}
-
-/*
- * These wrappers are to allow (temporary) funtionality divergences.
- */
-int
-VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
- char **modeNames, ClockRangePtr clockRanges,
- int *linePitches, int minPitch, int maxPitch, int pitchInc,
- int minHeight, int maxHeight, int virtualX, int virtualY,
- int apertureSize, LookupModeFlags strategy)
-{
- return xf86ValidateModes(scrp, availModes, modeNames, clockRanges,
- linePitches, minPitch, maxPitch, pitchInc,
- minHeight, maxHeight, virtualX, virtualY,
- apertureSize, strategy);
-}
-
-void
-VBEPrintModes(ScrnInfoPtr scrp)
-{
- xf86PrintModes(scrp);
-}
-
diff --git a/hw/xfree86/vbe/vbeModes.h b/hw/xfree86/vbe/vbeModes.h
deleted file mode 100644
index b3c57b917..000000000
--- a/hw/xfree86/vbe/vbeModes.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright © 2002 David Dawes
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of the author(s) shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * the author(s).
- *
- * Authors: David Dawes <dawes@xfree86.org>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.h,v 1.1 2003/02/17 17:06:46 dawes Exp $
- */
-
-#ifndef _VBE_MODES_H
-
-/*
- * This is intended to be stored in the DisplayModeRec's private area.
- * It includes all the information necessary to VBE information.
- */
-typedef struct _VbeModeInfoData {
- int mode;
- VbeModeInfoBlock *data;
- VbeCRTCInfoBlock *block;
-} VbeModeInfoData;
-
-#define V_DEPTH_1 0x001
-#define V_DEPTH_4 0x002
-#define V_DEPTH_8 0x004
-#define V_DEPTH_15 0x008
-#define V_DEPTH_16 0x010
-#define V_DEPTH_24_24 0x020
-#define V_DEPTH_24_32 0x040
-#define V_DEPTH_24 (V_DEPTH_24_24 | V_DEPTH_24_32)
-#define V_DEPTH_30 0x080
-#define V_DEPTH_32 0x100
-
-#define VBE_MODE_SUPPORTED(m) (((m)->ModeAttributes & 0x01) != 0)
-#define VBE_MODE_COLOR(m) (((m)->ModeAttributes & 0x08) != 0)
-#define VBE_MODE_GRAPHICS(m) (((m)->ModeAttributes & 0x10) != 0)
-#define VBE_MODE_VGA(m) (((m)->ModeAttributes & 0x40) == 0)
-#define VBE_MODE_LINEAR(m) (((m)->ModeAttributes & 0x80) != 0 && \
- ((m)->PhysBasePtr != 0))
-
-#define VBE_MODE_USABLE(m, f) (VBE_MODE_SUPPORTED(m) || \
- (f & V_MODETYPE_BAD)) && \
- VBE_MODE_GRAPHICS(m) && \
- (VBE_MODE_VGA(m) || VBE_MODE_LINEAR(m))
-
-#define V_MODETYPE_VBE 0x01
-#define V_MODETYPE_VGA 0x02
-#define V_MODETYPE_BAD 0x04
-
-extern int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock *vbe,
- int *flags24, int modeTypes);
-extern DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe,
- VbeInfoBlock *vbe, int modeTypes);
-extern void VBESetModeNames(DisplayModePtr pMode);
-extern void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe);
-
-
-/*
- * Note: These are alternatives to the standard helpers. They should
- * usually just wrap the standard helpers.
- */
-extern int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
- char **modeNames, ClockRangePtr clockRanges,
- int *linePitches, int minPitch, int maxPitch,
- int pitchInc, int minHeight, int maxHeight,
- int virtualX, int virtualY, int apertureSize,
- LookupModeFlags strategy);
-extern void VBEPrintModes(ScrnInfoPtr scrp);
-
-#endif /* VBE_MODES_H */
diff --git a/hw/xfree86/vbe/vbe_module.c b/hw/xfree86/vbe/vbe_module.c
deleted file mode 100644
index 65b161a2c..000000000
--- a/hw/xfree86/vbe/vbe_module.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe_module.c,v 1.1 2003/02/17 17:06:46 dawes Exp $ */
-
-#include "xf86.h"
-#include "xf86str.h"
-#include "vbe.h"
-
-extern const char *vbe_ddcSymbols[];
-
-#ifdef XFree86LOADER
-
-static MODULESETUPPROTO(vbeSetup);
-
-static XF86ModuleVersionInfo vbeVersRec =
-{
- "vbe",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 1, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData vbeModuleData = { &vbeVersRec, vbeSetup, NULL };
-
-static pointer
-vbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- LoaderRefSymLists(vbe_ddcSymbols,NULL);
- /*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
-
-#endif
-
diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c
deleted file mode 100644
index a70f572b5..000000000
--- a/hw/xfree86/vgahw/vgaCmap.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaCmap.c,v 1.7 2001/02/15 18:31:22 eich Exp $ */
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XConsortium: vgaCmap.c /main/15 1996/10/28 05:13:44 kaleb $ */
-
-
-#include "X.h"
-#include "Xproto.h"
-#include "windowstr.h"
-#include "compiler.h"
-#include "mipointer.h"
-#include "micmap.h"
-
-#include "xf86.h"
-#include "vgaHW.h"
-#include "xf86_ansic.h"
-
-#define _XF86DGA_SERVER_
-#include "extensions/xf86dgastr.h"
-#include "dgaproc.h"
-
-
-#define NOMAPYET (ColormapPtr) 0
-
-int
-vgaListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
-
- *pmaps = miInstalledMaps[pScreen->myNum]->mid;
- return(1);
-}
-
-int
-vgaGetInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- ColormapPtr *pmaps;
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
-
- *pmaps = miInstalledMaps[pScreen->myNum];
- return(1);
-}
-
-int vgaCheckColorMap(ColormapPtr pmap)
-{
- return (pmap != miInstalledMaps[pmap->pScreen->myNum]);
-}
-
-
-void
-vgaStoreColors(pmap, ndef, pdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *pdefs;
-{
- int i;
- unsigned char *cmap, *tmp = NULL;
- xColorItem directDefs[256];
- Bool new_overscan = FALSE;
- Bool writeColormap;
-
- /* This can get called before the ScrnInfoRec is installed so we
- can't rely on getting it with XF86SCRNINFO() */
- int scrnIndex = pmap->pScreen->myNum;
- ScrnInfoPtr scrninfp = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
-
- unsigned char overscan = hwp->ModeReg.Attribute[OVERSCAN];
- unsigned char tmp_overscan = 0;
-
- if (vgaCheckColorMap(pmap))
- return;
-
- if ((pmap->pVisual->class | DynamicClass) == DirectColor)
- {
- ndef = miExpandDirectColors (pmap, ndef, pdefs, directDefs);
- pdefs = directDefs;
- }
-
- writeColormap = scrninfp->vtSema;
- if (DGAAvailable(scrnIndex))
- {
- writeColormap = writeColormap ||
- (DGAGetDirectMode(scrnIndex) &&
- !(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) ||
- (DGAGetFlags(scrnIndex) & XF86DGAHasColormap);
- }
-
- if (writeColormap)
- hwp->enablePalette(hwp);
-
- for(i = 0; i < ndef; i++)
- {
- if (pdefs[i].pixel == overscan)
- {
- new_overscan = TRUE;
- }
- cmap = &(hwp->ModeReg.DAC[pdefs[i].pixel*3]);
- if (scrninfp->rgbBits == 8) {
- cmap[0] = pdefs[i].red >> 8;
- cmap[1] = pdefs[i].green >> 8;
- cmap[2] = pdefs[i].blue >> 8;
- }
- else {
- cmap[0] = pdefs[i].red >> 10;
- cmap[1] = pdefs[i].green >> 10;
- cmap[2] = pdefs[i].blue >> 10;
- }
-#if 0
- if (clgd6225Lcd)
- {
- /* The LCD doesn't like white */
- if (cmap[0] == 63) cmap[0]= 62;
- if (cmap[1] == 63) cmap[1]= 62;
- if (cmap[2] == 63) cmap[2]= 62;
- }
-#endif
-
- if (writeColormap)
- {
- if (hwp->ShowOverscan && i == 255)
- continue;
- hwp->writeDacWriteAddr(hwp, pdefs[i].pixel);
- DACDelay(hwp);
- hwp->writeDacData(hwp, cmap[0]);
- DACDelay(hwp);
- hwp->writeDacData(hwp, cmap[1]);
- DACDelay(hwp);
- hwp->writeDacData(hwp, cmap[2]);
- DACDelay(hwp);
- }
- }
- if (new_overscan && !hwp->ShowOverscan)
- {
- new_overscan = FALSE;
- for(i = 0; i < ndef; i++)
- {
- if (pdefs[i].pixel == overscan)
- {
- if ((pdefs[i].red != 0) ||
- (pdefs[i].green != 0) ||
- (pdefs[i].blue != 0))
- {
- new_overscan = TRUE;
- tmp_overscan = overscan;
- tmp = &(hwp->ModeReg.DAC[pdefs[i].pixel*3]);
- }
- break;
- }
- }
- if (new_overscan)
- {
- /*
- * Find a black pixel, or the nearest match.
- */
- for (i=255; i >= 0; i--)
- {
- cmap = &(hwp->ModeReg.DAC[i*3]);
- if ((cmap[0] == 0) && (cmap[1] == 0) && (cmap[2] == 0))
- {
- overscan = i;
- break;
- }
- else
- {
- if ((cmap[0] < tmp[0]) &&
- (cmap[1] < tmp[1]) && (cmap[2] < tmp[2]))
- {
- tmp = cmap;
- tmp_overscan = i;
- }
- }
- }
- if (i < 0)
- {
- overscan = tmp_overscan;
- }
- hwp->ModeReg.Attribute[OVERSCAN] = overscan;
- if (writeColormap)
- {
- hwp->writeAttr(hwp, OVERSCAN, overscan);
- }
- }
- }
-
- if (writeColormap)
- hwp->disablePalette(hwp);
-}
-
-
-void
-vgaInstallColormap(pmap)
- ColormapPtr pmap;
-{
- ColormapPtr oldmap = miInstalledMaps[pmap->pScreen->myNum];
- int entries;
- Pixel * ppix;
- xrgb * prgb;
- xColorItem *defs;
- int i;
-
-
- if (pmap == oldmap)
- return;
-
- if ((pmap->pVisual->class | DynamicClass) == DirectColor)
- entries = (pmap->pVisual->redMask |
- pmap->pVisual->greenMask |
- pmap->pVisual->blueMask) + 1;
- else
- entries = pmap->pVisual->ColormapEntries;
-
- ppix = (Pixel *)ALLOCATE_LOCAL( entries * sizeof(Pixel));
- prgb = (xrgb *)ALLOCATE_LOCAL( entries * sizeof(xrgb));
- defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
-
- if ( oldmap != NOMAPYET)
- WalkTree( pmap->pScreen, TellLostMap, &oldmap->mid);
-
- miInstalledMaps[pmap->pScreen->myNum] = pmap;
-
- for ( i=0; i<entries; i++) ppix[i] = i;
-
- QueryColors( pmap, entries, ppix, prgb);
-
- for ( i=0; i<entries; i++) /* convert xrgbs to xColorItems */
- {
- defs[i].pixel = ppix[i];
- defs[i].red = prgb[i].red;
- defs[i].green = prgb[i].green;
- defs[i].blue = prgb[i].blue;
- defs[i].flags = DoRed|DoGreen|DoBlue;
- }
- pmap->pScreen->StoreColors(pmap, entries, defs);
-
- WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid);
-
- DEALLOCATE_LOCAL(ppix);
- DEALLOCATE_LOCAL(prgb);
- DEALLOCATE_LOCAL(defs);
-}
-
-
-void
-vgaUninstallColormap(pmap)
- ColormapPtr pmap;
-{
-
- ColormapPtr defColormap;
-
- if ( pmap != miInstalledMaps[pmap->pScreen->myNum] )
- return;
-
- defColormap = (ColormapPtr) LookupIDByType( pmap->pScreen->defColormap,
- RT_COLORMAP);
-
- if (defColormap == miInstalledMaps[pmap->pScreen->myNum])
- return;
-
- (*pmap->pScreen->InstallColormap) (defColormap);
-}
-
-
-void
-vgaHandleColormaps(ScreenPtr pScreen, ScrnInfoPtr scrnp)
-{
- if (scrnp->bitsPerPixel > 1) {
- if (scrnp->bitsPerPixel <= 8) { /* For 8bpp SVGA and VGA16 */
- pScreen->InstallColormap = vgaInstallColormap;
- pScreen->UninstallColormap = vgaUninstallColormap;
- pScreen->ListInstalledColormaps = vgaListInstalledColormaps;
- pScreen->StoreColors = vgaStoreColors;
- }
- }
-}
-
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
deleted file mode 100644
index e1fd9716a..000000000
--- a/hw/xfree86/vgahw/vgaHW.c
+++ /dev/null
@@ -1,2005 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.58 2003/11/03 05:11:53 tsi Exp $ */
-
-/*
- *
- * Copyright 1991-1999 by The XFree86 Project, Inc.
- *
- * Loosely based on code bearing the following copyright:
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- */
-
-#define _NEED_SYSI86
-
-#include "X.h"
-#include "misc.h"
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
-#include "vgaHW.h"
-
-#include "compiler.h"
-
-#include "xf86cmap.h"
-
-#ifndef SAVE_FONT1
-#define SAVE_FONT1
-#endif
-
-/*
- * These used to be OS-specific, which made this module have an undesirable
- * OS dependency. Define them by default for all platforms.
- */
-#ifndef NEED_SAVED_CMAP
-#define NEED_SAVED_CMAP
-#endif
-#ifndef SAVE_TEXT
-#define SAVE_TEXT
-#endif
-#ifndef SAVE_FONT2
-#define SAVE_FONT2
-#endif
-
-/* bytes per plane to save for text */
-#define TEXT_AMOUNT 16384
-
-/* bytes per plane to save for font data */
-#define FONT_AMOUNT (8*8192)
-
-#if 0
-/* Override all of these for now */
-#undef SAVE_FONT1
-#define SAVE_FONT1
-#undef SAVE_FONT2
-#define SAVE_FONT2
-#undef SAVE_TEST
-#define SAVE_TEST
-#undef FONT_AMOUNT
-#define FONT_AMOUNT 65536
-#undef TEXT_AMOUNT
-#define TEXT_AMOUNT 65536
-#endif
-
-/* DAC indices for white and black */
-#define WHITE_VALUE 0x3F
-#define BLACK_VALUE 0x00
-#define OVERSCAN_VALUE 0x01
-
-
-/* Use a private definition of this here */
-#undef VGAHWPTR
-#define VGAHWPTRLVAL(p) (p)->privates[vgaHWPrivateIndex].ptr
-#define VGAHWPTR(p) ((vgaHWPtr)(VGAHWPTRLVAL(p)))
-
-static int vgaHWPrivateIndex = -1;
-
-#define DAC_TEST_MASK 0x3F
-
-#ifdef NEED_SAVED_CMAP
-/* This default colourmap is used only when it can't be read from the VGA */
-
-static CARD8 defaultDAC[768] =
-{
- 0, 0, 0, 0, 0, 42, 0, 42, 0, 0, 42, 42,
- 42, 0, 0, 42, 0, 42, 42, 21, 0, 42, 42, 42,
- 21, 21, 21, 21, 21, 63, 21, 63, 21, 21, 63, 63,
- 63, 21, 21, 63, 21, 63, 63, 63, 21, 63, 63, 63,
- 0, 0, 0, 5, 5, 5, 8, 8, 8, 11, 11, 11,
- 14, 14, 14, 17, 17, 17, 20, 20, 20, 24, 24, 24,
- 28, 28, 28, 32, 32, 32, 36, 36, 36, 40, 40, 40,
- 45, 45, 45, 50, 50, 50, 56, 56, 56, 63, 63, 63,
- 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0, 63,
- 63, 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16,
- 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0,
- 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63, 0,
- 0, 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47,
- 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63,
- 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31, 63,
- 63, 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39,
- 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31,
- 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63, 31,
- 31, 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55,
- 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63,
- 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45, 63,
- 63, 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49,
- 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45,
- 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63, 45,
- 45, 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58,
- 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63,
- 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0, 28,
- 28, 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7,
- 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0,
- 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28, 0,
- 0, 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21,
- 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28,
- 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14, 28,
- 28, 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17,
- 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14,
- 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28, 14,
- 14, 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24,
- 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28,
- 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20, 28,
- 28, 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22,
- 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20,
- 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28, 20,
- 20, 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26,
- 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28,
- 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0, 16,
- 16, 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4,
- 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0,
- 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16, 0,
- 0, 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12,
- 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16,
- 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8, 16,
- 16, 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10,
- 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8,
- 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16, 8,
- 8, 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14,
- 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16,
- 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11, 16,
- 16, 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12,
- 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11,
- 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16, 11,
- 11, 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15,
- 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-#endif /* NEED_SAVED_CMAP */
-
-/*
- * Standard VGA versions of the register access functions.
- */
-static void
-stdWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
- outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET, value);
-}
-
-static CARD8
-stdReadCrtc(vgaHWPtr hwp, CARD8 index)
-{
- outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
- return inb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET);
-}
-
-static void
-stdWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
- outb(hwp->PIOOffset + VGA_GRAPH_DATA, value);
-}
-
-static CARD8
-stdReadGr(vgaHWPtr hwp, CARD8 index)
-{
- outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
- return inb(hwp->PIOOffset + VGA_GRAPH_DATA);
-}
-
-static void
-stdWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
- outb(hwp->PIOOffset + VGA_SEQ_DATA, value);
-}
-
-static CARD8
-stdReadSeq(vgaHWPtr hwp, CARD8 index)
-{
- outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
- return inb(hwp->PIOOffset + VGA_SEQ_DATA);
-}
-
-static CARD8
-stdReadST00(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_IN_STAT_0);
-}
-
-static CARD8
-stdReadST01(vgaHWPtr hwp)
-{
- return inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
-}
-
-static CARD8
-stdReadFCR(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_FEATURE_R);
-}
-
-static void
-stdWriteFCR(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->IOBase + hwp->PIOOffset + VGA_FEATURE_W_OFFSET,value);
-}
-
-static void
-stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- if (hwp->paletteEnabled)
- index &= ~0x20;
- else
- index |= 0x20;
-
- (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
- outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
- outb(hwp->PIOOffset + VGA_ATTR_DATA_W, value);
-}
-
-static CARD8
-stdReadAttr(vgaHWPtr hwp, CARD8 index)
-{
- if (hwp->paletteEnabled)
- index &= ~0x20;
- else
- index |= 0x20;
-
- (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
- outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
- return inb(hwp->PIOOffset + VGA_ATTR_DATA_R);
-}
-
-static void
-stdWriteMiscOut(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_MISC_OUT_W, value);
-}
-
-static CARD8
-stdReadMiscOut(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_MISC_OUT_R);
-}
-
-static void
-stdEnablePalette(vgaHWPtr hwp)
-{
- (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
- outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00);
- hwp->paletteEnabled = TRUE;
-}
-
-static void
-stdDisablePalette(vgaHWPtr hwp)
-{
- (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
- outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20);
- hwp->paletteEnabled = FALSE;
-}
-
-static void
-stdWriteDacMask(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_DAC_MASK, value);
-}
-
-static CARD8
-stdReadDacMask(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_DAC_MASK);
-}
-
-static void
-stdWriteDacReadAddr(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_DAC_READ_ADDR, value);
-}
-
-static void
-stdWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_DAC_WRITE_ADDR, value);
-}
-
-static void
-stdWriteDacData(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_DAC_DATA, value);
-}
-
-static CARD8
-stdReadDacData(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_DAC_DATA);
-}
-
-static CARD8
-stdReadEnable(vgaHWPtr hwp)
-{
- return inb(hwp->PIOOffset + VGA_ENABLE);
-}
-
-static void
-stdWriteEnable(vgaHWPtr hwp, CARD8 value)
-{
- outb(hwp->PIOOffset + VGA_ENABLE, value);
-}
-
-void
-vgaHWSetStdFuncs(vgaHWPtr hwp)
-{
- hwp->writeCrtc = stdWriteCrtc;
- hwp->readCrtc = stdReadCrtc;
- hwp->writeGr = stdWriteGr;
- hwp->readGr = stdReadGr;
- hwp->readST00 = stdReadST00;
- hwp->readST01 = stdReadST01;
- hwp->readFCR = stdReadFCR;
- hwp->writeFCR = stdWriteFCR;
- hwp->writeAttr = stdWriteAttr;
- hwp->readAttr = stdReadAttr;
- hwp->writeSeq = stdWriteSeq;
- hwp->readSeq = stdReadSeq;
- hwp->writeMiscOut = stdWriteMiscOut;
- hwp->readMiscOut = stdReadMiscOut;
- hwp->enablePalette = stdEnablePalette;
- hwp->disablePalette = stdDisablePalette;
- hwp->writeDacMask = stdWriteDacMask;
- hwp->readDacMask = stdReadDacMask;
- hwp->writeDacWriteAddr = stdWriteDacWriteAddr;
- hwp->writeDacReadAddr = stdWriteDacReadAddr;
- hwp->writeDacData = stdWriteDacData;
- hwp->readDacData = stdReadDacData;
- hwp->PIOOffset = 0;
- hwp->readEnable = stdReadEnable;
- hwp->writeEnable = stdWriteEnable;
-}
-
-/*
- * MMIO versions of the register access functions. These require
- * hwp->MemBase to be set in such a way that when the standard VGA port
- * adderss is added the correct memory address results.
- */
-
-#define minb(p) MMIO_IN8(hwp->MMIOBase, (hwp->MMIOOffset + (p)))
-#define moutb(p,v) MMIO_OUT8(hwp->MMIOBase, (hwp->MMIOOffset + (p)),(v))
-
-static void
-mmioWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
- moutb(hwp->IOBase + VGA_CRTC_DATA_OFFSET, value);
-}
-
-static CARD8
-mmioReadCrtc(vgaHWPtr hwp, CARD8 index)
-{
- moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
- return minb(hwp->IOBase + VGA_CRTC_DATA_OFFSET);
-}
-
-static void
-mmioWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- moutb(VGA_GRAPH_INDEX, index);
- moutb(VGA_GRAPH_DATA, value);
-}
-
-static CARD8
-mmioReadGr(vgaHWPtr hwp, CARD8 index)
-{
- moutb(VGA_GRAPH_INDEX, index);
- return minb(VGA_GRAPH_DATA);
-}
-
-static void
-mmioWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- moutb(VGA_SEQ_INDEX, index);
- moutb(VGA_SEQ_DATA, value);
-}
-
-static CARD8
-mmioReadSeq(vgaHWPtr hwp, CARD8 index)
-{
- moutb(VGA_SEQ_INDEX, index);
- return minb(VGA_SEQ_DATA);
-}
-
-static CARD8
-mmioReadST00(vgaHWPtr hwp)
-{
- return minb(VGA_IN_STAT_0);
-}
-
-static CARD8
-mmioReadST01(vgaHWPtr hwp)
-{
- return minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
-}
-
-static CARD8
-mmioReadFCR(vgaHWPtr hwp)
-{
- return minb(VGA_FEATURE_R);
-}
-
-static void
-mmioWriteFCR(vgaHWPtr hwp, CARD8 value)
-{
- moutb(hwp->IOBase + VGA_FEATURE_W_OFFSET,value);
-}
-
-static void
-mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value)
-{
- if (hwp->paletteEnabled)
- index &= ~0x20;
- else
- index |= 0x20;
-
- (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
- moutb(VGA_ATTR_INDEX, index);
- moutb(VGA_ATTR_DATA_W, value);
-}
-
-static CARD8
-mmioReadAttr(vgaHWPtr hwp, CARD8 index)
-{
- if (hwp->paletteEnabled)
- index &= ~0x20;
- else
- index |= 0x20;
-
- (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
- moutb(VGA_ATTR_INDEX, index);
- return minb(VGA_ATTR_DATA_R);
-}
-
-static void
-mmioWriteMiscOut(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_MISC_OUT_W, value);
-}
-
-static CARD8
-mmioReadMiscOut(vgaHWPtr hwp)
-{
- return minb(VGA_MISC_OUT_R);
-}
-
-static void
-mmioEnablePalette(vgaHWPtr hwp)
-{
- (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
- moutb(VGA_ATTR_INDEX, 0x00);
- hwp->paletteEnabled = TRUE;
-}
-
-static void
-mmioDisablePalette(vgaHWPtr hwp)
-{
- (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
- moutb(VGA_ATTR_INDEX, 0x20);
- hwp->paletteEnabled = FALSE;
-}
-
-static void
-mmioWriteDacMask(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_DAC_MASK, value);
-}
-
-static CARD8
-mmioReadDacMask(vgaHWPtr hwp)
-{
- return minb(VGA_DAC_MASK);
-}
-
-static void
-mmioWriteDacReadAddr(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_DAC_READ_ADDR, value);
-}
-
-static void
-mmioWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_DAC_WRITE_ADDR, value);
-}
-
-static void
-mmioWriteDacData(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_DAC_DATA, value);
-}
-
-static CARD8
-mmioReadDacData(vgaHWPtr hwp)
-{
- return minb(VGA_DAC_DATA);
-}
-
-static CARD8
-mmioReadEnable(vgaHWPtr hwp)
-{
- return minb(VGA_ENABLE);
-}
-
-static void
-mmioWriteEnable(vgaHWPtr hwp, CARD8 value)
-{
- moutb(VGA_ENABLE, value);
-}
-
-void
-vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset)
-{
- hwp->writeCrtc = mmioWriteCrtc;
- hwp->readCrtc = mmioReadCrtc;
- hwp->writeGr = mmioWriteGr;
- hwp->readGr = mmioReadGr;
- hwp->readST00 = mmioReadST00;
- hwp->readST01 = mmioReadST01;
- hwp->readFCR = mmioReadFCR;
- hwp->writeFCR = mmioWriteFCR;
- hwp->writeAttr = mmioWriteAttr;
- hwp->readAttr = mmioReadAttr;
- hwp->writeSeq = mmioWriteSeq;
- hwp->readSeq = mmioReadSeq;
- hwp->writeMiscOut = mmioWriteMiscOut;
- hwp->readMiscOut = mmioReadMiscOut;
- hwp->enablePalette = mmioEnablePalette;
- hwp->disablePalette = mmioDisablePalette;
- hwp->writeDacMask = mmioWriteDacMask;
- hwp->readDacMask = mmioReadDacMask;
- hwp->writeDacWriteAddr = mmioWriteDacWriteAddr;
- hwp->writeDacReadAddr = mmioWriteDacReadAddr;
- hwp->writeDacData = mmioWriteDacData;
- hwp->readDacData = mmioReadDacData;
- hwp->MMIOBase = base;
- hwp->MMIOOffset = offset;
- hwp->readEnable = mmioReadEnable;
- hwp->writeEnable = mmioWriteEnable;
-}
-
-/*
- * vgaHWProtect --
- * Protect VGA registers and memory from corruption during loads.
- */
-
-void
-vgaHWProtect(ScrnInfoPtr pScrn, Bool on)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
-
- unsigned char tmp;
-
- if (pScrn->vtSema) {
- if (on) {
- /*
- * Turn off screen and disable sequencer.
- */
- tmp = hwp->readSeq(hwp, 0x01);
-
- vgaHWSeqReset(hwp, TRUE); /* start synchronous reset */
- hwp->writeSeq(hwp, 0x01, tmp | 0x20); /* disable the display */
-
- hwp->enablePalette(hwp);
- } else {
- /*
- * Reenable sequencer, then turn on screen.
- */
-
- tmp = hwp->readSeq(hwp, 0x01);
-
- hwp->writeSeq(hwp, 0x01, tmp & ~0x20); /* reenable display */
- vgaHWSeqReset(hwp, FALSE); /* clear synchronousreset */
-
- hwp->disablePalette(hwp);
- }
- }
-}
-
-
-/*
- * vgaHWBlankScreen -- blank the screen.
- */
-
-void
-vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- unsigned char scrn;
-
- scrn = hwp->readSeq(hwp, 0x01);
-
- if (on) {
- scrn &= ~0x20; /* enable screen */
- } else {
- scrn |= 0x20; /* blank screen */
- }
-
- vgaHWSeqReset(hwp, TRUE);
- hwp->writeSeq(hwp, 0x01, scrn); /* change mode */
- vgaHWSeqReset(hwp, FALSE);
-}
-
-
-/*
- * vgaHWSaveScreen -- blank the screen.
- */
-
-Bool
-vgaHWSaveScreen(ScreenPtr pScreen, int mode)
-{
- ScrnInfoPtr pScrn = NULL;
- Bool on;
-
- if (pScreen != NULL)
- pScrn = xf86Screens[pScreen->myNum];
-
- on = xf86IsUnblank(mode);
-
-#if 0
- if (on)
- SetTimeSinceLastInputEvent();
-#endif
-
- if ((pScrn != NULL) && pScrn->vtSema) {
- vgaHWBlankScreen(pScrn, on);
- }
- return (TRUE);
-}
-
-
-/*
- * vgaHWDPMSSet -- Sets VESA Display Power Management Signaling (DPMS) Mode
- *
- * This generic VGA function can only set the Off and On modes. If the
- * Standby and Suspend modes are to be supported, a chip specific replacement
- * for this function must be written.
- */
-
-void
-vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags)
-{
- unsigned char seq1 = 0, crtc17 = 0;
- vgaHWPtr hwp = VGAHWPTR(pScrn);
-
- if (!pScrn->vtSema) return;
-
- switch (PowerManagementMode) {
- case DPMSModeOn:
- /* Screen: On; HSync: On, VSync: On */
- seq1 = 0x00;
- crtc17 = 0x80;
- break;
- case DPMSModeStandby:
- /* Screen: Off; HSync: Off, VSync: On -- Not Supported */
- seq1 = 0x20;
- crtc17 = 0x80;
- break;
- case DPMSModeSuspend:
- /* Screen: Off; HSync: On, VSync: Off -- Not Supported */
- seq1 = 0x20;
- crtc17 = 0x80;
- break;
- case DPMSModeOff:
- /* Screen: Off; HSync: Off, VSync: Off */
- seq1 = 0x20;
- crtc17 = 0x00;
- break;
- }
- hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */
- seq1 |= hwp->readSeq(hwp, 0x01) & ~0x20;
- hwp->writeSeq(hwp, 0x01, seq1);
- crtc17 |= hwp->readCrtc(hwp, 0x17) & ~0x80;
- usleep(10000);
- hwp->writeCrtc(hwp, 0x17, crtc17);
- hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */
-}
-
-
-/*
- * vgaHWSeqReset
- * perform a sequencer reset.
- */
-
-void
-vgaHWSeqReset(vgaHWPtr hwp, Bool start)
-{
- if (start)
- hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */
- else
- hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */
-}
-
-
-void
-vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- int savedIOBase;
- unsigned char miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4;
- Bool doMap = FALSE;
-
-#if defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2)
-
- /* If nothing to do, return now */
- if (!hwp->FontInfo1 && !hwp->FontInfo2 && !hwp->TextInfo)
- return;
-
- if (hwp->Base == NULL) {
- doMap = TRUE;
- if (!vgaHWMapMem(scrninfp)) {
- xf86DrvMsg(scrninfp->scrnIndex, X_ERROR,
- "vgaHWRestoreFonts: vgaHWMapMem() failed\n");
- return;
- }
- }
-
- /* save the registers that are needed here */
- miscOut = hwp->readMiscOut(hwp);
- attr10 = hwp->readAttr(hwp, 0x10);
- gr1 = hwp->readGr(hwp, 0x01);
- gr3 = hwp->readGr(hwp, 0x03);
- gr4 = hwp->readGr(hwp, 0x04);
- gr5 = hwp->readGr(hwp, 0x05);
- gr6 = hwp->readGr(hwp, 0x06);
- gr8 = hwp->readGr(hwp, 0x08);
- seq2 = hwp->readSeq(hwp, 0x02);
- seq4 = hwp->readSeq(hwp, 0x04);
-
- /* save hwp->IOBase and temporarily set it for colour mode */
- savedIOBase = hwp->IOBase;
- hwp->IOBase = VGA_IOBASE_COLOR;
-
- /* Force into colour mode */
- hwp->writeMiscOut(hwp, miscOut | 0x01);
-
- vgaHWBlankScreen(scrninfp, FALSE);
-
- /*
- * here we temporarily switch to 16 colour planar mode, to simply
- * copy the font-info and saved text.
- *
- * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly!
- */
-#if 0
- hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */
-#endif
- if (scrninfp->depth == 4) {
- /* GJA */
- hwp->writeGr(hwp, 0x03, 0x00); /* don't rotate, write unmodified */
- hwp->writeGr(hwp, 0x08, 0xFF); /* write all bits in a byte */
- hwp->writeGr(hwp, 0x01, 0x00); /* all planes come from CPU */
- }
-
-#ifdef SAVE_FONT1
- if (hwp->FontInfo1) {
- hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
- }
-#endif
-
-#ifdef SAVE_FONT2
- if (hwp->FontInfo2) {
- hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
- }
-#endif
-
-#ifdef SAVE_TEXT
- if (hwp->TextInfo) {
- hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
- hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
- hwp->Base, TEXT_AMOUNT);
- }
-#endif
-
- vgaHWBlankScreen(scrninfp, TRUE);
-
- /* restore the registers that were changed */
- hwp->writeMiscOut(hwp, miscOut);
- hwp->writeAttr(hwp, 0x10, attr10);
- hwp->writeGr(hwp, 0x01, gr1);
- hwp->writeGr(hwp, 0x03, gr3);
- hwp->writeGr(hwp, 0x04, gr4);
- hwp->writeGr(hwp, 0x05, gr5);
- hwp->writeGr(hwp, 0x06, gr6);
- hwp->writeGr(hwp, 0x08, gr8);
- hwp->writeSeq(hwp, 0x02, seq2);
- hwp->writeSeq(hwp, 0x04, seq4);
- hwp->IOBase = savedIOBase;
-
- if (doMap)
- vgaHWUnmapMem(scrninfp);
-
-#endif /* defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2) */
-}
-
-
-void
-vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- int i;
-
- if (restore->MiscOutReg & 0x01)
- hwp->IOBase = VGA_IOBASE_COLOR;
- else
- hwp->IOBase = VGA_IOBASE_MONO;
-
- hwp->writeMiscOut(hwp, restore->MiscOutReg);
-
- for (i = 1; i < restore->numSequencer; i++)
- hwp->writeSeq(hwp, i, restore->Sequencer[i]);
-
- /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 or CRTC[17] */
-
- hwp->writeCrtc(hwp, 17, restore->CRTC[17] & ~0x80);
-
- for (i = 0; i < restore->numCRTC; i++)
- hwp->writeCrtc(hwp, i, restore->CRTC[i]);
-
- for (i = 0; i < restore->numGraphics; i++)
- hwp->writeGr(hwp, i, restore->Graphics[i]);
-
- hwp->enablePalette(hwp);
- for (i = 0; i < restore->numAttribute; i++)
- hwp->writeAttr(hwp, i, restore->Attribute[i]);
- hwp->disablePalette(hwp);
-}
-
-
-void
-vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- int i;
-
-#if 0
- hwp->enablePalette(hwp);
-#endif
-
- hwp->writeDacMask(hwp, 0xFF);
- hwp->writeDacWriteAddr(hwp, 0x00);
- for (i = 0; i < 768; i++) {
- hwp->writeDacData(hwp, restore->DAC[i]);
- DACDelay(hwp);
- }
-
- hwp->disablePalette(hwp);
-}
-
-
-/*
- * vgaHWRestore --
- * restore the VGA state
- */
-
-void
-vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags)
-{
- if (flags & VGA_SR_MODE)
- vgaHWRestoreMode(scrninfp, restore);
-
- if (flags & VGA_SR_FONTS)
- vgaHWRestoreFonts(scrninfp, restore);
-
- if (flags & VGA_SR_CMAP)
- vgaHWRestoreColormap(scrninfp, restore);
-}
-
-void
-vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- int savedIOBase;
- unsigned char miscOut, attr10, gr4, gr5, gr6, seq2, seq4;
- Bool doMap = FALSE;
-
-#if defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2)
-
- if (hwp->Base == NULL) {
- doMap = TRUE;
- if (!vgaHWMapMem(scrninfp)) {
- xf86DrvMsg(scrninfp->scrnIndex, X_ERROR,
- "vgaHWSaveFonts: vgaHWMapMem() failed\n");
- return;
- }
- }
-
- /* If in graphics mode, don't save anything */
- attr10 = hwp->readAttr(hwp, 0x10);
- if (attr10 & 0x01)
- return;
-
- /* save the registers that are needed here */
- miscOut = hwp->readMiscOut(hwp);
- gr4 = hwp->readGr(hwp, 0x04);
- gr5 = hwp->readGr(hwp, 0x05);
- gr6 = hwp->readGr(hwp, 0x06);
- seq2 = hwp->readSeq(hwp, 0x02);
- seq4 = hwp->readSeq(hwp, 0x04);
-
- /* save hwp->IOBase and temporarily set it for colour mode */
- savedIOBase = hwp->IOBase;
- hwp->IOBase = VGA_IOBASE_COLOR;
-
- /* Force into colour mode */
- hwp->writeMiscOut(hwp, miscOut | 0x01);
-
- vgaHWBlankScreen(scrninfp, FALSE);
-
- /*
- * get the character sets, and text screen if required
- */
- /*
- * Here we temporarily switch to 16 colour planar mode, to simply
- * copy the font-info
- *
- * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly!
- */
-#if 0
- hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */
-#endif
-#ifdef SAVE_FONT1
- if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
- hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
- }
-#endif /* SAVE_FONT1 */
-#ifdef SAVE_FONT2
- if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
- hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
- }
-#endif /* SAVE_FONT2 */
-#ifdef SAVE_TEXT
- if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
- hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
- hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
- hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
- slowbcopy_frombus(hwp->Base,
- (unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
- }
-#endif /* SAVE_TEXT */
-
- /* Restore clobbered registers */
- hwp->writeAttr(hwp, 0x10, attr10);
- hwp->writeSeq(hwp, 0x02, seq2);
- hwp->writeSeq(hwp, 0x04, seq4);
- hwp->writeGr(hwp, 0x04, gr4);
- hwp->writeGr(hwp, 0x05, gr5);
- hwp->writeGr(hwp, 0x06, gr6);
- hwp->writeMiscOut(hwp, miscOut);
- hwp->IOBase = savedIOBase;
-
- vgaHWBlankScreen(scrninfp, TRUE);
-
- if (doMap)
- vgaHWUnmapMem(scrninfp);
-
-#endif /* defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2) */
-}
-
-void
-vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- int i;
-
- save->MiscOutReg = hwp->readMiscOut(hwp);
- if (save->MiscOutReg & 0x01)
- hwp->IOBase = VGA_IOBASE_COLOR;
- else
- hwp->IOBase = VGA_IOBASE_MONO;
-
- for (i = 0; i < save->numCRTC; i++) {
- save->CRTC[i] = hwp->readCrtc(hwp, i);
-#ifdef DEBUG
- ErrorF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
-#endif
- }
-
- hwp->enablePalette(hwp);
- for (i = 0; i < save->numAttribute; i++) {
- save->Attribute[i] = hwp->readAttr(hwp, i);
-#ifdef DEBUG
- ErrorF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
-#endif
- }
- hwp->disablePalette(hwp);
-
- for (i = 0; i < save->numGraphics; i++) {
- save->Graphics[i] = hwp->readGr(hwp, i);
-#ifdef DEBUG
- ErrorF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
-#endif
- }
-
- for (i = 1; i < save->numSequencer; i++) {
- save->Sequencer[i] = hwp->readSeq(hwp, i);
-#ifdef DEBUG
- ErrorF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
-#endif
- }
-}
-
-
-void
-vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save)
-{
- vgaHWPtr hwp = VGAHWPTR(scrninfp);
- Bool readError = FALSE;
- int i;
-
-#ifdef NEED_SAVED_CMAP
- /*
- * Some ET4000 chips from 1991 have a HW bug that prevents the reading
- * of the color lookup table. Mask rev 9042EAI is known to have this bug.
- *
- * If the colourmap is not readable, we set the saved map to a default
- * map (taken from Ferraro's "Programmer's Guide to the EGA and VGA
- * Cards" 2nd ed).
- */
-
- /* Only save it once */
- if (hwp->cmapSaved)
- return;
-
-#if 0
- hwp->enablePalette(hwp);
-#endif
-
- hwp->writeDacMask(hwp, 0xFF);
-
- /*
- * check if we can read the lookup table
- */
- hwp->writeDacReadAddr(hwp, 0x00);
- for (i = 0; i < 6; i++) {
- save->DAC[i] = hwp->readDacData(hwp);
-#ifdef DEBUG
- switch (i % 3) {
- case 0:
- ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
- break;
- case 1:
- ErrorF("0x%02x, ", save->DAC[i]);
- break;
- case 2:
- ErrorF("0x%02x\n", save->DAC[i]);
- }
-#endif
- }
-
- /*
- * Check if we can read the palette -
- * use foreground color to prevent flashing.
- */
- hwp->writeDacWriteAddr(hwp, 0x01);
- for (i = 3; i < 6; i++)
- hwp->writeDacData(hwp, ~save->DAC[i] & DAC_TEST_MASK);
- hwp->writeDacReadAddr(hwp, 0x01);
- for (i = 3; i < 6; i++) {
- if (hwp->readDacData(hwp) != (~save->DAC[i] & DAC_TEST_MASK))
- readError = TRUE;
- }
- hwp->writeDacWriteAddr(hwp, 0x01);
- for (i = 3; i < 6; i++)
- hwp->writeDacData(hwp, save->DAC[i]);
-
- if (readError) {
- /*
- * save the default lookup table
- */
- memmove(save->DAC, defaultDAC, 768);
- xf86DrvMsg(scrninfp->scrnIndex, X_WARNING,
- "Cannot read colourmap from VGA. Will restore with default\n");
- } else {
- /* save the colourmap */
- hwp->writeDacReadAddr(hwp, 0x02);
- for (i = 6; i < 768; i++) {
- save->DAC[i] = hwp->readDacData(hwp);
- DACDelay(hwp);
-#ifdef DEBUG
- switch (i % 3) {
- case 0:
- ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
- break;
- case 1:
- ErrorF("0x%02x, ", save->DAC[i]);
- break;
- case 2:
- ErrorF("0x%02x\n", save->DAC[i]);
- }
-#endif
- }
- }
-
- hwp->disablePalette(hwp);
- hwp->cmapSaved = TRUE;
-#endif
-}
-
-/*
- * vgaHWSave --
- * save the current VGA state
- */
-
-void
-vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags)
-{
- if (save == NULL)
- return;
-
- if (flags & VGA_SR_CMAP)
- vgaHWSaveColormap(scrninfp, save);
-
- if (flags & VGA_SR_MODE)
- vgaHWSaveMode(scrninfp, save);
-
- if (flags & VGA_SR_FONTS)
- vgaHWSaveFonts(scrninfp, save);
-}
-
-
-/*
- * vgaHWInit --
- * Handle the initialization, etc. of a screen.
- * Return FALSE on failure.
- */
-
-Bool
-vgaHWInit(ScrnInfoPtr scrninfp, DisplayModePtr mode)
-{
- unsigned int i;
- vgaHWPtr hwp;
- vgaRegPtr regp;
- int depth = scrninfp->depth;
-
- /*
- * make sure the vgaHWRec is allocated
- */
- if (!vgaHWGetHWRec(scrninfp))
- return FALSE;
- hwp = VGAHWPTR(scrninfp);
- regp = &hwp->ModeReg;
-
- /*
- * compute correct Hsync & Vsync polarity
- */
- if ((mode->Flags & (V_PHSYNC | V_NHSYNC))
- && (mode->Flags & (V_PVSYNC | V_NVSYNC)))
- {
- regp->MiscOutReg = 0x23;
- if (mode->Flags & V_NHSYNC) regp->MiscOutReg |= 0x40;
- if (mode->Flags & V_NVSYNC) regp->MiscOutReg |= 0x80;
- }
- else
- {
- int VDisplay = mode->VDisplay;
- if (mode->Flags & V_DBLSCAN)
- VDisplay *= 2;
- if (mode->VScan > 1)
- VDisplay *= mode->VScan;
- if (VDisplay < 400)
- regp->MiscOutReg = 0xA3; /* +hsync -vsync */
- else if (VDisplay < 480)
- regp->MiscOutReg = 0x63; /* -hsync +vsync */
- else if (VDisplay < 768)
- regp->MiscOutReg = 0xE3; /* -hsync -vsync */
- else
- regp->MiscOutReg = 0x23; /* +hsync +vsync */
- }
-
- regp->MiscOutReg |= (mode->ClockIndex & 0x03) << 2;
-
- /*
- * Time Sequencer
- */
- if (depth == 4)
- regp->Sequencer[0] = 0x02;
- else
- regp->Sequencer[0] = 0x00;
- if (mode->Flags & V_CLKDIV2)
- regp->Sequencer[1] = 0x09;
- else
- regp->Sequencer[1] = 0x01;
- if (depth == 1)
- regp->Sequencer[2] = 1 << BIT_PLANE;
- else
- regp->Sequencer[2] = 0x0F;
- regp->Sequencer[3] = 0x00; /* Font select */
- if (depth < 8)
- regp->Sequencer[4] = 0x06; /* Misc */
- else
- regp->Sequencer[4] = 0x0E; /* Misc */
-
- /*
- * CRTC Controller
- */
- regp->CRTC[0] = (mode->CrtcHTotal >> 3) - 5;
- regp->CRTC[1] = (mode->CrtcHDisplay >> 3) - 1;
- regp->CRTC[2] = (mode->CrtcHBlankStart >> 3) - 1;
- regp->CRTC[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80;
- i = (((mode->CrtcHSkew << 2) + 0x10) & ~0x1F);
- if (i < 0x80)
- regp->CRTC[3] |= i;
- regp->CRTC[4] = (mode->CrtcHSyncStart >> 3);
- regp->CRTC[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2)
- | (((mode->CrtcHSyncEnd >> 3)) & 0x1F);
- regp->CRTC[6] = (mode->CrtcVTotal - 2) & 0xFF;
- regp->CRTC[7] = (((mode->CrtcVTotal - 2) & 0x100) >> 8)
- | (((mode->CrtcVDisplay - 1) & 0x100) >> 7)
- | ((mode->CrtcVSyncStart & 0x100) >> 6)
- | (((mode->CrtcVBlankStart - 1) & 0x100) >> 5)
- | 0x10
- | (((mode->CrtcVTotal - 2) & 0x200) >> 4)
- | (((mode->CrtcVDisplay - 1) & 0x200) >> 3)
- | ((mode->CrtcVSyncStart & 0x200) >> 2);
- regp->CRTC[8] = 0x00;
- regp->CRTC[9] = (((mode->CrtcVBlankStart - 1) & 0x200) >> 4) | 0x40;
- if (mode->Flags & V_DBLSCAN)
- regp->CRTC[9] |= 0x80;
- if (mode->VScan >= 32)
- regp->CRTC[9] |= 0x1F;
- else if (mode->VScan > 1)
- regp->CRTC[9] |= mode->VScan - 1;
- regp->CRTC[10] = 0x00;
- regp->CRTC[11] = 0x00;
- regp->CRTC[12] = 0x00;
- regp->CRTC[13] = 0x00;
- regp->CRTC[14] = 0x00;
- regp->CRTC[15] = 0x00;
- regp->CRTC[16] = mode->CrtcVSyncStart & 0xFF;
- regp->CRTC[17] = (mode->CrtcVSyncEnd & 0x0F) | 0x20;
- regp->CRTC[18] = (mode->CrtcVDisplay - 1) & 0xFF;
- regp->CRTC[19] = scrninfp->displayWidth >> 4; /* just a guess */
- regp->CRTC[20] = 0x00;
- regp->CRTC[21] = (mode->CrtcVBlankStart - 1) & 0xFF;
- regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF;
- if (depth < 8)
- regp->CRTC[23] = 0xE3;
- else
- regp->CRTC[23] = 0xC3;
- regp->CRTC[24] = 0xFF;
-
- vgaHWHBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
- vgaHWVBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
-
- /*
- * Theory resumes here....
- */
-
- /*
- * Graphics Display Controller
- */
- regp->Graphics[0] = 0x00;
- regp->Graphics[1] = 0x00;
- regp->Graphics[2] = 0x00;
- regp->Graphics[3] = 0x00;
- if (depth == 1) {
- regp->Graphics[4] = BIT_PLANE;
- regp->Graphics[5] = 0x00;
- } else {
- regp->Graphics[4] = 0x00;
- if (depth == 4)
- regp->Graphics[5] = 0x02;
- else
- regp->Graphics[5] = 0x40;
- }
- regp->Graphics[6] = 0x05; /* only map 64k VGA memory !!!! */
- regp->Graphics[7] = 0x0F;
- regp->Graphics[8] = 0xFF;
-
- if (depth == 1) {
- /* Initialise the Mono map according to which bit-plane gets used */
-
- Bool flipPixels = xf86GetFlipPixels();
-
- for (i=0; i<16; i++)
- if (((i & (1 << BIT_PLANE)) != 0) != flipPixels)
- regp->Attribute[i] = WHITE_VALUE;
- else
- regp->Attribute[i] = BLACK_VALUE;
-
- regp->Attribute[16] = 0x01; /* -VGA2- */ /* wrong for the ET4000 */
- if (!hwp->ShowOverscan)
- regp->Attribute[OVERSCAN] = OVERSCAN_VALUE; /* -VGA2- */
- } else {
- regp->Attribute[0] = 0x00; /* standard colormap translation */
- regp->Attribute[1] = 0x01;
- regp->Attribute[2] = 0x02;
- regp->Attribute[3] = 0x03;
- regp->Attribute[4] = 0x04;
- regp->Attribute[5] = 0x05;
- regp->Attribute[6] = 0x06;
- regp->Attribute[7] = 0x07;
- regp->Attribute[8] = 0x08;
- regp->Attribute[9] = 0x09;
- regp->Attribute[10] = 0x0A;
- regp->Attribute[11] = 0x0B;
- regp->Attribute[12] = 0x0C;
- regp->Attribute[13] = 0x0D;
- regp->Attribute[14] = 0x0E;
- regp->Attribute[15] = 0x0F;
- if (depth == 4)
- regp->Attribute[16] = 0x81; /* wrong for the ET4000 */
- else
- regp->Attribute[16] = 0x41; /* wrong for the ET4000 */
- /* Attribute[17] (overscan) initialised in vgaHWGetHWRec() */
- }
- regp->Attribute[18] = 0x0F;
- regp->Attribute[19] = 0x00;
- regp->Attribute[20] = 0x00;
-
- return(TRUE);
-}
-
- /*
- * OK, so much for theory. Now, let's deal with the >real< world...
- *
- * The above CRTC settings are precise in theory, except that many, if not
- * most, VGA clones fail to reset the blanking signal when the character or
- * line counter reaches [HV]Total. In this case, the signal is only
- * unblanked when the counter reaches [HV]BlankEnd (mod 64, 128 or 256 as
- * the case may be) at the start of the >next< scanline or frame, which
- * means only part of the screen shows. This affects how null overscans
- * are to be implemented on such adapters.
- *
- * Henceforth, VGA cores that implement this broken, but unfortunately
- * common, behaviour are to be designated as KGA's, in honour of Koen
- * Gadeyne, whose zeal to eliminate overscans (read: fury) set in motion
- * a series of events that led to the discovery of this problem.
- *
- * Some VGA's are KGA's only in the horizontal, or only in the vertical,
- * some in both, others in neither. Don't let anyone tell you there is
- * such a thing as a VGA "standard"... And, thank the Creator for the fact
- * that Hilbert spaces are not yet implemented in this industry.
- *
- * The following implements a trick suggested by David Dawes. This sets
- * [HV]BlankEnd to zero if the blanking interval does not already contain a
- * 0-point, and decrements it by one otherwise. In the latter case, this
- * will produce a left and/or top overscan which the colourmap code will
- * (still) need to ensure is as close to black as possible. This will make
- * the behaviour consistent across all chipsets, while allowing all
- * chipsets to display the entire screen. Non-KGA drivers can ignore the
- * following in their own copy of this code.
- *
- * -- TSI @ UQV, 1998.08.21
- */
-
-CARD32
-vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
- unsigned int Flags)
-{
- int nExtBits = (nBits < 6) ? 0 : nBits - 6;
- CARD32 ExtBits;
- CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6;
-
- regp->CRTC[3] = (regp->CRTC[3] & ~0x1F)
- | (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F);
- regp->CRTC[5] = (regp->CRTC[5] & ~0x80)
- | ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2);
- ExtBits = ((mode->CrtcHBlankEnd >> 3) - 1) & ExtBitMask;
-
- /* First the horizontal case */
- if ((Flags & KGA_FIX_OVERSCAN)
- && ((mode->CrtcHBlankEnd >> 3) == (mode->CrtcHTotal >> 3)))
- {
- int i = (regp->CRTC[3] & 0x1F)
- | ((regp->CRTC[5] & 0x80) >> 2)
- | ExtBits;
- if (Flags & KGA_ENABLE_ON_ZERO) {
- if ((i-- > (((mode->CrtcHBlankStart >> 3) - 1)
- & (0x3F | ExtBitMask)))
- && (mode->CrtcHBlankEnd == mode->CrtcHTotal))
- i = 0;
- } else if (Flags & KGA_BE_TOT_DEC)
- i--;
- regp->CRTC[3] = (regp->CRTC[3] & ~0x1F) | (i & 0x1F);
- regp->CRTC[5] = (regp->CRTC[5] & ~0x80) | ((i << 2) & 0x80);
- ExtBits = i & ExtBitMask;
- }
- return ExtBits >> 6;
-}
-
- /*
- * The vertical case is a little trickier. Some VGA's ignore bit 0x80 of
- * CRTC[22]. Also, in some cases, a zero CRTC[22] will still blank the
- * very first scanline in a double- or multi-scanned mode. This last case
- * needs further investigation.
- */
-CARD32
-vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
- unsigned int Flags)
-{
- CARD32 ExtBits;
- CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8);
- CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8;
- /* If width is not known nBits should be 0. In this
- * case BitMask is set to 0 so we can check for it. */
- CARD32 BitMask = (nBits < 7) ? 0 : ((1 << nExtBits) - 1);
- int VBlankStart = (mode->CrtcVBlankStart - 1) & 0xFF;
- regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF;
- ExtBits = (mode->CrtcVBlankEnd - 1) & ExtBitMask;
-
- if ((Flags & KGA_FIX_OVERSCAN)
- && (mode->CrtcVBlankEnd == mode->CrtcVTotal))
- /* Null top overscan */
- {
- int i = regp->CRTC[22] | ExtBits;
- if (Flags & KGA_ENABLE_ON_ZERO) {
- if (((BitMask && ((i & BitMask) > (VBlankStart & BitMask)))
- || ((i > VBlankStart) && /* 8-bit case */
- ((i & 0x7F) > (VBlankStart & 0x7F)))) && /* 7-bit case */
- !(regp->CRTC[9] & 0x9F)) /* 1 scanline/row */
- i = 0;
- else
- i = (i - 1);
- } else if (Flags & KGA_BE_TOT_DEC)
- i = (i - 1);
-
- regp->CRTC[22] = i & 0xFF;
- ExtBits = i & 0xFF00;
- }
- return ExtBits >> 8;
-}
-
-/*
- * these are some more hardware specific helpers, formerly in vga.c
- */
-static void
-vgaHWGetHWRecPrivate(void)
-{
- if (vgaHWPrivateIndex < 0)
- vgaHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
- return;
-}
-
-
-static void
-vgaHWFreeRegs(vgaRegPtr regp)
-{
- if (regp->CRTC)
- xfree (regp->CRTC);
-
- regp->CRTC =
- regp->Sequencer =
- regp->Graphics =
- regp->Attribute = NULL;
-
- regp->numCRTC =
- regp->numSequencer =
- regp->numGraphics =
- regp->numAttribute = 0;
-}
-
-
-
-static Bool
-vgaHWAllocRegs(vgaRegPtr regp)
-{
- unsigned char *buf;
-
- if ((regp->numCRTC + regp->numSequencer + regp->numGraphics +
- regp->numAttribute) == 0)
- return FALSE;
-
- buf = xcalloc(regp->numCRTC +
- regp->numSequencer +
- regp->numGraphics +
- regp->numAttribute, 1);
- if (!buf)
- return FALSE;
-
- regp->CRTC = buf;
- regp->Sequencer = regp->CRTC + regp->numCRTC;
- regp->Graphics = regp->Sequencer + regp->numSequencer;
- regp->Attribute = regp->Graphics + regp->numGraphics;
-
- return TRUE;
-}
-
-
-Bool
-vgaHWAllocDefaultRegs(vgaRegPtr regp)
-{
- regp->numCRTC = VGA_NUM_CRTC;
- regp->numSequencer = VGA_NUM_SEQ;
- regp->numGraphics = VGA_NUM_GFX;
- regp->numAttribute = VGA_NUM_ATTR;
-
- return vgaHWAllocRegs(regp);
-}
-
-
-Bool
-vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer,
- int numGraphics, int numAttribute)
-{
-#define VGAHWMINNUM(regtype) \
- ((newMode.num##regtype < regp->num##regtype) ? \
- (newMode.num##regtype) : (regp->num##regtype))
-#define VGAHWCOPYREGSET(regtype) \
- memcpy (newMode.regtype, regp->regtype, VGAHWMINNUM(regtype))
-
- vgaRegRec newMode, newSaved;
- vgaRegPtr regp;
-
- regp = &VGAHWPTR(scrp)->ModeReg;
- memcpy (&newMode, regp, sizeof(vgaRegRec));
-
- /* allocate space for new registers */
-
- regp = &newMode;
- regp->numCRTC = numCRTC;
- regp->numSequencer = numSequencer;
- regp->numGraphics = numGraphics;
- regp->numAttribute = numAttribute;
- if (!vgaHWAllocRegs(regp))
- return FALSE;
-
- regp = &VGAHWPTR(scrp)->SavedReg;
- memcpy (&newSaved, regp, sizeof(vgaRegRec));
-
- regp = &newSaved;
- regp->numCRTC = numCRTC;
- regp->numSequencer = numSequencer;
- regp->numGraphics = numGraphics;
- regp->numAttribute = numAttribute;
- if (!vgaHWAllocRegs(regp)) {
- vgaHWFreeRegs(&newMode);
- return FALSE;
- }
-
- /* allocations succeeded, copy register data into new space */
-
- regp = &VGAHWPTR(scrp)->ModeReg;
- VGAHWCOPYREGSET(CRTC);
- VGAHWCOPYREGSET(Sequencer);
- VGAHWCOPYREGSET(Graphics);
- VGAHWCOPYREGSET(Attribute);
-
- regp = &VGAHWPTR(scrp)->SavedReg;
- VGAHWCOPYREGSET(CRTC);
- VGAHWCOPYREGSET(Sequencer);
- VGAHWCOPYREGSET(Graphics);
- VGAHWCOPYREGSET(Attribute);
-
- /* free old register arrays */
-
- regp = &VGAHWPTR(scrp)->ModeReg;
- vgaHWFreeRegs(regp);
- memcpy(regp, &newMode, sizeof(vgaRegRec));
-
- regp = &VGAHWPTR(scrp)->SavedReg;
- vgaHWFreeRegs(regp);
- memcpy(regp, &newSaved, sizeof(vgaRegRec));
-
- return TRUE;
-
-#undef VGAHWMINNUM
-#undef VGAHWCOPYREGSET
-}
-
-
-Bool
-vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src)
-{
- vgaHWFreeRegs(dst);
-
- memcpy(dst, src, sizeof(vgaRegRec));
-
- if (!vgaHWAllocRegs(dst))
- return FALSE;
-
- memcpy(dst->CRTC, src->CRTC, src->numCRTC);
- memcpy(dst->Sequencer, src->Sequencer, src->numSequencer);
- memcpy(dst->Graphics, src->Graphics, src->numGraphics);
- memcpy(dst->Attribute, src->Attribute, src->numAttribute);
-
- return TRUE;
-}
-
-
-Bool
-vgaHWGetHWRec(ScrnInfoPtr scrp)
-{
- vgaRegPtr regp;
- vgaHWPtr hwp;
- pciVideoPtr pvp;
- int i;
-
- /*
- * Let's make sure that the private exists and allocate one.
- */
- vgaHWGetHWRecPrivate();
- /*
- * New privates are always set to NULL, so we can check if the allocation
- * has already been done.
- */
- if (VGAHWPTR(scrp))
- return TRUE;
- hwp = VGAHWPTRLVAL(scrp) = xnfcalloc(sizeof(vgaHWRec), 1);
- regp = &VGAHWPTR(scrp)->ModeReg;
-
- if ((!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->SavedReg)) ||
- (!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->ModeReg))) {
- xfree(hwp);
- return FALSE;
- }
-
- if (scrp->bitsPerPixel == 1) {
- rgb blackColour = scrp->display->blackColour,
- whiteColour = scrp->display->whiteColour;
-
- if (blackColour.red > 0x3F) blackColour.red = 0x3F;
- if (blackColour.green > 0x3F) blackColour.green = 0x3F;
- if (blackColour.blue > 0x3F) blackColour.blue = 0x3F;
-
- if (whiteColour.red > 0x3F) whiteColour.red = 0x3F;
- if (whiteColour.green > 0x3F) whiteColour.green = 0x3F;
- if (whiteColour.blue > 0x3F) whiteColour.blue = 0x3F;
-
- if ((blackColour.red == whiteColour.red ) &&
- (blackColour.green == whiteColour.green) &&
- (blackColour.blue == whiteColour.blue )) {
- blackColour.red ^= 0x3F;
- blackColour.green ^= 0x3F;
- blackColour.blue ^= 0x3F;
- }
-
- /*
- * initialize default colormap for monochrome
- */
- for (i=0; i<3; i++) regp->DAC[i] = 0x00;
- for (i=3; i<768; i++) regp->DAC[i] = 0x3F;
- i = BLACK_VALUE * 3;
- regp->DAC[i++] = blackColour.red;
- regp->DAC[i++] = blackColour.green;
- regp->DAC[i] = blackColour.blue;
- i = WHITE_VALUE * 3;
- regp->DAC[i++] = whiteColour.red;
- regp->DAC[i++] = whiteColour.green;
- regp->DAC[i] = whiteColour.blue;
- i = OVERSCAN_VALUE * 3;
- regp->DAC[i++] = 0x00;
- regp->DAC[i++] = 0x00;
- regp->DAC[i] = 0x00;
- } else {
- /* Set all colours to black */
- for (i=0; i<768; i++) regp->DAC[i] = 0x00;
- /* ... and the overscan */
- if (scrp->depth >= 4)
- regp->Attribute[OVERSCAN] = 0xFF;
- }
- if (xf86FindOption(scrp->confScreen->options, "ShowOverscan")) {
- xf86MarkOptionUsedByName(scrp->confScreen->options, "ShowOverscan");
- xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "Showing overscan area\n");
- regp->DAC[765] = 0x3F;
- regp->DAC[766] = 0x00;
- regp->DAC[767] = 0x3F;
- regp->Attribute[OVERSCAN] = 0xFF;
- hwp->ShowOverscan = TRUE;
- } else
- hwp->ShowOverscan = FALSE;
-
- hwp->paletteEnabled = FALSE;
- hwp->cmapSaved = FALSE;
- hwp->MapSize = 0;
- hwp->pScrn = scrp;
-
- /* Initialise the function pointers with the standard VGA versions */
- vgaHWSetStdFuncs(hwp);
-
- hwp->PIOOffset = scrp->domainIOBase;
- if ((pvp = xf86GetPciInfoForEntity(scrp->entityList[0])))
- hwp->Tag = pciTag(pvp->bus, pvp->device, pvp->func);
-
- return TRUE;
-}
-
-
-void
-vgaHWFreeHWRec(ScrnInfoPtr scrp)
-{
- if (vgaHWPrivateIndex >= 0) {
- vgaHWPtr hwp = VGAHWPTR(scrp);
-
- if (!hwp)
- return;
-
- xfree(hwp->FontInfo1);
- xfree(hwp->FontInfo2);
- xfree(hwp->TextInfo);
-
- vgaHWFreeRegs (&hwp->ModeReg);
- vgaHWFreeRegs (&hwp->SavedReg);
-
- xfree(hwp);
- VGAHWPTRLVAL(scrp) = NULL;
- }
-}
-
-
-Bool
-vgaHWMapMem(ScrnInfoPtr scrp)
-{
- vgaHWPtr hwp = VGAHWPTR(scrp);
- int scr_index = scrp->scrnIndex;
-
- if (hwp->Base)
- return TRUE;
-
- /* If not set, initialise with the defaults */
- if (hwp->MapSize == 0)
- hwp->MapSize = VGA_DEFAULT_MEM_SIZE;
- if (hwp->MapPhys == 0)
- hwp->MapPhys = VGA_DEFAULT_PHYS_ADDR;
-
- /*
- * Map as VIDMEM_MMIO_32BIT because WC
- * is bad when there is page flipping.
- * XXX This is not correct but we do it
- * for now.
- */
-#ifdef DEBUG
- ErrorF("Mapping VGAMem\n");
-#endif
- hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->Tag,
- hwp->MapPhys, hwp->MapSize);
- return hwp->Base != NULL;
-}
-
-
-void
-vgaHWUnmapMem(ScrnInfoPtr scrp)
-{
- vgaHWPtr hwp = VGAHWPTR(scrp);
- int scr_index = scrp->scrnIndex;
-
- if (hwp->Base == NULL)
- return;
-
-#ifdef DEBUG
- ErrorF("Unmapping VGAMem\n");
-#endif
- xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize);
- hwp->Base = NULL;
-}
-
-int
-vgaHWGetIndex()
-{
- return vgaHWPrivateIndex;
-}
-
-
-void
-vgaHWGetIOBase(vgaHWPtr hwp)
-{
- hwp->IOBase = (hwp->readMiscOut(hwp) & 0x01) ?
- VGA_IOBASE_COLOR : VGA_IOBASE_MONO;
- xf86DrvMsgVerb(hwp->pScrn->scrnIndex, X_INFO, 3,
- "vgaHWGetIOBase: hwp->IOBase is 0x%04x, hwp->PIOOffset is 0x%04lx\n",
- hwp->IOBase, hwp->PIOOffset);
-}
-
-
-void
-vgaHWLock(vgaHWPtr hwp)
-{
- /* Protect CRTC[0-7] */
- hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) | 0x80);
-}
-
-void
-vgaHWUnlock(vgaHWPtr hwp)
-{
- /* Unprotect CRTC[0-7] */
- hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) & ~0x80);
-}
-
-
-void
-vgaHWEnable(vgaHWPtr hwp)
-{
- hwp->writeEnable(hwp, hwp->readEnable(hwp) | 0x01);
-}
-
-
-void
-vgaHWDisable(vgaHWPtr hwp)
-{
- hwp->writeEnable(hwp, hwp->readEnable(hwp) & ~0x01);
-}
-
-
-static void
-vgaHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
- VisualPtr pVisual)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- int i, index;
-
- for (i = 0; i < numColors; i++) {
- index = indices[i];
- hwp->writeDacWriteAddr(hwp, index);
- DACDelay(hwp);
- hwp->writeDacData(hwp, colors[index].red);
- DACDelay(hwp);
- hwp->writeDacData(hwp, colors[index].green);
- DACDelay(hwp);
- hwp->writeDacData(hwp, colors[index].blue);
- DACDelay(hwp);
- }
-
- /* This shouldn't be necessary, but we'll play safe. */
- hwp->disablePalette(hwp);
-}
-
-
-static void
-vgaHWSetOverscan(ScrnInfoPtr pScrn, int overscan)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
-
- if (overscan < 0 || overscan > 255)
- return;
-
- hwp->enablePalette(hwp);
- hwp->writeAttr(hwp, OVERSCAN, overscan);
-
-#ifdef DEBUGOVERSCAN
- {
- int ov = hwp->readAttr(hwp, OVERSCAN);
- int red, green, blue;
-
- hwp->writeDacReadAddr(hwp, ov);
- red = hwp->readDacData(hwp);
- green = hwp->readDacData(hwp);
- blue = hwp->readDacData(hwp);
- ErrorF("Overscan index is 0x%02x, colours are #%02x%02x%02x\n",
- ov, red, green, blue);
- }
-#endif
-
- hwp->disablePalette(hwp);
-}
-
-
-Bool
-vgaHWHandleColormaps(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- if (pScrn->depth > 1 && pScrn->depth <= 8) {
- return xf86HandleColormaps(pScreen, 1 << pScrn->depth,
- pScrn->rgbBits, vgaHWLoadPalette,
- pScrn->depth > 4 ? vgaHWSetOverscan : NULL,
- CMAP_RELOAD_ON_MODE_SWITCH);
- }
- return TRUE;
-}
-
-/* ----------------------- DDC support ------------------------*/
-/*
- * Adjust v_active, v_blank, v_sync, v_sync_end, v_blank_end, v_total
- * to read out EDID at a faster rate. Allowed maximum is 25kHz with
- * 20 usec v_sync active. Set positive v_sync polarity, turn off lightpen
- * readback, enable access to cr00-cr07.
- */
-
-/* vertical timings */
-#define DISPLAY_END 0x04
-#define BLANK_START DISPLAY_END
-#define SYNC_START BLANK_START
-#define SYNC_END 0x09
-#define BLANK_END SYNC_END
-#define V_TOTAL BLANK_END
-/* this function doesn't have to be reentrant for our purposes */
-struct _vgaDdcSave {
- unsigned char cr03;
- unsigned char cr06;
- unsigned char cr07;
- unsigned char cr09;
- unsigned char cr10;
- unsigned char cr11;
- unsigned char cr12;
- unsigned char cr15;
- unsigned char cr16;
- unsigned char msr;
-};
-
-void
-vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- unsigned char tmp;
- struct _vgaDdcSave* save;
- switch (speed) {
- case DDC_FAST:
-
- if (hwp->ddc != NULL) break;
- hwp->ddc = xnfcalloc(sizeof(struct _vgaDdcSave),1);
- save = (struct _vgaDdcSave *)hwp->ddc;
- /* Lightpen register disable - allow access to cr10 & 11; just in case */
- save->cr03 = hwp->readCrtc(hwp, 0x03);
- hwp->writeCrtc(hwp,0x03,(save->cr03 |0x80));
- save->cr12 = hwp->readCrtc(hwp, 0x12);
- hwp->writeCrtc(hwp,0x12,DISPLAY_END);
- save->cr15 = hwp->readCrtc(hwp, 0x15);
- hwp->writeCrtc(hwp,0x15,BLANK_START);
- save->cr10 = hwp->readCrtc(hwp, 0x10);
- hwp->writeCrtc(hwp,0x10,SYNC_START);
- save->cr11 = hwp->readCrtc(hwp, 0x11);
- /* unprotect group 1 registers; just in case ...*/
- hwp->writeCrtc(hwp,0x11,((save->cr11 & 0x70) | SYNC_END));
- save->cr16 = hwp->readCrtc(hwp, 0x16);
- hwp->writeCrtc(hwp,0x16,BLANK_END);
- save->cr06 = hwp->readCrtc(hwp, 0x06);
- hwp->writeCrtc(hwp,0x06,V_TOTAL);
- /* all values have less than 8 bit - mask out 9th and 10th bits */
- save->cr09 = hwp->readCrtc(hwp, 0x09);
- hwp->writeCrtc(hwp,0x09,(save->cr09 &0xDF));
- save->cr07 = hwp->readCrtc(hwp, 0x07);
- hwp->writeCrtc(hwp,0x07,(save->cr07 &0x10));
- /* vsync polarity negativ & ensure a 25MHz clock */
- save->msr = hwp->readMiscOut(hwp);
- hwp->writeMiscOut(hwp,((save->msr & 0xF3) | 0x80));
- break;
- case DDC_SLOW:
- if (hwp->ddc == NULL) break;
- save = (struct _vgaDdcSave *)hwp->ddc;
- hwp->writeMiscOut(hwp,save->msr);
- hwp->writeCrtc(hwp,0x07,save->cr07);
- tmp = hwp->readCrtc(hwp, 0x09);
- hwp->writeCrtc(hwp,0x09,((save->cr09 & 0x20) | (tmp & 0xDF)));
- hwp->writeCrtc(hwp,0x06,save->cr06);
- hwp->writeCrtc(hwp,0x16,save->cr16);
- hwp->writeCrtc(hwp,0x11,save->cr11);
- hwp->writeCrtc(hwp,0x10,save->cr10);
- hwp->writeCrtc(hwp,0x15,save->cr15);
- hwp->writeCrtc(hwp,0x12,save->cr12);
- hwp->writeCrtc(hwp,0x03,save->cr03);
- xfree(save);
- hwp->ddc = NULL;
- break;
- default:
- break;
- }
-}
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
deleted file mode 100644
index 9a51f1046..000000000
--- a/hw/xfree86/vgahw/vgaHW.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.31 2002/04/04 14:05:56 eich Exp $ */
-
-
-/*
- * Copyright (c) 1997,1998 The XFree86 Project, Inc.
- *
- * Loosely based on code bearing the following copyright:
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Author: Dirk Hohndel
- */
-
-#ifndef _VGAHW_H
-#define _VGAHW_H
-
-#include "X.h"
-#include "misc.h"
-#include "input.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-
-#include "xf86str.h"
-#include "xf86Pci.h"
-
-#include "xf86DDC.h"
-
-#include "globals.h"
-#define DPMS_SERVER
-#include "extensions/dpms.h"
-
-extern int vgaHWGetIndex(void);
-
-/*
- * access macro
- */
-#define VGAHWPTR(p) ((vgaHWPtr)((p)->privates[vgaHWGetIndex()].ptr))
-
-/* Standard VGA registers */
-#define VGA_ATTR_INDEX 0x3C0
-#define VGA_ATTR_DATA_W 0x3C0
-#define VGA_ATTR_DATA_R 0x3C1
-#define VGA_IN_STAT_0 0x3C2 /* read */
-#define VGA_MISC_OUT_W 0x3C2 /* write */
-#define VGA_ENABLE 0x3C3
-#define VGA_SEQ_INDEX 0x3C4
-#define VGA_SEQ_DATA 0x3C5
-#define VGA_DAC_MASK 0x3C6
-#define VGA_DAC_READ_ADDR 0x3C7
-#define VGA_DAC_WRITE_ADDR 0x3C8
-#define VGA_DAC_DATA 0x3C9
-#define VGA_FEATURE_R 0x3CA /* read */
-#define VGA_MISC_OUT_R 0x3CC /* read */
-#define VGA_GRAPH_INDEX 0x3CE
-#define VGA_GRAPH_DATA 0x3CF
-
-#define VGA_IOBASE_MONO 0x3B0
-#define VGA_IOBASE_COLOR 0x3D0
-
-#define VGA_CRTC_INDEX_OFFSET 0x04
-#define VGA_CRTC_DATA_OFFSET 0x05
-#define VGA_IN_STAT_1_OFFSET 0x0A /* read */
-#define VGA_FEATURE_W_OFFSET 0x0A /* write */
-
-/* default number of VGA registers stored internally */
-#define VGA_NUM_CRTC 25
-#define VGA_NUM_SEQ 5
-#define VGA_NUM_GFX 9
-#define VGA_NUM_ATTR 21
-
-/* Flags for vgaHWSave() and vgaHWRestore() */
-#define VGA_SR_MODE 0x01
-#define VGA_SR_FONTS 0x02
-#define VGA_SR_CMAP 0x04
-#define VGA_SR_ALL (VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP)
-
-/* Defaults for the VGA memory window */
-#define VGA_DEFAULT_PHYS_ADDR 0xA0000
-#define VGA_DEFAULT_MEM_SIZE (64 * 1024)
-
-/*
- * vgaRegRec contains settings of standard VGA registers.
- */
-typedef struct {
- unsigned char MiscOutReg; /* */
- unsigned char *CRTC; /* Crtc Controller */
- unsigned char *Sequencer; /* Video Sequencer */
- unsigned char *Graphics; /* Video Graphics */
- unsigned char *Attribute; /* Video Atribute */
- unsigned char DAC[768]; /* Internal Colorlookuptable */
- unsigned char numCRTC; /* number of CRTC registers, def=VGA_NUM_CRTC */
- unsigned char numSequencer; /* number of seq registers, def=VGA_NUM_SEQ */
- unsigned char numGraphics; /* number of gfx registers, def=VGA_NUM_GFX */
- unsigned char numAttribute; /* number of attr registers, def=VGA_NUM_ATTR */
-} vgaRegRec, *vgaRegPtr;
-
-typedef struct _vgaHWRec *vgaHWPtr;
-
-typedef void (*vgaHWWriteIndexProcPtr)(vgaHWPtr hwp, CARD8 indx, CARD8 value);
-typedef CARD8 (*vgaHWReadIndexProcPtr)(vgaHWPtr hwp, CARD8 indx);
-typedef void (*vgaHWWriteProcPtr)(vgaHWPtr hwp, CARD8 value);
-typedef CARD8 (*vgaHWReadProcPtr)(vgaHWPtr hwp);
-typedef void (*vgaHWMiscProcPtr)(vgaHWPtr hwp);
-
-
-/*
- * vgaHWRec contains per-screen information required by the vgahw module.
- *
- * Note, the palette referred to by the paletteEnabled, enablePalette and
- * disablePalette is the 16-entry (+overscan) EGA-compatible palette accessed
- * via the first 17 attribute registers and not the main 8-bit palette.
- */
-typedef struct _vgaHWRec {
- pointer Base; /* Address of "VGA" memory */
- int MapSize; /* Size of "VGA" memory */
- unsigned long MapPhys; /* phys location of VGA mem */
- int IOBase; /* I/O Base address */
- CARD8 * MMIOBase; /* Pointer to MMIO start */
- int MMIOOffset; /* base + offset + vgareg
- = mmioreg */
- pointer FontInfo1; /* save area for fonts in
- plane 2 */
- pointer FontInfo2; /* save area for fonts in
- plane 3 */
- pointer TextInfo; /* save area for text */
- vgaRegRec SavedReg; /* saved registers */
- vgaRegRec ModeReg; /* register settings for
- current mode */
- Bool ShowOverscan;
- Bool paletteEnabled;
- Bool cmapSaved;
- ScrnInfoPtr pScrn;
- vgaHWWriteIndexProcPtr writeCrtc;
- vgaHWReadIndexProcPtr readCrtc;
- vgaHWWriteIndexProcPtr writeGr;
- vgaHWReadIndexProcPtr readGr;
- vgaHWReadProcPtr readST00;
- vgaHWReadProcPtr readST01;
- vgaHWReadProcPtr readFCR;
- vgaHWWriteProcPtr writeFCR;
- vgaHWWriteIndexProcPtr writeAttr;
- vgaHWReadIndexProcPtr readAttr;
- vgaHWWriteIndexProcPtr writeSeq;
- vgaHWReadIndexProcPtr readSeq;
- vgaHWWriteProcPtr writeMiscOut;
- vgaHWReadProcPtr readMiscOut;
- vgaHWMiscProcPtr enablePalette;
- vgaHWMiscProcPtr disablePalette;
- vgaHWWriteProcPtr writeDacMask;
- vgaHWReadProcPtr readDacMask;
- vgaHWWriteProcPtr writeDacWriteAddr;
- vgaHWWriteProcPtr writeDacReadAddr;
- vgaHWWriteProcPtr writeDacData;
- vgaHWReadProcPtr readDacData;
- pointer ddc;
- IOADDRESS PIOOffset; /* offset + vgareg
- = pioreg */
- vgaHWReadProcPtr readEnable;
- vgaHWWriteProcPtr writeEnable;
- PCITAG Tag;
-} vgaHWRec;
-
-/* Some macros that VGA drivers can use in their ChipProbe() function */
-#define VGAHW_GET_IOBASE() ((inb(VGA_MISC_OUT_R) & 0x01) ? \
- VGA_IOBASE_COLOR : VGA_IOBASE_MONO)
-
-#define OVERSCAN 0x11 /* Index of OverScan register */
-
-/* Flags that define how overscan correction should take place */
-#define KGA_FIX_OVERSCAN 1 /* overcan correction required */
-#define KGA_ENABLE_ON_ZERO 2 /* if possible enable display at beginning */
- /* of next scanline/frame */
-#define KGA_BE_TOT_DEC 4 /* always fix problem by setting blank end */
- /* to total - 1 */
-#define BIT_PLANE 3 /* Which plane we write to in mono mode */
-#define BITS_PER_GUN 6
-#define COLORMAP_SIZE 256
-
-#if defined(__powerpc__)
-#define DACDelay(hw) /* No legacy VGA support */
-#else
-#define DACDelay(hw) \
- do { \
- (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
- (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
- } while (0)
-#endif
-
-/* Function Prototypes */
-
-/* vgaHW.c */
-
-void vgaHWSetStdFuncs(vgaHWPtr hwp);
-void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset);
-void vgaHWProtect(ScrnInfoPtr pScrn, Bool on);
-Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode);
-void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on);
-void vgaHWSeqReset(vgaHWPtr hwp, Bool start);
-void vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore);
-void vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore);
-void vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore);
-void vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags);
-void vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save);
-void vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save);
-void vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save);
-void vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags);
-Bool vgaHWInit(ScrnInfoPtr scrnp, DisplayModePtr mode);
-Bool vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer,
- int numGraphics, int numAttribute);
-Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src);
-Bool vgaHWGetHWRec(ScrnInfoPtr scrp);
-void vgaHWFreeHWRec(ScrnInfoPtr scrp);
-Bool vgaHWMapMem(ScrnInfoPtr scrp);
-void vgaHWUnmapMem(ScrnInfoPtr scrp);
-void vgaHWGetIOBase(vgaHWPtr hwp);
-void vgaHWLock(vgaHWPtr hwp);
-void vgaHWUnlock(vgaHWPtr hwp);
-void vgaHWEnable(vgaHWPtr hwp);
-void vgaHWDisable(vgaHWPtr hwp);
-void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags);
-Bool vgaHWHandleColormaps(ScreenPtr pScreen);
-void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed);
-CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
- unsigned int Flags);
-CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
- unsigned int Flags);
-Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
-#endif /* _VGAHW_H */
diff --git a/hw/xfree86/vgahw/vgaHWmodule.c b/hw/xfree86/vgahw/vgaHWmodule.c
deleted file mode 100644
index 409e7b511..000000000
--- a/hw/xfree86/vgahw/vgaHWmodule.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHWmodule.c,v 1.6 1999/01/26 05:54:18 dawes Exp $ */
-
-/*
- * Copyright 1998 by The XFree86 Project, Inc
- */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-
-static XF86ModuleVersionInfo VersRec = {
- "vgahw",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 0, 1, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0, 0, 0, 0}
-};
-
-XF86ModuleData vgahwModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c
deleted file mode 100644
index 7519b35c3..000000000
--- a/hw/xfree86/x86emu/debug.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file contains the code to handle debugging of the
-* emulator.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/debug.c,v 1.4 2000/04/17 16:29:45 eich Exp $ */
-
-#include "x86emu/x86emui.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#else
-#include <stdarg.h>
-#include <stdlib.h>
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef DEBUG
-
-static void print_encoded_bytes (u16 s, u16 o);
-static void print_decoded_instruction (void);
-static int parse_line (char *s, int *ps, int *n);
-
-/* should look something like debug's output. */
-void X86EMU_trace_regs (void)
-{
- if (DEBUG_TRACE()) {
- x86emu_dump_regs();
- }
- if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) {
- printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
- print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
- print_decoded_instruction();
- }
-}
-
-void X86EMU_trace_xregs (void)
-{
- if (DEBUG_TRACE()) {
- x86emu_dump_xregs();
- }
-}
-
-void x86emu_just_disassemble (void)
-{
- /*
- * This routine called if the flag DEBUG_DISASSEMBLE is set kind
- * of a hack!
- */
- printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
- print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
- print_decoded_instruction();
-}
-
-static void disassemble_forward (u16 seg, u16 off, int n)
-{
- X86EMU_sysEnv tregs;
- int i;
- u8 op1;
- /*
- * hack, hack, hack. What we do is use the exact machinery set up
- * for execution, except that now there is an additional state
- * flag associated with the "execution", and we are using a copy
- * of the register struct. All the major opcodes, once fully
- * decoded, have the following two steps: TRACE_REGS(r,m);
- * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to
- * the preprocessor. The TRACE_REGS macro expands to:
- *
- * if (debug&DEBUG_DISASSEMBLE)
- * {just_disassemble(); goto EndOfInstruction;}
- * if (debug&DEBUG_TRACE) trace_regs(r,m);
- *
- * ...... and at the last line of the routine.
- *
- * EndOfInstruction: end_instr();
- *
- * Up to the point where TRACE_REG is expanded, NO modifications
- * are done to any register EXCEPT the IP register, for fetch and
- * decoding purposes.
- *
- * This was done for an entirely different reason, but makes a
- * nice way to get the system to help debug codes.
- */
- tregs = M;
- tregs.x86.R_IP = off;
- tregs.x86.R_CS = seg;
-
- /* reset the decoding buffers */
- tregs.x86.enc_str_pos = 0;
- tregs.x86.enc_pos = 0;
-
- /* turn on the "disassemble only, no execute" flag */
- tregs.x86.debug |= DEBUG_DISASSEMBLE_F;
-
- /* DUMP NEXT n instructions to screen in straight_line fashion */
- /*
- * This looks like the regular instruction fetch stream, except
- * that when this occurs, each fetched opcode, upon seeing the
- * DEBUG_DISASSEMBLE flag set, exits immediately after decoding
- * the instruction. XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
- * Note the use of a copy of the register structure...
- */
- for (i=0; i<n; i++) {
- op1 = (*sys_rdb)(((u32)M.x86.R_CS<<4) + (M.x86.R_IP++));
- (x86emu_optab[op1])(op1);
- }
- /* end major hack mode. */
-}
-
-void x86emu_check_ip_access (void)
-{
- /* NULL as of now */
-}
-
-void x86emu_check_sp_access (void)
-{
-}
-
-void x86emu_check_mem_access (u32 dummy)
-{
- /* check bounds, etc */
-}
-
-void x86emu_check_data_access (uint dummy1, uint dummy2)
-{
- /* check bounds, etc */
-}
-
-void x86emu_inc_decoded_inst_len (int x)
-{
- M.x86.enc_pos += x;
-}
-
-void x86emu_decode_printf (char *x)
-{
- sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x);
- M.x86.enc_str_pos += strlen(x);
-}
-
-void x86emu_decode_printf2 (char *x, int y)
-{
- char temp[100];
- sprintf(temp,x,y);
- sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",temp);
- M.x86.enc_str_pos += strlen(temp);
-}
-
-void x86emu_end_instr (void)
-{
- M.x86.enc_str_pos = 0;
- M.x86.enc_pos = 0;
-}
-
-static void print_encoded_bytes (u16 s, u16 o)
-{
- int i;
- char buf1[64];
- for (i=0; i< M.x86.enc_pos; i++) {
- sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i));
- }
- printk("%-20s",buf1);
-}
-
-static void print_decoded_instruction (void)
-{
- printk("%s", M.x86.decoded_buf);
-}
-
-void x86emu_print_int_vect (u16 iv)
-{
- u16 seg,off;
-
- if (iv > 256) return;
- seg = fetch_data_word_abs(0,iv*4);
- off = fetch_data_word_abs(0,iv*4+2);
- printk("%04x:%04x ", seg, off);
-}
-
-void X86EMU_dump_memory (u16 seg, u16 off, u32 amt)
-{
- u32 start = off & 0xfffffff0;
- u32 end = (off+16) & 0xfffffff0;
- u32 i;
- u32 current;
-
- current = start;
- while (end <= off + amt) {
- printk("%04x:%04x ", seg, start);
- for (i=start; i< off; i++)
- printk(" ");
- for ( ; i< end; i++)
- printk("%02x ", fetch_data_byte_abs(seg,i));
- printk("\n");
- start = end;
- end = start + 16;
- }
-}
-
-void x86emu_single_step (void)
-{
- char s[1024];
- int ps[10];
- int ntok;
- int cmd;
- int done;
- int segment;
- int offset;
- static int breakpoint;
- static int noDecode = 1;
-
- char *p;
-
- if (DEBUG_BREAK()) {
- if (M.x86.saved_ip != breakpoint) {
- return;
- } else {
- M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
- M.x86.debug |= DEBUG_TRACE_F;
- M.x86.debug &= ~DEBUG_BREAK_F;
- print_decoded_instruction ();
- X86EMU_trace_regs();
- }
- }
- done=0;
- offset = M.x86.saved_ip;
- while (!done) {
- printk("-");
- p = fgets(s, 1023, stdin);
- cmd = parse_line(s, ps, &ntok);
- switch(cmd) {
- case 'u':
- disassemble_forward(M.x86.saved_cs,(u16)offset,10);
- break;
- case 'd':
- if (ntok == 2) {
- segment = M.x86.saved_cs;
- offset = ps[1];
- X86EMU_dump_memory(segment,(u16)offset,16);
- offset += 16;
- } else if (ntok == 3) {
- segment = ps[1];
- offset = ps[2];
- X86EMU_dump_memory(segment,(u16)offset,16);
- offset += 16;
- } else {
- segment = M.x86.saved_cs;
- X86EMU_dump_memory(segment,(u16)offset,16);
- offset += 16;
- }
- break;
- case 'c':
- M.x86.debug ^= DEBUG_TRACECALL_F;
- break;
- case 's':
- M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
- break;
- case 'r':
- X86EMU_trace_regs();
- break;
- case 'x':
- X86EMU_trace_xregs();
- break;
- case 'g':
- if (ntok == 2) {
- breakpoint = ps[1];
- if (noDecode) {
- M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
- } else {
- M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
- }
- M.x86.debug &= ~DEBUG_TRACE_F;
- M.x86.debug |= DEBUG_BREAK_F;
- done = 1;
- }
- break;
- case 'q':
- exit(1);
- case 'P':
- noDecode = (noDecode)?0:1;
- printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
- break;
- case 't':
- case 0:
- done = 1;
- break;
- }
- }
-}
-
-int X86EMU_trace_on(void)
-{
- return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
-}
-
-int X86EMU_trace_off(void)
-{
- return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
-}
-
-static int parse_line (char *s, int *ps, int *n)
-{
- int cmd;
-
- *n = 0;
- while(*s == ' ' || *s == '\t') s++;
- ps[*n] = *s;
- switch (*s) {
- case '\n':
- *n += 1;
- return 0;
- default:
- cmd = *s;
- *n += 1;
- }
-
- while (1) {
- while (*s != ' ' && *s != '\t' && *s != '\n') s++;
-
- if (*s == '\n')
- return cmd;
-
- while(*s == ' ' || *s == '\t') s++;
-
- sscanf(s,"%x",&ps[*n]);
- *n += 1;
- }
-}
-
-#endif /* DEBUG */
-
-void x86emu_dump_regs (void)
-{
- printk("\tAX=%04x ", M.x86.R_AX );
- printk("BX=%04x ", M.x86.R_BX );
- printk("CX=%04x ", M.x86.R_CX );
- printk("DX=%04x ", M.x86.R_DX );
- printk("SP=%04x ", M.x86.R_SP );
- printk("BP=%04x ", M.x86.R_BP );
- printk("SI=%04x ", M.x86.R_SI );
- printk("DI=%04x\n", M.x86.R_DI );
- printk("\tDS=%04x ", M.x86.R_DS );
- printk("ES=%04x ", M.x86.R_ES );
- printk("SS=%04x ", M.x86.R_SS );
- printk("CS=%04x ", M.x86.R_CS );
- printk("IP=%04x ", M.x86.R_IP );
- if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
- else printk("NV ");
- if (ACCESS_FLAG(F_DF)) printk("DN ");
- else printk("UP ");
- if (ACCESS_FLAG(F_IF)) printk("EI ");
- else printk("DI ");
- if (ACCESS_FLAG(F_SF)) printk("NG ");
- else printk("PL ");
- if (ACCESS_FLAG(F_ZF)) printk("ZR ");
- else printk("NZ ");
- if (ACCESS_FLAG(F_AF)) printk("AC ");
- else printk("NA ");
- if (ACCESS_FLAG(F_PF)) printk("PE ");
- else printk("PO ");
- if (ACCESS_FLAG(F_CF)) printk("CY ");
- else printk("NC ");
- printk("\n");
-}
-
-void x86emu_dump_xregs (void)
-{
- printk("\tEAX=%08x ", M.x86.R_EAX );
- printk("EBX=%08x ", M.x86.R_EBX );
- printk("ECX=%08x ", M.x86.R_ECX );
- printk("EDX=%08x \n", M.x86.R_EDX );
- printk("\tESP=%08x ", M.x86.R_ESP );
- printk("EBP=%08x ", M.x86.R_EBP );
- printk("ESI=%08x ", M.x86.R_ESI );
- printk("EDI=%08x\n", M.x86.R_EDI );
- printk("\tDS=%04x ", M.x86.R_DS );
- printk("ES=%04x ", M.x86.R_ES );
- printk("SS=%04x ", M.x86.R_SS );
- printk("CS=%04x ", M.x86.R_CS );
- printk("EIP=%08x\n\t", M.x86.R_EIP );
- if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
- else printk("NV ");
- if (ACCESS_FLAG(F_DF)) printk("DN ");
- else printk("UP ");
- if (ACCESS_FLAG(F_IF)) printk("EI ");
- else printk("DI ");
- if (ACCESS_FLAG(F_SF)) printk("NG ");
- else printk("PL ");
- if (ACCESS_FLAG(F_ZF)) printk("ZR ");
- else printk("NZ ");
- if (ACCESS_FLAG(F_AF)) printk("AC ");
- else printk("NA ");
- if (ACCESS_FLAG(F_PF)) printk("PE ");
- else printk("PO ");
- if (ACCESS_FLAG(F_CF)) printk("CY ");
- else printk("NC ");
- printk("\n");
-}
diff --git a/hw/xfree86/x86emu/decode.c b/hw/xfree86/x86emu/decode.c
deleted file mode 100644
index 110be9848..000000000
--- a/hw/xfree86/x86emu/decode.c
+++ /dev/null
@@ -1,1073 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file includes subroutines which are related to
-* instruction decoding and accessess of immediate data via IP. etc.
-*
-****************************************************************************/
-
-/* $XFree86: xc/extras/x86emu/src/x86emu/decode.c,v 1.11 2002/07/23 20:20:43 tsi Exp $ */
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Handles any pending asychronous interrupts.
-****************************************************************************/
-static void x86emu_intr_handle(void)
-{
- u8 intno;
-
- if (M.x86.intr & INTR_SYNCH) {
- intno = M.x86.intno;
- if (_X86EMU_intrTab[intno]) {
- (*_X86EMU_intrTab[intno])(intno);
- } else {
- push_word((u16)M.x86.R_FLG);
- CLEAR_FLAG(F_IF);
- CLEAR_FLAG(F_TF);
- push_word(M.x86.R_CS);
- M.x86.R_CS = mem_access_word(intno * 4 + 2);
- push_word(M.x86.R_IP);
- M.x86.R_IP = mem_access_word(intno * 4);
- M.x86.intr = 0;
- }
- }
-}
-
-/****************************************************************************
-PARAMETERS:
-intrnum - Interrupt number to raise
-
-REMARKS:
-Raise the specified interrupt to be handled before the execution of the
-next instruction.
-****************************************************************************/
-void x86emu_intr_raise(
- u8 intrnum)
-{
- M.x86.intno = intrnum;
- M.x86.intr |= INTR_SYNCH;
-}
-
-/****************************************************************************
-REMARKS:
-Main execution loop for the emulator. We return from here when the system
-halts, which is normally caused by a stack fault when we return from the
-original real mode call.
-****************************************************************************/
-void X86EMU_exec(void)
-{
- u8 op1;
-
- M.x86.intr = 0;
- DB(x86emu_end_instr();)
-
- for (;;) {
-DB( if (CHECK_IP_FETCH())
- x86emu_check_ip_access();)
- /* If debugging, save the IP and CS values. */
- SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
- INC_DECODED_INST_LEN(1);
- if (M.x86.intr) {
- if (M.x86.intr & INTR_HALTED) {
-DB( printk("halted\n");
- X86EMU_trace_regs();)
- return;
- }
- if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
- !ACCESS_FLAG(F_IF)) {
- x86emu_intr_handle();
- }
- }
- op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
- (*x86emu_optab[op1])(op1);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Halts the system by setting the halted system flag.
-****************************************************************************/
-void X86EMU_halt_sys(void)
-{
- M.x86.intr |= INTR_HALTED;
-}
-
-/****************************************************************************
-PARAMETERS:
-mod - Mod value from decoded byte
-regh - Reg h value from decoded byte
-regl - Reg l value from decoded byte
-
-REMARKS:
-Raise the specified interrupt to be handled before the execution of the
-next instruction.
-
-NOTE: Do not inline this function, as (*sys_rdb) is already inline!
-****************************************************************************/
-void fetch_decode_modrm(
- int *mod,
- int *regh,
- int *regl)
-{
- int fetched;
-
-DB( if (CHECK_IP_FETCH())
- x86emu_check_ip_access();)
- fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
- INC_DECODED_INST_LEN(1);
- *mod = (fetched >> 6) & 0x03;
- *regh = (fetched >> 3) & 0x07;
- *regl = (fetched >> 0) & 0x07;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate byte value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdb) is already inline!
-****************************************************************************/
-u8 fetch_byte_imm(void)
-{
- u8 fetched;
-
-DB( if (CHECK_IP_FETCH())
- x86emu_check_ip_access();)
- fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
- INC_DECODED_INST_LEN(1);
- return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate word value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdw) is already inline!
-****************************************************************************/
-u16 fetch_word_imm(void)
-{
- u16 fetched;
-
-DB( if (CHECK_IP_FETCH())
- x86emu_check_ip_access();)
- fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
- M.x86.R_IP += 2;
- INC_DECODED_INST_LEN(2);
- return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate lone value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdw) is already inline!
-****************************************************************************/
-u32 fetch_long_imm(void)
-{
- u32 fetched;
-
-DB( if (CHECK_IP_FETCH())
- x86emu_check_ip_access();)
- fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
- M.x86.R_IP += 4;
- INC_DECODED_INST_LEN(4);
- return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Value of the default data segment
-
-REMARKS:
-Inline function that returns the default data segment for the current
-instruction.
-
-On the x86 processor, the default segment is not always DS if there is
-no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to
-addresses relative to SS (ie: on the stack). So, at the minimum, all
-decodings of addressing modes would have to set/clear a bit describing
-whether the access is relative to DS or SS. That is the function of the
-cpu-state-varible M.x86.mode. There are several potential states:
-
- repe prefix seen (handled elsewhere)
- repne prefix seen (ditto)
-
- cs segment override
- ds segment override
- es segment override
- fs segment override
- gs segment override
- ss segment override
-
- ds/ss select (in absense of override)
-
-Each of the above 7 items are handled with a bit in the mode field.
-****************************************************************************/
-_INLINE u32 get_data_segment(void)
-{
-#define GET_SEGMENT(segment)
- switch (M.x86.mode & SYSMODE_SEGMASK) {
- case 0: /* default case: use ds register */
- case SYSMODE_SEGOVR_DS:
- case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
- return M.x86.R_DS;
- case SYSMODE_SEG_DS_SS: /* non-overridden, use ss register */
- return M.x86.R_SS;
- case SYSMODE_SEGOVR_CS:
- case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
- return M.x86.R_CS;
- case SYSMODE_SEGOVR_ES:
- case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
- return M.x86.R_ES;
- case SYSMODE_SEGOVR_FS:
- case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
- return M.x86.R_FS;
- case SYSMODE_SEGOVR_GS:
- case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
- return M.x86.R_GS;
- case SYSMODE_SEGOVR_SS:
- case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
- return M.x86.R_SS;
- default:
-#ifdef DEBUG
- printk("error: should not happen: multiple overrides.\n");
-#endif
- HALT_SYS();
- return 0;
- }
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Byte value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u8 fetch_data_byte(
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- return (*sys_rdb)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Word value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 fetch_data_word(
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- return (*sys_rdw)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Long value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 fetch_data_long(
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- return (*sys_rdl)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Byte value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u8 fetch_data_byte_abs(
- uint segment,
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- return (*sys_rdb)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Word value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 fetch_data_word_abs(
- uint segment,
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- return (*sys_rdw)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Long value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 fetch_data_long_abs(
- uint segment,
- uint offset)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- return (*sys_rdl)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a word value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_byte(
- uint offset,
- u8 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- (*sys_wrb)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a word value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_word(
- uint offset,
- u16 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- (*sys_wrw)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a long value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_long(
- uint offset,
- u32 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
- (*sys_wrl)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to store data at
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a byte value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_byte_abs(
- uint segment,
- uint offset,
- u8 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- (*sys_wrb)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to store data at
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a word value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_word_abs(
- uint segment,
- uint offset,
- u16 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- (*sys_wrw)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment - Segment to store data at
-offset - Offset to store data at
-val - Value to store
-
-REMARKS:
-Writes a long value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_long_abs(
- uint segment,
- uint offset,
- u32 val)
-{
-#ifdef DEBUG
- if (CHECK_DATA_ACCESS())
- x86emu_check_data_access(segment, offset);
-#endif
- (*sys_wrl)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for byte operands. Also enables the decoding of instructions.
-****************************************************************************/
-u8* decode_rm_byte_register(
- int reg)
-{
- switch (reg) {
- case 0:
- DECODE_PRINTF("AL");
- return &M.x86.R_AL;
- case 1:
- DECODE_PRINTF("CL");
- return &M.x86.R_CL;
- case 2:
- DECODE_PRINTF("DL");
- return &M.x86.R_DL;
- case 3:
- DECODE_PRINTF("BL");
- return &M.x86.R_BL;
- case 4:
- DECODE_PRINTF("AH");
- return &M.x86.R_AH;
- case 5:
- DECODE_PRINTF("CH");
- return &M.x86.R_CH;
- case 6:
- DECODE_PRINTF("DH");
- return &M.x86.R_DH;
- case 7:
- DECODE_PRINTF("BH");
- return &M.x86.R_BH;
- }
- HALT_SYS();
- return NULL; /* NOT REACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for word operands. Also enables the decoding of instructions.
-****************************************************************************/
-u16* decode_rm_word_register(
- int reg)
-{
- switch (reg) {
- case 0:
- DECODE_PRINTF("AX");
- return &M.x86.R_AX;
- case 1:
- DECODE_PRINTF("CX");
- return &M.x86.R_CX;
- case 2:
- DECODE_PRINTF("DX");
- return &M.x86.R_DX;
- case 3:
- DECODE_PRINTF("BX");
- return &M.x86.R_BX;
- case 4:
- DECODE_PRINTF("SP");
- return &M.x86.R_SP;
- case 5:
- DECODE_PRINTF("BP");
- return &M.x86.R_BP;
- case 6:
- DECODE_PRINTF("SI");
- return &M.x86.R_SI;
- case 7:
- DECODE_PRINTF("DI");
- return &M.x86.R_DI;
- }
- HALT_SYS();
- return NULL; /* NOTREACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for dword operands. Also enables the decoding of instructions.
-****************************************************************************/
-u32* decode_rm_long_register(
- int reg)
-{
- switch (reg) {
- case 0:
- DECODE_PRINTF("EAX");
- return &M.x86.R_EAX;
- case 1:
- DECODE_PRINTF("ECX");
- return &M.x86.R_ECX;
- case 2:
- DECODE_PRINTF("EDX");
- return &M.x86.R_EDX;
- case 3:
- DECODE_PRINTF("EBX");
- return &M.x86.R_EBX;
- case 4:
- DECODE_PRINTF("ESP");
- return &M.x86.R_ESP;
- case 5:
- DECODE_PRINTF("EBP");
- return &M.x86.R_EBP;
- case 6:
- DECODE_PRINTF("ESI");
- return &M.x86.R_ESI;
- case 7:
- DECODE_PRINTF("EDI");
- return &M.x86.R_EDI;
- }
- HALT_SYS();
- return NULL; /* NOTREACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for word operands, modified from above for the weirdo
-special case of segreg operands. Also enables the decoding of instructions.
-****************************************************************************/
-u16* decode_rm_seg_register(
- int reg)
-{
- switch (reg) {
- case 0:
- DECODE_PRINTF("ES");
- return &M.x86.R_ES;
- case 1:
- DECODE_PRINTF("CS");
- return &M.x86.R_CS;
- case 2:
- DECODE_PRINTF("SS");
- return &M.x86.R_SS;
- case 3:
- DECODE_PRINTF("DS");
- return &M.x86.R_DS;
- case 4:
- case 5:
- case 6:
- case 7:
- DECODE_PRINTF("ILLEGAL SEGREG");
- break;
- }
- HALT_SYS();
- return NULL; /* NOT REACHED OR REACHED ON ERROR */
-}
-
-/*
- *
- * return offset from the SIB Byte
- */
-u32 decode_sib_address(int sib, int mod)
-{
- u32 base = 0, i = 0, scale = 1;
-
- switch(sib & 0x07) {
- case 0:
- DECODE_PRINTF("[EAX]");
- base = M.x86.R_EAX;
- break;
- case 1:
- DECODE_PRINTF("[ECX]");
- base = M.x86.R_ECX;
- break;
- case 2:
- DECODE_PRINTF("[EDX]");
- base = M.x86.R_EDX;
- break;
- case 3:
- DECODE_PRINTF("[EBX]");
- base = M.x86.R_EBX;
- break;
- case 4:
- DECODE_PRINTF("[ESP]");
- base = M.x86.R_ESP;
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- break;
- case 5:
- if (mod == 0) {
- base = fetch_long_imm();
- DECODE_PRINTF2("%08x", base);
- } else {
- DECODE_PRINTF("[EBP]");
- base = M.x86.R_ESP;
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- }
- break;
- case 6:
- DECODE_PRINTF("[ESI]");
- base = M.x86.R_ESI;
- break;
- case 7:
- DECODE_PRINTF("[EDI]");
- base = M.x86.R_EDI;
- break;
- }
- switch ((sib >> 3) & 0x07) {
- case 0:
- DECODE_PRINTF("[EAX");
- i = M.x86.R_EAX;
- break;
- case 1:
- DECODE_PRINTF("[ECX");
- i = M.x86.R_ECX;
- break;
- case 2:
- DECODE_PRINTF("[EDX");
- i = M.x86.R_EDX;
- break;
- case 3:
- DECODE_PRINTF("[EBX");
- i = M.x86.R_EBX;
- break;
- case 4:
- i = 0;
- break;
- case 5:
- DECODE_PRINTF("[EBP");
- i = M.x86.R_EBP;
- break;
- case 6:
- DECODE_PRINTF("[ESI");
- i = M.x86.R_ESI;
- break;
- case 7:
- DECODE_PRINTF("[EDI");
- i = M.x86.R_EDI;
- break;
- }
- scale = 1 << ((sib >> 6) & 0x03);
- if (((sib >> 3) & 0x07) != 4) {
- if (scale == 1) {
- DECODE_PRINTF("]");
- } else {
- DECODE_PRINTF2("*%d]", scale);
- }
- }
- return base + (i * scale);
-}
-
-/****************************************************************************
-PARAMETERS:
-rm - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=00 addressing. Also enables the
-decoding of instructions.
-
-NOTE: The code which specifies the corresponding segment (ds vs ss)
- below in the case of [BP+..]. The assumption here is that at the
- point that this subroutine is called, the bit corresponding to
- SYSMODE_SEG_DS_SS will be zero. After every instruction
- except the segment override instructions, this bit (as well
- as any bits indicating segment overrides) will be clear. So
- if a SS access is needed, set this bit. Otherwise, DS access
- occurs (unless any of the segment override bits are set).
-****************************************************************************/
-u32 decode_rm00_address(
- int rm)
-{
- u32 offset;
- int sib;
-
- if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
- switch (rm) {
- case 0:
- DECODE_PRINTF("[EAX]");
- return M.x86.R_EAX;
- case 1:
- DECODE_PRINTF("[ECX]");
- return M.x86.R_ECX;
- case 2:
- DECODE_PRINTF("[EDX]");
- return M.x86.R_EDX;
- case 3:
- DECODE_PRINTF("[EBX]");
- return M.x86.R_EBX;
- case 4:
- sib = fetch_byte_imm();
- return decode_sib_address(sib, 0);
- case 5:
- offset = fetch_long_imm();
- DECODE_PRINTF2("[%08x]", offset);
- return offset;
- case 6:
- DECODE_PRINTF("[ESI]");
- return M.x86.R_ESI;
- case 7:
- DECODE_PRINTF("[EDI]");
- return M.x86.R_EDI;
- }
- HALT_SYS();
- } else {
- switch (rm) {
- case 0:
- DECODE_PRINTF("[BX+SI]");
- return M.x86.R_BX + M.x86.R_SI;
- case 1:
- DECODE_PRINTF("[BX+DI]");
- return M.x86.R_BX + M.x86.R_DI;
- case 2:
- DECODE_PRINTF("[BP+SI]");
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI;
- case 3:
- DECODE_PRINTF("[BP+DI]");
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI;
- case 4:
- DECODE_PRINTF("[SI]");
- return M.x86.R_SI;
- case 5:
- DECODE_PRINTF("[DI]");
- return M.x86.R_DI;
- case 6:
- offset = fetch_word_imm();
- DECODE_PRINTF2("[%04x]", offset);
- return offset;
- case 7:
- DECODE_PRINTF("[BX]");
- return M.x86.R_BX;
- }
- HALT_SYS();
- }
- return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-rm - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=01 addressing. Also enables the
-decoding of instructions.
-****************************************************************************/
-u32 decode_rm01_address(
- int rm)
-{
- int displacement = 0;
- int sib;
-
- /* Fetch disp8 if no SIB byte */
- if (!((M.x86.mode & SYSMODE_PREFIX_ADDR) && (rm == 4)))
- displacement = (s8)fetch_byte_imm();
-
- if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
- switch (rm) {
- case 0:
- DECODE_PRINTF2("%d[EAX]", displacement);
- return M.x86.R_EAX + displacement;
- case 1:
- DECODE_PRINTF2("%d[ECX]", displacement);
- return M.x86.R_ECX + displacement;
- case 2:
- DECODE_PRINTF2("%d[EDX]", displacement);
- return M.x86.R_EDX + displacement;
- case 3:
- DECODE_PRINTF2("%d[EBX]", displacement);
- return M.x86.R_EBX + displacement;
- case 4:
- sib = fetch_byte_imm();
- displacement = (s8)fetch_byte_imm();
- DECODE_PRINTF2("%d", displacement);
- return decode_sib_address(sib, 1) + displacement;
- case 5:
- DECODE_PRINTF2("%d[EBP]", displacement);
- return M.x86.R_EBP + displacement;
- case 6:
- DECODE_PRINTF2("%d[ESI]", displacement);
- return M.x86.R_ESI + displacement;
- case 7:
- DECODE_PRINTF2("%d[EDI]", displacement);
- return M.x86.R_EDI + displacement;
- }
- HALT_SYS();
- } else {
- switch (rm) {
- case 0:
- DECODE_PRINTF2("%d[BX+SI]", displacement);
- return M.x86.R_BX + M.x86.R_SI + displacement;
- case 1:
- DECODE_PRINTF2("%d[BX+DI]", displacement);
- return M.x86.R_BX + M.x86.R_DI + displacement;
- case 2:
- DECODE_PRINTF2("%d[BP+SI]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI + displacement;
- case 3:
- DECODE_PRINTF2("%d[BP+DI]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI + displacement;
- case 4:
- DECODE_PRINTF2("%d[SI]", displacement);
- return M.x86.R_SI + displacement;
- case 5:
- DECODE_PRINTF2("%d[DI]", displacement);
- return M.x86.R_DI + displacement;
- case 6:
- DECODE_PRINTF2("%d[BP]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + displacement;
- case 7:
- DECODE_PRINTF2("%d[BX]", displacement);
- return M.x86.R_BX + displacement;
- }
- HALT_SYS();
- }
- return 0; /* SHOULD NOT HAPPEN */
-}
-
-/****************************************************************************
-PARAMETERS:
-rm - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=10 addressing. Also enables the
-decoding of instructions.
-****************************************************************************/
-u32 decode_rm10_address(
- int rm)
-{
- u32 displacement = 0;
- int sib;
-
- /* Fetch disp16 if 16-bit addr mode */
- if (!(M.x86.mode & SYSMODE_PREFIX_ADDR))
- displacement = (u16)fetch_word_imm();
- else {
- /* Fetch disp32 if no SIB byte */
- if (rm != 4)
- displacement = (u32)fetch_long_imm();
- }
-
- if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
- switch (rm) {
- case 0:
- DECODE_PRINTF2("%08x[EAX]", displacement);
- return M.x86.R_EAX + displacement;
- case 1:
- DECODE_PRINTF2("%08x[ECX]", displacement);
- return M.x86.R_ECX + displacement;
- case 2:
- DECODE_PRINTF2("%08x[EDX]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_EDX + displacement;
- case 3:
- DECODE_PRINTF2("%08x[EBX]", displacement);
- return M.x86.R_EBX + displacement;
- case 4:
- sib = fetch_byte_imm();
- displacement = (u32)fetch_long_imm();
- DECODE_PRINTF2("%08x", displacement);
- return decode_sib_address(sib, 2) + displacement;
- break;
- case 5:
- DECODE_PRINTF2("%08x[EBP]", displacement);
- return M.x86.R_EBP + displacement;
- case 6:
- DECODE_PRINTF2("%08x[ESI]", displacement);
- return M.x86.R_ESI + displacement;
- case 7:
- DECODE_PRINTF2("%08x[EDI]", displacement);
- return M.x86.R_EDI + displacement;
- }
- HALT_SYS();
- } else {
- switch (rm) {
- case 0:
- DECODE_PRINTF2("%04x[BX+SI]", displacement);
- return M.x86.R_BX + M.x86.R_SI + displacement;
- case 1:
- DECODE_PRINTF2("%04x[BX+DI]", displacement);
- return M.x86.R_BX + M.x86.R_DI + displacement;
- case 2:
- DECODE_PRINTF2("%04x[BP+SI]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_SI + displacement;
- case 3:
- DECODE_PRINTF2("%04x[BP+DI]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + M.x86.R_DI + displacement;
- case 4:
- DECODE_PRINTF2("%04x[SI]", displacement);
- return M.x86.R_SI + displacement;
- case 5:
- DECODE_PRINTF2("%04x[DI]", displacement);
- return M.x86.R_DI + displacement;
- case 6:
- DECODE_PRINTF2("%04x[BP]", displacement);
- M.x86.mode |= SYSMODE_SEG_DS_SS;
- return M.x86.R_BP + displacement;
- case 7:
- DECODE_PRINTF2("%04x[BX]", displacement);
- return M.x86.R_BX + displacement;
- }
- HALT_SYS();
- }
- return 0;
- /*NOTREACHED */
-}
diff --git a/hw/xfree86/x86emu/fpu.c b/hw/xfree86/x86emu/fpu.c
deleted file mode 100644
index 0f679bde6..000000000
--- a/hw/xfree86/x86emu/fpu.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file contains the code to implement the decoding and
-* emulation of the FPU instructions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/fpu.c,v 1.2 2003/10/22 20:03:06 tsi Exp $ */
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* opcode=0xd8 */
-void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("ESC D8\n");
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_d9_tab[] = {
- "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
- "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-
- "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
- "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-
- "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
- "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-};
-
-static char *x86emu_fpu_op_d9_tab1[] = {
- "FLD\t", "FLD\t", "FLD\t", "FLD\t",
- "FLD\t", "FLD\t", "FLD\t", "FLD\t",
-
- "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
- "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
-
- "FNOP", "ESC_D9", "ESC_D9", "ESC_D9",
- "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9",
-
- "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
- "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
-
- "FCHS", "FABS", "ESC_D9", "ESC_D9",
- "FTST", "FXAM", "ESC_D9", "ESC_D9",
-
- "FLD1", "FLDL2T", "FLDL2E", "FLDPI",
- "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9",
-
- "F2XM1", "FYL2X", "FPTAN", "FPATAN",
- "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP",
-
- "FPREM", "FYL2XP1", "FSQRT", "ESC_D9",
- "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xd9 */
-void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (mod != 3) {
- DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
- } else {
- DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
- }
-#endif
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- if (rh < 4) {
- DECODE_PRINTF2("ST(%d)\n", stkelem);
- } else {
- DECODE_PRINTF("\n");
- }
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- /* execute */
- switch (mod) {
- case 3:
- switch (rh) {
- case 0:
- x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
- break;
- case 1:
- x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
- break;
- case 2:
- switch (rl) {
- case 0:
- x86emu_fpu_R_nop();
- break;
- default:
- x86emu_fpu_illegal();
- break;
- }
- case 3:
- x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
- break;
- case 4:
- switch (rl) {
- case 0:
- x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP);
- break;
- case 4:
- x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP);
- break;
- default:
- /* 2,3,6,7 */
- x86emu_fpu_illegal();
- break;
- }
- break;
-
- case 5:
- switch (rl) {
- case 0:
- x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP);
- break;
- case 2:
- x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP);
- break;
- case 3:
- x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP);
- break;
- case 4:
- x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP);
- break;
- case 6:
- x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP);
- break;
- default:
- /* 7 */
- x86emu_fpu_illegal();
- break;
- }
- break;
-
- case 6:
- switch (rl) {
- case 0:
- x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP);
- break;
- case 2:
- x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP);
- break;
- case 3:
- x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP);
- break;
- case 4:
- x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_illegal();
- break;
- case 6:
- x86emu_fpu_R_decstp();
- break;
- case 7:
- x86emu_fpu_R_incstp();
- break;
- }
- break;
-
- case 7:
- switch (rl) {
- case 0:
- x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP);
- break;
- case 2:
- x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP);
- break;
- case 3:
- x86emu_fpu_illegal();
- break;
- case 4:
- x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP);
- break;
- case 6:
- case 7:
- default:
- x86emu_fpu_illegal();
- break;
- }
- break;
-
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
- break;
- case 1:
- x86emu_fpu_illegal();
- break;
- case 2:
- x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset);
- break;
- case 3:
- x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset);
- break;
- case 4:
- x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset);
- break;
- case 5:
- x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset);
- break;
- case 6:
- x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset);
- break;
- case 7:
- x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset);
- break;
- }
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif /* X86EMU_FPU_PRESENT */
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-char *x86emu_fpu_op_da_tab[] = {
- "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
- "FICOMP\tDWORD PTR ",
- "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
- "FIDIVR\tDWORD PTR ",
-
- "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
- "FICOMP\tDWORD PTR ",
- "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
- "FIDIVR\tDWORD PTR ",
-
- "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
- "FICOMP\tDWORD PTR ",
- "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
- "FIDIVR\tDWORD PTR ",
-
- "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
- "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xda */
-void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- switch (mod) {
- case 3:
- x86emu_fpu_illegal();
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
- break;
- case 1:
- x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset);
- break;
- case 2:
- x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset);
- break;
- case 3:
- x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset);
- break;
- case 4:
- x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset);
- break;
- case 5:
- x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset);
- break;
- case 6:
- x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset);
- break;
- case 7:
- x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-char *x86emu_fpu_op_db_tab[] = {
- "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
- "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-
- "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
- "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-
- "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
- "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdb */
-void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (mod != 3) {
- DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
- } else if (rh == 4) { /* === 11 10 0 nnn */
- switch (rl) {
- case 0:
- DECODE_PRINTF("FENI\n");
- break;
- case 1:
- DECODE_PRINTF("FDISI\n");
- break;
- case 2:
- DECODE_PRINTF("FCLEX\n");
- break;
- case 3:
- DECODE_PRINTF("FINIT\n");
- break;
- }
- } else {
- DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
- }
-#endif /* DEBUG */
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- break;
- case 3: /* register to register */
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- /* execute */
- switch (mod) {
- case 3:
- switch (rh) {
- case 4:
- switch (rl) {
- case 0:
- x86emu_fpu_R_feni();
- break;
- case 1:
- x86emu_fpu_R_fdisi();
- break;
- case 2:
- x86emu_fpu_R_fclex();
- break;
- case 3:
- x86emu_fpu_R_finit();
- break;
- default:
- x86emu_fpu_illegal();
- break;
- }
- break;
- default:
- x86emu_fpu_illegal();
- break;
- }
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
- break;
- case 1:
- x86emu_fpu_illegal();
- break;
- case 2:
- x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset);
- break;
- case 3:
- x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset);
- break;
- case 4:
- x86emu_fpu_illegal();
- break;
- case 5:
- x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset);
- break;
- case 6:
- x86emu_fpu_illegal();
- break;
- case 7:
- x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-char *x86emu_fpu_op_dc_tab[] = {
- "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
- "FCOMP\tQWORD PTR ",
- "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
- "FDIVR\tQWORD PTR ",
-
- "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
- "FCOMP\tQWORD PTR ",
- "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
- "FDIVR\tQWORD PTR ",
-
- "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
- "FCOMP\tQWORD PTR ",
- "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
- "FDIVR\tQWORD PTR ",
-
- "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
- "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
-};
-#endif /* DEBUG */
-
-/* opcode=0xdc */
-void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- /* execute */
- switch (mod) {
- case 3:
- switch (rh) {
- case 0:
- x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 2:
- x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 3:
- x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 4:
- x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 6:
- x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 7:
- x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP);
- break;
- }
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 1:
- x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 2:
- x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 3:
- x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 4:
- x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 5:
- x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 6:
- x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 7:
- x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_dd_tab[] = {
- "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
- "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
- "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
- "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
- "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
- "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
- "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
- "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdd */
-void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- switch (mod) {
- case 3:
- switch (rh) {
- case 0:
- x86emu_fpu_R_ffree(stkelem);
- break;
- case 1:
- x86emu_fpu_R_fxch(stkelem);
- break;
- case 2:
- x86emu_fpu_R_fst(stkelem); /* register version */
- break;
- case 3:
- x86emu_fpu_R_fstp(stkelem); /* register version */
- break;
- default:
- x86emu_fpu_illegal();
- break;
- }
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 1:
- x86emu_fpu_illegal();
- break;
- case 2:
- x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 3:
- x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset);
- break;
- case 4:
- x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset);
- break;
- case 5:
- x86emu_fpu_illegal();
- break;
- case 6:
- x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset);
- break;
- case 7:
- x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_de_tab[] =
-{
- "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
- "FICOMP\tWORD PTR ",
- "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
- "FIDIVR\tWORD PTR ",
-
- "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
- "FICOMP\tWORD PTR ",
- "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
- "FIDIVR\tWORD PTR ",
-
- "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
- "FICOMP\tWORD PTR ",
- "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
- "FIDIVR\tWORD PTR ",
-
- "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t",
- "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xde */
-void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- switch (mod) {
- case 3:
- switch (rh) {
- case 0:
- x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 1:
- x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 2:
- x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 3:
- if (stkelem == 1)
- x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
- else
- x86emu_fpu_illegal();
- break;
- case 4:
- x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 5:
- x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 6:
- x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP);
- break;
- case 7:
- x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP);
- break;
- }
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
- break;
- case 1:
- x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset);
- break;
- case 2:
- x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset);
- break;
- case 3:
- x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset);
- break;
- case 4:
- x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset);
- break;
- case 5:
- x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset);
- break;
- case 6:
- x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset);
- break;
- case 7:
- x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_df_tab[] = {
- /* mod == 00 */
- "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
- "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
- "FISTP\tQWORD PTR ",
-
- /* mod == 01 */
- "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
- "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
- "FISTP\tQWORD PTR ",
-
- /* mod == 10 */
- "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
- "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
- "FISTP\tQWORD PTR ",
-
- /* mod == 11 */
- "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
- "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdf */
-void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset = 0;
- u8 stkelem = 0;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- break;
- case 3: /* register to register */
- stkelem = (u8)rl;
- DECODE_PRINTF2("\tST(%d)\n", stkelem);
- break;
- }
-#ifdef X86EMU_FPU_PRESENT
- switch (mod) {
- case 3:
- switch (rh) {
- case 0:
- x86emu_fpu_R_ffree(stkelem);
- break;
- case 1:
- x86emu_fpu_R_fxch(stkelem);
- break;
- case 2:
- x86emu_fpu_R_fst(stkelem); /* register version */
- break;
- case 3:
- x86emu_fpu_R_fstp(stkelem); /* register version */
- break;
- default:
- x86emu_fpu_illegal();
- break;
- }
- break;
- default:
- switch (rh) {
- case 0:
- x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
- break;
- case 1:
- x86emu_fpu_illegal();
- break;
- case 2:
- x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset);
- break;
- case 3:
- x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset);
- break;
- case 4:
- x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset);
- break;
- case 5:
- x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset);
- break;
- case 6:
- x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset);
- break;
- case 7:
- x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset);
- break;
- }
- }
-#else
- (void)destoffset;
- (void)stkelem;
-#endif
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR_NO_TRACE();
-}
diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
deleted file mode 100644
index 94041f6c8..000000000
--- a/hw/xfree86/x86emu/ops.c
+++ /dev/null
@@ -1,11677 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file includes subroutines to implement the decoding
-* and emulation of all the x86 processor instructions.
-*
-* There are approximately 250 subroutines in here, which correspond
-* to the 256 byte-"opcodes" found on the 8086. The table which
-* dispatches this is found in the files optab.[ch].
-*
-* Each opcode proc has a comment preceeding it which gives it's table
-* address. Several opcodes are missing (undefined) in the table.
-*
-* Each proc includes information for decoding (DECODE_PRINTF and
-* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
-* functions (START_OF_INSTR, END_OF_INSTR).
-*
-* Many of the procedures are *VERY* similar in coding. This has
-* allowed for a very large amount of code to be generated in a fairly
-* short amount of time (i.e. cut, paste, and modify). The result is
-* that much of the code below could have been folded into subroutines
-* for a large reduction in size of this file. The downside would be
-* that there would be a penalty in execution speed. The file could
-* also have been *MUCH* larger by inlining certain functions which
-* were called. This could have resulted even faster execution. The
-* prime directive I used to decide whether to inline the code or to
-* modularize it, was basically: 1) no unnecessary subroutine calls,
-* 2) no routines more than about 200 lines in size, and 3) modularize
-* any code that I might not get right the first time. The fetch_*
-* subroutines fall into the latter category. The The decode_* fall
-* into the second category. The coding of the "switch(mod){ .... }"
-* in many of the subroutines below falls into the first category.
-* Especially, the coding of {add,and,or,sub,...}_{byte,word}
-* subroutines are an especially glaring case of the third guideline.
-* Since so much of the code is cloned from other modules (compare
-* opcode #00 to opcode #01), making the basic operations subroutine
-* calls is especially important; otherwise mistakes in coding an
-* "add" would represent a nightmare in maintenance.
-*
-****************************************************************************/
-
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.9 2003/10/22 20:03:06 tsi Exp $ */
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-op1 - Instruction op code
-
-REMARKS:
-Handles illegal opcodes.
-****************************************************************************/
-static void x86emuOp_illegal_op(
- u8 op1)
-{
- START_OF_INSTR();
- DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
- TRACE_REGS();
- printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
- M.x86.R_CS, M.x86.R_IP-1,op1);
- HALT_SYS();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x00
-****************************************************************************/
-static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 *destreg, *srcreg;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x01
-****************************************************************************/
-static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = add_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x02
-****************************************************************************/
-static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x03
-****************************************************************************/
-static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = add_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x04
-****************************************************************************/
-static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADD\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = add_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x05
-****************************************************************************/
-static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("ADD\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("ADD\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x06
-****************************************************************************/
-static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tES\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_ES);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x07
-****************************************************************************/
-static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("POP\tES\n");
- TRACE_AND_STEP();
- M.x86.R_ES = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x08
-****************************************************************************/
-static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("OR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x09
-****************************************************************************/
-static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("OR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = or_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0a
-****************************************************************************/
-static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("OR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0b
-****************************************************************************/
-static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("OR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = or_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0c
-****************************************************************************/
-static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("OR\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = or_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0d
-****************************************************************************/
-static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("OR\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("OR\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0e
-****************************************************************************/
-static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tCS\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
-****************************************************************************/
-static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
-{
- u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
- INC_DECODED_INST_LEN(1);
- (*x86emu_optab2[op2])(op2);
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x10
-****************************************************************************/
-static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADC\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x11
-****************************************************************************/
-static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADC\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = adc_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x12
-****************************************************************************/
-static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADC\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x13
-****************************************************************************/
-static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADC\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = adc_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x14
-****************************************************************************/
-static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("ADC\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = adc_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x15
-****************************************************************************/
-static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("ADC\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("ADC\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x16
-****************************************************************************/
-static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tSS\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_SS);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x17
-****************************************************************************/
-static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("POP\tSS\n");
- TRACE_AND_STEP();
- M.x86.R_SS = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x18
-****************************************************************************/
-static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SBB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x19
-****************************************************************************/
-static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SBB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sbb_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1a
-****************************************************************************/
-static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SBB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1b
-****************************************************************************/
-static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SBB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sbb_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1c
-****************************************************************************/
-static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SBB\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1d
-****************************************************************************/
-static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("SBB\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("SBB\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1e
-****************************************************************************/
-static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tDS\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_DS);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1f
-****************************************************************************/
-static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("POP\tDS\n");
- TRACE_AND_STEP();
- M.x86.R_DS = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x20
-****************************************************************************/
-static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("AND\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
-
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
-
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
-
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
-
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x21
-****************************************************************************/
-static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("AND\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = and_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x22
-****************************************************************************/
-static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("AND\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x23
-****************************************************************************/
-static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("AND\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_long(*destreg, srcval);
- break;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_word(*destreg, srcval);
- break;
- }
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = and_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x24
-****************************************************************************/
-static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("AND\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = and_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x25
-****************************************************************************/
-static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("AND\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("AND\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x26
-****************************************************************************/
-static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("ES:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_ES;
- /*
- * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
- * opcode subroutines we do not want to do this.
- */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x27
-****************************************************************************/
-static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("DAA\n");
- TRACE_AND_STEP();
- M.x86.R_AL = daa_byte(M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x28
-****************************************************************************/
-static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SUB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x29
-****************************************************************************/
-static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SUB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = sub_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2a
-****************************************************************************/
-static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SUB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2b
-****************************************************************************/
-static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SUB\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = sub_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2c
-****************************************************************************/
-static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("SUB\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = sub_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2d
-****************************************************************************/
-static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("SUB\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("SUB\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2e
-****************************************************************************/
-static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("CS:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_CS;
- /* note no DECODE_CLEAR_SEGOVR here. */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2f
-****************************************************************************/
-static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("DAS\n");
- TRACE_AND_STEP();
- M.x86.R_AL = das_byte(M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x30
-****************************************************************************/
-static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("XOR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_byte(destval, *srcreg);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x31
-****************************************************************************/
-static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("XOR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_long(destval, *srcreg);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = xor_word(destval, *srcreg);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x32
-****************************************************************************/
-static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("XOR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x33
-****************************************************************************/
-static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("XOR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = xor_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x34
-****************************************************************************/
-static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("XOR\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- M.x86.R_AL = xor_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x35
-****************************************************************************/
-static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XOR\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("XOR\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
- } else {
- M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x36
-****************************************************************************/
-static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("SS:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_SS;
- /* no DECODE_CLEAR_SEGOVR ! */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x37
-****************************************************************************/
-static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("AAA\n");
- TRACE_AND_STEP();
- M.x86.R_AX = aaa_word(M.x86.R_AX);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x38
-****************************************************************************/
-static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 *destreg, *srcreg;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMP\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(destval, *srcreg);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(destval, *srcreg);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(destval, *srcreg);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x39
-****************************************************************************/
-static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMP\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(destval, *srcreg);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(destval, *srcreg);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(destval, *srcreg);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3a
-****************************************************************************/
-static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMP\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(*destreg, srcval);
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(*destreg, srcval);
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(*destreg, srcval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3b
-****************************************************************************/
-static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMP\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(*destreg, srcval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(*destreg, srcval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(*destreg, srcval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- cmp_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3c
-****************************************************************************/
-static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMP\tAL,");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- cmp_byte(M.x86.R_AL, srcval);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3d
-****************************************************************************/
-static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("CMP\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("CMP\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- cmp_long(M.x86.R_EAX, srcval);
- } else {
- cmp_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3e
-****************************************************************************/
-static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("DS:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_DS;
- /* NO DECODE_CLEAR_SEGOVR! */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3f
-****************************************************************************/
-static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("AAS\n");
- TRACE_AND_STEP();
- M.x86.R_AX = aas_word(M.x86.R_AX);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x40
-****************************************************************************/
-static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tEAX\n");
- } else {
- DECODE_PRINTF("INC\tAX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = inc_long(M.x86.R_EAX);
- } else {
- M.x86.R_AX = inc_word(M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x41
-****************************************************************************/
-static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tECX\n");
- } else {
- DECODE_PRINTF("INC\tCX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = inc_long(M.x86.R_ECX);
- } else {
- M.x86.R_CX = inc_word(M.x86.R_CX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x42
-****************************************************************************/
-static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tEDX\n");
- } else {
- DECODE_PRINTF("INC\tDX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDX = inc_long(M.x86.R_EDX);
- } else {
- M.x86.R_DX = inc_word(M.x86.R_DX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x43
-****************************************************************************/
-static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tEBX\n");
- } else {
- DECODE_PRINTF("INC\tBX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBX = inc_long(M.x86.R_EBX);
- } else {
- M.x86.R_BX = inc_word(M.x86.R_BX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x44
-****************************************************************************/
-static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tESP\n");
- } else {
- DECODE_PRINTF("INC\tSP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESP = inc_long(M.x86.R_ESP);
- } else {
- M.x86.R_SP = inc_word(M.x86.R_SP);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x45
-****************************************************************************/
-static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tEBP\n");
- } else {
- DECODE_PRINTF("INC\tBP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBP = inc_long(M.x86.R_EBP);
- } else {
- M.x86.R_BP = inc_word(M.x86.R_BP);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x46
-****************************************************************************/
-static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tESI\n");
- } else {
- DECODE_PRINTF("INC\tSI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESI = inc_long(M.x86.R_ESI);
- } else {
- M.x86.R_SI = inc_word(M.x86.R_SI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x47
-****************************************************************************/
-static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tEDI\n");
- } else {
- DECODE_PRINTF("INC\tDI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDI = inc_long(M.x86.R_EDI);
- } else {
- M.x86.R_DI = inc_word(M.x86.R_DI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x48
-****************************************************************************/
-static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tEAX\n");
- } else {
- DECODE_PRINTF("DEC\tAX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = dec_long(M.x86.R_EAX);
- } else {
- M.x86.R_AX = dec_word(M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x49
-****************************************************************************/
-static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tECX\n");
- } else {
- DECODE_PRINTF("DEC\tCX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = dec_long(M.x86.R_ECX);
- } else {
- M.x86.R_CX = dec_word(M.x86.R_CX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4a
-****************************************************************************/
-static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tEDX\n");
- } else {
- DECODE_PRINTF("DEC\tDX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDX = dec_long(M.x86.R_EDX);
- } else {
- M.x86.R_DX = dec_word(M.x86.R_DX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4b
-****************************************************************************/
-static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tEBX\n");
- } else {
- DECODE_PRINTF("DEC\tBX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBX = dec_long(M.x86.R_EBX);
- } else {
- M.x86.R_BX = dec_word(M.x86.R_BX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4c
-****************************************************************************/
-static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tESP\n");
- } else {
- DECODE_PRINTF("DEC\tSP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESP = dec_long(M.x86.R_ESP);
- } else {
- M.x86.R_SP = dec_word(M.x86.R_SP);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4d
-****************************************************************************/
-static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tEBP\n");
- } else {
- DECODE_PRINTF("DEC\tBP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBP = dec_long(M.x86.R_EBP);
- } else {
- M.x86.R_BP = dec_word(M.x86.R_BP);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4e
-****************************************************************************/
-static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tESI\n");
- } else {
- DECODE_PRINTF("DEC\tSI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESI = dec_long(M.x86.R_ESI);
- } else {
- M.x86.R_SI = dec_word(M.x86.R_SI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4f
-****************************************************************************/
-static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tEDI\n");
- } else {
- DECODE_PRINTF("DEC\tDI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDI = dec_long(M.x86.R_EDI);
- } else {
- M.x86.R_DI = dec_word(M.x86.R_DI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x50
-****************************************************************************/
-static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tEAX\n");
- } else {
- DECODE_PRINTF("PUSH\tAX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_EAX);
- } else {
- push_word(M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x51
-****************************************************************************/
-static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tECX\n");
- } else {
- DECODE_PRINTF("PUSH\tCX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_ECX);
- } else {
- push_word(M.x86.R_CX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x52
-****************************************************************************/
-static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tEDX\n");
- } else {
- DECODE_PRINTF("PUSH\tDX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_EDX);
- } else {
- push_word(M.x86.R_DX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x53
-****************************************************************************/
-static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tEBX\n");
- } else {
- DECODE_PRINTF("PUSH\tBX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_EBX);
- } else {
- push_word(M.x86.R_BX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x54
-****************************************************************************/
-static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tESP\n");
- } else {
- DECODE_PRINTF("PUSH\tSP\n");
- }
- TRACE_AND_STEP();
- /* Always push (E)SP, since we are emulating an i386 and above
- * processor. This is necessary as some BIOS'es use this to check
- * what type of processor is in the system.
- */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_ESP);
- } else {
- push_word((u16)(M.x86.R_SP));
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x55
-****************************************************************************/
-static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tEBP\n");
- } else {
- DECODE_PRINTF("PUSH\tBP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_EBP);
- } else {
- push_word(M.x86.R_BP);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x56
-****************************************************************************/
-static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tESI\n");
- } else {
- DECODE_PRINTF("PUSH\tSI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_ESI);
- } else {
- push_word(M.x86.R_SI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x57
-****************************************************************************/
-static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSH\tEDI\n");
- } else {
- DECODE_PRINTF("PUSH\tDI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(M.x86.R_EDI);
- } else {
- push_word(M.x86.R_DI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x58
-****************************************************************************/
-static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tEAX\n");
- } else {
- DECODE_PRINTF("POP\tAX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = pop_long();
- } else {
- M.x86.R_AX = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x59
-****************************************************************************/
-static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tECX\n");
- } else {
- DECODE_PRINTF("POP\tCX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = pop_long();
- } else {
- M.x86.R_CX = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5a
-****************************************************************************/
-static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tEDX\n");
- } else {
- DECODE_PRINTF("POP\tDX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDX = pop_long();
- } else {
- M.x86.R_DX = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5b
-****************************************************************************/
-static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tEBX\n");
- } else {
- DECODE_PRINTF("POP\tBX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBX = pop_long();
- } else {
- M.x86.R_BX = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5c
-****************************************************************************/
-static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tESP\n");
- } else {
- DECODE_PRINTF("POP\tSP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESP = pop_long();
- } else {
- M.x86.R_SP = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5d
-****************************************************************************/
-static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tEBP\n");
- } else {
- DECODE_PRINTF("POP\tBP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBP = pop_long();
- } else {
- M.x86.R_BP = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5e
-****************************************************************************/
-static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tESI\n");
- } else {
- DECODE_PRINTF("POP\tSI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESI = pop_long();
- } else {
- M.x86.R_SI = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5f
-****************************************************************************/
-static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POP\tEDI\n");
- } else {
- DECODE_PRINTF("POP\tDI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDI = pop_long();
- } else {
- M.x86.R_DI = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x60
-****************************************************************************/
-static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSHAD\n");
- } else {
- DECODE_PRINTF("PUSHA\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 old_sp = M.x86.R_ESP;
-
- push_long(M.x86.R_EAX);
- push_long(M.x86.R_ECX);
- push_long(M.x86.R_EDX);
- push_long(M.x86.R_EBX);
- push_long(old_sp);
- push_long(M.x86.R_EBP);
- push_long(M.x86.R_ESI);
- push_long(M.x86.R_EDI);
- } else {
- u16 old_sp = M.x86.R_SP;
-
- push_word(M.x86.R_AX);
- push_word(M.x86.R_CX);
- push_word(M.x86.R_DX);
- push_word(M.x86.R_BX);
- push_word(old_sp);
- push_word(M.x86.R_BP);
- push_word(M.x86.R_SI);
- push_word(M.x86.R_DI);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x61
-****************************************************************************/
-static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POPAD\n");
- } else {
- DECODE_PRINTF("POPA\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDI = pop_long();
- M.x86.R_ESI = pop_long();
- M.x86.R_EBP = pop_long();
- M.x86.R_ESP += 4; /* skip ESP */
- M.x86.R_EBX = pop_long();
- M.x86.R_EDX = pop_long();
- M.x86.R_ECX = pop_long();
- M.x86.R_EAX = pop_long();
- } else {
- M.x86.R_DI = pop_word();
- M.x86.R_SI = pop_word();
- M.x86.R_BP = pop_word();
- M.x86.R_SP += 2; /* skip SP */
- M.x86.R_BX = pop_word();
- M.x86.R_DX = pop_word();
- M.x86.R_CX = pop_word();
- M.x86.R_AX = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/*opcode 0x62 ILLEGAL OP, calls x86emuOp_illegal_op() */
-/*opcode 0x63 ILLEGAL OP, calls x86emuOp_illegal_op() */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x64
-****************************************************************************/
-static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("FS:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_FS;
- /*
- * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
- * opcode subroutines we do not want to do this.
- */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x65
-****************************************************************************/
-static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("GS:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_SEGOVR_GS;
- /*
- * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
- * opcode subroutines we do not want to do this.
- */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x66 - prefix for 32-bit register
-****************************************************************************/
-static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("DATA:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_PREFIX_DATA;
- /* note no DECODE_CLEAR_SEGOVR here. */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x67 - prefix for 32-bit address
-****************************************************************************/
-static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("ADDR:\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_PREFIX_ADDR;
- /* note no DECODE_CLEAR_SEGOVR here. */
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x68
-****************************************************************************/
-static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 imm;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- imm = fetch_long_imm();
- } else {
- imm = fetch_word_imm();
- }
- DECODE_PRINTF2("PUSH\t%x\n", imm);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(imm);
- } else {
- push_word((u16)imm);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x69
-****************************************************************************/
-static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("IMUL\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
- s32 imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
- s16 imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
- s32 imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
- s16 imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
- s32 imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
- s16 imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
- u32 res_lo,res_hi;
- s32 imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg,*srcreg;
- u32 res;
- s16 imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- res = (s16)*srcreg * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6a
-****************************************************************************/
-static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
- s16 imm;
-
- START_OF_INSTR();
- imm = (s8)fetch_byte_imm();
- DECODE_PRINTF2("PUSH\t%d\n", imm);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long((s32)imm);
- } else {
- push_word(imm);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6b
-****************************************************************************/
-static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
- s8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("IMUL\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- res = (s16)srcval * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg,*srcreg;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%d\n", (s32)imm);
- res = (s16)*srcreg * (s16)imm;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6c
-****************************************************************************/
-static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("INSB\n");
- ins(1);
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6d
-****************************************************************************/
-static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INSD\n");
- ins(4);
- } else {
- DECODE_PRINTF("INSW\n");
- ins(2);
- }
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6e
-****************************************************************************/
-static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("OUTSB\n");
- outs(1);
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6f
-****************************************************************************/
-static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("OUTSD\n");
- outs(4);
- } else {
- DECODE_PRINTF("OUTSW\n");
- outs(2);
- }
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x70
-****************************************************************************/
-static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if overflow flag is set */
- START_OF_INSTR();
- DECODE_PRINTF("JO\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_OF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x71
-****************************************************************************/
-static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if overflow is not set */
- START_OF_INSTR();
- DECODE_PRINTF("JNO\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!ACCESS_FLAG(F_OF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x72
-****************************************************************************/
-static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if carry flag is set. */
- START_OF_INSTR();
- DECODE_PRINTF("JB\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_CF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x73
-****************************************************************************/
-static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if carry flag is clear. */
- START_OF_INSTR();
- DECODE_PRINTF("JNB\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!ACCESS_FLAG(F_CF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x74
-****************************************************************************/
-static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if zero flag is set. */
- START_OF_INSTR();
- DECODE_PRINTF("JZ\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_ZF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x75
-****************************************************************************/
-static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if zero flag is clear. */
- START_OF_INSTR();
- DECODE_PRINTF("JNZ\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!ACCESS_FLAG(F_ZF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x76
-****************************************************************************/
-static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if carry flag is set or if the zero
- flag is set. */
- START_OF_INSTR();
- DECODE_PRINTF("JBE\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x77
-****************************************************************************/
-static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if carry flag is clear and if the zero
- flag is clear */
- START_OF_INSTR();
- DECODE_PRINTF("JNBE\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x78
-****************************************************************************/
-static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if sign flag is set */
- START_OF_INSTR();
- DECODE_PRINTF("JS\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_SF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x79
-****************************************************************************/
-static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if sign flag is clear */
- START_OF_INSTR();
- DECODE_PRINTF("JNS\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!ACCESS_FLAG(F_SF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7a
-****************************************************************************/
-static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if parity flag is set (even parity) */
- START_OF_INSTR();
- DECODE_PRINTF("JP\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_PF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7b
-****************************************************************************/
-static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
-
- /* jump to byte offset if parity flag is clear (odd parity) */
- START_OF_INSTR();
- DECODE_PRINTF("JNP\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (!ACCESS_FLAG(F_PF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7c
-****************************************************************************/
-static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
- int sf, of;
-
- /* jump to byte offset if sign flag not equal to overflow flag. */
- START_OF_INSTR();
- DECODE_PRINTF("JL\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- sf = ACCESS_FLAG(F_SF) != 0;
- of = ACCESS_FLAG(F_OF) != 0;
- if (sf ^ of)
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7d
-****************************************************************************/
-static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
- int sf, of;
-
- /* jump to byte offset if sign flag not equal to overflow flag. */
- START_OF_INSTR();
- DECODE_PRINTF("JNL\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- sf = ACCESS_FLAG(F_SF) != 0;
- of = ACCESS_FLAG(F_OF) != 0;
- /* note: inverse of above, but using == instead of xor. */
- if (sf == of)
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7e
-****************************************************************************/
-static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
- int sf, of;
-
- /* jump to byte offset if sign flag not equal to overflow flag
- or the zero flag is set */
- START_OF_INSTR();
- DECODE_PRINTF("JLE\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- sf = ACCESS_FLAG(F_SF) != 0;
- of = ACCESS_FLAG(F_OF) != 0;
- if ((sf ^ of) || ACCESS_FLAG(F_ZF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7f
-****************************************************************************/
-static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
-{
- s8 offset;
- u16 target;
- int sf, of;
-
- /* jump to byte offset if sign flag equal to overflow flag.
- and the zero flag is clear */
- START_OF_INSTR();
- DECODE_PRINTF("JNLE\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + (s16)offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- sf = ACCESS_FLAG(F_SF) != 0;
- of = ACCESS_FLAG(F_OF) != 0;
- if ((sf == of) && !ACCESS_FLAG(F_ZF))
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
-{
- add_byte, /* 00 */
- or_byte, /* 01 */
- adc_byte, /* 02 */
- sbb_byte, /* 03 */
- and_byte, /* 04 */
- sub_byte, /* 05 */
- xor_byte, /* 06 */
- cmp_byte, /* 07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x80
-****************************************************************************/
-static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 imm;
- u8 destval;
-
- /*
- * Weirdo special case instruction format. Part of the opcode
- * held below in "RH". Doubly nested case would result, except
- * that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- DECODE_PRINTF("ADD\t");
- break;
- case 1:
- DECODE_PRINTF("OR\t");
- break;
- case 2:
- DECODE_PRINTF("ADC\t");
- break;
- case 3:
- DECODE_PRINTF("SBB\t");
- break;
- case 4:
- DECODE_PRINTF("AND\t");
- break;
- case 5:
- DECODE_PRINTF("SUB\t");
- break;
- case 6:
- DECODE_PRINTF("XOR\t");
- break;
- case 7:
- DECODE_PRINTF("CMP\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc80_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc80_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc80_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc80_byte_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-static u16 (*opc81_word_operation[])(u16 d, u16 s) =
-{
- add_word, /*00 */
- or_word, /*01 */
- adc_word, /*02 */
- sbb_word, /*03 */
- and_word, /*04 */
- sub_word, /*05 */
- xor_word, /*06 */
- cmp_word, /*07 */
-};
-
-static u32 (*opc81_long_operation[])(u32 d, u32 s) =
-{
- add_long, /*00 */
- or_long, /*01 */
- adc_long, /*02 */
- sbb_long, /*03 */
- and_long, /*04 */
- sub_long, /*05 */
- xor_long, /*06 */
- cmp_long, /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x81
-****************************************************************************/
-static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- /*
- * Weirdo special case instruction format. Part of the opcode
- * held below in "RH". Doubly nested case would result, except
- * that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- DECODE_PRINTF("ADD\t");
- break;
- case 1:
- DECODE_PRINTF("OR\t");
- break;
- case 2:
- DECODE_PRINTF("ADC\t");
- break;
- case 3:
- DECODE_PRINTF("SBB\t");
- break;
- case 4:
- DECODE_PRINTF("AND\t");
- break;
- case 5:
- DECODE_PRINTF("SUB\t");
- break;
- case 6:
- DECODE_PRINTF("XOR\t");
- break;
- case 7:
- DECODE_PRINTF("CMP\t");
- break;
- }
- }
-#endif
- /*
- * Know operation, decode the mod byte to find the addressing
- * mode.
- */
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- imm = fetch_long_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 destval,imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- imm = fetch_long_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_long_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- } else {
- u16 *destreg;
- u16 destval,imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc81_word_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
-{
- add_byte, /*00 */
- or_byte, /*01 *//*YYY UNUSED ???? */
- adc_byte, /*02 */
- sbb_byte, /*03 */
- and_byte, /*04 *//*YYY UNUSED ???? */
- sub_byte, /*05 */
- xor_byte, /*06 *//*YYY UNUSED ???? */
- cmp_byte, /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x82
-****************************************************************************/
-static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 imm;
- u8 destval;
-
- /*
- * Weirdo special case instruction format. Part of the opcode
- * held below in "RH". Doubly nested case would result, except
- * that the decoded instruction Similar to opcode 81, except that
- * the immediate byte is sign extended to a word length.
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ADD\t");
- break;
- case 1:
- DECODE_PRINTF("OR\t");
- break;
- case 2:
- DECODE_PRINTF("ADC\t");
- break;
- case 3:
- DECODE_PRINTF("SBB\t");
- break;
- case 4:
- DECODE_PRINTF("AND\t");
- break;
- case 5:
- DECODE_PRINTF("SUB\t");
- break;
- case 6:
- DECODE_PRINTF("XOR\t");
- break;
- case 7:
- DECODE_PRINTF("CMP\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc82_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc82_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- destval = fetch_data_byte(destoffset);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc82_byte_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc82_byte_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-static u16 (*opc83_word_operation[])(u16 s, u16 d) =
-{
- add_word, /*00 */
- or_word, /*01 *//*YYY UNUSED ???? */
- adc_word, /*02 */
- sbb_word, /*03 */
- and_word, /*04 *//*YYY UNUSED ???? */
- sub_word, /*05 */
- xor_word, /*06 *//*YYY UNUSED ???? */
- cmp_word, /*07 */
-};
-
-static u32 (*opc83_long_operation[])(u32 s, u32 d) =
-{
- add_long, /*00 */
- or_long, /*01 *//*YYY UNUSED ???? */
- adc_long, /*02 */
- sbb_long, /*03 */
- and_long, /*04 *//*YYY UNUSED ???? */
- sub_long, /*05 */
- xor_long, /*06 *//*YYY UNUSED ???? */
- cmp_long, /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x83
-****************************************************************************/
-static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- /*
- * Weirdo special case instruction format. Part of the opcode
- * held below in "RH". Doubly nested case would result, except
- * that the decoded instruction Similar to opcode 81, except that
- * the immediate byte is sign extended to a word length.
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ADD\t");
- break;
- case 1:
- DECODE_PRINTF("OR\t");
- break;
- case 2:
- DECODE_PRINTF("ADC\t");
- break;
- case 3:
- DECODE_PRINTF("SBB\t");
- break;
- case 4:
- DECODE_PRINTF("AND\t");
- break;
- case 5:
- DECODE_PRINTF("SUB\t");
- break;
- case 6:
- DECODE_PRINTF("XOR\t");
- break;
- case 7:
- DECODE_PRINTF("CMP\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- destval = fetch_data_long(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- destval = fetch_data_word(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- destval = fetch_data_long(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- destval = fetch_data_word(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- destval = fetch_data_long(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_long_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_long(destoffset, destval);
- } else {
- u16 destval,imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm10_address(rl);
- destval = fetch_data_word(destoffset);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_word_operation[rh]) (destval, imm);
- if (rh != 7)
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 destval,imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_long_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- } else {
- u16 *destreg;
- u16 destval,imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- imm = (s8) fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- destval = (*opc83_word_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x84
-****************************************************************************/
-static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("TEST\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_byte(destval, *srcreg);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_byte(destval, *srcreg);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_byte(destval, *srcreg);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_byte(*destreg, *srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x85
-****************************************************************************/
-static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("TEST\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_word(destval, *srcreg);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_word(destval, *srcreg);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_long(destval, *srcreg);
- } else {
- u16 destval;
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_word(destval, *srcreg);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_long(*destreg, *srcreg);
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- test_word(*destreg, *srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x86
-****************************************************************************/
-static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
- u8 destval;
- u8 tmp;
-
- START_OF_INSTR();
- DECODE_PRINTF("XCHG\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_byte(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_byte(destoffset);
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = *destreg;
- *destreg = tmp;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x87
-****************************************************************************/
-static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("XCHG\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
- u32 destval,tmp;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_long(destoffset, destval);
- } else {
- u16 *srcreg;
- u16 destval,tmp;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
- u32 destval,tmp;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_long(destoffset, destval);
- } else {
- u16 *srcreg;
- u16 destval,tmp;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
- u32 destval,tmp;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_long(destoffset);
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_long(destoffset, destval);
- } else {
- u16 *srcreg;
- u16 destval,tmp;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- destval = fetch_data_word(destoffset);
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = destval;
- destval = tmp;
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
- u32 tmp;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = *destreg;
- *destreg = tmp;
- } else {
- u16 *destreg,*srcreg;
- u16 tmp;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- tmp = *srcreg;
- *srcreg = *destreg;
- *destreg = tmp;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x88
-****************************************************************************/
-static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_byte(destoffset, *srcreg);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_byte(destoffset, *srcreg);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_byte(destoffset, *srcreg);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x89
-****************************************************************************/
-static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u32 destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_long(destoffset, *srcreg);
- } else {
- u16 *srcreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_word(destoffset, *srcreg);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_long(destoffset, *srcreg);
- } else {
- u16 *srcreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_word(destoffset, *srcreg);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_long(destoffset, *srcreg);
- } else {
- u16 *srcreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- store_data_word(destoffset, *srcreg);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- } else {
- u16 *destreg,*srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8a
-****************************************************************************/
-static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg, *srcreg;
- uint srcoffset;
- u8 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 1:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 2:
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8b
-****************************************************************************/
-static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg, *srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- } else {
- u16 *destreg, *srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8c
-****************************************************************************/
-static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u16 *destreg, *srcreg;
- uint destoffset;
- u16 destval;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcreg = decode_rm_seg_register(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = *srcreg;
- store_data_word(destoffset, destval);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcreg = decode_rm_seg_register(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = *srcreg;
- store_data_word(destoffset, destval);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcreg = decode_rm_seg_register(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = *srcreg;
- store_data_word(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcreg = decode_rm_seg_register(rh);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8d
-****************************************************************************/
-static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u16 *srcreg;
- uint destoffset;
-
-/*
- * TODO: Need to handle address size prefix!
- *
- * lea eax,[eax+ebx*2] ??
- */
-
- START_OF_INSTR();
- DECODE_PRINTF("LEA\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *srcreg = (u16)destoffset;
- break;
- case 1:
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *srcreg = (u16)destoffset;
- break;
- case 2:
- srcreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *srcreg = (u16)destoffset;
- break;
- case 3: /* register to register */
- /* undefined. Do nothing. */
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8e
-****************************************************************************/
-static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u16 *destreg, *srcreg;
- uint srcoffset;
- u16 srcval;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = decode_rm_seg_register(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 1:
- destreg = decode_rm_seg_register(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 2:
- destreg = decode_rm_seg_register(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 3: /* register to register */
- destreg = decode_rm_seg_register(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- break;
- }
- /*
- * Clean up, and reset all the R_xSP pointers to the correct
- * locations. This is about 3x too much overhead (doing all the
- * segreg ptrs when only one is needed, but this instruction
- * *cannot* be that common, and this isn't too much work anyway.
- */
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8f
-****************************************************************************/
-static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("POP\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- if (rh != 0) {
- DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
- HALT_SYS();
- }
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_long();
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_word();
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_long();
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_word();
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_long();
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- destval = pop_word();
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = pop_long();
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = pop_word();
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x90
-****************************************************************************/
-static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("NOP\n");
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x91
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,ECX\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,CX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_ECX;
- M.x86.R_ECX = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_CX;
- M.x86.R_CX = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x92
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,EDX\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,DX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_EDX;
- M.x86.R_EDX = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_DX;
- M.x86.R_DX = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x93
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,EBX\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,BX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_EBX;
- M.x86.R_EBX = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_BX;
- M.x86.R_BX = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x94
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,ESP\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,SP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_ESP;
- M.x86.R_ESP = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_SP;
- M.x86.R_SP = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x95
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,EBP\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,BP\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_EBP;
- M.x86.R_EBP = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_BP;
- M.x86.R_BP = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x96
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,ESI\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,SI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_ESI;
- M.x86.R_ESI = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_SI;
- M.x86.R_SI = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x97
-****************************************************************************/
-static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
-{
- u32 tmp;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("XCHG\tEAX,EDI\n");
- } else {
- DECODE_PRINTF("XCHG\tAX,DI\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- tmp = M.x86.R_EAX;
- M.x86.R_EAX = M.x86.R_EDI;
- M.x86.R_EDI = tmp;
- } else {
- tmp = M.x86.R_AX;
- M.x86.R_AX = M.x86.R_DI;
- M.x86.R_DI = (u16)tmp;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x98
-****************************************************************************/
-static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("CWDE\n");
- } else {
- DECODE_PRINTF("CBW\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- if (M.x86.R_AX & 0x8000) {
- M.x86.R_EAX |= 0xffff0000;
- } else {
- M.x86.R_EAX &= 0x0000ffff;
- }
- } else {
- if (M.x86.R_AL & 0x80) {
- M.x86.R_AH = 0xff;
- } else {
- M.x86.R_AH = 0x0;
- }
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x99
-****************************************************************************/
-static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("CDQ\n");
- } else {
- DECODE_PRINTF("CWD\n");
- }
- DECODE_PRINTF("CWD\n");
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- if (M.x86.R_EAX & 0x80000000) {
- M.x86.R_EDX = 0xffffffff;
- } else {
- M.x86.R_EDX = 0x0;
- }
- } else {
- if (M.x86.R_AX & 0x8000) {
- M.x86.R_DX = 0xffff;
- } else {
- M.x86.R_DX = 0x0;
- }
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9a
-****************************************************************************/
-static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 farseg, faroff;
-
- START_OF_INSTR();
- DECODE_PRINTF("CALL\t");
- faroff = fetch_word_imm();
- farseg = fetch_word_imm();
- DECODE_PRINTF2("%04x:", farseg);
- DECODE_PRINTF2("%04x\n", faroff);
- CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
-
- /* XXX
- *
- * Hooked interrupt vectors calling into our "BIOS" will cause
- * problems unless all intersegment stuff is checked for BIOS
- * access. Check needed here. For moment, let it alone.
- */
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = farseg;
- push_word(M.x86.R_IP);
- M.x86.R_IP = faroff;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9b
-****************************************************************************/
-static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("WAIT");
- TRACE_AND_STEP();
- /* NADA. */
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9c
-****************************************************************************/
-static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
-{
- u32 flags;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("PUSHFD\n");
- } else {
- DECODE_PRINTF("PUSHF\n");
- }
- TRACE_AND_STEP();
-
- /* clear out *all* bits not representing flags, and turn on real bits */
- flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- push_long(flags);
- } else {
- push_word((u16)flags);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9d
-****************************************************************************/
-static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("POPFD\n");
- } else {
- DECODE_PRINTF("POPF\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EFLG = pop_long();
- } else {
- M.x86.R_FLG = pop_word();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9e
-****************************************************************************/
-static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("SAHF\n");
- TRACE_AND_STEP();
- /* clear the lower bits of the flag register */
- M.x86.R_FLG &= 0xffffff00;
- /* or in the AH register into the flags register */
- M.x86.R_FLG |= M.x86.R_AH;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9f
-****************************************************************************/
-static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("LAHF\n");
- TRACE_AND_STEP();
- M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
- /*undocumented TC++ behavior??? Nope. It's documented, but
- you have too look real hard to notice it. */
- M.x86.R_AH |= 0x2;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa0
-****************************************************************************/
-static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 offset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tAL,");
- offset = fetch_word_imm();
- DECODE_PRINTF2("[%04x]\n", offset);
- TRACE_AND_STEP();
- M.x86.R_AL = fetch_data_byte(offset);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa1
-****************************************************************************/
-static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 offset;
-
- START_OF_INSTR();
- offset = fetch_word_imm();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
- } else {
- DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = fetch_data_long(offset);
- } else {
- M.x86.R_AX = fetch_data_word(offset);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa2
-****************************************************************************/
-static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 offset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- offset = fetch_word_imm();
- DECODE_PRINTF2("[%04x],AL\n", offset);
- TRACE_AND_STEP();
- store_data_byte(offset, M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa3
-****************************************************************************/
-static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 offset;
-
- START_OF_INSTR();
- offset = fetch_word_imm();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
- } else {
- DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- store_data_long(offset, M.x86.R_EAX);
- } else {
- store_data_word(offset, M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa4
-****************************************************************************/
-static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
-{
- u8 val;
- u32 count;
- int inc;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOVS\tBYTE\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -1;
- else
- inc = 1;
- TRACE_AND_STEP();
- count = 1;
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- count = M.x86.R_CX;
- M.x86.R_CX = 0;
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- }
- while (count--) {
- val = fetch_data_byte(M.x86.R_SI);
- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val);
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa5
-****************************************************************************/
-static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
-{
- u32 val;
- int inc;
- u32 count;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOVS\tDWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -4;
- else
- inc = 4;
- } else {
- DECODE_PRINTF("MOVS\tWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -2;
- else
- inc = 2;
- }
- TRACE_AND_STEP();
- count = 1;
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- count = M.x86.R_CX;
- M.x86.R_CX = 0;
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- }
- while (count--) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val = fetch_data_long(M.x86.R_SI);
- store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
- } else {
- val = fetch_data_word(M.x86.R_SI);
- store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
- }
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa6
-****************************************************************************/
-static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
-{
- s8 val1, val2;
- int inc;
-
- START_OF_INSTR();
- DECODE_PRINTF("CMPS\tBYTE\n");
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -1;
- else
- inc = 1;
-
- if (M.x86.mode & SYSMODE_PREFIX_REPE) {
- /* REPE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- val1 = fetch_data_byte(M.x86.R_SI);
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(val1, val2);
- M.x86.R_CX -= 1;
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF) == 0)
- break;
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPE;
- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
- /* REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- val1 = fetch_data_byte(M.x86.R_SI);
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(val1, val2);
- M.x86.R_CX -= 1;
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF))
- break; /* zero flag set means equal */
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
- } else {
- val1 = fetch_data_byte(M.x86.R_SI);
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(val1, val2);
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa7
-****************************************************************************/
-static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
-{
- u32 val1,val2;
- int inc;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("CMPS\tDWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -4;
- else
- inc = 4;
- } else {
- DECODE_PRINTF("CMPS\tWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -2;
- else
- inc = 2;
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_REPE) {
- /* REPE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val1 = fetch_data_long(M.x86.R_SI);
- val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(val1, val2);
- } else {
- val1 = fetch_data_word(M.x86.R_SI);
- val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word((u16)val1, (u16)val2);
- }
- M.x86.R_CX -= 1;
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF) == 0)
- break;
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPE;
- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
- /* REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val1 = fetch_data_long(M.x86.R_SI);
- val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(val1, val2);
- } else {
- val1 = fetch_data_word(M.x86.R_SI);
- val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word((u16)val1, (u16)val2);
- }
- M.x86.R_CX -= 1;
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF))
- break; /* zero flag set means equal */
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
- } else {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val1 = fetch_data_long(M.x86.R_SI);
- val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(val1, val2);
- } else {
- val1 = fetch_data_word(M.x86.R_SI);
- val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word((u16)val1, (u16)val2);
- }
- M.x86.R_SI += inc;
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa8
-****************************************************************************/
-static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- int imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("TEST\tAL,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%04x\n", imm);
- TRACE_AND_STEP();
- test_byte(M.x86.R_AL, (u8)imm);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa9
-****************************************************************************/
-static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("TEST\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("TEST\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- test_long(M.x86.R_EAX, srcval);
- } else {
- test_word(M.x86.R_AX, (u16)srcval);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xaa
-****************************************************************************/
-static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
-{
- int inc;
-
- START_OF_INSTR();
- DECODE_PRINTF("STOS\tBYTE\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -1;
- else
- inc = 1;
- TRACE_AND_STEP();
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
- M.x86.R_CX -= 1;
- M.x86.R_DI += inc;
- }
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- } else {
- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xab
-****************************************************************************/
-static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
-{
- int inc;
- u32 count;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("STOS\tDWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -4;
- else
- inc = 4;
- } else {
- DECODE_PRINTF("STOS\tWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -2;
- else
- inc = 2;
- }
- TRACE_AND_STEP();
- count = 1;
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- count = M.x86.R_CX;
- M.x86.R_CX = 0;
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- }
- while (count--) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
- } else {
- store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
- }
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xac
-****************************************************************************/
-static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
-{
- int inc;
-
- START_OF_INSTR();
- DECODE_PRINTF("LODS\tBYTE\n");
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -1;
- else
- inc = 1;
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
- M.x86.R_CX -= 1;
- M.x86.R_SI += inc;
- }
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- } else {
- M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
- M.x86.R_SI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xad
-****************************************************************************/
-static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
-{
- int inc;
- u32 count;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("LODS\tDWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -4;
- else
- inc = 4;
- } else {
- DECODE_PRINTF("LODS\tWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -2;
- else
- inc = 2;
- }
- TRACE_AND_STEP();
- count = 1;
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* move them until CX is ZERO. */
- count = M.x86.R_CX;
- M.x86.R_CX = 0;
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- }
- while (count--) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
- } else {
- M.x86.R_AX = fetch_data_word(M.x86.R_SI);
- }
- M.x86.R_SI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xae
-****************************************************************************/
-static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
-{
- s8 val2;
- int inc;
-
- START_OF_INSTR();
- DECODE_PRINTF("SCAS\tBYTE\n");
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -1;
- else
- inc = 1;
- if (M.x86.mode & SYSMODE_PREFIX_REPE) {
- /* REPE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(M.x86.R_AL, val2);
- M.x86.R_CX -= 1;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF) == 0)
- break;
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPE;
- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
- /* REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(M.x86.R_AL, val2);
- M.x86.R_CX -= 1;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF))
- break; /* zero flag set means equal */
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
- } else {
- val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_byte(M.x86.R_AL, val2);
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xaf
-****************************************************************************/
-static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
-{
- int inc;
- u32 val;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("SCAS\tDWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -4;
- else
- inc = 4;
- } else {
- DECODE_PRINTF("SCAS\tWORD\n");
- if (ACCESS_FLAG(F_DF)) /* down */
- inc = -2;
- else
- inc = 2;
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_REPE) {
- /* REPE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(M.x86.R_EAX, val);
- } else {
- val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word(M.x86.R_AX, (u16)val);
- }
- M.x86.R_CX -= 1;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF) == 0)
- break;
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPE;
- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
- /* REPNE */
- /* move them until CX is ZERO. */
- while (M.x86.R_CX != 0) {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(M.x86.R_EAX, val);
- } else {
- val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word(M.x86.R_AX, (u16)val);
- }
- M.x86.R_CX -= 1;
- M.x86.R_DI += inc;
- if (ACCESS_FLAG(F_ZF))
- break; /* zero flag set means equal */
- }
- M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
- } else {
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_long(M.x86.R_EAX, val);
- } else {
- val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
- cmp_word(M.x86.R_AX, (u16)val);
- }
- M.x86.R_DI += inc;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb0
-****************************************************************************/
-static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tAL,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_AL = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb1
-****************************************************************************/
-static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tCL,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_CL = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb2
-****************************************************************************/
-static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tDL,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_DL = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb3
-****************************************************************************/
-static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tBL,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_BL = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb4
-****************************************************************************/
-static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tAH,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_AH = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb5
-****************************************************************************/
-static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tCH,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_CH = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb6
-****************************************************************************/
-static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tDH,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_DH = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb7
-****************************************************************************/
-static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\tBH,");
- imm = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", imm);
- TRACE_AND_STEP();
- M.x86.R_BH = imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb8
-****************************************************************************/
-static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tEAX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tAX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = srcval;
- } else {
- M.x86.R_AX = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb9
-****************************************************************************/
-static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tECX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tCX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = srcval;
- } else {
- M.x86.R_CX = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xba
-****************************************************************************/
-static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tEDX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tDX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDX = srcval;
- } else {
- M.x86.R_DX = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbb
-****************************************************************************/
-static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tEBX,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tBX,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBX = srcval;
- } else {
- M.x86.R_BX = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbc
-****************************************************************************/
-static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tESP,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tSP,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESP = srcval;
- } else {
- M.x86.R_SP = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbd
-****************************************************************************/
-static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tEBP,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tBP,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EBP = srcval;
- } else {
- M.x86.R_BP = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbe
-****************************************************************************/
-static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tESI,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tSI,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ESI = srcval;
- } else {
- M.x86.R_SI = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbf
-****************************************************************************/
-static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
-{
- u32 srcval;
-
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("MOV\tEDI,");
- srcval = fetch_long_imm();
- } else {
- DECODE_PRINTF("MOV\tDI,");
- srcval = fetch_word_imm();
- }
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EDI = srcval;
- } else {
- M.x86.R_DI = (u16)srcval;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/* used by opcodes c0, d0, and d2. */
-static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
-{
- rol_byte,
- ror_byte,
- rcl_byte,
- rcr_byte,
- shl_byte,
- shr_byte,
- shl_byte, /* sal_byte === shl_byte by definition */
- sar_byte,
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc0
-****************************************************************************/
-static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 destval;
- u8 amt;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
- *destreg = destval;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/* used by opcodes c1, d1, and d3. */
-static u16(*opcD1_word_operation[])(u16 s, u8 d) =
-{
- rol_word,
- ror_word,
- rcl_word,
- rcr_word,
- shl_word,
- shr_word,
- shl_word, /* sal_byte === shl_byte by definition */
- sar_word,
-};
-
-/* used by opcodes c1, d1, and d3. */
-static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
-{
- rol_long,
- ror_long,
- rcl_long,
- rcr_long,
- shl_long,
- shr_long,
- shl_long, /* sal_byte === shl_byte by definition */
- sar_long,
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc1
-****************************************************************************/
-static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 amt;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm10_address(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- TRACE_AND_STEP();
- *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- amt = fetch_byte_imm();
- DECODE_PRINTF2(",%x\n", amt);
- TRACE_AND_STEP();
- *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc2
-****************************************************************************/
-static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("RET\t");
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
- TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_SP += imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc3
-****************************************************************************/
-static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("RET\n");
- RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
- TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc4
-****************************************************************************/
-static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rh, rl;
- u16 *dstreg;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("LES\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_ES = fetch_data_word(srcoffset + 2);
- break;
- case 1:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_ES = fetch_data_word(srcoffset + 2);
- break;
- case 2:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_ES = fetch_data_word(srcoffset + 2);
- break;
- case 3: /* register to register */
- /* UNDEFINED! */
- TRACE_AND_STEP();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc5
-****************************************************************************/
-static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rh, rl;
- u16 *dstreg;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("LDS\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_DS = fetch_data_word(srcoffset + 2);
- break;
- case 1:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_DS = fetch_data_word(srcoffset + 2);
- break;
- case 2:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_DS = fetch_data_word(srcoffset + 2);
- break;
- case 3: /* register to register */
- /* UNDEFINED! */
- TRACE_AND_STEP();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc6
-****************************************************************************/
-static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- if (rh != 0) {
- DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n");
- HALT_SYS();
- }
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%2x\n", imm);
- TRACE_AND_STEP();
- store_data_byte(destoffset, imm);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%2x\n", imm);
- TRACE_AND_STEP();
- store_data_byte(destoffset, imm);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%2x\n", imm);
- TRACE_AND_STEP();
- store_data_byte(destoffset, imm);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- imm = fetch_byte_imm();
- DECODE_PRINTF2(",%2x\n", imm);
- TRACE_AND_STEP();
- *destreg = imm;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc7
-****************************************************************************/
-static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOV\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- if (rh != 0) {
- DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
- HALT_SYS();
- }
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_long(destoffset, imm);
- } else {
- u16 imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_word(destoffset, imm);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_long(destoffset, imm);
- } else {
- u16 imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_word(destoffset, imm);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 imm;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_long(destoffset, imm);
- } else {
- u16 imm;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm10_address(rl);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- store_data_word(destoffset, imm);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 imm;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- imm = fetch_long_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- *destreg = imm;
- } else {
- u16 *destreg;
- u16 imm;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- imm = fetch_word_imm();
- DECODE_PRINTF2(",%x\n", imm);
- TRACE_AND_STEP();
- *destreg = imm;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc8
-****************************************************************************/
-static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
-{
- u16 local,frame_pointer;
- u8 nesting;
- int i;
-
- START_OF_INSTR();
- local = fetch_word_imm();
- nesting = fetch_byte_imm();
- DECODE_PRINTF2("ENTER %x\n", local);
- DECODE_PRINTF2(",%x\n", nesting);
- TRACE_AND_STEP();
- push_word(M.x86.R_BP);
- frame_pointer = M.x86.R_SP;
- if (nesting > 0) {
- for (i = 1; i < nesting; i++) {
- M.x86.R_BP -= 2;
- push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
- }
- push_word(frame_pointer);
- }
- M.x86.R_BP = frame_pointer;
- M.x86.R_SP = (u16)(M.x86.R_SP - local);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc9
-****************************************************************************/
-static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("LEAVE\n");
- TRACE_AND_STEP();
- M.x86.R_SP = M.x86.R_BP;
- M.x86.R_BP = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xca
-****************************************************************************/
-static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 imm;
-
- START_OF_INSTR();
- DECODE_PRINTF("RETF\t");
- imm = fetch_word_imm();
- DECODE_PRINTF2("%x\n", imm);
- RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
- TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
- M.x86.R_SP += imm;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcb
-****************************************************************************/
-static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("RETF\n");
- RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
- TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcc
-****************************************************************************/
-static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("INT 3\n");
- TRACE_AND_STEP();
- if (_X86EMU_intrTab[3]) {
- (*_X86EMU_intrTab[3])(3);
- } else {
- push_word((u16)M.x86.R_FLG);
- CLEAR_FLAG(F_IF);
- CLEAR_FLAG(F_TF);
- push_word(M.x86.R_CS);
- M.x86.R_CS = mem_access_word(3 * 4 + 2);
- push_word(M.x86.R_IP);
- M.x86.R_IP = mem_access_word(3 * 4);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcd
-****************************************************************************/
-static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 intnum;
-
- START_OF_INSTR();
- DECODE_PRINTF("INT\t");
- intnum = fetch_byte_imm();
- DECODE_PRINTF2("%x\n", intnum);
- TRACE_AND_STEP();
- if (_X86EMU_intrTab[intnum]) {
- (*_X86EMU_intrTab[intnum])(intnum);
- } else {
- push_word((u16)M.x86.R_FLG);
- CLEAR_FLAG(F_IF);
- CLEAR_FLAG(F_TF);
- push_word(M.x86.R_CS);
- M.x86.R_CS = mem_access_word(intnum * 4 + 2);
- push_word(M.x86.R_IP);
- M.x86.R_IP = mem_access_word(intnum * 4);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xce
-****************************************************************************/
-static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("INTO\n");
- TRACE_AND_STEP();
- if (ACCESS_FLAG(F_OF)) {
- if (_X86EMU_intrTab[4]) {
- (*_X86EMU_intrTab[4])(4);
- } else {
- push_word((u16)M.x86.R_FLG);
- CLEAR_FLAG(F_IF);
- CLEAR_FLAG(F_TF);
- push_word(M.x86.R_CS);
- M.x86.R_CS = mem_access_word(4 * 4 + 2);
- push_word(M.x86.R_IP);
- M.x86.R_IP = mem_access_word(4 * 4);
- }
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcf
-****************************************************************************/
-static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("IRET\n");
-
- TRACE_AND_STEP();
-
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
- M.x86.R_FLG = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd0
-****************************************************************************/
-static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 destval;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, 1);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, 1);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, 1);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",1\n");
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (*destreg, 1);
- *destreg = destval;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd1
-****************************************************************************/
-static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, 1);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, 1);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, 1);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, 1);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, 1);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",1\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, 1);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",1\n");
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (*destreg, 1);
- *destreg = destval;
- } else {
- u16 destval;
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",1\n");
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (*destreg, 1);
- *destreg = destval;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd2
-****************************************************************************/
-static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 destval;
- u8 amt;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- amt = M.x86.R_CL;
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (destval, amt);
- store_data_byte(destoffset, destval);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
- *destreg = destval;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd3
-****************************************************************************/
-static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 amt;
-
- /*
- * Yet another weirdo special case instruction format. Part of
- * the opcode held below in "RH". Doubly nested case would
- * result, except that the decoded instruction
- */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
- switch (rh) {
- case 0:
- DECODE_PRINTF("ROL\t");
- break;
- case 1:
- DECODE_PRINTF("ROR\t");
- break;
- case 2:
- DECODE_PRINTF("RCL\t");
- break;
- case 3:
- DECODE_PRINTF("RCR\t");
- break;
- case 4:
- DECODE_PRINTF("SHL\t");
- break;
- case 5:
- DECODE_PRINTF("SHR\t");
- break;
- case 6:
- DECODE_PRINTF("SAL\t");
- break;
- case 7:
- DECODE_PRINTF("SAR\t");
- break;
- }
- }
-#endif
- /* know operation, decode the mod byte to find the addressing
- mode. */
- amt = M.x86.R_CL;
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_long_operation[rh]) (destval, amt);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("WORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",CL\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = (*opcD1_word_operation[rh]) (destval, amt);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd4
-****************************************************************************/
-static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
-{
- u8 a;
-
- START_OF_INSTR();
- DECODE_PRINTF("AAM\n");
- a = fetch_byte_imm(); /* this is a stupid encoding. */
- if (a != 10) {
- DECODE_PRINTF("ERROR DECODING AAM\n");
- TRACE_REGS();
- HALT_SYS();
- }
- TRACE_AND_STEP();
- /* note the type change here --- returning AL and AH in AX. */
- M.x86.R_AX = aam_word(M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd5
-****************************************************************************/
-static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("AAD\n");
- (void) fetch_byte_imm();
- TRACE_AND_STEP();
- M.x86.R_AX = aad_word(M.x86.R_AX);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/* opcode 0xd6 ILLEGAL OPCODE */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd7
-****************************************************************************/
-static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
-{
- u16 addr;
-
- START_OF_INSTR();
- DECODE_PRINTF("XLAT\n");
- TRACE_AND_STEP();
- addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
- M.x86.R_AL = fetch_data_byte(addr);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/* instuctions D8 .. DF are in i87_ops.c */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe0
-****************************************************************************/
-static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
-{
- s16 ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("LOOPNE\t");
- ip = (s8) fetch_byte_imm();
- ip += (s16) M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", ip);
- TRACE_AND_STEP();
- M.x86.R_CX -= 1;
- if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */
- M.x86.R_IP = ip;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe1
-****************************************************************************/
-static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
-{
- s16 ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("LOOPE\t");
- ip = (s8) fetch_byte_imm();
- ip += (s16) M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", ip);
- TRACE_AND_STEP();
- M.x86.R_CX -= 1;
- if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */
- M.x86.R_IP = ip;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe2
-****************************************************************************/
-static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
-{
- s16 ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("LOOP\t");
- ip = (s8) fetch_byte_imm();
- ip += (s16) M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", ip);
- TRACE_AND_STEP();
- M.x86.R_CX -= 1;
- if (M.x86.R_CX != 0)
- M.x86.R_IP = ip;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe3
-****************************************************************************/
-static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
-{
- u16 target;
- s8 offset;
-
- /* jump to byte offset if overflow flag is set */
- START_OF_INSTR();
- DECODE_PRINTF("JCXZ\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- if (M.x86.R_CX == 0)
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe4
-****************************************************************************/
-static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 port;
-
- START_OF_INSTR();
- DECODE_PRINTF("IN\t");
- port = (u8) fetch_byte_imm();
- DECODE_PRINTF2("%x,AL\n", port);
- TRACE_AND_STEP();
- M.x86.R_AL = (*sys_inb)(port);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe5
-****************************************************************************/
-static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
- u8 port;
-
- START_OF_INSTR();
- DECODE_PRINTF("IN\t");
- port = (u8) fetch_byte_imm();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF2("EAX,%x\n", port);
- } else {
- DECODE_PRINTF2("AX,%x\n", port);
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = (*sys_inl)(port);
- } else {
- M.x86.R_AX = (*sys_inw)(port);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe6
-****************************************************************************/
-static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
-{
- u8 port;
-
- START_OF_INSTR();
- DECODE_PRINTF("OUT\t");
- port = (u8) fetch_byte_imm();
- DECODE_PRINTF2("%x,AL\n", port);
- TRACE_AND_STEP();
- (*sys_outb)(port, M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe7
-****************************************************************************/
-static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
-{
- u8 port;
-
- START_OF_INSTR();
- DECODE_PRINTF("OUT\t");
- port = (u8) fetch_byte_imm();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF2("%x,EAX\n", port);
- } else {
- DECODE_PRINTF2("%x,AX\n", port);
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- (*sys_outl)(port, M.x86.R_EAX);
- } else {
- (*sys_outw)(port, M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe8
-****************************************************************************/
-static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
-{
- s16 ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("CALL\t");
- ip = (s16) fetch_word_imm();
- ip += (s16) M.x86.R_IP; /* CHECK SIGN */
- DECODE_PRINTF2("%04x\n", (u16)ip);
- CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = ip;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe9
-****************************************************************************/
-static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
-{
- int ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("JMP\t");
- ip = (s16)fetch_word_imm();
- ip += (s16)M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", (u16)ip);
- TRACE_AND_STEP();
- M.x86.R_IP = (u16)ip;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xea
-****************************************************************************/
-static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 cs, ip;
-
- START_OF_INSTR();
- DECODE_PRINTF("JMP\tFAR ");
- ip = fetch_word_imm();
- cs = fetch_word_imm();
- DECODE_PRINTF2("%04x:", cs);
- DECODE_PRINTF2("%04x\n", ip);
- TRACE_AND_STEP();
- M.x86.R_IP = ip;
- M.x86.R_CS = cs;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xeb
-****************************************************************************/
-static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
- u16 target;
- s8 offset;
-
- START_OF_INSTR();
- DECODE_PRINTF("JMP\t");
- offset = (s8)fetch_byte_imm();
- target = (u16)(M.x86.R_IP + offset);
- DECODE_PRINTF2("%x\n", target);
- TRACE_AND_STEP();
- M.x86.R_IP = target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xec
-****************************************************************************/
-static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("IN\tAL,DX\n");
- TRACE_AND_STEP();
- M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xed
-****************************************************************************/
-static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("IN\tEAX,DX\n");
- } else {
- DECODE_PRINTF("IN\tAX,DX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
- } else {
- M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xee
-****************************************************************************/
-static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("OUT\tDX,AL\n");
- TRACE_AND_STEP();
- (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xef
-****************************************************************************/
-static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("OUT\tDX,EAX\n");
- } else {
- DECODE_PRINTF("OUT\tDX,AX\n");
- }
- TRACE_AND_STEP();
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
- } else {
- (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf0
-****************************************************************************/
-static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("LOCK:\n");
- TRACE_AND_STEP();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/*opcode 0xf1 ILLEGAL OPERATION */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf2
-****************************************************************************/
-static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("REPNE\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_PREFIX_REPNE;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf3
-****************************************************************************/
-static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("REPE\n");
- TRACE_AND_STEP();
- M.x86.mode |= SYSMODE_PREFIX_REPE;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf4
-****************************************************************************/
-static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
-{
- START_OF_INSTR();
- DECODE_PRINTF("HALT\n");
- TRACE_AND_STEP();
- HALT_SYS();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf5
-****************************************************************************/
-static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
-{
- /* complement the carry flag. */
- START_OF_INSTR();
- DECODE_PRINTF("CMC\n");
- TRACE_AND_STEP();
- TOGGLE_FLAG(F_CF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf6
-****************************************************************************/
-static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- u8 *destreg;
- uint destoffset;
- u8 destval, srcval;
-
- /* long, drawn out code follows. Double switch for a total
- of 32 cases. */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0: /* mod=00 */
- switch (rh) {
- case 0: /* test byte imm */
- DECODE_PRINTF("TEST\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%02x\n", srcval);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- test_byte(destval, srcval);
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- DECODE_PRINTF("NOT\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = not_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 3:
- DECODE_PRINTF("NEG\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = neg_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 4:
- DECODE_PRINTF("MUL\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- mul_byte(destval);
- break;
- case 5:
- DECODE_PRINTF("IMUL\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- imul_byte(destval);
- break;
- case 6:
- DECODE_PRINTF("DIV\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- div_byte(destval);
- break;
- case 7:
- DECODE_PRINTF("IDIV\tBYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- idiv_byte(destval);
- break;
- }
- break; /* end mod==00 */
- case 1: /* mod=01 */
- switch (rh) {
- case 0: /* test byte imm */
- DECODE_PRINTF("TEST\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%02x\n", srcval);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- test_byte(destval, srcval);
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- DECODE_PRINTF("NOT\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = not_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 3:
- DECODE_PRINTF("NEG\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = neg_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 4:
- DECODE_PRINTF("MUL\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- mul_byte(destval);
- break;
- case 5:
- DECODE_PRINTF("IMUL\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- imul_byte(destval);
- break;
- case 6:
- DECODE_PRINTF("DIV\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- div_byte(destval);
- break;
- case 7:
- DECODE_PRINTF("IDIV\tBYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- idiv_byte(destval);
- break;
- }
- break; /* end mod==01 */
- case 2: /* mod=10 */
- switch (rh) {
- case 0: /* test byte imm */
- DECODE_PRINTF("TEST\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%02x\n", srcval);
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- test_byte(destval, srcval);
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- DECODE_PRINTF("NOT\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = not_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 3:
- DECODE_PRINTF("NEG\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = neg_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 4:
- DECODE_PRINTF("MUL\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- mul_byte(destval);
- break;
- case 5:
- DECODE_PRINTF("IMUL\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- imul_byte(destval);
- break;
- case 6:
- DECODE_PRINTF("DIV\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- div_byte(destval);
- break;
- case 7:
- DECODE_PRINTF("IDIV\tBYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- idiv_byte(destval);
- break;
- }
- break; /* end mod==10 */
- case 3: /* mod=11 */
- switch (rh) {
- case 0: /* test byte imm */
- DECODE_PRINTF("TEST\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF(",");
- srcval = fetch_byte_imm();
- DECODE_PRINTF2("%02x\n", srcval);
- TRACE_AND_STEP();
- test_byte(*destreg, srcval);
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- DECODE_PRINTF("NOT\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = not_byte(*destreg);
- break;
- case 3:
- DECODE_PRINTF("NEG\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = neg_byte(*destreg);
- break;
- case 4:
- DECODE_PRINTF("MUL\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- mul_byte(*destreg); /*!!! */
- break;
- case 5:
- DECODE_PRINTF("IMUL\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- imul_byte(*destreg);
- break;
- case 6:
- DECODE_PRINTF("DIV\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- div_byte(*destreg);
- break;
- case 7:
- DECODE_PRINTF("IDIV\t");
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- idiv_byte(*destreg);
- break;
- }
- break; /* end mod==11 */
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf7
-****************************************************************************/
-static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rl, rh;
- uint destoffset;
-
- /* long, drawn out code follows. Double switch for a total
- of 32 cases. */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0: /* mod=00 */
- switch (rh) {
- case 0: /* test word imm */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,srcval;
-
- DECODE_PRINTF("TEST\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_long_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- test_long(destval, srcval);
- } else {
- u16 destval,srcval;
-
- DECODE_PRINTF("TEST\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_word_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- test_word(destval, srcval);
- }
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
- HALT_SYS();
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NOT\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = not_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NOT\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = not_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 3:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NEG\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = neg_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NEG\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = neg_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 4:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("MUL\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- mul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("MUL\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- mul_word(destval);
- }
- break;
- case 5:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IMUL\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- imul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IMUL\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- imul_word(destval);
- }
- break;
- case 6:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DIV\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- div_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("DIV\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- div_word(destval);
- }
- break;
- case 7:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IDIV\tDWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- idiv_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IDIV\tWORD PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- idiv_word(destval);
- }
- break;
- }
- break; /* end mod==00 */
- case 1: /* mod=01 */
- switch (rh) {
- case 0: /* test word imm */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,srcval;
-
- DECODE_PRINTF("TEST\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_long_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- test_long(destval, srcval);
- } else {
- u16 destval,srcval;
-
- DECODE_PRINTF("TEST\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_word_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- test_word(destval, srcval);
- }
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NOT\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = not_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NOT\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = not_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 3:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NEG\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = neg_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NEG\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = neg_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 4:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("MUL\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- mul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("MUL\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- mul_word(destval);
- }
- break;
- case 5:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IMUL\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- imul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IMUL\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- imul_word(destval);
- }
- break;
- case 6:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DIV\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- div_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("DIV\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- div_word(destval);
- }
- break;
- case 7:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IDIV\tDWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- idiv_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IDIV\tWORD PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- idiv_word(destval);
- }
- break;
- }
- break; /* end mod==01 */
- case 2: /* mod=10 */
- switch (rh) {
- case 0: /* test word imm */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval,srcval;
-
- DECODE_PRINTF("TEST\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_long_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- test_long(destval, srcval);
- } else {
- u16 destval,srcval;
-
- DECODE_PRINTF("TEST\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- srcval = fetch_word_imm();
- DECODE_PRINTF2("%x\n", srcval);
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- test_word(destval, srcval);
- }
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NOT\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = not_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NOT\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = not_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 3:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("NEG\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = neg_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("NEG\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = neg_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 4:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("MUL\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- mul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("MUL\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- mul_word(destval);
- }
- break;
- case 5:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IMUL\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- imul_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IMUL\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- imul_word(destval);
- }
- break;
- case 6:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("DIV\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- div_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("DIV\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- div_word(destval);
- }
- break;
- case 7:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- DECODE_PRINTF("IDIV\tDWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- idiv_long(destval);
- } else {
- u16 destval;
-
- DECODE_PRINTF("IDIV\tWORD PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- idiv_word(destval);
- }
- break;
- }
- break; /* end mod==10 */
- case 3: /* mod=11 */
- switch (rh) {
- case 0: /* test word imm */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- DECODE_PRINTF("TEST\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- srcval = fetch_long_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- test_long(*destreg, srcval);
- } else {
- u16 *destreg;
- u16 srcval;
-
- DECODE_PRINTF("TEST\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- srcval = fetch_word_imm();
- DECODE_PRINTF2("%x\n", srcval);
- TRACE_AND_STEP();
- test_word(*destreg, srcval);
- }
- break;
- case 1:
- DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
- HALT_SYS();
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("NOT\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = not_long(*destreg);
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("NOT\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = not_word(*destreg);
- }
- break;
- case 3:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("NEG\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = neg_long(*destreg);
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("NEG\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = neg_word(*destreg);
- }
- break;
- case 4:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("MUL\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- mul_long(*destreg); /*!!! */
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("MUL\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- mul_word(*destreg); /*!!! */
- }
- break;
- case 5:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("IMUL\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- imul_long(*destreg);
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("IMUL\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- imul_word(*destreg);
- }
- break;
- case 6:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("DIV\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- div_long(*destreg);
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("DIV\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- div_word(*destreg);
- }
- break;
- case 7:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- DECODE_PRINTF("IDIV\t");
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- idiv_long(*destreg);
- } else {
- u16 *destreg;
-
- DECODE_PRINTF("IDIV\t");
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- idiv_word(*destreg);
- }
- break;
- }
- break; /* end mod==11 */
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf8
-****************************************************************************/
-static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
-{
- /* clear the carry flag. */
- START_OF_INSTR();
- DECODE_PRINTF("CLC\n");
- TRACE_AND_STEP();
- CLEAR_FLAG(F_CF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf9
-****************************************************************************/
-static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
-{
- /* set the carry flag. */
- START_OF_INSTR();
- DECODE_PRINTF("STC\n");
- TRACE_AND_STEP();
- SET_FLAG(F_CF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfa
-****************************************************************************/
-static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
-{
- /* clear interrupts. */
- START_OF_INSTR();
- DECODE_PRINTF("CLI\n");
- TRACE_AND_STEP();
- CLEAR_FLAG(F_IF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfb
-****************************************************************************/
-static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
-{
- /* enable interrupts. */
- START_OF_INSTR();
- DECODE_PRINTF("STI\n");
- TRACE_AND_STEP();
- SET_FLAG(F_IF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfc
-****************************************************************************/
-static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
-{
- /* clear interrupts. */
- START_OF_INSTR();
- DECODE_PRINTF("CLD\n");
- TRACE_AND_STEP();
- CLEAR_FLAG(F_DF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfd
-****************************************************************************/
-static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
-{
- /* clear interrupts. */
- START_OF_INSTR();
- DECODE_PRINTF("STD\n");
- TRACE_AND_STEP();
- SET_FLAG(F_DF);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfe
-****************************************************************************/
-static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rh, rl;
- u8 destval;
- uint destoffset;
- u8 *destreg;
-
- /* Yet another special case instruction. */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- DECODE_PRINTF("INC\t");
- break;
- case 1:
- DECODE_PRINTF("DEC\t");
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod);
- HALT_SYS();
- break;
- }
- }
-#endif
- switch (mod) {
- case 0:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0: /* inc word ptr ... */
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = inc_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 1: /* dec word ptr ... */
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = dec_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- }
- break;
- case 1:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0:
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = inc_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = dec_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- }
- break;
- case 2:
- DECODE_PRINTF("BYTE PTR ");
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0:
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = inc_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- case 1:
- destval = fetch_data_byte(destoffset);
- TRACE_AND_STEP();
- destval = dec_byte(destval);
- store_data_byte(destoffset, destval);
- break;
- }
- break;
- case 3:
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0:
- TRACE_AND_STEP();
- *destreg = inc_byte(*destreg);
- break;
- case 1:
- TRACE_AND_STEP();
- *destreg = dec_byte(*destreg);
- break;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xff
-****************************************************************************/
-static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
-{
- int mod, rh, rl;
- uint destoffset = 0;
- u16 *destreg;
- u16 destval,destval2;
-
- /* Yet another special case instruction. */
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
- if (DEBUG_DECODE()) {
- /* XXX DECODE_PRINTF may be changed to something more
- general, so that it is important to leave the strings
- in the same format, even though the result is that the
- above test is done twice. */
-
- switch (rh) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("INC\tDWORD PTR ");
- } else {
- DECODE_PRINTF("INC\tWORD PTR ");
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- DECODE_PRINTF("DEC\tDWORD PTR ");
- } else {
- DECODE_PRINTF("DEC\tWORD PTR ");
- }
- break;
- case 2:
- DECODE_PRINTF("CALL\t");
- break;
- case 3:
- DECODE_PRINTF("CALL\tFAR ");
- break;
- case 4:
- DECODE_PRINTF("JMP\t");
- break;
- case 5:
- DECODE_PRINTF("JMP\tFAR ");
- break;
- case 6:
- DECODE_PRINTF("PUSH\t");
- break;
- case 7:
- DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t");
- HALT_SYS();
- break;
- }
- }
-#endif
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0: /* inc word ptr ... */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = inc_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = inc_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 1: /* dec word ptr ... */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = dec_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = dec_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 4: /* jmp word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- break;
- case 5: /* jmp far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- M.x86.R_CS = destval2;
- break;
- case 6: /* push word ptr ... */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- push_long(destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(destval);
- }
- break;
- }
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = inc_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = inc_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = dec_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = dec_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 4: /* jmp word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- break;
- case 5: /* jmp far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- M.x86.R_CS = destval2;
- break;
- case 6: /* push word ptr ... */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- push_long(destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(destval);
- }
- break;
- }
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- switch (rh) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = inc_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = inc_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- destval = dec_long(destval);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- destval = dec_word(destval);
- store_data_word(destoffset, destval);
- }
- break;
- case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
- break;
- case 4: /* jmp word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- break;
- case 5: /* jmp far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- M.x86.R_IP = destval;
- M.x86.R_CS = destval2;
- break;
- case 6: /* push word ptr ... */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
-
- destval = fetch_data_long(destoffset);
- TRACE_AND_STEP();
- push_long(destval);
- } else {
- u16 destval;
-
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(destval);
- }
- break;
- }
- break;
- case 3:
- switch (rh) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = inc_long(*destreg);
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = inc_word(*destreg);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = dec_long(*destreg);
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = dec_word(*destreg);
- }
- break;
- case 2: /* call word ptr ... */
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = *destreg;
- break;
- case 3: /* jmp far ptr ... */
- DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
- TRACE_AND_STEP();
- HALT_SYS();
- break;
-
- case 4: /* jmp ... */
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- M.x86.R_IP = (u16) (*destreg);
- break;
- case 5: /* jmp far ptr ... */
- DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
- TRACE_AND_STEP();
- HALT_SYS();
- break;
- case 6:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- push_long(*destreg);
- } else {
- u16 *destreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- push_word(*destreg);
- }
- break;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/***************************************************************************
- * Single byte operation code table:
- **************************************************************************/
-void (*x86emu_optab[256])(u8) =
-{
-/* 0x00 */ x86emuOp_add_byte_RM_R,
-/* 0x01 */ x86emuOp_add_word_RM_R,
-/* 0x02 */ x86emuOp_add_byte_R_RM,
-/* 0x03 */ x86emuOp_add_word_R_RM,
-/* 0x04 */ x86emuOp_add_byte_AL_IMM,
-/* 0x05 */ x86emuOp_add_word_AX_IMM,
-/* 0x06 */ x86emuOp_push_ES,
-/* 0x07 */ x86emuOp_pop_ES,
-
-/* 0x08 */ x86emuOp_or_byte_RM_R,
-/* 0x09 */ x86emuOp_or_word_RM_R,
-/* 0x0a */ x86emuOp_or_byte_R_RM,
-/* 0x0b */ x86emuOp_or_word_R_RM,
-/* 0x0c */ x86emuOp_or_byte_AL_IMM,
-/* 0x0d */ x86emuOp_or_word_AX_IMM,
-/* 0x0e */ x86emuOp_push_CS,
-/* 0x0f */ x86emuOp_two_byte,
-
-/* 0x10 */ x86emuOp_adc_byte_RM_R,
-/* 0x11 */ x86emuOp_adc_word_RM_R,
-/* 0x12 */ x86emuOp_adc_byte_R_RM,
-/* 0x13 */ x86emuOp_adc_word_R_RM,
-/* 0x14 */ x86emuOp_adc_byte_AL_IMM,
-/* 0x15 */ x86emuOp_adc_word_AX_IMM,
-/* 0x16 */ x86emuOp_push_SS,
-/* 0x17 */ x86emuOp_pop_SS,
-
-/* 0x18 */ x86emuOp_sbb_byte_RM_R,
-/* 0x19 */ x86emuOp_sbb_word_RM_R,
-/* 0x1a */ x86emuOp_sbb_byte_R_RM,
-/* 0x1b */ x86emuOp_sbb_word_R_RM,
-/* 0x1c */ x86emuOp_sbb_byte_AL_IMM,
-/* 0x1d */ x86emuOp_sbb_word_AX_IMM,
-/* 0x1e */ x86emuOp_push_DS,
-/* 0x1f */ x86emuOp_pop_DS,
-
-/* 0x20 */ x86emuOp_and_byte_RM_R,
-/* 0x21 */ x86emuOp_and_word_RM_R,
-/* 0x22 */ x86emuOp_and_byte_R_RM,
-/* 0x23 */ x86emuOp_and_word_R_RM,
-/* 0x24 */ x86emuOp_and_byte_AL_IMM,
-/* 0x25 */ x86emuOp_and_word_AX_IMM,
-/* 0x26 */ x86emuOp_segovr_ES,
-/* 0x27 */ x86emuOp_daa,
-
-/* 0x28 */ x86emuOp_sub_byte_RM_R,
-/* 0x29 */ x86emuOp_sub_word_RM_R,
-/* 0x2a */ x86emuOp_sub_byte_R_RM,
-/* 0x2b */ x86emuOp_sub_word_R_RM,
-/* 0x2c */ x86emuOp_sub_byte_AL_IMM,
-/* 0x2d */ x86emuOp_sub_word_AX_IMM,
-/* 0x2e */ x86emuOp_segovr_CS,
-/* 0x2f */ x86emuOp_das,
-
-/* 0x30 */ x86emuOp_xor_byte_RM_R,
-/* 0x31 */ x86emuOp_xor_word_RM_R,
-/* 0x32 */ x86emuOp_xor_byte_R_RM,
-/* 0x33 */ x86emuOp_xor_word_R_RM,
-/* 0x34 */ x86emuOp_xor_byte_AL_IMM,
-/* 0x35 */ x86emuOp_xor_word_AX_IMM,
-/* 0x36 */ x86emuOp_segovr_SS,
-/* 0x37 */ x86emuOp_aaa,
-
-/* 0x38 */ x86emuOp_cmp_byte_RM_R,
-/* 0x39 */ x86emuOp_cmp_word_RM_R,
-/* 0x3a */ x86emuOp_cmp_byte_R_RM,
-/* 0x3b */ x86emuOp_cmp_word_R_RM,
-/* 0x3c */ x86emuOp_cmp_byte_AL_IMM,
-/* 0x3d */ x86emuOp_cmp_word_AX_IMM,
-/* 0x3e */ x86emuOp_segovr_DS,
-/* 0x3f */ x86emuOp_aas,
-
-/* 0x40 */ x86emuOp_inc_AX,
-/* 0x41 */ x86emuOp_inc_CX,
-/* 0x42 */ x86emuOp_inc_DX,
-/* 0x43 */ x86emuOp_inc_BX,
-/* 0x44 */ x86emuOp_inc_SP,
-/* 0x45 */ x86emuOp_inc_BP,
-/* 0x46 */ x86emuOp_inc_SI,
-/* 0x47 */ x86emuOp_inc_DI,
-
-/* 0x48 */ x86emuOp_dec_AX,
-/* 0x49 */ x86emuOp_dec_CX,
-/* 0x4a */ x86emuOp_dec_DX,
-/* 0x4b */ x86emuOp_dec_BX,
-/* 0x4c */ x86emuOp_dec_SP,
-/* 0x4d */ x86emuOp_dec_BP,
-/* 0x4e */ x86emuOp_dec_SI,
-/* 0x4f */ x86emuOp_dec_DI,
-
-/* 0x50 */ x86emuOp_push_AX,
-/* 0x51 */ x86emuOp_push_CX,
-/* 0x52 */ x86emuOp_push_DX,
-/* 0x53 */ x86emuOp_push_BX,
-/* 0x54 */ x86emuOp_push_SP,
-/* 0x55 */ x86emuOp_push_BP,
-/* 0x56 */ x86emuOp_push_SI,
-/* 0x57 */ x86emuOp_push_DI,
-
-/* 0x58 */ x86emuOp_pop_AX,
-/* 0x59 */ x86emuOp_pop_CX,
-/* 0x5a */ x86emuOp_pop_DX,
-/* 0x5b */ x86emuOp_pop_BX,
-/* 0x5c */ x86emuOp_pop_SP,
-/* 0x5d */ x86emuOp_pop_BP,
-/* 0x5e */ x86emuOp_pop_SI,
-/* 0x5f */ x86emuOp_pop_DI,
-
-/* 0x60 */ x86emuOp_push_all,
-/* 0x61 */ x86emuOp_pop_all,
-/* 0x62 */ x86emuOp_illegal_op, /* bound */
-/* 0x63 */ x86emuOp_illegal_op, /* arpl */
-/* 0x64 */ x86emuOp_segovr_FS,
-/* 0x65 */ x86emuOp_segovr_GS,
-/* 0x66 */ x86emuOp_prefix_data,
-/* 0x67 */ x86emuOp_prefix_addr,
-
-/* 0x68 */ x86emuOp_push_word_IMM,
-/* 0x69 */ x86emuOp_imul_word_IMM,
-/* 0x6a */ x86emuOp_push_byte_IMM,
-/* 0x6b */ x86emuOp_imul_byte_IMM,
-/* 0x6c */ x86emuOp_ins_byte,
-/* 0x6d */ x86emuOp_ins_word,
-/* 0x6e */ x86emuOp_outs_byte,
-/* 0x6f */ x86emuOp_outs_word,
-
-/* 0x70 */ x86emuOp_jump_near_O,
-/* 0x71 */ x86emuOp_jump_near_NO,
-/* 0x72 */ x86emuOp_jump_near_B,
-/* 0x73 */ x86emuOp_jump_near_NB,
-/* 0x74 */ x86emuOp_jump_near_Z,
-/* 0x75 */ x86emuOp_jump_near_NZ,
-/* 0x76 */ x86emuOp_jump_near_BE,
-/* 0x77 */ x86emuOp_jump_near_NBE,
-
-/* 0x78 */ x86emuOp_jump_near_S,
-/* 0x79 */ x86emuOp_jump_near_NS,
-/* 0x7a */ x86emuOp_jump_near_P,
-/* 0x7b */ x86emuOp_jump_near_NP,
-/* 0x7c */ x86emuOp_jump_near_L,
-/* 0x7d */ x86emuOp_jump_near_NL,
-/* 0x7e */ x86emuOp_jump_near_LE,
-/* 0x7f */ x86emuOp_jump_near_NLE,
-
-/* 0x80 */ x86emuOp_opc80_byte_RM_IMM,
-/* 0x81 */ x86emuOp_opc81_word_RM_IMM,
-/* 0x82 */ x86emuOp_opc82_byte_RM_IMM,
-/* 0x83 */ x86emuOp_opc83_word_RM_IMM,
-/* 0x84 */ x86emuOp_test_byte_RM_R,
-/* 0x85 */ x86emuOp_test_word_RM_R,
-/* 0x86 */ x86emuOp_xchg_byte_RM_R,
-/* 0x87 */ x86emuOp_xchg_word_RM_R,
-
-/* 0x88 */ x86emuOp_mov_byte_RM_R,
-/* 0x89 */ x86emuOp_mov_word_RM_R,
-/* 0x8a */ x86emuOp_mov_byte_R_RM,
-/* 0x8b */ x86emuOp_mov_word_R_RM,
-/* 0x8c */ x86emuOp_mov_word_RM_SR,
-/* 0x8d */ x86emuOp_lea_word_R_M,
-/* 0x8e */ x86emuOp_mov_word_SR_RM,
-/* 0x8f */ x86emuOp_pop_RM,
-
-/* 0x90 */ x86emuOp_nop,
-/* 0x91 */ x86emuOp_xchg_word_AX_CX,
-/* 0x92 */ x86emuOp_xchg_word_AX_DX,
-/* 0x93 */ x86emuOp_xchg_word_AX_BX,
-/* 0x94 */ x86emuOp_xchg_word_AX_SP,
-/* 0x95 */ x86emuOp_xchg_word_AX_BP,
-/* 0x96 */ x86emuOp_xchg_word_AX_SI,
-/* 0x97 */ x86emuOp_xchg_word_AX_DI,
-
-/* 0x98 */ x86emuOp_cbw,
-/* 0x99 */ x86emuOp_cwd,
-/* 0x9a */ x86emuOp_call_far_IMM,
-/* 0x9b */ x86emuOp_wait,
-/* 0x9c */ x86emuOp_pushf_word,
-/* 0x9d */ x86emuOp_popf_word,
-/* 0x9e */ x86emuOp_sahf,
-/* 0x9f */ x86emuOp_lahf,
-
-/* 0xa0 */ x86emuOp_mov_AL_M_IMM,
-/* 0xa1 */ x86emuOp_mov_AX_M_IMM,
-/* 0xa2 */ x86emuOp_mov_M_AL_IMM,
-/* 0xa3 */ x86emuOp_mov_M_AX_IMM,
-/* 0xa4 */ x86emuOp_movs_byte,
-/* 0xa5 */ x86emuOp_movs_word,
-/* 0xa6 */ x86emuOp_cmps_byte,
-/* 0xa7 */ x86emuOp_cmps_word,
-/* 0xa8 */ x86emuOp_test_AL_IMM,
-/* 0xa9 */ x86emuOp_test_AX_IMM,
-/* 0xaa */ x86emuOp_stos_byte,
-/* 0xab */ x86emuOp_stos_word,
-/* 0xac */ x86emuOp_lods_byte,
-/* 0xad */ x86emuOp_lods_word,
-/* 0xac */ x86emuOp_scas_byte,
-/* 0xad */ x86emuOp_scas_word,
-
-
-/* 0xb0 */ x86emuOp_mov_byte_AL_IMM,
-/* 0xb1 */ x86emuOp_mov_byte_CL_IMM,
-/* 0xb2 */ x86emuOp_mov_byte_DL_IMM,
-/* 0xb3 */ x86emuOp_mov_byte_BL_IMM,
-/* 0xb4 */ x86emuOp_mov_byte_AH_IMM,
-/* 0xb5 */ x86emuOp_mov_byte_CH_IMM,
-/* 0xb6 */ x86emuOp_mov_byte_DH_IMM,
-/* 0xb7 */ x86emuOp_mov_byte_BH_IMM,
-
-/* 0xb8 */ x86emuOp_mov_word_AX_IMM,
-/* 0xb9 */ x86emuOp_mov_word_CX_IMM,
-/* 0xba */ x86emuOp_mov_word_DX_IMM,
-/* 0xbb */ x86emuOp_mov_word_BX_IMM,
-/* 0xbc */ x86emuOp_mov_word_SP_IMM,
-/* 0xbd */ x86emuOp_mov_word_BP_IMM,
-/* 0xbe */ x86emuOp_mov_word_SI_IMM,
-/* 0xbf */ x86emuOp_mov_word_DI_IMM,
-
-/* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
-/* 0xc1 */ x86emuOp_opcC1_word_RM_MEM,
-/* 0xc2 */ x86emuOp_ret_near_IMM,
-/* 0xc3 */ x86emuOp_ret_near,
-/* 0xc4 */ x86emuOp_les_R_IMM,
-/* 0xc5 */ x86emuOp_lds_R_IMM,
-/* 0xc6 */ x86emuOp_mov_byte_RM_IMM,
-/* 0xc7 */ x86emuOp_mov_word_RM_IMM,
-/* 0xc8 */ x86emuOp_enter,
-/* 0xc9 */ x86emuOp_leave,
-/* 0xca */ x86emuOp_ret_far_IMM,
-/* 0xcb */ x86emuOp_ret_far,
-/* 0xcc */ x86emuOp_int3,
-/* 0xcd */ x86emuOp_int_IMM,
-/* 0xce */ x86emuOp_into,
-/* 0xcf */ x86emuOp_iret,
-
-/* 0xd0 */ x86emuOp_opcD0_byte_RM_1,
-/* 0xd1 */ x86emuOp_opcD1_word_RM_1,
-/* 0xd2 */ x86emuOp_opcD2_byte_RM_CL,
-/* 0xd3 */ x86emuOp_opcD3_word_RM_CL,
-/* 0xd4 */ x86emuOp_aam,
-/* 0xd5 */ x86emuOp_aad,
-/* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */
-/* 0xd7 */ x86emuOp_xlat,
-/* 0xd8 */ x86emuOp_esc_coprocess_d8,
-/* 0xd9 */ x86emuOp_esc_coprocess_d9,
-/* 0xda */ x86emuOp_esc_coprocess_da,
-/* 0xdb */ x86emuOp_esc_coprocess_db,
-/* 0xdc */ x86emuOp_esc_coprocess_dc,
-/* 0xdd */ x86emuOp_esc_coprocess_dd,
-/* 0xde */ x86emuOp_esc_coprocess_de,
-/* 0xdf */ x86emuOp_esc_coprocess_df,
-
-/* 0xe0 */ x86emuOp_loopne,
-/* 0xe1 */ x86emuOp_loope,
-/* 0xe2 */ x86emuOp_loop,
-/* 0xe3 */ x86emuOp_jcxz,
-/* 0xe4 */ x86emuOp_in_byte_AL_IMM,
-/* 0xe5 */ x86emuOp_in_word_AX_IMM,
-/* 0xe6 */ x86emuOp_out_byte_IMM_AL,
-/* 0xe7 */ x86emuOp_out_word_IMM_AX,
-
-/* 0xe8 */ x86emuOp_call_near_IMM,
-/* 0xe9 */ x86emuOp_jump_near_IMM,
-/* 0xea */ x86emuOp_jump_far_IMM,
-/* 0xeb */ x86emuOp_jump_byte_IMM,
-/* 0xec */ x86emuOp_in_byte_AL_DX,
-/* 0xed */ x86emuOp_in_word_AX_DX,
-/* 0xee */ x86emuOp_out_byte_DX_AL,
-/* 0xef */ x86emuOp_out_word_DX_AX,
-
-/* 0xf0 */ x86emuOp_lock,
-/* 0xf1 */ x86emuOp_illegal_op,
-/* 0xf2 */ x86emuOp_repne,
-/* 0xf3 */ x86emuOp_repe,
-/* 0xf4 */ x86emuOp_halt,
-/* 0xf5 */ x86emuOp_cmc,
-/* 0xf6 */ x86emuOp_opcF6_byte_RM,
-/* 0xf7 */ x86emuOp_opcF7_word_RM,
-
-/* 0xf8 */ x86emuOp_clc,
-/* 0xf9 */ x86emuOp_stc,
-/* 0xfa */ x86emuOp_cli,
-/* 0xfb */ x86emuOp_sti,
-/* 0xfc */ x86emuOp_cld,
-/* 0xfd */ x86emuOp_std,
-/* 0xfe */ x86emuOp_opcFE_byte_RM,
-/* 0xff */ x86emuOp_opcFF_word_RM,
-};
diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c
deleted file mode 100644
index 55f361677..000000000
--- a/hw/xfree86/x86emu/ops2.c
+++ /dev/null
@@ -1,2805 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file includes subroutines to implement the decoding
-* and emulation of all the x86 extended two-byte processor
-* instructions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.6 2003/10/22 20:03:06 tsi Exp $ */
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-op1 - Instruction op code
-
-REMARKS:
-Handles illegal opcodes.
-****************************************************************************/
-static void x86emuOp2_illegal_op(
- u8 op2)
-{
- START_OF_INSTR();
- DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
- TRACE_REGS();
- printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
- M.x86.R_CS, M.x86.R_IP-2,op2);
- HALT_SYS();
- END_OF_INSTR();
-}
-
-#define xorl(a,b) ((a) && !(b)) || (!(a) && (b))
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0x80-0x8F
-****************************************************************************/
-static void x86emuOp2_long_jump(u8 op2)
-{
- s32 target;
- char *name = 0;
- int cond = 0;
-
- /* conditional jump to word offset. */
- START_OF_INSTR();
- switch (op2) {
- case 0x80:
- name = "JO\t";
- cond = ACCESS_FLAG(F_OF);
- break;
- case 0x81:
- name = "JNO\t";
- cond = !ACCESS_FLAG(F_OF);
- break;
- case 0x82:
- name = "JB\t";
- cond = ACCESS_FLAG(F_CF);
- break;
- case 0x83:
- name = "JNB\t";
- cond = !ACCESS_FLAG(F_CF);
- break;
- case 0x84:
- name = "JZ\t";
- cond = ACCESS_FLAG(F_ZF);
- break;
- case 0x85:
- name = "JNZ\t";
- cond = !ACCESS_FLAG(F_ZF);
- break;
- case 0x86:
- name = "JBE\t";
- cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
- break;
- case 0x87:
- name = "JNBE\t";
- cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
- break;
- case 0x88:
- name = "JS\t";
- cond = ACCESS_FLAG(F_SF);
- break;
- case 0x89:
- name = "JNS\t";
- cond = !ACCESS_FLAG(F_SF);
- break;
- case 0x8a:
- name = "JP\t";
- cond = ACCESS_FLAG(F_PF);
- break;
- case 0x8b:
- name = "JNP\t";
- cond = !ACCESS_FLAG(F_PF);
- break;
- case 0x8c:
- name = "JL\t";
- cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
- break;
- case 0x8d:
- name = "JNL\t";
- cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
- break;
- case 0x8e:
- name = "JLE\t";
- cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
- ACCESS_FLAG(F_ZF));
- break;
- case 0x8f:
- name = "JNLE\t";
- cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
- ACCESS_FLAG(F_ZF));
- break;
- }
- DECODE_PRINTF(name);
- (void)name;
- target = (s16) fetch_word_imm();
- target += (s16) M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", target);
- TRACE_AND_STEP();
- if (cond)
- M.x86.R_IP = (u16)target;
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0x90-0x9F
-****************************************************************************/
-static void x86emuOp2_set_byte(u8 op2)
-{
- int mod, rl, rh;
- uint destoffset;
- u8 *destreg;
- char *name = 0;
- int cond = 0;
-
- START_OF_INSTR();
- switch (op2) {
- case 0x90:
- name = "SETO\t";
- cond = ACCESS_FLAG(F_OF);
- break;
- case 0x91:
- name = "SETNO\t";
- cond = !ACCESS_FLAG(F_OF);
- break;
- case 0x92:
- name = "SETB\t";
- cond = ACCESS_FLAG(F_CF);
- break;
- case 0x93:
- name = "SETNB\t";
- cond = !ACCESS_FLAG(F_CF);
- break;
- case 0x94:
- name = "SETZ\t";
- cond = ACCESS_FLAG(F_ZF);
- break;
- case 0x95:
- name = "SETNZ\t";
- cond = !ACCESS_FLAG(F_ZF);
- break;
- case 0x96:
- name = "SETBE\t";
- cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
- break;
- case 0x97:
- name = "SETNBE\t";
- cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
- break;
- case 0x98:
- name = "SETS\t";
- cond = ACCESS_FLAG(F_SF);
- break;
- case 0x99:
- name = "SETNS\t";
- cond = !ACCESS_FLAG(F_SF);
- break;
- case 0x9a:
- name = "SETP\t";
- cond = ACCESS_FLAG(F_PF);
- break;
- case 0x9b:
- name = "SETNP\t";
- cond = !ACCESS_FLAG(F_PF);
- break;
- case 0x9c:
- name = "SETL\t";
- cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
- break;
- case 0x9d:
- name = "SETNL\t";
- cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
- break;
- case 0x9e:
- name = "SETLE\t";
- cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
- ACCESS_FLAG(F_ZF));
- break;
- case 0x9f:
- name = "SETNLE\t";
- cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
- ACCESS_FLAG(F_ZF));
- break;
- }
- DECODE_PRINTF(name);
- (void)name;
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destoffset = decode_rm00_address(rl);
- TRACE_AND_STEP();
- store_data_byte(destoffset, cond ? 0x01 : 0x00);
- break;
- case 1:
- destoffset = decode_rm01_address(rl);
- TRACE_AND_STEP();
- store_data_byte(destoffset, cond ? 0x01 : 0x00);
- break;
- case 2:
- destoffset = decode_rm10_address(rl);
- TRACE_AND_STEP();
- store_data_byte(destoffset, cond ? 0x01 : 0x00);
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_BYTE_REGISTER(rl);
- TRACE_AND_STEP();
- *destreg = cond ? 0x01 : 0x00;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa0
-****************************************************************************/
-static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tFS\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_FS);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa1
-****************************************************************************/
-static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
-{
- START_OF_INSTR();
- DECODE_PRINTF("POP\tFS\n");
- TRACE_AND_STEP();
- M.x86.R_FS = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa3
-****************************************************************************/
-static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- int bit,disp;
-
- START_OF_INSTR();
- DECODE_PRINTF("BT\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval;
- u32 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- } else {
- u16 srcval;
- u16 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval;
- u32 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- } else {
- u16 srcval;
- u16 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval;
- u32 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- } else {
- u16 srcval;
- u16 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg,*shiftreg;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
- } else {
- u16 *srcreg,*shiftreg;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa4
-****************************************************************************/
-static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 shift;
-
- START_OF_INSTR();
- DECODE_PRINTF("SHLD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*shiftreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- *destreg = shld_long(*destreg,*shiftreg,shift);
- } else {
- u16 *destreg,*shiftreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- *destreg = shld_word(*destreg,*shiftreg,shift);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa5
-****************************************************************************/
-static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SHLD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*shiftreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
- } else {
- u16 *destreg,*shiftreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa8
-****************************************************************************/
-static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
-{
- START_OF_INSTR();
- DECODE_PRINTF("PUSH\tGS\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_GS);
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa9
-****************************************************************************/
-static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
-{
- START_OF_INSTR();
- DECODE_PRINTF("POP\tGS\n");
- TRACE_AND_STEP();
- M.x86.R_GS = pop_word();
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-#if 0
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xaa
-****************************************************************************/
-static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- int bit,disp;
-
- START_OF_INSTR();
- DECODE_PRINTF("BTS\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval | mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, srcval | mask);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval | mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, srcval | mask);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval | mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, srcval | mask);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg,*shiftreg;
- u32 mask;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg |= mask;
- } else {
- u16 *srcreg,*shiftreg;
- u16 mask;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg |= mask;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xac
-****************************************************************************/
-static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint destoffset;
- u8 shift;
-
- START_OF_INSTR();
- DECODE_PRINTF("SHLD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,shift);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,shift);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*shiftreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- *destreg = shrd_long(*destreg,*shiftreg,shift);
- } else {
- u16 *destreg,*shiftreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- DECODE_PRINTF2("%d\n", shift);
- TRACE_AND_STEP();
- *destreg = shrd_word(*destreg,*shiftreg,shift);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xad
-****************************************************************************/
-static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint destoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("SHLD\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 destval;
- u32 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_long(destoffset);
- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
- store_data_long(destoffset, destval);
- } else {
- u16 destval;
- u16 *shiftreg;
-
- destoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- destval = fetch_data_word(destoffset);
- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
- store_data_word(destoffset, destval);
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*shiftreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
- } else {
- u16 *destreg,*shiftreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",CL\n");
- TRACE_AND_STEP();
- *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xaf
-****************************************************************************/
-static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("IMUL\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_long(srcoffset);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- TRACE_AND_STEP();
- res = (s16)*destreg * (s16)srcval;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_long(srcoffset);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- TRACE_AND_STEP();
- res = (s16)*destreg * (s16)srcval;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_long(srcoffset);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg;
- u16 srcval;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- TRACE_AND_STEP();
- res = (s16)*destreg * (s16)srcval;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
- u32 res_lo,res_hi;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- TRACE_AND_STEP();
- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
- if (res_hi != 0) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u32)res_lo;
- } else {
- u16 *destreg,*srcreg;
- u32 res;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- res = (s16)*destreg * (s16)*srcreg;
- if (res > 0xFFFF) {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- }
- *destreg = (u16)res;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb2
-****************************************************************************/
-static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rh, rl;
- u16 *dstreg;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("LSS\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_SS = fetch_data_word(srcoffset + 2);
- break;
- case 1:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_SS = fetch_data_word(srcoffset + 2);
- break;
- case 2:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_SS = fetch_data_word(srcoffset + 2);
- break;
- case 3: /* register to register */
- /* UNDEFINED! */
- TRACE_AND_STEP();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb3
-****************************************************************************/
-static void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- int bit,disp;
-
- START_OF_INSTR();
- DECODE_PRINTF("BTR\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval & ~mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval & ~mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval & ~mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg,*shiftreg;
- u32 mask;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg &= ~mask;
- } else {
- u16 *srcreg,*shiftreg;
- u16 mask;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg &= ~mask;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb4
-****************************************************************************/
-static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rh, rl;
- u16 *dstreg;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("LFS\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_FS = fetch_data_word(srcoffset + 2);
- break;
- case 1:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_FS = fetch_data_word(srcoffset + 2);
- break;
- case 2:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_FS = fetch_data_word(srcoffset + 2);
- break;
- case 3: /* register to register */
- /* UNDEFINED! */
- TRACE_AND_STEP();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb5
-****************************************************************************/
-static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rh, rl;
- u16 *dstreg;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("LGS\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_GS = fetch_data_word(srcoffset + 2);
- break;
- case 1:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_GS = fetch_data_word(srcoffset + 2);
- break;
- case 2:
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *dstreg = fetch_data_word(srcoffset);
- M.x86.R_GS = fetch_data_word(srcoffset + 2);
- break;
- case 3: /* register to register */
- /* UNDEFINED! */
- TRACE_AND_STEP();
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb6
-****************************************************************************/
-static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOVZX\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_byte(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u8 *srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- } else {
- u16 *destreg;
- u8 *srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb7
-****************************************************************************/
-static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- u32 *destreg;
- u32 srcval;
- u16 *srcreg;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOVZX\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 1:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 2:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = fetch_data_word(srcoffset);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = *srcreg;
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xba
-****************************************************************************/
-static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- int bit;
-
- START_OF_INSTR();
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (rh) {
- case 3:
- DECODE_PRINTF("BT\t");
- break;
- case 4:
- DECODE_PRINTF("BTS\t");
- break;
- case 5:
- DECODE_PRINTF("BTR\t");
- break;
- case 6:
- DECODE_PRINTF("BTC\t");
- break;
- default:
- DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
- TRACE_REGS();
- printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
- M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
- HALT_SYS();
- }
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0x1F;
- srcval = fetch_data_long(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_long(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_long(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_long(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- } else {
- u16 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0xF;
- srcval = fetch_data_word(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_word(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_word(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_word(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0x1F;
- srcval = fetch_data_long(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_long(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_long(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_long(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- } else {
- u16 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0xF;
- srcval = fetch_data_word(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_word(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_word(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_word(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0x1F;
- srcval = fetch_data_long(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_long(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_long(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_long(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- } else {
- u16 srcval, mask;
- u8 shift;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0xF;
- srcval = fetch_data_word(srcoffset);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- switch (rh) {
- case 4:
- store_data_word(srcoffset, srcval | mask);
- break;
- case 5:
- store_data_word(srcoffset, srcval & ~mask);
- break;
- case 6:
- store_data_word(srcoffset, srcval ^ mask);
- break;
- default:
- break;
- }
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg;
- u32 mask;
- u8 shift;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0x1F;
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- switch (rh) {
- case 4:
- *srcreg |= mask;
- break;
- case 5:
- *srcreg &= ~mask;
- break;
- case 6:
- *srcreg ^= mask;
- break;
- default:
- break;
- }
- } else {
- u16 *srcreg;
- u16 mask;
- u8 shift;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shift = fetch_byte_imm();
- TRACE_AND_STEP();
- bit = shift & 0xF;
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- switch (rh) {
- case 4:
- *srcreg |= mask;
- break;
- case 5:
- *srcreg &= ~mask;
- break;
- case 6:
- *srcreg ^= mask;
- break;
- default:
- break;
- }
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbb
-****************************************************************************/
-static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- int bit,disp;
-
- START_OF_INSTR();
- DECODE_PRINTF("BTC\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval ^ mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval ^ mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval,mask;
- u32 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- disp = (s16)*shiftreg >> 5;
- srcval = fetch_data_long(srcoffset+disp);
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_long(srcoffset+disp, srcval ^ mask);
- } else {
- u16 srcval,mask;
- u16 *shiftreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- disp = (s16)*shiftreg >> 4;
- srcval = fetch_data_word(srcoffset+disp);
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg,*shiftreg;
- u32 mask;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0x1F;
- mask = (0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg ^= mask;
- } else {
- u16 *srcreg,*shiftreg;
- u16 mask;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- shiftreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- bit = *shiftreg & 0xF;
- mask = (u16)(0x1 << bit);
- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
- *srcreg ^= mask;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbc
-****************************************************************************/
-static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("BSF\n");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch(mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg, *dstreg;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
- if ((*srcreg >> *dstreg) & 1) break;
- } else {
- u16 *srcreg, *dstreg;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
- if ((*srcreg >> *dstreg) & 1) break;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbd
-****************************************************************************/
-static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("BSF\n");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch(mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm00_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm01_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 srcval, *dstreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_long(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- } else {
- u16 srcval, *dstreg;
-
- srcoffset = decode_rm10_address(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- srcval = fetch_data_word(srcoffset);
- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
- if ((srcval >> *dstreg) & 1) break;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *srcreg, *dstreg;
-
- srcreg = DECODE_RM_LONG_REGISTER(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_LONG_REGISTER(rh);
- TRACE_AND_STEP();
- CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
- if ((*srcreg >> *dstreg) & 1) break;
- } else {
- u16 *srcreg, *dstreg;
-
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF(",");
- dstreg = DECODE_RM_WORD_REGISTER(rh);
- TRACE_AND_STEP();
- CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
- if ((*srcreg >> *dstreg) & 1) break;
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbe
-****************************************************************************/
-static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOVSX\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = (s32)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = (s16)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 1:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = (s32)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = (s16)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 2:
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 srcval;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = (s32)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- } else {
- u16 *destreg;
- u16 srcval;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = (s16)((s8)fetch_data_byte(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- }
- break;
- case 3: /* register to register */
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u8 *srcreg;
-
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = (s32)((s8)*srcreg);
- } else {
- u16 *destreg;
- u8 *srcreg;
-
- destreg = DECODE_RM_WORD_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_BYTE_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = (s16)((s8)*srcreg);
- }
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbf
-****************************************************************************/
-static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
-{
- int mod, rl, rh;
- uint srcoffset;
- u32 *destreg;
- u32 srcval;
- u16 *srcreg;
-
- START_OF_INSTR();
- DECODE_PRINTF("MOVSX\t");
- FETCH_DECODE_MODRM(mod, rh, rl);
- switch (mod) {
- case 0:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm00_address(rl);
- srcval = (s32)((s16)fetch_data_word(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 1:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm01_address(rl);
- srcval = (s32)((s16)fetch_data_word(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 2:
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcoffset = decode_rm10_address(rl);
- srcval = (s32)((s16)fetch_data_word(srcoffset));
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = srcval;
- break;
- case 3: /* register to register */
- destreg = DECODE_RM_LONG_REGISTER(rh);
- DECODE_PRINTF(",");
- srcreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- *destreg = (s32)((s16)*srcreg);
- break;
- }
- DECODE_CLEAR_SEGOVR();
- END_OF_INSTR();
-}
-
-/***************************************************************************
- * Double byte operation code table:
- **************************************************************************/
-void (*x86emu_optab2[256])(u8) =
-{
-/* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */
-/* 0x01 */ x86emuOp2_illegal_op, /* Group G (ring 0 PM) */
-/* 0x02 */ x86emuOp2_illegal_op, /* lar (ring 0 PM) */
-/* 0x03 */ x86emuOp2_illegal_op, /* lsl (ring 0 PM) */
-/* 0x04 */ x86emuOp2_illegal_op,
-/* 0x05 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
-/* 0x06 */ x86emuOp2_illegal_op, /* clts (ring 0 PM) */
-/* 0x07 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
-/* 0x08 */ x86emuOp2_illegal_op, /* invd (ring 0 PM) */
-/* 0x09 */ x86emuOp2_illegal_op, /* wbinvd (ring 0 PM) */
-/* 0x0a */ x86emuOp2_illegal_op,
-/* 0x0b */ x86emuOp2_illegal_op,
-/* 0x0c */ x86emuOp2_illegal_op,
-/* 0x0d */ x86emuOp2_illegal_op,
-/* 0x0e */ x86emuOp2_illegal_op,
-/* 0x0f */ x86emuOp2_illegal_op,
-
-/* 0x10 */ x86emuOp2_illegal_op,
-/* 0x11 */ x86emuOp2_illegal_op,
-/* 0x12 */ x86emuOp2_illegal_op,
-/* 0x13 */ x86emuOp2_illegal_op,
-/* 0x14 */ x86emuOp2_illegal_op,
-/* 0x15 */ x86emuOp2_illegal_op,
-/* 0x16 */ x86emuOp2_illegal_op,
-/* 0x17 */ x86emuOp2_illegal_op,
-/* 0x18 */ x86emuOp2_illegal_op,
-/* 0x19 */ x86emuOp2_illegal_op,
-/* 0x1a */ x86emuOp2_illegal_op,
-/* 0x1b */ x86emuOp2_illegal_op,
-/* 0x1c */ x86emuOp2_illegal_op,
-/* 0x1d */ x86emuOp2_illegal_op,
-/* 0x1e */ x86emuOp2_illegal_op,
-/* 0x1f */ x86emuOp2_illegal_op,
-
-/* 0x20 */ x86emuOp2_illegal_op, /* mov reg32,creg (ring 0 PM) */
-/* 0x21 */ x86emuOp2_illegal_op, /* mov reg32,dreg (ring 0 PM) */
-/* 0x22 */ x86emuOp2_illegal_op, /* mov creg,reg32 (ring 0 PM) */
-/* 0x23 */ x86emuOp2_illegal_op, /* mov dreg,reg32 (ring 0 PM) */
-/* 0x24 */ x86emuOp2_illegal_op, /* mov reg32,treg (ring 0 PM) */
-/* 0x25 */ x86emuOp2_illegal_op,
-/* 0x26 */ x86emuOp2_illegal_op, /* mov treg,reg32 (ring 0 PM) */
-/* 0x27 */ x86emuOp2_illegal_op,
-/* 0x28 */ x86emuOp2_illegal_op,
-/* 0x29 */ x86emuOp2_illegal_op,
-/* 0x2a */ x86emuOp2_illegal_op,
-/* 0x2b */ x86emuOp2_illegal_op,
-/* 0x2c */ x86emuOp2_illegal_op,
-/* 0x2d */ x86emuOp2_illegal_op,
-/* 0x2e */ x86emuOp2_illegal_op,
-/* 0x2f */ x86emuOp2_illegal_op,
-
-/* 0x30 */ x86emuOp2_illegal_op,
-/* 0x31 */ x86emuOp2_illegal_op,
-/* 0x32 */ x86emuOp2_illegal_op,
-/* 0x33 */ x86emuOp2_illegal_op,
-/* 0x34 */ x86emuOp2_illegal_op,
-/* 0x35 */ x86emuOp2_illegal_op,
-/* 0x36 */ x86emuOp2_illegal_op,
-/* 0x37 */ x86emuOp2_illegal_op,
-/* 0x38 */ x86emuOp2_illegal_op,
-/* 0x39 */ x86emuOp2_illegal_op,
-/* 0x3a */ x86emuOp2_illegal_op,
-/* 0x3b */ x86emuOp2_illegal_op,
-/* 0x3c */ x86emuOp2_illegal_op,
-/* 0x3d */ x86emuOp2_illegal_op,
-/* 0x3e */ x86emuOp2_illegal_op,
-/* 0x3f */ x86emuOp2_illegal_op,
-
-/* 0x40 */ x86emuOp2_illegal_op,
-/* 0x41 */ x86emuOp2_illegal_op,
-/* 0x42 */ x86emuOp2_illegal_op,
-/* 0x43 */ x86emuOp2_illegal_op,
-/* 0x44 */ x86emuOp2_illegal_op,
-/* 0x45 */ x86emuOp2_illegal_op,
-/* 0x46 */ x86emuOp2_illegal_op,
-/* 0x47 */ x86emuOp2_illegal_op,
-/* 0x48 */ x86emuOp2_illegal_op,
-/* 0x49 */ x86emuOp2_illegal_op,
-/* 0x4a */ x86emuOp2_illegal_op,
-/* 0x4b */ x86emuOp2_illegal_op,
-/* 0x4c */ x86emuOp2_illegal_op,
-/* 0x4d */ x86emuOp2_illegal_op,
-/* 0x4e */ x86emuOp2_illegal_op,
-/* 0x4f */ x86emuOp2_illegal_op,
-
-/* 0x50 */ x86emuOp2_illegal_op,
-/* 0x51 */ x86emuOp2_illegal_op,
-/* 0x52 */ x86emuOp2_illegal_op,
-/* 0x53 */ x86emuOp2_illegal_op,
-/* 0x54 */ x86emuOp2_illegal_op,
-/* 0x55 */ x86emuOp2_illegal_op,
-/* 0x56 */ x86emuOp2_illegal_op,
-/* 0x57 */ x86emuOp2_illegal_op,
-/* 0x58 */ x86emuOp2_illegal_op,
-/* 0x59 */ x86emuOp2_illegal_op,
-/* 0x5a */ x86emuOp2_illegal_op,
-/* 0x5b */ x86emuOp2_illegal_op,
-/* 0x5c */ x86emuOp2_illegal_op,
-/* 0x5d */ x86emuOp2_illegal_op,
-/* 0x5e */ x86emuOp2_illegal_op,
-/* 0x5f */ x86emuOp2_illegal_op,
-
-/* 0x60 */ x86emuOp2_illegal_op,
-/* 0x61 */ x86emuOp2_illegal_op,
-/* 0x62 */ x86emuOp2_illegal_op,
-/* 0x63 */ x86emuOp2_illegal_op,
-/* 0x64 */ x86emuOp2_illegal_op,
-/* 0x65 */ x86emuOp2_illegal_op,
-/* 0x66 */ x86emuOp2_illegal_op,
-/* 0x67 */ x86emuOp2_illegal_op,
-/* 0x68 */ x86emuOp2_illegal_op,
-/* 0x69 */ x86emuOp2_illegal_op,
-/* 0x6a */ x86emuOp2_illegal_op,
-/* 0x6b */ x86emuOp2_illegal_op,
-/* 0x6c */ x86emuOp2_illegal_op,
-/* 0x6d */ x86emuOp2_illegal_op,
-/* 0x6e */ x86emuOp2_illegal_op,
-/* 0x6f */ x86emuOp2_illegal_op,
-
-/* 0x70 */ x86emuOp2_illegal_op,
-/* 0x71 */ x86emuOp2_illegal_op,
-/* 0x72 */ x86emuOp2_illegal_op,
-/* 0x73 */ x86emuOp2_illegal_op,
-/* 0x74 */ x86emuOp2_illegal_op,
-/* 0x75 */ x86emuOp2_illegal_op,
-/* 0x76 */ x86emuOp2_illegal_op,
-/* 0x77 */ x86emuOp2_illegal_op,
-/* 0x78 */ x86emuOp2_illegal_op,
-/* 0x79 */ x86emuOp2_illegal_op,
-/* 0x7a */ x86emuOp2_illegal_op,
-/* 0x7b */ x86emuOp2_illegal_op,
-/* 0x7c */ x86emuOp2_illegal_op,
-/* 0x7d */ x86emuOp2_illegal_op,
-/* 0x7e */ x86emuOp2_illegal_op,
-/* 0x7f */ x86emuOp2_illegal_op,
-
-/* 0x80 */ x86emuOp2_long_jump,
-/* 0x81 */ x86emuOp2_long_jump,
-/* 0x82 */ x86emuOp2_long_jump,
-/* 0x83 */ x86emuOp2_long_jump,
-/* 0x84 */ x86emuOp2_long_jump,
-/* 0x85 */ x86emuOp2_long_jump,
-/* 0x86 */ x86emuOp2_long_jump,
-/* 0x87 */ x86emuOp2_long_jump,
-/* 0x88 */ x86emuOp2_long_jump,
-/* 0x89 */ x86emuOp2_long_jump,
-/* 0x8a */ x86emuOp2_long_jump,
-/* 0x8b */ x86emuOp2_long_jump,
-/* 0x8c */ x86emuOp2_long_jump,
-/* 0x8d */ x86emuOp2_long_jump,
-/* 0x8e */ x86emuOp2_long_jump,
-/* 0x8f */ x86emuOp2_long_jump,
-
-/* 0x90 */ x86emuOp2_set_byte,
-/* 0x91 */ x86emuOp2_set_byte,
-/* 0x92 */ x86emuOp2_set_byte,
-/* 0x93 */ x86emuOp2_set_byte,
-/* 0x94 */ x86emuOp2_set_byte,
-/* 0x95 */ x86emuOp2_set_byte,
-/* 0x96 */ x86emuOp2_set_byte,
-/* 0x97 */ x86emuOp2_set_byte,
-/* 0x98 */ x86emuOp2_set_byte,
-/* 0x99 */ x86emuOp2_set_byte,
-/* 0x9a */ x86emuOp2_set_byte,
-/* 0x9b */ x86emuOp2_set_byte,
-/* 0x9c */ x86emuOp2_set_byte,
-/* 0x9d */ x86emuOp2_set_byte,
-/* 0x9e */ x86emuOp2_set_byte,
-/* 0x9f */ x86emuOp2_set_byte,
-
-/* 0xa0 */ x86emuOp2_push_FS,
-/* 0xa1 */ x86emuOp2_pop_FS,
-/* 0xa2 */ x86emuOp2_illegal_op,
-/* 0xa3 */ x86emuOp2_bt_R,
-/* 0xa4 */ x86emuOp2_shld_IMM,
-/* 0xa5 */ x86emuOp2_shld_CL,
-/* 0xa6 */ x86emuOp2_illegal_op,
-/* 0xa7 */ x86emuOp2_illegal_op,
-/* 0xa8 */ x86emuOp2_push_GS,
-/* 0xa9 */ x86emuOp2_pop_GS,
-/* 0xaa */ x86emuOp2_illegal_op,
-/* 0xab */ x86emuOp2_bt_R,
-/* 0xac */ x86emuOp2_shrd_IMM,
-/* 0xad */ x86emuOp2_shrd_CL,
-/* 0xae */ x86emuOp2_illegal_op,
-/* 0xaf */ x86emuOp2_imul_R_RM,
-
-/* 0xb0 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
-/* 0xb1 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
-/* 0xb2 */ x86emuOp2_lss_R_IMM,
-/* 0xb3 */ x86emuOp2_btr_R,
-/* 0xb4 */ x86emuOp2_lfs_R_IMM,
-/* 0xb5 */ x86emuOp2_lgs_R_IMM,
-/* 0xb6 */ x86emuOp2_movzx_byte_R_RM,
-/* 0xb7 */ x86emuOp2_movzx_word_R_RM,
-/* 0xb8 */ x86emuOp2_illegal_op,
-/* 0xb9 */ x86emuOp2_illegal_op,
-/* 0xba */ x86emuOp2_btX_I,
-/* 0xbb */ x86emuOp2_btc_R,
-/* 0xbc */ x86emuOp2_bsf,
-/* 0xbd */ x86emuOp2_bsr,
-/* 0xbe */ x86emuOp2_movsx_byte_R_RM,
-/* 0xbf */ x86emuOp2_movsx_word_R_RM,
-
-/* 0xc0 */ x86emuOp2_illegal_op, /* TODO: xadd */
-/* 0xc1 */ x86emuOp2_illegal_op, /* TODO: xadd */
-/* 0xc2 */ x86emuOp2_illegal_op,
-/* 0xc3 */ x86emuOp2_illegal_op,
-/* 0xc4 */ x86emuOp2_illegal_op,
-/* 0xc5 */ x86emuOp2_illegal_op,
-/* 0xc6 */ x86emuOp2_illegal_op,
-/* 0xc7 */ x86emuOp2_illegal_op,
-/* 0xc8 */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xc9 */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xca */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xcb */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xcc */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xcd */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xce */ x86emuOp2_illegal_op, /* TODO: bswap */
-/* 0xcf */ x86emuOp2_illegal_op, /* TODO: bswap */
-
-/* 0xd0 */ x86emuOp2_illegal_op,
-/* 0xd1 */ x86emuOp2_illegal_op,
-/* 0xd2 */ x86emuOp2_illegal_op,
-/* 0xd3 */ x86emuOp2_illegal_op,
-/* 0xd4 */ x86emuOp2_illegal_op,
-/* 0xd5 */ x86emuOp2_illegal_op,
-/* 0xd6 */ x86emuOp2_illegal_op,
-/* 0xd7 */ x86emuOp2_illegal_op,
-/* 0xd8 */ x86emuOp2_illegal_op,
-/* 0xd9 */ x86emuOp2_illegal_op,
-/* 0xda */ x86emuOp2_illegal_op,
-/* 0xdb */ x86emuOp2_illegal_op,
-/* 0xdc */ x86emuOp2_illegal_op,
-/* 0xdd */ x86emuOp2_illegal_op,
-/* 0xde */ x86emuOp2_illegal_op,
-/* 0xdf */ x86emuOp2_illegal_op,
-
-/* 0xe0 */ x86emuOp2_illegal_op,
-/* 0xe1 */ x86emuOp2_illegal_op,
-/* 0xe2 */ x86emuOp2_illegal_op,
-/* 0xe3 */ x86emuOp2_illegal_op,
-/* 0xe4 */ x86emuOp2_illegal_op,
-/* 0xe5 */ x86emuOp2_illegal_op,
-/* 0xe6 */ x86emuOp2_illegal_op,
-/* 0xe7 */ x86emuOp2_illegal_op,
-/* 0xe8 */ x86emuOp2_illegal_op,
-/* 0xe9 */ x86emuOp2_illegal_op,
-/* 0xea */ x86emuOp2_illegal_op,
-/* 0xeb */ x86emuOp2_illegal_op,
-/* 0xec */ x86emuOp2_illegal_op,
-/* 0xed */ x86emuOp2_illegal_op,
-/* 0xee */ x86emuOp2_illegal_op,
-/* 0xef */ x86emuOp2_illegal_op,
-
-/* 0xf0 */ x86emuOp2_illegal_op,
-/* 0xf1 */ x86emuOp2_illegal_op,
-/* 0xf2 */ x86emuOp2_illegal_op,
-/* 0xf3 */ x86emuOp2_illegal_op,
-/* 0xf4 */ x86emuOp2_illegal_op,
-/* 0xf5 */ x86emuOp2_illegal_op,
-/* 0xf6 */ x86emuOp2_illegal_op,
-/* 0xf7 */ x86emuOp2_illegal_op,
-/* 0xf8 */ x86emuOp2_illegal_op,
-/* 0xf9 */ x86emuOp2_illegal_op,
-/* 0xfa */ x86emuOp2_illegal_op,
-/* 0xfb */ x86emuOp2_illegal_op,
-/* 0xfc */ x86emuOp2_illegal_op,
-/* 0xfd */ x86emuOp2_illegal_op,
-/* 0xfe */ x86emuOp2_illegal_op,
-/* 0xff */ x86emuOp2_illegal_op,
-};
diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
deleted file mode 100644
index ba4ffdeda..000000000
--- a/hw/xfree86/x86emu/prim_ops.c
+++ /dev/null
@@ -1,2914 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file contains the code to implement the primitive
-* machine operations used by the emulation code in ops.c
-*
-* Carry Chain Calculation
-*
-* This represents a somewhat expensive calculation which is
-* apparently required to emulate the setting of the OF and AF flag.
-* The latter is not so important, but the former is. The overflow
-* flag is the XOR of the top two bits of the carry chain for an
-* addition (similar for subtraction). Since we do not want to
-* simulate the addition in a bitwise manner, we try to calculate the
-* carry chain given the two operands and the result.
-*
-* So, given the following table, which represents the addition of two
-* bits, we can derive a formula for the carry chain.
-*
-* a b cin r cout
-* 0 0 0 0 0
-* 0 0 1 1 0
-* 0 1 0 1 0
-* 0 1 1 0 1
-* 1 0 0 1 0
-* 1 0 1 0 1
-* 1 1 0 0 1
-* 1 1 1 1 1
-*
-* Construction of table for cout:
-*
-* ab
-* r \ 00 01 11 10
-* |------------------
-* 0 | 0 1 1 1
-* 1 | 0 0 1 0
-*
-* By inspection, one gets: cc = ab + r'(a + b)
-*
-* That represents alot of operations, but NO CHOICE....
-*
-* Borrow Chain Calculation.
-*
-* The following table represents the subtraction of two bits, from
-* which we can derive a formula for the borrow chain.
-*
-* a b bin r bout
-* 0 0 0 0 0
-* 0 0 1 1 1
-* 0 1 0 1 1
-* 0 1 1 0 1
-* 1 0 0 1 0
-* 1 0 1 0 0
-* 1 1 0 0 0
-* 1 1 1 1 1
-*
-* Construction of table for cout:
-*
-* ab
-* r \ 00 01 11 10
-* |------------------
-* 0 | 0 1 0 0
-* 1 | 1 1 1 0
-*
-* By inspection, one gets: bc = a'b + r(a' + b)
-*
-****************************************************************************/
-
-#define PRIM_OPS_NO_REDEFINE_ASM
-#include "x86emu/x86emui.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-#ifndef __HAVE_INLINE_ASSEMBLER__
-
-static u32 x86emu_parity_tab[8] =
-{
- 0x96696996,
- 0x69969669,
- 0x69969669,
- 0x96696996,
- 0x69969669,
- 0x96696996,
- 0x96696996,
- 0x69969669,
-};
-
-#endif
-
-#define PARITY(x) (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
-#define XOR2(x) (((x) ^ ((x)>>1)) & 0x1)
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifndef __HAVE_INLINE_ASSEMBLER__
-
-/****************************************************************************
-REMARKS:
-Implements the AAA instruction and side effects.
-****************************************************************************/
-u16 aaa_word(u16 d)
-{
- u16 res;
- if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
- d += 0x6;
- d += 0x100;
- SET_FLAG(F_AF);
- SET_FLAG(F_CF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- }
- res = (u16)(d & 0xFF0F);
- CLEAR_FLAG(F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAA instruction and side effects.
-****************************************************************************/
-u16 aas_word(u16 d)
-{
- u16 res;
- if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
- d -= 0x6;
- d -= 0x100;
- SET_FLAG(F_AF);
- SET_FLAG(F_CF);
- } else {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- }
- res = (u16)(d & 0xFF0F);
- CLEAR_FLAG(F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAD instruction and side effects.
-****************************************************************************/
-u16 aad_word(u16 d)
-{
- u16 l;
- u8 hb, lb;
-
- hb = (u8)((d >> 8) & 0xff);
- lb = (u8)((d & 0xff));
- l = (u16)((lb + 10 * hb) & 0xFF);
-
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(l == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
- return l;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAM instruction and side effects.
-****************************************************************************/
-u16 aam_word(u8 d)
-{
- u16 h, l;
-
- h = (u16)(d / 10);
- l = (u16)(d % 10);
- l |= (u16)(h << 8);
-
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(l == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
- return l;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u8 adc_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- if (ACCESS_FLAG(F_CF))
- res = 1 + d + s;
- else
- res = d + s;
-
- CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u16 adc_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- if (ACCESS_FLAG(F_CF))
- res = 1 + d + s;
- else
- res = d + s;
-
- CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u32 adc_long(u32 d, u32 s)
-{
- register u32 lo; /* all operands in native machine order */
- register u32 hi;
- register u32 res;
- register u32 cc;
-
- if (ACCESS_FLAG(F_CF)) {
- lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
- res = 1 + d + s;
- }
- else {
- lo = (d & 0xFFFF) + (s & 0xFFFF);
- res = d + s;
- }
- hi = (lo >> 16) + (d >> 16) + (s >> 16);
-
- CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u8 add_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- res = d + s;
- CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u16 add_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- res = d + s;
- CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u32 add_long(u32 d, u32 s)
-{
- register u32 lo; /* all operands in native machine order */
- register u32 hi;
- register u32 res;
- register u32 cc;
-
- lo = (d & 0xFFFF) + (s & 0xFFFF);
- res = d + s;
- hi = (lo >> 16) + (d >> 16) + (s >> 16);
-
- CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (s & d) | ((~res) & (s | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u8 and_byte(u8 d, u8 s)
-{
- register u8 res; /* all operands in native machine order */
-
- res = d & s;
-
- /* set the flags */
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u16 and_word(u16 d, u16 s)
-{
- register u16 res; /* all operands in native machine order */
-
- res = d & s;
-
- /* set the flags */
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u32 and_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d & s;
-
- /* set the flags */
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u8 cmp_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CLEAR_FLAG(F_CF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u16 cmp_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u32 cmp_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DAA instruction and side effects.
-****************************************************************************/
-u8 daa_byte(u8 d)
-{
- u32 res = d;
- if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
- res += 6;
- SET_FLAG(F_AF);
- }
- if (res > 0x9F || ACCESS_FLAG(F_CF)) {
- res += 0x60;
- SET_FLAG(F_CF);
- }
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DAS instruction and side effects.
-****************************************************************************/
-u8 das_byte(u8 d)
-{
- if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
- d -= 6;
- SET_FLAG(F_AF);
- }
- if (d > 0x9F || ACCESS_FLAG(F_CF)) {
- d -= 0x60;
- SET_FLAG(F_CF);
- }
- CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(d == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
- return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u8 dec_byte(u8 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - 1;
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- /* based on sub_byte, uses s==1. */
- bc = (res & (~d | 1)) | (~d & 1);
- /* carry flag unchanged */
- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u16 dec_word(u16 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - 1;
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- /* based on the sub_byte routine, with s==1 */
- bc = (res & (~d | 1)) | (~d & 1);
- /* carry flag unchanged */
- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u32 dec_long(u32 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - 1;
-
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | 1)) | (~d & 1);
- /* carry flag unchanged */
- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u8 inc_byte(u8 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- res = d + 1;
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = ((1 & d) | (~res)) & (1 | d);
- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u16 inc_word(u16 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- res = d + 1;
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (1 & d) | ((~res) & (1 | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u32 inc_long(u32 d)
-{
- register u32 res; /* all operands in native machine order */
- register u32 cc;
-
- res = d + 1;
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the carry chain SEE NOTE AT TOP. */
- cc = (1 & d) | ((~res) & (1 | d));
- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u8 or_byte(u8 d, u8 s)
-{
- register u8 res; /* all operands in native machine order */
-
- res = d | s;
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u16 or_word(u16 d, u16 s)
-{
- register u16 res; /* all operands in native machine order */
-
- res = d | s;
- /* set the carry flag to be bit 8 */
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u32 or_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d | s;
-
- /* set the carry flag to be bit 8 */
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u8 neg_byte(u8 s)
-{
- register u8 res;
- register u8 bc;
-
- CONDITIONAL_SET_FLAG(s != 0, F_CF);
- res = (u8)-s;
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
- /* calculate the borrow chain --- modified such that d=0.
- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
- (the one used for sub) and simplifying, since ~d=0xff...,
- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
- ~d&s == s. So the simplified result is: */
- bc = res | s;
- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u16 neg_word(u16 s)
-{
- register u16 res;
- register u16 bc;
-
- CONDITIONAL_SET_FLAG(s != 0, F_CF);
- res = (u16)-s;
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain --- modified such that d=0.
- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
- (the one used for sub) and simplifying, since ~d=0xff...,
- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
- ~d&s == s. So the simplified result is: */
- bc = res | s;
- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u32 neg_long(u32 s)
-{
- register u32 res;
- register u32 bc;
-
- CONDITIONAL_SET_FLAG(s != 0, F_CF);
- res = (u32)-s;
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain --- modified such that d=0.
- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
- (the one used for sub) and simplifying, since ~d=0xff...,
- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
- ~d&s == s. So the simplified result is: */
- bc = res | s;
- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u8 not_byte(u8 s)
-{
- return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u16 not_word(u16 s)
-{
- return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u32 not_long(u32 s)
-{
- return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u8 rcl_byte(u8 d, u8 s)
-{
- register unsigned int res, cnt, mask, cf;
-
- /* s is the rotate distance. It varies from 0 - 8. */
- /* have
-
- CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
-
- want to rotate through the carry by "s" bits. We could
- loop, but that's inefficient. So the width is 9,
- and we split into three parts:
-
- The new carry flag (was B_n)
- the stuff in B_n-1 .. B_0
- the stuff in B_7 .. B_n+1
-
- The new rotate is done mod 9, and given this,
- for a rotation of n bits (mod 9) the new carry flag is
- then located n bits from the MSB. The low part is
- then shifted up cnt bits, and the high part is or'd
- in. Using CAPS for new values, and lowercase for the
- original values, this can be expressed as:
-
- IF n > 0
- 1) CF <- b_(8-n)
- 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0
- 3) B_(n-1) <- cf
- 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1))
- */
- res = d;
- if ((cnt = s % 9) != 0) {
- /* extract the new CARRY FLAG. */
- /* CF <- b_(8-n) */
- cf = (d >> (8 - cnt)) & 0x1;
-
- /* get the low stuff which rotated
- into the range B_7 .. B_cnt */
- /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */
- /* note that the right hand side done by the mask */
- res = (d << cnt) & 0xff;
-
- /* now the high stuff which rotated around
- into the positions B_cnt-2 .. B_0 */
- /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */
- /* shift it downward, 7-(n-2) = 9-n positions.
- and mask off the result before or'ing in.
- */
- mask = (1 << (cnt - 1)) - 1;
- res |= (d >> (9 - cnt)) & mask;
-
- /* if the carry flag was set, or it in. */
- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
- /* B_(n-1) <- cf */
- res |= 1 << (cnt - 1);
- }
- /* set the new carry flag, based on the variable "cf" */
- CONDITIONAL_SET_FLAG(cf, F_CF);
- /* OVERFLOW is set *IFF* cnt==1, then it is the
- xor of CF and the most significant bit. Blecck. */
- /* parenthesized this expression since it appears to
- be causing OF to be misset */
- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
- F_OF);
-
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u16 rcl_word(u16 d, u8 s)
-{
- register unsigned int res, cnt, mask, cf;
-
- res = d;
- if ((cnt = s % 17) != 0) {
- cf = (d >> (16 - cnt)) & 0x1;
- res = (d << cnt) & 0xffff;
- mask = (1 << (cnt - 1)) - 1;
- res |= (d >> (17 - cnt)) & mask;
- if (ACCESS_FLAG(F_CF)) {
- res |= 1 << (cnt - 1);
- }
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
- F_OF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u32 rcl_long(u32 d, u8 s)
-{
- register u32 res, cnt, mask, cf;
-
- res = d;
- if ((cnt = s % 33) != 0) {
- cf = (d >> (32 - cnt)) & 0x1;
- res = (d << cnt) & 0xffffffff;
- mask = (1 << (cnt - 1)) - 1;
- res |= (d >> (33 - cnt)) & mask;
- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
- res |= 1 << (cnt - 1);
- }
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
- F_OF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u8 rcr_byte(u8 d, u8 s)
-{
- u32 res, cnt;
- u32 mask, cf, ocf = 0;
-
- /* rotate right through carry */
- /*
- s is the rotate distance. It varies from 0 - 8.
- d is the byte object rotated.
-
- have
-
- CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
-
- The new rotate is done mod 9, and given this,
- for a rotation of n bits (mod 9) the new carry flag is
- then located n bits from the LSB. The low part is
- then shifted up cnt bits, and the high part is or'd
- in. Using CAPS for new values, and lowercase for the
- original values, this can be expressed as:
-
- IF n > 0
- 1) CF <- b_(n-1)
- 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
- 3) B_(8-n) <- cf
- 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0)
- */
- res = d;
- if ((cnt = s % 9) != 0) {
- /* extract the new CARRY FLAG. */
- /* CF <- b_(n-1) */
- if (cnt == 1) {
- cf = d & 0x1;
- /* note hackery here. Access_flag(..) evaluates to either
- 0 if flag not set
- non-zero if flag is set.
- doing access_flag(..) != 0 casts that into either
- 0..1 in any representation of the flags register
- (i.e. packed bit array or unpacked.)
- */
- ocf = ACCESS_FLAG(F_CF) != 0;
- } else
- cf = (d >> (cnt - 1)) & 0x1;
-
- /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */
- /* note that the right hand side done by the mask
- This is effectively done by shifting the
- object to the right. The result must be masked,
- in case the object came in and was treated
- as a negative number. Needed??? */
-
- mask = (1 << (8 - cnt)) - 1;
- res = (d >> cnt) & mask;
-
- /* now the high stuff which rotated around
- into the positions B_cnt-2 .. B_0 */
- /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */
- /* shift it downward, 7-(n-2) = 9-n positions.
- and mask off the result before or'ing in.
- */
- res |= (d << (9 - cnt));
-
- /* if the carry flag was set, or it in. */
- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
- /* B_(8-n) <- cf */
- res |= 1 << (8 - cnt);
- }
- /* set the new carry flag, based on the variable "cf" */
- CONDITIONAL_SET_FLAG(cf, F_CF);
- /* OVERFLOW is set *IFF* cnt==1, then it is the
- xor of CF and the most significant bit. Blecck. */
- /* parenthesized... */
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
- F_OF);
- }
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u16 rcr_word(u16 d, u8 s)
-{
- u32 res, cnt;
- u32 mask, cf, ocf = 0;
-
- /* rotate right through carry */
- res = d;
- if ((cnt = s % 17) != 0) {
- if (cnt == 1) {
- cf = d & 0x1;
- ocf = ACCESS_FLAG(F_CF) != 0;
- } else
- cf = (d >> (cnt - 1)) & 0x1;
- mask = (1 << (16 - cnt)) - 1;
- res = (d >> cnt) & mask;
- res |= (d << (17 - cnt));
- if (ACCESS_FLAG(F_CF)) {
- res |= 1 << (16 - cnt);
- }
- CONDITIONAL_SET_FLAG(cf, F_CF);
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
- F_OF);
- }
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u32 rcr_long(u32 d, u8 s)
-{
- u32 res, cnt;
- u32 mask, cf, ocf = 0;
-
- /* rotate right through carry */
- res = d;
- if ((cnt = s % 33) != 0) {
- if (cnt == 1) {
- cf = d & 0x1;
- ocf = ACCESS_FLAG(F_CF) != 0;
- } else
- cf = (d >> (cnt - 1)) & 0x1;
- mask = (1 << (32 - cnt)) - 1;
- res = (d >> cnt) & mask;
- if (cnt != 1)
- res |= (d << (33 - cnt));
- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
- res |= 1 << (32 - cnt);
- }
- CONDITIONAL_SET_FLAG(cf, F_CF);
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
- F_OF);
- }
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u8 rol_byte(u8 d, u8 s)
-{
- register unsigned int res, cnt, mask;
-
- /* rotate left */
- /*
- s is the rotate distance. It varies from 0 - 8.
- d is the byte object rotated.
-
- have
-
- CF B_7 ... B_0
-
- The new rotate is done mod 8.
- Much simpler than the "rcl" or "rcr" operations.
-
- IF n > 0
- 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0)
- 2) B_(n-1) .. B_(0) <- b_(7) .. b_(8-n)
- */
- res = d;
- if ((cnt = s % 8) != 0) {
- /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */
- res = (d << cnt);
-
- /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */
- mask = (1 << cnt) - 1;
- res |= (d >> (8 - cnt)) & mask;
-
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- /* OVERFLOW is set *IFF* s==1, then it is the
- xor of CF and the most significant bit. Blecck. */
- CONDITIONAL_SET_FLAG(s == 1 &&
- XOR2((res & 0x1) + ((res >> 6) & 0x2)),
- F_OF);
- } if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u16 rol_word(u16 d, u8 s)
-{
- register unsigned int res, cnt, mask;
-
- res = d;
- if ((cnt = s % 16) != 0) {
- res = (d << cnt);
- mask = (1 << cnt) - 1;
- res |= (d >> (16 - cnt)) & mask;
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- CONDITIONAL_SET_FLAG(s == 1 &&
- XOR2((res & 0x1) + ((res >> 14) & 0x2)),
- F_OF);
- } if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u32 rol_long(u32 d, u8 s)
-{
- register u32 res, cnt, mask;
-
- res = d;
- if ((cnt = s % 32) != 0) {
- res = (d << cnt);
- mask = (1 << cnt) - 1;
- res |= (d >> (32 - cnt)) & mask;
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- CONDITIONAL_SET_FLAG(s == 1 &&
- XOR2((res & 0x1) + ((res >> 30) & 0x2)),
- F_OF);
- } if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u8 ror_byte(u8 d, u8 s)
-{
- register unsigned int res, cnt, mask;
-
- /* rotate right */
- /*
- s is the rotate distance. It varies from 0 - 8.
- d is the byte object rotated.
-
- have
-
- B_7 ... B_0
-
- The rotate is done mod 8.
-
- IF n > 0
- 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
- 2) B_(7) .. B_(8-n) <- b_(n-1) .. b_(0)
- */
- res = d;
- if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */
- /* B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */
- res = (d << (8 - cnt));
-
- /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) */
- mask = (1 << (8 - cnt)) - 1;
- res |= (d >> (cnt)) & mask;
-
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
- /* OVERFLOW is set *IFF* s==1, then it is the
- xor of the two most significant bits. Blecck. */
- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
- } else if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u16 ror_word(u16 d, u8 s)
-{
- register unsigned int res, cnt, mask;
-
- res = d;
- if ((cnt = s % 16) != 0) {
- res = (d << (16 - cnt));
- mask = (1 << (16 - cnt)) - 1;
- res |= (d >> (cnt)) & mask;
- CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
- } else if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u32 ror_long(u32 d, u8 s)
-{
- register u32 res, cnt, mask;
-
- res = d;
- if ((cnt = s % 32) != 0) {
- res = (d << (32 - cnt));
- mask = (1 << (32 - cnt)) - 1;
- res |= (d >> (cnt)) & mask;
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
- } else if (s != 0) {
- /* set the new carry flag, Note that it is the low order
- bit of the result!!! */
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u8 shl_byte(u8 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 8) {
- cnt = s % 8;
-
- /* last bit shifted out goes into carry flag */
- if (cnt > 0) {
- res = d << cnt;
- cf = d & (1 << (8 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = (u8) d;
- }
-
- if (cnt == 1) {
- /* Needs simplification. */
- CONDITIONAL_SET_FLAG(
- (((res & 0x80) == 0x80) ^
- (ACCESS_FLAG(F_CF) != 0)),
- /* was (M.x86.R_FLG&F_CF)==F_CF)), */
- F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u16 shl_word(u16 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 16) {
- cnt = s % 16;
- if (cnt > 0) {
- res = d << cnt;
- cf = d & (1 << (16 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = (u16) d;
- }
-
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(
- (((res & 0x8000) == 0x8000) ^
- (ACCESS_FLAG(F_CF) != 0)),
- F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u32 shl_long(u32 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 32) {
- cnt = s % 32;
- if (cnt > 0) {
- res = d << cnt;
- cf = d & (1 << (32 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
- (ACCESS_FLAG(F_CF) != 0)), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u8 shr_byte(u8 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 8) {
- cnt = s % 8;
- if (cnt > 0) {
- cf = d & (1 << (cnt - 1));
- res = d >> cnt;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = (u8) d;
- }
-
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u16 shr_word(u16 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 16) {
- cnt = s % 16;
- if (cnt > 0) {
- cf = d & (1 << (cnt - 1));
- res = d >> cnt;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
-
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u32 shr_long(u32 d, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 32) {
- cnt = s % 32;
- if (cnt > 0) {
- cf = d & (1 << (cnt - 1));
- res = d >> cnt;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u8 sar_byte(u8 d, u8 s)
-{
- unsigned int cnt, res, cf, mask, sf;
-
- res = d;
- sf = d & 0x80;
- cnt = s % 8;
- if (cnt > 0 && cnt < 8) {
- mask = (1 << (8 - cnt)) - 1;
- cf = d & (1 << (cnt - 1));
- res = (d >> cnt) & mask;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- if (sf) {
- res |= ~mask;
- }
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- } else if (cnt >= 8) {
- if (sf) {
- res = 0xff;
- SET_FLAG(F_CF);
- CLEAR_FLAG(F_ZF);
- SET_FLAG(F_SF);
- SET_FLAG(F_PF);
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- }
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u16 sar_word(u16 d, u8 s)
-{
- unsigned int cnt, res, cf, mask, sf;
-
- sf = d & 0x8000;
- cnt = s % 16;
- res = d;
- if (cnt > 0 && cnt < 16) {
- mask = (1 << (16 - cnt)) - 1;
- cf = d & (1 << (cnt - 1));
- res = (d >> cnt) & mask;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- if (sf) {
- res |= ~mask;
- }
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else if (cnt >= 16) {
- if (sf) {
- res = 0xffff;
- SET_FLAG(F_CF);
- CLEAR_FLAG(F_ZF);
- SET_FLAG(F_SF);
- SET_FLAG(F_PF);
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u32 sar_long(u32 d, u8 s)
-{
- u32 cnt, res, cf, mask, sf;
-
- sf = d & 0x80000000;
- cnt = s % 32;
- res = d;
- if (cnt > 0 && cnt < 32) {
- mask = (1 << (32 - cnt)) - 1;
- cf = d & (1 << (cnt - 1));
- res = (d >> cnt) & mask;
- CONDITIONAL_SET_FLAG(cf, F_CF);
- if (sf) {
- res |= ~mask;
- }
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else if (cnt >= 32) {
- if (sf) {
- res = 0xffffffff;
- SET_FLAG(F_CF);
- CLEAR_FLAG(F_ZF);
- SET_FLAG(F_SF);
- SET_FLAG(F_PF);
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHLD instruction and side effects.
-****************************************************************************/
-u16 shld_word (u16 d, u16 fill, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 16) {
- cnt = s % 16;
- if (cnt > 0) {
- res = (d << cnt) | (fill >> (16-cnt));
- cf = d & (1 << (16 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
- (ACCESS_FLAG(F_CF) != 0)), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHLD instruction and side effects.
-****************************************************************************/
-u32 shld_long (u32 d, u32 fill, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 32) {
- cnt = s % 32;
- if (cnt > 0) {
- res = (d << cnt) | (fill >> (32-cnt));
- cf = d & (1 << (32 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
- (ACCESS_FLAG(F_CF) != 0)), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
- CLEAR_FLAG(F_OF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_PF);
- SET_FLAG(F_ZF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHRD instruction and side effects.
-****************************************************************************/
-u16 shrd_word (u16 d, u16 fill, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 16) {
- cnt = s % 16;
- if (cnt > 0) {
- cf = d & (1 << (cnt - 1));
- res = (d >> cnt) | (fill << (16 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
-
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHRD instruction and side effects.
-****************************************************************************/
-u32 shrd_long (u32 d, u32 fill, u8 s)
-{
- unsigned int cnt, res, cf;
-
- if (s < 32) {
- cnt = s % 32;
- if (cnt > 0) {
- cf = d & (1 << (cnt - 1));
- res = (d >> cnt) | (fill << (32 - cnt));
- CONDITIONAL_SET_FLAG(cf, F_CF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- } else {
- res = d;
- }
- if (cnt == 1) {
- CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
- } else {
- CLEAR_FLAG(F_OF);
- }
- } else {
- res = 0;
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- SET_FLAG(F_ZF);
- CLEAR_FLAG(F_SF);
- CLEAR_FLAG(F_PF);
- }
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u8 sbb_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- if (ACCESS_FLAG(F_CF))
- res = d - s - 1;
- else
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u16 sbb_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- if (ACCESS_FLAG(F_CF))
- res = d - s - 1;
- else
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u32 sbb_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- if (ACCESS_FLAG(F_CF))
- res = d - s - 1;
- else
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u8 sub_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u16 sub_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u32 sub_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
- register u32 bc;
-
- res = d - s;
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
- /* calculate the borrow chain. See note at top */
- bc = (res & (~d | s)) | (~d & s);
- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_byte(u8 d, u8 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d & s;
-
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- /* AF == dont care */
- CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_word(u16 d, u16 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d & s;
-
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- /* AF == dont care */
- CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d & s;
-
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- /* AF == dont care */
- CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u8 xor_byte(u8 d, u8 s)
-{
- register u8 res; /* all operands in native machine order */
-
- res = d ^ s;
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u16 xor_word(u16 d, u16 s)
-{
- register u16 res; /* all operands in native machine order */
-
- res = d ^ s;
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u32 xor_long(u32 d, u32 s)
-{
- register u32 res; /* all operands in native machine order */
-
- res = d ^ s;
- CLEAR_FLAG(F_OF);
- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_byte(u8 s)
-{
- s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
-
- M.x86.R_AX = res;
- if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
- ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_word(u16 s)
-{
- s32 res = (s16)M.x86.R_AX * (s16)s;
-
- M.x86.R_AX = (u16)res;
- M.x86.R_DX = (u16)(res >> 16);
- if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
- ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
-{
-#ifdef __HAS_LONG_LONG__
- s64 res = (s32)d * (s32)s;
-
- *res_lo = (u32)res;
- *res_hi = (u32)(res >> 32);
-#else
- u32 d_lo,d_hi,d_sign;
- u32 s_lo,s_hi,s_sign;
- u32 rlo_lo,rlo_hi,rhi_lo;
-
- if ((d_sign = d & 0x80000000) != 0)
- d = -d;
- d_lo = d & 0xFFFF;
- d_hi = d >> 16;
- if ((s_sign = s & 0x80000000) != 0)
- s = -s;
- s_lo = s & 0xFFFF;
- s_hi = s >> 16;
- rlo_lo = d_lo * s_lo;
- rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
- rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
- *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
- *res_hi = rhi_lo;
- if (d_sign != s_sign) {
- d = ~*res_lo;
- s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
- *res_lo = ~*res_lo+1;
- *res_hi = ~*res_hi+(s >> 16);
- }
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_long(u32 s)
-{
- imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
- if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
- ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_byte(u8 s)
-{
- u16 res = (u16)(M.x86.R_AL * s);
-
- M.x86.R_AX = res;
- if (M.x86.R_AH == 0) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_word(u16 s)
-{
- u32 res = M.x86.R_AX * s;
-
- M.x86.R_AX = (u16)res;
- M.x86.R_DX = (u16)(res >> 16);
- if (M.x86.R_DX == 0) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
- u64 res = (u32)M.x86.R_EAX * (u32)s;
-
- M.x86.R_EAX = (u32)res;
- M.x86.R_EDX = (u32)(res >> 32);
-#else
- u32 a,a_lo,a_hi;
- u32 s_lo,s_hi;
- u32 rlo_lo,rlo_hi,rhi_lo;
-
- a = M.x86.R_EAX;
- a_lo = a & 0xFFFF;
- a_hi = a >> 16;
- s_lo = s & 0xFFFF;
- s_hi = s >> 16;
- rlo_lo = a_lo * s_lo;
- rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
- rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
- M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
- M.x86.R_EDX = rhi_lo;
-#endif
-
- if (M.x86.R_EDX == 0) {
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_OF);
- } else {
- SET_FLAG(F_CF);
- SET_FLAG(F_OF);
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_byte(u8 s)
-{
- s32 dvd, div, mod;
-
- dvd = (s16)M.x86.R_AX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (s8)s;
- mod = dvd % (s8)s;
- if (abs(div) > 0x7f) {
- x86emu_intr_raise(0);
- return;
- }
- M.x86.R_AL = (s8) div;
- M.x86.R_AH = (s8) mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_word(u16 s)
-{
- s32 dvd, div, mod;
-
- dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (s16)s;
- mod = dvd % (s16)s;
- if (abs(div) > 0x7fff) {
- x86emu_intr_raise(0);
- return;
- }
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_SF);
- CONDITIONAL_SET_FLAG(div == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
- M.x86.R_AX = (u16)div;
- M.x86.R_DX = (u16)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
- s64 dvd, div, mod;
-
- dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (s32)s;
- mod = dvd % (s32)s;
- if (abs(div) > 0x7fffffff) {
- x86emu_intr_raise(0);
- return;
- }
-#else
- s32 div = 0, mod;
- s32 h_dvd = M.x86.R_EDX;
- u32 l_dvd = M.x86.R_EAX;
- u32 abs_s = s & 0x7FFFFFFF;
- u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
- u32 h_s = abs_s >> 1;
- u32 l_s = abs_s << 31;
- int counter = 31;
- int carry;
-
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- do {
- div <<= 1;
- carry = (l_dvd >= l_s) ? 0 : 1;
-
- if (abs_h_dvd < (h_s + carry)) {
- h_s >>= 1;
- l_s = abs_s << (--counter);
- continue;
- } else {
- abs_h_dvd -= (h_s + carry);
- l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
- : (l_dvd - l_s);
- h_s >>= 1;
- l_s = abs_s << (--counter);
- div |= 1;
- continue;
- }
-
- } while (counter > -1);
- /* overflow */
- if (abs_h_dvd || (l_dvd > abs_s)) {
- x86emu_intr_raise(0);
- return;
- }
- /* sign */
- div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
- mod = l_dvd;
-
-#endif
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
- M.x86.R_EAX = (u32)div;
- M.x86.R_EDX = (u32)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_byte(u8 s)
-{
- u32 dvd, div, mod;
-
- dvd = M.x86.R_AX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (u8)s;
- mod = dvd % (u8)s;
- if (abs(div) > 0xff) {
- x86emu_intr_raise(0);
- return;
- }
- M.x86.R_AL = (u8)div;
- M.x86.R_AH = (u8)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_word(u16 s)
-{
- u32 dvd, div, mod;
-
- dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (u16)s;
- mod = dvd % (u16)s;
- if (abs(div) > 0xffff) {
- x86emu_intr_raise(0);
- return;
- }
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_SF);
- CONDITIONAL_SET_FLAG(div == 0, F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
- M.x86.R_AX = (u16)div;
- M.x86.R_DX = (u16)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
- u64 dvd, div, mod;
-
- dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- div = dvd / (u32)s;
- mod = dvd % (u32)s;
- if (abs(div) > 0xffffffff) {
- x86emu_intr_raise(0);
- return;
- }
-#else
- s32 div = 0, mod;
- s32 h_dvd = M.x86.R_EDX;
- u32 l_dvd = M.x86.R_EAX;
-
- u32 h_s = s;
- u32 l_s = 0;
- int counter = 32;
- int carry;
-
- if (s == 0) {
- x86emu_intr_raise(0);
- return;
- }
- do {
- div <<= 1;
- carry = (l_dvd >= l_s) ? 0 : 1;
-
- if (h_dvd < (h_s + carry)) {
- h_s >>= 1;
- l_s = s << (--counter);
- continue;
- } else {
- h_dvd -= (h_s + carry);
- l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
- : (l_dvd - l_s);
- h_s >>= 1;
- l_s = s << (--counter);
- div |= 1;
- continue;
- }
-
- } while (counter > -1);
- /* overflow */
- if (h_dvd || (l_dvd > s)) {
- x86emu_intr_raise(0);
- return;
- }
- mod = l_dvd;
-#endif
- CLEAR_FLAG(F_CF);
- CLEAR_FLAG(F_AF);
- CLEAR_FLAG(F_SF);
- SET_FLAG(F_ZF);
- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
- M.x86.R_EAX = (u32)div;
- M.x86.R_EDX = (u32)mod;
-}
-
-#endif /* __HAVE_INLINE_ASSEMBLER__ */
-
-/****************************************************************************
-REMARKS:
-Implements the IN string instruction and side effects.
-****************************************************************************/
-void ins(int size)
-{
- int inc = size;
-
- if (ACCESS_FLAG(F_DF)) {
- inc = -size;
- }
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* in until CX is ZERO. */
- u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
- M.x86.R_ECX : M.x86.R_CX);
- switch (size) {
- case 1:
- while (count--) {
- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inb)(M.x86.R_DX));
- M.x86.R_DI += inc;
- }
- break;
-
- case 2:
- while (count--) {
- store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inw)(M.x86.R_DX));
- M.x86.R_DI += inc;
- }
- break;
- case 4:
- while (count--) {
- store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inl)(M.x86.R_DX));
- M.x86.R_DI += inc;
- break;
- }
- }
- M.x86.R_CX = 0;
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = 0;
- }
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- } else {
- switch (size) {
- case 1:
- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inb)(M.x86.R_DX));
- break;
- case 2:
- store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inw)(M.x86.R_DX));
- break;
- case 4:
- store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
- (*sys_inl)(M.x86.R_DX));
- break;
- }
- M.x86.R_DI += inc;
- }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OUT string instruction and side effects.
-****************************************************************************/
-void outs(int size)
-{
- int inc = size;
-
- if (ACCESS_FLAG(F_DF)) {
- inc = -size;
- }
- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
- /* dont care whether REPE or REPNE */
- /* out until CX is ZERO. */
- u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
- M.x86.R_ECX : M.x86.R_CX);
- switch (size) {
- case 1:
- while (count--) {
- (*sys_outb)(M.x86.R_DX,
- fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
- M.x86.R_SI += inc;
- }
- break;
-
- case 2:
- while (count--) {
- (*sys_outw)(M.x86.R_DX,
- fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
- M.x86.R_SI += inc;
- }
- break;
- case 4:
- while (count--) {
- (*sys_outl)(M.x86.R_DX,
- fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
- M.x86.R_SI += inc;
- break;
- }
- }
- M.x86.R_CX = 0;
- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- M.x86.R_ECX = 0;
- }
- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
- } else {
- switch (size) {
- case 1:
- (*sys_outb)(M.x86.R_DX,
- fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
- break;
- case 2:
- (*sys_outw)(M.x86.R_DX,
- fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
- break;
- case 4:
- (*sys_outl)(M.x86.R_DX,
- fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
- break;
- }
- M.x86.R_SI += inc;
- }
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Address to fetch word from
-
-REMARKS:
-Fetches a word from emulator memory using an absolute address.
-****************************************************************************/
-u16 mem_access_word(int addr)
-{
-DB( if (CHECK_MEM_ACCESS())
- x86emu_check_mem_access(addr);)
- return (*sys_rdw)(addr);
-}
-
-/****************************************************************************
-REMARKS:
-Pushes a word onto the stack.
-
-NOTE: Do not inline this, as (*sys_wrX) is already inline!
-****************************************************************************/
-void push_word(u16 w)
-{
-DB( if (CHECK_SP_ACCESS())
- x86emu_check_sp_access();)
- M.x86.R_SP -= 2;
- (*sys_wrw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
-}
-
-/****************************************************************************
-REMARKS:
-Pushes a long onto the stack.
-
-NOTE: Do not inline this, as (*sys_wrX) is already inline!
-****************************************************************************/
-void push_long(u32 w)
-{
-DB( if (CHECK_SP_ACCESS())
- x86emu_check_sp_access();)
- M.x86.R_SP -= 4;
- (*sys_wrl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
-}
-
-/****************************************************************************
-REMARKS:
-Pops a word from the stack.
-
-NOTE: Do not inline this, as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 pop_word(void)
-{
- register u16 res;
-
-DB( if (CHECK_SP_ACCESS())
- x86emu_check_sp_access();)
- res = (*sys_rdw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
- M.x86.R_SP += 2;
- return res;
-}
-
-/****************************************************************************
-REMARKS:
-Pops a long from the stack.
-
-NOTE: Do not inline this, as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 pop_long(void)
-{
- register u32 res;
-
-DB( if (CHECK_SP_ACCESS())
- x86emu_check_sp_access();)
- res = (*sys_rdl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
- M.x86.R_SP += 4;
- return res;
-}
-
-#ifdef __HAVE_INLINE_ASSEMBLER__
-
-u16 aaa_word (u16 d)
-{ return aaa_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aas_word (u16 d)
-{ return aas_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aad_word (u16 d)
-{ return aad_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aam_word (u8 d)
-{ return aam_word_asm(&M.x86.R_EFLG,d); }
-
-u8 adc_byte (u8 d, u8 s)
-{ return adc_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 adc_word (u16 d, u16 s)
-{ return adc_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 adc_long (u32 d, u32 s)
-{ return adc_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 add_byte (u8 d, u8 s)
-{ return add_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 add_word (u16 d, u16 s)
-{ return add_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 add_long (u32 d, u32 s)
-{ return add_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 and_byte (u8 d, u8 s)
-{ return and_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 and_word (u16 d, u16 s)
-{ return and_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 and_long (u32 d, u32 s)
-{ return and_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 cmp_byte (u8 d, u8 s)
-{ return cmp_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 cmp_word (u16 d, u16 s)
-{ return cmp_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 cmp_long (u32 d, u32 s)
-{ return cmp_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 daa_byte (u8 d)
-{ return daa_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 das_byte (u8 d)
-{ return das_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 dec_byte (u8 d)
-{ return dec_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 dec_word (u16 d)
-{ return dec_word_asm(&M.x86.R_EFLG,d); }
-
-u32 dec_long (u32 d)
-{ return dec_long_asm(&M.x86.R_EFLG,d); }
-
-u8 inc_byte (u8 d)
-{ return inc_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 inc_word (u16 d)
-{ return inc_word_asm(&M.x86.R_EFLG,d); }
-
-u32 inc_long (u32 d)
-{ return inc_long_asm(&M.x86.R_EFLG,d); }
-
-u8 or_byte (u8 d, u8 s)
-{ return or_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 or_word (u16 d, u16 s)
-{ return or_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 or_long (u32 d, u32 s)
-{ return or_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 neg_byte (u8 s)
-{ return neg_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 neg_word (u16 s)
-{ return neg_word_asm(&M.x86.R_EFLG,s); }
-
-u32 neg_long (u32 s)
-{ return neg_long_asm(&M.x86.R_EFLG,s); }
-
-u8 not_byte (u8 s)
-{ return not_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 not_word (u16 s)
-{ return not_word_asm(&M.x86.R_EFLG,s); }
-
-u32 not_long (u32 s)
-{ return not_long_asm(&M.x86.R_EFLG,s); }
-
-u8 rcl_byte (u8 d, u8 s)
-{ return rcl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcl_word (u16 d, u8 s)
-{ return rcl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcl_long (u32 d, u8 s)
-{ return rcl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rcr_byte (u8 d, u8 s)
-{ return rcr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcr_word (u16 d, u8 s)
-{ return rcr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcr_long (u32 d, u8 s)
-{ return rcr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rol_byte (u8 d, u8 s)
-{ return rol_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rol_word (u16 d, u8 s)
-{ return rol_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rol_long (u32 d, u8 s)
-{ return rol_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 ror_byte (u8 d, u8 s)
-{ return ror_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 ror_word (u16 d, u8 s)
-{ return ror_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 ror_long (u32 d, u8 s)
-{ return ror_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shl_byte (u8 d, u8 s)
-{ return shl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shl_word (u16 d, u8 s)
-{ return shl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shl_long (u32 d, u8 s)
-{ return shl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shr_byte (u8 d, u8 s)
-{ return shr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shr_word (u16 d, u8 s)
-{ return shr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shr_long (u32 d, u8 s)
-{ return shr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sar_byte (u8 d, u8 s)
-{ return sar_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sar_word (u16 d, u8 s)
-{ return sar_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sar_long (u32 d, u8 s)
-{ return sar_long_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shld_word (u16 d, u16 fill, u8 s)
-{ return shld_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shld_long (u32 d, u32 fill, u8 s)
-{ return shld_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u16 shrd_word (u16 d, u16 fill, u8 s)
-{ return shrd_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shrd_long (u32 d, u32 fill, u8 s)
-{ return shrd_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u8 sbb_byte (u8 d, u8 s)
-{ return sbb_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sbb_word (u16 d, u16 s)
-{ return sbb_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sbb_long (u32 d, u32 s)
-{ return sbb_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sub_byte (u8 d, u8 s)
-{ return sub_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sub_word (u16 d, u16 s)
-{ return sub_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sub_long (u32 d, u32 s)
-{ return sub_long_asm(&M.x86.R_EFLG,d,s); }
-
-void test_byte (u8 d, u8 s)
-{ test_byte_asm(&M.x86.R_EFLG,d,s); }
-
-void test_word (u16 d, u16 s)
-{ test_word_asm(&M.x86.R_EFLG,d,s); }
-
-void test_long (u32 d, u32 s)
-{ test_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 xor_byte (u8 d, u8 s)
-{ return xor_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 xor_word (u16 d, u16 s)
-{ return xor_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 xor_long (u32 d, u32 s)
-{ return xor_long_asm(&M.x86.R_EFLG,d,s); }
-
-void imul_byte (u8 s)
-{ imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void imul_word (u16 s)
-{ imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void imul_long (u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s); }
-
-void mul_byte (u8 s)
-{ mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void mul_word (u16 s)
-{ mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void mul_long (u32 s)
-{ mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void idiv_byte (u8 s)
-{ idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void idiv_word (u16 s)
-{ idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void idiv_long (u32 s)
-{ idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-void div_byte (u8 s)
-{ div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void div_word (u16 s)
-{ div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void div_long (u32 s)
-{ div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-#endif
diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c
deleted file mode 100644
index d493ae837..000000000
--- a/hw/xfree86/x86emu/sys.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: This file includes subroutines which are related to
-* programmed I/O and memory access. Included in this module
-* are default functions with limited usefulness. For real
-* uses these functions will most likely be overriden by the
-* user library.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/sys.c,v 1.7 2002/12/24 17:42:58 tsi Exp $ */
-
-#include "x86emu.h"
-#include "x86emu/x86emui.h"
-#include "x86emu/regs.h"
-#include "x86emu/debug.h"
-#include "x86emu/prim_ops.h"
-#ifdef IN_MODULE
-#include "xf86_ansic.h"
-#else
-#include <string.h>
-#endif
-/*------------------------- Global Variables ------------------------------*/
-
-X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */
-X86EMU_intrFuncs _X86EMU_intrTab[256];
-
-/*----------------------------- Implementation ----------------------------*/
-#if defined(__alpha__) || defined(__alpha)
-/* to cope with broken egcs-1.1.2 :-(((( */
-
-/*
- * inline functions to do unaligned accesses
- * from linux/include/asm-alpha/unaligned.h
- */
-
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads. Define some
- * packed structures to talk about such things with.
- */
-
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
-struct __una_u64 { unsigned long x __attribute__((packed)); };
-struct __una_u32 { unsigned int x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-#endif
-
-static __inline__ unsigned long ldq_u(unsigned long * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
- return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extql %0,%2,%0\n\t"
- "extqh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(7+(char *) r11)));
- return r1 | r2;
-#endif
-}
-
-static __inline__ unsigned long ldl_u(unsigned int * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
- return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extll %0,%2,%0\n\t"
- "extlh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(3+(char *) r11)));
- return r1 | r2;
-#endif
-}
-
-static __inline__ unsigned long ldw_u(unsigned short * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
- return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extwl %0,%2,%0\n\t"
- "extwh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(1+(char *) r11)));
- return r1 | r2;
-#endif
-}
-
-/*
- * Elemental unaligned stores
- */
-
-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u64 *ptr = (struct __una_u64 *) r11;
- ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "insqh %6,%7,%5\n\t"
- "insql %6,%7,%4\n\t"
- "mskqh %3,%7,%3\n\t"
- "mskql %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(7+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
-}
-
-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u32 *ptr = (struct __una_u32 *) r11;
- ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inslh %6,%7,%5\n\t"
- "insll %6,%7,%4\n\t"
- "msklh %3,%7,%3\n\t"
- "mskll %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(3+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
-}
-
-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
-{
-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
- struct __una_u16 *ptr = (struct __una_u16 *) r11;
- ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inswh %6,%7,%5\n\t"
- "inswl %6,%7,%4\n\t"
- "mskwh %3,%7,%3\n\t"
- "mskwl %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(1+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
-}
-#endif
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-
-RETURNS:
-Byte value read from emulator memory.
-
-REMARKS:
-Reads a byte value from the emulator memory.
-****************************************************************************/
-u8 X86API rdb(
- u32 addr)
-{
- u8 val;
-
- if (addr > M.mem_size - 1) {
- DB(printk("mem_read: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
- val = *(u8*)(M.mem_base + addr);
-DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 1 -> %#x\n", addr, val);)
- return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-
-RETURNS:
-Word value read from emulator memory.
-
-REMARKS:
-Reads a word value from the emulator memory.
-****************************************************************************/
-u16 X86API rdw(
- u32 addr)
-{
- u16 val = 0;
-
- if (addr > M.mem_size - 2) {
- DB(printk("mem_read: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
-#ifdef __BIG_ENDIAN__
- if (addr & 0x1) {
- val = (*(u8*)(M.mem_base + addr) |
- (*(u8*)(M.mem_base + addr + 1) << 8));
- }
- else
-#endif
-#if defined(__alpha__) || defined(__alpha)
- val = ldw_u((u16*)(M.mem_base + addr));
-#else
- val = *(u16*)(M.mem_base + addr);
-#endif
- DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 2 -> %#x\n", addr, val);)
- return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-
-RETURNS:
-Long value read from emulator memory.
-REMARKS:
-Reads a long value from the emulator memory.
-****************************************************************************/
-u32 X86API rdl(
- u32 addr)
-{
- u32 val = 0;
-
- if (addr > M.mem_size - 4) {
- DB(printk("mem_read: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
-#ifdef __BIG_ENDIAN__
- if (addr & 0x3) {
- val = (*(u8*)(M.mem_base + addr + 0) |
- (*(u8*)(M.mem_base + addr + 1) << 8) |
- (*(u8*)(M.mem_base + addr + 2) << 16) |
- (*(u8*)(M.mem_base + addr + 3) << 24));
- }
- else
-#endif
-#if defined(__alpha__) || defined(__alpha)
- val = ldl_u((u32*)(M.mem_base + addr));
-#else
- val = *(u32*)(M.mem_base + addr);
-#endif
-DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 4 -> %#x\n", addr, val);)
- return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-val - Value to store
-
-REMARKS:
-Writes a byte value to emulator memory.
-****************************************************************************/
-void X86API wrb(
- u32 addr,
- u8 val)
-{
-DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 1 <- %#x\n", addr, val);)
- if (addr > M.mem_size - 1) {
- DB(printk("mem_write: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
- *(u8*)(M.mem_base + addr) = val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-val - Value to store
-
-REMARKS:
-Writes a word value to emulator memory.
-****************************************************************************/
-void X86API wrw(
- u32 addr,
- u16 val)
-{
-DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 2 <- %#x\n", addr, val);)
- if (addr > M.mem_size - 2) {
- DB(printk("mem_write: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
-#ifdef __BIG_ENDIAN__
- if (addr & 0x1) {
- *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
- *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
- }
- else
-#endif
-#if defined(__alpha__) || defined(__alpha)
- stw_u(val,(u16*)(M.mem_base + addr));
-#else
- *(u16*)(M.mem_base + addr) = val;
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - Emulator memory address to read
-val - Value to store
-
-REMARKS:
-Writes a long value to emulator memory.
-****************************************************************************/
-void X86API wrl(
- u32 addr,
- u32 val)
-{
-DB( if (DEBUG_MEM_TRACE())
- printk("%#08x 4 <- %#x\n", addr, val);)
- if (addr > M.mem_size - 4) {
- DB(printk("mem_write: address %#lx out of range!\n", addr);)
- HALT_SYS();
- }
-#ifdef __BIG_ENDIAN__
- if (addr & 0x1) {
- *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
- *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
- *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
- *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
- }
- else
-#endif
-#if defined(__alpha__) || defined(__alpha)
- stl_u(val,(u32*)(M.mem_base + addr));
-#else
- *(u32*)(M.mem_base + addr) = val;
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO byte read function. Doesn't perform real inb.
-****************************************************************************/
-static u8 X86API p_inb(
- X86EMU_pioAddr addr)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("inb %#04x \n", addr);)
- return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO word read function. Doesn't perform real inw.
-****************************************************************************/
-static u16 X86API p_inw(
- X86EMU_pioAddr addr)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("inw %#04x \n", addr);)
- return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO long read function. Doesn't perform real inl.
-****************************************************************************/
-static u32 X86API p_inl(
- X86EMU_pioAddr addr)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("inl %#04x \n", addr);)
- return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to write
-val - Value to store
-REMARKS:
-Default PIO byte write function. Doesn't perform real outb.
-****************************************************************************/
-static void X86API p_outb(
- X86EMU_pioAddr addr,
- u8 val)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("outb %#02x -> %#04x \n", val, addr);)
- return;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to write
-val - Value to store
-REMARKS:
-Default PIO word write function. Doesn't perform real outw.
-****************************************************************************/
-static void X86API p_outw(
- X86EMU_pioAddr addr,
- u16 val)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("outw %#04x -> %#04x \n", val, addr);)
- return;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr - PIO address to write
-val - Value to store
-REMARKS:
-Default PIO ;ong write function. Doesn't perform real outl.
-****************************************************************************/
-static void X86API p_outl(
- X86EMU_pioAddr addr,
- u32 val)
-{
-DB( if (DEBUG_IO_TRACE())
- printk("outl %#08x -> %#04x \n", val, addr);)
- return;
-}
-
-/*------------------------- Global Variables ------------------------------*/
-
-u8 (X86APIP sys_rdb)(u32 addr) = rdb;
-u16 (X86APIP sys_rdw)(u32 addr) = rdw;
-u32 (X86APIP sys_rdl)(u32 addr) = rdl;
-void (X86APIP sys_wrb)(u32 addr,u8 val) = wrb;
-void (X86APIP sys_wrw)(u32 addr,u16 val) = wrw;
-void (X86APIP sys_wrl)(u32 addr,u32 val) = wrl;
-u8 (X86APIP sys_inb)(X86EMU_pioAddr addr) = p_inb;
-u16 (X86APIP sys_inw)(X86EMU_pioAddr addr) = p_inw;
-u32 (X86APIP sys_inl)(X86EMU_pioAddr addr) = p_inl;
-void (X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val) = p_outb;
-void (X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val) = p_outw;
-void (X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val) = p_outl;
-
-/*----------------------------- Setup -------------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-funcs - New memory function pointers to make active
-
-REMARKS:
-This function is used to set the pointers to functions which access
-memory space, allowing the user application to override these functions
-and hook them out as necessary for their application.
-****************************************************************************/
-void X86EMU_setupMemFuncs(
- X86EMU_memFuncs *funcs)
-{
- sys_rdb = funcs->rdb;
- sys_rdw = funcs->rdw;
- sys_rdl = funcs->rdl;
- sys_wrb = funcs->wrb;
- sys_wrw = funcs->wrw;
- sys_wrl = funcs->wrl;
-}
-
-/****************************************************************************
-PARAMETERS:
-funcs - New programmed I/O function pointers to make active
-
-REMARKS:
-This function is used to set the pointers to functions which access
-I/O space, allowing the user application to override these functions
-and hook them out as necessary for their application.
-****************************************************************************/
-void X86EMU_setupPioFuncs(
- X86EMU_pioFuncs *funcs)
-{
- sys_inb = funcs->inb;
- sys_inw = funcs->inw;
- sys_inl = funcs->inl;
- sys_outb = funcs->outb;
- sys_outw = funcs->outw;
- sys_outl = funcs->outl;
-}
-
-/****************************************************************************
-PARAMETERS:
-funcs - New interrupt vector table to make active
-
-REMARKS:
-This function is used to set the pointers to functions which handle
-interrupt processing in the emulator, allowing the user application to
-hook interrupts as necessary for their application. Any interrupts that
-are not hooked by the user application, and reflected and handled internally
-in the emulator via the interrupt vector table. This allows the application
-to get control when the code being emulated executes specific software
-interrupts.
-****************************************************************************/
-void X86EMU_setupIntrFuncs(
- X86EMU_intrFuncs funcs[])
-{
- int i;
-
- for (i=0; i < 256; i++)
- _X86EMU_intrTab[i] = NULL;
- if (funcs) {
- for (i = 0; i < 256; i++)
- _X86EMU_intrTab[i] = funcs[i];
- }
-}
-
-/****************************************************************************
-PARAMETERS:
-int - New software interrupt to prepare for
-
-REMARKS:
-This function is used to set up the emulator state to exceute a software
-interrupt. This can be used by the user application code to allow an
-interrupt to be hooked, examined and then reflected back to the emulator
-so that the code in the emulator will continue processing the software
-interrupt as per normal. This essentially allows system code to actively
-hook and handle certain software interrupts as necessary.
-****************************************************************************/
-void X86EMU_prepareForInt(
- int num)
-{
- push_word((u16)M.x86.R_FLG);
- CLEAR_FLAG(F_IF);
- CLEAR_FLAG(F_TF);
- push_word(M.x86.R_CS);
- M.x86.R_CS = mem_access_word(num * 4 + 2);
- push_word(M.x86.R_IP);
- M.x86.R_IP = mem_access_word(num * 4);
- M.x86.intr = 0;
-}
diff --git a/hw/xfree86/x86emu/validate.c b/hw/xfree86/x86emu/validate.c
deleted file mode 100644
index 239f6c1f3..000000000
--- a/hw/xfree86/x86emu/validate.c
+++ /dev/null
@@ -1,765 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: Watcom C 10.6 or later
-* Environment: 32-bit DOS
-* Developer: Kendall Bennett
-*
-* Description: Program to validate the x86 emulator library for
-* correctness. We run the emulator primitive operations
-* functions against the real x86 CPU, and compare the result
-* and flags to ensure correctness.
-*
-* We use inline assembler to compile and build this program.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include "x86emu.h"
-#include "x86emu/prim_asm.h"
-
-/*-------------------------- Implementation -------------------------------*/
-
-#define true 1
-#define false 0
-
-#define ALL_FLAGS (F_CF | F_PF | F_AF | F_ZF | F_SF | F_OF)
-
-#define VAL_START_BINARY(parm_type,res_type,dmax,smax,dincr,sincr) \
-{ \
- parm_type d,s; \
- res_type r,r_asm; \
- ulong flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < dmax; d += dincr) { \
- for (s = 0; s < smax; s += sincr) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_BINARY(name) \
- r_asm = name##_asm(&flags,d,s); \
- r = name(d,s); \
- if (r != r_asm || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) {
-
-#define VAL_TEST_BINARY_VOID(name) \
- name##_asm(&flags,d,s); \
- name(d,s); \
- r = r_asm = 0; \
- if (M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) {
-
-#define VAL_FAIL_BYTE_BYTE_BINARY(name) \
- if (failed) \
- printk("fail\n"); \
- printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
- r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_WORD_WORD_BINARY(name) \
- if (failed) \
- printk("fail\n"); \
- printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
- r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_LONG_BINARY(name) \
- if (failed) \
- printk("fail\n"); \
- printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
- r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_BINARY() \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_BYTE_BYTE_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_BYTE_BYTE_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_WORD_WORD_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_WORD_WORD_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_LONG_LONG_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_LONG_LONG_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_VOID_BYTE_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \
- VAL_TEST_BINARY_VOID(name) \
- VAL_FAIL_BYTE_BYTE_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_VOID_WORD_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
- VAL_TEST_BINARY_VOID(name) \
- VAL_FAIL_WORD_WORD_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_VOID_LONG_BINARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
- VAL_TEST_BINARY_VOID(name) \
- VAL_FAIL_LONG_LONG_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_BYTE_ROTATE(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u8,u8,0xFF,8,1,1) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_BYTE_BYTE_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_WORD_ROTATE(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u16,u16,0xFF00,16,0x100,1) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_WORD_WORD_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_LONG_ROTATE(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_BINARY(u32,u32,0xFF000000,32,0x1000000,1) \
- VAL_TEST_BINARY(name) \
- VAL_FAIL_LONG_LONG_BINARY(name) \
- VAL_END_BINARY()
-
-#define VAL_START_TERNARY(parm_type,res_type,dmax,smax,dincr,sincr,maxshift)\
-{ \
- parm_type d,s; \
- res_type r,r_asm; \
- u8 shift; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < dmax; d += dincr) { \
- for (s = 0; s < smax; s += sincr) { \
- for (shift = 0; shift < maxshift; shift += 1) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_TERNARY(name) \
- r_asm = name##_asm(&flags,d,s,shift); \
- r = name(d,s,shift); \
- if (r != r_asm || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) {
-
-#define VAL_FAIL_WORD_WORD_TERNARY(name) \
- if (failed) \
- printk("fail\n"); \
- printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \
- r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_LONG_TERNARY(name) \
- if (failed) \
- printk("fail\n"); \
- printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \
- r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_TERNARY() \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_WORD_ROTATE_DBL(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_TERNARY(u16,u16,0xFF00,0xFF00,0x100,0x100,16) \
- VAL_TEST_TERNARY(name) \
- VAL_FAIL_WORD_WORD_TERNARY(name) \
- VAL_END_TERNARY()
-
-#define VAL_LONG_ROTATE_DBL(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_TERNARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000,32) \
- VAL_TEST_TERNARY(name) \
- VAL_FAIL_LONG_LONG_TERNARY(name) \
- VAL_END_TERNARY()
-
-#define VAL_START_UNARY(parm_type,max,incr) \
-{ \
- parm_type d,r,r_asm; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < max; d += incr) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_UNARY(name) \
- r_asm = name##_asm(&flags,d); \
- r = name(d); \
- if (r != r_asm || M.x86.R_EFLG != flags) { \
- failed = true;
-
-#define VAL_FAIL_BYTE_UNARY(name) \
- printk("fail\n"); \
- printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \
- r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_WORD_UNARY(name) \
- printk("fail\n"); \
- printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \
- r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_UNARY(name) \
- printk("fail\n"); \
- printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \
- r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_UNARY() \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | ALL_FLAGS; \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_BYTE_UNARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_UNARY(u8,0xFF,0x1) \
- VAL_TEST_UNARY(name) \
- VAL_FAIL_BYTE_UNARY(name) \
- VAL_END_UNARY()
-
-#define VAL_WORD_UNARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_UNARY(u16,0xFF00,0x100) \
- VAL_TEST_UNARY(name) \
- VAL_FAIL_WORD_UNARY(name) \
- VAL_END_UNARY()
-
-#define VAL_WORD_BYTE_UNARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_UNARY(u16,0xFF,0x1) \
- VAL_TEST_UNARY(name) \
- VAL_FAIL_WORD_UNARY(name) \
- VAL_END_UNARY()
-
-#define VAL_LONG_UNARY(name) \
- printk("Validating %s ... ", #name); \
- VAL_START_UNARY(u32,0xFF000000,0x1000000) \
- VAL_TEST_UNARY(name) \
- VAL_FAIL_LONG_UNARY(name) \
- VAL_END_UNARY()
-
-#define VAL_BYTE_MUL(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u8 d,s; \
- u16 r,r_asm; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF; d += 1) { \
- for (s = 0; s < 0xFF; s += 1) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- name##_asm(&flags,&r_asm,d,s); \
- M.x86.R_AL = d; \
- name(s); \
- r = M.x86.R_AX; \
- if (r != r_asm || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
- r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
- r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_WORD_MUL(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u16 d,s; \
- u16 r_lo,r_asm_lo; \
- u16 r_hi,r_asm_hi; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF00; d += 0x100) { \
- for (s = 0; s < 0xFF00; s += 0x100) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \
- M.x86.R_AX = d; \
- name(s); \
- r_lo = M.x86.R_AX; \
- r_hi = M.x86.R_DX; \
- if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
- r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
- r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_LONG_MUL(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u32 d,s; \
- u32 r_lo,r_asm_lo; \
- u32 r_hi,r_asm_hi; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF000000; d += 0x1000000) { \
- for (s = 0; s < 0xFF000000; s += 0x1000000) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \
- M.x86.R_EAX = d; \
- name(s); \
- r_lo = M.x86.R_EAX; \
- r_hi = M.x86.R_EDX; \
- if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
- r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
- r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_BYTE_DIV(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u16 d,s; \
- u8 r_quot,r_rem,r_asm_quot,r_asm_rem; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF00; d += 0x100) { \
- for (s = 1; s < 0xFF; s += 1) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- M.x86.intr = 0; \
- M.x86.R_AX = d; \
- name(s); \
- r_quot = M.x86.R_AL; \
- r_rem = M.x86.R_AH; \
- if (M.x86.intr & INTR_SYNCH) \
- continue; \
- name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,s); \
- if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \
- r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \
- r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_WORD_DIV(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u32 d,s; \
- u16 r_quot,r_rem,r_asm_quot,r_asm_rem; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF000000; d += 0x1000000) { \
- for (s = 0x100; s < 0xFF00; s += 0x100) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- M.x86.intr = 0; \
- M.x86.R_AX = d & 0xFFFF; \
- M.x86.R_DX = d >> 16; \
- name(s); \
- r_quot = M.x86.R_AX; \
- r_rem = M.x86.R_DX; \
- if (M.x86.intr & INTR_SYNCH) \
- continue; \
- name##_asm(&flags,&r_asm_quot,&r_asm_rem,d & 0xFFFF,d >> 16,s);\
- if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \
- r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \
- r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-#define VAL_LONG_DIV(name) \
- printk("Validating %s ... ", #name); \
-{ \
- u32 d,s; \
- u32 r_quot,r_rem,r_asm_quot,r_asm_rem; \
- u32 flags,inflags; \
- int f,failed = false; \
- char buf1[80],buf2[80]; \
- for (d = 0; d < 0xFF000000; d += 0x1000000) { \
- for (s = 0x100; s < 0xFF00; s += 0x100) { \
- M.x86.R_EFLG = inflags = flags = def_flags; \
- for (f = 0; f < 2; f++) { \
- M.x86.intr = 0; \
- M.x86.R_EAX = d; \
- M.x86.R_EDX = 0; \
- name(s); \
- r_quot = M.x86.R_EAX; \
- r_rem = M.x86.R_EDX; \
- if (M.x86.intr & INTR_SYNCH) \
- continue; \
- name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,0,s); \
- if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
- failed = true; \
- if (failed || trace) { \
- if (failed) \
- printk("fail\n"); \
- printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \
- r_quot, r_rem, #name, 0, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
- printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \
- r_asm_quot, r_asm_rem, #name"_asm", 0, d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
- } \
- M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (failed) \
- break; \
- } \
- if (!failed) \
- printk("passed\n"); \
-}
-
-void printk(const char *fmt, ...)
-{
- va_list argptr;
- va_start(argptr, fmt);
- vfprintf(stdout, fmt, argptr);
- fflush(stdout);
- va_end(argptr);
-}
-
-char * print_flags(char *buf,ulong flags)
-{
- char *separator = "";
-
- buf[0] = 0;
- if (flags & F_CF) {
- strcat(buf,separator);
- strcat(buf,"CF");
- separator = ",";
- }
- if (flags & F_PF) {
- strcat(buf,separator);
- strcat(buf,"PF");
- separator = ",";
- }
- if (flags & F_AF) {
- strcat(buf,separator);
- strcat(buf,"AF");
- separator = ",";
- }
- if (flags & F_ZF) {
- strcat(buf,separator);
- strcat(buf,"ZF");
- separator = ",";
- }
- if (flags & F_SF) {
- strcat(buf,separator);
- strcat(buf,"SF");
- separator = ",";
- }
- if (flags & F_OF) {
- strcat(buf,separator);
- strcat(buf,"OF");
- separator = ",";
- }
- if (separator[0] == 0)
- strcpy(buf,"None");
- return buf;
-}
-
-int main(int argc)
-{
- ulong def_flags;
- int trace = false;
-
- if (argc > 1)
- trace = true;
- memset(&M, 0, sizeof(M));
- def_flags = get_flags_asm() & ~ALL_FLAGS;
-
- VAL_WORD_UNARY(aaa_word);
- VAL_WORD_UNARY(aas_word);
-
- VAL_WORD_UNARY(aad_word);
- VAL_WORD_UNARY(aam_word);
-
- VAL_BYTE_BYTE_BINARY(adc_byte);
- VAL_WORD_WORD_BINARY(adc_word);
- VAL_LONG_LONG_BINARY(adc_long);
-
- VAL_BYTE_BYTE_BINARY(add_byte);
- VAL_WORD_WORD_BINARY(add_word);
- VAL_LONG_LONG_BINARY(add_long);
-
- VAL_BYTE_BYTE_BINARY(and_byte);
- VAL_WORD_WORD_BINARY(and_word);
- VAL_LONG_LONG_BINARY(and_long);
-
- VAL_BYTE_BYTE_BINARY(cmp_byte);
- VAL_WORD_WORD_BINARY(cmp_word);
- VAL_LONG_LONG_BINARY(cmp_long);
-
- VAL_BYTE_UNARY(daa_byte);
- VAL_BYTE_UNARY(das_byte); // Fails for 0x9A (out of range anyway)
-
- VAL_BYTE_UNARY(dec_byte);
- VAL_WORD_UNARY(dec_word);
- VAL_LONG_UNARY(dec_long);
-
- VAL_BYTE_UNARY(inc_byte);
- VAL_WORD_UNARY(inc_word);
- VAL_LONG_UNARY(inc_long);
-
- VAL_BYTE_BYTE_BINARY(or_byte);
- VAL_WORD_WORD_BINARY(or_word);
- VAL_LONG_LONG_BINARY(or_long);
-
- VAL_BYTE_UNARY(neg_byte);
- VAL_WORD_UNARY(neg_word);
- VAL_LONG_UNARY(neg_long);
-
- VAL_BYTE_UNARY(not_byte);
- VAL_WORD_UNARY(not_word);
- VAL_LONG_UNARY(not_long);
-
- VAL_BYTE_ROTATE(rcl_byte);
- VAL_WORD_ROTATE(rcl_word);
- VAL_LONG_ROTATE(rcl_long);
-
- VAL_BYTE_ROTATE(rcr_byte);
- VAL_WORD_ROTATE(rcr_word);
- VAL_LONG_ROTATE(rcr_long);
-
- VAL_BYTE_ROTATE(rol_byte);
- VAL_WORD_ROTATE(rol_word);
- VAL_LONG_ROTATE(rol_long);
-
- VAL_BYTE_ROTATE(ror_byte);
- VAL_WORD_ROTATE(ror_word);
- VAL_LONG_ROTATE(ror_long);
-
- VAL_BYTE_ROTATE(shl_byte);
- VAL_WORD_ROTATE(shl_word);
- VAL_LONG_ROTATE(shl_long);
-
- VAL_BYTE_ROTATE(shr_byte);
- VAL_WORD_ROTATE(shr_word);
- VAL_LONG_ROTATE(shr_long);
-
- VAL_BYTE_ROTATE(sar_byte);
- VAL_WORD_ROTATE(sar_word);
- VAL_LONG_ROTATE(sar_long);
-
- VAL_WORD_ROTATE_DBL(shld_word);
- VAL_LONG_ROTATE_DBL(shld_long);
-
- VAL_WORD_ROTATE_DBL(shrd_word);
- VAL_LONG_ROTATE_DBL(shrd_long);
-
- VAL_BYTE_BYTE_BINARY(sbb_byte);
- VAL_WORD_WORD_BINARY(sbb_word);
- VAL_LONG_LONG_BINARY(sbb_long);
-
- VAL_BYTE_BYTE_BINARY(sub_byte);
- VAL_WORD_WORD_BINARY(sub_word);
- VAL_LONG_LONG_BINARY(sub_long);
-
- VAL_BYTE_BYTE_BINARY(xor_byte);
- VAL_WORD_WORD_BINARY(xor_word);
- VAL_LONG_LONG_BINARY(xor_long);
-
- VAL_VOID_BYTE_BINARY(test_byte);
- VAL_VOID_WORD_BINARY(test_word);
- VAL_VOID_LONG_BINARY(test_long);
-
- VAL_BYTE_MUL(imul_byte);
- VAL_WORD_MUL(imul_word);
- VAL_LONG_MUL(imul_long);
-
- VAL_BYTE_MUL(mul_byte);
- VAL_WORD_MUL(mul_word);
- VAL_LONG_MUL(mul_long);
-
- VAL_BYTE_DIV(idiv_byte);
- VAL_WORD_DIV(idiv_word);
- VAL_LONG_DIV(idiv_long);
-
- VAL_BYTE_DIV(div_byte);
- VAL_WORD_DIV(div_word);
- VAL_LONG_DIV(div_long);
-
- return 0;
-}
diff --git a/hw/xfree86/x86emu/x86emu.h b/hw/xfree86/x86emu/x86emu.h
deleted file mode 100644
index de989b83f..000000000
--- a/hw/xfree86/x86emu/x86emu.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for public specific functions.
-* Any application linking against us should only
-* include this header
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu.h,v 1.3 2002/09/16 18:05:17 eich Exp $ */
-
-#ifndef __X86EMU_X86EMU_H
-#define __X86EMU_X86EMU_H
-
-#ifdef SCITECH
-#include "scitech.h"
-#define X86API _ASMAPI
-#define X86APIP _ASMAPIP
-typedef int X86EMU_pioAddr;
-#else
-#include "x86emu/types.h"
-#define X86API
-#define X86APIP *
-#endif
-#include "x86emu/regs.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* #pragma pack(1) */ /* Don't pack structs with function pointers! */
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to programmed I/O functions used by the
-emulator. This is used so that the user program can hook all programmed
-I/O for the emulator to handled as necessary by the user program. By
-default the emulator contains simple functions that do not do access the
-hardware in any way. To allow the emualtor access the hardware, you will
-need to override the programmed I/O functions using the X86EMU_setupPioFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-inb - Function to read a byte from an I/O port
-inw - Function to read a word from an I/O port
-inl - Function to read a dword from an I/O port
-outb - Function to write a byte to an I/O port
-outw - Function to write a word to an I/O port
-outl - Function to write a dword to an I/O port
-****************************************************************************/
-typedef struct {
- u8 (X86APIP inb)(X86EMU_pioAddr addr);
- u16 (X86APIP inw)(X86EMU_pioAddr addr);
- u32 (X86APIP inl)(X86EMU_pioAddr addr);
- void (X86APIP outb)(X86EMU_pioAddr addr, u8 val);
- void (X86APIP outw)(X86EMU_pioAddr addr, u16 val);
- void (X86APIP outl)(X86EMU_pioAddr addr, u32 val);
- } X86EMU_pioFuncs;
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to memory access functions used by the
-emulator. This is used so that the user program can hook all memory
-access functions as necessary for the emulator. By default the emulator
-contains simple functions that only access the internal memory of the
-emulator. If you need specialised functions to handle access to different
-types of memory (ie: hardware framebuffer accesses and BIOS memory access
-etc), you will need to override this using the X86EMU_setupMemFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-rdb - Function to read a byte from an address
-rdw - Function to read a word from an address
-rdl - Function to read a dword from an address
-wrb - Function to write a byte to an address
-wrw - Function to write a word to an address
-wrl - Function to write a dword to an address
-****************************************************************************/
-typedef struct {
- u8 (X86APIP rdb)(u32 addr);
- u16 (X86APIP rdw)(u32 addr);
- u32 (X86APIP rdl)(u32 addr);
- void (X86APIP wrb)(u32 addr, u8 val);
- void (X86APIP wrw)(u32 addr, u16 val);
- void (X86APIP wrl)(u32 addr, u32 val);
- } X86EMU_memFuncs;
-
-/****************************************************************************
- Here are the default memory read and write
- function in case they are needed as fallbacks.
-***************************************************************************/
-extern u8 X86API rdb(u32 addr);
-extern u16 X86API rdw(u32 addr);
-extern u32 X86API rdl(u32 addr);
-extern void X86API wrb(u32 addr, u8 val);
-extern void X86API wrw(u32 addr, u16 val);
-extern void X86API wrl(u32 addr, u32 val);
-
-/* #pragma pack() */
-
-/*--------------------- type definitions -----------------------------------*/
-
-typedef void (X86APIP X86EMU_intrFuncs)(int num);
-extern X86EMU_intrFuncs _X86EMU_intrTab[256];
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-void X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
-void X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
-void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
-void X86EMU_prepareForInt(int num);
-
-/* decode.c */
-
-void X86EMU_exec(void);
-void X86EMU_halt_sys(void);
-
-#ifdef DEBUG
-#define HALT_SYS() \
- printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
- X86EMU_halt_sys()
-#else
-#define HALT_SYS() X86EMU_halt_sys()
-#endif
-
-/* Debug options */
-
-#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
-#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
-#define DEBUG_STEP_F 0x000004
-#define DEBUG_DISASSEMBLE_F 0x000008
-#define DEBUG_BREAK_F 0x000010
-#define DEBUG_SVC_F 0x000020
-#define DEBUG_FS_F 0x000080
-#define DEBUG_PROC_F 0x000100
-#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
-#define DEBUG_TRACECALL_F 0x000400
-#define DEBUG_INSTRUMENT_F 0x000800
-#define DEBUG_MEM_TRACE_F 0x001000
-#define DEBUG_IO_TRACE_F 0x002000
-#define DEBUG_TRACECALL_REGS_F 0x004000
-#define DEBUG_DECODE_NOPRINT_F 0x008000
-#define DEBUG_SAVE_IP_CS_F 0x010000
-#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
-
-void X86EMU_trace_regs(void);
-void X86EMU_trace_xregs(void);
-void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
-int X86EMU_trace_on(void);
-int X86EMU_trace_off(void);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_X86EMU_H */
diff --git a/hw/xfree86/x86emu/x86emu/debug.h b/hw/xfree86/x86emu/x86emu/debug.h
deleted file mode 100644
index 56221cbba..000000000
--- a/hw/xfree86/x86emu/x86emu/debug.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for debug definitions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/debug.h,v 1.4 2000/11/21 23:10:27 tsi Exp $ */
-
-#ifndef __X86EMU_DEBUG_H
-#define __X86EMU_DEBUG_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* checks to be enabled for "runtime" */
-
-#define CHECK_IP_FETCH_F 0x1
-#define CHECK_SP_ACCESS_F 0x2
-#define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */
-#define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset*/
-
-#ifdef DEBUG
-# define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F)
-# define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F)
-# define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F)
-# define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F)
-#else
-# define CHECK_IP_FETCH()
-# define CHECK_SP_ACCESS()
-# define CHECK_MEM_ACCESS()
-# define CHECK_DATA_ACCESS()
-#endif
-
-#ifdef DEBUG
-# define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F)
-# define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F)
-# define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F)
-# define DEBUG_STEP() (M.x86.debug & DEBUG_STEP_F)
-# define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F)
-# define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F)
-# define DEBUG_SVC() (M.x86.debug & DEBUG_SVC_F)
-# define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F)
-
-# define DEBUG_FS() (M.x86.debug & DEBUG_FS_F)
-# define DEBUG_PROC() (M.x86.debug & DEBUG_PROC_F)
-# define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F)
-# define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F)
-# define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
-# define DEBUG_SYS() (M.x86.debug & DEBUG_SYS_F)
-# define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F)
-# define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F)
-# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
-#else
-# define DEBUG_INSTRUMENT() 0
-# define DEBUG_DECODE() 0
-# define DEBUG_TRACE() 0
-# define DEBUG_STEP() 0
-# define DEBUG_DISASSEMBLE() 0
-# define DEBUG_BREAK() 0
-# define DEBUG_SVC() 0
-# define DEBUG_SAVE_IP_CS() 0
-# define DEBUG_FS() 0
-# define DEBUG_PROC() 0
-# define DEBUG_SYSINT() 0
-# define DEBUG_TRACECALL() 0
-# define DEBUG_TRACECALLREGS() 0
-# define DEBUG_SYS() 0
-# define DEBUG_MEM_TRACE() 0
-# define DEBUG_IO_TRACE() 0
-# define DEBUG_DECODE_NOPRINT() 0
-#endif
-
-#ifdef DEBUG
-
-# define DECODE_PRINTF(x) if (DEBUG_DECODE()) \
- x86emu_decode_printf(x)
-# define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \
- x86emu_decode_printf2(x,y)
-
-/*
- * The following allow us to look at the bytes of an instruction. The
- * first INCR_INSTRN_LEN, is called everytime bytes are consumed in
- * the decoding process. The SAVE_IP_CS is called initially when the
- * major opcode of the instruction is accessed.
- */
-#define INC_DECODED_INST_LEN(x) \
- if (DEBUG_DECODE()) \
- x86emu_inc_decoded_inst_len(x)
-
-#define SAVE_IP_CS(x,y) \
- if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \
- | DEBUG_IO_TRACE() | DEBUG_SAVE_IP_CS()) { \
- M.x86.saved_cs = x; \
- M.x86.saved_ip = y; \
- }
-#else
-# define INC_DECODED_INST_LEN(x)
-# define DECODE_PRINTF(x)
-# define DECODE_PRINTF2(x,y)
-# define SAVE_IP_CS(x,y)
-#endif
-
-#ifdef DEBUG
-#define TRACE_REGS() \
- if (DEBUG_DISASSEMBLE()) { \
- x86emu_just_disassemble(); \
- goto EndOfTheInstructionProcedure; \
- } \
- if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
-#else
-# define TRACE_REGS()
-#endif
-
-#ifdef DEBUG
-# define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step()
-#else
-# define SINGLE_STEP()
-#endif
-
-#define TRACE_AND_STEP() \
- TRACE_REGS(); \
- SINGLE_STEP()
-
-#ifdef DEBUG
-# define START_OF_INSTR()
-# define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr();
-# define END_OF_INSTR_NO_TRACE() x86emu_end_instr();
-#else
-# define START_OF_INSTR()
-# define END_OF_INSTR()
-# define END_OF_INSTR_NO_TRACE()
-#endif
-
-#ifdef DEBUG
-# define CALL_TRACE(u,v,w,x,s) \
- if (DEBUG_TRACECALLREGS()) \
- x86emu_dump_regs(); \
- if (DEBUG_TRACECALL()) \
- printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
-# define RETURN_TRACE(n,u,v) \
- if (DEBUG_TRACECALLREGS()) \
- x86emu_dump_regs(); \
- if (DEBUG_TRACECALL()) \
- printk("%04x:%04x: %s\n",u,v,n);
-#else
-# define CALL_TRACE(u,v,w,x,s)
-# define RETURN_TRACE(n,u,v)
-#endif
-
-#ifdef DEBUG
-#define DB(x) x
-#else
-#define DB(x)
-#endif
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-extern void x86emu_inc_decoded_inst_len (int x);
-extern void x86emu_decode_printf (char *x);
-extern void x86emu_decode_printf2 (char *x, int y);
-extern void x86emu_just_disassemble (void);
-extern void x86emu_single_step (void);
-extern void x86emu_end_instr (void);
-extern void x86emu_dump_regs (void);
-extern void x86emu_dump_xregs (void);
-extern void x86emu_print_int_vect (u16 iv);
-extern void x86emu_instrument_instruction (void);
-extern void x86emu_check_ip_access (void);
-extern void x86emu_check_sp_access (void);
-extern void x86emu_check_mem_access (u32 p);
-extern void x86emu_check_data_access (uint s, uint o);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_DEBUG_H */
diff --git a/hw/xfree86/x86emu/x86emu/decode.h b/hw/xfree86/x86emu/x86emu/decode.h
deleted file mode 100644
index d134f4294..000000000
--- a/hw/xfree86/x86emu/x86emu/decode.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for instruction decoding logic.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/decode.h,v 1.3 2002/07/23 01:51:03 tsi Exp $ */
-
-#ifndef __X86EMU_DECODE_H
-#define __X86EMU_DECODE_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* Instruction Decoding Stuff */
-
-#define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl)
-#define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r)
-#define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r)
-#define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r)
-#define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-void x86emu_intr_raise (u8 type);
-void fetch_decode_modrm (int *mod,int *regh,int *regl);
-u8 fetch_byte_imm (void);
-u16 fetch_word_imm (void);
-u32 fetch_long_imm (void);
-u8 fetch_data_byte (uint offset);
-u8 fetch_data_byte_abs (uint segment, uint offset);
-u16 fetch_data_word (uint offset);
-u16 fetch_data_word_abs (uint segment, uint offset);
-u32 fetch_data_long (uint offset);
-u32 fetch_data_long_abs (uint segment, uint offset);
-void store_data_byte (uint offset, u8 val);
-void store_data_byte_abs (uint segment, uint offset, u8 val);
-void store_data_word (uint offset, u16 val);
-void store_data_word_abs (uint segment, uint offset, u16 val);
-void store_data_long (uint offset, u32 val);
-void store_data_long_abs (uint segment, uint offset, u32 val);
-u8* decode_rm_byte_register(int reg);
-u16* decode_rm_word_register(int reg);
-u32* decode_rm_long_register(int reg);
-u16* decode_rm_seg_register(int reg);
-u32 decode_rm00_address(int rm);
-u32 decode_rm01_address(int rm);
-u32 decode_rm10_address(int rm);
-u32 decode_sib_address(int sib, int mod);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_DECODE_H */
diff --git a/hw/xfree86/x86emu/x86emu/fpu.h b/hw/xfree86/x86emu/x86emu/fpu.h
deleted file mode 100644
index 5fb271463..000000000
--- a/hw/xfree86/x86emu/x86emu/fpu.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for FPU instruction decoding.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_FPU_H
-#define __X86EMU_FPU_H
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-/* these have to be defined, whether 8087 support compiled in or not. */
-
-extern void x86emuOp_esc_coprocess_d8 (u8 op1);
-extern void x86emuOp_esc_coprocess_d9 (u8 op1);
-extern void x86emuOp_esc_coprocess_da (u8 op1);
-extern void x86emuOp_esc_coprocess_db (u8 op1);
-extern void x86emuOp_esc_coprocess_dc (u8 op1);
-extern void x86emuOp_esc_coprocess_dd (u8 op1);
-extern void x86emuOp_esc_coprocess_de (u8 op1);
-extern void x86emuOp_esc_coprocess_df (u8 op1);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_FPU_H */
diff --git a/hw/xfree86/x86emu/x86emu/fpu_regs.h b/hw/xfree86/x86emu/x86emu/fpu_regs.h
deleted file mode 100644
index b975b87e0..000000000
--- a/hw/xfree86/x86emu/x86emu/fpu_regs.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for FPU register definitions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/fpu_regs.h,v 1.3 2003/10/28 16:01:40 tsi Exp $ */
-
-#ifndef __X86EMU_FPU_REGS_H
-#define __X86EMU_FPU_REGS_H
-
-#ifdef X86_FPU_SUPPORT
-
-/* Basic 8087 register can hold any of the following values: */
-
-union x86_fpu_reg_u {
- s8 tenbytes[10];
- double dval;
- float fval;
- s16 sval;
- s32 lval;
- };
-
-struct x86_fpu_reg {
- union x86_fpu_reg_u reg;
- char tag;
- };
-
-/*
- * Since we are not going to worry about the problems of aliasing
- * registers, every time a register is modified, its result type is
- * set in the tag fields for that register. If some operation
- * attempts to access the type in a way inconsistent with its current
- * storage format, then we flag the operation. If common, we'll
- * attempt the conversion.
- */
-
-#define X86_FPU_VALID 0x80
-#define X86_FPU_REGTYP(r) ((r) & 0x7F)
-
-#define X86_FPU_WORD 0x0
-#define X86_FPU_SHORT 0x1
-#define X86_FPU_LONG 0x2
-#define X86_FPU_FLOAT 0x3
-#define X86_FPU_DOUBLE 0x4
-#define X86_FPU_LDBL 0x5
-#define X86_FPU_BSD 0x6
-
-#define X86_FPU_STKTOP 0
-
-struct x86_fpu_registers {
- struct x86_fpu_reg x86_fpu_stack[8];
- int x86_fpu_flags;
- int x86_fpu_config; /* rounding modes, etc. */
- short x86_fpu_tos, x86_fpu_bos;
- };
-
-/*
- * There are two versions of the following macro.
- *
- * One version is for opcode D9, for which there are more than 32
- * instructions encoded in the second byte of the opcode.
- *
- * The other version, deals with all the other 7 i87 opcodes, for
- * which there are only 32 strings needed to describe the
- * instructions.
- */
-
-#endif /* X86_FPU_SUPPORT */
-
-#ifdef DEBUG
-# define DECODE_PRINTINSTR32(t,mod,rh,rl) \
- DECODE_PRINTF(t[(mod<<3)+(rh)]);
-# define DECODE_PRINTINSTR256(t,mod,rh,rl) \
- DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
-#else
-# define DECODE_PRINTINSTR32(t,mod,rh,rl)
-# define DECODE_PRINTINSTR256(t,mod,rh,rl)
-#endif
-
-#endif /* __X86EMU_FPU_REGS_H */
diff --git a/hw/xfree86/x86emu/x86emu/ops.h b/hw/xfree86/x86emu/x86emu/ops.h
deleted file mode 100644
index 65ea67654..000000000
--- a/hw/xfree86/x86emu/x86emu/ops.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for operand decoding functions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_OPS_H
-#define __X86EMU_OPS_H
-
-extern void (*x86emu_optab[0x100])(u8 op1);
-extern void (*x86emu_optab2[0x100])(u8 op2);
-
-#endif /* __X86EMU_OPS_H */
diff --git a/hw/xfree86/x86emu/x86emu/prim_asm.h b/hw/xfree86/x86emu/x86emu/prim_asm.h
deleted file mode 100644
index 4fa8d5503..000000000
--- a/hw/xfree86/x86emu/x86emu/prim_asm.h
+++ /dev/null
@@ -1,971 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: Watcom C++ 10.6 or later
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Inline assembler versions of the primitive operand
-* functions for faster performance. At the moment this is
-* x86 inline assembler, but these functions could be replaced
-* with native inline assembler for each supported processor
-* platform.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/prim_asm.h,v 1.3 2000/04/19 15:48:15 tsi Exp $ */
-
-#ifndef __X86EMU_PRIM_ASM_H
-#define __X86EMU_PRIM_ASM_H
-
-#ifdef __WATCOMC__
-
-#ifndef VALIDATE
-#define __HAVE_INLINE_ASSEMBLER__
-#endif
-
-u32 get_flags_asm(void);
-#pragma aux get_flags_asm = \
- "pushf" \
- "pop eax" \
- value [eax] \
- modify exact [eax];
-
-u16 aaa_word_asm(u32 *flags,u16 d);
-#pragma aux aaa_word_asm = \
- "push [edi]" \
- "popf" \
- "aaa" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u16 aas_word_asm(u32 *flags,u16 d);
-#pragma aux aas_word_asm = \
- "push [edi]" \
- "popf" \
- "aas" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u16 aad_word_asm(u32 *flags,u16 d);
-#pragma aux aad_word_asm = \
- "push [edi]" \
- "popf" \
- "aad" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u16 aam_word_asm(u32 *flags,u8 d);
-#pragma aux aam_word_asm = \
- "push [edi]" \
- "popf" \
- "aam" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [ax] \
- modify exact [ax];
-
-u8 adc_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux adc_byte_asm = \
- "push [edi]" \
- "popf" \
- "adc al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 adc_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux adc_word_asm = \
- "push [edi]" \
- "popf" \
- "adc ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 adc_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux adc_long_asm = \
- "push [edi]" \
- "popf" \
- "adc eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 add_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux add_byte_asm = \
- "push [edi]" \
- "popf" \
- "add al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 add_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux add_word_asm = \
- "push [edi]" \
- "popf" \
- "add ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 add_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux add_long_asm = \
- "push [edi]" \
- "popf" \
- "add eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 and_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux and_byte_asm = \
- "push [edi]" \
- "popf" \
- "and al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 and_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux and_word_asm = \
- "push [edi]" \
- "popf" \
- "and ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 and_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux and_long_asm = \
- "push [edi]" \
- "popf" \
- "and eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 cmp_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux cmp_byte_asm = \
- "push [edi]" \
- "popf" \
- "cmp al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 cmp_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux cmp_word_asm = \
- "push [edi]" \
- "popf" \
- "cmp ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 cmp_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux cmp_long_asm = \
- "push [edi]" \
- "popf" \
- "cmp eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 daa_byte_asm(u32 *flags,u8 d);
-#pragma aux daa_byte_asm = \
- "push [edi]" \
- "popf" \
- "daa" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u8 das_byte_asm(u32 *flags,u8 d);
-#pragma aux das_byte_asm = \
- "push [edi]" \
- "popf" \
- "das" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u8 dec_byte_asm(u32 *flags,u8 d);
-#pragma aux dec_byte_asm = \
- "push [edi]" \
- "popf" \
- "dec al" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u16 dec_word_asm(u32 *flags,u16 d);
-#pragma aux dec_word_asm = \
- "push [edi]" \
- "popf" \
- "dec ax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u32 dec_long_asm(u32 *flags,u32 d);
-#pragma aux dec_long_asm = \
- "push [edi]" \
- "popf" \
- "dec eax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] \
- value [eax] \
- modify exact [eax];
-
-u8 inc_byte_asm(u32 *flags,u8 d);
-#pragma aux inc_byte_asm = \
- "push [edi]" \
- "popf" \
- "inc al" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u16 inc_word_asm(u32 *flags,u16 d);
-#pragma aux inc_word_asm = \
- "push [edi]" \
- "popf" \
- "inc ax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u32 inc_long_asm(u32 *flags,u32 d);
-#pragma aux inc_long_asm = \
- "push [edi]" \
- "popf" \
- "inc eax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] \
- value [eax] \
- modify exact [eax];
-
-u8 or_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux or_byte_asm = \
- "push [edi]" \
- "popf" \
- "or al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 or_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux or_word_asm = \
- "push [edi]" \
- "popf" \
- "or ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 or_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux or_long_asm = \
- "push [edi]" \
- "popf" \
- "or eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 neg_byte_asm(u32 *flags,u8 d);
-#pragma aux neg_byte_asm = \
- "push [edi]" \
- "popf" \
- "neg al" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u16 neg_word_asm(u32 *flags,u16 d);
-#pragma aux neg_word_asm = \
- "push [edi]" \
- "popf" \
- "neg ax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u32 neg_long_asm(u32 *flags,u32 d);
-#pragma aux neg_long_asm = \
- "push [edi]" \
- "popf" \
- "neg eax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] \
- value [eax] \
- modify exact [eax];
-
-u8 not_byte_asm(u32 *flags,u8 d);
-#pragma aux not_byte_asm = \
- "push [edi]" \
- "popf" \
- "not al" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] \
- value [al] \
- modify exact [al];
-
-u16 not_word_asm(u32 *flags,u16 d);
-#pragma aux not_word_asm = \
- "push [edi]" \
- "popf" \
- "not ax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] \
- value [ax] \
- modify exact [ax];
-
-u32 not_long_asm(u32 *flags,u32 d);
-#pragma aux not_long_asm = \
- "push [edi]" \
- "popf" \
- "not eax" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] \
- value [eax] \
- modify exact [eax];
-
-u8 rcl_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rcl_byte_asm = \
- "push [edi]" \
- "popf" \
- "rcl al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 rcl_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rcl_word_asm = \
- "push [edi]" \
- "popf" \
- "rcl ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 rcl_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rcl_long_asm = \
- "push [edi]" \
- "popf" \
- "rcl eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 rcr_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rcr_byte_asm = \
- "push [edi]" \
- "popf" \
- "rcr al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 rcr_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rcr_word_asm = \
- "push [edi]" \
- "popf" \
- "rcr ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 rcr_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rcr_long_asm = \
- "push [edi]" \
- "popf" \
- "rcr eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 rol_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rol_byte_asm = \
- "push [edi]" \
- "popf" \
- "rol al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 rol_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rol_word_asm = \
- "push [edi]" \
- "popf" \
- "rol ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 rol_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rol_long_asm = \
- "push [edi]" \
- "popf" \
- "rol eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 ror_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux ror_byte_asm = \
- "push [edi]" \
- "popf" \
- "ror al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 ror_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux ror_word_asm = \
- "push [edi]" \
- "popf" \
- "ror ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 ror_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux ror_long_asm = \
- "push [edi]" \
- "popf" \
- "ror eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 shl_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux shl_byte_asm = \
- "push [edi]" \
- "popf" \
- "shl al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 shl_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux shl_word_asm = \
- "push [edi]" \
- "popf" \
- "shl ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 shl_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux shl_long_asm = \
- "push [edi]" \
- "popf" \
- "shl eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 shr_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux shr_byte_asm = \
- "push [edi]" \
- "popf" \
- "shr al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 shr_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux shr_word_asm = \
- "push [edi]" \
- "popf" \
- "shr ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 shr_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux shr_long_asm = \
- "push [edi]" \
- "popf" \
- "shr eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u8 sar_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sar_byte_asm = \
- "push [edi]" \
- "popf" \
- "sar al,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [cl] \
- value [al] \
- modify exact [al cl];
-
-u16 sar_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux sar_word_asm = \
- "push [edi]" \
- "popf" \
- "sar ax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [cl] \
- value [ax] \
- modify exact [ax cl];
-
-u32 sar_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux sar_long_asm = \
- "push [edi]" \
- "popf" \
- "sar eax,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [cl] \
- value [eax] \
- modify exact [eax cl];
-
-u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
-#pragma aux shld_word_asm = \
- "push [edi]" \
- "popf" \
- "shld ax,dx,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [dx] [cl] \
- value [ax] \
- modify exact [ax dx cl];
-
-u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
-#pragma aux shld_long_asm = \
- "push [edi]" \
- "popf" \
- "shld eax,edx,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [edx] [cl] \
- value [eax] \
- modify exact [eax edx cl];
-
-u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
-#pragma aux shrd_word_asm = \
- "push [edi]" \
- "popf" \
- "shrd ax,dx,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [dx] [cl] \
- value [ax] \
- modify exact [ax dx cl];
-
-u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
-#pragma aux shrd_long_asm = \
- "push [edi]" \
- "popf" \
- "shrd eax,edx,cl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [edx] [cl] \
- value [eax] \
- modify exact [eax edx cl];
-
-u8 sbb_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sbb_byte_asm = \
- "push [edi]" \
- "popf" \
- "sbb al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 sbb_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux sbb_word_asm = \
- "push [edi]" \
- "popf" \
- "sbb ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 sbb_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux sbb_long_asm = \
- "push [edi]" \
- "popf" \
- "sbb eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-u8 sub_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sub_byte_asm = \
- "push [edi]" \
- "popf" \
- "sub al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 sub_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux sub_word_asm = \
- "push [edi]" \
- "popf" \
- "sub ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 sub_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux sub_long_asm = \
- "push [edi]" \
- "popf" \
- "sub eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-void test_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux test_byte_asm = \
- "push [edi]" \
- "popf" \
- "test al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- modify exact [al bl];
-
-void test_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux test_word_asm = \
- "push [edi]" \
- "popf" \
- "test ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- modify exact [ax bx];
-
-void test_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux test_long_asm = \
- "push [edi]" \
- "popf" \
- "test eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- modify exact [eax ebx];
-
-u8 xor_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux xor_byte_asm = \
- "push [edi]" \
- "popf" \
- "xor al,bl" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [al] [bl] \
- value [al] \
- modify exact [al bl];
-
-u16 xor_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux xor_word_asm = \
- "push [edi]" \
- "popf" \
- "xor ax,bx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [ax] [bx] \
- value [ax] \
- modify exact [ax bx];
-
-u32 xor_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux xor_long_asm = \
- "push [edi]" \
- "popf" \
- "xor eax,ebx" \
- "pushf" \
- "pop [edi]" \
- parm [edi] [eax] [ebx] \
- value [eax] \
- modify exact [eax ebx];
-
-void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
-#pragma aux imul_byte_asm = \
- "push [edi]" \
- "popf" \
- "imul bl" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- parm [edi] [esi] [al] [bl] \
- modify exact [esi ax bl];
-
-void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
-#pragma aux imul_word_asm = \
- "push [edi]" \
- "popf" \
- "imul bx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- "mov [ecx],dx" \
- parm [edi] [esi] [ecx] [ax] [bx]\
- modify exact [esi edi ax bx dx];
-
-void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
-#pragma aux imul_long_asm = \
- "push [edi]" \
- "popf" \
- "imul ebx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],eax" \
- "mov [ecx],edx" \
- parm [edi] [esi] [ecx] [eax] [ebx] \
- modify exact [esi edi eax ebx edx];
-
-void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
-#pragma aux mul_byte_asm = \
- "push [edi]" \
- "popf" \
- "mul bl" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- parm [edi] [esi] [al] [bl] \
- modify exact [esi ax bl];
-
-void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
-#pragma aux mul_word_asm = \
- "push [edi]" \
- "popf" \
- "mul bx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- "mov [ecx],dx" \
- parm [edi] [esi] [ecx] [ax] [bx]\
- modify exact [esi edi ax bx dx];
-
-void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
-#pragma aux mul_long_asm = \
- "push [edi]" \
- "popf" \
- "mul ebx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],eax" \
- "mov [ecx],edx" \
- parm [edi] [esi] [ecx] [eax] [ebx] \
- modify exact [esi edi eax ebx edx];
-
-void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
-#pragma aux idiv_byte_asm = \
- "push [edi]" \
- "popf" \
- "idiv bl" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],al" \
- "mov [ecx],ah" \
- parm [edi] [esi] [ecx] [ax] [bl]\
- modify exact [esi edi ax bl];
-
-void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
-#pragma aux idiv_word_asm = \
- "push [edi]" \
- "popf" \
- "idiv bx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- "mov [ecx],dx" \
- parm [edi] [esi] [ecx] [ax] [dx] [bx]\
- modify exact [esi edi ax dx bx];
-
-void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
-#pragma aux idiv_long_asm = \
- "push [edi]" \
- "popf" \
- "idiv ebx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],eax" \
- "mov [ecx],edx" \
- parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
- modify exact [esi edi eax edx ebx];
-
-void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
-#pragma aux div_byte_asm = \
- "push [edi]" \
- "popf" \
- "div bl" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],al" \
- "mov [ecx],ah" \
- parm [edi] [esi] [ecx] [ax] [bl]\
- modify exact [esi edi ax bl];
-
-void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
-#pragma aux div_word_asm = \
- "push [edi]" \
- "popf" \
- "div bx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],ax" \
- "mov [ecx],dx" \
- parm [edi] [esi] [ecx] [ax] [dx] [bx]\
- modify exact [esi edi ax dx bx];
-
-void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
-#pragma aux div_long_asm = \
- "push [edi]" \
- "popf" \
- "div ebx" \
- "pushf" \
- "pop [edi]" \
- "mov [esi],eax" \
- "mov [ecx],edx" \
- parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
- modify exact [esi edi eax edx ebx];
-
-#endif
-
-#endif /* __X86EMU_PRIM_ASM_H */
diff --git a/hw/xfree86/x86emu/x86emu/prim_ops.h b/hw/xfree86/x86emu/x86emu/prim_ops.h
deleted file mode 100644
index 1633fe1fa..000000000
--- a/hw/xfree86/x86emu/x86emu/prim_ops.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for primitive operation functions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_PRIM_OPS_H
-#define __X86EMU_PRIM_OPS_H
-
-#include "x86emu/prim_asm.h"
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-u16 aaa_word (u16 d);
-u16 aas_word (u16 d);
-u16 aad_word (u16 d);
-u16 aam_word (u8 d);
-u8 adc_byte (u8 d, u8 s);
-u16 adc_word (u16 d, u16 s);
-u32 adc_long (u32 d, u32 s);
-u8 add_byte (u8 d, u8 s);
-u16 add_word (u16 d, u16 s);
-u32 add_long (u32 d, u32 s);
-u8 and_byte (u8 d, u8 s);
-u16 and_word (u16 d, u16 s);
-u32 and_long (u32 d, u32 s);
-u8 cmp_byte (u8 d, u8 s);
-u16 cmp_word (u16 d, u16 s);
-u32 cmp_long (u32 d, u32 s);
-u8 daa_byte (u8 d);
-u8 das_byte (u8 d);
-u8 dec_byte (u8 d);
-u16 dec_word (u16 d);
-u32 dec_long (u32 d);
-u8 inc_byte (u8 d);
-u16 inc_word (u16 d);
-u32 inc_long (u32 d);
-u8 or_byte (u8 d, u8 s);
-u16 or_word (u16 d, u16 s);
-u32 or_long (u32 d, u32 s);
-u8 neg_byte (u8 s);
-u16 neg_word (u16 s);
-u32 neg_long (u32 s);
-u8 not_byte (u8 s);
-u16 not_word (u16 s);
-u32 not_long (u32 s);
-u8 rcl_byte (u8 d, u8 s);
-u16 rcl_word (u16 d, u8 s);
-u32 rcl_long (u32 d, u8 s);
-u8 rcr_byte (u8 d, u8 s);
-u16 rcr_word (u16 d, u8 s);
-u32 rcr_long (u32 d, u8 s);
-u8 rol_byte (u8 d, u8 s);
-u16 rol_word (u16 d, u8 s);
-u32 rol_long (u32 d, u8 s);
-u8 ror_byte (u8 d, u8 s);
-u16 ror_word (u16 d, u8 s);
-u32 ror_long (u32 d, u8 s);
-u8 shl_byte (u8 d, u8 s);
-u16 shl_word (u16 d, u8 s);
-u32 shl_long (u32 d, u8 s);
-u8 shr_byte (u8 d, u8 s);
-u16 shr_word (u16 d, u8 s);
-u32 shr_long (u32 d, u8 s);
-u8 sar_byte (u8 d, u8 s);
-u16 sar_word (u16 d, u8 s);
-u32 sar_long (u32 d, u8 s);
-u16 shld_word (u16 d, u16 fill, u8 s);
-u32 shld_long (u32 d, u32 fill, u8 s);
-u16 shrd_word (u16 d, u16 fill, u8 s);
-u32 shrd_long (u32 d, u32 fill, u8 s);
-u8 sbb_byte (u8 d, u8 s);
-u16 sbb_word (u16 d, u16 s);
-u32 sbb_long (u32 d, u32 s);
-u8 sub_byte (u8 d, u8 s);
-u16 sub_word (u16 d, u16 s);
-u32 sub_long (u32 d, u32 s);
-void test_byte (u8 d, u8 s);
-void test_word (u16 d, u16 s);
-void test_long (u32 d, u32 s);
-u8 xor_byte (u8 d, u8 s);
-u16 xor_word (u16 d, u16 s);
-u32 xor_long (u32 d, u32 s);
-void imul_byte (u8 s);
-void imul_word (u16 s);
-void imul_long (u32 s);
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
-void mul_byte (u8 s);
-void mul_word (u16 s);
-void mul_long (u32 s);
-void idiv_byte (u8 s);
-void idiv_word (u16 s);
-void idiv_long (u32 s);
-void div_byte (u8 s);
-void div_word (u16 s);
-void div_long (u32 s);
-void ins (int size);
-void outs (int size);
-u16 mem_access_word (int addr);
-void push_word (u16 w);
-void push_long (u32 w);
-u16 pop_word (void);
-u32 pop_long (void);
-
-#if defined(__HAVE_INLINE_ASSEMBLER__) && !defined(PRIM_OPS_NO_REDEFINE_ASM)
-
-#define aaa_word(d) aaa_word_asm(&M.x86.R_EFLG,d)
-#define aas_word(d) aas_word_asm(&M.x86.R_EFLG,d)
-#define aad_word(d) aad_word_asm(&M.x86.R_EFLG,d)
-#define aam_word(d) aam_word_asm(&M.x86.R_EFLG,d)
-#define adc_byte(d,s) adc_byte_asm(&M.x86.R_EFLG,d,s)
-#define adc_word(d,s) adc_word_asm(&M.x86.R_EFLG,d,s)
-#define adc_long(d,s) adc_long_asm(&M.x86.R_EFLG,d,s)
-#define add_byte(d,s) add_byte_asm(&M.x86.R_EFLG,d,s)
-#define add_word(d,s) add_word_asm(&M.x86.R_EFLG,d,s)
-#define add_long(d,s) add_long_asm(&M.x86.R_EFLG,d,s)
-#define and_byte(d,s) and_byte_asm(&M.x86.R_EFLG,d,s)
-#define and_word(d,s) and_word_asm(&M.x86.R_EFLG,d,s)
-#define and_long(d,s) and_long_asm(&M.x86.R_EFLG,d,s)
-#define cmp_byte(d,s) cmp_byte_asm(&M.x86.R_EFLG,d,s)
-#define cmp_word(d,s) cmp_word_asm(&M.x86.R_EFLG,d,s)
-#define cmp_long(d,s) cmp_long_asm(&M.x86.R_EFLG,d,s)
-#define daa_byte(d) daa_byte_asm(&M.x86.R_EFLG,d)
-#define das_byte(d) das_byte_asm(&M.x86.R_EFLG,d)
-#define dec_byte(d) dec_byte_asm(&M.x86.R_EFLG,d)
-#define dec_word(d) dec_word_asm(&M.x86.R_EFLG,d)
-#define dec_long(d) dec_long_asm(&M.x86.R_EFLG,d)
-#define inc_byte(d) inc_byte_asm(&M.x86.R_EFLG,d)
-#define inc_word(d) inc_word_asm(&M.x86.R_EFLG,d)
-#define inc_long(d) inc_long_asm(&M.x86.R_EFLG,d)
-#define or_byte(d,s) or_byte_asm(&M.x86.R_EFLG,d,s)
-#define or_word(d,s) or_word_asm(&M.x86.R_EFLG,d,s)
-#define or_long(d,s) or_long_asm(&M.x86.R_EFLG,d,s)
-#define neg_byte(s) neg_byte_asm(&M.x86.R_EFLG,s)
-#define neg_word(s) neg_word_asm(&M.x86.R_EFLG,s)
-#define neg_long(s) neg_long_asm(&M.x86.R_EFLG,s)
-#define not_byte(s) not_byte_asm(&M.x86.R_EFLG,s)
-#define not_word(s) not_word_asm(&M.x86.R_EFLG,s)
-#define not_long(s) not_long_asm(&M.x86.R_EFLG,s)
-#define rcl_byte(d,s) rcl_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcl_word(d,s) rcl_word_asm(&M.x86.R_EFLG,d,s)
-#define rcl_long(d,s) rcl_long_asm(&M.x86.R_EFLG,d,s)
-#define rcr_byte(d,s) rcr_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcr_word(d,s) rcr_word_asm(&M.x86.R_EFLG,d,s)
-#define rcr_long(d,s) rcr_long_asm(&M.x86.R_EFLG,d,s)
-#define rol_byte(d,s) rol_byte_asm(&M.x86.R_EFLG,d,s)
-#define rol_word(d,s) rol_word_asm(&M.x86.R_EFLG,d,s)
-#define rol_long(d,s) rol_long_asm(&M.x86.R_EFLG,d,s)
-#define ror_byte(d,s) ror_byte_asm(&M.x86.R_EFLG,d,s)
-#define ror_word(d,s) ror_word_asm(&M.x86.R_EFLG,d,s)
-#define ror_long(d,s) ror_long_asm(&M.x86.R_EFLG,d,s)
-#define shl_byte(d,s) shl_byte_asm(&M.x86.R_EFLG,d,s)
-#define shl_word(d,s) shl_word_asm(&M.x86.R_EFLG,d,s)
-#define shl_long(d,s) shl_long_asm(&M.x86.R_EFLG,d,s)
-#define shr_byte(d,s) shr_byte_asm(&M.x86.R_EFLG,d,s)
-#define shr_word(d,s) shr_word_asm(&M.x86.R_EFLG,d,s)
-#define shr_long(d,s) shr_long_asm(&M.x86.R_EFLG,d,s)
-#define sar_byte(d,s) sar_byte_asm(&M.x86.R_EFLG,d,s)
-#define sar_word(d,s) sar_word_asm(&M.x86.R_EFLG,d,s)
-#define sar_long(d,s) sar_long_asm(&M.x86.R_EFLG,d,s)
-#define shld_word(d,fill,s) shld_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shld_long(d,fill,s) shld_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_word(d,fill,s) shrd_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_long(d,fill,s) shrd_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define sbb_byte(d,s) sbb_byte_asm(&M.x86.R_EFLG,d,s)
-#define sbb_word(d,s) sbb_word_asm(&M.x86.R_EFLG,d,s)
-#define sbb_long(d,s) sbb_long_asm(&M.x86.R_EFLG,d,s)
-#define sub_byte(d,s) sub_byte_asm(&M.x86.R_EFLG,d,s)
-#define sub_word(d,s) sub_word_asm(&M.x86.R_EFLG,d,s)
-#define sub_long(d,s) sub_long_asm(&M.x86.R_EFLG,d,s)
-#define test_byte(d,s) test_byte_asm(&M.x86.R_EFLG,d,s)
-#define test_word(d,s) test_word_asm(&M.x86.R_EFLG,d,s)
-#define test_long(d,s) test_long_asm(&M.x86.R_EFLG,d,s)
-#define xor_byte(d,s) xor_byte_asm(&M.x86.R_EFLG,d,s)
-#define xor_word(d,s) xor_word_asm(&M.x86.R_EFLG,d,s)
-#define xor_long(d,s) xor_long_asm(&M.x86.R_EFLG,d,s)
-#define imul_byte(s) imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define imul_word(s) imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define imul_long(s) imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define imul_long_direct(res_lo,res_hi,d,s) imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s)
-#define mul_byte(s) mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define mul_word(s) mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define mul_long(s) mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define idiv_byte(s) idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define idiv_word(s) idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define idiv_long(s) idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-#define div_byte(s) div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define div_word(s) div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define div_long(s) div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-
-#endif
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_PRIM_OPS_H */
diff --git a/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h
deleted file mode 100644
index 3a4580138..000000000
--- a/hw/xfree86/x86emu/x86emu/regs.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for x86 register definitions.
-*
-****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.6 2003/10/28 16:01:40 tsi Exp $ */
-
-#ifndef __X86EMU_REGS_H
-#define __X86EMU_REGS_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/*
- * General EAX, EBX, ECX, EDX type registers. Note that for
- * portability, and speed, the issue of byte swapping is not addressed
- * in the registers. All registers are stored in the default format
- * available on the host machine. The only critical issue is that the
- * registers should line up EXACTLY in the same manner as they do in
- * the 386. That is:
- *
- * EAX & 0xff === AL
- * EAX & 0xffff == AX
- *
- * etc. The result is that alot of the calculations can then be
- * done using the native instruction set fully.
- */
-
-#ifdef __BIG_ENDIAN__
-
-typedef struct {
- u32 e_reg;
- } I32_reg_t;
-
-typedef struct {
- u16 filler0, x_reg;
- } I16_reg_t;
-
-typedef struct {
- u8 filler0, filler1, h_reg, l_reg;
- } I8_reg_t;
-
-#else /* !__BIG_ENDIAN__ */
-
-typedef struct {
- u32 e_reg;
- } I32_reg_t;
-
-typedef struct {
- u16 x_reg;
- } I16_reg_t;
-
-typedef struct {
- u8 l_reg, h_reg;
- } I8_reg_t;
-
-#endif /* BIG_ENDIAN */
-
-typedef union {
- I32_reg_t I32_reg;
- I16_reg_t I16_reg;
- I8_reg_t I8_reg;
- } i386_general_register;
-
-struct i386_general_regs {
- i386_general_register A, B, C, D;
- };
-
-typedef struct i386_general_regs Gen_reg_t;
-
-struct i386_special_regs {
- i386_general_register SP, BP, SI, DI, IP;
- u32 FLAGS;
- };
-
-/*
- * Segment registers here represent the 16 bit quantities
- * CS, DS, ES, SS.
- */
-
-struct i386_segment_regs {
- u16 CS, DS, SS, ES, FS, GS;
- };
-
-/* 8 bit registers */
-#define R_AH gen.A.I8_reg.h_reg
-#define R_AL gen.A.I8_reg.l_reg
-#define R_BH gen.B.I8_reg.h_reg
-#define R_BL gen.B.I8_reg.l_reg
-#define R_CH gen.C.I8_reg.h_reg
-#define R_CL gen.C.I8_reg.l_reg
-#define R_DH gen.D.I8_reg.h_reg
-#define R_DL gen.D.I8_reg.l_reg
-
-/* 16 bit registers */
-#define R_AX gen.A.I16_reg.x_reg
-#define R_BX gen.B.I16_reg.x_reg
-#define R_CX gen.C.I16_reg.x_reg
-#define R_DX gen.D.I16_reg.x_reg
-
-/* 32 bit extended registers */
-#define R_EAX gen.A.I32_reg.e_reg
-#define R_EBX gen.B.I32_reg.e_reg
-#define R_ECX gen.C.I32_reg.e_reg
-#define R_EDX gen.D.I32_reg.e_reg
-
-/* special registers */
-#define R_SP spc.SP.I16_reg.x_reg
-#define R_BP spc.BP.I16_reg.x_reg
-#define R_SI spc.SI.I16_reg.x_reg
-#define R_DI spc.DI.I16_reg.x_reg
-#define R_IP spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_SP spc.SP.I16_reg.x_reg
-#define R_BP spc.BP.I16_reg.x_reg
-#define R_SI spc.SI.I16_reg.x_reg
-#define R_DI spc.DI.I16_reg.x_reg
-#define R_IP spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_ESP spc.SP.I32_reg.e_reg
-#define R_EBP spc.BP.I32_reg.e_reg
-#define R_ESI spc.SI.I32_reg.e_reg
-#define R_EDI spc.DI.I32_reg.e_reg
-#define R_EIP spc.IP.I32_reg.e_reg
-#define R_EFLG spc.FLAGS
-
-/* segment registers */
-#define R_CS seg.CS
-#define R_DS seg.DS
-#define R_SS seg.SS
-#define R_ES seg.ES
-#define R_FS seg.FS
-#define R_GS seg.GS
-
-/* flag conditions */
-#define FB_CF 0x0001 /* CARRY flag */
-#define FB_PF 0x0004 /* PARITY flag */
-#define FB_AF 0x0010 /* AUX flag */
-#define FB_ZF 0x0040 /* ZERO flag */
-#define FB_SF 0x0080 /* SIGN flag */
-#define FB_TF 0x0100 /* TRAP flag */
-#define FB_IF 0x0200 /* INTERRUPT ENABLE flag */
-#define FB_DF 0x0400 /* DIR flag */
-#define FB_OF 0x0800 /* OVERFLOW flag */
-
-/* 80286 and above always have bit#1 set */
-#define F_ALWAYS_ON (0x0002) /* flag bits always on */
-
-/*
- * Define a mask for only those flag bits we will ever pass back
- * (via PUSHF)
- */
-#define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF)
-
-/* following bits masked in to a 16bit quantity */
-
-#define F_CF 0x0001 /* CARRY flag */
-#define F_PF 0x0004 /* PARITY flag */
-#define F_AF 0x0010 /* AUX flag */
-#define F_ZF 0x0040 /* ZERO flag */
-#define F_SF 0x0080 /* SIGN flag */
-#define F_TF 0x0100 /* TRAP flag */
-#define F_IF 0x0200 /* INTERRUPT ENABLE flag */
-#define F_DF 0x0400 /* DIR flag */
-#define F_OF 0x0800 /* OVERFLOW flag */
-
-#define TOGGLE_FLAG(flag) (M.x86.R_FLG ^= (flag))
-#define SET_FLAG(flag) (M.x86.R_FLG |= (flag))
-#define CLEAR_FLAG(flag) (M.x86.R_FLG &= ~(flag))
-#define ACCESS_FLAG(flag) (M.x86.R_FLG & (flag))
-#define CLEARALL_FLAG(m) (M.x86.R_FLG = 0)
-
-#define CONDITIONAL_SET_FLAG(COND,FLAG) \
- if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG)
-
-#define F_PF_CALC 0x010000 /* PARITY flag has been calced */
-#define F_ZF_CALC 0x020000 /* ZERO flag has been calced */
-#define F_SF_CALC 0x040000 /* SIGN flag has been calced */
-
-#define F_ALL_CALC 0xff0000 /* All have been calced */
-
-/*
- * Emulator machine state.
- * Segment usage control.
- */
-#define SYSMODE_SEG_DS_SS 0x00000001
-#define SYSMODE_SEGOVR_CS 0x00000002
-#define SYSMODE_SEGOVR_DS 0x00000004
-#define SYSMODE_SEGOVR_ES 0x00000008
-#define SYSMODE_SEGOVR_FS 0x00000010
-#define SYSMODE_SEGOVR_GS 0x00000020
-#define SYSMODE_SEGOVR_SS 0x00000040
-#define SYSMODE_PREFIX_REPE 0x00000080
-#define SYSMODE_PREFIX_REPNE 0x00000100
-#define SYSMODE_PREFIX_DATA 0x00000200
-#define SYSMODE_PREFIX_ADDR 0x00000400
-#define SYSMODE_INTR_PENDING 0x10000000
-#define SYSMODE_EXTRN_INTR 0x20000000
-#define SYSMODE_HALTED 0x40000000
-
-#define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS | \
- SYSMODE_SEGOVR_CS | \
- SYSMODE_SEGOVR_DS | \
- SYSMODE_SEGOVR_ES | \
- SYSMODE_SEGOVR_FS | \
- SYSMODE_SEGOVR_GS | \
- SYSMODE_SEGOVR_SS)
-#define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS | \
- SYSMODE_SEGOVR_CS | \
- SYSMODE_SEGOVR_DS | \
- SYSMODE_SEGOVR_ES | \
- SYSMODE_SEGOVR_FS | \
- SYSMODE_SEGOVR_GS | \
- SYSMODE_SEGOVR_SS | \
- SYSMODE_PREFIX_DATA | \
- SYSMODE_PREFIX_ADDR)
-
-#define INTR_SYNCH 0x1
-#define INTR_ASYNCH 0x2
-#define INTR_HALTED 0x4
-
-typedef struct {
- struct i386_general_regs gen;
- struct i386_special_regs spc;
- struct i386_segment_regs seg;
- /*
- * MODE contains information on:
- * REPE prefix 2 bits repe,repne
- * SEGMENT overrides 5 bits normal,DS,SS,CS,ES
- * Delayed flag set 3 bits (zero, signed, parity)
- * reserved 6 bits
- * interrupt # 8 bits instruction raised interrupt
- * BIOS video segregs 4 bits
- * Interrupt Pending 1 bits
- * Extern interrupt 1 bits
- * Halted 1 bits
- */
- u32 mode;
- volatile int intr; /* mask of pending interrupts */
- int debug;
-#ifdef DEBUG
- int check;
- u16 saved_ip;
- u16 saved_cs;
- int enc_pos;
- int enc_str_pos;
- char decode_buf[32]; /* encoded byte stream */
- char decoded_buf[256]; /* disassembled strings */
-#endif
- u8 intno;
- u8 __pad[3];
- } X86EMU_regs;
-
-/****************************************************************************
-REMARKS:
-Structure maintaining the emulator machine state.
-
-MEMBERS:
-mem_base - Base real mode memory for the emulator
-mem_size - Size of the real mode memory block for the emulator
-private - private data pointer
-x86 - X86 registers
-****************************************************************************/
-typedef struct {
- unsigned long mem_base;
- unsigned long mem_size;
- void* private;
- X86EMU_regs x86;
- } X86EMU_sysEnv;
-
-/*----------------------------- Global Variables --------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Global emulator machine state.
- *
- * We keep it global to avoid pointer dereferences in the code for speed.
- */
-
-extern X86EMU_sysEnv _X86EMU_env;
-#define M _X86EMU_env
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-/* Function to log information at runtime */
-
-void printk(const char *fmt, ...);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_REGS_H */
diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h
deleted file mode 100644
index 3a0dc17fc..000000000
--- a/hw/xfree86/x86emu/x86emu/types.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for x86 emulator type definitions.
-*
-****************************************************************************/
-
-/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.7 2003/07/07 15:34:21 eich Exp $ */
-
-#ifndef __X86EMU_TYPES_H
-#define __X86EMU_TYPES_H
-
-#ifndef IN_MODULE
-#include <sys/types.h>
-#endif
-
-/*
- * The following kludge is an attempt to work around typedef conflicts with
- * <sys/types.h>.
- */
-#define u8 x86emuu8
-#define u16 x86emuu16
-#define u32 x86emuu32
-#define u64 x86emuu64
-#define s8 x86emus8
-#define s16 x86emus16
-#define s32 x86emus32
-#define s64 x86emus64
-#define uint x86emuuint
-#define sint x86emusint
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* Currently only for Linux/32bit */
-#undef __HAS_LONG_LONG__
-#if defined(__GNUC__) && !defined(NO_LONG_LONG)
-#define __HAS_LONG_LONG__
-#endif
-
-/* Taken from Xmd.h */
-#undef NUM32
-#if defined (_LP64) || \
- defined(__alpha) || defined(__alpha__) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- (defined(__hppa__) && defined(__LP64)) || \
- defined(__AMD64__) || defined(AMD64) || \
- (defined(__sgi) && (_MIPS_SZLONG == 64))
-#define NUM32 int
-#else
-#define NUM32 long
-#endif
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned NUM32 u32;
-#ifdef __HAS_LONG_LONG__
-typedef unsigned long long u64;
-#endif
-
-typedef char s8;
-typedef short s16;
-typedef NUM32 s32;
-#ifdef __HAS_LONG_LONG__
-typedef long long s64;
-#endif
-
-typedef unsigned int uint;
-typedef int sint;
-
-typedef u16 X86EMU_pioAddr;
-
-#undef NUM32
-
-#endif /* __X86EMU_TYPES_H */
diff --git a/hw/xfree86/x86emu/x86emu/x86emui.h b/hw/xfree86/x86emu/x86emu/x86emui.h
deleted file mode 100644
index 9cdb0a1b3..000000000
--- a/hw/xfree86/x86emu/x86emu/x86emui.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-*
-* Realmode X86 Emulator Library
-*
-* Copyright (C) 1996-1999 SciTech Software, Inc.
-* Copyright (C) David Mosberger-Tang
-* Copyright (C) 1999 Egbert Eich
-*
-* ========================================================================
-*
-* Permission to use, copy, modify, distribute, and sell this software and
-* its documentation for any purpose is hereby granted without fee,
-* provided that the above copyright notice appear in all copies and that
-* both that copyright notice and this permission notice appear in
-* supporting documentation, and that the name of the authors not be used
-* in advertising or publicity pertaining to distribution of the software
-* without specific, written prior permission. The authors makes no
-* representations about the suitability of this software for any purpose.
-* It is provided "as is" without express or implied warranty.
-*
-* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-* PERFORMANCE OF THIS SOFTWARE.
-*
-* ========================================================================
-*
-* Language: ANSI C
-* Environment: Any
-* Developer: Kendall Bennett
-*
-* Description: Header file for system specific functions. These functions
-* are always compiled and linked in the OS depedent libraries,
-* and never in a binary portable driver.
-*
-****************************************************************************/
-
-/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/x86emui.h,v 1.4 2001/04/01 13:59:58 tsi Exp $ */
-
-#ifndef __X86EMU_X86EMUI_H
-#define __X86EMU_X86EMUI_H
-
-/* If we are compiling in C++ mode, we can compile some functions as
- * inline to increase performance (however the code size increases quite
- * dramatically in this case).
- */
-
-#if defined(__cplusplus) && !defined(_NO_INLINE)
-#define _INLINE inline
-#else
-#define _INLINE static
-#endif
-
-/* Get rid of unused parameters in C++ compilation mode */
-
-#ifdef __cplusplus
-#define X86EMU_UNUSED(v)
-#else
-#define X86EMU_UNUSED(v) v
-#endif
-
-#include "x86emu.h"
-#include "x86emu/regs.h"
-#include "x86emu/debug.h"
-#include "x86emu/decode.h"
-#include "x86emu/ops.h"
-#include "x86emu/prim_ops.h"
-#include "x86emu/fpu.h"
-#include "x86emu/fpu_regs.h"
-
-#ifdef IN_MODULE
-#include <xf86_ansic.h>
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-/*--------------------------- Inline Functions ----------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-extern u8 (X86APIP sys_rdb)(u32 addr);
-extern u16 (X86APIP sys_rdw)(u32 addr);
-extern u32 (X86APIP sys_rdl)(u32 addr);
-extern void (X86APIP sys_wrb)(u32 addr,u8 val);
-extern void (X86APIP sys_wrw)(u32 addr,u16 val);
-extern void (X86APIP sys_wrl)(u32 addr,u32 val);
-
-extern u8 (X86APIP sys_inb)(X86EMU_pioAddr addr);
-extern u16 (X86APIP sys_inw)(X86EMU_pioAddr addr);
-extern u32 (X86APIP sys_inl)(X86EMU_pioAddr addr);
-extern void (X86APIP sys_outb)(X86EMU_pioAddr addr,u8 val);
-extern void (X86APIP sys_outw)(X86EMU_pioAddr addr,u16 val);
-extern void (X86APIP sys_outl)(X86EMU_pioAddr addr,u32 val);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif
-
-#endif /* __X86EMU_X86EMUI_H */
diff --git a/hw/xfree86/xaa/XAA.HOWTO b/hw/xfree86/xaa/XAA.HOWTO
deleted file mode 100644
index 95d9d6100..000000000
--- a/hw/xfree86/xaa/XAA.HOWTO
+++ /dev/null
@@ -1,1427 +0,0 @@
-
-
- XAA.HOWTO
-
- This file describes how to add basic XAA support to a chipset driver.
-
-0) What is XAA
-1) XAA Initialization and Shutdown
-2) The Primitives
- 2.0 Generic Flags
- 2.1 Screen to Screen Copies
- 2.2 Solid Fills
- 2.3 Solid Lines
- 2.4 Dashed Lines
- 2.5 Color Expand Fills
- 2.5.1 Screen to Screen Color Expansion
- 2.5.2 CPU to Screen Color Expansion
- 2.5.2.1 The Direct Method
- 2.5.2.2 The Indirect Method
- 2.6 8x8 Mono Pattern Fills
- 2.7 8x8 Color Pattern Fills
- 2.8 Image Writes
- 2.8.1 The Direct Method
- 2.8.2 The Indirect Method
- 2.9 Clipping
-3) The Pixmap Cache
-4) Offscreen Pixmaps
-
-/********************************************************************/
-
-0) WHAT IS XAA
-
- XAA (the XFree86 Acceleration Architecture) is a device dependent
-layer that encapsulates the unaccelerated framebuffer rendering layer,
-intercepting rendering commands sent to it from higher levels of the
-server. For rendering tasks where hardware acceleration is not
-possible, XAA allows the requests to proceed to the software rendering
-code. Otherwise, XAA breaks the sometimes complicated X primitives
-into simpler primitives more suitable for hardware acceleration and
-will use accelerated functions exported by the chipset driver to
-render these.
-
- XAA provides a simple, easy to use driver interface that allows
-the driver to communicate its acceleration capabilities and restrictions
-back to XAA. XAA will use the information provided by the driver
-to determine whether or not acceleration will be possible for a
-particular X primitive.
-
-
-
-1) XAA INITIALIZATION AND SHUTDOWN
-
- All relevant prototypes and defines are in xaa.h.
-
- To Initialize the XAA layer, the driver should allocate an XAAInfoRec
-via XAACreateInfoRec(), fill it out as described in this document
-and pass it to XAAInit(). XAAInit() must be called _after_ the
-framebuffer initialization (usually cfb?ScreenInit or similar) since
-it is "wrapping" that layer. XAAInit() should be called _before_ the
-cursor initialization (usually miDCInitialize) since the cursor
-layer needs to "wrap" all the rendering code including XAA.
-
- When shutting down, the driver should free the XAAInfoRec
-structure in its CloseScreen function via XAADestroyInfoRec().
-The prototypes for the functions mentioned above are as follows:
-
- XAAInfoRecPtr XAACreateInfoRec(void);
- Bool XAAInit(ScreenPtr, XAAInfoRecPtr);
- void XAADestroyInfoRec(XAAInfoRec);
-
- The driver informs XAA of it's acceleration capablities by
-filling out an XAAInfoRec structure and passing it to XAAInit().
-The XAAInfoRec structure contains many fields, most of which are
-function pointers and flags. Each primitive will typically have
-two functions and a set of flags associated with it, but it may
-have more. These two functions are the "SetupFor" and "Subsequent"
-functions. The "SetupFor" function tells the driver that the
-hardware should be initialized for a particular type of graphics
-operation. After the "SetupFor" function, one or more calls to the
-"Subsequent" function will be made to indicate that an instance
-of the particular primitive should be rendered by the hardware.
-The details of each instance (width, height, etc...) are given
-with each "Subsequent" function. The set of flags associated
-with each primitive lets the driver tell XAA what its hardware
-limitations are (eg. It doesn't support a planemask, it can only
-do one of the raster-ops, etc...).
-
- Of the XAAInfoRec fields, one is required. This is the
-Sync function. XAA initialization will fail if this function
-is not provided.
-
-void Sync(ScrnInfoPtr pScrn) /* Required */
-
- Sync will be called when XAA needs to be certain that all
- graphics coprocessor operations are finished, such as when
- the framebuffer must be written to or read from directly
- and it must be certain that the accelerator will not be
- overwriting the area of interest.
-
- One needs to make certain that the Sync function not only
- waits for the accelerator fifo to empty, but that it waits for
- the rendering of that last operation to complete.
-
- It is guaranteed that no direct framebuffer access will
- occur after a "SetupFor" or "Subsequent" function without
- the Sync function being called first.
-
-
-
-2) THE PRIMITIVES
-
-2.0 Generic Flags
-
- Each primitive type has a set of flags associated with it which
-allow the driver to tell XAA what the hardware limitations are.
-The common ones are as follows:
-
-/* Foreground, Background, rop and planemask restrictions */
-
- GXCOPY_ONLY
-
- This indicates that the accelerator only supports GXcopy
- for the particular primitive.
-
- ROP_NEEDS_SOURCE
-
- This indicates that the accelerator doesn't supports a
- particular primitive with rops that don't involve the source.
- These rops are GXclear, GXnoop, GXinvert and GXset. If neither
- this flag nor GXCOPY_ONLY is defined, it is assumed that the
- accelerator supports all 16 raster operations (rops) for that
- primitive.
-
- NO_PLANEMASK
-
- This indicates that the accelerator does not support a hardware
- write planemask for the particular primitive.
-
- RGB_EQUAL
-
- This indicates that the particular primitive requires the red,
- green and blue bytes of the foreground color (and background color,
- if applicable) to be equal. This is useful for 24bpp when a graphics
- coprocessor is used in 8bpp mode, which is not uncommon in older
- hardware since some have no support for or only limited support for
- acceleration at 24bpp. This way, many operations will be accelerated
- for the common case of "grayscale" colors. This flag should only
- be used in 24bpp.
-
- In addition to the common ones listed above which are possible for
-nearly all primitives, each primitive may have its own flags specific
-to that primitive. If such flags exist they are documented in the
-descriptions of those primitives below.
-
-
-
-
-2.1 Screen to Screen Copies
-
- The SetupFor and Subsequent ScreenToScreenCopy functions provide
- an interface for copying rectangular areas from video memory to
- video memory. To accelerate this primitive the driver should
- provide both the SetupFor and Subsequent functions and indicate
- the hardware restrictions via the ScreenToScreenCopyFlags. The
- NO_PLANEMASK, GXCOPY_ONLY and ROP_NEEDS_SOURCE flags as described
- in Section 2.0 are valid as well as the following:
-
- NO_TRANSPARENCY
-
- This indicates that the accelerator does not support skipping
- of color keyed pixels when copying from the source to the destination.
-
- TRANSPARENCY_GXCOPY_ONLY
-
- This indicates that the accelerator supports skipping of color keyed
- pixels only when the rop is GXcopy.
-
- ONLY_LEFT_TO_RIGHT_BITBLT
-
- This indicates that the hardware only accepts blitting when the
- x direction is positive.
-
- ONLY_TWO_BITBLT_DIRECTIONS
-
- This indicates that the hardware can only cope with blitting when
- the direction of x is the same as the direction in y.
-
-
-void SetupForScreenToScreenCopy( ScrnInfoPtr pScrn,
- int xdir, int ydir,
- int rop,
- unsigned int planemask,
- int trans_color )
-
- When this is called, SubsequentScreenToScreenCopy will be called
- one or more times directly after. If ydir is 1, then the accelerator
- should copy starting from the top (minimum y) of the source and
- proceed downward. If ydir is -1, then the accelerator should copy
- starting from the bottom of the source (maximum y) and proceed
- upward. If xdir is 1, then the accelerator should copy each
- y scanline starting from the leftmost pixel of the source. If
- xdir is -1, it should start from the rightmost pixel.
- If trans_color is not -1 then trans_color indicates that the
- accelerator should not copy pixels with the color trans_color
- from the source to the destination, but should skip them.
- Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
-
-
-void SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn,
- int x1, int y1,
- int x2, int y2,
- int width, int height)
-
- Copy a rectangle "width" x "height" from the source (x1,y1) to the
- destination (x2,y2) using the parameters passed by the last
- SetupForScreenToScreenCopy call. (x1,y1) and (x2,y2) always denote
- the upper left hand corners of the source and destination regardless
- of which xdir and ydir values are given by SetupForScreenToScreenCopy.
-
-
-
-2.2 Solid Fills
-
- The SetupFor and Subsequent SolidFill(Rect/Trap) functions provide
- an interface for filling rectangular areas of the screen with a
- foreground color. To accelerate this primitive the driver should
- provide both the SetupForSolidFill and SubsequentSolidFillRect
- functions and indicate the hardware restrictions via the SolidFillFlags.
- The driver may optionally provide a SubsequentSolidFillTrap if
- it is capable of rendering the primitive correctly.
- The GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
- as described in Section 2.0 are valid.
-
-
-void SetupForSolidFill(ScrnInfoPtr pScrn,
- int color, int rop, unsigned int planemask)
-
- SetupForSolidFill indicates that any combination of the following
- may follow it.
-
- SubsequentSolidFillRect
- SubsequentSolidFillTrap
-
-
-
-void SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-
- Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
- using the color, rop and planemask given by the last
- SetupForSolidFill call.
-
-void SubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR)
-
- These parameters describe a trapezoid via a version of
- Bresenham's parameters. "y" is the top line. "h" is the
- number of spans to be filled in the positive Y direction.
- "left" and "right" indicate the starting X values of the
- left and right edges. dy/dx describes the edge slope.
- These are not the deltas between the beginning and ending
- points on an edge. They merely describe the slope. "e" is
- the initial error term. It's the relationships between dx,
- dy and e that define the edge.
- If your engine does not do bresenham trapezoids or does
- not allow the programmer to specify the error term then
- you are not expected to be able to accelerate them.
-
-
-2.3 Solid Lines
-
- XAA provides an interface for drawing thin lines. In order to
- draw X lines correctly a high degree of accuracy is required.
- This usually limits line acceleration to hardware which has a
- Bresenham line engine, though depending on the algorithm used,
- other line engines may come close if they accept 16 bit line
- deltas. XAA has both a Bresenham line interface and a two-point
- line interface for drawing lines of arbitrary orientation.
- Additionally there is a SubsequentSolidHorVertLine which will
- be used for all horizontal and vertical lines. Horizontal and
- vertical lines are handled separately since hardware that doesn't
- have a line engine (or has one that is unusable due to precision
- problems) can usually draw these lines by some other method such
- as drawing them as thin rectangles. Even for hardware that can
- draw arbitrary lines via the Bresenham or two-point interfaces,
- the SubsequentSolidHorVertLine is used for horizontal and vertical
- lines since most hardware is able to render the horizontal lines
- and sometimes the vertical lines faster by other methods (Hint:
- try rendering horizontal lines as flattened rectangles). If you have
- not provided a SubsequentSolidHorVertLine but you have provided
- Bresenham or two-point lines, a SubsequentSolidHorVertLine function
- will be supplied for you.
-
- The flags field associated with Solid Lines is SolidLineFlags and
- the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
- described in Section 2.0 are valid restrictions.
-
- Some line engines have line biases hardcoded to comply with
- Microsoft line biasing rules. A tell-tale sign of this is the
- hardware lines not matching the software lines in the zeroth and
- fourth octants. The driver can set the flag:
-
- MICROSOFT_ZERO_LINE_BIAS
-
- in the AccelInfoRec.Flags field to adjust the software lines to
- match the hardware lines. This is in the generic flags field
- rather than the SolidLineFlags since this flag applies to all
- software zero-width lines on the screen and not just the solid ones.
-
-
-void SetupForSolidLine(ScrnInfoPtr pScrn,
- int color, int rop, unsigned int planemask)
-
- SetupForSolidLine indicates that any combination of the following
- may follow it.
-
- SubsequentSolidBresenhamLine
- SubsequentSolidTwoPointLine
- SubsequentSolidHorVertLine
-
-
-void SubsequentSolidHorVertLine( ScrnInfoPtr pScrn,
- int x, int y, int len, int dir )
-
- All vertical and horizontal solid thin lines are rendered with
- this function. The line starts at coordinate (x,y) and extends
- "len" pixels inclusive. In the direction indicated by "dir."
- The direction is either DEGREES_O or DEGREES_270. That is, it
- always extends to the right or down.
-
-
-
-void SubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
- int x1, int y1, int x2, int y2, int flags)
-
- Draw a line from (x1,y1) to (x2,y2). If the flags field contains
- the flag OMIT_LAST, the last pixel should not be drawn. Otherwise,
- the pixel at (x2,y2) should be drawn.
-
- If you use the TwoPoint line interface there is a good possibility
- that your line engine has hard-coded line biases that do not match
- the default X zero-width lines. If so, you may need to set the
- MICROSOFT_ZERO_LINE_BIAS flag described above. Note that since
- any vertex in the 16-bit signed coordinate system is valid, your
- line engine is expected to handle 16-bit values if you have hardware
- line clipping enabled. If your engine cannot handle 16-bit values,
- you should not use hardware line clipping.
-
-
-void SubsequentSolidBresenhamLine(ScrnInfoPtr pScrn,
- int x, int y, int major, int minor, int err, int len, int octant)
-
- "X" and "y" are the starting point of the line. "Major" and "minor"
- are the major and minor step constants. "Err" is the initial error
- term. "Len" is the number of pixels to be drawn (inclusive). "Octant"
- can be any combination of the following flags OR'd together:
-
- Y_MAJOR Y is the major axis (X otherwise)
- X_DECREASING The line is drawn from right to left
- Y_DECREASING The line is drawn from bottom to top
-
- The major, minor and err terms are the "raw" Bresenham parameters
- consistent with a line engine that does:
-
- e = err;
- while(len--) {
- DRAW_POINT(x,y);
- e += minor;
- if(e >= 0) {
- e -= major;
- TAKE_ONE_STEP_ALONG_MINOR_AXIS;
- }
- TAKE_ONE_STEP_ALONG_MAJOR_AXIS;
- }
-
- IBM 8514 style Bresenham line interfaces require their parameters
- modified in the following way:
-
- Axial = minor;
- Diagonal = minor - major;
- Error = minor + err;
-
-SolidBresenhamLineErrorTermBits
-
- This field allows the driver to tell XAA how many bits large its
- Bresenham parameter registers are. Many engines have registers that
- only accept 12 or 13 bit Bresenham parameters, and the parameters
- for clipped lines may overflow these if they are not scaled down.
- If this field is not set, XAA will assume the engine can accomodate
- 16 bit parameters, otherwise, it will scale the parameters to the
- size specified.
-
-
-2.4 Dashed Lines
-
- The same degree of accuracy required by the solid lines is required
- for drawing dashed lines as well. The dash pattern itself is a
- buffer of binary data where ones are expanded into the foreground
- color and zeros either correspond to the background color or
- indicate transparency depending on whether or not DoubleDash or
- OnOffDashes are being drawn.
-
- The flags field associated with dashed Lines is DashedLineFlags and
- the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
- described in Section 2.0 are valid restrictions. Additionally, the
- following flags are valid:
-
- NO_TRANSPARENCY
-
- This indicates that the driver cannot support dashed lines
- with transparent backgrounds (OnOffDashes).
-
- TRANSPARENCY_ONLY
-
- This indicates that the driver cannot support dashes with
- both a foreground and background color (DoubleDashes).
-
- LINE_PATTERN_POWER_OF_2_ONLY
-
- This indicates that only patterns with a power of 2 length
- can be accelerated.
-
- LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
- LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
- LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
- LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
-
- These describe how the line pattern should be packed.
- The pattern buffer is DWORD padded. LSBFIRST indicates
- that the pattern runs from the LSB end to the MSB end.
- MSBFIRST indicates that the pattern runs from the MSB end
- to the LSB end. When the pattern does not completely fill
- the DWORD padded buffer, the pattern will be justified
- towards the MSB or LSB end based on the flags above.
-
-
- The following field indicates the maximum length dash pattern that
- should be accelerated.
-
- int DashPatternMaxLength
-
-
-void SetupForDashedLine(ScrnInfoPtr pScrn,
- int fg, int bg, int rop, unsigned int planemask,
- int length, unsigned char *pattern)
-
-
- SetupForDashedLine indicates that any combination of the following
- may follow it.
-
- SubsequentDashedBresenhamLine
- SubsequentDashedTwoPointLine
-
- If "bg" is -1, then the background (pixels corresponding to clear
- bits in the pattern) should remain unmodified. "Bg" indicates the
- background color otherwise. "Length" indicates the length of
- the pattern in bits and "pattern" points to the DWORD padded buffer
- holding the pattern which has been packed according to the flags
- set above.
-
-
-void SubsequentDashedTwoPointLine( ScrnInfoPtr pScrn,
- int x1, int y1, int x2, int y2, int flags, int phase)
-
-void SubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
- int x1, int y1, int major, int minor, int err, int len, int octant,
- int phase)
-
- These are the same as the SubsequentSolidTwoPointLine and
- SubsequentBresenhamLine functions except for the addition
- of the "phase" field which indicates the offset into the dash
- pattern that the pixel at (x1,y1) corresponds to.
-
- As with the SubsequentBresenhamLine, there is an
-
- int DashedBresenhamLineErrorTermBits
-
- field which indicates the size of the error term registers
- used with dashed lines. This is usually the same value as
- the field for the solid lines (because it's usually the same
- register).
-
-
-
-2.5 Color Expansion Fills
-
- When filling a color expansion rectangle, the accelerator
- paints each pixel depending on whether or not a bit in a
- corresponding bitmap is set or clear. Opaque expansions are
- when a set bit corresponds to the foreground color and a clear
- bit corresponds to the background color. A transparent expansion
- is when a set bit corresponds to the foreground color and a
- clear bit indicates that the pixel should remain unmodified.
-
- The graphics accelerator usually has access to the source
- bitmap in one of two ways: 1) the bitmap data is sent serially
- to the accelerator by the CPU through some memory mapped aperture
- or 2) the accelerator reads the source bitmap out of offscreen
- video memory. Some types of primitives are better suited towards
- one method or the other. Type 2 is useful for reusable patterns
- such as stipples which can be cached in offscreen memory. The
- aperature method can be used for stippling but the CPU must pass
- the data across the bus each time a stippled fill is to be performed.
- For expanding 1bpp client pixmaps or text strings to the screen,
- the aperature method is usually superior because the intermediate
- copy in offscreen memory needed by the second method would only be
- used once. Unfortunately, many accelerators can only do one of these
- methods and not both.
-
- XAA provides both ScreenToScreen and CPUToScreen color expansion
- interfaces for doing color expansion fills. The ScreenToScreen
- functions can only be used with hardware that supports reading
- of source bitmaps from offscreen video memory, and these are only
- used for cacheable patterns such as stipples. There are two
- variants of the CPUToScreen routines - a direct method intended
- for hardware that has a transfer aperature, and an indirect method
- intended for hardware without transfer aperatures or hardware
- with unusual transfer requirements. Hardware that can only expand
- bitmaps from video memory should supply ScreenToScreen routines
- but also ScanlineCPUToScreen (indirect) routines to optimize transfers
- of non-cacheable data. Hardware that can only accept source bitmaps
- through an aperature should supply CPUToScreen (or ScanlineCPUToScreen)
- routines. Hardware that can do both should provide both ScreenToScreen
- and CPUToScreen routines.
-
- For both ScreenToScreen and CPUToScreen interfaces, the GXCOPY_ONLY,
- ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags described in
- Section 2.0 are valid as well as the following:
-
- /* bit order requirements (one of these must be set) */
-
- BIT_ORDER_IN_BYTE_LSBFIRST
-
- This indicates that least significant bit in each byte of the source
- data corresponds to the leftmost of that block of 8 pixels. This
- is the prefered format.
-
- BIT_ORDER_IN_BYTE_MSBFIRST
-
- This indicates that most significant bit in each byte of the source
- data corresponds to the leftmost of that block of 8 pixels.
-
- /* transparency restrictions */
-
- NO_TRANSPARENCY
-
- This indicates that the accelerator cannot do a transparent expansion.
-
- TRANSPARENCY_ONLY
-
- This indicates that the accelerator cannot do an opaque expansion.
- In cases where where the background needs to be filled, XAA will
- render the primitive in two passes when using the CPUToScreen
- interface, but will not do so with the ScreenToScreen interface
- since that would require caching of two patterns. Some
- ScreenToScreen hardware may be able to render two passes at the
- driver level and remove the TRANSPARENCY_ONLY restriction if
- it can render pixels corresponding to the zero bits.
-
-
-
-2.5.1 Screen To Screen Color Expansion
-
- The ScreenToScreenColorExpandFill routines provide an interface
- for doing expansion blits from source patterns stored in offscreen
- video memory.
-
- void SetupForScreenToScreenColorExpandFill (ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop, unsigned int planemask)
-
-
- Ones in the source bitmap will correspond to the fg color.
- Zeros in the source bitmap will correspond to the bg color
- unless bg = -1. In that case the pixels corresponding to the
- zeros in the bitmap shall be left unmodified by the accelerator.
-
- For hardware that doesn't allow an easy implementation of skipleft, the
- driver can replace CacheMonoStipple function with one that stores multiple
- rotated copies of the stipple and select between them. In this case the
- driver should set CacheColorExpandDensity to tell XAA how many copies of
- the pattern are stored in the width of a cache slot. For instance if the
- hardware can specify the starting address in bytes, then 8 rotated copies
- of the stipple are needed and CacheColorExpandDensity should be set to 8.
-
- void SubsequentScreenToScreenColorExpandFill( ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int srcx, int srcy, int offset )
-
-
- Fill a rectangle "w" x "h" at location (x,y). The source pitch
- between scanlines is the framebuffer pitch (pScrn->displayWidth
- pixels) and srcx and srcy indicate the start of the source pattern
- in units of framebuffer pixels. "Offset" indicates the bit offset
- into the pattern that corresponds to the pixel being painted at
- "x" on the screen. Some hardware accepts source coordinates in
- units of bits which makes implementation of the offset trivial.
- In that case, the bit address of the source bit corresponding to
- the pixel painted at (x,y) would be:
-
- (srcy * pScrn->displayWidth + srcx) * pScrn->bitsPerPixel + offset
-
- It should be noted that the offset assumes LSBFIRST hardware.
- For MSBFIRST hardware, the driver may need to implement the
- offset by bliting only from byte boundaries and hardware clipping.
-
-
-
-2.5.2 CPU To Screen Color Expansion
-
-
- The CPUToScreenColorExpandFill routines provide an interface for
- doing expansion blits from source patterns stored in system memory.
- There are two varieties of this primitive, a CPUToScreenColorExpandFill
- and a ScanlineCPUToScreenColorExpandFill. With the
- CPUToScreenColorExpandFill method, the source data is sent serially
- through a memory mapped aperature. With the Scanline version, the
- data is rendered scanline at a time into intermediate buffers with
- a call to SubsequentColorExpandScanline following each scanline.
-
- These two methods have separate flags fields, the
- CPUToScreenColorExpandFillFlags and ScanlineCPUToScreenColorExpandFillFlags
- respectively. Flags specific to one method or the other are described
- in sections 2.5.2.1 and 2.5.2.2 but for both cases the bit order and
- transparency restrictions listed at the beginning of section 2.5 are
- valid as well as the following:
-
- /* clipping (optional) */
-
- LEFT_EDGE_CLIPPING
-
- This indicates that the accelerator supports omission of up to
- 31 pixels on the left edge of the rectangle to be filled. This
- is beneficial since it allows transfer of the source bitmap to
- always occur from DWORD boundaries.
-
- LEFT_EDGE_CLIPPING_NEGATIVE_X
-
- This flag indicates that the accelerator can render color expansion
- rectangles even if the value of x origin is negative (off of
- the screen on the left edge).
-
- /* misc */
-
- TRIPLE_BITS_24BPP
-
- When enabled (must be in 24bpp mode), color expansion functions
- are expected to require three times the amount of bits to be
- transferred so that 24bpp grayscale colors can be used with color
- expansion in 8bpp coprocessor mode. Each bit is expanded to 3
- bits when writing the monochrome data.
-
-
- 2.5.1 The Direct Method
-
-
- Using the direct method of color expansion XAA will send all
- bitmap data to the accelerator serially through an memory mapped
- transfer window defined by the following two fields:
-
- unsigned char *ColorExpandBase
-
- This indicates the memory address of the beginning of the aperture.
-
- int ColorExpandRange
-
- This indicates the size in bytes of the aperture.
-
- The driver should specify how the transfered data should be padded.
- There are options for both the padding of each Y scanline and for the
- total transfer to the aperature.
- One of the following two flags must be set:
-
- CPU_TRANSFER_PAD_DWORD
-
- This indicates that the total transfer (sum of all scanlines) sent
- to the aperature must be DWORD padded. This is the default behavior.
-
- CPU_TRANSFER_PAD_QWORD
-
- This indicates that the total transfer (sum of all scanlines) sent
- to the aperature must be QWORD padded. With this set, XAA will send
- an extra DWORD to the aperature when needed to ensure that only
- an even number of DWORDs are sent.
-
- And then there are the flags for padding of each scanline:
-
- SCANLINE_PAD_DWORD
-
- This indicates that each Y scanline should be DWORD padded.
- This is the only option available and is the default.
-
- Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
- that the aperture is a single register rather than a range of
- registers, and XAA should write all of the data to the first DWORD.
- If the ColorExpandRange is not large enough to accomodate scanlines
- the width of the screen, this option will be forced. That is, the
- ColorExpandRange must be:
-
- ((virtualX + 31)/32) * 4 bytes or more.
-
- ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
-
- If the TRIPLE_BITS_24BPP flag is set, the required area should be
- multiplied by three.
-
-
-void SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask)
-
-
-
- Ones in the source bitmap will correspond to the fg color.
- Zeros in the source bitmap will correspond to the bg color
- unless bg = -1. In that case the pixels corresponding to the
- zeros in the bitmap shall be left unmodified by the accelerator.
-
-
-void SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft )
-
- When this function is called, the accelerator should be setup
- to fill a rectangle of dimension "w" by "h" with origin at (x,y)
- in the fill style prescribed by the last call to
- SetupForCPUToScreenColorExpandFill. XAA will pass the data to
- the aperture immediately after this function is called. If the
- skipleft is non-zero (and LEFT_EDGE_CLIPPING has been enabled), then
- the accelerator _should_not_ render skipleft pixels on the leftmost
- edge of the rectangle. Some engines have an alignment feature
- like this built in, some others can do this using a clipping
- window.
-
- It can be arranged for XAA to call Sync() after it is through
- calling the Subsequent function by setting SYNC_AFTER_COLOR_EXPAND
- in the CPUToScreenColorExpandFillFlags. This can provide the driver
- with an oportunity to reset a clipping window if needed.
-
-
-2.5.2 The Indirect Method
-
- Using the indirect method, XAA will render the bitmap data scanline
- at a time to one or more buffers. These buffers may be memory
- mapped apertures or just intermediate storage.
-
- int NumScanlineColorExpandBuffers
-
- This indicates the number of buffers available.
-
- unsigned char **ScanlineColorExpandBuffers
-
- This is an array of pointers to the memory locations of each buffer.
- Each buffer is expected to be large enough to accommodate scanlines
- the width of the screen. That is:
-
- ((virtualX + 31)/32) * 4 bytes or more.
-
- ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
-
- Scanlines are always DWORD padded.
- If the TRIPLE_BITS_24BPP flag is set, the required area should be
- multiplied by three.
-
-
-void SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask)
-
- Ones in the source bitmap will correspond to the fg color.
- Zeros in the source bitmap will correspond to the bg color
- unless bg = -1. In that case the pixels corresponding to the
- zeros in the bitmap shall be left unmodified by the accelerator.
-
-
-void SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft )
-
-void SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
-
-
- When SubsequentScanlineCPUToScreenColorExpandFill is called, XAA
- will begin transfering the source data scanline at a time, calling
- SubsequentColorExpandScanline after each scanline. If more than
- one buffer is available, XAA will cycle through the buffers.
- Subsequent scanlines will use the next buffer and go back to the
- buffer 0 again when the last buffer is reached. The index into
- the ScanlineColorExpandBuffers array is presented as "bufno"
- with each SubsequentColorExpandScanline call.
-
- The skipleft field is the same as for the direct method.
-
- The indirect method can be use to send the source data directly
- to a memory mapped aperture represented by a single color expand
- buffer, scanline at a time, but more commonly it is used to place
- the data into offscreen video memory so that the accelerator can
- blit it to the visible screen from there. In the case where the
- accelerator permits rendering into offscreen video memory while
- the accelerator is active, several buffers can be used so that
- XAA can be placing source data into the next buffer while the
- accelerator is blitting the current buffer. For cases where
- the accelerator requires some special manipulation of the source
- data first, the buffers can be in system memory. The CPU can
- manipulate these buffers and then send the data to the accelerator.
-
-
-
-2.6 8x8 Mono Pattern Fills
-
- XAA provides support for two types of 8x8 hardware patterns -
- "Mono" patterns and "Color" patterns. Mono pattern data is
- 64 bits of color expansion data with ones indicating the
- foreground color and zeros indicating the background color.
- The source bitmaps for the 8x8 mono patterns can be presented
- to the graphics accelerator in one of two ways. They can be
- passed as two DWORDS to the 8x8 mono pattern functions or
- they can be cached in offscreen memory and their locations
- passed to the 8x8 mono pattern functions. In addition to the
- GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
- defined in Section 2.0, the following are defined for the
- Mono8x8PatternFillFlags:
-
- HARDWARE_PATTERN_PROGRAMMED_BITS
-
- This indicates that the 8x8 patterns should be packed into two
- DWORDS and passed to the 8x8 mono pattern functions. The default
- behavior is to cache the patterns in offscreen video memory and
- pass the locations of these patterns to the functions instead.
- The pixmap cache must be enabled for the default behavior (8x8
- pattern caching) to work. See Section 3 for how to enable the
- pixmap cache. The pixmap cache is not necessary for
- HARDWARE_PATTERN_PROGRAMMED_BITS.
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
- If the hardware supports programmable pattern offsets then
- this option should be set. See the table below for further
- infomation.
-
- HARDWARE_PATTERN_SCREEN_ORIGIN
-
- Some hardware wants the pattern offset specified with respect to the
- upper left-hand corner of the primitive being drawn. Other hardware
- needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that
- all pattern offsets should be referenced to the upper left-hand
- corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable
- since this is more natural for the X-Window system and offsets will
- have to be recalculated for each Subsequent function otherwise.
-
- BIT_ORDER_IN_BYTE_MSBFIRST
- BIT_ORDER_IN_BYTE_LSBFIRST
-
- As with other color expansion routines this indicates whether the
- most or the least significant bit in each byte from the pattern is
- the leftmost on the screen.
-
- TRANSPARENCY_ONLY
- NO_TRANSPARENCY
-
- This means the same thing as for the color expansion rect routines
- except that for TRANSPARENCY_ONLY XAA will not render the primitive
- in two passes since this is more easily handled by the driver.
- It is recommended that TRANSPARENCY_ONLY hardware handle rendering
- of opaque patterns in two passes (the background can be filled as
- a rectangle in GXcopy) in the Subsequent function so that the
- TRANSPARENCY_ONLY restriction can be removed.
-
-
-
- Additional information about cached patterns...
- For the case where HARDWARE_PATTERN_PROGRAMMED_BITS is not set and
- the pattern must be cached in offscreen memory, the first pattern
- starts at the cache slot boundary which is set by the
- CachePixelGranularity field used to configure the pixmap cache.
- One should ensure that the CachePixelGranularity reflects any
- alignment restrictions that the accelerator may put on 8x8 pattern
- storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set
- there is only one pattern stored. When this flag is not set,
- all 64 pre-rotated copies of the pattern are cached in offscreen memory.
- The MonoPatternPitch field can be used to specify the X position pixel
- granularity that each of these patterns must align on. If the
- MonoPatternPitch is not supplied, the patterns will be densely packed
- within the cache slot. The behavior of the default XAA 8x8 pattern
- caching mechanism to store all 8x8 patterns linearly in video memory.
- If the accelerator needs the patterns stored in a more unusual fashion,
- the driver will need to provide its own 8x8 mono pattern caching
- routines for XAA to use.
-
- The following table describes the meanings of the "patx" and "paty"
- fields in both the SetupFor and Subsequent functions.
-
- With HARDWARE_PATTERN_SCREEN_ORIGIN
- -----------------------------------
-
- HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
- SetupFor: patx and paty are the first and second DWORDS of the
- 8x8 mono pattern.
-
- Subsequent: patx and paty are the x,y offset into that pattern.
- All Subsequent calls will have the same offset in
- the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
- the offset specified by the first Subsequent call
- after a SetupFor call will need to be observed.
-
- HARDWARE_PATTERN_PROGRAMMED_BITS only
-
- SetupFor: patx and paty hold the first and second DWORDS of
- the 8x8 mono pattern pre-rotated to match the desired
- offset.
-
- Subsequent: These just hold the same patterns and can be ignored.
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
- SetupFor: patx and paty hold the x,y coordinates of the offscreen
- memory location where the 8x8 pattern is stored. The
- bits are stored linearly in memory at that location.
-
- Subsequent: patx and paty hold the offset into the pattern.
- All Subsequent calls will have the same offset in
- the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
- the offset specified by the first Subsequent call
- after a SetupFor call will need to be observed.
-
- Neither programmed bits or origin
-
- SetupFor: patx and paty hold the x,y coordinates of the offscreen
- memory location where the pre-rotated 8x8 pattern is
- stored.
-
- Subsequent: patx and paty are the same as in the SetupFor function
- and can be ignored.
-
-
- Without HARDWARE_PATTERN_SCREEN_ORIGIN
- --------------------------------------
-
- HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
- SetupFor: patx and paty are the first and second DWORDS of the
- 8x8 mono pattern.
-
- Subsequent: patx and paty are the x,y offset into that pattern.
-
- HARDWARE_PATTERN_PROGRAMMED_BITS only
-
- SetupFor: patx and paty holds the first and second DWORDS of
- the unrotated 8x8 mono pattern. This can be ignored.
-
- Subsequent: patx and paty hold the rotated 8x8 pattern to be
- rendered.
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
- SetupFor: patx and paty hold the x,y coordinates of the offscreen
- memory location where the 8x8 pattern is stored. The
- bits are stored linearly in memory at that location.
-
- Subsequent: patx and paty hold the offset into the pattern.
-
- Neither programmed bits or origin
-
- SetupFor: patx and paty hold the x,y coordinates of the offscreen
- memory location where the unrotated 8x8 pattern is
- stored. This can be ignored.
-
- Subsequent: patx and paty hold the x,y coordinates of the
- rotated 8x8 pattern to be rendered.
-
-
-
-void SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
- int fg, int bg, int rop, unsigned int planemask)
-
- SetupForMono8x8PatternFill indicates that any combination of the
- following may follow it.
-
- SubsequentMono8x8PatternFillRect
- SubsequentMono8x8PatternFillTrap
-
- The fg, bg, rop and planemask fields have the same meaning as the
- ones used for the other color expansion routines. Patx's and paty's
- meaning can be determined from the table above.
-
-
-void SubsequentMono8x8PatternFillRect( ScrnInfoPtr pScrn,
- int patx, int paty, int x, int y, int w, int h)
-
- Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
- using the parameters give by the last SetupForMono8x8PatternFill
- call. The meanings of patx and paty can be determined by the
- table above.
-
-void SubsequentMono8x8PatternFillTrap( ScrnInfoPtr pScrn,
- int patx, int paty, int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR )
-
- The meanings of patx and paty can be determined by the table above.
- The rest of the fields have the same meanings as those in the
- SubsequentSolidFillTrap function.
-
-
-
-2.7 8x8 Color Pattern Fills
-
- 8x8 color pattern data is 64 pixels of full color data that
- is stored linearly in offscreen video memory. 8x8 color patterns
- are useful as a substitute for 8x8 mono patterns when tiling,
- doing opaque stipples, or in the case where transperency is
- supported, regular stipples. 8x8 color pattern fills also have
- the additional benefit of being able to tile full color 8x8
- patterns instead of just 2 color ones like the mono patterns.
- However, full color 8x8 patterns aren't used very often in the
- X Window system so you might consider passing this primitive
- by if you already can do mono patterns, especially if they
- require alot of cache area. Color8x8PatternFillFlags is
- the flags field for this primitive and the GXCOPY_ONLY,
- ROP_NEEDS_SOURCE and NO_PLANEMASK flags as described in
- Section 2.0 are valid as well as the following:
-
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-
- If the hardware supports programmable pattern offsets then
- this option should be set.
-
- HARDWARE_PATTERN_SCREEN_ORIGIN
-
- Some hardware wants the pattern offset specified with respect to the
- upper left-hand corner of the primitive being drawn. Other hardware
- needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that
- all pattern offsets should be referenced to the upper left-hand
- corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable
- since this is more natural for the X-Window system and offsets will
- have to be recalculated for each Subsequent function otherwise.
-
- NO_TRANSPARENCY
- TRANSPARENCY_GXCOPY_ONLY
-
- These mean the same as for the ScreenToScreenCopy functions.
-
-
- The following table describes the meanings of patx and paty passed
- to the SetupFor and Subsequent fields:
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN && HARDWARE_PATTERN_SCREEN_ORIGIN
-
- SetupFor: patx and paty hold the x,y location of the unrotated
- pattern.
-
- Subsequent: patx and paty hold the pattern offset. For the case
- of HARDWARE_PATTERN_SCREEN_ORIGIN all Subsequent calls
- have the same offset so only the first call will need
- to be observed.
-
-
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
-
- SetupFor: patx and paty hold the x,y location of the unrotated
- pattern.
-
- Subsequent: patx and paty hold the pattern offset.
-
- HARDWARE_PATTERN_SCREEN_ORIGIN
-
- SetupFor: patx and paty hold the x,y location of the rotated pattern.
-
- Subsequent: patx and paty hold the same location as the SetupFor
- function so these can be ignored.
-
- neither flag
-
- SetupFor: patx and paty hold the x,y location of the unrotated
- pattern. This can be ignored.
-
- Subsequent: patx and paty hold the x,y location of the rotated
- pattern.
-
- Additional information about cached patterns...
- All 8x8 color patterns are cached in offscreen video memory so
- the pixmap cache must be enabled to use them. The first pattern
- starts at the cache slot boundary which is set by the
- CachePixelGranularity field used to configure the pixmap cache.
- One should ensure that the CachePixelGranularity reflects any
- alignment restrictions that the accelerator may put on 8x8 pattern
- storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set
- there is only one pattern stored. When this flag is not set,
- all 64 rotations off the pattern are accessible but it is assumed
- that the accelerator is capable of accessing data stored on 8
- pixel boundaries. If the accelerator has stricter alignment
- requirements than this the dirver will need to provide its own
- 8x8 color pattern caching routines.
-
-
-void SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
- int rop, unsigned int planemask, int trans_color)
-
- SetupForColor8x8PatternFill indicates that any combination of the
- following may follow it.
-
- SubsequentColor8x8PatternFillRect
- SubsequentColor8x8PatternFillTrap (not implemented yet)
-
- For the meanings of patx and paty, see the table above. Trans_color
- means the same as for the ScreenToScreenCopy functions.
-
-
-
-void SubsequentColor8x8PatternFillRect( ScrnInfoPtr pScrn,
- int patx, int paty, int x, int y, int w, int h)
-
- Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
- using the parameters give by the last SetupForColor8x8PatternFill
- call. The meanings of patx and paty can be determined by the
- table above.
-
-void SubsequentColor8x8PatternFillTrap( ScrnInfoPtr pScrn,
- int patx, int paty, int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR )
-
- For the meanings of patx and paty, see the table above.
- The rest of the fields have the same meanings as those in the
- SubsequentSolidFillTrap function.
-
-
-
-2.8 Image Writes
-
- XAA provides a mechanism for transfering full color pixel data from
- system memory to video memory through the accelerator. This is
- useful for dealing with alignment issues and performing raster ops
- on the data when writing it to the framebuffer. As with color
- expansion rectangles, there is a direct and indirect method. The
- direct method sends all data through a memory mapped aperature.
- The indirect method sends the data to an intermediated buffer scanline
- at a time.
-
- The direct and indirect methods have separate flags fields, the
- ImageWriteFlags and ScanlineImageWriteFlags respectively.
- Flags specific to one method or the other are described in sections
- 2.8.1 and 2.8.2 but for both cases the GXCOPY_ONLY, ROP_NEEDS_SOURCE
- and NO_PLANEMASK flags described in Section 2.0 are valid as well as
- the following:
-
- NO_GXCOPY
-
- In order to have accelerated image transfers faster than the
- software versions for GXcopy, the engine needs to support clipping,
- be using the direct method and have a large enough image transfer
- range so that CPU_TRANSFER_BASE_FIXED doesn't need to be set.
- If these are not supported, then it is unlikely that transfering
- the data through the accelerator will be of any advantage for the
- simple case of GXcopy. In fact, it may be much slower. For such
- cases it's probably best to set the NO_GXCOPY flag so that
- Image writes will only be used for the more complicated rops.
-
- /* transparency restrictions */
-
- NO_TRANSPARENCY
-
- This indicates that the accelerator does not support skipping
- of color keyed pixels when copying from the source to the destination.
-
- TRANSPARENCY_GXCOPY_ONLY
-
- This indicates that the accelerator supports skipping of color keyed
- pixels only when the rop is GXcopy.
-
- /* clipping (optional) */
-
- LEFT_EDGE_CLIPPING
-
- This indicates that the accelerator supports omission of up to
- 3 pixels on the left edge of the rectangle to be filled. This
- is beneficial since it allows transfer from the source pixmap to
- always occur from DWORD boundaries.
-
- LEFT_EDGE_CLIPPING_NEGATIVE_X
-
- This flag indicates that the accelerator can fill areas with
- image write data even if the value of x origin is negative (off of
- the screen on the left edge).
-
-
-2.8.1 The Direct Method
-
- Using the direct method of ImageWrite XAA will send all
- bitmap data to the accelerator serially through an memory mapped
- transfer window defined by the following two fields:
-
- unsigned char *ImageWriteBase
-
- This indicates the memory address of the beginning of the aperture.
-
- int ImageWriteRange
-
- This indicates the size in bytes of the aperture.
-
- The driver should specify how the transfered data should be padded.
- There are options for both the padding of each Y scanline and for the
- total transfer to the aperature.
- One of the following two flags must be set:
-
- CPU_TRANSFER_PAD_DWORD
-
- This indicates that the total transfer (sum of all scanlines) sent
- to the aperature must be DWORD padded. This is the default behavior.
-
- CPU_TRANSFER_PAD_QWORD
-
- This indicates that the total transfer (sum of all scanlines) sent
- to the aperature must be QWORD padded. With this set, XAA will send
- an extra DWORD to the aperature when needed to ensure that only
- an even number of DWORDs are sent.
-
- And then there are the flags for padding of each scanline:
-
- SCANLINE_PAD_DWORD
-
- This indicates that each Y scanline should be DWORD padded.
- This is the only option available and is the default.
-
- Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
- that the aperture is a single register rather than a range of
- registers, and XAA should write all of the data to the first DWORD.
- XAA will automatically select CPU_TRANSFER_BASE_FIXED if the
- ImageWriteRange is not large enough to accomodate an entire scanline.
-
-
-void SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
- int trans_color, int bpp, int depth)
-
- If trans_color is not -1 then trans_color indicates the transparency
- color key and pixels with color trans_color passed through the
- aperature should not be transfered to the screen but should be
- skipped. Bpp and depth indicate the bits per pixel and depth of
- the source pixmap. Trans_color is always -1 if the NO_TRANSPARENCY
- flag is set.
-
-
-void SubsequentImageWriteRect(ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft)
-
-
- Data passed through the aperature should be copied to a rectangle
- of width "w" and height "h" with origin (x,y). If LEFT_EDGE_CLIPPING
- has been enabled, skipleft will correspond to the number of pixels
- on the left edge that should not be drawn. Skipleft is zero
- otherwise.
-
- It can be arranged for XAA to call Sync() after it is through
- calling the Subsequent functions by setting SYNC_AFTER_IMAGE_WRITE
- in the ImageWriteFlags. This can provide the driver with an
- oportunity to reset a clipping window if needed.
-
-2.8.2 The Indirect Method
-
- Using the indirect method, XAA will render the pixel data scanline
- at a time to one or more buffers. These buffers may be memory
- mapped apertures or just intermediate storage.
-
- int NumScanlineImageWriteBuffers
-
- This indicates the number of buffers available.
-
- unsigned char **ScanlineImageWriteBuffers
-
- This is an array of pointers to the memory locations of each buffer.
- Each buffer is expected to be large enough to accommodate scanlines
- the width of the screen. That is:
-
- pScrn->VirtualX * pScreen->bitsPerPixel/8 bytes or more.
-
- If LEFT_EDGE_CLIPPING_NEGATIVE_X is set, add an additional 4
- bytes to that requirement in 8 and 16bpp, 12 bytes in 24bpp.
-
- Scanlines are always DWORD padded.
-
-void SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int trans_color,
- int bpp, int depth)
-
- If trans_color is not -1 then trans_color indicates the transparency
- color key and pixels with color trans_color in the buffer should not
- be transfered to the screen but should be skipped. Bpp and depth
- indicate the bits per pixel and depth of the source bitmap.
- Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
-
-
-void SubsequentImageWriteRect(ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft)
-
-
-void SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
-
-
- When SubsequentImageWriteRect is called, XAA will begin
- transfering the source data scanline at a time, calling
- SubsequentImageWriteScanline after each scanline. If more than
- one buffer is available, XAA will cycle through the buffers.
- Subsequent scanlines will use the next buffer and go back to the
- buffer 0 again when the last buffer is reached. The index into
- the ScanlineImageWriteBuffers array is presented as "bufno"
- with each SubsequentImageWriteScanline call.
-
- The skipleft field is the same as for the direct method.
-
- The indirect method can be use to send the source data directly
- to a memory mapped aperture represented by a single image write
- buffer, scanline at a time, but more commonly it is used to place
- the data into offscreen video memory so that the accelerator can
- blit it to the visible screen from there. In the case where the
- accelerator permits rendering into offscreen video memory while
- the accelerator is active, several buffers can be used so that
- XAA can be placing source data into the next buffer while the
- accelerator is blitting the current buffer. For cases where
- the accelerator requires some special manipulation of the source
- data first, the buffers can be in system memory. The CPU can
- manipulate these buffers and then send the data to the accelerator.
-
-
-2.9 Clipping
-
- XAA supports hardware clipping rectangles. To use clipping
- in this way it is expected that the graphics accelerator can
- clip primitives with verticies anywhere in the 16 bit signed
- coordinate system.
-
-void SetClippingRectangle ( ScrnInfoPtr pScrn,
- int left, int top, int right, int bottom)
-
-void DisableClipping (ScrnInfoPtr pScrn)
-
- When SetClippingRectangle is called, all hardware rendering
- following it should be clipped to the rectangle specified
- until DisableClipping is called.
-
- The ClippingFlags field indicates which operations this sort
- of Set/Disable pairing can be used with. Any of the following
- flags may be OR'd together.
-
- HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
- HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
- HARDWARE_CLIP_MONO_8x8_FILL
- HARDWARE_CLIP_COLOR_8x8_FILL
- HARDWARE_CLIP_SOLID_FILL
- HARDWARE_CLIP_DASHED_LINE
- HARDWARE_CLIP_SOLID_LINE
-
-
-
-3) XAA PIXMAP CACHE
-
- /* NOTE: XAA has no knowledge of framebuffer particulars so until
- the framebuffer is able to render into offscreen memory, usage
- of the pixmap cache requires that the driver provide ImageWrite
- routines or a WritePixmap or WritePixmapToCache replacement so
- that patterns can even be placed in the cache.
-
- ADDENDUM: XAA can now load the pixmap cache without requiring
- that the driver supply an ImageWrite function, but this can
- only be done on linear framebuffers. If you have a linear
- framebuffer, set LINEAR_FRAMEBUFFER in the XAAInfoRec.Flags
- field and XAA will then be able to upload pixmaps into the
- cache without the driver providing functions to do so.
- */
-
-
- The XAA pixmap cache provides a mechanism for caching of patterns
- in offscreen video memory so that tiled fills and in some cases
- stippling can be done by blitting the source patterns from offscreen
- video memory. The pixmap cache also provides the mechanism for caching
- of 8x8 color and mono hardware patterns. Any unused offscreen video
- memory gets used for the pixmap cache and that information is
- provided by the XFree86 Offscreen Memory Manager. XAA registers a
- callback with the manager so that it can be informed of any changes
- in the offscreen memory configuration. The driver writer does not
- need to deal with any of this since it is all automatic. The driver
- merely needs to initialize the Offscreen Memory Manager as described
- in the DESIGN document and set the PIXMAP_CACHE flag in the
- XAAInfoRec.Flags field. The Offscreen Memory Manager initialization
- must occur before XAA is initialized or else pixmap cache
- initialization will fail.
-
- PixmapCacheFlags is an XAAInfoRec field which allows the driver to
- control pixmap cache behavior to some extent. Currently only one
- flag is defined:
-
- DO_NOT_BLIT_STIPPLES
-
- This indicates that the stippling should not be done by blitting
- from the pixmap cache. This does not apply to 8x8 pattern fills.
-
-
- CachePixelGranularity is an optional field. If the hardware requires
- that a 8x8 patterns have some particular pixel alignment it should
- be reflected in this field. Ignoring this field or setting it to
- zero or one means there are no alignment issues.
-
-
-4) OFFSCREEN PIXMAPS
-
- XAA has the ability to store pixmap drawables in offscreen video
- memory and render into them with full hardware acceleration. Placement
- of pixmaps in the cache is done automatically on a first-come basis and
- only if there is room. To enable this feature, set the OFFSCREEN_PIXMAPS
- flag in the XAAInfoRec.Flags field. This is only available when a
- ScreenToScreenCopy function is provided, when the Offscreen memory
- manager has been initialized and when the LINEAR_FRAMEBUFFER flag is
- also set.
-
- int maxOffPixWidth
- int maxOffPixHeight
-
- These two fields allow the driver to limit the maximum dimensions
- of an offscreen pixmap. If one of these is not set, it is assumed
- that there is no limit on that dimension. Note that if an offscreen
- pixmap with a particular dimension is allowed, then your driver will be
- expected to render primitives as large as that pixmap.
-
-$XFree86: xc/programs/Xserver/hw/xfree86/xaa/XAA.HOWTO,v 1.13 2001/05/22 18:51:09 mvojkovi Exp $
diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h
deleted file mode 100644
index f183f8f02..000000000
--- a/hw/xfree86/xaa/xaa.h
+++ /dev/null
@@ -1,1362 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaa.h,v 1.39 2002/10/30 12:52:43 alanh Exp $ */
-
-#ifndef _XAA_H
-#define _XAA_H
-
-/*
-
- ******** OPERATION SPECIFIC FLAGS *********
-
- **** solid/dashed line flags ****
-
---------- --------
-23 LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
-22 LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
-21 LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
-20 LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
-19 LINE_PATTERN_POWER_OF_2_ONLY
-18 LINE_LIMIT_COORDS
-17 .
-16 .
---------- -------
-
- **** screen to screen copy flags ****
-
---------- --------
-23 ONLY_LEFT_TO_RIGHT_BITBLT
-22 ONLY_TWO_BITBLT_DIRECTIONS
-21 .
-20 .
-19 .
-18 .
-17 .
-16 .
---------- -------
-
- **** clipping flags ****
-
---------- --------
-23 .
-22 HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
-21 HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
-20 HARDWARE_CLIP_MONO_8x8_FILL
-19 HARDWARE_CLIP_COLOR_8x8_FILL
-18 HARDWARE_CLIP_SOLID_FILL
-17 HARDWARE_CLIP_DASHED_LINE
-16 HARDWARE_CLIP_SOLID_LINE
---------- -------
-
-
- **** hardware pattern flags ****
-
---------- --------
-23 .
-22 .
-21 HARDWARE_PATTERN_SCREEN_ORIGIN
-20 .
-19 .
-18 .
-17 HARDWARE_PATTERN_PROGRAMMED_ORIGIN
-16 HARDWARE_PATTERN_PROGRAMMED_BITS
---------- -------
-
- **** write pixmap flags ****
-
---------- --------
-23 .
-22 .
-21 .
-20 .
-19 .
-18 .
-17 .
-16 CONVERT_32BPP_TO_24BPP
---------- -------
-
-
- ******** GENERIC FLAGS *********
-
---------- -------
-15 SYNC_AFTER_COLOR_EXPAND
-14 CPU_TRANSFER_PAD_QWORD
-13 .
-12 LEFT_EDGE_CLIPPING_NEGATIVE_X
-11 LEFT_EDGE_CLIPPING
-10 CPU_TRANSFER_BASE_FIXED
- 9 BIT_ORDER_IN_BYTE_MSBFIRST
- 8 TRANSPARENCY_GXCOPY_ONLY
---------- -------
- 7 NO_TRANSPARENCY
- 6 TRANSPARENCY_ONLY
- 5 ROP_NEEDS_SOURCE
- 4 TRIPLE_BITS_24BPP
- 3 RGB_EQUAL
- 2 NO_PLANEMASK
- 1 NO_GXCOPY
- 0 GXCOPY_ONLY
---------- -------
-
-
-*/
-
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "regionstr.h"
-#include "xf86fbman.h"
-
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-/* Flags */
-#define PIXMAP_CACHE 0x00000001
-#define MICROSOFT_ZERO_LINE_BIAS 0x00000002
-#define OFFSCREEN_PIXMAPS 0x00000004
-#define LINEAR_FRAMEBUFFER 0x00000008
-
-
-/* GC fg, bg, and planemask restrictions */
-#define GXCOPY_ONLY 0x00000001
-#define NO_GXCOPY 0x00000002
-#define NO_PLANEMASK 0x00000004
-#define RGB_EQUAL 0x00000008
-#define TRIPLE_BITS_24BPP 0x00000010
-#define ROP_NEEDS_SOURCE 0x00000020
-
-/* transparency restrictions */
-#define TRANSPARENCY_ONLY 0x00000040
-#define NO_TRANSPARENCY 0x00000080
-#define TRANSPARENCY_GXCOPY_ONLY 0x00000100
-
-/* bit order restrictions */
-#define BIT_ORDER_IN_BYTE_MSBFIRST 0x00000200
-#define BIT_ORDER_IN_BYTE_LSBFIRST 0x00000000
-
-/* transfer base restriction */
-#define CPU_TRANSFER_BASE_FIXED 0x00000400
-
-/* skipleft restrictions */
-#define LEFT_EDGE_CLIPPING 0x00000800
-#define LEFT_EDGE_CLIPPING_NEGATIVE_X 0x00001000
-
-/* data padding */
-#define CPU_TRANSFER_PAD_DWORD 0x00000000
-#define CPU_TRANSFER_PAD_QWORD 0x00004000
-#define SCANLINE_PAD_DWORD 0x00000000
-
-#define SYNC_AFTER_COLOR_EXPAND 0x00008000
-#define SYNC_AFTER_IMAGE_WRITE SYNC_AFTER_COLOR_EXPAND
-
-/* hardware pattern */
-#define HARDWARE_PATTERN_PROGRAMMED_BITS 0x00010000
-#define HARDWARE_PATTERN_PROGRAMMED_ORIGIN 0x00020000
-#define HARDWARE_PATTERN_SCREEN_ORIGIN 0x00200000
-
-/* copyarea flags */
-#define ONLY_TWO_BITBLT_DIRECTIONS 0x00400000
-#define ONLY_LEFT_TO_RIGHT_BITBLT 0x00800000
-
-/* line flags */
-#define LINE_PATTERN_LSBFIRST_MSBJUSTIFIED 0x00800000
-#define LINE_PATTERN_LSBFIRST_LSBJUSTIFIED 0x00400000
-#define LINE_PATTERN_MSBFIRST_MSBJUSTIFIED 0x00200000
-#define LINE_PATTERN_MSBFIRST_LSBJUSTIFIED 0x00100000
-#define LINE_PATTERN_POWER_OF_2_ONLY 0x00080000
-#define LINE_LIMIT_COORDS 0x00040000
-
-/* clipping flags */
-#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND 0x00400000
-#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY 0x00200000
-#define HARDWARE_CLIP_MONO_8x8_FILL 0x00100000
-#define HARDWARE_CLIP_COLOR_8x8_FILL 0x00080000
-#define HARDWARE_CLIP_SOLID_FILL 0x00040000
-#define HARDWARE_CLIP_DASHED_LINE 0x00020000
-#define HARDWARE_CLIP_SOLID_LINE 0x00010000
-
-#define HARDWARE_CLIP_LINE 0x00000000
-
-
-/* image write flags */
-#define CONVERT_32BPP_TO_24BPP 0x00010000
-
-/* pixmap cache flags */
-#define CACHE_MONO_8x8 0x00000001
-#define CACHE_COLOR_8x8 0x00000002
-#define DO_NOT_BLIT_STIPPLES 0x00000004
-#define DO_NOT_TILE_MONO_DATA 0x00000008
-#define DO_NOT_TILE_COLOR_DATA 0x00000010
-
-
-#define DEGREES_0 0
-#define DEGREES_90 1
-#define DEGREES_180 2
-#define DEGREES_270 3
-
-#define OMIT_LAST 1
-
-/* render flags */
-
-#define XAA_RENDER_POWER_OF_2_TILE_ONLY 0x00000008
-#define XAA_RENDER_NO_SRC_ALPHA 0x00000004
-#define XAA_RENDER_IMPRECISE_ONLY 0x00000002
-#define XAA_RENDER_NO_TILE 0x00000001
-
-#define XAA_RENDER_REPEAT 0x00000001
-
-typedef void (* ValidateGCProcPtr)(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-typedef struct {
- unsigned char *bits;
- int width;
- int height;
- int yoff;
- int srcwidth;
- int start;
- int end;
-} NonTEGlyphInfo, *NonTEGlyphPtr;
-
-
-typedef struct {
- int x;
- int y;
- int w;
- int h;
- int orig_w;
- int orig_h;
- unsigned long serialNumber;
- int pat0;
- int pat1;
- int fg;
- int bg;
- int trans_color;
- DDXPointPtr offsets;
- DevUnion devPrivate;
-} XAACacheInfoRec, *XAACacheInfoPtr;
-
-
-typedef struct _PixmapLink {
- PixmapPtr pPix;
- struct _PixmapLink *next;
- FBAreaPtr area;
-} PixmapLink, *PixmapLinkPtr;
-
-typedef struct _XAAInfoRec {
- ScrnInfoPtr pScrn;
- int Flags;
-
- void (*Sync)(
- ScrnInfoPtr pScrn
- );
-
- /* Restore Accel State is a driver callback that is used
- * when another screen on the same device has been active.
- * This allows multihead on a single device to work.
- * If The entityProp has IS_SHARED_ACCEL defined then this
- * function is required.
- */
-
- void (*RestoreAccelState)(
- ScrnInfoPtr pScrn
- );
-
- /***************** Low Level *****************/
-
-/* Blits */
- void (*SetupForScreenToScreenCopy)(
- ScrnInfoPtr pScrn,
- int xdir, int ydir,
- int rop,
- unsigned int planemask,
- int trans_color
- );
- int ScreenToScreenCopyFlags;
-
- void (*SubsequentScreenToScreenCopy)(
- ScrnInfoPtr pScrn,
- int xsrc, int ysrc,
- int xdst, int ydst,
- int w, int h
- );
-
-
-/* Solid fills */
- void (*SetupForSolidFill)(
- ScrnInfoPtr pScrn,
- int color,
- int rop,
- unsigned int planemask
- );
- int SolidFillFlags;
-
- void (*SubsequentSolidFillRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h
- );
-
- void (*SubsequentSolidFillTrap)(
- ScrnInfoPtr pScrn,
- int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR
- );
-
-
-/* Solid lines */
-
- void (*SetupForSolidLine)(
- ScrnInfoPtr pScrn,
- int color,
- int rop,
- unsigned int planemask
- );
- int SolidLineFlags;
-
- void (*SubsequentSolidTwoPointLine)(
- ScrnInfoPtr pScrn,
- int xa, int ya, int xb, int yb, int flags
- );
-
- void (*SubsequentSolidBresenhamLine)(
- ScrnInfoPtr pScrn,
- int x, int y, int absmaj, int absmin, int err, int len, int octant
- );
- int SolidBresenhamLineErrorTermBits;
-
- void (*SubsequentSolidHorVertLine)(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
- );
-
-/* Dashed lines */
-
- void (*SetupForDashedLine)(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask,
- int length,
- unsigned char *pattern
- );
- int DashedLineFlags;
- int DashPatternMaxLength;
-
- void (*SubsequentDashedTwoPointLine)(
- ScrnInfoPtr pScrn,
- int xa, int ya, int xb, int yb, int flags, int phase
- );
-
- void (*SubsequentDashedBresenhamLine)(
- ScrnInfoPtr pScrn,
- int x, int y, int absmaj, int absmin, int err, int len, int flags,
- int phase
- );
- int DashedBresenhamLineErrorTermBits;
-
-/* Clipper */
-
- void (*SetClippingRectangle) (
- ScrnInfoPtr pScrn,
- int left, int top, int right, int bottom
- );
- int ClippingFlags;
-
- void (*DisableClipping)(ScrnInfoPtr pScrn);
-
-/* 8x8 mono pattern fills */
- void (*SetupForMono8x8PatternFill)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int fg, int bg,
- int rop,
- unsigned int planemask
- );
- int Mono8x8PatternFillFlags;
-
- void (*SubsequentMono8x8PatternFillRect)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int x, int y, int w, int h
- );
-
- void (*SubsequentMono8x8PatternFillTrap)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR
- );
-
-/* 8x8 color pattern fills */
-
- void (*SetupForColor8x8PatternFill)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int rop,
- unsigned int planemask,
- int transparency_color
- );
- int Color8x8PatternFillFlags;
-
- void (*SubsequentColor8x8PatternFillRect)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int x, int y, int w, int h
- );
-
- void (*SubsequentColor8x8PatternFillTrap)(
- ScrnInfoPtr pScrn,
- int patx, int paty,
- int y, int h,
- int left, int dxL, int dyL, int eL,
- int right, int dxR, int dyR, int eR
- );
-
-
-/* Color expansion */
-
- void (*SetupForCPUToScreenColorExpandFill)(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
- );
- int CPUToScreenColorExpandFillFlags;
-
- void (*SubsequentCPUToScreenColorExpandFill)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
- );
-
- unsigned char *ColorExpandBase;
- int ColorExpandRange;
-
-
-/* Scanline color expansion */
-
- void (*SetupForScanlineCPUToScreenColorExpandFill)(
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
- );
- int ScanlineCPUToScreenColorExpandFillFlags;
-
- void (*SubsequentScanlineCPUToScreenColorExpandFill)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
- );
-
- void (*SubsequentColorExpandScanline)(
- ScrnInfoPtr pScrn,
- int bufno
- );
-
- int NumScanlineColorExpandBuffers;
- unsigned char **ScanlineColorExpandBuffers;
-
-/* Screen to screen color expansion */
-
- void (*SetupForScreenToScreenColorExpandFill) (
- ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask
- );
- int ScreenToScreenColorExpandFillFlags;
-
- void (*SubsequentScreenToScreenColorExpandFill)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int srcx, int srcy, int skipleft
- );
-
-
-/* Image transfers */
-
- void (*SetupForImageWrite)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
- );
- int ImageWriteFlags;
-
- void (*SubsequentImageWriteRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
- );
- unsigned char *ImageWriteBase;
- int ImageWriteRange;
-
-/* Scanline Image transfers */
-
- void (*SetupForScanlineImageWrite)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
- );
- int ScanlineImageWriteFlags;
-
- void (*SubsequentScanlineImageWriteRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int skipleft
- );
-
- void (*SubsequentImageWriteScanline) (
- ScrnInfoPtr pScrn,
- int bufno
- );
-
- int NumScanlineImageWriteBuffers;
- unsigned char **ScanlineImageWriteBuffers;
-
- /* Image Reads - OBSOLETE AND NOT USED */
-
- void (*SetupForImageRead) (
- ScrnInfoPtr pScrn,
- int bpp, int depth
- );
- int ImageReadFlags;
-
- unsigned char *ImageReadBase;
- int ImageReadRange;
-
- void (*SubsequentImageReadRect)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h
- );
-
-
- /***************** Mid Level *****************/
- void (*ScreenToScreenBitBlt)(
- ScrnInfoPtr pScrn,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir, int ydir,
- int alu,
- unsigned int planmask
- );
- int ScreenToScreenBitBltFlags;
-
- void (*WriteBitmap) (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
- );
- int WriteBitmapFlags;
-
- void (*FillSolidRects)(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox
- );
- int FillSolidRectsFlags;
-
- void (*FillMono8x8PatternRects)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int pat0, int pat1,
- int xorg, int yorg
- );
- int FillMono8x8PatternRectsFlags;
-
- void (*FillColor8x8PatternRects)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
- );
- int FillColor8x8PatternRectsFlags;
-
- void (*FillCacheBltRects)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
- );
- int FillCacheBltRectsFlags;
-
- void (*FillColorExpandRects)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
- );
- int FillColorExpandRectsFlags;
-
- void (*FillCacheExpandRects)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
- );
- int FillCacheExpandRectsFlags;
-
- void (*FillImageWriteRects)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
- );
- int FillImageWriteRectsFlags;
-
-
- void (*FillSolidSpans)(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted
- );
- int FillSolidSpansFlags;
-
- void (*FillMono8x8PatternSpans)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted,
- int pat0, int pat1,
- int xorg, int yorg
- );
- int FillMono8x8PatternSpansFlags;
-
- void (*FillColor8x8PatternSpans)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted,
- XAACacheInfoPtr pCache,
- int xorg, int yorg
- );
- int FillColor8x8PatternSpansFlags;
-
- void (*FillCacheBltSpans)(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted,
- XAACacheInfoPtr pCache,
- int xorg, int yorg
- );
- int FillCacheBltSpansFlags;
-
- void (*FillColorExpandSpans)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
- );
- int FillColorExpandSpansFlags;
-
- void (*FillCacheExpandSpans)(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
- );
- int FillCacheExpandSpansFlags;
-
- void (*TEGlyphRenderer)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
- );
- int TEGlyphRendererFlags;
-
- void (*NonTEGlyphRenderer)(
- ScrnInfoPtr pScrn,
- int x, int y, int n,
- NonTEGlyphPtr glyphs,
- BoxPtr pbox,
- int fg, int rop,
- unsigned int planemask
- );
- int NonTEGlyphRendererFlags;
-
- void (*WritePixmap) (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
- );
- int WritePixmapFlags;
-
- void (*ReadPixmap) (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *dst,
- int dstwidth,
- int bpp, int depth
- );
- int ReadPixmapFlags;
-
- /***************** GC Level *****************/
- RegionPtr (*CopyArea)(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
- );
- int CopyAreaFlags;
-
- RegionPtr (*CopyPlane)(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
- );
- int CopyPlaneFlags;
-
- void (*PushPixelsSolid) (
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDrawable,
- int dx, int dy,
- int xOrg, int yOrg
- );
- int PushPixelsFlags;
-
- /** PolyFillRect **/
-
- void (*PolyFillRectSolid)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
- );
- int PolyFillRectSolidFlags;
-
- void (*PolyFillRectStippled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
- );
- int PolyFillRectStippledFlags;
-
- void (*PolyFillRectOpaqueStippled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
- );
- int PolyFillRectOpaqueStippledFlags;
-
- void (*PolyFillRectTiled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
- );
- int PolyFillRectTiledFlags;
-
- /** FillSpans **/
-
- void (*FillSpansSolid)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
- );
- int FillSpansSolidFlags;
-
- void (*FillSpansStippled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
- );
- int FillSpansStippledFlags;
-
- void (*FillSpansOpaqueStippled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
- );
- int FillSpansOpaqueStippledFlags;
-
- void (*FillSpansTiled)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
- );
- int FillSpansTiledFlags;
-
- int (*PolyText8TE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
- );
- int PolyText8TEFlags;
-
- int (*PolyText16TE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
- );
- int PolyText16TEFlags;
-
- void (*ImageText8TE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
- );
- int ImageText8TEFlags;
-
- void (*ImageText16TE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
- );
- int ImageText16TEFlags;
-
- void (*ImageGlyphBltTE) (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
- );
- int ImageGlyphBltTEFlags;
-
- void (*PolyGlyphBltTE) (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
- );
- int PolyGlyphBltTEFlags;
-
- int (*PolyText8NonTE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
- );
- int PolyText8NonTEFlags;
-
- int (*PolyText16NonTE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
- );
- int PolyText16NonTEFlags;
-
- void (*ImageText8NonTE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
- );
- int ImageText8NonTEFlags;
-
- void (*ImageText16NonTE) (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
- );
- int ImageText16NonTEFlags;
-
- void (*ImageGlyphBltNonTE) (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
- );
- int ImageGlyphBltNonTEFlags;
-
- void (*PolyGlyphBltNonTE) (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
- );
- int PolyGlyphBltNonTEFlags;
-
- void (*PolyRectangleThinSolid)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
- );
- int PolyRectangleThinSolidFlags;
-
- void (*PolylinesWideSolid)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
- );
- int PolylinesWideSolidFlags;
-
- void (*PolylinesThinSolid)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
- );
- int PolylinesThinSolidFlags;
-
- void (*PolySegmentThinSolid)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
- );
- int PolySegmentThinSolidFlags;
-
- void (*PolylinesThinDashed)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
- );
- int PolylinesThinDashedFlags;
-
- void (*PolySegmentThinDashed)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
- );
- int PolySegmentThinDashedFlags;
-
- void (*FillPolygonSolid)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
- );
- int FillPolygonSolidFlags;
-
- void (*FillPolygonStippled)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
- );
- int FillPolygonStippledFlags;
-
- void (*FillPolygonOpaqueStippled)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
- );
- int FillPolygonOpaqueStippledFlags;
-
- void (*FillPolygonTiled)(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
- );
- int FillPolygonTiledFlags;
-
- void (*PolyFillArcSolid)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
- );
- int PolyFillArcSolidFlags;
-
- void (*PutImage)(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage
- );
- int PutImageFlags;
-
- /* Validation masks */
-
- unsigned long FillSpansMask;
- ValidateGCProcPtr ValidateFillSpans;
- unsigned long SetSpansMask;
- ValidateGCProcPtr ValidateSetSpans;
- unsigned long PutImageMask;
- ValidateGCProcPtr ValidatePutImage;
- unsigned long CopyAreaMask;
- ValidateGCProcPtr ValidateCopyArea;
- unsigned long CopyPlaneMask;
- ValidateGCProcPtr ValidateCopyPlane;
- unsigned long PolyPointMask;
- ValidateGCProcPtr ValidatePolyPoint;
- unsigned long PolylinesMask;
- ValidateGCProcPtr ValidatePolylines;
- unsigned long PolySegmentMask;
- ValidateGCProcPtr ValidatePolySegment;
- unsigned long PolyRectangleMask;
- ValidateGCProcPtr ValidatePolyRectangle;
- unsigned long PolyArcMask;
- ValidateGCProcPtr ValidatePolyArc;
- unsigned long FillPolygonMask;
- ValidateGCProcPtr ValidateFillPolygon;
- unsigned long PolyFillRectMask;
- ValidateGCProcPtr ValidatePolyFillRect;
- unsigned long PolyFillArcMask;
- ValidateGCProcPtr ValidatePolyFillArc;
- unsigned long PolyText8Mask;
- ValidateGCProcPtr ValidatePolyText8;
- unsigned long PolyText16Mask;
- ValidateGCProcPtr ValidatePolyText16;
- unsigned long ImageText8Mask;
- ValidateGCProcPtr ValidateImageText8;
- unsigned long ImageText16Mask;
- ValidateGCProcPtr ValidateImageText16;
- unsigned long PolyGlyphBltMask;
- ValidateGCProcPtr ValidatePolyGlyphBlt;
- unsigned long ImageGlyphBltMask;
- ValidateGCProcPtr ValidateImageGlyphBlt;
- unsigned long PushPixelsMask;
- ValidateGCProcPtr ValidatePushPixels;
-
- void (*ComputeDash)(GCPtr pGC);
-
- /* Pixmap Cache */
-
- int PixmapCacheFlags;
- Bool UsingPixmapCache;
- Bool CanDoMono8x8;
- Bool CanDoColor8x8;
-
- void (*InitPixmapCache)(
- ScreenPtr pScreen,
- RegionPtr areas,
- pointer data
- );
- void (*ClosePixmapCache)(
- ScreenPtr pScreen
- );
-
- int (*StippledFillChooser)(GCPtr pGC);
- int (*OpaqueStippledFillChooser)(GCPtr pGC);
- int (*TiledFillChooser)(GCPtr pGC);
-
- int CachePixelGranularity;
- int MaxCacheableTileWidth;
- int MaxCacheableTileHeight;
- int MaxCacheableStippleWidth;
- int MaxCacheableStippleHeight;
-
- XAACacheInfoPtr (*CacheTile)(
- ScrnInfoPtr Scrn, PixmapPtr pPix
- );
- XAACacheInfoPtr (*CacheStipple)(
- ScrnInfoPtr Scrn, PixmapPtr pPix,
- int fg, int bg
- );
- XAACacheInfoPtr (*CacheMonoStipple)(
- ScrnInfoPtr Scrn, PixmapPtr pPix
- );
- XAACacheInfoPtr (*CacheMono8x8Pattern)(
- ScrnInfoPtr Scrn, int pat0, int pat1
- );
- XAACacheInfoPtr (*CacheColor8x8Pattern)(
- ScrnInfoPtr Scrn, PixmapPtr pPix,
- int fg, int bg
- );
-
-
- int MonoPatternPitch;
- int CacheWidthMono8x8Pattern;
- int CacheHeightMono8x8Pattern;
-
- int ColorPatternPitch;
- int CacheWidthColor8x8Pattern;
- int CacheHeightColor8x8Pattern;
-
- int CacheColorExpandDensity;
-
- void (*WriteBitmapToCache) (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int fg, int bg
- );
- void (*WritePixmapToCache) (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int bpp, int depth
- );
- void (*WriteMono8x8PatternToCache)(
- ScrnInfoPtr pScrn,
- XAACacheInfoPtr pCache
- );
- void (*WriteColor8x8PatternToCache)(
- ScrnInfoPtr pScrn,
- PixmapPtr pPix,
- XAACacheInfoPtr pCache
- );
-
- char* PixmapCachePrivate;
-
- /* Miscellaneous */
-
- GC ScratchGC;
- int PreAllocSize;
- unsigned char *PreAllocMem;
-
- CharInfoPtr CharInfo[255];
- NonTEGlyphInfo GlyphInfo[255];
-
- unsigned int FullPlanemask; /* deprecated */
-
- PixmapLinkPtr OffscreenPixmaps;
- int maxOffPixWidth;
- int maxOffPixHeight;
-
- XAACacheInfoRec ScratchCacheInfoRec;
-
- BoxPtr ClipBox;
-
- Bool NeedToSync;
-
- char *dgaSaves;
-
- /* These can be supplied to override the defaults */
-
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- BackingStoreSaveAreasProcPtr SaveAreas;
- BackingStoreRestoreAreasProcPtr RestoreAreas;
-
- unsigned int offscreenDepths;
- Bool offscreenDepthsInitialized;
-
- CARD32 FullPlanemasks[32];
-
-#ifdef RENDER
- Bool (*Composite) (
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height
- );
-
- Bool (*Glyphs) (
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs
- );
-
- Bool (*SetupForCPUToScreenAlphaTexture) (
- ScrnInfoPtr pScrn,
- int op,
- CARD16 red,
- CARD16 green,
- CARD16 blue,
- CARD16 alpha,
- int alphaType,
- CARD8 *alphaPtr,
- int alphaPitch,
- int width,
- int height,
- int flags
- );
- void (*SubsequentCPUToScreenAlphaTexture) (
- ScrnInfoPtr pScrn,
- int dstx,
- int dsty,
- int srcx,
- int srcy,
- int width,
- int height
- );
- int CPUToScreenAlphaTextureFlags;
- CARD32 * CPUToScreenAlphaTextureFormats;
-
- Bool (*SetupForCPUToScreenTexture) (
- ScrnInfoPtr pScrn,
- int op,
- int texType,
- CARD8 *texPtr,
- int texPitch,
- int width,
- int height,
- int flags
- );
- void (*SubsequentCPUToScreenTexture) (
- ScrnInfoPtr pScrn,
- int dstx,
- int dsty,
- int srcx,
- int srcy,
- int width,
- int height
- );
- int CPUToScreenTextureFlags;
- CARD32 * CPUToScreenTextureFormats;
-
-
-#endif
-
- /* these were added for 4.3.0 */
- BoxRec SolidLineLimits;
- BoxRec DashedLineLimits;
-
-} XAAInfoRec, *XAAInfoRecPtr;
-
-#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
-
-
-Bool
-XAAInit(
- ScreenPtr pScreen,
- XAAInfoRecPtr infoRec
-);
-
-XAAInfoRecPtr XAACreateInfoRec(void);
-
-void
-XAADestroyInfoRec(
- XAAInfoRecPtr infoRec
-);
-
-typedef void (*DepthChangeFuncPtr) (ScrnInfoPtr pScrn, int depth);
-
-Bool
-XAAInitDualFramebufferOverlay(
- ScreenPtr pScreen,
- DepthChangeFuncPtr callback
-);
-
-#endif /* _XAA_H */
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
deleted file mode 100644
index 83850767a..000000000
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.4 2003/11/10 18:22:39 tsi Exp $ */
-
-/*
- This is a lighter version of cfbBitBlt. We calculate the boxes
- when accelerating pixmap->screen and screen->screen copies.
- We also pass the GC to the doBitBlt function so that it has access
- to the fg and bg so CopyPlane can use this.
-*/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "xaalocal.h"
-
-
-RegionPtr
-XAABitBlt(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- void (*doBitBlt)(DrawablePtr, DrawablePtr, GCPtr, RegionPtr, DDXPointPtr),
- unsigned long bitPlane )
-{
-
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- RegionPtr prgnExposed;
- Bool freeSrcClip = FALSE;
- RegionRec rgnDst;
- DDXPointPtr pptSrc, ppt;
- DDXPointRec origDest;
- BoxPtr pbox;
- BoxRec fastBox;
- int i, dx, dy, numRects;
- xRectangle origSource;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate) {
- (*pSrcDrawable->pScreen->SourceValidate) (
- pSrcDrawable, srcx, srcy, width, height);
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
- if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
- if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else
- fastClip = 1;
- } else { /* Window */
- if (pGC->subWindowMode == IncludeInferiors) {
- if (!((WindowPtr) pSrcDrawable)->parent) {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- } else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE)) {
- prgnSrcClip = pGC->pCompositeClip;
- } else {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- } else {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip) {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x) {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y) {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW) {
- if (!((WindowPtr)pDstDrawable)->realized) {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip) {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
-
- cclip = pGC->pCompositeClip;
- if (REGION_NUM_RECTS(cclip) == 1) {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
- REGION_NULL(pGC->pScreen, &rgnDst);
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- } else {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
- }
- } else {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip) {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
- pGC->pCompositeClip);
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height) {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec)))) {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc);
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose) {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, bitPlane);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
diff --git a/hw/xfree86/xaa/xaaBitOrder.c b/hw/xfree86/xaa/xaaBitOrder.c
deleted file mode 100644
index d7f3ba2a3..000000000
--- a/hw/xfree86/xaa/xaaBitOrder.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.8 2003/02/17 16:08:29 dawes Exp $ */
-
-#include "Xmd.h"
-CARD32 XAAReverseBitOrder(CARD32 v);
-
-CARD32
-XAAReverseBitOrder(CARD32 v)
-{
- return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) |
- ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) |
- ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) |
- ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7));
-}
diff --git a/hw/xfree86/xaa/xaaBitmap.c b/hw/xfree86/xaa/xaaBitmap.c
deleted file mode 100644
index 9a8749dbf..000000000
--- a/hw/xfree86/xaa/xaaBitmap.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c,v 1.10 2000/09/01 05:49:45 mvojkovi Exp $ */
-
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-
-
-
-/********** byte swapping ***************/
-
-
-#ifdef FIXEDBASE
-# define DEST(i) *dest
-# define RETURN(i) return(dest)
-#else
-# define DEST(i) dest[i]
-# define RETURN(i) return(dest + i)
-#endif
-
-#ifdef MSBFIRST
-# define SOURCE(i) SWAP_BITS_IN_BYTES(src[i])
-#else
-# define SOURCE(i) src[i]
-#endif
-
-
-typedef CARD32 *(* BitmapScanlineProcPtr)(CARD32 *, CARD32 *, int, int);
-
-#ifdef TRIPLE_BITS
-static CARD32*
-BitmapScanline(
- CARD32 *src, CARD32 *base,
- int count, int skipleft )
-{
- CARD32 bits;
-
- while(count >= 3) {
- bits = *src;
- WRITE_BITS3(bits);
- src++;
- count -= 3;
- }
- if (count == 2) {
- bits = *src;
- WRITE_BITS2(bits);
- } else if (count == 1) {
- bits = *src;
- WRITE_BITS1(bits);
- }
-
- return base;
-}
-
-static CARD32*
-BitmapScanline_Inverted(
- CARD32 *src, CARD32 *base,
- int count, int skipleft )
-{
- CARD32 bits;
-
- while(count >= 3) {
- bits = ~(*src);
- WRITE_BITS3(bits);
- src++;
- count -= 3;
- }
- if (count == 2) {
- bits = ~(*src);
- WRITE_BITS2(bits);
- } else if (count == 1) {
- bits = ~(*src);
- WRITE_BITS1(bits);
- }
-
- return base;
-}
-
-
-static CARD32*
-BitmapScanline_Shifted(
- CARD32 *src, CARD32 *base,
- int count, int skipleft )
-{
- CARD32 bits;
-
- while(count >= 3) {
- bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
- WRITE_BITS3(bits);
- src++;
- count -= 3;
- }
- if (count == 2) {
- bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
- WRITE_BITS2(bits);
- } else if (count == 1) {
- bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
- WRITE_BITS1(bits);
- }
-
- return base;
-}
-
-static CARD32*
-BitmapScanline_Shifted_Inverted(
- CARD32 *src, CARD32 *base,
- int count, int skipleft )
-{
- CARD32 bits;
-
- while(count >= 3) {
- bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
- WRITE_BITS3(bits);
- src++;
- count -= 3;
- }
- if (count == 2) {
- bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
- WRITE_BITS2(bits);
- } else if (count == 1) {
- bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
- WRITE_BITS1(bits);
- }
-
- return base;
-}
-
-#define BitmapScanline_Shifted_Careful BitmapScanline_Shifted
-#define BitmapScanline_Shifted_Inverted_Careful BitmapScanline_Shifted_Inverted
-
-#else
-static CARD32*
-BitmapScanline(
- CARD32 *src, CARD32 *dest,
- int count, int skipleft )
-{
- while(count >= 4) {
- DEST(0) = SOURCE(0);
- DEST(1) = SOURCE(1);
- DEST(2) = SOURCE(2);
- DEST(3) = SOURCE(3);
- count -= 4;
- src += 4;
-#ifndef FIXEDBASE
- dest += 4;
-#endif
- }
-
- if(!count) return dest;
- DEST(0) = SOURCE(0);
- if(count == 1) RETURN(1);
- DEST(1) = SOURCE(1);
- if(count == 2) RETURN(2);
- DEST(2) = SOURCE(2);
- RETURN(3);
-}
-
-static CARD32*
-BitmapScanline_Inverted(
- CARD32 *src, CARD32 *dest,
- int count, int skipleft )
-{
- while(count >= 4) {
- DEST(0) = ~SOURCE(0);
- DEST(1) = ~SOURCE(1);
- DEST(2) = ~SOURCE(2);
- DEST(3) = ~SOURCE(3);
- count -= 4;
- src += 4;
-#ifndef FIXEDBASE
- dest += 4;
-#endif
- }
-
- if(!count) return dest;
- DEST(0) = ~SOURCE(0);
- if(count == 1) RETURN(1);
- DEST(1) = ~SOURCE(1);
- if(count == 2) RETURN(2);
- DEST(2) = ~SOURCE(2);
- RETURN(3);
-}
-
-
-static CARD32*
-BitmapScanline_Shifted(
- CARD32 *bits, CARD32 *base,
- int count, int skipleft )
-{
- while(count--) {
- register CARD32 tmp = SHIFT_R(*bits,skipleft) |
- SHIFT_L(*(bits + 1),(32 - skipleft));
- WRITE_BITS(tmp);
- bits++;
- }
- return base;
-}
-
-static CARD32*
-BitmapScanline_Shifted_Inverted(
- CARD32 *bits, CARD32 *base,
- int count, int skipleft )
-{
- while(count--) {
- register CARD32 tmp = ~(SHIFT_R(*bits,skipleft) |
- SHIFT_L(*(bits + 1),(32 - skipleft)));
- WRITE_BITS(tmp);
- bits++;
- }
- return base;
-}
-
-static CARD32*
-BitmapScanline_Shifted_Careful(
- CARD32 *bits, CARD32 *base,
- int count, int skipleft )
-{
- register CARD32 tmp;
- while(--count) {
- tmp = SHIFT_R(*bits,skipleft) | SHIFT_L(*(bits + 1),(32 - skipleft));
- WRITE_BITS(tmp);
- bits++;
- }
- tmp = SHIFT_R(*bits,skipleft);
- WRITE_BITS(tmp);
-
- return base;
-}
-
-static CARD32*
-BitmapScanline_Shifted_Inverted_Careful(
- CARD32 *bits, CARD32 *base,
- int count, int skipleft )
-{
- register CARD32 tmp;
- while(--count) {
- tmp = ~(SHIFT_R(*bits,skipleft) | SHIFT_L(*(bits + 1),(32 - skipleft)));
- WRITE_BITS(tmp);
- bits++;
- }
- tmp = ~(SHIFT_R(*bits,skipleft));
- WRITE_BITS(tmp);
- return base;
-}
-
-#endif
-
-/*
- When the accelerator is TRANSPARENCY_ONLY, WriteBitmap can do
- the fill in two passes, inverting the source on the second pass.
- For GXcopy we can fill the backing rectangle as a solid rect and
- avoid the invert.
-*/
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAWriteBitmapColorExpand3)(
-#else
-EXPNAME(XAAWriteBitmapColorExpand)(
-#endif
- ScrnInfoPtr pScrn,
- int x, int y, int w, int H,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32* base;
- unsigned char *srcp = src;
- int SecondPassColor = -1;
- int shift = 0, dwords;
- BitmapScanlineProcPtr firstFunc;
- BitmapScanlineProcPtr secondFunc;
- int flag;
- int h = H;
-
-#ifdef TRIPLE_BITS
- if((bg != -1) &&
- ((infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) ||
- ((infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
- (!CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg != -1) &&
- (infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
- if((rop == GXcopy) && infoRec->SetupForSolidFill) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- } else SecondPassColor = bg;
- bg = -1;
- }
-
-#ifdef TRIPLE_BITS
- if(skipleft) {
-#else
- if(skipleft &&
- (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING) ||
- (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
- (skipleft > x)))) {
-#endif
- if((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
- /* don't read past the end */
- firstFunc = BitmapScanline_Shifted_Careful;
- secondFunc = BitmapScanline_Shifted_Inverted_Careful;
- } else {
- firstFunc = BitmapScanline_Shifted;
- secondFunc = BitmapScanline_Shifted_Inverted;
- }
- shift = skipleft;
- skipleft = 0;
- } else {
- firstFunc = BitmapScanline;
- secondFunc = BitmapScanline_Inverted;
- w += skipleft;
- x -= skipleft;
- }
-
-#ifdef TRIPLE_BITS
- dwords = (3 * w + 31) >> 5;
-#else
- dwords = (w + 31) >> 5;
-#endif
-
-SECOND_PASS:
-
- flag = (infoRec->CPUToScreenColorExpandFillFlags
- & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, x, y, w, h, skipleft);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
-#ifndef FIXEDBASE
- if((dwords * h) <= infoRec->ColorExpandRange)
- while(h--) {
- base = (*firstFunc)((CARD32*)srcp, base, dwords, shift);
- srcp += srcwidth;
- }
- else
-#endif
- while(h--) {
- (*firstFunc)((CARD32*)srcp, base, dwords, shift);
- srcp += srcwidth;
- }
-
- if(flag){
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
- if(SecondPassColor != -1) {
- h = H; /* Reset height */
- fg = SecondPassColor;
- SecondPassColor = -1;
- firstFunc = secondFunc;
- srcp = src;
- goto SECOND_PASS;
- }
-
- if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAWriteBitmapScanlineColorExpand3)(
-#else
-EXPNAME(XAAWriteBitmapScanlineColorExpand)(
-#endif
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32* base;
- unsigned char *srcp = src;
- int SecondPassColor = -1;
- int shift = 0, dwords, bufferNo;
- BitmapScanlineProcPtr firstFunc;
- BitmapScanlineProcPtr secondFunc;
-
-#ifdef TRIPLE_BITS
- if((bg != -1) &&
- ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)
- || ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
- (!CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg != -1) &&
- (infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)){
-#endif
- if((rop == GXcopy) && infoRec->SetupForSolidFill) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- } else SecondPassColor = bg;
- bg = -1;
- }
-
-#ifdef TRIPLE_BITS
- if(skipleft) {
-#else
- if(skipleft &&
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- LEFT_EDGE_CLIPPING) ||
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- LEFT_EDGE_CLIPPING_NEGATIVE_X) && (skipleft > x)))) {
-#endif
- if((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
- /* don't read past the end */
- firstFunc = BitmapScanline_Shifted_Careful;
- secondFunc = BitmapScanline_Shifted_Inverted_Careful;
- } else {
- firstFunc = BitmapScanline_Shifted;
- secondFunc = BitmapScanline_Shifted_Inverted;
- }
- shift = skipleft;
- skipleft = 0;
- } else {
- firstFunc = BitmapScanline;
- secondFunc = BitmapScanline_Inverted;
- w += skipleft;
- x -= skipleft;
- }
-
-#ifdef TRIPLE_BITS
- dwords = (3 * w + 31) >> 5;
-#else
- dwords = (w + 31) >> 5;
-#endif
-
-SECOND_PASS:
-
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, x, y, w, h, skipleft);
-
- bufferNo = 0;
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- (*firstFunc)((CARD32*)srcp, base, dwords, shift);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- srcp += srcwidth;
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
- if(SecondPassColor != -1) {
- fg = SecondPassColor;
- SecondPassColor = -1;
- firstFunc = secondFunc;
- srcp = src;
- goto SECOND_PASS;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-#endif
diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c
deleted file mode 100644
index 497c3e7a1..000000000
--- a/hw/xfree86/xaa/xaaCpyArea.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyArea.c,v 1.13 2001/02/19 22:19:49 mvojkovi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-/*
- Written mostly by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
- */
-
-
-RegionPtr
-XAACopyArea(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(pDstDrawable->type == DRAWABLE_WINDOW) {
- if((pSrcDrawable->type == DRAWABLE_WINDOW) ||
- IS_OFFSCREEN_PIXMAP(pSrcDrawable)){
- if(infoRec->ScreenToScreenBitBlt &&
- CHECK_ROP(pGC,infoRec->ScreenToScreenBitBltFlags) &&
- CHECK_ROPSRC(pGC,infoRec->ScreenToScreenBitBltFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->ScreenToScreenBitBltFlags))
- return (XAABitBlt( pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty,
- XAADoBitBlt, 0L));
- } else {
- if(infoRec->WritePixmap &&
- ((pDstDrawable->bitsPerPixel == pSrcDrawable->bitsPerPixel) ||
- ((pDstDrawable->bitsPerPixel == 24) &&
- (pSrcDrawable->bitsPerPixel == 32) &&
- (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
- CHECK_ROP(pGC,infoRec->WritePixmapFlags) &&
- CHECK_ROPSRC(pGC,infoRec->WritePixmapFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->WritePixmapFlags) &&
- CHECK_NO_GXCOPY(pGC,infoRec->WritePixmapFlags))
- return (XAABitBlt( pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty,
- XAADoImageWrite, 0L));
- }
- } else if(IS_OFFSCREEN_PIXMAP(pDstDrawable)){
- if((pSrcDrawable->type == DRAWABLE_WINDOW) ||
- IS_OFFSCREEN_PIXMAP(pSrcDrawable)){
- if(infoRec->ScreenToScreenBitBlt &&
- CHECK_ROP(pGC,infoRec->ScreenToScreenBitBltFlags) &&
- CHECK_ROPSRC(pGC,infoRec->ScreenToScreenBitBltFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->ScreenToScreenBitBltFlags))
- return (XAABitBlt( pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty,
- XAADoBitBlt, 0L));
- }
- }
-
- return (XAAFallbackOps.CopyArea(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx, dsty));
-}
-
-
-void
-XAADoBitBlt(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc )
-{
- int nbox, careful;
- BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- int xdir, ydir;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1)) {
- /* walk source botttom to top */
- ydir = -1;
-
- if (nbox > 1) {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1)) {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1) {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2) {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* walk source left to right */
- xdir = 1;
- }
-
- (*infoRec->ScreenToScreenBitBlt)(infoRec->pScrn, nbox, pptSrc, pbox,
- xdir, ydir, pGC->alu, pGC->planemask);
-
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-
-}
-
-void
-XAADoImageWrite(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc )
-{
- int srcwidth;
- unsigned char* psrcBase; /* start of image */
- unsigned char* srcPntr; /* index into the image */
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int nbox = REGION_NUM_RECTS(prgnDst);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int Bpp = pSrc->bitsPerPixel >> 3;
-
- psrcBase = (unsigned char *)((PixmapPtr)pSrc)->devPrivate.ptr;
- srcwidth = (int)((PixmapPtr)pSrc)->devKind;
-
- for(; nbox; pbox++, pptSrc++, nbox--) {
- srcPntr = psrcBase + (pptSrc->y * srcwidth) + (pptSrc->x * Bpp);
-
- (*infoRec->WritePixmap)(infoRec->pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, srcPntr, srcwidth,
- pGC->alu, pGC->planemask, -1, pSrc->bitsPerPixel, pSrc->depth);
- }
-}
-
-
-void
-XAADoImageRead(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc )
-{
- int dstwidth;
- unsigned char* pdstBase; /* start of image */
- unsigned char* dstPntr; /* index into the image */
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int nbox = REGION_NUM_RECTS(prgnDst);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both
- src and dst have same bpp */
-
- pdstBase = (unsigned char *)((PixmapPtr)pDst)->devPrivate.ptr;
- dstwidth = (int)((PixmapPtr)pDst)->devKind;
-
- for(; nbox; pbox++, pptSrc++, nbox--) {
- dstPntr = pdstBase + (pbox->y1 * dstwidth) + (pbox->x1 * Bpp);
-
- (*infoRec->ReadPixmap)(infoRec->pScrn, pptSrc->x, pptSrc->y,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, dstPntr, dstwidth,
- pSrc->bitsPerPixel, pSrc->depth);
- }
-}
-
-
-void
-XAAScreenToScreenBitBlt(
- ScrnInfoPtr pScrn,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir, int ydir,
- int alu,
- unsigned int planemask )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int dirsetup;
-
- if ((!(infoRec->CopyAreaFlags & ONLY_TWO_BITBLT_DIRECTIONS)
- || (xdir == ydir)) &&
- (!(infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT)
- || (xdir == 1))) {
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- xdir, ydir, alu, planemask, -1);
- for (; nbox; pbox++, pptSrc++, nbox--)
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
- pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- SET_SYNC_FLAG(infoRec);
- return;
- }
-
- if (infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT) {
- /*
- * This is the case of a chip that only supports xdir = 1,
- * with ydir = 1 or ydir = -1, but we have xdir = -1.
- */
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- 1, ydir, alu, planemask, -1);
- for (; nbox; pbox++, pptSrc++, nbox--)
- if (pptSrc->y != pbox->y1 || pptSrc->x >= pbox->x1)
- /* No problem. Do a xdir = 1 blit instead. */
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pptSrc->x, pptSrc->y, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- else
- {
- /*
- * This is the difficult case. Needs striping into
- * non-overlapping horizontal chunks.
- */
- int stripeWidth, w, fullStripes, extra, i;
- stripeWidth = 16;
- w = pbox->x2 - pbox->x1;
- if (pbox->x1 - pptSrc->x < stripeWidth)
- stripeWidth = pbox->x1 - pptSrc->x;
- fullStripes = w / stripeWidth;
- extra = w % stripeWidth;
-
- /* First, take care of the little bit on the far right */
- if (extra)
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pptSrc->x + fullStripes * stripeWidth, pptSrc->y,
- pbox->x1 + fullStripes * stripeWidth, pbox->y1,
- extra, pbox->y2 - pbox->y1);
-
- /* Now, take care of the rest of the blit */
- for (i = fullStripes - 1; i >= 0; i--)
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pptSrc->x + i * stripeWidth, pptSrc->y,
- pbox->x1 + i * stripeWidth, pbox->y1,
- stripeWidth, pbox->y2 - pbox->y1);
- }
- SET_SYNC_FLAG(infoRec);
- return;
- }
-
- /*
- * Now the case of a chip that only supports xdir = ydir = 1 or
- * xdir = ydir = -1, but we have xdir != ydir.
- */
- dirsetup = 0; /* No direction set up yet. */
- for (; nbox; pbox++, pptSrc++, nbox--) {
- if (xdir == 1 && pptSrc->y != pbox->y1) {
- /* Do a xdir = ydir = -1 blit instead. */
- if (dirsetup != -1) {
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- -1, -1, alu, planemask, -1);
- dirsetup = -1;
- }
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
- pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- }
- else if (xdir == -1 && pptSrc->y != pbox->y1) {
- /* Do a xdir = ydir = 1 blit instead. */
- if (dirsetup != 1) {
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- 1, 1, alu, planemask, -1);
- dirsetup = 1;
- }
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
- pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- }
- else
- if (xdir == 1) {
- /*
- * xdir = 1, ydir = -1.
- * Perform line-by-line xdir = ydir = 1 blits, going up.
- */
- int i;
- if (dirsetup != 1) {
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- 1, 1, alu, planemask, -1);
- dirsetup = 1;
- }
- for (i = pbox->y2 - pbox->y1 - 1; i >= 0; i--)
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pptSrc->x, pptSrc->y + i, pbox->x1, pbox->y1 + i,
- pbox->x2 - pbox->x1, 1);
- }
- else {
- /*
- * xdir = -1, ydir = 1.
- * Perform line-by-line xdir = ydir = -1 blits, going down.
- */
- int i;
- if (dirsetup != -1) {
- (*infoRec->SetupForScreenToScreenCopy)(pScrn,
- -1, -1, alu, planemask, -1);
- dirsetup = -1;
- }
- for (i = 0; i < pbox->y2 - pbox->y1; i++)
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pptSrc->x, pptSrc->y + i, pbox->x1, pbox->y1 + i,
- pbox->x2 - pbox->x1, 1);
- }
- } /* next box */
- SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c
deleted file mode 100644
index d3d1c8a5c..000000000
--- a/hw/xfree86/xaa/xaaCpyPlane.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.14 2003/11/10 18:22:40 tsi Exp $ */
-
-/*
- A CopyPlane function that handles bitmap->screen copies and
- sends anything else to the Fallback.
-
- Also, a PushPixels for solid fill styles.
-
- Written by Mark Vojkovich (markv@valinux.com)
-
-*/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "servermd.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-
-static void XAACopyPlane1toNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, RegionPtr rgnDst,
- DDXPointPtr pptSrc);
-static void XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, RegionPtr rgnDst,
- DDXPointPtr pptSrc);
-
-
-static unsigned long TmpBitPlane;
-
-RegionPtr
-XAACopyPlaneColorExpansion(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- if((pSrc->type == DRAWABLE_PIXMAP) && !XAA_DEPTH_BUG(pGC)) {
- if(pSrc->bitsPerPixel == 1) {
- return(XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
- width, height, dstx, dsty,
- XAACopyPlane1toNColorExpand, bitPlane));
- } else if(bitPlane < (1 << pDst->depth)){
- TmpBitPlane = bitPlane;
- return(XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
- width, height, dstx, dsty,
- XAACopyPlaneNtoNColorExpand, bitPlane));
- }
- }
-
- return (XAAFallbackOps.CopyPlane(pSrc, pDst, pGC, srcx, srcy,
- width, height, dstx, dsty, bitPlane));
-}
-
-
-static void
-XAACopyPlane1toNColorExpand(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- RegionPtr rgnDst,
- DDXPointPtr pptSrc )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- BoxPtr pbox = REGION_RECTS(rgnDst);
- int numrects = REGION_NUM_RECTS(rgnDst);
- unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
- int srcwidth = ((PixmapPtr)pSrc)->devKind;
-
- while(numrects--) {
- (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- src + (srcwidth * pptSrc->y) + ((pptSrc->x >> 5) << 2),
- srcwidth, pptSrc->x & 31,
- pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask);
- pbox++; pptSrc++;
- }
-}
-
-
-static void
-XAACopyPlaneNtoNColorExpand(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- RegionPtr rgnDst,
- DDXPointPtr pptSrc
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- BoxPtr pbox = REGION_RECTS(rgnDst);
- int numrects = REGION_NUM_RECTS(rgnDst);
- unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
- unsigned char *data, *srcPtr, *dataPtr;
- int srcwidth = ((PixmapPtr)pSrc)->devKind;
- int pitch, width, height, h, i, index, offset;
- int Bpp = pSrc->bitsPerPixel >> 3;
- unsigned long mask = TmpBitPlane;
-
- if(TmpBitPlane < 8) {
- offset = 0;
- } else if(TmpBitPlane < 16) {
- offset = 1;
- mask >>= 8;
- } else if(TmpBitPlane < 24) {
- offset = 2;
- mask >>= 16;
- } else {
- offset = 3;
- mask >>= 24;
- }
-
- if(IS_OFFSCREEN_PIXMAP(pSrc))
- SYNC_CHECK(pSrc);
-
- while(numrects--) {
- width = pbox->x2 - pbox->x1;
- h = height = pbox->y2 - pbox->y1;
- pitch = BitmapBytePad(width);
-
- if(!(data = xalloc(height * pitch)))
- goto ALLOC_FAILED;
-
- bzero(data, height * pitch);
-
- dataPtr = data;
- srcPtr = ((pptSrc->y) * srcwidth) + src +
- ((pptSrc->x) * Bpp) + offset;
-
- while(h--) {
- for(i = index = 0; i < width; i++, index += Bpp) {
- if(mask & srcPtr[index])
- dataPtr[i >> 3] |= (1 << (i & 7));
- }
- dataPtr += pitch;
- srcPtr += srcwidth;
- }
-
- (*infoRec->WriteBitmap)(infoRec->pScrn,
- pbox->x1, pbox->y1, width, height, data, pitch, 0,
- pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask);
-
- xfree(data);
-
-ALLOC_FAILED:
-
- pbox++; pptSrc++;
- }
-}
-
-void
-XAAPushPixelsSolidColorExpansion(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy,
- int xOrg, int yOrg )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
- BoxPtr pbox, pClipBoxes;
- int nboxes, srcx, srcy;
- xRectangle TheRect;
- unsigned char *src = pBitMap->devPrivate.ptr;
- int srcwidth = pBitMap->devKind;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- TheRect.x = xOrg;
- TheRect.y = yOrg;
- TheRect.width = dx;
- TheRect.height = dy;
-
- if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) {
- pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec));
- if(!pClipBoxes) return;
- } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
-
- nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
- pbox = pClipBoxes;
-
- while(nboxes--) {
- srcx = pbox->x1 - xOrg;
- srcy = pbox->y1 - yOrg;
- (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- src + (srcwidth * srcy) + ((srcx >> 5) << 2),
- srcwidth, srcx & 31,
- pGC->fgPixel, -1, pGC->alu, pGC->planemask);
- pbox++;
- }
-
- if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem)
- xfree(pClipBoxes);
-}
-
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
deleted file mode 100644
index b77be1ad6..000000000
--- a/hw/xfree86/xaa/xaaCpyWin.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.4 2003/11/10 18:22:40 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-/*
- Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
-*/
-
-void
-XAACopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc )
-{
- DDXPointPtr pptSrc, ppt;
- RegionRec rgnDst;
- BoxPtr pbox;
- int dx, dy, nbox;
- WindowPtr pwinRoot;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
-
- if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
- XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
- if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow);
- return;
- }
-
- pwinRoot = WindowTable[pScreen->myNum];
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox ||
- !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
- REGION_UNINIT(pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- while(nbox--) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- ppt++; pbox++;
- }
-
- infoRec->ScratchGC.planemask = ~0L;
- infoRec->ScratchGC.alu = GXcopy;
-
- XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
- DEALLOCATE_LOCAL(pptSrc);
- REGION_UNINIT(pScreen, &rgnDst);
-}
diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c
deleted file mode 100644
index 212116ae4..000000000
--- a/hw/xfree86/xaa/xaaDashLine.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaDashLine.c,v 1.5 2002/09/18 18:14:59 martin Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-void
-#ifdef POLYSEGMENT
-XAAPolySegmentDashed(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-#else
-XAAPolyLinesDashed(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode, /* Origin or Previous */
- int npt, /* number of points */
- DDXPointPtr pptInit
-#endif
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
- BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
- int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int xorg = pDrawable->x;
- int yorg = pDrawable->y;
- int nbox;
- BoxPtr pbox;
-#ifndef POLYSEGMENT
- DDXPointPtr ppt;
-#endif
- unsigned int oc1, oc2;
- int dmin, dmaj, e, octant;
- int x1, x2, y1, y2, tmp, len, offset;
- int PatternLength, PatternOffset;
-
- if(!nboxInit)
- return;
-
- if (infoRec->DashedLineFlags & LINE_LIMIT_COORDS) {
- int minValX = infoRec->DashedLineLimits.x1;
- int maxValX = infoRec->DashedLineLimits.x2;
- int minValY = infoRec->DashedLineLimits.y1;
- int maxValY = infoRec->DashedLineLimits.y2;
-#ifdef POLYSEGMENT
- int n = nseg;
- xSegment *s = pSeg;
-
- while (n--)
-#else
- int n = npt;
- int xorgtmp = xorg;
- int yorgtmp = yorg;
-
- ppt = pptInit;
- x2 = ppt->x + xorgtmp;
- y2 = ppt->y + yorgtmp;
- while (--n)
-#endif
- {
-#ifdef POLYSEGMENT
- x1 = s->x1 + xorg;
- y1 = s->y1 + yorg;
- x2 = s->x2 + xorg;
- y2 = s->y2 + yorg;
- s++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorgtmp = x1;
- yorgtmp = y1;
- }
- x2 = ppt->x + xorgtmp;
- y2 = ppt->y + yorgtmp;
-#endif
- if (x1 > maxValX || x1 < minValX ||
- x2 > maxValX || x2 < minValX ||
- y1 > maxValY || y1 < minValY ||
- y2 > maxValY || y2 < minValY) {
-#ifdef POLYSEGMENT
- XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
-#else
- XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
-#endif
- return;
- }
- }
- }
-
- PatternLength = pGCPriv->DashLength;
- PatternOffset = pGC->dashOffset % PatternLength;
-
- (*infoRec->SetupForDashedLine)(infoRec->pScrn, pGC->fgPixel,
- (pGC->lineStyle == LineDoubleDash) ? pGC->bgPixel : -1,
- pGC->alu, pGC->planemask, PatternLength, pGCPriv->DashPattern);
-
-
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
-
- if (infoRec->SubsequentDashedBresenhamLine) {
- if((dmaj = x2 - x1) < 0) {
- dmaj = -dmaj;
- octant = XDECREASING;
- } else octant = 0;
-
- if((dmin = y2 - y1) < 0) {
- dmin = -dmin;
- octant |= YDECREASING;
- }
-
- if(dmin >= dmaj){
- tmp = dmin; dmin = dmaj; dmaj = tmp;
- octant |= YMAJOR;
- }
-
- e = -dmaj - ((bias >> octant) & 1);
- len = dmaj;
- dmin <<= 1;
- dmaj <<= 1;
- } else { /* Muffle compiler */
- dmin = dmaj = e = octant = len = 0;
- }
-
- while(nbox--) {
- oc1 = oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if (!(oc1 | oc2)) { /* uncliped */
- if(infoRec->SubsequentDashedTwoPointLine) {
- (*infoRec->SubsequentDashedTwoPointLine)(
- infoRec->pScrn, x1, y1, x2, y2,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? 0 :
-#endif
- OMIT_LAST, PatternOffset);
- } else {
- (*infoRec->SubsequentDashedBresenhamLine)(
- infoRec->pScrn, x1, y1, dmaj, dmin, e,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? (len+1) :
-#endif
- len, octant, PatternOffset);
- }
- break;
- } else if (oc1 & oc2) { /* completely clipped */
- pbox++;
- } else if (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE) {
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- pbox->x1, pbox->y1, pbox->x2 - 1, pbox->y2 - 1);
-
- if(infoRec->SubsequentDashedBresenhamLine) {
- (*infoRec->SubsequentDashedBresenhamLine)(
- infoRec->pScrn, x1, y1, dmaj, dmin, e,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? (len+1) :
-#endif
- len, octant, PatternOffset);
- } else {
- (*infoRec->SubsequentDashedTwoPointLine)(
- infoRec->pScrn, x1, y1, x2, y2,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? 0 :
-#endif
- OMIT_LAST, PatternOffset
- );
- }
- (*infoRec->DisableClipping)(infoRec->pScrn);
- pbox++;
- } else {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int err, adx, ady;
-
- if(octant & YMAJOR) {
- ady = dmaj >> 1;
- adx = dmin >> 1;
- } else {
- ady = dmin >> 1;
- adx = dmaj >> 1;
- }
-
- if (miZeroClipLine(pbox->x1, pbox->y1,
- pbox->x2 - 1, pbox->y2 - 1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (octant & YMAJOR)
- len = abs(new_y2 - new_y1);
- else
- len = abs(new_x2 - new_x1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- int abserr, clipdx, clipdy;
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
-
- if (octant & YMAJOR)
- err = e + clipdy*dmin - clipdx*dmaj;
- else
- err = e + clipdx*dmin - clipdy*dmaj;
- } else
- err = e;
-
-#define range infoRec->DashedBresenhamLineErrorTermBits
- abserr = abs(err);
- while((abserr & range) ||
- (dmaj & range) ||
- (dmin & range)) {
- dmin >>= 1;
- dmaj >>= 1;
- abserr >>= 1;
- err /= 2;
- }
-
- if(octant & YMAJOR)
- offset = abs(new_y1 - y1);
- else
- offset = abs(new_x1 - x1);
-
- offset += PatternOffset;
- offset %= PatternLength;
-
- (*infoRec->SubsequentDashedBresenhamLine)(
- infoRec->pScrn, new_x1, new_y1,
- dmaj, dmin, err, len, octant, offset);
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- len = abs(y2 - y1);
- tmp = abs(x2 - x1);
- PatternOffset += (len > tmp) ? len : tmp;
- PatternOffset %= PatternLength;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--) {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
- (x2 < pbox->x2) && (y2 < pbox->y2))
- {
- if(infoRec->SubsequentDashedTwoPointLine) {
- (*infoRec->SubsequentDashedTwoPointLine)(
- infoRec->pScrn, x2, y2, x2, y2, 0,
- PatternOffset);
- } else {
- (*infoRec->SubsequentDashedBresenhamLine)(
- infoRec->pScrn, x2, y2, 2, 0, -1,
- 1, 0, PatternOffset);
- }
- break;
- } else
- pbox++;
- }
- }
-#endif
-
- SET_SYNC_FLAG(infoRec);
-}
-
diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c
deleted file mode 100644
index 01b4bb408..000000000
--- a/hw/xfree86/xaa/xaaFallback.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFallback.c,v 1.5 1999/05/30 03:03:31 dawes Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-
-
-static void
-XAAFillSpansFallback(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAASetSpansFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPutImageFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-XAACopyAreaFallback(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty )
-{
- RegionPtr ret;
-
- XAA_GC_OP_PROLOGUE(pGC);
- if((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
- IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
- SYNC_CHECK(pGC);
- }
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- XAA_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static RegionPtr
-XAACopyPlaneFallback(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane )
-{
- RegionPtr ret;
-
- XAA_GC_OP_PROLOGUE(pGC);
- if((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
- IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
- SYNC_CHECK(pGC);
- }
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- XAA_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAPolyPointFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolylinesFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolySegmentFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyRectangleFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyArcFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAFillPolygonFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillRectFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillArcFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static int
-XAAPolyText8Fallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars )
-{
- int ret;
-
- XAA_GC_OP_PROLOGUE(pGC);
- SYNC_CHECK(pGC);
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- XAA_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static int
-XAAPolyText16Fallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars )
-{
- int ret;
-
- XAA_GC_OP_PROLOGUE(pGC);
- SYNC_CHECK(pGC);
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- XAA_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAImageText8Fallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAImageText16Fallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAImageGlyphBltFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyGlyphBltFallback(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPushPixelsFallback(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg )
-{
- XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
- SYNC_CHECK(pGC);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- XAA_GC_OP_EPILOGUE(pGC);
-}
-
-GCOps XAAFallbackOps = {
- XAAFillSpansFallback, XAASetSpansFallback,
- XAAPutImageFallback, XAACopyAreaFallback,
- XAACopyPlaneFallback, XAAPolyPointFallback,
- XAAPolylinesFallback, XAAPolySegmentFallback,
- XAAPolyRectangleFallback, XAAPolyArcFallback,
- XAAFillPolygonFallback, XAAPolyFillRectFallback,
- XAAPolyFillArcFallback, XAAPolyText8Fallback,
- XAAPolyText16Fallback, XAAImageText8Fallback,
- XAAImageText16Fallback, XAAImageGlyphBltFallback,
- XAAPolyGlyphBltFallback, XAAPushPixelsFallback,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
-
-
-
diff --git a/hw/xfree86/xaa/xaaFillArc.c b/hw/xfree86/xaa/xaaFillArc.c
deleted file mode 100644
index 352d8e084..000000000
--- a/hw/xfree86/xaa/xaaFillArc.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 1996 The XFree86 Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillArc.c,v 1.4 1999/05/30 03:03:31 dawes Exp $ */
-
-/*
- * Filled solid arcs, based on cfbfillarc.c.
- *
- * Fill arc using calls to low-level span fill. Because the math for
- * each span can be done concurrently with the drawing of the span
- * with a graphics coprocessor operation, this is faster than just
- * using miPolyFillArc, which first calculates all the spans and then
- * calls FillSpans.
- *
- * Clipped arcs are dispatched to FillSpans.
- */
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "mifillarc.h"
-#include "mi.h"
-
-/*
- * This is based on the integer-math versions from mi. Perhaps on a
- * Pentium, the floating-point (double)-math version is faster.
- */
-
-static void
-XAAFillEllipseSolid(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- register int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- int slw;
- miFillArcRec info;
-
- (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
- pGC->planemask);
-
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- }
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- if (slw > 0) {
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn, xorg - x,
- yorg - y, slw, 1);
- if (miFillArcLower(slw))
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
- xorg - x, yorg + y + dy, slw, 1);
- }
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-#define ADDSPAN(l,r) \
- if (r >= l) \
- (*infoRec->SubsequentSolidFillRect)( \
- infoRec->pScrn, l, ya, r - l + 1, 1);
-
-#define ADDSLICESPANS(flip) \
- if (!flip) \
- { \
- ADDSPAN(xl, xr); \
- } \
- else \
- { \
- xc = xorg - x; \
- ADDSPAN(xc, xr); \
- xc += slw - 1; \
- ADDSPAN(xl, xc); \
- }
-
-static void
-XAAFillArcSliceSolid(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int ya, xl, xr, xc;
-
- (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
- pGC->planemask);
-
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- slw = arc->height;
- if (slice.flip_top || slice.flip_bot)
- slw += (arc->height >> 1) + 1;
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- }
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- ya = yorg - y;
- MIARCSLICEUPPER(xl, xr, slice, slw);
-
- ADDSLICESPANS(slice.flip_top);
- }
- if (miFillSliceLower(slice))
- {
- ya = yorg + y + dy;
- MIARCSLICELOWER(xl, xr, slice, slw);
- ADDSLICESPANS(slice.flip_bot);
- }
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-void
-XAAPolyFillArcSolid(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- int x2, y2;
- BoxRec box;
- RegionPtr cclip;
-
- cclip = pGC->pCompositeClip;
-
- if(!REGION_NUM_RECTS(cclip))
- return;
-
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- XAAFillEllipseSolid(pDraw, pGC, arc);
- else
- XAAFillArcSliceSolid(pDraw, pGC, arc);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c
deleted file mode 100644
index 5566f51e6..000000000
--- a/hw/xfree86/xaa/xaaFillPoly.c
+++ /dev/null
@@ -1,960 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.16 2003/03/23 03:41:44 mvojkovi Exp $ */
-
-/*
- * Copyright 1996 The XFree86 Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Written by Mark Vojkovich. Loosly based on an original version
- * written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net) which
- * only did solid rectangles and didn't have trapezoid support.
- *
- */
-
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "micoord.h"
-
-#include "xaa.h"
-#include "xaalocal.h"
-
-#define POLY_USE_MI 0
-#define POLY_FULLY_CLIPPED 1
-#define POLY_IS_EASY 2
-
-
-#define Setup(c,x,vertex,dx,dy,e,sign,step,DX) {\
- x = intToX(vertex); \
- if ((dy = intToY(c) - y)) { \
- DX = dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) \
- { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx %= dy; \
- } \
- } \
- else \
- { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx %= dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) \
- { \
- x += sign; \
- e -= dy; \
- } \
-}
-
-#define FixError(x, dx, dy, e, sign, step, h) { \
- e += (h) * dx; \
- x += (h) * step; \
- if(e > 0) { \
- x += e * sign/dy; \
- e %= dy; \
- if(e) { \
- x += sign; \
- e -= dy; \
- } \
- } \
-}
-
-
-/*
- XAAIsEasyPoly -
-
- Checks CoordModeOrigin one rect polygons to see if we need
- to use Mi.
- Returns: POLY_USE_MI, POLY_FULLY_CLIPPED or POLY_IS_EASY
- as well as the pointer to the "top" point and the y
- extents.
-*/
-
-int
-XAAIsEasyPolygon(
- DDXPointPtr ptsIn,
- int count,
- BoxPtr extents,
- int origin,
- DDXPointPtr *topPoint, /* return */
- int *topY, int *bottomY, /* return */
- int shape
-){
- int c = 0, vertex1, vertex2;
-
- *topY = 32767;
- *bottomY = 0;
-
- origin -= (origin & 0x8000) << 1;
- vertex1 = *((int *) &extents->x1) - origin;
- vertex2 = *((int *) &extents->x2) - origin /* - 0x00010001 */;
- /* I think this was an error in cfb ^ */
-
- if (shape == Convex) {
- while (count--) {
- c = *((int*)ptsIn);
- if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
- return POLY_USE_MI;
-
- c = intToY(c);
- if (c < *topY) {
- *topY = c;
- *topPoint = ptsIn;
- }
- ptsIn++;
- if (c > *bottomY) *bottomY = c;
- }
- } else {
- int yFlip = 0;
- int dx2, dx1, x1, x2;
-
- x2 = x1 = -1;
- dx2 = dx1 = 1;
-
- while (count--) {
- c = *((int*)ptsIn);
- if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
- return POLY_USE_MI;
- c = intToY(c);
- if (c < *topY) {
- *topY = c;
- *topPoint = ptsIn;
- }
- ptsIn++;
- if (c > *bottomY) *bottomY = c;
- if (c == x1)
- continue;
- if (dx1 > 0) {
- if (x2 < 0) x2 = c;
- else dx2 = dx1 = (c - x1) >> 31;
- } else if ((c - x1) >> 31 != dx1) {
- dx1 = ~dx1;
- yFlip++;
- }
- x1 = c;
- }
- x1 = (x2 - c) >> 31;
- if (x1 != dx1) yFlip++;
- if (x1 != dx2) yFlip++;
- if (yFlip != 2) {
- if(*topY == *bottomY)
- return POLY_FULLY_CLIPPED;
- else
- return POLY_USE_MI;
- }
- }
- if (*topY == *bottomY)
- return POLY_FULLY_CLIPPED;
-
- return POLY_IS_EASY;
-}
-
-void
-XAAFillPolygonSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int origin, vertex1, vertex2;
- int *vertex1p, *vertex2p, *endp;
- int x1 = 0, x2 = 0;
- int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
- int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
- int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
- int c, y, maxy, h, yoffset;
- DDXPointPtr topPoint;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- if (mode == CoordModePrevious) {
- register DDXPointPtr ppt = ptsIn + 1;
-
- for (origin = 1; origin < count; origin++, ppt++) {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- mode = CoordModeOrigin;
- }
-
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- origin = coordToInt(pDraw->x, pDraw->y);
-
- switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
- origin, &topPoint, &y, &maxy, shape) ) {
- case POLY_USE_MI:
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- case POLY_FULLY_CLIPPED:
- return;
- }
-
- endp = (int*)ptsIn + count;
- vertex2p = vertex1p = (int *)topPoint;
- origin = pDraw->x;
- yoffset = pDraw->y;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-
- (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
- pGC->planemask);
-
- while(1) {
- if (y == intToY(vertex1)) {
- do {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1,DX1)
- } while (y >= intToY(vertex1));
- h = dy1;
- } else {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2)) {
- do {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2,DX2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- } else {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
-
- /* fill spans for this segment */
- if(DX1 | DX2) {
- if(infoRec->SubsequentSolidFillTrap && (h > 6)) {
- if(x1 == x2) {
- while(x1 == x2) {
- y++;
- if (!--h) break;
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if(y == maxy) break;
- if(!h) continue;
- }
-
- if(x1 < x2)
- (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn,
- y + yoffset, h,
- x1, DX1, dy1, e1,
- x2 - 1, DX2, dy2, e2);
- else
- (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn,
- y + yoffset, h,
- x2, DX2, dy2, e2,
- x1 - 1, DX1, dy1, e1);
- y += h;
- if(--h) {
- FixError(x1,dx1,dy1,e1,sign1,step1,h);
- FixError(x2,dx2,dy2,e2,sign2,step2,h);
- h = 0;
- }
- } else {
- while(1) {
- if (x2 > x1)
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
- x1, y + yoffset, x2 - x1, 1);
- else if (x1 > x2)
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
- x2, y + yoffset, x1 - x2, 1);
- y++;
- if (!--h) break;
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- }
- } else {
- if (x2 > x1)
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
- x1, y + yoffset, x2 - x1, h);
- else if (x1 > x2)
- (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
- x2, y + yoffset, x1 - x2, h);
-
- y += h;
- h = 0;
- }
- if (y == maxy) break;
- }
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-
-void
-XAAFillPolygonHelper(
- ScrnInfoPtr pScrn,
- DDXPointPtr ptsIn,
- int count,
- DDXPointPtr topPoint,
- int y,
- int maxy,
- int origin,
- RectFuncPtr RectFunc,
- TrapFuncPtr TrapFunc,
- int xorg,
- int yorg,
- XAACacheInfoPtr pCache
-){
- int *vertex1p, *vertex2p, *endp;
- int vertex1, vertex2;
- int x1 = 0, x2 = 0;
- int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
- int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
- int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
- int c, h, yoffset;
-
-
- endp = (int*)ptsIn + count;
- vertex2p = vertex1p = (int *)topPoint;
- yoffset = intToY(origin);
- origin = intToX(origin);
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *)ptsIn;
-
- while(1) {
- if (y == intToY(vertex1)) {
- do {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1,DX1)
- } while (y >= intToY(vertex1));
- h = dy1;
- } else {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2)) {
- do {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2,DX2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- } else {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
-
- /* fill spans for this segment */
- if(DX1 | DX2) {
- if(TrapFunc && (h > 6)) {
- if(x1 == x2) {
- while(x1 == x2) {
- y++;
- if (!--h) break;
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if(y == maxy) break;
- if(!h) continue;
- }
-
- if(x1 < x2)
- (*TrapFunc)(pScrn, y + yoffset, h,
- x1, DX1, dy1, e1,
- x2 - 1, DX2, dy2, e2, xorg, yorg, pCache);
- else
- (*TrapFunc)(pScrn, y + yoffset, h,
- x2, DX2, dy2, e2,
- x1 - 1, DX1, dy1, e1, xorg, yorg, pCache);
- y += h;
- if(--h) {
- FixError(x1,dx1,dy1,e1,sign1,step1,h);
- FixError(x2,dx2,dy2,e2,sign2,step2,h);
- h = 0;
- }
- } else {
- while(1) {
- if (x2 > x1)
- (*RectFunc)(pScrn,
- x1, y + yoffset, x2 - x1, 1, xorg, yorg, pCache);
- else if (x1 > x2)
- (*RectFunc)(pScrn,
- x2, y + yoffset, x1 - x2, 1, xorg, yorg, pCache);
- y++;
- if (!--h) break;
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- }
- } else {
- if (x2 > x1)
- (*RectFunc)(pScrn,
- x1, y + yoffset, x2 - x1, h, xorg, yorg, pCache);
- else if (x1 > x2)
- (*RectFunc)(pScrn,
- x2, y + yoffset, x1 - x2, h, xorg, yorg, pCache);
-
- y += h;
- h = 0;
- }
- if (y == maxy) break;
- }
-}
-
- /*****************\
- | Solid Helpers |
- \*****************/
-
-static void
-SolidTrapHelper(
- ScrnInfoPtr pScrn,
- int y, int h,
- int x1, int dx1, int dy1, int e1,
- int x2, int dx2, int dy2, int e2,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SubsequentSolidFillTrap) (pScrn,
- y, h, x1, dx1, dy1, e1, x2, dx2, dy2, e2);
-}
-
-static void
-SolidRectHelper (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
-}
-
-
- /*********************\
- | Mono 8x8 Patterns |
- \*********************/
-
-static void
-Mono8x8PatternTrapHelper_ScreenOrigin(
- ScrnInfoPtr pScrn,
- int y, int h,
- int x1, int dx1, int dy1, int e1,
- int x2, int dx2, int dy2, int e2,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SubsequentMono8x8PatternFillTrap) (pScrn, xorg, yorg,
- y, h, x1, dx1, dy1, e1, x2, dx2, dy2, e2);
-}
-
-static void
-Mono8x8PatternRectHelper_ScreenOrigin (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
- x, y, w, h);
-}
-
-static void
-Mono8x8PatternRectHelper (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- xorg = (x - xorg) & 0x07;
- yorg = (y - yorg) & 0x07;
-
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- int patx = pCache->pat0;
- int paty = pCache->pat1;
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- } else {
- int slot = (yorg << 3) + xorg;
- xorg = pCache->x + pCache->offsets[slot].x;
- yorg = pCache->y + pCache->offsets[slot].y;
- }
- }
-
-
- (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
- x, y, w, h);
-}
-
-
-
- /****************\
- | Cache Expand |
- \****************/
-
-
-static void
-CacheExpandRectHelper (
- ScrnInfoPtr pScrn,
- int X, int Y, int Width, int Height,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
- int cacheWidth;
-
- cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
- infoRec->CacheColorExpandDensity;
-
- phaseY = (Y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
- phaseX = (X - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
-
- while(1) {
- w = Width; skipleft = phaseX; x = X;
- blit_h = pCache->h - phaseY;
- if(blit_h > Height) blit_h = Height;
-
- while(1) {
- blit_w = cacheWidth - skipleft;
- if(blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenColorExpandFill)(
- pScrn, x, Y, blit_w, blit_h,
- pCache->x, pCache->y + phaseY, skipleft);
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- skipleft = (skipleft + blit_w) % pCache->orig_w;
- }
- Height -= blit_h;
- if(!Height) break;
- Y += blit_h;
- phaseY = (phaseY + blit_h) % pCache->orig_h;
- }
-}
-
-
-
- /**************\
- | Cache Blit |
- \**************/
-
-
-static void
-CacheBltRectHelper (
- ScrnInfoPtr pScrn,
- int X, int Y, int Width, int Height,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
-
- phaseY = (Y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
- phaseX = (X - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
-
- while(1) {
- w = Width; skipleft = phaseX; x = X;
- blit_h = pCache->h - phaseY;
- if(blit_h > Height) blit_h = Height;
-
- while(1) {
- blit_w = pCache->w - skipleft;
- if(blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pCache->x + skipleft, pCache->y + phaseY,
- x, Y, blit_w, blit_h);
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- skipleft = (skipleft + blit_w) % pCache->orig_w;
- }
- Height -= blit_h;
- if(!Height) break;
- Y += blit_h;
- phaseY = (phaseY + blit_h) % pCache->orig_h;
- }
-}
-
-
- /**********************\
- | Stippled Polygons |
- \**********************/
-
-
-void
-XAAFillPolygonStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- int origin, type, patx, paty, fg, bg;
- int y, maxy, xorg, yorg;
- DDXPointPtr topPoint;
- XAACacheInfoPtr pCache = NULL;
- RectFuncPtr RectFunc = NULL;
- TrapFuncPtr TrapFunc = NULL;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- if (mode == CoordModePrevious) {
- register DDXPointPtr ppt = ptsIn + 1;
-
- for (origin = 1; origin < count; origin++, ppt++) {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- mode = CoordModeOrigin;
- }
-
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
-
- if(pGC->fillStyle == FillStippled) {
- type = (*infoRec->StippledFillChooser)(pGC);
- fg = pGC->fgPixel; bg = -1;
- } else {
- type = (*infoRec->OpaqueStippledFillChooser)(pGC);
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- }
-
-
- if(!type) {
- (*XAAFallbackOps.FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- if((type == DO_COLOR_EXPAND) || (type == DO_COLOR_8x8)) {
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- origin = *((int *)&pDraw->x);
-
- switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
- origin, &topPoint, &y, &maxy, shape) ) {
- case POLY_USE_MI:
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- case POLY_FULLY_CLIPPED:
- return;
- }
-
- xorg = (pDraw->x + pGC->patOrg.x);
- yorg = (pDraw->y + pGC->patOrg.y);
-
-
- if((fg == bg) && (bg != -1) && infoRec->SetupForSolidFill) {
-
- (*infoRec->SetupForSolidFill)(infoRec->pScrn, fg,
- pGC->alu, pGC->planemask);
-
- RectFunc = SolidRectHelper;
- TrapFunc = infoRec->SubsequentSolidFillTrap ? SolidTrapHelper : NULL;
- } else
- switch(type) {
- case DO_MONO_8x8:
- patx = pPriv->pattern0; paty = pPriv->pattern1;
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_SCREEN_ORIGIN) {
- xorg = (-xorg) & 0x07; yorg = (-yorg) & 0x07;
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- }
- } else {
- XAACacheInfoPtr pCache = (*infoRec->CacheMono8x8Pattern)(
- infoRec->pScrn, patx, paty);
- patx = pCache->x; paty = pCache->y;
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- patx += pCache->offsets[slot].x;
- paty += pCache->offsets[slot].y;
- xorg = patx; yorg = paty;
- }
- }
- RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
- if(infoRec->SubsequentMono8x8PatternFillTrap)
- TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
- } else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS)){
- pCache = (*infoRec->CacheMono8x8Pattern)(
- infoRec->pScrn, patx, paty);
- patx = pCache->x; paty = pCache->y;
- } else {
- pCache = &(infoRec->ScratchCacheInfoRec);
- pCache->pat0 = patx;
- pCache->pat1 = paty;
- }
- RectFunc = Mono8x8PatternRectHelper;
- }
-
- (*infoRec->SetupForMono8x8PatternFill)(infoRec->pScrn,
- patx, paty, fg, bg, pGC->alu, pGC->planemask);
- break;
- case DO_CACHE_EXPAND:
- pCache = (*infoRec->CacheMonoStipple)(infoRec->pScrn, pGC->stipple);
-
- (*infoRec->SetupForScreenToScreenColorExpandFill)(
- infoRec->pScrn, fg, bg, pGC->alu, pGC->planemask);
-
- RectFunc = CacheExpandRectHelper;
- break;
- case DO_CACHE_BLT:
- pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
- fg, bg);
- (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
- pGC->alu, pGC->planemask, pCache->trans_color);
-
- RectFunc = CacheBltRectHelper;
- break;
- default:
- return;
- }
-
-
- XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
- y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, pCache);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-
- /*******************\
- | Tiled Polygons |
- \*******************/
-
-
-void
-XAAFillPolygonTiled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- int origin, type, patx, paty;
- int y, maxy, xorg, yorg;
- DDXPointPtr topPoint;
- XAACacheInfoPtr pCache = NULL;
- RectFuncPtr RectFunc = NULL;
- TrapFuncPtr TrapFunc = NULL;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- if (mode == CoordModePrevious) {
- register DDXPointPtr ppt = ptsIn + 1;
-
- for (origin = 1; origin < count; origin++, ppt++) {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- mode = CoordModeOrigin;
- }
-
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
-
- type = (*infoRec->TiledFillChooser)(pGC);
-
- if(!type || (type == DO_IMAGE_WRITE)) {
- (*XAAFallbackOps.FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- if(type == DO_COLOR_8x8) {
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- origin = *((int *)&pDraw->x);
-
- switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
- origin, &topPoint, &y, &maxy, shape) ) {
- case POLY_USE_MI:
- miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
- case POLY_FULLY_CLIPPED:
- return;
- }
-
- xorg = (pDraw->x + pGC->patOrg.x);
- yorg = (pDraw->y + pGC->patOrg.y);
-
- switch(type) {
- case DO_MONO_8x8:
- patx = pPriv->pattern0; paty = pPriv->pattern1;
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_SCREEN_ORIGIN) {
- xorg = (-xorg) & 0x07; yorg = (-yorg) & 0x07;
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- }
- } else {
- XAACacheInfoPtr pCache = (*infoRec->CacheMono8x8Pattern)(
- infoRec->pScrn, patx, paty);
- patx = pCache->x; paty = pCache->y;
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- patx += pCache->offsets[slot].x;
- paty += pCache->offsets[slot].y;
- xorg = patx; yorg = paty;
- }
- }
- RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
- if(infoRec->SubsequentMono8x8PatternFillTrap)
- TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
- } else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS)){
- pCache = (*infoRec->CacheMono8x8Pattern)(
- infoRec->pScrn, patx, paty);
- patx = pCache->x; paty = pCache->y;
- }
- else {
- pCache = &(infoRec->ScratchCacheInfoRec);
- pCache->pat0 = patx;
- pCache->pat1 = paty;
- }
- RectFunc = Mono8x8PatternRectHelper;
- }
-
- (*infoRec->SetupForMono8x8PatternFill)(infoRec->pScrn,
- patx, paty, pPriv->fg, pPriv->bg, pGC->alu, pGC->planemask);
- break;
- case DO_CACHE_BLT:
- pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
- (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
- pGC->alu, pGC->planemask, -1);
-
- RectFunc = CacheBltRectHelper;
- break;
- case DO_PIXMAP_COPY:
- pCache = &(infoRec->ScratchCacheInfoRec);
- pCache->x = pPriv->offscreenArea->box.x1;
- pCache->y = pPriv->offscreenArea->box.y1;
- pCache->w = pCache->orig_w =
- pPriv->offscreenArea->box.x2 - pCache->x;
- pCache->h = pCache->orig_h =
- pPriv->offscreenArea->box.y2 - pCache->y;
-
- (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
- pGC->alu, pGC->planemask, -1);
-
- RectFunc = CacheBltRectHelper;
- break;
- default:
- return;
- }
-
- XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
- y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, pCache);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c
deleted file mode 100644
index cda56e327..000000000
--- a/hw/xfree86/xaa/xaaFillRect.c
+++ /dev/null
@@ -1,1093 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.16 2003/11/10 18:22:40 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-static void XAARenderSolidRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderColor8x8Rects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderMono8x8Rects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderColorExpandRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderCacheExpandRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderCacheBltRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderImageWriteRects(GCPtr, int, BoxPtr, int, int);
-static void XAARenderPixmapCopyRects(GCPtr, int, BoxPtr, int, int);
-
-void
-XAAPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill, /* number of rectangles to fill */
- xRectangle *prectInit /* Pointer to first rectangle to fill */
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int xorg = pDraw->x;
- int yorg = pDraw->y;
- int type = 0;
- ClipAndRenderRectsFunc function;
-
- if((nrectFill <= 0) || !pGC->planemask)
- return;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- switch(pGC->fillStyle) {
- case FillSolid:
- type = DO_SOLID;
- break;
- case FillStippled:
- type = (*infoRec->StippledFillChooser)(pGC);
- break;
- case FillOpaqueStippled:
- if((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSolidRects &&
- CHECK_PLANEMASK(pGC,infoRec->FillSolidRectsFlags) &&
- CHECK_ROP(pGC,infoRec->FillSolidRectsFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillSolidRectsFlags) &&
- CHECK_FG(pGC,infoRec->FillSolidRectsFlags))
- type = DO_SOLID;
- else
- type = (*infoRec->OpaqueStippledFillChooser)(pGC);
- break;
- case FillTiled:
- type = (*infoRec->TiledFillChooser)(pGC);
- break;
- }
-
- switch(type) {
- case DO_SOLID:
- function = XAARenderSolidRects;
- break;
- case DO_COLOR_8x8:
- function = XAARenderColor8x8Rects;
- break;
- case DO_MONO_8x8:
- function = XAARenderMono8x8Rects;
- break;
- case DO_CACHE_BLT:
- function = XAARenderCacheBltRects;
- break;
- case DO_COLOR_EXPAND:
- function = XAARenderColorExpandRects;
- break;
- case DO_CACHE_EXPAND:
- function = XAARenderCacheExpandRects;
- break;
- case DO_IMAGE_WRITE:
- function = XAARenderImageWriteRects;
- break;
- case DO_PIXMAP_COPY:
- function = XAARenderPixmapCopyRects;
- break;
- default:
- (*XAAFallbackOps.PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- return;
- }
-
- if(xorg | yorg) {
- int n = nrectFill;
- xRectangle *prect = prectInit;
-
- while(n--) {
- prect->x += xorg;
- prect->y += yorg;
- prect++;
- }
- }
-
-
- XAAClipAndRenderRects(pGC, function, nrectFill, prectInit, xorg, yorg);
-}
-
-
-
- /*********************\
- | Solid Rects |
- \*********************/
-
-static void
-XAARenderSolidRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- (*infoRec->FillSolidRects) (infoRec->pScrn,
- pGC->fgPixel, pGC->alu, pGC->planemask, nboxes, pClipBoxes);
-}
-
-
- /************************\
- | Mono 8x8 Rects |
- \************************/
-
-static void
-XAARenderMono8x8Rects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAPixmapPtr pPriv;
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- case FillTiled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- fg = pPriv->fg; bg = pPriv->bg;
- break;
- default: /* Muffle compiler */
- pPriv = NULL; /* Kaboom */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillMono8x8PatternRects) (infoRec->pScrn,
- fg, bg, pGC->alu, pGC->planemask,
- nboxes, pClipBoxes, pPriv->pattern0, pPriv->pattern1,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
-}
-
- /*************************\
- | Color 8x8 Rects |
- \*************************/
-
-static void
-XAARenderColor8x8Rects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache;
- PixmapPtr pPix;
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pPix = pGC->stipple;
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- pPix = pGC->stipple;
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- case FillTiled:
- pPix = pGC->tile.pixmap;
- fg = -1; bg = -1;
- break;
- default: /* Muffle compiler */
- pPix = NULL;
- fg = -1; bg = -1;
- break;
- }
-
- pCache = (*infoRec->CacheColor8x8Pattern)(infoRec->pScrn, pPix, fg, bg);
- (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn,
- pGC->alu, pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y), pCache);
-}
-
-
- /****************************\
- | Color Expand Rects |
- \****************************/
-
-static void
-XAARenderColorExpandRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- default: /* Muffle compiler */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillColorExpandRects) (infoRec->pScrn, fg, bg,
- pGC->alu, pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pGC->stipple);
-}
-
-
- /*************************\
- | Cache Blt Rects |
- \*************************/
-
-static void
-XAARenderCacheBltRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
- pGC->fgPixel, -1);
- break;
- case FillOpaqueStippled:
- pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
- pGC->fgPixel, pGC->bgPixel);
- break;
- case FillTiled:
- pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
- break;
- default: /* Muffle compiler */
- pCache = NULL;
- break;
- }
-
- (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
- pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y), pCache);
-}
-
-
- /****************************\
- | Cache Expand Rects |
- \****************************/
-
-static void
-XAARenderCacheExpandRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- default: /* Muffle compiler */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillCacheExpandRects) (infoRec->pScrn, fg, bg,
- pGC->alu, pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pGC->stipple);
-}
-
-
-
- /***************************\
- | Image Write Rects |
- \***************************/
-
-static void
-XAARenderImageWriteRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- (*infoRec->FillImageWriteRects) (infoRec->pScrn, pGC->alu,
- pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pGC->tile.pixmap);
-}
-
-
-
- /***************************\
- | Pixmap Copy Rects |
- \***************************/
-
-static void
-XAARenderPixmapCopyRects(
- GCPtr pGC,
- int nboxes,
- BoxPtr pClipBoxes,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
- pCache->x = pPriv->offscreenArea->box.x1;
- pCache->y = pPriv->offscreenArea->box.y1;
- pCache->w = pCache->orig_w =
- pPriv->offscreenArea->box.x2 - pCache->x;
- pCache->h = pCache->orig_h =
- pPriv->offscreenArea->box.y2 - pCache->y;
- pCache->trans_color = -1;
-
- (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
- pGC->planemask, nboxes, pClipBoxes,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pCache);
-}
-
-
-
- /************\
- | Solid |
- \************/
-
-void
-XAAFillSolidRects(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int nBox, /* number of rectangles to fill */
- BoxPtr pBox /* Pointer to first rectangle to fill */
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SetupForSolidFill)(pScrn, fg, rop, planemask);
- while(nBox--) {
- (*infoRec->SubsequentSolidFillRect)(pScrn, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
- pBox++;
- }
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-
- /*********************\
- | 8x8 Mono Patterns |
- \*********************/
-
-
-void
-XAAFillMono8x8PatternRectsScreenOrigin(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int pattern0, int pattern1,
- int xorigin, int yorigin
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pattern0, paty = pattern1;
- int xorg = (-xorigin) & 0x07;
- int yorg = (-yorigin) & 0x07;
-
-
- if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- }
- } else {
- XAACacheInfoPtr pCache =
- (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
- patx = pCache->x; paty = pCache->y;
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- patx += pCache->offsets[slot].x;
- paty += pCache->offsets[slot].y;
- xorg = patx; yorg = paty;
- }
- }
-
- (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
- fg, bg, rop, planemask);
-
- while(nBox--) {
- (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
- xorg, yorg, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
- pBox++;
- }
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillMono8x8PatternRects(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int pattern0, int pattern1,
- int xorigin, int yorigin
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pattern0, paty = pattern1;
- int xorg, yorg;
- XAACacheInfoPtr pCache = NULL;
-
-
- if(!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)){
- pCache = (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
- patx = pCache->x; paty = pCache->y;
- }
-
-
- (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
- fg, bg, rop, planemask);
-
-
- while(nBox--) {
- xorg = (pBox->x1 - xorigin) & 0x07;
- yorg = (pBox->y1 - yorigin) & 0x07;
-
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- patx = pattern0; paty = pattern1;
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- } else {
- int slot = (yorg << 3) + xorg;
- xorg = patx + pCache->offsets[slot].x;
- yorg = paty + pCache->offsets[slot].y;
- }
- }
-
- (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
- xorg, yorg, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
- pBox++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
- /**********************\
- | 8x8 Color Patterns |
- \**********************/
-
-
-void
-XAAFillColor8x8PatternRectsScreenOrigin(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorigin, int yorigin,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pCache->x, paty = pCache->y;
- int xorg = (-xorigin) & 0x07;
- int yorg = (-yorigin) & 0x07;
-
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- paty += pCache->offsets[slot].y;
- patx += pCache->offsets[slot].x;
- xorg = patx; yorg = paty;
- }
-
- (*infoRec->SetupForColor8x8PatternFill)(pScrn, patx, paty,
- rop, planemask, pCache->trans_color);
-
- while(nBox--) {
- (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
- xorg, yorg, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
- pBox++;
- }
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAAFillColor8x8PatternRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorigin, int yorigin,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int xorg, yorg;
-
- (*infoRec->SetupForColor8x8PatternFill)(pScrn, pCache->x, pCache->y,
- rop, planemask, pCache->trans_color);
-
- while(nBox--) {
- xorg = (pBox->x1 - xorigin) & 0x07;
- yorg = (pBox->y1 - yorigin) & 0x07;
-
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- yorg = pCache->y + pCache->offsets[slot].y;
- xorg = pCache->x + pCache->offsets[slot].x;
- }
-
- (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
- xorg, yorg, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
- pBox++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
- /***************\
- | Cache Blits |
- \***************/
-
-void
-XAAFillCacheBltRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
-
- (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, rop, planemask,
- pCache->trans_color);
-
- while(nBox--) {
- y = pBox->y1;
- phaseY = (y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
- phaseX = (pBox->x1 - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
- height = pBox->y2 - y;
- width = pBox->x2 - pBox->x1;
-
-#if 0
- if (rop == GXcopy) {
- while(1) {
- w = width; skipleft = phaseX; x = pBox->x1;
- blit_h = pCache->h - phaseY;
- if(blit_h > height) blit_h = height;
-
- while(1) {
- blit_w = pCache->w - skipleft;
- if(blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pCache->x + skipleft, pCache->y + phaseY,
- x, y, blit_w, blit_h);
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- skipleft = (skipleft + blit_w) % pCache->orig_w;
- if(blit_w >= pCache->orig_w) break;
- }
-
- /* Expand horizontally */
- if (w) {
- skipleft -= phaseX;
- if (skipleft < 0) skipleft += pCache->orig_w;
- blit_w = x - pBox->x1 - skipleft;
- while(w) {
- if (blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pBox->x1 + skipleft, y, x, y, blit_w, blit_h);
- w -= blit_w;
- x += blit_w;
- blit_w <<= 1;
- }
- }
-
- height -= blit_h;
- if(!height) break;
- y += blit_h;
- phaseY = (phaseY + blit_h) % pCache->orig_h;
- if(blit_h >= pCache->orig_h) break;
- }
-
- /* Expand vertically */
- if (height) {
- blit_w = pBox->x2 - pBox->x1;
- phaseY -= (pBox->y1 - yorg) % pCache->orig_h;
- if (phaseY < 0) phaseY += pCache->orig_h;
- blit_h = y - pBox->y1 - phaseY;
- while(height) {
- if (blit_h > height) blit_h = height;
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pBox->x1,
- pBox->y1 + phaseY, pBox->x1, y, blit_w, blit_h);
- height -= blit_h;
- y += blit_h;
- blit_h <<= 1;
- }
- }
- } else
-#endif
- {
- while(1) {
- w = width; skipleft = phaseX; x = pBox->x1;
- blit_h = pCache->h - phaseY;
- if(blit_h > height) blit_h = height;
-
- while(1) {
- blit_w = pCache->w - skipleft;
- if(blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pCache->x + skipleft, pCache->y + phaseY,
- x, y, blit_w, blit_h);
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- skipleft = (skipleft + blit_w) % pCache->orig_w;
- }
- height -= blit_h;
- if(!height) break;
- y += blit_h;
- phaseY = (phaseY + blit_h) % pCache->orig_h;
- }
- }
- pBox++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-
- /*******************\
- | Cache Expansion |
- \*******************/
-
-
-
-void
-XAAFillCacheExpandRects(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
- int cacheWidth;
- XAACacheInfoPtr pCache;
-
- pCache = (*infoRec->CacheMonoStipple)(pScrn, pPix);
-
- cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
- infoRec->CacheColorExpandDensity;
-
- (*infoRec->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop,
- planemask);
-
- while(nBox--) {
- y = pBox->y1;
- phaseY = (y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
- phaseX = (pBox->x1 - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
- height = pBox->y2 - y;
- width = pBox->x2 - pBox->x1;
-
- while(1) {
- w = width; skipleft = phaseX; x = pBox->x1;
- blit_h = pCache->h - phaseY;
- if(blit_h > height) blit_h = height;
-
- while(1) {
- blit_w = cacheWidth - skipleft;
- if(blit_w > w) blit_w = w;
- (*infoRec->SubsequentScreenToScreenColorExpandFill)(
- pScrn, x, y, blit_w, blit_h,
- pCache->x, pCache->y + phaseY, skipleft);
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- skipleft = (skipleft + blit_w) % pCache->orig_w;
- }
- height -= blit_h;
- if(!height) break;
- y += blit_h;
- phaseY = (phaseY + blit_h) % pCache->orig_h;
- }
- pBox++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
- /******************\
- | Image Writes |
- \******************/
-
-
-
-/* This requires all LEFT_EDGE clipping. You get too many problems
- with reading past the edge of the pattern otherwise */
-
-static void
-WriteColumn(
- ScrnInfoPtr pScrn,
- unsigned char *pSrc,
- int x, int y, int w, int h,
- int xoff, int yoff,
- int pHeight,
- int srcwidth,
- int Bpp
-) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- unsigned char *src;
- Bool PlusOne = FALSE;
- int skipleft, dwords;
-
- pSrc += (Bpp * xoff);
-
- if((skipleft = (long)pSrc & 0x03L)) {
- if(Bpp == 3)
- skipleft = 4 - skipleft;
- else
- skipleft /= Bpp;
-
- x -= skipleft;
- w += skipleft;
-
- if(Bpp == 3)
- pSrc -= 3 * skipleft;
- else /* is this Alpha friendly ? */
- pSrc = (unsigned char*)((long)pSrc & ~0x03L);
- }
-
- src = pSrc + (yoff * srcwidth);
-
- dwords = ((w * Bpp) + 3) >> 2;
-
- if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
- ((dwords * h) & 0x01)) {
- PlusOne = TRUE;
- }
-
- (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, skipleft);
-
- if(dwords > infoRec->ImageWriteRange) {
- while(h--) {
- XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src += srcwidth;
- yoff++;
- if(yoff >= pHeight) {
- yoff = 0;
- src = pSrc;
- }
- }
- } else {
- if(srcwidth == (dwords << 2)) {
- int maxLines = infoRec->ImageWriteRange/dwords;
- int step;
-
- while(h) {
- step = pHeight - yoff;
- if(step > maxLines) step = maxLines;
- if(step > h) step = h;
-
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords * step);
-
- src += (srcwidth * step);
- yoff += step;
- if(yoff >= pHeight) {
- yoff = 0;
- src = pSrc;
- }
- h -= step;
- }
- } else {
- while(h--) {
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src += srcwidth;
- yoff++;
- if(yoff >= pHeight) {
- yoff = 0;
- src = pSrc;
- }
- }
- }
- }
-
- if(PlusOne) {
- CARD32* base = (CARD32*)infoRec->ImageWriteBase;
- *base = 0x00000000;
- }
-}
-
-void
-XAAFillImageWriteRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, phaseY, phaseX, height, width, blit_w;
- int pHeight = pPix->drawable.height;
- int pWidth = pPix->drawable.width;
- int Bpp = pPix->drawable.bitsPerPixel >> 3;
- int srcwidth = pPix->devKind;
-
- (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, -1,
- pPix->drawable.bitsPerPixel, pPix->drawable.depth);
-
- while(nBox--) {
- x = pBox->x1;
- phaseY = (pBox->y1 - yorg) % pHeight;
- if(phaseY < 0) phaseY += pHeight;
- phaseX = (x - xorg) % pWidth;
- if(phaseX < 0) phaseX += pWidth;
- height = pBox->y2 - pBox->y1;
- width = pBox->x2 - x;
-
- while(1) {
- blit_w = pWidth - phaseX;
- if(blit_w > width) blit_w = width;
-
- WriteColumn(pScrn, pPix->devPrivate.ptr, x, pBox->y1,
- blit_w, height, phaseX, phaseY, pHeight, srcwidth, Bpp);
-
- width -= blit_w;
- if(!width) break;
- x += blit_w;
- phaseX = (phaseX + blit_w) % pWidth;
- }
- pBox++;
- }
-
- if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-
- /*************\
- | Utilities |
- \*************/
-
-
-void
-XAAClipAndRenderRects(
- GCPtr pGC,
- ClipAndRenderRectsFunc BoxFunc,
- int nrectFill,
- xRectangle *prect,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int Right, Bottom, MaxBoxes;
- BoxPtr pextent, pboxClipped, pboxClippedBase;
-
- MaxBoxes = infoRec->PreAllocSize/sizeof(BoxRec);
- pboxClippedBase = (BoxPtr)infoRec->PreAllocMem;
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(pGC->pCompositeClip) == 1) {
- pextent = REGION_RECTS(pGC->pCompositeClip);
- while (nrectFill--) {
- pboxClipped->x1 = max(pextent->x1, prect->x);
- pboxClipped->y1 = max(pextent->y1, prect->y);
-
- Right = (int)prect->x + (int)prect->width;
- pboxClipped->x2 = min(pextent->x2, Right);
-
- Bottom = (int)prect->y + (int)prect->height;
- pboxClipped->y2 = min(pextent->y2, Bottom);
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2)) {
- pboxClipped++;
- if(pboxClipped >= (pboxClippedBase + MaxBoxes)) {
- (*BoxFunc)(pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
- pboxClipped = pboxClippedBase;
- }
- }
- }
- } else {
- pextent = REGION_EXTENTS(pGC->pScreen, pGC->pCompositeClip);
- while (nrectFill--) {
- int n;
- BoxRec box, *pbox;
-
- box.x1 = max(pextent->x1, prect->x);
- box.y1 = max(pextent->y1, prect->y);
-
- Right = (int)prect->x + (int)prect->width;
- box.x2 = min(pextent->x2, Right);
-
- Bottom = (int)prect->y + (int)prect->height;
- box.y2 = min(pextent->y2, Bottom);
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (pGC->pCompositeClip);
- pbox = REGION_RECTS(pGC->pCompositeClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--) {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2) {
- pboxClipped++;
- if(pboxClipped >= (pboxClippedBase + MaxBoxes)) {
- (*BoxFunc)(pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
- pboxClipped = pboxClippedBase;
- }
- }
- }
- }
- }
-
- if(pboxClipped != pboxClippedBase)
- (*BoxFunc)(pGC, pboxClipped - pboxClippedBase, pboxClippedBase,
- xorg, yorg);
-}
-
-
-int
-XAAGetRectClipBoxes(
- GCPtr pGC,
- BoxPtr pboxClippedBase,
- int nrectFill,
- xRectangle *prectInit
-){
- int Right, Bottom;
- BoxPtr pextent, pboxClipped = pboxClippedBase;
- xRectangle *prect = prectInit;
- RegionPtr prgnClip = pGC->pCompositeClip;
-
- if (REGION_NUM_RECTS(prgnClip) == 1) {
- pextent = REGION_RECTS(prgnClip);
- while (nrectFill--) {
- pboxClipped->x1 = max(pextent->x1, prect->x);
- pboxClipped->y1 = max(pextent->y1, prect->y);
-
- Right = (int)prect->x + (int)prect->width;
- pboxClipped->x2 = min(pextent->x2, Right);
-
- Bottom = (int)prect->y + (int)prect->height;
- pboxClipped->y2 = min(pextent->y2, Bottom);
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2)) {
- pboxClipped++;
- }
- }
- } else {
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- while (nrectFill--) {
- int n;
- BoxRec box, *pbox;
-
- box.x1 = max(pextent->x1, prect->x);
- box.y1 = max(pextent->y1, prect->y);
-
- Right = (int)prect->x + (int)prect->width;
- box.x2 = min(pextent->x2, Right);
-
- Bottom = (int)prect->y + (int)prect->height;
- box.y2 = min(pextent->y2, Bottom);
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--) {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2) {
- pboxClipped++;
- }
- }
- }
- }
-
- return(pboxClipped - pboxClippedBase);
-}
-
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
deleted file mode 100644
index c9ef93a1b..000000000
--- a/hw/xfree86/xaa/xaaGC.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaGC.c,v 1.19 2001/02/19 22:19:50 mvojkovi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-static void XAAChangeGC(GCPtr pGC, unsigned long mask);
-static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void XAADestroyGC(GCPtr pGC);
-static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void XAADestroyClip(GCPtr pGC);
-static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-GCFuncs XAAGCFuncs = {
- XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
- XAAChangeClip, XAADestroyClip, XAACopyClip
-};
-
-extern GCOps XAAPixmapOps;
-
-Bool
-XAACreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);
- Bool ret;
-
- XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
-
- if((ret = (*pScreen->CreateGC)(pGC))) {
- pGCPriv->wrapOps = NULL;
- pGCPriv->wrapFuncs = pGC->funcs;
- pGCPriv->XAAOps = &XAAFallbackOps;
- pGCPriv->flags = 0;
- pGCPriv->DashLength = 0;
- pGCPriv->DashPattern = NULL;
- pGCPriv->changes = 0;
- /* initialize any other private fields here */
- pGC->funcs = &XAAGCFuncs;
- }
-
- XAA_SCREEN_EPILOGUE(pScreen,CreateGC,XAACreateGC);
-
- return ret;
-}
-
-
-static void
-XAAValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAA_GC_FUNC_PROLOGUE(pGC);
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
-
- if((changes & GCPlaneMask) &&
- ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) ==
- infoRec->FullPlanemasks[pGC->depth - 1]))
- {
- pGC->planemask = ~0;
- }
-
- if(pGC->depth != 32) {
- if(pGC->bgPixel == -1) /* -1 is reserved for transparency */
- pGC->bgPixel = 0x7fffffff;
- if(pGC->fgPixel == -1) /* -1 is reserved for transparency */
- pGC->fgPixel = 0x7fffffff;
- }
-
- if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){
- pGCPriv->flags = OPS_ARE_PIXMAP;
- pGCPriv->changes |= changes;
-
- /* make sure we're not using videomemory pixmaps to render
- onto system memory drawables */
-
- if((pGC->fillStyle == FillTiled) &&
- IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
- !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) {
-
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- FBAreaPtr area = pPriv->offscreenArea;
-
- XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
- xf86FreeOffscreenArea(area);
- }
- }
- else if(!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) {
- pGCPriv->flags = 0;
- pGCPriv->changes |= changes;
- }
- else {
- if(!(pGCPriv->flags & OPS_ARE_ACCEL)) {
- changes |= pGCPriv->changes;
- pGCPriv->changes = 0;
- }
- pGCPriv->flags = OPS_ARE_ACCEL;
-
-#if 1
- /* Ugh. If we can't use the blitter on offscreen pixmaps used
- as tiles, then we need to move them out as cfb can't handle
- tiles with non-zero origins */
-
- if((pGC->fillStyle == FillTiled) &&
- IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
- (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser)(pGC))) {
-
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- FBAreaPtr area = pPriv->offscreenArea;
-
- XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
- xf86FreeOffscreenArea(area);
- }
-#endif
- }
-
- XAA_GC_FUNC_EPILOGUE(pGC);
-
- if(!(pGCPriv->flags & OPS_ARE_ACCEL)) return;
-
- if((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap){
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
- if(pixPriv->flags & DIRTY) {
- pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- }
- if((changes & GCStipple) && pGC->stipple){
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-
- if(pixPriv->flags & DIRTY) {
- pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- }
-
- /* If our Ops are still the default ones we need to allocate new ones */
- if(pGC->ops == &XAAFallbackOps) {
- if(!(pGCPriv->XAAOps = xalloc(sizeof(GCOps)))) {
- pGCPriv->XAAOps = &XAAFallbackOps;
- return;
- }
- /* make a modifiable copy of the default ops */
- memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps));
- pGC->ops = pGCPriv->XAAOps;
- changes = ~0;
- }
-
- if(!changes) return;
-
- if((changes & GCDashList) && infoRec->ComputeDash)
- infoRec->ComputeDash(pGC);
-
- if(changes & infoRec->FillSpansMask)
- (*infoRec->ValidateFillSpans)(pGC, changes, pDraw);
-
- if(changes & infoRec->SetSpansMask)
- (*infoRec->ValidateSetSpans)(pGC, changes, pDraw);
-
- if(changes & infoRec->PutImageMask)
- (*infoRec->ValidatePutImage)(pGC, changes, pDraw);
-
- if(changes & infoRec->CopyAreaMask)
- (*infoRec->ValidateCopyArea)(pGC, changes, pDraw);
-
- if(changes & infoRec->CopyPlaneMask)
- (*infoRec->ValidateCopyPlane)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyPointMask)
- (*infoRec->ValidatePolyPoint)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolylinesMask)
- (*infoRec->ValidatePolylines)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolySegmentMask)
- (*infoRec->ValidatePolySegment)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyRectangleMask)
- (*infoRec->ValidatePolyRectangle)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyArcMask)
- (*infoRec->ValidatePolyArc)(pGC, changes, pDraw);
-
- if(changes & infoRec->FillPolygonMask)
- (*infoRec->ValidateFillPolygon)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyFillRectMask)
- (*infoRec->ValidatePolyFillRect)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyFillArcMask)
- (*infoRec->ValidatePolyFillArc)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyGlyphBltMask)
- (*infoRec->ValidatePolyGlyphBlt)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageGlyphBltMask)
- (*infoRec->ValidateImageGlyphBlt)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyText8Mask)
- (*infoRec->ValidatePolyText8)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyText16Mask)
- (*infoRec->ValidatePolyText16)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageText8Mask)
- (*infoRec->ValidateImageText8)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageText16Mask)
- (*infoRec->ValidateImageText16)(pGC, changes, pDraw);
-
- if(changes & infoRec->PushPixelsMask)
- (*infoRec->ValidatePushPixels)(pGC, changes, pDraw);
-}
-
-
-static void
-XAADestroyGC(GCPtr pGC)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
-
- if(pGCPriv->XAAOps != &XAAFallbackOps)
- xfree(pGCPriv->XAAOps);
-
- if(pGCPriv->DashPattern)
- xfree(pGCPriv->DashPattern);
-
- (*pGC->funcs->DestroyGC)(pGC);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XAAChangeGC (
- GCPtr pGC,
- unsigned long mask
-)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- XAA_GC_FUNC_EPILOGUE (pGC);
-
- /* we have to assume that shared memory pixmaps are dirty
- because we can't wrap all operations on them */
-
- if((mask & GCTile) && !pGC->tileIsPixel &&
- PIXMAP_IS_SHARED(pGC->tile.pixmap))
- {
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- pPixPriv->flags |= DIRTY;
- }
-
- if((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)){
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- pPixPriv->flags |= DIRTY;
- }
-}
-
-static void
-XAACopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst)
-{
- XAA_GC_FUNC_PROLOGUE (pGCDst);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- XAA_GC_FUNC_EPILOGUE (pGCDst);
-}
-static void
-XAAChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects )
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- XAA_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- XAA_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-XAADestroyClip(GCPtr pGC)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-/**** Pixmap Wrappers ****/
-
-
-
-static void
-XAAFillSpansPixmap(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAASetSpansPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPutImagePixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-XAACopyAreaPixmap(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- RegionPtr ret;
-
- if(infoRec->pScrn->vtSema &&
- ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc)))
- {
- if(infoRec->ReadPixmap && (pGC->alu == GXcopy) &&
- (pSrc->bitsPerPixel == pDst->bitsPerPixel) &&
- ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1])
- == infoRec->FullPlanemasks[pSrc->depth - 1]))
- {
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst));
- pixPriv->flags |= DIRTY;
-
- return (XAABitBlt( pSrc, pDst, pGC,
- srcx, srcy, width, height, dstx, dsty,
- XAADoImageRead, 0L));
- } else
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- {
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- }
- return ret;
-}
-
-static RegionPtr
-XAACopyPlanePixmap(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- RegionPtr ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
-
- if(infoRec->pScrn->vtSema &&
- ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))){
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAPolyPointPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolylinesPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolySegmentPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyRectanglePixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyArcPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAFillPolygonPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillRectPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillArcPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static int
-XAAPolyText8Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static int
-XAAPolyText16Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAImageText8Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-static void
-XAAImageText16Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAImageGlyphBltPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyGlyphBltPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPushPixelsPixmap(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-GCOps XAAPixmapOps = {
- XAAFillSpansPixmap, XAASetSpansPixmap,
- XAAPutImagePixmap, XAACopyAreaPixmap,
- XAACopyPlanePixmap, XAAPolyPointPixmap,
- XAAPolylinesPixmap, XAAPolySegmentPixmap,
- XAAPolyRectanglePixmap, XAAPolyArcPixmap,
- XAAFillPolygonPixmap, XAAPolyFillRectPixmap,
- XAAPolyFillArcPixmap, XAAPolyText8Pixmap,
- XAAPolyText16Pixmap, XAAImageText8Pixmap,
- XAAImageText16Pixmap, XAAImageGlyphBltPixmap,
- XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
diff --git a/hw/xfree86/xaa/xaaGCmisc.c b/hw/xfree86/xaa/xaaGCmisc.c
deleted file mode 100644
index ab6cb9a24..000000000
--- a/hw/xfree86/xaa/xaaGCmisc.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaGCmisc.c,v 1.15 2000/09/25 23:56:14 mvojkovi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "mi.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-void
-XAAValidateCopyArea(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(infoRec->CopyArea &&
- CHECK_PLANEMASK(pGC,infoRec->CopyAreaFlags) &&
- CHECK_ROP(pGC,infoRec->CopyAreaFlags) &&
- CHECK_ROPSRC(pGC,infoRec->CopyAreaFlags)
- )
- pGC->ops->CopyArea = infoRec->CopyArea;
- else
- pGC->ops->CopyArea = XAAFallbackOps.CopyArea;
-}
-
-void
-XAAValidatePutImage(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(infoRec->PutImage &&
- CHECK_PLANEMASK(pGC,infoRec->PutImageFlags) &&
- CHECK_ROP(pGC,infoRec->PutImageFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PutImageFlags) &&
- CHECK_COLORS(pGC,infoRec->PutImageFlags)
- )
- pGC->ops->PutImage = infoRec->PutImage;
- else
- pGC->ops->PutImage = XAAFallbackOps.PutImage;
-}
-
-void
-XAAValidateCopyPlane(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(infoRec->CopyPlane &&
- CHECK_PLANEMASK(pGC,infoRec->CopyPlaneFlags) &&
- CHECK_ROP(pGC,infoRec->CopyPlaneFlags) &&
- CHECK_ROPSRC(pGC,infoRec->CopyPlaneFlags) &&
- CHECK_COLORS(pGC,infoRec->CopyPlaneFlags)
- )
- pGC->ops->CopyPlane = infoRec->CopyPlane;
- else
- pGC->ops->CopyPlane = XAAFallbackOps.CopyPlane;
-}
-
-void
-XAAValidatePushPixels(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(infoRec->PushPixelsSolid &&
- (pGC->fillStyle == FillSolid) &&
- CHECK_PLANEMASK(pGC,infoRec->PushPixelsFlags) &&
- CHECK_ROP(pGC,infoRec->PushPixelsFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PushPixelsFlags) &&
- CHECK_FG(pGC,infoRec->PushPixelsFlags) &&
- (!(infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY) ||
- (pGC->alu == GXcopy))
- )
- pGC->ops->PushPixels = infoRec->PushPixelsSolid;
- else
- pGC->ops->PushPixels = XAAFallbackOps.PushPixels;
-
-}
-
-
-/* We make the assumption that the FillSpans, PolyFillRect, FillPolygon
- and PolyFillArc functions are linked in a way that they all have
- the same rop/color/planemask restrictions. If the driver provides
- a GC level replacement for these, it will need to supply a new
- Validate functions if it breaks this assumption */
-
-
-void
-XAAValidateFillSpans(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(pGC->fillStyle != FillTiled) changes &= ~GCTile;
- if((pGC->fillStyle == FillTiled) || (pGC->fillStyle == FillSolid))
- changes &= ~GCStipple;
- if(!changes) return;
-
-
- pGC->ops->FillSpans = XAAFallbackOps.FillSpans;
- pGC->ops->PolyFillRect = XAAFallbackOps.PolyFillRect;
- pGC->ops->FillPolygon = XAAFallbackOps.FillPolygon;
- pGC->ops->PolyFillArc = XAAFallbackOps.PolyFillArc;
-
- switch(pGC->fillStyle){
- case FillSolid:
- if(infoRec->FillSpansSolid &&
- CHECK_PLANEMASK(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_ROP(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_FG(pGC,infoRec->FillSpansSolidFlags)
- ) {
- pGC->ops->FillSpans = infoRec->FillSpansSolid;
- pGC->ops->PolyFillRect = infoRec->PolyFillRectSolid;
- pGC->ops->FillPolygon = infoRec->FillPolygonSolid;
- pGC->ops->PolyFillArc = infoRec->PolyFillArcSolid;
- }
- break;
- /* The [Stippled/OpaqueStippled/Tiled]FillChooser
- functions do the validating */
- case FillStippled:
- if(infoRec->FillSpansStippled) {
- pGC->ops->FillSpans = infoRec->FillSpansStippled;
- pGC->ops->PolyFillRect = infoRec->PolyFillRectStippled;
- if(infoRec->FillPolygonStippled)
- pGC->ops->FillPolygon = infoRec->FillPolygonStippled;
- else pGC->ops->FillPolygon = miFillPolygon;
- pGC->ops->PolyFillArc = miPolyFillArc;
- }
- break;
- case FillOpaqueStippled:
- if(infoRec->FillSpansOpaqueStippled) {
- pGC->ops->FillSpans = infoRec->FillSpansOpaqueStippled;
- pGC->ops->PolyFillRect = infoRec->PolyFillRectOpaqueStippled;
- if(infoRec->FillPolygonOpaqueStippled)
- pGC->ops->FillPolygon = infoRec->FillPolygonOpaqueStippled;
- else pGC->ops->FillPolygon = miFillPolygon;
- pGC->ops->PolyFillArc = miPolyFillArc;
- }
- break;
- case FillTiled:
- if(infoRec->FillSpansTiled) {
- pGC->ops->FillSpans = infoRec->FillSpansTiled;
- pGC->ops->PolyFillRect = infoRec->PolyFillRectTiled;
- if(infoRec->FillPolygonTiled)
- pGC->ops->FillPolygon = infoRec->FillPolygonTiled;
- else pGC->ops->FillPolygon = miFillPolygon;
- pGC->ops->PolyFillArc = miPolyFillArc;
- }
- break;
- default: return;
- }
-}
-
-
-/* We make the assumption that these Text8/16 and GlyphBlt functions
- are linked in a way that they all have the same rop/color/planemask
- restrictions. If the driver provides a GC level replacement for
- these, it will need to supply a new Validate functions if it breaks
- this assumption */
-
-void
-XAAValidatePolyGlyphBlt(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- Bool BigFont = FALSE;
-
- pGC->ops->PolyText8 = XAAFallbackOps.PolyText8;
- pGC->ops->PolyText16 = XAAFallbackOps.PolyText16;
- pGC->ops->PolyGlyphBlt = XAAFallbackOps.PolyGlyphBlt;
-
- if(!pGC->font) return;
- if(pGC->fillStyle != FillSolid) return;
-
- if((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
- FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
- BigFont = TRUE;
-
- /* no funny business */
- if((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
- ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
- return;
-
- /* Check for TE Fonts */
- if(!TERMINALFONT(pGC->font) || BigFont) {
- if(infoRec->PolyGlyphBltNonTE &&
- CHECK_PLANEMASK(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
- CHECK_ROP(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
- CHECK_FG(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
- (!(infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
- (pGC->alu == GXcopy))
- ) {
- pGC->ops->PolyText8 = infoRec->PolyText8NonTE;
- pGC->ops->PolyText16 = infoRec->PolyText16NonTE;
- pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltNonTE;
- }
- } else {
- if(infoRec->PolyGlyphBltTE &&
- CHECK_PLANEMASK(pGC,infoRec->PolyGlyphBltTEFlags) &&
- CHECK_ROP(pGC,infoRec->PolyGlyphBltTEFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
- CHECK_FG(pGC,infoRec->PolyGlyphBltTEFlags) &&
- (!(infoRec->PolyGlyphBltTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
- (pGC->alu == GXcopy))
- ) {
- pGC->ops->PolyText8 = infoRec->PolyText8TE;
- pGC->ops->PolyText16 = infoRec->PolyText16TE;
- pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltTE;
- }
- }
-}
-
-void
-XAAValidateImageGlyphBlt(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- Bool BigFont = FALSE;
-
- pGC->ops->ImageText8 = XAAFallbackOps.ImageText8;
- pGC->ops->ImageText16 = XAAFallbackOps.ImageText16;
- pGC->ops->ImageGlyphBlt = XAAFallbackOps.ImageGlyphBlt;
-
- if(!pGC->font) return;
-
- if((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
- FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
- BigFont = TRUE;
-
- /* no funny business */
- if((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
- ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
- return;
-
-
- /* Check for TE Fonts */
- if(!TERMINALFONT(pGC->font) || BigFont || (pGC->depth == 32)) {
- if(infoRec->ImageGlyphBltNonTE &&
- CHECK_PLANEMASK(pGC,infoRec->ImageGlyphBltNonTEFlags) &&
- CHECK_FG(pGC,infoRec->ImageGlyphBltNonTEFlags) &&
- infoRec->SetupForSolidFill &&
- CHECK_PLANEMASK(pGC,infoRec->SolidFillFlags) &&
- CHECK_BG(pGC,infoRec->SolidFillFlags))
- {
- pGC->ops->ImageText8 = infoRec->ImageText8NonTE;
- pGC->ops->ImageText16 = infoRec->ImageText16NonTE;
- pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltNonTE;
- }
- } else if(infoRec->ImageGlyphBltTE &&
- CHECK_PLANEMASK(pGC,infoRec->ImageGlyphBltTEFlags)){
- if(!(infoRec->ImageGlyphBltTEFlags & TRANSPARENCY_ONLY) &&
- CHECK_COLORS(pGC,infoRec->ImageGlyphBltTEFlags))
- {
- pGC->ops->ImageText8 = infoRec->ImageText8TE;
- pGC->ops->ImageText16 = infoRec->ImageText16TE;
- pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
- } else {
- if(CHECK_FG(pGC,infoRec->ImageGlyphBltTEFlags) &&
- infoRec->SetupForSolidFill &&
- CHECK_PLANEMASK(pGC,infoRec->SolidFillFlags) &&
- CHECK_BG(pGC,infoRec->SolidFillFlags))
- {
- pGC->ops->ImageText8 = infoRec->ImageText8TE;
- pGC->ops->ImageText16 = infoRec->ImageText16TE;
- pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
- }
- }
- }
-}
-
-
-void
-XAAValidatePolylines(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
-
- if(pGC->lineStyle == LineSolid) changes &= ~GCDashList;
- if(!changes) return;
-
- pGC->ops->PolySegment = XAAFallbackOps.PolySegment;
- pGC->ops->Polylines = XAAFallbackOps.Polylines;
- pGC->ops->PolyRectangle = XAAFallbackOps.PolyRectangle;
- pGC->ops->PolyArc = XAAFallbackOps.PolyArc;
-
- if((pGC->ops->FillSpans != XAAFallbackOps.FillSpans) &&
- (pGC->lineWidth > 0)){
-
- pGC->ops->PolyArc = miPolyArc;
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->PolyRectangle = miPolyRectangle;
- if(pGC->lineStyle == LineSolid)
- pGC->ops->Polylines = miWideLine;
- else
- pGC->ops->Polylines = miWideDash;
- }
-
- if((pGC->lineWidth == 0) && (pGC->fillStyle == FillSolid)) {
-
- if(pGC->lineStyle == LineSolid) {
-
- if(infoRec->PolyRectangleThinSolid &&
- CHECK_PLANEMASK(pGC,infoRec->PolyRectangleThinSolidFlags) &&
- CHECK_ROP(pGC,infoRec->PolyRectangleThinSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolyRectangleThinSolidFlags) &&
- CHECK_FG(pGC,infoRec->PolyRectangleThinSolidFlags)) {
-
- pGC->ops->PolyRectangle = infoRec->PolyRectangleThinSolid;
- }
-
- if(infoRec->PolySegmentThinSolid &&
- CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinSolidFlags) &&
- CHECK_ROP(pGC,infoRec->PolySegmentThinSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolySegmentThinSolidFlags) &&
- CHECK_FG(pGC,infoRec->PolySegmentThinSolidFlags)) {
-
- pGC->ops->PolySegment = infoRec->PolySegmentThinSolid;
- }
-
- if(infoRec->PolylinesThinSolid &&
- CHECK_PLANEMASK(pGC,infoRec->PolylinesThinSolidFlags) &&
- CHECK_ROP(pGC,infoRec->PolylinesThinSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolylinesThinSolidFlags) &&
- CHECK_FG(pGC,infoRec->PolylinesThinSolidFlags)) {
-
- pGC->ops->Polylines = infoRec->PolylinesThinSolid;
- }
- } else if((pGC->lineStyle == LineOnOffDash) && pGCPriv->DashPattern){
-
- if(infoRec->PolySegmentThinDashed &&
- !(infoRec->PolySegmentThinDashedFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->PolySegmentThinDashedFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_ROP(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_FG(pGC,infoRec->PolySegmentThinDashedFlags)) {
-
- pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
- }
-
- if(infoRec->PolylinesThinDashed &&
- !(infoRec->PolylinesThinDashedFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->PolylinesThinDashedFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_PLANEMASK(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_ROP(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_FG(pGC,infoRec->PolylinesThinDashedFlags)) {
-
- pGC->ops->Polylines = infoRec->PolylinesThinDashed;
- }
-
- if(pGC->ops->Polylines != XAAFallbackOps.Polylines)
- pGC->ops->PolyRectangle = miPolyRectangle;
-
- } else if(pGCPriv->DashPattern && (pGC->depth != 32)) {
- /* LineDoubleDash */
- if(infoRec->PolySegmentThinDashed &&
- !(infoRec->PolySegmentThinDashedFlags & TRANSPARENCY_ONLY) &&
- CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_ROP(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolySegmentThinDashedFlags) &&
- CHECK_COLORS(pGC,infoRec->PolySegmentThinDashedFlags)) {
-
- pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
- }
-
- if(infoRec->PolylinesThinDashed &&
- !(infoRec->PolylinesThinDashedFlags & TRANSPARENCY_ONLY) &&
- CHECK_PLANEMASK(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_ROP(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolylinesThinDashedFlags) &&
- CHECK_COLORS(pGC,infoRec->PolylinesThinDashedFlags)) {
-
- pGC->ops->Polylines = infoRec->PolylinesThinDashed;
- }
-
- if(pGC->ops->Polylines != XAAFallbackOps.Polylines)
- pGC->ops->PolyRectangle = miPolyRectangle;
-
- }
- }
-
- if(infoRec->PolylinesWideSolid &&
- (pGC->lineWidth > 0) &&
- (pGC->fillStyle == FillSolid) &&
- (pGC->lineStyle == LineSolid) &&
- CHECK_PLANEMASK(pGC,infoRec->PolylinesWideSolidFlags) &&
- CHECK_ROP(pGC,infoRec->PolylinesWideSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->PolylinesWideSolidFlags) &&
- CHECK_FG(pGC,infoRec->PolylinesWideSolidFlags)) {
-
- pGC->ops->Polylines = infoRec->PolylinesWideSolid;
- }
-}
diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c
deleted file mode 100644
index c3db7ff57..000000000
--- a/hw/xfree86/xaa/xaaImage.c
+++ /dev/null
@@ -1,519 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.21 2003/11/10 18:22:41 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "servermd.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-void XAAMoveDWORDS_FixedBase(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *dest = *(src + 1);
- *dest = *(src + 2);
- *dest = *(src + 3);
- dwords -= 4;
- src += 4;
- }
-
- if(!dwords) return;
- *dest = *src;
- if(dwords == 1) return;
- *dest = *(src + 1);
- if(dwords == 2) return;
- *dest = *(src + 2);
-}
-
-void XAAMoveDWORDS(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- *(dest + 2) = *(src + 2);
- *(dest + 3) = *(src + 3);
- src += 4;
- dest += 4;
- dwords -= 4;
- }
- if(!dwords) return;
- *dest = *src;
- if(dwords == 1) return;
- *(dest + 1) = *(src + 1);
- if(dwords == 2) return;
- *(dest + 2) = *(src + 2);
-}
-
-void XAAMoveDWORDS_FixedSrc(
- register CARD32* dest,
- register CARD32* src,
- register int dwords )
-{
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *src;
- *(dest + 2) = *src;
- *(dest + 3) = *src;
- dest += 4;
- dwords -= 4;
- }
- if(!dwords) return;
- *dest = *src;
- if(dwords == 1) return;
- *(dest + 1) = *src;
- if(dwords == 2) return;
- *(dest + 2) = *src;
-}
-
-static void
-XAAWritePixmap32To24(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *srcInit,
- int srcwidth, /* bytes */
- int rop,
- unsigned int planemask,
- int trans
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int count, dwords = ((w * 3) + 3) >> 2;
- CARD32 *src, *dst;
- Bool PlusOne = FALSE;
-
- if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
- ((dwords * h) & 0x01)) {
- PlusOne = TRUE;
- }
-
- (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, trans, 24, 24);
- (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, 0);
-
- if(dwords > infoRec->ImageWriteRange) {
- dst = (CARD32*)infoRec->ImageWriteBase;
- while(h--) {
- src = (CARD32*)srcInit;
- count = w;
-
- while(count >= 4) {
- *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
- *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
- *dst = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
- src += 4;
- count -= 4;
- }
- switch(count) {
- case 0: break;
- case 1: *dst = src[0];
- break;
- case 2: *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
- *dst = src[1] >> 8;
- break;
- default: *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
- *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
- *dst = src[2] >> 16;
- break;
- }
- srcInit += srcwidth;
- }
- } else {
- while(h--) {
- dst = (CARD32*)infoRec->ImageWriteBase;
- src = (CARD32*)srcInit;
- count = w;
-
- while(count >= 4) {
- dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
- dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
- dst[2] = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
- dst += 3;
- src += 4;
- count -= 4;
- }
- switch(count) {
- case 0: break;
- case 1: dst[0] = src[0];
- break;
- case 2: dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
- dst[1] = src[1] >> 8;
- break;
- default: dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
- dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
- dst[2] = src[2] >> 16;
- break;
- }
- srcInit += srcwidth;
- }
- }
-
- if(PlusOne) {
- CARD32* base = (CARD32*)infoRec->ImageWriteBase;
- *base = 0x00000000;
- }
-
- if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-
-}
-
-void
-XAAWritePixmap (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth, /* bytes */
- int rop,
- unsigned int planemask,
- int trans,
- int bpp, int depth
-){
- XAAInfoRecPtr infoRec;
- int dwords, skipleft, Bpp;
- Bool beCareful, PlusOne;
-
- if((bpp == 32) && (pScrn->bitsPerPixel == 24)) {
- XAAWritePixmap32To24(pScrn, x, y, w, h, src, srcwidth,
- rop, planemask, trans);
- return;
- }
-
- infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- beCareful = PlusOne = FALSE;
- Bpp = bpp >> 3;
-
- if((skipleft = (long)src & 0x03L)) {
- if(!(infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
- skipleft = 0;
- beCareful = TRUE;
- goto BAD_ALIGNMENT;
- }
-
- if(Bpp == 3)
- skipleft = 4 - skipleft;
- else
- skipleft /= Bpp;
-
- if((x < skipleft) && !(infoRec->ImageWriteFlags &
- LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
- skipleft = 0;
- beCareful = TRUE;
- goto BAD_ALIGNMENT;
- }
-
- x -= skipleft;
- w += skipleft;
-
- if(Bpp == 3)
- src -= 3 * skipleft;
- else /* is this Alpha friendly ? */
- src = (unsigned char*)((long)src & ~0x03L);
- }
-
-BAD_ALIGNMENT:
-
- dwords = ((w * Bpp) + 3) >> 2;
-
- if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
- ((dwords * h) & 0x01)) {
- PlusOne = TRUE;
- }
-
-
- (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, trans, bpp, depth);
- (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, skipleft);
-
- if(beCareful) {
- /* in cases with bad alignment we have to be careful not
- to read beyond the end of the source */
- if(((x * Bpp) + (dwords << 2)) > srcwidth) h--;
- else beCareful = FALSE;
- }
-
- if(dwords > infoRec->ImageWriteRange) {
- while(h--) {
- XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src += srcwidth;
- }
- if(beCareful) {
- int shift = ((long)src & 0x03L) << 3;
- if(--dwords)
- XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
- *((CARD32*)infoRec->ImageWriteBase) = *((CARD32*)src) >> shift;
- }
- } else {
- if(srcwidth == (dwords << 2)) {
- int decrement = infoRec->ImageWriteRange/dwords;
-
- while(h > decrement) {
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords * decrement);
- src += (srcwidth * decrement);
- h -= decrement;
- }
- if(h) {
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords * h);
- if(beCareful) src += (srcwidth * h);
- }
- } else {
- while(h--) {
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src += srcwidth;
- }
- }
-
- if(beCareful) {
- int shift = ((long)src & 0x03L) << 3;
- if(--dwords)
- XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
- (CARD32*)src, dwords);
- src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
-
- ((CARD32*)infoRec->ImageWriteBase)[dwords] =
- *((CARD32*)src) >> shift;
- }
- }
-
- if(PlusOne) {
- CARD32* base = (CARD32*)infoRec->ImageWriteBase;
- *base = 0x00000000;
- }
-
- if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-
-void
-XAAWritePixmapScanline (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth, /* bytes */
- int rop,
- unsigned int planemask,
- int trans,
- int bpp, int depth
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int dwords, skipleft, bufferNo = 0, Bpp = bpp >> 3;
- Bool beCareful = FALSE;
- CARD32* base;
-
- if((skipleft = (long)src & 0x03L)) {
- if(!(infoRec->ScanlineImageWriteFlags & LEFT_EDGE_CLIPPING)) {
- skipleft = 0;
- beCareful = TRUE;
- goto BAD_ALIGNMENT;
- }
-
- if(Bpp == 3)
- skipleft = 4 - skipleft;
- else
- skipleft /= Bpp;
-
- if((x < skipleft) && !(infoRec->ScanlineImageWriteFlags &
- LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
- skipleft = 0;
- beCareful = TRUE;
- goto BAD_ALIGNMENT;
- }
-
- x -= skipleft;
- w += skipleft;
-
- if(Bpp == 3)
- src -= 3 * skipleft;
- else
- src = (unsigned char*)((long)src & ~0x03L);
- }
-
-BAD_ALIGNMENT:
-
- dwords = ((w * Bpp) + 3) >> 2;
-
- (*infoRec->SetupForScanlineImageWrite)(
- pScrn, rop, planemask, trans, bpp, depth);
- (*infoRec->SubsequentScanlineImageWriteRect)(pScrn, x, y, w, h, skipleft);
-
- if(beCareful) {
- /* in cases with bad alignment we have to be careful not
- to read beyond the end of the source */
- if(((x * Bpp) + (dwords << 2)) > srcwidth) h--;
- else beCareful = FALSE;
- }
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineImageWriteBuffers[bufferNo];
- XAAMoveDWORDS(base, (CARD32*)src, dwords);
- (*infoRec->SubsequentImageWriteScanline)(pScrn, bufferNo++);
- src += srcwidth;
- if(bufferNo >= infoRec->NumScanlineImageWriteBuffers)
- bufferNo = 0;
- }
-
- if(beCareful) {
- int shift = ((long)src & 0x03L) << 3;
- base = (CARD32*)infoRec->ScanlineImageWriteBuffers[bufferNo];
- if(--dwords)
- XAAMoveDWORDS(base,(CARD32*)src, dwords);
- src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
-
- base[dwords] = *((CARD32*)src) >> shift;
- (*infoRec->SubsequentImageWriteScanline)(pScrn, bufferNo);
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-void
-XAAPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int bpp = BitsPerPixel(depth);
- Bool depthBug = FALSE;
- if(!w || !h) return;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- depthBug = XAA_DEPTH_BUG(pGC);
-
- if(((format == ZPixmap) && infoRec->WritePixmap &&
- ((pDraw->bitsPerPixel == bpp) ||
- ((pDraw->bitsPerPixel == 24) && (bpp == 32) &&
- (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
- CHECK_ROP(pGC,infoRec->WritePixmapFlags) &&
- CHECK_ROPSRC(pGC,infoRec->WritePixmapFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->WritePixmapFlags) &&
- CHECK_NO_GXCOPY(pGC,infoRec->WritePixmapFlags)) ||
- ((format == XYBitmap) && !depthBug && infoRec->WriteBitmap &&
- CHECK_ROP(pGC,infoRec->WriteBitmapFlags) &&
- CHECK_ROPSRC(pGC,infoRec->WriteBitmapFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->WriteBitmapFlags) &&
- CHECK_COLORS(pGC,infoRec->WriteBitmapFlags) &&
- !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) ||
- ((format == XYPixmap) && !depthBug && infoRec->WriteBitmap &&
- CHECK_ROP(pGC,infoRec->WriteBitmapFlags) &&
- CHECK_ROPSRC(pGC,infoRec->WriteBitmapFlags) &&
- !(infoRec->WriteBitmapFlags & NO_PLANEMASK) &&
- !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))){
-
- int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
- BoxPtr pbox, pClipBoxes;
- int nboxes, srcx, srcy, srcwidth;
- xRectangle TheRect;
-
- TheRect.x = pDraw->x + x;
- TheRect.y = pDraw->y + y;
- TheRect.width = w;
- TheRect.height = h;
-
- if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) {
- pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec));
- if(!pClipBoxes) return;
- } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
-
- nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
- pbox = pClipBoxes;
-
- if(format == XYBitmap) {
- srcwidth = BitmapBytePad(leftPad + w);
- while(nboxes--) {
- srcx = pbox->x1 - TheRect.x + leftPad;
- srcy = pbox->y1 - TheRect.y;
- (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- (unsigned char*)pImage +
- (srcwidth * srcy) + ((srcx >> 5) << 2),
- srcwidth, srcx & 31, pGC->fgPixel, pGC->bgPixel,
- pGC->alu, pGC->planemask);
- pbox++;
- }
- } else if(format == ZPixmap) {
- int Bpp = bpp >> 3;
- srcwidth = PixmapBytePad(leftPad + w, depth);
- while(nboxes--) {
- srcx = pbox->x1 - TheRect.x + leftPad;
- srcy = pbox->y1 - TheRect.y;
- (*infoRec->WritePixmap)(infoRec->pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- (unsigned char*)pImage +
- (srcwidth * srcy) + (srcx * Bpp),
- srcwidth, pGC->alu, pGC->planemask, -1,
- Bpp << 3, depth);
- pbox++;
- }
- } else { /* XYPixmap */
- int depth = pGC->depth;
- int numBox, increment;
- unsigned long i, mask;
- BoxPtr pntBox;
-
- srcwidth = BitmapBytePad(w + leftPad);
- increment = h * srcwidth;
- i = 1 << (depth - 1);
- mask = ~0;
-
- if((infoRec->pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
- (pGC->depth == 8)){
- i = 0x80000000; mask = 0xff000000;
- }
-
- for(; i & mask; i >>= 1, pImage += increment) {
- if(i & pGC->planemask) {
- pntBox = pbox;
- numBox = nboxes;
- while(numBox--) {
- srcx = pntBox->x1 - TheRect.x + leftPad;
- srcy = pntBox->y1 - TheRect.y;
- (*infoRec->WriteBitmap)(infoRec->pScrn,
- pntBox->x1, pntBox->y1,
- pntBox->x2 - pntBox->x1,
- pntBox->y2 - pntBox->y1,
- (unsigned char*)pImage +
- (srcwidth * srcy) + ((srcx >> 5) << 2),
- srcwidth, srcx & 31, ~0, 0, pGC->alu, i);
- pntBox++;
- }
- }
- }
-
- }
-
- if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem)
- xfree(pClipBoxes);
- } else
- XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad,
- format, pImage);
-}
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
deleted file mode 100644
index 5237e8b2c..000000000
--- a/hw/xfree86/xaa/xaaInit.c
+++ /dev/null
@@ -1,762 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.35 2001/07/19 18:50:16 mvojkovi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-#define MAX_PREALLOC_MEM 65536 /* MUST be >= 1024 */
-
-#define MIN_OFFPIX_SIZE (320*200)
-
-static Bool XAACloseScreen(int i, ScreenPtr pScreen);
-static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planemask,
- char *pdstLine);
-static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
- int *pwidth, int nspans, char *pdstStart);
-static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
-static Bool XAADestroyPixmap(PixmapPtr pPixmap);
-static void XAARestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
- int xorg, int yorg, WindowPtr pWin);
-static void XAASaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
- int xorg, int yorg, WindowPtr pWin);
-static Bool XAAEnterVT (int index, int flags);
-static void XAALeaveVT (int index, int flags);
-static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
-static void XAAEnableDisableFBAccess (int index, Bool enable);
-static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
-
-int XAAScreenIndex = -1;
-int XAAGCIndex = -1;
-int XAAPixmapIndex = -1;
-static unsigned long XAAGeneration = 0;
-
-/* temp kludge */
-static Bool SwitchedOut = FALSE;
-
-XAAInfoRecPtr
-XAACreateInfoRec()
-{
- XAAInfoRecPtr infoRec;
-
- infoRec = xcalloc(1, sizeof(XAAInfoRec));
- if(infoRec)
- infoRec->CachePixelGranularity = -1;
-
- return infoRec;
-}
-
-void
-XAADestroyInfoRec(XAAInfoRecPtr infoRec)
-{
- if(!infoRec) return;
-
- if(infoRec->ClosePixmapCache)
- (*infoRec->ClosePixmapCache)(infoRec->pScrn->pScreen);
-
- if(infoRec->PreAllocMem)
- xfree(infoRec->PreAllocMem);
-
- if(infoRec->PixmapCachePrivate)
- xfree(infoRec->PixmapCachePrivate);
-
- xfree(infoRec);
-}
-
-
-Bool
-XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAScreenPtr pScreenPriv;
- int i;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- /* Return successfully if no acceleration wanted */
- if (!infoRec)
- return TRUE;
-
- if (XAAGeneration != serverGeneration) {
- if ( ((XAAScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((XAAGCIndex = AllocateGCPrivateIndex()) < 0) ||
- ((XAAPixmapIndex = AllocatePixmapPrivateIndex()) < 0))
- return FALSE;
-
- XAAGeneration = serverGeneration;
- }
-
- if (!AllocateGCPrivate(pScreen, XAAGCIndex, sizeof(XAAGCRec)))
- return FALSE;
-
- if (!AllocatePixmapPrivate(pScreen, XAAPixmapIndex, sizeof(XAAPixmapRec)))
- return FALSE;
-
- if (!(pScreenPriv = xalloc(sizeof(XAAScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[XAAScreenIndex].ptr = (pointer)pScreenPriv;
-
- if(!xf86FBManagerRunning(pScreen))
- infoRec->Flags &= ~(PIXMAP_CACHE | OFFSCREEN_PIXMAPS);
- if(!(infoRec->Flags & LINEAR_FRAMEBUFFER))
- infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
-
- if(!infoRec->FullPlanemask) { /* for backwards compatibility */
- infoRec->FullPlanemask = (1 << pScrn->depth) - 1;
- infoRec->FullPlanemasks[pScrn->depth - 1] = infoRec->FullPlanemask;
- }
-
- for(i = 0; i < 32; i++) {
- if(!infoRec->FullPlanemasks[i]) /* keep any set by caller */
- infoRec->FullPlanemasks[i] = (1 << (i+1)) - 1;
- }
-
- if(!XAAInitAccel(pScreen, infoRec)) return FALSE;
- pScreenPriv->AccelInfoRec = infoRec;
- infoRec->ScratchGC.pScreen = pScreen;
-
-
- if(!infoRec->GetImage)
- infoRec->GetImage = XAAGetImage;
- if(!infoRec->GetSpans)
- infoRec->GetSpans = XAAGetSpans;
- if(!infoRec->PaintWindowBackground)
- infoRec->PaintWindowBackground = XAAPaintWindow;
- if(!infoRec->PaintWindowBorder)
- infoRec->PaintWindowBorder = XAAPaintWindow;
- if(!infoRec->CopyWindow)
- infoRec->CopyWindow = XAACopyWindow;
- if(!infoRec->SaveAreas)
- infoRec->SaveAreas = XAASaveAreas;
- if(!infoRec->RestoreAreas)
- infoRec->RestoreAreas = XAARestoreAreas;
-
- pScreenPriv->CreateGC = pScreen->CreateGC;
- pScreen->CreateGC = XAACreateGC;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = XAACloseScreen;
- pScreenPriv->GetImage = pScreen->GetImage;
- pScreen->GetImage = infoRec->GetImage;
- pScreenPriv->GetSpans = pScreen->GetSpans;
- pScreen->GetSpans = infoRec->GetSpans;
- pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreen->PaintWindowBackground = infoRec->PaintWindowBackground;
- pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
- pScreen->PaintWindowBorder = infoRec->PaintWindowBorder;
- pScreenPriv->CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = infoRec->CopyWindow;
- pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
- pScreen->CreatePixmap = XAACreatePixmap;
- pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
- pScreen->DestroyPixmap = XAADestroyPixmap;
- pScreenPriv->BackingStoreFuncs.RestoreAreas =
- pScreen->BackingStoreFuncs.RestoreAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = infoRec->RestoreAreas;
- pScreenPriv->BackingStoreFuncs.SaveAreas =
- pScreen->BackingStoreFuncs.SaveAreas;
- pScreen->BackingStoreFuncs.SaveAreas = infoRec->SaveAreas;
- pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pScreen->ChangeWindowAttributes = XAAChangeWindowAttributes;
-
- pScreenPriv->EnterVT = pScrn->EnterVT;
- pScrn->EnterVT = XAAEnterVT;
- pScreenPriv->LeaveVT = pScrn->LeaveVT;
- pScrn->LeaveVT = XAALeaveVT;
- pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
- pScrn->SetDGAMode = XAASetDGAMode;
- pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
- pScrn->EnableDisableFBAccess = XAAEnableDisableFBAccess;
-
- pScreenPriv->WindowExposures = pScreen->WindowExposures;
-#ifdef RENDER
- if (ps)
- {
- pScreenPriv->Composite = ps->Composite;
- ps->Composite = XAAComposite;
- pScreenPriv->Glyphs = ps->Glyphs;
- ps->Glyphs = XAAGlyphs;
- }
-#endif
- if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR)
- XAASetupOverlay8_32Planar(pScreen);
-
- infoRec->PreAllocMem = xalloc(MAX_PREALLOC_MEM);
- if(infoRec->PreAllocMem)
- infoRec->PreAllocSize = MAX_PREALLOC_MEM;
-
- if(infoRec->Flags & PIXMAP_CACHE)
- xf86RegisterFreeBoxCallback(pScreen, infoRec->InitPixmapCache,
- (pointer)infoRec);
-
- if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
- miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
-
- return TRUE;
-}
-
-
-
-static Bool
-XAACloseScreen (int i, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
-
- pScrn->EnterVT = pScreenPriv->EnterVT;
- pScrn->LeaveVT = pScreenPriv->LeaveVT;
- pScrn->EnableDisableFBAccess = pScreenPriv->EnableDisableFBAccess;
-
- pScreen->CreateGC = pScreenPriv->CreateGC;
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->GetImage = pScreenPriv->GetImage;
- pScreen->GetSpans = pScreenPriv->GetSpans;
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
- pScreen->CopyWindow = pScreenPriv->CopyWindow;
- pScreen->WindowExposures = pScreenPriv->WindowExposures;
- pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
- pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
- pScreen->BackingStoreFuncs.RestoreAreas =
- pScreenPriv->BackingStoreFuncs.RestoreAreas;
- pScreen->BackingStoreFuncs.SaveAreas =
- pScreenPriv->BackingStoreFuncs.SaveAreas;
- pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
-
- /* We leave it up to the client to free the XAAInfoRec */
-
- xfree ((pointer) pScreenPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void
-XAAGetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planemask,
- char *pdstLine
-)
-{
- ScreenPtr pScreen = pDraw->pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = infoRec->pScrn;
-
- if(pScrn->vtSema &&
- ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw)))
- {
- if(infoRec->ReadPixmap && (format == ZPixmap) &&
- ((planemask & infoRec->FullPlanemasks[pDraw->depth - 1]) ==
- infoRec->FullPlanemasks[pDraw->depth - 1]) &&
- (pDraw->bitsPerPixel == BitsPerPixel(pDraw->depth)))
- {
- (*infoRec->ReadPixmap)(pScrn,
- sx + pDraw->x, sy + pDraw->y, w, h,
- (unsigned char *)pdstLine,
- PixmapBytePad(w, pDraw->depth),
- pDraw->bitsPerPixel, pDraw->depth);
- return;
- }
- SYNC_CHECK(pDraw);
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, GetImage);
- (*pScreen->GetImage) (pDraw, sx, sy, w, h, format, planemask, pdstLine);
- XAA_SCREEN_EPILOGUE (pScreen, GetImage, XAAGetImage);
-}
-
-static void
-XAAGetSpans (
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pdstStart
-)
-{
- ScreenPtr pScreen = pDraw->pScreen;
- XAA_SCREEN_PROLOGUE (pScreen, GetSpans);
- if(xf86Screens[pScreen->myNum]->vtSema &&
- ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) {
- SYNC_CHECK(pDraw);
- }
- (*pScreen->GetSpans) (pDraw, wMax, ppt, pwidth, nspans, pdstStart);
- XAA_SCREEN_EPILOGUE (pScreen, GetSpans, XAAGetSpans);
-}
-
-
-static void
-XAASaveAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
- if(IS_OFFSCREEN_PIXMAP(pPixmap)) {
- BoxPtr pbox = REGION_RECTS(prgnSave);
- int nboxes = REGION_NUM_RECTS(prgnSave);
-
- (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, ~0, -1);
- while(nboxes--) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pbox->x1 + xorg, pbox->y1 + yorg,
- pPixmap->drawable.x + pbox->x1,
- pPixmap->drawable.y + pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- pbox++;
- }
- SET_SYNC_FLAG(infoRec);
- return;
- }
-
- if(xf86Screens[pScreen->myNum]->vtSema && infoRec->ReadPixmap &&
- (pWin->drawable.bitsPerPixel == pPixmap->drawable.bitsPerPixel)) {
- BoxPtr pbox = REGION_RECTS(prgnSave);
- int nboxes = REGION_NUM_RECTS(prgnSave);
- int Bpp = pPixmap->drawable.bitsPerPixel >> 3;
- unsigned char *dstp = (unsigned char*)pPixmap->devPrivate.ptr;
-
- while(nboxes--) {
- (*infoRec->ReadPixmap)(infoRec->pScrn,
- pbox->x1 + xorg, pbox->y1 + yorg,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- dstp + (pPixmap->devKind * pbox->y1) + (pbox->x1 * Bpp),
- pPixmap->devKind,
- pPixmap->drawable.bitsPerPixel, pPixmap->drawable.depth);
- pbox++;
- }
- return;
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, BackingStoreFuncs.SaveAreas);
- if(pScrn->vtSema) {
- SYNC_CHECK(&pWin->drawable);
- }
- (*pScreen->BackingStoreFuncs.SaveAreas) (
- pPixmap, prgnSave, xorg, yorg, pWin);
-
- XAA_SCREEN_EPILOGUE (pScreen, BackingStoreFuncs.SaveAreas,
- XAASaveAreas);
-}
-
-static void
-XAARestoreAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
- if(IS_OFFSCREEN_PIXMAP(pPixmap)) {
- BoxPtr pbox = REGION_RECTS(prgnRestore);
- int nboxes = REGION_NUM_RECTS(prgnRestore);
- int pm = ~0;
-
- if((pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
- (pWin->drawable.depth == 24))
- pm = 0x00ffffff;
-
- (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, pm, -1);
- while(nboxes--) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pPixmap->drawable.x + pbox->x1 - xorg,
- pPixmap->drawable.y + pbox->y1 - yorg,
- pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- pbox++;
- }
- SET_SYNC_FLAG(infoRec);
- return;
- }
-
- if(pScrn->vtSema && infoRec->WritePixmap &&
- !(infoRec->WritePixmapFlags & NO_GXCOPY) &&
- ((pWin->drawable.bitsPerPixel == pPixmap->drawable.bitsPerPixel) ||
- ((pWin->drawable.bitsPerPixel == 24) &&
- (pPixmap->drawable.bitsPerPixel == 32) &&
- (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP)))) {
- BoxPtr pbox = REGION_RECTS(prgnRestore);
- int nboxes = REGION_NUM_RECTS(prgnRestore);
- int Bpp = pPixmap->drawable.bitsPerPixel >> 3;
- unsigned char *srcp = (unsigned char*)pPixmap->devPrivate.ptr;
- int pm = ~0;
-
- if((pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
- (pWin->drawable.depth == 24))
- pm = 0x00ffffff;
-
- while(nboxes--) {
- (*infoRec->WritePixmap)(pScrn, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- srcp + (pPixmap->devKind * (pbox->y1 - yorg)) +
- ((pbox->x1 - xorg) * Bpp),
- pPixmap->devKind, GXcopy, pm, -1,
- pPixmap->drawable.bitsPerPixel, pPixmap->drawable.depth);
- pbox++;
- }
- return;
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, BackingStoreFuncs.RestoreAreas);
- if(pScrn->vtSema) {
- SYNC_CHECK(&pWin->drawable);
- }
- (*pScreen->BackingStoreFuncs.RestoreAreas) (
- pPixmap, prgnRestore, xorg, yorg, pWin);
-
- XAA_SCREEN_EPILOGUE (pScreen, BackingStoreFuncs.RestoreAreas,
- XAARestoreAreas);
-}
-
-static int
-XAAPixmapBPP (ScreenPtr pScreen, int depth)
-{
- PixmapPtr pPix;
- int bpp;
- DestroyPixmapProcPtr destroyPixmap;
-
- XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
- pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth);
- XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
- if (!pPix)
- return 0;
- bpp = pPix->drawable.bitsPerPixel;
- destroyPixmap = pScreen->DestroyPixmap;
- XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
- (*pScreen->DestroyPixmap) (pPix);
- XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, destroyPixmap);
- return bpp;
-}
-
-static void
-XAAInitializeOffscreenDepths (ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- int d, dep;
-
- infoRec->offscreenDepthsInitialized = TRUE;
- infoRec->offscreenDepths = 0;
- if (infoRec->Flags & OFFSCREEN_PIXMAPS) {
- for (d = 0; d < pScreen->numDepths; d++) {
- dep = pScreen->allowedDepths[d].depth;
- if (XAAPixmapBPP (pScreen, dep) == pScrn->bitsPerPixel)
- infoRec->offscreenDepths |= (1 << (dep - 1));
- }
- }
-}
-
-static PixmapPtr
-XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAPixmapPtr pPriv;
- PixmapPtr pPix = NULL;
- int size = w * h;
-
- if (!infoRec->offscreenDepthsInitialized)
- XAAInitializeOffscreenDepths (pScreen);
-
- if(pScrn->vtSema && (infoRec->offscreenDepths & (1 << (depth - 1))) &&
- (size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
- (!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
- (!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight)) )
- {
- PixmapLinkPtr pLink;
- PixmapPtr pScreenPix;
- FBAreaPtr area;
- int gran = 0;
-
- switch(pScrn->bitsPerPixel) {
- case 24:
- case 8: gran = 4; break;
- case 16: gran = 2; break;
- case 32: gran = 1; break;
- default: break;
- }
-
- if(BITMAP_SCANLINE_PAD == 64)
- gran *= 2;
-
- if(!(area = xf86AllocateOffscreenArea(pScreen, w, h, gran, 0,
- XAARemoveAreaCallback, NULL))) {
- goto BAILOUT;
- }
-
- if(!(pLink = xalloc(sizeof(PixmapLink)))) {
- xf86FreeOffscreenArea(area);
- goto BAILOUT;
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
- pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth);
- XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
-
- if (!pPix) {
- xfree (pLink);
- xf86FreeOffscreenArea(area);
- goto BAILOUT;
- }
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- pPix->drawable.x = area->box.x1;
- pPix->drawable.y = area->box.y1;
- pPix->drawable.width = w;
- pPix->drawable.height = h;
- pPix->drawable.bitsPerPixel = pScrn->bitsPerPixel;
- pPix->devKind = pScreenPix->devKind;
- pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
- area->devPrivate.ptr = pPix;
-
- pPriv->flags = OFFSCREEN;
- pPriv->offscreenArea = area;
- pPriv->freeData = FALSE;
-
- pLink->next = infoRec->OffscreenPixmaps;
- pLink->pPix = pPix;
- infoRec->OffscreenPixmaps = pLink;
- return pPix;
- }
-BAILOUT:
- XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
- pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
- XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
-
- if(pPix) {
- pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- pPriv->flags = 0;
- pPriv->offscreenArea = NULL;
- pPriv->freeData = FALSE;
- if(!w || !h) /* either scratch or shared memory */
- pPriv->flags |= SHARED_PIXMAP;
- }
-
- return pPix;
-}
-
-static Bool
-XAADestroyPixmap(PixmapPtr pPix)
-{
- ScreenPtr pScreen = pPix->drawable.pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- Bool ret;
-
- if(pPix->refcnt == 1) {
- if(pPriv->flags & OFFSCREEN) {
- if(pPriv->flags & DGA_PIXMAP)
- xfree(pPriv->offscreenArea);
- else {
- FBAreaPtr area = pPriv->offscreenArea;
- PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
- PixmapLinkPtr prev = NULL;
-
- while(pLink->pPix != pPix) {
- prev = pLink;
- pLink = pLink->next;
- }
-
- if(prev) prev->next = pLink->next;
- else infoRec->OffscreenPixmaps = pLink->next;
-
- if(!area) area = pLink->area;
-
- xf86FreeOffscreenArea(area);
- pPriv->offscreenArea = NULL;
- xfree(pLink);
- }
- }
-
- if(pPriv->freeData) { /* pixmaps that were once in video ram */
- xfree(pPix->devPrivate.ptr);
- pPix->devPrivate.ptr = NULL;
- }
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
- ret = (*pScreen->DestroyPixmap) (pPix);
- XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, XAADestroyPixmap);
-
- return ret;
-}
-
-static Bool
-XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- Bool ret;
-
- XAA_SCREEN_PROLOGUE (pScreen, ChangeWindowAttributes);
- ret = (*pScreen->ChangeWindowAttributes) (pWin, mask);
- XAA_SCREEN_EPILOGUE (pScreen, ChangeWindowAttributes, XAAChangeWindowAttributes);
-
- /* we have to assume that shared memory pixmaps are dirty
- because we can't wrap operations on them */
-
- if((mask & CWBackPixmap) && (pWin->backgroundState == BackgroundPixmap) &&
- PIXMAP_IS_SHARED(pWin->background.pixmap))
- {
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->background.pixmap);
- pPixPriv->flags |= DIRTY;
- }
- if((mask & CWBorderPixmap) && !(pWin->borderIsPixel) &&
- PIXMAP_IS_SHARED(pWin->border.pixmap))
- {
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->border.pixmap);
- pPixPriv->flags |= DIRTY;
- }
-
- return ret;
-}
-
-
-
-/* These two aren't really needed for anything */
-
-static Bool
-XAAEnterVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
-
- return((*pScreenPriv->EnterVT)(index, flags));
-}
-
-static void
-XAALeaveVT(int index, int flags)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
- XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
-
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
-
- (*pScreenPriv->LeaveVT)(index, flags);
-}
-
-typedef struct {
- Bool UsingPixmapCache;
- Bool CanDoColor8x8;
- Bool CanDoMono8x8;
-} SavedCacheState, *SavedCacheStatePtr;
-
-static int
-XAASetDGAMode(int index, int num, DGADevicePtr devRet)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
- int ret;
-
- if (!num && infoRec->dgaSaves) { /* restore old pixmap cache state */
- SavedCacheStatePtr state = (SavedCacheStatePtr)infoRec->dgaSaves;
-
- infoRec->UsingPixmapCache = state->UsingPixmapCache;
- infoRec->CanDoColor8x8 = state->CanDoColor8x8;
- infoRec->CanDoMono8x8 = state->CanDoMono8x8;
- xfree(infoRec->dgaSaves);
- infoRec->dgaSaves = NULL;
- }
-
- ret = (*pScreenPriv->SetDGAMode)(index, num, devRet);
- if(ret != Success) return ret;
-
- if(num && devRet->pPix) { /* accelerate this pixmap */
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix);
- FBAreaPtr area;
-
- if((area = xalloc(sizeof(FBArea)))) {
- area->pScreen = pScreen;
- area->box.x1 = 0;
- area->box.x2 = 0;
- area->box.y1 = devRet->mode->pixmapWidth;
- area->box.y2 = devRet->mode->pixmapHeight;
- area->granularity = 0;
- area->MoveAreaCallback = 0;
- area->RemoveAreaCallback = 0;
- area->devPrivate.ptr = 0;
-
- pixPriv->flags |= OFFSCREEN | DGA_PIXMAP;
- pixPriv->offscreenArea = area;
-
- if(!infoRec->dgaSaves) { /* save pixmap cache state */
- SavedCacheStatePtr state = xalloc(sizeof(SavedCacheState));
-
- state->UsingPixmapCache = infoRec->UsingPixmapCache;
- state->CanDoColor8x8 = infoRec->CanDoColor8x8;
- state->CanDoMono8x8 = infoRec->CanDoMono8x8;
- infoRec->dgaSaves = (char*)state;
-
- infoRec->UsingPixmapCache = FALSE;
- if(infoRec->PixmapCacheFlags & CACHE_MONO_8x8)
- infoRec->CanDoMono8x8 = FALSE;
- if(infoRec->PixmapCacheFlags & CACHE_COLOR_8x8)
- infoRec->CanDoColor8x8 = FALSE;
- }
- }
- }
-
- return ret;
-}
-
-
-
-static void
-XAAEnableDisableFBAccess (int index, Bool enable)
-{
- ScreenPtr pScreen = screenInfo.screens[index];
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
-
- if(!enable) {
- if((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
- XAAMoveOutOffscreenPixmaps(pScreen);
- if(infoRec->Flags & PIXMAP_CACHE)
- XAAInvalidatePixmapCache(pScreen);
- SwitchedOut = TRUE;
- }
-
- (*pScreenPriv->EnableDisableFBAccess)(index, enable);
-
- if(enable) {
- if((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
- XAAMoveInOffscreenPixmaps(pScreen);
- SwitchedOut = FALSE;
- }
-}
diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c
deleted file mode 100644
index 1b1bc1830..000000000
--- a/hw/xfree86/xaa/xaaInitAccel.c
+++ /dev/null
@@ -1,1513 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.36 2003/01/12 03:55:51 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-#ifdef XFree86LOADER
-static const OptionInfoRec *XAAAvailableOptions(void *unused);
-#endif
-
-/*
- * XAA Config options
- */
-
-typedef enum {
- XAAOPT_SCREEN_TO_SCREEN_COPY,
- XAAOPT_SOLID_FILL_RECT,
- XAAOPT_SOLID_FILL_TRAP,
- XAAOPT_SOLID_TWO_POINT_LINE,
- XAAOPT_SOLID_BRESENHAM_LINE,
- XAAOPT_SOLID_HORVERT_LINE,
- XAAOPT_DASHED_TWO_POINT_LINE,
- XAAOPT_DASHED_BRESENHAM_LINE,
- XAAOPT_MONO_8x8_PATTERN_FILL_RECT,
- XAAOPT_MONO_8x8_PATTERN_FILL_TRAP,
- XAAOPT_COL_8x8_PATTERN_FILL_RECT,
- XAAOPT_COL_8x8_PATTERN_FILL_TRAP,
- XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL,
- XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
- XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL,
- XAAOPT_IMAGE_WRITE_RECT,
- XAAOPT_SCANLINE_IMAGE_WRITE_RECT,
- XAAOPT_WRITE_BITMAP,
- XAAOPT_WRITE_PIXMAP,
- XAAOPT_PIXMAP_CACHE,
- XAAOPT_OFFSCREEN_PIXMAPS
-} XAAOpts;
-
-static const OptionInfoRec XAAOptions[] = {
- {XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SOLID_FILL_TRAP, "XaaNoSolidFillTrap",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SOLID_TWO_POINT_LINE, "XaaNoSolidTwoPointLine",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SOLID_BRESENHAM_LINE, "XaaNoSolidBresenhamLine",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SOLID_HORVERT_LINE, "XaaNoSolidHorVertLine",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_DASHED_TWO_POINT_LINE, "XaaNoDashedTwoPointLine",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_DASHED_BRESENHAM_LINE, "XaaNoDashedBresenhamLine",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_MONO_8x8_PATTERN_FILL_RECT, "XaaNoMono8x8PatternFillRect",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, "XaaNoMono8x8PatternFillTrap",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_COL_8x8_PATTERN_FILL_RECT, "XaaNoColor8x8PatternFillRect",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_COL_8x8_PATTERN_FILL_TRAP, "XaaNoColor8x8PatternFillTrap",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, "XaaNoCPUToScreenColorExpandFill",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,"XaaNoScanlineCPUToScreenColorExpandFill",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, "XaaNoScreenToScreenColorExpandFill",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_IMAGE_WRITE_RECT, "XaaNoImageWriteRect",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_SCANLINE_IMAGE_WRITE_RECT, "XaaNoScanlineImageWriteRect",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_WRITE_BITMAP, "XaaNoWriteBitmap",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_WRITE_PIXMAP, "XaaNoWritePixmap",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_PIXMAP_CACHE, "XaaNoPixmapCache",
- OPTV_BOOLEAN, {0}, FALSE },
- {XAAOPT_OFFSCREEN_PIXMAPS, "XaaNoOffscreenPixmaps",
- OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL,
- OPTV_NONE, {0}, FALSE }
-};
-
-#ifdef XFree86LOADER
-static MODULESETUPPROTO(xaaSetup);
-
-static XF86ModuleVersionInfo xaaVersRec =
-{
- "xaa",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 1, 0,
- ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, NULL };
-
-ModuleInfoRec XAA = {
- 1,
- "XAA",
- NULL,
- 0,
- XAAAvailableOptions,
-};
-
-/*ARGSUSED*/
-static pointer
-xaaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
-{
- static Bool Initialised = FALSE;
-
- if (!Initialised) {
- Initialised = TRUE;
-#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
- if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
-#endif
- xf86AddModuleInfo(&XAA, Module);
- }
-
- return (pointer)TRUE;
-}
-
-/*ARGSUSED*/
-static const OptionInfoRec *
-XAAAvailableOptions(void *unused)
-{
- return (XAAOptions);
-}
-#endif
-
-Bool
-XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
- int index = pScreen->myNum;
- ScrnInfoPtr pScrn = xf86Screens[index];
- Bool HaveScreenToScreenCopy = FALSE;
- Bool HaveColorExpansion = FALSE;
- Bool HaveScanlineColorExpansion = FALSE;
- Bool HaveSolidFillRect = FALSE;
- Bool HaveMono8x8PatternFillRect = FALSE;
- Bool HaveColor8x8PatternFillRect = FALSE;
- Bool HaveSolidFillTrap = FALSE;
- Bool HaveMono8x8PatternFillTrap = FALSE;
- Bool HaveColor8x8PatternFillTrap = FALSE;
- Bool HaveSolidTwoPointLine = FALSE;
- Bool HaveSolidBresenhamLine = FALSE;
- Bool HaveSolidHorVertLine = FALSE;
- Bool HaveDashedTwoPointLine = FALSE;
- Bool HaveDashedBresenhamLine = FALSE;
- Bool HaveImageWriteRect = FALSE;
- Bool HaveScanlineImageWriteRect = FALSE;
- Bool HaveScreenToScreenColorExpandFill = FALSE;
- OptionInfoPtr options;
- int is_shared = 0;
- int i;
-
- options = xnfalloc(sizeof(XAAOptions));
- (void)memcpy(options, XAAOptions, sizeof(XAAOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- infoRec->pScrn = pScrn;
- infoRec->NeedToSync = FALSE;
-
- /* must have a Sync function */
- if(!infoRec->Sync) return FALSE;
- for(i = 0; i < pScrn->numEntities; i++) {
- if(xf86IsEntityShared(pScrn->entityList[i])) is_shared = 1;
- }
-
- /* If this PCI entity has IS_SHARED_ACCEL set in entityProp
- * then a RestoreAccelState function is required
- */
- if(!infoRec->RestoreAccelState && is_shared) return FALSE;
-
- if(infoRec->RestoreAccelState) {
- if(!XAAInitStateWrap(pScreen, infoRec)) return FALSE;
- }
-
- if (serverGeneration == 1)
- xf86DrvMsg(index, X_INFO,
- "Using XFree86 Acceleration Architecture (XAA)\n");
-
-
- /************** Low Level *************/
-
- if(!infoRec->SetClippingRectangle || !infoRec->DisableClipping) {
- infoRec->ClippingFlags = 0;
- infoRec->SetClippingRectangle = NULL;
- infoRec->DisableClipping = NULL;
- }
-
- /**** CopyArea ****/
-
- if(infoRec->SetupForScreenToScreenCopy &&
- infoRec->SubsequentScreenToScreenCopy &&
- !xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COPY)) {
- HaveScreenToScreenCopy = TRUE;
- } else {
- infoRec->ScreenToScreenCopyFlags = 0;
- infoRec->SetupForScreenToScreenCopy = NULL;
- infoRec->SubsequentScreenToScreenCopy = NULL;
- }
-
- /**** Solid Filled Rects ****/
-
- if(infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect &&
- !xf86IsOptionSet(options, XAAOPT_SOLID_FILL_RECT)) {
- HaveSolidFillRect = TRUE;
- if(infoRec->SubsequentSolidFillTrap &&
- !xf86IsOptionSet(options, XAAOPT_SOLID_FILL_TRAP))
- HaveSolidFillTrap = TRUE;
- else
- infoRec->SubsequentSolidFillTrap = NULL;
- } else {
- infoRec->SolidFillFlags = 0;
- infoRec->SetupForSolidFill = NULL;
- infoRec->SubsequentSolidFillRect = NULL;
- infoRec->SubsequentSolidFillTrap = NULL;
- }
-
- /**** Solid lines ****/
-
- if(infoRec->SetupForSolidLine) {
- if(infoRec->SubsequentSolidTwoPointLine &&
- !xf86IsOptionSet(options, XAAOPT_SOLID_TWO_POINT_LINE))
- HaveSolidTwoPointLine = TRUE;
- if(infoRec->SubsequentSolidBresenhamLine &&
- !xf86IsOptionSet(options, XAAOPT_SOLID_BRESENHAM_LINE)) {
- HaveSolidBresenhamLine = TRUE;
-
- if(infoRec->SolidBresenhamLineErrorTermBits)
- infoRec->SolidBresenhamLineErrorTermBits =
- ~((1 << infoRec->SolidBresenhamLineErrorTermBits) - 1);
- }
-
- if(infoRec->SubsequentSolidHorVertLine &&
- !xf86IsOptionSet(options, XAAOPT_SOLID_HORVERT_LINE))
- HaveSolidHorVertLine = TRUE;
- else if(HaveSolidTwoPointLine) {
- infoRec->SubsequentSolidHorVertLine =
- XAASolidHorVertLineAsTwoPoint;
- HaveSolidHorVertLine = TRUE;
- } else if(HaveSolidBresenhamLine) {
- infoRec->SubsequentSolidHorVertLine =
- XAASolidHorVertLineAsBresenham;
- HaveSolidHorVertLine = TRUE;
- }
- }
-
- /* XXX Should this also check for XAAOPT_SOLID_HORVERT_LINE? */
- if (!HaveSolidTwoPointLine &&
- !HaveSolidBresenhamLine &&
- !HaveSolidHorVertLine &&
- HaveSolidFillRect) {
- infoRec->SetupForSolidLine = infoRec->SetupForSolidFill;
- infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsRects;
- infoRec->SolidLineFlags = infoRec->SolidFillFlags;
- HaveSolidHorVertLine = TRUE;
- }
-
- if (!HaveSolidTwoPointLine)
- infoRec->SubsequentSolidTwoPointLine = NULL;
- if (!HaveSolidBresenhamLine)
- infoRec->SubsequentSolidBresenhamLine = NULL;
- if (!HaveSolidHorVertLine)
- infoRec->SubsequentSolidHorVertLine = NULL;
-
- /* Disable all if nothing left over */
- if (!HaveSolidTwoPointLine &&
- !HaveSolidBresenhamLine &&
- !HaveSolidHorVertLine) {
- infoRec->SolidLineFlags = 0;
- infoRec->SetupForSolidLine = NULL;
- }
-
- /**** 8x8 Mono Pattern Filled Rects ****/
-
- if(infoRec->SetupForMono8x8PatternFill &&
- infoRec->SubsequentMono8x8PatternFillRect &&
- !xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_RECT)) {
- HaveMono8x8PatternFillRect = TRUE;
- if(infoRec->SubsequentMono8x8PatternFillTrap &&
- !xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_TRAP))
- HaveMono8x8PatternFillTrap = TRUE;
-
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- infoRec->CanDoMono8x8 = TRUE;
- } else { /* others require caching */
- int min_pitch;
- infoRec->PixmapCacheFlags |= CACHE_MONO_8x8;
-
- switch(pScrn->bitsPerPixel) {
- case 32: min_pitch = 2; break;
- case 24: min_pitch = 3; break;
- case 16: min_pitch = 4; break;
- default: min_pitch = 8; break;
- }
-
- if(min_pitch > infoRec->MonoPatternPitch)
- infoRec->MonoPatternPitch = min_pitch;
-
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
- if(!infoRec->CacheWidthMono8x8Pattern ||
- !infoRec->CacheHeightMono8x8Pattern) {
- infoRec->CacheWidthMono8x8Pattern =
- infoRec->MonoPatternPitch;
- infoRec->CacheHeightMono8x8Pattern = 1;
- }
- } else {
- int numPerLine = 128/infoRec->MonoPatternPitch;
-
- if(!infoRec->CacheWidthMono8x8Pattern ||
- !infoRec->CacheHeightMono8x8Pattern) {
- infoRec->CacheWidthMono8x8Pattern =
- numPerLine * infoRec->MonoPatternPitch;
- infoRec->CacheHeightMono8x8Pattern =
- (64 + numPerLine - 1)/numPerLine;
- }
- }
- }
- } else {
- infoRec->Mono8x8PatternFillFlags = 0;
- infoRec->SetupForMono8x8PatternFill = NULL;
- infoRec->SubsequentMono8x8PatternFillRect = NULL;
- }
-
- /**** Dashed lines ****/
-
- if(infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) {
- if(infoRec->SubsequentDashedTwoPointLine &&
- !xf86IsOptionSet(options, XAAOPT_DASHED_TWO_POINT_LINE))
- HaveDashedTwoPointLine = TRUE;
- if(infoRec->SubsequentDashedBresenhamLine &&
- !xf86IsOptionSet(options, XAAOPT_DASHED_BRESENHAM_LINE)) {
- HaveDashedBresenhamLine = TRUE;
-
- if(infoRec->DashedBresenhamLineErrorTermBits)
- infoRec->DashedBresenhamLineErrorTermBits =
- ~((1 << infoRec->DashedBresenhamLineErrorTermBits) - 1);
- }
- }
-
- if (!HaveDashedTwoPointLine)
- infoRec->SubsequentDashedTwoPointLine = NULL;
- if (!HaveDashedBresenhamLine)
- infoRec->SubsequentDashedBresenhamLine = NULL;
-
- /* Disable all if nothing left over */
- if (!HaveDashedTwoPointLine && !HaveDashedBresenhamLine) {
- infoRec->DashedLineFlags = 0;
- infoRec->SetupForDashedLine = NULL;
- }
-
- /**** 8x8 Color Pattern Filled Rects ****/
-
- if(infoRec->SetupForColor8x8PatternFill &&
- infoRec->SubsequentColor8x8PatternFillRect &&
- !xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT)) {
- HaveColor8x8PatternFillRect = TRUE;
- if(infoRec->SubsequentColor8x8PatternFillTrap &&
- !xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP))
- HaveColor8x8PatternFillTrap = TRUE;
- else
- infoRec->SubsequentColor8x8PatternFillTrap = NULL;
-
- infoRec->PixmapCacheFlags |= CACHE_COLOR_8x8;
-
- if(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
- if(!infoRec->CacheWidthColor8x8Pattern ||
- !infoRec->CacheHeightColor8x8Pattern) {
- infoRec->CacheWidthColor8x8Pattern = 64;
- infoRec->CacheHeightColor8x8Pattern = 1;
- }
- } else {
- if(!infoRec->CacheWidthColor8x8Pattern ||
- !infoRec->CacheHeightColor8x8Pattern) {
- infoRec->CacheWidthColor8x8Pattern = 128;
- infoRec->CacheHeightColor8x8Pattern = 8;
- }
- }
- } else {
- infoRec->Color8x8PatternFillFlags = 0;
- infoRec->SetupForColor8x8PatternFill = NULL;
- infoRec->SubsequentColor8x8PatternFillRect = NULL;
- infoRec->SubsequentColor8x8PatternFillTrap = NULL;
- }
-
- /**** Color Expansion ****/
-
- if(infoRec->SetupForCPUToScreenColorExpandFill &&
- infoRec->ColorExpandBase &&
- infoRec->SubsequentCPUToScreenColorExpandFill &&
- !xf86IsOptionSet(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL)) {
- int dwordsNeeded = pScrn->virtualX;
-
- infoRec->ColorExpandRange >>= 2; /* convert to DWORDS */
- HaveColorExpansion = TRUE;
-
- if(infoRec->CPUToScreenColorExpandFillFlags &
- LEFT_EDGE_CLIPPING_NEGATIVE_X)
- dwordsNeeded += 31;
- dwordsNeeded = (dwordsNeeded + 31) >> 5;
- if(dwordsNeeded > infoRec->ColorExpandRange)
- infoRec->CPUToScreenColorExpandFillFlags |= CPU_TRANSFER_BASE_FIXED;
- } else {
- infoRec->CPUToScreenColorExpandFillFlags = 0;
- infoRec->SetupForCPUToScreenColorExpandFill = NULL;
- infoRec->SubsequentCPUToScreenColorExpandFill = NULL;
- }
-
- /**** Scanline Color Expansion ****/
-
- if(infoRec->SetupForScanlineCPUToScreenColorExpandFill &&
- infoRec->SubsequentScanlineCPUToScreenColorExpandFill &&
- infoRec->SubsequentColorExpandScanline &&
- infoRec->ScanlineColorExpandBuffers &&
- (infoRec->NumScanlineColorExpandBuffers > 0) &&
- !xf86IsOptionSet(options, XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL)) {
- HaveScanlineColorExpansion = TRUE;
- } else {
- infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0;
- infoRec->SetupForScanlineCPUToScreenColorExpandFill = NULL;
- infoRec->SubsequentScanlineCPUToScreenColorExpandFill = NULL;
- infoRec->SubsequentColorExpandScanline = NULL;
- }
-
- /**** Screen to Screen Color Expansion ****/
-
- if(infoRec->SetupForScreenToScreenColorExpandFill &&
- infoRec->SubsequentScreenToScreenColorExpandFill &&
- !xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL)) {
- HaveScreenToScreenColorExpandFill = TRUE;
- if (!infoRec->CacheColorExpandDensity)
- infoRec->CacheColorExpandDensity = 1;
- } else {
- infoRec->ScreenToScreenColorExpandFillFlags = 0;
- infoRec->SetupForScreenToScreenColorExpandFill = NULL;
- infoRec->SubsequentScreenToScreenColorExpandFill = NULL;
- }
-
- /**** Image Writes ****/
-
- if(infoRec->SetupForImageWrite && infoRec->ImageWriteBase &&
- infoRec->SubsequentImageWriteRect &&
- !xf86IsOptionSet(options, XAAOPT_IMAGE_WRITE_RECT)) {
-
- infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */
- if(infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED)
- infoRec->ImageWriteRange = 0;
- HaveImageWriteRect = TRUE;
- } else {
- infoRec->ImageWriteFlags = 0;
- infoRec->SetupForImageWrite = NULL;
- infoRec->SubsequentImageWriteRect = NULL;
- }
-
- /**** Scanline Image Writes ****/
-
- if(infoRec->SetupForScanlineImageWrite &&
- infoRec->SubsequentScanlineImageWriteRect &&
- infoRec->SubsequentImageWriteScanline &&
- infoRec->ScanlineImageWriteBuffers &&
- (infoRec->NumScanlineImageWriteBuffers > 0) &&
- !xf86IsOptionSet(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT)) {
- HaveScanlineImageWriteRect = TRUE;
- } else {
- infoRec->ScanlineImageWriteFlags = 0;
- infoRec->SetupForScanlineImageWrite = NULL;
- infoRec->SubsequentScanlineImageWriteRect = NULL;
- infoRec->SubsequentImageWriteScanline = NULL;
- }
-
-#ifndef __i386__
- /* XAA makes some unaligned accesses when clipping is not available */
-# define CLIP_FLAGS (LEFT_EDGE_CLIPPING | LEFT_EDGE_CLIPPING_NEGATIVE_X)
- if(HaveImageWriteRect &&
- ((infoRec->ImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS))
- {
- HaveImageWriteRect = FALSE;
- }
- if(HaveScanlineImageWriteRect &&
- ((infoRec->ScanlineImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS))
- {
- HaveScanlineImageWriteRect = FALSE;
- }
-#endif
-
- if (serverGeneration == 1) {
- if(HaveScreenToScreenCopy)
- xf86ErrorF("\tScreen to screen bit blits\n");
- if(HaveSolidFillRect)
- xf86ErrorF("\tSolid filled rectangles\n");
- if(HaveSolidFillTrap)
- xf86ErrorF("\tSolid filled trapezoids\n");
- if(HaveMono8x8PatternFillRect)
- xf86ErrorF("\t8x8 mono pattern filled rectangles\n");
- if(HaveMono8x8PatternFillTrap)
- xf86ErrorF("\t8x8 mono pattern filled trapezoids\n");
- if(HaveColor8x8PatternFillRect)
- xf86ErrorF("\t8x8 color pattern filled rectangles\n");
- if(HaveColor8x8PatternFillTrap)
- xf86ErrorF("\t8x8 color pattern filled trapezoids\n");
-
- if(HaveColorExpansion)
- xf86ErrorF("\tCPU to Screen color expansion\n");
- else if(HaveScanlineColorExpansion)
- xf86ErrorF("\tIndirect CPU to Screen color expansion\n");
-
- if(HaveScreenToScreenColorExpandFill)
- xf86ErrorF("\tScreen to Screen color expansion\n");
-
- if(HaveSolidTwoPointLine || HaveSolidBresenhamLine)
- xf86ErrorF("\tSolid Lines\n");
- else if(HaveSolidHorVertLine)
- xf86ErrorF("\tSolid Horizontal and Vertical Lines\n");
-
- if(HaveDashedTwoPointLine || HaveDashedBresenhamLine)
- xf86ErrorF("\tDashed Lines\n");
-
- if(HaveImageWriteRect)
- xf86ErrorF("\tImage Writes\n");
- else if(HaveScanlineImageWriteRect)
- xf86ErrorF("\tScanline Image Writes\n");
-
- }
-
-#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0)
-
- if((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy &&
- !xf86IsOptionSet(options, XAAOPT_OFFSCREEN_PIXMAPS)) {
- XAAMSG("\tOffscreen Pixmaps\n");
- } else {
- infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
- }
-
-
- /************** Mid Level *************/
-
- /**** ScreenToScreenBitBlt ****/
-
- if(infoRec->ScreenToScreenBitBlt) {
- XAAMSG("\tDriver provided ScreenToScreenBitBlt replacement\n");
- } else if(HaveScreenToScreenCopy) {
- infoRec->ScreenToScreenBitBlt = XAAScreenToScreenBitBlt;
- infoRec->ScreenToScreenBitBltFlags = infoRec->ScreenToScreenCopyFlags;
- }
-
- /**** FillSolidRects ****/
-
- if(infoRec->FillSolidRects) {
- XAAMSG("\tDriver provided FillSolidRects replacement\n");
- } else if(HaveSolidFillRect) {
- infoRec->FillSolidRects = XAAFillSolidRects;
- infoRec->FillSolidRectsFlags = infoRec->SolidFillFlags;
- }
-
- /**** FillSolidSpans ****/
-
- if(infoRec->FillSolidSpans) {
- XAAMSG("\tDriver provided FillSolidSpans replacement\n");
- } else if(HaveSolidFillRect) {
- infoRec->FillSolidSpans = XAAFillSolidSpans;
- infoRec->FillSolidSpansFlags = infoRec->SolidFillFlags;
- }
-
- /**** FillMono8x8PatternRects ****/
-
- if(infoRec->FillMono8x8PatternRects) {
- XAAMSG("\tDriver provided FillMono8x8PatternRects replacement\n");
- } else if(HaveMono8x8PatternFillRect) {
- infoRec->FillMono8x8PatternRects =
- (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
- XAAFillMono8x8PatternRectsScreenOrigin :
- XAAFillMono8x8PatternRects;
-
- infoRec->FillMono8x8PatternRectsFlags =
- infoRec->Mono8x8PatternFillFlags;
- }
-
- /**** FillMono8x8PatternSpans ****/
-
- if(infoRec->FillMono8x8PatternSpans) {
- XAAMSG("\tDriver provided FillMono8x8PatternSpans replacement\n");
- } else if(HaveMono8x8PatternFillRect) {
- infoRec->FillMono8x8PatternSpans =
- (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
- XAAFillMono8x8PatternSpansScreenOrigin:
- XAAFillMono8x8PatternSpans;
-
- infoRec->FillMono8x8PatternSpansFlags =
- infoRec->Mono8x8PatternFillFlags;
- }
-
- /**** FillColor8x8Rects ****/
-
- if(infoRec->FillColor8x8PatternRects) {
- XAAMSG("\tDriver provided FillColor8x8PatternRects replacement\n");
- } else if(HaveColor8x8PatternFillRect) {
- infoRec->FillColor8x8PatternRects =
- (infoRec->Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
- XAAFillColor8x8PatternRectsScreenOrigin :
- XAAFillColor8x8PatternRects;
-
- infoRec->FillColor8x8PatternRectsFlags =
- infoRec->Color8x8PatternFillFlags;
- }
-
- /**** FillColor8x8Spans ****/
-
- if(infoRec->FillColor8x8PatternSpans) {
- XAAMSG("\tDriver provided FillColor8x8PatternSpans replacement\n");
- } else if(HaveColor8x8PatternFillRect) {
- infoRec->FillColor8x8PatternSpans =
- (infoRec->Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
- XAAFillColor8x8PatternSpansScreenOrigin:
- XAAFillColor8x8PatternSpans;
-
- infoRec->FillColor8x8PatternSpansFlags =
- infoRec->Color8x8PatternFillFlags;
- }
-
- /**** FillCacheBltRects ****/
-
- if(infoRec->FillCacheBltRects) {
- XAAMSG("\tDriver provided FillCacheBltRects replacement\n");
- } else if(HaveScreenToScreenCopy) {
- infoRec->FillCacheBltRects = XAAFillCacheBltRects;
- infoRec->FillCacheBltRectsFlags = infoRec->ScreenToScreenCopyFlags;
- }
-
- /**** FillCacheBltSpans ****/
-
- if(infoRec->FillCacheBltSpans) {
- XAAMSG("\tDriver provided FillCacheBltSpans replacement\n");
- } else if(HaveScreenToScreenCopy) {
- infoRec->FillCacheBltSpans = XAAFillCacheBltSpans;
- infoRec->FillCacheBltSpansFlags = infoRec->ScreenToScreenCopyFlags;
- }
-
- /**** FillCacheExpandRects ****/
-
- if(infoRec->FillCacheExpandRects) {
- XAAMSG("\tDriver provided FillCacheExpandRects replacement\n");
- } else if(HaveScreenToScreenColorExpandFill) {
- infoRec->FillCacheExpandRects = XAAFillCacheExpandRects;
- infoRec->FillCacheExpandRectsFlags =
- infoRec->ScreenToScreenColorExpandFillFlags;
- }
-
- /**** FillCacheExpandSpans ****/
-
- if(infoRec->FillCacheExpandSpans) {
- XAAMSG("\tDriver provided FillCacheExpandSpans replacement\n");
- } else if(HaveScreenToScreenColorExpandFill) {
- infoRec->FillCacheExpandSpans = XAAFillCacheExpandSpans;
- infoRec->FillCacheExpandSpansFlags =
- infoRec->ScreenToScreenColorExpandFillFlags;
- }
-
- /**** FillColorExpandRects ****/
-
- if(infoRec->FillColorExpandRects) {
- XAAMSG("\tDriver provided FillColorExpandRects replacement\n");
- } else if(HaveColorExpansion) {
- if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRects3MSBFirstFixedBase;
- else
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRects3MSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRects3LSBFirstFixedBase;
- else
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRects3LSBFirst;
- }
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRectsMSBFirstFixedBase;
- else
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRectsMSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRectsLSBFirstFixedBase;
- else
- infoRec->FillColorExpandRects =
- XAAFillColorExpandRectsLSBFirst;
- }
- }
- infoRec->FillColorExpandRectsFlags =
- infoRec->CPUToScreenColorExpandFillFlags;
- } else if(HaveScanlineColorExpansion) {
- if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- TRIPLE_BITS_24BPP) {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->FillColorExpandRects =
- XAAFillScanlineColorExpandRects3MSBFirst;
- else
- infoRec->FillColorExpandRects =
- XAAFillScanlineColorExpandRects3LSBFirst;
- } else {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->FillColorExpandRects =
- XAAFillScanlineColorExpandRectsMSBFirst;
- else
- infoRec->FillColorExpandRects =
- XAAFillScanlineColorExpandRectsLSBFirst;
- }
- infoRec->FillColorExpandRectsFlags =
- infoRec->ScanlineCPUToScreenColorExpandFillFlags;
- }
-
- /**** FillColorExpandSpans ****/
-
- if(infoRec->FillColorExpandSpans) {
- XAAMSG("\tDriver provided FillColorExpandSpans replacement\n");
- } else if(HaveColorExpansion) {
- if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpans3MSBFirstFixedBase;
- else
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpans3MSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpans3LSBFirstFixedBase;
- else
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpans3LSBFirst;
- }
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpansMSBFirstFixedBase;
- else
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpansMSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpansLSBFirstFixedBase;
- else
- infoRec->FillColorExpandSpans =
- XAAFillColorExpandSpansLSBFirst;
- }
- }
- infoRec->FillColorExpandSpansFlags =
- infoRec->CPUToScreenColorExpandFillFlags;
- } else if(HaveScanlineColorExpansion) {
- if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- TRIPLE_BITS_24BPP) {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->FillColorExpandSpans =
- XAAFillScanlineColorExpandSpans3MSBFirst;
- else
- infoRec->FillColorExpandSpans =
- XAAFillScanlineColorExpandSpans3LSBFirst;
- } else {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->FillColorExpandSpans =
- XAAFillScanlineColorExpandSpansMSBFirst;
- else
- infoRec->FillColorExpandSpans =
- XAAFillScanlineColorExpandSpansLSBFirst;
- }
- infoRec->FillColorExpandSpansFlags =
- infoRec->ScanlineCPUToScreenColorExpandFillFlags;
- }
-
- /**** FillImageWriteRects ****/
-
- if(infoRec->FillImageWriteRects) {
- XAAMSG("\tDriver provided FillImageWriteRects replacement\n");
- } else if(HaveImageWriteRect &&
- (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
- (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
- infoRec->FillImageWriteRects = XAAFillImageWriteRects;
- infoRec->FillImageWriteRectsFlags = infoRec->ImageWriteFlags;
- }
-
- /**** WriteBitmap ****/
-
- if(infoRec->WriteBitmap &&
- !xf86IsOptionSet(options, XAAOPT_WRITE_BITMAP)) {
- XAAMSG("\tDriver provided WriteBitmap replacement\n");
- } else if(HaveColorExpansion) {
- if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->WriteBitmap =
- XAAWriteBitmapColorExpand3MSBFirstFixedBase;
- else
- infoRec->WriteBitmap = XAAWriteBitmapColorExpand3MSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->WriteBitmap =
- XAAWriteBitmapColorExpand3LSBFirstFixedBase;
- else
- infoRec->WriteBitmap = XAAWriteBitmapColorExpand3LSBFirst;
- }
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST) {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->WriteBitmap =
- XAAWriteBitmapColorExpandMSBFirstFixedBase;
- else
- infoRec->WriteBitmap = XAAWriteBitmapColorExpandMSBFirst;
- } else {
- if(infoRec->CPUToScreenColorExpandFillFlags &
- CPU_TRANSFER_BASE_FIXED)
- infoRec->WriteBitmap =
- XAAWriteBitmapColorExpandLSBFirstFixedBase;
- else
- infoRec->WriteBitmap = XAAWriteBitmapColorExpandLSBFirst;
- }
- }
- infoRec->WriteBitmapFlags = infoRec->CPUToScreenColorExpandFillFlags;
- } else if(HaveScanlineColorExpansion) {
- if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- TRIPLE_BITS_24BPP) {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->WriteBitmap =
- XAAWriteBitmapScanlineColorExpand3MSBFirst;
- else
- infoRec->WriteBitmap =
- XAAWriteBitmapScanlineColorExpand3LSBFirst;
- } else {
- if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->WriteBitmap =
- XAAWriteBitmapScanlineColorExpandMSBFirst;
- else
- infoRec->WriteBitmap =
- XAAWriteBitmapScanlineColorExpandLSBFirst;
- }
- infoRec->WriteBitmapFlags =
- infoRec->ScanlineCPUToScreenColorExpandFillFlags;
- } else
- infoRec->WriteBitmap = NULL;
-
- /**** TE Glyphs ****/
-
- if (infoRec->TEGlyphRenderer) {
- XAAMSG("\tDriver provided TEGlyphRenderer replacement\n");
- } else if (HaveColorExpansion) {
- infoRec->TEGlyphRendererFlags =
- infoRec->CPUToScreenColorExpandFillFlags;
-
- if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
- if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
- if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
- infoRec->TEGlyphRenderer =
- XAATEGlyphRenderer3MSBFirstFixedBase;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRenderer3MSBFirst;
- } else {
- if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
- infoRec->TEGlyphRenderer =
- XAATEGlyphRenderer3LSBFirstFixedBase;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRenderer3LSBFirst;
- }
-
- if (!HaveSolidFillRect &&
- (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
- infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
- XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL"
- " without solid fills\n");
- }
- } else {
- if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
- if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
- infoRec->TEGlyphRenderer =
- XAATEGlyphRendererMSBFirstFixedBase;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRendererMSBFirst;
- } else {
- if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
- infoRec->TEGlyphRenderer =
- XAATEGlyphRendererLSBFirstFixedBase;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRendererLSBFirst;
- }
- }
-
- if (!HaveSolidFillRect &&
- (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
- infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
- XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY"
- " without solid fills\n");
- }
-
- } else if (HaveScanlineColorExpansion) {
- infoRec->TEGlyphRendererFlags =
- infoRec->ScanlineCPUToScreenColorExpandFillFlags;
-
- if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
- if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3MSBFirst;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3LSBFirst;
-
- if (!HaveSolidFillRect &&
- (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
- infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
- XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL"
- " without solid fills\n");
- }
- } else {
- if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
- infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineMSBFirst;
- else
- infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineLSBFirst;
- }
-
- if (!HaveSolidFillRect &&
- (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
- infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
- XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY"
- " without solid fills\n");
- }
- }
-
- /**** NonTE Glyphs ****/
-
- if(infoRec->NonTEGlyphRenderer) {
- XAAMSG("\tDriver provided NonTEGlyphRenderer replacement\n");
- } else if(infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
- infoRec->NonTEGlyphRenderer = XAANonTEGlyphRenderer;
- infoRec->NonTEGlyphRendererFlags = infoRec->WriteBitmapFlags;
- }
-
- /**** WritePixmap ****/
-
- if(infoRec->WritePixmap &&
- !xf86IsOptionSet(options, XAAOPT_WRITE_PIXMAP)) {
- XAAMSG("\tDriver provided WritePixmap replacement\n");
- } else if(HaveImageWriteRect) {
- infoRec->WritePixmap = XAAWritePixmap;
- infoRec->WritePixmapFlags =
- infoRec->ImageWriteFlags | CONVERT_32BPP_TO_24BPP;
- } else if(HaveScanlineImageWriteRect) {
- infoRec->WritePixmap = XAAWritePixmapScanline;
- infoRec->WritePixmapFlags = infoRec->ScanlineImageWriteFlags;
- } else
- infoRec->WritePixmap = NULL;
-
- /**** ReadPixmap ****/
-
- if(infoRec->ReadPixmap) {
- XAAMSG("\tDriver provided ReadPixmap replacement\n");
- }
-
-
- /************** GC Level *************/
-
- /**** CopyArea ****/
-
- if(infoRec->CopyArea) {
- XAAMSG("\tDriver provided GC level CopyArea replacement\n");
- } else if(infoRec->ScreenToScreenBitBlt) {
- infoRec->CopyArea = XAACopyArea;
- infoRec->CopyAreaFlags = infoRec->ScreenToScreenBitBltFlags;
-
- /* most GC level primitives use one mid-level primitive so
- the GC level primitive gets the mid-level primitive flag
- and we use that at GC validation time. But CopyArea uses
- more than one mid-level primitive so we have to essentially
- do a GC validation every time that primitive is used.
- The CopyAreaFlags would only be used for filtering out the
- common denominators. Here we assume that if you don't do
- ScreenToScreenBitBlt you aren't going to do the others.
- We also assume that ScreenToScreenBitBlt has the least
- restrictions. */
- }
-
- if(infoRec->CopyPlane) {
- XAAMSG("\tDriver provided GC level CopyPlane replacement\n");
- } else if(infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) {
- infoRec->CopyPlane = XAACopyPlaneColorExpansion;
- infoRec->CopyPlaneFlags = infoRec->WriteBitmapFlags;
- }
-
- if(infoRec->PushPixelsSolid) {
- XAAMSG("\tDriver provided GC level PushPixelsSolid replacement\n");
- } else if(infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
- infoRec->PushPixelsSolid = XAAPushPixelsSolidColorExpansion;
- infoRec->PushPixelsFlags = infoRec->WriteBitmapFlags;
- }
-
- if(infoRec->FillSolidRects) {
- if(!infoRec->PolyFillRectSolid) {
- infoRec->PolyFillRectSolid = XAAPolyFillRect;
- infoRec->PolyFillRectSolidFlags = infoRec->FillSolidRectsFlags;
- }
- }
- if(infoRec->FillSolidSpans) {
- if(!infoRec->FillSpansSolid) {
- infoRec->FillSpansSolid = XAAFillSpans;
- infoRec->FillSpansSolidFlags = infoRec->FillSolidSpansFlags;
- }
- }
-
- if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
- infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
- infoRec->FillCacheExpandRects) {
- if(!infoRec->PolyFillRectStippled) {
-
- infoRec->PolyFillRectStippled = XAAPolyFillRect;
- infoRec->PolyFillRectStippledFlags = 0;
- }
- }
-
- if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
- infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
- infoRec->FillCacheExpandSpans) {
- if(!infoRec->FillSpansStippled) {
-
- infoRec->FillSpansStippled = XAAFillSpans;
- infoRec->FillSpansStippledFlags = 0;
- }
- }
-
- if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
- infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
- infoRec->FillCacheExpandRects) {
- if(!infoRec->PolyFillRectOpaqueStippled) {
-
- infoRec->PolyFillRectOpaqueStippled = XAAPolyFillRect;
- infoRec->PolyFillRectOpaqueStippledFlags = 0;
- }
- }
-
- if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
- infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
- infoRec->FillCacheExpandSpans) {
- if(!infoRec->FillSpansOpaqueStippled) {
-
- infoRec->FillSpansOpaqueStippled = XAAFillSpans;
- infoRec->FillSpansOpaqueStippledFlags = 0;
- }
- }
-
- if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
- infoRec->FillCacheBltRects || infoRec->FillImageWriteRects) {
- if(!infoRec->PolyFillRectTiled) {
-
- infoRec->PolyFillRectTiled = XAAPolyFillRect;
- infoRec->PolyFillRectTiledFlags = 0;
- }
- }
-
- if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
- infoRec->FillCacheBltSpans) {
- if(!infoRec->FillSpansTiled) {
-
- infoRec->FillSpansTiled = XAAFillSpans;
- infoRec->FillSpansTiledFlags = 0;
- }
- }
-
- if(infoRec->TEGlyphRenderer &&
- !(infoRec->TEGlyphRendererFlags & NO_TRANSPARENCY)) {
-
- if(!infoRec->PolyText8TE) {
- infoRec->PolyText8TE = XAAPolyText8TEColorExpansion;
- infoRec->PolyText8TEFlags = infoRec->TEGlyphRendererFlags;
- }
-
- if(!infoRec->PolyText16TE) {
- infoRec->PolyText16TE = XAAPolyText16TEColorExpansion;
- infoRec->PolyText16TEFlags = infoRec->TEGlyphRendererFlags;
- }
-
- if(!infoRec->PolyGlyphBltTE) {
- infoRec->PolyGlyphBltTE = XAAPolyGlyphBltTEColorExpansion;
- infoRec->PolyGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
- }
- }
-
- if(infoRec->TEGlyphRenderer &&
- !(infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
-
- if(!infoRec->ImageText8TE) {
- infoRec->ImageText8TE = XAAImageText8TEColorExpansion;
- infoRec->ImageText8TEFlags = infoRec->TEGlyphRendererFlags;
- }
-
- if(!infoRec->ImageText16TE) {
- infoRec->ImageText16TE = XAAImageText16TEColorExpansion;
- infoRec->ImageText16TEFlags = infoRec->TEGlyphRendererFlags;
- }
-
- if(!infoRec->ImageGlyphBltTE) {
- infoRec->ImageGlyphBltTE = XAAImageGlyphBltTEColorExpansion;
- infoRec->ImageGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
- }
- }
-
- if(infoRec->NonTEGlyphRenderer) {
- if(!infoRec->PolyText8NonTE) {
- infoRec->PolyText8NonTE = XAAPolyText8NonTEColorExpansion;
- infoRec->PolyText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
-
- if(!infoRec->PolyText16NonTE) {
- infoRec->PolyText16NonTE = XAAPolyText16NonTEColorExpansion;
- infoRec->PolyText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
- if(!infoRec->PolyGlyphBltNonTE) {
- infoRec->PolyGlyphBltNonTE = XAAPolyGlyphBltNonTEColorExpansion;
- infoRec->PolyGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
- }
-
- if(infoRec->NonTEGlyphRenderer && HaveSolidFillRect) {
- if(!infoRec->ImageText8NonTE) {
- infoRec->ImageText8NonTE = XAAImageText8NonTEColorExpansion;
- infoRec->ImageText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
-
- if(!infoRec->ImageText16NonTE) {
- infoRec->ImageText16NonTE = XAAImageText16NonTEColorExpansion;
- infoRec->ImageText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
-
- if(!infoRec->ImageGlyphBltNonTE) {
- infoRec->ImageGlyphBltNonTE = XAAImageGlyphBltNonTEColorExpansion;
- infoRec->ImageGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
- }
- }
-
- if(!infoRec->PolyRectangleThinSolid && HaveSolidHorVertLine) {
- infoRec->PolyRectangleThinSolid = XAAPolyRectangleThinSolid;
- infoRec->PolyRectangleThinSolidFlags = infoRec->SolidLineFlags;
- }
-
- if(!infoRec->FillPolygonSolid && HaveSolidFillRect) {
- infoRec->FillPolygonSolid = XAAFillPolygonSolid;
- infoRec->FillPolygonSolidFlags = infoRec->SolidFillFlags;
- }
-
- if(!infoRec->FillPolygonStippled && (HaveMono8x8PatternFillRect ||
- HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
- infoRec->FillPolygonStippled = XAAFillPolygonStippled;
- infoRec->FillPolygonStippledFlags = infoRec->SolidFillFlags;
- }
-
- if(!infoRec->FillPolygonOpaqueStippled && (HaveMono8x8PatternFillRect ||
- HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
- infoRec->FillPolygonOpaqueStippled = XAAFillPolygonStippled;
- infoRec->FillPolygonOpaqueStippledFlags = infoRec->SolidFillFlags;
- }
-
- if(!infoRec->FillPolygonTiled && (HaveMono8x8PatternFillRect ||
- HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
- infoRec->FillPolygonTiled = XAAFillPolygonTiled;
- infoRec->FillPolygonTiledFlags = infoRec->SolidFillFlags;
- }
-
-
- if(!infoRec->PolyFillArcSolid && HaveSolidFillRect) {
- infoRec->PolyFillArcSolid = XAAPolyFillArcSolid;
- infoRec->PolyFillArcSolidFlags = infoRec->SolidFillFlags;
- }
-
- if(!infoRec->PolylinesWideSolid && HaveSolidFillRect) {
- infoRec->PolylinesWideSolid = XAAPolylinesWideSolid;
- infoRec->PolylinesWideSolidFlags =
- infoRec->SolidFillFlags | GXCOPY_ONLY;
- }
-
- if(!infoRec->PutImage && (infoRec->WritePixmap ||
- (infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)))) {
- infoRec->PutImage = XAAPutImage;
-
- /* See comment for CopyArea above. But here we make fewer
- assumptions. The driver can provide the PutImageFlags if
- it wants too */
- }
-
- if(HaveSolidHorVertLine &&
- (HaveSolidBresenhamLine || (HaveSolidTwoPointLine &&
- (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE)))){
- if(!infoRec->PolylinesThinSolid) {
- infoRec->PolylinesThinSolid = XAAPolyLines;
- infoRec->PolylinesThinSolidFlags = infoRec->SolidLineFlags;
- }
- if(!infoRec->PolySegmentThinSolid) {
- infoRec->PolySegmentThinSolid = XAAPolySegment;
- infoRec->PolySegmentThinSolidFlags = infoRec->SolidLineFlags;
- }
- }
-
- if(HaveDashedBresenhamLine || (HaveDashedTwoPointLine &&
- (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE))){
- if(!infoRec->PolylinesThinDashed) {
- infoRec->PolylinesThinDashed = XAAPolyLinesDashed;
- infoRec->PolylinesThinDashedFlags = infoRec->DashedLineFlags;
- }
- if(!infoRec->PolySegmentThinDashed) {
- infoRec->PolySegmentThinDashed = XAAPolySegmentDashed;
- infoRec->PolySegmentThinDashedFlags = infoRec->DashedLineFlags;
- }
- }
-
- if(infoRec->PolylinesThinDashed || infoRec->PolySegmentThinDashed) {
- if(!infoRec->ComputeDash)
- infoRec->ComputeDash = XAAComputeDash;
- }
-
-#ifdef RENDER
- {
- Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
- infoRec->SetupForCPUToScreenTexture &&
- infoRec->SubsequentCPUToScreenTexture;
- Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
- infoRec->SetupForCPUToScreenAlphaTexture &&
- infoRec->SubsequentCPUToScreenAlphaTexture;
-
- if(!infoRec->Composite && (haveTexture || haveAlphaTexture))
- infoRec->Composite = XAADoComposite;
-
- if(!infoRec->Glyphs && infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
- {
- infoRec->Glyphs = XAADoGlyphs;
- }
- }
-#endif
-
- /************ Validation Functions **************/
-
- if(!infoRec->ValidateCopyArea && infoRec->CopyArea) {
- infoRec->CopyAreaMask = GCWhenForced;
- if((infoRec->CopyAreaFlags & GXCOPY_ONLY) ||
- (infoRec->CopyAreaFlags & ROP_NEEDS_SOURCE))
- infoRec->CopyAreaMask |= GCFunction;
- if(infoRec->CopyAreaFlags & NO_PLANEMASK)
- infoRec->CopyAreaMask |= GCPlaneMask;
- infoRec->ValidateCopyArea = XAAValidateCopyArea;
- }
-
- if(!infoRec->ValidateCopyPlane && infoRec->CopyPlane) {
- infoRec->CopyPlaneMask = GCWhenForced;
- if((infoRec->CopyPlaneFlags & GXCOPY_ONLY) ||
- (infoRec->CopyPlaneFlags & ROP_NEEDS_SOURCE))
- infoRec->CopyPlaneMask |= GCFunction;
- if(infoRec->CopyPlaneFlags & NO_PLANEMASK)
- infoRec->CopyPlaneMask |= GCPlaneMask;
- if(infoRec->CopyPlaneFlags & RGB_EQUAL)
- infoRec->CopyPlaneMask |= GCForeground | GCBackground;
- infoRec->ValidateCopyPlane = XAAValidateCopyPlane;
- }
-
- if(!infoRec->ValidatePutImage && infoRec->PutImage) {
- infoRec->PutImageMask = GCWhenForced;
- if((infoRec->PutImageFlags & GXCOPY_ONLY) ||
- (infoRec->PutImageFlags & ROP_NEEDS_SOURCE))
- infoRec->PutImageMask |= GCFunction;
- if(infoRec->PutImageFlags & NO_PLANEMASK)
- infoRec->PutImageMask |= GCPlaneMask;
- if(infoRec->PutImageFlags & RGB_EQUAL)
- infoRec->PutImageMask |= GCForeground | GCBackground;
- infoRec->ValidatePutImage = XAAValidatePutImage;
- }
-
-
- if(!infoRec->ValidatePushPixels && infoRec->PushPixelsSolid) {
- infoRec->PushPixelsMask = GCFillStyle;
- if((infoRec->PushPixelsFlags & GXCOPY_ONLY) ||
- (infoRec->PushPixelsFlags & ROP_NEEDS_SOURCE) ||
- (infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY))
- infoRec->PushPixelsMask |= GCFunction;
- if(infoRec->PushPixelsFlags & NO_PLANEMASK)
- infoRec->PushPixelsMask |= GCPlaneMask;
- if(infoRec->PushPixelsFlags & RGB_EQUAL)
- infoRec->PushPixelsMask |= GCForeground;
- infoRec->ValidatePushPixels = XAAValidatePushPixels;
- }
-
- /* By default XAA assumes the FillSpans, PolyFillRects, FillPolygon
- and PolyFillArcs have the same restrictions. If you supply GC
- level replacements for any of these and alter this relationship
- you may need to supply replacement validation routines */
-
- if(!infoRec->ValidateFillSpans &&
- (infoRec->FillSpansSolid || infoRec->FillSpansStippled ||
- infoRec->FillSpansOpaqueStippled || infoRec->FillSpansTiled)) {
-
- int compositeFlags = infoRec->FillSpansSolidFlags |
- infoRec->FillSpansStippledFlags |
- infoRec->FillSpansOpaqueStippledFlags |
- infoRec->FillSpansTiledFlags;
-
- infoRec->FillSpansMask = GCFillStyle | GCTile | GCStipple;
-
- if((compositeFlags & GXCOPY_ONLY) ||
- (compositeFlags & ROP_NEEDS_SOURCE))
- infoRec->FillSpansMask |= GCFunction;
- if(compositeFlags & NO_PLANEMASK)
- infoRec->FillSpansMask |= GCPlaneMask;
- if(compositeFlags & RGB_EQUAL)
- infoRec->FillSpansMask |= GCForeground;
- infoRec->ValidateFillSpans = XAAValidateFillSpans;
- }
-
- /* By default XAA only provides Validations for the GlyphBlt
- functions and not the text higher up. This is because the
- Text8/16 and GlyphBlt are linked. If you break this linkage,
- you may need to have the driver supply its own Validation
- routines */
-
- if(!infoRec->ValidatePolyGlyphBlt &&
- (infoRec->PolyGlyphBltTE || infoRec->PolyGlyphBltNonTE)) {
- int compositeFlags = infoRec->PolyGlyphBltTEFlags |
- infoRec->PolyGlyphBltNonTEFlags;
-
- infoRec->PolyGlyphBltMask = GCFillStyle | GCFont;
- if((compositeFlags & GXCOPY_ONLY) ||
- (compositeFlags & ROP_NEEDS_SOURCE) ||
- (infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY))
- infoRec->PolyGlyphBltMask |= GCFunction;
- if(compositeFlags & NO_PLANEMASK)
- infoRec->PolyGlyphBltMask |= GCPlaneMask;
- if(compositeFlags & RGB_EQUAL)
- infoRec->PolyGlyphBltMask |= GCForeground;
- infoRec->ValidatePolyGlyphBlt = XAAValidatePolyGlyphBlt;
- }
-
- if(!infoRec->ValidateImageGlyphBlt &&
- (infoRec->ImageGlyphBltTE || infoRec->ImageGlyphBltNonTE)) {
- int compositeFlags = infoRec->ImageGlyphBltTEFlags |
- infoRec->ImageGlyphBltNonTEFlags;
-
- if(infoRec->ImageGlyphBltNonTE)
- compositeFlags |= infoRec->SolidFillFlags;
-
- infoRec->ImageGlyphBltMask = GCFont;
- if(compositeFlags & NO_PLANEMASK)
- infoRec->ImageGlyphBltMask |= GCPlaneMask;
- if(compositeFlags & RGB_EQUAL)
- infoRec->ImageGlyphBltMask |= GCForeground | GCBackground;
- infoRec->ValidateImageGlyphBlt = XAAValidateImageGlyphBlt;
- }
-
- /* By default XAA only provides a Validation function for the
- Polylines and does segments and polylines at the same time */
-
- if(!infoRec->ValidatePolylines && infoRec->ValidateFillSpans) {
- int compositeFlags = infoRec->PolyRectangleThinSolidFlags |
- infoRec->PolylinesWideSolidFlags |
- infoRec->PolylinesThinSolidFlags |
- infoRec->PolySegmentThinSolidFlags |
- infoRec->PolySegmentThinDashedFlags |
- infoRec->PolylinesThinDashedFlags;
-
- infoRec->ValidatePolylines = XAAValidatePolylines;
- infoRec->PolylinesMask =
- infoRec->FillSpansMask | GCLineStyle | GCLineWidth;
-
- if(infoRec->PolySegmentThinDashed || infoRec->PolylinesThinDashed)
- infoRec->PolylinesMask |= GCDashList;
- if(compositeFlags & NO_PLANEMASK)
- infoRec->PolylinesMask |= GCPlaneMask;
- if((compositeFlags & GXCOPY_ONLY) ||
- (compositeFlags & ROP_NEEDS_SOURCE))
- infoRec->PolylinesMask |= GCFunction;
- if(compositeFlags & RGB_EQUAL)
- infoRec->PolylinesMask |= GCForeground;
- }
-
-
- /**** Fill choosers ****/
-
- if(!infoRec->StippledFillChooser)
- infoRec->StippledFillChooser = XAAStippledFillChooser;
-
- if(!infoRec->OpaqueStippledFillChooser)
- infoRec->OpaqueStippledFillChooser = XAAOpaqueStippledFillChooser;
-
- if(!infoRec->TiledFillChooser)
- infoRec->TiledFillChooser = XAATiledFillChooser;
-
-
- /**** Setup the pixmap cache ****/
-
- if(infoRec->WriteBitmapToCache) {}
- else if(infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))
- infoRec->WriteBitmapToCache = XAAWriteBitmapToCache;
- else if(infoRec->Flags & LINEAR_FRAMEBUFFER)
- infoRec->WriteBitmapToCache = XAAWriteBitmapToCacheLinear;
- else
- infoRec->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES;
-
- if(infoRec->WritePixmapToCache) {}
- else if(infoRec->WritePixmap && !(infoRec->WritePixmapFlags & NO_GXCOPY))
- infoRec->WritePixmapToCache = XAAWritePixmapToCache;
- else if(infoRec->Flags & LINEAR_FRAMEBUFFER)
- infoRec->WritePixmapToCache = XAAWritePixmapToCacheLinear;
- else
- infoRec->Flags &= ~PIXMAP_CACHE;
-
- if (xf86IsOptionSet(options, XAAOPT_PIXMAP_CACHE))
- infoRec->Flags &= ~PIXMAP_CACHE;
-
- if(infoRec->WriteMono8x8PatternToCache) {}
- else if(infoRec->PixmapCacheFlags & CACHE_MONO_8x8) {
- if(infoRec->WritePixmapToCache)
- infoRec->WriteMono8x8PatternToCache = XAAWriteMono8x8PatternToCache;
- else
- infoRec->PixmapCacheFlags &= ~CACHE_MONO_8x8;
- }
-
- if(infoRec->WriteColor8x8PatternToCache) {}
- else if(infoRec->PixmapCacheFlags & CACHE_COLOR_8x8) {
- if(infoRec->WritePixmapToCache && infoRec->WriteBitmapToCache)
- infoRec->WriteColor8x8PatternToCache = XAAWriteColor8x8PatternToCache;
- else
- infoRec->PixmapCacheFlags &= ~CACHE_COLOR_8x8;
- }
-
- if(infoRec->CachePixelGranularity < 0) {
- switch(pScrn->bitsPerPixel) {
- case 24:
- case 8: infoRec->CachePixelGranularity = 4; break;
- case 16: infoRec->CachePixelGranularity = 2; break;
- case 32: infoRec->CachePixelGranularity = 1; break;
- default: break;
- }
-
- if(BITMAP_SCANLINE_PAD == 64)
- infoRec->CachePixelGranularity *= 2;
- }
-
- xfree(options);
-
- if(!infoRec->CacheTile && infoRec->WritePixmapToCache)
- infoRec->CacheTile = XAACacheTile;
- if(!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache)
- infoRec->CacheMonoStipple = XAACacheMonoStipple;
- if(!infoRec->CacheStipple && infoRec->WriteBitmapToCache)
- infoRec->CacheStipple = XAACacheStipple;
- if(!infoRec->CacheMono8x8Pattern && infoRec->WriteMono8x8PatternToCache)
- infoRec->CacheMono8x8Pattern = XAACacheMono8x8Pattern;
- if(!infoRec->CacheColor8x8Pattern && infoRec->WriteColor8x8PatternToCache)
- infoRec->CacheColor8x8Pattern = XAACacheColor8x8Pattern;
-
- if((infoRec->Flags & PIXMAP_CACHE) && !infoRec->InitPixmapCache) {
- infoRec->InitPixmapCache = XAAInitPixmapCache;
- infoRec->ClosePixmapCache = XAAClosePixmapCache;
- }
-
- return TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaLine.c b/hw/xfree86/xaa/xaaLine.c
deleted file mode 100644
index 2084e8d61..000000000
--- a/hw/xfree86/xaa/xaaLine.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaLine.c,v 1.6 2002/09/18 18:15:00 martin Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-void
-#ifdef POLYSEGMENT
-XAAPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-#else
-XAAPolyLines(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode, /* Origin or Previous */
- int npt, /* number of points */
- DDXPointPtr pptInit
-#endif
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
- int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int xorg = pDrawable->x;
- int yorg = pDrawable->y;
- int nbox;
- BoxPtr pbox;
-#ifndef POLYSEGMENT
- DDXPointPtr ppt;
-#endif
- int x1, x2, y1, y2, tmp, len;
-
- if(!nboxInit)
- return;
-
- if (infoRec->SolidLineFlags & LINE_LIMIT_COORDS) {
- int minValX = infoRec->SolidLineLimits.x1;
- int maxValX = infoRec->SolidLineLimits.x2;
- int minValY = infoRec->SolidLineLimits.y1;
- int maxValY = infoRec->SolidLineLimits.y2;
-#ifdef POLYSEGMENT
- int n = nseg;
- xSegment *s = pSeg;
-
- while (n--)
-#else
- int n = npt;
- int xorgtmp = xorg;
- int yorgtmp = yorg;
-
- ppt = pptInit;
- x2 = ppt->x + xorgtmp;
- y2 = ppt->y + yorgtmp;
- while (--n)
-#endif
- {
-#ifdef POLYSEGMENT
- x1 = s->x1 + xorg;
- y1 = s->y1 + yorg;
- x2 = s->x2 + xorg;
- y2 = s->y2 + yorg;
- s++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorgtmp = x1;
- yorgtmp = y1;
- }
- x2 = ppt->x + xorgtmp;
- y2 = ppt->y + yorgtmp;
-#endif
- if (x1 > maxValX || x1 < minValX ||
- x2 > maxValX || x2 < minValX ||
- y1 > maxValY || y1 < minValY ||
- y2 > maxValY || y2 < minValY) {
-#ifdef POLYSEGMENT
- XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
-#else
- XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
-#endif
- return;
- }
- }
- }
-
- (*infoRec->SetupForSolidLine)(infoRec->pScrn, pGC->fgPixel,
- pGC->alu, pGC->planemask);
-
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) { /* vertical line */
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2) {
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast) y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast) y2++;
-#endif
- /* get to first band that might contain part of line */
- while(nbox && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- /* stop when lower edge of box is beyond end of line */
- while(nbox && (y2 >= pbox->y1)) {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
- tmp = max(y1, pbox->y1);
- len = min(y2, pbox->y2) - tmp;
- if (len) (*infoRec->SubsequentSolidHorVertLine)(
- infoRec->pScrn, x1, tmp, len, DEGREES_270);
- }
- nbox--;
- pbox++;
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- } else if (y1 == y2) { /* horizontal line */
- /* force line from left to right, keeping endpoint semantics */
- if (x1 > x2) {
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast) x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast) x2++;
-#endif
-
- /* find the correct band */
- while(nbox && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if (nbox && (pbox->y1 <= y1)) {
- int orig_y = pbox->y1;
- /* when we leave this band, we're done */
- while(nbox && (orig_y == pbox->y1)) {
- if (pbox->x2 <= x1) {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2) {
- nbox = 0;
- break;
- }
-
- tmp = max(x1, pbox->x1);
- len = min(x2, pbox->x2) - tmp;
- if (len) (*infoRec->SubsequentSolidHorVertLine)(
- infoRec->pScrn, tmp, y1, len, DEGREES_0);
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- } else{ /* sloped line */
- unsigned int oc1, oc2;
- int dmin, dmaj, e, octant;
-
- if (infoRec->SubsequentSolidBresenhamLine) {
- if((dmaj = x2 - x1) < 0) {
- dmaj = -dmaj;
- octant = XDECREASING;
- } else octant = 0;
-
- if((dmin = y2 - y1) < 0) {
- dmin = -dmin;
- octant |= YDECREASING;
- }
-
- if(dmin >= dmaj){
- tmp = dmin; dmin = dmaj; dmaj = tmp;
- octant |= YMAJOR;
- }
-
- e = -dmaj - ((bias >> octant) & 1);
- len = dmaj;
- dmin <<= 1;
- dmaj <<= 1;
- } else { /* Muffle compiler */
- dmin = dmaj = e = octant = len = 0;
- }
-
- while(nbox--) {
- oc1 = oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if (!(oc1 | oc2)) { /* unclipped */
- if(infoRec->SubsequentSolidTwoPointLine) {
- (*infoRec->SubsequentSolidTwoPointLine)(
- infoRec->pScrn, x1, y1, x2, y2,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? 0 :
-#endif
- OMIT_LAST
- );
- } else {
- (*infoRec->SubsequentSolidBresenhamLine)(
- infoRec->pScrn, x1, y1, dmaj, dmin, e,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? (len+1) :
-#endif
- len, octant);
- }
- break;
- } else if (oc1 & oc2) { /* completely clipped */
- pbox++;
- } else if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE) {
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- pbox->x1, pbox->y1, pbox->x2 - 1, pbox->y2 - 1);
-
- if(infoRec->SubsequentSolidBresenhamLine) {
- (*infoRec->SubsequentSolidBresenhamLine)(
- infoRec->pScrn, x1, y1, dmaj, dmin, e,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? (len+1) :
-#endif
- len, octant);
- } else {
- (*infoRec->SubsequentSolidTwoPointLine)(
- infoRec->pScrn, x1, y1, x2, y2,
-#ifdef POLYSEGMENT
- (pGC->capStyle != CapNotLast) ? 0 :
-#endif
- OMIT_LAST
- );
- }
- (*infoRec->DisableClipping)(infoRec->pScrn);
- pbox++;
- } else {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int err, adx, ady;
-
- if(octant & YMAJOR) {
- ady = dmaj >> 1;
- adx = dmin >> 1;
- } else {
- ady = dmin >> 1;
- adx = dmaj >> 1;
- }
-
- if (miZeroClipLine(pbox->x1, pbox->y1,
- pbox->x2 - 1, pbox->y2 - 1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (octant & YMAJOR)
- len = abs(new_y2 - new_y1);
- else
- len = abs(new_x2 - new_x1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- int abserr, clipdx, clipdy;
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
-
- if (octant & YMAJOR)
- err = e + clipdy*dmin - clipdx*dmaj;
- else
- err = e + clipdx*dmin - clipdy*dmaj;
- } else
- err = e;
-
-#define range infoRec->SolidBresenhamLineErrorTermBits
- abserr = abs(err);
- while((abserr & range) ||
- (dmaj & range) ||
- (dmin & range)) {
- dmin >>= 1;
- dmaj >>= 1;
- abserr >>= 1;
- err /= 2;
- }
-
- (*infoRec->SubsequentSolidBresenhamLine)(
- infoRec->pScrn, new_x1, new_y1,
- dmaj, dmin, err, len, octant);
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
- (x2 < pbox->x2) && (y2 < pbox->y2))
- {
- (*infoRec->SubsequentSolidHorVertLine)(
- infoRec->pScrn, x2, y2, 1, DEGREES_0);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-
- SET_SYNC_FLAG(infoRec);
-}
-
diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c
deleted file mode 100644
index 370921002..000000000
--- a/hw/xfree86/xaa/xaaLineMisc.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaLineMisc.c,v 1.5 1999/01/14 13:05:27 dawes Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "miline.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-void
-XAASolidHorVertLineAsRects(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- if(dir == DEGREES_0)
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, len, 1);
- else
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, len);
-}
-
-
-void
-XAASolidHorVertLineAsTwoPoint(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- len--;
-
- if(dir == DEGREES_0)
- (*infoRec->SubsequentSolidTwoPointLine)(pScrn, x, y, x + len, y, 0);
- else
- (*infoRec->SubsequentSolidTwoPointLine)(pScrn, x, y, x, y + len, 0);
-}
-
-void
-XAASolidHorVertLineAsBresenham(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- if(dir == DEGREES_0)
- (*infoRec->SubsequentSolidBresenhamLine)(
- pScrn, x, y, len << 1, 0, -len, len, 0);
- else
- (*infoRec->SubsequentSolidBresenhamLine)(
- pScrn, x, y, len << 1, 0, -len, len, YMAJOR);
-}
-
-
-void
-XAAComputeDash(GCPtr pGC)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
- Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
- int PatternLength = 0;
- unsigned char* DashPtr = (unsigned char*)pGC->dash;
- CARD32 *ptr;
- int count = pGC->numInDashList;
- int shift, value, direction;
- Bool set;
-
- if(pGCPriv->DashPattern)
- xfree(pGCPriv->DashPattern);
-
- pGCPriv->DashPattern = NULL;
- pGCPriv->DashLength = 0;
-
- while(count--)
- PatternLength += *(DashPtr++);
-
- if(!EvenDash)
- PatternLength <<= 1;
-
- if(PatternLength > infoRec->DashPatternMaxLength)
- return;
-
- if((infoRec->DashedLineFlags & LINE_PATTERN_POWER_OF_2_ONLY) &&
- (PatternLength & (PatternLength - 1)))
- return;
-
- pGCPriv->DashPattern = xcalloc((PatternLength + 31) >> 5, 4);
- if(!pGCPriv->DashPattern) return;
- pGCPriv->DashLength = PatternLength;
-
- if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
- LINE_PATTERN_LSBFIRST_LSBJUSTIFIED)) {
- direction = 1;
- set = TRUE;
- DashPtr = (unsigned char*)pGC->dash;
- } else {
- direction = -1;
- set = FALSE;
- DashPtr = (unsigned char*)pGC->dash + pGC->numInDashList - 1;
- }
-
- if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
- LINE_PATTERN_MSBFIRST_MSBJUSTIFIED))
- shift = 32 - (PatternLength & 31);
- else
- shift = 0;
-
- ptr = (CARD32*)(pGCPriv->DashPattern);
-
-CONCATENATE:
-
- count = pGC->numInDashList;
-
- while(count--) {
- value = *DashPtr;
- DashPtr += direction;
- while(value) {
- if(value < (32 - shift)) {
- if(set) *ptr |= XAAShiftMasks[value] << shift;
- shift += value;
- break;
- } else {
- if(set) *ptr |= ~0L << shift;
- value -= (32 - shift);
- shift = 0;
- ptr++;
- }
- }
- if(set) set = FALSE;
- else set = TRUE;
- }
-
- if(!EvenDash) {
- EvenDash = TRUE;
- if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
- LINE_PATTERN_LSBFIRST_LSBJUSTIFIED))
- DashPtr = (unsigned char*)pGC->dash;
- else
- DashPtr = (unsigned char*)pGC->dash + pGC->numInDashList;
- goto CONCATENATE;
- }
-}
diff --git a/hw/xfree86/xaa/xaaNonTEGlyph.c b/hw/xfree86/xaa/xaaNonTEGlyph.c
deleted file mode 100644
index 234d242c4..000000000
--- a/hw/xfree86/xaa/xaaNonTEGlyph.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEGlyph.c,v 1.6 1999/11/06 23:14:46 mvojkovi Exp $ */
-
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-
-/* Not used anymore because the algorithm isn't correct. It doesn't
- handle overlapping characters properly */
-
-#ifdef TRIPLE_BITS
-#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc3)
-#else
-#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc)
-#endif
-
-/********************************************************************
-
- Here we have NonTEGlyphRenders for a bunch of different color
- expansion types. The driver may provide its own renderer, but
- this is the default one which renders using lower-level primitives
- exported by the chipset driver.
-
-********************************************************************/
-
-/* Since the dimensions of the text string and the backing rectangle
- do not always coincide, it is possible that wBack or wText
- may be 0! The NonTEGlyphRender must always check for this. */
-
-/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not,
- with TRIPLE_BITS or not. A total of 8 versions */
-
-/* if the backing rectangle and text are of the same dimensions
- then we can draw in one pass */
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAANonTEGlyphRenderer3)(
-#else
-EXPNAME(XAANonTEGlyphRenderer)(
-#endif
- ScrnInfoPtr pScrn,
- int xText, int wText,
- int y, int h, int skipleft, int startline,
- NonTEGlyphInfo *glyphp,
- int fg, int rop,
- unsigned int planemask )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32* base = (CARD32*)infoRec->ColorExpandBase;
-#ifdef TRIPLE_BITS
- int dwords = ((3 * wText + 31) >> 5) * h;
-#else
- int dwords = ((wText + 31) >> 5) * h;
-#endif
-
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, -1, rop, planemask);
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, xText, y, wText, h, 0);
-
-#ifndef FIXEDBASE
-#ifdef TRIPLE_BITS
- if((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-#else
- if((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
-#endif
- while(h--)
- base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
- else
-#endif
- while(h--)
- NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
-
- if((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) &&
- (dwords & 1)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
- if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-#ifndef FIXEDBASE
-/* Scanline version of above gets built for LSBFIRST and MSBFIRST */
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAANonTEGlyphRendererScanline3)(
-#else
-EXPNAME(XAANonTEGlyphRendererScanline)(
-#endif
- ScrnInfoPtr pScrn,
- int xText, int wText,
- int y, int h, int skipleft, int startline,
- NonTEGlyphInfo *glyphp,
- int fg, int rop,
- unsigned int planemask )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int bufferNo = 0;
- CARD32* base;
-
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
- pScrn, fg, -1, rop, planemask);
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, xText, y, wText, h, 0);
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-/********************************************************************
-
- Generic NonTE scanline rendering code.
-
-********************************************************************/
-
-
-CARD32*
-NonTEGlyphFunc(
- CARD32 *base,
- NonTEGlyphInfo *glyphp,
- int line, int TotalWidth, int skipleft )
-{
- CARD32 bits = 0;
- int shift = glyphp->width;
-
- if(skipleft) {
- if((line >= glyphp->firstline) && (line <= glyphp->lastline))
- bits = SHIFT_R(glyphp->bitsp[line], skipleft);
- shift -= skipleft;
- } else if((line >= glyphp->firstline) && (line <= glyphp->lastline))
- bits = glyphp->bitsp[line];
-
-
- while(TotalWidth > 32) {
- while(shift < 32) {
- glyphp++;
- if((line >= glyphp->firstline) && (line <= glyphp->lastline))
- bits |= SHIFT_L(glyphp->bitsp[line],shift);
- shift += glyphp->width;
- }
-#ifdef TRIPLE_BITS
- WRITE_BITS3(bits);
-#else
- WRITE_BITS(bits);
-#endif
- shift &= 31;
- if(shift &&
- (line >= glyphp->firstline) && (line <= glyphp->lastline))
- bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift);
- else bits = 0;
- TotalWidth -= 32;
- }
-
- if(TotalWidth) {
- TotalWidth -= shift;
- while(TotalWidth > 0) {
- glyphp++;
- if((line >= glyphp->firstline) && (line <= glyphp->lastline))
- bits |= SHIFT_L(glyphp->bitsp[line], shift);
- shift += glyphp->width;
- TotalWidth -= glyphp->width;
- }
-#ifdef TRIPLE_BITS
- if (shift >= 22) {
- WRITE_BITS3(bits);
- } else if (shift >= 11) {
- WRITE_BITS2(bits);
- } else {
- WRITE_BITS1(bits);
- }
-#else
- WRITE_BITS(bits);
-#endif
- }
-
-
- return base;
-}
-
-
-
-
diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c
deleted file mode 100644
index e1c57588a..000000000
--- a/hw/xfree86/xaa/xaaNonTEText.c
+++ /dev/null
@@ -1,588 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.14 2003/11/14 21:54:51 dawes Exp $ */
-
-/********************************************************************
-
- In this file we have GC level replacements for PolyText8/16,
- ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for NonTE (proportional)
- fonts. The idea is that everything in this file is device independent.
- The mentioned GCOps are merely wrappers for the
- PolyGlyphBltNonTEColorExpansion and ImageGlyphBltNonTEColorExpansion
- functions which calculate the boxes containing arbitrarily clipped
- text and passes them to the NonTEGlyphRenderer which will usually
- be a lower level XAA function which renders these clipped glyphs using
- the basic color expansion functions exported by the chipset driver.
- The NonTEGlyphRenderer itself may optionally be driver supplied to
- facilitate work-arounds/optimizations at a higher level than usual.
-
- Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-
-********************************************************************/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "font.h"
-#include "scrnintstr.h"
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaacexp.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-
-static void ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
- int xInit, int yInit, FontPtr font,
- int fg, int bg, unsigned planemask,
- RegionPtr cclip, int nglyph,
- unsigned char* gBase, CharInfoPtr *ppci);
-static int PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
- int xInit, int yInit, FontPtr font,
- int fg, int rop, unsigned planemask,
- RegionPtr cclip, int nglyph,
- unsigned char* gBase, CharInfoPtr *ppci);
-
-/********************************************************************
-
- GC level replacements for PolyText8/16 and ImageText8/16
- for NonTE fonts when using color expansion.
-
-********************************************************************/
-
-
-int
-XAAPolyText8NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
- int width = 0;
-
- (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
- (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
-
- if(n) {
- width = PolyGlyphBltNonTEColorExpansion( infoRec->pScrn,
- x + pDraw->x, y + pDraw->y, pGC->font,
- pGC->fgPixel, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font),
- infoRec->CharInfo);
- }
-
- return (x + width);
-}
-
-
-int
-XAAPolyText16NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
- int width = 0;
-
- (*pGC->font->get_glyphs)(
- pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, infoRec->CharInfo);
-
- if(n) {
- width = PolyGlyphBltNonTEColorExpansion( infoRec->pScrn,
- x + pDraw->x, y + pDraw->y, pGC->font,
- pGC->fgPixel, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font),
- infoRec->CharInfo);
- }
-
- return (x + width);
-}
-
-
-void
-XAAImageText8NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
- (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
-
- if(n) ImageGlyphBltNonTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-}
-
-
-void
-XAAImageText16NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- (*pGC->font->get_glyphs)(
- pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, infoRec->CharInfo);
-
- if(n) ImageGlyphBltNonTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-}
-
-
-
-/********************************************************************
-
- GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
- NonTE fonts when using color expansion.
-
-********************************************************************/
-
-
-void
-XAAImageGlyphBltNonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci, /* array of character info */
- pointer pglyphBase /* start of array of glyphs */
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- ImageGlyphBltNonTEColorExpansion(
- infoRec->pScrn, xInit + pDraw->x, yInit + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
-}
-
-void
-XAAPolyGlyphBltNonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci, /* array of character info */
- pointer pglyphBase /* start of array of glyphs */
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- PolyGlyphBltNonTEColorExpansion(
- infoRec->pScrn, xInit + pDraw->x, yInit + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
-}
-
-
-
-
-/********************************************************************
-
- ImageGlyphBltNonTEColorExpansion -
- PolyGlyphBltNonTEColorExpansion -
-
- These guys compute the clipped pieces of text and send it to
- the lower-level function which will handle acceleration of
- arbitrarily clipped text.
-
-********************************************************************/
-
-
-
-static int
-CollectCharacterInfo(
- NonTEGlyphPtr glyphs,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- FontPtr pfont
-){
- int i, w = 0;
-
- for(i = 0; i < nglyph; i++, ppci++, glyphs++) {
- glyphs->bits = (unsigned char*)((*ppci)->bits);
- glyphs->start = w + (*ppci)->metrics.leftSideBearing;
- glyphs->end = w + (*ppci)->metrics.rightSideBearing;
- glyphs->yoff = (*ppci)->metrics.ascent;
- glyphs->height = glyphs->yoff + (*ppci)->metrics.descent;
- glyphs->srcwidth = PADGLYPHWIDTHBYTES(glyphs->end - glyphs->start);
- w += (*ppci)->metrics.characterWidth;
- }
- return w;
-}
-
-
-static void
-PolyGlyphBltAsSingleBitmap (
- ScrnInfoPtr pScrn,
- int nglyph,
- FontPtr font,
- int xInit,
- int yInit,
- int nbox,
- BoxPtr pbox,
- int fg,
- int rop,
- unsigned planemask
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *block, *pntr, *bits;
- int pitch, topLine, botLine, top, bot, height;
- int Left, Right, Top, Bottom;
- int LeftEdge, RightEdge;
- int bitPitch, shift, size, i, skippix;
- NonTEGlyphPtr glyphs = infoRec->GlyphInfo;
- Bool extra;
-
- Left = xInit + infoRec->GlyphInfo[0].start;
- Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
- Top = yInit - FONTMAXBOUNDS(font,ascent);
- Bottom = yInit + FONTMAXBOUNDS(font,descent);
-
- /* get into the first band that may contain part of our string */
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- if(!nbox) return;
-
- pitch = (Right - Left + 31) >> 5;
- size = (pitch << 2) * (Bottom - Top);
- block = (CARD32*)ALLOCATE_LOCAL(size);
- bzero(block, size);
-
- topLine = 10000; botLine = -10000;
-
- while(nglyph--) {
- top = -glyphs->yoff;
- bot = top + glyphs->height;
- if(top < topLine) topLine = top;
- if(bot > botLine) botLine = bot;
- skippix = glyphs->start - infoRec->GlyphInfo[0].start;
- bits = (CARD32*)glyphs->bits;
- bitPitch = glyphs->srcwidth >> 2;
- pntr = block + ((FONTMAXBOUNDS(font,ascent) + top) * pitch) +
- (skippix >> 5);
- shift = skippix & 31;
- extra = ((shift + glyphs->end - glyphs->start) > 32);
-
- for(i = top; i < bot; i++) {
- *pntr |= SHIFT_L(*bits, shift);
- if(extra)
- *(pntr + 1) |= SHIFT_R(*bits,32 - shift);
- pntr += pitch;
- bits += bitPitch;
- }
-
- glyphs++;
- }
-
- pntr = block + ((FONTMAXBOUNDS(font,ascent) + topLine) * pitch);
-
- Top = yInit + topLine;
- Bottom = yInit + botLine;
-
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- while(nbox && (Bottom > pbox->y1)) {
- LeftEdge = max(Left, pbox->x1);
- RightEdge = min(Right, pbox->x2);
-
- if(RightEdge > LeftEdge) {
- skippix = LeftEdge - Left;
- topLine = max(Top, pbox->y1);
- botLine = min(Bottom, pbox->y2);
- height = botLine - topLine;
-
- if(height > 0)
- (*infoRec->WriteBitmap)(pScrn, LeftEdge, topLine,
- RightEdge - LeftEdge, height,
- (unsigned char*)(pntr + ((topLine - Top) * pitch) +
- (skippix >> 5)),
- pitch << 2, skippix & 31, fg, -1, rop, planemask);
- }
-
- nbox--; pbox++;
- }
-
- DEALLOCATE_LOCAL(block);
-}
-
-static void
-ImageGlyphBltNonTEColorExpansion(
- ScrnInfoPtr pScrn,
- int xInit, int yInit,
- FontPtr font,
- int fg, int bg,
- unsigned planemask,
- RegionPtr cclip,
- int nglyph,
- unsigned char* gBase,
- CharInfoPtr *ppci
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int skippix, skipglyph, width, n, i;
- int Left, Right, Top, Bottom;
- int LeftEdge, RightEdge, ytop, ybot;
- int nbox = REGION_NUM_RECTS(cclip);
- BoxPtr pbox = REGION_RECTS(cclip);
- Bool AlreadySetup = FALSE;
-
- width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
-
- /* find our backing rectangle dimensions */
- Left = xInit;
- Right = Left + width;
- Top = yInit - FONTASCENT(font);
- Bottom = yInit + FONTDESCENT(font);
-
- /* get into the first band that may contain part of our box */
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- while(nbox && (Bottom >= pbox->y1)) {
- /* handle backing rect first */
- LeftEdge = max(Left, pbox->x1);
- RightEdge = min(Right, pbox->x2);
- if(RightEdge > LeftEdge) {
- ytop = max(Top, pbox->y1);
- ybot = min(Bottom, pbox->y2);
-
- if(ybot > ytop) {
- if(!AlreadySetup) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, GXcopy, planemask);
- AlreadySetup = TRUE;
- }
- (*infoRec->SubsequentSolidFillRect)(pScrn,
- LeftEdge, ytop, RightEdge - LeftEdge, ybot - ytop);
- }
- }
- nbox--; pbox++;
- }
-
- nbox = REGION_NUM_RECTS(cclip);
- pbox = REGION_RECTS(cclip);
-
- if(infoRec->WriteBitmap && (nglyph > 1) &&
- ((FONTMAXBOUNDS(font, rightSideBearing) -
- FONTMINBOUNDS(font, leftSideBearing)) <= 32))
- {
- PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
- xInit, yInit, nbox, pbox,
- fg, GXcopy, planemask);
-
- return;
- }
-
- /* compute an approximate but covering bounding box */
- Left = xInit + infoRec->GlyphInfo[0].start;
- Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
- Top = yInit - FONTMAXBOUNDS(font,ascent);
- Bottom = yInit + FONTMAXBOUNDS(font,descent);
-
- /* get into the first band that may contain part of our box */
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- /* stop when the lower edge of the box is beyond our string */
- while(nbox && (Bottom >= pbox->y1)) {
- LeftEdge = max(Left, pbox->x1);
- RightEdge = min(Right, pbox->x2);
-
- if(RightEdge > LeftEdge) { /* we're possibly drawing something */
- ytop = max(Top, pbox->y1);
- ybot = min(Bottom, pbox->y2);
- if(ybot > ytop) {
- skippix = LeftEdge - xInit;
- skipglyph = 0;
- while(skippix >= infoRec->GlyphInfo[skipglyph].end)
- skipglyph++;
-
- skippix = RightEdge - xInit;
- n = 0; i = skipglyph;
- while((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
- i++; n++;
- }
-
- if(n) (*infoRec->NonTEGlyphRenderer)(pScrn,
- xInit, yInit, n, infoRec->GlyphInfo + skipglyph,
- pbox, fg, GXcopy, planemask);
- }
- }
-
- nbox--; pbox++;
- }
-}
-
-
-static int
-PolyGlyphBltNonTEColorExpansion(
- ScrnInfoPtr pScrn,
- int xInit, int yInit,
- FontPtr font,
- int fg, int rop,
- unsigned planemask,
- RegionPtr cclip,
- int nglyph,
- unsigned char* gBase,
- CharInfoPtr *ppci
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int skippix, skipglyph, width, n, i;
- int Left, Right, Top, Bottom;
- int LeftEdge, RightEdge;
- int nbox = REGION_NUM_RECTS(cclip);
- BoxPtr pbox = REGION_RECTS(cclip);
-
- width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
-
- if(!nbox)
- return width;
-
- if((infoRec->WriteBitmap) && (rop == GXcopy) && (nglyph > 1) &&
- ((FONTMAXBOUNDS(font, rightSideBearing) -
- FONTMINBOUNDS(font, leftSideBearing)) <= 32)) {
-
- PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
- xInit, yInit, nbox, pbox,
- fg, rop, planemask);
-
- return width;
- }
-
- /* compute an approximate but covering bounding box */
- Left = xInit + infoRec->GlyphInfo[0].start;
- Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
- Top = yInit - FONTMAXBOUNDS(font,ascent);
- Bottom = yInit + FONTMAXBOUNDS(font,descent);
-
- /* get into the first band that may contain part of our string */
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- /* stop when the lower edge of the box is beyond our string */
- while(nbox && (Bottom >= pbox->y1)) {
- LeftEdge = max(Left, pbox->x1);
- RightEdge = min(Right, pbox->x2);
-
- if(RightEdge > LeftEdge) { /* we're possibly drawing something */
-
- skippix = LeftEdge - xInit;
- skipglyph = 0;
- while(skippix >= infoRec->GlyphInfo[skipglyph].end)
- skipglyph++;
-
- skippix = RightEdge - xInit;
- n = 0; i = skipglyph;
- while((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
- i++; n++;
- }
-
- if(n) (*infoRec->NonTEGlyphRenderer)(pScrn,
- xInit, yInit, n, infoRec->GlyphInfo + skipglyph,
- pbox, fg, rop, planemask);
- }
-
- nbox--; pbox++;
- }
- return width;
-}
-
-
-/* It is possible that the none of the glyphs passed to the
- NonTEGlyphRenderer will be drawn. This function being called
- indicates that part of the text string's bounding box is visible
- but not necessarily that any of the characters are visible */
-
-void XAANonTEGlyphRenderer(
- ScrnInfoPtr pScrn,
- int x, int y, int n,
- NonTEGlyphPtr glyphs,
- BoxPtr pbox,
- int fg, int rop,
- unsigned int planemask
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x1, x2, y1, y2, i, w, h, skipleft, skiptop;
- unsigned char *src;
-
- for(i = 0; i < n; i++, glyphs++) {
- x1 = x + glyphs->start;
- x2 = x + glyphs->end;
- y1 = y - glyphs->yoff;
- y2 = y1 + glyphs->height;
-
- if(y1 < pbox->y1) {
- skiptop = pbox->y1 - y1;
- y1 = pbox->y1;
- } else skiptop = 0;
- if(y2 > pbox->y2) y2 = pbox->y2;
- h = y2 - y1;
- if(h <= 0) continue;
-
- if(x1 < pbox->x1) {
- skipleft = pbox->x1 - x1;
- x1 = pbox->x1;
- } else skipleft = 0;
- if(x2 > pbox->x2) x2 = pbox->x2;
-
- w = x2 - x1;
-
- if(w > 0) {
- src = glyphs->bits + (skiptop * glyphs->srcwidth);
-
- if(skipleft) {
- src += (skipleft >> 5) << 2;
- skipleft &= 31;
- }
-
- (*infoRec->WriteBitmap)(pScrn, x1, y1, w, h, src,
- glyphs->srcwidth, skipleft, fg, -1, rop, planemask);
- }
- }
-
-}
diff --git a/hw/xfree86/xaa/xaaOffscreen.c b/hw/xfree86/xaa/xaaOffscreen.c
deleted file mode 100644
index 0fb1db365..000000000
--- a/hw/xfree86/xaa/xaaOffscreen.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOffscreen.c,v 1.6 2001/07/19 18:50:16 mvojkovi Exp $ */
-
-/*
- Copyright (c) 1999 - The XFree86 Project Inc.
-
- Written by Mark Vojkovich
-
-*/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-void
-XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
- XAAPixmapPtr pPriv;
-
- while(pLink) {
- pPriv = XAA_GET_PIXMAP_PRIVATE(pLink->pPix);
- pLink->area = pPriv->offscreenArea;
- XAAMoveOutOffscreenPixmap(pLink->pPix);
- pLink = pLink->next;
- }
-}
-
-
-
-void
-XAAMoveInOffscreenPixmaps(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
- PixmapPtr pPix, pScreenPix, tmpPix;
- pointer data;
- XAAPixmapPtr pPriv;
- GCPtr pGC;
- FBAreaPtr area;
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- while(pLink) {
- pPix = pLink->pPix;
- pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- area = pLink->area;
-
- data = pPix->devPrivate.ptr;
- tmpPix = GetScratchPixmapHeader(pScreen,
- pPix->drawable.width, pPix->drawable.height,
- pPix->drawable.depth, pPix->drawable.bitsPerPixel,
- pPix->devKind, data);
-
- pPriv->freeData = FALSE;
-
- pPix->drawable.x = area->box.x1;
- pPix->drawable.y = area->box.y1;
- pPix->devKind = pScreenPix->devKind;
- pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
- pPix->drawable.bitsPerPixel = infoRec->pScrn->bitsPerPixel;
- pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- if(!tmpPix) {
- pPriv->offscreenArea = area;
- xfree(data);
- pLink = pLink->next;
- continue;
- }
-
- pGC = GetScratchGC(pPix->drawable.depth, pScreen);
- ValidateGC((DrawablePtr)pPix, pGC);
-
- (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC,
- 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0);
-
- xfree(data);
- tmpPix->devPrivate.ptr = NULL;
-
- FreeScratchGC(pGC);
- FreeScratchPixmapHeader(tmpPix);
-
- pPriv->offscreenArea = area;
- pLink->area = NULL;
- pLink = pLink->next;
- }
-}
-
-
-void
-XAARemoveAreaCallback(FBAreaPtr area)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(area->pScreen);
- PixmapPtr pPix = (PixmapPtr)area->devPrivate.ptr;
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
-
- XAAMoveOutOffscreenPixmap(pPix);
-
- pPriv->flags &= ~OFFSCREEN;
-
- DELIST_OFFSCREEN_PIXMAP(pPix);
-}
-
-void
-XAAMoveOutOffscreenPixmap(PixmapPtr pPix)
-{
- ScreenPtr pScreen = pPix->drawable.pScreen;
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- int width, height, devKind, bitsPerPixel;
- PixmapPtr tmpPix;
- unsigned char *data;
- GCPtr pGC;
-
- width = pPix->drawable.width;
- height = pPix->drawable.height;
- bitsPerPixel = pPix->drawable.bitsPerPixel;
-
- devKind = BitmapBytePad(width * bitsPerPixel);
- if(!(data = xalloc(devKind * height)))
- FatalError("Out of memory\n");
-
- tmpPix = GetScratchPixmapHeader(pScreen, width, height,
- pPix->drawable.depth, bitsPerPixel, devKind, data);
- if(!tmpPix) {
- xfree(data);
- FatalError("Out of memory\n");
- }
-
- pGC = GetScratchGC(pPix->drawable.depth, pScreen);
- ValidateGC((DrawablePtr)tmpPix, pGC);
-
- (*pGC->ops->CopyArea)((DrawablePtr)pPix, (DrawablePtr)tmpPix,
- pGC, 0, 0, width, height, 0, 0);
-
- FreeScratchGC(pGC);
- FreeScratchPixmapHeader(tmpPix);
-
- pPix->drawable.x = 0;
- pPix->drawable.y = 0;
- pPix->devKind = devKind;
- pPix->devPrivate.ptr = data;
- pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- pPriv->offscreenArea = NULL;
- pPriv->freeData = TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
deleted file mode 100644
index d527b7c15..000000000
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.15 2003/11/10 18:22:41 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mioverlay.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-static void
-XAACopyWindow8_32(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-){
- DDXPointPtr pptSrc, ppt;
- RegionRec rgnDst;
- BoxPtr pbox;
- int dx, dy, nbox;
- WindowPtr pwinRoot;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
- Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
- RegionPtr borderClip = &pWin->borderClip;
- Bool freeReg = FALSE;
-
- if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt ||
- (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK))
- {
- XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
- if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow8_32);
- return;
- }
-
- pwinRoot = WindowTable[pScreen->myNum];
-
- if(doUnderlay)
- freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox ||
- !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
- REGION_UNINIT(pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- while(nbox--) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- ppt++; pbox++;
- }
-
- infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
- infoRec->ScratchGC.alu = GXcopy;
-
- XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
- DEALLOCATE_LOCAL(pptSrc);
- REGION_UNINIT(pScreen, &rgnDst);
- if(freeReg)
- REGION_DESTROY(pScreen, borderClip);
-}
-
-
-
-
-static void
-XAAPaintWindow8_32(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
- int nBox = REGION_NUM_RECTS(prgn);
- BoxPtr pBox = REGION_RECTS(prgn);
- PixmapPtr pPix = NULL;
- int depth = pWin->drawable.depth;
- int fg = 0, pm;
-
- if(!infoRec->pScrn->vtSema) goto BAILOUT;
-
- switch (what) {
- case PW_BACKGROUND:
- switch(pWin->backgroundState) {
- case None: return;
- case ParentRelative:
- do { pWin = pWin->parent; }
- while(pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what);
- return;
- case BackgroundPixel:
- fg = pWin->background.pixel;
- break;
- case BackgroundPixmap:
- pPix = pWin->background.pixmap;
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- fg = pWin->border.pixel;
- else /* pixmap */
- pPix = pWin->border.pixmap;
- break;
- default: return;
- }
-
- if(depth == 8) {
- pm = 0xff000000;
- fg <<= 24;
- } else
- pm = 0x00ffffff;
-
- if(!pPix) {
- if(infoRec->FillSolidRects &&
- !(infoRec->FillSolidRectsFlags & NO_PLANEMASK) &&
- (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) ||
- (depth == 8) || CHECK_RGB_EQUAL(fg)))
- {
- (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy,
- pm, nBox, pBox);
- return;
- }
- } else { /* pixmap */
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- WindowPtr pBgWin = pWin;
- int xorg, yorg;
-
- if (what == PW_BORDER) {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- }
-
- xorg = pBgWin->drawable.x;
- yorg = pBgWin->drawable.y;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pScreen->myNum;
- if(WindowTable[index] == pBgWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
-
- if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) {
- XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
-
- pCache->x = pPriv->offscreenArea->box.x1;
- pCache->y = pPriv->offscreenArea->box.y1;
- pCache->w = pCache->orig_w =
- pPriv->offscreenArea->box.x2 - pCache->x;
- pCache->h = pCache->orig_h =
- pPriv->offscreenArea->box.y2 - pCache->y;
- pCache->trans_color = -1;
-
- (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm,
- nBox, pBox, xorg, yorg, pCache);
-
- return;
- }
-
- if(pPriv->flags & DIRTY) {
- pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
-
- if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
- (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
- XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8);
- }
-
- if(pPriv->flags & REDUCIBLE_TO_8x8) {
- if((pPriv->flags & REDUCIBLE_TO_2_COLOR) &&
- infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects &&
- !(infoRec->FillMono8x8PatternRectsFlags & NO_PLANEMASK) &&
- !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))))
- {
- (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn,
- pPriv->fg, pPriv->bg, GXcopy, pm, nBox, pBox,
- pPriv->pattern0, pPriv->pattern1, xorg, yorg);
- return;
- }
- if(infoRec->CanDoColor8x8 && infoRec->FillColor8x8PatternRects &&
- !(infoRec->FillColor8x8PatternRectsFlags & NO_PLANEMASK))
- {
- XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)(
- infoRec->pScrn, pPix, -1, -1);
-
- (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn,
- GXcopy, pm, nBox, pBox, xorg, yorg, pCache);
- return;
- }
- }
-
- if(infoRec->UsingPixmapCache && infoRec->FillCacheBltRects &&
- !(infoRec->FillCacheBltRectsFlags & NO_PLANEMASK) &&
- (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) &&
- (pPix->drawable.width <= infoRec->MaxCacheableTileWidth))
- {
- XAACacheInfoPtr pCache =
- (*infoRec->CacheTile)(infoRec->pScrn, pPix);
- (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm,
- nBox, pBox, xorg, yorg, pCache);
- return;
- }
-
- if(infoRec->FillImageWriteRects &&
- !(infoRec->FillImageWriteRectsFlags & NO_PLANEMASK))
- {
- (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy,
- pm, nBox, pBox, xorg, yorg, pPix);
- return;
- }
- }
-
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
-
-BAILOUT:
-
- if(what == PW_BACKGROUND) {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
- (*pScreen->PaintWindowBackground) (pWin, prgn, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow8_32);
- } else {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
- (*pScreen->PaintWindowBorder) (pWin, prgn, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow8_32);
- }
-}
-
-
-static void
-XAASetColorKey8_32(
- ScreenPtr pScreen,
- int nbox,
- BoxPtr pbox
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = infoRec->pScrn;
-
- /* I'm counting on writes being clipped away while switched away.
- If this isn't going to be true then I need to be wrapping instead. */
- if(!infoRec->pScrn->vtSema) return;
-
- (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey << 24, GXcopy,
- 0xff000000, nbox, pbox);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAASetupOverlay8_32Planar(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- int i;
-
- pScreen->PaintWindowBackground = XAAPaintWindow8_32;
- pScreen->PaintWindowBorder = XAAPaintWindow8_32;
- pScreen->CopyWindow = XAACopyWindow8_32;
-
- if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
- miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
-
- infoRec->FullPlanemask = ~0;
- for(i = 0; i < 32; i++) /* haven't thought about this much */
- infoRec->FullPlanemasks[i] = ~0;
-}
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
deleted file mode 100644
index 5cce3e7ed..000000000
--- a/hw/xfree86/xaa/xaaOverlayDF.c
+++ /dev/null
@@ -1,1154 +0,0 @@
-/*
- Copyright (c) 1999 - The XFree86 Project Inc.
-
- Written by Mark Vojkovich
-*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.2 2003/11/10 18:22:41 tsi Exp $ */
-
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "servermd.h"
-
-/* Screen funcs */
-
-static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr);
-static void XAAOverPaintWindow(WindowPtr, RegionPtr, int);
-static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr);
-static void XAAOverSaveAreas(PixmapPtr, RegionPtr, int, int, WindowPtr);
-static void XAAOverRestoreAreas(PixmapPtr, RegionPtr, int, int, WindowPtr);
-
-
-static int XAAOverStippledFillChooser(GCPtr);
-static int XAAOverOpaqueStippledFillChooser(GCPtr);
-static int XAAOverTiledFillChooser(GCPtr);
-
-/* GC funcs */
-
-static RegionPtr XAAOverCopyArea(DrawablePtr, DrawablePtr, GC *,
- int, int, int, int, int, int);
-static RegionPtr XAAOverCopyPlane(DrawablePtr, DrawablePtr, GCPtr,
- int, int, int, int, int, int, unsigned long);
-static void XAAOverPushPixelsSolid(GCPtr, PixmapPtr, DrawablePtr, int,
- int, int, int);
-static void XAAOverPolyFillRectSolid(DrawablePtr, GCPtr, int, xRectangle*);
-static void XAAOverPolyFillRectStippled(DrawablePtr, GCPtr, int, xRectangle*);
-static void XAAOverPolyFillRectOpaqueStippled(DrawablePtr, GCPtr,
- int, xRectangle*);
-static void XAAOverPolyFillRectTiled(DrawablePtr, GCPtr, int, xRectangle*);
-static void XAAOverFillSpansSolid(DrawablePtr, GCPtr, int, DDXPointPtr,
- int*, int);
-static void XAAOverFillSpansStippled(DrawablePtr, GCPtr, int, DDXPointPtr,
- int*, int);
-static void XAAOverFillSpansOpaqueStippled(DrawablePtr, GCPtr, int,
- DDXPointPtr, int*, int);
-static void XAAOverFillSpansTiled(DrawablePtr, GCPtr, int, DDXPointPtr,
- int*, int);
-static int XAAOverPolyText8TE(DrawablePtr, GCPtr, int, int, int, char *);
-static int XAAOverPolyText16TE(DrawablePtr, GCPtr, int, int, int,
- unsigned short*);
-static void XAAOverImageText8TE(DrawablePtr, GCPtr, int, int, int, char*);
-static void XAAOverImageText16TE(DrawablePtr, GCPtr, int, int, int,
- unsigned short*);
-static void XAAOverImageGlyphBltTE(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr*, pointer);
-static void XAAOverPolyGlyphBltTE(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr*, pointer);
-static int XAAOverPolyText8NonTE(DrawablePtr, GCPtr, int, int, int, char*);
-static int XAAOverPolyText16NonTE(DrawablePtr, GCPtr, int, int, int,
- unsigned short*);
-static void XAAOverImageText8NonTE(DrawablePtr, GCPtr, int, int, int, char*);
-static void XAAOverImageText16NonTE(DrawablePtr, GCPtr, int, int, int,
- unsigned short*);
-static void XAAOverImageGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-static void XAAOverPolyGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-static void XAAOverPolyRectangleThinSolid(DrawablePtr, GCPtr, int, xRectangle*);
-static void XAAOverPolylinesWideSolid(DrawablePtr, GCPtr, int, int,
- DDXPointPtr);
-static void XAAOverPolylinesThinSolid(DrawablePtr, GCPtr, int, int,
- DDXPointPtr);
-static void XAAOverPolySegmentThinSolid(DrawablePtr, GCPtr, int, xSegment*);
-static void XAAOverPolylinesThinDashed(DrawablePtr, GCPtr, int, int,
- DDXPointPtr);
-static void XAAOverPolySegmentThinDashed(DrawablePtr, GCPtr, int, xSegment*);
-static void XAAOverFillPolygonSolid(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void XAAOverFillPolygonStippled(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void XAAOverFillPolygonOpaqueStippled(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void XAAOverFillPolygonTiled(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void XAAOverPolyFillArcSolid(DrawablePtr, GCPtr, int, xArc*);
-static void XAAOverPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
- int, int, char*);
-
-
-typedef struct {
- ScrnInfoPtr pScrn;
- DepthChangeFuncPtr callback;
- int currentDepth;
-/* GC funcs */
- RegionPtr (*CopyArea)(DrawablePtr, DrawablePtr, GC *,
- int, int, int, int, int, int);
- RegionPtr (*CopyPlane)(DrawablePtr, DrawablePtr, GCPtr,
- int, int, int, int, int, int, unsigned long);
- void (*PushPixelsSolid)(GCPtr, PixmapPtr, DrawablePtr, int, int, int, int);
- void (*PolyFillRectSolid)(DrawablePtr, GCPtr, int, xRectangle*);
- void (*PolyFillRectStippled)(DrawablePtr, GCPtr, int, xRectangle*);
- void (*PolyFillRectOpaqueStippled)(DrawablePtr, GCPtr, int, xRectangle*);
- void (*PolyFillRectTiled)(DrawablePtr, GCPtr, int, xRectangle*);
- void (*FillSpansSolid)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
- void (*FillSpansStippled)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
- void (*FillSpansOpaqueStippled)(DrawablePtr,GCPtr,int,DDXPointPtr,int*,int);
- void (*FillSpansTiled)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
- int (*PolyText8TE)(DrawablePtr, GCPtr, int, int, int, char *);
- int (*PolyText16TE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
- void (*ImageText8TE)(DrawablePtr, GCPtr, int, int, int, char*);
- void (*ImageText16TE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
- void (*ImageGlyphBltTE)(DrawablePtr, GCPtr, int, int, unsigned int,
- CharInfoPtr*, pointer);
- void (*PolyGlyphBltTE)(DrawablePtr, GCPtr, int, int, unsigned int,
- CharInfoPtr*, pointer);
- int (*PolyText8NonTE)(DrawablePtr, GCPtr, int, int, int, char*);
- int (*PolyText16NonTE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
- void (*ImageText8NonTE)(DrawablePtr, GCPtr, int, int, int, char*);
- void (*ImageText16NonTE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
- void (*ImageGlyphBltNonTE)(DrawablePtr, GCPtr, int, int, unsigned int,
- CharInfoPtr *, pointer);
- void (*PolyGlyphBltNonTE)(DrawablePtr, GCPtr, int, int, unsigned int,
- CharInfoPtr *, pointer);
- void (*PolyRectangleThinSolid)(DrawablePtr, GCPtr, int, xRectangle*);
- void (*PolylinesWideSolid)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
-
- void (*PolylinesThinSolid)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
- void (*PolySegmentThinSolid)(DrawablePtr, GCPtr, int, xSegment*);
- void (*PolylinesThinDashed)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
- void (*PolySegmentThinDashed)(DrawablePtr, GCPtr, int, xSegment*);
- void (*FillPolygonSolid)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
- void (*FillPolygonStippled)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
- void (*FillPolygonOpaqueStippled)(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
- void (*FillPolygonTiled)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
- void (*PolyFillArcSolid)(DrawablePtr, GCPtr, int, xArc*);
- void (*PutImage)(DrawablePtr, GCPtr, int, int, int, int, int, int,
- int, char*);
- int (*StippledFillChooser)(GCPtr);
- int (*OpaqueStippledFillChooser)(GCPtr);
- int (*TiledFillChooser)(GCPtr);
-} XAAOverlayRec, *XAAOverlayPtr;
-
-static int XAAOverlayIndex = -1;
-static unsigned long XAAOverlayGeneration = 0;
-
-#define GET_OVERLAY_PRIV(pScreen) \
- ((XAAOverlayPtr)((pScreen)->devPrivates[XAAOverlayIndex].ptr))
-
-#define SWITCH_DEPTH(d) \
- if(pOverPriv->currentDepth != d) { \
- (*pOverPriv->callback)(pOverPriv->pScrn, d); \
- pOverPriv->currentDepth = d; \
- }
-
-
-Bool
-XAAInitDualFramebufferOverlay(
- ScreenPtr pScreen,
- DepthChangeFuncPtr callback
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAOverlayPtr pOverPriv;
-
- if (XAAOverlayGeneration != serverGeneration) {
- if((XAAOverlayIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
-
- XAAOverlayGeneration = serverGeneration;
- }
-
-
- if(!(pOverPriv = xalloc(sizeof(XAAOverlayRec))))
- return FALSE;
-
- pScreen->devPrivates[XAAOverlayIndex].ptr = (pointer)pOverPriv;
-
- pOverPriv->pScrn = pScrn;
- pOverPriv->callback = callback;
- pOverPriv->currentDepth = -1;
-
- /* Overwrite key screen functions. The XAA core will clean up */
-
- pScreen->CopyWindow = XAAOverCopyWindow;
- pScreen->PaintWindowBackground = XAAOverPaintWindow;
- pScreen->PaintWindowBorder = XAAOverPaintWindow;
- pScreen->WindowExposures = XAAOverWindowExposures;
- pScreen->BackingStoreFuncs.SaveAreas = XAAOverSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = XAAOverRestoreAreas;
-
- pOverPriv->StippledFillChooser = infoRec->StippledFillChooser;
- pOverPriv->OpaqueStippledFillChooser = infoRec->OpaqueStippledFillChooser;
- pOverPriv->TiledFillChooser = infoRec->TiledFillChooser;
-
- infoRec->StippledFillChooser = XAAOverStippledFillChooser;
- infoRec->OpaqueStippledFillChooser = XAAOverOpaqueStippledFillChooser;
- infoRec->TiledFillChooser = XAAOverTiledFillChooser;
-
- /* wrap all XAA GC rendering */
-
- pOverPriv->CopyArea = infoRec->CopyArea;
- pOverPriv->CopyPlane = infoRec->CopyPlane;
- pOverPriv->PushPixelsSolid = infoRec->PushPixelsSolid;
- pOverPriv->PolyFillRectSolid = infoRec->PolyFillRectSolid;
- pOverPriv->PolyFillRectStippled = infoRec->PolyFillRectStippled;
- pOverPriv->PolyFillRectOpaqueStippled = infoRec->PolyFillRectOpaqueStippled;
- pOverPriv->PolyFillRectTiled = infoRec->PolyFillRectTiled;
- pOverPriv->FillSpansSolid = infoRec->FillSpansSolid;
- pOverPriv->FillSpansStippled = infoRec->FillSpansStippled;
- pOverPriv->FillSpansOpaqueStippled = infoRec->FillSpansOpaqueStippled;
- pOverPriv->FillSpansTiled = infoRec->FillSpansTiled;
- pOverPriv->PolyText8TE = infoRec->PolyText8TE;
- pOverPriv->PolyText16TE = infoRec->PolyText16TE;
- pOverPriv->ImageText8TE = infoRec->ImageText8TE;
- pOverPriv->ImageText16TE = infoRec->ImageText16TE;
- pOverPriv->ImageGlyphBltTE = infoRec->ImageGlyphBltTE;
- pOverPriv->PolyGlyphBltTE = infoRec->PolyGlyphBltTE;
- pOverPriv->PolyText8NonTE = infoRec->PolyText8NonTE;
- pOverPriv->PolyText16NonTE = infoRec->PolyText16NonTE;
- pOverPriv->ImageText8NonTE = infoRec->ImageText8NonTE;
- pOverPriv->ImageText16NonTE = infoRec->ImageText16NonTE;
- pOverPriv->ImageGlyphBltNonTE = infoRec->ImageGlyphBltNonTE;
- pOverPriv->PolyGlyphBltNonTE = infoRec->PolyGlyphBltNonTE;
- pOverPriv->PolyRectangleThinSolid = infoRec->PolyRectangleThinSolid;
- pOverPriv->PolylinesWideSolid = infoRec->PolylinesWideSolid;
- pOverPriv->PolylinesThinSolid = infoRec->PolylinesThinSolid;
- pOverPriv->PolySegmentThinSolid = infoRec->PolySegmentThinSolid;
- pOverPriv->PolylinesThinDashed = infoRec->PolylinesThinDashed;
- pOverPriv->PolySegmentThinDashed = infoRec->PolySegmentThinDashed;
- pOverPriv->FillPolygonSolid = infoRec->FillPolygonSolid;
- pOverPriv->FillPolygonStippled = infoRec->FillPolygonStippled;
- pOverPriv->FillPolygonOpaqueStippled = infoRec->FillPolygonOpaqueStippled;
- pOverPriv->FillPolygonTiled = infoRec->FillPolygonTiled;
- pOverPriv->PolyFillArcSolid = infoRec->PolyFillArcSolid;
- pOverPriv->PutImage = infoRec->PutImage;
-
-
- if(infoRec->CopyArea)
- infoRec->CopyArea = XAAOverCopyArea;
- if(infoRec->CopyPlane)
- infoRec->CopyPlane = XAAOverCopyPlane;
- if(infoRec->PushPixelsSolid)
- infoRec->PushPixelsSolid = XAAOverPushPixelsSolid;
- if(infoRec->PolyFillRectSolid)
- infoRec->PolyFillRectSolid = XAAOverPolyFillRectSolid;
- if(infoRec->PolyFillRectStippled)
- infoRec->PolyFillRectStippled = XAAOverPolyFillRectStippled;
- if(infoRec->PolyFillRectOpaqueStippled)
- infoRec->PolyFillRectOpaqueStippled = XAAOverPolyFillRectOpaqueStippled;
- if(infoRec->PolyFillRectTiled)
- infoRec->PolyFillRectTiled = XAAOverPolyFillRectTiled;
- if(infoRec->FillSpansSolid)
- infoRec->FillSpansSolid = XAAOverFillSpansSolid;
- if(infoRec->FillSpansStippled)
- infoRec->FillSpansStippled = XAAOverFillSpansStippled;
- if(infoRec->FillSpansOpaqueStippled)
- infoRec->FillSpansOpaqueStippled = XAAOverFillSpansOpaqueStippled;
- if(infoRec->FillSpansTiled)
- infoRec->FillSpansTiled = XAAOverFillSpansTiled;
- if(infoRec->PolyText8TE)
- infoRec->PolyText8TE = XAAOverPolyText8TE;
- if(infoRec->PolyText16TE)
- infoRec->PolyText16TE = XAAOverPolyText16TE;
- if(infoRec->ImageText8TE)
- infoRec->ImageText8TE = XAAOverImageText8TE;
- if(infoRec->ImageText16TE)
- infoRec->ImageText16TE = XAAOverImageText16TE;
- if(infoRec->ImageGlyphBltTE)
- infoRec->ImageGlyphBltTE = XAAOverImageGlyphBltTE;
- if(infoRec->PolyGlyphBltTE)
- infoRec->PolyGlyphBltTE = XAAOverPolyGlyphBltTE;
- if(infoRec->PolyText8NonTE)
- infoRec->PolyText8NonTE = XAAOverPolyText8NonTE;
- if(infoRec->PolyText16NonTE)
- infoRec->PolyText16NonTE = XAAOverPolyText16NonTE;
- if(infoRec->ImageText8NonTE)
- infoRec->ImageText8NonTE = XAAOverImageText8NonTE;
- if(infoRec->ImageText16NonTE)
- infoRec->ImageText16NonTE = XAAOverImageText16NonTE;
- if(infoRec->ImageGlyphBltNonTE)
- infoRec->ImageGlyphBltNonTE = XAAOverImageGlyphBltNonTE;
- if(infoRec->PolyGlyphBltNonTE)
- infoRec->PolyGlyphBltNonTE = XAAOverPolyGlyphBltNonTE;
- if(infoRec->PolyRectangleThinSolid)
- infoRec->PolyRectangleThinSolid = XAAOverPolyRectangleThinSolid;
- if(infoRec->PolylinesWideSolid)
- infoRec->PolylinesWideSolid = XAAOverPolylinesWideSolid;
- if(infoRec->PolylinesThinSolid)
- infoRec->PolylinesThinSolid = XAAOverPolylinesThinSolid;
- if(infoRec->PolySegmentThinSolid)
- infoRec->PolySegmentThinSolid = XAAOverPolySegmentThinSolid;
- if(infoRec->PolylinesThinDashed)
- infoRec->PolylinesThinDashed = XAAOverPolylinesThinDashed;
- if(infoRec->PolySegmentThinDashed)
- infoRec->PolySegmentThinDashed = XAAOverPolySegmentThinDashed;
- if(infoRec->FillPolygonSolid)
- infoRec->FillPolygonSolid = XAAOverFillPolygonSolid;
- if(infoRec->FillPolygonStippled)
- infoRec->FillPolygonStippled = XAAOverFillPolygonStippled;
- if(infoRec->FillPolygonOpaqueStippled)
- infoRec->FillPolygonOpaqueStippled = XAAOverFillPolygonOpaqueStippled;
- if(infoRec->FillPolygonTiled)
- infoRec->FillPolygonTiled = XAAOverFillPolygonTiled;
- if(infoRec->PolyFillArcSolid)
- infoRec->PolyFillArcSolid = XAAOverPolyFillArcSolid;
- if(infoRec->PutImage)
- infoRec->PutImage = XAAOverPutImage;
-
- return TRUE;
-}
-
-/*********************** Screen functions ************************/
-
-void
-XAAOverCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
- ScrnInfoPtr pScrn = infoRec->pScrn;
- DDXPointPtr ppt, pptSrc;
- RegionRec rgnDst;
- BoxPtr pbox;
- int i, nbox, dx, dy;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
-
-
- if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
- XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
- if(pScrn->vtSema && infoRec->NeedToSync) {
- (*infoRec->Sync)(pScrn);
- infoRec->NeedToSync = FALSE;
- }
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAAOverCopyWindow);
- return;
- }
-
- infoRec->ScratchGC.alu = GXcopy;
- infoRec->ScratchGC.planemask = ~0;
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(nbox &&
- (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
-
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- SWITCH_DEPTH(8);
- XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
- if(pWin->drawable.bitsPerPixel != 8) {
- SWITCH_DEPTH(pScrn->depth);
- XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
- }
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- REGION_UNINIT(pScreen, &rgnDst);
-
- if(pWin->drawable.depth == 8) {
- REGION_NULL(pScreen, &rgnDst);
- miSegregateChildren(pWin, &rgnDst, pScrn->depth);
- if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
- REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(nbox &&
- (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
-
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- SWITCH_DEPTH(pScrn->depth);
- XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
- DEALLOCATE_LOCAL(pptSrc);
- }
- }
- REGION_UNINIT(pScreen, &rgnDst);
- }
-}
-
-
-static void
-XAAOverPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = infoRec->pScrn;
-
- if(pScrn->vtSema) {
- if(what == PW_BACKGROUND) {
- SWITCH_DEPTH(pWin->drawable.depth);
- (*infoRec->PaintWindowBackground)(pWin, pRegion, what);
- return;
- } else {
- if(pWin->drawable.bitsPerPixel == 8) {
- SWITCH_DEPTH(8);
- (*infoRec->PaintWindowBorder)(pWin, pRegion, what);
- return;
- } else if (infoRec->FillSolidRects) {
- SWITCH_DEPTH(8);
- (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey, GXcopy,
- ~0, REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion));
-
- SWITCH_DEPTH(pWin->drawable.depth);
- (*infoRec->PaintWindowBorder)(pWin, pRegion, what);
- return;
- }
- }
-
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- if(what == PW_BACKGROUND) {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
- (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAOverPaintWindow);
- } else {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
- (*pScreen->PaintWindowBorder) (pWin, pRegion, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAOverPaintWindow);
- }
-}
-
-
-void
-XAAOverWindowExposures(
- WindowPtr pWin,
- RegionPtr pReg,
- RegionPtr pOtherReg
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
- if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
- if(REGION_NUM_RECTS(pReg) && infoRec->FillSolidRects) {
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
-
- SWITCH_DEPTH(8);
- (*infoRec->FillSolidRects)(infoRec->pScrn,
- infoRec->pScrn->colorKey, GXcopy, ~0,
- REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
- miWindowExposures(pWin, pReg, pOtherReg);
- return;
- } else if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- XAA_SCREEN_PROLOGUE (pScreen, WindowExposures);
- (*pScreen->WindowExposures) (pWin, pReg, pOtherReg);
- XAA_SCREEN_EPILOGUE(pScreen, WindowExposures, XAAOverWindowExposures);
-}
-
-
-static void
-XAAOverSaveAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pWin->drawable.pScreen);
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE((DrawablePtr)pWin);
-
- if(pOverPriv->pScrn->vtSema) {
- SWITCH_DEPTH(pWin->drawable.depth);
- }
-
- (*infoRec->SaveAreas)(pPixmap, prgnSave, xorg, yorg, pWin);
-}
-
-
-static void
-XAAOverRestoreAreas (
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pWin->drawable.pScreen);
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE((DrawablePtr)pWin);
-
- if(pOverPriv->pScrn->vtSema) {
- SWITCH_DEPTH(pWin->drawable.depth);
- }
-
- (*infoRec->RestoreAreas)(pPixmap, prgnRestore, xorg, yorg, pWin);
-}
-
-/********************* Choosers *************************/
-
-static int
-XAAOverStippledFillChooser(GCPtr pGC)
-{
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
- int ret;
-
- ret = (*pOverPriv->StippledFillChooser)(pGC);
-
- if((pGC->depth == 8) &&
- ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
- ret = 0;
- }
-
- return ret;
-}
-
-static int
-XAAOverOpaqueStippledFillChooser(GCPtr pGC)
-{
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
- int ret;
-
- ret = (*pOverPriv->OpaqueStippledFillChooser)(pGC);
-
- if((pGC->depth == 8) &&
- ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
- ret = 0;
- }
-
- return ret;
-}
-
-static int
-XAAOverTiledFillChooser(GCPtr pGC)
-{
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
- int ret;
-
- ret = (*pOverPriv->TiledFillChooser)(pGC);
-
- if((pGC->depth == 8) &&
- ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
- ret = 0;
- }
-
- return ret;
-}
-
-
-/**************************** GC Functions **************************/
-
-static RegionPtr
-XAAOverCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
-}
-
-static RegionPtr
-XAAOverCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
-
-}
-
-static void
-XAAOverPushPixelsSolid(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy,
- int xOrg, int yOrg
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PushPixelsSolid)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-}
-
-
-
-static void
-XAAOverPolyFillRectSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyFillRectSolid)(pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverPolyFillRectStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyFillRectStippled)(pDraw, pGC, nrectFill, prectInit);
-}
-
-
-static void
-XAAOverPolyFillRectOpaqueStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyFillRectOpaqueStippled)(pDraw, pGC, nrectFill, prectInit);
-}
-
-static void
-XAAOverPolyFillRectTiled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyFillRectTiled)(pDraw, pGC, nrectFill, prectInit);
-}
-
-
-static void
-XAAOverFillSpansSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillSpansSolid)(
- pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-
-static void
-XAAOverFillSpansStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillSpansStippled)(pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static void
-XAAOverFillSpansOpaqueStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillSpansOpaqueStippled)(
- pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-
-static void
-XAAOverFillSpansTiled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nInit,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillSpansTiled)(pDraw, pGC, nInit, ppt, pwidth, fSorted);
-}
-
-static int
-XAAOverPolyText8TE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->PolyText8TE)(pDraw, pGC, x, y, count, chars);
-}
-
-
-static int
-XAAOverPolyText16TE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->PolyText16TE)(pDraw, pGC, x, y, count, chars);
-}
-
-
-static void
-XAAOverImageText8TE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageText8TE)(pDraw, pGC, x, y, count, chars);
-}
-
-
-static void
-XAAOverImageText16TE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageText16TE)(pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageGlyphBltTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageGlyphBltTE)(
- pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAOverPolyGlyphBltTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyGlyphBltTE)(
- pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
-}
-
-static int
-XAAOverPolyText8NonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->PolyText8NonTE)(pDraw, pGC, x, y, count, chars);
-}
-
-
-static int
-XAAOverPolyText16NonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- return (*pOverPriv->PolyText16NonTE)(pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText8NonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageText8NonTE)(pDraw, pGC, x, y, count, chars);
-}
-
-static void
-XAAOverImageText16NonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageText16NonTE)(pDraw, pGC, x, y, count, chars);
-}
-
-
-static void
-XAAOverImageGlyphBltNonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->ImageGlyphBltNonTE)(
- pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAOverPolyGlyphBltNonTE(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyGlyphBltNonTE)(
- pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
-}
-
-static void
-XAAOverPolyRectangleThinSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyRectangleThinSolid)(pDraw, pGC, nRectsInit, pRectsInit);
-}
-
-
-
-static void
-XAAOverPolylinesWideSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolylinesWideSolid)(pDraw, pGC, mode, npt, pPts);
-}
-
-
-static void
-XAAOverPolylinesThinSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolylinesThinSolid)(pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-XAAOverPolySegmentThinSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolySegmentThinSolid)(pDraw, pGC, nseg, pSeg);
-}
-
-static void
-XAAOverPolylinesThinDashed(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolylinesThinDashed)(pDraw, pGC, mode, npt, pPts);
-}
-
-static void
-XAAOverPolySegmentThinDashed(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolySegmentThinDashed)(pDraw, pGC, nseg, pSeg);
-}
-
-
-static void
-XAAOverFillPolygonSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillPolygonSolid)(pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAOverFillPolygonStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillPolygonStippled)(pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-
-static void
-XAAOverFillPolygonOpaqueStippled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillPolygonOpaqueStippled)(
- pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-static void
-XAAOverFillPolygonTiled(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->FillPolygonTiled)(pDraw, pGC, shape, mode, count, ptsIn);
-}
-
-
-static void
-XAAOverPolyFillArcSolid(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PolyFillArcSolid)(pDraw, pGC, narcs, parcs);
-}
-
-
-static void
-XAAOverPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage
-){
- XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
-
- SWITCH_DEPTH(pGC->depth);
-
- (*pOverPriv->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
-}
-
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
deleted file mode 100644
index c7756ba93..000000000
--- a/hw/xfree86/xaa/xaaPCache.c
+++ /dev/null
@@ -1,2372 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.33 2003/11/03 05:11:54 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "gc.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "regionstr.h"
-#include "servermd.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaacexp.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-
-#define MAX_COLOR 32
-#define MAX_MONO 32
-#define MAX_8 32
-#define MAX_128 32
-#define MAX_256 32
-#define MAX_512 16
-
-static int CacheInitIndex = -1;
-#define CACHEINIT(p) ((p)->privates[CacheInitIndex].val)
-
-
-typedef struct _CacheLink {
- int x;
- int y;
- int w;
- int h;
- struct _CacheLink *next;
-} CacheLink, *CacheLinkPtr;
-
-
-static void
-TransferList(CacheLinkPtr list, XAACacheInfoPtr array, int num)
-{
- while(num--) {
- array->x = list->x;
- array->y = list->y;
- array->w = list->w;
- array->h = list->h;
- array->serialNumber = 0;
- array->fg = array->bg = -1;
- list = list->next;
- array++;
- }
-}
-
-
-
-static CacheLinkPtr
-Enlist(CacheLinkPtr link, int x, int y, int w, int h)
-{
- CacheLinkPtr newLink;
-
- newLink = xalloc(sizeof(CacheLink));
- newLink->next = link;
- newLink->x = x; newLink->y = y;
- newLink->w = w; newLink->h = h;
- return newLink;
-}
-
-
-
-static CacheLinkPtr
-Delist(CacheLinkPtr link) {
- CacheLinkPtr ret = NULL;
-
- if(link) {
- ret = link->next;
- xfree(link);
- }
- return ret;
-}
-
-
-
-static void
-FreeList(CacheLinkPtr link) {
- CacheLinkPtr tmp;
-
- while(link) {
- tmp = link;
- link = link->next;
- xfree(tmp);
- }
-}
-
-
-
-static CacheLinkPtr
-QuadLinks(CacheLinkPtr big, CacheLinkPtr little)
-{
- /* CAUTION: This doesn't free big */
- int w1, w2, h1, h2;
-
- while(big) {
- w1 = big->w >> 1;
- w2 = big->w - w1;
- h1 = big->h >> 1;
- h2 = big->h - h1;
-
- little = Enlist(little, big->x, big->y, w1, h1);
- little = Enlist(little, big->x + w1, big->y, w2, h1);
- little = Enlist(little, big->x, big->y + h1, w1, h2);
- little = Enlist(little, big->x + w1, big->y + h1, w2, h2);
-
- big = big->next;
- }
- return little;
-}
-
-
-static void
-SubdivideList(CacheLinkPtr *large, CacheLinkPtr *small)
-{
- CacheLinkPtr big = *large;
- CacheLinkPtr little = *small;
- int size = big->w >> 1;
-
- little = Enlist(little, big->x, big->y, size, size);
- little = Enlist(little, big->x + size, big->y, size, size);
- little = Enlist(little, big->x, big->y + size, size, size);
- little = Enlist(little, big->x + size, big->y + size, size, size);
- *small = little;
- big = Delist(big);
- *large = big;
-}
-
-static void
-FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv)
-{
- if(!pPriv) return;
-
- if(pPriv->Info512)
- xfree(pPriv->Info512);
- if(pPriv->Info256)
- xfree(pPriv->Info256);
- if(pPriv->Info128)
- xfree(pPriv->Info128);
- if(pPriv->InfoColor)
- xfree(pPriv->InfoColor);
- if(pPriv->InfoMono)
- xfree(pPriv->InfoMono);
- if(pPriv->InfoPartial)
- xfree(pPriv->InfoPartial);
-
- xfree(pPriv);
-}
-
-void
-XAAClosePixmapCache(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
- if(infoRec->PixmapCachePrivate)
- FreePixmapCachePrivate(
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate);
-
- infoRec->PixmapCachePrivate = NULL;
-}
-
-
-
-static CacheLinkPtr
-ThinOutPartials(
- CacheLinkPtr ListPartial,
- int *num, int *maxw, int *maxh
-) {
-/* This guy's job is to get at least 4 big slots out of a list of fragments */
-
- CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
- int Num64, Num32, Num16, Num8, NumKeepers;
- int w, h;
-
- List64 = List32 = List16 = List8 = ListKeepers = NULL;
- Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
- w = h = 0;
-
- /* We sort partials by how large a square tile they can cache.
- If a partial can't store a 64x64, 32x32, 16x16 or 8x8 tile,
- we free it. */
-
- pCur = ListPartial;
- while(pCur) {
- next = pCur->next;
- if((pCur->w >= 64) && (pCur->h >= 64)) {
- pCur->next = List64; List64 = pCur;
- Num64++;
- } else
- if((pCur->w >= 32) && (pCur->h >= 32)) {
- pCur->next = List32; List32 = pCur;
- Num32++;
- } else
- if((pCur->w >= 16) && (pCur->h >= 16)) {
- pCur->next = List16; List16 = pCur;
- Num16++;
- } else
- if((pCur->w >= 8) && (pCur->h >= 8)) {
- pCur->next = List8; List8 = pCur;
- Num8++;
- } else {
- xfree(pCur);
- }
-
- pCur = next;
- }
-
- /* We save all the tiles from the largest bin that we can get
- at least 4 of. If there are too few of a bigger slot, we
- cut it in fourths to make smaller slots. */
-
- if(Num64 >= 4) {
- ListKeepers = List64; List64 = NULL;
- NumKeepers = Num64;
- goto GOT_EM;
- } else if(Num64) {
- List32 = QuadLinks(List64, List32);
- Num32 += Num64 * 4;
- Num64 = 0;
- }
-
- if(Num32 >= 4) {
- ListKeepers = List32; List32 = NULL;
- NumKeepers = Num32;
- goto GOT_EM;
- } else if(Num32) {
- List16 = QuadLinks(List32, List16);
- Num16 += Num32 * 4;
- Num32 = 0;
- }
-
- if(Num16 >= 4) {
- ListKeepers = List16; List16 = NULL;
- NumKeepers = Num16;
- goto GOT_EM;
- } else if(Num16) {
- List8 = QuadLinks(List16, List8);
- Num8 += Num16 * 4;
- Num16 = 0;
- }
-
- if(Num8 >= 4) {
- ListKeepers = List8; List8 = NULL;
- NumKeepers = Num8;
- goto GOT_EM;
- }
-
-GOT_EM:
-
- /* Free the ones we aren't using */
-
- if(List64) FreeList(List64);
- if(List32) FreeList(List32);
- if(List16) FreeList(List16);
- if(List8) FreeList(List8);
-
-
- /* Enlarge the slots if we can */
-
- if(ListKeepers) {
- CacheLinkPtr pLink = ListKeepers;
- w = h = 128;
-
- while(pLink) {
- if(pLink->w < w) w = pLink->w;
- if(pLink->h < h) h = pLink->h;
- pLink = pLink->next;
- }
- }
-
- *maxw = w;
- *maxh = h;
- *num = NumKeepers;
- return ListKeepers;
-}
-
-static void
-ConvertColorToMono(
- CacheLinkPtr *ColorList,
- int ColorW, int ColorH,
- CacheLinkPtr *MonoList,
- int MonoW, int MonoH
-){
- int x, y, w;
-
- x = (*ColorList)->x; y = (*ColorList)->y;
- *ColorList = Delist(*ColorList);
-
- while(ColorH) {
- ColorH -= MonoH;
- for(w = 0; w <= (ColorW - MonoW); w += MonoW)
- *MonoList = Enlist(*MonoList, x + w, y + ColorH, MonoW, MonoH);
- }
-}
-
-static void
-ConvertAllPartialsTo8x8(
- int *NumMono, int *NumColor,
- CacheLinkPtr ListPartial,
- CacheLinkPtr *ListMono,
- CacheLinkPtr *ListColor,
- XAAInfoRecPtr infoRec
-){
-/* This guy extracts as many 8x8 slots as it can out of fragments */
-
- int ColorH = infoRec->CacheHeightColor8x8Pattern;
- int ColorW = infoRec->CacheWidthColor8x8Pattern;
- int MonoH = infoRec->CacheHeightMono8x8Pattern;
- int MonoW = infoRec->CacheWidthMono8x8Pattern;
- int x, y, w, Height, Width;
- Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
- Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
- CacheLinkPtr pLink = ListPartial;
- CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
-
- if(DoColor && DoMono) {
- /* we assume color patterns take more space than color ones */
- if(MonoH > ColorH) ColorH = MonoH;
- if(MonoW > ColorW) ColorW = MonoW;
- }
-
- /* Break up the area into as many Color and Mono slots as we can */
-
- while(pLink) {
- Height = pLink->h;
- Width = pLink->w;
- x = pLink->x;
- y = pLink->y;
-
- if(DoColor) {
- while(Height >= ColorH) {
- Height -= ColorH;
- for(w = 0; w <= (Width - ColorW); w += ColorW) {
- ColorList = Enlist(
- ColorList, x + w, y + Height, ColorW, ColorH);
- (*NumColor)++;
- }
- }
- }
-
- if(DoMono && (Height >= MonoH)) {
- while(Height >= MonoH) {
- Height -= MonoH;
- for(w = 0; w <= (Width - MonoW); w += MonoW) {
- MonoList = Enlist(
- MonoList, x + w, y + Height, MonoW, MonoH);
- (*NumMono)++;
- }
- }
- }
-
- pLink = pLink->next;
- }
-
-
- *ListMono = MonoList;
- *ListColor = ColorList;
- FreeList(ListPartial);
-}
-
-
-static CacheLinkPtr
-ExtractOneThatFits(CacheLinkPtr *initList, int w, int h)
-{
- CacheLinkPtr list = *initList;
- CacheLinkPtr prev = NULL;
-
- while(list) {
- if((list->w >= w) && (list->h >= h))
- break;
- prev = list;
- list = list->next;
- }
-
- if(list) {
- if(prev)
- prev->next = list->next;
- else
- *initList = list->next;
-
- list->next = NULL;
- }
-
- return list;
-}
-
-
-static CacheLinkPtr
-ConvertSomePartialsTo8x8(
- int *NumMono, int *NumColor, int *NumPartial,
- CacheLinkPtr ListPartial,
- CacheLinkPtr *ListMono,
- CacheLinkPtr *ListColor,
- int *maxw, int *maxh,
- XAAInfoRecPtr infoRec
-){
-/* This guy tries to get 4 of each type of 8x8 slot requested out of
- a list of fragments all while trying to retain some big fragments
- for the cache blits */
-
- int ColorH = infoRec->CacheHeightColor8x8Pattern;
- int ColorW = infoRec->CacheWidthColor8x8Pattern;
- int MonoH = infoRec->CacheHeightMono8x8Pattern;
- int MonoW = infoRec->CacheWidthMono8x8Pattern;
- Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
- Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
- CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
- CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
- int Num64, Num32, Num16, Num8, NumKeepers;
- int w, h, Width, Height;
- int MonosPerColor = 1;
-
- if(DoColor && DoMono) {
- /* we assume color patterns take more space than color ones */
- if(MonoH > ColorH) ColorH = MonoH;
- if(MonoW > ColorW) ColorW = MonoW;
- MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
- }
-
- List64 = List32 = List16 = List8 = ListKeepers = MonoList = ColorList = NULL;
- Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
- Width = Height = 0;
-
- /* We sort partials by how large a square tile they can cache.
- We make 8x8 patterns from the leftovers if we can. */
-
- pCur = ListPartial;
- while(pCur) {
- next = pCur->next;
- if((pCur->w >= 64) && (pCur->h >= 64)) {
- pCur->next = List64; List64 = pCur;
- Num64++;
- } else
- if((pCur->w >= 32) && (pCur->h >= 32)) {
- pCur->next = List32; List32 = pCur;
- Num32++;
- } else
- if((pCur->w >= 16) && (pCur->h >= 16)) {
- pCur->next = List16; List16 = pCur;
- Num16++;
- } else
- if((pCur->w >= 8) && (pCur->h >= 8)) {
- pCur->next = List8; List8 = pCur;
- Num8++;
- } else {
- h = pCur->h;
- if(DoColor && (pCur->w >= ColorW) && (h >= ColorH)) {
- while(h >= ColorH) {
- h -= ColorH;
- for(w = 0; w <= (pCur->w - ColorW); w += ColorW) {
- ColorList = Enlist( ColorList,
- pCur->x + w, pCur->y + h, ColorW, ColorH);
- (*NumColor)++;
- }
- }
- }
- if(DoMono && (pCur->w >= MonoW) && (h >= MonoH)) {
- while(h >= MonoH) {
- h -= MonoH;
- for(w = 0; w <= (pCur->w - MonoW); w += MonoW) {
- MonoList = Enlist( MonoList,
- pCur->x + w, pCur->y + h, MonoW, MonoH);
- (*NumMono)++;
- }
- }
- }
- xfree(pCur);
- }
-
- pCur = next;
- }
-
- /* Try to extract at least 4 of each type of 8x8 slot that we need */
-
- if(DoColor) {
- CacheLinkPtr theOne;
- while(*NumColor < 4) {
- theOne = NULL;
- if(Num8) {
- if((theOne = ExtractOneThatFits(&List8, ColorW, ColorH)))
- Num8--;
- }
- if(Num16 && !theOne) {
- if((theOne = ExtractOneThatFits(&List16, ColorW, ColorH)))
- Num16--;
- }
- if(Num32 && !theOne) {
- if((theOne = ExtractOneThatFits(&List32, ColorW, ColorH)))
- Num32--;
- }
- if(Num64 && !theOne) {
- if((theOne = ExtractOneThatFits(&List64, ColorW, ColorH)))
- Num64--;
- }
-
- if(!theOne) break;
-
-
- ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
- &MonoList, &ColorList, infoRec);
-
- if(DoMono) {
- while(*NumColor && (*NumMono < 4)) {
- ConvertColorToMono(&ColorList, ColorW, ColorH,
- &MonoList, MonoW, MonoH);
- (*NumColor)--; *NumMono += MonosPerColor;
- }
- }
- }
- }
-
- if(DoMono) {
- CacheLinkPtr theOne;
- while(*NumMono < 4) {
- theOne = NULL;
- if(Num8) {
- if((theOne = ExtractOneThatFits(&List8, MonoW, MonoH)))
- Num8--;
- }
- if(Num16 && !theOne) {
- if((theOne = ExtractOneThatFits(&List16, MonoW, MonoH)))
- Num16--;
- }
- if(Num32 && !theOne) {
- if((theOne = ExtractOneThatFits(&List32, MonoW, MonoH)))
- Num32--;
- }
- if(Num64 && !theOne) {
- if((theOne = ExtractOneThatFits(&List64, MonoW, MonoH)))
- Num64--;
- }
-
- if(!theOne) break;
-
- ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
- &MonoList, &ColorList, infoRec);
- }
- }
-
- /* We save all the tiles from the largest bin that we can get
- at least 4 of. If there are too few of a bigger slot, we
- cut it in fourths to make smaller slots. */
-
- if(Num64 >= 4) {
- ListKeepers = List64; List64 = NULL;
- NumKeepers = Num64;
- goto GOT_EM;
- } else if(Num64) {
- List32 = QuadLinks(List64, List32);
- Num32 += Num64 * 4;
- Num64 = 0;
- }
-
- if(Num32 >= 4) {
- ListKeepers = List32; List32 = NULL;
- NumKeepers = Num32;
- goto GOT_EM;
- } else if(Num32) {
- List16 = QuadLinks(List32, List16);
- Num16 += Num32 * 4;
- Num32 = 0;
- }
-
- if(Num16 >= 4) {
- ListKeepers = List16; List16 = NULL;
- NumKeepers = Num16;
- goto GOT_EM;
- } else if(Num16) {
- List8 = QuadLinks(List16, List8);
- Num8 += Num16 * 4;
- Num16 = 0;
- }
-
- if(Num8 >= 4) {
- ListKeepers = List8; List8 = NULL;
- NumKeepers = Num8;
- goto GOT_EM;
- }
-
-GOT_EM:
-
- /* Free the ones we aren't using */
-
- if(List64)
- ConvertAllPartialsTo8x8(NumMono, NumColor, List64,
- &MonoList, &ColorList, infoRec);
- if(List32)
- ConvertAllPartialsTo8x8(NumMono, NumColor, List32,
- &MonoList, &ColorList, infoRec);
- if(List16)
- ConvertAllPartialsTo8x8(NumMono, NumColor, List16,
- &MonoList, &ColorList, infoRec);
- if(List8)
- ConvertAllPartialsTo8x8(NumMono, NumColor, List8,
- &MonoList, &ColorList, infoRec);
-
-
- /* Enlarge the slots if we can */
-
- if(ListKeepers) {
- CacheLinkPtr pLink = ListKeepers;
- Width = Height = 128;
-
- while(pLink) {
- if(pLink->w < Width) Width = pLink->w;
- if(pLink->h < Height) Height = pLink->h;
- pLink = pLink->next;
- }
- }
-
- *ListMono = MonoList;
- *ListColor = ColorList;
- *maxw = Width;
- *maxh = Height;
- *NumPartial = NumKeepers;
- return ListKeepers;
-}
-
-
-void
-XAAInitPixmapCache(
- ScreenPtr pScreen,
- RegionPtr areas,
- pointer data
-) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAInfoRecPtr infoRec = (XAAInfoRecPtr)data;
- XAAPixmapCachePrivatePtr pCachePriv;
- BoxPtr pBox = REGION_RECTS(areas);
- int nBox = REGION_NUM_RECTS(areas);
- int Num512, Num256, Num128, NumPartial, NumColor, NumMono;
- int Target512, Target256;
- CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono;
- int x, y, w, h, ntotal, granularity, width, height, i;
- int MaxPartialWidth, MaxPartialHeight;
-
- infoRec->MaxCacheableTileWidth = 0;
- infoRec->MaxCacheableTileHeight = 0;
- infoRec->MaxCacheableStippleHeight = 0;
- infoRec->MaxCacheableStippleWidth = 0;
- infoRec->UsingPixmapCache = FALSE;
-
-
- if(!nBox || !pBox || !(infoRec->Flags & PIXMAP_CACHE))
- return;
-
- /* Allocate a persistent per-screen init flag to control messages */
- if (CacheInitIndex < 0)
- CacheInitIndex = xf86AllocateScrnInfoPrivateIndex();
-
- /* free the old private data if it exists */
- if(infoRec->PixmapCachePrivate) {
- FreePixmapCachePrivate(
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate);
- infoRec->PixmapCachePrivate = NULL;
- }
-
- Num512 = Num256 = Num128 = NumPartial = NumMono = NumColor = 0;
- List512 = List256 = List128 = ListPartial = ListMono = ListColor = NULL;
- granularity = infoRec->CachePixelGranularity;
- if(granularity <= 1) granularity = 0;
-
- /* go through the boxes and break it into as many pieces as we can fit */
-
- while(nBox--) {
- x = pBox->x1;
- if(granularity) {
- int tmp = x % granularity;
- if(tmp) x += (granularity - tmp);
- }
- width = pBox->x2 - x;
- if(width <= 0) {pBox++; continue;}
-
- y = pBox->y1;
- height = pBox->y2 - y;
-
- for(h = 0; h <= (height - 512); h += 512) {
- for(w = 0; w <= (width - 512); w += 512) {
- List512 = Enlist(List512, x + w, y + h, 512, 512);
- Num512++;
- }
- for(; w <= (width - 256); w += 256) {
- List256 = Enlist(List256, x + w, y + h, 256, 256);
- List256 = Enlist(List256, x + w, y + h + 256, 256, 256);
- Num256 += 2;
- }
- for(; w <= (width - 128); w += 128) {
- List128 = Enlist(List128, x + w, y + h, 128, 128);
- List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
- List128 = Enlist(List128, x + w, y + h + 256, 128, 128);
- List128 = Enlist(List128, x + w, y + h + 384, 128, 128);
- Num128 += 4;
- }
- if(w < width) {
- int d = width - w;
- ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
- ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
- ListPartial = Enlist(ListPartial, x + w, y + h + 256, d, 128);
- ListPartial = Enlist(ListPartial, x + w, y + h + 384, d, 128);
- NumPartial += 4;
- }
- }
- for(; h <= (height - 256); h += 256) {
- for(w = 0; w <= (width - 256); w += 256) {
- List256 = Enlist(List256, x + w, y + h, 256, 256);
- Num256++;
- }
- for(; w <= (width - 128); w += 128) {
- List128 = Enlist(List128, x + w, y + h, 128, 128);
- List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
- Num128 += 2;
- }
- if(w < width) {
- int d = width - w;
- ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
- ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
- NumPartial += 2;
- }
- }
- for(; h <= (height - 128); h += 128) {
- for(w = 0; w <= (width - 128); w += 128) {
- List128 = Enlist(List128, x + w, y + h, 128, 128);
- Num128++;
- }
- if(w < width) {
- ListPartial = Enlist(
- ListPartial, x + w, y + h, width - w, 128);
- NumPartial++;
- }
- }
- if(h < height) {
- int d = height - h;
- for(w = 0; w <= (width - 128); w += 128) {
- ListPartial = Enlist(ListPartial, x + w, y + h, 128, d);
- NumPartial++;
- }
- if(w < width) {
- ListPartial = Enlist(ListPartial, x + w, y + h, width - w, d);
- NumPartial++;
- }
- }
- pBox++;
- }
-
-
-/*
- by this point we've carved the space into as many 512x512, 256x256
- and 128x128 blocks as we could fit. We will then break larger
- blocks into smaller ones if we need to. The rules are as follows:
-
- 512x512 -
- 1) Don't take up more than half the memory.
- 2) Don't bother if you can't get at least four.
- 3) Don't make more than MAX_512.
- 4) Don't have any of there are no 256x256s.
-
- 256x256 -
- 1) Don't take up more than a quarter of the memory enless there
- aren't any 512x512s. Then we can take up to half.
- 2) Don't bother if you can't get at least four.
- 3) Don't make more than MAX_256.
-
- 128x128 -
- 1) Don't make more than MAX_128.
-
- We don't bother with the partial blocks unless we can use them
- for 8x8 pattern fills or we are short on larger blocks.
-
-*/
-
- ntotal = Num128 + (Num256<<2) + (Num512<<4);
-
- Target512 = ntotal >> 5;
- if(Target512 < 4) Target512 = 0;
- if(!Target512) Target256 = ntotal >> 3;
- else Target256 = ntotal >> 4;
- if(Target256 < 4) Target256 = 0;
-
- if(Num512 && Num256 < 4) {
- while(Num512 && Num256 < Target256) {
- SubdivideList(&List512, &List256);
- Num256 += 4; Num512--;
- }
- }
-
- if(!Num512) { /* no room */
- } else if((Num512 < 4) || (!Target512)) {
- while(Num512) {
- SubdivideList(&List512, &List256);
- Num256 += 4; Num512--;
- }
- } else if((Num512 > MAX_512) || (Num512 > Target512)){
- while(Num512 > MAX_512) {
- SubdivideList(&List512, &List256);
- Num256 += 4; Num512--;
- }
- while(Num512 > Target512) {
- if(Num256 < MAX_256) {
- SubdivideList(&List512, &List256);
- Num256 += 4; Num512--;
- } else break;
- }
- }
-
- if(!Num256) { /* no room */
- } else if((Num256 < 4) || (!Target256)) {
- while(Num256) {
- SubdivideList(&List256, &List128);
- Num128 += 4; Num256--;
- }
- } else if((Num256 > MAX_256) || (Num256 > Target256)) {
- while(Num256 > MAX_256) {
- SubdivideList(&List256, &List128);
- Num128 += 4; Num256--;
- }
- while(Num256 > Target256) {
- if(Num128 < MAX_128) {
- SubdivideList(&List256, &List128);
- Num128 += 4; Num256--;
- } else break;
- }
- }
-
- if(Num128 && ((Num128 < 4) || (Num128 > MAX_128))) {
- CacheLinkPtr next;
- int max = (Num128 > MAX_128) ? MAX_128 : 0;
-
- /*
- * Note: next is set in this way to work around a code generation
- * bug in gcc 2.7.2.3.
- */
- next = List128->next;
- while(Num128 > max) {
- List128->next = ListPartial;
- ListPartial = List128;
- if((List128 = next))
- next = List128->next;
- NumPartial++; Num128--;
- }
- }
-
- MaxPartialHeight = MaxPartialWidth = 0;
-
- /* at this point we have as many 512x512 and 256x256 slots as we
- want but may have an excess of 128x128 slots. We still need
- to find out if we need 8x8 slots. We take these from the
- partials if we have them. Otherwise, we break some 128x128's */
-
- if(!(infoRec->PixmapCacheFlags & (CACHE_MONO_8x8 | CACHE_COLOR_8x8))) {
- if(NumPartial) {
- if(Num128) { /* don't bother with partials */
- FreeList(ListPartial);
- NumPartial = 0; ListPartial = NULL;
- } else {
- /* We have no big slots. Weed out the unusable partials */
- ListPartial = ThinOutPartials(ListPartial, &NumPartial,
- &MaxPartialWidth, &MaxPartialHeight);
- }
- }
- } else {
- int MonosPerColor = 1;
- int ColorH = infoRec->CacheHeightColor8x8Pattern;
- int ColorW = infoRec->CacheWidthColor8x8Pattern;
- int MonoH = infoRec->CacheHeightMono8x8Pattern;
- int MonoW = infoRec->CacheWidthMono8x8Pattern;
- Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
- Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
-
- if(DoColor) infoRec->CanDoColor8x8 = FALSE;
- if(DoMono) infoRec->CanDoMono8x8 = FALSE;
-
- if(DoColor && DoMono) {
- /* we assume color patterns take more space than color ones */
- if(MonoH > ColorH) ColorH = MonoH;
- if(MonoW > ColorW) ColorW = MonoW;
- MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
- }
-
- if(Num128) {
- if(NumPartial) { /* use all for 8x8 slots */
- ConvertAllPartialsTo8x8(&NumMono, &NumColor,
- ListPartial, &ListMono, &ListColor, infoRec);
- NumPartial = 0; ListPartial = NULL;
- }
-
- /* Get some 8x8 slots from the 128 slots */
- while((Num128 > 4) &&
- ((NumMono < MAX_MONO) && (NumColor < MAX_COLOR))) {
- CacheLinkPtr tmp = NULL;
-
- tmp = Enlist(tmp, List128->x, List128->y,
- List128->w, List128->h);
- List128 = Delist(List128);
- Num128--;
-
- ConvertAllPartialsTo8x8(&NumMono, &NumColor,
- tmp, &ListMono, &ListColor, infoRec);
- }
- } else if(NumPartial) {
- /* We have share partials between 8x8 slots and tiles. */
- ListPartial = ConvertSomePartialsTo8x8(&NumMono, &NumColor,
- &NumPartial, ListPartial, &ListMono, &ListColor,
- &MaxPartialWidth, &MaxPartialHeight, infoRec);
- }
-
-
- if(DoMono && DoColor) {
- if(NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
- int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
-
- while(NumColor > max) {
- ConvertColorToMono(&ListColor, ColorW, ColorH,
- &ListMono, MonoW, MonoH);
- NumColor--; NumMono += MonosPerColor;
- }
- }
-
- /* favor Mono slots over Color ones */
- while((NumColor > 4) && (NumMono < MAX_MONO)) {
- ConvertColorToMono(&ListColor, ColorW, ColorH,
- &ListMono, MonoW, MonoH);
- NumColor--; NumMono += MonosPerColor;
- }
- }
-
- if(NumMono && ((NumMono > MAX_MONO) || (NumMono < 4))) {
- int max = (NumMono > MAX_MONO) ? MAX_MONO : 0;
-
- while(NumMono > max) {
- ListMono = Delist(ListMono);
- NumMono--;
- }
- }
- if(NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
- int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
-
- while(NumColor > max) {
- ListColor = Delist(ListColor);
- NumColor--;
- }
- }
- }
-
-
- pCachePriv = xcalloc(1,sizeof(XAAPixmapCachePrivate));
- if(!pCachePriv) {
- if(Num512) FreeList(List512);
- if(Num256) FreeList(List256);
- if(Num128) FreeList(List128);
- if(NumPartial) FreeList(ListPartial);
- if(NumColor) FreeList(ListColor);
- if(NumMono) FreeList(ListMono);
- return;
- }
-
- infoRec->PixmapCachePrivate = (char*)pCachePriv;
-
- if(Num512) {
- pCachePriv->Info512 = xcalloc(Num512,sizeof(XAACacheInfoRec));
- if(!pCachePriv->Info512) Num512 = 0;
- if(Num512) TransferList(List512, pCachePriv->Info512, Num512);
- FreeList(List512);
- pCachePriv->Num512x512 = Num512;
- }
- if(Num256) {
- pCachePriv->Info256 = xcalloc(Num256, sizeof(XAACacheInfoRec));
- if(!pCachePriv->Info256) Num256 = 0;
- if(Num256) TransferList(List256, pCachePriv->Info256, Num256);
- FreeList(List256);
- pCachePriv->Num256x256 = Num256;
- }
- if(Num128) {
- pCachePriv->Info128 = xcalloc(Num128, sizeof(XAACacheInfoRec));
- if(!pCachePriv->Info128) Num128 = 0;
- if(Num128) TransferList(List128, pCachePriv->Info128, Num128);
- FreeList(List128);
- pCachePriv->Num128x128 = Num128;
- }
-
- if(NumPartial) {
- pCachePriv->InfoPartial = xcalloc(NumPartial, sizeof(XAACacheInfoRec));
- if(!pCachePriv->InfoPartial) NumPartial = 0;
- if(NumPartial)
- TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial);
- FreeList(ListPartial);
- pCachePriv->NumPartial = NumPartial;
- }
-
- if(NumColor) {
- pCachePriv->InfoColor = xcalloc(NumColor, sizeof(XAACacheInfoRec));
- if(!pCachePriv->InfoColor) NumColor = 0;
- if(NumColor) TransferList(ListColor, pCachePriv->InfoColor, NumColor);
- FreeList(ListColor);
- pCachePriv->NumColor = NumColor;
- }
-
- if(NumMono) {
- pCachePriv->InfoMono = xcalloc(NumMono, sizeof(XAACacheInfoRec));
- if(!pCachePriv->InfoMono) NumMono = 0;
- if(NumMono) TransferList(ListMono, pCachePriv->InfoMono, NumMono);
- FreeList(ListMono);
- pCachePriv->NumMono = NumMono;
- }
-
-
- if(NumPartial) {
- infoRec->MaxCacheableTileWidth = MaxPartialWidth;
- infoRec->MaxCacheableTileHeight = MaxPartialHeight;
- }
- if(Num128)
- infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 128;
- if(Num256)
- infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 256;
- if(Num512)
- infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 512;
-
-
- infoRec->MaxCacheableStippleHeight = infoRec->MaxCacheableTileHeight;
- infoRec->MaxCacheableStippleWidth =
- infoRec->MaxCacheableTileWidth * pScrn->bitsPerPixel;
- if(infoRec->ScreenToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP)
- infoRec->MaxCacheableStippleWidth /= 3;
-
- if(NumMono) {
- if(!(infoRec->Mono8x8PatternFillFlags &
- (HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
- HARDWARE_PATTERN_PROGRAMMED_BITS))) {
- int numPerLine =
- infoRec->CacheWidthMono8x8Pattern/infoRec->MonoPatternPitch;
-
- for(i = 0; i < 64; i++) {
- pCachePriv->MonoOffsets[i].y = i/numPerLine;
- pCachePriv->MonoOffsets[i].x = (i % numPerLine) *
- infoRec->MonoPatternPitch;
- }
- }
- infoRec->CanDoMono8x8 = TRUE;
- }
- if(NumColor) {
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
-
- for(i = 0; i < 64; i++) {
- pCachePriv->ColorOffsets[i].y = i & 0x07;
- pCachePriv->ColorOffsets[i].x = i & ~0x07;
- }
- }
- infoRec->CanDoColor8x8 = TRUE;
- }
-
- if(!CACHEINIT(pScrn)) {
- xf86ErrorF("\tSetting up tile and stipple cache:\n");
- if(NumPartial)
- xf86ErrorF("\t\t%i %ix%i slots\n",
- NumPartial, MaxPartialWidth, MaxPartialHeight);
- if(Num128) xf86ErrorF("\t\t%i 128x128 slots\n", Num128);
- if(Num256) xf86ErrorF("\t\t%i 256x256 slots\n", Num256);
- if(Num512) xf86ErrorF("\t\t%i 512x512 slots\n", Num512);
- if(NumColor) xf86ErrorF("\t\t%i 8x8 color pattern slots\n", NumColor);
- if(NumMono) xf86ErrorF("\t\t%i 8x8 color expansion slots\n", NumMono);
- }
-
- if(!(NumPartial | Num128 | Num256 | Num512 | NumColor | NumMono)) {
- if(!CACHEINIT(pScrn))
- xf86ErrorF("\t\tNot enough video memory for pixmap cache\n");
- } else infoRec->UsingPixmapCache = TRUE;
-
- CACHEINIT(pScrn) = 1;
-}
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-static CARD32 StippleMasks[4] = {
- 0x80808080,
- 0xC0C0C0C0,
- 0x00000000,
- 0xF0F0F0F0
-};
-#else
-static CARD32 StippleMasks[4] = {
- 0x01010101,
- 0x03030303,
- 0x00000000,
- 0x0F0F0F0F
-};
-#endif
-
-Bool
-XAACheckStippleReducibility(PixmapPtr pPixmap)
-{
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
- CARD32 *IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
- int w = pPixmap->drawable.width;
- int h = pPixmap->drawable.height;
- int i;
- CARD32 bits[8];
- CARD32 mask = SHIFT_R(0xFFFFFFFF,24);
-
- pPriv->flags |= REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR;
- pPriv->flags &= ~REDUCIBLE_TO_8x8;
-
- if((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
- return FALSE;
-
- i = (h > 8) ? 8 : h;
-
- switch(w) {
- case 32:
- while(i--) {
- bits[i] = IntPtr[i] & mask;
- if( (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 8)), 8)) ||
- (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask,16)),16)) ||
- (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask,24)),24)))
- return FALSE;
- }
- break;
- case 16:
- while(i--) {
- bits[i] = IntPtr[i] & mask;
- if(bits[i] != ((IntPtr[i] & SHIFT_R(SHIFT_L(mask,8),8))))
- return FALSE;
- }
- break;
- default:
- while(i--)
- bits[i] = IntPtr[i] & mask;
- break;
- }
-
- switch(h) {
- case 32:
- if( (IntPtr[8] != IntPtr[16]) || (IntPtr[9] != IntPtr[17]) ||
- (IntPtr[10] != IntPtr[18]) || (IntPtr[11] != IntPtr[19]) ||
- (IntPtr[12] != IntPtr[20]) || (IntPtr[13] != IntPtr[21]) ||
- (IntPtr[14] != IntPtr[22]) || (IntPtr[15] != IntPtr[23]) ||
- (IntPtr[16] != IntPtr[24]) || (IntPtr[17] != IntPtr[25]) ||
- (IntPtr[18] != IntPtr[26]) || (IntPtr[19] != IntPtr[27]) ||
- (IntPtr[20] != IntPtr[28]) || (IntPtr[21] != IntPtr[29]) ||
- (IntPtr[22] != IntPtr[30]) || (IntPtr[23] != IntPtr[31]))
- return FALSE;
- /* fall through */
- case 16:
- if( (IntPtr[0] != IntPtr[8]) || (IntPtr[1] != IntPtr[9]) ||
- (IntPtr[2] != IntPtr[10]) || (IntPtr[3] != IntPtr[11]) ||
- (IntPtr[4] != IntPtr[12]) || (IntPtr[5] != IntPtr[13]) ||
- (IntPtr[6] != IntPtr[14]) || (IntPtr[7] != IntPtr[15]))
- return FALSE;
- case 8: break;
- case 1: bits[1] = bits[0];
- case 2: bits[2] = bits[0]; bits[3] = bits[1];
- case 4: bits[4] = bits[0]; bits[5] = bits[1];
- bits[6] = bits[2]; bits[7] = bits[3];
- break;
- }
-
- pPriv->flags |= REDUCIBLE_TO_8x8;
-
- pPriv->pattern0 = bits[0] | SHIFT_L(bits[1],8) | SHIFT_L(bits[2],16) | SHIFT_L(bits[3],24);
- pPriv->pattern1 = bits[4] | SHIFT_L(bits[5],8) | SHIFT_L(bits[6],16) | SHIFT_L(bits[7],24);
-
- if(w < 8) {
- pPriv->pattern0 &= StippleMasks[w - 1];
- pPriv->pattern1 &= StippleMasks[w - 1];
-
- switch(w) {
- case 1: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,1);
- pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,1);
- case 2: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,2);
- pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,2);
- case 4: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,4);
- pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,4);
- }
- }
-
- if(infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
- pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
- pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
- }
-
-
- return TRUE;
-}
-
-
-Bool
-XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono)
-{
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
- CARD32 *IntPtr;
- int w = pPixmap->drawable.width;
- int h = pPixmap->drawable.height;
- int pitch = pPixmap->devKind >> 2;
- int dwords, i, j;
-
- pPriv->flags |= REDUCIBILITY_CHECKED;
- pPriv->flags &= ~(REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR);
-
- if((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
- return FALSE;
-
- dwords = ((w * pPixmap->drawable.bitsPerPixel) + 31) >> 5;
- i = (h > 8) ? 8 : h;
-
-
- if(w > 8) {
- IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
- switch(pPixmap->drawable.bitsPerPixel) {
- case 8:
- while(i--) {
- for(j = 2; j < dwords; j++)
- if(IntPtr[j] != IntPtr[j & 0x01])
- return FALSE;
- IntPtr += pitch;
- }
- break;
- case 16:
- while(i--) {
- for(j = 4; j < dwords; j++)
- if(IntPtr[j] != IntPtr[j & 0x03])
- return FALSE;
- IntPtr += pitch;
- }
- break;
- case 24:
- while(i--) {
- for(j = 6; j < dwords; j++)
- if(IntPtr[j] != IntPtr[j % 6])
- return FALSE;
- IntPtr += pitch;
- }
- break;
- case 32:
- while(i--) {
- for(j = 8; j < dwords; j++)
- if(IntPtr[j] != IntPtr[j & 0x07])
- return FALSE;
- IntPtr += pitch;
- }
- break;
- default: return FALSE;
- }
-
- }
-
-
- if(h == 32) {
- CARD32 *IntPtr2, *IntPtr3, *IntPtr4;
- i = 8;
- IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
- IntPtr2 = IntPtr + (pitch << 3);
- IntPtr3 = IntPtr2 + (pitch << 3);
- IntPtr4 = IntPtr3 + (pitch << 3);
- while(i--) {
- for(j = 0; j < dwords; j++)
- if((IntPtr[j] != IntPtr2[j]) || (IntPtr[j] != IntPtr3[j]) ||
- (IntPtr[j] != IntPtr4[j]))
- return FALSE;
- IntPtr += pitch;
- IntPtr2 += pitch;
- IntPtr3 += pitch;
- IntPtr4 += pitch;
- }
- } else if (h == 16) {
- CARD32 *IntPtr2;
- i = 8;
- IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
- IntPtr2 = IntPtr + (pitch << 3);
- while(i--) {
- for(j = 0; j < dwords; j++)
- if(IntPtr[j] != IntPtr2[j])
- return FALSE;
- IntPtr += pitch;
- IntPtr2 += pitch;
- }
- }
-
- pPriv->flags |= REDUCIBLE_TO_8x8;
-
- if(checkMono) {
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
- unsigned char bits[8];
- int fg, bg = -1, x, y;
-
- i = (h > 8) ? 8 : h;
- j = (w > 8) ? 8 : w;
-
- if(pPixmap->drawable.bitsPerPixel == 8) {
- unsigned char *srcp = pPixmap->devPrivate.ptr;
- fg = srcp[0];
- pitch = pPixmap->devKind;
- for(y = 0; y < i; y++) {
- bits[y] = 0;
- for(x = 0; x < j; x++) {
- if(srcp[x] != fg) {
- if(bg == -1) bg = srcp[x];
- else if(bg != srcp[x]) return TRUE;
- } else bits[y] |= 1 << x;
- }
- srcp += pitch;
- }
- } else if(pPixmap->drawable.bitsPerPixel == 16) {
- unsigned short *srcp = (unsigned short*)pPixmap->devPrivate.ptr;
- fg = srcp[0];
- pitch = pPixmap->devKind >> 1;
- for(y = 0; y < i; y++) {
- bits[y] = 0;
- for(x = 0; x < j; x++) {
- if(srcp[x] != fg) {
- if(bg == -1) bg = srcp[x];
- else if(bg != srcp[x]) return TRUE;
- } else bits[y] |= 1 << x;
- }
- srcp += pitch;
- }
- } else if(pPixmap->drawable.bitsPerPixel == 24) {
- CARD32 val;
- unsigned char *srcp = pPixmap->devPrivate.ptr;
- fg = *((CARD32*)srcp) & 0x00FFFFFF;
- pitch = pPixmap->devKind;
- j *= 3;
- for(y = 0; y < i; y++) {
- bits[y] = 0;
- for(x = 0; x < j; x+=3) {
- val = *((CARD32*)(srcp+x)) & 0x00FFFFFF;
- if(val != fg) {
- if(bg == -1) bg = val;
- else if(bg != val)
- return TRUE;
- } else bits[y] |= 1 << (x/3);
- }
- srcp += pitch;
- }
- } else if(pPixmap->drawable.bitsPerPixel == 32) {
- IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
- fg = IntPtr[0];
- for(y = 0; y < i; y++) {
- bits[y] = 0;
- for(x = 0; x < j; x++) {
- if(IntPtr[x] != fg) {
- if(bg == -1) bg = IntPtr[x];
- else if(bg != IntPtr[x]) return TRUE;
- } else bits[y] |= 1 << x;
- }
- IntPtr += pitch;
- }
- } else return TRUE;
-
- pPriv->fg = fg;
- if(bg == -1) pPriv->bg = fg;
- else pPriv->bg = bg;
-
- if(h < 8) {
- switch(h) {
- case 1: bits[1] = bits[0];
- case 2: bits[2] = bits[0]; bits[3] = bits[1];
- case 4: bits[4] = bits[0]; bits[5] = bits[1];
- bits[6] = bits[2]; bits[7] = bits[3];
- break;
- }
- }
-
- pPriv->pattern0 =
- bits[0] | (bits[1]<<8) | (bits[2]<<16) | (bits[3]<<24);
- pPriv->pattern1 =
- bits[4] | (bits[5]<<8) | (bits[6]<<16) | (bits[7]<<24);
-
- if(w < 8) {
- switch(w) {
- case 1: pPriv->pattern0 |= (pPriv->pattern0 << 1);
- pPriv->pattern1 |= (pPriv->pattern1 << 1);
- case 2: pPriv->pattern0 |= (pPriv->pattern0 << 2);
- pPriv->pattern1 |= (pPriv->pattern1 << 2);
- case 4: pPriv->pattern0 |= (pPriv->pattern0 << 4);
- pPriv->pattern1 |= (pPriv->pattern1 << 4);
- }
- }
- pPriv->flags |= REDUCIBLE_TO_2_COLOR;
-
- if(infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
- pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
- pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
- }
-
- }
-
- return TRUE;
-}
-
-
-void XAATileCache(
- ScrnInfoPtr pScrn,
- XAACacheInfoPtr pCache,
- int w, int h
-) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, ~0, -1);
-
- while((w << 1) <= pCache->w) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
- pCache->x + w, pCache->y, w, h);
- w <<= 1;
- }
- if(w != pCache->w) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
- pCache->x + w, pCache->y, pCache->w - w, h);
- w = pCache->w;
- }
-
- while((h << 1) <= pCache->h) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
- pCache->x, pCache->y + h, w, h);
- h <<= 1;
- }
- if(h != pCache->h) {
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
- pCache->x, pCache->y + h, w, pCache->h - h);
- }
- SET_SYNC_FLAG(infoRec);
-}
-
-XAACacheInfoPtr
-XAACacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
- int w = pPix->drawable.width;
- int h = pPix->drawable.height;
- int size = max(w, h);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache, cacheRoot = NULL;
- int i, max = 0;
- int *current;
-
- if(size <= 128) {
- if(pCachePriv->Info128) {
- cacheRoot = pCachePriv->Info128;
- max = pCachePriv->Num128x128;
- current = &pCachePriv->Current128;
- } else {
- cacheRoot = pCachePriv->InfoPartial;
- max = pCachePriv->NumPartial;
- current = &pCachePriv->CurrentPartial;
- }
- } else if(size <= 256) {
- cacheRoot = pCachePriv->Info256;
- max = pCachePriv->Num256x256;
- current = &pCachePriv->Current256;
- } else if(size <= 512) {
- cacheRoot = pCachePriv->Info512;
- max = pCachePriv->Num512x512;
- current = &pCachePriv->Current512;
- } else { /* something's wrong */
- ErrorF("Something's wrong in XAACacheTile()\n");
- return pCachePriv->Info128;
- }
-
- pCache = cacheRoot;
-
- /* lets look for it */
- for(i = 0; i < max; i++, pCache++) {
- if(pCache->serialNumber == pPix->drawable.serialNumber) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
-
- pCache = &cacheRoot[(*current)++];
- if(*current >= max) *current = 0;
-
- pCache->serialNumber = pPix->drawable.serialNumber;
- pCache->trans_color = pCache->bg = pCache->fg = -1;
- pCache->orig_w = w; pCache->orig_h = h;
- (*infoRec->WritePixmapToCache)(
- pScrn, pCache->x, pCache->y, w, h, pPix->devPrivate.ptr,
- pPix->devKind, pPix->drawable.bitsPerPixel, pPix->drawable.depth);
- if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
- ((w != pCache->w) || (h != pCache->h)))
- XAATileCache(pScrn, pCache, w, h);
-
- return pCache;
-}
-
-XAACacheInfoPtr
-XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
- int w = pPix->drawable.width;
- int h = pPix->drawable.height;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache, cacheRoot = NULL;
- int i, max = 0, funcNo, pad, dwords, bpp = pScrn->bitsPerPixel;
- int *current;
- StippleScanlineProcPtr StippleFunc;
- unsigned char *data, *srcPtr, *dstPtr;
-
- if((h <= 128) && (w <= 128 * bpp)) {
- if(pCachePriv->Info128) {
- cacheRoot = pCachePriv->Info128;
- max = pCachePriv->Num128x128;
- current = &pCachePriv->Current128;
- } else {
- cacheRoot = pCachePriv->InfoPartial;
- max = pCachePriv->NumPartial;
- current = &pCachePriv->CurrentPartial;
- }
- } else if((h <= 256) && (w <= 256 * bpp)){
- cacheRoot = pCachePriv->Info256;
- max = pCachePriv->Num256x256;
- current = &pCachePriv->Current256;
- } else if((h <= 512) && (w <= 526 * bpp)){
- cacheRoot = pCachePriv->Info512;
- max = pCachePriv->Num512x512;
- current = &pCachePriv->Current512;
- } else { /* something's wrong */
- ErrorF("Something's wrong in XAACacheMonoStipple()\n");
- return pCachePriv->Info128;
- }
-
- pCache = cacheRoot;
-
- /* lets look for it */
- for(i = 0; i < max; i++, pCache++) {
- if((pCache->serialNumber == pPix->drawable.serialNumber) &&
- (pCache->fg == -1) && (pCache->bg == -1)) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
-
- pCache = &cacheRoot[(*current)++];
- if(*current >= max) *current = 0;
-
- pCache->serialNumber = pPix->drawable.serialNumber;
- pCache->trans_color = pCache->bg = pCache->fg = -1;
- pCache->orig_w = w; pCache->orig_h = h;
-
- if(w <= 32) {
- if(w & (w - 1)) funcNo = 1;
- else funcNo = 0;
- } else funcNo = 2;
-
- pad = BitmapBytePad(pCache->w * bpp);
- dwords = pad >> 2;
- dstPtr = data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
- srcPtr = (unsigned char*)pPix->devPrivate.ptr;
-
- if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
- StippleFunc = XAAStippleScanlineFuncMSBFirst[funcNo];
- else
- StippleFunc = XAAStippleScanlineFuncLSBFirst[funcNo];
-
- /* don't bother generating more than we'll ever use */
- max = ((pScrn->displayWidth + w - 1) + 31) >> 5;
- if(dwords > max)
- dwords = max;
-
- for(i = 0; i < h; i++) {
- (*StippleFunc)((CARD32*)dstPtr, (CARD32*)srcPtr, 0, w, dwords);
- srcPtr += pPix->devKind;
- dstPtr += pad;
- }
-
- while((h<<1) <= pCache->h) {
- memcpy(data + (pad * h), data, pad * h);
- h <<= 1;
- }
-
- if(h < pCache->h)
- memcpy(data + (pad * h), data, pad * (pCache->h - h));
-
- (*infoRec->WritePixmapToCache)(
- pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data,
- pad, bpp, pScrn->depth);
-
- DEALLOCATE_LOCAL(data);
-
- return pCache;
-}
-
-XAACacheInfoPtr
-XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
- int w = pPix->drawable.width;
- int h = pPix->drawable.height;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache, cacheRoot = NULL;
- int i, max = 0;
- int *current;
-
- if((h <= 128) && (w <= 128)) {
- if(pCachePriv->Info128) {
- cacheRoot = pCachePriv->Info128;
- max = pCachePriv->Num128x128;
- current = &pCachePriv->Current128;
- } else {
- cacheRoot = pCachePriv->InfoPartial;
- max = pCachePriv->NumPartial;
- current = &pCachePriv->CurrentPartial;
- }
- } else if((h <= 256) && (w <= 256)){
- cacheRoot = pCachePriv->Info256;
- max = pCachePriv->Num256x256;
- current = &pCachePriv->Current256;
- } else if((h <= 512) && (w <= 526)){
- cacheRoot = pCachePriv->Info512;
- max = pCachePriv->Num512x512;
- current = &pCachePriv->Current512;
- } else { /* something's wrong */
- ErrorF("Something's wrong in XAACachePlanarMonoStipple()\n");
- return pCachePriv->Info128;
- }
-
- pCache = cacheRoot;
-
- /* lets look for it */
- for(i = 0; i < max; i++, pCache++) {
- if((pCache->serialNumber == pPix->drawable.serialNumber) &&
- (pCache->fg == -1) && (pCache->bg == -1)) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
-
- pCache = &cacheRoot[(*current)++];
- if(*current >= max) *current = 0;
-
- pCache->serialNumber = pPix->drawable.serialNumber;
- pCache->trans_color = pCache->bg = pCache->fg = -1;
- pCache->orig_w = w; pCache->orig_h = h;
-
- /* Plane 0 holds the stipple. Plane 1 holds the inverted stipple */
- (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
- pPix->drawable.width, pPix->drawable.height, pPix->devPrivate.ptr,
- pPix->devKind, 1, 2);
- if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_MONO_DATA) &&
- ((w != pCache->w) || (h != pCache->h)))
- XAATileCache(pScrn, pCache, w, h);
-
- return pCache;
-}
-
-
-
-XAACacheInfoPtr
-XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
-{
- int w = pPix->drawable.width;
- int h = pPix->drawable.height;
- int size = max(w, h);
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache, cacheRoot = NULL;
- int i, max = 0;
- int *current;
-
- if(size <= 128) {
- if(pCachePriv->Info128) {
- cacheRoot = pCachePriv->Info128;
- max = pCachePriv->Num128x128;
- current = &pCachePriv->Current128;
- } else {
- cacheRoot = pCachePriv->InfoPartial;
- max = pCachePriv->NumPartial;
- current = &pCachePriv->CurrentPartial;
- }
- } else if(size <= 256) {
- cacheRoot = pCachePriv->Info256;
- max = pCachePriv->Num256x256;
- current = &pCachePriv->Current256;
- } else if(size <= 512) {
- cacheRoot = pCachePriv->Info512;
- max = pCachePriv->Num512x512;
- current = &pCachePriv->Current512;
- } else { /* something's wrong */
- ErrorF("Something's wrong in XAACacheStipple()\n");
- return pCachePriv->Info128;
- }
-
- pCache = cacheRoot;
- /* lets look for it */
- if(bg == -1)
- for(i = 0; i < max; i++, pCache++) {
- if((pCache->serialNumber == pPix->drawable.serialNumber) &&
- (fg == pCache->fg) && (pCache->fg != pCache->bg)) {
- pCache->trans_color = pCache->bg;
- return pCache;
- }
- }
- else
- for(i = 0; i < max; i++, pCache++) {
- if((pCache->serialNumber == pPix->drawable.serialNumber) &&
- (fg == pCache->fg) && (bg == pCache->bg)) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
-
- pCache = &cacheRoot[(*current)++];
- if(*current >= max) *current = 0;
-
- pCache->serialNumber = pPix->drawable.serialNumber;
- pCache->fg = fg;
- if(bg == -1)
- pCache->trans_color = bg = fg ^ 1;
- else
- pCache->trans_color = -1;
- pCache->bg = bg;
-
- pCache->orig_w = w; pCache->orig_h = h;
- (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
- pPix->drawable.width, pPix->drawable.height, pPix->devPrivate.ptr,
- pPix->devKind, fg, bg);
- if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
- ((w != pCache->w) || (h != pCache->h)))
- XAATileCache(pScrn, pCache, w, h);
-
- return pCache;
-}
-
-
-
-XAACacheInfoPtr
-XAACacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache = pCachePriv->InfoMono;
- int i;
-
- for(i = 0; i < pCachePriv->NumMono; i++, pCache++) {
- if(pCache->serialNumber &&
- (pCache->pat0 == pat0) && (pCache->pat1 == pat1))
- return pCache;
- }
-
- /* OK, let's cache it */
- pCache = &pCachePriv->InfoMono[pCachePriv->CurrentMono++];
- if(pCachePriv->CurrentMono >= pCachePriv->NumMono)
- pCachePriv->CurrentMono = 0;
-
- pCache->serialNumber = 1; /* we don't care since we do lookups by pattern */
- pCache->pat0 = pat0;
- pCache->pat1 = pat1;
-
- (*infoRec->WriteMono8x8PatternToCache)(pScrn, pCache);
-
- return pCache;
-}
-
-
-
-XAACacheInfoPtr
-XAACacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- XAACacheInfoPtr pCache = pCachePriv->InfoColor;
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- int i;
-
- if(!(pixPriv->flags & REDUCIBLE_TO_2_COLOR)) {
- for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
- if(pCache->serialNumber == pPix->drawable.serialNumber) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
- pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
- if(pCachePriv->CurrentColor >= pCachePriv->NumColor)
- pCachePriv->CurrentColor = 0;
-
- pCache->serialNumber = pPix->drawable.serialNumber;
- pCache->trans_color = pCache->fg = pCache->bg = -1;
- } else {
- int pat0 = pixPriv->pattern0;
- int pat1 = pixPriv->pattern1;
-
- if(fg == -1) { /* it's a tile */
- fg = pixPriv->fg; bg = pixPriv->bg;
- }
-
- if(bg == -1) { /* stipple */
- for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
- if(pCache->serialNumber &&
- (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
- (pCache->fg == fg) && (pCache->bg != fg)) {
- pCache->trans_color = pCache->bg;
- return pCache;
- }
- }
- } else { /* opaque stipple */
- for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
- if(pCache->serialNumber &&
- (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
- (pCache->fg == fg) && (pCache->bg == bg)) {
- pCache->trans_color = -1;
- return pCache;
- }
- }
- }
- pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
- if(pCachePriv->CurrentColor >= pCachePriv->NumColor)
- pCachePriv->CurrentColor = 0;
-
- if(bg == -1)
- pCache->trans_color = bg = fg ^ 1;
- else
- pCache->trans_color = -1;
-
- pCache->pat0 = pat0; pCache->pat1 = pat1;
- pCache->fg = fg; pCache->bg = bg;
- pCache->serialNumber = 1;
- }
-
- (*infoRec->WriteColor8x8PatternToCache)(pScrn, pPix, pCache);
-
- return pCache;
-}
-
-
-void
-XAAWriteBitmapToCache(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int fg, int bg
-) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->WriteBitmap)(pScrn, x, y, w, h, src, srcwidth,
- 0, fg, bg, GXcopy, ~0);
-}
-
-void
-XAAWriteBitmapToCacheLinear(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int fg, int bg
-){
- ScreenPtr pScreen = pScrn->pScreen;
- PixmapPtr pScreenPix, pDstPix;
- XID gcvals[2];
- GCPtr pGC;
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- pDstPix = GetScratchPixmapHeader(pScreen, pScreenPix->drawable.width,
- y + h, pScreenPix->drawable.depth,
- pScreenPix->drawable.bitsPerPixel,
- pScreenPix->devKind,
- pScreenPix->devPrivate.ptr);
-
- pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
- gcvals[0] = fg;
- gcvals[1] = bg;
- DoChangeGC(pGC, GCForeground | GCBackground, gcvals, 0);
- ValidateGC((DrawablePtr)pDstPix, pGC);
-
- /* We've unwrapped already so these ops miss a sync */
- SYNC_CHECK(pScrn);
-
- (*pGC->ops->PutImage)((DrawablePtr)pDstPix, pGC, 1, x, y, w, h, 0,
- XYBitmap, (pointer)src);
-
- FreeScratchGC(pGC);
- FreeScratchPixmapHeader(pDstPix);
-}
-
-
-void
-XAAWritePixmapToCache(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int bpp, int depth
-) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->WritePixmap)(pScrn, x, y, w, h, src, srcwidth,
- GXcopy, ~0, -1, bpp, depth);
-}
-
-
-
-void
-XAAWritePixmapToCacheLinear(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int bpp, int depth
-){
- ScreenPtr pScreen = pScrn->pScreen;
- PixmapPtr pScreenPix, pDstPix;
- GCPtr pGC;
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- pDstPix = GetScratchPixmapHeader(pScreen, x + w, y + h,
- depth, bpp, pScreenPix->devKind,
- pScreenPix->devPrivate.ptr);
-
- pGC = GetScratchGC(depth, pScreen);
- ValidateGC((DrawablePtr)pDstPix, pGC);
-
- /* We've unwrapped already so these ops miss a sync */
- SYNC_CHECK(pScrn);
-
- if(bpp == BitsPerPixel(depth))
- (*pGC->ops->PutImage)((DrawablePtr)pDstPix, pGC, depth, x, y, w,
- h, 0, ZPixmap, (pointer)src);
- else {
- PixmapPtr pSrcPix;
-
- pSrcPix = GetScratchPixmapHeader(pScreen, w, h, depth, bpp,
- srcwidth, (pointer)src);
-
- (*pGC->ops->CopyArea)((DrawablePtr)pSrcPix, (DrawablePtr)pDstPix,
- pGC, 0, 0, w, h, x, y);
-
- FreeScratchPixmapHeader(pSrcPix);
- }
-
- FreeScratchGC(pGC);
- FreeScratchPixmapHeader(pDstPix);
-}
-
-
-void
-XAAWriteMono8x8PatternToCache(
- ScrnInfoPtr pScrn,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- unsigned char *data;
- int pad, Bpp = (pScrn->bitsPerPixel >> 3);
-
- pCache->offsets = pCachePriv->MonoOffsets;
-
- pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
-
- data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
- if(!data) return;
-
- if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
- CARD32* ptr = (CARD32*)data;
- ptr[0] = pCache->pat0; ptr[1] = pCache->pat1;
- } else {
- CARD32 *ptr;
- DDXPointPtr pPoint = pCache->offsets;
- int patx, paty, i;
-
- for(i = 0; i < 64; i++, pPoint++) {
- patx = pCache->pat0; paty = pCache->pat1;
- XAARotateMonoPattern(&patx, &paty, i & 0x07, i >> 3,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- ptr = (CARD32*)(data + (pad * pPoint->y) + (Bpp * pPoint->x));
- ptr[0] = patx; ptr[1] = paty;
- }
- }
-
- (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
- pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
-
- DEALLOCATE_LOCAL(data);
-}
-
-void
-XAAWriteColor8x8PatternToCache(
- ScrnInfoPtr pScrn,
- PixmapPtr pPix,
- XAACacheInfoPtr pCache
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- int pad, i, w, h, nw, nh, Bpp;
- unsigned char *data, *srcPtr, *dstPtr;
-
- pCache->offsets = pCachePriv->ColorOffsets;
-
- if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) {
- CARD32* ptr;
- pad = BitmapBytePad(pCache->w);
- data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
- if(!data) return;
-
- if(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
- ptr = (CARD32*)data;
- ptr[0] = pCache->pat0; ptr[1] = pCache->pat1;
- } else {
- int patx, paty;
-
- ptr = (CARD32*)data;
- ptr[0] = ptr[2] = pCache->pat0; ptr[1] = ptr[3] = pCache->pat1;
- for(i = 1; i < 8; i++) {
- patx = pCache->pat0; paty = pCache->pat1;
- XAARotateMonoPattern(&patx, &paty, i, 0,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- ptr = (CARD32*)(data + (pad * i));
- ptr[0] = ptr[2] = patx; ptr[1] = ptr[3] = paty;
- }
- }
-
- (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
- pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg);
-
- DEALLOCATE_LOCAL(data);
- return;
- }
-
- Bpp = pScrn->bitsPerPixel >> 3;
- h = min(8,pPix->drawable.height);
- w = min(8,pPix->drawable.width);
- pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
-
- data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
- if(!data) return;
-
- /* Write and expand horizontally. */
- for (i = h, dstPtr = data, srcPtr = pPix->devPrivate.ptr; i--;
- srcPtr += pPix->devKind, dstPtr += pScrn->bitsPerPixel) {
- nw = w;
- memcpy(dstPtr, srcPtr, w * Bpp);
- while (nw != 8) {
- memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp);
- nw <<= 1;
- }
- }
- nh = h;
- /* Expand vertically. */
- while (nh != 8) {
- memcpy(data + (nh*pScrn->bitsPerPixel), data, nh*pScrn->bitsPerPixel);
- nh <<= 1;
- }
-
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int j;
- unsigned char *ptr = data + (128 * Bpp);
-
- memcpy(data + (64 * Bpp), data, 64 * Bpp);
- for(i = 1; i < 8; i++, ptr += (128 * Bpp)) {
- for(j = 0; j < 8; j++) {
- memcpy(ptr + (j * 8) * Bpp, data + (j * 8 + i) * Bpp,
- (8 - i) * Bpp);
- memcpy(ptr + (j * 8 + 8 - i) * Bpp, data + j * 8 * Bpp, i*Bpp);
- }
- memcpy(ptr + (64 * Bpp), ptr, 64 * Bpp);
- }
- }
-
- (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
- pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
-
- DEALLOCATE_LOCAL(data);
-}
-
-
-
-int
-XAAStippledFillChooser(GCPtr pGC)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- PixmapPtr pPixmap = pGC->stipple;
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
- if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
- (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
- XAACheckStippleReducibility(pPixmap);
- }
-
-
- if(pPriv->flags & REDUCIBLE_TO_8x8) {
- if(infoRec->CanDoMono8x8 &&
- !(infoRec->FillMono8x8PatternSpansFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->FillMono8x8PatternSpansFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_FG(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
-
- return DO_MONO_8x8;
- }
-
- if(infoRec->CanDoColor8x8 &&
- !(infoRec->FillColor8x8PatternSpansFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->FillColor8x8PatternSpansFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
-
- return DO_COLOR_8x8;
- }
- }
-
- if(infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
- (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
- (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
- infoRec->CacheColorExpandDensity) &&
- !(infoRec->FillCacheExpandSpansFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->FillCacheExpandSpansFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_ROP(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_FG(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheExpandSpansFlags)) {
-
- return DO_CACHE_EXPAND;
- }
-
-
- if(infoRec->UsingPixmapCache &&
- !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
- infoRec->FillCacheBltSpans &&
- (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
- (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
- !(infoRec->FillCacheBltSpansFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->FillCacheBltSpansFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
-
- return DO_CACHE_BLT;
- }
-
- if(infoRec->FillColorExpandSpans &&
- !(infoRec->FillColorExpandSpansFlags & NO_TRANSPARENCY) &&
- ((pGC->alu == GXcopy) || !(infoRec->FillColorExpandSpansFlags &
- TRANSPARENCY_GXCOPY_ONLY)) &&
- CHECK_ROP(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_FG(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillColorExpandSpansFlags)) {
-
- return DO_COLOR_EXPAND;
- }
-
- return 0;
-}
-
-
-int
-XAAOpaqueStippledFillChooser(GCPtr pGC)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- PixmapPtr pPixmap = pGC->stipple;
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
- if(XAA_DEPTH_BUG(pGC))
- return 0;
-
- if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
- (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
- XAACheckStippleReducibility(pPixmap);
- }
-
- if(pPriv->flags & REDUCIBLE_TO_8x8) {
- if(infoRec->CanDoMono8x8 &&
- !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
- CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_COLORS(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
-
- return DO_MONO_8x8;
- }
-
- if(infoRec->CanDoColor8x8 &&
- CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
-
- return DO_COLOR_8x8;
- }
- }
-
- if(infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
- (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
- (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
- infoRec->CacheColorExpandDensity) &&
- !(infoRec->FillCacheExpandSpansFlags & TRANSPARENCY_ONLY) &&
- CHECK_ROP(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_COLORS(pGC,infoRec->FillCacheExpandSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheExpandSpansFlags)) {
-
- return DO_CACHE_EXPAND;
- }
-
- if(infoRec->UsingPixmapCache &&
- !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
- infoRec->FillCacheBltSpans &&
- (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
- (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
- CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
-
- return DO_CACHE_BLT;
- }
-
- if(infoRec->FillColorExpandSpans &&
- !(infoRec->FillColorExpandSpansFlags & TRANSPARENCY_ONLY) &&
- CHECK_ROP(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_COLORS(pGC,infoRec->FillColorExpandSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillColorExpandSpansFlags)) {
-
- return DO_COLOR_EXPAND;
- }
-
- return 0;
-}
-
-
-
-int
-XAATiledFillChooser(GCPtr pGC)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- PixmapPtr pPixmap = pGC->tile.pixmap;
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
-
- if(IS_OFFSCREEN_PIXMAP(pPixmap) && infoRec->FillCacheBltSpans &&
- CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
-
- return DO_PIXMAP_COPY;
- }
-
- if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
- (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
- XAACheckTileReducibility(pPixmap,infoRec->CanDoMono8x8);
- }
-
- if(pPriv->flags & REDUCIBLE_TO_8x8) {
- if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && infoRec->CanDoMono8x8 &&
- !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
- CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
- (!(infoRec->FillMono8x8PatternSpansFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))) &&
- CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
-
- return DO_MONO_8x8;
- }
-
- if(infoRec->CanDoColor8x8 &&
- CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
-
- return DO_COLOR_8x8;
- }
- }
-
- if(infoRec->UsingPixmapCache && infoRec->FillCacheBltSpans &&
- (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
- (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
- CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
-
- return DO_CACHE_BLT;
- }
-
- if(infoRec->FillImageWriteRects &&
- CHECK_NO_GXCOPY(pGC,infoRec->FillImageWriteRectsFlags) &&
- CHECK_ROP(pGC,infoRec->FillImageWriteRectsFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillImageWriteRectsFlags) &&
- CHECK_PLANEMASK(pGC,infoRec->FillImageWriteRectsFlags)) {
-
- return DO_IMAGE_WRITE;
- }
-
- return 0;
-}
-
-
-static int RotateMasksX[8] = {
- 0xFFFFFFFF, 0x7F7F7F7F, 0x3F3F3F3F, 0x1F1F1F1F,
- 0x0F0F0F0F, 0x07070707, 0x03030303, 0x01010101
-};
-
-static int RotateMasksY[4] = {
- 0xFFFFFFFF, 0x00FFFFFF, 0x0000FFFF, 0x000000FF
-};
-
-void
-XAARotateMonoPattern(
- int *pat0, int *pat1,
- int xorg, int yorg,
- Bool msbfirst
-){
- int tmp, mask;
-
- if(xorg) {
- if(msbfirst) xorg = 8 - xorg;
- mask = RotateMasksX[xorg];
- *pat0 = ((*pat0 >> xorg) & mask) | ((*pat0 << (8 - xorg)) & ~mask);
- *pat1 = ((*pat1 >> xorg) & mask) | ((*pat1 << (8 - xorg)) & ~mask);
- }
- if(yorg >= 4) {
- tmp = *pat0; *pat0 = *pat1; *pat1 = tmp;
- yorg -= 4;
- }
- if(yorg) {
- mask = RotateMasksY[yorg];
- yorg <<= 3;
- tmp = *pat0;
- *pat0 = ((*pat0 >> yorg) & mask) | ((*pat1 << (32 - yorg)) & ~mask);
- *pat1 = ((*pat1 >> yorg) & mask) | ((tmp << (32 - yorg)) & ~mask);
- }
-}
-
-
-
-void
-XAAInvalidatePixmapCache(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAAPixmapCachePrivatePtr pCachePriv =
- (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
- int i;
-
- if(!pCachePriv) return;
-
- for(i = 0; i < pCachePriv->Num512x512; i++)
- (pCachePriv->Info512)[i].serialNumber = 0;
- for(i = 0; i < pCachePriv->Num256x256; i++)
- (pCachePriv->Info256)[i].serialNumber = 0;
- for(i = 0; i < pCachePriv->Num128x128; i++)
- (pCachePriv->Info128)[i].serialNumber = 0;
- for(i = 0; i < pCachePriv->NumPartial; i++)
- (pCachePriv->InfoPartial)[i].serialNumber = 0;
- for(i = 0; i < pCachePriv->NumMono; i++)
- (pCachePriv->InfoMono)[i].serialNumber = 0;
- for(i = 0; i < pCachePriv->NumColor; i++)
- (pCachePriv->InfoColor)[i].serialNumber = 0;
-}
diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c
deleted file mode 100644
index 2adf42466..000000000
--- a/hw/xfree86/xaa/xaaPaintWin.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.11 2003/02/17 16:08:29 dawes Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-void
-XAAPaintWindow(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
- int nBox = REGION_NUM_RECTS(prgn);
- BoxPtr pBox = REGION_RECTS(prgn);
- int fg = -1;
- PixmapPtr pPix = NULL;
-
- if(!infoRec->pScrn->vtSema) goto BAILOUT;
-
- switch (what) {
- case PW_BACKGROUND:
- switch(pWin->backgroundState) {
- case None: return;
- case ParentRelative:
- do { pWin = pWin->parent; }
- while(pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what);
- return;
- case BackgroundPixel:
- fg = pWin->background.pixel;
- break;
- case BackgroundPixmap:
- pPix = pWin->background.pixmap;
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- fg = pWin->border.pixel;
- else /* pixmap */
- pPix = pWin->border.pixmap;
- break;
- default: return;
- }
-
-
- if(!pPix) {
- if(infoRec->FillSolidRects &&
- (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(fg))) ) {
- (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, ~0,
- nBox, pBox);
- return;
- }
- } else { /* pixmap */
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- WindowPtr pBgWin = pWin;
- Bool NoCache = FALSE;
- int xorg, yorg;
-
- /* Hack so we can use this with the dual framebuffer layers
- which only support the pixmap cache in the primary bpp */
- if(pPix->drawable.bitsPerPixel != infoRec->pScrn->bitsPerPixel)
- NoCache = TRUE;
-
- if (what == PW_BORDER) {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- }
-
- xorg = pBgWin->drawable.x;
- yorg = pBgWin->drawable.y;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pScreen->myNum;
- if(WindowTable[index] == pBgWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
-
- if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) {
- XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
-
- pCache->x = pPriv->offscreenArea->box.x1;
- pCache->y = pPriv->offscreenArea->box.y1;
- pCache->w = pCache->orig_w =
- pPriv->offscreenArea->box.x2 - pCache->x;
- pCache->h = pCache->orig_h =
- pPriv->offscreenArea->box.y2 - pCache->y;
- pCache->trans_color = -1;
-
- (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0,
- nBox, pBox, xorg, yorg, pCache);
- return;
- }
-
- if(pPriv->flags & DIRTY) {
- pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
-
- if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
- (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
- XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8);
- }
-
- if(pPriv->flags & REDUCIBLE_TO_8x8) {
- if((pPriv->flags & REDUCIBLE_TO_2_COLOR) &&
- infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects &&
- !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) {
-
- (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn,
- pPriv->fg, pPriv->bg, GXcopy, ~0, nBox, pBox,
- pPriv->pattern0, pPriv->pattern1, xorg, yorg);
- return;
- }
- if(infoRec->CanDoColor8x8 && !NoCache &&
- infoRec->FillColor8x8PatternRects) {
- XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)(
- infoRec->pScrn, pPix, -1, -1);
-
- (*infoRec->FillColor8x8PatternRects) ( infoRec->pScrn,
- GXcopy, ~0, nBox, pBox, xorg, yorg, pCache);
- return;
- }
- }
-
- /* The window size check is to reduce pixmap cache thrashing
- when there are lots of little windows with pixmap backgrounds
- like are sometimes used for buttons, etc... */
-
- if(infoRec->UsingPixmapCache &&
- infoRec->FillCacheBltRects && !NoCache &&
- ((what == PW_BORDER) ||
- (pPix->drawable.height != pWin->drawable.height) ||
- (pPix->drawable.width != pWin->drawable.width)) &&
- (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) &&
- (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) {
-
- XAACacheInfoPtr pCache =
- (*infoRec->CacheTile)(infoRec->pScrn, pPix);
- (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0,
- nBox, pBox, xorg, yorg, pCache);
- return;
- }
-
- if(infoRec->FillImageWriteRects &&
- !(infoRec->FillImageWriteRectsFlags & NO_GXCOPY)) {
- (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy,
- ~0, nBox, pBox, xorg, yorg, pPix);
- return;
- }
- }
-
-
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
-
-BAILOUT:
-
- if(what == PW_BACKGROUND) {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
- (*pScreen->PaintWindowBackground) (pWin, prgn, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow);
- } else {
- XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
- (*pScreen->PaintWindowBorder) (pWin, prgn, what);
- XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow);
- }
-
-}
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
deleted file mode 100644
index fecbbcfa0..000000000
--- a/hw/xfree86/xaa/xaaPict.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.18 2003/04/23 18:35:34 eich Exp $
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "glyphstr.h"
-#include "picture.h"
-#include "mipict.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "xaacexp.h"
-#include "xf86fbman.h"
-#include "servermd.h"
-
-Bool
-XAAGetPixelFromRGBA (
- CARD32 *pixel,
- CARD16 red,
- CARD16 green,
- CARD16 blue,
- CARD16 alpha,
- CARD32 format
-){
- int rbits, bbits, gbits, abits;
- int rshift, bshift, gshift, ashift;
-
- *pixel = 0;
-
- if(!PICT_FORMAT_COLOR(format))
- return FALSE;
-
- rbits = PICT_FORMAT_R(format);
- gbits = PICT_FORMAT_G(format);
- bbits = PICT_FORMAT_B(format);
- abits = PICT_FORMAT_A(format);
-
- if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
- bshift = 0;
- gshift = bbits;
- rshift = gshift + gbits;
- ashift = rshift + rbits;
- } else { /* PICT_TYPE_ABGR */
- rshift = 0;
- gshift = rbits;
- bshift = gshift + gbits;
- ashift = bshift + bbits;
- }
-
- *pixel |= ( blue >> (16 - bbits)) << bshift;
- *pixel |= ( red >> (16 - rbits)) << rshift;
- *pixel |= (green >> (16 - gbits)) << gshift;
- *pixel |= (alpha >> (16 - abits)) << ashift;
-
- return TRUE;
-}
-
-
-Bool
-XAAGetRGBAFromPixel(
- CARD32 pixel,
- CARD16 *red,
- CARD16 *green,
- CARD16 *blue,
- CARD16 *alpha,
- CARD32 format
-){
- int rbits, bbits, gbits, abits;
- int rshift, bshift, gshift, ashift;
-
- if(!PICT_FORMAT_COLOR(format))
- return FALSE;
-
- rbits = PICT_FORMAT_R(format);
- gbits = PICT_FORMAT_G(format);
- bbits = PICT_FORMAT_B(format);
- abits = PICT_FORMAT_A(format);
-
- if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
- bshift = 0;
- gshift = bbits;
- rshift = gshift + gbits;
- ashift = rshift + rbits;
- } else { /* PICT_TYPE_ABGR */
- rshift = 0;
- gshift = rbits;
- bshift = gshift + gbits;
- ashift = bshift + bbits;
- }
-
- *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
- while(rbits < 16) {
- *red |= *red >> rbits;
- rbits <<= 1;
- }
-
- *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
- while(gbits < 16) {
- *green |= *green >> gbits;
- gbits <<= 1;
- }
-
- *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
- while(bbits < 16) {
- *blue |= *blue >> bbits;
- bbits <<= 1;
- }
-
- if(abits) {
- *alpha = ((pixel >> ashift ) & ((1 << abits) - 1)) << (16 - abits);
- while(abits < 16) {
- *alpha |= *alpha >> abits;
- abits <<= 1;
- }
- } else *alpha = 0xffff;
-
- return TRUE;
-}
-
-/* 8:8:8 + PICT_a8 -> 8:8:8:8 texture */
-
-void
-XAA_888_plus_PICT_a8_to_8888 (
- CARD32 color,
- CARD8 *alphaPtr, /* in bytes */
- int alphaPitch,
- CARD32 *dstPtr,
- int dstPitch, /* in dwords */
- int width,
- int height
-){
- int x;
-
- color &= 0x00ffffff;
-
- while(height--) {
- for(x = 0; x < width; x++)
- dstPtr[x] = color | (alphaPtr[x] << 24);
- dstPtr += dstPitch;
- alphaPtr += alphaPitch;
- }
-}
-
-Bool
-XAADoComposite (
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height
-){
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- RegionRec region;
- CARD32 *formats;
- int flags = 0;
- BoxPtr pbox;
- int nbox, w, h;
-
- if(!REGION_NUM_RECTS(pDst->pCompositeClip))
- return TRUE;
-
- if(!infoRec->pScrn->vtSema ||
- ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
- !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
- return FALSE;
-
- if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
- IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
- return FALSE;
-
- if (pSrc->transform || (pMask && pMask->transform))
- return FALSE;
-
- if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap))
- return FALSE;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
-
- if(pMask) {
- /* for now we only do it if there is a 1x1 (solid) source */
-
- if((pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1)) {
- CARD16 red, green, blue, alpha;
- CARD32 pixel =
- *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
-
- if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
- return FALSE;
-
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
-
- /* pull out color expandable operations here */
- if((pMask->format == PICT_a1) && (alpha == 0xffff) &&
- (op == PictOpOver) && infoRec->WriteBitmap && !pMask->repeat &&
- !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY) &&
- (!(infoRec->WriteBitmapFlags & RGB_EQUAL) ||
- ((red == green) && (green == blue))))
- {
- PixmapPtr pPix = (PixmapPtr)(pMask->pDrawable);
- int skipleft;
-
- if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height))
- return TRUE;
-
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
-
- if(!nbox)
- return TRUE;
-
- XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
-
- xMask -= xDst;
- yMask -= yDst;
-
- while(nbox--) {
- skipleft = pbox->x1 + xMask;
-
- (*infoRec->WriteBitmap)(infoRec->pScrn,
- pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- (unsigned char*)(pPix->devPrivate.ptr) +
- (pPix->devKind * (pbox->y1 + yMask)) +
- ((skipleft >> 3) & ~3), pPix->devKind,
- skipleft & 31, pixel, -1, GXcopy, ~0);
- pbox++;
- }
-
- /* WriteBitmap sets the Sync flag */
- REGION_UNINIT(pScreen, &region);
- return TRUE;
- }
-
- if(!(formats = infoRec->CPUToScreenAlphaTextureFormats))
- return FALSE;
-
- w = pMask->pDrawable->width;
- h = pMask->pDrawable->height;
-
- if(pMask->repeat) {
- if((infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_TILE) ||
- ((infoRec->CPUToScreenAlphaTextureFlags &
- XAA_RENDER_POWER_OF_2_TILE_ONLY) &&
- ((h & (h - 1)) || (w & (w - 1)))))
- {
- return FALSE;
- }
- flags |= XAA_RENDER_REPEAT;
- }
-
- if((alpha != 0xffff) &&
- (infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_SRC_ALPHA))
- return FALSE;
-
- while(*formats != pMask->format) {
- if(!(*formats)) return FALSE;
- formats++;
- }
-
- if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height))
- return TRUE;
-
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
-
- if(!nbox) {
- REGION_UNINIT(pScreen, &region);
- return TRUE;
- }
-
- if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
- op, red, green, blue, alpha, pMask->format,
- ((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
- ((PixmapPtr)(pMask->pDrawable))->devKind,
- w, h, flags))
- {
- REGION_UNINIT(pScreen, &region);
- return FALSE;
- }
-
- xMask -= xDst;
- yMask -= yDst;
-
- while(nbox--) {
- (*infoRec->SubsequentCPUToScreenAlphaTexture)(infoRec->pScrn,
- pbox->x1, pbox->y1,
- pbox->x1 + xMask, pbox->y1 + yMask,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- pbox++;
- }
-
- SET_SYNC_FLAG(infoRec);
- REGION_UNINIT(pScreen, &region);
- return TRUE;
- }
- } else {
- if(!(formats = infoRec->CPUToScreenTextureFormats))
- return FALSE;
-
- w = pSrc->pDrawable->width;
- h = pSrc->pDrawable->height;
-
- if(pSrc->repeat) {
- if((infoRec->CPUToScreenTextureFlags & XAA_RENDER_NO_TILE) ||
- ((infoRec->CPUToScreenTextureFlags &
- XAA_RENDER_POWER_OF_2_TILE_ONLY) &&
- ((h & (h - 1)) || (w & (w - 1)))))
- {
- return FALSE;
- }
- flags |= XAA_RENDER_REPEAT;
- }
-
-
- while(*formats != pSrc->format) {
- if(!(*formats)) return FALSE;
- formats++;
- }
-
- if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height))
- return TRUE;
-
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
-
- if(!nbox) {
- REGION_UNINIT(pScreen, &region);
- return TRUE;
- }
-
- if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
- op, pSrc->format,
- ((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
- ((PixmapPtr)(pSrc->pDrawable))->devKind,
- w, h, flags))
- {
- REGION_UNINIT(pScreen, &region);
- return FALSE;
- }
-
-
- xSrc -= xDst;
- ySrc -= yDst;
-
- while(nbox--) {
- (*infoRec->SubsequentCPUToScreenTexture)(infoRec->pScrn,
- pbox->x1, pbox->y1,
- pbox->x1 + xSrc, pbox->y1 + ySrc,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- pbox++;
- }
-
- SET_SYNC_FLAG(infoRec);
- REGION_UNINIT(pScreen, &region);
- return TRUE;
- }
-
-
- return FALSE;
-}
-
-
-void
-XAAComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAA_RENDER_PROLOGUE(pScreen, Composite);
-
- if(!infoRec->Composite ||
- !(*infoRec->Composite)(op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height))
- {
- if((pSrc->pDrawable->type == DRAWABLE_WINDOW ||
- pDst->pDrawable->type == DRAWABLE_WINDOW ||
- IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
- && infoRec->pScrn->vtSema) {
- SYNC_CHECK(pDst->pDrawable);
- }
- (*GetPictureScreen(pScreen)->Composite) (op,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height);
- }
-
- if(pDst->pDrawable->type == DRAWABLE_PIXMAP)
- (XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst->pDrawable)))->flags |= DIRTY;
-
- XAA_RENDER_EPILOGUE(pScreen, Composite, XAAComposite);
-}
-
-Bool
-XAADoGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
-
- if(!REGION_NUM_RECTS(pDst->pCompositeClip))
- return TRUE;
-
- if(!infoRec->pScrn->vtSema ||
- ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
- !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
- return FALSE;
-
- if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
- IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
- return FALSE;
-
- if(maskFormat && (maskFormat->depth == 1) &&
- (pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
- (op == PictOpOver) && infoRec->WriteBitmap &&
- !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
- {
- CARD16 red, green, blue, alpha;
- CARD32 pixel =
- *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
- CARD32 *bits, *pntr, *pnt;
- int x, y, i, n, left, top, right, bottom, width, height, pitch;
- int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
- int leftEdge, rightEdge, topLine, botLine;
- BoxPtr pbox;
- GlyphPtr glyph;
-
- if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
- return FALSE;
-
- if(alpha != 0xffff) return FALSE;
-
- XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
-
- if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !((red == green) && (green == blue)))
- return FALSE;
-
- x = pDst->pDrawable->x;
- y = pDst->pDrawable->y;
-
- while(nlist--) {
- x += list->xOff;
- y += list->yOff;
- left = right = X = x;
- top = bottom = Y = y;
- for(i = 0; i < list->len; i++) {
- glyph = glyphs[i];
-
- L = X - glyph->info.x;
- if(L < left) left = L;
- R = L + glyph->info.width;
- if(R > right) right = R;
-
- T = Y - glyph->info.y;
- if(T < top) top = T;
- B = T + glyph->info.height;
- if(B > bottom) bottom = B;
-
- X += glyph->info.xOff;
- Y += glyph->info.yOff;
- }
-
- width = right - left;
- height = bottom - top;
-
- if(width && height) {
- pitch = (((width + 31) & ~31) >> 5) + 1;
- pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
- if(!pntr)
- return TRUE;
- bzero(pntr, sizeof(CARD32) * pitch * height);
- n = list->len;
-
- X = x; Y = y;
- while(n--) {
- glyph = *glyphs++;
- h = glyph->info.height;
- w = glyph->info.width;
- if(h && w) {
- row = y - top - glyph->info.y;
- column = x - left - glyph->info.x;
- pnt = pntr + (row * pitch) + (column >> 5);
- column &= 31;
- dwords = ((w + 31) >> 5) - 1;
- bits = (CARD32*)(glyph + 1);
- if(dwords) {
- while(h--) {
- for(i = 0; i <= dwords; i++) {
- if(column) {
- pnt[i] |= SHIFT_L(*bits, column);
- pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
- } else
- pnt[i] |= *bits;
-
- if(i != dwords) bits++;
- }
- bits++;
- pnt += pitch;
- }
- } else {
- if(column) {
- while(h--) {
- pnt[0] |= SHIFT_L(*bits, column);
- pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
- bits++;
- pnt += pitch;
- }
- } else {
- while(h--) {
- *pnt |= *bits++;
- pnt += pitch;
- }
- }
- }
- }
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
-
- nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
- pbox = REGION_RECTS(pDst->pCompositeClip);
-
- while(nbox && (top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- while(nbox && (bottom > pbox->y1)) {
- leftEdge = max(left, pbox->x1);
- rightEdge = min(right, pbox->x2);
-
- if(rightEdge > leftEdge) {
- column = leftEdge - left;
- topLine = max(top, pbox->y1);
- botLine = min(bottom, pbox->y2);
- h = botLine - topLine;
-
- if(h > 0) {
- (*infoRec->WriteBitmap)(infoRec->pScrn,
- leftEdge, topLine, rightEdge - leftEdge, h,
- (unsigned char*)(pntr +
- ((topLine - top) * pitch) + (column >> 5)),
- pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
- }
- }
- nbox--; pbox++;
- }
- xfree(pntr);
- } else {
- x = X; y = Y;
- }
- list++;
- }
-
- return TRUE;
- }
-
- /*
- * If it looks like we have a chance of being able to draw these
- * glyphs with an accelerated Composite, do that now to avoid
- * unneeded and costly syncs.
- */
- if(maskFormat) {
- if(!infoRec->CPUToScreenAlphaTextureFormats)
- return FALSE;
- } else {
- if(!infoRec->CPUToScreenTextureFormats)
- return FALSE;
- }
-
- miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
-
- return TRUE;
-}
-
-
-void
-XAAGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- XAA_RENDER_PROLOGUE(pScreen, Glyphs);
-
- if(!infoRec->Glyphs ||
- !(*infoRec->Glyphs)(op, pSrc, pDst, maskFormat,
- xSrc, ySrc, nlist, list, glyphs))
- {
- if(((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
- (pDst->pDrawable->type == DRAWABLE_WINDOW) ||
- IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
- && infoRec->pScrn->vtSema) {
- SYNC_CHECK(pDst->pDrawable);
- }
- (*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat,
- xSrc, ySrc, nlist, list, glyphs);
- }
-
- if(pDst->pDrawable->type == DRAWABLE_PIXMAP)
- (XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst->pDrawable)))->flags |= DIRTY;
-
- XAA_RENDER_EPILOGUE(pScreen, Glyphs, XAAGlyphs);
-}
diff --git a/hw/xfree86/xaa/xaaROP.c b/hw/xfree86/xaa/xaaROP.c
deleted file mode 100644
index 4075bab6a..000000000
--- a/hw/xfree86/xaa/xaaROP.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaROP.c,v 1.2 2000/09/28 20:48:01 mvojkovi Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaarop.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-int XAACopyROP[16] =
-{
- ROP_0, /* GXclear */
- ROP_DSa, /* GXand */
- ROP_SDna, /* GXandReverse */
- ROP_S, /* GXcopy */
- ROP_DSna, /* GXandInverted */
- ROP_D, /* GXnoop */
- ROP_DSx, /* GXxor */
- ROP_DSo, /* GXor */
- ROP_DSon, /* GXnor */
- ROP_DSxn, /* GXequiv */
- ROP_Dn, /* GXinvert*/
- ROP_SDno, /* GXorReverse */
- ROP_Sn, /* GXcopyInverted */
- ROP_DSno, /* GXorInverted */
- ROP_DSan, /* GXnand */
- ROP_1 /* GXset */
-};
-
-int XAACopyROP_PM[16] =
-{
- ROP_0, /* not used */
- ROP_DSPnoa,
- ROP_DPSnaon,
- ROP_DPSDxax,
- ROP_DPSana,
- ROP_D, /* not used */
- ROP_DPSax,
- ROP_DPSao,
- ROP_DPSaon,
- ROP_DPSaxn,
- ROP_Dn, /* not used */
- ROP_DPSanan,
- ROP_PSDPxox, /* is that correct ? */
- ROP_DPSnao,
- ROP_DSPnoan,
- ROP_1 /* not used */
-};
-
-
-int XAAPatternROP[16]=
-{
- ROP_0,
- ROP_DPa,
- ROP_PDna,
- ROP_P,
- ROP_DPna,
- ROP_D,
- ROP_DPx,
- ROP_DPo,
- ROP_DPon,
- ROP_PDxn,
- ROP_Dn,
- ROP_PDno,
- ROP_Pn,
- ROP_DPno,
- ROP_DPan,
- ROP_1
-};
-
-int XAAPatternROP_PM[16] =
-{
- ROP_DPna,
- ROP_DPSnoa,
- ROP_DSPnaon,
- ROP_DSPDxax,
- ROP_DPSana,
- ROP_D,
- ROP_DPSax,
- ROP_DPSao,
- ROP_DPSaon,
- ROP_DPSaxn,
- ROP_DPx,
- ROP_DPSanan,
- ROP_SPDSxox, /* is that correct ? */
- ROP_DSPnao,
- ROP_DPSnoan,
- ROP_DPo
-};
-
-
-int
-XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int ret = 0;
-
- pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
-
- if(pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
- if(!NO_SRC_ROP(*rop))
- ret |= ROP_PAT;
- *rop = XAAPatternROP[*rop];
- } else {
- switch(*rop) {
- case GXnoop:
- break;
- case GXset:
- case GXclear:
- case GXinvert:
- ret |= ROP_PAT;
- *fg = pm;
- if(*bg != -1)
- *bg = pm;
- break;
- default:
- ret |= ROP_PAT | ROP_SRC;
- break;
- }
- *rop = XAAPatternROP_PM[*rop];
- }
-
- return ret;
-}
-
-
-int
-XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int ret = 0;
-
- pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
-
- if(pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
- if(!NO_SRC_ROP(*rop))
- ret |= ROP_PAT;
- *rop = XAAPatternROP[*rop];
- } else {
- switch(*rop) {
- case GXnoop:
- break;
- case GXset:
- case GXclear:
- case GXinvert:
- ret |= ROP_PAT;
- *fg = pm;
- break;
- default:
- ret |= ROP_PAT | ROP_SRC;
- break;
- }
- *rop = XAAPatternROP_PM[*rop];
- }
-
- return ret;
-}
-
diff --git a/hw/xfree86/xaa/xaaRect.c b/hw/xfree86/xaa/xaaRect.c
deleted file mode 100644
index fe8d70de2..000000000
--- a/hw/xfree86/xaa/xaaRect.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaRect.c,v 1.3 1999/05/30 03:03:33 dawes Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-/*
- Much of this file based on code by
- Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
-*/
-
-
-void
-XAAPolyRectangleThinSolid(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int nClipRects; /* number of clip rectangles */
- BoxPtr pClipRects; /* points to the list of clip rects */
- int xOrigin; /* Drawables x origin */
- int yOrigin; /* Drawables x origin */
- xRectangle *pRect; /* list of rects */
- int nRects; /* running count of number of rects */
- int origX1, origY1; /* original rectangle's U/L corner */
- int origX2, origY2; /* original rectangle's L/R corner */
- int clippedX1; /* clipped rectangle's left x */
- int clippedY1; /* clipped rectangle's top y */
- int clippedX2; /* clipped rectangle's right x */
- int clippedY2; /* clipped rectangle's bottom y */
- int clipXMin; /* upper left corner of clip rect */
- int clipYMin; /* upper left corner of clip rect */
- int clipXMax; /* lower right corner of clip rect */
- int clipYMax; /* lower right corner of clip rect */
- int width, height; /* width and height of rect */
-
- nClipRects = REGION_NUM_RECTS(pGC->pCompositeClip);
- pClipRects = REGION_RECTS(pGC->pCompositeClip);
-
- if(!nClipRects) return;
-
- xOrigin = pDrawable->x;
- yOrigin = pDrawable->y;
-
-
- (*infoRec->SetupForSolidLine)(infoRec->pScrn,
- pGC->fgPixel, pGC->alu, pGC->planemask);
-
-
- for ( ; nClipRects > 0;
- nClipRects--, pClipRects++ )
- {
- clipYMin = pClipRects->y1;
- clipYMax = pClipRects->y2 - 1;
- clipXMin = pClipRects->x1;
- clipXMax = pClipRects->x2 - 1;
-
- for (pRect = pRectsInit, nRects = nRectsInit;
- nRects > 0;
- nRects--, pRect++ )
- {
- /* translate rectangle data over to the drawable */
- origX1 = pRect->x + xOrigin;
- origY1 = pRect->y + yOrigin;
- origX2 = origX1 + pRect->width;
- origY2 = origY1 + pRect->height;
-
- /* reject entire rectangle if completely outside clip rect */
- if ((origX1 > clipXMax) || (origX2 < clipXMin) ||
- (origY1 > clipYMax) || (origY2 < clipYMin))
- continue;
-
- /* clip the rectangle */
- clippedX1 = max (origX1, clipXMin);
- clippedX2 = min (origX2, clipXMax);
- clippedY1 = max (origY1, clipYMin);
- clippedY2 = min (origY2, clipYMax);
-
- width = clippedX2 - clippedX1 + 1;
-
- if (origY1 >= clipYMin) {
- (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
- clippedX1, clippedY1, width, DEGREES_0);
-
- /* don't overwrite corner */
- clippedY1++;
- }
-
- if ((origY2 <= clipYMax) && (origY1 != origY2)) {
- (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
- clippedX1, clippedY2, width, DEGREES_0);
-
- /* don't overwrite corner */
- clippedY2--;
- }
-
- if (clippedY2 < clippedY1) continue;
-
- height = clippedY2 - clippedY1 + 1;
-
- /* draw vertical edges using lines if not clipped out */
- if (origX1 >= clipXMin)
- (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
- clippedX1, clippedY1, height, DEGREES_270);
-
- if ((origX2 <= clipXMax) && (origX2 != origX1))
- (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
- clippedX2, clippedY1, height, DEGREES_270);
- }
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hw/xfree86/xaa/xaaSpans.c b/hw/xfree86/xaa/xaaSpans.c
deleted file mode 100644
index 522225665..000000000
--- a/hw/xfree86/xaa/xaaSpans.c
+++ /dev/null
@@ -1,880 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaSpans.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "mispans.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-
-static void XAARenderSolidSpans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderColor8x8Spans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderMono8x8Spans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderCacheBltSpans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderColorExpandSpans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderCacheExpandSpans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-static void XAARenderPixmapCopySpans(
- GCPtr, int, DDXPointPtr, int*, int, int, int);
-
-void
-XAAFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit, /* number of spans to fill */
- DDXPointPtr pptInit, /* pointer to list of start points */
- int *pwidthInit, /* pointer to list of n widths */
- int fSorted
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int type = 0;
- ClipAndRenderSpansFunc function;
- Bool fastClip = FALSE;
-
- if((nInit <= 0) || !pGC->planemask)
- return;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- switch(pGC->fillStyle) {
- case FillSolid:
- type = DO_SOLID;
- break;
- case FillStippled:
- type = (*infoRec->StippledFillChooser)(pGC);
- break;
- case FillOpaqueStippled:
- if((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSpansSolid &&
- CHECK_PLANEMASK(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_ROP(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_ROPSRC(pGC,infoRec->FillSpansSolidFlags) &&
- CHECK_FG(pGC,infoRec->FillSpansSolidFlags))
- type = DO_SOLID;
- else
- type = (*infoRec->OpaqueStippledFillChooser)(pGC);
- break;
- case FillTiled:
- type = (*infoRec->TiledFillChooser)(pGC);
- break;
- }
-
- switch(type) {
- case DO_SOLID:
- function = XAARenderSolidSpans;
- if(infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL)
- fastClip = TRUE;
- break;
- case DO_COLOR_8x8:
- function = XAARenderColor8x8Spans;
- if(infoRec->ClippingFlags & HARDWARE_CLIP_COLOR_8x8_FILL)
- fastClip = TRUE;
- break;
- case DO_MONO_8x8:
- function = XAARenderMono8x8Spans;
- if(infoRec->ClippingFlags & HARDWARE_CLIP_MONO_8x8_FILL)
- fastClip = TRUE;
- break;
- case DO_CACHE_BLT:
- function = XAARenderCacheBltSpans;
- if(infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
- fastClip = TRUE;
- break;
- case DO_COLOR_EXPAND:
- function = XAARenderColorExpandSpans;
- break;
- case DO_CACHE_EXPAND:
- function = XAARenderCacheExpandSpans;
- if(infoRec->ClippingFlags &
- HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND)
- fastClip = TRUE;
- break;
- case DO_PIXMAP_COPY:
- function = XAARenderPixmapCopySpans;
- if(infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
- fastClip = TRUE;
- break;
- case DO_IMAGE_WRITE:
- default:
- (*XAAFallbackOps.FillSpans)(pDraw, pGC, nInit, pptInit,
- pwidthInit, fSorted);
- return;
- }
-
-
- if((nInit < 10) || (REGION_NUM_RECTS(pGC->pCompositeClip) != 1))
- fastClip = FALSE;
-
- if(fastClip) {
- infoRec->ClipBox = &pGC->pCompositeClip->extents;
- (*function)(pGC, nInit, pptInit, pwidthInit, fSorted,
- pDraw->x, pDraw->y);
- infoRec->ClipBox = NULL;
- } else
- XAAClipAndRenderSpans(pGC, pptInit, pwidthInit, nInit, fSorted,
- function, pDraw->x, pDraw->y);
-}
-
-
- /*********************\
- | Solid Spans |
- \*********************/
-
-
-static void
-XAARenderSolidSpans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- (*infoRec->FillSolidSpans) (infoRec->pScrn, pGC->fgPixel,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted);
-}
-
-
- /************************\
- | Mono 8x8 Spans |
- \************************/
-
-
-static void
-XAARenderMono8x8Spans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAPixmapPtr pPriv;
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- case FillTiled:
- pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- fg = pPriv->fg; bg = pPriv->bg;
- break;
- default: /* Muffle compiler */
- pPriv = NULL; /* Kaboom */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillMono8x8PatternSpans) (infoRec->pScrn,
- fg, bg, pGC->alu, pGC->planemask,
- n, ppt, pwidth, fSorted, pPriv->pattern0, pPriv->pattern1,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
-}
-
-
- /*************************\
- | Color 8x8 Spans |
- \*************************/
-
-
-static void
-XAARenderColor8x8Spans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache;
- PixmapPtr pPix;
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pPix = pGC->stipple;
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- pPix = pGC->stipple;
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- case FillTiled:
- pPix = pGC->tile.pixmap;
- fg = -1; bg = -1;
- break;
- default: /* Muffle compiler */
- pPix = NULL;
- fg = -1; bg = -1;
- break;
- }
-
- pCache = (*infoRec->CacheColor8x8Pattern)(infoRec->pScrn, pPix, fg, bg);
-
- (*infoRec->FillColor8x8PatternSpans) (infoRec->pScrn,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
- (yorg + pGC->patOrg.x), (xorg + pGC->patOrg.y));
-}
-
-
- /****************************\
- | Color Expand Spans |
- \****************************/
-
-
-static void
-XAARenderColorExpandSpans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- default: /* Muffle compiler */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillColorExpandSpans) (infoRec->pScrn, fg, bg,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pGC->stipple);
-
-}
-
-
- /*************************\
- | Cache Blt Spans |
- \*************************/
-
-
-static void
-XAARenderCacheBltSpans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
- pGC->fgPixel, -1);
- break;
- case FillOpaqueStippled:
- pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
- pGC->fgPixel, pGC->bgPixel);
- break;
- case FillTiled:
- pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
- break;
- default: /* Muffle compiler */
- pCache = NULL;
- break;
- }
-
- (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
-
-}
-
-
- /****************************\
- | Cache Expand Spans |
- \****************************/
-
-
-static void
-XAARenderCacheExpandSpans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int fg, bg;
-
- switch(pGC->fillStyle) {
- case FillStippled:
- fg = pGC->fgPixel; bg = -1;
- break;
- case FillOpaqueStippled:
- fg = pGC->fgPixel; bg = pGC->bgPixel;
- break;
- default: /* Muffle compiler */
- fg = -1; bg = -1;
- break;
- }
-
- (*infoRec->FillCacheExpandSpans) (infoRec->pScrn, fg, bg,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
- pGC->stipple);
-}
-
-
- /***************************\
- | Pixmap Copy Spans |
- \***************************/
-
-
-static void
-XAARenderPixmapCopySpans(
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
- pCache->x = pPriv->offscreenArea->box.x1;
- pCache->y = pPriv->offscreenArea->box.y1;
- pCache->w = pCache->orig_w =
- pPriv->offscreenArea->box.x2 - pCache->x;
- pCache->h = pCache->orig_h =
- pPriv->offscreenArea->box.y2 - pCache->y;
- pCache->trans_color = -1;
-
- (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
- pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
- (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
-}
-
-
-
-
-
- /****************\
- | Solid |
- \****************/
-
-
-void
-XAAFillSolidSpans(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
-
- (*infoRec->SetupForSolidFill)(pScrn, fg, rop, planemask);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- if (*pwidth > 0)
- (*infoRec->SubsequentSolidFillRect)(pScrn, ppt->x, ppt->y,
- *pwidth, 1);
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
- /***************\
- | Mono 8x8 |
- \***************/
-
-
-void
-XAAFillMono8x8PatternSpansScreenOrigin(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- int pattern0, int pattern1,
- int xorigin, int yorigin
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pattern0, paty = pattern1;
- int xorg = (-xorigin) & 0x07;
- int yorg = (-yorigin) & 0x07;
-
-
- if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- }
- } else {
- XAACacheInfoPtr pCache =
- (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
- patx = pCache->x; paty = pCache->y;
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- patx += pCache->offsets[slot].x;
- paty += pCache->offsets[slot].y;
- xorg = patx; yorg = paty;
- }
- }
-
- (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
- fg, bg, rop, planemask);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
- xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-void
-XAAFillMono8x8PatternSpans(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- int pattern0, int pattern1,
- int xorigin, int yorigin
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pattern0, paty = pattern1;
- int xorg, yorg, slot;
- XAACacheInfoPtr pCache = NULL;
-
-
- if(!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)){
- pCache = (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
- patx = pCache->x; paty = pCache->y;
- }
-
- (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
- fg, bg, rop, planemask);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- xorg = (ppt->x - xorigin) & 0x07;
- yorg = (ppt->y - yorigin) & 0x07;
-
- if(!(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- if(infoRec->Mono8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_BITS) {
- patx = pattern0; paty = pattern1;
- XAARotateMonoPattern(&patx, &paty, xorg, yorg,
- (infoRec->Mono8x8PatternFillFlags &
- BIT_ORDER_IN_BYTE_MSBFIRST));
- xorg = patx; yorg = paty;
- } else {
- slot = (yorg << 3) + xorg;
- xorg = patx + pCache->offsets[slot].x;
- yorg = paty + pCache->offsets[slot].y;
- }
- }
-
- (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
- xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
- /****************\
- | Color 8x8 |
- \****************/
-
-
-void
-XAAFillColor8x8PatternSpansScreenOrigin(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- XAACacheInfoPtr pCache,
- int xorigin, int yorigin
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int patx = pCache->x, paty = pCache->y;
- int xorg = (-xorigin) & 0x07;
- int yorg = (-yorigin) & 0x07;
-
-
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- int slot = (yorg << 3) + xorg;
- paty += pCache->offsets[slot].y;
- patx += pCache->offsets[slot].x;
- xorg = patx; yorg = paty;
- }
-
- (*infoRec->SetupForColor8x8PatternFill)(pScrn, patx, paty,
- rop, planemask, pCache->trans_color);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
- xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-void
-XAAFillColor8x8PatternSpans(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- XAACacheInfoPtr pCache,
- int xorigin, int yorigin
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int xorg, yorg, slot;
-
- (*infoRec->SetupForColor8x8PatternFill)(pScrn, pCache->x, pCache->y,
- rop, planemask, pCache->trans_color);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- xorg = (ppt->x - xorigin) & 0x07;
- yorg = (ppt->y - yorigin) & 0x07;
-
- if(!(infoRec->Color8x8PatternFillFlags &
- HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
- slot = (yorg << 3) + xorg;
- yorg = pCache->y + pCache->offsets[slot].y;
- xorg = pCache->x + pCache->offsets[slot].x;
- }
-
- (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
- xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
- /*****************\
- | Cache Blit |
- \*****************/
-
-
-void
-XAAFillCacheBltSpans(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- XAACacheInfoPtr pCache,
- int xorg, int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, w, phaseX, phaseY, blit_w;
-
- (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, rop, planemask,
- pCache->trans_color);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- x = ppt->x;
- w = *pwidth;
- phaseX = (x - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
- phaseY = (ppt->y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
-
- while(1) {
- blit_w = pCache->w - phaseX;
- if(blit_w > w) blit_w = w;
-
- (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
- pCache->x + phaseX, pCache->y + phaseY,
- x, ppt->y, blit_w, 1);
-
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- phaseX = (phaseX + blit_w) % pCache->orig_w;
- }
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
- /****************\
- | Cache Expand |
- \****************/
-
-
-void
-XAAFillCacheExpandSpans(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int x, w, phaseX, phaseY, blit_w, cacheWidth;
- XAACacheInfoPtr pCache;
-
- pCache = (*infoRec->CacheMonoStipple)(pScrn, pPix);
-
- cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
- infoRec->CacheColorExpandDensity;
-
- (*infoRec->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop,
- planemask);
-
- if(infoRec->ClipBox)
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
-
- while(n--) {
- x = ppt->x;
- w = *pwidth;
- phaseX = (x - xorg) % pCache->orig_w;
- if(phaseX < 0) phaseX += pCache->orig_w;
- phaseY = (ppt->y - yorg) % pCache->orig_h;
- if(phaseY < 0) phaseY += pCache->orig_h;
-
- while(1) {
- blit_w = cacheWidth - phaseX;
- if(blit_w > w) blit_w = w;
-
- (*infoRec->SubsequentScreenToScreenColorExpandFill)(
- pScrn, x, ppt->y, blit_w, 1,
- pCache->x, pCache->y + phaseY, phaseX);
-
- w -= blit_w;
- if(!w) break;
- x += blit_w;
- phaseX = (phaseX + blit_w) % pCache->orig_w;
- }
- ppt++; pwidth++;
- }
-
- if(infoRec->ClipBox)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-
-
-void
-XAAClipAndRenderSpans(
- GCPtr pGC,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted,
- ClipAndRenderSpansFunc func,
- int xorg,
- int yorg
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- DDXPointPtr pptNew, pptBase;
- int *pwidthBase, *pwidthNew;
- int Right, numRects, MaxBoxes;
-
- MaxBoxes = infoRec->PreAllocSize/(sizeof(DDXPointRec) + sizeof(int));
- pptBase = (DDXPointRec*)infoRec->PreAllocMem;
- pwidthBase = (int*)(&pptBase[MaxBoxes]);
-
- pptNew = pptBase;
- pwidthNew = pwidthBase;
-
- numRects = REGION_NUM_RECTS(pGC->pCompositeClip);
-
- if(numRects == 1) {
- BoxPtr pextent = REGION_RECTS(pGC->pCompositeClip);
-
- while(nspans--) {
- if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) {
- pptNew->x = max(pextent->x1, ppt->x);
- Right = ppt->x + *pwidth;
- *pwidthNew = min(pextent->x2, Right) - pptNew->x;
-
- if (*pwidthNew > 0) {
- pptNew->y = ppt->y;
- pptNew++;
- pwidthNew++;
-
- if(pptNew >= (pptBase + MaxBoxes)) {
- (*func)(pGC, MaxBoxes, pptBase, pwidthBase, fSorted,
- xorg, yorg);
- pptNew = pptBase;
- pwidthNew = pwidthBase;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- } else if (numRects) {
- BoxPtr pbox;
- int nbox;
-
- while(nspans--) {
- nbox = numRects;
- pbox = REGION_RECTS(pGC->pCompositeClip);
-
- /* find the first band */
- while(nbox && (pbox->y2 <= ppt->y)) {
- pbox++;
- nbox--;
- }
-
- if(nbox && (pbox->y1 <= ppt->y)) {
- int orig_y = pbox->y1;
- Right = ppt->x + *pwidth;
- while(nbox && (orig_y == pbox->y1)) {
- if(pbox->x2 <= ppt->x) {
- nbox--;
- pbox++;
- continue;
- }
-
- if(pbox->x1 >= Right) {
- nbox = 0;
- break;
- }
-
- pptNew->x = max(pbox->x1, ppt->x);
- *pwidthNew = min(pbox->x2, Right) - pptNew->x;
- if(*pwidthNew > 0) {
- pptNew->y = ppt->y;
- pptNew++;
- pwidthNew++;
-
- if(pptNew >= (pptBase + MaxBoxes)) {
- (*func)(pGC, MaxBoxes, pptBase, pwidthBase,
- fSorted, xorg, yorg);
- pptNew = pptBase;
- pwidthNew = pwidthBase;
- }
- }
- pbox++;
- nbox--;
- }
- }
- ppt++;
- pwidth++;
- }
- }
-
- if(pptNew != pptBase)
- (*func)(pGC, pptNew - pptBase, pptBase, pwidthBase, fSorted,
- xorg, yorg);
-}
diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c
deleted file mode 100644
index b27a54e81..000000000
--- a/hw/xfree86/xaa/xaaStateChange.c
+++ /dev/null
@@ -1,1678 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.3 2003/08/22 19:27:31 eich Exp $ */
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "mi.h"
-#include "miline.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "servermd.h"
-
-#define XAA_STATE_WRAP(func) do {\
-if(infoRec->func) { \
- pStatePriv->func = infoRec->func;\
- infoRec->func = XAAStateWrap##func;\
-}} while(0)
-
-/* Wrap all XAA functions and allocate our private structure.
- */
-
-typedef struct _XAAStateWrapRec {
- ScrnInfoPtr pScrn;
- void (*RestoreAccelState)(ScrnInfoPtr pScrn);
- void (*Sync)(ScrnInfoPtr pScrn);
- void (*SetupForScreenToScreenCopy)(ScrnInfoPtr pScrn, int xdir, int ydir,
- int rop, unsigned int planemask,
- int trans_color);
- void (*SetupForSolidFill)(ScrnInfoPtr pScrn, int color, int rop,
- unsigned int planemask);
- void (*SetupForSolidLine)(ScrnInfoPtr pScrn,int color,int rop,
- unsigned int planemask);
- void (*SetupForDashedLine)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int length,
- unsigned char *pattern);
- void (*SetClippingRectangle) (ScrnInfoPtr pScrn, int left, int top,
- int right, int bottom);
- void (*DisableClipping)(ScrnInfoPtr pScrn);
- void (*SetupForMono8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
- int fg, int bg, int rop,
- unsigned int planemask);
- void (*SetupForColor8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
- int rop, unsigned int planemask,
- int transparency_color);
- void (*SetupForCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn, int fg,
- int bg, int rop,
- unsigned int planemask);
- void (*SetupForScanlineCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask);
- void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask);
- void (*SetupForImageWrite)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int transparency_color,
- int bpp, int depth);
- void (*SetupForScanlineImageWrite)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth);
- void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth);
- void (*ScreenToScreenBitBlt)(ScrnInfoPtr pScrn, int nbox,
- DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
- int ydir, int alu, unsigned int planmask);
- void (*WriteBitmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int skipleft,
- int fg, int bg, int rop, unsigned int planemask);
- void (*FillSolidRects)(ScrnInfoPtr pScrn, int fg, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox);
- void (*FillMono8x8PatternRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int pat0, int pat1,
- int xorg, int yorg);
- void (*FillColor8x8PatternRects)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int xorg, int yorg,
- XAACacheInfoPtr pCache);
- void (*FillCacheBltRects)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox,
- int xorg, int yorg, XAACacheInfoPtr pCache);
- void (*FillColorExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int xorg, int yorg,
- PixmapPtr pPix);
- void (*FillCacheExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox,
- int xorg, int yorg, PixmapPtr pPix);
- void (*FillImageWriteRects)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox,
- int xorg, int yorg, PixmapPtr pPix);
- void (*FillSolidSpans)(ScrnInfoPtr pScrn, int fg, int rop,
- unsigned int planemask, int n, DDXPointPtr points,
- int *widths, int fSorted);
- void (*FillMono8x8PatternSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths,
- int fSorted, int pat0, int pat1,
- int xorg, int yorg);
- void (*FillColor8x8PatternSpans)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths,
- int fSorted, XAACacheInfoPtr pCache,
- int xorg, int yorg);
- void (*FillCacheBltSpans)(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int n, DDXPointPtr points,
- int *widths, int fSorted, XAACacheInfoPtr pCache,
- int xorg, int yorg);
- void (*FillColorExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths, int fSorted,
- int xorg, int yorg, PixmapPtr pPix);
- void (*FillCacheExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int n, DDXPointPtr ppt,
- int *pwidth, int fSorted, int xorg, int yorg,
- PixmapPtr pPix);
- void (*TEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- int skipleft, int startline, unsigned int **glyphs,
- int glyphWidth, int fg, int bg, int rop,
- unsigned planemask);
- void (*NonTEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int n,
- NonTEGlyphPtr glyphs, BoxPtr pbox,
- int fg, int rop, unsigned int planemask);
- void (*WritePixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int rop,
- unsigned int planemask, int transparency_color,
- int bpp, int depth);
- void (*ReadPixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *dst, int dstwidth, int bpp, int depth);
- RegionPtr (*CopyArea)(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GC *pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty);
- RegionPtr (*CopyPlane)(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height, int dstx,
- int dsty, unsigned long bitPlane);
- void (*PushPixelsSolid) (GCPtr pGC, PixmapPtr pBitMap,
- DrawablePtr pDrawable, int dx, int dy, int xOrg,
- int yOrg);
- void (*PolyFillRectSolid)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit);
- void (*PolyFillRectStippled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit);
- void (*PolyFillRectOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC,
- int nrectFill, xRectangle *prectInit);
- void (*PolyFillRectTiled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit);
- void (*FillSpansSolid)(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted);
- void (*FillSpansStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted);
- void (*FillSpansOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted);
- void (*FillSpansTiled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted);
- int (*PolyText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
- char *chars);
- int (*PolyText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
- unsigned short *chars);
- void (*ImageText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
- char *chars);
- void (*ImageText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars);
- void (*ImageGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci,
- pointer pglyphBase);
- void (*PolyGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci,
- pointer pglyphBase);
- int (*PolyText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars);
- int (*PolyText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars);
- void (*ImageText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars);
- void (*ImageText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars);
- void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
- void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
- void (*PolyRectangleThinSolid)(DrawablePtr pDrawable,GCPtr pGC,
- int nRectsInit, xRectangle *pRectsInit);
- void (*PolylinesWideSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts);
- void (*PolylinesThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts);
- void (*PolySegmentThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
- xSegment *pSeg);
- void (*PolylinesThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts);
- void (*PolySegmentThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
- xSegment *pSeg);
- void (*FillPolygonSolid)(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn);
- void (*FillPolygonStippled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn);
- void (*FillPolygonOpaqueStippled)(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr ptsIn);
- void (*FillPolygonTiled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn);
- void (*PolyFillArcSolid)(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs);
- void (*PutImage)(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage);
- ValidateGCProcPtr ValidateFillSpans;
- ValidateGCProcPtr ValidateSetSpans;
- ValidateGCProcPtr ValidatePutImage;
- ValidateGCProcPtr ValidateCopyArea;
- ValidateGCProcPtr ValidateCopyPlane;
- ValidateGCProcPtr ValidatePolyPoint;
- ValidateGCProcPtr ValidatePolylines;
- ValidateGCProcPtr ValidatePolySegment;
- ValidateGCProcPtr ValidatePolyRectangle;
- ValidateGCProcPtr ValidatePolyArc;
- ValidateGCProcPtr ValidateFillPolygon;
- ValidateGCProcPtr ValidatePolyFillRect;
- ValidateGCProcPtr ValidatePolyFillArc;
- ValidateGCProcPtr ValidatePolyText8;
- ValidateGCProcPtr ValidatePolyText16;
- ValidateGCProcPtr ValidateImageText8;
- ValidateGCProcPtr ValidateImageText16;
- ValidateGCProcPtr ValidatePolyGlyphBlt;
- ValidateGCProcPtr ValidateImageGlyphBlt;
- ValidateGCProcPtr ValidatePushPixels;
- void (*ComputeDash)(GCPtr pGC);
- void (*InitPixmapCache)(ScreenPtr pScreen, RegionPtr areas, pointer data);
- void (*ClosePixmapCache)(ScreenPtr pScreen);
- int (*StippledFillChooser)(GCPtr pGC);
- int (*OpaqueStippledFillChooser)(GCPtr pGC);
- int (*TiledFillChooser)(GCPtr pGC);
- XAACacheInfoPtr (*CacheTile)(ScrnInfoPtr Scrn, PixmapPtr pPix);
- XAACacheInfoPtr (*CacheStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg,
- int bg);
- XAACacheInfoPtr (*CacheMonoStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix);
- XAACacheInfoPtr (*CacheMono8x8Pattern)(ScrnInfoPtr Scrn, int pat0,
- int pat1);
- XAACacheInfoPtr (*CacheColor8x8Pattern)(ScrnInfoPtr Scrn, PixmapPtr pPix,
- int fg, int bg);
- void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int fg,
- int bg);
- void (*WritePixmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int bpp,
- int depth);
- void (*WriteMono8x8PatternToCache)(ScrnInfoPtr pScrn,
- XAACacheInfoPtr pCache);
- void (*WriteColor8x8PatternToCache)(ScrnInfoPtr pScrn, PixmapPtr pPix,
- XAACacheInfoPtr pCache);
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- BackingStoreSaveAreasProcPtr SaveAreas;
- BackingStoreRestoreAreasProcPtr RestoreAreas;
-#ifdef RENDER
- Bool (*SetupForCPUToScreenAlphaTexture)(ScrnInfoPtr pScrn, int op,
- CARD16 red, CARD16 green,
- CARD16 blue, CARD16 alpha,
- int alphaType, CARD8 *alphaPtr,
- int alphaPitch, int width,
- int height, int flags);
- Bool (*SetupForCPUToScreenTexture)(ScrnInfoPtr pScrn, int op, int texType,
- CARD8 *texPtr, int texPitch,
- int width, int height, int flags);
-#endif
-} XAAStateWrapRec, *XAAStateWrapPtr;
-
-static int XAAStateIndex = -1;
-static unsigned long XAAStateGeneration = 0;
-
-/* Wrap functions start here */
-#define GET_STATEPRIV_GC(pGC) XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)(pGC->pScreen->devPrivates[XAAStateIndex].ptr)
-
-#define GET_STATEPRIV_SCREEN(pScreen) XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)(pScreen->devPrivates[XAAStateIndex].ptr)
-
-#define GET_STATEPRIV_PSCRN(pScrn) XAAStateWrapPtr pStatePriv =\
-(XAAStateWrapPtr)(pScrn->pScreen->devPrivates[XAAStateIndex].ptr)
-
-#define STATE_CHECK_SP(pStatePriv) {\
- ScrnInfoPtr pScrn = pStatePriv->pScrn;\
- int i = 0;\
- int need_change = 0;\
- while(i < pScrn->numEntities) {\
- if(xf86IsEntityShared(pScrn->entityList[i]) &&\
- xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
- need_change = 1;\
- xf86SetLastScrnFlag(pScrn->entityList[i],\
- pScrn->scrnIndex);\
- }\
- i++;\
- }\
- if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
-}
-
-#define STATE_CHECK_PSCRN(pScrn) {\
- int i = 0;\
- int need_change = 0;\
- while(i < pScrn->numEntities) {\
- if(xf86IsEntityShared(pScrn->entityList[i]) &&\
- xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
- need_change = 1;\
- xf86SetLastScrnFlag(pScrn->entityList[i],\
- pScrn->scrnIndex);\
- }\
- i++;\
- }\
- if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
-}
-
-static void XAAStateWrapSync(ScrnInfoPtr pScrn)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->Sync)(pScrn);
-}
-
-static void XAAStateWrapSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir,
- int rop, unsigned int planemask,
- int trans_color)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForScreenToScreenCopy)(pScrn, xdir, ydir, rop, planemask,
- trans_color);
-}
-
-static void XAAStateWrapSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForSolidFill)(pScrn, color, rop, planemask);
-}
-
-static void XAAStateWrapSetupForSolidLine(ScrnInfoPtr pScrn,int color,int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForSolidLine)(pScrn, color, rop, planemask);
-}
-
-static void XAAStateWrapSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int length,
- unsigned char *pattern)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForDashedLine)(pScrn, fg, bg, rop, planemask, length, pattern);
-}
-
-static void XAAStateWrapSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top,
- int right, int bottom)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetClippingRectangle)(pScrn, left, top, right, bottom);
-}
-
-static void XAAStateWrapDisableClipping(ScrnInfoPtr pScrn)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->DisableClipping)(pScrn);
-}
-
-static void XAAStateWrapSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
- int fg, int bg, int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForMono8x8PatternFill)(pScrn, patx, paty, fg, bg, rop, planemask);
-}
-
-static void XAAStateWrapSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
- int rop, unsigned int planemask,
- int transparency_color)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForColor8x8PatternFill)(pScrn, patx, paty, rop, planemask,
- transparency_color);
-}
-
-static void XAAStateWrapSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
- int bg, int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForCPUToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
-}
-
-static void XAAStateWrapSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg,
- int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForScanlineCPUToScreenColorExpandFill)(pScrn, fg, bg, rop,
- planemask);
-}
-
-static void XAAStateWrapSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
-}
-
-static void XAAStateWrapSetupForImageWrite(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int transparency_color,
- int bpp, int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForImageWrite)(pScrn, rop, planemask, transparency_color, bpp,
- depth);
-}
-
-static void XAAStateWrapSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForScanlineImageWrite)(pScrn, rop, planemask, transparency_color,
- bpp, depth);
-}
-
-static void XAAStateWrapSetupForImageRead(ScrnInfoPtr pScrn, int bpp, int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->SetupForImageRead)(pScrn, bpp, depth);
-}
-
-static void XAAStateWrapScreenToScreenBitBlt(ScrnInfoPtr pScrn, int nbox,
- DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
- int ydir, int alu, unsigned int planmask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->ScreenToScreenBitBlt)(pScrn, nbox,
- pptSrc, pbox, xdir,
- ydir, alu, planmask);
-}
-
-static void XAAStateWrapWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int skipleft,
- int fg, int bg, int rop, unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WriteBitmap)(pScrn, x, y, w, h,
- src, srcwidth, skipleft,
- fg, bg, rop, planemask);
-}
-
-static void XAAStateWrapFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillSolidRects)(pScrn, fg, rop,
- planemask, nBox, pBox);
-}
-
-static void XAAStateWrapFillMono8x8PatternRects(ScrnInfoPtr pScrn, int fg, int bg,
- int rop, unsigned int planemask, int nBox,
- BoxPtr pBox, int pat0, int pat1,
- int xorg, int yorg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillMono8x8PatternRects)(pScrn, fg, bg,
- rop, planemask, nBox,
- pBox, pat0, pat1,
- xorg, yorg);
-}
-
-static void XAAStateWrapFillColor8x8PatternRects(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int xorg, int yorg,
- XAACacheInfoPtr pCache)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillColor8x8PatternRects)(pScrn, rop,
- planemask, nBox,
- pBox, xorg, yorg,
- pCache);
-}
-
-static void XAAStateWrapFillCacheBltRects(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox,
- int xorg, int yorg, XAACacheInfoPtr pCache)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillCacheBltRects)(pScrn, rop,
- planemask, nBox, pBox,
- xorg, yorg, pCache);
-}
-
-static void XAAStateWrapFillColorExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int xorg, int yorg,
- PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillColorExpandRects)(pScrn, fg, bg, rop,
- planemask, nBox,
- pBox, xorg, yorg,
- pPix);
-}
-
-static void XAAStateWrapFillCacheExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int nBox,
- BoxPtr pBox, int xorg, int yorg,
- PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillCacheExpandRects)(pScrn, fg, bg, rop,
- planemask, nBox,
- pBox, xorg, yorg,
- pPix);
-}
-
-static void XAAStateWrapFillImageWriteRects(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int nBox, BoxPtr pBox,
- int xorg, int yorg, PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillImageWriteRects)(pScrn, rop,
- planemask, nBox, pBox,
- xorg, yorg, pPix);
-}
-
-static void XAAStateWrapFillSolidSpans(ScrnInfoPtr pScrn, int fg, int rop,
- unsigned int planemask, int n, DDXPointPtr points,
- int *widths, int fSorted)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillSolidSpans)(pScrn, fg, rop,
- planemask, n, points,
- widths, fSorted);
-}
-
-static void XAAStateWrapFillMono8x8PatternSpans(ScrnInfoPtr pScrn, int fg, int bg,
- int rop, unsigned int planemask, int n,
- DDXPointPtr points, int *widths,
- int fSorted, int pat0, int pat1,
- int xorg, int yorg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillMono8x8PatternSpans)(pScrn, fg, bg,
- rop, planemask, n,
- points, widths,
- fSorted, pat0, pat1,
- xorg, yorg);
-}
-
-static void XAAStateWrapFillColor8x8PatternSpans(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths,
- int fSorted, XAACacheInfoPtr pCache,
- int xorg, int yorg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillColor8x8PatternSpans)(pScrn, rop,
- planemask, n,
- points, widths,
- fSorted, pCache,
- xorg, yorg);
-}
-
-static void XAAStateWrapFillCacheBltSpans(ScrnInfoPtr pScrn, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths,
- int fSorted, XAACacheInfoPtr pCache,
- int xorg, int yorg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillCacheBltSpans)(pScrn, rop,
- planemask, n,
- points, widths,
- fSorted, pCache,
- xorg, yorg);
-}
-
-static void XAAStateWrapFillColorExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int n,
- DDXPointPtr points, int *widths, int fSorted,
- int xorg, int yorg, PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillColorExpandSpans)(pScrn, fg, bg, rop,
- planemask, n,
- points, widths, fSorted,
- xorg, yorg, pPix);
-}
-
-static void XAAStateWrapFillCacheExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
- unsigned int planemask, int n,
- DDXPointPtr ppt, int *pwidth, int fSorted,
- int xorg, int yorg, PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->FillCacheExpandSpans)(pScrn, fg, bg, rop,
- planemask, n,
- ppt, pwidth, fSorted,
- xorg, yorg, pPix);
-}
-
-static void XAAStateWrapTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- int skipleft, int startline,
- unsigned int **glyphs,
- int glyphWidth, int fg, int bg, int rop,
- unsigned planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->TEGlyphRenderer)(pScrn, x, y, w, h,
- skipleft, startline,
- glyphs,
- glyphWidth, fg, bg, rop,
- planemask);
-}
-
-static void XAAStateWrapNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n,
- NonTEGlyphPtr glyphs, BoxPtr pbox,
- int fg, int rop, unsigned int planemask)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->NonTEGlyphRenderer)(pScrn, x, y, n,
- glyphs, pbox,
- fg, rop, planemask);
-}
-
-static void XAAStateWrapWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int rop,
- unsigned int planemask, int transparency_color,
- int bpp, int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WritePixmap)(pScrn, x, y, w, h,
- src, srcwidth, rop,
- planemask, transparency_color,
- bpp, depth);
-}
-
-static void XAAStateWrapReadPixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *dst, int dstwidth, int bpp, int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->ReadPixmap)(pScrn, x, y, w, h,
- dst, dstwidth, bpp, depth);
-}
-
-static RegionPtr XAAStateWrapCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GC *pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height,
- dstx, dsty);
-}
-
-static RegionPtr XAAStateWrapCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long bitPlane)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->CopyPlane)(pSrc, pDst, pGC,
- srcx, srcy, width, height,
- dstx, dsty, bitPlane);
-}
-
-static void XAAStateWrapPushPixelsSolid(GCPtr pGC, PixmapPtr pBitMap,
- DrawablePtr pDrawable, int dx, int dy, int xOrg,
- int yOrg)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PushPixelsSolid)(pGC, pBitMap,
- pDrawable, dx, dy, xOrg,
- yOrg);
-}
-
-static void XAAStateWrapPolyFillRectSolid(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyFillRectSolid)(pDraw, pGC, nrectFill,
- prectInit);
-}
-
-static void XAAStateWrapPolyFillRectStippled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyFillRectStippled)(pDraw, pGC, nrectFill,
- prectInit);
-}
-
-static void XAAStateWrapPolyFillRectOpaqueStippled(DrawablePtr pDraw, GCPtr pGC,
- int nrectFill, xRectangle *prectInit)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyFillRectOpaqueStippled)(pDraw, pGC,
- nrectFill, prectInit);
-}
-
-static void XAAStateWrapPolyFillRectTiled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
- xRectangle *prectInit)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyFillRectTiled)(pDraw, pGC, nrectFill,
- prectInit);
-}
-
-static void XAAStateWrapFillSpansSolid(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillSpansSolid)(pDraw, pGC, nInit,
- ppt, pwidth, fSorted);
-}
-
-static void XAAStateWrapFillSpansStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillSpansStippled)(pDraw, pGC, nInit,
- ppt, pwidth, fSorted);
-}
-
-static void XAAStateWrapFillSpansOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillSpansOpaqueStippled)(pDraw, pGC, nInit,
- ppt, pwidth, fSorted);
-}
-
-static void XAAStateWrapFillSpansTiled(DrawablePtr pDraw, GCPtr pGC, int nInit,
- DDXPointPtr ppt, int *pwidth, int fSorted)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillSpansTiled)(pDraw, pGC, nInit,
- ppt, pwidth, fSorted);
-}
-
-static int XAAStateWrapPolyText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
- char *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->PolyText8TE)(pDraw, pGC, x, y, count,
- chars);
-}
-
-static int XAAStateWrapPolyText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
- unsigned short *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->PolyText16TE)(pDraw, pGC, x, y, count,
- chars);
-}
-
-static void XAAStateWrapImageText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageText8TE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static void XAAStateWrapImageText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageText16TE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static void XAAStateWrapImageGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci,
- pointer pglyphBase)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageGlyphBltTE)(pDrawable, pGC, xInit,
- yInit, nglyph, ppci,
- pglyphBase);
-}
-
-static void XAAStateWrapPolyGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci,
- pointer pglyphBase)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyGlyphBltTE)(pDrawable, pGC, xInit,
- yInit, nglyph, ppci,
- pglyphBase);
-}
-
-static int XAAStateWrapPolyText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->PolyText8NonTE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static int XAAStateWrapPolyText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->PolyText16NonTE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static void XAAStateWrapImageText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageText8NonTE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static void XAAStateWrapImageText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageText16NonTE)(pDraw, pGC, x, y,
- count, chars);
-}
-
-static void XAAStateWrapImageGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ImageGlyphBltNonTE)(pDrawable, pGC, xInit,
- yInit, nglyph,
- ppci, pglyphBase);
-}
-
-static void XAAStateWrapPolyGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyGlyphBltNonTE)(pDrawable, pGC, xInit,
- yInit, nglyph,
- ppci, pglyphBase);
-}
-
-static void XAAStateWrapPolyRectangleThinSolid(DrawablePtr pDrawable,GCPtr pGC,
- int nRectsInit, xRectangle *pRectsInit)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyRectangleThinSolid)(pDrawable, pGC,
- nRectsInit, pRectsInit);
-}
-
-static void XAAStateWrapPolylinesWideSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolylinesWideSolid)(pDrawable, pGC, mode,
- npt, pPts);
-}
-
-static void XAAStateWrapPolylinesThinSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolylinesThinSolid)(pDrawable, pGC, mode,
- npt, pPts);
-}
-
-static void XAAStateWrapPolySegmentThinSolid(DrawablePtr pDrawable, GCPtr pGC, int nseg,
- xSegment *pSeg)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolySegmentThinSolid)(pDrawable, pGC, nseg,
- pSeg);
-}
-
-static void XAAStateWrapPolylinesThinDashed(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pPts)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolylinesThinDashed)(pDrawable, pGC, mode,
- npt, pPts);
-}
-
-static void XAAStateWrapPolySegmentThinDashed(DrawablePtr pDrawable, GCPtr pGC, int nseg,
- xSegment *pSeg)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolySegmentThinDashed)(pDrawable, pGC, nseg,
- pSeg);
-}
-
-static void XAAStateWrapFillPolygonSolid(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillPolygonSolid)(pDrawable, pGC, shape,
- mode, count, ptsIn);
-}
-
-static void XAAStateWrapFillPolygonStippled(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillPolygonStippled)(pDrawable, pGC, shape,
- mode, count, ptsIn);
-}
-
-static void XAAStateWrapFillPolygonOpaqueStippled(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr ptsIn)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillPolygonOpaqueStippled)(pDrawable, pGC,
- shape, mode, count,
- ptsIn);
-}
-
-static void XAAStateWrapFillPolygonTiled(DrawablePtr pDrawable, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->FillPolygonTiled)(pDrawable, pGC, shape,
- mode, count, ptsIn);
-}
-
-static void XAAStateWrapPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PolyFillArcSolid)(pDraw, pGC, narcs,
- parcs);
-}
-
-static void XAAStateWrapPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PutImage)(pDraw, pGC, depth, x, y,
- w, h, leftPad, format, pImage);
-}
-
-static void XAAStateWrapValidateFillSpans(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateFillSpans)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateSetSpans(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateSetSpans)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePutImage(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePutImage)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateCopyArea(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateCopyArea)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateCopyPlane(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateCopyPlane)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyPoint(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyPoint)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolylines(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolylines)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolySegment(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolySegment)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyRectangle(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyRectangle)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyArc(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyArc)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateFillPolygon(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateFillPolygon)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyFillRect(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyFillRect)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyFillArc(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyFillArc)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyText8(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyText8)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyText16(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyText16)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateImageText8(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateImageText8)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateImageText16(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidateImageText16)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePolyGlyphBlt)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidateImageGlyphBlt(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
- (*pStatePriv->ValidateImageGlyphBlt)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapValidatePushPixels(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ValidatePushPixels)(pGC, changes,
- pDraw);
-}
-
-static void XAAStateWrapComputeDash(GCPtr pGC)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ComputeDash)(pGC);
-}
-
-static void XAAStateWrapInitPixmapCache(ScreenPtr pScreen, RegionPtr areas,
- pointer data)
-{
- GET_STATEPRIV_SCREEN(pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->InitPixmapCache)(pScreen, areas,
- data);
-}
-
-static void XAAStateWrapClosePixmapCache(ScreenPtr pScreen)
-{
- GET_STATEPRIV_SCREEN(pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->ClosePixmapCache)(pScreen);
-}
-
-static int XAAStateWrapStippledFillChooser(GCPtr pGC)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->StippledFillChooser)(pGC);
-}
-
-static int XAAStateWrapOpaqueStippledFillChooser(GCPtr pGC)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->OpaqueStippledFillChooser)(pGC);
-}
-
-static int XAAStateWrapTiledFillChooser(GCPtr pGC)
-{
- GET_STATEPRIV_GC(pGC);
- STATE_CHECK_SP(pStatePriv);
-
- return (*pStatePriv->TiledFillChooser)(pGC);
-}
-
-static XAACacheInfoPtr XAAStateWrapCacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->CacheTile)(pScrn, pPix);
-}
-
-static XAACacheInfoPtr XAAStateWrapCacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg,
- int bg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->CacheStipple)(pScrn, pPix, fg,
- bg);
-}
-
-static XAACacheInfoPtr XAAStateWrapCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->CacheMonoStipple)(pScrn, pPix);
-}
-
-static XAACacheInfoPtr XAAStateWrapCacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0,
- int pat1)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->CacheMono8x8Pattern)(pScrn, pat0,
- pat1);
-}
-
-static XAACacheInfoPtr XAAStateWrapCacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix,
- int fg, int bg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->CacheColor8x8Pattern)(pScrn, pPix,
- fg, bg);
-}
-
-static void XAAStateWrapWriteBitmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int fg,
- int bg)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WriteBitmapToCache)(pScrn, x, y, w, h,
- src, srcwidth, fg,
- bg);
-}
-
-static void XAAStateWrapWritePixmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- unsigned char *src, int srcwidth, int bpp,
- int depth)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WritePixmapToCache)(pScrn, x, y, w, h,
- src, srcwidth, bpp,
- depth);
-}
-
-static void XAAStateWrapWriteMono8x8PatternToCache(ScrnInfoPtr pScrn,
- XAACacheInfoPtr pCache)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WriteMono8x8PatternToCache)(pScrn,
- pCache);
-}
-
-static void XAAStateWrapWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, PixmapPtr pPix,
- XAACacheInfoPtr pCache)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- (*pStatePriv->WriteColor8x8PatternToCache)(pScrn, pPix,
- pCache);
-}
-
-static void XAAStateWrapGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format,unsigned long planeMask,
- char *pdstLine)
-{
- GET_STATEPRIV_SCREEN(pDrawable->pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->GetImage)(pDrawable, sx, sy, w, h,
- format, planeMask,
- pdstLine);
-}
-
-static void XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
- int *pwidth, int nspans, char *pdstStart)
-{
- GET_STATEPRIV_SCREEN(pDrawable->pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->GetSpans)(pDrawable, wMax, ppt,
- pwidth, nspans, pdstStart);
-}
-
-static void XAAStateWrapPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion,
- int what)
-{
- GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PaintWindowBackground)(pWindow, pRegion,
- what);
-}
-
-static void XAAStateWrapPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion,
- int what)
-{
- GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->PaintWindowBorder)(pWindow, pRegion,
- what);
-}
-
-static void XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->CopyWindow)(pWindow, ptOldOrg,
- prgnSrc);
-}
-
-static void XAAStateWrapSaveAreas(PixmapPtr pBackingPixmap, RegionPtr pObscured, int x,
- int y, WindowPtr pWin)
-{
- GET_STATEPRIV_SCREEN(pBackingPixmap->drawable.pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->SaveAreas)(pBackingPixmap, pObscured, x,
- y, pWin);
-}
-
-static void XAAStateWrapRestoreAreas(PixmapPtr pBackingPixmap, RegionPtr pExposed,
- int x, int y, WindowPtr pWin)
-{
- GET_STATEPRIV_SCREEN(pBackingPixmap->drawable.pScreen);
- STATE_CHECK_SP(pStatePriv);
-
- (*pStatePriv->RestoreAreas)(pBackingPixmap, pExposed,
- x, y, pWin);
-}
-
-#ifdef RENDER
-static Bool XAAStateWrapSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
- int op, CARD16 red,
- CARD16 green,
- CARD16 blue,
- CARD16 alpha,
- int alphaType,
- CARD8 *alphaPtr,
- int alphaPitch,
- int width, int height,
- int flags)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->SetupForCPUToScreenAlphaTexture)(pScrn, op, red, green,
- blue, alpha, alphaType,
- alphaPtr, alphaPitch,
- width, height, flags);
-}
-
-static Bool XAAStateWrapSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
- int texType, CARD8 *texPtr,
- int texPitch,
- int width, int height,
- int flags)
-{
- GET_STATEPRIV_PSCRN(pScrn);
- STATE_CHECK_PSCRN(pScrn);
-
- return (*pStatePriv->SetupForCPUToScreenTexture)(pScrn, op, texType, texPtr,
- texPitch, width, height,
- flags);
-}
-#endif
-
-/* Setup Function */
-Bool
-XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- XAAStateWrapPtr pStatePriv;
- int i = 0;
-
- if (XAAStateGeneration != serverGeneration) {
- if((XAAStateIndex = AllocateScreenPrivateIndex()) < 0) return FALSE;
- XAAStateGeneration = serverGeneration;
- }
- if(!(pStatePriv = xalloc(sizeof(XAAStateWrapRec)))) return FALSE;
- pScreen->devPrivates[XAAStateIndex].ptr = (pointer)pStatePriv;
- pStatePriv->RestoreAccelState = infoRec->RestoreAccelState;
- pStatePriv->pScrn = pScrn;
-
- /* Initialize the last screen to -1 so whenever an accel function
- * is called the proper state is setup
- */
- while(i < pScrn->numEntities) {
- xf86SetLastScrnFlag(pScrn->entityList[i], -1);
- i++;
- }
-/* Do the wrapping */
- XAA_STATE_WRAP(Sync);
- XAA_STATE_WRAP(SetupForScreenToScreenCopy);
- XAA_STATE_WRAP(SetupForSolidFill);
- XAA_STATE_WRAP(SetupForSolidLine);
- XAA_STATE_WRAP(SetupForDashedLine);
- XAA_STATE_WRAP(SetClippingRectangle);
- XAA_STATE_WRAP(DisableClipping);
- XAA_STATE_WRAP(SetupForMono8x8PatternFill);
- XAA_STATE_WRAP(SetupForColor8x8PatternFill);
- XAA_STATE_WRAP(SetupForCPUToScreenColorExpandFill);
- XAA_STATE_WRAP(SetupForScanlineCPUToScreenColorExpandFill);
- XAA_STATE_WRAP(SetupForScreenToScreenColorExpandFill);
- XAA_STATE_WRAP(SetupForImageWrite);
- XAA_STATE_WRAP(SetupForScanlineImageWrite);
- XAA_STATE_WRAP(SetupForImageRead);
- XAA_STATE_WRAP(ScreenToScreenBitBlt);
- XAA_STATE_WRAP(WriteBitmap);
- XAA_STATE_WRAP(FillSolidRects);
- XAA_STATE_WRAP(FillMono8x8PatternRects);
- XAA_STATE_WRAP(FillColor8x8PatternRects);
- XAA_STATE_WRAP(FillCacheBltRects);
- XAA_STATE_WRAP(FillColorExpandRects);
- XAA_STATE_WRAP(FillCacheExpandRects);
- XAA_STATE_WRAP(FillImageWriteRects);
- XAA_STATE_WRAP(FillSolidSpans);
- XAA_STATE_WRAP(FillMono8x8PatternSpans);
- XAA_STATE_WRAP(FillColor8x8PatternSpans);
- XAA_STATE_WRAP(FillCacheBltSpans);
- XAA_STATE_WRAP(FillColorExpandSpans);
- XAA_STATE_WRAP(FillCacheExpandSpans);
- XAA_STATE_WRAP(TEGlyphRenderer);
- XAA_STATE_WRAP(NonTEGlyphRenderer);
- XAA_STATE_WRAP(WritePixmap);
- XAA_STATE_WRAP(ReadPixmap);
- XAA_STATE_WRAP(CopyArea);
- XAA_STATE_WRAP(CopyPlane);
- XAA_STATE_WRAP(PushPixelsSolid);
- XAA_STATE_WRAP(PolyFillRectSolid);
- XAA_STATE_WRAP(PolyFillRectStippled);
- XAA_STATE_WRAP(PolyFillRectOpaqueStippled);
- XAA_STATE_WRAP(PolyFillRectTiled);
- XAA_STATE_WRAP(FillSpansSolid);
- XAA_STATE_WRAP(FillSpansStippled);
- XAA_STATE_WRAP(FillSpansOpaqueStippled);
- XAA_STATE_WRAP(FillSpansTiled);
- XAA_STATE_WRAP(PolyText8TE);
- XAA_STATE_WRAP(PolyText16TE);
- XAA_STATE_WRAP(ImageText8TE);
- XAA_STATE_WRAP(ImageText16TE);
- XAA_STATE_WRAP(ImageGlyphBltTE);
- XAA_STATE_WRAP(PolyGlyphBltTE);
- XAA_STATE_WRAP(PolyText8NonTE);
- XAA_STATE_WRAP(PolyText16NonTE);
- XAA_STATE_WRAP(ImageText8NonTE);
- XAA_STATE_WRAP(ImageText16NonTE);
- XAA_STATE_WRAP(ImageGlyphBltNonTE);
- XAA_STATE_WRAP(PolyGlyphBltNonTE);
- XAA_STATE_WRAP(PolyRectangleThinSolid);
- XAA_STATE_WRAP(PolylinesWideSolid);
- XAA_STATE_WRAP(PolylinesThinSolid);
- XAA_STATE_WRAP(PolySegmentThinSolid);
- XAA_STATE_WRAP(PolylinesThinDashed);
- XAA_STATE_WRAP(PolySegmentThinDashed);
- XAA_STATE_WRAP(FillPolygonSolid);
- XAA_STATE_WRAP(FillPolygonStippled);
- XAA_STATE_WRAP(FillPolygonOpaqueStippled);
- XAA_STATE_WRAP(FillPolygonTiled);
- XAA_STATE_WRAP(PolyFillArcSolid);
- XAA_STATE_WRAP(PutImage);
- XAA_STATE_WRAP(ValidateFillSpans);
- XAA_STATE_WRAP(ValidateSetSpans);
- XAA_STATE_WRAP(ValidatePutImage);
- XAA_STATE_WRAP(ValidateCopyArea);
- XAA_STATE_WRAP(ValidateCopyPlane);
- XAA_STATE_WRAP(ValidatePolyPoint);
- XAA_STATE_WRAP(ValidatePolylines);
- XAA_STATE_WRAP(ValidatePolySegment);
- XAA_STATE_WRAP(ValidatePolyRectangle);
- XAA_STATE_WRAP(ValidatePolyArc);
- XAA_STATE_WRAP(ValidateFillPolygon);
- XAA_STATE_WRAP(ValidatePolyFillRect);
- XAA_STATE_WRAP(ValidatePolyFillArc);
- XAA_STATE_WRAP(ValidatePolyText8);
- XAA_STATE_WRAP(ValidatePolyText16);
- XAA_STATE_WRAP(ValidateImageText8);
- XAA_STATE_WRAP(ValidateImageText16);
- XAA_STATE_WRAP(ValidatePolyGlyphBlt);
- XAA_STATE_WRAP(ValidateImageGlyphBlt);
- XAA_STATE_WRAP(ValidatePushPixels);
- XAA_STATE_WRAP(ComputeDash);
- XAA_STATE_WRAP(InitPixmapCache);
- XAA_STATE_WRAP(ClosePixmapCache);
- XAA_STATE_WRAP(StippledFillChooser);
- XAA_STATE_WRAP(OpaqueStippledFillChooser);
- XAA_STATE_WRAP(TiledFillChooser);
- XAA_STATE_WRAP(CacheTile);
- XAA_STATE_WRAP(CacheStipple);
- XAA_STATE_WRAP(CacheMonoStipple);
- XAA_STATE_WRAP(CacheMono8x8Pattern);
- XAA_STATE_WRAP(CacheColor8x8Pattern);
- XAA_STATE_WRAP(WriteBitmapToCache);
- XAA_STATE_WRAP(WritePixmapToCache);
- XAA_STATE_WRAP(WriteMono8x8PatternToCache);
- XAA_STATE_WRAP(WriteColor8x8PatternToCache);
- XAA_STATE_WRAP(GetImage);
- XAA_STATE_WRAP(GetSpans);
- XAA_STATE_WRAP(PaintWindowBackground);
- XAA_STATE_WRAP(PaintWindowBorder);
- XAA_STATE_WRAP(CopyWindow);
- XAA_STATE_WRAP(SaveAreas);
- XAA_STATE_WRAP(RestoreAreas);
-#ifdef RENDER
- XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture);
- XAA_STATE_WRAP(SetupForCPUToScreenTexture);
-#endif
- return TRUE;
-}
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
deleted file mode 100644
index 862f50ba0..000000000
--- a/hw/xfree86/xaa/xaaStipple.c
+++ /dev/null
@@ -1,859 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.12 2003/08/04 22:18:31 mvojkovi Exp $ */
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-
-static CARD32* StipplePowerOfTwo(CARD32*, CARD32*, int, int, int);
-static CARD32* StipplePowerOfTwo_Inverted(CARD32*, CARD32*, int, int, int);
-static CARD32* StippleUpTo32(CARD32*, CARD32*, int, int, int);
-static CARD32* StippleUpTo32_Inverted(CARD32*, CARD32*, int, int, int);
-static CARD32* StippleOver32(CARD32*, CARD32*, int, int, int);
-static CARD32* StippleOver32_Inverted(CARD32*, CARD32*, int, int, int);
-
-#ifdef TRIPLE_BITS
-#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc3)
-#else
-#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc)
-#endif
-
-StippleScanlineProcPtr stipple_scanline_func[6] = {
- StipplePowerOfTwo,
- StippleUpTo32,
- StippleOver32,
- StipplePowerOfTwo_Inverted,
- StippleUpTo32_Inverted,
- StippleOver32_Inverted
-};
-
-
-#ifdef FIXEDBASE
-# define DEST(i) *dest
-# define RETURN(i) return(dest)
-#else
-# define DEST(i) dest[i]
-# define RETURN(i) return(dest + i)
-#endif
-
-
-/* TRIPLE_BITS pattern expansion */
-#ifdef TRIPLE_BITS
-#define EXPAND_PAT \
- CARD32 pat1 = byte_expand3[pat & 0xFF], \
- pat2 = byte_expand3[(pat & 0xFF00) >> 8], \
- pat3 = byte_expand3[(pat & 0xFF0000) >> 16], \
- pat4 = byte_expand3[(pat & 0xFF000000) >> 24], \
- patA = pat1 | (pat2 << 24), \
- patB = (pat2 >> 8) | (pat3 << 16), \
- patC = (pat3 >> 16) | (pat4 << 8)
-#ifdef FIXED_BASE
-#define WRITE_PAT1 { \
- *dest = patA; }
-#define WRITE_PAT2 { \
- *dest = patA; \
- *dest = patB; }
-#define WRITE_PAT3 { \
- *dest = patA; \
- *dest = patB; \
- *dest = patC; }
-#else
-#define WRITE_PAT1 { \
- *(dest++) = patA; }
-#define WRITE_PAT2 { \
- *(dest) = patA; \
- *(dest + 1) = patB; \
- dest += 2; }
-#define WRITE_PAT3 { \
- *(dest) = patA; \
- *(dest + 1) = patB; \
- *(dest + 2) = patC; \
- dest += 3; }
-#endif
-#endif
-
-
-#if !defined(FIXEDBASE) && !defined(MSBFIRST) && !defined(TRIPLE_BITS)
-
-unsigned int XAAShiftMasks[32] = {
- /* gcc is rather pedantic about SHIFT_R(0xFFFFFFFF,32) */
- 0x00000000 , SHIFT_R(0xFFFFFFFF,31),
- SHIFT_R(0xFFFFFFFF,30), SHIFT_R(0xFFFFFFFF,29),
- SHIFT_R(0xFFFFFFFF,28), SHIFT_R(0xFFFFFFFF,27),
- SHIFT_R(0xFFFFFFFF,26), SHIFT_R(0xFFFFFFFF,25),
- SHIFT_R(0xFFFFFFFF,24), SHIFT_R(0xFFFFFFFF,23),
- SHIFT_R(0xFFFFFFFF,22), SHIFT_R(0xFFFFFFFF,21),
- SHIFT_R(0xFFFFFFFF,20), SHIFT_R(0xFFFFFFFF,19),
- SHIFT_R(0xFFFFFFFF,18), SHIFT_R(0xFFFFFFFF,17),
- SHIFT_R(0xFFFFFFFF,16), SHIFT_R(0xFFFFFFFF,15),
- SHIFT_R(0xFFFFFFFF,14), SHIFT_R(0xFFFFFFFF,13),
- SHIFT_R(0xFFFFFFFF,12), SHIFT_R(0xFFFFFFFF,11),
- SHIFT_R(0xFFFFFFFF,10), SHIFT_R(0xFFFFFFFF,9),
- SHIFT_R(0xFFFFFFFF,8), SHIFT_R(0xFFFFFFFF,7),
- SHIFT_R(0xFFFFFFFF,6), SHIFT_R(0xFFFFFFFF,5),
- SHIFT_R(0xFFFFFFFF,4), SHIFT_R(0xFFFFFFFF,3),
- SHIFT_R(0xFFFFFFFF,2), SHIFT_R(0xFFFFFFFF,1)
-};
-
-#endif
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAFillColorExpandRects3)(
-#else
-EXPNAME(XAAFillColorExpandRects)(
-#endif
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *base;
- Bool TwoPass = FALSE, FirstPass = TRUE;
- StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
- int stipplewidth = pPix->drawable.width;
- int stippleheight = pPix->drawable.height;
- int srcwidth = pPix->devKind;
- int dwords, srcy, srcx, funcNo = 2, h;
- unsigned char *src = (unsigned char*)pPix->devPrivate.ptr;
- unsigned char *srcp;
- int flag;
-
- if(stipplewidth <= 32) {
- if(stipplewidth & (stipplewidth - 1))
- funcNo = 1;
- else
- funcNo = 0;
- }
- StippleFunc = stipple_scanline_func[funcNo];
- SecondFunc = stipple_scanline_func[funcNo];
- FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
- if((bg == -1) ||
- (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg == -1) ||
- !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
- /* one pass */
- } else if((rop == GXcopy) && infoRec->FillSolidRects) {
- /* one pass but we fill background rects first */
- (*infoRec->FillSolidRects)(pScrn, bg, rop, planemask, nBox, pBox);
- bg = -1;
- } else {
- /* gotta do two passes */
- TwoPass = TRUE;
- }
-
- if(!TwoPass)
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- while(nBox--) {
-#ifdef TRIPLE_BITS
- dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
-#else
- dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
-#endif
-
-SECOND_PASS:
- if(TwoPass) {
- (*infoRec->SetupForCPUToScreenColorExpandFill)(pScrn,
- (FirstPass) ? bg : fg, -1, rop, planemask);
- StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
- }
-
- h = pBox->y2 - pBox->y1;
- flag = (infoRec->CPUToScreenColorExpandFillFlags
- & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
-
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, h, 0);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
- srcy = (pBox->y1 - yorg) % stippleheight;
- if(srcy < 0) srcy += stippleheight;
- srcx = (pBox->x1 - xorg) % stipplewidth;
- if(srcx < 0) srcx += stipplewidth;
-
- srcp = (srcwidth * srcy) + src;
-
-#ifndef FIXEDBASE
- if((dwords * h) <= infoRec->ColorExpandRange) {
- while(h--) {
- base = (*StippleFunc)(
- base, (CARD32*)srcp, srcx, stipplewidth, dwords);
- srcy++;
- srcp += srcwidth;
- if (srcy >= stippleheight) {
- srcy = 0;
- srcp = src;
- }
- }
- } else
-#endif
- while(h--) {
- (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
- srcy++;
- srcp += srcwidth;
- if (srcy >= stippleheight) {
- srcy = 0;
- srcp = src;
- }
- }
-
- if (flag) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
- if(TwoPass) {
- if(FirstPass) {
- FirstPass = FALSE;
- goto SECOND_PASS;
- } else FirstPass = TRUE;
- }
-
- pBox++;
- }
-
- if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAFillColorExpandSpans3)(
-#else
-EXPNAME(XAAFillColorExpandSpans)(
-#endif
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *base;
- Bool TwoPass = FALSE, FirstPass = TRUE;
- StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
- int stipplewidth = pPix->drawable.width;
- int stippleheight = pPix->drawable.height;
- int dwords, srcy, srcx, funcNo = 2;
- unsigned char *srcp;
-
- if(stipplewidth <= 32) {
- if(stipplewidth & (stipplewidth - 1))
- funcNo = 1;
- else
- funcNo = 0;
- }
- StippleFunc = stipple_scanline_func[funcNo];
- SecondFunc = stipple_scanline_func[funcNo];
- FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
- if((bg == -1) ||
- (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg == -1) ||
- !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
- /* one pass */
- } else if((rop == GXcopy) && infoRec->FillSolidSpans) {
- /* one pass but we fill background rects first */
- (*infoRec->FillSolidSpans)(
- pScrn, bg, rop, planemask, n, ppt, pwidth, fSorted);
- bg = -1;
- } else {
- /* gotta do two passes */
- TwoPass = TRUE;
- }
-
- if(!TwoPass)
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- while(n--) {
-#ifdef TRIPLE_BITS
- dwords = (3 * *pwidth + 31) >> 5;
-#else
- dwords = (*pwidth + 31) >> 5;
-#endif
-
- srcy = (ppt->y - yorg) % stippleheight;
- if(srcy < 0) srcy += stippleheight;
- srcx = (ppt->x - xorg) % stipplewidth;
- if(srcx < 0) srcx += stipplewidth;
-
- srcp = (pPix->devKind * srcy) + (unsigned char*)pPix->devPrivate.ptr;
-
-SECOND_PASS:
- if(TwoPass) {
- (*infoRec->SetupForCPUToScreenColorExpandFill)(pScrn,
- (FirstPass) ? bg : fg, -1, rop, planemask);
- StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
- }
-
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, ppt->x, ppt->y,
- *pwidth, 1, 0);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
- (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
-
- if((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD)
- && (dwords & 0x01)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
- if(TwoPass) {
- if(FirstPass) {
- FirstPass = FALSE;
- goto SECOND_PASS;
- } else FirstPass = TRUE;
- }
-
- ppt++; pwidth++;
- }
-
- if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-
-#ifndef FIXEDBASE
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAFillScanlineColorExpandRects3)(
-#else
-EXPNAME(XAAFillScanlineColorExpandRects)(
-#endif
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *base;
- Bool TwoPass = FALSE, FirstPass = TRUE;
- StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
- int stipplewidth = pPix->drawable.width;
- int stippleheight = pPix->drawable.height;
- int srcwidth = pPix->devKind;
- int dwords, srcy, srcx, funcNo = 2, bufferNo, h;
- unsigned char *src = pPix->devPrivate.ptr;
- unsigned char *srcp;
-
- if(stipplewidth <= 32) {
- if(stipplewidth & (stipplewidth - 1))
- funcNo = 1;
- else
- funcNo = 0;
- }
- StippleFunc = stipple_scanline_func[funcNo];
- SecondFunc = stipple_scanline_func[funcNo];
- FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
- if((bg == -1) ||
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg == -1) ||
- !(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
- /* one pass */
- } else if((rop == GXcopy) && infoRec->FillSolidRects) {
- /* one pass but we fill background rects first */
- (*infoRec->FillSolidRects)(pScrn, bg, rop, planemask, nBox, pBox);
- bg = -1;
- } else {
- /* gotta do two passes */
- TwoPass = TRUE;
- }
-
- if(!TwoPass)
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- while(nBox--) {
-#ifdef TRIPLE_BITS
- dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
-#else
- dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
-#endif
-
-SECOND_PASS:
- if(TwoPass) {
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn,
- (FirstPass) ? bg : fg, -1, rop, planemask);
- StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
- }
-
- h = pBox->y2 - pBox->y1;
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, pBox->x1, pBox->y1, pBox->x2 - pBox->x1, h, 0);
-
- bufferNo = 0;
-
- srcy = (pBox->y1 - yorg) % stippleheight;
- if(srcy < 0) srcy += stippleheight;
- srcx = (pBox->x1 - xorg) % stipplewidth;
- if(srcx < 0) srcx += stipplewidth;
-
- srcp = (srcwidth * srcy) + src;
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- srcy++;
- srcp += srcwidth;
- if (srcy >= stippleheight) {
- srcy = 0;
- srcp = src;
- }
- }
-
- if(TwoPass) {
- if(FirstPass) {
- FirstPass = FALSE;
- goto SECOND_PASS;
- } else FirstPass = TRUE;
- }
-
- pBox++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-#ifdef TRIPLE_BITS
-EXPNAME(XAAFillScanlineColorExpandSpans3)(
-#else
-EXPNAME(XAAFillScanlineColorExpandSpans)(
-#endif
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *base;
- Bool TwoPass = FALSE, FirstPass = TRUE;
- StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
- int stipplewidth = pPix->drawable.width;
- int stippleheight = pPix->drawable.height;
- int dwords, srcy, srcx, funcNo = 2;
- unsigned char *srcp;
-
- if(stipplewidth <= 32) {
- if(stipplewidth & (stipplewidth - 1))
- funcNo = 1;
- else
- funcNo = 0;
- }
- StippleFunc = stipple_scanline_func[funcNo];
- SecondFunc = stipple_scanline_func[funcNo];
- FirstFunc = stipple_scanline_func[funcNo + 3];
-
-#ifdef TRIPLE_BITS
- if((bg == -1) ||
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
- (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
- (CHECK_RGB_EQUAL(bg))))) {
-#else
- if((bg == -1) ||
- !(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
-#endif
- /* one pass */
- } else if((rop == GXcopy) && infoRec->FillSolidSpans) {
- /* one pass but we fill background rects first */
- (*infoRec->FillSolidSpans)(
- pScrn, bg, rop, planemask, n, ppt, pwidth, fSorted);
- bg = -1;
- } else {
- /* gotta do two passes */
- TwoPass = TRUE;
- }
-
- if(!TwoPass)
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
-
- while(n--) {
-#ifdef TRIPLE_BITS
- dwords = (3 * *pwidth + 31) >> 5;
-#else
- dwords = (*pwidth + 31) >> 5;
-#endif
-
- srcy = (ppt->y - yorg) % stippleheight;
- if(srcy < 0) srcy += stippleheight;
- srcx = (ppt->x - xorg) % stipplewidth;
- if(srcx < 0) srcx += stipplewidth;
-
- srcp = (pPix->devKind * srcy) + (unsigned char*)pPix->devPrivate.ptr;
-
-SECOND_PASS:
- if(TwoPass) {
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn,
- (FirstPass) ? bg : fg, -1, rop, planemask);
- StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
- }
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, ppt->x, ppt->y, *pwidth, 1, 0);
-
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[0];
-
- (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, 0);
-
- if(TwoPass) {
- if(FirstPass) {
- FirstPass = FALSE;
- goto SECOND_PASS;
- } else FirstPass = TRUE;
- }
-
- ppt++; pwidth++;
- }
-
- SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-static CARD32 *
-StipplePowerOfTwo(
- CARD32* dest, CARD32* src,
- int shift, int width, int dwords
-){
- CARD32 pat = *src;
- if(width < 32) {
- pat &= XAAShiftMasks[width];
- while(width < 32) {
- pat |= SHIFT_L(pat,width);
- width <<= 1;
- }
- }
-
- if(shift)
- pat = SHIFT_R(pat,shift) | SHIFT_L(pat,32 - shift);
-
-#ifdef MSBFIRST
- pat = SWAP_BITS_IN_BYTES(pat);
-#endif
-
-#ifdef TRIPLE_BITS
- {
- EXPAND_PAT;
-
- while(dwords >= 3) {
- WRITE_PAT3;
- dwords -= 3;
- }
- if (dwords == 2) {
- WRITE_PAT2;
- } else if (dwords == 1) {
- WRITE_PAT1;
- }
-
- return dest;
- }
-#else /* TRIPLE_BITS */
- while(dwords >= 4) {
- DEST(0) = pat;
- DEST(1) = pat;
- DEST(2) = pat;
- DEST(3) = pat;
- dwords -= 4;
-#ifndef FIXEDBASE
- dest += 4;
-#endif
- }
-
- if(!dwords) return dest;
- DEST(0) = pat;
- if(dwords == 1) RETURN(1);
- DEST(1) = pat;
- if(dwords == 2) RETURN(2);
- DEST(2) = pat;
- RETURN(3);
-#endif /* TRIPLE_BITS */
-}
-
-static CARD32 *
-StipplePowerOfTwo_Inverted(
- CARD32* dest, CARD32* src,
- int shift, int width, int dwords
-){
- CARD32 pat = *src;
- if(width < 32) {
- pat &= XAAShiftMasks[width];
- while(width < 32) {
- pat |= SHIFT_L(pat,width);
- width <<= 1;
- }
- }
-
- if(shift)
- pat = SHIFT_R(pat,shift) | SHIFT_L(pat,32 - shift);
-
-#ifdef MSBFIRST
- pat = SWAP_BITS_IN_BYTES(pat);
-#endif
-
- pat = ~pat;
-
-#ifdef TRIPLE_BITS
- {
- EXPAND_PAT;
-
- while(dwords >= 3) {
- WRITE_PAT3;
- dwords -= 3;
- }
- if (dwords == 2) {
- WRITE_PAT2;
- } else if (dwords == 1) {
- WRITE_PAT1;
- }
-
- return dest;
- }
-#else /* TRIPLE_BITS */
- while(dwords >= 4) {
- DEST(0) = pat;
- DEST(1) = pat;
- DEST(2) = pat;
- DEST(3) = pat;
- dwords -= 4;
-#ifndef FIXEDBASE
- dest += 4;
-#endif
- }
-
- if(!dwords) return dest;
- DEST(0) = pat;
- if(dwords == 1) RETURN(1);
- DEST(1) = pat;
- if(dwords == 2) RETURN(2);
- DEST(2) = pat;
- RETURN(3);
-#endif /* TRIPLE_BITS */
-}
-
-
-static CARD32 *
-StippleUpTo32(
- CARD32* base, CARD32* src,
- int shift, int width, int dwords
-){
- CARD32 pat = *src & XAAShiftMasks[width];
-
- while(width <= 15) {
- pat |= SHIFT_L(pat,width);
- width <<= 1;
- }
- pat |= SHIFT_L(pat,width);
-
- while(dwords--) {
- CARD32 bits = SHIFT_R(pat,shift) | SHIFT_L(pat,width-shift);
-#ifdef TRIPLE_BITS
- if(dwords >= 2) {
- WRITE_BITS3(bits);
- dwords -= 2;
- } else if(dwords > 0) {
- WRITE_BITS2(bits);
- dwords--;
- } else {
- WRITE_BITS1(bits);
- }
-#else
- WRITE_BITS(bits);
-#endif
-
- shift += 32;
- shift %= width;
- }
- return base;
-}
-
-
-static CARD32 *
-StippleUpTo32_Inverted(
- CARD32* base, CARD32* src,
- int shift, int width, int dwords
-){
- CARD32 pat = *src & XAAShiftMasks[width];
-
- while(width <= 15) {
- pat |= SHIFT_L(pat,width);
- width <<= 1;
- }
- pat |= SHIFT_L(pat,width);
-
- while(dwords--) {
- CARD32 bits = ~(SHIFT_R(pat,shift) | SHIFT_L(pat,width-shift));
-#ifdef TRIPLE_BITS
- if(dwords >= 2) {
- WRITE_BITS3(bits);
- dwords -= 2;
- } else if(dwords > 0) {
- WRITE_BITS2(bits);
- dwords--;
- } else {
- WRITE_BITS1(bits);
- }
-#else
- WRITE_BITS(bits);
-#endif
-
- shift += 32;
- shift %= width;
- }
- return base;
-}
-
-
-static CARD32 *
-StippleOver32(
- CARD32* base, CARD32* src,
- int offset, int width, int dwords
-){
- CARD32* srcp;
- CARD32 bits;
- int bitsleft, shift, usable;
-
- while(dwords--) {
- bitsleft = width - offset;
- srcp = src + (offset >> 5);
- shift = offset & 31;
- usable = 32 - shift;
-
- if(bitsleft < 32) {
- if(bitsleft <= usable) {
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
- } else {
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
- }
- }
- else if(shift)
- bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
- else
- bits = *srcp;
-
-#ifdef TRIPLE_BITS
- if(dwords >= 2) {
- WRITE_BITS3(bits);
- dwords -= 2;
- } else if(dwords > 0) {
- WRITE_BITS2(bits);
- dwords--;
- } else {
- WRITE_BITS1(bits);
- }
-#else
- WRITE_BITS(bits);
-#endif
-
- offset += 32;
- offset %= width;
- }
- return base;
-}
-
-
-static CARD32 *
-StippleOver32_Inverted(
- CARD32* base, CARD32* src,
- int offset, int width, int dwords
-){
- CARD32* srcp;
- CARD32 bits;
- int bitsleft, shift, usable;
-
- while(dwords--) {
- bitsleft = width - offset;
- srcp = src + (offset >> 5);
- shift = offset & 31;
- usable = 32 - shift;
-
- if(bitsleft < 32) {
- if(bitsleft <= usable) {
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
- } else {
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
- }
- }
- else if(shift)
- bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
- else
- bits = *srcp;
-
- bits = ~bits;
-
-#ifdef TRIPLE_BITS
- if(dwords >= 2) {
- WRITE_BITS3(bits);
- dwords -= 2;
- } else if(dwords > 0) {
- WRITE_BITS2(bits);
- dwords--;
- } else {
- WRITE_BITS1(bits);
- }
-#else
- WRITE_BITS(bits);
-#endif
-
- offset += 32;
- offset %= width;
- }
- return base;
-}
diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c
deleted file mode 100644
index 845dccd4e..000000000
--- a/hw/xfree86/xaa/xaaTEGlyph.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEGlyph.c,v 1.9 2000/09/01 05:49:45 mvojkovi Exp $ */
-
-
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaacexp.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-
-
-/* scanline function for TRIPLE_BITS_24BPP */
-static CARD32 *DrawTextScanline3(CARD32 *base, CARD32 *mem, int width);
-
-/* Loop unrolled functions for common font widths */
-static CARD32 *DrawTETextScanlineGeneric(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth7(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth10(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth12(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth14(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth16(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth18(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth24(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-
-
-#ifdef USEASSEMBLER
-# ifdef FIXEDBASE
-# ifdef MSBFIRST
-CARD32 *DrawTETextScanlineWidth6PMSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PMSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PMSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-# else
-CARD32 *DrawTETextScanlineWidth6PLSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PLSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PLSBFirstFixedBase(CARD32 *base,
- unsigned int **glyphp, int line, int width, int glyphwidth);
-# endif
-# else
-# ifdef MSBFIRST
-CARD32 *DrawTETextScanlineWidth6PMSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PMSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PMSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-# else
-CARD32 *DrawTETextScanlineWidth6PLSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth8PLSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-CARD32 *DrawTETextScanlineWidth9PLSBFirst(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-# endif
-# endif
-#else
-static CARD32 *DrawTETextScanlineWidth6(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth8(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp,
- int line, int width, int glyphwidth);
-#endif
-
-#define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc)
-
-
-
-GlyphScanlineFuncPtr glyph_scanline_func[32] = {
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric,
-#ifdef USEASSEMBLER
-# ifdef FIXEDBASE
-# ifdef MSBFIRST
- DrawTETextScanlineWidth6PMSBFirstFixedBase,
- DrawTETextScanlineWidth7,
- DrawTETextScanlineWidth8PMSBFirstFixedBase,
- DrawTETextScanlineWidth9PMSBFirstFixedBase,
-# else
- DrawTETextScanlineWidth6PLSBFirstFixedBase,
- DrawTETextScanlineWidth7,
- DrawTETextScanlineWidth8PLSBFirstFixedBase,
- DrawTETextScanlineWidth9PLSBFirstFixedBase,
-# endif
-# else
-# ifdef MSBFIRST
- DrawTETextScanlineWidth6PMSBFirst,
- DrawTETextScanlineWidth7,
- DrawTETextScanlineWidth8PMSBFirst,
- DrawTETextScanlineWidth9PMSBFirst,
-# else
- DrawTETextScanlineWidth6PLSBFirst,
- DrawTETextScanlineWidth7,
- DrawTETextScanlineWidth8PLSBFirst,
- DrawTETextScanlineWidth9PLSBFirst,
-# endif
-# endif
-#else
- DrawTETextScanlineWidth6, DrawTETextScanlineWidth7,
- DrawTETextScanlineWidth8, DrawTETextScanlineWidth9,
-#endif
- DrawTETextScanlineWidth10,
- DrawTETextScanlineGeneric, DrawTETextScanlineWidth12,
- DrawTETextScanlineGeneric, DrawTETextScanlineWidth14,
- DrawTETextScanlineGeneric, DrawTETextScanlineWidth16,
- DrawTETextScanlineGeneric, DrawTETextScanlineWidth18,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineWidth24,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
- DrawTETextScanlineGeneric, DrawTETextScanlineGeneric
-};
-
-
-/********************************************************************
-
- Here we have TEGlyphRenders for a bunch of different color
- expansion types. The driver may provide its own renderer, but
- this is the default one which renders using lower-level primitives
- exported by the chipset driver.
-
-********************************************************************/
-
-/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not.
- A total of 4 versions */
-
-void
-EXPNAME(XAATEGlyphRenderer)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32* base;
- GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
- int dwords = 0;
-
- if((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- bg = -1;
- }
-
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- if(skipleft &&
- (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
- (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
- (skipleft > x)))) {
- /* draw the first character only */
-
- int count = h, line = startline;
- int width = glyphWidth - skipleft;
-
- if(width > w) width = w;
-
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, x, y, width, h, 0);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
- while(count--) {
- register CARD32 tmp = SHIFT_R(glyphs[0][line++],skipleft);
- WRITE_BITS(tmp);
- }
-
- w -= width;
- if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
- ((((width + 31) >> 5) * h) & 1)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
- if(!w) goto THE_END;
- glyphs++;
- x += width;
- skipleft = 0; /* nicely aligned again */
- }
-
- w += skipleft;
- x -= skipleft;
- dwords = ((w + 31) >> 5) * h;
-
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, x, y, w, h, skipleft);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
-#ifndef FIXEDBASE
- if((((w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
- while(h--) {
- base = (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
- }
- else
-#endif
- while(h--) {
- (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
- }
-
- if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
- (dwords & 1)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
-THE_END:
-
- if(infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-/********************************************************************
-
- This is the GlyphRenderer for TRIPLE_BITS_24BPP. It renders to a buffer
- with the non FIXEDBASE LSB_FIRST code before tripling, and possibly
- reversing the bits and sending them to the screen
-
-********************************************************************/
-
-void
-EXPNAME(XAATEGlyphRenderer3)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- CARD32 *base, *mem;
- GlyphScanlineFuncPtr GlyphFunc = XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
- int dwords = 0;
-
- if((bg != -1) &&
- ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
- ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
- (!CHECK_RGB_EQUAL(bg))))) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- bg = -1;
- }
-
- (*infoRec->SetupForCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- if(skipleft) {
- /* draw the first character only */
-
- int count = h, line = startline;
- int width = glyphWidth - skipleft;
- CARD32 bits;
-
- if(width > w) width = w;
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(
- pScrn, x, y, width, h, 0);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
- while(count--) {
- bits = SHIFT_R(glyphs[0][line++],skipleft);
- if (width >= 22) {
- WRITE_BITS3(bits);
- } else if (width >= 11) {
- WRITE_BITS2(bits);
- } else {
- WRITE_BITS1(bits);
- }
- }
-
- w -= width;
- if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
- ((((3 * width + 31) >> 5) * h) & 1)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
- if(!w) goto THE_END;
- glyphs++;
- x += width;
- skipleft = 0; /* nicely aligned again */
- }
-
- dwords = ((3 * w + 31) >> 5) * h;
- mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
- if (!mem) return;
-
- (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0);
-
- base = (CARD32*)infoRec->ColorExpandBase;
-
-# ifndef FIXEDBASE
- if((((3 * w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
- while(h--) {
- (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
- base = DrawTextScanline3(base, mem, w);
- }
- else
-# endif
- while(h--) {
- (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
- DrawTextScanline3(base, mem, w);
- }
-
- DEALLOCATE_LOCAL(mem);
-
- if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
- (dwords & 1)) {
- base = (CARD32*)infoRec->ColorExpandBase;
- base[0] = 0x00000000;
- }
-
-THE_END:
-
- if(infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
- (*infoRec->Sync)(pScrn);
- else SET_SYNC_FLAG(infoRec);
-}
-
-
-#ifndef FIXEDBASE
-/* Scanline version of above gets built for LSBFIRST and MSBFIRST */
-
-void
-EXPNAME(XAATEGlyphRendererScanline)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int bufferNo;
- CARD32* base;
- GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
-
- if((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- bg = -1;
- }
-
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- if(skipleft &&
- (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
- (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
- (skipleft > x)))) {
- /* draw the first character only */
-
- int count = h, line = startline;
- int width = glyphWidth - skipleft;
-
- if(width > w) width = w;
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, x, y, width, h, 0);
-
- bufferNo = 0;
-
- while(count--) {
- register CARD32 tmp = SHIFT_R(glyphs[0][line++],skipleft);
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- WRITE_BITS(tmp);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
- w -= width;
- if(!w) goto THE_END;
- glyphs++;
- x += width;
- skipleft = 0; /* nicely aligned again */
- }
-
- w += skipleft;
- x -= skipleft;
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, x, y, w, h, skipleft);
-
- bufferNo = 0;
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
-THE_END:
-
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-EXPNAME(XAATEGlyphRendererScanline3)(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int bufferNo;
- CARD32 *base, *mem;
- GlyphScanlineFuncPtr GlyphFunc = XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
-
- if((bg != -1) &&
- ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
- ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
- (!CHECK_RGB_EQUAL(bg))))) {
- (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- bg = -1;
- }
-
- (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
- pScrn, fg, bg, rop, planemask);
-
- if(skipleft) {
- /* draw the first character only */
-
- int count = h, line = startline;
- int width = glyphWidth - skipleft;
- CARD32 bits;
-
- if(width > w) width = w;
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, x, y, width, h, 0);
-
- bufferNo = 0;
-
- while(count--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- bits = SHIFT_R(glyphs[0][line++],skipleft);
- if (width >= 22) {
- WRITE_BITS3(bits);
- } else if (width >= 11) {
- WRITE_BITS2(bits);
- } else {
- WRITE_BITS1(bits);
- }
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
- w -= width;
- if(!w) goto THE_END;
- glyphs++;
- x += width;
- skipleft = 0; /* nicely aligned again */
- }
-
- w += skipleft;
- x -= skipleft;
- mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
- if (!mem) return;
-
- (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
- pScrn, x, y, w, h, skipleft);
-
- bufferNo = 0;
-
- while(h--) {
- base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
- (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
- DrawTextScanline3(base, mem, w);
- (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
- if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
- bufferNo = 0;
- }
-
- DEALLOCATE_LOCAL(mem);
-
-THE_END:
-
- SET_SYNC_FLAG(infoRec);
-}
-
-#endif
-
-
-
-/********************************************************************
-
- TRIPLE_BITS_24BPP scanline rendering code.
-
-********************************************************************/
-
-
-
-static CARD32*
-DrawTextScanline3(
- CARD32 *base,
- CARD32 *mem,
- int width )
-{
-
- while(width > 32) {
- WRITE_BITS3(*mem);
- mem++;
- width -= 32;
- }
- if(width) {
- if (width >= 22) {
- WRITE_BITS3(*mem);
- } else if (width >= 11) {
- WRITE_BITS2(*mem);
- } else {
- WRITE_BITS1(*mem);
- }
- }
-
- return base;
-}
-
-
-/********************************************************************
-
- Generic TE scanline rendering code.
-
-********************************************************************/
-
-
-
-static CARD32*
-DrawTETextScanlineGeneric(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- CARD32 bits = (*glyphp)[line];
- int shift = glyphwidth;
-
- while(width > 32) {
- while(shift < 32) {
- glyphp++;
- bits |= SHIFT_L((*glyphp)[line], shift);
- shift += glyphwidth;
- }
- WRITE_BITS(bits);
- shift &= 31;
- if(shift)
- bits = SHIFT_R((*glyphp)[line],(glyphwidth - shift));
- else bits = 0;
- width -= 32;
- }
-
- if(width) {
- width -= shift;
- while(width > 0) {
- glyphp++;
- bits |= SHIFT_L((*glyphp)[line],shift);
- shift += glyphwidth;
- width -= glyphwidth;
- }
- WRITE_BITS(bits);
- }
-
- return base;
-}
-
-
-/********************************************************************
-
- Loop unrolled TE font scanline rendering code
-
-********************************************************************/
-
-
-#ifndef USEASSEMBLER
-static CARD32*
-DrawTETextScanlineWidth6(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],6);
- bits |= SHIFT_L(glyphp[2][line],12);
- bits |= SHIFT_L(glyphp[3][line],18);
- bits |= SHIFT_L(glyphp[4][line],24);
- bits |= SHIFT_L(glyphp[5][line],30);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[5][line],2);
- bits |= SHIFT_L(glyphp[6][line],4);
- bits |= SHIFT_L(glyphp[7][line],10);
- bits |= SHIFT_L(glyphp[8][line],16);
- bits |= SHIFT_L(glyphp[9][line],22);
- bits |= SHIFT_L(glyphp[10][line],28);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[10][line],4);
- bits |= SHIFT_L(glyphp[11][line],2);
- bits |= SHIFT_L(glyphp[12][line],8);
- bits |= SHIFT_L(glyphp[13][line],14);
- bits |= SHIFT_L(glyphp[14][line],20);
- bits |= SHIFT_L(glyphp[15][line],26);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
-#ifndef FIXEDBASE
- base += 3;
-#endif
- width -= 96;
- glyphp += 16;
- }
- return base;
-}
-#endif
-
-static CARD32*
-DrawTETextScanlineWidth7(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],7);
- bits |= SHIFT_L(glyphp[2][line],14);
- bits |= SHIFT_L(glyphp[3][line],21);
- bits |= SHIFT_L(glyphp[4][line],28);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[4][line],4);
- bits |= SHIFT_L(glyphp[5][line],3);
- bits |= SHIFT_L(glyphp[6][line],10);
- bits |= SHIFT_L(glyphp[7][line],17);
- bits |= SHIFT_L(glyphp[8][line],24);
- bits |= SHIFT_L(glyphp[9][line],31);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[9][line],1);
- bits |= SHIFT_L(glyphp[10][line],6);
- bits |= SHIFT_L(glyphp[11][line],13);
- bits |= SHIFT_L(glyphp[12][line],20);
- bits |= SHIFT_L(glyphp[13][line],27);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = SHIFT_R(glyphp[13][line],5);
- bits |= SHIFT_L(glyphp[14][line],2);
- bits |= SHIFT_L(glyphp[15][line],9);
- bits |= SHIFT_L(glyphp[16][line],16);
- bits |= SHIFT_L(glyphp[17][line],23);
- bits |= SHIFT_L(glyphp[18][line],30);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
- bits = SHIFT_R(glyphp[18][line],2);
- bits |= SHIFT_L(glyphp[19][line],5);
- bits |= SHIFT_L(glyphp[20][line],12);
- bits |= SHIFT_L(glyphp[21][line],19);
- bits |= SHIFT_L(glyphp[22][line],26);
- WRITE_IN_BITORDER(base, 4, bits);
- CHECKRETURN(5);
- bits = SHIFT_R(glyphp[22][line],6);
- bits |= SHIFT_L(glyphp[23][line],1);
- bits |= SHIFT_L(glyphp[24][line],8);
- bits |= SHIFT_L(glyphp[25][line],15);
- bits |= SHIFT_L(glyphp[26][line],22);
- bits |= SHIFT_L(glyphp[27][line],29);
- WRITE_IN_BITORDER(base, 5, bits);
- CHECKRETURN(6);
- bits = SHIFT_R(glyphp[27][line],3);
- bits |= SHIFT_L(glyphp[28][line],4);
- bits |= SHIFT_L(glyphp[29][line],11);
- bits |= SHIFT_L(glyphp[30][line],18);
- bits |= SHIFT_L(glyphp[31][line],25);
- WRITE_IN_BITORDER(base, 6, bits);
- CHECKRETURN(7);
-#ifndef FIXEDBASE
- base += 7;
-#endif
- width -= 224;
- glyphp += 32;
- }
- return base;
-}
-
-
-#ifndef USEASSEMBLER
-static CARD32*
-DrawTETextScanlineWidth8(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],8);
- bits |= SHIFT_L(glyphp[2][line],16);
- bits |= SHIFT_L(glyphp[3][line],24);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = glyphp[4][line];
- bits |= SHIFT_L(glyphp[5][line],8);
- bits |= SHIFT_L(glyphp[6][line],16);
- bits |= SHIFT_L(glyphp[7][line],24);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
-#ifndef FIXEDBASE
- base += 2;
-#endif
- width -= 64;
- glyphp += 8;
- }
- return base;
-}
-#endif
-
-#ifndef USEASSEMBLER
-static CARD32*
-DrawTETextScanlineWidth9(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],9);
- bits |= SHIFT_L(glyphp[2][line],18);
- bits |= SHIFT_L(glyphp[3][line],27);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[3][line],5);
- bits |= SHIFT_L(glyphp[4][line],4);
- bits |= SHIFT_L(glyphp[5][line],13);
- bits |= SHIFT_L(glyphp[6][line],22);
- bits |= SHIFT_L(glyphp[7][line],31);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[7][line],1);
- bits |= SHIFT_L(glyphp[8][line],8);
- bits |= SHIFT_L(glyphp[9][line],17);
- bits |= SHIFT_L(glyphp[10][line],26);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = SHIFT_R(glyphp[10][line],6);
- bits |= SHIFT_L(glyphp[11][line],3);
- bits |= SHIFT_L(glyphp[12][line],12);
- bits |= SHIFT_L(glyphp[13][line],21);
- bits |= SHIFT_L(glyphp[14][line],30);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
- bits = SHIFT_R(glyphp[14][line],2);
- bits |= SHIFT_L(glyphp[15][line],7);
- bits |= SHIFT_L(glyphp[16][line],16);
- bits |= SHIFT_L(glyphp[17][line],25);
- WRITE_IN_BITORDER(base, 4, bits);
- CHECKRETURN(5);
- bits = SHIFT_R(glyphp[17][line],7);
- bits |= SHIFT_L(glyphp[18][line],2);
- bits |= SHIFT_L(glyphp[19][line],11);
- bits |= SHIFT_L(glyphp[20][line],20);
- bits |= SHIFT_L(glyphp[21][line],29);
- WRITE_IN_BITORDER(base, 5, bits);
- CHECKRETURN(6);
- bits = SHIFT_R(glyphp[21][line],3);
- bits |= SHIFT_L(glyphp[22][line],6);
- bits |= SHIFT_L(glyphp[23][line],15);
- bits |= SHIFT_L(glyphp[24][line],24);
- WRITE_IN_BITORDER(base, 6, bits);
- CHECKRETURN(7);
- bits = SHIFT_R(glyphp[24][line],8);
- bits |= SHIFT_L(glyphp[25][line],1);
- bits |= SHIFT_L(glyphp[26][line],10);
- bits |= SHIFT_L(glyphp[27][line],19);
- bits |= SHIFT_L(glyphp[28][line],28);
- WRITE_IN_BITORDER(base, 7, bits);
- CHECKRETURN(8);
- bits = SHIFT_R(glyphp[28][line],4);
- bits |= SHIFT_L(glyphp[29][line],5);
- bits |= SHIFT_L(glyphp[30][line],14);
- bits |= SHIFT_L(glyphp[31][line],23);
- WRITE_IN_BITORDER(base, 8, bits);
- CHECKRETURN(9);
-#ifndef FIXEDBASE
- base += 9;
-#endif
- width -= 288;
- glyphp += 32;
- }
- return base;
-}
-#endif
-
-static CARD32*
-DrawTETextScanlineWidth10(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],10);
- bits |= SHIFT_L(glyphp[2][line],20);
- bits |= SHIFT_L(glyphp[3][line],30);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[3][line],2);
- bits |= SHIFT_L(glyphp[4][line],8);
- bits |= SHIFT_L(glyphp[5][line],18);
- bits |= SHIFT_L(glyphp[6][line],28);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[6][line],4);
- bits |= SHIFT_L(glyphp[7][line],6);
- bits |= SHIFT_L(glyphp[8][line],16);
- bits |= SHIFT_L(glyphp[9][line],26);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = SHIFT_R(glyphp[9][line],6);
- bits |= SHIFT_L(glyphp[10][line],4);
- bits |= SHIFT_L(glyphp[11][line],14);
- bits |= SHIFT_L(glyphp[12][line],24);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
- bits = SHIFT_R(glyphp[12][line],8);
- bits |= SHIFT_L(glyphp[13][line],2);
- bits |= SHIFT_L(glyphp[14][line],12);
- bits |= SHIFT_L(glyphp[15][line],22);
- WRITE_IN_BITORDER(base, 4, bits);
- CHECKRETURN(5);
-#ifndef FIXEDBASE
- base += 5;
-#endif
- width -= 160;
- glyphp += 16;
- }
- return base;
-}
-
-static CARD32*
-DrawTETextScanlineWidth12(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],12);
- bits |= SHIFT_L(glyphp[2][line],24);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[2][line],8);
- bits |= SHIFT_L(glyphp[3][line],4);
- bits |= SHIFT_L(glyphp[4][line],16);
- bits |= SHIFT_L(glyphp[5][line],28);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[5][line],4);
- bits |= SHIFT_L(glyphp[6][line],8);
- bits |= SHIFT_L(glyphp[7][line],20);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
-#ifndef FIXEDBASE
- base += 3;
-#endif
- width -= 96;
- glyphp += 8;
- }
- return base;
-}
-
-
-
-static CARD32*
-DrawTETextScanlineWidth14(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],14);
- bits |= SHIFT_L(glyphp[2][line],28);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[2][line],4);
- bits |= SHIFT_L(glyphp[3][line],10);
- bits |= SHIFT_L(glyphp[4][line],24);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[4][line],8);
- bits |= SHIFT_L(glyphp[5][line],6);
- bits |= SHIFT_L(glyphp[6][line],20);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = SHIFT_R(glyphp[6][line],12);
- bits |= SHIFT_L(glyphp[7][line],2);
- bits |= SHIFT_L(glyphp[8][line],16);
- bits |= SHIFT_L(glyphp[9][line],30);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
- bits = SHIFT_R(glyphp[9][line],2);
- bits |= SHIFT_L(glyphp[10][line],12);
- bits |= SHIFT_L(glyphp[11][line],26);
- WRITE_IN_BITORDER(base, 4, bits);
- CHECKRETURN(5);
- bits = SHIFT_R(glyphp[11][line],6);
- bits |= SHIFT_L(glyphp[12][line],8);
- bits |= SHIFT_L(glyphp[13][line],22);
- WRITE_IN_BITORDER(base, 5, bits);
- CHECKRETURN(6);
- bits = SHIFT_R(glyphp[13][line],10);
- bits |= SHIFT_L(glyphp[14][line],4);
- bits |= SHIFT_L(glyphp[15][line],18);
- WRITE_IN_BITORDER(base, 6, bits);
- CHECKRETURN(7);
-#ifndef FIXEDBASE
- base += 7;
-#endif
- width -= 224;
- glyphp += 16;
- }
- return base;
-}
-
-
-static CARD32*
-DrawTETextScanlineWidth16(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],16);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = glyphp[2][line];
- bits |= SHIFT_L(glyphp[3][line],16);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = glyphp[4][line];
- bits |= SHIFT_L(glyphp[5][line],16);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = glyphp[6][line];
- bits |= SHIFT_L(glyphp[7][line],16);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
-#ifndef FIXEDBASE
- base += 4;
-#endif
- width -= 128;
- glyphp += 8;
- }
- return base;
-}
-
-
-
-static CARD32*
-DrawTETextScanlineWidth18(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],18);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[1][line],14);
- bits |= SHIFT_L(glyphp[2][line],4);
- bits |= SHIFT_L(glyphp[3][line],22);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[3][line],10);
- bits |= SHIFT_L(glyphp[4][line],8);
- bits |= SHIFT_L(glyphp[5][line],26);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
- bits = SHIFT_R(glyphp[5][line],6);
- bits |= SHIFT_L(glyphp[6][line],12);
- bits |= SHIFT_L(glyphp[7][line],30);
- WRITE_IN_BITORDER(base, 3, bits);
- CHECKRETURN(4);
- bits = SHIFT_R(glyphp[7][line],2);
- bits |= SHIFT_L(glyphp[8][line],16);
- WRITE_IN_BITORDER(base, 4, bits);
- CHECKRETURN(5);
- bits = SHIFT_R(glyphp[8][line],16);
- bits |= SHIFT_L(glyphp[9][line],2);
- bits |= SHIFT_L(glyphp[10][line],20);
- WRITE_IN_BITORDER(base, 5, bits);
- CHECKRETURN(6);
- bits = SHIFT_R(glyphp[10][line],12);
- bits |= SHIFT_L(glyphp[11][line],6);
- bits |= SHIFT_L(glyphp[12][line],24);
- WRITE_IN_BITORDER(base, 6, bits);
- CHECKRETURN(7);
- bits = SHIFT_R(glyphp[12][line],8);
- bits |= SHIFT_L(glyphp[13][line],10);
- bits |= SHIFT_L(glyphp[14][line],28);
- WRITE_IN_BITORDER(base, 7, bits);
- CHECKRETURN(8);
- bits = SHIFT_R(glyphp[14][line],4);
- bits |= SHIFT_L(glyphp[15][line],14);
- WRITE_IN_BITORDER(base, 8, bits);
- CHECKRETURN(9);
-#ifndef FIXEDBASE
- base += 9;
-#endif
- width -= 288;
- glyphp += 16;
- }
- return base;
-}
-
-
-static CARD32*
-DrawTETextScanlineWidth24(
- CARD32 *base,
- unsigned int **glyphp,
- int line, int width, int glyphwidth )
-{
- while (1) {
- unsigned int bits;
- bits = glyphp[0][line];
- bits |= SHIFT_L(glyphp[1][line],24);
- WRITE_IN_BITORDER(base, 0, bits);
- CHECKRETURN(1);
- bits = SHIFT_R(glyphp[1][line],8);
- bits |= SHIFT_L(glyphp[2][line],16);
- WRITE_IN_BITORDER(base, 1, bits);
- CHECKRETURN(2);
- bits = SHIFT_R(glyphp[2][line],16);
- bits |= SHIFT_L(glyphp[3][line],8);
- WRITE_IN_BITORDER(base, 2, bits);
- CHECKRETURN(3);
-#ifndef FIXEDBASE
- base += 3;
-#endif
- width -= 96;
- glyphp += 4;
- }
- return base;
-}
-
-
diff --git a/hw/xfree86/xaa/xaaTEGlyphBlt.S b/hw/xfree86/xaa/xaaTEGlyphBlt.S
deleted file mode 100644
index f5c580760..000000000
--- a/hw/xfree86/xaa/xaaTEGlyphBlt.S
+++ /dev/null
@@ -1,964 +0,0 @@
-/*
- * Copyright 1996 The XFree86 Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEGlyphBlt.S,v 1.2 1999/12/27 00:39:52 robin Exp $ */
-
-
-/*
- * Intel Pentium-optimized versions of "terminal emulator font" text
- * bitmap transfer routines.
- *
- * SCANLINE_PAD_DWORD.
- *
- * Only for glyphs with a fixed width of 6 pixels or 8 pixels.
- */
-
-#include "assyntax.h"
-
-#ifndef QNX4
- FILE("xaaTEGlyphBlt.s")
-#else
- FILE( __FILE__ )
-#endif
-
- AS_BEGIN
-
-/*
- * Definition of stack frame function arguments.
- * All functions have the same arguments (some don't have glyphwidth,
- * but that's OK, since it comes last and doesn't affect the offset
- * of the other arguments).
- */
-
-#define base_arg REGOFF(20,ESP)
-#define glyphp_arg REGOFF(24,ESP)
-#define line_arg REGOFF(28,ESP)
-#define width_arg REGOFF(32,ESP)
-#define glyphwidth_arg REGOFF(36,ESP)
-
-#define BYTE_REVERSED GLNAME(byte_reversed)
-
-/* I assume %eax and %edx can be trashed. */
-
- SEG_TEXT
-
- ALIGNTEXT4
-
-#ifdef FIXEDBASE
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase):
-# endif
-#else
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirst)
-GLNAME(DrawTETextScanlineWidth6PMSBFirst):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirst)
-GLNAME(DrawTETextScanlineWidth6PLSBFirst):
-# endif
-#endif
-
-/* Definition of stack frame function arguments. */
-
-#define base_arg REGOFF(20,ESP)
-#define glyphp_arg REGOFF(24,ESP)
-#define line_arg REGOFF(28,ESP)
-#define width_arg REGOFF(32,ESP)
-
- SUB_L (CONST(16),ESP)
- MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
- MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
- MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
- MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
-
- MOV_L (line_arg,EBP)
- MOV_L (base_arg,EDI)
- MOV_L (glyphp_arg,ESI)
-
- ALIGNTEXT4
-
-.L6_1:
- /* Pentium-optimized instruction pairing. */
- /* EBX = bits = glyph[0][line] */
- MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
- MOV_L (REGIND(ESI),EBX) /* glyphp[0] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[0][line] */
- SAL_L (CONST(6),EDX) /* glyphp[1][line] << 6 */
- MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
- MOV_L (REGOFF(12,ESI),EAX) /* glyphp[3] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[3][line] */
- SAL_L (CONST(12),ECX) /* glyphp[2][line] << 12 */
- OR_L (EDX,EBX) /* bits |= ..[1].. << 6 */
- SAL_L (CONST(18),EAX) /* glyphp[3][line] << 18 */
- OR_L (ECX,EBX) /* bits |= ..[2].. << 12 */
-
- MOV_L (REGOFF(16,ESI),EDX) /* glyphp[4] */
- MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[4][line] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
- SAL_L (CONST(24),EDX) /* glyphp[4][line] << 24 */
- OR_L (EAX,EBX) /* bits |= ..[3].. << 18 */
- SAL_L (CONST(30),ECX) /* glyphp[5][line] << 30 */
- OR_L (EDX,EBX) /* bits |= ..[4].. << 24 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
- OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
- MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (CONST(0),EAX)
- OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
- MOV_L (CONST(0),EDX)
- MOV_B (BL,AL)
- MOV_B (BH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
- ROL_L (CONST(16),EBX)
- MOV_B (BL,AL)
- MOV_B (BH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
- ROL_L (CONST(16),EBX)
- MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
- MOV_L (EBX,REGIND(EDI))
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
-#endif
-
- CMP_L (CONST(32),width_arg)
- JG (.L6_2)
-#ifndef FIXEDBASE
- ADD_L (CONST(4),EDI) /* base++ */
-#endif
- JMP (.L6_4)
-.L6_2:
- /* Note that glyphp[5][line] is already read again. */
- /* EAX = bits = glyphp[5][line] >> 2 */
- MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
- MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
- SHR_L (CONST(2),EAX) /* glyphp[5][line] >> 2 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
- MOV_L (REGOFF(32,ESI),ECX) /* glyphp[8] */
- SAL_L (CONST(4),EDX) /* glyphp[6][line] << 4 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[8][line] */
- SAL_L (CONST(10),EBX) /* glyphp[7][line] << 10 */
- OR_L (EDX,EAX) /* bits |= ..[6].. << 4 */
- SAL_L (CONST(16),ECX) /* glyphp[8][line] << 16 */
- MOV_L (REGOFF(36,ESI),EDX) /* glyphp[9] */
- OR_L (EBX,EAX) /* bits |= ..[7].. << 10 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[9][line] */
- OR_L (ECX,EAX) /* bits |= ..[8].. << 16 */
- MOV_L (REGOFF(40,ESI),EBX) /* glyphp[10] */
- SAL_L (CONST(22),EDX) /* glyphp[9][line] << 22 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[10][line] */
- OR_L (EDX,EAX) /* bits |= ..[9].. << 22 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
- SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
- MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
- OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
-#else
- MOV_L (CONST(0),ECX)
- SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
- MOV_L (CONST(0),EDX)
- OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
- MOV_B (AL,CL)
- MOV_B (AH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
- ROL_L (CONST(16),EAX)
- MOV_B (AL,CL)
- MOV_B (AH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
- MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
- ROL_L (CONST(16),EAX)
- MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
-#endif
-
- CMP_L (CONST(64),width_arg)
- JG (.L6_3)
-#ifndef FIXEDBASE
- ADD_L (CONST(8),EDI) /* base+=2 */
-#endif
- JMP (.L6_4)
-.L6_3:
- /* Note that glyphp[10][line] is read again. */
- /* EAX = bits = glyphp[10][line] >> 4 */
- SHR_L (CONST(4),ECX) /* glyphp[10][line] >> 4 */
- MOV_L (REGOFF(48,ESI),EBX) /* glyphp[12] */
- SAL_L (CONST(2),EDX) /* glyphp[11][line] << 2 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[12][line] */
- OR_L (EDX,ECX) /* bits |= ..[11].. << 2 */
- MOV_L (REGOFF(52,ESI),EAX) /* glyphp[13] */
- SAL_L (CONST(8),EBX) /* glyphp[12][line] << 8 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[13][line] */
- OR_L (EBX,ECX) /* bits |= ..[12].. << 8 */
- MOV_L (REGOFF(56,ESI),EDX) /* glyphp[14] */
- SAL_L (CONST(14),EAX) /* glyphp[13][line] << 14 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[14][line] */
- OR_L (EAX,ECX) /* bits |= ..[13].. << 14 */
- MOV_L (REGOFF(60,ESI),EBX) /* glyphp[15] */
- SAL_L (CONST(20),EDX) /* glyphp[14][line] << 20 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[15][line] */
- OR_L (EDX,ECX) /* bits |= ..[14].. << 20 */
-
-#ifndef MSBFIRST
- SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
- OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EAX)
- SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
- MOV_L (CONST(0),EDX)
- OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
- MOV_B (CL,AL)
- MOV_B (CH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
- ROL_L (CONST(16),ECX)
- MOV_B (CL,AL)
- MOV_B (CH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
- ROL_L (CONST(16),ECX)
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
-#ifndef FIXEDBASE
- ADD_L (CONST(12),EDI) /* base += 3*/
-#endif
- CMP_L (CONST(96),width_arg)
- JLE (.L6_4)
- ADD_L (CONST(64),ESI) /* glyphp += 16 */
- SUB_L (CONST(96),width_arg)
- JMP (.L6_1)
-
-.L6_4:
-
-#ifndef FIXEDBASE
- MOV_L (EDI,EAX) /* return base */
-#else
- MOV_L (base_arg,EAX) /* return base */
-#endif
- MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
- MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
- MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
- MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
- ADD_L (CONST(16),ESP)
- RET
-
-
- ALIGNTEXT4
-
-#ifdef FIXEDBASE
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase):
-# endif
-#else
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirst)
-GLNAME(DrawTETextScanlineWidth8PMSBFirst):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirst)
-GLNAME(DrawTETextScanlineWidth8PLSBFirst):
-# endif
-#endif
-
- SUB_L (CONST(16),ESP)
- MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
- MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
- MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
- MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
-
- MOV_L (line_arg,EBP)
- MOV_L (base_arg,EDI)
- MOV_L (glyphp_arg,ESI)
-
- ALIGNTEXT4
-
-.L8_1:
- /* Pentium-optimized instruction pairing. */
- /* EBX = bits */
- MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
- MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
-#ifdef MSBFIRST
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
-#else
- MOV_L (EAX,EBX) /* bits = glyph[0][line] */
- MOV_B (DL,BH) /* bits |= ..[1].. << 8 */
-#endif
-
- ROL_L (CONST(16),EBX)
- MOV_L (REGOFF(8,ESI),EAX) /* glyphp[2] */
- MOV_L (REGOFF(12,ESI),ECX) /* glyphp[3] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[2][line] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[3][line] */
-#ifdef MSBFIRST
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
-#else
- MOV_B (AL,BL) /* bits |= ..[2].. << 16 */
- MOV_B (CL,BH) /* bits |= ..[3].. << 24 */
-#endif
- ROL_L (CONST(16),EBX)
- MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
- CMP_L (CONST(32),width_arg)
-#ifndef FIXEDBASE
- JLE (.L8_2)
-#else
- JLE (.L8_3)
-#endif
-
- MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
- MOV_L (REGOFF(20,ESI),EDX) /* glyphp[5] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[5][line] */
-#ifdef MSBFIRST
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
-#else
- MOV_L (EAX,EBX) /* bits = glyph[4][line] */
- MOV_B (DL,BH) /* nits |= ..[5].. << 8 */
-#endif
-
- ROL_L (CONST(16),EBX)
- MOV_L (REGOFF(24,ESI),EAX) /* glyphp[6] */
- MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[6][line] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
-#ifdef MSBFIRST
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
-#else
- MOV_B (AL,BL) /* bits |= ..[6].. << 16 */
- MOV_B (CL,BH) /* bits |= ..[7].. << 24 */
-#endif
- ROL_L (CONST(16),EBX)
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base+1, bits) */
- ADD_L (CONST(8),EDI) /* base += 2 */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- CMP_L (CONST(64),width_arg)
- JLE (.L8_3)
- ADD_L (CONST(32),ESI) /* glyphp += 8 */
- SUB_L (CONST(64),width_arg)
- JMP (.L8_1)
-
-#ifndef FIXEDBASE
-.L8_2:
- ADD_L (CONST(4),EDI) /* base++ */
-.L8_3:
- MOV_L (EDI,EAX) /* return base */
-#else
-.L8_3:
- MOV_L (base_arg,EAX) /* return base */
-#endif
- MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
- MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
- MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
- MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
- ADD_L (CONST(16),ESP)
- RET
-
- ALIGNTEXT4
-
-#ifdef FIXEDBASE
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase)
-GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase):
-# endif
-#else
-# ifdef MSBFIRST
- GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirst)
-GLNAME(DrawTETextScanlineWidth9PMSBFirst):
-# else
- GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirst)
-GLNAME(DrawTETextScanlineWidth9PLSBFirst):
-# endif
-#endif
-
- SUB_L (CONST(16),ESP)
- MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
- MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
- MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
- MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
-
- MOV_L (line_arg,EBP)
- MOV_L (base_arg,EDI)
- MOV_L (glyphp_arg,ESI)
-
- ALIGNTEXT4
-
-.L9_1:
- /* Pentium-optimized instruction pairing. */
- /* EAX = bits */
- MOV_L (REGOFF(4,ESI),EBX) /* glyphp[1] */
- MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[1][line] */
- MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
- SAL_L (CONST(9),EBX) /* glyphp[1][line] << 9 */
- MOV_L (REGOFF(12,ESI),EDX) /* glyphp[3] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[3][line] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
- OR_L (EBX,EAX) /* bits |= ..[1].. << 9 */
- SAL_L (CONST(18),ECX) /* glyphp[2][line] << 18 */
- OR_L (ECX,EAX) /* bits |= ..[2].. << 18 */
- SAL_L (CONST(27),EDX) /* glyphp[3][line << 27 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
- OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (CONST(0),EBX)
- OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
- MOV_L (CONST(0),ECX)
- MOV_B (AL,BL)
- MOV_B (AH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
- ROL_L (CONST(16),EAX)
- MOV_B (AL,BL)
- MOV_B (AH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
- MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
- ROL_L (CONST(16),EAX)
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
- MOV_L (EAX,REGIND(EDI))
-#endif
-
- CMP_L (CONST(32),width_arg)
- JG (.L9_2)
-#ifndef FIXEDBASE
- ADD_L (CONST(4),EDI) /* base++ */
-#endif
- JMP (.L9_11)
-.L9_2:
- /* Note that glyphp[3][line] is read again. */
- /* EAX = bits, EBX = glyphp[3][line] >> 5 */
- SHR_L (CONST(5),EBX) /* glyphp[3][line] >> 5 */
- MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
- MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
- MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
- SAL_L (CONST(4),EAX) /* glyphp[4][line] << 4 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
- SAL_L (CONST(13),ECX) /* glyphp[5][line] << 13 */
- OR_L (EBX,EAX) /* bits |= ..[4].. << 4 */
- SAL_L (CONST(22),EDX) /* glyphp[6][line] << 22 */
- MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
- OR_L (ECX,EAX) /* bits |= ..[5].. << 13 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
- OR_L (EDX,EAX) /* bits |= ..[6].. << 22 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
- SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
- OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
- MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),ECX)
- SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
- MOV_L (CONST(0),EDX)
- OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
- MOV_B (AL,CL)
- MOV_B (AH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
- ROL_L (CONST(16),EAX)
- MOV_B (AL,CL)
- MOV_B (AH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
- MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
- ROL_L (CONST(16),EAX)
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
-#endif
-
- CMP_L (CONST(64),width_arg)
- JG (.L9_3)
-#ifndef FIXEDBASE
- ADD_L (CONST(8),EDI) /* base+=2 */
-#endif
- JMP (.L9_11)
-.L9_3:
-
- /* Note that glyphp[7][line] is read again. */
- /* ECX = bits = glyphp[7][line] >> 1 */
- SHR_L (CONST(1),ECX) /* glyphp[7][line] >> 1 */
- MOV_L (REGOFF(36,ESI),EBX) /* glyphp[9] */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[8][line] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[9][line] */
- SAL_L (CONST(8),EDX) /* glyphp[8][line] << 8 */
- MOV_L (REGOFF(40,ESI),EAX) /* glyphp[10] */
- SAL_L (CONST(17),EBX) /* glyphp[9][line] << 17 */
- OR_L (EDX,ECX) /* bits |= ..[8].. << 8 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[10][line] */
- OR_L (EBX,ECX) /* bits |= ..[9].. << 17 */
- SAL_L (CONST(26),EAX) /* glyphp[10][line] << 26 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
- OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EDX)
- OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
- MOV_L (CONST(0),EBX)
- MOV_B (CL,DL)
- MOV_B (CH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
- ROL_L (CONST(16),ECX)
- MOV_B (CL,DL)
- MOV_B (CH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
- MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
- ROL_L (CONST(16),ECX)
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
- CMP_L (CONST(96),width_arg)
- JG (.L9_4)
-#ifndef FIXEDBASE
- ADD_L (CONST(12),EDI) /* base+=3 */
-#endif
- JMP (.L9_11)
-.L9_4:
- /* Note that glyphp[10][line] is read again. */
- /* EDX = bits = glyphp[10][line] >> 6 */
- SHR_L (CONST(6),EDX) /* glyphp[10][line] >> 6 */
- MOV_L (REGOFF(44,ESI),EBX) /* glyphp[11] */
- MOV_L (REGOFF(48,ESI),EAX) /* glyphp[12] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[11][line] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[12][line] */
- MOV_L (REGOFF(52,ESI),ECX) /* glyphp[13] */
- SAL_L (CONST(3),EBX) /* glyphp[11][line] << 3 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[13][line] */
- SAL_L (CONST(12),EAX) /* glyphp[12][line] << 12 */
- OR_L (EBX,EDX) /* bits |= ..[11].. << 3 */
- SAL_L (CONST(21),ECX) /* glyphp[13][line] << 21 */
- MOV_L (REGOFF(56,ESI),EBX) /* glyphp[14] */
- OR_L (EAX,EDX) /* bits |= ..[12].. << 17 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[14][line] */
- SAL_L (CONST(30),EBX) /* glyphp[14][line] << 30 */
- OR_L (ECX,EDX) /* bits |= ..[13].. << 21 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
- OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
-#ifndef FIXEDBASE
- MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EAX)
- OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
- MOV_L (CONST(0),ECX)
- MOV_B (DL,AL)
- MOV_B (DH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
- ROL_L (CONST(16),EDX)
- MOV_B (DL,AL)
- MOV_B (DH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
- MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
- ROL_L (CONST(16),EDX)
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
-#ifndef FIXEDBASE
- MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
- CMP_L (CONST(128),width_arg)
- JG (.L9_5)
-#ifndef FIXEDBASE
- ADD_L (CONST(16),EDI) /* base+=4 */
-#endif
- JMP (.L9_11)
-.L9_5:
- /* Note that glyphp[14][line] is read again. */
- /* EAX = bits = glyphp[14][line] >> 2 */
- SHR_L (CONST(2),EAX) /* glyphp[14][line] >> 2 */
- MOV_L (REGOFF(60,ESI),ECX) /* glyphp[15] */
- MOV_L (REGOFF(64,ESI),EBX) /* glyphp[16] */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[15][line] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[16][line] */
- MOV_L (REGOFF(68,ESI),EDX) /* glyphp[17] */
- SAL_L (CONST(7),ECX) /* glyphp[15][line] << 7 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[17][line] */
- SAL_L (CONST(16),EBX) /* glyphp[16][line] << 16 */
- OR_L (ECX,EAX) /* bits |= ..[15].. << 7 */
- SAL_L (CONST(25),EDX) /* glyphp[17][line] << 25 */
- OR_L (EBX,EAX) /* bits |= ..[16].. << 16 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
- OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),ECX)
- OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
- MOV_L (CONST(0),EBX)
- MOV_B (AL,CL)
- MOV_B (AH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
- ROL_L (CONST(16),EAX)
- MOV_B (AL,CL)
- MOV_B (AH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
- MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
- ROL_L (CONST(16),EAX)
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
- CMP_L (CONST(160),width_arg)
- JG (.L9_6)
-#ifndef FIXEDBASE
- ADD_L (CONST(20),EDI) /* base+=5 */
-#endif
- JMP (.L9_11)
-.L9_6:
- /* Note that glyphp[17][line] is read again. */
- /* ECX = bits = glyphp[17][line] >> 7 */
- SHR_L (CONST(7),ECX) /* glyphp[17][line] >> 7 */
- MOV_L (REGOFF(72,ESI),EBX) /* glyphp[18] */
- MOV_L (REGOFF(76,ESI),EAX) /* glyphp[19] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[18][line] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[19][line] */
- MOV_L (REGOFF(80,ESI),EDX) /* glyphp[20] */
- SAL_L (CONST(2),EBX) /* glyphp[18][line] << 2 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[20][line] */
- SAL_L (CONST(11),EAX) /* glyphp[19][line] << 11 */
- OR_L (EBX,ECX) /* bits |= ..[18].. << 2 */
- SAL_L (CONST(20),EDX) /* glyphp[20][line] << 20 */
- MOV_L (REGOFF(84,ESI),EBX) /* glyphp[21] */
- OR_L (EAX,ECX) /* bits |= ..[19].. << 11 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[21][line] */
- OR_L (EDX,ECX) /* bits |= ..[20].. << 20 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
- SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
- OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
- MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EAX)
- SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
- MOV_L (CONST(0),EDX)
- OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
- MOV_B (CL,AL)
- MOV_B (CH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
- ROL_L (CONST(16),ECX)
- MOV_B (CL,AL)
- MOV_B (CH,DL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
- MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
- ROL_L (CONST(16),ECX)
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
-#ifndef FIXEDBASE
- MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
-#endif
-
- CMP_L (CONST(192),width_arg)
- JG (.L9_7)
-#ifndef FIXEDBASE
- ADD_L (CONST(24),EDI) /* base+=6 */
-#endif
- JMP (.L9_11)
-.L9_7:
- /* Note that glyphp[21][line] is read again. */
- /* EAX = bits = glyphp[21][line] >> 3 */
- SHR_L (CONST(3),EAX) /* glyphp[21][line] >> 3 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[22][line] */
- MOV_L (REGOFF(92,ESI),EBX) /* glyphp[23] */
- MOV_L (REGOFF(96,ESI),ECX) /* glyphp[24] */
- SAL_L (CONST(6),EDX) /* glyphp[22][line] << 6 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[23][line] */
- OR_L (EDX,EAX) /* bits |= ..[22].. << 6 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[24][line] */
- SAL_L (CONST(15),EBX) /* glyphp[23][line] << 15 */
- OR_L (EBX,EAX) /* bits |= ..[23].. << 15 */
- SAL_L (CONST(24),ECX) /* glyphp[24][line] << 24 */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
- OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EDX)
- OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
- MOV_L (CONST(0),EBX)
- MOV_B (AL,DL)
- MOV_B (AH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
- ROL_L (CONST(16),EAX)
- MOV_B (AL,DL)
- MOV_B (AH,BL)
- MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
- MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
- ROL_L (CONST(16),EAX)
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
-#ifndef FIXEDBASE
- MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
- CMP_L (CONST(224),width_arg)
- JG (.L9_8)
-#ifndef FIXEDBASE
- ADD_L (CONST(28),EDI) /* base+=7 */
-#endif
- JMP (.L9_11)
-.L9_8:
- /* Note that glyphp[24][line] is read again. */
- /* EDX = bits = glyphp[24][line] >> 8 */
-
- SHR_L (CONST(8),EDX) /* glyphp[24][line] >> 8 */
- MOV_L (REGOFF(100,ESI),EAX) /* glyphp[25] */
- MOV_L (REGOFF(104,ESI),EBX) /* glyphp[26] */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[25][line] */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[26][line] */
- MOV_L (REGOFF(108,ESI),ECX) /* glyphp[27] */
- SAL_L (CONST(1),EAX) /* glyphp[25][line] << 1 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[27][line] */
- SAL_L (CONST(10),EBX) /* glyphp[26][line] << 10 */
- OR_L (EAX,EDX) /* bits |= ..[25].. << 1 */
- SAL_L (CONST(19),ECX) /* glyphp[27][line] << 19 */
- OR_L (EBX,EDX) /* bits |= ..[26].. << 10 */
- MOV_L (REGOFF(112,ESI),EAX) /* glyphp[28] */
- OR_L (ECX,EDX) /* bits |= ..[27].. << 19 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[28][line] */
-
-#ifndef MSBFIRST
- MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
- SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
- OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
- MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
-#ifndef FIXEDBASE
- MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),EBX)
- SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
- MOV_L (CONST(0),ECX)
- OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
- MOV_B (DL,BL)
- MOV_B (DH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
- ROL_L (CONST(16),EDX)
- MOV_B (DL,BL)
- MOV_B (DH,CL)
- MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
- MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
- ROL_L (CONST(16),EDX)
- MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
-#ifndef FIXEDBASE
- MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
- MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
-#endif
-
- CMP_L (CONST(256),width_arg)
- JG (.L9_9)
-#ifndef FIXEDBASE
- ADD_L (CONST(32),EDI) /* base+=8 */
-#endif
- JMP (.L9_11)
-.L9_9:
- /* Note that glyphp[28][line] is read again. */
- /* EBX = bits = glyphp[28][line] >> 4 */
- SHR_L (CONST(4),EBX) /* glyphp[28][line] >> 4 */
- MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[29][line] */
- MOV_L (REGOFF(120,ESI),EAX) /* glyphp[30] */
- MOV_L (REGOFF(124,ESI),EDX) /* glyphp[31] */
- SAL_L (CONST(5),ECX) /* glyphp[29][line] << 5 */
- MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[30][line] */
- OR_L (ECX,EBX) /* bits |= ..[29].. << 5 */
- MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[31][line] */
- SAL_L (CONST(14),EAX) /* glyphp[30][line] << 14 */
- ADD_L (CONST(128),ESI) /* glyphp+=32 */
- SAL_L (CONST(23),EDX) /* glyphp[31][line] << 23 */
- OR_L (EAX,EBX) /* bits |= ..[30].. << 14 */
- SUB_L (CONST(288),width_arg) /* width-=288 */
- OR_L (EDX,EBX) /* bits |= ..[31].. << 23 */
-
-#ifndef MSBFIRST
-#ifndef FIXEDBASE
- MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#else
- MOV_L (CONST(0),ECX)
- MOV_L (CONST(0),EAX)
- MOV_B (BL,CL)
- MOV_B (BH,AL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
- ROL_L (CONST(16),EBX)
- MOV_B (BL,CL)
- MOV_B (BH,AL)
- MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
- MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
- ROL_L (CONST(16),EBX)
-#ifndef FIXEDBASE
- MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#else
- MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
-#endif
-#endif
-
- ADD_L (CONST(36),EDI) /* base+=9 */
- CMP_L (CONST(0),width_arg)
- JG (.L9_1)
-
-.L9_11:
-#ifndef FIXEDBASE
- MOV_L (EDI,EAX) /* return base */
-#else
- MOV_L (base_arg,EAX) /* return base */
-#endif
- MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
- MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
- MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
- MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
- ADD_L (CONST(16),ESP)
- RET
diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c
deleted file mode 100644
index 82fa28674..000000000
--- a/hw/xfree86/xaa/xaaTEText.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c,v 1.7 1999/05/30 03:03:33 dawes Exp $ */
-
-/********************************************************************
-
- In this file we have GC level replacements for PolyText8/16,
- ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for TE (fixed) fonts.
- The idea is that everything in this file is device independent.
- The mentioned GCOps are merely wrappers for XAAGlyphBltTEColorExpansion
- which calculates the boxes containing arbitrarily clipped text
- and passes them to the TEGlyphRenderer which will usually be a lower
- level XAA function which renders these clipped glyphs using
- the basic color expansion functions exported by the chipset driver.
- The TEGlyphRenderer itself may optionally be driver supplied to
- facilitate work-arounds/optimizations at a higher level than usual.
-
- v1.0 - Mark Vojkovich (mvojkovi@ucsd.edu)
-
-
-********************************************************************/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "font.h"
-#include "scrnintstr.h"
-#include "dixfontstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-
-
-static void XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn, int xInit,
- int yInit, FontPtr font, int fg, int bg, int rop,
- unsigned int planemask, RegionPtr cclip, int nglyph,
- unsigned char* gBase, CharInfoPtr *ppci);
-
-
-/********************************************************************
-
- GC level replacements for PolyText8/16 and ImageText8/16
- for TE fonts when using color expansion.
-
-********************************************************************/
-
-
-int
-XAAPolyText8TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
- (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
-
- /* we have divorced XAAGlyphBltTEColorExpansion from the drawable */
- if(n) XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-
- return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
-}
-
-
-int
-XAAPolyText16TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- (*pGC->font->get_glyphs)(
- pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, infoRec->CharInfo);
-
- if(n) XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-
- return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
-}
-
-
-void
-XAAImageText8TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
- (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
-
- if(n) XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-}
-
-
-void
-XAAImageText16TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- unsigned long n;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- (*pGC->font->get_glyphs)(
- pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, infoRec->CharInfo);
-
- if(n) XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, x + pDraw->x, y + pDraw->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
- pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
-}
-
-
-
-/********************************************************************
-
- GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
- TE fonts when using color expansion.
-
-********************************************************************/
-
-
-void
-XAAImageGlyphBltTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, xInit + pDrawable->x, yInit + pDrawable->y,
- pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
- pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
-}
-
-void
-XAAPolyGlyphBltTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- XAAGlyphBltTEColorExpansion(
- infoRec->pScrn, xInit + pDrawable->x, yInit + pDrawable->y,
- pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
- pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
-}
-
-
-
-
-/********************************************************************
-
- XAAGlyphBltTEColorExpansion -
-
- This guy computes the clipped pieces of text and sends it to
- the lower-level function which will handle acceleration of
- arbitrarily clipped text.
-
-********************************************************************/
-
-
-static void
-XAAGlyphBltTEColorExpansion(
- ScrnInfoPtr pScrn,
- int xInit, int yInit,
- FontPtr font,
- int fg, int bg,
- int rop,
- unsigned int planemask,
- RegionPtr cclip,
- int nglyph,
- unsigned char* gBase,
- CharInfoPtr *ppci )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- int skippix, skipglyphs;
- int Left, Right, Top, Bottom;
- int LeftEdge, RightEdge, ytop, ybot;
- int nbox = REGION_NUM_RECTS(cclip);
- BoxPtr pbox = REGION_RECTS(cclip);
- unsigned int **glyphs = NULL;
- int glyphWidth = FONTMAXBOUNDS(font, characterWidth);
-
- /* find the size of the box */
- Left = xInit;
- Right = Left + (glyphWidth * nglyph);
- Top = yInit - FONTASCENT(font);
- Bottom = yInit + FONTDESCENT(font);
-
- /* get into the first band that may contain part of our string */
- while(nbox && (Top >= pbox->y2)) {
- pbox++; nbox--;
- }
-
- /* stop when the lower edge of the box is beyond our string */
- while(nbox && (Bottom > pbox->y1)) {
- LeftEdge = max(Left, pbox->x1);
- RightEdge = min(Right, pbox->x2);
-
- if(RightEdge > LeftEdge) { /* we have something to draw */
- ytop = max(Top, pbox->y1);
- ybot = min(Bottom, pbox->y2);
-
- if((skippix = LeftEdge - Left)) {
- skipglyphs = skippix/glyphWidth;
- skippix %= glyphWidth;
- } else skipglyphs = 0;
-
- if(!glyphs) {
- int count;
- glyphs = (unsigned int**)(infoRec->PreAllocMem);
-
- for(count = 0; count < nglyph; count++)
- glyphs[count] = (unsigned int*)
- FONTGLYPHBITS(gBase,*ppci++);
-
- /* our new unrolled TE code only writes DWORDS at a time
- so it can read up to 6 characters past the last one
- we're displaying */
- glyphs[count + 0] = glyphs[0];
- glyphs[count + 1] = glyphs[0];
- glyphs[count + 2] = glyphs[0];
- glyphs[count + 3] = glyphs[0];
- glyphs[count + 4] = glyphs[0];
- glyphs[count + 5] = glyphs[0];
- }
-
- /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */
-
- (*infoRec->TEGlyphRenderer)( pScrn,
- LeftEdge, ytop, RightEdge - LeftEdge, ybot - ytop,
- skippix, ytop - Top, glyphs + skipglyphs, glyphWidth,
- fg, bg, rop, planemask);
- }
-
- nbox--; pbox++;
- }
-}
-
-
-
-
diff --git a/hw/xfree86/xaa/xaaTables.c b/hw/xfree86/xaa/xaaTables.c
deleted file mode 100644
index 0d2ce760a..000000000
--- a/hw/xfree86/xaa/xaaTables.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTables.c,v 1.2 1998/07/25 16:58:53 dawes Exp $ */
-
-/*
- * This is a table of 24-bit values, indexed with an 8-bit byte value, then
- * expands each bit to three consecutive bits. This is required for color
- * expansion in 24bpp mode with the coprocessor in 8bpp mode, with LSB-first
- * bit order within a byte.
- */
-
-unsigned int byte_expand3[256] =
-{
- 0x000000, 0x000007, 0x000038, 0x00003F, 0x0001C0, 0x0001C7, 0x0001F8, 0x0001FF,
- 0x000E00, 0x000E07, 0x000E38, 0x000E3F, 0x000FC0, 0x000FC7, 0x000FF8, 0x000FFF,
- 0x007000, 0x007007, 0x007038, 0x00703F, 0x0071C0, 0x0071C7, 0x0071F8, 0x0071FF,
- 0x007E00, 0x007E07, 0x007E38, 0x007E3F, 0x007FC0, 0x007FC7, 0x007FF8, 0x007FFF,
- 0x038000, 0x038007, 0x038038, 0x03803F, 0x0381C0, 0x0381C7, 0x0381F8, 0x0381FF,
- 0x038E00, 0x038E07, 0x038E38, 0x038E3F, 0x038FC0, 0x038FC7, 0x038FF8, 0x038FFF,
- 0x03F000, 0x03F007, 0x03F038, 0x03F03F, 0x03F1C0, 0x03F1C7, 0x03F1F8, 0x03F1FF,
- 0x03FE00, 0x03FE07, 0x03FE38, 0x03FE3F, 0x03FFC0, 0x03FFC7, 0x03FFF8, 0x03FFFF,
- 0x1C0000, 0x1C0007, 0x1C0038, 0x1C003F, 0x1C01C0, 0x1C01C7, 0x1C01F8, 0x1C01FF,
- 0x1C0E00, 0x1C0E07, 0x1C0E38, 0x1C0E3F, 0x1C0FC0, 0x1C0FC7, 0x1C0FF8, 0x1C0FFF,
- 0x1C7000, 0x1C7007, 0x1C7038, 0x1C703F, 0x1C71C0, 0x1C71C7, 0x1C71F8, 0x1C71FF,
- 0x1C7E00, 0x1C7E07, 0x1C7E38, 0x1C7E3F, 0x1C7FC0, 0x1C7FC7, 0x1C7FF8, 0x1C7FFF,
- 0x1F8000, 0x1F8007, 0x1F8038, 0x1F803F, 0x1F81C0, 0x1F81C7, 0x1F81F8, 0x1F81FF,
- 0x1F8E00, 0x1F8E07, 0x1F8E38, 0x1F8E3F, 0x1F8FC0, 0x1F8FC7, 0x1F8FF8, 0x1F8FFF,
- 0x1FF000, 0x1FF007, 0x1FF038, 0x1FF03F, 0x1FF1C0, 0x1FF1C7, 0x1FF1F8, 0x1FF1FF,
- 0x1FFE00, 0x1FFE07, 0x1FFE38, 0x1FFE3F, 0x1FFFC0, 0x1FFFC7, 0x1FFFF8, 0x1FFFFF,
- 0xE00000, 0xE00007, 0xE00038, 0xE0003F, 0xE001C0, 0xE001C7, 0xE001F8, 0xE001FF,
- 0xE00E00, 0xE00E07, 0xE00E38, 0xE00E3F, 0xE00FC0, 0xE00FC7, 0xE00FF8, 0xE00FFF,
- 0xE07000, 0xE07007, 0xE07038, 0xE0703F, 0xE071C0, 0xE071C7, 0xE071F8, 0xE071FF,
- 0xE07E00, 0xE07E07, 0xE07E38, 0xE07E3F, 0xE07FC0, 0xE07FC7, 0xE07FF8, 0xE07FFF,
- 0xE38000, 0xE38007, 0xE38038, 0xE3803F, 0xE381C0, 0xE381C7, 0xE381F8, 0xE381FF,
- 0xE38E00, 0xE38E07, 0xE38E38, 0xE38E3F, 0xE38FC0, 0xE38FC7, 0xE38FF8, 0xE38FFF,
- 0xE3F000, 0xE3F007, 0xE3F038, 0xE3F03F, 0xE3F1C0, 0xE3F1C7, 0xE3F1F8, 0xE3F1FF,
- 0xE3FE00, 0xE3FE07, 0xE3FE38, 0xE3FE3F, 0xE3FFC0, 0xE3FFC7, 0xE3FFF8, 0xE3FFFF,
- 0xFC0000, 0xFC0007, 0xFC0038, 0xFC003F, 0xFC01C0, 0xFC01C7, 0xFC01F8, 0xFC01FF,
- 0xFC0E00, 0xFC0E07, 0xFC0E38, 0xFC0E3F, 0xFC0FC0, 0xFC0FC7, 0xFC0FF8, 0xFC0FFF,
- 0xFC7000, 0xFC7007, 0xFC7038, 0xFC703F, 0xFC71C0, 0xFC71C7, 0xFC71F8, 0xFC71FF,
- 0xFC7E00, 0xFC7E07, 0xFC7E38, 0xFC7E3F, 0xFC7FC0, 0xFC7FC7, 0xFC7FF8, 0xFC7FFF,
- 0xFF8000, 0xFF8007, 0xFF8038, 0xFF803F, 0xFF81C0, 0xFF81C7, 0xFF81F8, 0xFF81FF,
- 0xFF8E00, 0xFF8E07, 0xFF8E38, 0xFF8E3F, 0xFF8FC0, 0xFF8FC7, 0xFF8FF8, 0xFF8FFF,
- 0xFFF000, 0xFFF007, 0xFFF038, 0xFFF03F, 0xFFF1C0, 0xFFF1C7, 0xFFF1F8, 0xFFF1FF,
- 0xFFFE00, 0xFFFE07, 0xFFFE38, 0xFFFE3F, 0xFFFFC0, 0xFFFFC7, 0xFFFFF8, 0xFFFFFF
-};
-
-/*
- * This is a table of 24-bit values, indexed with an 8-bit byte value,
- * that reverses the bit order of a byte and then expands each bit to three
- * consecutive bits. This is required for color expansion in 24bpp mode
- * with the coprocessor in 8bpp mode, with MSB-first bit order within a
- * byte.
- */
-
-unsigned int byte_reversed_expand3[256] =
-{
- 0x000000, 0x0000E0, 0x00001C, 0x0000FC, 0x008003, 0x0080E3, 0x00801F, 0x0080FF,
- 0x007000, 0x0070E0, 0x00701C, 0x0070FC, 0x00F003, 0x00F0E3, 0x00F01F, 0x00F0FF,
- 0x000E00, 0x000EE0, 0x000E1C, 0x000EFC, 0x008E03, 0x008EE3, 0x008E1F, 0x008EFF,
- 0x007E00, 0x007EE0, 0x007E1C, 0x007EFC, 0x00FE03, 0x00FEE3, 0x00FE1F, 0x00FEFF,
- 0xC00100, 0xC001E0, 0xC0011C, 0xC001FC, 0xC08103, 0xC081E3, 0xC0811F, 0xC081FF,
- 0xC07100, 0xC071E0, 0xC0711C, 0xC071FC, 0xC0F103, 0xC0F1E3, 0xC0F11F, 0xC0F1FF,
- 0xC00F00, 0xC00FE0, 0xC00F1C, 0xC00FFC, 0xC08F03, 0xC08FE3, 0xC08F1F, 0xC08FFF,
- 0xC07F00, 0xC07FE0, 0xC07F1C, 0xC07FFC, 0xC0FF03, 0xC0FFE3, 0xC0FF1F, 0xC0FFFF,
- 0x380000, 0x3800E0, 0x38001C, 0x3800FC, 0x388003, 0x3880E3, 0x38801F, 0x3880FF,
- 0x387000, 0x3870E0, 0x38701C, 0x3870FC, 0x38F003, 0x38F0E3, 0x38F01F, 0x38F0FF,
- 0x380E00, 0x380EE0, 0x380E1C, 0x380EFC, 0x388E03, 0x388EE3, 0x388E1F, 0x388EFF,
- 0x387E00, 0x387EE0, 0x387E1C, 0x387EFC, 0x38FE03, 0x38FEE3, 0x38FE1F, 0x38FEFF,
- 0xF80100, 0xF801E0, 0xF8011C, 0xF801FC, 0xF88103, 0xF881E3, 0xF8811F, 0xF881FF,
- 0xF87100, 0xF871E0, 0xF8711C, 0xF871FC, 0xF8F103, 0xF8F1E3, 0xF8F11F, 0xF8F1FF,
- 0xF80F00, 0xF80FE0, 0xF80F1C, 0xF80FFC, 0xF88F03, 0xF88FE3, 0xF88F1F, 0xF88FFF,
- 0xF87F00, 0xF87FE0, 0xF87F1C, 0xF87FFC, 0xF8FF03, 0xF8FFE3, 0xF8FF1F, 0xF8FFFF,
- 0x070000, 0x0700E0, 0x07001C, 0x0700FC, 0x078003, 0x0780E3, 0x07801F, 0x0780FF,
- 0x077000, 0x0770E0, 0x07701C, 0x0770FC, 0x07F003, 0x07F0E3, 0x07F01F, 0x07F0FF,
- 0x070E00, 0x070EE0, 0x070E1C, 0x070EFC, 0x078E03, 0x078EE3, 0x078E1F, 0x078EFF,
- 0x077E00, 0x077EE0, 0x077E1C, 0x077EFC, 0x07FE03, 0x07FEE3, 0x07FE1F, 0x07FEFF,
- 0xC70100, 0xC701E0, 0xC7011C, 0xC701FC, 0xC78103, 0xC781E3, 0xC7811F, 0xC781FF,
- 0xC77100, 0xC771E0, 0xC7711C, 0xC771FC, 0xC7F103, 0xC7F1E3, 0xC7F11F, 0xC7F1FF,
- 0xC70F00, 0xC70FE0, 0xC70F1C, 0xC70FFC, 0xC78F03, 0xC78FE3, 0xC78F1F, 0xC78FFF,
- 0xC77F00, 0xC77FE0, 0xC77F1C, 0xC77FFC, 0xC7FF03, 0xC7FFE3, 0xC7FF1F, 0xC7FFFF,
- 0x3F0000, 0x3F00E0, 0x3F001C, 0x3F00FC, 0x3F8003, 0x3F80E3, 0x3F801F, 0x3F80FF,
- 0x3F7000, 0x3F70E0, 0x3F701C, 0x3F70FC, 0x3FF003, 0x3FF0E3, 0x3FF01F, 0x3FF0FF,
- 0x3F0E00, 0x3F0EE0, 0x3F0E1C, 0x3F0EFC, 0x3F8E03, 0x3F8EE3, 0x3F8E1F, 0x3F8EFF,
- 0x3F7E00, 0x3F7EE0, 0x3F7E1C, 0x3F7EFC, 0x3FFE03, 0x3FFEE3, 0x3FFE1F, 0x3FFEFF,
- 0xFF0100, 0xFF01E0, 0xFF011C, 0xFF01FC, 0xFF8103, 0xFF81E3, 0xFF811F, 0xFF81FF,
- 0xFF7100, 0xFF71E0, 0xFF711C, 0xFF71FC, 0xFFF103, 0xFFF1E3, 0xFFF11F, 0xFFF1FF,
- 0xFF0F00, 0xFF0FE0, 0xFF0F1C, 0xFF0FFC, 0xFF8F03, 0xFF8FE3, 0xFF8F1F, 0xFF8FFF,
- 0xFF7F00, 0xFF7FE0, 0xFF7F1C, 0xFF7FFC, 0xFFFF03, 0xFFFFE3, 0xFFFF1F, 0xFFFFFF,
-};
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
deleted file mode 100644
index f999b425f..000000000
--- a/hw/xfree86/xaa/xaaWideLine.c
+++ /dev/null
@@ -1,941 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.11 2003/07/16 01:38:48 dawes Exp $ */
-
-/*
-
-XAAPolylinesWideSolid does not maintain a span list and subsequently does
-not follow the "touch-each-pixel-once" rules for wide lines and arcs.
-This means it can only be used in the case where we have
-miSpansEasyRop(pGC->alu). Since we clip spans on the fly, we
-limited usage of this function to one rect situations. This
-function is used only for solid lines.
-
- Adapted from miWideLine by Mark Vojkovich (mvojkovi@ucsd.edu)
-Original mi code written by Keith Packard.
-
-*/
-
-#ifndef XFree86LOADER
-#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
-#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "miwideline.h"
-#include "mi.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-
-#ifdef ICEILTEMPDECL
-ICEILTEMPDECL
-#endif
-
-#define DRAW_POINT(pScrn, x, y) \
- if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \
- else XAAPointHelper(pScrn, x, y)
-
-#define FILL_RECT(pScrn, x, y, w, h) \
- if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); \
- else XAAFillRectHelper(pScrn, x, y, w, h)
-
-#define FILL_SPAN(pScrn, x, y, w) \
- if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, 1); \
- else XAASpanHelper(pScrn, x, y, w)
-
-
-#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
- if (ybase == edgey) { \
- if (edgeleft) { \
- if (edge->x > xcl) \
- xcl = edge->x; \
- } else { \
- if (edge->x < xcr) \
- xcr = edge->x; \
- } \
- edgey++; \
- edge->x += edge->stepx; \
- edge->e += edge->dx; \
- if (edge->e > 0) { \
- edge->x += edge->signdx; \
- edge->e -= edge->dy; \
- } \
- }
-
-static void
-XAAPointHelper(ScrnInfoPtr pScrn, int x, int y)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- BoxPtr extents = infoRec->ClipBox;
-
- if((x >= extents->x1) && (x < extents->x2) &&
- (y >= extents->y1) && (y < extents->y2))
- (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1);
-}
-
-static void
-XAAFillRectHelper(ScrnInfoPtr pScrn, int x1, int y1, int dx, int dy)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- BoxPtr extents = infoRec->ClipBox;
- int x2 = x1 + dx;
- int y2 = y1 + dy;
-
- if(x1 < extents->x1) x1 = extents->x1;
- if(x2 >= extents->x2) x2 = extents->x2;
- if((dx = x2 - x1)<1) return;
- if(y1 < extents->y1) y1 = extents->y1;
- if(y2 >= extents->y2) y2 = extents->y2;
- if((dy = y2 - y1)<1) return;
-
- (*infoRec->SubsequentSolidFillRect)(pScrn, x1, y1, dx, dy);
-}
-
-
-static void
-XAASpanHelper(ScrnInfoPtr pScrn, int x1, int y, int width)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- BoxPtr extents = infoRec->ClipBox;
- int x2;
-
- if((y < extents->y1) || (y >= extents->y2)) return;
-
- x2 = x1 + width;
- if(x1 < extents->x1) x1 = extents->x1;
- if(x2 > extents->x2) x2 = extents->x2;
- width = x2 - x1;
-
- if(width > 0)
- (*infoRec->SubsequentSolidFillRect)(pScrn, x1, y, width, 1);
-
-}
-
-#define FixError(x, dx, dy, e, sign, step, h) { \
- e += (h) * dx; \
- x += (h) * step; \
- if(e > 0) { \
- x += e * sign/dy; \
- e %= dy; \
- if(e) { \
- x += sign; \
- e -= dy; \
- } \
- } \
-}
-
-
-static void
-XAAFillPolyHelper (
- GCPtr pGC,
- int y, /* start y coordinate */
- int overall_height, /* height of entire segment */
- PolyEdgePtr left, PolyEdgePtr right,
- int left_count, int right_count )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- BoxPtr extents = infoRec->ClipBox;
- int left_x, left_e, left_stepx, left_signdx, left_dy, left_dx;
- int right_x, right_e, right_stepx, right_signdx, right_dy, right_dx;
- int height, left_height, right_height;
- int xorg;
- Bool hardClip;
-
- if((y >= extents->y2) || ((y + overall_height) <= extents->y1))
- return;
-
- /* Muffle compiler */
- left_x = left_e = left_stepx = left_signdx = left_dy = left_dx = 0;
- right_x = right_e = right_stepx = right_signdx = right_dy = right_dx = 0;
-
- left_height = right_height = 0;
- xorg = 0;
-
- hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
- while ((left_count || left_height) && (right_count || right_height)) {
- if (!left_height && left_count) {
- left_height = left->height;
- left_x = left->x + xorg;
- left_stepx = left->stepx;
- left_signdx = left->signdx;
- left_e = left->e;
- left_dy = left->dy;
- left_dx = left->dx;
- left_count--;
- left++;
- }
- if (!right_height && right_count) {
- right_height = right->height;
- right_x = right->x + xorg + 1;
- right_stepx = right->stepx;
- right_signdx = right->signdx;
- right_e = right->e;
- right_dy = right->dy;
- right_dx = right->dx;
- right_count--;
- right++;
- }
-
- height = (left_height > right_height) ? right_height : left_height;
-
- left_height -= height;
- right_height -= height;
-
- if(hardClip && infoRec->SubsequentSolidFillTrap && (height > 6)) {
- int right_DX, left_DX;
-
- right_DX = (right_dx * right_signdx) + (right_stepx * right_dy);
- left_DX = (left_dx * left_signdx) + (left_stepx * left_dy);
-
- (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn, y, height,
- left_x, left_DX, left_dy, left_e,
- right_x - 1, right_DX, right_dy, right_e);
-
- FixError(left_x, left_dx, left_dy, left_e, left_signdx,
- left_stepx, height);
- FixError(right_x, right_dx, right_dy, right_e, right_signdx,
- right_stepx, height);
- y += height;
- continue;
- }
-
- while (height--) {
- if(right_x > left_x) {
- FILL_SPAN(infoRec->pScrn, left_x, y, right_x - left_x);
- }
- y++;
-
- left_x += left_stepx;
- left_e += left_dx;
- if (left_e > 0) {
- left_x += left_signdx;
- left_e -= left_dy;
- }
- right_x += right_stepx;
- right_e += right_dx;
- if (right_e > 0) {
- right_x += right_signdx;
- right_e -= right_dy;
- }
-
- }
- }
-}
-
-
-
-static void
-XAAWideSegment (
- GCPtr pGC,
- int x1, int y1, int x2, int y2,
- Bool projectLeft, Bool projectRight,
- LineFacePtr leftFace, LineFacePtr rightFace )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- double l, L, r;
- double xa, ya;
- double projectXoff, projectYoff;
- double k;
- double maxy;
- int x, y;
- int dx, dy;
- int finaly;
- PolyEdgePtr left, right;
- PolyEdgePtr top, bottom;
- int lefty, righty, topy, bottomy;
- int signdx;
- PolyEdgeRec lefts[2], rights[2];
- LineFacePtr tface;
- int lw = pGC->lineWidth;
- Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
- /* draw top-to-bottom always */
- if ((y2 < y1) || ((y2 == y1) && (x2 < x1))) {
- x = x1;
- x1 = x2;
- x2 = x;
-
- y = y1;
- y1 = y2;
- y2 = y;
-
- x = projectLeft;
- projectLeft = projectRight;
- projectRight = x;
-
- tface = leftFace;
- leftFace = rightFace;
- rightFace = tface;
- }
-
- dy = y2 - y1;
- signdx = 1;
- dx = x2 - x1;
- if (dx < 0)
- signdx = -1;
-
- leftFace->x = x1;
- leftFace->y = y1;
- leftFace->dx = dx;
- leftFace->dy = dy;
-
- rightFace->x = x2;
- rightFace->y = y2;
- rightFace->dx = -dx;
- rightFace->dy = -dy;
-
- if (!dy) {
- rightFace->xa = 0;
- rightFace->ya = (double) lw / 2.0;
- rightFace->k = -(double) (lw * dx) / 2.0;
- leftFace->xa = 0;
- leftFace->ya = -rightFace->ya;
- leftFace->k = rightFace->k;
- x = x1;
- if (projectLeft)
- x -= (lw >> 1);
- y = y1 - (lw >> 1);
- dx = x2 - x;
- if (projectRight)
- dx += ((lw + 1) >> 1);
- dy = lw;
- FILL_RECT(infoRec->pScrn, x, y, dx, dy);
- } else if (!dx) {
- leftFace->xa = (double) lw / 2.0;
- leftFace->ya = 0;
- leftFace->k = (double) (lw * dy) / 2.0;
- rightFace->xa = -leftFace->xa;
- rightFace->ya = 0;
- rightFace->k = leftFace->k;
- y = y1;
- if (projectLeft)
- y -= lw >> 1;
- x = x1 - (lw >> 1);
- dy = y2 - y;
- if (projectRight)
- dy += ((lw + 1) >> 1);
- dx = lw;
- FILL_RECT(infoRec->pScrn, x, y, dx, dy);
- } else {
- l = ((double) lw) / 2.0;
- L = sqrt((double)(dx*dx + dy*dy));
-
- if (dx < 0) {
- right = &rights[1];
- left = &lefts[0];
- top = &rights[0];
- bottom = &lefts[1];
- } else {
- right = &rights[0];
- left = &lefts[1];
- top = &lefts[0];
- bottom = &rights[1];
- }
- r = l / L;
-
- /* coord of upper bound at integral y */
- ya = -r * dx;
- xa = r * dy;
-
- projectXoff = -ya;
- projectYoff = xa;
-
- /* xa * dy - ya * dx */
- k = l * L;
-
- leftFace->xa = xa;
- leftFace->ya = ya;
- leftFace->k = k;
- rightFace->xa = -xa;
- rightFace->ya = -ya;
- rightFace->k = k;
-
- if (projectLeft)
- righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 0, right);
- else
- righty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 0, right);
-
- /* coord of lower bound at integral y */
- ya = -ya;
- xa = -xa;
-
- /* xa * dy - ya * dx */
- k = - k;
-
- if (projectLeft)
- lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 1, left);
- else
- lefty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 1, left);
-
- /* coord of top face at integral y */
-
- if (signdx > 0) {
- ya = -ya;
- xa = -xa;
- }
-
- if (projectLeft) {
- double xap = xa - projectXoff;
- double yap = ya - projectYoff;
- topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x1, y1, dx > 0, top);
- }
- else
- topy = miPolyBuildEdge(xa, ya, 0.0,
- -dy, dx, x1, y1, dx > 0, top);
-
- /* coord of bottom face at integral y */
-
- if (projectRight) {
- double xap = xa + projectXoff;
- double yap = ya + projectYoff;
- bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya + projectYoff;
- } else {
- bottomy = miPolyBuildEdge (xa, ya, 0.0,
- -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya;
- }
-
- finaly = ICEIL (maxy) + y2;
-
- if (dx < 0) {
- left->height = bottomy - lefty;
- right->height = finaly - righty;
- top->height = righty - topy;
- } else {
- right->height = bottomy - righty;
- left->height = finaly - lefty;
- top->height = lefty - topy;
- }
- bottom->height = finaly - bottomy;
- XAAFillPolyHelper (pGC, topy,
- bottom->height + bottomy - topy, lefts, rights, 2, 2);
- }
-}
-
-
-static void
-XAALineArcI (GCPtr pGC, int xorg, int yorg)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int x, y, e, ex;
- int slw = pGC->lineWidth;
- Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
- y = (slw >> 1) + 1;
- if (slw & 1)
- e = - ((y << 2) + 3);
- else
- e = - (y << 3);
- ex = -4;
- x = 0;
- while (y) {
- e += (y << 3) - 4;
- while (e >= 0) {
- x++;
- e += (ex = -((x << 3) + 4));
- }
- y--;
- slw = (x << 1) + 1;
- if ((e == ex) && (slw > 1))
- slw--;
-
- FILL_SPAN(infoRec->pScrn, xorg - x, yorg - y, slw);
-
- if ((y != 0) && ((slw > 1) || (e != ex))) {
- FILL_SPAN(infoRec->pScrn, xorg - x, yorg + y, slw);
- }
- }
-}
-
-
-static void
-XAALineArcD (
- GCPtr pGC,
- double xorg,
- double yorg,
- PolyEdgePtr edge1,
- int edgey1,
- Bool edgeleft1,
- PolyEdgePtr edge2,
- int edgey2,
- Bool edgeleft2 )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- double radius, x0, y0, el, er, yk, xlk, xrk, k;
- int xbase, ybase, y, boty, xl, xr, xcl, xcr;
- int ymin, ymax;
- Bool edge1IsMin, edge2IsMin;
- int ymin1, ymin2;
- Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
-
-
- xbase = floor(xorg);
- x0 = xorg - xbase;
- ybase = ICEIL (yorg);
- y0 = yorg - ybase;
-
- xlk = x0 + x0 + 1.0;
- xrk = x0 + x0 - 1.0;
- yk = y0 + y0 - 1.0;
- radius = ((double)pGC->lineWidth) / 2.0;
- y = floor(radius - y0 + 1.0);
- ybase -= y;
- ymin = ybase;
- ymax = 65536;
- edge1IsMin = FALSE;
- ymin1 = edgey1;
- if (edge1->dy >= 0) {
- if (!edge1->dy) {
- if (edgeleft1)
- edge1IsMin = TRUE;
- else
- ymax = edgey1;
- edgey1 = 65536;
- } else if ((edge1->signdx < 0) == edgeleft1)
- edge1IsMin = TRUE;
- }
- edge2IsMin = FALSE;
- ymin2 = edgey2;
- if (edge2->dy >= 0) {
- if (!edge2->dy) {
- if (edgeleft2)
- edge2IsMin = TRUE;
- else
- ymax = edgey2;
- edgey2 = 65536;
- } else if ((edge2->signdx < 0) == edgeleft2)
- edge2IsMin = TRUE;
- }
- if (edge1IsMin) {
- ymin = ymin1;
- if (edge2IsMin && (ymin1 > ymin2))
- ymin = ymin2;
- } else if (edge2IsMin)
- ymin = ymin2;
- el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
- er = el + xrk;
- xl = 1;
- xr = 0;
- if (x0 < 0.5) {
- xl = 0;
- el -= xlk;
- }
- boty = (y0 < -0.5) ? 1 : 0;
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty) {
- k = (y << 1) + yk;
- er += k;
- while (er > 0.0) {
- xr++;
- er += xrk - (xr << 1);
- }
- el += k;
- while (el >= 0.0) {
- xl--;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if(xcr >= xcl) {
- FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
- }
- }
- er = xrk - (xr << 1) - er;
- el = (xl << 1) - xlk - el;
- boty = floor(-y0 - radius + 1.0);
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty) {
- k = (y << 1) + yk;
- er -= k;
- while ((er >= 0.0) && (xr >= 0)) {
- xr--;
- er += xrk - (xr << 1);
- }
- el -= k;
- while ((el > 0.0) && (xl <= 0)) {
- xl++;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if(xcr >= xcl) {
- FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
- }
- }
-}
-
-
-static void
-XAALineArc (
- GCPtr pGC,
- LineFacePtr leftFace,
- LineFacePtr rightFace,
- double xorg,
- double yorg,
- Bool isInt )
-{
- int xorgi, yorgi;
- PolyEdgeRec edge1, edge2;
- int edgey1, edgey2;
- Bool edgeleft1, edgeleft2;
-
- if (isInt) {
- xorgi = leftFace ? leftFace->x : rightFace->x;
- yorgi = leftFace ? leftFace->y : rightFace->y;
- } else { /* Muffle compiler */
- xorgi = yorgi = 0;
- }
- edgey1 = 65536;
- edgey2 = 65536;
- edge1.x = 0; /* not used, keep memory checkers happy */
- edge1.dy = -1;
- edge2.x = 0; /* not used, keep memory checkers happy */
- edge2.dy = -1;
- edgeleft1 = FALSE;
- edgeleft2 = FALSE;
-
- if ((pGC->lineWidth > 2) &&
- ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
- (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt))) {
- if (isInt) {
- xorg = (double) xorgi;
- yorg = (double) yorgi;
- }
-
- if (leftFace && rightFace)
- miRoundJoinClip (leftFace, rightFace, &edge1, &edge2,
- &edgey1, &edgey2, &edgeleft1, &edgeleft2);
- else if (leftFace)
- edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1);
- else if (rightFace)
- edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2);
-
- isInt = FALSE;
- }
-
- if (isInt) {
- if(pGC->lineWidth == 1) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
- DRAW_POINT(infoRec->pScrn, xorgi, yorgi);
- } else
- XAALineArcI(pGC, xorgi, yorgi);
- } else
- XAALineArcD(pGC, xorg, yorg, &edge1, edgey1, edgeleft1,
- &edge2, edgey2, edgeleft2);
-
-}
-
-
-static void
-XAALineJoin (
- GCPtr pGC,
- LineFacePtr pLeft,
- LineFacePtr pRight )
-{
- double mx = 0, my = 0;
- double denom = 0;
- PolyVertexRec vertices[4];
- PolySlopeRec slopes[4];
- int edgecount;
- PolyEdgeRec left[4], right[4];
- int nleft, nright;
- int y, height;
- int swapslopes;
- int joinStyle = pGC->joinStyle;
- int lw = pGC->lineWidth;
-
- if (lw == 1) {
- /* Lines going in the same direction have no join */
- if ((pLeft->dx >= 0) == (pRight->dx <= 0))
- return;
- if (joinStyle != JoinRound) {
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx *
- (double)pLeft->dy;
- if (denom == 0.0)
- return; /* no join to draw */
- }
- if (joinStyle != JoinMiter) {
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
- DRAW_POINT(infoRec->pScrn, pLeft->x, pLeft->y);
- return;
- }
- } else {
- if (joinStyle == JoinRound) {
- XAALineArc(pGC, pLeft, pRight,(double)0.0, (double)0.0, TRUE);
- return;
- }
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx *
- (double)pLeft->dy;
- if (denom == 0.0)
- return; /* no join to draw */
- }
-
- swapslopes = 0;
- if (denom > 0) {
- pLeft->xa = -pLeft->xa;
- pLeft->ya = -pLeft->ya;
- pLeft->dx = -pLeft->dx;
- pLeft->dy = -pLeft->dy;
- } else {
- swapslopes = 1;
- pRight->xa = -pRight->xa;
- pRight->ya = -pRight->ya;
- pRight->dx = -pRight->dx;
- pRight->dy = -pRight->dy;
- }
-
- vertices[0].x = pRight->xa;
- vertices[0].y = pRight->ya;
- slopes[0].dx = -pRight->dy;
- slopes[0].dy = pRight->dx;
- slopes[0].k = 0;
-
- vertices[1].x = 0;
- vertices[1].y = 0;
- slopes[1].dx = pLeft->dy;
- slopes[1].dy = -pLeft->dx;
- slopes[1].k = 0;
-
- vertices[2].x = pLeft->xa;
- vertices[2].y = pLeft->ya;
-
- if (joinStyle == JoinMiter) {
- my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
- pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx ))/
- denom;
- if (pLeft->dy != 0)
- mx = pLeft->xa + (my - pLeft->ya) *
- (double) pLeft->dx / (double) pLeft->dy;
- else
- mx = pRight->xa + (my - pRight->ya) *
- (double) pRight->dx / (double) pRight->dy;
-
- /* check miter limit */
- if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
- joinStyle = JoinBevel;
- }
-
- if (joinStyle == JoinMiter) {
- slopes[2].dx = pLeft->dx;
- slopes[2].dy = pLeft->dy;
- slopes[2].k = pLeft->k;
- if (swapslopes) {
- slopes[2].dx = -slopes[2].dx;
- slopes[2].dy = -slopes[2].dy;
- slopes[2].k = -slopes[2].k;
- }
- vertices[3].x = mx;
- vertices[3].y = my;
- slopes[3].dx = pRight->dx;
- slopes[3].dy = pRight->dy;
- slopes[3].k = pRight->k;
- if (swapslopes) {
- slopes[3].dx = -slopes[3].dx;
- slopes[3].dy = -slopes[3].dy;
- slopes[3].k = -slopes[3].k;
- }
- edgecount = 4;
- } else {
- double scale, dx, dy, adx, ady;
-
- adx = dx = pRight->xa - pLeft->xa;
- ady = dy = pRight->ya - pLeft->ya;
- if (adx < 0)
- adx = -adx;
- if (ady < 0)
- ady = -ady;
- scale = ady;
- if (adx > ady)
- scale = adx;
- slopes[2].dx = (dx * 65536) / scale;
- slopes[2].dy = (dy * 65536) / scale;
- slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
- (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
- edgecount = 3;
- }
-
- y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y,
- left, right, &nleft, &nright, &height);
- XAAFillPolyHelper(pGC, y, height, left, right, nleft, nright);
-}
-
-
-void
-XAAPolylinesWideSolid (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts )
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- int x1, y1, x2, y2;
- Bool projectLeft, projectRight;
- LineFaceRec leftFace, rightFace, prevRightFace, firstFace;
- int first = TRUE;
- Bool somethingDrawn = FALSE;
- Bool selfJoin = FALSE;
- int xorg = pDrawable->x;
- int yorg = pDrawable->y;
- Bool hardClip = FALSE;
-
- if(!REGION_NUM_RECTS(pGC->pCompositeClip))
- return;
-
- if(REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miWideLine(pDrawable, pGC, mode, npt, pPts);
- return;
- }
-
- if (mode == CoordModePrevious) {
- pPts->x += xorg;
- pPts->y += yorg;
- } else if(xorg | yorg) {
- register int n = npt;
- register DDXPointPtr pts = pPts;
-
- while(n--) {
- pts->x += xorg;
- pts->y += yorg;
- pts++;
- }
- }
-
- x2 = pPts->x;
- y2 = pPts->y;
- if (npt > 1) {
- if (mode == CoordModePrevious) {
- int nptTmp;
- register DDXPointPtr pPtsTmp;
-
- x1 = x2;
- y1 = y2;
- nptTmp = npt;
- pPtsTmp = pPts + 1;
- while (--nptTmp) {
- x1 += pPtsTmp->x;
- y1 += pPtsTmp->y;
- ++pPtsTmp;
- }
- if ((x2 == x1) && (y2 == y1))
- selfJoin = TRUE;
- } else if ((x2 == pPts[npt-1].x) && (y2 == pPts[npt-1].y))
- selfJoin = TRUE;
- }
-
- projectLeft = ((pGC->capStyle == CapProjecting) && !selfJoin);
- projectRight = FALSE;
-
- (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
- pGC->planemask);
-
- infoRec->ClipBox = &pGC->pCompositeClip->extents;
-
- if(infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL) {
- hardClip = TRUE;
- (*infoRec->SetClippingRectangle)(infoRec->pScrn,
- infoRec->ClipBox->x1, infoRec->ClipBox->y1,
- infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
- }
-
- while (--npt) {
- x1 = x2;
- y1 = y2;
- ++pPts;
- x2 = pPts->x;
- y2 = pPts->y;
- if (mode == CoordModePrevious) {
- x2 += x1;
- y2 += y1;
- }
- if ((x1 != x2) || (y1 != y2)) {
- somethingDrawn = TRUE;
- if ((npt == 1) && (pGC->capStyle == CapProjecting) && !selfJoin)
- projectRight = TRUE;
- XAAWideSegment(pGC, x1, y1, x2, y2,
- projectLeft, projectRight, &leftFace, &rightFace);
- if (first) {
- if (selfJoin)
- firstFace = leftFace;
- else if (pGC->capStyle == CapRound) {
- if (pGC->lineWidth == 1) {
- DRAW_POINT(infoRec->pScrn, x1, y1);
- } else
- XAALineArc(pGC,&leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0,TRUE);
- }
- } else
- XAALineJoin (pGC, &leftFace, &prevRightFace);
-
- prevRightFace = rightFace;
- first = FALSE;
- projectLeft = FALSE;
- }
- if (npt == 1 && somethingDrawn) {
- if (selfJoin)
- XAALineJoin (pGC, &firstFace, &rightFace);
- else if (pGC->capStyle == CapRound) {
- if (pGC->lineWidth == 1) {
- DRAW_POINT(infoRec->pScrn, x2, y2);
- } else
- XAALineArc (pGC, (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0,TRUE);
- }
- }
- }
- /* handle crock where all points are coincedent */
- if (!somethingDrawn) {
- projectLeft = (pGC->capStyle == CapProjecting);
- XAAWideSegment (pGC, x2, y2, x2, y2, projectLeft, projectLeft,
- &leftFace, &rightFace);
- if (pGC->capStyle == CapRound) {
- XAALineArc (pGC, &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0, TRUE);
- rightFace.dx = -1; /* sleezy hack to make it work */
- XAALineArc (pGC, (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0, TRUE);
- }
- }
-
- infoRec->ClipBox = NULL;
- if(hardClip)
- (*infoRec->DisableClipping)(infoRec->pScrn);
-
- SET_SYNC_FLAG(infoRec);
-}
diff --git a/hw/xfree86/xaa/xaacexp.h b/hw/xfree86/xaa/xaacexp.h
deleted file mode 100644
index 276f01672..000000000
--- a/hw/xfree86/xaa/xaacexp.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaacexp.h,v 1.5 2000/06/13 02:51:25 mvojkovi Exp $ */
-
-
-#include "Xarch.h"
-
-#ifndef FIXEDBASE
-#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base + (b))
-#else
-#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base)
-#endif
-
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-# define SHIFT_L(value, shift) ((value) >> (shift))
-# define SHIFT_R(value, shift) ((value) << (shift))
-#else
-# define SHIFT_L(value, shift) ((value) << (shift))
-# define SHIFT_R(value, shift) ((value) >> (shift))
-#endif
-
-#ifndef MSBFIRST
-# ifdef FIXEDBASE
-# define WRITE_IN_BITORDER(dest, offset, data) *(dest) = data;
-# else
-# define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = data;
-# endif
-#else
-# ifdef FIXEDBASE
-# define WRITE_IN_BITORDER(dest, offset, data) *(dest) = SWAP_BITS_IN_BYTES(data);
-# else
-# define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = SWAP_BITS_IN_BYTES(data)
-# endif
-#endif
-
-#ifdef FIXEDBASE
-# ifdef MSBFIRST
-# define WRITE_BITS(b) *base = SWAP_BITS_IN_BYTES(b)
-# define WRITE_BITS1(b) { \
- *base = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
-# define WRITE_BITS2(b) { \
- *base = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
- *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; }
-# define WRITE_BITS3(b) { \
- *base = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
- *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
- *base = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
- byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; }
-# else
-# define WRITE_BITS(b) *base = (b)
-# define WRITE_BITS1(b) { \
- *base = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; }
-# define WRITE_BITS2(b) { \
- *base = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; \
- *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_expand3[((b) & 0xFF0000) >> 16] << 16; }
-# define WRITE_BITS3(b) { \
- *base = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; \
- *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
- *base = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
- byte_expand3[((b) & 0xFF000000) >> 24] << 8; }
-# endif
-#else
-# ifdef MSBFIRST
-# define WRITE_BITS(b) *(base++) = SWAP_BITS_IN_BYTES(b)
-# define WRITE_BITS1(b) { \
- *(base++) = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
-# define WRITE_BITS2(b) { \
- *(base) = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
- *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
- base += 2; }
-# define WRITE_BITS3(b) { \
- *(base) = byte_reversed_expand3[(b) & 0xFF] | \
- byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
- *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
- *(base + 2) = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
- byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; \
- base += 3; }
-# else
-# define WRITE_BITS(b) *(base++) = (b)
-# define WRITE_BITS1(b) { \
- *(base++) = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; }
-# define WRITE_BITS2(b) { \
- *(base) = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; \
- *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
- base += 2; }
-# define WRITE_BITS3(b) { \
- *(base) = byte_expand3[(b) & 0xFF] | \
- byte_expand3[((b) & 0xFF00) >> 8] << 24; \
- *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
- byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
- *(base + 2) = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
- byte_expand3[((b) & 0xFF000000) >> 24] << 8; \
- base += 3; }
-# endif
-#endif
-
-#ifdef FIXEDBASE
-# ifdef MSBFIRST
-# define EXPNAME(x) x##MSBFirstFixedBase
-# else
-# define EXPNAME(x) x##LSBFirstFixedBase
-# endif
-#else
-# ifdef MSBFIRST
-# define EXPNAME(x) x##MSBFirst
-# else
-# define EXPNAME(x) x##LSBFirst
-# endif
-#endif
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
deleted file mode 100644
index 4504deffd..000000000
--- a/hw/xfree86/xaa/xaalocal.h
+++ /dev/null
@@ -1,1756 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.37 2003/11/10 18:22:41 tsi Exp $ */
-
-#ifndef _XAALOCAL_H
-#define _XAALOCAL_H
-
-/* This file is very unorganized ! */
-
-
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "xf86fbman.h"
-#include "xaa.h"
-#include "mi.h"
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-#define GCWhenForced (GCArcMode << 1)
-
-#define DO_COLOR_8x8 0x00000001
-#define DO_MONO_8x8 0x00000002
-#define DO_CACHE_BLT 0x00000003
-#define DO_COLOR_EXPAND 0x00000004
-#define DO_CACHE_EXPAND 0x00000005
-#define DO_IMAGE_WRITE 0x00000006
-#define DO_PIXMAP_COPY 0x00000007
-#define DO_SOLID 0x00000008
-
-
-typedef CARD32 * (*GlyphScanlineFuncPtr)(
- CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
-);
-
-typedef CARD32 *(*StippleScanlineProcPtr)(CARD32*, CARD32*, int, int, int);
-
-typedef void (*RectFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
- XAACacheInfoPtr);
-typedef void (*TrapFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
- int, int, int, int, int, int,
- XAACacheInfoPtr);
-
-
-
-typedef struct _XAAScreen {
- CreateGCProcPtr CreateGC;
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- WindowExposuresProcPtr WindowExposures;
- BSFuncRec BackingStoreFuncs;
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- XAAInfoRecPtr AccelInfoRec;
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- int (*SetDGAMode)(int, int, DGADevicePtr);
- void (*EnableDisableFBAccess)(int, Bool);
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
-} XAAScreenRec, *XAAScreenPtr;
-
-#define OPS_ARE_PIXMAP 0x00000001
-#define OPS_ARE_ACCEL 0x00000002
-
-typedef struct _XAAGC {
- GCOps *wrapOps;
- GCFuncs *wrapFuncs;
- GCOps *XAAOps;
- int DashLength;
- unsigned char* DashPattern;
- unsigned long changes;
- unsigned long flags;
-} XAAGCRec, *XAAGCPtr;
-
-#define REDUCIBILITY_CHECKED 0x00000001
-#define REDUCIBLE_TO_8x8 0x00000002
-#define REDUCIBLE_TO_2_COLOR 0x00000004
-#define DIRTY 0x00010000
-#define OFFSCREEN 0x00020000
-#define DGA_PIXMAP 0x00040000
-#define SHARED_PIXMAP 0x00080000
-#define LOCKED_PIXMAP 0x00100000
-
-#define REDUCIBILITY_MASK \
- (REDUCIBILITY_CHECKED | REDUCIBLE_TO_8x8 | REDUCIBLE_TO_2_COLOR)
-
-typedef struct _XAAPixmap {
- unsigned long flags;
- CARD32 pattern0;
- CARD32 pattern1;
- int fg;
- int bg;
- FBAreaPtr offscreenArea;
- Bool freeData;
-} XAAPixmapRec, *XAAPixmapPtr;
-
-
-Bool
-XAACreateGC(
- GCPtr pGC
-);
-
-Bool
-XAAInitAccel(
- ScreenPtr pScreen,
- XAAInfoRecPtr infoRec
-);
-
-RegionPtr
-XAABitBlt(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty,
- void (*doBitBlt)(DrawablePtr, DrawablePtr, GCPtr, RegionPtr, DDXPointPtr),
- unsigned long bitPlane
-);
-
-void
-XAAScreenToScreenBitBlt(
- ScrnInfoPtr pScrn,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir,
- int ydir,
- int alu,
- unsigned int planemask
-);
-
-void
-XAADoBitBlt(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc
-);
-
-void
-XAADoImageWrite(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc
-);
-
-void
-XAADoImageRead(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc
-);
-
-void
-XAACopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-);
-
-
-RegionPtr
-XAACopyArea(
- DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GC *pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty
-);
-
-void
-XAAValidateCopyArea(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidatePutImage(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidateCopyPlane(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidatePushPixels(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidateFillSpans(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidatePolyGlyphBlt(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidateImageGlyphBlt(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-void
-XAAValidatePolylines(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-);
-
-
-RegionPtr
-XAACopyPlaneColorExpansion(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty,
- unsigned long bitPlane
-);
-
-
-void
-XAAPushPixelsSolidColorExpansion(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDrawable,
- int dx,
- int dy,
- int xOrg,
- int yOrg
-);
-
-void
-XAAWriteBitmapColorExpandMSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpand3MSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpandMSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpand3MSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpandLSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpand3LSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpandLSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapColorExpand3LSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-
-void
-XAAWriteBitmapScanlineColorExpandMSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpand3MSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpandMSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpand3MSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpandLSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpand3LSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpandLSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWriteBitmapScanlineColorExpand3LSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int skipleft,
- int fg, int bg,
- int rop,
- unsigned int planemask
-);
-
-void
-XAAWritePixmap (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
-);
-
-void
-XAAWritePixmapScanline (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int rop,
- unsigned int planemask,
- int transparency_color,
- int bpp, int depth
-);
-
-typedef void (*ClipAndRenderRectsFunc)(GCPtr, int, BoxPtr, int, int);
-
-
-void
-XAAClipAndRenderRects(
- GCPtr pGC,
- ClipAndRenderRectsFunc func,
- int nrectFill,
- xRectangle *prectInit,
- int xorg, int yorg
-);
-
-
-typedef void (*ClipAndRenderSpansFunc)(GCPtr, int, DDXPointPtr, int*,
- int, int, int);
-
-void
-XAAClipAndRenderSpans(
- GCPtr pGC,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted,
- ClipAndRenderSpansFunc func,
- int xorg,
- int yorg
-);
-
-
-void
-XAAFillSolidRects(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox
-);
-
-void
-XAAFillMono8x8PatternRects(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int pat0, int pat1,
- int xorg, int yorg
-);
-
-void
-XAAFillMono8x8PatternRectsScreenOrigin(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int pat0, int pat1,
- int xorg, int yorg
-);
-
-
-void
-XAAFillColor8x8PatternRectsScreenOrigin(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorigin, int yorigin,
- XAACacheInfoPtr pCache
-);
-
-void
-XAAFillColor8x8PatternRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorigin, int yorigin,
- XAACacheInfoPtr pCache
-);
-
-void
-XAAFillCacheBltRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- XAACacheInfoPtr pCache
-);
-
-void
-XAAFillCacheExpandRects(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillImageWriteRects(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-);
-
-
-void
-XAATEGlyphRendererMSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRenderer3MSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererMSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRenderer3MSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererLSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-
-void
-XAATEGlyphRenderer3LSBFirstFixedBase (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererLSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRenderer3LSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-
-void
-XAATEGlyphRendererScanlineMSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererScanline3MSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererScanlineLSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-void
-XAATEGlyphRendererScanline3LSBFirst (
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h, int skipleft, int startline,
- unsigned int **glyphs, int glyphWidth,
- int fg, int bg, int rop, unsigned planemask
-);
-
-
-extern CARD32 *(*XAAGlyphScanlineFuncMSBFirstFixedBase[32])(
- CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
-);
-
-extern CARD32 *(*XAAGlyphScanlineFuncMSBFirst[32])(
- CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
-);
-
-extern CARD32 *(*XAAGlyphScanlineFuncLSBFirstFixedBase[32])(
- CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
-);
-
-extern CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32])(
- CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
-);
-
-void
-XAAFillColorExpandRectsLSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRects3LSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRectsLSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRects3LSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRectsMSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRects3MSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRectsMSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandRects3MSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandRectsLSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandRects3LSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandRectsMSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandRects3MSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int nBox,
- BoxPtr pBox,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpansLSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpans3LSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpansLSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpans3LSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpansMSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpans3MSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpansMSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillColorExpandSpans3MSBFirstFixedBase(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandSpansLSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandSpans3LSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage
-);
-
-void
-XAAFillScanlineColorExpandSpansMSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillScanlineColorExpandSpans3MSBFirst(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-
-extern CARD32 *(*XAAStippleScanlineFuncMSBFirstFixedBase[6])(
- CARD32* base, CARD32* src, int offset, int width, int dwords
-);
-
-extern CARD32 *(*XAAStippleScanlineFuncMSBFirst[6])(
- CARD32* base, CARD32* src, int offset, int width, int dwords
-);
-
-extern CARD32 *(*XAAStippleScanlineFuncLSBFirstFixedBase[6])(
- CARD32* base, CARD32* src, int offset, int width, int dwords
-);
-
-extern CARD32 *(*XAAStippleScanlineFuncLSBFirst[6])(
- CARD32* base, CARD32* src, int offset, int width, int dwords
-);
-
-int
-XAAPolyText8TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-);
-
-int
-XAAPolyText16TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-);
-
-void
-XAAImageText8TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-);
-
-void
-XAAImageText16TEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-);
-
-void
-XAAImageGlyphBltTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-void
-XAAPolyGlyphBltTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-
-int
-XAAPolyText8NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-);
-
-int
-XAAPolyText16NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-);
-
-void
-XAAImageText8NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- char *chars
-);
-
-void
-XAAImageText16NonTEColorExpansion(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- int count,
- unsigned short *chars
-);
-
-void
-XAAImageGlyphBltNonTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-void
-XAAPolyGlyphBltNonTEColorExpansion(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-
-void XAANonTEGlyphRenderer(
- ScrnInfoPtr pScrn,
- int x, int y, int n,
- NonTEGlyphPtr glyphs,
- BoxPtr pbox,
- int fg, int rop,
- unsigned int planemask
-);
-
-void
-XAAFillSolidSpans(
- ScrnInfoPtr pScrn,
- int fg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted
-);
-
-void
-XAAFillMono8x8PatternSpans(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- int patx, int paty,
- int xorg, int yorg
-);
-
-void
-XAAFillMono8x8PatternSpansScreenOrigin(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- int patx, int paty,
- int xorg, int yorg
-);
-
-void
-XAAFillColor8x8PatternSpansScreenOrigin(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- XAACacheInfoPtr,
- int xorigin, int yorigin
-);
-
-void
-XAAFillColor8x8PatternSpans(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth, int fSorted,
- XAACacheInfoPtr,
- int xorigin, int yorigin
-);
-
-void
-XAAFillCacheBltSpans(
- ScrnInfoPtr pScrn,
- int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr points,
- int *widths,
- int fSorted,
- XAACacheInfoPtr pCache,
- int xorg, int yorg
-);
-
-void
-XAAFillCacheExpandSpans(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted,
- int xorg, int yorg,
- PixmapPtr pPix
-);
-
-void
-XAAFillSpans(
- DrawablePtr pDrawable,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidth,
- int fSorted
-);
-
-
-void
-XAAInitPixmapCache(
- ScreenPtr pScreen,
- RegionPtr areas,
- pointer data
-);
-
-void
-XAAWriteBitmapToCache(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int fg, int bg
-);
-
-void
-XAAWriteBitmapToCacheLinear(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int fg, int bg
-);
-
-void
-XAAWritePixmapToCache(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int bpp, int depth
-);
-
-void
-XAAWritePixmapToCacheLinear(
- ScrnInfoPtr pScrn,
- int x, int y, int w, int h,
- unsigned char *src,
- int srcwidth,
- int bpp, int depth
-);
-
-
-void
-XAAPaintWindow(
- WindowPtr pWin,
- RegionPtr prgn,
- int what
-);
-
-void
-XAASolidHorVertLineAsRects(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-);
-
-void
-XAASolidHorVertLineAsTwoPoint(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-);
-
-void
-XAASolidHorVertLineAsBresenham(
- ScrnInfoPtr pScrn,
- int x, int y, int len, int dir
-);
-
-
-void
-XAAPolyRectangleThinSolid(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-);
-
-
-void
-XAAPolylinesWideSolid (
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pPts
-);
-
-void
-XAAFillPolygonSolid(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-);
-
-void
-XAAFillPolygonStippled(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-);
-
-
-void
-XAAFillPolygonTiled(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-);
-
-
-int
-XAAIsEasyPolygon(
- DDXPointPtr ptsIn,
- int count,
- BoxPtr extents,
- int origin,
- DDXPointPtr *topPoint,
- int *topY, int *bottomY,
- int shape
-);
-
-void
-XAAFillPolygonHelper(
- ScrnInfoPtr pScrn,
- DDXPointPtr ptsIn,
- int count,
- DDXPointPtr topPoint,
- int y,
- int maxy,
- int origin,
- RectFuncPtr RectFunc,
- TrapFuncPtr TrapFunc,
- int xorg,
- int yorg,
- XAACacheInfoPtr pCache
-);
-
-void
-XAAPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-);
-
-void
-XAAPolyLines(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-);
-
-void
-XAAPolySegmentDashed(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-);
-
-void
-XAAPolyLinesDashed(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-);
-
-
-void
-XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache);
-
-void
-XAAWriteColor8x8PatternToCache(
- ScrnInfoPtr pScrn,
- PixmapPtr pPix,
- XAACacheInfoPtr pCache
-);
-
-void
-XAARotateMonoPattern(
- int *pat0, int *pat1,
- int xoffset, int yoffset,
- Bool msbfirst
-);
-
-void XAAComputeDash(GCPtr pGC);
-
-void XAAMoveDWORDS_FixedBase(
- register CARD32* dest,
- register CARD32* src,
- register int dwords
-);
-
-void XAAMoveDWORDS_FixedSrc(
- register CARD32* dest,
- register CARD32* src,
- register int dwords
-);
-
-void XAAMoveDWORDS(
- register CARD32* dest,
- register CARD32* src,
- register int dwords
-);
-
-int
-XAAGetRectClipBoxes(
- GCPtr pGC,
- BoxPtr pboxClippedBase,
- int nrectFill,
- xRectangle *prectInit
-);
-
-void
-XAASetupOverlay8_32Planar(ScreenPtr);
-
-void
-XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs);
-
-XAACacheInfoPtr
-XAACacheTile(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-XAACacheInfoPtr
-XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-XAACacheInfoPtr
-XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
-
-XAACacheInfoPtr
-XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
-
-XAACacheInfoPtr
-XAACacheMono8x8Pattern(ScrnInfoPtr Scrn, int pat0, int pat1);
-
-XAACacheInfoPtr
-XAACacheColor8x8Pattern(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
-
-void
-XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h);
-
-void XAAClosePixmapCache(ScreenPtr pScreen);
-void XAAInvalidatePixmapCache(ScreenPtr pScreen);
-
-Bool XAACheckStippleReducibility(PixmapPtr pPixmap);
-Bool XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono);
-
-int XAAStippledFillChooser(GCPtr pGC);
-int XAAOpaqueStippledFillChooser(GCPtr pGC);
-int XAATiledFillChooser(GCPtr pGC);
-
-void XAAMoveInOffscreenPixmaps(ScreenPtr pScreen);
-void XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen);
-void XAARemoveAreaCallback(FBAreaPtr area);
-void XAAMoveOutOffscreenPixmap(PixmapPtr pPix);
-Bool XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec);
-
-#ifdef RENDER
-void
-XAAComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-
-Bool
-XAADoComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-
-void
-XAAGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-
-Bool
-XAADoGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-
-
-
-/* helpers */
-void
-XAA_888_plus_PICT_a8_to_8888 (
- CARD32 color,
- CARD8 *alphaPtr, /* in bytes */
- int alphaPitch,
- CARD32 *dstPtr,
- int dstPitch, /* in dwords */
- int width,
- int height
-);
-
-Bool
-XAAGetRGBAFromPixel(
- CARD32 pixel,
- CARD16 *red,
- CARD16 *green,
- CARD16 *blue,
- CARD16 *alpha,
- CARD32 format
-);
-
-
-Bool
-XAAGetPixelFromRGBA (
- CARD32 *pixel,
- CARD16 red,
- CARD16 green,
- CARD16 blue,
- CARD16 alpha,
- CARD32 format
-);
-
-#endif
-
-
-extern GCOps XAAFallbackOps;
-extern GCFuncs XAAGCFuncs;
-extern int XAAScreenIndex;
-extern int XAAGCIndex;
-extern int XAAPixmapIndex;
-
-extern unsigned int XAAShiftMasks[32];
-
-extern unsigned int byte_expand3[256], byte_reversed_expand3[256];
-
-CARD32 XAAReverseBitOrder(CARD32 data);
-
-#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\
- (pScreen)->devPrivates[XAAScreenIndex].ptr
-
-#define GET_XAASCREENPTR_FROM_GC(pGC)\
- (pGC)->pScreen->devPrivates[XAAScreenIndex].ptr
-
-#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\
- (pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr
-
-#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\
- ((XAAScreenPtr)((pScreen)->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_GC(pGC)\
-((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\
-((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
-
-#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\
-((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
-
-#define XAA_GET_PIXMAP_PRIVATE(pix)\
- (XAAPixmapPtr)((pix)->devPrivates[XAAPixmapIndex].ptr)
-
-#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
-
-#define CHECK_FG(pGC, flags) \
- (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->fgPixel))
-
-#define CHECK_BG(pGC, flags) \
- (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->bgPixel))
-
-#define CHECK_ROP(pGC, flags) \
- (!(flags & GXCOPY_ONLY) || (pGC->alu == GXcopy))
-
-#define CHECK_ROPSRC(pGC, flags) \
- (!(flags & ROP_NEEDS_SOURCE) || ((pGC->alu != GXclear) && \
- (pGC->alu != GXnoop) && (pGC->alu != GXinvert) && \
- (pGC->alu != GXset)))
-
-#define CHECK_PLANEMASK(pGC, flags) \
- (!(flags & NO_PLANEMASK) || \
- ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == \
- infoRec->FullPlanemasks[pGC->depth - 1]))
-
-#define CHECK_COLORS(pGC, flags) \
- (!(flags & RGB_EQUAL) || \
- (CHECK_RGB_EQUAL(pGC->fgPixel) && CHECK_RGB_EQUAL(pGC->bgPixel)))
-
-#define CHECK_NO_GXCOPY(pGC, flags) \
- ((pGC->alu != GXcopy) || !(flags & NO_GXCOPY) || \
- ((pGC->planemask & infoRec->FullPlanemask) != infoRec->FullPlanemask))
-
-#define IS_OFFSCREEN_PIXMAP(pPix)\
- ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->offscreenArea)
-
-#define PIXMAP_IS_SHARED(pPix)\
- ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & SHARED_PIXMAP)
-
-#define OFFSCREEN_PIXMAP_LOCKED(pPix)\
- ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & LOCKED_PIXMAP)
-
-#define XAA_DEPTH_BUG(pGC) \
- ((pGC->depth == 32) && (pGC->bgPixel == 0xffffffff))
-
-#define DELIST_OFFSCREEN_PIXMAP(pPix) { \
- PixmapLinkPtr _pLink, _prev; \
- _pLink = infoRec->OffscreenPixmaps; \
- _prev = NULL; \
- while(_pLink) { \
- if(_pLink->pPix == pPix) { \
- if(_prev) _prev->next = _pLink->next; \
- else infoRec->OffscreenPixmaps = _pLink->next; \
- xfree(_pLink); \
- break; \
- } \
- _prev = _pLink; \
- _pLink = _pLink->next; \
- }}
-
-
-#define SWAP_BITS_IN_BYTES(v) \
- (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \
- ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \
- ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \
- ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7))
-
-/*
- * Moved XAAPixmapCachePrivate here from xaaPCache.c, since driver
- * replacements for CacheMonoStipple need access to it
- */
-
-typedef struct {
- int Num512x512;
- int Current512;
- XAACacheInfoPtr Info512;
- int Num256x256;
- int Current256;
- XAACacheInfoPtr Info256;
- int Num128x128;
- int Current128;
- XAACacheInfoPtr Info128;
- int NumMono;
- int CurrentMono;
- XAACacheInfoPtr InfoMono;
- int NumColor;
- int CurrentColor;
- XAACacheInfoPtr InfoColor;
- int NumPartial;
- int CurrentPartial;
- XAACacheInfoPtr InfoPartial;
- DDXPointRec MonoOffsets[64];
- DDXPointRec ColorOffsets[64];
-} XAAPixmapCachePrivate, *XAAPixmapCachePrivatePtr;
-
-
-#endif /* _XAALOCAL_H */
diff --git a/hw/xfree86/xaa/xaarop.h b/hw/xfree86/xaa/xaarop.h
deleted file mode 100644
index 8fee07533..000000000
--- a/hw/xfree86/xaa/xaarop.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaarop.h,v 1.1 1999/03/21 07:35:31 dawes Exp $ */
-
-/*
-
- int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
-
- For use with solid fills emulated by solid 8x8 patterns. You
- give it the foreground, planemask and X rop and it will replace
- the foreground with a new one and the rop with the appropriate
- MS triadic raster op. The function will return which components
- (S-P) need to be enabled.
-
-
- int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
-
- For use with 8x8 opaque pattern fills. You give it the foreground,
- and background, planemask and X rop and it will replace the
- foreground and background with new ones and the rop with the
- appropriate MS triadic raster op. The function will return which
- components (S-P) need to be enabled.
-
-
- ROP_PAT - Means to enable 8x8 mono patterns (all bits
- set for solid patterns). Set the foreground and
- background as returned by the function.
-
- ROP_SRC - Means a source of color == planemask should be used.
-
-
-*/
-
-#ifndef _XAAROP_H
-#define _XAAROP_H
-
-#define ROP_DST 0x00000001
-#define ROP_SRC 0x00000002
-#define ROP_PAT 0x00000004
-
-#define ROP_0 0x00
-#define ROP_DPSoon 0x01
-#define ROP_DPSona 0x02
-#define ROP_PSon 0x03
-#define ROP_SDPona 0x04
-#define ROP_DPon 0x05
-#define ROP_PDSxnon 0x06
-#define ROP_PDSaon 0x07
-#define ROP_SDPnaa 0x08
-#define ROP_PDSxon 0x09
-#define ROP_DPna 0x0A
-#define ROP_PSDnaon 0x0B
-#define ROP_SPna 0x0C
-#define ROP_PDSnaon 0x0D
-#define ROP_PDSonon 0x0E
-#define ROP_Pn 0x0F
-#define ROP_PDSona 0x10
-#define ROP_DSon 0x11
-#define ROP_SDPxnon 0x12
-#define ROP_SDPaon 0x13
-#define ROP_DPSxnon 0x14
-#define ROP_DPSaon 0x15
-#define ROP_PSDPSanaxx 0x16
-#define ROP_SSPxDSxaxn 0x17
-#define ROP_SPxPDxa 0x18
-#define ROP_SDPSanaxn 0x19
-#define ROP_PDSPaox 0x1A
-#define ROP_SDPSxaxn 0x1B
-#define ROP_PSDPaox 0x1C
-#define ROP_DSPDxaxn 0x1D
-#define ROP_PDSox 0x1E
-#define ROP_PDSoan 0x1F
-#define ROP_DPSnaa 0x20
-#define ROP_SDPxon 0x21
-#define ROP_DSna 0x22
-#define ROP_SPDnaon 0x23
-#define ROP_SPxDSxa 0x24
-#define ROP_PDSPanaxn 0x25
-#define ROP_SDPSaox 0x26
-#define ROP_SDPSxnox 0x27
-#define ROP_DPSxa 0x28
-#define ROP_PSDPSaoxxn 0x29
-#define ROP_DPSana 0x2A
-#define ROP_SSPxPDxaxn 0x2B
-#define ROP_SPDSoax 0x2C
-#define ROP_PSDnox 0x2D
-#define ROP_PSDPxox 0x2E
-#define ROP_PSDnoan 0x2F
-#define ROP_PSna 0x30
-#define ROP_SDPnaon 0x31
-#define ROP_SDPSoox 0x32
-#define ROP_Sn 0x33
-#define ROP_SPDSaox 0x34
-#define ROP_SPDSxnox 0x35
-#define ROP_SDPox 0x36
-#define ROP_SDPoan 0x37
-#define ROP_PSDPoax 0x38
-#define ROP_SPDnox 0x39
-#define ROP_SPDSxox 0x3A
-#define ROP_SPDnoan 0x3B
-#define ROP_PSx 0x3C
-#define ROP_SPDSonox 0x3D
-#define ROP_SPDSnaox 0x3E
-#define ROP_PSan 0x3F
-#define ROP_PSDnaa 0x40
-#define ROP_DPSxon 0x41
-#define ROP_SDxPDxa 0x42
-#define ROP_SPDSanaxn 0x43
-#define ROP_SDna 0x44
-#define ROP_DPSnaon 0x45
-#define ROP_DSPDaox 0x46
-#define ROP_PSDPxaxn 0x47
-#define ROP_SDPxa 0x48
-#define ROP_PDSPDaoxxn 0x49
-#define ROP_DPSDoax 0x4A
-#define ROP_PDSnox 0x4B
-#define ROP_SDPana 0x4C
-#define ROP_SSPxDSxoxn 0x4D
-#define ROP_PDSPxox 0x4E
-#define ROP_PDSnoan 0x4F
-#define ROP_PDna 0x50
-#define ROP_DSPnaon 0x51
-#define ROP_DPSDaox 0x52
-#define ROP_SPDSxaxn 0x53
-#define ROP_DPSonon 0x54
-#define ROP_Dn 0x55
-#define ROP_DPSox 0x56
-#define ROP_DPSoan 0x57
-#define ROP_PDSPoax 0x58
-#define ROP_DPSnox 0x59
-#define ROP_DPx 0x5A
-#define ROP_DPSDonox 0x5B
-#define ROP_DPSDxox 0x5C
-#define ROP_DPSnoan 0x5D
-#define ROP_DPSDnaox 0x5E
-#define ROP_DPan 0x5F
-#define ROP_PDSxa 0x60
-#define ROP_DSPDSaoxxn 0x61
-#define ROP_DSPDoax 0x62
-#define ROP_SDPnox 0x63
-#define ROP_SDPSoax 0x64
-#define ROP_DSPnox 0x65
-#define ROP_DSx 0x66
-#define ROP_SDPSonox 0x67
-#define ROP_DSPDSonoxxn 0x68
-#define ROP_PDSxxn 0x69
-#define ROP_DPSax 0x6A
-#define ROP_PSDPSoaxxn 0x6B
-#define ROP_SDPax 0x6C
-#define ROP_PDSPDoaxxn 0x6D
-#define ROP_SDPSnoax 0x6E
-#define ROP_PDSxnan 0x6F
-#define ROP_PDSana 0x70
-#define ROP_SSDxPDxaxn 0x71
-#define ROP_SDPSxox 0x72
-#define ROP_SDPnoan 0x73
-#define ROP_DSPDxox 0x74
-#define ROP_DSPnoan 0x75
-#define ROP_SDPSnaox 0x76
-#define ROP_DSan 0x77
-#define ROP_PDSax 0x78
-#define ROP_DSPDSoaxxn 0x79
-#define ROP_DPSDnoax 0x7A
-#define ROP_SDPxnan 0x7B
-#define ROP_SPDSnoax 0x7C
-#define ROP_DPSxnan 0x7D
-#define ROP_SPxDSxo 0x7E
-#define ROP_DPSaan 0x7F
-#define ROP_DPSaa 0x80
-#define ROP_SPxDSxon 0x81
-#define ROP_DPSxna 0x82
-#define ROP_SPDSnoaxn 0x83
-#define ROP_SDPxna 0x84
-#define ROP_PDSPnoaxn 0x85
-#define ROP_DSPDSoaxx 0x86
-#define ROP_PDSaxn 0x87
-#define ROP_DSa 0x88
-#define ROP_SDPSnaoxn 0x89
-#define ROP_DSPnoa 0x8A
-#define ROP_DSPDxoxn 0x8B
-#define ROP_SDPnoa 0x8C
-#define ROP_SDPSxoxn 0x8D
-#define ROP_SSDxPDxax 0x8E
-#define ROP_PDSanan 0x8F
-#define ROP_PDSxna 0x90
-#define ROP_SDPSnoaxn 0x91
-#define ROP_DPSDPoaxx 0x92
-#define ROP_SPDaxn 0x93
-#define ROP_PSDPSoaxx 0x94
-#define ROP_DPSaxn 0x95
-#define ROP_DPSxx 0x96
-#define ROP_PSDPSonoxx 0x97
-#define ROP_SDPSonoxn 0x98
-#define ROP_DSxn 0x99
-#define ROP_DPSnax 0x9A
-#define ROP_SDPSoaxn 0x9B
-#define ROP_SPDnax 0x9C
-#define ROP_DSPDoaxn 0x9D
-#define ROP_DSPDSaoxx 0x9E
-#define ROP_PDSxan 0x9F
-#define ROP_DPa 0xA0
-#define ROP_PDSPnaoxn 0xA1
-#define ROP_DPSnoa 0xA2
-#define ROP_DPSDxoxn 0xA3
-#define ROP_PDSPonoxn 0xA4
-#define ROP_PDxn 0xA5
-#define ROP_DSPnax 0xA6
-#define ROP_PDSPoaxn 0xA7
-#define ROP_DPSoa 0xA8
-#define ROP_DPSoxn 0xA9
-#define ROP_D 0xAA
-#define ROP_DPSono 0xAB
-#define ROP_SPDSxax 0xAC
-#define ROP_DPSDaoxn 0xAD
-#define ROP_DSPnao 0xAE
-#define ROP_DPno 0xAF
-#define ROP_PDSnoa 0xB0
-#define ROP_PDSPxoxn 0xB1
-#define ROP_SSPxDSxox 0xB2
-#define ROP_SDPanan 0xB3
-#define ROP_PSDnax 0xB4
-#define ROP_DPSDoaxn 0xB5
-#define ROP_DPSDPaoxx 0xB6
-#define ROP_SDPxan 0xB7
-#define ROP_PSDPxax 0xB8
-#define ROP_DSPDaoxn 0xB9
-#define ROP_DPSnao 0xBA
-#define ROP_DSno 0xBB
-#define ROP_SPDSanax 0xBC
-#define ROP_SDxPDxan 0xBD
-#define ROP_DPSxo 0xBE
-#define ROP_DPSano 0xBF
-#define ROP_Psa 0xC0
-#define ROP_SPDSnaoxn 0xC1
-#define ROP_SPDSonoxn 0xC2
-#define ROP_PSxn 0xC3
-#define ROP_SPDnoa 0xC4
-#define ROP_SPDSxoxn 0xC5
-#define ROP_SDPnax 0xC6
-#define ROP_PSDPoaxn 0xC7
-#define ROP_SDPoa 0xC8
-#define ROP_SPDoxn 0xC9
-#define ROP_DPSDxax 0xCA
-#define ROP_SPDSaoxn 0xCB
-#define ROP_S 0xCC
-#define ROP_SDPono 0xCD
-#define ROP_SDPnao 0xCE
-#define ROP_SPno 0xCF
-#define ROP_PSDnoa 0xD0
-#define ROP_PSDPxoxn 0xD1
-#define ROP_PDSnax 0xD2
-#define ROP_SPDSoaxn 0xD3
-#define ROP_SSPxPDxax 0xD4
-#define ROP_DPSanan 0xD5
-#define ROP_PSDPSaoxx 0xD6
-#define ROP_DPSxan 0xD7
-#define ROP_PDSPxax 0xD8
-#define ROP_SDPSaoxn 0xD9
-#define ROP_DPSDanax 0xDA
-#define ROP_SPxDSxan 0xDB
-#define ROP_SPDnao 0xDC
-#define ROP_SDno 0xDD
-#define ROP_SDPxo 0xDE
-#define ROP_SDPano 0xDF
-#define ROP_PDSoa 0xE0
-#define ROP_PDSoxn 0xE1
-#define ROP_DSPDxax 0xE2
-#define ROP_PSDPaoxn 0xE3
-#define ROP_SDPSxax 0xE4
-#define ROP_PDSPaoxn 0xE5
-#define ROP_SDPSanax 0xE6
-#define ROP_SPxPDxan 0xE7
-#define ROP_SSPxDSxax 0xE8
-#define ROP_DSPDSanaxxn 0xE9
-#define ROP_DPSao 0xEA
-#define ROP_DPSxno 0xEB
-#define ROP_SDPao 0xEC
-#define ROP_SDPxno 0xED
-#define ROP_DSo 0xEE
-#define ROP_SDPnoo 0xEF
-#define ROP_P 0xF0
-#define ROP_PDSono 0xF1
-#define ROP_PDSnao 0xF2
-#define ROP_PSno 0xF3
-#define ROP_PSDnao 0xF4
-#define ROP_PDno 0xF5
-#define ROP_PDSxo 0xF6
-#define ROP_PDSano 0xF7
-#define ROP_PDSao 0xF8
-#define ROP_PDSxno 0xF9
-#define ROP_DPo 0xFA
-#define ROP_DPSnoo 0xFB
-#define ROP_PSo 0xFC
-#define ROP_PSDnoo 0xFD
-#define ROP_DPSoo 0xFE
-#define ROP_1 0xFF
-
-#define NO_SRC_ROP(rop) \
- ((rop == GXnoop) || (rop == GXset) || (rop == GXclear) || (rop == GXinvert))
-
-int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop);
-int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop);
-
-extern int XAACopyROP[16];
-extern int XAACopyROP_PM[16];
-extern int XAAPatternROP[16];
-extern int XAAPatternROP_PM[16];
-
-#endif /* _XAAROP_H */
diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
deleted file mode 100644
index e6963c325..000000000
--- a/hw/xfree86/xaa/xaawrap.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaawrap.h,v 1.5 2000/09/20 02:05:42 keithp Exp $ */
-
-#define XAA_SCREEN_PROLOGUE(pScreen, field)\
- ((pScreen)->field = \
- ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
-
-#define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
-
-
-#define XAA_GC_FUNC_PROLOGUE(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;\
- (pGC)->funcs = pGCPriv->wrapFuncs;\
- if(pGCPriv->flags)\
- (pGC)->ops = pGCPriv->wrapOps
-
-#define XAA_GC_FUNC_EPILOGUE(pGC)\
- pGCPriv->wrapFuncs = (pGC)->funcs;\
- (pGC)->funcs = &XAAGCFuncs;\
- if(pGCPriv->flags) {\
- pGCPriv->wrapOps = (pGC)->ops;\
- (pGC)->ops = (pGCPriv->flags & OPS_ARE_ACCEL) ? pGCPriv->XAAOps :\
- &XAAPixmapOps;\
- }
-
-
-#define XAA_GC_OP_PROLOGUE(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
- GCFuncs *oldFuncs = pGC->funcs;\
- pGC->funcs = pGCPriv->wrapFuncs;\
- pGC->ops = pGCPriv->wrapOps
-
-#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
- GCFuncs *oldFuncs = pGC->funcs;\
- if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \
- pGC->funcs = pGCPriv->wrapFuncs;\
- pGC->ops = pGCPriv->wrapOps
-
-
-#define XAA_GC_OP_EPILOGUE(pGC)\
- pGCPriv->wrapOps = pGC->ops;\
- pGC->funcs = oldFuncs;\
- pGC->ops = pGCPriv->XAAOps
-
-
-#define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\
- GCFuncs *oldFuncs = pGC->funcs;\
- pGC->funcs = pGCPriv->wrapFuncs;\
- pGC->ops = pGCPriv->wrapOps
-
-
-#define XAA_PIXMAP_OP_EPILOGUE(pGC)\
- pGCPriv->wrapOps = pGC->ops;\
- pGC->funcs = oldFuncs;\
- pGC->ops = &XAAPixmapOps;\
- pixPriv->flags |= DIRTY
-
-#ifdef RENDER
-#define XAA_RENDER_PROLOGUE(pScreen,field)\
- (GetPictureScreen(pScreen)->field = \
- ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
-
-#define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\
- (GetPictureScreen(pScreen)->field = wrapper)
-#endif
-
-/* This also works fine for drawables */
-
-#define SYNC_CHECK(pGC) {\
- XAAInfoRecPtr infoRec =\
-((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec;\
- if(infoRec->NeedToSync) {\
- (*infoRec->Sync)(infoRec->pScrn);\
- infoRec->NeedToSync = FALSE;\
- }}
diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h
deleted file mode 100644
index e72fa4316..000000000
--- a/hw/xfree86/xf1bpp/mfbmap.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmap.h,v 1.2 1998/07/25 16:59:24 dawes Exp $ */
-
-#ifndef _MFBMAP_H
-#define _MFBMAP_H
-
-#define InverseAlu xf1bppInverseAlu
-#define endtab xf1bppendtab
-#define mask xf1bppmask
-#define mergeRopBits xf1bppmergeRopBits
-#define mfbAllocatePrivates xf1bppAllocatePrivates
-#define mfbBSFuncRec xf1bppBSFuncRec
-#define mfbBlackSolidFS xf1bppBlackSolidFS
-#define mfbBlackStippleFS xf1bppBlackStippleFS
-#define mfbBresD xf1bppBresD
-#define mfbBresS xf1bppBresS
-#define mfbChangeWindowAttributes xf1bppChangeWindowAttributes
-#define mfbCloseScreen xf1bppCloseScreen
-#define mfbCopyArea xf1bppCopyArea
-#define mfbCopyPixmap xf1bppCopyPixmap
-#define mfbCopyPlane xf1bppCopyPlane
-#define mfbCopyRotatePixmap xf1bppCopyRotatePixmap
-#define mfbCopyWindow xf1bppCopyWindow
-#define mfbCreateColormap xf1bppCreateColormap
-#define mfbCreateDefColormap xf1bppCreateDefColormap
-#define mfbCreateGC xf1bppCreateGC
-#define mfbCreatePixmap xf1bppCreatePixmap
-#define mfbCreateWindow xf1bppCreateWindow
-#define mfbDestroyColormap xf1bppDestroyColormap
-#define mfbDestroyPixmap xf1bppDestroyPixmap
-#define mfbDestroyWindow xf1bppDestroyWindow
-#define mfbDoBitblt xf1bppDoBitblt
-#define mfbDoBitbltCopy xf1bppDoBitbltCopy
-#define mfbDoBitbltCopyInverted xf1bppDoBitbltCopyInverted
-#define mfbDoBitbltGeneral xf1bppDoBitbltGeneral
-#define mfbDoBitbltOr xf1bppDoBitbltOr
-#define mfbDoBitbltXor xf1bppDoBitbltXor
-#define mfbFillPolyBlack xf1bppFillPolyBlack
-#define mfbFillPolyInvert xf1bppFillPolyInvert
-#define mfbFillPolyWhite xf1bppFillPolyWhite
-#define mfbGCPrivateIndex xf1bppGCPrivateIndex
-#define mfbGetImage xf1bppGetImage
-#define mfbGetSpans xf1bppGetSpans
-#define mfbGetWindowPixmap xf1bppGetWindowPixmap
-#define mfbHorzS xf1bppHorzS
-#define mfbImageGlyphBltBlack xf1bppImageGlyphBltBlack
-#define mfbImageGlyphBltWhite xf1bppImageGlyphBltWhite
-#define mfbInstallColormap xf1bppInstallColormap
-#define mfbInvertSolidFS xf1bppInvertSolidFS
-#define mfbInvertStippleFS xf1bppInvertStippleFS
-#define mfbLineSD xf1bppLineSD
-#define mfbLineSS xf1bppLineSS
-#define mfbListInstalledColormaps xf1bppListInstalledColormaps
-#define mfbMapWindow xf1bppMapWindow
-#define mfbPadPixmap xf1bppPadPixmap
-#define mfbPaintWindow xf1bppPaintWindow
-#define mfbPixmapToRegion xf1bppPixmapToRegion
-#define mfbPolyFillArcSolid xf1bppPolyFillArcSolid
-#define mfbPolyFillRect xf1bppPolyFillRect
-#define mfbPolyGlyphBltBlack xf1bppPolyGlyphBltBlack
-#define mfbPolyGlyphBltInvert xf1bppPolyGlyphBltInvert
-#define mfbPolyGlyphBltWhite xf1bppPolyGlyphBltWhite
-#define mfbPolyPoint xf1bppPolyPoint
-#define mfbPositionWindow xf1bppPositionWindow
-#define mfbPushPixels xf1bppPushPixels
-#define mfbPutImage xf1bppPutImage
-#define mfbQueryBestSize xf1bppQueryBestSize
-#define mfbRealizeFont xf1bppRealizeFont
-#define mfbReduceRop xf1bppReduceRop
-#define mfbRegisterCopyPlaneProc xf1bppRegisterCopyPlaneProc
-#define mfbResolveColor xf1bppResolveColor
-#define mfbRestoreAreas xf1bppRestoreAreas
-#define mfbSaveAreas xf1bppSaveAreas
-#define mfbScreenInit xf1bppScreenInit
-#define mfbSegmentSD xf1bppSegmentSD
-#define mfbSegmentSS xf1bppSegmentSS
-#define mfbSetScanline xf1bppSetScanline
-#define mfbSetSpans xf1bppSetSpans
-#define mfbSetWindowPixmap xf1bppSetWindowPixmap
-#define mfbSolidBlackArea xf1bppSolidBlackArea
-#define mfbSolidInvertArea xf1bppSolidInvertArea
-#define mfbSolidPP xf1bppSolidPP
-#define mfbSolidWhiteArea xf1bppSolidWhiteArea
-#define mfbStippleBlackArea xf1bppStippleBlackArea
-#define mfbStippleInvertArea xf1bppStippleInvertArea
-#define mfbStippleWhiteArea xf1bppStippleWhiteArea
-#define mfbTEGlyphBltBlack xf1bppTEGlyphBltBlack
-#define mfbTEGlyphBltWhite xf1bppTEGlyphBltWhite
-#define mfbTileAreaPPW xf1bppTileAreaPPW
-#define mfbTileAreaPPWCopy xf1bppTileAreaPPWCopy
-#define mfbTileAreaPPWGeneral xf1bppTileAreaPPWGeneral
-#define mfbTileFS xf1bppTileFS
-#define mfbUninstallColormap xf1bppUninstallColormap
-#define mfbUnmapWindow xf1bppUnmapWindow
-#define mfbUnnaturalStippleFS xf1bppUnnaturalStippleFS
-#define mfbUnnaturalTileFS xf1bppUnnaturalTileFS
-#define mfbUnrealizeFont xf1bppUnrealizeFont
-#define mfbValidateGC xf1bppValidateGC
-#define mfbVertS xf1bppVertS
-#define mfbWhiteSolidFS xf1bppWhiteSolidFS
-#define mfbWhiteStippleFS xf1bppWhiteStippleFS
-#define mfbWindowPrivateIndex xf1bppWindowPrivateIndex
-#define mfbXRotatePixmap xf1bppXRotatePixmap
-#define mfbYRotatePixmap xf1bppYRotatePixmap
-#define mfbZeroPolyArcSS xf1bppZeroPolyArcSS
-#define partmasks xf1bpppartmasks
-#define rmask xf1bpprmask
-#define starttab xf1bppstarttab
-
-#endif
diff --git a/hw/xfree86/xf1bpp/mfbmap.sh b/hw/xfree86/xf1bpp/mfbmap.sh
deleted file mode 100644
index a8f43eceb..000000000
--- a/hw/xfree86/xf1bpp/mfbmap.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-# $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmap.sh,v 1.2 1998/07/25 16:59:24 dawes Exp $
-#
-# This script recreates the mapping list that maps the mfb external
-# symbols * to xf1bpp* (without "mfb")
-# This should only be rerun if there have been changes in the mfb code
-# that affect the external symbols.
-# It assumes that Xserver/mfb has been compiled.
-# The output goes to stdout.
-echo ""
-echo "#ifndef _MFBMAP_H"
-echo "#define _MFBMAP_H"
-echo ""
-
-nm ../../../mfb/*.o | \
-awk "{ if ((\$2 == \"D\") || (\$2 == \"T\") || (\$2 == \"C\")) print \$3 }" | \
-sed s/^_// | \
-grep -v "ModuleInit$" | \
-sort | \
-awk "{ print \"#define \" \$1 \" xf1bpp\"\$1 }" | \
-sed s/xf1bppmfb/xf1bpp/
-
-echo ""
-echo "#endif"
diff --git a/hw/xfree86/xf1bpp/mfbmodule.c b/hw/xfree86/xf1bpp/mfbmodule.c
deleted file mode 100644
index 4fb795152..000000000
--- a/hw/xfree86/xf1bpp/mfbmodule.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmodule.c,v 1.6 1999/01/26 05:54:19 dawes Exp $ */
-/*
- * Copyright (C) 1997 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-#include "xf86Module.h"
-
-
-static XF86ModuleVersionInfo VersRec =
-{
- "xf1bpp",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData xf1bppModuleData = { &VersRec, NULL, NULL };
-
-#endif
diff --git a/hw/xfree86/xf1bpp/mfbunmap.h b/hw/xfree86/xf1bpp/mfbunmap.h
deleted file mode 100644
index 94c029856..000000000
--- a/hw/xfree86/xf1bpp/mfbunmap.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbunmap.h,v 1.2 1998/07/25 16:59:25 dawes Exp $ */
-
-#ifdef _MFBMAP_H
-#undef _MFBMAP_H
-
-#undef InverseAlu
-#undef endtab
-#undef mask
-#undef mergeRopBits
-#undef mfbAllocatePrivates
-#undef mfbBSFuncRec
-#undef mfbBlackSolidFS
-#undef mfbBlackStippleFS
-#undef mfbBresD
-#undef mfbBresS
-#undef mfbChangeWindowAttributes
-#undef mfbCloseScreen
-#undef mfbCopyArea
-#undef mfbCopyPixmap
-#undef mfbCopyPlane
-#undef mfbCopyRotatePixmap
-#undef mfbCopyWindow
-#undef mfbCreateColormap
-#undef mfbCreateDefColormap
-#undef mfbCreateGC
-#undef mfbCreatePixmap
-#undef mfbCreateWindow
-#undef mfbDestroyColormap
-#undef mfbDestroyPixmap
-#undef mfbDestroyWindow
-#undef mfbDoBitblt
-#undef mfbDoBitbltCopy
-#undef mfbDoBitbltCopyInverted
-#undef mfbDoBitbltGeneral
-#undef mfbDoBitbltOr
-#undef mfbDoBitbltXor
-#undef mfbFillPolyBlack
-#undef mfbFillPolyInvert
-#undef mfbFillPolyWhite
-#undef mfbGCPrivateIndex
-#undef mfbGetImage
-#undef mfbGetSpans
-#undef mfbGetWindowPixmap
-#undef mfbHorzS
-#undef mfbImageGlyphBltBlack
-#undef mfbImageGlyphBltWhite
-#undef mfbInstallColormap
-#undef mfbInvertSolidFS
-#undef mfbInvertStippleFS
-#undef mfbLineSD
-#undef mfbLineSS
-#undef mfbListInstalledColormaps
-#undef mfbMapWindow
-#undef mfbPadPixmap
-#undef mfbPaintWindow
-#undef mfbPixmapToRegion
-#undef mfbPolyFillArcSolid
-#undef mfbPolyFillRect
-#undef mfbPolyGlyphBltBlack
-#undef mfbPolyGlyphBltInvert
-#undef mfbPolyGlyphBltWhite
-#undef mfbPolyPoint
-#undef mfbPositionWindow
-#undef mfbPushPixels
-#undef mfbPutImage
-#undef mfbQueryBestSize
-#undef mfbRealizeFont
-#undef mfbReduceRop
-#undef mfbRegisterCopyPlaneProc
-#undef mfbResolveColor
-#undef mfbRestoreAreas
-#undef mfbSaveAreas
-#undef mfbScreenInit
-#undef mfbSegmentSD
-#undef mfbSegmentSS
-#undef mfbSetScanline
-#undef mfbSetSpans
-#undef mfbSetWindowPixmap
-#undef mfbSolidBlackArea
-#undef mfbSolidInvertArea
-#undef mfbSolidPP
-#undef mfbSolidWhiteArea
-#undef mfbStippleBlackArea
-#undef mfbStippleInvertArea
-#undef mfbStippleWhiteArea
-#undef mfbTEGlyphBltBlack
-#undef mfbTEGlyphBltWhite
-#undef mfbTileAreaPPW
-#undef mfbTileAreaPPWCopy
-#undef mfbTileAreaPPWGeneral
-#undef mfbTileFS
-#undef mfbUninstallColormap
-#undef mfbUnmapWindow
-#undef mfbUnnaturalStippleFS
-#undef mfbUnnaturalTileFS
-#undef mfbUnrealizeFont
-#undef mfbValidateGC
-#undef mfbVertS
-#undef mfbWhiteSolidFS
-#undef mfbWhiteStippleFS
-#undef mfbWindowPrivateIndex
-#undef mfbXRotatePixmap
-#undef mfbYRotatePixmap
-#undef mfbZeroPolyArcSS
-#undef partmasks
-#undef rmask
-#undef starttab
-
-#endif
diff --git a/hw/xfree86/xf1bpp/mfbunmap.sh b/hw/xfree86/xf1bpp/mfbunmap.sh
deleted file mode 100644
index 6b244e68e..000000000
--- a/hw/xfree86/xf1bpp/mfbunmap.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbunmap.sh,v 1.2 1998/07/25 16:59:25 dawes Exp $
-#
-# This script recreates a header that undoes the effect of mfbmap.h
-# This should only be rerun if there have been changes in the mfb code
-# that affect the external symbols.
-# It assumes that Xserver/mfb has been compiled.
-# The output goes to stdout.
-echo ""
-echo "#ifdef _MFBMAP_H"
-echo "#undef _MFBMAP_H"
-echo ""
-
-nm ../../../mfb/*.o | \
-awk "{ if ((\$2 == \"D\") || (\$2 == \"T\") || (\$2 == \"C\")) print \$3 }" | \
-sed s/^_// | \
-grep -v "ModuleInit$" | \
-sort | \
-awk "{ print \"#undef \" \$1 }"
-
-echo ""
-echo "#endif"
diff --git a/hw/xfree86/xf1bpp/xf1bpp.h b/hw/xfree86/xf1bpp/xf1bpp.h
deleted file mode 100644
index 18104a77e..000000000
--- a/hw/xfree86/xf1bpp/xf1bpp.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/xf1bpp.h,v 1.2 1998/07/25 16:59:25 dawes Exp $ */
-/*
- * Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifndef __XF1BPP_H__
-#define __XF1BPP_H__
-
-#define MFB_PROTOTYPES_ONLY
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mfbunmap.h"
-#undef MFB_PROTOTYPES_ONLY
-
-#endif
diff --git a/hw/xfree86/xf4bpp/NOTES b/hw/xfree86/xf4bpp/NOTES
deleted file mode 100644
index f9ccc95c1..000000000
--- a/hw/xfree86/xf4bpp/NOTES
+++ /dev/null
@@ -1,194 +0,0 @@
-This code originally hails from IBM. It was ported to an early XFree86 by
-Gertjan Akkerman, whose BUGS file I append here.
-
-In turn, this is a port of Gertjan's work to the new server design. Among the
-changes are:
-
-- The removal of almost all unreferenced code.
-- The removal of this code's own copy of mfb (xf1bpp is used instead).
-- The removal of banking support (mibank is used instead).
-- External symbols were made static where this was sufficient.
-- The remaining external names were renamed to xf4bpp*.
-- Several minor cleanups too many to mention here.
-
-To understate the matter, this code is >UGLY<. This seems inherent in IBM's
-corporate culture. Be that as it may, it *does* survive X11R4's xtest
-(whatever that means these days...). For now, this is sufficient for 4bpp
-support in the new design, but at some point, I'll have to sit down and
-rewrite this from scratch. A more technical justification for a rewrite is
-that the pixmap format is 8bpp, instead of 4bpp, which is causing me to
-pepper the rest of the server with unclean accomodations.
-
-Marc.
-
-===============================================================================
-Section 1: From IBM's X11R4 contribution towards XFree86.
-
-This section describes what I did to obtain a 16 colour vga server.
-
-I started with the SYSV, ppc, vga and common directories from IBM's X11R4
-contribution. Those directories have the following function:
-1. SYSV implements the mouse and keyboard.
-2. ppc is a generic layer implementing ddx in terms of drawing operations
- through rectangles. (With spans as a boundary case: height = 1.)
-3. vga implements a layer of operations drawing through rectangles.
-4. common implements ddx initialization and quitting, and screen saving.
-
-I eliminated SYSV and common since the functionality provided therein is
-already provided in XFree86. Since XFree86 is actively being ported to
-new operating systems, while X11R4 is out of date, I preferred the XFree86
-code here above the SYSV and common code.
-Whatever functionality was still needed from common (default colormap
-initialization -- not much code) was moved into ppc.
-
-Since XFree86 uses the mi-provided software cursor code, IBM's software
-cursor code was deleted from ppc and vga. This is a pity, since it is
-expected that it is more efficient than mi's code, but the XFree86 mouse and
-keyboard code directly call mi, and I do not want to maintain the XFree86
-mouse and keyboard code.
-
-Since we cannot support a monolithic multi-screen server using all of the
-x11r4 contributed code yet, all multi screen code was deleted. This includes
-one header file containing a nasty copyright statement.
-
-Since glyph handling has changed between X11R4 and X11R5, the code handling
-glyphs was replaced by appropriate calls to mi.
-I hope it can be modified and put back one day.
-
-Provisionally, some code was added (viz. file vga/offscreen.c) to intercept
-calls to the rectangle drawing code when we are switched out of the VT.
-I hope this can be replaced by some window tree invalidation and GC validation
-scheme.
-
-
-Section 2: BUGS
-
-This section describes fixed and still unfixed bugs in this code.
-All bugs not labeled otherwise also occur in IBM's X11R4 code, and may be of
-interest to anybody using that code.
-
-1. (Fixed.)
-I found (and provisionally fixed) a bug in the IBM bitblit code:
-In file ddx/ibm/vga/vgaImages.c a function vgaReadColorImage is defined.
-When this function is used to read less than 8 pixels starting on a byte
-boundary it will always read precisely 8 pixels.
-Thus, when space is allocated for 4 or less pixels, it will write beyond
-the allocated space.
-Since the code is rather convoluted, this may not be apparent at first sight,
-but going through the code with an example shows the error.
-
-2. (Fixed.)
-In ppcPixmapFS.c, function ppcStipplePixmapFS there was a bug
-regarding the stipple origin: The horizontal origin is added while
-the vertical one is subtracted. The horizontal origin should be subtracted
-instead of added here.
-This bug gets visible when backing-store is enabled and one uses twm:
-the submenu icons get truncated on their left hand side.
-(In case you wonder why this bug appears: under those circumstances
-twm prepares its menus by drawing into an unmapped window.
-The miCopyPlane function uses the ppcStipplePixmap (and many others)
-to get the plane copied.)
-I also fixed this bug in the other routines (ppcOpStipplePixmapFS,
-ppcTilePixmapFS) in this file, although I had no visible clues for this.
-I hope this is appropriate.
-
-3. (Fixed.)
-I find it suspect that ppcSetSpans gives different output when one
-claims that an actually sorted list of spans is unsorted.
-The unsorted code is wrong, and should be made to look more like the sorted
-code. I.e., use ( xStart - ppt->x ) instead of ( xStart - pbox->x1 )
-
-4. (Fixed.)
-There used to be another bug that became visible when using twm and backing
-store: popping up a submenu, and moving the cursor upwards til it leaves the
-submenu, the submenu would disappears, as it should.
-But the submenu icon would not get restored, while it should be.
-10b. By replacing the clip-computing code in ppcValidateGC by that in
-cfbValidateGC, I *finally* fixed the disappearing twm menu icon problem.
-
-5. Added mfbRegisterCopyplaneProc call. [Its omission was an error on my
- part.]
- Fixing a server core dump in XTest.
-
-6. Fixed not-very-high tile bug in function ppcTileRect, file emulTile.c
- (I.e., if the tile was higher than the area to be tiled, far too much
- was drawn, causing server core dumps in XTest.)
- Actually, "savey" ought to be used to determine the height of the tiles in
- the top line to be tiled, instead of "pTile->drawable.height".
-7. A use of height where width was intended was fixed in ppcTileRect:
- "savehcount = w / pTile->drawable.height;" should use "... .width" and
- "savehcount = ( x + w - htarget ) / pTile->drawable.height;" too.
-
-8. Deleted overly clever code in ppcCReduce.c
- (All code that tried to pre-compute how alu's could be replaced by
- other alu's with inverted colors, etc. was deleted. I think it is
- at least wrong for FillSolid.)
-
-9. Looked at suspicious code in ppcSetSp.c
- "tmpx = *pdst;" was never updated during the loop. We took it out of the
- initialization position of the for and moved it into the loop.
-
-10. Add xSrc := GC->patOrg.x + pDrawable.x and ySrc := ... in ppcPixmapFS.c,
- functions ppcStipplePixmapFS, ppcOpStipplePixmapFS, and ppcTilePixmapFS.
- This because stipple and tile origins are taken relative to the drawable.
- Also use a "modulo" function that gets the cases of a negative stipple
- or tile offset right. (When the stipple origin is to the right of or
- below the origin of the drawable.)
-
-11. File vgaSolid.c, function vgaFillSolid:
- Inverting is XORing with all ones. Not with the color we want to AND/OR
- later. So we'll have to set the color to VGA_ALLPLANES
- whenever we want to invert existing data, and reset it before the
- AND/OR is done.
- Also we replaced an outb( 0x3CF, tmp2 ) by the SetVideoGraphicsData( tmp2 )
- it is representing. (Just a cosmetic replacement.)
-
-12. File vgaImages, function vgaDrawColorImage.
- Moved a line "invert_existing_data = TRUE;" two lines down, past a case
- label. Now it is also part of the code executed for GXorReverse, as it
- should be.
-
-13. The pixmap FillSpans routines (file ppcPixmapFS.c) got somewhat better
- after importing some code from ddx/ibm/vga. (A getbits function that does
- wrapping.)
- They were wrong for the FillStippled and FillOpaqueStippled modes.
- I don't understand the old code. How could it handle stipples of a size not
- an exact multiple of 32? (or 8, for that matter.)
-
-14. In function vgaBitBlt file vgaBitBlt.c, in the shortcuts for
- GXSet, GXClear and GXInvert, the source (x0,y0) is accidentally operated
- upon by vgaFillSolid, instead of the destination (x1,y1).
-
-15. Notice that in DoMonoSingle and DoMonoMany in file vgaStipple.c, the left
- edge of the square to be stippled is treated wrong.
- Correct would be to get the bits with getbits using offset xshift, and
- to shift them right (x & 07) places.
- [One might wish to use the variable tmp1 at this place, since it had been
- set to (x & 07) at this place; but that is already re-used at this point.]
- Also note that NeedValX is set wrong: The implicit assumption was that
- stipples are more than 8 wide.
- This only fixes the problem when miPushPixel is used instead of ppcPushPixel.
- I think I should look some more into this.
-
-16. I took out some code of the CopyArea function, in which a no-op function
- was called while a real one was needed. My fix does not completely work,
- although it improved the behaviour of GetImage somewhat.
-
-17. After finding three kinds of errors in this single function,
- -- the new kinds being the right side not being always written due to
- an incorrect if scope, and the lower end not always being written due
- to variables being updated at the wrong place --
- (requiring modifications to be made at at least 10 places,
- I decided to REWRITE the body of the ppcTileRect function from scratch.
- This version simply computes all relevant margins in advance, and does
- not try to reuse temporary variables. I leave that to the compiler.
- (This was a maintenance and robustness nightmare anyway.)
-
-MORE NOTES:
- It is funny that there are two files in mi that require compilation
- with the proper #defines ( -DXF86VGA16 in my case ):
- Besides the obvious mibitblt.c, there is also mipushpxl.c.
-
-
-
-$XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/NOTES,v 1.2 1998/07/25 16:59:26 dawes Exp $
diff --git a/hw/xfree86/xf4bpp/OScompiler.h b/hw/xfree86/xf4bpp/OScompiler.h
deleted file mode 100644
index 3891f1e21..000000000
--- a/hw/xfree86/xf4bpp/OScompiler.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/OScompiler.h,v 1.4 2000/07/26 01:52:26 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: OScompiler.h /main/4 1996/02/21 17:56:09 kaleb $ */
-
-#ifndef __COMPILER_DEPENDANCIES__
-#define __COMPILER_DEPENDANCIES__
-
-#define MOVE( src, dst, length ) memcpy( dst, src, length)
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define ABS(x) (((x)>0)?(x):-(x))
-
-#include "misc.h"
-#include "xf86_ansic.h"
-#include "compiler.h"
-
-#ifdef lint
-/* So that lint doesn't complain about constructs it doesn't understand */
-#ifdef volatile
-#undef volatile
-#endif
-#define volatile
-#ifdef const
-#undef const
-#endif
-#define const
-#ifdef signed
-#undef signed
-#endif
-#define signed
-#ifdef _ANSI_DECLS_
-#undef _ANSI_DECLS_
-#endif
-#endif
-
-#endif /* !__COMPILER_DEPENDANCIES__ */
diff --git a/hw/xfree86/xf4bpp/emulOpStip.c b/hw/xfree86/xf4bpp/emulOpStip.c
deleted file mode 100644
index e9ac98dc9..000000000
--- a/hw/xfree86/xf4bpp/emulOpStip.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulOpStip.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: emulOpStip.c /main/4 1996/02/21 17:56:12 kaleb $ */
-
-/* ppc OpaqueStipple
- *
- * Based on the private stipple; does a foreground, and then an inverted
- * on the background
- *
- */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-
-void
-xf4bppOpaqueStipple( pWin, pStipple, fg, bg, alu, planes, x, y, w, h, xSrc, ySrc )
-WindowPtr pWin; /* GJA */
-register PixmapPtr pStipple ;
-unsigned long int fg ;
-unsigned long int bg ;
-int alu ;
-unsigned long int planes ;
-register int x, y, w, h ;
-int xSrc, ySrc ;
-{
- /* DO BACKGROUND */
- switch ( alu ) {
- /* Easy Cases -- i.e. Final Result Doesn't Depend On Initial Dest. */
- case GXclear: /* 0x0 Zero 0 */
- case GXset: /* 0xf 1 */
- /* Foreground And Background Are Both The Same !! */
- xf4bppFillSolid( pWin, bg, alu, planes, x, y, w, h ) ;
- case GXnoop: /* 0x5 dst */
- break ;
- case GXcopy: /* 0x3 src */
- case GXcopyInverted: /* 0xc NOT src */
- { /* Special Case Code */
- register int vtarget, htarget ;
-
- /* We Can Draw Just One Copy Then Blit The Rest !! */
- /* Draw The One Copy */
- htarget = MIN( w, pStipple->drawable.width ) ;
- vtarget = MIN( h, pStipple->drawable.height ) ;
-
- /* First The Background */
- xf4bppFillSolid( pWin, bg, alu, planes, x, y,
- htarget, vtarget ) ;
- /* Then The Foreground */
- xf4bppFillStipple( pWin, pStipple, fg, alu, planes,
- x, y, htarget, vtarget,
- xSrc, ySrc ) ;
-
- /* Here We Double The Size Of The BLIT Each Iteration */
- xf4bppReplicateArea(pWin, x, y, planes, w, h, htarget, vtarget);
- }
- break ;
- default:
- /* Hard Cases -- i.e. Final Result DOES Depend On Initial Dest. */
- { /* Do The Background */
- register int i, j;
- register PixmapPtr pInvPixmap = xf4bppCopyPixmap( pStipple ) ;
- register unsigned char *data = pInvPixmap->devPrivate.ptr ;
-
- /* INVERT PIXMAP OK, jeff, this is for you */
- for ( i = pInvPixmap->drawable.height ; i-- ; )
- for ( j = pInvPixmap->devKind ; j-- ; data++ )
- *data = ~ ( *data ) ;
-
- xf4bppFillStipple( pWin, pInvPixmap, bg, alu, planes, x, y, w, h, xSrc, ySrc );
- mfbDestroyPixmap( pInvPixmap ) ;
- /* DO FOREGROUND */
- xf4bppFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc );
- }
- break ;
- }
- return;
-}
diff --git a/hw/xfree86/xf4bpp/emulRepAre.c b/hw/xfree86/xf4bpp/emulRepAre.c
deleted file mode 100644
index 42f118aac..000000000
--- a/hw/xfree86/xf4bpp/emulRepAre.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulRepAre.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: emulRepAre.c /main/5 1996/02/21 17:56:16 kaleb $ */
-
-/* ppc Replicate Area -- A Divide & Conquer Algorithm
- * a "ppc" Helper Function For Stipples And Tiling
- * P. Shupak 1/88
- */
-
-#include "xf4bpp.h"
-
-void xf4bppReplicateArea( pWin, x, y, planeMask, goalWidth, goalHeight,
- currentHoriz, currentVert)
-WindowPtr pWin; /* GJA */
-register int x, y, planeMask ;
-int goalWidth, goalHeight ;
-int currentHoriz, currentVert ;
-{
- for ( ;
- currentHoriz <= ( goalWidth >> 1 ) ;
- currentHoriz <<= 1 ) {
- xf4bppBitBlt( pWin, GXcopy, planeMask,
- x, y,
- x + currentHoriz, y,
- currentHoriz, currentVert ) ;
- }
- if ( goalWidth - currentHoriz )
- xf4bppBitBlt( pWin, GXcopy, planeMask,
- x, y,
- x + currentHoriz, y,
- goalWidth - currentHoriz, currentVert ) ;
- for ( ;
- currentVert <= ( goalHeight >> 1 ) ;
- currentVert <<= 1 ) {
- xf4bppBitBlt( pWin, GXcopy, planeMask,
- x, y,
- x, y + currentVert,
- goalWidth, currentVert ) ;
- }
- if ( goalHeight - currentVert )
- xf4bppBitBlt( pWin, GXcopy, planeMask,
- x, y,
- x, y + currentVert,
- goalWidth, goalHeight - currentVert ) ;
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/emulTile.c b/hw/xfree86/xf4bpp/emulTile.c
deleted file mode 100644
index 650c448b8..000000000
--- a/hw/xfree86/xf4bpp/emulTile.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.4 2003/11/03 05:11:56 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: emulTile.c /main/4 1996/02/21 17:56:23 kaleb $ */
-
-/* ppc Tile
- * P. Shupak 11/87
- * Modified From original ppc Tile
- * T. Paquin 9/87
- * Uses private imageFill a bunch of times
- */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "ibmTrace.h"
-
-static void
-DrawFirstTile
-(
- WindowPtr pWin, /* GJA */
- register PixmapPtr pTile,
- register int x,
- register int y,
- int w,
- int h,
- int alu,
- unsigned long int planes,
- int xOffset,
- int yOffset
-)
-{
-register int htarget ;
-register int vtarget ;
-
- if ( xOffset ) { /* Not X-Aligned */
- if ( yOffset ) { /* Nor Y-Aligned */
- htarget = MIN( pTile->drawable.width - xOffset, w ),
- vtarget = MIN( pTile->drawable.height - yOffset, h ),
- yOffset *= pTile->devKind ;
- xf4bppDrawColorImage( pWin,x, y,
- htarget,
- vtarget,
- (unsigned char *)pTile->devPrivate.ptr + yOffset + xOffset,
- pTile->devKind,
- alu, planes ) ;
- if ( w > htarget ) {
- w = MIN( w, pTile->drawable.width ) ;
- if ( h > vtarget ) {
- h = MIN( h, pTile->drawable.height ) ;
- xf4bppDrawColorImage( pWin, x, y + vtarget,
- htarget,
- h - vtarget,
- (unsigned char *)pTile->devPrivate.ptr + xOffset,
- pTile->devKind,
- alu, planes ) ;
- xf4bppDrawColorImage( pWin, x + htarget, y,
- w - htarget,
- vtarget,
- (unsigned char *)pTile->devPrivate.ptr + yOffset,
- pTile->devKind,
- alu, planes ) ;
- xf4bppDrawColorImage( pWin, x + htarget,
- y + vtarget,
- w - htarget,
- h - vtarget,
- pTile->devPrivate.ptr,
- pTile->devKind,
- alu, planes ) ;
- }
- else { /* h <= vtarget */
- xf4bppDrawColorImage( pWin, x + htarget, y,
- w - htarget,
- vtarget,
- (unsigned char *)pTile->devPrivate.ptr + yOffset,
- pTile->devKind,
- alu, planes ) ;
- }
- }
- else if ( h > vtarget ) {
- xf4bppDrawColorImage( pWin, x, y + vtarget,
- htarget,
- MIN( h, pTile->drawable.height ) - vtarget,
- (unsigned char *)pTile->devPrivate.ptr + xOffset,
- pTile->devKind,
- alu, planes ) ;
- vtarget = pTile->drawable.height ;
- }
- }
- else { /* No Y Offset */
- xf4bppDrawColorImage( pWin, x, y,
- htarget = MIN( pTile->drawable.width - xOffset, w ),
- vtarget = MIN( pTile->drawable.height, h ),
- (unsigned char *)pTile->devPrivate.ptr + xOffset,
- pTile->devKind,
- alu, planes ) ;
- if ( w > htarget ) {
- xf4bppDrawColorImage( pWin, x + htarget, y,
- MIN( pTile->drawable.width, w ) - htarget,
- vtarget,
- pTile->devPrivate.ptr,
- pTile->devKind,
- alu, planes ) ;
- }
- }
- }
- else if ( yOffset ) {
- xf4bppDrawColorImage( pWin, x, y,
- htarget = MIN( pTile->drawable.width, w ),
- vtarget = MIN( pTile->drawable.height - yOffset, h ),
- (unsigned char *)pTile->devPrivate.ptr + ( yOffset * pTile->devKind ),
- pTile->devKind,
- alu, planes ) ;
- if ( h > vtarget ) {
- xf4bppDrawColorImage( pWin, x, y + vtarget,
- htarget,
- MIN( pTile->drawable.height, h ) - vtarget,
- pTile->devPrivate.ptr,
- pTile->devKind,
- alu, planes ) ;
- }
- }
- else { /* NO Offset */
- xf4bppDrawColorImage( pWin, x, y,
- htarget = MIN( pTile->drawable.width, w ),
- vtarget = MIN( pTile->drawable.height, h ),
- pTile->devPrivate.ptr,
- pTile->devKind,
- alu, planes ) ;
- }
-
- return ;
-}
-
-/* GJA --
- * After finding three kinds of errors in this single function,
- * (requiring modifications to be made at at least 10 places,
- * I decided to REWRITE the body of the xf4bppTileRect function from scratch.
- * This version simply computes all relevant margins in advance, and does
- * not try to reuse temporary variables. I leave that to the compiler.
- * (This was a maintenance and robustness nightmare anyway.)
- * The code is pretty obvious: all margins, coordinates, and numbers of tiles
- * are computed before drawing starts.
- * Notice that the margins consist of incompletely drawn tiles. Therefore
- * we need offsets in the data for the left and upper margins.
- * The right and lower margins are also incomplete, but start at offset 0
- * in the data. They just end at awkward offsets.
- * The center block, by definition, consists of fully drawn tiles.
- * Perhaps we could leave out some if's. But why bother? It would decrease
- * robustness.
- */
-void
-xf4bppTileRect( pWin, pTile, alu, planes, x0, y0, w, h, xSrc, ySrc )
-WindowPtr pWin; /* GJA */
-register PixmapPtr pTile ;
-const int alu ;
-const unsigned long int planes ;
-register int x0, y0, w, h ;
-int xSrc ;
-int ySrc ;
-{
-int xOffset ;
-int yOffset ;
-int width, height;
-
-TRACE( ( "xf4bppTileRect(pTile=x%x,alu=x%x,planes=x%02x,x0=%d,y0=%d,w=%d,h=%d,xSrc=%d,ySrc=%d\n",
- pTile, alu, planes, x0, y0, w, h, xSrc, ySrc ) ) ;
-
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXinvert: /* 0xa NOT dst */
- case GXset: /* 0xf 1 */
- xf4bppFillSolid
- ( pWin, 0xFF, alu, planes, x0, y0, w, h ) ;
- case GXnoop: /* 0x5 dst */
- return ;
- default:
- break ;
-}
-
- width = pTile->drawable.width;
- if ( ( xOffset = ( x0 - xSrc ) ) > 0 )
- xOffset %= width ;
- else
- xOffset = width - (( - xOffset ) % width ) ;
- if ( xOffset == width ) xOffset = 0; /* For else case */
-
- height = pTile->drawable.height;
- if ( ( yOffset = ( y0 - ySrc ) ) > 0 )
- yOffset %= height ;
- else
- yOffset = height - (( - yOffset ) % height ) ;
- if ( yOffset == height ) yOffset = 0; /* For else case */
-
- switch ( alu ) {
- case GXcopyInverted: /* 0xc NOT src */
- case GXcopy: /* 0x3 src */
- /* Special Case Code */
- DrawFirstTile( pWin, pTile, x0, y0, w, h,
- alu, planes, xOffset, yOffset ) ;
- /* Here We Double The Size Of The BLIT Each Iteration */
- xf4bppReplicateArea( pWin, x0, y0, planes, w, h,
- MIN( w, pTile->drawable.width ),
- MIN( h, pTile->drawable.height ) ) ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- case GXandReverse: /* 0x2 src AND NOT dst */
- case GXorReverse: /* 0xb src OR NOT dst */
- case GXnand: /* 0xe NOT src OR NOT dst */
- case GXandInverted: /* 0x4 NOT src AND dst */
- case GXand: /* 0x1 src AND dst */
- case GXequiv: /* 0x9 NOT src XOR dst */
- case GXxor: /* 0x6 src XOR dst */
- case GXorInverted: /* 0xd NOT src OR dst */
- case GXor: /* 0x7 src OR dst */
- default:
- {
- register unsigned char *data ;
- register int hcount, vcount ; /* Number of tiles in center */
- int xcount, ycount; /* Temporaries */
- int x1, y1; /* Left upper corner of center */
- int x2, y2; /* Left upper corner of lower right margin */
- int leftmgn, rightmgn, topmgn, botmgn; /* Margins */
-
- int htarget, vtarget ;
-
- data = pTile->devPrivate.ptr;
-
- /* Compute the various sizes and coordinates. */
- leftmgn = MIN( w, width - xOffset ) ;
- x1 = x0 + leftmgn;
- topmgn = MIN( h, height - yOffset ) ;
- y1 = y0 + topmgn;
-
- rightmgn = (w - leftmgn) % width;
- hcount = (w - leftmgn) / width;
- x2 = x0 + w - rightmgn;
- botmgn = (h - topmgn) % height;
- vcount = (h - topmgn) / height;
- y2 = y0 + h - botmgn;
-
- /* We'll use yOffset as offset in data.
- * This requires yOffset != height (ditto xOffset).
- */
- yOffset *= pTile->devKind;
-
- /* Draw top margin, including corners */
- if ( topmgn ) {
- if ( leftmgn ) {
- xf4bppDrawColorImage( pWin, x0, y0, leftmgn, topmgn,
- data + yOffset + xOffset,
- pTile->devKind, alu, planes ) ;
- }
- for ( xcount = hcount, htarget = x1;
- xcount ;
- xcount--, htarget += width )
- {
- xf4bppDrawColorImage( pWin, htarget, y0, width, topmgn,
- data + yOffset,
- pTile->devKind, alu, planes ) ;
- }
- if ( rightmgn ) {
- xf4bppDrawColorImage( pWin, x2, y0, rightmgn, topmgn,
- data + yOffset,
- pTile->devKind, alu, planes ) ;
- }
- }
-
- /* Draw bottom margin, including corners */
- if ( botmgn ) {
- if ( leftmgn ) {
- xf4bppDrawColorImage( pWin, x0, y2, leftmgn, botmgn,
- data + xOffset,
- pTile->devKind, alu, planes ) ;
- }
- for ( xcount = hcount, htarget = x1;
- xcount ;
- xcount--, htarget += width )
- {
- xf4bppDrawColorImage( pWin, htarget, y2, width, botmgn,
- data,
- pTile->devKind, alu, planes ) ;
- }
- if ( rightmgn ) {
- xf4bppDrawColorImage( pWin, x2, y2, rightmgn, botmgn,
- data,
- pTile->devKind, alu, planes ) ;
- }
- }
-
- /* Draw left margin, excluding corners */
- if ( leftmgn ) {
- for ( ycount = vcount, vtarget = y1 ;
- ycount ;
- ycount--, vtarget += height )
- {
- xf4bppDrawColorImage( pWin, x0, vtarget, leftmgn, height,
- data + xOffset,
- pTile->devKind, alu, planes ) ;
- }
- }
-
- /* Draw right margin, excluding corners */
- if ( rightmgn ) {
- for ( ycount = vcount, vtarget = y1 ;
- ycount ;
- ycount--, vtarget += height )
- {
- xf4bppDrawColorImage( pWin, x2, vtarget, rightmgn, height,
- data,
- pTile->devKind, alu, planes ) ;
- }
- }
-
- /* Draw center consisting of full tiles */
- for ( ycount = vcount, vtarget = y1 ;
- ycount ;
- ycount--, vtarget += height )
- {
- for ( xcount = hcount, htarget = x1 ;
- xcount ;
- xcount--, htarget += width )
- {
- xf4bppDrawColorImage( pWin, htarget, vtarget, width, height,
- data,
- pTile->devKind, alu, planes ) ;
-
- }
- }
- } } /* Block + switch */
-}
diff --git a/hw/xfree86/xf4bpp/ibmTrace.h b/hw/xfree86/xf4bpp/ibmTrace.h
deleted file mode 100644
index f99ce33e0..000000000
--- a/hw/xfree86/xf4bpp/ibmTrace.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ibmTrace.h,v 1.2 1998/07/25 16:59:28 dawes Exp $ */
-
-
-
-
-
-/* $XConsortium: ibmTrace.h /main/3 1996/02/21 17:56:27 kaleb $ */
-
-#define TRACE(x) /* empty */
-
diff --git a/hw/xfree86/xf4bpp/mfbbres.c b/hw/xfree86/xf4bpp/mfbbres.c
deleted file mode 100644
index 300256021..000000000
--- a/hw/xfree86/xf4bpp/mfbbres.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbbres.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* GJA -- modified this file for vga16 */
-/* $XConsortium: mfbbres.c /main/5 1996/02/21 17:56:30 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "miline.h"
-#include "wm3.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-xf4bppBresS(addrlbase, nlwidth, signdx, signdy, axis, x1, y1, e, e1, e2, len)
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl; /* bitmask long pointer
- *dont* * cast to char pointer */
- register PixelType bit; /* current bit being set/cleared/etc. */
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
-
- register int e3 = e2-e1;
-
- /* point to longword containing first point */
- addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
-
- if (!len)
- return;
-
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while(len--)
- {
- UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- addrl += yinc;
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit; addrl++; }
- }
- }
- else
- {
- while(len--)
- {
- UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- addrl += yinc;
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl--; }
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit; addrl++; }
- e += e3;
- }
- addrl += yinc;
- }
- }
- else
- {
- while(len--)
- {
- UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl--; }
- e += e3;
- }
- addrl += yinc;
- }
- }
- } /* else Y_AXIS */
-}
diff --git a/hw/xfree86/xf4bpp/mfbbresd.c b/hw/xfree86/xf4bpp/mfbbresd.c
deleted file mode 100644
index 560995957..000000000
--- a/hw/xfree86/xf4bpp/mfbbresd.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbbresd.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* GJA -- modified this file for vga16 */
-/* $XConsortium: mfbbresd.c /main/5 1996/02/21 17:56:34 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "miline.h"
-#include "wm3.h"
-#include "xf86.h"
-
-/* Dashed bresenham line */
-
-#define NO_INK (-1) /* GJA -- means: dash is off */
-
-#define StepDash\
- if (!--dashRemaining) { \
- if (++ dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- ink = fgink; \
- if (dashIndex & 1) \
- ink = bgink; \
- if (isDoubleDash) \
- WM3_SET_INK(ink); \
- }
-
-void
-xf4bppBresD(pDrawable, fgink, bgink,
- pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrlbase, nlwidth,
- signdx, signdy, axis, x1, y1, e, e1, e2, len)
-DrawablePtr pDrawable;
-int fgink, bgink;
-int *pdashIndex; /* current dash */
-unsigned char *pDash; /* dash list */
-int numInDashList; /* total length of dash list */
-int *pdashOffset; /* offset into current dash */
-int isDoubleDash;
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-{
- IOADDRESS REGBASE =
- xf86Screens[pDrawable->pScreen->myNum]->domainIOBase + 0x300;
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl;
- register int e3 = e2-e1;
- register unsigned long bit;
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- int ink;
-
- fgink &= 0x0F; bgink &= 0x0F; /* GJA -- so they're != NO_INK */
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- dashRemaining = pDash[dashIndex] - dashOffset;
- ink = fgink;
- if (!isDoubleDash)
- bgink = NO_INK;
- if (dashIndex & 1)
- ink = bgink;
- if ( ink != NO_INK ) WM3_SET_INK(ink);
-
- /* point to longword containing first point */
- addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while(len--)
- {
- if ( ink != NO_INK ) UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- addrl += yinc;
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit; addrl++; }
- StepDash
- }
- }
- else
- {
- while(len--)
- {
-
- if ( ink != NO_INK ) UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- addrl += yinc;
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl--; }
- StepDash
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- if ( ink != NO_INK ) UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit; addrl++; }
- e += e3;
- }
- addrl += yinc;
- StepDash
- }
- }
- else
- {
- while(len--)
- {
-
- if ( ink != NO_INK ) UPDRW(addrl,bit);
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl--; }
- e += e3;
- }
- addrl += yinc;
- StepDash
- }
- }
- } /* else Y_AXIS */
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c
deleted file mode 100644
index 4c4d8eab6..000000000
--- a/hw/xfree86/xf4bpp/mfbfillarc.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.6 2003/11/03 05:11:56 tsi Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* GJA -- Took mfb code and modified it. */
-
-/* $XConsortium: mfbfillarc.c /main/4 1996/02/21 17:56:37 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "mifillarc.h"
-#include "wm3.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-static void
-v16FillEllipseSolid
-(
- DrawablePtr pDraw,
- xArc *arc
-)
-{
- int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- register int slw;
- miFillArcRec info;
- int *addrlt, *addrlb;
- register int *addrl;
- register int n;
- int nlwidth;
- register int xpos;
- int startmask, endmask, nlmiddle;
-
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- addrlt = (int *)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
- nlwidth = (int)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
- }
- else
- {
- addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
- nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
- }
-
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- while (y)
- {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
- addrl = addrlt + (xpos >> PWSH);
- if (((xpos & PIM) + slw) < PPW)
- {
- maskpartialbits(xpos, slw, startmask);
- UPDRW(addrl,startmask);
- if (miFillArcLower(slw))
- {
- addrl = addrlb + (xpos >> PWSH);
- UPDRW(addrl,startmask);
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- if (startmask)
- {
- UPDRW(addrl,startmask); addrl++;
- }
- n = nlmiddle;
- while (n--) {
- UPDRW(addrl,~0); addrl++;
- }
- if (endmask)
- {
- UPDRW(addrl,endmask);
- }
- if (!miFillArcLower(slw))
- continue;
- addrl = addrlb + (xpos >> PWSH);
- if (startmask)
- {
- UPDRW(addrl,startmask); addrl++;
- }
- n = nlmiddle;
- while (n--) {
- UPDRW(addrl,~0); addrl++;
- }
- if (endmask)
- {
- UPDRW(addrl,endmask);
- }
- }
-}
-
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) \
- { \
- width = xr - xl + 1; \
- addrl = addr + (xl >> PWSH); \
- if (((xl & PIM) + width) < PPW) \
- { \
- maskpartialbits(xl, width, startmask); \
- UPDRW(addrl,startmask); \
- } \
- else \
- { \
- maskbits(xl, width, startmask, endmask, nlmiddle); \
- if (startmask) \
- { \
- UPDRW(addrl,startmask); addrl++; \
- } \
- n = nlmiddle; \
- while (n--) { \
- UPDRW(addrl,~0); addrl++; \
- } \
- if (endmask) \
- { \
- UPDRW(addrl,endmask); \
- } \
- } \
- }
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) \
- { \
- FILLSPAN(xl, xr, addr); \
- } \
- else \
- { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-v16FillArcSliceSolidCopy
-(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc
-)
-{
- register int *addrl;
- register int n;
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
- int *addrlt, *addrlb;
- int nlwidth;
- int width;
- int startmask, endmask, nlmiddle;
-
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- addrlt = (int *)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
- nlwidth = (int)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
- }
- else
- {
- addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
- nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
- }
-
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0)
- {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrlt);
- }
- if (miFillSliceLower(slice))
- {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrlb);
- }
- }
-}
-
-static void
-xf4bppPolyFillArcSolid
-(
- register DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-)
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- RegionPtr cclip;
-#if 0
- mfbPrivGC *priv;
- int rop;
-
- priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
- rop = priv->rop;
- if ((rop == RROP_NOP) || !(pGC->planemask & 1))
-#else
- if ( !(pGC->planemask & 0x0F))
-#endif
- return;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- box.x2 = box.x1 + (int)arc->width + 1;
- box.y2 = box.y1 + (int)arc->height + 1;
- if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
- {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- DO_WM3(pGC,v16FillEllipseSolid(pDraw, arc))
- else
- DO_WM3(pGC,v16FillArcSliceSolidCopy(pDraw, pGC, arc))
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
-
-void
-xf4bppPolyFillArc(pDraw, pGC, narcs, parcs)
- register DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- if ( !xf86Screens[pDraw->pScreen->myNum]->vtSema || (pGC->fillStyle != FillSolid) ) {
- miPolyFillArc(pDraw, pGC, narcs, parcs);
- } else {
- xf4bppPolyFillArcSolid(pDraw, pGC, narcs, parcs);
- }
-}
diff --git a/hw/xfree86/xf4bpp/mfbhrzvert.c b/hw/xfree86/xf4bpp/mfbhrzvert.c
deleted file mode 100644
index 3d6c3df52..000000000
--- a/hw/xfree86/xf4bpp/mfbhrzvert.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbhrzvert.c,v 1.3 1999/06/06 08:48:55 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* GJA -- modified this file for vga16 */
-/* $XConsortium: mfbhrzvert.c /main/3 1996/02/21 17:56:41 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "wm3.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-
-void
-xf4bppHorzS(addrl, nlwidth, x1, y1, len)
-register PixelType *addrl; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-{
- register PixelType startmask;
- register PixelType endmask;
- register int nlmiddle;
-
-
- /* force the line to go left to right
- but don't draw the last point
- */
- if (len < 0)
- {
- x1 += len;
- x1 += 1;
- len = -len;
- }
-
- addrl = mfbScanline(addrl, x1, y1, nlwidth);
-
- /* all bits inside same longword */
- if ( ((x1 & PIM) + len) < PPW)
- {
- maskpartialbits(x1, len, startmask);
- UPDRW(addrl,startmask);
- }
- else
- {
- maskbits(x1, len, startmask, endmask, nlmiddle);
- if (startmask) {
- UPDRW(addrl,startmask); addrl++;
- }
- Duff (nlmiddle, UPDRW(addrl,~0); addrl++);
- if (endmask) {
- UPDRW(addrl,endmask);
- }
- }
-}
-
-/* vertical solid line
- this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
- better code. sigh. we know that len will never be 0 or 1, so
- it's OK to use it.
-*/
-
-void
-xf4bppVertS(addrl, nlwidth, x1, y1, len)
-register PixelType *addrl; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int x1, y1; /* initial point */
-register int len; /* length of line */
-{
- register PixelType bitmask;
-
- addrl = mfbScanline(addrl, x1, y1, nlwidth);
-
- if (len < 0)
- {
- nlwidth = -nlwidth;
- len = -len;
- }
-
- bitmask = mask[x1 & PIM];
- Duff(len, UPDRW(addrl,bitmask); addrl += nlwidth);
-}
diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c
deleted file mode 100644
index a5d5b5b37..000000000
--- a/hw/xfree86/xf4bpp/mfbimggblt.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.9 2003/11/17 22:20:42 dawes Exp $ */
-
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: mfbimggblt.c /main/5 1996/02/21 17:56:44 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "dixfontstr.h"
-#include "ppcGCstr.h"
-#include "wm3.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-/*
- we should eventually special-case fixed-width fonts for ImageText.
-
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
- to avoid source proliferation, this file is compiled
-three times:
- MFBIMAGEGLYPHBLT OPEQ
- mfbImageGlyphBltWhite |=
- mfbImageGlyphBltBlack &=~
-
- the register allocations for startmask and endmask may not
-be the right thing. are there two other deserving candidates?
-xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
-*/
-
-/* Forward declarations -- GJA */
-static void doImageGlyphBlt(
- DrawablePtr,
- GC *,
- int,
- int,
- unsigned int,
- CharInfoPtr *,
- unsigned char *,
- ExtentInfoRec *
-);
-
-void
-xf4bppImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- xRectangle backrect;/* backing rectangle to paint.
- in the general case, NOT necessarily
- the same as the string's bounding box
- */
- /* GJA -- I agree, this ALL should be moved to GC validation. */
- if ( (pDrawable->type != DRAWABLE_WINDOW) || (pGC->alu != GXcopy) ||
- !xf86Screens[pDrawable->pScreen->myNum]->vtSema ||
- ((pGC->font) &&
- (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)) ) {
- miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- } else {
- ppcPrivGC *pPrivGC;
- int oldfillStyle, oldfg, oldalu;
-
- if (!(pGC->planemask & 0x0F))
- return;
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- backrect.x = x;
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.width = info.overallWidth;
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
-
- pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
- oldfillStyle = pPrivGC->colorRrop.fillStyle; /* GJA */
- oldfg = pPrivGC->colorRrop.fgPixel; /* GJA */
- oldalu = pPrivGC->colorRrop.alu; /* GJA */
-
- pPrivGC->colorRrop.fillStyle = FillSolid; /* GJA */
- pPrivGC->colorRrop.fgPixel = pGC->bgPixel; /* GJA */
- pGC->fgPixel = pGC->bgPixel;
- pPrivGC->colorRrop.alu = GXcopy; /* GJA */
- pGC->alu = GXcopy;
-
- /* Required fields:
- * colorRrop.alu, colorRrop.planemask, colorRrop.fgPixel
- */
- xf4bppPolyFillRect(pDrawable, pGC, 1, &backrect);
-
- pPrivGC->colorRrop.fgPixel = oldfg; /* GJA */
- pGC->fgPixel = oldfg;
-
- /* the faint-hearted can open their eyes now */
-
- DO_WM3(pGC,doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci,
- pglyphBase,&info))
-
- pPrivGC->colorRrop.fillStyle = oldfillStyle; /* GJA */
- pPrivGC->colorRrop.alu = oldalu; /* GJA */
- pGC->alu = oldalu;
- }
-
-}
-
-static void
-doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- unsigned char *pglyphBase; /* start of array of glyphs */
- ExtentInfoRec* infop; /* used by QueryGlyphExtents() */
-{
- BoxRec bbox; /* string's bounding box */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- CARD32 *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register CARD32 *pdst;
- /* pointer to current longword in dst */
-
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
-
- /* used for putting down glyph */
- register unsigned int tmpSrc;
- /* for getting bits from glyph */
- register int startmask;
- register int endmask;
-
- register int nFirst;/* bits of glyph in current longword */
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- pdstBase = (CARD32 *)
- (((PixmapPtr)(pDrawable->pScreen->devPrivate))->devPrivate.ptr);
- widthDst = (int)
- (((PixmapPtr)(pDrawable->pScreen->devPrivate))->devKind) >> 2;
- }
- else
- {
- pdstBase = (CARD32 *)(((PixmapPtr)pDrawable)->devPrivate.ptr);
- widthDst = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
- }
-
- x += xorg;
- y += yorg;
- bbox.x1 = x + infop->overallLeft;
- bbox.x2 = x + infop->overallRight;
- bbox.y1 = y - infop->overallAscent;
- bbox.y2 = y + infop->overallDescent;
-
- /* UNCLEAN CODE
- we know the mfbPolyFillRect uses only three fields in
- devPrivate[mfbGCPrivateIndex].ptr, two of which (the rotated
- tile/stipple and the ropFillArea) are
- irrelevant for solid filling, so we just poke the FillArea
- field. the GC is now in an inconsistent state, but we'll fix
- it as soon as PolyFillRect returns. fortunately, the server
- is single threaded.
-
- NOTE:
- if you are not using the standard mfbFillRectangle code, you
- need to poke any fields in the GC the rectangle stuff need
- (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGCPrivateIndex].ptr
- (probably rop or ropFillArea.) You could just call ValidateGC,
- but that is usually not a cheap thing to do.
- */
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
- {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = pdstBase + (widthDst * y) + (x >> PWSH);
- xchar = x & PIM;
-
- while(nglyph--)
- {
- pci = *ppci;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- h = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- /* start at top scanline of glyph */
- pdst = pdstBase - (pci->metrics.ascent * widthDst);
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PIM)
- {
- pdst++;
- xoff &= PIM;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- if ((xoff + w) <= PPW)
- {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
-
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- }
- else
- {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
- UPDRW(&(pdst[1]),(SCRLEFT(tmpSrc, nFirst) & endmask));
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- } /* glyph crosses longwords boundary */
-
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar -= PPW;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- TEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- unsigned int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
-#if GETLEFTBITS_ALIGNMENT > 1
- int getWidth; /* bits to get from glyph */
-#endif
-
- if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
- return;
-
- pdstBase = pdstBase + (widthDst * y) + (x >> PWSH);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i=0; i<nglyph; i++)
- {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar &= PIM;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while(nbox--)
- {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for(i=0; i<nglyph; i++)
- {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- h = bottomEdge - topEdge;
- if (h <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- pglyph += (glyphRow * widthGlyph);
-
- pdst = ppos[i].pdstBase - ((y-topEdge) * widthDst);
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
-#if GETLEFTBITS_ALIGNMENT > 1
- getWidth = w + glyphCol;
-#endif
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST)
- {
- xoff &= PIM;
- pdst++;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- if ((xoff + w) <= PPW)
- {
- maskpartialbits(xoff, w, startmask);
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- }
- else
- {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
- UPDRW(&(pdst[1]),(SCRLEFT(tmpSrc, nFirst) & endmask));
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- }
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
- default:
- break;
- }
-}
-
diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c
deleted file mode 100644
index c2717599f..000000000
--- a/hw/xfree86/xf4bpp/mfbline.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* GJA -- modified this file for vga16 */
-/* $XConsortium: mfbline.c /main/4 1996/02/21 17:56:48 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "miline.h"
-#include "vgaVideo.h"
-#include "wm3.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-#ifdef POLYSEGMENT
-static void DoV16SegmentSS(
- DrawablePtr, GCPtr, int, xSegment*
-);
-
-void
-xf4bppSegmentSS (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-{
- if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
- miPolySegment(pDrawable, pGC, nseg, pSeg);
- } else {
- DO_WM3(pGC,DoV16SegmentSS (pDrawable, pGC, nseg, pSeg));
- }
-}
-
-#else
-static void DoV16LineSS(
- DrawablePtr, GCPtr, int, int, DDXPointPtr
-);
-
-void
-xf4bppLineSS (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-{
- if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
- miZeroLine(pDrawable, pGC, mode, npt, pptInit);
- } else {
- DO_WM3(pGC,DoV16LineSS (pDrawable, pGC, mode, npt, pptInit));
- }
-}
-#endif
-
-static void
-#ifdef POLYSEGMENT
-DoV16SegmentSS (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-DoV16LineSS (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* pointer to start of drawable */
-#ifndef POLYSEGMENT
- PixelType *addrl; /* address of destination pixmap */
-#endif
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- /* a bunch of temporaries */
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
-#ifndef POLYSEGMENT
- int alu = pGC->alu; /* GJA */
-#endif
-
- if (!(pGC->planemask & 0x0F))
- return;
-
- cclip = pGC->pCompositeClip;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- nlwidth = BYTES_PER_LINE(pDrawable) >> 2; /* GJA */
- addrlBase = (PixelType *)VIDBASE(pDrawable); /* GJA */
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2)
- {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- if (nbox)
- {
- /* stop when lower edge of box is beyond end of line */
- while((nbox) && (y2 >= pbox->y1))
- {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2))
- {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- {
- xf4bppVertS (addrlBase, nlwidth,
- x1, y1t, y2t-y1t);
- }
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- }
- else if (y1 == y2) /* horizontal line */
- {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2)
- {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while( (nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1))
- {
- int tmp;
-
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while((nbox) && (pbox->y1 == tmp))
- {
- int x1t, x2t;
-
- if (pbox->x2 <= x1)
- {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2)
- {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- {
- xf4bppHorzS (addrlBase, nlwidth,
- x1t, y1, x2t-x1t);
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- xf4bppBresS (addrlBase, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, len);
- break;
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- xf4bppBresS (addrlBase, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
-
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- PixelType _mask;
-
- if (alu == RROP_BLACK)
- _mask = rmask[x2 & PIM];
- else
- _mask = mask[x2 & PIM];
-
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- addrl = mfbScanline(addrlBase, x2, y2, nlwidth);
- UPDRW(addrl,_mask);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-#ifdef POLYSEGMENT
-static void DoV16SegmentSD(
- DrawablePtr, GCPtr, int, xSegment*
-);
-
-void
-xf4bppSegmentSD (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-{
- if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
- miPolySegment(pDrawable, pGC, nseg, pSeg);
- } else {
- DO_WM3(pGC,DoV16SegmentSD (pDrawable, pGC, nseg, pSeg));
- }
-}
-
-#else
-static void DoV16LineSD(
- DrawablePtr, GCPtr, int, int, DDXPointPtr
-);
-
-void
-xf4bppLineSD (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-{
- if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
- miZeroDashLine(pDrawable, pGC, mode, npt, pptInit);
- } else {
- DO_WM3(pGC,DoV16LineSD (pDrawable, pGC, mode, npt, pptInit));
- }
-}
-#endif
-
-static void
-#ifdef POLYSEGMENT
-DoV16SegmentSD (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-DoV16LineSD( pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrl; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- int fgink, bgink; /* GJA */
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
-
- if (!(pGC->planemask & 0x0F))
- return;
-
- cclip = pGC->pCompositeClip;
- fgink = bgink = pGC->fgPixel; /* GJA */
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- nlwidth = BYTES_PER_LINE(pDrawable) >> 2; /* GJA */
- addrl = (PixelType *)VIDBASE(pDrawable); /* GJA */
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- if (isDoubleDash)
- bgink = pGC->bgPixel; /* GJA */
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- xf4bppBresD (pDrawable, fgink, bgink,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- break;
-#else
- xf4bppBresD (pDrawable, fgink, bgink,
- &dashIndex, pDash, numInDashList,
- &dashOffset, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- goto dontStep;
-#endif
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else /* have to clip */
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- if (clip1)
- {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- xf4bppBresD (pDrawable, fgink, bgink,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- unsigned long _mask;
-
- _mask = mask[x2 & PIM];
- addrl = mfbScanline(addrl, x2, y2, nlwidth);
- UPDRW(addrl,_mask);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
-
-
-#if 0
-#ifndef POLYSEGMENT
-/*
- the clipping code could be cleaned up some; most of its
-mess derives from originally being inline in the line code,
-then pulled out to make clipping dashes easier.
-*/
-
-int
-mfbClipLine(pbox, box,
- ppt1Orig, ppt1, ppt2,
- adx, ady, signdx, signdy, axis,
- pclip1, pclip2)
-BoxPtr pbox; /* box to clip to */
-BoxRec box; /* box to do calculations with */
-DDXPointPtr ppt1Orig, ppt1, ppt2;
-int adx, ady;
-int signdx, signdy;
-register int axis;
-int *pclip1, *pclip2;
-{
- DDXPointRec pt1Orig, pt1, pt2;
- register int swapped = 0;
- int clipDone = 0;
- register unsigned int utmp;
- register int oc1, oc2;
- int clip1, clip2;
-
- pt1Orig = *ppt1Orig;
- pt1 = *ppt1;
- pt2 = *ppt2;
- clip1 = 0;
- clip2 = 0;
-
- do
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, pt1.x, pt1.y, pbox);
- OUTCODES(oc2, pt2.x, pt2.y, pbox);
-
- if (oc1 & oc2)
- clipDone = -1;
- else if ((oc1 | oc2) == 0)
- {
- clipDone = 1;
- if (swapped)
- {
- SWAPPT(pt1, pt2);
- SWAPINT(oc1, oc2);
- SWAPINT(clip1, clip2);
- }
- }
- else /* have to clip */
- {
- /* only clip one point at a time */
- if (!oc1)
- {
- SWAPPT(pt1, pt2);
- SWAPINT(oc1, oc2);
- SWAPINT(clip1, clip2);
- swapped = !swapped;
- }
-
- clip1 |= oc1;
- if (oc1 & OUT_LEFT)
- {
- pt1.x = box.x1;
- utmp = abs(box.x1 - pt1Orig.x);
- utmp *= ady;
- if(axis==X_AXIS)
- {
- pt1.y = pt1Orig.y + SignTimes(signdy, round(utmp, adx));
- }
- else
- {
- utmp <<= 1;
- if (swapped)
- utmp += ady;
- else
- utmp -= ady;
- pt1.y = pt1Orig.y + SignTimes(signdy, ceiling(utmp, 2*adx));
- if (swapped)
- pt1.y -= signdy;
- }
- }
- else if (oc1 & OUT_ABOVE)
- {
- pt1.y = box.y1;
- utmp = abs(box.y1 - pt1Orig.y);
- utmp *= adx;
- if (axis == Y_AXIS)
- {
- pt1.x = pt1Orig.x + SignTimes(signdx, round(utmp, ady));
- }
- else
- {
- utmp <<= 1;
- if (swapped)
- utmp += adx;
- else
- utmp -= adx;
- pt1.x = pt1Orig.x + SignTimes(signdx, ceiling(utmp, 2*ady));
- if (swapped)
- pt1.x -= signdx;
- }
- }
- else if (oc1 & OUT_RIGHT)
- {
- pt1.x = box.x2;
- utmp = abs(pt1Orig.x - box.x2);
- utmp *= ady;
- if (axis == X_AXIS)
- {
- pt1.y = pt1Orig.y + SignTimes(signdy, round(utmp, adx));
- }
- else
- {
- utmp <<= 1;
- if (swapped)
- utmp += ady;
- else
- utmp -= ady;
- pt1.y = pt1Orig.y + SignTimes(signdy, ceiling(utmp, 2*adx));
- if (swapped)
- pt1.y -= signdy;
- }
- }
- else if (oc1 & OUT_BELOW)
- {
- pt1.y = box.y2;
- utmp = abs(pt1Orig.y - box.y2);
- utmp *= adx;
- if (axis == Y_AXIS)
- {
- pt1.x = pt1Orig.x + SignTimes(signdx, round(utmp, ady));
- }
- else
- {
- utmp <<= 1;
- if (swapped)
- utmp += adx;
- else
- utmp -= adx;
- pt1.x = pt1Orig.x + SignTimes(signdx, ceiling(utmp, 2*ady));
- if (swapped)
- pt1.x -= signdx;
- }
- }
- } /* else have to clip */
- } while(!clipDone);
- *ppt1 = pt1;
- *ppt2 = pt2;
- *pclip1 = clip1;
- *pclip2 = clip2;
-
- return clipDone;
-}
-#endif
-#endif
diff --git a/hw/xfree86/xf4bpp/mfbzerarc.c b/hw/xfree86/xf4bpp/mfbzerarc.c
deleted file mode 100644
index 7ca32d903..000000000
--- a/hw/xfree86/xf4bpp/mfbzerarc.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbzerarc.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
-
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-/* GJA -- Took mfb code and modified it. */
-
-/* $XConsortium: mfbzerarc.c /main/4 1996/02/21 17:56:52 kaleb $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "mizerarc.h"
-#include "wm3.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-/*
- * Note, LEFTMOST must be the bit leftmost in the actual screen
- * representation. This depends on both BITMAP_BIT_ORDER and
- * IMAGE_BYTE_ORDER
- * DHD 10/92
- */
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#if (IMAGE_BYTE_ORDER == MSBFirst)
-#define LEFTMOST ((unsigned int) 0x80000000)
-#else
-#define LEFTMOST ((unsigned int) 0x80)
-#endif
-#else
-#if (IMAGE_BYTE_ORDER == LSBFirst)
-#define LEFTMOST ((unsigned int) 1)
-#else
-#define LEFTMOST ((unsigned int) 0x1000000)
-#endif
-#endif
-
-#define PixelateWhite(addr,off) \
-{ \
- register int *tmpaddr = &((addr)[(off)>>PWSH]); \
- UPDRW(tmpaddr,SCRRIGHT (LEFTMOST, ((off) & PIM))); \
-}
-#define PixelateBlack(addr,off) \
-{ \
- register int *tmpaddr = &((addr)[(off)>>PWSH]); \
- UPDRW(tmpaddr,~(SCRRIGHT (LEFTMOST, ((off) & PIM)))); \
-}
-
-#define Pixelate(base,off) \
-{ \
- paddr = base + ((off)>>PWSH); \
- pmask = SCRRIGHT(LEFTMOST, (off) & PIM); \
- UPDRW(paddr,(pixel & pmask)); \
-}
-
-#define DoPix(bit,base,off) if (msk & bit) Pixelate(base,off);
-
-static void
-v16ZeroArcSS
-(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc
-)
-{
- miZeroArcRec info;
- Bool do360;
- register int x, y, a, b, d, msk;
- register int k1, k3, dx, dy;
- int *addrl;
- int *yorgl, *yorgol;
- unsigned long pixel;
- int nlwidth, yoffset, dyoffset;
- int pmask;
- register int *paddr;
-
- if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop ==
- RROP_BLACK)
- pixel = 0;
- else
- pixel = ~0UL;
-
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- addrl = (int *)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
- nlwidth = (int)
- (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
- }
- else
- {
- addrl = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
- nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
- }
-
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
- yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
- info.xorg += pDraw->x;
- info.xorgo += pDraw->x;
- MIARCSETUP();
- yoffset = y ? nlwidth : 0;
- dyoffset = 0;
- msk = info.initialMask;
- if (!(arc->width & 1))
- {
- DoPix(2, yorgl, info.xorgo);
- DoPix(8, yorgol, info.xorgo);
- }
- if (!info.end.x || !info.end.y)
- {
- msk = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1))
- {
- int xoffset = nlwidth;
- int *yorghl = yorgl + (info.h * nlwidth);
- int xorghp = info.xorg + info.h;
- int xorghn = info.xorg - info.h;
-
- while (1)
- {
- PixelateWhite(yorgl + yoffset, info.xorg + x);
- PixelateWhite(yorgl + yoffset, info.xorg - x);
- PixelateWhite(yorgol- yoffset, info.xorg - x);
- PixelateWhite(yorgol - yoffset, info.xorg + x);
- if (a < 0)
- break;
- PixelateWhite(yorghl - xoffset, xorghp - y);
- PixelateWhite(yorghl - xoffset, xorghn + y);
- PixelateWhite(yorghl + xoffset, xorghn + y);
- PixelateWhite(yorghl + xoffset, xorghp - y);
- xoffset += nlwidth;
- MIARCCIRCLESTEP(yoffset += nlwidth;);
- }
- x = info.w;
- yoffset = info.h * nlwidth;
- }
- else if (do360)
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- Pixelate(yorgl + yoffset, info.xorg + x);
- Pixelate(yorgl + yoffset, info.xorgo - x);
- Pixelate(yorgol - yoffset, info.xorgo - x);
- Pixelate(yorgol - yoffset, info.xorg + x);
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- }
- else
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- if ((x == info.start.x) || (y == info.start.y))
- {
- msk = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(1, yorgl + yoffset, info.xorg + x);
- DoPix(2, yorgl + yoffset, info.xorgo - x);
- DoPix(4, yorgol - yoffset, info.xorgo - x);
- DoPix(8, yorgol - yoffset, info.xorg + x);
- if ((x == info.end.x) || (y == info.end.y))
- {
- msk = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- msk = info.start.mask;
- DoPix(1, yorgl + yoffset, info.xorg + x);
- DoPix(4, yorgol - yoffset, info.xorgo - x);
- if (arc->height & 1)
- {
- DoPix(2, yorgl + yoffset, info.xorgo - x);
- DoPix(8, yorgol - yoffset, info.xorg + x);
- }
-}
-
-static void
-xf4bppZeroPolyArcSS
-(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-)
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- RegionPtr cclip;
-
- if (!pGC->planemask & 0x0F)
- return;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miCanZeroArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- box.x2 = box.x1 + (int)arc->width + 1;
- box.y2 = box.y1 + (int)arc->height + 1;
- if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
- v16ZeroArcSS(pDraw, pGC, arc);
- else
- miZeroPolyArc(pDraw, pGC, 1, arc);
- }
- else
- miPolyArc(pDraw, pGC, 1, arc);
- }
-}
-
-void
-xf4bppZeroPolyArc(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- if ( !xf86Screens[pDraw->pScreen->myNum]->vtSema ) {
- miZeroPolyArc(pDraw, pGC, narcs, parcs);
- } else {
- DO_WM3(pGC,xf4bppZeroPolyArcSS(pDraw, pGC, narcs, parcs));
- }
-}
diff --git a/hw/xfree86/xf4bpp/offscreen.c b/hw/xfree86/xf4bpp/offscreen.c
deleted file mode 100644
index 1d118863f..000000000
--- a/hw/xfree86/xf4bpp/offscreen.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/offscreen.c,v 1.5 2001/08/01 00:44:56 tsi Exp $ */
-/*
- * Copyright 1993 Gerrit Jan Akkerman
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Gerrit Jan Akkerman not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * GERRIT JAN AKKERMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL GERRIT JAN AKKERMAN BE LIABLE FOR ANY SPECIAL, INDIRECT
- * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
-*/
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: offscreen.c /main/4 1996/02/21 17:56:55 kaleb $ */
-
-#include "xf4bpp.h"
-#include "vgaVideo.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#define saved_screen(pWin) \
- ((unsigned char *)(((PixmapPtr)((pWin)->drawable.pScreen->devPrivate))->devPrivate.ptr))
-
-#define SAVEDSCREEN(pWin, x, y) \
- (*(saved_screen(pWin) + (y) * (BYTES_PER_LINE(pWin)) + (x)))
-
-#define DO_ROP(src,dst,alu,planes) \
- ((dst) = do_rop((src),(dst),(alu),(planes)))
-
-/* NOTE:
- * The following to functions don't do anything. They're just there to
- * provide a stable interface to the rest of the system.
- */
-
-static int
-do_rop
-(
- int src,
- int dst,
- int alu,
- const unsigned long planes
-)
-{
- int _dst; /* New dst */
-
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- _dst = 0; break ;
- case GXinvert: /* 0xa NOT dst */
- _dst = ~dst; break ;
- case GXset: /* 0xf 1 */
- _dst = src; break ;
- default:
- case GXnoop: /* 0x5 dst */
- return dst;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- _dst = ~src & ~dst; break ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- _dst = ~src & dst; break ;
- case GXand: /* 0x1 src AND dst */
- _dst = src & dst; break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- _dst = ~src ^ dst; break ;
- case GXxor: /* 0x6 src XOR dst */
- _dst = src ^ dst; break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- _dst = src & ~dst; break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- _dst = ~src | ~dst; break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- _dst = src | ~dst; break ;
- case GXorInverted: /* 0xd NOT src OR dst */
- _dst = ~src | dst; break ;
- case GXor: /* 0x7 src OR dst */
- _dst = src | dst; break ;
- case GXcopyInverted: /* 0xc NOT src */
- _dst = ~src; break ;
- case GXcopy: /* 0x3 src */
- _dst = src; break ;
- }
- return (dst & ~planes) | (_dst & planes);
-}
-
-/* File vgaBitBlt.c */
-void
-xf4bppOffBitBlt( pWin, alu, writeplanes, x0, y0, x1, y1, w, h )
-WindowPtr pWin; /* GJA */
-const int alu, writeplanes ;
-register int x0 ;
-int y0 ;
-register int x1 ;
-int y1 ;
-register int w, h ;
-{
- int x,y;
-
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXinvert: /* 0xa NOT dst */
- case GXset: /* 0xf 1 */
- xf4bppOffFillSolid( pWin, VGA_ALLPLANES, alu, writeplanes,
- x0, y0, w, h ) ;
- case GXnoop: /* 0x5 dst */
- return ;
- default:
- break ;
- }
-
- if ( (w <= 0) || (h <= 0) ) return;
-
- for ( y = 0 ; y < h ; y++ ) {
- for ( x = 0 ; x < w ; x++ ) {
- DO_ROP(SAVEDSCREEN(pWin,x0+x,y0+y),SAVEDSCREEN(pWin,x1+x,y1+y),
- alu,writeplanes);
- }
- }
-}
-
-/* for file vgaImages.c */
-
-void
-xf4bppOffDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes )
-WindowPtr pWin; /* GJA */
-int x, y ;
-register int w, h ;
-unsigned char *data ;
-register int RowIncrement ;
-const int alu ;
-const unsigned long int planes ;
-{
- int dx,dy;
-
- for ( dy = 0 ; dy < h ; dy++ ) {
- for ( dx = 0 ; dx < w ; dx++ ) {
- DO_ROP( data[dy * RowIncrement + dx],
- SAVEDSCREEN(pWin,x+dx,y+dy), alu, planes);
- }
- }
-}
-
-void
-xf4bppOffReadColorImage( pWin, x, y, lx, ly, data, RowIncrement )
-WindowPtr pWin; /* GJA */
-int x, y ;
-int lx, ly ;
-unsigned char *data ;
-int RowIncrement ;
-{
- int dx, dy;
-
- if ( ( lx <= 0 ) || ( ly <= 0 ) )
- return ;
-
- for ( dy = 0 ; dy < ly ; dy++ ) {
- for ( dx = 0 ; dx < lx ; dx++ ) {
- data[dy*RowIncrement+dx] = SAVEDSCREEN(pWin,x+dx,y+dy);
- }
- }
-}
-
-/* For file vgaSolid.c */
-
-void xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
-WindowPtr pWin; /* GJA */
-unsigned long int color ;
-const int alu ;
-unsigned long int planes ;
-register int x0 ;
-register const int y0 ;
-register int lx ;
-register const int ly ; /* MUST BE > 0 !! */
-{
- int dx, dy;
-
- if ( ( lx == 0 ) || ( ly == 0 ) )
- return;
-
- for ( dy = 0 ; dy < ly ; dy++ ) {
- for ( dx = 0 ; dx < lx ; dx++ ) {
- DO_ROP(color,SAVEDSCREEN(pWin, x0+dx,y0+dy),alu,planes);
- }
- }
-}
-
-/* For file vgaStipple.c */
-
-/* GJA -- modified this to take both Width and Height, and to
- * reduce x and y to Width and Height by taking remainders.
- */
-static unsigned char
-xygetbits
-(
- register int x,
- register int y,
- register const unsigned int Width,
- register const unsigned int paddedByteWidth,
- register const unsigned int Height,
- register const unsigned char * const data
-)
-{
- register unsigned char bits ;
- unsigned const char *lineptr, *cptr ;
- register int shift ;
- register int wrap ;
-
- x = x % Width;
- y = y % Height;
-
- lineptr = data + (y * paddedByteWidth);
- cptr = lineptr + (x >> 3) ;
- bits = *cptr ;
- if ((shift = x & 7))
- bits = SCRLEFT8( bits, shift ) |
- SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
- if ( ( wrap = x + 8 - Width ) > 0 ) {
- bits &= SCRLEFT8( 0xFF, wrap ) ;
- bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
- }
-
- return bits ;
-}
-
-static void
-DoMono
-(
- WindowPtr pWin, /* GJA */
- int w,
- int x,
- int y,
- register const unsigned char *mastersrc,
- int h,
- unsigned int width,
- register unsigned int paddedByteWidth,
- unsigned int height,
- int xshift,
- int yshift,
- int alu,
- int planes,
- int fg
-)
-{
- int dy, dx, i;
- int byte;
-
- for ( dy = 0 ; dy < h ; dy++ ) {
- for ( dx = 0; dx <= w - 8 ; dx += 8 ) {
- /* get next byte */
- byte = xygetbits(dx+xshift,dy+yshift,width,
- paddedByteWidth, height, mastersrc);
- for ( i = 0 ; i < 8 ; i++ ) {
- if ( byte & (128 >> i) ) {
- DO_ROP(fg,SAVEDSCREEN(pWin,x+dx+i,y+dy),
- alu,planes);
- }
- }
- }
- /* get last bits */
- byte = xygetbits(dx+xshift,dy+yshift,width,
- paddedByteWidth, height, mastersrc);
- for ( i = 0 ; i < (w - dx) ; i++ ) {
- if ( byte & (128 >> i) ) {
- DO_ROP(fg,SAVEDSCREEN(pWin,x+dx+i,y+dy),
- alu,planes);
- }
- }
- }
-}
-
-void
-xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes )
-WindowPtr pWin; /* GJA */
-unsigned char *data;
-int x, y, w, h ;
-unsigned long int fg ;
-int alu ;
-unsigned long int planes;
-{
-
- if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
- DoMono( pWin, w, x, y, (const unsigned char *) data, h,
- w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0, alu,
- (int)planes, (int)fg) ;
-
-}
-
-void
-xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
-WindowPtr pWin; /* GJA */
-register PixmapPtr const pStipple ;
-unsigned long int fg ;
-const int alu ;
-unsigned long int planes ;
-int x, y, w, h ;
-const int xSrc, ySrc ;
-{
- unsigned int width ;
- unsigned int height ;
- int xshift ;
- int yshift ;
-
- if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
- /* Figure Bit Offsets & Source Address */
- width = pStipple->drawable.width ;
- if ( ( xshift = ( x - xSrc ) ) < 0 )
- xshift = width - ( ( - xshift ) % width ) ;
- else
- xshift %= width ;
-
- height = pStipple->drawable.height ;
- if ( ( yshift = ( y - ySrc ) ) < 0 )
- yshift = height - ( ( - yshift ) % height ) ;
- else
- yshift %= height ;
-
- DoMono( pWin, w, x, y,
- (const unsigned char *) pStipple->devPrivate.ptr,
- h,
- width,
- ( ( width + 31 ) & (unsigned)(~31) ) >> 3,
- height,
- xshift, yshift,
- alu, (int)planes, (int)fg ) ;
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcArea.c b/hw/xfree86/xf4bpp/ppcArea.c
deleted file mode 100644
index 40e9d5b32..000000000
--- a/hw/xfree86/xf4bpp/ppcArea.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcArea.c,v 1.4 2003/02/18 21:29:59 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: ppcArea.c /main/4 1996/02/21 17:57:02 kaleb $ */
-
-/*
- * ppc solid area fill
- *
- * Tom Paquin 8/87
- */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "ppcGCstr.h"
-#include "ibmTrace.h"
-
-void
-xf4bppFillArea( pWin, nboxes, pBox, pGC )
- register WindowPtr pWin ;
- register int nboxes ;
- register BoxPtr pBox ;
- GCPtr pGC ;
-{
-register int x, y, w, h ;
-int alu ;
-unsigned long int fg, bg, pm ;
-int xSrc, ySrc ;
-PixmapPtr pPixmap ;
-ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
-
-TRACE( ( "xf4bppFillArea(0x%x,%d,0x%x,0x%x)\n", pWin, nboxes, pBox, pGC ) ) ;
-
-if ( ( alu = pPrivGC->colorRrop.alu ) == GXnoop || !nboxes )
- return ;
-
-xSrc = pGC->patOrg.x + pWin->drawable.x ;
-ySrc = pGC->patOrg.y + pWin->drawable.y ;
-
-pm = pPrivGC->colorRrop.planemask ;
-fg = pPrivGC->colorRrop.fgPixel ;
-bg = pPrivGC->colorRrop.bgPixel ;
-
-nboxes++ ;
-switch ( pPrivGC->colorRrop.fillStyle ) {
- case FillTiled:
- for ( pPixmap = pGC->tile.pixmap ; --nboxes ; pBox++ )
- if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
- && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
- xf4bppTileRect( pWin, pPixmap, alu, pm,
- x, y, w, h, xSrc, ySrc ) ;
- break ;
- case FillOpaqueStippled:
- for ( pPixmap = pGC->stipple ; --nboxes ; pBox++ )
- if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
- && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
- xf4bppOpaqueStipple( pWin, pPixmap, fg, bg, alu, pm,
- x, y, w, h, xSrc, ySrc ) ;
- break ;
- case FillStippled:
- for ( pPixmap = pGC->stipple ; --nboxes ; pBox++ )
- if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
- && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
- xf4bppFillStipple( pWin, pPixmap, fg, alu, pm,
- x, y, w, h, xSrc, ySrc ) ;
- break ;
- case FillSolid:
- for ( ; --nboxes ; pBox++ )
- if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
- && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
- xf4bppFillSolid( pWin, fg, alu, pm, x, y, w, h ) ;
- break ;
-}
-
-}
diff --git a/hw/xfree86/xf4bpp/ppcBStore.c b/hw/xfree86/xf4bpp/ppcBStore.c
deleted file mode 100644
index a1f49a486..000000000
--- a/hw/xfree86/xf4bpp/ppcBStore.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcBStore.c,v 1.3 1999/06/06 08:48:57 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by the Regents of the University of California
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-*/
-/* $XConsortium: ppcBStore.c /main/5 1996/02/21 17:57:06 kaleb $ */
-
-#include "xf4bpp.h"
-#include "vgaVideo.h"
-#include "ibmTrace.h"
-
-/*-----------------------------------------------------------------------
- * xf4bppSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-xf4bppSaveAreas( pPixmap, prgnSave, xorg, yorg, pWin )
- register PixmapPtr pPixmap ; /* Backing pixmap */
- RegionPtr prgnSave ; /* Region to save (pixmap-relative) */
- int xorg ; /* X origin of region */
- int yorg ; /* Y origin of region */
- WindowPtr pWin;
-{
- register BoxPtr pBox ;
- register int nBox ;
-
- TRACE( ( "xf4bppSaveAreas(0x%x,0x%x,%d,%d)\n",
- pPixmap, prgnSave, xorg, yorg ) ) ;
-/* WHOOP WHOOP WHOOP XXX -- depth 8 *only* */ /* GJA -- ? */
-
- if ( !( nBox = REGION_NUM_RECTS(prgnSave) ) )
- return ;
-
- for ( pBox = REGION_RECTS(prgnSave) ; nBox-- ; pBox++ )
- xf4bppReadColorImage( pWin, pBox->x1 + xorg,
- pBox->y1 + yorg,
- pBox->x2 - pBox->x1,
- pBox->y2 - pBox->y1,
- ( (unsigned char *) pPixmap->devPrivate.ptr )
- + ( pBox->y1 * pPixmap->devKind ) + pBox->x1,
- pPixmap->devKind ) ;
-
- return ;
-}
-
-/*-----------------------------------------------------------------------
- * xf4bppRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-xf4bppRestoreAreas( pPixmap, prgnRestore, xorg, yorg, pWin )
- register PixmapPtr pPixmap ; /* Backing pixmap */
- RegionPtr prgnRestore ; /* Region to restore (screen-relative)*/
- int xorg ; /* X origin of window */
- int yorg ; /* Y origin of window */
- WindowPtr pWin;
-{
- register BoxPtr pBox ;
- register int nBox ;
-
- TRACE( ( "xf4bppRestoreAreas(0x%x,0x%x,%d,%d)\n",
- pPixmap, prgnRestore, xorg, yorg ) ) ;
-/* WHOOP WHOOP WHOOP XXX -- depth 8 *only* */
-
- if ( !( nBox = REGION_NUM_RECTS(prgnRestore) ) )
- return ;
- for ( pBox = REGION_RECTS(prgnRestore) ; nBox-- ; pBox++ )
- xf4bppDrawColorImage( pWin, pBox->x1,
- pBox->y1,
- pBox->x2 - pBox->x1,
- pBox->y2 - pBox->y1,
- ( (unsigned char *)pPixmap->devPrivate.ptr )
- + ( ( pBox->y1 - yorg ) * pPixmap->devKind )
- + ( pBox->x1 - xorg ),
- pPixmap->devKind,
- GXcopy, VGA_ALLPLANES ) ;
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcCReduce.c b/hw/xfree86/xf4bpp/ppcCReduce.c
deleted file mode 100644
index a68f5faff..000000000
--- a/hw/xfree86/xf4bpp/ppcCReduce.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCReduce.c,v 1.3 1999/06/06 08:48:58 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: ppcCReduce.c /main/3 1996/02/21 17:57:17 kaleb $ */
-
-#include "xf4bpp.h"
-#include "ppcGCstr.h"
-
-/* xf4bppGetReducedColorRrop( pGC, drawableDepth, returnLoc )
- * An attempt to do "strength reduction" on color raster-ops
- * P. Shupak 1/88
- */
-
-static void
-ppcReduceGeneral
-(
- register int alu,
- register unsigned long pm,
- register unsigned long fg,
- register unsigned long bg,
- register int fillStyle,
- int drawableDepth,
- ppcReducedRrop *returnLoc
-)
-{
-
-if ( ( alu == GXnoop )
- || !( pm &= ( ( 1 << drawableDepth ) - 1 ) ) ) {
- returnLoc->alu = GXnoop ;
- return ;
-}
-
-#ifdef DELETE_THIS
-switch ( fillStyle ) {
- case FillTiled:
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXinvert: /* 0xa NOT dst */
- case GXset: /* 0xf 1 */
- fillStyle = FillSolid ;
- default: /* We Can't Do Much Here */
- break ;
- }
- break ;
- case FillOpaqueStippled:
- if ( ( fg & pm ) != ( bg & pm ) ) { /* else FillSolid */
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXset: /* 0xf 1 */
- case GXinvert: /* 0xa NOT dst */
- fillStyle = FillSolid ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- case GXnand: /* 0xe NOT src OR NOT dst */
- case GXcopy: /* 0x3 src */
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXnor ;
- break ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXand ; /* Fall Through */
- case GXand: /* 0x1 src AND dst */
- pm &= ~( fg & bg ) ;
- if ( ( bg & pm ) == pm ) {
- fillStyle = FillStippled ;
- alu = GXclear ;
- }
- break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXxor ; /* Fall Through */
- case GXxor: /* 0x6 src XOR dst */
- pm &= ( fg | bg ) ;
- if ( !( bg & pm ) ) {
- fillStyle = FillStippled ;
- alu = GXinvert ;
- }
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXnand ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXcopy ;
- break ;
- case GXorInverted: /* 0xd NOT src OR dst */
- fg = ~fg ;
- bg = ~bg ;
- alu = GXor ; /* Fall Through */
- case GXor: /* 0x7 src OR dst */
- pm &= ( fg | bg ) ;
- if ( !( bg & pm ) ) {
- fillStyle = FillStippled ;
- alu = GXset ;
- }
- break ;
- default:
- ErrorF(
- "xf4bppGetReducedColorRrop: Unknown Alu Raster-Op" ) ;
- break ;
- }
- break ; /* Don't Fall Through */
- }
- else
- fillStyle = FillSolid ;
- /* Fall Through */
- case FillStippled:
- case FillSolid:
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXset: /* 0xf 1 */
- case GXinvert: /* 0xa NOT dst */
- break ;
- case GXand: /* 0x1 src AND dst */
- pm &= ~fg ;
- alu = GXclear ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- fg = ~fg ;
- alu = GXnor ; /* Fall Through */
- case GXnor: /* 0x8 NOT src AND NOT dst */
- if ( !( fg & pm ) )
- alu = GXclear ;
- else if ( ( fg & pm ) == pm )
- alu = GXinvert ;
- break ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- pm &= fg ;
- alu = GXclear ;
- break ;
- case GXxor: /* 0x6 src XOR dst */
- pm &= fg ;
- alu = GXinvert ;
- break ;
- case GXor: /* 0x7 src OR dst */
- pm &= fg ;
- alu = GXset ;
- break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- pm &= ~fg ;
- alu = GXinvert ;
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- fg = ~fg ;
- alu = GXnand ; /* Fall Through */
- case GXnand: /* 0xe NOT src OR NOT dst */
- if ( !( fg & pm ) )
- alu = GXset ;
- else if ( ( fg & pm ) == pm )
- alu = GXinvert ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- fg = ~fg ;
- alu = GXcopy ; /* Fall Through */
- case GXcopy: /* 0x3 src */
- if ( !( fg & pm ) )
- alu = GXclear ;
- else if ( ( fg & pm ) == pm )
- alu = GXset ;
- break ;
- case GXorInverted: /* 0xd NOT src OR dst */
- pm &= ~fg ;
- alu = GXset ;
- break ;
- default:
- ErrorF(
- "xf4bppGetReducedColorRrop: Unknown Alu Raster-Op" ) ;
- break ;
- }
- break;
- default:
- ErrorF("xf4bppGetReducedColorRrop: Bad Fillstyle\n");
- break;
-}
-#endif
-
-/* Final Test On Restricted Plane Mask */
-if ( !pm )
- alu = GXnoop ;
-
-/* Set Actual Returned Values */
-returnLoc->planemask = pm ;
-returnLoc->fgPixel = fg ;
-returnLoc->bgPixel = bg ;
-returnLoc->alu = alu ;
-returnLoc->fillStyle = fillStyle ;
-
-return ;
-}
-
-void
-xf4bppGetReducedColorRrop( pGC, drawableDepth, returnLoc )
-GC *pGC ;
-int drawableDepth ;
-ppcReducedRrop *returnLoc ;
-{
-
-ppcReduceGeneral( pGC->alu,
- pGC->planemask,
- pGC->fgPixel,
- pGC->bgPixel,
- pGC->fillStyle,
- drawableDepth,
- returnLoc ) ;
-
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcClip.c b/hw/xfree86/xf4bpp/ppcClip.c
deleted file mode 100644
index cd307fe94..000000000
--- a/hw/xfree86/xf4bpp/ppcClip.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcClip.c,v 1.5 1999/09/25 14:38:16 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: ppcClip.c /main/4 1996/02/21 17:57:21 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "scrnintstr.h"
-
-void
-xf4bppDestroyClip(pGC)
- GCPtr pGC;
-{
- if(pGC->clientClipType == CT_NONE)
- return;
- else if (pGC->clientClipType == CT_PIXMAP)
- {
- mfbDestroyPixmap((PixmapPtr)(pGC->clientClip));
- }
- else
- {
- /* we know we'll never have a list of rectangles, since
- ChangeClip immediately turns them into a region
- */
- REGION_DESTROY(pGC->pScreen, pGC->clientClip);
- }
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-}
-
-void
-xf4bppChangeClip(pGC, type, pvalue, nrects)
- GCPtr pGC;
- int type;
- pointer pvalue;
- int nrects;
-{
- xf4bppDestroyClip(pGC);
- if(type == CT_PIXMAP)
- {
- /* convert the pixmap to a region */
- pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pvalue);
- /* you wouldn't do this if you were leaving the pixmap in
- rather than converting it.
- */
- (*pGC->pScreen->DestroyPixmap)(pvalue);
- }
- else if (type == CT_REGION)
- {
- /* stuff the region in the GC */
- pGC->clientClip = pvalue;
- }
- else if (type != CT_NONE)
- {
- pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects,
- (xRectangle *)pvalue,
- type);
- xfree(pvalue);
- }
- pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION :
- CT_NONE;
- pGC->stateChanges |= GCClipMask;
-}
-
-void
-xf4bppCopyClip (pgcDst, pgcSrc)
- GCPtr pgcDst, pgcSrc;
-{
- RegionPtr prgnNew;
-
- switch(pgcSrc->clientClipType)
- {
- case CT_PIXMAP:
- ((PixmapPtr) pgcSrc->clientClip)->refcnt++;
- /* Fall through !! */
- case CT_NONE:
- xf4bppChangeClip(pgcDst, pgcSrc->clientClipType, pgcSrc->clientClip, 0);
- break;
- case CT_REGION:
- prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1);
- REGION_COPY(pgcSrc->pScreen, prgnNew, (RegionPtr)(pgcSrc->clientClip));
- xf4bppChangeClip(pgcDst, CT_REGION, (pointer)prgnNew, 0);
- break;
- }
-}
diff --git a/hw/xfree86/xf4bpp/ppcCpArea.c b/hw/xfree86/xf4bpp/ppcCpArea.c
deleted file mode 100644
index 86b7d6f6c..000000000
--- a/hw/xfree86/xf4bpp/ppcCpArea.c
+++ /dev/null
@@ -1,468 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.7 2003/11/10 18:22:42 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: ppcCpArea.c /main/6 1996/02/21 17:57:24 kaleb $ */
-
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#define PSZ 8
-#include "cfb.h"
-#include "cfbmskbits.h"
-#include "mergerop.h"
-#include "mi.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-/*
- * Graft in the DoBitblt from cfb. It does everything correctly.
- */
-static void
-vga16DoBitblt
-(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int alu,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask
-)
-{
- int widthSrc, widthDst; /* add to get to same position in next line */
- BoxPtr pbox;
- int nbox;
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int careful;
-
- widthSrc = cfbGetLongWidth(pSrc);
- widthDst = cfbGetLongWidth(pDst);
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1))
- {
- /* walk source botttom to top */
- widthSrc = -widthSrc;
- widthDst = -widthDst;
-
- if (nbox > 1)
- {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1)
- {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox)
- {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase)
- {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- }
-
- if (careful && (pptSrc->x < pbox->x1))
- {
- if (nbox > 1)
- {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2)
- {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase)
- {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- }
-
- while(nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- if( pSrc->type == DRAWABLE_WINDOW )
- xf4bppBitBlt( (WindowPtr)pDst, alu, planemask,
- pptSrc->x, /* x0 */
- pptSrc->y, /* y0 */
- pbox->x1, /* x1 */
- pbox->y1, /* y1 */
- w, h ); /* w, h */
- else /* DRAWABLE_PIXMAP */
- xf4bppDrawColorImage( (WindowPtr)pDst,
- pbox->x1, pbox->y1,
- w,
- h,
- ((unsigned char *)((PixmapPtr)pSrc)->devPrivate.ptr
- + pptSrc->x + (pptSrc->y*((PixmapPtr)pSrc)->devKind)),
- ((PixmapPtr)pSrc)->devKind,
- alu, planemask ) ;
- pbox++;
- pptSrc++;
- }
- if (pboxNew2)
- {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
-
-
-/*
- * Graft in the CopyArea from mfb/cfb. It does everything correctly.
- */
-
-RegionPtr
-xf4bppCopyArea(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty)
-register DrawablePtr pSrcDrawable;
-register DrawablePtr pDstDrawable;
-register GC *pGC;
-int srcx, srcy;
-int width, height;
-int dstx, dsty;
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- if ( pDstDrawable->type != DRAWABLE_WINDOW )
- return miCopyArea( pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx, dsty ) ;
-
- /* Begin code from mfb/cfbCopyArea */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = pGC->pCompositeClip;
- }
- else
- {
- fastClip = 1;
- }
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- if (!((WindowPtr) pSrcDrawable)->parent)
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = pGC->pCompositeClip;
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip)
- {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x)
- {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y)
- {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- if (!((WindowPtr)pDstDrawable)->realized)
- {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip)
- {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
- cclip = pGC->pCompositeClip;
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height)
- {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- vga16DoBitblt(pSrcDrawable, pDstDrawable, pGC->alu,
- &rgnDst, pptSrc, pGC->planemask );
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose)
- {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed =
- miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, (unsigned long)0);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
diff --git a/hw/xfree86/xf4bpp/ppcDepth.c b/hw/xfree86/xf4bpp/ppcDepth.c
deleted file mode 100644
index 919fa0133..000000000
--- a/hw/xfree86/xf4bpp/ppcDepth.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcDepth.c,v 1.3 1999/06/06 08:48:58 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: ppcDepth.c /main/3 1996/02/21 17:57:31 kaleb $ */
-
-/* Check to see if the alleged depth is acceptable for the Screen
- *
- * T. Paquin 9/87
- *
- */
-
-#include "xf4bpp.h"
-#include "scrnintstr.h"
-
-Bool
-xf4bppDepthOK(pDraw,depth)
-register DrawablePtr pDraw;
-register int depth;
-{
-register ScreenPtr pScreen= pDraw->pScreen;
-register int i = pScreen->numDepths;
-
- if ( ( pDraw->type == DRAWABLE_PIXMAP ) && ( depth == 1 ) )
- return TRUE ;
-
- while ( i-- )
- if ( depth == pScreen->allowedDepths[i].depth )
- return TRUE ;
-
- return FALSE ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcFillRct.c b/hw/xfree86/xf4bpp/ppcFillRct.c
deleted file mode 100644
index af1ecb95e..000000000
--- a/hw/xfree86/xf4bpp/ppcFillRct.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcFillRct.c /main/5 1996/02/21 17:57:35 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "scrnintstr.h"
-
-#define MODEQ(a, b) ((a) %= (b))
-
-/*
- filled rectangles.
- translate the rectangles, clip them, and call the
-helper function in the GC.
-*/
-
-#define NUM_STACK_RECTS 1024
-
-void
-xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- int numRects;
- int n;
- int xorg, yorg;
-
- if (!(pGC->planemask & 0x0F)) /* GJA */
- return;
-
- prgnClip = pGC->pCompositeClip;
-
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg)
- {
- prect = prectInit;
- n = nrectFill;
- Duff (n, prect->x += xorg; prect->y += yorg; prect++);
- }
-
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS)
- {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1)
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2))
- {
- pboxClipped++;
- }
- }
- }
- else
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2)
- {
- pboxClipped++;
- }
- }
- }
- }
- if (pboxClipped != pboxClippedBase)
- xf4bppFillArea((WindowPtr)pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC);
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c
deleted file mode 100644
index df8ae335f..000000000
--- a/hw/xfree86/xf4bpp/ppcGC.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGC.c,v 1.8 2003/02/18 21:29:59 tsi Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-
-/* $XConsortium: ppcGC.c /main/6 1996/02/21 17:57:38 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "ppcGCstr.h"
-#include "vgaVideo.h"
-#include "ibmTrace.h"
-
-#define ppcGCInterestValidateMask \
-( GCLineStyle | GCLineWidth | GCJoinStyle | GCBackground | GCForeground \
-| GCFunction | GCPlaneMask | GCFillStyle | GC_CALL_VALIDATE_BIT \
-| GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode )
-
-
-/* GJA -- we modified the following function to get rid of
- * the records in file vgaData.c
- */
-static GCFuncs vgaGCFuncs = {
- xf4bppValidateGC,
- (void (*)())NoopDDA,
- (void (*)())NoopDDA,
- xf4bppDestroyGC,
- xf4bppChangeClip,
- xf4bppDestroyClip,
- xf4bppCopyClip,
- { NULL }
-};
-
-
-static ppcPrivGC vgaPrototypeGCPriv = {
- GXcopy, /* unsigned char rop */
- 0, /* unsigned char ropOpStip */
- 0, /* unsigned char ropFillArea */
- {0, }, /* unsigned char unused[sizeof(long) - 3] */
- NULL, /* mfbFillAreaProcPtr FillArea */
- {
- VGA_ALLPLANES, /* unsigned long planemask */
- 1, /* unsigned long fgPixel */
- 0, /* unsigned long bgPixel */
- GXcopy, /* int alu */
- FillSolid, /* int fillStyle */
- }, /* ppcReducedRrop colorRrop */
- -1, /* short lastDrawableType */
- -1, /* short lastDrawableDepth */
- 0 /* pointer devPriv */
-} ;
-
-static GCOps vgaGCOps = {
- xf4bppSolidWindowFS, /* void (* FillSpans)() */
- xf4bppSetSpans, /* void (* SetSpans)() */
- miPutImage, /* void (* PutImage)() */
- xf4bppCopyArea, /* RegionPtr (* CopyArea)() */
- miCopyPlane, /* void (* CopyPlane)() */
- xf4bppPolyPoint, /* void (* PolyPoint)() */
- miZeroLine, /* void (* Polylines)() */
- miPolySegment, /* void (* PolySegment)() */
- miPolyRectangle, /* void (* PolyRectangle)() */
- xf4bppZeroPolyArc, /* void (* PolyArc)() */
- miFillPolygon, /* void (* FillPolygon)() */
- miPolyFillRect, /* void (* PolyFillRect)() */
- xf4bppPolyFillArc, /* void (* PolyFillArc)() */
- miPolyText8, /* int (* PolyText8)() */
- miPolyText16, /* int (* PolyText16)() */
- miImageText8, /* void (* ImageText8)() */
- miImageText16, /* void (* ImageText16)() */
- xf4bppImageGlyphBlt, /* GJA -- void (* ImageGlyphBlt)() */
- miPolyGlyphBlt, /* GJA -- void (* PolyGlyphBlt)() */
- miPushPixels, /* void (* PushPixels)() */
-#ifdef NEED_LINEHELPER
- miMiter, /* void (* LineHelper)() */
-#endif
- {NULL} /* devPrivate */
-};
-
-Bool
-xf4bppCreateGC( pGC )
-register GCPtr pGC ;
-{
- ppcPrivGC *pPriv ;
- GCOps *pOps ;
-
- if ( pGC->depth == 1 )
- {
- return (mfbCreateGC(pGC));
- }
-
- if ( !( pPriv = xalloc( sizeof( ppcPrivGC ) ) ) )
- return FALSE ;
-
- if ( !( pOps = xalloc( sizeof( GCOps ) ) ) ) {
- xfree(pPriv);
- return FALSE;
- }
-
- /* Now we initialize the GC fields */
- pGC->miTranslate = 1;
- pGC->unused = 0;
- pGC->planemask = VGA_ALLPLANES;
- pGC->fgPixel = VGA_BLACK_PIXEL;
- pGC->bgPixel = VGA_WHITE_PIXEL;
- pGC->funcs = &vgaGCFuncs;
- /* ops, -- see below */
-
- pGC->fExpose = TRUE;
- pGC->freeCompClip = FALSE;
- pGC->pRotatedPixmap = NullPixmap;
-
- /* GJA: I don't like this code:
- * they allocated a mfbPrivGC, ignore the allocated data and place
- * a pointer to a ppcPrivGC in its slot.
- */
- *pPriv = vgaPrototypeGCPriv;
- (pGC->devPrivates[mfbGCPrivateIndex].ptr) = (pointer) pPriv;
-
- /* Set the vgaGCOps */
- *pOps = vgaGCOps;
- pOps->devPrivate.val = 1;
- pGC->ops = pOps;
-
- return TRUE ;
-}
-
-void
-xf4bppDestroyGC( pGC )
- register GC *pGC ;
-
-{
- TRACE( ( "xf4bppDestroyGC(pGC=0x%x)\n", pGC ) ) ;
-
- /* (ef) 11/9/87 -- ppc doesn't use rotated tile or stipple, but */
- /* *does* call mfbValidateGC under some conditions. */
- /* mfbValidateGC *does* use rotated tile and stipple */
- if ( pGC->pRotatedPixmap )
- mfbDestroyPixmap( pGC->pRotatedPixmap ) ;
-
- if ( pGC->freeCompClip && pGC->pCompositeClip )
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- if(pGC->ops->devPrivate.val) xfree( pGC->ops );
- xfree( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
- return ;
-}
-
-static Mask
-ppcChangePixmapGC
-(
- register GC *pGC,
- register Mask changes
-)
-{
-register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
-register unsigned long int idx ; /* used for stepping through bitfields */
-
-#define LOWBIT( x ) ( x & - x ) /* Two's complement */
-while ((idx = LOWBIT(changes))) {
- switch ( idx ) {
-
- case GCLineStyle:
- case GCLineWidth:
- pGC->ops->Polylines = ( ! pGC->lineWidth )
- ? miZeroLine
- : ( ( pGC->lineStyle == LineSolid )
- ? miWideLine : miWideDash ) ;
- changes &= ~( GCLineStyle | GCLineWidth ) ;
- break ;
-
- case GCJoinStyle:
-#ifdef NEED_LINEHELPER
- pGC->ops->LineHelper = ( pGC->joinStyle == JoinMiter )
- ? miMiter : miNotMiter ;
-#endif
- changes &= ~ idx ; /* i.e. changes &= ~ GCJoinStyle */
- break ;
-
- case GCBackground:
- if ( pGC->fillStyle != FillOpaqueStippled ) {
- changes &= ~ idx ; /* i.e. changes &= ~GCBackground */
- break ;
- } /* else Fall Through */
- case GCForeground:
- if ( pGC->fillStyle == FillTiled ) {
- changes &= ~ idx ; /* i.e. changes &= ~GCForeground */
- break ;
- } /* else Fall Through */
- case GCFunction:
- case GCPlaneMask:
- case GCFillStyle:
- { /* new_fill */
- int fillStyle = devPriv->colorRrop.fillStyle ;
- /* install a suitable fillspans */
- if ( fillStyle == FillSolid )
- pGC->ops->FillSpans = xf4bppSolidPixmapFS ;
- else if ( fillStyle == FillStippled )
- pGC->ops->FillSpans = xf4bppStipplePixmapFS ;
- else if ( fillStyle == FillOpaqueStippled )
- pGC->ops->FillSpans = xf4bppOpStipplePixmapFS ;
- else /* fillStyle == FillTiled */
- pGC->ops->FillSpans = xf4bppTilePixmapFS ;
- changes &= ~( GCBackground | GCForeground
- | GCFunction | GCPlaneMask | GCFillStyle ) ;
- break ;
- } /* end of new_fill */
-
- default:
- ErrorF( "ppcChangePixmapGC: Unexpected GC Change\n" ) ;
- changes &= ~ idx ; /* Remove it anyway */
- break ;
- }
-}
-
-return 0 ;
-}
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-void
-xf4bppValidateGC( pGC, changes, pDrawable )
- GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- register ppcPrivGCPtr devPriv ;
- WindowPtr pWin ;
-
- devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
-
- if ( pDrawable->type != devPriv->lastDrawableType ) {
- devPriv->lastDrawableType = pDrawable->type ;
- xf4bppChangeGCtype( pGC, devPriv ) ;
- changes = (unsigned)~0 ;
- }
-
- if ( pDrawable->depth == 1 ) {
-/* ibmAbort(); */
- xf4bppNeverCalled();
- }
-
- if ( pDrawable->type == DRAWABLE_WINDOW ) {
- pWin = (WindowPtr) pDrawable ;
- pGC->lastWinOrg.x = pWin->drawable.x ;
- pGC->lastWinOrg.y = pWin->drawable.y ;
- }
- else {
- pWin = (WindowPtr) NULL ;
- pGC->lastWinOrg.x = 0 ;
- pGC->lastWinOrg.y = 0 ;
- }
-
- changes &= ppcGCInterestValidateMask ;
- /* If Nothing REALLY Changed, Just Return */
- if ( pDrawable->serialNumber == (pGC->serialNumber & DRAWABLE_SERIAL_BITS) )
- if ( !( changes &= ~ GC_CALL_VALIDATE_BIT ) )
- return ;
-
- /* GJA -- start of cfb code */
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- if (pWin) {
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors) {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- }
- else {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping
- * the pointer we got, and remembering whether or not should
- * destroy (or maybe re-use) it later. this way, we avoid
- * unnecessary copying of regions. (this wins especially if
- * many clients clip by children and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE) {
- if (freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- }
- else {
- /*
- * we need one 'real' region to put into the composite
- * clip. if pregWin the current composite clip are real,
- * we can get rid of one. if pregWin is real and the
- * current composite clip isn't, use pregWin for the
- * composite clip. if the current composite clip is real
- * and pregWin isn't, use the current composite clip. if
- * neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip)
- {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pGC->pScreen, pregWin);
- }
- else if (freeTmpClip)
- {
- REGION_INTERSECT(pGC->pScreen, pregWin, pregWin,
- pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- }
- else
- {
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
-
- }
- } /* end of composite clip for a window */
- else {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- pixbounds.x1 = 0;
- pixbounds.y1 = 0;
- pixbounds.x2 = pDrawable->width;
- pixbounds.y2 = pDrawable->height;
-
- if (pGC->freeCompClip) {
- REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
- } else {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION)
- {
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
- -pGC->clipOrg.x, -pGC->clipOrg.y);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
- pGC->clipOrg.x, pGC->clipOrg.y);
- }
- } /* end of composute clip for pixmap */
- }
- /* GJA -- End of cfb code */
-
- changes &= ~ ( GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode
- | GC_CALL_VALIDATE_BIT ) ;
-
- /* If needed, Calculate the Color Reduced Raster-Op */
- if ( changes & ( GCFillStyle | GCBackground | GCForeground
- | GCPlaneMask | GCFunction ) )
- xf4bppGetReducedColorRrop( pGC, pDrawable->depth,
- &devPriv->colorRrop ) ;
-
- (* ( ( pDrawable->type == DRAWABLE_WINDOW )
- ? xf4bppChangeWindowGC
- : ppcChangePixmapGC ) )( pGC, changes ) ;
-
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcGCstr.h b/hw/xfree86/xf4bpp/ppcGCstr.h
deleted file mode 100644
index 341e17534..000000000
--- a/hw/xfree86/xf4bpp/ppcGCstr.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.4 2003/11/17 22:20:42 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/***********************************************************
- Copyright IBM Corporation 1988
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcGCstr.h /main/3 1996/02/21 17:57:42 kaleb $ */
-
-#include "gc.h"
-#include "mfb.h"
-
-typedef struct {
- unsigned long planemask ;
- unsigned long fgPixel ;
- unsigned long bgPixel ;
- int alu ;
- int fillStyle ;
- } ppcReducedRrop ;
-
-/* ************************************************************************ */
-
-/* private field of GC */
-typedef struct {
-/* The next five (5) fields MUST CORRESPOND to
- * the fields of a "mfbPrivGC" struct
- * ----- BEGINNING OF "DO-NOT-CHANGE" REGION -----
- */
- unsigned char rop ; /* reduction of rasterop to 1 of 3 */
- unsigned char ropOpStip ; /* rop for opaque stipple */
- unsigned char ropFillArea ; /* == alu, rop, or ropOpStip */
- unsigned char unused[sizeof(long) - 3];
- mfbFillAreaProcPtr FillArea; /* fills regions; look at the code */
-/* ----- END OF "DO-NOT-CHANGE" REGION ----- */
- ppcReducedRrop colorRrop ;
- short lastDrawableType ; /* was last drawable a window or a pixmap? */
- short lastDrawableDepth ; /* was last drawable 1 or 8 planes? */
- pointer devPriv ; /* Private area for device specific stuff */
- } ppcPrivGC ;
-typedef ppcPrivGC *ppcPrivGCPtr ;
-
-/* ppcCReduce.c */
-void xf4bppGetReducedColorRrop(
- GCPtr,
- int,
- ppcReducedRrop *
-);
-
-/* vgaGC.c */
-void xf4bppChangeGCtype(
- GCPtr,
- ppcPrivGCPtr
-);
diff --git a/hw/xfree86/xf4bpp/ppcGetSp.c b/hw/xfree86/xf4bpp/ppcGetSp.c
deleted file mode 100644
index b6c404e80..000000000
--- a/hw/xfree86/xf4bpp/ppcGetSp.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGetSp.c,v 1.3 1999/06/06 08:48:59 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $XConsortium: ppcGetSp.c /main/5 1996/02/21 17:57:45 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "servermd.h"
-#include "ibmTrace.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-void
-xf4bppGetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart )
- DrawablePtr pDrawable ; /* drawable from which to get bits */
- int wMax ; /* largest value of all *pwidths */
- DDXPointPtr ppt ; /* points to start copying from */
- int *pwidth ; /* list of number of bits to copy */
- int nspans ; /* number of scanlines to copy */
- char *pdstStart ;
-{
- register int j ;
- register unsigned char *pdst ; /* where to put the bits */
- register unsigned char *psrc ; /* where to get the bits */
- register int pixmapStride ;
-
-
- TRACE( ( "xf4bppGetSpans(pDrawable=0x%x,wMax=%d,ppt=0x%x,pwidth=0x%x,nspans=%d)\n",
- pDrawable, wMax, ppt, pwidth, nspans ) ) ;
-
- if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) )
- {
- mfbGetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart ) ;
- return;
- }
-
- pixmapStride = PixmapBytePad( wMax, pDrawable->depth ) ;
- pdst = (unsigned char *) /* GJA */ pdstStart ;
-
- if ( pDrawable->type == DRAWABLE_WINDOW ) {
- for ( ; nspans-- ; ppt++, pwidth++ ) {
- xf4bppReadColorImage( (WindowPtr)pDrawable,
- ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride ) ;
- pdst += j ; /* width is in 32 bit words */
- j = ( -j ) & 3 ;
- while ( j-- ) /* Pad out to 32-bit boundary */
- *pdst++ = 0 ;
- }
- }
- else { /* OK, if we are here, we had better be a DRAWABLE PIXMAP */
- register int widthSrc = /* width of pixmap in bytes */
- (int) ( (PixmapPtr) pDrawable )->devKind ;
-
- psrc = (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr ;
- for ( ; nspans-- ; ppt++, pwidth++ ) {
- MOVE( psrc + ( ppt->y * widthSrc ) + ppt->x,
- pdst, j = *pwidth ) ;
- pdst += j ;
- j = ( -j ) & 3 ;
- while ( j-- ) /* Pad out to 32-bit boundary */
- *pdst++ = 0 ;
- }
- }
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c
deleted file mode 100644
index f6999c561..000000000
--- a/hw/xfree86/xf4bpp/ppcIO.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
-/*
-
-Copyright (c) 1990 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: ppcIO.c /main/8 1996/02/21 17:57:49 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "micmap.h"
-#include "scrnintstr.h"
-#include "vgaVideo.h"
-
-#if 0
-/* XXX This remains to remind of the PC98 difference */
-static VisualRec vgaVisuals[] = {
-/* StaticColor needs to be first so is can be used as the default */
-/* vid class bpRGB cmpE nplan rMask gMask bMask oRed oGreen oBlue */
-#ifdef PC98
-{ 0, StaticColor, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, StaticGray, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, GrayScale, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, PseudoColor, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-#else
-{ 0, StaticColor, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, StaticGray, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, GrayScale, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-{ 0, PseudoColor, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
-#endif
-} ;
-#endif
-
-void
-xf4bppNeverCalled()
-{
- FatalError("xf4bppNeverCalled was nevertheless called\n");
-}
-
-static BSFuncRec ppcBSFuncRec = {
- xf4bppSaveAreas,
- xf4bppRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-/*ARGSUSED*/
-static Bool
-vgaScreenClose
-(
- int idx,
- ScreenPtr pScreen
-)
-{
- pScreen->defColormap = 0 ;
- return TRUE;
-}
-
-
-static GCPtr sampleGCperDepth[MAXFORMATS+1] = { 0 };
-static PixmapPtr samplePixmapPerDepth[1] = { 0 };
-
-/* GJA -- Took this from miscrinit.c.
- * We want that devKind contains the distance in bytes between two scanlines.
- * The computation that mi does is not appropriate for planar VGA.
- * Therefore we provide here our own routine.
- */
-
-/* GJA -- WARNING: this is an internal structure declaration, taken from
- * miscrinit.c
- */
-typedef struct
-{
- pointer pbits; /* pointer to framebuffer */
- int width; /* delta to add to a framebuffer addr to move one row down */
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
-
-/* With the introduction of pixmap privates, the "screen pixmap" can no
- * longer be created in miScreenInit, since all the modules that could
- * possibly ask for pixmap private space have not been initialized at
- * that time. pScreen->CreateScreenResources is called after all
- * possible private-requesting modules have been inited; we create the
- * screen pixmap here.
- */
-static Bool
-v16CreateScreenResources
-(
- ScreenPtr pScreen
-)
-{
- miScreenInitParmsPtr pScrInitParms;
- pointer value;
-
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
-
- /* if width is non-zero, pScreen->devPrivate will be a pixmap
- * else it will just take the value pbits
- */
- if (pScrInitParms->width)
- {
- PixmapPtr pPixmap;
-
- /* create a pixmap with no data, then redirect it to point to
- * the screen
- */
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
- if (!pPixmap)
- return FALSE;
-
- if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
- pScreen->height, pScreen->rootDepth, 8 /* bits per pixel */,
-/* GJA: was PixmapBytePad(pScrInitParms->width, pScreen->rootDepth), */
-#define BITS_PER_BYTE_SHIFT 3
- pScrInitParms->width >> BITS_PER_BYTE_SHIFT,
- pScrInitParms->pbits))
- return FALSE;
- value = (pointer)pPixmap;
- }
- else
- {
- value = pScrInitParms->pbits;
- }
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
- pScreen->devPrivate = value; /* pPixmap or pbits */
- return TRUE;
-}
-
-
-Bool
-xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width )
- ScreenPtr pScreen;
- pointer pbits;
- int virtx, virty;
- int dpix, dpiy;
- int width;
-{
- Bool ret;
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- ret = miInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual, (unsigned long)1 << 8, 6, -1);
- if (!ret)
- return FALSE;
-
- pScreen-> id = 0;
- pScreen->defColormap = FakeClientID(0);
- pScreen-> whitePixel = VGA_WHITE_PIXEL;
- pScreen-> blackPixel = VGA_BLACK_PIXEL;
- pScreen-> rgf = 0;
- *(pScreen-> GCperDepth) = *(sampleGCperDepth);
- *(pScreen-> PixmapPerDepth) = *(samplePixmapPerDepth);
- pScreen-> CloseScreen = vgaScreenClose;
- pScreen-> QueryBestSize = xf4bppQueryBestSize;
- pScreen-> GetImage = xf4bppGetImage;
- pScreen-> GetSpans = xf4bppGetSpans;
- pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware;
- pScreen-> DestroyWindow = xf4bppDestroyWindow;
- pScreen-> PositionWindow = xf4bppPositionWindow;
- pScreen-> ChangeWindowAttributes = mfbChangeWindowAttributes;
- pScreen-> RealizeWindow = mfbMapWindow;
- pScreen-> UnrealizeWindow = mfbUnmapWindow;
- pScreen-> PaintWindowBackground = xf4bppPaintWindow;
- pScreen-> PaintWindowBorder = xf4bppPaintWindow;
- pScreen-> CopyWindow = xf4bppCopyWindow;
- pScreen-> CreatePixmap = xf4bppCreatePixmap;
- pScreen-> DestroyPixmap = mfbDestroyPixmap;
- pScreen-> SaveDoomedAreas = (SaveDoomedAreasProcPtr)NoopDDA;
- pScreen-> RestoreAreas = (RestoreAreasProcPtr)NoopDDA;
- pScreen-> ExposeCopy = (ExposeCopyProcPtr)NoopDDA;
- pScreen-> TranslateBackingStore = (TranslateBackingStoreProcPtr)NoopDDA;
- pScreen-> ClearBackingStore = (ClearBackingStoreProcPtr)NoopDDA;
- pScreen-> DrawGuarantee = (DrawGuaranteeProcPtr)NoopDDA;
- pScreen-> RealizeFont = mfbRealizeFont;
- pScreen-> UnrealizeFont = mfbUnrealizeFont;
- pScreen-> CreateGC = xf4bppCreateGC;
- pScreen-> CreateColormap = xf4bppInitializeColormap;
- pScreen-> DestroyColormap = (DestroyColormapProcPtr)NoopDDA;
- pScreen-> InstallColormap = miInstallColormap;
- pScreen-> UninstallColormap = miUninstallColormap;
- pScreen-> ListInstalledColormaps = miListInstalledColormaps;
- pScreen-> StoreColors = (StoreColorsProcPtr)NoopDDA;
- pScreen-> ResolveColor = xf4bppResolveColor;
- pScreen-> BitmapToRegion = mfbPixmapToRegion;
-
- if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL))
- return FALSE;
-
- if (!miScreenInit(pScreen, pbits, virtx, virty, dpix, dpiy, width,
- rootdepth, ndepths, depths, defaultVisual /* See above */,
- nvisuals, visuals))
- return FALSE;
- pScreen->BackingStoreFuncs = ppcBSFuncRec;
-
- /* GJA -- Now we override the supplied default: */
- pScreen -> CreateScreenResources = v16CreateScreenResources;
-
- mfbRegisterCopyPlaneProc(pScreen,miCopyPlane); /* GJA -- R4->R5 */
- return TRUE;
-}
diff --git a/hw/xfree86/xf4bpp/ppcImg.c b/hw/xfree86/xf4bpp/ppcImg.c
deleted file mode 100644
index 275db433a..000000000
--- a/hw/xfree86/xf4bpp/ppcImg.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcImg.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: ppcImg.c /main/4 1996/02/21 17:57:53 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-
-/* Was MIGETIMAGE -- public entry for the GetImage Request
- * We're getting the image into a memory buffer. While we have to use GetSpans
- * to read a line from the device ( since we don't know what that looks like ) ,
- * we can just write into the destination buffer
- *
- * two different strategies are used, depending on whether we're getting the
- * image in Z format or XY format
- * Z format:
- * Line at a time, GetSpans a line and bcopy it to the destination
- * buffer, except that if the planemask is not all ones, we create a
- * temporary pixmap and do a SetSpans into it ( to get bits turned off )
- * and then another GetSpans to get stuff back ( because pixmaps are
- * opaque, and we are passed in the memory to write into ) . This is
- * completely ugly and slow but works, but the interfaces just aren't
- * designed for this case. Life is hard.
- * XY format:
- * get the single plane specified in planemask
- */
-void
-xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine )
- DrawablePtr pDraw ;
- int sx, sy, w, h ;
- unsigned int format ;
- unsigned long planeMask ;
- char * pdstLine ;
-{
-#if 1
- int depth, i, linelength, width ;
- DDXPointRec pt ;
- char *pbits ;
- XID gcv[2] ;
- PixmapPtr pPixmap = (PixmapPtr) NULL ;
- GCPtr pGC ;
- char *pDst = pdstLine ;
-
- depth = pDraw->depth ;
- if ( format == ZPixmap ) {
- linelength = PixmapBytePad( w, depth ) ;
-/* if ( pDraw->type == DRAWABLE_WINDOW ) { */
- sx += pDraw->x ;
- sy += pDraw->y ;
-/* } */
- if ( ( ( ( 1 << pDraw->depth ) - 1 ) & planeMask )
- != (unsigned)( 1 << pDraw->depth ) - 1 ) {
- pGC = GetScratchGC( depth, pDraw->pScreen ) ;
- pPixmap = (PixmapPtr)
- (* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth ) ;
- gcv[0] = GXcopy ;
- gcv[1] = planeMask ;
- DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ;
- ValidateGC( (DrawablePtr)pPixmap, pGC ) ;
-
- pbits = (char *)ALLOCATE_LOCAL(w);
-
- for ( i = 0 ; i < h ; i++ ) {
- pt.x = sx ;
- pt.y = sy + i ;
- width = w ;
- (* pDraw->pScreen->GetSpans)( pDraw, w, &pt, &width, 1, pbits ) ;
- pt.x = 0 ;
- pt.y = i ;
- width = w ;
- if ( planeMask & ((1 << depth) - 1) ) /* GJA -- mfb bug */
- (* pGC->ops->SetSpans)( (DrawablePtr)pPixmap, pGC, pbits, &pt, &width, 1, TRUE ) ;
- (* pDraw->pScreen->GetSpans)( (DrawablePtr)pPixmap, w, &pt, &width, 1, pDst ) ;
- pDst += linelength ;
- }
-
- DEALLOCATE_LOCAL(pbits) ;
- (* pGC->pScreen->DestroyPixmap)( pPixmap ) ;
- FreeScratchGC( pGC ) ;
- return ;
- }
-
- for ( i = 0 ; i < h ; i++ ) {
- pt.x = sx ;
- pt.y = sy + i ;
- width = w ;
- (* pDraw->pScreen->GetSpans)( pDraw, w, &pt, &width, 1, pDst ) ;
- pDst += linelength ;
- }
- }
- else
-#endif
- miGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine ) ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c
deleted file mode 100644
index c009d696e..000000000
--- a/hw/xfree86/xf4bpp/ppcPixFS.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/******************************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcPixFS.c /main/3 1996/02/21 17:57:57 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "mispans.h"
-#include "ppcGCstr.h"
-#include "ppcSpMcro.h"
-#include "vgaVideo.h"
-#include "ibmTrace.h"
-
-#define LeftMostBitInScreenLongWord SCRLEFT( 0xFFFFFFFF, 31 )
-
-/* GJA -- copied this from VGA */
-#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
-#define SCRRIGHT8(lw, n) ( (unsigned char) (((unsigned char)lw) >> (n)) )
-/*
-********** ********** ********** ********** ********** ********** **********
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in mfbCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-********** ********** ********** ********** ********** ********** **********
-*/
-/* A mod definition that goes smoothly into the negative.
- */
-static int
-modulo
-(
- int n1,
- int n2
-)
-{
- int tmp;
- if ( n1 < 0 ) {
- tmp = (-n1) % n2;
- if ( tmp == 0 ) {
- return 0;
- } else {
- return n2 - tmp;
- }
- } else {
- return n1 % n2;
- }
-}
-
-void
-xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
- DrawablePtr pDrawable ;
- GCPtr pGC ;
- int nInit ; /* number of spans to fill */
- DDXPointPtr pptInit ; /* pointer to list of start points */
- int *pwidthInit ; /* pointer to list of n widths */
- int fSorted ;
-{
- register unsigned long int pm, npm ;
- register unsigned long int fg ;
- register int alu ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- register unsigned char *addrl ; /* pointer to current longword in bitmap */
- int i ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE(("xf4bppSolidPixmapFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n", pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
-
- if ( pDrawable->type != DRAWABLE_PIXMAP ) {
- ErrorF("xf4bppSolidPixmapFS: drawable is not a pixmap\n") ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip) ;
- if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
- return ;
- pwidth = pwidthFree ;
-
- if ( !( pptFree = (DDXPointRec *)
- ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
- DEALLOCATE_LOCAL( pwidth ) ;
- return ;
- }
- ppt = pptFree ;
-
- n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted ) ;
-
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
- npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
-
- for ( ; n-- ; ppt++, pwidth++ ) {
- addrl = ( (unsigned char *) ( ( (PixmapPtr) pDrawable )->devPrivate.ptr ) )
- + ( ppt->y * ( (int) ( ( (PixmapPtr) pDrawable )->devKind ) ) )
- + ppt->x ;
- for ( i = *pwidth ; i-- ; addrl++ )
- {
- unsigned _p;
- DoRop( _p, alu, fg, *addrl );
- *addrl = ( *addrl & npm ) | ( pm & _p ) ;
- }
-#ifdef notdef /* PURDUE */
- *addrl = ( *addrl & npm ) | ( pm & DoRop( alu, fg, *addrl ) ) ;
-#endif /* PURDUE */
- }
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
-
-/* GJA -- copied from vgaStipple.c */
-static unsigned char
-vgagetbits
-(
- register const int x,
- register const unsigned int patternWidth,
- register const unsigned char * const lineptr
-)
-{
-register unsigned char bits ;
-register const unsigned char *cptr ;
-register int shift ;
-register int wrap ;
-
-cptr = lineptr + ( x >> 3 ) ;
-bits = *cptr ;
-if ((shift = x & 7))
- bits = SCRLEFT8( bits, shift ) | SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
-if ( ( wrap = x + 8 - patternWidth ) > 0 ) {
- bits &= SCRLEFT8( 0xFF, wrap ) ;
- bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
-}
-
-/* GJA -- Handle extraction of 8 bits from < 8 bits wide stipple.
- * I duplicated case 4,5,6,7 to give the compiler a chance to optimize.
- */
-switch (patternWidth) {
-case 1: /* Not really useful. */
- bits &= ~SCRRIGHT8(0xFF,1);
- bits |= SCRRIGHT8(bits,1);
- bits |= SCRRIGHT8(bits,2);
- bits |= SCRRIGHT8(bits,4);
- break;
-case 2:
- bits &= ~SCRRIGHT8(0xFF,2);
- bits |= SCRRIGHT8(bits,2); bits |= SCRRIGHT8(bits,4); break;
-case 3:
- bits &= ~SCRRIGHT8(0xFF,3);
- bits |= (SCRRIGHT8(bits,3) | SCRRIGHT8(bits,6)); break;
-case 4:
- bits = (bits & ~SCRRIGHT8(0xFF,4)) | SCRRIGHT8(bits,4); break;
-case 5:
- bits = (bits & ~SCRRIGHT8(0xFF,5)) | SCRRIGHT8(bits,5); break;
-case 6:
- bits = (bits & ~SCRRIGHT8(0xFF,6)) | SCRRIGHT8(bits,6); break;
-case 7:
- bits = (bits & ~SCRRIGHT8(0xFF,7)) | SCRRIGHT8(bits,7); break;
-default:
- ;
- /* Do nothing, of course */
-}
-
-return bits ;
-}
-
-void
-xf4bppStipplePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-register DrawablePtr pDrawable ;
-GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- register unsigned char *pdst ; /* pointer to current word in bitmap */
- register int *psrc ; /* pointer to current word in tile */
- register unsigned long int pm, npm ;
- register unsigned long int fg ;
- register int alu ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- PixmapPtr pTile ; /* pointer to tile we want to fill with */
- int width, x, xSrc, ySrc ;
- int tlwidth, tileWidth ;
- unsigned char *psrcT ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
- int xoff, count, stip, i ;
-
- TRACE(("xf4bppStipplePixmapFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
-
- if ( pDrawable->type != DRAWABLE_PIXMAP ) {
- ErrorF( "xf4bppStippleWindowFS: drawable is not a pixmap\n") ;
- return ;
- }
- if ( pGC->stipple->drawable.depth != 1 ) {
- ErrorF( "ppcStippleFS: bad depth\ntype = %d, depth = %d\n",
- pDrawable->type, pGC->stipple->drawable.depth ) ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
-
- pTile = pGC->stipple ;
- tlwidth = pTile->devKind ;
-
- tileWidth = pTile->drawable.width ;
-
- npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
-
- /* this replaces rotating the stipple. Instead, we just adjust the offset
- * at which we start grabbing bits from the stipple */
- xSrc = pGC->patOrg.x + pDrawable->x;
- ySrc = pGC->patOrg.y + pDrawable->y;
-
- while ( n-- ) {
- pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
- + ( ppt->y * ( (int) ( ( (PixmapPtr) pDrawable )->devKind ) ) )
- + ppt->x ;
- psrcT = (unsigned char *)pTile->devPrivate.ptr
- + ( modulo( ppt->y - ySrc, pTile->drawable.height ) * tlwidth ) ;
- x = ppt->x ;
-
- xoff = modulo( x - xSrc, tileWidth) ;
- for ( width = *pwidth ; width ; psrc++, width -= count, xoff+=count ) {
-
- if ( xoff >= tileWidth ) xoff -= tileWidth;
-
- if ( width < 8 )
- count = width;
- else
- count = 8;
-
- stip = vgagetbits( xoff, tileWidth, psrcT ) ;
-
- for ( i = count ; i-- ; ) {
- if ( stip & 128 )
- {
- unsigned _p;
- DoRop( _p, alu, fg, *pdst ) ;
- *pdst = ( *pdst & npm ) | ( pm & _p ) ;
- }
-#ifdef notdef /* PURDUE */
- *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, fg, *pdst ) ) ;
-#endif /* PURDUE */
- pdst++ ;
- stip = SCRLEFT( stip, 1 ) ;
- }
- }
- ppt++ ;
- pwidth++ ;
- }
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
-
-void
-xf4bppOpStipplePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-DrawablePtr pDrawable ;
-GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- register unsigned char *pdst ; /* pointer to current word in bitmap */
- register unsigned long int pm, npm ;
- register unsigned long int fg, bg ;
- register int alu ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- register int *psrc ; /* pointer to current word in tile */
- PixmapPtr pTile ; /* pointer to tile we want to fill with */
- int width ;
- int xSrc, ySrc ;
- int tlwidth, tileWidth ;
- unsigned char *psrcT ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
- int xoff, count, stip, i ;
-
- TRACE( ( "xf4bppOpStipplePixmapFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( pGC->stipple->drawable.depth != 1 ) {
- ErrorF( "xf4bppOpStipplePixmapFS: bad depth\ntype = %d, depth = %d\n",
- pDrawable->type, pGC->stipple->drawable.depth ) ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
- bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
-
- pTile = pGC->stipple ;
- tlwidth = pTile->devKind ;
- tileWidth = pTile->drawable.width ;
-
- xSrc = pGC->patOrg.x + pDrawable->x;
- ySrc = pGC->patOrg.y + pDrawable->y;
-
- /* this replaces rotating the stipple. Instead, we just adjust the offset
- * at which we start grabbing bits from the stipple */
- for ( ; n-- ; ppt++, pwidth++ ) {
- pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
- + ( ppt->y * ( (int) ( (PixmapPtr) pDrawable )->devKind ) )
- + ppt->x ;
- psrcT = (unsigned char *)pTile->devPrivate.ptr
- + ( modulo( ppt->y - ySrc, pTile->drawable.height ) * tlwidth ) ;
-
- xoff = modulo( ppt->x - xSrc, tileWidth) ;
-
- for ( width = *pwidth ; width ; psrc++, width -= count, xoff+=count ) {
-
- if ( xoff >= tileWidth ) xoff -= tileWidth;
-
- if ( width < 8 )
- count = width;
- else
- count = 8;
-
- stip = vgagetbits( xoff, tileWidth, psrcT ) ;
- for ( i = count ; i-- ; pdst++, stip = SCRLEFT( stip, 1 ) )
- if ( stip & 128 )
- {
- unsigned _p;
- DoRop( _p, alu, fg, *pdst ) ;
- *pdst = ( *pdst & npm ) | ( pm & _p ) ;
- }
-#ifdef notdef /* PURDUE */
- *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, fg, *pdst ) ) ;
-#endif /* PURDUE */
- else
- {
- unsigned _p;
- DoRop( _p, alu, bg, *pdst ) ;
- *pdst = ( *pdst & npm ) | ( pm & _p ) ;
- }
-#ifdef notdef /* PURDUE */
- *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, bg, *pdst ) ) ;
-#endif /* PURDUE */
- }
- }
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
-
-void
-xf4bppTilePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-register DrawablePtr pDrawable ;
-GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- register unsigned char *pdst ; /* pointer to current word in bitmap */
- register unsigned char *psrc ; /* pointer to current word in tile */
- register PixmapPtr pTile ; /* pointer to tile we want to fill with */
- int i ;
- int alu ;
- unsigned char pm, npm ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- int tileWidth ;
- int xSrc, ySrc;
- unsigned char *psrcT ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE( ( "ppcTileFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) ) {
- mfbTileFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ;
- return ;
- }
- if ( !xf4bppDepthOK( pDrawable, pGC->tile.pixmap->drawable.depth ) ) {
- ErrorF( "ppcTileFS: bad depth\ntype = %d, depth = %d\n",
- pDrawable->type, pDrawable->depth) ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- /* the following code is for 8 bits per pixel addressable memory only */
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
- pTile = pGC->tile.pixmap ;
- tileWidth = pTile->drawable.width ;
-
- xSrc = pGC->patOrg.x + pDrawable->x;
- ySrc = pGC->patOrg.y + pDrawable->y;
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile */
- for ( ; n-- ; ppt++, pwidth++ ) {
- pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
- + ( ppt->y * ( (int) ( (PixmapPtr) pDrawable )->devKind ) )
- + ppt->x ;
- psrcT = (unsigned char *) pTile->devPrivate.ptr
- + ( modulo( ppt->y - ySrc, pTile->drawable.height) * pTile->devKind ) ;
-
- psrc = psrcT + modulo( ppt->x - xSrc, tileWidth ) ;
- for ( i = *pwidth ; i-- ; pdst++, psrc++ ) {
- if ( psrc >= ( psrcT + tileWidth ) )
- psrc = psrcT ;
- {
- unsigned _p;
- DoRop( _p, alu, *psrc, *pdst ) ;
- *pdst = ( *pdst & npm ) | ( pm & _p ) ;
- }
-#ifdef notdef /* PURDUE */
- *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, *psrc, *pdst ) ) ;
-#endif /* PURDUE */
- }
- }
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c
deleted file mode 100644
index 2317fbdfa..000000000
--- a/hw/xfree86/xf4bpp/ppcPixmap.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c,v 1.5 2000/04/27 16:26:49 eich Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcPixmap.c /main/5 1996/02/21 17:58:00 kaleb $ */
-
-#include "xf4bpp.h"
-#include "servermd.h"
-#include "OScompiler.h"
-#include "ibmTrace.h"
-#include "scrnintstr.h"
-
-PixmapPtr
-xf4bppCreatePixmap( pScreen, width, height, depth )
- ScreenPtr pScreen ;
- int width ;
- int height ;
- int depth ;
-{
- register PixmapPtr pPixmap = (PixmapPtr)NULL;
- int size ;
-
- TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ;
-
- if ( depth > 8 )
- return (PixmapPtr) NULL ;
-
- size = PixmapBytePad(width, depth);
- pPixmap = AllocatePixmap (pScreen, (height * size));
-
- if ( !pPixmap )
- return (PixmapPtr) NULL ;
- pPixmap->drawable.type = DRAWABLE_PIXMAP ;
- pPixmap->drawable.class = 0 ;
- pPixmap->drawable.pScreen = pScreen ;
- pPixmap->drawable.depth = depth ;
- pPixmap->drawable.id = 0 ;
- pPixmap->drawable.bitsPerPixel = ( depth == 1 ) ? 1 : 8 ;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER ;
- pPixmap->drawable.x = 0 ;
- pPixmap->drawable.y = 0 ;
- pPixmap->drawable.width = width ;
- pPixmap->drawable.height = height ;
- pPixmap->devKind = size;
- pPixmap->refcnt = 1 ;
- size = height * pPixmap->devKind ;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap)
- + pScreen->totalPixmapSize);
-#else
- pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1);
-#endif
- bzero( (char *) pPixmap->devPrivate.ptr, size ) ;
- return pPixmap ;
-}
-
-PixmapPtr
-xf4bppCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
-
- TRACE(("xf4bppCopyPixmap(pSrc=0x%x)\n", pSrc)) ;
- size = pSrc->drawable.height * pSrc->devKind;
- pDst = xalloc(sizeof(PixmapRec) + size);
- if (!pDst)
- return NullPixmap;
- pDst->drawable = pSrc->drawable;
- pDst->drawable.id = 0;
- pDst->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pDst->devKind = pSrc->devKind;
- pDst->refcnt = 1;
- pDst->devPrivate.ptr = (pointer)(pDst + 1);
- MOVE( (char *)pSrc->devPrivate.ptr, (char *)pDst->devPrivate.ptr, size ) ;
- return pDst;
-}
diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c
deleted file mode 100644
index f52343fc9..000000000
--- a/hw/xfree86/xf4bpp/ppcPntWin.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.4 2003/11/17 22:20:42 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcPntWin.c /main/5 1996/02/21 17:58:04 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "ibmTrace.h"
-
-/* NOTE: These functions only work for visuals up to 31-bits deep */
-static void xf4bppPaintWindowSolid(
- WindowPtr,
- RegionPtr,
- int
-);
-static void xf4bppPaintWindowTile(
- WindowPtr,
- RegionPtr,
- int
-);
-
-void
-xf4bppPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
-
- register mfbPrivWin *pPrivWin;
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
-
- TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n",
- pWin,pRegion,what));
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- return;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground)
- {
- xf4bppPaintWindowTile(pWin, pRegion, what);
- return;
- }
- break;
- case BackgroundPixel:
- xf4bppPaintWindowSolid(pWin, pRegion, what);
- return;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- xf4bppPaintWindowSolid(pWin, pRegion, what);
- return;
- }
- else if (pPrivWin->fastBorder)
- {
- xf4bppPaintWindowTile(pWin, pRegion, what);
- return;
- }
- break;
- }
- miPaintWindow(pWin, pRegion, what);
-}
-
-static void
-xf4bppPaintWindowSolid(pWin, pRegion, what)
- register WindowPtr pWin;
- register RegionPtr pRegion;
- int what;
-{
- register int nbox;
- register BoxPtr pbox;
- register unsigned long int pixel;
- register unsigned long int pm ;
-
- TRACE(("xf4bppPaintWindowSolid(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what));
-
- if ( !( nbox = REGION_NUM_RECTS(pRegion)))
- return ;
- pbox = REGION_RECTS(pRegion);
-
- if (what == PW_BACKGROUND)
- pixel = pWin->background.pixel;
- else
- pixel = pWin->border.pixel;
-
- pm = ( 1 << pWin->drawable.depth ) - 1 ;
- for ( ; nbox-- ; pbox++ ) {
- /*
- * call fill routine, the parms are:
- * fill(color, alu, planes, x, y, width, height);
- */
- xf4bppFillSolid( pWin, pixel, GXcopy, pm, pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1 ) ;
- }
- return ;
-}
-
-static void
-xf4bppPaintWindowTile(pWin, pRegion, what)
- register WindowPtr pWin;
- register RegionPtr pRegion;
- int what;
-{
- register int nbox;
- register BoxPtr pbox;
- register PixmapPtr pTile;
- register unsigned long int pm ;
-
- TRACE(("xf4bppPaintWindowTile(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what));
-
- if ( !( nbox = REGION_NUM_RECTS(pRegion)))
- return ;
- pbox = REGION_RECTS(pRegion);
-
- if (what == PW_BACKGROUND)
- pTile = pWin->background.pixmap;
- else
- pTile = pWin->border.pixmap;
-
- pm = ( 1 << pWin->drawable.depth ) - 1 ;
- for ( ; nbox-- ; pbox++ ) {
- /*
- * call tile routine, the parms are:
- * tile(tile, alu, planes, x, y, width, height,xSrc,ySrc);
- */
- xf4bppTileRect(pWin, pTile, GXcopy, pm,
- pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
- pWin->drawable.x, pWin->drawable.y );
- }
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcPolyPnt.c b/hw/xfree86/xf4bpp/ppcPolyPnt.c
deleted file mode 100644
index d080a623f..000000000
--- a/hw/xfree86/xf4bpp/ppcPolyPnt.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPolyPnt.c,v 1.4 1999/09/25 14:38:17 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: ppcPolyPnt.c /main/5 1996/02/21 17:58:07 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "ppcGCstr.h"
-#include "ibmTrace.h"
-
-void
-xf4bppPolyPoint( pDrawable, pGC, mode, npt, pptInit )
-DrawablePtr pDrawable ;
-GCPtr pGC ;
-int mode ; /* Origin or Previous */
-int npt ;
-xPoint *pptInit ;
-{
-register xPoint *ppt ;
-ppcPrivGC *devPriv ;
-int alu ;
-int nptTmp ;
-
-TRACE( ("xf4bppPolyPoint(0x%x,0x%x,%d,%d,0x%x)\n",
- pDrawable, pGC, mode, npt, pptInit ) ) ;
-
-if ( pDrawable->type == DRAWABLE_PIXMAP ) {
- if ( pGC->alu != GXnoop )
- miPolyPoint( pDrawable, pGC, mode, npt, pptInit ) ;
- return ;
-}
-
-devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
-if ( ( alu = devPriv->colorRrop.alu ) == GXnoop )
- return ;
-
-/* make pointlist origin relative */
-if ( mode == CoordModePrevious )
- for ( ppt = pptInit, nptTmp = npt ; --nptTmp ; ) {
- ppt++ ;
- ppt->x += (ppt-1)->x ;
- ppt->y += (ppt-1)->y ;
- }
-
-if ( pGC->miTranslate ) {
- register int xorg = pDrawable->x ;
- register int yorg = pDrawable->y ;
- for ( ppt = pptInit, nptTmp = npt ; nptTmp-- ; ppt++ ) {
- ppt->x += xorg ;
- ppt->y += yorg ;
- }
-}
-
-{
- register RegionPtr pRegion = pGC->pCompositeClip ;
- register unsigned long int fg = devPriv->colorRrop.fgPixel ;
- register unsigned long int pm = devPriv->colorRrop.planemask ;
- BoxRec box ; /* Scratch Space */
-
- if ( ! REGION_NUM_RECTS(pRegion))
- return ;
-
- for ( ppt = pptInit ; npt-- ; ppt++ )
- if (POINT_IN_REGION(pDrawable->pScreen, pRegion,
- ppt->x, ppt->y, &box))
- xf4bppFillSolid( (WindowPtr)pDrawable,
- fg, alu, pm, ppt->x, ppt->y, 1, 1 ) ;
-}
-
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcPolyRec.c b/hw/xfree86/xf4bpp/ppcPolyRec.c
deleted file mode 100644
index 754eb3732..000000000
--- a/hw/xfree86/xf4bpp/ppcPolyRec.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPolyRec.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcPolyRec.c /main/4 1996/02/21 17:58:11 kaleb $ */
-
-#include "xf4bpp.h"
-
-void
-xf4bppPolyRectangle(pDraw, pGC, nrects, pRects)
- DrawablePtr pDraw;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- int i;
- xRectangle *pR = pRects;
- xRectangle *tmprects, *tmprectsinit;
- int lw, fs, ss;
-
- if ( ! ( tmprectsinit = tmprects = (xRectangle *)ALLOCATE_LOCAL( ( sizeof ( xRectangle ) * nrects ) << 2 ) ) )
- return;
-
- lw = pGC->lineWidth;
- ss = lw >> 1; /* skinny side of line */
- fs = ( lw + 1 ) >> 1; /* fat side of line */
-
- for (i=0; i<nrects; i++)
- {
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x + pR->width - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + pR->height - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- pR++;
- }
-
- (* pGC->ops->PolyFillRect)( pDraw, pGC, nrects << 2, tmprectsinit );
-
- DEALLOCATE_LOCAL( tmprectsinit );
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcQuery.c b/hw/xfree86/xf4bpp/ppcQuery.c
deleted file mode 100644
index 57d5fcff8..000000000
--- a/hw/xfree86/xf4bpp/ppcQuery.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcQuery.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: ppcQuery.c /main/3 1996/02/21 17:58:18 kaleb $ */
-
-#include "xf4bpp.h"
-
-void
-xf4bppQueryBestSize
-(
- register int class,
- register unsigned short *pwidth,
- register unsigned short *pheight,
- ScreenPtr pScreen
-)
-{
-if ( class == CursorShape )
- *pwidth = *pheight = 32 ; /* ppc's cursor max out at 32 by 32 */
-else /* either TileShape or StippleShape */
- /* Round Up To Nearest Multiple Of 8 -- We don't care what height they use */
- *pwidth = ( *pwidth + 0x7 ) & ~ 0x7 ;
-
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcRslvC.c b/hw/xfree86/xf4bpp/ppcRslvC.c
deleted file mode 100644
index 5d33bc3c9..000000000
--- a/hw/xfree86/xf4bpp/ppcRslvC.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcRslvC.c,v 1.5 2001/12/17 20:00:46 dawes Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: ppcRslvC.c /main/7 1996/02/21 17:58:25 kaleb $ */
-
-/* Generic Color Resolution Scheme
- * P. Shupak 12/31/87
- */
-
-#include "xf4bpp.h"
-#include "scrnintstr.h"
-
-/*
- * New colormap routines that can support multiple Visual types.
- */
-
-static unsigned short defstaticpalette[16][3] = {
- /* R G B */
- { 0x0000, 0x0000, 0x0000 }, /* black */
- { 0xFFFF, 0xFFFF, 0xFFFF }, /* white */
- { 0xAAAA, 0xAAAA, 0xAAAA }, /* grey */
- { 0x0000, 0x0000, 0xAAAA }, /* dark blue */
- { 0x0000, 0x0000, 0xFFFF }, /* medium blue */
- { 0x0000, 0xAAAA, 0xFFFF }, /* light blue */
- { 0x0000, 0xFFFF, 0xFFFF }, /* cyan */
- { 0x0000, 0xAAAA, 0x0000 }, /* dark green */
- { 0x0000, 0xFFFF, 0x0000 }, /* green */
- { 0xAAAA, 0xFFFF, 0x5555 }, /* pale green */
- { 0xAAAA, 0x5555, 0x0000 }, /* brown */
- { 0xFFFF, 0xAAAA, 0x0000 }, /* light brown */
- { 0xFFFF, 0xFFFF, 0x0000 }, /* yellow */
- { 0xAAAA, 0x0000, 0xAAAA }, /* purple */
- { 0xFFFF, 0x0000, 0xFFFF }, /* magenta */
- { 0xFFFF, 0x0000, 0x0000 }, /* red */
- };
-
-Bool
-xf4bppInitializeColormap(pmap)
- register ColormapPtr pmap;
-{
- register unsigned i;
- register VisualPtr pVisual;
- unsigned lim, maxent, shift;
-
- pVisual = pmap->pVisual;
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
- shift = 16 - pVisual->bitsPerRGBValue;
- maxent = pVisual->ColormapEntries - 1;
-
- switch( pVisual->class )
- {
- case StaticGray:
- for ( i = 0 ; i < maxent ; i++ ) {
- pmap->red[i].co.local.red =
- pmap->red[i].co.local.green =
- pmap->red[i].co.local.blue =
- ((((i * 65535) / maxent) >> shift) * 65535) / lim;
- }
- break;
- case StaticColor:
- for ( i = 0 ; i < 16 ; i++ ) {
- pmap->red[i].co.local.red = (defstaticpalette[i][0]);
- pmap->red[i].co.local.green = (defstaticpalette[i][1]);
- pmap->red[i].co.local.blue = (defstaticpalette[i][2]);
- }
- break;
- case GrayScale:
- case PseudoColor:
- for(i=0;i<=maxent;i++) {
- int a,b,c;
- a = i << 10;
- b = i << 12;
- c = i << 14;
- pmap->red[i].co.local.red = a;
- pmap->red[i].co.local.green = b;
- pmap->red[i].co.local.blue = c;
- }
- break;
- case TrueColor:
- case DirectColor:
- default:
- ErrorF( "Unsupported Visual class %d\b", pVisual->class );
- return FALSE;
- }
- return TRUE;
-}
-
-void
-xf4bppResolveColor( pred, pgreen, pblue, pVisual )
-register unsigned short* pred ;
-register unsigned short* pgreen ;
-register unsigned short* pblue ;
-register VisualPtr pVisual ;
-{
- unsigned lim, maxent, shift;
-
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
- shift = 16 - pVisual->bitsPerRGBValue;
- maxent = pVisual->ColormapEntries - 1;
-
- switch( pVisual->class )
- {
- case StaticGray:
- *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
- *pred = (((*pred * (maxent + 1)) >> 16) * 65535) / maxent;
- *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
- break;
- case StaticColor:
- break;
- case GrayScale:
- *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
- *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
- break;
- case PseudoColor:
- /* rescale to rgb bits */
- *pred = ((*pred >> shift) * 65535) / lim;
- *pgreen = ((*pgreen >> shift) * 65535) / lim;
- *pblue = ((*pblue >> shift) * 65535) / lim;
- break;
- case TrueColor:
- case DirectColor:
- default:
- ErrorF( "Unsupported Visual class %d\b", pVisual->class );
- }
-}
-
diff --git a/hw/xfree86/xf4bpp/ppcSetSp.c b/hw/xfree86/xf4bpp/ppcSetSp.c
deleted file mode 100644
index 81294b2cc..000000000
--- a/hw/xfree86/xf4bpp/ppcSetSp.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcSetSp.c,v 1.3 1999/06/06 08:49:02 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcSetSp.c /main/5 1996/02/21 17:58:32 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "servermd.h"
-
-/* SetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-static void
-ppcSetScanline
-(
- register int pixCount, /* width of scanline in bits */
- register char *psrc,
- register unsigned char *pdst, /* where to put the bits */
- register int pm, /* plane mask */
- const int alu /* raster op */
-)
-{
-register int npm = ~pm ; /* inverted plane mask */
-register char tmpx ;
-
-pm &= 0x0F; npm &= 0x0F; /* GJA */
-
-switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- while ( pixCount-- )
- *pdst++ &= npm ;
- break ;
- case GXand: /* 0x1 src AND dst */
- while ( pixCount-- )
- *pdst++ &= *psrc++ | npm ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- for ( ; pixCount-- ; pdst++, psrc++ ) {
- tmpx = *pdst;
- *pdst = ( tmpx & npm ) | ( pm & *psrc & ~tmpx ) ;
- }
- break ;
- case GXcopy: /* 0x3 src */
- for ( ; pixCount-- ; pdst++, psrc++ )
- *pdst = ( *pdst & npm ) | ( pm & *psrc ) ;
- break ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- while ( pixCount-- )
- *pdst++ &= npm | ~*psrc++ ;
- break ;
- case GXnoop: /* 0x5 dst */
- break ;
- case GXxor: /* 0x6 src XOR dst */
- while ( pixCount-- )
- *pdst++ ^= pm & *psrc++ ;
- break ;
- case GXor: /* 0x7 src OR dst */
- while ( pixCount-- )
- *pdst++ |= *psrc++ & pm ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- for ( ; pixCount-- ; pdst++, psrc++ ) {
- tmpx = *pdst;
- *pdst = ( tmpx & npm ) | ( pm & ~( tmpx | *psrc ) ) ;
- }
- break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- while ( pixCount-- )
- *pdst++ ^= pm & ~ *psrc++ ;
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- for ( ; pixCount-- ; pdst++, psrc++ ) {
- tmpx = *pdst;
- *pdst = ( tmpx & npm ) | ( pm & ( *psrc | ~tmpx ) ) ;
- }
- break ;
- case GXinvert: /* 0xa NOT dst */
- while ( pixCount-- )
- *pdst++ ^= pm ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- for ( ; pixCount-- ; pdst++, psrc++ )
- *pdst = ( *pdst & npm ) | ( pm & ~ *psrc ) ;
- break ;
- case GXorInverted: /* 0xd NOT src OR dst */
- while ( pixCount-- )
- *pdst++ |= pm & ~ *psrc++ ;
- break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- for ( ; pixCount-- ; pdst++, psrc++ ) {
- tmpx = *pdst;
- *pdst = ( tmpx & npm ) | ( pm & ~( tmpx & *psrc ) ) ;
- }
- break ;
- case GXset: /* 0xf 1 */
- while ( pixCount-- )
- *pdst++ |= pm ;
- break ;
- default:
- ErrorF( "ppcSetScanLine: bad alu value == 0x%02X\n", alu ) ;
- break ;
-}
-
-return ;
-}
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-xf4bppSetSpans( pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted )
- register DrawablePtr pDrawable ;
- GCPtr pGC ;
- char *psrc ;
- register DDXPointPtr ppt ;
- int *pwidth ;
- int nspans ;
- int fSorted ;
-{
- unsigned char *pdstBase = NULL; /* start of dst bitmap */
- int widthDst = 0; /* width of bitmap in words */
- register BoxPtr pbox, pboxLast, pboxTest ;
- register DDXPointPtr pptLast ;
- RegionPtr prgnDst ;
- register int width ;
- int xStart, xEnd ;
- int yMax ;
- int alu ;
- int pm ;
-
- /* allow for 1-deep windows on nfb machines (eg apa8, aed) */
- if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) ) {
- mfbSetSpans( pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted ) ;
- return ;
- }
-
- if ( !( pm = pGC->planemask & ~( (~0) << pDrawable->depth ) )
- || ( ( alu = pGC->alu ) == GXnoop ) )
- return ;
-
- prgnDst = pGC->pCompositeClip ;
-
- if ( ! REGION_NUM_RECTS(prgnDst))
- return ;
-
- pboxLast = ( pbox = REGION_RECTS(prgnDst) ) + REGION_NUM_RECTS(prgnDst);
- pptLast = ppt + nspans ;
-
- if ( pDrawable->type == DRAWABLE_WINDOW ) {
- yMax = (int) pDrawable->height + pDrawable->y ;
- }
- else {
- pdstBase = (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr ;
- widthDst = (int) ( (PixmapPtr) pDrawable )->devKind ;
- yMax = pDrawable->height ;
- }
-
- if ( fSorted ) {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- for ( pboxTest = pbox ;
- ( ppt < pptLast ) && ( ppt->y < yMax ) ;
- ppt++, pwidth++,
- psrc += PixmapBytePad( width, pDrawable->depth ) ) {
- width = *pwidth ;
- for ( pbox = pboxTest ;
- pbox < pboxLast ;
- pbox++ ) {
- if ( pbox->y2 <= ppt->y ) {
- /* clip box is before scanline */
- pboxTest = pbox + 1 ;
- }
- else if ( ( pbox->y1 > ppt->y )
- || ( pbox->x1 > ppt->x + width ) )
- break ; /* scanline before clip box or left of clip box */
- else if ( pbox->x2 > ppt->x ) {
- /* some of the scanline is in the current clip box */
- xStart = MAX( pbox->x1, ppt->x ) ;
- xEnd = MIN( ppt->x + width, pbox->x2 ) ;
- if ( pDrawable->type == DRAWABLE_PIXMAP )
- ppcSetScanline( xEnd - xStart,
- psrc + ( xStart - ppt->x ),
- pdstBase + xStart
- + ( ppt->y * widthDst ),
- pm, alu ) ;
- else
- xf4bppDrawColorImage( (WindowPtr)pDrawable,
- xStart, ppt->y, xEnd - xStart, 1,
- (unsigned char *)psrc + ( xStart - ppt->x ),
- xEnd - xStart, alu, pm ) ;
- if ( ppt->x + width <= pbox->x2 )
- break ; /* End of the line, as it were */
- }
- }
- /* We've tried this line against every box ; it must be outside them
- * all. move on to the next point */
- }
- }
- else {
- /* scan lines not sorted. We must clip each line against all the boxes */
- for ( ;
- ppt < pptLast ;
- ppt++, pwidth++,
- psrc += PixmapBytePad( width, pDrawable->depth ) ) {
- width = *pwidth ;
- if ( ppt->y >= 0 && ppt->y < yMax ) {
- for ( pbox = REGION_RECTS(prgnDst) ; pbox < pboxLast ; pbox++ ) {
- if ( pbox->y1 > ppt->y )
- break ; /* rest of clip region is above this scanline */
- else if ( ( pbox->y2 > ppt->y )
- && ( pbox->x1 <= ppt->x + width )
- && ( pbox->x2 > ppt->x ) ) {
- xStart = MAX( pbox->x1, ppt->x ) ;
- xEnd = MIN( pbox->x2, ppt->x + width ) ;
- if ( pDrawable->type == DRAWABLE_PIXMAP )
- ppcSetScanline( xEnd - xStart,
- psrc + ( xStart - ppt->x ),
- /* ^ GJA */
- ( ( pdstBase
- + ( ppt->y * widthDst ) )
- + xStart ),
- pm, alu ) ;
- else /* pDrawable->type == DRAWABLE_WINDOW */
- xf4bppDrawColorImage( (WindowPtr)pDrawable,
- xStart, ppt->y, xEnd - xStart, 1,
- (unsigned char *)psrc + ( xStart - ppt->x ),
- /* GJA ^ */
- xEnd - xStart, alu, pm ) ;
- }
-
- }
- }
- }
- }
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcSpMcro.h b/hw/xfree86/xf4bpp/ppcSpMcro.h
deleted file mode 100644
index 7ea244f66..000000000
--- a/hw/xfree86/xf4bpp/ppcSpMcro.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcSpMcro.h,v 1.2 1998/07/25 16:59:42 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: ppcSpMcro.h /main/3 1996/02/21 17:58:36 kaleb $ */
-
-/* This screwy macro is used in all the spans routines and you find
- it all over the place, so it is a macro just to tidy things up.
-*/
-
-#define SETSPANPTRS(IN,N,IPW,PW,IPPT,PPT,FPW,FPPT,FSORT) \
- { \
- N = IN * miFindMaxBand(pGC->pCompositeClip); \
- if(!(PW = (int *)ALLOCATE_LOCAL(N * sizeof(int)))) \
- return; \
- if(!(PPT = (DDXPointRec *)ALLOCATE_LOCAL(N * sizeof(DDXPointRec)))) \
- { \
- DEALLOCATE_LOCAL(PW); \
- return; \
- } \
- FPW = PW; \
- FPPT = PPT; \
- N = miClipSpans(pGC->pCompositeClip, IPPT, IPW, IN, \
- PPT, PW, FSORT); \
- }
-
diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c
deleted file mode 100644
index fc38cdcfe..000000000
--- a/hw/xfree86/xf4bpp/ppcWinFS.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.4 2003/11/03 05:11:57 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/******************************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcWinFS.c /main/3 1996/02/21 17:58:39 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "mispans.h"
-#include "ppcGCstr.h"
-#include "ppcSpMcro.h"
-#include "ibmTrace.h"
-
-#define LeftMostBitInScreenLongWord SCRLEFT( 0xFFFFFFFF, 31 )
-/*
-********** ********** ********** ********** ********** ********** **********
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in mfbCreateGC().)
-
- the number of new scanlines created by clipping ==
-MaxRectsPerBand * nSpans.
-********** ********** ********** ********** ********** ********** **********
-*/
-
-void
-xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
- DrawablePtr pDrawable ;
- GCPtr pGC ;
- int nInit ; /* number of spans to fill */
- DDXPointPtr pptInit ; /* pointer to list of start points */
- int *pwidthInit ; /* pointer to list of n widths */
- int fSorted ;
-{
- register unsigned long int pm ;
- register unsigned long int fg ;
- register int alu ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE( ( "xf4bppSolidWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( pDrawable->type != DRAWABLE_WINDOW ) {
- ErrorF( "xf4bppSolidWindowFS: drawable is not a window\n") ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- n = nInit * miFindMaxBand( pGC->pCompositeClip ) ;
- if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
- return ;
- pwidth = pwidthFree ;
-
- if ( !( pptFree = (DDXPointRec *)
- ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
- DEALLOCATE_LOCAL( pwidth ) ;
- return ;
- }
- ppt = pptFree ;
-
- n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted ) ;
-
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
-
- for ( ; n-- ; ppt++, pwidth++ )
- if ( *pwidth )
- xf4bppFillSolid( (WindowPtr)pDrawable,
- fg, alu, pm, ppt->x, ppt->y, *pwidth, 1 ) ;
-
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
-
-void
-xf4bppStippleWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-DrawablePtr pDrawable ;
-register GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- register unsigned long int pm ;
- register unsigned long int fg ;
- register int alu ;
- /* next three parameters are post-clip */
- int n ; /* number of spans to fill */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- PixmapPtr pTile ; /* pointer to tile we want to fill with */
- int xSrc ;
- int ySrc ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE( ( "xf4bppStippleWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( pDrawable->type != DRAWABLE_WINDOW ) {
- ErrorF( "xf4bppStippleWindowFS: drawable is not a window\n" ) ;
- return ;
- }
-
- if ( pGC->stipple->drawable.depth != 1 ) {
- ErrorF("ppcStippleFS: bad depth\ntype = %d, depth = %d\n",
- pDrawable->type, pGC->stipple->drawable.depth ) ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
-
- xSrc = pGC->patOrg.x + pDrawable->x ;
- ySrc = pGC->patOrg.y + pDrawable->y ;
- pTile = pGC->stipple ;
-
- for ( ; n-- ; ppt++, pwidth++ )
- xf4bppFillStipple( (WindowPtr)pDrawable, pTile, fg, alu, pm,
- ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
-
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
-
- return ;
-}
-
-void
-xf4bppOpStippleWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-DrawablePtr pDrawable ;
-register GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- int n ; /* number of spans to fill */
- int xSrc ;
- int ySrc ;
- unsigned long int pm ;
- unsigned long int fg, bg ;
- int alu ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE( ( "xf4bppOpStippleWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( pGC->stipple->drawable.depth != 1 ) {
- ErrorF( "xf4bppOpStippleWindowFS: bad depth\ntype = %d, depth = %d\n",
- pDrawable->type, pGC->stipple->drawable.depth ) ;
- return ;
- }
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
- fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
- bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
-
- xSrc = pGC->patOrg.x + pDrawable->x ;
- ySrc = pGC->patOrg.y + pDrawable->y ;
-
- for ( ; n-- ; ppt++, pwidth++ )
- xf4bppOpaqueStipple( (WindowPtr)pDrawable, pGC->stipple, fg, bg, alu, pm,
- ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
-
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
-
-void
-xf4bppTileWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
-DrawablePtr pDrawable ;
-register GC *pGC ;
-int nInit ; /* number of spans to fill */
-DDXPointPtr pptInit ; /* pointer to list of start points */
-int *pwidthInit ; /* pointer to list of n widths */
-int fSorted ;
-{
- /* next three parameters are post-clip */
- register DDXPointPtr ppt ; /* pointer to list of start points */
- register int *pwidth ; /* pointer to list of n widths */
- int n ; /* number of spans to fill */
- unsigned char pm ;
- int alu ;
- int xSrc ;
- int ySrc ;
- int *pwidthFree ; /* copies of the pointers to free */
- DDXPointPtr pptFree ;
-
- TRACE( ( "xf4bppTileWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
- pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
-
- if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
- return ;
-
- SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
- pptFree, pwidth, ppt, fSorted ) ;
-
- xSrc = pGC->patOrg.x + pDrawable->x ;
- ySrc = pGC->patOrg.y + pDrawable->y ;
- pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
-
- for ( ; n-- ; ppt++, pwidth++ )
- xf4bppTileRect( (WindowPtr)pDrawable, pGC->tile.pixmap, alu, pm,
- ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
-
- DEALLOCATE_LOCAL( pptFree ) ;
- DEALLOCATE_LOCAL( pwidthFree ) ;
- return ;
-}
diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c
deleted file mode 100644
index 1de8d68ee..000000000
--- a/hw/xfree86/xf4bpp/ppcWindow.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWindow.c,v 1.4 1999/09/25 14:38:17 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: ppcWindow.c /main/5 1996/02/21 17:58:43 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "scrnintstr.h"
-#include "ibmTrace.h"
-
-/*
- xf4bppCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-void
-xf4bppCopyWindow(pWin, ptOldOrg, prgnSrc)
- register WindowPtr pWin ;
- DDXPointRec ptOldOrg ;
- RegionPtr prgnSrc ;
-{
- RegionPtr prgnDst ;
- register BoxPtr pbox ;
- register int dx, dy ;
- register int nbox ;
- register int pm ;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew ;
- /* temporaries for shuffling rectangles */
-
- TRACE(("xf4bppCopyWindow(pWin= 0x%x, ptOldOrg= 0x%x, prgnSrc= 0x%x)\n", pWin, ptOldOrg, prgnSrc)) ;
-
-
- dx = ptOldOrg.x - pWin->drawable.x ;
- dy = ptOldOrg.y - pWin->drawable.y ;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
-
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst,
- &pWin->borderClip, prgnSrc);
-
- if ( !( nbox = REGION_NUM_RECTS(prgnDst) ) )
- return;
-
- pbox = REGION_RECTS(prgnDst);
-
- pboxNew = 0 ;
- if ( nbox > 1 ) {
- if ( dy < 0 ) {
- if ( dx > 0 ) {
- /* walk source bottom to top */
- /* keep ordering in each band, reverse order of bands */
- if ( !( pboxNew =
- (BoxPtr) ALLOCATE_LOCAL( sizeof( BoxRec ) * nbox ) ) )
- return ;
- pboxBase = pboxNext = pbox+nbox - 1 ;
- while ( pboxBase >= pbox ) {
- while ( ( pboxNext >= pbox )
- && ( pboxBase->y1 == pboxNext->y1 ) )
- pboxNext-- ;
- pboxTmp = pboxNext + 1 ;
- while ( pboxTmp <= pboxBase )
- *pboxNew++ = *pboxTmp++ ;
- pboxBase = pboxNext ;
- }
- pboxNew -= nbox ;
- pbox = pboxNew ;
- }
- else { /* dx <= 0 */
- /* we can just reverse the entire list in place */
- /* Do three-position swaps */
- BoxRec tmpBox ;
-
- pboxBase = pbox ;
- pboxNext = pbox + nbox - 1 ;
- while ( pboxBase < pboxNext ) {
- /* ****** Warning Structure Assignment !! ****** */
- tmpBox = *pboxBase ;
- *pboxBase = *pboxNext ;
- *pboxNext = tmpBox ;
- pboxBase++ ;
- pboxNext-- ;
- }
- }
- }
- else if ( dx < 0 ) {
- /* walk source right to left */
- /* reverse order of rects in each band */
- if ( !( pboxNew = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox) ) )
- return ;
- pboxBase = pboxNext = pbox ;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++ ;
- pboxTmp = pboxNext ;
- while (pboxTmp != pboxBase)
- *pboxNew++ = *--pboxTmp ;
- pboxBase = pboxNext ;
- }
- pboxNew -= nbox ;
- pbox = pboxNew ;
- }
- } /* END if nbox > 1 */
-
- /*
- * call blit several times, the parms are:
- * blit( alu,rplanes, wplanes, srcx, srcy, destx, desty, width, height ) ;
- */
-
- pm = ( 1 << pWin->drawable.depth ) - 1 ;
- for ( ; nbox-- ; pbox++ )
- xf4bppBitBlt( pWin, GXcopy, pm,
- pbox->x1 + dx, pbox->y1 + dy,
- pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1) ;
-
- /* free up stuff */
- if ( pboxNew )
- DEALLOCATE_LOCAL( pboxNew ) ;
-
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
-}
-
-Bool xf4bppPositionWindow(pWin, x, y)
-register WindowPtr pWin ;
-register int x, y ;
-{
- return TRUE ;
-}
-
-Bool
-xf4bppDestroyWindow(pWin)
-register WindowPtr pWin ;
-{
-return pWin ? TRUE : FALSE ;
-}
-
-/* As The Name Says -- Used For ega, vga and apa8c */
-Bool
-xf4bppCreateWindowForXYhardware(pWin)
-register WindowPtr pWin ;
-{
- register mfbPrivWin *pPrivWin;
-
- TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin));
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = 0;
- pPrivWin->fastBorder = 0;
-
- return TRUE;
-}
diff --git a/hw/xfree86/xf4bpp/vgaBitBlt.c b/hw/xfree86/xf4bpp/vgaBitBlt.c
deleted file mode 100644
index 660cc356b..000000000
--- a/hw/xfree86/xf4bpp/vgaBitBlt.c
+++ /dev/null
@@ -1,750 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */
-/* GJA -- span move routines */
-
-
-
-/* $XConsortium: vgaBitBlt.c /main/8 1996/10/27 11:06:39 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "vgaReg.h"
-#include "vgaVideo.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-#ifndef PC98_EGC /* not PC98_EGC */
-/* NOTE: It seems that there is no way to program the VGA to copy just
- * a part of a byte in the smarter modes. Therefore we copy the boundaries
- * plane by plane.
- */
-#define WORDSZ 8
- /* The fast blit code requires WORDSZ = 8 for its read-modify write cycle.
- * Therefore, we do not fully implement the other options.
- */
-#define HIGHPLANEMASK 0x08
-#define HIGHPLANEINDEX 3
-
-/* Of course, we want the following anyway:
- * (Yes, they're identical now.)
- */
-#define SMEM(x,y) ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + (x) )
-#define DMEM(x,y) ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + (x) )
-
-#define WORD8 unsigned char
-#define LW8 BYTES_PER_LINE(pWin) /* Line width */
-#define WSHIFT8 0x3
-#define WMASK8 0x07
-/* NOTE: lmask[8] matters. It must be different from lmask[0] */
-static unsigned char lmasktab[] = {
- 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF
-} ;
-static unsigned char rmasktab[] = {
- 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00
-} ;
-
-#define LMASK8(n) lmasktab[n]
-#define RMASK8(n) rmasktab[n]
-#define SWAPB8(x) (x)
-
-#if (WORDSZ == 8)
-
-#define WORD WORD8
-#define LW LW8
-#define WSHIFT WSHIFT8
-#define WMASK WMASK8
-
-#define LMASK(n) LMASK8(n)
-#define RMASK(n) RMASK8(n)
-#define SWAPB(x) SWAPB8(x)
-
-#endif /* WORDSZ == 8 */
-
-#define DO_ALU(dst,src,mask,alu) {\
- int _ndst, _odst; _odst = dst; \
- switch ( alu ) { \
- case GXclear: \
- _ndst = 0; break; \
- case GXand: \
- _ndst = src & _odst; break; \
- case GXandReverse: \
- _ndst = src & ~ _odst; break; \
- case GXcopy: \
- _ndst = src; break; \
- case GXandInverted: \
- _ndst = ~ src & _odst; break; \
- default: \
- case GXnoop: \
- _ndst = _odst; break; \
- case GXxor: \
- _ndst = src ^ _odst; break; \
- case GXor: \
- _ndst = src | _odst; break; \
- case GXnor: \
- _ndst = ~ src & ~ _odst; break; \
- case GXequiv: \
- _ndst = ~ src ^ _odst; break; \
- case GXinvert: \
- _ndst = ~ _odst; break; \
- case GXorReverse: \
- _ndst = src | ~ _odst; break; \
- case GXcopyInverted: \
- _ndst = ~ src; break; \
- case GXorInverted: \
- _ndst = ~ src | _odst; break; \
- case GXnand: \
- _ndst = ~ src | ~ _odst; break; \
- case GXset: \
- _ndst = ~0; break; \
- } \
- dst = (_odst & ~(mask)) | (_ndst & (mask)); \
- }
-
-static void aligned_blit(
- WindowPtr, int, int, int, int, int, int, int, int
-);
-
-static void aligned_blit_center(
- WindowPtr, int, int, int, int, int, int
-);
-
-static void shift(
- WindowPtr, int, int, int, int, int, int, int
-);
-
-static void shift_thin_rect(
- WindowPtr, int, int, int, int, int, int, int
-);
-
-static void shift_center(
- WindowPtr, int, int, int, int, int, int, int
-);
-
-void xf4bppBitBlt(pWin,alu,writeplanes,x0,y0,x1,y1,w,h)
-WindowPtr pWin; /* GJA */
-int alu;
-int writeplanes; /* planes */
-int x0, y0, x1, y1, w, h;
-{
- IOADDRESS REGBASE;
- int plane, bit;
-
- if ( !w || !h ) return;
-
- if ( ! xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffBitBlt(pWin,alu,writeplanes,x0,y0,x1,y1,w,h);
- return;
- }
-
- REGBASE =
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
-
- /* 0x7, not WMASK: it is hardware dependant */
- if ( ((x0 - x1) & 0x7) || (alu != GXcopy) ) {
- /* Use slow copy */
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX ;
- plane ; plane >>= 1, bit-- )
- {
-
- if ( writeplanes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift(pWin,x0,x1,y0,y1,w,h,alu);
- }
- }
- } else {
- aligned_blit(pWin,x0,x1,y0,y1,w,h,alu,writeplanes);
- }
-}
-
-/* Copy a span a number of places to the right.
- */
-static void
-shift(pWin,x0,x1,y0,y1,w,h,alu)
-WindowPtr pWin; /* GJA */
-int x0; /* left edge of source */
-int x1; /* left edge of target */
-int y0;
-int y1;
-int w; /* length of source, and of target */
-int h;
-int alu;
-{
- if ( ((x1 & WMASK) + w) <= WORDSZ ) {
- shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu);
- } else if ( x1 > x0 ) { /* Shift right: start right */
- int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
-
- if ( r1 ) /* right edge */
- shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
- shift_center(pWin,x0,x1,y0,y1,w,h,alu);
- if ( l1 ) /* left edge */
- shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
- } else {
- int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
-
- if ( l1 ) /* left edge */
- shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
- shift_center(pWin,x0,x1,y0,y1,w,h,alu);
- if ( r1 ) /* right edge */
- shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
- }
-}
-
-/* The whole rectangle is so thin that it fits in one byte written */
-static void
-shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu)
-WindowPtr pWin; /* GJA */
-int x0; /* left edge of source */
-int x1; /* left edge of target */
-int y0;
-int y1;
-int w; /* length of source, and of target */
-int h;
-int alu;
-{
- int l0 = x0 & WMASK; /* Left edge of source, as bit */
- int l1 = x1 & WMASK; /* Left edge of target, as bit */
- int L0 = x0 >> WSHIFT; /* Left edge of source, as byte */
- int L1 = x1 >> WSHIFT; /* Left edge of target, as byte */
- int pad;
- int htmp;
- int mask;
- int tmp;
- int bs;
-
- volatile unsigned char *sp, *dp;
-
- mask = RMASK(l1) & LMASK(l1+w);
- bs = (x1 - x0) & WMASK;
-
- if ( y1 > y0 ) { /* Move down, start at the bottom */
- pad = - BYTES_PER_LINE(pWin);
- sp = SMEM(L0,y0+h-1);
- dp = DMEM(L1,y1+h-1);
- } else { /* Move up, start at the top */
- pad = BYTES_PER_LINE(pWin);
- sp = SMEM(L0,y0);
- dp = DMEM(L1,y1);
- }
-
- if ( l0+w > WORDSZ ) {
- /* Need two bytes */
- for ( htmp = h ; htmp ; htmp-- ) {
- tmp = (sp[0] << (WORDSZ - bs));
- sp++;
- tmp |= (sp[0] >> bs);
- sp--;
- DO_ALU(dp[0],tmp,mask,alu);
- dp += pad;
- sp += pad;
- }
- } else if ( l0 <= l1 ) {
- /* Need one byte, shifted right */
- for ( htmp = h ; htmp ; htmp-- ) {
- tmp = (sp[0] >> bs);
- DO_ALU(dp[0],tmp,mask,alu);
- dp += pad;
- sp += pad;
- }
- } else {
- /* Need one byte, shifted left */
- for ( htmp = h ; htmp ; htmp-- ) {
- tmp = (sp[0] << (WORDSZ - bs));
- DO_ALU(dp[0],tmp,mask,alu);
- dp += pad;
- sp += pad;
- }
- }
-}
-
-static void
-shift_center(pWin,x0,x1,y0,y1,w,h,alu)
-WindowPtr pWin; /* GJA */
-int x0; /* left edge of source */
-int x1; /* left edge of target */
-int y0;
-int y1;
-int w; /* length of source, and of target */
-int h;
-int alu;
-{
- int l1 = x1 & WMASK; /* Left edge of target, as bit */
- int r1 = (x1 + w) & WMASK; /* Right edge of target, as bit */
- int pad;
- int htmp, wtmp; /* Temporaries for indices over height and width */
- volatile unsigned char tmp; /* Temporary result of the shifts */
- int bs;
- int rem; /* Remaining bits; temporary in loop */
- int bytecnt;
-
- volatile unsigned char *sp, *dp;
-
- bs = (x1 - x0) & WMASK;
-
- if ( l1 ) {
- bytecnt = (w - (WORDSZ - l1) - r1) >> WSHIFT;
- sp = SMEM( ((x0 + (WORDSZ - l1)) >> WSHIFT), y0);
- dp = DMEM( ((x1 + (WORDSZ - l1)) >> WSHIFT), y1);
- } else {
- bytecnt = (w - r1) >> WSHIFT;
- sp = SMEM( (x0 >> WSHIFT), y0);
- dp = DMEM( (x1 >> WSHIFT), y1);
- }
-
- if ( y1 > y0 ) { /* Move down, start at the bottom */
- if ( x1 > x0 ) { /* Move right, start right */
- pad = - BYTES_PER_LINE(pWin) + bytecnt;
- sp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
- dp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
- } else { /* Move left, start left */
- pad = - BYTES_PER_LINE(pWin) - bytecnt;
- sp += BYTES_PER_LINE(pWin) * (h - 1);
- dp += BYTES_PER_LINE(pWin) * (h - 1);
- }
- } else { /* Move up, start at the top */
- if ( x1 > x0 ) { /* Move right, start right */
- pad = BYTES_PER_LINE(pWin) + bytecnt;
- sp += bytecnt - 1;
- dp += bytecnt - 1;
- } else { /* Move left, start left */
- pad = BYTES_PER_LINE(pWin) - bytecnt;
- sp += 0;
- dp += 0;
- }
- }
-
- if ( x1 > x0 ) { /* Move right, start right */
- if ( bs == 0 ) { /* No shift. Need one byte only */
- for ( htmp = h ; htmp ; htmp-- ) {
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = sp[0];
- DO_ALU(dp[0],tmp,~0,alu);
- dp--;
- sp--;
- }
- dp += pad;
- sp += pad;
- }
- } else {
- for ( htmp = h ; htmp ; htmp-- ) {
- if ( bytecnt ) {
- sp++;
- rem = sp[0];
- sp--;
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = (rem >> bs);
- rem = sp[0];
- tmp |= (rem << (WORDSZ - bs)) ;
- DO_ALU(dp[0],tmp,~0,alu);
- dp--;
- sp--;
- }
- }
- dp += pad;
- sp += pad;
- }
- }
- } else { /* x1 <= x0 */ /* Move left, start left */
- if ( bs == 0 ) { /* No shift. Need one byte only */
- for ( htmp = h ; htmp ; htmp-- ) {
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = sp[0];
- DO_ALU(dp[0],tmp,~0,alu);
- dp++;
- sp++;
- }
- dp += pad;
- sp += pad;
- }
- } else {
- for ( htmp = h ; htmp ; htmp-- ) {
- if ( bytecnt ) {
- rem = sp[0];
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = (rem << (WORDSZ - bs));
- sp++;
- rem = sp[0];
- sp--;
- tmp |= (rem >> bs);
- DO_ALU(dp[0],tmp,~0,alu);
- dp++;
- sp++;
- }
- }
- dp += pad;
- sp += pad;
- }
- }
- }
-}
-
-/* Copy a rectangle.
- */
-static void
-aligned_blit(pWin,x0,x1,y0,y1,w,h,alu,planes)
-WindowPtr pWin; /* GJA */
-int x0; /* left edge of source */
-int x1; /* left edge of target */
-int y0;
-int y1;
-int w; /* length of source, and of target */
-int h;
-int alu;
-int planes;
-{
- IOADDRESS REGBASE =
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
- int plane, bit;
-
- if ( ((x1 & WMASK) + w) <= WORDSZ ) {
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
- plane ; plane >>= 1, bit-- )
- {
- if ( planes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu);
- }
- }
- } else if ( x1 > x0 ) { /* Shift right: start right */
- int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
-
- if ( r1 ) { /* right edge */
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
- plane ; plane >>= 1, bit-- )
- {
- if ( planes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
- }
- }
- }
-
- /* Center */
- SetVideoGraphics(Graphics_ModeIndex, 1); /* Write mode 1 */
- SetVideoSequencer(Mask_MapIndex, planes);
-
- aligned_blit_center(pWin,x0,x1,y0,y1,w,h);
-
- if ( l1 ) { /* left edge */
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
- plane ; plane >>= 1, bit-- )
- {
- if ( planes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
- }
- }
- }
- } else {
- int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
-
- if ( l1 ) { /* left edge */
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
- plane ; plane >>= 1, bit-- )
- {
- if ( planes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
- }
- }
- }
-
- /* Center */
- SetVideoGraphics(Graphics_ModeIndex, 1); /* Write mode 1 */
- SetVideoSequencer(Mask_MapIndex, planes);
-
- aligned_blit_center(pWin,x0,x1,y0,y1,w,h);
-
- if ( r1 ) { /* right edge */
- SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
- SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
- SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
- SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
-
- for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX ;
- plane ; plane >>= 1, bit-- )
- {
- if ( planes & plane) {
- SetVideoGraphics(Read_Map_SelectIndex, bit);
- SetVideoSequencer(Mask_MapIndex, plane);
-
- shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
- }
- }
- }
- }
-}
-
-static void
-aligned_blit_center(pWin,x0,x1,y0,y1,w,h)
-WindowPtr pWin; /* GJA */
-int x0; /* left edge of source */
-int x1; /* left edge of target */
-int y0;
-int y1;
-int w; /* length of source, and of target */
-int h;
-{
- int l1 = x1 & WMASK; /* Left edge of target, as bit */
- int r1 = (x1 + w) & WMASK; /* Right edge of target, as bit */
- int pad;
- int htmp, wtmp; /* Temporaries for indices over height and width */
- volatile unsigned char tmp; /* Temporary result of the shifts */
- int bytecnt;
-
- volatile unsigned char *sp, *dp;
-
- if ( l1 ) {
- bytecnt = (w - (WORDSZ - l1) - r1) >> WSHIFT;
- sp = SMEM( ((x0 + (WORDSZ - l1)) >> WSHIFT), y0);
- dp = DMEM( ((x1 + (WORDSZ - l1)) >> WSHIFT), y1);
- } else {
- bytecnt = (w - r1) >> WSHIFT;
- sp = SMEM( (x0 >> WSHIFT), y0);
- dp = DMEM( (x1 >> WSHIFT), y1);
- }
-
- if ( y1 > y0 ) { /* Move down, start at the bottom */
- if ( x1 > x0 ) { /* Move right, start right */
- pad = - BYTES_PER_LINE(pWin) + bytecnt;
- sp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
- dp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
- } else { /* Move left, start left */
- pad = - BYTES_PER_LINE(pWin) - bytecnt;
- sp += BYTES_PER_LINE(pWin) * (h - 1);
- dp += BYTES_PER_LINE(pWin) * (h - 1);
- }
- } else { /* Move up, start at the top */
- if ( x1 > x0 ) { /* Move right, start right */
- pad = BYTES_PER_LINE(pWin) + bytecnt;
- sp += bytecnt - 1;
- dp += bytecnt - 1;
- } else { /* Move left, start left */
- pad = BYTES_PER_LINE(pWin) - bytecnt;
- sp += 0;
- dp += 0;
- }
- }
-
- if ( x1 > x0 ) { /* Move right, start right */
- for ( htmp = h ; htmp ; htmp-- ) {
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = sp[0];
- dp[0] = tmp;
- dp--;
- sp--;
- }
- dp += pad;
- sp += pad;
- }
- } else { /* x1 <= x0 */ /* Move left, start left */
- for ( htmp = h ; htmp ; htmp-- ) {
- for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
- tmp = sp[0];
- dp[0] = tmp;
- dp++;
- sp++;
- }
- dp += pad;
- sp += pad;
- }
- }
-}
-#else /* PC98_EGC */
-
-static void
-egc_fast_blt (pWin, alu, writeplanes, x0, y0, x1, y1, w, h)
-WindowPtr pWin;
-const int alu, writeplanes ;
-register int x0, x1 ;
-int y0, y1 ;
-register int w, h ;
-{
-register volatile unsigned char *src ;
-register volatile unsigned char *dst ;
-unsigned short *src_x ;
-unsigned short *dst_x ;
-int x_direction, y_interval ;
-int src_off, dst_off ;
-register int k, i ;
-unsigned short ROP_value;
-
-src = (unsigned char *)SCREENADDRESS( pWin, 0, y0);
-dst = (unsigned char *)SCREENADDRESS( pWin, 0, y1);
-
-/* Set Map Mask */
-outw(EGC_PLANE, ~(writeplanes & VGA_ALLPLANES));
-switch(alu) {
-case GXnor: /* ~(S|D) */
- ROP_value = 0x2903;
- break;
-case GXandInverted: /* ~S&D */
- ROP_value = 0x290c;
- break;
-case GXand: /* S&D */
- ROP_value = 0x29c0;
- break;
-case GXequiv: /* ~S ^ D */
- ROP_value = 0x29c3;
- break;
-case GXxor: /* S^D */
- ROP_value = 0x293c;
- break;
-case GXandReverse: /* S&~D */
- ROP_value = 0x2930;
- break;
-case GXorReverse: /* S|~D */
- ROP_value = 0x29f3;
- break;
-case GXnand: /* ~(S&D) */
- ROP_value = 0x293f;
- break;
-case GXorInverted: /* ~S|D */
- ROP_value = 0x29cf;
- break;
-case GXor: /* S|D */
- ROP_value = 0x29fa;
- break;
-case GXcopyInverted: /* ~S */
- ROP_value = 0x290f;
- break;
-case GXcopy: /* S */
-default:
- ROP_value = 0x29f0;
-}
-outw(EGC_MODE, ROP_value);
-if ( y1 > y0 ) {
- y_interval = - BYTES_PER_LINE(pWin) * 8 ;
- src += BYTES_PER_LINE(pWin) * ( h - 1 ) ;
- dst += BYTES_PER_LINE(pWin) * ( h - 1 ) ;
-}
-else {
- y_interval = BYTES_PER_LINE(pWin) * 8 ;
-}
-
-src = (unsigned char *)((int)src << 3) ;
-dst = (unsigned char *)((int)dst << 3) ;
-
-if ( y1 > y0) {
- x_direction = 0x1000 ;
- src += x0 + w - 1 ;
- dst += x1 + w - 1 ;
-} else if ( y1 < y0 ) {
- x_direction = 0 ;
- src += x0 ;
- dst += x1 ;
-} else {
- if ( x1 < x0 ) {
- x_direction = 0 ;
- src += x0 ;
- dst += x1 ;
- } else {
- x_direction = 0x1000 ;
- src += x0 + w - 1 ;
- dst += x1 + w - 1 ;
- }
-}
- outw ( EGC_LENGTH , w - 1 ) ;
-
-for ( ; h-- ; ) {
- if ( x_direction ) {
- src_off = 15 - (int)src & 0xf ;
- dst_off = 15 - (int)dst & 0xf ;
- } else {
- src_off = (int)src & 0xf ;
- dst_off = (int)dst & 0xf ;
- }
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- src_x = (unsigned short *)(((unsigned int)src >> 4 ) << 1) ;
- dst_x = (unsigned short *)(((unsigned int)dst >> 4 ) << 1) ;
-#else
- src_x = (unsigned short *)(((int)src >> 4 ) << 1) ;
- dst_x = (unsigned short *)(((int)dst >> 4 ) << 1) ;
-#endif
- k = ( src_off + w + 15 ) >> 4 ;
- if ( src_off < dst_off ) {
- if ( ((src_off + w - 1 ) >> 4) < ((dst_off + w - 1) >> 4)) k++ ;
- }
- if ( src_off > dst_off ) {
- if ( ((src_off + w - 1) >> 4 ) == ((dst_off + w - 1) >> 4) ) k++ ;
- if ( x_direction ) dst_x ++ ;
- else dst_x -- ;
- }
- outw ( EGC_ADD , x_direction | src_off | dst_off << 4 );
- if ( x_direction ) {
- wcopyl ( src_x, dst_x, k, VIDBASE(pWin) ) ;
- } else {
- wcopyr ( src_x, dst_x, k, VIDBASE(pWin) ) ;
- }
-src += y_interval ;
-dst += y_interval ;
-}
-outw ( EGC_ADD, 0 ) ;
-outw ( EGC_LENGTH , 0xf );
-return;
-}
-
-void
-xf4bppBitBlt( pWin,alu, writeplanes, x0, y0, x1, y1, w, h )
-WindowPtr pWin; /* GJA */
-int alu;
-int writeplanes; /* planes */
-int x0, y0, x1, y1, w, h;
-{
- if ( ! xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffBitBlt( pWin, alu, writeplanes,
- x0, y0, x1, y1, w, h );
- return;
- }
-
-switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXinvert: /* 0xa NOT dst */
- case GXset: /* 0xf 1 */
- xf4bppFillSolid( pWin, VGA_ALLPLANES, alu, writeplanes, x1, y1, w, h ) ;
- /* x1, y1, GJA */
- case GXnoop: /* 0x5 dst */
- return ;
- default:
- break ;
-}
-
-egc_fast_blt ( pWin, alu, writeplanes, x0, y0, x1, y1, w, h);
-return;
-}
-#endif
diff --git a/hw/xfree86/xf4bpp/vgaGC.c b/hw/xfree86/xf4bpp/vgaGC.c
deleted file mode 100644
index 867e2c50e..000000000
--- a/hw/xfree86/xf4bpp/vgaGC.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaGC.c,v 1.4 2003/02/18 21:29:59 tsi Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright IBM Corporation 1987,1988,1989
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of IBM not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-
-/* $XConsortium: vgaGC.c /main/6 1996/02/21 17:58:54 kaleb $ */
-
-#include "xf4bpp.h"
-#include "mfbmap.h"
-#include "mfb.h"
-#include "mi.h"
-#include "ppcGCstr.h"
-
-void
-xf4bppChangeGCtype( pGC, devPriv )
-register GC *pGC ;
-register ppcPrivGCPtr devPriv ;
-{
- if ( devPriv->lastDrawableType == DRAWABLE_PIXMAP ) {
- pGC->ops->CopyArea = miCopyArea ;
- pGC->ops->PolyFillRect = miPolyFillRect ;
- pGC->ops->PushPixels = miPushPixels ;
- pGC->ops->PolyArc = miPolyArc ;
- pGC->ops->PolyFillArc = miPolyFillArc ;
- pGC->ops->PolySegment = miPolySegment ;
- }
- else {
- pGC->ops->CopyArea = xf4bppCopyArea ;
- pGC->ops->PolyFillRect = xf4bppPolyFillRect ;
- pGC->ops->PushPixels = miPushPixels ; /* GJA */
- pGC->ops->PolyArc = xf4bppZeroPolyArc ;
- pGC->ops->PolyFillArc = xf4bppPolyFillArc ;
- pGC->ops->PolySegment = xf4bppSegmentSS ;
- }
- return;
-}
-
-Mask
-xf4bppChangeWindowGC( pGC, changes )
-register GC *pGC ;
-register Mask changes ;
-{
-register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr) ;
-register unsigned long int idx ; /* used for stepping through bitfields */
-
-#define LOWBIT( x ) ( x & - x ) /* Two's complement */
- while ((idx = LOWBIT(changes))) {
- switch ( idx ) {
-
- case GCLineStyle:
- case GCLineWidth:
- pGC->ops->PolyArc = ( ( pGC->lineStyle == LineSolid )
- ? ( ( pGC->lineWidth == 0 ) ? xf4bppZeroPolyArc
- : miPolyArc )
- : miPolyArc ) ;
- pGC->ops->PolySegment = ( ( pGC->lineStyle == LineSolid )
- ? ( ( pGC->lineWidth == 0 )
- ? ( ( pGC->fillStyle == FillSolid ) ?
- xf4bppSegmentSS : miPolySegment )
- : miPolySegment )
- : ( ( pGC->lineWidth == 0 )
- ? ( ( pGC->fillStyle == FillSolid ) ?
- xf4bppSegmentSD : miPolySegment )
- : miPolySegment ) ) ;
- pGC->ops->Polylines = ( ( pGC->lineStyle == LineSolid )
- ? ( ( pGC->lineWidth == 0 )
- ? ( (pGC->fillStyle == FillSolid ) ?
- xf4bppLineSS : miZeroLine )
- : miWideLine )
- : ( ( pGC->lineWidth == 0 )
- ? ( (pGC->fillStyle == FillSolid ) ?
- xf4bppLineSD : miWideDash )
- : miWideDash ) ) ;
- /*
- * If these are just square boxes with no funny business
- * going on we can call the fast routine that draws
- * rectangles without floating point.
- */
-/* too buggy */
-#if 0
- if ( ( pGC->lineStyle == LineSolid )
- && ( pGC->joinStyle == JoinMiter )
- && ( pGC->lineWidth != 0 ) )
- pGC->ops->PolyRectangle = xf4bppPolyRectangle;
- else
-#endif
- pGC->ops->PolyRectangle = miPolyRectangle;
-
- changes &= ~( GCLineStyle | GCLineWidth ) ;
- break ;
- case GCJoinStyle:
-#ifdef NEED_LINEHELPER
- pGC->ops->LineHelper =
- ( pGC->joinStyle == JoinMiter ) ? miMiter : miNotMiter ;
-#endif
- /*
- * If these are just square boxes with no funny business
- * going on we can call the fast routine that draws
- * rectangles without floating point.
- */
-/* too buggy */
-#if 0
- if ( ( pGC->lineStyle == LineSolid )
- && ( pGC->joinStyle == JoinMiter )
- && ( pGC->lineWidth != 0 ) )
- pGC->ops->PolyRectangle = xf4bppPolyRectangle;
- else
-#endif
- pGC->ops->PolyRectangle = miPolyRectangle;
- changes &= ~ idx ; /* i.e. changes &= ~ GCJoinStyle */
- break ;
-
- case GCBackground:
- if ( pGC->fillStyle != FillOpaqueStippled ) {
- changes &= ~ idx ; /* i.e. changes &= ~GCBackground */
- break ;
- } /* else Fall Through */
- case GCForeground:
- if ( pGC->fillStyle == FillTiled ) {
- changes &= ~ idx ; /* i.e. changes &= ~GCForeground */
- break ;
- } /* else Fall Through */
- case GCFunction:
- case GCPlaneMask:
- case GCFillStyle:
- { /* new_fill */
- int fillStyle = devPriv->colorRrop.fillStyle ;
- /* install a suitable fillspans */
- if ( fillStyle == FillSolid )
- pGC->ops->FillSpans = xf4bppSolidWindowFS ;
- else if ( fillStyle == FillStippled )
- pGC->ops->FillSpans = xf4bppStippleWindowFS ;
- else if ( fillStyle == FillOpaqueStippled )
- pGC->ops->FillSpans = xf4bppOpStippleWindowFS ;
- else /* fillStyle == FillTiled */
- pGC->ops->FillSpans = xf4bppTileWindowFS ;
- } /* end of new_fill */
- changes &= ~( GCBackground | GCForeground
- | GCFunction
- | GCPlaneMask | GCFillStyle ) ;
- break ;
-
- default:
- ErrorF("xf4bppChangeWindowGC: Unexpected GC Change\n") ;
- changes &= ~ idx ; /* Remove it anyway */
- break ;
- }
- }
- return changes;
-}
diff --git a/hw/xfree86/xf4bpp/vgaImages.c b/hw/xfree86/xf4bpp/vgaImages.c
deleted file mode 100644
index 4357e4d8a..000000000
--- a/hw/xfree86/xf4bpp/vgaImages.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: vgaImages.c /main/5 1996/02/21 17:58:58 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "vgaReg.h"
-#include "vgaVideo.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-#undef TRUE
-#undef FALSE
-#define TRUE 1
-#define FALSE 0
-
-void
-xf4bppDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes )
-WindowPtr pWin; /* GJA */
-int x, y ;
-register int w, h ;
-unsigned char *data ;
-register int RowIncrement ;
-const int alu ;
-const unsigned long int planes ;
-{
-IOADDRESS REGBASE;
-register unsigned long int tmp ;
-register const unsigned char *src ;
-register volatile unsigned char *dst ;
-register int Pixel_Count ;
-register unsigned int currMask ;
-register unsigned int InitialMask ;
-register volatile unsigned char *StartByte ;
-unsigned int invert_source_data = FALSE ;
-#ifdef PC98_EGC /* new EGC test */
-register unsigned char tmp1;
-#endif
-
-{ /* Start GJA */
- if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes );
- return;
- }
-} /* End GJA */
-
-{
- unsigned int invert_existing_data = FALSE ;
- unsigned int data_rotate_value = VGA_COPY_MODE ;
-#ifdef PC98_EGC
- unsigned short ROP_value;
-#endif
-
- REGBASE = 0x300 +
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase;
-
- switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- case GXinvert: /* 0xa NOT dst */
- case GXset: /* 0xf 1 */
- xf4bppFillSolid( pWin, VGA_ALLPLANES, alu, planes, x, y, w, h ) ;
- case GXnoop: /* 0x5 dst */
- return ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- invert_existing_data = TRUE ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- invert_source_data = TRUE ;
- case GXand: /* 0x1 src AND dst */
- data_rotate_value = VGA_AND_MODE ;
- break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- invert_source_data = TRUE ;
- case GXxor: /* 0x6 src XOR dst */
- data_rotate_value = VGA_XOR_MODE ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- invert_existing_data = TRUE ;
- data_rotate_value = VGA_AND_MODE ;
- break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- invert_source_data = TRUE ;
- case GXorReverse: /* 0xb src OR NOT dst */
- invert_existing_data = TRUE ;
- /* GJA -- moved this here */
- data_rotate_value = VGA_OR_MODE ;
- break ;
- case GXorInverted: /* 0xd NOT src OR dst */
- invert_source_data = TRUE ;
- case GXor: /* 0x7 src OR dst */
- data_rotate_value = VGA_OR_MODE ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- invert_source_data = TRUE ;
- case GXcopy: /* 0x3 src */
- default:
- break ;
- }
-
-#ifdef PC98_EGC
- /* Setup EGC Registers */
- switch(data_rotate_value) {
-/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
- case VGA_AND_MODE:
- if (invert_existing_data)
- ROP_value = EGC_AND_INV_MODE;
- else
- ROP_value = EGC_AND_MODE;
- break;
- case VGA_OR_MODE:
- if (invert_existing_data)
- ROP_value = EGC_OR_INV_MODE;
- else
- ROP_value = EGC_OR_MODE;
- break;
- case VGA_XOR_MODE:
- if (invert_existing_data)
- ROP_value = EGC_XOR_INV_MODE;
- else
- ROP_value = EGC_XOR_MODE;
- break;
- case VGA_COPY_MODE:
- default:
- ROP_value = EGC_COPY_MODE;
- break;
- }
- outw(EGC_PLANE, ~(planes & VGA_ALLPLANES));
- outw(EGC_MODE, ROP_value);
- outw(EGC_FGC, 0x0000);
- tmp1 = 0;
-#else
- if ( invert_existing_data )
- xf4bppFillSolid( pWin, VGA_ALLPLANES, GXinvert, planes, x, y, w, h ) ;
- /* Setup VGA Registers */
- SetVideoSequencer( Mask_MapIndex, planes & VGA_ALLPLANES ) ;
- /* Set Raster Op */
- SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
- SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_2 ) ;
-#endif
-}
-
-StartByte = SCREENADDRESS(pWin, x, y);
-InitialMask = SCRRIGHT8( LeftmostBit, BIT_OFFSET( x ) ) ;
-if ( invert_source_data )
-#ifdef PC98_EGC
-#if 0 /* New EGC version */
- egc_image_invert ( StartByte, data, InitialMask, w, h,
- RowIncrement ) ;
-#else /* new EGC c version */
- for ( ;
- h-- ;
- data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
- dst = StartByte;
- for ( src = data,
- Pixel_Count = w, currMask = InitialMask ;
- Pixel_Count-- ;
- src++ ) {
- if (tmp1 != (~*src & VGA_ALLPLANES)) {
- tmp1 = ~*src & VGA_ALLPLANES;
- /* set FGC */
- outw(EGC_FGC, ~*src & VGA_ALLPLANES);
- }
- *((VgaMemoryPtr) dst) = currMask;
- if ( currMask & RightmostBit ) {
- currMask = LeftmostBit ;
- dst++;
- }
- else
- currMask = SCRRIGHT8( currMask, 1 ) ;
- }
- }
-#endif /* new EGC */
-#else /* original */
- for ( ;
- h-- ;
- data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
- dst = StartByte;
- for ( src = data,
- Pixel_Count = w, currMask = InitialMask ;
- Pixel_Count-- ;
- src++ ) {
- /* Set The Bit Mask Reg */
- SetVideoGraphics( Bit_MaskIndex, currMask ) ;
- /* Read To Load vga Data Latches */
- tmp = *( (VgaMemoryPtr) dst ) ;
- (void) tmp;
- *( (VgaMemoryPtr) dst ) = ~ *src ;
- if ( currMask & RightmostBit ) {
- currMask = LeftmostBit ;
- dst++;
- }
- else
- currMask = SCRRIGHT8( currMask, 1 ) ;
- }
- }
-#endif
-else /* invert_source_data == FALSE */
-#ifdef PC98_EGC
-#if 0 /* new EGC version */
- egc_image ( StartByte, data, InitialMask, w, h,
- RowIncrement );
-#else /* new EGC c version */
- for ( ;
- h-- ;
- data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
- dst = StartByte;
- for ( src = data,
- Pixel_Count = w, currMask = InitialMask ;
- Pixel_Count-- ;
- src++ ) {
- if (tmp1 != *src & VGA_ALLPLANES) {
- tmp1 = *src & VGA_ALLPLANES;
- outw(EGC_FGC, tmp1); /* set FGC */
- }
- *((VgaMemoryPtr) dst) = currMask; /* write with mask */
- if ( currMask & RightmostBit ) {
- currMask = LeftmostBit ;
- dst++;
- }
- else
- currMask = SCRRIGHT8( currMask, 1 ) ;
- }
- }
-#endif /* new EGC version */
-#else /* original */
- for ( ;
- h-- ;
- data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
- dst = StartByte;
- for ( src = data,
- Pixel_Count = w, currMask = InitialMask ;
- Pixel_Count-- ;
- src++ ) {
- /* Set The Bit Mask Reg */
- SetVideoGraphics( Bit_MaskIndex, currMask ) ; /* GJA */
- /* Read To Load vga Data Latches */
- tmp = *( (VgaMemoryPtr) dst ) ;
- (void) tmp;
- *( (VgaMemoryPtr) dst ) = *src ;
- if ( currMask & RightmostBit ) {
- currMask = LeftmostBit ;
- dst++;
- }
- else
- currMask = SCRRIGHT8( currMask, 1 ) ;
- }
- }
-#endif /* original */
-
-return ;
-}
-
-#ifndef PC98_EGC
-static unsigned long int
-read8Z
-(
- IOADDRESS REGBASE,
- register volatile unsigned char *screen_ptr
-)
-{
-register unsigned long int i ;
-register unsigned long int j ;
-
-/* Read One Byte At A Time to get
- * i == [ Plane 3 ] [ Plane 2 ] [ Plane 1 ] [ Plane 0 ]
- * into a single register
- */
-SetVideoGraphicsData( 3 ) ;
-i = *( (VgaMemoryPtr) screen_ptr ) << 8 ;
-SetVideoGraphicsData( 2 ) ;
-i |= *( (VgaMemoryPtr) screen_ptr ) ;
-i <<= 8 ;
-SetVideoGraphicsData( 1 ) ;
-i |= *( (VgaMemoryPtr) screen_ptr ) ;
-i <<= 8 ;
-SetVideoGraphicsData( 0 ) ;
-i |= *( (VgaMemoryPtr) screen_ptr ) ;
-
-/* Push Bits To Get
- * j == [Pixel 7][Pixel 6][Pixel 5][Pixel 4][Pixel 3][Pixel 2][Pixel 1][Pixel 0]
- * into one register
- */
-
-j = ( i & 0x1 ) << 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-j <<= 4 ;
-j |= ( i >>= 1 ) & 0x1 ;
-
-j |= ( i & 0x2 ) << 28 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 24 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 20 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 16 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 12 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 8 ;
-j |= ( ( i >>= 1 ) & 0x2 ) << 4 ;
-j |= ( i >>= 1 ) & 0x2 ;
-
-j |= ( i & 0x4 ) << 28 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 24 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 20 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 16 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 12 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 8 ;
-j |= ( ( i >>= 1 ) & 0x4 ) << 4 ;
-j |= ( i >>= 1 ) & 0x4 ;
-
-j |= ( i & 0x8 ) << 28 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 24 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 20 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 16 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 12 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 8 ;
-j |= ( ( i >>= 1 ) & 0x8 ) << 4 ;
-j |= ( i >>= 1 ) & 0x8 ;
-
-return j ;
-}
-#endif /* not PC98_EGC */
-
-void
-xf4bppReadColorImage( pWin, x, y, lx, ly, data, RowIncrement )
-WindowPtr pWin; /* GJA */
-int x, y ;
-int lx, ly ;
-register unsigned char *data ;
-int RowIncrement ;
-{
-IOADDRESS REGBASE;
-register unsigned long int tmp ;
-register volatile unsigned char *src ;
-volatile unsigned char *masterSrc ;
-int savCenterWidth ;
-int dx ;
-int skip ;
-int center_width ;
-int ignore ;
-int pad ;
-unsigned char tmpc;
-
-{ /* Start GJA */
- if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffReadColorImage( pWin, x, y, lx, ly, data, RowIncrement );
- return;
- }
-} /* End GJA */
-
-if ( ( lx <= 0 ) || ( ly <= 0 ) )
- return ;
-
- REGBASE = 0x300 +
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase;
-
-/* Setup VGA Registers */
-#ifndef PC98_EGC
-SetVideoGraphicsIndex( Graphics_ModeIndex ) ;
-tmpc = inb( GraphicsDataRegister );
-SetVideoGraphicsData( tmpc & ~0x8 ) ; /* Clear the bit */
-SetVideoGraphicsIndex( Read_Map_SelectIndex ) ;
-#else
-outw(EGC_MODE, 0x0800);
-#endif
-
-skip = BIT_OFFSET( x ) ;
-pad = RowIncrement - lx ;
-ignore = BIT_OFFSET( x + lx ) ;
-masterSrc = SCREENADDRESS( pWin, x, y ) ;
-center_width = ROW_OFFSET( x + lx ) - ROW_OFFSET( ( x + 0x7 ) & ~0x7 ) ;
-
-#define SINGLE_STEP *data++ = tmp & VGA_ALLPLANES ; tmp >>= 4
-
-
-if ( center_width < 0 ) {
- src = masterSrc;
- for ( ; ly-- ; ) {
- tmp = read8Z( REGBASE, src ) >> ( skip << 2 ) ;
- for ( dx = lx + 1 ; --dx ; ) {
- SINGLE_STEP ;
- }
- data += pad ;
- src += BYTES_PER_LINE(pWin);
- }
-} else
- for ( savCenterWidth = center_width ;
- ly-- ;
- center_width = savCenterWidth,
- masterSrc += BYTES_PER_LINE(pWin) ) {
- src = masterSrc ;
- tmp = read8Z( REGBASE, src ) ; src++;
- if ((dx = skip))
- tmp >>= ( dx << 2 ) ;
- else
- if ( lx < 8 ) { /* kludge -- GJA */
- --center_width ; /* kludge -- GJA */
- dx = 8 - lx ; /* kludge -- GJA */
- } else /* kludge -- GJA */
- --center_width ;
- BranchPoint:
- switch ( dx ) {
- LoopTop:
- case 0x0: SINGLE_STEP ;
- case 0x1: SINGLE_STEP ;
- case 0x2: SINGLE_STEP ;
- case 0x3: SINGLE_STEP ;
- case 0x4: SINGLE_STEP ;
- case 0x5: SINGLE_STEP ;
- case 0x6: SINGLE_STEP ;
- case 0x7: *data++ = tmp & VGA_ALLPLANES ;
-
- /* Fall Through To End Of Inner Loop */
- if ( center_width > 0 ) {
- tmp = read8Z( REGBASE, src ) ; src++;
- center_width-- ;
- goto LoopTop ;
- }
- else if ( ( center_width == 0 )
- && ( dx = ( - ignore ) & 07 ) ) {
- tmp = read8Z( REGBASE, src ) ; src++;
- center_width-- ;
- goto BranchPoint ; /* Do Mod 8 edge */
- }
- else /* End of this line */
- data += pad ;
- }
- }
-
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/vgaReg.h b/hw/xfree86/xf4bpp/vgaReg.h
deleted file mode 100644
index 43f59d938..000000000
--- a/hw/xfree86/xf4bpp/vgaReg.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaReg.h,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: vgaReg.h /main/4 1996/02/21 17:59:02 kaleb $ */
-
-#define SET_BYTE_REGISTER( ioport, value ) outb( ioport, value )
-#define SET_INDEX_REGISTER( ioport, value ) SET_BYTE_REGISTER( ioport, value )
-#define SET_DATA_REGISTER( ioport, value ) SET_BYTE_REGISTER( ioport, value )
-/* GJA -- deleted RTIO and ATRIO case here, so that a PCIO #define became
- * superfluous.
- */
-#define SET_INDEXED_REGISTER(RegGroup, Index, Value) \
- (SET_BYTE_REGISTER(RegGroup, Index), \
- SET_BYTE_REGISTER((RegGroup) + 1, Value))
-
-/* There is a jumper on the ega to change this to 0x200 instead !! */
-#if 0 /* This is now a stack variable, as needed */
-#define REGBASE 0x300
-#endif
-
-#define AttributeIndexRegister REGBASE + 0xC0
-#define AttributeDataWriteRegister REGBASE + 0xC0
-#define AttributeDataReadRegister REGBASE + 0xC1
-#define AttributeRegister AttributeIndexRegister
-#define AttributeModeIndex 0x30
-#define OverScanColorIndex 0x31
-#define ColorPlaneEnableIndex 0x32
-#define HorizPelPanIndex 0x33
-#define ColorSelectIndex 0x34
-#ifndef PC98_EGC
-#define SetVideoAttributeIndex( index ) \
- SET_INDEX_REGISTER( AttributeIndexRegister, index )
-#define SetVideoAttribute( index, value ) \
- SetVideoAttributeIndex( index ) ; \
- SET_BYTE_REGISTER( AttributeDataWriteRegister, value )
-#endif
-
- /* Graphics Registers 03CE & 03CF */
-#define GraphicsIndexRegister REGBASE + 0xCE
-#define GraphicsDataRegister REGBASE + 0xCF
-#define GraphicsRegister GraphicsIndexRegister
-#define Set_ResetIndex 0x00
-#define Enb_Set_ResetIndex 0x01
-#define Color_CompareIndex 0x02
-#define Data_RotateIndex 0x03
-#define Read_Map_SelectIndex 0x04
-#define Graphics_ModeIndex 0x05
-#define MiscellaneousIndex 0x06
-#define Color_Dont_CareIndex 0x07
-#define Bit_MaskIndex 0x08
-#ifndef PC98_EGC
-#define SetVideoGraphicsIndex( index ) \
- SET_INDEX_REGISTER( GraphicsIndexRegister, index )
-#define SetVideoGraphicsData( value ) \
- SET_INDEX_REGISTER( GraphicsDataRegister, value )
-#define SetVideoGraphics( index, value ) \
- SET_INDEXED_REGISTER( GraphicsRegister, index, value )
-#endif
-
-/* Sequencer Registers 03C4 & 03C5 */
-#define SequencerIndexRegister REGBASE + 0xC4
-#define SequencerDataRegister REGBASE + 0xC5
-#define SequencerRegister SequencerIndexRegister
-#define Seq_ResetIndex 00
-#define Clock_ModeIndex 01
-#define Mask_MapIndex 02
-#define Char_Map_SelectIndex 03
-#define Memory_ModeIndex 04
-#ifndef PC98_EGC
-#define SetVideoSequencerIndex( index ) \
- SET_INDEX_REGISTER( SequencerIndexRegister, index )
-#define SetVideoSequencer( index, value ) \
- SET_INDEXED_REGISTER( SequencerRegister, index, value )
-#endif
-
-/* BIT CONSTANTS FOR THE VGA/EGA HARDWARE */
-/* for the Graphics' Data_Rotate Register */
-#define VGA_ROTATE_FUNC_SHIFT 3
-#define VGA_COPY_MODE ( 0 << VGA_ROTATE_FUNC_SHIFT ) /* 0x00 */
-#define VGA_AND_MODE ( 1 << VGA_ROTATE_FUNC_SHIFT ) /* 0x08 */
-#define VGA_OR_MODE ( 2 << VGA_ROTATE_FUNC_SHIFT ) /* 0x10 */
-#define VGA_XOR_MODE ( 3 << VGA_ROTATE_FUNC_SHIFT ) /* 0x18 */
-/* for the Graphics' Graphics_Mode Register */
-#define VGA_READ_MODE_SHIFT 3
-#define VGA_WRITE_MODE_0 0
-#define VGA_WRITE_MODE_1 1
-#define VGA_WRITE_MODE_2 2
-#define VGA_WRITE_MODE_3 3
-#define VGA_READ_MODE_0 ( 0 << VGA_READ_MODE_SHIFT )
-#define VGA_READ_MODE_1 ( 1 << VGA_READ_MODE_SHIFT )
-
-#ifdef PC98_EGC
-/* I/O port address define for extended EGC */
-#define EGC_PLANE 0x4a0 /* EGC active plane select */
-#define EGC_READ 0x4a2 /* EGC FGC,EGC,Read Plane */
-#define EGC_MODE 0x4a4 /* EGC Mode register & ROP */
-#define EGC_FGC 0x4a6 /* EGC Forground color */
-#define EGC_MASK 0x4a8 /* EGC Mask register */
-#define EGC_BGC 0x4aa /* EGC Background color */
-#define EGC_ADD 0x4ac /* EGC Dest/Source address */
-#define EGC_LENGTH 0x4ae /* EGC Bit length */
-
-#define PALETTE_ADD 0xa8 /* Palette address */
-#define PALETTE_GRE 0xaa /* Palette Green */
-#define PALETTE_RED 0xac /* Palette Red */
-#define PALETTE_BLU 0xae /* Palette Blue */
-
-#define EGC_AND_MODE 0x2c8c /* (S&P&D)|(~S&D) */
-#define EGC_AND_INV_MODE 0x2c2c /* (S&P&~D)|(~S&D) */
-#define EGC_OR_MODE 0x2cec /* S&(P|D)|(~S&D) */
-#define EGC_OR_INV_MODE 0x2cbc /* S&(P|~D)|(~S&D) */
-#define EGC_XOR_MODE 0x2c6c /* (S&(P&~D|~P&D))|(~S&D) */
-#define EGC_XOR_INV_MODE 0x2c9c /* (S&(P&D)|(~P&~D))|(~S&D) */
-#define EGC_COPY_MODE 0x2cac /* (S&P)|(~S&D) */
-#endif
diff --git a/hw/xfree86/xf4bpp/vgaSolid.c b/hw/xfree86/xf4bpp/vgaSolid.c
deleted file mode 100644
index b3711f852..000000000
--- a/hw/xfree86/xf4bpp/vgaSolid.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: vgaSolid.c /main/5 1996/02/21 17:59:06 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "vgaReg.h"
-#include "vgaVideo.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-#undef TRUE
-#undef FALSE
-#define TRUE 1
-#define FALSE 0
-
-#ifndef PC98_EGC
-#ifdef USE_ASM
-extern void fastFill();
-extern void fastFillRMW();
-#else
-
-static void fastFill
-(
- register volatile unsigned char *destination,
- register const unsigned int bytes_per_line,
- register const unsigned int bytewidth, /* MUST BE > 0 !! */
- register unsigned int height /* MUST BE > 0 !! */
-)
-{
-int stop_count = bytewidth ;
-register int row_jump = bytes_per_line - bytewidth ;
-#if !defined(OLDHC) && defined(BSDrt) && !defined(i386)
-register const unsigned int notZero = ((unsigned char)(~0x0));
-#else
-#define notZero ((unsigned char)(~0))
-#endif
-
-#define SINGLE_STORE \
- ( *( (VgaMemoryPtr) destination ) = notZero ); \
- destination++; stop_count--;
-
-/* TOP OF FIRST LOOP */
-BranchPoint:
-
-switch ( bytewidth & 0xF ) { /* Jump into loop at mod 16 remainder */
- LoopTop :
- case 0x0 : SINGLE_STORE ;
- case 0xF : SINGLE_STORE ;
- case 0xE : SINGLE_STORE ;
- case 0xD : SINGLE_STORE ;
- case 0xC : SINGLE_STORE ;
- case 0xB : SINGLE_STORE ;
- case 0xA : SINGLE_STORE ;
- case 0x9 : SINGLE_STORE ;
- case 0x8 : SINGLE_STORE ;
- case 0x7 : SINGLE_STORE ;
- case 0x6 : SINGLE_STORE ;
- case 0x5 : SINGLE_STORE ;
- case 0x4 : SINGLE_STORE ;
- case 0x3 : SINGLE_STORE ;
- case 0x2 : SINGLE_STORE ;
- case 0x1 : SINGLE_STORE ;
-/* FIRST LOOP */
- if ( stop_count )
- goto LoopTop ;
-/* SECOND LOOP */
- if ( --height ) {
- destination += row_jump ;
- stop_count = bytewidth ;
- goto BranchPoint ;
- }
- else
- return ;
-#undef SINGLE_STORE
-}
-/*NOTREACHED*/
-}
-
-/* For Read-Modify-Write Case */
-static void fastFillRMW
-(
- register volatile unsigned char *destination,
- register const unsigned int bytes_per_line,
- register const unsigned int bytewidth, /* MUST BE > 0 !! */
- register unsigned int height /* MUST BE > 0 !! */
-)
-{
-int stop_count = bytewidth ;
-register int row_jump = bytes_per_line - bytewidth ;
-#if !defined(OLDHC) && defined(BSDrt) && !defined(i386)
-register const unsigned int notZero = ((unsigned char)(~0x0));
-#endif
-register int tmp ;
-
-#define SINGLE_STORE \
- tmp = *( (VgaMemoryPtr) destination ) ; (void)tmp; \
- ( *( (VgaMemoryPtr) destination ) = notZero ) ; \
- destination++; stop_count-- ;
-
-/* TOP OF FIRST LOOP */
-BranchPoint:
-
-switch ( bytewidth & 0xF ) { /* Jump into loop at mod 16 remainder */
- LoopTop :
- case 0x0 : SINGLE_STORE ;
- case 0xF : SINGLE_STORE ;
- case 0xE : SINGLE_STORE ;
- case 0xD : SINGLE_STORE ;
- case 0xC : SINGLE_STORE ;
- case 0xB : SINGLE_STORE ;
- case 0xA : SINGLE_STORE ;
- case 0x9 : SINGLE_STORE ;
- case 0x8 : SINGLE_STORE ;
- case 0x7 : SINGLE_STORE ;
- case 0x6 : SINGLE_STORE ;
- case 0x5 : SINGLE_STORE ;
- case 0x4 : SINGLE_STORE ;
- case 0x3 : SINGLE_STORE ;
- case 0x2 : SINGLE_STORE ;
- case 0x1 : SINGLE_STORE ;
-/* FIRST LOOP */
- if ( stop_count )
- goto LoopTop ;
-/* SECOND LOOP */
- if ( --height ) {
- destination += row_jump ;
- stop_count = bytewidth ;
- goto BranchPoint ;
- }
- else
- return ;
-}
-#undef SINGLE_STORE
-/*NOTREACHED*/
-}
-#endif
-
-
-void xf4bppFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
-WindowPtr pWin; /* GJA */
-unsigned long int color ;
-const int alu ;
-unsigned long int planes ;
-register int x0 ;
-register const int y0 ;
-register int lx ;
-register const int ly ; /* MUST BE > 0 !! */
-{
-IOADDRESS REGBASE;
-register volatile unsigned char *dst ;
-register int tmp ;
-register int tmp2 ;
-register int tmp3 ;
-unsigned int data_rotate_value = VGA_COPY_MODE ;
-unsigned int read_write_modify = FALSE ;
-unsigned int invert_existing_data = FALSE ;
-
-{ /* Start GJA */
- if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly );
- return;
- }
-} /* End GJA */
-
-if ( ( lx == 0 ) || ( ly == 0 ) )
- return;
-
-switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- color = 0 ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- invert_existing_data = TRUE ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- color = ~color ;
- case GXand: /* 0x1 src AND dst */
- data_rotate_value = VGA_AND_MODE ;
- read_write_modify = TRUE ;
- case GXcopy: /* 0x3 src */
- break ;
- case GXnoop: /* 0x5 dst */
- return ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- color = ~color ;
- case GXxor: /* 0x6 src XOR dst */
- data_rotate_value = VGA_XOR_MODE ;
- read_write_modify = TRUE ;
- planes &= color ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- invert_existing_data = TRUE ;
- data_rotate_value = VGA_AND_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- invert_existing_data = TRUE ;
- data_rotate_value = VGA_OR_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- invert_existing_data = TRUE ;
- case GXorInverted: /* 0xd NOT src OR dst */
- color = ~color ;
- case GXor: /* 0x7 src OR dst */
- data_rotate_value = VGA_OR_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- color = ~color ;
- break ;
- case GXinvert: /* 0xa NOT dst */
- data_rotate_value = VGA_XOR_MODE ;
- read_write_modify = TRUE ;
- case GXset: /* 0xf 1 */
- color = VGA_ALLPLANES ;
- default:
- break ;
-}
-
-if ( !( planes &= VGA_ALLPLANES ) )
- return ;
-
-REGBASE =
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
-
-/*
- * Set The Plane-Enable
- */
-SetVideoSequencer( Mask_MapIndex, planes ) ;
-SetVideoGraphics( Enb_Set_ResetIndex, planes ) ;
-/*
- * Put Display Into SET/RESET Write Mode
- */
-SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_3 ) ;
-/*
- * Set The Color in The Set/Reset Register
- */
-SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
-/*
- * Set The Function-Select In The Data Rotate Register
- */
-SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
-
-/* Do Left Edge */
-if ((tmp = x0 & 07)) {
- tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp ) ;
- /* Catch The Cases Where The Entire Region Is Within One Byte */
- if ( ( lx -= 8 - tmp ) < 0 ) {
- tmp2 &= SCRLEFT8( 0xFF, -lx ) ;
- lx = 0 ;
- }
- /* Set The Bit Mask Reg */
- SetVideoGraphics(Bit_MaskIndex, tmp2 ) ;
- if ( invert_existing_data == TRUE ) {
- SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
- dst = SCREENADDRESS( pWin, x0, y0 );
- for ( tmp = ly;
- tmp-- ; ) {
- tmp3 = *( (VgaMemoryPtr) dst ) ;
- (void)tmp3;
- *( (VgaMemoryPtr) dst ) = tmp2 ;
- dst += BYTES_PER_LINE(pWin);
- }
- SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
- /* Un-Set XOR */
- }
- dst = SCREENADDRESS( pWin, x0, y0 );
- for ( tmp = ly;
- tmp-- ; ) {
- tmp3 = *( (VgaMemoryPtr) dst ) ;
- (void)tmp3;
- *( (VgaMemoryPtr) dst ) = tmp2 ;
- dst += BYTES_PER_LINE(pWin);
- }
- if ( !lx ) { /* All Handled In This Byte */
- return ;
- }
- x0 = ( x0 + 8 ) & ~07 ;
-}
-
-/* Fill The Center Of The Box */
-if ( ROW_OFFSET( lx ) ) {
- SetVideoGraphics(Bit_MaskIndex, 0xFF ) ;
- if ( invert_existing_data == TRUE ) {
- SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
- fastFillRMW( SCREENADDRESS( pWin, x0, y0 ),
- BYTES_PER_LINE(pWin),
- ROW_OFFSET( lx ), ly ) ;
- SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
- /* Un-Set XOR */
- /* Point At The Bit Mask Reg */
- }
- (* ( ( read_write_modify == FALSE ) ? fastFill : fastFillRMW ) )
- ( SCREENADDRESS( pWin, x0, y0 ), BYTES_PER_LINE(pWin),
- ROW_OFFSET( lx ), ly ) ;
-}
-
-/* Do Right Edge */
-if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */
- /* Set The Bit Mask */
- SetVideoGraphics( Bit_MaskIndex,
- (tmp2 = SCRLEFT8( 0xFF, ( 8 - tmp ) ) ) ) ;
- if ( invert_existing_data == TRUE ) {
- SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
- dst = SCREENADDRESS( pWin, ( x0 + lx ), y0 );
- for ( tmp = ly;
- tmp-- ; ) {
- tmp3 = *( (VgaMemoryPtr) dst ) ;
- (void)tmp3;
- *( (VgaMemoryPtr) dst ) = tmp2 ;
- dst += BYTES_PER_LINE(pWin);
- }
- SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
- SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
- /* Un-Set XOR */
- }
- dst = SCREENADDRESS( pWin, ( x0 + lx ), y0 );
- for ( tmp = ly;
- tmp-- ; ) {
- tmp3 = *( (VgaMemoryPtr) dst ) ;
- (void)tmp3;
- *( (VgaMemoryPtr) dst ) = tmp2 ;
- dst += BYTES_PER_LINE(pWin) ;
- }
-}
-/* Disable Set/Reset Register */
-SetVideoGraphics( Enb_Set_ResetIndex, 0 ) ;
-
-
-return ;
-}
-
-#else /* for PC98 EGC */
-static void WordfastFill( destination, bytes_per_line, wordwidth, height )
-register volatile unsigned char *destination ;
-register const unsigned int bytes_per_line ;
-register const unsigned int wordwidth ; /* MUST BE > 0 !! */
-register unsigned int height ; /* MUST BE > 0 !! */
-{
-int stop_count = wordwidth ;
-register int row_jump = bytes_per_line - wordwidth*2 ;
-#if !defined(OLDHC) && defined(BSDrt) && !defined(i386) && 0
-register const int notZero = ~0x0 ;
-#else
-#define notZero ( ~0 )
-#endif
-
-#define SINGLE_STORE \
- ( *( (unsigned short *) destination++ ) = notZero ); \
- destination++; stop_count--;
-
-/* TOP OF FIRST LOOP */
-BranchPoint:
-
-switch ( wordwidth & 0xF ) { /* Jump into loop at mod 16 remainder */
- LoopTop :
- case 0x0 : SINGLE_STORE ;
- case 0xF : SINGLE_STORE ;
- case 0xE : SINGLE_STORE ;
- case 0xD : SINGLE_STORE ;
- case 0xC : SINGLE_STORE ;
- case 0xB : SINGLE_STORE ;
- case 0xA : SINGLE_STORE ;
- case 0x9 : SINGLE_STORE ;
- case 0x8 : SINGLE_STORE ;
- case 0x7 : SINGLE_STORE ;
- case 0x6 : SINGLE_STORE ;
- case 0x5 : SINGLE_STORE ;
- case 0x4 : SINGLE_STORE ;
- case 0x3 : SINGLE_STORE ;
- case 0x2 : SINGLE_STORE ;
- case 0x1 : SINGLE_STORE ;
-/* FIRST LOOP */
- if ( stop_count )
- goto LoopTop ;
-/* SECOND LOOP */
- if ( --height ) {
- destination += row_jump ;
- stop_count = wordwidth ;
- goto BranchPoint ;
- }
- else
- return ;
-#undef SINGLE_STORE
-}
-/*NOTREACHED*/
-}
-
-void xf4bppFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
-WindowPtr pWin; /* GJA */
-unsigned long int color ;
-const int alu ;
-unsigned long int planes ;
-register int x0 ;
-register const int y0 ;
-register int lx ;
-register const int ly ; /* MUST BE > 0 !! */
-{
-register volatile unsigned char *dst ;
-register tmp ;
-register tmp2 ;
-register unsigned short tmp3 ;
-unsigned short ROP_value;
-unsigned int data_rotate_value = VGA_COPY_MODE ;
-unsigned int read_write_modify = FALSE ;
-unsigned int invert_existing_data = FALSE ;
-
-{ /* Start GJA */
- if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly );
- return;
- }
-} /* End GJA */
-
-if ( ( lx == 0 ) || ( ly == 0 ) )
- return;
-
-switch ( alu ) {
- case GXclear: /* 0x0 Zero 0 */
- color = 0 ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- invert_existing_data = TRUE ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- color = ~color ;
- case GXand: /* 0x1 src AND dst */
- data_rotate_value = VGA_AND_MODE ;
- read_write_modify = TRUE ;
- case GXcopy: /* 0x3 src */
- break ;
- case GXnoop: /* 0x5 dst */
- return ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- color = ~color ;
- case GXxor: /* 0x6 src XOR dst */
- data_rotate_value = VGA_XOR_MODE ;
- read_write_modify = TRUE ;
- planes &= color ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- invert_existing_data = TRUE ;
- data_rotate_value = VGA_AND_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- invert_existing_data = TRUE ;
- data_rotate_value = VGA_OR_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- invert_existing_data = TRUE ;
- case GXorInverted: /* 0xd NOT src OR dst */
- color = ~color ;
- case GXor: /* 0x7 src OR dst */
- data_rotate_value = VGA_OR_MODE ;
- read_write_modify = TRUE ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- color = ~color ;
- break ;
- case GXinvert: /* 0xa NOT dst */
- data_rotate_value = VGA_XOR_MODE ;
- read_write_modify = TRUE ;
- case GXset: /* 0xf 1 */
- color = VGA_ALLPLANES ;
- default:
- break ;
-}
-
-if ( !( planes &= VGA_ALLPLANES ) )
- return ;
-
-/* Set Access Planes */
-outw(EGC_PLANE, ~planes);
-switch(data_rotate_value) {
-/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
- case VGA_AND_MODE:
- if (invert_existing_data)
- ROP_value = EGC_AND_INV_MODE;
- else
- ROP_value = EGC_AND_MODE;
- break;
- case VGA_OR_MODE:
- if (invert_existing_data)
- ROP_value = EGC_OR_INV_MODE;
- else
- ROP_value = EGC_OR_MODE;
- break;
- case VGA_XOR_MODE:
- if (invert_existing_data)
- ROP_value = EGC_XOR_INV_MODE;
- else
- ROP_value = EGC_XOR_MODE;
- break;
- case VGA_COPY_MODE:
- default:
- ROP_value = EGC_COPY_MODE;
- break;
-}
-outw(EGC_MODE, ROP_value);
-outw(EGC_FGC, color & VGA_ALLPLANES);
-/* Do Left Edge */
-if ( tmp = x0 & 0x0f ) {
- dst = (unsigned char *)((int)(SCREENADDRESS(pWin,x0,y0)) & ~0x01);
- tmp3 = (unsigned)0xffff >>tmp;
- /* Catch The Cases Where The Entire Region Is Within One Word */
- if ( ( lx -= 16 - tmp ) < 0 ) {
- tmp3 &= (unsigned)0xffff << -lx;
- lx = 0 ;
- }
- tmp3 = (unsigned short)(tmp3 >> 8 | tmp3 << 8);
- for ( tmp = ly;
- tmp-- ; ) {
- *((unsigned short *) dst ) = tmp3 ;
- dst += BYTES_PER_LINE(pWin);
- }
- if ( !lx ) { /* All Handled In This Word */
- return ;
- }
- x0 = ( x0 + 0x0f ) & ~0x0f ;
-}
-
-/* Fill The Center Of The Box */
-if (lx >> 4) {
- WordfastFill( SCREENADDRESS( pWin, x0, y0 ), BYTES_PER_LINE(pWin),
- (lx >> 4), ly ) ;
-}
-
-/* Do Right Edge */
-if ( tmp = lx & 0x0f ) { /* x0 Now Is Word Aligned */
- /* Set The Bit Mask */
- tmp3 = (unsigned)0xffff << ( 16 - tmp );
- dst = (unsigned char*)((int)SCREENADDRESS(pWin,(x0+lx),y0) & ~0x01);
- tmp3 = (unsigned short)(tmp3 >> 8 | tmp3 << 8);
- for ( tmp = ly;
- tmp-- ; ) {
- *( (unsigned short *) dst ) = tmp3 ;
- dst += BYTES_PER_LINE(pWin);
- }
-}
-
-return ;
-}
-#endif
diff --git a/hw/xfree86/xf4bpp/vgaStipple.c b/hw/xfree86/xf4bpp/vgaStipple.c
deleted file mode 100644
index f5ace74d0..000000000
--- a/hw/xfree86/xf4bpp/vgaStipple.c
+++ /dev/null
@@ -1,718 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/* $XConsortium: vgaStipple.c /main/5 1996/02/21 17:59:10 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "vgaReg.h"
-#include "vgaVideo.h"
-
-#include "xf86str.h" /* for pScrn->vtSema */
-extern ScrnInfoPtr *xf86Screens;
-
-#ifndef PC98_EGC
-static unsigned char
-getbits
-(
- register const int x,
- register const unsigned int patternWidth,
- register const unsigned char * const lineptr
-)
-{
-register unsigned char bits ;
-register const unsigned char *cptr ;
-register int shift ;
-register int wrap ;
-
-cptr = lineptr + ( x >> 3 ) ;
-bits = *cptr ;
-if ((shift = x & 7))
- bits = SCRLEFT8( bits, shift ) | SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
-if ( ( wrap = x + 8 - patternWidth ) > 0 ) {
- bits &= SCRLEFT8( 0xFF, wrap ) ;
- bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
-}
-
-/* GJA -- Handle extraction of 8 bits from < 8 bits wide stipple.
- * I duplicated case 4,5,6,7 to give the compiler a chance to optimize.
- */
-switch (patternWidth) {
-case 1: /* Not really useful. */
- bits &= ~SCRRIGHT8(0xFF,1);
- bits |= SCRRIGHT8(bits,1);
- bits |= SCRRIGHT8(bits,2);
- bits |= SCRRIGHT8(bits,4);
- break;
-case 2:
- bits &= ~SCRRIGHT8(0xFF,2);
- bits |= SCRRIGHT8(bits,2); bits |= SCRRIGHT8(bits,4); break;
-case 3:
- bits &= ~SCRRIGHT8(0xFF,3);
- bits |= (SCRRIGHT8(bits,3) | SCRRIGHT8(bits,6)); break;
-case 4:
- bits = (bits & ~SCRRIGHT8(0xFF,4)) | SCRRIGHT8(bits,4); break;
-case 5:
- bits = (bits & ~SCRRIGHT8(0xFF,5)) | SCRRIGHT8(bits,5); break;
-case 6:
- bits = (bits & ~SCRRIGHT8(0xFF,6)) | SCRRIGHT8(bits,6); break;
-case 7:
- bits = (bits & ~SCRRIGHT8(0xFF,7)) | SCRRIGHT8(bits,7); break;
-default:
- ;
- /* Do nothing, of course */
-}
-return bits ;
-}
-#endif
-
-/* GJA --
- * Basically, in the code below, we will draw a stipple in the usual
- * three parts: left edge, center and right edge.
- * For efficiency reasons, the center will be drawn byte aligned, so that
- * we will have to shuffle the bits in the left and right edges.
- * The hard cases will be stipples with width < 8: In order to get 8
- * bits from those, we will need a loop. One single 'if' will never do.
- * This is taken care of above.
- */
-static void
-DoMonoSingle
-(
- WindowPtr pWin, /* GJA */
- int w,
- int x,
- int y,
- register const unsigned char *mastersrc,
- int h,
- register unsigned int width,
- register unsigned int paddedByteWidth,
- unsigned int height,
- int xshift,
- int yshift
-)
-{
-IOADDRESS REGBASE =
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
-register volatile unsigned char *xDst ;
-register VideoAdapterObject tmp2 ;
-register int NeedValX ;
-register int counter ;
-register int tmp1 ;
-unsigned int rowCounter ;
-int byte_cnt ;
-#ifdef PC98_EGC
-unsigned char bitmask;
-#endif
-
-/* Do Left Edge */
-if ((tmp1 = x & 07)) {
- tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp1 ) ;
- /* Catch The Cases Where The Entire Region Is Within One Byte */
- if ( ( w -= 8 - tmp1 ) < 0 ) {
- tmp2 &= SCRLEFT8( (unsigned) 0xFF, -w ) ;
- w = 0 ;
- }
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, tmp2 ) ; /* Set The Bit Mask */
-#else
- bitmask = tmp2; /* Set The Bit Mask */
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- xDst = SCREENADDRESS( pWin, x, y );
- for ( tmp1 = yshift, rowCounter = h;
- rowCounter ;
- rowCounter-- , tmp1++ ) {
-
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
-#ifndef PC98_EGC
- /* Read To Save */
- tmp2 = *( (VgaMemoryPtr) xDst) ;
-#endif
- /* Write Pattern */
- *( (VgaMemoryPtr) xDst ) =
-#ifndef PC98_EGC
- getbits( xshift /* GJA */, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) >> (x & 07) ;
-#else
-#if 0
- (getbits( xshift /* GJA */, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) >> (x & 07)
- & bitmask);
-#else
- (getbits_x( xshift /* GJA */, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ), (x & 07))
- & bitmask);
-#endif
-#endif
- xDst += BYTES_PER_LINE(pWin);
- }
- NeedValX = (xshift + 8 - (x & 07)) % width;
- x = ( x + 7 ) & ~07 ;
-}
-else {
- NeedValX = xshift ;
-}
-
-if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
- int SavNeedX = NeedValX ;
-
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, 0xFF ) ; /* Set The Bit Mask */
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- xDst = SCREENADDRESS( pWin, x, y );
- for ( tmp1 = yshift, rowCounter = h;
- rowCounter ;
- rowCounter-- , tmp1++ ) {
- register const unsigned char *l_ptr ;
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
- l_ptr = mastersrc + ( tmp1 * paddedByteWidth ) ;
- /*
- * For Each Byte Across The Pattern In X
- */
- for ( counter = byte_cnt, NeedValX = SavNeedX ;
- counter-- ; ) {
-#ifndef PC98_EGC
- /* Read To Save */
- tmp2 = *( (VgaMemoryPtr) xDst) ;
-#endif
- /* Write Pattern */
- *( (VgaMemoryPtr) xDst ) =
-#ifndef PC98_EGC
- getbits( NeedValX, width, l_ptr ) ;
-#else
-#if 0
- getbits( NeedValX, width, l_ptr ) ;
-#else
- getbits_x ( NeedValX, width, l_ptr, 0 ) ;
-#endif
-#endif
- /* GJA -- The '%' is there since width could be < 8 */
- NeedValX = (NeedValX + 8) % width;
- xDst++;
- }
- xDst += BYTES_PER_LINE(pWin) - byte_cnt;
- }
-}
-
-/* Do Right Edge */
-if ((tmp1 = BIT_OFFSET(w))) { /* x Now Is Byte Aligned */
- /* Set The Bit Mask */
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, SCRLEFT8( 0xFF, ( 8 - tmp1 ) ) ) ;
-#else
- bitmask = SCRLEFT8( 0xFF, ( 8 - tmp1 ));
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- xDst = SCREENADDRESS( pWin, ( x + w ), y );
- for ( tmp1 = yshift, rowCounter = h;
- rowCounter ;
- rowCounter-- , tmp1++ ) {
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
-#ifndef PC98_EGC
- /* Read To Save */
- tmp2 = *( (VgaMemoryPtr) xDst) ;
-#endif
- /* Write Pattern */
- *( (VgaMemoryPtr) xDst ) =
-#ifndef PC98_EGC
- getbits( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) ;
-#else
-#if 0
- (getbits( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) & bitmask);
-#else
- (getbits_x( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ), 0 ) & bitmask);
-#endif
-#endif
- xDst += BYTES_PER_LINE(pWin) ;
- }
-}
-
-return ;
-}
-
-static void
-DoMonoMany
-(
- WindowPtr pWin, /* GJA */
- int w,
- int x,
- int y,
- register const unsigned char *mastersrc,
- int h,
- register unsigned int width,
- register unsigned int paddedByteWidth,
- unsigned int height,
- int xshift,
- int yshift
-)
-{
-IOADDRESS REGBASE =
- xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
-register volatile unsigned char *xDst ;
-register VideoAdapterObject tmp2 ;
-register int NeedValX ;
-register int byte_cnt ;
-register int tmp1 ;
-unsigned DestinationRow ;
-unsigned int SourceRow ;
-volatile unsigned char *dst ;
-int scr_incr = ( height * BYTES_PER_LINE(pWin) ) ;
-#ifdef PC98_EGC
-unsigned char bitmask;
-#endif
-
-/* Do Left Edge */
-if ((tmp1 = x & 07)) {
- tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp1 ) ;
- /* Catch The Cases Where The Entire Region Is Within One Byte */
- if ( ( w -= 8 - tmp1 ) < 0 ) {
- tmp2 &= SCRLEFT8( (unsigned) 0xFF, -w ) ;
- w = 0 ;
- }
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, tmp2 ) ; /* Set The Bit Mask */
-#else
- bitmask = tmp2; /* Set The Bit Mask */
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- for ( tmp1 = yshift, SourceRow = 0, dst = SCREENADDRESS( pWin, x, y ) ;
- SourceRow < height ;
- tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) ) {
- register unsigned bitPattern ;
-
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
- /*
- * For Each Time Pattern Repeats In The Y Dimension
- */
- xDst = dst;
- for ( DestinationRow = SourceRow,
-#ifndef PC98_EGC
- bitPattern = getbits( xshift, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) ;
-#else
-#if 0
- bitPattern = getbits( xshift, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) ;
-#else
- bitPattern = getbits_x( xshift, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ), 0 ) ;
-#endif
-#endif
- (int)DestinationRow < h ;
- DestinationRow += height ) {
-#ifndef PC98_EGC
- /* Read To Save */
- tmp2 = *( (VgaMemoryPtr) xDst ) ;
-#endif
- /* Write Pattern */
-#ifndef PC98_EGC
- *( (VgaMemoryPtr) xDst ) = bitPattern >> (x & 07);
-#else
- *( (VgaMemoryPtr) xDst ) = (bitPattern >> (x & 07)) & bitmask;
-#endif
- xDst += scr_incr;
- }
- }
- NeedValX = (xshift + 8 - (x & 07)) % width;
- x = ( x + 7 ) & ~07 ;
-}
-else {
- NeedValX = xshift ;
-}
-
-if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
- int SavNeedX = NeedValX ;
-
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, 0xFF ) ; /* Set The Bit Mask */
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- for ( tmp1 = yshift, SourceRow = 0, dst = SCREENADDRESS( pWin, x, y ) ;
- SourceRow < height ;
- tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) - byte_cnt ) {
- register const unsigned char *l_ptr ;
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
- l_ptr = mastersrc + ( tmp1 * paddedByteWidth ) ;
- /*
- * For Each Byte Across The Pattern In X
- */
- for ( tmp2 = byte_cnt, NeedValX = SavNeedX ;
- tmp2-- ;
- dst++ ) {
- register unsigned bitPattern ;
-#ifndef PC98_EGC
- register VideoAdapterObject tmp3 ;
-#endif
- /*
- * For Each Time Pattern Repeats In Y
- */
- xDst = dst;
- for ( DestinationRow = SourceRow,
-#ifndef PC98_EGC
- bitPattern = getbits( NeedValX, width, l_ptr ) ;
-#else
-#if 0
- bitPattern = getbits( NeedValX, width, l_ptr ) ;
-#else
- bitPattern = getbits_x( NeedValX, width, l_ptr, 0 ) ;
-#endif
-#endif
- (int)DestinationRow < h ;
- DestinationRow += height ) {
-#ifndef PC98_EGC
- /* Read To Save */
- tmp3 = *( (VgaMemoryPtr) xDst) ;
- (void)tmp3;
-#endif
- /* Write Pattern */
- *( (VgaMemoryPtr) xDst ) = bitPattern ;
- xDst += scr_incr;
- }
- NeedValX = (NeedValX + 8) % width;
- }
- }
-}
-
-/* Do Right Edge */
-if ((tmp1 = BIT_OFFSET(w))) { /* x Now Is Byte Aligned */
- /* Set The Bit Mask */
-#ifndef PC98_EGC
- SetVideoGraphics( Bit_MaskIndex, SCRLEFT8( 0xFF, ( 8 - tmp1 ) ) ) ;
-#else
- bitmask = SCRLEFT8( 0xFF, ( 8 - tmp1 ) );
-#endif
- /*
- * For Each Line In The Source Pixmap
- */
- for ( tmp1 = yshift, SourceRow = 0,
- dst = SCREENADDRESS( pWin, ( x + w ), y ) ;
- SourceRow < height ;
- tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) ) {
- register unsigned bitPattern ;
- if ( tmp1 >= (int)height )
- tmp1 -= height ;
- /*
- * For Each Time Pattern Repeats In The Y Dimension
- */
- xDst = dst;
- for ( DestinationRow = SourceRow,
-#ifndef PC98_EGC
- bitPattern = getbits( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) ;
-#else
-#if 0
- bitPattern = getbits( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ) ) ;
-#else
- bitPattern = getbits_x( NeedValX, width,
- mastersrc
- + ( tmp1 * paddedByteWidth ), 0 ) ;
-#endif
-#endif
- (int)DestinationRow < h ;
- DestinationRow += height ) {
-#ifndef PC98_EGC
- /* Read To Save */
- tmp2 = *( (VgaMemoryPtr) xDst) ;
-#endif
- /* Write Pattern */
-#ifndef PC98_EGC
- *( (VgaMemoryPtr) xDst ) = bitPattern ;
-#else
- *( (VgaMemoryPtr) xDst ) = bitPattern & bitmask;
-#endif
- xDst += scr_incr;
- }
- }
-}
-
-return ;
-}
-
-#define DO_RECURSE 0x10000
-
-static void
-vgaSetMonoRegisters
-(
- DrawablePtr pDrawable,
- register unsigned long int plane_mask,
- register unsigned long int desiredState
-)
-{
-IOADDRESS REGBASE =
- xf86Screens[pDrawable->pScreen->myNum]->domainIOBase + 0x300;
-#ifndef PC98_EGC
-/* Setup VGA Registers */
-/*
- * Set The Plane-Enable
- */
-SetVideoSequencer( Mask_MapIndex, plane_mask ) ;
-SetVideoGraphics( Enb_Set_ResetIndex, plane_mask ) ;
-/*
- * Put Display Into SET-AND (i.e. Write Mode 3 )
- */
-SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_3 ) ;
-/*
- * Set The Color in The Set/Reset Register
- */
-SetVideoGraphics( Set_ResetIndex, desiredState & VGA_ALLPLANES ) ;
-/*
- * Set The Vga's Alu Function
- */
-SetVideoGraphics( Data_RotateIndex, desiredState >> 8 ) ;
-#else /* PC98_EGC */
-unsigned short ROP_value;
-/* Setup VGA Registers */
-/*
- * Set The Plane-Enable
- */
-outw(EGC_PLANE, ~plane_mask);
-switch((desiredState >> 8)&0x18) {
-/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
- case VGA_AND_MODE:
- if (desiredState & DO_RECURSE)
- ROP_value = EGC_AND_INV_MODE;
- else
- ROP_value = EGC_AND_MODE;
- break;
- case VGA_OR_MODE:
- if (desiredState & DO_RECURSE)
- ROP_value = EGC_OR_INV_MODE;
- else
- ROP_value = EGC_OR_MODE;
- break;
- case VGA_XOR_MODE:
- if (desiredState & DO_RECURSE)
- ROP_value = EGC_XOR_INV_MODE;
- else
- ROP_value = EGC_XOR_MODE;
- break;
- case VGA_COPY_MODE:
- default:
- ROP_value = EGC_COPY_MODE;
- break;
-}
-outw(EGC_MODE, ROP_value);
-outw(EGC_FGC, desiredState & VGA_ALLPLANES);
-#endif
-
-return ;
-}
-
-static unsigned long
-vgaCalcMonoMode
-(
- int rasterOp,
- register unsigned long int color
-)
-{
-register unsigned int data_rotate_value = VGA_COPY_MODE << 8 ;
-register unsigned int invert_existing_data = 0 ;
-
-/* Test The Raster-Op */
-switch ( rasterOp ) {
- case GXclear: /* 0x0 Zero 0 */
- color = 0 ;
- break ;
- case GXinvert: /* 0xa NOT dst */
- data_rotate_value = VGA_XOR_MODE << 8 ;
- case GXset: /* 0xf 1 */
- color = VGA_ALLPLANES ;
- break ;
- case GXnor: /* 0x8 NOT src AND NOT dst */
- invert_existing_data = DO_RECURSE ;
- case GXandInverted: /* 0x4 NOT src AND dst */
- color = ~color ;
- case GXand: /* 0x1 src AND dst */
- data_rotate_value = VGA_AND_MODE << 8 ;
- case GXcopy: /* 0x3 src */
- break ;
- case GXequiv: /* 0x9 NOT src XOR dst */
- color = ~color ;
- case GXxor: /* 0x6 src XOR dst */
- data_rotate_value = VGA_XOR_MODE << 8 ;
- break ;
- case GXandReverse: /* 0x2 src AND NOT dst */
- invert_existing_data = DO_RECURSE ;
- data_rotate_value = VGA_AND_MODE << 8 ;
- break ;
- case GXorReverse: /* 0xb src OR NOT dst */
- invert_existing_data = DO_RECURSE ;
- data_rotate_value = VGA_OR_MODE << 8 ;
- break ;
- case GXnand: /* 0xe NOT src OR NOT dst */
- invert_existing_data = DO_RECURSE ;
- case GXorInverted: /* 0xd NOT src OR dst */
- color = ~color ;
- case GXor: /* 0x7 src OR dst */
- data_rotate_value = VGA_OR_MODE << 8 ;
- break ;
- case GXcopyInverted: /* 0xc NOT src */
- color = ~color ;
- break ;
- case GXnoop: /* 0x5 dst */
- ; /* Shouldn't Get Here !! */
-}
-
-return ( color & VGA_ALLPLANES ) | data_rotate_value | invert_existing_data ;
-}
-
-static void
-vgaDrawMonoImage
-(
- WindowPtr pWin, /* GJA */
- unsigned char *data,
- int x,
- int y,
- int w,
- int h,
- unsigned long int fg,
- int alu,
- unsigned long int planes
-)
-{
-unsigned long regState ;
-
-if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes );
- return;
-}
-
-if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
-#ifndef PC98_EGC
-if ( ( regState = vgaCalcMonoMode( alu, fg ) ) & DO_RECURSE ) {
- vgaDrawMonoImage( pWin, data, x, y, w, h,
- VGA_ALLPLANES, GXinvert, planes ) ;
- regState &= ~DO_RECURSE ;
-}
-#else
-regState = vgaCalcMonoMode(alu, (char)fg);
-#endif
-
-
-vgaSetMonoRegisters( (DrawablePtr)pWin, planes, regState ) ;
-
-DoMonoSingle( pWin, w, x, y, (const unsigned char *) data, h,
- w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0 ) ;
-
-
-return ;
-}
-
-void
-xf4bppFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
-WindowPtr pWin; /* GJA */
-register PixmapPtr const pStipple ;
-unsigned long int fg ;
-const int alu ;
-unsigned long int planes ;
-int x, y, w, h ;
-const int xSrc, ySrc ;
-{
-unsigned int width ;
-unsigned int height ;
-int xshift ;
-int yshift ;
-unsigned long regState ;
-
-if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
- xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes,
- x, y, w, h, xSrc, ySrc );
- return;
-}
-
-if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
-#if 1
-if ( ( regState = vgaCalcMonoMode( alu, fg ) ) & DO_RECURSE ) {
- xf4bppFillStipple( pWin, pStipple, VGA_ALLPLANES, GXinvert, planes,
- x, y, w, h, xSrc, ySrc ) ;
- regState &= ~DO_RECURSE ;
-}
-#else
-regState = vgaCalcMonoMode(alu, (char)fg);
-#endif
-
-
-vgaSetMonoRegisters( (DrawablePtr)pWin, planes, regState ) ;
-
-/* Figure Bit Offsets & Source Address */
-width = pStipple->drawable.width ;
-if ( ( xshift = ( x - xSrc ) ) < 0 )
- xshift = width - ( ( - xshift ) % width ) ;
-else
- xshift %= width ;
-if ( xshift == (int)width ) xshift = 0;
-
-height = pStipple->drawable.height ;
-if ( ( yshift = ( y - ySrc ) ) < 0 )
- yshift = height - ( ( - yshift ) % height ) ;
-else
- yshift %= height ;
-if ( yshift == (int)height ) yshift = 0;
-
- (* ( (h > (int)height) ? DoMonoMany : DoMonoSingle ) ) (
- pWin, w, x, y,
- (const unsigned char *) pStipple->devPrivate.ptr,
- h,
- width,
- ( ( width + 31 ) & ((unsigned)(~31)) ) >> 3,
- height,
- xshift, yshift
- ) ;
-
-return ;
-}
diff --git a/hw/xfree86/xf4bpp/vgaVideo.h b/hw/xfree86/xf4bpp/vgaVideo.h
deleted file mode 100644
index ecc2fa738..000000000
--- a/hw/xfree86/xf4bpp/vgaVideo.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaVideo.h,v 1.2 1998/07/25 16:59:45 dawes Exp $ */
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-
-/* $XConsortium: vgaVideo.h /main/4 1996/02/21 17:59:14 kaleb $ */
-
-#include "misc.h" /* GJA -- for pointer data type */
-#ifdef lint
-#if defined(volatile)
-#undef volatile
-#endif
-#define volatile /**/
-#if defined(const)
-#undef const
-#endif
-#define const /**/
-#if defined(signed)
-#undef signed
-#endif
-#define signed /**/
-#endif
-
-/*
- * References to all pc ( i.e. '286 ) memory in the
- * regions used by the [ev]ga server ( the 128K windows )
- * MUST be long-word ( i.e. 32-bit ) reads or writes.
- * This definition will change for other memory architectures
- * ( e.g. AIX-Rt )
- */
-typedef unsigned char VideoAdapterObject ;
-typedef volatile VideoAdapterObject *VideoMemoryPtr ;
-typedef volatile VideoAdapterObject *VgaMemoryPtr ;
-#if !defined(BITMAP_BIT_ORDER)
-#define BITMAP_BIT_ORDER MSBFirst
-#endif
-
-#if !defined(IMAGE_BYTE_ORDER)
-#define IMAGE_BYTE_ORDER LSBFirst
-#endif
-
-/* Bit Ordering Macros */
-#if !defined(SCRLEFT8)
-#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
-#endif
-#if !defined(SCRRIGHT8)
-#define SCRRIGHT8(lw, n) ( (unsigned char) (((unsigned char)lw) >> (n)) )
-#endif
-/* These work ONLY on 8-bit wide Quantities !! */
-#define LeftmostBit ( SCRLEFT8( 0xFF, 7 ) & 0xFF )
-#define RightmostBit ( SCRRIGHT8( 0xFF, 7 ) & 0xFF )
-
-/*
- * [ev]ga video screen defines & macros
- */
-#define VGA_BLACK_PIXEL 0
-#define VGA_WHITE_PIXEL 1
-
-#define VGA_MAXPLANES 4
-#define VGA_ALLPLANES 0xFL
-
-#define VIDBASE(pDraw) ((volatile unsigned char *) \
- (((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))-> \
- devPrivate.ptr))
-#define BYTES_PER_LINE(pDraw) \
- ((int)((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))->devKind)
-
-#define ROW_OFFSET( x ) ( ( x ) >> 3 )
-#define BIT_OFFSET( x ) ( ( x ) & 0x7 )
-#define SCREENADDRESS( pWin, x, y ) \
- ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + ROW_OFFSET(x) )
-
-
diff --git a/hw/xfree86/xf4bpp/vgamodule.c b/hw/xfree86/xf4bpp/vgamodule.c
deleted file mode 100644
index c7cf1b7d3..000000000
--- a/hw/xfree86/xf4bpp/vgamodule.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgamodule.c,v 1.8 1999/01/26 05:54:20 dawes Exp $ */
-/*
- * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-
-#ifdef XFree86LOADER
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(xf4bppSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "xf4bpp",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData xf4bppModuleData = { &VersRec, xf4bppSetup, NULL };
-
-static pointer
-xf4bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- /* This module requires xf1bpp for bitmap support */
- return LoadSubModule(module, "xf1bpp", NULL, NULL, NULL, NULL,
- errmaj, errmin);
-}
-
-#endif
diff --git a/hw/xfree86/xf4bpp/wm3.c b/hw/xfree86/xf4bpp/wm3.c
deleted file mode 100644
index 3509ce77f..000000000
--- a/hw/xfree86/xf4bpp/wm3.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/wm3.c,v 1.4 2002/01/25 21:56:23 tsi Exp $ */
-
-
-
-
-
-/* $XConsortium: wm3.c /main/5 1996/02/21 17:59:21 kaleb $ */
-
-#include "xf4bpp.h"
-#include "OScompiler.h"
-#include "wm3.h"
-#include "vgaVideo.h"
-#include "xf86.h"
-
-/* Ferraro is wrong. GJA */
-#define COPY (0 << 3)
-#define AND (1 << 3)
-#define OR (2 << 3)
-#define XOR (3 << 3)
-
-int
-wm3_set_regs(pGC)
-GC *pGC;
-{
-#ifndef PC98_EGC
- IOADDRESS REGBASE = xf86Screens[pGC->pScreen->myNum]->domainIOBase + 0x300;
- int post_invert = 0;
- int ALU;
-
- switch(pGC->alu) {
- case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
- pGC->fgPixel = 0;
- pGC->bgPixel = 0;
- ALU = COPY;
- break;
- case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
- ALU = AND;
- break;
- case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = OR;
- post_invert = 1;
- break;
- case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
- ALU = COPY;
- break;
- case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = AND;
- break;
- default:
- case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
- return 0;
- case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
- ALU = XOR;
- break;
- case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
- ALU = OR;
- break;
- case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
- ALU = OR;
- post_invert = 1;
- break;
- case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = XOR;
- break;
- case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
- pGC->fgPixel = 0x0F;
- pGC->bgPixel = 0x0F;
- ALU = XOR;
- break;
- case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = AND;
- post_invert = 1;
- break;
- case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = COPY;
- break;
- case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = OR;
- break;
- case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
- ALU = AND;
- post_invert = 1;
- break;
- case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
- pGC->fgPixel = 0x0F;
- pGC->bgPixel = 0x0F;
- ALU = COPY;
- break;
- }
-
-
- SetVideoSequencer(Mask_MapIndex, (pGC->planemask & VGA_ALLPLANES));
- SetVideoGraphics(Enb_Set_ResetIndex, VGA_ALLPLANES);
- SetVideoGraphics(Set_ResetIndex, pGC->fgPixel);
- SetVideoGraphics(Bit_MaskIndex, 0xFF);
- SetVideoGraphics(Graphics_ModeIndex, 3); /* Write Mode 3 */
- SetVideoGraphics(Data_RotateIndex, ALU);
-
- return post_invert;
-#else
- int ALU;
-
- switch(pGC->alu) {
- case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
- pGC->fgPixel = 0;
- pGC->bgPixel = 0;
- ALU = EGC_COPY_MODE;
- break;
- case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
- ALU = EGC_AND_MODE;
- break;
- case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_OR_INV_MODE;
- break;
- case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
- ALU = EGC_COPY_MODE;
- break;
- case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_AND_MODE;
- break;
- case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
- return 0;
- case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
- ALU = EGC_XOR_MODE;
- break;
- case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
- ALU = EGC_OR_MODE;
- break;
- case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
- ALU = EGC_OR_INV_MODE;
- break;
- case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_XOR_MODE;
- break;
- case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
- pGC->fgPixel = 0x0F;
- pGC->bgPixel = 0x0F;
- ALU = EGC_XOR_MODE;
- break;
- case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_AND_INV_MODE;
- break;
- case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_COPY_MODE;
- break;
- case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
- pGC->fgPixel = ~pGC->fgPixel;
- pGC->bgPixel = ~pGC->bgPixel;
- ALU = EGC_OR_MODE;
- break;
- case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
- ALU = EGC_OR_INV_MODE;
- break;
- case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
- pGC->fgPixel = 0x0F;
- pGC->bgPixel = 0x0F;
- ALU = EGC_COPY_MODE;
- break;
- }
-
- outw(EGC_PLANE, ~(pGC->planemask & VGA_ALLPLANES));
- outw(EGC_MODE, ALU);
- outw(EGC_FGC, pGC->fgPixel & VGA_ALLPLANES); /* set FGC */
-
- return 0;
-#endif
-}
-
-/*
- Now we will have to set the alu.
- Problematic is: How do we handle IsDoubleDash, which draws with both fg
- and bg colour?
- The answer is: We take care to store the ink colour in one register only.
- Then we need set only this register to change the ink.
- */
-
-/* -- MORE NOTES:
- We might try to 'wrap' the mfb functions in a 16-colour wrapper that does
- all operations once. However, this does not work:
- Some operations (esp) CopyArea may for example cause expositions.
- Such expositions will cause data to be copied in from backing store,
- and this copying in may damage the contents of the VGA registers.
- So we must take care to set the VGA registers at each place where they could
- be modified.
- */
diff --git a/hw/xfree86/xf4bpp/wm3.h b/hw/xfree86/xf4bpp/wm3.h
deleted file mode 100644
index 5fd303d7d..000000000
--- a/hw/xfree86/xf4bpp/wm3.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/wm3.h,v 1.3 2000/09/26 15:57:21 tsi Exp $ */
-
-
-
-
-
-/* $XConsortium: wm3.h /main/4 1996/02/21 17:59:24 kaleb $ */
-
-#include "vgaReg.h"
-
-#ifdef PC98_EGC
-#define VGA_ALLPLANES 0xFL
-#endif
-
-/* Do call in Write Mode 3.
- * We take care of the possibility that two passes are needed.
- */
-#ifndef PC98_EGC
-#define DO_WM3(pgc,call) \
- { int _tp, _fg, _bg, _alu; \
- _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
- _tp = wm3_set_regs(pgc); \
- (call); \
- if ( _tp ) { \
- _alu = pgc->alu; \
- pgc->alu = GXinvert; \
- _tp = wm3_set_regs(pgc); \
- (call); \
- pgc->alu = _alu; \
- } \
- pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
- }
-#else
-#define DO_WM3(pgc,call) \
- { int _tp, _fg, _bg; \
- _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
- _tp = wm3_set_regs(pgc); \
- (call); \
- pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
- }
-#endif
-
-#ifndef PC98_EGC
-#define WM3_SET_INK(ink) \
- SetVideoGraphics(Set_ResetIndex, ink)
-#else
-#define WM3_SET_INK(ink) \
- outw(EGC_FGC, ink)
-#endif
-
-/* GJA -- Move a long word to screen memory.
- * The reads into 'dummy' are here to load the VGA latches.
- * This is a RMW operation except for trivial cases.
- * Notice that we ignore the operation.
- */
-#ifdef PC98_EGC
-#define UPDRW(destp,src) \
- { volatile unsigned short *_dtmp = \
- (volatile unsigned short *)(destp); \
- unsigned int _stmp = (src); \
- *_dtmp = _stmp; _dtmp++; _stmp >>= 16; \
- *_dtmp = _stmp; }
-#else
-#define UPDRW(destp,src) \
- { volatile char *_dtmp = (volatile char *)(destp); \
- unsigned int _stmp = (src); \
- volatile int dummy; /* Bit bucket. */ \
- _stmp = ldl_u(&_stmp); \
- dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
- dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
- dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
- dummy = *_dtmp; *_dtmp = _stmp; }
-#endif
-
-#define UPDRWB(destp,src) \
- { volatile int dummy; /* Bit bucket. */ \
- dummy = *(destp); *(destp) = (src); }
diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h
deleted file mode 100644
index 59458a258..000000000
--- a/hw/xfree86/xf4bpp/xf4bpp.h
+++ /dev/null
@@ -1,654 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.10 2003/11/17 22:20:42 dawes Exp $ */
-
-
-#ifndef __XF4BPP_H__
-#define __XF4BPP_H__
-
-
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "colormapst.h"
-#include "fontstruct.h"
-#ifndef PixelType
-#define PixelType CARD32
-#endif
-
-/* ppcArea.c */
-void xf4bppFillArea(
- WindowPtr,
- int,
- BoxPtr,
- GCPtr
-);
-
-/* ppcBStore.c */
-void xf4bppSaveAreas(
- PixmapPtr,
- RegionPtr,
- int,
- int,
- WindowPtr
-);
-void xf4bppRestoreAreas(
- PixmapPtr,
- RegionPtr,
- int,
- int,
- WindowPtr
-);
-
-/* ppcClip.c */
-void xf4bppDestroyClip(
- GCPtr
-);
-void xf4bppChangeClip(
- GCPtr,
- int,
- pointer,
- int
-);
-void xf4bppCopyClip(
- GCPtr,
- GCPtr
-);
-
-/* ppcCpArea.c */
-RegionPtr xf4bppCopyArea(
- DrawablePtr,
- DrawablePtr,
- GCPtr,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* ppcDepth.c */
-Bool xf4bppDepthOK(
- DrawablePtr,
- int
-);
-
-/* ppcFillRct.c */
-void xf4bppPolyFillRect(
- DrawablePtr,
- GCPtr,
- int,
- xRectangle *
-);
-
-/* ppcWindowFS.c */
-void xf4bppSolidWindowFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppStippleWindowFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppOpStippleWindowFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppTileWindowFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-
-/* xf4bppPixmapFS.c */
-void xf4bppSolidPixmapFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppStipplePixmapFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppOpStipplePixmapFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-void xf4bppTilePixmapFS(
- DrawablePtr,
- GCPtr,
- int,
- DDXPointPtr,
- int *,
- int
-);
-
-/* ppcGC.c */
-Bool xf4bppCreateGC(
- GCPtr
-);
-void xf4bppDestroyGC(
- GC *
-);
-void xf4bppValidateGC(
- GCPtr,
- unsigned long,
- DrawablePtr
-);
-
-/* ppcGetSp.c */
-void xf4bppGetSpans(
- DrawablePtr,
- int,
- DDXPointPtr,
- int *,
- int,
- char *
-);
-
-/* ppcImg.c */
-void xf4bppGetImage(
- DrawablePtr,
- int,
- int,
- int,
- int,
- unsigned int,
- unsigned long,
- char *
-);
-
-/* ppcLine.c */
-void xf4bppScrnZeroLine(
- DrawablePtr,
- GCPtr,
- int,
- int,
- DDXPointPtr
-);
-void xf4bppScrnZeroDash(
- DrawablePtr,
- GCPtr,
- int,
- int,
- DDXPointPtr
-);
-void xf4bppScrnZeroSegs(
- DrawablePtr,
- GCPtr,
- int,
- xSegment *
-);
-
-/* ppcPixmap.c */
-PixmapPtr xf4bppCreatePixmap(
- ScreenPtr,
- int,
- int,
- int
-);
-PixmapPtr xf4bppCopyPixmap(
- PixmapPtr
-);
-
-/* ppcPntWin.c */
-void xf4bppPaintWindow(
- WindowPtr,
- RegionPtr,
- int
-);
-
-/* ppcPolyPnt.c */
-void xf4bppPolyPoint(
- DrawablePtr,
- GCPtr,
- int,
- int,
- xPoint *
-);
-
-/* ppcPolyRec.c */
-void xf4bppPolyRectangle(
- DrawablePtr,
- GCPtr,
- int,
- xRectangle *
-);
-
-/* ppcQuery.c */
-void xf4bppQueryBestSize(
- int,
- unsigned short *,
- unsigned short *,
- ScreenPtr
-);
-
-/* ppcRslvC.c */
-void xf4bppResolveColor(
- unsigned short *,
- unsigned short *,
- unsigned short *,
- VisualPtr
-);
-Bool xf4bppInitializeColormap(
- ColormapPtr
-);
-
-/* ppcSetSp.c */
-void xf4bppSetSpans(
- DrawablePtr,
- GCPtr,
- char *,
- DDXPointPtr,
- int *,
- int,
- int
-);
-
-/* ppcWindow.c */
-void xf4bppCopyWindow(
- WindowPtr,
- DDXPointRec,
- RegionPtr
-);
-Bool xf4bppPositionWindow(
- WindowPtr,
- int,
- int
-);
-Bool xf4bppUnrealizeWindow(
- WindowPtr,
- int,
- int
-);
-Bool xf4bppDestroyWindow(
- WindowPtr
-);
-Bool xf4bppCreateWindowForXYhardware(
- WindowPtr
-);
-
-/* emulOpStip.c */
-void xf4bppOpaqueStipple(
- WindowPtr,
- PixmapPtr,
- unsigned long int,
- unsigned long int,
- int,
- unsigned long int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* emulRepAre.c */
-void xf4bppReplicateArea(
- WindowPtr,
- int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* emulTile.c */
-void xf4bppTileRect(
- WindowPtr,
- PixmapPtr,
- const int,
- const unsigned long int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* vgaGC.c */
-Mask xf4bppChangeWindowGC(
- GCPtr,
- Mask
-);
-
-/* vgaBitBlt.c */
-void xf4bppBitBlt(
- WindowPtr,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* vgaImages.c */
-void xf4bppDrawColorImage(
- WindowPtr,
- int,
- int,
- int,
- int,
- unsigned char *,
- int,
- const int,
- const unsigned long int
-);
-void xf4bppReadColorImage(
- WindowPtr,
- int,
- int,
- int,
- int,
- unsigned char *,
- int
-);
-
-/* vgaLine.c */
-void xf4bppHorzLine(
- WindowPtr,
- unsigned long int,
- int,
- unsigned long int,
- int,
- int,
- int
-);
-void xf4bppVertLine(
- WindowPtr,
- unsigned long int,
- int,
- unsigned long int,
- int,
- int,
- int
-);
-void xf4bppBresLine(
- WindowPtr,
- unsigned long int,
- int,
- unsigned long int,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- unsigned long int
-);
-
-/* vgaStipple.c */
-void xf4bppFillStipple(
- WindowPtr,
- const PixmapPtr,
- unsigned long int,
- const int,
- unsigned long int,
- int,
- int,
- int,
- int,
- const int,
- const int
-);
-
-/* vgaSolid.c */
-void xf4bppFillSolid(
- WindowPtr,
- unsigned long int,
- const int,
- unsigned long int,
- int,
- const int,
- int,
- const int
-);
-
-/* offscreen.c */
-void xf4bppOffBitBlt(
- WindowPtr,
- const int,
- const int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-void xf4bppOffDrawColorImage(
- WindowPtr,
- int,
- int,
- int,
- int,
- unsigned char *,
- int,
- const int,
- const unsigned long int
-);
-void xf4bppOffReadColorImage(
- WindowPtr,
- int,
- int,
- int,
- int,
- unsigned char *,
- int
-);
-void xf4bppOffFillSolid(
- WindowPtr,
- unsigned long int,
- const int,
- unsigned long int,
- int,
- const int,
- int,
- const int
-);
-void xf4bppOffDrawMonoImage(
- WindowPtr,
- unsigned char *,
- int,
- int,
- int,
- int,
- unsigned long int,
- int,
- unsigned long int
-);
-void xf4bppOffFillStipple(
- WindowPtr,
- const PixmapPtr,
- unsigned long int,
- const int,
- unsigned long int,
- int,
- int,
- int,
- int,
- const int,
- const int
-);
-
-/* mfbimggblt.c */
-void xf4bppImageGlyphBlt(
- DrawablePtr,
- GCPtr,
- int,
- int,
- unsigned int,
- CharInfoPtr *,
- pointer
-);
-
-/* wm3.c */
-int wm3_set_regs(
- GC *
-);
-
-/* ppcIO.c */
-void xf4bppNeverCalled(
- void
-);
-Bool xf4bppScreenInit(
- ScreenPtr,
- pointer,
- int,
- int,
- int,
- int,
- int
-);
-
-/* mfbfillarc.c */
-void xf4bppPolyFillArc(
- DrawablePtr,
- GCPtr,
- int,
- xArc *
-);
-
-/* mfbzerarc.c */
-void xf4bppZeroPolyArc(
- DrawablePtr,
- GCPtr,
- int,
- xArc *
-);
-
-/* mfbline.c */
-void xf4bppSegmentSS (
- DrawablePtr,
- GCPtr,
- int,
- xSegment *
-);
-void xf4bppLineSS (
- DrawablePtr,
- GCPtr,
- int,
- int,
- DDXPointPtr
-);
-void xf4bppSegmentSD (
- DrawablePtr,
- GCPtr,
- int,
- xSegment *
-);
-void xf4bppLineSD (
- DrawablePtr,
- GCPtr,
- int,
- int,
- DDXPointPtr
-);
-
-/* mfbbres.c */
-void xf4bppBresS(
- PixelType *,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- int,
- int
-);
-
-/* mfbbresd.c */
-void xf4bppBresD(
- DrawablePtr,
- int, int,
- int *,
- unsigned char *,
- int,
- int *,
- int,
- PixelType *,
- int, int, int, int, int, int,
- int, int,
- int, int
-);
-
-/* mfbhrzvert.c */
-void xf4bppHorzS(
- PixelType *,
- int,
- int,
- int,
- int
-);
-void xf4bppVertS(
- PixelType *,
- int,
- int,
- int,
- int
-);
-
-#ifdef PC98_EGC
-
-/* egc_asm.s */
-unsigned char getbits_x(
- int,
- unsigned int,
- pointer,
- unsigned int
-);
-void wcopyr(
- pointer,
- pointer,
- int,
- pointer
-);
-void wcopyl(
- pointer,
- pointer,
- int,
- pointer
-);
-unsigned long int read8Z(
- pointer
-);
-
-#endif /* PC98_EGC */
-
-#endif /* __XF4BPP_H__ */
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16.h b/hw/xfree86/xf8_16bpp/cfb8_16.h
deleted file mode 100644
index b7fa9fd00..000000000
--- a/hw/xfree86/xf8_16bpp/cfb8_16.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfb8_16.h,v 1.2 1999/03/28 15:33:09 dawes Exp $ */
-
-#ifndef _CFB8_16_H
-#define _CFB8_16_H
-
-#include "regionstr.h"
-#include "windowstr.h"
-
-typedef struct {
- pointer pix8;
- int width8;
- pointer pix16;
- int width16;
- unsigned char key;
-} cfb8_16ScreenRec, *cfb8_16ScreenPtr;
-
-extern int cfb8_16ScreenPrivateIndex;
-
-Bool
-cfb8_16ScreenInit (
- ScreenPtr pScreen,
- pointer pbits16,
- pointer pbits8,
- int xsize, int ysize,
- int dpix, int dpiy,
- int width16,
- int width8
-);
-
-void
-cfb8_16PaintWindow (
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-);
-
-Bool cfb8_16CreateWindow(WindowPtr pWin);
-Bool cfb8_16DestroyWindow(WindowPtr pWin);
-
-Bool
-cfb8_16PositionWindow(
- WindowPtr pWin,
- int x, int y
-);
-
-void
-cfb8_16CopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-);
-
-Bool
-cfb8_16ChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask
-);
-
-void
-cfb8_16WindowExposures(
- WindowPtr pWin,
- RegionPtr pReg,
- RegionPtr pOtherReg
-);
-
-#define CFB8_16_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16ScreenPrivateIndex].ptr)
-
-#endif /* _CFB8_16_H */
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16module.c b/hw/xfree86/xf8_16bpp/cfb8_16module.c
deleted file mode 100644
index d0d1974e7..000000000
--- a/hw/xfree86/xf8_16bpp/cfb8_16module.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfb8_16module.c,v 1.1 1999/01/31 12:22:16 dawes Exp $ */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(xf8_16bppSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "xf8_16bpp",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- NULL,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData xf8_16bppModuleData = { &VersRec, xf8_16bppSetup, NULL };
-
-static pointer
-xf8_16bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb16", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- return (pointer)1; /* non-NULL required to indicate success */
-}
-
-#endif
diff --git a/hw/xfree86/xf8_16bpp/cfbscrinit.c b/hw/xfree86/xf8_16bpp/cfbscrinit.c
deleted file mode 100644
index 5e19fb7a2..000000000
--- a/hw/xfree86/xf8_16bpp/cfbscrinit.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
-
- Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbscrinit.c,v 1.8 2003/02/17 16:08:30 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb8_16.h"
-#include "mi.h"
-#include "micmap.h"
-#include "mistruct.h"
-#include "gcstruct.h"
-#include "dix.h"
-#include "mibstore.h"
-#include "xf86str.h"
-#include "xf86.h"
-
-/* CAUTION: We require that cfb8 and cfb16 were NOT
- compiled with CFB_NEED_SCREEN_PRIVATE */
-
-int cfb8_16ScreenPrivateIndex;
-
-static unsigned long cfb8_16Generation = 0;
-
-static PixmapPtr cfb8_16GetWindowPixmap(WindowPtr pWin);
-static void
-cfb8_16SaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-static void
-cfb8_16RestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-static BSFuncRec cfb8_16BSFuncRec = {
- cfb8_16SaveAreas,
- cfb8_16RestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-static void
-cfb8_16GetSpans(
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart
-);
-
-static void
-cfb8_16GetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planeMask,
- char *pdstLine
-);
-
-static Bool cfb8_16CreateGC(GCPtr pGC);
-static void cfb8_16EnableDisableFBAccess(int index, Bool enable);
-
-
-static Bool
-cfb8_16AllocatePrivates(ScreenPtr pScreen)
-{
- cfb8_16ScreenPtr pScreenPriv;
-
- if(cfb8_16Generation != serverGeneration) {
- if((cfb8_16ScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- cfb8_16Generation = serverGeneration;
- }
-
- if (!(pScreenPriv = xalloc(sizeof(cfb8_16ScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[cfb8_16ScreenPrivateIndex].ptr = (pointer)pScreenPriv;
-
-
- /* All cfb will have the same GC and Window private indicies */
- if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
- return FALSE;
-
- /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
- if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
- return FALSE;
-
- if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
- return FALSE;
-
- return TRUE;
-}
-
-static Bool
-cfb8_16SetupScreen(
- ScreenPtr pScreen,
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy
-){
- if (!cfb8_16AllocatePrivates(pScreen))
- return FALSE;
- pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = mfbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = cfb8_16GetImage;
- pScreen->GetSpans = cfb8_16GetSpans;
- pScreen->CreateWindow = cfb8_16CreateWindow;
- pScreen->DestroyWindow = cfb8_16DestroyWindow;
- pScreen->PositionWindow = cfb8_16PositionWindow;
- pScreen->ChangeWindowAttributes = cfb8_16ChangeWindowAttributes;
- pScreen->RealizeWindow = cfb16MapWindow; /* OK */
- pScreen->UnrealizeWindow = cfb16UnmapWindow; /* OK */
- pScreen->PaintWindowBackground = cfb8_16PaintWindow;
- pScreen->PaintWindowBorder = cfb8_16PaintWindow;
- pScreen->CopyWindow = cfb8_16CopyWindow;
- pScreen->CreatePixmap = cfb16CreatePixmap; /* OK */
- pScreen->DestroyPixmap = cfb16DestroyPixmap; /* OK */
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = cfb8_16CreateGC;
- pScreen->CreateColormap = miInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
- pScreen->InstallColormap = miInstallColormap;
- pScreen->UninstallColormap = miUninstallColormap;
- pScreen->ListInstalledColormaps = miListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
- pScreen->ResolveColor = miResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
- return TRUE;
-}
-
-static Bool
-cfb8_16CreateScreenResources(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
- PixmapPtr pix8, pix16;
-
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
-
- pix8 = (*pScreen->CreatePixmap)(pScreen, 0, 0, 8);
- pix16 = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth);
- if(!pix16 || !pix8)
- return FALSE;
-
- pix8->drawable.width = pScreen->width;
- pix8->drawable.height = pScreen->height;
- pix8->devKind = pScreenPriv->width8;
- pix8->devPrivate.ptr = pScreenPriv->pix8;
-
- pix16->drawable.width = pScreen->width;
- pix16->drawable.height = pScreen->height;
- pix16->devKind = pScreenPriv->width16 * 2;
- pix16->devPrivate.ptr = pScreenPriv->pix16;
-
- pScreenPriv->pix8 = (pointer)pix8;
- pScreenPriv->pix16 = (pointer)pix16;
-
- pScreen->devPrivate = (pointer)pix16;
-
- return TRUE;
-}
-
-
-static Bool
-cfb8_16CloseScreen (int i, ScreenPtr pScreen)
-{
- cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
-
- xfree((pointer) pScreenPriv);
-
- return(cfb16CloseScreen(i, pScreen));
-}
-
-static Bool
-cfb8_16FinishScreenInit(
- ScreenPtr pScreen,
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy /* dots per inch */
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(16-1)), 8, -1))
- return FALSE;
- if (! miScreenInit(pScreen, NULL, xsize, ysize, dpix, dpiy, 0,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals))
- return FALSE;
-
- pScreen->BackingStoreFuncs = cfb8_16BSFuncRec;
- pScreen->CreateScreenResources = cfb8_16CreateScreenResources;
- pScreen->CloseScreen = cfb8_16CloseScreen;
- pScreen->GetWindowPixmap = cfb8_16GetWindowPixmap;
- pScreen->WindowExposures = cfb8_16WindowExposures;
-
- pScrn->EnableDisableFBAccess = cfb8_16EnableDisableFBAccess;
-
- return TRUE;
-}
-
-Bool
-cfb8_16ScreenInit(
- ScreenPtr pScreen,
- pointer pbits16, /* pointer to screen bitmap */
- pointer pbits8,
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy, /* dots per inch */
- int width16, /* pixel width of frame buffer */
- int width8
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- cfb8_16ScreenPtr pScreenPriv;
-
- if (!cfb8_16SetupScreen(pScreen, xsize, ysize, dpix, dpiy))
- return FALSE;
-
- pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
- pScreenPriv->pix8 = pbits8;
- pScreenPriv->pix16 = pbits16;
- pScreenPriv->width8 = width8;
- pScreenPriv->width16 = width16;
- pScreenPriv->key = pScrn->colorKey;
-
- return cfb8_16FinishScreenInit(pScreen, xsize, ysize, dpix, dpiy);
-}
-
-
-static PixmapPtr
-cfb8_16GetWindowPixmap(WindowPtr pWin)
-{
- cfb8_16ScreenPtr pScreenPriv =
- CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
-
- return((pWin->drawable.bitsPerPixel == 16) ?
- (PixmapPtr)pScreenPriv->pix16 : (PixmapPtr)pScreenPriv->pix8);
-}
-
-static void
-cfb8_16GetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planemask,
- char *pdstLine
-){
- if(!w || !h) return;
-
- if(pDraw->bitsPerPixel == 16)
- cfb16GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
- else
- cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
-}
-
-static void
-cfb8_16GetSpans(
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pDst
-){
- if(pDraw->bitsPerPixel == 16)
- cfb16GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
- else
- cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
-}
-
-static void
-cfb8_16SaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- if(pWin->drawable.bitsPerPixel == 16)
- cfb16SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
- else
- cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
-}
-
-static void
-cfb8_16RestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- if(pWin->drawable.bitsPerPixel == 16)
- cfb16RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
- else
- cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
-}
-
-
-static Bool
-cfb8_16CreateGC(GCPtr pGC)
-{
- if(pGC->depth == 8)
- return(cfbCreateGC(pGC));
- else
- return(cfb16CreateGC(pGC));
-}
-
-static void
-cfb8_16EnableDisableFBAccess(int index, Bool enable)
-{
- ScreenPtr pScreen = xf86Screens[index]->pScreen;
- cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
- static DevUnion devPrivates8[MAXSCREENS];
- static DevUnion devPrivates16[MAXSCREENS];
- PixmapPtr pix8, pix16;
-
- pix8 = (PixmapPtr) pScreenPriv->pix8;
- pix16 = (PixmapPtr) pScreenPriv->pix16;
-
- if (enable)
- {
- pix8->devPrivate = devPrivates8[index];
- pix16->devPrivate = devPrivates16[index];
- }
- xf86EnableDisableFBAccess (index, enable);
- if (!enable)
- {
- devPrivates8[index] = pix8->devPrivate;
- pix8->devPrivate.ptr = 0;
- devPrivates16[index] = pix16->devPrivate;
- pix16->devPrivate.ptr = 0;
- }
-}
diff --git a/hw/xfree86/xf8_16bpp/cfbwindow.c b/hw/xfree86/xf8_16bpp/cfbwindow.c
deleted file mode 100644
index 757b0dc49..000000000
--- a/hw/xfree86/xf8_16bpp/cfbwindow.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
-
- Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.5 2003/11/10 18:22:42 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb8_16.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "xf86.h"
-
-/* We don't bother with cfb's fastBackground/Border so we don't
- need to use the Window privates */
-
-
-Bool
-cfb8_16CreateWindow(WindowPtr pWin)
-{
- cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
-
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
- pPrivWin->oldRotate.x = 0;
- pPrivWin->oldRotate.y = 0;
-
- return TRUE;
-}
-
-
-Bool
-cfb8_16DestroyWindow(WindowPtr pWin)
-{
- return TRUE;
-}
-
-Bool
-cfb8_16PositionWindow(
- WindowPtr pWin,
- int x, int y
-){
- return TRUE;
-}
-
-
-void
-cfb8_16CopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_16ScreenPtr pScreenPriv =
- CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- DDXPointPtr ppt, pptSrc;
- RegionRec rgnDst;
- BoxPtr pbox;
- int i, nbox, dx, dy;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(nbox &&
- (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
-
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
- cfbDoBitbltCopy((DrawablePtr)pRoot, (DrawablePtr)pRoot,
- GXcopy, &rgnDst, pptSrc, ~0L);
- if(pWin->drawable.bitsPerPixel == 16)
- cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
- (DrawablePtr)pScreenPriv->pix16,
- GXcopy, &rgnDst, pptSrc, ~0L);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- REGION_UNINIT(pScreen, &rgnDst);
-
- if(pWin->drawable.depth == 8) {
- REGION_NULL(pScreen, &rgnDst);
- miSegregateChildren(pWin, &rgnDst, pScrn->depth);
- if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
- REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(nbox &&
- (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
-
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
- (DrawablePtr)pScreenPriv->pix16,
- GXcopy, &rgnDst, pptSrc, ~0L);
- DEALLOCATE_LOCAL(pptSrc);
- }
- }
- REGION_UNINIT(pScreen, &rgnDst);
- }
-}
-
-Bool
-cfb8_16ChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask
-){
- if (pWin->drawable.bitsPerPixel == 16)
- return cfb16ChangeWindowAttributes(pWin,mask);
- else
- return cfbChangeWindowAttributes(pWin,mask);
-}
-
-void
-cfb8_16WindowExposures(
- WindowPtr pWin,
- RegionPtr pReg,
- RegionPtr pOtherReg
-){
-
- if(REGION_NUM_RECTS(pReg) && (pWin->drawable.bitsPerPixel == 16)) {
- cfb8_16ScreenPtr pScreenPriv =
- CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
-
- cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
- REGION_NUM_RECTS(pReg), REGION_RECTS(pReg),
- pScreenPriv->key);
- }
-
- miWindowExposures(pWin, pReg, pOtherReg);
-}
-
-
-void
-cfb8_16PaintWindow (
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-){
- if(pWin->drawable.bitsPerPixel == 16) {
- cfb16PaintWindow(pWin, pRegion, what);
- if(what == PW_BORDER) {
- cfb8_16ScreenPtr pScreenPriv =
- CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
-
- cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
- REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
- pScreenPriv->key);
- }
- } else
- cfbPaintWindow(pWin, pRegion, what);
-
-}
-
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h
deleted file mode 100644
index 30bc1a0fa..000000000
--- a/hw/xfree86/xf8_32bpp/cfb8_32.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
-
-#ifndef _CFB8_32_H
-#define _CFB8_32_H
-
-#include "gcstruct.h"
-
-typedef struct {
- GCOps *Ops8bpp;
- GCOps *Ops32bpp;
- unsigned long changes;
- Bool OpsAre8bpp;
-} cfb8_32GCRec, *cfb8_32GCPtr;
-
-typedef struct {
- unsigned char key;
- void (*EnableDisableFBAccess)(int scrnIndex, Bool enable);
- pointer visualData;
-} cfb8_32ScreenRec, *cfb8_32ScreenPtr;
-
-
-extern int cfb8_32GCPrivateIndex;
-extern int cfb8_32ScreenPrivateIndex;
-
-void
-cfb8_32SaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-void
-cfb8_32RestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-RegionPtr
-cfb8_32CopyArea(
- DrawablePtr pSrcDraw,
- DrawablePtr pDstDraw,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-);
-
-void
-cfbDoBitblt8To32(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask
-);
-
-void
-cfbDoBitblt32To8(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long planemask
-);
-
-
-void
-cfb8_32ValidateGC8(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-);
-
-void
-cfb8_32ValidateGC32(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-);
-
-void
-cfb32ValidateGC_Underlay(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-);
-
-Bool cfb8_32CreateGC(GCPtr pGC);
-
-void
-cfb8_32GetSpans(
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart
-);
-
-void
-cfb8_32PutImage (
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-);
-
-void
-cfb8_32GetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planeMask,
- char *pdstLine
-);
-
-void
-cfb8_32PaintWindow (
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-);
-
-Bool
-cfb8_32ScreenInit (
- ScreenPtr pScreen,
- pointer pbits,
- int xsize, int ysize,
- int dpix, int dpiy,
- int width
-);
-
-void
-cfb8_32FillBoxSolid8 (
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pBox,
- unsigned long color
-);
-
-
-void
-cfb8_32FillBoxSolid32 (
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pBox,
- unsigned long color
-);
-
-RegionPtr
-cfb8_32CopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-);
-
-void
-cfbDoBitblt8To8GXcopy(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-);
-
-void
-cfbDoBitblt24To24GXcopy(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-);
-
-Bool cfb8_32CreateWindow(WindowPtr pWin);
-Bool cfb8_32DestroyWindow(WindowPtr pWin);
-
-Bool
-cfb8_32PositionWindow(
- WindowPtr pWin,
- int x, int y
-);
-
-void
-cfb8_32CopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-);
-
-Bool
-cfb8_32ChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask
-);
-
-
-#define CFB8_32_GET_GC_PRIVATE(pGC)\
- (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GCPrivateIndex].ptr)
-
-#define CFB8_32_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32ScreenPrivateIndex].ptr)
-
-Bool xf86Overlay8Plus32Init (ScreenPtr pScreen);
-
-#endif /* _CFB8_32_H */
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32module.c b/hw/xfree86/xf8_32bpp/cfb8_32module.c
deleted file mode 100644
index 9ed6b2018..000000000
--- a/hw/xfree86/xf8_32bpp/cfb8_32module.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c,v 1.6 1999/01/26 05:54:20 dawes Exp $ */
-
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(xf8_32bppSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "xf8_32bpp",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData xf8_32bppModuleData = { &VersRec, xf8_32bppSetup, NULL };
-
-static pointer
-xf8_32bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- return (pointer)1; /* non-NULL required to indicate success */
-}
-
-#endif
diff --git a/hw/xfree86/xf8_32bpp/cfbbstore.c b/hw/xfree86/xf8_32bpp/cfbbstore.c
deleted file mode 100644
index 581efb4f6..000000000
--- a/hw/xfree86/xf8_32bpp/cfbbstore.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */
-
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-void
-cfb8_32SaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- BoxPtr pBox;
- int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- if(pPixmap->drawable.bitsPerPixel == 32) {
- cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
- return;
- }
-
- i = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- pScrPix = (PixmapPtr) pScreen->devPrivate;
-
- cfbDoBitblt32To8((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
- GXcopy, prgnSave, pPtsInit, ~0L);
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
-
-
-void
-cfb8_32RestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-){
- DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- BoxPtr pBox;
- int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- i = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- pScrPix = (PixmapPtr) pScreen->devPrivate;
-
- if(pPixmap->drawable.bitsPerPixel == 32) {
- if(pWin->drawable.depth == 24)
- cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, 0x00ffffff);
- else
- cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, ~0);
- } else {
- cfbDoBitblt8To32((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, ~0L);
- }
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/hw/xfree86/xf8_32bpp/cfbcpyarea.c
deleted file mode 100644
index 53af8f7d8..000000000
--- a/hw/xfree86/xf8_32bpp/cfbcpyarea.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "mi.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mibstore.h"
-
-
-RegionPtr
-cfb8_32CopyArea(
- DrawablePtr pSrcDraw,
- DrawablePtr pDstDraw,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
-
- if(pSrcDraw->bitsPerPixel == 32) {
- if(pDstDraw->bitsPerPixel == 32) {
- if((pGC->alu == GXcopy) && (pGC->planemask == 0xff000000)) {
- return cfb32BitBlt (pSrcDraw, pDstDraw,
- pGC, srcx, srcy, width, height, dstx, dsty,
- cfbDoBitblt8To8GXcopy, 0L);
- }
- return(cfb32CopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
- width, height, dstx, dsty));
- } else {
- /* have to translate 32 -> 8 copies */
- return cfb32BitBlt (pSrcDraw, pDstDraw,
- pGC, srcx, srcy, width, height, dstx, dsty,
- cfbDoBitblt32To8, 0L);
- }
- } else {
- if(pDstDraw->bitsPerPixel == 32) {
- /* have to translate 8 -> 32 copies */
- return cfb32BitBlt (pSrcDraw, pDstDraw,
- pGC, srcx, srcy, width, height, dstx, dsty,
- cfbDoBitblt8To32, 0L);
- } else {
- return(cfbCopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
- width, height, dstx, dsty));
- }
- }
-}
-
-
-
-
-void
-cfbDoBitblt8To32(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-){
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int nbox = REGION_NUM_RECTS(prgnDst);
- unsigned char *ptr8, *ptr32;
- unsigned char *data8, *data32;
- int pitch8, pitch32;
- int height, width, i;
-
- cfbGetByteWidthAndPointer(pSrc, pitch8, ptr8);
- cfbGetByteWidthAndPointer(pDst, pitch32, ptr32);
- ptr32 += 3; /* point to the top byte */
-
- pm >>= 24;
-
- if((pm == 0xff) && (rop == GXcopy)) {
- for(;nbox; pbox++, pptSrc++, nbox--) {
- data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
- data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- for(i = 0; i < width; i++)
- data32[i << 2] = data8[i];
- data8 += pitch8;
- data32 += pitch32;
- }
- }
- } else { /* it ain't pretty, but hey */
- for(;nbox; pbox++, pptSrc++, nbox--) {
- data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
- data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- switch(rop) {
- case GXcopy:
- for(i = 0; i < width; i++)
- data32[i<<2] = (data8[i] & pm) | (data32[i<<2] & ~pm);
- break;
- case GXor:
- for(i = 0; i < width; i++)
- data32[i<<2] |= data8[i] & pm;
- break;
- case GXclear:
- for(i = 0; i < width; i++)
- data32[i<<2] &= ~pm;
- break;
- case GXand:
- for(i = 0; i < width; i++)
- data32[i<<2] &= data8[i] | ~pm;
- break;
- case GXandReverse:
- for(i = 0; i < width; i++)
- data32[i<<2] = ~data32[i<<2] & (data8[i] | ~pm);
- break;
- case GXandInverted:
- for(i = 0; i < width; i++)
- data32[i<<2] &= ~data8[i] | ~pm;
- break;
- case GXnoop:
- return;
- case GXxor:
- for(i = 0; i < width; i++)
- data32[i<<2] ^= data8[i] & pm;
- break;
- case GXnor:
- for(i = 0; i < width; i++)
- data32[i<<2] = ~(data32[i<<2] | (data8[i] & pm));
- break;
- case GXequiv:
- for(i = 0; i < width; i++)
- data32[i<<2] = ~(data32[i<<2] ^ (data8[i] & pm));
- break;
- case GXinvert:
- for(i = 0; i < width; i++)
- data32[i<<2] ^= pm;
- break;
- case GXorReverse:
- for(i = 0; i < width; i++)
- data32[i<<2] = ~data32[i<<2] | (data8[i] & pm);
- break;
- case GXcopyInverted:
- for(i = 0; i < width; i++)
- data32[i<<2] = (~data8[i] & pm) | (data32[i<<2] & ~pm);
- break;
- case GXorInverted:
- for(i = 0; i < width; i++)
- data32[i<<2] |= ~data8[i] & pm;
- break;
- case GXnand:
- for(i = 0; i < width; i++)
- data32[i<<2] = ~(data32[i<<2] & (data8[i] | ~pm));
- break;
- case GXset:
- for(i = 0; i < width; i++)
- data32[i<<2] |= pm;
- break;
- }
- data8 += pitch8;
- data32 += pitch32;
- }
- }
- }
-}
-
-
-void
-cfbDoBitblt32To8(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-){
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int nbox = REGION_NUM_RECTS(prgnDst);
- unsigned char *ptr8, *ptr32;
- unsigned char *data8, *data32;
- int pitch8, pitch32;
- int height, width, i;
-
- cfbGetByteWidthAndPointer(pDst, pitch8, ptr8);
- cfbGetByteWidthAndPointer(pSrc, pitch32, ptr32);
- ptr32 += 3; /* point to the top byte */
-
- if(((pm & 0xff) == 0xff) && (rop == GXcopy)) {
- for(;nbox; pbox++, pptSrc++, nbox--) {
- data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
- data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
-
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- for(i = 0; i < width; i++)
- data8[i] = data32[i << 2];
- data8 += pitch8;
- data32 += pitch32;
- }
- }
- } else {
- for(;nbox; pbox++, pptSrc++, nbox--) {
- data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
- data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
-
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- switch(rop) {
- case GXcopy:
- for(i = 0; i < width; i++)
- data8[i] = (data32[i<<2] & pm) | (data8[i] & ~pm);
- break;
- case GXor:
- for(i = 0; i < width; i++)
- data8[i] |= data32[i<<2] & pm;
- break;
- case GXclear:
- for(i = 0; i < width; i++)
- data8[i] &= ~pm;
- break;
- case GXand:
- for(i = 0; i < width; i++)
- data8[i] &= data32[i<<2] | ~pm;
- break;
- case GXandReverse:
- for(i = 0; i < width; i++)
- data8[i] = ~data8[i] & (data32[i<<2] | ~pm);
- break;
- case GXandInverted:
- for(i = 0; i < width; i++)
- data8[i] &= ~data32[i<<2] | ~pm;
- break;
- case GXnoop:
- return;
- case GXxor:
- for(i = 0; i < width; i++)
- data8[i] ^= data32[i<<2] & pm;
- break;
- case GXnor:
- for(i = 0; i < width; i++)
- data8[i] = ~(data8[i] | (data32[i<<2] & pm));
- break;
- case GXequiv:
- for(i = 0; i < width; i++)
- data8[i] = ~(data8[i] ^ (data32[i<<2] & pm));
- break;
- case GXinvert:
- for(i = 0; i < width; i++)
- data8[i] ^= pm;
- break;
- case GXorReverse:
- for(i = 0; i < width; i++)
- data8[i] = ~data8[i] | (data32[i<<2] & pm);
- break;
- case GXcopyInverted:
- for(i = 0; i < width; i++)
- data8[i] = (~data32[i<<2] & pm) | (data8[i] & ~pm);
- break;
- case GXorInverted:
- for(i = 0; i < width; i++)
- data8[i] |= ~data32[i<<2] & pm;
- break;
- case GXnand:
- for(i = 0; i < width; i++)
- data8[i] = ~(data8[i] & (data32[i<<2] | ~pm));
- break;
- case GXset:
- for(i = 0; i < width; i++)
- data8[i] |= pm;
- break;
- }
- data8 += pitch8;
- data32 += pitch32;
- }
- }
- }
-}
-
-
-
-static void
-Do8To8Blt(
- unsigned char *SrcPtr,
- int SrcPitch,
- unsigned char *DstPtr,
- int DstPitch,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir, int ydir
-){
- int i, j, width, height, ydir2;
- CARD8 *src, *dst;
-
- SrcPtr += 3;
- DstPtr += 3;
- xdir *= 4;
- ydir2 = ydir * DstPitch;
- ydir *= SrcPitch;
-
- for(;nbox; pbox++, pptSrc++, nbox--) {
- src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
- dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- if(ydir < 0) {
- src += (height - 1) * SrcPitch;
- dst += (height - 1) * DstPitch;
- }
-
- if(xdir < 0) {
- register int tmp = (width - 1) << 2;
- src += tmp;
- dst += tmp;
- }
-
- while(height--) {
- for(i = width, j = 0; i--; j+=xdir)
- dst[j] = src[j];
- src += ydir;
- dst += ydir2;
- }
- }
-}
-
-static void
-Do24To24Blt(
- unsigned char *SrcPtr,
- int SrcPitch,
- unsigned char *DstPtr,
- int DstPitch,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir, int ydir
-){
- int i, j, width, height, ydir2;
- CARD8 *src, *dst;
-
- xdir *= 4;
- ydir2 = ydir * DstPitch;
- ydir *= SrcPitch;
-
- for(;nbox; pbox++, pptSrc++, nbox--) {
- src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
- dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- if(ydir < 0) {
- src += (height - 1) * SrcPitch;
- dst += (height - 1) * DstPitch;
- }
-
- if(xdir < 0) {
- register int tmp = (width - 1) << 2;
- src += tmp;
- dst += tmp;
- }
-
- while(height--) {
- for(i = width, j = 0; i--; j+=xdir) {
- *((CARD16*)(dst + j)) = *((CARD32*)(src + j));
- dst[j + 2] = src[j + 2];
- }
- src += ydir;
- dst += ydir2;
- }
- }
-}
-
-
-static void
-cfb8_32DoBitBlt(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- void (*DoBlt)(
- unsigned char *SrcPtr,
- int SrcPitch,
- unsigned char *DstPtr,
- int DstPitch,
- int nbox,
- DDXPointPtr pptSrc,
- BoxPtr pbox,
- int xdir, int ydir)
-){
- int nbox, careful, SrcPitch, DstPitch;
- BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- int xdir, ydir;
- unsigned char *SrcPtr, *DstPtr;
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1)) {
- /* walk source botttom to top */
- ydir = -1;
-
- if (nbox > 1) {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1)) {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1) {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2) {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* walk source left to right */
- xdir = 1;
- }
-
- cfbGetByteWidthAndPointer(pSrc, SrcPitch, SrcPtr);
- cfbGetByteWidthAndPointer(pDst, DstPitch, DstPtr);
-
- (*DoBlt)(SrcPtr,SrcPitch,DstPtr,DstPitch,nbox,pptSrc,pbox,xdir,ydir);
-
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-
-}
-
-
-/* A couple routines to speed up full planemask copies */
-
-void
-cfbDoBitblt8To8GXcopy(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-){
- cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do8To8Blt);
-}
-
-
-void
-cfbDoBitblt24To24GXcopy(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- int rop,
- RegionPtr prgnDst,
- DDXPointPtr pptSrc,
- unsigned long pm
-){
- cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt);
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbcpyplane.c b/hw/xfree86/xf8_32bpp/cfbcpyplane.c
deleted file mode 100644
index 248ca0869..000000000
--- a/hw/xfree86/xf8_32bpp/cfbcpyplane.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c,v 1.1 1999/01/03 03:58:55 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "mi.h"
-
-
-RegionPtr
-cfb8_32CopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- /* There's actually much more to it than this */
-
- if((pDst->bitsPerPixel == 8) && (pSrc->bitsPerPixel != 32)){
- return(cfbCopyPlane(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
- }
-
-
- return(miCopyPlane (pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbgc.c b/hw/xfree86/xf8_32bpp/cfbgc.c
deleted file mode 100644
index 6c13ca721..000000000
--- a/hw/xfree86/xf8_32bpp/cfbgc.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgc.c,v 1.4 2001/12/14 19:59:52 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-
-/*
-
-PSZ 8 16 24 32
-PIXEL_ADDR True True True True
-NO_ONE_RECT False False False False
-WriteBitGroup True True True True
-FOUR_BIT_CODE True False False False
-LOWMEMFTPT False False False False
-
-*/
-
-
-/* This gets built twice. Once for 8bpp and another for 32bpp */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "mioverlay.h"
-
-#include "cfb8_32.h"
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-
-
-#if PSZ == 8
-# define useTEGlyphBlt cfbTEGlyphBlt8
-#else
-# ifdef WriteBitGroup
-# define useTEGlyphBlt cfbImageGlyphBlt8
-# else
-# define useTEGlyphBlt cfbTEGlyphBlt
-# endif
-#endif
-
-#ifdef WriteBitGroup
-# define useImageGlyphBlt cfbImageGlyphBlt8
-# define usePolyGlyphBlt cfbPolyGlyphBlt8
-#else
-# define useImageGlyphBlt miImageGlyphBlt
-# define usePolyGlyphBlt miPolyGlyphBlt
-#endif
-
-#ifdef FOUR_BIT_CODE
-# define usePushPixels cfbPushPixels8
-#else
-#ifndef LOWMEMFTPT
-# define usePushPixels mfbPushPixels
-#else
-# define usePushPixels miPushPixels
-#endif /* ifndef LOWMEMFTPT */
-#endif
-
-#ifdef PIXEL_ADDR
-# define ZeroPolyArc cfbZeroPolyArcSS8Copy
-#else
-# define ZeroPolyArc miZeroPolyArc
-#endif
-
-
-static GCOps cfb8_32TEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfb8_32PutImage,
- cfb8_32CopyArea,
- cfb8_32CopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfb8_32NonTEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfb8_32PutImage,
- cfb8_32CopyArea,
- cfb8_32CopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfb8_32TEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfb8_32PutImage,
- cfb8_32CopyArea,
- cfb8_32CopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
- ZeroPolyArc,
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfb8_32NonTEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfb8_32PutImage,
- cfb8_32CopyArea,
- cfb8_32CopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
-#ifdef PIXEL_ADDR
- cfbZeroPolyArcSS8Copy,
-#else
- miZeroPolyArc,
-#endif
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps *
-cfb8_32MatchCommon (GCPtr pGC, cfbPrivGCPtr devPriv)
-{
- if (pGC->lineWidth != 0)
- return 0;
- if (pGC->lineStyle != LineSolid)
- return 0;
- if (pGC->fillStyle != FillSolid)
- return 0;
- if (devPriv->rop != GXcopy)
- return 0;
- if (pGC->font &&
- FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
- FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
- {
- if (TERMINALFONT(pGC->font)
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
-#ifdef NO_ONE_RECT
- return &cfb8_32TEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfb8_32TEOps1Rect;
- else
- return &cfb8_32TEOps;
-#endif
- else
-#ifdef NO_ONE_RECT
- return &cfb8_32NonTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfb8_32NonTEOps1Rect;
- else
- return &cfb8_32NonTEOps;
-#endif
- }
- return 0;
-}
-
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-void
-#if PSZ == 8
-cfb8_32ValidateGC8(
-#else
-cfb8_32ValidateGC32(
-#endif
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-){
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int new_rrop;
- int new_line, new_text, new_fillspans, new_fillarea;
- /* flags for changing the proc vector */
- cfbPrivGCPtr devPriv;
- int oneRect;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
- devPriv = cfbGetGCPrivate(pGC);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fillspans = FALSE;
- new_fillarea = FALSE;
-
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
- {
- miComputeCompositeClip (pGC, pDrawable);
-#ifdef NO_ONE_RECT
- devPriv->oneRect = FALSE;
-#else
- oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
- if (oneRect != devPriv->oneRect)
- new_line = TRUE;
- devPriv->oneRect = oneRect;
-#endif
- }
-
- mask = changes;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
-
- switch (index) {
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCPlaneMask:
- new_rrop = TRUE;
- new_text = TRUE;
- break;
- case GCBackground:
- break;
- case GCLineStyle:
- case GCLineWidth:
- new_line = TRUE;
- break;
- case GCJoinStyle:
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_text = TRUE;
- new_fillspans = TRUE;
- new_line = TRUE;
- new_fillarea = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
- case GCStipple:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
- case GCTileStipXOrigin:
- case GCTileStipYOrigin:
- break;
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- case GCGraphicsExposures:
- case GCClipXOrigin:
- case GCClipYOrigin:
- case GCClipMask:
- case GCDashOffset:
- case GCDashList:
- case GCArcMode:
- default:
- break;
- }
- }
-
- /*
- * If the drawable has changed, ensure suitable
- * entries are in the proc vector.
- */
- if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
- new_fillspans = TRUE; /* deal with FillSpans later */
-
- if (new_rrop)
- {
- int old_rrop;
-
- old_rrop = devPriv->rop;
- devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
- pGC->planemask,
- &devPriv->and, &devPriv->xor);
- if (old_rrop == devPriv->rop)
- new_rrop = FALSE;
- else
- {
-#ifdef PIXEL_ADDR
- new_line = TRUE;
-#endif
-#ifdef WriteBitGroup
- new_text = TRUE;
-#endif
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- }
- }
-
- if(!pGC->ops)
- pGC->ops = & cfb8_32NonTEOps;
-
- if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
- {
- GCOps *newops;
-
- if ((newops = cfb8_32MatchCommon (pGC, devPriv)))
- {
- if (pGC->ops->devPrivate.val)
- miDestroyGCOps (pGC->ops);
- pGC->ops = newops;
- new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
- }
- else
- {
- if (!pGC->ops->devPrivate.val)
- {
- pGC->ops = miCreateGCOps (pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
- }
-
- /* deal with the changes we've collected */
- if (new_line)
- {
- pGC->ops->FillPolygon = miFillPolygon;
-#ifdef NO_ONE_RECT
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#else
- if (devPriv->oneRect && pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#endif
- if (pGC->lineWidth == 0)
- {
-#ifdef PIXEL_ADDR
- if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
- {
- switch (devPriv->rop)
- {
- case GXxor:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
- break;
- case GXcopy:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
- break;
- default:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
- break;
- }
- }
- else
-#endif
- pGC->ops->PolyArc = miZeroPolyArc;
- }
- else
- pGC->ops->PolyArc = miPolyArc;
- pGC->ops->PolySegment = miPolySegment;
- switch (pGC->lineStyle)
- {
- case LineSolid:
- if(pGC->lineWidth == 0)
- {
- if (pGC->fillStyle == FillSolid)
- {
-#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
- if (devPriv->oneRect &&
- ((pDrawable->x >= pGC->pScreen->width - 32768) &&
- (pDrawable->y >= pGC->pScreen->height - 32768)))
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- } else
-#endif
-#ifdef NO_ONE_RECT
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- }
-#else
- {
- pGC->ops->Polylines = cfbLineSS;
- pGC->ops->PolySegment = cfbSegmentSS;
- }
-#endif
- }
- else
- pGC->ops->Polylines = miZeroLine;
- }
- else
- pGC->ops->Polylines = miWideLine;
- break;
- case LineOnOffDash:
- case LineDoubleDash:
- if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
- {
- pGC->ops->Polylines = cfbLineSD;
- pGC->ops->PolySegment = cfbSegmentSD;
- } else
- pGC->ops->Polylines = miWideDash;
- break;
- }
- }
-
- if (new_text && (pGC->font))
- {
- if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- else
- {
-#ifdef WriteBitGroup
- if (pGC->fillStyle == FillSolid)
- {
- if (devPriv->rop == GXcopy)
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
- else
-#ifdef FOUR_BIT_CODE
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
-#else
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
-#endif
- }
- else
-#endif
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- /* special case ImageGlyphBlt for terminal emulator fonts */
-#if !defined(WriteBitGroup) || PSZ == 8
- if (TERMINALFONT(pGC->font) &&
- (pGC->planemask & PMSK) == PMSK
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
- {
- pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
- }
- else
-#endif
- {
-#ifdef WriteBitGroup
- if (devPriv->rop == GXcopy &&
- pGC->fillStyle == FillSolid &&
- (pGC->planemask & PMSK) == PMSK)
- pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
- else
-#endif
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- }
- }
-
-
- if (new_fillspans) {
- switch (pGC->fillStyle) {
- case FillSolid:
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillSpans = cfbSolidSpansCopy;
- break;
- case GXxor:
- pGC->ops->FillSpans = cfbSolidSpansXor;
- break;
- default:
- pGC->ops->FillSpans = cfbSolidSpansGeneral;
- break;
- }
- break;
- case FillTiled:
- pGC->ops->FillSpans = cfbUnnaturalTileFS;
- break;
- case FillStippled:
- case FillOpaqueStippled:
- pGC->ops->FillSpans = cfbUnnaturalStippleFS;
- break;
- default:
- FatalError("cfbValidateGC: illegal fillStyle\n");
- }
- } /* end of new_fillspans */
-
- if (new_fillarea) {
-#ifndef FOUR_BIT_CODE
- pGC->ops->PolyFillRect = miPolyFillRect;
- if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
- {
- pGC->ops->PolyFillRect = cfbPolyFillRect;
- }
-#endif
-#ifdef FOUR_BIT_CODE
-#ifndef LOWMEMFTPT
- pGC->ops->PushPixels = mfbPushPixels;
-#else
- pGC->ops->PushPixels = miPushPixels;
-#endif /* ifndef LOWMEMFTPT */
- if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
- pGC->ops->PushPixels = cfbPushPixels8;
-#endif
- pGC->ops->PolyFillArc = miPolyFillArc;
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop)
- {
- case GXcopy:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
- break;
- default:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
- break;
- }
- }
- }
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbgcmisc.c b/hw/xfree86/xf8_32bpp/cfbgcmisc.c
deleted file mode 100644
index d8a6f4608..000000000
--- a/hw/xfree86/xf8_32bpp/cfbgcmisc.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c,v 1.3 2000/02/29 00:17:16 mvojkovi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "mibstore.h"
-#include "migc.h"
-
-
-static void cfb8_32ValidateGC(GCPtr, unsigned long, DrawablePtr);
-static void cfb8_32DestroyGC(GCPtr pGC);
-static void cfb32DestroyGC_Underlay(GCPtr pGC);
-
-static
-GCFuncs cfb8_32GCFuncs = {
- cfb8_32ValidateGC,
- miChangeGC,
- miCopyGC,
- cfb8_32DestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-
-
-static
-GCFuncs cfb32GCFuncs_Underlay = {
- cfb32ValidateGC_Underlay,
- miChangeGC,
- miCopyGC,
- cfb32DestroyGC_Underlay,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-
-static void
-cfb32DestroyGC_Underlay(GCPtr pGC)
-{
- if (pGC->freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
-
- if(pGC->ops)
- miDestroyGCOps(pGC->ops);
-}
-
-
-static void
-cfb8_32DestroyGC(GCPtr pGC)
-{
- cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
-
- if (pGC->freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- if(pGCPriv->Ops8bpp)
- miDestroyGCOps(pGCPriv->Ops8bpp);
- if(pGCPriv->Ops32bpp)
- miDestroyGCOps(pGCPriv->Ops32bpp);
-}
-
-Bool
-cfb8_32CreateGC(GCPtr pGC)
-{
- cfb8_32GCPtr pGCPriv;
- cfbPrivGC *pPriv;
-
- if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD)
- return (mfbCreateGC(pGC));
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
- pGC->miTranslate = 1;
- pGC->fExpose = TRUE;
- pGC->freeCompClip = FALSE;
- pGC->pRotatedPixmap = (PixmapPtr) NULL;
-
- pPriv = cfbGetGCPrivate(pGC);
- pPriv->rop = pGC->alu;
- pPriv->oneRect = FALSE;
-
- pGC->ops = NULL;
-
- if (pGC->depth == 8) {
- pGC->funcs = &cfb8_32GCFuncs;
-
- pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
- pGCPriv->Ops8bpp = NULL;
- pGCPriv->Ops32bpp = NULL;
- pGCPriv->OpsAre8bpp = FALSE;
- pGCPriv->changes = 0;
- } else
- pGC->funcs = &cfb32GCFuncs_Underlay;
-
- return TRUE;
-}
-
-
-static void
-cfb8_32ValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
-
- if(pDraw->bitsPerPixel == 32) {
- if(pGCPriv->OpsAre8bpp) {
- int origChanges = changes;
- pGC->ops = pGCPriv->Ops32bpp;
- changes |= pGCPriv->changes;
- pGCPriv->changes = origChanges;
- pGCPriv->OpsAre8bpp = FALSE;
- } else
- pGCPriv->changes |= changes;
-
- cfb8_32ValidateGC32(pGC, changes, pDraw);
- pGCPriv->Ops32bpp = pGC->ops;
- } else { /* bitsPerPixel == 8 */
- if(!pGCPriv->OpsAre8bpp) {
- int origChanges = changes;
- pGC->ops = pGCPriv->Ops8bpp;
- changes |= pGCPriv->changes;
- pGCPriv->changes = origChanges;
- pGCPriv->OpsAre8bpp = TRUE;
- } else
- pGCPriv->changes |= changes;
-
- cfb8_32ValidateGC8(pGC, changes, pDraw);
- pGCPriv->Ops8bpp = pGC->ops;
- }
-}
-
diff --git a/hw/xfree86/xf8_32bpp/cfbgcunder.c b/hw/xfree86/xf8_32bpp/cfbgcunder.c
deleted file mode 100644
index d01b2b5cb..000000000
--- a/hw/xfree86/xf8_32bpp/cfbgcunder.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#define PSZ 32
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "cfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "mioverlay.h"
-
-#include "cfbmskbits.h"
-#include "cfb8bit.h"
-#include "cfb8_32.h"
-
-#ifdef WriteBitGroup
-# define useTEGlyphBlt cfbImageGlyphBlt8
-#else
-# define useTEGlyphBlt cfbTEGlyphBlt
-#endif
-
-#ifdef WriteBitGroup
-# define useImageGlyphBlt cfbImageGlyphBlt8
-# define usePolyGlyphBlt cfbPolyGlyphBlt8
-#else
-# define useImageGlyphBlt miImageGlyphBlt
-# define usePolyGlyphBlt miPolyGlyphBlt
-#endif
-
-#ifdef FOUR_BIT_CODE
-# define usePushPixels cfbPushPixels8
-#else
-#ifndef LOWMEMFTPT
-# define usePushPixels mfbPushPixels
-#else
-# define usePushPixels miPushPixels
-#endif /* ifndef LOWMEMFTPT */
-#endif
-
-#ifdef PIXEL_ADDR
-# define ZeroPolyArc cfbZeroPolyArcSS8Copy
-#else
-# define ZeroPolyArc miZeroPolyArc
-#endif
-
-
-static GCOps cfbTEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfbNonTEOps1Rect = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
-#ifdef PIXEL_ADDR
- cfb8LineSS1Rect,
- cfb8SegmentSS1Rect,
-#else
- cfbLineSS,
- cfbSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- cfbFillPoly1RectCopy,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfbTEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
- ZeroPolyArc,
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps cfbNonTEOps = {
- cfbSolidSpansCopy,
- cfbSetSpans,
- cfbPutImage,
- cfbCopyArea,
- cfbCopyPlane,
- cfbPolyPoint,
- cfbLineSS,
- cfbSegmentSS,
- miPolyRectangle,
-#ifdef PIXEL_ADDR
- cfbZeroPolyArcSS8Copy,
-#else
- miZeroPolyArc,
-#endif
- miFillPolygon,
- cfbPolyFillRect,
- cfbPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps *
-cfb32MatchCommon_Underlay(
- GCPtr pGC,
- cfbPrivGCPtr devPriv)
-{
- if (pGC->lineWidth != 0)
- return 0;
- if (pGC->lineStyle != LineSolid)
- return 0;
- if (pGC->fillStyle != FillSolid)
- return 0;
- if (devPriv->rop != GXcopy)
- return 0;
- if (pGC->font &&
- FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
- FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
- {
- if (TERMINALFONT(pGC->font)
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
-#ifdef NO_ONE_RECT
- return &cfbTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfbTEOps1Rect;
- else
- return &cfbTEOps;
-#endif
- else
-#ifdef NO_ONE_RECT
- return &cfbNonTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &cfbNonTEOps1Rect;
- else
- return &cfbNonTEOps;
-#endif
- }
- return 0;
-}
-
-
-void
-cfb32ValidateGC_Underlay(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-){
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int new_rrop;
- int new_line, new_text, new_fillspans, new_fillarea;
- /* flags for changing the proc vector */
- cfbPrivGCPtr devPriv;
- int oneRect;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
- devPriv = cfbGetGCPrivate(pGC);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fillspans = FALSE;
- new_fillarea = FALSE;
-
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- if(pDrawable->type == DRAWABLE_WINDOW)
- miOverlayComputeCompositeClip (pGC, (WindowPtr)pDrawable);
- else
- miComputeCompositeClip (pGC, pDrawable);
-#ifdef NO_ONE_RECT
- devPriv->oneRect = FALSE;
-#else
- oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
- if (oneRect != devPriv->oneRect)
- new_line = TRUE;
- devPriv->oneRect = oneRect;
-#endif
- }
-
- mask = changes;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
-
- switch (index) {
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCPlaneMask:
- new_rrop = TRUE;
- new_text = TRUE;
- break;
- case GCBackground:
- break;
- case GCLineStyle:
- case GCLineWidth:
- new_line = TRUE;
- break;
- case GCJoinStyle:
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_text = TRUE;
- new_fillspans = TRUE;
- new_line = TRUE;
- new_fillarea = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
- case GCStipple:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
- case GCTileStipXOrigin:
- case GCTileStipYOrigin:
- break;
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- case GCGraphicsExposures:
- case GCClipXOrigin:
- case GCClipYOrigin:
- case GCClipMask:
- case GCDashOffset:
- case GCDashList:
- case GCArcMode:
- default:
- break;
- }
- }
-
- /*
- * If the drawable has changed, ensure suitable
- * entries are in the proc vector.
- */
- if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
- new_fillspans = TRUE; /* deal with FillSpans later */
-
- if (new_rrop)
- {
- int old_rrop;
-
- old_rrop = devPriv->rop;
- devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
- pGC->planemask,
- &devPriv->and, &devPriv->xor);
- if (old_rrop == devPriv->rop)
- new_rrop = FALSE;
- else
- {
-#ifdef PIXEL_ADDR
- new_line = TRUE;
-#endif
-#ifdef WriteBitGroup
- new_text = TRUE;
-#endif
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- }
- }
-
- if(!pGC->ops)
- pGC->ops = & cfbNonTEOps;
-
-
- if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
- {
- GCOps *newops;
-
- if ((newops = cfb32MatchCommon_Underlay (pGC, devPriv)))
- {
- if (pGC->ops->devPrivate.val)
- miDestroyGCOps (pGC->ops);
- pGC->ops = newops;
- new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
- }
- else
- {
- if (!pGC->ops->devPrivate.val)
- {
- pGC->ops = miCreateGCOps (pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
- }
-
- /* deal with the changes we've collected */
- if (new_line)
- {
- pGC->ops->FillPolygon = miFillPolygon;
-#ifdef NO_ONE_RECT
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#else
- if (devPriv->oneRect && pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
- break;
- }
- }
-#endif
- if (pGC->lineWidth == 0)
- {
-#ifdef PIXEL_ADDR
- if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
- {
- switch (devPriv->rop)
- {
- case GXxor:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
- break;
- case GXcopy:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
- break;
- default:
- pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
- break;
- }
- }
- else
-#endif
- pGC->ops->PolyArc = miZeroPolyArc;
- }
- else
- pGC->ops->PolyArc = miPolyArc;
- pGC->ops->PolySegment = miPolySegment;
- switch (pGC->lineStyle)
- {
- case LineSolid:
- if(pGC->lineWidth == 0)
- {
- if (pGC->fillStyle == FillSolid)
- {
-#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
- if (devPriv->oneRect &&
- ((pDrawable->x >= pGC->pScreen->width - 32768) &&
- (pDrawable->y >= pGC->pScreen->height - 32768)))
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- } else
-#endif
-#ifdef NO_ONE_RECT
- {
- pGC->ops->Polylines = cfb8LineSS1Rect;
- pGC->ops->PolySegment = cfb8SegmentSS1Rect;
- }
-#else
- {
- pGC->ops->Polylines = cfbLineSS;
- pGC->ops->PolySegment = cfbSegmentSS;
- }
-#endif
- }
- else
- pGC->ops->Polylines = miZeroLine;
- }
- else
- pGC->ops->Polylines = miWideLine;
- break;
- case LineOnOffDash:
- case LineDoubleDash:
- if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
- {
- pGC->ops->Polylines = cfbLineSD;
- pGC->ops->PolySegment = cfbSegmentSD;
- } else
- pGC->ops->Polylines = miWideDash;
- break;
- }
- }
-
- if (new_text && (pGC->font))
- {
- if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- else
- {
-#ifdef WriteBitGroup
- if (pGC->fillStyle == FillSolid)
- {
- if (devPriv->rop == GXcopy)
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
- else
-#ifdef FOUR_BIT_CODE
- pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
-#else
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
-#endif
- }
- else
-#endif
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- /* special case ImageGlyphBlt for terminal emulator fonts */
-#if !defined(WriteBitGroup) || PSZ == 8
- if (TERMINALFONT(pGC->font) &&
- (pGC->planemask & PMSK) == PMSK
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
- {
- pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
- }
- else
-#endif
- {
-#ifdef WriteBitGroup
- if (devPriv->rop == GXcopy &&
- pGC->fillStyle == FillSolid &&
- (pGC->planemask & PMSK) == PMSK)
- pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
- else
-#endif
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- }
- }
-
-
- if (new_fillspans) {
- switch (pGC->fillStyle) {
- case FillSolid:
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillSpans = cfbSolidSpansCopy;
- break;
- case GXxor:
- pGC->ops->FillSpans = cfbSolidSpansXor;
- break;
- default:
- pGC->ops->FillSpans = cfbSolidSpansGeneral;
- break;
- }
- break;
- case FillTiled:
- pGC->ops->FillSpans = cfbUnnaturalTileFS;
- break;
- case FillStippled:
- case FillOpaqueStippled:
- pGC->ops->FillSpans = cfbUnnaturalStippleFS;
- break;
- default:
- FatalError("cfbValidateGC: illegal fillStyle\n");
- }
- } /* end of new_fillspans */
-
- if (new_fillarea) {
-#ifndef FOUR_BIT_CODE
- pGC->ops->PolyFillRect = miPolyFillRect;
- if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
- {
- pGC->ops->PolyFillRect = cfbPolyFillRect;
- }
-#endif
-#ifdef FOUR_BIT_CODE
-#ifndef LOWMEMFTPT
- pGC->ops->PushPixels = mfbPushPixels;
-#else
- pGC->ops->PushPixels = miPushPixels;
-#endif /* ifndef LOWMEMFTPT */
- if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
- pGC->ops->PushPixels = cfbPushPixels8;
-#endif
- pGC->ops->PolyFillArc = miPolyFillArc;
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop)
- {
- case GXcopy:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
- break;
- default:
- pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
- break;
- }
- }
- }
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbimage.c b/hw/xfree86/xf8_32bpp/cfbimage.c
deleted file mode 100644
index e737e025e..000000000
--- a/hw/xfree86/xf8_32bpp/cfbimage.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */
-
-#include "X.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "servermd.h"
-#include "mi.h"
-
-
-void
-cfb8_32GetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planemask,
- char *pdstLine
-){
- if(!w || !h) return;
-
- if (!cfbDrawableEnabled (pDraw))
- return;
-
- if(pDraw->depth == 24){
- cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
- return;
- }
-
- if((pDraw->bitsPerPixel == 8) || (pDraw->bitsPerPixel == 1)){
- cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
- return;
- }
-
- /* source is depth 8, 32 bpp */
- if(format != ZPixmap) {
- miGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
- return;
- } else {
- BoxRec box;
- DDXPointRec ptSrc;
- RegionRec rgnDst;
- ScreenPtr pScreen;
- PixmapPtr pPixmap;
-
- pScreen = pDraw->pScreen;
- pPixmap = GetScratchPixmapHeader(pScreen, w, h, 8, 8,
- PixmapBytePad(w,8), (pointer)pdstLine);
- if (!pPixmap)
- return;
- if ((planemask & 0xff) != 0xff)
- bzero((char *)pdstLine, pPixmap->devKind * h);
- ptSrc.x = sx + pDraw->x;
- ptSrc.y = sy + pDraw->y;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
- cfbDoBitblt32To8(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
- &ptSrc, planemask);
- REGION_UNINIT(pScreen, &rgnDst);
- FreeScratchPixmapHeader(pPixmap);
- }
-}
-
-void
-cfb8_32PutImage (
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- if(!w || !h) return;
-
- if((pDraw->bitsPerPixel == 8) || (format != XYPixmap)){
- cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage);
- return;
- } else { /* moving an 8bpp XYPixmap to a 32bpp screen */
- unsigned long oldFg, oldBg;
- XID gcv[3];
- unsigned long oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0] = ~0L;
- gcv[1] = 0;
- DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
- bytesPer = (long)h * BitmapBytePad(w + leftPad);
-
- for (i = 0x80000000; i & 0xff000000; i >>= 1, pImage += bytesPer)
- {
- if (i & oldPlanemask)
- {
- gcv[0] = i;
- DoChangeGC(pGC, GCPlaneMask, gcv, 0);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
- XYBitmap, pImage);
- }
- }
- gcv[0] = oldPlanemask;
- gcv[1] = oldFg;
- gcv[2] = oldBg;
- DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
- ValidateGC(pDraw, pGC);
- }
-}
-
-
-
-
-void
-cfb8_32GetSpans(
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pDst
-){
- int pitch, i;
- CARD8 *ptr, *ptrBase;
-
- if (!cfbDrawableEnabled (pDraw))
- return;
-
- if(pDraw->bitsPerPixel == 1) {
- mfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
- return;
- }
-
- if(pDraw->depth == 24) {
- cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
- return;
- } else if(pDraw->bitsPerPixel == 8) {
- cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
- return;
- }
-
- /* gotta get spans from a depth 8 window */
- cfbGetByteWidthAndPointer(pDraw, pitch, ptrBase);
- ptrBase += 3; /* point to top byte */
-
- while(nspans--) {
- ptr = ptrBase + (ppt->y * pitch) + (ppt->x << 2);
-
- for(i = *pwidth; i--; ptr += 4)
- *(pDst++) = *ptr;
-
- pDst = (char*)((long)(pDst + 3) & ~3L);
-
- ppt++; pwidth++;
- }
-}
-
-
diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c
deleted file mode 100644
index 516decd6c..000000000
--- a/hw/xfree86/xf8_32bpp/cfbpntwin.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c,v 1.5 2001/10/01 13:44:15 eich Exp $ */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "mi.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-void
-cfb8_32PaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-){
- WindowPtr pBgWin;
- int xorg, yorg;
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(
- pWin, pRegion, what);
- break;
- case BackgroundPixmap:
- xorg = pWin->drawable.x;
- yorg = pWin->drawable.y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pWin->drawable.pScreen->myNum;
- if(WindowTable[index] == pWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
- pWin->background.pixmap, xorg, yorg, GXcopy,
- (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
- break;
- case BackgroundPixel:
- if(pWin->drawable.depth == 24)
- cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- else
- cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel) {
- if(pWin->drawable.depth == 24) {
- cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- } else
- cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- } else {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- xorg = pBgWin->drawable.x;
- yorg = pBgWin->drawable.y;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int index = pWin->drawable.pScreen->myNum;
- if(WindowTable[index] == pBgWin) {
- xorg -= panoramiXdataPtr[index].x;
- yorg -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
- pWin->border.pixmap, xorg, yorg, GXcopy,
- (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
- }
- break;
- }
-
-}
-
-void
-cfb8_32FillBoxSolid8(
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pbox,
- unsigned long color
-){
- CARD8 *ptr, *data;
- int pitch, height, width, i;
- CARD8 c = (CARD8)color;
-
- cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
- ptr += 3; /* point to the top byte */
-
- while(nbox--) {
- data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
- width = (pbox->x2 - pbox->x1) << 2;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- for(i = 0; i < width; i+=4)
- data[i] = c;
- data += pitch;
- }
- pbox++;
- }
-}
-
-
-void
-cfb8_32FillBoxSolid32(
- DrawablePtr pDraw,
- int nbox,
- BoxPtr pbox,
- unsigned long color
-){
- CARD8 *ptr, *data;
- CARD16 *ptr2, *data2;
- int pitch, pitch2;
- int height, width, i;
- CARD8 c = (CARD8)(color >> 16);
- CARD16 c2 = (CARD16)color;
-
- cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
- cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16);
- ptr += 2; /* point to the third byte */
-
- while(nbox--) {
- data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
- data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1);
- width = (pbox->x2 - pbox->x1) << 1;
- height = pbox->y2 - pbox->y1;
-
- while(height--) {
- for(i = 0; i < width; i+=2) {
- data[i << 1] = c;
- data2[i] = c2;
- }
- data += pitch;
- data2 += pitch2;
- }
- pbox++;
- }
-}
-
diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c
deleted file mode 100644
index 7f123d36a..000000000
--- a/hw/xfree86/xf8_32bpp/cfbscrinit.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.12 2003/07/16 01:38:50 dawes Exp $ */
-
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "mi.h"
-#include "micmap.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mibstore.h"
-#include "mioverlay.h"
-#include "xf86.h"
-#include "xf86str.h"
-#include "globals.h"
-
-/* CAUTION: We require that cfb8 and cfb32 were NOT
- compiled with CFB_NEED_SCREEN_PRIVATE */
-
-static BSFuncRec cfb8_32BSFuncRec = {
- cfb8_32SaveAreas,
- cfb8_32RestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-
-int cfb8_32GCPrivateIndex;
-int cfb8_32ScreenPrivateIndex;
-static unsigned long cfb8_32Generation = 0;
-
-static Bool
-cfb8_32AllocatePrivates(ScreenPtr pScreen)
-{
- cfb8_32ScreenPtr pScreenPriv;
-
- if(cfb8_32Generation != serverGeneration) {
- if(((cfb8_32GCPrivateIndex = AllocateGCPrivateIndex()) < 0) ||
- ((cfb8_32ScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0))
- return FALSE;
- cfb8_32Generation = serverGeneration;
- }
-
- if (!(pScreenPriv = xalloc(sizeof(cfb8_32ScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = (pointer)pScreenPriv;
-
-
- /* All cfb will have the same GC and Window private indicies */
- if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
- return FALSE;
-
- /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
- if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
- return FALSE;
-
- if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
- return FALSE;
-
- if(!AllocateGCPrivate(pScreen, cfb8_32GCPrivateIndex, sizeof(cfb8_32GCRec)))
- return FALSE;
-
- return TRUE;
-}
-
-static void DestroyColormapNoop(
- ColormapPtr pColormap)
-{
- /* NOOP */
-}
-
-static void StoreColorsNoop(
- ColormapPtr pColormap,
- int ndef,
- xColorItem * pdef)
-{
- /* NOOP */
-}
-
-static Bool
-cfb8_32SetupScreen(
- ScreenPtr pScreen,
- pointer pbits, /* pointer to screen bitmap */
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy, /* dots per inch */
- int width /* pixel width of frame buffer */
-){
- if (!cfb8_32AllocatePrivates(pScreen))
- return FALSE;
- pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = mfbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = cfb8_32GetImage;
- pScreen->GetSpans = cfb8_32GetSpans;
- pScreen->CreateWindow = cfb8_32CreateWindow;
- pScreen->DestroyWindow = cfb8_32DestroyWindow;
- pScreen->PositionWindow = cfb8_32PositionWindow;
- pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes;
- pScreen->RealizeWindow = cfb32MapWindow; /* OK */
- pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
- pScreen->PaintWindowBackground = cfb8_32PaintWindow;
- pScreen->PaintWindowBorder = cfb8_32PaintWindow;
- pScreen->CopyWindow = cfb8_32CopyWindow;
- pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
- pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = cfb8_32CreateGC;
- pScreen->CreateColormap = miInitializeColormap;
- pScreen->DestroyColormap = DestroyColormapNoop;
- pScreen->InstallColormap = miInstallColormap;
- pScreen->UninstallColormap = miUninstallColormap;
- pScreen->ListInstalledColormaps = miListInstalledColormaps;
- pScreen->StoreColors = StoreColorsNoop;
- pScreen->ResolveColor = miResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- mfbRegisterCopyPlaneProc (pScreen, cfb8_32CopyPlane);
- return TRUE;
-}
-
-typedef struct {
- pointer pbits;
- int width;
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
-
-static Bool
-cfb8_32CreateScreenResources(ScreenPtr pScreen)
-{
- miScreenInitParmsPtr pScrInitParms;
- int pitch;
- Bool retval;
-
- /* get the pitch before mi destroys it */
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
- pitch = pScrInitParms->width << 2;
-
- if((retval = miCreateScreenResources(pScreen))) {
- /* fix the screen pixmap */
- PixmapPtr pPix = (PixmapPtr)pScreen->devPrivate;
- pPix->drawable.bitsPerPixel = 32;
- pPix->drawable.depth = 8;
- pPix->devKind = pitch;
- }
-
- return retval;
-}
-
-
-static Bool
-cfb8_32CloseScreen (int i, ScreenPtr pScreen)
-{
- cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
- if(pScreenPriv->visualData)
- xfree(pScreenPriv->visualData);
-
- xfree((pointer) pScreenPriv);
- pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = NULL;
-
- return(cfb32CloseScreen(i, pScreen));
-}
-
-static void
-cfb8_32TransFunc(
- ScreenPtr pScreen,
- int nbox,
- BoxPtr pbox
-){
- cfb8_32FillBoxSolid8(&(WindowTable[pScreen->myNum]->drawable),
- nbox, pbox, xf86Screens[pScreen->myNum]->colorKey);
-}
-
-static Bool
-cfb8_32InOverlayFunc(WindowPtr pWin)
-{
- return (pWin->drawable.depth == 8);
-}
-
-static Bool
-cfb8_32FinishScreenInit(
- ScreenPtr pScreen,
- pointer pbits, /* pointer to screen bitmap */
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy, /* dots per inch */
- int width /* pixel width of frame buffer */
-){
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(32-1)), 8, -1))
- return FALSE;
- if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals))
- return FALSE;
-
- pScreen->BackingStoreFuncs = cfb8_32BSFuncRec;
- pScreen->CreateScreenResources = cfb8_32CreateScreenResources;
- pScreen->CloseScreen = cfb8_32CloseScreen;
- pScreen->GetScreenPixmap = cfb32GetScreenPixmap; /* OK */
- pScreen->SetScreenPixmap = cfb32SetScreenPixmap; /* OK */
-
- if (! miInitOverlay(pScreen, cfb8_32InOverlayFunc, cfb8_32TransFunc))
- return FALSE;
-
- return TRUE;
-}
-
-static void
-cfb8_32EnableDisableFBAccess (
- int index,
- Bool enable
-){
- ScreenPtr pScreen = screenInfo.screens[index];
- cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
-
- miOverlaySetRootClip(pScreen, enable);
-
- (*pScreenPriv->EnableDisableFBAccess) (index, enable);
-}
-
-static Atom overlayVisualsAtom;
-
-typedef struct {
- CARD32 overlay_visual;
- CARD32 transparent_type;
- CARD32 value;
- CARD32 layer;
-} overlayVisualRec;
-
-static void
-cfb8_32SetupVisuals (ScreenPtr pScreen)
-{
- cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
- char atomString[] = {"SERVER_OVERLAY_VISUALS"};
- overlayVisualRec *overlayVisuals;
- VisualID *visuals = NULL;
- int numVisuals = 0;
- DepthPtr pDepth = pScreen->allowedDepths;
- int numDepths = pScreen->numDepths;
- int i;
-
- /* find depth 8 visuals */
- for(i = 0; i < numDepths; i++, pDepth++) {
- if(pDepth->depth == 8) {
- numVisuals = pDepth->numVids;
- visuals = pDepth->vids;
- break;
- }
- }
-
- if(!numVisuals || !visuals) {
- ErrorF("No overlay visuals found!\n");
- return;
- }
-
- if(!(overlayVisuals = xalloc(numVisuals * sizeof(overlayVisualRec))))
- return;
-
- for(i = 0; i < numVisuals; i++) {
- overlayVisuals[i].overlay_visual = visuals[i];
- overlayVisuals[i].transparent_type = 1; /* transparent pixel */
- overlayVisuals[i].value = pScreenPriv->key;
- overlayVisuals[i].layer = 1;
- }
-
- overlayVisualsAtom = MakeAtom(atomString, sizeof(atomString) - 1, TRUE);
- xf86RegisterRootWindowProperty(pScreen->myNum, overlayVisualsAtom,
- overlayVisualsAtom, 32, numVisuals * 4, overlayVisuals);
- pScreenPriv->visualData = (pointer)overlayVisuals;
-}
-
-Bool
-cfb8_32ScreenInit(
- ScreenPtr pScreen,
- pointer pbits, /* pointer to screen bitmap */
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy, /* dots per inch */
- int w /* pixel width of frame buffer */
-){
- cfb8_32ScreenPtr pScreenPriv;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- if (!cfb8_32SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
- return FALSE;
-
- pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
- pScreenPriv->key = pScrn->colorKey;
- pScreenPriv->visualData = NULL;
-
-
- pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
- pScrn->EnableDisableFBAccess = cfb8_32EnableDisableFBAccess;
-
-
- if(cfb8_32FinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
- {
- cfb8_32SetupVisuals(pScreen);
- return TRUE;
- }
- return FALSE;
-}
diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c
deleted file mode 100644
index c18b54399..000000000
--- a/hw/xfree86/xf8_32bpp/cfbwindow.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.9 2003/11/10 18:22:43 tsi Exp $ */
-
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "mioverlay.h"
-
-
-/* We don't bother with cfb's fastBackground/Border so we don't
- need to use the Window privates */
-
-
-Bool
-cfb8_32CreateWindow(WindowPtr pWin)
-{
- cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
-
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-
- pWin->drawable.bitsPerPixel = 32;
- return TRUE;
-}
-
-
-Bool
-cfb8_32DestroyWindow(WindowPtr pWin)
-{
- return TRUE;
-}
-
-Bool
-cfb8_32PositionWindow(
- WindowPtr pWin,
- int x, int y
-){
- return TRUE;
-}
-
-void
-cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- DDXPointPtr ppt, pptSrc;
- RegionRec rgnDst;
- RegionPtr borderClip = &pWin->borderClip;
- BoxPtr pbox;
- int dx, dy, i, nbox;
- WindowPtr pwinRoot;
- Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
- Bool freeReg = FALSE;
-
- pwinRoot = WindowTable[pScreen->myNum];
-
- if(doUnderlay)
- freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox ||
- !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- for (i = nbox; --i >= 0; ppt++, pbox++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- if(doUnderlay)
- cfbDoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0);
- else
- cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0);
-
- DEALLOCATE_LOCAL(pptSrc);
- REGION_UNINIT(pScreen, &rgnDst);
- if(freeReg)
- REGION_DESTROY(pScreen, borderClip);
-}
-
-Bool
-cfb8_32ChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask
-){
- return TRUE;
-}
-
-
-
-
diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c
deleted file mode 100644
index 998503c21..000000000
--- a/hw/xfree86/xf8_32bpp/xf86overlay.c
+++ /dev/null
@@ -1,1258 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/xf86overlay.c,v 1.9 2002/02/11 00:07:25 dawes Exp $ */
-
-/*
- Copyright (C) 1998. The XFree86 Project Inc.
-
- Written by Mark Vojkovich (mvojkovi@ucsd.edu)
-*/
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "colormapst.h"
-#include "cfb8_32.h"
-
-#define IS_DIRTY 1
-#define IS_SHARED 2
-
-/** Screen Functions **/
-
-static Bool OverlayCloseScreen (int, ScreenPtr);
-static Bool OverlayCreateGC(GCPtr pGC);
-static Bool OverlayDestroyPixmap(PixmapPtr);
-static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int);
-static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long);
-static void OverlayPaintWindow(WindowPtr, RegionPtr, int);
-
-/** Funcs **/
-static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr);
-static void OverlayChangeGC(GCPtr, unsigned long);
-static void OverlayCopyGC(GCPtr, unsigned long, GCPtr);
-static void OverlayDestroyGC(GCPtr);
-static void OverlayChangeClip(GCPtr, int, pointer, int);
-static void OverlayDestroyClip(GCPtr);
-static void OverlayCopyClip(GCPtr, GCPtr);
-
-
-static PixmapPtr OverlayRefreshPixmap(PixmapPtr);
-
-static GCFuncs OverlayGCFuncs = {
- OverlayValidateGC, OverlayChangeGC,
- OverlayCopyGC, OverlayDestroyGC,
- OverlayChangeClip, OverlayDestroyClip,
- OverlayCopyClip
-};
-
-
-/** Pixmap Ops */
-static void PixmapFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
- int);
-static void PixmapSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
- int *, int, int);
-static void PixmapPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
- int, int, char *);
-static void PixmapPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
- int, int);
-static RegionPtr PixmapCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
- int, int, int, int);
-static RegionPtr PixmapCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
- int, int, int, int, unsigned long);
-static void PixmapPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
-static void PixmapPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
-static void PixmapPolySegment(DrawablePtr, GCPtr, int, xSegment *);
-static void PixmapPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
-static void PixmapPolyArc(DrawablePtr, GCPtr, int, xArc *);
-static void PixmapFillPolygon(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void PixmapPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
-static void PixmapPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
-static int PixmapPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
-static int PixmapPolyText16(DrawablePtr, GCPtr, int, int, int,
- unsigned short *);
-static void PixmapImageText8(DrawablePtr, GCPtr, int, int, int, char *);
-static void PixmapImageText16(DrawablePtr, GCPtr, int, int, int,
- unsigned short *);
-static void PixmapImageGlyphBlt(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-static void PixmapPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-
-static GCOps PixmapGCOps = {
- PixmapFillSpans, PixmapSetSpans,
- PixmapPutImage, PixmapCopyArea,
- PixmapCopyPlane, PixmapPolyPoint,
- PixmapPolylines, PixmapPolySegment,
- PixmapPolyRectangle, PixmapPolyArc,
- PixmapFillPolygon, PixmapPolyFillRect,
- PixmapPolyFillArc, PixmapPolyText8,
- PixmapPolyText16, PixmapImageText8,
- PixmapImageText16, PixmapImageGlyphBlt,
- PixmapPolyGlyphBlt, PixmapPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
-
-/** Window Ops **/
-static void WindowFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
- int);
-static void WindowSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
- int *, int, int);
-static void WindowPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
- int, int, char *);
-static void WindowPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
- int, int);
-static RegionPtr WindowCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
- int, int, int, int);
-static RegionPtr WindowCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
- int, int, int, int, unsigned long);
-static void WindowPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
-static void WindowPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
-static void WindowPolySegment(DrawablePtr, GCPtr, int, xSegment *);
-static void WindowPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
-static void WindowPolyArc(DrawablePtr, GCPtr, int, xArc *);
-static void WindowFillPolygon(DrawablePtr, GCPtr, int, int, int,
- DDXPointPtr);
-static void WindowPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
-static void WindowPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
-static int WindowPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
-static int WindowPolyText16(DrawablePtr, GCPtr, int, int, int,
- unsigned short *);
-static void WindowImageText8(DrawablePtr, GCPtr, int, int, int, char *);
-static void WindowImageText16(DrawablePtr, GCPtr, int, int, int,
- unsigned short *);
-static void WindowImageGlyphBlt(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-static void WindowPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
- unsigned int, CharInfoPtr *, pointer);
-
-static GCOps WindowGCOps = {
- WindowFillSpans, WindowSetSpans,
- WindowPutImage, WindowCopyArea,
- WindowCopyPlane, WindowPolyPoint,
- WindowPolylines, WindowPolySegment,
- WindowPolyRectangle, WindowPolyArc,
- WindowFillPolygon, WindowPolyFillRect,
- WindowPolyFillArc, WindowPolyText8,
- WindowPolyText16, WindowImageText8,
- WindowImageText16, WindowImageGlyphBlt,
- WindowPolyGlyphBlt, WindowPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
-/** privates **/
-
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- CreateGCProcPtr CreateGC;
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- int LockPrivate;
-} OverlayScreenRec, *OverlayScreenPtr;
-
-typedef struct {
- GCFuncs *wrapFuncs;
- GCOps *wrapOps;
- GCOps *overlayOps;
- unsigned long fg;
- unsigned long bg;
- unsigned long pm;
- PixmapPtr tile;
-} OverlayGCRec, *OverlayGCPtr;
-
-typedef struct {
- PixmapPtr pix32;
- CARD32 dirty;
-} OverlayPixmapRec, *OverlayPixmapPtr;
-
-
-static int OverlayScreenIndex = -1;
-static int OverlayGCIndex = -1;
-static int OverlayPixmapIndex = -1;
-static unsigned long OverlayGeneration = 0;
-
-/** Macros **/
-
-#define TILE_EXISTS(pGC) (!(pGC)->tileIsPixel && (pGC)->tile.pixmap)
-
-#define OVERLAY_GET_PIXMAP_PRIVATE(pPix) \
- (OverlayPixmapPtr)((pPix)->devPrivates[OverlayPixmapIndex].ptr)
-
-#define OVERLAY_GET_SCREEN_PRIVATE(pScreen) \
- (OverlayScreenPtr)((pScreen)->devPrivates[OverlayScreenIndex].ptr)
-
-#define OVERLAY_GET_GC_PRIVATE(pGC) \
- (OverlayGCPtr)((pGC)->devPrivates[OverlayGCIndex].ptr)
-
-#define OVERLAY_GC_FUNC_PROLOGUE(pGC)\
- OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
- (pGC)->funcs = pGCPriv->wrapFuncs;\
- if(pGCPriv->overlayOps) \
- (pGC)->ops = pGCPriv->wrapOps
-
-#define OVERLAY_GC_FUNC_EPILOGUE(pGC)\
- pGCPriv->wrapFuncs = (pGC)->funcs;\
- (pGC)->funcs = &OverlayGCFuncs;\
- if(pGCPriv->overlayOps) { \
- pGCPriv->wrapOps = (pGC)->ops;\
- (pGC)->ops = pGCPriv->overlayOps;\
- }
-
-#define WINDOW_GC_OP_PROLOGUE(pGC)\
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE((pGC)->pScreen);\
- OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
- unsigned long oldfg = (pGC)->fgPixel;\
- unsigned long oldbg = (pGC)->bgPixel;\
- unsigned long oldpm = (pGC)->planemask;\
- PixmapPtr oldtile = (pGC)->tile.pixmap;\
- (pGC)->fgPixel = pGCPriv->fg;\
- (pGC)->bgPixel = pGCPriv->bg;\
- (pGC)->planemask = pGCPriv->pm;\
- if(pGCPriv->tile) (pGC)->tile.pixmap = pGCPriv->tile;\
- (pGC)->funcs = pGCPriv->wrapFuncs;\
- (pGC)->ops = pGCPriv->wrapOps;\
- pScreenPriv->LockPrivate++
-
-
-#define WINDOW_GC_OP_EPILOGUE(pGC)\
- pGCPriv->wrapOps = (pGC)->ops;\
- pGCPriv->wrapFuncs = (pGC)->funcs;\
- (pGC)->fgPixel = oldfg;\
- (pGC)->bgPixel = oldbg;\
- (pGC)->planemask = oldpm;\
- (pGC)->tile.pixmap = oldtile;\
- (pGC)->funcs = &OverlayGCFuncs;\
- (pGC)->ops = &WindowGCOps;\
- pScreenPriv->LockPrivate--
-
-
-#define PIXMAP_GC_OP_PROLOGUE(pGC)\
- OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
- OverlayPixmapPtr pPixPriv = OVERLAY_GET_PIXMAP_PRIVATE((PixmapPtr)pDraw);\
- pGC->funcs = pGCPriv->wrapFuncs;\
- pGC->ops = pGCPriv->wrapOps
-
-#define PIXMAP_GC_OP_EPILOGUE(pGC)\
- pGCPriv->wrapOps = pGC->ops;\
- pGC->funcs = &OverlayGCFuncs;\
- pGC->ops = &PixmapGCOps;\
- pPixPriv->dirty |= IS_DIRTY
-
-
-Bool
-xf86Overlay8Plus32Init (ScreenPtr pScreen)
-{
- OverlayScreenPtr pScreenPriv;
-
- if(OverlayGeneration != serverGeneration) {
- if(((OverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((OverlayGCIndex = AllocateGCPrivateIndex()) < 0) ||
- ((OverlayPixmapIndex = AllocatePixmapPrivateIndex()) < 0))
- return FALSE;
-
- OverlayGeneration = serverGeneration;
- }
-
- if (!AllocateGCPrivate(pScreen, OverlayGCIndex, sizeof(OverlayGCRec)))
- return FALSE;
-
- if (!AllocatePixmapPrivate(pScreen, OverlayPixmapIndex,
- sizeof(OverlayPixmapRec)))
- return FALSE;
-
- if (!(pScreenPriv = xalloc(sizeof(OverlayScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[OverlayScreenIndex].ptr = (pointer)pScreenPriv;
-
- pScreenPriv->CreateGC = pScreen->CreateGC;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
- pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
- pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
- pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
-
- pScreen->CreateGC = OverlayCreateGC;
- pScreen->CloseScreen = OverlayCloseScreen;
- pScreen->CreatePixmap = OverlayCreatePixmap;
- pScreen->DestroyPixmap = OverlayDestroyPixmap;
- pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
- pScreen->PaintWindowBackground = OverlayPaintWindow;
- pScreen->PaintWindowBorder = OverlayPaintWindow;
-
- pScreenPriv->LockPrivate = 0;
-
- /* allocate the key in the default map */
- if(pScreen->defColormap) {
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- ColormapPtr pmap;
- xColorItem color;
-
- pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP);
-
- pmap->red[pScrn->colorKey].refcnt = AllocPrivate;
- pmap->red[pScrn->colorKey].fShared = FALSE;
- pmap->freeRed--;
-
- color.red = color.blue = color.green = 0;
- color.pixel = pScrn->colorKey;
- color.flags = DoRed | DoGreen | DoBlue;
-
- StoreColors(pmap, 1, &color);
- }
-
- return TRUE;
-}
-
-
-/*********************** Screen Funcs ***********************/
-
-Bool
-OverlayCreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- Bool ret;
-
- pScreen->CreateGC = pScreenPriv->CreateGC;
-
- if((ret = (*pScreen->CreateGC)(pGC)) && (pGC->depth != 1)) {
- pGCPriv->wrapFuncs = pGC->funcs;
- pGC->funcs = &OverlayGCFuncs;
- pGCPriv->wrapOps = NULL;
- pGCPriv->overlayOps = NULL;
- pGCPriv->tile = NULL;
- }
-
- pScreen->CreateGC = OverlayCreateGC;
-
- return ret;
-}
-
-static PixmapPtr
-OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
-{
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- PixmapPtr pPix;
-
- pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
- pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
- pScreen->CreatePixmap = OverlayCreatePixmap;
-
- /* We initialize all the privates */
- if(pPix) {
- OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
- pPriv->pix32 = NULL;
- pPriv->dirty = IS_DIRTY;
- if(!w || !h)
- pPriv->dirty |= IS_SHARED;
- }
-
- return pPix;
-}
-
-static Bool
-OverlayDestroyPixmap(PixmapPtr pPix)
-{
- ScreenPtr pScreen = pPix->drawable.pScreen;
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- Bool result;
-
- pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
-
- if((pPix->refcnt == 1) && (pPix->drawable.bitsPerPixel == 8)) {
- OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
- if(pPriv->pix32) {
- if(pPriv->pix32->refcnt != 1)
- ErrorF("Warning! private pix refcnt = %i\n", pPriv->pix32->refcnt);
- (*pScreen->DestroyPixmap)(pPriv->pix32);
- }
- pPriv->pix32 = NULL;
- }
-
- result = (*pScreen->DestroyPixmap) (pPix);
- pScreen->DestroyPixmap = OverlayDestroyPixmap;
-
- return result;
-}
-
-static Bool
-OverlayCloseScreen (int i, ScreenPtr pScreen)
-{
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
-
- pScreen->CreateGC = pScreenPriv->CreateGC;
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
- pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
- pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
-
- xfree ((pointer) pScreenPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-
-
-static Bool
-OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- Bool result;
-
- if(pWin->drawable.depth == 8) {
- if((mask & CWBackPixmap) &&
- (pWin->backgroundState == BackgroundPixmap))
- OverlayRefreshPixmap(pWin->background.pixmap);
-
- if((mask & CWBorderPixmap) && !pWin->borderIsPixel)
- OverlayRefreshPixmap(pWin->border.pixmap);
- }
-
- pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
- result = (*pScreen->ChangeWindowAttributes) (pWin, mask);
- pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
-
- return result;
-}
-
-static void
-OverlayPaintWindow(
- WindowPtr pWin,
- RegionPtr pReg,
- int what
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- OverlayPixmapPtr pixPriv;
- PixmapPtr oldPix = NULL;
-
- if(what == PW_BACKGROUND) {
- if(pWin->drawable.depth == 8) {
- if(pWin->backgroundState == ParentRelative) {
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- }
-
- if(pWin->backgroundState == BackgroundPixmap) {
- oldPix = pWin->background.pixmap;
- pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
- /* have to do this here because alot of applications
- incorrectly assume changes to a pixmap that is
- a window background go into effect immediatedly */
- if(pixPriv->dirty & IS_DIRTY)
- OverlayRefreshPixmap(pWin->background.pixmap);
- pWin->background.pixmap = pixPriv->pix32;
- }
- }
-
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- (*pScreen->PaintWindowBackground) (pWin, pReg, what);
- pScreen->PaintWindowBackground = OverlayPaintWindow;
-
- if(oldPix)
- pWin->background.pixmap = oldPix;
- } else {
- if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) {
- oldPix = pWin->border.pixmap;
- pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
- if(pixPriv->dirty & IS_DIRTY)
- OverlayRefreshPixmap(pWin->border.pixmap);
- pWin->border.pixmap = pixPriv->pix32;
- }
-
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
- (*pScreen->PaintWindowBorder) (pWin, pReg, what);
- pScreen->PaintWindowBorder = OverlayPaintWindow;
-
- if(oldPix)
- pWin->border.pixmap = oldPix;
- }
-}
-
-
-/*********************** GC Funcs *****************************/
-
-
-static PixmapPtr
-OverlayRefreshPixmap(PixmapPtr pix8)
-{
- OverlayPixmapPtr pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(pix8);
- ScreenPtr pScreen = pix8->drawable.pScreen;
-
- if(!pixPriv->pix32) {
- PixmapPtr newPix;
-
- newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width,
- pix8->drawable.height, 24);
- newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */
- pixPriv->pix32 = newPix;
- }
-
- if(pixPriv->dirty) {
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
- GCPtr pGC;
-
- pGC = GetScratchGC(8, pScreen);
-
- pScreenPriv->LockPrivate++; /* don't modify this one */
- ValidateGC((DrawablePtr)pixPriv->pix32, pGC);
-
- (*pGC->ops->CopyArea)((DrawablePtr)pix8, (DrawablePtr)pixPriv->pix32,
- pGC, 0, 0, pix8->drawable.width, pix8->drawable.height, 0, 0);
- pScreenPriv->LockPrivate--;
- FreeScratchGC(pGC);
-
- pixPriv->dirty &= ~IS_DIRTY;
- pixPriv->pix32->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
-
- return pixPriv->pix32;
-}
-
-
-static void
-OverlayValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pGC->pScreen);
- OVERLAY_GC_FUNC_PROLOGUE (pGC);
-
- if(pScreenPriv->LockPrivate < 0) {
- ErrorF("Something is wrong in OverlayValidateGC!\n");
- pScreenPriv->LockPrivate = 0;
- }
-
- if(pGC->depth == 24) {
- unsigned long oldpm = pGC->planemask;
- pGCPriv->overlayOps = NULL;
-
- if(pDraw->type == DRAWABLE_WINDOW)
- pGC->planemask &= 0x00ffffff;
- else
- pGC->planemask |= 0xff000000;
-
- if(oldpm != pGC->planemask) changes |= GCPlaneMask;
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
-
- } else { /* depth == 8 */
- unsigned long newChanges = 0;
-
- if(pDraw->bitsPerPixel == 32) {
-
- if(pGC->fillStyle == FillTiled)
- pGCPriv->tile = OverlayRefreshPixmap(pGC->tile.pixmap);
- else pGCPriv->tile = NULL;
-
- if(pGCPriv->overlayOps != &WindowGCOps) {
- newChanges = GCForeground | GCBackground | GCPlaneMask;
- if(pGCPriv->tile)
- newChanges |= GCTile;
- }
- pGCPriv->overlayOps = &WindowGCOps;
-
- if(!pScreenPriv->LockPrivate) {
- unsigned long oldfg = pGC->fgPixel;
- unsigned long oldbg = pGC->bgPixel;
- unsigned long oldpm = pGC->planemask;
- PixmapPtr oldtile = pGC->tile.pixmap;
-
- pGC->fgPixel = pGCPriv->fg = oldfg << 24;
- pGC->bgPixel = pGCPriv->bg = oldbg << 24;
- pGC->planemask = pGCPriv->pm = oldpm << 24;
- if(pGCPriv->tile)
- pGC->tile.pixmap = pGCPriv->tile;
-
- (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
-
- pGC->fgPixel = oldfg;
- pGC->bgPixel = oldbg;
- pGC->planemask = oldpm;
- pGC->tile.pixmap = oldtile;
- } else {
- pGCPriv->fg = pGC->fgPixel;
- pGCPriv->bg = pGC->bgPixel;
- pGCPriv->pm = pGC->planemask;
-
- (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
- }
-
- } else { /* bitsPerPixel == 8 */
- if(pGCPriv->overlayOps == &WindowGCOps) {
- newChanges = GCForeground | GCBackground | GCPlaneMask;
- if(pGCPriv->tile)
- newChanges |= GCTile;
- }
- pGCPriv->overlayOps = &PixmapGCOps;
-
- (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
- }
- }
-
- OVERLAY_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-static void
-OverlayDestroyGC(GCPtr pGC)
-{
- OVERLAY_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->DestroyGC)(pGC);
- OVERLAY_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-OverlayChangeGC (
- GCPtr pGC,
- unsigned long mask
-){
- OVERLAY_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- OVERLAY_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-OverlayCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-){
- OVERLAY_GC_FUNC_PROLOGUE (pGCDst);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- OVERLAY_GC_FUNC_EPILOGUE (pGCDst);
-}
-static void
-OverlayChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-){
- OVERLAY_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- OVERLAY_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-OverlayCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- OVERLAY_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- OVERLAY_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-OverlayDestroyClip(GCPtr pGC)
-{
- OVERLAY_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- OVERLAY_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-
-/******************* Window GC ops ***********************/
-
-static void
-WindowFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowSetSpans(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-WindowCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- RegionPtr ret;
-
- WINDOW_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- WINDOW_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static RegionPtr
-WindowCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- RegionPtr ret;
-
- WINDOW_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- WINDOW_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-WindowPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static int
-WindowPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int ret;
-
- WINDOW_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- WINDOW_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static int
-WindowPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int ret;
-
- WINDOW_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- WINDOW_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-WindowImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-WindowPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- WINDOW_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- WINDOW_GC_OP_EPILOGUE(pGC);
-}
-
-
-/******************* Pixmap GC ops ***********************/
-
-static void
-PixmapFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapSetSpans(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-PixmapCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDraw,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- RegionPtr ret;
-
- PIXMAP_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->CopyArea)(pSrc, pDraw,
- pGC, srcx, srcy, width, height, dstx, dsty);
- PIXMAP_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static RegionPtr
-PixmapCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDraw,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- RegionPtr ret;
-
- PIXMAP_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->CopyPlane)(pSrc, pDraw,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- PIXMAP_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-PixmapPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static int
-PixmapPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int ret;
-
- PIXMAP_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- PIXMAP_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static int
-PixmapPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int ret;
-
- PIXMAP_GC_OP_PROLOGUE(pGC);
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- PIXMAP_GC_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-PixmapImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-static void
-PixmapPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- PIXMAP_GC_OP_PROLOGUE(pGC);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- PIXMAP_GC_OP_EPILOGUE(pGC);
-}
-
-
diff --git a/hw/xfree86/xf8_32wid/cfb8_32wid.h b/hw/xfree86/xf8_32wid/cfb8_32wid.h
deleted file mode 100644
index 9913c2a6c..000000000
--- a/hw/xfree86/xf8_32wid/cfb8_32wid.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfb8_32wid.h,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
-
-#ifndef _CFB8_32WID_H
-#define _CFB8_32WID_H
-
-#include "regionstr.h"
-#include "windowstr.h"
-
-typedef struct {
- unsigned int (*WidGet)(WindowPtr);
- Bool (*WidAlloc)(WindowPtr);
- void (*WidFree)(WindowPtr);
- void (*WidFillBox)(DrawablePtr, DrawablePtr, int, BoxPtr);
- void (*WidCopyArea)(DrawablePtr, RegionPtr, DDXPointPtr);
-} cfb8_32WidOps;
-
-typedef struct {
- pointer pix8;
- int width8;
- pointer pix32;
- int width32;
-
- /* WID information */
- pointer pixWid;
- int widthWid;
- int bitsPerWid;
- cfb8_32WidOps *WIDOps;
-} cfb8_32WidScreenRec, *cfb8_32WidScreenPtr;
-
-extern int cfb8_32WidScreenPrivateIndex;
-
-Bool
-cfb8_32WidScreenInit (
- ScreenPtr pScreen,
- pointer pbits32,
- pointer pbits8,
- pointer pbitsWid,
- int xsize, int ysize,
- int dpix, int dpiy,
- int width32,
- int width8,
- int widthWid,
- int bitsPerWid,
- cfb8_32WidOps *WIDOps
-);
-
-/* cfbwindow.c */
-
-void
-cfb8_32WidPaintWindow (
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-);
-
-Bool cfb8_32WidCreateWindow(WindowPtr pWin);
-Bool cfb8_32WidDestroyWindow(WindowPtr pWin);
-
-Bool
-cfb8_32WidPositionWindow(
- WindowPtr pWin,
- int x, int y
-);
-
-void
-cfb8_32WidCopyWindow(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-);
-
-Bool
-cfb8_32WidChangeWindowAttributes(
- WindowPtr pWin,
- unsigned long mask
-);
-
-void
-cfb8_32WidWindowExposures(
- WindowPtr pWin,
- RegionPtr pReg,
- RegionPtr pOtherReg
-);
-
-/* cfbwid.c */
-
-Bool
-cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv);
-
-#define CFB8_32WID_GET_SCREEN_PRIVATE(pScreen)\
- (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidScreenPrivateIndex].ptr)
-
-#endif /* _CFB8_32WID_H */
diff --git a/hw/xfree86/xf8_32wid/cfb8_32widmodule.c b/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
deleted file mode 100644
index 5a47b9ff5..000000000
--- a/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfb8_32widmodule.c,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
-
-#ifdef XFree86LOADER
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(xf8_32widSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
- "xf8_32wid",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_ANSIC, /* Only need the ansic layer */
- ABI_ANSIC_VERSION,
- NULL,
- {0,0,0,0} /* signature, to be patched into the file by a tool */
-};
-
-XF86ModuleData xf8_32widModuleData = { &VersRec, xf8_32widSetup, NULL };
-
-static pointer
-xf8_32widSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- if (!LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb16", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb24", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL,
- errmaj, errmin))
- return NULL;
- return (pointer)1; /* non-NULL required to indicate success */
-}
-
-#endif
diff --git a/hw/xfree86/xf8_32wid/cfbscrinit.c b/hw/xfree86/xf8_32wid/cfbscrinit.c
deleted file mode 100644
index 93c15371d..000000000
--- a/hw/xfree86/xf8_32wid/cfbscrinit.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
-
- Written by David S. Miller (davem@redhat.com)
-
- Based largely upon the xf8_16bpp module which is
- Mark Vojkovich's work.
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbscrinit.c,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32wid.h"
-#include "mi.h"
-#include "micmap.h"
-#include "mistruct.h"
-#include "gcstruct.h"
-#include "dix.h"
-#include "mibstore.h"
-#include "xf86str.h"
-#include "xf86.h"
-
-/* CAUTION: We require that cfb8 and cfb32 were NOT
- compiled with CFB_NEED_SCREEN_PRIVATE */
-
-int cfb8_32WidScreenPrivateIndex;
-
-static unsigned long cfb8_32WidGeneration = 0;
-extern WindowPtr *WindowTable;
-
-static PixmapPtr cfb8_32WidGetWindowPixmap(WindowPtr pWin);
-
-static void
-cfb8_32WidSaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-static void
-cfb8_32WidRestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-);
-
-static BSFuncRec cfb8_32WidBSFuncRec = {
- cfb8_32WidSaveAreas,
- cfb8_32WidRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-static void
-cfb8_32WidGetSpans(
- DrawablePtr pDraw,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pchardstStart
-);
-
-static void
-cfb8_32WidGetImage (
- DrawablePtr pDraw,
- int sx, int sy, int w, int h,
- unsigned int format,
- unsigned long planeMask,
- char *pdstLine
-);
-
-static Bool cfb8_32WidCreateGC(GCPtr pGC);
-static void cfb8_32WidEnableDisableFBAccess(int index, Bool enable);
-
-
-static Bool
-cfb8_32WidAllocatePrivates(ScreenPtr pScreen)
-{
- cfb8_32WidScreenPtr pScreenPriv;
-
- if (cfb8_32WidGeneration != serverGeneration) {
- if ((cfb8_32WidScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- cfb8_32WidGeneration = serverGeneration;
- }
-
- if (!(pScreenPriv = xalloc(sizeof(cfb8_32WidScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[cfb8_32WidScreenPrivateIndex].ptr = (pointer)pScreenPriv;
-
- /* All cfb will have the same GC and Window private indicies */
- if (!mfbAllocatePrivates(pScreen, &cfbWindowPrivateIndex, &cfbGCPrivateIndex))
- return FALSE;
-
- /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
- if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, sizeof(cfbPrivWin)))
- return FALSE;
-
- if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
- return FALSE;
-
- return TRUE;
-}
-
-static Bool
-cfb8_32WidSetupScreen(
- ScreenPtr pScreen,
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy
-){
- if (!cfb8_32WidAllocatePrivates(pScreen))
- return FALSE;
-
- pScreen->defColormap = FakeClientID(0);
-
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = mfbQueryBestSize;
-
- /* SaveScreen */
- pScreen->GetImage = cfb8_32WidGetImage;
- pScreen->GetSpans = cfb8_32WidGetSpans;
- pScreen->CreateWindow = cfb8_32WidCreateWindow;
- pScreen->DestroyWindow = cfb8_32WidDestroyWindow;
- pScreen->PositionWindow = cfb8_32WidPositionWindow;
- pScreen->ChangeWindowAttributes = cfb8_32WidChangeWindowAttributes;
- pScreen->RealizeWindow = cfb32MapWindow; /* OK */
- pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
- pScreen->PaintWindowBackground = cfb8_32WidPaintWindow;
- pScreen->PaintWindowBorder = cfb8_32WidPaintWindow;
- pScreen->CopyWindow = cfb8_32WidCopyWindow;
- pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
- pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = cfb8_32WidCreateGC;
- pScreen->CreateColormap = miInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
- pScreen->InstallColormap = miInstallColormap;
- pScreen->UninstallColormap = miUninstallColormap;
- pScreen->ListInstalledColormaps = miListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
- pScreen->ResolveColor = miResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
- return TRUE;
-}
-
-static Bool
-cfb8_32WidCreateScreenResources(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
- PixmapPtr pix8, pix32, pixWid;
-
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
-
- pix8 = (*pScreen->CreatePixmap)(pScreen, 0, 0, 8);
- pix32 = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth);
- pixWid = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreenPriv->bitsPerWid);
- if (!pix32 || !pix8 || !pixWid)
- return FALSE;
-
- pix8->drawable.width = pScreen->width;
- pix8->drawable.height = pScreen->height;
- pix8->devKind = pScreenPriv->width8;
- pix8->devPrivate.ptr = pScreenPriv->pix8;
-
- pix32->drawable.width = pScreen->width;
- pix32->drawable.height = pScreen->height;
- pix32->devKind = pScreenPriv->width32 * 4;
- pix32->devPrivate.ptr = pScreenPriv->pix32;
-
- pixWid->drawable.width = pScreen->width;
- pixWid->drawable.height = pScreen->height;
- pixWid->devKind = (pScreenPriv->widthWid * pScreenPriv->bitsPerWid) / 8;
- pixWid->devPrivate.ptr = pScreenPriv->pixWid;
-
- pScreenPriv->pix8 = (pointer) pix8;
- pScreenPriv->pix32 = (pointer) pix32;
- pScreenPriv->pixWid = (pointer) pixWid;
-
- pScreen->devPrivate = (pointer) pix32;
-
- return TRUE;
-}
-
-
-static Bool
-cfb8_32WidCloseScreen (int i, ScreenPtr pScreen)
-{
- cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
-
- xfree((pointer) pScreenPriv);
-
- return cfb32CloseScreen(i, pScreen);
-}
-
-static Bool
-cfb8_32WidFinishScreenInit(
- ScreenPtr pScreen,
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy /* dots per inch */
-){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- if (!miInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(32-1)), 8, -1))
- return FALSE;
-
- if (!miScreenInit(pScreen, NULL, xsize, ysize, dpix, dpiy, 0,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals))
- return FALSE;
-
- pScreen->BackingStoreFuncs = cfb8_32WidBSFuncRec;
- pScreen->CreateScreenResources = cfb8_32WidCreateScreenResources;
- pScreen->CloseScreen = cfb8_32WidCloseScreen;
- pScreen->GetWindowPixmap = cfb8_32WidGetWindowPixmap;
- pScreen->WindowExposures = cfb8_32WidWindowExposures;
-
- pScrn->EnableDisableFBAccess = cfb8_32WidEnableDisableFBAccess;
-
- return TRUE;
-}
-
-Bool
-cfb8_32WidScreenInit(
- ScreenPtr pScreen,
- pointer pbits32, /* pointer to screen bitmap */
- pointer pbits8,
- pointer pbitsWid, /* pointer to WID bitmap */
- int xsize, int ysize, /* in pixels */
- int dpix, int dpiy, /* dots per inch */
- int width32, /* pixel width of frame buffer */
- int width8,
- int widthWid,
- int bitsPerWid,
- cfb8_32WidOps *WIDOps
-){
- cfb8_32WidScreenPtr pScreenPriv;
-
- if (!WIDOps || !WIDOps->WidGet || !WIDOps->WidAlloc || !WIDOps->WidFree)
- return FALSE;
-
- if (!cfb8_32WidSetupScreen(pScreen, xsize, ysize, dpix, dpiy))
- return FALSE;
-
- pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
- pScreenPriv->pix8 = pbits8;
- pScreenPriv->pix32 = pbits32;
- pScreenPriv->pixWid = pbitsWid;
- pScreenPriv->width8 = width8;
- pScreenPriv->width32 = width32;
- pScreenPriv->widthWid = widthWid;
- pScreenPriv->bitsPerWid = bitsPerWid;
-
- pScreenPriv->WIDOps = xalloc(sizeof(cfb8_32WidOps));
- if (!pScreenPriv->WIDOps)
- return FALSE;
-
- *(pScreenPriv->WIDOps) = *WIDOps;
-
- if (!WIDOps->WidFillBox || !WIDOps->WidCopyArea)
- cfb8_32WidGenericOpsInit(pScreenPriv);
-
- return cfb8_32WidFinishScreenInit(pScreen, xsize, ysize, dpix, dpiy);
-}
-
-static PixmapPtr
-cfb8_32WidGetWindowPixmap(WindowPtr pWin)
-{
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
-
- return ((pWin->drawable.bitsPerPixel == 8) ?
- (PixmapPtr) pScreenPriv->pix8 : (PixmapPtr) pScreenPriv->pix32);
-}
-
-static void
-cfb8_32WidGetImage (DrawablePtr pDraw, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planemask, char *pdstLine)
-{
- if (!w || !h)
- return;
-
- if (pDraw->bitsPerPixel == 8)
- cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
- else
- cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
-}
-
-static void
-cfb8_32WidGetSpans(DrawablePtr pDraw, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pDst)
-{
- if (pDraw->bitsPerPixel == 8)
- cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
- else
- cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
-}
-
-static void
-cfb8_32WidSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin)
-{
- if (pWin->drawable.bitsPerPixel == 8)
- cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
- else
- cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
-}
-
-static void
-cfb8_32WidRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin)
-{
- if (pWin->drawable.bitsPerPixel == 8)
- cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
- else
- cfb32RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
-}
-
-
-static Bool
-cfb8_32WidCreateGC(GCPtr pGC)
-{
- if (pGC->depth == 8)
- return cfbCreateGC(pGC);
- else
- return cfb32CreateGC(pGC);
-}
-
-static void
-cfb8_32WidEnableDisableFBAccess(int index, Bool enable)
-{
- ScreenPtr pScreen = xf86Screens[index]->pScreen;
- cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
- static DevUnion devPrivates8[MAXSCREENS];
- static DevUnion devPrivates32[MAXSCREENS];
- PixmapPtr pix8, pix32;
-
- pix8 = (PixmapPtr) pScreenPriv->pix8;
- pix32 = (PixmapPtr) pScreenPriv->pix32;
-
- if (enable) {
- pix8->devPrivate = devPrivates8[index];
- pix32->devPrivate = devPrivates32[index];
- }
-
- xf86EnableDisableFBAccess (index, enable);
-
- if (!enable) {
- devPrivates8[index] = pix8->devPrivate;
- pix8->devPrivate.ptr = 0;
- devPrivates32[index] = pix32->devPrivate;
- pix32->devPrivate.ptr = 0;
- }
-}
diff --git a/hw/xfree86/xf8_32wid/cfbwid.c b/hw/xfree86/xf8_32wid/cfbwid.c
deleted file mode 100644
index 0aa894176..000000000
--- a/hw/xfree86/xf8_32wid/cfbwid.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwid.c,v 1.1 2000/05/21 01:02:44 mvojkovi Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-
-#include "mfb.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb24.h"
-#include "cfb32.h"
-
-#include "cfb8_32wid.h"
-
-static void
-WidFillBox1(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
-{
- WindowPtr pWin = (WindowPtr) pWinDraw;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
-
- if (wid & 1)
- mfbSolidWhiteArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
- else
- mfbSolidBlackArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
-}
-
-static void
-WidCopyArea1(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
-{
- mfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc);
-}
-
-static void
-WidFillBox8(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
-{
- WindowPtr pWin = (WindowPtr) pWinDraw;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
-
- cfbFillBoxSolid(pixWid, nbox, pBox, wid);
-}
-
-static void
-WidCopyArea8(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
-{
- cfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
-}
-
-static void
-WidFillBox16(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
-{
- WindowPtr pWin = (WindowPtr) pWinDraw;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
-
- cfb16FillBoxSolid(pixWid, nbox, pBox, wid);
-}
-
-static void
-WidCopyArea16(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
-{
- cfb16DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
-}
-
-static void
-WidFillBox24(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
-{
- WindowPtr pWin = (WindowPtr) pWinDraw;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
-
- cfb24FillBoxSolid(pixWid, nbox, pBox, wid);
-}
-
-static void
-WidCopyArea24(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
-{
- cfb24DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
-}
-
-static void
-WidFillBox32(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
-{
- WindowPtr pWin = (WindowPtr) pWinDraw;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
- unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
-
- cfb32FillBoxSolid(pixWid, nbox, pBox, wid);
-}
-
-static void
-WidCopyArea32(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
-{
- cfb32DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
-}
-
-Bool
-cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv)
-{
- cfb8_32WidOps *WIDOps = pScreenPriv->WIDOps;
-
- switch (pScreenPriv->bitsPerWid) {
- case 1:
- WIDOps->WidFillBox = WidFillBox1;
- WIDOps->WidCopyArea = WidCopyArea1;
- break;
-
- case 8:
- WIDOps->WidFillBox = WidFillBox8;
- WIDOps->WidCopyArea = WidCopyArea8;
- break;
-
- case 16:
- WIDOps->WidFillBox = WidFillBox16;
- WIDOps->WidCopyArea = WidCopyArea16;
- break;
-
- case 24:
- WIDOps->WidFillBox = WidFillBox24;
- WIDOps->WidCopyArea = WidCopyArea24;
- break;
-
- case 32:
- WIDOps->WidFillBox = WidFillBox32;
- WIDOps->WidCopyArea = WidCopyArea32;
- break;
-
- default:
- return FALSE;
- };
-
- return TRUE;
-}
diff --git a/hw/xfree86/xf8_32wid/cfbwindow.c b/hw/xfree86/xf8_32wid/cfbwindow.c
deleted file mode 100644
index b7ac739b3..000000000
--- a/hw/xfree86/xf8_32wid/cfbwindow.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
-
- Written by David S. Miller (davem@redhat.com)
-
- Based largely upon the xf8_16bpp module which is
- Mark Vojkovich's work.
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.3 2003/11/10 18:22:43 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
-#include "cfb8_32wid.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "cfbmskbits.h"
-#include "xf86.h"
-
-/* We don't bother with cfb's fastBackground/Border so we don't
- need to use the Window privates */
-
-Bool
-cfb8_32WidCreateWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
- cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
-
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-
- if (!pScreenPriv->WIDOps->WidAlloc(pWin))
- return FALSE;
-
- return TRUE;
-}
-
-
-Bool
-cfb8_32WidDestroyWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
-
- pScreenPriv->WIDOps->WidFree(pWin);
- return TRUE;
-}
-
-Bool
-cfb8_32WidPositionWindow(WindowPtr pWin, int x, int y)
-{
- return TRUE;
-}
-
-static void
-SegregateChildrenBpp(WindowPtr pWin, RegionPtr pReg, int subtract, int bpp, int other_bpp)
-{
- WindowPtr pChild;
-
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
- if (pChild->drawable.bitsPerPixel == bpp) {
- if (subtract) {
- REGION_SUBTRACT(pWin->drawable.pScreen, pReg,
- pReg, &pChild->borderClip);
- } else {
- REGION_UNION(pWin->drawable.pScreen, pReg,
- pReg, &pChild->borderClip);
- }
- if (pChild->firstChild)
- SegregateChildrenBpp(pChild, pReg,
- !subtract, other_bpp, bpp);
- } else {
- if (pChild->firstChild)
- SegregateChildrenBpp(pChild, pReg,
- subtract, bpp, other_bpp);
- }
- }
-}
-
-void
-cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- PixmapPtr pPixChildren;
- DDXPointPtr ppt, pptSrc;
- RegionRec rgnDst, rgnOther, rgnPixmap;
- BoxPtr pbox;
- int i, nbox, dx, dy, other_bpp;
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- if ((nbox = REGION_NUM_RECTS(&rgnDst)) == 0) {
- /* Nothing to render. */
- REGION_UNINIT(pScreen, &rgnDst);
- return;
- }
-
- /* First, copy the WID plane for the whole area. */
- pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
- if(pptSrc) {
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- pScreenPriv->WIDOps->WidCopyArea((DrawablePtr)pScreenPriv->pixWid,
- &rgnDst, pptSrc);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- /* Next, we copy children which have a different
- * bpp than pWin into a temporary pixmap. We will
- * toss this pixmap back onto the framebuffer before
- * we return.
- */
- if (pWin->drawable.bitsPerPixel == 8)
- other_bpp = pScrn->bitsPerPixel;
- else
- other_bpp = 8;
-
- REGION_NULL(pScreen, &rgnOther);
- SegregateChildrenBpp(pWin, &rgnOther, 0,
- other_bpp, pWin->drawable.bitsPerPixel);
- pPixChildren = NULL;
- if (REGION_NOTEMPTY(pScreen, &rgnOther)) {
- REGION_INTERSECT(pScreen, &rgnOther, &rgnOther, prgnSrc);
- nbox = REGION_NUM_RECTS(&rgnOther);
- if (nbox) {
- int width = rgnOther.extents.x2 - rgnOther.extents.x1;
- int height = rgnOther.extents.y2 - rgnOther.extents.y1;
- int depth = (other_bpp == 8) ? 8 : pScrn->depth;
-
- if (other_bpp == 8)
- pPixChildren = cfbCreatePixmap(pScreen, width, height, depth);
- else
- pPixChildren = cfb32CreatePixmap(pScreen, width, height, depth);
- }
- if (nbox &&
- pPixChildren &&
- (pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
- pbox = REGION_RECTS(&rgnOther);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- REGION_NULL(pScreen, &rgnPixmap);
- REGION_COPY(pScreen, &rgnPixmap, &rgnOther);
- REGION_TRANSLATE(pScreen, &rgnPixmap, -(rgnOther.extents.x1), -(rgnOther.extents.y1));
-
- if (other_bpp == 8)
- cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
- (DrawablePtr)pPixChildren,
- GXcopy, &rgnPixmap, pptSrc, ~0L);
- else
- cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
- (DrawablePtr)pPixChildren,
- GXcopy, &rgnPixmap, pptSrc, ~0L);
-
- REGION_UNINIT(pScreen, &rgnPixmap);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- REGION_SUBTRACT(pScreen, &rgnDst, &rgnDst, &rgnOther);
- }
-
- /* Now copy the parent along with all child windows using the same depth. */
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(nbox &&
- (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
- pbox = REGION_RECTS(&rgnDst);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- if (pWin->drawable.bitsPerPixel == 8)
- cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
- (DrawablePtr)pScreenPriv->pix8,
- GXcopy, &rgnDst, pptSrc, ~0L);
- else
- cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
- (DrawablePtr)pScreenPriv->pix32,
- GXcopy, &rgnDst, pptSrc, ~0L);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- REGION_UNINIT(pScreen, &rgnDst);
-
- if (pPixChildren) {
- nbox = REGION_NUM_RECTS(&rgnOther);
- pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
- if (pptSrc) {
- pbox = REGION_RECTS(&rgnOther);
- for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
- ppt->x = pbox->x1 - rgnOther.extents.x1;
- ppt->y = pbox->y1 - rgnOther.extents.y1;
- }
-
- if (other_bpp == 8)
- cfbDoBitbltCopy((DrawablePtr)pPixChildren,
- (DrawablePtr)pScreenPriv->pix8,
- GXcopy, &rgnOther, pptSrc, ~0L);
- else
- cfb32DoBitbltCopy((DrawablePtr)pPixChildren,
- (DrawablePtr)pScreenPriv->pix32,
- GXcopy, &rgnOther, pptSrc, ~0L);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- if (other_bpp == 8)
- cfbDestroyPixmap(pPixChildren);
- else
- cfb32DestroyPixmap(pPixChildren);
- }
- REGION_UNINIT(pScreen, &rgnOther);
-}
-
-Bool
-cfb8_32WidChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
- return TRUE;
-}
-
-void
-cfb8_32WidWindowExposures(WindowPtr pWin, RegionPtr pReg, RegionPtr pOtherReg)
-{
- /* Fill in the WID channel before rendering of
- * the exposed window area.
- */
- if (REGION_NUM_RECTS(pReg)) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
-
- pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
- (DrawablePtr)pWin,
- REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
- }
-
- miWindowExposures(pWin, pReg, pOtherReg);
-}
-
-void
-cfb8_32WidPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- if (what == PW_BORDER) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
- cfb8_32WidScreenPtr pScreenPriv =
- CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
-
- pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
- (DrawablePtr)pWin,
- REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion));
- }
-
- if (pWin->drawable.bitsPerPixel == 8)
- cfbPaintWindow(pWin, pRegion, what);
- else
- cfb32PaintWindow(pWin, pRegion, what);
-}
-
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c
deleted file mode 100644
index 488179d01..000000000
--- a/hw/xnest/Args.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* $Xorg: Args.c,v 1.3 2000/08/17 19:53:26 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Args.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Args.h"
-
-char *xnestDisplayName = NULL;
-Bool xnestSynchronize = False;
-Bool xnestFullGeneration = False;
-int xnestDefaultClass;
-Bool xnestUserDefaultClass = False;
-int xnestDefaultDepth;
-Bool xnestUserDefaultDepth = False;
-Bool xnestSoftwareScreenSaver = False;
-int xnestX;
-int xnestY;
-unsigned int xnestWidth;
-unsigned int xnestHeight;
-int xnestUserGeometry = 0;
-int xnestBorderWidth;
-Bool xnestUserBorderWidth = False;
-char *xnestWindowName = NULL;
-int xnestNumScreens = 0;
-Bool xnestDoDirectColormaps = False;
-Window xnestParentWindow = 0;
-
-int
-ddxProcessArgument (int argc, char *argv[], int i)
-{
- if (!strcmp(argv[i], "-display")) {
- if (++i < argc) {
- xnestDisplayName = argv[i];
- return 2;
- }
- return 0;
- }
- if (!strcmp(argv[i], "-sync")) {
- xnestSynchronize = True;
- return 1;
- }
- if (!strcmp(argv[i], "-full")) {
- xnestFullGeneration = True;
- return 1;
- }
- if (!strcmp(argv[i], "-class")) {
- if (++i < argc) {
- if (!strcmp(argv[i], "StaticGray")) {
- xnestDefaultClass = StaticGray;
- xnestUserDefaultClass = True;
- return 2;
- }
- else if (!strcmp(argv[i], "GrayScale")) {
- xnestDefaultClass = GrayScale;
- xnestUserDefaultClass = True;
- return 2;
- }
- else if (!strcmp(argv[i], "StaticColor")) {
- xnestDefaultClass = StaticColor;
- xnestUserDefaultClass = True;
- return 2;
- }
- else if (!strcmp(argv[i], "PseudoColor")) {
- xnestDefaultClass = PseudoColor;
- xnestUserDefaultClass = True;
- return 2;
- }
- else if (!strcmp(argv[i], "TrueColor")) {
- xnestDefaultClass = TrueColor;
- xnestUserDefaultClass = True;
- return 2;
- }
- else if (!strcmp(argv[i], "DirectColor")) {
- xnestDefaultClass = DirectColor;
- xnestUserDefaultClass = True;
- return 2;
- }
- }
- return 0;
- }
- if (!strcmp(argv[i], "-cc")) {
- if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultClass) == 1) {
- if (xnestDefaultClass >= 0 && xnestDefaultClass <= 5) {
- xnestUserDefaultClass = True;
- /* lex the OS layer process it as well, so return 0 */
- }
- }
- return 0;
- }
- if (!strcmp(argv[i], "-depth")) {
- if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultDepth) == 1) {
- if (xnestDefaultDepth > 0) {
- xnestUserDefaultDepth = True;
- return 2;
- }
- }
- return 0;
- }
- if (!strcmp(argv[i], "-sss")) {
- xnestSoftwareScreenSaver = True;
- return 1;
- }
- if (!strcmp(argv[i], "-geometry")) {
- if (++i < argc) {
- xnestUserGeometry = XParseGeometry(argv[i],
- &xnestX, &xnestY,
- &xnestWidth, &xnestHeight);
- if (xnestUserGeometry) return 2;
- }
- return 0;
- }
- if (!strcmp(argv[i], "-bw")) {
- if (++i < argc && sscanf(argv[i], "%i", &xnestBorderWidth) == 1) {
- if (xnestBorderWidth >= 0) {
- xnestUserBorderWidth = True;
- return 2;
- }
- }
- return 0;
- }
- if (!strcmp(argv[i], "-name")) {
- if (++i < argc) {
- xnestWindowName = argv[i];
- return 2;
- }
- return 0;
- }
- if (!strcmp(argv[i], "-scrns")) {
- if (++i < argc && sscanf(argv[i], "%i", &xnestNumScreens) == 1) {
- if (xnestNumScreens > 0) {
- if (xnestNumScreens > MAXSCREENS) {
- ErrorF("Maximum number of screens is %d.\n", MAXSCREENS);
- xnestNumScreens = MAXSCREENS;
- }
- return 2;
- }
- }
- return 0;
- }
- if (!strcmp(argv[i], "-install")) {
- xnestDoDirectColormaps = True;
- return 1;
- }
- if (!strcmp(argv[i], "-parent")) {
- if (++i < argc) {
- xnestParentWindow = (XID) strtol (argv[i], (char**)NULL, 0);
- return 2;
- }
- }
- return 0;
-}
-
-void ddxUseMsg()
-{
- ErrorF("-display string display name of the real server\n");
- ErrorF("-sync sinchronize with the real server\n");
- ErrorF("-full utilize full regeneration\n");
- ErrorF("-class string default visual class\n");
- ErrorF("-depth int default depth\n");
- ErrorF("-sss use software screen saver\n");
- ErrorF("-geometry WxH+X+Y window size and position\n");
- ErrorF("-bw int window border width\n");
- ErrorF("-name string window name\n");
- ErrorF("-scrns int number of screens to generate\n");
- ErrorF("-install instal colormaps directly\n");
-}
diff --git a/hw/xnest/Args.h b/hw/xnest/Args.h
deleted file mode 100644
index dc2ac9de0..000000000
--- a/hw/xnest/Args.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $Xorg: Args.h,v 1.3 2000/08/17 19:53:27 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Args.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTARGC_H
-#define XNESTARGS_H
-
-extern char *xnestDisplayName;
-extern Bool xnestSynchronize;
-extern Bool xnestFullGeneration;
-extern int xnestDefaultClass;
-extern Bool xnestUserDefaultClass;
-extern int xnestDefaultDepth;
-extern Bool xnestUserDefaultDepth;
-extern Bool xnestSoftwareScreenSaver;
-extern int xnestX;
-extern int xnestY;
-extern unsigned int xnestWidth;
-extern unsigned int xnestHeight;
-extern int xnestUserGeometry;
-extern int xnestBorderWidth;
-extern Bool xnestUserBorderWidth;
-extern char *xnestWindowName;
-extern int xnestNumScreens;
-extern Bool xnestDoDirectColormaps;
-extern Window xnestParentWindow;
-
-#endif /* XNESTARGS_H */
diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c
deleted file mode 100644
index ae5ded5e3..000000000
--- a/hw/xnest/Color.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/* $Xorg: Color.c,v 1.3 2000/08/17 19:53:27 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Color.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "window.h"
-#include "windowstr.h"
-#include "colormapst.h"
-#include "resource.h"
-
-#include "Xnest.h"
-
-
-#include "Display.h"
-#include "Screen.h"
-#include "Color.h"
-#include "Visual.h"
-#include "XNWindow.h"
-#include "Args.h"
-
-static ColormapPtr InstalledMaps[MAXSCREENS];
-
-Bool
-xnestCreateColormap(ColormapPtr pCmap)
-{
- VisualPtr pVisual;
- XColor *colors;
- int i, ncolors;
- Pixel red, green, blue;
- Pixel redInc, greenInc, blueInc;
-
- pVisual = pCmap->pVisual;
- ncolors = pVisual->ColormapEntries;
-
- pCmap->devPriv = (pointer)xalloc(sizeof(xnestPrivColormap));
-
- xnestColormapPriv(pCmap)->colormap =
- XCreateColormap(xnestDisplay,
- xnestDefaultWindows[pCmap->pScreen->myNum],
- xnestVisual(pVisual),
- (pVisual->class & DynamicClass) ?
- AllocAll : AllocNone);
-
-
- switch (pVisual->class) {
- case StaticGray: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
- for (i = 0; i < ncolors; i++)
- colors[i].pixel = i;
- XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
- for (i = 0; i < ncolors; i++) {
- pCmap->red[i].co.local.red = colors[i].red;
- pCmap->red[i].co.local.green = colors[i].red;
- pCmap->red[i].co.local.blue = colors[i].red;
- }
- xfree(colors);
- break;
-
- case StaticColor: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
- for (i = 0; i < ncolors; i++)
- colors[i].pixel = i;
- XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
- for (i = 0; i < ncolors; i++) {
- pCmap->red[i].co.local.red = colors[i].red;
- pCmap->red[i].co.local.green = colors[i].green;
- pCmap->red[i].co.local.blue = colors[i].blue;
- }
- xfree(colors);
- break;
-
- case TrueColor: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
- red = green = blue = 0L;
- redInc = lowbit(pVisual->redMask);
- greenInc = lowbit(pVisual->greenMask);
- blueInc = lowbit(pVisual->blueMask);
- for (i = 0; i < ncolors; i++) {
- colors[i].pixel = red | green | blue;
- red += redInc;
- if (red > pVisual->redMask) red = 0L;
- green += greenInc;
- if (green > pVisual->greenMask) green = 0L;
- blue += blueInc;
- if (blue > pVisual->blueMask) blue = 0L;
- }
- XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
- for (i = 0; i < ncolors; i++) {
- pCmap->red[i].co.local.red = colors[i].red;
- pCmap->green[i].co.local.green = colors[i].green;
- pCmap->blue[i].co.local.blue = colors[i].blue;
- }
- xfree(colors);
- break;
-
- case GrayScale: /* read and write */
- break;
-
- case PseudoColor: /* read and write */
- break;
-
- case DirectColor: /* read and write */
- break;
- }
-
- return True;
-}
-
-void
-xnestDestroyColormap(ColormapPtr pCmap)
-{
- XFreeColormap(xnestDisplay, xnestColormap(pCmap));
- xfree(pCmap->devPriv);
-}
-
-#define SEARCH_PREDICATE \
- (xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i])
-
-static int
-xnestCountInstalledColormapWindows(WindowPtr pWin, pointer ptr)
-{
- xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr;
- int i;
-
- for (i = 0; i < icws->numCmapIDs; i++)
- if (SEARCH_PREDICATE) {
- icws->numWindows++;
- return WT_DONTWALKCHILDREN;
- }
-
- return WT_WALKCHILDREN;
-}
-
-static int
-xnestGetInstalledColormapWindows(WindowPtr pWin, pointer ptr)
-{
- xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr;
- int i;
-
- for (i = 0; i < icws->numCmapIDs; i++)
- if (SEARCH_PREDICATE) {
- icws->windows[icws->index++] = xnestWindow(pWin);
- return WT_DONTWALKCHILDREN;
- }
-
- return WT_WALKCHILDREN;
-}
-
-static Window *xnestOldInstalledColormapWindows = NULL;
-static int xnestNumOldInstalledColormapWindows = 0;
-
-static Bool
-xnestSameInstalledColormapWindows(Window *windows, int numWindows)
-{
- if (xnestNumOldInstalledColormapWindows != numWindows)
- return False;
-
- if (xnestOldInstalledColormapWindows == windows)
- return True;
-
- if (xnestOldInstalledColormapWindows == NULL || windows == NULL)
- return False;
-
- if (memcmp(xnestOldInstalledColormapWindows, windows,
- numWindows * sizeof(Window)))
- return False;
-
- return True;
-}
-
-void
-xnestSetInstalledColormapWindows(ScreenPtr pScreen)
-{
- xnestInstalledColormapWindows icws;
- int numWindows;
-
- icws.cmapIDs = (Colormap *)xalloc(pScreen->maxInstalledCmaps *
- sizeof(Colormap));
- icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs);
- icws.numWindows = 0;
- WalkTree(pScreen, xnestCountInstalledColormapWindows, (pointer)&icws);
- if (icws.numWindows) {
- icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window));
- icws.index = 0;
- WalkTree(pScreen, xnestGetInstalledColormapWindows, (pointer)&icws);
- icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum];
- numWindows = icws.numWindows + 1;
- }
- else {
- icws.windows = NULL;
- numWindows = 0;
- }
-
- xfree(icws.cmapIDs);
-
- if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
- if (xnestOldInstalledColormapWindows)
- xfree(xnestOldInstalledColormapWindows);
-
-#ifdef _XSERVER64
- {
- int i;
- Window64 *windows = (Window64 *)xalloc(numWindows * sizeof(Window64));
-
- for(i = 0; i < numWindows; ++i)
- windows[i] = icws.windows[i];
- XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
- windows, numWindows);
- xfree(windows);
- }
-#else
- XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
- icws.windows, numWindows);
-#endif
-
- xnestOldInstalledColormapWindows = icws.windows;
- xnestNumOldInstalledColormapWindows = icws.numWindows;
-
-#ifdef DUMB_WINDOW_MANAGERS
- /*
- This code is for dumb window managers.
- This will only work with default local visual colormaps.
- */
- if (icws.numWindows)
- {
- WindowPtr pWin;
- Visual *visual;
- ColormapPtr pCmap;
-
- pWin = xnestWindowPtr(icws.windows[0]);
- visual = xnestVisualFromID(pScreen, wVisual(pWin));
-
- if (visual == xnestDefaultVisual(pScreen))
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin),
- RT_COLORMAP);
- else
- pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap,
- RT_COLORMAP);
-
- XSetWindowColormap(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- xnestColormap(pCmap));
- }
-#endif /* DUMB_WINDOW_MANAGERS */
- }
- else
- if (icws.windows) xfree(icws.windows);
-}
-
-void
-xnestSetScreenSaverColormapWindow(ScreenPtr pScreen)
-{
- if (xnestOldInstalledColormapWindows)
- xfree(xnestOldInstalledColormapWindows);
-
-#ifdef _XSERVER64
- {
- Window64 window;
-
- window = xnestScreenSaverWindows[pScreen->myNum];
- XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
- &window, 1);
- xnestScreenSaverWindows[pScreen->myNum] = window;
- }
-#else
- XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum],
- &xnestScreenSaverWindows[pScreen->myNum], 1);
-#endif /* _XSERVER64 */
-
- xnestOldInstalledColormapWindows = NULL;
- xnestNumOldInstalledColormapWindows = 0;
-
- xnestDirectUninstallColormaps(pScreen);
-}
-
-void
-xnestDirectInstallColormaps(ScreenPtr pScreen)
-{
- int i, n;
- Colormap pCmapIDs[MAXCMAPS];
-
- if (!xnestDoDirectColormaps) return;
-
- n = (*pScreen->ListInstalledColormaps)(pScreen, pCmapIDs);
-
- for (i = 0; i < n; i++) {
- ColormapPtr pCmap;
-
- pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP);
- if (pCmap)
- XInstallColormap(xnestDisplay, xnestColormap(pCmap));
- }
-}
-
-void
-xnestDirectUninstallColormaps(ScreenPtr pScreen)
-{
- int i, n;
- Colormap pCmapIDs[MAXCMAPS];
-
- if (!xnestDoDirectColormaps) return;
-
- n = (*pScreen->ListInstalledColormaps)(pScreen, pCmapIDs);
-
- for (i = 0; i < n; i++) {
- ColormapPtr pCmap;
-
- pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP);
- if (pCmap)
- XUninstallColormap(xnestDisplay, xnestColormap(pCmap));
- }
-}
-
-void
-xnestInstallColormap(ColormapPtr pCmap)
-{
- int index;
- ColormapPtr pOldCmap;
-
- index = pCmap->pScreen->myNum;
- pOldCmap = InstalledMaps[index];
-
- if(pCmap != pOldCmap)
- {
- xnestDirectUninstallColormaps(pCmap->pScreen);
-
- /* Uninstall pInstalledMap. Notify all interested parties. */
- if(pOldCmap != (ColormapPtr)None)
- WalkTree(pCmap->pScreen, TellLostMap, (pointer)&pOldCmap->mid);
-
- InstalledMaps[index] = pCmap;
- WalkTree(pCmap->pScreen, TellGainedMap, (pointer)&pCmap->mid);
-
- xnestSetInstalledColormapWindows(pCmap->pScreen);
- xnestDirectInstallColormaps(pCmap->pScreen);
- }
-}
-
-void
-xnestUninstallColormap(ColormapPtr pCmap)
-{
- int index;
- ColormapPtr pCurCmap;
-
- index = pCmap->pScreen->myNum;
- pCurCmap = InstalledMaps[index];
-
- if(pCmap == pCurCmap)
- {
- if (pCmap->mid != pCmap->pScreen->defColormap)
- {
- pCurCmap = (ColormapPtr)LookupIDByType(pCmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pCmap->pScreen->InstallColormap)(pCurCmap);
- }
- }
-}
-
-static Bool xnestInstalledDefaultColormap = False;
-
-int
-xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs)
-{
- if (xnestInstalledDefaultColormap) {
- *pCmapIDs = InstalledMaps[pScreen->myNum]->mid;
- return 1;
- }
- else
- return 0;
-}
-
-void
-xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
-{
- if (pCmap->pVisual->class & DynamicClass)
-#ifdef _XSERVER64
- {
- int i;
- XColor *pColors64 = (XColor *)xalloc(nColors * sizeof(XColor) );
-
- for(i = 0; i < nColors; ++i)
- {
- pColors64[i].pixel = pColors[i].pixel;
- pColors64[i].red = pColors[i].red;
- pColors64[i].green = pColors[i].green;
- pColors64[i].blue = pColors[i].blue;
- pColors64[i].flags = pColors[i].flags;
- }
- XStoreColors(xnestDisplay, xnestColormap(pCmap), pColors64, nColors);
- xfree(pColors64);
- }
-#else
- XStoreColors(xnestDisplay, xnestColormap(pCmap),
- (XColor *)pColors, nColors);
-#endif
-}
-
-void
-xnestResolveColor(unsigned short *pRed, unsigned short *pGreen,
- unsigned short *pBlue, VisualPtr pVisual)
-{
- int shift;
- unsigned int lim;
-
- shift = 16 - pVisual->bitsPerRGBValue;
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
-
- if ((pVisual->class == PseudoColor) || (pVisual->class == DirectColor))
- {
- /* rescale to rgb bits */
- *pRed = ((*pRed >> shift) * 65535) / lim;
- *pGreen = ((*pGreen >> shift) * 65535) / lim;
- *pBlue = ((*pBlue >> shift) * 65535) / lim;
- }
- else if (pVisual->class == GrayScale)
- {
- /* rescale to gray then rgb bits */
- *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100;
- *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim;
- }
- else if (pVisual->class == StaticGray)
- {
- unsigned int limg;
-
- limg = pVisual->ColormapEntries - 1;
- /* rescale to gray then [0..limg] then [0..65535] then rgb bits */
- *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100;
- *pRed = ((((*pRed * (limg + 1))) >> 16) * 65535) / limg;
- *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim;
- }
- else
- {
- unsigned limr, limg, limb;
-
- limr = pVisual->redMask >> pVisual->offsetRed;
- limg = pVisual->greenMask >> pVisual->offsetGreen;
- limb = pVisual->blueMask >> pVisual->offsetBlue;
- /* rescale to [0..limN] then [0..65535] then rgb bits */
- *pRed = ((((((*pRed * (limr + 1)) >> 16) *
- 65535) / limr) >> shift) * 65535) / lim;
- *pGreen = ((((((*pGreen * (limg + 1)) >> 16) *
- 65535) / limg) >> shift) * 65535) / lim;
- *pBlue = ((((((*pBlue * (limb + 1)) >> 16) *
- 65535) / limb) >> shift) * 65535) / lim;
- }
-}
-
-Bool
-xnestCreateDefaultColormap(ScreenPtr pScreen)
-{
- VisualPtr pVisual;
- ColormapPtr pCmap;
- unsigned short zero = 0, ones = 0xFFFF;
- Pixel wp, bp;
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++);
-
- if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &pCmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll, 0)
- != Success)
- return False;
-
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
- if ((AllocColor(pCmap, &ones, &ones, &ones, &wp, 0) !=
- Success) ||
- (AllocColor(pCmap, &zero, &zero, &zero, &bp, 0) !=
- Success))
- return FALSE;
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
- (*pScreen->InstallColormap)(pCmap);
-
- xnestInstalledDefaultColormap = True;
-
- return True;
-}
diff --git a/hw/xnest/Color.h b/hw/xnest/Color.h
deleted file mode 100644
index 0b3c22581..000000000
--- a/hw/xnest/Color.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $Xorg: Color.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Color.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTCOLOR_H
-#define XNESTCOLOR_H
-
-#define DUMB_WINDOW_MANAGERS
-
-#define MAXCMAPS 1
-#define MINCMAPS 1
-
-typedef struct {
- Colormap colormap;
-} xnestPrivColormap;
-
-typedef struct {
- int numCmapIDs;
- Colormap *cmapIDs;
- int numWindows;
- Window *windows;
- int index;
-} xnestInstalledColormapWindows;
-
-#define xnestColormapPriv(pCmap) \
- ((xnestPrivColormap *)((pCmap)->devPriv))
-
-#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap)
-
-#define xnestPixel(pixel) (pixel)
-
-Bool xnestCreateColormap(ColormapPtr pCmap);
-void xnestDestroyColormap(ColormapPtr pCmap);
-void xnestSetInstalledColormapWindows(ScreenPtr pScreen);
-void xnestSetScreenSaverColormapWindow(ScreenPtr pScreen);
-void xnestDirectInstallColormaps(ScreenPtr pScreen);
-void xnestDirectUninstallColormaps(ScreenPtr pScreen);
-void xnestInstallColormap(ColormapPtr pCmap);
-void xnestUninstallColormap(ColormapPtr pCmap);
-int xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs);
-void xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors);
-void xnestResolveColor(unsigned short *pRed, unsigned short *pGreen,
- unsigned short *pBlue, VisualPtr pVisual);
-Bool xnestCreateDefaultColormap(ScreenPtr pScreen);
-
-#endif /* XNESTCOLOR_H */
diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
deleted file mode 100644
index 52ba867cf..000000000
--- a/hw/xnest/Cursor.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* $Xorg: Cursor.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Cursor.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "cursor.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "XNCursor.h"
-#include "Visual.h"
-#include "Keyboard.h"
-#include "Args.h"
-
-void
-xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
-{
-#ifdef _XSERVER64
- Window64 wroot;
-#else
- Window wroot;
-#endif
-
- int wx, wy;
- unsigned int wwidth, wheight;
- unsigned int wborderwidth;
- unsigned int wdepth;
-
- XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot,
- &wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth);
-
- if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
- pBox->x2 >= wwidth && pBox->y2 >= wheight)
- XUngrabPointer(xnestDisplay, CurrentTime);
- else {
- XReparentWindow(xnestDisplay, xnestConfineWindow,
- xnestDefaultWindows[pScreen->myNum],
- pBox->x1, pBox->y1);
- XResizeWindow(xnestDisplay, xnestConfineWindow,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
-
- XGrabPointer(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- True,
- xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask),
- GrabModeAsync, GrabModeAsync,
- xnestConfineWindow,
- None, CurrentTime);
- }
-}
-
-void
-xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
- BoxPtr pTopLeftBox)
-{
- *pTopLeftBox = *pHotBox;
-}
-
-Bool
-xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- XDefineCursor(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- xnestCursor(pCursor, pScreen));
- return True;
-}
-
-Bool
-xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- XImage *ximage;
- Pixmap source, mask;
- XColor fg_color, bg_color;
- unsigned long valuemask;
- XGCValues values;
-
- valuemask = GCFunction |
- GCPlaneMask |
- GCForeground |
- GCBackground |
- GCClipMask;
-
- values.function = GXcopy;
- values.plane_mask = AllPlanes;
- values.foreground = 1L;
- values.background = 0L;
- values.clip_mask = None;
-
- XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values);
-
- source = XCreatePixmap(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- pCursor->bits->width,
- pCursor->bits->height,
- 1);
-
- mask = XCreatePixmap(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- pCursor->bits->width,
- pCursor->bits->height,
- 1);
-
- ximage = XCreateImage(xnestDisplay,
- xnestDefaultVisual(pScreen),
- 1, XYBitmap, 0,
- (char *)pCursor->bits->source,
- pCursor->bits->width,
- pCursor->bits->height,
- BitmapPad(xnestDisplay), 0);
-
- XPutImage(xnestDisplay, source, xnestBitmapGC, ximage,
- 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
-
- XFree(ximage);
-
- ximage = XCreateImage(xnestDisplay,
- xnestDefaultVisual(pScreen),
- 1, XYBitmap, 0,
- (char *)pCursor->bits->mask,
- pCursor->bits->width,
- pCursor->bits->height,
- BitmapPad(xnestDisplay), 0);
-
- XPutImage(xnestDisplay, mask, xnestBitmapGC, ximage,
- 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
-
- XFree(ximage);
-
- fg_color.red = pCursor->foreRed;
- fg_color.green = pCursor->foreGreen;
- fg_color.blue = pCursor->foreBlue;
-
- bg_color.red = pCursor->backRed;
- bg_color.green = pCursor->backGreen;
- bg_color.blue = pCursor->backBlue;
-
- pCursor->devPriv[pScreen->myNum] = (pointer)xalloc(sizeof(xnestPrivCursor));
- xnestCursorPriv(pCursor, pScreen)->cursor =
- XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color,
- pCursor->bits->xhot, pCursor->bits->yhot);
-
- XFreePixmap(xnestDisplay, source);
- XFreePixmap(xnestDisplay, mask);
-
- return True;
-}
-
-Bool
-xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen));
- xfree(xnestCursorPriv(pCursor, pScreen));
- return True;
-}
-
-void
-xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
-{
- XColor fg_color, bg_color;
-
- fg_color.red = pCursor->foreRed;
- fg_color.green = pCursor->foreGreen;
- fg_color.blue = pCursor->foreBlue;
-
- bg_color.red = pCursor->backRed;
- bg_color.green = pCursor->backGreen;
- bg_color.blue = pCursor->backBlue;
-
- XRecolorCursor(xnestDisplay,
- xnestCursor(pCursor, pScreen),
- &fg_color, &bg_color);
-}
-
-Bool
-xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent)
-{
- int i;
-
- for (i = 0; i < xnestNumScreens; i++)
- XWarpPointer(xnestDisplay, xnestDefaultWindows[i],
- xnestDefaultWindows[pScreen->myNum],
- 0, 0, 0, 0, x, y);
-
- return True;
-}
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
deleted file mode 100644
index 1a8703063..000000000
--- a/hw/xnest/Display.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* $Xorg: Display.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.5 2003/11/16 05:05:20 dawes Exp $ */
-
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Init.h"
-#include "Args.h"
-
-#include "icon"
-#include "screensaver"
-
-Display *xnestDisplay = NULL;
-XVisualInfo *xnestVisuals;
-int xnestNumVisuals;
-int xnestDefaultVisualIndex;
-Colormap *xnestDefaultColormaps;
-int xnestNumDefaultColormaps;
-int *xnestDepths;
-int xnestNumDepths;
-XPixmapFormatValues *xnestPixmapFormats;
-int xnestNumPixmapFormats;
-Pixel xnestBlackPixel;
-Pixel xnestWhitePixel;
-Drawable xnestDefaultDrawables[MAXDEPTH + 1];
-Pixmap xnestIconBitmap;
-Pixmap xnestScreenSaverPixmap;
-XlibGC xnestBitmapGC;
-Window xnestConfineWindow;
-unsigned long xnestEventMask;
-
-void
-xnestOpenDisplay(int argc, char *argv[])
-{
- XVisualInfo vi;
- long mask;
- int i, j;
-
- if (!xnestDoFullGeneration) return;
-
- xnestCloseDisplay();
-
- xnestDisplay = XOpenDisplay(xnestDisplayName);
- if (xnestDisplay == NULL)
- FatalError("Unable to open display \"%s\".\n",
- XDisplayName(xnestDisplayName));
-
- if (xnestSynchronize)
- XSynchronize(xnestDisplay, True);
-
- mask = VisualScreenMask;
- vi.screen = DefaultScreen(xnestDisplay);
- xnestVisuals = XGetVisualInfo(xnestDisplay, mask, &vi, &xnestNumVisuals);
- if (xnestNumVisuals == 0 || xnestVisuals == NULL)
- FatalError("Unable to find any visuals.\n");
-
- if (xnestUserDefaultClass || xnestUserDefaultDepth) {
- xnestDefaultVisualIndex = UNDEFINED;
- for (i = 0; i < xnestNumVisuals; i++)
- if ((!xnestUserDefaultClass ||
- xnestVisuals[i].class == xnestDefaultClass)
- &&
- (!xnestUserDefaultDepth ||
- xnestVisuals[i].depth == xnestDefaultDepth)) {
- xnestDefaultVisualIndex = i;
- break;
- }
- if (xnestDefaultVisualIndex == UNDEFINED)
- FatalError("Unable to find desired default visual.\n");
- }
- else {
- vi.visualid = XVisualIDFromVisual(DefaultVisual(xnestDisplay,
- DefaultScreen(xnestDisplay)));
- xnestDefaultVisualIndex = 0;
- for (i = 0; i < xnestNumVisuals; i++)
- if (vi.visualid == xnestVisuals[i].visualid)
- xnestDefaultVisualIndex = i;
- }
-
- xnestNumDefaultColormaps = xnestNumVisuals;
- xnestDefaultColormaps = (Colormap *)xalloc(xnestNumDefaultColormaps *
- sizeof(Colormap));
- for (i = 0; i < xnestNumDefaultColormaps; i++)
- xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay,
- DefaultRootWindow(xnestDisplay),
- xnestVisuals[i].visual,
- AllocNone);
-
- xnestDepths = XListDepths(xnestDisplay, DefaultScreen(xnestDisplay),
- &xnestNumDepths);
-
- xnestPixmapFormats = XListPixmapFormats(xnestDisplay,
- &xnestNumPixmapFormats);
-
- xnestBlackPixel = BlackPixel(xnestDisplay, DefaultScreen(xnestDisplay));
- xnestWhitePixel = WhitePixel(xnestDisplay, DefaultScreen(xnestDisplay));
-
- if (xnestParentWindow != (Window) 0)
- xnestEventMask = StructureNotifyMask;
- else
- xnestEventMask = 0L;
-
- for (i = 0; i <= MAXDEPTH; i++)
- xnestDefaultDrawables[i] = None;
-
- for (i = 0; i < xnestNumPixmapFormats; i++)
- for (j = 0; j < xnestNumDepths; j++)
- if (xnestPixmapFormats[i].depth == 1 ||
- xnestPixmapFormats[i].depth == xnestDepths[j]) {
- xnestDefaultDrawables[xnestPixmapFormats[i].depth] =
- XCreatePixmap(xnestDisplay, DefaultRootWindow(xnestDisplay),
- 1, 1, xnestPixmapFormats[i].depth);
- }
-
- xnestBitmapGC = XCreateGC(xnestDisplay, xnestDefaultDrawables[1], 0L, NULL);
-
- xnestConfineWindow = XCreateWindow(xnestDisplay,
- DefaultRootWindow(xnestDisplay),
- 0, 0, 1, 1, 0, 0,
- InputOnly,
- CopyFromParent,
- 0L, NULL);
-
- if (!(xnestUserGeometry & XValue))
- xnestX = 0;
-
- if (!(xnestUserGeometry & YValue))
- xnestY = 0;
-
- if (xnestParentWindow == 0) {
- if (!(xnestUserGeometry & WidthValue))
- xnestWidth = 3 * DisplayWidth(xnestDisplay,
- DefaultScreen(xnestDisplay)) / 4;
-
- if (!(xnestUserGeometry & HeightValue))
- xnestHeight = 3 * DisplayHeight(xnestDisplay,
- DefaultScreen(xnestDisplay)) / 4;
- }
-
- if (!xnestUserBorderWidth)
- xnestBorderWidth = 1;
-
- xnestIconBitmap =
- XCreateBitmapFromData(xnestDisplay,
- DefaultRootWindow(xnestDisplay),
- (char *)icon_bits,
- icon_width,
- icon_height);
-
- xnestScreenSaverPixmap =
- XCreatePixmapFromBitmapData(xnestDisplay,
- DefaultRootWindow(xnestDisplay),
- (char *)screensaver_bits,
- screensaver_width,
- screensaver_height,
- xnestWhitePixel,
- xnestBlackPixel,
- DefaultDepth(xnestDisplay,
- DefaultScreen(xnestDisplay)));
-}
-
-void
-xnestCloseDisplay()
-{
- if (!xnestDoFullGeneration || !xnestDisplay) return;
-
- /*
- If xnestDoFullGeneration all x resources will be destroyed upon closing
- the display connection. There is no need to generate extra protocol.
- */
-
- xfree(xnestDefaultColormaps);
- XFree(xnestVisuals);
- XFree(xnestDepths);
- XFree(xnestPixmapFormats);
- XCloseDisplay(xnestDisplay);
-}
diff --git a/hw/xnest/Display.h b/hw/xnest/Display.h
deleted file mode 100644
index 044f8f131..000000000
--- a/hw/xnest/Display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $Xorg: Display.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Display.h,v 1.7 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTCOMMON_H
-#define XNESTCOMMON_H
-
-#define UNDEFINED -1
-
-#define MAXDEPTH 32
-#define MAXVISUALSPERDEPTH 256
-
-extern Display *xnestDisplay;
-extern XVisualInfo *xnestVisuals;
-extern int xnestNumVisuals;
-extern int xnestDefaultVisualIndex;
-extern Colormap *xnestDefaultColormaps;
-extern int xnestNumDefaultClormaps;
-extern int *xnestDepths;
-extern int xnestNumDepths;
-extern XPixmapFormatValues *xnestPixmapFormats;
-extern int xnestNumPixmapFormats;
-extern Pixel xnestBlackPixel;
-extern Pixel xnestWhitePixel;
-extern Drawable xnestDefaultDrawables[MAXDEPTH + 1];
-extern Pixmap xnestIconBitmap;
-extern Pixmap xnestScreenSaverPixmap;
-extern XlibGC xnestBitmapGC;
-extern Window xnestConfineWindow;
-extern unsigned long xnestEventMask;
-
-void xnestOpenDisplay(int argc, char *argv[]);
-void xnestCloseDisplay(void);
-
-#endif /* XNESTCOMMON_H */
diff --git a/hw/xnest/Drawable.h b/hw/xnest/Drawable.h
deleted file mode 100644
index 6f52b286b..000000000
--- a/hw/xnest/Drawable.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $Xorg: Drawable.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Drawable.h,v 1.3 2002/11/23 19:27:50 tsi Exp $ */
-
-#ifndef XNESTDRAWABLE_H
-#define XNESTDRAWABLE_H
-
-#include "XNWindow.h"
-#include "XNPixmap.h"
-
-#define xnestDrawable(pDrawable) \
- ((pDrawable)->type == DRAWABLE_WINDOW ? \
- xnestWindow((WindowPtr)pDrawable) : \
- xnestPixmap((PixmapPtr)pDrawable))
-
-#endif /* XNESTDRAWABLE_H */
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
deleted file mode 100644
index 1b7b3935f..000000000
--- a/hw/xnest/Events.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $Xorg: Events.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Events.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-
-#include "mi.h"
-
-#include "Xnest.h"
-
-#include "Args.h"
-#include "Color.h"
-#include "Display.h"
-#include "Screen.h"
-#include "XNWindow.h"
-#include "Events.h"
-
-CARD32 lastEventTime = 0;
-
-void
-ProcessInputEvents()
-{
- mieqProcessInputEvents();
-}
-
-int
-TimeSinceLastInputEvent()
-{
- if (lastEventTime == 0)
- lastEventTime = GetTimeInMillis();
- return GetTimeInMillis() - lastEventTime;
-}
-
-void
-SetTimeSinceLastInputEvent()
-{
- lastEventTime = GetTimeInMillis();
-}
-
-static Bool
-xnestExposurePredicate(Display *display, XEvent *event, char *args)
-{
- return (event->type == Expose || event->type == ProcessedExpose);
-}
-
-static Bool
-xnestNotExposurePredicate(Display *display, XEvent *event, char *args)
-{
- return !xnestExposurePredicate(display, event, args);
-}
-
-void
-xnestCollectExposures()
-{
- XEvent X;
- WindowPtr pWin;
- RegionRec Rgn;
- BoxRec Box;
-
- while (XCheckIfEvent(xnestDisplay, &X, xnestExposurePredicate, NULL)) {
- pWin = xnestWindowPtr(X.xexpose.window);
-
- if (pWin) {
- Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + X.xexpose.x;
- Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + X.xexpose.y;
- Box.x2 = Box.x1 + X.xexpose.width;
- Box.y2 = Box.y1 + X.xexpose.height;
-
- REGION_INIT(pWin->drawable.pScreen, &Rgn, &Box, 1);
-
- miWindowExposures(pWin, &Rgn, NullRegion);
- }
- }
-}
-
-void
-xnestCollectEvents()
-{
- XEvent X;
- xEvent x;
- ScreenPtr pScreen;
-
- while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
- switch (X.type) {
- case KeyPress:
- x.u.u.type = KeyPress;
- x.u.u.detail = X.xkey.keycode;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- break;
-
- case KeyRelease:
- x.u.u.type = KeyRelease;
- x.u.u.detail = X.xkey.keycode;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- break;
-
- case ButtonPress:
- x.u.u.type = ButtonPress;
- x.u.u.detail = X.xbutton.button;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- break;
-
- case ButtonRelease:
- x.u.u.type = ButtonRelease;
- x.u.u.detail = X.xbutton.button;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- break;
-
- case MotionNotify:
- x.u.u.type = MotionNotify;
- x.u.keyButtonPointer.rootX = X.xmotion.x;
- x.u.keyButtonPointer.rootY = X.xmotion.y;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- break;
-
- case FocusIn:
- if (X.xfocus.detail != NotifyInferior) {
- pScreen = xnestScreen(X.xfocus.window);
- if (pScreen)
- xnestDirectInstallColormaps(pScreen);
- }
- break;
-
- case FocusOut:
- if (X.xfocus.detail != NotifyInferior) {
- pScreen = xnestScreen(X.xfocus.window);
- if (pScreen)
- xnestDirectUninstallColormaps(pScreen);
- }
- break;
-
- case KeymapNotify:
- break;
-
- case EnterNotify:
- if (X.xcrossing.detail != NotifyInferior) {
- pScreen = xnestScreen(X.xcrossing.window);
- if (pScreen) {
- NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y);
- x.u.u.type = MotionNotify;
- x.u.keyButtonPointer.rootX = X.xcrossing.x;
- x.u.keyButtonPointer.rootY = X.xcrossing.y;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
- xnestDirectInstallColormaps(pScreen);
- }
- }
- break;
-
- case LeaveNotify:
- if (X.xcrossing.detail != NotifyInferior) {
- pScreen = xnestScreen(X.xcrossing.window);
- if (pScreen) {
- xnestDirectUninstallColormaps(pScreen);
- }
- }
- break;
-
- case DestroyNotify:
- if (xnestParentWindow != (Window) 0 &&
- X.xdestroywindow.window == xnestParentWindow)
- exit (0);
- break;
-
- default:
- ErrorF("xnest warning: unhandled event\n");
- break;
- }
- }
-}
diff --git a/hw/xnest/Events.h b/hw/xnest/Events.h
deleted file mode 100644
index ed0fbb830..000000000
--- a/hw/xnest/Events.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $Xorg: Events.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Events.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTEVENTS_H
-#define XNESTEVENTS_H
-
-#include <X11/Xmd.h>
-
-#define ProcessedExpose (LASTEvent + 1)
-
-extern CARD32 lastEventTime;
-
-void SetTimeSinceLastInputEvent(void);
-void xnestCollectExposures(void);
-void xnestCollectEvents(void);
-
-#endif /* XNESTEVENTS_H */
diff --git a/hw/xnest/Font.c b/hw/xnest/Font.c
deleted file mode 100644
index f70848854..000000000
--- a/hw/xnest/Font.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* $Xorg: Font.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xatom.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "regionstr.h"
-#include "font.h"
-#include "fontstruct.h"
-#include "scrnintstr.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "XNFont.h"
-
-int xnestFontPrivateIndex;
-
-Bool
-xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
-{
- pointer priv;
- Atom name_atom, value_atom;
- int nprops;
- FontPropPtr props;
- int i;
- char *name;
-
- FontSetPrivate(pFont, xnestFontPrivateIndex, NULL);
-
- if (requestingClient && XpClientIsPrintClient(requestingClient, NULL))
- return True;
-
- name_atom = MakeAtom("FONT", 4, True);
- value_atom = 0L;
-
- nprops = pFont->info.nprops;
- props = pFont->info.props;
-
- for (i = 0; i < nprops; i++)
- if (props[i].name == name_atom) {
- value_atom = props[i].value;
- break;
- }
-
- if (!value_atom) return False;
-
- name = (char *)NameForAtom(value_atom);
-
- if (!name) return False;
-
- priv = (pointer)xalloc(sizeof(xnestPrivFont));
- FontSetPrivate(pFont, xnestFontPrivateIndex, priv);
-
- xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name);
-
- if (!xnestFontStruct(pFont)) return False;
-
- return True;
-}
-
-
-Bool
-xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
-{
- if (xnestFontPriv(pFont)) {
- if (xnestFontStruct(pFont))
- XFreeFont(xnestDisplay, xnestFontStruct(pFont));
- xfree(xnestFontPriv(pFont));
- FontSetPrivate(pFont, xnestFontPrivateIndex, NULL);
- }
- return True;
-}
diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c
deleted file mode 100644
index 972849d9a..000000000
--- a/hw/xnest/GC.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/* $Xorg: GC.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "fontstruct.h"
-#include "mistruct.h"
-#include "region.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "XNGC.h"
-#include "GCOps.h"
-#include "Drawable.h"
-#include "XNFont.h"
-#include "Color.h"
-
-int xnestGCPrivateIndex;
-
-static GCFuncs xnestFuncs = {
- xnestValidateGC,
- xnestChangeGC,
- xnestCopyGC,
- xnestDestroyGC,
- xnestChangeClip,
- xnestDestroyClip,
- xnestCopyClip,
-};
-
-static GCOps xnestOps = {
- xnestFillSpans,
- xnestSetSpans,
- xnestPutImage,
- xnestCopyArea,
- xnestCopyPlane,
- xnestPolyPoint,
- xnestPolylines,
- xnestPolySegment,
- xnestPolyRectangle,
- xnestPolyArc,
- xnestFillPolygon,
- xnestPolyFillRect,
- xnestPolyFillArc,
- xnestPolyText8,
- xnestPolyText16,
- xnestImageText8,
- xnestImageText16,
- xnestImageGlyphBlt,
- xnestPolyGlyphBlt,
- xnestPushPixels
-};
-
-Bool
-xnestCreateGC(GCPtr pGC)
-{
- pGC->clientClipType = CT_NONE;
- pGC->clientClip = NULL;
-
- pGC->funcs = &xnestFuncs;
- pGC->ops = &xnestOps;
-
- pGC->miTranslate = 1;
-
- xnestGCPriv(pGC)->gc = XCreateGC(xnestDisplay,
- xnestDefaultDrawables[pGC->depth],
- 0L, NULL);
- xnestGCPriv(pGC)->nClipRects = 0;
-
- return True;
-}
-
-void
-xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
-}
-
-void
-xnestChangeGC(GCPtr pGC, unsigned long mask)
-{
- XGCValues values;
-
- if (mask & GCFunction)
- values.function = pGC->alu;
-
- if (mask & GCPlaneMask)
- values.plane_mask = pGC->planemask;
-
- if (mask & GCForeground)
- values.foreground = xnestPixel(pGC->fgPixel);
-
- if (mask & GCBackground)
- values.background = xnestPixel(pGC->bgPixel);
-
- if (mask & GCLineWidth)
- values.line_width = pGC->lineWidth;
-
- if (mask & GCLineStyle)
- values.line_style = pGC->lineStyle;
-
- if (mask & GCCapStyle)
- values.cap_style = pGC->capStyle;
-
- if (mask & GCJoinStyle)
- values.join_style = pGC->joinStyle;
-
- if (mask & GCFillStyle)
- values.fill_style = pGC->fillStyle;
-
- if (mask & GCFillRule)
- values.fill_rule = pGC->fillRule;
-
- if (mask & GCTile) {
- if (pGC->tileIsPixel)
- mask &= ~GCTile;
- else
- values.tile = xnestPixmap(pGC->tile.pixmap);
- }
-
- if (mask & GCStipple)
- values.stipple = xnestPixmap(pGC->stipple);
-
- if (mask & GCTileStipXOrigin)
- values.ts_x_origin = pGC->patOrg.x;
-
- if (mask & GCTileStipYOrigin)
- values.ts_y_origin = pGC->patOrg.y;
-
- if (mask & GCFont)
- values.font = xnestFont(pGC->font);
-
- if (mask & GCSubwindowMode)
- values.subwindow_mode = pGC->subWindowMode;
-
- if (mask & GCGraphicsExposures)
- values.graphics_exposures = pGC->graphicsExposures;
-
- if (mask & GCClipXOrigin)
- values.clip_x_origin = pGC->clipOrg.x;
-
- if (mask & GCClipYOrigin)
- values.clip_y_origin = pGC->clipOrg.y;
-
- if (mask & GCClipMask) /* this is handled in change clip */
- mask &= ~GCClipMask;
-
- if (mask & GCDashOffset)
- values.dash_offset = pGC->dashOffset;
-
- if (mask & GCDashList) {
- mask &= ~GCDashList;
- XSetDashes(xnestDisplay, xnestGC(pGC),
- pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
- }
-
- if (mask & GCArcMode)
- values.arc_mode = pGC->arcMode;
-
- if (mask)
- XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values);
-}
-
-void
-xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
- XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst));
-}
-
-void
-xnestDestroyGC(GCPtr pGC)
-{
- XFreeGC(xnestDisplay, xnestGC(pGC));
-}
-
-void
-xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
-{
- int i, size;
- BoxPtr pBox;
- XRectangle *pRects;
-
- xnestDestroyClipHelper(pGC);
-
- switch(type)
- {
- case CT_NONE:
- XSetClipMask(xnestDisplay, xnestGC(pGC), None);
- break;
-
- case CT_REGION:
- nRects = REGION_NUM_RECTS((RegionPtr)pValue);
- size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) xalloc(size);
- pBox = REGION_RECTS((RegionPtr)pValue);
- for (i = nRects; i-- > 0; ) {
- pRects[i].x = pBox[i].x1;
- pRects[i].y = pBox[i].y1;
- pRects[i].width = pBox[i].x2 - pBox[i].x1;
- pRects[i].height = pBox[i].y2 - pBox[i].y1;
- }
- XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0,
- pRects, nRects, Unsorted);
- xfree((char *) pRects);
- break;
-
- case CT_PIXMAP:
- XSetClipMask(xnestDisplay, xnestGC(pGC),
- xnestPixmap((PixmapPtr)pValue));
- /*
- * Need to change into region, so subsequent uses are with
- * current pixmap contents.
- */
- pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pValue);
- (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue);
- pValue = pGC->clientClip;
- type = CT_REGION;
- break;
-
- case CT_UNSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, Unsorted);
- break;
-
- case CT_YSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YSorted);
- break;
-
- case CT_YXSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YXSorted);
- break;
-
- case CT_YXBANDED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YXBanded);
- break;
- }
-
- switch(type)
- {
- default:
- break;
-
- case CT_UNSORTED:
- case CT_YSORTED:
- case CT_YXSORTED:
- case CT_YXBANDED:
-
- /*
- * other parts of server can only deal with CT_NONE,
- * CT_PIXMAP and CT_REGION client clips.
- */
- pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects,
- (xRectangle *)pValue, type);
- xfree(pValue);
- pValue = pGC->clientClip;
- type = CT_REGION;
-
- break;
- }
-
- pGC->clientClipType = type;
- pGC->clientClip = pValue;
- xnestGCPriv(pGC)->nClipRects = nRects;
-}
-
-void
-xnestDestroyClip(GCPtr pGC)
-{
- xnestDestroyClipHelper(pGC);
-
- XSetClipMask(xnestDisplay, xnestGC(pGC), None);
-
- pGC->clientClipType = CT_NONE;
- pGC->clientClip = NULL;
- xnestGCPriv(pGC)->nClipRects = 0;
-}
-
-void
-xnestDestroyClipHelper(GCPtr pGC)
-{
- switch (pGC->clientClipType)
- {
- default:
- case CT_NONE:
- break;
-
- case CT_REGION:
- REGION_DESTROY(pGC->pScreen, pGC->clientClip);
- break;
- }
-}
-
-void
-xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
- RegionPtr pRgn;
-
- switch (pGCSrc->clientClipType)
- {
- default:
- case CT_NONE:
- xnestDestroyClip(pGCDst);
- break;
-
- case CT_REGION:
- pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1);
- REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip);
- xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
- break;
- }
-}
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
deleted file mode 100644
index b43695c96..000000000
--- a/hw/xnest/GCOps.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/* $Xorg: GCOps.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "regionstr.h"
-#include "fontstruct.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "region.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "XNGC.h"
-#include "XNFont.h"
-#include "GCOps.h"
-#include "Drawable.h"
-#include "Visual.h"
-
-void
-xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, xPoint *pPoints,
- int *pWidths, int fSorted)
-{
- ErrorF("xnest warning: function xnestFillSpans not implemented\n");
-}
-
-void
-xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
- xPoint *pPoints, int *pWidths, int nSpans, int fSorted)
-{
- ErrorF("xnest warning: function xnestSetSpans not implemented\n");
-}
-
-void
-xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
- int *pWidths, int nSpans, char *pBuffer)
-{
- ErrorF("xnest warning: function xnestGetSpans not implemented\n");
-}
-
-void
-xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
- ScreenPtr pScreen)
-{
- unsigned int width, height;
-
- width = *pWidth;
- height = *pHeight;
-
- XQueryBestSize(xnestDisplay, class,
- xnestDefaultWindows[pScreen->myNum],
- width, height, &width, &height);
-
- *pWidth = width;
- *pHeight = height;
-}
-
-void
-xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage)
-{
- XImage *ximage;
-
- ximage = XCreateImage(xnestDisplay, xnestDefaultVisual(pDrawable->pScreen),
- depth, format, leftPad, (char *)pImage,
- w, h, BitmapPad(xnestDisplay),
- (format == ZPixmap) ?
- PixmapBytePad(w, depth) : BitmapBytePad(w+leftPad));
-
- if (ximage) {
- XPutImage(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- ximage, 0, 0, x, y, w, h);
- XFree(ximage);
- }
-}
-
-void
-xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pImage)
-{
- XImage *ximage;
- int length;
-
- ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
- x, y, w, h, planeMask, format);
-
- if (ximage) {
- length = ximage->bytes_per_line * ximage->height;
-
- memmove(pImage, ximage->data, length);
-
- XDestroyImage(ximage);
- }
-}
-
-static Bool
-xnestBitBlitPredicate(Display *display, XEvent *event, char *args)
-{
- return (event->type == GraphicsExpose || event->type == NoExpose);
-}
-
-static RegionPtr
-xnestBitBlitHelper(GCPtr pGC)
-{
- if (!pGC->graphicsExposures)
- return NullRegion;
- else {
- XEvent event;
- RegionPtr pReg, pTmpReg;
- BoxRec Box;
- Bool pending, overlap;
-
- pReg = REGION_CREATE(pGC->pScreen, NULL, 1);
- pTmpReg = REGION_CREATE(pGC->pScreen, NULL, 1);
- if(!pReg || !pTmpReg) return NullRegion;
-
- pending = True;
- while (pending) {
- XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL);
-
- switch (event.type) {
- case NoExpose:
- pending = False;
- break;
-
- case GraphicsExpose:
- Box.x1 = event.xgraphicsexpose.x;
- Box.y1 = event.xgraphicsexpose.y;
- Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width;
- Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height;
- REGION_RESET(pGC->pScreen, pTmpReg, &Box);
- REGION_APPEND(pGC->pScreen, pReg, pTmpReg);
- pending = event.xgraphicsexpose.count;
- break;
- }
- }
-
- REGION_DESTROY(pGC->pScreen, pTmpReg);
- REGION_VALIDATE(pGC->pScreen, pReg, &overlap);
- return(pReg);
- }
-}
-
-RegionPtr
-xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GCPtr pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty)
-{
- XCopyArea(xnestDisplay,
- xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
- xnestGC(pGC), srcx, srcy, width, height, dstx, dsty);
-
- return xnestBitBlitHelper(pGC);
-}
-
-RegionPtr
-xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GCPtr pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long plane)
-{
- XCopyPlane(xnestDisplay,
- xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
- xnestGC(pGC), srcx, srcy, width, height, dstx, dsty, plane);
-
- return xnestBitBlitHelper(pGC);
-}
-
-void
-xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
- DDXPointPtr pPoints)
-{
- XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XPoint *)pPoints, nPoints, mode);
-}
-
-void
-xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
- DDXPointPtr pPoints)
-{
- XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XPoint *)pPoints, nPoints, mode);
-}
-
-void
-xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
- xSegment *pSegments)
-{
- XDrawSegments(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XSegment *)pSegments, nSegments);
-}
-
-void
-xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
- xRectangle *pRectangles)
-{
- XDrawRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XRectangle *)pRectangles, nRectangles);
-}
-
-void
-xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
-{
- XDrawArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XArc *)pArcs, nArcs);
-}
-
-void
-xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
- int nPoints, DDXPointPtr pPoints)
-{
- XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XPoint *)pPoints, nPoints, shape, mode);
-}
-
-void
-xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
- xRectangle *pRectangles)
-{
- XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XRectangle *)pRectangles, nRectangles);
-}
-
-void
-xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
-{
- XFillArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- (XArc *)pArcs, nArcs);
-}
-
-int
-xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- char *string)
-{
- int width;
-
- XDrawString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, string, count);
-
- width = XTextWidth(xnestFontStruct(pGC->font), string, count);
-
- return width + x;
-}
-
-int
-xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- unsigned short *string)
-{
- int width;
-
- XDrawString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, (XChar2b *)string, count);
-
- width = XTextWidth16(xnestFontStruct(pGC->font), (XChar2b *)string, count);
-
- return width + x;
-}
-
-void
-xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- char *string)
-{
- XDrawImageString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, string, count);
-}
-
-void
-xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- unsigned short *string)
-{
- XDrawImageString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, (XChar2b *)string, count);
-}
-
-void
-xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
- ErrorF("xnest warning: function xnestImageGlyphBlt not implemented\n");
-}
-
-void
-xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase)
-{
- ErrorF("xnest warning: function xnestPolyGlyphBlt not implemented\n");
-}
-
-void
-xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
- int width, int height, int x, int y)
-{
- ErrorF("xnest warning: function xnestPushPixels not implemented\n");
-}
diff --git a/hw/xnest/GCOps.h b/hw/xnest/GCOps.h
deleted file mode 100644
index 722dde470..000000000
--- a/hw/xnest/GCOps.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $Xorg: GCOps.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTGCOPS_H
-#define XNESTGCOPS_H
-
-void xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans,
- xPoint *pPoints, int *pWidths, int fSorted);
-void xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
- xPoint *pPoints, int *pWidths, int nSpans, int fSorted);
-void xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
- int *pWidths, int nSpans, char *pBuffer);
-void xnestQueryBestSize(int class, unsigned short *pWidth,
- unsigned short *pHeight, ScreenPtr pScreen);
-void xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *pImage);
-void xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pImage);
-RegionPtr xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GCPtr pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty);
-RegionPtr xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
- GCPtr pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long plane);
-void xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
- DDXPointPtr pPoints);
-void xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
- DDXPointPtr pPoints);
-void xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
- xSegment *pSegments);
-void xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
- xRectangle *pRectangles);
-void xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs);
-void xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
- int nPoints, DDXPointPtr pPoints);
-void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
- xRectangle *pRectangles);
-void xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs);
-int xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- char *string);
-int xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- unsigned short *string);
-void xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- char *string);
-void xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
- unsigned short *string);
-void xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-void xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
- unsigned int nGlyphs, CharInfoPtr *pCharInfo,
- pointer pGlyphBase);
-void xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable,
- int width, int height, int x, int y);
-
-#endif /* XNESTGCOPS_H */
diff --git a/hw/xnest/GetTime.c b/hw/xnest/GetTime.c
deleted file mode 100644
index 3db9b8596..000000000
--- a/hw/xnest/GetTime.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $Xorg: GetTime.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright (c) 1993 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GetTime.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-
-#include "Xos.h"
-#include "os.h"
-#include <time.h>
-
-CARD32
-GetTimeInMillis()
-{
- struct timeval tp;
-
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
-}
diff --git a/hw/xnest/Handlers.c b/hw/xnest/Handlers.c
deleted file mode 100644
index 693c7296b..000000000
--- a/hw/xnest/Handlers.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Xorg: Handlers.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Events.h"
-#include "Handlers.h"
-
-void
-xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
-{
- xnestCollectExposures();
- XFlush(xnestDisplay);
-}
-
-void
-xnestWakeupHandler(pointer blockData, int result, pointer pReadMask)
-{
- xnestCollectEvents();
-}
diff --git a/hw/xnest/Handlers.h b/hw/xnest/Handlers.h
deleted file mode 100644
index ae92352d1..000000000
--- a/hw/xnest/Handlers.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $Xorg: Handlers.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTHANDLERS_H
-#define XNESTHANDLERS_H
-
-void xnestBlockHandler(pointer blockData, OSTimePtr pTimeout,
- pointer pReadMask);
-void xnestWakeupHandler(pointer blockData, int result, pointer pReadMask);
-
-#endif /* XNESTHANDLERS_H */
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
deleted file mode 100644
index 6b3c4f19f..000000000
--- a/hw/xnest/Init.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* $Xorg: Init.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.25 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-#include "mi.h"
-#include "fontstruct.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "Pointer.h"
-#include "Keyboard.h"
-#include "Handlers.h"
-#include "Init.h"
-#include "Args.h"
-#include "Drawable.h"
-#include "XNGC.h"
-#include "XNFont.h"
-#ifdef DPMSExtension
-#include "dpmsproc.h"
-#endif
-
-Bool xnestDoFullGeneration = True;
-
-void
-InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
-{
- int i, j;
-
- xnestOpenDisplay(argc, argv);
-
- screenInfo->imageByteOrder = ImageByteOrder(xnestDisplay);
- screenInfo->bitmapScanlineUnit = BitmapUnit(xnestDisplay);
- screenInfo->bitmapScanlinePad = BitmapPad(xnestDisplay);
- screenInfo->bitmapBitOrder = BitmapBitOrder(xnestDisplay);
-
- screenInfo->numPixmapFormats = 0;
- for (i = 0; i < xnestNumPixmapFormats; i++)
- for (j = 0; j < xnestNumDepths; j++)
- if ((xnestPixmapFormats[i].depth == 1) ||
- (xnestPixmapFormats[i].depth == xnestDepths[j])) {
- screenInfo->formats[screenInfo->numPixmapFormats].depth =
- xnestPixmapFormats[i].depth;
- screenInfo->formats[screenInfo->numPixmapFormats].bitsPerPixel =
- xnestPixmapFormats[i].bits_per_pixel;
- screenInfo->formats[screenInfo->numPixmapFormats].scanlinePad =
- xnestPixmapFormats[i].scanline_pad;
- screenInfo->numPixmapFormats++;
- break;
- }
-
- xnestWindowPrivateIndex = AllocateWindowPrivateIndex();
- xnestGCPrivateIndex = AllocateGCPrivateIndex();
- xnestFontPrivateIndex = AllocateFontPrivateIndex();
-
- if (!xnestNumScreens) xnestNumScreens = 1;
-
- for (i = 0; i < xnestNumScreens; i++)
- AddScreen(xnestOpenScreen, argc, argv);
-
- xnestNumScreens = screenInfo->numScreens;
-
- xnestDoFullGeneration = xnestFullGeneration;
-}
-
-void
-InitInput(int argc, char *argv[])
-{
- pointer ptr, kbd;
-
- ptr = AddInputDevice(xnestPointerProc, TRUE);
- kbd = AddInputDevice(xnestKeyboardProc, TRUE);
-
- RegisterPointerDevice(ptr);
- RegisterKeyboardDevice(kbd);
-
- mieqInit(kbd, ptr);
-
- AddEnabledDevice(XConnectionNumber(xnestDisplay));
-
- RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL);
-}
-
-/*
- * DDX - specific abort routine. Called by AbortServer().
- */
-void AbortDDX()
-{
- xnestDoFullGeneration = True;
- xnestCloseDisplay();
-}
-
-/* Called by GiveUp(). */
-void ddxGiveUp()
-{
- AbortDDX();
-}
-
-#ifdef __DARWIN__
-void
-DarwinHandleGUI(int argc, char *argv[])
-{
-}
-
-void GlxExtensionInit();
-void GlxWrapInitVisuals(void *procPtr);
-
-void
-DarwinGlxExtensionInit()
-{
- GlxExtensionInit();
-}
-
-void
-DarwinGlxWrapInitVisuals(
- void *procPtr)
-{
- GlxWrapInitVisuals(procPtr);
-}
-#endif
-
-void OsVendorInit()
-{
- return;
-}
-
-void OsVendorFatalError()
-{
- return;
-}
-
-/* this is just to get the server to link on AIX */
-#ifdef AIXV3
-int SelectWaitTime = 10000; /* usec */
-#endif
-
-#ifdef DPMSExtension
-/**************************************************************
- * DPMSSet(), DPMSGet(), DPMSSupported()
- *
- * stubs
- *
- ***************************************************************/
-
-void
-DPMSSet(int level)
-{
-}
-
-int
-DPMSGet(int *level)
-{
- return -1;
-}
-
-Bool
-DPMSSupported()
-{
- return FALSE;
-}
-#endif
diff --git a/hw/xnest/Init.h b/hw/xnest/Init.h
deleted file mode 100644
index 8fb9956eb..000000000
--- a/hw/xnest/Init.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $Xorg: Init.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-
-#ifndef XNESTINIT_H
-#define XNESTINIT_H
-
-extern Bool xnestDoFullGeneration;
-
-#endif /* XNESTINIT_H */
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
deleted file mode 100644
index eb9291878..000000000
--- a/hw/xnest/Keyboard.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* $Xorg: Keyboard.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.10 2003/11/16 05:05:20 dawes Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "keysym.h"
-#include "screenint.h"
-#include "inputstr.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "Keyboard.h"
-#include "Args.h"
-
-#ifdef XKB
-#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBsrv.h>
-#include <X11/extensions/XKBconfig.h>
-
-extern Bool
-XkbQueryExtension(
- Display * /* dpy */,
- int * /* opcodeReturn */,
- int * /* eventBaseReturn */,
- int * /* errorBaseReturn */,
- int * /* majorRtrn */,
- int * /* minorRtrn */
-);
-
-extern XkbDescPtr XkbGetKeyboard(
- Display * /* dpy */,
- unsigned int /* which */,
- unsigned int /* deviceSpec */
-);
-
-extern Status XkbGetControls(
- Display * /* dpy */,
- unsigned long /* which */,
- XkbDescPtr /* desc */
-);
-
-#ifndef XKB_BASE_DIRECTORY
-#define XKB_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb/"
-#endif
-#ifndef XKB_CONFIG_FILE
-#define XKB_CONFIG_FILE "X0-config.keyboard"
-#endif
-#ifndef XKB_DFLT_RULES_FILE
-#define XKB_DFLT_RULES_FILE "xfree86"
-#endif
-#ifndef XKB_DFLT_KB_LAYOUT
-#define XKB_DFLT_KB_LAYOUT "us"
-#endif
-#ifndef XKB_DFLT_KB_MODEL
-#define XKB_DFLT_KB_MODEL "pc101"
-#endif
-#ifndef XKB_DFLT_KB_VARIANT
-#define XKB_DFLT_KB_VARIANT NULL
-#endif
-#ifndef XKB_DFLT_KB_OPTIONS
-#define XKB_DFLT_KB_OPTIONS NULL
-#endif
-
-#endif
-
-void
-xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls)
-{
- XBell(xnestDisplay, volume);
-}
-
-void
-xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
-{
-#if 0
- unsigned long value_mask;
- XKeyboardControl values;
- int i;
-
- value_mask = KBKeyClickPercent |
- KBBellPercent |
- KBBellPitch |
- KBBellDuration |
- KBAutoRepeatMode;
-
- values.key_click_percent = ctrl->click;
- values.bell_percent = ctrl->bell;
- values.bell_pitch = ctrl->bell_pitch;
- values.bell_duration = ctrl->bell_duration;
- values.auto_repeat_mode = ctrl->autoRepeat ?
- AutoRepeatModeOn : AutoRepeatModeOff;
-
- XChangeKeyboardControl(xnestDisplay, value_mask, &values);
-
- /*
- value_mask = KBKey | KBAutoRepeatMode;
- At this point, we need to walk through the vector and compare it
- to the current server vector. If there are differences, report them.
- */
-
- value_mask = KBLed | KBLedMode;
- for (i = 1; i <= 32; i++) {
- values.led = i;
- values.led_mode = (ctrl->leds & (1 << (i - 1))) ? LedModeOn : LedModeOff;
- XChangeKeyboardControl(xnestDisplay, value_mask, &values);
- }
-#endif
-}
-
-int
-xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
-{
- XModifierKeymap *modifier_keymap;
- KeySym *keymap;
- int mapWidth;
- int min_keycode, max_keycode;
- KeySymsRec keySyms;
- CARD8 modmap[256];
- int i, j;
- XKeyboardState values;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- modifier_keymap = XGetModifierMapping(xnestDisplay);
- XDisplayKeycodes(xnestDisplay, &min_keycode, &max_keycode);
-#ifdef _XSERVER64
- {
- KeySym64 *keymap64;
- int i, len;
- keymap64 = XGetKeyboardMapping(xnestDisplay,
- min_keycode,
- max_keycode - min_keycode + 1,
- &mapWidth);
- len = (max_keycode - min_keycode + 1) * mapWidth;
- keymap = (KeySym *)xalloc(len * sizeof(KeySym));
- for(i = 0; i < len; ++i)
- keymap[i] = keymap64[i];
- XFree(keymap64);
- }
-#else
- keymap = XGetKeyboardMapping(xnestDisplay,
- min_keycode,
- max_keycode - min_keycode + 1,
- &mapWidth);
-#endif
-
- for (i = 0; i < 256; i++)
- modmap[i] = 0;
- for (j = 0; j < 8; j++)
- for(i = 0; i < modifier_keymap->max_keypermod; i++) {
- CARD8 keycode;
- if ((keycode =
- modifier_keymap->
- modifiermap[j * modifier_keymap->max_keypermod + i]))
- modmap[keycode] |= 1<<j;
- }
- XFreeModifiermap(modifier_keymap);
-
- keySyms.minKeyCode = min_keycode;
- keySyms.maxKeyCode = max_keycode;
- keySyms.mapWidth = mapWidth;
- keySyms.map = keymap;
-
-#ifdef XKB
- if (noXkbExtension) {
-XkbError:
-#endif
- XGetKeyboardControl(xnestDisplay, &values);
-
- memmove((char *) defaultKeyboardControl.autoRepeats,
- (char *) values.auto_repeats, sizeof(values.auto_repeats));
-
- InitKeyboardDeviceStruct(&pDev->public, &keySyms, modmap,
- xnestBell, xnestChangeKeyboardControl);
-#ifdef XKB
- } else {
- FILE *file;
- XkbConfigRtrnRec config;
-
- XkbComponentNamesRec names;
- char *rules, *model, *layout, *variants, *options;
-
- XkbDescPtr xkb;
- int op, event, error, major, minor;
-
- if (XkbQueryExtension(xnestDisplay, &op, &event, &error, &major, &minor) == 0) {
- ErrorF("Unable to initialize XKEYBOARD extension.\n");
- goto XkbError;
- }
- xkb = XkbGetKeyboard(xnestDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
- if (xkb == NULL || xkb->geom == NULL) {
- ErrorF("Couldn't get keyboard.\n");
- goto XkbError;
- }
- XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb);
-
- memset(&names, 0, sizeof(XkbComponentNamesRec));
- rules = XKB_DFLT_RULES_FILE;
- model = XKB_DFLT_KB_MODEL;
- layout = XKB_DFLT_KB_LAYOUT;
- variants = XKB_DFLT_KB_VARIANT;
- options = XKB_DFLT_KB_OPTIONS;
- if (XkbInitialMap) {
- if ((names.keymap = strchr(XkbInitialMap, '/')) != NULL)
- ++names.keymap;
- else
- names.keymap = XkbInitialMap;
- }
-
- if ((file = fopen(XKB_BASE_DIRECTORY XKB_CONFIG_FILE, "r")) != NULL) {
- if (XkbCFParse(file, XkbCFDflts, xkb, &config) == 0) {
- ErrorF("Error parsing config file.\n");
- fclose(file);
- goto XkbError;
- }
- if (config.rules_file)
- rules = config.rules_file;
- if (config.model)
- model = config.model;
- if (config.layout)
- layout = config.layout;
- if (config.variant)
- variants = config.variant;
- if (config.options)
- options = config.options;
-
- fclose(file);
- }
-
- XkbSetRulesDflts(rules, model, layout, variants, options);
- XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap,
- xnestBell, xnestChangeKeyboardControl);
- XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
- XkbFreeKeyboard(xkb, 0, False);
- }
-#endif
-#ifdef _XSERVER64
- xfree(keymap);
-#else
- XFree(keymap);
-#endif
- break;
- case DEVICE_ON:
- xnestEventMask |= XNEST_KEYBOARD_EVENT_MASK;
- for (i = 0; i < xnestNumScreens; i++)
- XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask);
- break;
- case DEVICE_OFF:
- xnestEventMask &= ~XNEST_KEYBOARD_EVENT_MASK;
- for (i = 0; i < xnestNumScreens; i++)
- XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask);
- break;
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
-
-Bool
-LegalModifier(unsigned int key, DevicePtr pDev)
-{
- return TRUE;
-}
diff --git a/hw/xnest/Keyboard.h b/hw/xnest/Keyboard.h
deleted file mode 100644
index 5f8dc3cb4..000000000
--- a/hw/xnest/Keyboard.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $Xorg: Keyboard.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTKEYBOARD_H
-#define XNESTKEYBOARD_H
-
-#define XNEST_KEYBOARD_EVENT_MASK \
- (KeyPressMask | KeyReleaseMask | FocusChangeMask | KeymapStateMask)
-
-void xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls);
-void xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl);
-int xnestKeyboardProc(DeviceIntPtr pDev, int onoff);
-
-#endif /* XNESTKEYBOARD_H */
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
deleted file mode 100644
index b82dfa49b..000000000
--- a/hw/xnest/Pixmap.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* $Xorg: Pixmap.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Pixmap.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "gc.h"
-#include "servermd.h"
-#include "mi.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "XNPixmap.h"
-
-#ifdef PIXPRIV
-int xnestPixmapPrivateIndex;
-#endif
-
-PixmapPtr
-xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
-{
- PixmapPtr pPixmap;
-
- pPixmap = AllocatePixmap(pScreen, sizeof(xnestPrivPixmap));
- if (!pPixmap)
- return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = depth;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->refcnt = 1;
- pPixmap->devKind = PixmapBytePad(width, depth);
-#ifdef PIXPRIV
- pPixmap->devPrivates[xnestPixmapPrivateIndex].ptr =
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize);
-#else
- pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
- if (width && height)
- xnestPixmapPriv(pPixmap)->pixmap =
- XCreatePixmap(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- width, height, depth);
- else
- xnestPixmapPriv(pPixmap)->pixmap = 0;
-
- return pPixmap;
-}
-
-Bool
-xnestDestroyPixmap(PixmapPtr pPixmap)
-{
- if(--pPixmap->refcnt)
- return TRUE;
- XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
- xfree(pPixmap);
- return TRUE;
-}
-
-RegionPtr
-xnestPixmapToRegion(PixmapPtr pPixmap)
-{
- XImage *ximage;
- register RegionPtr pReg, pTmpReg;
- register int x, y;
- unsigned long previousPixel, currentPixel;
- BoxRec Box;
- Bool overlap;
-
- ximage = XGetImage(xnestDisplay, xnestPixmap(pPixmap), 0, 0,
- pPixmap->drawable.width, pPixmap->drawable.height,
- 1, XYPixmap);
-
- pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
- pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
- if(!pReg || !pTmpReg) return NullRegion;
-
- for (y = 0; y < pPixmap->drawable.height; y++) {
- Box.y1 = y;
- Box.y2 = y + 1;
- previousPixel = 0L;
- for (x = 0; x < pPixmap->drawable.width; x++) {
- currentPixel = XGetPixel(ximage, x, y);
- if (previousPixel != currentPixel) {
- if (previousPixel == 0L) {
- /* left edge */
- Box.x1 = x;
- }
- else if (currentPixel == 0L) {
- /* right edge */
- Box.x2 = x;
- REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box);
- REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg);
- }
- previousPixel = currentPixel;
- }
- }
- if (previousPixel != 0L) {
- /* right edge because of the end of pixmap */
- Box.x2 = pPixmap->drawable.width;
- REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box);
- REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg);
- }
- }
-
- REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg);
- XDestroyImage(ximage);
-
- REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap);
-
- return(pReg);
-}
diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c
deleted file mode 100644
index 1af5f02ec..000000000
--- a/hw/xnest/Pointer.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $Xorg: Pointer.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "screenint.h"
-#include "inputstr.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "mipointer.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "Pointer.h"
-#include "Args.h"
-
-void
-xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
-{
- XChangePointerControl(xnestDisplay, True, True,
- ctrl->num, ctrl->den, ctrl->threshold);
-}
-
-int
-xnestPointerProc(DeviceIntPtr pDev, int onoff)
-{
- CARD8 map[MAXBUTTONS];
- int nmap;
- int i;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- nmap = XGetPointerMapping(xnestDisplay, map, MAXBUTTONS);
- for (i = 0; i <= nmap; i++)
- map[i] = i; /* buttons are already mapped */
- InitPointerDeviceStruct(&pDev->public, map, nmap,
- miPointerGetMotionEvents,
- xnestChangePointerControl,
- miPointerGetMotionBufferSize());
- break;
- case DEVICE_ON:
- xnestEventMask |= XNEST_POINTER_EVENT_MASK;
- for (i = 0; i < xnestNumScreens; i++)
- XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask);
- break;
- case DEVICE_OFF:
- xnestEventMask &= ~XNEST_POINTER_EVENT_MASK;
- for (i = 0; i < xnestNumScreens; i++)
- XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask);
- break;
- case DEVICE_CLOSE:
- break;
- }
- return Success;
-}
diff --git a/hw/xnest/Pointer.h b/hw/xnest/Pointer.h
deleted file mode 100644
index 0b06e5021..000000000
--- a/hw/xnest/Pointer.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $Xorg: Pointer.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTPOINTER_H
-#define XNESTPOINTER_H
-
-#define MAXBUTTONS 256
-
-#define XNEST_POINTER_EVENT_MASK \
- (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
- EnterWindowMask | LeaveWindowMask)
-
-void xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl);
-int xnestPointerProc(DeviceIntPtr pDev, int onoff);
-
-#endif /* XNESTPOINTER_H */
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
deleted file mode 100644
index 686884555..000000000
--- a/hw/xnest/Screen.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/* $Xorg: Screen.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.13 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "dix.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "micmap.h"
-#include "colormapst.h"
-#include "resource.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "XNGC.h"
-#include "GCOps.h"
-#include "Drawable.h"
-#include "XNFont.h"
-#include "Color.h"
-#include "XNCursor.h"
-#include "Visual.h"
-#include "Events.h"
-#include "Init.h"
-#include "mipointer.h"
-#include "Args.h"
-
-Window xnestDefaultWindows[MAXSCREENS];
-Window xnestScreenSaverWindows[MAXSCREENS];
-
-#ifdef GLXEXT
-extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
-#endif
-
-#ifdef PIXPRIV
-int xnestScreenGeneration = -1;
-#endif
-
-ScreenPtr
-xnestScreen(Window window)
-{
- int i;
-
- for (i = 0; i < xnestNumScreens; i++)
- if (xnestDefaultWindows[i] == window)
- return screenInfo.screens[i];
-
- return NULL;
-}
-
-static int
-offset(unsigned long mask)
-{
- int count;
-
- for (count = 0; !(mask & 1) && count < 32; count++)
- mask >>= 1;
-
- return count;
-}
-
-static Bool
-xnestSaveScreen(ScreenPtr pScreen, int what)
-{
- if (xnestSoftwareScreenSaver)
- return False;
- else {
- switch (what) {
- case SCREEN_SAVER_ON:
- XMapRaised(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
- xnestSetScreenSaverColormapWindow(pScreen);
- break;
-
- case SCREEN_SAVER_OFF:
- XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
- xnestSetInstalledColormapWindows(pScreen);
- break;
-
- case SCREEN_SAVER_FORCER:
- lastEventTime = GetTimeInMillis();
- XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
- xnestSetInstalledColormapWindows(pScreen);
- break;
-
- case SCREEN_SAVER_CYCLE:
- XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
- xnestSetInstalledColormapWindows(pScreen);
- break;
- }
- return True;
- }
-}
-
-static Bool
-xnestCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-static void
-xnestCrossScreen(ScreenPtr pScreen, Bool entering)
-{
-}
-
-static miPointerScreenFuncRec xnestPointerCursorFuncs =
-{
- xnestCursorOffScreen,
- xnestCrossScreen,
- miPointerWarpCursor
-};
-
-Bool
-xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
-{
- VisualPtr visuals;
- DepthPtr depths;
- int numVisuals, numDepths;
- int i, j, depthIndex;
- unsigned long valuemask;
- XSetWindowAttributes attributes;
- XWindowAttributes gattributes;
- XSizeHints sizeHints;
- VisualID defaultVisual;
- int rootDepth;
-
- if (!(AllocateWindowPrivate(pScreen, xnestWindowPrivateIndex,
- sizeof(xnestPrivWin)) &&
- AllocateGCPrivate(pScreen, xnestGCPrivateIndex,
- sizeof(xnestPrivGC))))
- return False;
-
-#ifdef PIXPRIV
- if (xnestScreenGeneration != serverGeneration) {
- if ((xnestPixmapPrivateIndex = AllocatePixmapPrivateIndex()) < 0)
- return False;
- xnestScreenGeneration = serverGeneration;
- }
-
- if (!AllocatePixmapPrivate(pScreen,xnestPixmapPrivateIndex,
- sizeof (xnestPrivPixmap)))
- return False;
-#endif
- visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec));
- numVisuals = 0;
-
- depths = (DepthPtr)xalloc(MAXDEPTH * sizeof(DepthRec));
- depths[0].depth = 1;
- depths[0].numVids = 0;
- depths[0].vids = (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
- numDepths = 1;
-
- for (i = 0; i < xnestNumVisuals; i++) {
- visuals[numVisuals].class = xnestVisuals[i].class;
- visuals[numVisuals].bitsPerRGBValue = xnestVisuals[i].bits_per_rgb;
- visuals[numVisuals].ColormapEntries = xnestVisuals[i].colormap_size;
- visuals[numVisuals].nplanes = xnestVisuals[i].depth;
- visuals[numVisuals].redMask = xnestVisuals[i].red_mask;
- visuals[numVisuals].greenMask = xnestVisuals[i].green_mask;
- visuals[numVisuals].blueMask = xnestVisuals[i].blue_mask;
- visuals[numVisuals].offsetRed = offset(xnestVisuals[i].red_mask);
- visuals[numVisuals].offsetGreen = offset(xnestVisuals[i].green_mask);
- visuals[numVisuals].offsetBlue = offset(xnestVisuals[i].blue_mask);
-
- /* Check for and remove duplicates. */
- for (j = 0; j < numVisuals; j++) {
- if (visuals[numVisuals].class == visuals[j].class &&
- visuals[numVisuals].bitsPerRGBValue == visuals[j].bitsPerRGBValue &&
- visuals[numVisuals].ColormapEntries == visuals[j].ColormapEntries &&
- visuals[numVisuals].nplanes == visuals[j].nplanes &&
- visuals[numVisuals].redMask == visuals[j].redMask &&
- visuals[numVisuals].greenMask == visuals[j].greenMask &&
- visuals[numVisuals].blueMask == visuals[j].blueMask &&
- visuals[numVisuals].offsetRed == visuals[j].offsetRed &&
- visuals[numVisuals].offsetGreen == visuals[j].offsetGreen &&
- visuals[numVisuals].offsetBlue == visuals[j].offsetBlue)
- break;
- }
- if (j < numVisuals)
- break;
-
- visuals[numVisuals].vid = FakeClientID(0);
-
- depthIndex = UNDEFINED;
- for (j = 0; j < numDepths; j++)
- if (depths[j].depth == xnestVisuals[i].depth) {
- depthIndex = j;
- break;
- }
-
- if (depthIndex == UNDEFINED) {
- depthIndex = numDepths;
- depths[depthIndex].depth = xnestVisuals[i].depth;
- depths[depthIndex].numVids = 0;
- depths[depthIndex].vids =
- (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
- numDepths++;
- }
- if (depths[depthIndex].numVids >= MAXVISUALSPERDEPTH) {
- FatalError("Visual table overflow");
- }
- depths[depthIndex].vids[depths[depthIndex].numVids] =
- visuals[numVisuals].vid;
- depths[depthIndex].numVids++;
-
- numVisuals++;
- }
- visuals = (VisualPtr)xrealloc(visuals, numVisuals * sizeof(VisualRec));
-
- defaultVisual = visuals[xnestDefaultVisualIndex].vid;
- rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
-
-#ifdef GLXEXT
- {
- miInitVisualsProcPtr proc = NULL;
-
- GlxWrapInitVisuals(&proc);
- /* GlxInitVisuals ignores the last three arguments. */
- proc(&visuals, &depths, &numVisuals, &numDepths,
- &rootDepth, &defaultVisual, 0, 0, 0);
- }
-#endif
-
- if (xnestParentWindow != 0) {
- XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes);
- xnestWidth = gattributes.width;
- xnestHeight = gattributes.height;
- }
-
- /* myNum */
- /* id */
- miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
- rootDepth,
- numDepths, depths,
- defaultVisual, /* root visual */
- numVisuals, visuals);
-
- miInitializeBackingStore(pScreen);
-
- miDCInitialize(pScreen, &xnestPointerCursorFuncs);
-
- pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
- DefaultScreen(xnestDisplay)) /
- DisplayWidth(xnestDisplay,
- DefaultScreen(xnestDisplay));
- pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
- DefaultScreen(xnestDisplay)) /
- DisplayHeight(xnestDisplay,
- DefaultScreen(xnestDisplay));
-
- pScreen->defColormap = (Colormap) FakeClientID(0);
- pScreen->minInstalledCmaps = MINCMAPS;
- pScreen->maxInstalledCmaps = MAXCMAPS;
- pScreen->backingStoreSupport = NotUseful;
- pScreen->saveUnderSupport = NotUseful;
- pScreen->whitePixel = xnestWhitePixel;
- pScreen->blackPixel = xnestBlackPixel;
- /* rgf */
- /* GCperDepth */
- /* PixmapPerDepth */
- pScreen->devPrivate = NULL;
- /* WindowPrivateLen */
- /* WindowPrivateSizes */
- /* totalWindowSize */
- /* GCPrivateLen */
- /* GCPrivateSizes */
- /* totalGCSize */
-
- /* Random screen procedures */
-
- pScreen->CloseScreen = xnestCloseScreen;
- pScreen->QueryBestSize = xnestQueryBestSize;
- pScreen->SaveScreen = xnestSaveScreen;
- pScreen->GetImage = xnestGetImage;
- pScreen->GetSpans = xnestGetSpans;
- pScreen->PointerNonInterestBox = NULL;
- pScreen->SourceValidate = NULL;
-
- /* Window Procedures */
-
- pScreen->CreateWindow = xnestCreateWindow;
- pScreen->DestroyWindow = xnestDestroyWindow;
- pScreen->PositionWindow = xnestPositionWindow;
- pScreen->ChangeWindowAttributes = xnestChangeWindowAttributes;
- pScreen->RealizeWindow = xnestRealizeWindow;
- pScreen->UnrealizeWindow = xnestUnrealizeWindow;
- pScreen->PostValidateTree = NULL;
- pScreen->WindowExposures = xnestWindowExposures;
- pScreen->PaintWindowBackground = xnestPaintWindowBackground;
- pScreen->PaintWindowBorder = xnestPaintWindowBorder;
- pScreen->CopyWindow = xnestCopyWindow;
- pScreen->ClipNotify = xnestClipNotify;
-
- /* Pixmap procedures */
-
- pScreen->CreatePixmap = xnestCreatePixmap;
- pScreen->DestroyPixmap = xnestDestroyPixmap;
-
- /* Backing store procedures */
-
- pScreen->SaveDoomedAreas = NULL;
- pScreen->RestoreAreas = NULL;
- pScreen->ExposeCopy = NULL;
- pScreen->TranslateBackingStore = NULL;
- pScreen->ClearBackingStore = NULL;
- pScreen->DrawGuarantee = NULL;
-
- /* Font procedures */
-
- pScreen->RealizeFont = xnestRealizeFont;
- pScreen->UnrealizeFont = xnestUnrealizeFont;
-
- /* Cursor Procedures */
-
- pScreen->ConstrainCursor = xnestConstrainCursor;
- pScreen->CursorLimits = xnestCursorLimits;
- pScreen->DisplayCursor = xnestDisplayCursor;
- pScreen->RealizeCursor = xnestRealizeCursor;
- pScreen->UnrealizeCursor = xnestUnrealizeCursor;
- pScreen->RecolorCursor = xnestRecolorCursor;
- pScreen->SetCursorPosition = xnestSetCursorPosition;
-
- /* GC procedures */
-
- pScreen->CreateGC = xnestCreateGC;
-
- /* Colormap procedures */
-
- pScreen->CreateColormap = xnestCreateColormap;
- pScreen->DestroyColormap = xnestDestroyColormap;
- pScreen->InstallColormap = xnestInstallColormap;
- pScreen->UninstallColormap = xnestUninstallColormap;
- pScreen->ListInstalledColormaps = xnestListInstalledColormaps;
- pScreen->StoreColors = xnestStoreColors;
- pScreen->ResolveColor = xnestResolveColor;
-
- pScreen->BitmapToRegion = xnestPixmapToRegion;
-
- /* OS layer procedures */
-
- pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA;
- pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
- pScreen->blockData = NULL;
- pScreen->wakeupData = NULL;
- if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
- return FALSE;
-
- /* devPrivates */
-
-#define POSITION_OFFSET (pScreen->myNum * (xnestWidth + xnestHeight) / 32)
-
- if (xnestDoFullGeneration) {
-
- valuemask = CWBackPixel | CWEventMask | CWColormap;
- attributes.background_pixel = xnestWhitePixel;
- attributes.event_mask = xnestEventMask;
- attributes.colormap = xnestDefaultVisualColormap(xnestDefaultVisual(pScreen));
-
- if (xnestParentWindow != 0) {
- xnestDefaultWindows[pScreen->myNum] = xnestParentWindow;
- XSelectInput (xnestDisplay, xnestDefaultWindows[pScreen->myNum],
- xnestEventMask);
- } else
- xnestDefaultWindows[pScreen->myNum] =
- XCreateWindow(xnestDisplay,
- DefaultRootWindow(xnestDisplay),
- xnestX + POSITION_OFFSET,
- xnestY + POSITION_OFFSET,
- xnestWidth, xnestHeight,
- xnestBorderWidth,
- pScreen->rootDepth,
- InputOutput,
- xnestDefaultVisual(pScreen),
- valuemask, &attributes);
-
- if (!xnestWindowName)
- xnestWindowName = argv[0];
-
- sizeHints.flags = PPosition | PSize | PMaxSize;
- sizeHints.x = xnestX + POSITION_OFFSET;
- sizeHints.y = xnestY + POSITION_OFFSET;
- sizeHints.width = sizeHints.max_width = xnestWidth;
- sizeHints.height = sizeHints.max_height = xnestHeight;
- if (xnestUserGeometry & XValue || xnestUserGeometry & YValue)
- sizeHints.flags |= USPosition;
- if (xnestUserGeometry & WidthValue || xnestUserGeometry & HeightValue)
- sizeHints.flags |= USSize;
- XSetStandardProperties(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- xnestWindowName,
- xnestWindowName,
- xnestIconBitmap,
- argv, argc, &sizeHints);
-
- XMapWindow(xnestDisplay, xnestDefaultWindows[pScreen->myNum]);
-
- valuemask = CWBackPixmap | CWColormap;
- attributes.background_pixmap = xnestScreenSaverPixmap;
- attributes.colormap =
- DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay));
- xnestScreenSaverWindows[pScreen->myNum] =
- XCreateWindow(xnestDisplay,
- xnestDefaultWindows[pScreen->myNum],
- 0, 0, xnestWidth, xnestHeight, 0,
- DefaultDepth(xnestDisplay, DefaultScreen(xnestDisplay)),
- InputOutput,
- DefaultVisual(xnestDisplay, DefaultScreen(xnestDisplay)),
- valuemask, &attributes);
- }
-
- if (!xnestCreateDefaultColormap(pScreen)) return False;
-
- return True;
-}
-
-Bool
-xnestCloseScreen(int index, ScreenPtr pScreen)
-{
- int i;
-
- for (i = 0; i < pScreen->numDepths; i++)
- xfree(pScreen->allowedDepths[i].vids);
- xfree(pScreen->allowedDepths);
- xfree(pScreen->visuals);
- xfree(pScreen->devPrivate);
-
- /*
- If xnestDoFullGeneration all x resources will be destroyed upon closing
- the display connection. There is no need to generate extra protocol.
- */
-
- return True;
-}
diff --git a/hw/xnest/Screen.h b/hw/xnest/Screen.h
deleted file mode 100644
index 96260435b..000000000
--- a/hw/xnest/Screen.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $Xorg: Screen.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTSCREEN_H
-#define XNESTSCREEN_H
-
-extern Window xnestDefaultWindows[MAXSCREENS];
-extern Window xnestScreenSaverWindows[MAXSCREENS];
-
-ScreenPtr xnestScreen(Window window);
-Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]);
-Bool xnestCloseScreen(int index, ScreenPtr pScreen);
-
-#endif /* XNESTSCREEN_H */
diff --git a/hw/xnest/TestExt.c b/hw/xnest/TestExt.c
deleted file mode 100644
index f153b5b2c..000000000
--- a/hw/xnest/TestExt.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* $Xorg: TestExt.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/Xlib.h>
-#undef Bool
-#include "screenint.h"
-#include "input.h"
-#include "misc.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "mipointer.h"
-#define XTestSERVER_SIDE
-#include "xtestext1.h"
-#include "xtest1dd.h"
-
-extern CARD32 lastEventTime;
-
-void
-XTestGetPointerPos(short *fmousex, short *fmousey)
-{
- int x,y;
-
- miPointerPosition(&x, &y);
- *fmousex = x;
- *fmousey = y;
-}
-
-void
-XTestJumpPointer(int jx, int jy, int dev_type)
-{
- miPointerAbsoluteCursor(jx, jy, GetTimeInMillis());
-}
-
-void
-XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
- int mousey)
-{
-/*
- xEvent tevent;
-
- tevent.u.u.type = (dev_type == XE_POINTER) ?
- (keystate == XTestKEY_UP) ? ButtonRelease : ButtonPress :
- (keystate == XTestKEY_UP) ? KeyRelease : KeyPress;
- tevent.u.u.detail = keycode;
- tevent.u.keyButtonPointer.rootX = mousex;
- tevent.u.keyButtonPointer.rootY = mousey;
- tevent.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&tevent);
-*/
-}
diff --git a/hw/xnest/Visual.c b/hw/xnest/Visual.c
deleted file mode 100644
index bcf7881eb..000000000
--- a/hw/xnest/Visual.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $Xorg: Visual.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "dix.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Visual.h"
-
-Visual *
-xnestVisual(VisualPtr pVisual)
-{
- int i;
-
- for (i = 0; i < xnestNumVisuals; i++)
- if (pVisual->class == xnestVisuals[i].class &&
- pVisual->bitsPerRGBValue == xnestVisuals[i].bits_per_rgb &&
- pVisual->ColormapEntries == xnestVisuals[i].colormap_size &&
- pVisual->nplanes == xnestVisuals[i].depth &&
- pVisual->redMask == xnestVisuals[i].red_mask &&
- pVisual->greenMask == xnestVisuals[i].green_mask &&
- pVisual->blueMask == xnestVisuals[i].blue_mask)
- return xnestVisuals[i].visual;
-
- return NULL;
-}
-
-Visual *
-xnestVisualFromID(ScreenPtr pScreen, VisualID visual)
-{
- int i;
-
- for (i = 0; i < pScreen->numVisuals; i++)
- if (pScreen->visuals[i].vid == visual)
- return xnestVisual(&pScreen->visuals[i]);
-
- return NULL;
-}
-
-Colormap
-xnestDefaultVisualColormap(Visual *visual)
-{
- int i;
-
- for (i = 0; i < xnestNumVisuals; i++)
- if (xnestVisuals[i].visual == visual)
- return xnestDefaultColormaps[i];
-
- return None;
-}
diff --git a/hw/xnest/Visual.h b/hw/xnest/Visual.h
deleted file mode 100644
index 14e0085dc..000000000
--- a/hw/xnest/Visual.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* $Xorg: Visual.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTVISUAL_H
-#define XNESTVISUAL_H
-
-Visual *xnestVisual(VisualPtr pVisual);
-Visual *xnestVisualFromID(ScreenPtr pScreen, VisualID visual);
-Colormap xnestDefaultVisualColormap(Visual *visual);
-
-#define xnestDefaultVisual(pScreen) \
- xnestVisualFromID((pScreen), (pScreen)->rootVisual)
-
-#endif /* XNESTVISUAL_H */
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
deleted file mode 100644
index 14ddac082..000000000
--- a/hw/xnest/Window.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/* $Xorg: Window.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mi.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "Screen.h"
-#include "XNGC.h"
-#include "Drawable.h"
-#include "Color.h"
-#include "Visual.h"
-#include "Events.h"
-#include "Args.h"
-
-int xnestWindowPrivateIndex;
-
-static int
-xnestFindWindowMatch(WindowPtr pWin, pointer ptr)
-{
- xnestWindowMatch *wm = (xnestWindowMatch *)ptr;
- if (wm->window == xnestWindow(pWin)) {
- wm->pWin = pWin;
- return WT_STOPWALKING;
- }
- else
- return WT_WALKCHILDREN;
-}
-
-WindowPtr
-xnestWindowPtr(Window window)
-{
- xnestWindowMatch wm;
- int i;
-
- wm.pWin = NullWindow;
- wm.window = window;
-
- for (i = 0; i < xnestNumScreens; i++) {
- WalkTree(screenInfo.screens[i], xnestFindWindowMatch, (pointer) &wm);
- if (wm.pWin) break;
- }
-
- return wm.pWin;
-}
-
-Bool
-xnestCreateWindow(WindowPtr pWin)
-{
- unsigned long mask;
- XSetWindowAttributes attributes;
- Visual *visual;
- ColormapPtr pCmap;
-
- if (pWin->drawable.class == InputOnly) {
- mask = 0L;
- visual = CopyFromParent;
- }
- else {
- mask = CWEventMask | CWBackingStore;
- attributes.event_mask = ExposureMask;
- attributes.backing_store = NotUseful;
-
- if (pWin->parent) {
- if (pWin->optional && pWin->optional->visual != wVisual(pWin->parent)) {
- visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin));
- mask |= CWColormap;
- if (pWin->optional->colormap) {
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP);
- attributes.colormap = xnestColormap(pCmap);
- }
- else
- attributes.colormap = xnestDefaultVisualColormap(visual);
- }
- else
- visual = CopyFromParent;
- }
- else { /* root windows have their own colormaps at creation time */
- visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin));
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP);
- mask |= CWColormap;
- attributes.colormap = xnestColormap(pCmap);
- }
- }
-
- xnestWindowPriv(pWin)->window = XCreateWindow(xnestDisplay,
- xnestWindowParent(pWin),
- pWin->origin.x -
- wBorderWidth(pWin),
- pWin->origin.y -
- wBorderWidth(pWin),
- pWin->drawable.width,
- pWin->drawable.height,
- pWin->borderWidth,
- pWin->drawable.depth,
- pWin->drawable.class,
- visual,
- mask, &attributes);
- xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);
- xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin);
- xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin);
- xnestWindowPriv(pWin)->width = pWin->drawable.width;
- xnestWindowPriv(pWin)->height = pWin->drawable.height;
- xnestWindowPriv(pWin)->border_width = pWin->borderWidth;
- xnestWindowPriv(pWin)->sibling_above = None;
- if (pWin->nextSib)
- xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
-#ifdef SHAPE
- xnestWindowPriv(pWin)->bounding_shape =
- REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
- xnestWindowPriv(pWin)->clip_shape =
- REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
-#endif /* SHAPE */
-
- if (!pWin->parent) /* only the root window will have the right colormap */
- xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
-
- return True;
-}
-
-Bool
-xnestDestroyWindow(WindowPtr pWin)
-{
- if (pWin->nextSib)
- xnestWindowPriv(pWin->nextSib)->sibling_above =
- xnestWindowPriv(pWin)->sibling_above;
-#ifdef SHAPE
- REGION_DESTROY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->bounding_shape);
- REGION_DESTROY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->clip_shape);
-#endif
- XDestroyWindow(xnestDisplay, xnestWindow(pWin));
- xnestWindowPriv(pWin)->window = None;
-
- if (pWin->optional && pWin->optional->colormap && pWin->parent)
- xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
-
- return True;
-}
-
-Bool
-xnestPositionWindow(WindowPtr pWin, int x, int y)
-{
- xnestConfigureWindow(pWin,
- CWParent |
- CWX | CWY |
- CWWidth | CWHeight |
- CWBorderWidth);
-
- return True;
-}
-
-void
-xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
-{
- unsigned int valuemask;
- XWindowChanges values;
-
- if (mask & CWParent &&
- xnestWindowPriv(pWin)->parent != xnestWindowParent(pWin)) {
- XReparentWindow(xnestDisplay, xnestWindow(pWin),
- xnestWindowParent(pWin),
- pWin->origin.x - wBorderWidth(pWin),
- pWin->origin.y - wBorderWidth(pWin));
- xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);
- xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin);
- xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin);
- xnestWindowPriv(pWin)->sibling_above = None;
- if (pWin->nextSib)
- xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
- }
-
- valuemask = 0;
-
- if (mask & CWX &&
- xnestWindowPriv(pWin)->x != pWin->origin.x - wBorderWidth(pWin)) {
- valuemask |= CWX;
- values.x =
- xnestWindowPriv(pWin)->x =
- pWin->origin.x - wBorderWidth(pWin);
- }
-
- if (mask & CWY &&
- xnestWindowPriv(pWin)->y != pWin->origin.y - wBorderWidth(pWin)) {
- valuemask |= CWY;
- values.y =
- xnestWindowPriv(pWin)->y =
- pWin->origin.y - wBorderWidth(pWin);
- }
-
- if (mask & CWWidth &&
- xnestWindowPriv(pWin)->width != pWin->drawable.width) {
- valuemask |= CWWidth;
- values.width =
- xnestWindowPriv(pWin)->width =
- pWin->drawable.width;
- }
-
- if (mask & CWHeight &&
- xnestWindowPriv(pWin)->height != pWin->drawable.height) {
- valuemask |= CWHeight;
- values.height =
- xnestWindowPriv(pWin)->height =
- pWin->drawable.height;
- }
-
- if (mask & CWBorderWidth &&
- xnestWindowPriv(pWin)->border_width != pWin->borderWidth) {
- valuemask |= CWBorderWidth;
- values.border_width =
- xnestWindowPriv(pWin)->border_width =
- pWin->borderWidth;
- }
-
- if (valuemask)
- XConfigureWindow(xnestDisplay, xnestWindow(pWin), valuemask, &values);
-
- if (mask & CWStackingOrder &&
- xnestWindowPriv(pWin)->sibling_above != xnestWindowSiblingAbove(pWin)) {
- WindowPtr pSib;
-
- /* find the top sibling */
- for (pSib = pWin; pSib->prevSib != NullWindow; pSib = pSib->prevSib);
-
- /* the top sibling */
- valuemask = CWStackMode;
- values.stack_mode = Above;
- XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values);
- xnestWindowPriv(pSib)->sibling_above = None;
-
- /* the rest of siblings */
- for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) {
- valuemask = CWSibling | CWStackMode;
- values.sibling = xnestWindowSiblingAbove(pSib);
- values.stack_mode = Below;
- XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values);
- xnestWindowPriv(pSib)->sibling_above = xnestWindowSiblingAbove(pSib);
- }
- }
-}
-
-Bool
-xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
- XSetWindowAttributes attributes;
-
- if (mask & CWBackPixmap)
- switch (pWin->backgroundState) {
- case None:
- attributes.background_pixmap = None;
- break;
-
- case ParentRelative:
- attributes.background_pixmap = ParentRelative;
- break;
-
- case BackgroundPixmap:
- attributes.background_pixmap = xnestPixmap(pWin->background.pixmap);
- break;
-
- case BackgroundPixel:
- mask &= ~CWBackPixmap;
- break;
- }
-
- if (mask & CWBackPixel) {
- if (pWin->backgroundState == BackgroundPixel)
- attributes.background_pixel = xnestPixel(pWin->background.pixel);
- else
- mask &= ~CWBackPixel;
- }
-
- if (mask & CWBorderPixmap) {
- if (pWin->borderIsPixel)
- mask &= ~CWBorderPixmap;
- else
- attributes.border_pixmap = xnestPixmap(pWin->border.pixmap);
- }
-
- if (mask & CWBorderPixel) {
- if (pWin->borderIsPixel)
- attributes.border_pixel = xnestPixel(pWin->border.pixel);
- else
- mask &= ~CWBorderPixel;
- }
-
- if (mask & CWBitGravity)
- attributes.bit_gravity = pWin->bitGravity;
-
- if (mask & CWWinGravity) /* dix does this for us */
- mask &= ~CWWinGravity;
-
- if (mask & CWBackingStore) /* this is really not useful */
- mask &= ~CWBackingStore;
-
- if (mask & CWBackingPlanes) /* this is really not useful */
- mask &= ~CWBackingPlanes;
-
- if (mask & CWBackingPixel) /* this is really not useful */
- mask &= ~CWBackingPixel;
-
- if (mask & CWOverrideRedirect)
- attributes.override_redirect = pWin->overrideRedirect;
-
- if (mask & CWSaveUnder) /* this is really not useful */
- mask &= ~CWSaveUnder;
-
- if (mask & CWEventMask) /* events are handled elsewhere */
- mask &= ~CWEventMask;
-
- if (mask & CWDontPropagate) /* events are handled elsewhere */
- mask &= ~CWDontPropagate;
-
- if (mask & CWColormap) {
- ColormapPtr pCmap;
-
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP);
-
- attributes.colormap = xnestColormap(pCmap);
-
- xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
- }
-
- if (mask & CWCursor) /* this is handeled in cursor code */
- mask &= ~CWCursor;
-
- if (mask)
- XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin),
- mask, &attributes);
-
- return True;
-}
-
-Bool
-xnestRealizeWindow(WindowPtr pWin)
-{
- xnestConfigureWindow(pWin, CWStackingOrder);
-#ifdef SHAPE
- xnestShapeWindow(pWin);
-#endif /* SHAPE */
- XMapWindow(xnestDisplay, xnestWindow(pWin));
-
- return True;
-}
-
-Bool
-xnestUnrealizeWindow(WindowPtr pWin)
-{
- XUnmapWindow(xnestDisplay, xnestWindow(pWin));
-
- return True;
-}
-
-void
-xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- int i;
- BoxPtr pBox;
-
- xnestConfigureWindow(pWin, CWWidth | CWHeight);
-
- pBox = REGION_RECTS(pRegion);
- for (i = 0; i < REGION_NUM_RECTS(pRegion); i++)
- XClearArea(xnestDisplay, xnestWindow(pWin),
- pBox[i].x1 - pWin->drawable.x,
- pBox[i].y1 - pWin->drawable.y,
- pBox[i].x2 - pBox[i].x1,
- pBox[i].y2 - pBox[i].y1,
- False);
-}
-
-void
-xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- xnestConfigureWindow(pWin, CWBorderWidth);
-}
-
-void
-xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion)
-{
-}
-
-void
-xnestClipNotify(WindowPtr pWin, int dx, int dy)
-{
- xnestConfigureWindow(pWin, CWStackingOrder);
-#ifdef SHAPE
- xnestShapeWindow(pWin);
-#endif /* SHAPE */
-}
-
-static Bool
-xnestWindowExposurePredicate(Display *display, XEvent *event, XPointer ptr)
-{
- return (event->type == Expose && event->xexpose.window == *(Window *)ptr);
-}
-
-void
-xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
-{
- XEvent event;
- Window window;
- BoxRec Box;
-
- XSync(xnestDisplay, False);
-
- window = xnestWindow(pWin);
-
- while (XCheckIfEvent(xnestDisplay, &event,
- xnestWindowExposurePredicate, (char *)&window)) {
-
- Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + event.xexpose.x;
- Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + event.xexpose.y;
- Box.x2 = Box.x1 + event.xexpose.width;
- Box.y2 = Box.y1 + event.xexpose.height;
-
- event.xexpose.type = ProcessedExpose;
-
- if (RECT_IN_REGION(pWin->drawable.pScreen, pRgn, &Box) != rgnIN)
- XPutBackEvent(xnestDisplay, &event);
- }
-
- miWindowExposures(pWin, pRgn, other_exposed);
-}
-
-#ifdef SHAPE
-static Bool
-xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2)
-{
- BoxPtr pBox1, pBox2;
- unsigned int n1, n2;
-
- if (pReg1 == pReg2) return True;
-
- if (pReg1 == NullRegion || pReg2 == NullRegion) return False;
-
- pBox1 = REGION_RECTS(pReg1);
- n1 = REGION_NUM_RECTS(pReg1);
-
- pBox2 = REGION_RECTS(pReg2);
- n2 = REGION_NUM_RECTS(pReg2);
-
- if (n1 != n2) return False;
-
- if (pBox1 == pBox2) return True;
-
- if (memcmp(pBox1, pBox2, n1 * sizeof(BoxRec))) return False;
-
- return True;
-}
-
-void
-xnestShapeWindow(WindowPtr pWin)
-{
- Region reg;
- BoxPtr pBox;
- XRectangle rect;
- int i;
-
- if (!xnestRegionEqual(xnestWindowPriv(pWin)->bounding_shape,
- wBoundingShape(pWin))) {
-
- if (wBoundingShape(pWin)) {
- REGION_COPY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin));
-
- reg = XCreateRegion();
- pBox = REGION_RECTS(xnestWindowPriv(pWin)->bounding_shape);
- for (i = 0;
- i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->bounding_shape);
- i++) {
- rect.x = pBox[i].x1;
- rect.y = pBox[i].y1;
- rect.width = pBox[i].x2 - pBox[i].x1;
- rect.height = pBox[i].y2 - pBox[i].y1;
- XUnionRectWithRegion(&rect, reg, reg);
- }
- XShapeCombineRegion(xnestDisplay, xnestWindow(pWin),
- ShapeBounding, 0, 0, reg, ShapeSet);
- XDestroyRegion(reg);
- }
- else {
- REGION_EMPTY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->bounding_shape);
-
- XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
- ShapeBounding, 0, 0, None, ShapeSet);
- }
- }
-
- if (!xnestRegionEqual(xnestWindowPriv(pWin)->clip_shape,
- wClipShape(pWin))) {
-
- if (wClipShape(pWin)) {
- REGION_COPY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin));
-
- reg = XCreateRegion();
- pBox = REGION_RECTS(xnestWindowPriv(pWin)->clip_shape);
- for (i = 0;
- i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->clip_shape);
- i++) {
- rect.x = pBox[i].x1;
- rect.y = pBox[i].y1;
- rect.width = pBox[i].x2 - pBox[i].x1;
- rect.height = pBox[i].y2 - pBox[i].y1;
- XUnionRectWithRegion(&rect, reg, reg);
- }
- XShapeCombineRegion(xnestDisplay, xnestWindow(pWin),
- ShapeClip, 0, 0, reg, ShapeSet);
- XDestroyRegion(reg);
- }
- else {
- REGION_EMPTY(pWin->drawable.pScreen,
- xnestWindowPriv(pWin)->clip_shape);
-
- XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
- ShapeClip, 0, 0, None, ShapeSet);
- }
- }
-}
-#endif /* SHAPE */
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
deleted file mode 100644
index 7d9426d72..000000000
--- a/hw/xnest/XNCursor.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $Xorg: Cursor.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/XNCursor.h,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTCURSOR_H
-#define XNESTCURSOR_H
-
-typedef struct {
- Cursor cursor;
-} xnestPrivCursor;
-
-#define xnestCursorPriv(pCursor, pScreen) \
- ((xnestPrivCursor *)((pCursor)->devPriv[pScreen->myNum]))
-
-#define xnestCursor(pCursor, pScreen) \
- (xnestCursorPriv(pCursor, pScreen)->cursor)
-
-void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
-void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
- BoxPtr pTopLeftBox);
-Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
-Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed);
-Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y,
- Bool generateEvent);
-
-#endif /* XNESTCURSOR_H */
diff --git a/hw/xnest/XNFont.h b/hw/xnest/XNFont.h
deleted file mode 100644
index 34d236f3b..000000000
--- a/hw/xnest/XNFont.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $Xorg: XNFont.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/XNFont.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-
-#ifndef XNESTFONT_H
-#define XNESTFONT_H
-
-typedef struct {
- XFontStruct *font_struct;
-} xnestPrivFont;
-
-extern int xnestFontPrivateIndex;
-
-#define xnestFontPriv(pFont) \
- ((xnestPrivFont *)FontGetPrivate(pFont, xnestFontPrivateIndex))
-
-#define xnestFontStruct(pFont) (xnestFontPriv(pFont)->font_struct)
-
-#define xnestFont(pFont) (xnestFontStruct(pFont)->fid)
-
-Bool xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont);
-Bool xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
-
-#endif /* XNESTFONT_H */
diff --git a/hw/xnest/XNGC.h b/hw/xnest/XNGC.h
deleted file mode 100644
index bbec67120..000000000
--- a/hw/xnest/XNGC.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Xorg: XNGC.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/XNGC.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTGC_H
-#define XNESTGC_H
-
-/* This file uses the GC definition form Xlib.h as XlibGC. */
-
-typedef struct {
- XlibGC gc;
- int nClipRects;
-} xnestPrivGC;
-
-extern int xnestGCPrivateIndex;
-
-#define xnestGCPriv(pGC) \
- ((xnestPrivGC *)((pGC)->devPrivates[xnestGCPrivateIndex].ptr))
-
-#define xnestGC(pGC) (xnestGCPriv(pGC)->gc)
-
-Bool xnestCreateGC(GCPtr pGC);
-void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
-void xnestChangeGC(GCPtr pGC, unsigned long mask);
-void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-void xnestDestroyGC(GCPtr pGC);
-void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects);
-void xnestDestroyClip(GCPtr pGC);
-void xnestDestroyClipHelper(GCPtr pGC);
-void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
-
-#endif /* XNESTGC_H */
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
deleted file mode 100644
index 4e4d9c40c..000000000
--- a/hw/xnest/XNPixmap.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $Xorg: Pixmap.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/XNPixmap.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTPIXMAP_H
-#define XNESTPIXMAP_H
-
-#ifdef PIXPRIV
-extern int xnestPixmapPrivateIndex;
-#endif
-
-typedef struct {
- Pixmap pixmap;
-} xnestPrivPixmap;
-
-#ifdef PIXPRIV
-#define xnestPixmapPriv(pPixmap) \
- ((xnestPrivPixmap *)((pPixmap)->devPrivates[xnestPixmapPrivateIndex].ptr))
-#else
-#define xnestPixmapPriv(pPixmap) \
- ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr))
-#endif
-
-#define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap)
-
-#define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
-
-PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
- int depth);
-Bool xnestDestroyPixmap(PixmapPtr pPixmap);
-RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
-
-#endif /* XNESTPIXMAP_H */
diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h
deleted file mode 100644
index 8b5f39115..000000000
--- a/hw/xnest/XNWindow.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* $Xorg: XNWindow.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/XNWindow.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
-
-#ifndef XNESTWINDOW_H
-#define XNESTWINDOW_H
-
-typedef struct {
- Window window;
- Window parent;
- int x;
- int y;
- unsigned int width;
- unsigned int height;
- unsigned int border_width;
- Window sibling_above;
-#ifdef SHAPE
- RegionPtr bounding_shape;
- RegionPtr clip_shape;
-#endif /* SHAPE */
-} xnestPrivWin;
-
-typedef struct {
- WindowPtr pWin;
- Window window;
-} xnestWindowMatch;
-
-extern int xnestWindowPrivateIndex;
-
-#define xnestWindowPriv(pWin) \
- ((xnestPrivWin *)((pWin)->devPrivates[xnestWindowPrivateIndex].ptr))
-
-#define xnestWindow(pWin) (xnestWindowPriv(pWin)->window)
-
-#define xnestWindowParent(pWin) \
- ((pWin)->parent ? \
- xnestWindow((pWin)->parent) : \
- xnestDefaultWindows[pWin->drawable.pScreen->myNum])
-
-#define xnestWindowSiblingAbove(pWin) \
- ((pWin)->prevSib ? xnestWindow((pWin)->prevSib) : None)
-
-#define xnestWindowSiblingBelow(pWin) \
- ((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : None)
-
-#define CWParent CWSibling
-#define CWStackingOrder CWStackMode
-
-WindowPtr xnestWindowPtr(Window window);
-Bool xnestCreateWindow(WindowPtr pWin);
-Bool xnestDestroyWindow(WindowPtr pWin);
-Bool xnestPositionWindow(WindowPtr pWin, int x, int y);
-void xnestConfigureWindow(WindowPtr pWin, unsigned int mask);
-Bool xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
-Bool xnestRealizeWindow(WindowPtr pWin);
-Bool xnestUnrealizeWindow(WindowPtr pWin);
-void xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what);
-void xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what);
-void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion);
-void xnestClipNotify(WindowPtr pWin, int dx, int dy);
-void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
- RegionPtr other_exposed);
-#ifdef SHAPE
-void xnestShapeWindow(WindowPtr pWin);
-#endif /* SHAPE */
-
-#endif /* XNESTWINDOW_H */
diff --git a/hw/xnest/Xnest.h b/hw/xnest/Xnest.h
deleted file mode 100644
index 64b09de7e..000000000
--- a/hw/xnest/Xnest.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $Xorg: Xnest.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
-/*
-
-Copyright (c) 1995 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Xnest.h,v 1.3 2001/08/28 16:48:08 tsi Exp $ */
-
-/*
-** Machines with a 64 bit library interface and a 32 bit server require
-** name changes to protect the guilty.
-*/
-#ifdef _XSERVER64
-#define _XSERVER64_tmp
-#undef _XSERVER64
-typedef unsigned long XID64;
-typedef unsigned long Mask64;
-typedef unsigned long Atom64;
-typedef unsigned long VisualID64;
-typedef unsigned long Time64;
-#define XID XID64
-#define Mask Mask64
-#define Atom Atom64
-#define VisualID VisualID64
-#define Time Time64
-typedef XID Window64;
-typedef XID Drawable64;
-typedef XID Font64;
-typedef XID Pixmap64;
-typedef XID Cursor64;
-typedef XID Colormap64;
-typedef XID GContext64;
-typedef XID KeySym64;
-#define Window Window64
-#define Drawable Drawable64
-#define Font Font64
-#define Pixmap Pixmap64
-#define Cursor Cursor64
-#define Colormap Colormap64
-#define GContext GContext64
-#define KeySym KeySym64
-#endif /*_XSERVER64*/
-
-#define GC XlibGC
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/shape.h>
-#undef GC
-
-#ifdef _XSERVER64_tmp
-#define _XSERVER64
-#undef _XSERVER64_tmp
-#undef XID
-#undef Mask
-#undef Atom
-#undef VisualID
-#undef Time
-#undef Window
-#undef Drawable
-#undef Font
-#undef Pixmap
-#undef Cursor
-#undef Colormap
-#undef GContext
-#undef KeySym
-#endif /*_XSERVER64_tmp*/
-
-
-
-
-
-
diff --git a/hw/xnest/Xnest.man.pre b/hw/xnest/Xnest.man.pre
deleted file mode 100644
index 488489189..000000000
--- a/hw/xnest/Xnest.man.pre
+++ /dev/null
@@ -1,264 +0,0 @@
-.\" $Xorg: Xnest.man,v 1.3 2000/08/17 19:53:28 cpqbld Exp $
-.\" Copyright (c) 1993, 1994 X Consortium
-.\"
-.\" Permission is hereby granted, free of charge, to any person obtaining
-.\" a copy of this software and associated documentation files (the
-.\" "Software"), to deal in the Software without restriction, including
-.\" without limitation the rights to use, copy, modify, merge, publish,
-.\" distribute, sublicense, and/or sell copies of the Software, and to
-.\" permit persons to whom the Software is furnished to do so, subject to
-.\" the following conditions:
-.\"
-.\" The above copyright notice and this permission notice shall be included
-.\" in all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-.\" OTHER DEALINGS IN THE SOFTWARE.
-.\"
-.\" Except as contained in this notice, the name of the X Consortium shall
-.\" not be used in advertising or otherwise to promote the sale, use or
-.\" other dealings in this Software without prior written authorization
-.\" from the X Consortium.
-.\"
-.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.7 2003/10/24 17:22:33 dawes Exp $
-.\"
-.TH XNEST 1 __xorgversion__
-.SH NAME
-Xnest \- a nested X server
-.SH SYNOPSIS
-.B Xnest
-[-options]
-.SH DESCRIPTION
-\fIXnest\fP is a client and a server. \fIXnest\fP is a client of the
-real server which manages windows and graphics requests on its behalf.
-\fIXnest\fP is a server to its own clients. \fIXnest\fP manages
-windows and graphics requests on their behalf. To these clients
-\fIXnest\fP appears to be a conventional server.
-.SH OPTIONS
-\fIXnest\fP supports all standard options of the sample server
-implementation. For more details, please see the manual page on your
-system for \fIXserver\fP. The following additional arguments are
-supported as well.
-.TP 4
-.B \-display \fIstring\fP
-This option specifies the display name of the real server that
-\fIXnest\fP should try to connect with. If it is not provided on the
-command line \fIXnest\fP will read the \fIDISPLAY\fP environment
-variable in order to find out the same information.
-.TP 4
-.B \-sync
-This option tells \fIXnest\fP to synchronize its window and graphics
-operations with the real server. This is a useful option for
-debugging, but it will slow down the performance considerably. It
-should not be used unless absolutely necessary.
-.TP 4
-.B \-full
-This option tells \fIXnest\fP to utilize full regeneration of real
-server objects and reopen a new connection to the real server each
-time the nested server regenerates. The sample server implementation
-regenerates all objects in the server when the last client of this
-server terminates. When this happens, \fIXnest\fP by default
-maintains the same top level window and the same real server
-connection in each new generation. If the user selects full
-regeneration, even the top level window and the connection to the real
-server will be regenerated for each server generation.
-.TP 4
-.B \-class \fIstring\fP
-This option specifies the default visual class of the nested server.
-It is similar to the \fI-cc\fP option from the set of standard options
-except that it will accept a string rather than a number for the
-visual class specification. The string must be one of the following
-six values: \fIStaticGray\fP, \fIGrayScale\fP, \fIStaticColor\fP,
-\fIPseudoColor\fP, \fITrueColor\fP, or \fIDirectColor\fP. If both,
-\fI-class\fP and \fI-cc\fP options are specified, the last instance of
-either option assumes precedence. The class of the default visual of
-the nested server need not be the same as the class of the default
-visual of the real server; although, it has to be supported by the
-real server. See \fIxdpyinfo\fP for a list of supported visual
-classes on the real server before starting \fIXnest\fP. If the user
-chooses a static class, all the colors in the default colormap will be
-preallocated. If the user chooses a dynamic class, colors in the
-default colormap will be available to individual clients for
-allocation.
-.TP 4
-.B \-depth \fIint\fP
-This option specifies the default visual depth of the nested server.
-The depth of the default visual of the nested server need not be the
-same as the depth of the default visual of the real server; although,
-it has to be supported by the real server. See \fIxdpyinfo\fP for a
-list of supported visual depths on the real server before starting
-\fIXnest\fP.
-.TP 4
-.B \-sss
-This option tells \fIXnest\fP to use the software screen saver. By
-default \fIXnest\fP will use the screen saver that corresponds to the
-hardware screen saver in the real server. Of course, even this screen
-saver is software generated since \fIXnest\fP does not control any
-actual hardware. However, it is treated as a hardware screen saver
-within the sample server code.
-.TP 4
-.B \-geometry \fIWxH+X+Y\fP
-This option specifies geometry parameters for the top level
-\fIXnest\fP windows. These windows corresponds to the root windows of
-the nested server. The width and height specified with this option
-will be the maximum width and height of each top level \fIXnest\fP
-window. \fIXnest\fP will allow the user to make any top level window
-smaller, but it will not actually change the size of the nested server
-root window. As of yet, there is no mechanism within the sample
-server implementation to change the size of the root window after
-screen initialization. In order to do so, one would probably need to
-extend the X protocol. Therefore, it is not likely that this will be
-available any time soon. If this option is not specified \fIXnest\fP
-will choose width and height to be 3/4 of the dimensions of the root
-window of the real server.
-.TP 4
-.B \-bw \fIint\fP
-This option specifies the border width of the top level \fIXnest\fP
-window. The integer parameter must be a positive number. The default
-border width is 1.
-.TP 4
-.B \-name \fIstring\fP
-This option specifies the name of the top level \fIXnest\fP window.
-The default value is the program name.
-.TP 4
-.B \-scrns \fIint\fP
-This option specifies the number of screens to create in the nested
-server. For each screen, \fIXnest\fP will create a separate top level
-window. Each screen is referenced by the number after the dot in the
-client display name specification. For example, \fIxterm -display
-:1.1\fP will open an \fIxterm\fP client in the nested server with the
-display number \fI:1\fP on the second screen. The number of screens
-is limited by the hard coded constant in the server sample code which
-is usually 3.
-.TP 4
-.B \-install
-This option tells \fIXnest\fP to do its own colormap installation by
-bypassing the real window manager. For it to work properly the user
-will probably have to temporarily quit the real window manager. By
-default \fIXnest\fP will keep the nested client window whose colormap
-should be installed in the real server in the
-\fIWM\_COLORMAP\_WINDOWS\fP property of the top level \fIXnest\fP
-window. If this colormap is of the same visual type as the root
-window of the nested server, \fIXnest\fP will associate this colormap
-with the top level \fIXnest\fP window as well. Since this does not
-have to be the case, window managers should look primarily at the
-\fIWM\_COLORMAP\_WINDOWS\fP property rather than the colormap
-associated with the top level \fIXnest\fP window. Unfortunately,
-window managers are not very good at doing that yet so this option
-might come in handy.
-.TP 4
-.B \-parent \fIwindow_id\fP
-This option tells \fIXnest\fP to use the \fIwindow_id\fP as the
-root window instead of creating a window. This option is used
-by the xrx xnestplugin.
-.SH USAGE
-Starting up \fIXnest\fP is as simple as starting up \fIxclock\fP from
-a terminal emulator. If a user wishes to run \fIXnest\fP on the same
-workstation as the real server, it is important that the nested server
-is given its own listening socket address. Therefore, if there is a
-server already running on the user's workstation, \fIXnest\fP will
-have to be started up with a new display number. Since there is
-usually no more than one server running on a workstation, specifying
-\fIXnest :1\fP on the command line will be sufficient for most users.
-For each server running on the workstation the display number needs to
-be incremented by one. Thus, if you wish to start another
-\fIXnest\fP, you will need to type \fIXnest :2\fP on the command line.
-.PP
-To run clients in the nested server each client needs to be given the
-same display number as the nested server. For example, \fIxterm
--display :1\fP will start up an \fIxterm\fP in the first nested server
-and \fIxterm -display :2\fP will start an \fIxterm\fP in the second
-nested server from the example above. Additional clients can be
-started from these \fIxterm\fPs in each nested server.
-.SH XNEST AS A CLIENT
-\fIXnest\fP behaves and looks to the real server and other real
-clients as another real client. It is a rather demanding client,
-however, since almost any window or graphics request from a nested
-client will result in a window or graphics request from \fIXnest\fP to
-the real server. Therefore, it is desirable that \fIXnest\fP and the
-real server are on a local network, or even better, on the same
-machine. As of now, \fIXnest\fP assumes that the real server supports
-the shape extension. There is no way to turn off this assumption
-dynamically. \fIXnest\fP can be compiled without the shape extension
-built in, and in that case the real server need not support it. The
-dynamic shape extension selection support should be considered in
-further development of \fIXnest\fP.
-.PP
-Since \fIXnest\fP need not use the same default visual as the the real
-server, the top level window of the \fIXnest\fP client always has its
-own colormap. This implies that other windows' colors will not be
-displayed properly while the keyboard or pointer focus is in the
-\fIXnest\fP window, unless the real server has support for more than
-one installed colormap at any time. The colormap associated with the
-top window of the \fIXnest\fP client need not be the appropriate
-colormap that the nested server wants installed in the real server.
-In the case that a nested client attempts to install a colormap of a
-different visual from the default visual of the nested server,
-\fIXnest\fP will put the top window of this nested client and all
-other top windows of the nested clients that use the same colormap
-into the \fIWM\_COLORMAP\_WINDOWS\fP property of the top level
-\fIXnest\fP window on the real server. Thus, it is important that the
-real window manager that manages the \fIXnest\fP top level window
-looks at the \fIWM\_COLORMAP\_WINDOWS\fP property rather than the
-colormap associated with the top level \fIXnest\fP window. Since most
-window managers appear to not implement this convention properly as of
-yet, \fIXnest\fP can optionally do direct installation of colormaps
-into the real server bypassing the real window manager. If the user
-chooses this option, it is usually necessary to temporarily disable
-the real window manager since it will interfere with the \fIXnest\fP
-scheme of colormap installation.
-.PP
-Keyboard and pointer control procedures of the nested server change
-the keyboard and pointer control parameters of the real server.
-Therefore, after \fIXnest\fP is started up, it will change the
-keyboard and pointer controls of the real server to its own internal
-defaults. Perhaps there should be a command line option to tell
-\fIXnest\fP to inherit the keyboard and pointer control parameters
-from the real server rather than imposing its own. This is a future
-consideration.
-.SH XNEST AS A SERVER
-\fIXnest\fP as a server looks exactly like a real server to its own
-clients. For the clients there is no way of telling if they are
-running on a real or a nested server.
-.PP
-As already mentioned, \fIXnest\fP is a very user friendly server when
-it comes to customization. \fIXnest\fP will pick up a number of
-command line arguments that can configure its default visual class and
-depth, number of screens, etc. In the future, \fIXnest\fP should read
-a customization input file to provide even greater freedom and
-simplicity in selecting the desired layout. Unfortunately, there is
-no support for backing store and save under as of yet, but this should
-also be considered in the future development of \fIXnest\fP.
-.PP
-The only apparent intricacy from the users' perspective about using
-\fIXnest\fP as a server is the selection of fonts. \fIXnest\fP
-manages fonts by loading them locally and then passing the font name
-to the real server and asking it to load that font remotely. This
-approach avoids the overload of sending the glyph bits across the
-network for every text operation, although it is really a bug. The
-proper implementation of fonts should be moved into the \fIos\fP
-layer. The consequence of this approach is that the user will have to
-worry about two different font paths - a local one for the nested
-server and a remote one for the real server - since \fIXnest\fP does
-not propagate its font path to the real server. The reason for this
-is because real and nested servers need not run on the same file
-system which makes the two font paths mutually incompatible. Thus, if
-there is a font in the local font path of the nested server, there is
-no guarantee that this font exists in the remote font path of the real
-server. \fIXlsfonts\fP client, if run on the nested server will list
-fonts in the local font path and if run on the real server will list
-fonts in the remote font path. Before a font can be successfully
-opened by the nested server it has to exist in local and remote font
-paths. It is the users' responsibility to make sure that this is the
-case.
-.SH BUGS
-Won't run well on servers supporting different visual depths.
-Still crashes randomly. Probably has some memory leaks.
-.SH AUTHOR
-Davor Matic, MIT X Consortium
-
diff --git a/hw/xnest/icon b/hw/xnest/icon
deleted file mode 100644
index 725f1131a..000000000
--- a/hw/xnest/icon
+++ /dev/null
@@ -1,14 +0,0 @@
-#define icon_width 32
-#define icon_height 32
-static unsigned char icon_bits[] = {
- 0xff, 0x00, 0x00, 0xc0, 0xfe, 0x01, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x60,
- 0xf8, 0x07, 0x00, 0x30, 0xf8, 0x07, 0x00, 0x18, 0xf0, 0x0f, 0x00, 0x0c,
- 0xe0, 0x1f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x03,
- 0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00, 0x00, 0xfe, 0x61, 0x00,
- 0x00, 0xfe, 0x31, 0x00, 0x00, 0xfc, 0x33, 0x00, 0x00, 0xf8, 0x1b, 0x00,
- 0x00, 0xf0, 0x0d, 0x00, 0x00, 0xf0, 0x0e, 0x00, 0x00, 0x60, 0x1f, 0x00,
- 0x00, 0xb0, 0x3f, 0x00, 0x00, 0x98, 0x7f, 0x00, 0x00, 0x98, 0x7f, 0x00,
- 0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01, 0x00, 0x03, 0xfc, 0x03,
- 0x80, 0x01, 0xfc, 0x03, 0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xf0, 0x0f,
- 0x60, 0x00, 0xe0, 0x1f, 0x30, 0x00, 0xe0, 0x1f, 0x18, 0x00, 0xc0, 0x3f,
- 0x0c, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0xff};
diff --git a/hw/xnest/os2Stub.c b/hw/xnest/os2Stub.c
deleted file mode 100644
index 15282d206..000000000
--- a/hw/xnest/os2Stub.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * (c) Copyright 1996 by Sebastien Marineau
- * <marineau@genie.uottawa.ca>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Sebastien Marineau shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Sebastien Marineau.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.2 2003/11/06 03:25:46 dawes Exp $ */
-
-/* This below implements select() for calls in xnest. It has been */
-/* somewhat optimized for improved performance, but assumes a few */
-/* things so it cannot be used as a general select. */
-
-#define I_NEED_OS2_H
-#include "Xpoll.h"
-#include <stdio.h>
-#include <sys/select.h>
-#include <sys/errno.h>
-#include <sys/time.h>
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSNPIPES
-#define INCL_DOSMISC
-#define INCL_DOSMODULEMGR
-#undef BOOL
-#undef BYTE
-#include <os2.h>
-
-HEV hPipeSem;
-HMODULE hmod_so32dll;
-static int (*os2_tcp_select)(int*,int,int,int,long);
-ULONG os2_get_sys_millis();
-extern int _files[];
-
-#define MAX_TCP 256
-/* These lifted from sys/emx.h. Change if that changes there! */
-#define F_SOCKET 0x10000000
-#define F_PIPE 0x20000000
-
-struct select_data
-{
- fd_set read_copy;
- fd_set write_copy;
- BOOL have_read;
- BOOL have_write;
- int tcp_select_mask[MAX_TCP];
- int tcp_emx_handles[MAX_TCP];
- int tcp_select_copy[MAX_TCP];
- int socket_nread;
- int socket_nwrite;
- int socket_ntotal;
- int pipe_ntotal;
- int pipe_have_write;
- int max_fds;
-};
-
-int os2PseudoSelect(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
-{
-static BOOL FirstTime=TRUE;
-static haveTCPIP=TRUE;
-ULONG timeout_ms;
-ULONG postCount, start_millis,now_millis;
-char faildata[16];
-struct select_data sd;
-BOOL any_ready;
-int np,ns, i,ready_handles,n;
-APIRET rc;
-
-sd.have_read=FALSE; sd.have_write=FALSE;
-sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0;
-sd.max_fds=31; ready_handles=0; any_ready=FALSE;
-sd.pipe_ntotal=0; sd.pipe_have_write=FALSE;
-
-if(FirstTime){
- /* First load the so32dll.dll module and get a pointer to the SELECT function */
-
- if((rc=DosLoadModule(faildata,sizeof(faildata),"SO32DLL",&hmod_so32dll))!=0){
- fprintf(stderr, "Could not load module so32dll.dll, rc = %d. Error note %s\n",rc,faildata);
- haveTCPIP=FALSE;
- }
- if((rc = DosQueryProcAddr(hmod_so32dll, 0, "SELECT", (PPFN)&os2_tcp_select))!=0){
- fprintf(stderr, "Could not query address of SELECT, rc = %d.\n",rc);
- haveTCPIP=FALSE;
- }
- /* Call these a first time to set the semaphore */
- /* rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE);
- if(rc) {
- fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc);
- return(-1);
- }
- rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/
-
- /*fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem);*/
-
- FirstTime = FALSE;
-}
-
-/* Set up the time delay structs */
-
- if(timeout!=NULL) {
- timeout_ms=timeout->tv_sec*1000+timeout->tv_usec/1000;
- }
- else { timeout_ms=1000000; } /* This should be large enough... */
- if(timeout_ms>0) start_millis=os2_get_sys_millis();
-
-/* Copy the masks */
- {FD_ZERO(&sd.read_copy);}
- {FD_ZERO(&sd.write_copy);}
- if(readfds!=NULL){ XFD_COPYSET(readfds,&sd.read_copy); sd.have_read=TRUE;}
- if(writefds!=NULL) {XFD_COPYSET(writefds,&sd.write_copy);sd.have_write=TRUE;}
-
-/* And zero the original masks */
- if(sd.have_read){ FD_ZERO(readfds);}
- if(sd.have_write) {FD_ZERO(writefds);}
- if(exceptfds != NULL) {FD_ZERO(exceptfds);}
-
-/* Now we parse the fd_sets passed to select and separate pipe/sockets */
- n = os2_parse_select(&sd,nfds);
- if(n == -1) {
- errno = EBADF;
- return (-1);
- }
-
-/* Now we have three cases: either we have sockets, pipes, or both */
-/* We handle all three cases differently to optimize things */
-
-/* Case 1: only pipes! */
- if((sd.pipe_ntotal >0) && (!sd.socket_ntotal)){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- return (np);
- }
- else if (np == -1) { return(-1); }
- while(!any_ready){
- rc = DosWaitEventSem(hPipeSem, 1L);
- /* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */
- if(rc == 640) {
- return(0);
- }
- if((rc != 0) && (rc != 95)) {errno= EBADF; return(-1);}
- np = os2_check_pipes(&sd,readfds,writefds);
- if (np > 0){
- return(np);
- }
- else if (np < 0){ return(-1); }
- }
- }
-
-/* Case 2: only sockets. Just let the os/2 tcp select do the work */
- if((sd.socket_ntotal > 0) && (!sd.pipe_ntotal)){
- ns = os2_check_sockets(&sd, readfds, writefds, timeout_ms);
- return (ns);
- }
-
-/* Case 3: combination of both */
- if((sd.socket_ntotal > 0) && (sd.pipe_ntotal)){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- any_ready=TRUE;
- ready_handles += np;
- }
- else if (np == -1) { return(-1); }
-
- ns = os2_check_sockets(&sd,readfds,writefds, 0);
- if(ns>0){
- ready_handles+=ns;
- any_ready = TRUE;
- }
- else if (ns == -1) {return(-1);}
-
- while (!any_ready && timeout_ms){
-
- rc = DosWaitEventSem(hPipeSem, 1L);
- if (rc==640) return(0);
- if(rc == 0){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- ready_handles+=np;
- any_ready = TRUE;
- }
- else if (np == -1) {
- return(-1); }
- }
-
- ns = os2_check_sockets(&sd,readfds,writefds,exceptfds, 0);
- if(ns>0){
- ready_handles+=ns;
- any_ready = TRUE;
- }
- else if (ns == -1) {return(-1);}
-
- if (i%8 == 0) {
- now_millis = os2_get_sys_millis();
- if((now_millis-start_millis) > timeout_ms) timeout_ms = 0;
- }
- i++;
- }
- }
-
-return(ready_handles);
-}
-
-
-ULONG os2_get_sys_millis()
-{
- APIRET rc;
- ULONG milli;
-
- rc = DosQuerySysInfo(14, 14, &milli, sizeof(milli));
- if(rc) {
- fprintf(stderr,"Bad return code querying the millisecond counter! rc=%d\n",rc);
- return(0);
- }
- return(milli);
-}
-
-int os2_parse_select(sd,nfds)
-struct select_data *sd;
-int nfds;
-{
- int i;
- APIRET rc;
-/* First we determine up to which descriptor we need to check. */
-/* No need to check up to 256 if we don't have to (and usually we dont...)*/
-/* Note: stuff here is hardcoded for fd_sets which are int[8] as in EMX! */
-
- if(nfds > sd->max_fds){
- for(i=0;i<((FD_SETSIZE+31)/32);i++){
- if(sd->read_copy.fds_bits[i] ||
- sd->write_copy.fds_bits[i])
- sd->max_fds=(i*32) +32;
- }
- }
- else { sd->max_fds = nfds; }
-/* Check if result is greater than specified in select() call */
- if(sd->max_fds > nfds) sd->max_fds = nfds;
-
- if (sd->have_read)
- {
- for (i = 0; i < sd->max_fds; ++i) {
- if (FD_ISSET (i, &sd->read_copy)){
- if(_files[i] & F_SOCKET)
- {
- sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
- sd->tcp_emx_handles[sd->socket_ntotal]=i;
- sd->socket_ntotal++; sd->socket_nread++;
- }
- else if (_files[i] & F_PIPE)
- {
- sd -> pipe_ntotal++;
- /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
- if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */
- }
- }
- }
- }
-
- if (sd->have_write)
- {
- for (i = 0; i < sd->max_fds; ++i) {
- if (FD_ISSET (i, &sd->write_copy)){
- if(_files[i] & F_SOCKET)
- {
- sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
- sd->tcp_emx_handles[sd->socket_ntotal]=i;
- sd->socket_ntotal++; sd->socket_nwrite++;
- }
- else if (_files[i] & F_PIPE)
- {
- sd -> pipe_ntotal++;
- /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
- if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */
- sd -> pipe_have_write=TRUE;
- }
- }
- }
- }
-
-
-return(sd->socket_ntotal);
-}
-
-
-int os2_check_sockets(sd,readfds,writefds)
-struct select_data *sd;
-fd_set *readfds,*writefds;
-{
- int e,i;
- int j,n;
- memcpy(sd->tcp_select_copy,sd->tcp_select_mask,
- sd->socket_ntotal*sizeof(int));
-
- e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread,
- sd->socket_nwrite, 0, 0);
-
- if(e == 0) return(e);
-/* We have something ready? */
- if(e>0){
- j = 0; n = 0;
- for (i = 0; i < sd->socket_nread; ++i, ++j)
- if (sd->tcp_select_copy[j] != -1)
- {
- FD_SET (sd->tcp_emx_handles[j], readfds);
- n ++;
- }
- for (i = 0; i < sd->socket_nwrite; ++i, ++j)
- if (sd->tcp_select_copy[j] != -1)
- {
- FD_SET (sd->tcp_emx_handles[j], writefds);
- n ++;
- }
- errno = 0;
-
- return n;
- }
- if(e<0){
- /*Error -- TODO. EBADF is a good choice for now. */
- fprintf(stderr,"Error in server select! e=%d\n",e);
- errno = EBADF;
- return (-1);
- }
- }
-
-/* Check to see if anything is ready on pipes */
-
-int os2_check_pipes(sd,readfds,writefds)
-struct select_data *sd;
-fd_set *readfds,*writefds;
-{
-int i,e;
-ULONG ulPostCount;
-PIPESEMSTATE pipeSemState[128];
-APIRET rc;
- e = 0;
- rc = DosResetEventSem(hPipeSem,&ulPostCount);
- rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState,
- sizeof(pipeSemState));
- if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc);
- i=0;
- while (pipeSemState[i].fStatus != 0) {
- /*fprintf(stderr,"SELECT: sem entry, stat=%d, flag=%d, key=%d,avail=%d\n",
- pipeSemState[i].fStatus,pipeSemState[i].fFlag,pipeSemState[i].usKey,
- pipeSemState[i].usAvail); */
- if((pipeSemState[i].fStatus == 1) &&
- (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy))){
- FD_SET(pipeSemState[i].usKey,readfds);
- e++;
- }
- else if((pipeSemState[i].fStatus == 2) &&
- (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy))){
- FD_SET(pipeSemState[i].usKey,writefds);
- e++;
- }
- else if( (pipeSemState[i].fStatus == 3) &&
- ( (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy)) ||
- (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy)) )){
- errno = EBADF;
- /* fprintf(stderr,"Pipe has closed down, fd=%d\n",pipeSemState[i].usKey); */
- return (-1);
- }
- i++;
- } /* endwhile */
- /*fprintf(stderr,"Done listing pipe sem entries, total %d entries, total ready entries %d\n",i,e);*/
-errno = 0;
-return(e);
-}
-
diff --git a/hw/xnest/screensaver b/hw/xnest/screensaver
deleted file mode 100644
index 4940f2650..000000000
--- a/hw/xnest/screensaver
+++ /dev/null
@@ -1,686 +0,0 @@
-#define screensaver_width 256
-#define screensaver_height 256
-static unsigned char screensaver_bits[] = {
- 0xa8, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x40, 0x55,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x50,
- 0x55, 0x05, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00,
- 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0xa0,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x15, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0xaa,
- 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0xa0,
- 0xaa, 0x0a, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x50,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xaa, 0x2a, 0x80, 0x02, 0x80, 0xaa, 0xaa, 0x82, 0x0a, 0xa8, 0x28, 0x80,
- 0x8a, 0x80, 0x2a, 0x80, 0x80, 0x8a, 0xa2, 0x82, 0x0a, 0xaa, 0x0a, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x80, 0x82, 0x41, 0x40, 0x00, 0x50,
- 0x55, 0x41, 0x00, 0x00, 0x04, 0x00, 0x54, 0x40, 0x10, 0x00, 0x40, 0x00,
- 0x51, 0x55, 0x00, 0x15, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x41, 0x00, 0x10, 0x14, 0x00, 0x00, 0x00, 0xa8, 0x8a, 0x02, 0x00, 0x02,
- 0x00, 0x20, 0xa2, 0x00, 0x80, 0x00, 0x08, 0x00, 0xaa, 0x2a, 0x00, 0x2a,
- 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80,
- 0x01, 0x00, 0x01, 0x50, 0x45, 0x05, 0x00, 0x01, 0x10, 0x10, 0x40, 0x11,
- 0x40, 0x00, 0x44, 0x00, 0x50, 0x15, 0x01, 0x15, 0x04, 0x00, 0x40, 0x00,
- 0x05, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x50, 0x20, 0x00, 0x00, 0xa2,
- 0xaa, 0x2a, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x08, 0x00, 0x00, 0x00, 0x00,
- 0xa2, 0xaa, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x20,
- 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x01, 0x40, 0x44, 0x15, 0x10, 0x01,
- 0x10, 0x10, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x54, 0x55, 0x41, 0x45,
- 0x04, 0x00, 0x40, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x54,
- 0x20, 0x80, 0x00, 0x82, 0xaa, 0x0a, 0x00, 0x00, 0x22, 0x00, 0x80, 0x0a,
- 0x00, 0x00, 0x82, 0x00, 0xa0, 0x8a, 0x22, 0x02, 0x00, 0x08, 0x20, 0x00,
- 0xa8, 0x00, 0x00, 0x20, 0x00, 0x80, 0x00, 0x2a, 0x10, 0x40, 0x00, 0x01,
- 0x54, 0x45, 0x10, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00,
- 0x50, 0x45, 0x05, 0x41, 0x00, 0x04, 0x10, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x15, 0x00, 0x28, 0x00, 0xaa, 0xaa, 0x0a, 0x0a, 0x00,
- 0x20, 0x08, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0xa8, 0xa2, 0x22, 0x2a,
- 0x00, 0x00, 0x0a, 0x00, 0xa8, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0a,
- 0x50, 0x05, 0x00, 0x01, 0x55, 0x45, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40,
- 0x01, 0x00, 0x00, 0x00, 0x40, 0x55, 0x11, 0x00, 0x00, 0x54, 0x01, 0x00,
- 0x44, 0x01, 0x00, 0x00, 0x05, 0x40, 0x00, 0x05, 0x00, 0x08, 0x00, 0x80,
- 0xaa, 0xaa, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x80, 0x00,
- 0x80, 0xaa, 0x28, 0x20, 0x00, 0x00, 0x02, 0x00, 0x80, 0x02, 0x00, 0x00,
- 0x28, 0x00, 0x80, 0x02, 0x10, 0x10, 0x00, 0x01, 0x54, 0x45, 0x01, 0x00,
- 0x41, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x10, 0x55, 0x14, 0x00,
- 0x00, 0x04, 0x04, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x40, 0x40, 0x01,
- 0x08, 0x00, 0x80, 0x00, 0xa8, 0xa2, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0xa0, 0xaa, 0x00, 0x80, 0x28, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00,
- 0x80, 0x02, 0x00, 0x00, 0x80, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x14, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x00, 0x40, 0x00, 0x00, 0x08, 0x20, 0x80, 0x00, 0x08, 0x08, 0x80, 0x80,
- 0x80, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8a, 0x00,
- 0x02, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01,
- 0x10, 0x10, 0x00, 0x01, 0x10, 0x45, 0x55, 0x01, 0x00, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00,
- 0x20, 0xa2, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x00, 0x80, 0x00, 0x02, 0x04, 0x00, 0x40, 0x00, 0x04, 0x04, 0x40, 0x40,
- 0x00, 0x01, 0x00, 0x04, 0x04, 0x00, 0x00, 0x01, 0x00, 0x51, 0x45, 0x05,
- 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x45, 0x01,
- 0x2a, 0x80, 0xaa, 0xaa, 0x82, 0xaa, 0x2a, 0xa0, 0x02, 0x02, 0x80, 0xa8,
- 0x00, 0x2a, 0xa0, 0x02, 0x80, 0xa2, 0x00, 0xa0, 0xa0, 0x0a, 0xa0, 0x00,
- 0x00, 0x00, 0x80, 0x88, 0x02, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x50, 0x41, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55,
- 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xa0, 0xaa, 0x0a,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x2a, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8,
- 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x55, 0x55,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x15, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xa8, 0xaa,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x15, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0,
- 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x2a, 0x20, 0x00, 0x00, 0x41, 0x05, 0x55, 0x54, 0x11, 0x04, 0x00, 0x14,
- 0x40, 0x10, 0x44, 0x15, 0x15, 0x00, 0x00, 0x50, 0x01, 0x00, 0x50, 0x55,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x10, 0x50, 0x40,
- 0x82, 0x08, 0x02, 0x08, 0x20, 0x08, 0x00, 0x22, 0xa0, 0x20, 0x88, 0x00,
- 0x22, 0x00, 0x00, 0xa8, 0x2a, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x80, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0xaa, 0x08, 0x88, 0x20, 0x44, 0x10, 0x01, 0x04,
- 0x50, 0x04, 0x00, 0x41, 0x10, 0x11, 0x44, 0x00, 0x41, 0x00, 0x00, 0x54,
- 0x41, 0x00, 0x40, 0x55, 0x15, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00,
- 0x54, 0x11, 0x04, 0x11, 0x80, 0x20, 0x02, 0x08, 0xa0, 0x08, 0x00, 0x02,
- 0x88, 0x20, 0x88, 0x00, 0x82, 0x00, 0x00, 0x2a, 0x22, 0x00, 0x80, 0xaa,
- 0x2a, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x08, 0x20,
- 0x40, 0x10, 0x01, 0x04, 0x50, 0x04, 0x00, 0x01, 0x04, 0x41, 0x44, 0x00,
- 0x41, 0x00, 0x00, 0x15, 0x05, 0x14, 0x15, 0x50, 0x10, 0x05, 0x40, 0x41,
- 0x41, 0x10, 0x45, 0x05, 0x50, 0x04, 0x04, 0x10, 0x80, 0x20, 0x02, 0x08,
- 0xa0, 0x08, 0x00, 0x02, 0x08, 0x22, 0x82, 0x00, 0x82, 0x00, 0x00, 0x0a,
- 0x2a, 0x22, 0x8a, 0x22, 0x22, 0x08, 0x80, 0x22, 0x22, 0x88, 0x88, 0x02,
- 0x28, 0x02, 0x08, 0x20, 0x40, 0x10, 0x15, 0x54, 0x10, 0x05, 0x00, 0x14,
- 0x04, 0x41, 0x44, 0x05, 0x41, 0x00, 0x00, 0x05, 0x50, 0x01, 0x41, 0x04,
- 0x05, 0x11, 0x00, 0x05, 0x44, 0x44, 0x50, 0x00, 0x10, 0x05, 0x50, 0x10,
- 0x80, 0x0a, 0x02, 0x08, 0x20, 0x0a, 0x00, 0x20, 0xa8, 0x82, 0x82, 0x00,
- 0x2a, 0x00, 0x80, 0x02, 0x22, 0x02, 0x82, 0x20, 0x20, 0x08, 0x20, 0x88,
- 0x82, 0x88, 0x8a, 0x00, 0x88, 0x0a, 0x80, 0x20, 0x40, 0x04, 0x01, 0x04,
- 0x10, 0x05, 0x00, 0x40, 0x04, 0x41, 0x41, 0x00, 0x11, 0x00, 0x40, 0x01,
- 0x41, 0x41, 0x41, 0x14, 0x15, 0x11, 0x40, 0x44, 0x04, 0x44, 0x40, 0x00,
- 0x44, 0x15, 0x00, 0x11, 0x80, 0x08, 0x02, 0x08, 0x20, 0x0a, 0x00, 0x80,
- 0x08, 0x82, 0x82, 0x00, 0x22, 0x00, 0xa0, 0x00, 0x22, 0x22, 0x82, 0x20,
- 0x22, 0x0a, 0x20, 0x28, 0x82, 0x82, 0x88, 0x00, 0x88, 0x2a, 0x00, 0x22,
- 0x44, 0x10, 0x01, 0x04, 0x10, 0x04, 0x00, 0x41, 0x04, 0x01, 0x41, 0x00,
- 0x41, 0x00, 0x50, 0x01, 0x14, 0x14, 0x01, 0x55, 0x10, 0x15, 0x40, 0x45,
- 0x05, 0x01, 0x45, 0x00, 0x04, 0x55, 0x04, 0x11, 0x82, 0x20, 0x02, 0x08,
- 0x20, 0x08, 0x00, 0x22, 0x08, 0x82, 0x80, 0x00, 0x82, 0x00, 0xa8, 0x00,
- 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0xaa, 0x88, 0x20, 0x41, 0x10, 0x55, 0x54, 0x11, 0x04, 0x00, 0x14,
- 0x04, 0x01, 0x41, 0x15, 0x41, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x54, 0x51, 0x40,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x15, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xa8, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00,
- 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x10, 0x00, 0x50, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15,
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x15, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x14, 0x40, 0x01, 0x41, 0x40, 0x01, 0x14, 0x10, 0x01, 0x00, 0x40,
- 0x01, 0x04, 0x14, 0x14, 0x14, 0x10, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, 0x80, 0x82, 0xa0, 0x20, 0x82,
- 0xa2, 0x20, 0x02, 0x22, 0x28, 0x02, 0x00, 0x08, 0x8a, 0x22, 0x08, 0x08,
- 0x22, 0x28, 0x0a, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x44, 0x54,
- 0x01, 0x00, 0x00, 0x40, 0x41, 0x40, 0x10, 0x04, 0x11, 0x11, 0x04, 0x41,
- 0x10, 0x04, 0x00, 0x04, 0x04, 0x40, 0x10, 0x00, 0x41, 0x10, 0x11, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xaa, 0x02, 0x00, 0x00, 0xa0,
- 0x82, 0x80, 0x08, 0x08, 0x02, 0x08, 0x88, 0x80, 0x08, 0x08, 0x00, 0x08,
- 0x08, 0x20, 0x20, 0x80, 0x80, 0x20, 0x00, 0x00, 0x10, 0x50, 0x14, 0x14,
- 0x45, 0x05, 0x40, 0x05, 0x41, 0x14, 0x15, 0x50, 0x41, 0x01, 0x04, 0x00,
- 0x01, 0x04, 0x50, 0x00, 0x11, 0x04, 0x00, 0x14, 0x00, 0x40, 0x10, 0x44,
- 0x00, 0x11, 0x00, 0x00, 0xa0, 0x88, 0x22, 0xa2, 0x88, 0x08, 0x00, 0x2a,
- 0x82, 0x22, 0x22, 0xa8, 0x80, 0x0a, 0x08, 0x00, 0x02, 0xa8, 0x8a, 0xaa,
- 0x08, 0x08, 0x00, 0xa8, 0x00, 0x2a, 0x20, 0x80, 0xaa, 0x20, 0x00, 0x00,
- 0x00, 0x05, 0x04, 0x15, 0x55, 0x04, 0x40, 0x04, 0x50, 0x54, 0x01, 0x54,
- 0x00, 0x54, 0x04, 0x00, 0x01, 0x04, 0x40, 0x00, 0x10, 0x04, 0x00, 0x40,
- 0x05, 0x41, 0x40, 0x40, 0x00, 0x10, 0x00, 0x00, 0x80, 0x08, 0x02, 0x82,
- 0x80, 0x08, 0x80, 0x20, 0x02, 0x02, 0x02, 0x2a, 0x00, 0xa0, 0x08, 0x00,
- 0x02, 0x08, 0x80, 0x00, 0x08, 0x08, 0x00, 0x00, 0x8a, 0x20, 0x20, 0x82,
- 0x00, 0x20, 0x00, 0x00, 0x10, 0x45, 0x04, 0x11, 0x51, 0x04, 0x50, 0x44,
- 0x44, 0x44, 0x01, 0x15, 0x00, 0x40, 0x05, 0x00, 0x01, 0x04, 0x40, 0x00,
- 0x10, 0x04, 0x00, 0x00, 0x54, 0x40, 0x40, 0x41, 0x00, 0x10, 0x00, 0x00,
- 0xa0, 0x28, 0x02, 0x0a, 0x8a, 0x08, 0x20, 0x0a, 0x0a, 0x28, 0x02, 0x0a,
- 0x00, 0x80, 0x08, 0x00, 0x02, 0x08, 0x80, 0x00, 0x08, 0x08, 0x00, 0x00,
- 0x88, 0x20, 0x80, 0x80, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x05, 0x40, 0x00, 0x11, 0x00,
- 0x01, 0x10, 0x10, 0x01, 0x11, 0x04, 0x00, 0x04, 0x50, 0x40, 0x41, 0x01,
- 0x01, 0x11, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa,
- 0xaa, 0x00, 0x80, 0x02, 0x80, 0x80, 0x20, 0x02, 0x02, 0x20, 0x08, 0x82,
- 0x08, 0x08, 0x00, 0x08, 0x88, 0x20, 0x80, 0x00, 0x82, 0x20, 0x00, 0x00,
- 0x00, 0x40, 0x01, 0x10, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x40, 0x01,
- 0x40, 0x14, 0x40, 0x41, 0x05, 0x40, 0x01, 0x14, 0x14, 0x14, 0x00, 0x44,
- 0x01, 0x45, 0x00, 0x00, 0x14, 0x54, 0x00, 0x00, 0x00, 0x80, 0x02, 0x08,
- 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x04, 0x00, 0x00, 0x00, 0x50,
- 0x55, 0x05, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0xa8, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01,
- 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0xa0,
- 0xaa, 0x0a, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x15, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x55, 0x15, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x8a, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0xa8, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x05, 0x50, 0x00, 0x50, 0x40, 0x45, 0x11, 0x00, 0x50,
- 0x40, 0x41, 0x01, 0x00, 0x14, 0x00, 0x51, 0x40, 0x40, 0x00, 0x05, 0x14,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0a,
- 0x88, 0x02, 0xaa, 0xa8, 0x80, 0x00, 0x00, 0xaa, 0xa8, 0xa2, 0x02, 0x00,
- 0xa2, 0xa0, 0x22, 0xa8, 0xa0, 0xa0, 0x8a, 0x2a, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x14, 0x04, 0x01, 0x45, 0x51,
- 0x04, 0x40, 0x00, 0x45, 0x41, 0x51, 0x01, 0x00, 0x41, 0x50, 0x54, 0x50,
- 0x50, 0x50, 0x14, 0x14, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x82, 0xa2, 0xa0, 0x02, 0xa0, 0x88, 0x82,
- 0xa0, 0x88, 0x02, 0x80, 0x82, 0x28, 0x28, 0xa0, 0x20, 0x28, 0x08, 0x8a,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x45, 0x54, 0x00,
- 0x14, 0x40, 0x41, 0x50, 0x05, 0x51, 0x10, 0x41, 0x41, 0x41, 0x01, 0x00,
- 0x05, 0x14, 0x10, 0x50, 0x40, 0x10, 0x14, 0x54, 0x04, 0x00, 0x41, 0x55,
- 0x04, 0x45, 0x01, 0x04, 0x20, 0x02, 0x08, 0x00, 0x2a, 0xa0, 0x00, 0xa0,
- 0x8a, 0x20, 0xa8, 0xa2, 0xa0, 0xa0, 0x00, 0x80, 0x0a, 0x28, 0x28, 0xa0,
- 0x20, 0x28, 0x0a, 0x2a, 0x00, 0x00, 0x22, 0x0a, 0x80, 0x88, 0x02, 0x88,
- 0x04, 0x50, 0x01, 0x00, 0x54, 0x40, 0x01, 0x50, 0x15, 0x10, 0x14, 0x51,
- 0x40, 0x41, 0x01, 0x00, 0x15, 0x14, 0x14, 0x40, 0x11, 0x14, 0x05, 0x14,
- 0x00, 0x40, 0x10, 0x00, 0x15, 0x45, 0x04, 0x01, 0x00, 0x00, 0x08, 0x00,
- 0xa8, 0xa0, 0x00, 0x28, 0x8a, 0x08, 0x0a, 0x28, 0xa0, 0xa0, 0x00, 0x00,
- 0x2a, 0x0a, 0x28, 0xa0, 0x08, 0x8a, 0x02, 0x0a, 0x00, 0x80, 0x00, 0x08,
- 0x80, 0x00, 0x00, 0x82, 0x44, 0x11, 0x00, 0x00, 0x50, 0x50, 0x00, 0x10,
- 0x05, 0x40, 0x15, 0x05, 0x50, 0x50, 0x00, 0x00, 0x14, 0x14, 0x14, 0x40,
- 0x11, 0x54, 0x00, 0x05, 0x00, 0x00, 0x11, 0x00, 0x01, 0x40, 0x04, 0x44,
- 0x80, 0x20, 0x0a, 0x00, 0xa0, 0xa0, 0x00, 0x88, 0x82, 0xa8, 0x0a, 0x00,
- 0xa0, 0xa0, 0x00, 0x00, 0x28, 0x0a, 0x0a, 0xa0, 0x08, 0x0a, 0x00, 0x0a,
- 0x00, 0x00, 0x22, 0x0a, 0xa2, 0x00, 0x00, 0x88, 0x01, 0x40, 0x15, 0x00,
- 0x50, 0x51, 0x40, 0x00, 0x01, 0x51, 0x15, 0x00, 0x50, 0x50, 0x00, 0x00,
- 0x54, 0x14, 0x54, 0x40, 0x05, 0x14, 0x00, 0x05, 0x00, 0x40, 0x41, 0x15,
- 0x14, 0x45, 0x04, 0x05, 0x00, 0x00, 0x00, 0x80, 0xa0, 0xa0, 0x20, 0x88,
- 0x80, 0xaa, 0x08, 0x82, 0x28, 0x28, 0x02, 0x20, 0x28, 0x0a, 0x2a, 0xa0,
- 0x02, 0x0a, 0x88, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x41, 0x40, 0x11, 0x44, 0x00, 0x55, 0x14, 0x44,
- 0x50, 0x50, 0x01, 0x40, 0x10, 0x54, 0x15, 0x40, 0x01, 0x14, 0x04, 0x45,
- 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x22, 0xa0, 0x0a, 0x00, 0x00, 0x0a, 0x2a, 0x20, 0x28, 0xa8, 0x00, 0xa0,
- 0x08, 0xa8, 0x08, 0xa0, 0x00, 0xa8, 0x82, 0x82, 0x02, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x05, 0x00,
- 0x00, 0x54, 0x55, 0x10, 0x50, 0x50, 0x00, 0x00, 0x05, 0x50, 0x04, 0x40,
- 0x00, 0x50, 0x40, 0x05, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x80, 0xaa, 0x2a,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x05, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a,
- 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x00, 0x00, 0x55, 0x55,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x01,
- 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa8, 0xaa,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
- 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x50, 0x55,
- 0x05, 0x00, 0x00, 0x14, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x28,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0a, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
- 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x80, 0xaa,
- 0x2a, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x55, 0x50, 0x15,
- 0x55, 0x11, 0x55, 0x00, 0x15, 0x00, 0x54, 0x01, 0x00, 0x54, 0x01, 0x40,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x50, 0x00, 0x20, 0x82, 0x20, 0x08, 0x82, 0x00, 0x22, 0x80,
- 0x08, 0x08, 0x28, 0xa2, 0x28, 0x20, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xa2,
- 0x00, 0x04, 0x41, 0x10, 0x04, 0x11, 0x00, 0x40, 0x10, 0x14, 0x10, 0x54,
- 0x54, 0x11, 0x10, 0x00, 0x01, 0x00, 0x50, 0x14, 0x15, 0x05, 0x45, 0x01,
- 0x50, 0x50, 0x44, 0x14, 0x05, 0x00, 0x04, 0x40, 0x20, 0x02, 0x22, 0x02,
- 0x22, 0x08, 0x20, 0x20, 0x00, 0x08, 0x20, 0xa8, 0x28, 0x22, 0x08, 0x80,
- 0x02, 0x00, 0x88, 0x22, 0xa2, 0x88, 0x28, 0x02, 0x88, 0x80, 0x22, 0xa2,
- 0x08, 0x00, 0x08, 0x22, 0x00, 0x04, 0x41, 0x00, 0x04, 0x00, 0x01, 0x40,
- 0x00, 0x10, 0x40, 0x04, 0x11, 0x10, 0x04, 0x10, 0x05, 0x00, 0x10, 0x04,
- 0x01, 0x55, 0x45, 0x04, 0x10, 0x50, 0x44, 0x15, 0x01, 0x00, 0x14, 0x10,
- 0x00, 0x2a, 0xa0, 0x02, 0x2a, 0x20, 0x22, 0x80, 0x02, 0x22, 0x20, 0x02,
- 0x0a, 0xa0, 0x02, 0x08, 0x0a, 0x00, 0x20, 0x02, 0x82, 0x80, 0x20, 0x02,
- 0x80, 0x88, 0x28, 0x82, 0x00, 0x00, 0xa8, 0x20, 0x00, 0x44, 0x40, 0x01,
- 0x14, 0x00, 0x04, 0x00, 0x05, 0x10, 0x40, 0x00, 0x11, 0x10, 0x05, 0x04,
- 0x14, 0x00, 0x44, 0x44, 0x01, 0x51, 0x44, 0x04, 0x10, 0x45, 0x14, 0x11,
- 0x01, 0x00, 0x50, 0x11, 0x00, 0x82, 0x20, 0x02, 0x22, 0x20, 0x28, 0x20,
- 0x08, 0x2a, 0x80, 0x02, 0x02, 0x20, 0x08, 0x00, 0x00, 0x00, 0x28, 0x28,
- 0x02, 0x8a, 0x22, 0x02, 0xa0, 0xa8, 0x08, 0x8a, 0x00, 0x00, 0x80, 0x22,
- 0x00, 0x04, 0x41, 0x10, 0x04, 0x01, 0x10, 0x00, 0x10, 0x41, 0x40, 0x01,
- 0x11, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x51, 0x20, 0x82, 0x20, 0x00,
- 0x02, 0x20, 0x28, 0x20, 0x88, 0x20, 0x80, 0x00, 0x82, 0x20, 0x28, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x22, 0x10, 0x04, 0x45, 0x10, 0x04, 0x01, 0x10, 0x40,
- 0x04, 0x40, 0x00, 0x00, 0x41, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x41,
- 0x8a, 0x0a, 0xaa, 0x8a, 0xaa, 0xa8, 0x20, 0xa0, 0x82, 0xa2, 0x80, 0x80,
- 0xaa, 0xa8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x15, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa8, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa0, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x2a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x10, 0x50,
- 0x41, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x15, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xa0, 0x80, 0x02, 0xa8, 0x28,
- 0x0a, 0xa0, 0x02, 0xa8, 0x00, 0x8a, 0x02, 0x28, 0x00, 0x00, 0x00, 0x0a,
- 0x28, 0x80, 0x2a, 0x80, 0x22, 0x80, 0x0a, 0x00, 0xa8, 0x00, 0x28, 0x2a,
- 0x00, 0x05, 0x00, 0x50, 0x00, 0x00, 0x55, 0x51, 0x14, 0x14, 0x54, 0x54,
- 0x01, 0x54, 0x01, 0x50, 0x50, 0x05, 0x00, 0x05, 0x00, 0x50, 0x55, 0x40,
- 0x51, 0x50, 0x15, 0x00, 0x54, 0x05, 0x14, 0x55, 0x00, 0x0a, 0x00, 0xa0,
- 0x00, 0x80, 0xaa, 0x2a, 0x2a, 0x08, 0x2a, 0xa8, 0x02, 0xaa, 0x02, 0xa0,
- 0xa0, 0x02, 0x00, 0x0a, 0x00, 0xa8, 0xaa, 0x80, 0x2a, 0xa8, 0x2a, 0x80,
- 0xaa, 0x0a, 0xa8, 0xaa, 0x01, 0x05, 0x00, 0x50, 0x05, 0x40, 0x55, 0x55,
- 0x14, 0x00, 0x14, 0x50, 0x05, 0x54, 0x01, 0x40, 0x51, 0x01, 0x00, 0x55,
- 0x00, 0x54, 0x55, 0x41, 0x15, 0x54, 0x55, 0x40, 0x55, 0x15, 0x54, 0x55,
- 0x02, 0x0a, 0x00, 0xa0, 0x0a, 0xa0, 0x02, 0x2a, 0x2a, 0x00, 0x0a, 0x88,
- 0x0a, 0x2a, 0x00, 0x80, 0xaa, 0x00, 0x00, 0xaa, 0x00, 0xaa, 0xa0, 0xa2,
- 0x0a, 0x2a, 0xa8, 0xa0, 0x0a, 0x0a, 0xaa, 0xa0, 0x01, 0x14, 0x01, 0x40,
- 0x55, 0x50, 0x01, 0x14, 0x14, 0x00, 0x05, 0x04, 0x15, 0x15, 0x00, 0x00,
- 0x51, 0x00, 0x00, 0x54, 0x05, 0x14, 0x40, 0x45, 0x05, 0x15, 0x50, 0x41,
- 0x01, 0x14, 0x54, 0x40, 0x02, 0xa8, 0x00, 0x80, 0xaa, 0xa8, 0x00, 0x2a,
- 0x28, 0x88, 0x02, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8,
- 0x0a, 0x0a, 0xa0, 0xa2, 0x82, 0x0a, 0xa0, 0xa0, 0x00, 0x28, 0x2a, 0xa0,
- 0x01, 0x50, 0x00, 0x00, 0x55, 0x50, 0x00, 0x14, 0x54, 0x54, 0x05, 0x15,
- 0x14, 0x15, 0x00, 0x00, 0x11, 0x00, 0x00, 0x50, 0x05, 0x15, 0x00, 0x40,
- 0x01, 0x05, 0x40, 0x51, 0x00, 0x14, 0x14, 0x40, 0x00, 0xa8, 0x00, 0x00,
- 0xa8, 0x28, 0x00, 0x28, 0x28, 0xa8, 0x02, 0x80, 0x0a, 0x0a, 0x00, 0x80,
- 0x08, 0x00, 0x00, 0x80, 0x8a, 0x0a, 0x00, 0xa0, 0x80, 0xaa, 0xaa, 0xa8,
- 0xaa, 0x2a, 0x0a, 0xa0, 0x01, 0x44, 0x01, 0x00, 0x50, 0x55, 0x00, 0x14,
- 0x50, 0x14, 0x01, 0x00, 0x15, 0x05, 0x00, 0x40, 0x15, 0x00, 0x00, 0x00,
- 0x15, 0x05, 0x00, 0x50, 0x41, 0x55, 0x55, 0x51, 0x55, 0x15, 0x15, 0x40,
- 0x00, 0x80, 0x02, 0x00, 0xa0, 0x28, 0x00, 0x0a, 0x28, 0x0a, 0x02, 0x00,
- 0x8a, 0x0a, 0x00, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x8a, 0x0a, 0x00, 0xa0,
- 0x80, 0xaa, 0xaa, 0xa8, 0xaa, 0x2a, 0x0a, 0xa0, 0x01, 0x40, 0x01, 0x00,
- 0x50, 0x55, 0x00, 0x14, 0x50, 0x05, 0x00, 0x00, 0x14, 0x05, 0x00, 0x50,
- 0x50, 0x00, 0x00, 0x00, 0x15, 0x05, 0x00, 0x50, 0x40, 0x55, 0x55, 0x51,
- 0x55, 0x15, 0x05, 0x50, 0x00, 0x80, 0x02, 0x2a, 0xa8, 0x28, 0x00, 0x0a,
- 0xa8, 0x0a, 0x80, 0xaa, 0x82, 0x02, 0x00, 0x20, 0xa0, 0x00, 0xa0, 0x82,
- 0x8a, 0x0a, 0x00, 0xa0, 0x80, 0x02, 0x00, 0x28, 0x00, 0x00, 0x0a, 0xa0,
- 0x00, 0x00, 0x05, 0x14, 0x50, 0x54, 0x00, 0x15, 0x50, 0x05, 0x40, 0x55,
- 0x01, 0x05, 0x00, 0x10, 0x40, 0x01, 0x40, 0x01, 0x05, 0x15, 0x50, 0x51,
- 0x40, 0x01, 0x00, 0x50, 0x00, 0x00, 0x05, 0x50, 0x00, 0x00, 0x0a, 0x2a,
- 0xa8, 0xa8, 0x80, 0x0a, 0xa0, 0x02, 0x80, 0x0a, 0x80, 0x02, 0x00, 0x08,
- 0x80, 0x02, 0xa0, 0x82, 0x0a, 0x2a, 0xa8, 0xa0, 0x80, 0x02, 0x2a, 0xa8,
- 0x80, 0x8a, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x54, 0x55, 0x50, 0x55, 0x05,
- 0x50, 0x01, 0x00, 0x00, 0x44, 0x05, 0x00, 0x04, 0x00, 0x05, 0x40, 0x55,
- 0x05, 0x54, 0x55, 0x50, 0x00, 0x55, 0x15, 0x50, 0x55, 0x05, 0x05, 0x50,
- 0x00, 0x00, 0x00, 0xa8, 0x2a, 0xa0, 0xaa, 0x0a, 0xa0, 0x00, 0x08, 0x00,
- 0x8a, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x80, 0xaa, 0x02, 0xaa, 0x2a, 0x28,
- 0x80, 0xaa, 0x0a, 0xa0, 0xaa, 0x82, 0x02, 0x28, 0x00, 0x00, 0x00, 0x50,
- 0x15, 0x40, 0x55, 0x05, 0x40, 0x01, 0x10, 0x00, 0x55, 0x01, 0x00, 0x05,
- 0x00, 0x00, 0x00, 0x55, 0x01, 0x54, 0x15, 0x50, 0x00, 0x55, 0x05, 0x40,
- 0x55, 0x01, 0x05, 0x50, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x80, 0x0a, 0x0a,
- 0xa0, 0x00, 0x00, 0xa0, 0xaa, 0x02, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x2a,
- 0x00, 0xa0, 0x0a, 0x28, 0x00, 0xa8, 0x00, 0x80, 0x2a, 0x80, 0x02, 0x28,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55,
- 0x55, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0xa0, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa,
- 0xaa, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x50, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50,
- 0x55, 0x05, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x0a, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0xaa, 0x8a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x45, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0xa0, 0x22, 0xa8, 0x0a, 0xa8, 0x00,
- 0xa8, 0xa0, 0x28, 0x80, 0xaa, 0x22, 0x28, 0xa0, 0x02, 0x2a, 0x2a, 0xa0,
- 0x02, 0x8a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x40, 0x15, 0x50, 0x15, 0x54, 0x15, 0x54, 0x01, 0x55, 0x41, 0x55, 0x00,
- 0x55, 0x11, 0x54, 0x50, 0x05, 0x54, 0x54, 0x54, 0x05, 0x54, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x08, 0x08,
- 0x20, 0x08, 0x02, 0x82, 0x82, 0x82, 0x82, 0x00, 0xaa, 0x08, 0x20, 0x20,
- 0x08, 0x08, 0x08, 0x0a, 0x0a, 0x28, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x50, 0x10, 0x04, 0x10, 0x10, 0x00, 0x01, 0x04,
- 0x01, 0x01, 0x01, 0x01, 0x54, 0x14, 0x11, 0x00, 0x10, 0x10, 0x04, 0x04,
- 0x04, 0x10, 0x00, 0x14, 0x51, 0x10, 0x44, 0x01, 0x50, 0x44, 0x44, 0x14,
- 0xa0, 0x00, 0x02, 0x08, 0x08, 0x80, 0x00, 0x82, 0x00, 0x82, 0x80, 0x00,
- 0xa8, 0x28, 0x00, 0xa0, 0x0a, 0x20, 0x08, 0x02, 0x08, 0x08, 0x00, 0x00,
- 0x20, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x05, 0x04, 0x00,
- 0x10, 0x00, 0x55, 0x45, 0x55, 0x41, 0x40, 0x00, 0x54, 0x54, 0x00, 0x50,
- 0x05, 0x10, 0x04, 0x55, 0x05, 0x04, 0x00, 0x44, 0x10, 0x14, 0x45, 0x04,
- 0x10, 0x54, 0x54, 0x04, 0x00, 0x0a, 0x02, 0x00, 0x08, 0x80, 0xaa, 0x82,
- 0xaa, 0x82, 0x80, 0x00, 0x2a, 0xaa, 0x00, 0x08, 0x08, 0x20, 0x02, 0xaa,
- 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00,
- 0x10, 0x14, 0x04, 0x00, 0x04, 0x00, 0x01, 0x40, 0x00, 0x40, 0x40, 0x00,
- 0x15, 0x45, 0x15, 0x04, 0x04, 0x10, 0x01, 0x01, 0x00, 0x04, 0x00, 0x05,
- 0x15, 0x10, 0x44, 0x04, 0x14, 0x14, 0x41, 0x04, 0x08, 0x08, 0x0a, 0x08,
- 0x08, 0x80, 0x02, 0x82, 0x80, 0x20, 0x20, 0x80, 0x8a, 0x8a, 0x22, 0x02,
- 0x02, 0xa0, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x05, 0x54, 0x15, 0x55, 0x01, 0x55, 0x01,
- 0x55, 0x51, 0x51, 0x01, 0x45, 0x05, 0x00, 0x54, 0x15, 0x40, 0x00, 0x54,
- 0x45, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa8, 0x02, 0xa8, 0x82, 0xaa, 0x00, 0xaa, 0x00, 0x2a, 0xa8, 0xa8, 0x80,
- 0x82, 0x22, 0x20, 0xa8, 0x0a, 0x20, 0x00, 0xa8, 0x80, 0xaa, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x55, 0x55, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50,
- 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa0, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50,
- 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x15, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0xa8, 0xaa, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x2a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x54, 0x00, 0x54, 0x55, 0x01, 0x00, 0x40, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a,
- 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x50, 0x55, 0x05,
- 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x54, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x0a, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x0a, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x02, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05,
- 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x14, 0x04, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x80, 0xaa, 0x2a,
- 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa8, 0x02, 0x08, 0x00, 0x10, 0x50, 0x50, 0x50, 0x40, 0x10, 0x00, 0x00,
- 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x50, 0x00,
- 0x50, 0x00, 0x05, 0x04, 0x01, 0x05, 0x50, 0x40, 0x54, 0x05, 0x04, 0x05,
- 0x8a, 0x20, 0x20, 0x88, 0xa0, 0x28, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00,
- 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x20, 0x00, 0x82, 0x82, 0x08, 0x8a,
- 0x82, 0x08, 0x88, 0xa0, 0xa8, 0x0a, 0x22, 0x28, 0x00, 0x41, 0x00, 0x04,
- 0x41, 0x44, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x55, 0x55,
- 0x00, 0x00, 0x10, 0x00, 0x01, 0x41, 0x10, 0x44, 0x44, 0x10, 0x04, 0x41,
- 0x50, 0x15, 0x11, 0x10, 0x80, 0x80, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x80, 0x00,
- 0x02, 0x22, 0x20, 0x08, 0x20, 0x20, 0x02, 0x22, 0xa0, 0x2a, 0x22, 0x20,
- 0x00, 0x41, 0x10, 0x01, 0x44, 0x00, 0x00, 0x40, 0x41, 0x51, 0x04, 0x14,
- 0x15, 0x00, 0x11, 0x44, 0x50, 0x54, 0x40, 0x01, 0x05, 0x10, 0x00, 0x04,
- 0x10, 0x40, 0x01, 0x44, 0x10, 0x15, 0x51, 0x00, 0xa8, 0x80, 0x00, 0xaa,
- 0x82, 0x00, 0x00, 0x20, 0x22, 0x8a, 0xa2, 0x22, 0x22, 0x80, 0xa0, 0x88,
- 0x88, 0x88, 0x88, 0x02, 0x2a, 0x20, 0x00, 0x08, 0xa0, 0x2a, 0xaa, 0x22,
- 0x20, 0x8a, 0xa0, 0x02, 0x04, 0x01, 0x01, 0x01, 0x40, 0x00, 0x00, 0x40,
- 0x10, 0x10, 0x41, 0x54, 0x11, 0x00, 0x11, 0x40, 0x54, 0x05, 0x04, 0x05,
- 0x50, 0x11, 0x00, 0x04, 0x10, 0x00, 0x01, 0x40, 0x10, 0x45, 0x00, 0x15,
- 0x82, 0x80, 0x08, 0x02, 0x80, 0x00, 0x00, 0x00, 0x22, 0x88, 0x02, 0x02,
- 0x22, 0x00, 0x82, 0x08, 0x02, 0x08, 0x02, 0x0a, 0x80, 0x22, 0x00, 0x08,
- 0x20, 0x00, 0x02, 0x20, 0x20, 0xa2, 0x00, 0x28, 0x01, 0x01, 0x05, 0x01,
- 0x40, 0x00, 0x00, 0x40, 0x14, 0x51, 0x41, 0x44, 0x11, 0x40, 0x04, 0x11,
- 0x04, 0x05, 0x01, 0x14, 0x00, 0x15, 0x00, 0x04, 0x10, 0x00, 0x01, 0x40,
- 0x10, 0x51, 0x01, 0x50, 0x82, 0x00, 0x02, 0x02, 0x80, 0x00, 0x00, 0x80,
- 0xa2, 0x88, 0x2a, 0x28, 0x22, 0x80, 0x02, 0x28, 0x8a, 0x88, 0x00, 0x28,
- 0x00, 0x22, 0x00, 0x08, 0x20, 0x00, 0x02, 0x20, 0xa0, 0xa8, 0x02, 0x20,
- 0x01, 0x05, 0x05, 0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00,
- 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x01, 0x44, 0x00, 0x04,
- 0x40, 0x40, 0x04, 0x44, 0x10, 0x51, 0x15, 0x40, 0x82, 0x00, 0x02, 0x08,
- 0x82, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa,
- 0x2a, 0x00, 0x00, 0x00, 0x02, 0x82, 0x08, 0x08, 0x80, 0x20, 0x08, 0x22,
- 0xa0, 0xa0, 0x2a, 0x20, 0x14, 0x01, 0x00, 0x50, 0x50, 0x01, 0x00, 0x00,
- 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00,
- 0x51, 0x00, 0x05, 0x15, 0x00, 0x05, 0x50, 0x50, 0x50, 0x40, 0x15, 0x05,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x28, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x2a, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x54, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x00, 0x50, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xa0, 0x0a,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x50, 0x55, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00,
- 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x10, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x2a, 0x00, 0x00, 0x00,
- 0x00, 0xa0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0xaa, 0x15, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00,
- 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55,
- 0xa2, 0x00, 0x80, 0x02, 0x0a, 0xa2, 0x82, 0x02, 0x0a, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0a, 0xa8, 0xa0, 0x80, 0x82, 0xa0, 0x11, 0x01, 0x00, 0x04,
- 0x11, 0x50, 0x41, 0x04, 0x11, 0x10, 0x00, 0x14, 0x44, 0x40, 0x00, 0x41,
- 0x11, 0x00, 0x14, 0x00, 0x44, 0x05, 0x05, 0x04, 0x45, 0x00, 0x10, 0x44,
- 0x11, 0x11, 0x04, 0x44, 0xa2, 0x02, 0x20, 0x80, 0x20, 0x28, 0x20, 0x08,
- 0x02, 0x20, 0x80, 0x22, 0xa8, 0xa8, 0xa0, 0x82, 0x28, 0x00, 0x28, 0x80,
- 0x22, 0x08, 0x82, 0x0a, 0x22, 0x80, 0x00, 0x82, 0x20, 0x00, 0x88, 0x8a,
- 0x51, 0x05, 0x50, 0x00, 0x10, 0x11, 0x11, 0x10, 0x01, 0x50, 0x40, 0x10,
- 0x54, 0x04, 0x11, 0x04, 0x41, 0x00, 0x50, 0x40, 0x10, 0x04, 0x44, 0x10,
- 0x44, 0x40, 0x01, 0x01, 0x10, 0x10, 0x44, 0x14, 0xa2, 0x00, 0xa0, 0x00,
- 0xa8, 0x02, 0xa0, 0x0a, 0x02, 0xa0, 0xa0, 0x00, 0x0a, 0x82, 0x08, 0x82,
- 0x20, 0x00, 0xa0, 0x20, 0x20, 0x08, 0x22, 0x08, 0x02, 0x80, 0x02, 0x02,
- 0x20, 0xa8, 0x8a, 0x82, 0x51, 0x01, 0x40, 0x01, 0x55, 0x01, 0x10, 0x00,
- 0x01, 0x40, 0x41, 0x00, 0x04, 0x54, 0x50, 0x41, 0x40, 0x00, 0x40, 0x10,
- 0x10, 0x04, 0x41, 0x05, 0x01, 0x00, 0x05, 0x01, 0x10, 0x10, 0x40, 0x50,
- 0xa2, 0x08, 0x80, 0x82, 0xa0, 0x8a, 0x20, 0x00, 0x02, 0x80, 0x22, 0x00,
- 0x02, 0x0a, 0x28, 0x80, 0x20, 0x00, 0x80, 0x20, 0x08, 0x88, 0xa0, 0x00,
- 0x02, 0x00, 0x0a, 0x02, 0x20, 0x08, 0x80, 0xa0, 0x51, 0x01, 0x00, 0x44,
- 0x50, 0x11, 0x10, 0x00, 0x01, 0x00, 0x11, 0x00, 0x01, 0x01, 0x04, 0x40,
- 0x10, 0x00, 0x40, 0x11, 0x10, 0x10, 0x11, 0x00, 0x01, 0x00, 0x10, 0x01,
- 0x10, 0x10, 0x40, 0x50, 0xa2, 0x08, 0x00, 0x88, 0x80, 0x08, 0x20, 0x00,
- 0x02, 0x02, 0x22, 0x00, 0x02, 0x02, 0x08, 0x20, 0x20, 0x00, 0x80, 0x08,
- 0x08, 0x88, 0x20, 0x80, 0x00, 0x00, 0x20, 0x02, 0x20, 0x28, 0x80, 0xa0,
- 0x51, 0x11, 0x10, 0x44, 0x40, 0x50, 0x40, 0x10, 0x01, 0x00, 0x11, 0x00,
- 0x01, 0x01, 0x04, 0x40, 0x10, 0x00, 0x01, 0x11, 0x04, 0x50, 0x10, 0x00,
- 0x01, 0x40, 0x10, 0x04, 0x11, 0x50, 0x00, 0x01, 0xa2, 0x28, 0x20, 0x82,
- 0x0a, 0x20, 0xa0, 0x0a, 0x02, 0x02, 0x22, 0x88, 0x00, 0x82, 0x08, 0x22,
- 0x08, 0x80, 0x80, 0x28, 0x08, 0x28, 0x20, 0x88, 0x00, 0x80, 0x08, 0xaa,
- 0x20, 0xa0, 0x82, 0xaa, 0x41, 0x50, 0x50, 0x01, 0x55, 0x00, 0x00, 0x05,
- 0x05, 0x05, 0x51, 0x04, 0x01, 0x45, 0x14, 0x11, 0x50, 0x00, 0x41, 0x50,
- 0x04, 0x10, 0x50, 0x44, 0x00, 0x40, 0x05, 0x50, 0x50, 0x40, 0x01, 0x14,
- 0xaa, 0xaa, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xa0, 0x82,
- 0x00, 0x2a, 0xa8, 0x20, 0x28, 0x80, 0x2a, 0x20, 0x08, 0x08, 0xa0, 0x82,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00,
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x80, 0x0a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x54, 0x55, 0x01, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0xa0,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x40, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa0, 0xaa, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x50,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x28, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x55, 0x55, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x40, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x2a, 0x2a,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x15, 0x15, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xaa, 0x8a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x45,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0xa2, 0x22, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x88, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x0a, 0x00, 0x0a, 0x08,
- 0x02, 0x22, 0xa0, 0x80, 0x08, 0x00, 0xa0, 0x00, 0x20, 0xa0, 0xa0, 0xa0,
- 0x41, 0x01, 0x51, 0x45, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01,
- 0x00, 0x00, 0x55, 0x55, 0x14, 0x00, 0x11, 0x14, 0x05, 0x45, 0x10, 0x41,
- 0x11, 0x00, 0x40, 0x01, 0x14, 0x41, 0x40, 0x10, 0x82, 0x28, 0xa2, 0xaa,
- 0x80, 0xa2, 0xa2, 0xa0, 0xa8, 0x00, 0x28, 0x28, 0x08, 0xa2, 0x02, 0xaa,
- 0xa8, 0x80, 0x20, 0x88, 0x88, 0x0a, 0x08, 0x82, 0x20, 0x00, 0x80, 0x0a,
- 0x00, 0x82, 0x00, 0x08, 0x04, 0x51, 0x51, 0x55, 0x45, 0x44, 0x11, 0x11,
- 0x11, 0x01, 0x50, 0x44, 0x04, 0x11, 0x05, 0x55, 0x41, 0x41, 0x40, 0x10,
- 0x40, 0x55, 0x04, 0x44, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, 0x01, 0x04,
- 0x88, 0xa8, 0xa8, 0x2a, 0x2a, 0x20, 0x08, 0x0a, 0x0a, 0x02, 0xa0, 0x80,
- 0x88, 0x08, 0xa2, 0xaa, 0x02, 0x22, 0x00, 0x08, 0xa0, 0x8a, 0x02, 0x88,
- 0x20, 0x00, 0x00, 0x20, 0x00, 0x82, 0x20, 0x02, 0x05, 0x55, 0x54, 0x55,
- 0x44, 0x40, 0x50, 0x51, 0x11, 0x01, 0x04, 0x51, 0x10, 0x51, 0x41, 0x55,
- 0x05, 0x44, 0x00, 0x10, 0x00, 0x50, 0x54, 0x45, 0x40, 0x00, 0x00, 0x40,
- 0x50, 0x01, 0x01, 0x54, 0x80, 0x2a, 0xaa, 0x0a, 0x28, 0x28, 0x08, 0x08,
- 0x08, 0x02, 0x88, 0x88, 0x80, 0x08, 0xa8, 0xaa, 0x0a, 0x28, 0x00, 0x08,
- 0xa0, 0x02, 0x02, 0x80, 0x20, 0x00, 0x00, 0x80, 0x08, 0x02, 0x02, 0x02,
- 0x00, 0x15, 0x55, 0x15, 0x44, 0x44, 0x10, 0x11, 0x11, 0x01, 0x04, 0x45,
- 0x50, 0x10, 0x51, 0x55, 0x15, 0x44, 0x00, 0x10, 0x00, 0x01, 0x04, 0x40,
- 0x40, 0x00, 0x00, 0x40, 0x04, 0x01, 0x11, 0x04, 0x80, 0x0a, 0xaa, 0x2a,
- 0x82, 0x22, 0xa0, 0xa0, 0x08, 0x02, 0xa8, 0xa8, 0x20, 0xa0, 0xa8, 0xaa,
- 0x0a, 0x28, 0x00, 0x08, 0x80, 0x00, 0x02, 0x80, 0x20, 0x00, 0x00, 0x80,
- 0x02, 0x02, 0x0a, 0x02, 0x00, 0x04, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x44, 0x00, 0x10,
- 0x10, 0x00, 0x04, 0x40, 0x40, 0x00, 0x00, 0x40, 0x04, 0x01, 0x04, 0x04,
- 0x08, 0x02, 0xa8, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0xaa, 0x28, 0x82, 0x00, 0x08, 0xa8, 0x80, 0x08, 0x88,
- 0x20, 0x00, 0x20, 0x20, 0x02, 0x0a, 0x0a, 0x08, 0x44, 0x00, 0x50, 0x55,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55,
- 0x51, 0x01, 0x11, 0x10, 0x54, 0x41, 0x10, 0x44, 0x40, 0x00, 0x40, 0x10,
- 0x04, 0x01, 0x04, 0x10, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00,
- 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x08, 0x00, 0x0a, 0x2a,
- 0x2a, 0x0a, 0xa0, 0xa0, 0xa0, 0x00, 0x20, 0x0a, 0x28, 0x02, 0x00, 0xa0,
- 0x50, 0x01, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
deleted file mode 100644
index de84a7aee..000000000
--- a/hw/xwin/InitInput.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* $TOG: InitInput.c /main/12 1998/02/10 13:23:52 kaleb $ */
-/*
-
- Copyright 1993, 1998 The Open Group
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation.
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of The Open Group shall
- not be used in advertising or otherwise to promote the sale, use or
- other dealings in this Software without prior written authorization
- from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.13 2003/07/29 21:25:15 dawes Exp $ */
-
-#include "win.h"
-#include "../../Xext/xf86miscproc.h"
-
-CARD32 g_c32LastInputEventTime = 0;
-
-
-/* Called from dix/devices.c */
-/*
- * All of our keys generate up and down transition notifications,
- * so all of our keys can be used as modifiers.
- *
- * An example of a modifier is mapping the A key to the Control key.
- * A has to be a legal modifier. I think.
- */
-
-Bool
-LegalModifier (unsigned int uiKey, DevicePtr pDevice)
-{
- return TRUE;
-}
-
-
-/* Called from dix/dispatch.c */
-/*
- * Run through the Windows message queue(s) one more time.
- * Tell mi to dequeue the events that we have sent it.
- */
-void
-ProcessInputEvents (void)
-{
-#if 0
- ErrorF ("ProcessInputEvents\n");
-#endif
-
- mieqProcessInputEvents ();
- miPointerUpdate ();
-
-#if 0
- ErrorF ("ProcessInputEvents - returning\n");
-#endif
-}
-
-
-int
-TimeSinceLastInputEvent ()
-{
- if (g_c32LastInputEventTime == 0)
- g_c32LastInputEventTime = GetTickCount ();
- return GetTickCount () - g_c32LastInputEventTime;
-}
-
-
-/* See Porting Layer Definition - p. 17 */
-void
-InitInput (int argc, char *argv[])
-{
- DeviceIntPtr pMouse, pKeyboard;
-
-#if CYGDEBUG
- ErrorF ("InitInput\n");
-#endif
-
- pMouse = AddInputDevice (winMouseProc, TRUE);
- pKeyboard = AddInputDevice (winKeybdProc, TRUE);
-
- RegisterPointerDevice (pMouse);
- RegisterKeyboardDevice (pKeyboard);
-
- miRegisterPointerDevice (screenInfo.screens[0], pMouse);
- mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
-
- /* Initialize the mode key states */
- winInitializeModeKeyStates ();
-
- /* Only open the windows message queue device once */
- if (g_fdMessageQueue == WIN_FD_INVALID)
- {
- /* Open a file descriptor for the Windows message queue */
- g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
-
- if (g_fdMessageQueue == -1)
- {
- FatalError ("InitInput - Failed opening %s\n",
- WIN_MSG_QUEUE_FNAME);
- }
-
- /* Add the message queue as a device to wait for in WaitForSomething */
- AddEnabledDevice (g_fdMessageQueue);
- }
-
-#if 0
- {
- MiscExtReturn ret;
- pointer kbd;
-
-#if 0
- if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
- return BadAlloc;
-#else
- kbd = MiscExtCreateStruct (MISC_KEYBOARD);
-#endif
-
- MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, 0);
- MiscExtSetKbdValue(kbd, MISC_KBD_RATE, 0);
- MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, 0);
- MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, 0);
-
- switch ((ret = MiscExtApply (kbd, MISC_KEYBOARD)))
- {
- case MISC_RET_SUCCESS: break;
- case MISC_RET_BADVAL:
- case MISC_RET_BADKBDTYPE:
- default:
- ErrorF ("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
- }
- }
-#endif
-
-#if CYGDEBUG
- ErrorF ("InitInput - returning\n");
-#endif
-}
-
-
-#ifdef XTESTEXT1
-void
-XTestGenerateEvent (int dev_type, int keycode, int keystate,
- int mousex, int mousey)
-{
- ErrorF ("XTestGenerateEvent\n");
-}
-
-
-void
-XTestGetPointerPos (short *fmousex, short *fmousey)
-{
- ErrorF ("XTestGetPointerPos\n");
-}
-
-
-void
-XTestJumpPointer (int jx, int jy, int dev_type)
-{
- ErrorF ("XTestJumpPointer\n");
-}
-#endif
-
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
deleted file mode 100644
index 3202ae8d9..000000000
--- a/hw/xwin/InitOutput.c
+++ /dev/null
@@ -1,1358 +0,0 @@
-/* $TOG: InitOutput.c /main/20 1998/02/10 13:23:56 kaleb $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.35 2003/10/08 11:13:02 eich Exp $ */
-
-#include "win.h"
-#include "winconfig.h"
-#include "winprefs.h"
-
-/*
- * General global variables
- */
-
-int g_iNumScreens = 0;
-winScreenInfo g_ScreenInfo[MAXSCREENS];
-int g_iLastScreen = -1;
-int g_fdMessageQueue = WIN_FD_INVALID;
-int g_iScreenPrivateIndex = -1;
-int g_iCmapPrivateIndex = -1;
-int g_iGCPrivateIndex = -1;
-int g_iPixmapPrivateIndex = -1;
-int g_iWindowPrivateIndex = -1;
-unsigned long g_ulServerGeneration = 0;
-Bool g_fInitializedDefaultScreens = FALSE;
-DWORD g_dwEnginesSupported = 0;
-HINSTANCE g_hInstance = 0;
-HWND g_hDlgDepthChange = NULL;
-HWND g_hDlgExit = NULL;
-Bool g_fCalledSetLocale = FALSE;
-Bool g_fCalledXInitThreads = FALSE;
-int g_iLogVerbose = 4;
-char * g_pszLogFile = WIN_LOG_FNAME;
-Bool g_fLogInited = FALSE;
-const char * g_pszQueryHost = NULL;
-
-
-/*
- * Global variables for dynamically loaded libraries and
- * their function pointers
- */
-
-HMODULE g_hmodDirectDraw = NULL;
-FARPROC g_fpDirectDrawCreate = NULL;
-FARPROC g_fpDirectDrawCreateClipper = NULL;
-
-HMODULE g_hmodCommonControls = NULL;
-FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
-
-
-/* Function prototypes */
-
-#ifdef DDXOSVERRORF
-void OsVendorVErrorF (const char *pszFormat, va_list va_args);
-#endif
-
-
-/*
- * For the depth 24 pixmap we default to 32 bits per pixel, but
- * we change this pixmap format later if we detect that the display
- * is going to be running at 24 bits per pixel.
- *
- * FIXME: On second thought, don't DIBs only support 32 bits per pixel?
- * DIBs are the underlying bitmap used for DirectDraw surfaces, so it
- * seems that all pixmap formats with depth 24 would be 32 bits per pixel.
- * Confirm whether depth 24 DIBs can have 24 bits per pixel, then remove/keep
- * the bits per pixel adjustment and update this comment to reflect the
- * situation. Harold Hunt - 2002/07/02
- */
-
-static PixmapFormatRec g_PixmapFormats[] = {
- { 1, 1, BITMAP_SCANLINE_PAD },
- { 4, 8, BITMAP_SCANLINE_PAD },
- { 8, 8, BITMAP_SCANLINE_PAD },
- { 15, 16, BITMAP_SCANLINE_PAD },
- { 16, 16, BITMAP_SCANLINE_PAD },
- { 24, 32, BITMAP_SCANLINE_PAD },
-#ifdef RENDER
- { 32, 32, BITMAP_SCANLINE_PAD }
-#endif
-};
-
-const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]);
-
-
-void
-winInitializeDefaultScreens (void)
-{
- int i;
- DWORD dwWidth, dwHeight;
-
- /* Bail out early if default screens have already been initialized */
- if (g_fInitializedDefaultScreens)
- return;
-
- /* Zero the memory used for storing the screen info */
- ZeroMemory (g_ScreenInfo, MAXSCREENS * sizeof (winScreenInfo));
-
- /* Get default width and height */
- /*
- * NOTE: These defaults will cause the window to cover only
- * the primary monitor in the case that we have multiple monitors.
- */
- dwWidth = GetSystemMetrics (SM_CXSCREEN);
- dwHeight = GetSystemMetrics (SM_CYSCREEN);
-
- ErrorF ("winInitializeDefaultScreens - w %d h %d\n", dwWidth, dwHeight);
-
- /* Set a default DPI, if no parameter was passed */
- if (monitorResolution == 0)
- monitorResolution = WIN_DEFAULT_DPI;
-
- for (i = 0; i < MAXSCREENS; ++i)
- {
- g_ScreenInfo[i].dwScreen = i;
- g_ScreenInfo[i].dwWidth = dwWidth;
- g_ScreenInfo[i].dwHeight = dwHeight;
- g_ScreenInfo[i].dwUserWidth = dwWidth;
- g_ScreenInfo[i].dwUserHeight = dwHeight;
- g_ScreenInfo[i].fUserGaveHeightAndWidth
- = WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH;
- g_ScreenInfo[i].dwBPP = WIN_DEFAULT_BPP;
- g_ScreenInfo[i].dwClipUpdatesNBoxes = WIN_DEFAULT_CLIP_UPDATES_NBOXES;
- g_ScreenInfo[i].fEmulatePseudo = WIN_DEFAULT_EMULATE_PSEUDO;
- g_ScreenInfo[i].dwRefreshRate = WIN_DEFAULT_REFRESH;
- g_ScreenInfo[i].pfb = NULL;
- g_ScreenInfo[i].fFullScreen = FALSE;
- g_ScreenInfo[i].fDecoration = TRUE;
- g_ScreenInfo[i].fRootless = FALSE;
- g_ScreenInfo[i].fMultiWindow = FALSE;
- g_ScreenInfo[i].fMultipleMonitors = FALSE;
- g_ScreenInfo[i].fClipboard = FALSE;
- g_ScreenInfo[i].fLessPointer = FALSE;
- g_ScreenInfo[i].fScrollbars = FALSE;
- g_ScreenInfo[i].fNoTrayIcon = FALSE;
- g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF;
- g_ScreenInfo[i].dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI)
- * 25.4;
- g_ScreenInfo[i].dwHeight_mm = (dwHeight / WIN_DEFAULT_DPI)
- * 25.4;
- g_ScreenInfo[i].fUseWinKillKey = WIN_DEFAULT_WIN_KILL;
- g_ScreenInfo[i].fUseUnixKillKey = WIN_DEFAULT_UNIX_KILL;
- g_ScreenInfo[i].fIgnoreInput = FALSE;
- g_ScreenInfo[i].fExplicitScreen = FALSE;
- }
-
- /* Signal that the default screens have been initialized */
- g_fInitializedDefaultScreens = TRUE;
-
- ErrorF ("winInitializeDefaultScreens - Returning\n");
-}
-
-
-/* See Porting Layer Definition - p. 57 */
-void
-ddxGiveUp()
-{
-#if CYGDEBUG
- ErrorF ("ddxGiveUp\n");
-#endif
-
- /* Notify the worker threads we're exiting */
- winDeinitClipboard ();
- winDeinitMultiWindowWM ();
-
- /* Close our handle to our message queue */
- if (g_fdMessageQueue != WIN_FD_INVALID)
- {
- /* Close /dev/windows */
- close (g_fdMessageQueue);
-
- /* Set the file handle to invalid */
- g_fdMessageQueue = WIN_FD_INVALID;
- }
-
- if (!g_fLogInited) {
- LogInit(g_pszLogFile, NULL);
- g_fLogInited = TRUE;
- }
- LogClose();
-
- /*
- * At this point we aren't creating any new screens, so
- * we are guaranteed to not need the DirectDraw functions.
- */
- if (g_hmodDirectDraw != NULL)
- {
- FreeLibrary (g_hmodDirectDraw);
- g_hmodDirectDraw = NULL;
- g_fpDirectDrawCreate = NULL;
- g_fpDirectDrawCreateClipper = NULL;
- }
-
- /* Unload our TrackMouseEvent funtion pointer */
- if (g_hmodCommonControls != NULL)
- {
- FreeLibrary (g_hmodCommonControls);
- g_hmodCommonControls = NULL;
- g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
- }
-
- /* Tell Windows that we want to end the app */
- PostQuitMessage (0);
-}
-
-
-/* See Porting Layer Definition - p. 57 */
-void
-AbortDDX (void)
-{
-#if CYGDEBUG
- ErrorF ("AbortDDX\n");
-#endif
- ddxGiveUp ();
-}
-
-
-void
-OsVendorInit (void)
-{
-#ifdef DDXOSVERRORF
- if (!OsVendorVErrorFProc)
- OsVendorVErrorFProc = OsVendorVErrorF;
-#endif
-
- if (!g_fLogInited) {
- LogInit(g_pszLogFile, NULL);
- g_fLogInited = TRUE;
- }
- LogSetParameter(XLOG_FLUSH, 1);
- LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose);
-
- /* Add a default screen if no screens were specified */
- if (g_iNumScreens == 0)
- {
- ErrorF ("OsVendorInit - Creating bogus screen 0\n");
-
- /*
- * We need to initialize default screens if no arguments
- * were processed. Otherwise, the default screens would
- * already have been initialized by ddxProcessArgument ().
- */
- winInitializeDefaultScreens ();
-
- /*
- * Add a screen 0 using the defaults set by
- * winInitializeDefaultScreens () and any additional parameters
- * processed by ddxProcessArgument ().
- */
- g_iNumScreens = 1;
- g_iLastScreen = 0;
-
- /* We have to flag this as an explicit screen, even though it isn't */
- g_ScreenInfo[0].fExplicitScreen = TRUE;
- }
-}
-
-
-/* See Porting Layer Definition - p. 57 */
-void
-ddxUseMsg (void)
-{
- ErrorF ("-depth bits_per_pixel\n"
- "\tSpecify an optional bitdepth to use in fullscreen mode\n"
- "\twith a DirectDraw engine.\n");
-
- ErrorF ("-emulate3buttons [timeout]\n"
- "\tEmulate 3 button mouse with an optional timeout in\n"
- "\tmilliseconds.\n");
-
- ErrorF ("-engine engine_type_id\n"
- "\tOverride the server's automatically selected engine type:\n"
- "\t\t1 - Shadow GDI\n"
- "\t\t2 - Shadow DirectDraw\n"
- "\t\t4 - Shadow DirectDraw4 Non-Locking\n"
- "\t\t16 - Native GDI - experimental\n");
-
- ErrorF ("-fullscreen\n"
- "\tRun the server in fullscreen mode.\n");
-
- ErrorF ("-refresh rate_in_Hz\n"
- "\tSpecify an optional refresh rate to use in fullscreen mode\n"
- "\twith a DirectDraw engine.\n");
-
- ErrorF ("-screen scr_num [width height]\n"
- "\tEnable screen scr_num and optionally specify a width and\n"
- "\theight for that screen.\n");
-
- ErrorF ("-lesspointer\n"
- "\tHide the windows mouse pointer when it is over an inactive\n"
- "\tXFree86 window. This prevents ghost cursors appearing where\n"
- "\tthe Windows cursor is drawn overtop of the X cursor\n");
-
- ErrorF ("-nodecoration\n"
- "\tDo not draw a window border, title bar, etc. Windowed\n"
- "\tmode only.\n");
-
- ErrorF ("-rootless\n"
- "\tEXPERIMENTAL: Run the server in pseudo-rootless mode.\n");
-
- ErrorF ("-multiwindow\n"
- "\tEXPERIMENTAL: Run the server in multi-window mode.\n");
-
- ErrorF ("-multiplemonitors\n"
- "\tEXPERIMENTAL: Use the entire virtual screen if multiple\n"
- "\tmonitors are present.\n");
-
- ErrorF ("-clipboard\n"
- "\tEXPERIMENTAL: Run the clipboard integration module.\n");
-
- ErrorF ("-scrollbars\n"
- "\tIn windowed mode, allow screens bigger than the Windows desktop.\n"
- "\tMoreover, if the window has decorations, one can now resize\n"
- "\tit.\n");
-
- ErrorF ("-[no]trayicon\n"
- "\tDo not create a tray icon. Default is to create one\n"
- "\ticon per screen. You can globally disable tray icons with\n"
- "\t-notrayicon, then enable it for specific screens with\n"
- "\t-trayicon for those screens.\n");
-
- ErrorF ("-clipupdates num_boxes\n"
- "\tUse a clipping region to constrain shadow update blits to\n"
- "\tthe updated region when num_boxes, or more, are in the\n"
- "\tupdated region. Currently supported only by `-engine 1'.\n");
-
- ErrorF ("-emulatepseudo\n"
- "\tCreate a depth 8 PseudoColor visual when running in\n"
- "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n"
- "\tdepths. The PseudoColor visual does not have correct colors,\n"
- "\tand it may crash, but it at least allows you to run your\n"
- "\tapplication in TrueColor modes.\n");
-
- ErrorF ("-[no]unixkill\n"
- "\tCtrl+Alt+Backspace exits the X Server.\n");
-
- ErrorF ("-[no]winkill\n"
- "\tAlt+F4 exits the X Server.\n");
-
- ErrorF ("-xf86config\n"
- "\tSpecify a configuration file.\n");
-
- ErrorF ("-keyboard\n"
- "\tSpecify a keyboard device from the configuration file.\n");
-}
-
-
-/* See Porting Layer Definition - p. 57 */
-/*
- * INPUT
- * argv: pointer to an array of null-terminated strings, one for
- * each token in the X Server command line; the first token
- * is 'XWin.exe', or similar.
- * argc: a count of the number of tokens stored in argv.
- * i: a zero-based index into argv indicating the current token being
- * processed.
- *
- * OUTPUT
- * return: return the number of tokens processed correctly.
- *
- * NOTE
- * When looking for n tokens, check that i + n is less than argc. Or,
- * you may check if i is greater than or equal to argc, in which case
- * you should display the UseMsg () and return 0.
- */
-
-/* Check if enough arguments are given for the option */
-#define CHECK_ARGS(count) if (i + count >= argc) { UseMsg (); return 0; }
-
-/* Compare the current option with the string. */
-#define IS_OPTION(name) (strcmp (argv[i], name) == 0)
-
-int
-ddxProcessArgument (int argc, char *argv[], int i)
-{
- static Bool s_fBeenHere = FALSE;
-
- /* Initialize once */
- if (!s_fBeenHere)
- {
-#ifdef DDXOSVERRORF
- /*
- * This initialises our hook into VErrorF () for catching log messages
- * that are generated before OsInit () is called.
- */
- OsVendorVErrorFProc = OsVendorVErrorF;
-#endif
-
- s_fBeenHere = TRUE;
-
- /*
- * Initialize default screen settings. We have to do this before
- * OsVendorInit () gets called, otherwise we will overwrite
- * settings changed by parameters such as -fullscreen, etc.
- */
- ErrorF ("ddxProcessArgument - Initializing default screens\n");
- winInitializeDefaultScreens ();
- }
-
-#if CYGDEBUG
- ErrorF ("ddxProcessArgument - arg: %s\n", argv[i]);
-#endif
-
- /*
- * Look for the '-screen scr_num [width height]' argument
- */
- if (strcmp (argv[i], "-screen") == 0)
- {
- int iArgsProcessed = 1;
- int nScreenNum;
- int iWidth, iHeight;
-
-#if CYGDEBUG
- ErrorF ("ddxProcessArgument - screen - argc: %d i: %d\n",
- argc, i);
-#endif
-
- /* Display the usage message if the argument is malformed */
- if (i + 1 >= argc)
- {
- return 0;
- }
-
- /* Grab screen number */
- nScreenNum = atoi (argv[i + 1]);
-
- /* Validate the specified screen number */
- if (nScreenNum < 0 || nScreenNum >= MAXSCREENS)
- {
- ErrorF ("ddxProcessArgument - screen - Invalid screen number %d\n",
- nScreenNum);
- UseMsg ();
- return 0;
- }
-
- /* Look for 'WxD' or 'W D' */
- if (i + 2 < argc
- && 2 == sscanf (argv[i + 2], "%dx%d",
- (int *) &iWidth,
- (int *) &iHeight))
- {
- ErrorF ("ddxProcessArgument - screen - Found ``WxD'' arg\n");
- iArgsProcessed = 3;
- g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE;
- g_ScreenInfo[nScreenNum].dwWidth = iWidth;
- g_ScreenInfo[nScreenNum].dwHeight = iHeight;
- g_ScreenInfo[nScreenNum].dwUserWidth = iWidth;
- g_ScreenInfo[nScreenNum].dwUserHeight = iHeight;
- }
- else if (i + 3 < argc
- && 1 == sscanf (argv[i + 2], "%d",
- (int *) &iWidth)
- && 1 == sscanf (argv[i + 3], "%d",
- (int *) &iHeight))
- {
- ErrorF ("ddxProcessArgument - screen - Found ``W D'' arg\n");
- iArgsProcessed = 4;
- g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE;
- g_ScreenInfo[nScreenNum].dwWidth = iWidth;
- g_ScreenInfo[nScreenNum].dwHeight = iHeight;
- g_ScreenInfo[nScreenNum].dwUserWidth = iWidth;
- g_ScreenInfo[nScreenNum].dwUserHeight = iHeight;
- }
- else
- {
- ErrorF ("ddxProcessArgument - screen - Did not find size arg. "
- "dwWidth: %d dwHeight: %d\n",
- g_ScreenInfo[nScreenNum].dwWidth,
- g_ScreenInfo[nScreenNum].dwHeight);
- iArgsProcessed = 2;
- g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE;
- }
-
- /* Calculate the screen width and height in millimeters */
- if (g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth)
- {
- g_ScreenInfo[nScreenNum].dwWidth_mm
- = (g_ScreenInfo[nScreenNum].dwWidth
- / monitorResolution) * 25.4;
- g_ScreenInfo[nScreenNum].dwHeight_mm
- = (g_ScreenInfo[nScreenNum].dwHeight
- / monitorResolution) * 25.4;
- }
-
- /* Flag that this screen was explicity specified by the user */
- g_ScreenInfo[nScreenNum].fExplicitScreen = TRUE;
-
- /*
- * Keep track of the last screen number seen, as parameters seen
- * before a screen number apply to all screens, whereas parameters
- * seen after a screen number apply to that screen number only.
- */
- g_iLastScreen = nScreenNum;
-
- /* Keep a count of the number of screens */
- ++g_iNumScreens;
-
- return iArgsProcessed;
- }
-
- /*
- * Look for the '-engine n' argument
- */
- if (strcmp (argv[i], "-engine") == 0)
- {
- DWORD dwEngine = 0;
- CARD8 c8OnBits = 0;
-
- /* Display the usage message if the argument is malformed */
- if (++i >= argc)
- {
- UseMsg ();
- return 0;
- }
-
- /* Grab the argument */
- dwEngine = atoi (argv[i]);
-
- /* Count the one bits in the engine argument */
- c8OnBits = winCountBits (dwEngine);
-
- /* Argument should only have a single bit on */
- if (c8OnBits != 1)
- {
- UseMsg ();
- return 0;
- }
-
- /* Is this parameter attached to a screen or global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].dwEnginePreferred = dwEngine;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].dwEnginePreferred = dwEngine;
- }
-
- /* Indicate that we have processed the argument */
- return 2;
- }
-
- /*
- * Look for the '-fullscreen' argument
- */
- if (strcmp (argv[i], "-fullscreen") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fFullScreen = TRUE;
-
- /*
- * No scrollbars in fullscreen mode. Later, we may want to have
- * a fullscreen with a bigger virtual screen?
- */
- g_ScreenInfo[j].fScrollbars = FALSE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fFullScreen = TRUE;
-
- /*
- * No scrollbars in fullscreen mode. Later, we may want to have
- * a fullscreen with a bigger virtual screen?
- */
- g_ScreenInfo[g_iLastScreen].fScrollbars = FALSE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-lesspointer' argument
- */
- if (strcmp (argv[i], "-lesspointer") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fLessPointer = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fLessPointer = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-nodecoration' argument
- */
- if (strcmp (argv[i], "-nodecoration") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fDecoration = FALSE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fDecoration = FALSE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-rootless' argument
- */
- if (strcmp (argv[i], "-rootless") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fRootless = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fRootless = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-multiwindow' argument
- */
- if (strcmp (argv[i], "-multiwindow") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fMultiWindow = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fMultiWindow = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-multiplemonitors' argument
- */
- if (strcmp (argv[i], "-multiplemonitors") == 0
- || strcmp (argv[i], "-multimonitors") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fMultipleMonitors = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-scrollbars' argument
- */
- if (strcmp (argv[i], "-scrollbars") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- /* No scrollbar in fullscreen mode */
- if (!g_ScreenInfo[j].fFullScreen)
- g_ScreenInfo[j].fScrollbars = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- if (!g_ScreenInfo[g_iLastScreen].fFullScreen)
- {
- /* No scrollbar in fullscreen mode */
- g_ScreenInfo[g_iLastScreen].fScrollbars = TRUE;
- }
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
-
-
- /*
- * Look for the '-clipboard' argument
- */
- if (strcmp (argv[i], "-clipboard") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fClipboard = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fClipboard = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-ignoreinput' argument
- */
- if (strcmp (argv[i], "-ignoreinput") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fIgnoreInput = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fIgnoreInput = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-emulate3buttons' argument
- */
- if (strcmp (argv[i], "-emulate3buttons") == 0)
- {
- int iArgsProcessed = 1;
- int iE3BTimeout = WIN_DEFAULT_E3B_TIME;
-
- /* Grab the optional timeout value */
- if (i + 1 < argc
- && 1 == sscanf (argv[i + 1], "%d",
- &iE3BTimeout))
- {
- /* Indicate that we have processed the next argument */
- iArgsProcessed++;
- }
- else
- {
- /*
- * sscanf () won't modify iE3BTimeout if it doesn't find
- * the specified format; however, I want to be explicit
- * about setting the default timeout in such cases to
- * prevent some programs (me) from getting confused.
- */
- iE3BTimeout = WIN_DEFAULT_E3B_TIME;
- }
-
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].iE3BTimeout = iE3BTimeout;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].iE3BTimeout = iE3BTimeout;
- }
-
- /* Indicate that we have processed this argument */
- return iArgsProcessed;
- }
-
- /*
- * Look for the '-depth n' argument
- */
- if (strcmp (argv[i], "-depth") == 0)
- {
- DWORD dwBPP = 0;
-
- /* Display the usage message if the argument is malformed */
- if (++i >= argc)
- {
- UseMsg ();
- return 0;
- }
-
- /* Grab the argument */
- dwBPP = atoi (argv[i]);
-
- /* Is this parameter attached to a screen or global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].dwBPP = dwBPP;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].dwBPP = dwBPP;
- }
-
- /* Indicate that we have processed the argument */
- return 2;
- }
-
- /*
- * Look for the '-refresh n' argument
- */
- if (strcmp (argv[i], "-refresh") == 0)
- {
- DWORD dwRefreshRate = 0;
-
- /* Display the usage message if the argument is malformed */
- if (++i >= argc)
- {
- UseMsg ();
- return 0;
- }
-
- /* Grab the argument */
- dwRefreshRate = atoi (argv[i]);
-
- /* Is this parameter attached to a screen or global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].dwRefreshRate = dwRefreshRate;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].dwRefreshRate = dwRefreshRate;
- }
-
- /* Indicate that we have processed the argument */
- return 2;
- }
-
- /*
- * Look for the '-clipupdates num_boxes' argument
- */
- if (strcmp (argv[i], "-clipupdates") == 0)
- {
- DWORD dwNumBoxes = 0;
-
- /* Display the usage message if the argument is malformed */
- if (++i >= argc)
- {
- UseMsg ();
- return 0;
- }
-
- /* Grab the argument */
- dwNumBoxes = atoi (argv[i]);
-
- /* Is this parameter attached to a screen or global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].dwClipUpdatesNBoxes = dwNumBoxes;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].dwClipUpdatesNBoxes = dwNumBoxes;
- }
-
- /* Indicate that we have processed the argument */
- return 2;
- }
-
- /*
- * Look for the '-emulatepseudo' argument
- */
- if (strcmp (argv[i], "-emulatepseudo") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fEmulatePseudo = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fEmulatePseudo = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-nowinkill' argument
- */
- if (strcmp (argv[i], "-nowinkill") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fUseWinKillKey = FALSE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fUseWinKillKey = FALSE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-winkill' argument
- */
- if (strcmp (argv[i], "-winkill") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fUseWinKillKey = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fUseWinKillKey = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-nounixkill' argument
- */
- if (strcmp (argv[i], "-nounixkill") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fUseUnixKillKey = FALSE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fUseUnixKillKey = FALSE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-unixkill' argument
- */
- if (strcmp (argv[i], "-unixkill") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fUseUnixKillKey = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fUseUnixKillKey = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-notrayicon' argument
- */
- if (strcmp (argv[i], "-notrayicon") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fNoTrayIcon = TRUE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fNoTrayIcon = TRUE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-trayicon' argument
- */
- if (strcmp (argv[i], "-trayicon") == 0)
- {
- /* Is this parameter attached to a screen or is it global? */
- if (-1 == g_iLastScreen)
- {
- int j;
-
- /* Parameter is for all screens */
- for (j = 0; j < MAXSCREENS; j++)
- {
- g_ScreenInfo[j].fNoTrayIcon = FALSE;
- }
- }
- else
- {
- /* Parameter is for a single screen */
- g_ScreenInfo[g_iLastScreen].fNoTrayIcon = FALSE;
- }
-
- /* Indicate that we have processed this argument */
- return 1;
- }
-
- /*
- * Look for the '-fp' argument
- */
- if (IS_OPTION ("-fp"))
- {
- CHECK_ARGS (1);
- g_cmdline.fontPath = argv[++i];
- return 0; /* Let DIX parse this again */
- }
-
- /*
- * Look for the '-co' argument
- */
- if (IS_OPTION ("-co"))
- {
- CHECK_ARGS (1);
- g_cmdline.rgbPath = argv[++i];
- return 0; /* Let DIX parse this again */
- }
-
- /*
- * Look for the '-query' argument
- */
- if (IS_OPTION ("-query"))
- {
- CHECK_ARGS (1);
- g_pszQueryHost = argv[++i];
- return 0; /* Let DIX parse this again */
- }
-
- /*
- * Look for the '-xf86config' argument
- */
- if (IS_OPTION ("-xf86config"))
- {
- CHECK_ARGS (1);
- g_cmdline.configFile = argv[++i];
- return 2;
- }
-
- /*
- * Look for the '-keyboard' argument
- */
- if (IS_OPTION ("-keyboard"))
- {
- CHECK_ARGS (1);
- g_cmdline.keyboard = argv[++i];
- return 2;
- }
-
- /*
- * Look for the '-logfile' argument
- */
- if (IS_OPTION ("-logfile"))
- {
- CHECK_ARGS (1);
- g_pszLogFile = argv[++i];
- return 2;
- }
-
- /*
- * Look for the '-logverbose' argument
- */
- if (IS_OPTION ("-logverbose"))
- {
- CHECK_ARGS (1);
- g_iLogVerbose = atoi(argv[++i]);
- return 2;
- }
-
- return 0;
-}
-
-
-#ifdef DDXTIME /* from ServerOSDefines */
-CARD32
-GetTimeInMillis (void)
-{
- return GetTickCount ();
-}
-#endif /* DDXTIME */
-
-
-/* See Porting Layer Definition - p. 20 */
-/*
- * Do any global initialization, then initialize each screen.
- *
- * NOTE: We use ddxProcessArgument, so we don't need to touch argc and argv
- */
-
-void
-InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
-{
- int i;
- int iMaxConsecutiveScreen = 0;
-
-#if CYGDEBUG
- ErrorF ("InitOutput\n");
-#endif
-
- /* Try to read the XF86Config-style configuration file */
- if (!winReadConfigfile ())
- ErrorF ("InitOutput - Error reading config file\n");
-
- /* Setup global screen info parameters */
- screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
- screenInfo->numPixmapFormats = NUMFORMATS;
-
- /* Describe how we want common pixmap formats padded */
- for (i = 0; i < NUMFORMATS; i++)
- {
- screenInfo->formats[i] = g_PixmapFormats[i];
- }
-
- /* Load pointers to DirectDraw functions */
- winGetDDProcAddresses ();
-
- /* Detect supported engines */
- winDetectSupportedEngines ();
-
- /* Load common controls library */
- g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0);
-
- /* Load TrackMouseEvent function pointer */
- g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls,
- "_TrackMouseEvent");
- if (g_fpTrackMouseEvent == NULL)
- {
- ErrorF ("InitOutput - Could not get pointer to function\n"
- "\t_TrackMouseEvent in comctl32.dll. Try installing\n"
- "\tInternet Explorer 3.0 or greater if you have not\n"
- "\talready.\n");
-
- /* Free the library since we won't need it */
- FreeLibrary (g_hmodCommonControls);
- g_hmodCommonControls = NULL;
-
- /* Set function pointer to point to no operation function */
- g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
- }
-
- /*
- * Check for a malformed set of -screen parameters.
- * Examples of malformed parameters:
- * XWin -screen 1
- * XWin -screen 0 -screen 2
- * XWin -screen 1 -screen 2
- */
- for (i = 0; i < MAXSCREENS; i++)
- {
- if (g_ScreenInfo[i].fExplicitScreen)
- iMaxConsecutiveScreen = i + 1;
- }
- ErrorF ("InitOutput - g_iNumScreens: %d iMaxConsecutiveScreen: %d\n",
- g_iNumScreens, iMaxConsecutiveScreen);
- if (g_iNumScreens < iMaxConsecutiveScreen)
- FatalError ("InitOutput - Malformed set of screen parameter(s). "
- "Screens must be specified consecutively starting with "
- "screen 0. That is, you cannot have only a screen 1, nor "
- "could you have screen 0 and screen 2. You instead must have "
- "screen 0, or screen 0 and screen 1, respectively. Of "
- "you can specify as many screens as you want from 0 up to "
- "%d.\n", MAXSCREENS - 1);
-
- /* Store the instance handle */
- g_hInstance = GetModuleHandle (NULL);
-
- /* Initialize each screen */
- for (i = 0; i < g_iNumScreens; i++)
- {
- /* Initialize the screen */
- if (-1 == AddScreen (winScreenInit, argc, argv))
- {
- FatalError ("InitOutput - Couldn't add screen %d", i);
- }
- }
-
- LoadPreferences();
-
-#if CYGDEBUG || YES
- ErrorF ("InitOutput - Returning.\n");
-#endif
-}
diff --git a/hw/xwin/X.ico b/hw/xwin/X.ico
deleted file mode 100644
index 26e2cf947..000000000
--- a/hw/xwin/X.ico
+++ /dev/null
Binary files differ
diff --git a/hw/xwin/XWin.man b/hw/xwin/XWin.man
deleted file mode 100644
index fe78047c4..000000000
--- a/hw/xwin/XWin.man
+++ /dev/null
@@ -1,129 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/xwin/XWin.man,v 1.7 2003/10/02 13:30:09 eich Exp $
-.TH XWIN 1 __vendorversion__
-.SH NAME
-XWin \- X Server for the Cygwin environment on Microsoft Windows
-.SH SYNOPSIS
-.B XWin
-[ options ] ...
-.SH DESCRIPTION
-.I XWin
-is an X Server for the X Window System on the Cygwin environment
-running on Microsoft Windows.
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXWin\fP accepts the following command line switches:
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specify the color depth, in bits per pixel, to use when running in
-fullscreen with a DirectDraw engine. This parameter is ignored if
-\fB\-fullscreen\fP is not specified.
-.TP 8
-.B "\-emulate3buttons \fItimeout\fP"
-Emulate a three button mouse; pressing both buttons within
-.I timeout
-milliseconds causes an emulated middle button press. The default
-.I timeout
-is 50 milliseconds.
-.TP 8
-.B "\-engine \fIengine_type_id\fP"
-Override the server's automatically supported engine type. This
-parameter will be ignored if the specified engine type is not
-supported on the current system. The supported engine type ids are 1
-- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw4.
-Additionally, there is a barely functional experimental engine type id
-16 - Native GDI.
-.TP 8
-.B \-fullscreen
-Run the server in fullscreen mode, as opposed to the default windowed
-mode.
-.TP 8
-.B "\-refresh \fIrate_in_Hz\fP"
-Specify an optional refresh rate to use when running in
-fullscreen with a DirectDraw engine. This parameter is ignored if
-\fB\-fullscreen\fP is not specified.
-.TP 8
-.B "\-screen \fIscreen_number\fP \fIwidth\fP \fIheight\fP"
-Sets the display resolution for the X server to use on screen
-.I screen_number.
-.TP 8
-.B \-nodecoration
-Draw the Cygwin/XFree86 window without a border or title bar.
-.TP 8
-.B \-rootless
-EXPERIMENTAL: Run Cygwin/XFree86 in pseduo-rootless mode.
-.TP 8
-.B \-lesspointer
-Hide the Windows mouse pointer when over an inactive XFree86 window
-.TP 8
-.B \-scrollbars
-In windowed mode, allow screens bigger than the Windows desktop.
-Moreover, if the window has decorations, one can now resize it.
-.TP 8
-.B "\-clipupdates \fInum_boxes\fP"
-Specify an optional threshold, above which the boxes in a shadow
-update operation will be collected into a GDI clipping region. The
-clipping region is then used to do a single bit block transfer that is
-constrained to the updated area by the clipping region. There is some
-overhead involved in creating, installing, destroying, and removing
-the clipping region, thus there may not be much benefit for a small
-number of boxes (less than 10). It is even possible that this
-functionality does not provide a benefit at any number of boxes; we
-can only determine the usefullness of this feature through testing.
-This parameter works in conjunction with engines 1, 2, and 4 (Shadow
-GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
-respectively).
-.TP 8
-.B \-emulatepseudo
-Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
-or 32, collectively known as TrueColor depths. The PseudoColor visual
-does not have correct colors, and it may crash, but it at least allows
-you to run your PseudoColor application in TrueColor modes.
-.TP 8
-.B \-[no]unixkill
-Ctrl+Alt+Backspace exits the X Server
-.TP 8
-.B \-[no]winkill
-Alt+F4 exits the X Server
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(5)
-.SH BUGS
-.I XWin
-and this man page still have many limitations. Some of the more obvious
-ones are:
-.br
-- The display mode can not be changed once the X server has started.
-.PP
-.SH AUTHORS
-XFree86 was originally ported to Cygwin by Dakshinamurthy Karra,
-Dr. Peter Busch, John Fortin, and Suhaib Siddiqi.
-.I XWin
-is maintained by the Cygwin/XFree86 project, with hosting services
-provided by RedHat.
-.PP
-The following members, in alphabetical order by last name, of the
-Cygwin/XFree86 Team contributed to the XFree86 4.1.0 release:
-.PP
-Robert Collins - Cygwin developer, miscellaneous
-.br
-Christopher Faylor - Management of hosting services, general
-programming guru
-.br
-Alexander Gottwald - AltGr handling for non-U.S. keyboards
-.br
-Alan Hourihane - XFree86 developer, patch reviewer, general programming guru
-.br
-Pierre A Humblet - Debugging of socket-related crashes, developer
-.br
-Harold L Hunt II - Project leader, lead developer, documentation,
-and website updates
-.br
-Suhaib Siddiqi - Originator of the project
-
-
-
-
-
-
-
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
deleted file mode 100644
index 7b5708af2..000000000
--- a/hw/xwin/XWin.rc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/XWin.rc,v 1.2 2003/07/29 21:25:15 dawes Exp $ */
-
-#include "resource.h"
-
-
-/*
- * Dialogs
- */
-
-/* Depth_Change */
-
-DEPTH_CHANGE_BOX DIALOG DISCARDABLE 32, 32, 180, 100
-STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER
-FONT 8, "MS Sans Serif"
-CAPTION "Cygwin/XFree86"
-BEGIN
- DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
- CTEXT "Cygwin/XFree86", IDC_STATIC, 40, 12, 100, 8
- CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
- CTEXT "Restore previous resolution to use Cygwin/XFree86.", IDC_STATIC, 7, 52, 166, 8
-END
-
-
-/* Exit */
-
-EXIT_DIALOG DIALOG DISCARDABLE 32, 32, 180, 70
-STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTER
-FONT 8, "MS Sans Serif"
-CAPTION "Cygwin/XFree86 - Exit?"
-BEGIN
- PUSHBUTTON "E&xit", IDOK, 55, 48, 30, 14
- DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 48, 30, 14
- CTEXT "Exiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
- CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 24, 166, 8
-END
-
-
-/*
- * Menus
- */
-
-IDM_TRAYICON_MENU MENU DISCARDABLE
-BEGIN
- POPUP "TRAYICON_MENU"
- BEGIN
- MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
- MENUITEM "&Show Root Window", ID_APP_SHOW_ROOT
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
- END
-END
-
-
-/*
- * Icons
- */
-
-IDI_XWIN ICON DISCARDABLE "X.ico"
diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
deleted file mode 100644
index dbd79f2bf..000000000
--- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
+++ /dev/null
@@ -1,105 +0,0 @@
-# XWin Server Resource File - EXAMPLE
-# Earle F. Philhower, III
-
-# Place in ~/.XWinrc or in /usr/X11R6/lib/X11/system.XWinrc
-
-# Keywords are case insensitive, comments legal pretty much anywhere
-# you can have an end-of-line
-
-# Comments begin with "#" or "//" and go to the end-of-line
-
-# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc)
-
-# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons)
-
-# Menus are defined as...
-# MENU <name> {
-# <Menu Text> EXEC <command>
-# ^^ This command will have any "%display%"
-# string replaced with the proper display
-# variable (i.e. 127.0.0.1:<display>.0)
-# or <Menu Text> MENU <name-of-some-prior-defined-menu>
-# or <Menu Text> ALWAYSONTOP
-# ^^ Sets the window to display above all others
-# or <Menu Text> RELOAD
-# ^^ Causes ~/.XWinrc or the system.XWinrc file
-# to be reloaded and icons and menus regenerated
-# or SEPARATOR
-# ...
-# }
-
-# Set the taskmar menu with
-# ROOTMENU <name-of-some-prior-defined-menu>
-
-# If you want a menu to be applied to all popup window's system menu
-# DEFAULTSYSMENU <name-of-some-prior-defined-menu> <atstart|atend>
-
-# To choose a specific menu for a specific WM_CLASS or WM_NAME use ...
-# SYSMENU {
-# <class-or-name-of-window> <name-of-prior-defined-menu> <atstart|atend>
-# ...
-# }
-
-# To define where ICO files live (** Windows path**)
-# ICONDIRECTORY <windows-path i.e. c:\cygwin\usr\icons>
-
-# To define a replacement for the standard X icon for apps w/o specified icons
-# DEFAULTICON <name-of-windows-ico-file-in-icondirectory>
-
-# To define substitute icons on a per-window basis use...
-# ICONS {
-# <class-or-name-of-window> <icon-file-name.ico>
-# ...
-# }
-# In the case where multiple matches occur, the first listed in the ICONS
-# section will be chosen.
-
-# DEBUG <string> prints out the string to the XWin.log file
-
-// Below are just some silly menus to demonstrate writing your
-// own configuration file.
-
-// Make some menus...
-menu apps {
- xterm exec "xterm"
- "Emacs" exec "emacs"
- notepad exec notepad
- xload exec "xload -display %display%" # Comment
-}
-
-menu root {
-// Comments fit here, too...
- "Reload .XWinrc" RELOAD
- "Applications" menu apps
- SEParATOR
-}
-
-menu aot {
- Separator
- "Always on Top" alwaysontop
-}
-
-menu xtermspecial {
- "Emacs" exec "emacs"
- "Always on Top" alwaysontop
- SepArAtor
-}
-
-RootMenu root
-
-DefaultSysMenu aot atend
-
-SysMenu {
- "xterm" xtermspecial atstart
-}
-
-# IconDirectory "c:\winnt\"
-
-# DefaultIcon "reinstall.ico"
-
-# Icons {
-# "xterm" "uninstall.ico"
-# }
-
-DEBUG "Done parsing the configuration file..."
-
diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h
deleted file mode 100644
index b67a556b5..000000000
--- a/hw/xwin/ddraw.h
+++ /dev/null
@@ -1,2094 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xwin/ddraw.h,v 1.4 2001/07/29 22:08:15 tsi Exp $ */
-
-#ifndef __WINE_DDRAW_H
-#define __WINE_DDRAW_H
-
-#include <winnt.h>
-#include <wingdi.h>
-#include "obj_base.h"
-
-#ifdef NONAMELESSUNION
-#ifndef DUMMYUNIONNAME1
-#define DUMMYUNIONNAME1 u1
-#endif
-#endif
-
-# ifdef UNICODE
-# define WINELIB_NAME_AW(func) func##W
-# else
-# define WINELIB_NAME_AW(func) func##A
-# endif /* UNICODE */
-#define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-#ifndef DIRECTDRAW_VERSION
-#define DIRECTDRAW_VERSION 0x0700
-#endif /* DIRECTDRAW_VERSION */
-
-/*****************************************************************************
- * Predeclare the interfaces
- */
-DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
-DEFINE_GUID( CLSID_DirectDraw7, 0x3C305196,0x50DB,0x11D3,0x9C,0xFE,0x00,0xC0,0x4F,0xD9,0x30,0xC5 );
-DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
-DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
-DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
-DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
-DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
-DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
-DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
-DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
-DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
-DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
-
-typedef struct IDirectDraw IDirectDraw,*LPDIRECTDRAW;
-typedef struct IDirectDraw2 IDirectDraw2,*LPDIRECTDRAW2;
-typedef struct IDirectDraw4 IDirectDraw4,*LPDIRECTDRAW4;
-typedef struct IDirectDraw7 IDirectDraw7,*LPDIRECTDRAW7;
-typedef struct IDirectDrawClipper IDirectDrawClipper,*LPDIRECTDRAWCLIPPER;
-typedef struct IDirectDrawPalette IDirectDrawPalette,*LPDIRECTDRAWPALETTE;
-typedef struct IDirectDrawSurface IDirectDrawSurface,*LPDIRECTDRAWSURFACE;
-typedef struct IDirectDrawSurface2 IDirectDrawSurface2,*LPDIRECTDRAWSURFACE2;
-typedef struct IDirectDrawSurface3 IDirectDrawSurface3,*LPDIRECTDRAWSURFACE3;
-typedef struct IDirectDrawSurface4 IDirectDrawSurface4,*LPDIRECTDRAWSURFACE4;
-typedef struct IDirectDrawSurface7 IDirectDrawSurface7,*LPDIRECTDRAWSURFACE7;
-typedef struct IDirectDrawColorControl IDirectDrawColorControl,*LPDIRECTDRAWCOLORCONTROL;
-typedef struct IDirectDrawGammaControl IDirectDrawGammaControl,*LPDIRECTDRAWGAMMACONTROL;
-
-
-#define DDENUMRET_CANCEL 0
-#define DDENUMRET_OK 1
-
-#define DD_OK 0
-
-
-#define _FACDD 0x876
-#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
-
-#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 )
-#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 )
-#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 )
-#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 )
-#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 )
-#define DDERR_GENERIC E_FAIL
-#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 )
-#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 )
-#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 )
-#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 )
-#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 )
-#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 )
-#define DDERR_INVALIDPARAMS E_INVALIDARG
-#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 )
-#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 )
-#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 )
-#define DDERR_NO3D MAKE_DDHRESULT( 170 )
-#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 )
-#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 )
-#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 )
-#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 )
-#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 )
-#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 )
-#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 )
-#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 )
-#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 )
-#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 )
-#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 )
-#define DDERR_NOGDI MAKE_DDHRESULT( 240 )
-#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 )
-#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 )
-#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 )
-#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 )
-#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 )
-#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 )
-#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 )
-#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 )
-#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 )
-#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 )
-#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 )
-#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 )
-#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 )
-#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 )
-#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 )
-#define DDERR_OUTOFMEMORY E_OUTOFMEMORY
-#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 )
-#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 )
-#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 )
-#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 )
-#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 )
-#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 )
-#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 )
-#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 )
-#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 )
-#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 )
-#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 )
-#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 )
-#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 )
-#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 )
-#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 )
-#define DDERR_UNSUPPORTED E_NOTIMPL
-#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 )
-#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 )
-#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 )
-#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 )
-#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 )
-#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 )
-#define DDERR_XALIGN MAKE_DDHRESULT( 560 )
-#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 )
-#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 )
-#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 )
-#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 )
-#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 )
-#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 )
-#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 )
-#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 )
-#define DDERR_NOHWND MAKE_DDHRESULT( 569 )
-#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 )
-#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 )
-#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 )
-#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 )
-#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 )
-#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 )
-#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 )
-#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 )
-#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 )
-#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 )
-#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 )
-#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 )
-#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 )
-#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 )
-#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 )
-#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 )
-#define DDERR_NODC MAKE_DDHRESULT( 586 )
-#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 )
-#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 )
-#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 )
-#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 )
-#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 )
-#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 )
-#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 )
-#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 )
-#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 )
-#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 )
-#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 )
-#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 )
-#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 )
-#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 )
-#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 )
-#define DDERR_MOREDATA MAKE_DDHRESULT( 690 )
-#define DDERR_EXPIRED MAKE_DDHRESULT( 691 )
-#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 )
-#define DDERR_NEWMODE MAKE_DDHRESULT( 693 )
-#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 )
-#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 )
-#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 )
-#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 )
-#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 )
-#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED
-
-/* dwFlags for Blt* */
-#define DDBLT_ALPHADEST 0x00000001
-#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002
-#define DDBLT_ALPHADESTNEG 0x00000004
-#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008
-#define DDBLT_ALPHAEDGEBLEND 0x00000010
-#define DDBLT_ALPHASRC 0x00000020
-#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040
-#define DDBLT_ALPHASRCNEG 0x00000080
-#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100
-#define DDBLT_ASYNC 0x00000200
-#define DDBLT_COLORFILL 0x00000400
-#define DDBLT_DDFX 0x00000800
-#define DDBLT_DDROPS 0x00001000
-#define DDBLT_KEYDEST 0x00002000
-#define DDBLT_KEYDESTOVERRIDE 0x00004000
-#define DDBLT_KEYSRC 0x00008000
-#define DDBLT_KEYSRCOVERRIDE 0x00010000
-#define DDBLT_ROP 0x00020000
-#define DDBLT_ROTATIONANGLE 0x00040000
-#define DDBLT_ZBUFFER 0x00080000
-#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000
-#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000
-#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000
-#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000
-#define DDBLT_WAIT 0x01000000
-#define DDBLT_DEPTHFILL 0x02000000
-#define DDBLT_DONOTWAIT 0x08000000
-
-/* dwTrans for BltFast */
-#define DDBLTFAST_NOCOLORKEY 0x00000000
-#define DDBLTFAST_SRCCOLORKEY 0x00000001
-#define DDBLTFAST_DESTCOLORKEY 0x00000002
-#define DDBLTFAST_WAIT 0x00000010
-#define DDBLTFAST_DONOTWAIT 0x00000020
-
-/* dwFlags for Flip */
-#define DDFLIP_WAIT 0x00000001
-#define DDFLIP_EVEN 0x00000002 /* only valid for overlay */
-#define DDFLIP_ODD 0x00000004 /* only valid for overlay */
-#define DDFLIP_NOVSYNC 0x00000008
-#define DDFLIP_STEREO 0x00000010
-#define DDFLIP_DONOTWAIT 0x00000020
-
-/* dwFlags for GetBltStatus */
-#define DDGBS_CANBLT 0x00000001
-#define DDGBS_ISBLTDONE 0x00000002
-
-/* dwFlags for IDirectDrawSurface7::GetFlipStatus */
-#define DDGFS_CANFLIP 1L
-#define DDGFS_ISFLIPDONE 2L
-
-/* dwFlags for IDirectDrawSurface7::SetPrivateData */
-#define DDSPD_IUNKNOWNPTR 1L
-#define DDSPD_VOLATILE 2L
-
-/* DDSCAPS.dwCaps */
-/* reserved1, was 3d capable */
-#define DDSCAPS_RESERVED1 0x00000001
-/* surface contains alpha information */
-#define DDSCAPS_ALPHA 0x00000002
-/* this surface is a backbuffer */
-#define DDSCAPS_BACKBUFFER 0x00000004
-/* complex surface structure */
-#define DDSCAPS_COMPLEX 0x00000008
-/* part of surface flipping structure */
-#define DDSCAPS_FLIP 0x00000010
-/* this surface is the frontbuffer surface */
-#define DDSCAPS_FRONTBUFFER 0x00000020
-/* this is a plain offscreen surface */
-#define DDSCAPS_OFFSCREENPLAIN 0x00000040
-/* overlay */
-#define DDSCAPS_OVERLAY 0x00000080
-/* palette objects can be created and attached to us */
-#define DDSCAPS_PALETTE 0x00000100
-/* primary surface (the one the user looks at currently)(right eye)*/
-#define DDSCAPS_PRIMARYSURFACE 0x00000200
-/* primary surface for left eye */
-#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400
-/* surface exists in systemmemory */
-#define DDSCAPS_SYSTEMMEMORY 0x00000800
-/* surface can be used as a texture */
-#define DDSCAPS_TEXTURE 0x00001000
-/* surface may be destination for 3d rendering */
-#define DDSCAPS_3DDEVICE 0x00002000
-/* surface exists in videomemory */
-#define DDSCAPS_VIDEOMEMORY 0x00004000
-/* surface changes immediately visible */
-#define DDSCAPS_VISIBLE 0x00008000
-/* write only surface */
-#define DDSCAPS_WRITEONLY 0x00010000
-/* zbuffer surface */
-#define DDSCAPS_ZBUFFER 0x00020000
-/* has its own DC */
-#define DDSCAPS_OWNDC 0x00040000
-/* surface should be able to receive live video */
-#define DDSCAPS_LIVEVIDEO 0x00080000
-/* should be able to have a hw codec decompress stuff into it */
-#define DDSCAPS_HWCODEC 0x00100000
-/* mode X (320x200 or 320x240) surface */
-#define DDSCAPS_MODEX 0x00200000
-/* one mipmap surface (1 level) */
-#define DDSCAPS_MIPMAP 0x00400000
-#define DDSCAPS_RESERVED2 0x00800000
-/* memory allocation delayed until Load() */
-#define DDSCAPS_ALLOCONLOAD 0x04000000
-/* Indicates that the surface will receive data from a video port */
-#define DDSCAPS_VIDEOPORT 0x08000000
-/* surface is in local videomemory */
-#define DDSCAPS_LOCALVIDMEM 0x10000000
-/* surface is in nonlocal videomemory */
-#define DDSCAPS_NONLOCALVIDMEM 0x20000000
-/* surface is a standard VGA mode surface (NOT ModeX) */
-#define DDSCAPS_STANDARDVGAMODE 0x40000000
-/* optimized? surface */
-#define DDSCAPS_OPTIMIZED 0x80000000
-
-typedef struct _DDSCAPS {
- DWORD dwCaps; /* capabilities of surface wanted */
-} DDSCAPS,*LPDDSCAPS;
-
-/* DDSCAPS2.dwCaps2 */
-/* indicates the surface will receive data from a video port using
- deinterlacing hardware. */
-#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000002
-/* indicates the surface will be locked very frequently. */
-#define DDSCAPS2_HINTDYNAMIC 0x00000004
-/* indicates surface can be re-ordered or retiled on load() */
-#define DDSCAPS2_HINTSTATIC 0x00000008
-/* indicates surface to be managed by directdraw/direct3D */
-#define DDSCAPS2_TEXTUREMANAGE 0x00000010
-/* reserved bits */
-#define DDSCAPS2_RESERVED1 0x00000020
-#define DDSCAPS2_RESERVED2 0x00000040
-/* indicates surface will never be locked again */
-#define DDSCAPS2_OPAQUE 0x00000080
-/* set at CreateSurface() time to indicate antialising will be used */
-#define DDSCAPS2_HINTANTIALIASING 0x00000100
-/* set at CreateSurface() time to indicate cubic environment map */
-#define DDSCAPS2_CUBEMAP 0x00000200
-/* face flags for cube maps */
-#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
-#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
-#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
-#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
-#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
-#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
-/* specifies all faces of a cube for CreateSurface() */
-#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\
- DDSCAPS2_CUBEMAP_NEGATIVEX |\
- DDSCAPS2_CUBEMAP_POSITIVEY |\
- DDSCAPS2_CUBEMAP_NEGATIVEY |\
- DDSCAPS2_CUBEMAP_POSITIVEZ |\
- DDSCAPS2_CUBEMAP_NEGATIVEZ )
-/* set for mipmap sublevels on DirectX7 and later. ignored by CreateSurface() */
-#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000
-/* indicates texture surface to be managed by Direct3D *only* */
-#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000
-/* indicates managed surface that can safely be lost */
-#define DDSCAPS2_DONOTPERSIST 0x00040000
-/* indicates surface is part of a stereo flipping chain */
-#define DDSCAPS2_STEREOSURFACELEFT 0x00080000
-
-typedef struct _DDSCAPS2 {
- DWORD dwCaps; /* capabilities of surface wanted */
- DWORD dwCaps2; /* additional capabilities */
- DWORD dwCaps3; /* reserved capabilities */
- DWORD dwCaps4; /* more reserved capabilities */
-} DDSCAPS2,*LPDDSCAPS2;
-
-#define DD_ROP_SPACE (256/32) /* space required to store ROP array */
-
-typedef struct _DDCAPS_DX7 /* DirectX 7 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
- DDSCAPS2 ddsCaps; /* surface capabilities */
-} DDCAPS_DX7,*LPDDCAPS_DX7;
-
-typedef struct _DDCAPS_DX6 /* DirectX 6 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
- /* and one new member for DirectX 6 */
- DDSCAPS2 ddsCaps; /* surface capabilities */
-} DDCAPS_DX6,*LPDDCAPS_DX6;
-
-typedef struct _DDCAPS_DX5 /* DirectX5 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- /* the following are the new DirectX 5 members */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
-} DDCAPS_DX5,*LPDDCAPS_DX5;
-
-typedef struct _DDCAPS_DX3 /* DirectX3 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwReserved4;
- DWORD dwReserved5;
- DWORD dwReserved6;
-} DDCAPS_DX3,*LPDDCAPS_DX3;
-
-/* set caps struct according to DIRECTDRAW_VERSION */
-
-#if DIRECTDRAW_VERSION <= 0x300
-typedef DDCAPS_DX3 DDCAPS;
-#elif DIRECTDRAW_VERSION <= 0x500
-typedef DDCAPS_DX5 DDCAPS;
-#elif DIRECTDRAW_VERSION <= 0x600
-typedef DDCAPS_DX6 DDCAPS;
-#else
-typedef DDCAPS_DX7 DDCAPS;
-#endif
-
-typedef DDCAPS *LPDDCAPS;
-
-/* DDCAPS.dwCaps */
-#define DDCAPS_3D 0x00000001
-#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002
-#define DDCAPS_ALIGNSIZEDEST 0x00000004
-#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008
-#define DDCAPS_ALIGNSIZESRC 0x00000010
-#define DDCAPS_ALIGNSTRIDE 0x00000020
-#define DDCAPS_BLT 0x00000040
-#define DDCAPS_BLTQUEUE 0x00000080
-#define DDCAPS_BLTFOURCC 0x00000100
-#define DDCAPS_BLTSTRETCH 0x00000200
-#define DDCAPS_GDI 0x00000400
-#define DDCAPS_OVERLAY 0x00000800
-#define DDCAPS_OVERLAYCANTCLIP 0x00001000
-#define DDCAPS_OVERLAYFOURCC 0x00002000
-#define DDCAPS_OVERLAYSTRETCH 0x00004000
-#define DDCAPS_PALETTE 0x00008000
-#define DDCAPS_PALETTEVSYNC 0x00010000
-#define DDCAPS_READSCANLINE 0x00020000
-#define DDCAPS_STEREOVIEW 0x00040000
-#define DDCAPS_VBI 0x00080000
-#define DDCAPS_ZBLTS 0x00100000
-#define DDCAPS_ZOVERLAYS 0x00200000
-#define DDCAPS_COLORKEY 0x00400000
-#define DDCAPS_ALPHA 0x00800000
-#define DDCAPS_COLORKEYHWASSIST 0x01000000
-#define DDCAPS_NOHARDWARE 0x02000000
-#define DDCAPS_BLTCOLORFILL 0x04000000
-#define DDCAPS_BANKSWITCHED 0x08000000
-#define DDCAPS_BLTDEPTHFILL 0x10000000
-#define DDCAPS_CANCLIP 0x20000000
-#define DDCAPS_CANCLIPSTRETCHED 0x40000000
-#define DDCAPS_CANBLTSYSMEM 0x80000000
-
-/* DDCAPS.dwCaps2 */
-#define DDCAPS2_CERTIFIED 0x00000001
-#define DDCAPS2_NO2DDURING3DSCENE 0x00000002
-#define DDCAPS2_VIDEOPORT 0x00000004
-#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008
-#define DDCAPS2_CANBOBINTERLEAVED 0x00000010
-#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020
-#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040
-#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080
-#define DDCAPS2_CANDROPZ16BIT 0x00000100
-#define DDCAPS2_NONLOCALVIDMEM 0x00000200
-#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400
-#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800
-#define DDCAPS2_WIDESURFACES 0x00001000
-#define DDCAPS2_CANFLIPODDEVEN 0x00002000
-#define DDCAPS2_CANBOBHARDWARE 0x00004000
-#define DDCAPS2_COPYFOURCC 0x00008000
-#define DDCAPS2_PRIMARYGAMMA 0x00020000
-#define DDCAPS2_CANRENDERWINDOWED 0x00080000
-#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000
-#define DDCAPS2_FLIPINTERVAL 0x00200000
-#define DDCAPS2_FLIPNOVSYNC 0x00400000
-#define DDCAPS2_CANMANAGETEXTURE 0x00800000
-#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000
-#define DDCAPS2_STEREO 0x02000000
-#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000
-
-
-/* Set/Get Colour Key Flags */
-#define DDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */
-#define DDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */
-#define DDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */
-#define DDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */
-#define DDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */
-
-typedef struct _DDCOLORKEY
-{
- DWORD dwColorSpaceLowValue;/* low boundary of color space that is to
- * be treated as Color Key, inclusive
- */
- DWORD dwColorSpaceHighValue;/* high boundary of color space that is
- * to be treated as Color Key, inclusive
- */
-} DDCOLORKEY,*LPDDCOLORKEY;
-
-/* ddCKEYCAPS bits */
-#define DDCKEYCAPS_DESTBLT 0x00000001
-#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002
-#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004
-#define DDCKEYCAPS_DESTBLTYUV 0x00000008
-#define DDCKEYCAPS_DESTOVERLAY 0x00000010
-#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020
-#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
-#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
-#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100
-#define DDCKEYCAPS_SRCBLT 0x00000200
-#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400
-#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
-#define DDCKEYCAPS_SRCBLTYUV 0x00001000
-#define DDCKEYCAPS_SRCOVERLAY 0x00002000
-#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
-#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
-#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
-#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000
-#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000
-
-typedef struct _DDPIXELFORMAT {
- DWORD dwSize; /* 0: size of structure */
- DWORD dwFlags; /* 4: pixel format flags */
- DWORD dwFourCC; /* 8: (FOURCC code) */
- union {
- DWORD dwRGBBitCount; /* C: how many bits per pixel */
- DWORD dwYUVBitCount; /* C: how many bits per pixel */
- DWORD dwZBufferBitDepth; /* C: how many bits for z buffers */
- DWORD dwAlphaBitDepth; /* C: how many bits for alpha channels*/
- DWORD dwLuminanceBitCount;
- DWORD dwBumpBitCount;
- } DUMMYUNIONNAME1;
- union {
- DWORD dwRBitMask; /* 10: mask for red bit*/
- DWORD dwYBitMask; /* 10: mask for Y bits*/
- DWORD dwStencilBitDepth;
- DWORD dwLuminanceBitMask;
- DWORD dwBumpDuBitMask;
- } DUMMYUNIONNAME2;
- union {
- DWORD dwGBitMask; /* 14: mask for green bits*/
- DWORD dwUBitMask; /* 14: mask for U bits*/
- DWORD dwZBitMask;
- DWORD dwBumpDvBitMask;
- } DUMMYUNIONNAME3;
- union {
- DWORD dwBBitMask; /* 18: mask for blue bits*/
- DWORD dwVBitMask; /* 18: mask for V bits*/
- DWORD dwStencilBitMask;
- DWORD dwBumpLuminanceBitMask;
- } DUMMYUNIONNAME4;
- union {
- DWORD dwRGBAlphaBitMask; /* 1C: mask for alpha channel */
- DWORD dwYUVAlphaBitMask; /* 1C: mask for alpha channel */
- DWORD dwLuminanceAlphaBitMask;
- DWORD dwRGBZBitMask; /* 1C: mask for Z channel */
- DWORD dwYUVZBitMask; /* 1C: mask for Z channel */
- } DUMMYUNIONNAME5;
- /* 20: next structure */
-} DDPIXELFORMAT,*LPDDPIXELFORMAT;
-
-/* DDCAPS.dwFXCaps */
-#define DDFXCAPS_BLTALPHA 0x00000001
-#define DDFXCAPS_OVERLAYALPHA 0x00000004
-#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010
-#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020
-#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040
-#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080
-#define DDFXCAPS_BLTROTATION 0x00000100
-#define DDFXCAPS_BLTROTATION90 0x00000200
-#define DDFXCAPS_BLTSHRINKX 0x00000400
-#define DDFXCAPS_BLTSHRINKXN 0x00000800
-#define DDFXCAPS_BLTSHRINKY 0x00001000
-#define DDFXCAPS_BLTSHRINKYN 0x00002000
-#define DDFXCAPS_BLTSTRETCHX 0x00004000
-#define DDFXCAPS_BLTSTRETCHXN 0x00008000
-#define DDFXCAPS_BLTSTRETCHY 0x00010000
-#define DDFXCAPS_BLTSTRETCHYN 0x00020000
-#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000
-#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008
-#define DDFXCAPS_OVERLAYSHRINKX 0x00080000
-#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000
-#define DDFXCAPS_OVERLAYSHRINKY 0x00200000
-#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000
-#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000
-#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000
-#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000
-#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000
-#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000
-#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000
-
-#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY
-
-/* DDCAPS.dwFXAlphaCaps */
-#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001
-#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002
-#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004
-#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008
-#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010
-#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020
-#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040
-#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080
-#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100
-#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200
-
-/* DDCAPS.dwPalCaps */
-#define DDPCAPS_4BIT 0x00000001
-#define DDPCAPS_8BITENTRIES 0x00000002
-#define DDPCAPS_8BIT 0x00000004
-#define DDPCAPS_INITIALIZE 0x00000008
-#define DDPCAPS_PRIMARYSURFACE 0x00000010
-#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020
-#define DDPCAPS_ALLOW256 0x00000040
-#define DDPCAPS_VSYNC 0x00000080
-#define DDPCAPS_1BIT 0x00000100
-#define DDPCAPS_2BIT 0x00000200
-#define DDPCAPS_ALPHA 0x00000400
-
-/* DDCAPS.dwSVCaps */
-/* the first 4 of these are now obsolete */
-#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch occured */
-#define DDSVCAPS_RESERVED1 0x00000001
-#define DDSVCAPS_RESERVED2 0x00000002
-#define DDSVCAPS_RESERVED3 0x00000004
-#define DDSVCAPS_RESERVED4 0x00000008
-#else
-#define DDSVCAPS_ENIGMA 0x00000001
-#define DDSVCAPS_FLICKER 0x00000002
-#define DDSVCAPS_REDBLUE 0x00000004
-#define DDSVCAPS_SPLIT 0x00000008
-#endif
-#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010
-
-/* BitDepths */
-#define DDBD_1 0x00004000
-#define DDBD_2 0x00002000
-#define DDBD_4 0x00001000
-#define DDBD_8 0x00000800
-#define DDBD_16 0x00000400
-#define DDBD_24 0x00000200
-#define DDBD_32 0x00000100
-
-/* DDOVERLAYFX.dwDDFX */
-#define DDOVERFX_ARITHSTRETCHY 0x00000001
-#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002
-#define DDOVERFX_MIRRORUPDOWN 0x00000004
-
-/* UpdateOverlay flags */
-#define DDOVER_ALPHADEST 0x00000001
-#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002
-#define DDOVER_ALPHADESTNEG 0x00000004
-#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008
-#define DDOVER_ALPHAEDGEBLEND 0x00000010
-#define DDOVER_ALPHASRC 0x00000020
-#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040
-#define DDOVER_ALPHASRCNEG 0x00000080
-#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100
-#define DDOVER_HIDE 0x00000200
-#define DDOVER_KEYDEST 0x00000400
-#define DDOVER_KEYDESTOVERRIDE 0x00000800
-#define DDOVER_KEYSRC 0x00001000
-#define DDOVER_KEYSRCOVERRIDE 0x00002000
-#define DDOVER_SHOW 0x00004000
-#define DDOVER_ADDDIRTYRECT 0x00008000
-#define DDOVER_REFRESHDIRTYRECTS 0x00010000
-#define DDOVER_REFRESHALL 0x00020000
-#define DDOVER_DDFX 0x00080000
-#define DDOVER_AUTOFLIP 0x00100000
-#define DDOVER_BOB 0x00200000
-#define DDOVER_OVERRIDEBOBWEAVE 0x00400000
-#define DDOVER_INTERLEAVED 0x00800000
-
-/* DDCOLORKEY.dwFlags */
-#define DDPF_ALPHAPIXELS 0x00000001
-#define DDPF_ALPHA 0x00000002
-#define DDPF_FOURCC 0x00000004
-#define DDPF_PALETTEINDEXED4 0x00000008
-#define DDPF_PALETTEINDEXEDTO8 0x00000010
-#define DDPF_PALETTEINDEXED8 0x00000020
-#define DDPF_RGB 0x00000040
-#define DDPF_COMPRESSED 0x00000080
-#define DDPF_RGBTOYUV 0x00000100
-#define DDPF_YUV 0x00000200
-#define DDPF_ZBUFFER 0x00000400
-#define DDPF_PALETTEINDEXED1 0x00000800
-#define DDPF_PALETTEINDEXED2 0x00001000
-#define DDPF_ZPIXELS 0x00002000
-#define DDPF_STENCILBUFFER 0x00004000
-#define DDPF_ALPHAPREMULT 0x00008000
-#define DDPF_LUMINANCE 0x00020000
-#define DDPF_BUMPLUMINANCE 0x00040000
-#define DDPF_BUMPDUDV 0x00080000
-
-/* SetCooperativeLevel dwFlags */
-#define DDSCL_FULLSCREEN 0x00000001
-#define DDSCL_ALLOWREBOOT 0x00000002
-#define DDSCL_NOWINDOWCHANGES 0x00000004
-#define DDSCL_NORMAL 0x00000008
-#define DDSCL_EXCLUSIVE 0x00000010
-#define DDSCL_ALLOWMODEX 0x00000040
-#define DDSCL_SETFOCUSWINDOW 0x00000080
-#define DDSCL_SETDEVICEWINDOW 0x00000100
-#define DDSCL_CREATEDEVICEWINDOW 0x00000200
-#define DDSCL_MULTITHREADED 0x00000400
-#define DDSCL_FPUSETUP 0x00000800
-#define DDSCL_FPUPRESERVE 0x00001000
-
-
-/* DDSURFACEDESC.dwFlags */
-#define DDSD_CAPS 0x00000001
-#define DDSD_HEIGHT 0x00000002
-#define DDSD_WIDTH 0x00000004
-#define DDSD_PITCH 0x00000008
-#define DDSD_BACKBUFFERCOUNT 0x00000020
-#define DDSD_ZBUFFERBITDEPTH 0x00000040
-#define DDSD_ALPHABITDEPTH 0x00000080
-#define DDSD_LPSURFACE 0x00000800
-#define DDSD_PIXELFORMAT 0x00001000
-#define DDSD_CKDESTOVERLAY 0x00002000
-#define DDSD_CKDESTBLT 0x00004000
-#define DDSD_CKSRCOVERLAY 0x00008000
-#define DDSD_CKSRCBLT 0x00010000
-#define DDSD_MIPMAPCOUNT 0x00020000
-#define DDSD_REFRESHRATE 0x00040000
-#define DDSD_LINEARSIZE 0x00080000
-#define DDSD_TEXTURESTAGE 0x00100000
-#define DDSD_FVF 0x00200000
-#define DDSD_SRCVBHANDLE 0x00400000
-#define DDSD_ALL 0x007ff9ee
-
-/* EnumSurfaces flags */
-#define DDENUMSURFACES_ALL 0x00000001
-#define DDENUMSURFACES_MATCH 0x00000002
-#define DDENUMSURFACES_NOMATCH 0x00000004
-#define DDENUMSURFACES_CANBECREATED 0x00000008
-#define DDENUMSURFACES_DOESEXIST 0x00000010
-
-/* SetDisplayMode flags */
-#define DDSDM_STANDARDVGAMODE 0x00000001
-
-/* EnumDisplayModes flags */
-#define DDEDM_REFRESHRATES 0x00000001
-#define DDEDM_STANDARDVGAMODES 0x00000002
-
-/* WaitForVerticalDisplay flags */
-
-#define DDWAITVB_BLOCKBEGIN 0x00000001
-#define DDWAITVB_BLOCKBEGINEVENT 0x00000002
-#define DDWAITVB_BLOCKEND 0x00000004
-
-typedef struct _DDSURFACEDESC
-{
- DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
- DWORD dwFlags; /* 4: determines what fields are valid*/
- DWORD dwHeight; /* 8: height of surface to be created*/
- DWORD dwWidth; /* C: width of input surface*/
- union {
- LONG lPitch; /* 10: distance to start of next line (return value only)*/
- DWORD dwLinearSize;
- } DUMMYUNIONNAME1;
- DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
- union {
- DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
- DWORD dwZBufferBitDepth;/*18: depth of Z buffer requested*/
- DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
- } DUMMYUNIONNAME2;
- DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
- DWORD dwReserved; /* 20:reserved*/
- LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
- DDCOLORKEY ddckCKDestOverlay;/* 28: CK for dest overlay use*/
- DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
- DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
- DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
- DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
- DDSCAPS ddsCaps; /* 68: direct draw surface caps */
-} DDSURFACEDESC,*LPDDSURFACEDESC;
-
-typedef struct _DDSURFACEDESC2
-{
- DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
- DWORD dwFlags; /* 4: determines what fields are valid*/
- DWORD dwHeight; /* 8: height of surface to be created*/
- DWORD dwWidth; /* C: width of input surface*/
- union {
- LONG lPitch; /*10: distance to start of next line (return value only)*/
- DWORD dwLinearSize; /*10: formless late-allocated optimized surface size */
- } DUMMYUNIONNAME1;
- DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
- union {
- DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
- DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
- DWORD dwSrcVBHandle;/* 18:source used in VB::Optimize */
- } DUMMYUNIONNAME2;
- DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
- DWORD dwReserved; /* 20:reserved*/
- LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
- union {
- DDCOLORKEY ddckCKDestOverlay; /* 28: CK for dest overlay use*/
- DWORD dwEmptyFaceColor; /* 28: color for empty cubemap faces */
- } DUMMYUNIONNAME3;
- DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
- DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
- DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
-
- union {
- DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
- DWORD dwFVF; /* 48: vertex format description of vertex buffers */
- } DUMMYUNIONNAME4;
- DDSCAPS2 ddsCaps; /* 68: DDraw surface caps */
- DWORD dwTextureStage; /* 78: stage in multitexture cascade */
-} DDSURFACEDESC2,*LPDDSURFACEDESC2;
-
-/* DDCOLORCONTROL.dwFlags */
-#define DDCOLOR_BRIGHTNESS 0x00000001
-#define DDCOLOR_CONTRAST 0x00000002
-#define DDCOLOR_HUE 0x00000004
-#define DDCOLOR_SATURATION 0x00000008
-#define DDCOLOR_SHARPNESS 0x00000010
-#define DDCOLOR_GAMMA 0x00000020
-#define DDCOLOR_COLORENABLE 0x00000040
-
-typedef struct {
- DWORD dwSize;
- DWORD dwFlags;
- LONG lBrightness;
- LONG lContrast;
- LONG lHue;
- LONG lSaturation;
- LONG lSharpness;
- LONG lGamma;
- LONG lColorEnable;
- DWORD dwReserved1;
-} DDCOLORCONTROL,*LPDDCOLORCONTROL;
-
-typedef struct {
- WORD red[256];
- WORD green[256];
- WORD blue[256];
-} DDGAMMARAMP,*LPDDGAMMARAMP;
-
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID);
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID);
-DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK)
-
-typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID);
-
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR);
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
-DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACKEX)
-
-HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
-HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
-#define DirectDrawEnumerateEx WINELIB_NAME_AW(DirectDrawEnumerateEx)
-
-/* flags for DirectDrawEnumerateEx */
-#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001
-#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002
-#define DDENUM_NONDISPLAYDEVICES 0x00000004
-
-/* flags for DirectDrawCreate or IDirectDraw::Initialize */
-#define DDCREATE_HARDWAREONLY 1L
-#define DDCREATE_EMULATIONONLY 2L
-
-typedef struct _DDBLTFX
-{
- DWORD dwSize; /* size of structure */
- DWORD dwDDFX; /* FX operations */
- DWORD dwROP; /* Win32 raster operations */
- DWORD dwDDROP; /* Raster operations new for DirectDraw */
- DWORD dwRotationAngle; /* Rotation angle for blt */
- DWORD dwZBufferOpCode; /* ZBuffer compares */
- DWORD dwZBufferLow; /* Low limit of Z buffer */
- DWORD dwZBufferHigh; /* High limit of Z buffer */
- DWORD dwZBufferBaseDest; /* Destination base value */
- DWORD dwZDestConstBitDepth; /* Bit depth used to specify Z constant for destination */
- union
- {
- DWORD dwZDestConst; /* Constant to use as Z buffer for dest */
- LPDIRECTDRAWSURFACE lpDDSZBufferDest; /* Surface to use as Z buffer for dest */
- } DUMMYUNIONNAME1;
- DWORD dwZSrcConstBitDepth; /* Bit depth used to specify Z constant for source */
- union
- {
- DWORD dwZSrcConst; /* Constant to use as Z buffer for src */
- LPDIRECTDRAWSURFACE lpDDSZBufferSrc; /* Surface to use as Z buffer for src */
- } DUMMYUNIONNAME2;
- DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
- DWORD dwAlphaEdgeBlend; /* Alpha for edge blending */
- DWORD dwReserved;
- DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
- union
- {
- DWORD dwAlphaDestConst; /* Constant to use as Alpha Channel */
- LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as Alpha Channel */
- } DUMMYUNIONNAME3;
- DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
- union
- {
- DWORD dwAlphaSrcConst; /* Constant to use as Alpha Channel */
- LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as Alpha Channel */
- } DUMMYUNIONNAME4;
- union
- {
- DWORD dwFillColor; /* color in RGB or Palettized */
- DWORD dwFillDepth; /* depth value for z-buffer */
- DWORD dwFillPixel; /* pixel val for RGBA or RGBZ */
- LPDIRECTDRAWSURFACE lpDDSPattern; /* Surface to use as pattern */
- } DUMMYUNIONNAME5;
- DDCOLORKEY ddckDestColorkey; /* DestColorkey override */
- DDCOLORKEY ddckSrcColorkey; /* SrcColorkey override */
-} DDBLTFX,*LPDDBLTFX;
-
-/* dwDDFX */
-/* arithmetic stretching along y axis */
-#define DDBLTFX_ARITHSTRETCHY 0x00000001
-/* mirror on y axis */
-#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002
-/* mirror on x axis */
-#define DDBLTFX_MIRRORUPDOWN 0x00000004
-/* do not tear */
-#define DDBLTFX_NOTEARING 0x00000008
-/* 180 degrees clockwise rotation */
-#define DDBLTFX_ROTATE180 0x00000010
-/* 270 degrees clockwise rotation */
-#define DDBLTFX_ROTATE270 0x00000020
-/* 90 degrees clockwise rotation */
-#define DDBLTFX_ROTATE90 0x00000040
-/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
-#define DDBLTFX_ZBUFFERRANGE 0x00000080
-/* add dwZBufferBaseDest to every source z value before compare */
-#define DDBLTFX_ZBUFFERBASEDEST 0x00000100
-
-typedef struct _DDOVERLAYFX
-{
- DWORD dwSize; /* size of structure */
- DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
- DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */
- DWORD dwReserved;
- DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
- union
- {
- DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */
- LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as alpha channel for dest */
- } DUMMYUNIONNAME1;
- DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
- union
- {
- DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */
- LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as alpha channel for src */
- } DUMMYUNIONNAME2;
- DDCOLORKEY dckDestColorkey; /* DestColorkey override */
- DDCOLORKEY dckSrcColorkey; /* DestColorkey override */
- DWORD dwDDFX; /* Overlay FX */
- DWORD dwFlags; /* flags */
-} DDOVERLAYFX,*LPDDOVERLAYFX;
-
-typedef struct _DDBLTBATCH
-{
- LPRECT lprDest;
- LPDIRECTDRAWSURFACE lpDDSSrc;
- LPRECT lprSrc;
- DWORD dwFlags;
- LPDDBLTFX lpDDBltFx;
-} DDBLTBATCH,*LPDDBLTBATCH;
-
-#define MAX_DDDEVICEID_STRING 512
-
-typedef struct tagDDDEVICEIDENTIFIER {
- char szDriver[MAX_DDDEVICEID_STRING];
- char szDescription[MAX_DDDEVICEID_STRING];
- LARGE_INTEGER liDriverVersion;
- DWORD dwVendorId;
- DWORD dwDeviceId;
- DWORD dwSubSysId;
- DWORD dwRevision;
- GUID guidDeviceIdentifier;
-} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
-
-typedef struct tagDDDEVICEIDENTIFIER2 {
- char szDriver[MAX_DDDEVICEID_STRING]; /* user readable driver name */
- char szDescription[MAX_DDDEVICEID_STRING]; /* user readable description */
- LARGE_INTEGER liDriverVersion; /* driver version */
- DWORD dwVendorId; /* vendor ID, zero if unknown */
- DWORD dwDeviceId; /* chipset ID, zero if unknown */
- DWORD dwSubSysId; /* board ID, zero if unknown */
- DWORD dwRevision; /* chipset version, zero if unknown */
- GUID guidDeviceIdentifier; /* unique ID for this driver/chipset combination */
- DWORD dwWHQLLevel; /* Windows Hardware Quality Lab certification level */
-} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2;
-
-/*****************************************************************************
- * IDirectDrawPalette interface
- */
-#define ICOM_INTERFACE IDirectDrawPalette
-#define IDirectDrawPalette_METHODS \
- ICOM_METHOD1(HRESULT,GetCaps, LPDWORD,lpdwCaps) \
- ICOM_METHOD4(HRESULT,GetEntries, DWORD,dwFlags, DWORD,dwBase, DWORD,dwNumEntries, LPPALETTEENTRY,lpEntries) \
- ICOM_METHOD3(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags, LPPALETTEENTRY,lpDDColorTable) \
- ICOM_METHOD4(HRESULT,SetEntries, DWORD,dwFlags, DWORD,dwStartingEntry, DWORD,dwCount, LPPALETTEENTRY,lpEntries)
-#define IDirectDrawPalette_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawPalette_METHODS
-ICOM_DEFINE(IDirectDrawPalette,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawPalette_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawPalette_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDrawPalette methods ***/
-#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL4(GetEntries,p,a,b,c,d)
-#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
-#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL4(SetEntries,p,a,b,c,d)
-
-
-/*****************************************************************************
- * IDirectDrawClipper interface
- */
-#define ICOM_INTERFACE IDirectDrawClipper
-#define IDirectDrawClipper_METHODS \
- ICOM_METHOD3(HRESULT,GetClipList, LPRECT,lpRect, LPRGNDATA,lpClipList, LPDWORD,lpdwSize) \
- ICOM_METHOD1(HRESULT,GetHWnd, HWND*,lphWnd) \
- ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,IsClipListChanged, BOOL*,lpbChanged) \
- ICOM_METHOD2(HRESULT,SetClipList, LPRGNDATA,lpClipList, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,SetHWnd, DWORD,dwFlags, HWND,hWnd)
-#define IDirectDrawClipper_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawClipper_METHODS
-ICOM_DEFINE(IDirectDrawClipper,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawClipper_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawClipper_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDrawClipper methods ***/
-#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL3(GetClipList,p,a,b,c)
-#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL1(GetHWnd,p,a)
-#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL1(IsClipListChanged,p,a)
-#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL2(SetClipList,p,a,b)
-#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL2(SetHWnd,p,a,b)
-
-
-/*****************************************************************************
- * IDirectDraw interface
- */
-#define ICOM_INTERFACE IDirectDraw
-#define IDirectDraw_METHODS \
- ICOM_METHOD (HRESULT,Compact) \
- ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
- ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
- ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE*,lplpDDSurface, IUnknown*,pUnkOuter) \
- ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE,lpDDSurface, LPDIRECTDRAWSURFACE*,lplpDupDDSurface) \
- ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \
- ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
- ICOM_METHOD (HRESULT,FlipToGDISurface) \
- ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
- ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
- ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE*,lplpGDIDDSurface) \
- ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
- ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
- ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
- ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
- ICOM_METHOD (HRESULT,RestoreDisplayMode) \
- ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
- ICOM_METHOD3(HRESULT,SetDisplayMode, DWORD,, DWORD,, DWORD,) \
- ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent)
-#define IDirectDraw_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDraw_METHODS
-ICOM_DEFINE(IDirectDraw,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDraw_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDraw_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDraw methods ***/
-#define IDirectDraw_Compact(p) ICOM_CALL (Compact,p)
-#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
-#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
-#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
-#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
-#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
-#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
-#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
-#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
-#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
-#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
-#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
-#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
-#define IDirectDraw_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
-#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
-#define IDirectDraw_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
-#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
-#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
-#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL3(SetDisplayMode,p,a,b,c)
-#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
-
-
-/* flags for Lock() */
-#define DDLOCK_SURFACEMEMORYPTR 0x00000000
-#define DDLOCK_WAIT 0x00000001
-#define DDLOCK_EVENT 0x00000002
-#define DDLOCK_READONLY 0x00000010
-#define DDLOCK_WRITEONLY 0x00000020
-#define DDLOCK_NOSYSLOCK 0x00000800
-
-
-/*****************************************************************************
- * IDirectDraw2 interface
- */
-/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of
- * arguments of SetDisplayMode has changed !
- */
-#define ICOM_INTERFACE IDirectDraw2
-#define IDirectDraw2_METHODS \
-/*0c*/ ICOM_METHOD (HRESULT,Compact) \
-/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
-/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
-/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2*,lplpDDSurface, IUnknown*,pUnkOuter) \
-/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE2,lpDDSurface, LPDIRECTDRAWSURFACE2*,lplpDupDDSurface) \
-/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \
-/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
-/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
-/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
-/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \
-/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
-/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE2*,lplpGDIDDSurface) \
-/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
-/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
-/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
-/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
-/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
-/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
-/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
-/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
- /* added in v2 */ \
-/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree)
-#define IDirectDraw2_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDraw2_METHODS
-ICOM_DEFINE(IDirectDraw2,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDraw2_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDraw2_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDraw methods ***/
-#define IDirectDraw2_Compact(p) ICOM_CALL (Compact,p)
-#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
-#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
-#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
-#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
-#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
-#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
-#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
-#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
-#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
-#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
-#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
-#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
-#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
-#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
-#define IDirectDraw2_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
-#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
-#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
-#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
-#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
-/*** IDirectDraw2 methods ***/
-#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
-
-
-/*****************************************************************************
- * IDirectDraw4 interface
- */
-#define ICOM_INTERFACE IDirectDraw4
-#define IDirectDraw4_METHODS \
-/*0c*/ ICOM_METHOD (HRESULT,Compact) \
-/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
-/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
-/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4*,lplpDDSurface, IUnknown*,pUnkOuter) \
-/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE4,lpDDSurface, LPDIRECTDRAWSURFACE4*,lplpDupDDSurface) \
-/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \
-/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK2,lpEnumSurfacesCallback) \
-/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
-/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
-/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
-/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
-/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE4*,lplpGDIDDSurface) \
-/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
-/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
-/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
-/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
-/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
-/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
-/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
-/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
- /* added in v2 */ \
-/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \
- /* added in v4 */ \
- ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE4*,) \
- ICOM_METHOD (HRESULT,RestoreAllSurfaces) \
- ICOM_METHOD (HRESULT,TestCooperativeLevel) \
- ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER,, DWORD,)
-#define IDirectDraw4_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDraw4_METHODS
-ICOM_DEFINE(IDirectDraw4,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDraw4_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDraw4_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDraw methods ***/
-#define IDirectDraw4_Compact(p) ICOM_CALL (Compact,p)
-#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
-#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
-#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
-#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
-#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
-#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
-#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
-#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
-#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
-#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
-#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
-#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
-#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
-#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
-#define IDirectDraw4_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
-#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
-#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
-#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
-#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
-/*** IDirectDraw2 methods ***/
-#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
-/*** IDirectDraw4 methods ***/
-#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b)
-#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL (RestoreAllSurfaces,p)
-#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p)
-#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b)
-
-
-/*****************************************************************************
- * IDirectDraw7 interface
- */
-/* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented
- * as not interchangeable with earlier DirectDraw interfaces.
- */
-#define ICOM_INTERFACE IDirectDraw7
-#define IDirectDraw7_METHODS \
-/*0c*/ ICOM_METHOD (HRESULT,Compact) \
-/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
-/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
-/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7*,lplpDDSurface, IUnknown*,pUnkOuter) \
-/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE7,lpDDSurface, LPDIRECTDRAWSURFACE7*,lplpDupDDSurface) \
-/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \
-/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \
-/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
-/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
-/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
-/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
-/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE7*,lplpGDIDDSurface) \
-/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
-/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
-/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
-/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
-/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
-/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
-/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
-/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
- /* added in v2 */ \
-/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \
- /* added in v4 */ \
-/*60*/ ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE7*,) \
-/*64*/ ICOM_METHOD (HRESULT,RestoreAllSurfaces) \
-/*68*/ ICOM_METHOD (HRESULT,TestCooperativeLevel) \
-/*6c*/ ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER2,, DWORD,) \
- /* added in v7 */ \
-/*70*/ ICOM_METHOD3(HRESULT,StartModeTest, LPSIZE,, DWORD,, DWORD,) \
-/*74*/ ICOM_METHOD2(HRESULT,EvaluateMode, DWORD,, DWORD *,)
-#define IDirectDraw7_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDraw7_METHODS
-ICOM_DEFINE(IDirectDraw7,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDraw7_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDraw7_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDraw methods ***/
-#define IDirectDraw7_Compact(p) ICOM_CALL (Compact,p)
-#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
-#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
-#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
-#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
-#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
-#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
-#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
-#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
-#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
-#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
-#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
-#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
-#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
-#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
-#define IDirectDraw7_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
-#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
-#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
-#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
-#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
-/*** added in IDirectDraw2 ***/
-#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
-/*** added in IDirectDraw4 ***/
-#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b)
-#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL (RestoreAllSurfaces,p)
-#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p)
-#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b)
-/*** added in IDirectDraw 7 ***/
-#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL3(StartModeTest,p,a,b,c)
-#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL2(EvaluateMode,p,a,b)
-
-
-/*****************************************************************************
- * IDirectDrawSurface interface
- */
-#define ICOM_INTERFACE IDirectDrawSurface
-#define IDirectDrawSurface_METHODS \
-/*0c*/ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \
-/*10*/ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
-/*14*/ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
-/*18*/ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
-/*1c*/ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
-/*20*/ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \
-/*24*/ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
-/*28*/ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
-/*2c*/ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
-/*30*/ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE*,lplpDDAttachedSurface) \
-/*34*/ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
-/*38*/ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
-/*3c*/ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
-/*40*/ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
-/*44*/ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
-/*48*/ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
-/*4c*/ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
-/*50*/ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
-/*54*/ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
-/*58*/ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
-/*5c*/ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
-/*60*/ ICOM_METHOD (HRESULT,IsLost) \
-/*64*/ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
-/*68*/ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
-/*6c*/ ICOM_METHOD (HRESULT,Restore) \
-/*70*/ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
-/*74*/ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
-/*78*/ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
-/*7c*/ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
-/*80*/ ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
-/*84*/ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
-/*88*/ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
-/*8c*/ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSReference)
-#define IDirectDrawSurface_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawSurface_METHODS
-ICOM_DEFINE(IDirectDrawSurface,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawSurface_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawSurface_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDrawSurface methods ***/
-#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
-#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
-#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
-#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
-#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
-#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
-#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
-#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
-#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
-#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
-#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
-#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
-#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
-#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
-#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
-#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
-#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
-#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
-#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
-#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawSurface_IsLost(p) ICOM_CALL (IsLost,p)
-#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
-#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
-#define IDirectDrawSurface_Restore(p) ICOM_CALL (Restore,p)
-#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
-#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
-#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
-#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
-#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
-#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
-#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
-#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
-
-
-/*****************************************************************************
- * IDirectDrawSurface2 interface
- */
-/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters
- * have been converted to LPDIRECTDRAWSURFACE2.
- */
-#define ICOM_INTERFACE IDirectDrawSurface2
-#define IDirectDrawSurface2_METHODS \
- ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \
- ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
- ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
- ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
- ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
- ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \
- ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
- ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
- ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE2,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE2*,lplpDDAttachedSurface) \
- ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
- ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
- ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
- ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
- ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
- ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
- ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD (HRESULT,IsLost) \
- ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
- ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
- ICOM_METHOD (HRESULT,Restore) \
- ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
- ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
- ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
- ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
- ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE2,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
- ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSReference) \
- /* added in v2 */ \
- ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
- ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags)
-#define IDirectDrawSurface2_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawSurface2_METHODS
-ICOM_DEFINE(IDirectDrawSurface2,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawSurface2_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawSurface2_Release(p) ICOM_CALL (Release,p)
-/*** IDirectDrawSurface methods (almost) ***/
-#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
-#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
-#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
-#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
-#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
-#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
-#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
-#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
-#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
-#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
-#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
-#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
-#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
-#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
-#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
-#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
-#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
-#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
-#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
-#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawSurface2_IsLost(p) ICOM_CALL (IsLost,p)
-#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
-#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
-#define IDirectDrawSurface2_Restore(p) ICOM_CALL (Restore,p)
-#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
-#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
-#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
-#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
-#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
-#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
-#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
-#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
-#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
-#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
-
-
-/*****************************************************************************
- * IDirectDrawSurface3 interface
- */
-/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters
- * have been converted to LPDIRECTDRAWSURFACE3.
- */
-#define ICOM_INTERFACE IDirectDrawSurface3
-#define IDirectDrawSurface3_METHODS \
- ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \
- ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
- ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
- ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
- ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
- ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \
- ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
- ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
- ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE3,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE3*,lplpDDAttachedSurface) \
- ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
- ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
- ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
- ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
- ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
- ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
- ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD (HRESULT,IsLost) \
- ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
- ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
- ICOM_METHOD (HRESULT,Restore) \
- ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
- ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
- ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
- ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
- ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE3,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
- ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSReference) \
- /* added in v2 */ \
- ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
- ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
- /* added in v3 */ \
- ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags)
-#define IDirectDrawSurface3_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawSurface3_METHODS
-ICOM_DEFINE(IDirectDrawSurface3,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawSurface3_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawSurface3_Release(p) ICOM_CALL (Release,p)
-/*** IDirectDrawSurface methods (almost) ***/
-#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
-#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
-#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
-#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
-#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
-#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
-#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
-#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
-#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
-#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
-#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
-#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
-#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
-#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
-#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
-#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
-#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
-#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
-#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
-#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawSurface3_IsLost(p) ICOM_CALL (IsLost,p)
-#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
-#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
-#define IDirectDrawSurface3_Restore(p) ICOM_CALL (Restore,p)
-#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
-#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
-#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
-#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
-#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
-#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
-#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
-#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
-#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
-#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
-
-
-/*****************************************************************************
- * IDirectDrawSurface4 interface
- */
-/* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2.
- */
-#define ICOM_INTERFACE IDirectDrawSurface4
-#define IDirectDrawSurface4_METHODS \
- ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \
- ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
- ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
- ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
- ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
- ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \
- ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
- ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
- ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE4,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE4*,lplpDDAttachedSurface) \
- ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \
- ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
- ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
- ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
- ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
- ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
- ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
- ICOM_METHOD (HRESULT,IsLost) \
- ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
- ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
- ICOM_METHOD (HRESULT,Restore) \
- ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
- ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
- ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
- ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \
- ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE4,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
- ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSReference) \
- /* added in v2 */ \
- ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
- ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
- /* added in v3 */ \
- ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags) \
- /* added in v4 */ \
- ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \
- ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \
- ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \
- ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \
- ICOM_METHOD (HRESULT,ChangeUniquenessValue)
-#define IDirectDrawSurface4_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawSurface4_METHODS
-ICOM_DEFINE(IDirectDrawSurface4,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawSurface4_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawSurface4_Release(p) ICOM_CALL (Release,p)
-/*** IDirectDrawSurface (almost) methods ***/
-#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
-#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
-#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
-#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
-#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
-#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
-#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
-#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
-#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
-#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
-#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
-#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
-#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
-#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
-#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
-#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
-#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
-#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
-#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
-#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawSurface4_IsLost(p) ICOM_CALL (IsLost,p)
-#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
-#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
-#define IDirectDrawSurface4_Restore(p) ICOM_CALL (Restore,p)
-#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
-#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
-#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
-#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
-#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
-#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
-#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
-#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
-#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
-#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
-/*** IDirectDrawSurface4 methods ***/
-#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d)
-#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c)
-#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a)
-#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a)
-#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p)
-
-
-/*****************************************************************************
- * IDirectDrawSurface7 interface
- */
-#define ICOM_INTERFACE IDirectDrawSurface7
-#define IDirectDrawSurface7_METHODS \
- ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \
- ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
- ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
- ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
- ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
- ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \
- ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \
- ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpfnCallback) \
- ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE7,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE7*,lplpDDAttachedSurface) \
- ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \
- ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
- ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
- ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
- ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
- ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
- ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
- ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
- ICOM_METHOD (HRESULT,IsLost) \
- ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC2,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
- ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
- ICOM_METHOD (HRESULT,Restore) \
- ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
- ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
- ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
- ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
- ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \
- ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE7,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
- ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
- ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSReference) \
- /* added in v2 */ \
- ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
- ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
- ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
- /* added in v3 */ \
- ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC2,lpDDSD, DWORD,dwFlags) \
- /* added in v4 */ \
- ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \
- ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \
- ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \
- ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \
- ICOM_METHOD (HRESULT,ChangeUniquenessValue) \
- /* added in v7 */ \
- ICOM_METHOD1(HRESULT,SetPriority, DWORD,prio) \
- ICOM_METHOD1(HRESULT,GetPriority, LPDWORD,prio) \
- ICOM_METHOD1(HRESULT,SetLOD, DWORD,lod) \
- ICOM_METHOD1(HRESULT,GetLOD, LPDWORD,lod)
-#define IDirectDrawSurface7_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawSurface7_METHODS
-ICOM_DEFINE(IDirectDrawSurface7,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawSurface7_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawSurface7_Release(p) ICOM_CALL (Release,p)
-/*** IDirectDrawSurface (almost) methods ***/
-#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
-#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
-#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
-#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
-#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
-#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
-#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
-#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
-#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
-#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
-#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
-#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
-#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
-#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
-#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
-#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
-#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
-#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
-#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
-#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
-#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
-#define IDirectDrawSurface7_IsLost(p) ICOM_CALL (IsLost,p)
-#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
-#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
-#define IDirectDrawSurface7_Restore(p) ICOM_CALL (Restore,p)
-#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
-#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
-#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
-#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
-#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
-#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
-#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
-#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
-#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
-#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
-/*** IDirectDrawSurface4 methods ***/
-#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d)
-#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c)
-#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a)
-#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a)
-#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p)
-/*** IDirectDrawSurface7 methods ***/
-#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL1(SetPriority,p,a)
-#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL1(GetPriority,p,a)
-#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL1(SetLOD,p,a)
-#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL1(GetLOD,p,a)
-
-/*****************************************************************************
- * IDirectDrawColorControl interface
- */
-#define ICOM_INTERFACE IDirectDrawColorControl
-#define IDirectDrawColorControl_METHODS \
- ICOM_METHOD1(HRESULT,GetColorControls, LPDDCOLORCONTROL,lpColorControl) \
- ICOM_METHOD1(HRESULT,SetColorControls, LPDDCOLORCONTROL,lpColorControl)
-#define IDirectDrawColorControl_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawColorControl_METHODS
-ICOM_DEFINE(IDirectDrawColorControl,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawColorControl_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawColorControl_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDrawColorControl methods ***/
-#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL(GetColorControls,p,a)
-#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL(SetColorControls,p,a)
-
-/*****************************************************************************
- * IDirectDrawGammaControl interface
- */
-#define ICOM_INTERFACE IDirectDrawGammaControl
-#define IDirectDrawGammaControl_METHODS \
- ICOM_METHOD2(HRESULT,GetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp) \
- ICOM_METHOD2(HRESULT,SetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp)
-#define IDirectDrawGammaControl_IMETHODS \
- IUnknown_IMETHODS \
- IDirectDrawGammaControl_METHODS
-ICOM_DEFINE(IDirectDrawGammaControl,IUnknown)
-#undef ICOM_INTERFACE
-
- /*** IUnknown methods ***/
-#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL (AddRef,p)
-#define IDirectDrawGammaControl_Release(p) ICOM_CALL (Release,p)
- /*** IDirectDrawGammaControl methods ***/
-#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL(GetGammaRamp,p,a,b)
-#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL(SetGammaRamp,p,a,b)
-
-
-HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN);
-HRESULT WINAPI DirectDrawCreateEx(LPGUID,LPVOID*,REFIID,LPUNKNOWN);
-HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA,LPVOID);
-HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID);
-#define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate)
-HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,LPUNKNOWN);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif /* __WINE_DDRAW_H */
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
deleted file mode 100644
index 6ecf5ada0..000000000
--- a/hw/xwin/win.h
+++ /dev/null
@@ -1,1537 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- * Kensuke Matsuzaki
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.38 2003/10/08 11:13:02 eich Exp $ */
-
-#ifndef _WIN_H_
-#define _WIN_H_
-
-
-#ifndef NO
-#define NO 0
-#endif
-#ifndef YES
-#define YES 1
-#endif
-
-/*
- * Build toggles for experimental features
- */
-#define WIN_NATIVE_GDI_SUPPORT YES
-#define WIN_LAYER_SUPPORT NO
-#define WIN_NEW_KEYBOARD_SUPPORT NO
-#define WIN_EMULATE_PSEUDO_SUPPORT YES
-#define WIN_UPDATE_STATS NO
-
-/* Turn debug messages on or off */
-#define CYGDEBUG NO
-
-#define NEED_EVENTS
-
-#define WIN_DEFAULT_BPP 0
-#define WIN_DEFAULT_WHITEPIXEL 255
-#define WIN_DEFAULT_BLACKPIXEL 0
-#define WIN_DEFAULT_LINEBIAS 0
-#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */
-#define WIN_DEFAULT_DPI 75
-#define WIN_DEFAULT_REFRESH 0
-#define WIN_DEFAULT_WIN_KILL TRUE
-#define WIN_DEFAULT_UNIX_KILL FALSE
-#define WIN_DEFAULT_CLIP_UPDATES_NBOXES 0
-#define WIN_DEFAULT_EMULATE_PSEUDO FALSE
-#define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE
-
-#define WIN_DIB_MAXIMUM_SIZE 0x08000000 /* 16 MB on Windows 95, 98, Me */
-#define WIN_DIB_MAXIMUM_SIZE_MB (WIN_DIB_MAXIMUM_SIZE / 8 / 1024 / 1024)
-
-/*
- * Windows only supports 256 color palettes
- */
-#define WIN_NUM_PALETTE_ENTRIES 256
-
-/*
- * Number of times to call Restore in an attempt to restore the primary surface
- */
-#define WIN_REGAIN_SURFACE_RETRIES 1
-
-/*
- * Build a supported display depths mask by shifting one to the left
- * by the number of bits in the supported depth.
- */
-#define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \
- | (1 << (16 - 1)) | (1 << (15 - 1)) \
- | (1 << ( 8 - 1)))
-#define WIN_CHECK_DEPTH YES
-
-/*
- * Timer IDs for WM_TIMER
- */
-#define WIN_E3B_TIMER_ID 1
-#define WIN_POLLING_MOUSE_TIMER_ID 2
-
-
-#define WIN_E3B_OFF -1
-#define WIN_FD_INVALID -1
-
-#define WIN_SERVER_NONE 0x0L /* 0 */
-#define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */
-#define WIN_SERVER_SHADOW_DD 0x2L /* 2 */
-#define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */
-#define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */
-#define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */
-
-#define AltMapIndex Mod1MapIndex
-#define NumLockMapIndex Mod2MapIndex
-#define AltLangMapIndex Mod3MapIndex
-#define KanaMapIndex Mod4MapIndex
-#define ScrollLockMapIndex Mod5MapIndex
-
-#define WIN_MOD_LALT 0x00000001
-#define WIN_MOD_RALT 0x00000002
-#define WIN_MOD_LCONTROL 0x00000004
-#define WIN_MOD_RCONTROL 0x00000008
-
-#define WIN_24BPP_MASK_RED 0x00FF0000
-#define WIN_24BPP_MASK_GREEN 0x0000FF00
-#define WIN_24BPP_MASK_BLUE 0x000000FF
-
-#define WIN_MAX_KEYS_PER_KEY 4
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include <X11/XWDFile.h>
-
-#ifdef HAS_MMAP
-#include <sys/mman.h>
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif /* MAP_FILE */
-#endif /* HAS_MMAP */
-
-#include "X.h"
-#include "Xproto.h"
-#include "Xos.h"
-#include "Xprotostr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "pixmap.h"
-#include "region.h"
-#include "gcstruct.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "miscstruct.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "micmap.h"
-#include "migc.h"
-#include "mifillarc.h"
-#include "mifpoly.h"
-#include "mibstore.h"
-#include "input.h"
-#include "mipointer.h"
-#include "keysym.h"
-#include "mibstore.h"
-#include "micoord.h"
-#include "dix.h"
-#include "miline.h"
-#include "shadow.h"
-#include "fb.h"
-#include "layer.h"
-
-#ifdef RENDER
-#include "mipict.h"
-#include "picturestr.h"
-#endif
-
-#ifdef RANDR
-#include "randrstr.h"
-#endif
-
-/*
- * Windows headers
- */
-#include "winms.h"
-
-
-/*
- * Define Windows constants
- */
-
-#define WM_TRAYICON (WM_USER + 1000)
-#define WM_INIT_SYS_MENU (WM_USER + 1001)
-#define WM_GIVEUP (WM_USER + 1002)
-
-
-/*
- * Multi-Window Window Manager header
- */
-
-#include "winwindow.h"
-
-
-/* Cygwin's winuser.h does not define VK_KANA as of 28Mar2001 */
-/* NOTE: Cygwin's winuser.h was fixed shortly after 28Mar2001. */
-#ifndef VK_KANA
-#define VK_KANA 15
-#endif
-
-
-/*
- * Debugging macros
- */
-
-#if CYGDEBUG
-#define DEBUG_MSG(str,...) \
-if (fDebugProcMsg) \
-{ \
- char *pszTemp; \
- int iLength; \
- \
- iLength = sprintf (NULL, str, ##__VA_ARGS__); \
- \
- pszTemp = malloc (iLength + 1); \
- \
- sprintf (pszTemp, str, ##__VA_ARGS__); \
- \
- MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
- \
- free (pszTemp); \
-}
-#else
-#define DEBUG_MSG(str,...)
-#endif
-
-#if CYGDEBUG
-#define DEBUG_FN_NAME(str) PTSTR szFunctionName = str
-#else
-#define DEBUG_FN_NAME(str)
-#endif
-
-#if CYGDEBUG || YES
-#define DEBUGVARS BOOL fDebugProcMsg = FALSE
-#else
-#define DEBUGVARS
-#endif
-
-#if CYGDEBUG || YES
-#define DEBUGPROC_MSG fDebugProcMsg = TRUE
-#else
-#define DEBUGPROC_MSG
-#endif
-
-/* We use xor this macro for detecting toggle key state changes */
-#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b)))
-
-
-/*
- * Typedefs for engine dependent function pointers
- */
-
-typedef Bool (*winAllocateFBProcPtr)(ScreenPtr);
-
-typedef void (*winShadowUpdateProcPtr)(ScreenPtr, shadowBufPtr);
-
-typedef Bool (*winCloseScreenProcPtr)(int, ScreenPtr);
-
-typedef Bool (*winInitVisualsProcPtr)(ScreenPtr);
-
-typedef Bool (*winAdjustVideoModeProcPtr)(ScreenPtr);
-
-typedef Bool (*winCreateBoundingWindowProcPtr)(ScreenPtr);
-
-typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **);
-
-typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr);
-
-typedef Bool (*winActivateAppProcPtr)(ScreenPtr);
-
-typedef Bool (*winRedrawScreenProcPtr)(ScreenPtr pScreen);
-
-typedef Bool (*winRealizeInstalledPaletteProcPtr)(ScreenPtr pScreen);
-
-typedef Bool (*winInstallColormapProcPtr)(ColormapPtr pColormap);
-
-typedef Bool (*winStoreColorsProcPtr)(ColormapPtr pmap,
- int ndef, xColorItem *pdefs);
-
-typedef Bool (*winCreateColormapProcPtr)(ColormapPtr pColormap);
-
-typedef Bool (*winDestroyColormapProcPtr)(ColormapPtr pColormap);
-
-typedef Bool (*winHotKeyAltTabProcPtr)(ScreenPtr);
-
-typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr);
-
-typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
-
-
-/*
- * GC (graphics context) privates
- */
-
-typedef struct
-{
- HDC hdc;
- HDC hdcMem;
-} winPrivGCRec, *winPrivGCPtr;
-
-
-/*
- * Pixmap privates
- */
-
-typedef struct
-{
- HDC hdcSelected;
- HBITMAP hBitmap;
- BYTE *pbBits;
- DWORD dwScanlineBytes;
- BITMAPINFOHEADER *pbmih;
-} winPrivPixmapRec, *winPrivPixmapPtr;
-
-
-/*
- * Colormap privates
- */
-
-typedef struct
-{
- HPALETTE hPalette;
- LPDIRECTDRAWPALETTE lpDDPalette;
- RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
- PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES];
-} winPrivCmapRec, *winPrivCmapPtr;
-
-
-#if WIN_NEW_KEYBOARD_SUPPORT
-/*
- * Keyboard event structure
- */
-
-typedef struct
-{
- DWORD dwXKeycodes[WIN_MAX_KEYS_PER_KEY];
- DWORD dwReleaseModifiers;
-} winKeyEventsRec, *winKeyEventsPtr;
-
-#endif /* WIN_NEW_KEYBOARD_SUPPORT */
-
-/*
- * Screen information structure that we need before privates are available
- * in the server startup sequence.
- */
-
-typedef struct
-{
- ScreenPtr pScreen;
-
- /* Did the user specify a height and width? */
- Bool fUserGaveHeightAndWidth;
-
- DWORD dwScreen;
- DWORD dwUserWidth;
- DWORD dwUserHeight;
- DWORD dwWidth;
- DWORD dwHeight;
- DWORD dwWidth_mm;
- DWORD dwHeight_mm;
- DWORD dwPaddedWidth;
-
- /*
- * dwStride is the number of whole pixels that occupy a scanline,
- * including those pixels that are not displayed. This is basically
- * a rounding up of the width.
- */
- DWORD dwStride;
-
- /* Offset of the screen in the window when using scrollbars */
- DWORD dwXOffset;
- DWORD dwYOffset;
-
- DWORD dwBPP;
- DWORD dwDepth;
- DWORD dwRefreshRate;
- char *pfb;
- XWDColor *pXWDCmap;
- XWDFileHeader *pXWDHeader;
- DWORD dwEngine;
- DWORD dwEnginePreferred;
- DWORD dwClipUpdatesNBoxes;
- Bool fEmulatePseudo;
- Bool fFullScreen;
- Bool fDecoration;
- Bool fRootless;
- Bool fMultiWindow;
- Bool fMultipleMonitors;
- Bool fClipboard;
- Bool fLessPointer;
- Bool fScrollbars;
- Bool fNoTrayIcon;
- int iE3BTimeout;
- /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
- Bool fUseWinKillKey;
- Bool fUseUnixKillKey;
- Bool fIgnoreInput;
-
- /* Did the user explicitly set this screen? */
- Bool fExplicitScreen;
-} winScreenInfo, *winScreenInfoPtr;
-
-
-/*
- * Screen privates
- */
-
-typedef struct _winPrivScreenRec
-{
- winScreenInfoPtr pScreenInfo;
-
- Bool fEnabled;
- Bool fClosed;
- Bool fActive;
- Bool fBadDepth;
-
- int iDeltaZ;
-
- CloseScreenProcPtr CloseScreen;
-
- DWORD dwRedMask;
- DWORD dwGreenMask;
- DWORD dwBlueMask;
- DWORD dwBitsPerRGB;
-
- DWORD dwModeKeyStates;
-
- /* Handle to icons that must be freed */
- HICON hiconNotifyIcon;
-
- /* Clipboard support */
- pthread_t ptClipboardProc;
-
-#if 0
- HWND hwndNextViewer;
- void *display;
- int window;
-#endif
-
- /* Last width, height, and depth of the Windows display */
- DWORD dwLastWindowsWidth;
- DWORD dwLastWindowsHeight;
- DWORD dwLastWindowsBitsPixel;
-
- /* Layer support */
-#if WIN_LAYER_SUPPORT
- DWORD dwLayerKind;
- LayerPtr pLayer;
-#endif
-
- /* Palette management */
- ColormapPtr pcmapInstalled;
-
- /* Pointer to the root visual so we only have to look it up once */
- VisualPtr pRootVisual;
-
- /* 3 button emulation variables */
- int iE3BCachedPress;
- Bool fE3BFakeButton2Sent;
-
- /* Privates used by shadow fb GDI server */
- HBITMAP hbmpShadow;
- HDC hdcScreen;
- HDC hdcShadow;
- HWND hwndScreen;
-
- /* Privates used by shadow fb and primary fb DirectDraw servers */
- LPDIRECTDRAW pdd;
- LPDIRECTDRAWSURFACE2 pddsPrimary;
- LPDIRECTDRAW2 pdd2;
-
- /* Privates used by shadow fb DirectDraw server */
- LPDIRECTDRAWSURFACE2 pddsShadow;
- LPDDSURFACEDESC pddsdShadow;
-
- /* Privates used by primary fb DirectDraw server */
- LPDIRECTDRAWSURFACE2 pddsOffscreen;
- LPDDSURFACEDESC pddsdOffscreen;
- LPDDSURFACEDESC pddsdPrimary;
-
- /* Privates used by shadow fb DirectDraw Nonlocking server */
- LPDIRECTDRAW4 pdd4;
- LPDIRECTDRAWSURFACE4 pddsShadow4;
- LPDIRECTDRAWSURFACE4 pddsPrimary4;
-
- /* Privates used by both shadow fb DirectDraw servers */
- LPDIRECTDRAWCLIPPER pddcPrimary;
-
- /* Privates used by multi-window server */
- pthread_t ptWMProc;
- pthread_t ptXMsgProc;
- void *pWMInfo;
- Bool fWindowOrderChanged;
- Bool fRestacking;
- Bool fRootWindowShown;
-
- /* Privates used for any module running in a seperate thread */
- pthread_mutex_t pmServerStarted;
- Bool fServerStarted;
-
- /* Engine specific functions */
- winAllocateFBProcPtr pwinAllocateFB;
- winShadowUpdateProcPtr pwinShadowUpdate;
- winCloseScreenProcPtr pwinCloseScreen;
- winInitVisualsProcPtr pwinInitVisuals;
- winAdjustVideoModeProcPtr pwinAdjustVideoMode;
- winCreateBoundingWindowProcPtr pwinCreateBoundingWindow;
- winFinishScreenInitProcPtr pwinFinishScreenInit;
- winBltExposedRegionsProcPtr pwinBltExposedRegions;
- winActivateAppProcPtr pwinActivateApp;
- winRedrawScreenProcPtr pwinRedrawScreen;
- winRealizeInstalledPaletteProcPtr pwinRealizeInstalledPalette;
- winInstallColormapProcPtr pwinInstallColormap;
- winStoreColorsProcPtr pwinStoreColors;
- winCreateColormapProcPtr pwinCreateColormap;
- winDestroyColormapProcPtr pwinDestroyColormap;
- winHotKeyAltTabProcPtr pwinHotKeyAltTab;
- winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
- winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
-
- /* Window Procedures for Rootless mode */
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- ValidateTreeProcPtr ValidateTree;
- PostValidateTreeProcPtr PostValidateTree;
- WindowExposuresProcPtr WindowExposures;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- ClipNotifyProcPtr ClipNotify;
- RestackWindowProcPtr RestackWindow;
- ReparentWindowProcPtr ReparentWindow;
-#ifdef SHAPE
- SetShapeProcPtr SetShape;
-#endif
-} winPrivScreenRec;
-
-
-typedef struct {
- pointer value;
- XID id;
-} WindowIDPairRec, *WindowIDPairPtr;
-
-
-/*
- * Extern declares for general global variables
- */
-
-extern winScreenInfo g_ScreenInfo[];
-extern miPointerScreenFuncRec g_winPointerCursorFuncs;
-extern DWORD g_dwEvents;
-extern int g_fdMessageQueue;
-extern int g_iScreenPrivateIndex;
-extern int g_iCmapPrivateIndex;
-extern int g_iGCPrivateIndex;
-extern int g_iPixmapPrivateIndex;
-extern int g_iWindowPrivateIndex;
-extern unsigned long g_ulServerGeneration;
-extern CARD32 g_c32LastInputEventTime;
-extern DWORD g_dwEnginesSupported;
-extern HINSTANCE g_hInstance;
-extern HWND g_hDlgDepthChange;
-extern HWND g_hDlgExit;
-extern int g_copyROP[];
-extern int g_patternROP[];
-extern const char * g_pszQueryHost;
-
-
-/*
- * Extern declares for dynamically loaded libraries and function pointers
- */
-
-extern HMODULE g_hmodDirectDraw;
-extern FARPROC g_fpDirectDrawCreate;
-extern FARPROC g_fpDirectDrawCreateClipper;
-
-extern HMODULE g_hmodCommonControls;
-extern FARPROC g_fpTrackMouseEvent;
-
-
-/*
- * Screen privates macros
- */
-
-#define winGetScreenPriv(pScreen) \
- ((winPrivScreenPtr) (pScreen)->devPrivates[g_iScreenPrivateIndex].ptr)
-
-#define winSetScreenPriv(pScreen,v) \
- ((pScreen)->devPrivates[g_iScreenPrivateIndex].ptr = (pointer) v)
-
-#define winScreenPriv(pScreen) \
- winPrivScreenPtr pScreenPriv = winGetScreenPriv(pScreen)
-
-
-/*
- * Colormap privates macros
- */
-
-#define winGetCmapPriv(pCmap) \
- ((winPrivCmapPtr) (pCmap)->devPrivates[g_iCmapPrivateIndex].ptr)
-
-#define winSetCmapPriv(pCmap,v) \
- ((pCmap)->devPrivates[g_iCmapPrivateIndex].ptr = (pointer) v)
-
-#define winCmapPriv(pCmap) \
- winPrivCmapPtr pCmapPriv = winGetCmapPriv(pCmap)
-
-
-/*
- * GC privates macros
- */
-
-#define winGetGCPriv(pGC) \
- ((winPrivGCPtr) (pGC)->devPrivates[g_iGCPrivateIndex].ptr)
-
-#define winSetGCPriv(pGC,v) \
- ((pGC)->devPrivates[g_iGCPrivateIndex].ptr = (pointer) v)
-
-#define winGCPriv(pGC) \
- winPrivGCPtr pGCPriv = winGetGCPriv(pGC)
-
-
-/*
- * Pixmap privates macros
- */
-
-#define winGetPixmapPriv(pPixmap) \
- ((winPrivPixmapPtr) (pPixmap)->devPrivates[g_iPixmapPrivateIndex].ptr)
-
-#define winSetPixmapPriv(pPixmap,v) \
- ((pPixmap)->devPrivates[g_iPixmapPrivateIndex].ptr = (pointer) v)
-
-#define winPixmapPriv(pPixmap) \
- winPrivPixmapPtr pPixmapPriv = winGetPixmapPriv(pPixmap)
-
-
-/*
- * Window privates macros
- */
-
-#define winGetWindowPriv(pWin) \
- ((winPrivWinPtr) (pWin)->devPrivates[g_iWindowPrivateIndex].ptr)
-
-#define winSetWindowPriv(pWin,v) \
- ((pWin)->devPrivates[g_iWindowPrivateIndex].ptr = (pointer) v)
-
-#define winWindowPriv(pWin) \
- winPrivWinPtr pWinPriv = winGetWindowPriv(pWin)
-
-
-/*
- * FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers.
- * Has been fixed after May 05, 2001. Remove this section after the
- * fixed headers are in distribution.
- */
-
-#ifndef GET_WHEEL_DELTA_WPARAM
-#define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
-#endif /* GET_WHEEL_DELTA_WPARAM */
-
-
-/*
- * FIXME: Windows shell API defines. Should be in w32api shellapi.h
- */
-
-#ifndef ABS_AUTOHIDE
-#define ABS_AUTOHIDE 0x00000001
-#endif
-#ifndef ABS_ALWAYSONTOP
-#define ABS_ALWAYSONTOP 0x00000002
-#endif
-
-
-/*
- * BEGIN DDX and DIX Function Prototypes
- */
-
-
-/*
- * winallpriv.c
- */
-
-Bool
-winAllocatePrivates (ScreenPtr pScreen);
-
-Bool
-winInitCmapPrivates (ColormapPtr pCmap);
-
-Bool
-winAllocateCmapPrivates (ColormapPtr pCmap);
-
-
-/*
- * winblock.c
- */
-
-void
-winBlockHandler (int nScreen,
- pointer pBlockData,
- pointer pTimeout,
- pointer pReadMask);
-
-
-/*
- * winclip.c
- */
-
-RegionPtr
-winPixmapToRegionNativeGDI (PixmapPtr pPix);
-
-
-/*
- * winclipboardinit.c
- */
-
-Bool
-winInitClipboard (pthread_t *ptClipboardProc,
- pthread_mutex_t *ppmServerStarted,
- DWORD dwScreen);
-
-/*
- * winclipboardthread.c
- */
-
-void
-winDeinitClipboard ();
-
-
-/*
- * wincmap.c
- */
-
-int
-winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps);
-
-void
-winStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
-
-void
-winInstallColormap (ColormapPtr pmap);
-
-void
-winUninstallColormap (ColormapPtr pmap);
-
-void
-winResolveColor (unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual);
-
-Bool
-winCreateColormap (ColormapPtr pmap);
-
-void
-winDestroyColormap (ColormapPtr pmap);
-
-int
-winExpandDirectColors (ColormapPtr pmap, int ndef,
- xColorItem *indefs, xColorItem *outdefs);
-
-Bool
-winCreateDefColormap (ScreenPtr pScreen);
-
-Bool
-winSetVisualTypesNativeGDI (int nDepth, int nVisuals, int nBitsPerRGB);
-
-void
-winClearVisualTypes (void);
-
-
-/*
- * wincreatewnd.c
- */
-
-Bool
-winCreateBoundingWindowFullScreen (ScreenPtr pScreen);
-
-Bool
-winCreateBoundingWindowWindowed (ScreenPtr pScreen);
-
-
-/*
- * wincursor.c
- */
-
-void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y);
-
-Bool
-winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y);
-
-void
-winCrossScreen (ScreenPtr pScreen, Bool fEntering);
-
-
-/*
- * windialogs.c
- */
-
-void
-winDisplayExitDialog (winPrivScreenPtr pScreenPriv);
-
-
-void
-winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv);
-
-
-/*
- * winengine.c
- */
-
-void
-winDetectSupportedEngines ();
-
-Bool
-winSetEngine (ScreenPtr pScreen);
-
-Bool
-winGetDDProcAddresses ();
-
-
-/*
- * winerror.c
- */
-
-void
-OSVenderVErrorF (const char *pszFormat, va_list va_args);
-
-
-/*
- * winfillsp.c
- */
-
-void
-winFillSpansNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- int nSpans,
- DDXPointPtr pPoints,
- int *pWidths,
- int fSorted);
-
-
-/*
- * winfont.c
- */
-
-Bool
-winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
-
-Bool
-winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
-
-
-/*
- * wingc.c
- */
-
-Bool
-winCreateGCNativeGDI (GCPtr pGC);
-
-void
-winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges);
-
-void
-winPadPixmapNativdGDI (PixmapPtr pPixmap);
-
-void
-winValidateGCNativeGDI (GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable);
-
-void
-winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst);
-
-void
-winDestroyGCNativeGDI (GCPtr pGC);
-
-void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects);
-
-void
-winDestroyClipNativeGDI (GCPtr pGC);
-
-void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc);
-
-
-/*
- * wingetsp.c
- */
-
-void
-winGetSpansNativeGDI (DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr pPoints,
- int *pWidths,
- int nSpans,
- char *pDst);
-
-
-/*
- * winkeybd.c
- */
-
-#if WIN_NEW_KEYBOARD_SUPPORT
-winKeyEventsRec
-winTranslateKey (DWORD dwVirtualKey, DWORD dwKeyData);
-#else
-void
-winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode);
-#endif
-
-void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap);
-
-void
-winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
- pointer pCtrl, int iClass);
-
-void
-winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl);
-
-int
-winKeybdProc (DeviceIntPtr pDeviceInt, int iState);
-
-void
-winInitializeModeKeyStates (void);
-
-void
-winStoreModeKeyStates (ScreenPtr pScreen);
-
-void
-winRestoreModeKeyStates (ScreenPtr pScreen);
-
-Bool
-winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
-
-void
-winKeybdReleaseKeys ();
-
-void
-winSendKeyEvent (DWORD dwKey, Bool fDown);
-
-#if WIN_NEW_KEYBOARD_SUPPORT
-void
-winProcessKeyEvent (DWORD dwVirtKey, DWORD dwKeyData);
-#endif
-
-
-/*
- * winlayer.c
- */
-
-#if WIN_LAYER_SUPPORT
-
-LayerPtr
-winLayerCreate (ScreenPtr pScreen);
-
-int
-winLayerAdd (WindowPtr pWindow, pointer value);
-
-int
-winLayerRemove (WindowPtr pWindow, pointer value);
-
-#ifdef RANDR
-Bool
-winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations);
-
-Bool
-winRandRSetConfig (ScreenPtr pScreen,
- Rotation rotateKind,
- RRScreenSizePtr pSize);
-
-Bool
-winRandRInit (ScreenPtr pScreen);
-#endif /* RANDR */
-#endif /* WIN_LAYER_SUPPORT */
-
-
-/*
- * winmisc.c
- */
-
-void
-winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
- unsigned short *pHeight, ScreenPtr pScreen);
-
-CARD8
-winCountBits (DWORD dw);
-
-Bool
-winUpdateFBPointer (ScreenPtr pScreen, void *pbits);
-
-BOOL
-winPaintBackground (HWND hwnd, COLORREF colorref);
-
-
-/*
- * winmouse.c
- */
-
-void
-winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl);
-
-int
-winMouseProc (DeviceIntPtr pDeviceInt, int iState);
-
-int
-winMouseWheel (ScreenPtr pScreen, int iDeltaZ);
-
-void
-winMouseButtonsSendEvent (int iEventType, int iButton);
-
-int
-winMouseButtonsHandle (ScreenPtr pScreen,
- int iEventType, int iButton,
- WPARAM wParam);
-
-
-/*
- * winnativegdi.c
- */
-
-HBITMAP
-winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth,
- BYTE **ppbBits, BITMAPINFO **ppbmi);
-
-Bool
-winAllocateFBNativeGDI (ScreenPtr pScreen);
-
-void
-winShadowUpdateNativeGDI (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-Bool
-winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen);
-
-Bool
-winInitVisualsNativeGDI (ScreenPtr pScreen);
-
-Bool
-winAdjustVideoModeNativeGDI (ScreenPtr pScreen);
-
-Bool
-winBltExposedRegionsNativeGDI (ScreenPtr pScreen);
-
-Bool
-winActivateAppNativeGDI (ScreenPtr pScreen);
-
-Bool
-winSetEngineFunctionsNativeGDI (ScreenPtr pScreen);
-
-Bool
-winRedrawScreenNativeGDI (ScreenPtr pScreen);
-
-Bool
-winRealizeInstalledPaletteNativeGDI (ScreenPtr pScreen);
-
-Bool
-winInstallColormapNativeGDI (ColormapPtr pColormap);
-
-Bool
-winStoreColorsNativeGDI (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs);
-
-Bool
-winCreateColormapNativeGDI (ColormapPtr pColormap);
-
-Bool
-winDestroyColormapNativeGDI (ColormapPtr pColormap);
-
-
-
-/*
- * winpfbddd.c
- */
-
-Bool
-winAllocateFBPrimaryDD (ScreenPtr pScreen);
-
-Bool
-winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen);
-
-Bool
-winInitVisualsPrimaryDD (ScreenPtr pScreen);
-
-Bool
-winAdjustVideoModePrimaryDD (ScreenPtr pScreen);
-
-Bool
-winActivateAppPrimaryDD (ScreenPtr pScreen);
-
-Bool
-winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
-
-Bool
-winHotKeyAltTabPrimaryDD (ScreenPtr pScreen);
-
-
-/*
- * winpixmap.c
- */
-
-PixmapPtr
-winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth);
-
-Bool
-winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
-
-void
-winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw);
-
-void
-winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh);
-
-void
-winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
- int xrot, int yrot);
-
-Bool
-winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
- int iWidth, int iHeight,
- int iDepth,
- int iBitsPerPixel,
- int devKind,
- pointer pPixData);
-
-
-/*
- * winpntwin.c
- */
-
-void
-winPaintWindowNativeGDI (WindowPtr pWin, RegionPtr pRegion, int what);
-
-
-/*
- * winpolyline.c
- */
-
-void
-winPolyLineNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt);
-
-
-/*
- * winscrinit.c
- */
-
-Bool
-winScreenInit (int index,
- ScreenPtr pScreen,
- int argc, char **argv);
-
-Bool
-winFinishScreenInitFB (int index,
- ScreenPtr pScreen,
- int argc, char **argv);
-
-Bool
-winFinishScreenInitNativeGDI (int index,
- ScreenPtr pScreen,
- int argc, char **argv);
-
-Bool
-winSaveScreen (ScreenPtr pScreen, int on);
-
-PixmapPtr
-winGetWindowPixmap (WindowPtr pWin);
-
-void
-winSetWindowPixmap (WindowPtr pWin, PixmapPtr pPix);
-
-
-/*
- * winsetsp.c
- */
-
-void
-winSetSpansNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- char *pSrc,
- DDXPointPtr pPoints,
- int *pWidth,
- int nSpans,
- int fSorted);
-
-/*
- * winshaddd.c
- */
-
-Bool
-winAllocateFBShadowDD (ScreenPtr pScreen);
-
-void
-winShadowUpdateDD (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-Bool
-winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen);
-
-Bool
-winInitVisualsShadowDD (ScreenPtr pScreen);
-
-Bool
-winAdjustVideoModeShadowDD (ScreenPtr pScreen);
-
-Bool
-winBltExposedRegionsShadowDD (ScreenPtr pScreen);
-
-Bool
-winActivateAppShadowDD (ScreenPtr pScreen);
-
-Bool
-winSetEngineFunctionsShadowDD (ScreenPtr pScreen);
-
-Bool
-winRedrawScreenShadowDD (ScreenPtr pScreen);
-
-Bool
-winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen);
-
-Bool
-winInstallColormapShadowDD (ColormapPtr pColormap);
-
-Bool
-winStoreColorsShadowDD (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs);
-
-Bool
-winCreateColormapShadowDD (ColormapPtr pColormap);
-
-Bool
-winDestroyColormapShadowDD (ColormapPtr pColormap);
-
-Bool
-winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen);
-
-Bool
-winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen);
-
-
-/*
- * winshadddnl.c
- */
-
-Bool
-winAllocateFBShadowDDNL (ScreenPtr pScreen);
-
-void
-winShadowUpdateDDNL (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-Bool
-winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen);
-
-Bool
-winInitVisualsShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winAdjustVideoModeShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winBltExposedRegionsShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winActivateAppShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winRedrawScreenShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winInstallColormapShadowDDNL (ColormapPtr pColormap);
-
-Bool
-winStoreColorsShadowDDNL (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs);
-
-Bool
-winCreateColormapShadowDDNL (ColormapPtr pColormap);
-
-Bool
-winDestroyColormapShadowDDNL (ColormapPtr pColormap);
-
-Bool
-winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
-
-Bool
-winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
-
-
-/*
- * winshadgdi.c
- */
-
-Bool
-winAllocateFBShadowGDI (ScreenPtr pScreen);
-
-void
-winShadowUpdateGDI (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-Bool
-winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen);
-
-Bool
-winInitVisualsShadowGDI (ScreenPtr pScreen);
-
-Bool
-winAdjustVideoModeShadowGDI (ScreenPtr pScreen);
-
-Bool
-winActivateAppShadowGDI (ScreenPtr pScreen);
-
-Bool
-winRedrawScreenShadowGDI (ScreenPtr pScreen);
-
-Bool
-winSetEngineFunctionsShadowGDI (ScreenPtr pScreen);
-
-Bool
-winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen);
-
-Bool
-winInstallColormapShadowGDI (ColormapPtr pColormap);
-
-Bool
-winStoreColorsShadowGDI (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs);
-
-Bool
-winCreateColormapShadowGDI (ColormapPtr pColormap);
-
-Bool
-winDestroyColormapShadowGDI (ColormapPtr pColormap);
-
-
-/*
- * winwakeup.c
- */
-
-void
-winWakeupHandler (int nScreen,
- pointer pWakeupData,
- unsigned long ulResult,
- pointer pReadmask);
-
-
-/*
- * winwindow.c
- */
-
-Bool
-winCreateWindowNativeGDI (WindowPtr pWin);
-
-Bool
-winDestroyWindowNativeGDI (WindowPtr pWin);
-
-Bool
-winPositionWindowNativeGDI (WindowPtr pWin, int x, int y);
-
-void
-winCopyWindowNativeGDI (WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-
-Bool
-winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask);
-
-Bool
-winUnmapWindowNativeGDI (WindowPtr pWindow);
-
-Bool
-winMapWindowNativeGDI (WindowPtr pWindow);
-
-Bool
-winCreateWindowPRootless (WindowPtr pWindow);
-
-Bool
-winDestroyWindowPRootless (WindowPtr pWindow);
-
-Bool
-winPositionWindowPRootless (WindowPtr pWindow, int x, int y);
-
-Bool
-winChangeWindowAttributesPRootless (WindowPtr pWindow, unsigned long mask);
-
-Bool
-winUnmapWindowPRootless (WindowPtr pWindow);
-
-Bool
-winMapWindowPRootless (WindowPtr pWindow);
-
-#ifdef SHAPE
-void
-winSetShapePRootless (WindowPtr pWindow);
-#endif
-
-
-/*
- * winmultiwindowicons.c
- */
-
-HICON
-winXIconToHICON (WindowPtr pWin);
-
-void
-winUpdateIcon (Window id);
-
-
-/*
- * winmultiwindowshape.c
- */
-
-#ifdef SHAPE
-void
-winReshapeMultiWindow (WindowPtr pWin);
-
-void
-winSetShapeMultiWindow (WindowPtr pWindow);
-
-void
-winUpdateRgnMultiWindow (WindowPtr pWindow);
-#endif
-
-
-/*
- * winmultiwindowwindow.c
- */
-
-Bool
-winCreateWindowMultiWindow (WindowPtr pWindow);
-
-Bool
-winDestroyWindowMultiWindow (WindowPtr pWindow);
-
-Bool
-winPositionWindowMultiWindow (WindowPtr pWindow, int x, int y);
-
-Bool
-winChangeWindowAttributesMultiWindow (WindowPtr pWindow, unsigned long mask);
-
-Bool
-winUnmapWindowMultiWindow (WindowPtr pWindow);
-
-Bool
-winMapWindowMultiWindow (WindowPtr pWindow);
-
-void
-winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent);
-
-void
-winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib);
-
-void
-winReorderWindowsMultiWindow (ScreenPtr pScreen);
-
-void
-winMoveXWindow (WindowPtr pWin, int x, int y);
-
-void
-winResizeXWindow (WindowPtr pWin, int w, int h);
-
-XID
-winGetWindowID (WindowPtr pWin);
-
-
-/*
- * winmultiwindowwndproc.c
- */
-
-LRESULT CALLBACK
-winTopLevelWindowProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam);
-
-
-/*
- * wintrayicon.c
- */
-
-void
-winInitNotifyIcon (winPrivScreenPtr pScreenPriv);
-
-void
-winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv);
-
-LRESULT
-winHandleIconMessage (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam,
- winPrivScreenPtr pScreenPriv);
-
-
-/*
- * winwndproc.c
- */
-
-LRESULT CALLBACK
-winWindowProc (HWND hWnd, UINT message,
- WPARAM wParam, LPARAM lParam);
-
-
-/*
- * END DDX and DIX Function Prototypes
- */
-
-#endif /* _WIN_H_ */
-
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
deleted file mode 100644
index a27309598..000000000
--- a/hw/xwin/winallpriv.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Keith Packard, MIT X Consortium
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.12 2002/10/31 23:04:39 alanh Exp $ */
-
-#include "win.h"
-
-
-
-/* See Porting Layer Definition - p. 58 */
-/*
- * Allocate indexes for the privates that we use.
- * Allocate memory directly for the screen privates.
- * Reserve space in GCs and Pixmaps for our privates.
- * Colormap privates are handled in winAllocateCmapPrivates ()
- */
-
-Bool
-winAllocatePrivates (ScreenPtr pScreen)
-{
- winPrivScreenPtr pScreenPriv;
-
-#if CYGDEBUG
- ErrorF ("winAllocateScreenPrivates - g_ulServerGeneration: %d "
- "serverGeneration: %d\n",
- g_ulServerGeneration, serverGeneration);
-#endif
-
- /* We need a new slot for our privates if the screen gen has changed */
- if (g_ulServerGeneration != serverGeneration)
- {
- /* Get an index that we can store our privates at */
- g_iScreenPrivateIndex = AllocateScreenPrivateIndex ();
- g_iGCPrivateIndex = AllocateGCPrivateIndex ();
- g_iPixmapPrivateIndex = AllocatePixmapPrivateIndex ();
- g_iWindowPrivateIndex = AllocateWindowPrivateIndex ();
-
- g_ulServerGeneration = serverGeneration;
- }
-
- /* Allocate memory for the screen private structure */
- pScreenPriv = (winPrivScreenPtr) malloc (sizeof (winPrivScreenRec));
- if (!pScreenPriv)
- {
- ErrorF ("winAllocateScreenPrivates - malloc () failed\n");
- return FALSE;
- }
-
- /* Initialize the memory of the private structure */
- ZeroMemory (pScreenPriv, sizeof (winPrivScreenRec));
-
- /* Intialize private structure members */
- pScreenPriv->fActive = TRUE;
-
- /* Save the screen private pointer */
- winSetScreenPriv (pScreen, pScreenPriv);
-
- /* Reserve GC memory for our privates */
- if (!AllocateGCPrivate (pScreen, g_iGCPrivateIndex,
- sizeof (winPrivGCRec)))
- {
- ErrorF ("winAllocatePrivates - AllocateGCPrivate () failed\n");
- return FALSE;
- }
-
- /* Reserve Pixmap memory for our privates */
- if (!AllocatePixmapPrivate (pScreen, g_iPixmapPrivateIndex,
- sizeof (winPrivPixmapRec)))
- {
- ErrorF ("winAllocatePrivates - AllocatePixmapPrivates () failed\n");
- return FALSE;
- }
-
- /* Reserve Window memory for our privates */
- if (!AllocateWindowPrivate (pScreen, g_iWindowPrivateIndex,
- sizeof (winPrivWinRec)))
- {
- ErrorF ("winAllocatePrivates () - AllocateWindowPrivates () failed\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Colormap privates may be allocated after the default colormap has
- * already been created for some screens. This initialization procedure
- * is called for each default colormap that is found.
- */
-
-Bool
-winInitCmapPrivates (ColormapPtr pcmap)
-{
-#if CYGDEBUG
- ErrorF ("winInitCmapPrivates\n");
-#endif
-
- /*
- * I see no way that this function can do anything useful
- * with only a ColormapPtr. We don't have the index for
- * our dev privates yet, so we can't really initialize
- * anything. Perhaps I am misunderstanding the purpose
- * of this function.
- */
-
- return TRUE;
-}
-
-
-/*
- * Allocate memory for our colormap privates
- */
-
-Bool
-winAllocateCmapPrivates (ColormapPtr pCmap)
-{
- winPrivCmapPtr pCmapPriv;
- static unsigned long s_ulPrivateGeneration = 0;
-
-#if CYGDEBUG
- ErrorF ("winAllocateCmapPrivates\n");
-#endif
-
- /* Get a new privates index when the server generation changes */
- if (s_ulPrivateGeneration != serverGeneration)
- {
- /* Get an index that we can store our privates at */
- g_iCmapPrivateIndex = AllocateColormapPrivateIndex (winInitCmapPrivates);
-
- /* Save the new server generation */
- s_ulPrivateGeneration = serverGeneration;
- }
-
- /* Allocate memory for our private structure */
- pCmapPriv = (winPrivCmapPtr) malloc (sizeof (winPrivCmapRec));
- if (!pCmapPriv)
- {
- ErrorF ("winAllocateCmapPrivates - malloc () failed\n");
- return FALSE;
- }
-
- /* Initialize the memory of the private structure */
- ZeroMemory (pCmapPriv, sizeof (winPrivCmapRec));
-
- /* Save the cmap private pointer */
- winSetCmapPriv (pCmap, pCmapPriv);
-
-#if CYGDEBUG
- ErrorF ("winAllocateCmapPrivates - Returning\n");
-#endif
-
- return TRUE;
-}
diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
deleted file mode 100644
index cc057eed6..000000000
--- a/hw/xwin/winblock.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winblock.c,v 1.7 2003/07/29 21:25:16 dawes Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 6 */
-void
-winBlockHandler (int nScreen,
- pointer pBlockData,
- pointer pTimeout,
- pointer pReadMask)
-{
- winScreenPriv((ScreenPtr)pBlockData);
- MSG msg;
-
- /* Signal threaded modules to begin */
- if (pScreenPriv != NULL && !pScreenPriv->fServerStarted)
- {
- int iReturn;
-
- ErrorF ("winBlockHandler - Releasing pmServerStarted\n");
-
- /* Flag that modules are to be started */
- pScreenPriv->fServerStarted = TRUE;
-
- /* Unlock the mutex for threaded modules */
- iReturn = pthread_mutex_unlock (&pScreenPriv->pmServerStarted);
- if (iReturn != 0)
- {
- ErrorF ("winBlockHandler - pthread_mutex_unlock () failed: %d\n",
- iReturn);
- goto winBlockHandler_ProcessMessages;
- }
-
- ErrorF ("winBlockHandler - pthread_mutex_unlock () returned\n");
- }
-
-winBlockHandler_ProcessMessages:
-
- /* Process all messages on our queue */
- while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
- {
- if ((g_hDlgDepthChange == 0
- || !IsDialogMessage (g_hDlgDepthChange, &msg))
- && (g_hDlgExit == 0
- || !IsDialogMessage (g_hDlgExit, &msg)))
- {
- DispatchMessage (&msg);
- }
- }
- winReorderWindowsMultiWindow ((ScreenPtr)pBlockData);
-}
diff --git a/hw/xwin/winclip.c b/hw/xwin/winclip.c
deleted file mode 100644
index a829e8eb9..000000000
--- a/hw/xwin/winclip.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclip.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
-
-#include "win.h"
-
-/* Look at mfb/mfbclip.c for sample implementation */
-RegionPtr
-winPixmapToRegionNativeGDI (PixmapPtr pPix)
-{
- ErrorF ("winPixmapToRegion()\n");
- return NULL;
-}
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
deleted file mode 100644
index 8f9bae789..000000000
--- a/hw/xwin/winclipboard.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold Hunt
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboard.h,v 1.3 2003/10/02 13:30:10 eich Exp $ */
-
-
-#ifndef _WINCLIPBOARD_H_
-#define _WINCLIPBOARD_H_
-
-/* Standard library headers */
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/select.h>
-#include <fcntl.h>
-#include <setjmp.h>
-#include <pthread.h>
-
-/* X headers */
-#include "X.h"
-#include "Xatom.h"
-/* NOTE: For some unknown reason, including Xproto.h solves
- * tons of problems with including windows.h. Unknowns reasons
- * are usually bad, so someone should investigate this.
- */
-#include "Xproto.h"
-#include "Xutil.h"
-#include "Xlocale.h"
-
-/* Fixups to prevent collisions between Windows and X headers */
-#define ATOM DWORD
-
-/* Windows headers */
-#include <windows.h>
-
-
-/* Clipboard module constants */
-#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
-#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
-#define WIN_MSG_QUEUE_FNAME "/dev/windows"
-#define WIN_CONNECT_RETRIES 3
-#define WIN_CONNECT_DELAY 4
-#define WIN_JMP_OKAY 0
-#define WIN_JMP_ERROR_IO 2
-
-/*
- * Argument structure for Clipboard module main thread
- */
-
-typedef struct _ClipboardProcArgRec {
- DWORD dwScreen;
- pthread_mutex_t *ppmServerStarted;
-} ClipboardProcArgRec, *ClipboardProcArgPtr;
-
-
-/*
- * References to external symbols
- */
-
-extern char *display;
-extern void ErrorF (const char* /*f*/, ...);
-
-
-/*
- * winclipboardinit.c
- */
-
-Bool
-winInitClipboard (pthread_t *ptClipboardProc,
- pthread_mutex_t *ppmServerStarted,
- DWORD dwScreen);
-
-HWND
-winClipboardCreateMessagingWindow ();
-
-
-/*
- * winclipboardtextconv.c
- */
-
-void
-winClipboardDOStoUNIX (char *pszData, int iLength);
-
-void
-winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
-
-
-/*
- * winclipboardthread.c
- */
-
-void *
-winClipboardProc (void *pArg);
-
-void
-winDeinitClipboard ();
-
-/*
- * winclipboardunicode.c
- */
-
-Bool
-winClipboardDetectUnicodeSupport ();
-
-
-/*
- * winclipboardwndproc.c
- */
-
-BOOL
-winClipboardFlushWindowsMessageQueue (HWND hwnd);
-
-LRESULT CALLBACK
-winClipboardWindowProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam);
-
-
-/*
- * winclipboardxevents.c
- */
-
-Bool
-winClipboardFlushXEvents (HWND hwnd,
- Atom atomClipboard,
- Atom atomLocalProperty,
- Atom atomUTF8String,
- Atom atomCompoundText,
- Atom atomTargets,
- Atom atomDeleteWindow,
- int iWindow,
- Display *pDisplay,
- Bool fUnicodeSupport);
-#endif
diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
deleted file mode 100644
index a1f7b0b6d..000000000
--- a/hw/xwin/winclipboardinit.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardinit.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
-
-#include "winclipboard.h"
-
-
-/*
- * Intialize the Clipboard module
- */
-
-Bool
-winInitClipboard (pthread_t *ptClipboardProc,
- pthread_mutex_t *ppmServerStarted,
- DWORD dwScreen)
-{
- ClipboardProcArgPtr pArg;
-
- ErrorF ("winInitClipboard ()\n");
-
- /* Allocate the parameter structure */
- pArg = (ClipboardProcArgPtr) malloc (sizeof (ClipboardProcArgRec));
- if (pArg == NULL)
- {
- ErrorF ("winInitClipboard - malloc for ClipboardProcArgRec failed.\n");
- return FALSE;
- }
-
- /* Setup the argument structure for the thread function */
- pArg->dwScreen = dwScreen;
- pArg->ppmServerStarted = ppmServerStarted;
-
- /* Spawn a thread for the Clipboard module */
- if (pthread_create (ptClipboardProc, NULL, winClipboardProc, pArg))
- {
- /* Bail if thread creation failed */
- ErrorF ("winInitClipboard - pthread_create failed.\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Create the Windows window that we use to recieve Windows messages
- */
-
-HWND
-winClipboardCreateMessagingWindow ()
-{
- WNDCLASS wc;
- HWND hwnd;
-
- /* Setup our window class */
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = winClipboardWindowProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = GetModuleHandle (NULL);
- wc.hIcon = 0;
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS;
- RegisterClass (&wc);
-
- /* Create the window */
- hwnd = CreateWindowExA (0, /* Extended styles */
- WIN_CLIPBOARD_WINDOW_CLASS,/* Class name */
- WIN_CLIPBOARD_WINDOW_TITLE,/* Window name */
- WS_OVERLAPPED, /* Not visible anyway */
- CW_USEDEFAULT, /* Horizontal position */
- CW_USEDEFAULT, /* Vertical position */
- CW_USEDEFAULT, /* Right edge */
- CW_USEDEFAULT, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
- (HMENU) NULL, /* No menu */
- GetModuleHandle (NULL),/* Instance handle */
- NULL); /* ScreenPrivates */
- assert (hwnd != NULL);
-
- /* I'm not sure, but we may need to call this to start message processing */
- ShowWindow (hwnd, SW_HIDE);
-
- /* Similarly, we may need a call to this even though we don't paint */
- UpdateWindow (hwnd);
-
- return hwnd;
-}
diff --git a/hw/xwin/winclipboardtextconv.c b/hw/xwin/winclipboardtextconv.c
deleted file mode 100644
index 09ef40076..000000000
--- a/hw/xwin/winclipboardtextconv.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardtextconv.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
-
-#include "win.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-
-/*
- * Convert \r\n to \n
- *
- * NOTE: This was heavily inspired by, if not down right stolen from,
- * Cygwin's winsup/cygwin/fhandler.cc/fhandler_base::read ()
- */
-
-void
-winClipboardDOStoUNIX (char *pszSrc, int iLength)
-{
- char *pszDest = pszSrc;
- char *pszEnd = pszSrc + iLength;
-
- /* Loop until the last character */
- while (pszSrc < pszEnd)
- {
- /* Copy the current source character to current destination character */
- *pszDest = *pszSrc;
-
- /* Advance to the next source character */
- pszSrc++;
-
- /* Don't advance the destination character if we need to drop an \r */
- if (*pszDest != '\r' || *pszSrc != '\n')
- pszDest++;
- }
-
- /* Move the terminating null */
- *pszDest = '\0';
-}
-
-
-/*
- * Convert \n to \r\n
- */
-
-void
-winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength)
-{
- int iNewlineCount = 0;
- unsigned char *pszSrc = *ppszData;
- unsigned char *pszEnd = pszSrc + iLength;
- unsigned char *pszDest = NULL, *pszDestBegin = NULL;
-
-#if 0
- ErrorF ("UNIXtoDOS () - Original data:\n%s\n", *ppszData);
-#endif
-
- /* Count \n characters without leading \r */
- while (pszSrc < pszEnd)
- {
- /* Skip ahead two character if found set of \r\n */
- if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
- {
- pszSrc += 2;
- continue;
- }
-
- /* Increment the count if found naked \n */
- if (*pszSrc == '\n')
- {
- iNewlineCount++;
- }
-
- pszSrc++;
- }
-
- /* Return if no naked \n's */
- if (iNewlineCount == 0)
- return;
-
- /* Allocate a new string */
- pszDestBegin = pszDest = malloc (iLength + iNewlineCount + 1);
-
- /* Set source pointer to beginning of data string */
- pszSrc = *ppszData;
-
- /* Loop through all characters in source string */
- while (pszSrc < pszEnd)
- {
- /* Copy line endings that are already valid */
- if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
- {
- *pszDest = *pszSrc;
- *(pszDest + 1) = *(pszSrc + 1);
- pszDest += 2;
- pszSrc += 2;
- continue;
- }
-
- /* Add \r to naked \n's */
- if (*pszSrc == '\n')
- {
- *pszDest = '\r';
- *(pszDest + 1) = *pszSrc;
- pszDest += 2;
- pszSrc += 1;
- continue;
- }
-
- /* Copy normal characters */
- *pszDest = *pszSrc;
- pszSrc++;
- pszDest++;
- }
-
- /* Put terminating null at end of new string */
- *pszDest = '\0';
-
- /* Swap string pointers */
- free (*ppszData);
- *ppszData = pszDestBegin;
-
-#if 0
- ErrorF ("UNIXtoDOS () - Final string:\n%s\n", pszDestBegin);
-#endif
-}
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
deleted file mode 100644
index 06a985533..000000000
--- a/hw/xwin/winclipboardthread.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardthread.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
-
-#include "winclipboard.h"
-
-/*
- * References to external symbols
- */
-
-extern Bool g_fCalledSetLocale;
-
-
-/*
- * Global variables
- */
-
-static jmp_buf g_jmpEntry;
-static Bool g_shutdown = FALSE;
-
-
-/*
- * Local function prototypes
- */
-
-static int
-winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr);
-
-static int
-winClipboardIOErrorHandler (Display *pDisplay);
-
-
-/*
- * Main thread function
- */
-
-void *
-winClipboardProc (void *pArg)
-{
- Atom atomClipboard, atomClipboardManager;
- Atom atomLocalProperty, atomCompoundText;
- Atom atomUTF8String, atomTargets;
- int iReturn;
- HWND hwnd = NULL;
- int iConnectionNumber;
- int fdMessageQueue;
- fd_set fdsRead;
- int iMaxDescriptor;
- Display *pDisplay;
- Window iWindow;
- Atom atomDeleteWindow;
- Bool fReturn;
- int iRetries;
- Bool fUnicodeSupport;
- char szDisplay[512];
- ClipboardProcArgPtr pProcArg = (ClipboardProcArgPtr) pArg;
-
- ErrorF ("winClipboardProc - Hello\n");
-
- /* Check that argument pointer is not invalid */
- if (pArg == NULL)
- {
- ErrorF ("winClipboardProc - pArg is NULL, bailing.\n");
- pthread_exit (NULL);
- }
-
- ErrorF ("winClipboardProc - Calling pthread_mutex_lock ()\n");
-
- /* Grab the server started mutex - pause until we get it */
- iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
- if (iReturn != 0)
- {
- ErrorF ("winClipboardProc - pthread_mutex_lock () failed: %d\n",
- iReturn);
- pthread_exit (NULL);
- }
-
- ErrorF ("winClipboardProc - pthread_mutex_lock () returned.\n");
-
- /* Do we have Unicode support? */
- fUnicodeSupport = winClipboardDetectUnicodeSupport ();
-
- /* Set the current locale? What does this do? */
- if (fUnicodeSupport && !g_fCalledSetLocale)
- {
- ErrorF ("winClipboardProc - Calling setlocale ()\n");
- if (!setlocale (LC_ALL, ""))
- {
- ErrorF ("winClipboardProc - setlocale () error\n");
- pthread_exit (NULL);
- }
- ErrorF ("winClipboardProc - setlocale () returned\n");
-
- /* See if X supports the current locale */
- if (XSupportsLocale () == False)
- {
- ErrorF ("winClipboardProc - Locale not supported by X\n");
- pthread_exit (NULL);
- }
- }
-
- /* Flag that we have called setlocale */
- g_fCalledSetLocale = TRUE;
-
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winClipboardProc - XInitThreads failed.\n");
- pthread_exit (NULL);
- }
-
- ErrorF ("winClipboardProc - XInitThreads () returned.\n");
-
- /* Release the server started mutex */
- pthread_mutex_unlock (pProcArg->ppmServerStarted);
-
- ErrorF ("winClipboardProc - pthread_mutex_unlock () returned.\n");
-
- /* Set jump point for Error exits */
- iReturn = setjmp (g_jmpEntry);
-
- /* Check if we should continue operations */
- if (iReturn != WIN_JMP_ERROR_IO
- && iReturn != WIN_JMP_OKAY)
- {
- /* setjmp returned an unknown value, exit */
- ErrorF ("winClipboardProc - setjmp returned: %d exiting\n",
- iReturn);
- pthread_exit (NULL);
- }
- else if (g_shutdown)
- {
- /* Shutting down, the X server severed out connection! */
- ErrorF ("winClipboardProc - Detected shutdown in progress\n");
- pthread_exit (NULL);
- }
- else if (iReturn == WIN_JMP_ERROR_IO)
- {
- ErrorF ("winClipboardProc - setjmp returned and hwnd: %08x\n", hwnd);
- }
-
- /* Initialize retry count */
- iRetries = 0;
-
- /* Setup the display connection string x */
- snprintf (szDisplay,
- 512,
- "127.0.0.1:%s.%d",
- display,
- (int) pProcArg->dwScreen);
-
- /* Print the display connection string */
- ErrorF ("winClipboardProc - DISPLAY=%s\n", szDisplay);
-
- /* Open the X display */
- do
- {
- pDisplay = XOpenDisplay (szDisplay);
- if (pDisplay == NULL)
- {
- ErrorF ("winClipboardProc - Could not open display, "
- "try: %d, sleeping: %d\n",
- iRetries + 1, WIN_CONNECT_DELAY);
- ++iRetries;
- sleep (WIN_CONNECT_DELAY);
- continue;
- }
- else
- break;
- }
- while (pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
-
- /* Make sure that the display opened */
- if (pDisplay == NULL)
- {
- ErrorF ("winClipboardProc - Failed opening the display, giving up\n");
- pthread_exit (NULL);
- }
-
- ErrorF ("winClipboardProc - XOpenDisplay () returned and "
- "successfully opened the display.\n");
-
- /* Create Windows messaging window */
- hwnd = winClipboardCreateMessagingWindow ();
-
- /* Get our connection number */
- iConnectionNumber = ConnectionNumber (pDisplay);
-
- /* Open a file descriptor for the windows message queue */
- fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
- if (fdMessageQueue == -1)
- {
- ErrorF ("winClipboardProc - Failed opening %s\n", WIN_MSG_QUEUE_FNAME);
- pthread_exit (NULL);
- }
-
- /* Find max of our file descriptors */
- iMaxDescriptor = max (fdMessageQueue, iConnectionNumber) + 1;
-
- /* Select event types to watch */
- if (XSelectInput (pDisplay,
- DefaultRootWindow (pDisplay),
- SubstructureNotifyMask |
- StructureNotifyMask |
- PropertyChangeMask) == BadWindow)
- ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
- "on RootWindow\n\n");
-
- /* Create a messaging window */
- iWindow = XCreateSimpleWindow (pDisplay,
- DefaultRootWindow (pDisplay),
- 1, 1,
- 500, 500,
- 0,
- BlackPixel (pDisplay, 0),
- BlackPixel (pDisplay, 0));
- if (iWindow == 0)
- {
- ErrorF ("winClipboardProc - Could not create a window\n");
- pthread_exit (NULL);
- }
-
- /* This looks like our only hope for getting a message before shutdown */
- /* Register for WM_DELETE_WINDOW message from window manager */
- atomDeleteWindow = XInternAtom (pDisplay, "WM_DELETE_WINDOW", False);
- XSetWMProtocols (pDisplay, iWindow, &atomDeleteWindow, 1);
-
- /* Set error handler */
- XSetErrorHandler (winClipboardErrorHandler);
- XSetIOErrorHandler (winClipboardIOErrorHandler);
-
- /* Create an atom for CLIPBOARD_MANAGER */
- atomClipboardManager = XInternAtom (pDisplay, "CLIPBOARD_MANAGER", False);
- if (atomClipboardManager == None)
- {
- ErrorF ("winClipboardProc - Could not create CLIPBOARD_MANAGER atom\n");
- pthread_exit (NULL);
- }
-
- /* Assert ownership of CLIPBOARD_MANAGER */
- iReturn = XSetSelectionOwner (pDisplay, atomClipboardManager,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardProc - Could not set CLIPBOARD_MANAGER owner\n");
- pthread_exit (NULL);
- }
-
- /* Create an atom for CLIPBOARD */
- atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
- if (atomClipboard == None)
- {
- ErrorF ("winClipboardProc - Could not create CLIPBOARD atom\n");
- pthread_exit (NULL);
- }
-
- /* Assert ownership of CLIPBOARD */
- iReturn = XSetSelectionOwner (pDisplay, atomClipboard,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardProc - Could not set CLIPBOARD owner\n");
- pthread_exit (NULL);
- }
-
- /* Assert ownership of PRIMARY */
- iReturn = XSetSelectionOwner (pDisplay, XA_PRIMARY,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardProc - Could not set PRIMARY owner\n");
- pthread_exit (NULL);
- }
-
- /* Local property to hold pasted data */
- atomLocalProperty = XInternAtom (pDisplay, "CYGX_CUT_BUFFER", False);
- if (atomLocalProperty == None)
- {
- ErrorF ("winClipboardProc - Could not create CYGX_CUT_BUFFER atom\n");
- pthread_exit (NULL);
- }
-
- /* Create an atom for UTF8_STRING */
- atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False);
- if (atomUTF8String == None)
- {
- ErrorF ("winClipboardProc - Could not create UTF8_STRING atom\n");
- pthread_exit (NULL);
- }
-
- /* Create an atom for COMPOUND_TEXT */
- atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False);
- if (atomCompoundText == None)
- {
- ErrorF ("winClipboardProc - Could not create COMPOUND_TEXT atom\n");
- pthread_exit (NULL);
- }
-
- /* Create an atom for TARGETS */
- atomTargets = XInternAtom (pDisplay, "TARGETS", False);
- if (atomTargets == None)
- {
- ErrorF ("winClipboardProc - Could not create TARGETS atom\n");
- pthread_exit (NULL);
- }
-
- /* Pre-flush X events */
- /*
- * NOTE: Apparently you'll freeze if you don't do this,
- * because there may be events in local data structures
- * already.
- */
- winClipboardFlushXEvents (hwnd,
- atomClipboard,
- atomLocalProperty,
- atomUTF8String,
- atomCompoundText,
- atomTargets,
- atomDeleteWindow,
- iWindow,
- pDisplay,
- fUnicodeSupport);
-
- /* Pre-flush Windows messages */
- if (!winClipboardFlushWindowsMessageQueue (hwnd))
- return 0;
-
- /* Loop for X events */
- while (1)
- {
- /* Setup the file descriptor set */
- /*
- * NOTE: You have to do this before every call to select
- * because select modifies the mask to indicate
- * which descriptors are ready.
- */
- FD_ZERO (&fdsRead);
- FD_SET (fdMessageQueue, &fdsRead);
- FD_SET (iConnectionNumber, &fdsRead);
-
- /* Wait for a Windows event or an X event */
- iReturn = select (iMaxDescriptor, /* Highest fds number */
- &fdsRead, /* Read mask */
- NULL, /* No write mask */
- NULL, /* No exception mask */
- NULL); /* No timeout */
- if (iReturn <= 0)
- {
- ErrorF ("winClipboardProc - Call to select () failed: %d. "
- "Bailing.\n", iReturn);
- break;
- }
-
- /* Branch on which descriptor became active */
- if (FD_ISSET (iConnectionNumber, &fdsRead))
- {
- /* X event ready */
-#if 0
- ErrorF ("winClipboardProc - X event ready\n");
-#endif
-
- /* Process X events */
- /* Exit when we see that server is shutting down */
- fReturn = winClipboardFlushXEvents (hwnd,
- atomClipboard,
- atomLocalProperty,
- atomUTF8String,
- atomCompoundText,
- atomTargets,
- atomDeleteWindow,
- iWindow,
- pDisplay,
- fUnicodeSupport);
- if (!fReturn)
- {
- ErrorF ("winClipboardProc - Caught WM_DELETE_WINDOW - "
- "shutting down\n");
- break;
- }
- }
-
- /* Check for Windows event ready */
- if (FD_ISSET (fdMessageQueue, &fdsRead))
- {
- /* Windows event ready */
-#if 0
- ErrorF ("winClipboardProc - Windows event ready\n");
-#endif
-
- /* Process Windows messages */
- if (!winClipboardFlushWindowsMessageQueue (hwnd))
- break;
- }
- }
-
- return 0;
-}
-
-
-/*
- * winClipboardErrorHandler - Our application specific error handler
- */
-
-static int
-winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
-{
- char pszErrorMsg[100];
-
- XGetErrorText (pDisplay,
- pErr->error_code,
- pszErrorMsg,
- sizeof (pszErrorMsg));
- ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n", pszErrorMsg);
-
- if (pErr->error_code == BadWindow
- || pErr->error_code == BadMatch
- || pErr->error_code == BadDrawable)
- {
-#if 0
- pthread_exit (NULL);
-#endif
- }
-
-#if 0
- pthread_exit (NULL);
-#endif
-
- return 0;
-}
-
-
-/*
- * winClipboardIOErrorHandler - Our application specific IO error handler
- */
-
-static int
-winClipboardIOErrorHandler (Display *pDisplay)
-{
- printf ("\nwinClipboardIOErrorHandler!\n\n");
-
- /* Restart at the main entry point */
- longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
-
- return 0;
-}
-
-
-/*
- * Notify the clipboard thread we're exiting and not to reconnect
- */
-
-void
-winDeinitClipboard ()
-{
- ErrorF ("winDeinitClipboard - Noting shutdown in progress\n");
- g_shutdown = TRUE;
-}
diff --git a/hw/xwin/winclipboardunicode.c b/hw/xwin/winclipboardunicode.c
deleted file mode 100644
index 9eb2b0d87..000000000
--- a/hw/xwin/winclipboardunicode.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardunicode.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
-
-#include "win.h"
-
-
-/*
- * Determine whether we suport Unicode or not.
- * NOTE: Currently, just check if we are on an NT-based platform or not.
- */
-
-Bool
-winClipboardDetectUnicodeSupport ()
-{
- Bool fReturn = FALSE;
- OSVERSIONINFO osvi;
-
- /* Get operating system version information */
- ZeroMemory (&osvi, sizeof (osvi));
- osvi.dwOSVersionInfoSize = sizeof (osvi);
- GetVersionEx (&osvi);
-
- /* Branch on platform ID */
- switch (osvi.dwPlatformId)
- {
- case VER_PLATFORM_WIN32_NT:
- /* Engine 4 is supported on NT only */
- ErrorF ("DetectUnicodeSupport - Windows NT/2000/XP\n");
- fReturn = TRUE;
- break;
-
- case VER_PLATFORM_WIN32_WINDOWS:
- /* Engine 4 is supported on NT only */
- ErrorF ("DetectUnicodeSupport - Windows 95/98/Me\n");
- fReturn = FALSE;
- break;
- }
-
- return fReturn;
-}
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
deleted file mode 100644
index c577d060e..000000000
--- a/hw/xwin/winclipboardwndproc.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
-
-#include "winclipboard.h"
-
-
-/*
- * Process a given Windows message
- */
-
-LRESULT CALLBACK
-winClipboardWindowProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- /* Branch on message type */
- switch (message)
- {
- case WM_DESTROY:
- PostQuitMessage (0);
- return 0;
-
- case WM_CREATE:
-#if 0
- ErrorF ("WindowProc - WM_CREATE\n");
-#endif
- return 0;
- }
-
- /* Let Windows perform default processing for unhandled messages */
- return DefWindowProc (hwnd, message, wParam, lParam);
-}
-
-
-/*
- * Process any pending Windows messages
- */
-
-BOOL
-winClipboardFlushWindowsMessageQueue (HWND hwnd)
-{
- MSG msg;
-
- /* Flush the messaging window queue */
- /* NOTE: Do not pass the hwnd of our messaging window to PeekMessage,
- * as this will filter out many non-window-specific messages that
- * are sent to our thread, such as WM_QUIT.
- */
- while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
- {
- /* Dispatch the message if not WM_QUIT */
- if (msg.message == WM_QUIT)
- return FALSE;
- else
- DispatchMessage (&msg);
- }
-
- return TRUE;
-}
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
deleted file mode 100644
index 8b3a56489..000000000
--- a/hw/xwin/winclipboardxevents.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardxevents.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
-
-#include "winclipboard.h"
-
-
-/*
- * Process any pending X events
- */
-
-Bool
-winClipboardFlushXEvents (HWND hwnd,
- Atom atomClipboard,
- Atom atomLocalProperty,
- Atom atomUTF8String,
- Atom atomCompoundText,
- Atom atomTargets,
- Atom atomDeleteWindow,
- int iWindow,
- Display *pDisplay,
- Bool fUnicodeSupport)
-{
- Atom atomReturnType;
- int iReturnFormat;
- unsigned long ulReturnItems;
- XTextProperty xtpText;
- XEvent event;
- XSelectionEvent eventSelection;
- unsigned long ulReturnBytesLeft;
- unsigned char *pszReturnData = NULL;
- char *pszGlobalData = NULL;
- int iReturn;
- HGLOBAL hGlobal;
- Bool fReturn = TRUE;
- XICCEncodingStyle xiccesStyle;
- int iUTF8;
- char *pszUTF8 = NULL;
- char *pszTextList[2];
- int iCount;
- char **ppszTextList = NULL;
- wchar_t *pwszUnicodeStr = NULL;
- int iUnicodeLen = 0;
-
- /* Process all pending events */
- while (XPending (pDisplay))
- {
- /* Get the next event - will not block because one is ready */
- XNextEvent (pDisplay, &event);
-
- /* Branch on the event type */
- switch (event.type)
- {
- case ClientMessage:
- if (event.xclient.data.l[0] == atomDeleteWindow)
- {
- ErrorF ("\nwinClipboardFlushXEvents - Received "
- "WM_DELETE_WINDOW\n\n");
- fReturn = FALSE;
- }
- else
- ErrorF ("\nwinClipboardFlushXEvents - Unknown ClientMessage\n\n");
- break;
-
- case SelectionClear:
- /* Request the lost selection contents */
- iReturn = XConvertSelection (pDisplay,
- event.xselectionclear.selection,
- atomCompoundText,
- atomLocalProperty,
- iWindow,
- CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionClear - "
- "XConvertSelection () failed\n");
- pthread_exit (NULL);
- }
- break;
-
-
- /*
- * SelectionRequest
- */
-
- case SelectionRequest:
-#if 0
- char *pszAtomName = NULL
-
- ErrorF ("SelectionRequest - target %d\n",
- event.xselectionrequest.target);
-
- pszAtomName = XGetAtomName (pDisplay,
- event.xselectionrequest.target);
- ErrorF ("SelectionRequest - Target atom name %s\n", pszAtomName);
- XFree (pszAtomName);
- pszAtomName = NULL;
-#endif
-
- /* Abort if invalid target type */
- if (event.xselectionrequest.target != XA_STRING
- && event.xselectionrequest.target != atomUTF8String
- && event.xselectionrequest.target != atomCompoundText
- && event.xselectionrequest.target != atomTargets)
- {
- /* Setup selection notify event */
- eventSelection.type = SelectionNotify;
- eventSelection.send_event = True;
- eventSelection.display = pDisplay;
- eventSelection.requestor = event.xselectionrequest.requestor;
- eventSelection.selection = event.xselectionrequest.selection;
- eventSelection.target = event.xselectionrequest.target;
- eventSelection.property = None;
- eventSelection.time = event.xselectionrequest.time;
-
- /* Notify the requesting window that the operation is complete */
- iReturn = XSendEvent (pDisplay,
- eventSelection.requestor,
- False,
- 0L,
- (XEvent *) &eventSelection);
- if (iReturn == BadValue || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "XSendEvent () failed\n");
- pthread_exit (NULL);
- }
-
- break;
- }
-
- /* Handle targets type of request */
- if (event.xselectionrequest.target == atomTargets)
- {
- Atom atomTargetArr[4] = {atomTargets,
- atomCompoundText,
- atomUTF8String,
- XA_STRING};
-
- /* Try to change the property */
- iReturn = XChangeProperty (pDisplay,
- event.xselectionrequest.requestor,
- event.xselectionrequest.property,
- event.xselectionrequest.target,
- 8,
- PropModeReplace,
- (char *) atomTargetArr,
- sizeof (atomTargetArr));
- if (iReturn == BadAlloc
- || iReturn == BadAtom
- || iReturn == BadMatch
- || iReturn == BadValue
- || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "XChangeProperty failed: %d\n",
- iReturn);
- }
-
- /* Setup selection notify xevent */
- eventSelection.type = SelectionNotify;
- eventSelection.send_event = True;
- eventSelection.display = pDisplay;
- eventSelection.requestor = event.xselectionrequest.requestor;
- eventSelection.selection = event.xselectionrequest.selection;
- eventSelection.target = event.xselectionrequest.target;
- eventSelection.property = event.xselectionrequest.property;
- eventSelection.time = event.xselectionrequest.time;
-
- /*
- * Notify the requesting window that
- * the operation has completed
- */
- iReturn = XSendEvent (pDisplay,
- eventSelection.requestor,
- False,
- 0L,
- (XEvent *) &eventSelection);
- if (iReturn == BadValue || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "XSendEvent () failed\n");
- }
- break;
- }
-
- /* Access the clipboard */
- if (!OpenClipboard (hwnd))
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "OpenClipboard () failed: %08x\n",
- GetLastError ());
- pthread_exit (NULL);
- }
-
- /* Setup the string style */
- if (event.xselectionrequest.target == XA_STRING)
- xiccesStyle = XStringStyle;
- else if (event.xselectionrequest.target == atomUTF8String)
- xiccesStyle = XUTF8StringStyle;
- else if (event.xselectionrequest.target == atomCompoundText)
- xiccesStyle = XCompoundTextStyle;
- else
- xiccesStyle = XStringStyle;
-
- /*
- * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
- */
-
- /* Get a pointer to the clipboard text */
- if (fUnicodeSupport)
- hGlobal = GetClipboardData (CF_UNICODETEXT);
- else
- hGlobal = GetClipboardData (CF_TEXT);
- if (!hGlobal)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "GetClipboardData () failed: %08x\n",
- GetLastError ());
- pthread_exit (NULL);
- }
- pszGlobalData = (char *) GlobalLock (hGlobal);
-
- /* Convert the Unicode string to UTF8 (MBCS) */
- if (fUnicodeSupport)
- {
- iUTF8 = WideCharToMultiByte (CP_UTF8,
- 0,
- (LPCWSTR)pszGlobalData,
- -1,
- NULL,
- 0,
- NULL,
- NULL);
- pszUTF8 = (char *) malloc (iUTF8); /* Don't need +1 */
- WideCharToMultiByte (CP_UTF8,
- 0,
- (LPCWSTR)pszGlobalData,
- -1,
- pszUTF8,
- iUTF8,
- NULL,
- NULL);
- }
-
- /* Convert DOS string to UNIX string */
- if (fUnicodeSupport)
- {
- winClipboardDOStoUNIX (pszUTF8, strlen (pszUTF8));
-
- /* Setup our text list */
- pszTextList[0] = pszUTF8;
- pszTextList[1] = NULL;
-
- /* Initialize the text property */
- xtpText.value = NULL;
-
- /* Create the text property from the text list */
- iReturn = Xutf8TextListToTextProperty (pDisplay,
- pszTextList,
- 1,
- xiccesStyle,
- &xtpText);
- if (iReturn == XNoMemory || iReturn == XLocaleNotSupported)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "Xutf8TextListToTextProperty failed: %d\n",
- iReturn);
- exit(1);
- }
-
- /* Free the UTF8 string */
- free (pszUTF8);
- }
- else
- winClipboardDOStoUNIX (pszGlobalData, strlen (pszGlobalData));
-
- /*
- * FIXME: Pass pszGlobalData and strlen (pszGlobalData(
- * on 1 byte, pass xtpText.value and xtpText.nitems
- * on 2 byte.
- */
-
- /* Copy the clipboard text to the requesting window */
- if (fUnicodeSupport)
- iReturn = XChangeProperty (pDisplay,
- event.xselectionrequest.requestor,
- event.xselectionrequest.property,
- event.xselectionrequest.target,
- 8,
- PropModeReplace,
- xtpText.value,
- xtpText.nitems);
- else
- iReturn = XChangeProperty (pDisplay,
- event.xselectionrequest.requestor,
- event.xselectionrequest.property,
- event.xselectionrequest.target,
- 8,
- PropModeReplace,
- pszGlobalData,
- strlen (pszGlobalData));
- if (iReturn == BadAlloc || iReturn == BadAtom
- || iReturn == BadMatch || iReturn == BadValue
- || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "XChangeProperty failed: %d\n",
- iReturn);
- pthread_exit (NULL);
- }
-
- /* Release the clipboard data */
- GlobalUnlock (hGlobal);
- pszGlobalData = NULL;
- CloseClipboard ();
-
- /* FIXME: Don't clean up on 1 byte. */
- if (fUnicodeSupport)
- {
- XFree (xtpText.value);
- xtpText.value = NULL;
- }
-
- /* Setup selection notify event */
- eventSelection.type = SelectionNotify;
- eventSelection.send_event = True;
- eventSelection.display = pDisplay;
- eventSelection.requestor = event.xselectionrequest.requestor;
- eventSelection.selection = event.xselectionrequest.selection;
- eventSelection.target = event.xselectionrequest.target;
- eventSelection.property = event.xselectionrequest.property;
- eventSelection.time = event.xselectionrequest.time;
-
- /* Notify the requesting window that the operation has completed */
- iReturn = XSendEvent (pDisplay,
- eventSelection.requestor,
- False,
- 0L,
- (XEvent *) &eventSelection);
- if (iReturn == BadValue || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "XSendEvent () failed\n");
- pthread_exit (NULL);
- }
- break;
-
-
- /*
- * SelectionNotify
- */
-
- case SelectionNotify:
-#if 0
- ErrorF ("SelectionNotify\n");
-#endif
- {
- char *pszAtomName;
-
- pszAtomName = XGetAtomName (pDisplay,
- event.xselection.selection);
-
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n",
- pszAtomName);
-
- XFree (pszAtomName);
- }
-
-#if 0
- /*
- * TEMP: Bail if selection is anything other than CLIPBOARD
- */
-
- if (event.xselection.selection != atomClipboard)
- break;
-#endif
-
- /*
- *
- * What are we doing here?
- *
- */
- if (fUnicodeSupport)
- {
- if (event.xselection.property == None)
- {
- if(event.xselection.target == XA_STRING)
- {
-#if 0
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "XA_STRING\n");
-#endif
- return fReturn;
- }
- else if (event.xselection.target == atomUTF8String)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify "
- "UTF8\n");
- iReturn = XConvertSelection (pDisplay,
- event.xselection.selection,
- XA_STRING,
- atomLocalProperty,
- iWindow,
- CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify "
- "- XConvertSelection () failed\n");
- pthread_exit (NULL);
- }
- return fReturn;
- }
- else if (event.xselection.target == atomCompoundText)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify "
- "CompoundText\n");
- iReturn = XConvertSelection (pDisplay,
- event.xselection.selection,
- atomUTF8String,
- atomLocalProperty,
- iWindow,
- CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify "
- "- XConvertSelection () failed\n");
- pthread_exit (NULL);
- }
- return fReturn;
- }
- else
- {
- ErrorF ("winClipboardFlushXEvents - Unknown format\n");
- return fReturn;
- }
- }
- }
-
- /* Retrieve the size of the stored data */
- if (fUnicodeSupport)
- iReturn = XGetWindowProperty (pDisplay,
- iWindow,
- atomLocalProperty,
- 0,
- 0, /* Don't get data, just size */
- False,
- AnyPropertyType,
- &xtpText.encoding,
- &xtpText.format,
- &xtpText.nitems,
- &ulReturnBytesLeft,
- &xtpText.value);
- else
- iReturn = XGetWindowProperty (pDisplay,
- iWindow,
- atomLocalProperty,
- 0,
- 0, /* Don't get data, just size */
- False,
- AnyPropertyType,
- &atomReturnType,
- &iReturnFormat,
- &ulReturnItems,
- &ulReturnBytesLeft,
- &pszReturnData);
- if (iReturn != Success)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "XGetWindowProperty () failed\n");
- pthread_exit (NULL);
- }
-
-#if 0
- if (fUnicodeSupport)
- ErrorF ("SelectionNotify - returned data %d left %d\n",
- xtpText.nitems, ulReturnBytesLeft);
- else
- ErrorF ("SelectionNotify - returned data %d left %d\n",
- ulReturnItems, ulReturnBytesLeft);
-#endif
-
- /* Request the selection data */
- if (fUnicodeSupport)
- iReturn = XGetWindowProperty (pDisplay,
- iWindow,
- atomLocalProperty,
- 0,
- ulReturnBytesLeft,
- False,
- AnyPropertyType,
- &xtpText.encoding,
- &xtpText.format,
- &xtpText.nitems,
- &ulReturnBytesLeft,
- &xtpText.value);
- else
- iReturn = XGetWindowProperty (pDisplay,
- iWindow,
- atomLocalProperty,
- 0,
- ulReturnBytesLeft,
- False,
- AnyPropertyType,
- &atomReturnType,
- &iReturnFormat,
- &ulReturnItems,
- &ulReturnBytesLeft,
- &pszReturnData);
- if (iReturn != Success)
- {
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "XGetWindowProperty () failed\n");
- pthread_exit (NULL);
- }
-
- if (fUnicodeSupport)
- {
-#if 0
- char *pszAtomName = NULL;
-
- ErrorF ("SelectionNotify - returned data %d left %d\n",
- prop.nitems, ulReturnBytesLeft);
-
- pszAtomName = XGetAtomName(pDisplay, prop.encoding);
- ErrorF ("Notify atom name %s\n", pszAtomName);
- XFree (pszAtomName);
- pszAtomName = NULL;
-#endif
-
- /* Convert the text property to a text list */
- Xutf8TextPropertyToTextList (pDisplay,
- &xtpText,
- &ppszTextList,
- &iCount);
- if (iCount > 0)
- {
- pszReturnData = malloc (strlen (ppszTextList[0]) + 1);
- strcpy (pszReturnData, ppszTextList[0]);
- }
- else
- {
- pszReturnData = malloc (1);
- pszReturnData[0] = 0;
- }
-
- /* Free the data returned from XGetWindowProperty */
- XFreeStringList (ppszTextList);
- XFree (xtpText.value);
- }
-
- /* Convert the X clipboard string to DOS format */
- winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
-
- if (fUnicodeSupport)
- {
- /* Find out how much space needed to convert MBCS to Unicode */
- iUnicodeLen = MultiByteToWideChar (CP_UTF8,
- 0,
- pszReturnData,
- -1,
- NULL,
- 0);
-
- /* Allocate memory for the Unicode string */
- pwszUnicodeStr
- = (wchar_t*) malloc (sizeof (wchar_t) * (iUnicodeLen + 1));
-
- /* Do the actual conversion */
- MultiByteToWideChar (CP_UTF8,
- 0,
- pszReturnData,
- -1,
- pwszUnicodeStr,
- iUnicodeLen);
- }
-
- /* Access the Windows clipboard */
- if (!OpenClipboard (hwnd))
- {
- ErrorF ("winClipboardFlushXEvents - OpenClipboard () failed: "
- "%08x\n", GetLastError ());
- pthread_exit (NULL);
- }
-
- /* Take ownership of the Window clipboard */
- if (!EmptyClipboard ())
- {
- ErrorF ("winClipboardFlushXEvents - EmptyClipboard () failed: "
- "%08x\n", GetLastError ());
- pthread_exit (NULL);
- }
-
- /* Allocate global memory for the X clipboard data */
- if (fUnicodeSupport)
- hGlobal = GlobalAlloc (GMEM_MOVEABLE,
- sizeof (wchar_t) * (iUnicodeLen + 1));
- else
- hGlobal = GlobalAlloc (GMEM_MOVEABLE, strlen (pszReturnData) + 1);
-
- /* Obtain a pointer to the global memory */
- pszGlobalData = GlobalLock (hGlobal);
- if (pszGlobalData == NULL)
- {
- ErrorF ("winClipboardFlushXEvents - Could not lock global "
- "memory for clipboard transfer\n");
- pthread_exit (NULL);
- }
-
- /* Copy the returned string into the global memory */
- if (fUnicodeSupport)
- memcpy (pszGlobalData,
- pwszUnicodeStr,
- sizeof (wchar_t) * (iUnicodeLen + 1));
- else
- strcpy (pszGlobalData, pszReturnData);
-
- /* Free the data returned from XGetWindowProperty */
- if (fUnicodeSupport)
- {
- free (pwszUnicodeStr);
- pwszUnicodeStr = NULL;
- }
- else
- {
- XFree (pszReturnData);
- pszReturnData = NULL;
- }
-
- /* Release the pointer to the global memory */
- GlobalUnlock (hGlobal);
- pszGlobalData = NULL;
-
- /* Push the selection data to the Windows clipboard */
- if (fUnicodeSupport)
- SetClipboardData (CF_UNICODETEXT, hGlobal);
- else
- SetClipboardData (CF_TEXT, hGlobal);
-
- /*
- * NOTE: Do not try to free pszGlobalData, it is owned by
- * Windows after the call to SetClipboardData ().
- */
-
- /* Release the clipboard */
- if (!CloseClipboard ())
- {
- ErrorF ("winClipboardFlushXEvents - CloseClipboard () failed: "
- "%08x\n",
- GetLastError ());
- pthread_exit (NULL);
- }
-
- /* Reassert ownership of the selection */
- iReturn = XSetSelectionOwner (pDisplay,
- event.xselection.selection,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- char *pszAtomName = NULL;
-
- pszAtomName = XGetAtomName (pDisplay,
- event.xselection.selection);
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "Could not reassert ownership of selection ATOM: %s\n",
- pszAtomName);
- XFree (pszAtomName);
- pszAtomName = NULL;
- pthread_exit (NULL);
- }
- else
- {
-#if 0
- char *pszAtomName = NULL;
-
- pszAtomName = XGetAtomName (pDisplay,
- event.xselection.selection);
- ErrorF ("SelectionNotify - Reasserted ownership of ATOM: %s\n",
- pszAtomName);
- XFree (pszAtomName);
- pszAtomName = NULL;
-#endif
- }
-#if 0
- /* Reassert ownership of the CLIPBOARD */
- iReturn = XSetSelectionOwner (pDisplay,
- atomClipboard,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
- {
- ErrorF ("winClipboardFlushXEvents - Could not reassert "
- "ownership of selection\n");
- pthread_exit (NULL);
- }
-#endif
- break;
-
-#if 0
- case CreateNotify:
- ErrorF ("FlushXEvents - CreateNotify parent: %ld\twindow: %ld\n",
- event.xcreatewindow.parent, event.xcreatewindow.window);
- break;
-
- case DestroyNotify:
- ErrorF ("FlushXEvents - DestroyNotify window: %ld\tevent: %ld\n",
- event.xdestroywindow.window, event.xdestroywindow.event);
- break;
-#endif
-
- default:
- break;
- }
- }
-
- return fReturn;
-}
diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c
deleted file mode 100644
index 4fb89a2fd..000000000
--- a/hw/xwin/wincmap.c
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.10 2002/10/17 08:18:22 alanh Exp $ */
-
-#include "win.h"
-
-
-/* See Porting Layer Definition - p. 30 */
-/*
- * Walk the list of installed colormaps, filling the pmaps list
- * with the resource ids of the installed maps, and return
- * a count of the total number of installed maps.
- */
-int
-winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps)
-{
- winScreenPriv(pScreen);
-
- /*
- * There will only be one installed colormap, so we only need
- * to return one id, and the count of installed maps will always
- * be one.
- */
- *pmaps = pScreenPriv->pcmapInstalled->mid;
- return 1;
-}
-
-
-/* See Porting Layer Definition - p. 30 */
-/* See Programming Windows - p. 663 */
-void
-winInstallColormap (ColormapPtr pColormap)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- ColormapPtr oldpmap = pScreenPriv->pcmapInstalled;
-
-#if CYGDEBUG
- ErrorF ("winInstallColormap\n");
-#endif
-
- /* Did the colormap actually change? */
- if (pColormap != oldpmap)
- {
-#if CYGDEBUG
- ErrorF ("winInstallColormap - Colormap has changed, attempt "
- "to install.\n");
-#endif
-
- /* Was there a previous colormap? */
- if (oldpmap != (ColormapPtr) None)
- {
- /* There was a previous colormap; tell clients it is gone */
- WalkTree (pColormap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- }
-
- /* Install new colormap */
- pScreenPriv->pcmapInstalled = pColormap;
- WalkTree (pColormap->pScreen, TellGainedMap, (char *)&pColormap->mid);
-
- /* Call the engine specific colormap install procedure */
- if (!((*pScreenPriv->pwinInstallColormap) (pColormap)))
- {
- ErrorF ("winInstallColormap - Screen specific colormap install "
- "procedure failed. Continuing, but colors may be "
- "messed up from now on.\n");
- }
- }
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-}
-
-
-/* See Porting Layer Definition - p. 30 */
-void
-winUninstallColormap (ColormapPtr pmap)
-{
- winScreenPriv(pmap->pScreen);
- ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
-
-#if CYGDEBUG
- ErrorF ("winUninstallColormap\n");
-#endif
-
- /* Is the colormap currently installed? */
- if (pmap != curpmap)
- {
- /* Colormap not installed, nothing to do */
- return;
- }
-
- /* Clear the installed colormap flag */
- pScreenPriv->pcmapInstalled = NULL;
-
- /*
- * NOTE: The default colormap does not get "uninstalled" before
- * it is destroyed.
- */
-
- /* Install the default cmap in place of the cmap to be uninstalled */
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pmap->pScreen->InstallColormap) (curpmap);
- }
-}
-
-
-/* See Porting Layer Definition - p. 30 */
-void
-winStoreColors (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pmap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pmap);
- int i;
- unsigned short nRed, nGreen, nBlue;
-
-#if CYGDEBUG
- if (ndef != 1)
- ErrorF ("winStoreColors - ndef: %d\n",
- ndef);
-#endif
-
- /* Save the new colors in the colormap privates */
- for (i = 0; i < ndef; ++i)
- {
- /* Adjust the colors from the X color spec to the Windows color spec */
- nRed = pdefs[i].red >> 8;
- nGreen = pdefs[i].green >> 8;
- nBlue = pdefs[i].blue >> 8;
-
- /* Copy the colors to a palette entry table */
- pCmapPriv->peColors[pdefs[0].pixel + i].peRed = nRed;
- pCmapPriv->peColors[pdefs[0].pixel + i].peGreen = nGreen;
- pCmapPriv->peColors[pdefs[0].pixel + i].peBlue = nBlue;
-
- /* Copy the colors to a RGBQUAD table */
- pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbRed = nRed;
- pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbGreen = nGreen;
- pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbBlue = nBlue;
-
-#if CYGDEBUG
- ErrorF ("winStoreColors - nRed %d nGreen %d nBlue %d\n",
- nRed, nGreen, nBlue);
-#endif
- }
-
- /* Call the engine specific store colors procedure */
- if (!((pScreenPriv->pwinStoreColors) (pmap, ndef, pdefs)))
- {
- ErrorF ("winStoreColors - Engine cpecific color storage procedure "
- "failed. Continuing, but colors may be messed up from now "
- "on.\n");
- }
-}
-
-
-/* See Porting Layer Definition - p. 30 */
-void
-winResolveColor (unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
-#if CYGDEBUG
- ErrorF ("winResolveColor ()\n");
-#endif
-
- miResolveColor (pred, pgreen, pblue, pVisual);
-}
-
-
-/* See Porting Layer Definition - p. 29 */
-Bool
-winCreateColormap (ColormapPtr pmap)
-{
- winPrivCmapPtr pCmapPriv = NULL;
- ScreenPtr pScreen = pmap->pScreen;
- winScreenPriv(pScreen);
-
-#if CYGDEBUG
- ErrorF ("winCreateColormap\n");
-#endif
-
- /* Allocate colormap privates */
- if (!winAllocateCmapPrivates (pmap))
- {
- ErrorF ("winCreateColorma - Couldn't allocate cmap privates\n");
- return FALSE;
- }
-
- /* Get a pointer to the newly allocated privates */
- pCmapPriv = winGetCmapPriv (pmap);
-
- /*
- * FIXME: This is some evil hackery to help in handling some X clients
- * that expect the top pixel to be white. This "help" only lasts until
- * some client overwrites the top colormap entry.
- *
- * We don't want to actually allocate the top entry, as that causes
- * problems with X clients that need 7 planes (128 colors) in the default
- * colormap, such as Magic 7.1.
- */
- pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbRed = 255;
- pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbGreen = 255;
- pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbBlue = 255;
- pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peRed = 255;
- pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peGreen = 255;
- pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peBlue = 255;
-
- /* Call the engine specific colormap initialization procedure */
- if (!((*pScreenPriv->pwinCreateColormap) (pmap)))
- {
- ErrorF ("winCreateColormap - Engine specific colormap creation "
- "procedure failed. Aborting.\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 29, 30 */
-void
-winDestroyColormap (ColormapPtr pColormap)
-{
- winScreenPriv(pColormap->pScreen);
- winCmapPriv(pColormap);
-
- /* Call the engine specific colormap destruction procedure */
- if (!((*pScreenPriv->pwinDestroyColormap) (pColormap)))
- {
- ErrorF ("winDestroyColormap - Engine specific colormap destruction "
- "procedure failed. Continuing, but it is possible that memory "
- "was leaked, or that colors will be messed up from now on.\n");
- }
-
- /* Free the colormap privates */
- free (pCmapPriv);
- winSetCmapPriv (pColormap, NULL);
-
-#if CYGDEBUG
- ErrorF ("winDestroyColormap - Returning\n");
-#endif
-}
-
-
-int
-winExpandDirectColors (ColormapPtr pmap, int ndef,
- xColorItem *indefs, xColorItem *outdefs)
-{
- ErrorF ("\nwinExpandDirectColors\n");
- return miExpandDirectColors (pmap, ndef, indefs, outdefs);
-}
-
-
-/*
- * Internal function to load the palette used by the Shadow DIB
- */
-
-static
-Bool
-winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap)
-{
- winScreenPriv(pScreen);
- int i;
- Pixel pixel; /* Pixel == CARD32 */
- CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
- UINT uiColorsRetrieved = 0;
- RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
-
- /* Get the color table for the screen */
- uiColorsRetrieved = GetDIBColorTable (pScreenPriv->hdcScreen,
- 0,
- WIN_NUM_PALETTE_ENTRIES,
- rgbColors);
- if (uiColorsRetrieved == 0)
- {
- ErrorF ("winGetPaletteDIB - Could not retrieve screen color table\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winGetPaletteDIB - Retrieved %d colors from DIB\n",
- uiColorsRetrieved);
-#endif
-
- /* Set the DIB color table to the default screen palette */
- if (SetDIBColorTable (pScreenPriv->hdcShadow,
- 0,
- uiColorsRetrieved,
- rgbColors) == 0)
- {
- ErrorF ("winGetPaletteDIB - SetDIBColorTable () failed\n");
- return FALSE;
- }
-
- /* Alloc each color in the DIB color table */
- for (i = 0; i < uiColorsRetrieved; ++i)
- {
- pixel = i;
-
- /* Extract the color values for current palette entry */
- nRed = rgbColors[i].rgbRed << 8;
- nGreen = rgbColors[i].rgbGreen << 8;
- nBlue = rgbColors[i].rgbBlue << 8;
-
-#if CYGDEBUG
- ErrorF ("winGetPaletteDIB - Allocating a color: %d; "
- "%d %d %d\n",
- pixel, nRed, nGreen, nBlue);
-#endif
-
- /* Allocate a entry in the X colormap */
- if (AllocColor (pcmap,
- &nRed,
- &nGreen,
- &nBlue,
- &pixel,
- 0) != Success)
- {
- ErrorF ("winGetPaletteDIB - AllocColor () failed, pixel %d\n",
- i);
- return FALSE;
- }
-
- if (i != pixel
- || nRed != rgbColors[i].rgbRed
- || nGreen != rgbColors[i].rgbGreen
- || nBlue != rgbColors[i].rgbBlue)
- {
- ErrorF ("winGetPaletteDIB - Got: %d; "
- "%d %d %d\n",
- pixel, nRed, nGreen, nBlue);
- }
-
- /* FIXME: Not sure that this bit is needed at all */
- pcmap->red[i].co.local.red = nRed;
- pcmap->red[i].co.local.green = nGreen;
- pcmap->red[i].co.local.blue = nBlue;
- }
-
- /* System is using a colormap */
- /* Set the black and white pixel indices */
- pScreen->whitePixel = uiColorsRetrieved - 1;
- pScreen->blackPixel = 0;
-
- return TRUE;
-}
-
-
-/*
- * Internal function to load the standard system palette being used by GDI
- */
-
-static
-Bool
-winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap)
-{
- int i;
- Pixel pixel; /* Pixel == CARD32 */
- CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
- UINT uiSystemPaletteEntries;
- LPPALETTEENTRY ppeColors = NULL;
- HDC hdc = NULL;
-
- /* Get a DC to obtain the default palette */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winGetPaletteDD - Couldn't get a DC\n");
- return FALSE;
- }
-
- /* Get the number of entries in the system palette */
- uiSystemPaletteEntries = GetSystemPaletteEntries (hdc,
- 0, 0, NULL);
- if (uiSystemPaletteEntries == 0)
- {
- ErrorF ("winGetPaletteDD - Unable to determine number of "
- "system palette entries\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winGetPaletteDD - uiSystemPaletteEntries %d\n",
- uiSystemPaletteEntries);
-#endif
-
- /* Allocate palette entries structure */
- ppeColors = malloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY));
- if (ppeColors == NULL)
- {
- ErrorF ("winGetPaletteDD - malloc () for colormap failed\n");
- return FALSE;
- }
-
- /* Get system palette entries */
- GetSystemPaletteEntries (hdc,
- 0, uiSystemPaletteEntries, ppeColors);
-
- /* Allocate an X colormap entry for every system palette entry */
- for (i = 0; i < uiSystemPaletteEntries; ++i)
- {
- pixel = i;
-
- /* Extract the color values for current palette entry */
- nRed = ppeColors[i].peRed << 8;
- nGreen = ppeColors[i].peGreen << 8;
- nBlue = ppeColors[i].peBlue << 8;
-#if CYGDEBUG
- ErrorF ("winGetPaletteDD - Allocating a color: %d; "
- "%d %d %d\n",
- pixel, nRed, nGreen, nBlue);
-#endif
- if (AllocColor (pcmap,
- &nRed,
- &nGreen,
- &nBlue,
- &pixel,
- 0) != Success)
- {
- ErrorF ("winGetPaletteDD - AllocColor () failed, pixel %d\n",
- i);
- free (ppeColors);
- ppeColors = NULL;
- return FALSE;
- }
-
- pcmap->red[i].co.local.red = nRed;
- pcmap->red[i].co.local.green = nGreen;
- pcmap->red[i].co.local.blue = nBlue;
- }
-
- /* System is using a colormap */
- /* Set the black and white pixel indices */
- pScreen->whitePixel = uiSystemPaletteEntries - 1;
- pScreen->blackPixel = 0;
-
- /* Free colormap */
- if (ppeColors != NULL)
- {
- free (ppeColors);
- ppeColors = NULL;
- }
-
- /* Free the DC */
- if (hdc != NULL)
- {
- ReleaseDC (NULL, hdc);
- hdc = NULL;
- }
-
- return TRUE;
-}
-
-
-/*
- * Install the standard fb colormap, or the GDI colormap,
- * depending on the current screen depth.
- */
-
-Bool
-winCreateDefColormap (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- unsigned short zero = 0, ones = 0xFFFF;
- VisualPtr pVisual = pScreenPriv->pRootVisual;
- ColormapPtr pcmap = NULL;
- Pixel wp, bp;
-
-#if CYGDEBUG
- ErrorF ("winCreateDefColormap\n");
-#endif
-
- /* Use standard fb colormaps for non palettized color modes */
- if (pScreenInfo->dwBPP > 8)
- {
- ErrorF ("winCreateDefColormap - Deferring to " \
- "fbCreateDefColormap ()\n");
- return fbCreateDefColormap (pScreen);
- }
-
- /*
- * AllocAll for non-Dynamic visual classes,
- * AllocNone for Dynamic visual classes.
- */
-
- /*
- * Dynamic visual classes allow the colors of the color map
- * to be changed by clients.
- */
-
-#if CYGDEBUG
- ErrorF ("winCreateDefColormap - defColormap: %d\n",
- pScreen->defColormap);
-#endif
-
- /* Allocate an X colormap, owned by client 0 */
- if (CreateColormap (pScreen->defColormap,
- pScreen,
- pVisual,
- &pcmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
- 0) != Success)
- {
- ErrorF ("winCreateDefColormap - CreateColormap failed\n");
- return FALSE;
- }
- if (pcmap == NULL)
- {
- ErrorF ("winCreateDefColormap - Colormap could not be created\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winCreateDefColormap - Created a colormap\n");
-#endif
-
- /* Branch on the visual class */
- if (!(pVisual->class & DynamicClass))
- {
- /* Branch on engine type */
- if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI)
- {
- /* Load the colors being used by the Shadow DIB */
- if (!winGetPaletteDIB (pScreen, pcmap))
- {
- ErrorF ("winCreateDefColormap - Couldn't get DIB colors\n");
- return FALSE;
- }
- }
- else
- {
- /* Load the colors from the default system palette */
- if (!winGetPaletteDD (pScreen, pcmap))
- {
- ErrorF ("winCreateDefColormap - Couldn't get colors "
- "for DD\n");
- return FALSE;
- }
- }
- }
- else
- {
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
-
- /* Allocate a black and white pixel */
- if ((AllocColor (pcmap, &ones, &ones, &ones, &wp, 0) !=
- Success)
- ||
- (AllocColor (pcmap, &zero, &zero, &zero, &bp, 0) !=
- Success))
- {
- ErrorF ("winCreateDefColormap - Couldn't allocate bp or wp\n");
- return FALSE;
- }
-
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
-
-#if 0
- /* Have to reserve first 10 and last ten pixels in DirectDraw windowed */
- if (pScreenInfo->dwEngine != WIN_SERVER_SHADOW_GDI)
- {
- int k;
- Pixel p;
-
- for (k = 1; k < 10; ++k)
- {
- p = k;
- if (AllocColor (pcmap, &ones, &ones, &ones, &p, 0) != Success)
- FatalError ("Foo!\n");
- }
-
- for (k = 245; k < 255; ++k)
- {
- p = k;
- if (AllocColor (pcmap, &zero, &zero, &zero, &p, 0) != Success)
- FatalError ("Baz!\n");
- }
- }
-#endif
- }
-
- /* Install the created colormap */
- (*pScreen->InstallColormap)(pcmap);
-
-#if CYGDEBUG
- ErrorF ("winCreateDefColormap - Returning\n");
-#endif
-
- return TRUE;
-}
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
deleted file mode 100644
index b42b1d6bf..000000000
--- a/hw/xwin/winconfig.c
+++ /dev/null
@@ -1,1014 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Alexander Gottwald
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.c,v 1.4 2003/10/08 11:13:02 eich Exp $ */
-
-#include "win.h"
-#include "winconfig.h"
-#include "winmsg.h"
-#include "globals.h"
-
-#ifdef XKB
-#define XKB_IN_SERVER
-#include "XKBsrv.h"
-#endif
-
-#ifndef CONFIGPATH
-#define CONFIGPATH "%A," "%R," \
- "/etc/X11/%R," "%P/etc/X11/%R," \
- "%E," "%F," \
- "/etc/X11/%F," "%P/etc/X11/%F," \
- "%D/%X," \
- "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
- "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
- "%P/etc/X11/%X," \
- "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
- "%P/lib/X11/%X"
-#endif
-
-XF86ConfigPtr g_xf86configptr = NULL;
-WinCmdlineRec g_cmdline = {
- NULL, /* configFile */
- NULL, /* fontPath */
- NULL, /* rgbPath */
- NULL, /* keyboard */
-#ifdef XKB
- FALSE, /* noXkbExtension */
- NULL, /* xkbMap */
-#endif
- NULL, /* screenname */
- NULL, /* mousename */
- FALSE, /* emulate3Buttons */
- 0 /* emulate3Timeout */
-};
-
-winInfoRec g_winInfo = {
- { /* keyboard */
- 0, /* leds */
- 500, /* delay */
- 30 /* rate */
-#ifdef XKB
- }
- ,
- { /* xkb */
- FALSE, /* disable */
- NULL, /* rules */
- NULL, /* model */
- NULL, /* layout */
- NULL, /* variant */
- NULL, /* options */
- NULL, /* initialMap */
- NULL, /* keymap */
- NULL, /* types */
- NULL, /* compat */
- NULL, /* keycodes */
- NULL, /* symbols */
- NULL /* geometry */
-#endif
- }
- ,
- {
- FALSE,
- 50}
-};
-
-serverLayoutRec g_winConfigLayout;
-
-static Bool ParseOptionValue (int scrnIndex, pointer options,
- OptionInfoPtr p);
-static Bool configLayout (serverLayoutPtr, XF86ConfLayoutPtr, char *);
-static Bool configImpliedLayout (serverLayoutPtr, XF86ConfScreenPtr);
-static Bool GetBoolValue (OptionInfoPtr p, const char *s);
-
-#define NULL_IF_EMPTY(x) (winNameCompare(x,"")?x:NULL)
-
-
-Bool
-winReadConfigfile ()
-{
- Bool retval = TRUE;
- const char *filename;
- MessageType from = X_DEFAULT;
- char *xf86ConfigFile = NULL;
-
- if (g_cmdline.configFile)
- {
- from = X_CMDLINE;
- xf86ConfigFile = g_cmdline.configFile;
- }
-
- /* Parse config file into data structure */
-
- filename = xf86openConfigFile (CONFIGPATH, xf86ConfigFile, PROJECTROOT);
- if (filename)
- {
- winMsg (from, "Using config file: \"%s\"\n", filename);
- }
- else
- {
- winMsg (X_ERROR, "Unable to locate/open config file");
- if (xf86ConfigFile)
- ErrorF (": \"%s\"", xf86ConfigFile);
- ErrorF ("\n");
- return FALSE;
- }
- if ((g_xf86configptr = xf86readConfigFile ()) == NULL)
- {
- winMsg (X_ERROR, "Problem parsing the config file\n");
- return FALSE;
- }
- xf86closeConfigFile ();
-
- LogPrintMarkers();
-
- /* set options from data structure */
-
- if (g_xf86configptr->conf_layout_lst == NULL || g_cmdline.screenname != NULL)
- {
- if (g_cmdline.screenname == NULL)
- {
- winMsg (X_WARNING,
- "No Layout section. Using the first Screen section.\n");
- }
- if (!configImpliedLayout (&g_winConfigLayout,
- g_xf86configptr->conf_screen_lst))
- {
- winMsg (X_ERROR, "Unable to determine the screen layout\n");
- return FALSE;
- }
- }
- else
- {
- /* Check if layout is given in the config file */
- if (g_xf86configptr->conf_flags != NULL)
- {
- char *dfltlayout = NULL;
- pointer optlist = g_xf86configptr->conf_flags->flg_option_lst;
-
- if (optlist && winFindOption (optlist, "defaultserverlayout"))
- dfltlayout =
- winSetStrOption (optlist, "defaultserverlayout", NULL);
-
- if (!configLayout (&g_winConfigLayout,
- g_xf86configptr->conf_layout_lst,
- dfltlayout))
- {
- winMsg (X_ERROR, "Unable to determine the screen layout\n");
- return FALSE;
- }
- }
- else
- {
- if (!configLayout (&g_winConfigLayout,
- g_xf86configptr->conf_layout_lst,
- NULL))
- {
- winMsg (X_ERROR, "Unable to determin the screen layout\n");
- return FALSE;
- }
- }
- }
-
- /* setup special config files */
- winConfigFiles ();
- return retval;
-}
-
-
-/* Set the keyboard configuration */
-
-typedef struct {
- unsigned int winlayout;
- int winkbtype;
- char *xkbmodel;
- char *xkblayout;
- char *xkbvariant;
- char *xkboptions;
- char *layoutname;
-} WinKBLayoutRec, *WinKBLayoutPtr;
-
-WinKBLayoutRec winKBLayouts[] = {
- { 0x405, -1, "pc105", "cz", NULL, NULL, "Czech"},
- { 0x406, -1, "pc105", "dk", NULL, NULL, "Danish"},
- { 0x407, -1, "pc105", "de", NULL, NULL, "German (Germany)"},
- {0x10407, -1, "pc105", "de", NULL, NULL, "German (Germany, IBM)"},
- { 0x807, -1, "pc105", "de_CH", NULL, NULL, "German (Switzerland)"},
- {0x10409, -1, "pc105", "dvorak", NULL, NULL, "English (USA, Dvorak)"},
- {0x20409, -1, "pc105", "us_intl", NULL, NULL, "English (USA, International)"},
- { 0x809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"},
- { 0x40a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain, Traditional Sort)"},
- { 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"},
- { 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
- { 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
- { 0x410, -1, "pc105", "it", NULL, NULL, "Italian"},
- { 0x411, -1, "jp", "jp", NULL, NULL, "Japanese"},
- { 0x414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
- { 0x416, -1, "pc105", "pt", NULL, NULL, "Portuguese (Brazil, ABNT)"},
- {0x10416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil, ABNT2)"},
- { 0x816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"},
- { 0x41d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"},
- { -1, -1, NULL, NULL, NULL, NULL, NULL}
-};
-
-
-Bool
-winConfigKeyboard (DeviceIntPtr pDevice)
-{
- char layoutName[KL_NAMELENGTH];
- unsigned int layoutNum;
- int keyboardType;
- XF86ConfInputPtr kbd = NULL;
- XF86ConfInputPtr input_list = NULL;
- MessageType from = X_DEFAULT;
- MessageType kbdfrom = X_CONFIG;
-
- /* Setup defaults */
-#ifdef XKB
- g_winInfo.xkb.disable = FALSE;
-# ifdef PC98 /* japanese */ /* not implemented */
- g_winInfo.xkb.rules = "xfree98";
- g_winInfo.xkb.model = "pc98";
- g_winInfo.xkb.layout = "nex/jp";
- g_winInfo.xkb.variant = NULL;
- g_winInfo.xkb.options = NULL;
-# else
- g_winInfo.xkb.rules = "xfree86";
- g_winInfo.xkb.model = "pc101";
- g_winInfo.xkb.layout = "us";
- g_winInfo.xkb.variant = NULL;
- g_winInfo.xkb.options = NULL;
-# endif /* PC98 */
-
-
-
- keyboardType = GetKeyboardType (0);
- if (keyboardType > 0 && GetKeyboardLayoutName (layoutName))
- {
- WinKBLayoutPtr pLayout;
-
- layoutNum = strtoul (layoutName, (char **)NULL, 16);
- if ((layoutNum & 0xffff) == 0x411) {
- /* The japanese layouts know a lot of different IMEs which all have
- different layout numbers set. Map them to a single entry.
- Same might apply for chinese, korean and other symbol languages
- too */
- layoutNum = (layoutNum & 0xffff);
- }
- winMsg (X_DEFAULT, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
- layoutName, layoutNum);
-
- for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
- {
- if (pLayout->winlayout != layoutNum)
- continue;
- if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
- continue;
-
- winMsg (X_DEFAULT,
- "Using preset keyboard for \"%s\" (%s), type \"%d\"\n",
- pLayout->layoutname, layoutName, keyboardType);
-
- g_winInfo.xkb.model = pLayout->xkbmodel;
- g_winInfo.xkb.layout = pLayout->xkblayout;
- g_winInfo.xkb.variant = pLayout->xkbvariant;
- g_winInfo.xkb.options = pLayout->xkboptions;
- break;
- }
- }
-
- g_winInfo.xkb.initialMap = NULL;
- g_winInfo.xkb.keymap = NULL;
- g_winInfo.xkb.types = NULL;
- g_winInfo.xkb.compat = NULL;
- g_winInfo.xkb.keycodes = NULL;
- g_winInfo.xkb.symbols = NULL;
- g_winInfo.xkb.geometry = NULL;
-#endif /* XKB */
-
- /* parse the configuration */
-
- if (g_cmdline.keyboard)
- kbdfrom = X_CMDLINE;
-
- /*
- * Until the layout code is finished, I search for the keyboard
- * device and configure the server with it.
- */
-
- if (g_xf86configptr != NULL)
- input_list = g_xf86configptr->conf_input_lst;
-
- while (input_list != NULL)
- {
- if (winNameCompare (input_list->inp_driver, "keyboard") == 0)
- {
- /* Check if device name matches requested name */
- if (g_cmdline.keyboard && winNameCompare (input_list->inp_identifier,
- g_cmdline.keyboard))
- continue;
- kbd = input_list;
- }
- input_list = input_list->list.next;
- }
-
- if (kbd != NULL)
- {
- if (kbd->inp_identifier)
- winMsg (kbdfrom, "Using keyboard \"%s\" as primary keyboard\n",
- kbd->inp_identifier);
-
-#ifdef XKB
- from = X_DEFAULT;
- if (g_cmdline.noXkbExtension)
- {
- from = X_CMDLINE;
- g_winInfo.xkb.disable = TRUE;
- }
- else if (kbd->inp_option_lst)
- {
- int b = winSetBoolOption (kbd->inp_option_lst, "XkbDisable", FALSE);
- if (b)
- {
- from = X_CONFIG;
- g_winInfo.xkb.disable = TRUE;
- }
- }
- if (g_winInfo.xkb.disable)
- {
- winMsg (from, "XkbExtension disabled\n");
- }
- else
- {
- char *s;
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL)))
- {
- g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: rules: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL)))
- {
- g_winInfo.xkb.model = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: model: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL)))
- {
- g_winInfo.xkb.layout = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: layout: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL)))
- {
- g_winInfo.xkb.variant = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: variant: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL)))
- {
- g_winInfo.xkb.options = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: options: \"%s\"\n", s);
- }
-
- from = X_CMDLINE;
- if (!XkbInitialMap)
- {
- s =
- winSetStrOption (kbd->inp_option_lst, "XkbInitialMap", NULL);
- if (s)
- {
- XkbInitialMap = NULL_IF_EMPTY (s);
- from = X_CONFIG;
- }
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbKeymap", NULL)))
- {
- g_winInfo.xkb.keymap = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: keymap: \"%s\" "
- " (overrides other XKB settings)\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbCompat", NULL)))
- {
- g_winInfo.xkb.compat = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: compat: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbTypes", NULL)))
- {
- g_winInfo.xkb.types = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: types: \"%s\"\n", s);
- }
-
- if (
- (s =
- winSetStrOption (kbd->inp_option_lst, "XkbKeycodes", NULL)))
- {
- g_winInfo.xkb.keycodes = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: keycodes: \"%s\"\n", s);
- }
-
- if (
- (s =
- winSetStrOption (kbd->inp_option_lst, "XkbGeometry", NULL)))
- {
- g_winInfo.xkb.geometry = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: geometry: \"%s\"\n", s);
- }
-
- if ((s = winSetStrOption (kbd->inp_option_lst, "XkbSymbols", NULL)))
- {
- g_winInfo.xkb.symbols = NULL_IF_EMPTY (s);
- winMsg (X_CONFIG, "XKB: symbols: \"%s\"\n", s);
- }
- }
-#endif
- }
- else
- {
- winMsg (X_ERROR, "No primary keyboard configured\n");
- winMsg (X_DEFAULT, "Using compiletime defaults for keyboard\n");
- }
-
- return TRUE;
-}
-
-
-Bool
-winConfigMouse (DeviceIntPtr pDevice)
-{
- MessageType mousefrom = X_CONFIG;
- XF86ConfInputPtr mouse = NULL;
- XF86ConfInputPtr input_list = NULL;
-
- if (g_cmdline.mouse)
- mousefrom = X_CMDLINE;
-
- if (g_xf86configptr != NULL)
- input_list = g_xf86configptr->conf_input_lst;
-
- while (input_list != NULL)
- {
- if (winNameCompare (input_list->inp_driver, "mouse") == 0)
- {
- /* Check if device name matches requested name */
- if (g_cmdline.mouse && winNameCompare (input_list->inp_identifier,
- g_cmdline.mouse))
- continue;
- mouse = input_list;
- }
- input_list = input_list->list.next;
- }
-
- if (mouse != NULL)
- {
- if (mouse->inp_identifier)
- winMsg (mousefrom, "Using pointer \"%s\" as primary pointer\n",
- mouse->inp_identifier);
-
- g_winInfo.pointer.emulate3Buttons =
- winSetBoolOption (mouse->inp_option_lst, "Emulate3Buttons", FALSE);
- if (g_cmdline.emulate3buttons)
- g_winInfo.pointer.emulate3Buttons = g_cmdline.emulate3buttons;
-
- g_winInfo.pointer.emulate3Timeout =
- winSetIntOption (mouse->inp_option_lst, "Emulate3Timeout", 50);
- if (g_cmdline.emulate3timeout)
- g_winInfo.pointer.emulate3Timeout = g_cmdline.emulate3timeout;
- }
- else
- {
- winMsg (X_ERROR, "No primary pointer configured\n");
- winMsg (X_DEFAULT, "Using compiletime defaults for pointer\n");
- }
-
- return TRUE;
-}
-
-
-Bool
-winConfigFiles ()
-{
- MessageType from;
- XF86ConfFilesPtr filesptr = NULL;
-
- /* set some shortcuts */
- if (g_xf86configptr != NULL)
- {
- filesptr = g_xf86configptr->conf_files;
- }
-
-
- /* Fontpath */
- from = X_DEFAULT;
-
- if (g_cmdline.fontPath)
- {
- from = X_CMDLINE;
- defaultFontPath = g_cmdline.fontPath;
- }
- else if (filesptr != NULL && filesptr->file_fontpath)
- {
- from = X_CONFIG;
- defaultFontPath = xstrdup (filesptr->file_fontpath);
- }
- winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
-
- /* RGBPath */
- from = X_DEFAULT;
- if (g_cmdline.rgbPath)
- {
- from = X_CMDLINE;
- rgbPath = g_cmdline.rgbPath;
- }
- else if (filesptr != NULL && filesptr->file_rgbpath)
- {
- from = X_CONFIG;
- rgbPath = xstrdup (filesptr->file_rgbpath);
- }
- winMsg (from, "RgbPath set to \"%s\"\n", rgbPath);
-
- return TRUE;
-}
-
-
-Bool
-winConfigOptions ()
-{
- return TRUE;
-}
-
-
-Bool
-winConfigScreens ()
-{
- return TRUE;
-}
-
-
-char *
-winSetStrOption (pointer optlist, const char *name, char *deflt)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_STRING;
- if (ParseOptionValue (-1, optlist, &o))
- deflt = o.value.str;
- if (deflt)
- return xstrdup (deflt);
- else
- return NULL;
-}
-
-
-int
-winSetBoolOption (pointer optlist, const char *name, int deflt)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_BOOLEAN;
- if (ParseOptionValue (-1, optlist, &o))
- deflt = o.value.bool;
- return deflt;
-}
-
-
-int
-winSetIntOption (pointer optlist, const char *name, int deflt)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_INTEGER;
- if (ParseOptionValue (-1, optlist, &o))
- deflt = o.value.num;
- return deflt;
-}
-
-
-double
-winSetRealOption (pointer optlist, const char *name, double deflt)
-{
- OptionInfoRec o;
-
- o.name = name;
- o.type = OPTV_REAL;
- if (ParseOptionValue (-1, optlist, &o))
- deflt = o.value.realnum;
- return deflt;
-}
-
-
-/*
- * Compare two strings for equality. This is caseinsensitive and
- * The characters '_', ' ' (space) and '\t' (tab) are treated as
- * not existing.
- */
-
-int
-winNameCompare (const char *s1, const char *s2)
-{
- char c1, c2;
-
- if (!s1 || *s1 == 0)
- {
- if (!s2 || *s2 == 0)
- return 0;
- else
- return 1;
- }
-
- while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
- s1++;
- while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
- s2++;
-
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
-
- while (c1 == c2)
- {
- if (c1 == 0)
- return 0;
- s1++;
- s2++;
-
- while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
- s1++;
- while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
- s2++;
-
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
- }
- return (c1 - c2);
-}
-
-
-/*
- * Find the named option in the list.
- * @return the pointer to the option record, or NULL if not found.
- */
-
-XF86OptionPtr
-winFindOption (XF86OptionPtr list, const char *name)
-{
- while (list)
- {
- if (winNameCompare (list->opt_name, name) == 0)
- return list;
- list = list->list.next;
- }
- return NULL;
-}
-
-
-/*
- * Find the Value of an named option.
- * @return The option value or NULL if not found.
- */
-
-char *
-winFindOptionValue (XF86OptionPtr list, const char *name)
-{
- list = winFindOption (list, name);
- if (list)
- {
- if (list->opt_val)
- return (list->opt_val);
- else
- return "";
- }
- return (NULL);
-}
-
-
-/*
- * Parse the option.
- */
-
-static Bool
-ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p)
-{
- char *s, *end;
-
- if ((s = winFindOptionValue (options, p->name)) != NULL)
- {
- switch (p->type)
- {
- case OPTV_INTEGER:
- if (*s == '\0')
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
- p->found = FALSE;
- }
- else
- {
- p->value.num = strtoul (s, &end, 0);
- if (*end == '\0')
- {
- p->found = TRUE;
- }
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
- p->found = FALSE;
- }
- }
- break;
- case OPTV_STRING:
- if (*s == '\0')
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an string value\n", p->name);
- p->found = FALSE;
- }
- else
- {
- p->value.str = s;
- p->found = TRUE;
- }
- break;
- case OPTV_ANYSTR:
- p->value.str = s;
- p->found = TRUE;
- break;
- case OPTV_REAL:
- if (*s == '\0')
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
- p->found = FALSE;
- }
- else
- {
- p->value.realnum = strtod (s, &end);
- if (*end == '\0')
- {
- p->found = TRUE;
- }
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
- p->found = FALSE;
- }
- }
- break;
- case OPTV_BOOLEAN:
- if (GetBoolValue (p, s))
- {
- p->found = TRUE;
- }
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", p->name);
- p->found = FALSE;
- }
- break;
- case OPTV_FREQ:
- if (*s == '\0')
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- }
- else
- {
- double freq = strtod (s, &end);
- int units = 0;
-
- if (end != s)
- {
- p->found = TRUE;
- if (!winNameCompare (end, "Hz"))
- units = 1;
- else if (!winNameCompare (end, "kHz") ||
- !winNameCompare (end, "k"))
- units = 1000;
- else if (!winNameCompare (end, "MHz") ||
- !winNameCompare (end, "M"))
- units = 1000000;
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- }
- if (p->found)
- freq *= (double) units;
- }
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
- p->found = FALSE;
- }
- if (p->found)
- {
- p->value.freq.freq = freq;
- p->value.freq.units = units;
- }
- }
- break;
- case OPTV_NONE:
- /* Should never get here */
- p->found = FALSE;
- break;
- }
- if (p->found)
- {
- winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", p->name);
- if (!(p->type == OPTV_BOOLEAN && *s == 0))
- {
- winErrorFVerb (2, " \"%s\"", s);
- }
- winErrorFVerb (2, "\n");
- }
- }
- else if (p->type == OPTV_BOOLEAN)
- {
- /* Look for matches with options with or without a "No" prefix. */
- char *n, *newn;
- OptionInfoRec opt;
-
- n = winNormalizeName (p->name);
- if (!n)
- {
- p->found = FALSE;
- return FALSE;
- }
- if (strncmp (n, "no", 2) == 0)
- {
- newn = n + 2;
- }
- else
- {
- free (n);
- n = malloc (strlen (p->name) + 2 + 1);
- if (!n)
- {
- p->found = FALSE;
- return FALSE;
- }
- strcpy (n, "No");
- strcat (n, p->name);
- newn = n;
- }
- if ((s = winFindOptionValue (options, newn)) != NULL)
- {
- if (GetBoolValue (&opt, s))
- {
- p->value.bool = !opt.value.bool;
- p->found = TRUE;
- }
- else
- {
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", newn);
- p->found = FALSE;
- }
- }
- else
- {
- p->found = FALSE;
- }
- if (p->found)
- {
- winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
- if (*s != 0)
- {
- winErrorFVerb (2, " \"%s\"", s);
- }
- winErrorFVerb (2, "\n");
- }
- free (n);
- }
- else
- {
- p->found = FALSE;
- }
- return p->found;
-}
-
-
-static Bool
-configLayout (serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
- char *default_layout)
-{
-#if 0
-#pragma warn UNIMPLEMENTED
-#endif
- return TRUE;
-}
-
-
-static Bool
-configImpliedLayout (serverLayoutPtr servlayoutp,
- XF86ConfScreenPtr conf_screen)
-{
-#if 0
-#pragma warn UNIMPLEMENTED
-#endif
- return TRUE;
-}
-
-
-static Bool
-GetBoolValue (OptionInfoPtr p, const char *s)
-{
- if (*s == 0)
- {
- p->value.bool = TRUE;
- }
- else
- {
- if (winNameCompare (s, "1") == 0)
- p->value.bool = TRUE;
- else if (winNameCompare (s, "on") == 0)
- p->value.bool = TRUE;
- else if (winNameCompare (s, "true") == 0)
- p->value.bool = TRUE;
- else if (winNameCompare (s, "yes") == 0)
- p->value.bool = TRUE;
- else if (winNameCompare (s, "0") == 0)
- p->value.bool = FALSE;
- else if (winNameCompare (s, "off") == 0)
- p->value.bool = FALSE;
- else if (winNameCompare (s, "false") == 0)
- p->value.bool = FALSE;
- else if (winNameCompare (s, "no") == 0)
- p->value.bool = FALSE;
- }
- return TRUE;
-}
-
-
-char *
-winNormalizeName (const char *s)
-{
- char *ret, *q;
- const char *p;
-
- if (s == NULL)
- return NULL;
-
- ret = malloc (strlen (s) + 1);
- for (p = s, q = ret; *p != 0; p++)
- {
- switch (*p)
- {
- case '_':
- case ' ':
- case '\t':
- continue;
- default:
- if (isupper (*p))
- *q++ = tolower (*p);
- else
- *q++ = *p;
- }
- }
- *q = '\0';
- return ret;
-}
diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h
deleted file mode 100644
index d3099b373..000000000
--- a/hw/xwin/winconfig.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Alexander Gottwald
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.h,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
-#ifndef __WIN_CONFIG_H__
-#define __WIN_CONFIG_H__
-
-#include "win.h"
-#include "../xfree86/parser/xf86Parser.h"
-
-
-/* These are taken from hw/xfree86/common/xf86str.h */
-
-typedef struct
-{
- CARD32 red, green, blue;
-}
-rgb;
-
-
-typedef struct
-{
- float red, green, blue;
-}
-Gamma;
-
-
-typedef struct
-{
- char *identifier;
- char *vendor;
- char *board;
- char *chipset;
- char *ramdac;
- char *driver;
- struct _confscreenrec *myScreenSection;
- Bool claimed;
- Bool active;
- Bool inUse;
- int videoRam;
- int textClockFreq;
- pointer options;
- int screen; /* For multi-CRTC cards */
-}
-GDevRec, *GDevPtr;
-
-
-typedef struct
-{
- char *identifier;
- char *driver;
- pointer commonOptions;
- pointer extraOptions;
-}
-IDevRec, *IDevPtr;
-
-
-typedef struct
-{
- int frameX0;
- int frameY0;
- int virtualX;
- int virtualY;
- int depth;
- int fbbpp;
- rgb weight;
- rgb blackColour;
- rgb whiteColour;
- int defaultVisual;
- char **modes;
- pointer options;
-}
-DispRec, *DispPtr;
-
-
-typedef struct _confxvportrec
-{
- char *identifier;
- pointer options;
-}
-confXvPortRec, *confXvPortPtr;
-
-
-typedef struct _confxvadaptrec
-{
- char *identifier;
- int numports;
- confXvPortPtr ports;
- pointer options;
-}
-confXvAdaptorRec, *confXvAdaptorPtr;
-
-
-typedef struct _confscreenrec
-{
- char *id;
- int screennum;
- int defaultdepth;
- int defaultbpp;
- int defaultfbbpp;
- GDevPtr device;
- int numdisplays;
- DispPtr displays;
- int numxvadaptors;
- confXvAdaptorPtr xvadaptors;
- pointer options;
-}
-confScreenRec, *confScreenPtr;
-
-
-typedef enum
-{
- PosObsolete = -1,
- PosAbsolute = 0,
- PosRightOf,
- PosLeftOf,
- PosAbove,
- PosBelow,
- PosRelative
-}
-PositionType;
-
-
-typedef struct _screenlayoutrec
-{
- confScreenPtr screen;
- char *topname;
- confScreenPtr top;
- char *bottomname;
- confScreenPtr bottom;
- char *leftname;
- confScreenPtr left;
- char *rightname;
- confScreenPtr right;
- PositionType where;
- int x;
- int y;
- char *refname;
- confScreenPtr refscreen;
-}
-screenLayoutRec, *screenLayoutPtr;
-
-
-typedef struct _serverlayoutrec
-{
- char *id;
- screenLayoutPtr screens;
- GDevPtr inactives;
- IDevPtr inputs;
- pointer options;
-}
-serverLayoutRec, *serverLayoutPtr;
-
-
-/*
- * winconfig.c
- */
-
-typedef struct
-{
- /* Files */
- char *configFile;
- char *fontPath;
- char *rgbPath;
- /* input devices - keyboard */
- char *keyboard;
-#ifdef XKB
- Bool noXkbExtension;
- char *xkbMap;
-#endif
- /* layout */
- char *screenname;
- /* mouse settings */
- char *mouse;
- Bool emulate3buttons;
- long emulate3timeout;
-}
-WinCmdlineRec, *WinCmdlinePtr;
-
-
-extern WinCmdlineRec g_cmdline;
-
-extern XF86ConfigPtr g_xf86configptr;
-extern serverLayoutRec g_winConfigLayout;
-
-
-/*
- * Function prototypes
- */
-
-Bool winReadConfigfile (void);
-Bool winConfigFiles (void);
-Bool winConfigOptions (void);
-Bool winConfigScreens (void);
-Bool winConfigKeyboard (DeviceIntPtr pDevice);
-Bool winConfigMouse (DeviceIntPtr pDevice);
-
-
-typedef struct
-{
- double freq;
- int units;
-}
-OptFrequency;
-
-
-typedef union
-{
- unsigned long num;
- char *str;
- double realnum;
- Bool bool;
- OptFrequency freq;
-}
-ValueUnion;
-
-
-typedef enum
-{
- OPTV_NONE = 0,
- OPTV_INTEGER,
- OPTV_STRING, /* a non-empty string */
- OPTV_ANYSTR, /* Any string, including an empty one */
- OPTV_REAL,
- OPTV_BOOLEAN,
- OPTV_FREQ
-}
-OptionValueType;
-
-
-typedef enum
-{
- OPTUNITS_HZ = 1,
- OPTUNITS_KHZ,
- OPTUNITS_MHZ
-}
-OptFreqUnits;
-
-
-typedef struct
-{
- int token;
- const char *name;
- OptionValueType type;
- ValueUnion value;
- Bool found;
-}
-OptionInfoRec, *OptionInfoPtr;
-
-
-/*
- * Function prototypes
- */
-
-char *winSetStrOption (pointer optlist, const char *name, char *deflt);
-int winSetBoolOption (pointer optlist, const char *name, int deflt);
-int winSetIntOption (pointer optlist, const char *name, int deflt);
-double winSetRealOption (pointer optlist, const char *name, double deflt);
-
-XF86OptionPtr winFindOption (XF86OptionPtr list, const char *name);
-char *winFindOptionValue (XF86OptionPtr list, const char *name);
-int winNameCompare (const char *s1, const char *s2);
-char *winNormalizeName (const char *s);
-
-
-typedef struct
-{
- struct
- {
- long leds;
- long delay;
- long rate;
- }
- keyboard;
-#ifdef XKB
- struct
- {
- Bool disable;
- char *rules;
- char *model;
- char *layout;
- char *variant;
- char *options;
- char *initialMap;
- char *keymap;
- char *types;
- char *compat;
- char *keycodes;
- char *symbols;
- char *geometry;
- }
- xkb;
-#endif
- struct
- {
- Bool emulate3Buttons;
- long emulate3Timeout;
- }
- pointer;
-}
-winInfoRec, *winInfoPtr;
-
-
-extern winInfoRec g_winInfo;
-
-#endif
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
deleted file mode 100644
index 336131c8a..000000000
--- a/hw/xwin/wincreatewnd.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/*
- *Copyright (C) 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincreatewnd.c,v 1.7 2003/10/08 11:13:03 eich Exp $ */
-
-#include "win.h"
-#include "shellapi.h"
-
-
-/*
- * Local function prototypes
- */
-
-static Bool
-winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo);
-
-static Bool
-winAdjustForAutoHide (RECT *prcWorkArea);
-
-
-/*
- * Create a full screen window
- */
-
-Bool
-winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- int iWidth = pScreenInfo->dwWidth;
- int iHeight = pScreenInfo->dwHeight;
- HWND *phwnd = &pScreenPriv->hwndScreen;
- WNDCLASS wc;
- char szTitle[256];
-
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowFullScreen\n");
-#endif
-
- /* Setup our window class */
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = winWindowProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = g_hInstance;
- wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
- wc.hCursor = 0;
- wc.hbrBackground = 0;
- wc.lpszMenuName = NULL;
- wc.lpszClassName = WINDOW_CLASS;
- RegisterClass (&wc);
-
- /* Set display and screen-specific tooltip text */
- if (g_pszQueryHost != NULL)
- snprintf (szTitle,
- sizeof (szTitle),
- WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
- else
- snprintf (szTitle,
- sizeof (szTitle),
- WINDOW_TITLE,
- display,
- (int) pScreenInfo->dwScreen);
-
- /* Create the window */
- *phwnd = CreateWindowExA (WS_EX_TOPMOST, /* Extended styles */
- WINDOW_CLASS, /* Class name */
- szTitle, /* Window name */
- WS_POPUP,
- 0, /* Horizontal position */
- 0, /* Vertical position */
- iWidth, /* Right edge */
- iHeight, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
- (HMENU) NULL, /* No menu */
- GetModuleHandle (NULL),/* Instance handle */
- pScreenPriv); /* ScreenPrivates */
-
- /* Branch on the server engine */
- switch (pScreenInfo->dwEngine)
- {
- case WIN_SERVER_SHADOW_GDI:
- /* Show the window */
- ShowWindow (*phwnd, SW_SHOWMAXIMIZED);
- break;
-
- default:
- /* Hide the window */
- ShowWindow (*phwnd, SW_SHOWNORMAL);
- break;
- }
-
- /* Send first paint message */
- UpdateWindow (*phwnd);
-
- /* Attempt to bring our window to the top of the display */
- BringWindowToTop (*phwnd);
-
- return TRUE;
-}
-
-
-/*
- * Create our primary Windows display window
- */
-
-Bool
-winCreateBoundingWindowWindowed (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- int iWidth = pScreenInfo->dwUserWidth;
- int iHeight = pScreenInfo->dwUserHeight;
- HWND *phwnd = &pScreenPriv->hwndScreen;
- WNDCLASS wc;
- RECT rcClient, rcWorkArea;
- DWORD dwWindowStyle;
- char szTitle[256];
-
- ErrorF ("winCreateBoundingWindowWindowed - User w: %d h: %d\n",
- pScreenInfo->dwUserWidth, pScreenInfo->dwUserHeight);
- ErrorF ("winCreateBoundingWindowWindowed - Current w: %d h: %d\n",
- pScreenInfo->dwWidth, pScreenInfo->dwHeight);
-
- /* Set the common window style flags */
- dwWindowStyle = WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX;
-
- /* Decorated or undecorated window */
- if (pScreenInfo->fDecoration
- && !pScreenInfo->fRootless
- && !pScreenInfo->fMultiWindow)
- {
- dwWindowStyle |= WS_CAPTION;
- if (pScreenInfo->fScrollbars)
- dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
- }
- else
- dwWindowStyle |= WS_POPUP;
-
- /* Setup our window class */
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = winWindowProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = g_hInstance;
- wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = WINDOW_CLASS;
- RegisterClass (&wc);
-
- /* Get size of work area */
- winGetWorkArea (&rcWorkArea, pScreenInfo);
-
- /* Adjust for auto-hide taskbars */
- winAdjustForAutoHide (&rcWorkArea);
-
- /* Did the user specify a height and width? */
- if (pScreenInfo->fUserGaveHeightAndWidth)
- {
- /* User gave a desired height and width, try to accomodate */
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - User gave height "
- "and width\n");
-#endif
-
- /* Adjust the window width and height for borders and title bar */
- if (pScreenInfo->fDecoration
- && !pScreenInfo->fRootless
- && !pScreenInfo->fMultiWindow)
- {
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - Window has decoration\n");
-#endif
- /* Are we using scrollbars? */
- if (pScreenInfo->fScrollbars)
- {
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - Window has "
- "scrollbars\n");
-#endif
-
- iWidth += 2 * GetSystemMetrics (SM_CXSIZEFRAME);
- iHeight += 2 * GetSystemMetrics (SM_CYSIZEFRAME)
- + GetSystemMetrics (SM_CYCAPTION);
- }
- else
- {
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - Window does not have "
- "scrollbars\n");
-#endif
-
- iWidth += 2 * GetSystemMetrics (SM_CXFIXEDFRAME);
- iHeight += 2 * GetSystemMetrics (SM_CYFIXEDFRAME)
- + GetSystemMetrics (SM_CYCAPTION);
- }
- }
- else
- {
- /*
- * User gave a width and height but also said no decoration.
- * In this case we have to ignore the requested width and height
- * and instead use the largest possible window that we can.
- */
- if (pScreenInfo->fMultipleMonitors)
- {
- iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
- iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
- }
- else
- {
- iWidth = GetSystemMetrics (SM_CXSCREEN);
- iHeight = GetSystemMetrics (SM_CYSCREEN);
- }
- }
- }
- else
- {
- /* By default, we are creating a window that is as large as possible */
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - User did not give "
- "height and width\n");
-#endif
- /* Defaults are wrong if we have multiple monitors */
- if (pScreenInfo->fMultipleMonitors)
- {
- iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
- iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
- }
- }
-
- /* Clean up the scrollbars flag, if necessary */
- if ((!pScreenInfo->fDecoration
- || pScreenInfo->fRootless
- || pScreenInfo->fMultiWindow)
- && pScreenInfo->fScrollbars)
- {
- /* We cannot have scrollbars if we do not have a window border */
- pScreenInfo->fScrollbars = FALSE;
- }
-
- /* Trim window width to fit work area */
- if (iWidth > (rcWorkArea.right - rcWorkArea.left))
- iWidth = rcWorkArea.right - rcWorkArea.left;
-
- /* Trim window height to fit work area */
- if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top))
- iHeight = rcWorkArea.bottom - rcWorkArea.top;
-
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - Adjusted width: %d "\
- "height: %d\n",
- iWidth, iHeight);
-#endif
-
- /* Set display and screen-specific tooltip text */
- if (g_pszQueryHost != NULL)
- snprintf (szTitle,
- sizeof (szTitle),
- WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
- else
- snprintf (szTitle,
- sizeof (szTitle),
- WINDOW_TITLE,
- display,
- (int) pScreenInfo->dwScreen);
-
- /* Create the window */
- *phwnd = CreateWindowExA (0, /* Extended styles */
- WINDOW_CLASS, /* Class name */
- szTitle, /* Window name */
- dwWindowStyle,
- rcWorkArea.left, /* Horizontal position */
- rcWorkArea.top, /* Vertical position */
- iWidth, /* Right edge */
- iHeight, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
- (HMENU) NULL, /* No menu */
- GetModuleHandle (NULL),/* Instance handle */
- pScreenPriv); /* ScreenPrivates */
- if (*phwnd == NULL)
- {
- ErrorF ("winCreateBoundingWindowWindowed - CreateWindowEx () failed\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winCreateBoundingWindowWindowed - CreateWindowEx () returned\n");
-#endif
-
- /* Get the client area coordinates */
- if (!GetClientRect (*phwnd, &rcClient))
- {
- ErrorF ("winCreateBoundingWindowWindowed - GetClientRect () "
- "failed\n");
- return FALSE;
- }
-
- ErrorF ("winCreateBoundingWindowWindowed - WindowClient "
- "w %ld h %ld r %ld l %ld b %ld t %ld\n",
- rcClient.right - rcClient.left,
- rcClient.bottom - rcClient.top,
- rcClient.right, rcClient.left,
- rcClient.bottom, rcClient.top);
-
- /* We adjust the visual size if the user did not specify it */
- if (!(pScreenInfo->fScrollbars && pScreenInfo->fUserGaveHeightAndWidth))
- {
- /*
- * User did not give a height and width with scrollbars enabled,
- * so we will resize the underlying visual to be as large as
- * the initial view port (page size). This way scrollbars will
- * not appear until the user shrinks the window, if they ever do.
- *
- * NOTE: We have to store the viewport size here because
- * the user may have an autohide taskbar, which would
- * cause the viewport size to be one less in one dimension
- * than the viewport size that we calculated by subtracting
- * the size of the borders and caption.
- */
- pScreenInfo->dwWidth = rcClient.right - rcClient.left;
- pScreenInfo->dwHeight = rcClient.bottom - rcClient.top;
- }
-
-#if 0
- /*
- * NOTE: For the uninitiated, the page size is the number of pixels
- * that we can display in the x or y direction at a time and the
- * range is the total number of pixels in the x or y direction that we
- * have available to display. In other words, the page size is the
- * size of the window area minus the space the caption, borders, and
- * scrollbars (if any) occupy, and the range is the size of the
- * underlying X visual. Notice that, contrary to what some of the
- * MSDN Library arcticles lead you to believe, the windows
- * ``client area'' size does not include the scrollbars. In other words,
- * the whole client area size that is reported to you is drawable by
- * you; you do not have to subtract the size of the scrollbars from
- * the client area size, and if you did it would result in the size
- * of the scrollbars being double counted.
- */
-
- /* Setup scrollbar page and range, if scrollbars are enabled */
- if (pScreenInfo->fScrollbars)
- {
- SCROLLINFO si;
-
- /* Initialize the scrollbar info structure */
- si.cbSize = sizeof (si);
- si.fMask = SIF_RANGE | SIF_PAGE;
- si.nMin = 0;
-
- /* Setup the width range and page size */
- si.nMax = pScreenInfo->dwWidth - 1;
- si.nPage = rcClient.right - rcClient.left;
- ErrorF ("winCreateBoundingWindowWindowed - HORZ nMax: %d nPage :%d\n",
- si.nMax, si.nPage);
- SetScrollInfo (*phwnd, SB_HORZ, &si, TRUE);
-
- /* Setup the height range and page size */
- si.nMax = pScreenInfo->dwHeight - 1;
- si.nPage = rcClient.bottom - rcClient.top;
- ErrorF ("winCreateBoundingWindowWindowed - VERT nMax: %d nPage :%d\n",
- si.nMax, si.nPage);
- SetScrollInfo (*phwnd, SB_VERT, &si, TRUE);
- }
-#endif
-
- /* Show the window */
- if (pScreenInfo->fMultiWindow)
- {
- pScreenPriv->fRootWindowShown = FALSE;
- ShowWindow (*phwnd, SW_HIDE);
- }
- else
- ShowWindow (*phwnd, SW_SHOWNORMAL);
- if (!UpdateWindow (*phwnd))
- {
- ErrorF ("winCreateBoundingWindowWindowed - UpdateWindow () failed\n");
- return FALSE;
- }
-
- /* Attempt to bring our window to the top of the display */
- if (!BringWindowToTop (*phwnd))
- {
- ErrorF ("winCreateBoundingWindowWindowed - BringWindowToTop () "
- "failed\n");
- return FALSE;
- }
-
- /* Paint window background blue */
- if (pScreenInfo->dwEngine == WIN_SERVER_NATIVE_GDI)
- winPaintBackground (*phwnd, RGB (0x00, 0x00, 0xFF));
-
- ErrorF ("winCreateBoundingWindowWindowed - Returning\n");
-
- return TRUE;
-}
-
-
-/*
- * Find the work area of all attached monitors
- */
-
-static Bool
-winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
-{
- int iPrimaryWidth, iPrimaryHeight;
- int iWidth, iHeight;
- int iLeft, iTop;
- int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
-
- /* SPI_GETWORKAREA only gets the work area of the primary screen. */
- SystemParametersInfo (SPI_GETWORKAREA, 0, prcWorkArea, 0);
-
- /* Bail out here if we aren't using multiple monitors */
- if (!pScreenInfo->fMultipleMonitors)
- return TRUE;
-
- ErrorF ("winGetWorkArea - Original WorkArea: %d %d %d %d\n",
- prcWorkArea->top, prcWorkArea->left,
- prcWorkArea->bottom, prcWorkArea->right);
-
- /* Get size of full virtual screen */
- iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
- iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
-
- ErrorF ("winGetWorkArea - Virtual screen is %d x %d\n", iWidth, iHeight);
-
- /* Get origin of full virtual screen */
- iLeft = GetSystemMetrics (SM_XVIRTUALSCREEN);
- iTop = GetSystemMetrics (SM_YVIRTUALSCREEN);
-
- ErrorF ("winGetWorkArea - Virtual screen origin is %d, %d\n", iLeft, iTop);
-
- /* Get size of primary screen */
- iPrimaryWidth = GetSystemMetrics (SM_CXSCREEN);
- iPrimaryHeight = GetSystemMetrics (SM_CYSCREEN);
-
- ErrorF ("winGetWorkArea - Primary screen is %d x %d\n",
- iPrimaryWidth, iPrimaryHeight);
-
- /* Work out how much of the primary screen we aren't using */
- iPrimaryNonWorkAreaWidth = iPrimaryWidth - (prcWorkArea->right -
- prcWorkArea->left);
- iPrimaryNonWorkAreaHeight = iPrimaryHeight - (prcWorkArea->bottom
- - prcWorkArea->top);
-
- /* Update the rectangle to include all monitors */
- if (iLeft < 0)
- {
- prcWorkArea->left = iLeft;
- }
- if (iTop < 0)
- {
- prcWorkArea->top = iTop;
- }
- prcWorkArea->right = prcWorkArea->left + iWidth -
- iPrimaryNonWorkAreaWidth;
- prcWorkArea->bottom = prcWorkArea->top + iHeight -
- iPrimaryNonWorkAreaHeight;
-
- ErrorF ("winGetWorkArea - Adjusted WorkArea for multiple "
- "monitors: %d %d %d %d\n",
- prcWorkArea->top, prcWorkArea->left,
- prcWorkArea->bottom, prcWorkArea->right);
-
- return TRUE;
-}
-
-
-/*
- * Adjust the client area so that any auto-hide toolbars
- * will work correctly.
- */
-
-static Bool
-winAdjustForAutoHide (RECT *prcWorkArea)
-{
- APPBARDATA abd;
- HWND hwndAutoHide;
-
- ErrorF ("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n",
- prcWorkArea->top, prcWorkArea->left,
- prcWorkArea->bottom, prcWorkArea->right);
-
- /* Find out if the Windows taskbar is set to auto-hide */
- ZeroMemory (&abd, sizeof (abd));
- abd.cbSize = sizeof (abd);
- if (SHAppBarMessage (ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
- ErrorF ("winAdjustForAutoHide - Taskbar is auto hide\n");
-
- /* Look for a TOP auto-hide taskbar */
- abd.uEdge = ABE_TOP;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
- {
- ErrorF ("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
- prcWorkArea->top += 1;
- }
-
- /* Look for a LEFT auto-hide taskbar */
- abd.uEdge = ABE_LEFT;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
- {
- ErrorF ("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
- prcWorkArea->left += 1;
- }
-
- /* Look for a BOTTOM auto-hide taskbar */
- abd.uEdge = ABE_BOTTOM;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
- {
- ErrorF ("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
- prcWorkArea->bottom -= 1;
- }
-
- /* Look for a RIGHT auto-hide taskbar */
- abd.uEdge = ABE_RIGHT;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
- {
- ErrorF ("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
- prcWorkArea->right -= 1;
- }
-
- ErrorF ("winAdjustForAutoHide - Adjusted WorkArea: %d %d %d %d\n",
- prcWorkArea->top, prcWorkArea->left,
- prcWorkArea->bottom, prcWorkArea->right);
-
-#if 0
- /* Obtain the task bar window dimensions */
- abd.hWnd = hwndAutoHide;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETTASKBARPOS, &abd);
- ErrorF ("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n",
- hwndAutoHide, abd.hWnd,
- abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right);
-#endif
-
- return TRUE;
-}
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
deleted file mode 100644
index e7c3ba7e7..000000000
--- a/hw/xwin/wincursor.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.6 2003/07/29 21:25:17 dawes Exp $ */
-
-#include "win.h"
-
-miPointerScreenFuncRec g_winPointerCursorFuncs =
-{
- winCursorOffScreen,
- winCrossScreen,
- winPointerWarpCursor
-};
-
-
-void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
-{
- winScreenPriv(pScreen);
- RECT rcClient;
- static Bool s_fInitialWarp = TRUE;
-
- /* Discard first warp call */
- if (s_fInitialWarp)
- {
- /* First warp moves mouse to center of window, just ignore it */
-
- /* Don't ignore subsequent warps */
- s_fInitialWarp = FALSE;
-
- ErrorF ("winPointerWarpCursor - Discarding first warp: %d %d\n",
- x, y);
-
- return;
- }
-
- /* Only update the Windows cursor position if we are active */
- if (pScreenPriv->hwndScreen == GetForegroundWindow ())
- {
- /* Get the client area coordinates */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
-
- /* Translate the client area coords to screen coords */
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient,
- 2);
-
- /*
- * Update the Windows cursor position so that we don't
- * immediately warp back to the current position.
- */
- SetCursorPos (rcClient.left + x, rcClient.top + y);
- }
-
- /* Call the mi warp procedure to do the actual warping in X. */
- miPointerWarpCursor (pScreen, x, y);
-}
-
-Bool
-winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
-{
- return FALSE;
-}
-
-void
-winCrossScreen (ScreenPtr pScreen, Bool fEntering)
-{
-}
-
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
deleted file mode 100755
index d905ad81c..000000000
--- a/hw/xwin/windialogs.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/windialogs.c,v 1.1 2003/07/29 21:25:17 dawes Exp $ */
-
-#include "win.h"
-
-extern Bool g_fCursor;
-
-BOOL CALLBACK
-winExitDlgProc (HWND hDialog, UINT message,
- WPARAM wParam, LPARAM lParam);
-
-BOOL CALLBACK
-winChangeDepthDlgProc (HWND hDialog, UINT message,
- WPARAM wParam, LPARAM lParam);
-
-
-/*
- * Display the Exit dialog box
- */
-
-void
-winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
-{
- /* Check if dialog already exists */
- if (g_hDlgExit != NULL)
- {
- /* Dialog box already exists, display it */
- ShowWindow (g_hDlgExit, SW_SHOWDEFAULT);
-
- /* User has lost the dialog. Show them where it is. */
- SetForegroundWindow (g_hDlgExit);
-
- return;
- }
-
- /* Create dialog box */
- g_hDlgExit = CreateDialogParam (g_hInstance,
- "EXIT_DIALOG",
- pScreenPriv->hwndScreen,
- winExitDlgProc,
- (int) pScreenPriv);
-
- /* Drop minimize and maximize buttons */
- SetWindowLong (g_hDlgExit, GWL_STYLE,
- GetWindowLong (g_hDlgExit, GWL_STYLE)
- & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
- SetWindowLong (g_hDlgExit, GWL_EXSTYLE,
- GetWindowLong (g_hDlgExit, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
- SetWindowPos (g_hDlgExit, 0, 0, 0, 0, 0,
- SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
-
- /* Show the dialog box */
- ShowWindow (g_hDlgExit, SW_SHOW);
-
- /* Needed to get keyboard controls (tab, arrows, enter, esc) to work */
- SetForegroundWindow (g_hDlgExit);
-
- /* Set focus to the Cancel buton */
- PostMessage (g_hDlgExit, WM_NEXTDLGCTL,
- (int) GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
-}
-
-
-/*
- * Exit dialog window procedure
- */
-
-BOOL CALLBACK
-winExitDlgProc (HWND hDialog, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- static winPrivScreenPtr s_pScreenPriv = NULL;
- static winScreenInfo *s_pScreenInfo = NULL;
- static ScreenPtr s_pScreen = NULL;
-
- /* Branch on message type */
- switch (message)
- {
- case WM_INITDIALOG:
- /* Store pointers to private structures for future use */
- s_pScreenPriv = (winPrivScreenPtr) lParam;
- s_pScreenInfo = s_pScreenPriv->pScreenInfo;
- s_pScreen = s_pScreenInfo->pScreen;
-
- /* Set icon to standard app icon */
- PostMessage (hDialog,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD (wParam))
- {
- case IDOK:
- /* Send message to call the GiveUp function */
- PostMessage (s_pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0);
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
-
- /* Fix to make sure keyboard focus isn't trapped */
- PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
- return TRUE;
-
- case IDCANCEL:
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
-
- /* Fix to make sure keyboard focus isn't trapped */
- PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
- return TRUE;
- }
- break;
-
- case WM_MOUSEMOVE:
- case WM_NCMOUSEMOVE:
- /* Show the cursor if it is hidden */
- if (!g_fCursor)
- {
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
- return TRUE;
-
- case WM_CLOSE:
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
-
- /* Fix to make sure keyboard focus isn't trapped */
- PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/*
- * Display the Depth Change dialog box
- */
-
-void
-winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv)
-{
- /* Check if dialog already exists */
- if (g_hDlgDepthChange != NULL)
- {
- /* Dialog box already exists, display it */
- ShowWindow (g_hDlgDepthChange, SW_SHOWDEFAULT);
-
- /* User has lost the dialog. Show them where it is. */
- SetForegroundWindow (g_hDlgDepthChange);
-
- return;
- }
-
- /*
- * Display a notification to the user that the visual
- * will not be displayed until the Windows display depth
- * is restored to the original value.
- */
- g_hDlgDepthChange = CreateDialogParam (g_hInstance,
- "DEPTH_CHANGE_BOX",
- pScreenPriv->hwndScreen,
- winChangeDepthDlgProc,
- (int) pScreenPriv);
-
- /* Drop minimize and maximize buttons */
- SetWindowLong (g_hDlgDepthChange, GWL_STYLE,
- GetWindowLong (g_hDlgDepthChange, GWL_STYLE)
- & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
- SetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE,
- GetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE)
- & ~WS_EX_APPWINDOW );
- SetWindowPos (g_hDlgDepthChange, 0, 0, 0, 0, 0,
- SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
-
- /* Show the dialog box */
- ShowWindow (g_hDlgDepthChange, SW_SHOW);
-
- ErrorF ("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
- g_hDlgDepthChange);
- ErrorF ("winDisplayDepthChangeDialog - GetLastError: %d\n", GetLastError ());
-
- /* Minimize the display window */
- ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
-}
-
-
-/*
- * Process messages for the dialog that is displayed for
- * disruptive screen depth changes.
- */
-
-BOOL CALLBACK
-winChangeDepthDlgProc (HWND hwndDialog, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- static winPrivScreenPtr s_pScreenPriv = NULL;
- static winScreenInfo *s_pScreenInfo = NULL;
- static ScreenPtr s_pScreen = NULL;
-
-#if CYGDEBUG
- ErrorF ("winChangeDepthDlgProc\n");
-#endif
-
- /* Branch on message type */
- switch (message)
- {
- case WM_INITDIALOG:
-#if CYGDEBUG
- ErrorF ("winChangeDepthDlgProc - WM_INITDIALOG\n");
-#endif
-
- /* Store pointers to private structures for future use */
- s_pScreenPriv = (winPrivScreenPtr) lParam;
- s_pScreenInfo = s_pScreenPriv->pScreenInfo;
- s_pScreen = s_pScreenInfo->pScreen;
-
-#if CYGDEBUG
- ErrorF ("winChangeDepthDlgProc - WM_INITDIALG - s_pScreenPriv: %08x, "
- "s_pScreenInfo: %08x, s_pScreen: %08x\n",
- s_pScreenPriv, s_pScreenInfo, s_pScreen);
-#endif
-
-#if CYGDEBUG
- ErrorF ("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, "
- "last bpp: %d\n",
- s_pScreenInfo->dwBPP,
- s_pScreenPriv->dwLastWindowsBitsPixel);
-#endif
-
- /* Set icon to standard app icon */
- PostMessage (hwndDialog,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
-
- return TRUE;
-
- case WM_DISPLAYCHANGE:
-#if CYGDEBUG
- ErrorF ("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, "
- "last bpp: %d, new bpp: %d\n",
- s_pScreenInfo->dwBPP,
- s_pScreenPriv->dwLastWindowsBitsPixel,
- wParam);
-#endif
-
- /* Dismiss the dialog if the display returns to the original depth */
- if (wParam == s_pScreenInfo->dwBPP)
- {
- ErrorF ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n");
-
- /* Depth has been restored, dismiss dialog */
- DestroyWindow (g_hDlgDepthChange);
- g_hDlgDepthChange = NULL;
-
- /* Flag that we have a valid screen depth */
- s_pScreenPriv->fBadDepth = FALSE;
- }
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD (wParam))
- {
- case IDOK:
- case IDCANCEL:
- ErrorF ("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
-
- /*
- * User dismissed the dialog, hide it until the
- * display mode is restored.
- */
- ShowWindow (g_hDlgDepthChange, SW_HIDE);
- return TRUE;
- }
- break;
-
- case WM_CLOSE:
- ErrorF ("winChangeDepthDlgProc - WM_CLOSE\n");
-
- /*
- * User dismissed the dialog, hide it until the
- * display mode is restored.
- */
- ShowWindow (g_hDlgDepthChange, SW_HIDE);
- return TRUE;
- }
-
- return FALSE;
-}
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
deleted file mode 100644
index d76e58628..000000000
--- a/hw/xwin/winengine.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- *Copyright (C) 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winengine.c,v 1.5 2003/07/29 21:25:17 dawes Exp $ */
-
-#include "win.h"
-
-
-/*
- * External global variables
- */
-
-extern const GUID _IID_IDirectDraw4;
-
-
-/*
- * Detect engines supported by current Windows version
- * DirectDraw version and hardware
- */
-
-void
-winDetectSupportedEngines ()
-{
- OSVERSIONINFO osvi;
-
- /* Initialize the engine support flags */
- g_dwEnginesSupported = WIN_SERVER_SHADOW_GDI;
-
-#if WIN_NATIVE_GDI_SUPPORT
- g_dwEnginesSupported |= WIN_SERVER_NATIVE_GDI;
-#endif
-
- /* Get operating system version information */
- ZeroMemory (&osvi, sizeof (osvi));
- osvi.dwOSVersionInfoSize = sizeof (osvi);
- GetVersionEx (&osvi);
-
- /* Branch on platform ID */
- switch (osvi.dwPlatformId)
- {
- case VER_PLATFORM_WIN32_NT:
- /* Engine 4 is supported on NT only */
- ErrorF ("winDetectSupportedEngines - Windows NT/2000/XP\n");
- break;
-
- case VER_PLATFORM_WIN32_WINDOWS:
- /* Engine 4 is supported on NT only */
- ErrorF ("winDetectSupportedEngines - Windows 95/98/Me\n");
- break;
- }
-
- /* Do we have DirectDraw? */
- if (g_hmodDirectDraw != NULL)
- {
- LPDIRECTDRAW lpdd = NULL;
- LPDIRECTDRAW4 lpdd4 = NULL;
- HRESULT ddrval;
-
- /* Was the DirectDrawCreate function found? */
- if (g_fpDirectDrawCreate == NULL)
- {
- /* No DirectDraw support */
- return;
- }
-
- /* DirectDrawCreate exists, try to call it */
- /* Create a DirectDraw object, store the address at lpdd */
- ddrval = (*g_fpDirectDrawCreate) (NULL,
- (void**) &lpdd,
- NULL);
- if (FAILED (ddrval))
- {
- /* No DirectDraw support */
- ErrorF ("winDetectSupportedEngines - DirectDraw not installed\n");
- return;
- }
- else
- {
- /* We have DirectDraw */
- ErrorF ("winDetectSupportedEngines - DirectDraw installed\n");
- g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD;
-
- /* Allow PrimaryDD engine if NT */
- if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
- {
- g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD;
- ErrorF ("winDetectSupportedEngines - Allowing PrimaryDD\n");
- }
- }
-
- /* Try to query for DirectDraw4 interface */
- ddrval = IDirectDraw_QueryInterface (lpdd,
- &IID_IDirectDraw4,
- (LPVOID*) &lpdd4);
- if (SUCCEEDED (ddrval))
- {
- /* We have DirectDraw4 */
- ErrorF ("winDetectSupportedEngines - DirectDraw4 installed\n");
- g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL;
- }
-
- /* Cleanup DirectDraw interfaces */
- if (lpdd4 != NULL)
- IDirectDraw_Release (lpdd4);
- if (lpdd != NULL)
- IDirectDraw_Release (lpdd);
- }
-
- ErrorF ("winDetectSupportedEngines - Returning, supported engines %08x\n",
- g_dwEnginesSupported);
-}
-
-
-/*
- * Set the engine type, depending on the engines
- * supported for this screen, and whether the user
- * suggested an engine type
- */
-
-Bool
-winSetEngine (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc;
- DWORD dwBPP;
-
- /* Get a DC */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winSetEngine - Couldn't get an HDC\n");
- return FALSE;
- }
-
- /*
- * pScreenInfo->dwBPP may be 0 to indicate that the current screen
- * depth is to be used. Thus, we must query for the current display
- * depth here.
- */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* Release the DC */
- ReleaseDC (NULL, hdc);
- hdc = NULL;
-
- /* ShadowGDI is the only engine that supports windowed PseudoColor */
- if (dwBPP == 8 && !pScreenInfo->fFullScreen)
- {
- ErrorF ("winSetEngine - Windowed && PseudoColor => ShadowGDI\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowGDI (pScreen);
- return TRUE;
- }
-
- /* ShadowGDI is the only engine that supports Multi Window Mode */
- if (pScreenInfo->fMultiWindow)
- {
- ErrorF ("winSetEngine - Multi Window => ShadowGDI\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowGDI (pScreen);
- return TRUE;
- }
-
- /* If the user's choice is supported, we'll use that */
- if (g_dwEnginesSupported & pScreenInfo->dwEnginePreferred)
- {
- ErrorF ("winSetEngine - Using user's preference: %d\n",
- pScreenInfo->dwEnginePreferred);
- pScreenInfo->dwEngine = pScreenInfo->dwEnginePreferred;
-
- /* Setup engine function pointers */
- switch (pScreenInfo->dwEngine)
- {
- case WIN_SERVER_SHADOW_GDI:
- winSetEngineFunctionsShadowGDI (pScreen);
- break;
- case WIN_SERVER_SHADOW_DD:
- winSetEngineFunctionsShadowDD (pScreen);
- break;
- case WIN_SERVER_SHADOW_DDNL:
- winSetEngineFunctionsShadowDDNL (pScreen);
- break;
- case WIN_SERVER_PRIMARY_DD:
- winSetEngineFunctionsPrimaryDD (pScreen);
- break;
- case WIN_SERVER_NATIVE_GDI:
- winSetEngineFunctionsNativeGDI (pScreen);
- break;
- default:
- FatalError ("winSetEngine - Invalid engine type\n");
- }
- return TRUE;
- }
-
- /* ShadowDDNL has good performance, so why not */
- if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DDNL)
- {
- ErrorF ("winSetEngine - Using Shadow DirectDraw NonLocking\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DDNL;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowDDNL (pScreen);
- return TRUE;
- }
-
- /* ShadowDD is next in line */
- if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DD)
- {
- ErrorF ("winSetEngine - Using Shadow DirectDraw\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DD;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowDD (pScreen);
- return TRUE;
- }
-
- /* ShadowGDI is next in line */
- if (g_dwEnginesSupported & WIN_SERVER_SHADOW_GDI)
- {
- ErrorF ("winSetEngine - Using Shadow GDI DIB\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowGDI (pScreen);
- return TRUE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Get procedure addresses for DirectDrawCreate and DirectDrawCreateClipper
- */
-
-Bool
-winGetDDProcAddresses ()
-{
- Bool fReturn = TRUE;
-
- /* Load the DirectDraw library */
- g_hmodDirectDraw = LoadLibraryEx ("ddraw.dll", NULL, 0);
- if (g_hmodDirectDraw == NULL)
- {
- ErrorF ("winGetDDProcAddresses - Could not load ddraw.dll\n");
- fReturn = TRUE;
- goto winGetDDProcAddresses_Exit;
- }
-
- /* Try to get the DirectDrawCreate address */
- g_fpDirectDrawCreate = GetProcAddress (g_hmodDirectDraw,
- "DirectDrawCreate");
- if (g_fpDirectDrawCreate == NULL)
- {
- ErrorF ("winGetDDProcAddresses - Could not get DirectDrawCreate "
- "address\n");
- fReturn = TRUE;
- goto winGetDDProcAddresses_Exit;
- }
-
- /* Try to get the DirectDrawCreateClipper address */
- g_fpDirectDrawCreateClipper = GetProcAddress (g_hmodDirectDraw,
- "DirectDrawCreateClipper");
- if (g_fpDirectDrawCreateClipper == NULL)
- {
- ErrorF ("winGetDDProcAddresses - Could not get "
- "DirectDrawCreateClipper address\n");
- fReturn = FALSE;
- goto winGetDDProcAddresses_Exit;
- }
-
- /*
- * Note: Do not unload ddraw.dll here. Do it in GiveUp
- */
-
- winGetDDProcAddresses_Exit:
- /* Unload the DirectDraw library if we failed to initialize */
- if (!fReturn && g_hmodDirectDraw != NULL)
- {
- FreeLibrary (g_hmodDirectDraw);
- g_hmodDirectDraw = NULL;
- }
-
- return fReturn;
-}
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
deleted file mode 100644
index 8a1e0df85..000000000
--- a/hw/xwin/winerror.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winerror.c,v 1.6 2003/10/02 13:30:10 eich Exp $ */
-
-#include "win.h"
-
-#ifdef DDXOSVERRORF
-void
-OsVendorVErrorF (const char *pszFormat, va_list va_args)
-{
- static pthread_mutex_t s_pmPrinting = PTHREAD_MUTEX_INITIALIZER;
-
- /* Lock the printing mutex */
- pthread_mutex_lock (&s_pmPrinting);
-
- /* Print the error message to a log file, could be stderr */
- LogVWrite(0, pszFormat, va_args);
-
- /* Unlock the printing mutex */
- pthread_mutex_unlock (&s_pmPrinting);
-}
-#endif
-
-
-/*
- * os/util.c/FatalError () calls our vendor ErrorF, so the message
- * from a FatalError will be logged. Thus, the message for the
- * fatal error is not passed to this function.
- *
- * Attempt to do last-ditch, safe, important cleanup here.
- */
-#ifdef DDXOSFATALERROR
-void
-OsVendorFatalError (void)
-{
-
-}
-#endif
diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
deleted file mode 100644
index 9ac536274..000000000
--- a/hw/xwin/winfillsp.c
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- * Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winfillsp.c,v 1.10 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-extern void ROP16(HDC hdc, int rop);
-
-#define TRANSLATE_COLOR(color) \
-{ \
- if (pDrawable->depth == 15) \
- color = ((color & 0x1F) << 19) | ((color & 0x03E0) << 6) | \
- ((color & 0xF800) >> 8); \
- else if (pDrawable->depth == 16) \
- color = ((color & 0x1F) << 19) | ((color & 0x07E0) << 5) | \
- ((color & 0xF800) >> 8); \
- else if (pDrawable->depth == 24 || pDrawable->depth == 32) \
- color = ((color & 0xFF) << 16) | (color & 0xFF00) | \
- ((color & 0xFF0000) >> 16); \
-}
-
-/* See Porting Layer Definition - p. 54 */
-void
-winFillSpansNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- int iSpans,
- DDXPointPtr pPoints,
- int *piWidths,
- int fSorted)
-{
- winGCPriv(pGC);
- HBITMAP hbmpOrig = NULL, hbmpOrigStipple = NULL;
- HBITMAP hPenOrig = NULL;
- HBITMAP hBitmap = NULL;
- PixmapPtr pPixmap = NULL;
- winPrivPixmapPtr pPixmapPriv = NULL;
- PixmapPtr pStipple = NULL;
- winPrivPixmapPtr pStipplePriv = NULL;
- PixmapPtr pTile = NULL;
- winPrivPixmapPtr pTilePriv = NULL;
- HDC hdcStipple = NULL, hdcTile = NULL;
- HPEN hPen = NULL;
- int iX;
- int fg, bg;
- RegionPtr pClip = pGC->pCompositeClip;
- BoxPtr pextent, pbox;
- int nbox;
- int extentX1, extentX2, extentY1, extentY2;
- int fullX1, fullX2, fullY1;
- HRGN hrgn = NULL, combined = NULL;
-
- nbox = REGION_NUM_RECTS (pClip);
- pbox = REGION_RECTS (pClip);
-
- if (!nbox) return;
-
- combined = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
- nbox--; pbox++;
-
- while (nbox--)
- {
- hrgn = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
- CombineRgn (combined, combined, hrgn, RGN_OR);
- DeleteObject (hrgn);
- hrgn = NULL;
- pbox++;
- }
-
- pextent = REGION_EXTENTS (pGC->pScreen, pClip);
- extentX1 = pextent->x1;
- extentY1 = pextent->y1;
- extentX2 = pextent->x2;
- extentY2 = pextent->y2;
-
- /* Branch on the type of drawable we have */
- switch (pDrawable->type)
- {
- case DRAWABLE_PIXMAP:
-
- SelectClipRgn (pGCPriv->hdcMem, combined);
- DeleteObject (combined);
- combined = NULL;
-
- /* Get a pixmap pointer from the drawable pointer, and fetch privates */
- pPixmap = (PixmapPtr) pDrawable;
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
- /* Select the drawable pixmap into memory hdc */
- hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
- if (hbmpOrig == NULL)
- FatalError ("winFillSpans - DRAWABLE_PIXMAP - "
- "SelectObject () failed on\n\tpPixmapPriv->hBitmap: "
- "%08x\n", pPixmapPriv->hBitmap);
-
- /* Branch on the fill type */
- switch (pGC->fillStyle)
- {
- case FillSolid:
-
- ROP16 (pGCPriv->hdcMem, pGC->alu);
-
- if (pDrawable->depth == 1)
- {
- if (pGC->fgPixel == 0)
- hPenOrig = SelectObject (pGCPriv->hdcMem,
- GetStockObject (BLACK_PEN));
- else
- hPenOrig = SelectObject (pGCPriv->hdcMem,
- GetStockObject (WHITE_PEN));
- }
- else
- {
- fg = pGC->fgPixel;
- TRANSLATE_COLOR (fg);
- hPen = CreatePen (PS_SOLID, 0, fg);
- hPenOrig = SelectObject (pGCPriv->hdcMem, hPen);
- }
-
- while (iSpans--)
- {
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- MoveToEx (pGCPriv->hdcMem, fullX1, fullY1, NULL);
- LineTo (pGCPriv->hdcMem, fullX2, fullY1);
- }
-
- SetROP2 (pGCPriv->hdcMem, R2_COPYPEN);
-
- /* Give back the Pen */
- SelectObject (pGCPriv->hdcMem, hPenOrig);
-
- if (pDrawable->depth != 1)
- DeleteObject (hPen);
- break;
-
- case FillOpaqueStippled:
-
- pStipple = pGC->stipple;
- pStipplePriv = winGetPixmapPriv (pStipple);
-
- /* Create a device-dependent bitmap for the stipple */
- hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
- (BITMAPINFOHEADER *)pStipplePriv->pbmih,
- CBM_INIT,
- pStipplePriv->pbBits,
- (BITMAPINFO *)pStipplePriv->pbmih,
- DIB_RGB_COLORS);
-
- /* Create a memory DC to hold the stipple */
- hdcStipple = CreateCompatibleDC (pGCPriv->hdcMem);
-
- /* Select the stipple bitmap into the stipple DC */
- hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
- if (hbmpOrigStipple == NULL)
- FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
- "SelectObject () failed on hbmpOrigStipple\n");
-
- /* Make a temporary copy of the foreground and background colors */
- bg = pGC->bgPixel;
- fg = pGC->fgPixel;
-
- /* Translate the depth-dependent colors to Win32 COLORREFs */
- TRANSLATE_COLOR (fg);
- TRANSLATE_COLOR (bg);
- SetTextColor (pGCPriv->hdcMem, fg);
- SetBkColor (pGCPriv->hdcMem, bg);
-
- while (iSpans--)
- {
- int width = pStipple->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pStipple->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pStipple->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pStipple->drawable.width)
- width = pStipple->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdcMem,
- iX, fullY1,
- width, 1,
- hdcStipple,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Clear the stipple HDC */
- SelectObject (hdcStipple, hbmpOrigStipple);
- DeleteDC (hdcStipple);
-
- /* Delete the device dependent stipple bitmap */
- DeleteObject (hBitmap);
-
- break;
- case FillStippled:
-
- pStipple = pGC->stipple;
- pStipplePriv = winGetPixmapPriv (pStipple);
-
- /* Create a device-dependent bitmap for the stipple */
- hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
- (BITMAPINFOHEADER *)pStipplePriv->pbmih,
- CBM_INIT,
- pStipplePriv->pbBits,
- (BITMAPINFO *)pStipplePriv->pbmih,
- DIB_RGB_COLORS);
-
- /* Create a memory DC to hold the stipple */
- hdcStipple = CreateCompatibleDC (pGCPriv->hdcMem);
-
- /* Select the stipple bitmap into the stipple DC */
- hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
- if (hbmpOrigStipple == NULL)
- FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
- "SelectObject () failed on hbmpOrigStipple\n");
-
- /* Make a temporary copy of the foreground and background colors */
- bg = pGC->bgPixel;
- fg = pGC->fgPixel;
-
- /* Translate the depth-dependent colors to Win32 COLORREFs */
- TRANSLATE_COLOR (fg);
- TRANSLATE_COLOR (bg);
-
- /* this is fudgy, we should only invert on the last one
- * We need to get the black/white pixels right in the
- * colormap. But yeah ! it's working..
- */
- if (pGC->bgPixel != -1 && pGC->fgPixel != -1)
- {
- SetTextColor (pGCPriv->hdcMem, fg);
- SetBkColor (pGCPriv->hdcMem, bg);
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0, 0,
- 0x330008);
- }
- else if (pGC->bgPixel == -1)
- {
- SetTextColor (pGCPriv->hdcMem, fg);
- SetBkMode (pGCPriv->hdcMem, TRANSPARENT);
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0, 0,
- 0x330008);
- }
- else if (pGC->fgPixel == -1)
- {
- SetTextColor (pGCPriv->hdcMem, bg);
- SetBkMode (pGCPriv->hdcMem, TRANSPARENT);
-#if 0
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0, 0,
- 0x330008);
-#endif
- }
-
- while (iSpans--)
- {
- int width = pStipple->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pStipple->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pStipple->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pStipple->drawable.width)
- width = pStipple->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdcMem,
- iX, fullY1,
- width, 1,
- hdcStipple,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Clear the stipple HDC */
- SelectObject (hdcStipple, hbmpOrigStipple);
- DeleteDC (hdcStipple);
-
- /* Delete the device dependent stipple bitmap */
- DeleteObject (hBitmap);
-
- /* Restore the background mode */
- SetBkMode (pGCPriv->hdcMem, OPAQUE);
- break;
-
- case FillTiled:
-
- /* Get a pixmap pointer from the tile pointer, and fetch privates */
- pTile = (PixmapPtr) pGC->tile.pixmap;
- pTilePriv = winGetPixmapPriv (pTile);
-
- /* Create a memory DC to hold the tile */
- hdcTile = CreateCompatibleDC (pGCPriv->hdcMem);
-
- /* Select the tile into a DC */
- hbmpOrig = SelectObject (hdcTile, pTilePriv->hBitmap);
- if (hbmpOrig == NULL)
- FatalError ("winFillSpans - DRAWABLE_PIXMAP - FillTiled - "
- "SelectObject () failed on pTilePriv->hBitmap\n");
-
- while (iSpans--)
- {
- int width = pTile->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pTile->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pTile->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pTile->drawable.width) - pTile->drawable.width)) % pTile->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pTile->drawable.width)
- width = pTile->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdcMem,
- iX, fullY1,
- width, 1,
- hdcTile,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pTile->drawable.height) - pTile->drawable.height)) % pTile->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Push the tile pixmap out of the memory HDC */
- SelectObject (hdcTile, hbmpOrig);
-
- /* Delete the tile */
- DeleteDC (hdcTile);
- break;
-
- default:
- ErrorF ("winFillSpans - DRAWABLE_PIXMAP - Unknown fillStyle\n");
- break;
- }
-
- /* Reset clip region */
- SelectClipRgn (pGCPriv->hdcMem, NULL);
-
- /* Push the drawable pixmap out of the GC HDC */
- SelectObject (pGCPriv->hdcMem, hbmpOrig);
- break;
-
- case DRAWABLE_WINDOW:
-
- SelectClipRgn (pGCPriv->hdc, combined);
- DeleteObject (combined);
- combined = NULL;
-
- /* Branch on fill style */
- switch (pGC->fillStyle)
- {
- case FillSolid:
-
- ROP16 (pGCPriv->hdc, pGC->alu);
-
- if (pDrawable->depth == 1)
- {
- if (pGC->fgPixel == 0)
- hPenOrig = SelectObject (pGCPriv->hdc,
- GetStockObject (BLACK_PEN));
- else
- hPenOrig = SelectObject (pGCPriv->hdc,
- GetStockObject (WHITE_PEN));
- }
- else
- {
- fg = pGC->fgPixel;
- TRANSLATE_COLOR (fg);
- hPen = CreatePen (PS_SOLID, 0, fg);
- hPenOrig = SelectObject (pGCPriv->hdc, hPen);
- }
-
- while (iSpans--)
- {
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- MoveToEx (pGCPriv->hdc, fullX1, fullY1, NULL);
- LineTo (pGCPriv->hdc, fullX2, fullY1);
- }
-
- SetROP2 (pGCPriv->hdc, R2_COPYPEN);
-
- /* Give back the Brush */
- SelectObject (pGCPriv->hdc, hPenOrig);
-
- if (pDrawable->depth != 1)
- DeleteObject (hPen);
- break;
-
- case FillOpaqueStippled:
-
- pStipple = pGC->stipple;
- pStipplePriv = winGetPixmapPriv (pStipple);
-
- /* Create a device-dependent bitmap for the stipple */
- hBitmap = CreateDIBitmap (pGCPriv->hdc,
- (BITMAPINFOHEADER *)pStipplePriv->pbmih,
- CBM_INIT,
- pStipplePriv->pbBits,
- (BITMAPINFO *)pStipplePriv->pbmih,
- DIB_RGB_COLORS);
-
- /* Create a memory DC to hold the stipple */
- hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
-
- /* Select the stipple bitmap into the stipple DC */
- hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
- if (hbmpOrigStipple == NULL)
- FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
- "SelectObject () failed on hbmpOrigStipple\n");
-
- /* Make a temporary copy of the foreground and background colors */
- bg = pGC->bgPixel;
- fg = pGC->fgPixel;
-
- /* Translate the depth-dependent colors to Win32 COLORREFs */
- TRANSLATE_COLOR (fg);
- TRANSLATE_COLOR (bg);
- SetTextColor (pGCPriv->hdc, fg);
- SetBkColor (pGCPriv->hdc, bg);
-
- while (iSpans--)
- {
- int width = pStipple->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pStipple->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pStipple->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pStipple->drawable.width)
- width = pStipple->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdc,
- iX, fullY1,
- width, 1,
- hdcStipple,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Clear the stipple HDC */
- SelectObject (hdcStipple, hbmpOrigStipple);
- DeleteDC (hdcStipple);
-
- /* Delete the device dependent stipple bitmap */
- DeleteObject (hBitmap);
-
- break;
-
- case FillStippled:
- pStipple = pGC->stipple;
- pStipplePriv = winGetPixmapPriv (pStipple);
-
- /* Create a device-dependent bitmap for the stipple */
- hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
- (BITMAPINFOHEADER *)pStipplePriv->pbmih,
- CBM_INIT,
- pStipplePriv->pbBits,
- (BITMAPINFO *)pStipplePriv->pbmih,
- DIB_RGB_COLORS);
-
- /* Create a memory DC to hold the stipple */
- hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
-
- /* Select the stipple bitmap into the stipple DC */
- hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
- if (hbmpOrigStipple == NULL)
- FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
- "SelectObject () failed on hbmpOrigStipple\n");
-
- /* Make a temporary copy of the foreground and background colors */
- bg = pGC->bgPixel;
- fg = pGC->fgPixel;
-
- /* Translate the depth-dependent colors to Win32 COLORREFs */
- TRANSLATE_COLOR (fg);
- TRANSLATE_COLOR (bg);
-
- /* this is fudgy, we should only invert on the last one
- * We need to get the black/white pixels right in the
- * colormap. But yeah ! it's working..
- */
- if (pGC->bgPixel != -1 && pGC->fgPixel != -1)
- {
- SetTextColor (pGCPriv->hdc, fg);
- SetBkColor (pGCPriv->hdc, bg);
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0,0,
- 0x330008);
- }
- else if (pGC->bgPixel == -1)
- {
- SetTextColor (pGCPriv->hdc, fg);
- SetBkMode (pGCPriv->hdc, TRANSPARENT);
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0,0,
- 0x330008);
- }
- else if (pGC->fgPixel == -1)
- {
- SetTextColor (pGCPriv->hdc, bg);
- SetBkMode (pGCPriv->hdc, TRANSPARENT);
-#if 0
- BitBlt (hdcStipple,
- 0, 0,
- pStipple->drawable.width, pStipple->drawable.height,
- hdcStipple,
- 0, 0,
- 0x330008);
-#endif
- }
-
- while (iSpans--)
- {
- int width = pStipple->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pStipple->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pStipple->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pStipple->drawable.width)
- width = pStipple->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdc,
- iX, fullY1,
- width, 1,
- hdcStipple,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Clear the stipple HDC */
- SelectObject (hdcStipple, hbmpOrigStipple);
- DeleteDC (hdcStipple);
-
- /* Delete the device dependent stipple bitmap */
- DeleteObject (hBitmap);
-
- /* Restore the background mode */
- SetBkMode (pGCPriv->hdc, OPAQUE);
- break;
-
- case FillTiled:
-
- /* Get a pixmap pointer from the tile pointer, and fetch privates */
- pTile = (PixmapPtr) pGC->tile.pixmap;
- pTilePriv = winGetPixmapPriv (pTile);
-
- /* Select the tile into a DC */
- hbmpOrig = SelectObject (pGCPriv->hdcMem, pTilePriv->hBitmap);
- if (hbmpOrig == NULL)
- FatalError ("winFillSpans - DRAWABLE_WINDOW - FillTiled - "
- "SelectObject () failed on pTilePriv->hBitmap\n");
-
- while (iSpans--)
- {
- int width = pTile->drawable.width;
- fullX1 = pPoints->x;
- fullY1 = pPoints->y;
- fullX2 = fullX1 + (int) *piWidths;
- pPoints++;
- piWidths++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- for (iX = fullX1; iX < fullX2; iX += width)
- {
- int xoffset;
-
- if ((iX + pTile->drawable.width) > fullX2)
- width = fullX2 - iX;
- else
- width = pTile->drawable.width;
-
- if (iX == fullX1)
- xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pTile->drawable.width) - pTile->drawable.width)) % pTile->drawable.width;
- else
- xoffset = 0;
-
- if (xoffset + width > pTile->drawable.width)
- width = pTile->drawable.width - xoffset;
-
- BitBlt (pGCPriv->hdc,
- iX, fullY1,
- width, 1,
- pGCPriv->hdcMem,
- xoffset,
- (fullY1 - (pDrawable->y + (pGC->patOrg.y % pTile->drawable.height) - pTile->drawable.height)) % pTile->drawable.height,
- g_copyROP[pGC->alu]);
- }
- }
-
- /* Push the tile pixmap out of the memory HDC */
- SelectObject (pGCPriv->hdcMem, hbmpOrig);
- break;
-
- default:
- ErrorF ("winFillSpans - DRAWABLE_WINDOW - Unknown fillStyle\n");
- break;
- }
-
- /* Reset clip region */
- SelectClipRgn (pGCPriv->hdc, NULL);
- break;
-
- case UNDRAWABLE_WINDOW:
- /* UNDRAWABLE_WINDOW doesn't appear to get called when running xterm */
- switch (pGC->fillStyle)
- {
- case FillSolid:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillSolid - "
- "Unimplemented\n");
- break;
-
- case FillStippled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillStippled - "
- "Unimplemented\n");
- break;
-
- case FillTiled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillTiled - "
- "Unimplemented\n");
- break;
-
- case FillOpaqueStippled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - OpaqueStippled - "
- "Unimplemented\n");
- break;
-
- default:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - Unknown fillStyle\n");
- break;
- }
- break;
-
- case DRAWABLE_BUFFER:
- /* DRAWABLE_BUFFER seems to be undocumented. */
- ErrorF ("winFillSpans - DRAWABLE_BUFFER - Unimplemented\n");
- break;
-
- default:
- ErrorF ("winFillSpans - Unknown drawable type\n");
- break;
- }
-}
diff --git a/hw/xwin/winfont.c b/hw/xwin/winfont.c
deleted file mode 100644
index 97bd7967b..000000000
--- a/hw/xwin/winfont.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winfont.c,v 1.3 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 32 */
-/* See mfb/mfbfont.c - mfbRealizeFont() - which is empty :) */
-Bool
-winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
-{
-#if CYGDEBUG
- ErrorF ("winRealizeFont()\n");
-#endif
- return TRUE;
-}
-
-/* See Porting Layer Definition - p. 32 */
-/* See mfb/mfbfont.c - mfbUnrealizeFont() - which is empty :) */
-Bool
-winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
-{
-#if CYGDEBUG
- ErrorF ("winUnrealizeFont()\n");
-#endif
- return TRUE;
-}
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
deleted file mode 100644
index a4e2a53cb..000000000
--- a/hw/xwin/wingc.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wingc.c,v 1.11 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-void
-winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg);
-
-#if 0
-/* GC Handling Routines */
-const GCFuncs winGCFuncs = {
- winValidateGCNativeGDI,
- winChangeGCNativeGDI,
- winCopyGCNativeGDI,
- winDestroyGCNativeGDI,
- winChangeClipNativeGDI,
- winDestroyClipNativeGDI,
- winCopyClipNativeGDI,
-};
-#else
-const GCFuncs winGCFuncs = {
- winValidateGCNativeGDI,
- miChangeGC,
- miCopyGC,
- winDestroyGCNativeGDI,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-#endif
-
-/* Drawing Primitives */
-const GCOps winGCOps = {
- winFillSpansNativeGDI,
- winSetSpansNativeGDI,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- winPolyLineNativeGDI,
- miPolySegment,
- miPolyRectangle,
- miPolyArc,
- miFillPolygon,
- miPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
-#if 0
- winImageGlyphBltNativeGDI,
- winPolyGlyphBltNativeGDI,
-#else
- miImageGlyphBlt,
- miPolyGlyphBlt,
-#endif
- winPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-
-/* See Porting Layer Definition - p. 45 */
-/* See mfb/mfbgc.c - mfbCreateGC() */
-/* See Strategies for Porting - pp. 15, 16 */
-Bool
-winCreateGCNativeGDI (GCPtr pGC)
-{
- winPrivGCPtr pGCPriv = NULL;
- winPrivScreenPtr pScreenPriv = NULL;
-
-#if 0
- ErrorF ("winCreateGCNativeGDI - depth: %d\n",
- pGC->depth);
-#endif
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
- pGC->freeCompClip = FALSE;
- pGC->pCompositeClip = 0;
-
- pGC->ops = (GCOps *) &winGCOps;
- pGC->funcs = (GCFuncs *) &winGCFuncs;
-
- /* We want all coordinates passed to spans functions to be screen relative */
- pGC->miTranslate = TRUE;
-
- /* Allocate privates for this GC */
- pGCPriv = winGetGCPriv (pGC);
- if (pGCPriv == NULL)
- {
- ErrorF ("winCreateGCNativeGDI () - Privates pointer was NULL\n");
- return FALSE;
- }
-
- /* Create a new screen DC for the display window */
- pScreenPriv = winGetScreenPriv (pGC->pScreen);
- pGCPriv->hdc = GetDC (pScreenPriv->hwndScreen);
-
- /* Allocate a memory DC for the GC */
- pGCPriv->hdcMem = CreateCompatibleDC (pGCPriv->hdc);
-
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 45 */
-void
-winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges)
-{
-#if 0
- ErrorF ("winChangeGCNativeGDI () - Doing nothing\n");
-#endif
-}
-
-
-void
-winValidateGCNativeGDI (GCPtr pGC,
- unsigned long ulChanges,
- DrawablePtr pDrawable)
-{
- if ((ulChanges & (GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode))
- || (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
- {
- miComputeCompositeClip (pGC, pDrawable);
- }
-}
-
-
-/* See Porting Layer Definition - p. 46 */
-void
-winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 46 */
-void
-winDestroyGCNativeGDI (GCPtr pGC)
-{
- winGCPriv(pGC);
- winScreenPriv(pGC->pScreen);
-
- if (pGC->freeCompClip)
- REGION_DESTROY (pGC->pScreen, pGC->pCompositeClip);
-
- /* Free the memory DC */
- if (pGCPriv->hdcMem != NULL)
- {
- DeleteDC (pGCPriv->hdcMem);
- pGCPriv->hdcMem = NULL;
- }
-
- /* Release the screen DC for the display window */
- if (pGCPriv->hdc != NULL)
- {
- ReleaseDC (pScreenPriv->hwndScreen, pGCPriv->hdc);
- pGCPriv->hdc = NULL;
- }
-
- /* Invalidate the GC privates pointer */
- winSetGCPriv (pGC, NULL);
-}
-
-
-/* See Porting Layer Definition - p. 46 */
-void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-void
-winDestroyClipNativeGDI (GCPtr pGC)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc)
-{
-
-}
diff --git a/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c
deleted file mode 100644
index 49ba7f2fb..000000000
--- a/hw/xwin/wingetsp.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- * Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wingetsp.c,v 1.8 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 55 */
-void
-winGetSpansNativeGDI (DrawablePtr pDrawable,
- int nMax,
- DDXPointPtr pPoints,
- int *piWidths,
- int iSpans,
- char *pDsts)
-{
- PixmapPtr pPixmap = NULL;
- winPrivPixmapPtr pPixmapPriv = NULL;
- int iSpan;
- DDXPointPtr pPoint = NULL;
- int *piWidth = NULL;
- char *pDst = pDsts;
- HBITMAP hbmpWindow, hbmpOrig, hbmpOrig1;
- BYTE *pbWindow = NULL;
- HDC hdcMem, hdcMem1;
- ScreenPtr pScreen = pDrawable->pScreen;
- winScreenPriv(pScreen);
-
- /* Branch on the drawable type */
- switch (pDrawable->type)
- {
- case DRAWABLE_PIXMAP:
-#if 0
- ErrorF ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
- pDrawable);
-#endif
-
- pPixmap = (PixmapPtr) pDrawable;
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
- /* Open a memory HDC */
- hdcMem1 = CreateCompatibleDC (NULL);
- hdcMem = CreateCompatibleDC (NULL);
-
- /* Select the drawable pixmap into a DC */
- hbmpOrig1 = SelectObject (hdcMem1, pPixmapPriv->hBitmap);
-
- if (hbmpOrig1 == NULL)
- FatalError ("winGetSpans - DRAWABLE_PIXMAP - SelectObject () "
- "failed on pPixmapPriv->hBitmap\n");
-
- /* Loop through spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
- {
- pPoint = pPoints + iSpan;
- piWidth = piWidths + iSpan;
-
- hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
- pDrawable->depth,
- &pbWindow,
- NULL);
-
- hbmpOrig = SelectObject (hdcMem, hbmpWindow);
-
- /* Transfer the window bits to the window bitmap */
- BitBlt (hdcMem,
- 0, 0,
- *piWidth, 1,
- hdcMem1,
- pPoint->x, pPoint->y,
- SRCCOPY);
-
- memcpy (pDst,
- (char*) pbWindow,
- PixmapBytePad (*piWidth, pDrawable->depth));
-
- /* Pop the window bitmap out of the HDC and delete the bitmap */
- SelectObject (hdcMem, hbmpOrig);
- DeleteObject (hbmpWindow);
-
-#if 0
- ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *piWidth);
-#endif
-
- /* Calculate offset of next bit destination */
- pDst += PixmapBytePad (*piWidth, pDrawable->depth);
- }
-
- /* Pop the pixmap's bitmap out of the HDC */
- SelectObject (hdcMem1, hbmpOrig1);
-
- /* Delete the HDCs */
- DeleteDC (hdcMem1);
- DeleteDC (hdcMem);
- break;
-
- case DRAWABLE_WINDOW:
-#if 0
- ErrorF ("winGetSpans - DRAWABLE_WINDOW\n");
-#endif
-
- /* Open a memory HDC */
- hdcMem = CreateCompatibleDC (NULL);
-
- /* Loop through spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
- {
- pPoint = pPoints + iSpan;
- piWidth = piWidths + iSpan;
-
- hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
- pDrawable->depth,
- &pbWindow,
- NULL);
-
- hbmpOrig = SelectObject (hdcMem, hbmpWindow);
-
- /* Transfer the window bits to the window bitmap */
- BitBlt (hdcMem,
- 0, 0,
- *piWidth, 1,
- pScreenPriv->hdcScreen,
- pPoint->x, pPoint->y,
- SRCCOPY);
-
- memcpy (pDst,
- (char*) pbWindow,
- PixmapBytePad (*piWidth, pDrawable->depth));
-
- /* Pop the window bitmap out of the HDC */
- SelectObject (hdcMem, hbmpOrig);
-
- DeleteObject (hbmpWindow);
-
-#if 0
- ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *piWidth);
-#endif
-
- /* Calculate offset of next bit destination */
- pDst += PixmapBytePad (*piWidth, pDrawable->depth);
- }
-
- /* Delete the window bitmap */
- DeleteDC (hdcMem);
- break;
-
- case UNDRAWABLE_WINDOW:
- FatalError ("winGetSpans - UNDRAWABLE_WINDOW\n");
- break;
-
- case DRAWABLE_BUFFER:
- FatalError ("winGetSpans - DRAWABLE_BUFFER\n");
- break;
-
- default:
- FatalError ("winGetSpans - Unknown drawable type\n");
- break;
- }
-}
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
deleted file mode 100644
index 95f245e57..000000000
--- a/hw/xwin/winkeybd.c
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.13 2003/07/29 21:25:17 dawes Exp $ */
-
-
-#include "win.h"
-#include "winkeybd.h"
-#include "winconfig.h"
-
-#ifdef XKB
-#define XKB_IN_SERVER
-#include "XKBsrv.h"
-#endif
-
-static Bool g_winKeyState[NUM_KEYCODES];
-
-
-#if WIN_NEW_KEYBOARD_SUPPORT
-
-const unsigned int MaxKeysPerKey = 4;
-
-void
-winProcessKeyEvent (DWORD dwVirtualKey, DWORD dwKeyData)
-{
- Bool fDown = ((dwKeyData & 0x80000000) == 0);
- winKeyEventsRec kerEvent;
- int i;
-
- /* Get the key events */
- kerEvent = winTranslateKey (dwVirtualKey, dwKeyData);
-
- if (kerEvent.dwReleaseModifiers & WIN_MOD_LCONTROL)
- winSendKeyEvent (XK_Control_L, FALSE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_RCONTROL)
- winSendKeyEvent (XK_Control_R, FALSE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_LALT)
- winSendKeyEvent (XK_Alt_L, FALSE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_RALT)
- winSendKeyEvent (XK_Alt_R, FALSE);
-
- for (i = 0; kerEvent.dwXKeycodes[i] != XK_VoidSymbol; ++i)
- winSendKeyEvent (kerEvent.dwXKeycodes[i], fDown);
-
- if (kerEvent.dwReleaseModifiers & WIN_MOD_LCONTROL)
- winSendKeyEvent (XK_Control_L, FALSE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_RCONTROL)
- winSendKeyEvent (XK_Control_R, TRUE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_LALT)
- winSendKeyEvent (XK_Alt_L, FALSE);
- if (kerEvent.dwReleaseModifiers & WIN_MOD_RALT)
- winSendKeyEvent (XK_Alt_R, TRUE);
-
-}
-
-
-winKeyEventsRec
-winTranslateKey (DWORD dwVirtualKey, DWORD dwKeyData)
-{
- winKeyEventsRec kerEvents;
- Bool fExtended = ((HIWORD (dwKeyData) & KF_EXTENDED) != 0);
- int i;
- DWORD dwNumEvents = 0;
- BYTE bKeyboardState[256];
- int iReturn;
- unsigned char cAscii[4];
-
- /* Remap extended modifiers to the right version of that key. */
- if (fExtended)
- {
- switch (dwVirtualKey)
- {
- case VK_MENU:
- dwVirtualKey = VK_RMENU;
- break;
-
- case VK_CONTROL:
- dwVirtualKey = VK_RCONTROL;
- break;
- }
- }
-
- /* Initialize the modifiers to release flag */
- kerEvents.dwReleaseModifiers = 0;
-
- /* Look up the current virtual key code in the translation table */
- for (i = 0; i < g_winKeymapEntries; ++i)
- {
- /* Did we find a mapping? */
- if (winKeymap[i].dwVirtualKey == dwVirtualKey)
- {
- /* Mapping found, we have at least one event now */
- kerEvents.dwXKeycodes[dwNumEvents] = winKeymap[i].dwXKey;
- break;
- }
- }
-
-
- /* Break out early, if we found the key in the translation table */
- if (dwNumEvents != 0)
- {
- /* Terminate the last of the key events with a void symbol */
- kerEvents.dwXKeycodes[dwNumEvents] = XK_VoidSymbol;
- return kerEvents;
- }
-
- /* Get the state of all keyboard keys */
- GetKeyboardState (bKeyboardState);
-
- /* Try to convert the key to ASCII */
- iReturn = ToAscii (dwVirtualKey, 0, bKeyboardState, (WORD *) cAscii, 0);
-
- /*
- * Left Control and Alt pressed, combined with a valid result
- * from ToAscii means that we have found the Windows version of AltGr.
- */
- if ((bKeyboardState[VK_MENU] & 0x80) && (bKeyboardState[VK_CONTROL] & 0x80)
- && (iReturn >= 1)
- && (((cAscii[0] >= 32) && (cAscii[0] <= 126))
- || (cAscii[0] >= 160)))
- {
- /* These three calls will return 0 on Windows 95/98/Me */
- if ((GetKeyState (VK_LCONTROL) & KF_UP))
- kerEvents.dwReleaseModifiers |= WIN_MOD_LCONTROL;
- if ((GetKeyState (VK_LMENU) & KF_UP))
- kerEvents.dwReleaseModifiers |= WIN_MOD_LALT;
- if ((GetKeyState (VK_RMENU) & KF_UP))
- kerEvents.dwReleaseModifiers |= WIN_MOD_RALT;
-
- /* Windows 95/98/Me handling - pop all of them */
- if (kerEvents.dwReleaseModifiers == 0)
- kerEvents.dwReleaseModifiers
- = WIN_MOD_LCONTROL | WIN_MOD_LALT | WIN_MOD_RALT;
-
- /* Copy the string of character events */
- for (i = 0; i < iReturn; ++i)
- kerEvents.dwXKeycodes[dwNumEvents++] = cAscii[i];
- }
-
- /* Handle non Ctrl+Alt cases*/
- if (dwNumEvents == 0)
- {
- bKeyboardState[VK_CONTROL] = 0;
- bKeyboardState[VK_LCONTROL] = 0;
- bKeyboardState[VK_RCONTROL] = 0;
-
- iReturn = ToAscii (dwVirtualKey, 0, bKeyboardState, (WORD *)cAscii, 0);
- if (iReturn < 0)
- {
- switch (cAscii[0])
- {
- case '`':
- kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_grave;
- break;
-
- case '\'':
- kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_acute;
- break;
-
- case '~':
- kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_tilde;
- break;
-
- case '^':
- kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_circumflex;
- break;
- }
- }
-
- /* Send what we've got if its a printable character */
- if (iReturn >= 1)
- for (i = 0; i < iReturn; ++i)
- kerEvents.dwXKeycodes[dwNumEvents++] = cAscii[i];
- }
-
-
- /* Terminate the last of the key events with a void symbol */
- kerEvents.dwXKeycodes[dwNumEvents] = XK_VoidSymbol;
- return kerEvents;
-}
-
-
-#else /* WIN_NEW_KEYBOARD_SUPPORT */
-
-
-/*
- * Translate a Windows WM_[SYS]KEY(UP/DOWN) message
- * into an ASCII scan code.
- *
- * We do this ourselves, rather than letting Windows handle it,
- * because Windows tends to munge the handling of special keys,
- * like AltGr on European keyboards.
- */
-
-void
-winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
-{
- int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1];
- int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2];
-
- /* Branch on special extended, special non-extended, or normal key */
- if ((HIWORD (lParam) & KF_EXTENDED) && iKeyFixupEx)
- *piScanCode = iKeyFixupEx;
- else if (iKeyFixup)
- *piScanCode = iKeyFixup;
- else
- *piScanCode = LOBYTE (HIWORD (lParam));
-}
-
-#endif /* WIN_NEW_KEYBOARD_SUPPORT */
-
-
-/*
- * We call this function from winKeybdProc when we are
- * initializing the keyboard.
- */
-
-void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- int i;
- KeySym *pMap = map;
- KeySym *pKeySym;
-
- /*
- * Initialize all key states to up... which may not be true
- * but it is close enough.
- */
- ZeroMemory (g_winKeyState, sizeof (g_winKeyState[0]) * NUM_KEYCODES);
-
- /* MAP_LENGTH is defined in Xserver/include/input.h to be 256 */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- /* Loop through all valid entries in the key symbol table */
- for (pKeySym = pMap, i = MIN_KEYCODE;
- i < (MIN_KEYCODE + NUM_KEYCODES);
- i++, pKeySym += GLYPHS_PER_KEY)
- {
- switch (*pKeySym)
- {
- case XK_Shift_L:
- case XK_Shift_R:
- pModMap[i] = ShiftMask;
- break;
-
- case XK_Control_L:
- case XK_Control_R:
- pModMap[i] = ControlMask;
- break;
-
- case XK_Caps_Lock:
- pModMap[i] = LockMask;
- break;
-
- case XK_Alt_L:
- case XK_Alt_R:
- pModMap[i] = AltMask;
- break;
-
-#if !WIN_NEW_KEYBOARD_SUPPORT
- case XK_Num_Lock:
- pModMap[i] = NumLockMask;
- break;
-
- case XK_Scroll_Lock:
- pModMap[i] = ScrollLockMask;
- break;
-
- /* Hirigana/Katakana toggle */
- case XK_Kana_Lock:
- case XK_Kana_Shift:
- pModMap[i] = KanaMask;
- break;
-#endif
-
- /* alternate toggle for multinational support */
- case XK_Mode_switch:
- pModMap[i] = AltLangMask;
- break;
- }
- }
-
- pKeySyms->map = (KeySym *) pMap;
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-
-/* Ring the keyboard bell (system speaker on PCs) */
-void
-winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
- pointer pCtrl, int iClass)
-{
- /*
- * We can't use Beep () here because it uses the PC speaker
- * on NT/2000. MessageBeep (MB_OK) will play the default system
- * sound on systems with a sound card or it will beep the PC speaker
- * on systems that do not have a sound card.
- */
- MessageBeep (MB_OK);
-}
-
-
-/* Change some keyboard configuration parameters */
-void
-winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
-{
-
-}
-
-
-/*
- * See Porting Layer Definition - p. 18
- * winKeybdProc is known as a DeviceProc.
- */
-
-int
-winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
-{
- KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
- DevicePtr pDevice = (DevicePtr) pDeviceInt;
-#ifdef XKB
- XkbComponentNamesRec names;
-#endif
-
- switch (iState)
- {
- case DEVICE_INIT:
- winConfigKeyboard (pDeviceInt);
-
- winGetKeyMappings (&keySyms, modMap);
-
-#ifdef XKB
- /* FIXME: Maybe we should use winGetKbdLeds () here? */
- defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
-#else
- defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
-#endif
-
-#ifdef XKB
- if (g_winInfo.xkb.disable)
- {
-#endif
- InitKeyboardDeviceStruct (pDevice,
- &keySyms,
- modMap,
- winKeybdBell,
- winKeybdCtrl);
-#ifdef XKB
- }
- else
- {
-
- if (XkbInitialMap)
- {
- names.keymap = XkbInitialMap;
- names.keycodes = NULL;
- names.types = NULL;
- names.compat = NULL;
- names.symbols = NULL;
- names.geometry = NULL;
- }
- else
- {
- names.keymap = g_winInfo.xkb.keymap;
- names.keycodes = g_winInfo.xkb.keycodes;
- names.types = g_winInfo.xkb.types;
- names.compat = g_winInfo.xkb.compat;
- names.symbols = g_winInfo.xkb.symbols;
- names.geometry = g_winInfo.xkb.geometry;
- }
-
- ErrorF("Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
- " Variant = \"%s\" Options = \"%s\"\n",
- g_winInfo.xkb.rules, g_winInfo.xkb.model,
- g_winInfo.xkb.layout, g_winInfo.xkb.variant,
- g_winInfo.xkb.options);
-
- XkbSetRulesDflts (g_winInfo.xkb.rules, g_winInfo.xkb.model,
- g_winInfo.xkb.layout, g_winInfo.xkb.variant,
- g_winInfo.xkb.options);
- XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms,
- modMap, winKeybdBell, winKeybdCtrl);
- }
-#endif
- break;
- case DEVICE_ON:
- pDevice->on = TRUE;
- break;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pDevice->on = FALSE;
- break;
- }
-
- return Success;
-}
-
-
-/*
- * Detect current mode key states upon server startup.
- *
- * Simulate a press and release of any key that is currently
- * toggled.
- */
-
-void
-winInitializeModeKeyStates (void)
-{
-#if !WIN_NEW_KEYBOARD_SUPPORT
- /* Restore NumLock */
- if (GetKeyState (VK_NUMLOCK) & 0x0001)
- {
- winSendKeyEvent (KEY_NumLock, TRUE);
- winSendKeyEvent (KEY_NumLock, FALSE);
- }
-
- /* Restore CapsLock */
- if (GetKeyState (VK_CAPITAL) & 0x0001)
- {
- winSendKeyEvent (KEY_CapsLock, TRUE);
- winSendKeyEvent (KEY_CapsLock, FALSE);
- }
-
- /* Restore ScrollLock */
- if (GetKeyState (VK_SCROLL) & 0x0001)
- {
- winSendKeyEvent (KEY_ScrollLock, TRUE);
- winSendKeyEvent (KEY_ScrollLock, FALSE);
- }
-
- /* Restore KanaLock */
- if (GetKeyState (VK_KANA) & 0x0001)
- {
- winSendKeyEvent (KEY_HKTG, TRUE);
- winSendKeyEvent (KEY_HKTG, FALSE);
- }
-#endif
-}
-
-
-/*
- * We have to store the last state of each mode
- * key before we lose the keyboard focus.
- */
-
-void
-winStoreModeKeyStates (ScreenPtr pScreen)
-{
-#if !WIN_NEW_KEYBOARD_SUPPORT
- winScreenPriv(pScreen);
-
- /* Initialize all mode key states to off */
- pScreenPriv->dwModeKeyStates = 0x0L;
-
- pScreenPriv->dwModeKeyStates |=
- (GetKeyState (VK_NUMLOCK) & 0x0001) << NumLockMapIndex;
-
- pScreenPriv->dwModeKeyStates |=
- (GetKeyState (VK_SCROLL) & 0x0001) << ScrollLockMapIndex;
-
- pScreenPriv->dwModeKeyStates |=
- (GetKeyState (VK_CAPITAL) & 0x0001) << LockMapIndex;
-
- pScreenPriv->dwModeKeyStates |=
- (GetKeyState (VK_KANA) & 0x0001) << KanaMapIndex;
-#endif
-}
-
-
-/*
- * Upon regaining the keyboard focus we must
- * resynchronize our internal mode key states
- * with the actual state of the keys.
- */
-
-void
-winRestoreModeKeyStates (ScreenPtr pScreen)
-{
-#if !WIN_NEW_KEYBOARD_SUPPORT
- winScreenPriv(pScreen);
- DWORD dwKeyState;
-
- /*
- * NOTE: The C XOR operator, ^, will not work here because it is
- * a bitwise operator, not a logical operator. C does not
- * have a logical XOR operator, so we use a macro instead.
- */
-
- /* Has the key state changed? */
- dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001;
- if (WIN_XOR (pScreenPriv->dwModeKeyStates & NumLockMask, dwKeyState))
- {
- winSendKeyEvent (KEY_NumLock, TRUE);
- winSendKeyEvent (KEY_NumLock, FALSE);
- }
-
- /* Has the key state changed? */
- dwKeyState = GetKeyState (VK_CAPITAL) & 0x0001;
- if (WIN_XOR (pScreenPriv->dwModeKeyStates & LockMask, dwKeyState))
- {
- winSendKeyEvent (KEY_CapsLock, TRUE);
- winSendKeyEvent (KEY_CapsLock, FALSE);
- }
-
- /* Has the key state changed? */
- dwKeyState = GetKeyState (VK_SCROLL) & 0x0001;
- if (WIN_XOR (pScreenPriv->dwModeKeyStates & ScrollLockMask, dwKeyState))
- {
- winSendKeyEvent (KEY_ScrollLock, TRUE);
- winSendKeyEvent (KEY_ScrollLock, FALSE);
- }
-
- /* Has the key state changed? */
- dwKeyState = GetKeyState (VK_KANA) & 0x0001;
- if (WIN_XOR (pScreenPriv->dwModeKeyStates & KanaMask, dwKeyState))
- {
- winSendKeyEvent (KEY_HKTG, TRUE);
- winSendKeyEvent (KEY_HKTG, FALSE);
- }
-#endif
-}
-
-
-#if !WIN_NEW_KEYBOARD_SUPPORT
-/*
- * Look for the lovely fake Control_L press/release generated by Windows
- * when AltGr is pressed/released on a non-U.S. keyboard.
- */
-
-Bool
-winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam)
-{
- MSG msgNext;
- LONG lTime;
- Bool fReturn;
-
- /*
- * Fake Ctrl_L presses will be followed by an Alt_R keypress
- * with the same timestamp as the Ctrl_L press.
- */
- if (message == WM_KEYDOWN
- && wParam == VK_CONTROL
- && (HIWORD (lParam) & KF_EXTENDED) == 0)
- {
- /* Got a Ctrl_L press */
-
- /* Get time of current message */
- lTime = GetMessageTime ();
-
- /* Look for fake Ctrl_L preceeding an Alt_R press. */
- fReturn = PeekMessage (&msgNext, NULL,
- WM_KEYDOWN, WM_KEYDOWN,
- PM_NOREMOVE);
-
- /* Is next press an Alt_R with the same timestamp? */
- if (fReturn && msgNext.wParam == VK_MENU
- && msgNext.time == lTime
- && (HIWORD (msgNext.lParam) & KF_EXTENDED))
- {
- /*
- * Next key press is Alt_R with same timestamp as current
- * Ctrl_L message. Therefore, this Ctrl_L press is a fake
- * event, so discard it.
- */
- return TRUE;
- }
- }
-
- /*
- * Fake Ctrl_L releases will be followed by an Alt_R release
- * with the same timestamp as the Ctrl_L release.
- */
- if ((message == WM_KEYUP || message == WM_SYSKEYUP)
- && wParam == VK_CONTROL
- && (HIWORD (lParam) & KF_EXTENDED) == 0)
- {
- /* Got a Ctrl_L release */
-
- /* Get time of current message */
- lTime = GetMessageTime ();
-
- /* Look for fake Ctrl_L release preceeding an Alt_R release. */
- fReturn = PeekMessage (&msgNext, NULL,
- WM_KEYUP, WM_SYSKEYUP,
- PM_NOREMOVE);
-
- /* Is next press an Alt_R with the same timestamp? */
- if (fReturn
- && (msgNext.message == WM_KEYUP
- || msgNext.message == WM_SYSKEYUP)
- && msgNext.wParam == VK_MENU
- && msgNext.time == lTime
- && (HIWORD (msgNext.lParam) & KF_EXTENDED))
- {
- /*
- * Next key release is Alt_R with same timestamp as current
- * Ctrl_L message. Therefore, this Ctrl_L release is a fake
- * event, so discard it.
- */
- return TRUE;
- }
- }
-
- /* Not a fake control left press/release */
- return FALSE;
-}
-#endif /* WIN_NEW_KEYBOARD_SUPPORT */
-
-
-/*
- * Lift any modifier keys that are pressed
- */
-
-void
-winKeybdReleaseKeys ()
-{
-#if !WIN_NEW_KEYBOARD_SUPPORT
- int i;
-
- /* Verify that the mi input system has been initialized */
- if (g_fdMessageQueue == WIN_FD_INVALID)
- return;
-
- /* Loop through all keys */
- for (i = 0; i < NUM_KEYCODES; ++i)
- {
- /* Pop key if pressed */
- if (g_winKeyState[i])
- winSendKeyEvent (i, FALSE);
-
- /* Reset pressed flag for keys */
- g_winKeyState[i] = FALSE;
- }
-#endif
-}
-
-
-/*
- * Take a raw X key code and send an up or down event for it.
- *
- * Thanks to VNC for inspiration, though it is a simple function.
- */
-
-void
-winSendKeyEvent (DWORD dwKey, Bool fDown)
-{
- xEvent xCurrentEvent;
-
- /*
- * When alt-tabing between screens we can get phantom key up messages
- * Here we only pass them through it we think we should!
- */
- if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) return;
-
- /* Update the keyState map */
- g_winKeyState[dwKey] = fDown;
-
- ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
-
- xCurrentEvent.u.u.type = fDown ? KeyPress : KeyRelease;
- xCurrentEvent.u.keyButtonPointer.time =
- g_c32LastInputEventTime = GetTickCount ();
- xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE;
- mieqEnqueue (&xCurrentEvent);
-}
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
deleted file mode 100644
index 0822b0e5f..000000000
--- a/hw/xwin/winkeybd.h
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.h,v 1.3 2002/07/05 09:19:26 alanh Exp $ */
-
-/*
- * We need symbols for the scan codes of keys.
- */
-#include "../xfree86/common/atKeynames.h"
-
-
-/*
- * Include the standard XFree86 ASCII keymap.
- *
- * This header declares a static KeySym array called 'map'.
- */
-#include "../xfree86/common/xf86Keymap.h"
-
-
-#if WIN_NEW_KEYBOARD_SUPPORT
-
-/* Define the keymap structure */
-typedef struct
-{
- DWORD dwVirtualKey;
- DWORD dwXKey;
-} winKeymappingRec, *winKeymappingPtr;
-
-static const winKeymappingRec
-winKeymap[] = {
- {VK_BACK, XK_BackSpace},
- {VK_TAB, XK_Tab},
- {VK_CLEAR, XK_Clear},
- {VK_RETURN, XK_Return},
- {VK_LSHIFT, XK_Shift_L},
- {VK_RSHIFT, XK_Shift_R},
- {VK_SHIFT, XK_Shift_L},
- {VK_LCONTROL, XK_Control_L},
- {VK_RCONTROL, XK_Control_R},
- {VK_CONTROL, XK_Control_L},
- {VK_LMENU, XK_Alt_L},
- {VK_RMENU, XK_Alt_R},
- {VK_MENU, XK_Alt_L},
- {VK_PAUSE, XK_Pause},
- {VK_CAPITAL, XK_Caps_Lock},
- {VK_ESCAPE, XK_Escape},
- {VK_SPACE, XK_space},
- {VK_PRIOR, XK_Page_Up},
- {VK_NEXT, XK_Page_Down},
- {VK_END, XK_End},
- {VK_HOME, XK_Home},
- {VK_LEFT, XK_Left},
- {VK_UP, XK_Up},
- {VK_RIGHT, XK_Right},
- {VK_DOWN, XK_Down},
- {VK_SELECT, XK_Select},
- {VK_EXECUTE, XK_Execute},
- {VK_SNAPSHOT, XK_Print},
- {VK_INSERT, XK_Insert},
- {VK_DELETE, XK_Delete},
- {VK_HELP, XK_Help},
- {VK_NUMPAD0, XK_KP_0},
- {VK_NUMPAD1, XK_KP_1},
- {VK_NUMPAD2, XK_KP_2},
- {VK_NUMPAD3, XK_KP_3},
- {VK_NUMPAD4, XK_KP_4},
- {VK_NUMPAD5, XK_KP_5},
- {VK_NUMPAD6, XK_KP_6},
- {VK_NUMPAD7, XK_KP_7},
- {VK_NUMPAD8, XK_KP_8},
- {VK_NUMPAD9, XK_KP_9},
- {VK_MULTIPLY, XK_KP_Multiply},
- {VK_ADD, XK_KP_Add},
- {VK_SEPARATOR, XK_KP_Separator}, // often comma
- {VK_SUBTRACT, XK_KP_Subtract},
- {VK_DECIMAL, XK_KP_Decimal},
- {VK_DIVIDE, XK_KP_Divide},
- {VK_F1, XK_F1},
- {VK_F2, XK_F2},
- {VK_F3, XK_F3},
- {VK_F4, XK_F4},
- {VK_F5, XK_F5},
- {VK_F6, XK_F6},
- {VK_F7, XK_F7},
- {VK_F8, XK_F8},
- {VK_F9, XK_F9},
- {VK_F10, XK_F10},
- {VK_F11, XK_F11},
- {VK_F12, XK_F12},
- {VK_F13, XK_F13},
- {VK_F14, XK_F14},
- {VK_F15, XK_F15},
- {VK_F16, XK_F16},
- {VK_F17, XK_F17},
- {VK_F18, XK_F18},
- {VK_F19, XK_F19},
- {VK_F20, XK_F20},
- {VK_F21, XK_F21},
- {VK_F22, XK_F22},
- {VK_F23, XK_F23},
- {VK_F24, XK_F24},
- {VK_NUMLOCK, XK_Num_Lock},
- {VK_SCROLL, XK_Scroll_Lock}
-};
-
-static int g_winKeymapEntries = sizeof (winKeymap) / sizeof (winKeymappingRec);
-
-#else /* WIN_NEW_KEYBOARD_SUPPORT */
-
-#define WIN_KEYMAP_COLS 3
-
-const int
-g_iKeyMap [] = {
- /* count Windows VK, ASCII, ASCII when extended VK */
- /* 0 */ 0, 0, 0,
- /* 1 */ 0, 0, 0,
- /* 2 */ 0, 0, 0,
- /* 3 */ VK_CANCEL, 0, KEY_Break,
- /* 4 */ 0, 0, 0,
- /* 5 */ 0, 0, 0,
- /* 6 */ 0, 0, 0,
- /* 7 */ 0, 0, 0,
- /* 8 */ 0, 0, 0,
- /* 9 */ 0, 0, 0,
- /* 10 */ 0, 0, 0,
- /* 11 */ 0, 0, 0,
- /* 12 */ 0, 0, 0,
- /* 13 */ VK_RETURN, 0, KEY_KP_Enter,
- /* 14 */ 0, 0, 0,
- /* 15 */ 0, 0, 0,
- /* 16 */ VK_SHIFT, KEY_ShiftL, KEY_ShiftR,
- /* 17 */ VK_CONTROL, 0, KEY_RCtrl,
- /* 18 */ VK_MENU, 0, KEY_AltLang,
- /* 19 */ VK_PAUSE, KEY_Pause, 0,
- /* 20 */ 0, 0, 0,
- /* 21 */ 0, 0, 0,
- /* 22 */ 0, 0, 0,
- /* 23 */ 0, 0, 0,
- /* 24 */ 0, 0, 0,
- /* 25 */ 0, 0, 0,
- /* 26 */ 0, 0, 0,
- /* 27 */ 0, 0, 0,
- /* 28 */ 0, 0, 0,
- /* 29 */ 0, 0, 0,
- /* 30 */ 0, 0, 0,
- /* 31 */ 0, 0, 0,
- /* 32 */ 0, 0, 0,
- /* 33 */ VK_PRIOR, 0, KEY_PgUp,
- /* 34 */ VK_NEXT, 0, KEY_PgDown,
- /* 35 */ VK_END, 0, KEY_End,
- /* 36 */ VK_HOME, 0, KEY_Home,
- /* 37 */ VK_LEFT, 0, KEY_Left,
- /* 38 */ VK_UP, 0, KEY_Up,
- /* 39 */ VK_RIGHT, 0, KEY_Right,
- /* 40 */ VK_DOWN, 0, KEY_Down,
- /* 41 */ 0, 0, 0,
- /* 42 */ 0, 0, 0,
- /* 43 */ 0, 0, 0,
- /* 44 */ VK_SNAPSHOT, 0, KEY_Print,
- /* 45 */ VK_INSERT, 0, KEY_Insert,
- /* 46 */ VK_DELETE, 0, KEY_Delete,
- /* 47 */ 0, 0, 0,
- /* 48 */ 0, 0, 0,
- /* 49 */ 0, 0, 0,
- /* 50 */ 0, 0, 0,
- /* 51 */ 0, 0, 0,
- /* 52 */ 0, 0, 0,
- /* 53 */ 0, 0, 0,
- /* 54 */ 0, 0, 0,
- /* 55 */ 0, 0, 0,
- /* 56 */ 0, 0, 0,
- /* 57 */ 0, 0, 0,
- /* 58 */ 0, 0, 0,
- /* 59 */ 0, 0, 0,
- /* 60 */ 0, 0, 0,
- /* 61 */ 0, 0, 0,
- /* 62 */ 0, 0, 0,
- /* 63 */ 0, 0, 0,
- /* 64 */ 0, 0, 0,
- /* 65 */ 0, 0, 0,
- /* 66 */ 0, 0, 0,
- /* 67 */ 0, 0, 0,
- /* 68 */ 0, 0, 0,
- /* 69 */ 0, 0, 0,
- /* 70 */ 0, 0, 0,
- /* 71 */ 0, 0, 0,
- /* 72 */ 0, 0, 0,
- /* 73 */ 0, 0, 0,
- /* 74 */ 0, 0, 0,
- /* 75 */ 0, 0, 0,
- /* 76 */ 0, 0, 0,
- /* 77 */ 0, 0, 0,
- /* 78 */ 0, 0, 0,
- /* 79 */ 0, 0, 0,
- /* 80 */ 0, 0, 0,
- /* 81 */ 0, 0, 0,
- /* 82 */ 0, 0, 0,
- /* 83 */ 0, 0, 0,
- /* 84 */ 0, 0, 0,
- /* 85 */ 0, 0, 0,
- /* 86 */ 0, 0, 0,
- /* 87 */ 0, 0, 0,
- /* 88 */ 0, 0, 0,
- /* 89 */ 0, 0, 0,
- /* 90 */ 0, 0, 0,
- /* 91 */ 0, 0, 0,
- /* 92 */ 0, 0, 0,
- /* 93 */ 0, 0, 0,
- /* 94 */ 0, 0, 0,
- /* 95 */ 0, 0, 0,
- /* 96 */ 0, 0, 0,
- /* 97 */ 0, 0, 0,
- /* 98 */ 0, 0, 0,
- /* 99 */ 0, 0, 0,
- /* 100 */ 0, 0, 0,
- /* 101 */ 0, 0, 0,
- /* 102 */ 0, 0, 0,
- /* 103 */ 0, 0, 0,
- /* 104 */ 0, 0, 0,
- /* 105 */ 0, 0, 0,
- /* 106 */ 0, 0, 0,
- /* 107 */ 0, 0, 0,
- /* 108 */ 0, 0, 0,
- /* 109 */ 0, 0, 0,
- /* 110 */ 0, 0, 0,
- /* 111 */ VK_DIVIDE, 0, KEY_KP_Divide,
- /* 112 */ 0, 0, 0,
- /* 113 */ 0, 0, 0,
- /* 114 */ 0, 0, 0,
- /* 115 */ 0, 0, 0,
- /* 116 */ 0, 0, 0,
- /* 117 */ 0, 0, 0,
- /* 118 */ 0, 0, 0,
- /* 119 */ 0, 0, 0,
- /* 120 */ 0, 0, 0,
- /* 121 */ 0, 0, 0,
- /* 122 */ 0, 0, 0,
- /* 123 */ 0, 0, 0,
- /* 124 */ 0, 0, 0,
- /* 125 */ 0, 0, 0,
- /* 126 */ 0, 0, 0,
- /* 127 */ 0, 0, 0,
- /* 128 */ 0, 0, 0,
- /* 129 */ 0, 0, 0,
- /* 130 */ 0, 0, 0,
- /* 131 */ 0, 0, 0,
- /* 132 */ 0, 0, 0,
- /* 133 */ 0, 0, 0,
- /* 134 */ 0, 0, 0,
- /* 135 */ 0, 0, 0,
- /* 136 */ 0, 0, 0,
- /* 137 */ 0, 0, 0,
- /* 138 */ 0, 0, 0,
- /* 139 */ 0, 0, 0,
- /* 140 */ 0, 0, 0,
- /* 141 */ 0, 0, 0,
- /* 142 */ 0, 0, 0,
- /* 143 */ 0, 0, 0,
- /* 144 */ 0, 0, 0,
- /* 145 */ 0, 0, 0,
- /* 146 */ 0, 0, 0,
- /* 147 */ 0, 0, 0,
- /* 148 */ 0, 0, 0,
- /* 149 */ 0, 0, 0,
- /* 150 */ 0, 0, 0,
- /* 151 */ 0, 0, 0,
- /* 152 */ 0, 0, 0,
- /* 153 */ 0, 0, 0,
- /* 154 */ 0, 0, 0,
- /* 155 */ 0, 0, 0,
- /* 156 */ 0, 0, 0,
- /* 157 */ 0, 0, 0,
- /* 158 */ 0, 0, 0,
- /* 159 */ 0, 0, 0,
- /* 160 */ 0, 0, 0,
- /* 161 */ 0, 0, 0,
- /* 162 */ 0, 0, 0,
- /* 163 */ 0, 0, 0,
- /* 164 */ 0, 0, 0,
- /* 165 */ 0, 0, 0,
- /* 166 */ 0, 0, 0,
- /* 167 */ 0, 0, 0,
- /* 168 */ 0, 0, 0,
- /* 169 */ 0, 0, 0,
- /* 170 */ 0, 0, 0,
- /* 171 */ 0, 0, 0,
- /* 172 */ 0, 0, 0,
- /* 173 */ 0, 0, 0,
- /* 174 */ 0, 0, 0,
- /* 175 */ 0, 0, 0,
- /* 176 */ 0, 0, 0,
- /* 177 */ 0, 0, 0,
- /* 178 */ 0, 0, 0,
- /* 179 */ 0, 0, 0,
- /* 180 */ 0, 0, 0,
- /* 181 */ 0, 0, 0,
- /* 182 */ 0, 0, 0,
- /* 183 */ 0, 0, 0,
- /* 184 */ 0, 0, 0,
- /* 185 */ 0, 0, 0,
- /* 186 */ 0, 0, 0,
- /* 187 */ 0, 0, 0,
- /* 188 */ 0, 0, 0,
- /* 189 */ 0, 0, 0,
- /* 190 */ 0, 0, 0,
- /* 191 */ 0, 0, 0,
- /* 192 */ 0, 0, 0,
- /* 193 */ 0, 0, 0,
- /* 194 */ 0, 0, 0,
- /* 195 */ 0, 0, 0,
- /* 196 */ 0, 0, 0,
- /* 197 */ 0, 0, 0,
- /* 198 */ 0, 0, 0,
- /* 199 */ 0, 0, 0,
- /* 200 */ 0, 0, 0,
- /* 201 */ 0, 0, 0,
- /* 202 */ 0, 0, 0,
- /* 203 */ 0, 0, 0,
- /* 204 */ 0, 0, 0,
- /* 205 */ 0, 0, 0,
- /* 206 */ 0, 0, 0,
- /* 207 */ 0, 0, 0,
- /* 208 */ 0, 0, 0,
- /* 209 */ 0, 0, 0,
- /* 210 */ 0, 0, 0,
- /* 211 */ 0, 0, 0,
- /* 212 */ 0, 0, 0,
- /* 213 */ 0, 0, 0,
- /* 214 */ 0, 0, 0,
- /* 215 */ 0, 0, 0,
- /* 216 */ 0, 0, 0,
- /* 217 */ 0, 0, 0,
- /* 218 */ 0, 0, 0,
- /* 219 */ 0, 0, 0,
- /* 220 */ 0, 0, 0,
- /* 221 */ 0, 0, 0,
- /* 222 */ 0, 0, 0,
- /* 223 */ 0, 0, 0,
- /* 224 */ 0, 0, 0,
- /* 225 */ 0, 0, 0,
- /* 226 */ 0, 0, 0,
- /* 227 */ 0, 0, 0,
- /* 228 */ 0, 0, 0,
- /* 229 */ 0, 0, 0,
- /* 230 */ 0, 0, 0,
- /* 231 */ 0, 0, 0,
- /* 232 */ 0, 0, 0,
- /* 233 */ 0, 0, 0,
- /* 234 */ 0, 0, 0,
- /* 235 */ 0, 0, 0,
- /* 236 */ 0, 0, 0,
- /* 237 */ 0, 0, 0,
- /* 238 */ 0, 0, 0,
- /* 239 */ 0, 0, 0,
- /* 240 */ 0, 0, 0,
- /* 241 */ 0, 0, 0,
- /* 242 */ 0, 0, 0,
- /* 243 */ 0, 0, 0,
- /* 244 */ 0, 0, 0,
- /* 245 */ 0, 0, 0,
- /* 246 */ 0, 0, 0,
- /* 247 */ 0, 0, 0,
- /* 248 */ 0, 0, 0,
- /* 249 */ 0, 0, 0,
- /* 250 */ 0, 0, 0,
- /* 251 */ 0, 0, 0,
- /* 252 */ 0, 0, 0,
- /* 253 */ 0, 0, 0,
- /* 254 */ 0, 0, 0,
- /* 255 */ 0, 0, 0
-};
-#endif /* WIN_NEW_KEYBOARD_SUPPORT */
diff --git a/hw/xwin/winmisc.c b/hw/xwin/winmisc.c
deleted file mode 100644
index ea8303ea9..000000000
--- a/hw/xwin/winmisc.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.6 2002/07/05 09:19:26 alanh Exp $ */
-
-#include "win.h"
-
-
-/* See Porting Layer Definition - p. 33 */
-/*
- * Called by clients, returns the best size for a cursor, tile, or
- * stipple, specified by class (sometimes called kind)
- */
-
-void
-winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
- unsigned short *pHeight, ScreenPtr pScreen)
-{
- ErrorF ("winQueryBestSizeNativeGDI\n");
-}
-
-
-/*
- * Count the number of one bits in a color mask.
- */
-
-CARD8
-winCountBits (DWORD dw)
-{
- DWORD dwBits = 0;
-
- while (dw)
- {
- dwBits += (dw & 1);
- dw >>= 1;
- }
-
- return dwBits;
-}
-
-
-/*
- * Modify the screen pixmap to point to the new framebuffer address
- */
-
-Bool
-winUpdateFBPointer (ScreenPtr pScreen, void *pbits)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Location of shadow framebuffer has changed */
- pScreenInfo->pfb = pbits;
-
- /* Update the screen pixmap */
- if (!(*pScreen->ModifyPixmapHeader) (pScreen->devPrivate,
- pScreen->width,
- pScreen->height,
- pScreen->rootDepth,
- BitsPerPixel (pScreen->rootDepth),
- PixmapBytePad (pScreenInfo->dwStride,
- pScreenInfo->dwBPP),
- pScreenInfo->pfb))
- {
- FatalError ("winUpdateFramebufferPointer - Failed modifying "\
- "screen pixmap\n");
- }
-
- return TRUE;
-}
-
-
-/*
- * Paint the window background with the specified color
- */
-
-BOOL
-winPaintBackground (HWND hwnd, COLORREF colorref)
-{
- HDC hdc;
- HBRUSH hbrush;
- RECT rect;
-
- /* Create an hdc */
- hdc = GetDC (hwnd);
- if (hdc == NULL)
- {
- printf ("gdiWindowProc - GetDC failed\n");
- exit (1);
- }
-
- /* Create and select blue brush */
- hbrush = CreateSolidBrush (colorref);
- if (hbrush == NULL)
- {
- printf ("gdiWindowProc - CreateSolidBrush failed\n");
- exit (1);
- }
-
- /* Get window extents */
- if (GetClientRect (hwnd, &rect) == FALSE)
- {
- printf ("gdiWindowProc - GetClientRect failed\n");
- exit (1);
- }
-
- /* Fill window with blue brush */
- if (FillRect (hdc, &rect, hbrush) == 0)
- {
- printf ("gdiWindowProc - FillRect failed\n");
- exit (1);
- }
-
- /* Delete blue brush */
- DeleteObject (hbrush);
-
- /* Release the hdc */
- ReleaseDC (hwnd, hdc);
-
- return TRUE;
-}
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
deleted file mode 100644
index 8c9439bfd..000000000
--- a/hw/xwin/winmouse.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.4 2001/10/29 21:10:24 alanh Exp $ */
-
-#include "win.h"
-
-void
-winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
-{
-}
-
-
-/*
- * See Porting Layer Definition - p. 18
- * This is known as a DeviceProc
- */
-
-int
-winMouseProc (DeviceIntPtr pDeviceInt, int iState)
-{
- CARD8 map[6];
- DevicePtr pDevice = (DevicePtr) pDeviceInt;
-
- switch (iState)
- {
- case DEVICE_INIT:
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- map[4] = 4;
- map[5] = 5;
- InitPointerDeviceStruct (pDevice,
- map,
- 5, /* Buttons 4 and 5 are mouse wheel events */
- miPointerGetMotionEvents,
- winMouseCtrl,
- miPointerGetMotionBufferSize ());
- break;
-
- case DEVICE_ON:
- pDevice->on = TRUE;
- break;
-
- case DEVICE_CLOSE:
- case DEVICE_OFF:
- pDevice->on = FALSE;
- break;
- }
- return Success;
-}
-
-
-/* Handle the mouse wheel */
-int
-winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
-{
- winScreenPriv(pScreen);
- xEvent xCurrentEvent;
-
- /* Button4 = WheelUp */
- /* Button5 = WheelDown */
-
- /* Do we have any previous delta stored? */
- if ((pScreenPriv->iDeltaZ > 0
- && iDeltaZ > 0)
- || (pScreenPriv->iDeltaZ < 0
- && iDeltaZ < 0))
- {
- /* Previous delta and of same sign as current delta */
- iDeltaZ += pScreenPriv->iDeltaZ;
- pScreenPriv->iDeltaZ = 0;
- }
- else
- {
- /*
- * Previous delta of different sign, or zero.
- * We will set it to zero for either case,
- * as blindly setting takes just as much time
- * as checking, then setting if necessary :)
- */
- pScreenPriv->iDeltaZ = 0;
- }
-
- /*
- * Only process this message if the wheel has moved further than
- * WHEEL_DELTA
- */
- if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA)
- {
- pScreenPriv->iDeltaZ = 0;
-
- /* Figure out how many whole deltas of the wheel we have */
- iDeltaZ /= WHEEL_DELTA;
- }
- else
- {
- /*
- * Wheel has not moved past WHEEL_DELTA threshold;
- * we will store the wheel delta until the threshold
- * has been reached.
- */
- pScreenPriv->iDeltaZ = iDeltaZ;
- return 0;
- }
-
- /* Set the button to indicate up or down wheel delta */
- if (iDeltaZ > 0)
- {
- xCurrentEvent.u.u.detail = Button4;
- }
- else
- {
- xCurrentEvent.u.u.detail = Button5;
- }
-
- /*
- * Flip iDeltaZ to positive, if negative,
- * because always need to generate a *positive* number of
- * button clicks for the Z axis.
- */
- if (iDeltaZ < 0)
- {
- iDeltaZ *= -1;
- }
-
- /* Generate X input messages for each wheel delta we have seen */
- while (iDeltaZ--)
- {
- /* Push the wheel button */
- xCurrentEvent.u.u.type = ButtonPress;
- xCurrentEvent.u.keyButtonPointer.time
- = g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
-
- /* Release the wheel button */
- xCurrentEvent.u.u.type = ButtonRelease;
- xCurrentEvent.u.keyButtonPointer.time
- = g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- }
-
- return 0;
-}
-
-
-/*
- * Enqueue a mouse button event
- */
-
-void
-winMouseButtonsSendEvent (int iEventType, int iButton)
-{
- xEvent xCurrentEvent;
-
- /* Load an xEvent and enqueue the event */
- xCurrentEvent.u.u.type = iEventType;
- xCurrentEvent.u.u.detail = iButton;
- xCurrentEvent.u.keyButtonPointer.time
- = g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
-}
-
-
-/*
- * Decide what to do with a Windows mouse message
- */
-
-int
-winMouseButtonsHandle (ScreenPtr pScreen,
- int iEventType, int iButton,
- WPARAM wParam)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Send button events right away if emulate 3 buttons is off */
- if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF)
- {
- /* Emulate 3 buttons is off, send the button event */
- winMouseButtonsSendEvent (iEventType, iButton);
- return 0;
- }
-
- /* Emulate 3 buttons is on, let the fun begin */
- if (iEventType == ButtonPress
- && pScreenPriv->iE3BCachedPress == 0
- && !pScreenPriv->fE3BFakeButton2Sent)
- {
- /*
- * Button was pressed, no press is cached,
- * and there is no fake button 2 release pending.
- */
-
- /* Store button press type */
- pScreenPriv->iE3BCachedPress = iButton;
-
- /*
- * Set a timer to send this button press if the other button
- * is not pressed within the timeout time.
- */
- SetTimer (pScreenPriv->hwndScreen,
- WIN_E3B_TIMER_ID,
- pScreenInfo->iE3BTimeout,
- NULL);
- }
- else if (iEventType == ButtonPress
- && pScreenPriv->iE3BCachedPress != 0
- && pScreenPriv->iE3BCachedPress != iButton
- && !pScreenPriv->fE3BFakeButton2Sent)
- {
- /*
- * Button press is cached, other button was pressed,
- * and there is no fake button 2 release pending.
- */
-
- /* Mouse button was cached and other button was pressed */
- KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
- pScreenPriv->iE3BCachedPress = 0;
-
- /* Send fake middle button */
- winMouseButtonsSendEvent (ButtonPress, Button2);
-
- /* Indicate that a fake middle button event was sent */
- pScreenPriv->fE3BFakeButton2Sent = TRUE;
- }
- else if (iEventType == ButtonRelease
- && pScreenPriv->iE3BCachedPress == iButton)
- {
- /*
- * Cached button was released before timer ran out,
- * and before the other mouse button was pressed.
- */
- KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
- pScreenPriv->iE3BCachedPress = 0;
-
- /* Send cached press, then send release */
- winMouseButtonsSendEvent (ButtonPress, iButton);
- winMouseButtonsSendEvent (ButtonRelease, iButton);
- }
- else if (iEventType == ButtonRelease
- && pScreenPriv->fE3BFakeButton2Sent
- && !(wParam & MK_LBUTTON)
- && !(wParam & MK_RBUTTON))
- {
- /*
- * Fake button 2 was sent and both mouse buttons have now been released
- */
- pScreenPriv->fE3BFakeButton2Sent = FALSE;
-
- /* Send middle mouse button release */
- winMouseButtonsSendEvent (ButtonRelease, Button2);
- }
- else if (iEventType == ButtonRelease
- && pScreenPriv->iE3BCachedPress == 0
- && !pScreenPriv->fE3BFakeButton2Sent)
- {
- /*
- * Button was release, no button is cached,
- * and there is no fake button 2 release is pending.
- */
- winMouseButtonsSendEvent (ButtonRelease, iButton);
- }
-
- return 0;
-}
diff --git a/hw/xwin/winms.h b/hw/xwin/winms.h
deleted file mode 100644
index 17454487d..000000000
--- a/hw/xwin/winms.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winms.h,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
-
-#ifndef _WINMS_H_
-#define _WINMS_H_
-
-#undef MINSHORT
-#undef MAXSHORT
-#undef CARD8
-#undef INT32
-#undef ATOM
-
-#define NONAMELESSUNION
-#define DIRECTDRAW_VERSION 0x0300
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-#include <windowsx.h>
-
-#include "obj_base.h"
-#include "ddraw.h"
-
-/*
- * Undefine unneeded Windows symbols that conflict
- * with X symbols
- */
-
-#undef CreateWindow
-#undef FreeResource
-
-#endif /* _WINMS_H_ */
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
deleted file mode 100644
index ce8ac4199..000000000
--- a/hw/xwin/winmsg.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Alexander Gottwald
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
-
-#include "win.h"
-#include "winmsg.h"
-#include <stdarg.h>
-
-#ifndef VERBOSE_LEVEL
-#define VERBOSE_LEVEL 4
-#endif
-
-
-void winVMsg (int, MessageType, int verb, const char *, va_list);
-
-
-void
-winVMsg (int scrnIndex, MessageType type, int verb, const char *format,
- va_list ap)
-{
- LogVMessageVerb(type, verb, format, ap);
-}
-
-
-void
-winDrvMsg (int scrnIndex, MessageType type, const char *format, ...)
-{
- va_list ap;
- va_start (ap, format);
- LogVMessageVerb(type, 0, format, ap);
- va_end (ap);
-}
-
-
-void
-winMsg (MessageType type, const char *format, ...)
-{
- va_list ap;
- va_start (ap, format);
- LogVMessageVerb(type, 0, format, ap);
- va_end (ap);
-}
-
-
-void
-winDrvMsgVerb (int scrnIndex, MessageType type, int verb, const char *format,
- ...)
-{
- va_list ap;
- va_start (ap, format);
- LogVMessageVerb(type, verb, format, ap);
- va_end (ap);
-}
-
-
-void
-winMsgVerb (MessageType type, int verb, const char *format, ...)
-{
- va_list ap;
- va_start (ap, format);
- LogVMessageVerb(type, verb, format, ap);
- va_end (ap);
-}
-
-
-void
-winErrorFVerb (int verb, const char *format, ...)
-{
- va_list ap;
- va_start (ap, format);
- LogVMessageVerb(X_NONE, verb, format, ap);
- va_end (ap);
-}
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
deleted file mode 100644
index 16ec536b0..000000000
--- a/hw/xwin/winmsg.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Alexander Gottwald
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.h,v 1.2 2003/10/02 13:30:10 eich Exp $ */
-
-#ifndef __WIN_MSG_H__
-#define __WIN_MSG_H__
-
-/*
- * Function prototypes
- */
-
-void winDrvMsgVerb (int scrnIndex,
- MessageType type, int verb, const char *format, ...);
-void winDrvMsg (int scrnIndex, MessageType type, const char *format, ...);
-void winMsgVerb (MessageType type, int verb, const char *format, ...);
-void winMsg (MessageType type, const char *format, ...);
-
-void winErrorFVerb (int verb, const char *format, ...);
-
-#endif
diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
deleted file mode 100755
index 21be64977..000000000
--- a/hw/xwin/winmultiwindowclass.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowclass.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
-
-#include <Xatom.h>
-#include "propertyst.h"
-#include "windowstr.h"
-#include "winmultiwindowclass.h"
-
-int
-winMultiWindowGetClassHint (WindowPtr pWin, char **res_name, char **res_class)
-{
- struct _Window *pwin;
- struct _Property *prop;
- int len_name, len_class;
-
- if (!pWin || !res_name || !res_class)
- {
- ErrorF ("winMultiWindowGetClassHint - pWin, res_name, or res_class was "
- "NULL\n");
- return 0;
- }
-
- pwin = (struct _Window*) pWin;
-
- if (pwin->optional)
- prop = (struct _Property *) pwin->optional->userProps;
- else
- prop = NULL;
-
- *res_name = *res_class = NULL;
-
- while (prop)
- {
- if (prop->propertyName == XA_WM_CLASS
- && prop->type == XA_STRING
- && prop->format == 8
- && prop->data)
- {
- len_name = strlen ((char *) prop->data);
-
- (*res_name) = malloc (len_name + 1);
-
- if (!*res_name)
- {
- ErrorF ("winMultiWindowGetClassHint - *res_name was NULL\n");
- return 0;
- }
-
- /* Add one to len_name to allow copying of trailing 0 */
- strncpy ((*res_name), prop->data, len_name + 1);
-
- if (len_name == prop->size)
- len_name--;
-
- len_class = strlen (((char *)prop->data) + 1 + len_name);
-
- (*res_class) = malloc (len_class + 1);
-
- if (!*res_class)
- {
- ErrorF ("winMultiWindowGetClassHint - *res_class was NULL\n");
-
- /* Free the previously allocated res_name */
- free (*res_name);
- return 0;
- }
-
- strcpy ((*res_class), ((char *)prop->data) + 1 + len_name);
-
- return 1;
- }
- else
- prop = prop->next;
- }
-
- return 0;
-}
-
-
-int
-winMultiWindowGetWMHints (WindowPtr pWin, WinXWMHints *hints)
-{
- struct _Window *pwin;
- struct _Property *prop;
-
- if (!pWin || !hints)
- {
- ErrorF ("winMultiWindowGetWMHints - pWin or hints was NULL\n");
- return 0;
- }
-
- pwin = (struct _Window*) pWin;
-
- if (pwin->optional)
- prop = (struct _Property *) pwin->optional->userProps;
- else
- prop = NULL;
-
- memset (hints, 0, sizeof (WinXWMHints));
-
- while (prop)
- {
- if (prop->propertyName == XA_WM_HINTS
- && prop->data)
- {
- memcpy (hints, prop->data, sizeof (WinXWMHints));
- return 1;
- }
- else
- prop = prop->next;
- }
-
- return 0;
-}
-
-
-int
-winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role)
-{
- struct _Window *pwin;
- struct _Property *prop;
- int len_role;
- static Atom atmWmWindowRole = 0;
-
- if (!pWin || !res_role)
- return 0;
-
- /* Initialize the window role atom, not in XAtom.h */
- if (!atmWmWindowRole)
- atmWmWindowRole = MakeAtom ("WM_WINDOW_ROLE", 14, 1);
-
- pwin = (struct _Window*) pWin;
-
- if (pwin->optional)
- prop = (struct _Property *) pwin->optional->userProps;
- else
- prop = NULL;
-
- *res_role = NULL;
- while (prop)
- {
- if (prop->propertyName == atmWmWindowRole
- && prop->type == XA_STRING
- && prop->format == 8
- && prop->data)
- {
- len_role= strlen ((char *) prop->data);
-
- (*res_role) = malloc (len_role + 1);
-
- if (!*res_role)
- {
- ErrorF ("winMultiWindowGetWindowRole - *res_role was NULL\n");
- return 0;
- }
-
- strcpy ((*res_role), prop->data);
-
- return 1;
- }
- else
- prop = prop->next;
- }
-
- return 0;
-}
-
-
-int
-winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints)
-{
- struct _Window *pwin;
- struct _Property *prop;
-
- if (!pWin || !hints)
- {
- ErrorF ("winMultiWindowGetWMNormalHints - pWin or hints was NULL\n");
- return 0;
- }
-
- pwin = (struct _Window*) pWin;
-
- if (pwin->optional)
- prop = (struct _Property *) pwin->optional->userProps;
- else
- prop = NULL;
-
- memset (hints, 0, sizeof (WinXSizeHints));
-
- while (prop)
- {
- if (prop->propertyName == XA_WM_NORMAL_HINTS
- && prop->data)
- {
- memcpy (hints, prop->data, sizeof (WinXSizeHints));
- return 1;
- }
- else
- prop = prop->next;
- }
-
- return 0;
-}
-
-
-int
-winMultiWindowGetWMName (WindowPtr pWin, char **wmName)
-{
- struct _Window *pwin;
- struct _Property *prop;
- int len_name;
-
- if (!pWin || !wmName)
- {
- ErrorF ("winMultiWindowGetClassHint - pWin, res_name, or res_class was "
- "NULL\n");
- return 0;
- }
-
- pwin = (struct _Window*) pWin;
-
- if (pwin->optional)
- prop = (struct _Property *) pwin->optional->userProps;
- else
- prop = NULL;
-
- *wmName = NULL;
-
- while (prop)
- {
- if (prop->propertyName == XA_WM_NAME
- && prop->type == XA_STRING
- && prop->data)
- {
- len_name = strlen ((char *) prop->data);
-
- (*wmName) = malloc (len_name + 1);
-
- if (!*wmName)
- {
- ErrorF ("winMultiWindowGetWMName - *wmName was NULL\n");
- return 0;
- }
-
- /* Add one to len_name to allow copying of trailing 0 */
- strncpy ((*wmName), prop->data, len_name+1);
-
- return 1;
- }
- else
- prop = prop->next;
- }
-
- return 0;
-}
-
diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h
deleted file mode 100755
index b6ad55d8b..000000000
--- a/hw/xwin/winmultiwindowclass.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowclass.h,v 1.2 2003/10/02 13:30:10 eich Exp $ */
-
-
-/*
- * Structures
- */
-
-typedef struct {
- long flags; /* marks which fields in this structure are defined */
- Bool input; /* does this application rely on the window manager to
- get keyboard input? */
- int initial_state; /* see below */
- Pixmap icon_pixmap; /* pixmap to be used as icon */
- Window icon_window; /* window to be used as icon */
- int icon_x, icon_y; /* initial position of icon */
- Pixmap icon_mask; /* icon mask bitmap */
- XID window_group; /* id of related window group */
- /* this structure may be extended in the future */
-} WinXWMHints;
-
-
-/*
- * new version containing base_width, base_height, and win_gravity fields;
- * used with WM_NORMAL_HINTS.
- */
-typedef struct {
- long flags; /* marks which fields in this structure are defined */
- int x, y; /* obsolete for new window mgrs, but clients */
- int width, height; /* should set so old wm's don't mess up */
- int min_width, min_height;
- int max_width, max_height;
- int width_inc, height_inc;
- struct {
- int x; /* numerator */
- int y; /* denominator */
- } min_aspect, max_aspect;
- int base_width, base_height; /* added by ICCCM version 1 */
- int win_gravity; /* added by ICCCM version 1 */
-} WinXSizeHints;
-
-/*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
-/* flags argument in size hints */
-#define USPosition (1L << 0) /* user specified x, y */
-#define USSize (1L << 1) /* user specified width, height */
-
-#define PPosition (1L << 2) /* program specified position */
-#define PSize (1L << 3) /* program specified size */
-#define PMinSize (1L << 4) /* program specified minimum size */
-#define PMaxSize (1L << 5) /* program specified maximum size */
-#define PResizeInc (1L << 6) /* program specified resize increments */
-#define PAspect (1L << 7) /* program specified min and max aspect ratios */
-#define PBaseSize (1L << 8) /* program specified base for incrementing */
-#define PWinGravity (1L << 9) /* program specified window gravity */
-
-/* obsolete */
-#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
-
-
-/*
- * Function prototypes
- */
-
-int
-winMultiWindowGetWMHints (WindowPtr pWin, WinXWMHints *hints);
-
-int
-winMultiWindowGetClassHint (WindowPtr pWin, char **res_name, char **res_class);
-
-int
-winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role);
-
-int
-winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints);
-
-int
-winMultiWindowGetWMName (WindowPtr pWin, char **wmName);
-
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
deleted file mode 100755
index dd56db6d6..000000000
--- a/hw/xwin/winmultiwindowicons.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowicons.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
-
-#include "win.h"
-#include "dixevents.h"
-#include "winmultiwindowclass.h"
-#include "winprefs.h"
-
-
-/*
- * External global variables
- */
-
-extern HICON g_hiconX;
-
-
-/*
- * Prototypes for local functions
- */
-
-static void
-winScaleXBitmapToWindows (int iconSize, int effBPP,
- PixmapPtr pixmap, unsigned char *image);
-
-
-/*
- * Scale an X icon bitmap into a Windoze icon bitmap
- */
-
-static void
-winScaleXBitmapToWindows (int iconSize,
- int effBPP,
- PixmapPtr pixmap,
- unsigned char *image)
-{
- int row, column, effXBPP, effXDepth;
- unsigned char *outPtr;
- unsigned char *iconData = 0;
- int stride, xStride;
- float factX, factY;
- int posX, posY;
- unsigned char *ptr;
- unsigned int zero;
- unsigned int color;
-
-
- if (pixmap->drawable.bitsPerPixel == 15)
- effXBPP = 16;
- else
- effXBPP = pixmap->drawable.bitsPerPixel;
-
- if (pixmap->drawable.depth == 15)
- effXDepth = 16;
- else
- effXDepth = pixmap->drawable.depth;
-
- /* Need 32-bit aligned rows */
- stride = ((iconSize * effBPP + 31) & (~31)) / 8;
- xStride = ((pixmap->drawable.width * effXBPP + 31) & (~31)) / 8;
-
- iconData = malloc (xStride * pixmap->drawable.height);
- miGetImage ((DrawablePtr) &(pixmap->drawable), 0, 0,
- pixmap->drawable.width, pixmap->drawable.height,
- ZPixmap, 0xffffffff, iconData);
-
- /* Keep aspect ratio */
- factX = ((float)pixmap->drawable.width) / ((float)iconSize);
- factY = ((float)pixmap->drawable.height) / ((float)iconSize);
- if (factX > factY)
- factY = factX;
- else
- factX = factY;
-
- /* Out-of-bounds, fill icon with zero */
- zero = 0;
-
- for (row = 0; row < iconSize; row++)
- {
- outPtr = image + stride * row;
- for (column = 0; column < iconSize; column++)
- {
- posX = factX * column;
- posY = factY * row;
-
- ptr = iconData + posY*xStride;
- if (effXBPP == 1)
- {
- ptr += posX / 8;
-
- /* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
- ptr = (unsigned char *) &zero;
-
- if ((*ptr) & (1 << (posX & 7)))
- switch (effBPP)
- {
- case 32:
- *(outPtr++) = 0;
- case 24:
- *(outPtr++) = 0;
- case 16:
- *(outPtr++) = 0;
- case 8:
- *(outPtr++) = 0;
- break;
- case 1:
- outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
- break;
- }
- else
- switch (effBPP)
- {
- case 32:
- *(outPtr++) = 255;
- *(outPtr++) = 255;
- *(outPtr++) = 255;
- *(outPtr++) = 0;
- break;
- case 24:
- *(outPtr++) = 255;
- case 16:
- *(outPtr++) = 255;
- case 8:
- *(outPtr++) = 255;
- break;
- case 1:
- outPtr[column / 8] |= (1 << (7 - (column & 7)));
- break;
- }
- }
- else if (effXDepth == 24 || effXDepth == 32)
- {
- ptr += posX * (effXBPP / 8);
-
- /* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
- ptr = (unsigned char *) &zero;
- color = (((*ptr) << 16)
- + ((*(ptr + 1)) << 8)
- + ((*(ptr + 2)) << 0));
- switch (effBPP)
- {
- case 32:
- *(outPtr++) = *(ptr++); // b
- *(outPtr++) = *(ptr++); // g
- *(outPtr++) = *(ptr++); // r
- *(outPtr++) = 0; // resvd
- break;
- case 24:
- *(outPtr++) = *(ptr++);
- *(outPtr++) = *(ptr++);
- *(outPtr++) = *(ptr++);
- break;
- case 16:
- color = ((((*ptr) >> 2) << 10)
- + (((*(ptr + 1)) >> 2) << 5)
- + (((*(ptr + 2)) >> 2)));
- *(outPtr++) = (color >> 8);
- *(outPtr++) = (color & 255);
- break;
- case 8:
- color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2))));
- color /= 3;
- *(outPtr++) = color;
- break;
- case 1:
- if (color)
- outPtr[column / 8] |= (1 << (7 - (column & 7)));
- else
- outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
- }
- }
- else if (effXDepth == 16)
- {
- ptr += posX * (effXBPP / 8);
-
- /* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
- ptr = (unsigned char *) &zero;
- color = ((*ptr) << 8) + (*(ptr + 1));
- switch (effBPP)
- {
- case 32:
- *(outPtr++) = (color & 31) << 2;
- *(outPtr++) = ((color >> 5) & 31) << 2;
- *(outPtr++) = ((color >> 10) & 31) << 2;
- *(outPtr++) = 0; // resvd
- break;
- case 24:
- *(outPtr++) = (color & 31) << 2;
- *(outPtr++) = ((color >> 5) & 31) << 2;
- *(outPtr++) = ((color >> 10) & 31) << 2;
- break;
- case 16:
- *(outPtr++) = *(ptr++);
- *(outPtr++) = *(ptr++);
- break;
- case 8:
- *(outPtr++) = (((color & 31)
- + ((color >> 5) & 31)
- + ((color >> 10) & 31)) / 3) << 2;
- break;
- case 1:
- if (color)
- outPtr[column / 8] |= (1 << (7 - (column & 7)));
- else
- outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
- break;
- } /* end switch(effbpp) */
- } /* end if effxbpp==16) */
- } /* end for column */
- } /* end for row */
- free (iconData);
-}
-
-
-/*
- * Attempt to create a custom icon from the WM_HINTS bitmaps
- */
-
-HICON
-winXIconToHICON (WindowPtr pWin)
-{
- unsigned char *mask, *image, *imageMask;
- unsigned char *dst, *src;
- PixmapPtr iconPtr;
- PixmapPtr maskPtr;
- int iconSize, planes, bpp, effBPP, stride, maskStride, i;
- HDC hDC;
- ICONINFO ii;
- WinXWMHints hints;
- HICON hIcon;
-
- winMultiWindowGetWMHints (pWin, &hints);
- if (!hints.icon_pixmap) return NULL;
-
- iconPtr = LookupIDByType (hints.icon_pixmap, RT_PIXMAP);
-
- if (!iconPtr) return NULL;
-
- iconSize = 32;
-
- hDC = GetDC (GetDesktopWindow ());
- planes = GetDeviceCaps (hDC, PLANES);
- bpp = GetDeviceCaps (hDC, BITSPIXEL);
- ReleaseDC (GetDesktopWindow (), hDC);
-
- /* 15 BPP is really 16BPP as far as we care */
- if (bpp == 15)
- effBPP = 16;
- else
- effBPP = bpp;
-
- /* Need 32-bit aligned rows */
- stride = ((iconSize * effBPP + 31) & (~31)) / 8;
-
- /* Mask is 1-bit deep */
- maskStride = ((iconSize * 1 + 31) & (~31)) / 8;
-
- image = (unsigned char * ) malloc (stride * iconSize);
- imageMask = (unsigned char *) malloc (stride * iconSize);
- mask = (unsigned char *) malloc (maskStride * iconSize);
-
- /* Default to a completely black mask */
- memset (mask, 0, maskStride * iconSize);
-
- winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image);
- maskPtr = LookupIDByType (hints.icon_mask, RT_PIXMAP);
-
- if (maskPtr)
- {
- winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask);
-
- winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask);
-
- /* Now we need to set all bits of the icon which are not masked */
- /* on to 0 because Color is really an XOR, not an OR function */
- dst = image;
- src = imageMask;
-
- for (i = 0; i < (stride * iconSize); i++)
- if ((*(src++)))
- *(dst++) = 0;
- else
- dst++;
- }
-
- ii.fIcon = TRUE;
- ii.xHotspot = 0; /* ignored */
- ii.yHotspot = 0; /* ignored */
-
- /* Create Win32 mask from pixmap shape */
- ii.hbmMask = CreateBitmap (iconSize, iconSize, planes, 1, mask);
-
- /* Create Win32 bitmap from pixmap */
- ii.hbmColor = CreateBitmap (iconSize, iconSize, planes, bpp, image);
-
- /* Merge Win32 mask and bitmap into icon */
- hIcon = CreateIconIndirect (&ii);
-
- /* Release Win32 mask and bitmap */
- DeleteObject (ii.hbmMask);
- DeleteObject (ii.hbmColor);
-
- /* Free X mask and bitmap */
- free (mask);
- free (image);
- free (imageMask);
-
- return hIcon;
-}
-
-
-
-/*
- * Change the Windows window icon
- */
-
-void
-winUpdateIcon (Window id)
-{
- WindowPtr pWin;
- HICON hIcon, hiconOld;
-
- pWin = LookupIDByType (id, RT_WINDOW);
- hIcon = (HICON)winOverrideIcon ((unsigned long)pWin);
-
- if (!hIcon)
- hIcon = winXIconToHICON (pWin);
-
- if (hIcon)
- {
- winWindowPriv(pWin);
-
- if (pWinPriv->hWnd)
- {
- hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
- GCL_HICON,
- (int) hIcon);
-
- /* Delete the icon if its not the default */
- if (hiconOld != g_hiconX &&
- !winIconIsOverride((unsigned long)hiconOld))
- DeleteObject (hiconOld);
- }
- }
-}
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
deleted file mode 100755
index 5c623d14e..000000000
--- a/hw/xwin/winmultiwindowshape.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Kensuke Matsuzaki
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowshape.c,v 1.2 2003/11/10 18:22:44 tsi Exp $ */
-
-#ifdef SHAPE
-
-#include "win.h"
-
-
-/*
- * External global variables
- */
-
-extern HICON g_hiconX;
-
-
-/*
- * winSetShapeMultiWindow - See Porting Layer Definition - p. 42
- */
-
-void
-winSetShapeMultiWindow (WindowPtr pWin)
-{
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped SetShape function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->SetShape)
- winGetScreenPriv(pWin->drawable.pScreen)->SetShape (pWin);
-
- /* Update the Windows window's shape */
- winReshapeMultiWindow (pWin);
- winUpdateRgnMultiWindow (pWin);
-
- return;
-}
-
-
-/*
- * winUpdateRgnMultiWindow - Local function to update a Windows window region
- */
-
-void
-winUpdateRgnMultiWindow (WindowPtr pWin)
-{
- SetWindowRgn (winGetWindowPriv(pWin)->hWnd,
- winGetWindowPriv(pWin)->hRgn, TRUE);
-}
-
-
-/*
- * winReshapeMultiWindow - Computes the composite clipping region for a window
- */
-
-void
-winReshapeMultiWindow (WindowPtr pWin)
-{
- int nRects;
- RegionRec rrNewShape;
- BoxPtr pShape, pRects, pEnd;
- HRGN hRgn, hRgnRect;
- winWindowPriv(pWin);
-
-#if CYGDEBUG
- ErrorF ("winReshape ()\n");
-#endif
-
- /* Bail if the window is the root window */
- if (pWin->parent == NULL)
- return;
-
- /* Bail if the window is not top level */
- if (pWin->parent->parent != NULL)
- return;
-
- /* Bail if Windows window handle is invalid */
- if (pWinPriv->hWnd == NULL)
- return;
-
- /* Free any existing window region stored in the window privates */
- if (pWinPriv->hRgn != NULL)
- {
- DeleteObject (pWinPriv->hRgn);
- pWinPriv->hRgn = NULL;
- }
-
- /* Bail if the window has no bounding region defined */
- if (!wBoundingShape (pWin))
- return;
-
- REGION_NULL(pScreen, &rrNewShape);
- REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen,
- &rrNewShape,
- pWin->borderWidth,
- pWin->borderWidth);
-
- nRects = REGION_NUM_RECTS(&rrNewShape);
- pShape = REGION_RECTS(&rrNewShape);
-
- /* Don't do anything if there are no rectangles in the region */
- if (nRects > 0)
- {
- RECT rcClient;
- RECT rcWindow;
- int iOffsetX, iOffsetY;
-
- /* Get client rectangle */
- if (!GetClientRect (pWinPriv->hWnd, &rcClient))
- {
- ErrorF ("winReshape - GetClientRect failed, bailing: %d\n",
- GetLastError ());
- return;
- }
-
- /* Translate client rectangle coords to screen coords */
- /* NOTE: Only transforms top and left members */
- ClientToScreen (pWinPriv->hWnd, (LPPOINT) &rcClient);
-
- /* Get window rectangle */
- if (!GetWindowRect (pWinPriv->hWnd, &rcWindow))
- {
- ErrorF ("winReshape - GetWindowRect failed, bailing: %d\n",
- GetLastError ());
- return;
- }
-
- /* Calculate offset from window upper-left to client upper-left */
- iOffsetX = rcClient.left - rcWindow.left;
- iOffsetY = rcClient.top - rcWindow.top;
-
- /* Create initial Windows region for title bar */
- /* FIXME: Mean, nasty, ugly hack!!! */
- hRgn = CreateRectRgn (0, 0, rcWindow.right, iOffsetY);
- if (hRgn == NULL)
- {
- ErrorF ("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) "
- "failed: %d\n",
- 0, 0, rcWindow.right, iOffsetY, GetLastError ());
- }
-
- /* Loop through all rectangles in the X region */
- for (pRects = pShape, pEnd = pShape + nRects; pRects < pEnd; pRects++)
- {
- /* Create a Windows region for the X rectangle */
- hRgnRect = CreateRectRgn (pRects->x1 + iOffsetX - 1,
- pRects->y1 + iOffsetY - 1,
- pRects->x2 + iOffsetX - 1,
- pRects->y2 + iOffsetY - 1);
- if (hRgnRect == NULL)
- {
- ErrorF ("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) "
- "failed: %d\n"
- "\tx1: %d x2: %d xOff: %d y1: %d y2: %d yOff: %d\n",
- pRects->x1 + iOffsetX - 1,
- pRects->y1 + iOffsetY - 1,
- pRects->x2 + iOffsetX - 1,
- pRects->y2 + iOffsetY - 1,
- GetLastError (),
- pRects->x1, pRects->x2, iOffsetX,
- pRects->y1, pRects->y2, iOffsetY);
- }
-
- /* Merge the Windows region with the accumulated region */
- if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
- {
- ErrorF ("winReshape - CombineRgn () failed: %d\n",
- GetLastError ());
- }
-
- /* Delete the temporary Windows region */
- DeleteObject (hRgnRect);
- }
-
- /* Save a handle to the composite region in the window privates */
- pWinPriv->hRgn = hRgn;
- }
-
- REGION_UNINIT(pScreen, &rrNewShape);
-
- return;
-}
-#endif
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
deleted file mode 100644
index 15e508659..000000000
--- a/hw/xwin/winmultiwindowwindow.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Kensuke Matsuzaki
- * Earle F. Philhower, III
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
-
-#include "win.h"
-#include "dixevents.h"
-#include "winmultiwindowclass.h"
-#include "winprefs.h"
-
-
-/*
- * External global variables
- */
-
-extern HICON g_hiconX;
-
-
-/*
- * Prototypes for local functions
- */
-
-static void
-winCreateWindowsWindow (WindowPtr pWin);
-
-static void
-winDestroyWindowsWindow (WindowPtr pWin);
-
-static void
-winUpdateWindowsWindow (WindowPtr pWin);
-
-static void
-winFindWindow (pointer value, XID id, pointer cdata);
-
-#if 0
-static void
-winRestackXWindow (WindowPtr pWin, int smode);
-#endif
-
-
-/*
- * Constant defines
- */
-
-#define MOUSE_POLLING_INTERVAL 500
-
-
-/*
- * Macros
- */
-
-#define SubSend(pWin) \
- ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask)
-
-#define StrSend(pWin) \
- ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask)
-
-#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
-
-
-/*
- * CreateWindow - See Porting Layer Definition - p. 37
- */
-
-Bool
-winCreateWindowMultiWindow (WindowPtr pWin)
-{
- Bool fResult = TRUE;
- winWindowPriv(pWin);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped CreateWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow (pWin);
-
- /* Initialize some privates values */
- pWinPriv->hRgn = NULL;
- pWinPriv->hWnd = NULL;
- pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
- pWinPriv->fXKilled = FALSE;
- pWinPriv->fNeedRestore = FALSE;
-
- return fResult;
-}
-
-
-/*
- * DestroyWindow - See Porting Layer Definition - p. 37
- */
-
-Bool
-winDestroyWindowMultiWindow (WindowPtr pWin)
-{
- Bool fResult = TRUE;
- winWindowPriv(pWin);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped DestroyWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow (pWin);
-
- /* Flag that the window has been destroyed */
- pWinPriv->fXKilled = TRUE;
-
- /* Kill the MS Windows window associated with this window */
- winDestroyWindowsWindow (pWin);
-
- return fResult;
-}
-
-
-/*
- * PositionWindow - See Porting Layer Definition - p. 37
- */
-
-Bool
-winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
-{
- Bool fResult = TRUE;
- int iX, iY, iWidth, iHeight, iBorder;
- winWindowPriv(pWin);
- HWND hWnd = pWinPriv->hWnd;
- RECT rcNew;
- RECT rcOld;
-#if CYGMULTIWINDOW_DEBUG
- RECT rcClient;
- RECT *lpRc;
-#endif
- DWORD dwExStyle;
- DWORD dwStyle;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winPositionWindowMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped PositionWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow (pWin, x, y);
-
- /* Bail out if the Windows window handle is bad */
- if (!hWnd)
- return fResult;
-
- /* Get the Windows window style and extended style */
- dwExStyle = GetWindowLongPtr (hWnd, GWL_EXSTYLE);
- dwStyle = GetWindowLongPtr (hWnd, GWL_STYLE);
-
- /* Get the width of the X window border */
- iBorder = wBorderWidth (pWin);
-
- /* Get the X and Y location of the X window */
- iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
- iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
-
- /* Get the height and width of the X window */
- iWidth = pWin->drawable.width;
- iHeight = pWin->drawable.height;
-
- /* Store the origin, height, and width in a rectangle structure */
- SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
-
-#if CYGMULTIWINDOW_DEBUG
- lpRc = &rcNew;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
- GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-#endif
-
- /*
- * Calculate the required size of the Windows window rectangle,
- * given the size of the Windows window client area.
- */
- AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle);
-
- /* Get a rectangle describing the old Windows window */
- GetWindowRect (hWnd, &rcOld);
-
-#if CYGMULTIWINDOW_DEBUG
- /* Get a rectangle describing the Windows window client area */
- GetClientRect (hWnd, &rcClient);
-
- lpRc = &rcNew;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
- GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-
- lpRc = &rcOld;
- ErrorF ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
- GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-
- lpRc = &rcClient;
- ErrorF ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
- GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-#endif
-
- /* Check if the old rectangle and new rectangle are the same */
- if (!EqualRect (&rcNew, &rcOld))
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winPositionWindowMultiWindow - Need to move\n");
-#endif
-
- /* Change the position and dimensions of the Windows window */
- MoveWindow (hWnd,
- rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
- TRUE);
- }
- else
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winPositionWindowMultiWindow - Not need to move\n");
-#endif
- }
-
- return fResult;
-}
-
-
-/*
- * ChangeWindowAttributes - See Porting Layer Definition - p. 37
- */
-
-Bool
-winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
-{
- Bool fResult = TRUE;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped ChangeWindowAttributes function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes (pWin, mask);
-
- /*
- * NOTE: We do not currently need to do anything here.
- */
-
- return fResult;
-}
-
-
-/*
- * UnmapWindow - See Porting Layer Definition - p. 37
- * Also referred to as UnrealizeWindow
- */
-
-Bool
-winUnmapWindowMultiWindow (WindowPtr pWin)
-{
- Bool fResult = TRUE;
- winWindowPriv(pWin);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped UnrealizeWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow (pWin);
-
- /* Flag that the window has been killed */
- pWinPriv->fXKilled = TRUE;
-
- /* Destroy the Windows window associated with this X window */
- winDestroyWindowsWindow (pWin);
-
- return fResult;
-}
-
-
-/*
- * MapWindow - See Porting Layer Definition - p. 37
- * Also referred to as RealizeWindow
- */
-
-Bool
-winMapWindowMultiWindow (WindowPtr pWin)
-{
- Bool fResult = TRUE;
- winWindowPriv(pWin);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped RealizeWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow (pWin);
-
- /* Flag that this window has not been destroyed */
- pWinPriv->fXKilled = FALSE;
-
- /* Refresh/redisplay the Windows window associated with this X window */
- winUpdateWindowsWindow (pWin);
-
-#ifdef SHAPE
- /* Update the Windows window's shape */
- winReshapeMultiWindow (pWin);
- winUpdateRgnMultiWindow (pWin);
-#endif
-
- return fResult;
-}
-
-
-/*
- * ReparentWindow - See Porting Layer Definition - p. 42
- */
-
-void
-winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
-{
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin);
-#endif
-
- /* Call any wrapped ReparentWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow (pWin,
- pPriorParent);
-
- /* Update the Windows window associated with this X window */
- winUpdateWindowsWindow (pWin);
-}
-
-
-/*
- * RestackWindow - Shuffle the z-order of a window
- */
-
-void
-winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
-{
- WindowPtr pPrevWin;
- UINT uFlags;
- HWND hInsertAfter;
- HWND hWnd = NULL;
- winWindowPriv(pWin);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winRestackMultiWindow - %08x\n", pWin);
-#endif
-
- /* Call any wrapped RestackWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow (pWin,
- pOldNextSib);
-
- if (winGetScreenPriv(pWin->drawable.pScreen)->fRestacking)
- return;
-
- /* Bail out if no window privates or window handle is invalid */
- if (!pWinPriv || !pWinPriv->hWnd)
- return;
-
- /* Get a pointer to our previous sibling window */
- pPrevWin = pWin->prevSib;
-
- /*
- * Look for a sibling window with
- * valid privates and window handle
- */
- while (pPrevWin
- && !winGetWindowPriv(pPrevWin)
- && !winGetWindowPriv(pPrevWin)->hWnd)
- pPrevWin = pPrevWin->prevSib;
-
- /* Check if we found a valid sibling */
- if (pPrevWin)
- {
- /* Valid sibling - get handle to insert window after */
- hInsertAfter = winGetWindowPriv(pPrevWin)->hWnd;
- uFlags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE;
-
- hWnd = GetNextWindow (pWinPriv->hWnd, GW_HWNDPREV);
-
- do
- {
- if (GetProp (hWnd, WIN_WINDOW_PROP))
- {
- if (hWnd == winGetWindowPriv(pPrevWin)->hWnd)
- {
- uFlags |= SWP_NOZORDER;
- }
- break;
- }
- hWnd = GetNextWindow (hWnd, GW_HWNDPREV);
- }
- while (hWnd);
- }
- else
- {
- /* No valid sibling - make this window the top window */
- hInsertAfter = HWND_TOP;
- uFlags = SWP_NOMOVE | SWP_NOSIZE;
- }
-
- /* Perform the restacking operation in Windows */
- SetWindowPos (pWinPriv->hWnd,
- hInsertAfter,
- 0, 0,
- 0, 0,
- uFlags);
-}
-
-
-/*
- * winCreateWindowsWindow - Create a Windows window associated with an X window
- */
-
-static void
-winCreateWindowsWindow (WindowPtr pWin)
-{
- int iX, iY;
- int iWidth;
- int iHeight;
- int iBorder;
- HWND hWnd;
- WNDCLASS wc;
- winWindowPriv(pWin);
- HICON hIcon;
-#define CLASS_NAME_LENGTH 512
- char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
- char *res_name, *res_class, *res_role;
- static int s_iWindowID = 0;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
-#endif
-
- iBorder = wBorderWidth (pWin);
-
- iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
- iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
-
- iWidth = pWin->drawable.width;
- iHeight = pWin->drawable.height;
-
- /* Load default X icon in case it's not ready yet */
- if (!g_hiconX)
- g_hiconX = (HICON)winOverrideDefaultIcon();
-
- if (!g_hiconX)
- g_hiconX = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
-
- /* Try and get the icon from WM_HINTS */
- hIcon = winXIconToHICON (pWin);
-
- /* Use default X icon if no icon loaded from WM_HINTS */
- if (!hIcon)
- hIcon = g_hiconX;
-
- /* Set standard class name prefix so we can identify window easily */
- strncpy (pszClass, WINDOW_CLASS_X, strlen (WINDOW_CLASS_X));
-
- if (winMultiWindowGetClassHint (pWin, &res_name, &res_class))
- {
- strncat (pszClass, "-", 1);
- strncat (pszClass, res_name, CLASS_NAME_LENGTH - strlen (pszClass));
- strncat (pszClass, "-", 1);
- strncat (pszClass, res_class, CLASS_NAME_LENGTH - strlen (pszClass));
-
- /* Check if a window class is provided by the WM_WINDOW_ROLE property,
- * if not use the WM_CLASS information.
- * For further information see:
- * http://tronche.com/gui/x/icccm/sec-5.html
- */
- if (winMultiWindowGetWindowRole (pWin, &res_role) )
- {
- strcat (pszClass, "-");
- strcat (pszClass, res_role);
- free (res_role);
- }
-
- free (res_name);
- free (res_class);
- }
-
- /* Add incrementing window ID to make unique class name */
- sprintf (pszWindowID, "-%x", s_iWindowID++);
- strcat (pszClass, pszWindowID);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowsWindow - Creating class: %s\n", pszClass);
-#endif
-
- /* Setup our window class */
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = winTopLevelWindowProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = g_hInstance;
- wc.hIcon = hIcon;
- wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = pszClass;
- RegisterClass (&wc);
-
- /* Create the window */
- hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
- pszClass, /* Class name */
- WINDOW_TITLE_X, /* Window name */
- WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
- iX, /* Horizontal position */
- iY, /* Vertical position */
- iWidth, /* Right edge */
- iHeight, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
- (HMENU) NULL, /* No menu */
- GetModuleHandle (NULL), /* Instance handle */
- pWin); /* ScreenPrivates */
- if (hWnd == NULL)
- {
- ErrorF ("winCreateWindowsWindow - CreateWindowExA () failed: %d\n",
- GetLastError ());
- }
-
- pWinPriv->hWnd = hWnd;
-
- /* Cause the "Always On Top" to be added in main WNDPROC */
- PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0);
-
- SetProp (pWinPriv->hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin));
-
- /* Flag that this Windows window handles its own activation */
- SetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
-}
-
-
-/*
- * winDestroyWindowsWindow - Destroy a Windows window associated
- * with an X window
- */
-
-static void
-winDestroyWindowsWindow (WindowPtr pWin)
-{
- MSG msg;
- winWindowPriv(pWin);
- HICON hiconClass;
- HMODULE hInstance;
- int iReturn;
- char pszClass[512];
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowsWindow\n");
-#endif
-
- /* Bail out if the Windows window handle is invalid */
- if (pWinPriv->hWnd == NULL)
- return;
-
- SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, 0);
-
- /* Store the info we need to destroy after this window is gone */
- hInstance = (HINSTANCE) GetClassLong (pWinPriv->hWnd, GCL_HMODULE);
- hiconClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICON);
- iReturn = GetClassName (pWinPriv->hWnd, pszClass, 512);
-
- /* Destroy the Windows window */
- DestroyWindow (pWinPriv->hWnd);
-
- /* Null our handle to the Window so referencing it will cause an error */
- pWinPriv->hWnd = NULL;
-
- /* Process all messages on our queue */
- while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
- {
- if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
- {
- DispatchMessage (&msg);
- }
- }
-
- /* Only if we were able to get the name */
- if (iReturn)
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowsWindow - Unregistering %s: ", pszClass);
-#endif
- iReturn = UnregisterClass (pszClass, hInstance);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowsWindow - %d Deleting Icon: ", iReturn);
-#endif
-
- /* Only delete if it's not the default */
- if (hiconClass != g_hiconX &&
- !winIconIsOverride((unsigned long)hiconClass))
- {
- iReturn = DestroyIcon (hiconClass);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowsWindow - %d\n", iReturn);
-#endif
- }
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-winDestroyWindowsWindow\n");
-#endif
-}
-
-
-/*
- * winUpdateWindowsWindow - Redisplay/redraw a Windows window
- * associated with an X window
- */
-
-static void
-winUpdateWindowsWindow (WindowPtr pWin)
-{
- winWindowPriv(pWin);
- HWND hWnd = pWinPriv->hWnd;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winUpdateWindowsWindow\n");
-#endif
-
- /* Check if the Windows window's parents have been destroyed */
- if (pWin->parent != NULL
- && pWin->parent->parent == NULL
- && pWin->mapped)
- {
- /* Create the Windows window if it has been destroyed */
- if (hWnd == NULL)
- {
- winCreateWindowsWindow (pWin);
- assert (pWinPriv->hWnd != NULL);
- }
-
- /* Display the window without activating it */
- ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
-
- /* Send first paint message */
- UpdateWindow (pWinPriv->hWnd);
- }
- else if (hWnd != NULL)
- {
- /* Destroy the Windows window if its parents are destroyed */
- winDestroyWindowsWindow (pWin);
- assert (pWinPriv->hWnd == NULL);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-winUpdateWindowsWindow\n");
-#endif
-}
-
-
-/*
- * winGetWindowID -
- */
-
-XID
-winGetWindowID (WindowPtr pWin)
-{
- WindowIDPairRec wi = {pWin, 0};
- ClientPtr c = wClient(pWin);
-
- /* */
- FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winGetWindowID - Window ID: %d\n", wi.id);
-#endif
-
- return wi.id;
-}
-
-
-/*
- * winMoveXWindow -
- */
-
-void
-winMoveXWindow (WindowPtr pWin, int x, int y)
-{
- XID *vlist = malloc(sizeof(long)*2);
-
- (CARD32*)vlist[0] = x;
- (CARD32*)vlist[1] = y;
- ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
- free(vlist);
-}
-
-
-/*
- * winResizeXWindow -
- */
-
-void
-winResizeXWindow (WindowPtr pWin, int w, int h)
-{
- XID *vlist = malloc(sizeof(long)*2);
-
- (CARD32*)vlist[0] = w;
- (CARD32*)vlist[1] = h;
- ConfigureWindow (pWin, CWWidth | CWHeight, vlist, wClient(pWin));
- free(vlist);
-}
-
-
-/*
- * winFindWindow -
- */
-
-static void
-winFindWindow (pointer value, XID id, pointer cdata)
-{
- WindowIDPairPtr wi = (WindowIDPairPtr)cdata;
-
- if (value == wi->value)
- {
- wi->id = id;
- }
-}
-
-
-#if 0
-/*
- * winRestackXWindow -
- */
-
-static void
-winRestackXWindow (WindowPtr pWin, int smode)
-{
- XID *vlist = malloc(sizeof(unsigned long));
-
- if (vlist == NULL)
- {
- ErrorF ("winRestackXWindow - malloc () failed\n");
- return;
- }
-
- if (pWin == NULL)
- {
- ErrorF ("winRestackXWindow - NULL window\n");
- free(vlist);
- return;
- }
-
- *((unsigned long*)vlist) = smode;
- ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin));
-
- free(vlist);
-}
-#endif
-
-
-/*
- * winReorderWindowsMultiWindow -
- */
-
-void
-winReorderWindowsMultiWindow (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- HWND hwnd = NULL;
- WindowPtr pWin = NULL;
- WindowPtr pWinSib = NULL;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winOrderWindowsMultiWindow\n");
-#endif
-
- pScreenPriv->fRestacking = TRUE;
-
- if (pScreenPriv->fWindowOrderChanged)
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winOrderWindowsMultiWindow - Need to restack\n");
-#endif
- hwnd = GetTopWindow (NULL);
-
- while (hwnd)
- {
- if (GetProp (hwnd, WIN_WINDOW_PROP))
- {
- pWinSib = pWin;
- pWin = GetProp (hwnd, WIN_WINDOW_PROP);
-
- if (pWinSib)
- {
- XID *vlist = malloc (sizeof(long) * 2);
-
- if (vlist == NULL)
- {
- ErrorF ("winOrderWindowsMultiWindow - malloc () "
- "failed\n");
- return;
- }
-
- ((long*)vlist)[0] = winGetWindowID (pWinSib);
- ((long*)vlist)[1] = Below;
-
- ConfigureWindow (pWin, CWSibling | CWStackMode,
- vlist, wClient(pWin));
-
- free (vlist);
- }
- }
- hwnd = GetNextWindow (hwnd, GW_HWNDNEXT);
- }
- }
-
- pScreenPriv->fRestacking = FALSE;
- pScreenPriv->fWindowOrderChanged = FALSE;
-}
-
-
-/*
- * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE
- */
-
-void
-winMinimizeWindow (Window id)
-{
- WindowPtr pWin;
- winPrivWinPtr pWinPriv;
-
- pWin = LookupIDByType (id, RT_WINDOW);
-
- pWinPriv = winGetWindowPriv (pWin);
-
- ShowWindow (pWinPriv->hWnd, SW_MINIMIZE);
-}
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
deleted file mode 100644
index a60d36135..000000000
--- a/hw/xwin/winmultiwindowwm.c
+++ /dev/null
@@ -1,1183 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Kensuke Matsuzaki
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwm.c,v 1.3 2003/10/02 13:30:11 eich Exp $ */
-
-/* X headers */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/select.h>
-#include <fcntl.h>
-#include <setjmp.h>
-#include <pthread.h>
-#include <X11/X.h>
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-#include <X11/Xlocale.h>
-#include <X11/Xproto.h>
-#include <X11/Xutil.h>
-
-/* Fixups to prevent collisions between Windows and X headers */
-#define ATOM DWORD
-
-/* Windows headers */
-#include <windows.h>
-
-/* Local headers */
-#include "winwindow.h"
-
-
-/*
- * Constant defines
- */
-
-#define WIN_CONNECT_RETRIES 5
-#define WIN_CONNECT_DELAY 5
-#define WIN_MSG_QUEUE_FNAME "/dev/windows"
-#define WIN_JMP_OKAY 0
-#define WIN_JMP_ERROR_IO 2
-
-
-/*
- * Local structures
- */
-
-typedef struct _WMMsgNodeRec {
- winWMMessageRec msg;
- struct _WMMsgNodeRec *pNext;
-} WMMsgNodeRec, *WMMsgNodePtr;
-
-typedef struct _WMMsgQueueRec {
- struct _WMMsgNodeRec *pHead;
- struct _WMMsgNodeRec *pTail;
- pthread_mutex_t pmMutex;
- pthread_cond_t pcNotEmpty;
-} WMMsgQueueRec, *WMMsgQueuePtr;
-
-typedef struct _WMInfo {
- Display *pDisplay;
- WMMsgQueueRec wmMsgQueue;
- Atom atmWmProtos;
- Atom atmWmDelete;
- Atom atmPrivMap;
-} WMInfoRec, *WMInfoPtr;
-
-typedef struct _WMProcArgRec {
- DWORD dwScreen;
- WMInfoPtr pWMInfo;
- pthread_mutex_t *ppmServerStarted;
-} WMProcArgRec, *WMProcArgPtr;
-
-typedef struct _XMsgProcArgRec {
- Display *pDisplay;
- DWORD dwScreen;
- WMInfoPtr pWMInfo;
- pthread_mutex_t *ppmServerStarted;
-} XMsgProcArgRec, *XMsgProcArgPtr;
-
-
-/*
- * References to external symbols
- */
-
-extern char *display;
-extern void ErrorF (const char* /*f*/, ...);
-extern Bool g_fCalledSetLocale;
-extern Bool g_fCalledXInitThreads;
-
-
-/*
- * Prototypes for local functions
- */
-
-static void
-PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode);
-
-static WMMsgNodePtr
-PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo);
-
-static Bool
-InitQueue (WMMsgQueuePtr pQueue);
-
-static void
-GetWindowName (Display * pDpy, Window iWin, char **ppName);
-
-static int
-SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
-
-static void
-UpdateName (WMInfoPtr pWMInfo, Window iWindow);
-
-static void*
-winMultiWindowWMProc (void* pArg);
-
-static int
-winMultiWindowWMErrorHandler (Display *pDisp, XErrorEvent *e);
-
-static void *
-winMultiWindowXMsgProc (void *pArg);
-
-static void
-winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg);
-
-static int
-winMutliWindowWMIOErrorHandler (Display *pDisplay);
-
-
-/*
- * Local globals
- */
-
-static int g_nQueueSize;
-static jmp_buf g_jmpEntry;
-static Bool g_shutdown = FALSE;
-
-
-
-/*
- * PushMessage - Push a message onto the queue
- */
-
-static void
-PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
-{
-
- /* Lock the queue mutex */
- pthread_mutex_lock (&pQueue->pmMutex);
-
- pNode->pNext = NULL;
-
- if (pQueue->pTail != NULL)
- {
- pQueue->pTail->pNext = pNode;
- }
- pQueue->pTail = pNode;
-
- if (pQueue->pHead == NULL)
- {
- pQueue->pHead = pNode;
- }
-
-
-#if 0
- switch (pNode->msg.msg)
- {
- case WM_WM_MOVE:
- ErrorF ("\tWM_WM_MOVE\n");
- break;
- case WM_WM_RAISE:
- ErrorF ("\tWM_WM_RAISE\n");
- break;
- case WM_WM_LOWER:
- ErrorF ("\tWM_WM_RAISE\n");
- break;
- case WM_WM_MAP:
- ErrorF ("\tWM_WM_MAP\n");
- break;
- case WM_WM_UNMAP:
- ErrorF ("\tWM_WM_UNMAP\n");
- break;
- case WM_WM_KILL:
- ErrorF ("\tWM_WM_KILL\n");
- break;
- default:
- ErrorF ("Unknown Message.\n");
- break;
- }
-#endif
-
- /* Increase the count of elements in the queue by one */
- ++g_nQueueSize;
-
- /* Release the queue mutex */
- pthread_mutex_unlock (&pQueue->pmMutex);
-
- /* Signal that the queue is not empty */
- pthread_cond_signal (&pQueue->pcNotEmpty);
-}
-
-
-#if CYGMULTIWINDOW_DEBUG
-/*
- * QueueSize - Return the size of the queue
- */
-
-static int
-QueueSize (WMMsgQueuePtr pQueue)
-{
- WMMsgNodePtr pNode;
- int nSize = 0;
-
- /* Loop through all elements in the queue */
- for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
- ++nSize;
-
- return nSize;
-}
-#endif
-
-
-/*
- * PopMessage - Pop a message from the queue
- */
-
-static WMMsgNodePtr
-PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
-{
- WMMsgNodePtr pNode;
-
- /* Lock the queue mutex */
- pthread_mutex_lock (&pQueue->pmMutex);
-
- /* Wait for --- */
- while (pQueue->pHead == NULL)
- {
- pthread_cond_wait (&pQueue->pcNotEmpty, &pQueue->pmMutex);
- }
-
- pNode = pQueue->pHead;
- if (pQueue->pHead != NULL)
- {
- pQueue->pHead = pQueue->pHead->pNext;
- }
-
- if (pQueue->pTail == pNode)
- {
- pQueue->pTail = NULL;
- }
-
- /* Drop the number of elements in the queue by one */
- --g_nQueueSize;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("Queue Size %d %d\n", g_nQueueSize, QueueSize(pQueue));
-#endif
-
- /* Release the queue mutex */
- pthread_mutex_unlock (&pQueue->pmMutex);
-
- return pNode;
-}
-
-
-#if 0
-/*
- * HaveMessage -
- */
-
-static Bool
-HaveMessage (WMMsgQueuePtr pQueue, UINT msg, Window iWindow)
-{
- WMMsgNodePtr pNode;
-
- for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
- {
- if (pNode->msg.msg==msg && pNode->msg.iWindow==iWindow)
- return True;
- }
-
- return False;
-}
-#endif
-
-
-/*
- * InitQueue - Initialize the Window Manager message queue
- */
-
-static
-Bool
-InitQueue (WMMsgQueuePtr pQueue)
-{
- /* Check if the pQueue pointer is NULL */
- if (pQueue == NULL)
- {
- ErrorF ("InitQueue - pQueue is NULL. Exiting.\n");
- return FALSE;
- }
-
- /* Set the head and tail to NULL */
- pQueue->pHead = NULL;
- pQueue->pTail = NULL;
-
- /* There are no elements initially */
- g_nQueueSize = 0;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("InitQueue - Queue Size %d %d\n", g_nQueueSize, QueueSize(pQueue));
-#endif
-
- ErrorF ("InitQueue - Calling pthread_mutex_init\n");
-
- /* Create synchronization objects */
- pthread_mutex_init (&pQueue->pmMutex, NULL);
-
- ErrorF ("InitQueue - pthread_mutex_init returned\n");
- ErrorF ("InitQueue - Calling pthread_cond_init\n");
-
- pthread_cond_init (&pQueue->pcNotEmpty, NULL);
-
- ErrorF ("InitQueue - pthread_cond_init returned\n");
-
- return TRUE;
-}
-
-
-/*
- * GetWindowName - Retrieve the title of an X Window
- */
-
-static void
-GetWindowName (Display *pDisplay, Window iWin, char **ppName)
-{
- int nResult, nNum;
- char **ppList;
- XTextProperty xtpName;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName\n");
-#endif
-
- /* Intialize ppName to NULL */
- *ppName = NULL;
-
- /* Try to get --- */
- nResult = XGetWMName (pDisplay, iWin, &xtpName);
- if (!nResult || !xtpName.value || !xtpName.nitems)
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - XGetWMName failed. No name.\n");
-#endif
- return;
- }
-
- /* */
- if (xtpName.encoding == XA_STRING)
- {
- /* */
- if (xtpName.value)
- {
- *ppName = strdup ((char*)xtpName.value);
- XFree (xtpName.value);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - XA_STRING %s\n", *ppName);
-#endif
- }
- else
- {
- XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum);
-
- /* */
- if (nNum && ppList && *ppList)
- {
- XFree (xtpName.value);
- *ppName = strdup (*ppList);
- XFreeStringList (ppList);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - %s %s\n",
- XGetAtomName (pDisplay, xtpName.encoding), *ppName);
-#endif
- }
-
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - Returning\n");
-#endif
-}
-
-
-/*
- * Send a message to the X server from the WM thread
- */
-
-static int
-SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
-{
- XEvent e;
-
- /* Prepare the X event structure */
- e.type = ClientMessage;
- e.xclient.window = iWin;
- e.xclient.message_type = atmType;
- e.xclient.format = 32;
- e.xclient.data.l[0] = nData;
- e.xclient.data.l[1] = CurrentTime;
-
- /* Send the event to X */
- return XSendEvent (pDisplay, iWin, False, NoEventMask, &e);
-}
-
-
-/*
- * Updates the name of a HWND according to its X WM_NAME property
- */
-
-static void
-UpdateName (WMInfoPtr pWMInfo, Window iWindow)
-{
- char *pszName;
- Atom atmType;
- int fmtRet;
- unsigned long items, remain;
- HWND *retHwnd, hWnd;
- XWindowAttributes attr;
-
- hWnd = 0;
-
- /* See if we can get the cached HWND for this window... */
- if (XGetWindowProperty (pWMInfo->pDisplay,
- iWindow,
- pWMInfo->atmPrivMap,
- 0,
- 1,
- False,
- pWMInfo->atmPrivMap,
- &atmType,
- &fmtRet,
- &items,
- &remain,
- (unsigned char **) &retHwnd) == Success)
- {
- if (retHwnd)
- {
- hWnd = *retHwnd;
- XFree (retHwnd);
- }
- }
-
- /* Some sanity checks */
- if (!hWnd) return;
- if (!IsWindow (hWnd)) return;
-
- /* Set the Windows window name */
- GetWindowName (pWMInfo->pDisplay, iWindow, &pszName);
- if (pszName)
- {
- /* Get the window attributes */
- XGetWindowAttributes (pWMInfo->pDisplay,
- iWindow,
- &attr);
- if (!attr.override_redirect)
- {
- SetWindowText (hWnd, pszName);
- winUpdateIcon (iWindow);
- }
-
- free (pszName);
- }
-}
-
-
-/*
- * winMultiWindowWMProc
- */
-
-static void *
-winMultiWindowWMProc (void *pArg)
-{
- WMProcArgPtr pProcArg = (WMProcArgPtr)pArg;
- WMInfoPtr pWMInfo = pProcArg->pWMInfo;
-
- /* Initialize the Window Manager */
- winInitMultiWindowWM (pWMInfo, pProcArg);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winMultiWindowWMProc ()\n");
-#endif
-
- /* Loop until we explicity break out */
- for (;;)
- {
- WMMsgNodePtr pNode;
-
- /* Pop a message off of our queue */
- pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo);
- if (pNode == NULL)
- {
- /* Bail if PopMessage returns without a message */
- /* NOTE: Remember that PopMessage is a blocking function. */
- ErrorF ("winMultiWindowWMProc - Queue is Empty?\n");
- pthread_exit (NULL);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
- GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID);
-#endif
-
- /* Branch on the message type */
- switch (pNode->msg.msg)
- {
-#if 0
- case WM_WM_MOVE:
- ErrorF ("\tWM_WM_MOVE\n");
- break;
-
- case WM_WM_SIZE:
- ErrorF ("\tWM_WM_SIZE\n");
- break;
-#endif
-
- case WM_WM_RAISE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_RAISE\n");
-#endif
-
- /* Raise the window */
- XRaiseWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
- break;
-
- case WM_WM_LOWER:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_LOWER\n");
-#endif
-
- /* Lower the window */
- XLowerWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
- break;
-
- case WM_WM_MAP:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_MAP\n");
-#endif
- /* Put a note as to the HWND associated with this Window */
- XChangeProperty (pWMInfo->pDisplay,
- pNode->msg.iWindow,
- pWMInfo->atmPrivMap,
- pWMInfo->atmPrivMap,
- 32,
- PropModeReplace,
- (unsigned char *) &(pNode->msg.hwndWindow),
- 1);
- UpdateName (pWMInfo, pNode->msg.iWindow);
- winUpdateIcon (pNode->msg.iWindow);
- break;
-
- case WM_WM_UNMAP:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_UNMAP\n");
-#endif
-
- /* Unmap the window */
- XUnmapWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
- break;
-
- case WM_WM_KILL:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_KILL\n");
-#endif
- {
- int i, n, found = 0;
- Atom *protocols;
-
- /* --- */
- if (XGetWMProtocols (pWMInfo->pDisplay,
- pNode->msg.iWindow,
- &protocols,
- &n))
- {
- for (i = 0; i < n; ++i)
- if (protocols[i] == pWMInfo->atmWmDelete)
- ++found;
-
- XFree (protocols);
- }
-
- /* --- */
- if (found)
- SendXMessage (pWMInfo->pDisplay,
- pNode->msg.iWindow,
- pWMInfo->atmWmProtos,
- pWMInfo->atmWmDelete);
- else
- XKillClient (pWMInfo->pDisplay,
- pNode->msg.iWindow);
- }
- break;
-
- case WM_WM_ACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tWM_WM_ACTIVATE\n");
-#endif
-
- /* Set the input focus */
- XSetInputFocus (pWMInfo->pDisplay,
- pNode->msg.iWindow,
- RevertToPointerRoot,
- CurrentTime);
- break;
-
- case WM_WM_NAME_EVENT:
- UpdateName (pWMInfo, pNode->msg.iWindow);
- break;
-
- case WM_WM_HINTS_EVENT:
- winUpdateIcon (pNode->msg.iWindow);
- break;
-
- case WM_WM_CHANGE_STATE:
- /* Minimize the window in Windows */
- winMinimizeWindow (pNode->msg.iWindow);
- break;
-
- default:
- ErrorF ("winMultiWindowWMProc - Unknown Message.\n");
- pthread_exit (NULL);
- break;
- }
-
- /* Free the retrieved message */
- free (pNode);
-
- /* Flush any pending events on our display */
- XFlush (pWMInfo->pDisplay);
- }
-
- /* Free the condition variable */
- pthread_cond_destroy (&pWMInfo->wmMsgQueue.pcNotEmpty);
-
- /* Free the mutex variable */
- pthread_mutex_destroy (&pWMInfo->wmMsgQueue.pmMutex);
-
- /* Free the passed-in argument */
- free (pProcArg);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF("-winMultiWindowWMProc ()\n");
-#endif
-}
-
-
-/*
- * winMultiWindowWMErrorHandler - Our application specific error handler
- */
-
-static int
-winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
-{
- char pszErrorMsg[100];
-
- if (pErr->request_code == X_ChangeWindowAttributes
- && pErr->error_code == BadAccess)
- {
- ErrorF ("winMultiWindowWMErrorHandler - ChangeWindowAttributes "
- "BadAccess.\n");
-#if 0
- pthread_exit (NULL);
-#endif
- return 0;
- }
-
- XGetErrorText (pDisplay,
- pErr->error_code,
- pszErrorMsg,
- sizeof (pszErrorMsg));
- ErrorF ("winMultiWindowWMErrorHandler - ERROR: %s\n", pszErrorMsg);
-
- if (pErr->error_code == BadWindow
- || pErr->error_code == BadMatch
- || pErr->error_code == BadDrawable)
- {
-#if 0
- pthread_exit (NULL);
-#endif
- return 0;
- }
-
- pthread_exit (NULL);
- return 0;
-}
-
-
-/*
- *
- */
-
-static void *
-winMultiWindowXMsgProc (void *pArg)
-{
- winWMMessageRec msg;
- XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg;
- char pszDisplay[512];
- int iRetries;
- XEvent event;
- Atom atmWmName;
- Atom atmWmHints;
- Atom atmWmChange;
- int iReturn;
- XIconSize *xis;
-
- ErrorF ("winMultiWindowXMsgProc - Hello\n");
-
- /* Check that argument pointer is not invalid */
- if (pProcArg == NULL)
- {
- ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL, bailing.\n");
- pthread_exit (NULL);
- }
-
- ErrorF ("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n");
-
- /* Grab the server started mutex - pause until we get it */
- iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
- if (iReturn != 0)
- {
- ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d\n",
- iReturn);
- pthread_exit (NULL);
- }
-
- ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n");
-
- /* Only call XInitThreads once for the whole process */
- if (!g_fCalledXInitThreads)
- {
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed.\n");
- pthread_exit (NULL);
- }
-
- /* Flag that XInitThreads has been called */
- g_fCalledXInitThreads = TRUE;
-
- ErrorF ("winMultiWindowXMsgProc - XInitThreads () returned.\n");
- }
-
- /* Release the server started mutex */
- pthread_mutex_unlock (pProcArg->ppmServerStarted);
-
- ErrorF ("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n");
-
- /* Setup the display connection string x */
- snprintf (pszDisplay,
- 512, "127.0.0.1:%s.%d", display, (int)pProcArg->dwScreen);
-
- /* Print the display connection string */
- ErrorF ("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay);
-
- iRetries = 0;
-
- /* Open the X display */
- do
- {
- /* Try to open the display */
- pProcArg->pDisplay = XOpenDisplay (pszDisplay);
- if (pProcArg->pDisplay == NULL)
- {
- ErrorF ("winMultiWindowXMsgProc - Could not open display, try: %d, "
- "sleeping: %d\n\f",
- iRetries + 1, WIN_CONNECT_DELAY);
- ++iRetries;
- sleep (WIN_CONNECT_DELAY);
- continue;
- }
- else
- break;
- }
- while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
-
- /* Make sure that the display opened */
- if (pProcArg->pDisplay == NULL)
- {
- ErrorF ("winMultiWindowXMsgProcwinInitMultiWindowWM - "
- "Failed opening the display, giving up.\n\f");
- pthread_exit (NULL);
- }
-
- ErrorF ("winMultiWindowXMsgProc - XOpenDisplay () returned and "
- "successfully opened the display.\n");
-
- /* Install our error handler */
- XSetErrorHandler (winMultiWindowWMErrorHandler);
- XSetIOErrorHandler (winMutliWindowWMIOErrorHandler);
-
- XSelectInput (pProcArg->pDisplay,
- RootWindow(pProcArg->pDisplay, pProcArg->dwScreen),
- SubstructureNotifyMask);
-
- /* Set up the supported icon sizes */
- xis = XAllocIconSize ();
- if (xis)
- {
- xis->min_width = xis->min_height = 16;
- xis->max_width = xis->max_height = 48;
- xis->width_inc = xis->height_inc = 16;
- XSetIconSizes (pProcArg->pDisplay,
- RootWindow (pProcArg->pDisplay, pProcArg->dwScreen),
- xis,
- 1);
- XFree (xis);
- }
-
- atmWmName = XInternAtom (pProcArg->pDisplay,
- "WM_NAME",
- False);
- atmWmHints = XInternAtom (pProcArg->pDisplay,
- "WM_HINTS",
- False);
- atmWmChange = XInternAtom (pProcArg->pDisplay,
- "WM_CHANGE_STATE",
- False);
-
- /* Loop until we explicitly break out */
- while (1)
- {
- /* Fetch next event */
- XNextEvent (pProcArg->pDisplay, &event);
-
- /* Branch on event type */
- if (event.type == CreateNotify)
- {
- XSelectInput (pProcArg->pDisplay,
- event.xcreatewindow.window,
- PropertyChangeMask);
- }
- else if (event.type == PropertyNotify
- && event.xproperty.atom == atmWmName)
- {
- memset (&msg, 0, sizeof (msg));
-
- msg.msg = WM_WM_NAME_EVENT;
- msg.iWindow = event.xproperty.window;
-
- /* Other fields ignored */
- winSendMessageToWM (pProcArg->pWMInfo, &msg);
- }
- else if (event.type == PropertyNotify
- && event.xproperty.atom == atmWmHints)
- {
- memset (&msg, 0, sizeof (msg));
-
- msg.msg = WM_WM_HINTS_EVENT;
- msg.iWindow = event.xproperty.window;
-
- /* Other fields ignored */
- winSendMessageToWM (pProcArg->pWMInfo, &msg);
- }
- else if (event.type == ClientMessage
- && event.xclient.message_type == atmWmChange
- && event.xclient.data.l[0] == IconicState)
- {
- ErrorF ("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n");
-
- memset (&msg, 0, sizeof (msg));
-
- msg.msg = WM_WM_CHANGE_STATE;
- msg.iWindow = event.xclient.window;
-
- winSendMessageToWM (pProcArg->pWMInfo, &msg);
- }
- }
-}
-
-
-/*
- * winInitWM - Entry point for the X server to spawn
- * the Window Manager thread. Called from
- * winscrinit.c/winFinishScreenInitFB ().
- */
-
-Bool
-winInitWM (void **ppWMInfo,
- pthread_t *ptWMProc,
- pthread_t *ptXMsgProc,
- pthread_mutex_t *ppmServerStarted,
- int dwScreen)
-{
- WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
- WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
- XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec));
-
- /* Bail if the input parameters are bad */
- if (pArg == NULL || pWMInfo == NULL)
- {
- ErrorF ("winInitWM - malloc fail.\n");
- return FALSE;
- }
-
- /* Set a return pointer to the Window Manager info structure */
- *ppWMInfo = pWMInfo;
-
- /* Setup the argument structure for the thread function */
- pArg->dwScreen = dwScreen;
- pArg->pWMInfo = pWMInfo;
- pArg->ppmServerStarted = ppmServerStarted;
-
- /* Intialize the message queue */
- if (!InitQueue (&pWMInfo->wmMsgQueue))
- {
- ErrorF ("winInitWM - InitQueue () failed.\n");
- return FALSE;
- }
-
- /* Spawn a thread for the Window Manager */
- if (pthread_create (ptWMProc, NULL, winMultiWindowWMProc, pArg))
- {
- /* Bail if thread creation failed */
- ErrorF ("winInitWM - pthread_create failed for Window Manager.\n");
- return FALSE;
- }
-
- /* Spawn the XNextEvent thread, will send messages to WM */
- pXMsgArg->dwScreen = dwScreen;
- pXMsgArg->pWMInfo = pWMInfo;
- pXMsgArg->ppmServerStarted = ppmServerStarted;
- if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg))
- {
- /* Bail if thread creation failed */
- ErrorF ("winInitWM - pthread_create failed on XMSG.\n");
- return FALSE;
- }
-
-#if CYGDEBUG || YES
- ErrorF ("winInitWM - Returning.\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * winInitMultiWindowWM -
- */
-
-Bool
-winClipboardDetectUnicodeSupport ();
-
-static void
-winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
-{
- int iRetries = 0;
- char pszDisplay[512];
- int iReturn;
- Bool fUnicodeSupport;
-
- ErrorF ("winInitMultiWindowWM - Hello\n");
-
- /* Check that argument pointer is not invalid */
- if (pProcArg == NULL)
- {
- ErrorF ("winInitMultiWindowWM - pProcArg is NULL, bailing.\n");
- pthread_exit (NULL);
- }
-
- ErrorF ("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n");
-
- /* Grab our garbage mutex to satisfy pthread_cond_wait */
- iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
- if (iReturn != 0)
- {
- ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d\n",
- iReturn);
- pthread_exit (NULL);
- }
-
- ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n");
-
- /* Do we have Unicode support? */
- fUnicodeSupport = winClipboardDetectUnicodeSupport ();
-
- /* Set the current locale? What does this do? */
- if (fUnicodeSupport && !g_fCalledSetLocale)
- {
- ErrorF ("winInitMultiWindowWM - Calling setlocale ()\n");
- if (!setlocale (LC_ALL, ""))
- {
- ErrorF ("winInitMultiWindowWM - setlocale () error\n");
- pthread_exit (NULL);
- }
- ErrorF ("winInitMultiWindowWM - setlocale () returned\n");
-
- /* See if X supports the current locale */
- if (XSupportsLocale () == False)
- {
- ErrorF ("winInitMultiWindowWM - Locale not supported by X\n");
- pthread_exit (NULL);
- }
- }
-
- /* Flag that we have called setlocale */
- g_fCalledSetLocale = TRUE;
-
- /* Only call XInitThreads once for the whole process */
- if (!g_fCalledXInitThreads)
- {
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winInitMultiWindowWM - XInitThreads () failed.\n");
- pthread_exit (NULL);
- }
-
- /* Flag that XInitThreads has been called */
- g_fCalledXInitThreads = TRUE;
-
- ErrorF ("winInitMultiWindowWM - XInitThreads () returned.\n");
- }
-
- /* Release the server started mutex */
- pthread_mutex_unlock (pProcArg->ppmServerStarted);
-
- ErrorF ("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n");
-
- /* Set jump point for IO Error exits */
- iReturn = setjmp (g_jmpEntry);
-
- /* Check if we should continue operations */
- if (iReturn != WIN_JMP_ERROR_IO
- && iReturn != WIN_JMP_OKAY)
- {
- /* setjmp returned an unknown value, exit */
- ErrorF ("winInitMultiWindowWM - setjmp returned: %d exiting\n",
- iReturn);
- pthread_exit (NULL);
- }
- else if (g_shutdown)
- {
- /* Shutting down, the X server severed out connection! */
- ErrorF ("winInitMultiWindowWM - Detected shutdown in progress\n");
- pthread_exit (NULL);
- }
- else if (iReturn == WIN_JMP_ERROR_IO)
- {
- ErrorF ("winInitMultiWindowWM - setjmp returned WIN_JMP_ERROR_IO\n");
- }
-
- /* Setup the display connection string x */
- snprintf (pszDisplay,
- 512,
- "127.0.0.1:%s.%d",
- display,
- (int) pProcArg->dwScreen);
-
- /* Print the display connection string */
- ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
-
- /* Open the X display */
- do
- {
- /* Try to open the display */
- pWMInfo->pDisplay = XOpenDisplay (pszDisplay);
- if (pWMInfo->pDisplay == NULL)
- {
- ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, "
- "sleeping: %d\n\f",
- iRetries + 1, WIN_CONNECT_DELAY);
- ++iRetries;
- sleep (WIN_CONNECT_DELAY);
- continue;
- }
- else
- break;
- }
- while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
-
- /* Make sure that the display opened */
- if (pWMInfo->pDisplay == NULL)
- {
- ErrorF ("winInitMultiWindowWM - Failed opening the display, "
- "giving up.\n\f");
- pthread_exit (NULL);
- }
-
- ErrorF ("winInitMultiWindowWM - XOpenDisplay () returned and "
- "successfully opened the display.\n");
-
- /* Install our error handler */
- XSetErrorHandler (winMultiWindowWMErrorHandler);
- XSetIOErrorHandler (winMutliWindowWMIOErrorHandler);
-
- /* Create some atoms */
- pWMInfo->atmWmProtos = XInternAtom (pWMInfo->pDisplay,
- "WM_PROTOCOLS",
- False);
- pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
- "WM_DELETE_WINDOW",
- False);
- pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
- WIN_HWND_CACHE,
- False);
-}
-
-
-/*
- * winSendMessageToWM - Send a message from the X thread to the WM thread
- */
-
-void
-winSendMessageToWM (void *pWMInfo, winWMMessagePtr pMsg)
-{
- WMMsgNodePtr pNode;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winSendMessageToWM ()\n");
-#endif
-
- pNode = (WMMsgNodePtr)malloc(sizeof(WMMsgNodeRec));
- if (pNode != NULL)
- {
- memcpy (&pNode->msg, pMsg, sizeof(winWMMessageRec));
- PushMessage (&((WMInfoPtr)pWMInfo)->wmMsgQueue, pNode);
- }
-}
-
-
-/*
- * winMutliWindowWMIOErrorHandler - Our application specific IO error handler
- */
-
-static int
-winMutliWindowWMIOErrorHandler (Display *pDisplay)
-{
- printf ("\nwinMutliWindowWMIOErrorHandler!\n\n");
-
- /* Restart at the main entry point */
- longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
-
- return 0;
-}
-
-
-/*
- * Notify the MWM thread we're exiting and not to reconnect
- */
-
-void
-winDeinitMultiWindowWM ()
-{
- ErrorF ("winDeinitMultiWindowWM - Noting shutdown in progress\n");
- g_shutdown = TRUE;
-}
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
deleted file mode 100755
index d90abb61f..000000000
--- a/hw/xwin/winmultiwindowwndproc.c
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Kensuke Matsuzaki
- * Earle F. Philhower, III
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwndproc.c,v 1.3 2003/10/08 11:13:03 eich Exp $ */
-
-#include "win.h"
-#include "dixevents.h"
-#include "winmultiwindowclass.h"
-#include "winprefs.h"
-
-/*
- * External global variables
- */
-
-extern Bool g_fCursor;
-
-
-/*
- * Global variables
- */
-
-HICON g_hiconX = NULL;
-
-
-/*
- * Local globals
- */
-
-static UINT_PTR g_uipMousePollingTimerID = 0;
-
-
-/*
- * Constant defines
- */
-
-#define MOUSE_POLLING_INTERVAL 500
-#define WIN_MULTIWINDOW_SHAPE YES
-
-
-
-/*
- * ConstrainSize - Taken from TWM sources - Respects hints for sizing
- */
-#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) )
-static void
-ConstrainSize (WinXSizeHints hints, int *widthp, int *heightp)
-{
- int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta;
- int baseWidth, baseHeight;
- int dwidth = *widthp, dheight = *heightp;
-
- if (hints.flags & PMinSize)
- {
- minWidth = hints.min_width;
- minHeight = hints.min_height;
- }
- else if (hints.flags & PBaseSize)
- {
- minWidth = hints.base_width;
- minHeight = hints.base_height;
- }
- else
- minWidth = minHeight = 1;
-
- if (hints.flags & PBaseSize)
- {
- baseWidth = hints.base_width;
- baseHeight = hints.base_height;
- }
- else if (hints.flags & PMinSize)
- {
- baseWidth = hints.min_width;
- baseHeight = hints.min_height;
- }
- else
- baseWidth = baseHeight = 0;
-
- if (hints.flags & PMaxSize)
- {
- maxWidth = hints.max_width;
- maxHeight = hints.max_height;
- }
- else
- {
- maxWidth = MAXINT;
- maxHeight = MAXINT;
- }
-
- if (hints.flags & PResizeInc)
- {
- xinc = hints.width_inc;
- yinc = hints.height_inc;
- }
- else
- xinc = yinc = 1;
-
- /*
- * First, clamp to min and max values
- */
- if (dwidth < minWidth)
- dwidth = minWidth;
- if (dheight < minHeight)
- dheight = minHeight;
-
- if (dwidth > maxWidth)
- dwidth = maxWidth;
- if (dheight > maxHeight)
- dheight = maxHeight;
-
- /*
- * Second, fit to base + N * inc
- */
- dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth;
- dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight;
-
- /*
- * Third, adjust for aspect ratio
- */
-
- /*
- * The math looks like this:
- *
- * minAspectX dwidth maxAspectX
- * ---------- <= ------- <= ----------
- * minAspectY dheight maxAspectY
- *
- * If that is multiplied out, then the width and height are
- * invalid in the following situations:
- *
- * minAspectX * dheight > minAspectY * dwidth
- * maxAspectX * dheight < maxAspectY * dwidth
- *
- */
-
- if (hints.flags & PAspect)
- {
- if (hints.min_aspect.x * dheight > hints.min_aspect.y * dwidth)
- {
- delta = makemult(hints.min_aspect.x * dheight / hints.min_aspect.y - dwidth, xinc);
- if (dwidth + delta <= maxWidth)
- dwidth += delta;
- else
- {
- delta = makemult(dheight - dwidth*hints.min_aspect.y/hints.min_aspect.x, yinc);
- if (dheight - delta >= minHeight)
- dheight -= delta;
- }
- }
-
- if (hints.max_aspect.x * dheight < hints.max_aspect.y * dwidth)
- {
- delta = makemult(dwidth * hints.max_aspect.y / hints.max_aspect.x - dheight, yinc);
- if (dheight + delta <= maxHeight)
- dheight += delta;
- else
- {
- delta = makemult(dwidth - hints.max_aspect.x*dheight/hints.max_aspect.y, xinc);
- if (dwidth - delta >= minWidth)
- dwidth -= delta;
- }
- }
- }
-
- /* Return computed values */
- *widthp = dwidth;
- *heightp = dheight;
-}
-#undef makemult
-
-
-
-/*
- * ValidateSizing - Ensures size request respects hints
- */
-static int
-ValidateSizing (HWND hwnd, WindowPtr pWin,
- WPARAM wParam, LPARAM lParam)
-{
- WinXSizeHints sizeHints;
- RECT *rect;
- int iWidth, iHeight, iTopBorder;
- POINT pt;
-
- /* Invalid input checking */
- if (pWin==NULL || lParam==0)
- return FALSE;
-
- /* No size hints, no checking */
- if (!winMultiWindowGetWMNormalHints (pWin, &sizeHints))
- return FALSE;
-
- /* Avoid divide-by-zero */
- if (sizeHints.flags & PResizeInc)
- {
- if (sizeHints.width_inc == 0) sizeHints.width_inc = 1;
- if (sizeHints.height_inc == 0) sizeHints.height_inc = 1;
- }
-
- rect = (RECT*)lParam;
-
- iWidth = rect->right - rect->left;
- iHeight = rect->bottom - rect->top;
-
- /* Get title bar height, there must be an easier way?! */
- pt.x = pt.y = 0;
- ClientToScreen(hwnd, &pt);
- iTopBorder = pt.y - rect->top;
-
- /* Now remove size of any borders */
- iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
- iHeight -= GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
-
- /* Constrain the size to legal values */
- ConstrainSize (sizeHints, &iWidth, &iHeight);
-
- /* Add back the borders */
- iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
- iHeight += GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
-
- /* Adjust size according to where we're dragging from */
- switch(wParam) {
- case WMSZ_TOP:
- case WMSZ_TOPRIGHT:
- case WMSZ_BOTTOM:
- case WMSZ_BOTTOMRIGHT:
- case WMSZ_RIGHT:
- rect->right = rect->left + iWidth;
- break;
- default:
- rect->left = rect->right - iWidth;
- break;
- }
- switch(wParam) {
- case WMSZ_BOTTOM:
- case WMSZ_BOTTOMRIGHT:
- case WMSZ_BOTTOMLEFT:
- case WMSZ_RIGHT:
- case WMSZ_LEFT:
- rect->bottom = rect->top + iHeight;
- break;
- default:
- rect->top = rect->bottom - iHeight;
- break;
- }
- return TRUE;
-}
-
-
-/*
- * winTopLevelWindowProc - Window procedure for all top-level Windows windows.
- */
-
-LRESULT CALLBACK
-winTopLevelWindowProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- POINT ptMouse;
- HDC hdcUpdate;
- PAINTSTRUCT ps;
- WindowPtr pWin = NULL;
- winPrivWinPtr pWinPriv = NULL;
- ScreenPtr s_pScreen = NULL;
- winPrivScreenPtr s_pScreenPriv = NULL;
- winScreenInfo *s_pScreenInfo = NULL;
- HWND hwndScreen = NULL;
- DrawablePtr pDraw = NULL;
- int iX, iY, iWidth, iHeight, iBorder;
- winWMMessageRec wmMsg;
- Bool fWMMsgInitialized = FALSE;
- static Bool s_fTracking = FALSE;
-
- /* Check if the Windows window property for our X window pointer is valid */
- if ((pWin = GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
- {
- /* Our X window pointer is valid */
-
- /* Get pointers to the drawable and the screen */
- pDraw = &pWin->drawable;
- s_pScreen = pWin->drawable.pScreen;
-
- /* Get a pointer to our window privates */
- pWinPriv = winGetWindowPriv(pWin);
-
- /* Get pointers to our screen privates and screen info */
- s_pScreenPriv = pWinPriv->pScreenPriv;
- s_pScreenInfo = s_pScreenPriv->pScreenInfo;
-
- /* Get the handle for our screen-sized window */
- hwndScreen = s_pScreenPriv->hwndScreen;
-
- /* */
- wmMsg.msg = 0;
- wmMsg.hwndWindow = hwnd;
- wmMsg.iWindow = (Window)GetProp (hwnd, WIN_WID_PROP);
-
- wmMsg.iX = pWinPriv->iX;
- wmMsg.iY = pWinPriv->iY;
- wmMsg.iWidth = pWinPriv->iWidth;
- wmMsg.iHeight = pWinPriv->iHeight;
-
- fWMMsgInitialized = TRUE;
-
-#if 0
- /*
- * Print some debugging information
- */
-
- ErrorF ("hWnd %08X\n", hwnd);
- ErrorF ("pWin %08X\n", pWin);
- ErrorF ("pDraw %08X\n", pDraw);
- ErrorF ("\ttype %08X\n", pWin->drawable.type);
- ErrorF ("\tclass %08X\n", pWin->drawable.class);
- ErrorF ("\tdepth %08X\n", pWin->drawable.depth);
- ErrorF ("\tbitsPerPixel %08X\n", pWin->drawable.bitsPerPixel);
- ErrorF ("\tid %08X\n", pWin->drawable.id);
- ErrorF ("\tx %08X\n", pWin->drawable.x);
- ErrorF ("\ty %08X\n", pWin->drawable.y);
- ErrorF ("\twidth %08X\n", pWin->drawable.width);
- ErrorF ("\thenght %08X\n", pWin->drawable.height);
- ErrorF ("\tpScreen %08X\n", pWin->drawable.pScreen);
- ErrorF ("\tserialNumber %08X\n", pWin->drawable.serialNumber);
- ErrorF ("g_iWindowPrivateIndex %d\n", g_iWindowPrivateIndex);
- ErrorF ("pWinPriv %08X\n", pWinPriv);
- ErrorF ("s_pScreenPriv %08X\n", s_pScreenPriv);
- ErrorF ("s_pScreenInfo %08X\n", s_pScreenInfo);
- ErrorF ("hwndScreen %08X\n", hwndScreen);
-#endif
- }
-
- /* Branch on message type */
- switch (message)
- {
- case WM_CREATE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_CREATE\n");
-#endif
-
- /* */
- SetProp (hwnd,
- WIN_WINDOW_PROP,
- (HANDLE)((LPCREATESTRUCT) lParam)->lpCreateParams);
-
- /* */
- SetProp (hwnd,
- WIN_WID_PROP,
- (HANDLE)winGetWindowID (((LPCREATESTRUCT) lParam)->lpCreateParams));
-
- return 0;
-
-
- case WM_INIT_SYS_MENU:
- /*
- * Add whatever the setup file wants to for this window
- */
- SetupSysMenu ((unsigned long)hwnd);
- return 0;
-
- case WM_SYSCOMMAND:
- /*
- * Any window menu items go through here
- */
- HandleCustomWM_COMMAND ((unsigned long)hwnd, LOWORD(wParam));
- break;
-
- case WM_INITMENU:
- /* Checks/Unchecks any menu items before they are displayed */
- HandleCustomWM_INITMENU ((unsigned long)hwnd, wParam);
- break;
-
- case WM_PAINT:
- /* Only paint if our window handle is valid */
- if (hwndScreen == NULL)
- break;
-
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint (hwnd, &ps);
-
- /* Get the position and dimensions of the window */
- iBorder = wBorderWidth (pWin);
- iX = pWin->drawable.x;
- iY = pWin->drawable.y;
- iWidth = pWin->drawable.width;
- iHeight = pWin->drawable.height;
-
- /* Try to copy from the shadow buffer */
- if (!BitBlt (hdcUpdate,
- 0, 0,
- iWidth, iHeight,
- s_pScreenPriv->hdcShadow,
- iX, iY,
- SRCCOPY))
- {
- LPVOID lpMsgBuf;
-
- /* Display a fancy error message */
- FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError (),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf,
- 0, NULL);
-
- ErrorF ("winTopLevelWindowProc - BitBlt failed: %s\n",
- (LPSTR)lpMsgBuf);
- LocalFree (lpMsgBuf);
- }
-
- /* EndPaint frees the DC */
- EndPaint (hwndScreen, &ps);
- return 0;
-
- case WM_MOUSEMOVE:
- /* Unpack the client area mouse coordinates */
- ptMouse.x = GET_X_LPARAM(lParam);
- ptMouse.y = GET_Y_LPARAM(lParam);
-
- /* Translate the client area mouse coordinates to screen coordinates */
- ClientToScreen (hwnd, &ptMouse);
-
- /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
- ptMouse.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
- ptMouse.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
-
- /* We can't do anything without privates */
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Has the mouse pointer crossed screens? */
- if (s_pScreen != miPointerCurrentScreen ())
- miPointerSetNewScreen (s_pScreenInfo->dwScreen,
- ptMouse.x - s_pScreenInfo->dwXOffset,
- ptMouse.y - s_pScreenInfo->dwYOffset);
-
- /* Are we tracking yet? */
- if (!s_fTracking)
- {
- TRACKMOUSEEVENT tme;
-
- /* Setup data structure */
- ZeroMemory (&tme, sizeof (tme));
- tme.cbSize = sizeof (tme);
- tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = hwnd;
-
- /* Call the tracking function */
- if (!(*g_fpTrackMouseEvent) (&tme))
- ErrorF ("winTopLevelWindowProc - _TrackMouseEvent failed\n");
-
- /* Flag that we are tracking now */
- s_fTracking = TRUE;
- }
-
- /* Hide or show the Windows mouse cursor */
- if (g_fCursor)
- {
- /* Hide Windows cursor */
- g_fCursor = FALSE;
- ShowCursor (FALSE);
- }
-
- /* Kill the timer used to poll mouse events */
- if (g_uipMousePollingTimerID != 0)
- {
- KillTimer (s_pScreenPriv->hwndScreen, WIN_POLLING_MOUSE_TIMER_ID);
- g_uipMousePollingTimerID = 0;
- }
-
- /* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
- ptMouse.y - s_pScreenInfo->dwYOffset,
- g_c32LastInputEventTime = GetTickCount ());
- return 0;
-
- case WM_NCMOUSEMOVE:
- /*
- * We break instead of returning 0 since we need to call
- * DefWindowProc to get the mouse cursor changes
- * and min/max/close button highlighting in Windows XP.
- * The Platform SDK says that you should return 0 if you
- * process this message, but it fails to mention that you
- * will give up any default functionality if you do return 0.
- */
-
- /* We can't do anything without privates */
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Non-client mouse movement, show Windows cursor */
- if (!g_fCursor)
- {
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
-
- /*
- * Timer to poll mouse events. This is needed to make
- * programs like xeyes follow the mouse properly.
- */
- if (g_uipMousePollingTimerID == 0)
- g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
- WIN_POLLING_MOUSE_TIMER_ID,
- MOUSE_POLLING_INTERVAL,
- NULL);
- break;
-
- case WM_MOUSELEAVE:
- /* Mouse has left our client area */
-
- /* Flag that we are no longer tracking */
- s_fTracking = FALSE;
-
- /* Show the mouse cursor, if necessary */
- if (!g_fCursor)
- {
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
-
- /*
- * Timer to poll mouse events. This is needed to make
- * programs like xeyes follow the mouse properly.
- */
- if (g_uipMousePollingTimerID == 0)
- g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
- WIN_POLLING_MOUSE_TIMER_ID,
- MOUSE_POLLING_INTERVAL,
- NULL);
- return 0;
-
- case WM_LBUTTONDBLCLK:
- case WM_LBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
-
- case WM_LBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
-
- case WM_MBUTTONDBLCLK:
- case WM_MBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
-
- case WM_MBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
-
- case WM_RBUTTONDBLCLK:
- case WM_RBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
-
- case WM_RBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
-
- case WM_MOUSEWHEEL:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_MOUSEWHEEL\n");
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
-
- case WM_KILLFOCUS:
- /* Pop any pressed keys since we are losing keyboard focus */
- winKeybdReleaseKeys ();
- return 0;
-
- case WM_SYSDEADCHAR:
- case WM_DEADCHAR:
- /*
- * NOTE: We do nothing with WM_*CHAR messages,
- * nor does the root window, so we can just toss these messages.
- */
- return 0;
-
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_*KEYDOWN\n");
-#endif
-
- /*
- * Don't pass Alt-F4 key combo to root window,
- * let Windows translate to WM_CLOSE and close this top-level window.
- *
- * NOTE: We purposely don't check the fUseWinKillKey setting because
- * it should only apply to the key handling for the root window,
- * not for top-level window-manager windows.
- *
- * ALSO NOTE: We do pass Ctrl-Alt-Backspace to the root window
- * because that is a key combo that no X app should be expecting to
- * receive, since it has historically been used to shutdown the X server.
- * Passing Ctrl-Alt-Backspace to the root window preserves that
- * behavior, assuming that -unixkill has been passed as a parameter.
- */
- if (wParam == VK_F4 && (GetKeyState (VK_MENU) & 0x8000))
- break;
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
-
- case WM_SYSKEYUP:
- case WM_KEYUP:
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_*KEYUP\n");
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
-
- case WM_HOTKEY:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_HOTKEY\n");
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
-
- case WM_ACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_ACTIVATE\n");
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
-
- if (s_pScreenPriv != NULL)
- s_pScreenPriv->fWindowOrderChanged = TRUE;
-
- if (LOWORD(wParam) != WA_INACTIVE)
- {
- /* Tell our Window Manager thread to activate the window */
- wmMsg.msg = WM_WM_ACTIVATE;
- if (fWMMsgInitialized)
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
- }
- return 0;
-
- case WM_ACTIVATEAPP:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_ACTIVATEAPP\n");
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
-
- case WM_CLOSE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_CLOSE\n");
-#endif
- /* Branch on if the window was killed in X already */
- if (pWinPriv->fXKilled)
- {
- /* Window was killed, go ahead and destroy the window */
- DestroyWindow (hwnd);
- }
- else
- {
- /* Tell our Window Manager thread to kill the window */
- wmMsg.msg = WM_WM_KILL;
- if (fWMMsgInitialized)
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
- }
- return 0;
-
- case WM_DESTROY:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_DESTROY\n");
-#endif
-
- /* Branch on if the window was killed in X already */
- if (pWinPriv && !pWinPriv->fXKilled)
- {
- ErrorF ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n");
-
- /* Tell our Window Manager thread to kill the window */
- wmMsg.msg = WM_WM_KILL;
- if (fWMMsgInitialized)
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_DESTROY\n");
-#endif
- break;
-
- case WM_MOVE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_MOVE - %d ms\n", GetTickCount ());
-#endif
-
- /* Bail if Windows window is not actually moving */
- if (pWinPriv->iX == (short) LOWORD(lParam)
- && pWinPriv->iY == (short) HIWORD(lParam))
- break;
-
- /* Also bail if we're maximizing, we'll do the whole thing in WM_SIZE */
- {
- WINDOWPLACEMENT windPlace;
- windPlace.length = sizeof (WINDOWPLACEMENT);
-
- /* Get current window placement */
- GetWindowPlacement (hwnd, &windPlace);
-
- /* Bail if maximizing */
- if (windPlace.showCmd == SW_MAXIMIZE
- || windPlace.showCmd == SW_SHOWMAXIMIZED)
- break;
- }
-
- /* Get new position */
- pWinPriv->iX = (short) LOWORD(lParam);
- pWinPriv->iY = (short) HIWORD(lParam);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\t(%d, %d)\n", pWinPriv->iX, pWinPriv->iY);
-#endif
-
- winMoveXWindow (pWin,
- (LOWORD(lParam) - wBorderWidth (pWin)
- - GetSystemMetrics (SM_XVIRTUALSCREEN)),
- (HIWORD(lParam) - wBorderWidth (pWin)
- - GetSystemMetrics (SM_YVIRTUALSCREEN)));
- return 0;
-
- case WM_SHOWWINDOW:
- /* Bail out if the window is being hidden */
- if (!wParam)
- return 0;
-
- /* Tell X to map the window */
- MapWindow (pWin, wClient(pWin));
-
- /* */
- if (!pWin->overrideRedirect)
- {
- DWORD dwExStyle;
- DWORD dwStyle;
- RECT rcNew;
- int iDx, iDy;
-
- /* Flag that this window needs to be made active when clicked */
- SetProp (hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1);
-
- /* Get the standard and extended window style information */
- dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
- dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
-
- /* */
- if (dwExStyle != WS_EX_APPWINDOW)
- {
- /* Setup a rectangle with the X window position and size */
- SetRect (&rcNew,
- pWinPriv->iX,
- pWinPriv->iY,
- pWinPriv->iX + pWinPriv->iWidth,
- pWinPriv->iY + pWinPriv->iHeight);
-
-#if 0
- ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
- rcNew.left, rcNew.top,
- rcNew.right, rcNew.bottom);
-#endif
-
- /* */
- AdjustWindowRectEx (&rcNew,
- WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
- FALSE,
- WS_EX_APPWINDOW);
-
- /* Calculate position deltas */
- iDx = pWinPriv->iX - rcNew.left;
- iDy = pWinPriv->iY - rcNew.top;
-
- /* Calculate new rectangle */
- rcNew.left += iDx;
- rcNew.right += iDx;
- rcNew.top += iDy;
- rcNew.bottom += iDy;
-
-#if 0
- ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
- rcNew.left, rcNew.top,
- rcNew.right, rcNew.bottom);
-#endif
-
- /* Set the window extended style flags */
- SetWindowLongPtr (hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
-
- /* Set the window standard style flags */
- SetWindowLongPtr (hwnd, GWL_STYLE,
- WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW);
-
- /* Position the Windows window */
- SetWindowPos (hwnd, HWND_TOP,
- rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
- SWP_NOMOVE | SWP_FRAMECHANGED
- | SWP_SHOWWINDOW | SWP_NOACTIVATE);
-
- /* Bring the Windows window to the foreground */
- SetForegroundWindow (hwnd);
- }
- }
-
- /* Setup the Window Manager message */
- wmMsg.msg = WM_WM_MAP;
- wmMsg.iWidth = pWinPriv->iWidth;
- wmMsg.iHeight = pWinPriv->iHeight;
-
- /* Tell our Window Manager thread to map the window */
- if (fWMMsgInitialized)
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
-
- if (s_pScreenPriv != NULL)
- s_pScreenPriv->fWindowOrderChanged = TRUE;
- return 0;
-
- case WM_SIZING:
- /* Need to legalize the size according to WM_NORMAL_HINTS */
- /* for applications like xterm */
- return ValidateSizing (hwnd, pWin, wParam, lParam);
-
- case WM_WINDOWPOSCHANGED:
- {
- LPWINDOWPOS pwindPos = (LPWINDOWPOS) lParam;
-
- /* Bail if window z order was not changed */
- if (pwindPos->flags & SWP_NOZORDER)
- break;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - hwndInsertAfter: %p\n",
- pwindPos->hwndInsertAfter);
-#endif
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
-
- if (s_pScreenPriv != NULL)
- s_pScreenPriv->fWindowOrderChanged = TRUE;
- }
- return 0;
-
- case WM_SIZE:
- /* see dix/window.c */
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_SIZE - %d ms\n", GetTickCount ());
-#endif
-
- /* Branch on type of resizing occurring */
- switch (wParam)
- {
- case SIZE_MINIMIZED:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\tSIZE_MINIMIZED\n");
-#endif
- if (s_pScreenPriv != NULL)
- s_pScreenPriv->fWindowOrderChanged = TRUE;
- break;
-
- case SIZE_RESTORED:
- case SIZE_MAXIMIZED:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("SIZE_RESTORED || SIZE_MAXIMIZED\n");
-#endif
- /* Break out if nothing to do */
- if (pWinPriv->iWidth == (short) LOWORD(lParam)
- && pWinPriv->iHeight == (short) HIWORD(lParam))
- break;
-
- /* Get the dimensions of the resized Windows window */
- pWinPriv->iWidth = (short) LOWORD(lParam);
- pWinPriv->iHeight = (short) HIWORD(lParam);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("\t(%d, %d)\n", pWinPriv->iWidth, pWinPriv->iHeight);
-#endif
-
- /*
- * If we're maximizing the window has been moved to upper left
- * of current screen. Now it is safe for X to know about this.
- */
- if (wParam == SIZE_MAXIMIZED)
- {
- POINT ptHome;
-
- /* Flag that we are being maximized and store info for restore */
- pWinPriv->fNeedRestore = TRUE;
- pWinPriv->ptRestore.x = pWinPriv->iX;
- pWinPriv->ptRestore.y = pWinPriv->iY;
-
- /* Get screen location of window root */
- ptHome.x = 0;
- ptHome.y = 0;
- ClientToScreen (hwnd, &ptHome);
-
- /* Map from screen (-X,-Y) to (0,0) root coords */
- winMoveXWindow (pWin,
- ptHome.x - wBorderWidth (pWin)
- - GetSystemMetrics (SM_XVIRTUALSCREEN),
- ptHome.y - wBorderWidth (pWin)
- - GetSystemMetrics (SM_YVIRTUALSCREEN));
- }
- else if (wParam == SIZE_RESTORED && pWinPriv->fNeedRestore)
- {
- /* If need restore and !maximized then move to cached position */
- WINDOWPLACEMENT windPlace;
-
- windPlace.length = sizeof (WINDOWPLACEMENT);
-
- GetWindowPlacement (hwnd, &windPlace);
-
- if (windPlace.showCmd != SW_MAXIMIZE
- && windPlace.showCmd != SW_SHOWMAXIMIZED)
- {
- pWinPriv->fNeedRestore = FALSE;
- winMoveXWindow (pWin,
- pWinPriv->ptRestore.x - wBorderWidth (pWin)
- - GetSystemMetrics (SM_XVIRTUALSCREEN),
- pWinPriv->ptRestore.y - wBorderWidth (pWin)
- - GetSystemMetrics (SM_YVIRTUALSCREEN));
- }
- }
-
- /* Perform the resize and notify the X client */
- winResizeXWindow (pWin,
- (short) LOWORD(lParam),
- (short) HIWORD(lParam));
- break;
-
- default:
- break;
- }
- return 0;
-
- case WM_MOUSEACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE\n");
-#endif
-
- /* Check if this window needs to be made active when clicked */
- if (!GetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP))
- {
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE - "
- "MA_NOACTIVATE\n");
-#endif
-
- /* */
- return MA_NOACTIVATE;
- }
- break;
-
- default:
- break;
- }
-
- return DefWindowProc (hwnd, message, wParam, lParam);
-}
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
deleted file mode 100644
index f7d8a4a1a..000000000
--- a/hw/xwin/winnativegdi.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.15 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-Bool
-winAllocateFBNativeGDI (ScreenPtr pScreen)
-{
- FatalError ("winAllocateFBNativeGDI\n");
-
- return TRUE;
-}
-
-/*
- * We wrap whatever CloseScreen procedure was specified by fb;
- * a pointer to said procedure is stored in our privates.
- */
-Bool
-winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- ErrorF ("winCloseScreenNativeGDI - Freeing screen resources\n");
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /*
- * NOTE: mi doesn't use a CloseScreen procedure, so we do not
- * need to call a wrapped procedure here.
- */
-
- /* Delete the window property */
- RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- ErrorF ("winCloseScreenNativeGDI - Destroying window\n");
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon (pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL)
- {
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen)
- {
- DestroyWindow (pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
- /* Invalidate our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Free the screen privates for this screen */
- free (pScreenPriv);
-
- ErrorF ("winCloseScreenNativeGDI - Returning\n");
-
- return TRUE;
-}
-
-
-void
-winShadowUpdateNativeGDI (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- FatalError ("winShadowUpdateNativeGDI\n");
- return;
-}
-
-
-Bool
-winInitVisualsNativeGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set the bitsPerRGB and bit masks */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- pScreenPriv->dwBitsPerRGB = 8;
- pScreenPriv->dwRedMask = 0x00FF0000;
- pScreenPriv->dwGreenMask = 0x0000FF00;
- pScreenPriv->dwBlueMask = 0x000000FF;
- break;
-
- case 16:
- pScreenPriv->dwBitsPerRGB = 6;
- pScreenPriv->dwRedMask = 0xF800;
- pScreenPriv->dwGreenMask = 0x07E0;
- pScreenPriv->dwBlueMask = 0x001F;
- break;
-
- case 15:
- pScreenPriv->dwBitsPerRGB = 5;
- pScreenPriv->dwRedMask = 0x7C00;
- pScreenPriv->dwGreenMask = 0x03E0;
- pScreenPriv->dwBlueMask = 0x001F;
- break;
-
- case 8:
- pScreenPriv->dwBitsPerRGB = 8;
- pScreenPriv->dwRedMask = 0;
- pScreenPriv->dwGreenMask = 0;
- pScreenPriv->dwBlueMask = 0;
- break;
-
- default:
- ErrorF ("winInitVisualsNativeGDI - Unknown screen depth\n");
- return FALSE;
- break;
- }
-
- /* Tell the user how many bits per RGB we are using */
- ErrorF ("winInitVisualsNativeGDI - Using dwBitsPerRGB: %d\n",
- pScreenPriv->dwBitsPerRGB);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- case 16:
- case 15:
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- TrueColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisuals - miSetVisualTypesAndMasks failed\n");
- return FALSE;
- }
- break;
-
- case 8:
- ErrorF ("winInitVisuals - Calling miSetVisualTypesAndMasks\n");
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- StaticColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisuals - miSetVisualTypesAndMasks failed\n");
- return FALSE;
- }
- break;
-
- default:
- ErrorF ("winInitVisualsNativeGDI - Unknown screen depth\n");
- return FALSE;
- }
-
-#if 1
- ErrorF ("winInitVisualsNativeGDI - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/* Adjust the video mode */
-Bool
-winAdjustVideoModeNativeGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = NULL;
- DWORD dwBPP;
-
- hdc = GetDC (NULL);
-
- /* We're in serious trouble if we can't get a DC */
- if (hdc == NULL)
- {
- ErrorF ("winAdjustVideoModeNativeGDI - GetDC () failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
- pScreenInfo->dwDepth = GetDeviceCaps (hdc, PLANES);
-
- switch (pScreenInfo->dwDepth) {
- case 24:
- case 16:
- case 15:
- case 8:
- break;
- default:
- if (dwBPP == 32)
- pScreenInfo->dwDepth = 24;
- else
- pScreenInfo->dwDepth = dwBPP;
- break;
- }
-
- /* GDI cannot change the screen depth */
- if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
- {
- /* No -depth parameter passed, let the user know the depth being used */
- ErrorF ("winAdjustVideoModeNativeGDI - Using Windows display "
- "depth of %d bits per pixel, %d depth\n", dwBPP, pScreenInfo->dwDepth);
-
- /* Use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
- else if (dwBPP != pScreenInfo->dwBPP)
- {
- /* Warn user if GDI depth is different than -depth parameter */
- ErrorF ("winAdjustVideoModeNativeGDI - Command line bpp: %d, "\
- "using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
-
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
-
- return TRUE;
-}
-
-
-Bool
-winActivateAppNativeGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /*
- * Are we active?
- * Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /*
- * Activating, attempt to bring our window
- * to the top of the display
- */
- ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
- }
-
- /*
- * Are we inactive?
- * Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && !pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /*
- * Deactivating, stuff our window onto the
- * task bar.
- */
- ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
- }
-
- return TRUE;
-}
-
-
-HBITMAP
-winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth,
- BYTE **ppbBits, BITMAPINFO **ppbmi)
-{
- BITMAPINFOHEADER *pbmih = NULL;
- HBITMAP hBitmap = NULL;
- BITMAPINFO *pbmi = NULL;
-
- /* Don't create an invalid bitmap */
- if (iWidth == 0
- || iHeight == 0
- || iDepth == 0)
- {
- ErrorF ("\nwinCreateDIBNativeGDI - Invalid specs w %d h %d d %d\n\n",
- iWidth, iHeight, iDepth);
- return NULL;
- }
-
- /* Allocate bitmap info header */
- pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
- + 256 * sizeof (RGBQUAD));
- if (pbmih == NULL)
- {
- ErrorF ("winCreateDIBNativeGDI - malloc () failed\n");
- return FALSE;
- }
- ZeroMemory (pbmih, sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
-
- /* Describe bitmap to be created */
- pbmih->biSize = sizeof (BITMAPINFOHEADER);
- pbmih->biWidth = iWidth;
- pbmih->biHeight = -iHeight;
- pbmih->biPlanes = 1;
- pbmih->biBitCount = iDepth;
- pbmih->biCompression = BI_RGB;
- pbmih->biSizeImage = 0;
- pbmih->biXPelsPerMeter = 0;
- pbmih->biYPelsPerMeter = 0;
- pbmih->biClrUsed = 0;
- pbmih->biClrImportant = 0;
-
- /* Setup color table for mono DIBs */
- if (iDepth == 1)
- {
- pbmi = (BITMAPINFO*) pbmih;
- pbmi->bmiColors[1].rgbBlue = 255;
- pbmi->bmiColors[1].rgbGreen = 255;
- pbmi->bmiColors[1].rgbRed = 255;
- }
-
- /* Create a DIB with a bit pointer */
- hBitmap = CreateDIBSection (NULL,
- (BITMAPINFO *) pbmih,
- DIB_RGB_COLORS,
- (void **) ppbBits,
- NULL,
- 0);
- if (hBitmap == NULL)
- {
- ErrorF ("winCreateDIBNativeGDI - CreateDIBSection () failed\n");
- return NULL;
- }
-
- /* Free the bitmap info header memory */
- if (ppbmi != NULL)
- {
- /* Store the address of the BMIH in the ppbmih parameter */
- *ppbmi = (BITMAPINFO *) pbmih;
- }
- else
- {
- free (pbmih);
- pbmih = NULL;
- }
-
- return hBitmap;
-}
-
-
-Bool
-winBltExposedRegionsNativeGDI (ScreenPtr pScreen)
-{
-
- return TRUE;
-}
-
-
-Bool
-winRedrawScreenNativeGDI (ScreenPtr pScreen)
-{
- FatalError ("winRedrawScreenNativeGDI\n");
- return TRUE;
-}
-
-
-Bool
-winRealizeInstalledPaletteNativeGDI (ScreenPtr pScreen)
-{
- FatalError ("winRealizeInstalledPaletteNativeGDI\n");
- return TRUE;
-}
-
-
-Bool
-winInstallColormapNativeGDI (ColormapPtr pColormap)
-{
- FatalError ("winInstallColormapNativeGDI\n");
- return TRUE;
-}
-
-
-Bool
-winStoreColorsNativeGDI (ColormapPtr pmap,
- int ndef,
- xColorItem *pdefs)
-{
- FatalError ("winStoreColorsNativeGDI\n");
- return TRUE;
-}
-
-
-Bool
-winCreateColormapNativeGDI (ColormapPtr pColormap)
-{
- FatalError ("winCreateColormapNativeGDI\n");
- return TRUE;
-}
-
-
-Bool
-winDestroyColormapNativeGDI (ColormapPtr pColormap)
-{
- FatalError ("winDestroyColormapNativeGDI\n");
- return TRUE;
-}
-
-
-/* Set engine specific funtions */
-Bool
-winSetEngineFunctionsNativeGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBNativeGDI;
- pScreenPriv->pwinShadowUpdate = winShadowUpdateNativeGDI;
- pScreenPriv->pwinCloseScreen = winCloseScreenNativeGDI;
- pScreenPriv->pwinInitVisuals = winInitVisualsNativeGDI;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeNativeGDI;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitNativeGDI;
- /*
- * WARNING: Do not set the BltExposedRegions procedure pointer to anything
- * other than NULL until a working painting procedure is in place.
- * Else, winWindowProc will get stuck in an infinite loop because
- * Windows expects the BeginPaint and EndPaint functions to be called
- * before a WM_PAINT message can be removed from the queue. We are
- * using NULL here as a signal for winWindowProc that it should
- * not signal that the WM_PAINT message has been processed.
- */
- pScreenPriv->pwinBltExposedRegions = NULL;
- pScreenPriv->pwinActivateApp = winActivateAppNativeGDI;
- pScreenPriv->pwinRedrawScreen = winRedrawScreenNativeGDI;
- pScreenPriv->pwinRealizeInstalledPalette =
- winRealizeInstalledPaletteNativeGDI;
- pScreenPriv->pwinInstallColormap = winInstallColormapNativeGDI;
- pScreenPriv->pwinStoreColors = winStoreColorsNativeGDI;
- pScreenPriv->pwinCreateColormap = winCreateColormapNativeGDI;
- pScreenPriv->pwinDestroyColormap = winDestroyColormapNativeGDI;
- pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
-
- return TRUE;
-}
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
deleted file mode 100644
index 7cbdb5e53..000000000
--- a/hw/xwin/winpfbdd.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.18 2003/07/29 21:25:18 dawes Exp $ */
-
-#include "win.h"
-
-
-/*
- * External global variables
- */
-
-extern const GUID _IID_IDirectDraw2;
-
-
-/*
- * Create a DirectDraw primary surface
- */
-
-Bool
-winAllocateFBPrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC ddsd;
- DDSURFACEDESC *pddsdPrimary = NULL;
- DDSURFACEDESC *pddsdOffscreen = NULL;
- RECT rcClient;
-
- ErrorF ("winAllocateFBPrimaryDD\n");
-
- /* Get client area location in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Create a DirectDraw object, store the address at lpdd */
- ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
- if (ddrval != DD_OK)
- FatalError ("winAllocateFBPrimaryDD - Could not start DirectDraw\n");
-
- /* Get a DirectDraw2 interface pointer */
- ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
- &IID_IDirectDraw2,
- (LPVOID*) &pScreenPriv->pdd2);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
- ddrval);
- return FALSE;
- }
-
-
- ErrorF ("winAllocateFBPrimaryDD - Created and initialized DD\n");
-
- /* Are we windowed or fullscreen? */
- if (pScreenInfo->fFullScreen)
- {
- /* Full screen mode */
- ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_FULLSCREEN
- | DDSCL_EXCLUSIVE);
- if (FAILED (ddrval))
- FatalError ("winAllocateFBPrimaryDD - Could not set "
- "cooperative level\n");
-
- /* Change the video mode to the mode requested */
- ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
- pScreenInfo->dwWidth,
- pScreenInfo->dwHeight,
- pScreenInfo->dwBPP,
- pScreenInfo->dwRefreshRate,
- 0);
- if (FAILED (ddrval))
- FatalError ("winAllocateFBPrimaryDD - Could not set "
- "full screen display mode\n");
- }
- else
- {
- /* Windowed mode */
- ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_NORMAL);
- if (FAILED (ddrval))
- FatalError ("winAllocateFBPrimaryDD - Could not set "
- "cooperative level\n");
- }
-
- /* Describe the primary surface */
- ZeroMemory (&ddsd, sizeof (ddsd));
- ddsd.dwSize = sizeof (ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- /* Create the primary surface */
- ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
- &ddsd,
- &pScreenPriv->pddsPrimary,
- NULL);
- if (FAILED (ddrval))
- FatalError ("winAllocateFBPrimaryDD - Could not create primary "
- "surface %08x\n", ddrval);
-
- ErrorF ("winAllocateFBPrimaryDD - Created primary\n");
-
- /* Allocate a DD surface description for our screen privates */
- pddsdPrimary = pScreenPriv->pddsdPrimary
- = malloc (sizeof (DDSURFACEDESC));
- if (pddsdPrimary == NULL)
- FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
- "description memory\n");
- ZeroMemory (pddsdPrimary, sizeof (*pddsdPrimary));
- pddsdPrimary->dwSize = sizeof (*pddsdPrimary);
-
- /* Describe the offscreen surface to be created */
- /*
- * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- * as drawing, locking, and unlocking take forever
- * with video memory surfaces. In addition,
- * video memory is a somewhat scarce resource,
- * so you shouldn't be allocating video memory when
- * you have the option of using system memory instead.
- */
- ZeroMemory (&ddsd, sizeof (ddsd));
- ddsd.dwSize = sizeof (ddsd);
- ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
- ddsd.dwHeight = pScreenInfo->dwHeight;
- ddsd.dwWidth = pScreenInfo->dwWidth;
-
- /* Create the shadow surface */
- ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
- &ddsd,
- &pScreenPriv->pddsOffscreen,
- NULL);
- if (ddrval != DD_OK)
- FatalError ("winAllocateFBPrimaryDD - Could not create shadow "
- "surface\n");
-
- ErrorF ("winAllocateFBPrimaryDD - Created offscreen\n");
-
- /* Allocate a DD surface description for our screen privates */
- pddsdOffscreen = pScreenPriv->pddsdOffscreen
- = malloc (sizeof (DDSURFACEDESC));
- if (pddsdOffscreen == NULL)
- FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
- "description memory\n");
- ZeroMemory (pddsdOffscreen, sizeof (*pddsdOffscreen));
- pddsdOffscreen->dwSize = sizeof (*pddsdOffscreen);
-
- ErrorF ("winAllocateFBPrimaryDD - Locking primary\n");
-
- /* Lock the primary surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
- pScreenInfo->fFullScreen ? NULL:&rcClient,
- pddsdPrimary,
- DDLOCK_WAIT,
- NULL);
- if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL)
- FatalError ("winAllocateFBPrimaryDD - Could not lock "
- "primary surface\n");
-
- ErrorF ("winAllocateFBPrimaryDD - Locked primary\n");
-
- /* We don't know how to deal with anything other than RGB */
- if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB))
- FatalError ("winAllocateFBPrimaryDD - Color format other than RGB\n");
-
- /* Grab the pitch from the surface desc */
- pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8)
- / pScreenInfo->dwBPP;
-
- /* Save the pointer to our surface memory */
- pScreenInfo->pfb = pddsdPrimary->lpSurface;
-
- /* Grab the color depth and masks from the surface description */
- pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask;
- pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask;
- pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask;
-
- ErrorF ("winAllocateFBPrimaryDD - Returning\n");
-
- return TRUE;
-}
-
-
-/*
- * Call the wrapped CloseScreen function.
- *
- * Free our resources and private structures.
- */
-
-Bool
-winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- Bool fReturn;
-
- ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n");
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
-
- /* Delete the window property */
- RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- /* Free the offscreen surface, if there is one */
- if (pScreenPriv->pddsOffscreen)
- {
- IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, NULL);
- IDirectDrawSurface2_Release (pScreenPriv->pddsOffscreen);
- pScreenPriv->pddsOffscreen = NULL;
- }
-
- /* Release the primary surface, if there is one */
- if (pScreenPriv->pddsPrimary)
- {
- IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, NULL);
- IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
- pScreenPriv->pddsPrimary = NULL;
- }
-
- /* Free the DirectDraw object, if there is one */
- if (pScreenPriv->pdd)
- {
- IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd);
- IDirectDraw2_Release (pScreenPriv->pdd);
- pScreenPriv->pdd = NULL;
- }
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon (pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL)
- {
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen)
- {
- DestroyWindow (pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
- /* Kill our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Invalidate the ScreenInfo's fb pointer */
- pScreenInfo->pfb = NULL;
-
- /* Free the screen privates for this screen */
- free ((pointer) pScreenPriv);
-
- return fReturn;
-}
-
-
-/*
- * Tell mi what sort of visuals we need.
- *
- * Generally we only need one visual, as our screen can only
- * handle one format at a time, I believe. You may want
- * to verify that last sentence.
- */
-
-Bool
-winInitVisualsPrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
- /* Count the number of ones in each color mask */
- dwRedBits = winCountBits (pScreenPriv->dwRedMask);
- dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
- dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
-
- /* Store the maximum number of ones in a color mask as the bitsPerRGB */
- if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- ErrorF ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n",
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask,
- pScreenPriv->dwBitsPerRGB);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- case 16:
- case 15:
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- TrueColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsPrimaryDD - "
- "miSetVisualTypesAndMasks failed\n");
- return FALSE;
- }
- break;
-
- case 8:
-#if CYGDEBUG
- ErrorF ("winInitVisuals - Calling miSetVisualTypesAndMasks\n");
-#endif /* CYGDEBUG */
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- PseudoColorMask,
- pScreenPriv->dwBitsPerRGB,
- PseudoColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsPrimaryDD - "
- "miSetVisualTypesAndMasks failed\n");
- return FALSE;
- }
-#if CYGDEBUG
- ErrorF ("winInitVisualsPrimaryDD - Returned from "
- "miSetVisualTypesAndMasks\n");
-#endif /* CYGDEBUG */
- break;
-
- default:
- ErrorF ("winInitVisualsPrimaryDD - Unknown screen depth\n");
- return FALSE;
- }
-
- ErrorF ("winInitVisualsPrimaryDD - Returning\n");
-
- return TRUE;
-}
-
-
-Bool
-winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = NULL;
- DWORD dwBPP;
-
- /* We're in serious trouble if we can't get a DC */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winAdjustVideoModePrimaryDD - GetDC failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* DirectDraw can only change the depth in fullscreen mode */
- if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
- {
- /* No -depth parameter passed, let the user know the depth being used */
- ErrorF ("winAdjustVideoModePrimaryDD - Using Windows display "
- "depth of %d bits per pixel\n", dwBPP);
-
- /* Use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
- else if (pScreenInfo->fFullScreen
- && pScreenInfo->dwBPP != dwBPP)
- {
- /* FullScreen, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModePrimaryDD - FullScreen, using command "
- "line depth: %d\n", pScreenInfo->dwBPP);
- }
- else if (dwBPP != pScreenInfo->dwBPP)
- {
- /* Windowed, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModePrimaryDD - Windowed, command line "
- "depth: %d, using depth: %d\n",
- pScreenInfo->dwBPP, dwBPP);
-
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
-
- return TRUE;
-}
-
-
-/*
- * We need to blit our offscreen fb to
- * the screen when we are activated, and we need to point
- * the fb code back to the primary surface memory.
- */
-
-Bool
-winActivateAppPrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RECT rcSrc, rcClient;
- HRESULT ddrval = DD_OK;
-
- /* Check for errors */
- if (pScreenPriv == NULL
- || pScreenPriv->pddsPrimary == NULL
- || pScreenPriv->pddsOffscreen == NULL)
- return FALSE;
-
- /* Check for do-nothing */
- if (!pScreenPriv->fActive)
- return TRUE;
-
- /* We are activating */
- ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsOffscreen);
- if (ddrval == DD_OK)
- {
- IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen,
- NULL);
- /*
- * We don't check for an error from Unlock, because it
- * doesn't matter if the Unlock failed.
- */
- }
-
- /* Restore both surfaces, just cause I like it that way */
- IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
- IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
-
- /* Get client area in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Setup a source rectangle */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
- &rcClient,
- pScreenPriv->pddsOffscreen,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (ddrval != DD_OK)
- FatalError ("winActivateAppPrimaryDD () - Failed blitting offscreen "
- "surface to primary surface %08x\n", ddrval);
-
- /* Lock the primary surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
- &rcClient,
- pScreenPriv->pddsdPrimary,
- DDLOCK_WAIT,
- NULL);
- if (ddrval != DD_OK
- || pScreenPriv->pddsdPrimary->lpSurface == NULL)
- FatalError ("winActivateAppPrimaryDD () - Could not lock "
- "primary surface\n");
-
- /* Notify FB of the new memory pointer */
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdPrimary->lpSurface);
-
- /*
- * Register the Alt-Tab combo as a hotkey so we can copy
- * the primary framebuffer before the display mode changes
- */
- RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9);
-
- return TRUE;
-}
-
-
-/*
- * Handle the Alt+Tab hotkey.
- *
- * We need to save the primary fb to an offscreen fb when
- * we get deactivated, and point the fb code at the offscreen
- * fb for the duration of the deactivation.
- */
-
-Bool
-winHotKeyAltTabPrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RECT rcClient, rcSrc;
- HRESULT ddrval = DD_OK;
-
- ErrorF ("\nwinHotKeyAltTabPrimaryDD\n\n");
-
- /* Alt+Tab was pressed, we will lose focus very soon */
- pScreenPriv->fActive = FALSE;
-
- /* Check for error conditions */
- if (pScreenPriv->pddsPrimary == NULL
- || pScreenPriv->pddsOffscreen == NULL)
- return FALSE;
-
- /* Get client area in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Did we loose the primary surface? */
- ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsPrimary);
- if (ddrval == DD_OK)
- {
- ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary,
- NULL);
- if (FAILED (ddrval))
- FatalError ("winHotKeyAltTabPrimaryDD - Failed unlocking primary "
- "surface\n");
- }
-
- /* Setup a source rectangle */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Blit the primary surface to the offscreen surface */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
- NULL, /* should be rcDest */
- pScreenPriv->pddsPrimary,
- NULL,
- DDBLT_WAIT,
- NULL);
- if (ddrval == DDERR_SURFACELOST)
- {
- IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
- IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
-
- /* Blit the primary surface to the offscreen surface */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
- NULL,
- pScreenPriv->pddsPrimary,
- NULL,
- DDBLT_WAIT,
- NULL);
- if (FAILED (ddrval))
- FatalError ("winHotKeyAltTabPrimaryDD - Failed blitting primary "
- "surface to offscreen surface: %08x\n",
- ddrval);
- }
- else
- {
- FatalError ("winHotKeyAltTabPrimaryDD - Unknown error from "
- "Blt: %08dx\n", ddrval);
- }
-
- /* Lock the offscreen surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsOffscreen,
- NULL,
- pScreenPriv->pddsdOffscreen,
- DDLOCK_WAIT,
- NULL);
- if (ddrval != DD_OK
- || pScreenPriv->pddsdPrimary->lpSurface == NULL)
- FatalError ("winHotKeyAltTabPrimaryDD - Could not lock "
- "offscreen surface\n");
-
- /* Notify FB of the new memory pointer */
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdOffscreen->lpSurface);
-
- /* Unregister our hotkey */
- UnregisterHotKey (pScreenPriv->hwndScreen, 1);
-
- return TRUE;
-}
-
-
-/* Set engine specific functions */
-Bool
-winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD;
- pScreenPriv->pwinShadowUpdate
- = (winShadowUpdateProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD;
- pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
- pScreenPriv->pwinBltExposedRegions
- = (winBltExposedRegionsProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
- pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD;
-
- return TRUE;
-}
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
deleted file mode 100644
index 43ade059b..000000000
--- a/hw/xwin/winpixmap.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: drewry, september 1986
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.11 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 34 */
-/* See mfb/mfbpixmap.c - mfbCreatePixmap() */
-PixmapPtr
-winCreatePixmapNativeGDI (ScreenPtr pScreen,
- int iWidth, int iHeight,
- int iDepth)
-{
- winPrivPixmapPtr pPixmapPriv = NULL;
- PixmapPtr pPixmap = NULL;
-
- /* Allocate pixmap memory */
- pPixmap = AllocatePixmap (pScreen, 0);
- if (!pPixmap)
- {
- ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n");
- return NullPixmap;
- }
-
-#if CYGDEBUG
- ErrorF ("winCreatePixmap () - w %d h %d d %d bw %d\n",
- iWidth, iHeight, iDepth,
- PixmapBytePad (iWidth, iDepth));
-#endif
-
- /* Setup pixmap values */
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = iDepth;
- pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = iWidth;
- pPixmap->drawable.height = iHeight;
- pPixmap->devKind = 0;
- pPixmap->refcnt = 1;
- pPixmap->devPrivate.ptr = NULL;
-
- /* Pixmap privates are allocated by AllocatePixmap */
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
- /* Initialize pixmap privates */
- pPixmapPriv->hBitmap = NULL;
- pPixmapPriv->hdcSelected = NULL;
- pPixmapPriv->pbBits = NULL;
- pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth);
-
- /* Check for zero width or height pixmaps */
- if (iWidth == 0 || iHeight == 0)
- {
- /* Don't allocate a real pixmap, just set fields and return */
- return pPixmap;
- }
-
- /* Create a DIB for the pixmap */
- pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth,
- &pPixmapPriv->pbBits,
- (BITMAPINFO **) &pPixmapPriv->pbmih);
-
-#if CYGDEBUG
- ErrorF ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
- "screen: %08x\n",
- pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
-#endif
-
- return pPixmap;
-}
-
-
-/*
- * See Porting Layer Definition - p. 35
- *
- * See mfb/mfbpixmap.c - mfbDestroyPixmap()
- */
-
-Bool
-winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
-{
- winPrivPixmapPtr pPixmapPriv = NULL;
-
-#if CYGDEBUG
- ErrorF ("winDestroyPixmapNativeGDI ()\n");
-#endif
-
- /* Bail early if there is not a pixmap to destroy */
- if (pPixmap == NULL)
- {
- ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n");
- return TRUE;
- }
-
- /* Get a handle to the pixmap privates */
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
-#if CYGDEBUG
- ErrorF ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
- pPixmapPriv->hBitmap);
-#endif
-
- /* Decrement reference count, return if nonzero */
- --pPixmap->refcnt;
- if (pPixmap->refcnt != 0)
- return TRUE;
-
- /* Free GDI bitmap */
- if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
-
- /* Free the bitmap info header memory */
- if (pPixmapPriv->pbmih != NULL)
- {
- free (pPixmapPriv->pbmih);
- pPixmapPriv->pbmih = NULL;
- }
-
- /* Free the pixmap memory */
- free (pPixmap);
- pPixmap = NULL;
-
- return TRUE;
-}
-
-
-/*
- * Not used yet
- */
-
-Bool
-winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
- int iWidth, int iHeight,
- int iDepth,
- int iBitsPerPixel,
- int devKind,
- pointer pPixData)
-{
- FatalError ("winModifyPixmapHeaderNativeGDI ()\n");
- return TRUE;
-}
-
-
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-
-void
-winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw)
-{
- ErrorF ("winXRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
-
-
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-void
-winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh)
-{
- ErrorF ("winYRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
-
-
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-
-void
-winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
- int xrot, int yrot)
-{
- ErrorF ("winCopyRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
diff --git a/hw/xwin/winpntwin.c b/hw/xwin/winpntwin.c
deleted file mode 100644
index d28929d67..000000000
--- a/hw/xwin/winpntwin.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpntwin.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 39
- * Sometimes implemented as two functions:
- * PaintWindowBackground (nKind = PW_BACKGROUND)
- * PaintWindowBorder (nKind = PW_BORDER)
- */
-void
-winPaintWindowNativeGDI (WindowPtr pWin,
- RegionPtr pRegion,
- int nKind)
-{
- ErrorF ("winPaintWindow()\n");
-}
diff --git a/hw/xwin/winpolyline.c b/hw/xwin/winpolyline.c
deleted file mode 100644
index 948c34428..000000000
--- a/hw/xwin/winpolyline.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpolyline.c,v 1.4 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 50 */
-void
-winPolyLineNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr ppt)
-{
- switch (pGC->lineStyle)
- {
- case LineSolid:
- if (pGC->lineWidth == 0)
- return miZeroLine (pDrawable, pGC, mode, npt, ppt);
- else
- miWideLine (pDrawable, pGC, mode, npt, ppt);
- break;
- case LineOnOffDash:
- case LineDoubleDash:
- miWideDash (pDrawable, pGC, mode, npt, ppt);
- break;
- }
-}
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
deleted file mode 100644
index 3bea60d3d..000000000
--- a/hw/xwin/winprefs.c
+++ /dev/null
@@ -1,661 +0,0 @@
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winprefs.c,v 1.1 2003/10/02 13:30:11 eich Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/resource.h>
-#include "win.h"
-
-/* Fixups to prevent collisions between Windows and X headers */
-#define ATOM DWORD
-#include <windows.h>
-
-#include "winprefs.h"
-#include "winmultiwindowclass.h"
-
-/* Where will the custom menu commands start counting from? */
-#define STARTMENUID WM_USER
-
-/* From winmultiwindowflex.l, the real parser */
-extern void parse_file (FILE *fp);
-
-/* From winmultiwindowyacc.y, the pref structure loaded by the parser */
-extern WINMULTIWINDOWPREFS pref;
-
-/* The global X default icon */
-extern HICON g_hiconX;
-
-/* Currently in use command ID, incremented each new menu item created */
-static int g_cmdid = STARTMENUID;
-
-
-/* Defined in DIX */
-extern char *display;
-
-/*
- * Creates or appends a menu from a MENUPARSED structure
- */
-static HMENU
-MakeMenu (char *name,
- HMENU editMenu,
- int editItem)
-{
- int i;
- int item;
- MENUPARSED *m;
- HMENU hmenu;
-
- for (i=0; i<pref.menuItems; i++)
- {
- if (!strcmp(name, pref.menu[i].menuName))
- break;
- }
-
- /* Didn't find a match, bummer */
- if (i==pref.menuItems)
- {
- ErrorF("MakeMenu: Can't find menu %s\n", name);
- return NULL;
- }
-
- m = &(pref.menu[i]);
-
- if (editMenu)
- {
- hmenu = editMenu;
- item = editItem;
- }
- else
- {
- hmenu = CreatePopupMenu();
- item = 0;
- }
-
- /* Add the menu items */
- for (i=0; i<m->menuItems; i++)
- {
- /* Only assign IDs one time... */
- if ( m->menuItem[i].commandID == 0 )
- m->menuItem[i].commandID = g_cmdid++;
-
- switch (m->menuItem[i].cmd)
- {
- case CMD_EXEC:
- case CMD_ALWAYSONTOP:
- case CMD_RELOAD:
- InsertMenu (hmenu,
- item,
- MF_BYPOSITION|MF_ENABLED|MF_STRING,
- m->menuItem[i].commandID,
- m->menuItem[i].text);
- break;
-
- case CMD_SEPARATOR:
- InsertMenu (hmenu,
- item,
- MF_BYPOSITION|MF_SEPARATOR,
- 0,
- NULL);
- break;
-
- case CMD_MENU:
- /* Recursive! */
- InsertMenu (hmenu,
- item,
- MF_BYPOSITION|MF_POPUP|MF_ENABLED|MF_STRING,
- (UINT_PTR)MakeMenu (m->menuItem[i].param, 0, 0),
- m->menuItem[i].text);
- break;
- }
-
- /* If item==-1 (means to add at end of menu) don't increment) */
- if (item>=0)
- item++;
- }
-
- return hmenu;
-}
-
-
-/*
- * Callback routine that is executed once per window class.
- * Removes or creates custom window settings depending on LPARAM
- */
-static BOOL CALLBACK
-ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam)
-{
- char szClassName[1024];
- HICON hicon;
-
- if (!GetClassName (hwnd, szClassName, 1024))
- return TRUE;
-
- if (strncmp (szClassName, WINDOW_CLASS_X, strlen (WINDOW_CLASS_X)))
- /* Not one of our windows... */
- return TRUE;
-
- /* It's our baby, either clean or dirty it */
- if (lParam==FALSE)
- {
- hicon = (HICON)GetClassLong(hwnd, GCL_HICON);
-
- /* Unselect any icon in the class structure */
- SetClassLong (hwnd, GCL_HICON, (LONG)LoadIcon (NULL, IDI_APPLICATION));
-
- /* If it's generated on-the-fly, get rid of it, will regen */
- if (!winIconIsOverride((unsigned long)hicon) && hicon!=g_hiconX)
- DestroyIcon (hicon);
-
- /* Remove any menu additions, use bRevert flag */
- GetSystemMenu (hwnd, TRUE);
-
- /* This window is now clean of our taint */
- }
- else
- {
- /* Make the icon default, dynamic, of from xwinrc */
- SetClassLong (hwnd, GCL_HICON, (LONG)g_hiconX);
- winUpdateIcon ((Window)GetProp (hwnd, WIN_WID_PROP));
- /* Update the system menu for this window */
- SetupSysMenu ((unsigned long)hwnd);
-
- /* That was easy... */
- }
-
- return TRUE;
-}
-
-
-/*
- * Removes any custom icons in classes, custom menus, etc.
- * Frees all members in pref structure.
- * Reloads the preferences file.
- * Set custom icons and menus again.
- */
-static void
-ReloadPrefs ()
-{
- int i;
-
- /* First, iterate over all windows replacing their icon with system */
- /* default one and deleting any custom system menus */
- EnumWindows (ReloadEnumWindowsProc, FALSE);
-
- /* Now, free/clear all info from our prefs structure */
- for (i=0; i<pref.menuItems; i++)
- free (pref.menu[i].menuItem);
- free (pref.menu);
- pref.menu = NULL;
- pref.menuItems = 0;
-
- pref.rootMenuName[0] = 0;
-
- free (pref.sysMenu);
- pref.sysMenuItems = 0;
-
- pref.defaultSysMenuName[0] = 0;
- pref.defaultSysMenuPos = 0;
-
- pref.iconDirectory[0] = 0;
- pref.defaultIconName[0] = 0;
-
- for (i=0; i<pref.iconItems; i++)
- if (pref.icon[i].hicon)
- DestroyIcon ((HICON)pref.icon[i].hicon);
- free (pref.icon);
- pref.icon = NULL;
- pref.iconItems = 0;
-
- /* Free global default X icon */
- DestroyIcon (g_hiconX);
-
- /* Reset the custom command IDs */
- g_cmdid = STARTMENUID;
-
- /* Load the updated resource file */
- LoadPreferences();
-
- /* Define global icon, load it */
- g_hiconX = (HICON)winOverrideDefaultIcon();
- if (!g_hiconX)
- g_hiconX = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
-
- /* Rebuild the icons and menus */
- EnumWindows (ReloadEnumWindowsProc, TRUE);
-
- /* Whew, done */
-}
-
-/*
- * Check/uncheck the ALWAYSONTOP items in this menu
- */
-void
-HandleCustomWM_INITMENU(unsigned long hwndIn,
- unsigned long hmenuIn)
-{
- HWND hwnd;
- HMENU hmenu;
- DWORD dwExStyle;
- int i, j;
-
- hwnd = (HWND)hwndIn;
- hmenu = (HMENU)hmenuIn;
- if (!hwnd || !hmenu)
- return;
-
- if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
- dwExStyle = MF_BYCOMMAND | MF_CHECKED;
- else
- dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
-
- for (i=0; i<pref.menuItems; i++)
- for (j=0; j<pref.menu[i].menuItems; j++)
- if (pref.menu[i].menuItem[j].cmd==CMD_ALWAYSONTOP)
- CheckMenuItem (hmenu, pref.menu[i].menuItem[j].commandID, dwExStyle );
-
-}
-
-/*
- * Searches for the custom WM_COMMAND command ID and performs action
- */
-int
-HandleCustomWM_COMMAND (unsigned long hwndIn,
- int command)
-{
- HWND hwnd;
- int i, j;
- MENUPARSED *m;
- DWORD dwExStyle;
-
- hwnd = (HWND)hwndIn;
-
- if (!command)
- return 0;
-
- for (i=0; i<pref.menuItems; i++)
- {
- m = &(pref.menu[i]);
- for (j=0; j<m->menuItems; j++)
- {
- if (command==m->menuItem[j].commandID)
- {
- /* Match! */
- switch(m->menuItem[j].cmd)
- {
- case CMD_EXEC:
- if (fork()==0)
- {
- struct rlimit rl;
- unsigned long i;
-
- /* Close any open descriptors except for STD* */
- getrlimit (RLIMIT_NOFILE, &rl);
- for (i = STDERR_FILENO+1; i < rl.rlim_cur; i++)
- close(i);
-
- /* Disassociate any TTYs */
- setsid();
-
- execl ("/bin/sh",
- "/bin/sh",
- "-c",
- m->menuItem[j].param,
- NULL);
- exit (0);
- }
- else
- return 0;
- break;
-
- case CMD_ALWAYSONTOP:
- if (!hwnd)
- return 0;
-
- /* Get extended window style */
- dwExStyle = GetWindowLong (hwnd, GWL_EXSTYLE);
-
- /* Handle topmost windows */
- if (dwExStyle & WS_EX_TOPMOST)
- SetWindowPos (hwnd,
- HWND_NOTOPMOST,
- 0, 0,
- 0, 0,
- SWP_NOSIZE | SWP_NOMOVE);
- else
- SetWindowPos (hwnd,
- HWND_TOPMOST,
- 0, 0,
- 0, 0,
- SWP_NOSIZE | SWP_NOMOVE);
- return 0;
-
- case CMD_RELOAD:
- ReloadPrefs();
- return 0;
-
- default:
- return 0;
- }
- } /* match */
- } /* for j */
- } /* for i */
-
- return 0;
-}
-
-
-/*
- * Add the default or a custom menu depending on the class match
- */
-void
-SetupSysMenu (unsigned long hwndIn)
-{
- HWND hwnd;
- HMENU sys;
- int i;
- WindowPtr pWin;
- char *res_name, *res_class;
-
- hwnd = (HWND)hwndIn;
- if (!hwnd)
- return;
-
- pWin = GetProp (hwnd, WIN_WINDOW_PROP);
-
- sys = GetSystemMenu (hwnd, FALSE);
- if (!sys)
- return;
-
- if (pWin)
- {
- /* First see if there's a class match... */
- if (winMultiWindowGetClassHint (pWin, &res_name, &res_class))
- {
- for (i=0; i<pref.sysMenuItems; i++)
- {
- if (!strcmp(pref.sysMenu[i].match, res_name) ||
- !strcmp(pref.sysMenu[i].match, res_class) )
- {
- free(res_name);
- free(res_class);
-
- MakeMenu (pref.sysMenu[i].menuName, sys,
- pref.sysMenu[i].menuPos==AT_START?0:-1);
- return;
- }
- }
-
- /* No match, just free alloc'd strings */
- free(res_name);
- free(res_class);
- } /* Found wm_class */
- } /* if pwin */
-
- /* Fallback to system default */
- if (pref.defaultSysMenuName[0])
- {
- if (pref.defaultSysMenuPos==AT_START)
- MakeMenu (pref.defaultSysMenuName, sys, 0);
- else
- MakeMenu (pref.defaultSysMenuName, sys, -1);
- }
-}
-
-
-/*
- * Possibly add a menu to the toolbar icon
- */
-void
-SetupRootMenu (unsigned long hmenuRoot)
-{
- HMENU root;
-
- root = (HMENU)hmenuRoot;
- if (!root)
- return;
-
- if (pref.rootMenuName[0])
- {
- MakeMenu(pref.rootMenuName, root, 0);
- }
-}
-
-
-/*
- * Check for and return an overridden default ICON specified in the prefs
- */
-unsigned long
-winOverrideDefaultIcon()
-{
- HICON hicon;
- char fname[PATH_MAX+NAME_MAX+2];
-
- if (pref.defaultIconName[0])
- {
- /* Make sure we have a dir with trailing backslash */
- /* Note we are using _Windows_ paths here, not cygwin */
- strcpy (fname, pref.iconDirectory);
- if (pref.iconDirectory[0])
- if (fname[strlen(fname)-1]!='\\')
- strcat (fname, "\\");
- strcat (fname, pref.defaultIconName);
-
- hicon = (HICON)LoadImage(NULL,
- fname,
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTSIZE|LR_LOADFROMFILE);
- if (hicon==NULL)
- ErrorF ("winOverrideDefaultIcon: LoadIcon(%s) failed\n", fname);
-
- return (unsigned long)hicon;
- }
-
- return 0;
-}
-
-
-/*
- * Check for a match of the window class to one specified in the
- * ICONS{} section in the prefs file, and load the icon from a file
- */
-unsigned long
-winOverrideIcon (unsigned long longWin)
-{
- WindowPtr pWin = (WindowPtr) longWin;
- char *res_name, *res_class;
- int i;
- HICON hicon;
- char fname[PATH_MAX+NAME_MAX+2];
- char *wmName;
-
- if (pWin==NULL)
- return 0;
-
- /* If we can't find the class, we can't override from default! */
- if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
- return 0;
-
- winMultiWindowGetWMName (pWin, &wmName);
-
- for (i=0; i<pref.iconItems; i++) {
- if (!strcmp(pref.icon[i].match, res_name) ||
- !strcmp(pref.icon[i].match, res_class) ||
- (wmName && strstr(wmName, pref.icon[i].match)))
- {
- free (res_name);
- free (res_class);
- if (wmName)
- free (wmName);
-
- if (pref.icon[i].hicon)
- return pref.icon[i].hicon;
-
- /* Make sure we have a dir with trailing backslash */
- /* Note we are using _Windows_ paths here, not cygwin */
- strcpy (fname, pref.iconDirectory);
- if (pref.iconDirectory[0])
- if (fname[strlen(fname)-1]!='\\')
- strcat (fname, "\\");
- strcat (fname, pref.icon[i].iconFile);
-
- hicon = (HICON)LoadImage(NULL,
- fname,
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTSIZE|LR_LOADFROMFILE);
- if (hicon==NULL)
- ErrorF ("winOverrideIcon: LoadIcon(%s) failed\n", fname);
-
- pref.icon[i].hicon = (unsigned long)hicon;
- return (unsigned long)hicon;
- }
- }
-
- /* Didn't find the icon, fail gracefully */
- free (res_name);
- free (res_class);
- if (wmName)
- free (wmName);
-
- return 0;
-}
-
-
-/*
- * Should we free this icon or leave it in memory (is it part of our
- * ICONS{} overrides)?
- */
-int
-winIconIsOverride(unsigned hiconIn)
-{
- HICON hicon;
- int i;
-
- hicon = (HICON)hiconIn;
-
- if (!hicon)
- return 0;
-
- for (i=0; i<pref.iconItems; i++)
- if ((HICON)pref.icon[i].hicon == hicon)
- return 1;
-
- return 0;
-}
-
-
-
-/*
- * Try and open ~/.XWinrc and /usr/X11R6/lib/X11/system.XWinrc
- * Load it into prefs structure for use by other functions
- */
-void
-LoadPreferences ()
-{
- char *home;
- char fname[PATH_MAX+NAME_MAX+2];
- FILE *prefFile;
- char szDisplay[512];
- char *szEnvDisplay;
- int i, j;
- char param[PARAM_MAX+1];
- char *srcParam, *dstParam;
-
- /* First, clear all preference settings */
- memset (&pref, 0, sizeof(pref));
- prefFile = NULL;
-
- /* Now try and find a ~/.xwinrc file */
- home = getenv ("HOME");
- if (home)
- {
- strcpy (fname, home);
- if (fname[strlen(fname)-1]!='/')
- strcat (fname, "/");
- strcat (fname, ".XWinrc");
-
- prefFile = fopen (fname, "r");
- }
-
- /* No home file found, check system default */
- if (!prefFile)
- prefFile = fopen (PROJECTROOT"/lib/X11/system.XWinrc", "r");
-
- /* If we could open it, then read the settings and close it */
- if (prefFile)
- {
- parse_file (prefFile);
- fclose (prefFile);
- }
-
- /* Setup a DISPLAY environment variable, need to allocate on heap */
- /* because putenv doesn't copy the argument... */
- snprintf (szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display);
- szEnvDisplay = (char *)(malloc (strlen(szDisplay)+1));
- if (szEnvDisplay)
- {
- strcpy (szEnvDisplay, szDisplay);
- putenv (szEnvDisplay);
- }
-
- /* Replace any "%display%" in menu commands with display string */
- snprintf (szDisplay, 512, "127.0.0.1:%s.0", display);
- for (i=0; i<pref.menuItems; i++)
- {
- for (j=0; j<pref.menu[i].menuItems; j++)
- {
- if (pref.menu[i].menuItem[j].cmd==CMD_EXEC)
- {
- srcParam = pref.menu[i].menuItem[j].param;
- dstParam = param;
- while (*srcParam) {
- if (!strncmp(srcParam, "%display%", 9))
- {
- memcpy (dstParam, szDisplay, strlen(szDisplay));
- dstParam += strlen(szDisplay);
- srcParam += 9;
- }
- else
- {
- *dstParam = *srcParam;
- dstParam++;
- srcParam++;
- }
- }
- *dstParam = 0;
- strcpy (pref.menu[i].menuItem[j].param, param);
- } /* cmd==cmd_exec */
- } /* for all menuitems */
- } /* for all menus */
-
-}
-
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
deleted file mode 100644
index ae1cb07d8..000000000
--- a/hw/xwin/winprefs.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winprefs.h,v 1.1 2003/10/02 13:30:11 eich Exp $ */
-
-/* Need to know how long paths can be... */
-#include <limits.h>
-
-#ifndef NAME_MAX
-#define NAME_MAX PATH_MAX
-#endif
-#define MENU_MAX 128 /* Maximum string length of a menu name or item */
-#define PARAM_MAX (4*PATH_MAX) /* Maximim length of a parameter to a MENU */
-
-
-/* Supported commands in a MENU {} statement */
-typedef enum MENUCOMMANDTYPE
-{
- CMD_EXEC, /* /bin/sh -c the parameter */
- CMD_MENU, /* Display a popup menu named param */
- CMD_SEPARATOR, /* Menu separator */
- CMD_ALWAYSONTOP, /* Toggle always-on-top mode */
- CMD_RELOAD /* Reparse the .XWINRC file */
-} MENUCOMMANDTYPE;
-
-/* Where to place a system menu */
-typedef enum MENUPOSITION
-{
- AT_START, /* Place menu at the top of the system menu */
- AT_END /* Put it at the bottom of the menu (default) */
-} MENUPOSITION;
-
-/* Menu item definitions */
-typedef struct MENUITEM
-{
- char text[MENU_MAX+1]; /* To be displayed in menu */
- MENUCOMMANDTYPE cmd; /* What should it do? */
- char param[PARAM_MAX+1]; /* Any parameters? */
- unsigned long commandID; /* Windows WM_COMMAND ID assigned at runtime */
-} MENUITEM;
-
-/* A completely read in menu... */
-typedef struct MENUPARSED
-{
- char menuName[MENU_MAX+1]; /* What's it called in the text? */
- MENUITEM *menuItem; /* Array of items */
- int menuItems; /* How big's the array? */
-} MENUPARSED;
-
-/* To map between a window and a system menu to add for it */
-typedef struct SYSMENUITEM
-{
- char match[MENU_MAX+1]; /* String to look for to apply this sysmenu */
- char menuName[MENU_MAX+1]; /* Which menu to show? Used to set *menu */
- MENUPOSITION menuPos; /* Where to place it (ignored in root) */
-} SYSMENUITEM;
-
-/* To redefine icons for certain window types */
-typedef struct ICONITEM
-{
- char match[MENU_MAX+1]; /* What string to search for? */
- char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */
- unsigned long hicon; /* LoadImage() result */
-} ICONITEM;
-
-typedef struct WINMULTIWINDOWPREFS
-{
- /* Menu information */
- MENUPARSED *menu; /* Array of created menus */
- int menuItems; /* How big? */
-
- /* Taskbar menu settings */
- char rootMenuName[MENU_MAX+1]; /* Menu for taskbar icon */
-
- /* System menu addition menus */
- SYSMENUITEM *sysMenu;
- int sysMenuItems;
-
- /* Which menu to add to unmatched windows? */
- char defaultSysMenuName[MENU_MAX+1];
- MENUPOSITION defaultSysMenuPos; /* Where to place it */
-
- /* Icon information */
- char iconDirectory[PATH_MAX+1]; /* Where do the .icos lie? (Win32 path) */
- char defaultIconName[NAME_MAX+1]; /* Replacement for x.ico */
-
- ICONITEM *icon;
- int iconItems;
-
-} WINMULTIWINDOWPREFS;
-
-
-
-
-/* Functions */
-void
-LoadPreferences();
-
-void
-SetupRootMenu (unsigned long hmenuRoot);
-
-void
-SetupSysMenu (unsigned long hwndIn);
-
-void
-HandleCustomWM_INITMENU(unsigned long hwndIn,
- unsigned long hmenuIn);
-
-int
-HandleCustomWM_COMMAND (unsigned long hwndIn,
- int command);
-
-int
-winIconIsOverride (unsigned hiconIn);
-
-unsigned long
-winOverrideIcon (unsigned long longpWin);
-
-unsigned long
-winOverrideDefaultIcon();
-
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
deleted file mode 100644
index 8eda8e6c2..000000000
--- a/hw/xwin/winprefslex.l
+++ /dev/null
@@ -1,113 +0,0 @@
-%{ # -*- C -*-
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winprefslex.l,v 1.1 2003/10/02 13:30:11 eich Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "winprefsyacc.h"
-
-extern YYSTYPE yylval;
-extern char *yytext;
-extern int yyparse();
-
-extern void ErrorF (const char* /*f*/, ...);
-
-int yylineno;
-
-/* Copy the parsed string, must be free()d in yacc parser */
-static char *makestr(char *str)
-{
- char *ptr;
- ptr = (char*)malloc (strlen(str)+1);
- if (!ptr)
- {
- ErrorF ("winMultiWindowLex:makestr() out of memory\n");
- exit (-1);
- }
- strcpy(ptr, str);
- return ptr;
-}
-
-%}
-
-%option yylineno
-
-%%
-\#.*[\r\n] { /* comment */ return NEWLINE; }
-\/\/.*[\r\n] { /* comment */ return NEWLINE; }
-[\r\n] { return NEWLINE; }
-[ \t]+ { /* ignore whitespace */ }
-[mM][eE][nN][uU] { return MENU; }
-[iI][cC][oO][nN][dD][iI][rR][eE][cC][tT][oO][rR][yY] { return ICONDIRECTORY; }
-[dD][eE][fF][aA][uU][lL][tT][iI][cC][oO][nN] { return DEFAULTICON; }
-[iI][cC][oO][nN][sS] { return ICONS; }
-[rR][oO][oO][tT][mM][eE][nN][uU] { return ROOTMENU; }
-[dD][eE][fF][aA][uU][lL][tT][sS][yY][sS][mM][eE][nN][uU] { return DEFAULTSYSMENU; }
-[sS][yY][sS][mM][eE][nN][uU] { return SYSMENU; }
-[sS][eE][pP][aA][rR][aA][tT][oO][rR] { return SEPARATOR; }
-[aA][tT][sS][tT][aA][rR][tT] { return ATSTART; }
-[aA][tT][eE][nN][dD] { return ATEND; }
-[eE][xX][eE][cC] { return EXEC; }
-[aA][lL][wW][aA][yY][sS][oO][nN][tT][oO][pP] { return ALWAYSONTOP; }
-[dD][eE][bB][uU][gG] { return DEBUG; }
-[rR][eE][lL][oO][aA][dD] { return RELOAD; }
-"{" { return LB; }
-"}" { return RB; }
-"\""[^\"\r\n]+"\"" { yylval.sVal = makestr(yytext+1); \
- yylval.sVal[strlen(yylval.sVal)-1] = 0; \
- return STRING; }
-[^ \t\r\n]+ { yylval.sVal = makestr(yytext); \
- return STRING; }
-%%
-
-/*
- * Run-of-the mill requirement for yacc
- */
-int
-yywrap ()
-{
- return 1;
-}
-
-/*
- * Run a file through the yacc parser
- */
-void
-parse_file (FILE *file)
-{
- if (!file)
- return;
-
- yylineno = 1;
- yyin = file;
- yyparse ();
-}
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
deleted file mode 100644
index a6ffc7207..000000000
--- a/hw/xwin/winprefsyacc.y
+++ /dev/null
@@ -1,334 +0,0 @@
-%{
-/*
- * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * from the XFree86 Project.
- *
- * Authors: Earle F. Philhower, III
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winprefsyacc.y,v 1.1 2003/10/02 13:30:11 eich Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "winprefs.h"
-
-/* The following give better error messages in bison at the cost of a few KB */
-#define YYERROR_VERBOSE 1
-
-/* The global pref settings */
-WINMULTIWINDOWPREFS pref;
-
-/* The working menu */
-static MENUPARSED menu;
-
-/* Functions for parsing the tokens into out structure */
-/* Defined at the end section of this file */
-
-static void SetIconDirectory (char *path);
-static void SetDefaultIcon (char *fname);
-static void SetRootMenu (char *menu);
-static void SetDefaultSysMenu (char *menu, int pos);
-
-static void OpenMenu(char *menuname);
-static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
-static void CloseMenu();
-
-static void OpenIcons();
-static void AddIconLine(char *matchstr, char *iconfile);
-static void CloseIcons();
-
-static void OpenSysMenu();
-static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
-static void CloseSysMenu();
-
-static int yyerror (char *s);
-
-extern void ErrorF (const char* /*f*/, ...);
-extern char *yytext;
-extern int yylex();
-
-%}
-
-%union {
- char *sVal;
- int iVal;
-}
-
-%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS DEFAULTSYSMENU
-%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG
-%token RELOAD
-
-%token <sVal> STRING
-%type <iVal> atspot
-
-%%
-
-input: /* empty */
- | input line
- ;
-
-line: NEWLINE
- | command
- ;
-
-
-newline_or_nada:
- | NEWLINE newline_or_nada
- ;
-
-command: defaulticon
- | icondirectory
- | menu
- | icons
- | sysmenu
- | rootmenu
- | defaultsysmenu
- | debug
- ;
-
-rootmenu: ROOTMENU STRING NEWLINE { SetRootMenu($2); free($2); }
- ;
-
-defaultsysmenu: DEFAULTSYSMENU STRING atspot NEWLINE { SetDefaultSysMenu($2, $3); free($2); }
- ;
-
-defaulticon: DEFAULTICON STRING NEWLINE { SetDefaultIcon($2); free($2); }
- ;
-
-icondirectory: ICONDIRECTORY STRING NEWLINE { SetIconDirectory($2); free($2); }
- ;
-
-menuline: SEPARATOR NEWLINE newline_or_nada { AddMenuLine("-", CMD_SEPARATOR, ""); }
- | STRING ALWAYSONTOP NEWLINE newline_or_nada { AddMenuLine($1, CMD_ALWAYSONTOP, ""); free($1); }
- | STRING EXEC STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_EXEC, $3); free($1); free($3); }
- | STRING MENU STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_MENU, $3); free($1); free($3); }
- | STRING RELOAD NEWLINE newline_or_nada { AddMenuLine($1, CMD_RELOAD, ""); free($1); }
- ;
-
-menulist: menuline
- | menuline menulist
- ;
-
-menu: MENU STRING LB { OpenMenu($2); free($2); } newline_or_nada menulist RB {CloseMenu();}
- ;
-
-iconline: STRING STRING NEWLINE newline_or_nada { AddIconLine($1, $2); free($1); free($2); }
- ;
-
-iconlist: iconline
- | iconline iconlist
- ;
-
-icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();}
- ;
-
-atspot: { $$=AT_END; }
- | ATSTART { $$=AT_START; }
- | ATEND { $$=AT_END; }
- ;
-
-sysmenuline: STRING STRING atspot NEWLINE newline_or_nada { AddSysMenuLine($1, $2, $3); free($1); free($2); }
- ;
-
-sysmenulist: sysmenuline
- | sysmenuline sysmenulist
- ;
-
-sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();}
- ;
-
-debug: DEBUG STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); }
- ;
-
-
-%%
-/*
- * Errors in parsing abort and print log messages
- */
-static int
-yyerror (char *s)
-{
- extern int yylineno; /* Handled by flex internally */
-
- ErrorF("LoadPreferences: %s line %d\n", s, yylineno);
- return 1;
-}
-
-/* Miscellaneous functions to store TOKENs into the structure */
-static void
-SetIconDirectory (char *path)
-{
- strncpy (pref.iconDirectory, path, PATH_MAX);
- pref.iconDirectory[PATH_MAX] = 0;
-}
-
-static void
-SetDefaultIcon (char *fname)
-{
- strncpy (pref.defaultIconName, fname, NAME_MAX);
- pref.defaultIconName[NAME_MAX] = 0;
-}
-
-static void
-SetRootMenu (char *menu)
-{
- strncpy (pref.rootMenuName, menu, MENU_MAX);
- pref.rootMenuName[MENU_MAX] = 0;
-}
-
-static void
-SetDefaultSysMenu (char *menu, int pos)
-{
- strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
- pref.defaultSysMenuName[MENU_MAX] = 0;
- pref.defaultSysMenuPos = pos;
-}
-
-static void
-OpenMenu (char *menuname)
-{
- if (menu.menuItem) free(menu.menuItem);
- menu.menuItem = NULL;
- strncpy(menu.menuName, menuname, MENU_MAX);
- menu.menuName[MENU_MAX] = 0;
- menu.menuItems = 0;
-}
-
-static void
-AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
-{
- if (menu.menuItem==NULL)
- menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
- else
- menu.menuItem = (MENUITEM*)
- realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
-
- strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
- menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
-
- menu.menuItem[menu.menuItems].cmd = cmd;
-
- strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX);
- menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0;
-
- menu.menuItem[menu.menuItems].commandID = 0;
-
- menu.menuItems++;
-}
-
-static void
-CloseMenu ()
-{
- if (menu.menuItem==NULL || menu.menuItems==0)
- {
- ErrorF("LoadPreferences: Empty menu detected\n");
- return;
- }
-
- if (pref.menuItems)
- pref.menu = (MENUPARSED*)
- realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
- else
- pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
-
- memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
- pref.menuItems++;
-
- memset (&menu, 0, sizeof(MENUPARSED));
-}
-
-static void
-OpenIcons ()
-{
- if (pref.icon != NULL) {
- ErrorF("LoadPreferences: Redefining icon mappings\n");
- free(pref.icon);
- pref.icon = NULL;
- }
- pref.iconItems = 0;
-}
-
-static void
-AddIconLine (char *matchstr, char *iconfile)
-{
- if (pref.icon==NULL)
- pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
- else
- pref.icon = (ICONITEM*)
- realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
-
- strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
- pref.icon[pref.iconItems].match[MENU_MAX] = 0;
-
- strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1);
- pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0;
-
- pref.icon[pref.iconItems].hicon = 0;
-
- pref.iconItems++;
-}
-
-static void
-CloseIcons ()
-{
-}
-
-static void
-OpenSysMenu ()
-{
- if (pref.sysMenu != NULL) {
- ErrorF("LoadPreferences: Redefining system menu\n");
- free(pref.sysMenu);
- pref.sysMenu = NULL;
- }
- pref.sysMenuItems = 0;
-}
-
-static void
-AddSysMenuLine (char *matchstr, char *menuname, int pos)
-{
- if (pref.sysMenu==NULL)
- pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
- else
- pref.sysMenu = (SYSMENUITEM*)
- realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
-
- strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
- pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
-
- strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX);
- pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0;
-
- pref.sysMenu[pref.sysMenuItems].menuPos = pos;
-
- pref.sysMenuItems++;
-}
-
-static void
-CloseSysMenu ()
-{
-}
-
diff --git a/hw/xwin/winpushpxl.c b/hw/xwin/winpushpxl.c
deleted file mode 100644
index deb9629d7..000000000
--- a/hw/xwin/winpushpxl.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpushpxl.c,v 1.1 2003/08/07 23:47:58 alanh Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#include "X.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miscstruct.h"
-#include "../mfb/maskbits.h"
-#include "mi.h"
-
-#define NPT 128
-
-/* winPushPixels -- squeegees the fill style of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
-
-WARNING:
- this code works if the 1-bit deep pixmap format returned by GetSpans
-is the same as the format defined by the mfb code (i.e. 32-bit padding
-per scanline, scanline unit = 32 bits; later, this might mean
-bitsizeof(int) padding and sacnline unit == bitsizeof(int).)
-
- */
-
-/*
- * in order to have both (MSB_FIRST and LSB_FIRST) versions of this
- * in the server, we need to rename one of them
- */
-void
-winPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- int h, dxDivPPW, ibEnd;
- MiBits *pwLineStart;
- register MiBits *pw, *pwEnd;
- register MiBits msk;
- register int ib, w;
- register int ipt; /* index into above arrays */
- Bool fInBox;
- DDXPointRec pt[NPT], ptThisLine;
- int width[NPT];
- PixelType startmask;
-
-
- startmask = (MiBits)(-1) ^
- LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
-
- pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx));
- if (!pwLineStart)
- return;
- ipt = 0;
- dxDivPPW = dx/PPW;
-
- for(h = 0, ptThisLine.x = 0, ptThisLine.y = 0;
- h < dy;
- h++, ptThisLine.y++)
- {
-
- (*pBitMap->drawable.pScreen->GetSpans)((DrawablePtr)pBitMap, dx,
- &ptThisLine, &dx, 1, (char *)pwLineStart);
-
- pw = pwLineStart;
- /* Process all words which are fully in the pixmap */
-
- fInBox = FALSE;
- pwEnd = pwLineStart + dxDivPPW;
- while(pw < pwEnd)
- {
- w = *pw;
-#ifdef XFree86Server
- msk = startmask;
-#else
- msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
-#endif
- for(ib = 0; ib < PPW; ib++)
- {
- if(w & msk)
- {
- if(!fInBox)
- {
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC,
- NPT, pt, width, TRUE);
- ipt = 0;
- }
- /* end box */
- fInBox = FALSE;
- }
- }
-#ifdef XFree86Server
- /* This is not quite right, but it'll do for now */
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
-#else
- msk = SCRRIGHT(msk, 1);
-#endif
- }
- pw++;
- }
- ibEnd = dx & PIM;
- if(ibEnd)
- {
- /* Process final partial word on line */
- w = *pw;
-#ifdef XFree86Server
- msk = startmask;
-#else
- msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
-#endif
- for(ib = 0; ib < ibEnd; ib++)
- {
- if(w & msk)
- {
- if(!fInBox)
- {
- /* start new box */
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable,
- pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- fInBox = FALSE;
- }
- }
-#ifdef XFree86Server
- /* This is not quite right, but it'll do for now */
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
-#else
- msk = SCRRIGHT(msk, 1);
-#endif
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox)
- {
- width[ipt] = dx + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- }
- }
- xfree(pwLineStart);
- /* Flush any remaining spans */
- if (ipt)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
- }
-}
diff --git a/hw/xwin/winregistry.c b/hw/xwin/winregistry.c
deleted file mode 100644
index b31fcf641..000000000
--- a/hw/xwin/winregistry.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winregistry.c,v 1.1 2002/07/05 09:19:26 alanh Exp $ */
-
-#include "win.h"
-
-
-DWORD
-winGetRegistryDWORD (HKEY hkey, char *pszRegistryKey)
-{
- HKEY hkResult;
- DWORD dwDisposition;
-
- RegCreateKeyEx (hkey,
- pszRegistryKey,
- 0,
- '\0',
- REG_OPTION_NON_VOLATILE,
- KEY_READ,
- NULL,
- &hkResult,
- &dwDisposition);
-
- if (dwDisposition == REG_CREATED_NEW_KEY)
- {
- ErrorF ("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey);
- }
- else if (dwDisposition == REG_OPENED_EXISTING_KEY)
- {
- ErrorF ("winGetRegistryDWORD - Opened existing key: %s\n",
- pszRegistryKey);
- }
-
- /* Free the registry key handle */
- RegCloseKey (hkResult);
- hkResult = NULL;
-
- return 0;
-}
diff --git a/hw/xwin/winrop.c b/hw/xwin/winrop.c
deleted file mode 100644
index c5ec45de5..000000000
--- a/hw/xwin/winrop.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *Copyright (C) 1994-2002 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winrop.c,v 1.1 2003/08/07 23:47:58 alanh Exp $ */
-
-/*
- * Raster operations used by Windows translated to X's 16 rop codes...
- */
-#include "win.h"
-
-int g_copyROP[16] = { 0xFF0062, /* GXclear - 0 */
- 0x8800C6, /* GXand - S & D */
- 0x440328, /* GXandReverse - S & !D */
- 0xCC0020, /* GXcopy - S */
- 0x220326, /* GXandInverted - !S & D */
- 0xAA0029, /* GXnoop - D */
- 0x660046, /* GXxor - S ^ D */
- 0xEE0086, /* GXor - S | D */
- 0x1100A6, /* GXnor - !S & !D */
- 0x990126, /* GXequiv - !S ^ D */
- 0x550009, /* GXinvert - !D */
- 0xDD0228, /* GXorReverse - S | !D */
- 0x330008, /* GXcopyInverted - !S */
- 0xBB0226, /* GXorInverted - !S | D */
- 0x7700C6, /* GXnand - !S | !D */
- 0x000042 /* GXset - 1 */
-};
-
-int g_patternROP[16] = {0xFF0062, /* GXclear - 0 */
- 0xA000C9, /* GXand - P & D */
- 0xF50225, /* GXandReverse - P & !D */
- 0xF00021, /* GXcopy - P */
- 0x5F00E9, /* GXandInverted - !P & D */
- 0xAA0029, /* GXnoop - D */
- 0xA50065, /* GXxor - P ^ D */
- 0xA000C9, /* GXor - P | D */
- 0x5F00E9, /* GXnor - !P & !D */
- 0x5A0049, /* GXequiv - !P ^ D */
- 0x550009, /* GXinvert - !D */
- 0x500325, /* GXorReverse - P | !D */
- 0x0F0001, /* GXcopyInverted - !P */
- 0x0A0329, /* GXorInverted - !P | D */
- 0x0500A9, /* GXnand - !P | !D */
- 0x000042 /* GXset - 1 */
-};
-
-
-void
-ROP16 (HDC hdc, int rop)
-{
- switch (rop)
- {
- case GXclear:
- SetROP2 (hdc, R2_BLACK);
- break;
-
- case GXand:
- SetROP2 (hdc, R2_MASKPEN);
- break;
-
- case GXandReverse:
- SetROP2 (hdc, R2_MASKPENNOT);
- break;
-
- case GXcopy:
- SetROP2 (hdc, R2_COPYPEN);
- break;
-
- case GXnoop:
- SetROP2 (hdc, R2_NOP);
- break;
-
- case GXxor:
- SetROP2 (hdc, R2_XORPEN);
- break;
-
- case GXor:
- SetROP2 (hdc, R2_MERGEPEN);
- break;
-
- case GXnor:
- SetROP2 (hdc, R2_NOTMERGEPEN);
- break;
-
- case GXequiv:
- SetROP2 (hdc, R2_NOTXORPEN);
- break;
-
- case GXinvert:
- SetROP2 (hdc, R2_NOT);
- break;
-
- case GXorReverse:
- SetROP2 (hdc, R2_MERGEPENNOT);
- break;
-
- case GXcopyInverted:
- SetROP2 (hdc, R2_NOTCOPYPEN);
- break;
-
- case GXorInverted:
- SetROP2 (hdc, R2_MERGENOTPEN);
- break;
-
- case GXnand:
- SetROP2 (hdc, R2_NOTMASKPEN);
- break;
-
- case GXset:
- SetROP2 (hdc, R2_WHITE);
- break;
- }
-}
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
deleted file mode 100644
index 79e985c6b..000000000
--- a/hw/xwin/winscrinit.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- * Kensuke Matsuzaki
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.28 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-
-/*
- * Determine what type of screen we are initializing
- * and call the appropriate procedure to intiailize
- * that type of screen.
- */
-
-Bool
-winScreenInit (int index,
- ScreenPtr pScreen,
- int argc, char **argv)
-{
- winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
- winPrivScreenPtr pScreenPriv;
- HDC hdc;
-
-#if CYGDEBUG
- ErrorF ("winScreenInit - dwWidth: %d dwHeight: %d\n",
- pScreenInfo->dwWidth, pScreenInfo->dwHeight);
-#endif
-
- /* Allocate privates for this screen */
- if (!winAllocatePrivates (pScreen))
- {
- ErrorF ("winScreenInit - Couldn't allocate screen privates\n");
- return FALSE;
- }
-
- /* Get a pointer to the privates structure that was allocated */
- pScreenPriv = winGetScreenPriv (pScreen);
-
- /* Save a pointer to this screen in the screen info structure */
- pScreenInfo->pScreen = pScreen;
-
- /* Save a pointer to the screen info in the screen privates structure */
- /* This allows us to get back to the screen info from a screen pointer */
- pScreenPriv->pScreenInfo = pScreenInfo;
-
- /*
- * Determine which engine to use.
- *
- * NOTE: This is done once per screen because each screen possibly has
- * a preferred engine specified on the command line.
- */
- if (!winSetEngine (pScreen))
- {
- ErrorF ("winScreenInit - winSetEngine () failed\n");
- return FALSE;
- }
-
- /* Adjust the video mode for our engine type */
- if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
- {
- ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
- return FALSE;
- }
-
- /* Check for supported display depth */
- if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1))))
- {
- ErrorF ("winScreenInit - Unsupported display depth: %d\n" \
- "Change your Windows display depth to 15, 16, 24, or 32 bits "
- "per pixel.\n",
- pScreenInfo->dwBPP);
- ErrorF ("winScreenInit - Supported depths: %08x\n",
- WIN_SUPPORTED_BPPS);
-#if WIN_CHECK_DEPTH
- return FALSE;
-#endif
- }
-
- /*
- * Check that all monitors have the same display depth if we are using
- * multiple monitors
- */
- if (pScreenInfo->fMultipleMonitors
- && !GetSystemMetrics (SM_SAMEDISPLAYFORMAT))
- {
- ErrorF ("winScreenInit - Monitors do not all have same pixel format / "
- "display depth.\n"
- "Using primary display only.\n");
- pScreenInfo->fMultipleMonitors = FALSE;
- }
-
- /* Create display window */
- if (!(*pScreenPriv->pwinCreateBoundingWindow) (pScreen))
- {
- ErrorF ("winScreenInit - pwinCreateBoundingWindow () "
- "failed\n");
- return FALSE;
- }
-
- /* Get a device context */
- hdc = GetDC (pScreenPriv->hwndScreen);
-
- /* Store the initial height, width, and depth of the display */
- /* Are we using multiple monitors? */
- if (pScreenInfo->fMultipleMonitors)
- {
- pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
- pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
-
- /*
- * In this case, some of the defaults set in
- * winInitializeDefaultScreens () are not correct ...
- */
- if (!pScreenInfo->fUserGaveHeightAndWidth)
- {
- pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
- pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
- pScreenInfo->dwWidth_mm = (pScreenInfo->dwWidth /
- WIN_DEFAULT_DPI) * 25.4;
- pScreenInfo->dwHeight_mm = (pScreenInfo->dwHeight /
- WIN_DEFAULT_DPI) * 25.4;
- }
- }
- else
- {
- pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
- pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
- }
-
- /* Save the original bits per pixel */
- pScreenPriv->dwLastWindowsBitsPixel = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* Release the device context */
- ReleaseDC (pScreenPriv->hwndScreen, hdc);
-
- /* Clear the visuals list */
- miClearVisualTypes ();
-
- /* Set the padded screen width */
- pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth,
- pScreenInfo->dwBPP);
-
- /* Call the engine dependent screen initialization procedure */
- if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
- {
- ErrorF ("winScreenInit - winFinishScreenInit () failed\n");
- return FALSE;
- }
-
-#if CYGDEBUG || YES
- ErrorF ("winScreenInit - returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 20 */
-Bool
-winFinishScreenInitFB (int index,
- ScreenPtr pScreen,
- int argc, char **argv)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- VisualPtr pVisual = NULL;
- char *pbits = NULL;
- int iReturn;
-
-#if WIN_LAYER_SUPPORT
- pScreenPriv->dwLayerKind = LAYER_SHADOW;
-#endif
-
- /* Create framebuffer */
- if (!(*pScreenPriv->pwinAllocateFB) (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - Could not allocate framebuffer\n");
- return FALSE;
- }
-
- /*
- * Grab the number of bits that are used to represent color in each pixel.
- */
- if (pScreenInfo->dwBPP == 8)
- pScreenInfo->dwDepth = 8;
- else
- pScreenInfo->dwDepth = winCountBits (pScreenPriv->dwRedMask)
- + winCountBits (pScreenPriv->dwGreenMask)
- + winCountBits (pScreenPriv->dwBlueMask);
-
- ErrorF ("winFinishScreenInitFB - Masks: %08x %08x %08x\n",
- pScreenPriv->dwRedMask, pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask);
-
- /* Init visuals */
- if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - winInitVisuals failed\n");
- return FALSE;
- }
-
- /* Setup a local variable to point to the framebuffer */
- pbits = pScreenInfo->pfb;
-
- /* Apparently we need this for the render extension */
- miSetPixmapDepths ();
-
- /* Start fb initialization */
- if (!fbSetupScreen (pScreen,
- pScreenInfo->pfb,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- monitorResolution, monitorResolution,
- pScreenInfo->dwStride,
- pScreenInfo->dwBPP))
- {
- ErrorF ("winFinishScreenInitFB - fbSetupScreen failed\n");
- return FALSE;
- }
-
- /* Override default colormap routines if visual class is dynamic */
- if (pScreenInfo->dwDepth == 8
- && (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
- || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
- && pScreenInfo->fFullScreen)
- || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
- && pScreenInfo->fFullScreen)))
- {
- pScreen->CreateColormap = winCreateColormap;
- pScreen->DestroyColormap = winDestroyColormap;
- pScreen->InstallColormap = winInstallColormap;
- pScreen->UninstallColormap = winUninstallColormap;
- pScreen->ListInstalledColormaps = winListInstalledColormaps;
- pScreen->StoreColors = winStoreColors;
- pScreen->ResolveColor = winResolveColor;
-
- /*
- * NOTE: Setting whitePixel to 255 causes Magic 7.1 to allocate its
- * own colormap, as it cannot allocate 7 planes in the default
- * colormap. Setting whitePixel to 1 allows Magic to get 7
- * planes in the default colormap, so it doesn't create its
- * own colormap. This latter situation is highly desireable,
- * as it keeps the Magic window viewable when switching to
- * other X clients that use the default colormap.
- */
- pScreen->blackPixel = 0;
- pScreen->whitePixel = 1;
- }
-
- /* Place our save screen function */
- pScreen->SaveScreen = winSaveScreen;
-
- /* Backing store functions */
- /*
- * FIXME: Backing store support still doesn't seem to be working.
- */
- pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas;
-
- /* Finish fb initialization */
- if (!fbFinishScreenInit (pScreen,
- pScreenInfo->pfb,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- monitorResolution, monitorResolution,
- pScreenInfo->dwStride,
- pScreenInfo->dwBPP))
- {
- ErrorF ("winFinishScreenInitFB - fbFinishScreenInit failed\n");
- return FALSE;
- }
-
- /* Save a pointer to the root visual */
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++);
- pScreenPriv->pRootVisual = pVisual;
-
- /*
- * Setup points to the block and wakeup handlers. Pass a pointer
- * to the current screen as pWakeupdata.
- */
- pScreen->BlockHandler = winBlockHandler;
- pScreen->WakeupHandler = winWakeupHandler;
- pScreen->blockData = pScreen;
- pScreen->wakeupData = pScreen;
-
-#ifdef RENDER
- /* Render extension initialization, calls miPictureInit */
- if (!fbPictureInit (pScreen, NULL, 0))
- {
- ErrorF ("winFinishScreenInitFB - fbPictureInit () failed\n");
- return FALSE;
- }
-#endif
-
-#if WIN_LAYER_SUPPORT
- /* KDrive does LayerStartInit right after fbPictureInit */
- if (!LayerStartInit (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - LayerStartInit () failed\n");
- return FALSE;
- }
-
- /* Not sure what we're adding to shadow, but add it anyway */
- if (!shadowAdd (pScreen, 0, pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
- {
- ErrorF ("winFinishScreenInitFB - shadowAdd () failed\n");
- return FALSE;
- }
-
- /* KDrive does LayerFinishInit right after LayerStartInit */
- if (!LayerFinishInit (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - LayerFinishInit () failed\n");
- return FALSE;
- }
-
- /* KDrive does LayerCreate right after LayerFinishInit */
- pScreenPriv->pLayer = winLayerCreate (pScreen);
- if (!pScreenPriv->pLayer)
- {
- ErrorF ("winFinishScreenInitFB - winLayerCreate () failed\n");
- return FALSE;
- }
-
- /* KDrive does RandRInit right after LayerCreate */
-#ifdef RANDR
- if (pScreenInfo->dwDepth != 8 && !winRandRInit (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - winRandRInit () failed\n");
- return FALSE;
- }
-#endif
-#endif
-
- /*
- * Backing store support should reduce network traffic and increase
- * performance.
- */
- miInitializeBackingStore (pScreen);
-
- /* KDrive does miDCInitialize right after miInitializeBackingStore */
- /* Setup the cursor routines */
-#if CYGDEBUG
- ErrorF ("winFinishScreenInitFB - Calling miDCInitialize ()\n");
-#endif
- miDCInitialize (pScreen, &g_winPointerCursorFuncs);
-
- /* KDrive does winCreateDefColormap right after miDCInitialize */
- /* Create a default colormap */
-#if CYGDEBUG
- ErrorF ("winFinishScreenInitFB - Calling winCreateDefColormap ()\n");
-#endif
- if (!winCreateDefColormap (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - Could not create colormap\n");
- return FALSE;
- }
-
-#if !WIN_LAYER_SUPPORT
- /* Initialize the shadow framebuffer layer */
- if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
- || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
- || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
- {
-#if CYGDEBUG
- ErrorF ("winFinishScreenInitFB - Calling shadowInit ()\n");
-#endif
- if (!shadowInit (pScreen,
- pScreenPriv->pwinShadowUpdate,
- NULL))
- {
- ErrorF ("winFinishScreenInitFB - shadowInit () failed\n");
- return FALSE;
- }
- }
-#endif
-
-
- /* Handle pseudo-rootless mode */
- if (pScreenInfo->fRootless)
- {
- /* Define the WRAP macro temporarily for local use */
-#define WRAP(a) \
- if (pScreen->a) { \
- pScreenPriv->a = pScreen->a; \
- } else { \
- ErrorF("null screen fn " #a "\n"); \
- pScreenPriv->a = NULL; \
- }
-
- /* Save a pointer to each lower-level window procedure */
- WRAP(CreateWindow);
- WRAP(DestroyWindow);
- WRAP(RealizeWindow);
- WRAP(UnrealizeWindow);
- WRAP(PositionWindow);
- WRAP(ChangeWindowAttributes);
-#ifdef SHAPE
- WRAP(SetShape);
-#endif
-
- /* Assign pseudo-rootless window procedures to be top level procedures */
- pScreen->CreateWindow = winCreateWindowPRootless;
- pScreen->DestroyWindow = winDestroyWindowPRootless;
- pScreen->PositionWindow = winPositionWindowPRootless;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesPRootless;
- pScreen->RealizeWindow = winMapWindowPRootless;
- pScreen->UnrealizeWindow = winUnmapWindowPRootless;
-#ifdef SHAPE
- pScreen->SetShape = winSetShapePRootless;
-#endif
-
- /* Undefine the WRAP macro, as it is not needed elsewhere */
-#undef WRAP
- }
- /* Handle multi window mode */
- else if (pScreenInfo->fMultiWindow)
- {
- /* Define the WRAP macro temporarily for local use */
-#define WRAP(a) \
- if (pScreen->a) { \
- pScreenPriv->a = pScreen->a; \
- } else { \
- ErrorF("null screen fn " #a "\n"); \
- pScreenPriv->a = NULL; \
- }
-
- /* Save a pointer to each lower-level window procedure */
- WRAP(CreateWindow);
- WRAP(DestroyWindow);
- WRAP(RealizeWindow);
- WRAP(UnrealizeWindow);
- WRAP(PositionWindow);
- WRAP(ChangeWindowAttributes);
- WRAP(ReparentWindow);
- WRAP(RestackWindow);
-#ifdef SHAPE
- WRAP(SetShape);
-#endif
-
- /* Assign multi-window window procedures to be top level procedures */
- pScreen->CreateWindow = winCreateWindowMultiWindow;
- pScreen->DestroyWindow = winDestroyWindowMultiWindow;
- pScreen->PositionWindow = winPositionWindowMultiWindow;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;
- pScreen->RealizeWindow = winMapWindowMultiWindow;
- pScreen->UnrealizeWindow = winUnmapWindowMultiWindow;
- pScreen->ReparentWindow = winReparentWindowMultiWindow;
- pScreen->RestackWindow = winRestackWindowMultiWindow;
-#ifdef SHAPE
- pScreen->SetShape = winSetShapeMultiWindow;
-#endif
-
- /* Undefine the WRAP macro, as it is not needed elsewhere */
-#undef WRAP
- }
-
- /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
-
- /* Create a mutex for modules in seperate threads to wait for */
- iReturn = pthread_mutex_init (&pScreenPriv->pmServerStarted, NULL);
- if (iReturn != 0)
- {
- ErrorF ("winFinishScreenInitFB - pthread_mutex_init () failed: %d\n",
- iReturn);
- return FALSE;
- }
-
- /* Own the mutex for modules in seperate threads */
- iReturn = pthread_mutex_lock (&pScreenPriv->pmServerStarted);
- if (iReturn != 0)
- {
- ErrorF ("winFinishScreenInitFB - pthread_mutex_lock () failed: %d\n",
- iReturn);
- return FALSE;
- }
-
- /* Set the ServerStarted flag to false */
- pScreenPriv->fServerStarted = FALSE;
-
- /* Set the WindowOrderChanged flag to false */
- pScreenPriv->fWindowOrderChanged = FALSE;
-
- pScreenPriv->fRestacking = FALSE;
-
-#if CYGDEBUG || YES
- if (pScreenInfo->fMultiWindow)
- ErrorF ("winFinishScreenInitFB - Calling winInitWM.\n");
-#endif
-
- /* Initialize multi window mode */
- if (pScreenInfo->fMultiWindow
- && !winInitWM (&pScreenPriv->pWMInfo,
- &pScreenPriv->ptWMProc,
- &pScreenPriv->ptXMsgProc,
- &pScreenPriv->pmServerStarted,
- pScreenInfo->dwScreen))
- {
- ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
- return FALSE;
- }
-
-#if CYGDEBUG || YES
- if (pScreenInfo->fClipboard)
- ErrorF ("winFinishScreenInitFB - Calling winInitClipboard.\n");
-#endif
-
- /* Initialize the clipboard manager */
- if (pScreenInfo->fClipboard
- && !winInitClipboard (&pScreenPriv->ptClipboardProc,
- &pScreenPriv->pmServerStarted,
- pScreenInfo->dwScreen))
- {
- ErrorF ("winFinishScreenInitFB - winClipboardInit () failed.\n");
- return FALSE;
- }
-
- /* Tell the server that we are enabled */
- pScreenPriv->fEnabled = TRUE;
-
- /* Tell the server that we have a valid depth */
- pScreenPriv->fBadDepth = FALSE;
-
-#if CYGDEBUG || YES
- ErrorF ("winFinishScreenInitFB - returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- *
- *
- *
- *
- * TEST CODE BELOW - NOT USED IN NORMAL COMPILATION
- *
- *
- *
- *
- *
- */
-
-
-/* See Porting Layer Definition - p. 20 */
-
-Bool
-winFinishScreenInitNativeGDI (int index,
- ScreenPtr pScreen,
- int argc, char **argv)
-{
- winScreenPriv(pScreen);
- winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
- VisualPtr pVisuals = NULL;
- DepthPtr pDepths = NULL;
- VisualID rootVisual = 0;
- int nVisuals = 0, nDepths = 0, nRootDepth = 0;
-
- /* Ignore user input (mouse, keyboard) */
- pScreenInfo->fIgnoreInput = FALSE;
-
- /* Get device contexts for the screen and shadow bitmap */
- pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
- if (pScreenPriv->hdcScreen == NULL)
- FatalError ("winFinishScreenInitNativeGDI - Couldn't get a DC\n");
-
- /* Init visuals */
- if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
- {
- ErrorF ("winFinishScreenInitNativeGDI - pwinInitVisuals failed\n");
- return FALSE;
- }
-
- /* Initialize the mi visuals */
- if (!miInitVisuals (&pVisuals, &pDepths, &nVisuals, &nDepths, &nRootDepth,
- &rootVisual,
- ((unsigned long)1 << (pScreenInfo->dwDepth - 1)), 8,
- TrueColor))
- {
- ErrorF ("winFinishScreenInitNativeGDI - miInitVisuals () failed\n");
- return FALSE;
- }
-
- /* Initialize the CloseScreen procedure pointer */
- pScreen->CloseScreen = NULL;
-
- /* Initialize the mi code */
- if (!miScreenInit (pScreen,
- NULL, /* No framebuffer */
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- monitorResolution, monitorResolution,
- pScreenInfo->dwStride,
- nRootDepth, nDepths, pDepths, rootVisual,
- nVisuals, pVisuals))
- {
- ErrorF ("winFinishScreenInitNativeGDI - miScreenInit failed\n");
- return FALSE;
- }
-
- pScreen->defColormap = FakeClientID(0);
-
- /*
- * Register our block and wakeup handlers; these procedures
- * process messages in our Windows message queue; specifically,
- * they process mouse and keyboard input.
- */
- pScreen->BlockHandler = winBlockHandler;
- pScreen->WakeupHandler = winWakeupHandler;
- pScreen->blockData = pScreen;
- pScreen->wakeupData = pScreen;
-
- /* Place our save screen function */
- pScreen->SaveScreen = winSaveScreen;
-
- /* Pixmaps */
- pScreen->CreatePixmap = winCreatePixmapNativeGDI;
- pScreen->DestroyPixmap = winDestroyPixmapNativeGDI;
-
- /* Other Screen Routines */
- pScreen->QueryBestSize = winQueryBestSizeNativeGDI;
- pScreen->SaveScreen = winSaveScreen;
- pScreen->GetImage = miGetImage;
- pScreen->GetSpans = winGetSpansNativeGDI;
-
- /* Window Procedures */
- pScreen->CreateWindow = winCreateWindowNativeGDI;
- pScreen->DestroyWindow = winDestroyWindowNativeGDI;
- pScreen->PositionWindow = winPositionWindowNativeGDI;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;
- pScreen->RealizeWindow = winMapWindowNativeGDI;
- pScreen->UnrealizeWindow = winUnmapWindowNativeGDI;
-
- /* Paint window */
- pScreen->PaintWindowBackground = miPaintWindow;
- pScreen->PaintWindowBorder = miPaintWindow;
- pScreen->CopyWindow = winCopyWindowNativeGDI;
-
- /* Fonts */
- pScreen->RealizeFont = winRealizeFontNativeGDI;
- pScreen->UnrealizeFont = winUnrealizeFontNativeGDI;
-
- /* GC */
- pScreen->CreateGC = winCreateGCNativeGDI;
-
- /* Colormap Routines */
- pScreen->CreateColormap = miInitializeColormap;
- pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)()) NoopDDA;
- pScreen->InstallColormap = miInstallColormap;
- pScreen->UninstallColormap = miUninstallColormap;
- pScreen->ListInstalledColormaps = miListInstalledColormaps;
- pScreen->StoreColors = (StoreColorsProcPtr) (void (*)()) NoopDDA;
- pScreen->ResolveColor = miResolveColor;
-
- /* Bitmap */
- pScreen->BitmapToRegion = winPixmapToRegionNativeGDI;
-
- ErrorF ("winFinishScreenInitNativeGDI - calling miDCInitialize\n");
-
- /* Set the default white and black pixel positions */
- pScreen->whitePixel = pScreen->blackPixel = (Pixel) 0;
-
- /* Initialize the cursor */
- if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs))
- {
- ErrorF ("winFinishScreenInitNativeGDI - miDCInitialize failed\n");
- return FALSE;
- }
-
- /* Create a default colormap */
- if (!miCreateDefColormap (pScreen))
- {
- ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
- "failed\n");
- return FALSE;
- }
-
- ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
- "returned\n");
-
- /* mi doesn't use a CloseScreen procedure, so no need to wrap */
- pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
-
- /* Tell the server that we are enabled */
- pScreenPriv->fEnabled = TRUE;
-
- ErrorF ("winFinishScreenInitNativeGDI - Successful addition of "
- "screen %08x\n",
- pScreen);
-
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 33 */
-Bool
-winSaveScreen (ScreenPtr pScreen, int on)
-{
- return TRUE;
-}
-
-
-PixmapPtr
-winGetWindowPixmap (WindowPtr pwin)
-{
- ErrorF ("winGetWindowPixmap ()\n");
- return NULL;
-}
-
-
-void
-winSetWindowPixmap (WindowPtr pwin, PixmapPtr pPix)
-{
- ErrorF ("winSetWindowPixmap ()\n");
-}
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
deleted file mode 100644
index c0340e47b..000000000
--- a/hw/xwin/winsetsp.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- * Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.8 2003/08/07 23:47:58 alanh Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 55 */
-void
-winSetSpansNativeGDI (DrawablePtr pDrawable,
- GCPtr pGC,
- char *pSrcs,
- DDXPointPtr pPoints,
- int *piWidths,
- int iSpans,
- int fSorted)
-{
- winGCPriv(pGC);
- PixmapPtr pPixmap = NULL;
- winPrivPixmapPtr pPixmapPriv = NULL;
- HBITMAP hbmpOrig = NULL;
- BITMAPINFO bmi;
- HRGN hrgn = NULL, combined = NULL;
- int nbox;
- BoxPtr pbox;
-
- nbox = REGION_NUM_RECTS (pGC->pCompositeClip);
- pbox = REGION_RECTS (pGC->pCompositeClip);
-
- if (!nbox) return;
-
- combined = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
- nbox--; pbox++;
- while (nbox--)
- {
- hrgn = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
- CombineRgn (combined, combined, hrgn, RGN_OR);
- DeleteObject (hrgn);
- hrgn = NULL;
- pbox++;
- }
-
- /* Branch on the drawable type */
- switch (pDrawable->type)
- {
- case DRAWABLE_PIXMAP:
-
- SelectClipRgn (pGCPriv->hdcMem, combined);
- DeleteObject (combined);
- combined = NULL;
-
- pPixmap = (PixmapPtr) pDrawable;
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
- /* Select the drawable pixmap into a DC */
- hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
- if (hbmpOrig == NULL)
- FatalError ("winSetSpans - DRAWABLE_PIXMAP - SelectObject () "
- "failed on pPixmapPriv->hBitmap\n");
-
- while (iSpans--)
- {
- ZeroMemory (&bmi, sizeof (BITMAPINFO));
- bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = *piWidths;
- bmi.bmiHeader.biHeight = 1;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = pDrawable->depth;
- bmi.bmiHeader.biCompression = BI_RGB;
-
- /* Setup color table for mono DIBs */
- if (pDrawable->depth == 1)
- {
- bmi.bmiColors[1].rgbBlue = 255;
- bmi.bmiColors[1].rgbGreen = 255;
- bmi.bmiColors[1].rgbRed = 255;
- }
-
- StretchDIBits (pGCPriv->hdcMem,
- pPoints->x, pPoints->y,
- *piWidths, 1,
- 0, 0,
- *piWidths, 1,
- pSrcs,
- (BITMAPINFO *) &bmi,
- DIB_RGB_COLORS,
- g_copyROP[pGC->alu]);
-
- pSrcs += PixmapBytePad (*piWidths, pDrawable->depth);
- pPoints++;
- piWidths++;
- }
-
- /* Reset the clip region */
- SelectClipRgn (pGCPriv->hdcMem, NULL);
-
- /* Push the drawable pixmap out of the GC HDC */
- SelectObject (pGCPriv->hdcMem, hbmpOrig);
- break;
-
- case DRAWABLE_WINDOW:
-
- SelectClipRgn (pGCPriv->hdc, combined);
- DeleteObject (combined);
- combined = NULL;
-
- while (iSpans--)
- {
- ZeroMemory (&bmi, sizeof (BITMAPINFO));
- bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = *piWidths;
- bmi.bmiHeader.biHeight = 1;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = pDrawable->depth;
- bmi.bmiHeader.biCompression = BI_RGB;
-
- /* Setup color table for mono DIBs */
- if (pDrawable->depth == 1)
- {
- bmi.bmiColors[1].rgbBlue = 255;
- bmi.bmiColors[1].rgbGreen = 255;
- bmi.bmiColors[1].rgbRed = 255;
- }
-
- StretchDIBits (pGCPriv->hdc,
- pPoints->x, pPoints->y,
- *piWidths, 1,
- 0, 0,
- *piWidths, 1,
- pSrcs,
- (BITMAPINFO *) &bmi,
- DIB_RGB_COLORS,
- g_copyROP[pGC->alu]);
-
- pSrcs += PixmapBytePad (*piWidths, pDrawable->depth);
- pPoints++;
- piWidths++;
- }
-
- /* Reset the clip region */
- SelectClipRgn (pGCPriv->hdc, NULL);
- break;
-
- case UNDRAWABLE_WINDOW:
- FatalError ("\nwinSetSpansNativeGDI - UNDRAWABLE_WINDOW\n\n");
- break;
-
- case DRAWABLE_BUFFER:
- FatalError ("\nwinSetSpansNativeGDI - DRAWABLE_BUFFER\n\n");
- break;
-
- default:
- FatalError ("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
- break;
- }
-}
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
deleted file mode 100644
index a409c27c6..000000000
--- a/hw/xwin/winshaddd.c
+++ /dev/null
@@ -1,1373 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.24 2003/07/29 21:25:18 dawes Exp $ */
-
-#include "win.h"
-
-/*
- * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
- * so we have to redefine it here.
- */
-#ifdef DEFINE_GUID
-#undef DEFINE_GUID
-#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif /* DEFINE_GUID */
-
-
-/*
- * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
- * here manually. Should be handled by ddraw.h
- */
-#ifndef IID_IDirectDraw2
-DEFINE_GUID( IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
-#endif /* IID_IDirectDraw2 */
-
-
-/*
- * Create the primary surface and attach the clipper.
- * Used for both the initial surface creation and during
- * WM_DISPLAYCHANGE messages.
- */
-
-Bool
-winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC ddsd;
-
- /* Describe the primary surface */
- ZeroMemory (&ddsd, sizeof (ddsd));
- ddsd.dwSize = sizeof (ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- /* Create the primary surface */
- ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
- &ddsd,
- &pScreenPriv->pddsPrimary,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreatePrimarySurfaceShadowDD - Could not create primary "
- "surface: %08x\n", ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winCreatePrimarySurfaceShadowDD - Created primary surface\n");
-#endif
-
- /*
- * Attach a clipper to the primary surface that will clip our blits to our
- * display window.
- */
- ddrval = IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
- pScreenPriv->pddcPrimary);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreatePrimarySurfaceShadowDD - Primary attach clipper "
- "failed: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winCreatePrimarySurfaceShadowDD - Attached clipper to "
- "primary surface\n");
-#endif
-
- /* Everything was correct */
- return TRUE;
-}
-
-
-/*
- * Detach the clipper and release the primary surface.
- * Called from WM_DISPLAYCHANGE.
- */
-
-Bool
-winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- ErrorF ("winReleasePrimarySurfaceShadowDD - Hello\n");
-
- /* Release the primary surface and clipper, if they exist */
- if (pScreenPriv->pddsPrimary)
- {
- /*
- * Detach the clipper from the primary surface.
- * NOTE: We do this explicity for clarity. The Clipper is not released.
- */
- IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
- NULL);
-
- ErrorF ("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
-
- /* Release the primary surface */
- IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
- pScreenPriv->pddsPrimary = NULL;
- }
-
- ErrorF ("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
-
- return TRUE;
-}
-
-
-/*
- * Create a DirectDraw surface for the shadow framebuffer; also create
- * a primary surface object so we can blit to the display.
- *
- * Install a DirectDraw clipper on our primary surface object
- * that clips our blits to the unobscured client area of our display window.
- */
-
-Bool
-winAllocateFBShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC ddsd;
- DDSURFACEDESC *pddsdShadow = NULL;
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD\n");
-#endif
-
- /* Create a clipper */
- ddrval = (*g_fpDirectDrawCreateClipper) (0,
- &pScreenPriv->pddcPrimary,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not create clipper: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Created a clipper\n");
-#endif
-
- /* Get a device context for the screen */
- pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
-
- /* Attach the clipper to our display window */
- ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
- 0,
- pScreenPriv->hwndScreen);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Clipper not attached to "
- "window: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Attached clipper to window\n");
-#endif
-
- /* Create a DirectDraw object, store the address at lpdd */
- ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not start DirectDraw: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD () - Created and initialized DD\n");
-#endif
-
- /* Get a DirectDraw2 interface pointer */
- ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
- &IID_IDirectDraw2,
- (LPVOID*) &pScreenPriv->pdd2);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
- ddrval);
- return FALSE;
- }
-
- /* Are we full screen? */
- if (pScreenInfo->fFullScreen)
- {
- DDSURFACEDESC ddsdCurrent;
- DWORD dwRefreshRateCurrent = 0;
- HDC hdc = NULL;
-
- /* Set the cooperative level to full screen */
- ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_EXCLUSIVE
- | DDSCL_FULLSCREEN);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not set "
- "cooperative level: %08x\n",
- ddrval);
- return FALSE;
- }
-
- /*
- * We only need to get the current refresh rate for comparison
- * if a refresh rate has been passed on the command line.
- */
- if (pScreenInfo->dwRefreshRate != 0)
- {
- ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
- ddsdCurrent.dwSize = sizeof (ddsdCurrent);
-
- /* Get information about current display settings */
- ddrval = IDirectDraw2_GetDisplayMode (pScreenPriv->pdd2,
- &ddsdCurrent);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not get current "
- "refresh rate: %08x. Continuing.\n",
- ddrval);
- dwRefreshRateCurrent = 0;
- }
- else
- {
- /* Grab the current refresh rate */
- dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
- }
- }
-
- /* Clean up the refresh rate */
- if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
- {
- /*
- * Refresh rate is non-specified or equal to current.
- */
- pScreenInfo->dwRefreshRate = 0;
- }
-
- /* Grab a device context for the screen */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winAllocateFBShadowDD - GetDC () failed\n");
- return FALSE;
- }
-
- /* Only change the video mode when different than current mode */
- if (!pScreenInfo->fMultipleMonitors
- && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
- || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
- || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
- || pScreenInfo->dwRefreshRate != 0))
- {
- ErrorF ("winAllocateFBShadowDD - Changing video mode\n");
-
- /* Change the video mode to the mode requested */
- ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
- pScreenInfo->dwWidth,
- pScreenInfo->dwHeight,
- pScreenInfo->dwBPP,
- pScreenInfo->dwRefreshRate,
- 0);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not set "\
- "full screen display mode: %08x\n",
- ddrval);
- return FALSE;
- }
- }
- else
- {
- ErrorF ("winAllocateFBShadowDD - Not changing video mode\n");
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
- hdc = NULL;
- }
- else
- {
- /* Set the cooperative level for windowed mode */
- ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_NORMAL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not set "\
- "cooperative level: %08x\n",
- ddrval);
- return FALSE;
- }
- }
-
- /* Create the primary surface */
- if (!winCreatePrimarySurfaceShadowDD (pScreen))
- {
- ErrorF ("winAllocateFBShadowDD - winCreatePrimarySurfaceShadowDD "
- "failed\n");
- return FALSE;
- }
-
- /* Describe the shadow surface to be created */
- /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- * as drawing, locking, and unlocking take forever
- * with video memory surfaces. In addition,
- * video memory is a somewhat scarce resource,
- * so you shouldn't be allocating video memory when
- * you have the option of using system memory instead.
- */
- ZeroMemory (&ddsd, sizeof (ddsd));
- ddsd.dwSize = sizeof (ddsd);
- ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
- ddsd.dwHeight = pScreenInfo->dwHeight;
- ddsd.dwWidth = pScreenInfo->dwWidth;
-
- /* Create the shadow surface */
- ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
- &ddsd,
- &pScreenPriv->pddsShadow,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDD - Could not create shadow "\
- "surface: %08x\n", ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Created shadow\n");
-#endif
-
- /* Allocate a DD surface description for our screen privates */
- pddsdShadow = pScreenPriv->pddsdShadow = malloc (sizeof (DDSURFACEDESC));
- if (pddsdShadow == NULL)
- {
- ErrorF ("winAllocateFBShadowDD - Could not allocate surface "\
- "description memory\n");
- return FALSE;
- }
- ZeroMemory (pddsdShadow, sizeof (*pddsdShadow));
- pddsdShadow->dwSize = sizeof (*pddsdShadow);
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Locking shadow\n");
-#endif
-
- /* Lock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
- NULL,
- pddsdShadow,
- DDLOCK_WAIT,
- NULL);
- if (FAILED (ddrval) || pddsdShadow->lpSurface == NULL)
- {
- ErrorF ("winAllocateFBShadowDD - Could not lock shadow "\
- "surface: %08x\n", ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Locked shadow\n");
-#endif
-
- /* We don't know how to deal with anything other than RGB */
- if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB))
- {
- ErrorF ("winAllocateFBShadowDD - Color format other than RGB\n");
- return FALSE;
- }
-
- /* Grab the pitch from the surface desc */
- pScreenInfo->dwStride = (pddsdShadow->u1.lPitch * 8)
- / pScreenInfo->dwBPP;
-
- /* Save the pointer to our surface memory */
- pScreenInfo->pfb = pddsdShadow->lpSurface;
-
- /* Grab the color depth and masks from the surface description */
- pScreenPriv->dwRedMask = pddsdShadow->ddpfPixelFormat.u2.dwRBitMask;
- pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask;
- pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask;
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDD - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Transfer the damaged regions of the shadow framebuffer to the display.
- */
-
-void
-winShadowUpdateDD (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
- HRESULT ddrval = DD_OK;
- RECT rcDest, rcSrc;
- POINT ptOrigin;
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
-
- /*
- * Return immediately if the app is not active
- * and we are fullscreen, or if we have a bad display depth
- */
- if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
- || pScreenPriv->fBadDepth) return;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
-
- /* Unlock the shadow surface, so we can blit */
- ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winShadowUpdateProcDD - Unlock failed\n");
- return;
- }
-
- /*
- * Handle small regions with multiple blits,
- * handle large regions by creating a clipping region and
- * doing a single blit constrained to that clipping region.
- */
- if (pScreenInfo->dwClipUpdatesNBoxes == 0
- || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
- {
- /* Loop through all boxes in the damaged region */
- while (dwBox--)
- {
- /* Assign damage box to source rectangle */
- rcSrc.left = pBox->x1;
- rcSrc.top = pBox->y1;
- rcSrc.right = pBox->x2;
- rcSrc.bottom = pBox->y2;
-
- /* Calculate destination rectange */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Blit the damaged areas */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
-
- /* Get a pointer to the next box */
- ++pBox;
- }
- }
- else
- {
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
-
- /* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--)
- {
- hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject (hrgnTemp);
- pBox++;
- }
-
- /* Install the GDI region as a clipping region */
- SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
- DeleteObject (hrgnCombined);
- hrgnCombined = NULL;
-
- /* Calculating a bounding box for the source is easy */
- rcSrc.left = pBoxExtents->x1;
- rcSrc.top = pBoxExtents->y1;
- rcSrc.right = pBoxExtents->x2;
- rcSrc.bottom = pBoxExtents->y2;
-
- /* Calculating a bounding box for the destination is trickier */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
-
- /* Reset the clip region */
- SelectClipRgn (pScreenPriv->hdcScreen, NULL);
- }
-
- /* Relock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winShadowUpdateProcDD - Lock failed\n");
- return;
- }
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- {
- ErrorF ("winShadowUpdateProcDD - Memory location of the shadow "
- "surface has changed, trying to update the root window "
- "pixmap header to point to the new address. If you get "
- "this message and Cygwin/XFree86 freezes or crashes "
- "after this message then send a problem report and your "
- "/tmp/XWin.log file to cygwin-xfree@cygwin.com\n");
-
- /* Location of shadow framebuffer has changed */
- pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
-
- /* Update the screen pixmap */
- if (!(*pScreen->ModifyPixmapHeader)(pScreen->devPrivate,
- pScreen->width,
- pScreen->height,
- pScreen->rootDepth,
- BitsPerPixel (pScreen->rootDepth),
- PixmapBytePad (pScreenInfo->dwStride,
- pScreenInfo->dwBPP),
- pScreenInfo->pfb))
- {
- ErrorF ("winShadowUpdateProcDD - Bits changed, could not "
- "notify fb.\n");
- return;
- }
- }
-}
-
-
-/*
- * Call the wrapped CloseScreen function.
- *
- * Free our resources and private structures.
- */
-
-Bool
-winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- Bool fReturn;
-
-#if CYGDEBUG
- ErrorF ("winCloseScreenShadowDD - Freeing screen resources\n");
-#endif
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
-
- /* Free the screen DC */
- ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
-
- /* Delete the window property */
- RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- /* Free the shadow surface, if there is one */
- if (pScreenPriv->pddsShadow)
- {
- IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
- IDirectDrawSurface2_Release (pScreenPriv->pddsShadow);
- pScreenPriv->pddsShadow = NULL;
- }
-
- /* Detach the clipper from the primary surface and release the clipper. */
- if (pScreenPriv->pddcPrimary)
- {
- /* Detach the clipper */
- IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
- NULL);
-
- /* Release the clipper object */
- IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
- pScreenPriv->pddcPrimary = NULL;
- }
-
- /* Release the primary surface, if there is one */
- if (pScreenPriv->pddsPrimary)
- {
- IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
- pScreenPriv->pddsPrimary = NULL;
- }
-
- /* Free the DirectDraw2 object, if there is one */
- if (pScreenPriv->pdd2)
- {
- IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2);
- IDirectDraw2_Release (pScreenPriv->pdd2);
- pScreenPriv->pdd2 = NULL;
- }
-
- /* Free the DirectDraw object, if there is one */
- if (pScreenPriv->pdd)
- {
- IDirectDraw_Release (pScreenPriv->pdd);
- pScreenPriv->pdd = NULL;
- }
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon (pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL)
- {
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen)
- {
- DestroyWindow (pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
- /* Destroy the thread startup mutex */
- pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
-
- /* Kill our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Invalidate the ScreenInfo's fb pointer */
- pScreenInfo->pfb = NULL;
-
- /* Free the screen privates for this screen */
- free ((pointer) pScreenPriv);
-
- return fReturn;
-}
-
-
-/*
- * Tell mi what sort of visuals we need.
- *
- * Generally we only need one visual, as our screen can only
- * handle one format at a time, I believe. You may want
- * to verify that last sentence.
- */
-
-Bool
-winInitVisualsShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
- /* Count the number of ones in each color mask */
- dwRedBits = winCountBits (pScreenPriv->dwRedMask);
- dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
- dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
-
- /* Store the maximum number of ones in a color mask as the bitsPerRGB */
- if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
- pScreenPriv->dwBitsPerRGB = 8;
- else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- ErrorF ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->dwDepth,
- pScreenInfo->dwBPP);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- case 16:
- case 15:
-#if defined(XFree86Server)
- /* Create the real visual */
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- TrueColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!miSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- -1,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#else /* XFree86Server */
- /* Create the real visual */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!fbSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#endif /* XFree86Server */
- break;
-
- case 8:
-#if defined(XFree86Server)
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- pScreenInfo->fFullScreen
- ? PseudoColorMask : StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->fFullScreen
- ? PseudoColor : StaticColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#else /* XFree86Server */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- pScreenInfo->fFullScreen
- ? PseudoColorMask : StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#endif /* XFree86Server */
- break;
-
- default:
- ErrorF ("winInitVisualsShadowDD - Unknown screen depth\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winInitVisualsShadowDD - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Adjust the user proposed video mode
- */
-
-Bool
-winAdjustVideoModeShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = NULL;
- DWORD dwBPP;
-
- /* We're in serious trouble if we can't get a DC */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winAdjustVideoModeShadowDD - GetDC () failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* DirectDraw can only change the depth in fullscreen mode */
- if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
- {
- /* No -depth parameter passed, let the user know the depth being used */
- ErrorF ("winAdjustVideoModeShadowDD - Using Windows display "
- "depth of %d bits per pixel\n", dwBPP);
-
- /* Use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
- else if (pScreenInfo->fFullScreen
- && pScreenInfo->dwBPP != dwBPP)
- {
- /* FullScreen, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModeShadowDD - FullScreen, using command line "
- "bpp: %d\n", pScreenInfo->dwBPP);
- }
- else if (dwBPP != pScreenInfo->dwBPP)
- {
- /* Windowed, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModeShadowDD - Windowed, command line bpp: "
- "%d, using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
-
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* See if the shadow bitmap will be larger than the DIB size limit */
- if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
- >= WIN_DIB_MAXIMUM_SIZE)
- {
- ErrorF ("winAdjustVideoModeShadowDD - Requested DirectDraw surface "
- "will be larger than %d MB. The surface may fail to be "
- "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
- "DIB size. This limit does not apply to Windows NT/2000, and "
- "this message may be ignored on those platforms.\n",
- WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
- return TRUE;
-}
-
-
-/*
- * Blt exposed regions to the screen
- */
-
-Bool
-winBltExposedRegionsShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
- HDC hdcUpdate = NULL;
- PAINTSTRUCT ps;
- HRESULT ddrval = DD_OK;
- Bool fReturn = TRUE;
- Bool fLocked = TRUE;
- int i;
-
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
- if (hdcUpdate == NULL)
- {
- ErrorF ("winBltExposedRegionsShadowDD - BeginPaint () returned "
- "a NULL device context handle. Aborting blit attempt.\n");
- return FALSE;
- }
-
- /* Unlock the shadow surface, so we can blit */
- ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
- if (FAILED (ddrval))
- {
- fReturn = FALSE;
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else
- {
- /* Flag that we have unlocked the shadow surface */
- fLocked = FALSE;
- }
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
-
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be enter shadow surface, as Blt should clip */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Try to regain the primary surface and blit again if we've lost it */
- for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i)
- {
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (ddrval == DDERR_SURFACELOST)
- {
- /* Surface was lost */
- ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
- "reported that the primary surface was lost, "
- "trying to restore, retry: %d\n", i + 1);
-
- /* Try to restore the surface, once */
- ddrval = IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
- ErrorF ("winBltExposedRegionsShadowDDNL - "
- "IDirectDrawSurface2_Restore returned: ");
- if (ddrval == DD_OK)
- continue;
- else if (ddrval == DDERR_WRONGMODE)
- ErrorF ("DDERR_WRONGMODE\n");
- else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
- ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
- else if (ddrval == DDERR_UNSUPPORTED)
- ErrorF ("DDERR_UNSUPPORTED\n");
- else if (ddrval == DDERR_INVALIDPARAMS)
- ErrorF ("DDERR_INVALIDPARAMS\n");
- else if (ddrval == DDERR_INVALIDOBJECT)
- ErrorF ("DDERR_INVALIDOBJECT\n");
- else
- ErrorF ("unknown error: %08x\n", ddrval);
-
- /* Loop around to try the blit one more time */
- continue;
- }
- else if (FAILED (ddrval))
- {
- fReturn = FALSE;
- ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
- "failed, but surface not lost: %08x %d\n", ddrval, ddrval);
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else
- {
- /* Success, stop looping */
- break;
- }
- }
-
- /* Relock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT,
- NULL);
- if (FAILED (ddrval))
- {
- fReturn = FALSE;
- ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Lock "
- "failed\n");
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else
- {
- /* Indicate that we have relocked the shadow surface */
- fLocked = TRUE;
- }
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdShadow->lpSurface);
-
- winBltExposedRegionsShadowDD_Exit:
- /* EndPaint frees the DC */
- if (hdcUpdate != NULL)
- EndPaint (pScreenPriv->hwndScreen, &ps);
-
- /*
- * Relock the surface if it is not locked. We don't care if locking fails,
- * as it will cause the server to shutdown within a few more operations.
- */
- if (!fLocked)
- {
- IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT,
- NULL);
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdShadow->lpSurface);
-
- fLocked = TRUE;
- }
- return fReturn;
-}
-
-
-/*
- * Do any engine-specific appliation-activation processing
- */
-
-Bool
-winActivateAppShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- /*
- * Do we have a surface?
- * Are we active?
- * Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary != NULL
- && pScreenPriv->fActive)
- {
- /* Primary surface was lost, restore it */
- IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
- }
-
- return TRUE;
-}
-
-
-/*
- * Reblit the shadow framebuffer to the screen.
- */
-
-Bool
-winRedrawScreenShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be entire shadow surface, as Blt should clip for us */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Redraw the whole window, to take account for the new colors */
- ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () "
- "failed: %08x\n",
- ddrval);
- }
-
- return TRUE;
-}
-
-
-/*
- * Realize the currently installed colormap
- */
-
-Bool
-winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-
-/*
- * Install the specified colormap
- */
-
-Bool
-winInstallColormapShadowDD (ColormapPtr pColormap)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /* Install the DirectDraw palette on the primary surface */
- ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
- pCmapPriv->lpDDPalette);
- if (FAILED (ddrval))
- {
- ErrorF ("winInstallColormapShadowDD - Failed installing the "
- "DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-
- return TRUE;
-}
-
-
-/*
- * Store the specified colors in the specified colormap
- */
-
-Bool
-winStoreColorsShadowDD (ColormapPtr pColormap,
- int ndef,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
- HRESULT ddrval = DD_OK;
-
- /* Put the X colormap entries into the Windows logical palette */
- ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
- 0,
- pdefs[0].pixel,
- ndef,
- pCmapPriv->peColors
- + pdefs[0].pixel);
- if (FAILED (ddrval))
- {
- ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed\n");
- return FALSE;
- }
-
- /* Don't install the DirectDraw palette if the colormap is not installed */
- if (pColormap != curpmap)
- {
- return TRUE;
- }
-
- if (!winInstallColormapShadowDD (pColormap))
- {
- ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Colormap initialization procedure
- */
-
-Bool
-winCreateColormapShadowDD (ColormapPtr pColormap)
-{
- HRESULT ddrval = DD_OK;
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
-
- /* Create a DirectDraw palette */
- ddrval = IDirectDraw2_CreatePalette (pScreenPriv->pdd,
- DDPCAPS_8BIT | DDPCAPS_ALLOW256,
- pCmapPriv->peColors,
- &pCmapPriv->lpDDPalette,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Colormap destruction procedure
- */
-
-Bool
-winDestroyColormapShadowDD (ColormapPtr pColormap)
-{
- winScreenPriv(pColormap->pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /*
- * Is colormap to be destroyed the default?
- *
- * Non-default colormaps should have had winUninstallColormap
- * called on them before we get here. The default colormap
- * will not have had winUninstallColormap called on it. Thus,
- * we need to handle the default colormap in a special way.
- */
- if (pColormap->flags & IsDefault)
- {
-#if CYGDEBUG
- ErrorF ("winDestroyColormapShadowDDNL - Destroying default "
- "colormap\n");
-#endif
-
- /*
- * FIXME: Walk the list of all screens, popping the default
- * palette out of each screen device context.
- */
-
- /* Pop the palette out of the primary surface */
- ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
- "default colormap DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Clear our private installed colormap pointer */
- pScreenPriv->pcmapInstalled = NULL;
- }
-
- /* Release the palette */
- IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
-
- /* Invalidate the colormap privates */
- pCmapPriv->lpDDPalette = NULL;
-
- return TRUE;
-}
-
-
-/*
- * Set engine specific functions
- */
-
-Bool
-winSetEngineFunctionsShadowDD (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD;
- pScreenPriv->pwinShadowUpdate = winShadowUpdateDD;
- pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD;
- pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
- pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD;
- pScreenPriv->pwinActivateApp = winActivateAppShadowDD;
- pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDD;
- pScreenPriv->pwinRealizeInstalledPalette
- = winRealizeInstalledPaletteShadowDD;
- pScreenPriv->pwinInstallColormap = winInstallColormapShadowDD;
- pScreenPriv->pwinStoreColors = winStoreColorsShadowDD;
- pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD;
- pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD;
- pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD;
- pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD;
-
- return TRUE;
-}
-
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
deleted file mode 100644
index e902f31b0..000000000
--- a/hw/xwin/winshadddnl.c
+++ /dev/null
@@ -1,1316 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.26 2003/10/02 13:30:11 eich Exp $ */
-
-#include "win.h"
-
-/*
- * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
- * so we have to redefine it here.
- */
-#ifdef DEFINE_GUID
-#undef DEFINE_GUID
-#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif /* DEFINE_GUID */
-
-/*
- * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
- * here manually. Should be handled by ddraw.h
- */
-#ifndef IID_IDirectDraw4
-DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
-#endif /* IID_IDirectDraw4 */
-
-#define FAIL_MSG_MAX_BLT 10
-
-
-/*
- * Create the primary surface and attach the clipper.
- * Used for both the initial surface creation and during
- * WM_DISPLAYCHANGE messages.
- */
-
-Bool
-winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC2 ddsd;
-
- ErrorF ("winCreatePrimarySurfaceShadowDDNL - Creating primary surface\n");
-
- /* Describe the primary surface */
- ZeroMemory (&ddsd, sizeof (ddsd));
- ddsd.dwSize = sizeof (ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- /* Create the primary surface */
- ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
- &ddsd,
- &pScreenPriv->pddsPrimary4,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create primary "
- "surface: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if 1
- ErrorF ("winCreatePrimarySurfaceShadowDDNL - Created primary surface\n");
-#endif
-
- /* Attach our clipper to our primary surface handle */
- ddrval = IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
- pScreenPriv->pddcPrimary);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreatePrimarySurfaceShadowDDNL - Primary attach clipper "
- "failed: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if 1
- ErrorF ("winCreatePrimarySurfaceShadowDDNL - Attached clipper to primary "
- "surface\n");
-#endif
-
- /* Everything was correct */
- return TRUE;
-}
-
-
-/*
- * Detach the clipper and release the primary surface.
- * Called from WM_DISPLAYCHANGE.
- */
-
-Bool
-winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- ErrorF ("winReleasePrimarySurfaceShadowDDNL - Hello\n");
-
- /* Release the primary surface and clipper, if they exist */
- if (pScreenPriv->pddsPrimary4)
- {
- /*
- * Detach the clipper from the primary surface.
- * NOTE: We do this explicity for clarity. The Clipper is not released.
- */
- IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
- NULL);
-
- ErrorF ("winReleasePrimarySurfaceShadowDDNL - Detached clipper\n");
-
- /* Release the primary surface */
- IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
- pScreenPriv->pddsPrimary4 = NULL;
- }
-
- ErrorF ("winReleasePrimarySurfaceShadowDDNL - Released primary surface\n");
-
- return TRUE;
-}
-
-
-/*
- * Create a DirectDraw surface for the shadow framebuffer; also create
- * a primary surface object so we can blit to the display.
- *
- * Install a DirectDraw clipper on our primary surface object
- * that clips our blits to the unobscured client area of our display window.
- */
-
-Bool
-winAllocateFBShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC2 ddsdShadow;
- char *lpSurface = NULL;
- DDPIXELFORMAT ddpfPrimary;
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - w %d h %d d %d\n",
- pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth);
-#endif
-
- /* Allocate memory for our shadow surface */
- lpSurface = malloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
- if (lpSurface == NULL)
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not allocate bits\n");
- return FALSE;
- }
-
- /*
- * Initialize the framebuffer memory so we don't get a
- * strange display at startup
- */
- ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
-
- /* Create a clipper */
- ddrval = (*g_fpDirectDrawCreateClipper) (0,
- &pScreenPriv->pddcPrimary,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not attach clipper: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - Created a clipper\n");
-#endif
-
- /* Get a device context for the screen */
- pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
-
- /* Attach the clipper to our display window */
- ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
- 0,
- pScreenPriv->hwndScreen);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Clipper not attached "
- "to window: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - Attached clipper to window\n");
-#endif
-
- /* Create a DirectDraw object, store the address at lpdd */
- ddrval = (*g_fpDirectDrawCreate) (NULL,
- (LPDIRECTDRAW*) &pScreenPriv->pdd,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not start "
- "DirectDraw: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - Created and initialized DD\n");
-#endif
-
- /* Get a DirectDraw4 interface pointer */
- ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
- &IID_IDirectDraw4,
- (LPVOID*) &pScreenPriv->pdd4);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Failed DD4 query: %08x\n",
- ddrval);
- return FALSE;
- }
-
- /* Are we full screen? */
- if (pScreenInfo->fFullScreen)
- {
- DDSURFACEDESC2 ddsdCurrent;
- DWORD dwRefreshRateCurrent = 0;
- HDC hdc = NULL;
-
- /* Set the cooperative level to full screen */
- ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
- pScreenPriv->hwndScreen,
- DDSCL_EXCLUSIVE
- | DDSCL_FULLSCREEN);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not set "
- "cooperative level: %08x\n",
- ddrval);
- return FALSE;
- }
-
- /*
- * We only need to get the current refresh rate for comparison
- * if a refresh rate has been passed on the command line.
- */
- if (pScreenInfo->dwRefreshRate != 0)
- {
- ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
- ddsdCurrent.dwSize = sizeof (ddsdCurrent);
-
- /* Get information about current display settings */
- ddrval = IDirectDraw4_GetDisplayMode (pScreenPriv->pdd4,
- &ddsdCurrent);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not get current "
- "refresh rate: %08x. Continuing.\n",
- ddrval);
- dwRefreshRateCurrent = 0;
- }
- else
- {
- /* Grab the current refresh rate */
- dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
- }
- }
-
- /* Clean up the refresh rate */
- if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
- {
- /*
- * Refresh rate is non-specified or equal to current.
- */
- pScreenInfo->dwRefreshRate = 0;
- }
-
- /* Grab a device context for the screen */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winAllocateFBShadowDDNL - GetDC () failed\n");
- return FALSE;
- }
-
- /* Only change the video mode when different than current mode */
- if (!pScreenInfo->fMultipleMonitors
- && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
- || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
- || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
- || pScreenInfo->dwRefreshRate != 0))
- {
- ErrorF ("winAllocateFBShadowDDNL - Changing video mode\n");
-
- /* Change the video mode to the mode requested */
- ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
- pScreenInfo->dwWidth,
- pScreenInfo->dwHeight,
- pScreenInfo->dwBPP,
- pScreenInfo->dwRefreshRate,
- 0);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not set "
- "full screen display mode: %08x\n",
- ddrval);
- return FALSE;
- }
- }
- else
- {
- ErrorF ("winAllocateFBShadowDDNL - Not changing video mode\n");
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
- hdc = NULL;
- }
- else
- {
- /* Set the cooperative level for windowed mode */
- ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
- pScreenPriv->hwndScreen,
- DDSCL_NORMAL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not set "
- "cooperative level: %08x\n",
- ddrval);
- return FALSE;
- }
- }
-
- /* Create the primary surface */
- if (!winCreatePrimarySurfaceShadowDDNL (pScreen))
- {
- ErrorF ("winAllocateFBShadowDDNL - winCreatePrimarySurfaceShadowDDNL "
- "failed\n");
- return FALSE;
- }
-
- /* Get primary surface's pixel format */
- ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary));
- ddpfPrimary.dwSize = sizeof (ddpfPrimary);
- ddrval = IDirectDrawSurface4_GetPixelFormat (pScreenPriv->pddsPrimary4,
- &ddpfPrimary);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not get primary "
- "pixformat: %08x\n",
- ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x "
- "dwRGBBitCount: %d\n",
- ddpfPrimary.u2.dwRBitMask,
- ddpfPrimary.u3.dwGBitMask,
- ddpfPrimary.u4.dwBBitMask,
- ddpfPrimary.u1.dwRGBBitCount);
-#endif
-
- /* Describe the shadow surface to be created */
- /*
- * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- * as drawing, locking, and unlocking take forever
- * with video memory surfaces. In addition,
- * video memory is a somewhat scarce resource,
- * so you shouldn't be allocating video memory when
- * you have the option of using system memory instead.
- */
- ZeroMemory (&ddsdShadow, sizeof (ddsdShadow));
- ddsdShadow.dwSize = sizeof (ddsdShadow);
- ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH
- | DDSD_LPSURFACE | DDSD_PITCH | DDSD_PIXELFORMAT;
- ddsdShadow.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
- ddsdShadow.dwHeight = pScreenInfo->dwHeight;
- ddsdShadow.dwWidth = pScreenInfo->dwWidth;
- ddsdShadow.u1.lPitch = pScreenInfo->dwPaddedWidth;
- ddsdShadow.lpSurface = lpSurface;
- ddsdShadow.u4.ddpfPixelFormat = ddpfPrimary;
-
- ErrorF ("winAllocateFBShadowDDNL - lPitch: %d\n",
- pScreenInfo->dwPaddedWidth);
-
- /* Create the shadow surface */
- ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
- &ddsdShadow,
- &pScreenPriv->pddsShadow4,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winAllocateFBShadowDDNL - Could not create shadow "
- "surface: %08x\n", ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG || YES
- ErrorF ("winAllocateFBShadowDDNL - Created shadow pitch: %d\n",
- ddsdShadow.u1.lPitch);
-#endif
-
- /* Grab the pitch from the surface desc */
- pScreenInfo->dwStride = (ddsdShadow.u1.lPitch * 8)
- / pScreenInfo->dwBPP;
-
-#if CYGDEBUG || YES
- ErrorF ("winAllocateFBShadowDDNL - Created shadow stride: %d\n",
- pScreenInfo->dwStride);
-#endif
-
- /* Save the pointer to our surface memory */
- pScreenInfo->pfb = lpSurface;
-
- /* Grab the masks from the surface description */
- pScreenPriv->dwRedMask = ddsdShadow.u4.ddpfPixelFormat.u2.dwRBitMask;
- pScreenPriv->dwGreenMask = ddsdShadow.u4.ddpfPixelFormat.u3.dwGBitMask;
- pScreenPriv->dwBlueMask = ddsdShadow.u4.ddpfPixelFormat.u4.dwBBitMask;
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowDDNL - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Transfer the damaged regions of the shadow framebuffer to the display.
- */
-
-void
-winShadowUpdateDDNL (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
- HRESULT ddrval = DD_OK;
- RECT rcDest, rcSrc;
- POINT ptOrigin;
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
-
- /*
- * Return immediately if the app is not active
- * and we are fullscreen, or if we have a bad display depth
- */
- if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
- || pScreenPriv->fBadDepth) return;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
-
- /*
- * Handle small regions with multiple blits,
- * handle large regions by creating a clipping region and
- * doing a single blit constrained to that clipping region.
- */
- if (pScreenInfo->dwClipUpdatesNBoxes == 0
- || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
- {
- /* Loop through all boxes in the damaged region */
- while (dwBox--)
- {
- /* Assign damage box to source rectangle */
- rcSrc.left = pBox->x1;
- rcSrc.top = pBox->y1;
- rcSrc.right = pBox->x2;
- rcSrc.bottom = pBox->y2;
-
- /* Calculate destination rectangle */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Blit the damaged areas */
- ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
- &rcDest,
- pScreenPriv->pddsShadow4,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (FAILED (ddrval))
- {
- static int s_iFailCount = 0;
-
- if (s_iFailCount < FAIL_MSG_MAX_BLT)
- {
- ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt () "
- "failed: %08x\n",
- ddrval);
-
- ++s_iFailCount;
-
- if (s_iFailCount == FAIL_MSG_MAX_BLT)
- {
- ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt "
- "failure message maximum (%d) reached. No "
- "more failure messages will be printed.",
- FAIL_MSG_MAX_BLT);
- }
- }
- }
-
- /* Get a pointer to the next box */
- ++pBox;
- }
- }
- else
- {
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
-
- /* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--)
- {
- hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject (hrgnTemp);
- pBox++;
- }
-
- /* Install the GDI region as a clipping region */
- SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
- DeleteObject (hrgnCombined);
- hrgnCombined = NULL;
-
-#if CYGDEBUG
- ErrorF ("winShadowUpdateDDNL - be x1 %d y1 %d x2 %d y2 %d\n",
- pBoxExtents->x1, pBoxExtents->y1,
- pBoxExtents->x2, pBoxExtents->y2);
-#endif
-
- /* Calculating a bounding box for the source is easy */
- rcSrc.left = pBoxExtents->x1;
- rcSrc.top = pBoxExtents->y1;
- rcSrc.right = pBoxExtents->x2;
- rcSrc.bottom = pBoxExtents->y2;
-
- /* Calculating a bounding box for the destination is trickier */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
- &rcDest,
- pScreenPriv->pddsShadow4,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
-
- /* Reset the clip region */
- SelectClipRgn (pScreenPriv->hdcScreen, NULL);
- }
-}
-
-
-/*
- * Call the wrapped CloseScreen function.
- *
- * Free our resources and private structures.
- */
-
-Bool
-winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- Bool fReturn;
-
-#if CYGDEBUG
- ErrorF ("winCloseScreenShadowDDNL - Freeing screen resources\n");
-#endif
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
-
- /* Free the screen DC */
- ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
-
- /* Delete the window property */
- RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- /* Free the shadow surface, if there is one */
- if (pScreenPriv->pddsShadow4)
- {
- IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4);
- free (pScreenInfo->pfb);
- pScreenInfo->pfb = NULL;
- pScreenPriv->pddsShadow4 = NULL;
- }
-
- /* Detach the clipper from the primary surface and release the clipper. */
- if (pScreenPriv->pddcPrimary)
- {
- /* Detach the clipper */
- IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
- NULL);
-
- /* Release the clipper object */
- IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
- pScreenPriv->pddcPrimary = NULL;
- }
-
- /* Release the primary surface, if there is one */
- if (pScreenPriv->pddsPrimary4)
- {
- IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
- pScreenPriv->pddsPrimary4 = NULL;
- }
-
- /* Free the DirectDraw4 object, if there is one */
- if (pScreenPriv->pdd4)
- {
- IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4);
- IDirectDraw4_Release (pScreenPriv->pdd4);
- pScreenPriv->pdd4 = NULL;
- }
-
- /* Free the DirectDraw object, if there is one */
- if (pScreenPriv->pdd)
- {
- IDirectDraw_Release (pScreenPriv->pdd);
- pScreenPriv->pdd = NULL;
- }
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon (pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL)
- {
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen)
- {
- DestroyWindow (pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
- /* Destroy the thread startup mutex */
- pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
-
- /* Kill our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Invalidate the ScreenInfo's fb pointer */
- pScreenInfo->pfb = NULL;
-
- /* Free the screen privates for this screen */
- free ((pointer) pScreenPriv);
-
- return fReturn;
-}
-
-
-/*
- * Tell mi what sort of visuals we need.
- *
- * Generally we only need one visual, as our screen can only
- * handle one format at a time, I believe. You may want
- * to verify that last sentence.
- */
-
-Bool
-winInitVisualsShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
- /* Count the number of ones in each color mask */
- dwRedBits = winCountBits (pScreenPriv->dwRedMask);
- dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
- dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
-
- /* Store the maximum number of ones in a color mask as the bitsPerRGB */
- if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
- pScreenPriv->dwBitsPerRGB = 8;
- else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- ErrorF ("winInitVisualsShadowDDNL - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->dwDepth,
- pScreenInfo->dwBPP);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- case 16:
- case 15:
-#if defined(XFree86Server)
- /* Setup the real visual */
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- -1,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!miSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- -1,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#else /* XFree86Server */
- /* Setup the real visual */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!fbSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#endif /* XFree86Server */
- break;
-
- case 8:
-#if defined(XFree86Server)
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- pScreenInfo->fFullScreen
- ? PseudoColorMask : StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->fFullScreen
- ? PseudoColor : StaticColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#else /* XFree86Server */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- pScreenInfo->fFullScreen
- ? PseudoColorMask : StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#endif /* XFree86Server */
- break;
-
- default:
- ErrorF ("winInitVisualsShadowDDNL - Unknown screen depth\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winInitVisualsShadowDDNL - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Adjust the user proposed video mode
- */
-
-Bool
-winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = NULL;
- DWORD dwBPP;
-
- /* We're in serious trouble if we can't get a DC */
- hdc = GetDC (NULL);
- if (hdc == NULL)
- {
- ErrorF ("winAdjustVideoModeShadowDDNL - GetDC () failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* DirectDraw can only change the depth in fullscreen mode */
- if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
- {
- /* No -depth parameter passed, let the user know the depth being used */
- ErrorF ("winAdjustVideoModeShadowDDNL - Using Windows display "
- "depth of %d bits per pixel\n", dwBPP);
-
- /* Use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
- else if (pScreenInfo->fFullScreen
- && pScreenInfo->dwBPP != dwBPP)
- {
- /* FullScreen, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModeShadowDDNL - FullScreen, using command "
- "line bpp: %d\n", pScreenInfo->dwBPP);
- }
- else if (dwBPP != pScreenInfo->dwBPP)
- {
- /* Windowed, and GDI depth differs from -depth parameter */
- ErrorF ("winAdjustVideoModeShadowDDNL - Windowed, command line "
- "bpp: %d, using bpp: %d\n",
- pScreenInfo->dwBPP, dwBPP);
-
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* See if the shadow bitmap will be larger than the DIB size limit */
- if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
- >= WIN_DIB_MAXIMUM_SIZE)
- {
- ErrorF ("winAdjustVideoModeShadowDDNL - Requested DirectDraw surface "
- "will be larger than %d MB. The surface may fail to be "
- "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
- "DIB size. This limit does not apply to Windows NT/2000, and "
- "this message may be ignored on those platforms.\n",
- WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
-
- return TRUE;
-}
-
-
-/*
- * Blt exposed regions to the screen
- */
-
-Bool
-winBltExposedRegionsShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
- HDC hdcUpdate;
- PAINTSTRUCT ps;
- HRESULT ddrval = DD_OK;
- Bool fReturn = TRUE;
- int i;
-
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
- if (hdcUpdate == NULL)
- {
- fReturn = FALSE;
- ErrorF ("winBltExposedRegionsShadowDDNL - BeginPaint () returned "
- "a NULL device context handle. Aborting blit attempt.\n");
- goto winBltExposedRegionsShadowDDNL_Exit;
- }
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
-
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be entire shadow surface, as Blt should clip for us */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Try to regain the primary surface and blit again if we've lost it */
- for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i)
- {
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
- &rcDest,
- pScreenPriv->pddsShadow4,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (ddrval == DDERR_SURFACELOST)
- {
- /* Surface was lost */
- ErrorF ("winBltExposedRegionsShadowDDNL - IDirectDrawSurface4_Blt "
- "reported that the primary surface was lost, "
- "trying to restore, retry: %d\n", i + 1);
-
- /* Try to restore the surface, once */
-
- ddrval = IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4);
- ErrorF ("winBltExposedRegionsShadowDDNL - "
- "IDirectDrawSurface4_Restore returned: ");
- if (ddrval == DD_OK)
- continue;
- else if (ddrval == DDERR_WRONGMODE)
- ErrorF ("DDERR_WRONGMODE\n");
- else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
- ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
- else if (ddrval == DDERR_UNSUPPORTED)
- ErrorF ("DDERR_UNSUPPORTED\n");
- else if (ddrval == DDERR_INVALIDPARAMS)
- ErrorF ("DDERR_INVALIDPARAMS\n");
- else if (ddrval == DDERR_INVALIDOBJECT)
- ErrorF ("DDERR_INVALIDOBJECT\n");
- else
- ErrorF ("unknown error: %08x\n", ddrval);
-
- /* Loop around to try the blit one more time */
- continue;
- }
- else if (FAILED (ddrval))
- {
- fReturn = FALSE;
- ErrorF ("winBltExposedRegionsShadowDDNL - IDirectDrawSurface4_Blt "
- "failed, but surface not lost: %08x %d\n", ddrval, ddrval);
- goto winBltExposedRegionsShadowDDNL_Exit;
- }
- else
- {
- /* Success, stop looping */
- break;
- }
- }
-
- winBltExposedRegionsShadowDDNL_Exit:
- /* EndPaint frees the DC */
- if (hdcUpdate != NULL)
- EndPaint (pScreenPriv->hwndScreen, &ps);
- return fReturn;
-}
-
-
-/*
- * Do any engine-specific appliation-activation processing
- */
-
-Bool
-winActivateAppShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- /*
- * Do we have a surface?
- * Are we active?
- * Are we full screen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary4 != NULL
- && pScreenPriv->fActive)
- {
- /* Primary surface was lost, restore it */
- IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4);
- }
-
- return TRUE;
-}
-
-
-/*
- * Reblit the shadow framebuffer to the screen.
- */
-
-Bool
-winRedrawScreenShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be entire shadow surface, as Blt should clip for us */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Redraw the whole window, to take account for the new colors */
- ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
- &rcDest,
- pScreenPriv->pddsShadow4,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winRedrawScreenShadowDDNL - IDirectDrawSurface4_Blt () "
- "failed: %08x\n",
- ddrval);
- }
-
- return TRUE;
-}
-
-
-/*
- * Realize the currently installed colormap
- */
-
-Bool
-winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-
-/*
- * Install the specified colormap
- */
-
-Bool
-winInstallColormapShadowDDNL (ColormapPtr pColormap)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /* Install the DirectDraw palette on the primary surface */
- ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
- pCmapPriv->lpDDPalette);
- if (FAILED (ddrval))
- {
- ErrorF ("winInstallColormapShadowDDNL - Failed installing the "
- "DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-
- return TRUE;
-}
-
-
-/*
- * Store the specified colors in the specified colormap
- */
-
-Bool
-winStoreColorsShadowDDNL (ColormapPtr pColormap,
- int ndef,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
- HRESULT ddrval = DD_OK;
-
- /* Put the X colormap entries into the Windows logical palette */
- ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
- 0,
- pdefs[0].pixel,
- ndef,
- pCmapPriv->peColors
- + pdefs[0].pixel);
- if (FAILED (ddrval))
- {
- ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed\n");
- return FALSE;
- }
-
- /* Don't install the DirectDraw palette if the colormap is not installed */
- if (pColormap != curpmap)
- {
- return TRUE;
- }
-
- if (!winInstallColormapShadowDDNL (pColormap))
- {
- ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Colormap initialization procedure
- */
-
-Bool
-winCreateColormapShadowDDNL (ColormapPtr pColormap)
-{
- HRESULT ddrval = DD_OK;
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
-
- /* Create a DirectDraw palette */
- ddrval = IDirectDraw4_CreatePalette (pScreenPriv->pdd4,
- DDPCAPS_8BIT | DDPCAPS_ALLOW256,
- pCmapPriv->peColors,
- &pCmapPriv->lpDDPalette,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Colormap destruction procedure
- */
-
-Bool
-winDestroyColormapShadowDDNL (ColormapPtr pColormap)
-{
- winScreenPriv(pColormap->pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /*
- * Is colormap to be destroyed the default?
- *
- * Non-default colormaps should have had winUninstallColormap
- * called on them before we get here. The default colormap
- * will not have had winUninstallColormap called on it. Thus,
- * we need to handle the default colormap in a special way.
- */
- if (pColormap->flags & IsDefault)
- {
-#if CYGDEBUG
- ErrorF ("winDestroyColormapShadowDDNL - Destroying default "
- "colormap\n");
-#endif
-
- /*
- * FIXME: Walk the list of all screens, popping the default
- * palette out of each screen device context.
- */
-
- /* Pop the palette out of the primary surface */
- ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
- NULL);
- if (FAILED (ddrval))
- {
- ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
- "default colormap DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Clear our private installed colormap pointer */
- pScreenPriv->pcmapInstalled = NULL;
- }
-
- /* Release the palette */
- IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
-
- /* Invalidate the colormap privates */
- pCmapPriv->lpDDPalette = NULL;
-
- return TRUE;
-}
-
-
-/*
- * Set pointers to our engine specific functions
- */
-
-Bool
-winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBShadowDDNL;
- pScreenPriv->pwinShadowUpdate = winShadowUpdateDDNL;
- pScreenPriv->pwinCloseScreen = winCloseScreenShadowDDNL;
- pScreenPriv->pwinInitVisuals = winInitVisualsShadowDDNL;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDDNL;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
- pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL;
- pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL;
- pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDDNL;
- pScreenPriv->pwinRealizeInstalledPalette
- = winRealizeInstalledPaletteShadowDDNL;
- pScreenPriv->pwinInstallColormap = winInstallColormapShadowDDNL;
- pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL;
- pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL;
- pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
- pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
- pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
-
- return TRUE;
-}
-
-
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
deleted file mode 100644
index 16b1969d7..000000000
--- a/hw/xwin/winshadgdi.c
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.23 2003/07/29 21:25:18 dawes Exp $ */
-
-#include "win.h"
-
-/*
- * Local function prototypes
- */
-
-BOOL CALLBACK
-winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam);
-
-
-/*
- * Internal function to get the DIB format that is compatible with the screen
- */
-
-static
-Bool
-winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih)
-{
- winScreenPriv(pScreen);
- HBITMAP hbmp;
-#if CYGDEBUG
- LPDWORD pdw = NULL;
-#endif
-
- /* Create a memory bitmap compatible with the screen */
- hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1);
- if (hbmp == NULL)
- {
- ErrorF ("winQueryScreenDIBFormat - CreateCompatibleBitmap failed\n");
- return FALSE;
- }
-
- /* Initialize our bitmap info header */
- ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
- pbmih->biSize = sizeof (BITMAPINFOHEADER);
-
- /* Get the biBitCount */
- if (!GetDIBits (pScreenPriv->hdcScreen,
- hbmp,
- 0, 1,
- NULL,
- (BITMAPINFO*) pbmih,
- DIB_RGB_COLORS))
- {
- ErrorF ("winQueryScreenDIBFormat - First call to GetDIBits failed\n");
- DeleteObject (hbmp);
- return FALSE;
- }
-
-#if CYGDEBUG
- /* Get a pointer to bitfields */
- pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
-
- ErrorF ("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n",
- pdw[0], pdw[1], pdw[2]);
-#endif
-
- /* Get optimal color table, or the optimal bitfields */
- if (!GetDIBits (pScreenPriv->hdcScreen,
- hbmp,
- 0, 1,
- NULL,
- (BITMAPINFO*)pbmih,
- DIB_RGB_COLORS))
- {
- ErrorF ("winQueryScreenDIBFormat - Second call to GetDIBits "
- "failed\n");
- DeleteObject (hbmp);
- return FALSE;
- }
-
- /* Free memory */
- DeleteObject (hbmp);
-
- return TRUE;
-}
-
-
-/*
- * Internal function to determine the GDI bits per rgb and bit masks
- */
-
-static
-Bool
-winQueryRGBBitsAndMasks (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- BITMAPINFOHEADER *pbmih = NULL;
- Bool fReturn = TRUE;
- LPDWORD pdw = NULL;
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
- /* Color masks for 8 bpp are standardized */
- if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE)
- {
- /*
- * RGB BPP for 8 bit palletes is always 8
- * and the color masks are always 0.
- */
- pScreenPriv->dwBitsPerRGB = 8;
- pScreenPriv->dwRedMask = 0x0L;
- pScreenPriv->dwGreenMask = 0x0L;
- pScreenPriv->dwBlueMask = 0x0L;
- return TRUE;
- }
-
- /* Color masks for 24 bpp are standardized */
- if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES)
- * GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24)
- {
- ErrorF ("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) "
- "returned 24 for the screen. Using default 24bpp masks.\n");
-
- /* 8 bits per primary color */
- pScreenPriv->dwBitsPerRGB = 8;
-
- /* Set screen privates masks */
- pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED;
- pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN;
- pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE;
-
- return TRUE;
- }
-
- /* Allocate a bitmap header and color table */
- pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
- + 256 * sizeof (RGBQUAD));
- if (pbmih == NULL)
- {
- ErrorF ("winQueryRGBBitsAndMasks - malloc failed\n");
- return FALSE;
- }
-
- /* Get screen description */
- if (winQueryScreenDIBFormat (pScreen, pbmih))
- {
- /* Get a pointer to bitfields */
- pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
-
-#if CYGDEBUG
- ErrorF ("winQueryRGBBitsAndMasks - Masks: %08x %08x %08x\n",
- pdw[0], pdw[1], pdw[2]);
-#endif
-
- /* Count the number of bits in each mask */
- dwRedBits = winCountBits (pdw[0]);
- dwGreenBits = winCountBits (pdw[1]);
- dwBlueBits = winCountBits (pdw[2]);
-
- /* Find maximum bits per red, green, blue */
- if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- /* Set screen privates masks */
- pScreenPriv->dwRedMask = pdw[0];
- pScreenPriv->dwGreenMask = pdw[1];
- pScreenPriv->dwBlueMask = pdw[2];
- }
- else
- {
- ErrorF ("winQueryRGBBitsAndMasks - winQueryScreenDIBFormat failed\n");
- free (pbmih);
- fReturn = FALSE;
- }
-
- /* Free memory */
- free (pbmih);
-
- return fReturn;
-}
-
-
-/*
- * Redraw all ---?
- */
-
-BOOL CALLBACK
-winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam)
-{
- char strClassName[100];
-
- if (GetClassName (hwnd, strClassName, 100))
- {
- if (strncmp (WINDOW_CLASS_X, strClassName, strlen (WINDOW_CLASS_X)) == 0)
- {
- InvalidateRect (hwnd, NULL, FALSE);
- UpdateWindow (hwnd);
- }
- }
- return TRUE;
-}
-
-
-/*
- * Allocate a DIB for the shadow framebuffer GDI server
- */
-
-Bool
-winAllocateFBShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- BITMAPINFOHEADER *pbmih = NULL;
- DIBSECTION dibsection;
- Bool fReturn = TRUE;
-
- /* Get device contexts for the screen and shadow bitmap */
- pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
- pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen);
-
- /* Allocate bitmap info header */
- pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
- + 256 * sizeof (RGBQUAD));
- if (pbmih == NULL)
- {
- ErrorF ("winAllocateFBShadowGDI - malloc () failed\n");
- return FALSE;
- }
-
- /* Query the screen format */
- fReturn = winQueryScreenDIBFormat (pScreen, pbmih);
-
- /* Describe shadow bitmap to be created */
- pbmih->biWidth = pScreenInfo->dwWidth;
- pbmih->biHeight = -pScreenInfo->dwHeight;
-
- ErrorF ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d "
- "depth: %d\n",
- pbmih->biWidth, -pbmih->biHeight, pbmih->biBitCount);
-
- /* Create a DI shadow bitmap with a bit pointer */
- pScreenPriv->hbmpShadow = CreateDIBSection (pScreenPriv->hdcScreen,
- (BITMAPINFO *) pbmih,
- DIB_RGB_COLORS,
- (VOID**) &pScreenInfo->pfb,
- NULL,
- 0);
- if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL)
- {
- ErrorF ("winAllocateFBShadowGDI - CreateDIBSection failed\n");
- return FALSE;
- }
- else
- {
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowGDI - Shadow buffer allocated\n");
-#endif
- }
-
- /* Get information about the bitmap that was allocated */
- GetObject (pScreenPriv->hbmpShadow,
- sizeof (dibsection),
- &dibsection);
-
-#if CYGDEBUG || YES
- /* Print information about bitmap allocated */
- ErrorF ("winAllocateFBShadowGDI - Dibsection width: %d height: %d "
- "depth: %d size image: %d\n",
- dibsection.dsBmih.biWidth, dibsection.dsBmih.biHeight,
- dibsection.dsBmih.biBitCount,
- dibsection.dsBmih.biSizeImage);
-#endif
-
- /* Select the shadow bitmap into the shadow DC */
- SelectObject (pScreenPriv->hdcShadow,
- pScreenPriv->hbmpShadow);
-
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowGDI - Attempting a shadow blit\n");
-#endif
-
- /* Do a test blit from the shadow to the screen, I think */
- fReturn = BitBlt (pScreenPriv->hdcScreen,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
- if (fReturn)
- {
-#if CYGDEBUG
- ErrorF ("winAllocateFBShadowGDI - Shadow blit success\n");
-#endif
- }
- else
- {
- ErrorF ("winAllocateFBShadowGDI - Shadow blit failure\n");
- return FALSE;
- }
-
- /* Look for height weirdness */
- if (dibsection.dsBmih.biHeight < 0)
- {
- /* FIXME: Figure out why biHeight is sometimes negative */
- ErrorF ("winAllocateFBShadowGDI - WEIRDNESS - biHeight "
- "still negative: %d\n"
- "winAllocateFBShadowGDI - WEIRDNESS - Flipping biHeight sign\n",
- dibsection.dsBmih.biHeight);
- dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
- }
-
- /* Set screeninfo stride */
- pScreenInfo->dwStride = ((dibsection.dsBmih.biSizeImage
- / dibsection.dsBmih.biHeight)
- * 8) / pScreenInfo->dwBPP;
-
-#if CYGDEBUG || YES
- ErrorF ("winAllocateFBShadowGDI - Created shadow stride: %d\n",
- pScreenInfo->dwStride);
-#endif
-
- /* See if the shadow bitmap will be larger than the DIB size limit */
- if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
- >= WIN_DIB_MAXIMUM_SIZE)
- {
- ErrorF ("winAllocateFBShadowGDI - Requested DIB (bitmap) "
- "will be larger than %d MB. The surface may fail to be "
- "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
- "DIB size. This limit does not apply to Windows NT/2000, and "
- "this message may be ignored on those platforms.\n",
- WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
- }
-
- /* Determine our color masks */
- if (!winQueryRGBBitsAndMasks (pScreen))
- {
- ErrorF ("winAllocateFBShadowGDI - winQueryRGBBitsAndMasks failed\n");
- return FALSE;
- }
-
- /* Redraw all windows */
- if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
-
- return fReturn;
-}
-
-
-/*
- * Blit the damaged regions of the shadow fb to the screen
- */
-
-void
-winShadowUpdateGDI (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
- int x, y, w, h;
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
-#if WIN_UPDATE_STATS
- static DWORD s_dwNonUnitRegions = 0;
- static DWORD s_dwTotalUpdates = 0;
- static DWORD s_dwTotalBoxes = 0;
-#endif
-
- /*
- * Return immediately if the app is not active
- * and we are fullscreen, or if we have a bad display depth
- */
- if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
- || pScreenPriv->fBadDepth) return;
-
-#if WIN_UPDATE_STATS
- ++s_dwTotalUpdates;
- s_dwTotalBoxes += dwBox;
-
- if (dwBox != 1)
- {
- ++s_dwNonUnitRegions;
- ErrorF ("winShadowUpdatGDI - dwBox: %d\n", dwBox);
- }
-
- if ((s_dwTotalUpdates % 100) == 0)
- ErrorF ("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d "
- "nu: %d tu: %d\n",
- (s_dwNonUnitRegions * 100) / s_dwTotalUpdates,
- s_dwTotalBoxes / s_dwTotalUpdates,
- s_dwNonUnitRegions, s_dwTotalUpdates);
-#endif /* WIN_UPDATE_STATS */
-
- /*
- * Handle small regions with multiple blits,
- * handle large regions by creating a clipping region and
- * doing a single blit constrained to that clipping region.
- */
- if (pScreenInfo->dwClipUpdatesNBoxes == 0
- || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
- {
- /* Loop through all boxes in the damaged region */
- while (dwBox--)
- {
- /*
- * Calculate x offset, y offset, width, and height for
- * current damage box
- */
- x = pBox->x1;
- y = pBox->y1;
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
-
- BitBlt (pScreenPriv->hdcScreen,
- x, y,
- w, h,
- pScreenPriv->hdcShadow,
- x, y,
- SRCCOPY);
-
- /* Get a pointer to the next box */
- ++pBox;
- }
- }
- else
- {
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
-
- /* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--)
- {
- hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject (hrgnTemp);
- pBox++;
- }
-
- /* Install the GDI region as a clipping region */
- SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
- DeleteObject (hrgnCombined);
- hrgnCombined = NULL;
-
- /*
- * Blit the shadow buffer to the screen,
- * constrained to the clipping region.
- */
- BitBlt (pScreenPriv->hdcScreen,
- pBoxExtents->x1, pBoxExtents->y1,
- pBoxExtents->x2 - pBoxExtents->x1,
- pBoxExtents->y2 - pBoxExtents->y1,
- pScreenPriv->hdcShadow,
- pBoxExtents->x1, pBoxExtents->y1,
- SRCCOPY);
-
- /* Reset the clip region */
- SelectClipRgn (pScreenPriv->hdcScreen, NULL);
- }
-
- /* Redraw all windows */
- if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
-}
-
-
-/* See Porting Layer Definition - p. 33 */
-/*
- * We wrap whatever CloseScreen procedure was specified by fb;
- * a pointer to said procedure is stored in our privates.
- */
-
-Bool
-winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- Bool fReturn;
-
-#if CYGDEBUG
- ErrorF ("winCloseScreenShadowGDI - Freeing screen resources\n");
-#endif
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
-
- /* Delete the window property */
- RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- /* Free the shadow DC; which allows the bitmap to be freed */
- DeleteDC (pScreenPriv->hdcShadow);
-
- /* Free the shadow bitmap */
- DeleteObject (pScreenPriv->hbmpShadow);
-
- /* Free the screen DC */
- ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon (pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL)
- {
- DestroyWindow (g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen)
- {
- DestroyWindow (pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
- /* Destroy the thread startup mutex */
- pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
-
- /* Invalidate our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Invalidate the ScreenInfo's fb pointer */
- pScreenInfo->pfb = NULL;
-
- /* Free the screen privates for this screen */
- free ((pointer) pScreenPriv);
-
- return fReturn;
-}
-
-
-/*
- * Tell mi what sort of visuals we need.
- *
- * Generally we only need one visual, as our screen can only
- * handle one format at a time, I believe. You may want
- * to verify that last sentence.
- */
-
-Bool
-winInitVisualsShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Display debugging information */
- ErrorF ("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->dwDepth,
- pScreenInfo->dwBPP);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth)
- {
- case 24:
- case 16:
- case 15:
-#if defined(XFree86Server)
- /* Setup the real visual */
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- -1,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!miSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- -1,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#else /* XFree86Server */
- /* Setup the real visual */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#if WIN_EMULATE_PSEUDO_SUPPORT
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!fbSetVisualTypesAndMasks (8,
- PseudoColorMask,
- 8,
- 0,
- 0,
- 0))
- {
- ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
-#endif /* XFree86Server */
- break;
-
- case 8:
-#if defined(XFree86Server)
- if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- PseudoColorMask,
- pScreenPriv->dwBitsPerRGB,
- PseudoColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#else /* XFree86Server */
- if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
- PseudoColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask))
- {
- ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
-#endif
- break;
-
- default:
- ErrorF ("winInitVisualsShadowGDI - Unknown screen depth\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- ErrorF ("winInitVisualsShadowGDI - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Adjust the proposed video mode
- */
-
-Bool
-winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc;
- DWORD dwBPP;
-
- hdc = GetDC (NULL);
-
- /* We're in serious trouble if we can't get a DC */
- if (hdc == NULL)
- {
- ErrorF ("winAdjustVideoModeShadowGDI - GetDC () failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
-
- /* GDI cannot change the screen depth */
- if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
- {
- /* No -depth parameter passed, let the user know the depth being used */
- ErrorF ("winAdjustVideoModeShadowGDI - Using Windows display "
- "depth of %d bits per pixel\n", dwBPP);
-
- /* Use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
- else if (dwBPP != pScreenInfo->dwBPP)
- {
- /* Warn user if GDI depth is different than -depth parameter */
- ErrorF ("winAdjustVideoModeShadowGDI - Command line bpp: %d, "\
- "using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
-
- /* We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* Release our DC */
- ReleaseDC (NULL, hdc);
- hdc = NULL;
-
- return TRUE;
-}
-
-
-/*
- * Blt exposed regions to the screen
- */
-
-Bool
-winBltExposedRegionsShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- winPrivCmapPtr pCmapPriv = NULL;
- HDC hdcUpdate;
- PAINTSTRUCT ps;
-
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
-
- /* Realize the palette, if we have one */
- if (pScreenPriv->pcmapInstalled != NULL)
- {
- pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
-
- SelectPalette (hdcUpdate, pCmapPriv->hPalette, FALSE);
- RealizePalette (hdcUpdate);
- }
-
- /* Our BitBlt will be clipped to the invalidated region */
- BitBlt (hdcUpdate,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
-
- /* EndPaint frees the DC */
- EndPaint (pScreenPriv->hwndScreen, &ps);
-
- /* Redraw all windows */
- if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
-
- return TRUE;
-}
-
-
-/*
- * Do any engine-specific appliation-activation processing
- */
-
-Bool
-winActivateAppShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
-#if CYGDEBUG
- ErrorF ("winActivateAppShadowGDI\n");
-#endif
-
- /*
- * Are we active?
- * Are we fullscreen?
- */
- if (pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /*
- * Activating, attempt to bring our window
- * to the top of the display
- */
- ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
- }
- else if (!pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /*
- * Deactivating, stuff our window onto the
- * task bar.
- */
- ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
- }
-
-#if CYGDEBUG
- ErrorF ("winActivateAppShadowGDI - Returning\n");
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Reblit the shadow framebuffer to the screen.
- */
-
-Bool
-winRedrawScreenShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Redraw the whole window, to take account for the new colors */
- BitBlt (pScreenPriv->hdcScreen,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
-
- /* Redraw all windows */
- if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
- return TRUE;
-}
-
-
-/*
- * Realize the currently installed colormap
- */
-
-Bool
-winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winPrivCmapPtr pCmapPriv = NULL;
-
-#if CYGDEBUG
- ErrorF ("winRealizeInstalledPaletteShadowGDI\n");
-#endif
-
- /* Don't do anything if there is not a colormap */
- if (pScreenPriv->pcmapInstalled == NULL)
- {
-#if CYGDEBUG
- ErrorF ("winRealizeInstalledPaletteShadowGDI - No colormap "
- "installed\n");
-#endif
- return TRUE;
- }
-
- pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
-
- /* Realize our palette for the screen */
- if (RealizePalette (pScreenPriv->hdcScreen) == GDI_ERROR)
- {
- ErrorF ("winRealizeInstalledPaletteShadowGDI - RealizePalette () "
- "failed\n");
- return FALSE;
- }
-
- /* Set the DIB color table */
- if (SetDIBColorTable (pScreenPriv->hdcShadow,
- 0,
- WIN_NUM_PALETTE_ENTRIES,
- pCmapPriv->rgbColors) == 0)
- {
- ErrorF ("winRealizeInstalledPaletteShadowGDI - SetDIBColorTable () "
- "failed\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Install the specified colormap
- */
-
-Bool
-winInstallColormapShadowGDI (ColormapPtr pColormap)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- winCmapPriv(pColormap);
-
- /*
- * Tell Windows to install the new colormap
- */
- if (SelectPalette (pScreenPriv->hdcScreen,
- pCmapPriv->hPalette,
- FALSE) == NULL)
- {
- ErrorF ("winInstallColormapShadowGDI - SelectPalette () failed\n");
- return FALSE;
- }
-
- /* Realize the palette */
- if (GDI_ERROR == RealizePalette (pScreenPriv->hdcScreen))
- {
- ErrorF ("winInstallColormapShadowGDI - RealizePalette () failed\n");
- return FALSE;
- }
-
- /* Set the DIB color table */
- if (SetDIBColorTable (pScreenPriv->hdcShadow,
- 0,
- WIN_NUM_PALETTE_ENTRIES,
- pCmapPriv->rgbColors) == 0)
- {
- ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
- return FALSE;
- }
-
- /* Redraw the whole window, to take account for the new colors */
- BitBlt (pScreenPriv->hdcScreen,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-
- /* Redraw all windows */
- if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
-
- return TRUE;
-}
-
-
-/*
- * Store the specified colors in the specified colormap
- */
-
-Bool
-winStoreColorsShadowGDI (ColormapPtr pColormap,
- int ndef,
- xColorItem *pdefs)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
-
- /* Put the X colormap entries into the Windows logical palette */
- if (SetPaletteEntries (pCmapPriv->hPalette,
- pdefs[0].pixel,
- ndef,
- pCmapPriv->peColors + pdefs[0].pixel) == 0)
- {
- ErrorF ("winStoreColorsShadowGDI - SetPaletteEntries () failed\n");
- return FALSE;
- }
-
- /* Don't install the Windows palette if the colormap is not installed */
- if (pColormap != curpmap)
- {
- return TRUE;
- }
-
- /* Try to install the newly modified colormap */
- if (!winInstallColormapShadowGDI (pColormap))
- {
- ErrorF ("winInstallColormapShadowGDI - winInstallColormapShadowGDI "
- "failed\n");
- return FALSE;
- }
-
-#if 0
- /* Tell Windows that the palette has changed */
- RealizePalette (pScreenPriv->hdcScreen);
-
- /* Set the DIB color table */
- if (SetDIBColorTable (pScreenPriv->hdcShadow,
- pdefs[0].pixel,
- ndef,
- pCmapPriv->rgbColors + pdefs[0].pixel) == 0)
- {
- ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
- return FALSE;
- }
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-#endif
-
- return TRUE;
-}
-
-
-/*
- * Colormap initialization procedure
- */
-
-Bool
-winCreateColormapShadowGDI (ColormapPtr pColormap)
-{
- LPLOGPALETTE lpPaletteNew = NULL;
- DWORD dwEntriesMax;
- VisualPtr pVisual;
- HPALETTE hpalNew = NULL;
- winCmapPriv(pColormap);
-
- /* Get a pointer to the visual that the colormap belongs to */
- pVisual = pColormap->pVisual;
-
- /* Get the maximum number of palette entries for this visual */
- dwEntriesMax = pVisual->ColormapEntries;
-
- /* Allocate a Windows logical color palette with max entries */
- lpPaletteNew = malloc (sizeof (LOGPALETTE)
- + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
- if (lpPaletteNew == NULL)
- {
- ErrorF ("winCreateColormapShadowGDI - Couldn't allocate palette "
- "with %d entries\n",
- dwEntriesMax);
- return FALSE;
- }
-
- /* Zero out the colormap */
- ZeroMemory (lpPaletteNew, sizeof (LOGPALETTE)
- + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
-
- /* Set the logical palette structure */
- lpPaletteNew->palVersion = 0x0300;
- lpPaletteNew->palNumEntries = dwEntriesMax;
-
- /* Tell Windows to create the palette */
- hpalNew = CreatePalette (lpPaletteNew);
- if (hpalNew == NULL)
- {
- ErrorF ("winCreateColormapShadowGDI - CreatePalette () failed\n");
- free (lpPaletteNew);
- return FALSE;
- }
-
- /* Save the Windows logical palette handle in the X colormaps' privates */
- pCmapPriv->hPalette = hpalNew;
-
- /* Free the palette initialization memory */
- free (lpPaletteNew);
-
- return TRUE;
-}
-
-
-/*
- * Colormap destruction procedure
- */
-
-Bool
-winDestroyColormapShadowGDI (ColormapPtr pColormap)
-{
- winScreenPriv(pColormap->pScreen);
- winCmapPriv(pColormap);
-
- /*
- * Is colormap to be destroyed the default?
- *
- * Non-default colormaps should have had winUninstallColormap
- * called on them before we get here. The default colormap
- * will not have had winUninstallColormap called on it. Thus,
- * we need to handle the default colormap in a special way.
- */
- if (pColormap->flags & IsDefault)
- {
-#if CYGDEBUG
- ErrorF ("winDestroyColormapShadowGDI - Destroying default "
- "colormap\n");
-#endif
-
- /*
- * FIXME: Walk the list of all screens, popping the default
- * palette out of each screen device context.
- */
-
- /* Pop the palette out of the device context */
- SelectPalette (pScreenPriv->hdcScreen,
- GetStockObject (DEFAULT_PALETTE),
- FALSE);
-
- /* Clear our private installed colormap pointer */
- pScreenPriv->pcmapInstalled = NULL;
- }
-
- /* Try to delete the logical palette */
- if (DeleteObject (pCmapPriv->hPalette) == 0)
- {
- ErrorF ("winDestroyColormap - DeleteObject () failed\n");
- return FALSE;
- }
-
- /* Invalidate the colormap privates */
- pCmapPriv->hPalette = NULL;
-
- return TRUE;
-}
-
-
-/*
- * Set engine specific funtions
- */
-
-Bool
-winSetEngineFunctionsShadowGDI (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBShadowGDI;
- pScreenPriv->pwinShadowUpdate = winShadowUpdateGDI;
- pScreenPriv->pwinCloseScreen = winCloseScreenShadowGDI;
- pScreenPriv->pwinInitVisuals = winInitVisualsShadowGDI;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowGDI;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
- pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI;
- pScreenPriv->pwinActivateApp = winActivateAppShadowGDI;
- pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowGDI;
- pScreenPriv->pwinRealizeInstalledPalette =
- winRealizeInstalledPaletteShadowGDI;
- pScreenPriv->pwinInstallColormap = winInstallColormapShadowGDI;
- pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
- pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
- pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
- pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinCreatePrimarySurface
- = (winCreatePrimarySurfaceProcPtr) (void (*)())NoopDDA;
- pScreenPriv->pwinReleasePrimarySurface
- = (winReleasePrimarySurfaceProcPtr) (void (*)())NoopDDA;
-
- return TRUE;
-}
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
deleted file mode 100755
index 90c77b1c8..000000000
--- a/hw/xwin/wintrayicon.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Early Ehlinger
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/wintrayicon.c,v 1.2 2003/10/02 13:30:11 eich Exp $ */
-
-#include "win.h"
-#include <shellapi.h>
-#include "winprefs.h"
-
-/*
- * Initialize the tray icon
- */
-
-void
-winInitNotifyIcon (winPrivScreenPtr pScreenPriv)
-{
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- NOTIFYICONDATA nid = {0};
-
- nid.cbSize = sizeof (NOTIFYICONDATA);
- nid.hWnd = pScreenPriv->hwndScreen;
- nid.uID = pScreenInfo->dwScreen;
- nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
- nid.uCallbackMessage = WM_TRAYICON;
- nid.hIcon = LoadImage (g_hInstance,
- MAKEINTRESOURCE(IDI_XWIN),
- IMAGE_ICON,
- GetSystemMetrics (SM_CXSMICON),
- GetSystemMetrics (SM_CYSMICON),
- 0);
-
- /* Save handle to the icon so it can be freed later */
- pScreenPriv->hiconNotifyIcon = nid.hIcon;
-
- /* Set display and screen-specific tooltip text */
- snprintf (nid.szTip,
- sizeof (nid.szTip),
- "Cygwin/XFree86 Server - %s:%d",
- display,
- (int) pScreenInfo->dwScreen);
-
- /* Add the tray icon */
- if (!Shell_NotifyIcon (NIM_ADD, &nid))
- ErrorF ("winInitNotifyIcon - Shell_NotifyIcon Failed\n");
-}
-
-
-/*
- * Delete the tray icon
- */
-
-void
-winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv)
-{
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- NOTIFYICONDATA nid = {0};
-
-#if 0
- ErrorF ("winDeleteNotifyIcon\n");
-#endif
-
- nid.cbSize = sizeof (NOTIFYICONDATA);
- nid.hWnd = pScreenPriv->hwndScreen;
- nid.uID = pScreenInfo->dwScreen;
-
- /* Delete the tray icon */
- if (!Shell_NotifyIcon (NIM_DELETE, &nid))
- {
- ErrorF ("winDeleteNotifyIcon - Shell_NotifyIcon failed\n");
- return;
- }
-
- /* Free the icon that was loaded */
- if (pScreenPriv->hiconNotifyIcon != NULL
- && DestroyIcon (pScreenPriv->hiconNotifyIcon) == 0)
- {
- ErrorF ("winDeleteNotifyIcon - DestroyIcon failed\n");
- }
- pScreenPriv->hiconNotifyIcon = NULL;
-}
-
-
-/*
- * Process messages intended for the tray icon
- */
-
-LRESULT
-winHandleIconMessage (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam,
- winPrivScreenPtr pScreenPriv)
-{
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- switch (lParam)
- {
- case WM_LBUTTONDBLCLK:
- /* Display Exit dialog box */
- winDisplayExitDialog (pScreenPriv);
- break;
-
- case WM_RBUTTONUP:
- {
- POINT ptCursor;
- HMENU hmenuPopup;
- HMENU hmenuTray;
-
- /* Get cursor position */
- GetCursorPos (&ptCursor);
-
- /* Load tray icon menu resource */
- hmenuPopup = LoadMenu (g_hInstance,
- MAKEINTRESOURCE(IDM_TRAYICON_MENU));
- if (!hmenuPopup)
- ErrorF ("winHandleIconMessage - LoadMenu failed\n");
-
- /* Get actual tray icon menu */
- hmenuTray = GetSubMenu (hmenuPopup, 0);
-
- /* Check for MultiWindow mode */
- if (pScreenInfo->fMultiWindow)
- {
- /* Check if root window is shown or hidden */
- if (pScreenPriv->fRootWindowShown)
- {
- /* Remove Show Root Window button */
- RemoveMenu (hmenuTray,
- ID_APP_SHOW_ROOT,
- MF_BYCOMMAND);
- }
- else
- {
- /* Remove Hide Root Window button */
- RemoveMenu (hmenuTray,
- ID_APP_HIDE_ROOT,
- MF_BYCOMMAND);
- }
- }
- else
- {
- /* Remove Show Root Window button */
- RemoveMenu (hmenuTray,
- ID_APP_SHOW_ROOT,
- MF_BYCOMMAND);
-
- /* Remove Hide Root Window button */
- RemoveMenu (hmenuTray,
- ID_APP_HIDE_ROOT,
- MF_BYCOMMAND);
-
- /* Remove separator */
- RemoveMenu (hmenuTray,
- 0,
- MF_BYPOSITION);
- }
-
- SetupRootMenu ((unsigned long)hmenuTray);
-
- /*
- * NOTE: This three-step procedure is required for
- * proper popup menu operation. Without the
- * call to SetForegroundWindow the
- * popup menu will often not disappear when you click
- * outside of it. Without the PostMessage the second
- * time you display the popup menu it might immediately
- * disappear.
- */
- SetForegroundWindow (hwnd);
- TrackPopupMenuEx (hmenuTray,
- TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_RIGHTBUTTON,
- ptCursor.x, ptCursor.y,
- hwnd,
- NULL);
- PostMessage (hwnd, WM_NULL, 0, 0);
-
- /* Free menu */
- DestroyMenu (hmenuPopup);
- }
- break;
- }
-
- return 0;
-}
diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c
deleted file mode 100755
index 8bf12cd66..000000000
--- a/hw/xwin/winvideo.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winvideo.c,v 1.2 2003/11/10 18:22:44 tsi Exp $ */
-
-#include "win.h"
-#include "Xv.h"
-#include "Xvproto.h"
-
-
-/*
- * winInitVideo - Initialize support for the X Video (Xv) Extension.
- */
-
-void
-winInitVideo (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- if (pScreenInfo->dwBPP > 8)
- {
-
- }
-
-
-}
-
-
-
-
-
-
-
-#if 0
-#include "../xfree86/common/xf86.h"
-#include "../Xext/xvdix.h"
-#include "../xfree86/common/xf86xv.h"
-#include "Xv.h"
-#endif
-
-#include "win.h"
-
-
-
-#if 0
-/* client libraries expect an encoding */
-static XF86VideoEncodingRec DummyEncoding[1] =
-{
- {
- 0,
- "XV_IMAGE",
- IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
- {1, 1}
- }
-};
-
-#define NUM_FORMATS 3
-
-static XF86VideoFormatRec Formats[NUM_FORMATS] =
-{
- {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
-};
-
-#define NUM_ATTRIBUTES 3
-
-static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
-{
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
- {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
-};
-
-#define NUM_IMAGES 4
-
-static XF86ImageRec Images[NUM_IMAGES] =
-{
- XVIMAGE_YUY2,
- XVIMAGE_YV12,
- XVIMAGE_I420,
- XVIMAGE_UYVY
-};
-
-
-
-/*
- * winInitVideo - Initialize support for the X Video (Xv) Extension.
- */
-
-void
-winInitVideo (ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- XF86VideoAdaptorPtr newAdaptor = NULL;
-
- if (pScreenInfo->dwBPP > 8)
- {
- newAdaptor = I810SetupImageVideo (pScreen);
- I810InitOffscreenImages (pScreen);
- }
-
- xf86XVScreenInit (pScreen, adaptors, 1);
-}
-
-
-static XF86VideoAdaptorPtr
-winSetupImageVideo (ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-#if 0
- I810Ptr pI810 = I810PTR(pScrn);
-#endif
- XF86VideoAdaptorPtr adapt;
-
- if (!(adapt = xcalloc (1, sizeof(XF86VideoAdaptorRec))))
- return NULL;
-
- adapt->type = XvWindowMask | XvInputMask | XvImageMask;
- adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
- adapt->name = "Cygwin/XFree86 Video Overlay";
- adapt->nEncodings = 1;
- adapt->pEncodings = DummyEncoding;
- adapt->nFormats = NUM_FORMATS;
- adapt->pFormats = Formats;
- adapt->nPorts = 1;
- adapt->pPortPrivates = NULL;
-
- adapt->pPortPrivates[0].ptr = NULL;
- adapt->pAttributes = Attributes;
- adapt->nImages = NUM_IMAGES;
- adapt->nAttributes = NUM_ATTRIBUTES;
- adapt->pImages = Images;
- adapt->PutVideo = NULL;
- adapt->PutStill = NULL;
- adapt->GetVideo = NULL;
- adapt->GetStill = NULL;
-#if 0
- adapt->StopVideo = I810StopVideo;
- adapt->SetPortAttribute = I810SetPortAttribute;
- adapt->GetPortAttribute = I810GetPortAttribute;
- adapt->QueryBestSize = I810QueryBestSize;
- adapt->PutImage = I810PutImage;
- adapt->QueryImageAttributes = I810QueryImageAttributes;
-#endif
-
-#if 0
- pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1);
-#endif
- pPriv->videoStatus = 0;
- pPriv->brightness = 0;
- pPriv->contrast = 64;
- pPriv->linear = NULL;
- pPriv->currentBuf = 0;
-
-#if 0
- /* gotta uninit this someplace */
- REGION_NULL(pScreen, &pPriv->clip);
-#endif
-
-#if 0
- pI810->adaptor = adapt;
-
- pI810->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = I810BlockHandler;
-#endif
-
-#if 0
- xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
- xvContrast = MAKE_ATOM("XV_CONTRAST");
- xvColorKey = MAKE_ATOM("XV_COLORKEY");
-#endif
-
-#if 0
- I810ResetVideo(pScrn);
-#endif
-
- return adapt;
-}
-#endif
diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c
deleted file mode 100644
index f311d0dc9..000000000
--- a/hw/xwin/winwakeup.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.7 2003/07/29 21:25:18 dawes Exp $ */
-
-#include "win.h"
-
-/* See Porting Layer Definition - p. 7 */
-void
-winWakeupHandler (int nScreen,
- pointer pWakeupData,
- unsigned long ulResult,
- pointer pReadmask)
-{
-#if 0
- winScreenPriv((ScreenPtr)pWakeupData);
-#endif
- MSG msg;
-
- /* Process all messages on our queue */
- while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
- {
- if ((g_hDlgDepthChange == 0
- || !IsDialogMessage (g_hDlgDepthChange, &msg))
- && (g_hDlgExit == 0
- || !IsDialogMessage (g_hDlgExit, &msg)))
- {
- DispatchMessage (&msg);
- }
- }
- winReorderWindowsMultiWindow ((ScreenPtr)pWakeupData);
-}
-
-
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
deleted file mode 100644
index 6515c8596..000000000
--- a/hw/xwin/winwindow.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Harold L Hunt II
- * Kensuke Matsuzaki
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.c,v 1.9 2003/11/10 18:22:44 tsi Exp $ */
-
-#include "win.h"
-
-/*
- * Prototypes for local functions
- */
-
-static int
-winAddRgn (WindowPtr pWindow, pointer data);
-
-static
-void
-winUpdateRgnPRootless (WindowPtr pWindow);
-
-#ifdef SHAPE
-static
-void
-winReshapePRootless (WindowPtr pWin);
-#endif
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbCreateWindow() */
-
-Bool
-winCreateWindowNativeGDI (WindowPtr pWin)
-{
- ErrorF ("winCreateWindowNativeGDI ()\n");
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbDestroyWindow() */
-
-Bool
-winDestroyWindowNativeGDI (WindowPtr pWin)
-{
- ErrorF ("winDestroyWindowNativeGDI ()\n");
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbPositionWindow() */
-
-Bool
-winPositionWindowNativeGDI (WindowPtr pWin, int x, int y)
-{
- ErrorF ("winPositionWindowNativeGDI ()\n");
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 39 */
-/* See mfb/mfbwindow.c - mfbCopyWindow() */
-
-void
-winCopyWindowNativeGDI (WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- DDXPointPtr pptSrc;
- DDXPointPtr ppt;
- RegionPtr prgnDst;
- BoxPtr pBox;
- int dx, dy;
- int i, nbox;
- WindowPtr pwinRoot;
- BoxPtr pBoxDst, pBoxSrc;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- winScreenPriv(pScreen);
-
-#if 0
- ErrorF ("winCopyWindow\n");
-#endif
-
- /* Get a pointer to the root window */
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- /* Create a region for the destination */
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
-
- /* Calculate the shift from the source to the destination */
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
-
- /* Translate the region from the destination to the source? */
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
- prgnSrc);
-
- /* Get a pointer to the first box in the region to be copied */
- pBox = REGION_RECTS(prgnDst);
-
- /* Get the number of boxes in the region */
- nbox = REGION_NUM_RECTS(prgnDst);
-
- /* Allocate source points for each box */
- if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- return;
-
- /* Set an iterator pointer */
- ppt = pptSrc;
-
- /* Calculate the source point of each box? */
- for (i = nbox; --i >= 0; ppt++, pBox++)
- {
- ppt->x = pBox->x1 + dx;
- ppt->y = pBox->y1 + dy;
- }
-
- /* Setup loop pointers again */
- pBoxDst = REGION_RECTS(prgnDst);
- ppt = pptSrc;
-
-#if 0
- ErrorF ("winCopyWindow - x1\tx2\ty1\ty2\tx\ty\n");
-#endif
-
- /* BitBlt each source to the destination point */
- for (i = nbox; --i >= 0; pBoxDst++, ppt++)
- {
-#if 0
- ErrorF ("winCopyWindow - %d\t%d\t%d\t%d\t%d\t%d\n",
- pBoxDst->x1, pBoxDst->x2, pBoxDst->y1, pBoxDst->y2,
- ppt->x, ppt->y);
-#endif
-
- BitBlt (pScreenPriv->hdcScreen,
- pBoxDst->x1, pBoxDst->y1,
- pBoxDst->x2 - pBoxDst->x1, pBoxDst->y2 - pBoxDst->y1,
- pScreenPriv->hdcScreen,
- ppt->x, ppt->y,
- SRCCOPY);
- }
-
- /* Cleanup the regions, etc. */
- DEALLOCATE_LOCAL(pptSrc);
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbChangeWindowAttributes() */
-
-Bool
-winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask)
-{
- ErrorF ("winChangeWindowAttributesNativeGDI ()\n");
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 37
- * Also referred to as UnrealizeWindow
- */
-
-Bool
-winUnmapWindowNativeGDI (WindowPtr pWindow)
-{
- ErrorF ("winUnmapWindowNativeGDI ()\n");
- /* This functions is empty in the CFB,
- * we probably won't need to do anything
- */
- return TRUE;
-}
-
-
-/* See Porting Layer Definition - p. 37
- * Also referred to as RealizeWindow
- */
-
-Bool
-winMapWindowNativeGDI (WindowPtr pWindow)
-{
- ErrorF ("winMapWindowNativeGDI ()\n");
- /* This function is empty in the CFB,
- * we probably won't need to do anything
- */
- return TRUE;
-
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbCreateWindow() */
-
-Bool
-winCreateWindowPRootless (WindowPtr pWin)
-{
- Bool fResult = FALSE;
- winWindowPriv(pWin);
-
-#if CYGDEBUG
- ErrorF ("winCreateWindowPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow(pWin);
-
- pWinPriv->hRgn = NULL;
-
- return fResult;
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbDestroyWindow() */
-
-Bool
-winDestroyWindowPRootless (WindowPtr pWin)
-{
- Bool fResult = FALSE;
- winWindowPriv(pWin);
-
-#if CYGDEBUG
- ErrorF ("winDestroyWindowPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow(pWin);
-
- if (pWinPriv->hRgn != NULL)
- {
- DeleteObject(pWinPriv->hRgn);
- pWinPriv->hRgn = NULL;
- }
-
- winUpdateRgnPRootless (pWin);
-
- return fResult;
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbPositionWindow() */
-
-Bool
-winPositionWindowPRootless (WindowPtr pWin, int x, int y)
-{
- Bool fResult = FALSE;
-
-#if CYGDEBUG
- ErrorF ("winPositionWindowPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow(pWin, x, y);
-
- winUpdateRgnPRootless (pWin);
-
- return fResult;
-}
-
-
-/* See Porting Layer Definition - p. 37 */
-/* See mfb/mfbwindow.c - mfbChangeWindowAttributes() */
-
-Bool
-winChangeWindowAttributesPRootless (WindowPtr pWin, unsigned long mask)
-{
- Bool fResult = FALSE;
-
-#if CYGDEBUG
- ErrorF ("winChangeWindowAttributesPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes(pWin, mask);
-
- winUpdateRgnPRootless (pWin);
-
- return fResult;
-}
-
-
-/* See Porting Layer Definition - p. 37
- * Also referred to as UnrealizeWindow
- */
-
-Bool
-winUnmapWindowPRootless (WindowPtr pWin)
-{
- Bool fResult = FALSE;
- winWindowPriv(pWin);
-
-#if CYGDEBUG
- ErrorF ("winUnmapWindowPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow(pWin);
-
- if (pWinPriv->hRgn != NULL)
- {
- DeleteObject(pWinPriv->hRgn);
- pWinPriv->hRgn = NULL;
- }
-
- winUpdateRgnPRootless (pWin);
-
- return fResult;
-}
-
-
-/* See Porting Layer Definition - p. 37
- * Also referred to as RealizeWindow
- */
-
-Bool
-winMapWindowPRootless (WindowPtr pWin)
-{
- Bool fResult = FALSE;
-
-#if CYGDEBUG
- ErrorF ("winMapWindowPRootless ()\n");
-#endif
-
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow(pWin);
-
- winReshapePRootless (pWin);
-
- winUpdateRgnPRootless (pWin);
-
- return fResult;
-}
-
-
-#ifdef SHAPE
-void
-winSetShapePRootless (WindowPtr pWin)
-{
-#if CYGDEBUG
- ErrorF ("winSetShapePRootless ()\n");
-#endif
-
- winGetScreenPriv(pWin->drawable.pScreen)->SetShape(pWin);
-
- winReshapePRootless (pWin);
- winUpdateRgnPRootless (pWin);
-
- return;
-}
-#endif
-
-
-/*
- * Local function for adding a region to the Windows window region
- */
-
-static
-int
-winAddRgn (WindowPtr pWin, pointer data)
-{
- int iX, iY, iWidth, iHeight, iBorder;
- HRGN hRgn = *(HRGN*)data;
- HRGN hRgnWin;
- winWindowPriv(pWin);
-
- /* If pWin is not Root */
- if (pWin->parent != NULL)
- {
-#if CYGDEBUG
- ErrorF ("winAddRgn ()\n");
-#endif
- if (pWin->mapped)
- {
- iBorder = wBorderWidth (pWin);
-
- iX = pWin->drawable.x - iBorder;
- iY = pWin->drawable.y - iBorder;
-
- iWidth = pWin->drawable.width + iBorder * 2;
- iHeight = pWin->drawable.height + iBorder * 2;
-
- hRgnWin = CreateRectRgn (0, 0, iWidth, iHeight);
-
- if (hRgnWin == NULL)
- {
- ErrorF ("winAddRgn - CreateRectRgn () failed\n");
- ErrorF (" Rect %d %d %d %d\n",
- iX, iY, iX + iWidth, iY + iHeight);
- }
-
- if (pWinPriv->hRgn)
- {
- if (CombineRgn (hRgnWin, hRgnWin, pWinPriv->hRgn, RGN_AND)
- == ERROR)
- {
- ErrorF ("winAddRgn - CombineRgn () failed\n");
- }
- }
-
- OffsetRgn (hRgnWin, iX, iY);
-
- if (CombineRgn (hRgn, hRgn, hRgnWin, RGN_OR) == ERROR)
- {
- ErrorF ("winAddRgn - CombineRgn () failed\n");
- }
-
- DeleteObject (hRgnWin);
- }
- return WT_DONTWALKCHILDREN;
- }
- else
- {
- return WT_WALKCHILDREN;
- }
-}
-
-
-/*
- * Local function to update the Windows window's region
- */
-
-static
-void
-winUpdateRgnPRootless (WindowPtr pWin)
-{
- HRGN hRgn = CreateRectRgn (0, 0, 0, 0);
-
- if (hRgn != NULL)
- {
- WalkTree (pWin->drawable.pScreen, winAddRgn, &hRgn);
- SetWindowRgn (winGetScreenPriv(pWin->drawable.pScreen)->hwndScreen,
- hRgn, TRUE);
- }
- else
- {
- ErrorF ("winUpdateRgnPRootless - CreateRectRgn failed.\n");
- }
-}
-
-
-#ifdef SHAPE
-static
-void
-winReshapePRootless (WindowPtr pWin)
-{
- int nRects;
-#if 0
- ScreenPtr pScreen = pWin->drawable.pScreen;
-#endif
- RegionRec rrNewShape;
- BoxPtr pShape, pRects, pEnd;
- HRGN hRgn, hRgnRect;
- winWindowPriv(pWin);
-
-#if CYGDEBUG
- ErrorF ("winReshapePRootless ()\n");
-#endif
-
- /* Bail if the window is the root window */
- if (pWin->parent == NULL)
- return;
-
- /* Bail if the window is not top level */
- if (pWin->parent->parent != NULL)
- return;
-
- /* Free any existing window region stored in the window privates */
- if (pWinPriv->hRgn != NULL)
- {
- DeleteObject (pWinPriv->hRgn);
- pWinPriv->hRgn = NULL;
- }
-
- /* Bail if the window has no bounding region defined */
- if (!wBoundingShape (pWin))
- return;
-
- REGION_NULL(pScreen, &rrNewShape);
- REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen, &rrNewShape, pWin->borderWidth,
- pWin->borderWidth);
-
- nRects = REGION_NUM_RECTS(&rrNewShape);
- pShape = REGION_RECTS(&rrNewShape);
-
- if (nRects > 0)
- {
- /* Create initial empty Windows region */
- hRgn = CreateRectRgn (0, 0, 0, 0);
-
- /* Loop through all rectangles in the X region */
- for (pRects = pShape, pEnd = pShape + nRects; pRects < pEnd; pRects++)
- {
- /* Create a Windows region for the X rectangle */
- hRgnRect = CreateRectRgn (pRects->x1, pRects->y1,
- pRects->x2, pRects->y2);
- if (hRgnRect == NULL)
- {
- ErrorF("winReshapePRootless - CreateRectRgn() failed\n");
- }
-
- /* Merge the Windows region with the accumulated region */
- if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
- {
- ErrorF("winReshapePRootless - CombineRgn() failed\n");
- }
-
- /* Delete the temporary Windows region */
- DeleteObject (hRgnRect);
- }
-
- /* Save a handle to the composite region in the window privates */
- pWinPriv->hRgn = hRgn;
- }
-
- REGION_UNINIT(pScreen, &rrNewShape);
-
- return;
-}
-#endif
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
deleted file mode 100644
index 8153b5600..000000000
--- a/hw/xwin/winwindow.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Kensuke Matsuzaki
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.h,v 1.4 2003/10/08 11:13:03 eich Exp $ */
-
-
-#ifndef _WINWINDOW_H_
-#define _WINWINDOW_H_
-
-#ifndef NO
-#define NO 0
-#endif
-#ifndef YES
-#define YES 1
-#endif
-
-/* Constant strings */
-#define WINDOW_CLASS "cygwin/xfree86"
-#define WINDOW_TITLE "Cygwin/XFree86 - %s:%d"
-#define WINDOW_TITLE_XDMCP "Cygwin/XFree86 - %s"
-#define WIN_SCR_PROP "cyg_screen_prop rl"
-#define WINDOW_CLASS_X "cygwin/xfree86 X rl"
-#define WINDOW_TITLE_X "Cygwin/XFree86 X"
-#define WIN_WINDOW_PROP "cyg_window_prop_rl"
-#define WIN_MSG_QUEUE_FNAME "/dev/windows"
-#define WIN_LOG_FNAME "/tmp/XWin.log"
-#define WIN_WID_PROP "cyg_wid_prop_rl"
-#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
-#define WIN_HWND_CACHE "cyg_privmap_rl"
-#define CYGMULTIWINDOW_DEBUG NO
-
-typedef struct _winPrivScreenRec *winPrivScreenPtr;
-
-
-/*
- * Window privates
- */
-
-typedef struct
-{
- DWORD dwDummy;
- HRGN hRgn;
- HWND hWnd;
- winPrivScreenPtr pScreenPriv;
- int iX;
- int iY;
- int iWidth;
- int iHeight;
- Bool fXKilled;
- Bool fNeedRestore;
- POINT ptRestore;
-} winPrivWinRec, *winPrivWinPtr;
-
-typedef struct _winWMMessageRec{
- DWORD dwID;
- DWORD msg;
- int iWindow;
- HWND hwndWindow;
- int iX, iY;
- int iWidth, iHeight;
-} winWMMessageRec, *winWMMessagePtr;
-
-
-/*
- * winrootlesswm.c
- */
-
-#define WM_WM_MOVE (WM_USER + 1)
-#define WM_WM_SIZE (WM_USER + 2)
-#define WM_WM_RAISE (WM_USER + 3)
-#define WM_WM_LOWER (WM_USER + 4)
-#define WM_WM_MAP (WM_USER + 5)
-#define WM_WM_UNMAP (WM_USER + 6)
-#define WM_WM_KILL (WM_USER + 7)
-#define WM_WM_ACTIVATE (WM_USER + 8)
-#define WM_WM_NAME_EVENT (WM_USER + 9)
-#define WM_WM_HINTS_EVENT (WM_USER + 10)
-#define WM_WM_CHANGE_STATE (WM_USER + 11)
-
-
-/*
- * winmultiwindowwm.c
- */
-
-void
-winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
-
-Bool
-winInitWM (void **ppWMInfo,
- pthread_t *ptWMProc,
- pthread_t *ptXMsgProc,
- pthread_mutex_t *ppmServerStarted,
- int dwScreen);
-
-void
-winDeinitMultiWindowWM ();
-
-void
-winMinimizeWindow (Window id);
-
-
-/*
- * winmultiwindowicons.c
- */
-
-void
-winUpdateIcon (Window id);
-
-#endif
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
deleted file mode 100644
index 5b47a212a..000000000
--- a/hw/xwin/winwndproc.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- * MATSUZAKI Kensuke
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.26 2003/10/02 13:30:11 eich Exp $ */
-
-#include "win.h"
-#include <commctrl.h>
-#include "winprefs.h"
-
-/*
- * Global variables
- */
-
-Bool g_fCursor = TRUE;
-
-
-
-/*
- * Called by winWakeupHandler
- * Processes current Windows message
- */
-
-LRESULT CALLBACK
-winWindowProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- static winPrivScreenPtr s_pScreenPriv = NULL;
- static winScreenInfo *s_pScreenInfo = NULL;
- static ScreenPtr s_pScreen = NULL;
- static HWND s_hwndLastPrivates = NULL;
- static HINSTANCE s_hInstance;
- static Bool s_fTracking = FALSE;
- static unsigned long s_ulServerGeneration = 0;
- int iScanCode;
- int i;
-
- /* Watch for server regeneration */
- if (g_ulServerGeneration != s_ulServerGeneration)
- {
- /* Store new server generation */
- s_ulServerGeneration = g_ulServerGeneration;
- }
-
- /* Only retrieve new privates pointers if window handle is null or changed */
- if ((s_pScreenPriv == NULL || hwnd != s_hwndLastPrivates)
- && (s_pScreenPriv = GetProp (hwnd, WIN_SCR_PROP)) != NULL)
- {
-#if CYGDEBUG
- ErrorF ("winWindowProc - Setting privates handle\n");
-#endif
- s_pScreenInfo = s_pScreenPriv->pScreenInfo;
- s_pScreen = s_pScreenInfo->pScreen;
- s_hwndLastPrivates = hwnd;
- }
- else if (s_pScreenPriv == NULL)
- {
- /* For safety, handle case that should never happen */
- s_pScreenInfo = NULL;
- s_pScreen = NULL;
- s_hwndLastPrivates = NULL;
- }
-
- /* Branch on message type */
- switch (message)
- {
- case WM_TRAYICON:
- return winHandleIconMessage (hwnd, message, wParam, lParam,
- s_pScreenPriv);
-
- case WM_CREATE:
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_CREATE\n");
-#endif
-
- /*
- * Add a property to our display window that references
- * this screens' privates.
- *
- * This allows the window procedure to refer to the
- * appropriate window DC and shadow DC for the window that
- * it is processing. We use this to repaint exposed
- * areas of our display window.
- */
- s_pScreenPriv = ((LPCREATESTRUCT) lParam)->lpCreateParams;
- s_hInstance = ((LPCREATESTRUCT) lParam)->hInstance;
- s_pScreenInfo = s_pScreenPriv->pScreenInfo;
- s_pScreen = s_pScreenInfo->pScreen;
- s_hwndLastPrivates = hwnd;
- SetProp (hwnd, WIN_SCR_PROP, s_pScreenPriv);
-
- /* Store the mode key states so restore doesn't try to restore them */
- winStoreModeKeyStates (s_pScreen);
-
- /* Setup tray icon */
- if (!s_pScreenInfo->fNoTrayIcon)
- {
- /*
- * NOTE: The WM_CREATE message is processed before CreateWindowEx
- * returns, so s_pScreenPriv->hwndScreen is invalid at this point.
- * We go ahead and copy our hwnd parameter over top of the screen
- * privates hwndScreen so that we have a valid value for
- * that member. Otherwise, the tray icon will disappear
- * the first time you move the mouse over top of it.
- */
-
- s_pScreenPriv->hwndScreen = hwnd;
-
- winInitNotifyIcon (s_pScreenPriv);
- }
- return 0;
-
- case WM_DISPLAYCHANGE:
- /* We cannot handle a display mode change during initialization */
- if (s_pScreenInfo == NULL)
- FatalError ("winWindowProc - WM_DISPLAYCHANGE - The display "
- "mode changed while we were intializing. This is "
- "very bad and unexpected. Exiting.\n");
-
- /*
- * We do not care about display changes with
- * fullscreen DirectDraw engines, because those engines set
- * their own mode when they become active.
- */
- if (s_pScreenInfo->fFullScreen
- && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
- || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
- || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD))
- {
- /*
- * Store the new display dimensions and depth.
- * We do this here for future compatibility in case we
- * ever allow switching from fullscreen to windowed mode.
- */
- s_pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
- s_pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
- s_pScreenPriv->dwLastWindowsBitsPixel
- = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL);
- break;
- }
-
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - orig bpp: %d, last bpp: %d, "
- "new bpp: %d\n",
- s_pScreenInfo->dwBPP,
- s_pScreenPriv->dwLastWindowsBitsPixel,
- wParam);
-
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - new width: %d "
- "new height: %d\n",
- LOWORD (lParam), HIWORD (lParam));
-
- /*
- * TrueColor --> TrueColor depth changes are disruptive for:
- * Windowed:
- * Shadow DirectDraw
- * Shadow DirectDraw Non-Locking
- * Primary DirectDraw
- *
- * TrueColor --> TrueColor depth changes are non-optimal for:
- * Windowed:
- * Shadow GDI
- *
- * FullScreen:
- * Shadow GDI
- *
- * TrueColor --> PseudoColor or vice versa are disruptive for:
- * Windowed:
- * Shadow DirectDraw
- * Shadow DirectDraw Non-Locking
- * Primary DirectDraw
- * Shadow GDI
- */
-
- /*
- * Check for a disruptive change in depth.
- * We can only display a message for a disruptive depth change,
- * we cannot do anything to correct the situation.
- */
- if ((s_pScreenInfo->dwBPP != wParam)
- && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
- || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
- || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD))
- {
- /* Cannot display the visual until the depth is restored */
- ErrorF ("winWindowProc - Disruptive change in depth\n");
-
- /* Display Exit dialog */
- winDisplayDepthChangeDialog (s_pScreenPriv);
-
- /* Flag that we have an invalid screen depth */
- s_pScreenPriv->fBadDepth = TRUE;
-
- /* Minimize the display window */
- ShowWindow (hwnd, SW_MINIMIZE);
- }
- else
- {
- /* Flag that we have a valid screen depth */
- s_pScreenPriv->fBadDepth = FALSE;
- }
-
- /*
- * Check for a change in display dimensions.
- * We can simply recreate the same-sized primary surface when
- * the display dimensions change.
- */
- if (s_pScreenPriv->dwLastWindowsWidth != LOWORD (lParam)
- || s_pScreenPriv->dwLastWindowsHeight != HIWORD (lParam))
- {
- /*
- * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface
- * and CreatePrimarySurface function pointers to point
- * to the no operation function, NoopDDA. This allows us
- * to blindly call these functions, even if they are not
- * relevant to the current engine (e.g., Shadow GDI).
- */
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Dimensions changed\n");
-#endif
-
- /* Release the old primary surface */
- (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen);
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Released "
- "primary surface\n");
-#endif
-
- /* Create the new primary surface */
- (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen);
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Recreated "
- "primary surface\n");
-#endif
- }
- else
- {
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Dimensions did not "
- "change\n");
-#endif
- }
-
- /* Store the new display dimensions and depth */
- s_pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
- s_pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
- s_pScreenPriv->dwLastWindowsBitsPixel
- = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL);
- break;
-
- case WM_SIZE:
- {
- SCROLLINFO si;
- RECT rcWindow;
- int iWidth, iHeight;
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_SIZE\n");
-#endif
-
- /* Break if we do not use scrollbars */
- if (!s_pScreenInfo->fScrollbars
- || !s_pScreenInfo->fDecoration
- || s_pScreenInfo->fRootless
- || s_pScreenInfo->fMultiWindow
- || s_pScreenInfo->fFullScreen)
- break;
-
- /* No need to resize if we get minimized */
- if (wParam == SIZE_MINIMIZED)
- return 0;
-
- /*
- * Get the size of the whole window, including client area,
- * scrollbars, and non-client area decorations (caption, borders).
- * We do this because we need to check if the client area
- * without scrollbars is large enough to display the whole visual.
- * The new client area size passed by lParam already subtracts
- * the size of the scrollbars if they are currently displayed.
- * So checking is LOWORD(lParam) == visual_width and
- * HIWORD(lParam) == visual_height will never tell us to hide
- * the scrollbars because the client area would always be too small.
- * GetClientRect returns the same sizes given by lParam, so we
- * cannot use GetClientRect either.
- */
- GetWindowRect (hwnd, &rcWindow);
- iWidth = rcWindow.right - rcWindow.left;
- iHeight = rcWindow.bottom - rcWindow.top;
-
- ErrorF ("winWindowProc - WM_SIZE - window w: %d h: %d, "
- "new client area w: %d h: %d\n",
- iWidth, iHeight, LOWORD (lParam), HIWORD (lParam));
-
- /* Subtract the frame size from the window size. */
- iWidth -= 2 * GetSystemMetrics (SM_CXSIZEFRAME);
- iHeight -= (2 * GetSystemMetrics (SM_CYSIZEFRAME)
- + GetSystemMetrics (SM_CYCAPTION));
-
- /*
- * Update scrollbar page sizes.
- * NOTE: If page size == range, then the scrollbar is
- * automatically hidden.
- */
-
- /* Is the naked client area large enough to show the whole visual? */
- if (iWidth < s_pScreenInfo->dwWidth
- || iHeight < s_pScreenInfo->dwHeight)
- {
- /* Client area too small to display visual, use scrollbars */
- iWidth -= GetSystemMetrics (SM_CXVSCROLL);
- iHeight -= GetSystemMetrics (SM_CYHSCROLL);
- }
-
- /* Set the horizontal scrollbar page size */
- si.cbSize = sizeof (si);
- si.fMask = SIF_PAGE | SIF_RANGE;
- si.nMin = 0;
- si.nMax = s_pScreenInfo->dwWidth - 1;
- si.nPage = iWidth;
- SetScrollInfo (hwnd, SB_HORZ, &si, TRUE);
-
- /* Set the vertical scrollbar page size */
- si.cbSize = sizeof (si);
- si.fMask = SIF_PAGE | SIF_RANGE;
- si.nMin = 0;
- si.nMax = s_pScreenInfo->dwHeight - 1;
- si.nPage = iHeight;
- SetScrollInfo (hwnd, SB_VERT, &si, TRUE);
-
- /*
- * NOTE: Scrollbars may have moved if they were at the
- * far right/bottom, so we query their current position.
- */
-
- /* Get the horizontal scrollbar position and set the offset */
- si.cbSize = sizeof (si);
- si.fMask = SIF_POS;
- GetScrollInfo (hwnd, SB_HORZ, &si);
- s_pScreenInfo->dwXOffset = -si.nPos;
-
- /* Get the vertical scrollbar position and set the offset */
- si.cbSize = sizeof (si);
- si.fMask = SIF_POS;
- GetScrollInfo (hwnd, SB_VERT, &si);
- s_pScreenInfo->dwYOffset = -si.nPos;
- }
- return 0;
-
- case WM_VSCROLL:
- {
- SCROLLINFO si;
- int iVertPos;
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_VSCROLL\n");
-#endif
-
- /* Get vertical scroll bar info */
- si.cbSize = sizeof (si);
- si.fMask = SIF_ALL;
- GetScrollInfo (hwnd, SB_VERT, &si);
-
- /* Save the vertical position for comparison later */
- iVertPos = si.nPos;
-
- /*
- * Don't forget:
- * moving the scrollbar to the DOWN, scroll the content UP
- */
- switch (LOWORD(wParam))
- {
- case SB_TOP:
- si.nPos = si.nMin;
- break;
-
- case SB_BOTTOM:
- si.nPos = si.nMax - si.nPage + 1;
- break;
-
- case SB_LINEUP:
- si.nPos -= 1;
- break;
-
- case SB_LINEDOWN:
- si.nPos += 1;
- break;
-
- case SB_PAGEUP:
- si.nPos -= si.nPage;
- break;
-
- case SB_PAGEDOWN:
- si.nPos += si.nPage;
- break;
-
- case SB_THUMBTRACK:
- si.nPos = si.nTrackPos;
- break;
-
- default:
- break;
- }
-
- /*
- * We retrieve the position after setting it,
- * because Windows may adjust it.
- */
- si.fMask = SIF_POS;
- SetScrollInfo (hwnd, SB_VERT, &si, TRUE);
- GetScrollInfo (hwnd, SB_VERT, &si);
-
- /* Scroll the window if the position has changed */
- if (si.nPos != iVertPos)
- {
- /* Save the new offset for bit block transfers, etc. */
- s_pScreenInfo->dwYOffset = -si.nPos;
-
- /* Change displayed region in the window */
- ScrollWindowEx (hwnd,
- 0,
- iVertPos - si.nPos,
- NULL,
- NULL,
- NULL,
- NULL,
- SW_INVALIDATE);
-
- /* Redraw the window contents */
- UpdateWindow (hwnd);
- }
- }
- return 0;
-
- case WM_HSCROLL:
- {
- SCROLLINFO si;
- int iHorzPos;
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_HSCROLL\n");
-#endif
-
- /* Get horizontal scroll bar info */
- si.cbSize = sizeof (si);
- si.fMask = SIF_ALL;
- GetScrollInfo (hwnd, SB_HORZ, &si);
-
- /* Save the horizontal position for comparison later */
- iHorzPos = si.nPos;
-
- /*
- * Don't forget:
- * moving the scrollbar to the RIGHT, scroll the content LEFT
- */
- switch (LOWORD(wParam))
- {
- case SB_LEFT:
- si.nPos = si.nMin;
- break;
-
- case SB_RIGHT:
- si.nPos = si.nMax - si.nPage + 1;
- break;
-
- case SB_LINELEFT:
- si.nPos -= 1;
- break;
-
- case SB_LINERIGHT:
- si.nPos += 1;
- break;
-
- case SB_PAGELEFT:
- si.nPos -= si.nPage;
- break;
-
- case SB_PAGERIGHT:
- si.nPos += si.nPage;
- break;
-
- case SB_THUMBTRACK:
- si.nPos = si.nTrackPos;
- break;
-
- default:
- break;
- }
-
- /*
- * We retrieve the position after setting it,
- * because Windows may adjust it.
- */
- si.fMask = SIF_POS;
- SetScrollInfo (hwnd, SB_HORZ, &si, TRUE);
- GetScrollInfo (hwnd, SB_HORZ, &si);
-
- /* Scroll the window if the position has changed */
- if (si.nPos != iHorzPos)
- {
- /* Save the new offset for bit block transfers, etc. */
- s_pScreenInfo->dwXOffset = -si.nPos;
-
- /* Change displayed region in the window */
- ScrollWindowEx (hwnd,
- iHorzPos - si.nPos,
- 0,
- NULL,
- NULL,
- NULL,
- NULL,
- SW_INVALIDATE);
-
- /* Redraw the window contents */
- UpdateWindow (hwnd);
- }
- }
- return 0;
-
- case WM_GETMINMAXINFO:
- {
- MINMAXINFO *pMinMaxInfo = (MINMAXINFO *) lParam;
- int iCaptionHeight;
- int iBorderHeight, iBorderWidth;
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_GETMINMAXINFO - pScreenInfo: %08x\n",
- s_pScreenInfo);
-#endif
-
- /* Can't do anything without screen info */
- if (s_pScreenInfo == NULL
- || !s_pScreenInfo->fScrollbars
- || s_pScreenInfo->fFullScreen
- || !s_pScreenInfo->fDecoration
- || s_pScreenInfo->fRootless
- || s_pScreenInfo->fMultiWindow)
- break;
-
- /*
- * Here we can override the maximum tracking size, which
- * is the largest size that can be assigned to our window
- * via the sizing border.
- */
-
- /*
- * FIXME: Do we only need to do this once, since our visual size
- * does not change? Does Windows store this value statically
- * once we have set it once?
- */
-
- /* Get the border and caption sizes */
- iCaptionHeight = GetSystemMetrics (SM_CYCAPTION);
- iBorderWidth = 2 * GetSystemMetrics (SM_CXSIZEFRAME);
- iBorderHeight = 2 * GetSystemMetrics (SM_CYSIZEFRAME);
-
- /* Allow the full visual to be displayed */
- pMinMaxInfo->ptMaxTrackSize.x
- = s_pScreenInfo->dwWidth + iBorderWidth;
- pMinMaxInfo->ptMaxTrackSize.y
- = s_pScreenInfo->dwHeight + iBorderHeight + iCaptionHeight;
- }
- return 0;
-
- case WM_ERASEBKGND:
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_ERASEBKGND\n");
-#endif
- /*
- * Pretend that we did erase the background but we don't care,
- * the application uses the full window estate. This avoids some
- * flickering when resizing.
- */
- return TRUE;
-
- case WM_PAINT:
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_PAINT\n");
-#endif
- /* Only paint if we have privates and the server is enabled */
- if (s_pScreenPriv == NULL
- || !s_pScreenPriv->fEnabled
- || (s_pScreenInfo->fFullScreen && !s_pScreenPriv->fActive)
- || s_pScreenPriv->fBadDepth)
- {
- /* We don't want to paint */
- break;
- }
-
- /* Break out here if we don't have a valid paint routine */
- if (s_pScreenPriv->pwinBltExposedRegions == NULL)
- break;
-
- /* Call the engine dependent repainter */
- (*s_pScreenPriv->pwinBltExposedRegions) (s_pScreen);
- return 0;
-
- case WM_PALETTECHANGED:
- {
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_PALETTECHANGED\n");
-#endif
- /*
- * Don't process if we don't have privates or a colormap,
- * or if we have an invalid depth.
- */
- if (s_pScreenPriv == NULL
- || s_pScreenPriv->pcmapInstalled == NULL
- || s_pScreenPriv->fBadDepth)
- break;
-
- /* Return if we caused the palette to change */
- if ((HWND) wParam == hwnd)
- {
- /* Redraw the screen */
- (*s_pScreenPriv->pwinRedrawScreen) (s_pScreen);
- return 0;
- }
-
- /* Reinstall the windows palette */
- (*s_pScreenPriv->pwinRealizeInstalledPalette) (s_pScreen);
-
- /* Redraw the screen */
- (*s_pScreenPriv->pwinRedrawScreen) (s_pScreen);
- return 0;
- }
-
- case WM_MOUSEMOVE:
- /* We can't do anything without privates */
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Has the mouse pointer crossed screens? */
- if (s_pScreen != miPointerCurrentScreen ())
- miPointerSetNewScreen (s_pScreenInfo->dwScreen,
- GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
- GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
-
- /* Are we tracking yet? */
- if (!s_fTracking)
- {
- TRACKMOUSEEVENT tme;
-
- /* Setup data structure */
- ZeroMemory (&tme, sizeof (tme));
- tme.cbSize = sizeof (tme);
- tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = hwnd;
-
- /* Call the tracking function */
- if (!(*g_fpTrackMouseEvent) (&tme))
- ErrorF ("winWindowProc - _TrackMouseEvent failed\n");
-
- /* Flag that we are tracking now */
- s_fTracking = TRUE;
- }
-
- /* Hide or show the Windows mouse cursor */
- if (g_fCursor && (s_pScreenPriv->fActive || s_pScreenInfo->fLessPointer))
- {
- /* Hide Windows cursor */
- g_fCursor = FALSE;
- ShowCursor (FALSE);
- }
- else if (!g_fCursor && !s_pScreenPriv->fActive
- && !s_pScreenInfo->fLessPointer)
- {
- /* Show Windows cursor */
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
-
- /* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
- GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset,
- g_c32LastInputEventTime = GetTickCount ());
- return 0;
-
- case WM_NCMOUSEMOVE:
- /*
- * We break instead of returning 0 since we need to call
- * DefWindowProc to get the mouse cursor changes
- * and min/max/close button highlighting in Windows XP.
- * The Platform SDK says that you should return 0 if you
- * process this message, but it fails to mention that you
- * will give up any default functionality if you do return 0.
- */
-
- /* We can't do anything without privates */
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Non-client mouse movement, show Windows cursor */
- if (!g_fCursor)
- {
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
- break;
-
- case WM_MOUSELEAVE:
- /* Mouse has left our client area */
-
- /* Flag that we are no longer tracking */
- s_fTracking = FALSE;
-
- /* Show the mouse cursor, if necessary */
- if (!g_fCursor)
- {
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
- return 0;
-
- case WM_LBUTTONDBLCLK:
- case WM_LBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
-
- case WM_LBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
-
- case WM_MBUTTONDBLCLK:
- case WM_MBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
-
- case WM_MBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
-
- case WM_RBUTTONDBLCLK:
- case WM_RBUTTONDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
-
- case WM_RBUTTONUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
- if (s_pScreenInfo->fRootless) ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
-
- case WM_TIMER:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Branch on the timer id */
- switch (wParam)
- {
- case WIN_E3B_TIMER_ID:
- /* Send delayed button press */
- winMouseButtonsSendEvent (ButtonPress,
- s_pScreenPriv->iE3BCachedPress);
-
- /* Kill this timer */
- KillTimer (s_pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
-
- /* Clear screen privates flags */
- s_pScreenPriv->iE3BCachedPress = 0;
- break;
-
- case WIN_POLLING_MOUSE_TIMER_ID:
- {
- POINT point;
-
- /* Get the current position of the mouse cursor */
- GetCursorPos (&point);
-
- /* Map from screen (-X, -Y) to root (0, 0) */
- point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
- point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
-
- /* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (point.x, point.y,
- g_c32LastInputEventTime = GetTickCount());
- }
- }
- return 0;
-
- case WM_CTLCOLORSCROLLBAR:
- FatalError ("winWindowProc - WM_CTLCOLORSCROLLBAR - We are not "
- "supposed to get this message. Exiting.\n");
- return 0;
-
- case WM_MOUSEWHEEL:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_MOUSEWHEEL\n");
-#endif
- winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam));
- break;
-
- case WM_SETFOCUS:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Restore the state of all mode keys */
- winRestoreModeKeyStates (s_pScreen);
- return 0;
-
- case WM_KILLFOCUS:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Store the state of all mode keys */
- winStoreModeKeyStates (s_pScreen);
-
- /* Release any pressed keys */
- winKeybdReleaseKeys ();
- return 0;
-
-#if WIN_NEW_KEYBOARD_SUPPORT
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- case WM_SYSKEYUP:
- case WM_KEYUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* Don't process keys if we are not active */
- if (!s_pScreenPriv->fActive)
- return 0;
-
- winProcessKeyEvent ((DWORD)wParam, (DWORD) lParam);
- return 0;
-
- case WM_DEADCHAR:
- case WM_SYSDEADCHAR:
- return 0;
-
-#else /* WIN_NEW_KEYBOARD_SUPPORT */
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /*
- * FIXME: Catching Alt-F4 like this is really terrible. This should
- * be generalized to handle other Windows keyboard signals. Actually,
- * the list keys to catch and the actions to perform when caught should
- * be configurable; that way user's can customize the keys that they
- * need to have passed through to their window manager or apps, or they
- * can remap certain actions to new key codes that do not conflict
- * with the X apps that they are using. Yeah, that'll take awhile.
- */
- if ((s_pScreenInfo->fUseWinKillKey && wParam == VK_F4
- && (GetKeyState (VK_MENU) & 0x8000))
- || (s_pScreenInfo->fUseUnixKillKey && wParam == VK_BACK
- && (GetKeyState (VK_MENU) & 0x8000)
- && (GetKeyState (VK_CONTROL) & 0x8000)))
- {
- /*
- * Better leave this message here, just in case some unsuspecting
- * user enters Alt + F4 and is surprised when the application
- * quits.
- */
- ErrorF ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n");
-
- /* Display Exit dialog */
- winDisplayExitDialog (s_pScreenPriv);
- return 0;
- }
-
- /*
- * Don't do anything for the Windows keys, as focus will soon
- * be returned to Windows. We may be able to trap the Windows keys,
- * but we should determine if that is desirable before doing so.
- */
- if (wParam == VK_LWIN || wParam == VK_RWIN)
- break;
-
- /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */
- if (winIsFakeCtrl_L (message, wParam, lParam))
- return 0;
-
- /* Send the key event(s) */
- winTranslateKey (wParam, lParam, &iScanCode);
- for (i = 0; i < LOWORD(lParam); ++i)
- winSendKeyEvent (iScanCode, TRUE);
- return 0;
-
- case WM_SYSKEYUP:
- case WM_KEYUP:
- if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
- break;
-
- /*
- * Don't do anything for the Windows keys, as focus will soon
- * be returned to Windows. We may be able to trap the Windows keys,
- * but we should determine if that is desirable before doing so.
- */
- if (wParam == VK_LWIN || wParam == VK_RWIN)
- break;
-
- /* Ignore the fake Ctrl_L that follows an AltGr release */
- if (winIsFakeCtrl_L (message, wParam, lParam))
- return 0;
-
- /* Enqueue a keyup event */
- winTranslateKey (wParam, lParam, &iScanCode);
- winSendKeyEvent (iScanCode, FALSE);
- return 0;
-#endif /* WIN_NEW_KEYBOARD_SUPPORT */
-
- case WM_HOTKEY:
- if (s_pScreenPriv == NULL)
- break;
-
- /* Call the engine-specific hot key handler */
- (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen);
- return 0;
-
- case WM_ACTIVATE:
- if (s_pScreenPriv == NULL
- || s_pScreenInfo->fIgnoreInput)
- break;
-
- /* TODO: Override display of window when we have a bad depth */
- if (LOWORD(wParam) != WA_INACTIVE && s_pScreenPriv->fBadDepth)
- {
- ErrorF ("winWindowProc - WM_ACTIVATE - Bad depth, trying "
- "to override window activation\n");
-
- /* Minimize the window */
- ShowWindow (hwnd, SW_MINIMIZE);
-
- /* Display dialog box */
- if (g_hDlgDepthChange != NULL)
- {
- /* Make the existing dialog box active */
- SetActiveWindow (g_hDlgDepthChange);
- }
- else
- {
- /* TODO: Recreate the dialog box and bring to the top */
- ShowWindow (g_hDlgDepthChange, SW_SHOWDEFAULT);
- }
-
- /* Don't do any other processing of this message */
- return 0;
- }
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_ACTIVATE\n");
-#endif
-
- /*
- * Focus is being changed to another window.
- * The other window may or may not belong to
- * our process.
- */
-
- /* Clear any lingering wheel delta */
- s_pScreenPriv->iDeltaZ = 0;
-
- /* Reshow the Windows mouse cursor if we are being deactivated */
- if (LOWORD(wParam) == WA_INACTIVE
- && !g_fCursor)
- {
- /* Show Windows cursor */
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
- return 0;
-
- case WM_ACTIVATEAPP:
- if (s_pScreenPriv == NULL
- || s_pScreenInfo->fIgnoreInput)
- break;
-
-#if CYGDEBUG
- ErrorF ("winWindowProc - WM_ACTIVATEAPP\n");
-#endif
-
- /* Activate or deactivate */
- s_pScreenPriv->fActive = wParam;
-
- /* Reshow the Windows mouse cursor if we are being deactivated */
- if (!s_pScreenPriv->fActive
- && !g_fCursor)
- {
- /* Show Windows cursor */
- g_fCursor = TRUE;
- ShowCursor (TRUE);
- }
-
- /* Call engine specific screen activation/deactivation function */
- (*s_pScreenPriv->pwinActivateApp) (s_pScreen);
- return 0;
-
- case WM_COMMAND:
- switch (LOWORD (wParam))
- {
- case ID_APP_EXIT:
- /* Display Exit dialog */
- winDisplayExitDialog (s_pScreenPriv);
- return 0;
-
- case ID_APP_HIDE_ROOT:
- ShowWindow (s_pScreenPriv->hwndScreen, SW_HIDE);
- s_pScreenPriv->fRootWindowShown = FALSE;
- return 0;
-
- case ID_APP_SHOW_ROOT:
- ShowWindow (s_pScreenPriv->hwndScreen, SW_SHOW);
- s_pScreenPriv->fRootWindowShown = TRUE;
- return 0;
-
- default:
- /* It's probably one of the custom menus... */
- return HandleCustomWM_COMMAND (0, LOWORD (wParam));
-
- }
- break;
-
- case WM_GIVEUP:
- /* Tell X that we are giving up */
- winDeinitClipboard ();
- winDeinitMultiWindowWM ();
- GiveUp (0);
- return 0;
-
- case WM_CLOSE:
- /* Display Exit dialog */
- winDisplayExitDialog (s_pScreenPriv);
- return 0;
- }
-
- return DefWindowProc (hwnd, message, wParam, lParam);
-}
diff --git a/ilbm/README b/ilbm/README
deleted file mode 100644
index 650d6b803..000000000
--- a/ilbm/README
+++ /dev/null
@@ -1,17 +0,0 @@
-
- ilbm -- Interleaved bitplanes for Amiga
- © Copyright 1995 by Geert Uytterhoeven and Others (read the sources)
-
-All stuff in this directory is based on Xdaniver, which is based on mfb (read
-../afb/Xdaniver.doc).
-
-I made changes to support the interleaved mode of the Linux/68k Amiga Color
-Frame Buffer Device, which uses interleaved bitplanes instead of normal
-bitplanes.
-
-Note: there are still some annoying bugs left in ilbmimage.
-
---
-Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be
-Wavelets, Linux/m68k on Amiga http://www.cs.kuleuven.ac.be/~geert/
-Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
diff --git a/ilbm/ilbm.h b/ilbm/ilbm.h
deleted file mode 100644
index cb4ee6be4..000000000
--- a/ilbm/ilbm.h
+++ /dev/null
@@ -1,1047 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbm.h,v 3.3 2003/11/17 22:20:43 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbm.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */
-/* Monochrome Frame Buffer definitions
- written by drewry, september 1986
-*/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "pixmap.h"
-#include "region.h"
-#include "gc.h"
-#include "colormap.h"
-#include "miscstruct.h"
-#include "mibstore.h"
-
-extern int ilbmInverseAlu[];
-extern int ilbmScreenPrivateIndex;
-/* warning: PixelType definition duplicated in maskbits.h */
-#ifndef PixelType
-#define PixelType unsigned long
-#endif /* PixelType */
-
-#define AFB_MAX_DEPTH 8
-
-/* ilbmbitblt.c */
-
-extern void ilbmDoBitblt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-extern RegionPtr ilbmBitBlt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (*doBitBlt)(),
- unsigned long /*planemask*/
-);
-
-extern RegionPtr ilbmCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-extern RegionPtr ilbmCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/
-);
-
-extern void ilbmCopy1ToN(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbltC.c */
-
-extern void ilbmDoBitbltCopy(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbltCI.c */
-
-extern void ilbmDoBitbltCopyInverted(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbltG.c */
-
-extern void ilbmDoBitbltGeneral(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbltO.c */
-
-extern void ilbmDoBitbltOr(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbltX.c */
-
-extern void ilbmDoBitbltXor(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* ilbmbres.c */
-
-extern void ilbmBresS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-/* ilbmbresd.c */
-
-extern void ilbmBresD(
- int * /*pdashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pdashOffset*/,
- int /*isDoubleDash*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/,
- unsigned char * /*rrops*/,
- unsigned char * /*bgrrops*/
-);
-/* ilbmbstore.c */
-
-extern void ilbmSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void ilbmRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-/* ilbmclip.c */
-
-extern RegionPtr ilbmPixmapToRegion(
- PixmapPtr /*pPix*/
-);
-
-/* ilbmcmap.c */
-
-extern Bool ilbmInitializeColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void ilbmResolveColor(
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/,
- VisualPtr /*pVisual*/
-);
-
-extern Bool ilbmSetVisualTypes(
- int /*depth*/,
- int /*visuals*/,
- int /*bitsPerRGB*/
-);
-
-/* ilbmfillarc.c */
-
-extern void ilbmPolyFillArcSolid(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* ilbmfillrct.c */
-
-extern void ilbmPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-
-/* ilbmply1rct.c */
-extern void ilbmFillPolygonSolid(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*shape*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-
-/* ilbmfillsp.c */
-
-extern void ilbmSolidFS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmUnnaturalTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmUnnaturalStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmOpaqueStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ilbmUnnaturalOpaqueStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-/* ilbmfont.c */
-
-extern Bool ilbmRealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-
-extern Bool ilbmUnrealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-/* ilbmgc.c */
-
-extern Bool ilbmCreateGC(
- GCPtr /*pGC*/
-);
-
-extern void ilbmValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-extern void ilbmDestroyGC(
- GCPtr /*pGC*/
-);
-
-extern void ilbmReduceRop(
- int /*alu*/,
- Pixel /*src*/,
- unsigned long /*planemask*/,
- int /*depth*/,
- unsigned char * /*rrops*/
-);
-
-extern void ilbmReduceOpaqueStipple (
- Pixel /*fg*/,
- Pixel /*bg*/,
- unsigned long /*planemask*/,
- int /*depth*/,
- unsigned char * /*rrops*/
-);
-
-extern void ilbmComputeCompositeClip(
- GCPtr /*pGC*/,
- DrawablePtr /*pDrawable*/
-);
-
-/* ilbmgetsp.c */
-
-extern void ilbmGetSpans(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/
-);
-/* ilbmhrzvert.c */
-
-extern int ilbmHorzS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-
-extern int ilbmVertS(
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/,
- unsigned char * /*rrops*/
-);
-/* ilbmigbblak.c */
-
-extern void ilbmImageGlyphBlt (
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* ilbmigbwht.c */
-
-/* ilbmimage.c */
-
-extern void ilbmPutImage(
- DrawablePtr /*dst*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-extern void ilbmGetImage(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-/* ilbmline.c */
-
-extern void ilbmLineSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void ilbmLineSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-/* ilbmmisc.c */
-
-extern void ilbmQueryBestSize(
- int /*class*/,
- unsigned short * /*pwidth*/,
- unsigned short * /*pheight*/,
- ScreenPtr /*pScreen*/
-);
-/* ilbmpntarea.c */
-
-extern void ilbmSolidFillArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- unsigned char * /*rrops*/
-);
-
-extern void ilbmStippleAreaPPW(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- PixmapPtr /*pstipple*/,
- unsigned char * /*rrops*/
-);
-extern void ilbmStippleArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- PixmapPtr /*pstipple*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char * /*rrops*/
-);
-/* ilbmplygblt.c */
-
-extern void ilbmPolyGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-
-/* ilbmpixmap.c */
-
-extern PixmapPtr ilbmCreatePixmap(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/
-);
-
-extern Bool ilbmDestroyPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern PixmapPtr ilbmCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void ilbmPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern void ilbmXRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rw*/
-);
-
-extern void ilbmYRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rh*/
-);
-
-extern void ilbmCopyRotatePixmap(
- PixmapPtr /*psrcPix*/,
- PixmapPtr * /*ppdstPix*/,
- int /*xrot*/,
- int /*yrot*/
-);
-extern void ilbmPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*pRegion*/,
- int /*what*/
-);
-/* ilbmpolypnt.c */
-
-extern void ilbmPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-/* ilbmpushpxl.c */
-
-extern void ilbmPushPixels(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-/* ilbmscrclse.c */
-
-extern Bool ilbmCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-/* ilbmscrinit.c */
-
-extern Bool ilbmAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*pWinIndex*/,
- int * /*pGCIndex*/
-);
-
-extern Bool ilbmScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern PixmapPtr ilbmGetWindowPixmap(
- WindowPtr /*pWin*/
-);
-
-extern void ilbmSetWindowPixmap(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/
-);
-
-/* ilbmseg.c */
-
-extern void ilbmSegmentSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-
-extern void ilbmSegmentSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-/* ilbmsetsp.c */
-
-extern int ilbmSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- PixelType * /*psrc*/,
- int /*alu*/,
- PixelType * /*pdstBase*/,
- int /*widthDst*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*sizeSrc*/
-);
-
-extern void ilbmSetSpans(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/
-);
-/* ilbmtegblt.c */
-
-extern void ilbmTEGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* ilbmtileC.c */
-
-extern void ilbmTileAreaPPWCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned long /*planemask*/
-);
-/* ilbmtileG.c */
-
-extern void ilbmTileAreaPPWGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned long /*planemask*/
-);
-
-extern void ilbmTileAreaCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned long /*planemask*/
-);
-/* ilbmtileG.c */
-
-extern void ilbmTileAreaGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned long /*planemask*/
-);
-
-extern void ilbmOpaqueStippleAreaPPWCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-/* ilbmtileG.c */
-
-extern void ilbmOpaqueStippleAreaPPWGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-
-extern void ilbmOpaqueStippleAreaCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-/* ilbmtileG.c */
-
-extern void ilbmOpaqueStippleAreaGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/,
- int /*xOff*/,
- int /*yOff*/,
- unsigned char */*rropsOS*/,
- unsigned long /*planemask*/
-);
-
-/* ilbmwindow.c */
-
-extern Bool ilbmCreateWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool ilbmDestroyWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool ilbmMapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern Bool ilbmPositionWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/
-);
-
-extern Bool ilbmUnmapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern void ilbmCopyWindow(
- WindowPtr /*pWin*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/
-);
-
-extern Bool ilbmChangeWindowAttributes(
- WindowPtr /*pWin*/,
- unsigned long /*mask*/
-);
-/* ilbmzerarc.c */
-
-extern void ilbmZeroPolyArcSS(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-/*
- private field of pixmap
- pixmap.devPrivate = (PixelType *)pointer_to_bits
- pixmap.devKind = width_of_pixmap_in_bytes
-
- private field of screen
- a pixmap, for which we allocate storage. devPrivate is a pointer to
-the bits in the hardware framebuffer. note that devKind can be poked to
-make the code work for framebuffers that are wider than their
-displayable screen (e.g. the early vsII, which displayed 960 pixels
-across, but was 1024 in the hardware.)
-
- private field of GC
-*/
-
-typedef struct {
- unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */
- unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */
-} ilbmPrivGC;
-typedef ilbmPrivGC *ilbmPrivGCPtr;
-
-extern int ilbmGCPrivateIndex; /* index into GC private array */
-extern int ilbmWindowPrivateIndex; /* index into Window private array */
-#ifdef PIXMAP_PER_WINDOW
-extern int frameWindowPrivateIndex; /* index into Window private array */
-#endif
-
-#define ilbmGetGCPrivate(pGC) \
- ((ilbmPrivGC *)((pGC)->devPrivates[ilbmGCPrivateIndex].ptr))
-
-/* private field of window */
-typedef struct {
- unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
- unsigned char fastBackground;
- unsigned short unused; /* pad for alignment with Sun compiler */
- DDXPointRec oldRotate;
- PixmapPtr pRotatedBackground;
- PixmapPtr pRotatedBorder;
-} ilbmPrivWin;
-
-/* Common macros for extracting drawing information */
-
-#define ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, width, aux, dep, pointer) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[ilbmScreenPrivateIndex].ptr; \
- else \
- _pPix = (PixmapPtr)(pDrawable); \
- (pointer) = (PixelType *)_pPix->devPrivate.ptr; \
- (width) = ((int)_pPix->devKind)/sizeof(PixelType); \
- (dep) = _pPix->drawable.depth; \
- (aux) = (width)*(dep); \
-}
-
-/* ilbm uses the following macros to calculate addresses in drawables.
- * To support banked framebuffers, the macros come in four flavors.
- * All four collapse into the same definition on unbanked devices.
- *
- * ilbmScanlineFoo - calculate address and do bank switching
- * ilbmScanlineFooNoBankSwitch - calculate address, don't bank switch
- * ilbmScanlineFooSrc - calculate address, switch source bank
- * ilbmScanlineFooDst - calculate address, switch destination bank
- */
-
-/* The NoBankSwitch versions are the same for banked and unbanked cases */
-
-#define ilbmScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
-#define ilbmScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr)+(_off))
-#define ilbmScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
- ilbmScanlineOffsetNoBankSwitch(_ptr, (_y)*(_w))
-#define ilbmScanlineNoBankSwitch(_ptr, _x, _y, _w) \
- ilbmScanlineOffsetNoBankSwitch(_ptr, (_y)*(_w)+((_x)>>MFB_PWSH))
-
-#ifdef MFB_LINE_BANK
-
-#include "ilbmlinebank.h" /* get macro definitions from this file */
-
-#else /* !MFB_LINE_BANK - unbanked case */
-
-#define ilbmScanlineInc(_ptr, _off) ilbmScanlineIncNoBankSwitch(_ptr, _off)
-#define ilbmScanlineIncSrc(_ptr, _off) ilbmScanlineInc(_ptr, _off)
-#define ilbmScanlineIncDst(_ptr, _off) ilbmScanlineInc(_ptr, _off)
-
-#define ilbmScanlineOffset(_ptr, _off) ilbmScanlineOffsetNoBankSwitch(_ptr, _off)
-#define ilbmScanlineOffsetSrc(_ptr, _off) ilbmScanlineOffset(_ptr, _off)
-#define ilbmScanlineOffsetDst(_ptr, _off) ilbmScanlineOffset(_ptr, _off)
-
-#define ilbmScanlineSrc(_ptr, _x, _y, _w) ilbmScanline(_ptr, _x, _y, _w)
-#define ilbmScanlineDst(_ptr, _x, _y, _w) ilbmScanline(_ptr, _x, _y, _w)
-
-#define ilbmScanlineDeltaSrc(_ptr, _y, _w) ilbmScanlineDelta(_ptr, _y, _w)
-#define ilbmScanlineDeltaDst(_ptr, _y, _w) ilbmScanlineDelta(_ptr, _y, _w)
-
-#endif /* MFB_LINE_BANK */
-
-#define ilbmScanlineDelta(_ptr, _y, _w) \
- ilbmScanlineOffset(_ptr, (_y)*(_w))
-
-#define ilbmScanline(_ptr, _x, _y, _w) \
- ilbmScanlineOffset(_ptr, (_y)*(_w)+((_x)>>MFB_PWSH))
-
-/* precomputed information about each glyph for GlyphBlt code.
- this saves recalculating the per glyph information for each box.
-*/
-
-typedef struct _ilbmpos{
- int xpos; /* xposition of glyph's origin */
- int xchar; /* x position mod 32 */
- int leftEdge;
- int rightEdge;
- int topEdge;
- int bottomEdge;
- PixelType *pdstBase; /* longword with character origin */
- int widthGlyph; /* width in bytes of this glyph */
-} ilbmTEXTPOS;
-
-/* reduced raster ops for ilbm */
-#define RROP_BLACK GXclear
-#define RROP_WHITE GXset
-#define RROP_NOP GXnoop
-#define RROP_INVERT GXinvert
-#define RROP_COPY GXcopy
-
-/* macros for ilbmbitblt.c, ilbmfillsp.c
- these let the code do one switch on the rop per call, rather
- than a switch on the rop per item (span or rectangle.)
-*/
-
-#define fnCLEAR(src, dst) (0)
-#define fnAND(src, dst) (src & dst)
-#define fnANDREVERSE(src, dst) (src & ~dst)
-#define fnCOPY(src, dst) (src)
-#define fnANDINVERTED(src, dst) (~src & dst)
-#define fnNOOP(src, dst) (dst)
-#define fnXOR(src, dst) (src ^ dst)
-#define fnOR(src, dst) (src | dst)
-#define fnNOR(src, dst) (~(src | dst))
-#define fnEQUIV(src, dst) (~src ^ dst)
-#define fnINVERT(src, dst) (~dst)
-#define fnORREVERSE(src, dst) (src | ~dst)
-#define fnCOPYINVERTED(src, dst) (~src)
-#define fnORINVERTED(src, dst) (~src | dst)
-#define fnNAND(src, dst) (~(src & dst))
-#define fnSET(src, dst) (~0)
-
-/* Using a "switch" statement is much faster in most cases
- * since the compiler can do a look-up table or multi-way branch
- * instruction, depending on the architecture. The result on
- * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
- * distribution of RasterOp operation types.
- *
- * However, doing some profiling on a running system reveals
- * GXcopy is the operation over 99.5% of the time and
- * GXxor is the next most frequent (about .4%), so we make special
- * checks for those first.
- *
- * Note that this requires a change to the "calling sequence"
- * since we can't engineer a "switch" statement to have an lvalue.
- */
-#define DoRop(result, alu, src, dst) \
-{ \
- if (alu == GXcopy) \
- result = fnCOPY (src, dst); \
- else if (alu == GXxor) \
- result = fnXOR (src, dst); \
- else \
- switch (alu) { \
- case GXclear: \
- result = fnCLEAR (src, dst); \
- break; \
- case GXand: \
- result = fnAND (src, dst); \
- break; \
- case GXandReverse: \
- result = fnANDREVERSE (src, dst); \
- break; \
- case GXandInverted: \
- result = fnANDINVERTED (src, dst); \
- break; \
- case GXnoop: \
- result = fnNOOP (src, dst); \
- break; \
- case GXor: \
- result = fnOR (src, dst); \
- break; \
- case GXnor: \
- result = fnNOR (src, dst); \
- break; \
- case GXequiv: \
- result = fnEQUIV (src, dst); \
- break; \
- case GXinvert: \
- result = fnINVERT (src, dst); \
- break; \
- case GXorReverse: \
- result = fnORREVERSE (src, dst); \
- break; \
- case GXcopyInverted: \
- result = fnCOPYINVERTED (src, dst); \
- break; \
- case GXorInverted: \
- result = fnORINVERTED (src, dst); \
- break; \
- case GXnand: \
- result = fnNAND (src, dst); \
- break; \
- case GXset: \
- result = fnSET (src, dst); \
- break; \
- } \
-}
-
-
-/* C expression fragments for various operations. These get passed in
- * as -D's on the compile command line. See ilbm/Imakefile. This
- * fixes XBUG 6319.
- *
- * This seems like a good place to point out that ilbm's use of the
- * words black and white is an unfortunate misnomer. In ilbm code, black
- * means zero, and white means one.
- */
-#define MFB_OPEQ_WHITE |=
-#define MFB_OPEQ_BLACK &=~
-#define MFB_OPEQ_INVERT ^=
-#define MFB_EQWHOLEWORD_WHITE =~0
-#define MFB_EQWHOLEWORD_BLACK =0
-#define MFB_EQWHOLEWORD_INVERT ^=~0
-#define MFB_OP_WHITE /* nothing */
-#define MFB_OP_BLACK ~
diff --git a/ilbm/ilbmbitblt.c b/ilbm/ilbmbitblt.c
deleted file mode 100644
index b148bc00c..000000000
--- a/ilbm/ilbmbitblt.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmbitblt.c,v 3.3 2003/11/10 18:22:44 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmbitblt.c,v 5.25 94/04/17 20:28:16 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xprotostr.h"
-
-#include "miscstruct.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mi.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-
-static unsigned char ilbmRropsOS[AFB_MAX_DEPTH];
-
-/* CopyArea and CopyPlane for a monchrome frame buffer
-
-
- clip the source rectangle to the source's available bits. (this
-avoids copying unnecessary pieces that will just get exposed anyway.)
-this becomes the new shape of the destination.
- clip the destination region to the composite clip in the
-GC. this requires translating the destination region to (dstx, dsty).
- build a list of source points, one for each rectangle in the
-destination. this is a simple translation.
- go do the multiple rectangle copies
- do graphics exposures
-*/
-/** Optimized for drawing pixmaps into windows, especially when drawing into
- ** unobscured windows. Calls to the general-purpose region code were
- ** replaced with rectangle-to-rectangle clipping comparisions. This is
- ** possible, since the pixmap is a single rectangle. In an unobscured
- ** window, the destination clip is also a single rectangle, and region
- ** code can be avoided entirely. This is a big savings, since the region
- ** code uses XAlloc() and makes many function calls.
- **
- ** In addition, if source is a pixmap, there is no need to call the
- ** expensive miHandleExposures() routine. Instead, we simply return NULL.
- **
- ** Previously, drawing a pixmap into an unobscured window executed at least
- ** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code.
- **
- ** Now, the same operation requires no XAlloc()'s, no region function calls,
- ** and much less overhead. Nice for drawing lots of small pixmaps.
- */
-
-void
-ilbmDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- switch (alu) {
- case GXcopy:
- ilbmDoBitbltCopy(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXxor:
- ilbmDoBitbltXor(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXcopyInverted:
- ilbmDoBitbltCopyInverted(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- case GXor:
- ilbmDoBitbltOr(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- default:
- ilbmDoBitbltGeneral(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
- break;
- }
-}
-
-RegionPtr
-ilbmCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
-{
- void (*doBitBlt)();
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = ilbmDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = ilbmDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = ilbmDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = ilbmDoBitbltOr;
- break;
- default:
- doBitBlt = ilbmDoBitbltGeneral;
- break;
- }
-
- return(ilbmBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
- width, height, dstx, dsty, doBitBlt, pGC->planemask));
-}
-
-RegionPtr
-ilbmBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty, doBitBlt, planemask)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- register GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- void (*doBitBlt)();
- unsigned long planemask;
-{
- RegionPtr prgnSrcClip; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
- void (*localDoBitBlt)();
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) && pSrcDrawable->pScreen->SourceValidate)
- (*pSrcDrawable->pScreen->SourceValidate)(pSrcDrawable, srcx, srcy, width,
- height);
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else
- fastClip = 1;
- else if (pGC->subWindowMode == IncludeInferiors)
- if (!((WindowPtr)pSrcDrawable)->parent)
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- else
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip) {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x) {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y) {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int)pSrcDrawable->width) {
- fastBox.x2 = pSrcDrawable->x + (int)pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int)pSrcDrawable->height) {
- fastBox.y2 = pSrcDrawable->y + (int)pSrcDrawable->height;
- fastExpose = 0;
- }
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- if (!((WindowPtr)pDstDrawable)->realized) {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip) {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
- cclip = pGC->pCompositeClip;
- if (REGION_NUM_RECTS(cclip) == 1) {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1)
- fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2)
- fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1)
- fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2)
- fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
- REGION_NULL(pGC->pScreen, &rgnDst);
- } else {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- } else {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- } else
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
-
- if (!fastClip) {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height) {
- if (!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec)))) {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc,
- planemask);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose) {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height, origDest.x,
- origDest.y, (unsigned long)0);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-RegionPtr
-ilbmCopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height,
- dstx, dsty, plane)
-DrawablePtr pSrcDrawable, pDstDrawable;
-register GC *pGC;
-int srcx, srcy;
-int width, height;
-int dstx, dsty;
-unsigned long plane;
-{
- int alu;
- RegionPtr prgnExposed = NULL;
- unsigned long old_planemask;
- PixmapPtr pPixmap = NULL;
-
- if (pDstDrawable->depth == 1) {
- old_planemask = pGC->planemask;
- pGC->planemask = plane;
- if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) {
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- } else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) {
- unsigned char rop;
-
- ilbmReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop);
- alu = pGC->alu;
- pGC->alu = rop;
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- } else { /* need to invert the src */
- alu = pGC->alu;
- pGC->alu = ilbmInverseAlu[alu];
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- }
- pGC->planemask = old_planemask;
- } else {
- int free_pixmap = FALSE;
- PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable;
- ScreenPtr pScreen = pSrcDrawable->pScreen;
- GCPtr pGC1;
-
- if (pSrcDrawable == pDstDrawable ||
- pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) {
- /* Copy a plane from source drawable to a tmp 1-bit deep pixmap */
- /* XXX: Range check width and height */
- pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1);
-
- if (!pBitmap)
- return(NULL);
- pGC1 = GetScratchGC(1, pScreen);
- if (!pGC1) {
- (*pScreen->DestroyPixmap)(pBitmap);
- return(NULL);
- }
- ValidateGC((DrawablePtr)pBitmap, pGC1);
- (void)ilbmBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy,
- width, height, 0, 0, ilbmDoBitbltCopy, plane);
- free_pixmap = TRUE;
- }
-#if 0
- else {
- /* XXX: could cope with N-deep pixmap source case without using tmp
- * src bitmap by setting up a scratch pixmap header and fiddle
- * around with the pbits pointer.
- */
- }
-#endif
- ilbmReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, ilbmRropsOS);
- (void)ilbmBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width,
- height, dstx, dsty, ilbmCopy1ToN, pGC->planemask);
- if (free_pixmap) {
- (*pScreen->DestroyPixmap)(pBitmap);
- FreeScratchGC(pGC1);
- }
-
- if (pGC->fExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx,
- srcy, width, height, dstx, dsty,
- plane);
- }
- return prgnExposed;
-}
-
-void
-ilbmCopy1ToN(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- int numRects = REGION_NUM_RECTS(prgnDst);
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int r;
-
- for (r = 0; r < numRects; r++, pbox++, pptSrc++) {
- int dx = pptSrc->x;
- int dy = pptSrc->y;
-
- if (alu == GXcopy)
- ilbmOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy,
- ilbmRropsOS, planemask);
- else
- ilbmOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx,
- dy, ilbmRropsOS, planemask);
- }
-}
diff --git a/ilbm/ilbmblt.c b/ilbm/ilbmblt.c
deleted file mode 100644
index 455c07cb5..000000000
--- a/ilbm/ilbmblt.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmblt.c,v 3.0 1996/08/18 01:53:39 dawes Exp $ */
-/*
- * ilbm copy area
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-Author: Keith Packard
-
-*/
-/* $XConsortium: ilbmblt.c,v 1.11 94/04/17 20:28:16 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-#include "fastblt.h"
-#include "mergerop.h"
-
-void
-MROP_NAME(ilbmDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- PixelType *psrcBase, *pdstBase; /* start of src and dst bitmaps */
- int widthSrc, widthDst; /* add to get to same position in next line */
- int heightSrc, heightDst;
- int auxSrc, auxDst;
-
- BoxPtr pbox;
- int nbox;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int xdir; /* 1 = left right, -1 = right left/ */
- int ydir; /* 1 = top down, -1 = bottom up */
-
- PixelType *psrcLine, *pdstLine;
- /* pointers to line with current src and dst */
- register PixelType *psrc; /* pointer to current src longword */
- register PixelType *pdst; /* pointer to current dst longword */
-
- MROP_DECLARE_REG()
-
- /* following used for looping through a line */
- PixelType startmask, endmask; /* masks for writing ends of dst */
- int nlMiddle; /* whole longwords in dst */
- int xoffSrc, xoffDst;
- register int leftShift, rightShift;
- register PixelType bits;
- register PixelType bits1;
- register int nl; /* temp copy of nlMiddle */
-
- /* place to store full source word */
- int nstart; /* number of ragged bits at start of dst */
- int nend; /* number of ragged bits at end of dst */
- int srcStartOver; /* pulling nstart bits from src
- overflows into the next word? */
- int careful;
- int tmpSrc;
- int depthSrc;
- int depthDst;
-
- MROP_INITIALIZE(alu,0);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pSrc, widthSrc, auxSrc, depthSrc,
- psrcBase);
- ilbmGetPixelWidthAuxDepthAndPointer(pDst, widthDst, auxDst, depthDst,
- pdstBase);
-
- /* Special case where depth of dest pixmap is 1 but source pixmap isn't
- * Used for GetImage to copy a plane from a source pixmap to a particular
- * dest pixmap plane.
- * Note: planemask should have only one bit set or several planes from
- * the source will be copied to the same dest plane.
- */
- if (depthDst == 1 && depthDst != depthSrc)
- widthDst = 0;
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1)) {
- /* walk source botttom to top */
- ydir = -1;
- auxSrc = -auxSrc;
- auxDst = -auxDst;
-
- if (nbox > 1) {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- if (!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if (!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1)) {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1) {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if (!pboxNew2 || !pptNew2) {
- if (pptNew2)
- DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2)
- DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) && (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* walk source left to right */
- xdir = 1;
- }
-
- while (nbox--) {
- int d;
- for (d = 0; d < depthSrc; d++) {
- PixelType *psrcB;
- PixelType *pdstB;
-
- if (!(planemask & (1 << d)))
- continue;
-
- psrcB = psrcBase + widthSrc * d; /* @@@ NEXT PLANE @@@ */
- pdstB = pdstBase + widthDst * d; /* @@@ NEXT PLANE @@@ */
-
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- if (ydir == -1) { /* start at last scanline of rectangle */
- psrcLine = ilbmScanlineDeltaSrc(psrcB, -(pptSrc->y+h-1), auxSrc);
- pdstLine = ilbmScanlineDeltaDst(pdstB, -(pbox->y2-1), auxDst);
- } else { /* start at first scanline */
- psrcLine = ilbmScanlineDeltaSrc(psrcB, pptSrc->y, auxSrc);
- pdstLine = ilbmScanlineDeltaDst(pdstB, pbox->y1, auxDst);
- }
- if ((pbox->x1 & PIM) + w <= PPW) {
- maskpartialbits (pbox->x1, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
- }
- if (xdir == 1) {
- xoffSrc = pptSrc->x & PIM;
- xoffDst = pbox->x1 & PIM;
- pdstLine += (pbox->x1 >> PWSH);
- psrcLine += (pptSrc->x >> PWSH);
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)(((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- if (startmask) {
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- psrc++;
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
-#ifdef NOTDEF
- /* you'd think this would be faster --
- * a single instruction instead of 6
- * but measurements show it to be ~15% slower
- */
- while ((nl -= 6) >= 0) {
- asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
- : "=m" (*(char *)pdst)
- : "m" (*(char *)psrc)
- : "d0", "d1", "d2", "d3",
- "a2", "a3");
- pdst += 6;
- }
- nl += 6;
- while (nl--)
- *pdst++ = *psrc++;
-#endif
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif
-
- if (endmask)
- *pdst = MROP_MASK(*psrc, *pdst, endmask);
- ilbmScanlineIncDst(pdstLine, auxDst);
- ilbmScanlineIncSrc(psrcLine, auxSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else {
- if (xoffSrc > xoffDst) {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- } else {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- }
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffSrc > xoffDst)
- bits = *psrc++;
- if (startmask) {
- bits1 = BitLeft(bits,leftShift);
- bits = *psrc++;
- bits1 |= BitRight(bits,rightShift);
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
-bits = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
-bits1 = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
-pdst++;
-
-#define BodyEven(n) \
-bits1 = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
-pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-
- if (endmask) {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift)) {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- ilbmScanlineIncDst(pdstLine, auxDst);
- ilbmScanlineIncSrc(psrcLine, auxSrc);
- }
- }
-#endif /* DO_UNALIGNED_BITBLT */
- } else { /* xdir == -1 */
- xoffSrc = (pptSrc->x + w - 1) & PIM;
- xoffDst = (pbox->x2 - 1) & PIM;
- pdstLine += ((pbox->x2-1) >> PWSH) + 1;
- psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)
- (((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- if (endmask) {
- pdst--;
- psrc--;
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
-
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset \
-pdst -= UNROLL;\
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
-#define BodyEven(n) BodyOdd(n)
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl,label3,
- --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
-#endif
-
- if (startmask) {
- --pdst;
- --psrc;
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- }
- ilbmScanlineIncDst(pdstLine, auxDst);
- ilbmScanlineIncSrc(psrcLine, auxSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else {
- if (xoffDst > xoffSrc) {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- } else {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- }
- while (h--) {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffDst > xoffSrc)
- bits = *--psrc;
- if (endmask) {
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- pdst--;
- *pdst = MROP_MASK(bits1, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) \
-bits = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
-
-#define BodyEven(n) \
-bits1 = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
-
-#define LoopReset \
-pdst -= UNROLL; \
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
-
-#define BodyEven(n) \
-bits1 = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
-
-#define LoopReset ;
-
-#endif
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl, label4,
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- --pdst;
- *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
- )
-#endif
-
- if (startmask) {
- bits1 = BitRight(bits, rightShift);
- if (BitRight (startmask, leftShift)) {
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- }
- --pdst;
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- }
- ilbmScanlineIncDst(pdstLine, auxDst);
- ilbmScanlineIncSrc(psrcLine, auxSrc);
- }
- }
-#endif
- }
- }
- pbox++;
- pptSrc++;
- }
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
diff --git a/ilbm/ilbmbres.c b/ilbm/ilbmbres.c
deleted file mode 100644
index 4204c61b5..000000000
--- a/ilbm/ilbmbres.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmbres.c,v 3.0 1996/08/18 01:53:40 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmbres.c,v 1.22 94/04/17 20:28:17 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "misc.h"
-#include "ilbm.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-ilbmBresS(addrlbase, nlwidth, auxDst, depthDst, signdx, signdy, axis, x1, y1,
- e, e1, e2, len, rrops)
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int auxDst;
-int depthDst;
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-unsigned char *rrops;
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl; /* bitmask long pointer */
- register PixelType bit; /* current bit being set/cleared/etc. */
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
-
- register int e3 = e2-e1;
- PixelType tmp;
- int saveE;
- int saveLen;
- int d;
-
- /* point to longword containing first point */
- yinc = signdy * auxDst;
- e = e-e1; /* to make looping easier */
-
- if (!len)
- return;
-
- saveLen = len;
- saveE = e;
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(addrlbase, x1, y1, auxDst);
- addrlbase += nlwidth; /* @@@ NEXT PLANE @@@ */
- len = saveLen;
- e = saveE;
- bit = mask[x1 & PIM];
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- tmp = *addrl;
- for (;;) {
- tmp &= ~bit;
- if (!--len)
- break;
- bit = SCRRIGHT(bit,1);
- e += e1;
- if (e >= 0) {
- *addrl = tmp;
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- } else {
- tmp = *addrl;
- for (;;) {
- tmp &= ~bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while (len--) {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- } else {
- while (len--) {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- break;
-
- case RROP_WHITE:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- tmp = *addrl;
- for (;;) {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRRIGHT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- } else {
- tmp = *addrl;
- for (;;) {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0) {
- *addrl = tmp;
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- if (!bit) {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- } else if (!bit) {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while (len--) {
- *addrl |= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- } else {
- while (len--) {
- *addrl |= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- break;
-
- case RROP_INVERT:
- if (axis == X_AXIS) {
- if (signdx > 0) {
- while (len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- }
- } else {
- while (len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- }
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while (len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- } else {
- while (len--) {
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl --; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- } /* switch */
- } /* for (d = ... ) */
-}
diff --git a/ilbm/ilbmbresd.c b/ilbm/ilbmbresd.c
deleted file mode 100644
index 75391e96b..000000000
--- a/ilbm/ilbmbresd.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmbresd.c,v 3.0 1996/08/18 01:53:41 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmbresd.c,v 1.10 94/04/17 20:28:18 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "misc.h"
-#include "ilbm.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Dashed bresenham line */
-
-#define StepDash\
- if (!--dashRemaining) { \
- if (++ dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- rop = fgrop; \
- if (dashIndex & 1) \
- rop = bgrop; \
- }
-
-void
-ilbmBresD(pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrlbase, nlwidth, auxDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, len, rrops, bgrrops)
-int *pdashIndex; /* current dash */
-unsigned char *pDash; /* dash list */
-int numInDashList; /* total length of dash list */
-int *pdashOffset; /* offset into current dash */
-int isDoubleDash;
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int auxDst;
-int depthDst;
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-unsigned char *rrops;
-unsigned char *bgrrops;
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl;
- register int e3 = e2-e1;
- register unsigned long bit;
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- int rop;
- int fgrop;
- int bgrop;
- int saveE;
- int saveLen;
- int d;
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- dashRemaining = pDash[dashIndex] - dashOffset;
- /* point to longword containing first point */
-
- yinc = signdy * auxDst;
- e = e-e1; /* to make looping easier */
-
- saveE = e;
- saveLen = len;
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(addrlbase, x1, y1, auxDst);
- addrlbase += nlwidth; /* @@@ NEXT PLANE @@@ */
-
- fgrop = rrops[d];
- bgrop = bgrrops[d];
-
- e = saveE;
- len = saveLen;
- bit = mask[x1 & PIM];
-
- rop = fgrop;
- if (!isDoubleDash)
- bgrop = -1;
- if (dashIndex & 1)
- rop = bgrop;
-
- if (axis == X_AXIS) {
- if (signdx > 0) {
- while (len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- StepDash
- }
- } else {
- while (len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- ilbmScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- StepDash
- }
- }
- } /* if X_AXIS */ else {
- if (signdx > 0) {
- while (len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- StepDash
- }
- } else {
- while (len--) {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0) {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- ilbmScanlineInc(addrl, yinc);
- StepDash
- }
- }
- } /* else Y_AXIS */
- } /* for (d = ...) */
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/ilbm/ilbmbstore.c b/ilbm/ilbmbstore.c
deleted file mode 100644
index 8309e2600..000000000
--- a/ilbm/ilbmbstore.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmbstore.c,v 3.0 1996/08/18 01:53:43 dawes Exp $ */
-/* $XConsortium: ilbmbstore.c,v 5.7 94/04/17 20:28:18 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-*/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "ilbm.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * ilbmSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * ilbmDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-ilbmSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- ilbmDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivates[ilbmScreenPrivateIndex].ptr,
- (DrawablePtr)pPixmap,
- GXcopy,
- prgnSave,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * ilbmRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * ilbmDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-ilbmRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- ilbmDoBitblt((DrawablePtr)pPixmap,
- (DrawablePtr)pPixmap->drawable.pScreen->devPrivates[ilbmScreenPrivateIndex].ptr,
- GXcopy,
- prgnRestore,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
diff --git a/ilbm/ilbmclip.c b/ilbm/ilbmclip.c
deleted file mode 100644
index 4628e61d0..000000000
--- a/ilbm/ilbmclip.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmclip.c,v 3.0 1996/08/18 01:53:44 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmclip.c,v 5.6 94/04/17 20:28:19 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "miscstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "gc.h"
-#include "maskbits.h"
-#include "mi.h"
-
-#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
-if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
- (!((reg)->data->numRects && \
- ((r-1)->y1 == (ry1)) && \
- ((r-1)->y2 == (ry2)) && \
- ((r-1)->x1 <= (rx1)) && \
- ((r-1)->x2 >= (rx2))))) { \
- if ((reg)->data->numRects == (reg)->data->size) { \
- miRectAlloc(reg, 1); \
- fr = REGION_BOXPTR(reg); \
- r = fr + (reg)->data->numRects; \
- } \
- r->x1 = (rx1); \
- r->y1 = (ry1); \
- r->x2 = (rx2); \
- r->y2 = (ry2); \
- (reg)->data->numRects++; \
- if (r->x1 < (reg)->extents.x1) \
- (reg)->extents.x1 = r->x1; \
- if (r->x2 > (reg)->extents.x2) \
- (reg)->extents.x2 = r->x2; \
- r++; \
-}
-
-/* Convert bitmap clip mask into clipping region.
- * First, goes through each line and makes boxes by noting the transitions
- * from 0 to 1 and 1 to 0.
- * Then it coalesces the current line with the previous if they have boxes
- * at the same X coordinates.
- */
-RegionPtr
-ilbmPixmapToRegion(pPix)
- PixmapPtr pPix;
-{
- register RegionPtr pReg;
- register PixelType *pw, w;
- register int ib;
- int width, h, base, rx1, crects;
- PixelType *pwLineEnd;
- int irectPrevStart, irectLineStart;
- register BoxPtr prectO, prectN;
- BoxPtr FirstRect, rects, prectLineStart;
- Bool fInBox, fSame;
- register PixelType mask0 = mask[0];
- PixelType *pwLine;
- int nWidth;
-
- pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1);
- if (!pReg)
- return(NullRegion);
- FirstRect = REGION_BOXPTR(pReg);
- rects = FirstRect;
-
- pwLine = (PixelType *)pPix->devPrivate.ptr;
- nWidth = pPix->devKind/PGSZB;
-
- width = pPix->drawable.width;
- pReg->extents.x1 = width - 1;
- pReg->extents.x2 = 0;
- irectPrevStart = -1;
- for (h = 0; h < pPix->drawable.height; h++) {
- pw = pwLine;
- pwLine += nWidth;
- irectLineStart = rects - FirstRect;
- /* If the Screen left most bit of the word is set, we're starting in
- * a box */
- if (*pw & mask0) {
- fInBox = TRUE;
- rx1 = 0;
- } else
- fInBox = FALSE;
- /* Process all words which are fully in the pixmap */
- pwLineEnd = pw + (width >> PWSH);
- for (base = 0; pw < pwLineEnd; base += PPW) {
- w = *pw++;
- if (fInBox) {
- if (!~w)
- continue;
- } else {
- if (!w)
- continue;
- }
- for (ib = 0; ib < PPW; ib++) {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if (w & mask0) {
- if (!fInBox) {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if (fInBox) {
- /* end box */
- ADDRECT(pReg, rects, FirstRect, rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- if (width & PIM) {
- /* Process final partial word on line */
- w = *pw++;
- for (ib = 0; ib < (width & PIM); ib++) {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if (w & mask0) {
- if (!fInBox) {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if (fInBox) {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if (fInBox) {
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + (width & PIM), h + 1);
- }
- /* if all rectangles on this line have the same x-coords as
- * those on the previous line, then add 1 to all the previous y2s and
- * throw away all the rectangles from this line
- */
- fSame = FALSE;
- if (irectPrevStart != -1) {
- crects = irectLineStart - irectPrevStart;
- if (crects == ((rects - FirstRect) - irectLineStart)) {
- prectO = FirstRect + irectPrevStart;
- prectN = prectLineStart = FirstRect + irectLineStart;
- fSame = TRUE;
- while (prectO < prectLineStart) {
- if ((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) {
- fSame = FALSE;
- break;
- }
- prectO++;
- prectN++;
- }
- if (fSame) {
- prectO = FirstRect + irectPrevStart;
- while (prectO < prectLineStart) {
- prectO->y2 += 1;
- prectO++;
- }
- rects -= crects;
- pReg->data->numRects -= crects;
- }
- }
- }
- if (!fSame)
- irectPrevStart = irectLineStart;
- }
- if (!pReg->data->numRects)
- pReg->extents.x1 = pReg->extents.x2 = 0;
- else {
- pReg->extents.y1 = REGION_BOXPTR(pReg)->y1;
- pReg->extents.y2 = REGION_END(pReg)->y2;
- if (pReg->data->numRects == 1) {
- xfree(pReg->data);
- pReg->data = (RegDataPtr)NULL;
- }
- }
-#ifdef DEBUG
- if (!miValidRegion(pReg))
- FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
-#endif
- return(pReg);
-}
diff --git a/ilbm/ilbmcmap.c b/ilbm/ilbmcmap.c
deleted file mode 100644
index 10dadd968..000000000
--- a/ilbm/ilbmcmap.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmcmap.c,v 3.1 1998/11/22 10:37:40 dawes Exp $ */
-/* $XConsortium: ilbmcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "micmap.h"
-
-int
-ilbmListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-
-void
-ilbmInstallColormap(pmap)
- ColormapPtr pmap;
-{
- miInstallColormap(pmap);
-}
-
-void
-ilbmUninstallColormap(pmap)
- ColormapPtr pmap;
-{
- miUninstallColormap(pmap);
-}
-
-void
-ilbmResolveColor(pred, pgreen, pblue, pVisual)
- unsigned short *pred, *pgreen, *pblue;
- register VisualPtr pVisual;
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-ilbmInitializeColormap(pmap)
- register ColormapPtr pmap;
-{
- return miInitializeColormap(pmap);
-}
-
-int
-ilbmExpandDirectColors(pmap, ndef, indefs, outdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *indefs, *outdefs;
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-ilbmCreateDefColormap(pScreen)
- ScreenPtr pScreen;
-{
- return miCreateDefColormap(pScreen);
-}
-
-Bool
-ilbmSetVisualTypes(depth, visuals, bitsPerRGB)
- int depth;
- int visuals;
- int bitsPerRGB;
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which correspond to
- * the set which can be used with this version of ilbm.
- */
-
-Bool
-ilbmInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp,
- sizes, bitsPerRGB)
- VisualPtr *visualp;
- DepthPtr *depthp;
- int *nvisualp, *ndepthp;
- int *rootDepthp;
- VisualID *defaultVisp;
- unsigned long sizes;
- int bitsPerRGB;
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
diff --git a/ilbm/ilbmfillarc.c b/ilbm/ilbmfillarc.c
deleted file mode 100644
index f107e4692..000000000
--- a/ilbm/ilbmfillarc.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmfillarc.c,v 3.1 1998/03/20 21:08:01 hohndel Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: ilbmfillarc.c,v 5.14 94/04/17 20:28:20 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "miscstruct.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "ilbm.h"
-#include "maskbits.h"
-#include "mifillarc.h"
-#include "mi.h"
-
-static void
-ilbmFillEllipseSolid(pDraw, arc, rrops)
- DrawablePtr pDraw;
- xArc *arc;
- register unsigned char *rrops;
-{
- int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- register int slw;
- miFillArcRec info;
- PixelType *addrlt, *addrlb;
- register PixelType *pdst;
- PixelType *addrl;
- register int n;
- register int d;
- int nlwidth;
- register int xpos;
- PixelType startmask, endmask;
- int nlmiddle;
- int depthDst;
- int auxDst;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- addrlt);
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += auxDst * (yorg - y);
- addrlb += auxDst * (yorg + y + dy);
- while (y) {
- addrlt += auxDst;
- addrlb -= auxDst;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
- pdst = addrl = ilbmScanlineOffset(addrlt, (xpos >> PWSH));
- if (((xpos & PIM) + slw) < PPW) {
- maskpartialbits(xpos, slw, startmask);
- for (d = 0; d < depthDst; d++, pdst += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~startmask;
- break;
- case RROP_WHITE:
- *pdst |= startmask;
- break;
- case RROP_INVERT:
- *pdst ^= startmask;
- break;
- case RROP_NOP:
- break;
- }
- }
- if (miFillArcLower(slw)) {
- pdst = ilbmScanlineOffset(addrlb, (xpos >> PWSH));
-
- for (d = 0; d < depthDst; d++, pdst += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~startmask;
- break;
- case RROP_WHITE:
- *pdst |= startmask;
- break;
- case RROP_INVERT:
- *pdst ^= startmask;
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- for (d = 0; d < depthDst; d++, addrl += nlwidth) { /* @@@ NEXT PLANE @@@ */
- n = nlmiddle;
- pdst = addrl;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *pdst++ &= ~startmask;
- while (n--)
- *pdst++ = 0;
- if (endmask)
- *pdst &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *pdst++ |= startmask;
- while (n--)
- *pdst++ = ~0;
- if (endmask)
- *pdst |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *pdst++ ^= startmask;
- while (n--)
- *pdst++ ^= ~0;
- if (endmask)
- *pdst ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- }
- }
- if (!miFillArcLower(slw))
- continue;
- addrl = ilbmScanlineOffset(addrlb, (xpos >> PWSH));
- for (d = 0; d < depthDst; d++, addrl += nlwidth) { /* @@@ NEXT PLANE @@@ */
- n = nlmiddle;
- pdst = addrl;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *pdst++ &= ~startmask;
- while (n--)
- *pdst++ = 0;
- if (endmask)
- *pdst &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *pdst++ |= startmask;
- while (n--)
- *pdst++ = ~0;
- if (endmask)
- *pdst |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *pdst++ ^= startmask;
- while (n--)
- *pdst++ ^= ~0;
- if (endmask)
- *pdst ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- }
- }
- }
-}
-
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) { \
- width = xr - xl + 1; \
- addrl = ilbmScanlineOffset(addr, (xl >> PWSH)); \
- if (((xl & PIM) + width) < PPW) { \
- maskpartialbits(xl, width, startmask); \
- for (pdst = addrl, d = 0; d < depthDst; d++, pdst += nlwidth) { /* @@@ NEXT PLANE @@@ */ \
- switch (rrops[d]) { \
- case RROP_BLACK: \
- *pdst &= ~startmask; \
- break; \
- case RROP_WHITE: \
- *pdst |= startmask; \
- break; \
- case RROP_INVERT: \
- *pdst ^= startmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
- } \
- } else { \
- maskbits(xl, width, startmask, endmask, nlmiddle); \
- for (d = 0; d < depthDst; d++, addrl += nlwidth) { /* @@@ NEXT PLANE @@@ */ \
- n = nlmiddle; \
- pdst = addrl; \
- switch (rrops[d]) { \
- case RROP_BLACK: \
- if (startmask) \
- *pdst++ &= ~startmask; \
- while (n--) \
- *pdst++ = 0; \
- if (endmask) \
- *pdst &= ~endmask; \
- break; \
- case RROP_WHITE: \
- if (startmask) \
- *pdst++ |= startmask; \
- while (n--) \
- *pdst++ = ~0; \
- if (endmask) \
- *pdst |= endmask; \
- break; \
- case RROP_INVERT: \
- if (startmask) \
- *pdst++ ^= startmask; \
- while (n--) \
- *pdst++ ^= ~0; \
- if (endmask) \
- *pdst ^= endmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
- } \
- } \
- }
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) { \
- FILLSPAN(xl, xr, addr); \
- } else { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-ilbmFillArcSliceSolidCopy(pDraw, pGC, arc, rrops)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
- register unsigned char *rrops;
-{
- PixelType *addrl;
- register PixelType *pdst;
- register int n;
- register int d;
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
- PixelType *addrlt, *addrlb;
- int nlwidth;
- int width;
- PixelType startmask, endmask;
- int nlmiddle;
- int auxDst;
- int depthDst;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- addrlt);
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt = ilbmScanlineDeltaNoBankSwitch(addrlt, yorg - y, auxDst);
- addrlb = ilbmScanlineDeltaNoBankSwitch(addrlb, yorg + y + dy, auxDst);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0) {
- ilbmScanlineIncNoBankSwitch(addrlt, auxDst);
- ilbmScanlineIncNoBankSwitch(addrlb, -auxDst);
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice)) {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrlt);
- }
- if (miFillSliceLower(slice)) {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrlb);
- }
- }
-}
-
-void
-ilbmPolyFillArcSolid(pDraw, pGC, narcs, parcs)
- register DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- ilbmPrivGC *priv;
- register xArc *arc;
- register int i;
- int x2, y2;
- BoxRec box;
- RegionPtr cclip;
- unsigned char *rrops;
-
- priv = (ilbmPrivGC *) pGC->devPrivates[ilbmGCPrivateIndex].ptr;
- rrops = priv->rrops;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++) {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc)) {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) ) {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- ilbmFillEllipseSolid(pDraw, arc, rrops);
- else
- ilbmFillArcSliceSolidCopy(pDraw, pGC, arc, rrops);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/ilbm/ilbmfillrct.c b/ilbm/ilbmfillrct.c
deleted file mode 100644
index 642a95f40..000000000
--- a/ilbm/ilbmfillrct.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmfillrct.c,v 3.1 1998/03/20 21:08:01 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmfillrct.c,v 5.10 94/04/17 20:28:21 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "miscstruct.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-#define MODEQ(a, b) ((a) %= (b))
-void ilbmPaintOddSize();
-
-/*
- filled rectangles.
- translate the rectangles, clip them, and call the
-helper function in the GC.
-*/
-
-#define NUM_STACK_RECTS 1024
-
-void
-ilbmPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- int numRects;
- int n;
- int xorg, yorg;
- ilbmPrivGC *priv;
- PixmapPtr ppix;
- unsigned char *rrops;
- unsigned char *rropsOS;
-
- priv = (ilbmPrivGC *)pGC->devPrivates[ilbmGCPrivateIndex].ptr;
- ppix = pGC->pRotatedPixmap;
- prgnClip = pGC->pCompositeClip;
- rrops = priv->rrops;
- rropsOS = priv->rropOS;
-
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg) {
- prect = prectInit;
- n = nrectFill;
- Duff(n, prect->x += xorg; prect->y += yorg; prect++);
- }
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS) {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1) {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--) {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2)) {
- pboxClipped++;
- }
- }
- } else {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--) {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while (n--) {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if (pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2)
- pboxClipped++;
- }
- }
- }
- if (pboxClipped != pboxClippedBase) {
- switch (pGC->fillStyle) {
- case FillSolid:
- ilbmSolidFillArea(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, rrops);
- break;
- case FillTiled:
- switch (pGC->alu) {
- case GXcopy:
- if (pGC->pRotatedPixmap)
- ilbmTileAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->pRotatedPixmap, pGC->planemask);
- else
- ilbmTileAreaCopy(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy, pGC->tile.pixmap,
- pGC->patOrg.x, pGC->patOrg.y,
- pGC->planemask);
- break;
-
- default:
- if (pGC->pRotatedPixmap)
- ilbmTileAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->pRotatedPixmap,
- pGC->planemask);
- else
- ilbmTileAreaGeneral(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->tile.pixmap, pGC->patOrg.x,
- pGC->patOrg.y, pGC->planemask);
- break;
- } /* switch (alu) */
- break;
-
- case FillStippled:
- if (pGC->pRotatedPixmap)
- ilbmStippleAreaPPW(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->pRotatedPixmap, rrops);
- else
- ilbmStippleArea(pDrawable, pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->stipple, pGC->patOrg.x,
- pGC->patOrg.y, rrops);
- break;
-
- case FillOpaqueStippled:
- switch (pGC->alu) {
- case GXcopy:
- if (pGC->pRotatedPixmap)
- ilbmOpaqueStippleAreaPPWCopy(pDrawable,
- pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->pRotatedPixmap, rropsOS,
- pGC->planemask);
- else
- ilbmOpaqueStippleAreaCopy(pDrawable,
- pboxClipped-pboxClippedBase,
- pboxClippedBase, GXcopy,
- pGC->stipple, pGC->patOrg.x,
- pGC->patOrg.y, rropsOS,
- pGC->planemask);
- break;
-
- default:
- if (pGC->pRotatedPixmap)
- ilbmOpaqueStippleAreaPPWGeneral(pDrawable,
- pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->pRotatedPixmap,
- rropsOS, pGC->planemask);
- else
- ilbmOpaqueStippleAreaGeneral(pDrawable,
- pboxClipped-pboxClippedBase,
- pboxClippedBase, pGC->alu,
- pGC->stipple, pGC->patOrg.x,
- pGC->patOrg.y, rropsOS,
- pGC->planemask);
- break;
- } /* switch (alu) */
- break;
- }
- }
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/ilbm/ilbmfillsp.c b/ilbm/ilbmfillsp.c
deleted file mode 100644
index 5564e5142..000000000
--- a/ilbm/ilbmfillsp.c
+++ /dev/null
@@ -1,1145 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmfillsp.c,v 3.1 1998/03/20 21:08:01 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmfillsp.c,v 5.13 94/04/17 20:28:21 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "ilbm.h"
-#include "maskbits.h"
-
-#include "mergerop.h"
-
-#include "servermd.h"
-#include "mi.h"
-#include "mispans.h"
-
-/* scanline filling for monochrome frame buffer
- written by drewry, oct 1986
-
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in ilbmCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-
-*/
-
-
-void
-ilbmSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int depthDst;
- int auxDst;
- int d;
- unsigned char *rrops;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
- while (n--) {
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
-
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (*pwidth) {
- addrl = addrlBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- }
- break;
-
- case RROP_WHITE:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- }
- break;
- case RROP_INVERT:
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= startmask;
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- }
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-ilbmStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pStipple;
- PixelType *psrc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int d;
- int depthDst;
- int auxDst;
- unsigned char *rrops;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- pStipple = pGC->pRotatedPixmap;
- tileHeight = pStipple->drawable.height;
- psrc = (PixelType *)(pStipple->devPrivate.ptr);
-
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
-
- while (n--) {
- src = psrc[ppt->y % tileHeight];
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- addrl = addrlBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~(src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~(src & startmask);
- Duff (nlmiddle, *addrl++ &= ~src);
- if (endmask)
- *addrl &= ~(src & endmask);
- }
- break;
- case RROP_WHITE:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= (src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= (src & startmask);
- Duff (nlmiddle, *addrl++ |= src);
- if (endmask)
- *addrl |= (src & endmask);
- }
- break;
- case RROP_INVERT:
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= (src & startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= (src & startmask);
- Duff (nlmiddle, *addrl++ ^= src);
- if (endmask)
- *addrl ^= (src & endmask);
- }
- break;
-
- case RROP_NOP:
- break;
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-ilbmTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pTile;
- PixelType *psrc;
- int tileHeight;
- int rop;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int auxDst;
- int depthDst;
- int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- pTile = pGC->pRotatedPixmap;
- tileHeight = pTile->drawable.height;
- psrc = (PixelType *)(pTile->devPrivate.ptr);
- rop = pGC->alu;
-
- switch (rop) {
- case GXcopy:
-#define DoMaskCopyRop(src,dst,mask) ((dst) & ~(mask) | (src) & (mask))
- while (n--) {
- if (*pwidth) {
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
-
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- addrl = addrlBase;
- src = psrc[ppt->y % tileHeight + tileHeight * d];
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = src;
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskCopyRop (src, *addrl, endmask);
- }
- }
- }
- pwidth++;
- ppt++;
- }
- break;
-
- default:
- {
- register DeclareMergeRop ();
-
- InitializeMergeRop(rop,~0);
- while (n--) {
- if (*pwidth) {
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- addrl = addrlBase;
-
- src = psrc[ppt->y % tileHeight + tileHeight * d];
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = DoMergeRop (src, *addrl);
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskMergeRop (src, *addrl, endmask);
- }
- }
- }
- pwidth++;
- ppt++;
- }
- break;
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-void
-ilbmOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pTile;
- PixelType *psrc;
- int tileHeight;
- int rop;
- unsigned char *rropsOS;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int auxDst;
- int depthDst;
- int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- pTile = pGC->pRotatedPixmap;
- tileHeight = pTile->drawable.height;
- psrc = (PixelType *)(pTile->devPrivate.ptr);
- rop = pGC->alu;
- rropsOS = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rropOS;
-
- switch (rop) {
- case GXcopy:
-#define DoMaskCopyRop(src,dst,mask) ((dst) & ~(mask) | (src) & (mask))
- while (n--) {
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
- if (*pwidth) {
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- src = 0;
- break;
- case RROP_WHITE:
- src = ~0;
- break;
- case RROP_INVERT:
- src = ~psrc[ppt->y % tileHeight];
- break;
- case RROP_COPY:
- src = psrc[ppt->y % tileHeight];
- break;
- case RROP_NOP:
- continue;
- }
-
- addrl = addrlBase;
-
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = src;
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskCopyRop (src, *addrl, endmask);
- }
- } /* for (d = ...) */
- }
-
- pwidth++;
- ppt++;
- }
- break;
-
- default:
- {
- register DeclareMergeRop ();
-
- InitializeMergeRop(rop,~0);
- while (n--) {
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
- if (*pwidth) {
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- src = 0;
- break;
- case RROP_WHITE:
- src = ~0;
- break;
- case RROP_INVERT:
- src = ~psrc[ppt->y % tileHeight];
- break;
- case RROP_COPY:
- src = psrc[ppt->y % tileHeight];
- break;
- case RROP_NOP:
- continue;
- }
-
- addrl = addrlBase;
-
- if ( ((ppt->x & PIM) + *pwidth) < PPW) {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- } else {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask) {
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--) {
- *addrl = DoMergeRop (src, *addrl);
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskMergeRop (src, *addrl, endmask);
- }
- } /* for (d = ...) */
- }
- pwidth++;
- ppt++;
- } /* while (n) */
- break;
- }
- } /* switch (rop) */
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with tiles that aren't PPW bits wide */
-void
-ilbmUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- int iline; /* first line of tile to use */
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst;/* pointer to current word in bitmap */
- register PixelType *psrc;/* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- PixelType endmask, *psrcT;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int auxDst;
- int sizeTile;
- int depthDst;
- register int d;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->tile.pixmap;
- tlwidth = pTile->devKind/PGSZB;
- rop = pGC->alu;
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- sizeTile = tlwidth * tileHeight;
-
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
-
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
-
- for (d = 0; d < depthDst; d++, psrcT += sizeTile, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- if (*pwidth) {
- x = ppt->x;
- pdst = addrlBase;
- width = *pwidth;
- while (width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrop((psrc+endinc), (rem&PIM), (x & PIM), w, pdst, rop);
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- putbitsrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- getandputrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if (endmask) {
- getandputrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with stipples that aren't PPW bits wide */
-void
-ilbmUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- int iline; /* first line of tile to use */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst; /* pointer to current word in bitmap */
- register PixelType *psrc; /* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- PixelType endmask, *psrcT;
- int tlwidth, rem, tileWidth, endinc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- unsigned char *rrops;
- register int d;
- int auxDst;
- int depthDst;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->stipple;
- tlwidth = pTile->devKind/PGSZB;
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
-
- /* this replaces rotating the stipple. Instead, we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
-
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- rop = rrops[d];
- if (rop == RROP_NOP)
- continue;
-
- pdst = addrlBase;
- x = ppt->x;
-
- if (*pwidth) {
- width = *pwidth;
- while (width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrrop((psrc + endinc), (rem & PIM), (x & PIM),
- w, pdst, rop)
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- getandputrrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if (endmask) {
- getandputrrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-/* Fill spans with OpaqueStipples that aren't PPW bits wide */
-void
-ilbmUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- int iline; /* first line of tile to use */
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- PixelType *pBase;
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst;/* pointer to current word in bitmap */
- register PixelType *psrc;/* pointer to current word in tile */
- register int nlMiddle;
- register int d;
- register PixelType tmpsrc;
- register PixelType tmpdst;
- register int alu, nstart;
- register unsigned char *rropsOS;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- PixelType endmask, *psrcT;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- int auxDst;
- int sizeTile;
- int depthDst;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if (!pptFree || !pwidthFree) {
- if (pptFree)
- DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree)
- DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->stipple;
- tlwidth = pTile->devKind/PGSZB;
- alu = pGC->alu;
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- rropsOS = ilbmGetGCPrivate(pGC)->rropOS;
-
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
-
- while (n--) {
- iline = (ppt->y - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- addrlBase = ilbmScanline(pBase, ppt->x, ppt->y, auxDst);
-
- for (d = 0; d < depthDst; d++, addrlBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(pGC->planemask & (1 << d)))
- continue;
-
- if (*pwidth) {
- x = ppt->x;
- pdst = addrlBase;
- width = *pwidth;
- while (width > 0) {
- psrc = psrcT;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), w, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
-
- putbits (tmpsrc, (x & PIM), w, pdst);
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), w, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
- if (alu != GXcopy) {
- getbits (pdst, (x & PIM), nstart, tmpdst);
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- getbits (psrc, nstart, PPW, tmpsrc);
- break;
- case RROP_INVERT:
- getbits (psrc, nstart, PPW, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
- if (alu != GXcopy) {
- tmpdst = *pdst;
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++;*/
- psrc++;
- }
- if (endmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits (psrc, nstart, nend, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits (psrc, nstart, nend, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
- if (alu != GXcopy) {
- tmpdst = *pdst;
- DoRop (tmpsrc, alu, tmpsrc, tmpdst);
- }
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- }
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/ilbm/ilbmfont.c b/ilbm/ilbmfont.c
deleted file mode 100644
index 50cf56773..000000000
--- a/ilbm/ilbmfont.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmfont.c,v 3.0 1996/08/18 01:53:51 dawes Exp $ */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XConsortium: ilbmfont.c,v 1.18 94/04/17 20:28:22 keith Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-
-/*ARGSUSED*/
-Bool
-ilbmRealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-ilbmUnrealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
diff --git a/ilbm/ilbmgc.c b/ilbm/ilbmgc.c
deleted file mode 100644
index 8253d9cd4..000000000
--- a/ilbm/ilbmgc.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmgc.c,v 3.1 1998/03/20 21:08:02 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmgc.c,v 5.35 94/04/17 20:28:23 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "migc.h"
-
-#include "maskbits.h"
-
-static GCFuncs ilbmFuncs = {
- ilbmValidateGC,
- miChangeGC,
- miCopyGC,
- ilbmDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip
-};
-
-static GCOps ilbmGCOps = {
- ilbmSolidFS,
- ilbmSetSpans,
- ilbmPutImage,
- ilbmCopyArea,
- miCopyPlane,
- ilbmPolyPoint,
- ilbmLineSS,
- ilbmSegmentSS,
- miPolyRectangle,
- ilbmZeroPolyArcSS,
- ilbmFillPolygonSolid,
- ilbmPolyFillRect,
- ilbmPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- ilbmTEGlyphBlt,
- ilbmPolyGlyphBlt,
- ilbmPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-
-Bool
-ilbmCreateGC(pGC)
- register GCPtr pGC;
-{
- ilbmPrivGC *pPriv;
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- /* some of the output primitives aren't really necessary, since
- they will be filled in ValidateGC because of dix/CreateGC()
- setting all the change bits. Others are necessary because although
- they depend on being a monochrome frame buffer, they don't change
- */
-
- pGC->ops = &ilbmGCOps;
- pGC->funcs = &ilbmFuncs;
-
- /* ilbm wants to translate before scan convesion */
- pGC->miTranslate = 1;
-
- pPriv = (ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr);
- ilbmReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- ilbmReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, pPriv->rropOS);
-
- pGC->fExpose = TRUE;
- pGC->pRotatedPixmap = NullPixmap;
- pGC->freeCompClip = FALSE;
- return TRUE;
-}
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-/*ARGSUSED*/
-void
-ilbmValidateGC(pGC, changes, pDrawable)
- register GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- register ilbmPrivGCPtr devPriv;
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int xrot, yrot; /* rotations for tile and stipple pattern */
- int rrop; /* reduced rasterop */
- /* flags for changing the proc vector
- and updating things in devPriv
- */
- int new_rotate, new_rrop, new_line, new_text, new_fill;
- DDXPointRec oldOrg; /* origin of thing GC was last used with */
-
- oldOrg = pGC->lastWinOrg;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
-
- /* we need to re-rotate the tile if the previous window/pixmap
- origin (oldOrg) differs from the new window/pixmap origin
- (pGC->lastWinOrg)
- */
- new_rotate = (oldOrg.x != pGC->lastWinOrg.x) ||
- (oldOrg.y != pGC->lastWinOrg.y);
-
-
- devPriv = ((ilbmPrivGCPtr)(pGC->devPrivates[ilbmGCPrivateIndex].ptr));
-
-
- /*
- if the client clip is different or moved OR
- the subwindowMode has changed OR
- the window's clip has changed since the last validation
- we need to recompute the composite clip
- */
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
- ilbmComputeCompositeClip(pGC, pDrawable);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fill = FALSE;
-
- mask = changes;
- while (mask) {
- index = lowbit(mask);
- mask &= ~index;
-
- /* this switch acculmulates a list of which procedures
- might have to change due to changes in the GC. in
- some cases (e.g. changing one 16 bit tile for another)
- we might not really need a change, but the code is
- being paranoid.
- this sort of batching wins if, for example, the alu
- and the font have been changed, or any other pair
- of items that both change the same thing.
- */
- switch (index) {
- case GCPlaneMask:
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCBackground:
- new_rrop = TRUE; /* for opaque stipples */
- break;
- case GCLineStyle:
- case GCLineWidth:
- case GCJoinStyle:
- new_line = TRUE;
- break;
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_fill = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- if (pGC->tileIsPixel)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCStipple:
- if (pGC->stipple == (PixmapPtr)NULL)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCTileStipXOrigin:
- new_rotate = TRUE;
- break;
-
- case GCTileStipYOrigin:
- new_rotate = TRUE;
- break;
-
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- break;
- case GCGraphicsExposures:
- break;
- case GCClipXOrigin:
- break;
- case GCClipYOrigin:
- break;
- case GCClipMask:
- break;
- case GCDashOffset:
- break;
- case GCDashList:
- break;
- case GCArcMode:
- break;
- default:
- break;
- }
- }
-
- /* deal with the changes we've collected .
- new_rrop must be done first because subsequent things
- depend on it.
- */
-
- if (new_rotate || new_fill) {
- Bool new_pix = FALSE;
-
- /* figure out how much to rotate */
- xrot = pGC->patOrg.x;
- yrot = pGC->patOrg.y;
- xrot += pDrawable->x;
- yrot += pDrawable->y;
-
- switch (pGC->fillStyle) {
- case FillTiled:
- /* copy current tile and stipple */
- if (!pGC->tileIsPixel &&
- (pGC->tile.pixmap->drawable.width <= PPW) &&
- !(pGC->tile.pixmap->drawable.width &
- (pGC->tile.pixmap->drawable.width - 1))) {
- ilbmCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- break;
- case FillStippled:
- case FillOpaqueStippled:
- if (pGC->stipple && (pGC->stipple->drawable.width <= PPW) &&
- !(pGC->stipple->drawable.width &
- (pGC->stipple->drawable.width - 1))) {
- ilbmCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- }
- /* destroy any previously rotated tile or stipple */
- if (!new_pix && pGC->pRotatedPixmap) {
- (*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- pGC->pRotatedPixmap = (PixmapPtr)NULL;
- }
- }
-
- /*
- * duck out here when the GC is unchanged
- */
-
- if (!changes)
- return;
-
- if (new_rrop || new_fill) {
- ilbmReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pDrawable->depth,
- devPriv->rrops);
- ilbmReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, devPriv->rropOS);
- new_fill = TRUE;
- }
-
- if (new_line || new_fill || new_text) {
- if (!pGC->ops->devPrivate.val) {
- pGC->ops = miCreateGCOps(pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
-
- if (new_line || new_fill) {
- if (pGC->lineWidth == 0) {
- if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid)
- pGC->ops->PolyArc = ilbmZeroPolyArcSS;
- else
- pGC->ops->PolyArc = miZeroPolyArc;
- } else
- pGC->ops->PolyArc = miPolyArc;
- if (pGC->lineStyle == LineSolid) {
- if (pGC->lineWidth == 0) {
- if (pGC->fillStyle == FillSolid) {
- pGC->ops->PolySegment = ilbmSegmentSS;
- pGC->ops->Polylines = ilbmLineSS;
- } else {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miZeroLine;
- }
- } else {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miWideLine;
- }
- } else {
- if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) {
- pGC->ops->PolySegment = ilbmSegmentSD;
- pGC->ops->Polylines = ilbmLineSD;
- } else {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miWideDash;
- }
- }
- }
-
- if (new_text || new_fill) {
- if ((pGC->font) &&
- (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)) {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- } else {
- /* special case ImageGlyphBlt for terminal emulator fonts */
- if ((pGC->font) &&
- TERMINALFONT(pGC->font)) {
- pGC->ops->ImageGlyphBlt = ilbmTEGlyphBlt;
- } else {
- pGC->ops->ImageGlyphBlt = ilbmImageGlyphBlt;
- }
-
- /* now do PolyGlyphBlt */
- if (pGC->fillStyle == FillSolid) {
- pGC->ops->PolyGlyphBlt = ilbmPolyGlyphBlt;
- } else {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- }
- }
- }
-
- if (new_fill) {
- /* install a suitable fillspans and pushpixels */
- pGC->ops->PushPixels = ilbmPushPixels;
- pGC->ops->FillPolygon = miFillPolygon;
- pGC->ops->PolyFillArc = miPolyFillArc;
-
- switch (pGC->fillStyle) {
- case FillSolid:
- pGC->ops->FillSpans = ilbmSolidFS;
- pGC->ops->FillPolygon = ilbmFillPolygonSolid;
- pGC->ops->PolyFillArc = ilbmPolyFillArcSolid;
- break;
- case FillTiled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = ilbmTileFS;
- else
- pGC->ops->FillSpans = ilbmUnnaturalTileFS;
- break;
- case FillOpaqueStippled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = ilbmOpaqueStippleFS;
- else
- pGC->ops->FillSpans = ilbmUnnaturalOpaqueStippleFS;
- break;
-
- case FillStippled:
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = ilbmStippleFS;
- else
- pGC->ops->FillSpans = ilbmUnnaturalStippleFS;
- break;
- }
- } /* end of new_fill */
-}
-
-void
-ilbmDestroyGC(pGC)
- GCPtr pGC;
-{
- if (pGC->pRotatedPixmap)
- (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- if (pGC->freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- miDestroyGCOps(pGC->ops);
-}
-
-/* table to map alu(src, dst) to alu(~src, dst) */
-int ilbmInverseAlu[16] = {
- GXclear,
- GXandInverted,
- GXnor,
- GXcopyInverted,
- GXand,
- GXnoop,
- GXequiv,
- GXorInverted,
- GXandReverse,
- GXxor,
- GXinvert,
- GXnand,
- GXcopy,
- GXor,
- GXorReverse,
- GXset
-};
-
-void
-ilbmReduceOpaqueStipple(fg, bg, planemask, depth, rop)
-register PixelType fg;
-register PixelType bg;
-register unsigned long planemask;
-int depth;
-register unsigned char *rop;
-{
- register int d;
- register Pixel mask = 1;
-
- bg ^= fg;
-
- for (d = 0; d < depth; d++, mask <<= 1) {
- if (!(planemask & mask))
- rop[d] = RROP_NOP;
- else if (!(bg & mask)) {
- /* Both fg and bg have a 0 or 1 in this plane */
- if (fg & mask)
- rop[d] = RROP_WHITE;
- else
- rop[d] = RROP_BLACK;
- } else {
- /* Both fg and bg have different bits on this plane */
- if (fg & mask)
- rop[d] = RROP_COPY;
- else
- rop[d] = RROP_INVERT;
- }
- }
-}
-
-void
-ilbmReduceRop(alu, src, planemask, depth, rop)
- register int alu;
- register Pixel src;
- register unsigned long planemask;
- int depth;
- register unsigned char *rop;
-{
- register int d;
- register Pixel mask = 1;
-
- for (d = 0; d < depth; d++, mask <<= 1) {
- if (!(planemask & mask))
- rop[d] = RROP_NOP;
- else if ((src & mask) == 0) /* src is black */
- switch (alu) {
- case GXclear:
- rop[d] = RROP_BLACK;
- break;
- case GXand:
- rop[d] = RROP_BLACK;
- break;
- case GXandReverse:
- rop[d] = RROP_BLACK;
- break;
- case GXcopy:
- rop[d] = RROP_BLACK;
- break;
- case GXandInverted:
- rop[d] = RROP_NOP;
- break;
- case GXnoop:
- rop[d] = RROP_NOP;
- break;
- case GXxor:
- rop[d] = RROP_NOP;
- break;
- case GXor:
- rop[d] = RROP_NOP;
- break;
- case GXnor:
- rop[d] = RROP_INVERT;
- break;
- case GXequiv:
- rop[d] = RROP_INVERT;
- break;
- case GXinvert:
- rop[d] = RROP_INVERT;
- break;
- case GXorReverse:
- rop[d] = RROP_INVERT;
- break;
- case GXcopyInverted:
- rop[d] = RROP_WHITE;
- break;
- case GXorInverted:
- rop[d] = RROP_WHITE;
- break;
- case GXnand:
- rop[d] = RROP_WHITE;
- break;
- case GXset:
- rop[d] = RROP_WHITE;
- break;
- }
- else /* src is white */
- switch (alu) {
- case GXclear:
- rop[d] = RROP_BLACK;
- break;
- case GXand:
- rop[d] = RROP_NOP;
- break;
- case GXandReverse:
- rop[d] = RROP_INVERT;
- break;
- case GXcopy:
- rop[d] = RROP_WHITE;
- break;
- case GXandInverted:
- rop[d] = RROP_BLACK;
- break;
- case GXnoop:
- rop[d] = RROP_NOP;
- break;
- case GXxor:
- rop[d] = RROP_INVERT;
- break;
- case GXor:
- rop[d] = RROP_WHITE;
- break;
- case GXnor:
- rop[d] = RROP_BLACK;
- break;
- case GXequiv:
- rop[d] = RROP_NOP;
- break;
- case GXinvert:
- rop[d] = RROP_INVERT;
- break;
- case GXorReverse:
- rop[d] = RROP_WHITE;
- break;
- case GXcopyInverted:
- rop[d] = RROP_BLACK;
- break;
- case GXorInverted:
- rop[d] = RROP_NOP;
- break;
- case GXnand:
- rop[d] = RROP_INVERT;
- break;
- case GXset:
- rop[d] = RROP_WHITE;
- break;
- }
- }
-}
-
-void
-ilbmComputeCompositeClip(pGC, pDrawable)
- GCPtr pGC;
- DrawablePtr pDrawable;
-{
- ScreenPtr pScreen = pGC->pScreen;
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors) {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- } else {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy (or
- * maybe re-use) it later. this way, we avoid unnecessary copying of
- * regions. (this wins especially if many clients clip by children
- * and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE) {
- if (freeCompClip)
- REGION_DESTROY(pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- } else {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip) {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
- pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pScreen, pregWin);
- } else if (freeTmpClip) {
- REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- } else {
- pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- }
- } /* end of composite clip for a window */
- else {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- pixbounds.x1 = 0;
- pixbounds.y1 = 0;
- pixbounds.x2 = pDrawable->width;
- pixbounds.y2 = pDrawable->height;
-
- if (pGC->freeCompClip) {
- REGION_RESET(pScreen, pGC->pCompositeClip, &pixbounds);
- } else {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION) {
- REGION_TRANSLATE(pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
- -pGC->clipOrg.y);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
- pGC->clipOrg.y);
- }
- } /* end of composite clip for pixmap */
-} /* end ilbmComputeCompositeClip */
diff --git a/ilbm/ilbmgetsp.c b/ilbm/ilbmgetsp.c
deleted file mode 100644
index 727bafd39..000000000
--- a/ilbm/ilbmgetsp.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmgetsp.c,v 3.0 1996/08/18 01:53:54 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmgetsp.c,v 5.10 94/04/17 20:28:24 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "region.h"
-#include "gc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-/*ARGSUSED*/
-void
-ilbmGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pchardstStart; /* where to put the bits */
-{
- PixelType *pdstStart = (PixelType *)pchardstStart;
- register PixelType *pdst; /* where to put the bits */
- register PixelType *psrc; /* where to get the bits */
- register PixelType tmpSrc; /* scratch buffer for bits */
- PixelType *psrcBase; /* start of src bitmap */
- int widthSrc; /* width of pixmap in bytes */
- int auxSrc;
- int depthSrc;
- register DDXPointPtr pptLast; /* one past last point to get */
- int xEnd; /* last pixel to copy from */
- register int nstart;
- register int d;
- int nend;
- int srcStartOver;
- PixelType startmask, endmask;
- unsigned int srcBit;
- int nlMiddle, nl;
- int w;
-
- pptLast = ppt + nspans;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthSrc, auxSrc, depthSrc,
- psrcBase);
- pdst = pdstStart;
-
- while (ppt < pptLast) {
- /* XXX should this really be << PWSH, or * 8, or * PGSZB? */
- xEnd = min(ppt->x + *pwidth, widthSrc << PWSH);
- pwidth++;
- for (d = 0; d < depthSrc; d++) {
- psrc = ilbmScanline(psrcBase, ppt->x, ppt->y, auxSrc);
- psrcBase += widthSrc; /* @@@ NEXT PLANE @@@ */
- w = xEnd - ppt->x;
- srcBit = ppt->x & PIM;
-
- if (srcBit + w <= PPW)
- {
- getandputbits0(psrc, srcBit, w, pdst);
- pdst++;
- }
- else
- {
-
- maskbits(ppt->x, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - srcBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- srcStartOver = srcBit + nstart > PLST;
- if (startmask)
- {
- getandputbits0(psrc, srcBit, nstart, pdst);
- if (srcStartOver)
- psrc++;
- }
- nl = nlMiddle;
-#ifdef FASTPUTBITS
- Duff(nl, putbits(*psrc, nstart, PPW, pdst); psrc++; pdst++;);
-#else
- while (nl--)
- {
- tmpSrc = *psrc;
- putbits(tmpSrc, nstart, PPW, pdst);
- psrc++;
- pdst++;
- }
-#endif
- if (endmask)
- {
- putbits(*psrc, nstart, nend, pdst);
- if (nstart + nend > PPW)
- pdst++;
- }
- if (startmask || endmask)
- pdst++;
- }
- }
- ppt++;
- }
-}
diff --git a/ilbm/ilbmhrzvert.c b/ilbm/ilbmhrzvert.c
deleted file mode 100644
index fe2638167..000000000
--- a/ilbm/ilbmhrzvert.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmhrzvert.c,v 3.0 1996/08/18 01:53:55 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmhrzvert.c,v 1.15 94/04/17 20:28:24 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "gc.h"
-#include "window.h"
-#include "pixmap.h"
-#include "region.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-ilbmHorzS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
-PixelType *pbase; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int auxDst;
-int depthDst;
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-register unsigned char *rrops;
-{
- register PixelType *addrl;
- register PixelType startmask;
- register PixelType endmask;
- register int nlmiddle;
- register int d;
- int saveNLmiddle;
-
- /* force the line to go left to right
- but don't draw the last point
- */
- if (len < 0) {
- x1 += len;
- x1 += 1;
- len = -len;
- }
-
- /* all bits inside same longword */
- if ( ((x1 & PIM) + len) < PPW) {
- maskpartialbits(x1, len, startmask);
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(pbase, x1, y1, auxDst);
- pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- *addrl &= ~startmask;
- break;
- case RROP_WHITE:
- *addrl |= startmask;
- break;
- case RROP_INVERT:
- *addrl ^= startmask;
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- } else {
- maskbits(x1, len, startmask, endmask, nlmiddle);
- saveNLmiddle = nlmiddle;
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(pbase, x1, y1, auxDst);
- pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
- nlmiddle = saveNLmiddle;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- break;
-
- case RROP_WHITE:
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- break;
-
- case RROP_INVERT:
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ... ) */
- }
-}
-
-/* vertical solid line
- this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
- better code. sigh. we know that len will never be 0 or 1, so
- it's OK to use it.
-*/
-
-ilbmVertS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
-PixelType *pbase; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int auxDst;
-int depthDst;
-int x1, y1; /* initial point */
-register int len; /* length of line */
-unsigned char *rrops;
-{
- register PixelType *addrl;
- register PixelType bitmask;
- int saveLen;
- int d;
-
- if (len < 0) {
- auxDst = -auxDst;
- len = -len;
- }
-
- saveLen = len;
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(pbase, x1, y1, auxDst);
- pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
- len = saveLen;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- bitmask = rmask[x1 & PIM];
- Duff(len, *addrl &= bitmask; ilbmScanlineInc(addrl, auxDst) );
- break;
-
- case RROP_WHITE:
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl |= bitmask; ilbmScanlineInc(addrl, auxDst) );
- break;
-
- case RROP_INVERT:
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl ^= bitmask; ilbmScanlineInc(addrl, auxDst) );
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-}
diff --git a/ilbm/ilbmimage.c b/ilbm/ilbmimage.c
deleted file mode 100644
index d2f7a4df9..000000000
--- a/ilbm/ilbmimage.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmimage.c,v 3.1 1998/03/20 21:08:02 hohndel Exp $ */
-#include <stdio.h>
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "ilbm.h"
-#include "maskbits.h"
-#include "servermd.h"
-
-void
-ilbmPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
- DrawablePtr pDraw;
- GCPtr pGC;
- int depth, x, y, width, height;
- int leftPad;
- int format;
- char *pImage;
-{
- PixmapPtr pPixmap;
-
-#if 1
- fprintf(stderr, "ilbmPutImage()\n");
- fprintf(stderr, "\tdepth = %d, x = %d, y = %d, width = %d, height = %d, "
- "leftPad = %d\n", depth, x, y, width, height, leftPad);
- switch (format) {
- case XYBitmap:
- fprintf(stderr, "\tformat = XYBitmap\n");
- break;
- case XYPixmap:
- fprintf(stderr, "\tformat = XYPixmap\n");
- break;
- case ZPixmap:
- fprintf(stderr, "\tformat = ZPixmap\n");
- break;
- default:
- fprintf(stderr, "\tformat = %d\n");
- break;
- }
-#endif
-
- if ((width == 0) || (height == 0))
- return;
-
- if (format != ZPixmap || depth == 1 || pDraw->depth == 1) {
- if (format == XYBitmap) {
- char *ptmp;
- int realwidth;
- int size;
- int aux;
- int d, yy, xx;
- char *ss, *dd;
-
- realwidth = BitmapBytePad(width+leftPad);
- aux = depth*realwidth;
- size = height*aux;
-
-#if 1
- fprintf(stderr, "\trealwidth = %d, aux = %d, size = %d\n", realwidth,
- aux, size);
-#endif
-
- if (!(ptmp = (char *)ALLOCATE_LOCAL(size)))
- return;
-
- /*
- * Convert from bitplanes to interleaved bitplanes
- */
-
- ss = (char *)pImage;
- for (d = 0; d < depth; d++) {
- dd = ptmp+d*realwidth;
- for (yy = 0; yy < height; yy++) {
- for (xx = 0; xx < realwidth; xx++)
-#if 1
- {
- fprintf(stderr, "*(%d) = *(%d)\n", (&dd[xx])-ptmp,
- ss-(char *)pImage);
-#endif
- dd[xx] = *(ss++);
-#if 1
- }
-#endif
- dd += aux;
- }
- }
-
- pPixmap = GetScratchPixmapHeader(pDraw->pScreen, width+leftPad, height,
- depth, depth,
- BitmapBytePad(width+leftPad),
- (pointer)ptmp);
- if (!pPixmap) {
- DEALLOCATE_LOCAL(ptmp);
- return;
- }
- pGC->fExpose = FALSE;
- (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
- 0, width, height, x, y, 1);
- DEALLOCATE_LOCAL(ptmp);
- } else {
-#if 0
- /* XXX: bit plane order wronge ! */
- pPixmap->drawable.depth = 1;
- pPixmap->drawable.bitsPerPixel = 1;
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = ilbmDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = ilbmDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = ilbmDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = ilbmDoBitbltOr;
- break;
- default:
- doBitBlt = ilbmDoBitbltGeneral;
- break;
- }
-
- for (plane = (1L << (pPixmap->drawable.depth - 1)); plane;
- plane >>= 1) {
- (void)ilbmBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
- width, height, x, y, doBitBlt, plane);
- /* pDraw->devKind += sizeDst; */
- }
-#else
- char *ptmp;
- int realwidth;
- int size;
- int aux;
- int d, yy, xx;
- char *ss, *dd;
-
- realwidth = BitmapBytePad(width+leftPad);
- aux = depth*realwidth;
- size = height*aux;
-
-#if 1
- fprintf(stderr, "\trealwidth = %d, aux = %d, size = %d\n", realwidth,
- aux, size);
-#endif
-
- if (!(ptmp = (char *)ALLOCATE_LOCAL(size)))
- return;
-
- /*
- * Convert from bitplanes to interleaved bitplanes
- */
-
- ss = (char *)pImage;
- for (d = 0; d < depth; d++) {
- dd = ptmp+d*realwidth;
- for (yy = 0; yy < height; yy++) {
- for (xx = 0; xx < realwidth; xx++)
-#if 1
- {
- fprintf(stderr, "*(%d) = *(%d)\n", (&dd[xx])-ptmp,
- ss-(char *)pImage);
-#endif
- dd[xx] = *(ss++);
-#if 1
- }
-#endif
- dd += aux;
- }
- }
-
- pPixmap = GetScratchPixmapHeader(pDraw->pScreen, width+leftPad, height,
- depth, depth,
- BitmapBytePad(width+leftPad),
- (pointer)ptmp);
- if (!pPixmap) {
- DEALLOCATE_LOCAL(ptmp);
- return;
- }
-
- pGC->fExpose = FALSE;
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
- 0, width, height, x, y);
- DEALLOCATE_LOCAL(ptmp);
-#endif
- }
-
- pGC->fExpose = TRUE;
- FreeScratchPixmapHeader(pPixmap);
- } else {
- /* Chunky to planar conversion required */
-
- PixmapPtr pPixmap;
- ScreenPtr pScreen = pDraw->pScreen;
- int widthSrc;
- int start_srcshift;
- register int b;
- register int dstshift;
- register int shift_step;
- register PixelType dst;
- register PixelType srcbits;
- register PixelType *pdst;
- register PixelType *psrc;
- int start_bit;
- register int nl;
- register int h;
- register int d;
- int auxDst;
- PixelType *pdstBase;
- int widthDst;
- int depthDst;
-
- /* Create a tmp pixmap */
- pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth);
- if (!pPixmap)
- return;
-
- ilbmGetPixelWidthAuxDepthAndPointer((DrawablePtr)pPixmap, widthDst,
- auxDst, depthDst, pdstBase);
-
- widthSrc = PixmapWidthInPadUnits(width, depth);
- /* XXX: if depth == 8, use fast chunky to planar assembly function.*/
- if (depth > 4) {
- start_srcshift = 24;
- shift_step = 8;
- } else {
- start_srcshift = 28;
- shift_step = 4;
- }
-
- for (d = 0; d < depth; d++, pdstBase += widthDst) { /* @@@ NEXT PLANE @@@ */
- register PixelType *pdstLine = pdstBase;
- start_bit = start_srcshift + d;
- psrc = (PixelType *)pImage;
- h = height;
-
- while (h--) {
- pdst = pdstLine;
- pdstLine += auxDst;
- dstshift = PPW - 1;
- dst = 0;
- nl = widthSrc;
- while (nl--) {
- srcbits = *psrc++;
- for (b = start_bit; b >= 0; b -= shift_step) {
- dst |= ((srcbits >> b) & 1) << dstshift;
- if (--dstshift < 0) {
- dstshift = PPW - 1;
- *pdst++ = dst;
- dst = 0;
- }
- }
- }
- if (dstshift != PPW - 1)
- *pdst++ = dst;
- }
- } /* for (d = ...) */
-
- pGC->fExpose = FALSE;
- (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
- width, height, x, y);
- pGC->fExpose = TRUE;
- (*pScreen->DestroyPixmap)(pPixmap);
- }
-}
-
-void
-ilbmGetImage(pDrawable, sx, sy, width, height, format, planemask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, width, height;
- unsigned int format;
- unsigned long planemask;
- char *pdstLine;
-{
- BoxRec box;
- DDXPointRec ptSrc;
- RegionRec rgnDst;
- ScreenPtr pScreen;
- PixmapPtr pPixmap;
-
-#if 1
- fprintf(stderr, "ilbmGetImage()\n");
- fprintf(stderr, "\tsx = %d, sy = %d, width = %d, height = %d, "
- "planemask = 0x%08x\n", sx, sy, width, height, planemask);
- switch (format) {
- case XYBitmap:
- fprintf(stderr, "\tformat = XYBitmap\n");
- break;
- case XYPixmap:
- fprintf(stderr, "\tformat = XYPixmap\n");
- break;
- case ZPixmap:
- fprintf(stderr, "\tformat = ZPixmap\n");
- break;
- default:
- fprintf(stderr, "\tformat = %d\n");
- break;
- }
-#endif
-
- if ((width == 0) || (height == 0))
- return;
-
- pScreen = pDrawable->pScreen;
- sx += pDrawable->x;
- sy += pDrawable->y;
-
- if (format == XYPixmap || pDrawable->depth == 1) {
- pPixmap = GetScratchPixmapHeader(pScreen, width, height, 1, 1,
- BitmapBytePad(width), (pointer)pdstLine);
- if (!pPixmap)
- return;
-
- ptSrc.x = sx;
- ptSrc.y = sy;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
-
- pPixmap->drawable.depth = 1;
- pPixmap->drawable.bitsPerPixel = 1;
- /* dix layer only ever calls GetImage with 1 bit set in planemask
- * when format is XYPixmap.
- */
- ilbmDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, &ptSrc,
- planemask);
-
- FreeScratchPixmapHeader(pPixmap);
- REGION_UNINIT(pScreen, &rgnDst);
- } else {
- /* Planar to chunky conversion required */
-
- PixelType *psrcBits;
- PixelType *psrcLine;
- PixelType startmask, endmask;
- int depthSrc;
- int widthSrc;
- int auxSrc;
- int sizeDst;
- int widthDst;
- register PixelType *psrc;
- register PixelType *pdst;
- register PixelType dst;
- register PixelType srcbits;
- register int d;
- register int b;
- register int dstshift;
- register int shift_step;
- register int start_endbit;
- int start_startbit;
- register int end_endbit;
- register int start_dstshift;
- register int nl;
- register int h;
- int nlmiddle;
-
- widthDst = PixmapWidthInPadUnits(width, pDrawable->depth);
- sizeDst = widthDst * height;
-
- /* Clear the dest image */
- bzero(pdstLine, sizeDst << 2);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthSrc, auxSrc,
- depthSrc, psrcBits);
-
- psrcBits = ilbmScanline(psrcBits, sx, sy, auxSrc);
-
- start_startbit = PPW - 1 - (sx & PIM);
- if ((sx & PIM) + width < PPW) {
- maskpartialbits(sx, width, startmask);
- nlmiddle = 0;
- endmask = 0;
- start_endbit = PPW - ((sx + width) & PIM);
- } else {
- maskbits(sx, width, startmask, endmask, nlmiddle);
- start_endbit = 0;
- end_endbit = PPW - ((sx + width) & PIM);
- }
- /* ZPixmap images have either 4 or 8 bits per pixel dependent on
- * depth.
- */
- if (depthSrc > 4) {
- start_dstshift = 24;
- shift_step = 8;
- } else {
- start_dstshift = 28;
- shift_step = 4;
- }
-#define SHIFT_BITS(start_bit,end_bit) \
-for (b = (start_bit); b >= (end_bit); b--) { \
- dst |= ((srcbits >> b) & 1) << dstshift; \
- if ((dstshift -= shift_step) < 0) { \
- dstshift = start_dstshift + d; \
- *pdst++ = dst; \
- dst = *pdst; \
- } \
-} \
-
- for (d = 0; d < depthSrc; d++, psrcBits += widthSrc) { /* @@@ NEXT PLANE @@@ */
- psrcLine = psrcBits;
- pdst = (PixelType *)pdstLine;
- h = height;
-
- while (h--) {
- psrc = psrcLine;
- psrcLine += auxSrc;
- dst = *pdst;
- dstshift = start_dstshift + d;
-
- if (startmask) {
- srcbits = *psrc++ & startmask;
- SHIFT_BITS(start_startbit, start_endbit);
- }
-
- nl = nlmiddle;
- while (nl--) {
- srcbits = *psrc++;
- SHIFT_BITS(PPW - 1, 0);
- }
- if (endmask) {
- srcbits = *psrc & endmask;
- SHIFT_BITS(PPW - 1, end_endbit);
- }
-
- if (dstshift != start_dstshift + d)
- *pdst++ = dst;
- } /* while (h--) */
- } /* for (d = ...) */
- }
-}
diff --git a/ilbm/ilbmimggblt.c b/ilbm/ilbmimggblt.c
deleted file mode 100644
index 1bd6f02f9..000000000
--- a/ilbm/ilbmimggblt.c
+++ /dev/null
@@ -1,470 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmimggblt.c,v 3.1 1998/03/20 21:08:02 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- we should eventually special-case fixed-width fonts for ImageText.
-
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
- the register allocations for startmask and endmask may not
-be the right thing. are there two other deserving candidates?
-xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
-*/
-
-void
-ilbmImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
- xRectangle backrect;/* backing rectangle to paint.
- in the general case, NOT necessarily
- the same as the string's bounding box
- */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst;
- /* pointer to current longword in dst */
-
- register int d;
- int depthDst;
- int auxDst;
- int hSave;
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- unsigned char rrops[AFB_MAX_DEPTH];
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
- unsigned char *pglyphSave;
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
-
- register int nFirst;/* bits of glyph in current longword */
- PixelType *pdstSave;
- int oldFill;
- ilbmPrivGC *pPriv = (ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthDst, auxDst, depthDst,
- pdstBase);
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- backrect.x = x;
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.width = info.overallWidth;
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
- x += xorg;
- y += yorg;
-
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- oldFill = pGC->fillStyle;
- pGC->fillStyle = FillSolid;
- ilbmReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- ilbmPolyFillRect(pDrawable, pGC, 1, &backrect);
- pGC->fillStyle = oldFill;
- ilbmReduceRop (pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
- pPriv->rrops);
- ilbmReduceRop (GXcopy, pGC->fgPixel, pGC->planemask, pGC->depth, rrops);
-
- /* the faint-hearted can open their eyes now */
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = ilbmScanlineNoBankSwitch(pdstBase, x, y, auxDst);
- xchar = x & PIM;
-
- while (nglyph--) {
- pci = *ppci;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- hSave = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
- /* start at top scanline of glyph */
- pdstSave = ilbmScanlineDelta(pdstBase, -pci->metrics.ascent,
- auxDst);
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST) {
- pdstSave++;
- xoff &= PIM;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += widthDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } /* glyph crosses longwords boundary */
- } /* depth loop */
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar -= PPW;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- ilbmTEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
- int getWidth; /* bits to get from glyph */
-
- if (!(ppos = (ilbmTEXTPOS *)ALLOCATE_LOCAL(nglyph *
- sizeof(ilbmTEXTPOS))))
- return;
-
- pdstBase = ilbmScanlineNoBankSwitch(pdstBase, x, y, auxDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i = 0; i < nglyph; i++) {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar &= PIM;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while (nbox--) {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for (i = 0; i < nglyph; i++) {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- hSave = bottomEdge - topEdge;
- if (hSave <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- pglyphSave += (glyphRow * widthGlyph);
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
- getWidth = w + glyphCol;
-
- pdstSave = ilbmScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
- auxDst);
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST) {
- xoff &= PIM;
- pdstSave++;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += widthDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- maskpartialbits(xoff, w, startmask);
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
- *(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- }
- }
- } /* depth */
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
-
- default:
- break;
- }
-}
diff --git a/ilbm/ilbmline.c b/ilbm/ilbmline.c
deleted file mode 100644
index d831489c5..000000000
--- a/ilbm/ilbmline.c
+++ /dev/null
@@ -1,701 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmline.c,v 3.1 1998/03/20 21:08:02 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmline.c,v 5.18 94/04/17 20:28:26 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-
-void
-#ifdef POLYSEGMENT
-ilbmSegmentSS(pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-ilbmLineSS(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* pointer to start of drawable */
- PixelType *addrl; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int depthDst;
- int d;
- int auxDst;
- unsigned char *rrops;
-
- /* a bunch of temporaries */
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
-
- cclip = pGC->pCompositeClip;
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- addrlBase);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while (--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2) {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- if (nbox) {
- /* stop when lower edge of box is beyond end of line */
- while ((nbox) && (y2 >= pbox->y1)) {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- ilbmVertS(addrlBase, nlwidth, auxDst, depthDst, x1, y1t,
- y2t-y1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- } else if (y1 == y2) /* horizontal line */ {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2) {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while ((nbox) && (pbox->y2 <= y1)) {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1)) {
- int tmp;
-
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while ((nbox) && (pbox->y1 == tmp)) {
- int x1t, x2t;
-
- if (pbox->x2 <= x1) {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2) {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- ilbmHorzS(addrlBase, nlwidth, auxDst, depthDst, x1t, y1,
- x2t-x1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady,
- signdx, signdy, 1, 1, octant);
-
- if (adx > ady) {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- } else {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while (nbox--) {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0) {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- ilbmBresS(addrlBase, nlwidth, auxDst, depthDst, signdx, signdy,
- axis, x1, y1, e, e1, e2, len, rrops); /* @@@ NEXT PLANE PASSED @@@ */
- break;
- } else if (oc1 & oc2) {
- pbox++;
- } else {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1) {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- ilbmBresS(addrlBase, nlwidth, auxDst, depthDst, signdx,
- signdy, axis, new_x1, new_y1, err, e1, e2, len,
- rrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
-
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1))) {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--) {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
- (y2 < pbox->y2)) {
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(addrlBase, x2, y2, auxDst);
- addrlBase += nlwidth; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- *addrl &= rmask[x2 & PIM];
- break;
- case RROP_WHITE:
- *addrl |= mask[x2 & PIM];
- break;
- case RROP_INVERT:
- *addrl ^= mask[x2 & PIM];
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- break;
- } else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-void
-#ifdef POLYSEGMENT
-ilbmSegmentSD(pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-ilbmLineSD(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* address of destination pixmap */
- PixelType *addrl;
- int nlwidth; /* width in longwords of destination pixmap */
- int auxDst;
- int depthDst;
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- unsigned char *rrops;
- unsigned char bgrrops[AFB_MAX_DEPTH];
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
- int d;
-
- cclip = pGC->pCompositeClip;
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- addrlBase);
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- if (isDoubleDash)
- ilbmReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
- bgrrops);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while (--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious) {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady) {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- } else {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while (nbox--) {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0) {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- ilbmBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
- isDoubleDash, addrlBase, nlwidth, auxDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
- rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- break;
-#else
- ilbmBresD(&dashIndex, pDash, numInDashList, &dashOffset,
- isDoubleDash, addrlBase, nlwidth, auxDst, depthDst,
- signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
- rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- goto dontStep;
-#endif
- } else if (oc1 & oc2) {
- pbox++;
- } else /* have to clip */ {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1) {
- pbox++;
- continue;
- }
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- if (clip1) {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len) {
- /* unwind bresenham error term to first point */
- if (clip1) {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- ilbmBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
- isDoubleDash, addrlBase, nlwidth, auxDst, depthDst,
- signdx, signdy, axis, new_x1, new_y1, err, e1, e2,
- len, rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1))) {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--) {
- if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
- (y2 < pbox->y2)) {
- int rop;
-
- for (d = 0; d < depthDst; d++) {
- addrl = ilbmScanline(addrlBase, x2, y2, auxDst);
- addrlBase += nlwidth; /* @@@ NEXT PLANE @@@ */
-
- rop = rrops[d];
- if (dashIndex & 1)
- rop = bgrrops[d];
-
- switch (rop) {
- case RROP_BLACK:
- *addrl &= rmask[x2 & PIM];
- break;
- case RROP_WHITE:
- *addrl |= mask[x2 & PIM];
- break;
-
- case RROP_INVERT:
- *addrl ^= mask[x2 & PIM];
- break;
-
- case RROP_NOP:
- break;
- }
- } /* for (d = ...) */
- break;
- } else
- pbox++;
- }
- }
-#endif
-}
diff --git a/ilbm/ilbmmisc.c b/ilbm/ilbmmisc.c
deleted file mode 100644
index d85346aca..000000000
--- a/ilbm/ilbmmisc.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmmisc.c,v 3.0 1996/08/18 01:53:59 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmmisc.c,v 5.4 94/04/17 20:28:27 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "misc.h"
-#include "cursor.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-
-/*ARGSUSED*/
-void
-ilbmQueryBestSize(class, pwidth, pheight, pScreen)
-int class;
-unsigned short *pwidth;
-unsigned short *pheight;
-ScreenPtr pScreen;
-{
- unsigned width, test;
-
- switch (class) {
- case CursorShape:
- if (*pwidth > pScreen->width)
- *pwidth = pScreen->width;
- if (*pheight > pScreen->height)
- *pheight = pScreen->height;
- break;
- case TileShape:
- case StippleShape:
- width = *pwidth;
- if (!width) break;
- /* Return the closes power of two not less than what they gave me */
- test = 0x80000000;
- /* Find the highest 1 bit in the width given */
- while (!(test & width))
- test >>= 1;
- /* If their number is greater than that, bump up to the next
- * power of two */
- if ((test - 1) & width)
- test <<= 1;
- *pwidth = test;
- /* We don't care what height they use */
- break;
- }
-}
diff --git a/ilbm/ilbmpixmap.c b/ilbm/ilbmpixmap.c
deleted file mode 100644
index ab5a33f2a..000000000
--- a/ilbm/ilbmpixmap.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmpixmap.c,v 3.0 1996/08/18 01:54:01 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmpixmap.c,v 5.13 94/04/17 20:28:28 dpw Exp $ */
-
-/* pixmap management
- written by drewry, september 1986
-
- on a monchrome device, a pixmap is a bitmap.
-*/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "maskbits.h"
-
-#include "ilbm.h"
-#include "mi.h"
-
-#include "servermd.h"
-
-PixmapPtr
-ilbmCreatePixmap(pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
-
- paddedWidth = BitmapBytePad(width);
- datasize = height * paddedWidth * depth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return(NullPixmap);
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = depth;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = datasize ?
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
- pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
- return(pPixmap);
-}
-
-Bool
-ilbmDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- if (--pPixmap->refcnt)
- return(TRUE);
- xfree(pPixmap);
- return(TRUE);
-}
-
-
-PixmapPtr
-ilbmCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
- ScreenPtr pScreen;
-
- size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
- pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
- if (!pDst)
- return(NullPixmap);
- memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
- return(pDst);
-}
-
-
-/* replicates a pattern to be a full 32 bits wide.
- relies on the fact that each scnaline is longword padded.
- doesn't do anything if pixmap is not a factor of 32 wide.
- changes width field of pixmap if successful, so that the fast
- XRotatePixmap code gets used if we rotate the pixmap later.
-
- calculate number of times to repeat
- for each scanline of pattern
- zero out area to be filled with replicate
- left shift and or in original as many times as needed
-*/
-void
-ilbmPadPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- register int width = pPixmap->drawable.width;
- register int h;
- register PixelType mask;
- register PixelType *p;
- register PixelType bits; /* real pattern bits */
- register int i;
- int d;
- int rep; /* repeat count for pattern */
-
- if (width >= PPW)
- return;
-
- rep = PPW/width;
- if (rep*width != PPW)
- return;
-
- mask = endtab[width];
-
- p = (PixelType *)(pPixmap->devPrivate.ptr);
-
- for (d = 0; d < pPixmap->drawable.depth; d++) {
- for (h = 0; h < pPixmap->drawable.height; h++) {
- *p &= mask;
- bits = *p;
- for (i = 1; i < rep; i++) {
- bits = SCRRIGHT(bits, width);
- *p |= bits;
- }
- p++;
- }
- }
- pPixmap->drawable.width = PPW;
-}
-
-/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
- * words are PPW bits wide, and that the least significant bit appears on the
- * left.
- */
-void
-ilbmXRotatePixmap(pPix, rw)
- PixmapPtr pPix;
- register int rw;
-{
- register PixelType *pw, *pwFinal;
- register PixelType t;
-
- if (pPix == NullPixmap)
- return;
-
- pw = (PixelType *)pPix->devPrivate.ptr;
- rw %= (int)pPix->drawable.width;
- if (rw < 0)
- rw += (int)pPix->drawable.width;
- if (pPix->drawable.width == PPW) {
- pwFinal = pw + pPix->drawable.height * pPix->drawable.depth;
- while (pw < pwFinal) {
- t = *pw;
- *pw++ = SCRRIGHT(t, rw) | (SCRLEFT(t, (PPW-rw)) & endtab[rw]);
- }
- } else {
- /* We no longer do this. Validate doesn't try to rotate odd-size
- * tiles or stipples. ilbmUnnatural<tile/stipple>FS works directly off
- * the unrotate tile/stipple in the GC
- */
- ErrorF("X internal error: trying to rotate odd-sized pixmap.\n");
- }
-
-}
-
-/* Rotates pixmap pPix by h lines. Assumes that h is always less than
- pPix->height
- works on any width.
- */
-void
-ilbmYRotatePixmap(pPix, rh)
- register PixmapPtr pPix;
- int rh;
-{
- int nbyDown; /* bytes to move down to row 0; also offset of
- row rh */
- int nbyUp; /* bytes to move up to line rh; also
- offset of first line moved down to 0 */
- char *pbase;
- char *ptmp;
- int height;
- int aux;
-
- if (pPix == NullPixmap)
- return;
- height = (int) pPix->drawable.height;
- rh %= height;
- if (rh < 0)
- rh += height;
-
- aux = pPix->devKind*pPix->drawable.depth;
- nbyDown = rh*aux;
- nbyUp = height*aux-nbyDown;
-
- if (!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
- return;
-
- pbase = (char *)pPix->devPrivate.ptr;
- memmove(ptmp, pbase, nbyUp); /* save the low rows */
- memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
- memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */
- DEALLOCATE_LOCAL(ptmp);
-}
-
-void
-ilbmCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
- register PixmapPtr psrcPix, *ppdstPix;
- int xrot, yrot;
-{
- register PixmapPtr pdstPix;
-
- if ((pdstPix = *ppdstPix) && (pdstPix->devKind == psrcPix->devKind) &&
- (pdstPix->drawable.height == psrcPix->drawable.height) &&
- (pdstPix->drawable.depth == psrcPix->drawable.depth)) {
- memmove((char *)pdstPix->devPrivate.ptr, (char *)psrcPix->devPrivate.ptr,
- psrcPix->drawable.height * psrcPix->devKind *
- psrcPix->drawable.depth);
- pdstPix->drawable.width = psrcPix->drawable.width;
- pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- } else {
- if (pdstPix)
- /* FIX XBUG 6168 */
- (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
- *ppdstPix = pdstPix = ilbmCopyPixmap(psrcPix);
- if (!pdstPix)
- return;
- }
- ilbmPadPixmap(pdstPix);
- if (xrot)
- ilbmXRotatePixmap(pdstPix, xrot);
- if (yrot)
- ilbmYRotatePixmap(pdstPix, yrot);
-}
diff --git a/ilbm/ilbmply1rct.c b/ilbm/ilbmply1rct.c
deleted file mode 100644
index b76a29892..000000000
--- a/ilbm/ilbmply1rct.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmply1rct.c,v 3.1 1998/03/20 21:08:03 hohndel Exp $ */
-/*
- * $XConsortium: ilbmply1rct.c,v 1.9 94/04/17 20:28:28 dpw Exp $
- *
-Copyright (c) 1990 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-#if defined(mips) || defined(sparc)
-#define GetHighWord(x) (((int)(x)) >> 16)
-#else
-#define GetHighWord(x) (((int)(x)) / 65536)
-#endif
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) (i))))
-#define coordToInt(x,y) (((x) << 16) | (y))
-#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int)((short) i))
-#else
-#define intToCoord(i,x,y) (((x) = (int)((short) (i))), ((y) = GetHighWord(i)))
-#define coordToInt(x,y) (((y) << 16) | (x))
-#define intToX(i) ((int)((short) (i)))
-#define intToY(i) (GetHighWord(i))
-#endif
-
-void
-ilbmFillPolygonSolid (pDrawable, pGC, shape, mode, count, ptsIn)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int shape;
- int mode;
- int count;
- DDXPointPtr ptsIn;
-{
- ilbmPrivGCPtr devPriv;
- int nlwidth;
- PixelType *addrl, *addr;
- int maxy;
- int origin;
- register int vertex1, vertex2;
- int c;
- BoxPtr extents;
- int clip;
- int y;
- int *vertex1p, *vertex2p;
- int *endp;
- int x1, x2;
- int dx1, dx2;
- int dy1, dy2;
- int e1, e2;
- int step1, step2;
- int sign1, sign2;
- int h;
- int l, r;
- PixelType mask, bits = ~((PixelType)0);
- int nmiddle;
- register unsigned char *rrops;
- register int n;
- register int d;
- int auxDst;
- int depthDst;
- register PixelType *pdst;
-
- devPriv = (ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr);
-
- if (mode == CoordModePrevious || shape != Convex ||
- REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
- origin = *((int *) &pDrawable->x);
- origin -= (origin & 0x8000) << 1;
- extents = &pGC->pCompositeClip->extents;
- vertex1 = *((int *) &extents->x1) - origin;
- vertex2 = *((int *) &extents->x2) - origin - 0x00010001;
- clip = 0;
- y = 32767;
- maxy = 0;
- vertex2p = (int *) ptsIn;
- endp = vertex2p + count;
- while (count--) {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y) {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- }
- if (y == maxy)
- return;
-
- if (clip & 0x80008000) {
- miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
- return;
- }
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- addrl);
- rrops = devPriv->rrops;
- addrl = ilbmScanlineDelta(addrl, y + pDrawable->y, auxDst);
- origin = intToX(origin);
- vertex2p = vertex1p;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
- x = intToX(vertex); \
- if (dy = intToY(c) - y) { \
- dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx = dx % dy; \
- } \
- } else { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx = dx % dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) { \
- x += sign; \
- e -= dy; \
- } \
-}
- for (;;) {
- if (y == intToY(vertex1)) {
- do {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
- } while (y >= intToY(vertex1));
- h = dy1;
- } else {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2)) {
- do {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- } else {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
- /* fill spans for this segment */
- y += h;
- for (;;) {
- l = x1;
- r = x2;
- nmiddle = x2 - x1;
- if (nmiddle < 0) {
- nmiddle = -nmiddle;
- l = x2;
- r = x1;
- }
- c = l & PIM;
- l -= c;
- l = l >> PWSH;
- addr = addrl + l;
- if (c + nmiddle < PPW) {
- mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle);
- for (pdst = addr, d = 0; d < depthDst; d++, pdst += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- *pdst |= mask;
- break;
- case RROP_INVERT:
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- } else {
- if (c) {
- mask = SCRRIGHT(bits, c);
- for (pdst = addr, d = 0; d < depthDst; d++, pdst += nlwidth) { /* @@@ NEXT PLANE @@@ */
- switch (rrops[d]) {
- case RROP_BLACK:
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- *pdst |= mask;
- break;
- case RROP_INVERT:
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- nmiddle += c - PPW;
- addr++;
- }
- nmiddle >>= PWSH;
- mask = ~SCRRIGHT(bits, r & PIM);
-
- for (d = 0; d < depthDst; d++, addr += nlwidth) { /* @@@ NEXT PLANE @@@ */
- n = nmiddle;
- pdst = addr;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- Duff (n, *pdst++ = 0;)
- if (mask)
- *pdst &= ~mask;
- break;
- case RROP_WHITE:
- Duff (n, *pdst++ = ~0;);
- if (mask)
- *pdst |= mask;
- break;
- case RROP_INVERT:
- Duff (n, *pdst++ ^= ~0;);
- if (mask)
- *pdst ^= mask;
- break;
- case RROP_NOP:
- break;
- }
- }
- }
- if (!--h)
- break;
- ilbmScanlineInc(addrl, auxDst);
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if (y == maxy)
- break;
- ilbmScanlineInc(addrl, auxDst);
- }
-}
diff --git a/ilbm/ilbmplygblt.c b/ilbm/ilbmplygblt.c
deleted file mode 100644
index a7dca5756..000000000
--- a/ilbm/ilbmplygblt.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmplygblt.c,v 3.1 1998/03/20 21:08:03 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmimggblt.c,v 5.17 94/04/17 20:28:25 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
-*/
-
-void
-ilbmPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
- xRectangle backrect; /* backing rectangle to paint.
- in the general case, NOT necessarily
- the same as the string's bounding box
- */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst; /* pointer to current longword in dst */
-
- register int d;
- int depthDst;
- int auxDst;
- int hSave;
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- unsigned char *rrops;
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
- unsigned char *pglyphSave;
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
-
- register int nFirst; /* bits of glyph in current longword */
- PixelType *pdstSave;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthDst, auxDst, depthDst,
- pdstBase);
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- x += xorg;
- y += yorg;
-
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- rrops = ((ilbmPrivGCPtr) pGC->devPrivates[ilbmGCPrivateIndex].ptr)->rrops;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = ilbmScanlineNoBankSwitch(pdstBase, x, y, auxDst);
- xchar = x & PIM;
-
- while (nglyph--) {
- pci = *ppci;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- hSave = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
- /* start at top scanline of glyph */
- pdstSave = ilbmScanlineDelta(pdstBase, -pci->metrics.ascent,
- auxDst);
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST) {
- pdstSave++;
- xoff &= PIM;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += widthDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- }
- } else {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getleftbits(pglyph, w, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- }
- } /* glyph crosses longwords boundary */
- } /* depth loop */
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar -= PPW;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- ilbmTEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
- int getWidth; /* bits to get from glyph */
-
- if (!(ppos = (ilbmTEXTPOS *)ALLOCATE_LOCAL(nglyph *
- sizeof(ilbmTEXTPOS))))
- return;
-
- pdstBase = ilbmScanlineNoBankSwitch(pdstBase, x, y, auxDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i = 0; i < nglyph; i++) {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST) {
- xchar &= PIM;
- pdstBase++;
- } else if (xchar < 0) {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while (nbox--) {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for (i = 0; i<nglyph; i++) {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- hSave = bottomEdge - topEdge;
- if (hSave <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
- pglyphSave += (glyphRow * widthGlyph);
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
- getWidth = w + glyphCol;
-
- pdstSave = ilbmScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
- auxDst);
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST) {
- xoff &= PIM;
- pdstSave++;
- } else if (xoff < 0) {
- xoff += PPW;
- pdstSave--;
- }
-
- for (d = 0; d < depthDst; d++) {
- h = hSave;
- pdst = pdstSave;
- pdstSave += widthDst; /* @@@ NEXT PLANE @@@ */
- pglyph = pglyphSave;
-
- if ((xoff + w) <= PPW) {
- maskpartialbits(xoff, w, startmask);
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- }
- } else {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- switch (rrops[d]) {
- case RROP_WHITE:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_BLACK:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- ilbmScanlineInc(pdst, auxDst);
- }
- break;
- }
- }
- } /* depth */
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
-
- default:
- break;
- }
-}
diff --git a/ilbm/ilbmpntarea.c b/ilbm/ilbmpntarea.c
deleted file mode 100644
index 0199b0bc6..000000000
--- a/ilbm/ilbmpntarea.c
+++ /dev/null
@@ -1,652 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmpntarea.c,v 3.0 1996/08/18 01:54:04 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmpntarea.c,v 5.7 94/04/17 20:28:29 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-/*
- the solid fillers are called for rectangles and window backgrounds.
- the boxes are already translated.
- maybe this should always take a pixmap instead of a drawable?
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*ARGSUSED*/
-void
-ilbmSolidFillArea(pDraw, nbox, pbox, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- register unsigned char *rrops;
-{
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int h; /* height of current box */
- register PixelType *p; /* pointer to bits we're writing */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType startmask;
- register PixelType endmask;
- /* masks for reggedy bits at either end of line */
- register int nlwExtra; /* to get from right of box to left of next span */
- int nlwMiddle; /* number of longwords between sides of boxes */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- int saveH;
- int depthDst;
- int auxDst;
- register int d;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst, pbits);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
-
- saveP = ilbmScanline(pbits, pbox->x1, pbox->y1, auxDst);
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- for (d = 0; d < depthDst; d++) {
- h = saveH;
- p = saveP;
- saveP += nlwidth; /* @@@ NEXT PLANE @@@ */
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = auxDst;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- Duff(h, *p &= ~startmask; ilbmScanlineInc(p, nlwExtra));
- break;
- case RROP_WHITE:
- Duff(h, *p |= startmask; ilbmScanlineInc(p, nlwExtra));
- break;
- case RROP_INVERT:
- Duff(h, *p ^= startmask; ilbmScanlineInc(p, nlwExtra));
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ..) */
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++) {
- h = saveH;
- p = saveP;
- saveP += nlwidth; /* @@@ NEXT PLANE @@@ */
- nlwExtra = auxDst - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- *p &= ~startmask;
- p++;
- Duff(nlw, *p++ = 0);
- *p &= ~endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- *p |= startmask;
- p++;
- Duff(nlw, *p++ = ~0);
- *p |= endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- *p ^= startmask;
- p++;
- Duff(nlw, *p++ ^= ~0);
- *p ^= endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- *p &= ~startmask;
- p++;
- Duff(nlw, *p++ = 0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- *p |= startmask;
- p++;
- Duff(nlw, *p++ = ~0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- *p ^= startmask;
- p++;
- Duff(nlw, *p++ ^= ~0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- }
- } else if (!startmask && endmask) {
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = 0);
- *p &= ~endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = ~0);
- *p |= endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= ~0);
- *p ^= endmask;
- ilbmScanlineInc(p, nlwExtra);
- }
- case RROP_NOP:
- break;
- }
- } else { /* no ragged bits at either end */
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = 0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ = ~0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= ~0);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- }
- } /* for (d = 0 ... ) */
- }
- pbox++;
- }
-}
-
-/* stipple a list of boxes -
-
-you can use the reduced rasterop for stipples. if rrop is
-black, AND the destination with (not stipple pattern). if rrop is
-white OR the destination with the stipple pattern. if rrop is invert,
-XOR the destination with the stipple pattern.
-*/
-
-/*ARGSUSED*/
-void
-ilbmStippleAreaPPW(pDraw, nbox, pbox, pstipple, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- PixmapPtr pstipple;
- unsigned char *rrops;
-{
- register PixelType *psrc; /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
-
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- register int h; /* height of current box */
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- int auxDst;
- int depthDst;
- int d;
- int saveIy;
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *pBase;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst, pBase);
-
- tileHeight = pstipple->drawable.height;
- psrc = (PixelType *)(pstipple->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveIy = pbox->y1 % tileHeight;
- pbits = pBase;
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = auxDst;
- for (d = 0; d < depthDst; d++) {
- p = ilbmScanline(pbits, pbox->x1, pbox->y1, auxDst);
- pbits += nlwidth; /* @@@ NEXT PLANE @@@ */
- iy = saveIy;
- h = pbox->y2 - pbox->y1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p &= ~(srcpix & startmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p |= (srcpix & startmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p ^= (srcpix & startmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++) {
- nlwExtra = auxDst - nlwMiddle;
- p = ilbmScanline(pbits, pbox->x1, pbox->y1, auxDst);
- pbits += nlwidth; /* @@@ NEXT PLANE @@@ */
- iy = saveIy;
- h = pbox->y2 - pbox->y1;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p &= ~(srcpix & startmask);
- p++;
- Duff (nlw, *p++ &= ~srcpix);
- *p &= ~(srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p |= (srcpix & startmask);
- p++;
- Duff (nlw, *p++ |= srcpix);
- *p |= (srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p ^= (srcpix & startmask);
- p++;
- Duff (nlw, *p++ ^= srcpix);
- *p ^= (srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p &= ~(srcpix & startmask);
- p++;
- Duff(nlw, *p++ &= ~srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p |= (srcpix & startmask);
- p++;
- Duff(nlw, *p++ |= srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p ^= (srcpix & startmask);
- p++;
- Duff(nlw, *p++ ^= srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else if (!startmask && endmask) {
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ &= ~srcpix);
- *p &= ~(srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ |= srcpix);
- *p |= (srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= srcpix);
- *p ^= (srcpix & endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } else { /* no ragged bits at either end */
- switch (rrops[d]) {
- case RROP_BLACK:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ &= ~srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_WHITE:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ |= srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- case RROP_INVERT:
- while (h--) {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ ^= srcpix);
- ilbmScanlineInc(p, nlwExtra);
- }
- break;
- } /* switch */
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-ilbmStippleArea(pDraw, nbox, pbox, pTile, xOff, yOff, rrops)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- unsigned char *rrops;
-{
- register PixelType *psrc; /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- int auxDst;
- int depthDst;
- int sizeTile;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- register int rop;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst, pBase);
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind/sizeof(PixelType);
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *)pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = ilbmScanline(pBase, pbox->x1, pbox->y1, auxDst);
-
- for (d = 0; d < depthDst; d++, saveP += nlwidth) { /* @@@ NEXT PLANE @@@ */
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- rop = rrops[d];
-
- while (width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrrop((psrc + endinc), (rem & PIM), (x & PIM), w,
- pdst, rop)
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrrop(*psrc, x & PIM, w, pdst, rop);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- getandputrrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
-
- if (endmask) {
- getandputrrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += auxDst;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
diff --git a/ilbm/ilbmpntwin.c b/ilbm/ilbmpntwin.c
deleted file mode 100644
index 5cc29e331..000000000
--- a/ilbm/ilbmpntwin.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmpntwin.c,v 3.0 1996/08/18 01:54:05 dawes Exp $ */
-/* $XConsortium: ilbmpntwin.c,v 5.12 94/04/17 20:28:30 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-#include "mi.h"
-
-void
-ilbmPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- register ilbmPrivWin *pPrivWin;
- unsigned char rrops[AFB_MAX_DEPTH];
-
- pPrivWin = (ilbmPrivWin *)(pWin->devPrivates[ilbmWindowPrivateIndex].ptr);
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- return;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground) {
- ilbmTileAreaPPWCopy((DrawablePtr)pWin,
- REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBackground, ~0);
- return;
- } else {
- ilbmTileAreaCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pWin->background.pixmap, 0, 0, ~0);
- return;
- }
- break;
- case BackgroundPixel:
- ilbmReduceRop(GXcopy, pWin->background.pixel, ~0,
- pWin->drawable.depth, rrops);
- ilbmSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), rrops);
- return;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel) {
- ilbmReduceRop(GXcopy, pWin->border.pixel, ~0, pWin->drawable.depth,
- rrops);
- ilbmSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), rrops);
- return;
- } else if (pPrivWin->fastBorder) {
- ilbmTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBorder, ~0);
- return;
- }
- break;
- }
- miPaintWindow(pWin, pRegion, what);
-}
diff --git a/ilbm/ilbmpolypnt.c b/ilbm/ilbmpolypnt.c
deleted file mode 100644
index f313dc8d1..000000000
--- a/ilbm/ilbmpolypnt.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmpolypnt.c,v 3.1 1998/03/20 21:08:03 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmpolypnt.c,v 5.6 94/04/17 20:28:30 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "miscstruct.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-void
-ilbmPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- register DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
-
- register BoxPtr pbox;
- register int nbox;
- register int d;
-
- register PixelType *addrl;
- PixelType *pBase;
- PixelType *pBaseSave;
- int nlwidth;
- int auxDst;
- int depthDst;
-
- int nptTmp;
- register xPoint *ppt;
-
- register int x;
- register int y;
- register unsigned char *rrops;
- ilbmPrivGC *pGCPriv;
-
- pGCPriv = (ilbmPrivGC *) pGC->devPrivates[ilbmGCPrivateIndex].ptr;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
- pBaseSave);
-
- rrops = pGCPriv->rrops;
- if ((mode == CoordModePrevious) && (npt > 1))
- for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
-
- nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
- pbox = REGION_RECTS(pGC->pCompositeClip);
- for (; --nbox >= 0; pbox++)
- for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += nlwidth) { /* @@@ NEXT PLANE @@@ */
- addrl = pBase;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *ilbmScanline(addrl, x, y, auxDst) &= rmask[x & PIM];
- }
- break;
-
- case RROP_WHITE:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *ilbmScanline(addrl, x, y, auxDst) |= mask[x & PIM];
- }
- break;
-
- case RROP_INVERT:
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *ilbmScanline(addrl, x, y, auxDst) ^= mask[x & PIM];
- }
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
-}
diff --git a/ilbm/ilbmpushpxl.c b/ilbm/ilbmpushpxl.c
deleted file mode 100644
index 6a045d242..000000000
--- a/ilbm/ilbmpushpxl.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmpushpxl.c,v 3.1 1998/03/20 21:08:03 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmpushpxl.c,v 5.6 94/04/17 20:28:31 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miscstruct.h"
-#include "maskbits.h"
-#include "regionstr.h"
-#include "ilbm.h"
-
-/* ilbmSolidPP is courtesy of xhacks@csri.toronto.edu
-
- For fillStyle==FillSolid, a monochrome PushPixels can be reduced to
- a ROP in the following way: (Note that the ROP is the same as the
- result of ROP(src=0x3,dst=0x5))
-
- src=0011 0000 0011
- dst=0101 0101 0101
- rop fg=0 fg=1
- GXclear 0x0 0000 0100 0100 0
- GXand 0x1 0001 0100 0101 s&d
- GXandReverse 0x2 0010 0100 0110 s&~d
- GXcopy 0x3 0011 0100 0111 s
- GXandInverted 0x4 0100 0101 0100 ~s&d
- GXnoop 0x5 0101 0101 0101 d
- GXxor 0x6 0110 0101 0110 s^d
- GXor 0x7 0111 0101 0111 s|d
- GXnor 0x8 1000 0110 0100 ~s&~d
- GXequiv 0x9 1001 0110 0101 ~s^d
- GXinvert 0xa 1010 0110 0110 ~d
- GXorReverse 0xb 1011 0110 0111 s|~d
- GXcopyInverted 0xc 1100 0111 0100 ~s
- GXorInverted 0xd 1101 0111 0101 ~s|d
- GXnand 0xe 1110 0111 0110 ~s|~d
- GXset 0xf 1111 0111 0111 1
-
-For src=0: newRop = 0x4|(rop>>2)
-For src=1: newRop = 0x4|(rop&3)
-*/
-
-/* ilbmSolidPP -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-ilbmSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- unsigned char alu;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- BoxRec srcBox;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
-
- if (!pGC->planemask & 1) return;
-
- /* compute the reduced rop function */
- alu = pGC->alu;
- if (!(pGC->fgPixel&1)) alu >>= 2;
- alu = (alu & 0x3) | 0x4;
- if (alu == GXnoop) return;
-
- srcBox.x1 = xOrg;
- srcBox.y1 = yOrg;
- srcBox.x2 = xOrg + dx;
- srcBox.y2 = yOrg + dy;
- REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1);
-
- /* clip the shape of the dst to the destination composite clip */
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
-
- if (!REGION_NIL(&rgnDst)) {
- i = REGION_NUM_RECTS(&rgnDst);
- pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if (pptSrc) {
- for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; --i >= 0;
- pbox++, ppt++) {
- ppt->x = pbox->x1 - xOrg;
- ppt->y = pbox->y1 - yOrg;
- }
- ilbmDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc,
- pGC->planemask);
- DEALLOCATE_LOCAL(pptSrc);
- }
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
-}
-
-#define NPT 128
-
-/* ilbmPushPixels -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-ilbmPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- int h, dxDivPPW, ibEnd;
- PixelType *pwLineStart;
- register PixelType *pw, *pwEnd;
- register PixelType mask;
- register int ib;
- register PixelType w;
- register int ipt; /* index into above arrays */
- Bool fInBox;
- DDXPointRec pt[NPT];
- int width[NPT];
-
- /* Now scan convert the pixmap and use the result to call fillspans in
- * in the drawable with the original GC */
- ipt = 0;
- dxDivPPW = dx/PPW;
- for (h = 0; h < dy; h++) {
-
- pw = (PixelType *)
- (((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind));
- pwLineStart = pw;
- /* Process all words which are fully in the pixmap */
-
- fInBox = FALSE;
- pwEnd = pwLineStart + dxDivPPW;
- while (pw < pwEnd) {
- w = *pw;
- mask = endtab[1];
- for (ib = 0; ib < PPW; ib++) {
- if (w & mask) {
- if (!fInBox) {
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- /* start new box */
- fInBox = TRUE;
- }
- } else {
- if (fInBox) {
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- /* end box */
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- pw++;
- }
- ibEnd = dx & PIM;
- if (ibEnd) {
- /* Process final partial word on line */
- w = *pw;
- mask = endtab[1];
- for (ib = 0; ib < ibEnd; ib++) {
- if (w & mask) {
- if (!fInBox) {
- /* start new box */
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- fInBox = TRUE;
- }
- } else {
- if (fInBox) {
- /* end box */
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if (fInBox) {
- width[ipt] = dx + xOrg - pt[ipt].x;
- if (++ipt >= NPT) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- }
- }
- /* Flush any remaining spans */
- if (ipt) {
- (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
- }
-}
diff --git a/ilbm/ilbmscrinit.c b/ilbm/ilbmscrinit.c
deleted file mode 100644
index 5a6fa71a0..000000000
--- a/ilbm/ilbmscrinit.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmscrinit.c,v 3.5 1998/11/22 10:37:40 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmscrinit.c,v 5.17 94/04/17 20:28:34 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xproto.h" /* for xColorItem */
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "ilbm.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "servermd.h"
-
-#ifdef PIXMAP_PER_WINDOW
-int frameWindowPrivateIndex;
-#endif
-int ilbmWindowPrivateIndex;
-int ilbmGCPrivateIndex;
-int ilbmScreenPrivateIndex;
-
-static unsigned long ilbmGeneration = 0;
-
-BSFuncRec ilbmBSFuncRec = {
- ilbmSaveAreas,
- ilbmRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-Bool
-ilbmCloseScreen(index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- int d;
- DepthPtr depths = pScreen->allowedDepths;
-
- for (d = 0; d < pScreen->numDepths; d++)
- xfree(depths[d].vids);
- xfree(depths);
- xfree(pScreen->visuals);
- xfree(pScreen->devPrivates[ilbmScreenPrivateIndex].ptr);
- return(TRUE);
-}
-
-Bool
-ilbmCreateScreenResources(pScreen)
- ScreenPtr pScreen;
-{
- Bool retval;
-
- pointer oldDevPrivate = pScreen->devPrivate;
-
- pScreen->devPrivate = pScreen->devPrivates[ilbmScreenPrivateIndex].ptr;
- retval = miCreateScreenResources(pScreen);
-
- /* Modify screen's pixmap devKind value stored off devPrivate to
- * be the width of a single plane in longs rather than the width
- * of a chunky screen in longs as incorrectly setup by the mi routine.
- */
- ((PixmapPtr)pScreen->devPrivate)->devKind = BitmapBytePad(pScreen->width);
- pScreen->devPrivates[ilbmScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
- return(retval);
-}
-
-Bool
-ilbmAllocatePrivates(pScreen, pWinIndex, pGCIndex)
- ScreenPtr pScreen;
- int *pWinIndex, *pGCIndex;
-{
- if (ilbmGeneration != serverGeneration) {
-#ifdef PIXMAP_PER_WINDOW
- frameWindowPrivateIndex = AllocateWindowPrivateIndex();
-#endif
- ilbmWindowPrivateIndex = AllocateWindowPrivateIndex();
- ilbmGCPrivateIndex = AllocateGCPrivateIndex();
- ilbmGeneration = serverGeneration;
- }
- if (pWinIndex)
- *pWinIndex = ilbmWindowPrivateIndex;
- if (pGCIndex)
- *pGCIndex = ilbmGCPrivateIndex;
-
- ilbmScreenPrivateIndex = AllocateScreenPrivateIndex();
- pScreen->GetWindowPixmap = ilbmGetWindowPixmap;
- pScreen->SetWindowPixmap = ilbmSetWindowPixmap;
- return(AllocateWindowPrivate(pScreen, ilbmWindowPrivateIndex, sizeof(ilbmPrivWin)) &&
- AllocateGCPrivate(pScreen, ilbmGCPrivateIndex, sizeof(ilbmPrivGC)));
-}
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-ilbmScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
- pointer oldDevPrivate;
-
- rootdepth = 0;
- if (!ilbmInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual, 256, 8)) {
- ErrorF("ilbmInitVisuals: FALSE\n");
- return FALSE;
- }
- if (!ilbmAllocatePrivates(pScreen,(int *)NULL, (int *)NULL)) {
- ErrorF("ilbmAllocatePrivates: FALSE\n");
- return FALSE;
- }
-
- pScreen->defColormap = (Colormap)FakeClientID(0);
- /* whitePixel, blackPixel */
- pScreen->blackPixel = 0;
- pScreen->whitePixel = 0;
- pScreen->QueryBestSize = ilbmQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = ilbmGetImage;
- pScreen->GetSpans = ilbmGetSpans;
- pScreen->CreateWindow = ilbmCreateWindow;
- pScreen->DestroyWindow = ilbmDestroyWindow;
- pScreen->PositionWindow = ilbmPositionWindow;
- pScreen->ChangeWindowAttributes = ilbmChangeWindowAttributes;
- pScreen->RealizeWindow = ilbmMapWindow;
- pScreen->UnrealizeWindow = ilbmUnmapWindow;
- pScreen->PaintWindowBackground = ilbmPaintWindow;
- pScreen->PaintWindowBorder = ilbmPaintWindow;
- pScreen->CopyWindow = ilbmCopyWindow;
- pScreen->CreatePixmap = ilbmCreatePixmap;
- pScreen->DestroyPixmap = ilbmDestroyPixmap;
- pScreen->RealizeFont = ilbmRealizeFont;
- pScreen->UnrealizeFont = ilbmUnrealizeFont;
- pScreen->CreateGC = ilbmCreateGC;
- pScreen->CreateColormap = ilbmInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
- pScreen->InstallColormap = ilbmInstallColormap;
- pScreen->UninstallColormap = ilbmUninstallColormap;
- pScreen->ListInstalledColormaps = ilbmListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
- pScreen->ResolveColor = ilbmResolveColor;
- pScreen->BitmapToRegion = ilbmPixmapToRegion;
- oldDevPrivate = pScreen->devPrivate;
- if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth,
- ndepths, depths, defaultVisual, nvisuals, visuals)) {
- ErrorF("miScreenInit: FALSE\n");
- return FALSE;
- }
-
- pScreen->CloseScreen = ilbmCloseScreen;
- pScreen->CreateScreenResources = ilbmCreateScreenResources;
- pScreen->BackingStoreFuncs = ilbmBSFuncRec;
-
- pScreen->devPrivates[ilbmScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
-
- return TRUE;
-}
-
-PixmapPtr
-ilbmGetWindowPixmap(pWin)
- WindowPtr pWin;
-{
-#ifdef PIXMAP_PER_WINDOW
- return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
-#else
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- return (* pScreen->GetScreenPixmap)(pScreen);
-#endif
-}
-
-void
-ilbmSetWindowPixmap(pWin, pPix)
- WindowPtr pWin;
- PixmapPtr pPix;
-{
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
-#else
- (* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
-#endif
-}
diff --git a/ilbm/ilbmsetsp.c b/ilbm/ilbmsetsp.c
deleted file mode 100644
index a18cf53f8..000000000
--- a/ilbm/ilbmsetsp.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmsetsp.c,v 3.1 1998/03/20 21:08:04 hohndel Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmsetsp.c,v 5.8 94/04/17 20:28:34 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-
-/* ilbmSetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-ilbmSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, auxDst,
- depthDst, widthSrc)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register PixelType *psrc;
- register int alu; /* raster op */
- PixelType *pdstBase; /* start of the drawable */
- int widthDst; /* width of drawable in words */
- int auxDst;
- int depthDst;
- int widthSrc; /* width of drawable in words */
-{
- int w; /* width of scanline in bits */
- register PixelType *pdst; /* where to put the bits */
- register PixelType tmpSrc; /* scratch buffer to collect bits in */
- int dstBit; /* offset in bits from beginning of
- * word */
- register int nstart; /* number of bits from first partial */
- register int nend; /* " " last partial word */
- int offSrc;
- PixelType startmask, endmask;
- PixelType *savePsrc = psrc + ((xStart - xOrigin) >> PWSH);
- int nlMiddle, nl;
- int d;
-
- for (d = 0; d < depthDst; d++) {
- pdst = ilbmScanline(pdstBase, xStart, y, auxDst) + widthDst * d; /* @@@ NEXT PLANE @@@ */
- psrc = savePsrc + widthSrc * d; /* @@@ NEXT PLANE @@@ */
- offSrc = (xStart - xOrigin) & PIM;
- w = xEnd - xStart;
- dstBit = xStart & PIM;
-
- if (dstBit + w <= PPW) {
- getandputrop(psrc, offSrc, dstBit, w, pdst, alu)
- } else {
- maskbits(xStart, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - dstBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- else
- nend = 0;
- if (startmask) {
- getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
- pdst++;
- offSrc += nstart;
- if (offSrc > PLST) {
- psrc++;
- offSrc -= PPW;
- }
- }
- nl = nlMiddle;
- while (nl--) {
- getbits(psrc, offSrc, PPW, tmpSrc);
- DoRop(*pdst, alu, tmpSrc, *pdst);
- pdst++;
- psrc++;
- }
- if (endmask) {
- getandputrop0(psrc, offSrc, nend, pdst, alu);
- }
- }
- }
-}
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-ilbmSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *pcharsrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- PixelType *psrc = (PixelType *)pcharsrc;
- PixelType *pdstBase; /* start of dst bitmap */
- int widthDst; /* width of bitmap in words */
- int auxDst;
- int depthDst;
- int widthSrc;
- register BoxPtr pbox, pboxLast, pboxTest;
- register DDXPointPtr pptLast;
- int alu;
- RegionPtr prgnDst;
- int xStart, xEnd;
- int yMax;
-
- alu = pGC->alu;
- prgnDst = pGC->pCompositeClip;
-
- pptLast = ppt + nspans;
-
- yMax = pDrawable->y + (int) pDrawable->height;
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthDst, auxDst, depthDst,
- pdstBase);
-
- pbox = REGION_RECTS(prgnDst);
- pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
-
- if (fSorted) {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- pboxTest = pbox;
- while (ppt < pptLast) {
- pbox = pboxTest;
- if (ppt->y >= yMax)
- break;
- while (pbox < pboxLast) {
- if (pbox->y1 > ppt->y) {
- /* scanline is before clip box */
- break;
- } else if (pbox->y2 <= ppt->y) {
- /* clip box is before scanline */
- pboxTest = ++pbox;
- continue;
- } else if (pbox->x1 > ppt->x + *pwidth) {
- /* clip box is to right of scanline */
- break;
- } else if (pbox->x2 <= ppt->x) {
- /* scanline is to right of clip box */
- pbox++;
- continue;
- }
-
- /* at least some of the scanline is in the current clip box */
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(ppt->x + *pwidth, pbox->x2);
- widthSrc = PixmapWidthInPadUnits(*pwidth, 1);
- ilbmSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase,
- widthDst, auxDst, depthDst, widthSrc);
- if (ppt->x + *pwidth <= pbox->x2) {
- /* End of the line, as it were */
- break;
- } else
- pbox++;
- }
- /* We've tried this line against every box; it must be outside them
- * all. move on to the next point */
- ppt++;
- psrc += widthSrc * depthDst;
- pwidth++;
- }
- } else {
- /* scan lines not sorted. We must clip each line against all the boxes */
- while (ppt < pptLast) {
- if (ppt->y >= 0 && ppt->y < yMax) {
- for (pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++) {
- if (pbox->y1 > ppt->y) {
- /* rest of clip region is above this scanline,
- * skip it */
- break;
- }
- if (pbox->y2 <= ppt->y) {
- /* clip box is below scanline */
- pbox++;
- break;
- }
- if (pbox->x1 <= ppt->x + *pwidth &&
- pbox->x2 > ppt->x) {
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(pbox->x2, ppt->x + *pwidth);
- widthSrc = PixmapWidthInPadUnits(*pwidth, 1);
- ilbmSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- pdstBase, widthDst, auxDst, depthDst,
- widthSrc);
- }
-
- }
- }
- psrc += widthSrc * depthDst;
- ppt++;
- pwidth++;
- }
- }
-}
diff --git a/ilbm/ilbmtegblt.c b/ilbm/ilbmtegblt.c
deleted file mode 100644
index dc42baee9..000000000
--- a/ilbm/ilbmtegblt.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmtegblt.c,v 3.1 1998/03/20 21:08:04 hohndel Exp $ */
-/* $XConsortium: ilbmtegblt.c,v 5.14 94/04/17 20:28:35 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ilbm.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= PPW bits wide.
-
- This should be called only with a terminal-emulator font;
-this means that the FIXED_METRICS flag is set, and that
-glyphbounds == charbounds.
-
- in theory, this goes faster; even if it doesn't, it reduces the
-flicker caused by writing a string over itself with image text (since
-the background gets repainted per character instead of per string.)
-this seems to be important for some converted X10 applications.
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
-*/
-
-#if defined(NO_3_60_CG4) && defined(FASTPUTBITS) && defined(FASTGETBITS)
-#define FASTCHARS
-#endif
-
-/*
- * this macro "knows" that only characters <= 8 bits wide will
- * fit this case (which is why it is independent of GLYPHPADBYTES)
- */
-
-#if (BITMAP_BIT_ORDER == MSBFirst) && (GLYPHPADBYTES != 4)
-#if GLYPHPADBYTES == 1
-#define ShiftAmnt 24
-#else
-#define ShiftAmnt 16
-#endif
-
-/*
- * Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its
- * first argument more than once. Thus the imbedded char++ have to be moved.
- * (DHD)
- */
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#if PPW == 32
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
-#else /* PPW */
-#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
- (SCRRIGHT (*char2++ << ShiftAmnt, xoff2) << 32 ) | \
- (SCRRIGHT (*char3++ << ShiftAmnt, xoff3) << 32 ) | \
- (SCRRIGHT (*char4++ << ShiftAmnt, xoff4) << 32 ) | \
- (*char5++ << ShiftAmnt) | \
- SCRRIGHT (*char6++ << ShiftAmnt, xoff6) | \
- SCRRIGHT (*char7++ << ShiftAmnt, xoff7) | \
- SCRRIGHT (*char8++ << ShiftAmnt, xoff8);
-#endif /* PPW */
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#if PPW == 32
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4 << ShiftAmnt, xoff4); \
- char2++; char3++; char4++;
-#else /* PPW == 64 */
-#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
- (SCRRIGHT (*char2 << ShiftAmnt, xoff2) << 32 ) | \
- (SCRRIGHT (*char3 << ShiftAmnt, xoff3) << 32 ) | \
- (SCRRIGHT (*char4 << ShiftAmnt, xoff4) << 32 ) | \
- (*char5++ << ShiftAmnt) | \
- SCRRIGHT (*char6 << ShiftAmnt, xoff6) | \
- SCRRIGHT (*char7 << ShiftAmnt, xoff7) | \
- SCRRIGHT (*char8 << ShiftAmnt, xoff8); \
- char2++; char3++; char4++; char6++; char7++; char8++;
-#endif /* PPW */
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */
-
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#if PPW == 32
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2++, xoff2) | \
- SCRRIGHT (*char3++, xoff3) | \
- SCRRIGHT (*char4++, xoff4);
-#else /* PPW == 64 */
-#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
- (SCRRIGHT (*char2++, xoff2) << 64 ) | \
- (SCRRIGHT (*char3++, xoff3) << 64 ) | \
- (SCRRIGHT (*char4++, xoff4) << 64 ) | \
- SCRRIGHT (*char5++, xoff5) | \
- SCRRIGHT (*char6++, xoff6) | \
- SCRRIGHT (*char7++, xoff7) | \
- SCRRIGHT (*char8++, xoff8));
-#endif /* PPW */
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#if PPW == 32
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2, xoff2) | \
- SCRRIGHT (*char3, xoff3) | \
- SCRRIGHT (*char4, xoff4); \
- char2++; char3++; char4++;
-#else /* PPW == 64 */
-#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
- (SCRRIGHT (*char2, xoff2) << 64 ) | \
- (SCRRIGHT (*char3, xoff3) << 64 ) | \
- (SCRRIGHT (*char4, xoff4) << 64 ) | \
- SCRRIGHT (*char5, xoff5) | \
- SCRRIGHT (*char6, xoff6) | \
- SCRRIGHT (*char7, xoff7) | \
- SCRRIGHT (*char8, xoff8)); \
- char2++; char3++; char4++; \
- char5++; char6++; char7++; char8++;
-#endif /* PPW */
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */
-
-
-#if GLYPHPADBYTES == 1
-typedef unsigned char *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 2
-typedef unsigned short *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 4
-typedef unsigned int *glyphPointer;
-#endif
-
-#ifdef USE_LEFTBITS
-#define GetBits1 getleftbits (char1, widthGlyph, c); \
- c &= glyphMask; \
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
-#define GetBits1 c = *char1++;
-#endif
-
-void
-ilbmTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- FontPtr pfont = pGC->font;
- int widthDst;
- PixelType *pdstBase; /* pointer to longword with top row
- of current glyph */
-
- int h; /* height of glyph and char */
- register int xpos; /* current x */
- int ypos; /* current y */
- int widthGlyph;
-
- int hTmp; /* counter for height */
- register PixelType startmask, endmask;
- int nfirst; /* used if glyphs spans a longword boundary */
- BoxRec bbox; /* for clipping */
- int widthGlyphs;
- int auxDst;
- int depthDst;
- PixelType *saveDst;
- register PixelType *dst;
- register PixelType c;
- register int d;
- register int xoff1, xoff2, xoff3, xoff4;
- register glyphPointer char1, char2, char3, char4;
- glyphPointer schar1, schar2, schar3, schar4;
-#if PPW == 64
- register int xoff5, xoff6, xoff7, xoff8;
- register glyphPointer char5, char6, char7, char8;
- glyphPointer schar5, schar6, schar7, schar8;
-#endif /* PPW */
-
- unsigned char *rrops;
-#ifdef USE_LEFTBITS
- register PixelType glyphMask;
- register PixelType tmpSrc;
- register int glyphBytes;
-#endif
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, widthDst, auxDst, depthDst,
- pdstBase);
-
- xpos = x + pDrawable->x;
- ypos = y + pDrawable->y;
-
- widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
-
- xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
- ypos -= FONTASCENT(pfont);
-
- rrops = ((ilbmPrivGCPtr) pGC->devPrivates[ilbmGCPrivateIndex].ptr)->rropOS;
-
- bbox.x1 = xpos;
- bbox.x2 = xpos + (widthGlyph * nglyph);
- bbox.y1 = ypos;
- bbox.y2 = ypos + h;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
- case rgnPART:
- /* this is the WRONG thing to do, but it works.
- calling the non-terminal text is easy, but slow, given
- what we know about the font.
-
- the right thing to do is something like:
- for each clip rectangle
- compute at which row the glyph starts to be in it,
- and at which row the glyph ceases to be in it
- compute which is the first glyph inside the left
- edge, and the last one inside the right edge
- draw a fractional first glyph, using only
- the rows we know are in
- draw all the whole glyphs, using the appropriate rows
- draw any pieces of the last glyph, using the right rows
-
- this way, the code would take advantage of knowing that
- all glyphs are the same height and don't overlap.
-
- one day...
- */
- ilbmImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- case rgnOUT:
- return;
- }
- pdstBase = ilbmScanlineDeltaNoBankSwitch(pdstBase, ypos, auxDst);
- widthGlyphs = widthGlyph * PGSZB;
-
-#ifdef USE_LEFTBITS
- glyphMask = endtab[widthGlyph];
- glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
-#endif
-
- if (nglyph >= PGSZB && widthGlyphs <= PPW) {
- while (nglyph >= PGSZB) {
- nglyph -= PGSZB;
- xoff1 = xpos & PIM;
- xoff2 = widthGlyph;
- xoff3 = xoff2 + widthGlyph;
- xoff4 = xoff3 + widthGlyph;
-#if PPW == 64
- xoff5 = xoff4 + widthGlyph;
- xoff6 = xoff5 + widthGlyph;
- xoff7 = xoff6 + widthGlyph;
- xoff8 = xoff7 + widthGlyph;
-#endif /* PPW */
- schar1 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar2 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar3 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar4 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
-#if PPW == 64
- schar5 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar6 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar7 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
- schar8 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
-#endif /* PPW */
-
- hTmp = h;
- saveDst = ilbmScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */
-
-#ifndef FASTCHARS
- if (xoff1 + widthGlyphs <= PPW) {
- maskpartialbits (xoff1, widthGlyphs, startmask);
-#endif
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += widthDst; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
-#ifdef FASTCHARS
- FASTPUTBITS(0, xoff1, widthGlyphs, dst);
-#else
- *(dst) &= ~startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
-#ifdef FASTCHARS
- FASTPUTBITS(~0, xoff1, widthGlyphs, dst);
-#else
- *(dst) |= startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_INVERT:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
- /* XXX */
- while (hTmp--) {
- GetBits4
-#ifdef FASTCHARS
-# if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyphs;
-# endif
- FASTPUTBITS(~c, xoff1, widthGlyphs, dst);
-#else
- *(dst) = (*dst) & ~startmask | ~SCRRIGHT(c, xoff1) & startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_COPY:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
-#ifdef FASTCHARS
-# if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyphs;
-#endif
- FASTPUTBITS(c, xoff1, widthGlyphs, dst);
-#else
- *(dst) = (*dst) & ~startmask | SCRRIGHT(c, xoff1) & startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch (rrops[d]) */
- } /* for (d = ... ) */
-#ifndef FASTCHARS
- } else {
- maskPPWbits (xoff1, widthGlyphs, startmask, endmask);
- nfirst = PPW - xoff1;
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += widthDst; /* @@@ NEXT PLANE @@@ */
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- dst[0] &= ~startmask;
- dst[1] &= ~endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- dst[0] |= startmask;
- dst[1] |= endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_INVERT:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
- dst[0] = dst[0] & ~startmask |
- ~SCRRIGHT(c,xoff1) & startmask;
- dst[1] = dst[1] & ~endmask |
- ~SCRLEFT(c,nfirst) & endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_COPY:
- char1 = schar1;
- char2 = schar2;
- char3 = schar3;
- char4 = schar4;
-
- while (hTmp--) {
- GetBits4
- dst[0] = dst[0] & ~startmask |
- SCRRIGHT(c,xoff1) & startmask;
- dst[1] = dst[1] & ~endmask |
- SCRLEFT(c,nfirst) & endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
-
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ... ) */
- }
-#endif
- xpos += widthGlyphs;
- }
- }
-
- while (nglyph--) {
- xoff1 = xpos & PIM;
- schar1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- hTmp = h;
- saveDst = ilbmScanlineOffset(pdstBase, (xpos >> PWSH));
-
- if (xoff1 + widthGlyph <= PPW) {
- maskpartialbits (xoff1, widthGlyph, startmask);
-
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += widthDst; /* @@@ NEXT PLANE @@@ */
- char1 = schar1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- (*dst) &= ~startmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- (*dst) |= startmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (hTmp--) {
-#ifdef FASTCHARS
-#ifdef USE_LEFTBITS
- FASTGETBITS (char1,0,widthGlyph,c);
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
- c = *char1++;
-#if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyph;
-#endif
-#endif
- FASTPUTBITS (~c,xoff1,widthGlyph,dst);
-#else
- GetBits1
- (*dst) = (*dst) & ~startmask | ~SCRRIGHT(c, xoff1) & startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_COPY:
- while (hTmp--) {
-#ifdef FASTCHARS
-#ifdef USE_LEFTBITS
- FASTGETBITS (char1,0,widthGlyph,c);
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
- c = *char1++;
-#if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyph;
-#endif
-#endif
- FASTPUTBITS (c,xoff1,widthGlyph,dst);
-#else
- GetBits1
- (*dst) = (*dst) & ~startmask | SCRRIGHT(c, xoff1) & startmask;
-#endif
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- } else {
- maskPPWbits (xoff1, widthGlyph, startmask, endmask);
- nfirst = PPW - xoff1;
-
- for (d = 0; d < depthDst; d++) {
- hTmp = h;
- dst = saveDst;
- saveDst += widthDst; /* @@@ NEXT PLANE @@@ */
- char1 = schar1;
-
- switch (rrops[d]) {
- case RROP_BLACK:
- while (hTmp--) {
- dst[0] &= ~startmask;
- dst[1] &= ~endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_WHITE:
- while (hTmp--) {
- dst[0] |= startmask;
- dst[1] |= endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_INVERT:
- while (hTmp--) {
- GetBits1
- dst[0] = dst[0] & ~startmask |
- ~SCRRIGHT(c,xoff1) & startmask;
- dst[1] = dst[1] & ~endmask |
- ~SCRLEFT(c,nfirst) & endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_COPY:
- while (hTmp--) {
- GetBits1
- dst[0] = dst[0] & ~startmask |
- SCRRIGHT(c,xoff1) & startmask;
- dst[1] = dst[1] & ~endmask |
- SCRLEFT(c,nfirst) & endmask;
- ilbmScanlineInc(dst, auxDst);
- }
- break;
- case RROP_NOP:
- break;
- } /* switch */
- } /* for (d = ...) */
- }
-
- xpos += widthGlyph;
- }
-}
diff --git a/ilbm/ilbmtile.c b/ilbm/ilbmtile.c
deleted file mode 100644
index e289144ef..000000000
--- a/ilbm/ilbmtile.c
+++ /dev/null
@@ -1,853 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmtile.c,v 3.0 1996/08/18 01:54:12 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ilbmtile.c,v 5.8 94/04/17 20:28:36 dpw Exp $ */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ilbm.h"
-#include "maskbits.h"
-
-#include "mergerop.h"
-/*
-
- the boxes are already translated.
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*
- tile area with a PPW bit wide pixmap
-*/
-void
-MROP_NAME(ilbmTileAreaPPW)(pDraw, nbox, pbox, alu, ptile, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- int auxDst;
- int depthDst;
- int tlwidth;
- register int d;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pSaveSrc;
- int saveH;
- int saveIY;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- pbits);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = ptile->drawable.height;
- tlwidth = ptile->devKind/sizeof(PixelType);
- pSaveSrc = (PixelType *)(ptile->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
- saveIY = pbox->y1 % tileHeight;
- saveP = ilbmScanline(pbits, pbox->x1, pbox->y1, auxDst);
- psrc = pSaveSrc;
-
- if (((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = auxDst;
- for (d = 0; d < depthDst; d++, saveP += nlwidth, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
-
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- *p = MROP_MASK(srcpix,*p,startmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- }
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++, saveP += nlwidth, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
- nlwExtra = auxDst - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK (srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK(srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
- ilbmScanlineInc(p, nlwExtra);
- }
- } else if (!startmask && endmask) {
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- } else { /* no ragged bits at either end */
- while (h--) {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID (srcpix,*p);
- p++;
- }
- ilbmScanlineInc(p, nlwExtra);
- }
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-MROP_NAME(ilbmTileArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- register PixelType tmpsrc, tmpdst;
- int auxDst;
- int depthDst;
- int sizeTile;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- pBase);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind/sizeof(PixelType);
- sizeTile = tlwidth * tileHeight;
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = ilbmScanline(pBase, pbox->x1, pbox->y1, auxDst);
-
- for (d = 0; d < depthDst; d++, psrcT += sizeTile, saveP += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- while (width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
-
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
-
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- tmpsrc = *psrc;
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- tmpsrc = *psrc;
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), nstart, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- getbits (psrc, nstart, PPW, tmpsrc);
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++;*/
- psrc++;
- }
-
- if (endmask) {
- getbits (psrc, nstart, nend, tmpsrc);
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += auxDst;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
-
-void
-MROP_NAME(ilbmOpaqueStippleAreaPPW)(pDraw, nbox, pbox, alu, ptile,
- rropsOS, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
- register unsigned char *rropsOS;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- int auxDst;
- int depthDst;
- register int d;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
- PixelType *saveP;
- int saveH;
- int saveIY;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- pbits);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = ptile->drawable.height;
- psrc = (PixelType *)(ptile->devPrivate.ptr);
-
- while (nbox--) {
- w = pbox->x2 - pbox->x1;
- saveH = pbox->y2 - pbox->y1;
- saveIY = pbox->y1 % tileHeight;
- saveP = ilbmScanline(pbits, pbox->x1, pbox->y1, auxDst);
-
- if ( ((pbox->x1 & PIM) + w) < PPW) {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = auxDst;
- for (d = 0; d < depthDst; d++, saveP += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
-
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- *p = MROP_MASK(srcpix,*p,startmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- }
- } else {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
-
- for (d = 0; d < depthDst; d++, saveP += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- p = saveP;
- h = saveH;
- iy = saveIY;
- nlwExtra = auxDst - nlwMiddle;
-
- if (startmask && endmask) {
- nlwExtra -= 1;
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK (srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- } else if (startmask && !endmask) {
- nlwExtra -= 1;
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK(srcpix,*p,startmask);
- p++;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
- ilbmScanlineInc(p, nlwExtra);
- }
- } else if (!startmask && endmask) {
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- ilbmScanlineInc(p, nlwExtra);
- }
- } else { /* no ragged bits at either end */
- while (h--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- srcpix = 0;
- break;
- case RROP_WHITE:
- srcpix = ~0;
- break;
- case RROP_COPY:
- srcpix = psrc[iy];
- break;
- case RROP_INVERT:
- srcpix = ~psrc[iy];
- break;
- }
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--) {
- *p = MROP_SOLID (srcpix,*p);
- p++;
- }
- ilbmScanlineInc(p, nlwExtra);
- }
- }
- } /* for (d = ...) */
- }
- pbox++;
- }
-}
-
-void
-MROP_NAME(ilbmOpaqueStippleArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff,
- rropsOS, planemask)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr pTile;
- int xOff;
- int yOff;
- register unsigned char *rropsOS;
- unsigned long planemask;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int nlwidth; /* width in longwords of the drawable */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register PixelType *pdst; /* pointer to bits we're writing */
- register PixelType tmpsrc, tmpdst;
- int auxDst;
- int depthDst;
- int tileLine;
- int iline;
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- int saveW;
- PixelType *psrcT;
- int d;
- int nstart;
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
- int iy;
- PixelType *pBase; /* pointer to start of drawable */
- PixelType *saveP;
- PixelType *pStartDst;
- PixelType *pStartTile;
- int saveH;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- pBase);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = pTile->drawable.height;
- tileWidth = pTile->drawable.width;
- tlwidth = pTile->devKind/sizeof(PixelType);
-
- xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
- ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
-
- while (nbox--) {
- saveW = pbox->x2 - pbox->x1;
- iline = (pbox->y1 - ySrc) % tileHeight;
- psrcT = (PixelType *) pTile->devPrivate.ptr;
- tileLine = iline * tlwidth;
- saveH = pbox->y2 - pbox->y1;
- saveP = ilbmScanline(pBase, pbox->x1, pbox->y1, auxDst);
-
- for (d = 0; d < depthDst; d++, saveP += nlwidth) { /* @@@ NEXT PLANE @@@ */
- if (!(planemask & (1 << d)))
- continue;
-
- h = saveH;
- pStartDst = saveP;
- pStartTile = psrcT + tileLine;
- iy = iline;
-
- while (h--) {
- x = pbox->x1;
- width = saveW;
- pdst = pStartDst;
- while (width > 0) {
- psrc = pStartTile;
- w = min(tileWidth, width);
- if ((rem = (x - xSrc) % tileWidth) != 0) {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
-
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
-
- if ((x & PIM) + w >= PPW)
- pdst++;
- } else if (((x & PIM) + w) < PPW) {
- /* doing < PPW bits is easy, and worth special-casing */
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), w, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), w, pdst);
- } else {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if (startmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- tmpsrc = *psrc;
- break;
- case RROP_INVERT:
- tmpsrc = ~*psrc;
- break;
- }
-#if (MROP) != Mcopy
- getbits (pdst, (x & PIM), nstart, tmpdst);
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, (x & PIM), nstart, pdst);
- pdst++;
- if (srcStartOver)
- psrc++;
- }
-
- while (nlMiddle--) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
- case RROP_COPY:
- getbits (psrc, nstart, PPW, tmpsrc);
- break;
- case RROP_INVERT:
- getbits (psrc, nstart, PPW, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- *pdst++ = tmpsrc;
- /*putbits (tmpsrc, 0, PPW, pdst);
- pdst++; */
- psrc++;
- }
-
- if (endmask) {
- switch (rropsOS[d]) {
- case RROP_BLACK:
- tmpsrc = 0;
- break;
- case RROP_WHITE:
- tmpsrc = ~0;
- break;
-
- case RROP_COPY:
- getbits (psrc, nstart, nend, tmpsrc);
- break;
-
- case RROP_INVERT:
- getbits (psrc, nstart, nend, tmpsrc);
- tmpsrc = ~tmpsrc;
- break;
- }
-#if (MROP) != Mcopy
- tmpdst = *pdst;
- tmpsrc = DoMergeRop (tmpsrc, tmpdst);
-#endif
- putbits (tmpsrc, 0, nend, pdst);
- }
- }
- x += w;
- width -= w;
- } /* while (width > 0) */
-
- pStartDst += auxDst;
- if (++iy >= tileHeight) {
- iy = 0;
- pStartTile = psrcT;
- } else
- pStartTile += tlwidth;
-
- } /* while (h) */
- } /* for (d = ... ) */
- pbox++;
- } /* for each box */
-}
diff --git a/ilbm/ilbmwindow.c b/ilbm/ilbmwindow.c
deleted file mode 100644
index 524972944..000000000
--- a/ilbm/ilbmwindow.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmwindow.c,v 3.0 1996/08/18 01:54:14 dawes Exp $ */
-/* $XConsortium: ilbmwindow.c,v 5.14 94/04/17 20:28:36 dpw Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "ilbm.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-extern WindowPtr *WindowTable;
-
-Bool
-ilbmCreateWindow(pWin)
- register WindowPtr pWin;
-{
- register ilbmPrivWin *pPrivWin;
-
- pPrivWin = (ilbmPrivWin *)(pWin->devPrivates[ilbmWindowPrivateIndex].ptr);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- pWin->pDrawable.pScreen->devPrivates[ilbmScreenPrivateIndex].ptr;
-#endif
-
- return (TRUE);
-}
-
-/* This always returns true, because Xfree can't fail. It might be possible
- * on some devices for Destroy to fail */
-Bool
-ilbmDestroyWindow(pWin)
- WindowPtr pWin;
-{
- register ilbmPrivWin *pPrivWin;
-
- pPrivWin = (ilbmPrivWin *)(pWin->devPrivates[ilbmWindowPrivateIndex].ptr);
-
- if (pPrivWin->pRotatedBorder)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
- if (pPrivWin->pRotatedBackground)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
-
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-ilbmMapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* (x, y) is the upper left corner of the window on the screen
- do we really need to pass this? (is it a;ready in pWin->absCorner?)
- we only do the rotation for pixmaps that are 32 bits wide (padded
-or otherwise.)
- ilbmChangeWindowAttributes() has already put a copy of the pixmap
-in pPrivWin->pRotated*
-*/
-
-/*ARGSUSED*/
-Bool
-ilbmPositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- register ilbmPrivWin *pPrivWin;
- int reset = 0;
-
- pPrivWin = (ilbmPrivWin *)(pWin->devPrivates[ilbmWindowPrivateIndex].ptr);
- if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) {
- ilbmXRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- ilbmYRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
-
- if (!pWin->borderIsPixel && pPrivWin->fastBorder) {
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
- ilbmXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- ilbmYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
- if (reset) {
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
-
- /* This is the "wrong" fix to the right problem, but it doesn't really
- * cost very much. When the window is moved, we need to invalidate any
- * RotatedPixmap that exists in any GC currently validated against this
- * window.
- */
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-ilbmUnmapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* UNCLEAN!
- this code calls the bitblt helper code directly.
-
- ilbmCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-
-void
-ilbmCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- RegionPtr prgnDst;
- register BoxPtr pbox;
- register int dx, dy;
- register int i, nbox;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
- prgnSrc);
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
- if (!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- return;
- ppt = pptSrc;
-
- for (i=nbox; --i >= 0; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- ilbmDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst,
- pptSrc, ~0);
- DEALLOCATE_LOCAL(pptSrc);
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
-}
-
-
-
-/* swap in correct PaintWindow* routine. If we can use a fast output
-routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
-of it in devPrivate.
-*/
-Bool
-ilbmChangeWindowAttributes(pWin, mask)
- register WindowPtr pWin;
- register unsigned long mask;
-{
- register unsigned long index;
- register ilbmPrivWin *pPrivWin;
- WindowPtr pBgWin;
-
- pPrivWin = (ilbmPrivWin *)(pWin->devPrivates[ilbmWindowPrivateIndex].ptr);
- /*
- * When background state changes from ParentRelative and
- * we had previously rotated the fast border pixmap to match
- * the parent relative origin, rerotate to match window
- */
- if (mask & (CWBackPixmap | CWBackPixel) &&
- pWin->backgroundState != ParentRelative && pPrivWin->fastBorder &&
- (pPrivWin->oldRotate.x != pWin->drawable.x ||
- pPrivWin->oldRotate.y != pWin->drawable.y)) {
- ilbmXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- ilbmYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
- switch (index) {
- case CWBackPixmap:
- if (pWin->backgroundState == None)
- pPrivWin->fastBackground = FALSE;
- else if (pWin->backgroundState == ParentRelative) {
- pPrivWin->fastBackground = FALSE;
- /* Rotate border to match parent origin */
- if (pPrivWin->pRotatedBorder) {
- for (pBgWin = pWin->parent;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- ilbmXRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.x - pPrivWin->oldRotate.x);
- ilbmYRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- } else if ((pWin->background.pixmap->drawable.width <= PPW) &&
- !(pWin->background.pixmap->drawable.width &
- (pWin->background.pixmap->drawable.width - 1))) {
- ilbmCopyRotatePixmap(pWin->background.pixmap,
- &pPrivWin->pRotatedBackground,
- pWin->drawable.x, pWin->drawable.y);
- if (pPrivWin->pRotatedBackground) {
- pPrivWin->fastBackground = TRUE;
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- } else
- pPrivWin->fastBackground = FALSE;
- } else
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBackPixel:
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBorderPixmap:
- if ((pWin->border.pixmap->drawable.width <= PPW) &&
- !(pWin->border.pixmap->drawable.width &
- (pWin->border.pixmap->drawable.width - 1))) {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- ilbmCopyRotatePixmap(pWin->border.pixmap,
- &pPrivWin->pRotatedBorder,
- pBgWin->drawable.x, pBgWin->drawable.y);
- if (pPrivWin->pRotatedBorder) {
- pPrivWin->fastBorder = TRUE;
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- } else
- pPrivWin->fastBorder = FALSE;
- } else
- pPrivWin->fastBorder = FALSE;
- break;
- case CWBorderPixel:
- pPrivWin->fastBorder = FALSE;
- break;
- }
- }
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
diff --git a/ilbm/ilbmzerarc.c b/ilbm/ilbmzerarc.c
deleted file mode 100644
index 9bdf22155..000000000
--- a/ilbm/ilbmzerarc.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* $XFree86: xc/programs/Xserver/ilbm/ilbmzerarc.c,v 3.1 1998/03/20 21:08:04 hohndel Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: ilbmzerarc.c,v 5.19 94/04/17 20:28:37 dpw Exp $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
- to use interleaved bitplanes instead of normal bitplanes */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "miscstruct.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "ilbm.h"
-#include "maskbits.h"
-#include "mizerarc.h"
-#include "mi.h"
-
-/*
- * Note: LEFTMOST must be the bit leftmost in the actual screen
- * representation. This depends also on the IMAGE_BYTE_ORDER.
- * LONG2CHARS() takes care of the re-ordering as required. (DHD)
- */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define LEFTMOST ((PixelType) LONG2CHARS((1 << PLST)))
-#else
-#define LEFTMOST ((PixelType) LONG2CHARS(1))
-#endif
-
-#define Pixelate(base,yoff,xoff) \
-{ \
- paddr = ilbmScanlineOffset(base, (yoff) + ((xoff)>>PWSH)); \
- pmask = SCRRIGHT(LEFTMOST, (xoff) & PIM); \
- for (de = 0; de < depthDst; de++, paddr += nlwidth) /* @@@ NEXT PLANE @@@ */ \
- switch (rrops[de]) { \
- case RROP_BLACK: \
- *paddr &= ~pmask; \
- break; \
- case RROP_WHITE: \
- *paddr |= pmask; \
- break; \
- case RROP_INVERT: \
- *paddr ^= pmask; \
- break; \
- case RROP_NOP: \
- break; \
- } \
-}
-
-#define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff);
-
-static void
-ilbmZeroArcSS(pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
-{
- miZeroArcRec info;
- Bool do360;
- register int de;
- register int x, y, a, b, d, mask;
- register int k1, k3, dx, dy;
- PixelType *addrl;
- PixelType *yorgl, *yorgol;
- PixelType pixel;
- int nlwidth, yoffset, dyoffset;
- int auxDst, depthDst;
- PixelType pmask;
- register PixelType *paddr;
- register unsigned char *rrops;
-
- rrops = ((ilbmPrivGC *)(pGC->devPrivates[ilbmGCPrivateIndex].ptr))->rrops;
-
- ilbmGetPixelWidthAuxDepthAndPointer(pDraw, nlwidth, auxDst, depthDst,
- addrl);
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgl = addrl + ((info.yorg + pDraw->y) * auxDst);
- yorgol = addrl + ((info.yorgo + pDraw->y) * auxDst);
- info.xorg += pDraw->x;
- info.xorgo += pDraw->x;
- MIARCSETUP();
- yoffset = y ? auxDst : 0;
- dyoffset = 0;
- mask = info.initialMask;
- if (!(arc->width & 1)) {
- DoPix(2, yorgl, 0, info.xorgo);
- DoPix(8, yorgol, 0, info.xorgo);
- }
- if (!info.end.x || !info.end.y) {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1)) {
- int xoffset = auxDst;
- PixelType *yorghl = ilbmScanlineDeltaNoBankSwitch(yorgl, info.h, auxDst);
- int xorghp = info.xorg + info.h;
- int xorghn = info.xorg - info.h;
-
- while (1) {
- Pixelate(yorgl, yoffset, info.xorg + x);
- Pixelate(yorgl, yoffset, info.xorg - x);
- Pixelate(yorgol, -yoffset, info.xorg - x);
- Pixelate(yorgol, -yoffset, info.xorg + x);
- if (a < 0)
- break;
- Pixelate(yorghl, -xoffset, xorghp - y);
- Pixelate(yorghl, -xoffset, xorghn + y);
- Pixelate(yorghl, xoffset, xorghn + y);
- Pixelate(yorghl, xoffset, xorghp - y);
- xoffset += auxDst;
- MIARCCIRCLESTEP(yoffset += auxDst;);
- }
- x = info.w;
- yoffset = info.h * auxDst;
- } else if (do360) {
- while (y < info.h || x < info.w) {
- MIARCOCTANTSHIFT(dyoffset = auxDst;);
- Pixelate(yorgl, yoffset, info.xorg + x);
- Pixelate(yorgl, yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorg + x);
- MIARCSTEP(yoffset += dyoffset;, yoffset += auxDst;);
- }
- } else {
- while (y < info.h || x < info.w) {
- MIARCOCTANTSHIFT(dyoffset = auxDst;);
- if ((x == info.start.x) || (y == info.start.y)) {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- if ((x == info.end.x) || (y == info.end.y)) {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += auxDst;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- if (arc->height & 1) {
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- }
-}
-
-void
-ilbmZeroPolyArcSS(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- RegionPtr cclip;
-
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++) {
- if (miCanZeroArc(arc)) {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- box.x2 = box.x1 + (int)arc->width + 1;
- box.y2 = box.y1 + (int)arc->height + 1;
- if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
- ilbmZeroArcSS(pDraw, pGC, arc);
- else
- miZeroPolyArc(pDraw, pGC, 1, arc);
- } else
- miPolyArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/include/XIstubs.h b/include/XIstubs.h
deleted file mode 100644
index ad36bc716..000000000
--- a/include/XIstubs.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/XIstubs.h,v 3.2 2003/04/27 21:31:04 herrb Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef XI_STUBS_H
-#define XI_STUBS_H 1
-
-int
-ChangeKeyboardDevice (
- DeviceIntPtr /* old_dev */,
- DeviceIntPtr /* new_dev */);
-
-int
-ChangePointerDevice (
- DeviceIntPtr /* old_dev */,
- DeviceIntPtr /* new_dev */,
- unsigned char /* x */,
- unsigned char /* y */);
-
-void
-CloseInputDevice (
- DeviceIntPtr /* d */,
- ClientPtr /* client */);
-
-void
-AddOtherInputDevices (void);
-
-void
-OpenInputDevice (
- DeviceIntPtr /* dev */,
- ClientPtr /* client */,
- int * /* status */);
-
-int
-SetDeviceMode (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int /* mode */);
-
-int
-SetDeviceValuators (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int * /* valuators */,
- int /* first_valuator */,
- int /* num_valuators */);
-
-int
-ChangeDeviceControl (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- xDeviceCtl * /* control */);
-
-#endif /* XI_STUBS_H */
diff --git a/include/bstore.h b/include/bstore.h
deleted file mode 100644
index c3a6a9f38..000000000
--- a/include/bstore.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/bstore.h,v 1.2 2001/01/06 20:58:12 tsi Exp $*/
-/*
- * Copyright (c) 1987 by the Regents of the University of California
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies. The University of
- * California makes no representations about the suitability of this software
- * for any purpose. It is provided "as is" without express or implied
- * warranty.
- */
-
-/*
- * Moved here from mi to allow wrapping of lower level backing store functions.
- * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
- */
-
-#ifndef _BSTORE_H_
-#define _BSTORE_H_
-
-#include "bstorestr.h"
-
-#endif /* _BSTORE_H_ */
diff --git a/include/bstorestr.h b/include/bstorestr.h
deleted file mode 100644
index 694841ed0..000000000
--- a/include/bstorestr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/bstorestr.h,v 1.3 2003/04/27 21:31:04 herrb Exp $*/
-/*
- * Copyright (c) 1987 by the Regents of the University of California
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies. The University of
- * California makes no representations about the suitability of this software
- * for any purpose. It is provided "as is" without express or implied
- * warranty.
- */
-
-/*
- * Moved here from mi to allow wrapping of lower level backing store functions.
- * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
- */
-
-#ifndef _BSTORESTR_H_
-#define _BSTORESTR_H_
-
-#include "gc.h"
-#include "pixmap.h"
-#include "region.h"
-#include "window.h"
-
-typedef void (* BackingStoreSaveAreasProcPtr)(
- PixmapPtr /*pBackingPixmap*/,
- RegionPtr /*pObscured*/,
- int /*x*/,
- int /*y*/,
- WindowPtr /*pWin*/);
-
-typedef void (* BackingStoreRestoreAreasProcPtr)(
- PixmapPtr /*pBackingPixmap*/,
- RegionPtr /*pExposed*/,
- int /*x*/,
- int /*y*/,
- WindowPtr /*pWin*/);
-
-typedef void (* BackingStoreSetClipmaskRgnProcPtr)(
- GCPtr /*pBackingGC*/,
- RegionPtr /*pbackingCompositeClip*/);
-
-typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)(void);
-
-typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)(void);
-
-typedef struct _BSFuncs {
-
- BackingStoreSaveAreasProcPtr SaveAreas;
- BackingStoreRestoreAreasProcPtr RestoreAreas;
- BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn;
- BackingStoreGetImagePixmapProcPtr GetImagePixmap;
- BackingStoreGetSpansPixmapProcPtr GetSpansPixmap;
-
-} BSFuncRec, *BSFuncPtr;
-
-#endif /* _BSTORESTR_H_ */
diff --git a/include/closestr.h b/include/closestr.h
deleted file mode 100644
index 34d5931f2..000000000
--- a/include/closestr.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* $Xorg: closestr.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
-/*
-
-Copyright 1991, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/include/closestr.h,v 3.5 2003/11/17 22:20:43 dawes Exp $ */
-
-
-#ifndef CLOSESTR_H
-#define CLOSESTR_H
-
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "closure.h"
-#include "dix.h"
-#include "misc.h"
-#include "gcstruct.h"
-
-/* closure structures */
-
-/* OpenFont */
-
-typedef struct _OFclosure {
- ClientPtr client;
- short current_fpe;
- short num_fpes;
- FontPathElementPtr *fpe_list;
- Mask flags;
- Bool slept;
-
-/* XXX -- get these from request buffer instead? */
- char *origFontName;
- int origFontNameLen;
- XID fontid;
- char *fontname;
- int fnamelen;
- FontPtr non_cachable_font;
-} OFclosureRec;
-
-/* ListFontsWithInfo */
-
-#define XLFDMAXFONTNAMELEN 256
-typedef struct _LFWIstate {
- char pattern[XLFDMAXFONTNAMELEN];
- int patlen;
- int current_fpe;
- int max_names;
- Bool list_started;
- pointer private;
-} LFWIstateRec, *LFWIstatePtr;
-
-typedef struct _LFWIclosure {
- ClientPtr client;
- int num_fpes;
- FontPathElementPtr *fpe_list;
- xListFontsWithInfoReply *reply;
- int length;
- LFWIstateRec current;
- LFWIstateRec saved;
- int savedNumFonts;
- Bool haveSaved;
- Bool slept;
- char *savedName;
-} LFWIclosureRec;
-
-/* ListFonts */
-
-typedef struct _LFclosure {
- ClientPtr client;
- int num_fpes;
- FontPathElementPtr *fpe_list;
- FontNamesPtr names;
- LFWIstateRec current;
- LFWIstateRec saved;
- Bool haveSaved;
- Bool slept;
- char *savedName;
- int savedNameLen;
-} LFclosureRec;
-
-/* PolyText */
-
-typedef
- int (* PolyTextPtr)(
- DrawablePtr /* pDraw */,
- GCPtr /* pGC */,
- int /* x */,
- int /* y */,
- int /* count */,
- void * /* chars or shorts */
- );
-
-typedef struct _PTclosure {
- ClientPtr client;
- DrawablePtr pDraw;
- GC *pGC;
- unsigned char *pElt;
- unsigned char *endReq;
- unsigned char *data;
- int xorg;
- int yorg;
- CARD8 reqType;
- PolyTextPtr polyText;
- int itemSize;
- XID did;
- int err;
- Bool slept;
-} PTclosureRec;
-
-/* ImageText */
-
-typedef
- void (* ImageTextPtr)(
- DrawablePtr /* pDraw */,
- GCPtr /* pGC */,
- int /* x */,
- int /* y */,
- int /* count */,
- void * /* chars or shorts */
- );
-
-typedef struct _ITclosure {
- ClientPtr client;
- DrawablePtr pDraw;
- GC *pGC;
- BYTE nChars;
- unsigned char *data;
- int xorg;
- int yorg;
- CARD8 reqType;
- ImageTextPtr imageText;
- int itemSize;
- XID did;
- Bool slept;
-} ITclosureRec;
-#endif /* CLOSESTR_H */
diff --git a/include/closure.h b/include/closure.h
deleted file mode 100644
index d80388bf4..000000000
--- a/include/closure.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $Xorg: closure.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#ifndef CLOSURE_H
-#define CLOSURE_H 1
-
-typedef struct _LFclosure *LFclosurePtr;
-typedef struct _LFWIclosure *LFWIclosurePtr;
-typedef struct _OFclosure *OFclosurePtr;
-typedef struct _PTclosure *PTclosurePtr;
-typedef struct _ITclosure *ITclosurePtr;
-
-#endif /* CLOSURE_H */
diff --git a/include/colormap.h b/include/colormap.h
deleted file mode 100644
index f249f4f03..000000000
--- a/include/colormap.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.6 2003/04/27 21:31:04 herrb Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $Xorg: colormap.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
-
-#ifndef CMAP_H
-#define CMAP_H 1
-
-#include "X11/Xproto.h"
-#include "screenint.h"
-#include "window.h"
-
-/* these follow X.h's AllocNone and AllocAll */
-#define CM_PSCREEN 2
-#define CM_PWIN 3
-/* Passed internally in colormap.c */
-#define REDMAP 0
-#define GREENMAP 1
-#define BLUEMAP 2
-#define PSEUDOMAP 3
-#define AllocPrivate (-1)
-#define AllocTemporary (-2)
-#define DynamicClass 1
-
-/* Values for the flags field of a colormap. These should have 1 bit set
- * and not overlap */
-#define IsDefault 1
-#define AllAllocated 2
-#define BeingCreated 4
-
-
-typedef CARD32 Pixel;
-typedef struct _CMEntry *EntryPtr;
-/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
-typedef struct _colorResource *colorResourcePtr;
-
-extern int CreateColormap(
- Colormap /*mid*/,
- ScreenPtr /*pScreen*/,
- VisualPtr /*pVisual*/,
- ColormapPtr* /*ppcmap*/,
- int /*alloc*/,
- int /*client*/);
-
-extern int FreeColormap(
- pointer /*pmap*/,
- XID /*mid*/);
-
-extern int TellLostMap(
- WindowPtr /*pwin*/,
- pointer /* Colormap *pmid */);
-
-extern int TellGainedMap(
- WindowPtr /*pwin*/,
- pointer /* Colormap *pmid */);
-
-extern int CopyColormapAndFree(
- Colormap /*mid*/,
- ColormapPtr /*pSrc*/,
- int /*client*/);
-
-extern int AllocColor(
- ColormapPtr /*pmap*/,
- unsigned short* /*pred*/,
- unsigned short* /*pgreen*/,
- unsigned short* /*pblue*/,
- Pixel* /*pPix*/,
- int /*client*/);
-
-extern void FakeAllocColor(
- ColormapPtr /*pmap*/,
- xColorItem * /*item*/);
-
-extern void FakeFreeColor(
- ColormapPtr /*pmap*/,
- Pixel /*pixel*/);
-
-typedef int (*ColorCompareProcPtr)(
- EntryPtr /*pent*/,
- xrgb * /*prgb*/);
-
-extern int FindColor(
- ColormapPtr /*pmap*/,
- EntryPtr /*pentFirst*/,
- int /*size*/,
- xrgb* /*prgb*/,
- Pixel* /*pPixel*/,
- int /*channel*/,
- int /*client*/,
- ColorCompareProcPtr /*comp*/);
-
-extern int QueryColors(
- ColormapPtr /*pmap*/,
- int /*count*/,
- Pixel* /*ppixIn*/,
- xrgb* /*prgbList*/);
-
-extern int FreeClientPixels(
- pointer /*pcr*/,
- XID /*fakeid*/);
-
-extern int AllocColorCells(
- int /*client*/,
- ColormapPtr /*pmap*/,
- int /*colors*/,
- int /*planes*/,
- Bool /*contig*/,
- Pixel* /*ppix*/,
- Pixel* /*masks*/);
-
-extern int AllocColorPlanes(
- int /*client*/,
- ColormapPtr /*pmap*/,
- int /*colors*/,
- int /*r*/,
- int /*g*/,
- int /*b*/,
- Bool /*contig*/,
- Pixel* /*pixels*/,
- Pixel* /*prmask*/,
- Pixel* /*pgmask*/,
- Pixel* /*pbmask*/);
-
-extern int FreeColors(
- ColormapPtr /*pmap*/,
- int /*client*/,
- int /*count*/,
- Pixel* /*pixels*/,
- Pixel /*mask*/);
-
-extern int StoreColors(
- ColormapPtr /*pmap*/,
- int /*count*/,
- xColorItem* /*defs*/);
-
-extern int IsMapInstalled(
- Colormap /*map*/,
- WindowPtr /*pWin*/);
-
-#endif /* CMAP_H */
diff --git a/include/colormapst.h b/include/colormapst.h
deleted file mode 100644
index b176f7dc3..000000000
--- a/include/colormapst.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $Xorg: colormapst.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
-#ifndef CMAPSTRUCT_H
-#define CMAPSTRUCT_H 1
-
-#include "colormap.h"
-#include "screenint.h"
-
-/* Shared color -- the color is used by AllocColorPlanes */
-typedef struct
-{
- unsigned short color;
- short refcnt;
-} SHAREDCOLOR;
-
-/* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
- * use the first value (called red) in the structure. What channel they
- * are really talking about depends on which map they are in. */
-typedef struct
-{
- unsigned short red, green, blue;
-} LOCO;
-
-/* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes.
- * DirectColor maps always use the first value (called red) in the structure.
- * What channel they are really talking about depends on which map they
- * are in. */
-typedef struct
-{
- SHAREDCOLOR *red, *green, *blue;
-} SHCO;
-
-
-/* color map entry */
-typedef struct _CMEntry
-{
- union
- {
- LOCO local;
- SHCO shco;
- } co;
- short refcnt;
- Bool fShared;
-} Entry;
-
-/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
- * only needs one cell table, we arbitrarily pick red. We keep track
- * of that table with freeRed, numPixelsRed, and clientPixelsRed */
-
-typedef struct _ColormapRec
-{
- VisualPtr pVisual;
- short class; /* PseudoColor or DirectColor */
- long mid; /* client's name for colormap */
- ScreenPtr pScreen; /* screen map is associated with */
- short flags; /* 1 = IsDefault
- * 2 = AllAllocated */
- int freeRed;
- int freeGreen;
- int freeBlue;
- int *numPixelsRed;
- int *numPixelsGreen;
- int *numPixelsBlue;
- Pixel **clientPixelsRed;
- Pixel **clientPixelsGreen;
- Pixel **clientPixelsBlue;
- Entry *red;
- Entry *green;
- Entry *blue;
- pointer devPriv;
- DevUnion *devPrivates; /* dynamic devPrivates added after devPriv
- already existed - must keep devPriv */
-} ColormapRec;
-
-#endif /* COLORMAP_H */
diff --git a/include/cursor.h b/include/cursor.h
deleted file mode 100644
index 7509a94af..000000000
--- a/include/cursor.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/cursor.h,v 1.7 2003/04/27 21:31:04 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: cursor.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-#ifndef CURSOR_H
-#define CURSOR_H
-
-#include "misc.h"
-#include "screenint.h"
-#include "window.h"
-
-#define NullCursor ((CursorPtr)NULL)
-
-/* Provide support for alpha composited cursors */
-#ifdef RENDER
-#define ARGB_CURSOR
-#endif
-
-typedef struct _Cursor *CursorPtr;
-typedef struct _CursorMetric *CursorMetricPtr;
-
-extern CursorPtr rootCursor;
-
-extern int FreeCursor(
- pointer /*pCurs*/,
- XID /*cid*/);
-
-/* Quartz support on Mac OS X pulls in the QuickDraw
- framework whose AllocCursor function conflicts here. */
-#ifdef __DARWIN__
-#define AllocCursor Darwin_X_AllocCursor
-#endif
-extern CursorPtr AllocCursor(
- unsigned char* /*psrcbits*/,
- unsigned char* /*pmaskbits*/,
- CursorMetricPtr /*cm*/,
- unsigned /*foreRed*/,
- unsigned /*foreGreen*/,
- unsigned /*foreBlue*/,
- unsigned /*backRed*/,
- unsigned /*backGreen*/,
- unsigned /*backBlue*/);
-
-extern CursorPtr AllocCursorARGB(
- unsigned char* /*psrcbits*/,
- unsigned char* /*pmaskbits*/,
- CARD32* /*argb*/,
- CursorMetricPtr /*cm*/,
- unsigned /*foreRed*/,
- unsigned /*foreGreen*/,
- unsigned /*foreBlue*/,
- unsigned /*backRed*/,
- unsigned /*backGreen*/,
- unsigned /*backBlue*/);
-
-extern int AllocGlyphCursor(
- Font /*source*/,
- unsigned int /*sourceChar*/,
- Font /*mask*/,
- unsigned int /*maskChar*/,
- unsigned /*foreRed*/,
- unsigned /*foreGreen*/,
- unsigned /*foreBlue*/,
- unsigned /*backRed*/,
- unsigned /*backGreen*/,
- unsigned /*backBlue*/,
- CursorPtr* /*ppCurs*/,
- ClientPtr /*client*/);
-
-extern CursorPtr CreateRootCursor(
- char* /*pfilename*/,
- unsigned int /*glyph*/);
-
-extern int ServerBitsFromGlyph(
- FontPtr /*pfont*/,
- unsigned int /*ch*/,
- register CursorMetricPtr /*cm*/,
- unsigned char ** /*ppbits*/);
-
-extern Bool CursorMetricsFromGlyph(
- FontPtr /*pfont*/,
- unsigned /*ch*/,
- CursorMetricPtr /*cm*/);
-
-extern void CheckCursorConfinement(
- WindowPtr /*pWin*/);
-
-extern void NewCurrentScreen(
- ScreenPtr /*newScreen*/,
- int /*x*/,
- int /*y*/);
-
-extern Bool PointerConfinedToScreen(void);
-
-extern void GetSpritePosition(
- int * /*px*/,
- int * /*py*/);
-
-#ifdef PANORAMIX
-extern int XineramaGetCursorScreen(void);
-#endif /* PANORAMIX */
-
-#endif /* CURSOR_H */
diff --git a/include/cursorstr.h b/include/cursorstr.h
deleted file mode 100644
index 0e2f04a6d..000000000
--- a/include/cursorstr.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* $Xorg: cursorstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/cursorstr.h,v 1.9 2003/01/12 02:44:27 dawes Exp $ */
-
-#ifndef CURSORSTRUCT_H
-#define CURSORSTRUCT_H
-
-#include "cursor.h"
-/*
- * device-independent cursor storage
- */
-
-/*
- * source and mask point directly to the bits, which are in the server-defined
- * bitmap format.
- */
-typedef struct _CursorBits {
- unsigned char *source; /* points to bits */
- unsigned char *mask; /* points to bits */
- Bool emptyMask; /* all zeros mask */
- unsigned short width, height, xhot, yhot; /* metrics */
- int refcnt; /* can be shared */
- pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/
-#ifdef ARGB_CURSOR
- CARD32 *argb; /* full-color alpha blended */
-#endif
-} CursorBits, *CursorBitsPtr;
-
-typedef struct _Cursor {
- CursorBitsPtr bits;
- unsigned short foreRed, foreGreen, foreBlue; /* device-independent color */
- unsigned short backRed, backGreen, backBlue; /* device-independent color */
- int refcnt;
- pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/
-} CursorRec;
-
-typedef struct _CursorMetric {
- unsigned short width, height, xhot, yhot;
-} CursorMetricRec;
-
-#endif /* CURSORSTRUCT_H */
diff --git a/include/dix.h b/include/dix.h
deleted file mode 100644
index a47bfd8cc..000000000
--- a/include/dix.h
+++ /dev/null
@@ -1,788 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/dix.h,v 3.27 2003/04/27 21:31:04 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: dix.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-
-#ifndef DIX_H
-#define DIX_H
-
-#include "gc.h"
-#include "window.h"
-#include "input.h"
-
-#define EARLIER -1
-#define SAMETIME 0
-#define LATER 1
-
-#define NullClient ((ClientPtr) 0)
-#define REQUEST(type) \
- register type *stuff = (type *)client->requestBuffer
-
-
-#define REQUEST_SIZE_MATCH(req)\
- if ((sizeof(req) >> 2) != client->req_len)\
- return(BadLength)
-
-#define REQUEST_AT_LEAST_SIZE(req) \
- if ((sizeof(req) >> 2) > client->req_len )\
- return(BadLength)
-
-#define REQUEST_FIXED_SIZE(req, n)\
- if (((sizeof(req) >> 2) > client->req_len) || \
- (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
- return(BadLength)
-
-#define LEGAL_NEW_RESOURCE(id,client)\
- if (!LegalNewID(id,client)) \
- {\
- client->errorValue = id;\
- return(BadIDChoice);\
- }
-
-/* XXX if you are using this macro, you are probably not generating Match
- * errors where appropriate */
-#define LOOKUP_DRAWABLE(did, client)\
- ((client->lastDrawableID == did) ? \
- client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
-
-#ifdef XCSECURITY
-
-#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
- if (client->lastDrawableID == did && !client->trustLevel)\
- pDraw = client->lastDrawable;\
- else \
- {\
- pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
- RC_DRAWABLE, mode);\
- if (!pDraw) \
- {\
- client->errorValue = did; \
- return BadDrawable;\
- }\
- if (pDraw->type == UNDRAWABLE_WINDOW)\
- return BadMatch;\
- }
-
-#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
- if (client->lastDrawableID == did && !client->trustLevel)\
- pDraw = client->lastDrawable;\
- else \
- {\
- pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
- RC_DRAWABLE, mode);\
- if (!pDraw) \
- {\
- client->errorValue = did; \
- return BadDrawable;\
- }\
- }
-
-#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
- if (client->lastGCID == rid && !client->trustLevel)\
- pGC = client->lastGC;\
- else\
- pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
- if (!pGC)\
- {\
- client->errorValue = rid;\
- return (BadGC);\
- }
-
-#define VERIFY_DRAWABLE(pDraw, did, client)\
- SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)
-
-#define VERIFY_GEOMETRABLE(pDraw, did, client)\
- SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)
-
-#define VERIFY_GC(pGC, rid, client)\
- SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
-
-#else /* not XCSECURITY */
-
-#define VERIFY_DRAWABLE(pDraw, did, client)\
- if (client->lastDrawableID == did)\
- pDraw = client->lastDrawable;\
- else \
- {\
- pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
- if (!pDraw) \
- {\
- client->errorValue = did; \
- return BadDrawable;\
- }\
- if (pDraw->type == UNDRAWABLE_WINDOW)\
- return BadMatch;\
- }
-
-#define VERIFY_GEOMETRABLE(pDraw, did, client)\
- if (client->lastDrawableID == did)\
- pDraw = client->lastDrawable;\
- else \
- {\
- pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
- if (!pDraw) \
- {\
- client->errorValue = did; \
- return BadDrawable;\
- }\
- }
-
-#define VERIFY_GC(pGC, rid, client)\
- if (client->lastGCID == rid)\
- pGC = client->lastGC;\
- else\
- pGC = (GC *)LookupIDByType(rid, RT_GC);\
- if (!pGC)\
- {\
- client->errorValue = rid;\
- return (BadGC);\
- }
-
-#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
- VERIFY_DRAWABLE(pDraw, did, client)
-
-#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
- VERIFY_GEOMETRABLE(pDraw, did, client)
-
-#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
- VERIFY_GC(pGC, rid, client)
-
-#endif /* XCSECURITY */
-
-/*
- * We think that most hardware implementations of DBE will want
- * LookupID*(dbe_back_buffer_id) to return the window structure that the
- * id is a back buffer for. Since both front and back buffers will
- * return the same structure, you need to be able to distinguish
- * somewhere what kind of buffer (front/back) was being asked for, so
- * that ddx can render to the right place. That's the problem that the
- * following code solves. Note: we couldn't embed this in the LookupID*
- * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents
- * those functions by checking a one-element cache. That's why we're
- * mucking with VALIDATE_DRAWABLE_AND_GC.
- *
- * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window
- * structure will have two additional bits defined, srcBuffer and
- * dstBuffer, and their values will be maintained via the macros
- * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below). If you also
- * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function
- * DbeValidateBuffer will be called any time the bits change to give you
- * a chance to do some setup. See the DBE code for more details on this
- * function. We put in these levels of conditionality so that you can do
- * just what you need to do, and no more. If neither of these defines
- * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will
- * be unchanged. dpw
- */
-
-#if defined(NEED_DBE_BUF_BITS)
-#define SET_DBE_DSTBUF(_pDraw, _drawID) \
- SET_DBE_BUF(_pDraw, _drawID, dstBuffer, TRUE)
-#define SET_DBE_SRCBUF(_pDraw, _drawID) \
- SET_DBE_BUF(_pDraw, _drawID, srcBuffer, FALSE)
-#if defined (NEED_DBE_BUF_VALIDATE)
-#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
- if (_pDraw->type == DRAWABLE_WINDOW)\
- {\
- int thisbuf = (_pDraw->id == _drawID);\
- if (thisbuf != ((WindowPtr)_pDraw)->_whichBuffer)\
- {\
- ((WindowPtr)_pDraw)->_whichBuffer = thisbuf;\
- DbeValidateBuffer((WindowPtr)_pDraw, _drawID, _dstbuf);\
- }\
- }
-#else /* want buffer bits, but don't need to call DbeValidateBuffer */
-#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
- if (_pDraw->type == DRAWABLE_WINDOW)\
- {\
- ((WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\
- }
-#endif /* NEED_DBE_BUF_VALIDATE */
-#else /* don't want buffer bits in window */
-#define SET_DBE_DSTBUF(_pDraw, _drawID) /**/
-#define SET_DBE_SRCBUF(_pDraw, _drawID) /**/
-#endif /* NEED_DBE_BUF_BITS */
-
-#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
- if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
- (client->lastDrawableID != drawID))\
- {\
- SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\
- SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\
- if ((pGC->depth != pDraw->depth) ||\
- (pGC->pScreen != pDraw->pScreen))\
- return (BadMatch);\
- client->lastDrawable = pDraw;\
- client->lastDrawableID = drawID;\
- client->lastGC = pGC;\
- client->lastGCID = stuff->gc;\
- }\
- else\
- {\
- pGC = client->lastGC;\
- pDraw = client->lastDrawable;\
- }\
- SET_DBE_DSTBUF(pDraw, drawID);\
- if (pGC->serialNumber != pDraw->serialNumber)\
- ValidateGC(pDraw, pGC);
-
-
-#define WriteReplyToClient(pClient, size, pReply) { \
- if ((pClient)->swapped) \
- (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
- (pClient, (int)(size), pReply); \
- else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); }
-
-#define WriteSwappedDataToClient(pClient, size, pbuf) \
- if ((pClient)->swapped) \
- (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
- else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
-
-typedef struct _TimeStamp *TimeStampPtr;
-
-#ifndef _XTYPEDEF_CLIENTPTR
-typedef struct _Client *ClientPtr; /* also in misc.h */
-#define _XTYPEDEF_CLIENTPTR
-#endif
-
-typedef struct _WorkQueue *WorkQueuePtr;
-
-extern ClientPtr requestingClient;
-extern ClientPtr *clients;
-extern ClientPtr serverClient;
-extern int currentMaxClients;
-
-typedef int HWEventQueueType;
-typedef HWEventQueueType* HWEventQueuePtr;
-
-extern HWEventQueuePtr checkForInput[2];
-
-typedef struct _TimeStamp {
- CARD32 months; /* really ~49.7 days */
- CARD32 milliseconds;
-} TimeStamp;
-
-/* dispatch.c */
-
-extern void SetInputCheck(
- HWEventQueuePtr /*c0*/,
- HWEventQueuePtr /*c1*/);
-
-extern void CloseDownClient(
- ClientPtr /*client*/);
-
-extern void UpdateCurrentTime(void);
-
-extern void UpdateCurrentTimeIf(void);
-
-extern void InitSelections(void);
-
-extern void FlushClientCaches(XID /*id*/);
-
-extern int dixDestroyPixmap(
- pointer /*value*/,
- XID /*pid*/);
-
-extern void CloseDownRetainedResources(void);
-
-extern void InitClient(
- ClientPtr /*client*/,
- int /*i*/,
- pointer /*ospriv*/);
-
-extern ClientPtr NextAvailableClient(
- pointer /*ospriv*/);
-
-extern void SendErrorToClient(
- ClientPtr /*client*/,
- unsigned int /*majorCode*/,
- unsigned int /*minorCode*/,
- XID /*resId*/,
- int /*errorCode*/);
-
-extern void DeleteWindowFromAnySelections(
- WindowPtr /*pWin*/);
-
-extern void MarkClientException(
- ClientPtr /*client*/);
-
-extern int GetGeometry(
- ClientPtr /*client*/,
- xGetGeometryReply* /* wa */);
-
-extern int SendConnSetup(
- ClientPtr /*client*/,
- char* /*reason*/);
-
-extern int DoGetImage(
- ClientPtr /*client*/,
- int /*format*/,
- Drawable /*drawable*/,
- int /*x*/,
- int /*y*/,
- int /*width*/,
- int /*height*/,
- Mask /*planemask*/,
- xGetImageReply **/*im_return*/);
-
-#ifdef LBX
-extern void IncrementClientCount(void);
-#endif /* LBX */
-
-/* dixutils.c */
-
-extern void CopyISOLatin1Lowered(
- unsigned char * /*dest*/,
- unsigned char * /*source*/,
- int /*length*/);
-
-#ifdef XCSECURITY
-
-extern WindowPtr SecurityLookupWindow(
- XID /*rid*/,
- ClientPtr /*client*/,
- Mask /*access_mode*/);
-
-extern pointer SecurityLookupDrawable(
- XID /*rid*/,
- ClientPtr /*client*/,
- Mask /*access_mode*/);
-
-extern WindowPtr LookupWindow(
- XID /*rid*/,
- ClientPtr /*client*/);
-
-extern pointer LookupDrawable(
- XID /*rid*/,
- ClientPtr /*client*/);
-
-#else
-
-extern WindowPtr LookupWindow(
- XID /*rid*/,
- ClientPtr /*client*/);
-
-extern pointer LookupDrawable(
- XID /*rid*/,
- ClientPtr /*client*/);
-
-#define SecurityLookupWindow(rid, client, access_mode) \
- LookupWindow(rid, client)
-
-#define SecurityLookupDrawable(rid, client, access_mode) \
- LookupDrawable(rid, client)
-
-#endif /* XCSECURITY */
-
-extern ClientPtr LookupClient(
- XID /*rid*/,
- ClientPtr /*client*/);
-
-extern void NoopDDA(void);
-
-extern int AlterSaveSetForClient(
- ClientPtr /*client*/,
- WindowPtr /*pWin*/,
- unsigned /*mode*/);
-
-extern void DeleteWindowFromAnySaveSet(
- WindowPtr /*pWin*/);
-
-extern void BlockHandler(
- pointer /*pTimeout*/,
- pointer /*pReadmask*/);
-
-extern void WakeupHandler(
- int /*result*/,
- pointer /*pReadmask*/);
-
-typedef void (* WakeupHandlerProcPtr)(
- pointer /* blockData */,
- int /* result */,
- pointer /* pReadmask */);
-
-extern Bool RegisterBlockAndWakeupHandlers(
- BlockHandlerProcPtr /*blockHandler*/,
- WakeupHandlerProcPtr /*wakeupHandler*/,
- pointer /*blockData*/);
-
-extern void RemoveBlockAndWakeupHandlers(
- BlockHandlerProcPtr /*blockHandler*/,
- WakeupHandlerProcPtr /*wakeupHandler*/,
- pointer /*blockData*/);
-
-extern void InitBlockAndWakeupHandlers(void);
-
-extern void ProcessWorkQueue(void);
-
-extern void ProcessWorkQueueZombies(void);
-
-extern Bool QueueWorkProc(
- Bool (* /*function*/)(
- ClientPtr /*clientUnused*/,
- pointer /*closure*/),
- ClientPtr /*client*/,
- pointer /*closure*/
-);
-
-typedef Bool (* ClientSleepProcPtr)(
- ClientPtr /*client*/,
- pointer /*closure*/);
-
-extern Bool ClientSleep(
- ClientPtr /*client*/,
- ClientSleepProcPtr /* function */,
- pointer /*closure*/);
-
-#ifndef ___CLIENTSIGNAL_DEFINED___
-#define ___CLIENTSIGNAL_DEFINED___
-extern Bool ClientSignal(
- ClientPtr /*client*/);
-#endif /* ___CLIENTSIGNAL_DEFINED___ */
-
-extern void ClientWakeup(
- ClientPtr /*client*/);
-
-extern Bool ClientIsAsleep(
- ClientPtr /*client*/);
-
-/* atom.c */
-
-extern Atom MakeAtom(
- char * /*string*/,
- unsigned /*len*/,
- Bool /*makeit*/);
-
-extern Bool ValidAtom(
- Atom /*atom*/);
-
-extern char *NameForAtom(
- Atom /*atom*/);
-
-extern void AtomError(void);
-
-extern void FreeAllAtoms(void);
-
-extern void InitAtoms(void);
-
-/* events.c */
-
-extern void SetMaskForEvent(
- Mask /* mask */,
- int /* event */);
-
-
-extern Bool IsParent(
- WindowPtr /* maybeparent */,
- WindowPtr /* child */);
-
-extern WindowPtr GetCurrentRootWindow(void);
-
-extern WindowPtr GetSpriteWindow(void);
-
-
-extern void NoticeEventTime(xEventPtr /* xE */);
-
-extern void EnqueueEvent(
- xEventPtr /* xE */,
- DeviceIntPtr /* device */,
- int /* count */);
-
-extern void ComputeFreezes(void);
-
-extern void CheckGrabForSyncs(
- DeviceIntPtr /* dev */,
- Bool /* thisMode */,
- Bool /* otherMode */);
-
-extern void ActivatePointerGrab(
- DeviceIntPtr /* mouse */,
- GrabPtr /* grab */,
- TimeStamp /* time */,
- Bool /* autoGrab */);
-
-extern void DeactivatePointerGrab(
- DeviceIntPtr /* mouse */);
-
-extern void ActivateKeyboardGrab(
- DeviceIntPtr /* keybd */,
- GrabPtr /* grab */,
- TimeStamp /* time */,
- Bool /* passive */);
-
-extern void DeactivateKeyboardGrab(
- DeviceIntPtr /* keybd */);
-
-extern void AllowSome(
- ClientPtr /* client */,
- TimeStamp /* time */,
- DeviceIntPtr /* thisDev */,
- int /* newState */);
-
-extern void ReleaseActiveGrabs(
- ClientPtr client);
-
-extern int DeliverEventsToWindow(
- WindowPtr /* pWin */,
- xEventPtr /* pEvents */,
- int /* count */,
- Mask /* filter */,
- GrabPtr /* grab */,
- int /* mskidx */);
-
-extern int DeliverDeviceEvents(
- WindowPtr /* pWin */,
- xEventPtr /* xE */,
- GrabPtr /* grab */,
- WindowPtr /* stopAt */,
- DeviceIntPtr /* dev */,
- int /* count */);
-
-extern void DefineInitialRootWindow(
- WindowPtr /* win */);
-
-extern void WindowHasNewCursor(
- WindowPtr /* pWin */);
-
-extern Bool CheckDeviceGrabs(
- DeviceIntPtr /* device */,
- xEventPtr /* xE */,
- int /* checkFirst */,
- int /* count */);
-
-extern void DeliverFocusedEvent(
- DeviceIntPtr /* keybd */,
- xEventPtr /* xE */,
- WindowPtr /* window */,
- int /* count */);
-
-extern void DeliverGrabbedEvent(
- xEventPtr /* xE */,
- DeviceIntPtr /* thisDev */,
- Bool /* deactivateGrab */,
- int /* count */);
-
-#ifdef XKB
-extern void FixKeyState(
- xEvent * /* xE */,
- DeviceIntPtr /* keybd */);
-#endif /* XKB */
-
-extern void RecalculateDeliverableEvents(
- WindowPtr /* pWin */);
-
-extern int OtherClientGone(
- pointer /* value */,
- XID /* id */);
-
-extern void DoFocusEvents(
- DeviceIntPtr /* dev */,
- WindowPtr /* fromWin */,
- WindowPtr /* toWin */,
- int /* mode */);
-
-extern int SetInputFocus(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- Window /* focusID */,
- CARD8 /* revertTo */,
- Time /* ctime */,
- Bool /* followOK */);
-
-extern int GrabDevice(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned /* this_mode */,
- unsigned /* other_mode */,
- Window /* grabWindow */,
- unsigned /* ownerEvents */,
- Time /* ctime */,
- Mask /* mask */,
- CARD8 * /* status */);
-
-extern void InitEvents(void);
-
-extern void CloseDownEvents(void);
-
-extern void DeleteWindowFromAnyEvents(
- WindowPtr /* pWin */,
- Bool /* freeResources */);
-
-
-extern Mask EventMaskForClient(
- WindowPtr /* pWin */,
- ClientPtr /* client */);
-
-
-
-extern int DeliverEvents(
- WindowPtr /*pWin*/,
- xEventPtr /*xE*/,
- int /*count*/,
- WindowPtr /*otherParent*/);
-
-
-extern void WriteEventsToClient(
- ClientPtr /*pClient*/,
- int /*count*/,
- xEventPtr /*events*/);
-
-extern int TryClientEvents(
- ClientPtr /*client*/,
- xEventPtr /*pEvents*/,
- int /*count*/,
- Mask /*mask*/,
- Mask /*filter*/,
- GrabPtr /*grab*/);
-
-extern void WindowsRestructured(void);
-
-
-#ifdef RANDR
-void
-ScreenRestructured (ScreenPtr pScreen);
-#endif
-
-extern void ResetClientPrivates(void);
-
-extern int AllocateClientPrivateIndex(void);
-
-extern Bool AllocateClientPrivate(
- int /*index*/,
- unsigned /*amount*/);
-
-/*
- * callback manager stuff
- */
-
-#ifndef _XTYPEDEF_CALLBACKLISTPTR
-typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
-#define _XTYPEDEF_CALLBACKLISTPTR
-#endif
-
-typedef void (*CallbackProcPtr) (
- CallbackListPtr *, pointer, pointer);
-
-typedef Bool (*AddCallbackProcPtr) (
- CallbackListPtr *, CallbackProcPtr, pointer);
-
-typedef Bool (*DeleteCallbackProcPtr) (
- CallbackListPtr *, CallbackProcPtr, pointer);
-
-typedef void (*CallCallbacksProcPtr) (
- CallbackListPtr *, pointer);
-
-typedef void (*DeleteCallbackListProcPtr) (
- CallbackListPtr *);
-
-typedef struct _CallbackProcs {
- AddCallbackProcPtr AddCallback;
- DeleteCallbackProcPtr DeleteCallback;
- CallCallbacksProcPtr CallCallbacks;
- DeleteCallbackListProcPtr DeleteCallbackList;
-} CallbackFuncsRec, *CallbackFuncsPtr;
-
-extern Bool CreateCallbackList(
- CallbackListPtr * /*pcbl*/,
- CallbackFuncsPtr /*cbfuncs*/);
-
-extern Bool AddCallback(
- CallbackListPtr * /*pcbl*/,
- CallbackProcPtr /*callback*/,
- pointer /*data*/);
-
-extern Bool DeleteCallback(
- CallbackListPtr * /*pcbl*/,
- CallbackProcPtr /*callback*/,
- pointer /*data*/);
-
-extern void CallCallbacks(
- CallbackListPtr * /*pcbl*/,
- pointer /*call_data*/);
-
-extern void DeleteCallbackList(
- CallbackListPtr * /*pcbl*/);
-
-extern void InitCallbackManager(void);
-
-/*
- * ServerGrabCallback stuff
- */
-
-extern CallbackListPtr ServerGrabCallback;
-
-typedef enum {SERVER_GRABBED, SERVER_UNGRABBED,
- CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;
-
-typedef struct {
- ClientPtr client;
- ServerGrabState grabstate;
-} ServerGrabInfoRec;
-
-/*
- * EventCallback stuff
- */
-
-extern CallbackListPtr EventCallback;
-
-typedef struct {
- ClientPtr client;
- xEventPtr events;
- int count;
-} EventInfoRec;
-
-/*
- * DeviceEventCallback stuff
- */
-
-extern CallbackListPtr DeviceEventCallback;
-
-typedef struct {
- xEventPtr events;
- int count;
-} DeviceEventInfoRec;
-
-#endif /* DIX_H */
diff --git a/include/dixevents.h b/include/dixevents.h
deleted file mode 100644
index f80f3ab0b..000000000
--- a/include/dixevents.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/dixevents.h,v 3.5 2003/04/27 21:31:04 herrb Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef DIXEVENTS_H
-#define DIXEVENTS_H
-
-extern void SetCriticalEvent(int /* event */);
-
-extern CursorPtr GetSpriteCursor(void);
-
-extern int ProcAllowEvents(ClientPtr /* client */);
-
-extern int MaybeDeliverEventsToClient(
- WindowPtr /* pWin */,
- xEvent * /* pEvents */,
- int /* count */,
- Mask /* filter */,
- ClientPtr /* dontClient */);
-
-extern int ProcWarpPointer(ClientPtr /* client */);
-
-#if 0
-extern void
-#ifdef XKB
-CoreProcessKeyboardEvent (
-#else
-ProcessKeyboardEvent (
-#endif
- xEvent * /* xE */,
- DeviceIntPtr /* keybd */,
- int /* count */);
-
-extern void
-#ifdef XKB
-CoreProcessPointerEvent (
-#else
-ProcessPointerEvent (
-#endif
- xEvent * /* xE */,
- DeviceIntPtr /* mouse */,
- int /* count */);
-#endif
-
-extern int EventSelectForWindow(
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */);
-
-extern int EventSuppressForWindow(
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- Bool * /* checkOptional */);
-
-extern int ProcSetInputFocus(ClientPtr /* client */);
-
-extern int ProcGetInputFocus(ClientPtr /* client */);
-
-extern int ProcGrabPointer(ClientPtr /* client */);
-
-extern int ProcChangeActivePointerGrab(ClientPtr /* client */);
-
-extern int ProcUngrabPointer(ClientPtr /* client */);
-
-extern int ProcGrabKeyboard(ClientPtr /* client */);
-
-extern int ProcUngrabKeyboard(ClientPtr /* client */);
-
-extern int ProcQueryPointer(ClientPtr /* client */);
-
-extern int ProcSendEvent(ClientPtr /* client */);
-
-extern int ProcUngrabKey(ClientPtr /* client */);
-
-extern int ProcGrabKey(ClientPtr /* client */);
-
-extern int ProcGrabButton(ClientPtr /* client */);
-
-extern int ProcUngrabButton(ClientPtr /* client */);
-
-extern int ProcRecolorCursor(ClientPtr /* client */);
-
-#endif /* DIXEVENTS_H */
diff --git a/include/dixfont.h b/include/dixfont.h
deleted file mode 100644
index 2a6877de2..000000000
--- a/include/dixfont.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $Xorg: dixfont.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/dixfont.h,v 3.8 2001/04/05 17:42:35 dawes Exp $ */
-
-#ifndef DIXFONT_H
-#define DIXFONT_H 1
-
-#include "dix.h"
-#include "font.h"
-#include "closure.h"
-#include "fontstruct.h"
-
-#define NullDIXFontProp ((DIXFontPropPtr)0)
-
-typedef struct _DIXFontProp *DIXFontPropPtr;
-
-extern FPEFunctions *fpe_functions;
-
-extern int FontToXError(int /*err*/);
-
-extern Bool SetDefaultFont(char * /*defaultfontname*/);
-
-extern void QueueFontWakeup(FontPathElementPtr /*fpe*/);
-
-extern void RemoveFontWakeup(FontPathElementPtr /*fpe*/);
-
-extern void FontWakeup(pointer /*data*/,
- int /*count*/,
- pointer /*LastSelectMask*/);
-
-extern int OpenFont(ClientPtr /*client*/,
- XID /*fid*/,
- Mask /*flags*/,
- unsigned /*lenfname*/,
- char * /*pfontname*/);
-
-extern int CloseFont(pointer /*pfont*/,
- XID /*fid*/);
-
-typedef struct _xQueryFontReply *xQueryFontReplyPtr;
-
-extern void QueryFont(FontPtr /*pFont*/,
- xQueryFontReplyPtr /*pReply*/,
- int /*nProtoCCIStructs*/);
-
-extern int ListFonts(ClientPtr /*client*/,
- unsigned char * /*pattern*/,
- unsigned int /*length*/,
- unsigned int /*max_names*/);
-
-int
-doListFontsWithInfo(ClientPtr /*client*/,
- LFWIclosurePtr /*c*/);
-
-extern int doPolyText(ClientPtr /*client*/,
- PTclosurePtr /*c*/
-);
-
-extern int PolyText(ClientPtr /*client*/,
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- unsigned char * /*pElt*/,
- unsigned char * /*endReq*/,
- int /*xorg*/,
- int /*yorg*/,
- int /*reqType*/,
- XID /*did*/);
-
-extern int doImageText(ClientPtr /*client*/,
- ITclosurePtr /*c*/);
-
-extern int ImageText(ClientPtr /*client*/,
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*nChars*/,
- unsigned char * /*data*/,
- int /*xorg*/,
- int /*yorg*/,
- int /*reqType*/,
- XID /*did*/);
-
-extern int SetFontPath(ClientPtr /*client*/,
- int /*npaths*/,
- unsigned char * /*paths*/,
- int * /*error*/);
-
-extern int SetDefaultFontPath(char * /*path*/);
-
-extern unsigned char *GetFontPath(int * /*count*/,
- int * /*length*/);
-
-extern int LoadGlyphs(ClientPtr /*client*/,
- FontPtr /*pfont*/,
- unsigned /*nchars*/,
- int /*item_size*/,
- unsigned char * /*data*/);
-
-extern void DeleteClientFontStuff(ClientPtr /*client*/);
-
-/* Quartz support on Mac OS X pulls in the QuickDraw
- framework whose InitFonts function conflicts here. */
-#ifdef __DARWIN__
-#define InitFonts Darwin_X_InitFonts
-#endif
-extern void InitFonts(void);
-
-extern void FreeFonts(void);
-
-extern FontPtr find_old_font(XID /*id*/);
-
-extern void GetGlyphs(FontPtr /*font*/,
- unsigned long /*count*/,
- unsigned char * /*chars*/,
- FontEncoding /*fontEncoding*/,
- unsigned long * /*glyphcount*/,
- CharInfoPtr * /*glyphs*/);
-
-extern void QueryGlyphExtents(FontPtr /*pFont*/,
- CharInfoPtr * /*charinfo*/,
- unsigned long /*count*/,
- ExtentInfoPtr /*info*/);
-
-extern Bool QueryTextExtents(FontPtr /*pFont*/,
- unsigned long /*count*/,
- unsigned char * /*chars*/,
- ExtentInfoPtr /*info*/);
-
-extern Bool ParseGlyphCachingMode(char * /*str*/);
-
-extern void InitGlyphCaching(void);
-
-extern void SetGlyphCachingMode(int /*newmode*/);
-
-#endif /* DIXFONT_H */
diff --git a/include/dixfontstr.h b/include/dixfontstr.h
deleted file mode 100644
index d1d0449dc..000000000
--- a/include/dixfontstr.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $Xorg: dixfontstr.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifndef DIXFONTSTRUCT_H
-#define DIXFONTSTRUCT_H
-
-#include "servermd.h"
-#include "dixfont.h"
-#include "fontstruct.h"
-#include "closure.h"
-#define NEED_REPLIES
-#include "X11/Xproto.h" /* for xQueryFontReply */
-
-#define FONTCHARSET(font) (font)
-#define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field
-#define FONTMINBOUNDS(font,field) (font)->info.minbounds.field
-#define TERMINALFONT(font) (font)->info.terminalFont
-#define FONTASCENT(font) (font)->info.fontAscent
-#define FONTDESCENT(font) (font)->info.fontDescent
-#define FONTGLYPHS(font) 0
-#define FONTCONSTMETRICS(font) (font)->info.constantMetrics
-#define FONTCONSTWIDTH(font) (font)->info.constantWidth
-#define FONTALLEXIST(font) (font)->info.allExist
-#define FONTFIRSTCOL(font) (font)->info.firstCol
-#define FONTLASTCOL(font) (font)->info.lastCol
-#define FONTFIRSTROW(font) (font)->info.firstRow
-#define FONTLASTROW(font) (font)->info.lastRow
-#define FONTDEFAULTCH(font) (font)->info.defaultCh
-#define FONTINKMIN(font) (&((font)->info.ink_minbounds))
-#define FONTINKMAX(font) (&((font)->info.ink_maxbounds))
-#define FONTPROPS(font) (font)->info.props
-#define FONTGLYPHBITS(base,pci) ((unsigned char *) (pci)->bits)
-#define FONTINFONPROPS(font) (font)->info.nprops
-
-/* some things haven't changed names, but we'll be careful anyway */
-
-#define FONTREFCNT(font) (font)->refcnt
-
-/*
- * for linear char sets
- */
-#define N1dChars(pfont) (FONTLASTCOL(pfont) - FONTFIRSTCOL(pfont) + 1)
-
-/*
- * for 2D char sets
- */
-#define N2dChars(pfont) (N1dChars(pfont) * \
- (FONTLASTROW(pfont) - FONTFIRSTROW(pfont) + 1))
-
-#ifndef GLYPHPADBYTES
-#define GLYPHPADBYTES -1
-#endif
-
-#if GLYPHPADBYTES == 0 || GLYPHPADBYTES == 1
-#define GLYPHWIDTHBYTESPADDED(pci) (GLYPHWIDTHBYTES(pci))
-#define PADGLYPHWIDTHBYTES(w) (((w)+7)>>3)
-#endif
-
-#if GLYPHPADBYTES == 2
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+1) & ~0x1)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+1) & ~0x1)
-#endif
-
-#if GLYPHPADBYTES == 4
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+3) & ~0x3)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+3) & ~0x3)
-#endif
-
-#if GLYPHPADBYTES == 8 /* for a cray? */
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+7) & ~0x7)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+7) & ~0x7)
-#endif
-
-#endif /* DIXFONTSTRUCT_H */
diff --git a/include/dixgrabs.h b/include/dixgrabs.h
deleted file mode 100644
index 21992e786..000000000
--- a/include/dixgrabs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/dixgrabs.h,v 3.1 2003/04/27 21:31:04 herrb Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef DIXGRABS_H
-#define DIXGRABS_H 1
-
-extern GrabPtr CreateGrab(
- int /* client */,
- DeviceIntPtr /* device */,
- WindowPtr /* window */,
- Mask /* eventMask */,
- Bool /* ownerEvents */,
- Bool /* keyboardMode */,
- Bool /* pointerMode */,
- DeviceIntPtr /* modDevice */,
- unsigned short /* modifiers */,
- int /* type */,
- KeyCode /* keybut */,
- WindowPtr /* confineTo */,
- CursorPtr /* cursor */);
-
-extern int DeletePassiveGrab(
- pointer /* value */,
- XID /* id */);
-
-extern Bool GrabMatchesSecond(
- GrabPtr /* pFirstGrab */,
- GrabPtr /* pSecondGrab */);
-
-extern int AddPassiveGrabToList(
- GrabPtr /* pGrab */);
-
-extern Bool DeletePassiveGrabFromList(
- GrabPtr /* pMinuendGrab */);
-
-#endif /* DIXGRABS_H */
diff --git a/include/dixstruct.h b/include/dixstruct.h
deleted file mode 100644
index 43920540f..000000000
--- a/include/dixstruct.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.20 2003/11/03 05:11:59 tsi Exp $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: dixstruct.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */
-
-#ifndef DIXSTRUCT_H
-#define DIXSTRUCT_H
-
-#include "dix.h"
-#include "resource.h"
-#include "cursor.h"
-#include "gc.h"
-#include "pixmap.h"
-#include <X11/Xmd.h>
-
-/*
- * direct-mapped hash table, used by resource manager to store
- * translation from client ids to server addresses.
- */
-
-#ifdef DEBUG
-#define MAX_REQUEST_LOG 100
-#endif
-
-extern CallbackListPtr ClientStateCallback;
-
-typedef struct {
- ClientPtr client;
- xConnSetupPrefix *prefix;
- xConnSetup *setup;
-} NewClientInfoRec;
-
-typedef void (*ReplySwapPtr) (
- ClientPtr /* pClient */,
- int /* size */,
- void * /* pbuf */);
-
-extern void ReplyNotSwappd (
- ClientPtr /* pClient */,
- int /* size */,
- void * /* pbuf */);
-
-typedef enum {ClientStateInitial,
- ClientStateAuthenticating,
- ClientStateRunning,
- ClientStateRetained,
- ClientStateGone,
- ClientStateCheckingSecurity,
- ClientStateCheckedSecurity} ClientState;
-
-typedef struct _Client {
- int index;
- Mask clientAsMask;
- pointer requestBuffer;
- pointer osPrivate; /* for OS layer, including scheduler */
- Bool swapped;
- ReplySwapPtr pSwapReplyFunc;
- XID errorValue;
- int sequence;
- int closeDownMode;
- int clientGone;
- int noClientException; /* this client died or needs to be
- * killed */
- DrawablePtr lastDrawable;
- Drawable lastDrawableID;
- GCPtr lastGC;
- GContext lastGCID;
- pointer *saveSet;
- int numSaved;
- pointer screenPrivate[MAXSCREENS];
- int (**requestVector) (
- ClientPtr /* pClient */);
- CARD32 req_len; /* length of current request */
- Bool big_requests; /* supports large requests */
- int priority;
- ClientState clientState;
- DevUnion *devPrivates;
-#ifdef XKB
- unsigned short xkbClientFlags;
- unsigned short mapNotifyMask;
- unsigned short newKeyboardNotifyMask;
- unsigned short vMajor,vMinor;
- KeyCode minKC,maxKC;
-#endif
-
-#ifdef DEBUG
- unsigned char requestLog[MAX_REQUEST_LOG];
- int requestLogIndex;
-#endif
-#ifdef LBX
- int (*readRequest)(ClientPtr /*client*/);
-#endif
- unsigned long replyBytesRemaining;
-#ifdef XCSECURITY
- XID authId;
- unsigned int trustLevel;
- pointer (* CheckAccess)(
- ClientPtr /*pClient*/,
- XID /*id*/,
- RESTYPE /*classes*/,
- Mask /*access_mode*/,
- pointer /*resourceval*/);
-#endif
-#ifdef XAPPGROUP
- struct _AppGroupRec* appgroup;
-#endif
- struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
- ClientPtr /* pClient */,
- int * /* num */);
-#ifdef SMART_SCHEDULE
- int smart_priority;
- long smart_start_tick;
- long smart_stop_tick;
- long smart_check_tick;
-#endif
-} ClientRec;
-
-#ifdef SMART_SCHEDULE
-/*
- * Scheduling interface
- */
-extern long SmartScheduleTime;
-extern long SmartScheduleInterval;
-extern long SmartScheduleSlice;
-extern long SmartScheduleMaxSlice;
-extern unsigned long SmartScheduleIdleCount;
-extern Bool SmartScheduleDisable;
-extern Bool SmartScheduleIdle;
-extern Bool SmartScheduleTimerStopped;
-extern Bool SmartScheduleStartTimer(void);
-#define SMART_MAX_PRIORITY (20)
-#define SMART_MIN_PRIORITY (-20)
-
-extern Bool SmartScheduleInit(void);
-
-#endif
-
-/* This prototype is used pervasively in Xext, dix */
-#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
-
-typedef struct _WorkQueue {
- struct _WorkQueue *next;
- Bool (*function) (
- ClientPtr /* pClient */,
- pointer /* closure */
-);
- ClientPtr client;
- pointer closure;
-} WorkQueueRec;
-
-extern TimeStamp currentTime;
-extern TimeStamp lastDeviceEventTime;
-
-extern int CompareTimeStamps(
- TimeStamp /*a*/,
- TimeStamp /*b*/);
-
-extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/);
-
-typedef struct _CallbackRec {
- CallbackProcPtr proc;
- pointer data;
- Bool deleted;
- struct _CallbackRec *next;
-} CallbackRec, *CallbackPtr;
-
-typedef struct _CallbackList {
- CallbackFuncsRec funcs;
- int inCallback;
- Bool deleted;
- int numDeleted;
- CallbackPtr list;
-} CallbackListRec;
-
-/* proc vectors */
-
-extern int (* InitialVector[3]) (ClientPtr /*client*/);
-
-extern int (* ProcVector[256]) (ClientPtr /*client*/);
-
-extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
-
-#ifdef K5AUTH
-extern int (*k5_Vector[256])(ClientPtr /*client*/);
-#endif
-
-extern ReplySwapPtr ReplySwapVector[256];
-
-extern int ProcBadRequest(ClientPtr /*client*/);
-
-#endif /* DIXSTRUCT_H */
diff --git a/include/exevents.h b/include/exevents.h
deleted file mode 100644
index ea3804bd3..000000000
--- a/include/exevents.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/exevents.h,v 3.2 2003/04/27 21:31:04 herrb Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- * Interface of 'exevents.c'
- */
-
-#ifndef EXEVENTS_H
-#define EXEVENTS_H
-
-extern void RegisterOtherDevice (
- DeviceIntPtr /* device */);
-
-extern void ProcessOtherEvent (
- xEventPtr /* FIXME deviceKeyButtonPointer * xE */,
- DeviceIntPtr /* other */,
- int /* count */);
-
-extern int InitProximityClassDeviceStruct(
- DeviceIntPtr /* dev */);
-
-extern void InitValuatorAxisStruct(
- DeviceIntPtr /* dev */,
- int /* axnum */,
- int /* minval */,
- int /* maxval */,
- int /* resolution */,
- int /* min_res */,
- int /* max_res */);
-
-extern void DeviceFocusEvent(
- DeviceIntPtr /* dev */,
- int /* type */,
- int /* mode */,
- int /* detail */,
- WindowPtr /* pWin */);
-
-extern int GrabButton(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- BYTE /* this_device_mode */,
- BYTE /* other_devices_mode */,
- CARD16 /* modifiers */,
- DeviceIntPtr /* modifier_device */,
- CARD8 /* button */,
- Window /* grabWindow */,
- BOOL /* ownerEvents */,
- Cursor /* rcursor */,
- Window /* rconfineTo */,
- Mask /* eventMask */);
-
-extern int GrabKey(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- BYTE /* this_device_mode */,
- BYTE /* other_devices_mode */,
- CARD16 /* modifiers */,
- DeviceIntPtr /* modifier_device */,
- CARD8 /* key */,
- Window /* grabWindow */,
- BOOL /* ownerEvents */,
- Mask /* mask */);
-
-extern int SelectForWindow(
- DeviceIntPtr /* dev */,
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- Mask /* exclusivemasks */,
- Mask /* validmasks */);
-
-extern int AddExtensionClient (
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- int /* mskidx */);
-
-extern void RecalculateDeviceDeliverableEvents(
- WindowPtr /* pWin */);
-
-extern int InputClientGone(
- WindowPtr /* pWin */,
- XID /* id */);
-
-extern int SendEvent (
- ClientPtr /* client */,
- DeviceIntPtr /* d */,
- Window /* dest */,
- Bool /* propagate */,
- xEvent * /* ev */,
- Mask /* mask */,
- int /* count */);
-
-extern int SetButtonMapping (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int /* nElts */,
- BYTE * /* map */);
-
-extern int SetModifierMapping(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int /* len */,
- int /* rlen */,
- int /* numKeyPerModifier */,
- KeyCode * /* inputMap */,
- KeyClassPtr * /* k */);
-
-extern void SendDeviceMappingNotify(
- CARD8 /* request, */,
- KeyCode /* firstKeyCode */,
- CARD8 /* count */,
- DeviceIntPtr /* dev */);
-
-extern int ChangeKeyMapping(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned /* len */,
- int /* type */,
- KeyCode /* firstKeyCode */,
- CARD8 /* keyCodes */,
- CARD8 /* keySymsPerKeyCode */,
- KeySym * /* map */);
-
-extern void DeleteWindowFromAnyExtEvents(
- WindowPtr /* pWin */,
- Bool /* freeResources */);
-
-extern void DeleteDeviceFromAnyExtEvents(
- WindowPtr /* pWin */,
- DeviceIntPtr /* dev */);
-
-extern int MaybeSendDeviceMotionNotifyHint (
- deviceKeyButtonPointer * /* pEvents */,
- Mask /* mask */);
-
-extern void CheckDeviceGrabAndHintWindow (
- WindowPtr /* pWin */,
- int /* type */,
- deviceKeyButtonPointer * /* xE */,
- GrabPtr /* grab */,
- ClientPtr /* client */,
- Mask /* deliveryMask */);
-
-extern Mask DeviceEventMaskForClient(
- DeviceIntPtr /* dev */,
- WindowPtr /* pWin */,
- ClientPtr /* client */);
-
-extern void MaybeStopDeviceHint(
- DeviceIntPtr /* dev */,
- ClientPtr /* client */);
-
-extern int DeviceEventSuppressForWindow(
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- int /* maskndx */);
-
-#endif /* EXEVENTS_H */
diff --git a/include/extension.h b/include/extension.h
deleted file mode 100644
index 6b674f07f..000000000
--- a/include/extension.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $Xorg: extension.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/extension.h,v 1.6 2003/04/27 21:31:04 herrb Exp $ */
-
-#ifndef EXTENSION_H
-#define EXTENSION_H
-
-_XFUNCPROTOBEGIN
-
-extern unsigned short StandardMinorOpcode(ClientPtr /*client*/);
-
-extern unsigned short MinorOpcodeOfRequest(ClientPtr /*client*/);
-
-extern void InitExtensions(int argc, char **argv);
-
-extern void InitVisualWrap(void);
-
-extern void CloseDownExtensions(void);
-
-_XFUNCPROTOEND
-
-#endif /* EXTENSION_H */
diff --git a/include/extinit.h b/include/extinit.h
deleted file mode 100644
index 107eee891..000000000
--- a/include/extinit.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/extinit.h,v 3.3 2003/11/17 22:20:43 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- * Interface of extinit.c
- */
-
-#ifndef EXTINIT_H
-#define EXTINIT_H
-
-#include "extnsionst.h"
-
-void
-XInputExtensionInit(
- void
- );
-
-
-int
-ProcIDispatch (
- ClientPtr /* client */
- );
-
-int
-SProcIDispatch(
- ClientPtr /* client */
- );
-
-void
-SReplyIDispatch (
- ClientPtr /* client */,
- int /* len */,
- xGrabDeviceReply * /* rep */
- );
-
-void
-SEventIDispatch (
- xEvent * /* from */,
- xEvent * /* to */
- );
-
-void
-SEventDeviceValuator (
- deviceValuator * /* from */,
- deviceValuator * /* to */
- );
-
-void
-SEventFocus (
- deviceFocus * /* from */,
- deviceFocus * /* to */
- );
-
-void
-SDeviceStateNotifyEvent (
- deviceStateNotify * /* from */,
- deviceStateNotify * /* to */
- );
-
-void
-SDeviceKeyStateNotifyEvent (
- deviceKeyStateNotify * /* from */,
- deviceKeyStateNotify * /* to */
- );
-
-void
-SDeviceButtonStateNotifyEvent (
- deviceButtonStateNotify * /* from */,
- deviceButtonStateNotify * /* to */
- );
-
-void
-SChangeDeviceNotifyEvent (
- changeDeviceNotify * /* from */,
- changeDeviceNotify * /* to */
- );
-
-void
-SDeviceMappingNotifyEvent (
- deviceMappingNotify * /* from */,
- deviceMappingNotify * /* to */
- );
-
-void
-FixExtensionEvents (
- ExtensionEntry * /* extEntry */
- );
-
-void
-RestoreExtensionEvents (
- void
- );
-
-void
-IResetProc(
- ExtensionEntry * /* unused */
- );
-
-void
-AssignTypeAndName (
- DeviceIntPtr /* dev */,
- Atom /* type */,
- char * /* name */
- );
-
-void
-MakeDeviceTypeAtoms (
- void
-);
-
-DeviceIntPtr
-LookupDeviceIntRec (
- CARD8 /* id */
- );
-
-void
-SetExclusiveAccess (
- Mask /* mask */
- );
-
-void
-AllowPropagateSuppress (
- Mask /* mask */
- );
-
-Mask
-GetNextExtEventMask (
- void
-);
-
-void
-SetMaskForExtEvent(
- Mask /* mask */,
- int /* event */
- );
-
-void
-SetEventInfo(
- Mask /* mask */,
- int /* constant */
- );
-
-#endif /* EXTINIT_H */
diff --git a/include/extnsionst.h b/include/extnsionst.h
deleted file mode 100644
index 0d7debe0b..000000000
--- a/include/extnsionst.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* $Xorg: extnsionst.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/extnsionst.h,v 3.9 2003/07/16 01:38:52 dawes Exp $ */
-
-#ifndef EXTENSIONSTRUCT_H
-#define EXTENSIONSTRUCT_H
-
-#include "misc.h"
-#include "screenint.h"
-#include "extension.h"
-#include "gc.h"
-
-typedef struct _ExtensionEntry {
- int index;
- void (* CloseDown)( /* called at server shutdown */
- struct _ExtensionEntry * /* extension */);
- char *name; /* extension name */
- int base; /* base request number */
- int eventBase;
- int eventLast;
- int errorBase;
- int errorLast;
- int num_aliases;
- char **aliases;
- pointer extPrivate;
- unsigned short (* MinorOpcode)( /* called for errors */
- ClientPtr /* client */);
-#ifdef XCSECURITY
- Bool secure; /* extension visible to untrusted clients? */
-#endif
-} ExtensionEntry;
-
-/*
- * The arguments may be different for extension event swapping functions.
- * Deal with this by casting when initializing the event's EventSwapVector[]
- * entries.
- */
-typedef void (*EventSwapPtr) (xEvent *, xEvent *);
-
-extern EventSwapPtr EventSwapVector[128];
-
-extern void NotImplemented ( /* FIXME: this may move to another file... */
- xEvent *,
- xEvent *);
-
-typedef void (* ExtensionLookupProc)(
-#ifdef EXTENSION_PROC_ARGS
- EXTENSION_PROC_ARGS
-#else
- /* args no longer indeterminate */
- char *name,
- GCPtr pGC
-#endif
-);
-
-typedef struct _ProcEntry {
- char *name;
- ExtensionLookupProc proc;
-} ProcEntryRec, *ProcEntryPtr;
-
-typedef struct _ScreenProcEntry {
- int num;
- ProcEntryPtr procList;
-} ScreenProcEntry;
-
-#define SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom) \
- pGC->VectorElement = NewRoutineAddress;
-
-#define GetGCValue(pGC, GCElement) (pGC->GCElement)
-
-
-extern ExtensionEntry *AddExtension(
- char* /*name*/,
- int /*NumEvents*/,
- int /*NumErrors*/,
- int (* /*MainProc*/)(ClientPtr /*client*/),
- int (* /*SwappedMainProc*/)(ClientPtr /*client*/),
- void (* /*CloseDownProc*/)(ExtensionEntry * /*extension*/),
- unsigned short (* /*MinorOpcodeProc*/)(ClientPtr /*client*/)
-);
-
-extern Bool AddExtensionAlias(
- char* /*alias*/,
- ExtensionEntry * /*extension*/);
-
-extern ExtensionEntry *CheckExtension(const char *extname);
-
-extern ExtensionLookupProc LookupProc(
- char* /*name*/,
- GCPtr /*pGC*/);
-
-extern Bool RegisterProc(
- char* /*name*/,
- GCPtr /*pGC*/,
- ExtensionLookupProc /*proc*/);
-
-extern Bool RegisterScreenProc(
- char* /*name*/,
- ScreenPtr /*pScreen*/,
- ExtensionLookupProc /*proc*/);
-
-extern void DeclareExtensionSecurity(
- char * /*extname*/,
- Bool /*secure*/);
-
-#endif /* EXTENSIONSTRUCT_H */
-
diff --git a/include/gc.h b/include/gc.h
deleted file mode 100644
index a886d77b8..000000000
--- a/include/gc.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/gc.h,v 1.6 2003/04/27 21:31:04 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: gc.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-
-#ifndef GC_H
-#define GC_H
-
-#include "X11/X.h" /* for GContext, Mask */
-#include "Xdefs.h" /* for Bool */
-#include "X11/Xproto.h"
-#include "screenint.h" /* for ScreenPtr */
-#include "pixmap.h" /* for DrawablePtr */
-
-/* clientClipType field in GC */
-#define CT_NONE 0
-#define CT_PIXMAP 1
-#define CT_REGION 2
-#define CT_UNSORTED 6
-#define CT_YSORTED 10
-#define CT_YXSORTED 14
-#define CT_YXBANDED 18
-
-#define GCQREASON_VALIDATE 1
-#define GCQREASON_CHANGE 2
-#define GCQREASON_COPY_SRC 3
-#define GCQREASON_COPY_DST 4
-#define GCQREASON_DESTROY 5
-
-#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
-#define GC_CALL_VALIDATE_BIT (1L<<30)
-#define GCExtensionInterest (1L<<29)
-
-#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
-
-#define MAX_SERIAL_NUM (1L<<28)
-
-#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
- (globalSerialNumber = 1): globalSerialNumber)
-
-typedef struct _GCInterest *GCInterestPtr;
-typedef struct _GC *GCPtr;
-typedef struct _GCOps *GCOpsPtr;
-
-extern void ValidateGC(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/);
-
-extern int ChangeGC(
- GCPtr/*pGC*/,
- BITS32 /*mask*/,
- XID* /*pval*/);
-
-extern int DoChangeGC(
- GCPtr/*pGC*/,
- BITS32 /*mask*/,
- XID* /*pval*/,
- int /*fPointer*/);
-
-typedef union {
- CARD32 val;
- pointer ptr;
-} ChangeGCVal, *ChangeGCValPtr;
-
-extern int dixChangeGC(
- ClientPtr /*client*/,
- GCPtr /*pGC*/,
- BITS32 /*mask*/,
- CARD32 * /*pval*/,
- ChangeGCValPtr /*pCGCV*/);
-
-extern GCPtr CreateGC(
- DrawablePtr /*pDrawable*/,
- BITS32 /*mask*/,
- XID* /*pval*/,
- int* /*pStatus*/);
-
-extern int CopyGC(
- GCPtr/*pgcSrc*/,
- GCPtr/*pgcDst*/,
- BITS32 /*mask*/);
-
-extern int FreeGC(
- pointer /*pGC*/,
- XID /*gid*/);
-
-extern void SetGCMask(
- GCPtr /*pGC*/,
- Mask /*selectMask*/,
- Mask /*newDataMask*/);
-
-extern GCPtr CreateScratchGC(
- ScreenPtr /*pScreen*/,
- unsigned /*depth*/);
-
-extern void FreeGCperDepth(
- int /*screenNum*/);
-
-extern Bool CreateGCperDepth(
- int /*screenNum*/);
-
-extern Bool CreateDefaultStipple(
- int /*screenNum*/);
-
-extern void FreeDefaultStipple(
- int /*screenNum*/);
-
-extern int SetDashes(
- GCPtr /*pGC*/,
- unsigned /*offset*/,
- unsigned /*ndash*/,
- unsigned char* /*pdash*/);
-
-extern int VerifyRectOrder(
- int /*nrects*/,
- xRectangle* /*prects*/,
- int /*ordering*/);
-
-extern int SetClipRects(
- GCPtr /*pGC*/,
- int /*xOrigin*/,
- int /*yOrigin*/,
- int /*nrects*/,
- xRectangle* /*prects*/,
- int /*ordering*/);
-
-extern GCPtr GetScratchGC(
- unsigned /*depth*/,
- ScreenPtr /*pScreen*/);
-
-extern void FreeScratchGC(
- GCPtr /*pGC*/);
-
-#endif /* GC_H */
diff --git a/include/gcstruct.h b/include/gcstruct.h
deleted file mode 100644
index 43cc679b4..000000000
--- a/include/gcstruct.h
+++ /dev/null
@@ -1,328 +0,0 @@
-/* $Xorg: gcstruct.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-
-/* $XFree86: xc/programs/Xserver/include/gcstruct.h,v 1.8 2003/07/16 01:38:52 dawes Exp $ */
-
-#ifndef GCSTRUCT_H
-#define GCSTRUCT_H
-
-#include "gc.h"
-
-#include "regionstr.h"
-#include "region.h"
-#include "pixmap.h"
-#include "screenint.h"
-#include "Xprotostr.h"
-
-/*
- * functions which modify the state of the GC
- */
-
-typedef struct _GCFuncs {
- void (* ValidateGC)(
- GCPtr /*pGC*/,
- unsigned long /*stateChanges*/,
- DrawablePtr /*pDrawable*/);
-
- void (* ChangeGC)(
- GCPtr /*pGC*/,
- unsigned long /*mask*/);
-
- void (* CopyGC)(
- GCPtr /*pGCSrc*/,
- unsigned long /*mask*/,
- GCPtr /*pGCDst*/);
-
- void (* DestroyGC)(
- GCPtr /*pGC*/);
-
- void (* ChangeClip)(
- GCPtr /*pGC*/,
- int /*type*/,
- pointer /*pvalue*/,
- int /*nrects*/);
-
- void (* DestroyClip)(
- GCPtr /*pGC*/);
-
- void (* CopyClip)(
- GCPtr /*pgcDst*/,
- GCPtr /*pgcSrc*/);
- DevUnion devPrivate;
-} GCFuncs;
-
-/*
- * graphics operations invoked through a GC
- */
-
-typedef struct _GCOps {
- void (* FillSpans)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/);
-
- void (* SetSpans)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/);
-
- void (* PutImage)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pBits*/);
-
- RegionPtr (* CopyArea)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*w*/,
- int /*h*/,
- int /*dstx*/,
- int /*dsty*/);
-
- RegionPtr (* CopyPlane)(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*bitPlane*/);
- void (* PolyPoint)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/);
-
- void (* Polylines)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/);
-
- void (* PolySegment)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegs*/);
-
- void (* PolyRectangle)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrects*/,
- xRectangle * /*pRects*/);
-
- void (* PolyArc)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/);
-
- void (* FillPolygon)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*pPts*/);
-
- void (* PolyFillRect)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/);
-
- void (* PolyFillArc)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/);
-
- int (* PolyText8)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/);
-
- int (* PolyText16)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- unsigned short * /*chars*/);
-
- void (* ImageText8)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/);
-
- void (* ImageText16)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- unsigned short * /*chars*/);
-
- void (* ImageGlyphBlt)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/);
-
- void (* PolyGlyphBlt)(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/);
-
- void (* PushPixels)(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDst*/,
- int /*w*/,
- int /*h*/,
- int /*x*/,
- int /*y*/);
-
-#ifdef NEED_LINEHELPER
- void (* LineHelper)();
-#endif
-
- DevUnion devPrivate;
-} GCOps;
-
-/* there is padding in the bit fields because the Sun compiler doesn't
- * force alignment to 32-bit boundaries. losers.
- */
-typedef struct _GC {
- ScreenPtr pScreen;
- unsigned char depth;
- unsigned char alu;
- unsigned short lineWidth;
- unsigned short dashOffset;
- unsigned short numInDashList;
- unsigned char *dash;
- unsigned int lineStyle : 2;
- unsigned int capStyle : 2;
- unsigned int joinStyle : 2;
- unsigned int fillStyle : 2;
- unsigned int fillRule : 1;
- unsigned int arcMode : 1;
- unsigned int subWindowMode : 1;
- unsigned int graphicsExposures : 1;
- unsigned int clientClipType : 2; /* CT_<kind> */
- unsigned int miTranslate:1; /* should mi things translate? */
- unsigned int tileIsPixel:1; /* tile is solid pixel */
- unsigned int fExpose:1; /* Call exposure handling */
- unsigned int freeCompClip:1; /* Free composite clip */
- unsigned int unused:14; /* see comment above */
- unsigned long planemask;
- unsigned long fgPixel;
- unsigned long bgPixel;
- /*
- * alas -- both tile and stipple must be here as they
- * are independently specifiable
- */
- PixUnion tile;
- PixmapPtr stipple;
- DDXPointRec patOrg; /* origin for (tile, stipple) */
- struct _Font *font;
- DDXPointRec clipOrg;
- DDXPointRec lastWinOrg; /* position of window last validated */
- pointer clientClip;
- unsigned long stateChanges; /* masked with GC_<kind> */
- unsigned long serialNumber;
- GCFuncs *funcs;
- GCOps *ops;
- DevUnion *devPrivates;
- /*
- * The following were moved here from private storage to allow device-
- * independent access to them from screen wrappers.
- * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org)
- */
- PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */
- RegionPtr pCompositeClip;
- /* fExpose & freeCompClip defined above */
-} GC;
-
-#endif /* GCSTRUCT_H */
diff --git a/include/globals.h b/include/globals.h
deleted file mode 100644
index 3b1b6ba0b..000000000
--- a/include/globals.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/globals.h,v 1.4 2000/06/28 18:21:22 tsi Exp $ */
-
-#ifndef _XSERV_GLOBAL_H_
-#define _XSERV_GLOBAL_H_
-
-#include "window.h" /* for WindowPtr */
-
-/* Global X server variables that are visible to mi, dix, os, and ddx */
-
-extern CARD32 defaultScreenSaverTime;
-extern CARD32 defaultScreenSaverInterval;
-extern CARD32 ScreenSaverTime;
-extern CARD32 ScreenSaverInterval;
-
-extern char *defaultFontPath;
-extern char *rgbPath;
-extern int monitorResolution;
-extern Bool loadableFonts;
-extern int defaultColorVisualClass;
-
-extern Bool Must_have_memory;
-extern WindowPtr *WindowTable;
-extern int GrabInProgress;
-extern Bool noTestExtensions;
-
-extern DDXPointRec dixScreenOrigins[MAXSCREENS];
-
-#ifdef DPMSExtension
-extern CARD32 defaultDPMSStandbyTime;
-extern CARD32 defaultDPMSSuspendTime;
-extern CARD32 defaultDPMSOffTime;
-extern CARD32 DPMSStandbyTime;
-extern CARD32 DPMSSuspendTime;
-extern CARD32 DPMSOffTime;
-extern CARD16 DPMSPowerLevel;
-extern Bool defaultDPMSEnabled;
-extern Bool DPMSEnabled;
-extern Bool DPMSEnabledSwitch;
-extern Bool DPMSDisabledSwitch;
-extern Bool DPMSCapableFlag;
-#endif
-
-#ifdef PANORAMIX
-extern Bool noPanoramiXExtension;
-extern Bool PanoramiXMapped;
-extern Bool PanoramiXVisibilityNotifySent;
-extern Bool PanoramiXWindowExposureSent;
-extern Bool PanoramiXOneExposeRequest;
-#endif
-
-
-#endif /* _XSERV_GLOBAL_H_ */
diff --git a/include/input.h b/include/input.h
deleted file mode 100644
index acf3bca1a..000000000
--- a/include/input.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/* $Xorg: input.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/include/input.h,v 3.8 2003/04/27 21:31:04 herrb Exp $ */
-
-#ifndef INPUT_H
-#define INPUT_H
-
-#include "misc.h"
-#include "screenint.h"
-#include "X11/Xmd.h"
-#include "X11/Xproto.h"
-#include "window.h" /* for WindowPtr */
-
-#define DEVICE_INIT 0
-#define DEVICE_ON 1
-#define DEVICE_OFF 2
-#define DEVICE_CLOSE 3
-
-#define MAP_LENGTH 256
-#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
-#define NullGrab ((GrabPtr)NULL)
-#define PointerRootWin ((WindowPtr)PointerRoot)
-#define NoneWin ((WindowPtr)None)
-#define NullDevice ((DevicePtr)NULL)
-
-#ifndef FollowKeyboard
-#define FollowKeyboard 3
-#endif
-#ifndef FollowKeyboardWin
-#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
-#endif
-#ifndef RevertToFollowKeyboard
-#define RevertToFollowKeyboard 3
-#endif
-
-typedef unsigned long Leds;
-typedef struct _OtherClients *OtherClientsPtr;
-typedef struct _InputClients *InputClientsPtr;
-typedef struct _DeviceIntRec *DeviceIntPtr;
-
-typedef int (*DeviceProc)(
- DeviceIntPtr /*device*/,
- int /*what*/);
-
-typedef void (*ProcessInputProc)(
- xEventPtr /*events*/,
- DeviceIntPtr /*device*/,
- int /*count*/);
-
-typedef struct _DeviceRec {
- pointer devicePrivate;
- ProcessInputProc processInputProc; /* current */
- ProcessInputProc realInputProc; /* deliver */
- ProcessInputProc enqueueInputProc; /* enqueue */
- Bool on; /* used by DDX to keep state */
-} DeviceRec, *DevicePtr;
-
-typedef struct {
- int click, bell, bell_pitch, bell_duration;
- Bool autoRepeat;
- unsigned char autoRepeats[32];
- Leds leds;
- unsigned char id;
-} KeybdCtrl;
-
-typedef struct {
- KeySym *map;
- KeyCode minKeyCode,
- maxKeyCode;
- int mapWidth;
-} KeySymsRec, *KeySymsPtr;
-
-typedef struct {
- int num, den, threshold;
- unsigned char id;
-} PtrCtrl;
-
-typedef struct {
- int resolution, min_value, max_value;
- int integer_displayed;
- unsigned char id;
-} IntegerCtrl;
-
-typedef struct {
- int max_symbols, num_symbols_supported;
- int num_symbols_displayed;
- KeySym *symbols_supported;
- KeySym *symbols_displayed;
- unsigned char id;
-} StringCtrl;
-
-typedef struct {
- int percent, pitch, duration;
- unsigned char id;
-} BellCtrl;
-
-typedef struct {
- Leds led_values;
- Mask led_mask;
- unsigned char id;
-} LedCtrl;
-
-extern KeybdCtrl defaultKeyboardControl;
-extern PtrCtrl defaultPointerControl;
-
-#undef AddInputDevice
-extern DevicePtr AddInputDevice(
- DeviceProc /*deviceProc*/,
- Bool /*autoStart*/);
-
-#define AddInputDevice(deviceProc, autoStart) \
- _AddInputDevice(deviceProc, autoStart)
-
-extern DeviceIntPtr _AddInputDevice(
- DeviceProc /*deviceProc*/,
- Bool /*autoStart*/);
-
-extern Bool EnableDevice(
- DeviceIntPtr /*device*/);
-
-extern Bool DisableDevice(
- DeviceIntPtr /*device*/);
-
-extern int InitAndStartDevices(void);
-
-extern void CloseDownDevices(void);
-
-extern void RemoveDevice(
- DeviceIntPtr /*dev*/);
-
-extern int NumMotionEvents(void);
-
-#undef RegisterPointerDevice
-extern void RegisterPointerDevice(
- DevicePtr /*device*/);
-
-#define RegisterPointerDevice(device) \
- _RegisterPointerDevice(device)
-
-extern void _RegisterPointerDevice(
- DeviceIntPtr /*device*/);
-
-#undef RegisterKeyboardDevice
-extern void RegisterKeyboardDevice(
- DevicePtr /*device*/);
-
-#define RegisterKeyboardDevice(device) \
- _RegisterKeyboardDevice(device)
-
-extern void _RegisterKeyboardDevice(
- DeviceIntPtr /*device*/);
-
-extern DevicePtr LookupKeyboardDevice(void);
-
-extern DevicePtr LookupPointerDevice(void);
-
-extern DevicePtr LookupDevice(
- int /* id */);
-
-extern void QueryMinMaxKeyCodes(
- KeyCode* /*minCode*/,
- KeyCode* /*maxCode*/);
-
-extern Bool SetKeySymsMap(
- KeySymsPtr /*dst*/,
- KeySymsPtr /*src*/);
-
-extern Bool InitKeyClassDeviceStruct(
- DeviceIntPtr /*device*/,
- KeySymsPtr /*pKeySyms*/,
- CARD8 /*pModifiers*/[]);
-
-extern Bool InitButtonClassDeviceStruct(
- DeviceIntPtr /*device*/,
- int /*numButtons*/,
- CARD8* /*map*/);
-
-typedef int (*ValuatorMotionProcPtr)(
- DeviceIntPtr /*pdevice*/,
- xTimecoord * /*coords*/,
- unsigned long /*start*/,
- unsigned long /*stop*/,
- ScreenPtr /*pScreen*/);
-
-extern Bool InitValuatorClassDeviceStruct(
- DeviceIntPtr /*device*/,
- int /*numAxes*/,
- ValuatorMotionProcPtr /* motionProc */,
- int /*numMotionEvents*/,
- int /*mode*/);
-
-extern Bool InitFocusClassDeviceStruct(
- DeviceIntPtr /*device*/);
-
-typedef void (*BellProcPtr)(
- int /*percent*/,
- DeviceIntPtr /*device*/,
- pointer /*ctrl*/,
- int);
-
-typedef void (*KbdCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- KeybdCtrl * /*ctrl*/);
-
-extern Bool InitKbdFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- BellProcPtr /*bellProc*/,
- KbdCtrlProcPtr /*controlProc*/);
-
-typedef void (*PtrCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- PtrCtrl * /*ctrl*/);
-
-extern Bool InitPtrFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- PtrCtrlProcPtr /*controlProc*/);
-
-typedef void (*StringCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- StringCtrl * /*ctrl*/);
-
-extern Bool InitStringFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- StringCtrlProcPtr /*controlProc*/,
- int /*max_symbols*/,
- int /*num_symbols_supported*/,
- KeySym* /*symbols*/);
-
-typedef void (*BellCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- BellCtrl * /*ctrl*/);
-
-extern Bool InitBellFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- BellProcPtr /*bellProc*/,
- BellCtrlProcPtr /*controlProc*/);
-
-typedef void (*LedCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- LedCtrl * /*ctrl*/);
-
-extern Bool InitLedFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- LedCtrlProcPtr /*controlProc*/);
-
-typedef void (*IntegerCtrlProcPtr)(
- DeviceIntPtr /*device*/,
- IntegerCtrl * /*ctrl*/);
-
-
-extern Bool InitIntegerFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- IntegerCtrlProcPtr /*controlProc*/);
-
-extern Bool InitPointerDeviceStruct(
- DevicePtr /*device*/,
- CARD8* /*map*/,
- int /*numButtons*/,
- ValuatorMotionProcPtr /*motionProc*/,
- PtrCtrlProcPtr /*controlProc*/,
- int /*numMotionEvents*/);
-
-extern Bool InitKeyboardDeviceStruct(
- DevicePtr /*device*/,
- KeySymsPtr /*pKeySyms*/,
- CARD8 /*pModifiers*/[],
- BellProcPtr /*bellProc*/,
- KbdCtrlProcPtr /*controlProc*/);
-
-extern void SendMappingNotify(
- unsigned int /*request*/,
- unsigned int /*firstKeyCode*/,
- unsigned int /*count*/,
- ClientPtr /* client */);
-
-extern Bool BadDeviceMap(
- BYTE* /*buff*/,
- int /*length*/,
- unsigned /*low*/,
- unsigned /*high*/,
- XID* /*errval*/);
-
-extern Bool AllModifierKeysAreUp(
- DeviceIntPtr /*device*/,
- CARD8* /*map1*/,
- int /*per1*/,
- CARD8* /*map2*/,
- int /*per2*/);
-
-extern void NoteLedState(
- DeviceIntPtr /*keybd*/,
- int /*led*/,
- Bool /*on*/);
-
-extern void MaybeStopHint(
- DeviceIntPtr /*device*/,
- ClientPtr /*client*/);
-
-extern void ProcessPointerEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*mouse*/,
- int /*count*/);
-
-extern void ProcessKeyboardEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*keybd*/,
- int /*count*/);
-
-#ifdef XKB
-extern void CoreProcessPointerEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*mouse*/,
- int /*count*/);
-
-extern void CoreProcessKeyboardEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*keybd*/,
- int /*count*/);
-#endif
-
-extern Bool LegalModifier(
- unsigned int /*key*/,
- DevicePtr /*pDev*/);
-
-extern void ProcessInputEvents(void);
-
-extern void InitInput(
- int /*argc*/,
- char ** /*argv*/);
-
-#endif /* INPUT_H */
diff --git a/include/inputstr.h b/include/inputstr.h
deleted file mode 100644
index a8a834807..000000000
--- a/include/inputstr.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/inputstr.h,v 1.6 2003/04/27 21:31:04 herrb Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/* $Xorg: inputstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-
-#ifndef INPUTSTRUCT_H
-#define INPUTSTRUCT_H
-
-#include "input.h"
-#include "window.h"
-#include "dixstruct.h"
-
-#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
-
-#define SameClient(obj,client) \
- (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
-
-#define MAX_DEVICES 20
-
-#define EMASKSIZE MAX_DEVICES
-
-/* Kludge: OtherClients and InputClients must be compatible, see code */
-
-typedef struct _OtherClients {
- OtherClientsPtr next;
- XID resource; /* id for putting into resource manager */
- Mask mask;
-} OtherClients;
-
-typedef struct _InputClients {
- InputClientsPtr next;
- XID resource; /* id for putting into resource manager */
- Mask mask[EMASKSIZE];
-} InputClients;
-
-typedef struct _OtherInputMasks {
- Mask deliverableEvents[EMASKSIZE];
- Mask inputEvents[EMASKSIZE];
- Mask dontPropagateMask[EMASKSIZE];
- InputClientsPtr inputClients;
-} OtherInputMasks;
-
-/*
- * The following structure gets used for both active and passive grabs. For
- * active grabs some of the fields (e.g. modifiers) are not used. However,
- * that is not much waste since there aren't many active grabs (one per
- * keyboard/pointer device) going at once in the server.
- */
-
-#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
- modifier combinations, but only
- 3 buttons. */
-
- typedef struct _DetailRec { /* Grab details may be bit masks */
- unsigned short exact;
- Mask *pMask;
- } DetailRec;
-
- typedef struct _GrabRec {
- GrabPtr next; /* for chain of passive grabs */
- XID resource;
- DeviceIntPtr device;
- WindowPtr window;
- unsigned ownerEvents:1;
- unsigned keyboardMode:1;
- unsigned pointerMode:1;
- unsigned coreGrab:1; /* grab is on core device */
- unsigned coreMods:1; /* modifiers are on core keyboard */
- CARD8 type; /* event type */
- DetailRec modifiersDetail;
- DeviceIntPtr modifierDevice;
- DetailRec detail; /* key or button */
- WindowPtr confineTo; /* always NULL for keyboards */
- CursorPtr cursor; /* always NULL for keyboards */
- Mask eventMask;
-} GrabRec;
-
-typedef struct _KeyClassRec {
- CARD8 down[DOWN_LENGTH];
- KeyCode *modifierKeyMap;
- KeySymsRec curKeySyms;
- int modifierKeyCount[8];
- CARD8 modifierMap[MAP_LENGTH];
- CARD8 maxKeysPerModifier;
- unsigned short state;
- unsigned short prev_state;
-#ifdef XKB
- struct _XkbSrvInfo *xkbInfo;
-#endif
-} KeyClassRec, *KeyClassPtr;
-
-typedef struct _AxisInfo {
- int resolution;
- int min_resolution;
- int max_resolution;
- int min_value;
- int max_value;
-} AxisInfo, *AxisInfoPtr;
-
-typedef struct _ValuatorClassRec {
- ValuatorMotionProcPtr GetMotionProc;
- int numMotionEvents;
- WindowPtr motionHintWindow;
- AxisInfoPtr axes;
- unsigned short numAxes;
- int *axisVal;
- CARD8 mode;
-} ValuatorClassRec, *ValuatorClassPtr;
-
-typedef struct _ButtonClassRec {
- CARD8 numButtons;
- CARD8 buttonsDown; /* number of buttons currently down */
- unsigned short state;
- Mask motionMask;
- CARD8 down[DOWN_LENGTH];
- CARD8 map[MAP_LENGTH];
-#ifdef XKB
- union _XkbAction * xkb_acts;
-#endif
-} ButtonClassRec, *ButtonClassPtr;
-
-typedef struct _FocusClassRec {
- WindowPtr win;
- int revert;
- TimeStamp time;
- WindowPtr *trace;
- int traceSize;
- int traceGood;
-} FocusClassRec, *FocusClassPtr;
-
-typedef struct _ProximityClassRec {
- char pad;
-} ProximityClassRec, *ProximityClassPtr;
-
-typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
-typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
-typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
-typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
-typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
-typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
-
-typedef struct _KbdFeedbackClassRec {
- BellProcPtr BellProc;
- KbdCtrlProcPtr CtrlProc;
- KeybdCtrl ctrl;
- KbdFeedbackPtr next;
-#ifdef XKB
- struct _XkbSrvLedInfo *xkb_sli;
-#endif
-} KbdFeedbackClassRec;
-
-typedef struct _PtrFeedbackClassRec {
- PtrCtrlProcPtr CtrlProc;
- PtrCtrl ctrl;
- PtrFeedbackPtr next;
-} PtrFeedbackClassRec;
-
-typedef struct _IntegerFeedbackClassRec {
- IntegerCtrlProcPtr CtrlProc;
- IntegerCtrl ctrl;
- IntegerFeedbackPtr next;
-} IntegerFeedbackClassRec;
-
-typedef struct _StringFeedbackClassRec {
- StringCtrlProcPtr CtrlProc;
- StringCtrl ctrl;
- StringFeedbackPtr next;
-} StringFeedbackClassRec;
-
-typedef struct _BellFeedbackClassRec {
- BellProcPtr BellProc;
- BellCtrlProcPtr CtrlProc;
- BellCtrl ctrl;
- BellFeedbackPtr next;
-} BellFeedbackClassRec;
-
-typedef struct _LedFeedbackClassRec {
- LedCtrlProcPtr CtrlProc;
- LedCtrl ctrl;
- LedFeedbackPtr next;
-#ifdef XKB
- struct _XkbSrvLedInfo *xkb_sli;
-#endif
-} LedFeedbackClassRec;
-
-/* states for devices */
-
-#define NOT_GRABBED 0
-#define THAWED 1
-#define THAWED_BOTH 2 /* not a real state */
-#define FREEZE_NEXT_EVENT 3
-#define FREEZE_BOTH_NEXT_EVENT 4
-#define FROZEN 5 /* any state >= has device frozen */
-#define FROZEN_NO_EVENT 5
-#define FROZEN_WITH_EVENT 6
-#define THAW_OTHERS 7
-
-typedef struct _DeviceIntRec {
- DeviceRec public;
- DeviceIntPtr next;
- TimeStamp grabTime;
- Bool startup; /* true if needs to be turned on at
- server intialization time */
- DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
- used to initialize, turn on, or
- turn off the device */
- Bool inited; /* TRUE if INIT returns Success */
- GrabPtr grab; /* the grabber - used by DIX */
- struct {
- Bool frozen;
- int state;
- GrabPtr other; /* if other grab has this frozen */
- xEvent *event; /* saved to be replayed */
- int evcount;
- } sync;
- Atom type;
- char *name;
- CARD8 id;
- CARD8 activatingKey;
- Bool fromPassiveGrab;
- GrabRec activeGrab;
- void (*ActivateGrab) (
- DeviceIntPtr /*device*/,
- GrabPtr /*grab*/,
- TimeStamp /*time*/,
- Bool /*autoGrab*/);
- void (*DeactivateGrab)(
- DeviceIntPtr /*device*/);
- KeyClassPtr key;
- ValuatorClassPtr valuator;
- ButtonClassPtr button;
- FocusClassPtr focus;
- ProximityClassPtr proximity;
- KbdFeedbackPtr kbdfeed;
- PtrFeedbackPtr ptrfeed;
- IntegerFeedbackPtr intfeed;
- StringFeedbackPtr stringfeed;
- BellFeedbackPtr bell;
- LedFeedbackPtr leds;
-#ifdef XKB
- struct _XkbInterest * xkb_interest;
-#endif
-} DeviceIntRec;
-
-typedef struct {
- int numDevices; /* total number of devices */
- DeviceIntPtr devices; /* all devices turned on */
- DeviceIntPtr off_devices; /* all devices turned off */
- DeviceIntPtr keyboard; /* the main one for the server */
- DeviceIntPtr pointer;
-} InputInfo;
-
-extern InputInfo inputInfo;
-
-/* for keeping the events for devices grabbed synchronously */
-typedef struct _QdEvent *QdEventPtr;
-typedef struct _QdEvent {
- QdEventPtr next;
- DeviceIntPtr device;
- ScreenPtr pScreen; /* what screen the pointer was on */
- unsigned long months; /* milliseconds is in the event */
- xEvent *event;
- int evcount;
-} QdEventRec;
-
-#endif /* INPUTSTRUCT_H */
diff --git a/include/misc.h b/include/misc.h
deleted file mode 100644
index ffa65b31e..000000000
--- a/include/misc.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.29 2003/04/27 21:31:04 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-Copyright 1992, 1993 Data General Corporation;
-Copyright 1992, 1993 OMRON Corporation
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that the
-above copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting documentation, and that
-neither the name OMRON or DATA GENERAL be used in advertising or publicity
-pertaining to distribution of the software without specific, written prior
-permission of the party whose name is to be used. Neither OMRON or
-DATA GENERAL make any representation about the suitability of this software
-for any purpose. It is provided "as is" without express or implied warranty.
-
-OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
-IN NO EVENT SHALL OMRON OR DATA GENERAL BE LIABLE FOR ANY SPECIAL, INDIRECT
-OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-OF THIS SOFTWARE.
-
-******************************************************************/
-/* $Xorg: misc.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */
-#ifndef MISC_H
-#define MISC_H 1
-/*
- * X internal definitions
- *
- */
-
-extern unsigned long globalSerialNumber;
-extern unsigned long serverGeneration;
-
-#include <X11/Xosdefs.h>
-#include <X11/Xfuncproto.h>
-#include <X11/Xmd.h>
-#include <X11/X.h>
-#include <X11/Xdefs.h>
-
-#ifndef IN_MODULE
-#ifndef NULL
-#include <stddef.h>
-#endif
-#endif
-
-#ifndef MAXSCREENS
-#define MAXSCREENS 16
-#endif
-#define MAXCLIENTS 256
-#define MAXDITS 1
-#define MAXEXTENSIONS 128
-#define MAXFORMATS 8
-#define MAXVISUALS_PER_SCREEN 50
-
-typedef unsigned long PIXEL;
-typedef unsigned long ATOM;
-
-
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#ifndef _XTYPEDEF_CALLBACKLISTPTR
-typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
-#define _XTYPEDEF_CALLBACKLISTPTR
-#endif
-
-typedef struct _xReq *xReqPtr;
-
-#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
-#ifndef IN_MODULE
-#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
-#endif
-
-#define NullBox ((BoxPtr)0)
-#define MILLI_PER_MIN (1000 * 60)
-#define MILLI_PER_SECOND (1000)
-
- /* this next is used with None and ParentRelative to tell
- PaintWin() what to use to paint the background. Also used
- in the macro IS_VALID_PIXMAP */
-
-#define USE_BACKGROUND_PIXEL 3
-#define USE_BORDER_PIXEL 3
-
-
-/* byte swap a 32-bit literal */
-#define lswapl(x) ((((x) & 0xff) << 24) |\
- (((x) & 0xff00) << 8) |\
- (((x) & 0xff0000) >> 8) |\
- (((x) >> 24) & 0xff))
-
-/* byte swap a short literal */
-#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
-
-#undef min
-#undef max
-
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-#ifndef IN_MODULE
-/* abs() is a function, not a macro; include the file declaring
- * it in case we haven't done that yet.
- */
-#include <stdlib.h>
-#endif /* IN_MODULE */
-#ifndef Fabs
-#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
-#endif
-#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
-/* this assumes b > 0 */
-#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
-/*
- * return the least significant bit in x which is set
- *
- * This works on 1's complement and 2's complement machines.
- * If you care about the extra instruction on 2's complement
- * machines, change to ((x) & (-(x)))
- */
-#define lowbit(x) ((x) & (~(x) + 1))
-
-#ifndef IN_MODULE
-/* XXX Not for modules */
-#include <limits.h>
-#if !defined(MAXSHORT) || !defined(MINSHORT) || \
- !defined(MAXINT) || !defined(MININT)
-/*
- * Some implementations #define these through <math.h>, so preclude
- * #include'ing it later.
- */
-
-#include <math.h>
-#endif
-#undef MAXSHORT
-#define MAXSHORT SHRT_MAX
-#undef MINSHORT
-#define MINSHORT SHRT_MIN
-#undef MAXINT
-#define MAXINT INT_MAX
-#undef MININT
-#define MININT INT_MIN
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h> /* for fopen, etc... */
-
-#endif
-
-/* some macros to help swap requests, replies, and events */
-
-#define LengthRestB(stuff) \
- ((client->req_len << 2) - sizeof(*stuff))
-
-#define LengthRestS(stuff) \
- ((client->req_len << 1) - (sizeof(*stuff) >> 1))
-
-#define LengthRestL(stuff) \
- (client->req_len - (sizeof(*stuff) >> 2))
-
-#define SwapRestS(stuff) \
- SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
-
-#define SwapRestL(stuff) \
- SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
-
-/* byte swap a 32-bit value */
-#define swapl(x, n) { \
- n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[3];\
- ((char *) (x))[3] = n;\
- n = ((char *) (x))[1];\
- ((char *) (x))[1] = ((char *) (x))[2];\
- ((char *) (x))[2] = n; }
-
-/* byte swap a short */
-#define swaps(x, n) { \
- n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[1];\
- ((char *) (x))[1] = n; }
-
-/* copy 32-bit value from src to dst byteswapping on the way */
-#define cpswapl(src, dst) { \
- ((char *)&(dst))[0] = ((char *) &(src))[3];\
- ((char *)&(dst))[1] = ((char *) &(src))[2];\
- ((char *)&(dst))[2] = ((char *) &(src))[1];\
- ((char *)&(dst))[3] = ((char *) &(src))[0]; }
-
-/* copy short from src to dst byteswapping on the way */
-#define cpswaps(src, dst) { \
- ((char *) &(dst))[0] = ((char *) &(src))[1];\
- ((char *) &(dst))[1] = ((char *) &(src))[0]; }
-
-extern void SwapLongs(
- CARD32 *list,
- unsigned long count);
-
-extern void SwapShorts(
- short *list,
- unsigned long count);
-
-extern void MakePredeclaredAtoms(void);
-
-extern int Ones(
- unsigned long /*mask*/);
-
-typedef struct _xPoint *DDXPointPtr;
-typedef struct _Box *BoxPtr;
-typedef struct _xEvent *xEventPtr;
-typedef struct _xRectangle *xRectanglePtr;
-typedef struct _GrabRec *GrabPtr;
-
-/* typedefs from other places - duplicated here to minimize the amount
- * of unnecessary junk that one would normally have to include to get
- * these symbols defined
- */
-
-#ifndef _XTYPEDEF_CHARINFOPTR
-typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
-#define _XTYPEDEF_CHARINFOPTR
-#endif
-
-#endif /* MISC_H */
diff --git a/include/miscstruct.h b/include/miscstruct.h
deleted file mode 100644
index 86f114792..000000000
--- a/include/miscstruct.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $Xorg: miscstruct.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.5 2003/07/16 01:38:52 dawes Exp $ */
-
-#ifndef MISCSTRUCT_H
-#define MISCSTRUCT_H 1
-
-#include "misc.h"
-#include "X11/Xprotostr.h"
-#include "gc.h"
-
-typedef xPoint DDXPointRec;
-
-typedef struct _Box {
- short x1, y1, x2, y2;
-} BoxRec;
-
-typedef union _DevUnion {
- pointer ptr;
- long val;
- unsigned long uval;
- RegionPtr (*fptr)(
- DrawablePtr /* pSrcDrawable */,
- DrawablePtr /* pDstDrawable */,
- GCPtr /* pGC */,
- int /* srcx */,
- int /* srcy */,
- int /* width */,
- int /* height */,
- int /* dstx */,
- int /* dsty */,
- unsigned long /* bitPlane */);
-} DevUnion;
-
-#endif /* MISCSTRUCT_H */
diff --git a/include/opaque.h b/include/opaque.h
deleted file mode 100644
index b5a55a60b..000000000
--- a/include/opaque.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $Xorg: opaque.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.14 2003/09/09 03:20:41 dawes Exp $ */
-
-#ifndef OPAQUE_H
-#define OPAQUE_H
-
-#include <X11/Xmd.h>
-
-#include "globals.h"
-
-extern char *defaultTextFont;
-extern char *defaultCursorFont;
-extern int MaxClients;
-extern char isItTimeToYield;
-extern char dispatchException;
-
-/* bit values for dispatchException */
-#define DE_RESET 1
-#define DE_TERMINATE 2
-#define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */
-
-extern CARD32 TimeOutValue;
-extern int ScreenSaverBlanking;
-extern int ScreenSaverAllowExposures;
-extern int defaultScreenSaverBlanking;
-extern int defaultScreenSaverAllowExposures;
-extern int argcGlobal;
-extern char **argvGlobal;
-extern char *display;
-
-extern int defaultBackingStore;
-extern Bool disableBackingStore;
-extern Bool enableBackingStore;
-extern Bool disableSaveUnders;
-extern Bool PartialNetwork;
-#ifndef NOLOGOHACK
-extern int logoScreenSaver;
-#endif
-#ifdef RLIMIT_DATA
-extern int limitDataSpace;
-#endif
-#ifdef RLIMIT_STACK
-extern int limitStackSpace;
-#endif
-#ifdef RLIMIT_NOFILE
-extern int limitNoFile;
-#endif
-extern Bool permitOldBugs;
-extern Bool defeatAccessControl;
-extern long maxBigRequestSize;
-extern Bool blackRoot;
-
-extern Bool CoreDump;
-
-
-#endif /* OPAQUE_H */
diff --git a/include/os.h b/include/os.h
deleted file mode 100644
index e9328c8fa..000000000
--- a/include/os.h
+++ /dev/null
@@ -1,548 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/os.h,v 3.54 2003/10/30 21:21:06 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: os.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-
-#ifndef OS_H
-#define OS_H
-
-#include "misc.h"
-#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
-#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))
-#include "Xalloca.h"
-#ifndef IN_MODULE
-#include <stdarg.h>
-#else
-#include "xf86_ansic.h"
-#endif
-
-#define NullFID ((FID) 0)
-
-#define SCREEN_SAVER_ON 0
-#define SCREEN_SAVER_OFF 1
-#define SCREEN_SAVER_FORCER 2
-#define SCREEN_SAVER_CYCLE 3
-
-#ifndef MAX_REQUEST_SIZE
-#define MAX_REQUEST_SIZE 65535
-#endif
-#ifndef MAX_BIG_REQUEST_SIZE
-#define MAX_BIG_REQUEST_SIZE 4194303
-#endif
-
-typedef pointer FID;
-typedef struct _FontPathRec *FontPathPtr;
-typedef struct _NewClientRec *NewClientPtr;
-
-#ifndef xalloc
-#define xnfalloc(size) XNFalloc((unsigned long)(size))
-#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
-#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
-
-#define xalloc(size) Xalloc((unsigned long)(size))
-#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
-#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
-#define xfree(ptr) Xfree((pointer)(ptr))
-#define xstrdup(s) Xstrdup(s)
-#define xnfstrdup(s) XNFstrdup(s)
-#endif
-
-#ifndef IN_MODULE
-#ifdef SCO
-#include <stdio.h>
-#endif
-#include <string.h>
-#endif
-
-/* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
-#ifdef SIGNALRETURNSINT
-#define SIGVAL int
-#else
-#define SIGVAL void
-#endif
-
-extern Bool OsDelayInitColors;
-extern void (*OsVendorVErrorFProc)(const char *, va_list args);
-
-extern int WaitForSomething(
- int* /*pClientsReady*/
-);
-
-#ifdef LBX
-#define ReadRequestFromClient(client) ((client)->readRequest(client))
-extern int StandardReadRequestFromClient(ClientPtr /*client*/);
-
-extern int ClientConnectionNumber(ClientPtr /*client*/);
-#else
-extern int ReadRequestFromClient(ClientPtr /*client*/);
-#endif /* LBX */
-
-extern Bool InsertFakeRequest(
- ClientPtr /*client*/,
- char* /*data*/,
- int /*count*/);
-
-extern void ResetCurrentRequest(ClientPtr /*client*/);
-
-extern void FlushAllOutput(void);
-
-extern void FlushIfCriticalOutputPending(void);
-
-extern void SetCriticalOutputPending(void);
-
-extern int WriteToClient(ClientPtr /*who*/, int /*count*/, char* /*buf*/);
-
-extern void ResetOsBuffers(void);
-
-extern void InitConnectionLimits(void);
-
-extern void CreateWellKnownSockets(void);
-
-extern void ResetWellKnownSockets(void);
-
-extern void CloseWellKnownConnections(void);
-
-extern XID AuthorizationIDOfClient(ClientPtr /*client*/);
-
-extern char *ClientAuthorized(
- ClientPtr /*client*/,
- unsigned int /*proto_n*/,
- char* /*auth_proto*/,
- unsigned int /*string_n*/,
- char* /*auth_string*/);
-
-extern Bool EstablishNewConnections(
- ClientPtr /*clientUnused*/,
- pointer /*closure*/);
-
-extern void CheckConnections(void);
-
-extern void CloseDownConnection(ClientPtr /*client*/);
-
-extern void AddEnabledDevice(int /*fd*/);
-
-extern void RemoveEnabledDevice(int /*fd*/);
-
-extern void OnlyListenToOneClient(ClientPtr /*client*/);
-
-extern void ListenToAllClients(void);
-
-extern void IgnoreClient(ClientPtr /*client*/);
-
-extern void AttendClient(ClientPtr /*client*/);
-
-extern void MakeClientGrabImpervious(ClientPtr /*client*/);
-
-extern void MakeClientGrabPervious(ClientPtr /*client*/);
-
-#ifdef LBX
-extern void CloseDownFileDescriptor(ClientPtr /* client */);
-#endif
-
-extern void AvailableClientInput(ClientPtr /* client */);
-
-extern CARD32 GetTimeInMillis(void);
-
-extern void AdjustWaitForDelay(
- pointer /*waitTime*/,
- unsigned long /*newdelay*/);
-
-typedef struct _OsTimerRec *OsTimerPtr;
-
-typedef CARD32 (*OsTimerCallback)(
- OsTimerPtr /* timer */,
- CARD32 /* time */,
- pointer /* arg */);
-
-extern void TimerInit(void);
-
-extern Bool TimerForce(OsTimerPtr /* timer */);
-
-#define TimerAbsolute (1<<0)
-#define TimerForceOld (1<<1)
-
-extern OsTimerPtr TimerSet(
- OsTimerPtr /* timer */,
- int /* flags */,
- CARD32 /* millis */,
- OsTimerCallback /* func */,
- pointer /* arg */);
-
-extern void TimerCheck(void);
-extern void TimerCancel(OsTimerPtr /* pTimer */);
-extern void TimerFree(OsTimerPtr /* pTimer */);
-
-extern void SetScreenSaverTimer(void);
-extern void FreeScreenSaverTimer(void);
-
-#ifdef DPMSExtension
-extern void SetDPMSTimers(void);
-extern void FreeDPMSTimers(void);
-#endif
-
-extern SIGVAL AutoResetServer(int /*sig*/);
-
-extern SIGVAL GiveUp(int /*sig*/);
-
-extern void UseMsg(void);
-
-extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]);
-
-extern int set_font_authorizations(
- char ** /* authorizations */,
- int * /*authlen */,
- pointer /* client */);
-
-#ifndef _HAVE_XALLOC_DECLS
-#define _HAVE_XALLOC_DECLS
-extern pointer Xalloc(unsigned long /*amount*/);
-extern pointer Xcalloc(unsigned long /*amount*/);
-extern pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/);
-extern void Xfree(pointer /*ptr*/);
-#endif
-
-extern pointer XNFalloc(unsigned long /*amount*/);
-extern pointer XNFcalloc(unsigned long /*amount*/);
-extern pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/);
-
-extern void OsInitAllocator(void);
-
-extern char *Xstrdup(const char *s);
-extern char *XNFstrdup(const char *s);
-
-typedef SIGVAL (*OsSigHandlerPtr)(int /* sig */);
-
-extern OsSigHandlerPtr OsSignal(int /* sig */, OsSigHandlerPtr /* handler */);
-
-extern int auditTrailLevel;
-
-#ifdef SERVER_LOCK
-extern void LockServer(void);
-extern void UnlockServer(void);
-#endif
-
-extern int OsLookupColor(
- int /*screen*/,
- char * /*name*/,
- unsigned /*len*/,
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/);
-
-extern void OsInit(void);
-
-extern void OsCleanup(Bool);
-
-extern void OsVendorFatalError(void);
-
-extern void OsVendorInit(void);
-
-extern int OsInitColors(void);
-
-void OsBlockSignals (void);
-
-void OsReleaseSignals (void);
-
-#if !defined(WIN32) && !defined(__UNIXOS2__)
-extern int System(char *);
-extern pointer Popen(char *, char *);
-extern int Pclose(pointer);
-extern pointer Fopen(char *, char *);
-extern int Fclose(pointer);
-#else
-#define System(a) system(a)
-#define Popen(a,b) popen(a,b)
-#define Pclose(a) pclose(a)
-#define Fopen(a,b) fopen(a,b)
-#define Fclose(a) fclose(a)
-#endif
-
-extern void CheckUserParameters(int argc, char **argv, char **envp);
-extern void CheckUserAuthorization(void);
-
-extern int AddHost(
- ClientPtr /*client*/,
- int /*family*/,
- unsigned /*length*/,
- pointer /*pAddr*/);
-
-extern Bool ForEachHostInFamily (
- int /*family*/,
- Bool (* /*func*/ )(
- unsigned char * /* addr */,
- short /* len */,
- pointer /* closure */),
- pointer /*closure*/);
-
-extern int RemoveHost(
- ClientPtr /*client*/,
- int /*family*/,
- unsigned /*length*/,
- pointer /*pAddr*/);
-
-extern int GetHosts(
- pointer * /*data*/,
- int * /*pnHosts*/,
- int * /*pLen*/,
- BOOL * /*pEnabled*/);
-
-typedef struct sockaddr * sockaddrPtr;
-
-extern int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/);
-
-extern int LocalClient(ClientPtr /* client */);
-
-extern int LocalClientCred(ClientPtr, int *, int *);
-
-extern int ChangeAccessControl(ClientPtr /*client*/, int /*fEnabled*/);
-
-extern int GetAccessControl(void);
-
-
-extern void AddLocalHosts(void);
-
-extern void ResetHosts(char *display);
-
-extern void EnableLocalHost(void);
-
-extern void DisableLocalHost(void);
-
-extern void AccessUsingXdmcp(void);
-
-extern void DefineSelf(int /*fd*/);
-
-extern void AugmentSelf(pointer /*from*/, int /*len*/);
-
-extern void InitAuthorization(char * /*filename*/);
-
-/* extern int LoadAuthorization(void); */
-
-extern void RegisterAuthorizations(void);
-
-extern XID AuthorizationToID (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data);
-
-extern int AuthorizationFromID (
- XID id,
- unsigned short *name_lenp,
- char **namep,
- unsigned short *data_lenp,
- char **datap);
-
-extern XID CheckAuthorization(
- unsigned int /*namelength*/,
- char * /*name*/,
- unsigned int /*datalength*/,
- char * /*data*/,
- ClientPtr /*client*/,
- char ** /*reason*/
-);
-
-extern void ResetAuthorization(void);
-
-extern int RemoveAuthorization (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data);
-
-extern int AddAuthorization(
- unsigned int /*name_length*/,
- char * /*name*/,
- unsigned int /*data_length*/,
- char * /*data*/);
-
-extern XID GenerateAuthorization(
- unsigned int /* name_length */,
- char * /* name */,
- unsigned int /* data_length */,
- char * /* data */,
- unsigned int * /* data_length_return */,
- char ** /* data_return */);
-
-#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
-extern void ExpandCommandLine(int * /*pargc*/, char *** /*pargv*/);
-#endif
-
-extern int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/);
-
-extern void ddxUseMsg(void);
-
-/*
- * idiom processing stuff
- */
-
-extern xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore);
-
-extern void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
-
-/* int ReqLen(xReq *req, ClientPtr client)
- * Given a pointer to a *complete* request, return its length in bytes.
- * Note that if the request is a big request (as defined in the Big
- * Requests extension), the macro lies by returning 4 less than the
- * length that it actually occupies in the request buffer. This is so you
- * can blindly compare the length with the various sz_<request> constants
- * in Xproto.h without having to know/care about big requests.
- */
-#define ReqLen(_pxReq, _client) \
- ((_pxReq->length ? \
- (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \
- : ((_client->swapped ? \
- lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \
- ) << 2)
-
-/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)
- * Cast the given request to one of type otherReqTypePtr to access
- * fields beyond the length field.
- */
-#define CastxReq(_pxReq, otherReqTypePtr) \
- (_pxReq->length ? (otherReqTypePtr)_pxReq \
- : (otherReqTypePtr)(((CARD32*)_pxReq)+1))
-
-/* stuff for SkippedRequestsCallback */
-extern CallbackListPtr SkippedRequestsCallback;
-typedef struct {
- xReqPtr req;
- ClientPtr client;
- int numskipped;
-} SkippedRequestInfoRec;
-
-/* stuff for ReplyCallback */
-extern CallbackListPtr ReplyCallback;
-typedef struct {
- ClientPtr client;
- pointer replyData;
- unsigned long dataLenBytes;
- unsigned long bytesRemaining;
- Bool startOfReply;
-} ReplyInfoRec;
-
-/* stuff for FlushCallback */
-extern CallbackListPtr FlushCallback;
-
-extern void AbortDDX(void);
-extern void ddxGiveUp(void);
-extern int TimeSinceLastInputEvent(void);
-
-/* Logging. */
-typedef enum _LogParameter {
- XLOG_FLUSH,
- XLOG_SYNC,
- XLOG_VERBOSITY,
- XLOG_FILE_VERBOSITY
-} LogParameter;
-
-/* Flags for log messages. */
-typedef enum {
- X_PROBED, /* Value was probed */
- X_CONFIG, /* Value was given in the config file */
- X_DEFAULT, /* Value is a default */
- X_CMDLINE, /* Value was given on the command line */
- X_NOTICE, /* Notice */
- X_ERROR, /* Error message */
- X_WARNING, /* Warning message */
- X_INFO, /* Informational message */
- X_NONE, /* No prefix */
- X_NOT_IMPLEMENTED, /* Not implemented */
- X_UNKNOWN = -1 /* unknown -- this must always be last */
-} MessageType;
-
-/* XXX Need to check which GCC versions have the format(printf) attribute. */
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
-#define _printf_attribute(a,b) __attribute((format(printf,a,b)))
-#else
-#define _printf_attribute(a,b) /**/
-#endif
-
-#ifdef printf
-#define printf_defined
-#undef printf
-#endif
-
-extern const char *LogInit(const char *fname, const char *backup);
-extern void LogClose(void);
-extern Bool LogSetParameter(LogParameter param, int value);
-extern void LogVWrite(int verb, const char *f, va_list args);
-extern void LogWrite(int verb, const char *f, ...) _printf_attribute(2,3);
-extern void LogVMessageVerb(MessageType type, int verb, const char *format,
- va_list args);
-extern void LogMessageVerb(MessageType type, int verb, const char *format,
- ...) _printf_attribute(3,4);
-extern void LogMessage(MessageType type, const char *format, ...)
- _printf_attribute(2,3);
-extern void FreeAuditTimer(void);
-extern void AuditF(const char *f, ...) _printf_attribute(1,2);
-extern void VAuditF(const char *f, va_list args);
-extern void FatalError(const char *f, ...) _printf_attribute(1,2)
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
-__attribute((noreturn))
-#endif
-;
-
-extern void VErrorF(const char *f, va_list args);
-extern void ErrorF(const char *f, ...) _printf_attribute(1,2);
-extern void Error(char *str);
-extern void LogPrintMarkers(void);
-
-#if defined(NEED_SNPRINTF) && !defined(IN_MODULE)
-extern int snprintf(char *str, size_t size, const char *format, ...)
- _printf_attribute(3,4);
-extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
-#endif
-
-#ifdef printf_defined
-#define printf xf86printf
-#undef printf_defined
-#endif
-
-#endif /* OS_H */
diff --git a/include/pixmap.h b/include/pixmap.h
deleted file mode 100644
index 56bb675ae..000000000
--- a/include/pixmap.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* $Xorg: pixmap.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/pixmap.h,v 1.4 2003/11/03 05:36:35 tsi Exp $ */
-
-#ifndef PIXMAP_H
-#define PIXMAP_H
-
-#include "misc.h"
-#include "screenint.h"
-
-/* types for Drawable */
-#define DRAWABLE_WINDOW 0
-#define DRAWABLE_PIXMAP 1
-#define UNDRAWABLE_WINDOW 2
-#define DRAWABLE_BUFFER 3
-
-/* flags to PaintWindow() */
-#define PW_BACKGROUND 0
-#define PW_BORDER 1
-
-#define NullPixmap ((PixmapPtr)0)
-
-typedef struct _Drawable *DrawablePtr;
-typedef struct _Pixmap *PixmapPtr;
-
-typedef union _PixUnion {
- PixmapPtr pixmap;
- unsigned long pixel;
-} PixUnion;
-
-#define SamePixUnion(a,b,isPixel)\
- ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
-
-#define EqualPixUnion(as, a, bs, b) \
- ((as) == (bs) && (SamePixUnion (a, b, as)))
-
-#define OnScreenDrawable(type) \
- ((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
-
-#define WindowDrawable(type) \
- ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
-
-extern PixmapPtr GetScratchPixmapHeader(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/,
- int /*bitsPerPixel*/,
- int /*devKind*/,
- pointer /*pPixData*/);
-
-extern void FreeScratchPixmapHeader(
- PixmapPtr /*pPixmap*/);
-
-extern Bool CreateScratchPixmapsForScreen(
- int /*scrnum*/);
-
-extern void FreeScratchPixmapsForScreen(
- int /*scrnum*/);
-
-extern PixmapPtr AllocatePixmap(
- ScreenPtr /*pScreen*/,
- int /*pixDataSize*/);
-
-#endif /* PIXMAP_H */
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
deleted file mode 100644
index d5bc21273..000000000
--- a/include/pixmapstr.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* $Xorg: pixmapstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/pixmapstr.h,v 1.3 2003/07/16 01:38:52 dawes Exp $ */
-
-#ifndef PIXMAPSTRUCT_H
-#define PIXMAPSTRUCT_H
-#include "pixmap.h"
-#include "screenint.h"
-#include "regionstr.h"
-
-typedef struct _Drawable {
- unsigned char type; /* DRAWABLE_<type> */
- unsigned char class; /* specific to type */
- unsigned char depth;
- unsigned char bitsPerPixel;
- unsigned long id; /* resource id */
- short x; /* window: screen absolute, pixmap: 0 */
- short y; /* window: screen absolute, pixmap: 0 */
- unsigned short width;
- unsigned short height;
- ScreenPtr pScreen;
- unsigned long serialNumber;
-} DrawableRec;
-
-/*
- * PIXMAP -- device dependent
- */
-
-typedef struct _Pixmap {
- DrawableRec drawable;
- int refcnt;
- int devKind;
- DevUnion devPrivate;
-#ifdef PIXPRIV
- DevUnion *devPrivates; /* real devPrivates like gcs & windows */
-#endif
-} PixmapRec;
-
-#endif /* PIXMAPSTRUCT_H */
diff --git a/include/property.h b/include/property.h
deleted file mode 100644
index 66103bc8e..000000000
--- a/include/property.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $Xorg: property.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/property.h,v 1.4 2003/04/27 21:31:04 herrb Exp $ */
-
-#ifndef PROPERTY_H
-#define PROPERTY_H
-
-#include "window.h"
-
-typedef struct _Property *PropertyPtr;
-
-extern int ChangeWindowProperty(
- WindowPtr /*pWin*/,
- Atom /*property*/,
- Atom /*type*/,
- int /*format*/,
- int /*mode*/,
- unsigned long /*len*/,
- pointer /*value*/,
- Bool /*sendevent*/);
-
-extern int DeleteProperty(
- WindowPtr /*pWin*/,
- Atom /*propName*/);
-
-extern void DeleteAllWindowProperties(
- WindowPtr /*pWin*/);
-
-#endif /* PROPERTY_H */
diff --git a/include/propertyst.h b/include/propertyst.h
deleted file mode 100644
index 5c335d038..000000000
--- a/include/propertyst.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $Xorg: propertyst.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/propertyst.h,v 3.3 2001/12/14 19:59:55 dawes Exp $ */
-
-#ifndef PROPERTYSTRUCT_H
-#define PROPERTYSTRUCT_H
-#include "misc.h"
-#include "property.h"
-/*
- * PROPERTY -- property element
- */
-
-typedef struct _Property {
- struct _Property *next;
- ATOM propertyName;
- ATOM type; /* ignored by server */
- short format; /* format of data for swapping - 8,16,32 */
- long size; /* size of data in (format/8) bytes */
- pointer data; /* private to client */
-#if defined(LBX) || defined(LBX_COMPAT)
- /* If space is at a premium and binary compatibility is not
- * an issue, you may want to put the owner_pid next to format
- * so that the two shorts pack together without padding.
- */
- short owner_pid; /* proxy that has the data */
- XID tag_id;
-#endif
-} PropertyRec;
-
-#endif /* PROPERTYSTRUCT_H */
-
diff --git a/include/region.h b/include/region.h
deleted file mode 100644
index 64f0ff444..000000000
--- a/include/region.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $Xorg: region.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#ifndef REGION_H
-#define REGION_H
-
-#include "regionstr.h"
-
-#endif /* REGION_H */
diff --git a/include/regionstr.h b/include/regionstr.h
deleted file mode 100644
index b431d0b04..000000000
--- a/include/regionstr.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/* $Xorg: regionstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/regionstr.h,v 1.11 2003/11/10 18:22:45 tsi Exp $ */
-
-#ifndef REGIONSTRUCT_H
-#define REGIONSTRUCT_H
-
-typedef struct _Region RegionRec, *RegionPtr;
-
-#include "miscstruct.h"
-
-/* Return values from RectIn() */
-
-#define rgnOUT 0
-#define rgnIN 1
-#define rgnPART 2
-
-#define NullRegion ((RegionPtr)0)
-
-/*
- * clip region
- */
-
-typedef struct _RegData {
- long size;
- long numRects;
-/* BoxRec rects[size]; in memory but not explicitly declared */
-} RegDataRec, *RegDataPtr;
-
-struct _Region {
- BoxRec extents;
- RegDataPtr data;
-};
-
-extern BoxRec miEmptyBox;
-extern RegDataRec miEmptyData;
-extern RegDataRec miBrokenData;
-
-#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
-/* not a region */
-#define REGION_NAR(reg) ((reg)->data == &miBrokenData)
-#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
-#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
-#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
- : &(reg)->extents)
-#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))
-#define REGION_BOX(reg,i) (&REGION_BOXPTR(reg)[i])
-#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)
-#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)
-#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
-
-#ifdef NEED_SCREEN_REGIONS
-
-#define REGION_CREATE(_pScreen, _rect, _size) \
- (*(_pScreen)->RegionCreate)(_rect, _size)
-
-#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
- (*(_pScreen)->RegionInit)(_pReg, _rect, _size)
-
-#define REGION_COPY(_pScreen, dst, src) \
- (*(_pScreen)->RegionCopy)(dst, src)
-
-#define REGION_DESTROY(_pScreen, _pReg) \
- (*(_pScreen)->RegionDestroy)(_pReg)
-
-#define REGION_UNINIT(_pScreen, _pReg) \
- (*(_pScreen)->RegionUninit)(_pReg)
-
-#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
- (*(_pScreen)->Intersect)(newReg, reg1, reg2)
-
-#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
- (*(_pScreen)->Union)(newReg, reg1, reg2)
-
-#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
- (*(_pScreen)->Subtract)(newReg, reg1, reg2)
-
-#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
- (*(_pScreen)->Inverse)(newReg, reg1, invRect)
-
-#define REGION_RESET(_pScreen, _pReg, _pBox) \
- (*(_pScreen)->RegionReset)(_pReg, _pBox)
-
-#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
- (*(_pScreen)->TranslateRegion)(_pReg, _x, _y)
-
-#define RECT_IN_REGION(_pScreen, _pReg, prect) \
- (*(_pScreen)->RectIn)(_pReg, prect)
-
-#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
- (*(_pScreen)->PointInRegion)(_pReg, _x, _y, prect)
-
-#define REGION_NOTEMPTY(_pScreen, _pReg) \
- (*(_pScreen)->RegionNotEmpty)(_pReg)
-
-#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
- (*(_pScreen)->RegionEqual)(_pReg1, _pReg2)
-
-#define REGION_BROKEN(_pScreen, _pReg) \
- (*(_pScreen)->RegionBroken)(_pReg)
-
-#define REGION_BREAK(_pScreen, _pReg) \
- (*(_pScreen)->RegionBreak)(_pReg)
-
-#define REGION_EMPTY(_pScreen, _pReg) \
- (*(_pScreen)->RegionEmpty)(_pReg)
-
-#define REGION_EXTENTS(_pScreen, _pReg) \
- (*(_pScreen)->RegionExtents)(_pReg)
-
-#define REGION_APPEND(_pScreen, dstrgn, rgn) \
- (*(_pScreen)->RegionAppend)(dstrgn, rgn)
-
-#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
- (*(_pScreen)->RegionValidate)(badreg, pOverlap)
-
-#define BITMAP_TO_REGION(_pScreen, pPix) \
- (*(_pScreen)->BitmapToRegion)(pPix)
-
-#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
- (*(_pScreen)->RectsToRegion)(nrects, prect, ctype)
-
-#else /* !NEED_SCREEN_REGIONS */
-
-/* Reference _pScreen macro argument and possibly check its type */
-#undef REGION_SCREEN
-#if defined(NDEBUG) && !defined(DEBUG) && !defined(BUILDDEBUG)
-
-# define REGION_SCREEN(_pScreen_) (void)(_pScreen_)
-
-#else
-
-extern volatile ScreenPtr currentRegionScreen;
-
-# define REGION_SCREEN(_pScreen_) (void)(currentRegionScreen = (_pScreen_))
-
-#endif
-
-#define REGION_CREATE(_pScreen, _rect, _size) \
- (REGION_SCREEN(_pScreen), miRegionCreate(_rect, _size))
-
-#define REGION_COPY(_pScreen, dst, src) \
- (REGION_SCREEN(_pScreen), miRegionCopy(dst, src))
-
-#define REGION_DESTROY(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionDestroy(_pReg))
-
-#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
- (REGION_SCREEN(_pScreen), miIntersect(newReg, reg1, reg2))
-
-#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
- (REGION_SCREEN(_pScreen), miUnion(newReg, reg1, reg2))
-
-#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
- (REGION_SCREEN(_pScreen), miSubtract(newReg, reg1, reg2))
-
-#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
- (REGION_SCREEN(_pScreen), miInverse(newReg, reg1, invRect))
-
-#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
- (REGION_SCREEN(_pScreen), miTranslateRegion(_pReg, _x, _y))
-
-#define RECT_IN_REGION(_pScreen, _pReg, prect) \
- (REGION_SCREEN(_pScreen), miRectIn(_pReg, prect))
-
-#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
- (REGION_SCREEN(_pScreen), miPointInRegion(_pReg, _x, _y, prect))
-
-#define REGION_APPEND(_pScreen, dstrgn, rgn) \
- (REGION_SCREEN(_pScreen), miRegionAppend(dstrgn, rgn))
-
-#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
- (REGION_SCREEN(_pScreen), miRegionValidate(badreg, pOverlap))
-
-#define BITMAP_TO_REGION(_pScreen, pPix) \
- (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
-
-#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
- (REGION_SCREEN(_pScreen), miRectsToRegion(nrects, prect, ctype))
-
-#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
- (REGION_SCREEN(_pScreen), miRegionEqual(_pReg1, _pReg2))
-
-#define REGION_BREAK(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionBreak(_pReg))
-
-#ifdef DONT_INLINE_REGION_OPS
-
-#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
- (REGION_SCREEN(_pScreen), miRegionInit(_pReg, _rect, _size))
-
-#define REGION_UNINIT(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionUninit(_pReg))
-
-#define REGION_RESET(_pScreen, _pReg, _pBox) \
- (REGION_SCREEN(_pScreen), miRegionReset(_pReg, _pBox))
-
-#define REGION_NOTEMPTY(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionNotEmpty(_pReg))
-
-#define REGION_BROKEN(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionBroken(_pReg))
-
-#define REGION_EMPTY(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionEmpty(_pReg))
-
-#define REGION_EXTENTS(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), miRegionExtents(_pReg))
-
-#else /* inline certain simple region ops for performance */
-
-#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
-{ \
- REGION_SCREEN(_pScreen); \
- (_pReg)->extents = *(_rect); \
- (_pReg)->data = (RegDataPtr)NULL; \
-}
-
-#define REGION_UNINIT(_pScreen, _pReg) \
-{ \
- REGION_SCREEN(_pScreen); \
- if ((_pReg)->data && (_pReg)->data->size) { \
- xfree((_pReg)->data); \
- (_pReg)->data = NULL; \
- } \
-}
-
-#define REGION_RESET(_pScreen, _pReg, _pBox) \
-{ \
- REGION_SCREEN(_pScreen); \
- (_pReg)->extents = *(_pBox); \
- REGION_UNINIT(_pScreen, _pReg); \
- (_pReg)->data = (RegDataPtr)NULL; \
-}
-
-#define REGION_NOTEMPTY(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), !REGION_NIL(_pReg))
-
-#define REGION_BROKEN(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), REGION_NAR(_pReg))
-
-#define REGION_EMPTY(_pScreen, _pReg) \
-{ \
- REGION_UNINIT(_pScreen, _pReg); \
- (_pReg)->extents.x2 = (_pReg)->extents.x1; \
- (_pReg)->extents.y2 = (_pReg)->extents.y1; \
- (_pReg)->data = &miEmptyData; \
-}
-
-#define REGION_EXTENTS(_pScreen, _pReg) \
- (REGION_SCREEN(_pScreen), &(_pReg)->extents)
-
-#define REGION_NULL(_pScreen, _pReg) \
-{ \
- REGION_SCREEN(_pScreen); \
- (_pReg)->extents = miEmptyBox; \
- (_pReg)->data = &miEmptyData; \
-}
-
-#endif /* DONT_INLINE_REGION_OPS */
-
-#endif /* NEED_SCREEN_REGIONS */
-
-#ifndef REGION_NULL
-#define REGION_NULL(_pScreen, _pReg) \
- REGION_INIT(_pScreen, _pReg, NullBox, 1)
-#endif
-
-/* moved from mi.h */
-
-extern RegionPtr miRegionCreate(
- BoxPtr /*rect*/,
- int /*size*/);
-
-extern void miRegionInit(
- RegionPtr /*pReg*/,
- BoxPtr /*rect*/,
- int /*size*/);
-
-extern void miRegionDestroy(
- RegionPtr /*pReg*/);
-
-extern void miRegionUninit(
- RegionPtr /*pReg*/);
-
-extern Bool miRegionCopy(
- RegionPtr /*dst*/,
- RegionPtr /*src*/);
-
-extern Bool miIntersect(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- RegionPtr /*reg2*/);
-
-extern Bool miUnion(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- RegionPtr /*reg2*/);
-
-extern Bool miRegionAppend(
- RegionPtr /*dstrgn*/,
- RegionPtr /*rgn*/);
-
-extern Bool miRegionValidate(
- RegionPtr /*badreg*/,
- Bool * /*pOverlap*/);
-
-extern RegionPtr miRectsToRegion(
- int /*nrects*/,
- xRectanglePtr /*prect*/,
- int /*ctype*/);
-
-extern Bool miSubtract(
- RegionPtr /*regD*/,
- RegionPtr /*regM*/,
- RegionPtr /*regS*/);
-
-extern Bool miInverse(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- BoxPtr /*invRect*/);
-
-extern int miRectIn(
- RegionPtr /*region*/,
- BoxPtr /*prect*/);
-
-extern void miTranslateRegion(
- RegionPtr /*pReg*/,
- int /*x*/,
- int /*y*/);
-
-extern void miRegionReset(
- RegionPtr /*pReg*/,
- BoxPtr /*pBox*/);
-
-extern Bool miRegionBreak(
- RegionPtr /*pReg*/);
-
-extern Bool miPointInRegion(
- RegionPtr /*pReg*/,
- int /*x*/,
- int /*y*/,
- BoxPtr /*box*/);
-
-extern Bool miRegionEqual(
- RegionPtr /*pReg1*/,
- RegionPtr /*pReg2*/);
-
-extern Bool miRegionNotEmpty(
- RegionPtr /*pReg*/);
-
-extern void miRegionEmpty(
- RegionPtr /*pReg*/);
-
-extern BoxPtr miRegionExtents(
- RegionPtr /*pReg*/);
-
-#endif /* REGIONSTRUCT_H */
diff --git a/include/resource.h b/include/resource.h
deleted file mode 100644
index 6517ab212..000000000
--- a/include/resource.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* $Xorg: resource.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/resource.h,v 1.12 2003/04/27 21:31:05 herrb Exp $ */
-
-#ifndef RESOURCE_H
-#define RESOURCE_H 1
-#include "misc.h"
-
-/*****************************************************************
- * STUFF FOR RESOURCES
- *****************************************************************/
-
-/* classes for Resource routines */
-
-typedef unsigned long RESTYPE;
-
-#define RC_VANILLA ((RESTYPE)0)
-#define RC_CACHED ((RESTYPE)1<<31)
-#define RC_DRAWABLE ((RESTYPE)1<<30)
-/* Use class RC_NEVERRETAIN for resources that should not be retained
- * regardless of the close down mode when the client dies. (A client's
- * event selections on objects that it doesn't own are good candidates.)
- * Extensions can use this too!
- */
-#define RC_NEVERRETAIN ((RESTYPE)1<<29)
-#define RC_LASTPREDEF RC_NEVERRETAIN
-#define RC_ANY (~(RESTYPE)0)
-
-/* types for Resource routines */
-
-#define RT_WINDOW ((RESTYPE)1|RC_CACHED|RC_DRAWABLE)
-#define RT_PIXMAP ((RESTYPE)2|RC_CACHED|RC_DRAWABLE)
-#define RT_GC ((RESTYPE)3|RC_CACHED)
-#undef RT_FONT
-#undef RT_CURSOR
-#define RT_FONT ((RESTYPE)4)
-#define RT_CURSOR ((RESTYPE)5)
-#define RT_COLORMAP ((RESTYPE)6)
-#define RT_CMAPENTRY ((RESTYPE)7)
-#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
-#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
-#define RT_LASTPREDEF ((RESTYPE)9)
-#define RT_NONE ((RESTYPE)0)
-
-/* bits and fields within a resource id */
-#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
-#if MAXCLIENTS == 64
-#define RESOURCE_CLIENT_BITS 6
-#endif
-#if MAXCLIENTS == 128
-#define RESOURCE_CLIENT_BITS 7
-#endif
-#if MAXCLIENTS == 256
-#define RESOURCE_CLIENT_BITS 8
-#endif
-#if MAXCLIENTS == 512
-#define RESOURCE_CLIENT_BITS 9
-#endif
-/* client field offset */
-#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
-/* resource field */
-#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1)
-/* client field */
-#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET)
-/* extract the client mask from an XID */
-#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK)
-/* extract the client id from an XID */
-#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))
-#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */
-
-#ifdef INVALID
-#undef INVALID /* needed on HP/UX */
-#endif
-
-/* Invalid resource id */
-#define INVALID (0)
-
-#define BAD_RESOURCE 0xe0000000
-
-typedef int (*DeleteType)(
- pointer /*value*/,
- XID /*id*/);
-
-typedef void (*FindResType)(
- pointer /*value*/,
- XID /*id*/,
- pointer /*cdata*/);
-
-typedef void (*FindAllRes)(
- pointer /*value*/,
- XID /*id*/,
- RESTYPE /*type*/,
- pointer /*cdata*/);
-
-typedef Bool (*FindComplexResType)(
- pointer /*value*/,
- XID /*id*/,
- pointer /*cdata*/);
-
-extern RESTYPE CreateNewResourceType(
- DeleteType /*deleteFunc*/);
-
-extern RESTYPE CreateNewResourceClass(void);
-
-extern Bool InitClientResources(
- ClientPtr /*client*/);
-
-extern XID FakeClientID(
- int /*client*/);
-
-/* Quartz support on Mac OS X uses the CarbonCore
- framework whose AddResource function conflicts here. */
-#ifdef __DARWIN__
-#define AddResource Darwin_X_AddResource
-#endif
-extern Bool AddResource(
- XID /*id*/,
- RESTYPE /*type*/,
- pointer /*value*/);
-
-extern void FreeResource(
- XID /*id*/,
- RESTYPE /*skipDeleteFuncType*/);
-
-extern void FreeResourceByType(
- XID /*id*/,
- RESTYPE /*type*/,
- Bool /*skipFree*/);
-
-extern Bool ChangeResourceValue(
- XID /*id*/,
- RESTYPE /*rtype*/,
- pointer /*value*/);
-
-extern void FindClientResourcesByType(
- ClientPtr /*client*/,
- RESTYPE /*type*/,
- FindResType /*func*/,
- pointer /*cdata*/);
-
-extern void FindAllClientResources(
- ClientPtr /*client*/,
- FindAllRes /*func*/,
- pointer /*cdata*/);
-
-extern void FreeClientNeverRetainResources(
- ClientPtr /*client*/);
-
-extern void FreeClientResources(
- ClientPtr /*client*/);
-
-extern void FreeAllResources(void);
-
-extern Bool LegalNewID(
- XID /*id*/,
- ClientPtr /*client*/);
-
-extern pointer LookupIDByType(
- XID /*id*/,
- RESTYPE /*rtype*/);
-
-extern pointer LookupIDByClass(
- XID /*id*/,
- RESTYPE /*classes*/);
-
-extern pointer LookupClientResourceComplex(
- ClientPtr client,
- RESTYPE type,
- FindComplexResType func,
- pointer cdata);
-
-/* These are the access modes that can be passed in the last parameter
- * to SecurityLookupIDByType/Class. The Security extension doesn't
- * currently make much use of these; they're mainly provided as an
- * example of what you might need for discretionary access control.
- * You can or these values together to indicate multiple modes
- * simultaneously.
- */
-
-#define SecurityUnknownAccess 0 /* don't know intentions */
-#define SecurityReadAccess (1<<0) /* inspecting the object */
-#define SecurityWriteAccess (1<<1) /* changing the object */
-#define SecurityDestroyAccess (1<<2) /* destroying the object */
-
-#ifdef XCSECURITY
-
-extern pointer SecurityLookupIDByType(
- ClientPtr /*client*/,
- XID /*id*/,
- RESTYPE /*rtype*/,
- Mask /*access_mode*/);
-
-extern pointer SecurityLookupIDByClass(
- ClientPtr /*client*/,
- XID /*id*/,
- RESTYPE /*classes*/,
- Mask /*access_mode*/);
-
-#else /* not XCSECURITY */
-
-#define SecurityLookupIDByType(client, id, rtype, access_mode) \
- LookupIDByType(id, rtype)
-
-#define SecurityLookupIDByClass(client, id, classes, access_mode) \
- LookupIDByClass(id, classes)
-
-#endif /* XCSECURITY */
-
-extern void GetXIDRange(
- int /*client*/,
- Bool /*server*/,
- XID * /*minp*/,
- XID * /*maxp*/);
-
-extern unsigned int GetXIDList(
- ClientPtr /*client*/,
- unsigned int /*count*/,
- XID * /*pids*/);
-
-extern RESTYPE lastResourceType;
-extern RESTYPE TypeMask;
-
-#ifdef XResExtension
-extern Atom *ResourceNames;
-void RegisterResourceName(RESTYPE type, char* name);
-#endif
-
-#endif /* RESOURCE_H */
-
diff --git a/include/rgb.h b/include/rgb.h
deleted file mode 100644
index 5741a4efa..000000000
--- a/include/rgb.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: rgb.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-
-#ifndef RGB_H
-#define RGB_H
-typedef struct _RGB {
- unsigned short red, green, blue;
- } RGB;
-#endif /* RGB_H */
diff --git a/include/screenint.h b/include/screenint.h
deleted file mode 100644
index 988a7416c..000000000
--- a/include/screenint.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* $Xorg: screenint.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.6 2003/04/27 21:31:05 herrb Exp $ */
-#ifndef SCREENINT_H
-#define SCREENINT_H
-
-#include "misc.h"
-
-typedef struct _PixmapFormat *PixmapFormatPtr;
-typedef struct _Visual *VisualPtr;
-typedef struct _Depth *DepthPtr;
-typedef struct _Screen *ScreenPtr;
-
-extern void ResetScreenPrivates(void);
-
-extern int AllocateScreenPrivateIndex(void);
-
-extern void ResetWindowPrivates(void);
-
-extern int AllocateWindowPrivateIndex(void);
-
-extern Bool AllocateWindowPrivate(
- ScreenPtr /* pScreen */,
- int /* index */,
- unsigned /* amount */);
-
-extern void ResetGCPrivates(void);
-
-extern int AllocateGCPrivateIndex(void);
-
-extern Bool AllocateGCPrivate(
- ScreenPtr /* pScreen */,
- int /* index */,
- unsigned /* amount */);
-
-extern int AddScreen(
- Bool (* /*pfnInit*/)(
- int /*index*/,
- ScreenPtr /*pScreen*/,
- int /*argc*/,
- char ** /*argv*/),
- int /*argc*/,
- char** /*argv*/);
-
-#ifdef PIXPRIV
-
-extern void ResetPixmapPrivates(void);
-
-extern int AllocatePixmapPrivateIndex(void);
-
-extern Bool AllocatePixmapPrivate(
- ScreenPtr /* pScreen */,
- int /* index */,
- unsigned /* amount */);
-
-#endif /* PIXPRIV */
-
-extern void ResetColormapPrivates(void);
-
-
-typedef struct _ColormapRec *ColormapPtr;
-typedef int (*InitCmapPrivFunc)(ColormapPtr);
-
-extern int AllocateColormapPrivateIndex(
- InitCmapPrivFunc /* initPrivFunc */);
-
-#endif /* SCREENINT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
deleted file mode 100644
index 0f1813c00..000000000
--- a/include/scrnintstr.h
+++ /dev/null
@@ -1,733 +0,0 @@
-/* $Xorg: scrnintstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/scrnintstr.h,v 1.13 2003/07/16 01:38:53 dawes Exp $ */
-
-#ifndef SCREENINTSTRUCT_H
-#define SCREENINTSTRUCT_H
-
-#include "screenint.h"
-#include "regionstr.h"
-#include "bstore.h"
-#include "colormap.h"
-#include "cursor.h"
-#include "validate.h"
-#include "X11/Xproto.h"
-#include "dix.h"
-
-typedef struct _PixmapFormat {
- unsigned char depth;
- unsigned char bitsPerPixel;
- unsigned char scanlinePad;
- } PixmapFormatRec;
-
-typedef struct _Visual {
- VisualID vid;
- short class;
- short bitsPerRGBValue;
- short ColormapEntries;
- short nplanes;/* = log2 (ColormapEntries). This does not
- * imply that the screen has this many planes.
- * it may have more or fewer */
- unsigned long redMask, greenMask, blueMask;
- int offsetRed, offsetGreen, offsetBlue;
- } VisualRec;
-
-typedef struct _Depth {
- unsigned char depth;
- short numVids;
- VisualID *vids; /* block of visual ids for this depth */
- } DepthRec;
-
-
-/*
- * There is a typedef for each screen function pointer so that code that
- * needs to declare a screen function pointer (e.g. in a screen private
- * or as a local variable) can easily do so and retain full type checking.
- */
-
-typedef Bool (* CloseScreenProcPtr)(
- int /*index*/,
- ScreenPtr /*pScreen*/);
-
-typedef void (* QueryBestSizeProcPtr)(
- int /*class*/,
- unsigned short * /*pwidth*/,
- unsigned short * /*pheight*/,
- ScreenPtr /*pScreen*/);
-
-typedef Bool (* SaveScreenProcPtr)(
- ScreenPtr /*pScreen*/,
- int /*on*/);
-
-typedef void (* GetImageProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/);
-
-typedef void (* GetSpansProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int* /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/);
-
-typedef void (* PointerNonInterestBoxProcPtr)(
- ScreenPtr /*pScreen*/,
- BoxPtr /*pBox*/);
-
-typedef void (* SourceValidateProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*x*/,
- int /*y*/,
- int /*width*/,
- int /*height*/);
-
-typedef Bool (* CreateWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* DestroyWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* PositionWindowProcPtr)(
- WindowPtr /*pWindow*/,
- int /*x*/,
- int /*y*/);
-
-typedef Bool (* ChangeWindowAttributesProcPtr)(
- WindowPtr /*pWindow*/,
- unsigned long /*mask*/);
-
-typedef Bool (* RealizeWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* UnrealizeWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef void (* RestackWindowProcPtr)(
- WindowPtr /*pWindow*/,
- WindowPtr /*pOldNextSib*/);
-
-typedef int (* ValidateTreeProcPtr)(
- WindowPtr /*pParent*/,
- WindowPtr /*pChild*/,
- VTKind /*kind*/);
-
-typedef void (* PostValidateTreeProcPtr)(
- WindowPtr /*pParent*/,
- WindowPtr /*pChild*/,
- VTKind /*kind*/);
-
-typedef void (* WindowExposuresProcPtr)(
- WindowPtr /*pWindow*/,
- RegionPtr /*prgn*/,
- RegionPtr /*other_exposed*/);
-
-typedef void (* PaintWindowProcPtr)(
- WindowPtr /*pWindow*/,
- RegionPtr /*pRegion*/,
- int /*what*/);
-
-typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
-typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
-
-typedef void (* CopyWindowProcPtr)(
- WindowPtr /*pWindow*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/);
-
-typedef void (* ClearToBackgroundProcPtr)(
- WindowPtr /*pWindow*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- Bool /*generateExposures*/);
-
-typedef void (* ClipNotifyProcPtr)(
- WindowPtr /*pWindow*/,
- int /*dx*/,
- int /*dy*/);
-
-typedef PixmapPtr (* CreatePixmapProcPtr)(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/);
-
-typedef Bool (* DestroyPixmapProcPtr)(
- PixmapPtr /*pPixmap*/);
-
-typedef void (* SaveDoomedAreasProcPtr)(
- WindowPtr /*pWindow*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/);
-
-typedef RegionPtr (* RestoreAreasProcPtr)(
- WindowPtr /*pWindow*/,
- RegionPtr /*prgnRestore*/);
-
-typedef void (* ExposeCopyProcPtr)(
- WindowPtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- GCPtr /*pGC*/,
- RegionPtr /*prgnExposed*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/);
-
-typedef RegionPtr (* TranslateBackingStoreProcPtr)(
- WindowPtr /*pWindow*/,
- int /*windx*/,
- int /*windy*/,
- RegionPtr /*oldClip*/,
- int /*oldx*/,
- int /*oldy*/);
-
-typedef RegionPtr (* ClearBackingStoreProcPtr)(
- WindowPtr /*pWindow*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- Bool /*generateExposures*/);
-
-typedef void (* DrawGuaranteeProcPtr)(
- WindowPtr /*pWindow*/,
- GCPtr /*pGC*/,
- int /*guarantee*/);
-
-typedef Bool (* RealizeFontProcPtr)(
- ScreenPtr /*pScreen*/,
- FontPtr /*pFont*/);
-
-typedef Bool (* UnrealizeFontProcPtr)(
- ScreenPtr /*pScreen*/,
- FontPtr /*pFont*/);
-
-typedef void (* ConstrainCursorProcPtr)(
- ScreenPtr /*pScreen*/,
- BoxPtr /*pBox*/);
-
-typedef void (* CursorLimitsProcPtr)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- BoxPtr /*pHotBox*/,
- BoxPtr /*pTopLeftBox*/);
-
-typedef Bool (* DisplayCursorProcPtr)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef Bool (* RealizeCursorProcPtr)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef Bool (* UnrealizeCursorProcPtr)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef void (* RecolorCursorProcPtr)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- Bool /*displayed*/);
-
-typedef Bool (* SetCursorPositionProcPtr)(
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/,
- Bool /*generateEvent*/);
-
-typedef Bool (* CreateGCProcPtr)(
- GCPtr /*pGC*/);
-
-typedef Bool (* CreateColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* DestroyColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* InstallColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* UninstallColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef int (* ListInstalledColormapsProcPtr) (
- ScreenPtr /*pScreen*/,
- XID* /*pmaps */);
-
-typedef void (* StoreColorsProcPtr)(
- ColormapPtr /*pColormap*/,
- int /*ndef*/,
- xColorItem * /*pdef*/);
-
-typedef void (* ResolveColorProcPtr)(
- unsigned short* /*pred*/,
- unsigned short* /*pgreen*/,
- unsigned short* /*pblue*/,
- VisualPtr /*pVisual*/);
-
-#ifdef NEED_SCREEN_REGIONS
-
-typedef RegionPtr (* RegionCreateProcPtr)(
- BoxPtr /*rect*/,
- int /*size*/);
-
-typedef void (* RegionInitProcPtr)(
- RegionPtr /*pReg*/,
- BoxPtr /*rect*/,
- int /*size*/);
-
-typedef Bool (* RegionCopyProcPtr)(
- RegionPtr /*dst*/,
- RegionPtr /*src*/);
-
-typedef void (* RegionDestroyProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef void (* RegionUninitProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef Bool (* IntersectProcPtr)(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- RegionPtr /*reg2*/);
-
-typedef Bool (* UnionProcPtr)(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- RegionPtr /*reg2*/);
-
-typedef Bool (* SubtractProcPtr)(
- RegionPtr /*regD*/,
- RegionPtr /*regM*/,
- RegionPtr /*regS*/);
-
-typedef Bool (* InverseProcPtr)(
- RegionPtr /*newReg*/,
- RegionPtr /*reg1*/,
- BoxPtr /*invRect*/);
-
-typedef void (* RegionResetProcPtr)(
- RegionPtr /*pReg*/,
- BoxPtr /*pBox*/);
-
-typedef void (* TranslateRegionProcPtr)(
- RegionPtr /*pReg*/,
- int /*x*/,
- int /*y*/);
-
-typedef int (* RectInProcPtr)(
- RegionPtr /*region*/,
- BoxPtr /*prect*/);
-
-typedef Bool (* PointInRegionProcPtr)(
- RegionPtr /*pReg*/,
- int /*x*/,
- int /*y*/,
- BoxPtr /*box*/);
-
-typedef Bool (* RegionNotEmptyProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef Bool (* RegionEqualProcPtr)(
- RegionPtr /*pReg1*/,
- RegionPtr /*pReg2*/);
-
-typedef Bool (* RegionBrokenProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef Bool (* RegionBreakProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef void (* RegionEmptyProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef BoxPtr (* RegionExtentsProcPtr)(
- RegionPtr /*pReg*/);
-
-typedef Bool (* RegionAppendProcPtr)(
- RegionPtr /*dstrgn*/,
- RegionPtr /*rgn*/);
-
-typedef Bool (* RegionValidateProcPtr)(
- RegionPtr /*badreg*/,
- Bool* /*pOverlap*/);
-
-#endif /* NEED_SCREEN_REGIONS */
-
-typedef RegionPtr (* BitmapToRegionProcPtr)(
- PixmapPtr /*pPix*/);
-
-#ifdef NEED_SCREEN_REGIONS
-
-typedef RegionPtr (* RectsToRegionProcPtr)(
- int /*nrects*/,
- xRectangle* /*prect*/,
- int /*ctype*/);
-
-#endif /* NEED_SCREEN_REGIONS */
-
-typedef void (* SendGraphicsExposeProcPtr)(
- ClientPtr /*client*/,
- RegionPtr /*pRgn*/,
- XID /*drawable*/,
- int /*major*/,
- int /*minor*/);
-
-typedef void (* ScreenBlockHandlerProcPtr)(
- int /*screenNum*/,
- pointer /*blockData*/,
- pointer /*pTimeout*/,
- pointer /*pReadmask*/);
-
-typedef void (* ScreenWakeupHandlerProcPtr)(
- int /*screenNum*/,
- pointer /*wakeupData*/,
- unsigned long /*result*/,
- pointer /*pReadMask*/);
-
-typedef Bool (* CreateScreenResourcesProcPtr)(
- ScreenPtr /*pScreen*/);
-
-typedef Bool (* ModifyPixmapHeaderProcPtr)(
- PixmapPtr /*pPixmap*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/,
- int /*bitsPerPixel*/,
- int /*devKind*/,
- pointer /*pPixData*/);
-
-typedef PixmapPtr (* GetWindowPixmapProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef void (* SetWindowPixmapProcPtr)(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/);
-
-typedef PixmapPtr (* GetScreenPixmapProcPtr)(
- ScreenPtr /*pScreen*/);
-
-typedef void (* SetScreenPixmapProcPtr)(
- PixmapPtr /*pPix*/);
-
-typedef void (* MarkWindowProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef Bool (* MarkOverlappedWindowsProcPtr)(
- WindowPtr /*parent*/,
- WindowPtr /*firstChild*/,
- WindowPtr * /*pLayerWin*/);
-
-typedef Bool (* ChangeSaveUnderProcPtr)(
- WindowPtr /*pLayerWin*/,
- WindowPtr /*firstChild*/);
-
-typedef void (* PostChangeSaveUnderProcPtr)(
- WindowPtr /*pLayerWin*/,
- WindowPtr /*firstChild*/);
-
-typedef void (* MoveWindowProcPtr)(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- WindowPtr /*pSib*/,
- VTKind /*kind*/);
-
-typedef void (* ResizeWindowProcPtr)(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*w*/,
- unsigned int /*h*/,
- WindowPtr /*pSib*/
-);
-
-typedef WindowPtr (* GetLayerWindowProcPtr)(
- WindowPtr /*pWin*/
-);
-
-typedef void (* HandleExposuresProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef void (* ReparentWindowProcPtr)(
- WindowPtr /*pWin*/,
- WindowPtr /*pPriorParent*/);
-
-#ifdef SHAPE
-typedef void (* SetShapeProcPtr)(
- WindowPtr /*pWin*/);
-#endif /* SHAPE */
-
-typedef void (* ChangeBorderWidthProcPtr)(
- WindowPtr /*pWin*/,
- unsigned int /*width*/);
-
-typedef void (* MarkUnrealizedWindowProcPtr)(
- WindowPtr /*pChild*/,
- WindowPtr /*pWin*/,
- Bool /*fromConfigure*/);
-
-typedef struct _Screen {
- int myNum; /* index of this instance in Screens[] */
- ATOM id;
- short width, height;
- short mmWidth, mmHeight;
- short numDepths;
- unsigned char rootDepth;
- DepthPtr allowedDepths;
- unsigned long rootVisual;
- unsigned long defColormap;
- short minInstalledCmaps, maxInstalledCmaps;
- char backingStoreSupport, saveUnderSupport;
- unsigned long whitePixel, blackPixel;
- unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
- GCPtr GCperDepth[MAXFORMATS+1];
- /* next field is a stipple to use as default in
- a GC. we don't build default tiles of all depths
- because they are likely to be of a color
- different from the default fg pixel, so
- we don't win anything by building
- a standard one.
- */
- PixmapPtr PixmapPerDepth[1];
- pointer devPrivate;
- short numVisuals;
- VisualPtr visuals;
- int WindowPrivateLen;
- unsigned *WindowPrivateSizes;
- unsigned totalWindowSize;
- int GCPrivateLen;
- unsigned *GCPrivateSizes;
- unsigned totalGCSize;
-
- /* Random screen procedures */
-
- CloseScreenProcPtr CloseScreen;
- QueryBestSizeProcPtr QueryBestSize;
- SaveScreenProcPtr SaveScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- PointerNonInterestBoxProcPtr PointerNonInterestBox;
- SourceValidateProcPtr SourceValidate;
-
- /* Window Procedures */
-
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- ValidateTreeProcPtr ValidateTree;
- PostValidateTreeProcPtr PostValidateTree;
- WindowExposuresProcPtr WindowExposures;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- ClipNotifyProcPtr ClipNotify;
- RestackWindowProcPtr RestackWindow;
-
- /* Pixmap procedures */
-
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
-
- /* Backing store procedures */
-
- SaveDoomedAreasProcPtr SaveDoomedAreas;
- RestoreAreasProcPtr RestoreAreas;
- ExposeCopyProcPtr ExposeCopy;
- TranslateBackingStoreProcPtr TranslateBackingStore;
- ClearBackingStoreProcPtr ClearBackingStore;
- DrawGuaranteeProcPtr DrawGuarantee;
- /*
- * A read/write copy of the lower level backing store vector is needed now
- * that the functions can be wrapped.
- */
- BSFuncRec BackingStoreFuncs;
-
- /* Font procedures */
-
- RealizeFontProcPtr RealizeFont;
- UnrealizeFontProcPtr UnrealizeFont;
-
- /* Cursor Procedures */
-
- ConstrainCursorProcPtr ConstrainCursor;
- CursorLimitsProcPtr CursorLimits;
- DisplayCursorProcPtr DisplayCursor;
- RealizeCursorProcPtr RealizeCursor;
- UnrealizeCursorProcPtr UnrealizeCursor;
- RecolorCursorProcPtr RecolorCursor;
- SetCursorPositionProcPtr SetCursorPosition;
-
- /* GC procedures */
-
- CreateGCProcPtr CreateGC;
-
- /* Colormap procedures */
-
- CreateColormapProcPtr CreateColormap;
- DestroyColormapProcPtr DestroyColormap;
- InstallColormapProcPtr InstallColormap;
- UninstallColormapProcPtr UninstallColormap;
- ListInstalledColormapsProcPtr ListInstalledColormaps;
- StoreColorsProcPtr StoreColors;
- ResolveColorProcPtr ResolveColor;
-
- /* Region procedures */
-
-#ifdef NEED_SCREEN_REGIONS
- RegionCreateProcPtr RegionCreate;
- RegionInitProcPtr RegionInit;
- RegionCopyProcPtr RegionCopy;
- RegionDestroyProcPtr RegionDestroy;
- RegionUninitProcPtr RegionUninit;
- IntersectProcPtr Intersect;
- UnionProcPtr Union;
- SubtractProcPtr Subtract;
- InverseProcPtr Inverse;
- RegionResetProcPtr RegionReset;
- TranslateRegionProcPtr TranslateRegion;
- RectInProcPtr RectIn;
- PointInRegionProcPtr PointInRegion;
- RegionNotEmptyProcPtr RegionNotEmpty;
- RegionEqualProcPtr RegionEqual;
- RegionBrokenProcPtr RegionBroken;
- RegionBreakProcPtr RegionBreak;
- RegionEmptyProcPtr RegionEmpty;
- RegionExtentsProcPtr RegionExtents;
- RegionAppendProcPtr RegionAppend;
- RegionValidateProcPtr RegionValidate;
-#endif /* NEED_SCREEN_REGIONS */
- BitmapToRegionProcPtr BitmapToRegion;
-#ifdef NEED_SCREEN_REGIONS
- RectsToRegionProcPtr RectsToRegion;
-#endif /* NEED_SCREEN_REGIONS */
- SendGraphicsExposeProcPtr SendGraphicsExpose;
-
- /* os layer procedures */
-
- ScreenBlockHandlerProcPtr BlockHandler;
- ScreenWakeupHandlerProcPtr WakeupHandler;
-
- pointer blockData;
- pointer wakeupData;
-
- /* anybody can get a piece of this array */
- DevUnion *devPrivates;
-
- CreateScreenResourcesProcPtr CreateScreenResources;
- ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
-
- GetWindowPixmapProcPtr GetWindowPixmap;
- SetWindowPixmapProcPtr SetWindowPixmap;
- GetScreenPixmapProcPtr GetScreenPixmap;
- SetScreenPixmapProcPtr SetScreenPixmap;
-
- PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
-
-#ifdef PIXPRIV
- int PixmapPrivateLen;
- unsigned int *PixmapPrivateSizes;
- unsigned int totalPixmapSize;
-#endif
-
- MarkWindowProcPtr MarkWindow;
- MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
- ChangeSaveUnderProcPtr ChangeSaveUnder;
- PostChangeSaveUnderProcPtr PostChangeSaveUnder;
- MoveWindowProcPtr MoveWindow;
- ResizeWindowProcPtr ResizeWindow;
- GetLayerWindowProcPtr GetLayerWindow;
- HandleExposuresProcPtr HandleExposures;
- ReparentWindowProcPtr ReparentWindow;
-
-#ifdef SHAPE
- SetShapeProcPtr SetShape;
-#endif /* SHAPE */
-
- ChangeBorderWidthProcPtr ChangeBorderWidth;
- MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
-
-} ScreenRec;
-
-typedef struct _ScreenInfo {
- int imageByteOrder;
- int bitmapScanlineUnit;
- int bitmapScanlinePad;
- int bitmapBitOrder;
- int numPixmapFormats;
- PixmapFormatRec
- formats[MAXFORMATS];
- int arraySize;
- int numScreens;
- ScreenPtr screens[MAXSCREENS];
- int numVideoScreens;
-} ScreenInfo;
-
-extern ScreenInfo screenInfo;
-
-extern void InitOutput(
- ScreenInfo * /*pScreenInfo*/,
- int /*argc*/,
- char ** /*argv*/);
-
-#endif /* SCREENINTSTRUCT_H */
diff --git a/include/selection.h b/include/selection.h
deleted file mode 100644
index 520cfd4aa..000000000
--- a/include/selection.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $Xorg: selection.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-#ifndef SELECTION_H
-#define SELECTION_H 1
-
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "dixstruct.h"
-/*
- *
- * Selection data structures
- */
-
-typedef struct _Selection {
- Atom selection;
- TimeStamp lastTimeChanged;
- Window window;
- WindowPtr pWin;
- ClientPtr client;
-} Selection;
-
-#endif /* SELECTION_H */
-
-
diff --git a/include/servermd.h b/include/servermd.h
deleted file mode 100644
index 654e1411b..000000000
--- a/include/servermd.h
+++ /dev/null
@@ -1,576 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/servermd.h,v 3.57 2003/11/03 05:11:59 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: servermd.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-
-#ifndef SERVERMD_H
-#define SERVERMD_H 1
-
-/*
- * Machine dependent values:
- * GLYPHPADBYTES should be chosen with consideration for the space-time
- * trade-off. Padding to 0 bytes means that there is no wasted space
- * in the font bitmaps (both on disk and in memory), but that access of
- * the bitmaps will cause odd-address memory references. Padding to
- * 2 bytes would ensure even address memory references and would
- * be suitable for a 68010-class machine, but at the expense of wasted
- * space in the font bitmaps. Padding to 4 bytes would be good
- * for real 32 bit machines, etc. Be sure that you tell the font
- * compiler what kind of padding you want because its defines are
- * kept separate from this. See server/include/font.h for how
- * GLYPHPADBYTES is used.
- *
- * Along with this, you should choose an appropriate value for
- * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h. This
- * constant choses what kind of memory references are guarenteed during
- * font access; either 1, 2 or 4, for byte, word or longword access,
- * respectively. For instance, if you have decided to to have
- * GLYPHPADBYTES == 4, then it is pointless for you to have a
- * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
- * guarenteed you that your fonts are longword aligned. On the other
- * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
- * also decide that the computing involved in aligning the pointer is more
- * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
- *
- * Next, choose the tuning parameters which are appropriate for your
- * hardware; these modify the behaviour of the raw frame buffer code
- * in ddx/mfb and ddx/cfb. Defining these incorrectly will not cause
- * the server to run incorrectly, but defining these correctly will
- * cause some noticeable speed improvements:
- *
- * AVOID_MEMORY_READ - (8-bit cfb only)
- * When stippling pixels on the screen (polytext and pushpixels),
- * don't read long words from the display and mask in the
- * appropriate values. Rather, perform multiple byte/short/long
- * writes as appropriate. This option uses many more instructions
- * but runs much faster when the destination is much slower than
- * the CPU and at least 1 level of write buffer is availible (2
- * is much better). Defined currently for SPARC and MIPS.
- *
- * FAST_CONSTANT_OFFSET_MODE - (cfb and mfb)
- * This define is used on machines which have no auto-increment
- * addressing mode, but do have an effectively free constant-offset
- * addressing mode. Currently defined for MIPS and SPARC, even though
- * I remember the cg6 as performing better without it (cg3 definitely
- * performs better with it).
- *
- * LARGE_INSTRUCTION_CACHE -
- * This define increases the number of times some loops are
- * unrolled. On 68020 machines (with 256 bytes of i-cache),
- * this define will slow execution down as instructions miss
- * the cache frequently. On machines with real i-caches, this
- * reduces loop overhead, causing a slight performance improvement.
- * Currently defined for MIPS and SPARC
- *
- * FAST_UNALIGNED_READS -
- * For machines with more memory bandwidth than CPU, this
- * define uses unaligned reads for 8-bit BitBLT instead of doing
- * aligned reads and combining the results with shifts and
- * logical-ors. Currently defined for 68020 and vax.
- * PLENTIFUL_REGISTERS -
- * For machines with > 20 registers. Currently used for
- * unrolling the text painting code a bit more. Currently
- * defined for MIPS.
- * SHARED_IDCACHE -
- * For non-Harvard RISC machines, those which share the same
- * CPU memory bus for instructions and data. This unrolls some
- * solid fill loops which are otherwise best left rolled up.
- * Currently defined for SPARC.
- */
-
-#ifdef vax
-
-#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */
-#define BITMAP_BIT_ORDER LSBFirst
-#define GLYPHPADBYTES 1
-#define GETLEFTBITS_ALIGNMENT 4
-#define FAST_UNALIGNED_READS
-
-#endif /* vax */
-
-#ifdef __arm32__
-
-#define IMAGE_BYTE_ORDER LSBFirst
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
-# define BITMAP_BIT_ORDER MSBFirst
-# else
-# define BITMAP_BIT_ORDER LSBFirst
-# endif
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16)
-# define BITMAP_SCANLINE_UNIT 8
-# endif
-
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-#define LARGE_INSTRUCTION_CACHE
-#define AVOID_MEMORY_READ
-
-#endif /* __arm32__ */
-
-#if defined (hpux)
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4 /* to make fb work */
-#define GETLEFTBITS_ALIGNMENT 1 /* PA forces longs to 4 */
- /* byte boundries */
-#define AVOID_MEMORY_READ
-#define FAST_CONSTANT_OFFSET_MODE
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-
-#endif /* hpux */
-
-#if defined(__powerpc__)
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-/* XXX Should this be for Lynx only? */
-#ifdef Lynx
-#define BITMAP_SCANLINE_UNIT 8
-#endif
-
-#define LARGE_INSTRUCTION_CACHE
-#define FAST_CONSTANT_OFFSET_MODE
-#define PLENTIFUL_REGISTERS
-#define AVOID_MEMORY_READ
-
-#define FAST_MEMCPY
-
-#endif /* PowerPC */
-
-#if defined(__sh__)
-
-#if defined(__BIG_ENDIAN__)
-# define IMAGE_BYTE_ORDER MSBFirst
-# define BITMAP_BIT_ORDER MSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#else
-# define IMAGE_BYTE_ORDER LSBFirst
-# define BITMAP_BIT_ORDER LSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#endif
-
-#define AVOID_MEMORY_READ
-#define FAST_CONSTANT_OFFSET_MODE
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-
-#endif /* SuperH */
-
-
-#if (defined(sun) && !(defined(i386) && defined(SVR4))) || \
- (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
- defined(__sparc__) || defined(__mc68000__)
-
-#if defined(sun386) || defined(sun5)
-# define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */
-# define BITMAP_BIT_ORDER LSBFirst
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */
-# define BITMAP_BIT_ORDER MSBFirst
-#endif
-
-#ifdef sparc
-# define AVOID_MEMORY_READ
-# define LARGE_INSTRUCTION_CACHE
-# define FAST_CONSTANT_OFFSET_MODE
-# define SHARED_IDCACHE
-#endif
-
-#ifdef mc68020
-#define FAST_UNALIGNED_READS
-#endif
-
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#endif /* sun && !(i386 && SVR4) */
-
-
-#if defined(AIXV3)
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RISC/6000 */
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#define LARGE_INSTRUCTION_CACHE
-#define FAST_CONSTANT_OFFSET_MODE
-#define PLENTIFUL_REGISTERS
-#define AVOID_MEMORY_READ
-
-#define FAST_MEMCPY
-#endif /* AIXV3 */
-
-#if defined(ibm032) || defined (ibm)
-
-#ifdef i386
-# define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only*/
-#endif
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 1
-#define GETLEFTBITS_ALIGNMENT 4
-/* ibm pcc doesn't understand pragmas. */
-
-#ifdef i386
-#define BITMAP_SCANLINE_UNIT 8
-#endif
-
-#endif /* ibm */
-
-#if defined (M4310) || defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for Pegasus only */
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#define FAST_UNALIGNED_READS
-
-#endif /* tektronix */
-
-#ifdef macII
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MacII only */
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-/* might want FAST_UNALIGNED_READS for frame buffers with < 1us latency */
-
-#endif /* macII */
-
-#if (defined(mips) || defined(__mips)) && !defined(sgi)
-
-#if defined(MIPSEL) || defined(__MIPSEL__)
-# define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */
-# define BITMAP_BIT_ORDER LSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */
-# define BITMAP_BIT_ORDER MSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#endif
-
-#define AVOID_MEMORY_READ
-#define FAST_CONSTANT_OFFSET_MODE
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-
-#endif /* mips */
-
-#if defined(__alpha) || defined(__alpha__) || defined(__alphaCross)
-# define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
-# define BITMAP_BIT_ORDER MSBFirst
-# else
-# define BITMAP_BIT_ORDER LSBFirst
-# endif
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16)
-# define BITMAP_SCANLINE_UNIT 8
-# endif
-
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-# define FAST_CONSTANT_OFFSET_MODE
-# define LARGE_INSTRUCTION_CACHE
-# define PLENTIFUL_REGISTERS
-
-#endif /* alpha */
-
-#if defined (linux) && defined (__s390__)
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#define BITMAP_SCANLINE_UNIT 8
-#define LARGE_INSTRUCTION_CACHE
-#define FAST_CONSTANT_OFFSET_MODE
-#define FAST_UNALIGNED_READ
-
-#define FAST_MEMCPY
-
-#endif /* linux/s390 */
-
-#if defined (linux) && defined (__s390x__)
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#define BITMAP_SCANLINE_UNIT 8
-#define LARGE_INSTRUCTION_CACHE
-#define FAST_CONSTANT_OFFSET_MODE
-#define FAST_UNALIGNED_READ
-
-#define FAST_MEMCPY
-#endif /* linux/s390x */
-
-
-#if defined(__ia64__) || defined(ia64)
-# define IMAGE_BYTE_ORDER LSBFirst
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
-# define BITMAP_BIT_ORDER MSBFirst
-# else
-# define BITMAP_BIT_ORDER LSBFirst
-# endif
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16)
-# define BITMAP_SCANLINE_UNIT 8
-# endif
-
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-# define FAST_CONSTANT_OFFSET_MODE
-# define LARGE_INSTRUCTION_CACHE
-# define PLENTIFUL_REGISTERS
-
-#endif /* ia64 */
-
-#if defined(__AMD64__) || defined(AMD64)
-# define IMAGE_BYTE_ORDER LSBFirst
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
-# define BITMAP_BIT_ORDER MSBFirst
-# else
-# define BITMAP_BIT_ORDER LSBFirst
-# endif
-
-# if defined(XF86MONOVGA) || defined(XF86VGA16)
-# define BITMAP_SCANLINE_UNIT 8
-# endif
-
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-# define LARGE_INSTRUCTION_CACHE
-# define FAST_CONSTANT_OFFSET_MODE
-/* ???? */
-# define FAST_UNALIGNED_READS
-#endif /* AMD64 */
-
-#ifdef stellar
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the stellar only*/
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 4
-#define IMAGE_BUFSIZE (64*1024)
-/*
- * Use SysV random number generator.
- */
-#define random rand
-
-#endif /* stellar */
-
-#ifdef luna
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the OMRON only*/
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#ifndef mc68000
-#define FAST_CONSTANT_OFFSET_MODE
-#define AVOID_MEMORY_READ
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-#endif
-
-#endif /* luna */
-
-#if (defined(SVR4) && defined(i386)) || \
- defined(__alpha__) || defined(__alpha) || \
- defined(__i386__) || \
- defined(__UNIXOS2__) || \
- defined(__OS2ELF__) || \
- defined(__QNX__) || \
- defined(__s390x__) || defined(__s390__)
-
-#ifndef IMAGE_BYTE_ORDER
-#define IMAGE_BYTE_ORDER LSBFirst
-#endif
-
-#ifndef BITMAP_BIT_ORDER
-# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
-# define BITMAP_BIT_ORDER MSBFirst
-# else
-# define BITMAP_BIT_ORDER LSBFirst
-# endif
-#endif
-
-#ifndef BITMAP_SCANLINE_UNIT
-# if defined(XF86MONOVGA) || defined(XF86VGA16)
-# define BITMAP_SCANLINE_UNIT 8
-# endif
-#endif
-
-#ifndef GLYPHPADBYTES
-#define GLYPHPADBYTES 4
-#endif
-
-#define GETLEFTBITS_ALIGNMENT 1
-#define AVOID_MEMORY_READ
-#ifdef XSVGA
-#define AVOID_GLYPHBLT
-#define FAST_CONSTANT_OFFSET_MODE
-#define FAST_MEMCPY
-#define NO_ONE_RECT
-#endif
-
-#endif /* SVR4 / BSD / i386 */
-
-#if defined (linux) && defined (__mc68000__)
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define FAST_UNALIGNED_READS
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#endif /* linux/m68k */
-
-#ifdef sgi
-
-#define IMAGE_BYTE_ORDER MSBFirst
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-#define AVOID_MEMORY_READ
-#define FAST_CONSTANT_OFFSET_MODE
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-
-#endif
-
-/* linux on the Compaq Itsy */
-#if defined(linux) && defined(__arm__)
-#define IMAGE_BYTE_ORDER LSBFirst
-#define BITMAP_BIT_ORDER LSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-#endif
-
-/* size of buffer to use with GetImage, measured in bytes. There's obviously
- * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
- * you) used and the number of times the ddx routine has to be called.
- */
-#ifndef IMAGE_BUFSIZE
-#define IMAGE_BUFSIZE (64*1024)
-#endif
-
-/* pad scanline to a longword */
-#ifndef BITMAP_SCANLINE_UNIT
-#define BITMAP_SCANLINE_UNIT 32
-#endif
-
-#ifndef BITMAP_SCANLINE_PAD
-#define BITMAP_SCANLINE_PAD 32
-#define LOG2_BITMAP_PAD 5
-#define LOG2_BYTES_PER_SCANLINE_PAD 2
-#endif
-
-/*
- * This returns the number of padding units, for depth d and width w.
- * For bitmaps this can be calculated with the macros above.
- * Other depths require either grovelling over the formats field of the
- * screenInfo or hardwired constants.
- */
-
-typedef struct _PaddingInfo {
- int padRoundUp; /* pixels per pad unit - 1 */
- int padPixelsLog2; /* log 2 (pixels per pad unit) */
- int padBytesLog2; /* log 2 (bytes per pad unit) */
- int notPower2; /* bitsPerPixel not a power of 2 */
- int bytesPerPixel; /* only set when notPower2 is TRUE */
- int bitsPerPixel; /* bits per pixel */
-} PaddingInfo;
-extern PaddingInfo PixmapWidthPaddingInfo[];
-
-/* The only portable way to get the bpp from the depth is to look it up */
-#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
-
-#define PixmapWidthInPadUnits(w, d) \
- (PixmapWidthPaddingInfo[d].notPower2 ? \
- (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
- PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
- PixmapWidthPaddingInfo[d].padBytesLog2) : \
- ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
- PixmapWidthPaddingInfo[d].padPixelsLog2))
-
-/*
- * Return the number of bytes to which a scanline of the given
- * depth and width will be padded.
- */
-#define PixmapBytePad(w, d) \
- (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
-
-#define BitmapBytePad(w) \
- (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
-
-#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
-#define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
-#define BitmapBytePadProto(w) BitmapBytePad(w)
-
-#endif /* SERVERMD_H */
diff --git a/include/site.h b/include/site.h
deleted file mode 100644
index 1c272fc3f..000000000
--- a/include/site.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* $Xorg: site.h,v 1.6 2001/02/09 02:05:16 xorgcvs Exp $ */
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/include/site.h,v 1.9 2003/09/09 03:20:41 dawes Exp $ */
-
-#ifndef SITE_H
-#define SITE_H
-/*
- * The vendor string identifies the vendor responsible for the
- * server executable.
- */
-#ifndef VENDOR_STRING
-#define VENDOR_STRING "The X.Org Group"
-#endif
-
-/*
- * The vendor release number identifies, for the purpose of submitting
- * traceable bug reports, the release number of software produced
- * by the vendor.
- */
-#ifndef VENDOR_RELEASE
-#define VENDOR_RELEASE 6600
-#endif
-
-/*
- * The following constants are provided solely as a last line of defense. The
- * normal build ALWAYS overrides them using a special rule given in
- * server/dix/Imakefile. If you want to change either of these constants,
- * you should set the DefaultFontPath or DefaultRGBDatabase configuration
- * parameters.
- * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE!
- */
-#ifndef COMPILEDDEFAULTFONTPATH
-#define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/"
-#endif
-#ifndef RGB_DB
-#define RGB_DB "/usr/lib/X11/rgb"
-#endif
-
-/*
- * The following constants contain default values for all of the variables
- * that can be initialized on the server command line or in the environment.
- */
-#define COMPILEDDEFAULTFONT "fixed"
-#define COMPILEDCURSORFONT "cursor"
-#ifndef COMPILEDDISPLAYCLASS
-#define COMPILEDDISPLAYCLASS "MIT-unspecified"
-#endif
-#define DEFAULT_TIMEOUT 60 /* seconds */
-#define DEFAULT_KEYBOARD_CLICK 0
-#define DEFAULT_BELL 50
-#define DEFAULT_BELL_PITCH 400
-#define DEFAULT_BELL_DURATION 100
-#ifdef XKB
-#define DEFAULT_AUTOREPEAT TRUE
-#else
-#define DEFAULT_AUTOREPEAT FALSE
-#endif
-#define DEFAULT_AUTOREPEATS {\
- 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
-
-#define DEFAULT_LEDS 0x0 /* all off */
-#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
-#define DEFAULT_INT_RESOLUTION 1000
-#define DEFAULT_INT_MIN_VALUE 0
-#define DEFAULT_INT_MAX_VALUE 100
-#define DEFAULT_INT_DISPLAYED 0
-
-#define DEFAULT_PTR_NUMERATOR 2
-#define DEFAULT_PTR_DENOMINATOR 1
-#define DEFAULT_PTR_THRESHOLD 4
-
-#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000))
-#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000))
-#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking
-#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures
-#ifndef NOLOGOHACK
-#define DEFAULT_LOGO_SCREEN_SAVER 1
-#endif
-#ifndef DEFAULT_ACCESS_CONTROL
-#define DEFAULT_ACCESS_CONTROL TRUE
-#endif
-
-/* Default logging parameters. */
-#ifndef DEFAULT_LOG_VERBOSITY
-#define DEFAULT_LOG_VERBOSITY 0
-#endif
-#ifndef DEFAULT_LOG_FILE_VERBOSITY
-#define DEFAULT_LOG_FILE_VERBOSITY 3
-#endif
-
-#endif /* SITE_H */
diff --git a/include/swaprep.h b/include/swaprep.h
deleted file mode 100644
index b6671e7d9..000000000
--- a/include/swaprep.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/swaprep.h,v 3.1 2003/04/27 21:31:05 herrb Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SWAPREP_H
-#define SWAPREP_H 1
-
-extern void Swap32Write(
- ClientPtr /* pClient */,
- int /* size */,
- CARD32 * /* pbuf */);
-
-extern void CopySwap32Write(
- ClientPtr /* pClient */,
- int /* size */,
- CARD32 * /* pbuf */);
-
-extern void CopySwap16Write(
- ClientPtr /* pClient */,
- int /* size */,
- short * /* pbuf */);
-
-extern void SGenericReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGenericReply * /* pRep */);
-
-extern void SGetWindowAttributesReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetWindowAttributesReply * /* pRep */);
-
-extern void SGetGeometryReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetGeometryReply * /* pRep */);
-
-extern void SQueryTreeReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryTreeReply * /* pRep */);
-
-extern void SInternAtomReply(
- ClientPtr /* pClient */,
- int /* size */,
- xInternAtomReply * /* pRep */);
-
-extern void SGetAtomNameReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetAtomNameReply * /* pRep */);
-
-extern void SGetPropertyReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetPropertyReply * /* pRep */);
-
-extern void SListPropertiesReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListPropertiesReply * /* pRep */);
-
-extern void SGetSelectionOwnerReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetSelectionOwnerReply * /* pRep */);
-
-extern void SQueryPointerReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryPointerReply * /* pRep */);
-
-extern void SwapTimecoord(
- xTimecoord * /* pCoord */);
-
-extern void SwapTimeCoordWrite(
- ClientPtr /* pClient */,
- int /* size */,
- xTimecoord * /* pRep */);
-
-extern void SGetMotionEventsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetMotionEventsReply * /* pRep */);
-
-extern void STranslateCoordsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xTranslateCoordsReply * /* pRep */);
-
-extern void SGetInputFocusReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetInputFocusReply * /* pRep */);
-
-extern void SQueryKeymapReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryKeymapReply * /* pRep */);
-
-#ifdef LBX
-extern void SwapCharInfo(
- xCharInfo * /* pInfo */);
-#endif
-
-#ifdef LBX
-extern void SwapFont(
- xQueryFontReply * /* pr */,
- Bool /* hasGlyphs */);
-#endif
-
-extern void SQueryFontReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryFontReply * /* pRep */);
-
-extern void SQueryTextExtentsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryTextExtentsReply * /* pRep */);
-
-extern void SListFontsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListFontsReply * /* pRep */);
-
-extern void SListFontsWithInfoReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListFontsWithInfoReply * /* pRep */);
-
-extern void SGetFontPathReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetFontPathReply * /* pRep */);
-
-extern void SGetImageReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetImageReply * /* pRep */);
-
-extern void SListInstalledColormapsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListInstalledColormapsReply * /* pRep */);
-
-extern void SAllocColorReply(
- ClientPtr /* pClient */,
- int /* size */,
- xAllocColorReply * /* pRep */);
-
-extern void SAllocNamedColorReply(
- ClientPtr /* pClient */,
- int /* size */,
- xAllocNamedColorReply * /* pRep */);
-
-extern void SAllocColorCellsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xAllocColorCellsReply * /* pRep */);
-
-extern void SAllocColorPlanesReply(
- ClientPtr /* pClient */,
- int /* size */,
- xAllocColorPlanesReply * /* pRep */);
-
-extern void SwapRGB(
- xrgb * /* prgb */);
-
-extern void SQColorsExtend(
- ClientPtr /* pClient */,
- int /* size */,
- xrgb * /* prgb */);
-
-extern void SQueryColorsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryColorsReply * /* pRep */);
-
-extern void SLookupColorReply(
- ClientPtr /* pClient */,
- int /* size */,
- xLookupColorReply * /* pRep */);
-
-extern void SQueryBestSizeReply(
- ClientPtr /* pClient */,
- int /* size */,
- xQueryBestSizeReply * /* pRep */);
-
-extern void SListExtensionsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListExtensionsReply * /* pRep */);
-
-extern void SGetKeyboardMappingReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetKeyboardMappingReply * /* pRep */);
-
-extern void SGetPointerMappingReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetPointerMappingReply * /* pRep */);
-
-extern void SGetModifierMappingReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetModifierMappingReply * /* pRep */);
-
-extern void SGetKeyboardControlReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetKeyboardControlReply * /* pRep */);
-
-extern void SGetPointerControlReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetPointerControlReply * /* pRep */);
-
-extern void SGetScreenSaverReply(
- ClientPtr /* pClient */,
- int /* size */,
- xGetScreenSaverReply * /* pRep */);
-
-extern void SLHostsExtend(
- ClientPtr /* pClient */,
- int /* size */,
- char * /* buf */);
-
-extern void SListHostsReply(
- ClientPtr /* pClient */,
- int /* size */,
- xListHostsReply * /* pRep */);
-
-extern void SErrorEvent(
- xError * /* from */,
- xError * /* to */);
-
-extern void SwapConnSetupInfo(
- char * /* pInfo */,
- char * /* pInfoTBase */);
-
-extern void WriteSConnectionInfo(
- ClientPtr /* pClient */,
- unsigned long /* size */,
- char * /* pInfo */);
-
-extern void SwapConnSetup(
- xConnSetup * /* pConnSetup */,
- xConnSetup * /* pConnSetupT */);
-
-extern void SwapWinRoot(
- xWindowRoot * /* pRoot */,
- xWindowRoot * /* pRootT */);
-
-extern void SwapVisual(
- xVisualType * /* pVis */,
- xVisualType * /* pVisT */);
-
-extern void SwapConnSetupPrefix(
- xConnSetupPrefix * /* pcspFrom */,
- xConnSetupPrefix * /* pcspTo */);
-
-extern void WriteSConnSetupPrefix(
- ClientPtr /* pClient */,
- xConnSetupPrefix * /* pcsp */);
-
-#undef SWAPREP_PROC
-#define SWAPREP_PROC(func) void func(xEvent * /* from */, xEvent * /* to */)
-
-SWAPREP_PROC(SCirculateEvent);
-SWAPREP_PROC(SClientMessageEvent);
-SWAPREP_PROC(SColormapEvent);
-SWAPREP_PROC(SConfigureNotifyEvent);
-SWAPREP_PROC(SConfigureRequestEvent);
-SWAPREP_PROC(SCreateNotifyEvent);
-SWAPREP_PROC(SDestroyNotifyEvent);
-SWAPREP_PROC(SEnterLeaveEvent);
-SWAPREP_PROC(SExposeEvent);
-SWAPREP_PROC(SFocusEvent);
-SWAPREP_PROC(SGraphicsExposureEvent);
-SWAPREP_PROC(SGravityEvent);
-SWAPREP_PROC(SKeyButtonPtrEvent);
-SWAPREP_PROC(SKeymapNotifyEvent);
-SWAPREP_PROC(SMapNotifyEvent);
-SWAPREP_PROC(SMapRequestEvent);
-SWAPREP_PROC(SMappingEvent);
-SWAPREP_PROC(SNoExposureEvent);
-SWAPREP_PROC(SPropertyEvent);
-SWAPREP_PROC(SReparentEvent);
-SWAPREP_PROC(SResizeRequestEvent);
-SWAPREP_PROC(SSelectionClearEvent);
-SWAPREP_PROC(SSelectionNotifyEvent);
-SWAPREP_PROC(SSelectionRequestEvent);
-SWAPREP_PROC(SUnmapNotifyEvent);
-SWAPREP_PROC(SVisibilityEvent);
-
-#undef SWAPREP_PROC
-
-#endif /* SWAPREP_H */
diff --git a/include/swapreq.h b/include/swapreq.h
deleted file mode 100644
index 59ba8c5be..000000000
--- a/include/swapreq.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* $XFree86: xc/programs/Xserver/include/swapreq.h,v 1.4 2003/11/17 22:20:43 dawes Exp $ */
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-#ifndef SWAPREQ_H
-#define SWAPREQ_H 1
-
-/* The first two are in misc.h */
-#if 0
-extern void SwapLongs (
- CARD32 * /* list */,
- unsigned long /* count */);
-
-extern void SwapShorts (
- short * /* list */,
- unsigned long /* count */);
-#endif
-
-extern void SwapColorItem(
- xColorItem * /* pItem */);
-
-extern void SwapConnClientPrefix(
- xConnClientPrefix * /* pCCP */);
-
-#undef SWAPREQ_PROC
-
-#define SWAPREQ_PROC(func) int func(ClientPtr /* client */)
-
-SWAPREQ_PROC(SProcAllocColor);
-SWAPREQ_PROC(SProcAllocColorCells);
-SWAPREQ_PROC(SProcAllocColorPlanes);
-SWAPREQ_PROC(SProcAllocNamedColor);
-SWAPREQ_PROC(SProcChangeActivePointerGrab);
-SWAPREQ_PROC(SProcChangeGC);
-SWAPREQ_PROC(SProcChangeHosts);
-SWAPREQ_PROC(SProcChangeKeyboardControl);
-SWAPREQ_PROC(SProcChangeKeyboardMapping);
-SWAPREQ_PROC(SProcChangePointerControl);
-SWAPREQ_PROC(SProcChangeProperty);
-SWAPREQ_PROC(SProcChangeWindowAttributes);
-SWAPREQ_PROC(SProcClearToBackground);
-SWAPREQ_PROC(SProcConfigureWindow);
-SWAPREQ_PROC(SProcConvertSelection);
-SWAPREQ_PROC(SProcCopyArea);
-SWAPREQ_PROC(SProcCopyColormapAndFree);
-SWAPREQ_PROC(SProcCopyGC);
-SWAPREQ_PROC(SProcCopyPlane);
-SWAPREQ_PROC(SProcCreateColormap);
-SWAPREQ_PROC(SProcCreateCursor);
-SWAPREQ_PROC(SProcCreateGC);
-SWAPREQ_PROC(SProcCreateGlyphCursor);
-SWAPREQ_PROC(SProcCreatePixmap);
-SWAPREQ_PROC(SProcCreateWindow);
-SWAPREQ_PROC(SProcDeleteProperty);
-SWAPREQ_PROC(SProcFillPoly);
-SWAPREQ_PROC(SProcFreeColors);
-SWAPREQ_PROC(SProcGetImage);
-SWAPREQ_PROC(SProcGetMotionEvents);
-SWAPREQ_PROC(SProcGetProperty);
-SWAPREQ_PROC(SProcGrabButton);
-SWAPREQ_PROC(SProcGrabKey);
-SWAPREQ_PROC(SProcGrabKeyboard);
-SWAPREQ_PROC(SProcGrabPointer);
-SWAPREQ_PROC(SProcImageText);
-SWAPREQ_PROC(SProcInternAtom);
-SWAPREQ_PROC(SProcListFonts);
-SWAPREQ_PROC(SProcListFontsWithInfo);
-SWAPREQ_PROC(SProcLookupColor);
-SWAPREQ_PROC(SProcNoOperation);
-SWAPREQ_PROC(SProcOpenFont);
-SWAPREQ_PROC(SProcPoly);
-SWAPREQ_PROC(SProcPolyText);
-SWAPREQ_PROC(SProcPutImage);
-SWAPREQ_PROC(SProcQueryBestSize);
-SWAPREQ_PROC(SProcQueryColors);
-SWAPREQ_PROC(SProcQueryExtension);
-SWAPREQ_PROC(SProcRecolorCursor);
-SWAPREQ_PROC(SProcReparentWindow);
-SWAPREQ_PROC(SProcResourceReq);
-SWAPREQ_PROC(SProcRotateProperties);
-SWAPREQ_PROC(SProcSendEvent);
-SWAPREQ_PROC(SProcSetClipRectangles);
-SWAPREQ_PROC(SProcSetDashes);
-SWAPREQ_PROC(SProcSetFontPath);
-SWAPREQ_PROC(SProcSetInputFocus);
-SWAPREQ_PROC(SProcSetScreenSaver);
-SWAPREQ_PROC(SProcSetSelectionOwner);
-SWAPREQ_PROC(SProcSimpleReq);
-SWAPREQ_PROC(SProcStoreColors);
-SWAPREQ_PROC(SProcStoreNamedColor);
-SWAPREQ_PROC(SProcTranslateCoords);
-SWAPREQ_PROC(SProcUngrabButton);
-SWAPREQ_PROC(SProcUngrabKey);
-SWAPREQ_PROC(SProcWarpPointer);
-
-#undef SWAPREQ_PROC
-
-#endif /* SWAPREQ_H */
diff --git a/include/validate.h b/include/validate.h
deleted file mode 100644
index 2a13962a7..000000000
--- a/include/validate.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $Xorg: validate.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/include/validate.h,v 1.5 2001/12/14 19:59:56 dawes Exp $ */
-
-#ifndef VALIDATE_H
-#define VALIDATE_H
-
-#include "miscstruct.h"
-#include "regionstr.h"
-
-typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind;
-
-/* union _Validate is now device dependent; see mivalidate.h for an example */
-typedef union _Validate *ValidatePtr;
-
-#define UnmapValData ((ValidatePtr)1)
-
-#endif /* VALIDATE_H */
diff --git a/include/window.h b/include/window.h
deleted file mode 100644
index 0c886559e..000000000
--- a/include/window.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/* $Xorg: window.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/window.h,v 1.6 2003/11/03 05:36:35 tsi Exp $ */
-
-#ifndef WINDOW_H
-#define WINDOW_H
-
-#include "misc.h"
-#include "region.h"
-#include "screenint.h"
-#include "X11/Xproto.h"
-
-#define TOTALLY_OBSCURED 0
-#define UNOBSCURED 1
-#define OBSCURED 2
-
-#define VisibilityNotViewable 3
-
-/* return values for tree-walking callback procedures */
-#define WT_STOPWALKING 0
-#define WT_WALKCHILDREN 1
-#define WT_DONTWALKCHILDREN 2
-#define WT_NOMATCH 3
-#define NullWindow ((WindowPtr) 0)
-
-typedef struct _BackingStore *BackingStorePtr;
-typedef struct _Window *WindowPtr;
-
-typedef int (*VisitWindowProcPtr)(
- WindowPtr /*pWin*/,
- pointer /*data*/);
-
-extern int TraverseTree(
- WindowPtr /*pWin*/,
- VisitWindowProcPtr /*func*/,
- pointer /*data*/);
-
-extern int WalkTree(
- ScreenPtr /*pScreen*/,
- VisitWindowProcPtr /*func*/,
- pointer /*data*/);
-
-extern WindowPtr AllocateWindow(
- ScreenPtr /*pScreen*/);
-
-extern Bool CreateRootWindow(
- ScreenPtr /*pScreen*/);
-
-extern void InitRootWindow(
- WindowPtr /*pWin*/);
-
-extern void ClippedRegionFromBox(
- WindowPtr /*pWin*/,
- RegionPtr /*Rgn*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/);
-
-extern WindowPtr RealChildHead(
- WindowPtr /*pWin*/);
-
-extern WindowPtr CreateWindow(
- Window /*wid*/,
- WindowPtr /*pParent*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*w*/,
- unsigned int /*h*/,
- unsigned int /*bw*/,
- unsigned int /*class*/,
- Mask /*vmask*/,
- XID* /*vlist*/,
- int /*depth*/,
- ClientPtr /*client*/,
- VisualID /*visual*/,
- int* /*error*/);
-
-extern int DeleteWindow(
- pointer /*pWin*/,
- XID /*wid*/);
-
-extern void DestroySubwindows(
- WindowPtr /*pWin*/,
- ClientPtr /*client*/);
-
-/* Quartz support on Mac OS X uses the HIToolbox
- framework whose ChangeWindowAttributes function conflicts here. */
-#ifdef __DARWIN__
-#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
-#endif
-extern int ChangeWindowAttributes(
- WindowPtr /*pWin*/,
- Mask /*vmask*/,
- XID* /*vlist*/,
- ClientPtr /*client*/);
-
-/* Quartz support on Mac OS X uses the HIToolbox
- framework whose GetWindowAttributes function conflicts here. */
-#ifdef __DARWIN__
-#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
-extern void Darwin_X_GetWindowAttributes(
-#else
-extern void GetWindowAttributes(
-#endif
- WindowPtr /*pWin*/,
- ClientPtr /*client*/,
- xGetWindowAttributesReply* /* wa */);
-
-extern RegionPtr CreateUnclippedWinSize(
- WindowPtr /*pWin*/);
-
-extern void GravityTranslate(
- int /*x*/,
- int /*y*/,
- int /*oldx*/,
- int /*oldy*/,
- int /*dw*/,
- int /*dh*/,
- unsigned /*gravity*/,
- int* /*destx*/,
- int* /*desty*/);
-
-extern int ConfigureWindow(
- WindowPtr /*pWin*/,
- Mask /*mask*/,
- XID* /*vlist*/,
- ClientPtr /*client*/);
-
-extern int CirculateWindow(
- WindowPtr /*pParent*/,
- int /*direction*/,
- ClientPtr /*client*/);
-
-extern int ReparentWindow(
- WindowPtr /*pWin*/,
- WindowPtr /*pParent*/,
- int /*x*/,
- int /*y*/,
- ClientPtr /*client*/);
-
-extern int MapWindow(
- WindowPtr /*pWin*/,
- ClientPtr /*client*/);
-
-extern void MapSubwindows(
- WindowPtr /*pParent*/,
- ClientPtr /*client*/);
-
-extern int UnmapWindow(
- WindowPtr /*pWin*/,
- Bool /*fromConfigure*/);
-
-extern void UnmapSubwindows(
- WindowPtr /*pWin*/);
-
-extern void HandleSaveSet(
- ClientPtr /*client*/);
-
-extern Bool VisibleBoundingBoxFromPoint(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- BoxPtr /*box*/);
-
-extern Bool PointInWindowIsVisible(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/);
-
-extern RegionPtr NotClippedByChildren(
- WindowPtr /*pWin*/);
-
-extern void SendVisibilityNotify(
- WindowPtr /*pWin*/);
-
-extern void SaveScreens(
- int /*on*/,
- int /*mode*/);
-
-extern WindowPtr FindWindowWithOptional(
- WindowPtr /*w*/);
-
-extern void CheckWindowOptionalNeed(
- WindowPtr /*w*/);
-
-extern Bool MakeWindowOptional(
- WindowPtr /*pWin*/);
-
-extern void DisposeWindowOptional(
- WindowPtr /*pWin*/);
-
-extern WindowPtr MoveWindowInStack(
- WindowPtr /*pWin*/,
- WindowPtr /*pNextSib*/);
-
-void SetWinSize(
- WindowPtr /*pWin*/);
-
-void SetBorderSize(
- WindowPtr /*pWin*/);
-
-void ResizeChildrenWinSize(
- WindowPtr /*pWin*/,
- int /*dx*/,
- int /*dy*/,
- int /*dw*/,
- int /*dh*/);
-
-#endif /* WINDOW_H */
diff --git a/include/windowstr.h b/include/windowstr.h
deleted file mode 100644
index 2dce443d3..000000000
--- a/include/windowstr.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/* $Xorg: windowstr.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/include/windowstr.h,v 1.7 2003/04/27 21:31:05 herrb Exp $ */
-
-#ifndef WINDOWSTRUCT_H
-#define WINDOWSTRUCT_H
-
-#include "window.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "cursor.h"
-#include "property.h"
-#include "resource.h" /* for ROOT_WINDOW_ID_BASE */
-#include "dix.h"
-#include "miscstruct.h"
-#include "X11/Xprotostr.h"
-#include "opaque.h"
-
-#define GuaranteeNothing 0
-#define GuaranteeVisBack 1
-
-#define SameBackground(as, a, bs, b) \
- ((as) == (bs) && ((as) == None || \
- (as) == ParentRelative || \
- SamePixUnion(a,b,as == BackgroundPixel)))
-
-#define SameBorder(as, a, bs, b) \
- EqualPixUnion(as, a, bs, b)
-
-typedef struct _WindowOpt {
- VisualID visual; /* default: same as parent */
- CursorPtr cursor; /* default: window.cursorNone */
- Colormap colormap; /* default: same as parent */
- Mask dontPropagateMask; /* default: window.dontPropagate */
- Mask otherEventMasks; /* default: 0 */
- struct _OtherClients *otherClients; /* default: NULL */
- struct _GrabRec *passiveGrabs; /* default: NULL */
- PropertyPtr userProps; /* default: NULL */
- unsigned long backingBitPlanes; /* default: ~0L */
- unsigned long backingPixel; /* default: 0 */
-#ifdef SHAPE
- RegionPtr boundingShape; /* default: NULL */
- RegionPtr clipShape; /* default: NULL */
-#endif
-#ifdef XINPUT
- struct _OtherInputMasks *inputMasks; /* default: NULL */
-#endif
-} WindowOptRec, *WindowOptPtr;
-
-#define BackgroundPixel 2L
-#define BackgroundPixmap 3L
-
-typedef struct _Window {
- DrawableRec drawable;
- WindowPtr parent; /* ancestor chain */
- WindowPtr nextSib; /* next lower sibling */
- WindowPtr prevSib; /* next higher sibling */
- WindowPtr firstChild; /* top-most child */
- WindowPtr lastChild; /* bottom-most child */
- RegionRec clipList; /* clipping rectangle for output */
- RegionRec borderClip; /* NotClippedByChildren + border */
- union _Validate *valdata;
- RegionRec winSize;
- RegionRec borderSize;
- DDXPointRec origin; /* position relative to parent */
- unsigned short borderWidth;
- unsigned short deliverableEvents;
- Mask eventMask;
- PixUnion background;
- PixUnion border;
- pointer backStorage; /* null when BS disabled */
- WindowOptPtr optional;
- unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */
- unsigned borderIsPixel:1;
- unsigned cursorIsNone:1; /* else real cursor (might inherit) */
- unsigned backingStore:2;
- unsigned saveUnder:1;
- unsigned DIXsaveUnder:1;
- unsigned bitGravity:4;
- unsigned winGravity:4;
- unsigned overrideRedirect:1;
- unsigned visibility:2;
- unsigned mapped:1;
- unsigned realized:1; /* ancestors are all mapped */
- unsigned viewable:1; /* realized && InputOutput */
- unsigned dontPropagate:3;/* index into DontPropagateMasks */
- unsigned forcedBS:1; /* system-supplied backingStore */
-#ifdef NEED_DBE_BUF_BITS
-#define DBE_FRONT_BUFFER 1
-#define DBE_BACK_BUFFER 0
- unsigned dstBuffer:1; /* destination buffer for rendering */
- unsigned srcBuffer:1; /* source buffer for rendering */
-#endif
- DevUnion *devPrivates;
-} WindowRec;
-
-/*
- * Ok, a bunch of macros for accessing the optional record
- * fields (or filling the appropriate default value)
- */
-
-extern Mask DontPropagateMasks[];
-
-#define wTrackParent(w,field) ((w)->optional ? \
- (w)->optional->field \
- : FindWindowWithOptional(w)->optional->field)
-#define wUseDefault(w,field,def) ((w)->optional ? \
- (w)->optional->field \
- : def)
-
-#define wVisual(w) wTrackParent(w, visual)
-#define wCursor(w) ((w)->cursorIsNone ? None : wTrackParent(w, cursor))
-#define wColormap(w) ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap))
-#define wDontPropagateMask(w) wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate])
-#define wOtherEventMasks(w) wUseDefault(w, otherEventMasks, 0)
-#define wOtherClients(w) wUseDefault(w, otherClients, NULL)
-#ifdef XINPUT
-#define wOtherInputMasks(w) wUseDefault(w, inputMasks, NULL)
-#else
-#define wOtherInputMasks(w) NULL
-#endif
-#define wPassiveGrabs(w) wUseDefault(w, passiveGrabs, NULL)
-#define wUserProps(w) wUseDefault(w, userProps, NULL)
-#define wBackingBitPlanes(w) wUseDefault(w, backingBitPlanes, ~0L)
-#define wBackingPixel(w) wUseDefault(w, backingPixel, 0)
-#ifdef SHAPE
-#define wBoundingShape(w) wUseDefault(w, boundingShape, NULL)
-#define wClipShape(w) wUseDefault(w, clipShape, NULL)
-#endif
-#define wClient(w) (clients[CLIENT_ID((w)->drawable.id)])
-#define wBorderWidth(w) ((int) (w)->borderWidth)
-
-/* true when w needs a border drawn. */
-
-#ifdef SHAPE
-#define HasBorder(w) ((w)->borderWidth || wClipShape(w))
-#else
-#define HasBorder(w) ((w)->borderWidth)
-#endif
-
-typedef struct _ScreenSaverStuff {
- WindowPtr pWindow;
- XID wid;
- char blanked;
- Bool (*ExternalScreenSaver)(
- ScreenPtr /*pScreen*/,
- int /*xstate*/,
- Bool /*force*/);
-} ScreenSaverStuffRec, *ScreenSaverStuffPtr;
-
-#define SCREEN_IS_BLANKED 0
-#define SCREEN_ISNT_SAVED 1
-#define SCREEN_IS_TILED 2
-#define SCREEN_IS_BLACK 3
-
-#define HasSaverWindow(i) (savedScreenInfo[i].pWindow != NullWindow)
-
-extern int screenIsSaved;
-extern ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
-
-/*
- * this is the configuration parameter "NO_BACK_SAVE"
- * it means that any existant backing store should not
- * be used to implement save unders.
- */
-
-#ifndef NO_BACK_SAVE
-#define DO_SAVE_UNDERS(pWin) ((pWin)->drawable.pScreen->saveUnderSupport ==\
- USE_DIX_SAVE_UNDERS)
-/*
- * saveUnderSupport is set to this magic value when using DIXsaveUnders
- */
-
-#define USE_DIX_SAVE_UNDERS 0x40
-#endif
-
-extern int numSaveUndersViewable;
-extern int deltaSaveUndersViewable;
-
-#endif /* WINDOWSTRUCT_H */
diff --git a/iplan2p4/ipl.h b/iplan2p4/ipl.h
deleted file mode 100644
index bdc1682f5..000000000
--- a/iplan2p4/ipl.h
+++ /dev/null
@@ -1,1250 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/ipl.h,v 3.6 2003/11/17 22:20:43 dawes Exp $ */
-/* $XConsortium: ipl.h,v 5.37 94/04/17 20:28:38 dpw Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "pixmap.h"
-#include "region.h"
-#include "gc.h"
-#include "colormap.h"
-#include "miscstruct.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "mfb.h"
-#undef PixelType
-
-#include "iplmap.h"
-
-/*
- private filed of pixmap
- pixmap.devPrivate = (unsigned int *)pointer_to_bits
- pixmap.devKind = width_of_pixmap_in_bytes
-*/
-
-extern int iplGCPrivateIndex;
-extern int iplWindowPrivateIndex;
-
-/* private field of GC */
-typedef struct {
- unsigned char rop; /* special case rop values */
- /* next two values unused in ipl, included for compatibility with mfb */
- unsigned char ropOpStip; /* rop for opaque stipple */
- /* this value is ropFillArea in mfb, usurped for ipl */
- unsigned char oneRect; /* drawable has one clip rect */
- unsigned long xor, and; /* reduced rop values */
- unsigned short xorg[INTER_PLANES],andg[INTER_PLANES];
- } iplPrivGC;
-
-typedef iplPrivGC *iplPrivGCPtr;
-
-#define iplGetGCPrivate(pGC) ((iplPrivGCPtr)\
- (pGC)->devPrivates[iplGCPrivateIndex].ptr)
-
-#define iplGetCompositeClip(pGC) ((pGC)->pCompositeClip)
-
-/* way to carry RROP info around */
-typedef struct {
- unsigned char rop;
- unsigned long xor, and;
- unsigned short xorg[INTER_PLANES],andg[INTER_PLANES];
-} iplRRopRec, *iplRRopPtr;
-
-/* private field of window */
-typedef struct {
- unsigned char fastBorder; /* non-zero if border is 32 bits wide */
- unsigned char fastBackground;
- unsigned short unused; /* pad for alignment with Sun compiler */
- DDXPointRec oldRotate;
- PixmapPtr pRotatedBackground;
- PixmapPtr pRotatedBorder;
- } iplPrivWin;
-
-#define iplGetWindowPrivate(_pWin) ((iplPrivWin *)\
- (_pWin)->devPrivates[iplWindowPrivateIndex].ptr)
-
-
-/* ipl8bit.c */
-
-extern int iplSetStipple(
- int /*alu*/,
- unsigned long /*fg*/,
- unsigned long /*planemask*/
-);
-
-extern int iplSetOpaqueStipple(
- int /*alu*/,
- unsigned long /*fg*/,
- unsigned long /*bg*/,
- unsigned long /*planemask*/
-);
-
-extern int iplComputeClipMasks32(
- BoxPtr /*pBox*/,
- int /*numRects*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- CARD32 * /*clips*/
-);
-/* ipl8cppl.c */
-
-extern void iplCopyImagePlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-extern void iplCopyPlane8to1(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-/* ipl8lineCO.c */
-
-extern int ipl8LineSS1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void ipl8LineSS1Rect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void ipl8ClippedLineCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* ipl8lineCP.c */
-
-extern int ipl8LineSS1RectPreviousCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-/* ipl8lineG.c */
-
-extern int ipl8LineSS1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void ipl8ClippedLineGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* ipl8lineX.c */
-
-extern int ipl8LineSS1RectXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/,
- DDXPointPtr /*pptInitOrig*/,
- int * /*x1p*/,
- int * /*y1p*/,
- int * /*x2p*/,
- int * /*y2p*/
-);
-
-extern void ipl8ClippedLineXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x1*/,
- int /*y1*/,
- int /*x2*/,
- int /*y2*/,
- BoxPtr /*boxp*/,
- Bool /*shorten*/
-);
-/* ipl8segC.c */
-
-extern int ipl8SegmentSS1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* ipl8segCS.c */
-
-extern int ipl8SegmentSS1RectShiftCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-
-extern void ipl8SegmentSS1Rect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* ipl8segG.c */
-
-extern int ipl8SegmentSS1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* iplsegX.c */
-
-extern int ipl8SegmentSS1RectXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegInit*/
-);
-/* iplallpriv.c */
-
-extern Bool iplAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*window_index*/,
- int * /*gc_index*/
-);
-/* iplbitblt.c */
-
-extern RegionPtr iplBitBlt(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (* /*doBitBlt*/)(),
- unsigned long /*bitPlane*/
-);
-
-extern void iplDoBitblt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-
-extern RegionPtr iplCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-extern void iplCopyPlane1to8(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- int /*rop*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
-);
-
-extern RegionPtr iplCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*bitPlane*/
-);
-/* iplbltC.c */
-
-extern void iplDoBitbltCopy(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* iplbltG.c */
-
-extern void iplDoBitbltGeneral(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* iplbltO.c */
-
-extern void iplDoBitbltOr(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* iplbltX.c */
-
-extern void iplDoBitbltXor(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
-/* iplbres.c */
-
-extern void iplBresS(
- int /*rop*/,
- unsigned short * /*and*/,
- unsigned short * /*xor*/,
- unsigned short * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* iplbresd.c */
-
-extern void iplBresD(
- iplRRopPtr /*rrops*/,
- int * /*pdashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pdashOffset*/,
- int /*isDoubleDash*/,
- unsigned short * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* iplbstore.c */
-
-extern void iplSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void iplRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-/* iplcmap.c */
-
-extern int iplListInstalledColormaps(
- ScreenPtr /*pScreen*/,
- Colormap * /*pmaps*/
-);
-
-extern void iplInstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void iplUninstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void iplResolveColor(
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/,
- VisualPtr /*pVisual*/
-);
-
-extern Bool iplInitializeColormap(
- ColormapPtr /*pmap*/
-);
-
-extern int iplExpandDirectColors(
- ColormapPtr /*pmap*/,
- int /*ndef*/,
- xColorItem * /*indefs*/,
- xColorItem * /*outdefs*/
-);
-
-extern Bool iplCreateDefColormap(
- ScreenPtr /*pScreen*/
-);
-
-extern Bool iplSetVisualTypes(
- int /*depth*/,
- int /*visuals*/,
- int /*bitsPerRGB*/
-);
-
-extern Bool iplInitVisuals(
- VisualPtr * /*visualp*/,
- DepthPtr * /*depthp*/,
- int * /*nvisualp*/,
- int * /*ndepthp*/,
- int * /*rootDepthp*/,
- VisualID * /*defaultVisp*/,
- unsigned long /*sizes*/,
- int /*bitsPerRGB*/
-);
-/* iplfillarcC.c */
-
-extern void iplPolyFillArcSolidCopy(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* iplfillarcG.c */
-
-extern void iplPolyFillArcSolidGeneral(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* iplfillrct.c */
-
-extern void iplFillBoxTileOdd(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- BoxPtr /*rects*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/
-);
-
-extern void iplFillRectTileOdd(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-/* iplfillsp.c */
-
-extern void iplUnnaturalTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void iplUnnaturalStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ipl8Stipple32FS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void ipl8OpaqueStipple32FS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* iplgc.c */
-
-extern GCOpsPtr iplMatchCommon(
- GCPtr /*pGC*/,
- iplPrivGCPtr /*devPriv*/
-);
-
-extern Bool iplCreateGC(
- GCPtr /*pGC*/
-);
-
-extern void iplValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-/* iplgetsp.c */
-
-extern void iplGetSpans(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/
-);
-/* iplglblt8.c */
-
-extern void iplPolyGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* iplglrop8.c */
-
-extern void iplPolyGlyphRop8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* iplhrzvert.c */
-
-extern int iplHorzS(
- int /*rop*/,
- unsigned short * /*and*/,
- unsigned short * /*xor*/,
- unsigned short * /*addrg*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-
-extern int iplVertS(
- int /*rop*/,
- unsigned short * /*and*/,
- unsigned short * /*xor*/,
- unsigned short * /*addrg*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-/* ipligblt8.c */
-
-extern void iplImageGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* iplimage.c */
-
-extern void iplPutImage(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-extern void iplGetImage(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-/* iplline.c */
-
-extern void iplLineSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void iplLineSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-/* iplmskbits.c */
-/* iplpixmap.c */
-
-extern PixmapPtr iplCreatePixmap(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/
-);
-
-extern Bool iplDestroyPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern PixmapPtr iplCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void iplPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern void iplXRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rw*/
-);
-
-extern void iplYRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rh*/
-);
-
-extern void iplCopyRotatePixmap(
- PixmapPtr /*psrcPix*/,
- PixmapPtr * /*ppdstPix*/,
- int /*xrot*/,
- int /*yrot*/
-);
-/* iplply1rctC.c */
-
-extern void iplFillPoly1RectCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* iplply1rctG.c */
-
-extern void iplFillPoly1RectGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* iplpntwin.c */
-
-extern void iplPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*pRegion*/,
- int /*what*/
-);
-
-extern void iplFillBoxSolid(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- unsigned long /*pixel*/
-);
-
-extern void iplFillBoxTile32(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/
-);
-/* iplpolypnt.c */
-
-extern void iplPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-/* iplpush8.c */
-
-extern void iplPushPixels8(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitmap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-/* iplrctstp8.c */
-
-extern void ipl8FillRectOpaqueStippled32(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void ipl8FillRectTransparentStippled32(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void ipl8FillRectStippledUnnatural(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-/* iplrrop.c */
-
-extern int iplReduceRasterOp(
- int /*rop*/,
- unsigned long /*fg*/,
- unsigned long /*pm*/,
- unsigned short * /*andp*/,
- unsigned short * /*xorp*/
-);
-/* iplscrinit.c */
-
-extern Bool iplCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-
-extern Bool iplSetupScreen(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern int iplFinishScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern Bool iplScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern PixmapPtr iplGetScreenPixmap(
- ScreenPtr /*pScreen*/
-);
-
-extern void iplSetScreenPixmap(
- PixmapPtr /*pPix*/
-);
-
-/* iplseg.c */
-
-extern void iplSegmentSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-
-extern void iplSegmentSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-/* iplsetsp.c */
-
-extern int iplSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- unsigned int * /*psrc*/,
- int /*alu*/,
- unsigned short * /*pdstBase*/,
- int /*widthDst*/,
- unsigned long /*planemask*/
-);
-
-extern void iplSetSpans(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/
-);
-/* iplsolidC.c */
-
-extern void iplFillRectSolidCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplSolidSpansCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* iplsolidG.c */
-
-extern void iplFillRectSolidGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplSolidSpansGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* iplsolidX.c */
-
-extern void iplFillRectSolidXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplSolidSpansXor(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* iplteblt8.c */
-
-extern void iplTEGlyphBlt8(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*xInit*/,
- int /*yInit*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* ipltegblt.c */
-
-extern void iplTEGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* ipltile32C.c */
-
-extern void iplFillRectTile32Copy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplTile32FSCopy(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* ipltile32G.c */
-
-extern void iplFillRectTile32General(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nBox*/,
- BoxPtr /*pBox*/
-);
-
-extern void iplTile32FSGeneral(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* ipltileoddC.c */
-
-extern void iplFillBoxTileOddCopy(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillSpanTileOddCopy(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillBoxTile32sCopy(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillSpanTile32sCopy(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-/* ipltileoddG.c */
-
-extern void iplFillBoxTileOddGeneral(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillSpanTileOddGeneral(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillBoxTile32sGeneral(
- DrawablePtr /*pDrawable*/,
- int /*nBox*/,
- BoxPtr /*pBox*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-
-extern void iplFillSpanTile32sGeneral(
- DrawablePtr /*pDrawable*/,
- int /*n*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- PixmapPtr /*tile*/,
- int /*xrot*/,
- int /*yrot*/,
- int /*alu*/,
- unsigned long /*planemask*/
-);
-/* iplwindow.c */
-
-extern Bool iplCreateWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool iplDestroyWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool iplMapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern Bool iplPositionWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/
-);
-
-extern Bool iplUnmapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern void iplCopyWindow(
- WindowPtr /*pWin*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/
-);
-
-extern Bool iplChangeWindowAttributes(
- WindowPtr /*pWin*/,
- unsigned long /*mask*/
-);
-/* iplzerarcC.c */
-
-extern void iplZeroPolyArcSS8Copy(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* iplzerarcG.c */
-
-extern void iplZeroPolyArcSS8General(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* iplzerarcX.c */
-
-extern void iplZeroPolyArcSS8Xor(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-/* Common macros for extracting drawing information */
-
-#if (!defined(SINGLEDEPTH) && PSZ != 8) || defined(FORCE_SEPARATE_PRIVATE)
-
-#define CFB_NEED_SCREEN_PRIVATE
-
-extern int iplScreenPrivateIndex;
-#endif
-
-#define iplGetWindowPixmap(d) \
- ((* ((DrawablePtr)(d))->pScreen->GetWindowPixmap)((WindowPtr)(d)))
-
-#define iplGetTypedWidth(pDrawable,wtype) (\
- (((pDrawable)->type != DRAWABLE_PIXMAP) ? \
- (int) (iplGetWindowPixmap(pDrawable)->devKind) : \
- (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
-
-#define iplGetByteWidth(pDrawable) iplGetTypedWidth(pDrawable, unsigned char)
-
-#define iplGetPixelWidth(pDrawable) iplGetTypedWidth(pDrawable, PixelType)
-
-#define iplGetLongWidth(pDrawable) iplGetTypedWidth(pDrawable, unsigned long)
-
-#define iplGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) \
- _pPix = iplGetWindowPixmap(pDrawable); \
- else \
- _pPix = (PixmapPtr) (pDrawable); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define iplGetByteWidthAndPointer(pDrawable, width, pointer) \
- iplGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
-
-#define iplGetLongWidthAndPointer(pDrawable, width, pointer) \
- iplGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned long, unsigned long)
-
-#define iplGetPixelWidthAndPointer(pDrawable, width, pointer) \
- iplGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-#define iplGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = iplGetWindowPixmap((DrawablePtr) (pWin)); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define iplGetWindowLongWidthAndPointer(pWin, width, pointer) \
- iplGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned long, unsigned long)
-
-#define iplGetWindowByteWidthAndPointer(pWin, width, pointer) \
- iplGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char)
-
-#define iplGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \
- iplGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-/* Macros which handle a coordinate in a single register */
-
-/* Most compilers will convert divide by 65536 into a shift, if signed
- * shifts exist. If your machine does arithmetic shifts and your compiler
- * can't get it right, add to this line.
- */
-
-/* mips compiler - what a joke - it CSEs the 65536 constant into a reg
- * forcing as to use div instead of shift. Let's be explicit.
- */
-
-#if defined(mips) || defined(sparc) || defined(__alpha) || defined(__alpha__)
-#define GetHighWord(x) (((int) (x)) >> 16)
-#else
-#define GetHighWord(x) (((int) (x)) / 65536)
-#endif
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
-#define coordToInt(x,y) (((x) << 16) | (y))
-#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int) ((short) i))
-#else
-#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
-#define coordToInt(x,y) (((y) << 16) | (x))
-#define intToX(i) ((int) ((short) (i)))
-#define intToY(i) (GetHighWord(i))
-#endif
diff --git a/iplan2p4/iplallpriv.c b/iplan2p4/iplallpriv.c
deleted file mode 100644
index 57b8fce57..000000000
--- a/iplan2p4/iplallpriv.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplallpriv.c,v 3.0 1996/08/18 01:54:33 dawes Exp $ */
-/*
- * $XConsortium: iplallpriv.c,v 1.5 94/04/17 20:28:42 dpw Exp $
- *
-Copyright (c) 1991 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "ipl.h"
-#include "mi.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mibstore.h"
-
-int iplWindowPrivateIndex;
-int iplGCPrivateIndex;
-#ifdef CFB_NEED_SCREEN_PRIVATE
-int iplScreenPrivateIndex;
-#endif
-
-extern RegionPtr (*iplPuntCopyPlane)();
-
-Bool
-iplAllocatePrivates(pScreen, window_index, gc_index)
- ScreenPtr pScreen;
- int *window_index, *gc_index;
-{
- if (!window_index || !gc_index ||
- *window_index == -1 && *gc_index == -1)
- {
- if (!mfbAllocatePrivates(pScreen,
- &iplWindowPrivateIndex, &iplGCPrivateIndex))
- return FALSE;
- if (window_index)
- *window_index = iplWindowPrivateIndex;
- if (gc_index)
- *gc_index = iplGCPrivateIndex;
- }
- else
- {
- iplWindowPrivateIndex = *window_index;
- iplGCPrivateIndex = *gc_index;
- }
- if (!AllocateWindowPrivate(pScreen, iplWindowPrivateIndex,
- sizeof(iplPrivWin)) ||
- !AllocateGCPrivate(pScreen, iplGCPrivateIndex, sizeof(iplPrivGC)))
- return FALSE;
-
- iplPuntCopyPlane = miCopyPlane;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- iplScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (iplScreenPrivateIndex == -1)
- return FALSE;
-#endif
- return TRUE;
-}
diff --git a/iplan2p4/iplbitblt.c b/iplan2p4/iplbitblt.c
deleted file mode 100644
index 27470382b..000000000
--- a/iplan2p4/iplbitblt.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplbitblt.c,v 3.2 2003/11/10 18:22:45 tsi Exp $ */
-/*
- * ipl copy area
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-Author: Keith Packard
-
-*/
-/* $XConsortium: iplbitblt.c,v 5.51 94/05/27 11:00:56 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "ipl.h"
-#include "fastblt.h"
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-#include "iplmskbits.h"
-
-RegionPtr
-iplBitBlt (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, bitPlane)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- void (*doBitBlt)();
- unsigned long bitPlane;
-{
- RegionPtr prgnSrcClip; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = iplGetCompositeClip(pGC);
- }
- else
- {
- fastClip = 1;
- }
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- if (!((WindowPtr) pSrcDrawable)->parent)
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = iplGetCompositeClip(pGC);
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip)
- {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x)
- {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y)
- {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- if (!((WindowPtr)pDstDrawable)->realized)
- {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip)
- {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
-
- /* XXX because CopyPlane uses this routine for 8-to-1 bit
- * copies, this next line *must* also correctly fetch the
- * composite clip from an mfb gc
- */
-
- cclip = iplGetCompositeClip(pGC);
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst,
- &rgnDst,
- iplGetCompositeClip(pGC));
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height)
- {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane);
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose)
- {
- extern RegionPtr miHandleExposures();
-
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed =
- miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, bitPlane);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-
-void
-iplDoBitblt (pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- void (*blt)() = iplDoBitbltGeneral;
- if ((planemask & INTER_PMSK) == INTER_PMSK) {
- switch (alu) {
- case GXcopy:
- blt = iplDoBitbltCopy;
- break;
- case GXxor:
- blt = iplDoBitbltXor;
- break;
- case GXor:
- blt = iplDoBitbltOr;
- break;
- }
- }
- (*blt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask);
-}
-
-RegionPtr
-iplCopyArea(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
-{
- void (*doBitBlt) ();
-
- doBitBlt = iplDoBitbltCopy;
- if (pGC->alu != GXcopy || (pGC->planemask & INTER_PMSK) != INTER_PMSK)
- {
- doBitBlt = iplDoBitbltGeneral;
- if ((pGC->planemask & INTER_PMSK) == INTER_PMSK)
- {
- switch (pGC->alu) {
- case GXxor:
- doBitBlt = iplDoBitbltXor;
- break;
- case GXor:
- doBitBlt = iplDoBitbltOr;
- break;
- }
- }
- }
- return iplBitBlt (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, 0L);
-}
-
-/* shared among all different ipl depths through linker magic */
-RegionPtr (*iplPuntCopyPlane)();
-
-RegionPtr iplCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GCPtr pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- unsigned long bitPlane;
-{
- RegionPtr ret;
- extern RegionPtr miHandleExposures();
- void (*doBitBlt)();
-
- ret = (*iplPuntCopyPlane) (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- return ret;
-}
diff --git a/iplan2p4/iplblt.c b/iplan2p4/iplblt.c
deleted file mode 100644
index 8a48bd9da..000000000
--- a/iplan2p4/iplblt.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplblt.c,v 3.0 1996/08/18 01:54:35 dawes Exp $ */
-/*
- * ipl copy area
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-Author: Keith Packard
-
-*/
-/* $XConsortium: iplblt.c,v 1.13 94/04/17 20:28:44 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "ipl.h"
-#include "fastblt.h"
-#include "iplmergerop.h"
-#include "iplmskbits.h"
-
-void
-INTER_MROP_NAME(iplDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
-{
- INTER_DECLAREG(*psrcBase);
- INTER_DECLAREG(*pdstBase); /* start of src and dst bitmaps */
- int widthSrc, widthDst; /* add to get to same position in next line */
-
- BoxPtr pbox;
- int nbox;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int xdir; /* 1 = left right, -1 = right left/ */
- int ydir; /* 1 = top down, -1 = bottom up */
-
- INTER_DECLAREG(*psrcLine);
- INTER_DECLAREG(*pdstLine); /* pointers to line with current src and dst */
- INTER_DECLAREG(*psrc); /* pointer to current src group */
- INTER_DECLAREG(*pdst); /* pointer to current dst group */
-
- INTER_MROP_DECLARE_REG()
-
- /* following used for looping through a line */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask); /* masks for writing ends of dst */
- int ngMiddle; /* whole groups in dst */
- int xoffSrc, xoffDst;
- register int leftShift, rightShift;
- INTER_DECLAREGP(bits);
- INTER_DECLAREGP(bits1);
- INTER_DECLAREGP(bits2);
- register int ng; /* temp copy of ngMiddle */
-
- /* place to store full source word */
- int nstart; /* number of ragged bits at start of dst */
- int nend; /* number of ragged bits at end of dst */
- int srcStartOver; /* pulling nstart bits from src
- overflows into the next word? */
- int careful;
- int tmpSrc;
-
- INTER_MROP_INITIALIZE(alu,planemask);
-
- iplGetGroupWidthAndPointer (pSrc, widthSrc, psrcBase)
-
- iplGetGroupWidthAndPointer (pDst, widthDst, pdstBase)
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1))
- {
- /* walk source botttom to top */
- ydir = -1;
- widthSrc = -widthSrc;
- widthDst = -widthDst;
-
- if (nbox > 1)
- {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1)
- {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox)
- {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase)
- {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- }
- else
- {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1))
- {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1)
- {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2)
- {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase)
- {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- }
- else
- {
- /* walk source left to right */
- xdir = 1;
- }
-
- while(nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- if (ydir == -1) /* start at last scanline of rectangle */
- {
- psrcLine = psrcBase + ((pptSrc->y+h-1) * -widthSrc);
- pdstLine = pdstBase + ((pbox->y2-1) * -widthDst);
- }
- else /* start at first scanline */
- {
- psrcLine = psrcBase + (pptSrc->y * widthSrc);
- pdstLine = pdstBase + (pbox->y1 * widthDst);
- }
- if ((pbox->x1 & INTER_PIM) + w <= INTER_PPG)
- {
- INTER_maskpartialbits (pbox->x1, w, endmask);
- startmask = 0;
- ngMiddle = 0;
- }
- else
- {
- INTER_maskbits(pbox->x1, w, startmask, endmask, ngMiddle);
- }
-
- if (xdir == 1)
- {
- xoffSrc = pptSrc->x & INTER_PIM;
- xoffDst = pbox->x1 & INTER_PIM;
- pdstLine += (pbox->x1 >> INTER_PGSH) * INTER_PLANES;
- psrcLine += (pptSrc->x >> INTER_PGSH) * INTER_PLANES;
- ng = xoffSrc - xoffDst;
- if (xoffSrc == xoffDst)
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- if (startmask)
- {
- INTER_MROP_MASK(psrc, pdst, startmask, pdst);
- INTER_NEXT_GROUP(psrc);
- INTER_NEXT_GROUP(pdst);
- }
- ng = ngMiddle;
-
- DuffL(ng, label1,
- INTER_MROP_SOLID(psrc, pdst, pdst);
- INTER_NEXT_GROUP(psrc);
- INTER_NEXT_GROUP(pdst);
- )
- if (endmask)
- INTER_MROP_MASK(psrc, pdst, endmask, pdst);
- }
- }
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = xoffSrc - xoffDst;
- rightShift = (INTER_PIM+1) - leftShift;
- }
- else
- {
- rightShift = xoffDst - xoffSrc;
- leftShift = (INTER_PIM+1) - rightShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- INTER_CLR(bits);
- if (xoffSrc > xoffDst) {
- INTER_COPY(psrc, bits);
- INTER_NEXT_GROUP(psrc);
- }
- if (startmask)
- {
- INTER_GETLRC(leftShift, rightShift, psrc, bits, bits1);
- INTER_MROP_MASK(bits1, pdst, startmask, pdst);
- INTER_NEXT_GROUP(psrc);
- INTER_NEXT_GROUP(pdst);
- }
- ng = ngMiddle;
- DuffL (ng,label2,
- INTER_GETLRC(leftShift, rightShift, psrc, bits, bits1);
- INTER_MROP_SOLID(bits1, pdst, pdst);
- INTER_NEXT_GROUP(psrc);
- INTER_NEXT_GROUP(pdst);
- )
- if (endmask)
- {
- if ((endmask << rightShift) & 0xffff) {
- INTER_GETLRC(leftShift, rightShift, psrc, bits,
- bits1);
- }
- else {
- INTER_SCRLEFT(leftShift, bits, bits1);
- }
- INTER_MROP_MASK(bits1, pdst, endmask, pdst);
- }
- }
- }
- }
- else /* xdir == -1 */
- {
- xoffSrc = (pptSrc->x + w - 1) & INTER_PIM;
- xoffDst = (pbox->x2 - 1) & INTER_PIM;
- pdstLine += (((pbox->x2-1) >> INTER_PGSH) + 1) * INTER_PLANES;
- psrcLine += (((pptSrc->x+w - 1) >> INTER_PGSH) + 1) * INTER_PLANES;
- if (xoffSrc == xoffDst)
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- if (endmask)
- {
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- INTER_MROP_MASK(psrc, pdst, endmask, pdst);
- }
- ng = ngMiddle;
-
- DuffL(ng,label3,
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- INTER_MROP_SOLID(psrc, pdst, pdst);
- )
-
- if (startmask)
- {
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- INTER_MROP_MASK(psrc, pdst, startmask, pdst);
- }
- }
- }
- else
- {
- if (xoffDst > xoffSrc)
- {
- rightShift = xoffDst - xoffSrc;
- leftShift = (INTER_PIM + 1) - rightShift;
- }
- else
- {
- leftShift = xoffSrc - xoffDst;
- rightShift = (INTER_PIM + 1) - leftShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- pdstLine += widthDst;
- psrcLine += widthSrc;
- INTER_CLR(bits);
- if (xoffDst > xoffSrc) {
- INTER_PREV_GROUP(psrc);
- INTER_COPY(psrc, bits);
- }
- if (endmask)
- {
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- INTER_GETRLC(rightShift, leftShift, psrc, bits, bits1);
- INTER_MROP_MASK(bits1, pdst, endmask, pdst);
- }
- ng = ngMiddle;
- DuffL (ng, label4,
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- INTER_GETRLC(rightShift, leftShift, psrc, bits, bits1);
- INTER_MROP_SOLID(bits1, pdst, pdst);
- )
- if (startmask)
- {
- INTER_PREV_GROUP(psrc);
- INTER_PREV_GROUP(pdst);
- if ((startmask >> leftShift) & 0xffff) {
- INTER_GETRLC(rightShift, leftShift, psrc, bits,
- bits1);
- }
- else {
- INTER_SCRRIGHT(rightShift, bits, bits1);
- }
- INTER_MROP_MASK(bits1, pdst, startmask, pdst);
- }
- }
- }
- }
- pbox++;
- pptSrc++;
- }
- if (pboxNew2)
- {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
diff --git a/iplan2p4/iplbres.c b/iplan2p4/iplbres.c
deleted file mode 100644
index 9d2b571db..000000000
--- a/iplan2p4/iplbres.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplbres.c,v 3.0 1996/08/18 01:54:36 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: iplbres.c,v 1.15 94/04/17 20:28:45 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "misc.h"
-#include "ipl.h"
-#include "servermd.h"
-#include "miline.h"
-
-#include "iplmskbits.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-iplBresS(rop, andp, xorp, addrg, ngwidth, signdx, signdy, axis, x1, y1, e, e1,
- e2, len)
- int rop;
- INTER_DECLARERRAX(andp);
- INTER_DECLARERRAX(xorp);
- INTER_DECLAREG(*addrg); /* pointer to base of bitmap */
- int ngwidth; /* width in longwords of bitmap */
- register int signdx;
- int signdy; /* signs of directions */
- int axis; /* major axis (Y_AXIS or X_AXIS) */
- int x1, y1; /* initial point */
- register int e; /* error accumulator */
- register int e1; /* bresenham increments */
- int e2;
- int len; /* length of line */
-{
- register int e3 = e2-e1;
- INTER_DECLAREG(bit);
- INTER_DECLAREG(leftbit);
- INTER_DECLAREG(rightbit);
-
- /* point to longword containing first point */
- addrg = addrg + y1 * ngwidth + (x1 >> INTER_PGSH) * INTER_PLANES;
-
- if (signdy < 0)
- ngwidth = -ngwidth;
- e = e-e1; /* to make looping easier */
-
- leftbit = iplmask[0];
- rightbit = iplmask[INTER_PPG-1];
- bit = iplmask[x1 & INTER_PIM];
-
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while (len--)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, bit, addrg);
- bit = bit >> 1;
- e += e1;
- if (e >= 0)
- {
- addrg += ngwidth;
- e += e3;
- }
- if (!bit)
- {
- bit = leftbit;
- addrg += INTER_PLANES;
- }
- }
- }
- else
- {
- while (len--)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, bit, addrg);
- e += e1;
- bit = bit << 1;
- if (e >= 0)
- {
- addrg += ngwidth;
- e += e3;
- }
- if (!bit)
- {
- bit = rightbit;
- addrg -= INTER_PLANES;
- }
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, bit, addrg);
- e += e1;
- if (e >= 0)
- {
- bit = bit >> 1;
- if (!bit)
- {
- bit = leftbit;
- addrg += INTER_PLANES;
- }
- e += e3;
- }
- addrg += ngwidth;
- }
- }
- else
- {
- while(len--)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, bit, addrg);
- e += e1;
- if (e >= 0)
- {
- bit = bit << 1;
- if (!bit)
- {
- bit = rightbit;
- addrg -= INTER_PLANES;
- }
- e += e3;
- }
- addrg += ngwidth;
- }
- }
- } /* else Y_AXIS */
-}
diff --git a/iplan2p4/iplbresd.c b/iplan2p4/iplbresd.c
deleted file mode 100644
index 7cc93e90c..000000000
--- a/iplan2p4/iplbresd.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplbresd.c,v 3.0 1996/08/18 01:54:38 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: iplbresd.c,v 1.16 94/04/17 20:28:45 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "misc.h"
-#include "ipl.h"
-#include "miline.h"
-#include "iplmskbits.h"
-
-/* Dashed bresenham line */
-
-void
-iplBresD(rrops,
- pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrg, ngwidth,
- signdx, signdy, axis, x1, y1, e, e1, e2, len)
- iplRRopPtr rrops;
- int *pdashIndex; /* current dash */
- unsigned char *pDash; /* dash list */
- int numInDashList; /* total length of dash list */
- int *pdashOffset; /* offset into current dash */
- int isDoubleDash;
- INTER_DECLAREG(*addrg); /* pointer to base of bitmap */
- int ngwidth; /* width in groups of bitmap */
- int signdx, signdy; /* signs of directions */
- int axis; /* major axis (Y_AXIS or X_AXIS) */
- int x1, y1; /* initial point */
- register int e; /* error accumulator */
- register int e1; /* bresenham increments */
- int e2;
- int len; /* length of line */
-{
- register int e3 = e2-e1;
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- INTER_DECLARERRAX(xorFg);
- INTER_DECLARERRAX(andFg);
- INTER_DECLARERRAX(xorBg);
- INTER_DECLARERRAX(andBg);
- int thisDash;
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- xorFg = rrops[0].xorg;
- andFg = rrops[0].andg;
- xorBg = rrops[1].xorg;
- andBg = rrops[1].andg;
- dashRemaining = pDash[dashIndex] - dashOffset;
- if ((thisDash = dashRemaining) >= len)
- {
- thisDash = len;
- dashRemaining -= len;
- }
- e = e-e1; /* to make looping easier */
-
-#define BresStep(minor,major) {if ((e += e1) >= 0) { e += e3; minor; } major;}
-
-#define NextDash {\
- dashIndex++; \
- if (dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- if ((thisDash = dashRemaining) >= len) \
- { \
- dashRemaining -= len; \
- thisDash = len; \
- } \
-}
-
- {
- INTER_DECLAREG(startbit);
- INTER_DECLAREG(bit);
-
- /* point to longword containing first point */
- addrg = addrg + (y1 * ngwidth) + (x1 >> INTER_PGSH) * INTER_PLANES;
- signdy = signdy * ngwidth;
- signdx = signdx * INTER_PLANES;
-
- if (signdx > 0)
- startbit = iplmask[0];
- else
- startbit = iplmask[INTER_PPG-1];
- bit = iplmask[x1 & INTER_PIM];
-
-#define X_Loop(store) while(thisDash--) {\
- store; \
- BresStep(addrg += signdy, \
- if (signdx > 0) \
- bit >>= 1; \
- else \
- bit <<= 1; \
- if (!bit) \
- { \
- bit = startbit; \
- addrg += signdx; \
- }) \
- }
-#define Y_Loop(store) while(thisDash--) {\
- store; \
- BresStep(if (signdx > 0) \
- bit >>= 1; \
- else \
- bit <<= 1; \
- if (!bit) \
- { \
- bit = startbit; \
- addrg += signdx; \
- }, \
- addrg += signdy) \
- }
-
- if (axis == X_AXIS)
- {
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
- X_Loop(
- INTER_DoMaskRRop(addrg, andBg, xorBg, bit, addrg);
- )
- } else {
- X_Loop(;)
- }
- } else {
- X_Loop(INTER_DoMaskRRop(addrg, andFg, xorFg, bit, addrg));
- }
- if (!len)
- break;
- NextDash
- }
- } /* if X_AXIS */
- else
- {
- for (;;)
- {
- len -= thisDash;
- if (dashIndex & 1) {
- if (isDoubleDash) {
- Y_Loop(
- INTER_DoMaskRRop(addrg, andBg, xorBg, bit, addrg);
- )
- } else {
- Y_Loop(;)
- }
- } else {
- Y_Loop(INTER_DoMaskRRop(addrg, andFg, xorFg, bit, addrg));
- }
- if (!len)
- break;
- NextDash
- }
- } /* else Y_AXIS */
- }
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/iplan2p4/iplbstore.c b/iplan2p4/iplbstore.c
deleted file mode 100644
index 5719ca308..000000000
--- a/iplan2p4/iplbstore.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplbstore.c,v 3.0 1996/08/18 01:54:39 dawes Exp $ */
-
-/*-
- * iplbstore.c --
- * Functions required by the backing-store implementation in MI.
- *
- * Copyright (c) 1987 by the Regents of the University of California
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- *
- */
-#ifndef lint
-static char rcsid[] =
-"$XConsortium: iplbstore.c,v 5.8 93/12/13 17:21:51 dpw Exp $ SPRITE (Berkeley)";
-#endif
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "ipl.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * iplSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * iplDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-iplSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- i = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pScrPix = (PixmapPtr) pScreen->devPrivates[iplScreenPrivateIndex].ptr;
-#else
- pScrPix = (PixmapPtr) pScreen->devPrivate;
-#endif
-
- iplDoBitbltCopy((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
- GXcopy, prgnSave, pPtsInit, ~0L);
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * iplRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * iplDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-iplRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int i;
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- PixmapPtr pScrPix;
-
- i = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (--i >= 0) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pScrPix = (PixmapPtr) pScreen->devPrivates[iplScreenPrivateIndex].ptr;
-#else
- pScrPix = (PixmapPtr) pScreen->devPrivate;
-#endif
-
- iplDoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, ~0L);
-
- DEALLOCATE_LOCAL (pPtsInit);
-}
diff --git a/iplan2p4/iplcmap.c b/iplan2p4/iplcmap.c
deleted file mode 100644
index 21abfdbb3..000000000
--- a/iplan2p4/iplcmap.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplcmap.c,v 3.1 1998/11/22 10:37:41 dawes Exp $ */
-/* $XConsortium: iplcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "micmap.h"
-
-int
-iplListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-
-void
-iplInstallColormap(pmap)
- ColormapPtr pmap;
-{
- miInstallColormap(pmap);
-}
-
-void
-iplUninstallColormap(pmap)
- ColormapPtr pmap;
-{
- miUninstallColormap(pmap);
-}
-
-void
-iplResolveColor(pred, pgreen, pblue, pVisual)
- unsigned short *pred, *pgreen, *pblue;
- register VisualPtr pVisual;
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-iplInitializeColormap(pmap)
- register ColormapPtr pmap;
-{
- return miInitializeColormap(pmap);
-}
-
-int
-iplExpandDirectColors (pmap, ndef, indefs, outdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *indefs, *outdefs;
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-iplCreateDefColormap(pScreen)
- ScreenPtr pScreen;
-{
- return miCreateDefColormap(pScreen);
-}
-
-Bool
-iplSetVisualTypes (depth, visuals, bitsPerRGB)
- int depth;
- int visuals;
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of ipl.
- */
-
-Bool
-iplInitVisuals (visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, sizes, bitsPerRGB)
- VisualPtr *visualp;
- DepthPtr *depthp;
- int *nvisualp, *ndepthp;
- int *rootDepthp;
- VisualID *defaultVisp;
- unsigned long sizes;
- int bitsPerRGB;
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
diff --git a/iplan2p4/iplfillarc.c b/iplan2p4/iplfillarc.c
deleted file mode 100644
index c77db6b63..000000000
--- a/iplan2p4/iplfillarc.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplfillarc.c,v 3.0 1996/08/18 01:54:41 dawes Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: iplfillarc.c,v 5.15 94/04/17 20:28:47 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "miscstruct.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "ipl.h"
-#include "mifillarc.h"
-#include "iplrrop.h"
-#include "mi.h"
-#include "iplmskbits.h"
-
-static void
-INTER_RROP_NAME(iplFillEllipseSolid) (pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
-{
- int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- miFillArcRec info;
- INTER_DECLAREG(*addrgt);
- INTER_DECLAREG(*addrgb);
- INTER_DECLAREG(*addrg);
- register int n;
- int ngwidth;
- INTER_RROP_DECLARE
- register int xpos;
- register int slw;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
- int nlmiddle;
-
- iplGetGroupWidthAndPointer (pDraw, ngwidth, addrgt);
-
- INTER_RROP_FETCH_GC(pGC);
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrgb = addrgt;
- addrgt += ngwidth * (yorg - y);
- addrgb += ngwidth * (yorg + y + dy);
- while (y)
- {
- addrgt += ngwidth;
- addrgb -= ngwidth;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
- addrg = addrgt + (xpos >> INTER_PGSH) * INTER_PLANES;
- if (((xpos & INTER_PIM) + slw) <= INTER_PPG)
- {
- INTER_maskpartialbits(xpos, slw, startmask);
- INTER_RROP_SOLID_MASK(addrg,startmask);
- if (miFillArcLower(slw))
- {
- addrg = addrgb + (xpos >> INTER_PGSH) * INTER_PLANES;
- INTER_RROP_SOLID_MASK(addrg, startmask);
- }
- continue;
- }
- INTER_maskbits(xpos, slw, startmask, endmask, nlmiddle);
- if (startmask)
- {
- INTER_RROP_SOLID_MASK(addrg, startmask);
- INTER_NEXT_GROUP(addrg);
- }
- n = nlmiddle;
- INTER_RROP_SPAN(addrg,n)
-
- if (endmask)
- INTER_RROP_SOLID_MASK(addrg, endmask);
- if (!miFillArcLower(slw))
- continue;
- addrg = addrgb + (xpos >> INTER_PGSH) * INTER_PLANES;
- if (startmask)
- {
- INTER_RROP_SOLID_MASK(addrg, startmask);
- INTER_NEXT_GROUP(addrg);
- }
- n = nlmiddle;
- INTER_RROP_SPAN(addrg, n);
- if (endmask)
- INTER_RROP_SOLID_MASK(addrg, endmask);
- }
-}
-
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) \
- { \
- n = xr - xl + 1; \
- addrg = addr + (xl >> INTER_PGSH) * INTER_PLANES; \
- if (((xl & INTER_PIM) + n) <= INTER_PPG) \
- { \
- INTER_maskpartialbits(xl, n, startmask); \
- INTER_RROP_SOLID_MASK(addrg, startmask); \
- } \
- else \
- { \
- INTER_maskbits(xl, n, startmask, endmask, n); \
- if (startmask) \
- { \
- INTER_RROP_SOLID_MASK(addrg, startmask); \
- INTER_NEXT_GROUP(addrg); \
- } \
- while (n--) \
- { \
- INTER_RROP_SOLID(addrg); \
- INTER_NEXT_GROUP(addrg); \
- } \
- if (endmask) \
- INTER_RROP_SOLID_MASK(addrg, endmask); \
- } \
- }
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) \
- { \
- FILLSPAN(xl, xr, addr); \
- } \
- else \
- { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-INTER_RROP_NAME(iplFillArcSliceSolid)(pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
-{
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
- INTER_DECLAREG(*addrgt);
- INTER_DECLAREG(*addrgb);
- INTER_DECLAREG(*addrg);
- register int n;
- int ngwidth;
- INTER_RROP_DECLARE
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
-
- iplGetGroupWidthAndPointer (pDraw, ngwidth, addrgt);
-
- INTER_RROP_FETCH_GC(pGC);
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrgb = addrgt;
- addrgt += ngwidth * (yorg - y);
- addrgb += ngwidth * (yorg + y + dy);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0)
- {
- addrgt += ngwidth;
- addrgb -= ngwidth;
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrgt);
- }
- if (miFillSliceLower(slice))
- {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrgb);
- }
- }
-}
-
-void
-INTER_RROP_NAME(iplPolyFillArcSolid) (pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- int x2, y2;
- BoxRec box;
- RegionPtr cclip;
-
- cclip = iplGetCompositeClip(pGC);
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- INTER_RROP_NAME(iplFillEllipseSolid)(pDraw, pGC, arc);
- else
- INTER_RROP_NAME(iplFillArcSliceSolid)(pDraw, pGC, arc);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/iplan2p4/iplfillrct.c b/iplan2p4/iplfillrct.c
deleted file mode 100644
index 512c48048..000000000
--- a/iplan2p4/iplfillrct.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplfillrct.c,v 3.1 1998/03/20 21:08:08 hohndel Exp $ */
-/*
- * Fill rectangles.
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-*/
-
-/* $XConsortium: iplfillrct.c,v 5.18 94/04/17 20:28:47 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "ipl.h"
-#include "iplmskbits.h"
-#include "mergerop.h"
-
-
-void
-iplFillBoxTileOdd (pDrawable, n, rects, tile, xrot, yrot)
- DrawablePtr pDrawable;
- int n;
- BoxPtr rects;
- PixmapPtr tile;
- int xrot, yrot;
-{
- if (tile->drawable.width & INTER_PIM)
- iplFillBoxTileOddCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L);
- else
- iplFillBoxTile32sCopy (pDrawable, n, rects, tile, xrot, yrot, GXcopy, ~0L);
-}
-
-void
-iplFillRectTileOdd (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox;
- BoxPtr pBox;
-{
- int xrot, yrot;
- void (*fill)();
-
- xrot = pDrawable->x + pGC->patOrg.x;
- yrot = pDrawable->y + pGC->patOrg.y;
- if (pGC->tile.pixmap->drawable.width & INTER_PIM)
- {
- fill = iplFillBoxTileOddGeneral;
- if ((pGC->planemask & INTER_PMSK) == INTER_PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = iplFillBoxTileOddCopy;
- }
- }
- else
- {
- fill = iplFillBoxTile32sGeneral;
- if ((pGC->planemask & INTER_PMSK) == INTER_PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = iplFillBoxTile32sCopy;
- }
- }
- (*fill) (pDrawable, nBox, pBox, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask);
-}
-
-#define NUM_STACK_RECTS 1024
-
-void
-iplPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- iplPrivGC *priv;
- int numRects;
- void (*BoxFill)();
- int n;
- int xorg, yorg;
-
- priv = iplGetGCPrivate(pGC);
- prgnClip = pGC->pCompositeClip;
-
- BoxFill = 0;
- switch (pGC->fillStyle)
- {
- case FillSolid:
- switch (priv->rop) {
- case GXcopy:
- BoxFill = iplFillRectSolidCopy;
- break;
- case GXxor:
- BoxFill = iplFillRectSolidXor;
- break;
- default:
- BoxFill = iplFillRectSolidGeneral;
- break;
- }
- break;
- case FillTiled:
- if (!pGC->pRotatedPixmap)
- BoxFill = iplFillRectTileOdd;
- else
- {
- if (pGC->alu == GXcopy && (pGC->planemask & INTER_PMSK) == INTER_PMSK)
- BoxFill = iplFillRectTile32Copy;
- else
- BoxFill = iplFillRectTile32General;
- }
- break;
- }
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg)
- {
- prect = prectInit;
- n = nrectFill;
- while(n--)
- {
- prect->x += xorg;
- prect->y += yorg;
- prect++;
- }
- }
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS)
- {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1)
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2))
- {
- pboxClipped++;
- }
- }
- }
- else
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2)
- {
- pboxClipped++;
- }
- }
- }
- }
- if (pboxClipped != pboxClippedBase)
- (*BoxFill) (pDrawable, pGC,
- pboxClipped-pboxClippedBase, pboxClippedBase);
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/iplan2p4/iplfillsp.c b/iplan2p4/iplfillsp.c
deleted file mode 100644
index 010f911f6..000000000
--- a/iplan2p4/iplfillsp.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplfillsp.c,v 3.0 1996/08/18 01:54:43 dawes Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $XConsortium: iplfillsp.c,v 5.24 94/04/17 20:28:48 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "ipl.h"
-
-#include "mergerop.h"
-
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-#include "iplmskbits.h"
-
-/* scanline filling for color frame buffer
- written by drewry, oct 1986 modified by smarks
- changes for compatibility with Little-endian systems Jul 1987; MIT:yba.
-
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in iplCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-
- FillSolid is overloaded to be used for OpaqueStipple as well,
-if fgPixel == bgPixel.
-Note that for solids, PrivGC.rop == PrivGC.ropOpStip
-
-
- FillTiled is overloaded to be used for OpaqueStipple, if
-fgPixel != bgPixel. based on the fill style, it uses
-{RotatedTile, gc.alu} or {RotatedStipple, PrivGC.ropOpStip}
-*/
-
-#ifdef notdef
-#include <stdio.h>
-static
-dumpspans(n, ppt, pwidth)
- int n;
- DDXPointPtr ppt;
- int *pwidth;
-{
- fprintf(stderr,"%d spans\n", n);
- while (n--) {
- fprintf(stderr, "[%d,%d] %d\n", ppt->x, ppt->y, *pwidth);
- ppt++;
- pwidth++;
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-/* Fill spans with tiles that aren't 32 bits wide */
-void
-iplUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
-DrawablePtr pDrawable;
-GC *pGC;
-int nInit; /* number of spans to fill */
-DDXPointPtr pptInit; /* pointer to list of start points */
-int *pwidthInit; /* pointer to list of n widths */
-int fSorted;
-{
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- void (*fill)();
- int xrot, yrot;
-
- if (!(pGC->planemask))
- return;
-
- if (pGC->tile.pixmap->drawable.width & INTER_PIM)
- {
- fill = iplFillSpanTileOddGeneral;
- if ((pGC->planemask & INTER_PMSK) == INTER_PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = iplFillSpanTileOddCopy;
- }
- }
- else
- {
- fill = iplFillSpanTile32sGeneral;
- if ((pGC->planemask & INTER_PMSK) == INTER_PMSK)
- {
- if (pGC->alu == GXcopy)
- fill = iplFillSpanTile32sCopy;
- }
- }
- n = nInit * miFindMaxBand( iplGetCompositeClip(pGC) );
- if ( n == 0 )
- return;
- pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!ppt || !pwidth)
- {
- if (ppt) DEALLOCATE_LOCAL(ppt);
- if (pwidth) DEALLOCATE_LOCAL(pwidth);
- return;
- }
- n = miClipSpans( iplGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- xrot = pDrawable->x + pGC->patOrg.x;
- yrot = pDrawable->y + pGC->patOrg.y;
-
- (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask);
-
- DEALLOCATE_LOCAL(ppt);
- DEALLOCATE_LOCAL(pwidth);
-}
-
-/* Fill spans with stipples that aren't 32 bits wide */
-void
-iplUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
-DrawablePtr pDrawable;
-GC *pGC;
-int nInit; /* number of spans to fill */
-DDXPointPtr pptInit; /* pointer to list of start points */
-int *pwidthInit; /* pointer to list of n widths */
-int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- int iline; /* first line of tile to use */
- INTER_DECLAREG(*addrgBase); /* pointer to start of bitmap */
- int ngwidth; /* width in groups of bitmap */
- INTER_DECLAREG(*pdst); /* pointer to current group in bitmap */
- PixmapPtr pStipple; /* pointer to stipple we want to fill with */
- register int w;
- int width, x, xrem, xSrc, ySrc;
- INTER_DECLAREGP(tmpSrc);
- INTER_DECLAREGP(tmpDst1);
- INTER_DECLAREGP(tmpDst2);
- int stwidth, stippleWidth;
- unsigned long *psrcS;
- int rop, stiprop;
- int stippleHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- INTER_DECLARERRAXP(bgfill);
- INTER_DECLARERRAXP(fgfill);
-
- if (!(pGC->planemask))
- return;
-
- n = nInit * miFindMaxBand( iplGetCompositeClip(pGC) );
- if ( n == 0 )
- return;
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans( iplGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
- rop = pGC->alu;
- if (pGC->fillStyle == FillStippled) {
- switch (rop) {
- case GXand:
- case GXcopy:
- case GXnoop:
- case GXor:
- stiprop = rop;
- break;
- default:
- stiprop = rop;
- rop = GXcopy;
- }
- }
- INTER_PFILL(pGC->fgPixel, fgfill);
- INTER_PFILL(pGC->bgPixel, bgfill);
-
- /*
- * OK, so what's going on here? We have two Drawables:
- *
- * The Stipple:
- * Depth = 1
- * Width = stippleWidth
- * Words per scanline = stwidth
- * Pointer to pixels = pStipple->devPrivate.ptr
- */
- pStipple = pGC->stipple;
-
- stwidth = pStipple->devKind / MFB_PGSZB;
- stippleWidth = pStipple->drawable.width;
- stippleHeight = pStipple->drawable.height;
-
- /*
- * The Target:
- * Depth = INTER_PLANES
- * Width = determined from *pwidth
- * Groups per scanline = ngwidth
- * Pointer to pixels = addrgBase
- */
-
- iplGetGroupWidthAndPointer (pDrawable, ngwidth, addrgBase)
-
- /* this replaces rotating the stipple. Instead we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and xrem always stay within the stipple bounds.
- */
- modulus (pGC->patOrg.x, stippleWidth, xSrc);
- xSrc += pDrawable->x - stippleWidth;
- modulus (pGC->patOrg.y, stippleHeight, ySrc);
- ySrc += pDrawable->y - stippleHeight;
-
- while (n--)
- {
- iline = (ppt->y - ySrc) % stippleHeight;
- x = ppt->x;
- pdst = addrgBase + (ppt->y * ngwidth);
- psrcS = (unsigned long *) pStipple->devPrivate.ptr + (iline * stwidth);
-
- if (*pwidth)
- {
- width = *pwidth;
- while(width > 0)
- {
- int xtemp, tmpx;
- register unsigned long *ptemp;
- INTER_DECLAREG(*pdsttmp);
- /*
- * Do a stripe through the stipple & destination w pixels
- * wide. w is not more than:
- * - the width of the destination
- * - the width of the stipple
- * - the distance between x and the next word
- * boundary in the destination
- * - the distance between x and the next word
- * boundary in the stipple
- */
-
- /* width of dest/stipple */
- xrem = (x - xSrc) % stippleWidth;
- w = min((stippleWidth - xrem), width);
- /* dist to word bound in dest */
- w = min(w, INTER_PPG - (x & INTER_PIM));
- /* dist to word bound in stip */
- w = min(w, MFB_PPW - (x & MFB_PIM));
-
- xtemp = (xrem & MFB_PIM);
- ptemp = (unsigned long *)(psrcS + (xrem >> MFB_PWSH));
- tmpx = x & INTER_PIM;
- pdsttmp = pdst + (x >> INTER_PGSH) * INTER_PLANES;
- switch ( pGC->fillStyle ) {
- case FillOpaqueStippled:
- INTER_getstipplepixelsb(ptemp,xtemp,w,bgfill,fgfill,
- tmpDst1);
- INTER_putbitsrop(tmpDst1, tmpx, w, pdsttmp,
- pGC->planemask, rop);
- break;
- case FillStippled:
- /* Fill tmpSrc with the source pixels */
- INTER_getbits(pdsttmp, tmpx, w, tmpSrc);
- INTER_getstipplepixels(ptemp, xtemp, w, 0, tmpSrc,
- tmpDst1);
- if (rop != stiprop) {
- INTER_putbitsrop(fgfill, 0, w, tmpSrc, pGC->planemask, stiprop);
- } else {
- INTER_COPY(fgfill, tmpSrc);
- }
- INTER_getstipplepixels(ptemp, xtemp, w, 1, tmpSrc, tmpDst2);
- INTER_OR(tmpDst1,tmpDst2,tmpDst2);
- INTER_putbitsrop(tmpDst2, tmpx, w, pdsttmp,
- pGC->planemask, rop);
- }
- x += w;
- width -= w;
- }
- }
- ppt++;
- pwidth++;
- }
-
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
diff --git a/iplan2p4/iplgc.c b/iplan2p4/iplgc.c
deleted file mode 100644
index 794a62609..000000000
--- a/iplan2p4/iplgc.c
+++ /dev/null
@@ -1,782 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplgc.c,v 3.1 1998/03/20 21:08:08 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $XConsortium: iplgc.c,v 5.62 94/04/17 20:28:49 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ipl.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "mibstore.h"
-#include "migc.h"
-
-#include "iplmskbits.h"
-
-# ifdef WriteBitGroup
-# define useTEGlyphBlt iplImageGlyphBlt8
-# else
-# define useTEGlyphBlt iplTEGlyphBlt
-# endif
-
-#ifdef WriteBitGroup
-# define useImageGlyphBlt iplImageGlyphBlt8
-# define usePolyGlyphBlt iplPolyGlyphBlt8
-#else
-# define useImageGlyphBlt miImageGlyphBlt
-# define usePolyGlyphBlt miPolyGlyphBlt
-#endif
-
-#ifdef FOUR_BIT_CODE
-# define usePushPixels iplPushPixels8
-#else
-# define usePushPixels mfbPushPixels
-#endif
-
-#ifdef PIXEL_ADDR
-# define ZeroPolyArc iplZeroPolyArcSS8Copy
-#else
-# define ZeroPolyArc miZeroPolyArc
-#endif
-
-GCFuncs iplGCFuncs = {
- iplValidateGC,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
-
-GCOps iplTEOps1Rect = {
- iplSolidSpansCopy,
- iplSetSpans,
- iplPutImage,
- iplCopyArea,
- iplCopyPlane,
- iplPolyPoint,
-#ifdef PIXEL_ADDR
- ipl8LineSS1Rect,
- ipl8SegmentSS1Rect,
-#else
- iplLineSS,
- iplSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- iplFillPoly1RectCopy,
- iplPolyFillRect,
- iplPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps iplNonTEOps1Rect = {
- iplSolidSpansCopy,
- iplSetSpans,
- iplPutImage,
- iplCopyArea,
- iplCopyPlane,
- iplPolyPoint,
-#ifdef PIXEL_ADDR
- ipl8LineSS1Rect,
- ipl8SegmentSS1Rect,
-#else
- iplLineSS,
- iplSegmentSS,
-#endif
- miPolyRectangle,
- ZeroPolyArc,
- iplFillPoly1RectCopy,
- iplPolyFillRect,
- iplPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps iplTEOps = {
- iplSolidSpansCopy,
- iplSetSpans,
- iplPutImage,
- iplCopyArea,
- iplCopyPlane,
- iplPolyPoint,
- iplLineSS,
- iplSegmentSS,
- miPolyRectangle,
- ZeroPolyArc,
- miFillPolygon,
- iplPolyFillRect,
- iplPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useTEGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps iplNonTEOps = {
- iplSolidSpansCopy,
- iplSetSpans,
- iplPutImage,
- iplCopyArea,
- iplCopyPlane,
- iplPolyPoint,
- iplLineSS,
- iplSegmentSS,
- miPolyRectangle,
-#ifdef PIXEL_ADDR
- iplZeroPolyArcSS8Copy,
-#else
- miZeroPolyArc,
-#endif
- miFillPolygon,
- iplPolyFillRect,
- iplPolyFillArcSolidCopy,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- useImageGlyphBlt,
- usePolyGlyphBlt,
- usePushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-GCOps *
-iplMatchCommon (pGC, devPriv)
- GCPtr pGC;
- iplPrivGCPtr devPriv;
-{
- if (pGC->lineWidth != 0)
- return 0;
- if (pGC->lineStyle != LineSolid)
- return 0;
- if (pGC->fillStyle != FillSolid)
- return 0;
- if (devPriv->rop != GXcopy)
- return 0;
- if (pGC->font &&
- FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
- FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
- {
- if (TERMINALFONT(pGC->font)
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
-#ifdef NO_ONE_RECT
- return &iplTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &iplTEOps1Rect;
- else
- return &iplTEOps;
-#endif
- else
-#ifdef NO_ONE_RECT
- return &iplNonTEOps1Rect;
-#else
- if (devPriv->oneRect)
- return &iplNonTEOps1Rect;
- else
- return &iplNonTEOps;
-#endif
- }
- return 0;
-}
-
-Bool
-iplCreateGC(pGC)
- register GCPtr pGC;
-{
- iplPrivGC *pPriv;
-
- if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD)
- return (mfbCreateGC(pGC));
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- /*
- * some of the output primitives aren't really necessary, since they
- * will be filled in ValidateGC because of dix/CreateGC() setting all
- * the change bits. Others are necessary because although they depend
- * on being a color frame buffer, they don't change
- */
-
- pGC->ops = &iplNonTEOps;
- pGC->funcs = &iplGCFuncs;
-
- /* ipl wants to translate before scan conversion */
- pGC->miTranslate = 1;
-
- pPriv = iplGetGCPrivate(pGC);
- pPriv->rop = pGC->alu;
- pPriv->oneRect = FALSE;
- pGC->fExpose = TRUE;
- pGC->freeCompClip = FALSE;
- pGC->pRotatedPixmap = (PixmapPtr) NULL;
- return TRUE;
-}
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-void
-iplValidateGC(pGC, changes, pDrawable)
- register GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int new_rrop;
- int new_line, new_text, new_fillspans, new_fillarea;
- int new_rotate;
- int xrot, yrot;
- /* flags for changing the proc vector */
- iplPrivGCPtr devPriv;
- int oneRect;
-
- new_rotate = pGC->lastWinOrg.x != pDrawable->x ||
- pGC->lastWinOrg.y != pDrawable->y;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
- devPriv = iplGetGCPrivate(pGC);
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fillspans = FALSE;
- new_fillarea = FALSE;
-
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- miComputeCompositeClip (pGC, pDrawable);
-#ifdef NO_ONE_RECT
- devPriv->oneRect = FALSE;
-#else
- oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
- if (oneRect != devPriv->oneRect)
- new_line = TRUE;
- devPriv->oneRect = oneRect;
-#endif
- }
-
- mask = changes;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
-
- /*
- * this switch acculmulates a list of which procedures might have
- * to change due to changes in the GC. in some cases (e.g.
- * changing one 16 bit tile for another) we might not really need
- * a change, but the code is being paranoid. this sort of batching
- * wins if, for example, the alu and the font have been changed,
- * or any other pair of items that both change the same thing.
- */
- switch (index) {
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCPlaneMask:
- new_rrop = TRUE;
- new_text = TRUE;
- break;
- case GCBackground:
- break;
- case GCLineStyle:
- case GCLineWidth:
- new_line = TRUE;
- break;
- case GCJoinStyle:
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_text = TRUE;
- new_fillspans = TRUE;
- new_line = TRUE;
- new_fillarea = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
-
- case GCStipple:
- if (pGC->stipple)
- {
- int width = pGC->stipple->drawable.width;
- PixmapPtr nstipple;
-
- if ((width <= INTER_PGSZ) && !(width & (width - 1)) &&
- (nstipple = iplCopyPixmap(pGC->stipple)))
- {
- iplPadPixmap(nstipple);
- (*pGC->pScreen->DestroyPixmap)(pGC->stipple);
- pGC->stipple = nstipple;
- }
- }
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- break;
-
- case GCTileStipXOrigin:
- new_rotate = TRUE;
- break;
-
- case GCTileStipYOrigin:
- new_rotate = TRUE;
- break;
-
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- break;
- case GCGraphicsExposures:
- break;
- case GCClipXOrigin:
- break;
- case GCClipYOrigin:
- break;
- case GCClipMask:
- break;
- case GCDashOffset:
- break;
- case GCDashList:
- break;
- case GCArcMode:
- break;
- default:
- break;
- }
- }
-
- /*
- * If the drawable has changed, ensure suitable
- * entries are in the proc vector.
- */
- if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS))) {
- new_fillspans = TRUE; /* deal with FillSpans later */
- }
-
- if (new_rotate || new_fillspans)
- {
- Bool new_pix = FALSE;
-
- xrot = pGC->patOrg.x + pDrawable->x;
- yrot = pGC->patOrg.y + pDrawable->y;
-
- switch (pGC->fillStyle)
- {
- case FillTiled:
- if (!pGC->tileIsPixel)
- {
- int width = pGC->tile.pixmap->drawable.width;
-
- if ((width <= INTER_PGSZ) && !(width & (width - 1)))
- {
- iplCopyRotatePixmap(pGC->tile.pixmap,
- &pGC->pRotatedPixmap,
- xrot, yrot);
- new_pix = TRUE;
- }
- }
- break;
-#ifdef FOUR_BIT_CODE
- case FillStippled:
- case FillOpaqueStippled:
- {
- int width = pGC->stipple->drawable.width;
-
- if ((width <= INTER_PGSZ) && !(width & (width - 1)))
- {
- mfbCopyRotatePixmap(pGC->stipple,
- &pGC->pRotatedPixmap, xrot, yrot);
- new_pix = TRUE;
- }
- }
- break;
-#endif
- }
- if (!new_pix && pGC->pRotatedPixmap)
- {
- (*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- pGC->pRotatedPixmap = (PixmapPtr) NULL;
- }
- }
-
- if (new_rrop)
- {
- int old_rrop;
-
- old_rrop = devPriv->rop;
- devPriv->rop = iplReduceRasterOp(pGC->alu, pGC->fgPixel,
- pGC->planemask, devPriv->andg, devPriv->xorg);
- if (old_rrop == devPriv->rop)
- new_rrop = FALSE;
- else
- {
-#ifdef PIXEL_ADDR
- new_line = TRUE;
-#endif
-#ifdef WriteBitGroup
- new_text = TRUE;
-#endif
- new_fillspans = TRUE;
- new_fillarea = TRUE;
- }
- }
-
- if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
- {
- GCOps *newops;
-
- if (newops = iplMatchCommon (pGC, devPriv))
- {
- if (pGC->ops->devPrivate.val)
- miDestroyGCOps (pGC->ops);
- pGC->ops = newops;
- new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
- }
- else
- {
- if (!pGC->ops->devPrivate.val)
- {
- pGC->ops = miCreateGCOps (pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
- }
-
- /* deal with the changes we've collected */
- if (new_line)
- {
- pGC->ops->FillPolygon = miFillPolygon;
-#ifdef NO_ONE_RECT
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = iplFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = iplFillPoly1RectGeneral;
- break;
- }
- }
-#else
- if (devPriv->oneRect && pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillPolygon = iplFillPoly1RectCopy;
- break;
- default:
- pGC->ops->FillPolygon = iplFillPoly1RectGeneral;
- break;
- }
- }
-#endif
- if (pGC->lineWidth == 0)
- {
-#ifdef PIXEL_ADDR
- if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
- {
- switch (devPriv->rop)
- {
- case GXxor:
- pGC->ops->PolyArc = iplZeroPolyArcSS8Xor;
- break;
- case GXcopy:
- pGC->ops->PolyArc = iplZeroPolyArcSS8Copy;
- break;
- default:
- pGC->ops->PolyArc = iplZeroPolyArcSS8General;
- break;
- }
- }
- else
-#endif
- pGC->ops->PolyArc = miZeroPolyArc;
- }
- else
- pGC->ops->PolyArc = miPolyArc;
- pGC->ops->PolySegment = miPolySegment;
- switch (pGC->lineStyle)
- {
- case LineSolid:
- if(pGC->lineWidth == 0)
- {
- if (pGC->fillStyle == FillSolid)
- {
-#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
- if (devPriv->oneRect &&
- ((pDrawable->x >= pGC->pScreen->width - 32768) &&
- (pDrawable->y >= pGC->pScreen->height - 32768)))
- {
- pGC->ops->Polylines = ipl8LineSS1Rect;
- pGC->ops->PolySegment = ipl8SegmentSS1Rect;
- } else
-#endif
-#ifdef NO_ONE_RECT
- {
- pGC->ops->Polylines = ipl8LineSS1Rect;
- pGC->ops->PolySegment = ipl8SegmentSS1Rect;
- }
-#else
- {
- pGC->ops->Polylines = iplLineSS;
- pGC->ops->PolySegment = iplSegmentSS;
- }
-#endif
- }
- else
- pGC->ops->Polylines = miZeroLine;
- }
- else
- pGC->ops->Polylines = miWideLine;
- break;
- case LineOnOffDash:
- case LineDoubleDash:
- if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
- {
- pGC->ops->Polylines = iplLineSD;
- pGC->ops->PolySegment = iplSegmentSD;
- } else
- pGC->ops->Polylines = miWideDash;
- break;
- }
- }
-
- if (new_text && (pGC->font))
- {
- if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- else
- {
-#ifdef WriteBitGroup
- if (pGC->fillStyle == FillSolid)
- {
- if (devPriv->rop == GXcopy)
- pGC->ops->PolyGlyphBlt = iplPolyGlyphBlt8;
- else
-#ifdef FOUR_BIT_CODE
- pGC->ops->PolyGlyphBlt = iplPolyGlyphRop8;
-#else
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
-#endif
- }
- else
-#endif
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- /* special case ImageGlyphBlt for terminal emulator fonts */
-#if !defined(WriteBitGroup)
- if (TERMINALFONT(pGC->font) &&
- (pGC->planemask & INTER_PMSK) == INTER_PMSK
-#ifdef FOUR_BIT_CODE
- && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
-#endif
- )
- {
- pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
- }
- else
-#endif
- {
-#ifdef WriteBitGroup
- if (devPriv->rop == GXcopy &&
- pGC->fillStyle == FillSolid &&
- (pGC->planemask & INTER_PMSK) == INTER_PMSK)
- pGC->ops->ImageGlyphBlt = iplImageGlyphBlt8;
- else
-#endif
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- }
- }
-
-
- if (new_fillspans) {
- switch (pGC->fillStyle) {
- case FillSolid:
- switch (devPriv->rop) {
- case GXcopy:
- pGC->ops->FillSpans = iplSolidSpansCopy;
- break;
- case GXxor:
- pGC->ops->FillSpans = iplSolidSpansXor;
- break;
- default:
- pGC->ops->FillSpans = iplSolidSpansGeneral;
- break;
- }
- break;
- case FillTiled:
- if (pGC->pRotatedPixmap)
- {
- if (pGC->alu == GXcopy && (pGC->planemask & INTER_PMSK) == INTER_PMSK)
- pGC->ops->FillSpans = iplTile32FSCopy;
- else
- pGC->ops->FillSpans = iplTile32FSGeneral;
- }
- else
- pGC->ops->FillSpans = iplUnnaturalTileFS;
- break;
- case FillStippled:
-#ifdef FOUR_BIT_CODE
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = ipl8Stipple32FS;
- else
-#endif
- pGC->ops->FillSpans = iplUnnaturalStippleFS;
- break;
- case FillOpaqueStippled:
-#ifdef FOUR_BIT_CODE
- if (pGC->pRotatedPixmap)
- pGC->ops->FillSpans = ipl8OpaqueStipple32FS;
- else
-#endif
- pGC->ops->FillSpans = iplUnnaturalStippleFS;
- break;
- default:
- FatalError("iplValidateGC: illegal fillStyle\n");
- }
- } /* end of new_fillspans */
-
- if (new_fillarea) {
-#ifndef FOUR_BIT_CODE
- pGC->ops->PolyFillRect = miPolyFillRect;
- if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
- {
- pGC->ops->PolyFillRect = iplPolyFillRect;
- }
-#endif
-#ifdef FOUR_BIT_CODE
- pGC->ops->PushPixels = mfbPushPixels;
- if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
- pGC->ops->PushPixels = iplPushPixels8;
-#endif
- pGC->ops->PolyFillArc = miPolyFillArc;
- if (pGC->fillStyle == FillSolid)
- {
- switch (devPriv->rop)
- {
- case GXcopy:
- pGC->ops->PolyFillArc = iplPolyFillArcSolidCopy;
- break;
- default:
- pGC->ops->PolyFillArc = iplPolyFillArcSolidGeneral;
- break;
- }
- }
- }
-}
diff --git a/iplan2p4/iplgetsp.c b/iplan2p4/iplgetsp.c
deleted file mode 100644
index 271656bda..000000000
--- a/iplan2p4/iplgetsp.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplgetsp.c,v 3.0 1996/08/18 01:54:47 dawes Exp $ */
-/* $XConsortium: iplgetsp.c,v 5.14 94/04/17 20:28:50 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-#include "misc.h"
-#include "region.h"
-#include "gc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ipl.h"
-#include "iplmskbits.h"
-#include "iplpack.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-void
-iplGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pchardstStart; /* where to put the bits */
-{
- unsigned long *pdst = (unsigned long *)pchardstStart;
- INTER_DECLAREG(*psrc); /* where to get the bits */
- INTER_DECLAREGP(tmpSrc); /* scratch buffer for bits */
- INTER_DECLAREG(*psrcBase); /* start of src bitmap */
- int widthSrc; /* width of pixmap in bytes */
- register DDXPointPtr pptLast; /* one past last point to get */
- int xEnd; /* last pixel to copy from */
- register int nstart;
- int nend;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
- int nlMiddle, nl, srcBit;
- int w,longs;
- INTER_DECLAREG(*tmppdst);
- INTER_DECLAREG(*ipdst);
-
- switch (pDrawable->bitsPerPixel) {
- case 1:
- mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart);
- return;
- case INTER_PLANES:
- break;
- default:
- FatalError("iplGetSpans: invalid depth\n");
- }
-
- longs = NUM_LONGS(INTER_PLANES, 0, wMax);
- tmppdst = (unsigned short *)
- ALLOCATE_LOCAL(NUM_TEMP_BYTES(INTER_PLANES, longs));
- iplGetGroupWidthAndPointer (pDrawable, widthSrc, psrcBase)
-
- pptLast = ppt + nspans;
- while(ppt < pptLast)
- {
- xEnd = min(ppt->x + *pwidth, (widthSrc / INTER_PLANES) << INTER_PGSH);
- psrc = psrcBase + ppt->y * widthSrc +
- (ppt->x >> INTER_PGSH) * INTER_PLANES;
- w = xEnd - ppt->x;
- srcBit = ppt->x & INTER_PIM;
- ipdst = tmppdst;
-
- if (srcBit + w <= INTER_PPG)
- {
- INTER_getbits(psrc, srcBit, w, tmpSrc);
- INTER_putbits(tmpSrc, 0, w, ipdst, ~((unsigned long)0));
- }
- else
- {
- INTER_maskbits(ppt->x, w, startmask, endmask, nlMiddle);
- nstart = 0;
- if (startmask)
- {
- nstart = INTER_PPG - srcBit;
- INTER_getbits(psrc, srcBit, nstart, tmpSrc);
- INTER_putbits(tmpSrc, 0, nstart, ipdst, ~((unsigned long)0));
- if(srcBit + nstart >= INTER_PPG)
- INTER_NEXT_GROUP(psrc);
- }
- nl = nlMiddle;
- while (nl--)
- {
- INTER_putbits(psrc, nstart, INTER_PPG, ipdst, ~((unsigned long)0));
- INTER_NEXT_GROUP(psrc);
- INTER_NEXT_GROUP(ipdst);
- }
- if (endmask)
- {
- nend = xEnd & INTER_PIM;
- INTER_getbits(psrc, 0, nend, tmpSrc);
- INTER_putbits(tmpSrc, nstart, nend, ipdst, ~((unsigned long)0));
- }
- }
- longs=(w * INTER_PLANES + 31)/32;
- iplPackLine(INTER_PLANES, longs, tmppdst, pdst);
- pdst+=longs;
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(tmppdst);
-}
diff --git a/iplan2p4/iplhrzvert.c b/iplan2p4/iplhrzvert.c
deleted file mode 100644
index 6374e4d19..000000000
--- a/iplan2p4/iplhrzvert.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplhrzvert.c,v 3.0 1996/08/18 01:54:48 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: iplhrzvert.c,v 1.8 94/04/17 20:28:51 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-
-#include "gc.h"
-#include "window.h"
-#include "pixmap.h"
-#include "region.h"
-
-#include "ipl.h"
-
-#include "iplmskbits.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-iplHorzS(rop, andp, xorp, addrg, ngwidth, x1, y1, len)
-register int rop;
-INTER_DECLARERRAX(andp);
-INTER_DECLARERRAX(xorp);
-INTER_DECLAREG(*addrg); /* pointer to base of bitmap */
-int ngwidth; /* width in groups of bitmap */
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-{
- register int ngmiddle;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
-
- addrg = addrg + y1 * ngwidth + (x1 >> INTER_PGSH) * INTER_PLANES;
- /* all bits inside same group */
- if ( ((x1 & INTER_PIM) + len) < INTER_PPG)
- {
- INTER_maskpartialbits(x1, len, startmask);
- INTER_DoMaskRRop(addrg, andp, xorp, startmask, addrg);
- }
- else
- {
- INTER_maskbits(x1, len, startmask, endmask, ngmiddle);
- if (startmask)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, startmask, addrg);
- addrg += INTER_PLANES;
- }
- while (ngmiddle--)
- {
- INTER_DoRRop(addrg, andp, xorp, addrg);
- addrg += INTER_PLANES;
- }
- if (endmask)
- INTER_DoMaskRRop(addrg, andp, xorp, endmask, addrg);
- }
-}
-
-/* vertical solid line */
-
-iplVertS(rop, andp, xorp, addrg, ngwidth, x1, y1, len)
-int rop;
-INTER_DECLARERRAX(andp);
-INTER_DECLARERRAX(xorp);
-INTER_DECLAREG(*addrg); /* pointer to base of bitmap */
-register int ngwidth; /* width in groups of bitmap */
-int x1, y1; /* initial point */
-register int len; /* length of line */
-{
- addrg = addrg + (y1 * ngwidth) + (x1 >> INTER_PGSH) * INTER_PLANES;
- while (len--)
- {
- INTER_DoMaskRRop(addrg, andp, xorp, iplmask[x1 & INTER_PIM], addrg);
- addrg += ngwidth;
- }
-}
diff --git a/iplan2p4/iplimage.c b/iplan2p4/iplimage.c
deleted file mode 100644
index 0522309b4..000000000
--- a/iplan2p4/iplimage.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplimage.c,v 3.0 1996/08/18 01:54:49 dawes Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: iplimage.c,v 1.18 94/04/17 20:28:52 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "ipl.h"
-#include "servermd.h"
-
-void
-iplPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
- DrawablePtr pDraw;
- GCPtr pGC;
- int depth, x, y, w, h;
- int leftPad;
- int format;
- char *pImage;
-{
- miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage);
-}
-
-void
-iplGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char *pdstLine;
-{
- miGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-}
diff --git a/iplan2p4/iplline.c b/iplan2p4/iplline.c
deleted file mode 100644
index 479bfb00a..000000000
--- a/iplan2p4/iplline.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplline.c,v 3.1 1998/03/20 21:08:08 hohndel Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: iplline.c,v 1.23 94/04/17 20:28:53 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "ipl.h"
-#include "miline.h"
-
-#include "iplmskbits.h"
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-
-void
-#ifdef POLYSEGMENT
-iplSegmentSS (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-iplLineSS (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- INTER_DECLAREG(*addrg); /* address of destination pixmap */
- int ngwidth; /* width in groups of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- /* a bunch of temporaries */
- int tmp;
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
- iplPrivGCPtr devPriv;
- INTER_DECLARERRAX(xor);
- INTER_DECLARERRAX(and);
- int alu;
-
- devPriv = iplGetGCPrivate(pGC);
- cclip = pGC->pCompositeClip;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- iplGetGroupWidthAndPointer (pDrawable, ngwidth, addrg)
-
- alu = devPriv->rop;
- xor = devPriv->xorg;
- and = devPriv->andg;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2)
- {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- if (nbox)
- {
- /* stop when lower edge of box is beyond end of line */
- while((nbox) && (y2 >= pbox->y1))
- {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2))
- {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- {
- iplVertS (alu, and, xor,
- addrg, ngwidth,
- x1, y1t, y2t-y1t);
- }
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- }
- else if (y1 == y2) /* horizontal line */
- {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2)
- {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while( (nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1))
- {
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while((nbox) && (pbox->y1 == tmp))
- {
- int x1t, x2t;
-
- if (pbox->x2 <= x1)
- {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2)
- {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- {
- iplHorzS (alu, and, xor,
- addrg, ngwidth,
- x1t, y1, x2t-x1t);
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- iplBresS (alu, and, xor,
- addrg, ngwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, len);
- break;
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- iplBresS(alu, and, xor,
- addrg, ngwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- INTER_DECLAREG(mask);
- INTER_DECLAREGP(temp);
-
- mask = iplmask[x2 & INTER_PIM];
- addrg += (y2 * ngwidth) + (x2 >> INTER_PGSH) * INTER_PLANES;
-
- INTER_DoRRop(addrg, and, xor, temp);
- INTER_COPYM(temp, addrg, mask, addrg);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-void
-#ifdef POLYSEGMENT
-iplSegmentSD (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-iplLineSD( pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- INTER_DECLAREG(*addrg); /* address of destination pixmap */
- int ngwidth; /* width in groups of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- iplRRopRec rrops[2];
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
- iplPrivGCPtr devPriv;
-
- devPriv = iplGetGCPrivate(pGC);
- cclip = pGC->pCompositeClip;
- rrops[0].rop = devPriv->rop;
- INTER_COPY(devPriv->andg, rrops[0].andg)
- INTER_COPY(devPriv->xorg, rrops[0].xorg)
-#if 0
- if (pGC->alu == GXcopy)
- {
- rrops[1].rop = GXcopy;
- rrops[1].and = 0;
- rrops[1].xor = PFILL (pGC->bgPixel);
- }
- else
-#endif
- {
- rrops[1].rop = iplReduceRasterOp (pGC->alu,
- pGC->bgPixel, pGC->planemask,
- rrops[1].andg, rrops[1].xorg);
- }
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- iplGetGroupWidthAndPointer (pDrawable, ngwidth, addrg)
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- iplBresD (rrops,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrg, ngwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- break;
-#else
- iplBresD (rrops,
- &dashIndex, pDash, numInDashList,
- &dashOffset, isDoubleDash,
- addrg, ngwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- goto dontStep;
-#endif
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else /* have to clip */
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
- int dashIndexTmp, dashOffsetTmp;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
-
- if (clip1)
- {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- iplBresD (rrops,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrg, ngwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- INTER_DECLAREG(mask);
- int pix;
-
- pix = 0;
- if (dashIndex & 1)
- pix = 1;
- mask = iplmask[x2 & INTER_PIM];
- addrg += (y2 * ngwidth) + (x2 >> INTER_PGSH) * INTER_PLANES;
- INTER_DoMaskRRop(addrg, rrops[pix].andg, rrops[pix].xorg,
- mask, addrg);
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
diff --git a/iplan2p4/iplmap.h b/iplan2p4/iplmap.h
deleted file mode 100644
index 2e0a2b3cc..000000000
--- a/iplan2p4/iplmap.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplmap.h,v 3.2 2001/07/25 15:05:09 dawes Exp $ */
-/*
- * $XConsortium: iplmap.h,v 1.9 94/04/17 20:28:54 dpw Exp $
- *
-Copyright (c) 1991 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-/*
- * Map names around so that multiple depths can be supported simultaneously
- */
-
-/* a losing vendor cpp dumps core if we define NAME in terms of CATNAME */
-
-#if INTER_PLANES == 2
-#define NAME(subname) ipl2p2##subname
-#elif INTER_PLANES == 4
-#define NAME(subname) ipl2p4##subname
-#elif INTER_PLANES == 8
-#define NAME(subname) ipl2p8##subname
-#endif
-
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define CATNAME(prefix,subname) prefix##subname
-#else
-#define CATNAME(prefix,subname) prefix/**/subname
-#endif
-
-#define iplScreenPrivateIndex NAME(ScreenPrivateIndex)
-#define QuartetBitsTable NAME(QuartetBitsTable)
-#define QuartetPixelMaskTable NAME(QuartetPixelMaskTable)
-#define iplAllocatePrivates NAME(AllocatePrivates)
-#define iplBSFuncRec NAME(BSFuncRec)
-#define iplBitBlt NAME(BitBlt)
-#define iplBresD NAME(BresD)
-#define iplBresS NAME(BresS)
-#define iplChangeWindowAttributes NAME(ChangeWindowAttributes)
-#define iplCloseScreen NAME(CloseScreen)
-#define iplCopyArea NAME(CopyArea)
-#define iplCopyImagePlane NAME(CopyImagePlane)
-#define iplCopyPixmap NAME(CopyPixmap)
-#define iplCopyPlane NAME(CopyPlane)
-#define iplCopyRotatePixmap NAME(CopyRotatePixmap)
-#define iplCopyWindow NAME(CopyWindow)
-#define iplCreateGC NAME(CreateGC)
-#define iplCreatePixmap NAME(CreatePixmap)
-#define iplCreateWindow NAME(CreateWindow)
-#define iplCreateScreenResources NAME(CreateScreenResoures)
-#define iplDestroyPixmap NAME(DestroyPixmap)
-#define iplDestroyWindow NAME(DestroyWindow)
-#define iplDoBitblt NAME(DoBitblt)
-#define iplDoBitbltCopy NAME(DoBitbltCopy)
-#define iplDoBitbltGeneral NAME(DoBitbltGeneral)
-#define iplDoBitbltOr NAME(DoBitbltOr)
-#define iplDoBitbltXor NAME(DoBitbltXor)
-#define iplFillBoxSolid NAME(FillBoxSolid)
-#define iplFillBoxTile32 NAME(FillBoxTile32)
-#define iplFillBoxTile32sCopy NAME(FillBoxTile32sCopy)
-#define iplFillBoxTile32sGeneral NAME(FillBoxTile32sGeneral)
-#define iplFillBoxTileOdd NAME(FillBoxTileOdd)
-#define iplFillBoxTileOddCopy NAME(FillBoxTileOddCopy)
-#define iplFillBoxTileOddGeneral NAME(FillBoxTileOddGeneral)
-#define iplFillPoly1RectCopy NAME(FillPoly1RectCopy)
-#define iplFillPoly1RectGeneral NAME(FillPoly1RectGeneral)
-#define iplFillRectSolidCopy NAME(FillRectSolidCopy)
-#define iplFillRectSolidGeneral NAME(FillRectSolidGeneral)
-#define iplFillRectSolidXor NAME(FillRectSolidXor)
-#define iplFillRectTile32Copy NAME(FillRectTile32Copy)
-#define iplFillRectTile32General NAME(FillRectTile32General)
-#define iplFillRectTileOdd NAME(FillRectTileOdd)
-#define iplFillSpanTile32sCopy NAME(FillSpanTile32sCopy)
-#define iplFillSpanTile32sGeneral NAME(FillSpanTile32sGeneral)
-#define iplFillSpanTileOddCopy NAME(FillSpanTileOddCopy)
-#define iplFillSpanTileOddGeneral NAME(FillSpanTileOddGeneral)
-#define iplFinishScreenInit NAME(FinishScreenInit)
-#define iplGCFuncs NAME(GCFuncs)
-#define iplGetImage NAME(GetImage)
-#define iplGetScreenPixmap NAME(GetScreenPixmap)
-#define iplGetSpans NAME(GetSpans)
-#define iplHorzS NAME(HorzS)
-#define iplImageGlyphBlt8 NAME(ImageGlyphBlt8)
-#define iplLineSD NAME(LineSD)
-#define iplLineSS NAME(LineSS)
-#define iplMapWindow NAME(MapWindow)
-#define iplMatchCommon NAME(MatchCommon)
-#define iplNonTEOps NAME(NonTEOps)
-#define iplNonTEOps1Rect NAME(NonTEOps1Rect)
-#define iplPadPixmap NAME(PadPixmap)
-#define iplPaintWindow NAME(PaintWindow)
-#define iplPolyGlyphBlt8 NAME(PolyGlyphBlt8)
-#define iplPolyGlyphRop8 NAME(PolyGlyphRop8)
-#define iplPolyFillArcSolidCopy NAME(PolyFillArcSolidCopy)
-#define iplPolyFillArcSolidGeneral NAME(PolyFillArcSolidGeneral)
-#define iplPolyFillRect NAME(PolyFillRect)
-#define iplPolyPoint NAME(PolyPoint)
-#define iplPositionWindow NAME(PositionWindow)
-#define iplPutImage NAME(PutImage)
-#define iplReduceRasterOp NAME(ReduceRasterOp)
-#define iplRestoreAreas NAME(RestoreAreas)
-#define iplSaveAreas NAME(SaveAreas)
-#define iplScreenInit NAME(ScreenInit)
-#define iplSegmentSD NAME(SegmentSD)
-#define iplSegmentSS NAME(SegmentSS)
-#define iplSetScanline NAME(SetScanline)
-#define iplSetScreenPixmap NAME(SetScreenPixmap)
-#define iplSetSpans NAME(SetSpans)
-#define iplSetupScreen NAME(SetupScreen)
-#define iplSolidSpansCopy NAME(SolidSpansCopy)
-#define iplSolidSpansGeneral NAME(SolidSpansGeneral)
-#define iplSolidSpansXor NAME(SolidSpansXor)
-#define iplStippleStack NAME(StippleStack)
-#define iplStippleStackTE NAME(StippleStackTE)
-#define iplTEGlyphBlt NAME(TEGlyphBlt)
-#define iplTEOps NAME(TEOps)
-#define iplTEOps1Rect NAME(TEOps1Rect)
-#define iplTile32FSCopy NAME(Tile32FSCopy)
-#define iplTile32FSGeneral NAME(Tile32FSGeneral)
-#define iplUnmapWindow NAME(UnmapWindow)
-#define iplUnnaturalStippleFS NAME(UnnaturalStippleFS)
-#define iplUnnaturalTileFS NAME(UnnaturalTileFS)
-#define iplValidateGC NAME(ValidateGC)
-#define iplVertS NAME(VertS)
-#define iplXRotatePixmap NAME(XRotatePixmap)
-#define iplYRotatePixmap NAME(YRotatePixmap)
-#define iplendpartial NAME(endpartial)
-#define iplendtab NAME(endtab)
-#define iplmask NAME(mask)
-#define iplrmask NAME(rmask)
-#define iplstartpartial NAME(startpartial)
-#define iplstarttab NAME(starttab)
-#define ipl8LineSS1Rect NAME(LineSS1Rect)
-#define ipl8SegmentSS1Rect NAME(SegmentSS1Rect)
-#define ipl8ClippedLineCopy NAME(ClippedLineCopy)
-#define ipl8ClippedLineXor NAME(ClippedLineXor)
-#define ipl8ClippedLineGeneral NAME(ClippedLineGeneral )
-#define ipl8SegmentSS1RectCopy NAME(SegmentSS1RectCopy)
-#define ipl8SegmentSS1RectXor NAME(SegmentSS1RectXor)
-#define ipl8SegmentSS1RectGeneral NAME(SegmentSS1RectGeneral )
-#define ipl8SegmentSS1RectShiftCopy NAME(SegmentSS1RectShiftCopy)
-#define ipl8LineSS1RectCopy NAME(LineSS1RectCopy)
-#define ipl8LineSS1RectXor NAME(LineSS1RectXor)
-#define ipl8LineSS1RectGeneral NAME(LineSS1RectGeneral )
-#define ipl8LineSS1RectPreviousCopy NAME(LineSS1RectPreviousCopy)
-#define iplZeroPolyArcSS8Copy NAME(ZeroPolyArcSSCopy)
-#define iplZeroPolyArcSS8Xor NAME(ZeroPolyArcSSXor)
-#define iplZeroPolyArcSS8General NAME(ZeroPolyArcSSGeneral)
diff --git a/iplan2p4/iplmergerop.h b/iplan2p4/iplmergerop.h
deleted file mode 100644
index fa537d3a7..000000000
--- a/iplan2p4/iplmergerop.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplmergerop.h,v 3.1 2001/07/25 15:05:09 dawes Exp $ */
-#ifndef _IPLANMERGEROP_H_
-#define _IPLANMERGEROP_H_
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-/* defines:
- INTER_MROP_NAME
- INTER_MROP_DECLARE_REG()
- INTER_MROP_INITIALIZE(alu, pm)
- INTER_MROP_SOLID(src1, src2, dst)
- INTER_MROP_MASK(src1, src2, mask, dst)
- INTER_MROP_PREBUILD(src)
- INTER_MROP_PREBUILT_DECLARE()
- INTER_MROP_PREBUILT_SOLID(src,dst)
- INTER_MROP_PREBUILT_MASK(src,dst,mask)
-*/
-
-#ifndef GXcopy
-#include "X.h"
-#endif
-
-typedef struct _mergeRopBits {
- unsigned long ca1, cx1, ca2, cx2;
-} mergeRopRec, *mergeRopPtr;
-
-extern mergeRopRec mergeRopBits[16];
-
-#define INTER_DeclareMergeRop() \
- INTER_DECLAREGP(_ca1); \
- INTER_DECLAREGP(_cx1); \
- INTER_DECLAREGP(_ca2); \
- INTER_DECLAREGP(_cx2);
-
-#define INTER_DeclarePrebuiltMergeRop() \
- INTER_DECLAREGP(_cca); \
- INTER_DECLAREGP(_ccx);
-
-#define INTER_InitializeMergeRop(alu,pm) { \
- INTER_DECLAREGP(_pm); \
- mergeRopPtr _bits; \
- INTER_PFILL(pm, _pm); \
- _bits = &mergeRopBits[alu]; \
- INTER_ANDMSK(_pm, _bits->ca1, _ca1); \
- INTER_ANDMSK(_pm, _bits->ca2, _ca2); \
- INTER_ANDMSK(_pm, _bits->cx2, _cx2); \
- INTER_NOT(_pm, _pm); \
- INTER_ORMSK(_pm, _bits->cx1, _cx1); \
-}
-
-#define INTER_DoMergeRop(src1, src2, dst) \
- INTER_CPLX(src1, src2, _ca1, _cx1, _ca2, _cx2, dst)
-
-#define INTER_DoMaskMergeRop(src1, src2, mask, dst) \
- INTER_CPLXM(src1, src2, _ca1, _cx1, _ca2, _cx2, mask, dst)
-
-#define INTER_DoPrebuiltMergeRop(src, dst) \
- INTER_DoRRop(src, _cca, _ccx, dst)
-
-#define INTER_DoMaskPrebuiltMergeRop(src, mask, dst) \
- INTER_DoMaskRRop(src, _cca, _ccx, mask, dst)
-
-#define INTER_PrebuildMergeRop(src) \
- INTER_DoRRop(src, _ca1, _cx1, _cca); \
- INTER_DoRRop(src, _ca2, _cx2, _ccx);
-
-#ifndef MROP
-#define MROP 0
-#endif
-
-#define Mclear (1<<GXclear)
-#define Mand (1<<GXand)
-#define MandReverse (1<<GXandReverse)
-#define Mcopy (1<<GXcopy)
-#define MandInverted (1<<GXandInverted)
-#define Mnoop (1<<GXnoop)
-#define Mxor (1<<GXxor)
-#define Mor (1<<GXor)
-#define Mnor (1<<GXnor)
-#define Mequiv (1<<GXequiv)
-#define Minvert (1<<GXinvert)
-#define MorReverse (1<<GXorReverse)
-#define McopyInverted (1<<GXcopyInverted)
-#define MorInverted (1<<GXorInverted)
-#define Mnand (1<<GXnand)
-#define Mset (1<<GXset)
-
-#if (MROP) == Mcopy
-#define INTER_MROP_NAME(prefix) INTER_MROP_NAME_CAT(prefix,Copy)
-#define INTER_MROP_DECLARE_REG()
-#define INTER_MROP_INITIALIZE(alu,pm)
-#define INTER_MROP_SOLID(src,dst,dst2) INTER_COPY(src, dst2)
-#define INTER_MROP_MASK(src,dst,mask, dst2) INTER_COPYM(src,dst,mask,dst2)
-#endif
-
-#if (MROP) == Mxor
-#define INTER_MROP_NAME(prefix) INTER_MROP_NAME_CAT(prefix,Xor)
-#define INTER_MROP_DECLARE_REG()
-#define INTER_MROP_INITIALIZE(alu,pm)
-#define INTER_MROP_SOLID(src,dst,dst2) INTER_XOR(src,dst,dst2)
-#define INTER_MROP_MASK(src,dst,mask,dst2) INTER_XORM(src,dst,mask,dst2)
-#endif
-
-#if (MROP) == Mor
-#define INTER_MROP_NAME(prefix) INTER_MROP_NAME_CAT(prefix,Or)
-#define INTER_MROP_DECLARE_REG()
-#define INTER_MROP_INITIALIZE(alu,pm)
-#define INTER_MROP_SOLID(src,dst,dst2) INTER_OR(src,dst,dst2)
-#define INTER_MROP_MASK(src,dst,mask,dst2) INTER_ORM(src,dst,mask,dst2)
-#endif
-
-#if (MROP) == 0
-#define INTER_MROP_NAME(prefix) INTER_MROP_NAME_CAT(prefix,General)
-#define INTER_MROP_DECLARE_REG() INTER_DeclareMergeRop()
-#define INTER_MROP_INITIALIZE(alu,pm) INTER_InitializeMergeRop(alu,pm)
-#define INTER_MROP_SOLID(src,dst,dst2) INTER_DoMergeRop(src, dst, dst2)
-#define INTER_MROP_MASK(src,dst,mask,dst2) \
- INTER_DoMaskMergeRop(src, dst, mask, dst2)
-#define INTER_MROP_PREBUILD(src) INTER_PrebuildMergeRop(src)
-#define INTER_MROP_PREBUILT_DECLARE() INTER_DeclarePrebuiltMergeRop()
-#define INTER_MROP_PREBUILT_SOLID(src,dst, dst2) \
- INTER_DoPrebuiltMergeRop(dst,dst2)
-#define INTER_MROP_PREBUILT_MASK(src,dst,mask,dst2) \
- INTER_DoMaskPrebuiltMergeRop(dst,mask, dst2)
-#endif
-
-#ifndef INTER_MROP_PREBUILD
-#define INTER_MROP_PREBUILD(src)
-#define INTER_MROP_PREBUILT_DECLARE()
-#define INTER_MROP_PREBUILT_SOLID(src,dst,dst2) INTER_MROP_SOLID(src,dst,dst2)
-#define INTER_MROP_PREBUILT_MASK(src,dst,mask,dst2) \
- INTER_MROP_MASK(src,dst,mask,dst2)
-#endif
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define INTER_MROP_NAME_CAT(prefix,suffix) prefix##suffix
-#else
-#define INTER_MROP_NAME_CAT(prefix,suffix) prefix/**/suffix
-#endif
-
-#endif /* _IPLANMERGEROP_H_ */
diff --git a/iplan2p4/iplmskbits.c b/iplan2p4/iplmskbits.c
deleted file mode 100644
index 9f1d37dfb..000000000
--- a/iplan2p4/iplmskbits.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplmskbits.c,v 3.0 1996/08/18 01:54:54 dawes Exp $ */
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-#include "iplmap.h"
-
-unsigned short iplmask[] =
- { 0x8000,
- 0x4000,
- 0x2000,
- 0x1000,
- 0x0800,
- 0x0400,
- 0x0200,
- 0x0100,
- 0x0080,
- 0x0040,
- 0x0020,
- 0x0010,
- 0x0008,
- 0x0004,
- 0x0002,
- 0x0001
- };
-
-unsigned short iplstarttab[] =
- {
- 0x0000,
- 0x7fff,
- 0x3fff,
- 0x1fff,
- 0x0fff,
- 0x07ff,
- 0x03ff,
- 0x01ff,
- 0x00ff,
- 0x007f,
- 0x003f,
- 0x001f,
- 0x000f,
- 0x0007,
- 0x0003,
- 0x0001
- };
-
-unsigned short iplendtab[] =
- {
- 0x0000,
- 0x8000,
- 0xc000,
- 0xe000,
- 0xf000,
- 0xf800,
- 0xfc00,
- 0xfe00,
- 0xff00,
- 0xff80,
- 0xffc0,
- 0xffe0,
- 0xfff0,
- 0xfff8,
- 0xfffc,
- 0xfffe
- };
-
-unsigned short iplstartpartial[] =
- {
- 0xffff,
- 0x7fff,
- 0x3fff,
- 0x1fff,
- 0x0fff,
- 0x07ff,
- 0x03ff,
- 0x01ff,
- 0x00ff,
- 0x007f,
- 0x003f,
- 0x001f,
- 0x000f,
- 0x0007,
- 0x0003,
- 0x0001
- };
-
-unsigned short iplendpartial[] =
- {
- 0xffff,
- 0x8000,
- 0xc000,
- 0xe000,
- 0xf000,
- 0xf800,
- 0xfc00,
- 0xfe00,
- 0xff00,
- 0xff80,
- 0xffc0,
- 0xffe0,
- 0xfff0,
- 0xfff8,
- 0xfffc,
- 0xfffe
- };
-
diff --git a/iplan2p4/iplmskbits.h b/iplan2p4/iplmskbits.h
deleted file mode 100644
index 4fb3fe066..000000000
--- a/iplan2p4/iplmskbits.h
+++ /dev/null
@@ -1,496 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplmskbits.h,v 3.0 1996/08/18 01:54:55 dawes Exp $ */
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#define INTER_PIXGRP unsigned short
-
-#define INTER_PGSZ 16
-#define INTER_PGSZB 2
-#define INTER_PPG 16
-#define INTER_PPGMSK 0xffff
-#define INTER_PLST 15
-#define INTER_PIM 15
-#define INTER_PGSH 4
-#define INTER_PMSK ((1 << (INTER_PLANES)) - 1)
-
-extern INTER_PIXGRP iplmask[];
-extern INTER_PIXGRP iplstarttab[];
-extern INTER_PIXGRP iplendtab[];
-extern INTER_PIXGRP iplstartpartial[];
-extern INTER_PIXGRP iplendpartial[];
-
-#define MFB_PSZ 1
-
-#define INTER_NEXT(x) ((x) + INTER_PLANES)
-#define INTER_NEXT_GROUP(x) (x) += INTER_PLANES
-#define INTER_PREV_GROUP(x) (x) -= INTER_PLANES
-
-#define _I(x) (((unsigned long *) (x))[_INDEX])
-#define _IG(x) ((x)[_INDEX])
-
-#define INTER_DECLAREG(x) INTER_PIXGRP x
-#define INTER_DECLAREGP(x) INTER_PIXGRP x[INTER_PLANES]
-
-#define INTER_DECLARERRAX(x) INTER_PIXGRP *(x)
-#define INTER_DECLARERRAXP(x) INTER_PIXGRP x[INTER_PLANES]
-
-/* and |= PLANE_FILL(~fg), or &= PLANE_FILL(fg) */
-#define INTER_ANDXOR_PM(pm, and, xor) \
- PLANE_TIMESG( \
- if (!(pm & INTER_PLANE(_INDEX))) { \
- _IG(and) = INTER_PPGMSK; \
- _IG(xor) = 0; \
- })
-
-#if INTER_PLANES == 2
-
-#define PLANE_TIMESCONDG(x) \
- ({ int _INDEX; \
- int _ret; \
- _ret=(_INDEX=0, (x)) && \
- (_INDEX=1, (x)) && \
- _ret; \
- })
-
-#define PLANE_TIMESCOND(x) \
- ({ int _INDEX; \
- (_INDEX=0, x) \
- })
-
-#define PLANE_TIMESG(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- _INDEX=1; x; \
- }
-
-#define PLANE_TIMES(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- }
-
-#elif INTER_PLANES == 4
-
-#define PLANE_TIMESCONDG(x) \
- ({ int _INDEX; \
- int _ret; \
- _ret=(_INDEX=0, (x)) && \
- (_INDEX=1, (x)) && \
- (_INDEX=2, (x)) && \
- (_INDEX=3, (x)); \
- _ret; \
- })
-
-#define PLANE_TIMESCOND(x) \
- ({ int _INDEX; \
- ((_INDEX=0, x) && \
- (_INDEX=1, x)) \
- })
-
-#define PLANE_TIMESG(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- _INDEX=1; x; \
- _INDEX=2; x; \
- _INDEX=3; x; \
- }
-
-#define PLANE_TIMES(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- _INDEX=1; x; \
- }
-
-#elif INTER_PLANES == 8
-
-#define PLANE_TIMESCONDG(x) \
- ({ int _INDEX; \
- int _ret; \
- _ret=((_INDEX=0, (x)) && \
- (_INDEX=1, (x)) && \
- (_INDEX=2, (x)) && \
- (_INDEX=3, (x)) && \
- (_INDEX=4, (x)) && \
- (_INDEX=5, (x)) && \
- (_INDEX=6, (x)) && \
- (_INDEX=7, (x))); \
- _ret; \
- })
-
-#define PLANE_TIMESCOND(x) \
- ({ int _INDEX; \
- ((_INDEX=0, x) && \
- (_INDEX=1, x) && \
- (_INDEX=2, x) && \
- (_INDEX=3, x)) \
- })
-
-#define PLANE_TIMESG(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- _INDEX=1; x; \
- _INDEX=2; x; \
- _INDEX=3; x; \
- _INDEX=4; x; \
- _INDEX=5; x; \
- _INDEX=6; x; \
- _INDEX=7; x; \
- }
-
-#define PLANE_TIMES(x) \
- { int _INDEX; \
- _INDEX=0; x; \
- _INDEX=1; x; \
- _INDEX=2; x; \
- _INDEX=3; x; \
- }
-
-#endif
-
-/* src = 0 */
-#define INTER_IS_CLR(src) \
- PLANE_TIMESCONDG(_IG(src) == 0)
-
-/* src = PPGMSK ? */
-#define INTER_IS_SET(src) \
- PLANE_TIMESCONDG(_IG(src) == INTER_PPGMSK)
-
-/* (src1 ^ scr2) = PPGMSK ? */
-#define INTER_IS_XOR_SET(src1, src2) \
- PLANE_TIMESCONDG((_IG(src1) ^ _IG(src2)) == INTER_PPGMSK)
-
-/* dst = ~src */
-#define INTER_NOT(src, dst) \
- PLANE_TIMES(_I(dst) = ~_I(src))
-
-/* dst = 0 */
-#define INTER_CLR(dst) \
- PLANE_TIMES(_I(dst) = 0)
-
-/* dst = PPGMSK */
-#define INTER_SET(dst) \
- PLANE_TIMESG(_IG(dst) = INTER_PPGMSK)
-
-/* dst = src */
-#define INTER_COPY(src,dst) \
- PLANE_TIMES(_I(dst) = _I(src))
-
-/* dst2 = (dst & ~mask) | (src & mask) */
-#define INTER_COPYM(src,dst,mask,dst2) \
- PLANE_TIMESG( \
- _IG(dst2) = (_IG(dst) & ~mask) | (_IG(src) & mask) \
- )
-
-/* dst2 = dst ^ src */
-#define INTER_XOR(src,dst,dst2) \
- PLANE_TIMES(_I(dst2) = _I(dst) ^ _I(src))
-
-/* dst2 = dst ^ (src & mask) */
-#define INTER_XORM(src,dst,mask,dst2) \
- PLANE_TIMESG(_IG(dst2) = _IG(dst) ^ (_IG(src) & (mask)))
-
-/* dst2 = dst & src */
-#define INTER_AND(src,dst,dst2) \
- PLANE_TIMES(_I(dst2) = _I(dst) & _I(src))
-
-/* dst2 = dst & (src | ~mask) */
-#define INTER_ANDM(mask,src,dst,dst2) \
- PLANE_TIMESG(_IG(dst2) = _IG(dst) & (_IG(src) | ~(mask)))
-
-/* dst2 = dst | src */
-#define INTER_OR(src,dst,dst2) \
- PLANE_TIMES(_I(dst2) = _I(dst) | _I(src))
-
-/* dst2 = dst | (src & mask) */
-#define INTER_ORM(src,dst,mask,dst2) \
- PLANE_TIMESG(_IG(dst2) = _IG(dst) | (_IG(src) & (mask)))
-
-/* dst = src | msk */
-#define INTER_ORMSK(src,msk,dst) \
- PLANE_TIMESG(_IG(dst) = _IG(src) | (msk))
-
-/* dst = src & msk */
-#define INTER_ANDMSK(src,msk,dst) \
- PLANE_TIMESG(_IG(dst) = _IG(src) & (msk))
-
-/* dst = (src1 & msk1) | (src2 & msk2) */
-#define INTER_ANDMSK2(src1,msk1,src2,msk2,dst) \
- PLANE_TIMESG(_IG(dst) = (_IG(src1) & (msk1)) | (_IG(src2) & (msk2)))
-
-#define INTER_PLANE(x) (1<<(x))
-
-#define INTER_PFILL(col, fill) \
- PLANE_TIMESG(_IG(fill) = \
- ((col) & INTER_PLANE(_INDEX)) ? INTER_PPGMSK : 0)
-
-/* dst = src >> cnt */
-#define INTER_SCRRIGHT(cnt, src, dst) \
- PLANE_TIMESG(_IG(dst) = _IG(src) >> (cnt))
-
-/* dst = src << cnt */
-#define INTER_SCRLEFT(cnt, src, dst) \
- PLANE_TIMESG(_IG(dst) = _IG(src) << (cnt))
-
-/* bits1=(bits >> right) | (bits=psrc) << left) */
-#define INTER_GETRLC(right, left, psrc, bits, bits1) \
- PLANE_TIMESG( _IG(bits1)=(_IG(bits) >> (right)) | \
- ((_IG(bits) = _IG(psrc)) << (left)))
-
-/* bits1=(bits << left) | (bits=psrc) >> right) */
-#define INTER_GETLRC(left, right, psrc, bits, bits1) \
- PLANE_TIMESG( _IG(bits1)=(_IG(bits) << (left)) | \
- ((_IG(bits) = _IG(psrc)) >> (right)))
-
-/* dst=src2 & (src1 & a1 ^ x1) ^ (src1 & a2 ^ x2) */
-#define INTER_CPLX(src1, src2, a1, x1, a2, x2, dst) \
- PLANE_TIMES( _I(dst) = (_I(src2) \
- & (_I(src1) & _I(a1) ^ _I(x1)) \
- ^ (_I(src1) & _I(a2) ^ _I(x2)))) \
-
-/* dst=src2 & ((src1 & a1 ^ x1) | ~mask) ^ ((src1 & a2 ^ x2) & mask) */
-#define INTER_CPLXM(src1, src2, a1, x1, a2, x2, mask, dst) \
- PLANE_TIMESG( _IG(dst) = (_IG(src2) \
- & ((_IG(src1) & _IG(a1) ^ _IG(x1)) | ~mask) \
- ^ ((_IG(src1) & _IG(a2) ^ _IG(x2)) & mask)))
-
-/* dst = (src & ~(bitmask | planemask)) | (insert | (bitmask | planemask)) */
-#define INTER_PMSKINS(bitmask, planemask, insert, src, dst) \
- PLANE_TIMESG( \
- if (planemask & INTER_PLANE(_INDEX)) \
- _IG(dst) = (_IG(src) & ~bitmask) | (_IG(insert) & bitmask) \
- )
-
-/* dst = (src & ~bitmask) | ((insert >> shift) & bitmask) */
-#define INTER_SCRRMSKINS(bitmask, planemask, insert, shift, src, dst) \
- PLANE_TIMESG( \
- if (planemask & INTER_PLANE(_INDEX)) \
- _IG(dst) = (_IG(src) & ~(bitmask)) | \
- ((_IG(insert) >> shift) & (bitmask)) \
- )
-
-/* dst = (src & ~bitmask) | ((insert << shift) & bitmask) */
-#define INTER_SCRLMSKINS(bitmask, planemask, insert, shift, src, dst) \
- PLANE_TIMESG( \
- if (planemask & INTER_PLANE(_INDEX)) \
- _IG(dst) = (_IG(src) & ~bitmask) | \
- ((_IG(insert) << shift) & bitmask) \
- )
-
-/* dst = ((src1 << sl1) & bitmask1) | ((src2 >> sr2) & bitmask2) */
-#define INTER_MSKINSM(bitmask1, sl1, src1, bitmask2, sr2, src2, dst) \
- PLANE_TIMESG( \
- _IG(dst) = ((_IG(src1) << sl1) & (bitmask1)) | \
- ((_IG(src2) >> sr2) & (bitmask2)) \
- )
-
-/* dst = src & and ^ xor */
-#define INTER_DoRRop(src, and, xor, dst) \
- PLANE_TIMES(_I(dst) = (_I(src) & _I(and) ^ _I(xor))) \
-
-#define INTER_DoMaskRRop(src, and, xor, mask, dst) \
- PLANE_TIMESG( \
- _IG(dst) = (_IG(src) & ((_IG(and) | ~(mask))) \
- ^ (_IG(xor) & mask)))
-
-#define INTER_DoRop(result, alu, src, dst) \
-{ \
- if (alu == GXcopy) { \
- PLANE_TIMES( \
- _I(result) = fnCOPY (_I(src), _I(dst))); \
- } else if (alu == GXxor) { \
- PLANE_TIMES( \
- _I(result) = fnXOR (_I(src), _I(dst))); \
- } \
- else { \
- switch (alu) \
- { \
- case GXclear: \
- PLANE_TIMES( \
- _I(result) = fnCLEAR (_I(src), _I(dst))); \
- break; \
- case GXand: \
- PLANE_TIMES( \
- _I(result) = fnAND (_I(src), _I(dst))); \
- break; \
- case GXandReverse: \
- PLANE_TIMES( \
- _I(result) = fnANDREVERSE (_I(src), _I(dst))); \
- break; \
- case GXandInverted: \
- PLANE_TIMES( \
- _I(result) = fnANDINVERTED (_I(src), _I(dst))); \
- break; \
- case GXnoop: \
- PLANE_TIMES( \
- _I(result) = fnNOOP (_I(src), _I(dst))); \
- break; \
- case GXor: \
- PLANE_TIMES( \
- _I(result) = fnOR (_I(src), _I(dst))); \
- break; \
- case GXnor: \
- PLANE_TIMES( \
- _I(result) = fnNOR (_I(src), _I(dst))); \
- break; \
- case GXequiv: \
- PLANE_TIMES( \
- _I(result) = fnEQUIV (_I(src), _I(dst))); \
- break; \
- case GXinvert: \
- PLANE_TIMES( \
- _I(result) = fnINVERT (_I(src), _I(dst))); \
- break; \
- case GXorReverse: \
- PLANE_TIMES( \
- _I(result) = fnORREVERSE (_I(src), _I(dst))); \
- break; \
- case GXcopyInverted: \
- PLANE_TIMES( \
- _I(result) = fnCOPYINVERTED (_I(src), _I(dst))); \
- break; \
- case GXorInverted: \
- PLANE_TIMES( \
- _I(result) = fnORINVERTED (_I(src), _I(dst))); \
- break; \
- case GXnand: \
- PLANE_TIMES( \
- _I(result) = fnNAND (_I(src), _I(dst))); \
- break; \
- case GXset: \
- PLANE_TIMES( \
- _I(result) = fnSET (_I(src), _I(dst))); \
- break; \
- } \
- } \
-}
-
-#define iplGetGroupWidthAndPointer(pDrawable, width, pointer) \
- iplGetTypedWidthAndPointer(pDrawable, width, pointer, INTER_PIXGRP, INTER_PIXGRP)
-
-#define INTER_getstipplepixels(psrcstip, x, w, ones, psrcpix, pdstpix) \
-{ \
- unsigned long q; \
- int m; \
- if (ones) { \
- if ((m = ((x) - ((MFB_PPW*MFB_PSZ)-MFB_PPW))) > 0) { \
- q = (*(psrcstip)) << m; \
- if ( (x)+(w) > (MFB_PPW*MFB_PSZ) ) \
- q |= *((psrcstip)+1) >> ((MFB_PPW*MFB_PSZ)-m); \
- } \
- else \
- q = (*(psrcstip)) >> -m; \
- } \
- else { \
- if ((m = ((x) - ((MFB_PPW*MFB_PSZ)-MFB_PPW))) > 0) { \
- q = (~ *(psrcstip)) << m; \
- if ( (x)+(w) > (MFB_PPW*MFB_PSZ) ) \
- q |= (~*((psrcstip)+1)) >> ((MFB_PPW*MFB_PSZ)-m); \
- } \
- else \
- q = (~ *(psrcstip)) >> -m; \
- } \
- q >>=16; \
- INTER_ANDMSK(psrcpix,q,pdstpix); \
-}
-
-#define INTER_getstipplepixelsb(psrcstip, x, w, psrcpix0, psrcpix1, pdstpix) \
-{ \
- unsigned long q,qn; \
- int m; \
- if ((m = ((x) - ((MFB_PPW*MFB_PSZ)-MFB_PPW))) > 0) { \
- q = (*(psrcstip)) << m; \
- qn = (~ *(psrcstip)) << m; \
- if ( (x)+(w) > (MFB_PPW*MFB_PSZ) ) { \
- q |= *((psrcstip)+1) >> ((MFB_PPW*MFB_PSZ)-m); \
- qn |= (~ *((psrcstip)+1)) >> ((MFB_PPW*MFB_PSZ)-m); \
- } \
- } \
- else { \
- q = (*(psrcstip)) >> -m; \
- qn = (~ *(psrcstip)) >> -m; \
- } \
- q >>=16; \
- qn >>=16; \
- INTER_ANDMSK2(psrcpix0,qn,psrcpix1,q,pdstpix); \
-}
-
-#define INTER_maskbits(x, w, startmask, endmask, nlg) \
- startmask = iplstarttab[(x) & INTER_PIM]; \
- endmask = iplendtab[((x)+(w)) & INTER_PIM]; \
- if (startmask) \
- nlg = (((w) - (INTER_PPG - ((x) & INTER_PIM))) >> INTER_PGSH); \
- else \
- nlg = (w) >> INTER_PGSH;
-
-#define INTER_maskpartialbits(x, w, mask) \
- mask = iplstartpartial[(x) & INTER_PIM] & \
- iplendpartial[((x) + (w)) & INTER_PIM];
-
-#define INTER_mask32bits(x, w, startmask, endmask, nlw) \
- startmask = iplstarttab[(x) & INTER_PIM]; \
- endmask = iplendtab[((x)+(w)) & INTER_PIM];
-
-#define INTER_getbits(psrc, x, w, pdst) \
- if ( ((x) + (w)) <= INTER_PPG) \
- { \
- INTER_SCRLEFT((x), psrc, pdst); \
- } \
- else \
- { \
- int m; \
- m = INTER_PPG-(x); \
- INTER_MSKINSM(iplendtab[m], x, psrc, \
- iplstarttab[m], m, INTER_NEXT(psrc), pdst); \
- }
-
-#define INTER_putbits(psrc, x, w, pdst, planemask) \
- if ( ((x)+(w)) <= INTER_PPG) \
- { \
- INTER_DECLAREG(tmpmask); \
- INTER_maskpartialbits((x), (w), tmpmask); \
- INTER_SCRRMSKINS(tmpmask, planemask, psrc, x, pdst, pdst); \
- } \
- else \
- { \
- unsigned long m; \
- unsigned long n; \
- m = INTER_PPG-(x); \
- n = (w) - m; \
- INTER_SCRRMSKINS(iplstarttab[x], planemask, psrc, x, \
- pdst, pdst); \
- INTER_SCRLMSKINS(iplendtab[n], planemask, psrc, m, \
- INTER_NEXT(pdst), INTER_NEXT(pdst)); \
- }
-
-#define INTER_putbitsrop(psrc, x, w, pdst, planemask, rop) \
-if ( ((x)+(w)) <= INTER_PPG) \
-{ \
- INTER_DECLAREG(tmpmask); \
- INTER_DECLAREGP(t1); INTER_DECLAREGP(t2); \
- INTER_maskpartialbits((x), (w), tmpmask); \
- INTER_SCRRIGHT((x), (psrc), (t1)); \
- INTER_DoRop(t2, rop, t1, pdst); \
- INTER_PMSKINS(tmpmask, planemask, t2, pdst, pdst); \
-} \
-else \
-{ \
- unsigned long m; \
- unsigned long n; \
- INTER_DECLAREGP(t1); INTER_DECLAREGP(t2); \
- m = INTER_PPG-(x); \
- n = (w) - m; \
- INTER_SCRRIGHT((x), (psrc), (t1)); \
- INTER_DoRop(t2, rop, t1, pdst); \
- INTER_PMSKINS(iplstarttab[x], planemask, t2, pdst, pdst); \
- INTER_SCRLEFT(m, (psrc), (t1)); \
- INTER_DoRop(t2, rop, t1, pdst+1); \
- INTER_PMSKINS(iplendtab[n], planemask, t2, pdst, pdst); \
-}
-
-#define INTER_putbitsmropshort(src, x, w, pdst) { \
- INTER_DECLAREG(_tmpmask); \
- INTER_DECLAREGP(_t1); \
- INTER_maskpartialbits((x), (w), _tmpmask); \
- INTER_SCRRIGHT((x), (src), _t1); \
- INTER_DoMaskMergeRop(_t1, pdst, _tmpmask, pdst); \
-}
-
diff --git a/iplan2p4/iplpack.c b/iplan2p4/iplpack.c
deleted file mode 100644
index 96072895c..000000000
--- a/iplan2p4/iplpack.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplpack.c,v 3.0 1996/08/18 01:54:56 dawes Exp $ */
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-/* abcd abcd abcd abcd abcd abcd abcd abcd */
-/* aaaa aaaa bbbb bbbb cccc cccc dddd dddd */
-
-unsigned long tabi[256] = {
- 0x00000000,0x00001000,0x10000000,0x10001000,
- 0x00002000,0x00003000,0x10002000,0x10003000,
- 0x20000000,0x20001000,0x30000000,0x30001000,
- 0x20002000,0x20003000,0x30002000,0x30003000,
- 0x00004000,0x00005000,0x10004000,0x10005000,
- 0x00006000,0x00007000,0x10006000,0x10007000,
- 0x20004000,0x20005000,0x30004000,0x30005000,
- 0x20006000,0x20007000,0x30006000,0x30007000,
- 0x40000000,0x40001000,0x50000000,0x50001000,
- 0x40002000,0x40003000,0x50002000,0x50003000,
- 0x60000000,0x60001000,0x70000000,0x70001000,
- 0x60002000,0x60003000,0x70002000,0x70003000,
- 0x40004000,0x40005000,0x50004000,0x50005000,
- 0x40006000,0x40007000,0x50006000,0x50007000,
- 0x60004000,0x60005000,0x70004000,0x70005000,
- 0x60006000,0x60007000,0x70006000,0x70007000,
- 0x00008000,0x00009000,0x10008000,0x10009000,
- 0x0000a000,0x0000b000,0x1000a000,0x1000b000,
- 0x20008000,0x20009000,0x30008000,0x30009000,
- 0x2000a000,0x2000b000,0x3000a000,0x3000b000,
- 0x0000c000,0x0000d000,0x1000c000,0x1000d000,
- 0x0000e000,0x0000f000,0x1000e000,0x1000f000,
- 0x2000c000,0x2000d000,0x3000c000,0x3000d000,
- 0x2000e000,0x2000f000,0x3000e000,0x3000f000,
- 0x40008000,0x40009000,0x50008000,0x50009000,
- 0x4000a000,0x4000b000,0x5000a000,0x5000b000,
- 0x60008000,0x60009000,0x70008000,0x70009000,
- 0x6000a000,0x6000b000,0x7000a000,0x7000b000,
- 0x4000c000,0x4000d000,0x5000c000,0x5000d000,
- 0x4000e000,0x4000f000,0x5000e000,0x5000f000,
- 0x6000c000,0x6000d000,0x7000c000,0x7000d000,
- 0x6000e000,0x6000f000,0x7000e000,0x7000f000,
- 0x80000000,0x80001000,0x90000000,0x90001000,
- 0x80002000,0x80003000,0x90002000,0x90003000,
- 0xa0000000,0xa0001000,0xb0000000,0xb0001000,
- 0xa0002000,0xa0003000,0xb0002000,0xb0003000,
- 0x80004000,0x80005000,0x90004000,0x90005000,
- 0x80006000,0x80007000,0x90006000,0x90007000,
- 0xa0004000,0xa0005000,0xb0004000,0xb0005000,
- 0xa0006000,0xa0007000,0xb0006000,0xb0007000,
- 0xc0000000,0xc0001000,0xd0000000,0xd0001000,
- 0xc0002000,0xc0003000,0xd0002000,0xd0003000,
- 0xe0000000,0xe0001000,0xf0000000,0xf0001000,
- 0xe0002000,0xe0003000,0xf0002000,0xf0003000,
- 0xc0004000,0xc0005000,0xd0004000,0xd0005000,
- 0xc0006000,0xc0007000,0xd0006000,0xd0007000,
- 0xe0004000,0xe0005000,0xf0004000,0xf0005000,
- 0xe0006000,0xe0007000,0xf0006000,0xf0007000,
- 0x80008000,0x80009000,0x90008000,0x90009000,
- 0x8000a000,0x8000b000,0x9000a000,0x9000b000,
- 0xa0008000,0xa0009000,0xb0008000,0xb0009000,
- 0xa000a000,0xa000b000,0xb000a000,0xb000b000,
- 0x8000c000,0x8000d000,0x9000c000,0x9000d000,
- 0x8000e000,0x8000f000,0x9000e000,0x9000f000,
- 0xa000c000,0xa000d000,0xb000c000,0xb000d000,
- 0xa000e000,0xa000f000,0xb000e000,0xb000f000,
- 0xc0008000,0xc0009000,0xd0008000,0xd0009000,
- 0xc000a000,0xc000b000,0xd000a000,0xd000b000,
- 0xe0008000,0xe0009000,0xf0008000,0xf0009000,
- 0xe000a000,0xe000b000,0xf000a000,0xf000b000,
- 0xc000c000,0xc000d000,0xd000c000,0xd000d000,
- 0xc000e000,0xc000f000,0xd000e000,0xd000f000,
- 0xe000c000,0xe000d000,0xf000c000,0xf000d000,
- 0xe000e000,0xe000f000,0xf000e000,0xf000f000,
- };
-static unsigned long tabp[256] = {
- 0x00000000,0x00020000,0x00080000,0x000a0000,
- 0x00200000,0x00220000,0x00280000,0x002a0000,
- 0x00800000,0x00820000,0x00880000,0x008a0000,
- 0x00a00000,0x00a20000,0x00a80000,0x00aa0000,
- 0x02000000,0x02020000,0x02080000,0x020a0000,
- 0x02200000,0x02220000,0x02280000,0x022a0000,
- 0x02800000,0x02820000,0x02880000,0x028a0000,
- 0x02a00000,0x02a20000,0x02a80000,0x02aa0000,
- 0x08000000,0x08020000,0x08080000,0x080a0000,
- 0x08200000,0x08220000,0x08280000,0x082a0000,
- 0x08800000,0x08820000,0x08880000,0x088a0000,
- 0x08a00000,0x08a20000,0x08a80000,0x08aa0000,
- 0x0a000000,0x0a020000,0x0a080000,0x0a0a0000,
- 0x0a200000,0x0a220000,0x0a280000,0x0a2a0000,
- 0x0a800000,0x0a820000,0x0a880000,0x0a8a0000,
- 0x0aa00000,0x0aa20000,0x0aa80000,0x0aaa0000,
- 0x20000000,0x20020000,0x20080000,0x200a0000,
- 0x20200000,0x20220000,0x20280000,0x202a0000,
- 0x20800000,0x20820000,0x20880000,0x208a0000,
- 0x20a00000,0x20a20000,0x20a80000,0x20aa0000,
- 0x22000000,0x22020000,0x22080000,0x220a0000,
- 0x22200000,0x22220000,0x22280000,0x222a0000,
- 0x22800000,0x22820000,0x22880000,0x228a0000,
- 0x22a00000,0x22a20000,0x22a80000,0x22aa0000,
- 0x28000000,0x28020000,0x28080000,0x280a0000,
- 0x28200000,0x28220000,0x28280000,0x282a0000,
- 0x28800000,0x28820000,0x28880000,0x288a0000,
- 0x28a00000,0x28a20000,0x28a80000,0x28aa0000,
- 0x2a000000,0x2a020000,0x2a080000,0x2a0a0000,
- 0x2a200000,0x2a220000,0x2a280000,0x2a2a0000,
- 0x2a800000,0x2a820000,0x2a880000,0x2a8a0000,
- 0x2aa00000,0x2aa20000,0x2aa80000,0x2aaa0000,
- 0x80000000,0x80020000,0x80080000,0x800a0000,
- 0x80200000,0x80220000,0x80280000,0x802a0000,
- 0x80800000,0x80820000,0x80880000,0x808a0000,
- 0x80a00000,0x80a20000,0x80a80000,0x80aa0000,
- 0x82000000,0x82020000,0x82080000,0x820a0000,
- 0x82200000,0x82220000,0x82280000,0x822a0000,
- 0x82800000,0x82820000,0x82880000,0x828a0000,
- 0x82a00000,0x82a20000,0x82a80000,0x82aa0000,
- 0x88000000,0x88020000,0x88080000,0x880a0000,
- 0x88200000,0x88220000,0x88280000,0x882a0000,
- 0x88800000,0x88820000,0x88880000,0x888a0000,
- 0x88a00000,0x88a20000,0x88a80000,0x88aa0000,
- 0x8a000000,0x8a020000,0x8a080000,0x8a0a0000,
- 0x8a200000,0x8a220000,0x8a280000,0x8a2a0000,
- 0x8a800000,0x8a820000,0x8a880000,0x8a8a0000,
- 0x8aa00000,0x8aa20000,0x8aa80000,0x8aaa0000,
- 0xa0000000,0xa0020000,0xa0080000,0xa00a0000,
- 0xa0200000,0xa0220000,0xa0280000,0xa02a0000,
- 0xa0800000,0xa0820000,0xa0880000,0xa08a0000,
- 0xa0a00000,0xa0a20000,0xa0a80000,0xa0aa0000,
- 0xa2000000,0xa2020000,0xa2080000,0xa20a0000,
- 0xa2200000,0xa2220000,0xa2280000,0xa22a0000,
- 0xa2800000,0xa2820000,0xa2880000,0xa28a0000,
- 0xa2a00000,0xa2a20000,0xa2a80000,0xa2aa0000,
- 0xa8000000,0xa8020000,0xa8080000,0xa80a0000,
- 0xa8200000,0xa8220000,0xa8280000,0xa82a0000,
- 0xa8800000,0xa8820000,0xa8880000,0xa88a0000,
- 0xa8a00000,0xa8a20000,0xa8a80000,0xa8aa0000,
- 0xaa000000,0xaa020000,0xaa080000,0xaa0a0000,
- 0xaa200000,0xaa220000,0xaa280000,0xaa2a0000,
- 0xaa800000,0xaa820000,0xaa880000,0xaa8a0000,
- 0xaaa00000,0xaaa20000,0xaaa80000,0xaaaa0000,
- };
-
-void
-iplUnpackLine(int planes, int longs, unsigned int *psrc, unsigned short *ipsrc)
-{
- unsigned long temp,m;
- unsigned char *t=(unsigned char *) &temp;
- unsigned char *i=(unsigned char *) ipsrc;
- unsigned char *s=(unsigned char *) psrc;
- int j,off;
- switch (planes) {
- case 2:
- for (j = 0 ; j < longs ; j++)
- {
- *((long *) ipsrc)++=(tabi[s[0]] >> 0) |
- (tabi[s[1]] >> 4) |
- (tabi[s[2]] >> 8) |
- (tabi[s[3]] >> 12);
- s+=4;
- }
- break;
- case 4:
- for (j = 0 ; j < longs ; j++)
- {
- temp= (tabi[s[0]] >> 0) |
- (tabi[s[1]] >> 4) |
- (tabi[s[2]] >> 8) |
- (tabi[s[3]] >> 12);
- temp= (tabi[t[0]] >> 0) |
- (tabi[t[1]] >> 4) |
- (tabi[t[2]] >> 8) |
- (tabi[t[3]] >> 12);
- s+=4;
- if (j & 1) {
- i[7]=t[0];
- i[5]=t[1];
- i[3]=t[2];
- i[1]=t[3];
- i += 8;
- }
- else {
- i[6]=t[0];
- i[4]=t[1];
- i[2]=t[2];
- i[0]=t[3];
- }
- }
- break;
- case 8:
- for (j = 0 ; j < longs ; j++)
- {
- temp= (tabi[s[0]] >> 0) |
- (tabi[s[1]] >> 4) |
- (tabi[s[2]] >> 8) |
- (tabi[s[3]] >> 12);
-
- temp= (tabi[t[0]] >> 0) |
- (tabi[t[1]] >> 4) |
- (tabi[t[2]] >> 8) |
- (tabi[t[3]] >> 12);
-
- temp= (tabi[t[0]] >> 0) |
- (tabi[t[1]] >> 4) |
- (tabi[t[2]] >> 8) |
- (tabi[t[3]] >> 12);
-
- off=12-(j & 3)*4;
- m=0xf << off;
- ipsrc[7]=(ipsrc[7] & ~m) | (((temp >> 28) << off) & m);
- ipsrc[6]=(ipsrc[6] & ~m) | (((temp >> 24) << off) & m);
- ipsrc[5]=(ipsrc[5] & ~m) | (((temp >> 20) << off) & m);
- ipsrc[4]=(ipsrc[4] & ~m) | (((temp >> 16) << off) & m);
- ipsrc[3]=(ipsrc[3] & ~m) | (((temp >> 12) << off) & m);
- ipsrc[2]=(ipsrc[2] & ~m) | (((temp >> 8) << off) & m);
- ipsrc[1]=(ipsrc[1] & ~m) | (((temp >> 4) << off) & m);
- ipsrc[0]=(ipsrc[0] & ~m) | (((temp >> 0) << off) & m);
- if (! off)
- ipsrc +=8;
- s+=4;
- }
- }
-}
-
-void
-iplPackLine(int planes, int longs, unsigned short *ipdst, unsigned int *pdst)
-{
- unsigned long temp,m;
- unsigned char *t=(unsigned char *) &temp;
- unsigned char *i=(unsigned char *) ipdst;
- int j,off;
- switch (planes) {
- case 2:
- for (j = 0 ; j < longs ; j++)
- {
- *pdst++=(tabp[i[2]] >> 0) |
- (tabp[i[0]] >> 1) |
- (tabp[i[3]] >> 16) |
- (tabp[i[1]] >> 17);
- i+=4;
- }
- break;
- case 4:
- for (j = 0 ; j < longs ; j++)
- {
- if (j & 1) {
- temp= (tabp[i[7]] >> 0) |
- (tabp[i[3]] >> 1) |
- (tabp[i[5]] >> 16) |
- (tabp[i[1]] >> 17);
- i += 8;
- }
- else {
- temp= (tabp[i[6]] >> 0) |
- (tabp[i[2]] >> 1) |
- (tabp[i[4]] >> 16) |
- (tabp[i[0]] >> 17);
- }
- *pdst++=(tabp[t[0]] >> 0) |
- (tabp[t[2]] >> 1) |
- (tabp[t[1]] >> 16) |
- (tabp[t[3]] >> 17);
- }
- break;
- case 8:
- for (j = 0 ; j < longs ; j++)
- {
- off=12-(j & 3)*4;
- m=0xf;
- temp=(((ipdst[7] >> off) & m) << 28) |
- (((ipdst[6] >> off) & m) << 24) |
- (((ipdst[5] >> off) & m) << 20) |
- (((ipdst[4] >> off) & m) << 16) |
- (((ipdst[3] >> off) & m) << 12) |
- (((ipdst[2] >> off) & m) << 8) |
- (((ipdst[1] >> off) & m) << 4) |
- (((ipdst[0] >> off) & m) << 0);
-
- if (! off)
- ipdst +=8;
-
- temp= (tabp[t[0]] >> 0) |
- (tabp[t[2]] >> 1) |
- (tabp[t[1]] >> 16) |
- (tabp[t[3]] >> 17);
-
- temp= (tabp[t[0]] >> 0) |
- (tabp[t[2]] >> 1) |
- (tabp[t[1]] >> 16) |
- (tabp[t[3]] >> 17);
-
- *pdst++=(tabp[t[0]] >> 0) |
- (tabp[t[2]] >> 1) |
- (tabp[t[1]] >> 16) |
- (tabp[t[3]] >> 17);
- }
- }
-}
-
-unsigned long
-iplpack(unsigned long ipl)
-{
- unsigned char *ic=(unsigned char *) &ipl;
- return (tabp[ic[0]]) | /* a0a0a0a0a0a0a0a00000000000000000 */
- (tabp[ic[2]] >> 1) | /* abababababababab0000000000000000 */
- (tabp[ic[1]] >> 16) | /* ababababababababa0a0a0a0a0a0a0a0 */
- (tabp[ic[3]] >> 17); /* abababababababababababababababab */
-}
-
-unsigned long
-iplunpack(unsigned long pack)
-{
- unsigned char *ip=(unsigned char *) &pack;
- return (tabi[ip[0]]) | /* aaaa000000000000bbbb000000000000 */
- (tabi[ip[1]] >> 4) | /* aaaaaaaa00000000bbbbbbbb00000000 */
- (tabi[ip[2]] >> 8) | /* aaaaaaaaaaaa0000bbbbbbbbbbbb0000 */
- (tabi[ip[3]] >> 12); /* aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb */
-}
-
diff --git a/iplan2p4/iplpack.h b/iplan2p4/iplpack.h
deleted file mode 100644
index 9545c75ec..000000000
--- a/iplan2p4/iplpack.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplpack.h,v 3.0 1996/08/18 01:54:57 dawes Exp $ */
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#define NUM_LONGS(planes, xs, xe) \
- (((((xe) * (planes) + 31) & ~31) - \
- (((xs) * (planes)) & ~31))/32)
-
-#define NUM_TEMP_BYTES(planes, longs) \
- (((2 * (longs) + (planes) - 1) / planes + 1) * planes * 2)
diff --git a/iplan2p4/iplpixmap.c b/iplan2p4/iplpixmap.c
deleted file mode 100644
index 212f94979..000000000
--- a/iplan2p4/iplpixmap.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplpixmap.c,v 3.1 2001/12/17 20:00:46 dawes Exp $ */
-/* $XConsortium: iplpixmap.c,v 5.14 94/04/17 20:28:56 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* pixmap management
- written by drewry, september 1986
-
- on a monchrome device, a pixmap is a bitmap.
-*/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "mi.h"
-#include "ipl.h"
-#include "iplmskbits.h"
-
-extern unsigned long endtab[];
-
-PixmapPtr
-iplCreatePixmap (pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
- int ipad=INTER_PLANES*2 - 1;
-
- paddedWidth = PixmapBytePad(width, depth);
- paddedWidth = (paddedWidth + ipad) & ~ipad;
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth);
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = datasize ?
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
- pPixmap->devPrivate.ptr = (pointer)((long)(pPixmap + 1));
-#endif
- return pPixmap;
-}
-
-Bool
-iplDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- if(--pPixmap->refcnt)
- return TRUE;
- xfree(pPixmap);
- return TRUE;
-}
-
-PixmapPtr
-iplCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
- ScreenPtr pScreen;
-
- size = pSrc->drawable.height * pSrc->devKind;
- pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
- if (!pDst)
- return NullPixmap;
- memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
- return pDst;
-}
-
-
-/* replicates a pattern to be a full 32 bits wide.
- relies on the fact that each scnaline is longword padded.
- doesn't do anything if pixmap is not a factor of 32 wide.
- changes width field of pixmap if successful, so that the fast
- iplXRotatePixmap code gets used if we rotate the pixmap later.
- iplYRotatePixmap code gets used if we rotate the pixmap later.
-
- calculate number of times to repeat
- for each scanline of pattern
- zero out area to be filled with replicate
- left shift and or in original as many times as needed
-*/
-
-void
-iplPadPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- register int width = pPixmap->drawable.width;
- register int h;
- register unsigned short mask;
- register unsigned short *p;
- register unsigned short bits; /* real pattern bits */
- register int i;
- int rep; /* repeat count for pattern */
-
- if (width >= INTER_PGSZ)
- return;
-
- rep = INTER_PGSZ/width;
-/* if (rep*width != INTER_PGSZ)
- return; */
-
- mask = iplendtab[width];
-
- p = (unsigned short *)(pPixmap->devPrivate.ptr);
- for (h=0; h < pPixmap->drawable.height * INTER_PLANES; h++)
- {
- *p &= mask;
- bits = *p ;
- for(i=1; i<rep; i++)
- {
-#if (BITMAP_BIT_ORDER == MSBFirst)
- bits >>= width;
-#else
- bits <<= width;
-#endif
- *p |= bits;
- }
- p++;
- }
- pPixmap->drawable.width = rep*width; /* PGSZ/(pPixmap->drawable.bitsPerPixel); */
-}
-
-
-#ifdef notdef
-/*
- * ipl debugging routine -- assumes pixmap is 1 byte deep
- */
-static ipldumppixmap(pPix)
- PixmapPtr pPix;
-{
- unsigned int *pw;
- char *psrc, *pdst;
- int i, j;
- char line[66];
-
- ErrorF( "pPixmap: 0x%x\n", pPix);
- ErrorF( "%d wide %d high\n", pPix->drawable.width, pPix->drawable.height);
- if (pPix->drawable.width > 64)
- {
- ErrorF( "too wide to see\n");
- return;
- }
-
- pw = (unsigned int *) pPix->devPrivate.ptr;
- psrc = (char *) pw;
-
-/*
- for ( i=0; i<pPix->drawable.height; ++i )
- ErrorF( "0x%x\n", pw[i] );
-*/
-
- for ( i = 0; i < pPix->drawable.height; ++i ) {
- pdst = line;
- for(j = 0; j < pPix->drawable.width; j++) {
- *pdst++ = *psrc++ ? 'X' : ' ' ;
- }
- *pdst++ = '\n';
- *pdst++ = '\0';
- ErrorF( "%s", line);
- }
-}
-#endif /* notdef */
-
-/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
- * words are PGSZ bits wide, and that the least significant bit appears on the
- * left.
- */
-void
-iplXRotatePixmap(pPix, rw)
- PixmapPtr pPix;
- register int rw;
-{
- INTER_DECLAREG(*pw);
- INTER_DECLAREG(*pwFinal);
- INTER_DECLAREGP(t);
- int rot;
-
- if (pPix == NullPixmap)
- return;
-
- switch (((DrawablePtr) pPix)->bitsPerPixel) {
- case INTER_PLANES:
- break;
- case 1:
- mfbXRotatePixmap(pPix, rw);
- return;
- default:
- ErrorF("iplXRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel);
- return;
- }
- pw = (unsigned short *)pPix->devPrivate.ptr;
- modulus (rw, (int) pPix->drawable.width, rot);
- if(pPix->drawable.width == 16)
- {
- pwFinal = pw + pPix->drawable.height * INTER_PLANES;
- while(pw < pwFinal)
- {
- INTER_COPY(pw, t);
- INTER_MSKINSM(iplendtab[rot], INTER_PPG-rot, t,
- ~0, rot, t, pw)
- INTER_NEXT_GROUP(pw);
- }
- }
- else
- {
- ErrorF("ipl internal error: trying to rotate odd-sized pixmap.\n");
-#ifdef notdef
- register unsigned long *pwTmp;
- int size, tsize;
-
- tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth);
- pwTmp = (unsigned long *) ALLOCATE_LOCAL(pPix->drawable.height * tsize);
- if (!pwTmp)
- return;
- /* divide pw (the pixmap) in two vertically at (w - rot) and swap */
- tsize >>= 2;
- size = pPix->devKind >> SIZE0F(PixelGroup);
- iplQuickBlt((long *)pw, (long *)pwTmp,
- 0, 0, 0, 0,
- (int)pPix->drawable.width - rot, (int)pPix->drawable.height,
- size, tsize);
- iplQuickBlt((long *)pw, (long *)pw,
- (int)pPix->drawable.width - rot, 0, 0, 0,
- rot, (int)pPix->drawable.height,
- size, size);
- iplQuickBlt((long *)pwTmp, (long *)pw,
- 0, 0, rot, 0,
- (int)pPix->drawable.width - rot, (int)pPix->drawable.height,
- tsize, size);
- DEALLOCATE_LOCAL(pwTmp);
-#endif
- }
-}
-
-/* Rotates pixmap pPix by h lines. Assumes that h is always less than
- pPix->drawable.height
- works on any width.
- */
-void
-iplYRotatePixmap(pPix, rh)
- register PixmapPtr pPix;
- int rh;
-{
- int nbyDown; /* bytes to move down to row 0; also offset of
- row rh */
- int nbyUp; /* bytes to move up to line rh; also
- offset of first line moved down to 0 */
- char *pbase;
- char *ptmp;
- int rot;
-
- if (pPix == NullPixmap)
- return;
- switch (((DrawablePtr) pPix)->bitsPerPixel) {
- case INTER_PLANES:
- break;
- case 1:
- mfbYRotatePixmap(pPix, rh);
- return;
- default:
- ErrorF("iplYRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel);
- return;
- }
-
- modulus (rh, (int) pPix->drawable.height, rot);
- pbase = (char *)pPix->devPrivate.ptr;
-
- nbyDown = rot * pPix->devKind;
- nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown;
- if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
- return;
-
- memmove(ptmp, pbase, nbyUp); /* save the low rows */
- memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
- memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */
- DEALLOCATE_LOCAL(ptmp);
-}
-
-void
-iplCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
- register PixmapPtr psrcPix, *ppdstPix;
- int xrot, yrot;
-{
- register PixmapPtr pdstPix;
-
- if ((pdstPix = *ppdstPix) &&
- (pdstPix->devKind == psrcPix->devKind) &&
- (pdstPix->drawable.height == psrcPix->drawable.height))
- {
- memmove((char *)pdstPix->devPrivate.ptr,
- (char *)psrcPix->devPrivate.ptr,
- psrcPix->drawable.height * psrcPix->devKind);
- pdstPix->drawable.width = psrcPix->drawable.width;
- pdstPix->drawable.depth = psrcPix->drawable.depth;
- pdstPix->drawable.bitsPerPixel = psrcPix->drawable.bitsPerPixel;
- pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- else
- {
- if (pdstPix)
- /* FIX XBUG 6168 */
- (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
- *ppdstPix = pdstPix = iplCopyPixmap(psrcPix);
- if (!pdstPix)
- return;
- }
- iplPadPixmap(pdstPix);
- if (xrot)
- iplXRotatePixmap(pdstPix, xrot);
- if (yrot)
- iplYRotatePixmap(pdstPix, yrot);
-}
diff --git a/iplan2p4/iplply1rct.c b/iplan2p4/iplply1rct.c
deleted file mode 100644
index f73bc8864..000000000
--- a/iplan2p4/iplply1rct.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplply1rct.c,v 3.1 1998/03/20 21:08:09 hohndel Exp $ */
-/*
- * $XConsortium: iplply1rct.c,v 1.14 94/04/17 20:28:56 dpw Exp $
- *
-Copyright (c) 1990 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "ipl.h"
-#include "iplrrop.h"
-
-#include "iplmskbits.h"
-
-void
-INTER_RROP_NAME(iplFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int count;
- DDXPointPtr ptsIn;
-{
- iplPrivGCPtr devPriv;
- int ngwidth;
- unsigned short *addrl, *addr;
- int maxy;
- int origin;
- register int vertex1, vertex2;
- int c;
- BoxPtr extents;
- int clip;
- int y;
- int *vertex1p, *vertex2p;
- int *endp;
- int x1, x2;
- int dx1, dx2;
- int dy1, dy2;
- int e1, e2;
- int step1, step2;
- int sign1, sign2;
- int h;
- int l, r;
- INTER_DECLAREG(mask);
- INTER_DECLAREG(bits);
- int nmiddle;
- INTER_RROP_DECLARE
- bits=~0;
-
- if (mode == CoordModePrevious)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
-
- devPriv = iplGetGCPrivate(pGC);
-#ifdef NO_ONE_RECT
- if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
-#endif
- origin = *((int *) &pDrawable->x);
- origin -= (origin & 0x8000) << 1;
- extents = &pGC->pCompositeClip->extents;
- INTER_RROP_FETCH_GCPRIV(devPriv);
- vertex1 = *((int *) &extents->x1) - origin;
- vertex2 = *((int *) &extents->x2) - origin - 0x00010001;
- clip = 0;
- y = 32767;
- maxy = 0;
- vertex2p = (int *) ptsIn;
- endp = vertex2p + count;
- if (shape == Convex)
- {
- while (count--)
- {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y)
- {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- }
- }
- else
- {
- int yFlip = 0;
- dx1 = 1;
- x2 = -1;
- x1 = -1;
- while (count--)
- {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y)
- {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- if (c == x1)
- continue;
- if (dx1 > 0)
- {
- if (x2 < 0)
- x2 = c;
- else
- dx2 = dx1 = (c - x1) >> 31;
- }
- else
- if ((c - x1) >> 31 != dx1)
- {
- dx1 = ~dx1;
- yFlip++;
- }
- x1 = c;
- }
- x1 = (x2 - c) >> 31;
- if (x1 != dx1)
- yFlip++;
- if (x1 != dx2)
- yFlip++;
- if (yFlip != 2)
- clip = 0x8000;
- }
- if (y == maxy)
- return;
-
- if (clip & 0x80008000)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
- return;
- }
-
-#define AddrYPlus(a,y) ((a) + (y) * ngwidth)
-
- iplGetGroupWidthAndPointer(pDrawable, ngwidth, addrl);
- addrl = AddrYPlus(addrl,y + pDrawable->y);
- origin = intToX(origin);
- vertex2p = vertex1p;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
- x = intToX(vertex); \
- if (dy = intToY(c) - y) { \
- dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) \
- { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx = dx % dy; \
- } \
- } \
- else \
- { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx = dx % dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) \
- { \
- x += sign; \
- e -= dy; \
- } \
-}
- for (;;)
- {
- if (y == intToY(vertex1))
- {
- do
- {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
- } while (y >= intToY(vertex1));
- h = dy1;
- }
- else
- {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2))
- {
- do
- {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- }
- else
- {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
- /* fill spans for this segment */
- y += h;
- for (;;)
- {
- l = x1;
- r = x2;
- nmiddle = x2 - x1;
- if (nmiddle < 0)
- {
- nmiddle = -nmiddle;
- l = x2;
- r = x1;
- }
- c = l & INTER_PIM;
- l -= c;
-
- addr = addrl + (l >> INTER_PGSH) * INTER_PLANES;
- if (c + nmiddle < INTER_PPG)
- {
- mask = (bits >> c) ^ (bits >> (c+nmiddle));
- INTER_RROP_SOLID_MASK(addr,mask);
- }
- else
- {
- if (c)
- {
- mask = bits >> c;
- INTER_RROP_SOLID_MASK(addr,mask);
- nmiddle += c - INTER_PPG;
- INTER_NEXT_GROUP(addr);
- }
- nmiddle >>= INTER_PGSH;
- while (--nmiddle >= 0) {
- INTER_RROP_SOLID(addr); INTER_NEXT_GROUP(addr);
- }
- if (mask = ~(bits >> (r & INTER_PIM)))
- INTER_RROP_SOLID_MASK(addr,mask);
- }
- if (!--h)
- break;
- addrl = AddrYPlus (addrl, 1);
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if (y == maxy)
- break;
- addrl = AddrYPlus (addrl, 1);
- }
-}
diff --git a/iplan2p4/iplpntwin.c b/iplan2p4/iplpntwin.c
deleted file mode 100644
index a5a61194a..000000000
--- a/iplan2p4/iplpntwin.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplpntwin.c,v 3.0 1996/08/18 01:55:01 dawes Exp $ */
-/* $XConsortium: iplpntwin.c,v 5.18 94/04/17 20:28:57 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ipl.h"
-#include "mi.h"
-
-void
-iplPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- register iplPrivWin *pPrivWin;
- WindowPtr pBgWin;
-
- pPrivWin = iplGetWindowPrivate(pWin);
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground)
- {
- iplFillBoxTile32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pPrivWin->pRotatedBackground);
- }
- else
- {
- iplFillBoxTileOdd ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixmap,
- (int) pWin->drawable.x, (int) pWin->drawable.y);
- }
- break;
- case BackgroundPixel:
- iplFillBoxSolid ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->background.pixel);
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- iplFillBoxSolid ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixel);
- }
- else if (pPrivWin->fastBorder)
- {
- iplFillBoxTile32 ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pPrivWin->pRotatedBorder);
- }
- else
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- iplFillBoxTileOdd ((DrawablePtr)pWin,
- (int)REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- pWin->border.pixmap,
- (int) pBgWin->drawable.x,
- (int) pBgWin->drawable.y);
- }
- break;
- }
-}
-
-/*
- * Use the RROP macros in copy mode
- */
-
-#define RROP GXcopy
-#include "iplrrop.h"
-#include "iplmskbits.h"
-
-
-# define Expand(left, right, leftAdjust) { \
- int widthStep; \
- widthStep = widthDst - (nmiddle + leftAdjust) * INTER_PLANES; \
- while (h--) { \
- left \
- m = nmiddle; \
- INTER_RROP_SPAN(pdst, m); \
- right \
- pdst += widthStep; \
- } \
-}
-
-void
-iplFillBoxSolid (pDrawable, nBox, pBox, pixel)
- DrawablePtr pDrawable;
- int nBox;
- BoxPtr pBox;
- unsigned long pixel;
-{
- INTER_DECLAREG(*pdstBase);
- int widthDst;
- register int h;
- INTER_DECLAREGP(rrop_xor);
- INTER_DECLAREG(*pdst);
- INTER_DECLAREG(leftMask);
- INTER_DECLAREG(rightMask);
- int nmiddle;
- register int m;
- int w;
-
- iplGetGroupWidthAndPointer(pDrawable, widthDst, pdstBase);
-
- INTER_PFILL(pixel, rrop_xor);
- for (; nBox; nBox--, pBox++)
- {
- pdst = pdstBase + pBox->y1 * widthDst;
- h = pBox->y2 - pBox->y1;
- w = pBox->x2 - pBox->x1;
- pdst += (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- if ((pBox->x1 & INTER_PIM) + w <= INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, leftMask);
- while (h--) {
- INTER_COPYM(rrop_xor, pdst, leftMask, pdst);
- pdst += widthDst;
- }
- }
- else
- {
- INTER_maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);
- if (leftMask)
- {
- if (rightMask)
- {
- Expand (INTER_RROP_SOLID_MASK (pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- INTER_RROP_SOLID_MASK (pdst, rightMask); ,
- 1)
- }
- else
- {
- Expand (INTER_RROP_SOLID_MASK (pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- ;,
- 1)
- }
- }
- else
- {
- if (rightMask)
- {
- Expand (;,
- INTER_RROP_SOLID_MASK (pdst, rightMask);,
- 0)
- }
- else
- {
- Expand (;,
- ;,
- 0)
- }
- }
- }
- }
-}
-
-void
-iplFillBoxTile32 (pDrawable, nBox, pBox, tile)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* rotated, expanded tile */
-{
- INTER_DECLAREGP(rrop_xor);
- INTER_DECLAREG(*pdst);
- register int m;
- INTER_DECLAREG(*psrc);
- int tileHeight;
-
- int widthDst;
- int w;
- int h;
- INTER_DECLAREG(leftMask);
- INTER_DECLAREG(rightMask);
- int nmiddle;
- int y;
- int srcy;
-
- INTER_DECLAREG(*pdstBase);
-
- tileHeight = tile->drawable.height;
- psrc = (unsigned short *)tile->devPrivate.ptr;
-
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase);
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
- pdst = pdstBase + (pBox->y1 * widthDst) +
- (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- srcy = y % tileHeight;
-
-#define StepTile INTER_COPY(psrc + srcy * INTER_PLANES, rrop_xor); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0;
-
- if ( ((pBox->x1 & INTER_PIM) + w) < INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, leftMask);
- rightMask = ~leftMask;
- while (h--)
- {
- StepTile
- INTER_MSKINSM(rightMask, 0, pdst, leftMask, 0, rrop_xor, pdst);
- pdst += widthDst;
- }
- }
- else
- {
- INTER_maskbits(pBox->x1, w, leftMask, rightMask, nmiddle);
-
- if (leftMask)
- {
- if (rightMask)
- {
- Expand (StepTile
- INTER_RROP_SOLID_MASK(pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- INTER_RROP_SOLID_MASK(pdst, rightMask);,
- 1)
- }
- else
- {
- Expand (StepTile
- INTER_RROP_SOLID_MASK(pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- ;,
- 1)
- }
- }
- else
- {
- if (rightMask)
- {
- Expand (StepTile
- ,
- INTER_RROP_SOLID_MASK(pdst, rightMask);,
- 0)
- }
- else
- {
- Expand (StepTile
- ,
- ;,
- 0)
- }
- }
- }
- pBox++;
- }
-}
diff --git a/iplan2p4/iplpolypnt.c b/iplan2p4/iplpolypnt.c
deleted file mode 100644
index 3d90edea4..000000000
--- a/iplan2p4/iplpolypnt.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplpolypnt.c,v 3.1 1998/03/20 21:08:09 hohndel Exp $ */
-/************************************************************
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-********************************************************/
-
-/* $XConsortium: iplpolypnt.c,v 5.17 94/04/17 20:28:57 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "ipl.h"
-#include "iplmskbits.h"
-
-#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & ClipMask)
-
-/* WARNING: pbox contains two shorts. This code assumes they are packed
- * and can be referenced together as an INT32.
- */
-
-#define PointLoop(fill) { \
- for (nbox = REGION_NUM_RECTS(cclip), pbox = REGION_RECTS(cclip); \
- --nbox >= 0; \
- pbox++) \
- { \
- c1 = *((INT32 *) &pbox->x1) - off; \
- c2 = *((INT32 *) &pbox->x2) - off - 0x00010001; \
- for (ppt = (INT32 *) pptInit, i = npt; --i >= 0;) \
- { \
- pt = *ppt++; \
- if (!isClipped(pt,c1,c2)) { \
- fill \
- } \
- } \
- } \
-}
-
-void
-iplPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- xPoint *pptInit;
-{
- register INT32 pt;
- register INT32 c1, c2;
- register unsigned long ClipMask = 0x80008000;
- INTER_DECLAREG(*addrg);
- register int ngwidth;
- register int xoffset;
- INTER_DECLAREG(*addrgt);
- register INT32 *ppt;
- RegionPtr cclip;
- int nbox;
- register int i;
- register BoxPtr pbox;
- INTER_DECLARERRAX(and);
- INTER_DECLARERRAX(xor);
- int rop = pGC->alu;
- int off;
- iplPrivGCPtr devPriv;
- xPoint *pptPrev;
-
- devPriv =iplGetGCPrivate(pGC);
- rop = devPriv->rop;
- if (rop == GXnoop)
- return;
- cclip = pGC->pCompositeClip;
- xor = devPriv->xorg;
- and = devPriv->andg;
- if ((mode == CoordModePrevious) && (npt > 1))
- {
- for (pptPrev = pptInit + 1, i = npt - 1; --i >= 0; pptPrev++)
- {
- pptPrev->x += (pptPrev-1)->x;
- pptPrev->y += (pptPrev-1)->y;
- }
- }
- off = *((int *) &pDrawable->x);
- off -= (off & 0x8000) << 1;
- iplGetGroupWidthAndPointer(pDrawable, ngwidth, addrg);
- addrg = addrg + pDrawable->y * ngwidth +
- (pDrawable->x >> INTER_PGSH) * INTER_PLANES;
- xoffset = pDrawable->x & INTER_PIM;
- PointLoop( addrgt = addrg + intToY(pt) * ngwidth
- + ((intToX(pt) + xoffset) >> INTER_PGSH) * INTER_PLANES;
- INTER_DoMaskRRop(addrgt, and, xor,
- iplmask[(intToX(pt) + xoffset) & INTER_PIM], addrgt);
- )
-}
diff --git a/iplan2p4/iplrrop.c b/iplan2p4/iplrrop.c
deleted file mode 100644
index cfc43c130..000000000
--- a/iplan2p4/iplrrop.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplrrop.c,v 3.0 1996/08/18 01:55:03 dawes Exp $ */
-/*
- * $XConsortium: iplrrop.c,v 1.8 94/04/17 20:28:59 dpw Exp $
- *
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-/* ipl reduced rasterop computations */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ipl.h"
-
-#include "iplmskbits.h"
-
-/* A description:
- *
- * There are four possible operations on each bit in the destination word,
- *
- * 1 2 3 4
- *
- * 0 0 0 1 1
- * 1 0 1 0 1
- *
- * On examination of the reduced rop equation (dst = (dst & and) ^ xor),
- * these four fall to reduced rops as follows:
- *
- * and 0 1 1 0
- * xor 0 0 1 1
- *
- * or, (if 'and' is expensive) (dst = (dst | or) ^ xor)
- *
- * or 1 0 0 1
- * xor 1 0 1 0
- *
- * The trouble with using this later equation is that trivial
- * rasterop reduction is more difficult; some common rasterops
- * use complicated expressions of xor/and instead of the simple
- * ones while other common rasterops are not made any simpler:
- *
- * GXcopy: *dst = ~xor instead of *dst = xor
- * GXand: *dst = *dst & ~or instead of *dst = *dst & and
- * GXor: *dst = *dst | or instead of *dst = *dst | xor
- * GXxor: *dst = *dst ^ xor instead of *dst = *dst ^ xor
- *
- * If you're really set on using this second mechanism, the changes
- * are pretty simple.
- *
- * All that remains is to provide a mechanism for computing and/xor values
- * based on the raster op and foreground value.
- *
- * The 16 rops fall as follows, with the associated reduced
- * rop and/xor and or/xor values. The values in parenthesis following the
- * reduced values gives an equation using the source value for
- * the reduced value, and is one of {0, src, ~src, 1} as appropriate.
- *
- * clear and andReverse copy
- * src 0 1 0 1 0 1 0 1
- * dst 0 0 0 0 0 0 0 0 1 0 0 1
- * 1 0 0 1 0 1 1 0 0 1 0 1
- *
- * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0)
- * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src)
- *
- * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1)
- * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src)
- *
- * andInverted noop xor or
- * src 0 1 0 1 0 1 0 1
- * dst 0 0 0 0 0 0 0 0 1 0 0 1
- * 1 1 0 1 1 1 1 1 0 1 1 1
- *
- * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src)
- * xor 0 0 (0) 0 0 (0) 0 1 (src) 0 1 (src)
- *
- * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src)
- * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0)
- *
- * nor equiv invert orReverse
- * src 0 1 0 1 0 1 0 1
- * dst 0 1 0 0 1 0 0 1 1 0 1 1
- * 1 0 0 1 0 1 1 0 0 1 0 1
- *
- * and 1 0 (~src) 1 1 (1) 1 1 (1) 1 0 (~src)
- * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1)
- *
- * or 0 1 (src) 0 0 (0) 0 0 (0) 0 1 (src)
- * xor 1 1 (1) 1 0 (~src) 1 1 (1) 1 0 (~src)
- *
- * copyInverted orInverted nand set
- * src 0 1 0 1 0 1 0 1
- * dst 0 1 0 0 1 0 0 1 1 0 1 1
- * 1 1 0 1 1 1 1 1 0 1 1 1
- *
- * and 0 0 (0) 0 1 (src) 0 1 (src) 0 0 (0)
- * xor 1 0 (~src) 1 0 (~src) 1 1 (1) 1 1 (1)
- *
- * or 1 1 (1) 1 0 (~src) 1 0 (~src) 1 1 (1)
- * xor 0 1 (src) 0 0 (0) 0 1 (src) 0 0 (0)
- */
-
-iplReduceRasterOp (rop, fg, pm, and, xor)
- int rop;
- unsigned long fg, pm;
- unsigned short *and;
- unsigned short *xor;
-{
- int rrop;
- switch (rop)
- {
- case GXclear:
- INTER_CLR(and);
- INTER_CLR(xor);
- break;
- case GXand:
- INTER_PFILL(fg, and);
- INTER_CLR(xor);
- break;
- case GXandReverse:
- INTER_PFILL(fg, and);
- INTER_PFILL(fg, xor);
- break;
- case GXcopy:
- INTER_CLR(and);
- INTER_PFILL(fg, xor);
- break;
- case GXandInverted:
- INTER_PFILL(~fg, xor);
- INTER_CLR(xor);
- break;
- case GXnoop:
- INTER_SET(and);
- INTER_CLR(xor);
- break;
- case GXxor:
- INTER_SET(and);
- INTER_PFILL(fg, xor);
- break;
- case GXor:
- INTER_PFILL(~fg, and);
- INTER_PFILL(fg, xor);
- break;
- case GXnor:
- INTER_PFILL(~fg, and);
- INTER_PFILL(~fg, xor);
- break;
- case GXequiv:
- INTER_SET(and);
- INTER_PFILL(~fg, xor);
- case GXinvert:
- INTER_SET(and);
- INTER_SET(xor);
- break;
- case GXorReverse:
- INTER_PFILL(~fg, and);
- INTER_SET(xor);
- break;
- case GXcopyInverted:
- INTER_CLR(and);
- INTER_PFILL(~fg, xor);
- break;
- case GXorInverted:
- INTER_PFILL(fg, and);
- INTER_PFILL(~fg, xor);
- break;
- case GXnand:
- INTER_PFILL(fg, and);
- INTER_SET(xor);
- break;
- case GXset:
- INTER_CLR(and);
- INTER_SET(xor);
- break;
- }
- INTER_ANDXOR_PM(pm, and, xor);
- if (INTER_IS_CLR(and))
- rrop = GXcopy;
- else if (INTER_IS_SET(and))
- rrop = GXxor;
- else if (INTER_IS_CLR(xor))
- rrop = GXand;
- else if (INTER_IS_XOR_SET(and, xor))
- rrop = GXor;
- else
- rrop = GXset;
- return rrop;
-}
-
diff --git a/iplan2p4/iplrrop.h b/iplan2p4/iplrrop.h
deleted file mode 100644
index d14d1a54b..000000000
--- a/iplan2p4/iplrrop.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplrrop.h,v 3.1 2001/07/25 15:05:09 dawes Exp $ */
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-/* reduced raster ops */
-/* INTER_RROP_DECLARE INTER_RROP_FETCH_GC,
- INTER_RROP_SOLID_MASK, INTER_RROP_SPAN INTER_RROP_NAME */
-
-#define INTER_RROP_FETCH_GC(gc) \
-INTER_RROP_FETCH_GCPRIV(((iplPrivGCPtr)(gc)->devPrivates[iplGCPrivateIndex].ptr))
-
-#if RROP == GXcopy
-#define INTER_RROP_DECLARE register unsigned short *rrop_xor;
-#define INTER_RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xorg;
-#define INTER_RROP_SOLID(dst) INTER_COPY(rrop_xor, dst)
-#define INTER_RROP_SOLID_MASK(dst,mask) INTER_COPYM(rrop_xor, dst, mask, dst)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,Copy)
-#endif /* GXcopy */
-
-#if RROP == GXxor
-#define INTER_RROP_DECLARE register unsigned short *rrop_xor;
-#define INTER_RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xorg;
-#define INTER_RROP_SOLID(dst) INTER_XOR(rrop_xor, dst, dst)
-#define INTER_RROP_SOLID_MASK(dst,mask) INTER_XORM(rrop_xor, dst, mask, dst)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,Xor)
-#endif /* GXxor */
-
-#if RROP == GXand
-#define INTER_RROP_DECLARE register unsigned short *rrop_and;
-#define INTER_RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->andg;
-#define INTER_RROP_SOLID(dst) INTER_AND(rrop_and, dst, dst)
-#define INTER_RROP_SOLID_MASK(dst,mask) INTER_ANDM(rrop_and, dst, mask, dst)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,And)
-#endif /* GXand */
-
-#if RROP == GXor
-#define INTER_RROP_DECLARE register unsigned short *rrop_or;
-#define INTER_RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xorg;
-#define INTER_RROP_SOLID(dst) INTER_OR(rrop_or, dst, dst)
-#define INTER_RROP_SOLID_MASK(dst,mask) INTER_ORM(mask, rrop_or, dst, dst)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,Or)
-#endif /* GXor */
-
-#if RROP == GXnoop
-#define INTER_RROP_DECLARE
-#define INTER_RROP_FETCH_GCPRIV(devPriv)
-#define INTER_RROP_SOLID(dst)
-#define INTER_RROP_SOLID_MASK(dst,mask)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,Noop)
-#endif /* GXnoop */
-
-#if RROP == GXset
-#define INTER_RROP_DECLARE register unsigned short *rrop_and, *rrop_xor;
-#define INTER_RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->andg; \
- rrop_xor = (devPriv)->xorg;
-#define INTER_RROP_SOLID(dst) INTER_DoRRop(dst, rrop_and, rrop_xor, dst)
-#define INTER_RROP_SOLID_MASK(dst,mask) \
- INTER_DoMaskRRop(dst, rrop_and, rrop_xor, mask, dst)
-#define INTER_RROP_NAME(prefix) INTER_RROP_NAME_CAT(prefix,General)
-#endif /* GXset */
-
-#ifndef INTER_RROP_SPAN
-#define INTER_RROP_SPAN(pdst,nmiddle) \
- while (--(nmiddle) >= 0) { \
- INTER_RROP_SOLID(pdst); \
- (pdst) = INTER_NEXT(pdst); \
- }
-
-#endif
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define INTER_RROP_NAME_CAT(prefix,suffix) prefix##suffix
-#else
-#define INTER_RROP_NAME_CAT(prefix,suffix) prefix/**/suffix
-#endif
-
diff --git a/iplan2p4/iplscrinit.c b/iplan2p4/iplscrinit.c
deleted file mode 100644
index 1d7915776..000000000
--- a/iplan2p4/iplscrinit.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplscrinit.c,v 3.3 1998/11/22 10:37:41 dawes Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XConsortium: iplscrinit.c,v 5.32 94/04/17 20:29:00 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "ipl.h"
-#include "mi.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mibstore.h"
-
-
-BSFuncRec iplBSFuncRec = {
- iplSaveAreas,
- iplRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-Bool
-iplCloseScreen (index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- int d;
- DepthPtr depths = pScreen->allowedDepths;
-
- for (d = 0; d < pScreen->numDepths; d++)
- xfree (depths[d].vids);
- xfree (depths);
- xfree (pScreen->visuals);
-#ifdef CFB_NEED_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[iplScreenPrivateIndex].ptr);
-#else
- xfree (pScreen->devPrivate);
-#endif
- return TRUE;
-}
-
-Bool
-iplSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- int i;
- extern RegionPtr (*iplPuntCopyPlane)();
-
- if (!iplAllocatePrivates(pScreen, (int *) 0, (int *) 0))
- return FALSE;
- pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
- pScreen->QueryBestSize = mfbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = iplGetImage;
- pScreen->GetSpans = iplGetSpans;
- pScreen->CreateWindow = iplCreateWindow;
- pScreen->DestroyWindow = iplDestroyWindow;
- pScreen->PositionWindow = iplPositionWindow;
- pScreen->ChangeWindowAttributes = iplChangeWindowAttributes;
- pScreen->RealizeWindow = iplMapWindow;
- pScreen->UnrealizeWindow = iplUnmapWindow;
- pScreen->PaintWindowBackground = iplPaintWindow;
- pScreen->PaintWindowBorder = iplPaintWindow;
- pScreen->CopyWindow = iplCopyWindow;
- pScreen->CreatePixmap = iplCreatePixmap;
- pScreen->DestroyPixmap = iplDestroyPixmap;
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = iplCreateGC;
- pScreen->CreateColormap = iplInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
- pScreen->InstallColormap = iplInstallColormap;
- pScreen->UninstallColormap = iplUninstallColormap;
- pScreen->ListInstalledColormaps = iplListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
- pScreen->ResolveColor = iplResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
-
- mfbRegisterCopyPlaneProc (pScreen, iplCopyPlane);
- return TRUE;
-}
-
-#ifdef CFB_NEED_SCREEN_PRIVATE
-Bool
-iplCreateScreenResources(pScreen)
- ScreenPtr pScreen;
-{
- Bool retval;
-
- pointer oldDevPrivate = pScreen->devPrivate;
- pScreen->devPrivate = pScreen->devPrivates[iplScreenPrivateIndex].ptr;
- retval = miCreateScreenResources(pScreen);
- pScreen->devPrivates[iplScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
- return retval;
-}
-#endif
-
-Bool
-iplFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- int i, j;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pointer oldDevPrivate;
-#endif
- VisualPtr visuals;
- DepthPtr depths;
- int nvisuals;
- int ndepths;
- int rootdepth;
- VisualID defaultVisual;
-
- rootdepth = 0;
- if (!iplInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
- &defaultVisual,((unsigned long)1<<(INTER_PLANES-1)), 8))
- return FALSE;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- oldDevPrivate = pScreen->devPrivate;
-#endif
- if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals))
- return FALSE;
- /* overwrite miCloseScreen with our own */
- pScreen->CloseScreen = iplCloseScreen;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- pScreen->CreateScreenResources = iplCreateScreenResources;
- pScreen->devPrivates[iplScreenPrivateIndex].ptr = pScreen->devPrivate;
- pScreen->devPrivate = oldDevPrivate;
-#endif
- pScreen->BackingStoreFuncs = iplBSFuncRec;
- pScreen->GetScreenPixmap = iplGetScreenPixmap;
- pScreen->SetScreenPixmap = iplSetScreenPixmap;
- return TRUE;
-}
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-iplScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- if (!iplSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width))
- return FALSE;
- if (!iplFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width))
- return FALSE;
-#if INTER_PLANES == 2
-/* This shouldn't be necessary */
- PixmapWidthPaddingInfo[2].padPixelsLog2 = 4;
- PixmapWidthPaddingInfo[2].padRoundUp = 15;
- PixmapWidthPaddingInfo[2].padBytesLog2 = 2;
-#endif
- return TRUE;
-}
-
-PixmapPtr
-iplGetScreenPixmap(pScreen)
- ScreenPtr pScreen;
-{
-#ifdef CFB_NEED_SCREEN_PRIVATE
- return (PixmapPtr)(pScreen->devPrivates[iplScreenPrivateIndex].ptr);
-#else
- return (PixmapPtr)(pScreen->devPrivate.ptr);
-#endif
-}
-
-void
-iplSetScreenPixmap(pPix)
- PixmapPtr pPix;
-{
-#ifdef CFB_NEED_SCREEN_PRIVATE
- if (pPix)
- pPix->drawable.pScreen->devPrivates[iplScreenPrivateIndex].ptr =
- (pointer)pPix;
-#else
- if (pPix)
- pPix->drawable.pScreen->devPrivate.ptr = (pointer)pPix;
-#endif
-}
diff --git a/iplan2p4/iplsetsp.c b/iplan2p4/iplsetsp.c
deleted file mode 100644
index 0533eed71..000000000
--- a/iplan2p4/iplsetsp.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplsetsp.c,v 3.0 1996/08/18 01:55:07 dawes Exp $ */
-/* $XConsortium: iplsetsp.c,v 5.10 94/04/17 20:29:01 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "ipl.h"
-
-#include "iplmskbits.h"
-#include "iplmergerop.h"
-#include "iplpack.h"
-
-/* iplSetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-iplSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemask)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register unsigned int *psrc;
- register int alu; /* raster op */
- INTER_DECLAREG(*pdstBase); /* start of the drawable */
- int widthDst; /* width of drawable in groups */
- unsigned long planemask;
-{
- int w; /* width of scanline in bits */
- INTER_DECLAREG(*pdst); /* where to put the bits */
- INTER_DECLAREGP(tmpSrc); /* scratch buffer to collect bits in */
- int dstBit; /* offset in bits from beginning of
- * word */
- register int nstart; /* number of bits from first partial */
- register int nend; /* " " last partial word */
- int offSrc;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
- int nlMiddle, nl, longs;
- INTER_DECLAREG(*ipsrc);
- INTER_DECLAREG(*tmppsrc);
- INTER_DeclareMergeRop()
-
- INTER_InitializeMergeRop(alu,planemask);
-
- longs=NUM_LONGS(INTER_PLANES, xOrigin, xEnd);
-
- tmppsrc = ipsrc = (unsigned short *)
- ALLOCATE_LOCAL(NUM_TEMP_BYTES(INTER_PLANES,longs));
-
- iplUnpackLine(INTER_PLANES, longs, psrc, ipsrc);
-
- pdst = pdstBase + (y * widthDst) + (xStart >> INTER_PGSH) * INTER_PLANES;
- offSrc = (xStart - xOrigin) & INTER_PIM;
- w = xEnd - xStart;
- dstBit = xStart & INTER_PIM;
-
- ipsrc += ((xStart - xOrigin) >> INTER_PGSH) * INTER_PLANES;
- if (dstBit + w <= INTER_PPG)
- {
- INTER_maskpartialbits(dstBit, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- INTER_maskbits(xStart, w, startmask, endmask, nlMiddle);
- }
- if (startmask)
- nstart = INTER_PPG - dstBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & INTER_PIM;
- else
- nend = 0;
- if (startmask)
- {
- INTER_getbits(ipsrc, offSrc, nstart, tmpSrc);
- INTER_putbitsmropshort(tmpSrc, dstBit, nstart, pdst);
- INTER_NEXT_GROUP(pdst);
- offSrc += nstart;
- if (offSrc > INTER_PLST)
- {
- INTER_NEXT_GROUP(ipsrc);
- offSrc -= INTER_PPG;
- }
- }
- nl = nlMiddle;
- while (nl--)
- {
- INTER_getbits(ipsrc, offSrc, INTER_PPG, tmpSrc);
- INTER_DoMergeRop(tmpSrc, pdst, pdst);
- INTER_NEXT_GROUP(pdst);
- INTER_NEXT_GROUP(ipsrc);
- }
- if (endmask)
- {
- INTER_getbits(ipsrc, offSrc, nend, tmpSrc);
- INTER_putbitsmropshort(tmpSrc, 0, nend, pdst);
- }
- DEALLOCATE_LOCAL(tmppsrc);
-}
-
-
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-iplSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *pcharsrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- unsigned int *psrc = (unsigned int *)pcharsrc;
- INTER_DECLAREG(*pdstBase); /* start of dst bitmap */
- int widthDst; /* width of bitmap in words */
- register BoxPtr pbox, pboxLast, pboxTest;
- register DDXPointPtr pptLast;
- int alu;
- RegionPtr prgnDst;
- int xStart, xEnd;
- int yMax;
-
- alu = pGC->alu;
- prgnDst = iplGetCompositeClip(pGC);
- pptLast = ppt + nspans;
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- yMax = (int) pDrawable->y + (int) pDrawable->height;
-
- pbox = REGION_RECTS(prgnDst);
- pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
-
- if(fSorted)
- {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- pboxTest = pbox;
- while(ppt < pptLast)
- {
- pbox = pboxTest;
- if(ppt->y >= yMax)
- break;
- while(pbox < pboxLast)
- {
- if(pbox->y1 > ppt->y)
- {
- /* scanline is before clip box */
- break;
- }
- else if(pbox->y2 <= ppt->y)
- {
- /* clip box is before scanline */
- pboxTest = ++pbox;
- continue;
- }
- else if(pbox->x1 > ppt->x + *pwidth)
- {
- /* clip box is to right of scanline */
- break;
- }
- else if(pbox->x2 <= ppt->x)
- {
- /* scanline is to right of clip box */
- pbox++;
- continue;
- }
-
- /* at least some of the scanline is in the current clip box */
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(ppt->x + *pwidth, pbox->x2);
- iplSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- pdstBase, widthDst, pGC->planemask);
- if(ppt->x + *pwidth <= pbox->x2)
- {
- /* End of the line, as it were */
- break;
- }
- else
- pbox++;
- }
- /* We've tried this line against every box; it must be outside them
- * all. move on to the next point */
- ppt++;
- psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth);
- pwidth++;
- }
- }
- else
- {
- /* scan lines not sorted. We must clip each line against all the boxes */
- while(ppt < pptLast)
- {
- if(ppt->y >= 0 && ppt->y < yMax)
- {
-
- for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++)
- {
- if(pbox->y1 > ppt->y)
- {
- /* rest of clip region is above this scanline,
- * skip it */
- break;
- }
- if(pbox->y2 <= ppt->y)
- {
- /* clip box is below scanline */
- pbox++;
- break;
- }
- if(pbox->x1 <= ppt->x + *pwidth &&
- pbox->x2 > ppt->x)
- {
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(pbox->x2, ppt->x + *pwidth);
- iplSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- pdstBase, widthDst, pGC->planemask);
- }
-
- }
- }
- psrc += PixmapWidthInPadUnits(*pwidth, pDrawable->depth);
- ppt++;
- pwidth++;
- }
- }
-}
-
diff --git a/iplan2p4/iplsolid.c b/iplan2p4/iplsolid.c
deleted file mode 100644
index 2f741ed7f..000000000
--- a/iplan2p4/iplsolid.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplsolid.c,v 3.1 1998/03/20 21:08:09 hohndel Exp $ */
-/*
- * $XConsortium: iplsolid.c,v 1.9 94/04/17 20:29:02 dpw Exp $
- *
-Copyright (c) 1990 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "ipl.h"
-#include "iplrrop.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-#include "iplmskbits.h"
-
-# define Expand(left, right, leftAdjust) { \
- while (h--) { \
- pdst = pdstRect; \
- left \
- m = nmiddle; \
- INTER_RROP_SPAN(pdst, m); \
- right \
- pdstRect += widthDst; \
- } \
-}
-
-
-void
-INTER_RROP_NAME(iplFillRectSolid) (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox;
- BoxPtr pBox;
-{
- register int m;
- INTER_DECLAREG(*pdst);
- INTER_RROP_DECLARE
- INTER_DECLAREG(leftMask);
- INTER_DECLAREG(rightMask);
- INTER_DECLAREG(*pdstBase);
- INTER_DECLAREG(*pdstRect);
- int nmiddle;
- int h;
- int w;
- int widthDst;
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- INTER_RROP_FETCH_GC(pGC)
-
- for (; nBox; nBox--, pBox++)
- {
- pdstRect = pdstBase + pBox->y1 * widthDst;
- h = pBox->y2 - pBox->y1;
- w = pBox->x2 - pBox->x1;
- pdstRect += (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- if ((pBox->x1 & INTER_PIM) + w <= INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, leftMask);
- pdst = pdstRect;
- while (h--) {
- INTER_RROP_SOLID_MASK (pdst, leftMask);
- pdst += widthDst;
- }
- }
- else
- {
- INTER_maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);
- if (leftMask)
- {
- if (rightMask) /* left mask and right mask */
- {
- Expand(INTER_RROP_SOLID_MASK (pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- INTER_RROP_SOLID_MASK (pdst, rightMask);, 1)
- }
- else /* left mask and no right mask */
- {
- Expand(INTER_RROP_SOLID_MASK (pdst, leftMask);
- INTER_NEXT_GROUP(pdst);,
- ;, 1)
- }
- }
- else
- {
- if (rightMask) /* no left mask and right mask */
- {
- Expand(;,
- INTER_RROP_SOLID_MASK (pdst, rightMask);, 0)
- }
- else /* no left mask and no right mask */
- {
- Expand(;,
- ;, 0)
- }
- }
- }
- }
-}
-
-void
-INTER_RROP_NAME(iplSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- INTER_DECLAREG(*pdstBase);
- int widthDst;
-
- INTER_RROP_DECLARE
-
- INTER_DECLAREG(*pdst);
- register int ngmiddle;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
- register int w;
- int x;
-
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidthFree;/* copies of the pointers to free */
- DDXPointPtr pptFree;
- int *pwidth;
- iplPrivGCPtr devPriv;
-
- devPriv = iplGetGCPrivate(pGC);
- INTER_RROP_FETCH_GCPRIV(devPriv)
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (n--)
- {
- x = ppt->x;
- pdst = pdstBase + (ppt->y * widthDst);
- ++ppt;
- w = *pwidth++;
- if (!w)
- continue;
- if ((x & INTER_PIM) + w <= INTER_PPG)
- {
- pdst += (x >> INTER_PGSH) * INTER_PLANES;
- INTER_maskpartialbits (x, w, startmask);
- INTER_RROP_SOLID_MASK (pdst, startmask);
- }
- else
- {
- pdst += (x >> INTER_PGSH) * INTER_PLANES;
- INTER_maskbits (x, w, startmask, endmask, ngmiddle);
- if (startmask)
- {
- INTER_RROP_SOLID_MASK (pdst, startmask);
- INTER_NEXT_GROUP(pdst);
- }
-
- INTER_RROP_SPAN(pdst,ngmiddle);
-
- if (endmask)
- {
- INTER_RROP_SOLID_MASK (pdst, endmask);
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/iplan2p4/ipltegblt.c b/iplan2p4/ipltegblt.c
deleted file mode 100644
index 4d82a655a..000000000
--- a/iplan2p4/ipltegblt.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/ipltegblt.c,v 3.0 1996/08/18 01:55:09 dawes Exp $ */
-/* $XConsortium: ipltegblt.c,v 5.9 94/04/17 20:29:03 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "ipl.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "mi.h"
-#define MFB_CONSTS_ONLY
-#include "maskbits.h"
-
-#include "iplmskbits.h"
-
-/*
- this works for fonts with glyphs <= 32 bits wide, on an
- arbitrarily deep display. Use iplTEGlyphBlt8 for 8 bit displays.
-
- This should be called only with a terminal-emulator font;
-this means that the FIXED_METRICS flag is set, and that
-glyphbounds == charbounds.
-
- in theory, this goes faster; even if it doesn't, it reduces the
-flicker caused by writing a string over itself with image text (since
-the background gets repainted per character instead of per string.)
-this seems to be important for some converted X10 applications.
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
-*/
-
-void
-iplTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- FontPtr pfont = pGC->font;
- int widthDst;
- INTER_DECLAREG(*pdstBase); /* pointer to group with top row
- of current glyph */
-
- int w; /* width of glyph and char */
- int h; /* height of glyph and char */
- register int xpos=x; /* current x%32 */
- int ypos=y; /* current y%32 */
- register unsigned char *pglyph;
- int widthGlyph;
-
- INTER_DECLAREG(*pdst); /* pointer to current group in dst */
- int hTmp; /* counter for height */
- BoxRec bbox; /* for clipping */
-
- register int wtmp,xtemp,width;
- INTER_DECLAREGP(bgfill);
- INTER_DECLAREGP(fgfill);
- unsigned long *ptemp;
- INTER_DECLAREGP(tmpDst1);
- INTER_DECLAREGP(tmpDst2);
- INTER_DECLAREG(*pdtmp);
- int tmpx;
-
- xpos += pDrawable->x;
- ypos += pDrawable->y;
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- wtmp = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
- widthGlyph = GLYPHWIDTHBYTESPADDED(*ppci);
-
- xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
- ypos -= FONTASCENT(pfont);
-
- bbox.x1 = xpos;
- bbox.x2 = xpos + (wtmp * nglyph);
- bbox.y1 = ypos;
- bbox.y2 = ypos + h;
-
- INTER_PFILL(pGC->fgPixel, fgfill);
- INTER_PFILL(pGC->bgPixel, bgfill);
-
- switch (RECT_IN_REGION(pGC->pScreen, iplGetCompositeClip(pGC), &bbox))
- {
- case rgnOUT:
- break;
- case rgnPART:
- /* this is the WRONG thing to do, but it works.
- calling the non-terminal text is easy, but slow, given
- what we know about the font.
-
- the right thing to do is something like:
- for each clip rectangle
- compute at which row the glyph starts to be in it,
- and at which row the glyph ceases to be in it
- compute which is the first glyph inside the left
- edge, and the last one inside the right edge
- draw a fractional first glyph, using only
- the rows we know are in
- draw all the whole glyphs, using the appropriate rows
- draw any pieces of the last glyph, using the right rows
-
- this way, the code would take advantage of knowing that
- all glyphs are the same height and don't overlap.
-
- one day...
- */
-#if 1
- miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-#endif
- break;
- case rgnIN:
-
- pdtmp = pdstBase + (widthDst * ypos);
- while(nglyph--)
- {
-
- pglyph = FONTGLYPHBITS(pglyphBase, *ppci++);
- pdst = pdtmp;
- hTmp = h;
-
- while (hTmp--)
- {
- x = xpos;
- width = wtmp;
- xtemp = 0;
-
- while (width > 0)
- {
- tmpx = x & INTER_PIM;
- w = min(width, INTER_PPG - tmpx);
- /* w = min(w, (PGSZ - xtemp)); */
-
- ptemp = (unsigned long *)(pglyph + (xtemp >> MFB_PWSH));
-#if 1
- INTER_getstipplepixelsb(ptemp,xtemp,w,bgfill,fgfill,tmpDst1);
-#endif
- {
- INTER_DECLAREG(*pdsttmp) =
- pdst + (x >> INTER_PGSH) * INTER_PLANES;
-#if 1
- INTER_putbits(tmpDst1,tmpx,w,pdsttmp,pGC->planemask);
-#endif
- }
- x += w;
- xtemp += w;
- width -= w;
- }
- pglyph += widthGlyph;
- pdst += widthDst;
- }
- xpos += wtmp;
- }
- break;
- }
-}
diff --git a/iplan2p4/ipltile32.c b/iplan2p4/ipltile32.c
deleted file mode 100644
index ea608effb..000000000
--- a/iplan2p4/ipltile32.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/ipltile32.c,v 3.1 1998/03/20 21:08:09 hohndel Exp $ */
-/*
- * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow.
- * no depth dependencies.
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-*/
-
-/* $XConsortium: ipltile32.c,v 1.8 94/04/17 20:29:05 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "ipl.h"
-
-#include "mi.h"
-#include "mispans.h"
-
-#include "iplmskbits.h"
-#include "iplmergerop.h"
-
-#define STORE(p) INTER_MROP_PREBUILT_SOLID(srcpix, p, p)
-
-#define Expand(left,right) {\
- while (h--) { \
- INTER_COPY(psrc+srcy*INTER_PLANES, srcpix); \
- INTER_MROP_PREBUILD(srcpix); \
- ++srcy; \
- if (srcy == tileHeight) \
- srcy = 0; \
- left \
- ngw = ngwMiddle; \
- while (ngw--) \
- { \
- STORE(p); \
- INTER_NEXT_GROUP(p); \
- } \
- right \
- p += ngwExtra; \
- } \
-}
-
-void
-INTER_MROP_NAME(iplFillRectTile32) (pDrawable, pGC, nBox, pBox)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nBox; /* number of boxes to fill */
- BoxPtr pBox; /* pointer to list of boxes to fill */
-{
- INTER_DECLAREGP(srcpix);
- INTER_DECLAREG(*psrc); /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
-
- int ngwDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- register int h; /* height of current box */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask); /* masks for reggedy bits at either end of line */
- int ngwMiddle; /* number of longwords between sides of boxes */
- int ngwExtra; /* to get from right of box to left of next span */
- register int ngw; /* loop version of ngwMiddle */
- INTER_DECLAREG(*p); /* pointer to bits we're writing */
- int y; /* current scan line */
- int srcy; /* current tile position */
-
- INTER_DECLAREG(*pbits); /* pointer to start of pixmap */
- PixmapPtr tile; /* rotated, expanded tile */
- INTER_MROP_DECLARE_REG()
- INTER_MROP_PREBUILT_DECLARE()
-
- tile = pGC->pRotatedPixmap;
- tileHeight = tile->drawable.height;
- psrc = (unsigned short *)tile->devPrivate.ptr;
-
- INTER_MROP_INITIALIZE(pGC->alu, pGC->planemask);
-
- iplGetGroupWidthAndPointer (pDrawable, ngwDst, pbits)
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- y = pBox->y1;
- p = pbits + (y * ngwDst) + (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- srcy = y % tileHeight;
-
- if ( ((pBox->x1 & INTER_PIM) + w) <= INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, startmask);
- ngwExtra = ngwDst;
- while (h--)
- {
- INTER_COPY(psrc+srcy*INTER_PLANES, srcpix);
- INTER_MROP_PREBUILD(srcpix);
- ++srcy;
- if (srcy == tileHeight)
- srcy = 0;
- INTER_MROP_PREBUILT_MASK(srcpix, p, startmask, p);
- p += ngwExtra;
- }
- }
- else
- {
- INTER_maskbits(pBox->x1, w, startmask, endmask, ngwMiddle);
- ngwExtra = ngwDst - ngwMiddle * INTER_PLANES;
-
- if (startmask)
- {
- ngwExtra -= INTER_PLANES;
- if (endmask)
- {
- Expand(
- INTER_MROP_PREBUILT_MASK(srcpix, p, startmask, p);
- INTER_NEXT_GROUP(p);,
- INTER_MROP_PREBUILT_MASK(srcpix, p, endmask, p));
- }
- else
- {
- Expand(
- INTER_MROP_PREBUILT_MASK(srcpix, p, startmask, p);
- INTER_NEXT_GROUP(p);,
- ;)
- }
- }
- else
- {
- if (endmask)
- {
- Expand(;,
- INTER_MROP_PREBUILT_MASK(srcpix, p, endmask, p));
- }
- else
- {
- Expand(;,
- ;)
- }
- }
- }
- pBox++;
- }
-}
-
-void
-INTER_MROP_NAME(iplTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- DDXPointPtr ppt; /* pointer to list of start points */
- int *pwidth;/* pointer to list of n widths */
- INTER_DECLAREG(*pbits); /* pointer to start of bitmap */
- int ngwDst; /* width in longwords of bitmap */
- INTER_DECLAREG(*p); /* pointer to current longword in bitmap */
- register int w; /* current span width */
- register int ngw;
- register int x;
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);
- INTER_DECLAREGP(srcpix);
- int y;
- int *pwidthFree;/* copies of the pointers to free */
- DDXPointPtr pptFree;
- PixmapPtr tile;
- INTER_DECLAREG(*psrc); /* pointer to bits in tile */
- int tileHeight;/* height of the tile */
- INTER_MROP_DECLARE_REG ()
- INTER_MROP_PREBUILT_DECLARE()
-
- n = nInit * miFindMaxBand( iplGetCompositeClip(pGC) );
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans( iplGetCompositeClip(pGC),
- pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- tile = pGC->pRotatedPixmap;
- tileHeight = tile->drawable.height;
- psrc = (unsigned short *)tile->devPrivate.ptr;
-
- INTER_MROP_INITIALIZE(pGC->alu, pGC->planemask);
-
- iplGetGroupWidthAndPointer (pDrawable, ngwDst, pbits)
-
- {
- while (n--)
- {
- x = ppt->x;
- y = ppt->y;
- ++ppt;
- w = *pwidth++;
- p = pbits + (y * ngwDst) + (x >> INTER_PGSH) * INTER_PLANES;
- INTER_COPY(psrc +(y % tileHeight)*INTER_PLANES,srcpix);
- INTER_MROP_PREBUILD(srcpix);
-
- if ((x & INTER_PIM) + w < INTER_PPG)
- {
- INTER_maskpartialbits(x, w, startmask);
- INTER_MROP_PREBUILT_MASK(srcpix, p, startmask, p);
- }
- else
- {
- INTER_maskbits(x, w, startmask, endmask, ngw);
- if (startmask)
- {
- INTER_MROP_PREBUILT_MASK(srcpix, p, startmask, p);
- INTER_NEXT_GROUP(p);
- }
- while (ngw--)
- {
- STORE(p);
- INTER_NEXT_GROUP(p);
- }
- if (endmask)
- {
- INTER_MROP_PREBUILT_MASK(srcpix, p, endmask, p);
- }
- }
- }
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/iplan2p4/ipltileodd.c b/iplan2p4/ipltileodd.c
deleted file mode 100644
index a63ce5da6..000000000
--- a/iplan2p4/ipltileodd.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/ipltileodd.c,v 3.0 1996/08/18 01:55:11 dawes Exp $ */
-/*
- * Fill odd tiled rectangles and spans.
- * no depth dependencies.
- */
-
-/*
-
-Copyright (c) 1989 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-*/
-
-/* $XConsortium: ipltileodd.c,v 1.16 94/04/17 20:29:06 dpw Exp $ */
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-
-#include "ipl.h"
-
-#include "iplmskbits.h"
-#include "iplmergerop.h"
-
-#define LEFTSHIFT_AMT 0
-
-#define LastTileBits {\
- INTER_COPY(bits, tmp); \
- if (tileEndPart) \
- INTER_MSKINSM(tileEndMask, 0, pSrc, \
- ~0, tileEndLeftShift, pSrcLine, bits) \
- else \
- INTER_COPY(pSrc, bits); \
-}
-
-#define ResetTileBits {\
- pSrc = pSrcLine; \
- nlwSrc = widthSrc;\
- if (tileEndPart) { \
- if (INTER_PPG - xoff + tileEndPart <= INTER_PPG) {\
- INTER_COPY(pSrc, bits); INTER_NEXT_GROUP(pSrc); \
- nlwSrc--; \
- } else \
- INTER_MSKINSM(~0, tileEndLeftShift, tmp, \
- ~0, tileEndRightShift, bits, bits); \
- xoff = (xoff + xoffStep) & INTER_PIM; \
- leftShift = xoff << LEFTSHIFT_AMT; \
- rightShift = INTER_PGSZ - leftShift; \
- }\
-}
-
-#define NextTileBits {\
- if (nlwSrc == 1) {\
- LastTileBits\
- } else { \
- if (nlwSrc == 0) {\
- ResetTileBits\
- } \
- if (nlwSrc == 1) {\
- LastTileBits\
- } else {\
- INTER_COPY(bits, tmp); \
- INTER_COPY(pSrc, bits); INTER_NEXT_GROUP(pSrc); \
- }\
- }\
- nlwSrc--; \
-}
-
-void
-INTER_MROP_NAME(iplFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- register BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* tile */
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile in pixels */
- int tileHeight; /* height of the tile */
- int widthSrc;
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- int h; /* height of current box */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);/* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwSrc; /* number of whole longwords in source */
-
- register int nlw; /* loop version of nlwMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int xoffDst, xoffSrc;
- int leftShift, rightShift;
-
- INTER_MROP_DECLARE_REG()
-
- INTER_DECLAREG(*pDstBase); /* pointer to start of dest */
- INTER_DECLAREG(*pDstLine); /* poitner to start of dest box */
- INTER_DECLAREG(*pSrcBase); /* pointer to start of source */
- INTER_DECLAREG(*pSrcLine); /* pointer to start of source line */
- INTER_DECLAREG(*pDst);
- INTER_DECLAREG(*pSrc);
- INTER_DECLAREGP(bits);
- INTER_DECLAREGP(tmp);
- INTER_DECLAREGP(tmp1);
- register int nlwPart;
- int xoffStart, xoff;
- int leftShiftStart, rightShiftStart, nlwSrcStart;
- INTER_DECLAREG(tileEndMask);
- int tileEndLeftShift, tileEndRightShift;
- int xoffStep;
- int tileEndPart;
- int needFirst;
- unsigned short narrow[2 * INTER_PLANES];
- INTER_DECLAREG(narrowMask);
- int narrowShift;
- Bool narrowTile;
- int narrowRep;
-
- INTER_MROP_INITIALIZE (alu, planemask)
-
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / (INTER_PGSZB * INTER_PLANES);
- narrowTile = FALSE;
-
- if (widthSrc == 1)
- {
- narrowRep = INTER_PPG / tileWidth;
- narrowMask = iplendpartial [tileWidth];
- tileWidth *= narrowRep;
- narrowShift = tileWidth;
- tileWidth *= 2;
- widthSrc = 2;
- narrowTile = TRUE;
- }
- pSrcBase = (unsigned short *)tile->devPrivate.ptr;
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pDstBase)
-
- tileEndPart = tileWidth & INTER_PIM;
- tileEndMask = iplendpartial[tileEndPart];
- tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT;
- tileEndRightShift = INTER_PGSZ - tileEndLeftShift;
- xoffStep = INTER_PPG - tileEndPart;
- /*
- * current assumptions: tile > 32 bits wide.
- */
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
- modulus (pBox->x1 - xrot, tileWidth, srcx);
- modulus (pBox->y1 - yrot, tileHeight, srcy);
- xoffDst = pBox->x1 & INTER_PIM;
- if (xoffDst + w < INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, startmask);
- endmask = 0;
- nlwMiddle = 0;
- }
- else
- {
- INTER_maskbits (pBox->x1, w, startmask, endmask, nlwMiddle)
- }
- pDstLine = pDstBase + (pBox->y1 * widthDst) +
- (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- pSrcLine = pSrcBase + (srcy * widthSrc) * INTER_PLANES;
- xoffSrc = srcx & INTER_PIM;
- if (xoffSrc >= xoffDst)
- {
- xoffStart = xoffSrc - xoffDst;
- needFirst = 1;
- }
- else
- {
- xoffStart = INTER_PPG - (xoffDst - xoffSrc);
- needFirst = 0;
- }
- leftShiftStart = (xoffStart) << LEFTSHIFT_AMT;
- rightShiftStart = INTER_PGSZ - leftShiftStart;
- nlwSrcStart = (widthSrc - (srcx >> INTER_PGSH));
- while (h--)
- {
- /* XXX only works when narrowShift >= INTER_PPG/2 */
- if (narrowTile)
- {
- int tmpnarrowRep;
- int shift=narrowShift/narrowRep;
- INTER_ANDMSK(pSrcBase + srcy * INTER_PLANES, narrowMask, tmp);
- tmpnarrowRep=narrowRep;
- /* copy tile until its nearly a whole group wide */
- while (--tmpnarrowRep)
- INTER_MSKINSM(~0,0,tmp,~0,shift,tmp,tmp);
- INTER_MSKINSM(~0, 0, tmp, ~0, narrowShift, tmp, narrow);
- INTER_MSKINSM(~0, INTER_PPG - narrowShift, tmp,
- ~0, 2 * narrowShift - INTER_PPG, tmp,
- narrow + INTER_PLANES);
- pSrcLine = narrow;
- }
- xoff = xoffStart;
- leftShift = leftShiftStart;
- rightShift = rightShiftStart;
- nlwSrc = nlwSrcStart;
- pSrc = pSrcLine + (srcx >> INTER_PGSH) * INTER_PLANES;
- pDst = pDstLine;
- INTER_CLR(bits);
- if (needFirst)
- {
- NextTileBits
- }
- if (startmask)
- {
- NextTileBits
- INTER_SCRLEFT(leftShift, tmp, tmp);
- if (rightShift != INTER_PGSZ)
- INTER_MSKINSM(~0, 0, tmp, ~0, rightShift, bits, tmp)
- INTER_MROP_MASK (tmp, pDst, startmask, pDst);
- INTER_NEXT_GROUP(pDst);
- }
- nlw = nlwMiddle;
- while (nlw)
- {
- {
- NextTileBits
- if (rightShift != INTER_PGSZ)
- {
- INTER_MSKINSM(~0, leftShift, tmp, ~0, rightShift, bits,
- tmp1);
- INTER_MROP_SOLID(tmp1, pDst, pDst);
- }
- else
- {
- INTER_MROP_SOLID (tmp, pDst, pDst);
- }
- INTER_NEXT_GROUP(pDst);
- nlw--;
- }
- }
- if (endmask)
- {
- NextTileBits
- if (rightShift == INTER_PGSZ)
- INTER_CLR(bits);
- INTER_MSKINSM(~0, leftShift, tmp, ~0, rightShift, bits, tmp1);
- INTER_MROP_MASK(tmp1, pDst, endmask, pDst);
- }
- pDstLine += widthDst;
- pSrcLine += widthSrc * INTER_PLANES;
- if (++srcy == tileHeight)
- {
- srcy = 0;
- pSrcLine = pSrcBase;
- }
- }
- pBox++;
- }
-}
-
-void
-INTER_MROP_NAME(iplFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int n;
- DDXPointPtr ppt;
- int *pwidth;
- PixmapPtr tile;
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile in pixels */
- int tileHeight; /* height of the tile */
- int widthSrc;
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current span */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG (endmask); /* masks for reggedy bits at either end of line */
- int nlwSrc; /* number of whole longwords in source */
-
- register int nlw; /* loop version of nlwMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int xoffDst, xoffSrc;
- int leftShift, rightShift;
-
- INTER_MROP_DECLARE_REG()
-
- INTER_DECLAREG(*pDstBase); /* pointer to start of dest */
- INTER_DECLAREG(*pDstLine); /* poitner to start of dest box */
- INTER_DECLAREG(*pSrcBase); /* pointer to start of source */
- INTER_DECLAREG(*pSrcLine); /* pointer to start of source line */
- INTER_DECLAREG(*pDst);
- INTER_DECLAREG(*pSrc);
- INTER_DECLAREGP(bits);
- INTER_DECLAREGP(tmp);
- INTER_DECLAREGP(tmp1);
- register int nlwPart;
- int xoffStart, xoff;
- int leftShiftStart, rightShiftStart, nlwSrcStart;
- INTER_DECLAREG(tileEndMask);
- int tileEndLeftShift, tileEndRightShift;
- int xoffStep;
- int tileEndPart;
- int needFirst;
- unsigned short narrow[2 * INTER_PLANES];
- INTER_DECLAREG(narrowMask);
- int narrowShift;
- Bool narrowTile;
- int narrowRep;
-
- INTER_MROP_INITIALIZE (alu, planemask)
-
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / (INTER_PGSZB * INTER_PLANES);
- narrowTile = FALSE;
- if (widthSrc == 1)
- {
- narrowRep = INTER_PPG / tileWidth;
- narrowMask = iplendpartial [tileWidth];
- tileWidth *= narrowRep;
- narrowShift = tileWidth;
- tileWidth *= 2;
- widthSrc = 2;
- narrowTile = TRUE;
- }
- pSrcBase = (unsigned short *)tile->devPrivate.ptr;
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pDstBase)
-
- tileEndPart = tileWidth & INTER_PIM;
- tileEndMask = iplendpartial[tileEndPart];
- tileEndLeftShift = (tileEndPart) << LEFTSHIFT_AMT;
- tileEndRightShift = INTER_PGSZ - tileEndLeftShift;
- xoffStep = INTER_PPG - tileEndPart;
- while (n--)
- {
- w = *pwidth++;
- modulus (ppt->x - xrot, tileWidth, srcx);
- modulus (ppt->y - yrot, tileHeight, srcy);
- xoffDst = ppt->x & INTER_PIM;
- if (xoffDst + w < INTER_PPG)
- {
- INTER_maskpartialbits(ppt->x, w, startmask);
- endmask = 0;
- nlw = 0;
- }
- else
- {
- INTER_maskbits (ppt->x, w, startmask, endmask, nlw)
- }
- pDstLine = pDstBase + (ppt->y * widthDst) +
- (ppt->x >> INTER_PGSH) * INTER_PLANES;
- pSrcLine = pSrcBase + (srcy * widthSrc) * INTER_PLANES;
- xoffSrc = srcx & INTER_PIM;
- if (xoffSrc >= xoffDst)
- {
- xoffStart = xoffSrc - xoffDst;
- needFirst = 1;
- }
- else
- {
- xoffStart = INTER_PPG - (xoffDst - xoffSrc);
- needFirst = 0;
- }
- leftShiftStart = (xoffStart) << LEFTSHIFT_AMT;
- rightShiftStart = INTER_PGSZ - leftShiftStart;
- nlwSrcStart = widthSrc - (srcx >> INTER_PGSH);
- /* XXX only works when narrowShift >= INTER_PPG/2 */
- if (narrowTile)
- {
- int tmpnarrowRep;
- int shift=narrowShift/narrowRep;
- INTER_ANDMSK(pSrcBase + srcy * INTER_PLANES, narrowMask, tmp);
- tmpnarrowRep=narrowRep;
- /* copy tile until its nearly a whole group wide */
- while (--tmpnarrowRep)
- INTER_MSKINSM(~0,0,tmp,~0,shift,tmp,tmp);
- INTER_MSKINSM(~0, 0, tmp, ~0, narrowShift, tmp, narrow);
- INTER_MSKINSM(~0, INTER_PPG - narrowShift, tmp,
- ~0, 2 * narrowShift - INTER_PPG, tmp,
- narrow + INTER_PLANES);
- pSrcLine = narrow;
- }
- xoff = xoffStart;
- leftShift = leftShiftStart;
- rightShift = rightShiftStart;
- nlwSrc = nlwSrcStart;
- pSrc = pSrcLine + (srcx >> INTER_PGSH) * INTER_PLANES;
- pDst = pDstLine;
- INTER_CLR(bits);
- if (needFirst)
- {
- NextTileBits
- }
- if (startmask)
- {
- NextTileBits
- INTER_SCRLEFT(leftShift, tmp, tmp);
- if (rightShift != INTER_PGSZ)
- INTER_MSKINSM(~0, 0, tmp, ~0, rightShift, bits, tmp);
- INTER_MROP_MASK (tmp, pDst, startmask, pDst);
- INTER_NEXT_GROUP(pDst);
- }
- while (nlw)
- {
- {
- NextTileBits
- if (rightShift != INTER_PGSZ)
- {
- INTER_MSKINSM(~0, leftShift, tmp, ~0, rightShift, bits,
- tmp1);
- INTER_MROP_SOLID(tmp1, pDst, pDst);
- INTER_NEXT_GROUP(pDst);
- }
- else
- {
- INTER_MROP_SOLID (tmp, pDst, pDst);
- INTER_NEXT_GROUP(pDst);
- }
- nlw--;
- }
- }
- if (endmask)
- {
- NextTileBits
- if (rightShift == INTER_PGSZ)
- INTER_CLR(bits);
-
- INTER_MSKINSM(~0, leftShift, tmp, ~0, rightShift, bits, tmp1);
- INTER_MROP_MASK(tmp1, pDst, endmask, pDst);
- }
- ppt++;
- }
-}
-
-# include "fastblt.h"
-
-#define IncSrcPtr INTER_NEXT_GROUP(psrc); if (!--srcRemaining) { srcRemaining = widthSrc; psrc = psrcStart; }
-
-void
-INTER_MROP_NAME(iplFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int nBox; /* number of boxes to fill */
- register BoxPtr pBox; /* pointer to list of boxes to fill */
- PixmapPtr tile; /* tile */
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile */
- int tileHeight; /* height of the tile */
- int widthSrc; /* width in longwords of the source tile */
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- int h; /* height of current box */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask); /* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
-
- register int nl; /* loop version of nlMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int srcRemaining; /* number of longwords remaining in source */
- int xoffDst, xoffSrc;
- int srcStart; /* number of longwords source offset at left of box */
- int leftShift, rightShift;
-
- INTER_MROP_DECLARE_REG()
-
- INTER_DECLAREG(*pdstBase); /* pointer to start of dest */
- INTER_DECLAREG(*pdstLine); /* poitner to start of dest box */
- INTER_DECLAREG(*psrcBase); /* pointer to start of source */
- INTER_DECLAREG(*psrcLine); /* pointer to fetch point of source */
- INTER_DECLAREG(*psrcStart); /* pointer to start of source line */
- INTER_DECLAREG(*pdst);
- INTER_DECLAREG(*psrc);
- INTER_DECLAREGP(bits);
- INTER_DECLAREGP(bits1);
- register int nlTemp;
-
- INTER_MROP_INITIALIZE (alu, planemask)
-
- psrcBase = (unsigned short *)tile->devPrivate.ptr;
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / (INTER_PGSZB * INTER_PLANES);
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (nBox--)
- {
- w = pBox->x2 - pBox->x1;
- h = pBox->y2 - pBox->y1;
-
- /* set up source */
- modulus (pBox->x1 - xrot, tileWidth, srcx);
- modulus (pBox->y1 - yrot, tileHeight, srcy);
- xoffSrc = srcx & INTER_PIM;
- srcStart = srcx >> INTER_PGSH;
- psrcStart = psrcBase + (srcy * widthSrc) * INTER_PLANES;
- psrcLine = psrcStart + srcStart * INTER_PLANES;
-
- /* set up dest */
- xoffDst = pBox->x1 & INTER_PIM;
- pdstLine = pdstBase + (pBox->y1 * widthDst) +
- (pBox->x1 >> INTER_PGSH) * INTER_PLANES;
- /* set up masks */
- if (xoffDst + w < INTER_PPG)
- {
- INTER_maskpartialbits(pBox->x1, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- INTER_maskbits (pBox->x1, w, startmask, endmask, nlMiddle)
- }
- if (xoffSrc == xoffDst)
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- srcRemaining = widthSrc - srcStart;
- if (startmask)
- {
- INTER_MROP_MASK (psrc, pdst, startmask, pdst);
- INTER_NEXT_GROUP(pdst);
- IncSrcPtr
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
- while (nl--) {
- INTER_MROP_SOLID (psrc, pdst, pdst);
- INTER_NEXT_GROUP(pdst); INTER_NEXT_GROUP(psrc);
- }
-
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
- if (endmask)
- {
- INTER_MROP_MASK (psrc, pdst, endmask, pdst);
- }
- pdstLine += widthDst;
- psrcLine += widthSrc * INTER_PLANES;
- psrcStart += widthSrc * INTER_PLANES;
- if (++srcy == tileHeight)
- {
- psrcStart = psrcBase;
- psrcLine = psrcStart + srcStart * INTER_PLANES;
- srcy = 0;
- }
- }
- }
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT;
- rightShift = INTER_PGSZ - leftShift;
- }
- else
- {
- rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT;
- leftShift = INTER_PGSZ - rightShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- INTER_CLR(bits);
- srcRemaining = widthSrc - srcStart;
- if (xoffSrc > xoffDst)
- {
- INTER_COPY(psrc, bits);
- IncSrcPtr
- }
- if (startmask)
- {
- INTER_SCRLEFT(leftShift, bits, bits1);
- INTER_COPY(psrc, bits);
- IncSrcPtr
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- INTER_MROP_MASK(bits1, pdst, startmask, pdst);
- INTER_NEXT_GROUP(pdst);
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
- while (nl--) {
- INTER_SCRLEFT(leftShift, bits, bits1);
- INTER_COPY(psrc, bits); INTER_NEXT_GROUP(psrc);
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- INTER_MROP_SOLID (bits1, pdst, pdst);
- INTER_NEXT_GROUP(pdst);
- }
-
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
-
- if (endmask)
- {
- INTER_SCRLEFT(leftShift, bits, bits1);
- if (endmask << rightShift)
- {
- INTER_COPY(psrc, bits);
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- }
- INTER_MROP_MASK (bits1, pdst, endmask, pdst);
- }
- pdstLine += widthDst;
- psrcLine += widthSrc * INTER_PLANES;
- psrcStart += widthSrc * INTER_PLANES;
- if (++srcy == tileHeight)
- {
- psrcStart = psrcBase;
- psrcLine = psrcStart + srcStart * INTER_PLANES;
- srcy = 0;
- }
- }
- }
- pBox++;
- }
-}
-
-void
-INTER_MROP_NAME(iplFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask)
- DrawablePtr pDrawable;
- int n;
- DDXPointPtr ppt;
- int *pwidth;
- PixmapPtr tile;
- int xrot, yrot;
- int alu;
- unsigned long planemask;
-{
- int tileWidth; /* width of tile */
- int tileHeight; /* height of the tile */
- int widthSrc; /* width in longwords of the source tile */
-
- int widthDst; /* width in longwords of the dest pixmap */
- int w; /* width of current box */
- INTER_DECLAREG(startmask);
- INTER_DECLAREG(endmask);/* masks for reggedy bits at either end of line */
- int nlMiddle; /* number of longwords between sides of boxes */
-
- register int nl; /* loop version of nlMiddle */
- int srcy; /* current tile y position */
- int srcx; /* current tile x position */
- int srcRemaining; /* number of longwords remaining in source */
- int xoffDst, xoffSrc;
- int srcStart; /* number of longwords source offset at left of box */
- int leftShift, rightShift;
-
- INTER_MROP_DECLARE_REG()
-
- INTER_DECLAREG(*pdstBase); /* pointer to start of dest */
- INTER_DECLAREG(*pdstLine); /* poitner to start of dest box */
- INTER_DECLAREG(*psrcBase); /* pointer to start of source */
- INTER_DECLAREG(*psrcLine); /* pointer to fetch point of source */
- INTER_DECLAREG(*psrcStart); /* pointer to start of source line */
- INTER_DECLAREG(*pdst);
- INTER_DECLAREG(*psrc);
- INTER_DECLAREGP(bits);
- INTER_DECLAREGP(bits1);
- register int nlTemp;
-
- INTER_MROP_INITIALIZE (alu, planemask)
-
- psrcBase = (unsigned short *)tile->devPrivate.ptr;
- tileHeight = tile->drawable.height;
- tileWidth = tile->drawable.width;
- widthSrc = tile->devKind / (INTER_PGSZB * INTER_PLANES);
-
- iplGetGroupWidthAndPointer (pDrawable, widthDst, pdstBase)
-
- while (n--)
- {
- w = *pwidth++;
-
- /* set up source */
- modulus (ppt->x - xrot, tileWidth, srcx);
- modulus (ppt->y - yrot, tileHeight, srcy);
- xoffSrc = srcx & INTER_PIM;
- srcStart = srcx >> INTER_PGSH;
- psrcStart = psrcBase + (srcy * widthSrc) * INTER_PLANES;
- psrcLine = psrcStart + srcStart * INTER_PLANES;
-
- /* set up dest */
- xoffDst = ppt->x & INTER_PIM;
- pdstLine = pdstBase + (ppt->y * widthDst) +
- (ppt->x >> INTER_PGSH) * INTER_PLANES;
- /* set up masks */
- if (xoffDst + w < INTER_PPG)
- {
- INTER_maskpartialbits(ppt->x, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- INTER_maskbits (ppt->x, w, startmask, endmask, nlMiddle)
- }
-
- if (xoffSrc == xoffDst)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- srcRemaining = widthSrc - srcStart;
- if (startmask)
- {
- INTER_MROP_MASK (psrc, pdst, startmask, pdst);
- INTER_NEXT_GROUP(pdst);
- IncSrcPtr
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
- while (nl--) {
- INTER_MROP_SOLID (psrc, pdst, pdst);
- INTER_NEXT_GROUP(pdst); INTER_NEXT_GROUP(psrc);
- }
-
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
- if (endmask)
- {
- INTER_MROP_MASK (psrc, pdst, endmask, pdst);
- }
- }
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = (xoffSrc - xoffDst) << LEFTSHIFT_AMT;
- rightShift = INTER_PGSZ - leftShift;
- }
- else
- {
- rightShift = (xoffDst - xoffSrc) << LEFTSHIFT_AMT;
- leftShift = INTER_PGSZ - rightShift;
- }
- psrc = psrcLine;
- pdst = pdstLine;
- INTER_CLR(bits);
- srcRemaining = widthSrc - srcStart;
- if (xoffSrc > xoffDst)
- {
- INTER_COPY(psrc, bits);
- IncSrcPtr
- }
- if (startmask)
- {
- INTER_SCRLEFT(leftShift, bits, bits1);
- INTER_COPY(psrc, bits);
- IncSrcPtr
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- INTER_MROP_MASK(bits1, pdst, startmask, pdst);
- INTER_NEXT_GROUP(pdst);
- }
- nlTemp = nlMiddle;
- while (nlTemp)
- {
- nl = nlTemp;
- if (nl > srcRemaining)
- nl = srcRemaining;
-
- nlTemp -= nl;
- srcRemaining -= nl;
-
- while (nl--) {
- INTER_SCRLEFT(leftShift, bits, bits1);
- INTER_COPY(psrc, bits); INTER_NEXT_GROUP(psrc);
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- INTER_MROP_SOLID(bits1, pdst, pdst);
- INTER_NEXT_GROUP(pdst);
- }
-
- if (!srcRemaining)
- {
- srcRemaining = widthSrc;
- psrc = psrcStart;
- }
- }
-
- if (endmask)
- {
- INTER_SCRLEFT(leftShift, bits, bits1);
- if (endmask << rightShift)
- {
- INTER_COPY(psrc, bits);
- INTER_MSKINSM(~0, 0, bits1, ~0, rightShift, bits, bits1);
- }
- INTER_MROP_MASK (bits1, pdst, endmask, pdst);
- }
- }
- ppt++;
- }
-}
diff --git a/iplan2p4/iplwindow.c b/iplan2p4/iplwindow.c
deleted file mode 100644
index 39d1eff9b..000000000
--- a/iplan2p4/iplwindow.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/* $XFree86: xc/programs/Xserver/iplan2p4/iplwindow.c,v 3.1 2003/11/10 18:22:45 tsi Exp $ */
-/* $XConsortium: iplwindow.c,v 5.22 94/04/17 20:29:07 dpw Exp $ */
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* Modified nov 94 by Martin Schaller (Martin_Schaller@maus.r.de) for use with
-interleaved planes */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "ipl.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "iplmskbits.h"
-
-extern WindowPtr *WindowTable;
-
-Bool
-iplCreateWindow(pWin)
- WindowPtr pWin;
-{
- iplPrivWin *pPrivWin;
-
- pPrivWin = iplGetWindowPrivate(pWin);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
- pPrivWin->oldRotate.x = 0;
- pPrivWin->oldRotate.y = 0;
-
-#ifdef PIXMAP_PER_WINDOW
- /* Setup pointer to Screen pixmap */
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- (pointer) iplGetScreenPixmap(pWin->drawable.pScreen);
-#endif
-
- return TRUE;
-}
-
-Bool
-iplDestroyWindow(pWin)
- WindowPtr pWin;
-{
- iplPrivWin *pPrivWin;
-
- pPrivWin = iplGetWindowPrivate(pWin);
-
- if (pPrivWin->pRotatedBorder)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
- if (pPrivWin->pRotatedBackground)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
- return(TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-iplMapWindow(pWindow)
- WindowPtr pWindow;
-{
- return(TRUE);
-}
-
-/* (x, y) is the upper left corner of the window on the screen
- do we really need to pass this? (is it a;ready in pWin->absCorner?)
- we only do the rotation for pixmaps that are 32 bits wide (padded
-or otherwise.)
- iplChangeWindowAttributes() has already put a copy of the pixmap
-in pPrivWin->pRotated*
-*/
-/*ARGSUSED*/
-Bool
-iplPositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x, y;
-{
- iplPrivWin *pPrivWin;
- int setxy = 0;
-
- pPrivWin = iplGetWindowPrivate(pWin);
- if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground)
- {
- iplXRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- iplYRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- setxy = 1;
- }
-
- if (!pWin->borderIsPixel && pPrivWin->fastBorder)
- {
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
- iplXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- iplYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- setxy = 1;
- }
- if (setxy)
- {
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-iplUnmapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* UNCLEAN!
- this code calls the bitblt helper code directly.
-
- iplCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-
-void
-iplCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- RegionRec rgnDst;
- register BoxPtr pbox;
- register int dx, dy;
- register int i, nbox;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- REGION_NULL(pWin->drawable.pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- for (i = nbox; --i >= 0; ppt++, pbox++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- iplDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0L);
- DEALLOCATE_LOCAL(pptSrc);
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
-}
-
-
-
-/* swap in correct PaintWindow* routine. If we can use a fast output
-routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
-of it in devPrivates[iplWindowPrivateIndex].ptr.
-*/
-Bool
-iplChangeWindowAttributes(pWin, mask)
- WindowPtr pWin;
- unsigned long mask;
-{
- register unsigned long index;
- register iplPrivWin *pPrivWin;
- int width;
- WindowPtr pBgWin;
-
- pPrivWin = iplGetWindowPrivate(pWin);
-
- /*
- * When background state changes from ParentRelative and
- * we had previously rotated the fast border pixmap to match
- * the parent relative origin, rerotate to match window
- */
- if (mask & (CWBackPixmap | CWBackPixel) &&
- pWin->backgroundState != ParentRelative &&
- pPrivWin->fastBorder &&
- (pPrivWin->oldRotate.x != pWin->drawable.x ||
- pPrivWin->oldRotate.y != pWin->drawable.y))
- {
- iplXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- iplYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- while(mask)
- {
- index = lowbit (mask);
- mask &= ~index;
- switch(index)
- {
- case CWBackPixmap:
- if (pWin->backgroundState == None)
- {
- pPrivWin->fastBackground = FALSE;
- }
- else if (pWin->backgroundState == ParentRelative)
- {
- pPrivWin->fastBackground = FALSE;
- /* Rotate border to match parent origin */
- if (pPrivWin->pRotatedBorder) {
- for (pBgWin = pWin->parent;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- iplXRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.x - pPrivWin->oldRotate.x);
- iplYRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- }
- else if (((width = (pWin->background.pixmap->drawable.width))
- <= INTER_PGSZ) && !(width & (width - 1)))
- {
- iplCopyRotatePixmap(pWin->background.pixmap,
- &pPrivWin->pRotatedBackground,
- pWin->drawable.x,
- pWin->drawable.y);
- if (pPrivWin->pRotatedBackground)
- {
- pPrivWin->fastBackground = TRUE;
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- break;
-
- case CWBackPixel:
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBorderPixmap:
- if (((width = (pWin->border.pixmap->drawable.width)) <= INTER_PGSZ) &&
- !(width & (width - 1)))
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- iplCopyRotatePixmap(pWin->border.pixmap,
- &pPrivWin->pRotatedBorder,
- pBgWin->drawable.x,
- pBgWin->drawable.y);
- if (pPrivWin->pRotatedBorder)
- {
- pPrivWin->fastBorder = TRUE;
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- break;
- case CWBorderPixel:
- pPrivWin->fastBorder = FALSE;
- break;
- }
- }
- return (TRUE);
-}
-
diff --git a/lbx/lbxcmap.c b/lbx/lbxcmap.c
deleted file mode 100644
index 25ef34426..000000000
--- a/lbx/lbxcmap.c
+++ /dev/null
@@ -1,1152 +0,0 @@
-/* $Xorg: lbxcmap.c,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-
-/*
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/lbx/lbxcmap.c,v 1.10 2001/12/14 19:59:59 dawes Exp $ */
-
-#include <sys/types.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "Xos.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#include "Xfuncproto.h"
-#include <stdio.h>
-
-static int lbxScreenPrivIndex; /* lbx screen private index */
-static int lbxColormapPrivIndex; /* lbx colormap private index */
-
-typedef struct { /* lbx screen private */
- CreateColormapProcPtr CreateColormap;
- DestroyColormapProcPtr DestroyColormap;
- CloseScreenProcPtr CloseScreen;
-} LbxScreenPriv;
-
-typedef struct _LbxStalled {
- XID id;
- struct _LbxStalled *next;
-} LbxStalled;
-
-typedef struct _LbxColormapPriv { /* lbx colormap private */
- char grab_status;
- char smart_grab;
- LbxProxyPtr grabber;
- int last_grabber; /* uid, not pid */
- LbxStalled *stalled_clients;
- ColormapPtr next; /* proxy chain */
-} LbxColormapPriv;
-
-#define CMAP_NOT_GRABBED 0
-#define CMAP_GRABBED 1
-#define CMAP_WAITING_FOR_UNGRAB 2
-
-static int LbxUnstallClient(pointer data, XID id);
-
-static RESTYPE StalledResType;
-
-/*
- * Initialize the fields in the colormap private allocated for LBX.
- */
-
-static LbxColormapPriv *
-LbxColormapPrivInit (ColormapPtr pmap)
-{
- LbxColormapPriv *cmapPriv;
-
- cmapPriv = (LbxColormapPriv *) xalloc (sizeof (LbxColormapPriv));
- if (!cmapPriv)
- return cmapPriv;
-
- pmap->devPrivates[lbxColormapPrivIndex].ptr = (pointer) cmapPriv;
-
- cmapPriv->grab_status = CMAP_NOT_GRABBED;
- cmapPriv->grabber = NULL;
- cmapPriv->last_grabber = 0;
- cmapPriv->smart_grab = FALSE;
- cmapPriv->stalled_clients = NULL;
- cmapPriv->next = NULL;
-
- return cmapPriv;
-}
-
-
-static int
-LbxDefCmapPrivInit (ColormapPtr pmap)
-{
-#if 0
- /* BUG: You can't do that. lbxColormapPrivIndex hasn't
- been initialized yet. */
- pmap->devPrivates[lbxColormapPrivIndex].ptr = NULL;
-#endif
- return 1;
-}
-
-static Bool
-LbxCreateColormap (ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
- Bool ret;
-
- pScreen->CreateColormap = ((LbxScreenPriv *) (pScreen->devPrivates[
- lbxScreenPrivIndex].ptr))->CreateColormap;
-
- pmap->devPrivates[lbxColormapPrivIndex].ptr = NULL;
- ret = (*pScreen->CreateColormap) (pmap);
-
- pScreen->CreateColormap = LbxCreateColormap;
-
- return ret;
-}
-
-static void
-LbxDestroyColormap (ColormapPtr pmap)
-{
- ScreenPtr pScreen = pmap->pScreen;
-
- LbxReleaseCmap(pmap, FALSE);
- pScreen->DestroyColormap = ((LbxScreenPriv *) (pScreen->devPrivates[
- lbxScreenPrivIndex].ptr))->DestroyColormap;
- (*pScreen->DestroyColormap) (pmap);
- if (pmap->devPrivates && pmap->devPrivates[lbxColormapPrivIndex].ptr)
- xfree(pmap->devPrivates[lbxColormapPrivIndex].ptr);
- pScreen->DestroyColormap = LbxDestroyColormap;
-}
-
-static Bool
-LbxCloseScreen(int i, ScreenPtr pScreen)
-{
- LbxScreenPriv* pLbxScrPriv = ((LbxScreenPriv *)
- (pScreen->devPrivates[lbxScreenPrivIndex].ptr));
-
- pScreen->CloseScreen = pLbxScrPriv->CloseScreen;
-
- xfree(pScreen->devPrivates[lbxScreenPrivIndex].ptr);
- pScreen->devPrivates[lbxScreenPrivIndex].ptr = NULL;
-
- return pScreen->CloseScreen(i, pScreen);
-}
-
-/*
- * Initialize LBX colormap private.
- */
-
-int
-LbxCmapInit (void)
-
-{
- LbxScreenPriv *pScreenPriv;
- ColormapPtr defMap;
- ScreenPtr pScreen;
- int i;
-
- StalledResType = CreateNewResourceType(LbxUnstallClient);
-
- lbxScreenPrivIndex = AllocateScreenPrivateIndex ();
- if (lbxScreenPrivIndex < 0)
- return 0;
-
- lbxColormapPrivIndex = AllocateColormapPrivateIndex (LbxDefCmapPrivInit);
- if (lbxColormapPrivIndex < 0)
- return 0;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
-
- defMap = (ColormapPtr) LookupIDByType(
- pScreen->defColormap, RT_COLORMAP);
-
- /* now lbxColormapPrivIndex exists */
- defMap->devPrivates[lbxColormapPrivIndex].ptr = NULL;
-
- pScreenPriv = (LbxScreenPriv *) xalloc (sizeof (LbxScreenPriv));
- if (!pScreenPriv)
- return 0;
-
- pScreenPriv->CreateColormap = pScreen->CreateColormap;
- pScreen->CreateColormap = LbxCreateColormap;
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
- pScreen->DestroyColormap = LbxDestroyColormap;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = LbxCloseScreen;
- pScreen->devPrivates[lbxScreenPrivIndex].ptr = (pointer) pScreenPriv;
- }
-
- return 1;
-}
-
-/*
- * Return the number of allocated cells in the PSEUDO colormap.
- */
-
-static int
-NumAllocatedCells (EntryPtr pent,
- int size)
-{
- Pixel pixel;
- int count = 0;
-
- for (pixel = 0; pixel < size; pixel++)
- {
- if (pent[pixel].refcnt != 0 && pent[pixel].refcnt != AllocTemporary)
- count++;
- }
-
- return count;
-}
-
-#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
-#define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1)
-#define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1)
-
-#define PIX_OUT(ptr,is2,val) \
- if (is2) *ptr++ = (val) >> 8; \
- *ptr++ = (val)
-#define RGB_OUT(ptr,is2,shift,val) \
- *ptr++ = (val) >> shift; \
- if (is2) *ptr++ = (val)
-
-/*
- * Return the list of allocated cells in the channel in
- * the format required by LbxGrabCmapReply.
- */
-
-static CARD8 *
-OutputChannel(ColormapPtr pmap,
- EntryPtr chan,
- int size,
- CARD8 *ptr,
- CARD8 flags,
- CARD8 channels)
-{
- Bool px2;
- Bool rgb2;
- int shift;
- int rgb_sz;
- Pixel pixel;
- EntryPtr pent;
- CARD8 *pixel_private_range_ptr = NULL;
- CARD8 *pixel_shared_range_ptr = NULL;
- int allocpriv;
-
- px2 = (flags & LBX_2BYTE_PIXELS) != 0;
- rgb2 = (flags & LBX_RGB_BITS_MASK) > 7;
- if (rgb2)
- shift = 8;
- else
- shift = 15 - (flags & LBX_RGB_BITS_MASK);
- rgb_sz = rgb2 + 1;
- if (channels == (DoRed|DoGreen|DoBlue))
- rgb_sz *= 3;
- /* kinda gross, but ddxen use AllocAll on static maps */
- allocpriv = (pmap->pVisual->class & DynamicClass) ? AllocPrivate : 0;
- for (pixel = 0; pixel < size; pixel++)
- {
- pent = (EntryPtr) &chan[pixel];
-
- if (pent->refcnt == 0 || pent->refcnt == AllocTemporary)
- {
- /*
- * A free pixel. This disrupts all ranges.
- */
-
- pixel_private_range_ptr = pixel_shared_range_ptr = NULL;
-
- continue;
- }
- else if (pent->refcnt == allocpriv)
- {
- /*
- * A private pixel. This disrupts any PIXEL_SHARED_RANGE.
- */
-
- pixel_shared_range_ptr = NULL;
-
- if (!pixel_private_range_ptr)
- {
- pixel_private_range_ptr = ptr;
-
- *ptr++ = LBX_PIXEL_PRIVATE;
- PIX_OUT(ptr, px2, pixel);
- }
- else
- {
- CARD8 *pos = pixel_private_range_ptr + 2 + px2;
- if (*pixel_private_range_ptr == LBX_PIXEL_PRIVATE) {
- *pixel_private_range_ptr = LBX_PIXEL_RANGE_PRIVATE;
- ptr += 1 + px2;
- }
- PIX_OUT(pos, px2, pixel);
- }
- }
- else
- {
- /*
- * A shared pixel. This disrupts any PIXEL_PRIVATE_RANGE.
- */
-
- pixel_private_range_ptr = NULL;
-
- if (!pixel_shared_range_ptr)
- {
- pixel_shared_range_ptr = ptr;
-
- *ptr++ = LBX_PIXEL_SHARED;
- PIX_OUT(ptr, px2, pixel);
- }
- else
- {
- CARD8 *pos = pixel_shared_range_ptr + 2 + px2;
- if (*pixel_shared_range_ptr == LBX_PIXEL_SHARED)
- {
- *pixel_shared_range_ptr = LBX_PIXEL_RANGE_SHARED;
- memmove (pos + 1 + px2, pos, rgb_sz);
- ptr += 1 + px2;
- }
- PIX_OUT(pos, px2, pixel);
- }
-
- if (channels & DoRed) {
- RGB_OUT(ptr, rgb2, shift, pent->co.local.red);
- }
- if (channels & DoGreen) {
- RGB_OUT(ptr, rgb2, shift, pent->co.local.green);
- }
- if (channels & DoBlue) {
- RGB_OUT(ptr, rgb2, shift, pent->co.local.blue);
- }
- }
- }
- return ptr;
-}
-
-static void
-GetAllocatedCells (ColormapPtr pmap,
- CARD8 *flags,
- CARD8 *buf,
- int *bytes)
-{
- CARD8 *ptr;
-
- *flags = pmap->pVisual->bitsPerRGBValue - 1;
- if (pmap->pVisual->ColormapEntries > 256)
- *flags |= LBX_2BYTE_PIXELS;
- if (!(pmap->pVisual->class & DynamicClass))
- *flags |= LBX_AUTO_RELEASE;
- if ((pmap->pVisual->class | DynamicClass) == DirectColor) {
- *flags |= LBX_3CHANNELS;
- ptr = OutputChannel(pmap, pmap->red, NUMRED(pmap->pVisual),
- buf, *flags, DoRed);
- *ptr++ = LBX_NEXT_CHANNEL;
- ptr = OutputChannel(pmap, pmap->green, NUMGREEN(pmap->pVisual),
- ptr, *flags, DoGreen);
- *ptr++ = LBX_NEXT_CHANNEL;
- ptr = OutputChannel(pmap, pmap->blue, NUMBLUE(pmap->pVisual),
- ptr, *flags, DoBlue);
- } else
- ptr = OutputChannel(pmap, pmap->red, pmap->pVisual->ColormapEntries,
- buf, *flags, DoRed|DoGreen|DoBlue);
- *ptr++ = LBX_LIST_END;
- *bytes = ptr - buf;
-}
-
-
-/*
- * Send an LbxReleaseCmapEvent to a proxy.
- */
-
-static void
-SendReleaseCmapEvent (LbxProxyPtr proxy,
- Colormap cmap)
-{
- xLbxReleaseCmapEvent ev;
- ClientPtr client;
- LbxClientPtr lbxcp;
- int n;
-
- lbxcp = proxy->lbxClients[0];
-
- if (lbxcp && (client = lbxcp->client))
- {
- ev.type = LbxEventCode;
- ev.lbxType = LbxReleaseCmapEvent;
- ev.sequenceNumber = client->sequence;
- ev.colormap = cmap;
- ev.pad1 = ev.pad2 = ev.pad3 = ev.pad4 = ev.pad5 = ev.pad6 = 0;
-
- if (client->swapped)
- {
- swaps(&ev.sequenceNumber, n);
- swapl(&ev.colormap, n);
- }
-
- WriteToClient(client, sz_xLbxReleaseCmapEvent, (char *) &ev);
- LbxForceOutput(proxy);
-
-#ifdef COLOR_DEBUG
- fprintf (stderr,
- "Sent LbxReleaseCmapEvent to proxy %d, seq = 0x%x, cmap = 0x%x\n",
- proxy->pid, client->sequence, cmap);
-#endif
- }
-}
-
-
-/*
- * WaitForServerCmapControl checks if the colormap is grabbed by a proxy,
- * and if so, sends an LbxReleaseCmapEvent to the proxy. It then suspends
- * the current request until the server gets the ReleaseCmap message from
- * the proxy.
- */
-
-static Bool
-WaitForServerCmapControl (ClientPtr client,
- ColormapPtr pmap)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
- LbxStalled *stalled;
-
- if (cmapPriv->grab_status == CMAP_GRABBED)
- {
- /*
- * Send an LbxReleaseCmapEvent to the proxy that has the grab.
- */
-
- SendReleaseCmapEvent (cmapPriv->grabber, pmap->mid);
- cmapPriv->grab_status = CMAP_WAITING_FOR_UNGRAB;
- }
-
- stalled = (LbxStalled *)xalloc(sizeof(LbxStalled));
- if (!stalled)
- return FALSE;
- stalled->id = FakeClientID(client->index);
- stalled->next = cmapPriv->stalled_clients;
- cmapPriv->stalled_clients = stalled;
- return AddResource(stalled->id, StalledResType, (pointer)cmapPriv);
-}
-
-
-/*
- * When the X server gets any of the requests that allocate color cells,
- * it calls LbxCheckColorRequest on the request. This function will check
- * if the colormap is grabbed by a proxy, and if so, will suspend the
- * current request and wait for the proxy to release the colormap.
- */
-
-Bool
-LbxCheckColorRequest (ClientPtr client,
- ColormapPtr pmap,
- xReq *req)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
-
- if (!cmapPriv)
- return FALSE;
-
- if (cmapPriv->grab_status != CMAP_NOT_GRABBED)
- {
- /*
- * The colormap is grabbed by a proxy. Reset this request, and
- * process it after the server gets back control of the colormap.
- * Before we reset the request, we must put it back in the
- * client's byte order.
- */
-
- if (!WaitForServerCmapControl (client, pmap))
- return FALSE;
-
- if (client->swapped)
- {
- register int n;
-
- switch (req->reqType)
- {
- case X_AllocColor:
- {
- xAllocColorReq *stuff = (xAllocColorReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- break;
- }
- case X_AllocNamedColor:
- {
- xAllocNamedColorReq *stuff = (xAllocNamedColorReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swaps(&stuff->nbytes, n);
- break;
- }
- case X_AllocColorCells:
- {
- xAllocColorCellsReq *stuff = (xAllocColorCellsReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->planes, n);
- break;
- }
- case X_AllocColorPlanes:
- {
- xAllocColorPlanesReq *stuff = (xAllocColorPlanesReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- break;
- }
- default:
- break;
- }
- }
-
- ResetCurrentRequest(client);
- client->sequence--;
- IgnoreClient(client);
-
- return TRUE;
- }
-
- if (!LbxClient(client) ||
- LbxProxy(client)->uid != cmapPriv->last_grabber)
- {
- /*
- * Next time the proxy for this client does a colormap grab, it
- * will have to get the colormap state (a non-smart grab).
- */
-
- cmapPriv->smart_grab = FALSE;
- }
-
- return FALSE;
-}
-
-static Bool
-LbxGrabbedByClient (ClientPtr client,
- ColormapPtr pmap)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
- return (cmapPriv &&
- (cmapPriv->grab_status != CMAP_NOT_GRABBED) &&
- (cmapPriv->grabber == LbxProxy(client)));
-}
-
-/*
- * Check if a colormap is grabbed by a proxy.
- */
-
-int
-LbxCheckCmapGrabbed (ColormapPtr pmap)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
-
- return (cmapPriv && (cmapPriv->grab_status == CMAP_GRABBED));
-}
-
-
-/*
- * Disable a smart grab on the specified colormap.
- */
-
-void
-LbxDisableSmartGrab (ColormapPtr pmap)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
-
- if (cmapPriv)
- cmapPriv->smart_grab = FALSE;
-}
-
-
-/*
- * Send an LbxFreeCellsEvent to the specified proxy.
- */
-
-static void
-SendFreeCellsEvent (LbxProxyPtr proxy,
- Colormap cmap,
- Pixel pixel_start,
- Pixel pixel_end)
-{
- xLbxFreeCellsEvent ev;
- ClientPtr client;
- LbxClientPtr lbxcp;
- int n;
-
- lbxcp = proxy->lbxClients[0];
-
- if (lbxcp && (client = lbxcp->client))
- {
- ev.type = LbxEventCode;
- ev.lbxType = LbxFreeCellsEvent;
- ev.sequenceNumber = client->sequence;
- ev.colormap = cmap;
- ev.pixelStart = pixel_start;
- ev.pixelEnd = pixel_end;
- ev.pad1 = ev.pad2 = ev.pad3 = ev.pad4 = 0;
-
- if (client->swapped)
- {
- swaps(&ev.sequenceNumber, n);
- swapl(&ev.colormap, n);
- swapl(&ev.pixelStart, n);
- swapl(&ev.pixelEnd, n);
- }
-
- WriteToClient(client, sz_xLbxFreeCellsEvent, (char *) &ev);
- LbxForceOutput(proxy);
-#ifdef COLOR_DEBUG
- fprintf (stderr, "Sent LbxFreeCellsEvent to proxy %d, seq = 0x%x\n",
- proxy->pid, client->sequence);
- fprintf (stderr, " cmap = 0x%x, pixelStart = %d, pixelEnd = %d\n",
- cmap, pixel_start, pixel_end);
-#endif
- }
-}
-
-/* XXX use of globals like this is gross */
-static long pixel_start;
-static long pixel_end;
-
-
-/*
- * LbxFreeCellsEvent generation functions.
- */
-
-/*ARGSUSED*/
-void
-LbxBeginFreeCellsEvent (ColormapPtr pmap)
-{
- pixel_start = -1;
- pixel_end = -1;
-}
-
-
-void
-LbxAddFreeCellToEvent (ColormapPtr pmap,
- Pixel pixel)
-{
- /*
- * We must notify the proxy that has this colormap
- * grabbed which cells are being freed (their refcount
- * has reached zero).
- */
-
- if (pixel_start == -1)
- pixel_start = pixel;
- else
- {
- if (pixel_end == -1)
- pixel_end = pixel;
- else
- {
- if (pixel_end + 1 == pixel)
- pixel_end = pixel;
- else if (pixel > pixel_end + 1)
- {
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
-
- SendFreeCellsEvent (cmapPriv->grabber,
- pmap->mid, pixel_start, pixel_end);
-
- pixel_start = pixel;
- pixel_end = -1;
- }
- }
- }
-}
-
-void
-LbxEndFreeCellsEvent (ColormapPtr pmap)
-{
- /*
- * Check if there is an LbxFreeCellEvent we need to write.
- */
-
- if (pixel_start != -1)
- {
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
-
- SendFreeCellsEvent (cmapPriv->grabber,
- pmap->mid, pixel_start,
- pixel_end == -1 ? pixel_start : pixel_end);
- }
-}
-
-
-/*
- * Sort the specified pixel list. This optimizes generation
- * of LbxFreeCellsEvent.
- */
-
-void
-LbxSortPixelList (Pixel *pixels,
- int count)
-{
- int i, j;
-
- for (i = 0; i <= count - 2; i++)
- for (j = count - 1; j > i; j--)
- if (pixels[j - 1] > pixels[j])
- {
- Pixel temp = pixels[j - 1];
- pixels[j - 1] = pixels[j];
- pixels[j] = temp;
- }
-}
-
-
-/*
- * Handle a colormap grab request from a proxy.
- */
-
-int
-ProcLbxGrabCmap(ClientPtr client)
-{
- REQUEST(xLbxGrabCmapReq);
- xLbxGrabCmapReply *reply;
- Bool smartGrab;
- LbxColormapPriv *cmapPriv;
- ColormapPtr pmap;
- int bytes, n;
- LbxProxyPtr proxy = LbxProxy(client);
-
- client->sequence--; /* not a counted request */
-
- pmap = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
- RT_COLORMAP,
- SecurityWriteAccess);
-
- if (!pmap)
- {
- client->errorValue = stuff->cmap;
- return BadColor;
- }
-
- cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
- if (!cmapPriv)
- {
- cmapPriv = LbxColormapPrivInit (pmap);
- if (!cmapPriv)
- return BadAlloc;
- }
-
-
- /*
- * We have a SMART GRAB if since this proxy last ungrabbed the
- * colormap, no color cell was alloc'd by an entity other than
- * this proxy (this includes other proxies as well as clients
- * directly connected to the X server without a proxy).
- *
- * We want to optimize this special case because a proxy may give
- * up a grab because it got a request that it could not handle
- * (e.g. AllocNamedColor or LookupColor). When it asks back for
- * the grab, there is no need for the server to send the colormap
- * state, because the proxy is already up to date on the state of
- * the colormap.
- *
- * In order for this to work, the following assumptions are made
- * about the proxy:
- *
- * - the proxy is kept up to date on all cell allocations made on its
- * behalf resulting from the following requests: AllocNamedColor,
- * AllocColorCells, AllocColorPlanes
- * - the proxy is kept up to date on all cells freed by any client
- * via the LbxFreeCell event.
- */
-
- /* if proxy is this confused, give it full info */
- if (cmapPriv->grab_status == CMAP_GRABBED && cmapPriv->grabber == proxy)
- LbxReleaseCmap(pmap, FALSE);
-
- if (proxy->uid != cmapPriv->last_grabber)
- cmapPriv->smart_grab = FALSE;
- smartGrab = cmapPriv->smart_grab;
-
-#ifdef COLOR_DEBUG
- fprintf (stderr, "\nGot colormap grab request, ");
- fprintf (stderr, "seq = 0x%x, proxy = %d, client = %d, cmap = 0x%x\n",
- client->sequence, proxy->pid, client->index, stuff->cmap);
-
- if (cmapPriv->grab_status == CMAP_NOT_GRABBED)
- {
- fprintf (stderr, "cmap 0x%x is not grabbed by any proxy\n",
- stuff->cmap);
- if (smartGrab)
- fprintf (stderr, "This is a smart grab\n");
- }
- else if (cmapPriv->grab_status == CMAP_GRABBED)
- {
- if (cmapPriv->grabber == proxy)
- {
- fprintf (stderr, "cmap 0x%x is already grabbed by proxy %d\n",
- stuff->cmap, proxy->pid);
- }
- else
- {
- fprintf (stderr, "cmap 0x%x is currently grabbed by proxy %d\n",
- stuff->cmap, cmapPriv->grabber->pid);
- }
- }
- else if (cmapPriv->grab_status == CMAP_WAITING_FOR_UNGRAB)
- {
- fprintf (stderr,
- "Already waiting for cmap 0x%x to be ungrabbed by proxy %d\n",
- stuff->cmap, cmapPriv->grabber->pid);
- }
-#endif
-
- if (cmapPriv->grab_status != CMAP_NOT_GRABBED &&
- cmapPriv->grabber != proxy)
- {
- /*
- * The colormap is grabbed by a proxy other than the one that
- * is requesting this grab. Reset this grab request, and process
- * it after the server gets back control of the colormap. Before
- * we reset the request, we must put it back in the client's byte
- * order.
- */
-
- if (!WaitForServerCmapControl (client, pmap))
- return BadAlloc;
-
- if (client->swapped)
- {
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- }
-
- ResetCurrentRequest(client);
- IgnoreClient(client);
-
- return Success;
- }
-
- if (pmap->pVisual->class & DynamicClass) {
- cmapPriv->grabber = proxy;
- cmapPriv->grab_status = CMAP_GRABBED;
- cmapPriv->next = proxy->grabbedCmaps;
- proxy->grabbedCmaps = pmap;
- } else
- smartGrab = FALSE;
-
- /*
- * For an smart grab (see comments above), there is no information
- * sent about the colormap cells because the proxy is all up to date.
- * Otherwise, the server sends the proxy the state of all allocated
- * cells in the colormap. All cells not specified are assumed free.
- */
-
- bytes = 0;
- if (!smartGrab) {
- if ((pmap->pVisual->class | DynamicClass) == DirectColor) {
- bytes = NumAllocatedCells(pmap->red,
- NUMRED(pmap->pVisual)) * 9;
- bytes += NumAllocatedCells(pmap->green,
- NUMGREEN(pmap->pVisual)) * 9;
- bytes += NumAllocatedCells(pmap->blue,
- NUMBLUE(pmap->pVisual)) * 9;
- bytes += 2;
- } else
- bytes = NumAllocatedCells(pmap->red,
- pmap->pVisual->ColormapEntries) * 9;
- }
- bytes += sz_xLbxGrabCmapReply + 1;
- reply = (xLbxGrabCmapReply *) xalloc (bytes);
- bzero (reply, sz_xLbxGrabCmapReply);
-
- if (smartGrab)
- {
- reply->flags = LBX_SMART_GRAB;
- reply->length = 0;
- }
- else
- {
- GetAllocatedCells (pmap, &reply->flags,
- (CARD8 *) reply + sz_xLbxGrabCmapReplyHdr, &bytes);
- if (bytes <= (sz_xLbxGrabCmapReply - sz_xLbxGrabCmapReplyHdr))
- reply->length = 0;
- else
- reply->length = (sz_xLbxGrabCmapReplyHdr +
- bytes - sz_xLbxGrabCmapReply + 3) >> 2;
- }
-
- reply->type = X_Reply;
- reply->sequenceNumber = client->sequence;
-
- bytes = sz_xLbxGrabCmapReply + (reply->length << 2);
-
- if (client->swapped)
- {
- register char n;
-
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- }
-
- WriteToClient (client, bytes, (char *)reply);
-
- xfree (reply);
-
- return (client->noClientException);
-}
-
-static int
-LbxUnstallClient(pointer data,
- XID id)
-{
- LbxColormapPriv *cmapPriv = (LbxColormapPriv *)data;
- LbxStalled **prev;
- ClientPtr client;
-
- for (prev = &cmapPriv->stalled_clients; *prev && (*prev)->id != id; )
- prev = &(*prev)->next;
- *prev = (*prev)->next;
- client = clients[CLIENT_ID(id)];
- if (!client->clientGone)
- AttendClient(client);
- return 0;
-}
-
-void
-LbxReleaseCmap(ColormapPtr pmap,
- Bool smart)
-{
- LbxColormapPriv *cmapPriv;
- ColormapPtr *prev;
-
- if (!pmap->devPrivates)
- return;
- cmapPriv = (LbxColormapPriv *)
- (pmap->devPrivates[lbxColormapPrivIndex].ptr);
- if (!cmapPriv || (cmapPriv->grab_status == CMAP_NOT_GRABBED))
- return;
-
- for (prev = &cmapPriv->grabber->grabbedCmaps; *prev && *prev != pmap; )
- prev = &((LbxColormapPriv *)
- (*prev)->devPrivates[lbxColormapPrivIndex].ptr)->next;
- if (*prev == pmap)
- *prev = cmapPriv->next;
-
- while (cmapPriv->stalled_clients)
- FreeResource(cmapPriv->stalled_clients->id, 0);
-
- cmapPriv->grab_status = CMAP_NOT_GRABBED;
- cmapPriv->last_grabber = smart ? cmapPriv->grabber->uid : 0;
- cmapPriv->grabber = NULL;
- cmapPriv->smart_grab = smart;
-}
-
-/*
- * Handle a colormap release request from a proxy.
- */
-
-int
-ProcLbxReleaseCmap(ClientPtr client)
-{
- REQUEST(xLbxReleaseCmapReq);
- ColormapPtr pmap;
-
-#ifdef COLOR_DEBUG
- fprintf (stderr, "Got colormap release request, ");
- fprintf (stderr, "seq = 0x%x, proxy = %d, client = %d, cmap = 0x%x\n",
- client->sequence, LbxProxyID(client), client->index, stuff->cmap);
-#endif
-
- pmap = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
- RT_COLORMAP,
- SecurityWriteAccess);
-
- if (!pmap)
- {
- client->errorValue = stuff->cmap;
- return BadColor;
- }
-
- if (LbxGrabbedByClient(client, pmap))
- LbxReleaseCmap(pmap, TRUE);
- return Success;
-}
-
-
-/*
- * Handle an LbxAllocColor request. The proxy did the alloc and
- * is telling the server what rgb and pixel value to use.
- */
-
-int
-ProcLbxAllocColor(ClientPtr client)
-{
- REQUEST(xLbxAllocColorReq);
- ColormapPtr pmap;
- CARD32 pixel = stuff->pixel;
-
- REQUEST_SIZE_MATCH (xLbxAllocColorReq);
- pmap = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
- RT_COLORMAP,
- SecurityWriteAccess);
-
-#ifdef COLOR_DEBUG
- fprintf (stderr,
- "Got LBX alloc color: seq = 0x%x, proxy = %d, client = %d\n",
- client->sequence, LbxProxyID(client), client->index);
- fprintf (stderr, " cmap = 0x%x, pixel = %d, rgb = (%d,%d,%d)\n",
- stuff->cmap, stuff->pixel, stuff->red, stuff->green, stuff->blue);
-#endif
-
- if (pmap)
- {
- int status;
- if (!LbxGrabbedByClient(client, pmap))
- return BadAccess;
-
- status = AllocColor (pmap,
- &stuff->red, &stuff->green, &stuff->blue,
- &pixel, client->index);
-
- if (status == Success && pixel != stuff->pixel)
- {
- /*
- * Internal error - Proxy allocated different pixel from server
- */
-#ifdef COLOR_DEBUG
- fprintf(stderr, "got pixel %d (%d, %d, %d), expected %d\n",
- pixel, stuff->red, stuff->green, stuff->blue, stuff->pixel);
-#endif
- FreeColors (pmap, client->index, 1, &pixel, 0L);
- return BadAlloc;
- }
-
- return status;
- }
- else
- {
- client->errorValue = stuff->cmap;
- return (BadColor);
- }
-}
-
-
-/*
- * The proxy sends an LbxIncrementPixel request when it short circuits
- * an AllocColor. The server must bump up the reference count the
- * specified amount.
- */
-
-int
-ProcLbxIncrementPixel(ClientPtr client)
-{
- REQUEST(xLbxIncrementPixelReq);
- ColormapPtr pmap;
- EntryPtr pent;
- Pixel pixel;
- unsigned short red, green, blue;
- VisualPtr pVisual;
- int status;
-
-#ifdef COLOR_DEBUG
- fprintf (stderr,
- "Got LBX increment pixel: seq = 0x%x, proxy = %d, client = %d\n",
- client->sequence, LbxProxyID(client), client->index);
- fprintf (stderr, " cmap = 0x%x, pixel = %d\n",
- stuff->cmap, stuff->pixel);
-#endif
-
- /*
- * Looks up the color associated with the pixel, and then call
- * AllocColor() - a bit round-about, but it should work.
- */
-
- pmap = (ColormapPtr) SecurityLookupIDByType(client, stuff->cmap,
- RT_COLORMAP,
- SecurityWriteAccess);
- if (!pmap) {
- client->errorValue = stuff->cmap;
- return BadColor;
- }
-
- pixel = stuff->pixel;
-
- switch (pmap->class) {
- case StaticColor:
- case StaticGray:
- red = pmap->red[pixel].co.local.red;
- green = pmap->red[pixel].co.local.green;
- blue = pmap->red[pixel].co.local.blue;
- break;
- case GrayScale:
- case PseudoColor:
- pent = pmap->red + pixel;
- red = pent->co.local.red;
- green = pent->co.local.green;
- blue = pent->co.local.blue;
- break;
- default:
- pVisual = pmap->pVisual;
- red = pmap->red[(pixel & pVisual->redMask) >> pVisual->offsetRed].co.local.red;
- green = pmap->green[(pixel & pVisual->greenMask) >> pVisual->offsetGreen].co.local.green;
- blue = pmap->blue[(pixel & pVisual->blueMask) >> pVisual->offsetBlue].co.local.blue;
- break;
- }
-
- status = AllocColor(pmap, &red, &green, &blue, &pixel, client->index);
-
- if (status == Success && pixel != stuff->pixel)
- {
- /*
- * Internal error - Proxy allocated different pixel from server
- */
-#ifdef COLOR_DEBUG
- fprintf(stderr, "got pixel %d, expected %d\n", pixel, stuff->pixel);
-#endif
- FreeColors (pmap, client->index, 1, &pixel, 0L);
- return BadAlloc;
- }
-
- return status;
-}
diff --git a/lbx/lbxdata.h b/lbx/lbxdata.h
deleted file mode 100644
index d5240f7ea..000000000
--- a/lbx/lbxdata.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Xorg: lbxdata.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-/*
- * Copyright 1994 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifndef _LBXDATA_H_
-#define _LBXDATA_H_
-#define NEED_REPLIES
-#include "X.h"
-#include "Xproto.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "dixfontstr.h"
-
-extern int lbx_font_private;
-
-typedef struct _fonttaginfo {
- XID tid;
- FontPtr pfont;
- unsigned long size;
- int compression;
- xLbxFontInfo *fontinfo;
-} FontTagInfoRec, *FontTagInfoPtr;
-
-#endif /* _LBXDATA_H_ */
diff --git a/lbx/lbxdix.c b/lbx/lbxdix.c
deleted file mode 100644
index 5a40614f6..000000000
--- a/lbx/lbxdix.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/* $Xorg: lbxdix.c,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-/*
-
-Copyright 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.8 2001/12/14 19:59:59 dawes Exp $ */
-
-/* various bits of DIX-level mangling */
-
-#include <sys/types.h>
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "inputstr.h"
-#include "servermd.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#include "lbxtags.h"
-#include "lbxdata.h"
-#include "Xfuncproto.h"
-#ifdef XAPPGROUP
-#include "Xagsrv.h"
-#endif
-#include "swaprep.h"
-
-int lbx_font_private = -1;
-
-void
-LbxDixInit(void)
-{
- TagInit();
- lbx_font_private = AllocateFontPrivateIndex();
-}
-
-/* ARGSUSED */
-void
-LbxAllowMotion(ClientPtr client,
- int num)
-{
- LbxProxyPtr proxy = LbxProxy(client);
- proxy->motion_allowed_events += num;
-}
-
-extern xConnSetupPrefix connSetupPrefix;
-extern char *ConnectionInfo;
-extern int connBlockScreenStart;
-
-int
-LbxSendConnSetup(ClientPtr client,
- char *reason)
-{
- int dlength;
- int i, ndex, lim, wndex;
- CARD32 dataBuf[16];
- xLbxConnSetupPrefix csp;
- NewClientInfoRec nci;
- LbxProxyPtr proxy = LbxProxy(client);
-
- if (reason) {
- SendConnSetup(client, reason);
- LbxForceOutput(proxy); /* expedient to avoid another state variable */
- return (client->noClientException);
- }
-
- IncrementClientCount();
-
- client->requestVector = client->swapped ? SwappedProcVector : ProcVector;
- client->sequence = 0;
- dataBuf[0] = client->clientAsMask;
-
- csp.success = TRUE;
- csp.majorVersion = connSetupPrefix.majorVersion;
- csp.minorVersion = connSetupPrefix.minorVersion;
- csp.tag = 0;
-#ifdef XAPPGROUP
- if (!client->appgroup) {
-#endif
- csp.changeType = 1; /* LbxNormalDeltas */
- csp.length = 2 + /* tag + resource-id-base */
- screenInfo.numScreens; /* input-mask per screen */
- wndex = 0; ndex = 1; lim = screenInfo.numScreens;
-#ifdef XAPPGROUP
- } else {
- csp.changeType = 2; /* LbxAppGroupDeltas */
- csp.length = 7 + /* tag, res-id-base, root, visual, colormap, b&w-pix */
- 1 + screenInfo.numScreens - screenInfo.numVideoScreens;
- XagGetDeltaInfo (client, &dataBuf[1]);
- for (i = 0; i < MAXSCREENS; i++) {
- if ((CARD32) WindowTable[i]->drawable.id == dataBuf[1]) {
- dataBuf[6] = WindowTable[i]->eventMask | wOtherEventMasks(WindowTable[i]);
- break;
- }
- }
- wndex = screenInfo.numVideoScreens;
- ndex = 7;
- lim = screenInfo.numScreens - screenInfo.numVideoScreens;
- }
-#endif
- for (i = 0; i < lim; i++, ndex++, wndex++) {
- dataBuf[ndex] =
- WindowTable[wndex]->eventMask | wOtherEventMasks(WindowTable[wndex]);
- }
- dlength = (csp.length - 1) << 2;
-
- if (LbxProxyClient(proxy)->swapped) {
- swaps(&csp.length, i);
- }
-
- if (client->swapped) {
- LbxWriteSConnSetupPrefix(client, &csp);
- SwapLongs(dataBuf, (1 + screenInfo.numScreens));
- WriteToClient(client, dlength, (pointer) dataBuf);
- } else {
- WriteToClient(client, sizeof(xLbxConnSetupPrefix), (char *) &csp);
- WriteToClient(client, dlength, (pointer) dataBuf);
- }
-
- LbxForceOutput(proxy); /* expedient to avoid another state variable */
- client->clientState = ClientStateRunning;
- if (ClientStateCallback) {
- if (LbxProxyClient(proxy)->swapped != client->swapped) {
- swaps(&csp.length, i);
- }
- nci.client = client;
- nci.prefix = (xConnSetupPrefix*) &csp;
- nci.setup = (xConnSetup *) ConnectionInfo;
- CallCallbacks(&ClientStateCallback, (pointer) &nci);
- }
-
- return client->noClientException;
-}
-
-static XID modifier_map_tag;
-
-int
-LbxGetModifierMapping(ClientPtr client)
-{
- TagData td;
- pointer tagdata;
- xLbxGetModifierMappingReply rep;
- register KeyClassPtr keyc = inputInfo.keyboard->key;
- int dlength = keyc->maxKeysPerModifier << 3;
- Bool tag_known = FALSE,
- send_data;
- int n;
-
- if (!modifier_map_tag) {
- tagdata = (pointer) keyc->modifierKeyMap;
- TagSaveTag(LbxTagTypeModmap, dlength, tagdata, &modifier_map_tag);
- } else {
- td = TagGetTag(modifier_map_tag);
- tagdata = td->tdata;
- tag_known = TagProxyMarked(modifier_map_tag, LbxProxyID(client));
- }
- if (modifier_map_tag)
- TagMarkProxy(modifier_map_tag, LbxProxyID(client));
-
- send_data = (!modifier_map_tag || !tag_known);
-
- rep.type = X_Reply;
- rep.keyspermod = keyc->maxKeysPerModifier;
- rep.sequenceNumber = client->sequence;
- rep.tag = modifier_map_tag;
- rep.pad0 = rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0;
-
- if (send_data)
- rep.length = dlength >> 2;
- else
- rep.length = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.tag, n);
- }
- WriteToClient(client, sizeof(xLbxGetModifierMappingReply), (char *)&rep);
-
- if (send_data)
- WriteToClient(client, dlength, (char *) tagdata);
-
- return client->noClientException;
-}
-
-void
-LbxFlushModifierMapTag(void)
-{
-
- if (modifier_map_tag)
- TagDeleteTag(modifier_map_tag);
-}
-
-static XID keyboard_map_tag;
-
-int
-LbxGetKeyboardMapping(ClientPtr client)
-{
- TagData td;
- pointer tagdata;
- xLbxGetKeyboardMappingReply rep;
-
- REQUEST(xLbxGetKeyboardMappingReq);
- KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms;
- int dlength;
- Bool tag_known = FALSE,
- send_data;
- int n;
-
- REQUEST_SIZE_MATCH(xLbxGetKeyboardMappingReq);
-
- if ((stuff->firstKeyCode < curKeySyms->minKeyCode) ||
- (stuff->firstKeyCode > curKeySyms->maxKeyCode)) {
- client->errorValue = stuff->firstKeyCode;
- return BadValue;
- }
- if (stuff->firstKeyCode + stuff->count > curKeySyms->maxKeyCode + 1) {
- client->errorValue = stuff->count;
- return BadValue;
- }
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.keysperkeycode = curKeySyms->mapWidth;
- /* length is a count of 4 byte quantities and KeySyms are 4 bytes */
-
- if (!keyboard_map_tag) {
- tagdata = (pointer) &curKeySyms->map[(stuff->firstKeyCode -
- curKeySyms->minKeyCode) * curKeySyms->mapWidth];
- dlength = (curKeySyms->mapWidth * stuff->count);
- TagSaveTag(LbxTagTypeKeymap, dlength, tagdata, &keyboard_map_tag);
- } else {
- td = TagGetTag(keyboard_map_tag);
- tagdata = td->tdata;
- tag_known = TagProxyMarked(keyboard_map_tag, LbxProxyID(client));
- }
- if (keyboard_map_tag)
- TagMarkProxy(keyboard_map_tag, LbxProxyID(client));
-
- send_data = (!keyboard_map_tag || !tag_known);
- rep.type = X_Reply;
- rep.keysperkeycode = curKeySyms->mapWidth;
- rep.sequenceNumber = client->sequence;
- rep.tag = keyboard_map_tag;
- rep.pad0 = rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0;
-
- if (send_data)
- rep.length = (curKeySyms->mapWidth * stuff->count);
- else
- rep.length = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.tag, n);
- }
- WriteToClient(client, sizeof(xLbxGetKeyboardMappingReply), (char *)&rep);
-
- if (send_data) {
- client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
- WriteSwappedDataToClient(client,
- curKeySyms->mapWidth * stuff->count * sizeof(KeySym),
- &curKeySyms->map[(stuff->firstKeyCode - curKeySyms->minKeyCode) *
- curKeySyms->mapWidth]);
- }
- return client->noClientException;
-}
-
-void
-LbxFlushKeyboardMapTag(void)
-{
- if (keyboard_map_tag)
- TagDeleteTag(keyboard_map_tag);
-}
-
-/* counts number of bits needed to hold value */
-static int
-_bitsize(int val)
-{
- int bits = 1; /* always need one for sign bit */
-
- if (val == 0)
- return (bits);
-
- if (val < 0) {
- val = -val;
- }
- while (val) {
- bits++;
- val >>= 1;
- }
-
- return bits;
-
-}
-
-/*
- * squashes the font (if possible), returning the new length and
- * a pointer to the new data (which has been allocated). if it can't
- * squish, it just returns a 0 and the data is sent in raw form.
- */
-int _lbx_fi_junklen = sizeof(BYTE) * 2 + sizeof(CARD16) + sizeof(CARD32);
-
-static int
-squish_font_info(xQueryFontReply *qfr,
- int rlen,
- xLbxFontInfo **sqrep)
-{
- int len,
- hlen;
- xLbxFontInfo *new;
- xCharInfo *minb,
- *maxb,
- *ci,
- bbox;
- int i;
- char *t;
- xLbxCharInfo *chars;
- int num_chars;
-
- num_chars = qfr->nCharInfos;
-
- if (num_chars == 0)
- return 0;
-
- minb = &qfr->minBounds;
- maxb = &qfr->maxBounds;
- /*
- * first do the quick check -- if the attribute fields aren't all the
- * same, punt
- */
-
- if (minb->attributes != maxb->attributes)
- return 0;
-
-#define compute(field) \
- bbox.field = max(_bitsize(minb->field), _bitsize(maxb->field))
-
- compute(characterWidth);
- compute(leftSideBearing);
- compute(rightSideBearing);
- compute(ascent);
- compute(descent);
-
-#undef compute
-
- /* make sure it fits */
- if (!((bbox.characterWidth <= LBX_WIDTH_BITS) &&
- (bbox.leftSideBearing <= LBX_LEFT_BITS) &&
- (bbox.rightSideBearing <= LBX_RIGHT_BITS) &&
- (bbox.ascent <= LBX_ASCENT_BITS) &&
- (bbox.descent <= LBX_DESCENT_BITS))) {
- return 0;
- }
-
- hlen = sizeof(xLbxFontInfo) + qfr->nFontProps * sizeof(xFontProp);
-
- len = hlen + (num_chars * sizeof(xLbxCharInfo));
-
- new = (xLbxFontInfo *) xalloc(len);
- if (!new)
- return 0;
-
- /* gross hack to avoid copying all the fields */
- t = (char *) qfr;
- t += _lbx_fi_junklen;
-
- /* copy all but the char infos */
- memcpy((char *) new, (char *) t, hlen);
-
- t = (char *) new;
- t += hlen;
- chars = (xLbxCharInfo *) t;
-
- t = (char *) qfr;
- t += sizeof(xQueryFontReply) + qfr->nFontProps * sizeof(xFontProp);
- ci = (xCharInfo *) t;
-
- /* now copy & pack the charinfos */
- for (i = 0; i < num_chars; i++, chars++, ci++) {
- chars->metrics = 0;
- chars->metrics |= (LBX_MASK_BITS(ci->characterWidth, LBX_WIDTH_BITS)
- << LBX_WIDTH_SHIFT);
- chars->metrics |= (LBX_MASK_BITS(ci->leftSideBearing, LBX_LEFT_BITS)
- << LBX_LEFT_SHIFT);
- chars->metrics |= (LBX_MASK_BITS(ci->rightSideBearing, LBX_RIGHT_BITS)
- << LBX_RIGHT_SHIFT);
- chars->metrics |= (LBX_MASK_BITS(ci->ascent, LBX_ASCENT_BITS)
- << LBX_ASCENT_SHIFT);
- chars->metrics |= (LBX_MASK_BITS(ci->descent, LBX_DESCENT_BITS)
- << LBX_DESCENT_SHIFT);
- }
-
- *sqrep = new;
- return len;
-}
-
-int
-LbxQueryFont(ClientPtr client)
-{
- xQueryFontReply *reply;
- xLbxQueryFontReply lbxrep;
- FontPtr pFont;
- register GC *pGC;
- Bool send_data = FALSE;
- Bool free_data = FALSE;
- int rlength = 0;
- FontTagInfoPtr ftip;
- int sqlen = 0;
- xLbxFontInfo *sqrep,
- *sreply = NULL;
-
- REQUEST(xLbxQueryFontReq);
-
- REQUEST_SIZE_MATCH(xLbxQueryFontReq);
-
- client->errorValue = stuff->fid; /* EITHER font or gc */
- pFont = (FontPtr) SecurityLookupIDByType(client, stuff->fid, RT_FONT,
- SecurityReadAccess);
- if (!pFont) {
- /* can't use VERIFY_GC because it might return BadGC */
- pGC = (GC *) SecurityLookupIDByType(client, stuff->fid, RT_GC,
- SecurityReadAccess);
- if (!pGC || !pGC->font) { /* catch a non-existent builtin font */
- client->errorValue = stuff->fid;
- return (BadFont); /* procotol spec says only error is BadFont */
- }
- pFont = pGC->font;
- }
-
- /* get tag (if any) */
- ftip = (FontTagInfoPtr) FontGetPrivate(pFont, lbx_font_private);
-
- if (!ftip) {
- xCharInfo *pmax = FONTINKMAX(pFont);
- xCharInfo *pmin = FONTINKMIN(pFont);
- int nprotoxcistructs;
-
- nprotoxcistructs = (
- pmax->rightSideBearing == pmin->rightSideBearing &&
- pmax->leftSideBearing == pmin->leftSideBearing &&
- pmax->descent == pmin->descent &&
- pmax->ascent == pmin->ascent &&
- pmax->characterWidth == pmin->characterWidth) ?
- 0 : N2dChars(pFont);
-
- rlength = sizeof(xQueryFontReply) +
- FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
- nprotoxcistructs * sizeof(xCharInfo);
- reply = (xQueryFontReply *) xalloc(rlength);
- if (!reply) {
- return (BadAlloc);
- }
- free_data = TRUE;
- send_data = TRUE;
- QueryFont(pFont, reply, nprotoxcistructs);
-
- sqlen = squish_font_info(reply, rlength, &sqrep);
- if (!sqlen) { /* if it failed to squish, send it raw */
- char *t;
-
- lbxrep.compression = 0;
-
- sqlen = rlength - _lbx_fi_junklen;
- t = (char *) reply;
- sqrep = (xLbxFontInfo *) (t + _lbx_fi_junklen);
- } else {
- lbxrep.compression = 1;
- xfree(reply); /* no longer needed */
- }
- } else { /* just get data from tag */
- sqrep = ftip->fontinfo;
- sqlen = ftip->size;
- lbxrep.compression = ftip->compression;
- }
-
- if (!ftip) {
- /* data allocation is done when font is first queried */
- ftip = (FontTagInfoPtr) xalloc(sizeof(FontTagInfoRec));
- if (ftip &&
- TagSaveTag(LbxTagTypeFont, sqlen, (pointer) ftip, &ftip->tid)) {
- FontSetPrivate(pFont, lbx_font_private, (pointer) ftip);
- ftip->pfont = pFont;
- ftip->size = sqlen;
- ftip->fontinfo = sqrep;
- ftip->compression = lbxrep.compression;
- free_data = FALSE;
- } else {
- xfree(ftip);
- }
- }
- if (ftip) {
- if (!TagProxyMarked(ftip->tid, LbxProxyID(client)))
- send_data = TRUE;
- TagMarkProxy(ftip->tid, LbxProxyID(client));
- lbxrep.tag = ftip->tid;
- } else {
- lbxrep.tag = 0;
- send_data = TRUE;
- }
-
- lbxrep.type = X_Reply;
- lbxrep.sequenceNumber = client->sequence;
- lbxrep.pad0 = lbxrep.pad1 = lbxrep.pad2 = lbxrep.pad3 = lbxrep.pad4 = 0;
-
- if (send_data)
- lbxrep.length = sqlen >> 2;
- else
- lbxrep.length = 0;
-
- if (client->swapped) {
- int n;
-
- swaps(&lbxrep.sequenceNumber, n);
- swapl(&lbxrep.length, n);
- swapl(&lbxrep.tag, n);
- sreply = (xLbxFontInfo *) ALLOCATE_LOCAL(sqlen);
- if (!sreply)
- return BadAlloc;
- memcpy((char *) sreply, (char *) sqrep, sqlen);
- LbxSwapFontInfo(sreply, lbxrep.compression);
- sqrep = sreply;
- }
- WriteToClient(client, sizeof(xLbxQueryFontReply), (char *) &lbxrep);
- if (send_data)
- WriteToClient(client, sqlen, (char *)sqrep);
- if (free_data)
- xfree(sqrep);
- if (sreply)
- DEALLOCATE_LOCAL(sreply);
- return (client->noClientException);
-}
-
-void
-LbxFreeFontTag(FontPtr pfont)
-{
- FontTagInfoPtr ftip;
-
- ftip = (FontTagInfoPtr) FontGetPrivate(pfont, lbx_font_private);
- if (ftip)
- TagDeleteTag(ftip->tid);
-}
-
-int
-LbxInvalidateTag(ClientPtr client,
- XID tag)
-{
- TagClearProxy(tag, LbxProxyID(client));
- return client->noClientException;
-}
-
-void
-LbxSendInvalidateTag(ClientPtr client,
- XID tag,
- int tagtype)
-{
- xLbxInvalidateTagEvent ev;
- int n;
-
- ev.type = LbxEventCode;
- ev.lbxType = LbxInvalidateTagEvent;
- ev.sequenceNumber = client->sequence;
- ev.tag = tag;
- ev.tagType = tagtype;
- ev.pad1 = ev.pad2 = ev.pad3 = ev.pad4 = ev.pad5 = 0;
-
- if (client->swapped) {
- swaps(&ev.sequenceNumber, n);
- swapl(&ev.tag, n);
- swapl(&ev.tagType, n);
- }
- DBG(DBG_CLIENT, (stderr, "Invalidating tag %d\n", tag));
- WriteToClient(client, sizeof(xLbxInvalidateTagEvent), (char *) &ev);
- LbxForceOutput(LbxProxy(client));
-}
-
-static void
-LbxSendSendTagData(int pid,
- XID tag,
- int tagtype)
-{
- xLbxSendTagDataEvent ev;
- int n;
- LbxProxyPtr proxy;
- ClientPtr client;
- LbxClientPtr lbxcp;
-
- proxy = LbxPidToProxy(pid);
- lbxcp = (proxy != NULL) ? proxy->lbxClients[0] : NULL;
- if (lbxcp && (client = lbxcp->client)) {
- ev.type = LbxEventCode;
- ev.lbxType = LbxSendTagDataEvent;
- ev.sequenceNumber = client->sequence;
- ev.tag = tag;
- ev.tagType = tagtype;
- ev.pad1 = ev.pad2 = ev.pad3 = ev.pad4 = ev.pad5 = 0;
-
- if (client->swapped) {
- swaps(&ev.sequenceNumber, n);
- swapl(&ev.tag, n);
- swapl(&ev.tagType, n);
- }
- DBG(DBG_CLIENT, (stderr, "Requesting tag %d\n", tag));
- WriteToClient(client, sizeof(xLbxSendTagDataEvent), (char *) &ev);
- LbxForceOutput(proxy);
- }
-}
-
-/*
- * keep track of clients stalled waiting for tags to come back from
- * a proxy. since multiple clinets can be waiting for the same tag,
- * we have to keep a list of all of them.
- */
-
-typedef struct _sendtagq {
- XID tag;
- int num_stalled;
- ClientPtr *stalled_clients;
- struct _sendtagq *next;
-} SendTagQRec, *SendTagQPtr;
-
-static SendTagQPtr queried_tags = NULL;
-
-#define LbxSendTagFailed -1
-#define LbxSendTagSendIt 0
-#define LbxSendTagAlreadySent 1
-
-static Bool
-LbxQueueSendTag(ClientPtr client,
- XID tag)
-{
- SendTagQPtr stqp, *prev, new;
- ClientPtr *newlist;
-
-
- /* see if we're asking for one already in the pipeline */
- for (prev = &queried_tags; (stqp = *prev); prev = &stqp->next) {
- if (stqp->tag == tag) {
- /* add new client to list */
- newlist = (ClientPtr *) xrealloc(stqp->stalled_clients,
- (sizeof(ClientPtr) * (stqp->num_stalled + 1)));
- if (!newlist)
- return LbxSendTagFailed;
- newlist[stqp->num_stalled++] = client;
- stqp->stalled_clients = newlist;
- DBG(DBG_CLIENT, (stderr, "Additional client requesting tag %d\n", tag));
- return LbxSendTagAlreadySent;
- }
- }
-
- /* make new one */
- new = (SendTagQPtr) xalloc(sizeof(SendTagQRec));
- newlist = (ClientPtr *) xalloc(sizeof(ClientPtr));
- if (!new || !newlist) {
- xfree(new);
- xfree(newlist);
- return LbxSendTagFailed;
- }
- *newlist = client;
- new->stalled_clients = newlist;
- new->num_stalled = 1;
- new->tag = tag;
- new->next = NULL;
-
- /* stick on end of list */
- *prev = new;
- return LbxSendTagSendIt;
-}
-
-static SendTagQPtr
-LbxFindQTag(XID tag)
-{
- SendTagQPtr stqp;
-
- for (stqp = queried_tags; stqp; stqp = stqp->next) {
- if (stqp->tag == tag)
- return stqp;
- }
- return NULL;
-}
-
-static void
-LbxFreeQTag(SendTagQPtr stqp)
-{
- xfree(stqp->stalled_clients);
- xfree(stqp);
-}
-
-static void
-LbxRemoveQTag(XID tag)
-{
- SendTagQPtr stqp, *prev;
-
- for (prev = &queried_tags; (stqp = *prev); prev = &stqp->next) {
- if (stqp->tag == tag) {
- *prev = stqp->next;
- LbxFreeQTag(stqp);
- return;
- }
- }
-}
-
-Bool
-LbxFlushQTag(XID tag)
-{
- SendTagQPtr stqp;
- ClientPtr *cp;
-
- stqp = LbxFindQTag(tag);
- if (!stqp)
- return FALSE;
- for (cp = stqp->stalled_clients; --stqp->num_stalled >= 0; cp++)
- AttendClient(*cp);
- LbxRemoveQTag(tag);
- return TRUE;
-}
-
-void
-ProcessQTagZombies(void)
-{
- SendTagQPtr stqp;
- ClientPtr *out, *in;
- int i;
-
- for (stqp = queried_tags; stqp; stqp = stqp->next) {
- out = stqp->stalled_clients;
- for (in = out, i = stqp->num_stalled; --i >= 0; in++) {
- if ((*in)->clientGone)
- --stqp->num_stalled;
- else
- *out++ = *in;
- }
- }
-}
-
-/*
- * server sends this
- */
-
-void
-LbxQueryTagData(ClientPtr client,
- int owner_pid,
- XID tag,
- int tagtype)
-{
- /* save the info and the client being stalled */
- if (LbxQueueSendTag(client, tag) == LbxSendTagSendIt)
- LbxSendSendTagData(owner_pid, tag, tagtype);
-}
-
-/*
- * server recieves this
- */
-int
-LbxTagData(ClientPtr client,
- XID tag,
- unsigned long len,
- pointer data)
-{
- TagData td;
- PropertyPtr pProp;
-
- td = TagGetTag(tag);
- if (!td || td->data_type != LbxTagTypeProperty)
- return Success;
- if (!td->global) {
- /* somebody changed contents while we were querying */
- TagDeleteTag(tag);
- return Success;
- }
- LbxFlushQTag(tag);
- pProp = (PropertyPtr) td->tdata;
- if (pProp->tag_id != tag || pProp->owner_pid != LbxProxyID(client))
- return Success;
- pProp->owner_pid = 0;
- if (len != td->size)
- pProp->size = len / (pProp->format >> 3);
- pProp->data = xrealloc(pProp->data, len);
- if (!pProp->data) {
- pProp->size = 0;
- return Success;
- }
- if (client->swapped) {
- switch (pProp->format) {
- case 32:
- SwapLongs((CARD32 *) data, len >> 2);
- break;
- case 16:
- SwapShorts((short *) data, len >> 1);
- break;
- default:
- break;
- }
- }
- memmove((char *) pProp->data, (char *) data, len);
- return Success;
-}
-
-/* when server resets, need to reset global tags */
-void
-LbxResetTags(void)
-{
- SendTagQPtr stqp;
-
- modifier_map_tag = 0;
- keyboard_map_tag = 0;
-
- /* clean out any pending tag requests */
- while ((stqp = queried_tags)) {
- queried_tags = stqp->next;
- LbxFreeQTag(stqp);
- }
-}
diff --git a/lbx/lbxexts.c b/lbx/lbxexts.c
deleted file mode 100644
index d611a7f2c..000000000
--- a/lbx/lbxexts.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/* $Xorg: lbxexts.c,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-/*
- * Copyright 1994 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxexts.c,v 1.4 2001/02/16 13:24:10 eich Exp $ */
-
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "dixstruct.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "extensions/security.h"
-#endif
-
-typedef struct _lbxext {
- char *name;
- char **aliases;
- int num_aliases;
- int idx;
- int opcode;
- int ev_base;
- int err_base;
- int num_reqs;
- CARD8 *rep_mask;
- CARD8 *ev_mask;
-#ifdef XCSECURITY
- Bool secure;
-#endif
-} LbxExtensionEntry;
-
-static LbxExtensionEntry **lbx_extensions = NULL;
-static int num_exts = 0;
-
-
-Bool
-LbxAddExtension(char *name,
- int opcode,
- int ev_base,
- int err_base)
-{
- int i;
- LbxExtensionEntry *ext,
- **newexts;
-
- ext = (LbxExtensionEntry *) xalloc(sizeof(LbxExtensionEntry));
- if (!ext)
- return FALSE;
- ext->name = (char *) xalloc(strlen(name) + 1);
- ext->num_aliases = 0;
- ext->aliases = (char **) NULL;
- if (!ext->name) {
- xfree(ext);
- return FALSE;
- }
- strcpy(ext->name, name);
- i = num_exts;
- newexts = (LbxExtensionEntry **) xrealloc(lbx_extensions,
- (i + 1) * sizeof(LbxExtensionEntry *));
- if (!newexts) {
- xfree(ext->name);
- xfree(ext);
- return FALSE;
- }
- num_exts++;
- lbx_extensions = newexts;
- lbx_extensions[i] = ext;
- ext->idx = i;
-
- ext->opcode = opcode;;
- ext->ev_base = ev_base;;
- ext->err_base = err_base;
- ext->ev_mask = NULL;
- ext->rep_mask = NULL;
- ext->num_reqs = 0;
-#ifdef XCSECURITY
- ext->secure = FALSE;
-#endif
-
- return TRUE;
-}
-
-Bool
-LbxAddExtensionAlias(int idx,
- char *alias)
-{
- char *name;
- char **aliases;
- LbxExtensionEntry *ext = lbx_extensions[idx];
-
- aliases = (char **) xrealloc(ext->aliases,
- (ext->num_aliases + 1) * sizeof(char *));
- if (!aliases)
- return FALSE;
- ext->aliases = aliases;
- name = (char *) xalloc(strlen(alias) + 1);
- if (!name)
- return FALSE;
- strcpy(name, alias);
- ext->aliases[ext->num_aliases] = name;
- ext->num_aliases++;
- return TRUE;
-}
-
-static int
-LbxFindExtension(char *extname,
- int len)
-{
- int i, j;
-
- for (i = 0; i < num_exts; i++) {
- if ((strlen(lbx_extensions[i]->name) == len) &&
- (strncmp(lbx_extensions[i]->name, extname, len) == 0))
- return i;
- for (j = lbx_extensions[i]->num_aliases; --j >= 0;) {
- if ((strlen(lbx_extensions[i]->aliases[j]) == len) &&
- (strncmp(lbx_extensions[i]->aliases[j], extname, len) == 0))
- return i;
- }
- }
- return -1;
-}
-
-void
-LbxDeclareExtensionSecurity(char *extname,
- Bool secure)
-{
-#ifdef XCSECURITY
- int i = LbxFindExtension(extname, strlen(extname));
- if (i >= 0)
- lbx_extensions[i]->secure = secure;
-#endif
-}
-
-Bool
-LbxRegisterExtensionGenerationMasks(int idx,
- int num_reqs,
- char *rep_mask,
- char *ev_mask)
-{
- LbxExtensionEntry *ext = lbx_extensions[idx];
- CARD8 *nrm,
- *nem;
- int mlen = mlen = num_reqs / (8 * sizeof(CARD8)) + 1;
-
- nrm = (CARD8 *) xalloc(sizeof(CARD8) * mlen);
- nem = (CARD8 *) xalloc(sizeof(CARD8) * mlen);
-
- if (!nrm || !nem) {
- xfree(nrm);
- xfree(nem);
- return FALSE;
- }
- memcpy((char *) nrm, (char *) rep_mask, mlen);
- memcpy((char *) nem, (char *) ev_mask, mlen);
- ext->rep_mask = nrm;
- ext->ev_mask = nem;
- ext->num_reqs = num_reqs;
-
- return TRUE;
-}
-
-int
-LbxQueryExtension(ClientPtr client,
- char *ename,
- int nlen)
-{
- xLbxQueryExtensionReply rep;
- int i;
- int mlen = 0;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.major_opcode = 0;
- rep.present = FALSE;
- rep.length = 0;
- rep.pad0 = rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0;
-
- i = LbxFindExtension(ename, nlen);
-
- if (i < 0
-#ifdef XCSECURITY
- /* don't show insecure extensions to untrusted clients */
- || (client->trustLevel == XSecurityClientUntrusted &&
- !lbx_extensions[i]->secure)
-#endif
- )
- rep.present = FALSE;
- else {
- rep.present = TRUE;
- rep.major_opcode = lbx_extensions[i]->opcode;
- rep.first_event = lbx_extensions[i]->ev_base;
- rep.first_error = lbx_extensions[i]->err_base;
- rep.numReqs = lbx_extensions[i]->num_reqs;
- if (lbx_extensions[i]->rep_mask) {
- mlen = (lbx_extensions[i]->num_reqs + 7) >> 3;
- rep.length = ((mlen + 3) >> 2) * 2;
- }
- }
- if (client->swapped) {
- char n;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xLbxQueryExtensionReply), (char *)&rep);
- if (mlen) {
- WriteToClient(client, mlen, (char *)lbx_extensions[i]->rep_mask);
- WriteToClient(client, mlen, (char *)lbx_extensions[i]->ev_mask);
- }
- return Success;
-}
-
-void
-LbxCloseDownExtensions(void)
-{
- int i,j;
-
- for (i = 0; i < num_exts; i++) {
- xfree(lbx_extensions[i]->name);
- for (j = 0; j < lbx_extensions[i]->num_aliases; j++)
- xfree(lbx_extensions[i]->aliases[j]);
- xfree(lbx_extensions[i]->aliases);
- xfree(lbx_extensions[i]->rep_mask);
- xfree(lbx_extensions[i]->ev_mask);
- xfree(lbx_extensions[i]);
- }
- xfree(lbx_extensions);
- lbx_extensions = NULL;
- num_exts = 0;
-
-}
-
-void
-LbxSetReqMask(CARD8 *mask,
- int req,
- Bool on)
-{
- int mword = req / (8 * sizeof(CARD8));
-
- req = req % (8 * sizeof(CARD8));
- if (on) {
- mask[mword] |= (1 << req);
- } else {
- mask[mword] &= ~(1 << req);
- }
-}
diff --git a/lbx/lbxgfx.c b/lbx/lbxgfx.c
deleted file mode 100644
index 6eb7af197..000000000
--- a/lbx/lbxgfx.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/* $Xorg: lbxgfx.c,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxgfx.c,v 1.4 2001/08/23 14:46:57 alanh Exp $ */
-
-/* various bits of DIX-level mangling */
-
-#include <sys/types.h>
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "servermd.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#include "lbxtags.h"
-#include "Xfuncproto.h"
-#include "lbximage.h"
-#include "lbxsrvopts.h"
-
-#define DrawableCache(client) (LbxClient(client)->drawableCache)
-#define GContextCache(client) (LbxClient(client)->gcontextCache)
-
-static void
-push (XID cache[GFX_CACHE_SIZE],
- XID xid)
-{
- memmove (cache+1, cache, (GFX_CACHE_SIZE - 1) * sizeof (cache[0]));
- cache[0] = xid;
-}
-
-static XID
-use (XID cache[GFX_CACHE_SIZE],
- int i)
-{
- XID tmp;
-
- tmp = cache[i];
- if (i != 0)
- {
- memmove (cache + 1, cache, i * sizeof (cache[0]));
- cache[0] = tmp;
- }
- return tmp;
-}
-
-extern char *ConnectionInfo;
-
-static int
-LbxDecodeGFXCache(ClientPtr client,
- CARD8 cacheEnts,
- char *after,
- Drawable *drawp,
- GContext *gcp)
-{
- int skip;
- int dcache, gcache;
-
- dcache = GFXdCacheEnt (cacheEnts);
- gcache = GFXgCacheEnt (cacheEnts);
- skip = 0;
- if (dcache == GFXCacheNone)
- {
- memcpy (drawp, after, sizeof (Drawable));
- push (DrawableCache(client), *drawp);
- after += sizeof (Drawable);
- skip += sizeof (Drawable);
- }
- else
- *drawp = use (DrawableCache(client), dcache);
- if (gcache == GFXCacheNone)
- {
- memcpy (gcp, after, sizeof (GContext));
- push (GContextCache(client), *gcp);
- skip += sizeof (GContext);
- }
- else
- *gcp = use (GContextCache(client), gcache);
- return skip;
-}
-
-static int
-LbxDecodeDrawableCache(ClientPtr client,
- CARD8 cacheEnts,
- char *after,
- Drawable *drawp)
-{
- int skip;
- int dcache;
-
- dcache = GFXdCacheEnt (cacheEnts);
- skip = 0;
- if (dcache == GFXCacheNone)
- {
- memcpy (drawp, after, sizeof (Drawable));
- push (DrawableCache(client), *drawp);
- after += sizeof (Drawable);
- skip += sizeof (Drawable);
- }
- else
- *drawp = use (DrawableCache(client), dcache);
- return skip;
-}
-
-#ifdef notyet
-static int
-LbxDecodeGCCache(ClientPtr client,
- CARD8 cacheEnts,
- char *after,
- GContext *gcp)
-{
- int skip;
- int gcache;
-
- gcache = GFXgCacheEnt (cacheEnts);
- skip = 0;
- if (gcache == GFXCacheNone)
- {
- memcpy (gcp, after, sizeof (GContext));
- push (GContextCache(client), *gcp);
- after += sizeof (GContext);
- skip += sizeof (GContext);
- }
- else
- *gcp = use (GContextCache(client), gcache);
- return skip;
-}
-#endif
-
-#define GFX_GET_DRAWABLE_AND_GC(type,in,len) {\
- int skip; \
- len = (client->req_len << 2) - SIZEOF(type); \
- in = ((char *) stuff) + SIZEOF(type);\
- skip = LbxDecodeGFXCache(client, stuff->cacheEnts, in, \
- &drawable, &gc); \
- in += skip; \
- len -= skip; \
-}
-
-#define GFX_GET_DST_DRAWABLE_AND_GC(type,in,len) {\
- int skip; \
- len = (client->req_len << 2) - SIZEOF(type); \
- in = ((char *) stuff) + SIZEOF(type);\
- skip = LbxDecodeGFXCache(client, stuff->cacheEnts, in, \
- &dstDrawable, &gc); \
- in += skip; \
- len -= skip; \
-}
-
-#define GFX_GET_SRC_DST_DRAWABLE_AND_GC(type, in, len) { \
- int skip; \
- len = (client->req_len << 2) - SIZEOF(type); \
- in = ((char *) stuff) + SIZEOF(type); \
- skip = LbxDecodeDrawableCache(client, stuff->srcCache, in, \
- &srcDrawable); \
- in += skip; \
- len -= skip; \
- skip = LbxDecodeGFXCache(client, stuff->cacheEnts, in, \
- &dstDrawable, &gc); \
- in += skip; \
- len -= skip; \
-}
-
-#define GFX_GET_GC(type, in, len) { \
- int skip; \
- len = (client->req_len << 2) - SIZEOF(type); \
- in = ((char *) stuff) + SIZEOF(type); \
- skip = LbxDecodeGCCache(client, stuff->gcCache, in, &gc); \
- in += skip; \
- len -= skip; \
-}
-
-int
-LbxDecodePoly(ClientPtr client,
- CARD8 xreqtype,
- int (*decode_rtn)(char *, char *, short *))
-{
- REQUEST(xLbxPolyPointReq);
- char *in;
- xPolyPointReq *xreq;
- int len;
- int retval;
- Drawable drawable;
- GContext gc;
-
- GFX_GET_DRAWABLE_AND_GC(xLbxPolyPointReq, in, len);
- if ((xreq = (xPolyPointReq *)
- xalloc(sizeof(xPolyPointReq) + (len << 1))) == NULL)
- return BadAlloc;
- len = (*decode_rtn)(in, in + len - stuff->padBytes, (short *)(&xreq[1]));
- xreq->reqType = xreqtype;
- xreq->coordMode = 1;
- xreq->drawable = drawable;
- xreq->gc = gc;
- xreq->length = client->req_len = (sizeof(xPolyPointReq) + len) >> 2;
- client->requestBuffer = (pointer)xreq;
-
- retval = (*ProcVector[xreqtype])(client);
- xfree(xreq);
- return retval;
-}
-
-int
-LbxDecodeFillPoly(ClientPtr client)
-{
- REQUEST(xLbxFillPolyReq);
- char *in;
- xFillPolyReq *xreq;
- int len;
- int retval;
- Drawable drawable;
- GContext gc;
-
- GFX_GET_DRAWABLE_AND_GC(xLbxFillPolyReq, in, len);
- if ((xreq = (xFillPolyReq *)
- xalloc(sizeof(xFillPolyReq) + (len << 1))) == NULL)
- return BadAlloc;
- len = LbxDecodePoints(in, in + len - stuff->padBytes, (short *) &xreq[1]);
- xreq->reqType = X_FillPoly;
- xreq->drawable = drawable;
- xreq->gc = gc;
- xreq->shape = stuff->shape;
- xreq->coordMode = 1;
- xreq->length = client->req_len = (sizeof(xFillPolyReq) + len) >> 2;
- client->requestBuffer = (pointer)xreq;
-
- retval = (*ProcVector[X_FillPoly])(client);
- xfree(xreq);
- return retval;
-}
-
-/*
- * Routines for decoding line drawing requests
- */
-
-#define DECODE_PSHORT(in, val) \
- if ((*(in) & 0xf0) != 0xf0) \
- (val) = *(CARD8 *)(in)++; \
- else { \
- (val) = ((*(CARD8 *)(in) & 0x0f) << 8) | *(CARD8 *)((in) + 1); \
- if ((val) >= 0xe00) \
- (val) -= 0x1000; \
- else \
- (val) += 0xf0; \
- (in) += 2; \
- }
-
-#define DECODE_SHORT(in, val) \
- if ((*(in) & 0xf0) != 0x80) \
- (val) = *(INT8 *)(in)++; \
- else { \
- (val) = ((*(CARD8 *)(in) & 0x0f) << 8) | *(CARD8 *)((in) + 1); \
- if ((val) & 0x0800) \
- (val) = ((val) | 0xf000) - 0x70; \
- else \
- (val) += 0x80; \
- (in) += 2; \
- }
-
-#define DECODE_USHORT(in, val) \
- if ((*(in) & 0xf0) != 0xf0) \
- (val) = *(CARD8 *)(in)++; \
- else { \
- (val) = (((*(CARD8 *)(in) & 0x0f) << 8) | *(CARD8 *)((in) + 1)) + 0xf0; \
- (in) += 2; \
- }
-
-#define DECODE_ANGLE(in, val) \
- if (*(INT8 *)(in) >= 0x6e) \
- (val) = (*(INT8 *)(in)++ - 0x67) * (15 << 6); \
- else if (*(INT8 *)(in) >= 0x5a) \
- (val) = (*(INT8 *)(in)++ - 0x5a) * (5 << 6); \
- else if (*(INT8 *)(in) <= (INT8)0x91) \
- (val) = (*(INT8 *)(in)++ - (INT8)0x98) * (15 << 6); \
- else if (*(INT8 *)(in) <= (INT8)0xa5) \
- (val) = (*(INT8 *)(in)++ - (INT8)0xa6) * (5 << 6); \
- else { \
- (val) = (*(CARD8 *)(in) << 8) | *(CARD8 *)((in) + 1); \
- (in) += 2; \
- }
-
-int
-LbxDecodePoints(char *in,
- char *inend,
- short *out)
-{
- char *start_out = (char *)out;
-
- while (in < inend) {
- DECODE_SHORT(in, *out);
- out++;
- DECODE_SHORT(in, *out);
- out++;
- }
- return ((char *)out - start_out);
-}
-
-int
-LbxDecodeSegment(char *in,
- char *inend,
- short *out)
-{
- short diff;
- short last_x = 0;
- short last_y = 0;
- char *start_out = (char *)out;
-
- while (in < inend) {
- DECODE_SHORT(in, diff);
- *out = last_x + diff;
- last_x += diff;
- out++;
- DECODE_SHORT(in, diff);
- *out = last_y + diff;
- last_y += diff;
- out++;
-
- DECODE_SHORT(in, diff);
- *out = last_x + diff;
- out++;
- DECODE_SHORT(in, diff);
- *out = last_y + diff;
- out++;
- }
- return ((char *)out - start_out);
-}
-
-int
-LbxDecodeRectangle(char *in,
- char *inend,
- short *out)
-{
- short diff;
- short last_x = 0;
- short last_y = 0;
- char *start_out = (char *)out;
-
- while (in < inend) {
- DECODE_SHORT(in, diff);
- *out = last_x + diff;
- last_x += diff;
- out++;
- DECODE_SHORT(in, diff);
- *out = last_y + diff;
- last_y += diff;
- out++;
-
- DECODE_USHORT(in, *(unsigned short *)out);
- out++;
- DECODE_USHORT(in, *(unsigned short *)out);
- out++;
- }
- return ((char *)out - start_out);
-}
-
-int
-LbxDecodeArc(char *in,
- char *inend,
- short *out)
-{
- short diff;
- short last_x = 0;
- short last_y = 0;
- char *start_out = (char *)out;
-
- while (in < inend) {
- DECODE_SHORT(in, diff);
- *out = last_x + diff;
- last_x += diff;
- out++;
- DECODE_SHORT(in, diff);
- *out = last_y + diff;
- last_y += diff;
- out++;
-
- DECODE_USHORT(in, *(unsigned short *)out);
- out++;
- DECODE_USHORT(in, *(unsigned short *)out);
- out++;
-
- DECODE_ANGLE(in, *out);
- out++;
- DECODE_ANGLE(in, *out);
- out++;
- }
- return ((char *)out - start_out);
-}
-
-int
-LbxDecodeCopyArea (ClientPtr client)
-{
- REQUEST(xLbxCopyAreaReq);
- char *in;
- xCopyAreaReq req;
- int len;
- Drawable srcDrawable, dstDrawable;
- GContext gc;
-
- GFX_GET_SRC_DST_DRAWABLE_AND_GC(xLbxCopyAreaReq, in, len);
- req.reqType = X_CopyArea;
- req.length = client->req_len = SIZEOF(xCopyAreaReq) >> 2;
- req.srcDrawable = srcDrawable;
- req.dstDrawable = dstDrawable;
- req.gc = gc;
- DECODE_PSHORT (in, req.srcX);
- DECODE_PSHORT (in, req.srcY);
- DECODE_PSHORT (in, req.dstX);
- DECODE_PSHORT (in, req.dstY);
- DECODE_USHORT (in, req.width);
- DECODE_USHORT (in, req.height);
- client->requestBuffer = (pointer) &req;
- return (*ProcVector[X_CopyArea])(client);
-}
-
-int
-LbxDecodeCopyPlane (ClientPtr client)
-{
- REQUEST(xLbxCopyPlaneReq);
- char *in;
- xCopyPlaneReq req;
- int len;
- Drawable srcDrawable, dstDrawable;
- GContext gc;
-
- GFX_GET_SRC_DST_DRAWABLE_AND_GC(xLbxCopyPlaneReq, in, len);
- req.reqType = X_CopyPlane;
- req.length = client->req_len = SIZEOF(xCopyPlaneReq) >> 2;
- req.srcDrawable = srcDrawable;
- req.dstDrawable = dstDrawable;
- req.gc = gc;
- DECODE_PSHORT (in, req.srcX);
- DECODE_PSHORT (in, req.srcY);
- DECODE_PSHORT (in, req.dstX);
- DECODE_PSHORT (in, req.dstY);
- DECODE_USHORT (in, req.width);
- DECODE_USHORT (in, req.height);
- req.bitPlane = stuff->bitPlane;
- client->requestBuffer = (pointer) &req;
- return (*ProcVector[X_CopyPlane])(client);
-}
-
-static pointer
-get_gfx_buffer(ClientPtr client,
- int len)
-{
- LbxClientPtr lbxClient = LbxClient(client);
- pointer tmp;
-
- /* XXX should probably shrink this sucker too */
- if (len > lbxClient->gb_size) {
- tmp = (pointer) xrealloc(lbxClient->gfx_buffer, len);
- if (!tmp)
- return (pointer) NULL;
- lbxClient->gfx_buffer = tmp;
- lbxClient->gb_size = len;
- }
- return lbxClient->gfx_buffer;
-}
-
-int
-LbxDecodePolyText (ClientPtr client)
-{
- REQUEST(xLbxPolyTextReq);
- char *in, *pos;
- xPolyTextReq *xreq;
- int len;
- Drawable drawable;
- GContext gc;
-
- GFX_GET_DRAWABLE_AND_GC(xLbxPolyTextReq, in, len);
- xreq = (xPolyTextReq *) get_gfx_buffer(client, sizeof (xPolyTextReq) + len);
- if (!xreq)
- return BadAlloc;
- xreq->reqType = stuff->lbxReqType == X_LbxPolyText8? X_PolyText8 : X_PolyText16;
- xreq->drawable = drawable;
- xreq->gc = gc;
- pos = in;
- DECODE_PSHORT(in, xreq->x);
- DECODE_PSHORT(in, xreq->y);
- len -= (in - pos);
- memmove ((char *) (xreq + 1), in, len);
- xreq->length = client->req_len = (sizeof (xPolyTextReq) + len) >> 2;
- client->requestBuffer = (pointer) xreq;
- return (*ProcVector[xreq->reqType])(client);
-}
-
-int
-LbxDecodeImageText (ClientPtr client)
-{
- REQUEST(xLbxImageTextReq);
- char *in, *pos;
- xImageTextReq *xreq;
- int len;
- Drawable drawable;
- GContext gc;
-
- GFX_GET_DRAWABLE_AND_GC(xLbxImageTextReq, in, len);
- xreq = (xImageTextReq *) get_gfx_buffer(client, sizeof (xImageTextReq) + len);
- if (!xreq)
- return BadAlloc;
- xreq->reqType = stuff->lbxReqType == X_LbxImageText8? X_ImageText8 : X_ImageText16;
- xreq->drawable = drawable;
- xreq->gc = gc;
- xreq->nChars = stuff->nChars;
- pos = in;
- DECODE_PSHORT(in, xreq->x);
- DECODE_PSHORT(in, xreq->y);
- len -= (in - pos);
- memmove ((char *) (xreq + 1), in, len);
- xreq->length = client->req_len = (sizeof (xImageTextReq) + len) >> 2;
- client->requestBuffer = (pointer) xreq;
- return (*ProcVector[xreq->reqType])(client);
-}
-
-int
-LbxDecodePutImage (ClientPtr client)
-{
- REQUEST (xLbxPutImageReq);
- char *in, *data;
- xPutImageReq xreq;
- int ppl, bpl, nbytes;
- int retval;
- int n;
-
- xreq.reqType = X_PutImage;
-
- in = (char *) stuff + sz_xLbxPutImageReq;
-
- if (stuff->bitPacked & 0x80) {
- xreq.format = (stuff->bitPacked >> 5) & 0x3;
- xreq.depth = ((stuff->bitPacked >> 2) & 0x7) + 1;
- xreq.leftPad = 0;
- } else {
- xreq.depth = (stuff->bitPacked >> 2) + 1;
- xreq.format = (*in >> 5) & 0x3;
- xreq.leftPad = *in++ & 0x1f;
- }
- DECODE_USHORT(in, xreq.width);
- DECODE_USHORT(in, xreq.height);
- DECODE_PSHORT(in, xreq.dstX);
- DECODE_PSHORT(in, xreq.dstY);
- if (client->swapped) {
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone ||
- GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (in, n);
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone &&
- GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (in + 4, n);
- }
- }
- in += LbxDecodeGFXCache(client, stuff->cacheEnts, in,
- &xreq.drawable, &xreq.gc);
-
- ppl = xreq.width + xreq.leftPad;
- if (xreq.format != ZPixmap ||
- (xreq.depth == 1 && screenInfo.formats->bitsPerPixel == 1)) {
-#ifdef INTERNAL_VS_EXTERNAL_PADDING
- bpl = BitmapBytePadProto(ppl);
-#else
- bpl = BitmapBytePad(ppl);
-#endif
- nbytes = bpl;
- if (xreq.format == XYPixmap)
- nbytes *= xreq.depth;
- } else {
-#ifdef INTERNAL_VS_EXTERNAL_PADDING
- bpl = PixmapBytePadProto(ppl, xreq.depth);
-#else
- bpl = PixmapBytePad(ppl, xreq.depth);
-#endif
- nbytes = bpl;
- }
- nbytes *= xreq.height;
- xreq.length = ((nbytes + 3) >> 2) + (sz_xPutImageReq >> 2);
- /* +1 is because fillspan in DecodeFaxG42D seems to go 1 byte too far,
- * and I don't want to mess with that code */
- if ((data = (char *) xalloc ((xreq.length << 2) + 1)) == NULL)
- return BadAlloc;
-
- *((xPutImageReq *)data) = xreq;
-
- if (!stuff->compressionMethod)
- {
- memcpy(data + sz_xPutImageReq, in, nbytes);
- }
- else if (xreq.format != ZPixmap ||
- (xreq.depth == 1 && screenInfo.formats->bitsPerPixel == 1))
- {
- LbxBitmapCompMethod *compMethod;
-
- compMethod = LbxSrvrLookupBitmapCompMethod (LbxProxy(client),
- stuff->compressionMethod);
-
- if (!compMethod)
- {
- xfree (data);
- return (BadValue);
- }
- else
- {
- if (!compMethod->inited)
- {
- if (compMethod->compInit)
- (*compMethod->compInit)();
- compMethod->inited = 1;
- }
-
- (*compMethod->decompFunc) (
- (unsigned char *) in, (unsigned char *) data + sz_xPutImageReq,
- nbytes,
-#if BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER
- (ppl + BITMAP_SCANLINE_UNIT - 1) & ~BITMAP_SCANLINE_UNIT,
-#else
- ppl,
-#endif
- bpl,
- ((xConnSetup *) ConnectionInfo)->bitmapBitOrder == LSBFirst);
- }
- }
- else
- {
- LbxPixmapCompMethod *compMethod;
-
- compMethod = LbxSrvrLookupPixmapCompMethod (LbxProxy(client),
- stuff->compressionMethod);
-
- if (!compMethod)
- {
- xfree (data);
- return (BadValue);
- }
- else
- {
- if (!compMethod->inited)
- {
- if (compMethod->compInit)
- (*compMethod->compInit)();
- compMethod->inited = 1;
- }
-
- (*compMethod->decompFunc) (
- in, (char *) data + sz_xPutImageReq,
- (int) xreq.height, bpl);
- }
- }
-
- client->req_len = xreq.length;
- client->requestBuffer = (pointer) data;
-
- retval = (*ProcVector[X_PutImage])(client);
- xfree(data);
- return retval;
-}
-
-int
-LbxDecodeGetImage (ClientPtr client)
-{
- REQUEST (xLbxGetImageReq);
- xLbxGetImageReply *reply = NULL;
- int lbxLen, xLen, n;
- int method = 0, bytes, status;
- xGetImageReply *theImage;
-
- REQUEST_SIZE_MATCH(xLbxGetImageReq);
-
- status = DoGetImage(client, stuff->format, stuff->drawable,
- stuff->x, stuff->y,
- (int)stuff->width, (int)stuff->height,
- stuff->planeMask, &theImage);
-
- if (status != Success)
- return (status);
-
- if ((reply = (xLbxGetImageReply *) xalloc (
- sz_xLbxGetImageReply + theImage->length)) == NULL)
- {
- xfree(theImage);
- return (BadAlloc);
- }
-
- if (stuff->format != ZPixmap ||
- (theImage->depth == 1 && screenInfo.formats->bitsPerPixel == 1))
- {
- LbxBitmapCompMethod *compMethod;
-
- compMethod = LbxSrvrFindPreferredBitmapCompMethod (LbxProxy(client));
-
- if (!compMethod)
- status = LBX_IMAGE_COMPRESS_NO_SUPPORT;
- else
- {
- if (!compMethod->inited)
- {
- if (compMethod->compInit)
- (*compMethod->compInit)();
- compMethod->inited = 1;
- }
-
- status = (*compMethod->compFunc) (
- (unsigned char *) &theImage[1],
- (unsigned char *) &reply[1],
- theImage->length,
- theImage->length,
-#if BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER
- (int) (stuff->width + BITMAP_SCANLINE_UNIT - 1) &
- ~BITMAP_SCANLINE_UNIT,
-#else
- (int) stuff->width,
-#endif
-#ifdef INTERNAL_VS_EXTERNAL_PADDING
- BitmapBytePadProto(stuff->width),
-#else
- BitmapBytePad(stuff->width),
-#endif
- ((xConnSetup *) ConnectionInfo)->bitmapBitOrder == LSBFirst,
- &bytes);
-
- method = compMethod->methodOpCode;
- }
- }
- else
- {
- LbxPixmapCompMethod *compMethod;
-
- compMethod = LbxSrvrFindPreferredPixmapCompMethod (
- LbxProxy(client), (int) stuff->format, theImage->depth);
-
- if (!compMethod)
- status = LBX_IMAGE_COMPRESS_NO_SUPPORT;
- else
- {
- if (!compMethod->inited)
- {
- if (compMethod->compInit)
- (*compMethod->compInit)();
- compMethod->inited = 1;
- }
-
- status = (*compMethod->compFunc) (
- (char *) &theImage[1],
- (char *) &reply[1],
- theImage->length,
- (int) stuff->format,
- theImage->depth,
- (int) stuff->height,
-#ifdef INTERNAL_VS_EXTERNAL_PADDING
- PixmapBytePadProto(stuff->width, theImage->depth),
-#else
- PixmapBytePad(stuff->width, theImage->depth),
-#endif
- &bytes);
-
- method = compMethod->methodOpCode;
- }
- }
-
- reply->type = X_Reply;
- reply->depth = theImage->depth;
- reply->sequenceNumber = client->sequence;
- reply->visual = theImage->visual;
- reply->pad1 = reply->pad2 = reply->pad3 = reply->pad4 = reply->pad5 = 0;
-
- if (status != LBX_IMAGE_COMPRESS_SUCCESS)
- {
- reply->compressionMethod = LbxImageCompressNone;
- reply->lbxLength = reply->xLength = (theImage->length + 3) >> 2;
- }
- else
- {
- reply->compressionMethod = method;
- reply->lbxLength = (bytes + 3) >> 2;
- reply->xLength = (theImage->length + 3) >> 2;
- }
-
- lbxLen = reply->lbxLength;
- xLen = reply->xLength;
-
- if (client->swapped)
- {
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->lbxLength, n);
- swapl (&reply->xLength, n);
- swapl (&reply->visual, n);
- }
-
- if (reply->compressionMethod != LbxImageCompressNone)
- {
- /*
- * If the compressed image is greater that 25% of the original
- * image, run the GetImage reply through the regular stream
- * compressor. Otherwise, just write the compressed image.
- */
-
- if (lbxLen > (xLen / 4))
- {
- WriteToClient (client,
- sz_xLbxGetImageReply + (lbxLen << 2), (char *)reply);
- }
- else
- {
- UncompressedWriteToClient (client,
- sz_xLbxGetImageReply + (lbxLen << 2), (char *)reply);
- }
- }
- else
- {
- /*
- * Write back the original uncompressed image.
- */
-
- WriteToClient (client, sz_xLbxGetImageReply, (char *)reply);
- WriteToClient (client, lbxLen << 2, (char *)&theImage[1]);
- }
-
- xfree (theImage);
-
- if (reply)
- xfree ((char *) reply);
-
- return (Success);
-}
diff --git a/lbx/lbxmain.c b/lbx/lbxmain.c
deleted file mode 100644
index 1a82ce3b3..000000000
--- a/lbx/lbxmain.c
+++ /dev/null
@@ -1,1756 +0,0 @@
-/* $Xorg: lbxmain.c,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1992 Network Computing Devices
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of NCD. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. NCD. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxmain.c,v 1.13 2001/12/14 20:00:00 dawes Exp $ */
-
-#include <sys/types.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "Xos.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "extnsionst.h"
-#include "servermd.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxdeltastr.h"
-#include "lbxserve.h"
-#include "lbximage.h"
-#include "lbxsrvopts.h"
-#include "lbxtags.h"
-#include "Xfuncproto.h"
-#include <errno.h>
-#ifndef Lynx
-#include <sys/uio.h>
-#else
-#include <uio.h>
-#endif
-#include <stdio.h>
-
-#ifndef X_NOT_POSIX
-#include <unistd.h>
-#endif
-
-#define CloseLbxClient 0xff
-
-#define MAXBYTESDIFF 8
-
-int LbxWhoAmI = 1; /*
- * for lbx zlib library to know who we are
- * server = 1
- * proxy = 0
- */
-
-
-static void LbxResetProc ( ExtensionEntry *extEntry );
-static void LbxFreeClient ( ClientPtr client );
-static void LbxShutdownProxy ( LbxProxyPtr proxy );
-static int DecodeLbxDelta ( ClientPtr client );
-
-static LbxProxyPtr proxyList;
-unsigned char LbxReqCode;
-int LbxEventCode;
-static int BadLbxClientCode;
-static int uid_seed;
-
-static int lbxCompressWorkProcCount;
-
-LbxClientPtr lbxClients[MAXCLIENTS];
-
-extern xConnSetupPrefix connSetupPrefix;
-extern char *ConnectionInfo;
-extern int (*LbxInitialVector[3])(ClientPtr);
-
-#ifdef DEBUG
-int lbxDebug = 0;
-#endif
-
-
-void
-LbxExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- lbxCompressWorkProcCount = 0;
- proxyList = NULL;
- uid_seed = 0;
- if ((extEntry = AddExtension(LBXNAME, LbxNumberEvents, LbxNumberErrors,
- ProcLbxDispatch, SProcLbxDispatch,
- LbxResetProc, StandardMinorOpcode)))
- {
- LbxReqCode = (unsigned char)extEntry->base;
- LbxEventCode = extEntry->eventBase;
- BadLbxClientCode = extEntry->errorBase + BadLbxClient;
- LbxDixInit();
-
- LbxCmapInit ();
- DeclareExtensionSecurity(LBXNAME, TRUE);
- }
-}
-
-/*ARGSUSED*/
-static void
-LbxResetProc (ExtensionEntry *extEntry)
-{
- LbxResetTags();
- uid_seed = 0;
-}
-
-void
-LbxCloseClient (ClientPtr client)
-{
- xLbxCloseEvent closeEvent;
- ClientPtr master;
- LbxProxyPtr proxy;
- LbxClientPtr lbxClient = LbxClient(client);
- CARD32 id;
-
- if (!lbxClient)
- return;
- id = lbxClient->id;
- proxy = lbxClient->proxy;
-
- DBG (DBG_CLIENT, (stderr, "Close client %d\n", client->index));
- LbxFreeClient (client);
- if (!id)
- {
- isItTimeToYield = TRUE;
- CloseDownFileDescriptor (client);
- LbxShutdownProxy (proxy);
- }
- else
- {
- master = NULL;
- if (proxy->lbxClients[0])
- master = LbxProxyClient(proxy);
- if (master && !master->clientGone)
- {
- closeEvent.type = LbxEventCode;
- closeEvent.lbxType = LbxCloseEvent;
- closeEvent.client = id;
- closeEvent.sequenceNumber = master->sequence;
- closeEvent.pad1 = closeEvent.pad2 = closeEvent.pad3 =
- closeEvent.pad4 = closeEvent.pad5 = closeEvent.pad6 = 0;
- if (master->swapped) {
- int n;
-
- swaps(&closeEvent.sequenceNumber, n);
- swapl(&closeEvent.client, n);
- }
- WriteToClient(master, sizeof (closeEvent), (char *)&closeEvent);
- LbxForceOutput(proxy);
- }
- }
-}
-
-static int
-LbxReencodeEvent(ClientPtr client,
- LbxProxyPtr proxy,
- char *buf)
-{
- xEvent *ev = (xEvent *)buf;
- int n;
- lbxMotionCache *motionCache = &proxy->motionCache;
- int motionDelta = 0;
- Bool swapCache;
- xEvent tev, *sev;
-
- if (ev->u.u.type != MotionNotify) {
- if (proxy->dosquishing)
- return LbxSquishEvent(buf);
- return 0;
- }
-
- /*
- * Check if we can generate a motion delta event.
- *
- * The motion cache contains the last motion event the server sent.
- *
- * The following are always stored in the cache in the server's
- * byte order:
- * sequenceNumber, time, rootX, rootY, eventX, eventY
- * This is because when determining if we can do a delta, all
- * arithmetic must be done using the server's byte order.
- *
- * The following are stored in the byte order of the latest client
- * receiving a motion event (indicated by motionCache->swapped):
- * root, event, child, state
- * These fields do not need to be stored in the server's byte order
- * because we only use the '==' operator on them.
- */
-
- if (!proxy->motion_allowed_events) {
- DBG(DBG_CLIENT, (stderr, "throttling motion event for client %d\n", client->index));
- return sz_xEvent;
- }
- proxy->motion_allowed_events--;
-
- motionCache = &proxy->motionCache;
-
- if (!client->swapped)
- {
- swapCache = motionCache->swapped;
- sev = ev;
- }
- else
- {
- swapCache = !motionCache->swapped;
- sev = &tev;
- cpswaps (ev->u.keyButtonPointer.rootX,
- sev->u.keyButtonPointer.rootX);
- cpswaps (ev->u.keyButtonPointer.rootY,
- sev->u.keyButtonPointer.rootY);
- cpswaps (ev->u.keyButtonPointer.eventX,
- sev->u.keyButtonPointer.eventX);
- cpswaps (ev->u.keyButtonPointer.eventY,
- sev->u.keyButtonPointer.eventY);
- cpswaps (ev->u.u.sequenceNumber,
- sev->u.u.sequenceNumber);
- cpswapl (ev->u.keyButtonPointer.time,
- sev->u.keyButtonPointer.time);
- }
-
- if (swapCache)
- {
- swapl (&motionCache->root, n);
- swapl (&motionCache->event, n);
- swapl (&motionCache->child, n);
- swaps (&motionCache->state, n);
-
- motionCache->swapped = !motionCache->swapped;
- }
-
- motionDelta = 0;
-
- if (ev->u.u.detail == motionCache->detail &&
- ev->u.keyButtonPointer.root == motionCache->root &&
- ev->u.keyButtonPointer.event == motionCache->event &&
- ev->u.keyButtonPointer.child == motionCache->child &&
- ev->u.keyButtonPointer.state == motionCache->state &&
- ev->u.keyButtonPointer.sameScreen == motionCache->sameScreen) {
-
- int root_delta_x =
- sev->u.keyButtonPointer.rootX - motionCache->rootX;
- int root_delta_y =
- sev->u.keyButtonPointer.rootY - motionCache->rootY;
- int event_delta_x =
- sev->u.keyButtonPointer.eventX - motionCache->eventX;
- int event_delta_y =
- sev->u.keyButtonPointer.eventY - motionCache->eventY;
- unsigned long sequence_delta =
- sev->u.u.sequenceNumber - motionCache->sequenceNumber;
- unsigned long time_delta =
- sev->u.keyButtonPointer.time - motionCache->time;
-
- if (root_delta_x == event_delta_x &&
- event_delta_x >= -128 && event_delta_x < 128 &&
- root_delta_y == event_delta_y &&
- event_delta_y >= -128 && event_delta_y < 128) {
-
- if (sequence_delta == 0 && time_delta < 256) {
-
- lbxQuickMotionDeltaEvent *mev =
- (lbxQuickMotionDeltaEvent *)(buf + sz_xEvent -
- sz_lbxQuickMotionDeltaEvent);
-
- mev->type = LbxEventCode + LbxQuickMotionDeltaEvent;
- mev->deltaTime = time_delta;
- mev->deltaX = event_delta_x;
- mev->deltaY = event_delta_y;
-
- motionDelta = sz_xEvent - sz_lbxQuickMotionDeltaEvent;
-
- } else if (sequence_delta < 65536 && time_delta < 65536) {
-
- lbxMotionDeltaEvent *mev =
- (lbxMotionDeltaEvent *)(buf + sz_xEvent -
- sz_lbxMotionDeltaEvent);
-
- mev->type = LbxEventCode;
- mev->lbxType = LbxMotionDeltaEvent;
- mev->deltaTime = time_delta;
- mev->deltaSequence = sequence_delta;
- mev->deltaX = event_delta_x;
- mev->deltaY = event_delta_y;
-
- if (LbxProxyClient(proxy)->swapped)
- {
- swaps (&mev->deltaTime, n);
- swaps (&mev->deltaSequence, n);
- }
-
- motionDelta = sz_xEvent - sz_lbxMotionDeltaEvent;
- }
- }
- }
-
- motionCache->sequenceNumber = sev->u.u.sequenceNumber;
- motionCache->time = sev->u.keyButtonPointer.time;
- motionCache->rootX = sev->u.keyButtonPointer.rootX;
- motionCache->rootY = sev->u.keyButtonPointer.rootY;
- motionCache->eventX = sev->u.keyButtonPointer.eventX;
- motionCache->eventY = sev->u.keyButtonPointer.eventY;
-
- if (motionDelta)
- return motionDelta;
-
- ev->u.keyButtonPointer.pad1 = 0;
- motionCache->detail = ev->u.u.detail;
- motionCache->root = ev->u.keyButtonPointer.root;
- motionCache->event = ev->u.keyButtonPointer.event;
- motionCache->child = ev->u.keyButtonPointer.child;
- motionCache->state = ev->u.keyButtonPointer.state;
- motionCache->sameScreen = ev->u.keyButtonPointer.sameScreen;
- return 0;
-}
-
-static int
-LbxComposeDelta(LbxProxyPtr proxy,
- char *reply,
- int len,
- char *buf)
-{
- int diffs;
- int cindex;
- int n;
- xLbxDeltaReq *p = (xLbxDeltaReq *)buf;
-
- diffs = LBXDeltaMinDiffs(&proxy->outdeltas, (unsigned char *)reply, len,
- min(MAXBYTESDIFF, (len - sz_xLbxDeltaReq) >> 1),
- &cindex);
- if (diffs < 0) {
- LBXAddDeltaOut(&proxy->outdeltas, (unsigned char *)reply, len);
- return 0;
- }
- LBXEncodeDelta(&proxy->outdeltas, (unsigned char *)reply, diffs, cindex,
- (unsigned char *)(&buf[sz_xLbxDeltaReq]));
- LBXAddDeltaOut(&proxy->outdeltas, (unsigned char *)reply, len);
- p->reqType = LbxEventCode;
- p->lbxReqType = LbxDeltaEvent;
- p->diffs = diffs;
- p->cindex = cindex;
- len = (sz_xLbxDeltaReq + sz_xLbxDiffItem * diffs + 3) & ~3;
- p->length = len >> 2;
- if (LbxProxyClient(proxy)->swapped) {
- swaps(&p->length, n);
- }
- return len;
-}
-
-void
-LbxReencodeOutput(ClientPtr client,
- char *pbuf,
- int *pcount,
- char *cbuf,
- int *ccount)
-{
- LbxClientPtr lbxClient = LbxClient(client);
- LbxProxyPtr proxy = lbxClient->proxy;
- CARD32 len;
- int n;
- int count = *ccount;
- char *obuf = cbuf;
-
- if (client->clientState != ClientStateRunning) {
- if (DELTA_CACHEABLE(&proxy->outdeltas, count) &&
- (n = LbxComposeDelta(proxy, cbuf, count, proxy->oDeltaBuf))) {
- memcpy(obuf, proxy->oDeltaBuf, n);
- *ccount -= (count - n);
- }
- return;
- }
- if (lbxClient->bytes_remaining) {
- if (count < lbxClient->bytes_remaining) {
- lbxClient->bytes_remaining -= count;
- return;
- }
- if (DELTA_CACHEABLE(&proxy->outdeltas, lbxClient->bytes_in_reply)) {
- len = lbxClient->bytes_in_reply - lbxClient->bytes_remaining;
- pbuf += (*pcount - len);
- memcpy(proxy->replyBuf, pbuf, len);
- memcpy(proxy->replyBuf + len, cbuf, lbxClient->bytes_remaining);
- n = LbxComposeDelta(proxy, proxy->replyBuf,
- lbxClient->bytes_in_reply, proxy->oDeltaBuf);
- if (!n)
- obuf += lbxClient->bytes_remaining;
- else if (n <= len) {
- memcpy(pbuf, proxy->oDeltaBuf, n);
- *pcount -= (len - n);
- *ccount -= lbxClient->bytes_remaining;
- } else {
- memcpy(pbuf, proxy->oDeltaBuf, len);
- memcpy(obuf, proxy->oDeltaBuf + len, n - len);
- *ccount -= lbxClient->bytes_remaining - (n - len);
- obuf += n - len;
- }
- } else
- obuf += lbxClient->bytes_remaining;
- cbuf += lbxClient->bytes_remaining;
- count -= lbxClient->bytes_remaining;
- lbxClient->bytes_remaining = 0;
- }
- while (count) {
- lbxClient->bytes_in_reply = sz_xEvent;
- if (((xGenericReply *)cbuf)->type == X_Reply) {
- len = ((xGenericReply *)cbuf)->length;
- if (client->swapped) {
- swapl(&len, n);
- }
- lbxClient->bytes_in_reply += (len << 2);
- if (LbxProxyClient(proxy)->swapped != client->swapped) {
- swapl(&((xGenericReply *)cbuf)->length, n);
- }
- if (count < lbxClient->bytes_in_reply) {
- lbxClient->bytes_remaining = lbxClient->bytes_in_reply - count;
- if (obuf != cbuf)
- memmove(obuf, cbuf, count);
- return;
- }
- } else if (((xGenericReply *)cbuf)->type > X_Reply &&
- ((xGenericReply *)cbuf)->type < LASTEvent &&
- (n = LbxReencodeEvent(client, proxy, cbuf))) {
- cbuf += n;
- *ccount -= n;
- count -= n;
- if (n == sz_xEvent)
- continue;
- lbxClient->bytes_in_reply -= n;
- }
- if (DELTA_CACHEABLE(&proxy->outdeltas, lbxClient->bytes_in_reply) &&
- (n = LbxComposeDelta(proxy, cbuf, lbxClient->bytes_in_reply,
- proxy->oDeltaBuf))) {
- memcpy(obuf, proxy->oDeltaBuf, n);
- obuf += n;
- *ccount -= (lbxClient->bytes_in_reply - n);
- } else {
- if (obuf != cbuf)
- memmove(obuf, cbuf, lbxClient->bytes_in_reply);
- obuf += lbxClient->bytes_in_reply;
- }
- cbuf += lbxClient->bytes_in_reply;
- count -= lbxClient->bytes_in_reply;
- }
-}
-
-/*ARGSUSED*/
-static void
-LbxReplyCallback(CallbackListPtr *pcbl,
- pointer nulldata,
- pointer calldata)
-{
- ReplyInfoRec *pri = (ReplyInfoRec *)calldata;
- ClientPtr client = pri->client;
- LbxClientPtr lbxClient;
- REQUEST(xReq);
-
- if (!pri->startOfReply || stuff->reqType > 127)
- return;
- lbxClient = LbxClient(client);
- if (lbxClient)
- ZeroReplyPadBytes(pri->replyData, stuff->reqType);
-}
-
-/*
- * XXX If you think this is moronic, you're in good company,
- * but things definitely hang if we don't have this.
- */
-/* ARGSUSED */
-static Bool
-LbxCheckCompressInput (ClientPtr dummy1,
- pointer dummy2)
-{
- LbxProxyPtr proxy;
-
- if (!lbxCompressWorkProcCount)
- return TRUE;
-
- for (proxy = proxyList; proxy; proxy = proxy->next) {
- if (proxy->compHandle &&
- proxy->streamOpts.streamCompInputAvail(proxy->fd))
- AvailableClientInput (LbxProxyClient(proxy));
- }
- return FALSE;
-}
-
-static Bool
-LbxIsClientBlocked (LbxClientPtr lbxClient)
-{
- LbxProxyPtr proxy = lbxClient->proxy;
-
- return (lbxClient->ignored ||
- (GrabInProgress && lbxClient->client->index != GrabInProgress &&
- lbxClient != proxy->lbxClients[0]));
-}
-
-static void
-LbxSwitchRecv (LbxProxyPtr proxy,
- LbxClientPtr lbxClient)
-{
- ClientPtr client;
-
- proxy->curRecv = lbxClient;
- if (!lbxClient || lbxClient->client->clientGone)
- {
- DBG(DBG_CLIENT, (stderr, "switching to dispose input\n"));
- lbxClient = proxy->lbxClients[0];
- if (!lbxClient)
- return;
- }
- client = lbxClient->client;
- DBG (DBG_SWITCH, (stderr, "switching input to client %d\n", client->index));
-
- SwitchClientInput (client, FALSE);
- proxy->curDix = lbxClient;
-}
-
-/* ARGSUSED */
-static Bool
-LbxWaitForUnblocked (ClientPtr client,
- pointer closure)
-{
- LbxClientPtr lbxClient;
- LbxProxyPtr proxy;
-
- if (client->clientGone)
- return TRUE;
- lbxClient = LbxClient(client);
- if (!lbxClient)
- return TRUE;
- proxy = lbxClient->proxy;
- if (LbxIsClientBlocked (lbxClient) ||
- ((lbxClient != proxy->curDix) && proxy->curDix->reqs_pending &&
- !LbxIsClientBlocked(proxy->curDix)))
- return FALSE;
- lbxClient->input_blocked = FALSE;
- DBG (DBG_BLOCK, (stderr, "client %d no longer blocked, switching\n",
- client->index));
- SwitchClientInput (client, TRUE);
- proxy->curDix = lbxClient;
- return TRUE;
-}
-
-void
-LbxSetForBlock(LbxClientPtr lbxClient)
-{
- lbxClient->reqs_pending++;
- if (!lbxClient->input_blocked)
- {
- lbxClient->input_blocked = TRUE;
- QueueWorkProc(LbxWaitForUnblocked, lbxClient->client, NULL);
- }
-}
-
-/* ARGSUSED */
-static int
-LbxWaitForUngrab (ClientPtr client,
- pointer closure)
-{
- LbxClientPtr lbxClient = LbxClient(client);
- LbxProxyPtr proxy;
- xLbxListenToAllEvent ungrabEvent;
-
- if (client->clientGone || !lbxClient)
- return TRUE;
- if (GrabInProgress)
- return FALSE;
- proxy = lbxClient->proxy;
- proxy->grabClient = 0;
- ungrabEvent.type = LbxEventCode;
- ungrabEvent.lbxType = LbxListenToAll;
- ungrabEvent.pad1 = ungrabEvent.pad2 = ungrabEvent.pad3 =
- ungrabEvent.pad4 = ungrabEvent.pad5 = ungrabEvent.pad6 =
- ungrabEvent.pad7 = 0;
- WriteToClient (client,
- sizeof(xLbxListenToAllEvent), (char *)&ungrabEvent);
- LbxForceOutput(proxy);
- return TRUE;
-}
-
-static void
-LbxServerGrab(LbxProxyPtr proxy)
-{
- LbxClientPtr grabbingLbxClient;
- xLbxListenToOneEvent grabEvent;
-
- /*
- * If the current grabbing client has changed, then we need
- * to send a message to update the proxy.
- */
-
- grabEvent.type = LbxEventCode;
- grabEvent.lbxType = LbxListenToOne;
- if (!(grabbingLbxClient = lbxClients[GrabInProgress]) ||
- grabbingLbxClient->proxy != proxy)
- grabEvent.client = 0xffffffff; /* client other than a proxy client */
- else
- grabEvent.client = grabbingLbxClient->id;
- grabEvent.pad1 = grabEvent.pad2 = grabEvent.pad3 =
- grabEvent.pad4 = grabEvent.pad5 = grabEvent.pad6 = 0;
- if (LbxProxyClient(proxy)->swapped) {
- int n;
- swapl(&grabEvent.client, n);
- }
- WriteToClient(LbxProxyClient(proxy),
- sizeof(xLbxListenToOneEvent), (char *)&grabEvent);
- LbxForceOutput(proxy);
- if (!proxy->grabClient)
- QueueWorkProc(LbxWaitForUngrab, LbxProxyClient(proxy), NULL);
- proxy->grabClient = GrabInProgress;
-}
-
-#define MAJOROP(client) ((xReq *)client->requestBuffer)->reqType
-#define MINOROP(client) ((xReq *)client->requestBuffer)->data
-
-static Bool lbxCacheable[] = {
- FALSE, /* LbxQueryVersion 0 */
- FALSE, /* LbxStartProxy 1 */
- TRUE, /* LbxStopProxy 2 */
- FALSE, /* LbxSwitch 3 */
- FALSE, /* LbxNewClient 4 */
- TRUE, /* LbxCloseClient 5 */
- TRUE, /* LbxModifySequence 6 */
- FALSE, /* LbxAllowMotion 7 */
- TRUE, /* LbxIncrementPixel 8 */
- FALSE, /* LbxDelta 9 */
- TRUE, /* LbxGetModifierMapping 10 */
- FALSE, /* nothing 11 */
- TRUE, /* LbxInvalidateTag 12 */
- TRUE, /* LbxPolyPoint 13 */
- TRUE, /* LbxPolyLine 14 */
- TRUE, /* LbxPolySegment 15 */
- TRUE, /* LbxPolyRectangle 16 */
- TRUE, /* LbxPolyArc 17 */
- TRUE, /* LbxFillPoly 18 */
- TRUE, /* LbxPolyFillRectangle 19 */
- TRUE, /* LbxPolyFillArc 20 */
- TRUE, /* LbxGetKeyboardMapping 21 */
- TRUE, /* LbxQueryFont 22 */
- TRUE, /* LbxChangeProperty 23 */
- TRUE, /* LbxGetProperty 24 */
- TRUE, /* LbxTagData 25 */
- TRUE, /* LbxCopyArea 26 */
- TRUE, /* LbxCopyPlane 27 */
- TRUE, /* LbxPolyText8 28 */
- TRUE, /* LbxPolyText16 29 */
- TRUE, /* LbxImageText8 30 */
- TRUE, /* LbxImageText16 31 */
- FALSE, /* LbxQueryExtension 32 */
- TRUE, /* LbxPutImage 33 */
- TRUE, /* LbxGetImage 34 */
- FALSE, /* LbxBeginLargeRequest 35 */
- FALSE, /* LbxLargeRequestData 36 */
- FALSE, /* LbxEndLargeRequest 37 */
- FALSE, /* LbxInternAtoms 38 */
- TRUE, /* LbxGetWinAttrAndGeom 39 */
- TRUE, /* LbxGrabCmap 40 */
- TRUE, /* LbxReleaseCmap 41 */
- TRUE, /* LbxAllocColor 42 */
- TRUE, /* LbxSync 43 */
-};
-
-#define NUM(a) (sizeof (a) / sizeof (a[0]))
-
-static int
-LbxReadRequestFromClient (ClientPtr client)
-{
- int ret;
- LbxClientPtr lbxClient = LbxClient(client);
- LbxProxyPtr proxy = lbxClient->proxy;
- ClientPtr masterClient = LbxProxyClient(proxy);
- Bool isblocked;
- Bool cacheable;
-
- DBG (DBG_READ_REQ, (stderr, "Reading request from client %d\n", client->index));
-
- if (GrabInProgress && (proxy->grabClient != GrabInProgress))
- LbxServerGrab(proxy);
- isblocked = LbxIsClientBlocked(lbxClient);
-
- if (lbxClient->reqs_pending && !isblocked) {
- ret = StandardReadRequestFromClient(client);
- if (ret > 0 && (MAJOROP(client) == LbxReqCode) &&
- (MINOROP(client) == X_LbxEndLargeRequest))
- ret = PrepareLargeReqBuffer(client);
- if (!--lbxClient->reqs_pending && (lbxClient != proxy->curRecv))
- LbxSwitchRecv (proxy, proxy->curRecv);
- return ret;
- }
- while (1) {
- ret = StandardReadRequestFromClient(masterClient);
- if (ret <= 0)
- return ret;
- client->requestBuffer = masterClient->requestBuffer;
- client->req_len = masterClient->req_len;
- cacheable = client->clientState == ClientStateRunning;
- if (cacheable && (MAJOROP(client) == LbxReqCode)) {
- /* Check to see if this request is delta cached */
- if (MINOROP(client) < NUM(lbxCacheable))
- cacheable = lbxCacheable[MINOROP(client)];
- switch (MINOROP(client)) {
- case X_LbxSwitch:
- /* Switch is sent by proxy */
- if (masterClient->swapped)
- SProcLbxSwitch (client);
- else
- ProcLbxSwitch (client);
- return 0;
- case X_LbxDelta:
- ret = DecodeLbxDelta (client);
- DBG(DBG_DELTA,
- (stderr,"delta decompressed msg %d, len = %d\n",
- (unsigned)((unsigned char *)client->requestBuffer)[0],
- ret));
- break;
- case X_LbxEndLargeRequest:
- if (!isblocked)
- ret = PrepareLargeReqBuffer(client);
- break;
- }
- }
- if (cacheable && DELTA_CACHEABLE(&proxy->indeltas, ret)) {
- DBG(DBG_DELTA,
- (stderr, "caching msg %d, len = %d, index = %d\n",
- (unsigned)((unsigned char *)client->requestBuffer)[0],
- ret, proxy->indeltas.nextDelta));
- LBXAddDeltaIn(&proxy->indeltas, client->requestBuffer, ret);
- }
- if (client->swapped != masterClient->swapped) {
- char n;
- /* put length in client order */
- swaps(&((xReq *)client->requestBuffer)->length, n);
- }
- if (!isblocked)
- return ret;
- DBG (DBG_BLOCK, (stderr, "Stashing %d bytes for %d\n",
- ret, client->index));
- AppendFakeRequest (client, client->requestBuffer, ret);
- LbxSetForBlock(lbxClient);
- }
-}
-
-static LbxClientPtr
-LbxInitClient (LbxProxyPtr proxy,
- ClientPtr client,
- CARD32 id)
-{
- LbxClientPtr lbxClient;
- int i;
-
- lbxClient = (LbxClientPtr) xalloc (sizeof (LbxClientRec));
- if (!lbxClient)
- return NULL;
- lbxClient->id = id;
- lbxClient->client = client;
- lbxClient->proxy = proxy;
- lbxClient->ignored = FALSE;
- lbxClient->input_blocked = FALSE;
- lbxClient->reqs_pending = 0;
- lbxClient->bytes_in_reply = 0;
- lbxClient->bytes_remaining = 0;
- client->readRequest = LbxReadRequestFromClient;
- bzero (lbxClient->drawableCache, sizeof (lbxClient->drawableCache));
- bzero (lbxClient->gcontextCache, sizeof (lbxClient->gcontextCache));
- lbxClients[client->index] = lbxClient;
- for (i = 0; proxy->lbxClients[i]; i++)
- ;
- if (i > proxy->maxIndex)
- proxy->maxIndex = i;
- proxy->lbxClients[i] = lbxClient;
- proxy->numClients++;
- lbxClient->gfx_buffer = (pointer) NULL;
- lbxClient->gb_size = 0;
- return lbxClient;
-}
-
-static void
-LbxFreeClient (ClientPtr client)
-{
- LbxClientPtr lbxClient = LbxClient(client);
- LbxProxyPtr proxy = lbxClient->proxy;
- int i;
-
- if (lbxClient != proxy->lbxClients[0]) {
- if (lbxClient == proxy->curRecv)
- LbxSwitchRecv(proxy, NULL);
- else if (lbxClient == proxy->curDix)
- LbxSwitchRecv(proxy, proxy->curRecv);
- }
-
- --proxy->numClients;
- lbxClients[client->index] = NULL;
- for (i = 0; i <= proxy->maxIndex; i++) {
- if (proxy->lbxClients[i] == lbxClient) {
- proxy->lbxClients[i] = NULL;
- break;
- }
- }
- while (proxy->maxIndex >= 0 && !proxy->lbxClients[proxy->maxIndex])
- --proxy->maxIndex;
- xfree(lbxClient->gfx_buffer);
- client->readRequest = StandardReadRequestFromClient;
- xfree (lbxClient);
-}
-
-static void
-LbxFreeProxy (LbxProxyPtr proxy)
-{
- LbxProxyPtr *p;
-
- LBXFreeDeltaCache(&proxy->indeltas);
- LBXFreeDeltaCache(&proxy->outdeltas);
- LbxFreeOsBuffers(proxy);
- if (proxy->iDeltaBuf)
- xfree(proxy->iDeltaBuf);
- if (proxy->replyBuf)
- xfree(proxy->replyBuf);
- if (proxy->oDeltaBuf)
- xfree(proxy->oDeltaBuf);
- if (proxy->compHandle)
- proxy->streamOpts.streamCompFreeHandle(proxy->compHandle);
- if (proxy->bitmapCompMethods)
- xfree (proxy->bitmapCompMethods);
- if (proxy->pixmapCompMethods)
- xfree (proxy->pixmapCompMethods);
- if (proxy->pixmapCompDepths)
- {
- int i;
- for (i = 0; i < proxy->numPixmapCompMethods; i++)
- xfree (proxy->pixmapCompDepths[i]);
- xfree (proxy->pixmapCompDepths);
- }
-
- for (p = &proxyList; *p; p = &(*p)->next) {
- if (*p == proxy) {
- *p = proxy->next;
- break;
- }
- }
- if (!proxyList)
- DeleteCallback(&ReplyCallback, LbxReplyCallback, NULL);
-
- xfree (proxy);
-}
-
-LbxProxyPtr
-LbxPidToProxy(int pid)
-{
- LbxProxyPtr proxy;
-
- for (proxy = proxyList; proxy; proxy = proxy->next) {
- if (proxy->pid == pid)
- return proxy;
- }
- return NULL;
-}
-
-static void
-LbxShutdownProxy (LbxProxyPtr proxy)
-{
- int i;
- ClientPtr client;
-
- if (proxy->compHandle)
- --lbxCompressWorkProcCount;
- while (proxy->grabbedCmaps)
- LbxReleaseCmap(proxy->grabbedCmaps, FALSE);
- for (i = 0; i <= proxy->maxIndex; i++)
- {
- if (proxy->lbxClients[i])
- {
- client = proxy->lbxClients[i]->client;
- if (!client->clientGone)
- CloseDownClient (client);
- }
- }
- LbxFlushTags(proxy);
- LbxFreeProxy(proxy);
-}
-
-
-int
-ProcLbxQueryVersion (ClientPtr client)
-{
- /* REQUEST(xLbxQueryVersionReq); */
- xLbxQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xLbxQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = LBX_MAJOR_VERSION;
- rep.minorVersion = LBX_MINOR_VERSION;
- rep.pad0 = rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xLbxQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-NextProxyID (void)
-{
- LbxProxyPtr proxy;
- int id;
-
- for (id = 1; id < MAX_NUM_PROXIES; id++) {
- for (proxy = proxyList; proxy && proxy->pid != id; proxy = proxy->next)
- ;
- if (!proxy)
- return id;
- }
- return -1;
-}
-
-int
-ProcLbxStartProxy (ClientPtr client)
-{
- REQUEST(xLbxStartProxyReq);
- LbxProxyPtr proxy;
- LbxClientPtr lbxClient;
- int reqlen;
- int replylen;
- xLbxStartReply *replybuf;
- LbxNegOptsRec negopt;
- register int n;
- pointer compHandle = NULL;
-
- REQUEST_AT_LEAST_SIZE(xLbxStartProxyReq);
- if (lbxClients[client->index])
- return BadLbxClientCode;
- proxy = (LbxProxyPtr) xalloc (sizeof (LbxProxyRec));
- if (!proxy)
- return BadAlloc;
- bzero(proxy, sizeof (LbxProxyRec));
- proxy->pid = NextProxyID();
- if (proxy->pid < 0) { /* too many proxies */
- xfree(proxy);
- return BadAlloc;
- }
- proxy->uid = ++uid_seed;
- if (!proxyList)
- AddCallback(&ReplyCallback, LbxReplyCallback, NULL);
-
- if(!proxyList)
- proxyList = proxy;
- else{
- proxy->next = proxyList;
- proxyList = proxy;
- }
-
- /*
- * Don't know exactly how big the reply will be, but it won't be
- * bigger than the request
- */
- reqlen = client->req_len << 2;
- replybuf = (xLbxStartReply *) xalloc(max(reqlen, sz_xLbxStartReply));
- if (!replybuf) {
- LbxFreeProxy(proxy);
- return BadAlloc;
- }
-
- LbxOptionInit(&negopt);
-
- replylen = LbxOptionParse(&negopt,
- (unsigned char *)&stuff[1],
- reqlen - sz_xLbxStartProxyReq,
- (unsigned char *)&replybuf->optDataStart);
- if (replylen < 0) {
- /*
- * Didn't understand option format, so we'll just end up
- * using the defaults. Set nopts so that the proxy will
- * be informed that we rejected the options because of
- * decoding problems.
- */
- LbxOptionInit(&negopt);
- negopt.nopts = 0xff;
- replylen = 0;
- }
-
- if (LBXInitDeltaCache(&proxy->indeltas, negopt.proxyDeltaN,
- negopt.proxyDeltaMaxLen) < 0
- ||
- LBXInitDeltaCache(&proxy->outdeltas, negopt.serverDeltaN,
- negopt.serverDeltaMaxLen) < 0) {
- LbxFreeProxy(proxy);
- xfree(replybuf);
- return BadAlloc;
- }
-
- n = 0;
- if (negopt.proxyDeltaN)
- n = negopt.proxyDeltaMaxLen;
- if (negopt.serverDeltaN && negopt.serverDeltaMaxLen > n)
- n = negopt.serverDeltaMaxLen;
- if (n &&
- (!(proxy->iDeltaBuf = (char *)xalloc (n)) ||
- !(proxy->replyBuf = (char *)xalloc (n)) ||
- !(proxy->oDeltaBuf = (char *)xalloc (n)))) {
- LbxFreeProxy(proxy);
- xfree(replybuf);
- return BadAlloc;
- }
-
- MakeClientGrabImpervious(client); /* proxy needs to be grab-proof */
- proxy->fd = ClientConnectionNumber(client);
- if (negopt.streamOpts.streamCompInit) {
- compHandle =
- (*negopt.streamOpts.streamCompInit)(proxy->fd, negopt.streamOpts.streamCompArg);
- if (!compHandle) {
- LbxFreeProxy(proxy);
- xfree(replybuf);
- return BadAlloc;
- }
- }
- proxy->ofirst = NULL;
- proxy->olast = NULL;
- if (!LbxInitClient (proxy, client, 0))
- {
- LbxFreeProxy(proxy);
- xfree(replybuf);
- return BadAlloc;
- }
- proxy->dosquishing = negopt.squish;
- proxy->numBitmapCompMethods = negopt.numBitmapCompMethods;
- proxy->bitmapCompMethods = negopt.bitmapCompMethods;
- proxy->numPixmapCompMethods = negopt.numPixmapCompMethods;
- proxy->pixmapCompMethods = negopt.pixmapCompMethods;
- proxy->pixmapCompDepths = negopt.pixmapCompDepths;
-
- proxy->streamOpts = negopt.streamOpts;
- proxy->useTags = negopt.useTags;
-
- proxy->grabbedCmaps = NULL;
-
- /* send reply */
- replybuf->type = X_Reply;
- replybuf->nOpts = negopt.nopts;
- replybuf->sequenceNumber = client->sequence;
-
- replylen += sz_xLbxStartReplyHdr;
- if (replylen < sz_xLbxStartReply)
- replylen = sz_xLbxStartReply;
- replybuf->length = (replylen - sz_xLbxStartReply + 3) >> 2;
- if (client->swapped) {
- swaps(&replybuf->sequenceNumber, n);
- swapl(&replybuf->length, n);
- }
- lbxClient = LbxClient(client);
- WriteToClient(client, replylen, (char *)replybuf);
-
- LbxProxyConnection(client, proxy);
- lbxClient = proxy->lbxClients[0];
- proxy->curDix = lbxClient;
- proxy->curRecv = lbxClient;
- proxy->compHandle = compHandle;
-
- if (proxy->compHandle && !lbxCompressWorkProcCount++)
- QueueWorkProc(LbxCheckCompressInput, NULL, NULL);
-
- xfree(replybuf);
- return Success;
-}
-
-int
-ProcLbxStopProxy(ClientPtr client)
-{
- /* REQUEST(xLbxStopProxyReq); */
- LbxProxyPtr proxy;
- LbxClientPtr lbxClient = LbxClient(client);
-
- REQUEST_SIZE_MATCH(xLbxStopProxyReq);
-
- if (!lbxClient)
- return BadLbxClientCode;
- if (lbxClient->id)
- return BadLbxClientCode;
-
- proxy = lbxClient->proxy;
- LbxFreeClient (client);
- LbxShutdownProxy (proxy);
- return Success;
-}
-
-int
-ProcLbxSwitch(ClientPtr client)
-{
- REQUEST(xLbxSwitchReq);
- LbxProxyPtr proxy = LbxMaybeProxy(client);
- LbxClientPtr lbxClient;
- int i;
-
- REQUEST_SIZE_MATCH(xLbxSwitchReq);
- if (!proxy)
- return BadLbxClientCode;
- for (i = 0; i <= proxy->maxIndex; i++) {
- lbxClient = proxy->lbxClients[i];
- if (lbxClient && lbxClient->id == stuff->client) {
- LbxSwitchRecv (proxy, lbxClient);
- return Success;
- }
- }
- LbxSwitchRecv (proxy, NULL);
- return BadLbxClientCode;
-}
-
-int
-ProcLbxBeginLargeRequest(ClientPtr client)
-{
- REQUEST(xLbxBeginLargeRequestReq);
-
- client->sequence--;
- REQUEST_SIZE_MATCH(xLbxBeginLargeRequestReq);
- if (!AllocateLargeReqBuffer(client, stuff->largeReqLength << 2))
- return BadAlloc;
- return Success;
-}
-
-
-int
-ProcLbxLargeRequestData(ClientPtr client)
-{
- REQUEST(xLbxLargeRequestDataReq);
-
- client->sequence--;
- REQUEST_AT_LEAST_SIZE(xLbxLargeRequestDataReq);
- if (!AddToLargeReqBuffer(client, (char *) (stuff + 1),
- (client->req_len - 1) << 2))
- return BadAlloc;
- return Success;
-}
-
-
-int
-ProcLbxEndLargeRequest(ClientPtr client)
-{
- /* REQUEST(xReq); */
-
- client->sequence--;
- REQUEST_SIZE_MATCH(xReq);
- return BadAlloc;
-}
-
-
-int
-ProcLbxInternAtoms(ClientPtr client)
-{
- REQUEST(xLbxInternAtomsReq);
- LbxClientPtr lbxClient = LbxClient(client);
- xLbxInternAtomsReply *replyRet;
- char *ptr = (char *) stuff + sz_xLbxInternAtomsReq;
- Atom *atomsRet;
- int replyLen, i;
- char lenbuf[2];
- CARD16 len;
- char n;
-
- REQUEST_AT_LEAST_SIZE(xLbxInternAtomsReq);
-
- if (!lbxClient)
- return BadLbxClientCode;
- if (lbxClient->id)
- return BadLbxClientCode;
-
- replyLen = sz_xLbxInternAtomsReplyHdr + stuff->num * sizeof (Atom);
- if (replyLen < sz_xLbxInternAtomsReply)
- replyLen = sz_xLbxInternAtomsReply;
-
- if (!(replyRet = (xLbxInternAtomsReply *) xalloc (replyLen)))
- return BadAlloc;
-
- atomsRet = (Atom *) ((char *) replyRet + sz_xLbxInternAtomsReplyHdr);
-
- for (i = 0; i < stuff->num; i++)
- {
- lenbuf[0] = ptr[0];
- lenbuf[1] = ptr[1];
- len = *((CARD16 *) lenbuf);
- ptr += 2;
-
- if ((atomsRet[i] = MakeAtom (ptr, len, TRUE)) == BAD_RESOURCE)
- {
- xfree (replyRet);
- return BadAlloc;
- }
-
- ptr += len;
- }
-
- if (client->swapped)
- for (i = 0; i < stuff->num; i++)
- swapl (&atomsRet[i], n);
-
- replyRet->type = X_Reply;
- replyRet->sequenceNumber = client->sequence;
- replyRet->length = (replyLen - sz_xLbxInternAtomsReply + 3) >> 2;
-
- if (client->swapped) {
- swaps(&replyRet->sequenceNumber, n);
- swapl(&replyRet->length, n);
- }
-
- WriteToClient (client, replyLen, (char *) replyRet);
-
- xfree (replyRet);
-
- return Success;
-}
-
-
-int
-ProcLbxGetWinAttrAndGeom(ClientPtr client)
-{
- REQUEST(xLbxGetWinAttrAndGeomReq);
- xGetWindowAttributesReply wa;
- xGetGeometryReply wg;
- xLbxGetWinAttrAndGeomReply reply;
- WindowPtr pWin;
- int status;
-
- REQUEST_SIZE_MATCH(xLbxGetWinAttrAndGeomReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client,
- SecurityReadAccess);
- if (!pWin)
- return(BadWindow);
- GetWindowAttributes(pWin, client, &wa);
-
- if ((status = GetGeometry(client, &wg)) != Success)
- return status;
-
- reply.type = X_Reply;
- reply.length = (sz_xLbxGetWinAttrAndGeomReply - 32) >> 2;
- reply.sequenceNumber = client->sequence;
-
- reply.backingStore = wa.backingStore;
- reply.visualID = wa.visualID;
-#if defined(__cplusplus) || defined(c_plusplus)
- reply.c_class = wa.c_class;
-#else
- reply.class = wa.class;
-#endif
- reply.bitGravity = wa.bitGravity;
- reply.winGravity = wa.winGravity;
- reply.backingBitPlanes = wa.backingBitPlanes;
- reply.backingPixel = wa.backingPixel;
- reply.saveUnder = wa.saveUnder;
- reply.mapInstalled = wa.mapInstalled;
- reply.mapState = wa.mapState;
- reply.override = wa.override;
- reply.colormap = wa.colormap;
- reply.allEventMasks = wa.allEventMasks;
- reply.yourEventMask = wa.yourEventMask;
- reply.doNotPropagateMask = wa.doNotPropagateMask;
- reply.pad1 = 0;
- reply.root = wg.root;
- reply.x = wg.x;
- reply.y = wg.y;
- reply.width = wg.width;
- reply.height = wg.height;
- reply.borderWidth = wg.borderWidth;
- reply.depth = wg.depth;
- reply.pad2 = 0;
-
- if (client->swapped)
- {
- register char n;
-
- swaps(&reply.sequenceNumber, n);
- swapl(&reply.length, n);
- swapl(&reply.visualID, n);
- swaps(&reply.class, n);
- swapl(&reply.backingBitPlanes, n);
- swapl(&reply.backingPixel, n);
- swapl(&reply.colormap, n);
- swapl(&reply.allEventMasks, n);
- swapl(&reply.yourEventMask, n);
- swaps(&reply.doNotPropagateMask, n);
- swapl(&reply.root, n);
- swaps(&reply.x, n);
- swaps(&reply.y, n);
- swaps(&reply.width, n);
- swaps(&reply.height, n);
- swaps(&reply.borderWidth, n);
- }
-
- WriteToClient(client, sizeof(xLbxGetWinAttrAndGeomReply), (char *)&reply);
- return(client->noClientException);
-}
-
-int
-ProcLbxNewClient(ClientPtr client)
-{
- REQUEST(xLbxNewClientReq);
- ClientPtr newClient;
- LbxProxyPtr proxy = LbxMaybeProxy(client);
- CARD32 id;
- int len, i;
- char *setupbuf;
- LbxClientPtr lbxClient;
-
- REQUEST_AT_LEAST_SIZE(xLbxNewClientReq);
-
- /* save info before our request disappears */
- id = stuff->client;
- if (!proxy || !id)
- return BadLbxClientCode;
- if (proxy->numClients == MAX_LBX_CLIENTS)
- return BadAlloc;
- for (i = 1; i <= proxy->maxIndex; i++) {
- if (proxy->lbxClients[i] && proxy->lbxClients[i]->id == id)
- return BadLbxClientCode;
- }
- len = (client->req_len << 2) - sizeof(xLbxNewClientReq);
- setupbuf = (char *)xalloc (len);
- if (!setupbuf)
- return BadAlloc;
- memcpy (setupbuf, (char *)&stuff[1], len);
-
- newClient = AllocLbxClientConnection (client, proxy);
- if (!newClient)
- return BadAlloc;
- newClient->requestVector = LbxInitialVector;
- lbxClient = LbxInitClient (proxy, newClient, id);
- if (!lbxClient)
- {
- CloseDownClient (newClient);
- return BadAlloc;
- }
-
- AppendFakeRequest (newClient, setupbuf, len);
- xfree (setupbuf);
- LbxSetForBlock(lbxClient);
-
- DBG (DBG_CLIENT, (stderr, "lbxNewClient X %d\n", newClient->index));
- return Success;
-}
-
-int
-ProcLbxEstablishConnection(ClientPtr client)
-{
- char *reason = NULL;
- char *auth_proto, *auth_string;
- register xConnClientPrefix *prefix;
- REQUEST(xReq);
-
- prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
- auth_proto = (char *)prefix + sz_xConnClientPrefix;
- auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3);
- if ((prefix->majorVersion != X_PROTOCOL) ||
- (prefix->minorVersion != X_PROTOCOL_REVISION))
- reason = "Protocol version mismatch";
- else
- reason = ClientAuthorized(client,
- prefix->nbytesAuthProto,
- auth_proto,
- prefix->nbytesAuthString,
- auth_string);
-
- if (client->clientState == ClientStateCheckingSecurity ||
- client->clientState == ClientStateAuthenticating)
- return (client->noClientException = -1); /* XXX some day */
- return(LbxSendConnSetup(client, reason));
-}
-
-int
-ProcLbxCloseClient (ClientPtr client)
-{
- REQUEST(xLbxCloseClientReq);
- LbxClientPtr lbxClient = LbxClient(client);
-
- REQUEST_SIZE_MATCH(xLbxCloseClientReq);
- if (!lbxClient || lbxClient->id != stuff->client)
- return BadLbxClientCode;
-
- /* this will cause the client to be closed down back in Dispatch() */
- return(client->noClientException = CloseLbxClient);
-}
-
-int
-ProcLbxModifySequence (ClientPtr client)
-{
- REQUEST(xLbxModifySequenceReq);
-
- REQUEST_SIZE_MATCH(xLbxModifySequenceReq);
- client->sequence += (stuff->adjust - 1); /* Dispatch() adds 1 */
- return Success;
-}
-
-int
-ProcLbxAllowMotion (ClientPtr client)
-{
- REQUEST(xLbxAllowMotionReq);
-
- client->sequence--;
- REQUEST_SIZE_MATCH(xLbxAllowMotionReq);
- LbxAllowMotion(client, stuff->num);
- return Success;
-}
-
-
-static int
-DecodeLbxDelta (ClientPtr client)
-{
- REQUEST(xLbxDeltaReq);
- LbxClientPtr lbxClient = LbxClient(client);
- LbxProxyPtr proxy = lbxClient->proxy;
- int len;
- unsigned char *buf;
-
- /* Note that LBXDecodeDelta decodes and adds current msg to the cache */
- len = LBXDecodeDelta(&proxy->indeltas,
- (xLbxDiffItem *)(((char *)stuff) + sz_xLbxDeltaReq),
- stuff->diffs, stuff->cindex, &buf);
- /*
- * Some requests, such as FillPoly, result in the protocol input
- * buffer being modified. So we need to copy the request
- * into a temporary buffer where a write would be harmless.
- * Maybe some day do this copying on a case by case basis,
- * since not all requests are guilty of this.
- */
- memcpy(proxy->iDeltaBuf, buf, len);
-
- client->requestBuffer = proxy->iDeltaBuf;
- client->req_len = len >> 2;
- return len;
-}
-
-int
-ProcLbxGetModifierMapping(ClientPtr client)
-{
- /* REQUEST(xLbxGetModifierMappingReq); */
-
- REQUEST_SIZE_MATCH(xLbxGetModifierMappingReq);
- return LbxGetModifierMapping(client);
-}
-
-int
-ProcLbxGetKeyboardMapping(ClientPtr client)
-{
- /* REQUEST(xLbxGetKeyboardMappingReq); */
-
- REQUEST_SIZE_MATCH(xLbxGetKeyboardMappingReq);
- return LbxGetKeyboardMapping(client);
-}
-
-int
-ProcLbxQueryFont(ClientPtr client)
-{
- /* REQUEST(xLbxQueryFontReq); */
-
- REQUEST_SIZE_MATCH(xLbxQueryFontReq);
- return LbxQueryFont(client);
-}
-
-int
-ProcLbxChangeProperty(ClientPtr client)
-{
- /* REQUEST(xLbxChangePropertyReq); */
-
- REQUEST_SIZE_MATCH(xLbxChangePropertyReq);
- return LbxChangeProperty(client);
-}
-
-int
-ProcLbxGetProperty(ClientPtr client)
-{
- /* REQUEST(xLbxGetPropertyReq); */
-
- REQUEST_SIZE_MATCH(xLbxGetPropertyReq);
- return LbxGetProperty(client);
-}
-
-int
-ProcLbxTagData(ClientPtr client)
-{
- REQUEST(xLbxTagDataReq);
-
- client->sequence--; /* not a counted request */
- REQUEST_AT_LEAST_SIZE(xLbxTagDataReq);
-
- return LbxTagData(client, stuff->tag, stuff->real_length,
- (pointer)&stuff[1]); /* better not give any errors */
-}
-
-int
-ProcLbxInvalidateTag(ClientPtr client)
-{
- REQUEST(xLbxInvalidateTagReq);
-
- client->sequence--;
- REQUEST_SIZE_MATCH(xLbxInvalidateTagReq);
- return LbxInvalidateTag(client, stuff->tag);
-}
-
-int
-ProcLbxPolyPoint(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyPoint, LbxDecodePoints);
-}
-
-int
-ProcLbxPolyLine(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyLine, LbxDecodePoints);
-}
-
-int
-ProcLbxPolySegment(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolySegment, LbxDecodeSegment);
-}
-
-int
-ProcLbxPolyRectangle(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyRectangle, LbxDecodeRectangle);
-}
-
-int
-ProcLbxPolyArc(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyArc, LbxDecodeArc);
-}
-
-int
-ProcLbxFillPoly(ClientPtr client)
-{
- return LbxDecodeFillPoly(client);
-}
-
-int
-ProcLbxPolyFillRectangle(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyFillRectangle, LbxDecodeRectangle);
-}
-
-int
-ProcLbxPolyFillArc(ClientPtr client)
-{
- return LbxDecodePoly(client, X_PolyFillArc, LbxDecodeArc);
-}
-
-int
-ProcLbxCopyArea(ClientPtr client)
-{
- return LbxDecodeCopyArea(client);
-}
-
-int
-ProcLbxCopyPlane(ClientPtr client)
-{
- return LbxDecodeCopyPlane(client);
-}
-
-
-int
-ProcLbxPolyText(ClientPtr client)
-{
- return LbxDecodePolyText(client);
-}
-
-int
-ProcLbxImageText(ClientPtr client)
-{
- return LbxDecodeImageText(client);
-}
-
-int
-ProcLbxQueryExtension(ClientPtr client)
-{
- REQUEST(xLbxQueryExtensionReq);
- char *ename;
-
- REQUEST_AT_LEAST_SIZE(xLbxQueryExtensionReq);
- ename = (char *) &stuff[1];
- return LbxQueryExtension(client, ename, stuff->nbytes);
-}
-
-int
-ProcLbxPutImage(ClientPtr client)
-{
- return LbxDecodePutImage(client);
-}
-
-int
-ProcLbxGetImage(ClientPtr client)
-{
- return LbxDecodeGetImage(client);
-}
-
-
-int
-ProcLbxSync(ClientPtr client)
-{
- xLbxSyncReply reply;
-
- client->sequence--; /* not a counted request */
-
-#ifdef COLOR_DEBUG
- fprintf (stderr, "Got LBX sync, seq = 0x%x\n", client->sequence);
-#endif
-
- reply.type = X_Reply;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.pad0 = reply.pad1 = reply.pad2 = reply.pad3 = reply.pad4 =
- reply.pad5 = reply.pad6 = 0;
-
- if (client->swapped)
- {
- register char n;
- swaps (&reply.sequenceNumber, n);
- }
-
- WriteToClient (client, sz_xLbxSyncReply, (char *)&reply);
-
- return (client->noClientException);
-}
-
-
-int
-ProcLbxDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_LbxQueryVersion:
- return ProcLbxQueryVersion(client);
- case X_LbxStartProxy:
- return ProcLbxStartProxy(client);
- case X_LbxStopProxy:
- return ProcLbxStopProxy(client);
- case X_LbxNewClient:
- return ProcLbxNewClient(client);
- case X_LbxCloseClient:
- return ProcLbxCloseClient(client);
- case X_LbxModifySequence:
- return ProcLbxModifySequence(client);
- case X_LbxAllowMotion:
- return ProcLbxAllowMotion(client);
- case X_LbxIncrementPixel:
- return ProcLbxIncrementPixel(client);
- case X_LbxGrabCmap:
- return ProcLbxGrabCmap(client);
- case X_LbxReleaseCmap:
- return ProcLbxReleaseCmap(client);
- case X_LbxAllocColor:
- return ProcLbxAllocColor(client);
- case X_LbxGetModifierMapping:
- return ProcLbxGetModifierMapping(client);
- case X_LbxGetKeyboardMapping:
- return ProcLbxGetKeyboardMapping(client);
- case X_LbxInvalidateTag:
- return ProcLbxInvalidateTag(client);
- case X_LbxPolyPoint:
- return ProcLbxPolyPoint (client);
- case X_LbxPolyLine:
- return ProcLbxPolyLine (client);
- case X_LbxPolySegment:
- return ProcLbxPolySegment (client);
- case X_LbxPolyRectangle:
- return ProcLbxPolyRectangle (client);
- case X_LbxPolyArc:
- return ProcLbxPolyArc (client);
- case X_LbxFillPoly:
- return ProcLbxFillPoly (client);
- case X_LbxPolyFillRectangle:
- return ProcLbxPolyFillRectangle (client);
- case X_LbxPolyFillArc:
- return ProcLbxPolyFillArc (client);
- case X_LbxQueryFont:
- return ProcLbxQueryFont (client);
- case X_LbxChangeProperty:
- return ProcLbxChangeProperty (client);
- case X_LbxGetProperty:
- return ProcLbxGetProperty (client);
- case X_LbxTagData:
- return ProcLbxTagData (client);
- case X_LbxCopyArea:
- return ProcLbxCopyArea (client);
- case X_LbxCopyPlane:
- return ProcLbxCopyPlane (client);
- case X_LbxPolyText8:
- case X_LbxPolyText16:
- return ProcLbxPolyText (client);
- case X_LbxImageText8:
- case X_LbxImageText16:
- return ProcLbxImageText (client);
- case X_LbxQueryExtension:
- return ProcLbxQueryExtension (client);
- case X_LbxPutImage:
- return ProcLbxPutImage (client);
- case X_LbxGetImage:
- return ProcLbxGetImage (client);
- case X_LbxInternAtoms:
- return ProcLbxInternAtoms(client);
- case X_LbxGetWinAttrAndGeom:
- return ProcLbxGetWinAttrAndGeom(client);
- case X_LbxSync:
- return ProcLbxSync(client);
- case X_LbxBeginLargeRequest:
- return ProcLbxBeginLargeRequest(client);
- case X_LbxLargeRequestData:
- return ProcLbxLargeRequestData(client);
- case X_LbxEndLargeRequest:
- return ProcLbxLargeRequestData(client);
- default:
- return BadRequest;
- }
-}
diff --git a/lbx/lbxopts.c b/lbx/lbxopts.c
deleted file mode 100644
index 461f0d778..000000000
--- a/lbx/lbxopts.c
+++ /dev/null
@@ -1,802 +0,0 @@
-/* $Xorg: lbxopts.c,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-/*
- * Copyright 1994 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxopts.c,v 1.6 2001/10/28 03:34:12 tsi Exp $ */
-
-#ifdef OPTDEBUG
-#include <stdio.h>
-#endif
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxserve.h"
-#include "lbxstr.h"
-#include "lbximage.h"
-#include "lbxopts.h"
-#include "lbxsrvopts.h"
-#ifndef NO_ZLIB
-#include "lbxzlib.h"
-#endif /* NO_ZLIB */
-
-static int LbxProxyDeltaOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int LbxServerDeltaOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int LbxDeltaOpt ( unsigned char *popt, int optlen,
- unsigned char *preply, short *pn, short *pmaxlen );
-static int LbxStreamCompOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int ZlibParse ( LbxNegOptsPtr pno, unsigned char *popt, int optlen,
- unsigned char *preply );
-static int LbxMessageCompOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int LbxUseTagsOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int LbxBitmapCompOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int LbxPixmapCompOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-static int MergeDepths ( int *depths, LbxPixmapCompMethod *method );
-static int LbxCmapAllOpt ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-
-/*
- * List of LBX options we recognize and are willing to negotiate
- */
-static struct _LbxOptionParser {
- CARD8 optcode;
- int (*parser)(LbxNegOptsPtr, unsigned char *,
- int, unsigned char *);
-} LbxOptions[] = {
- { LBX_OPT_DELTA_PROXY, LbxProxyDeltaOpt },
- { LBX_OPT_DELTA_SERVER, LbxServerDeltaOpt },
- { LBX_OPT_STREAM_COMP, LbxStreamCompOpt },
- { LBX_OPT_BITMAP_COMP, LbxBitmapCompOpt },
- { LBX_OPT_PIXMAP_COMP, LbxPixmapCompOpt },
- { LBX_OPT_MSG_COMP, LbxMessageCompOpt },
- { LBX_OPT_USE_TAGS, LbxUseTagsOpt },
- { LBX_OPT_CMAP_ALL, LbxCmapAllOpt }
-};
-
-#define LBX_N_OPTS (sizeof(LbxOptions) / sizeof(struct _LbxOptionParser))
-
-/*
- * Set option defaults
- */
-void
-LbxOptionInit(LbxNegOptsPtr pno)
-{
- bzero(pno, sizeof(LbxNegOptsRec));
- pno->proxyDeltaN = pno->serverDeltaN = LBX_OPT_DELTA_NCACHE_DFLT;
- pno->proxyDeltaMaxLen = pno->serverDeltaMaxLen = LBX_OPT_DELTA_MSGLEN_DFLT;
- pno->squish = TRUE;
- pno->numBitmapCompMethods = 0;
- pno->bitmapCompMethods = NULL;
- pno->numPixmapCompMethods = 0;
- pno->pixmapCompMethods = NULL;
- pno->pixmapCompDepths = NULL;
- pno->useTags = TRUE;
-}
-
-int
-LbxOptionParse(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
- int i;
- int nopts = *popt++;
- unsigned char *pout = preply;
-
- for (i = 0; i < nopts; i++) {
- int j;
- int len;
- int hdrlen;
- int replylen;
-
- LBX_OPT_DECODE_LEN(popt + 1, len, hdrlen);
- if (len < ++hdrlen || len > optlen) {
-#ifdef OPTDEBUG
- fprintf(stderr, "bad option length, len = %d, hdrlen = %d, optlen = %d\n", len, hdrlen, optlen);
-#endif
- return -1;
- }
-
- for (j = 0; j < LBX_N_OPTS; j++) {
- if (popt[0] == LbxOptions[j].optcode) {
- replylen = (*LbxOptions[j].parser)(pno,
- popt + hdrlen,
- len - hdrlen,
- pout + LBX_OPT_SMALLHDR_LEN);
- if (replylen < 0)
- return -1;
- else if (replylen > 0) {
- /*
- * None of the current options require big headers,
- * so this works for now.
- */
- *pout++ = i;
- *pout++ = LBX_OPT_SMALLHDR_LEN + replylen;
- pout += replylen;
- pno->nopts++;
- }
- break;
- }
- }
-
- optlen -= len;
- popt += len;
- }
-
- return (pout - preply);
-}
-
-static int
-LbxProxyDeltaOpt(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
- return LbxDeltaOpt(popt, optlen, preply,
- &pno->proxyDeltaN, &pno->proxyDeltaMaxLen);
-}
-
-static int
-LbxServerDeltaOpt(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
- return LbxDeltaOpt(popt, optlen, preply,
- &pno->serverDeltaN, &pno->serverDeltaMaxLen);
-}
-
-static int
-LbxDeltaOpt(unsigned char *popt,
- int optlen,
- unsigned char *preply,
- short *pn,
- short *pmaxlen)
-{
- short n;
- short maxlen;
-
- /*
- * If there's more data than we expect, we just ignore it.
- */
- if (optlen < LBX_OPT_DELTA_REQLEN) {
-#ifdef OPTDEBUG
- fprintf(stderr, "bad delta option length = %d\n", optlen);
-#endif
- return -1;
- }
-
- /*
- * Accept whatever value the proxy prefers, so skip the
- * min/max offerings. Note that the max message len value is
- * encoded as the number of 4-byte values.
- */
- popt += 2;
- n = *popt++;
- popt += 2;
- maxlen = *popt++;
- if ((maxlen <<= 2) == 0)
- n = 0;
- else if (maxlen < 32) {
-#ifdef OPTDEBUG
- fprintf(stderr, "bad delta max msg length %d\n", maxlen);
-#endif
- return -1;
- }
-
- /*
- * Put the response in the reply buffer
- */
- *preply++ = n;
- *preply++ = maxlen >> 2;
-
- *pn = n;
- *pmaxlen = maxlen;
-
- return LBX_OPT_DELTA_REPLYLEN;
-}
-
-
-static struct _LbxStreamCompParser {
- int typelen;
- char *type;
- int (*parser)(LbxNegOptsPtr, unsigned char *,
- int, unsigned char *);
-} LbxStreamComp[] = {
-#ifndef NO_ZLIB
- { ZLIB_STRCOMP_OPT_LEN, ZLIB_STRCOMP_OPT, ZlibParse },
-#endif /* NO_ZLIB */
-};
-
-#define LBX_N_STRCOMP \
- (sizeof(LbxStreamComp) / sizeof(struct _LbxStreamCompParser))
-
-static int
-LbxStreamCompOpt(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
- int i;
- int typelen;
- int nopts = *popt++;
-
- for (i = 0; i < nopts; i++) {
- int j;
- int len;
- int lensize;
- int replylen;
-
- typelen = popt[0];
- for (j = 0; j < LBX_N_STRCOMP; j++) {
- if (typelen == LbxStreamComp[j].typelen &&
- !strncmp((char *) popt + 1, LbxStreamComp[j].type, typelen))
- break;
- }
-
- popt += 1 + typelen;
- optlen -= 1 + typelen;
- LBX_OPT_DECODE_LEN(popt, len, lensize);
-
- if (j < LBX_N_STRCOMP) {
- if (len > optlen)
- return -1;
- replylen = (*LbxStreamComp[j].parser)(pno,
- popt + lensize,
- len - lensize,
- preply + 1);
- if (replylen == -1)
- return -1;
- else if (replylen >= 0) {
- *preply = i;
- return replylen + 1;
- }
- }
-
- optlen -= len;
- popt += len;
- }
-
- return 0;
-}
-
-
-static int
-ZlibParse(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
- int level; /* compression level */
-
- if (*popt++ != 1) /* length should be 1 */
- return (-1);
-
- level = *popt;
- if (level < 1 || level > 9)
- return (-1);
-
- pno->streamOpts.streamCompInit =
- (LbxStreamCompHandle (*)(int, pointer))ZlibInit;
- pno->streamOpts.streamCompArg = (pointer)(long)level;
- pno->streamOpts.streamCompStuffInput = ZlibStuffInput;
- pno->streamOpts.streamCompInputAvail = ZlibInputAvail;
- pno->streamOpts.streamCompFlush = ZlibFlush;
- pno->streamOpts.streamCompRead = ZlibRead;
- pno->streamOpts.streamCompWriteV = ZlibWriteV;
- pno->streamOpts.streamCompOn = ZlibCompressOn;
- pno->streamOpts.streamCompOff = ZlibCompressOff;
- pno->streamOpts.streamCompFreeHandle =
- (void (*)(LbxStreamCompHandle))ZlibFree;
-
- return (0);
-}
-
-static int
-LbxMessageCompOpt(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
-
- if (optlen == 0) {
-#ifdef OPTDEBUG
- fprintf(stderr, "bad message-comp option length specified %d\n", optlen);
-#endif
- return -1;
- }
-
- pno->squish = *preply = *popt;
- return 1;
-}
-
-
-static int
-LbxUseTagsOpt(LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-{
-
- if (optlen == 0) {
-#ifdef OPTDEBUG
- fprintf(stderr, "bad use-tags option length specified %d\n", optlen);
-#endif
- return -1;
- }
-
- pno->useTags = *preply = *popt;
- return 1;
-}
-
-
-/*
- * Option negotiation for image compression
- */
-
-LbxBitmapCompMethod
-LbxBitmapCompMethods [] = {
- {
- "XC-FaxG42D", /* compression method name */
- 0, /* inited */
- 2, /* method opcode */
- NULL, /* init function */
- LbxImageEncodeFaxG42D, /* encode function */
- LbxImageDecodeFaxG42D /* decode function */
- }
-};
-
-#define NUM_BITMAP_METHODS \
- (sizeof (LbxBitmapCompMethods) / sizeof (LbxBitmapCompMethod))
-
-
-#if 1
-/*
- * Currently, we don't support any pixmap compression algorithms
- * because regular stream compression does much better than PackBits.
- * If we want to plug in a better pixmap image compression algorithm,
- * it would go here.
- */
-
-#define NUM_PIXMAP_METHODS 0
-LbxPixmapCompMethod LbxPixmapCompMethods [1]; /* dummy */
-
-#else
-
-LbxPixmapCompMethod
-LbxPixmapCompMethods [] = {
- {
- "XC-PackBits", /* compression method name */
- 1 << ZPixmap, /* formats supported */
- 1, {8}, /* depths supported */
- 0, /* inited */
- 1, /* method opcode */
- NULL, /* init function */
- LbxImageEncodePackBits, /* encode function */
- LbxImageDecodePackBits /* decode function */
- }
-};
-
-#define NUM_PIXMAP_METHODS \
- (sizeof (LbxPixmapCompMethods) / sizeof (LbxPixmapCompMethod))
-#endif
-
-
-static int
-LbxImageCompOpt (Bool pixmap,
- LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-
-{
- unsigned char *preplyStart = preply;
- int numMethods = *popt++;
- unsigned char *myIndices, *hisIndices;
- unsigned int *retFormats = NULL;
- int **retDepths = NULL;
- int replyCount = 0;
- int status, i, j;
-
- if (numMethods == 0)
- {
- if (pixmap)
- pno->numPixmapCompMethods = 0;
- else
- pno->numBitmapCompMethods = 0;
-
- *preply++ = 0;
- return (1);
- }
-
- myIndices = (unsigned char *) xalloc (numMethods);
- hisIndices = (unsigned char *) xalloc (numMethods);
-
- if (!myIndices || !hisIndices)
- {
- if (myIndices)
- xfree (myIndices);
- if (hisIndices)
- xfree (hisIndices);
- return -1;
- }
-
- if (pixmap)
- {
- retFormats = (unsigned *) xalloc (numMethods);
- retDepths = (int **) xalloc (numMethods * sizeof (int *));
-
- if (!retFormats || !retDepths)
- {
- if (retFormats)
- xfree (retFormats);
- if (retDepths)
- xfree (retDepths);
- xfree (myIndices);
- xfree (hisIndices);
- return -1;
- }
- }
-
- /*
- * For each method in the list sent by the proxy, see if the server
- * supports this method. If YES, update the following lists:
- *
- * myIndices[] is a list of indices into the server's
- * LbxBit[Pix]mapCompMethods table.
- *
- * hisIndices[] is a list of indices into the list of
- * method names sent by the proxy.
- *
- * retFormats[] indicates for each pixmap compression method,
- * the pixmap formats supported.
- *
- * retDepths[] indicates for each pixmap compression method,
- * the pixmap depths supported.
- */
-
- for (i = 0; i < numMethods; i++)
- {
- unsigned int formatMask = 0, newFormatMask = 0;
- int depthCount, *depths = NULL, len;
- int freeDepths;
- char *methodName;
-
- freeDepths = 0;
- len = *popt++;
- methodName = (char *) popt;
- popt += len;
-
- if (pixmap)
- {
- formatMask = *popt++;
- depthCount = *popt++;
- depths = (int *) xalloc ((depthCount + 1) * sizeof (int));
- freeDepths = 1;
- depths[0] = depthCount;
- for (j = 1; j <= depthCount; j++)
- depths[j] = *popt++;
- }
-
- for (j = 0;
- j < (pixmap ? NUM_PIXMAP_METHODS : NUM_BITMAP_METHODS); j++)
- {
-
- status = strncmp (methodName,
- (pixmap ? LbxPixmapCompMethods[j].methodName :
- LbxBitmapCompMethods[j].methodName),
- len);
-
- if (status == 0 && pixmap)
- {
- newFormatMask =
- formatMask & LbxPixmapCompMethods[j].formatMask;
-
- depthCount = MergeDepths (depths, &LbxPixmapCompMethods[j]);
-
- if (newFormatMask == 0 || depthCount == 0)
- status = 1;
- }
-
- if (status == 0)
- {
- myIndices[replyCount] = j;
- hisIndices[replyCount] = i;
-
- if (pixmap)
- {
- retFormats[replyCount] = newFormatMask;
- retDepths[replyCount] = depths;
- freeDepths = 0;
- }
-
- replyCount++;
- break;
- }
- }
-
- if (freeDepths)
- xfree (depths);
- }
-
- *preply++ = replyCount;
-
- /*
- * Sort the lists by LBX server preference (increasing myIndices[] vals)
- */
-
- for (i = 0; i <= replyCount - 2; i++)
- for (j = replyCount - 1; j >= i; j--)
- if (myIndices[j - 1] > myIndices[j])
- {
- char temp1 = myIndices[j - 1];
- char temp2 = hisIndices[j - 1];
-
- myIndices[j - 1] = myIndices[j];
- myIndices[j] = temp1;
-
- hisIndices[j - 1] = hisIndices[j];
- hisIndices[j] = temp2;
-
- if (pixmap)
- {
- unsigned temp3 = retFormats[j - 1];
- int *temp4 = retDepths[j - 1];
-
- retFormats[j - 1] = retFormats[j];
- retFormats[j] = temp3;
-
- retDepths[j - 1] = retDepths[j];
- retDepths[j] = temp4;
- }
- }
-
- /*
- * For each method supported, return to the proxy an index into
- * the list sent by the proxy, the opcode to be used for the method,
- * the pixmap formats supported, and the list of depths supported.
- */
-
- for (i = 0; i < replyCount; i++)
- {
- *preply++ = hisIndices[i];
-
- if (pixmap)
- {
- int left;
- *preply++ = LbxPixmapCompMethods[myIndices[i]].methodOpCode;
- *preply++ = retFormats[i];
- *preply++ = left = retDepths[i][0];
- j = 1;
- while (left > 0)
- {
- *preply++ = retDepths[i][j];
- left--;
- }
- }
- else
- {
- *preply++ = LbxBitmapCompMethods[myIndices[i]].methodOpCode;
- }
- }
-
- if (pixmap)
- {
- pno->numPixmapCompMethods = replyCount;
- pno->pixmapCompMethods = myIndices;
- pno->pixmapCompDepths = retDepths;
- }
- else
- {
- pno->numBitmapCompMethods = replyCount;
- pno->bitmapCompMethods = myIndices;
- }
-
- if (hisIndices)
- xfree (hisIndices);
-
- if (pixmap)
- {
- if (retFormats)
- xfree (retFormats);
- }
-
- return (preply - preplyStart);
-}
-
-
-
-static int
-LbxBitmapCompOpt (LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-
-{
- return (LbxImageCompOpt (0 /* bitmap */, pno, popt, optlen, preply));
-}
-
-
-static int
-LbxPixmapCompOpt (LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-
-{
- return (LbxImageCompOpt (1 /* Pixmap */, pno, popt, optlen, preply));
-}
-
-
-LbxBitmapCompMethod *
-LbxSrvrLookupBitmapCompMethod (LbxProxyPtr proxy,
- int methodOpCode)
-
-{
- int i;
-
- for (i = 0; i < proxy->numBitmapCompMethods; i++)
- {
- LbxBitmapCompMethod *method;
-
- method = &LbxBitmapCompMethods[proxy->bitmapCompMethods[i]];
-
- if (method->methodOpCode == methodOpCode)
- return (method);
- }
-
- return (NULL);
-}
-
-
-LbxPixmapCompMethod *
-LbxSrvrLookupPixmapCompMethod (LbxProxyPtr proxy,
- int methodOpCode)
-
-{
- int i;
-
- for (i = 0; i < proxy->numPixmapCompMethods; i++)
- {
- LbxPixmapCompMethod *method;
-
- method = &LbxPixmapCompMethods[proxy->pixmapCompMethods[i]];
-
- if (method->methodOpCode == methodOpCode)
- return (method);
- }
-
- return (NULL);
-}
-
-
-LbxBitmapCompMethod *
-LbxSrvrFindPreferredBitmapCompMethod (LbxProxyPtr proxy)
-
-{
- if (proxy->numBitmapCompMethods == 0)
- return NULL;
- else
- return (&LbxBitmapCompMethods[proxy->bitmapCompMethods[0]]);
-}
-
-
-
-LbxPixmapCompMethod *
-LbxSrvrFindPreferredPixmapCompMethod (LbxProxyPtr proxy,
- int format,
- int depth)
-
-{
- if (proxy->numPixmapCompMethods == 0)
- return NULL;
- else
- {
- LbxPixmapCompMethod *method;
- int i, j;
-
- for (i = 0; i < proxy->numPixmapCompMethods; i++)
- {
- method = &LbxPixmapCompMethods[proxy->pixmapCompMethods[i]];
-
- if ((method->formatMask & (1 << format)))
- {
- int n = proxy->pixmapCompDepths[i][0];
- j = 1;
- while (n > 0)
- {
- if (depth == proxy->pixmapCompDepths[i][j])
- return method;
- else
- n--;
- }
- }
- }
-
- return NULL;
- }
-}
-
-
-static int
-MergeDepths (int *depths,
- LbxPixmapCompMethod *method)
-
-{
- int i, j, count;
- int temp[LBX_MAX_DEPTHS + 1];
-
- temp[0] = count = 0;
-
- for (i = 1; i <= depths[0]; i++)
- {
- for (j = 0; j < method->depthCount; j++)
- if (method->depths[j] == depths[i])
- {
- temp[0]++;
- temp[++count] = depths[i];
- break;
- }
- }
-
- memcpy (depths, temp, (count + 1) * sizeof (int));
-
- return (count);
-}
-
-
-#define LbxCmapAllMethod "XC-CMAP"
-
-static int
-LbxCmapAllOpt (LbxNegOptsPtr pno,
- unsigned char *popt,
- int optlen,
- unsigned char *preply)
-
-{
- int numMethods = *popt++;
- int i;
-
- for (i = 0; i < numMethods; i++)
- {
- int len;
- char *methodName;
-
- len = *popt++;
- methodName = (char *) popt;
- popt += len;
- if (!strncmp(methodName, LbxCmapAllMethod, len))
- break;
- }
- if (i >= numMethods)
- i = 0; /* assume first one is proxy's favorite */
- *preply = i;
- return 1;
-}
diff --git a/lbx/lbxprop.c b/lbx/lbxprop.c
deleted file mode 100644
index e9a6d8a8e..000000000
--- a/lbx/lbxprop.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/* $Xorg: lbxprop.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1986, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.5 2001/12/14 20:00:00 dawes Exp $ */
-
-/* various bits of DIX-level mangling */
-
-#include <sys/types.h>
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "servermd.h"
-#include "propertyst.h"
-#include "colormapst.h"
-#include "windowstr.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#include "lbxtags.h"
-#include "Xfuncproto.h"
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "extensions/security.h"
-#endif
-#include "swaprep.h"
-
-void
-LbxStallPropRequest(ClientPtr client,
- PropertyPtr pProp)
-{
- xReq *req = (xReq *) client->requestBuffer;
- register char n;
-
- LbxQueryTagData(client, pProp->owner_pid,
- pProp->tag_id, LbxTagTypeProperty);
-
- /*
- * Before we reset the request, we must make sure
- * it is in the client's byte order.
- */
-
- if (client->swapped) {
- if (req->reqType == X_ChangeProperty) {
- xChangePropertyReq *stuff = (xChangePropertyReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- switch ( stuff->format ) {
- case 16:
- SwapRestS(stuff);
- break;
- case 32:
- SwapRestL(stuff);
- break;
- }
- } else if (req->reqType == X_GetProperty) {
- xGetPropertyReq *stuff = (xGetPropertyReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- } else if (req->data == X_LbxChangeProperty) {
- xLbxChangePropertyReq *stuff = (xLbxChangePropertyReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- } else if (req->data == X_LbxGetProperty) {
- xLbxGetPropertyReq *stuff = (xLbxGetPropertyReq *) req;
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- }
- }
- ResetCurrentRequest(client);
- client->sequence--;
- IgnoreClient(client);
-}
-
-int
-LbxChangeWindowProperty(ClientPtr client,
- WindowPtr pWin,
- Atom property,
- Atom type,
- int format,
- int mode,
- unsigned long len,
- Bool have_data,
- pointer value,
- Bool sendevent,
- XID *tag)
-{
- PropertyPtr pProp;
- xEvent event;
- int sizeInBytes;
- int totalSize;
- pointer data;
-
- sizeInBytes = format >> 3;
- totalSize = len * sizeInBytes;
-
- /* first see if property already exists */
-
- pProp = wUserProps(pWin);
- while (pProp) {
- if (pProp->propertyName == property)
- break;
- pProp = pProp->next;
- }
- if (!pProp) { /* just add to list */
- if (!pWin->optional && !MakeWindowOptional(pWin))
- return (BadAlloc);
- pProp = (PropertyPtr) xalloc(sizeof(PropertyRec));
- if (!pProp)
- return (BadAlloc);
- data = (pointer) xalloc(totalSize);
- if (!data && len) {
- xfree(pProp);
- return (BadAlloc);
- }
- pProp->propertyName = property;
- pProp->type = type;
- pProp->format = format;
- pProp->data = data;
- if (have_data) {
- if (len)
- memmove((char *) data, (char *) value, totalSize);
- pProp->tag_id = 0;
- pProp->owner_pid = 0;
- } else {
- if (!TagSaveTag(LbxTagTypeProperty, totalSize,
- (pointer)pProp, &pProp->tag_id)) {
- xfree(pProp);
- xfree(pProp->data);
- return BadAlloc;
- }
- pProp->owner_pid = LbxProxyID(client);
- TagMarkProxy(pProp->tag_id, pProp->owner_pid);
- }
- pProp->size = len;
- pProp->next = pWin->optional->userProps;
- pWin->optional->userProps = pProp;
- } else {
- /*
- * To append or prepend to a property the request format and type must
- * match those of the already defined property. The existing format
- * and type are irrelevant when using the mode "PropModeReplace" since
- * they will be written over.
- */
-
- if ((format != pProp->format) && (mode != PropModeReplace))
- return (BadMatch);
- if ((pProp->type != type) && (mode != PropModeReplace))
- return (BadMatch);
-
- /*
- * if its a modify instead of replace, make sure we have the current
- * value
- */
- if ((mode != PropModeReplace) && pProp->tag_id && pProp->owner_pid) {
- LbxStallPropRequest(client, pProp);
- return (client->noClientException);
- }
- /* make sure any old tag is flushed first */
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
- if (mode == PropModeReplace) {
- if (totalSize != pProp->size * (pProp->format >> 3)) {
- data = (pointer) xrealloc(pProp->data, totalSize);
- if (!data && len)
- return (BadAlloc);
- pProp->data = data;
- }
- if (have_data) {
- if (len)
- memmove((char *) pProp->data, (char *) value, totalSize);
- } else {
- if (!TagSaveTag(LbxTagTypeProperty, totalSize,
- (pointer)pProp, &pProp->tag_id)) {
- xfree(pProp);
- xfree(pProp->data);
- return BadAlloc;
- }
- pProp->owner_pid = LbxProxyID(client);
- TagMarkProxy(pProp->tag_id, pProp->owner_pid);
- }
- pProp->size = len;
- pProp->type = type;
- pProp->format = format;
- } else if (len == 0) {
- /* do nothing */
- } else if (mode == PropModeAppend) {
- data = (pointer) xrealloc(pProp->data,
- sizeInBytes * (len + pProp->size));
- if (!data)
- return (BadAlloc);
- pProp->data = data;
- memmove(&((char *) data)[pProp->size * sizeInBytes],
- (char *) value,
- totalSize);
- pProp->size += len;
- } else if (mode == PropModePrepend) {
- data = (pointer) xalloc(sizeInBytes * (len + pProp->size));
- if (!data)
- return (BadAlloc);
- memmove(&((char *) data)[totalSize], (char *) pProp->data,
- (int) (pProp->size * sizeInBytes));
- memmove((char *) data, (char *) value, totalSize);
- xfree(pProp->data);
- pProp->data = data;
- pProp->size += len;
- }
- }
- if (sendevent) {
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyNewValue;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr) NULL);
- }
- if (pProp->tag_id)
- *tag = pProp->tag_id;
- return (Success);
-}
-
-int
-LbxChangeProperty(ClientPtr client)
-{
- WindowPtr pWin;
- char format,
- mode;
- unsigned long len;
- int err;
- int n;
- XID newtag;
- xLbxChangePropertyReply rep;
- REQUEST(xLbxChangePropertyReq);
-
- REQUEST_SIZE_MATCH(xLbxChangePropertyReq);
- UpdateCurrentTime();
- format = stuff->format;
- mode = stuff->mode;
- if ((mode != PropModeReplace) && (mode != PropModeAppend) &&
- (mode != PropModePrepend)) {
- client->errorValue = mode;
- return BadValue;
- }
- if ((format != 8) && (format != 16) && (format != 32)) {
- client->errorValue = format;
- return BadValue;
- }
- len = stuff->nUnits;
- if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2))
- return BadLength;
-
- pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin)
- return (BadWindow);
- if (!ValidAtom(stuff->property)) {
- client->errorValue = stuff->property;
- return (BadAtom);
- }
- if (!ValidAtom(stuff->type)) {
- client->errorValue = stuff->type;
- return (BadAtom);
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.pad = rep.pad0 = rep.pad1 = rep.pad2 = rep.pad3 = rep.pad4 = 0;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- }
-
-#ifdef XCSECURITY
- switch (SecurityCheckPropertyAccess(client, pWin, stuff->property,
- SecurityWriteAccess))
- {
- case SecurityErrorOperation:
- client->errorValue = stuff->property;
- return BadAtom;
- case SecurityIgnoreOperation:
- rep.tag = 0;
- WriteToClient(client, sizeof(xLbxChangePropertyReply), (char *)&rep);
- return client->noClientException;
- }
-#endif
-
- err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type,
- (int) format, (int) mode, len, FALSE, (pointer) &stuff[1],
- TRUE, &newtag);
- if (err)
- return err;
-
- rep.tag = newtag;
-
- if (client->swapped) {
- swapl(&rep.tag, n);
- }
- WriteToClient(client, sizeof(xLbxChangePropertyReply), (char *)&rep);
-
- return client->noClientException;
-}
-
-static void
-LbxWriteGetpropReply(ClientPtr client,
- xLbxGetPropertyReply *rep)
-{
- int n;
-
- if (client->swapped) {
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->propertyType, n);
- swapl(&rep->bytesAfter, n);
- swapl(&rep->nItems, n);
- swapl(&rep->tag, n);
- }
- WriteToClient(client, sizeof(xLbxGetPropertyReply), (char *)rep);
-}
-
-int
-LbxGetProperty(ClientPtr client)
-{
- PropertyPtr pProp,
- prevProp;
- unsigned long n,
- len,
- ind;
- WindowPtr pWin;
- xLbxGetPropertyReply reply;
- Bool send_data = FALSE;
-
- REQUEST(xLbxGetPropertyReq);
-
- REQUEST_SIZE_MATCH(xLbxGetPropertyReq);
-
- reply.pad1 = 0;
- reply.pad2 = 0;
-
- if (stuff->delete)
- UpdateCurrentTime();
- pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
- if (!pWin)
- return (BadWindow);
-
- if (!ValidAtom(stuff->property)) {
- client->errorValue = stuff->property;
- return (BadAtom);
- }
- if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) {
- client->errorValue = stuff->delete;
- return (BadValue);
- }
- if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type))
- {
- client->errorValue = stuff->type;
- return(BadAtom);
- }
- pProp = wUserProps(pWin);
- prevProp = (PropertyPtr) NULL;
- while (pProp) {
- if (pProp->propertyName == stuff->property)
- break;
- prevProp = pProp;
- pProp = pProp->next;
- }
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- if (!pProp) {
- reply.nItems = 0;
- reply.length = 0;
- reply.bytesAfter = 0;
- reply.propertyType = None;
- reply.format = 0;
- reply.tag = 0;
- LbxWriteGetpropReply(client, &reply);
- return client->noClientException;
- }
- /*
- * If the request type and actual type don't match. Return the
- * property information, but not the data.
- */
- if ((stuff->type != pProp->type) &&
- (stuff->type != AnyPropertyType)) {
- reply.bytesAfter = pProp->size;
- reply.format = pProp->format;
- reply.length = 0;
- reply.nItems = 0;
- reply.propertyType = pProp->type;
- reply.tag = 0;
- LbxWriteGetpropReply(client, &reply);
- return client->noClientException;
- }
- /*
- * Return type, format, value to client
- */
- n = (pProp->format >> 3) * pProp->size; /* size (bytes) of prop */
- ind = stuff->longOffset << 2;
-
- /*
- * If longOffset is invalid such that it causes "len" to be
- * negative, it's a value error.
- */
-
- if (n < ind) {
- client->errorValue = stuff->longOffset;
- return BadValue;
- }
-
- /* make sure we have the current value */
- if (pProp->tag_id && pProp->owner_pid) {
- LbxStallPropRequest(client, pProp);
- return client->noClientException;
- }
-
- len = min(n - ind, stuff->longLength << 2);
-
- reply.bytesAfter = n - (ind + len);
- reply.format = pProp->format;
- reply.propertyType = pProp->type;
-
- if (!pProp->tag_id) {
- if (n && (!stuff->delete || reply.bytesAfter)) {
- TagSaveTag(LbxTagTypeProperty, n, (pointer)pProp, &pProp->tag_id);
- pProp->owner_pid = 0;
- }
- send_data = TRUE;
- } else
- send_data = !TagProxyMarked(pProp->tag_id, LbxProxyID(client));
- if (pProp->tag_id && send_data)
- TagMarkProxy(pProp->tag_id, LbxProxyID(client));
- reply.tag = pProp->tag_id;
-
- if (!send_data)
- len = 0;
- else if (reply.tag) {
- len = n;
- ind = 0;
- }
- reply.nItems = len / (pProp->format >> 3);
- reply.length = (len + 3) >> 2;
-
- if (stuff->delete && (reply.bytesAfter == 0)) {
- xEvent event;
-
- event.u.u.type = PropertyNotify;
- event.u.property.window = pWin->drawable.id;
- event.u.property.state = PropertyDelete;
- event.u.property.atom = pProp->propertyName;
- event.u.property.time = currentTime.milliseconds;
- DeliverEvents(pWin, &event, 1, (WindowPtr) NULL);
- }
- LbxWriteGetpropReply(client, &reply);
- if (len) {
- switch (reply.format) {
- case 32:
- client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
- break;
- case 16:
- client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write;
- break;
- default:
- client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
- break;
- }
- WriteSwappedDataToClient(client, len,
- (char *) pProp->data + ind);
- }
- if (stuff->delete && (reply.bytesAfter == 0)) {
- if (pProp->tag_id)
- TagDeleteTag(pProp->tag_id);
- if (prevProp == (PropertyPtr) NULL) {
- if (!(pWin->optional->userProps = pProp->next))
- CheckWindowOptionalNeed(pWin);
- } else
- prevProp->next = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
- }
- return client->noClientException;
-}
diff --git a/lbx/lbxserve.h b/lbx/lbxserve.h
deleted file mode 100644
index 40a2ff0ae..000000000
--- a/lbx/lbxserve.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $Xorg: lbxserve.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1992 Network Computing Devices
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of NCD. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. NCD. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxserve.h,v 1.5 2001/12/14 20:00:00 dawes Exp $ */
-
-#ifndef _LBXSERVE_H_
-
-#include "colormap.h"
-#include "property.h"
-
-#define _LBXSERVE_H_
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxdeltastr.h"
-#include "lbxopts.h"
-
-#define MAX_LBX_CLIENTS MAXCLIENTS
-#define MAX_NUM_PROXIES (MAXCLIENTS >> 1)
-
-typedef struct _LbxClient *LbxClientPtr;
-typedef struct _LbxProxy *LbxProxyPtr;
-
-typedef struct _LbxClient {
- CARD32 id;
- ClientPtr client;
- LbxProxyPtr proxy;
- Bool ignored;
- Bool input_blocked;
- int reqs_pending;
- long bytes_in_reply;
- long bytes_remaining;
- Drawable drawableCache[GFX_CACHE_SIZE];
- GContext gcontextCache[GFX_CACHE_SIZE];
- pointer gfx_buffer; /* tmp buffer for unpacking gfx requests */
- unsigned long gb_size;
-} LbxClientRec;
-
-typedef struct _connectionOutput *OSBufPtr;
-
-typedef struct _LbxProxy {
- LbxProxyPtr next;
- /* this array is indexed by lbx proxy index */
- LbxClientPtr lbxClients[MAX_LBX_CLIENTS];
- LbxClientPtr curRecv,
- curDix;
- int fd;
- int pid; /* proxy ID */
- int uid;
- int numClients;
- int maxIndex;
- Bool aborted;
- int grabClient;
- pointer compHandle;
- Bool dosquishing;
- Bool useTags;
- LBXDeltasRec indeltas;
- LBXDeltasRec outdeltas;
- char *iDeltaBuf;
- char *replyBuf;
- char *oDeltaBuf;
- OSBufPtr ofirst;
- OSBufPtr olast;
- CARD32 cur_send_id;
-
- LbxStreamOpts streamOpts;
-
- int numBitmapCompMethods;
- unsigned char *bitmapCompMethods; /* array of indices */
- int numPixmapCompMethods;
- unsigned char *pixmapCompMethods; /* array of indices */
- int **pixmapCompDepths; /* depths supported from each method */
-
- struct _ColormapRec *grabbedCmaps; /* chained via lbx private */
- int motion_allowed_events;
- lbxMotionCache motionCache;
-} LbxProxyRec;
-
-/* This array is indexed by server client index, not lbx proxy index */
-
-extern LbxClientPtr lbxClients[MAXCLIENTS];
-
-#define LbxClient(client) (lbxClients[(client)->index])
-#define LbxProxy(client) (LbxClient(client)->proxy)
-#define LbxMaybeProxy(client) (LbxClient(client) ? LbxProxy(client) : 0)
-#define LbxProxyID(client) (LbxProxy(client)->pid)
-#define LbxProxyClient(proxy) ((proxy)->lbxClients[0]->client)
-
-extern int LbxEventCode;
-
-
-/* os/connection.c */
-extern ClientPtr AllocLbxClientConnection ( ClientPtr client,
- LbxProxyPtr proxy );
-extern void LbxProxyConnection ( ClientPtr client, LbxProxyPtr proxy );
-
-/* os/libxio.c */
-extern int UncompressedWriteToClient ( ClientPtr who, int count, char *buf );
-extern void LbxForceOutput ( LbxProxyPtr proxy );
-extern void SwitchClientInput ( ClientPtr client, Bool pending );
-extern int PrepareLargeReqBuffer ( ClientPtr client );
-extern Bool AppendFakeRequest ( ClientPtr client, char *data, int count );
-extern void LbxFreeOsBuffers ( LbxProxyPtr proxy );
-extern Bool AllocateLargeReqBuffer ( ClientPtr client, int size );
-extern Bool AddToLargeReqBuffer ( ClientPtr client, char *data, int size );
-extern void LbxPrimeInput ( ClientPtr client, LbxProxyPtr proxy );
-
-/* lbxcmap.c */
-extern int LbxCmapInit ( void );
-extern Bool LbxCheckColorRequest ( ClientPtr client, ColormapPtr pmap,
- xReq *req );
-extern int LbxCheckCmapGrabbed ( ColormapPtr pmap );
-extern void LbxDisableSmartGrab ( ColormapPtr pmap );
-extern void LbxBeginFreeCellsEvent ( ColormapPtr pmap );
-extern void LbxAddFreeCellToEvent ( ColormapPtr pmap, Pixel pixel );
-extern void LbxEndFreeCellsEvent ( ColormapPtr pmap );
-extern void LbxSortPixelList ( Pixel *pixels, int count );
-extern int ProcLbxGrabCmap ( ClientPtr client );
-extern void LbxReleaseCmap ( ColormapPtr pmap, Bool smart );
-extern int ProcLbxReleaseCmap ( ClientPtr client );
-extern int ProcLbxAllocColor ( ClientPtr client );
-extern int ProcLbxIncrementPixel ( ClientPtr client );
-
-/* lbxdix.h */
-extern void LbxDixInit ( void );
-extern void LbxResetTags ( void );
-extern int LbxSendConnSetup ( ClientPtr client, char *reason );
-extern int LbxGetModifierMapping ( ClientPtr client );
-extern int LbxGetKeyboardMapping ( ClientPtr client );
-extern int LbxQueryFont ( ClientPtr client );
-extern int LbxTagData ( ClientPtr client, XID tag, unsigned long len,
- pointer data );
-extern int LbxInvalidateTag ( ClientPtr client, XID tag );
-extern void LbxAllowMotion ( ClientPtr client, int num );
-extern void LbxFlushModifierMapTag ( void );
-extern void LbxFlushKeyboardMapTag ( void );
-extern void LbxFreeFontTag ( FontPtr pfont );
-extern void LbxSendInvalidateTag ( ClientPtr client, XID tag, int tagtype );
-extern Bool LbxFlushQTag ( XID tag );
-extern void ProcessQTagZombies ( void );
-extern void LbxQueryTagData ( ClientPtr client, int owner_pid, XID tag,
- int tagtype );
-
-/* lbxexts.c */
-extern Bool LbxAddExtension ( char *name, int opcode, int ev_base,
- int err_base );
-extern Bool LbxAddExtensionAlias ( int idx, char *alias );
-extern void LbxDeclareExtensionSecurity ( char *extname, Bool secure );
-extern Bool LbxRegisterExtensionGenerationMasks ( int idx, int num_reqs,
- char *rep_mask,
- char *ev_mask );
-extern int LbxQueryExtension ( ClientPtr client, char *ename, int nlen );
-extern void LbxCloseDownExtensions ( void );
-extern void LbxSetReqMask ( CARD8 *mask, int req, Bool on );
-
-/* lbxgfx.c */
-extern int LbxDecodePoly( ClientPtr client, CARD8 xreqtype,
- int (*decode_rtn)(char *, char *, short *) );
-extern int LbxDecodeFillPoly ( ClientPtr client );
-extern int LbxDecodeCopyArea ( ClientPtr client );
-extern int LbxDecodeCopyPlane ( ClientPtr client );
-extern int LbxDecodePolyText ( ClientPtr client );
-extern int LbxDecodeImageText ( ClientPtr client );
-extern int LbxDecodePutImage ( ClientPtr client );
-extern int LbxDecodeGetImage ( ClientPtr client );
-extern int LbxDecodePoints ( char *in, char *inend, short *out );
-extern int LbxDecodeSegment ( char *in, char *inend, short *out );
-extern int LbxDecodeRectangle ( char *in, char *inend, short *out );
-extern int LbxDecodeArc ( char *in, char *inend, short *out );
-
-/* lbxmain.c */
-extern LbxProxyPtr LbxPidToProxy ( int pid );
-extern void LbxReencodeOutput ( ClientPtr client, char *pbuf, int *pcount,
- char *cbuf, int *ccount );
-extern void LbxExtensionInit ( void );
-extern void LbxCloseClient ( ClientPtr client );
-extern void LbxSetForBlock ( LbxClientPtr lbxClient );
-extern int ProcLbxDispatch ( ClientPtr client );
-extern int ProcLbxSwitch ( ClientPtr client );
-extern int ProcLbxQueryVersion ( ClientPtr client );
-extern int ProcLbxStartProxy ( ClientPtr client );
-extern int ProcLbxStopProxy ( ClientPtr client );
-extern int ProcLbxBeginLargeRequest ( ClientPtr client );
-extern int ProcLbxLargeRequestData ( ClientPtr client );
-extern int ProcLbxEndLargeRequest ( ClientPtr client );
-extern int ProcLbxInternAtoms ( ClientPtr client );
-extern int ProcLbxGetWinAttrAndGeom ( ClientPtr client );
-extern int ProcLbxNewClient ( ClientPtr client );
-extern int ProcLbxEstablishConnection ( ClientPtr client );
-extern int ProcLbxCloseClient ( ClientPtr client );
-extern int ProcLbxModifySequence ( ClientPtr client );
-extern int ProcLbxAllowMotion ( ClientPtr client );
-extern int ProcLbxGetModifierMapping ( ClientPtr client );
-extern int ProcLbxGetKeyboardMapping ( ClientPtr client );
-extern int ProcLbxQueryFont ( ClientPtr client );
-extern int ProcLbxChangeProperty ( ClientPtr client );
-extern int ProcLbxGetProperty ( ClientPtr client );
-extern int ProcLbxTagData ( ClientPtr client );
-extern int ProcLbxInvalidateTag ( ClientPtr client );
-extern int ProcLbxPolyPoint ( ClientPtr client );
-extern int ProcLbxPolyLine ( ClientPtr client );
-extern int ProcLbxPolySegment ( ClientPtr client );
-extern int ProcLbxPolyRectangle ( ClientPtr client );
-extern int ProcLbxPolyArc ( ClientPtr client );
-extern int ProcLbxFillPoly ( ClientPtr client );
-extern int ProcLbxPolyFillRectangle ( ClientPtr client );
-extern int ProcLbxPolyFillArc ( ClientPtr client );
-extern int ProcLbxCopyArea ( ClientPtr client );
-extern int ProcLbxCopyPlane ( ClientPtr client );
-extern int ProcLbxPolyText ( ClientPtr client );
-extern int ProcLbxImageText ( ClientPtr client );
-extern int ProcLbxQueryExtension ( ClientPtr client );
-extern int ProcLbxPutImage ( ClientPtr client );
-extern int ProcLbxGetImage ( ClientPtr client );
-extern int ProcLbxSync ( ClientPtr client );
-
-/* lbxprop.c */
-extern int LbxChangeProperty ( ClientPtr client );
-extern int LbxGetProperty ( ClientPtr client );
-extern void LbxStallPropRequest ( ClientPtr client, PropertyPtr pProp );
-extern int LbxChangeWindowProperty ( ClientPtr client, WindowPtr pWin,
- Atom property, Atom type, int format,
- int mode, unsigned long len,
- Bool have_data, pointer value,
- Bool sendevent, XID *tag );
-/* lbxsquish.c */
-extern int LbxSquishEvent ( char *buf );
-
-/* lbwswap.c */
-extern int SProcLbxDispatch( ClientPtr client );
-extern int SProcLbxSwitch ( ClientPtr client );
-extern int SProcLbxBeginLargeRequest ( ClientPtr client );
-extern int SProcLbxLargeRequestData ( ClientPtr client );
-extern int SProcLbxEndLargeRequest ( ClientPtr client );
-extern void LbxWriteSConnSetupPrefix ( ClientPtr pClient,
- xLbxConnSetupPrefix *pcsp );
-extern void LbxSwapFontInfo ( xLbxFontInfo *pr, Bool compressed );
-
-/* lbxzerorep.c */
-extern void ZeroReplyPadBytes ( char *buf, int reqType );
-
-#endif /* _LBXSERVE_H_ */
diff --git a/lbx/lbxsquish.c b/lbx/lbxsquish.c
deleted file mode 100644
index d71647091..000000000
--- a/lbx/lbxsquish.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Xorg: lbxsquish.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1994 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxsquish.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "Xos.h"
-#include "misc.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxserve.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-
-/* handles server-side protocol squishing */
-
-static char lbxevdelta[] = {
- 0,
- 0,
- sz_xEvent - lbxsz_KeyButtonEvent,
- sz_xEvent - lbxsz_KeyButtonEvent,
- sz_xEvent - lbxsz_KeyButtonEvent,
- sz_xEvent - lbxsz_KeyButtonEvent,
- sz_xEvent - lbxsz_KeyButtonEvent,
- sz_xEvent - lbxsz_EnterLeaveEvent,
- sz_xEvent - lbxsz_EnterLeaveEvent,
- sz_xEvent - lbxsz_FocusEvent,
- sz_xEvent - lbxsz_FocusEvent,
- sz_xEvent - lbxsz_KeymapEvent,
- sz_xEvent - lbxsz_ExposeEvent,
- sz_xEvent - lbxsz_GfxExposeEvent,
- sz_xEvent - lbxsz_NoExposeEvent,
- sz_xEvent - lbxsz_VisibilityEvent,
- sz_xEvent - lbxsz_CreateNotifyEvent,
- sz_xEvent - lbxsz_DestroyNotifyEvent,
- sz_xEvent - lbxsz_UnmapNotifyEvent,
- sz_xEvent - lbxsz_MapNotifyEvent,
- sz_xEvent - lbxsz_MapRequestEvent,
- sz_xEvent - lbxsz_ReparentEvent,
- sz_xEvent - lbxsz_ConfigureNotifyEvent,
- sz_xEvent - lbxsz_ConfigureRequestEvent,
- sz_xEvent - lbxsz_GravityEvent,
- sz_xEvent - lbxsz_ResizeRequestEvent,
- sz_xEvent - lbxsz_CirculateEvent,
- sz_xEvent - lbxsz_CirculateEvent,
- sz_xEvent - lbxsz_PropertyEvent,
- sz_xEvent - lbxsz_SelectionClearEvent,
- sz_xEvent - lbxsz_SelectionRequestEvent,
- sz_xEvent - lbxsz_SelectionNotifyEvent,
- sz_xEvent - lbxsz_ColormapEvent,
- sz_xEvent - lbxsz_ClientMessageEvent,
- sz_xEvent - lbxsz_MappingNotifyEvent
-};
-
-static char lbxevpad[] = {
- 0,
- 0,
- lbxsz_KeyButtonEvent - lbxupsz_KeyButtonEvent,
- lbxsz_KeyButtonEvent - lbxupsz_KeyButtonEvent,
- lbxsz_KeyButtonEvent - lbxupsz_KeyButtonEvent,
- lbxsz_KeyButtonEvent - lbxupsz_KeyButtonEvent,
- lbxsz_KeyButtonEvent - lbxupsz_KeyButtonEvent,
- lbxsz_EnterLeaveEvent - lbxupsz_EnterLeaveEvent,
- lbxsz_EnterLeaveEvent - lbxupsz_EnterLeaveEvent,
- lbxsz_FocusEvent - lbxupsz_FocusEvent,
- lbxsz_FocusEvent - lbxupsz_FocusEvent,
- lbxsz_KeymapEvent - lbxupsz_KeymapEvent,
- lbxsz_ExposeEvent - lbxupsz_ExposeEvent,
- lbxsz_GfxExposeEvent - lbxupsz_GfxExposeEvent,
- lbxsz_NoExposeEvent - lbxupsz_NoExposeEvent,
- lbxsz_VisibilityEvent - lbxupsz_VisibilityEvent,
- lbxsz_CreateNotifyEvent - lbxupsz_CreateNotifyEvent,
- lbxsz_DestroyNotifyEvent - lbxupsz_DestroyNotifyEvent,
- lbxsz_UnmapNotifyEvent - lbxupsz_UnmapNotifyEvent,
- lbxsz_MapNotifyEvent - lbxupsz_MapNotifyEvent,
- lbxsz_MapRequestEvent - lbxupsz_MapRequestEvent,
- lbxsz_ReparentEvent - lbxupsz_ReparentEvent,
- lbxsz_ConfigureNotifyEvent - lbxupsz_ConfigureNotifyEvent,
- lbxsz_ConfigureRequestEvent - lbxupsz_ConfigureRequestEvent,
- lbxsz_GravityEvent - lbxupsz_GravityEvent,
- lbxsz_ResizeRequestEvent - lbxupsz_ResizeRequestEvent,
- lbxsz_CirculateEvent - lbxupsz_CirculateEvent,
- lbxsz_CirculateEvent - lbxupsz_CirculateEvent,
- lbxsz_PropertyEvent - lbxupsz_PropertyEvent,
- lbxsz_SelectionClearEvent - lbxupsz_SelectionClearEvent,
- lbxsz_SelectionRequestEvent - lbxupsz_SelectionRequestEvent,
- lbxsz_SelectionNotifyEvent - lbxupsz_SelectionNotifyEvent,
- lbxsz_ColormapEvent - lbxupsz_ColormapEvent,
- lbxsz_ClientMessageEvent - lbxupsz_ClientMessageEvent,
- lbxsz_MappingNotifyEvent - lbxupsz_MappingNotifyEvent
-};
-
-int
-LbxSquishEvent(char *buf)
-{
- int delta = lbxevdelta[((xEvent *)buf)->u.u.type];
- int pad = lbxevpad[((xEvent *)buf)->u.u.type];
-
- if (delta)
- memmove(buf + delta, buf, sz_xEvent - delta);
- if (pad) {
- buf += sz_xEvent;
- while (--pad >= 0)
- *--buf = 0;
- }
- return delta;
-}
diff --git a/lbx/lbxsrvopts.h b/lbx/lbxsrvopts.h
deleted file mode 100644
index eeb94f266..000000000
--- a/lbx/lbxsrvopts.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $Xorg: lbxsrvopts.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
-/*
- * Copyright 1994 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxsrvopts.h,v 1.3 2001/01/17 22:37:00 dawes Exp $ */
-
-#ifndef _LBX_SRVOPTS_H_
-#define _LBX_SRVOPTS_H_
-
-#include "lbxopts.h"
-
-typedef struct _LbxNegOpts {
- int nopts;
- short proxyDeltaN;
- short proxyDeltaMaxLen;
- short serverDeltaN;
- short serverDeltaMaxLen;
- LbxStreamOpts streamOpts;
- int numBitmapCompMethods;
- unsigned char *bitmapCompMethods; /* array of indices */
- int numPixmapCompMethods;
- unsigned char *pixmapCompMethods; /* array of indices */
- int **pixmapCompDepths; /* depths supported from each method */
- Bool squish;
- Bool useTags;
-} LbxNegOptsRec;
-
-typedef LbxNegOptsRec *LbxNegOptsPtr;
-
-
-extern void LbxOptionInit ( LbxNegOptsPtr pno );
-extern int LbxOptionParse ( LbxNegOptsPtr pno, unsigned char *popt,
- int optlen, unsigned char *preply );
-extern LbxBitmapCompMethod *
-LbxSrvrLookupBitmapCompMethod ( LbxProxyPtr proxy, int methodOpCode );
-extern LbxPixmapCompMethod *
-LbxSrvrLookupPixmapCompMethod ( LbxProxyPtr proxy, int methodOpCode );
-extern LbxBitmapCompMethod *
-LbxSrvrFindPreferredBitmapCompMethod ( LbxProxyPtr proxy );
-extern LbxPixmapCompMethod *
-LbxSrvrFindPreferredPixmapCompMethod ( LbxProxyPtr proxy, int format, int depth );
-
-
-#endif /* _LBX_SRVOPTS_H_ */
diff --git a/lbx/lbxswap.c b/lbx/lbxswap.c
deleted file mode 100644
index edfc0bea7..000000000
--- a/lbx/lbxswap.c
+++ /dev/null
@@ -1,824 +0,0 @@
-/* $Xorg: lbxswap.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1992 Network Computing Devices
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of NCD. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. NCD. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxswap.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */
-
-#include <sys/types.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "Xos.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "swaprep.h"
-#include "propertyst.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "lbxserve.h"
-#include "Xfuncproto.h"
-
-#include <stdio.h>
-
-static int
-SProcLbxQueryVersion(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxQueryVersionReq);
-
- swaps(&stuff->length, n);
- return ProcLbxQueryVersion(client);
-}
-
-static int
-SProcLbxStartProxy(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxStartProxyReq);
-
- swaps(&stuff->length, n);
- return ProcLbxStartProxy(client);
-}
-
-static int
-SProcLbxStopProxy(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxStopProxyReq);
-
- swaps(&stuff->length, n);
- return ProcLbxStopProxy(client);
-}
-
-int
-SProcLbxSwitch(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxSwitchReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->client, n);
- return ProcLbxSwitch(client);
-}
-
-int
-SProcLbxBeginLargeRequest (ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxBeginLargeRequestReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->largeReqLength, n);
- return ProcLbxBeginLargeRequest(client);
-}
-
-int
-SProcLbxLargeRequestData (ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxLargeRequestDataReq);
-
- swaps(&stuff->length, n);
- return ProcLbxLargeRequestData(client);
-}
-
-int
-SProcLbxEndLargeRequest (ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxEndLargeRequestReq);
-
- swaps(&stuff->length, n);
- return ProcLbxEndLargeRequest(client);
-}
-
-static int
-SProcLbxNewClient(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxNewClientReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->client, n);
- return ProcLbxNewClient(client);
-}
-
-static int
-SProcLbxCloseClient(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxCloseClientReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->client, n);
- return ProcLbxCloseClient(client);
-}
-
-static int
-SProcLbxModifySequence(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxModifySequenceReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->adjust, n);
- return ProcLbxModifySequence(client);
-}
-
-static int
-SProcLbxAllowMotion(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxAllowMotionReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->num, n);
- return ProcLbxAllowMotion(client);
-}
-
-static int
-SProcLbxIncrementPixel(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxIncrementPixelReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swapl(&stuff->pixel, n);
- return ProcLbxIncrementPixel(client);
-}
-
-static int
-SProcLbxGrabCmap(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxGrabCmapReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
-
- return ProcLbxGrabCmap(client);
-}
-
-static int
-SProcLbxReleaseCmap(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxReleaseCmapReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
-
- return ProcLbxReleaseCmap(client);
-}
-
-static int
-SProcLbxAllocColor(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxAllocColorReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cmap, n);
- swapl(&stuff->pixel, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
-
- return ProcLbxAllocColor(client);
-}
-
-static int
-SProcLbxGetModifierMapping(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxGetModifierMappingReq);
-
- swaps(&stuff->length, n);
- return ProcLbxGetModifierMapping(client);
-}
-
-static int
-SProcLbxGetKeyboardMapping(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxGetKeyboardMappingReq);
-
- swaps(&stuff->length, n);
- return ProcLbxGetKeyboardMapping(client);
-}
-
-static int
-SProcLbxQueryFont(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxQueryFontReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->fid, n);
- return ProcLbxQueryFont(client);
-}
-
-static int
-SProcLbxChangeProperty(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxChangePropertyReq);
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xLbxChangePropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- switch (stuff->format) {
- case 8:
- break;
- case 16:
- SwapRestS(stuff);
- break;
- case 32:
- SwapRestL(stuff);
- break;
- }
- return ProcLbxChangeProperty(client);
-}
-
-static int
-SProcLbxGetProperty(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxGetPropertyReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- return ProcLbxGetProperty(client);
-}
-
-static int
-SProcLbxTagData(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxTagDataReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->tag, n);
- swapl(&stuff->real_length, n);
- return ProcLbxTagData(client);
-}
-
-static int
-SProcLbxInvalidateTag(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxInvalidateTagReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->tag, n);
- return ProcLbxInvalidateTag(client);
-}
-
-static int
-SProcLbxPoly(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxPolyPointReq);
- char *after;
-
- swaps(&stuff->length, n);
- after = ((char *) stuff) + SIZEOF(xLbxPolyPointReq);
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxDispatch(client);
-}
-
-static int
-SProcLbxFillPoly(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxFillPolyReq);
- char *after;
-
- swaps(&stuff->length, n);
- after = ((char *) stuff) + SIZEOF(xLbxFillPolyReq);
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxFillPoly(client);
-}
-
-static int
-SProcLbxCopyArea(ClientPtr client)
-{
- int n;
-
- REQUEST(xLbxCopyAreaReq);
- char *after;
-
- swaps(&stuff->length, n);
- after = ((char *) stuff) + SIZEOF(xLbxCopyAreaReq);
- if (GFXdCacheEnt (stuff->srcCache) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxCopyArea(client);
-}
-
-static int
-SProcLbxCopyPlane(ClientPtr client)
-{
- int n;
-
- REQUEST(xLbxCopyPlaneReq);
- char *after;
-
- swaps(&stuff->length, n);
- swapl(&stuff->bitPlane, n);
- after = ((char *) stuff) + SIZEOF(xLbxCopyPlaneReq);
- if (GFXdCacheEnt (stuff->srcCache) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxCopyPlane(client);
-}
-
-static int
-SProcLbxPolyText(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxPolyTextReq);
- char *after;
-
- swaps(&stuff->length, n);
- after = ((char *) stuff) + SIZEOF(xLbxPolyTextReq);
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxDispatch(client);
-}
-
-static int
-SProcLbxImageText(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxImageTextReq);
- char *after;
-
- swaps(&stuff->length, n);
- after = ((char *) stuff) + SIZEOF(xLbxImageTextReq);
- if (GFXdCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- {
- swapl (((Drawable *) after), n);
- after += sizeof (Drawable);
- }
- if (GFXgCacheEnt (stuff->cacheEnts) == GFXCacheNone)
- swapl (((GContext *) after), n);
- return ProcLbxDispatch(client);
-}
-
-
-static int
-SProcLbxPutImage(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxPutImageReq);
-
- swaps (&stuff->length, n);
- return ProcLbxPutImage(client);
-}
-
-static int
-SProcLbxGetImage(ClientPtr client)
-{
- register int n;
-
- REQUEST(xLbxGetImageReq);
-
- swaps (&stuff->length, n);
- swapl (&stuff->drawable, n);
- swaps (&stuff->x, n);
- swaps (&stuff->y, n);
- swaps (&stuff->width, n);
- swaps (&stuff->height, n);
- swapl (&stuff->planeMask, n);
- return ProcLbxGetImage(client);
-}
-
-static int
-SProcLbxInternAtoms(ClientPtr client)
-{
- register int n;
- char *ptr;
- char lenbuf[2];
- CARD16 len;
- int i;
-
- REQUEST(xLbxInternAtomsReq);
-
- swaps (&stuff->length, n);
- swaps (&stuff->num, n);
-
- ptr = (char *) stuff + sz_xLbxInternAtomsReq;
- for (i = 0; i < stuff->num; i++)
- {
- swaps (ptr, n);
- lenbuf[0] = ptr[0];
- lenbuf[1] = ptr[1];
- len = *((CARD16 *) lenbuf);
- ptr += (len + 2);
- }
-
- return ProcLbxInternAtoms(client);
-}
-
-
-static int
-SProcLbxGetWinAttrAndGeom(ClientPtr client)
-{
- int n;
-
- REQUEST(xLbxGetWinAttrAndGeomReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->id, n);
-
- return ProcLbxGetWinAttrAndGeom(client);
-}
-
-
-
-static int
-SProcLbxQueryExtension(ClientPtr client)
-{
- int n;
-
- REQUEST(xLbxQueryExtensionReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->nbytes, n);
- return ProcLbxQueryExtension(client);
-}
-
-int
-SProcLbxDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_LbxQueryVersion:
- return SProcLbxQueryVersion(client);
- case X_LbxStartProxy:
- return SProcLbxStartProxy(client);
- case X_LbxStopProxy:
- return SProcLbxStopProxy(client);
- case X_LbxNewClient:
- return SProcLbxNewClient(client);
- case X_LbxCloseClient:
- return SProcLbxCloseClient(client);
- case X_LbxModifySequence:
- return SProcLbxModifySequence(client);
- case X_LbxAllowMotion:
- return SProcLbxAllowMotion(client);
- case X_LbxIncrementPixel:
- return SProcLbxIncrementPixel(client);
- case X_LbxGrabCmap:
- return SProcLbxGrabCmap(client);
- case X_LbxReleaseCmap:
- return SProcLbxReleaseCmap(client);
- case X_LbxAllocColor:
- return SProcLbxAllocColor(client);
- case X_LbxGetModifierMapping:
- return SProcLbxGetModifierMapping(client);
- case X_LbxGetKeyboardMapping:
- return SProcLbxGetKeyboardMapping(client);
- case X_LbxInvalidateTag:
- return SProcLbxInvalidateTag(client);
- case X_LbxPolyPoint:
- case X_LbxPolyLine:
- case X_LbxPolySegment:
- case X_LbxPolyRectangle:
- case X_LbxPolyArc:
- case X_LbxPolyFillRectangle:
- case X_LbxPolyFillArc:
- return SProcLbxPoly(client);
- case X_LbxFillPoly:
- return SProcLbxFillPoly(client);
- case X_LbxQueryFont:
- return SProcLbxQueryFont(client);
- case X_LbxChangeProperty:
- return SProcLbxChangeProperty(client);
- case X_LbxGetProperty:
- return SProcLbxGetProperty(client);
- case X_LbxTagData:
- return SProcLbxTagData(client);
- case X_LbxCopyArea:
- return SProcLbxCopyArea(client);
- case X_LbxCopyPlane:
- return SProcLbxCopyPlane(client);
- case X_LbxPolyText8:
- case X_LbxPolyText16:
- return SProcLbxPolyText(client);
- case X_LbxImageText8:
- case X_LbxImageText16:
- return SProcLbxImageText (client);
- case X_LbxQueryExtension:
- return SProcLbxQueryExtension(client);
- case X_LbxPutImage:
- return SProcLbxPutImage(client);
- case X_LbxGetImage:
- return SProcLbxGetImage(client);
- case X_LbxInternAtoms:
- return SProcLbxInternAtoms(client);
- case X_LbxGetWinAttrAndGeom:
- return SProcLbxGetWinAttrAndGeom(client);
- case X_LbxSync:
- return ProcLbxSync(client); /* nothing to swap */
- case X_LbxBeginLargeRequest:
- return SProcLbxBeginLargeRequest(client);
- case X_LbxLargeRequestData:
- return SProcLbxLargeRequestData(client);
- default:
- return BadRequest;
- }
-}
-
-#ifdef notyet
-void
-LbxWriteSConnectionInfo(ClientPtr pClient,
- unsigned long size,
- char *pInfo)
-{
- int i, j, k;
- ScreenPtr pScreen;
- DepthPtr pDepth;
- char *pInfoT, *pInfoTBase;
- xConnSetup *pConnSetup = (xConnSetup *)pInfo;
-
- pInfoT = pInfoTBase = (char *) ALLOCATE_LOCAL(size);
- if (!pInfoTBase)
- {
- pClient->noClientException = -1;
- return;
- }
- SwapConnSetup(pConnSetup, (xConnSetup *)pInfoT);
- pInfo += sizeof(xConnSetup);
- pInfoT += sizeof(xConnSetup);
-
- /* Copy the vendor string */
- i = (pConnSetup->nbytesVendor + 3) & ~3;
- memmove(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- /* The Pixmap formats don't need to be swapped, just copied. */
- i = sizeof(xPixmapFormat) * screenInfo.numPixmapFormats;
- memmove(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- for(i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- SwapWinRoot((xWindowRoot *)pInfo, (xWindowRoot *)pInfoT);
- pInfo += sizeof(xWindowRoot);
- pInfoT += sizeof(xWindowRoot);
- pDepth = pScreen->allowedDepths;
- for(j = 0; j < pScreen->numDepths; j++, pDepth++)
- {
- ((xDepth *)pInfoT)->depth = ((xDepth *)pInfo)->depth;
- cpswaps(((xDepth *)pInfo)->nVisuals, ((xDepth *)pInfoT)->nVisuals);
- pInfo += sizeof(xDepth);
- pInfoT += sizeof(xDepth);
- for(k = 0; k < pDepth->numVids; k++)
- {
- SwapVisual((xVisualType *)pInfo, (xVisualType *)pInfoT);
- pInfo += sizeof(xVisualType);
- pInfoT += sizeof(xVisualType);
- }
- }
- }
- (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
- DEALLOCATE_LOCAL(pInfoTBase);
-}
-
-void
-SwapConnSetup(xConnSetup *pConnSetup,
- xConnSetup *pConnSetupT)
-{
- cpswapl(pConnSetup->release, pConnSetupT->release);
- cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
- cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
- cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
- cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
- cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
- pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
- pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
- pConnSetupT->numRoots = pConnSetup->numRoots;
- pConnSetupT->numFormats = pConnSetup->numFormats;
- pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
- pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
- pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
- pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
-}
-
-void
-SwapWinRoot(xWindowRoot *pRoot,
- xWindowRoot *pRootT)
-{
- cpswapl(pRoot->windowId, pRootT->windowId);
- cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
- cpswapl(pRoot->whitePixel, pRootT->whitePixel);
- cpswapl(pRoot->blackPixel, pRootT->blackPixel);
- cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
- cpswaps(pRoot->pixWidth, pRootT->pixWidth);
- cpswaps(pRoot->pixHeight, pRootT->pixHeight);
- cpswaps(pRoot->mmWidth, pRootT->mmWidth);
- cpswaps(pRoot->mmHeight, pRootT->mmHeight);
- cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
- cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
- cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
- pRootT->backingStore = pRoot->backingStore;
- pRootT->saveUnders = pRoot->saveUnders;
- pRootT->rootDepth = pRoot->rootDepth;
- pRootT->nDepths = pRoot->nDepths;
-}
-
-void
-SwapVisual(xVisualType *pVis,
- xVisualType *pVisT;
-{
- cpswapl(pVis->visualID, pVisT->visualID);
- pVisT->class = pVis->class;
- pVisT->bitsPerRGB = pVis->bitsPerRGB;
- cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
- cpswapl(pVis->redMask, pVisT->redMask);
- cpswapl(pVis->greenMask, pVisT->greenMask);
- cpswapl(pVis->blueMask, pVisT->blueMask);
-}
-#endif
-
-void
-LbxWriteSConnSetupPrefix(ClientPtr pClient,
- xLbxConnSetupPrefix *pcsp)
-{
- xLbxConnSetupPrefix cspT;
-
- cspT.success = pcsp->success;
- cspT.changeType = pcsp->changeType;
- cspT.length = pcsp->length;
- cpswaps(pcsp->majorVersion, cspT.majorVersion);
- cpswaps(pcsp->minorVersion, cspT.minorVersion);
- cpswapl(pcsp->tag, cspT.tag);
-
- (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT);
-}
-
-void
-LbxSwapFontInfo(xLbxFontInfo *pr,
- Bool compressed)
-{
- unsigned i;
- xCharInfo *pxci;
- unsigned nchars,
- nprops;
- char *pby;
- register char n;
-
- nchars = pr->nCharInfos;
- nprops = pr->nFontProps;
- swaps(&pr->minCharOrByte2, n);
- swaps(&pr->maxCharOrByte2, n);
- swaps(&pr->defaultChar, n);
- swaps(&pr->nFontProps, n);
- swaps(&pr->fontAscent, n);
- swaps(&pr->fontDescent, n);
- SwapCharInfo(&pr->minBounds);
- SwapCharInfo(&pr->maxBounds);
- swapl(&pr->nCharInfos, n);
-
- pby = (char *) &pr[1];
- /*
- * Font properties are an atom and either an int32 or a CARD32, so they
- * are always 2 4 byte values
- */
- for (i = 0; i < nprops; i++) {
- swapl(pby, n);
- pby += 4;
- swapl(pby, n);
- pby += 4;
- }
- if (!compressed) {
- pxci = (xCharInfo *) pby;
- for (i = 0; i < nchars; i++, pxci++)
- SwapCharInfo(pxci);
- } else {
- SwapLongs((CARD32 *) pby, nchars);
- }
-}
diff --git a/lbx/lbxtables.c b/lbx/lbxtables.c
deleted file mode 100644
index e071846e3..000000000
--- a/lbx/lbxtables.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $Xorg: lbxtables.c,v 1.3 2000/08/17 19:53:32 cpqbld Exp $ */
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxtables.c,v 1.3 2001/01/17 22:37:00 dawes Exp $ */
-#include "dix.h"
-
-extern int ProcInitialConnection(ClientPtr client);
-extern int ProcLbxEstablishConnection(ClientPtr client);
-
-int (* LbxInitialVector[3]) (ClientPtr) =
-{
- 0,
- ProcInitialConnection,
- ProcLbxEstablishConnection
-};
diff --git a/lbx/lbxtags.c b/lbx/lbxtags.c
deleted file mode 100644
index 5b1d65a4a..000000000
--- a/lbx/lbxtags.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $Xorg: lbxtags.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxtags.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */
-
-#include "X.h"
-#include "misc.h"
-#include "lbxdata.h"
-#include "resource.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxtags.h"
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#include "propertyst.h"
-
-static RESTYPE TagResType;
-
-extern int _lbx_fi_junklen;
-
-/* ARGSUSED */
-static int
-tag_free(pointer data,
- XID id)
-{
- TagData td = (TagData) data;
- FontTagInfoPtr ftip;
- char *t;
-
- if (td->global)
- *(td->global) = 0;
- /* some types need to be freed, others are shared */
- if (td->data_type == LbxTagTypeFont) {
- /* remove any back links */
- ftip = (FontTagInfoPtr) td->tdata;
- FontSetPrivate(ftip->pfont, lbx_font_private, NULL);
- t = (char *) ftip->fontinfo;
- if (!ftip->compression) /* points to xQueryFont, so back up to it */
- t -= _lbx_fi_junklen;
- xfree(t);
- xfree(ftip);
- }
- xfree(data);
- return 0;
-}
-
-void
-TagInit(void)
-{
- TagResType = CreateNewResourceType(tag_free);
-}
-
-XID
-TagNewTag(void)
-{
- return FakeClientID(0);
-}
-
-void
-TagClearProxy(XID tid,
- int pid)
-{
- TagData td;
-
- td = (TagData) LookupIDByType(tid, TagResType);
- if (td)
- td->sent_to_proxy[pid >> 3] &= ~(1 << (pid & 7));
-}
-
-void
-TagMarkProxy(XID tid,
- int pid)
-{
- TagData td;
-
- td = (TagData) LookupIDByType(tid, TagResType);
- td->sent_to_proxy[pid >> 3] |= 1 << (pid & 7);
-}
-
-Bool
-TagProxyMarked(XID tid,
- int pid)
-{
- TagData td;
-
- td = (TagData) LookupIDByType(tid, TagResType);
- return (td->sent_to_proxy[pid >> 3] & (1 << (pid & 7))) != 0;
-}
-
-XID
-TagSaveTag(int dtype,
- int size,
- pointer data,
- XID *global)
-{
- TagData td;
-
- td = (TagData) xalloc(sizeof(TagDataRec));
- if (!td) {
- if (global)
- *global = 0;
- return 0;
- }
- bzero((char *) td->sent_to_proxy, (MAX_NUM_PROXIES + 7) / 8);
- td->tid = TagNewTag();
- td->data_type = dtype;
- td->tdata = data;
- td->size = size;
- td->global = global;
- if (!AddResource(td->tid, TagResType, (pointer) td))
- return 0;
- if (global)
- *global = td->tid;
- return td->tid;
-}
-
-void
-TagDeleteTag(XID tid)
-{
- int pid;
- TagData td;
- LbxProxyPtr proxy;
- ClientPtr client;
- LbxClientPtr lbxcp;
-
- td = (TagData) LookupIDByType(tid, TagResType);
- if (!td) /* shouldn't happen, but play it safe */
- return;
- for (pid = 1; pid < MAX_NUM_PROXIES; pid++) {
- if (td->sent_to_proxy[pid >> 3] & (1 << (pid & 7))) {
- proxy = LbxPidToProxy(pid);
- lbxcp = (proxy != NULL) ? proxy->lbxClients[0] : NULL;
- if (lbxcp && (client = lbxcp->client))
- LbxSendInvalidateTag(client, tid, td->data_type);
- td->sent_to_proxy[pid >> 3] &= ~(1 << (pid & 7));
- }
- }
- if (td->data_type != LbxTagTypeProperty || !LbxFlushQTag(tid))
- FreeResource(tid, 0);
- else if (td->global) {
- *(td->global) = 0;
- td->global = NULL;
- }
-}
-
-TagData
-TagGetTag(XID tid)
-{
- TagData td;
-
- td = (TagData) LookupIDByType(tid, TagResType);
- return td;
-}
-
-static void
-LbxFlushTag(pointer value,
- XID tid,
- pointer cdata)
-{
- TagData td = (TagData)value;
- LbxProxyPtr proxy = (LbxProxyPtr)cdata;
- int i;
-
- if ((td->data_type == LbxTagTypeProperty) && td->global) {
- PropertyPtr pProp = (PropertyPtr)td->tdata;
- if ((pProp->tag_id == tid) && (pProp->owner_pid == proxy->pid)) {
- LbxFlushQTag(tid);
- pProp->size = 0;
- FreeResource(tid, 0);
- return;
- }
- }
- td->sent_to_proxy[proxy->pid >> 3] &= ~(1 << (proxy->pid & 7));
- for (i = 0; i < (MAX_NUM_PROXIES + 7) / 8; i++) {
- if (td->sent_to_proxy[i])
- return;
- }
- FreeResource(tid, 0);
-}
-
-/*
- * clear out markers for proxies
- */
-void
-LbxFlushTags(LbxProxyPtr proxy)
-{
- FindClientResourcesByType(NULL, TagResType, LbxFlushTag, (pointer)proxy);
-}
diff --git a/lbx/lbxtags.h b/lbx/lbxtags.h
deleted file mode 100644
index e451ad091..000000000
--- a/lbx/lbxtags.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $Xorg: lbxtags.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/*
- * Copyright 1993 Network Computing Devices, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name Network Computing Devices, Inc. not be
- * used in advertising or publicity pertaining to distribution of this
- * software without specific, written prior permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC.,
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
- * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK
- * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
- * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
- * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
- * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/lbx/lbxtags.h,v 1.4 2001/12/14 20:00:01 dawes Exp $ */
-
-#ifndef _LBXTAGS_H_
-#define _LBXTAGS_H_
-#include "lbxserve.h"
-
-#include "os.h"
-#include "opaque.h"
-#include "resource.h"
-#include "X.h"
-#include "Xproto.h"
-
-typedef struct _tagdata {
- XID tid;
- short data_type;
- unsigned char sent_to_proxy[(MAX_NUM_PROXIES + 7) / 8];
- int size;
- pointer tdata;
- XID *global;
-} TagDataRec;
-
-typedef struct _tagdata *TagData;
-
-extern void TagInit ( void );
-extern XID TagNewTag ( void );
-extern void TagClearProxy ( XID tid, int pid );
-extern void TagMarkProxy ( XID tid, int pid );
-extern Bool TagProxyMarked ( XID tid, int pid );
-extern XID TagSaveTag ( int dtype, int size, pointer data, XID *global );
-extern void TagDeleteTag ( XID tid );
-extern TagData TagGetTag ( XID tid );
-extern void LbxFlushTags ( LbxProxyPtr proxy );
-
-#endif /* _LBXTAGS_H_ */
diff --git a/lbx/lbxzerorep.c b/lbx/lbxzerorep.c
deleted file mode 100644
index 50b424708..000000000
--- a/lbx/lbxzerorep.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/* $Xorg: lbxzerorep.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/lbx/lbxzerorep.c,v 1.4 2001/12/14 20:00:02 dawes Exp $ */
-
-/*
- * This module handles zeroing out unused pad bytes in core X replies.
- * This will hopefully improve both stream and delta compression,
- * since we are removing the random values in pad bytes.
- */
-
-#define NEED_REPLIES
-#include "X.h"
-#include <X11/Xproto.h>
-
-void
-ZeroReplyPadBytes (char *buf,
- int reqType)
-{
- switch (reqType) {
- case X_GetWindowAttributes:
- {
- xGetWindowAttributesReply *reply = (xGetWindowAttributesReply *) buf;
- reply->pad = 0;
- break;
- }
- case X_GetGeometry:
- {
- xGetGeometryReply *reply = (xGetGeometryReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- break;
- }
- case X_QueryTree:
- {
- xQueryTreeReply *reply = (xQueryTreeReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- break;
- }
- case X_InternAtom:
- {
- xInternAtomReply *reply = (xInternAtomReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_GetAtomName:
- {
- xGetAtomNameReply *reply = (xGetAtomNameReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetProperty:
- {
- xGetPropertyReply *reply = (xGetPropertyReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- break;
- }
- case X_ListProperties:
- {
- xListPropertiesReply *reply = (xListPropertiesReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetSelectionOwner:
- {
- xGetSelectionOwnerReply *reply = (xGetSelectionOwnerReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_GrabKeyboard:
- case X_GrabPointer:
- {
- xGrabKeyboardReply *reply = (xGrabKeyboardReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_QueryPointer:
- {
- xQueryPointerReply *reply = (xQueryPointerReply *) buf;
- reply->pad1 = 0;
- reply->pad = 0;
- break;
- }
- case X_GetMotionEvents:
- {
- xGetMotionEventsReply *reply = (xGetMotionEventsReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_TranslateCoords:
- {
- xTranslateCoordsReply *reply = (xTranslateCoordsReply *) buf;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- break;
- }
- case X_GetInputFocus:
- {
- xGetInputFocusReply *reply = (xGetInputFocusReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- break;
- }
- case X_QueryKeymap:
- {
- xQueryKeymapReply *reply = (xQueryKeymapReply *) buf;
- reply->pad1 = 0;
- break;
- }
- case X_QueryFont:
- {
- xQueryFontReply *reply = (xQueryFontReply *) buf;
- reply->pad1 = 0;
- break;
- }
- case X_QueryTextExtents:
- {
- xQueryTextExtentsReply *reply = (xQueryTextExtentsReply *) buf;
- reply->pad = 0;
- break;
- }
- case X_ListFonts:
- {
- xListFontsReply *reply = (xListFontsReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetFontPath:
- {
- xGetFontPathReply *reply = (xGetFontPathReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetImage:
- {
- xGetImageReply *reply = (xGetImageReply *) buf;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_ListInstalledColormaps:
- {
- xListInstalledColormapsReply *reply =
- (xListInstalledColormapsReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_AllocColor:
- {
- xAllocColorReply *reply = (xAllocColorReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- break;
- }
- case X_AllocNamedColor:
- {
- xAllocNamedColorReply *reply = (xAllocNamedColorReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- break;
- }
- case X_AllocColorCells:
- {
- xAllocColorCellsReply *reply = (xAllocColorCellsReply *) buf;
- reply->pad1 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_AllocColorPlanes:
- {
- xAllocColorPlanesReply *reply = (xAllocColorPlanesReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- break;
- }
- case X_QueryColors:
- {
- xQueryColorsReply *reply = (xQueryColorsReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_LookupColor:
- {
- xLookupColorReply *reply = (xLookupColorReply *) buf;
- reply->pad1 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- break;
- }
- case X_QueryBestSize:
- {
- xQueryBestSizeReply *reply = (xQueryBestSizeReply *) buf;
- reply->pad1 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_QueryExtension:
- {
- xQueryExtensionReply *reply = (xQueryExtensionReply *) buf;
- reply->pad1 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_ListExtensions:
- {
- xListExtensionsReply *reply = (xListExtensionsReply *) buf;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_SetPointerMapping:
- case X_SetModifierMapping:
- {
- xSetMappingReply *reply = (xSetMappingReply *) buf;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetPointerMapping:
- {
- xGetPointerMappingReply *reply = (xGetPointerMappingReply *) buf;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetKeyboardMapping:
- {
- xGetKeyboardMappingReply *reply = (xGetKeyboardMappingReply *) buf;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- case X_GetModifierMapping:
- {
- xGetModifierMappingReply *reply = (xGetModifierMappingReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_GetKeyboardControl:
- {
- xGetKeyboardControlReply *reply = (xGetKeyboardControlReply *) buf;
- reply->pad = 0;
- break;
- }
- case X_GetPointerControl:
- {
- xGetPointerControlReply *reply = (xGetPointerControlReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_GetScreenSaver:
- {
- xGetScreenSaverReply *reply = (xGetScreenSaverReply *) buf;
- reply->pad1 = 0;
- reply->pad2 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- break;
- }
- case X_ListHosts:
- {
- xListHostsReply *reply = (xListHostsReply *) buf;
- reply->pad1 = 0;
- reply->pad3 = 0;
- reply->pad4 = 0;
- reply->pad5 = 0;
- reply->pad6 = 0;
- reply->pad7 = 0;
- break;
- }
- }
-}
diff --git a/mfb/fastblt.h b/mfb/fastblt.h
deleted file mode 100644
index f647eb6ba..000000000
--- a/mfb/fastblt.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $Xorg: fastblt.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mfb/fastblt.h,v 1.5 2001/12/14 20:00:03 dawes Exp $ */
-
-/*
- * Fast bitblt macros for certain hardware. If your machine has an addressing
- * mode of small constant + register, you'll probably want this magic specific
- * code. It's 25% faster for the R2000. I haven't studied the Sparc
- * instruction set, but I suspect it also has this addressing mode. Also,
- * unrolling the loop by 32 is possibly excessive for mfb. The number of times
- * the loop is actually looped through is pretty small.
- */
-
-/*
- * WARNING: These macros make *a lot* of assumptions about
- * the environment they are invoked in. Plenty of implicit
- * arguments, lots of side effects. Don't use them casually.
- */
-
-#define SwitchOdd(n) case n: BodyOdd(n)
-#define SwitchEven(n) case n: BodyEven(n)
-
-/* to allow mfb and cfb to share code... */
-#ifndef BitRight
-#define BitRight(a,b) SCRRIGHT(a,b)
-#define BitLeft(a,b) SCRLEFT(a,b)
-#endif
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#define UNROLL 8
-#define PackedLoop \
- switch (nl & (UNROLL-1)) { \
- SwitchOdd( 7) SwitchEven( 6) SwitchOdd( 5) SwitchEven( 4) \
- SwitchOdd( 3) SwitchEven( 2) SwitchOdd( 1) \
- } \
- while ((nl -= UNROLL) >= 0) { \
- LoopReset \
- BodyEven( 8) \
- BodyOdd( 7) BodyEven( 6) BodyOdd( 5) BodyEven( 4) \
- BodyOdd( 3) BodyEven( 2) BodyOdd( 1) \
- }
-#else
-#define UNROLL 4
-#define PackedLoop \
- switch (nl & (UNROLL-1)) { \
- SwitchOdd( 3) SwitchEven( 2) SwitchOdd( 1) \
- } \
- while ((nl -= UNROLL) >= 0) { \
- LoopReset \
- BodyEven( 4) \
- BodyOdd( 3) BodyEven( 2) BodyOdd( 1) \
- }
-#endif
-
-#define DuffL(counter,label,body) \
- switch (counter & 3) { \
- label: \
- body \
- case 3: \
- body \
- case 2: \
- body \
- case 1: \
- body \
- case 0: \
- if ((counter -= 4) >= 0) \
- goto label; \
- }
diff --git a/mfb/maskbits.c b/mfb/maskbits.c
deleted file mode 100644
index 4f3e0087b..000000000
--- a/mfb/maskbits.c
+++ /dev/null
@@ -1,1051 +0,0 @@
-/* $Xorg: maskbits.c,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $XFree86: xc/programs/Xserver/mfb/maskbits.c,v 1.6 2001/12/14 20:00:03 dawes Exp $ */
-
-#include "maskbits.h"
-#include "servermd.h"
-
-/*
-these tables are used by several macros in the mfb code.
-
- the vax numbers everything left to right, so bit indices on the
-screen match bit indices in longwords. the pc-rt and Sun number
-bits on the screen the way they would be written on paper,
-(i.e. msb to the left), and so a bit index n on the screen is
-bit index PPW-n in a longword
-
- see also maskbits.h
-*/
-
-#if PPW != 32
- ERROR MFB must be compiled with PPW 32
-#endif
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-/* NOTE:
-the first element in starttab could be 0xffffffff. making it 0
-lets us deal with a full first word in the middle loop, rather
-than having to do the multiple reads and masks that we'd
-have to do if we thought it was partial.
-*/
-PixelType starttab[PPW+1] =
- {
- LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x7FFFFFFF ),
- LONG2CHARS( 0x3FFFFFFF ),
- LONG2CHARS( 0x1FFFFFFF ),
- LONG2CHARS( 0x0FFFFFFF ),
- LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x03FFFFFF ),
- LONG2CHARS( 0x01FFFFFF ),
- LONG2CHARS( 0x00FFFFFF ),
- LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x003FFFFF ),
- LONG2CHARS( 0x001FFFFF ),
- LONG2CHARS( 0x000FFFFF ),
- LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x0003FFFF ),
- LONG2CHARS( 0x0001FFFF ),
- LONG2CHARS( 0x0000FFFF ),
- LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x00003FFF ),
- LONG2CHARS( 0x00001FFF ),
- LONG2CHARS( 0x00000FFF ),
- LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x000003FF ),
- LONG2CHARS( 0x000001FF ),
- LONG2CHARS( 0x000000FF ),
- LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x0000003F ),
- LONG2CHARS( 0x0000001F ),
- LONG2CHARS( 0x0000000F ),
- LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x00000003 ),
- LONG2CHARS( 0x00000001 ),
- LONG2CHARS( 0x00000000 )
- };
-
-PixelType endtab[PPW+1] =
- {
- LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x80000000 ),
- LONG2CHARS( 0xC0000000 ),
- LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0xF0000000 ),
- LONG2CHARS( 0xF8000000 ),
- LONG2CHARS( 0xFC000000 ),
- LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0xFF000000 ),
- LONG2CHARS( 0xFF800000 ),
- LONG2CHARS( 0xFFC00000 ),
- LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0xFFF00000 ),
- LONG2CHARS( 0xFFF80000 ),
- LONG2CHARS( 0xFFFC0000 ),
- LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0xFFFF0000 ),
- LONG2CHARS( 0xFFFF8000 ),
- LONG2CHARS( 0xFFFFC000 ),
- LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0xFFFFF000 ),
- LONG2CHARS( 0xFFFFF800 ),
- LONG2CHARS( 0xFFFFFC00 ),
- LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0xFFFFFF00 ),
- LONG2CHARS( 0xFFFFFF80 ),
- LONG2CHARS( 0xFFFFFFC0 ),
- LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0xFFFFFFF0 ),
- LONG2CHARS( 0xFFFFFFF8 ),
- LONG2CHARS( 0xFFFFFFFC ),
- LONG2CHARS( 0xFFFFFFFE ),
- LONG2CHARS( 0xFFFFFFFF )
- };
-
-#ifndef LOWMEMFTPT
-
-#ifdef NEED_OLD_MFB_MASKS
-/* a hack, for now, since the entries for 0 need to be all
- 1 bits, not all zeros.
- this means the code DOES NOT WORK for segments of length
- 0 (which is only a problem in the horizontal line code.)
-*/
-PixelType startpartial[33] =
- {
- LONG2CHARS( 0xFFFFFFFF ),
- LONG2CHARS( 0x7FFFFFFF ),
- LONG2CHARS( 0x3FFFFFFF ),
- LONG2CHARS( 0x1FFFFFFF ),
- LONG2CHARS( 0x0FFFFFFF ),
- LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x03FFFFFF ),
- LONG2CHARS( 0x01FFFFFF ),
- LONG2CHARS( 0x00FFFFFF ),
- LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x003FFFFF ),
- LONG2CHARS( 0x001FFFFF ),
- LONG2CHARS( 0x000FFFFF ),
- LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x0003FFFF ),
- LONG2CHARS( 0x0001FFFF ),
- LONG2CHARS( 0x0000FFFF ),
- LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x00003FFF ),
- LONG2CHARS( 0x00001FFF ),
- LONG2CHARS( 0x00000FFF ),
- LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x000003FF ),
- LONG2CHARS( 0x000001FF ),
- LONG2CHARS( 0x000000FF ),
- LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x0000003F ),
- LONG2CHARS( 0x0000001F ),
- LONG2CHARS( 0x0000000F ),
- LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x00000003 ),
- LONG2CHARS( 0x00000001 ),
- LONG2CHARS( 0x00000000 )
- };
-
-PixelType endpartial[33] =
- {
- LONG2CHARS( 0xFFFFFFFF ),
- LONG2CHARS( 0x80000000 ),
- LONG2CHARS( 0xC0000000 ),
- LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0xF0000000 ),
- LONG2CHARS( 0xF8000000 ),
- LONG2CHARS( 0xFC000000 ),
- LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0xFF000000 ),
- LONG2CHARS( 0xFF800000 ),
- LONG2CHARS( 0xFFC00000 ),
- LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0xFFF00000 ),
- LONG2CHARS( 0xFFF80000 ),
- LONG2CHARS( 0xFFFC0000 ),
- LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0xFFFF0000 ),
- LONG2CHARS( 0xFFFF8000 ),
- LONG2CHARS( 0xFFFFC000 ),
- LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0xFFFFF000 ),
- LONG2CHARS( 0xFFFFF800 ),
- LONG2CHARS( 0xFFFFFC00 ),
- LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0xFFFFFF00 ),
- LONG2CHARS( 0xFFFFFF80 ),
- LONG2CHARS( 0xFFFFFFC0 ),
- LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0xFFFFFFF0 ),
- LONG2CHARS( 0xFFFFFFF8 ),
- LONG2CHARS( 0xFFFFFFFC ),
- LONG2CHARS( 0xFFFFFFFE ),
- LONG2CHARS( 0xFFFFFFFF )
- };
-#endif /* NEED_OLD_MFB_MASKS */
-
-#endif /* ifndef LOWMEMFTPT */
-
-PixelType partmasks[PPW][PPW] = {
- {LONG2CHARS( 0xFFFFFFFF ), LONG2CHARS( 0x80000000 ), LONG2CHARS( 0xC0000000 ), LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0xF0000000 ), LONG2CHARS( 0xF8000000 ), LONG2CHARS( 0xFC000000 ), LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0xFF000000 ), LONG2CHARS( 0xFF800000 ), LONG2CHARS( 0xFFC00000 ), LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0xFFF00000 ), LONG2CHARS( 0xFFF80000 ), LONG2CHARS( 0xFFFC0000 ), LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0xFFFF0000 ), LONG2CHARS( 0xFFFF8000 ), LONG2CHARS( 0xFFFFC000 ), LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0xFFFFF000 ), LONG2CHARS( 0xFFFFF800 ), LONG2CHARS( 0xFFFFFC00 ), LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0xFFFFFF00 ), LONG2CHARS( 0xFFFFFF80 ), LONG2CHARS( 0xFFFFFFC0 ), LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0xFFFFFFF0 ), LONG2CHARS( 0xFFFFFFF8 ), LONG2CHARS( 0xFFFFFFFC ), LONG2CHARS( 0xFFFFFFFE )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x40000000 ), LONG2CHARS( 0x60000000 ), LONG2CHARS( 0x70000000 ),
- LONG2CHARS( 0x78000000 ), LONG2CHARS( 0x7C000000 ), LONG2CHARS( 0x7E000000 ), LONG2CHARS( 0x7F000000 ),
- LONG2CHARS( 0x7F800000 ), LONG2CHARS( 0x7FC00000 ), LONG2CHARS( 0x7FE00000 ), LONG2CHARS( 0x7FF00000 ),
- LONG2CHARS( 0x7FF80000 ), LONG2CHARS( 0x7FFC0000 ), LONG2CHARS( 0x7FFE0000 ), LONG2CHARS( 0x7FFF0000 ),
- LONG2CHARS( 0x7FFF8000 ), LONG2CHARS( 0x7FFFC000 ), LONG2CHARS( 0x7FFFE000 ), LONG2CHARS( 0x7FFFF000 ),
- LONG2CHARS( 0x7FFFF800 ), LONG2CHARS( 0x7FFFFC00 ), LONG2CHARS( 0x7FFFFE00 ), LONG2CHARS( 0x7FFFFF00 ),
- LONG2CHARS( 0x7FFFFF80 ), LONG2CHARS( 0x7FFFFFC0 ), LONG2CHARS( 0x7FFFFFE0 ), LONG2CHARS( 0x7FFFFFF0 ),
- LONG2CHARS( 0x7FFFFFF8 ), LONG2CHARS( 0x7FFFFFFC ), LONG2CHARS( 0x7FFFFFFE ), LONG2CHARS( 0x7FFFFFFF )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x20000000 ), LONG2CHARS( 0x30000000 ), LONG2CHARS( 0x38000000 ),
- LONG2CHARS( 0x3C000000 ), LONG2CHARS( 0x3E000000 ), LONG2CHARS( 0x3F000000 ), LONG2CHARS( 0x3F800000 ),
- LONG2CHARS( 0x3FC00000 ), LONG2CHARS( 0x3FE00000 ), LONG2CHARS( 0x3FF00000 ), LONG2CHARS( 0x3FF80000 ),
- LONG2CHARS( 0x3FFC0000 ), LONG2CHARS( 0x3FFE0000 ), LONG2CHARS( 0x3FFF0000 ), LONG2CHARS( 0x3FFF8000 ),
- LONG2CHARS( 0x3FFFC000 ), LONG2CHARS( 0x3FFFE000 ), LONG2CHARS( 0x3FFFF000 ), LONG2CHARS( 0x3FFFF800 ),
- LONG2CHARS( 0x3FFFFC00 ), LONG2CHARS( 0x3FFFFE00 ), LONG2CHARS( 0x3FFFFF00 ), LONG2CHARS( 0x3FFFFF80 ),
- LONG2CHARS( 0x3FFFFFC0 ), LONG2CHARS( 0x3FFFFFE0 ), LONG2CHARS( 0x3FFFFFF0 ), LONG2CHARS( 0x3FFFFFF8 ),
- LONG2CHARS( 0x3FFFFFFC ), LONG2CHARS( 0x3FFFFFFE ), LONG2CHARS( 0x3FFFFFFF ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x10000000 ), LONG2CHARS( 0x18000000 ), LONG2CHARS( 0x1C000000 ),
- LONG2CHARS( 0x1E000000 ), LONG2CHARS( 0x1F000000 ), LONG2CHARS( 0x1F800000 ), LONG2CHARS( 0x1FC00000 ),
- LONG2CHARS( 0x1FE00000 ), LONG2CHARS( 0x1FF00000 ), LONG2CHARS( 0x1FF80000 ), LONG2CHARS( 0x1FFC0000 ),
- LONG2CHARS( 0x1FFE0000 ), LONG2CHARS( 0x1FFF0000 ), LONG2CHARS( 0x1FFF8000 ), LONG2CHARS( 0x1FFFC000 ),
- LONG2CHARS( 0x1FFFE000 ), LONG2CHARS( 0x1FFFF000 ), LONG2CHARS( 0x1FFFF800 ), LONG2CHARS( 0x1FFFFC00 ),
- LONG2CHARS( 0x1FFFFE00 ), LONG2CHARS( 0x1FFFFF00 ), LONG2CHARS( 0x1FFFFF80 ), LONG2CHARS( 0x1FFFFFC0 ),
- LONG2CHARS( 0x1FFFFFE0 ), LONG2CHARS( 0x1FFFFFF0 ), LONG2CHARS( 0x1FFFFFF8 ), LONG2CHARS( 0x1FFFFFFC ),
- LONG2CHARS( 0x1FFFFFFE ), LONG2CHARS( 0x1FFFFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x08000000 ), LONG2CHARS( 0x0C000000 ), LONG2CHARS( 0x0E000000 ),
- LONG2CHARS( 0x0F000000 ), LONG2CHARS( 0x0F800000 ), LONG2CHARS( 0x0FC00000 ), LONG2CHARS( 0x0FE00000 ),
- LONG2CHARS( 0x0FF00000 ), LONG2CHARS( 0x0FF80000 ), LONG2CHARS( 0x0FFC0000 ), LONG2CHARS( 0x0FFE0000 ),
- LONG2CHARS( 0x0FFF0000 ), LONG2CHARS( 0x0FFF8000 ), LONG2CHARS( 0x0FFFC000 ), LONG2CHARS( 0x0FFFE000 ),
- LONG2CHARS( 0x0FFFF000 ), LONG2CHARS( 0x0FFFF800 ), LONG2CHARS( 0x0FFFFC00 ), LONG2CHARS( 0x0FFFFE00 ),
- LONG2CHARS( 0x0FFFFF00 ), LONG2CHARS( 0x0FFFFF80 ), LONG2CHARS( 0x0FFFFFC0 ), LONG2CHARS( 0x0FFFFFE0 ),
- LONG2CHARS( 0x0FFFFFF0 ), LONG2CHARS( 0x0FFFFFF8 ), LONG2CHARS( 0x0FFFFFFC ), LONG2CHARS( 0x0FFFFFFE ),
- LONG2CHARS( 0x0FFFFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x04000000 ), LONG2CHARS( 0x06000000 ), LONG2CHARS( 0x07000000 ),
- LONG2CHARS( 0x07800000 ), LONG2CHARS( 0x07C00000 ), LONG2CHARS( 0x07E00000 ), LONG2CHARS( 0x07F00000 ),
- LONG2CHARS( 0x07F80000 ), LONG2CHARS( 0x07FC0000 ), LONG2CHARS( 0x07FE0000 ), LONG2CHARS( 0x07FF0000 ),
- LONG2CHARS( 0x07FF8000 ), LONG2CHARS( 0x07FFC000 ), LONG2CHARS( 0x07FFE000 ), LONG2CHARS( 0x07FFF000 ),
- LONG2CHARS( 0x07FFF800 ), LONG2CHARS( 0x07FFFC00 ), LONG2CHARS( 0x07FFFE00 ), LONG2CHARS( 0x07FFFF00 ),
- LONG2CHARS( 0x07FFFF80 ), LONG2CHARS( 0x07FFFFC0 ), LONG2CHARS( 0x07FFFFE0 ), LONG2CHARS( 0x07FFFFF0 ),
- LONG2CHARS( 0x07FFFFF8 ), LONG2CHARS( 0x07FFFFFC ), LONG2CHARS( 0x07FFFFFE ), LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x02000000 ), LONG2CHARS( 0x03000000 ), LONG2CHARS( 0x03800000 ),
- LONG2CHARS( 0x03C00000 ), LONG2CHARS( 0x03E00000 ), LONG2CHARS( 0x03F00000 ), LONG2CHARS( 0x03F80000 ),
- LONG2CHARS( 0x03FC0000 ), LONG2CHARS( 0x03FE0000 ), LONG2CHARS( 0x03FF0000 ), LONG2CHARS( 0x03FF8000 ),
- LONG2CHARS( 0x03FFC000 ), LONG2CHARS( 0x03FFE000 ), LONG2CHARS( 0x03FFF000 ), LONG2CHARS( 0x03FFF800 ),
- LONG2CHARS( 0x03FFFC00 ), LONG2CHARS( 0x03FFFE00 ), LONG2CHARS( 0x03FFFF00 ), LONG2CHARS( 0x03FFFF80 ),
- LONG2CHARS( 0x03FFFFC0 ), LONG2CHARS( 0x03FFFFE0 ), LONG2CHARS( 0x03FFFFF0 ), LONG2CHARS( 0x03FFFFF8 ),
- LONG2CHARS( 0x03FFFFFC ), LONG2CHARS( 0x03FFFFFE ), LONG2CHARS( 0x03FFFFFF ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x01000000 ), LONG2CHARS( 0x01800000 ), LONG2CHARS( 0x01C00000 ),
- LONG2CHARS( 0x01E00000 ), LONG2CHARS( 0x01F00000 ), LONG2CHARS( 0x01F80000 ), LONG2CHARS( 0x01FC0000 ),
- LONG2CHARS( 0x01FE0000 ), LONG2CHARS( 0x01FF0000 ), LONG2CHARS( 0x01FF8000 ), LONG2CHARS( 0x01FFC000 ),
- LONG2CHARS( 0x01FFE000 ), LONG2CHARS( 0x01FFF000 ), LONG2CHARS( 0x01FFF800 ), LONG2CHARS( 0x01FFFC00 ),
- LONG2CHARS( 0x01FFFE00 ), LONG2CHARS( 0x01FFFF00 ), LONG2CHARS( 0x01FFFF80 ), LONG2CHARS( 0x01FFFFC0 ),
- LONG2CHARS( 0x01FFFFE0 ), LONG2CHARS( 0x01FFFFF0 ), LONG2CHARS( 0x01FFFFF8 ), LONG2CHARS( 0x01FFFFFC ),
- LONG2CHARS( 0x01FFFFFE ), LONG2CHARS( 0x01FFFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00800000 ), LONG2CHARS( 0x00C00000 ), LONG2CHARS( 0x00E00000 ),
- LONG2CHARS( 0x00F00000 ), LONG2CHARS( 0x00F80000 ), LONG2CHARS( 0x00FC0000 ), LONG2CHARS( 0x00FE0000 ),
- LONG2CHARS( 0x00FF0000 ), LONG2CHARS( 0x00FF8000 ), LONG2CHARS( 0x00FFC000 ), LONG2CHARS( 0x00FFE000 ),
- LONG2CHARS( 0x00FFF000 ), LONG2CHARS( 0x00FFF800 ), LONG2CHARS( 0x00FFFC00 ), LONG2CHARS( 0x00FFFE00 ),
- LONG2CHARS( 0x00FFFF00 ), LONG2CHARS( 0x00FFFF80 ), LONG2CHARS( 0x00FFFFC0 ), LONG2CHARS( 0x00FFFFE0 ),
- LONG2CHARS( 0x00FFFFF0 ), LONG2CHARS( 0x00FFFFF8 ), LONG2CHARS( 0x00FFFFFC ), LONG2CHARS( 0x00FFFFFE ),
- LONG2CHARS( 0x00FFFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00400000 ), LONG2CHARS( 0x00600000 ), LONG2CHARS( 0x00700000 ),
- LONG2CHARS( 0x00780000 ), LONG2CHARS( 0x007C0000 ), LONG2CHARS( 0x007E0000 ), LONG2CHARS( 0x007F0000 ),
- LONG2CHARS( 0x007F8000 ), LONG2CHARS( 0x007FC000 ), LONG2CHARS( 0x007FE000 ), LONG2CHARS( 0x007FF000 ),
- LONG2CHARS( 0x007FF800 ), LONG2CHARS( 0x007FFC00 ), LONG2CHARS( 0x007FFE00 ), LONG2CHARS( 0x007FFF00 ),
- LONG2CHARS( 0x007FFF80 ), LONG2CHARS( 0x007FFFC0 ), LONG2CHARS( 0x007FFFE0 ), LONG2CHARS( 0x007FFFF0 ),
- LONG2CHARS( 0x007FFFF8 ), LONG2CHARS( 0x007FFFFC ), LONG2CHARS( 0x007FFFFE ), LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00200000 ), LONG2CHARS( 0x00300000 ), LONG2CHARS( 0x00380000 ),
- LONG2CHARS( 0x003C0000 ), LONG2CHARS( 0x003E0000 ), LONG2CHARS( 0x003F0000 ), LONG2CHARS( 0x003F8000 ),
- LONG2CHARS( 0x003FC000 ), LONG2CHARS( 0x003FE000 ), LONG2CHARS( 0x003FF000 ), LONG2CHARS( 0x003FF800 ),
- LONG2CHARS( 0x003FFC00 ), LONG2CHARS( 0x003FFE00 ), LONG2CHARS( 0x003FFF00 ), LONG2CHARS( 0x003FFF80 ),
- LONG2CHARS( 0x003FFFC0 ), LONG2CHARS( 0x003FFFE0 ), LONG2CHARS( 0x003FFFF0 ), LONG2CHARS( 0x003FFFF8 ),
- LONG2CHARS( 0x003FFFFC ), LONG2CHARS( 0x003FFFFE ), LONG2CHARS( 0x003FFFFF ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00100000 ), LONG2CHARS( 0x00180000 ), LONG2CHARS( 0x001C0000 ),
- LONG2CHARS( 0x001E0000 ), LONG2CHARS( 0x001F0000 ), LONG2CHARS( 0x001F8000 ), LONG2CHARS( 0x001FC000 ),
- LONG2CHARS( 0x001FE000 ), LONG2CHARS( 0x001FF000 ), LONG2CHARS( 0x001FF800 ), LONG2CHARS( 0x001FFC00 ),
- LONG2CHARS( 0x001FFE00 ), LONG2CHARS( 0x001FFF00 ), LONG2CHARS( 0x001FFF80 ), LONG2CHARS( 0x001FFFC0 ),
- LONG2CHARS( 0x001FFFE0 ), LONG2CHARS( 0x001FFFF0 ), LONG2CHARS( 0x001FFFF8 ), LONG2CHARS( 0x001FFFFC ),
- LONG2CHARS( 0x001FFFFE ), LONG2CHARS( 0x001FFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00080000 ), LONG2CHARS( 0x000C0000 ), LONG2CHARS( 0x000E0000 ),
- LONG2CHARS( 0x000F0000 ), LONG2CHARS( 0x000F8000 ), LONG2CHARS( 0x000FC000 ), LONG2CHARS( 0x000FE000 ),
- LONG2CHARS( 0x000FF000 ), LONG2CHARS( 0x000FF800 ), LONG2CHARS( 0x000FFC00 ), LONG2CHARS( 0x000FFE00 ),
- LONG2CHARS( 0x000FFF00 ), LONG2CHARS( 0x000FFF80 ), LONG2CHARS( 0x000FFFC0 ), LONG2CHARS( 0x000FFFE0 ),
- LONG2CHARS( 0x000FFFF0 ), LONG2CHARS( 0x000FFFF8 ), LONG2CHARS( 0x000FFFFC ), LONG2CHARS( 0x000FFFFE ),
- LONG2CHARS( 0x000FFFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00040000 ), LONG2CHARS( 0x00060000 ), LONG2CHARS( 0x00070000 ),
- LONG2CHARS( 0x00078000 ), LONG2CHARS( 0x0007C000 ), LONG2CHARS( 0x0007E000 ), LONG2CHARS( 0x0007F000 ),
- LONG2CHARS( 0x0007F800 ), LONG2CHARS( 0x0007FC00 ), LONG2CHARS( 0x0007FE00 ), LONG2CHARS( 0x0007FF00 ),
- LONG2CHARS( 0x0007FF80 ), LONG2CHARS( 0x0007FFC0 ), LONG2CHARS( 0x0007FFE0 ), LONG2CHARS( 0x0007FFF0 ),
- LONG2CHARS( 0x0007FFF8 ), LONG2CHARS( 0x0007FFFC ), LONG2CHARS( 0x0007FFFE ), LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00020000 ), LONG2CHARS( 0x00030000 ), LONG2CHARS( 0x00038000 ),
- LONG2CHARS( 0x0003C000 ), LONG2CHARS( 0x0003E000 ), LONG2CHARS( 0x0003F000 ), LONG2CHARS( 0x0003F800 ),
- LONG2CHARS( 0x0003FC00 ), LONG2CHARS( 0x0003FE00 ), LONG2CHARS( 0x0003FF00 ), LONG2CHARS( 0x0003FF80 ),
- LONG2CHARS( 0x0003FFC0 ), LONG2CHARS( 0x0003FFE0 ), LONG2CHARS( 0x0003FFF0 ), LONG2CHARS( 0x0003FFF8 ),
- LONG2CHARS( 0x0003FFFC ), LONG2CHARS( 0x0003FFFE ), LONG2CHARS( 0x0003FFFF ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00010000 ), LONG2CHARS( 0x00018000 ), LONG2CHARS( 0x0001C000 ),
- LONG2CHARS( 0x0001E000 ), LONG2CHARS( 0x0001F000 ), LONG2CHARS( 0x0001F800 ), LONG2CHARS( 0x0001FC00 ),
- LONG2CHARS( 0x0001FE00 ), LONG2CHARS( 0x0001FF00 ), LONG2CHARS( 0x0001FF80 ), LONG2CHARS( 0x0001FFC0 ),
- LONG2CHARS( 0x0001FFE0 ), LONG2CHARS( 0x0001FFF0 ), LONG2CHARS( 0x0001FFF8 ), LONG2CHARS( 0x0001FFFC ),
- LONG2CHARS( 0x0001FFFE ), LONG2CHARS( 0x0001FFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00008000 ), LONG2CHARS( 0x0000C000 ), LONG2CHARS( 0x0000E000 ),
- LONG2CHARS( 0x0000F000 ), LONG2CHARS( 0x0000F800 ), LONG2CHARS( 0x0000FC00 ), LONG2CHARS( 0x0000FE00 ),
- LONG2CHARS( 0x0000FF00 ), LONG2CHARS( 0x0000FF80 ), LONG2CHARS( 0x0000FFC0 ), LONG2CHARS( 0x0000FFE0 ),
- LONG2CHARS( 0x0000FFF0 ), LONG2CHARS( 0x0000FFF8 ), LONG2CHARS( 0x0000FFFC ), LONG2CHARS( 0x0000FFFE ),
- LONG2CHARS( 0x0000FFFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00004000 ), LONG2CHARS( 0x00006000 ), LONG2CHARS( 0x00007000 ),
- LONG2CHARS( 0x00007800 ), LONG2CHARS( 0x00007C00 ), LONG2CHARS( 0x00007E00 ), LONG2CHARS( 0x00007F00 ),
- LONG2CHARS( 0x00007F80 ), LONG2CHARS( 0x00007FC0 ), LONG2CHARS( 0x00007FE0 ), LONG2CHARS( 0x00007FF0 ),
- LONG2CHARS( 0x00007FF8 ), LONG2CHARS( 0x00007FFC ), LONG2CHARS( 0x00007FFE ), LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00002000 ), LONG2CHARS( 0x00003000 ), LONG2CHARS( 0x00003800 ),
- LONG2CHARS( 0x00003C00 ), LONG2CHARS( 0x00003E00 ), LONG2CHARS( 0x00003F00 ), LONG2CHARS( 0x00003F80 ),
- LONG2CHARS( 0x00003FC0 ), LONG2CHARS( 0x00003FE0 ), LONG2CHARS( 0x00003FF0 ), LONG2CHARS( 0x00003FF8 ),
- LONG2CHARS( 0x00003FFC ), LONG2CHARS( 0x00003FFE ), LONG2CHARS( 0x00003FFF ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00001000 ), LONG2CHARS( 0x00001800 ), LONG2CHARS( 0x00001C00 ),
- LONG2CHARS( 0x00001E00 ), LONG2CHARS( 0x00001F00 ), LONG2CHARS( 0x00001F80 ), LONG2CHARS( 0x00001FC0 ),
- LONG2CHARS( 0x00001FE0 ), LONG2CHARS( 0x00001FF0 ), LONG2CHARS( 0x00001FF8 ), LONG2CHARS( 0x00001FFC ),
- LONG2CHARS( 0x00001FFE ), LONG2CHARS( 0x00001FFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000800 ), LONG2CHARS( 0x00000C00 ), LONG2CHARS( 0x00000E00 ),
- LONG2CHARS( 0x00000F00 ), LONG2CHARS( 0x00000F80 ), LONG2CHARS( 0x00000FC0 ), LONG2CHARS( 0x00000FE0 ),
- LONG2CHARS( 0x00000FF0 ), LONG2CHARS( 0x00000FF8 ), LONG2CHARS( 0x00000FFC ), LONG2CHARS( 0x00000FFE ),
- LONG2CHARS( 0x00000FFF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000400 ), LONG2CHARS( 0x00000600 ), LONG2CHARS( 0x00000700 ),
- LONG2CHARS( 0x00000780 ), LONG2CHARS( 0x000007C0 ), LONG2CHARS( 0x000007E0 ), LONG2CHARS( 0x000007F0 ),
- LONG2CHARS( 0x000007F8 ), LONG2CHARS( 0x000007FC ), LONG2CHARS( 0x000007FE ), LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000200 ), LONG2CHARS( 0x00000300 ), LONG2CHARS( 0x00000380 ),
- LONG2CHARS( 0x000003C0 ), LONG2CHARS( 0x000003E0 ), LONG2CHARS( 0x000003F0 ), LONG2CHARS( 0x000003F8 ),
- LONG2CHARS( 0x000003FC ), LONG2CHARS( 0x000003FE ), LONG2CHARS( 0x000003FF ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000100 ), LONG2CHARS( 0x00000180 ), LONG2CHARS( 0x000001C0 ),
- LONG2CHARS( 0x000001E0 ), LONG2CHARS( 0x000001F0 ), LONG2CHARS( 0x000001F8 ), LONG2CHARS( 0x000001FC ),
- LONG2CHARS( 0x000001FE ), LONG2CHARS( 0x000001FF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000080 ), LONG2CHARS( 0x000000C0 ), LONG2CHARS( 0x000000E0 ),
- LONG2CHARS( 0x000000F0 ), LONG2CHARS( 0x000000F8 ), LONG2CHARS( 0x000000FC ), LONG2CHARS( 0x000000FE ),
- LONG2CHARS( 0x000000FF ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000040 ), LONG2CHARS( 0x00000060 ), LONG2CHARS( 0x00000070 ),
- LONG2CHARS( 0x00000078 ), LONG2CHARS( 0x0000007C ), LONG2CHARS( 0x0000007E ), LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000020 ), LONG2CHARS( 0x00000030 ), LONG2CHARS( 0x00000038 ),
- LONG2CHARS( 0x0000003C ), LONG2CHARS( 0x0000003E ), LONG2CHARS( 0x0000003F ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000010 ), LONG2CHARS( 0x00000018 ), LONG2CHARS( 0x0000001C ),
- LONG2CHARS( 0x0000001E ), LONG2CHARS( 0x0000001F ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000008 ), LONG2CHARS( 0x0000000C ), LONG2CHARS( 0x0000000E ),
- LONG2CHARS( 0x0000000F ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000004 ), LONG2CHARS( 0x00000006 ), LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000002 ), LONG2CHARS( 0x00000003 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000001 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
-};
-
-#else /* LSBFirst */
-/* NOTE:
-the first element in starttab could be LONG2CHARS( 0xffffffff. making it 0
-lets us deal with a full first word in the middle loop ), rather
-than having to do the multiple reads and masks that we'd
-have to do if we thought it was partial.
-*/
-PixelType starttab[PPW+1] =
- {
- LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0xFFFFFFFE ),
- LONG2CHARS( 0xFFFFFFFC ),
- LONG2CHARS( 0xFFFFFFF8 ),
- LONG2CHARS( 0xFFFFFFF0 ),
- LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0xFFFFFFC0 ),
- LONG2CHARS( 0xFFFFFF80 ),
- LONG2CHARS( 0xFFFFFF00 ),
- LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0xFFFFFC00 ),
- LONG2CHARS( 0xFFFFF800 ),
- LONG2CHARS( 0xFFFFF000 ),
- LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0xFFFFC000 ),
- LONG2CHARS( 0xFFFF8000 ),
- LONG2CHARS( 0xFFFF0000 ),
- LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0xFFFC0000 ),
- LONG2CHARS( 0xFFF80000 ),
- LONG2CHARS( 0xFFF00000 ),
- LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0xFFC00000 ),
- LONG2CHARS( 0xFF800000 ),
- LONG2CHARS( 0xFF000000 ),
- LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0xFC000000 ),
- LONG2CHARS( 0xF8000000 ),
- LONG2CHARS( 0xF0000000 ),
- LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0xC0000000 ),
- LONG2CHARS( 0x80000000 ),
- LONG2CHARS( 0x00000000 )
- };
-
-PixelType endtab[PPW+1] =
- {
- LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0x00000001 ),
- LONG2CHARS( 0x00000003 ),
- LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x0000000F ),
- LONG2CHARS( 0x0000001F ),
- LONG2CHARS( 0x0000003F ),
- LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x000000FF ),
- LONG2CHARS( 0x000001FF ),
- LONG2CHARS( 0x000003FF ),
- LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x00000FFF ),
- LONG2CHARS( 0x00001FFF ),
- LONG2CHARS( 0x00003FFF ),
- LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x0000FFFF ),
- LONG2CHARS( 0x0001FFFF ),
- LONG2CHARS( 0x0003FFFF ),
- LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x000FFFFF ),
- LONG2CHARS( 0x001FFFFF ),
- LONG2CHARS( 0x003FFFFF ),
- LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x00FFFFFF ),
- LONG2CHARS( 0x01FFFFFF ),
- LONG2CHARS( 0x03FFFFFF ),
- LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x0FFFFFFF ),
- LONG2CHARS( 0x1FFFFFFF ),
- LONG2CHARS( 0x3FFFFFFF ),
- LONG2CHARS( 0x7FFFFFFF ),
- LONG2CHARS( 0xFFFFFFFF )
- };
-
-#ifndef LOWMEMFTPT
-
-#ifdef NEED_OLD_MFB_MASKS
-/* a hack ), for now, since the entries for 0 need to be all
- 1 bits ), not all zeros.
- this means the code DOES NOT WORK for segments of length
- 0 (which is only a problem in the horizontal line code.)
-*/
-PixelType startpartial[33] =
- {
- LONG2CHARS( 0xFFFFFFFF ),
- LONG2CHARS( 0xFFFFFFFE ),
- LONG2CHARS( 0xFFFFFFFC ),
- LONG2CHARS( 0xFFFFFFF8 ),
- LONG2CHARS( 0xFFFFFFF0 ),
- LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0xFFFFFFC0 ),
- LONG2CHARS( 0xFFFFFF80 ),
- LONG2CHARS( 0xFFFFFF00 ),
- LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0xFFFFFC00 ),
- LONG2CHARS( 0xFFFFF800 ),
- LONG2CHARS( 0xFFFFF000 ),
- LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0xFFFFC000 ),
- LONG2CHARS( 0xFFFF8000 ),
- LONG2CHARS( 0xFFFF0000 ),
- LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0xFFFC0000 ),
- LONG2CHARS( 0xFFF80000 ),
- LONG2CHARS( 0xFFF00000 ),
- LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0xFFC00000 ),
- LONG2CHARS( 0xFF800000 ),
- LONG2CHARS( 0xFF000000 ),
- LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0xFC000000 ),
- LONG2CHARS( 0xF8000000 ),
- LONG2CHARS( 0xF0000000 ),
- LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0xC0000000 ),
- LONG2CHARS( 0x80000000 ),
- LONG2CHARS( 0x00000000 )
- };
-
-PixelType endpartial[33] =
- {
- LONG2CHARS( 0xFFFFFFFF ),
- LONG2CHARS( 0x00000001 ),
- LONG2CHARS( 0x00000003 ),
- LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x0000000F ),
- LONG2CHARS( 0x0000001F ),
- LONG2CHARS( 0x0000003F ),
- LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x000000FF ),
- LONG2CHARS( 0x000001FF ),
- LONG2CHARS( 0x000003FF ),
- LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x00000FFF ),
- LONG2CHARS( 0x00001FFF ),
- LONG2CHARS( 0x00003FFF ),
- LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x0000FFFF ),
- LONG2CHARS( 0x0001FFFF ),
- LONG2CHARS( 0x0003FFFF ),
- LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x000FFFFF ),
- LONG2CHARS( 0x001FFFFF ),
- LONG2CHARS( 0x003FFFFF ),
- LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x00FFFFFF ),
- LONG2CHARS( 0x01FFFFFF ),
- LONG2CHARS( 0x03FFFFFF ),
- LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x0FFFFFFF ),
- LONG2CHARS( 0x1FFFFFFF ),
- LONG2CHARS( 0x3FFFFFFF ),
- LONG2CHARS( 0x7FFFFFFF ),
- LONG2CHARS( 0xFFFFFFFF )
- };
-#endif
-
-#endif /* ifndef LOWMEMFTPT */
-
-PixelType partmasks[PPW][PPW] = {
- {LONG2CHARS( 0xFFFFFFFF ), LONG2CHARS( 0x00000001 ), LONG2CHARS( 0x00000003 ), LONG2CHARS( 0x00000007 ),
- LONG2CHARS( 0x0000000F ), LONG2CHARS( 0x0000001F ), LONG2CHARS( 0x0000003F ), LONG2CHARS( 0x0000007F ),
- LONG2CHARS( 0x000000FF ), LONG2CHARS( 0x000001FF ), LONG2CHARS( 0x000003FF ), LONG2CHARS( 0x000007FF ),
- LONG2CHARS( 0x00000FFF ), LONG2CHARS( 0x00001FFF ), LONG2CHARS( 0x00003FFF ), LONG2CHARS( 0x00007FFF ),
- LONG2CHARS( 0x0000FFFF ), LONG2CHARS( 0x0001FFFF ), LONG2CHARS( 0x0003FFFF ), LONG2CHARS( 0x0007FFFF ),
- LONG2CHARS( 0x000FFFFF ), LONG2CHARS( 0x001FFFFF ), LONG2CHARS( 0x003FFFFF ), LONG2CHARS( 0x007FFFFF ),
- LONG2CHARS( 0x00FFFFFF ), LONG2CHARS( 0x01FFFFFF ), LONG2CHARS( 0x03FFFFFF ), LONG2CHARS( 0x07FFFFFF ),
- LONG2CHARS( 0x0FFFFFFF ), LONG2CHARS( 0x1FFFFFFF ), LONG2CHARS( 0x3FFFFFFF ), LONG2CHARS( 0x7FFFFFFF )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000002 ), LONG2CHARS( 0x00000006 ), LONG2CHARS( 0x0000000E ),
- LONG2CHARS( 0x0000001E ), LONG2CHARS( 0x0000003E ), LONG2CHARS( 0x0000007E ), LONG2CHARS( 0x000000FE ),
- LONG2CHARS( 0x000001FE ), LONG2CHARS( 0x000003FE ), LONG2CHARS( 0x000007FE ), LONG2CHARS( 0x00000FFE ),
- LONG2CHARS( 0x00001FFE ), LONG2CHARS( 0x00003FFE ), LONG2CHARS( 0x00007FFE ), LONG2CHARS( 0x0000FFFE ),
- LONG2CHARS( 0x0001FFFE ), LONG2CHARS( 0x0003FFFE ), LONG2CHARS( 0x0007FFFE ), LONG2CHARS( 0x000FFFFE ),
- LONG2CHARS( 0x001FFFFE ), LONG2CHARS( 0x003FFFFE ), LONG2CHARS( 0x007FFFFE ), LONG2CHARS( 0x00FFFFFE ),
- LONG2CHARS( 0x01FFFFFE ), LONG2CHARS( 0x03FFFFFE ), LONG2CHARS( 0x07FFFFFE ), LONG2CHARS( 0x0FFFFFFE ),
- LONG2CHARS( 0x1FFFFFFE ), LONG2CHARS( 0x3FFFFFFE ), LONG2CHARS( 0x7FFFFFFE ), LONG2CHARS( 0xFFFFFFFE )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000004 ), LONG2CHARS( 0x0000000C ), LONG2CHARS( 0x0000001C ),
- LONG2CHARS( 0x0000003C ), LONG2CHARS( 0x0000007C ), LONG2CHARS( 0x000000FC ), LONG2CHARS( 0x000001FC ),
- LONG2CHARS( 0x000003FC ), LONG2CHARS( 0x000007FC ), LONG2CHARS( 0x00000FFC ), LONG2CHARS( 0x00001FFC ),
- LONG2CHARS( 0x00003FFC ), LONG2CHARS( 0x00007FFC ), LONG2CHARS( 0x0000FFFC ), LONG2CHARS( 0x0001FFFC ),
- LONG2CHARS( 0x0003FFFC ), LONG2CHARS( 0x0007FFFC ), LONG2CHARS( 0x000FFFFC ), LONG2CHARS( 0x001FFFFC ),
- LONG2CHARS( 0x003FFFFC ), LONG2CHARS( 0x007FFFFC ), LONG2CHARS( 0x00FFFFFC ), LONG2CHARS( 0x01FFFFFC ),
- LONG2CHARS( 0x03FFFFFC ), LONG2CHARS( 0x07FFFFFC ), LONG2CHARS( 0x0FFFFFFC ), LONG2CHARS( 0x1FFFFFFC ),
- LONG2CHARS( 0x3FFFFFFC ), LONG2CHARS( 0x7FFFFFFC ), LONG2CHARS( 0xFFFFFFFC ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000008 ), LONG2CHARS( 0x00000018 ), LONG2CHARS( 0x00000038 ),
- LONG2CHARS( 0x00000078 ), LONG2CHARS( 0x000000F8 ), LONG2CHARS( 0x000001F8 ), LONG2CHARS( 0x000003F8 ),
- LONG2CHARS( 0x000007F8 ), LONG2CHARS( 0x00000FF8 ), LONG2CHARS( 0x00001FF8 ), LONG2CHARS( 0x00003FF8 ),
- LONG2CHARS( 0X00007FF8 ), LONG2CHARS( 0x0000FFF8 ), LONG2CHARS( 0x0001FFF8 ), LONG2CHARS( 0x0003FFF8 ),
- LONG2CHARS( 0X0007FFF8 ), LONG2CHARS( 0x000FFFF8 ), LONG2CHARS( 0x001FFFF8 ), LONG2CHARS( 0x003FFFF8 ),
- LONG2CHARS( 0X007FFFF8 ), LONG2CHARS( 0x00FFFFF8 ), LONG2CHARS( 0x01FFFFF8 ), LONG2CHARS( 0x03FFFFF8 ),
- LONG2CHARS( 0X07FFFFF8 ), LONG2CHARS( 0x0FFFFFF8 ), LONG2CHARS( 0x1FFFFFF8 ), LONG2CHARS( 0x3FFFFFF8 ),
- LONG2CHARS( 0X7FFFFFF8 ), LONG2CHARS( 0xFFFFFFF8 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000010 ), LONG2CHARS( 0x00000030 ), LONG2CHARS( 0x00000070 ),
- LONG2CHARS( 0X000000F0 ), LONG2CHARS( 0x000001F0 ), LONG2CHARS( 0x000003F0 ), LONG2CHARS( 0x000007F0 ),
- LONG2CHARS( 0X00000FF0 ), LONG2CHARS( 0x00001FF0 ), LONG2CHARS( 0x00003FF0 ), LONG2CHARS( 0x00007FF0 ),
- LONG2CHARS( 0X0000FFF0 ), LONG2CHARS( 0x0001FFF0 ), LONG2CHARS( 0x0003FFF0 ), LONG2CHARS( 0x0007FFF0 ),
- LONG2CHARS( 0X000FFFF0 ), LONG2CHARS( 0x001FFFF0 ), LONG2CHARS( 0x003FFFF0 ), LONG2CHARS( 0x007FFFF0 ),
- LONG2CHARS( 0X00FFFFF0 ), LONG2CHARS( 0x01FFFFF0 ), LONG2CHARS( 0x03FFFFF0 ), LONG2CHARS( 0x07FFFFF0 ),
- LONG2CHARS( 0X0FFFFFF0 ), LONG2CHARS( 0x1FFFFFF0 ), LONG2CHARS( 0x3FFFFFF0 ), LONG2CHARS( 0x7FFFFFF0 ),
- LONG2CHARS( 0XFFFFFFF0 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000020 ), LONG2CHARS( 0x00000060 ), LONG2CHARS( 0x000000E0 ),
- LONG2CHARS( 0X000001E0 ), LONG2CHARS( 0x000003E0 ), LONG2CHARS( 0x000007E0 ), LONG2CHARS( 0x00000FE0 ),
- LONG2CHARS( 0X00001FE0 ), LONG2CHARS( 0x00003FE0 ), LONG2CHARS( 0x00007FE0 ), LONG2CHARS( 0x0000FFE0 ),
- LONG2CHARS( 0X0001FFE0 ), LONG2CHARS( 0x0003FFE0 ), LONG2CHARS( 0x0007FFE0 ), LONG2CHARS( 0x000FFFE0 ),
- LONG2CHARS( 0X001FFFE0 ), LONG2CHARS( 0x003FFFE0 ), LONG2CHARS( 0x007FFFE0 ), LONG2CHARS( 0x00FFFFE0 ),
- LONG2CHARS( 0X01FFFFE0 ), LONG2CHARS( 0x03FFFFE0 ), LONG2CHARS( 0x07FFFFE0 ), LONG2CHARS( 0x0FFFFFE0 ),
- LONG2CHARS( 0X1FFFFFE0 ), LONG2CHARS( 0x3FFFFFE0 ), LONG2CHARS( 0x7FFFFFE0 ), LONG2CHARS( 0xFFFFFFE0 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000040 ), LONG2CHARS( 0x000000C0 ), LONG2CHARS( 0x000001C0 ),
- LONG2CHARS( 0X000003C0 ), LONG2CHARS( 0x000007C0 ), LONG2CHARS( 0x00000FC0 ), LONG2CHARS( 0x00001FC0 ),
- LONG2CHARS( 0X00003FC0 ), LONG2CHARS( 0x00007FC0 ), LONG2CHARS( 0x0000FFC0 ), LONG2CHARS( 0x0001FFC0 ),
- LONG2CHARS( 0X0003FFC0 ), LONG2CHARS( 0x0007FFC0 ), LONG2CHARS( 0x000FFFC0 ), LONG2CHARS( 0x001FFFC0 ),
- LONG2CHARS( 0X003FFFC0 ), LONG2CHARS( 0x007FFFC0 ), LONG2CHARS( 0x00FFFFC0 ), LONG2CHARS( 0x01FFFFC0 ),
- LONG2CHARS( 0X03FFFFC0 ), LONG2CHARS( 0x07FFFFC0 ), LONG2CHARS( 0x0FFFFFC0 ), LONG2CHARS( 0x1FFFFFC0 ),
- LONG2CHARS( 0X3FFFFFC0 ), LONG2CHARS( 0x7FFFFFC0 ), LONG2CHARS( 0xFFFFFFC0 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000080 ), LONG2CHARS( 0x00000180 ), LONG2CHARS( 0x00000380 ),
- LONG2CHARS( 0X00000780 ), LONG2CHARS( 0x00000F80 ), LONG2CHARS( 0x00001F80 ), LONG2CHARS( 0x00003F80 ),
- LONG2CHARS( 0X00007F80 ), LONG2CHARS( 0x0000FF80 ), LONG2CHARS( 0x0001FF80 ), LONG2CHARS( 0x0003FF80 ),
- LONG2CHARS( 0X0007FF80 ), LONG2CHARS( 0x000FFF80 ), LONG2CHARS( 0x001FFF80 ), LONG2CHARS( 0x003FFF80 ),
- LONG2CHARS( 0X007FFF80 ), LONG2CHARS( 0x00FFFF80 ), LONG2CHARS( 0x01FFFF80 ), LONG2CHARS( 0x03FFFF80 ),
- LONG2CHARS( 0X07FFFF80 ), LONG2CHARS( 0x0FFFFF80 ), LONG2CHARS( 0x1FFFFF80 ), LONG2CHARS( 0x3FFFFF80 ),
- LONG2CHARS( 0X7FFFFF80 ), LONG2CHARS( 0xFFFFFF80 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000100 ), LONG2CHARS( 0x00000300 ), LONG2CHARS( 0x00000700 ),
- LONG2CHARS( 0X00000F00 ), LONG2CHARS( 0x00001F00 ), LONG2CHARS( 0x00003F00 ), LONG2CHARS( 0x00007F00 ),
- LONG2CHARS( 0X0000FF00 ), LONG2CHARS( 0x0001FF00 ), LONG2CHARS( 0x0003FF00 ), LONG2CHARS( 0x0007FF00 ),
- LONG2CHARS( 0X000FFF00 ), LONG2CHARS( 0x001FFF00 ), LONG2CHARS( 0x003FFF00 ), LONG2CHARS( 0x007FFF00 ),
- LONG2CHARS( 0X00FFFF00 ), LONG2CHARS( 0x01FFFF00 ), LONG2CHARS( 0x03FFFF00 ), LONG2CHARS( 0x07FFFF00 ),
- LONG2CHARS( 0X0FFFFF00 ), LONG2CHARS( 0x1FFFFF00 ), LONG2CHARS( 0x3FFFFF00 ), LONG2CHARS( 0x7FFFFF00 ),
- LONG2CHARS( 0XFFFFFF00 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000200 ), LONG2CHARS( 0x00000600 ), LONG2CHARS( 0x00000E00 ),
- LONG2CHARS( 0X00001E00 ), LONG2CHARS( 0x00003E00 ), LONG2CHARS( 0x00007E00 ), LONG2CHARS( 0x0000FE00 ),
- LONG2CHARS( 0X0001FE00 ), LONG2CHARS( 0x0003FE00 ), LONG2CHARS( 0x0007FE00 ), LONG2CHARS( 0x000FFE00 ),
- LONG2CHARS( 0X001FFE00 ), LONG2CHARS( 0x003FFE00 ), LONG2CHARS( 0x007FFE00 ), LONG2CHARS( 0x00FFFE00 ),
- LONG2CHARS( 0X01FFFE00 ), LONG2CHARS( 0x03FFFE00 ), LONG2CHARS( 0x07FFFE00 ), LONG2CHARS( 0x0FFFFE00 ),
- LONG2CHARS( 0X1FFFFE00 ), LONG2CHARS( 0x3FFFFE00 ), LONG2CHARS( 0x7FFFFE00 ), LONG2CHARS( 0xFFFFFE00 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000400 ), LONG2CHARS( 0x00000C00 ), LONG2CHARS( 0x00001C00 ),
- LONG2CHARS( 0X00003C00 ), LONG2CHARS( 0x00007C00 ), LONG2CHARS( 0x0000FC00 ), LONG2CHARS( 0x0001FC00 ),
- LONG2CHARS( 0X0003FC00 ), LONG2CHARS( 0x0007FC00 ), LONG2CHARS( 0x000FFC00 ), LONG2CHARS( 0x001FFC00 ),
- LONG2CHARS( 0X003FFC00 ), LONG2CHARS( 0x007FFC00 ), LONG2CHARS( 0x00FFFC00 ), LONG2CHARS( 0x01FFFC00 ),
- LONG2CHARS( 0X03FFFC00 ), LONG2CHARS( 0x07FFFC00 ), LONG2CHARS( 0x0FFFFC00 ), LONG2CHARS( 0x1FFFFC00 ),
- LONG2CHARS( 0X3FFFFC00 ), LONG2CHARS( 0x7FFFFC00 ), LONG2CHARS( 0xFFFFFC00 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000800 ), LONG2CHARS( 0x00001800 ), LONG2CHARS( 0x00003800 ),
- LONG2CHARS( 0X00007800 ), LONG2CHARS( 0x0000F800 ), LONG2CHARS( 0x0001F800 ), LONG2CHARS( 0x0003F800 ),
- LONG2CHARS( 0X0007F800 ), LONG2CHARS( 0x000FF800 ), LONG2CHARS( 0x001FF800 ), LONG2CHARS( 0x003FF800 ),
- LONG2CHARS( 0X007FF800 ), LONG2CHARS( 0x00FFF800 ), LONG2CHARS( 0x01FFF800 ), LONG2CHARS( 0x03FFF800 ),
- LONG2CHARS( 0X07FFF800 ), LONG2CHARS( 0x0FFFF800 ), LONG2CHARS( 0x1FFFF800 ), LONG2CHARS( 0x3FFFF800 ),
- LONG2CHARS( 0X7FFFF800 ), LONG2CHARS( 0xFFFFF800 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00001000 ), LONG2CHARS( 0x00003000 ), LONG2CHARS( 0x00007000 ),
- LONG2CHARS( 0X0000F000 ), LONG2CHARS( 0x0001F000 ), LONG2CHARS( 0x0003F000 ), LONG2CHARS( 0x0007F000 ),
- LONG2CHARS( 0X000FF000 ), LONG2CHARS( 0x001FF000 ), LONG2CHARS( 0x003FF000 ), LONG2CHARS( 0x007FF000 ),
- LONG2CHARS( 0X00FFF000 ), LONG2CHARS( 0x01FFF000 ), LONG2CHARS( 0x03FFF000 ), LONG2CHARS( 0x07FFF000 ),
- LONG2CHARS( 0X0FFFF000 ), LONG2CHARS( 0x1FFFF000 ), LONG2CHARS( 0x3FFFF000 ), LONG2CHARS( 0x7FFFF000 ),
- LONG2CHARS( 0XFFFFF000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00002000 ), LONG2CHARS( 0x00006000 ), LONG2CHARS( 0x0000E000 ),
- LONG2CHARS( 0X0001E000 ), LONG2CHARS( 0x0003E000 ), LONG2CHARS( 0x0007E000 ), LONG2CHARS( 0x000FE000 ),
- LONG2CHARS( 0X001FE000 ), LONG2CHARS( 0x003FE000 ), LONG2CHARS( 0x007FE000 ), LONG2CHARS( 0x00FFE000 ),
- LONG2CHARS( 0X01FFE000 ), LONG2CHARS( 0x03FFE000 ), LONG2CHARS( 0x07FFE000 ), LONG2CHARS( 0x0FFFE000 ),
- LONG2CHARS( 0X1FFFE000 ), LONG2CHARS( 0x3FFFE000 ), LONG2CHARS( 0x7FFFE000 ), LONG2CHARS( 0xFFFFE000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00004000 ), LONG2CHARS( 0x0000C000 ), LONG2CHARS( 0x0001C000 ),
- LONG2CHARS( 0X0003C000 ), LONG2CHARS( 0x0007C000 ), LONG2CHARS( 0x000FC000 ), LONG2CHARS( 0x001FC000 ),
- LONG2CHARS( 0X003FC000 ), LONG2CHARS( 0x007FC000 ), LONG2CHARS( 0x00FFC000 ), LONG2CHARS( 0x01FFC000 ),
- LONG2CHARS( 0X03FFC000 ), LONG2CHARS( 0x07FFC000 ), LONG2CHARS( 0x0FFFC000 ), LONG2CHARS( 0x1FFFC000 ),
- LONG2CHARS( 0X3FFFC000 ), LONG2CHARS( 0x7FFFC000 ), LONG2CHARS( 0xFFFFC000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00008000 ), LONG2CHARS( 0x00018000 ), LONG2CHARS( 0x00038000 ),
- LONG2CHARS( 0X00078000 ), LONG2CHARS( 0x000F8000 ), LONG2CHARS( 0x001F8000 ), LONG2CHARS( 0x003F8000 ),
- LONG2CHARS( 0X007F8000 ), LONG2CHARS( 0x00FF8000 ), LONG2CHARS( 0x01FF8000 ), LONG2CHARS( 0x03FF8000 ),
- LONG2CHARS( 0X07FF8000 ), LONG2CHARS( 0x0FFF8000 ), LONG2CHARS( 0x1FFF8000 ), LONG2CHARS( 0x3FFF8000 ),
- LONG2CHARS( 0X7FFF8000 ), LONG2CHARS( 0xFFFF8000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00010000 ), LONG2CHARS( 0x00030000 ), LONG2CHARS( 0x00070000 ),
- LONG2CHARS( 0X000F0000 ), LONG2CHARS( 0x001F0000 ), LONG2CHARS( 0x003F0000 ), LONG2CHARS( 0x007F0000 ),
- LONG2CHARS( 0X00FF0000 ), LONG2CHARS( 0x01FF0000 ), LONG2CHARS( 0x03FF0000 ), LONG2CHARS( 0x07FF0000 ),
- LONG2CHARS( 0X0FFF0000 ), LONG2CHARS( 0x1FFF0000 ), LONG2CHARS( 0x3FFF0000 ), LONG2CHARS( 0x7FFF0000 ),
- LONG2CHARS( 0XFFFF0000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00020000 ), LONG2CHARS( 0x00060000 ), LONG2CHARS( 0x000E0000 ),
- LONG2CHARS( 0X001E0000 ), LONG2CHARS( 0x003E0000 ), LONG2CHARS( 0x007E0000 ), LONG2CHARS( 0x00FE0000 ),
- LONG2CHARS( 0X01FE0000 ), LONG2CHARS( 0x03FE0000 ), LONG2CHARS( 0x07FE0000 ), LONG2CHARS( 0x0FFE0000 ),
- LONG2CHARS( 0X1FFE0000 ), LONG2CHARS( 0x3FFE0000 ), LONG2CHARS( 0x7FFE0000 ), LONG2CHARS( 0xFFFE0000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00040000 ), LONG2CHARS( 0x000C0000 ), LONG2CHARS( 0x001C0000 ),
- LONG2CHARS( 0X003C0000 ), LONG2CHARS( 0x007C0000 ), LONG2CHARS( 0x00FC0000 ), LONG2CHARS( 0x01FC0000 ),
- LONG2CHARS( 0X03FC0000 ), LONG2CHARS( 0x07FC0000 ), LONG2CHARS( 0x0FFC0000 ), LONG2CHARS( 0x1FFC0000 ),
- LONG2CHARS( 0X3FFC0000 ), LONG2CHARS( 0x7FFC0000 ), LONG2CHARS( 0xFFFC0000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00080000 ), LONG2CHARS( 0x00180000 ), LONG2CHARS( 0x00380000 ),
- LONG2CHARS( 0X00780000 ), LONG2CHARS( 0x00F80000 ), LONG2CHARS( 0x01F80000 ), LONG2CHARS( 0x03F80000 ),
- LONG2CHARS( 0X07F80000 ), LONG2CHARS( 0x0FF80000 ), LONG2CHARS( 0x1FF80000 ), LONG2CHARS( 0x3FF80000 ),
- LONG2CHARS( 0X7FF80000 ), LONG2CHARS( 0xFFF80000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00100000 ), LONG2CHARS( 0x00300000 ), LONG2CHARS( 0x00700000 ),
- LONG2CHARS( 0X00F00000 ), LONG2CHARS( 0x01F00000 ), LONG2CHARS( 0x03F00000 ), LONG2CHARS( 0x07F00000 ),
- LONG2CHARS( 0X0FF00000 ), LONG2CHARS( 0x1FF00000 ), LONG2CHARS( 0x3FF00000 ), LONG2CHARS( 0x7FF00000 ),
- LONG2CHARS( 0XFFF00000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00200000 ), LONG2CHARS( 0x00600000 ), LONG2CHARS( 0x00E00000 ),
- LONG2CHARS( 0X01E00000 ), LONG2CHARS( 0x03E00000 ), LONG2CHARS( 0x07E00000 ), LONG2CHARS( 0x0FE00000 ),
- LONG2CHARS( 0X1FE00000 ), LONG2CHARS( 0x3FE00000 ), LONG2CHARS( 0x7FE00000 ), LONG2CHARS( 0xFFE00000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00400000 ), LONG2CHARS( 0x00C00000 ), LONG2CHARS( 0x01C00000 ),
- LONG2CHARS( 0X03C00000 ), LONG2CHARS( 0x07C00000 ), LONG2CHARS( 0x0FC00000 ), LONG2CHARS( 0x1FC00000 ),
- LONG2CHARS( 0X3FC00000 ), LONG2CHARS( 0x7FC00000 ), LONG2CHARS( 0xFFC00000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00800000 ), LONG2CHARS( 0x01800000 ), LONG2CHARS( 0x03800000 ),
- LONG2CHARS( 0X07800000 ), LONG2CHARS( 0x0F800000 ), LONG2CHARS( 0x1F800000 ), LONG2CHARS( 0x3F800000 ),
- LONG2CHARS( 0X7F800000 ), LONG2CHARS( 0xFF800000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x01000000 ), LONG2CHARS( 0x03000000 ), LONG2CHARS( 0x07000000 ),
- LONG2CHARS( 0X0F000000 ), LONG2CHARS( 0x1F000000 ), LONG2CHARS( 0x3F000000 ), LONG2CHARS( 0x7F000000 ),
- LONG2CHARS( 0XFF000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x02000000 ), LONG2CHARS( 0x06000000 ), LONG2CHARS( 0x0E000000 ),
- LONG2CHARS( 0X1E000000 ), LONG2CHARS( 0x3E000000 ), LONG2CHARS( 0x7E000000 ), LONG2CHARS( 0xFE000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x04000000 ), LONG2CHARS( 0x0C000000 ), LONG2CHARS( 0x1C000000 ),
- LONG2CHARS( 0X3C000000 ), LONG2CHARS( 0x7C000000 ), LONG2CHARS( 0xFC000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x08000000 ), LONG2CHARS( 0x18000000 ), LONG2CHARS( 0x38000000 ),
- LONG2CHARS( 0X78000000 ), LONG2CHARS( 0xF8000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x10000000 ), LONG2CHARS( 0x30000000 ), LONG2CHARS( 0x70000000 ),
- LONG2CHARS( 0XF0000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x20000000 ), LONG2CHARS( 0x60000000 ), LONG2CHARS( 0xE0000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x40000000 ), LONG2CHARS( 0xC0000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
- {LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x80000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ),
- LONG2CHARS( 0X00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 ), LONG2CHARS( 0x00000000 )},
-};
-
-#endif /* BITMAP_BIT_ORDER */
-
-/* used for masking bits in bresenham lines
- mask[n] is used to mask out all but bit n in a longword (n is a
-screen position).
- rmask[n] is used to mask out the single bit at position n (n
-is a screen posiotion.)
-*/
-
-#define _1_ ((PixelType)1)
-
-#if (BITMAP_BIT_ORDER == MSBFirst)
-PixelType mask[PPW] =
- {
- LONG2CHARS( _1_<<31 ), LONG2CHARS( 1<<30 ), LONG2CHARS( 1<<29 ),
- LONG2CHARS( 1<<28 ), LONG2CHARS( 1<<27 ), LONG2CHARS( 1<<26 ),
- LONG2CHARS( 1<<25 ), LONG2CHARS( 1<<24 ), LONG2CHARS( 1<<23 ),
- LONG2CHARS( 1<<22 ), LONG2CHARS( 1<<21 ), LONG2CHARS( 1<<20 ),
- LONG2CHARS( 1<<19 ), LONG2CHARS( 1<<18 ), LONG2CHARS( 1<<17 ),
- LONG2CHARS( 1<<16 ), LONG2CHARS( 1<<15 ), LONG2CHARS( 1<<14 ),
- LONG2CHARS( 1<<13 ), LONG2CHARS( 1<<12 ), LONG2CHARS( 1<<11 ),
- LONG2CHARS( 1<<10 ), LONG2CHARS( 1<<9 ), LONG2CHARS( 1<<8 ),
- LONG2CHARS( 1<<7 ), LONG2CHARS( 1<<6 ), LONG2CHARS( 1<<5 ),
- LONG2CHARS( 1<<4 ), LONG2CHARS( 1<<3 ), LONG2CHARS( 1<<2 ),
- LONG2CHARS( 1<<1 ), LONG2CHARS( 1<<0 )
- };
-
-PixelType rmask[] =
- {
- 0xffffffff ^ LONG2CHARS( _1_<<31 ), 0xffffffff ^ LONG2CHARS( 1<<30 ),
- 0xffffffff ^ LONG2CHARS( 1<<29 ), 0xffffffff ^ LONG2CHARS( 1<<28),
- 0xffffffff ^ LONG2CHARS( 1<<27 ), 0xffffffff ^ LONG2CHARS( 1<<26),
- 0xffffffff ^ LONG2CHARS( 1<<25 ), 0xffffffff ^ LONG2CHARS( 1<<24 ),
- 0xffffffff ^ LONG2CHARS( 1<<23 ), 0xffffffff ^ LONG2CHARS( 1<<22),
- 0xffffffff ^ LONG2CHARS( 1<<21 ), 0xffffffff ^ LONG2CHARS( 1<<20),
- 0xffffffff ^ LONG2CHARS( 1<<19 ), 0xffffffff ^ LONG2CHARS( 1<<18 ),
- 0xffffffff ^ LONG2CHARS( 1<<17 ), 0xffffffff ^ LONG2CHARS( 1<<16),
- 0xffffffff ^ LONG2CHARS( 1<<15 ), 0xffffffff ^ LONG2CHARS( 1<<14),
- 0xffffffff ^ LONG2CHARS( 1<<13 ), 0xffffffff ^ LONG2CHARS( 1<<12 ),
- 0xffffffff ^ LONG2CHARS( 1<<11 ), 0xffffffff ^ LONG2CHARS( 1<<10),
- 0xffffffff ^ LONG2CHARS( 1<<9 ), 0xffffffff ^ LONG2CHARS( 1<<8),
- 0xffffffff ^ LONG2CHARS( 1<<7 ), 0xffffffff ^ LONG2CHARS( 1<<6),
- 0xffffffff ^ LONG2CHARS( 1<<5 ), 0xffffffff ^ LONG2CHARS( 1<<4),
- 0xffffffff ^ LONG2CHARS( 1<<3 ), 0xffffffff ^ LONG2CHARS( 1<<2),
- 0xffffffff ^ LONG2CHARS( 1<<1 ), 0xffffffff ^ LONG2CHARS( 1<<0)
- };
-#else /* LSBFirst */
-PixelType mask[] =
- {
- LONG2CHARS( 1<<0 ), LONG2CHARS( 1<<1 ), LONG2CHARS( 1<<2),
- LONG2CHARS( 1<<3 ), LONG2CHARS( 1<<4 ), LONG2CHARS( 1<<5),
- LONG2CHARS( 1<<6 ), LONG2CHARS( 1<<7 ), LONG2CHARS( 1<<8),
- LONG2CHARS( 1<<9 ), LONG2CHARS( 1<<10 ), LONG2CHARS( 1<<11),
- LONG2CHARS( 1<<12 ), LONG2CHARS( 1<<13 ), LONG2CHARS( 1<<14),
- LONG2CHARS( 1<<15 ), LONG2CHARS( 1<<16 ), LONG2CHARS( 1<<17),
- LONG2CHARS( 1<<18 ), LONG2CHARS( 1<<19 ), LONG2CHARS( 1<<20),
- LONG2CHARS( 1<<21 ), LONG2CHARS( 1<<22 ), LONG2CHARS( 1<<23),
- LONG2CHARS( 1<<24 ), LONG2CHARS( 1<<25 ), LONG2CHARS( 1<<26),
- LONG2CHARS( 1<<27 ), LONG2CHARS( 1<<28 ), LONG2CHARS( 1<<29),
- LONG2CHARS( 1<<30 ), LONG2CHARS( _1_<<31 )
- };
-PixelType rmask[] =
- {
- 0xffffffff ^ LONG2CHARS( 1<<0), 0xffffffff ^ LONG2CHARS( 1<<1),
- 0xffffffff ^ LONG2CHARS( 1<<2), 0xffffffff ^ LONG2CHARS( 1<<3),
- 0xffffffff ^ LONG2CHARS( 1<<4), 0xffffffff ^ LONG2CHARS( 1<<5),
- 0xffffffff ^ LONG2CHARS( 1<<6), 0xffffffff ^ LONG2CHARS( 1<<7),
- 0xffffffff ^ LONG2CHARS( 1<<8), 0xffffffff ^ LONG2CHARS( 1<<9),
- 0xffffffff ^ LONG2CHARS( 1<<10), 0xffffffff ^ LONG2CHARS( 1<<11),
- 0xffffffff ^ LONG2CHARS( 1<<12), 0xffffffff ^ LONG2CHARS( 1<<13),
- 0xffffffff ^ LONG2CHARS( 1<<14), 0xffffffff ^ LONG2CHARS( 1<<15),
- 0xffffffff ^ LONG2CHARS( 1<<16), 0xffffffff ^ LONG2CHARS( 1<<17),
- 0xffffffff ^ LONG2CHARS( 1<<18), 0xffffffff ^ LONG2CHARS( 1<<19),
- 0xffffffff ^ LONG2CHARS( 1<<20), 0xffffffff ^ LONG2CHARS( 1<<21),
- 0xffffffff ^ LONG2CHARS( 1<<22), 0xffffffff ^ LONG2CHARS( 1<<23),
- 0xffffffff ^ LONG2CHARS( 1<<24), 0xffffffff ^ LONG2CHARS( 1<<25),
- 0xffffffff ^ LONG2CHARS( 1<<26), 0xffffffff ^ LONG2CHARS( 1<<27),
- 0xffffffff ^ LONG2CHARS( 1<<28), 0xffffffff ^ LONG2CHARS( 1<<29),
- 0xffffffff ^ LONG2CHARS( 1<<30), 0xffffffff ^ LONG2CHARS( _1_<<31)
- };
-#endif /* BITMAP_BIT_ORDER */
-
-#undef _1_
-
-/*
- * Merge raster ops for full src + dest + plane mask
- *
- * More clever usage of boolean arithmetic to reduce the
- * cost of complex raster ops. This is for bitblt and
- * reduces all 16 raster ops + planemask to a single
- * expression:
- *
- * dst = dst & (src & ca1 ^ cx1) ^ (src & ca2 ^ cx2)
- *
- * The array below contains the values for c?? for each
- * raster op. Those values are further modified by
- * planemasks on multi-plane displays as follows:
- *
- * ca1 &= pm;
- * cx1 |= ~pm;
- * ca2 &= pm;
- * cx2 &= pm;
- */
-
-#include "mergerop.h"
-
-#define O 0
-#define I ~((MfbBits)0)
-
-mergeRopRec mergeRopBits[16] = {
-{ O,O,O,O, }, /* clear 0x0 0 */
-{ I,O,O,O, }, /* and 0x1 src AND dst */
-{ I,O,I,O, }, /* andReverse 0x2 src AND NOT dst */
-{ O,O,I,O, }, /* copy 0x3 src */
-{ I,I,O,O, }, /* andInverted 0x4 NOT src AND dst */
-{ O,I,O,O, }, /* noop 0x5 dst */
-{ O,I,I,O, }, /* xor 0x6 src XOR dst */
-{ I,I,I,O, }, /* or 0x7 src OR dst */
-{ I,I,I,I, }, /* nor 0x8 NOT src AND NOT dst */
-{ O,I,I,I, }, /* equiv 0x9 NOT src XOR dst */
-{ O,I,O,I, }, /* invert 0xa NOT dst */
-{ I,I,O,I, }, /* orReverse 0xb src OR NOT dst */
-{ O,O,I,I, }, /* copyInverted 0xc NOT src */
-{ I,O,I,I, }, /* orInverted 0xd NOT src OR dst */
-{ I,O,O,I, }, /* nand 0xe NOT src OR NOT dst */
-{ O,O,O,I, }, /* set 0xf 1 */
-};
-
-#undef O
-#undef I
diff --git a/mfb/maskbits.h b/mfb/maskbits.h
deleted file mode 100644
index 711731660..000000000
--- a/mfb/maskbits.h
+++ /dev/null
@@ -1,680 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/maskbits.h,v 3.9 2003/02/18 21:30:00 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.1, 1/24/89 */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: maskbits.h,v 1.3 2000/08/17 19:53:34 cpqbld Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-
-/* the following notes use the following conventions:
-SCREEN LEFT SCREEN RIGHT
-in this file and maskbits.c, left and right refer to screen coordinates,
-NOT bit numbering in registers.
-
-starttab[n]
- bits[0,n-1] = 0 bits[n,PLST] = 1
-endtab[n] =
- bits[0,n-1] = 1 bits[n,PLST] = 0
-
-startpartial[], endpartial[]
- these are used as accelerators for doing putbits and masking out
-bits that are all contained between longword boudaries. the extra
-256 bytes of data seems a small price to pay -- code is smaller,
-and narrow things (e.g. window borders) go faster.
-
-the names may seem misleading; they are derived not from which end
-of the word the bits are turned on, but at which end of a scanline
-the table tends to be used.
-
-look at the tables and macros to understand boundary conditions.
-(careful readers will note that starttab[n] = ~endtab[n] for n != 0)
-
------------------------------------------------------------------------
-these two macros depend on the screen's bit ordering.
-in both of them x is a screen position. they are used to
-combine bits collected from multiple longwords into a
-single destination longword, and to unpack a single
-source longword into multiple destinations.
-
-SCRLEFT(dst, x)
- takes dst[x, PPW] and moves them to dst[0, PPW-x]
- the contents of the rest of dst are 0.
- this is a right shift on LSBFirst (forward-thinking)
- machines like the VAX, and left shift on MSBFirst
- (backwards) machines like the 680x0 and pc/rt.
-
-SCRRIGHT(dst, x)
- takes dst[0,x] and moves them to dst[PPW-x, PPW]
- the contents of the rest of dst are 0.
- this is a left shift on LSBFirst, right shift
- on MSBFirst.
-
-
-the remaining macros are cpu-independent; all bit order dependencies
-are built into the tables and the two macros above.
-
-maskbits(x, w, startmask, endmask, nlw)
- for a span of width w starting at position x, returns
-a mask for ragged bits at start, mask for ragged bits at end,
-and the number of whole longwords between the ends.
-
-maskpartialbits(x, w, mask)
- works like maskbits(), except all the bits are in the
- same longword (i.e. (x&PIM + w) <= PPW)
-
-maskPPWbits(x, w, startmask, endmask, nlw)
- as maskbits, but does not calculate nlw. it is used by
- mfbGlyphBlt to put down glyphs <= PPW bits wide.
-
--------------------------------------------------------------------
-
-NOTE
- any pointers passed to the following 4 macros are
- guranteed to be PPW-bit aligned.
- The only non-PPW-bit-aligned references ever made are
- to font glyphs, and those are made with getleftbits()
- and getshiftedleftbits (qq.v.)
-
- For 64-bit server, it is assumed that we will never have font padding
- of more than 4 bytes. The code uses int's to access the fonts
- intead of longs.
-
-getbits(psrc, x, w, dst)
- starting at position x in psrc (x < PPW), collect w
- bits and put them in the screen left portion of dst.
- psrc is a longword pointer. this may span longword boundaries.
- it special-cases fetching all w bits from one longword.
-
- +--------+--------+ +--------+
- | | m |n| | ==> | m |n| |
- +--------+--------+ +--------+
- x x+w 0 w
- psrc psrc+1 dst
- m = PPW - x
- n = w - m
-
- implementation:
- get m bits, move to screen-left of dst, zeroing rest of dst;
- get n bits from next word, move screen-right by m, zeroing
- lower m bits of word.
- OR the two things together.
-
-putbits(src, x, w, pdst)
- starting at position x in pdst, put down the screen-leftmost
- w bits of src. pdst is a longword pointer. this may
- span longword boundaries.
- it special-cases putting all w bits into the same longword.
-
- +--------+ +--------+--------+
- | m |n| | ==> | | m |n| |
- +--------+ +--------+--------+
- 0 w x x+w
- dst pdst pdst+1
- m = PPW - x
- n = w - m
-
- implementation:
- get m bits, shift screen-right by x, zero screen-leftmost x
- bits; zero rightmost m bits of *pdst and OR in stuff
- from before the semicolon.
- shift src screen-left by m, zero bits n-PPW;
- zero leftmost n bits of *(pdst+1) and OR in the
- stuff from before the semicolon.
-
-putbitsrop(src, x, w, pdst, ROP)
- like putbits but calls DoRop with the rasterop ROP (see mfb.h for
- DoRop)
-
-putbitsrrop(src, x, w, pdst, ROP)
- like putbits but calls DoRRop with the reduced rasterop ROP
- (see mfb.h for DoRRop)
-
------------------------------------------------------------------------
- The two macros below are used only for getting bits from glyphs
-in fonts, and glyphs in fonts are gotten only with the following two
-mcros.
- You should tune these macros toyour font format and cpu
-byte ordering.
-
-NOTE
-getleftbits(psrc, w, dst)
- get the leftmost w (w<=32) bits from *psrc and put them
- in dst. this is used by the mfbGlyphBlt code for glyphs
- <=PPW bits wide.
- psrc is declared (unsigned char *)
-
- psrc is NOT guaranteed to be PPW-bit aligned. on many
- machines this will cause problems, so there are several
- versions of this macro.
-
- this macro is called ONLY for getting bits from font glyphs,
- and depends on the server-natural font padding.
-
- for blazing text performance, you want this macro
- to touch memory as infrequently as possible (e.g.
- fetch longwords) and as efficiently as possible
- (e.g. don't fetch misaligned longwords)
-
-getshiftedleftbits(psrc, offset, w, dst)
- used by the font code; like getleftbits, but shifts the
- bits SCRLEFT by offset.
- this is implemented portably, calling getleftbits()
- and SCRLEFT().
- psrc is declared (unsigned char *).
-*/
-
-/* to match CFB and allow algorithm sharing ...
- * name mfb32 mfb64 explanation
- * ---- ------ ----- -----------
- * PGSZ 32 64 pixel group size (in bits; same as PPW for mfb)
- * PGSZB 4 8 pixel group size (in bytes)
- * PPW 32 64 pixels per word (pixels per pixel group)
- * PLST 31 63 index of last pixel in a word (should be PPW-1)
- * PIM 0x1f 0x3f pixel index mask (index within a pixel group)
- * PWSH 5 6 pixel-to-word shift (should be log2(PPW))
- *
- * The MFB_ versions are here so that cfb can include maskbits.h to get
- * the bitmap constants without conflicting with its own P* constants.
- *
- * Keith Packard (keithp@suse.com):
- * Note mfb64 is no longer supported; it requires DIX support
- * for realigning images which costs too much
- */
-
-/* warning: PixelType definition duplicated in mfb.h */
-#ifndef PixelType
-#define PixelType CARD32
-#endif /* PixelType */
-#ifndef MfbBits
-#define MfbBits CARD32
-#endif
-
-#define MFB_PGSZB 4
-#define MFB_PPW (MFB_PGSZB<<3) /* assuming 8 bits per byte */
-#define MFB_PGSZ MFB_PPW
-#define MFB_PLST (MFB_PPW-1)
-#define MFB_PIM MFB_PLST
-
-/* set PWSH = log2(PPW) using brute force */
-
-#if MFB_PPW == 32
-#define MFB_PWSH 5
-#endif /* MFB_PPW == 32 */
-
-extern PixelType starttab[];
-extern PixelType endtab[];
-extern PixelType partmasks[MFB_PPW][MFB_PPW];
-extern PixelType rmask[];
-extern PixelType mask[];
-
-#ifndef MFB_CONSTS_ONLY
-
-#define PGSZB MFB_PGSZB
-#define PPW MFB_PPW
-#define PGSZ MFB_PGSZ
-#define PLST MFB_PLST
-#define PIM MFB_PIM
-#define PWSH MFB_PWSH
-
-#define BitLeft(b,s) SCRLEFT(b,s)
-#define BitRight(b,s) SCRRIGHT(b,s)
-
-#ifdef XFree86Server
-#define LONG2CHARSSAMEORDER(x) ((MfbBits)(x))
-#define LONG2CHARSDIFFORDER( x ) ( ( ( ( x ) & (MfbBits)0x000000FF ) << 0x18 ) \
- | ( ( ( x ) & (MfbBits)0x0000FF00 ) << 0x08 ) \
- | ( ( ( x ) & (MfbBits)0x00FF0000 ) >> 0x08 ) \
- | ( ( ( x ) & (MfbBits)0xFF000000 ) >> 0x18 ) )
-#endif /* XFree86Server */
-
-#if (BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER)
-#define LONG2CHARS(x) ((MfbBits)(x))
-#else
-/*
- * the unsigned case below is for compilers like
- * the Danbury C and i386cc
- */
-#define LONG2CHARS( x ) ( ( ( ( x ) & (MfbBits)0x000000FF ) << 0x18 ) \
- | ( ( ( x ) & (MfbBits)0x0000FF00 ) << 0x08 ) \
- | ( ( ( x ) & (MfbBits)0x00FF0000 ) >> 0x08 ) \
- | ( ( ( x ) & (MfbBits)0xFF000000 ) >> 0x18 ) )
-#endif /* BITMAP_BIT_ORDER */
-
-#ifdef STRICT_ANSI_SHIFT
-#define SHL(x,y) ((y) >= PPW ? 0 : LONG2CHARS(LONG2CHARS(x) << (y)))
-#define SHR(x,y) ((y) >= PPW ? 0 : LONG2CHARS(LONG2CHARS(x) >> (y)))
-#else
-#define SHL(x,y) LONG2CHARS(LONG2CHARS(x) << (y))
-#define SHR(x,y) LONG2CHARS(LONG2CHARS(x) >> (y))
-#endif
-
-#if (BITMAP_BIT_ORDER == MSBFirst) /* pc/rt, 680x0 */
-#define SCRLEFT(lw, n) SHL((PixelType)(lw),(n))
-#define SCRRIGHT(lw, n) SHR((PixelType)(lw),(n))
-#else /* vax, intel */
-#define SCRLEFT(lw, n) SHR((PixelType)(lw),(n))
-#define SCRRIGHT(lw, n) SHL((PixelType)(lw),(n))
-#endif
-
-#define DoRRop(alu, src, dst) \
-(((alu) == RROP_BLACK) ? ((dst) & ~(src)) : \
- ((alu) == RROP_WHITE) ? ((dst) | (src)) : \
- ((alu) == RROP_INVERT) ? ((dst) ^ (src)) : \
- (dst))
-
-/* A generalized form of a x4 Duff's Device */
-#define Duff(counter, block) { \
- while (counter >= 4) {\
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- counter -= 4; \
- } \
- switch (counter & 3) { \
- case 3: { block; } \
- case 2: { block; } \
- case 1: { block; } \
- case 0: \
- counter = 0; \
- } \
-}
-
-#define maskbits(x, w, startmask, endmask, nlw) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM]; \
- if (startmask) \
- nlw = (((w) - (PPW - ((x) & PIM))) >> PWSH); \
- else \
- nlw = (w) >> PWSH;
-
-#define maskpartialbits(x, w, mask) \
- mask = partmasks[(x) & PIM][(w) & PIM];
-
-#define maskPPWbits(x, w, startmask, endmask) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM];
-
-#ifdef __GNUC__ /* XXX don't want for Alpha? */
-#ifdef vax
-#define FASTGETBITS(psrc,x,w,dst) \
- __asm ("extzv %1,%2,%3,%0" \
- : "=g" (dst) \
- : "g" (x), "g" (w), "m" (*(char *)(psrc)))
-#define getbits(psrc,x,w,dst) FASTGETBITS(psrc,x,w,dst)
-
-#define FASTPUTBITS(src, x, w, pdst) \
- __asm ("insv %3,%1,%2,%0" \
- : "=m" (*(char *)(pdst)) \
- : "g" (x), "g" (w), "g" (src))
-#define putbits(src, x, w, pdst) FASTPUTBITS(src, x, w, pdst)
-#endif /* vax */
-#ifdef mc68020
-#define FASTGETBITS(psrc, x, w, dst) \
- __asm ("bfextu %3{%1:%2},%0" \
- : "=d" (dst) : "di" (x), "di" (w), "o" (*(char *)(psrc)))
-
-#define getbits(psrc,x,w,dst) \
-{ \
- FASTGETBITS(psrc, x, w, dst);\
- dst = SHL(dst,(32-(w))); \
-}
-
-#define FASTPUTBITS(src, x, w, pdst) \
- __asm ("bfins %3,%0{%1:%2}" \
- : "=o" (*(char *)(pdst)) \
- : "di" (x), "di" (w), "d" (src), "0" (*(char *) (pdst)))
-
-#define putbits(src, x, w, pdst) FASTPUTBITS(SHR((src),32-(w)), x, w, pdst)
-
-#endif /* mc68020 */
-#endif /* __GNUC__ */
-
-/* The following flag is used to override a bugfix for sun 3/60+CG4 machines,
- */
-
-/* We don't need to be careful about this unless we're dealing with sun3's
- * We will default its usage for those who do not know anything, but will
- * override its effect if the machine doesn't look like a sun3
- */
-#if !defined(mc68020) || !defined(sun)
-#define NO_3_60_CG4
-#endif
-
-/* This is gross. We want to #define u_putbits as something which can be used
- * in the case of the 3/60+CG4, but if we use /bin/cc or are on another
- * machine type, we want nothing to do with u_putbits. What a hastle. Here
- * I used slo_putbits as something which either u_putbits or putbits could be
- * defined as.
- *
- * putbits gets it iff it is not already defined with FASTPUTBITS above.
- * u_putbits gets it if we have FASTPUTBITS (putbits) from above and have not
- * overridden the NO_3_60_CG4 flag.
- */
-
-#define slo_putbits(src, x, w, pdst) \
-{ \
- register int n = (x)+(w)-PPW; \
- \
- if (n <= 0) \
- { \
- register PixelType tmpmask; \
- maskpartialbits((x), (w), tmpmask); \
- *(pdst) = (*(pdst) & ~tmpmask) | \
- (SCRRIGHT(src, x) & tmpmask); \
- } \
- else \
- { \
- register int d = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | \
- (SCRLEFT(src, d) & endtab[n]); \
- } \
-}
-
-#if defined(putbits) && !defined(NO_3_60_CG4)
-#define u_putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst)
-#else
-#define u_putbits(src, x, w, pdst) putbits(src, x, w, pdst)
-#endif
-
-#if !defined(putbits)
-#define putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst)
-#endif
-
-/* Now if we have not gotten any really good bitfield macros, try some
- * moderately fast macros. Alas, I don't know how to do asm instructions
- * without gcc.
- */
-
-#ifndef getbits
-#define getbits(psrc, x, w, dst) \
-{ \
- dst = SCRLEFT(*(psrc), (x)); \
- if ( ((x) + (w)) > PPW) \
- dst |= (SCRRIGHT(*((psrc)+1), PPW-(x))); \
-}
-#endif
-
-/* We have to special-case putbitsrop because of 3/60+CG4 combos
- */
-
-#define u_putbitsrop(src, x, w, pdst, rop) \
-{\
- register PixelType t1, t2; \
- register int n = (x)+(w)-PPW; \
- \
- t1 = SCRRIGHT((src), (x)); \
- DoRop(t2, rop, t1, *(pdst)); \
- \
- if (n <= 0) \
- { \
- register PixelType tmpmask; \
- \
- maskpartialbits((x), (w), tmpmask); \
- *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
- } \
- else \
- { \
- int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
- t1 = SCRLEFT((src), m); \
- DoRop(t2, rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
- } \
-}
-
-/* If our getbits and putbits are FAST enough,
- * do this brute force, it's faster
- */
-
-#if defined(FASTPUTBITS) && defined(FASTGETBITS) && defined(NO_3_60_CG4)
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define putbitsrop(src, x, w, pdst, rop) \
-{ \
- register PixelType _tmp, _tmp2; \
- FASTGETBITS(pdst, x, w, _tmp); \
- _tmp2 = SCRRIGHT(src, PPW-(w)); \
- DoRop(_tmp, rop, _tmp2, _tmp) \
- FASTPUTBITS(_tmp, x, w, pdst); \
-}
-#define putbitsrrop(src, x, w, pdst, rop) \
-{ \
- register PixelType _tmp, _tmp2; \
- \
- FASTGETBITS(pdst, x, w, _tmp); \
- _tmp2 = SCRRIGHT(src, PPW-(w)); \
- _tmp= DoRRop(rop, _tmp2, _tmp); \
- FASTPUTBITS(_tmp, x, w, pdst); \
-}
-#undef u_putbitsrop
-#else
-#define putbitsrop(src, x, w, pdst, rop) \
-{ \
- register PixelType _tmp; \
- FASTGETBITS(pdst, x, w, _tmp); \
- DoRop(_tmp, rop, src, _tmp) \
- FASTPUTBITS(_tmp, x, w, pdst); \
-}
-#define putbitsrrop(src, x, w, pdst, rop) \
-{ \
- register PixelType _tmp; \
- \
- FASTGETBITS(pdst, x, w, _tmp); \
- _tmp= DoRRop(rop, src, _tmp); \
- FASTPUTBITS(_tmp, x, w, pdst); \
-}
-#undef u_putbitsrop
-#endif
-#endif
-
-#ifndef putbitsrop
-#define putbitsrop(src, x, w, pdst, rop) u_putbitsrop(src, x, w, pdst, rop)
-#endif
-
-#ifndef putbitsrrop
-#define putbitsrrop(src, x, w, pdst, rop) \
-{\
- register PixelType t1, t2; \
- register int n = (x)+(w)-PPW; \
- \
- t1 = SCRRIGHT((src), (x)); \
- t2 = DoRRop(rop, t1, *(pdst)); \
- \
- if (n <= 0) \
- { \
- register PixelType tmpmask; \
- \
- maskpartialbits((x), (w), tmpmask); \
- *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
- } \
- else \
- { \
- int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
- t1 = SCRLEFT((src), m); \
- t2 = DoRRop(rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
- } \
-}
-#endif
-
-#if GETLEFTBITS_ALIGNMENT == 1
-#define getleftbits(psrc, w, dst) dst = *((CARD32 *)(pointer) psrc)
-#endif /* GETLEFTBITS_ALIGNMENT == 1 */
-
-#if GETLEFTBITS_ALIGNMENT == 2
-#define getleftbits(psrc, w, dst) \
- { \
- if ( ((int)(psrc)) & 0x01 ) \
- getbits( ((CARD32 *)(((char *)(psrc))-1)), 8, (w), (dst) ); \
- else \
- getbits(psrc, 0, w, dst); \
- }
-#endif /* GETLEFTBITS_ALIGNMENT == 2 */
-
-#if GETLEFTBITS_ALIGNMENT == 4
-#define getleftbits(psrc, w, dst) \
- { \
- int off, off_b; \
- off_b = (off = ( ((int)(psrc)) & 0x03)) << 3; \
- getbits( \
- (CARD32 *)( ((char *)(psrc)) - off), \
- (off_b), (w), (dst) \
- ); \
- }
-#endif /* GETLEFTBITS_ALIGNMENT == 4 */
-
-
-#define getshiftedleftbits(psrc, offset, w, dst) \
- getleftbits((psrc), (w), (dst)); \
- dst = SCRLEFT((dst), (offset));
-
-/* FASTGETBITS and FASTPUTBITS are not necessarily correct implementations of
- * getbits and putbits, but they work if used together.
- *
- * On a MSBFirst machine, a cpu bitfield extract instruction (like bfextu)
- * could normally assign its result to a 32-bit word register in the screen
- * right position. This saves canceling register shifts by not fighting the
- * natural cpu byte order.
- *
- * Unfortunately, these fail on a 3/60+CG4 and cannot be used unmodified. Sigh.
- */
-#if defined(FASTGETBITS) && defined(FASTPUTBITS)
-#ifdef NO_3_60_CG4
-#define u_FASTPUT(aa, bb, cc, dd) FASTPUTBITS(aa, bb, cc, dd)
-#else
-#define u_FASTPUT(aa, bb, cc, dd) u_putbits(SCRLEFT(aa, PPW-(cc)), bb, cc, dd)
-#endif
-
-#define getandputbits(psrc, srcbit, dstbit, width, pdst) \
-{ \
- register PixelType _tmpbits; \
- FASTGETBITS(psrc, srcbit, width, _tmpbits); \
- u_FASTPUT(_tmpbits, dstbit, width, pdst); \
-}
-
-#define getandputrop(psrc, srcbit, dstbit, width, pdst, rop) \
-{ \
- register PixelType _tmpsrc, _tmpdst; \
- FASTGETBITS(pdst, dstbit, width, _tmpdst); \
- FASTGETBITS(psrc, srcbit, width, _tmpsrc); \
- DoRop(_tmpdst, rop, _tmpsrc, _tmpdst); \
- u_FASTPUT(_tmpdst, dstbit, width, pdst); \
-}
-
-#define getandputrrop(psrc, srcbit, dstbit, width, pdst, rop) \
-{ \
- register PixelType _tmpsrc, _tmpdst; \
- FASTGETBITS(pdst, dstbit, width, _tmpdst); \
- FASTGETBITS(psrc, srcbit, width, _tmpsrc); \
- _tmpdst = DoRRop(rop, _tmpsrc, _tmpdst); \
- u_FASTPUT(_tmpdst, dstbit, width, pdst); \
-}
-
-#define getandputbits0(psrc, srcbit, width, pdst) \
- getandputbits(psrc, srcbit, 0, width, pdst)
-
-#define getandputrop0(psrc, srcbit, width, pdst, rop) \
- getandputrop(psrc, srcbit, 0, width, pdst, rop)
-
-#define getandputrrop0(psrc, srcbit, width, pdst, rop) \
- getandputrrop(psrc, srcbit, 0, width, pdst, rop)
-
-
-#else /* Slow poke */
-
-/* pairs of getbits/putbits happen frequently. Some of the code can
- * be shared or avoided in a few specific instances. It gets us a
- * small advantage, so we do it. The getandput...0 macros are the only ones
- * which speed things here. The others are here for compatibility w/the above
- * FAST ones
- */
-
-#define getandputbits(psrc, srcbit, dstbit, width, pdst) \
-{ \
- register PixelType _tmpbits; \
- getbits(psrc, srcbit, width, _tmpbits); \
- putbits(_tmpbits, dstbit, width, pdst); \
-}
-
-#define getandputrop(psrc, srcbit, dstbit, width, pdst, rop) \
-{ \
- register PixelType _tmpbits; \
- getbits(psrc, srcbit, width, _tmpbits) \
- putbitsrop(_tmpbits, dstbit, width, pdst, rop) \
-}
-
-#define getandputrrop(psrc, srcbit, dstbit, width, pdst, rop) \
-{ \
- register PixelType _tmpbits; \
- getbits(psrc, srcbit, width, _tmpbits) \
- putbitsrrop(_tmpbits, dstbit, width, pdst, rop) \
-}
-
-
-#define getandputbits0(psrc, sbindex, width, pdst) \
-{ /* unroll the whole damn thing to see how it * behaves */ \
- register int _flag = PPW - (sbindex); \
- register PixelType _src; \
- \
- _src = SCRLEFT (*(psrc), (sbindex)); \
- if ((width) > _flag) \
- _src |= SCRRIGHT (*((psrc) + 1), _flag); \
- \
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
-}
-
-
-#define getandputrop0(psrc, sbindex, width, pdst, rop) \
-{ \
- register int _flag = PPW - (sbindex); \
- register PixelType _src; \
- \
- _src = SCRLEFT (*(psrc), (sbindex)); \
- if ((width) > _flag) \
- _src |= SCRRIGHT (*((psrc) + 1), _flag); \
- DoRop(_src, rop, _src, *(pdst)); \
- \
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
-}
-
-#define getandputrrop0(psrc, sbindex, width, pdst, rop) \
-{ \
- int _flag = PPW - (sbindex); \
- register PixelType _src; \
- \
- _src = SCRLEFT (*(psrc), (sbindex)); \
- if ((width) > _flag) \
- _src |= SCRRIGHT (*((psrc) + 1), _flag); \
- _src = DoRRop(rop, _src, *(pdst)); \
- \
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
-}
-
-#endif /* FASTGETBITS && FASTPUTBITS */
-
-#endif /* MFB_CONSTS_ONLY */
diff --git a/mfb/mergerop.h b/mfb/mergerop.h
deleted file mode 100644
index ee3a33fe9..000000000
--- a/mfb/mergerop.h
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * $Xorg: mergerop.h,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $
- *
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/mfb/mergerop.h,v 3.14 2001/12/14 20:00:03 dawes Exp $ */
-
-#ifndef _MERGEROP_H_
-#define _MERGEROP_H_
-
-#ifndef GXcopy
-#include "X.h"
-#endif
-
-typedef struct _mergeRopBits {
- MfbBits ca1, cx1, ca2, cx2;
-} mergeRopRec, *mergeRopPtr;
-
-extern mergeRopRec mergeRopBits[16];
-
-#if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */
-#define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0;
-#define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx;
-#if PSZ == 24 /* both for PGSZ == 32 and 64 */
-#define DeclareMergeRop24() \
- MfbBits _ca1u[4], _cx1u[4], _ca2u[4], _cx2u[4];
- /* int _unrollidx[3]={0,0,1,2};*/
-#define DeclarePrebuiltMergeRop24() MfbBits _ccau[4], _ccxu[4];
-#endif /* PSZ == 24 */
-#else /* mfb */
-#define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0;
-#define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx;
-#endif
-
-#if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */
-#define InitializeMergeRop(alu,pm) {\
- MfbBits _pm; \
- mergeRopPtr _bits; \
- _pm = PFILL(pm); \
- _bits = &mergeRopBits[alu]; \
- _ca1 = _bits->ca1 & _pm; \
- _cx1 = _bits->cx1 | ~_pm; \
- _ca2 = _bits->ca2 & _pm; \
- _cx2 = _bits->cx2 & _pm; \
-}
-#if PSZ == 24
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define InitializeMergeRop24(alu,pm) {\
- register int i; \
- register MfbBits _pm = (pm) & 0xFFFFFF; \
- mergeRopPtr _bits = &mergeRopBits[alu]; \
- MfbBits _bits_ca1 = _bits->ca1; \
- MfbBits _bits_cx1 = _bits->cx1; \
- MfbBits _bits_ca2 = _bits->ca2; \
- MfbBits _bits_cx2 = _bits->cx2; \
- _pm = (_pm << 8) | (_pm >> 16); \
- for(i = 0; i < 4; i++){ \
- _ca1u[i] = _bits_ca1 & _pm; \
- _cx1u[i] = _bits_cx1 | ~_pm; \
- _ca2u[i] = _bits_ca2 & _pm; \
- _cx2u[i] = _bits_cx2 & _pm; \
- _pm = (_pm << 16)|(_pm >> 8); \
- } \
-}
-#else /*(BITMAP_BIT_ORDER == LSBFirst)*/
-#define InitializeMergeRop24(alu,pm) {\
- register int i; \
- register MfbBits _pm = (pm) & cfbmask[0]; \
- mergeRopPtr _bits = &mergeRopBits[alu]; \
- MfbBits _bits_ca1 = _bits->ca1 & cfbmask[0]; \
- MfbBits _bits_cx1 = _bits->cx1 & cfbmask[0]; \
- MfbBits _bits_ca2 = _bits->ca2 & cfbmask[0]; \
- MfbBits _bits_cx2 = _bits->cx2 & cfbmask[0]; \
- _pm |= (_pm << 24); \
- _bits_ca1 |= (_bits->ca1 << 24); \
- _bits_cx1 |= (_bits->cx1 << 24); \
- _bits_ca2 |= (_bits->ca2 << 24); \
- _bits_cx2 |= (_bits->cx2 << 24); \
- for(i = 0; i < 4; i++){ \
- _ca1u[i] = _bits_ca1 & _pm; \
- _cx1u[i] = _bits_cx1 | ~_pm; \
- _ca2u[i] = _bits_ca2 & _pm; \
- _cx2u[i] = _bits_cx2 & _pm; \
- _pm = (_pm << 16)|(_pm >> 8); \
- } \
-}
-#endif /*(BITMAP_BIT_ORDER == MSBFirst)*/
-#endif /* PSZ == 24 */
-#else /* mfb */
-#define InitializeMergeRop(alu,pm) {\
- mergeRopPtr _bits; \
- _bits = &mergeRopBits[alu]; \
- _ca1 = _bits->ca1; \
- _cx1 = _bits->cx1; \
- _ca2 = _bits->ca2; \
- _cx2 = _bits->cx2; \
-}
-#endif
-
-/* AND has higher precedence than XOR */
-
-#define DoMergeRop(src, dst) \
- (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
-
-#define DoMergeRop24u(src, dst, i) \
-(((dst) & (((src) & _ca1u[i]) ^ _cx1u[i])) ^ (((src) & _ca2u[i]) ^ _cx2u[i]))
-
-#define DoMaskMergeRop24(src, dst, mask, index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src0 = (src);\
- MfbBits _src1 = (_src0 & _ca1) ^ _cx1; \
- MfbBits _src2 = (_src0 & _ca2) ^ _cx2; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | (((*(dst)) & cfbmask[idx]) & \
- (((( _src1 |(~mask))<<cfb24Shift[idx])&cfbmask[idx]) ^ \
- ((( _src2&(mask))<<cfb24Shift[idx])&cfbmask[idx])))); \
- idx++; \
- (dst)++; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | (((*(dst)) & cfbmask[idx]) & \
- ((((_src1 |(~mask))>>cfb24Shift[idx])&cfbmask[idx]) ^ \
- (((_src2 &(mask))>>cfb24Shift[idx])&cfbmask[idx])))); \
- (dst)--; \
- }
-
-#define DoMaskMergeRop(src, dst, mask) \
- (((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
-
-#define DoMaskMergeRop24u(src, dst, mask, i) \
-(((dst) & ((((src) & _ca1u[(i)]) ^ _cx1u[(i)]) | ~(mask))) ^ ((((src) & _ca2u[(i)]) ^ _cx2u[(i)]) & (mask)))
-
-#define DoMergeRop24(src,dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src0 = (src);\
- MfbBits _src1 = (_src0 & _ca1) ^ _cx1; \
- MfbBits _src2 = (_src0 & _ca2) ^ _cx2; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) & \
- ((_src1 << cfb24Shift[idx])&cfbmask[idx])) ^ \
- ((_src2 << cfb24Shift[idx])&cfbmask[idx]))); \
- idx++; \
- (dst)++; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) & \
- ((_src1 >> cfb24Shift[idx])&cfbmask[idx])) ^ \
- ((_src2 >> cfb24Shift[idx])&cfbmask[idx]))); \
- (dst)--; \
- }
-
-#define DoPrebuiltMergeRop(dst) (((dst) & _cca) ^ _ccx)
-
-#define DoPrebuiltMergeRop24(dst,index) { \
- register int idx = ((index) & 3)<< 1; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) &\
- (( _cca <<cfb24Shift[idx])&cfbmask[idx])) ^ \
- (( _ccx <<cfb24Shift[idx])&cfbmask[idx]))); \
- idx++; \
- (dst)++; \
- *(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) &\
- (( _cca >>cfb24Shift[idx])&cfbmask[idx])) ^ \
- (( _ccx >>cfb24Shift[idx])&cfbmask[idx]))); \
- (dst)--; \
- }
-
-#define DoMaskPrebuiltMergeRop(dst,mask) \
- (((dst) & (_cca | ~(mask))) ^ (_ccx & (mask)))
-
-#define PrebuildMergeRop(src) ((_cca = ((src) & _ca1) ^ _cx1), \
- (_ccx = ((src) & _ca2) ^ _cx2))
-
-#ifndef MROP
-#define MROP 0
-#endif
-
-#define Mclear (1<<GXclear)
-#define Mand (1<<GXand)
-#define MandReverse (1<<GXandReverse)
-#define Mcopy (1<<GXcopy)
-#define MandInverted (1<<GXandInverted)
-#define Mnoop (1<<GXnoop)
-#define Mxor (1<<GXxor)
-#define Mor (1<<GXor)
-#define Mnor (1<<GXnor)
-#define Mequiv (1<<GXequiv)
-#define Minvert (1<<GXinvert)
-#define MorReverse (1<<GXorReverse)
-#define McopyInverted (1<<GXcopyInverted)
-#define MorInverted (1<<GXorInverted)
-#define Mnand (1<<GXnand)
-#define Mset (1<<GXset)
-
-#define MROP_PIXEL24(pix, idx) \
- (((*(pix) & cfbmask[(idx)<<1]) >> cfb24Shift[(idx)<<1])| \
- ((*((pix)+1) & cfbmask[((idx)<<1)+1]) << cfb24Shift[((idx)<<1)+1]))
-
-#define MROP_SOLID24P(src,dst,sindex, index) \
- MROP_SOLID24(MROP_PIXEL24(src,sindex),dst,index)
-
-#define MROP_MASK24P(src,dst,mask,sindex,index) \
- MROP_MASK24(MROP_PIXEL24(src,sindex),dst,mask,index)
-
-#if (MROP) == Mcopy
-#define MROP_DECLARE()
-#define MROP_DECLARE_REG()
-#define MROP_INITIALIZE(alu,pm)
-#define MROP_SOLID(src,dst) (src)
-#define MROP_SOLID24(src,dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = (src); \
- *(dst) = (*(dst) & cfbrmask[idx])|((_src<<cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- *((dst)+1) = (*((dst)+1) & cfbrmask[idx])|((_src>>cfb24Shift[idx])&cfbmask[idx]); \
- }
-#define MROP_MASK(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask)))
-#define MROP_MASK24(src,dst,mask,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = (src); \
- *(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)<< cfb24Shift[idx])&cfbmask[idx])) | \
- (((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx])); \
- idx++; \
- *((dst)+1) = (*((dst)+1) & cfbrmask[idx] &(~(((mask)>>cfb24Shift[idx])&cfbmask[idx])) | \
- (((_src&(mask))>>cfb24Shift[idx])&cfbmask[idx])); \
- }
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Copy)
-#endif
-
-#if (MROP) == McopyInverted
-#define MROP_DECLARE()
-#define MROP_DECLARE_REG()
-#define MROP_INITIALIZE(alu,pm)
-#define MROP_SOLID(src,dst) (~(src))
-#define MROP_SOLID24(src,dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = ~(src); \
- *(dst) = (*(dst) & cfbrmask[idx])|((_src << cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- (dst)++; \
- *(dst) = (*(dst) & cfbrmask[idx])|((_src >>cfb24Shift[idx])&cfbmask[idx]); \
- (dst)--; \
- }
-#define MROP_MASK(src,dst,mask) (((dst) & ~(mask)) | ((~(src)) & (mask)))
-#define MROP_MASK24(src,dst,mask,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = ~(src); \
- *(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)<< cfb24Shift[idx])&cfbmask[idx])) | \
- (((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx])); \
- idx++; \
- (dst)++; \
- *(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)>>cfb24Shift[idx])&cfbmask[idx])) | \
- ((((_src & (mask))>>cfb24Shift[idx])&cfbmask[idx])); \
- (dst)--; \
- }
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,CopyInverted)
-#endif
-
-#if (MROP) == Mxor
-#define MROP_DECLARE()
-#define MROP_DECLARE_REG()
-#define MROP_INITIALIZE(alu,pm)
-#define MROP_SOLID(src,dst) ((src) ^ (dst))
-#define MROP_SOLID24(src,dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = (src); \
- *(dst) ^= ((_src << cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- (dst)++; \
- *(dst) ^= ((_src >>cfb24Shift[idx])&cfbmask[idx]); \
- (dst)--; \
- }
-#define MROP_MASK(src,dst,mask) (((src) & (mask)) ^ (dst))
-#define MROP_MASK24(src,dst,mask,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(dst) ^= ((((src)&(mask))<<cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- (dst)++; \
- *(dst) ^= ((((src)&(mask))>>cfb24Shift[idx])&cfbmask[idx]); \
- (dst)--; \
- }
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Xor)
-#endif
-
-#if (MROP) == Mor
-#define MROP_DECLARE()
-#define MROP_DECLARE_REG()
-#define MROP_INITIALIZE(alu,pm)
-#define MROP_SOLID(src,dst) ((src) | (dst))
-#define MROP_SOLID24(src,dst,index) {\
- register int idx = ((index) & 3)<< 1; \
- *(dst) |= (((src)<<cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- (dst)++; \
- *(dst) |= (((src)>>cfb24Shift[idx])&cfbmask[idx]); \
- (dst)--; \
- }
-#define MROP_MASK(src,dst,mask) (((src) & (mask)) | (dst))
-#define MROP_MASK24(src,dst,mask,index) {\
- register int idx = ((index) & 3)<< 1; \
- MfbBits _src = (src); \
- *(dst) |= (((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx]); \
- idx++; \
- (dst)++; \
- *(dst) |= (((_src &(mask))>>cfb24Shift[idx])&cfbmask[idx]); \
- (dst)--; \
- }
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Or)
-#endif
-
-#if (MROP) == (Mcopy|Mxor|MandReverse|Mor)
-#define MROP_DECLARE() MfbBits _ca1 = 0, _cx1 = 0;
-#define MROP_DECLARE_REG() register MROP_DECLARE()
-#define MROP_INITIALIZE(alu,pm) { \
- mergeRopPtr _bits; \
- _bits = &mergeRopBits[alu]; \
- _ca1 = _bits->ca1; \
- _cx1 = _bits->cx1; \
-}
-#define MROP_SOLID(src,dst) \
- (((dst) & (((src) & _ca1) ^ _cx1)) ^ (src))
-#define MROP_MASK(src,dst,mask) \
- (((dst) & ((((src) & _ca1) ^ _cx1)) | (~(mask)) ^ ((src) & (mask))))
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,CopyXorAndReverseOr)
-#define MROP_PREBUILD(src) PrebuildMergeRop(src)
-#define MROP_PREBUILT_DECLARE() DeclarePrebuiltMergeRop()
-#define MROP_PREBUILT_SOLID(src,dst) DoPrebuiltMergeRop(dst)
-#define MROP_PREBUILT_SOLID24(src,dst,index) DoPrebuiltMergeRop24(dst,index)
-#define MROP_PREBUILT_MASK(src,dst,mask) DoMaskPrebuiltMergeRop(dst,mask)
-#define MROP_PREBUILT_MASK24(src,dst,mask,index) DoMaskPrebuiltMergeRop24(dst,mask,index)
-#endif
-
-#if (MROP) == 0
-#if !defined(PSZ) || (PSZ != 24)
-#define MROP_DECLARE() DeclareMergeRop()
-#define MROP_DECLARE_REG() register DeclareMergeRop()
-#define MROP_INITIALIZE(alu,pm) InitializeMergeRop(alu,pm)
-#define MROP_SOLID(src,dst) DoMergeRop(src,dst)
-#define MROP_MASK(src,dst,mask) DoMaskMergeRop(src, dst, mask)
-#else
-#define MROP_DECLARE() \
- DeclareMergeRop() \
- DeclareMergeRop24()
-#define MROP_DECLARE_REG() \
- register DeclareMergeRop()\
- DeclareMergeRop24()
-#define MROP_INITIALIZE(alu,pm) \
- InitializeMergeRop(alu,pm)\
- InitializeMergeRop24(alu,pm)
-#define MROP_SOLID(src,dst) DoMergeRop24u(src,dst,((int)(&(dst)-pdstBase) % 3))
-#define MROP_MASK(src,dst,mask) DoMaskMergeRop24u(src, dst, mask,((int)(&(dst) - pdstBase)%3))
-#endif
-#define MROP_SOLID24(src,dst,index) DoMergeRop24(src,dst,index)
-#define MROP_MASK24(src,dst,mask,index) DoMaskMergeRop24(src, dst, mask,index)
-#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,General)
-#define MROP_PREBUILD(src) PrebuildMergeRop(src)
-#define MROP_PREBUILT_DECLARE() DeclarePrebuiltMergeRop()
-#define MROP_PREBUILT_SOLID(src,dst) DoPrebuiltMergeRop(dst)
-#define MROP_PREBUILT_SOLID24(src,dst,index) DoPrebuiltMergeRop24(dst,index)
-#define MROP_PREBUILT_MASK(src,dst,mask) DoMaskPrebuiltMergeRop(dst,mask)
-#define MROP_PREBUILT_MASK24(src,dst,mask,index) \
- DoMaskPrebuiltMergeRop24(dst,mask,index)
-#endif
-
-#ifndef MROP_PREBUILD
-#define MROP_PREBUILD(src)
-#define MROP_PREBUILT_DECLARE()
-#define MROP_PREBUILT_SOLID(src,dst) MROP_SOLID(src,dst)
-#define MROP_PREBUILT_SOLID24(src,dst,index) MROP_SOLID24(src,dst,index)
-#define MROP_PREBUILT_MASK(src,dst,mask) MROP_MASK(src,dst,mask)
-#define MROP_PREBUILT_MASK24(src,dst,mask,index) MROP_MASK24(src,dst,mask,index)
-#endif
-
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define MROP_NAME_CAT(prefix,suffix) prefix##suffix
-#else
-#define MROP_NAME_CAT(prefix,suffix) prefix/**/suffix
-#endif
-
-#endif
diff --git a/mfb/mfb.h b/mfb/mfb.h
deleted file mode 100644
index 01e09f195..000000000
--- a/mfb/mfb.h
+++ /dev/null
@@ -1,1120 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfb.h,v 1.22 2003/11/17 22:20:44 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfb.h,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-
-#if !defined(_MFB_H_) || defined(MFB_PROTOTYPES_ONLY)
-#ifndef MFB_PROTOTYPES_ONLY
-#define _MFB_H_
-#endif
-
-/* Monochrome Frame Buffer definitions
- written by drewry, september 1986
-*/
-#include "pixmap.h"
-#include "region.h"
-#include "gc.h"
-#include "colormap.h"
-#include "miscstruct.h"
-#include "mibstore.h"
-
-extern int InverseAlu[];
-
-
-/* warning: PixelType definition duplicated in maskbits.h */
-#ifndef PixelType
-#define PixelType CARD32
-#endif /* PixelType */
-#ifndef MfbBits
-#define MfbBits CARD32
-#endif
-
-/* mfbbitblt.c */
-
-extern void mfbDoBitblt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-
-extern RegionPtr mfbCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-extern Bool mfbRegisterCopyPlaneProc(
- ScreenPtr /*pScreen*/,
- RegionPtr (* /*proc*/)(
- DrawablePtr /* pSrcDrawable */,
- DrawablePtr /* pDstDrawable */,
- GCPtr /* pGC */,
- int /* srcx */,
- int /* srcy */,
- int /* width */,
- int /* height */,
- int /* dstx */,
- int /* dsty */,
- unsigned long /* bitPlane */
- )
-);
-
-extern RegionPtr mfbCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/
-);
-/* mfbbltC.c */
-
-extern void mfbDoBitbltCopy(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-/* mfbbltCI.c */
-
-extern void mfbDoBitbltCopyInverted(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-/* mfbbltG.c */
-
-extern void mfbDoBitbltGeneral(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-/* mfbbltO.c */
-
-extern void mfbDoBitbltOr(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-/* mfbbltX.c */
-
-extern void mfbDoBitbltXor(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/
-);
-/* mfbbres.c */
-
-extern void mfbBresS(
- int /*rop*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* mfbbresd.c */
-
-extern void mfbBresD(
- int /*fgrop*/,
- int /*bgrop*/,
- int * /*pdashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pdashOffset*/,
- int /*isDoubleDash*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*signdx*/,
- int /*signdy*/,
- int /*axis*/,
- int /*x1*/,
- int /*y1*/,
- int /*e*/,
- int /*e1*/,
- int /*e2*/,
- int /*len*/
-);
-/* mfbbstore.c */
-
-extern void mfbSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void mfbRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-/* mfbclip.c */
-
-extern RegionPtr mfbPixmapToRegion(
- PixmapPtr /*pPix*/
-);
-/* mfbcmap.c */
-
-extern int mfbListInstalledColormaps(
- ScreenPtr /*pScreen*/,
- Colormap * /*pmaps*/
-);
-
-extern void mfbInstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void mfbUninstallColormap(
- ColormapPtr /*pmap*/
-);
-
-extern void mfbResolveColor(
- unsigned short * /*pred*/,
- unsigned short * /*pgreen*/,
- unsigned short * /*pblue*/,
- VisualPtr /*pVisual*/
-);
-
-extern Bool mfbCreateColormap(
- ColormapPtr /*pMap*/
-);
-
-extern void mfbDestroyColormap(
- ColormapPtr /*pMap*/
-);
-
-extern Bool mfbCreateDefColormap(
- ScreenPtr /*pScreen*/
-);
-/* mfbfillarc.c */
-
-extern void mfbPolyFillArcSolid(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-/* mfbfillrct.c */
-
-extern void mfbPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-/* mfbfillsp.c */
-
-extern void mfbBlackSolidFS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbWhiteSolidFS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbInvertSolidFS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbWhiteStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbBlackStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbInvertStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbUnnaturalTileFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-
-extern void mfbUnnaturalStippleFS(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*nInit*/,
- DDXPointPtr /*pptInit*/,
- int * /*pwidthInit*/,
- int /*fSorted*/
-);
-/* mfbfont.c */
-
-extern Bool mfbRealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-
-extern Bool mfbUnrealizeFont(
- ScreenPtr /*pscr*/,
- FontPtr /*pFont*/
-);
-/* mfbgc.c */
-
-extern Bool mfbCreateGC(
- GCPtr /*pGC*/
-);
-
-extern void mfbValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-extern int mfbReduceRop(
- int /*alu*/,
- Pixel /*src*/
-);
-
-/* mfbgetsp.c */
-
-extern void mfbGetSpans(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/
-);
-/* mfbhrzvert.c */
-
-extern void mfbHorzS(
- int /*rop*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-
-extern void mfbVertS(
- int /*rop*/,
- PixelType * /*addrl*/,
- int /*nlwidth*/,
- int /*x1*/,
- int /*y1*/,
- int /*len*/
-);
-/* mfbigbblak.c */
-
-extern void mfbImageGlyphBltBlack(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbigbwht.c */
-
-extern void mfbImageGlyphBltWhite(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbimage.c */
-
-extern void mfbPutImage(
- DrawablePtr /*dst*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-extern void mfbGetImage(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-/* mfbline.c */
-
-extern void mfbLineSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-extern void mfbLineSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pptInit*/
-);
-
-/* mfbmisc.c */
-
-extern void mfbQueryBestSize(
- int /*class*/,
- unsigned short * /*pwidth*/,
- unsigned short * /*pheight*/,
- ScreenPtr /*pScreen*/
-);
-/* mfbpablack.c */
-
-extern void mfbSolidBlackArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*nop*/
-);
-
-extern void mfbStippleBlackArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*pstipple*/
-);
-/* mfbpainv.c */
-
-extern void mfbSolidInvertArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*nop*/
-);
-
-extern void mfbStippleInvertArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*pstipple*/
-);
-/* mfbpawhite.c */
-
-extern void mfbSolidWhiteArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*nop*/
-);
-
-extern void mfbStippleWhiteArea(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*pstipple*/
-);
-
-/* mfbpgbinv.c */
-
-extern void mfbPolyGlyphBltBlack(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbpgbinv.c */
-
-extern void mfbPolyGlyphBltInvert(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbpgbwht.c */
-
-extern void mfbPolyGlyphBltWhite(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbpixmap.c */
-
-extern PixmapPtr mfbCreatePixmap(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/
-);
-
-extern Bool mfbDestroyPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern PixmapPtr mfbCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void mfbPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
-extern void mfbXRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rw*/
-);
-
-extern void mfbYRotatePixmap(
- PixmapPtr /*pPix*/,
- int /*rh*/
-);
-
-extern void mfbCopyRotatePixmap(
- PixmapPtr /*psrcPix*/,
- PixmapPtr * /*ppdstPix*/,
- int /*xrot*/,
- int /*yrot*/
-);
-/* mfbplyblack.c */
-
-extern void mfbFillPolyBlack(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* mfbplyinv.c */
-
-extern void mfbFillPolyInvert(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-
-/* mfbpntwin.c */
-
-extern void mfbFillPolyWhite(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-/* mfbpntwin.c */
-
-extern void mfbPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*pRegion*/,
- int /*what*/
-);
-/* mfbpolypnt.c */
-
-extern void mfbPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-/* mfbpushpxl.c */
-
-extern void mfbSolidPP(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-
-extern void mfbPushPixels(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-/* mfbscrclse.c */
-
-extern Bool mfbCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-/* mfbscrinit.c */
-
-extern Bool mfbAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*pWinIndex*/,
- int * /*pGCIndex*/
-);
-
-extern Bool mfbScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/
-);
-
-extern PixmapPtr mfbGetWindowPixmap(
- WindowPtr /*pWin*/
-);
-
-extern void mfbSetWindowPixmap(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/
-);
-
-/* mfbseg.c */
-
-extern void mfbSegmentSS(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-
-extern void mfbSegmentSD(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSeg*/
-);
-/* mfbsetsp.c */
-
-extern void mfbSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- PixelType * /*psrc*/,
- int /*alu*/,
- PixelType * /*pdstBase*/,
- int /*widthDst*/
-);
-
-extern void mfbSetSpans(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- char * /*psrc*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- int /*fSorted*/
-);
-/* mfbteblack.c */
-
-extern void mfbTEGlyphBltBlack(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbtewhite.c */
-
-extern void mfbTEGlyphBltWhite(
- DrawablePtr /*pDrawable*/,
- GCPtr/*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-/* mfbtileC.c */
-
-extern void mfbTileAreaPPWCopy(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/
-);
-/* mfbtileG.c */
-
-extern void mfbTileAreaPPWGeneral(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/
-);
-
-extern void mfbTileAreaPPW(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/
-);
-/* mfbwindow.c */
-
-extern Bool mfbCreateWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool mfbDestroyWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool mfbMapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern Bool mfbPositionWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/
-);
-
-extern Bool mfbUnmapWindow(
- WindowPtr /*pWindow*/
-);
-
-extern void mfbCopyWindow(
- WindowPtr /*pWin*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/
-);
-
-extern Bool mfbChangeWindowAttributes(
- WindowPtr /*pWin*/,
- unsigned long /*mask*/
-);
-/* mfbzerarc.c */
-
-extern void mfbZeroPolyArcSS(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-#ifndef MFB_PROTOTYPES_ONLY
-/*
- private filed of pixmap
- pixmap.devPrivate = (PixelType *)pointer_to_bits
- pixmap.devKind = width_of_pixmap_in_bytes
-
- private field of screen
- a pixmap, for which we allocate storage. devPrivate is a pointer to
-the bits in the hardware framebuffer. note that devKind can be poked to
-make the code work for framebuffers that are wider than their
-displayable screen (e.g. the early vsII, which displayed 960 pixels
-across, but was 1024 in the hardware.)
-
- private field of GC
-*/
-typedef void (*mfbFillAreaProcPtr)(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*nop*/
- );
-
-typedef struct {
- unsigned char rop; /* reduction of rasterop to 1 of 3 */
- unsigned char ropOpStip; /* rop for opaque stipple */
- unsigned char ropFillArea; /* == alu, rop, or ropOpStip */
- unsigned char unused1[sizeof(long) - 3]; /* Alignment */
- mfbFillAreaProcPtr FillArea; /* fills regions; look at the code */
- } mfbPrivGC;
-typedef mfbPrivGC *mfbPrivGCPtr;
-#endif
-
-extern int mfbGCPrivateIndex; /* index into GC private array */
-extern int mfbWindowPrivateIndex; /* index into Window private array */
-#ifdef PIXMAP_PER_WINDOW
-extern int frameWindowPrivateIndex; /* index into Window private array */
-#endif
-
-#ifndef MFB_PROTOTYPES_ONLY
-/* private field of window */
-typedef struct {
- unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
- unsigned char fastBackground;
- unsigned short unused; /* pad for alignment with Sun compiler */
- DDXPointRec oldRotate;
- PixmapPtr pRotatedBackground;
- PixmapPtr pRotatedBorder;
- } mfbPrivWin;
-
-/* Common macros for extracting drawing information */
-
-#define mfbGetTypedWidth(pDrawable,wtype) (\
- (((pDrawable)->type == DRAWABLE_WINDOW) ? \
- (int) (((PixmapPtr)((pDrawable)->pScreen->devPrivate))->devKind) : \
- (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
-
-#define mfbGetByteWidth(pDrawable) mfbGetTypedWidth(pDrawable, unsigned char)
-
-#define mfbGetPixelWidth(pDrawable) mfbGetTypedWidth(pDrawable, PixelType)
-
-#define mfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix; \
- if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr) (pDrawable)->pScreen->devPrivate; \
- else \
- _pPix = (PixmapPtr) (pDrawable); \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define mfbGetByteWidthAndPointer(pDrawable, width, pointer) \
- mfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
-
-#define mfbGetPixelWidthAndPointer(pDrawable, width, pointer) \
- mfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
-
-#define mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = (PixmapPtr) (pWin)->drawable.pScreen->devPrivate; \
- (pointer) = (ptype *) _pPix->devPrivate.ptr; \
- (width) = ((int) _pPix->devKind) / sizeof (wtype); \
-}
-
-#define mfbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
- mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
-
-#define mfbGetWindowByteWidthAndPointer(pWin, width, pointer) \
- mfbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
-
-/* mfb uses the following macros to calculate addresses in drawables.
- * To support banked framebuffers, the macros come in four flavors.
- * All four collapse into the same definition on unbanked devices.
- *
- * mfbScanlineFoo - calculate address and do bank switching
- * mfbScanlineFooNoBankSwitch - calculate address, don't bank switch
- * mfbScanlineFooSrc - calculate address, switch source bank
- * mfbScanlineFooDst - calculate address, switch destination bank
- */
-
-/* The NoBankSwitch versions are the same for banked and unbanked cases */
-
-#define mfbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
-#define mfbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
-#define mfbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
- mfbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
-#define mfbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
- mfbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
-
-#ifdef MFB_LINE_BANK
-
-#include "mfblinebank.h" /* get macro definitions from this file */
-
-#else /* !MFB_LINE_BANK - unbanked case */
-
-#define mfbScanlineInc(_ptr, _off) mfbScanlineIncNoBankSwitch(_ptr, _off)
-#define mfbScanlineIncSrc(_ptr, _off) mfbScanlineInc(_ptr, _off)
-#define mfbScanlineIncDst(_ptr, _off) mfbScanlineInc(_ptr, _off)
-
-#define mfbScanlineOffset(_ptr, _off) mfbScanlineOffsetNoBankSwitch(_ptr, _off)
-#define mfbScanlineOffsetSrc(_ptr, _off) mfbScanlineOffset(_ptr, _off)
-#define mfbScanlineOffsetDst(_ptr, _off) mfbScanlineOffset(_ptr, _off)
-
-#define mfbScanlineSrc(_ptr, _x, _y, _w) mfbScanline(_ptr, _x, _y, _w)
-#define mfbScanlineDst(_ptr, _x, _y, _w) mfbScanline(_ptr, _x, _y, _w)
-
-#define mfbScanlineDeltaSrc(_ptr, _y, _w) mfbScanlineDelta(_ptr, _y, _w)
-#define mfbScanlineDeltaDst(_ptr, _y, _w) mfbScanlineDelta(_ptr, _y, _w)
-
-#endif /* MFB_LINE_BANK */
-
-#define mfbScanlineDelta(_ptr, _y, _w) \
- mfbScanlineOffset(_ptr, (_y) * (_w))
-
-#define mfbScanline(_ptr, _x, _y, _w) \
- mfbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
-
-
-/* precomputed information about each glyph for GlyphBlt code.
- this saves recalculating the per glyph information for each box.
-*/
-typedef struct _pos{
- int xpos; /* xposition of glyph's origin */
- int xchar; /* x position mod 32 */
- int leftEdge;
- int rightEdge;
- int topEdge;
- int bottomEdge;
- PixelType *pdstBase; /* longword with character origin */
- int widthGlyph; /* width in bytes of this glyph */
-} TEXTPOS;
-
-/* reduced raster ops for mfb */
-#define RROP_BLACK GXclear
-#define RROP_WHITE GXset
-#define RROP_NOP GXnoop
-#define RROP_INVERT GXinvert
-
-/* macros for mfbbitblt.c, mfbfillsp.c
- these let the code do one switch on the rop per call, rather
-than a switch on the rop per item (span or rectangle.)
-*/
-
-#define fnCLEAR(src, dst) (0)
-#define fnAND(src, dst) (src & dst)
-#define fnANDREVERSE(src, dst) (src & ~dst)
-#define fnCOPY(src, dst) (src)
-#define fnANDINVERTED(src, dst) (~src & dst)
-#define fnNOOP(src, dst) (dst)
-#define fnXOR(src, dst) (src ^ dst)
-#define fnOR(src, dst) (src | dst)
-#define fnNOR(src, dst) (~(src | dst))
-#define fnEQUIV(src, dst) (~src ^ dst)
-#define fnINVERT(src, dst) (~dst)
-#define fnORREVERSE(src, dst) (src | ~dst)
-#define fnCOPYINVERTED(src, dst)(~src)
-#define fnORINVERTED(src, dst) (~src | dst)
-#define fnNAND(src, dst) (~(src & dst))
-#undef fnSET
-#define fnSET(src, dst) (MfbBits)(~0)
-
-/* Using a "switch" statement is much faster in most cases
- * since the compiler can do a look-up table or multi-way branch
- * instruction, depending on the architecture. The result on
- * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
- * distribution of RasterOp operation types.
- *
- * However, doing some profiling on a running system reveals
- * GXcopy is the operation over 99.5% of the time and
- * GXxor is the next most frequent (about .4%), so we make special
- * checks for those first.
- *
- * Note that this requires a change to the "calling sequence"
- * since we can't engineer a "switch" statement to have an lvalue.
- */
-#undef DoRop
-#define DoRop(result, alu, src, dst) \
-{ \
- if (alu == GXcopy) \
- result = fnCOPY (src, dst); \
- else if (alu == GXxor) \
- result = fnXOR (src, dst); \
- else \
- switch (alu) \
- { \
- case GXclear: \
- result = fnCLEAR (src, dst); \
- break; \
- case GXand: \
- result = fnAND (src, dst); \
- break; \
- case GXandReverse: \
- result = fnANDREVERSE (src, dst); \
- break; \
- case GXandInverted: \
- result = fnANDINVERTED (src, dst); \
- break; \
- default: \
- case GXnoop: \
- result = fnNOOP (src, dst); \
- break; \
- case GXor: \
- result = fnOR (src, dst); \
- break; \
- case GXnor: \
- result = fnNOR (src, dst); \
- break; \
- case GXequiv: \
- result = fnEQUIV (src, dst); \
- break; \
- case GXinvert: \
- result = fnINVERT (src, dst); \
- break; \
- case GXorReverse: \
- result = fnORREVERSE (src, dst); \
- break; \
- case GXcopyInverted: \
- result = fnCOPYINVERTED (src, dst); \
- break; \
- case GXorInverted: \
- result = fnORINVERTED (src, dst); \
- break; \
- case GXnand: \
- result = fnNAND (src, dst); \
- break; \
- case GXset: \
- result = fnSET (src, dst); \
- break; \
- } \
-}
-
-
-/* C expression fragments for various operations. These get passed in
- * as -D's on the compile command line. See mfb/Imakefile. This
- * fixes XBUG 6319.
- *
- * This seems like a good place to point out that mfb's use of the
- * words black and white is an unfortunate misnomer. In mfb code, black
- * means zero, and white means one.
- */
-#define MFB_OPEQ_WHITE |=
-#define MFB_OPEQ_BLACK &=~
-#define MFB_OPEQ_INVERT ^=
-#define MFB_EQWHOLEWORD_WHITE =~0
-#define MFB_EQWHOLEWORD_BLACK =0
-#define MFB_EQWHOLEWORD_INVERT ^=~0
-#define MFB_OP_WHITE /* nothing */
-#define MFB_OP_BLACK ~
-
-/*
- * if MFB is built as a module, it shouldn't call libc functions.
- */
-#ifdef XFree86LOADER
-#include "xf86_ansic.h"
-#endif
-
-#endif /* MFB_PROTOTYPES_ONLY */
-#endif /* _MFB_H_ */
diff --git a/mfb/mfbbitblt.c b/mfb/mfbbitblt.c
deleted file mode 100644
index 310d492f8..000000000
--- a/mfb/mfbbitblt.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbbitblt.c,v 1.8 2003/11/10 18:22:45 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbbitblt.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "Xprotostr.h"
-
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mi.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-
-/* CopyArea and CopyPlane for a monchrome frame buffer
-
-
- clip the source rectangle to the source's available bits. (this
-avoids copying unnecessary pieces that will just get exposed anyway.)
-this becomes the new shape of the destination.
- clip the destination region to the composite clip in the
-GC. this requires translating the destination region to (dstx, dsty).
- build a list of source points, one for each rectangle in the
-destination. this is a simple translation.
- go do the multiple rectangle copies
- do graphics exposures
-*/
-/** Optimized for drawing pixmaps into windows, especially when drawing into
- ** unobscured windows. Calls to the general-purpose region code were
- ** replaced with rectangle-to-rectangle clipping comparisions. This is
- ** possible, since the pixmap is a single rectangle. In an unobscured
- ** window, the destination clip is also a single rectangle, and region
- ** code can be avoided entirely. This is a big savings, since the region
- ** code uses XAlloc() and makes many function calls.
- **
- ** In addition, if source is a pixmap, there is no need to call the
- ** expensive miHandleExposures() routine. Instead, we simply return NULL.
- **
- ** Previously, drawing a pixmap into an unobscured window executed at least
- ** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code.
- **
- ** Now, the same operation requires no XAlloc()'s, no region function calls,
- ** and much less overhead. Nice for drawing lots of small pixmaps.
- */
-
-#ifndef LOWMEMFTPT
-
-void
-mfbDoBitblt (pSrc, pDst, alu, prgnDst, pptSrc)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
-{
- switch (alu)
- {
- case GXcopy:
- mfbDoBitbltCopy (pSrc, pDst, alu, prgnDst, pptSrc);
- break;
- case GXxor:
- mfbDoBitbltXor (pSrc, pDst, alu, prgnDst, pptSrc);
- break;
- case GXcopyInverted:
- mfbDoBitbltCopyInverted (pSrc, pDst, alu, prgnDst, pptSrc);
- break;
- case GXor:
- mfbDoBitbltOr (pSrc, pDst, alu, prgnDst, pptSrc);
- break;
- default:
- mfbDoBitbltGeneral (pSrc, pDst, alu, prgnDst, pptSrc);
- break;
- }
-}
-
-RegionPtr
-mfbCopyArea(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty)
-register DrawablePtr pSrcDrawable;
-register DrawablePtr pDstDrawable;
-register GC *pGC;
-int srcx, srcy;
-int width, height;
-int dstx, dsty;
-{
- RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
- Bool freeSrcClip = FALSE;
-
- RegionPtr prgnExposed;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
- register int dx;
- register int dy;
- xRectangle origSource;
- DDXPointRec origDest;
- int numRects;
- BoxRec fastBox;
- int fastClip = 0; /* for fast clipping with pixmap source */
- int fastExpose = 0; /* for fast exposures with pixmap source */
- void (*localDoBitBlt)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/);
-
- origSource.x = srcx;
- origSource.y = srcy;
- origSource.width = width;
- origSource.height = height;
- origDest.x = dstx;
- origDest.y = dsty;
-
- if ((pSrcDrawable != pDstDrawable) &&
- pSrcDrawable->pScreen->SourceValidate)
- {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
- }
-
- switch (pGC->alu) {
- case GXcopy:
- localDoBitBlt = mfbDoBitbltCopy;
- break;
- case GXcopyInverted:
- localDoBitBlt = mfbDoBitbltCopyInverted;
- break;
- case GXxor:
- localDoBitBlt = mfbDoBitbltXor;
- break;
- case GXor:
- localDoBitBlt = mfbDoBitbltOr;
- break;
- default:
- localDoBitBlt = mfbDoBitbltGeneral;
- break;
- }
-
- srcx += pSrcDrawable->x;
- srcy += pSrcDrawable->y;
-
- /* clip the source */
-
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = pGC->pCompositeClip;
- }
- else
- {
- fastClip = 1;
- }
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- if (!((WindowPtr) pSrcDrawable)->parent)
- {
- /*
- * special case bitblt from root window in
- * IncludeInferiors mode; just like from a pixmap
- */
- fastClip = 1;
- }
- else if ((pSrcDrawable == pDstDrawable) &&
- (pGC->clientClipType == CT_NONE))
- {
- prgnSrcClip = pGC->pCompositeClip;
- }
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
- freeSrcClip = TRUE;
- }
- }
- else
- {
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
- }
-
- fastBox.x1 = srcx;
- fastBox.y1 = srcy;
- fastBox.x2 = srcx + width;
- fastBox.y2 = srcy + height;
-
- /* Don't create a source region if we are doing a fast clip */
- if (fastClip)
- {
- fastExpose = 1;
- /*
- * clip the source; if regions extend beyond the source size,
- * make sure exposure events get sent
- */
- if (fastBox.x1 < pSrcDrawable->x)
- {
- fastBox.x1 = pSrcDrawable->x;
- fastExpose = 0;
- }
- if (fastBox.y1 < pSrcDrawable->y)
- {
- fastBox.y1 = pSrcDrawable->y;
- fastExpose = 0;
- }
- if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- {
- fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- fastExpose = 0;
- }
- if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- {
- fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- fastExpose = 0;
- }
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- }
-
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- if (!((WindowPtr)pDstDrawable)->realized)
- {
- if (!fastClip)
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- }
-
- dx = srcx - dstx;
- dy = srcy - dsty;
-
- /* Translate and clip the dst to the destination composite clip */
- if (fastClip)
- {
- RegionPtr cclip;
-
- /* Translate the region directly */
- fastBox.x1 -= dx;
- fastBox.x2 -= dx;
- fastBox.y1 -= dy;
- fastBox.y2 -= dy;
-
- /* If the destination composite clip is one rectangle we can
- do the clip directly. Otherwise we have to create a full
- blown region and call intersect */
- cclip = pGC->pCompositeClip;
- if (REGION_NUM_RECTS(cclip) == 1)
- {
- BoxPtr pBox = REGION_RECTS(cclip);
-
- if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
- if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
- if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
- if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
-
- /* Check to see if the region is empty */
- if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
- {
- REGION_NULL(pGC->pScreen, &rgnDst);
- }
- else
- {
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- /* We must turn off fastClip now, since we must create
- a full blown region. It is intersected with the
- composite clip below. */
- fastClip = 0;
- REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
- }
- }
- else
- {
- REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
- }
-
- if (!fastClip)
- {
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
- }
-
- /* Do bit blitting */
- numRects = REGION_NUM_RECTS(&rgnDst);
- if (numRects && width && height)
- {
- if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
- sizeof(DDXPointRec))))
- {
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return NULL;
- }
- pbox = REGION_RECTS(&rgnDst);
- ppt = pptSrc;
- for (i = numRects; --i >= 0; pbox++, ppt++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- if (pGC->planemask & 1)
- (*localDoBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc);
-
- DEALLOCATE_LOCAL(pptSrc);
- }
-
- prgnExposed = NULL;
- if (pGC->fExpose)
- {
- /* Pixmap sources generate a NoExposed (we return NULL to do this) */
- if (!fastExpose)
- prgnExposed =
- miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
- origSource.x, origSource.y,
- (int)origSource.width,
- (int)origSource.height,
- origDest.x, origDest.y, (unsigned long)0);
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
- return prgnExposed;
-}
-
-#endif /* ifndef LOWMEMFTPT */
-
-/*
- * Devices which use mfb for 1-bit pixmap support
- * must register a function for n-to-1 copy operations
- */
-
-static unsigned long copyPlaneGeneration;
-static int copyPlaneScreenIndex = -1;
-
-Bool
-mfbRegisterCopyPlaneProc (pScreen, proc)
- ScreenPtr pScreen;
- RegionPtr (*proc)(
- DrawablePtr /* pSrcDrawable */,
- DrawablePtr /* pDstDrawable */,
- GCPtr /* pGC */,
- int /* srcx */,
- int /* srcy */,
- int /* width */,
- int /* height */,
- int /* dstx */,
- int /* dsty */,
- unsigned long /* bitPlane */);
-{
- if (copyPlaneGeneration != serverGeneration)
- {
- copyPlaneScreenIndex = AllocateScreenPrivateIndex();
- if (copyPlaneScreenIndex < 0)
- return FALSE;
- copyPlaneGeneration = serverGeneration;
- }
- pScreen->devPrivates[copyPlaneScreenIndex].fptr = proc;
- return TRUE;
-}
-
-/*
- if fg == 1 and bg ==0, we can do an ordinary CopyArea.
- if fg == bg, we can do a CopyArea with alu = mfbReduceRop(alu, fg)
- if fg == 0 and bg == 1, we use the same rasterop, with
- source operand inverted.
-
- CopyArea deals with all of the graphics exposure events.
- This code depends on knowing that we can change the
-alu in the GC without having to call ValidateGC() before calling
-CopyArea().
-
-*/
-
-#ifndef LOWMEMFTPT
-
-RegionPtr
-mfbCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, plane)
-DrawablePtr pSrcDrawable, pDstDrawable;
-register GC *pGC;
-int srcx, srcy;
-int width, height;
-int dstx, dsty;
-unsigned long plane;
-{
- int alu;
- RegionPtr prgnExposed;
- RegionPtr (*copyPlane)(
- DrawablePtr /* pSrcDrawable */,
- DrawablePtr /* pDstDrawable */,
- GCPtr /* pGC */,
- int /* srcx */,
- int /* srcy */,
- int /* width */,
- int /* height */,
- int /* dstx */,
- int /* dsty */,
- unsigned long /* bitPlane */);
-
-
- if (pSrcDrawable->depth != 1)
- {
- if (copyPlaneScreenIndex >= 0 &&
- (copyPlane =
- pSrcDrawable->pScreen->devPrivates[copyPlaneScreenIndex].fptr)
- )
- {
- return (*copyPlane) (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, plane);
- }
- else
- {
- FatalError ("No copyPlane proc registered for depth %d\n",
- pSrcDrawable->depth);
- }
- }
- if (plane != 1)
- return NULL;
-
- if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0)
- {
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- }
- else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))
- {
- alu = pGC->alu;
- pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel);
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- pGC->alu = alu;
- }
- else /* need to invert the src */
- {
- alu = pGC->alu;
- pGC->alu = InverseAlu[alu];
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- pGC->alu = alu;
- }
- return prgnExposed;
-}
-
-#endif /* ifndef LOWMEMFTPT */
diff --git a/mfb/mfbblt.c b/mfb/mfbblt.c
deleted file mode 100644
index 59968110b..000000000
--- a/mfb/mfbblt.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- * mfb copy area
- */
-/* $XFree86: xc/programs/Xserver/mfb/mfbblt.c,v 3.4 2001/12/14 20:00:04 dawes Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Keith Packard
-
-*/
-/* $Xorg: mfbblt.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-#include "fastblt.h"
-#include "mergerop.h"
-
-void
-MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
-{
- PixelType *psrcBase, *pdstBase;
- /* start of src and dst bitmaps */
- int widthSrc, widthDst; /* add to get to same position in next line */
-
- BoxPtr pbox;
- int nbox;
-
- BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- /* temporaries for shuffling rectangles */
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- /* shuffling boxes entails shuffling the
- source points too */
- int w, h;
- int xdir; /* 1 = left right, -1 = right left/ */
- int ydir; /* 1 = top down, -1 = bottom up */
-
- PixelType *psrcLine, *pdstLine;
- /* pointers to line with current src and dst */
- register PixelType *psrc;/* pointer to current src longword */
- register PixelType *pdst;/* pointer to current dst longword */
-
- MROP_DECLARE_REG()
-
- /* following used for looping through a line */
- PixelType startmask, endmask; /* masks for writing ends of dst */
- int nlMiddle; /* whole longwords in dst */
- int xoffSrc, xoffDst;
- register int leftShift, rightShift;
- register PixelType bits;
- register PixelType bits1;
- register int nl; /* temp copy of nlMiddle */
- int careful;
-
- MROP_INITIALIZE(alu,0);
-
- mfbGetPixelWidthAndPointer(pSrc, widthSrc, psrcBase);
-
- mfbGetPixelWidthAndPointer(pDst, widthDst, pdstBase);
-
- /* XXX we have to err on the side of safety when both are windows,
- * because we don't know if IncludeInferiors is being used.
- */
- careful = ((pSrc == pDst) ||
- ((pSrc->type == DRAWABLE_WINDOW) &&
- (pDst->type == DRAWABLE_WINDOW)));
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
-
- pboxNew1 = NULL;
- pptNew1 = NULL;
- pboxNew2 = NULL;
- pptNew2 = NULL;
- if (careful && (pptSrc->y < pbox->y1))
- {
- /* walk source botttom to top */
- ydir = -1;
- widthSrc = -widthSrc;
- widthDst = -widthDst;
-
- if (nbox > 1)
- {
- /* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- if(!pboxNew1)
- return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pptNew1)
- {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox)
- {
- while ((pboxNext >= pbox) &&
- (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase)
- {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- }
- else
- {
- /* walk source top to bottom */
- ydir = 1;
- }
-
- if (careful && (pptSrc->x < pbox->x1))
- {
- /* walk source right to left */
- xdir = -1;
-
- if (nbox > 1)
- {
- /* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if(!pboxNew2 || !pptNew2)
- {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox)
- {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase)
- {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- }
- else
- {
- /* walk source left to right */
- xdir = 1;
- }
-
- while(nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- if (ydir == -1) /* start at last scanline of rectangle */
- {
- psrcLine = mfbScanlineDeltaSrc(psrcBase, -(pptSrc->y+h-1), widthSrc);
- pdstLine = mfbScanlineDeltaDst(pdstBase, -(pbox->y2-1), widthDst);
- }
- else /* start at first scanline */
- {
- psrcLine = mfbScanlineDeltaSrc(psrcBase, pptSrc->y, widthSrc);
- pdstLine = mfbScanlineDeltaDst(pdstBase, pbox->y1, widthDst);
- }
- if ((pbox->x1 & PIM) + w <= PPW)
- {
- maskpartialbits (pbox->x1, w, startmask);
- endmask = 0;
- nlMiddle = 0;
- }
- else
- {
- maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
- }
- if (xdir == 1)
- {
- xoffSrc = pptSrc->x & PIM;
- xoffDst = pbox->x1 & PIM;
- pdstLine += (pbox->x1 >> PWSH);
- psrcLine += (pptSrc->x >> PWSH);
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)
- (((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- if (startmask)
- {
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- psrc++;
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
-#ifdef NOTDEF
- /* you'd think this would be faster --
- * a single instruction instead of 6
- * but measurements show it to be ~15% slower
- */
- while ((nl -= 6) >= 0)
- {
- asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
- : "=m" (*(char *)pdst)
- : "m" (*(char *)psrc)
- : "d0", "d1", "d2", "d3",
- "a2", "a3");
- pdst += 6;
- }
- nl += 6;
- while (nl--)
- *pdst++ = *psrc++;
-#endif
- DuffL(nl, label1,
- *pdst = MROP_SOLID (*psrc, *pdst);
- pdst++; psrc++;)
-#endif
-
- if (endmask)
- *pdst = MROP_MASK(*psrc, *pdst, endmask);
- mfbScanlineIncDst(pdstLine, widthDst);
- mfbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else
- {
- if (xoffSrc > xoffDst)
- {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- }
- else
- {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffSrc > xoffDst)
- bits = *psrc++;
- if (startmask)
- {
- bits1 = BitLeft(bits,leftShift);
- if (BitLeft(startmask, rightShift)) {
- bits = *psrc++;
- bits1 |= BitRight(bits,rightShift);
- }
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- pdst++;
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-
-#ifdef FAST_CONSTANT_OFFSET_MODE
-
- psrc += nl & (UNROLL-1);
- pdst += nl & (UNROLL-1);
-
-#define BodyOdd(n) \
-bits = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
-
-#define BodyEven(n) \
-bits1 = psrc[-n]; \
-pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
-
-#define LoopReset \
-pdst += UNROLL; \
-psrc += UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
-pdst++;
-
-#define BodyEven(n) \
-bits1 = *psrc++; \
-*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
-pdst++;
-
-#define LoopReset ;
-
-#endif /* !FAST_CONSTANT_OFFSET_MODE */
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl,label2,
- bits1 = BitLeft(bits, leftShift);
- bits = *psrc++;
- *pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
- pdst++;
- )
-#endif
-
- if (endmask)
- {
- bits1 = BitLeft(bits, leftShift);
- if (BitLeft(endmask, rightShift))
- {
- bits = *psrc;
- bits1 |= BitRight(bits, rightShift);
- }
- *pdst = MROP_MASK (bits1, *pdst, endmask);
- }
- mfbScanlineIncDst(pdstLine, widthDst);
- mfbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#endif /* DO_UNALIGNED_BITBLT */
- }
- else /* xdir == -1 */
- {
- xoffSrc = (pptSrc->x + w - 1) & PIM;
- xoffDst = (pbox->x2 - 1) & PIM;
- pdstLine += ((pbox->x2-1) >> PWSH) + 1;
- psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
-#ifdef DO_UNALIGNED_BITBLT
- nl = xoffSrc - xoffDst;
- psrcLine = (PixelType *)
- (((unsigned char *) psrcLine) + nl);
-#else
- if (xoffSrc == xoffDst)
-#endif
- {
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- if (endmask)
- {
- pdst--;
- psrc--;
- *pdst = MROP_MASK (*psrc, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
-
-#define BodyEven(n) BodyOdd(n)
-
-#define LoopReset \
-pdst -= UNROLL;\
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
-#define BodyEven(n) BodyOdd(n)
-#define LoopReset ;
-
-#endif
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL(nl,label3,
- --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
-#endif
-
- if (startmask)
- {
- --pdst;
- --psrc;
- *pdst = MROP_MASK(*psrc, *pdst, startmask);
- }
- mfbScanlineIncDst(pdstLine, widthDst);
- mfbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#ifndef DO_UNALIGNED_BITBLT
- else
- {
- if (xoffDst > xoffSrc)
- {
- rightShift = (xoffDst - xoffSrc);
- leftShift = PPW - rightShift;
- }
- else
- {
- leftShift = (xoffSrc - xoffDst);
- rightShift = PPW - leftShift;
- }
- while (h--)
- {
- psrc = psrcLine;
- pdst = pdstLine;
- bits = 0;
- if (xoffDst > xoffSrc)
- bits = *--psrc;
- if (endmask)
- {
- bits1 = BitRight(bits, rightShift);
- if (BitRight(endmask, leftShift)) {
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- }
- pdst--;
- *pdst = MROP_MASK(bits1, *pdst, endmask);
- }
- nl = nlMiddle;
-
-#ifdef LARGE_INSTRUCTION_CACHE
- bits1 = bits;
-#ifdef FAST_CONSTANT_OFFSET_MODE
- psrc -= nl & (UNROLL - 1);
- pdst -= nl & (UNROLL - 1);
-
-#define BodyOdd(n) \
-bits = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
-
-#define BodyEven(n) \
-bits1 = psrc[n-1]; \
-pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
-
-#define LoopReset \
-pdst -= UNROLL; \
-psrc -= UNROLL;
-
-#else
-
-#define BodyOdd(n) \
-bits = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
-
-#define BodyEven(n) \
-bits1 = *--psrc; --pdst; \
-*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
-
-#define LoopReset ;
-
-#endif
-
- PackedLoop
-
-#undef BodyOdd
-#undef BodyEven
-#undef LoopReset
-
-#else
- DuffL (nl, label4,
- bits1 = BitRight(bits, rightShift);
- bits = *--psrc;
- --pdst;
- *pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
- )
-#endif
-
- if (startmask)
- {
- bits1 = BitRight(bits, rightShift);
- if (BitRight (startmask, leftShift))
- {
- bits = *--psrc;
- bits1 |= BitLeft(bits, leftShift);
- }
- --pdst;
- *pdst = MROP_MASK(bits1, *pdst, startmask);
- }
- mfbScanlineIncDst(pdstLine, widthDst);
- mfbScanlineIncSrc(psrcLine, widthSrc);
- }
- }
-#endif
- }
- pbox++;
- pptSrc++;
- }
- if (pboxNew2)
- {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1)
- {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-}
diff --git a/mfb/mfbbres.c b/mfb/mfbbres.c
deleted file mode 100644
index d43bd2e00..000000000
--- a/mfb/mfbbres.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/* $XFree86: xc/programs/Xserver/mfb/mfbbres.c,v 1.5 2001/12/14 20:00:05 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbbres.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "misc.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Solid bresenham line */
-/* NOTES
- e2 is used less often than e1, so it's not in a register
-*/
-
-void
-mfbBresS(rop, addrlbase, nlwidth, signdx, signdy, axis, x1, y1, e, e1, e2, len)
-int rop; /* a reduced rasterop */
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl; /* bitmask 32-bit pointer */
- register PixelType bit; /* current bit being set/cleared/etc. */
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
-
- register int e3 = e2-e1;
- PixelType tmp;
-
- /* point to longword containing first point */
- addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
-
- if (!len)
- return;
- if (rop == RROP_BLACK)
- {
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- tmp = *addrl;
- for (;;)
- {
- tmp &= ~bit;
- if (!--len)
- break;
- bit = SCRRIGHT(bit,1);
- e += e1;
- if (e >= 0)
- {
- *addrl = tmp;
- mfbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit)
- {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- }
- else if (!bit)
- {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- else
- {
- tmp = *addrl;
- for (;;)
- {
- tmp &= ~bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0)
- {
- *addrl = tmp;
- mfbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit)
- {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- }
- else if (!bit)
- {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- else
- {
- while(len--)
- {
- *addrl &= ~bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- }
- else if (rop == RROP_WHITE)
- {
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- tmp = *addrl;
- for (;;)
- {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRRIGHT(bit,1);
- if (e >= 0)
- {
- *addrl = tmp;
- mfbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit)
- {
- bit = leftbit;
- addrl ++;
- }
- tmp = *addrl;
- }
- else if (!bit)
- {
- *addrl = tmp;
- bit = leftbit;
- addrl ++;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- else
- {
- tmp = *addrl;
- for (;;)
- {
- tmp |= bit;
- if (!--len)
- break;
- e += e1;
- bit = SCRLEFT(bit,1);
- if (e >= 0)
- {
- *addrl = tmp;
- mfbScanlineInc(addrl, yinc);
- e += e3;
- if (!bit)
- {
- bit = rightbit;
- addrl --;
- }
- tmp = *addrl;
- }
- else if (!bit)
- {
- *addrl = tmp;
- bit = rightbit;
- addrl --;
- tmp = *addrl;
- }
- }
- *addrl = tmp;
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- *addrl |= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- else
- {
- while(len--)
- {
- *addrl |= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- }
- else if (rop == RROP_INVERT)
- {
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while(len--)
- {
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- mfbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- }
- }
- else
- {
- while(len--)
- {
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- mfbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- else
- {
- while(len--)
- {
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit; addrl --; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- }
- }
- } /* else Y_AXIS */
- }
-}
diff --git a/mfb/mfbbresd.c b/mfb/mfbbresd.c
deleted file mode 100644
index 182744d6e..000000000
--- a/mfb/mfbbresd.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbbresd.c,v 1.5 2001/12/14 20:00:05 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbbresd.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "misc.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* Dashed bresenham line */
-
-#define StepDash\
- if (!--dashRemaining) { \
- if (++ dashIndex == numInDashList) \
- dashIndex = 0; \
- dashRemaining = pDash[dashIndex]; \
- rop = fgrop; \
- if (dashIndex & 1) \
- rop = bgrop; \
- }
-
-void
-mfbBresD(fgrop, bgrop,
- pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
- addrlbase, nlwidth,
- signdx, signdy, axis, x1, y1, e, e1, e2, len)
-int fgrop, bgrop;
-int *pdashIndex; /* current dash */
-unsigned char *pDash; /* dash list */
-int numInDashList; /* total length of dash list */
-int *pdashOffset; /* offset into current dash */
-int isDoubleDash;
-PixelType *addrlbase; /* pointer to base of bitmap */
-int nlwidth; /* width in longwords of bitmap */
-int signdx, signdy; /* signs of directions */
-int axis; /* major axis (Y_AXIS or X_AXIS) */
-int x1, y1; /* initial point */
-register int e; /* error accumulator */
-register int e1; /* bresenham increments */
-int e2;
-int len; /* length of line */
-{
- register int yinc; /* increment to next scanline, in bytes */
- register PixelType *addrl;
- register int e3 = e2-e1;
- register MfbBits bit;
- PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
- PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
- int dashIndex;
- int dashOffset;
- int dashRemaining;
- int rop;
-
- dashOffset = *pdashOffset;
- dashIndex = *pdashIndex;
- dashRemaining = pDash[dashIndex] - dashOffset;
- rop = fgrop;
- if (!isDoubleDash)
- bgrop = -1;
- if (dashIndex & 1)
- rop = bgrop;
-
- /* point to longword containing first point */
- addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
- yinc = signdy * nlwidth;
- e = e-e1; /* to make looping easier */
- bit = mask[x1 & PIM];
- if (axis == X_AXIS)
- {
- if (signdx > 0)
- {
- while(len--)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- mfbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- StepDash
- }
- }
- else
- {
- while(len--)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- mfbScanlineInc(addrl, yinc);
- e += e3;
- }
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- StepDash
- }
- }
- } /* if X_AXIS */
- else
- {
- if (signdx > 0)
- {
- while(len--)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRRIGHT(bit,1);
- if (!bit) { bit = leftbit;addrl ++; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- StepDash
- }
- }
- else
- {
- while(len--)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~bit;
- else if (rop == RROP_WHITE)
- *addrl |= bit;
- else if (rop == RROP_INVERT)
- *addrl ^= bit;
- e += e1;
- if (e >= 0)
- {
- bit = SCRLEFT(bit,1);
- if (!bit) { bit = rightbit;addrl --; }
- e += e3;
- }
- mfbScanlineInc(addrl, yinc);
- StepDash
- }
- }
- } /* else Y_AXIS */
- *pdashIndex = dashIndex;
- *pdashOffset = pDash[dashIndex] - dashRemaining;
-}
diff --git a/mfb/mfbbstore.c b/mfb/mfbbstore.c
deleted file mode 100644
index 661ed0827..000000000
--- a/mfb/mfbbstore.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* $Xorg: mfbbstore.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-#include "mfb.h"
-#include "X.h"
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * mfbSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * mfbDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-mfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (numRects--)
- {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- mfbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivate,
- (DrawablePtr)pPixmap,
- GXcopy,
- prgnSave,
- pPtsInit);
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * mfbRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * mfbDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-mfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (numRects--)
- {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- mfbDoBitblt((DrawablePtr)pPixmap,
- (DrawablePtr)pPixmap->drawable.pScreen->devPrivate,
- GXcopy,
- prgnRestore,
- pPtsInit);
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
diff --git a/mfb/mfbclip.c b/mfb/mfbclip.c
deleted file mode 100644
index d23071cd3..000000000
--- a/mfb/mfbclip.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbclip.c,v 1.6 2003/07/16 01:38:55 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbclip.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "gc.h"
-#include "maskbits.h"
-#include "mi.h"
-#include "mfb.h"
-
-#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
-if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
- (!((reg)->data->numRects && \
- ((r-1)->y1 == (ry1)) && \
- ((r-1)->y2 == (ry2)) && \
- ((r-1)->x1 <= (rx1)) && \
- ((r-1)->x2 >= (rx2))))) \
-{ \
- if ((reg)->data->numRects == (reg)->data->size) \
- { \
- miRectAlloc(reg, 1); \
- fr = REGION_BOXPTR(reg); \
- r = fr + (reg)->data->numRects; \
- } \
- r->x1 = (rx1); \
- r->y1 = (ry1); \
- r->x2 = (rx2); \
- r->y2 = (ry2); \
- (reg)->data->numRects++; \
- if(r->x1 < (reg)->extents.x1) \
- (reg)->extents.x1 = r->x1; \
- if(r->x2 > (reg)->extents.x2) \
- (reg)->extents.x2 = r->x2; \
- r++; \
-}
-
-/* Convert bitmap clip mask into clipping region.
- * First, goes through each line and makes boxes by noting the transitions
- * from 0 to 1 and 1 to 0.
- * Then it coalesces the current line with the previous if they have boxes
- * at the same X coordinates.
- */
-RegionPtr
-mfbPixmapToRegion(pPix)
- PixmapPtr pPix;
-{
- register RegionPtr pReg;
- register PixelType *pw, w;
- register int ib;
- int width, h, base, rx1 = 0, crects;
- PixelType *pwLineEnd;
- int irectPrevStart, irectLineStart;
- register BoxPtr prectO, prectN;
- BoxPtr FirstRect, rects, prectLineStart;
- Bool fInBox, fSame;
- register PixelType mask0 = mask[0];
- PixelType *pwLine;
- int nWidth;
-
- pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1);
- if(!pReg)
- return NullRegion;
- FirstRect = REGION_BOXPTR(pReg);
- rects = FirstRect;
-
- pwLine = (PixelType *) pPix->devPrivate.ptr;
- nWidth = pPix->devKind / PGSZB;
-
- width = pPix->drawable.width;
- pReg->extents.x1 = width - 1;
- pReg->extents.x2 = 0;
- irectPrevStart = -1;
- for(h = 0; h < pPix->drawable.height; h++)
- {
- pw = pwLine;
- pwLine += nWidth;
- irectLineStart = rects - FirstRect;
- /* If the Screen left most bit of the word is set, we're starting in
- * a box */
- if(*pw & mask0)
- {
- fInBox = TRUE;
- rx1 = 0;
- }
- else
- fInBox = FALSE;
- /* Process all words which are fully in the pixmap */
- pwLineEnd = pw + (width >> PWSH);
- for (base = 0; pw < pwLineEnd; base += PPW)
- {
- w = *pw++;
- if (fInBox)
- {
- if (!~w)
- continue;
- }
- else
- {
- if (!w)
- continue;
- }
- for(ib = 0; ib < PPW; ib++)
- {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0)
- {
- if(!fInBox)
- {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- if(width & PIM)
- {
- /* Process final partial word on line */
- w = *pw++;
- for(ib = 0; ib < (width & PIM); ib++)
- {
- /* If the Screen left most bit of the word is set, we're
- * starting a box */
- if(w & mask0)
- {
- if(!fInBox)
- {
- rx1 = base + ib;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + ib, h + 1);
- fInBox = FALSE;
- }
- }
- /* Shift the word VISUALLY left one. */
- w = SCRLEFT(w, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox)
- {
- ADDRECT(pReg, rects, FirstRect,
- rx1, h, base + (width & PIM), h + 1);
- }
- /* if all rectangles on this line have the same x-coords as
- * those on the previous line, then add 1 to all the previous y2s and
- * throw away all the rectangles from this line
- */
- fSame = FALSE;
- if(irectPrevStart != -1)
- {
- crects = irectLineStart - irectPrevStart;
- if(crects == ((rects - FirstRect) - irectLineStart))
- {
- prectO = FirstRect + irectPrevStart;
- prectN = prectLineStart = FirstRect + irectLineStart;
- fSame = TRUE;
- while(prectO < prectLineStart)
- {
- if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2))
- {
- fSame = FALSE;
- break;
- }
- prectO++;
- prectN++;
- }
- if (fSame)
- {
- prectO = FirstRect + irectPrevStart;
- while(prectO < prectLineStart)
- {
- prectO->y2 += 1;
- prectO++;
- }
- rects -= crects;
- pReg->data->numRects -= crects;
- }
- }
- }
- if(!fSame)
- irectPrevStart = irectLineStart;
- }
- if (!pReg->data->numRects)
- pReg->extents.x1 = pReg->extents.x2 = 0;
- else
- {
- pReg->extents.y1 = REGION_BOXPTR(pReg)->y1;
- pReg->extents.y2 = REGION_END(pReg)->y2;
- if (pReg->data->numRects == 1)
- {
- xfree(pReg->data);
- pReg->data = (RegDataPtr)NULL;
- }
- }
-#ifdef DEBUG
- if (!miValidRegion(pReg))
- FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
-#endif
- return(pReg);
-}
diff --git a/mfb/mfbcmap.c b/mfb/mfbcmap.c
deleted file mode 100644
index d5dfbf47f..000000000
--- a/mfb/mfbcmap.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbcmap.c,v 1.8 2003/02/18 21:30:01 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbcmap.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "micmap.h"
-#include "mfb.h"
-
-/* A monochrome frame buffer is a static gray colormap with two entries.
- * We have a "required list" of length 1. Because we can only support 1
- * colormap, we never have to change it, but we may have to change the
- * name we call it. If someone installs a new colormap, we know it must
- * look just like the old one (because we've checked in dispatch that it was
- * a valid colormap identifier, and all the colormap IDs for this device
- * look the same). Nevertheless, we still have to uninstall the old colormap
- * and install the new one. Similarly, if someone uninstalls a colormap,
- * we have to install the default map, even though we know those two looked
- * alike.
- * The required list concept is pretty much irrelevant when you can only
- * have one map installed at a time.
- */
-
-int
-mfbListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-
-void
-mfbInstallColormap(pmap)
- ColormapPtr pmap;
-{
- miInstallColormap(pmap);
-}
-
-void
-mfbUninstallColormap(pmap)
- ColormapPtr pmap;
-{
- miUninstallColormap(pmap);
-}
-
-/*ARGSUSED*/
-void
-mfbResolveColor (pred, pgreen, pblue, pVisual)
- unsigned short *pred;
- unsigned short *pgreen;
- unsigned short *pblue;
- VisualPtr pVisual;
-{
- /*
- * Gets intensity from RGB. If intensity is >= half, pick white, else
- * pick black. This may well be more trouble than it's worth.
- */
- *pred = *pgreen = *pblue =
- (((30L * *pred +
- 59L * *pgreen +
- 11L * *pblue) >> 8) >= (((1<<8)-1)*50)) ? ~0 : 0;
-}
-
-Bool
-mfbCreateColormap(pMap)
- ColormapPtr pMap;
-{
- ScreenPtr pScreen;
- unsigned short red0, green0, blue0;
- unsigned short red1, green1, blue1;
- Pixel pix;
-
- pScreen = pMap->pScreen;
- if (pScreen->whitePixel == 0)
- {
- red0 = green0 = blue0 = ~0;
- red1 = green1 = blue1 = 0;
- }
- else
- {
- red0 = green0 = blue0 = 0;
- red1 = green1 = blue1 = ~0;
- }
-
- /* this is a monochrome colormap, it only has two entries, just fill
- * them in by hand. If it were a more complex static map, it would be
- * worth writing a for loop or three to initialize it */
-
- /* this will be pixel 0 */
- pix = 0;
- if (AllocColor(pMap, &red0, &green0, &blue0, &pix, 0) != Success)
- return FALSE;
-
- /* this will be pixel 1 */
- if (AllocColor(pMap, &red1, &green1, &blue1, &pix, 0) != Success)
- return FALSE;
- return TRUE;
-}
-
-/*ARGSUSED*/
-void
-mfbDestroyColormap (pMap)
- ColormapPtr pMap;
-{
- return;
-}
-
-Bool
-mfbCreateDefColormap (pScreen)
- ScreenPtr pScreen;
-{
- return miCreateDefColormap(pScreen);
-}
diff --git a/mfb/mfbfillarc.c b/mfb/mfbfillarc.c
deleted file mode 100644
index 886c2852a..000000000
--- a/mfb/mfbfillarc.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbfillarc.c,v 1.6 2003/07/16 01:38:55 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mfbfillarc.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mifillarc.h"
-#include "mi.h"
-
-static void
-mfbFillEllipseSolid(
- DrawablePtr pDraw,
- xArc *arc,
- register int rop)
-{
- int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- register int slw;
- miFillArcRec info;
- PixelType *addrlt, *addrlb;
- register PixelType *addrl;
- register int n;
- int nlwidth;
- register int xpos;
- PixelType startmask, endmask;
- int nlmiddle;
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, addrlt);
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt += nlwidth * (yorg - y);
- addrlb += nlwidth * (yorg + y + dy);
- while (y)
- {
- addrlt += nlwidth;
- addrlb -= nlwidth;
- MIFILLARCSTEP(slw);
- if (!slw)
- continue;
- xpos = xorg - x;
- addrl = mfbScanlineOffset(addrlt, (xpos >> PWSH));
- if (((xpos & PIM) + slw) < PPW)
- {
- maskpartialbits(xpos, slw, startmask);
- if (rop == RROP_BLACK)
- *addrl &= ~startmask;
- else if (rop == RROP_WHITE)
- *addrl |= startmask;
- else
- *addrl ^= startmask;
- if (miFillArcLower(slw))
- {
- addrl = mfbScanlineOffset(addrlb, (xpos >> PWSH));
- if (rop == RROP_BLACK)
- *addrl &= ~startmask;
- else if (rop == RROP_WHITE)
- *addrl |= startmask;
- else
- *addrl ^= startmask;
- }
- continue;
- }
- maskbits(xpos, slw, startmask, endmask, nlmiddle);
- if (startmask)
- {
- if (rop == RROP_BLACK)
- *addrl++ &= ~startmask;
- else if (rop == RROP_WHITE)
- *addrl++ |= startmask;
- else
- *addrl++ ^= startmask;
- }
- n = nlmiddle;
- if (rop == RROP_BLACK)
- while (n--)
- *addrl++ = 0;
- else if (rop == RROP_WHITE)
- while (n--)
- *addrl++ = ~0;
- else
- while (n--)
- *addrl++ ^= ~0;
- if (endmask)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~endmask;
- else if (rop == RROP_WHITE)
- *addrl |= endmask;
- else
- *addrl ^= endmask;
- }
- if (!miFillArcLower(slw))
- continue;
- addrl = mfbScanlineOffset(addrlb, (xpos >> PWSH));
- if (startmask)
- {
- if (rop == RROP_BLACK)
- *addrl++ &= ~startmask;
- else if (rop == RROP_WHITE)
- *addrl++ |= startmask;
- else
- *addrl++ ^= startmask;
- }
- n = nlmiddle;
- if (rop == RROP_BLACK)
- while (n--)
- *addrl++ = 0;
- else if (rop == RROP_WHITE)
- while (n--)
- *addrl++ = ~0;
- else
- while (n--)
- *addrl++ ^= ~0;
- if (endmask)
- {
- if (rop == RROP_BLACK)
- *addrl &= ~endmask;
- else if (rop == RROP_WHITE)
- *addrl |= endmask;
- else
- *addrl ^= endmask;
- }
- }
-}
-
-#define FILLSPAN(xl,xr,addr) \
- if (xr >= xl) \
- { \
- width = xr - xl + 1; \
- addrl = mfbScanlineOffset(addr, (xl >> PWSH)); \
- if (((xl & PIM) + width) < PPW) \
- { \
- maskpartialbits(xl, width, startmask); \
- if (rop == RROP_BLACK) \
- *addrl &= ~startmask; \
- else if (rop == RROP_WHITE) \
- *addrl |= startmask; \
- else \
- *addrl ^= startmask; \
- } \
- else \
- { \
- maskbits(xl, width, startmask, endmask, nlmiddle); \
- if (startmask) \
- { \
- if (rop == RROP_BLACK) \
- *addrl++ &= ~startmask; \
- else if (rop == RROP_WHITE) \
- *addrl++ |= startmask; \
- else \
- *addrl++ ^= startmask; \
- } \
- n = nlmiddle; \
- if (rop == RROP_BLACK) \
- while (n--) \
- *addrl++ = 0; \
- else if (rop == RROP_WHITE) \
- while (n--) \
- *addrl++ = ~0; \
- else \
- while (n--) \
- *addrl++ ^= ~0; \
- if (endmask) \
- { \
- if (rop == RROP_BLACK) \
- *addrl &= ~endmask; \
- else if (rop == RROP_WHITE) \
- *addrl |= endmask; \
- else \
- *addrl ^= endmask; \
- } \
- } \
- }
-
-#define FILLSLICESPANS(flip,addr) \
- if (!flip) \
- { \
- FILLSPAN(xl, xr, addr); \
- } \
- else \
- { \
- xc = xorg - x; \
- FILLSPAN(xc, xr, addr); \
- xc += slw - 1; \
- FILLSPAN(xl, xc, addr); \
- }
-
-static void
-mfbFillArcSliceSolidCopy(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc,
- register int rop)
-{
- register PixelType *addrl;
- register int n;
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int xl, xr, xc;
- PixelType *addrlt, *addrlb;
- int nlwidth;
- int width;
- PixelType startmask, endmask;
- int nlmiddle;
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, addrlt);
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- xorg += pDraw->x;
- yorg += pDraw->y;
- addrlb = addrlt;
- addrlt = mfbScanlineDeltaNoBankSwitch(addrlt, yorg - y, nlwidth);
- addrlb = mfbScanlineDeltaNoBankSwitch(addrlb, yorg + y + dy, nlwidth);
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- while (y > 0)
- {
- mfbScanlineIncNoBankSwitch(addrlt, nlwidth);
- mfbScanlineIncNoBankSwitch(addrlb, -nlwidth);
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- MIARCSLICEUPPER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_top, addrlt);
- }
- if (miFillSliceLower(slice))
- {
- MIARCSLICELOWER(xl, xr, slice, slw);
- FILLSLICESPANS(slice.flip_bot, addrlb);
- }
- }
-}
-
-void
-mfbPolyFillArcSolid(pDraw, pGC, narcs, parcs)
- register DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- mfbPrivGC *priv;
- register xArc *arc;
- register int i;
- BoxRec box;
- int x2, y2;
- RegionPtr cclip;
- int rop;
-
- priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
- rop = priv->rop;
- if ((rop == RROP_NOP) || !(pGC->planemask & 1))
- return;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;
- if (miCanFillArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- {
- if ((arc->angle2 >= FULLCIRCLE) ||
- (arc->angle2 <= -FULLCIRCLE))
- mfbFillEllipseSolid(pDraw, arc, rop);
- else
- mfbFillArcSliceSolidCopy(pDraw, pGC, arc, rop);
- continue;
- }
- }
- miPolyFillArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/mfb/mfbfillrct.c b/mfb/mfbfillrct.c
deleted file mode 100644
index cd1b66845..000000000
--- a/mfb/mfbfillrct.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbfillrct.c,v 1.6 2003/02/18 21:30:01 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbfillrct.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "miscstruct.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-#define MODEQ(a, b) ((a) %= (b))
-
-/*
- filled rectangles.
- translate the rectangles, clip them, and call the
-helper function in the GC.
-*/
-
-#define NUM_STACK_RECTS 1024
-
-void
-mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *prect;
- RegionPtr prgnClip;
- register BoxPtr pbox;
- register BoxPtr pboxClipped;
- BoxPtr pboxClippedBase;
- BoxPtr pextent;
- BoxRec stackRects[NUM_STACK_RECTS];
- int numRects;
- int n;
- int xorg, yorg;
- mfbPrivGC *priv;
- int alu;
- mfbFillAreaProcPtr pfn;
- PixmapPtr ppix;
-
- if (!(pGC->planemask & 1))
- return;
-
- priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
- alu = priv->ropFillArea;
- pfn = priv->FillArea;
- ppix = pGC->pRotatedPixmap;
- prgnClip = pGC->pCompositeClip;
-
- prect = prectInit;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- if (xorg || yorg)
- {
- prect = prectInit;
- n = nrectFill;
- Duff (n, prect->x += xorg; prect->y += yorg; prect++);
- }
-
-
- prect = prectInit;
-
- numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
- if (numRects > NUM_STACK_RECTS)
- {
- pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
- if (!pboxClippedBase)
- return;
- }
- else
- pboxClippedBase = stackRects;
-
- pboxClipped = pboxClippedBase;
-
- if (REGION_NUM_RECTS(prgnClip) == 1)
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_RECTS(prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- if ((pboxClipped->x1 = prect->x) < x1)
- pboxClipped->x1 = x1;
-
- if ((pboxClipped->y1 = prect->y) < y1)
- pboxClipped->y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- pboxClipped->x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- pboxClipped->y2 = by2;
-
- prect++;
- if ((pboxClipped->x1 < pboxClipped->x2) &&
- (pboxClipped->y1 < pboxClipped->y2))
- {
- pboxClipped++;
- }
- }
- }
- else
- {
- int x1, y1, x2, y2, bx2, by2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
- x1 = pextent->x1;
- y1 = pextent->y1;
- x2 = pextent->x2;
- y2 = pextent->y2;
- while (nrectFill--)
- {
- BoxRec box;
-
- if ((box.x1 = prect->x) < x1)
- box.x1 = x1;
-
- if ((box.y1 = prect->y) < y1)
- box.y1 = y1;
-
- bx2 = (int) prect->x + (int) prect->width;
- if (bx2 > x2)
- bx2 = x2;
- box.x2 = bx2;
-
- by2 = (int) prect->y + (int) prect->height;
- if (by2 > y2)
- by2 = y2;
- box.y2 = by2;
-
- prect++;
-
- if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
- continue;
-
- n = REGION_NUM_RECTS (prgnClip);
- pbox = REGION_RECTS(prgnClip);
-
- /* clip the rectangle to each box in the clip region
- this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- pboxClipped->x1 = max(box.x1, pbox->x1);
- pboxClipped->y1 = max(box.y1, pbox->y1);
- pboxClipped->x2 = min(box.x2, pbox->x2);
- pboxClipped->y2 = min(box.y2, pbox->y2);
- pbox++;
-
- /* see if clipping left anything */
- if(pboxClipped->x1 < pboxClipped->x2 &&
- pboxClipped->y1 < pboxClipped->y2)
- {
- pboxClipped++;
- }
- }
- }
- }
- if (pboxClipped != pboxClippedBase)
- (*pfn) (pDrawable,pboxClipped-pboxClippedBase, pboxClippedBase, alu, ppix);
- if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
-}
diff --git a/mfb/mfbfillsp.c b/mfb/mfbfillsp.c
deleted file mode 100644
index 5a095757f..000000000
--- a/mfb/mfbfillsp.c
+++ /dev/null
@@ -1,1024 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbfillsp.c,v 1.9 2001/12/14 20:00:06 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbfillsp.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "Xmd.h"
-#include "gcstruct.h"
-#include "window.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "mfb.h"
-#include "maskbits.h"
-
-#include "mergerop.h"
-
-#include "servermd.h"
-#include "mi.h"
-#include "mispans.h"
-
-/* scanline filling for monochrome frame buffer
- written by drewry, oct 1986
-
- these routines all clip. they assume that anything that has called
-them has already translated the points (i.e. pGC->miTranslate is
-non-zero, which is howit gets set in mfbCreateGC().)
-
- the number of new scnalines created by clipping ==
-MaxRectsPerBand * nSpans.
-
- FillSolid is overloaded to be used for OpaqueStipple as well,
-if fgPixel == bgPixel.
-
-
- FillTiled is overloaded to be used for OpaqueStipple, if
-fgPixel != bgPixel. based on the fill style, it uses
-{RotatedPixmap, gc.alu} or {RotatedPixmap, PrivGC.ropOpStip}
-*/
-
-
-void
-mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
-
- if (*pwidth)
- {
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~startmask;
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-
-void
-mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
-
- if (*pwidth)
- {
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= startmask;
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-
-void
-mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
-
- if (*pwidth)
- {
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- /* all bits inside same longword */
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= startmask;
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- }
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-void
-mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl;/* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pStipple;
- PixelType *psrc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- pStipple = pGC->pRotatedPixmap;
- tileHeight = pStipple->drawable.height;
- psrc = (PixelType *)(pStipple->devPrivate.ptr);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- src = psrc[ppt->y % tileHeight];
-
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl |= (src & startmask);
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ |= (src & startmask);
- Duff (nlmiddle, *addrl++ |= src);
- if (endmask)
- *addrl |= (src & endmask);
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-void
-mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pStipple;
- PixelType *psrc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- pStipple = pGC->pRotatedPixmap;
- tileHeight = pStipple->drawable.height;
- psrc = (PixelType *)(pStipple->devPrivate.ptr);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- src = psrc[ppt->y % tileHeight];
-
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl &= ~(src & startmask);
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ &= ~(src & startmask);
- Duff (nlmiddle, *addrl++ &= ~src);
- if (endmask)
- *addrl &= ~(src & endmask);
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-void
-mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pStipple;
- PixelType *psrc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- pStipple = pGC->pRotatedPixmap;
- tileHeight = pStipple->drawable.height;
- psrc = (PixelType *)(pStipple->devPrivate.ptr);
-
- while (n--)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- src = psrc[ppt->y % tileHeight];
-
- /* all bits inside same longword */
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl ^= (src & startmask);
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- *addrl++ ^= (src & startmask);
- Duff(nlmiddle, *addrl++ ^= src);
- if (endmask)
- *addrl ^= (src & endmask);
- }
- pwidth++;
- ppt++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-/* this works with tiles of width == PPW */
-#define FILLSPANPPW(ROP) \
- while (n--) \
- { \
- if (*pwidth) \
- { \
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth); \
- src = psrc[ppt->y % tileHeight]; \
- if ( ((ppt->x & PIM) + *pwidth) < PPW) \
- { \
- maskpartialbits(ppt->x, *pwidth, startmask); \
- *addrl = (*addrl & ~startmask) | \
- (ROP(src, *addrl) & startmask); \
- } \
- else \
- { \
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle); \
- if (startmask) \
- { \
- *addrl = (*addrl & ~startmask) | \
- (ROP(src, *addrl) & startmask); \
- addrl++; \
- } \
- while (nlmiddle--) \
- { \
- *addrl = ROP(src, *addrl); \
- addrl++; \
- } \
- if (endmask) \
- *addrl = (*addrl & ~endmask) | \
- (ROP(src, *addrl) & endmask); \
- } \
- } \
- pwidth++; \
- ppt++; \
- }
-
-
-
-void
-mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *addrl; /* pointer to current longword in bitmap */
- register PixelType src;
- register int nlmiddle;
- register PixelType startmask;
- register PixelType endmask;
- PixmapPtr pTile;
- PixelType *psrc;
- int tileHeight;
- int rop;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
- MfbBits flip;
-
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- pTile = pGC->pRotatedPixmap;
- tileHeight = pTile->drawable.height;
- psrc = (PixelType *)(pTile->devPrivate.ptr);
- if (pGC->fillStyle == FillTiled)
- rop = pGC->alu;
- else
- rop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->ropOpStip;
-
- flip = 0;
- switch(rop)
- {
- case GXcopyInverted: /* for opaque stipples */
- flip = ~0;
- case GXcopy:
- {
-
-#define DoMaskCopyRop(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask)))
-
- while (n--)
- {
- if (*pwidth)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- src = psrc[ppt->y % tileHeight] ^ flip;
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- {
- *addrl = DoMaskCopyRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--)
- {
- *addrl = src;
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskCopyRop (src, *addrl, endmask);
- }
- }
- pwidth++;
- ppt++;
- }
- }
- break;
- default:
- {
- register DeclareMergeRop ();
-
- InitializeMergeRop(rop,~0);
- while (n--)
- {
- if (*pwidth)
- {
- addrl = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- src = psrc[ppt->y % tileHeight];
- if ( ((ppt->x & PIM) + *pwidth) < PPW)
- {
- maskpartialbits(ppt->x, *pwidth, startmask);
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- }
- else
- {
- maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
- if (startmask)
- {
- *addrl = DoMaskMergeRop (src, *addrl, startmask);
- addrl++;
- }
- while (nlmiddle--)
- {
- *addrl = DoMergeRop (src, *addrl);
- addrl++;
- }
- if (endmask)
- *addrl = DoMaskMergeRop (src, *addrl, endmask);
- }
- }
- pwidth++;
- ppt++;
- }
- }
- break;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-/* Fill spans with tiles that aren't PPW bits wide */
-void
-mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- int iline; /* first line of tile to use */
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst;/* pointer to current word in bitmap */
- register PixelType *psrc;/* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- int tlwidth, rem, tileWidth, tileHeight, endinc;
- PixelType endmask, *psrcT;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- if (pGC->fillStyle == FillTiled)
- {
- pTile = pGC->tile.pixmap;
- tlwidth = pTile->devKind / PGSZB;
- rop = pGC->alu;
- }
- else
- {
- pTile = pGC->stipple;
- tlwidth = pTile->devKind / PGSZB;
- rop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->ropOpStip;
- }
-
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
-
- /* this replaces rotating the tile. Instead we just adjust the offset
- * at which we start grabbing bits from the tile.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
-
- while (n--)
- {
- iline = (ppt->y - ySrc) % tileHeight;
- pdst = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- x = ppt->x;
-
- if (*pwidth)
- {
- width = *pwidth;
- while(width > 0)
- {
- psrc = psrcT;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0)
- {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrop((psrc+endinc), (rem&PIM), (x & PIM), w, pdst, rop);
- if((x & PIM) + w >= PPW)
- pdst++;
- }
- else if(((x & PIM) + w) < PPW)
- {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrop(*psrc, x & PIM, w, pdst, rop);
- }
- else
- {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask)
- {
- putbitsrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
-#if defined(__alpha__) || defined(__alpha)
- /*
- * XXX workaround an egcs 1.1.2 code generation
- * bug. This version might actually be faster.
- */
- psrc += srcStartOver;
-#else
- if(srcStartOver)
- psrc++;
-#endif
- }
-
- while(nlMiddle--)
- {
- getandputrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if(endmask)
- {
- getandputrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
-
-
-/* Fill spans with stipples that aren't PPW bits wide */
-void
-mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GC *pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- /* next three parameters are post-clip */
- int n; /* number of spans to fill */
- register DDXPointPtr ppt; /* pointer to list of start points */
- register int *pwidth; /* pointer to list of n widths */
- int iline; /* first line of tile to use */
- PixelType *addrlBase; /* pointer to start of bitmap */
- int nlwidth; /* width in longwords of bitmap */
- register PixelType *pdst; /* pointer to current word in bitmap */
- register PixelType *psrc; /* pointer to current word in tile */
- register int nlMiddle;
- register int rop, nstart;
- PixelType startmask;
- PixmapPtr pTile; /* pointer to tile we want to fill with */
- int w, width, x, xSrc, ySrc, srcStartOver, nend;
- PixelType endmask, *psrcT;
- int tlwidth, rem, tileWidth, endinc;
- int tileHeight;
- int *pwidthFree; /* copies of the pointers to free */
- DDXPointPtr pptFree;
-
- if (!(pGC->planemask & 1))
- return;
-
- n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
- if(!pptFree || !pwidthFree)
- {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
- return;
- }
- pwidth = pwidthFree;
- ppt = pptFree;
- n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
- ppt, pwidth, fSorted);
-
- pTile = pGC->stipple;
- rop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
- tlwidth = pTile->devKind / PGSZB;
- xSrc = pDrawable->x;
- ySrc = pDrawable->y;
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
-
- /* this replaces rotating the stipple. Instead, we just adjust the offset
- * at which we start grabbing bits from the stipple.
- * Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
- * so that iline and rem always stay within the tile bounds.
- */
- xSrc += (pGC->patOrg.x % tileWidth) - tileWidth;
- ySrc += (pGC->patOrg.y % tileHeight) - tileHeight;
- while (n--)
- {
- iline = (ppt->y - ySrc) % tileHeight;
- pdst = mfbScanline(addrlBase, ppt->x, ppt->y, nlwidth);
- psrcT = (PixelType *) pTile->devPrivate.ptr + (iline * tlwidth);
- x = ppt->x;
-
- if (*pwidth)
- {
- width = *pwidth;
- while(width > 0)
- {
- psrc = psrcT;
- w = min(tileWidth, width);
- if((rem = (x - xSrc) % tileWidth) != 0)
- {
- /* if we're in the middle of the tile, get
- as many bits as will finish the span, or
- as many as will get to the left edge of the tile,
- or a longword worth, starting at the appropriate
- offset in the tile.
- */
- w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
- endinc = rem / BITMAP_SCANLINE_PAD;
- getandputrrop((psrc + endinc), (rem & PIM), (x & PIM),
- w, pdst, rop)
- if((x & PIM) + w >= PPW)
- pdst++;
- }
-
- else if(((x & PIM) + w) < PPW)
- {
- /* doing < PPW bits is easy, and worth special-casing */
- putbitsrrop(*psrc, x & PIM, w, pdst, rop);
- }
- else
- {
- /* start at the left edge of the tile,
- and put down as much as we can
- */
- maskbits(x, w, startmask, endmask, nlMiddle);
-
- if (startmask)
- nstart = PPW - (x & PIM);
- else
- nstart = 0;
- if (endmask)
- nend = (x + w) & PIM;
- else
- nend = 0;
-
- srcStartOver = nstart > PLST;
-
- if(startmask)
- {
- putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
- pdst++;
- if(srcStartOver)
- psrc++;
- }
-
- while(nlMiddle--)
- {
- getandputrrop0(psrc, nstart, PPW, pdst, rop);
- pdst++;
- psrc++;
- }
- if(endmask)
- {
- getandputrrop0(psrc, nstart, nend, pdst, rop);
- }
- }
- x += w;
- width -= w;
- }
- }
- ppt++;
- pwidth++;
- }
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
-}
diff --git a/mfb/mfbfont.c b/mfb/mfbfont.c
deleted file mode 100644
index 499dac52a..000000000
--- a/mfb/mfbfont.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-*/
-/* $Xorg: mfbfont.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "scrnintstr.h"
-
-/*ARGSUSED*/
-Bool
-mfbRealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-mfbUnrealizeFont( pscr, pFont)
- ScreenPtr pscr;
- FontPtr pFont;
-{
- return (TRUE);
-}
diff --git a/mfb/mfbgc.c b/mfb/mfbgc.c
deleted file mode 100644
index 1119f66f9..000000000
--- a/mfb/mfbgc.c
+++ /dev/null
@@ -1,1572 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbgc.c,v 1.10 2003/07/16 03:35:16 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbgc.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "region.h"
-
-#include "mistruct.h"
-#include "migc.h"
-
-#include "maskbits.h"
-
-static GCFuncs mfbFuncs = {
- mfbValidateGC,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip
-};
-
-#ifndef LOWMEMFTPT
-
-static GCOps whiteTECopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltWhite,
- mfbPolyGlyphBltWhite,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackTECopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltBlack,
- mfbPolyGlyphBltBlack,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteTEInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- mfbPutImage,
- miCopyArea,
- miCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltWhite,
- mfbPolyGlyphBltInvert,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackTEInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltBlack,
- mfbPolyGlyphBltInvert,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteCopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltWhite,
- mfbPolyGlyphBltWhite,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackCopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltBlack,
- mfbPolyGlyphBltBlack,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltWhite,
- mfbPolyGlyphBltInvert,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltBlack,
- mfbPolyGlyphBltInvert,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteWhiteCopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltWhite,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackBlackCopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- mfbZeroPolyArcSS,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltBlack,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps fgEqBgInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- mfbPutImage,
- mfbCopyArea,
- mfbCopyPlane,
- mfbPolyPoint,
- mfbLineSS,
- mfbSegmentSS,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- mfbPolyFillArcSolid,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltInvert,
- mfbSolidPP
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-#else
-
-static GCOps whiteTECopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltWhite,
- mfbPolyGlyphBltWhite,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackTECopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltBlack,
- mfbPolyGlyphBltBlack,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteTEInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltWhite,
- mfbPolyGlyphBltInvert,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackTEInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbTEGlyphBltBlack,
- mfbPolyGlyphBltInvert,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteCopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltWhite,
- mfbPolyGlyphBltWhite,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackCopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltBlack,
- mfbPolyGlyphBltBlack,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltWhite,
- mfbPolyGlyphBltInvert,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- mfbImageGlyphBltBlack,
- mfbPolyGlyphBltInvert,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps whiteWhiteCopyOps = {
- mfbWhiteSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyWhite,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltWhite,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps blackBlackCopyOps = {
- mfbBlackSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyBlack,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltBlack,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-static GCOps fgEqBgInvertOps = {
- mfbInvertSolidFS,
- mfbSetSpans,
- miPutImage,
- miCopyArea,
- miCopyPlane,
- miPolyPoint,
- miZeroLine,
- miPolySegment,
- miPolyRectangle,
- miZeroPolyArc,
- mfbFillPolyInvert,
- mfbPolyFillRect,
- miPolyFillArc,
- miPolyText8,
- miPolyText16,
- miImageText8,
- miImageText16,
- miImageGlyphBlt,
- mfbPolyGlyphBltInvert,
- miPushPixels
-#ifdef NEED_LINEHELPER
- ,NULL
-#endif
-};
-
-#endif /* ifndef LOWMEMFTPT */
-
-struct commonOps {
- int fg, bg;
- int rrop;
- int terminalFont;
- GCOps *ops;
- void (*fillArea)(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*nop*/);
-};
-
-static struct commonOps mfbCommonOps[] = {
- { 1, 0, RROP_WHITE, 1, &whiteTECopyOps, mfbSolidWhiteArea },
- { 0, 1, RROP_BLACK, 1, &blackTECopyOps, mfbSolidBlackArea },
- { 1, 0, RROP_INVERT, 1, &whiteTEInvertOps, mfbSolidInvertArea },
- { 0, 1, RROP_INVERT, 1, &blackTEInvertOps, mfbSolidInvertArea },
- { 1, 0, RROP_WHITE, 0, &whiteCopyOps, mfbSolidWhiteArea },
- { 0, 1, RROP_BLACK, 0, &blackCopyOps, mfbSolidBlackArea },
- { 1, 0, RROP_INVERT, 0, &whiteInvertOps, mfbSolidInvertArea },
- { 0, 1, RROP_INVERT, 0, &blackInvertOps, mfbSolidInvertArea },
- { 1, 1, RROP_WHITE, 0, &whiteWhiteCopyOps, mfbSolidWhiteArea },
- { 0, 0, RROP_BLACK, 0, &blackBlackCopyOps, mfbSolidBlackArea },
- { 1, 1, RROP_INVERT, 0, &fgEqBgInvertOps, mfbSolidInvertArea },
- { 0, 0, RROP_INVERT, 0, &fgEqBgInvertOps, mfbSolidInvertArea },
-};
-
-#define numberCommonOps (sizeof (mfbCommonOps) / sizeof (mfbCommonOps[0]))
-
-static GCOps *
-matchCommon (
- GCPtr pGC)
-{
- int i;
- struct commonOps *cop;
- mfbPrivGC *priv;
-
- if (pGC->lineWidth != 0)
- return 0;
- if (pGC->lineStyle != LineSolid)
- return 0;
- if (pGC->fillStyle != FillSolid)
- return 0;
- if (!pGC->font ||
- FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0)
- return 0;
- priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
- for (i = 0; i < numberCommonOps; i++) {
- cop = &mfbCommonOps[i];
- if ((pGC->fgPixel & 1) != cop->fg)
- continue;
- if ((pGC->bgPixel & 1) != cop->bg)
- continue;
- if (priv->rop != cop->rrop)
- continue;
- if (cop->terminalFont && !TERMINALFONT(pGC->font))
- continue;
- priv->FillArea = cop->fillArea;
- return cop->ops;
- }
- return 0;
-}
-
-
-Bool
-mfbCreateGC(pGC)
- register GCPtr pGC;
-{
- mfbPrivGC *pPriv;
-
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-
- /* some of the output primitives aren't really necessary, since
- they will be filled in ValidateGC because of dix/CreateGC()
- setting all the change bits. Others are necessary because although
- they depend on being a monochrome frame buffer, they don't change
- */
-
- pGC->ops = &whiteCopyOps;
- pGC->funcs = &mfbFuncs;
-
- /* mfb wants to translate before scan convesion */
- pGC->miTranslate = 1;
-
- pPriv = (mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr);
- pPriv->rop = mfbReduceRop(pGC->alu, pGC->fgPixel);
- pGC->fExpose = TRUE;
- pGC->pRotatedPixmap = NullPixmap;
- pGC->freeCompClip = FALSE;
- pPriv->FillArea = mfbSolidInvertArea;
- return TRUE;
-}
-
-/* some noop functions */
-static void
-mfbPolyGlyphBltNoop(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr * ppci,
- pointer pglyphBase)
-{
- /* this is a no-op function */
-}
-
-static void
-mfbNoopFS(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nInit,
- DDXPointPtr pptInit,
- int * pwidthInit,
- int fSorted)
-{
- /* this is a no-op function */
-}
-
-static void
-mfbFillPolyNoop(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn)
-{
- /* this is a no-op function */
-}
-
-
-/* Clipping conventions
- if the drawable is a window
- CT_REGION ==> pCompositeClip really is the composite
- CT_other ==> pCompositeClip is the window clip region
- if the drawable is a pixmap
- CT_REGION ==> pCompositeClip is the translated client region
- clipped to the pixmap boundary
- CT_other ==> pCompositeClip is the pixmap bounding box
-*/
-
-/*ARGSUSED*/
-void
-mfbValidateGC(pGC, changes, pDrawable)
- register GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- register mfbPrivGCPtr devPriv;
- int mask; /* stateChanges */
- int index; /* used for stepping through bitfields */
- int xrot, yrot; /* rotations for tile and stipple pattern */
- int rrop; /* reduced rasterop */
- /* flags for changing the proc vector
- and updating things in devPriv
- */
- int new_rotate, new_rrop, new_line, new_text, new_fill;
- DDXPointRec oldOrg; /* origin of thing GC was last used with */
-
- oldOrg = pGC->lastWinOrg;
-
- pGC->lastWinOrg.x = pDrawable->x;
- pGC->lastWinOrg.y = pDrawable->y;
-
- /* we need to re-rotate the tile if the previous window/pixmap
- origin (oldOrg) differs from the new window/pixmap origin
- (pGC->lastWinOrg)
- */
- new_rotate = (oldOrg.x != pGC->lastWinOrg.x) ||
- (oldOrg.y != pGC->lastWinOrg.y);
-
- devPriv = ((mfbPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr));
-
- /*
- if the client clip is different or moved OR
- the subwindowMode has changed OR
- the window's clip has changed since the last validation
- we need to recompute the composite clip
- */
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- miComputeCompositeClip(pGC, pDrawable);
- }
-
- new_rrop = FALSE;
- new_line = FALSE;
- new_text = FALSE;
- new_fill = FALSE;
-
- mask = changes;
- while (mask)
- {
- index = lowbit (mask);
- mask &= ~index;
-
- /* this switch acculmulates a list of which procedures
- might have to change due to changes in the GC. in
- some cases (e.g. changing one 16 bit tile for another)
- we might not really need a change, but the code is
- being paranoid.
- this sort of batching wins if, for example, the alu
- and the font have been changed, or any other pair
- of items that both change the same thing.
- */
- switch (index)
- {
- case GCFunction:
- case GCForeground:
- new_rrop = TRUE;
- break;
- case GCPlaneMask:
- break;
- case GCBackground:
- new_rrop = TRUE; /* for opaque stipples */
- break;
- case GCLineStyle:
- case GCLineWidth:
- case GCJoinStyle:
- new_line = TRUE;
- break;
- case GCCapStyle:
- break;
- case GCFillStyle:
- new_fill = TRUE;
- break;
- case GCFillRule:
- break;
- case GCTile:
- if(pGC->tileIsPixel)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCStipple:
- if(pGC->stipple == (PixmapPtr)NULL)
- break;
- new_rotate = TRUE;
- new_fill = TRUE;
- break;
-
- case GCTileStipXOrigin:
- new_rotate = TRUE;
- break;
-
- case GCTileStipYOrigin:
- new_rotate = TRUE;
- break;
-
- case GCFont:
- new_text = TRUE;
- break;
- case GCSubwindowMode:
- break;
- case GCGraphicsExposures:
- break;
- case GCClipXOrigin:
- break;
- case GCClipYOrigin:
- break;
- case GCClipMask:
- break;
- case GCDashOffset:
- break;
- case GCDashList:
- break;
- case GCArcMode:
- break;
- default:
- break;
- }
- }
-
- /* deal with the changes we've collected .
- new_rrop must be done first because subsequent things
- depend on it.
- */
-
- if(new_rotate || new_fill)
- {
- Bool new_pix = FALSE;
-
- /* figure out how much to rotate */
- xrot = pGC->patOrg.x;
- yrot = pGC->patOrg.y;
- xrot += pDrawable->x;
- yrot += pDrawable->y;
-
- switch (pGC->fillStyle)
- {
- case FillTiled:
- /* copy current tile and stipple */
- if (!pGC->tileIsPixel && (pGC->tile.pixmap->drawable.width <= PPW) &&
- !(pGC->tile.pixmap->drawable.width & (pGC->tile.pixmap->drawable.width - 1)))
- {
- mfbCopyRotatePixmap(pGC->tile.pixmap,
- &pGC->pRotatedPixmap, xrot, yrot);
- new_pix = TRUE;
- }
- break;
- case FillStippled:
- case FillOpaqueStippled:
- if (pGC->stipple && (pGC->stipple->drawable.width <= PPW) &&
- !(pGC->stipple->drawable.width & (pGC->stipple->drawable.width - 1)))
- {
- mfbCopyRotatePixmap(pGC->stipple,
- &pGC->pRotatedPixmap, xrot, yrot);
- new_pix = TRUE;
- }
- }
- /* destroy any previously rotated tile or stipple */
- if (!new_pix && pGC->pRotatedPixmap)
- {
- (*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
- pGC->pRotatedPixmap = (PixmapPtr)NULL;
- }
- }
-
- /*
- * duck out here when the GC is unchanged
- */
-
- if (!changes)
- return;
-
- if (new_rrop || new_fill)
- {
- rrop = mfbReduceRop(pGC->alu, pGC->fgPixel);
- devPriv->rop = rrop;
- new_fill = TRUE;
- /* FillArea raster op is GC's for tile filling,
- and the reduced rop for solid and stipple
- */
- if (pGC->fillStyle == FillTiled)
- devPriv->ropFillArea = pGC->alu;
- else
- devPriv->ropFillArea = rrop;
-
- /* opaque stipples:
- fg bg ropOpStip fill style
- 1 0 alu tile
- 0 1 inverseAlu tile
- 1 1 rrop(fg, alu) solid
- 0 0 rrop(fg, alu) solid
- Note that rrop(fg, alu) == mfbPrivGC.rop, so we don't really need to
- compute it.
- */
- if (pGC->fillStyle == FillOpaqueStippled)
- {
- if ((pGC->fgPixel & 1) != (pGC->bgPixel & 1))
- {
- if (pGC->fgPixel & 1)
- devPriv->ropOpStip = pGC->alu;
- else
- devPriv->ropOpStip = InverseAlu[pGC->alu];
- }
- else
- devPriv->ropOpStip = rrop;
- devPriv->ropFillArea = devPriv->ropOpStip;
- }
- }
- else
- rrop = devPriv->rop;
-
- if (new_line || new_fill || new_text)
- {
- GCOps *newops;
-
- if ((newops = matchCommon (pGC)))
- {
- if (pGC->ops->devPrivate.val)
- miDestroyGCOps (pGC->ops);
- pGC->ops = newops;
- new_line = new_fill = new_text = 0;
- }
- else
- {
- if (!pGC->ops->devPrivate.val)
- {
- pGC->ops = miCreateGCOps (pGC->ops);
- pGC->ops->devPrivate.val = 1;
- }
- }
- }
-
- if (new_line || new_fill)
- {
- if (pGC->lineWidth == 0)
- {
-#ifndef LOWMEMFTPT
- if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid)
- && ((rrop == RROP_WHITE) || (rrop == RROP_BLACK)))
- pGC->ops->PolyArc = mfbZeroPolyArcSS;
- else
-#endif /* ifndef LOWMEMFTPT */
- pGC->ops->PolyArc = miZeroPolyArc;
- }
- else
- pGC->ops->PolyArc = miPolyArc;
- if (pGC->lineStyle == LineSolid)
- {
- if(pGC->lineWidth == 0)
- {
-#ifndef LOWMEMFTPT
- if (pGC->fillStyle == FillSolid)
- {
- pGC->ops->PolySegment = mfbSegmentSS;
- pGC->ops->Polylines = mfbLineSS;
- }
- else
-#endif /* ifndef LOWMEMFTPT */
- {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miZeroLine;
- }
- }
- else
- {
- pGC->ops->PolySegment = miPolySegment;
- pGC->ops->Polylines = miWideLine;
- }
- }
- else
- {
-#ifndef LOWMEMFTPT
- if(pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
- {
- pGC->ops->Polylines = mfbLineSD;
- pGC->ops->PolySegment = mfbSegmentSD;
- }
- else
-#endif /* ifndef LOWMEMFTPT */
- {
- pGC->ops->Polylines = miWideDash;
- pGC->ops->PolySegment = miPolySegment;
- }
- }
- }
-
- if (new_text || new_fill)
- {
- if ((pGC->font) &&
- (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
- FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
- FONTMINBOUNDS(pGC->font,characterWidth) < 0))
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
- }
- else
- {
- /* special case ImageGlyphBlt for terminal emulator fonts */
-
-#ifndef LOWMEMFTPT
-
- if ((pGC->font) &&
- TERMINALFONT(pGC->font) &&
- ((pGC->fgPixel & 1) != (pGC->bgPixel & 1)))
- {
- /* pcc bug makes this not compile...
- pGC->ops->ImageGlyphBlt = (pGC->fgPixel & 1) ? mfbTEGlyphBltWhite :
- mfbTEGlyphBltBlack;
- */
- if (pGC->fgPixel & 1)
- pGC->ops->ImageGlyphBlt = mfbTEGlyphBltWhite;
- else
- pGC->ops->ImageGlyphBlt = mfbTEGlyphBltBlack;
- }
- else
-
-#endif /* ifndef LOWMEMFTPT */
-
- {
- if (pGC->fgPixel & 1)
- pGC->ops->ImageGlyphBlt = mfbImageGlyphBltWhite;
- else
- pGC->ops->ImageGlyphBlt = mfbImageGlyphBltBlack;
- }
-
- /* now do PolyGlyphBlt */
- if (pGC->fillStyle == FillSolid ||
- (pGC->fillStyle == FillOpaqueStippled &&
- (pGC->fgPixel & 1) == (pGC->bgPixel & 1)
- )
- )
- {
- if (rrop == RROP_WHITE)
- pGC->ops->PolyGlyphBlt = mfbPolyGlyphBltWhite;
- else if (rrop == RROP_BLACK)
- pGC->ops->PolyGlyphBlt = mfbPolyGlyphBltBlack;
- else if (rrop == RROP_INVERT)
- pGC->ops->PolyGlyphBlt = mfbPolyGlyphBltInvert;
- else
- pGC->ops->PolyGlyphBlt = mfbPolyGlyphBltNoop;
- }
- else
- {
- pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
- }
- }
- }
-
- if (new_fill)
-
-#ifndef LOWMEMFTPT
-
- {
- /* install a suitable fillspans and pushpixels */
- pGC->ops->PushPixels = mfbPushPixels;
- pGC->ops->FillPolygon = miFillPolygon;
- if ((pGC->fillStyle == FillSolid) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))))
- {
- pGC->ops->PushPixels = mfbSolidPP;
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- pGC->ops->FillSpans = mfbWhiteSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyWhite;
- break;
- case RROP_BLACK:
- pGC->ops->FillSpans = mfbBlackSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyBlack;
- break;
- case RROP_INVERT:
- pGC->ops->FillSpans = mfbInvertSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyInvert;
- break;
- case RROP_NOP:
- pGC->ops->FillSpans = mfbNoopFS;
- pGC->ops->FillPolygon = mfbFillPolyNoop;
- break;
- }
- }
- /* beyond this point, opaqueStippled ==> fg != bg */
- else if (((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillOpaqueStippled)) &&
- !pGC->pRotatedPixmap)
- {
- pGC->ops->FillSpans = mfbUnnaturalTileFS;
- }
- else if ((pGC->fillStyle == FillStippled) && !pGC->pRotatedPixmap)
- {
- pGC->ops->FillSpans = mfbUnnaturalStippleFS;
- }
- else if (pGC->fillStyle == FillStippled)
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- pGC->ops->FillSpans = mfbWhiteStippleFS;
- break;
- case RROP_BLACK:
- pGC->ops->FillSpans = mfbBlackStippleFS;
- break;
- case RROP_INVERT:
- pGC->ops->FillSpans = mfbInvertStippleFS;
- break;
- case RROP_NOP:
- pGC->ops->FillSpans = mfbNoopFS;
- break;
- }
- }
- else /* overload tiles to do parti-colored opaque stipples */
- {
- pGC->ops->FillSpans = mfbTileFS;
- }
- if (pGC->fillStyle == FillSolid)
- pGC->ops->PolyFillArc = mfbPolyFillArcSolid;
- else
- pGC->ops->PolyFillArc = miPolyFillArc;
- /* the rectangle code doesn't deal with opaque stipples that
- are two colors -- we can fool it for fg==bg, though
- */
- if ((((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillStippled)) &&
- !pGC->pRotatedPixmap) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) != (pGC->bgPixel & 1)))
- )
- {
- pGC->ops->PolyFillRect = miPolyFillRect;
- }
- else /* deal with solids and natural stipples and tiles */
- {
- pGC->ops->PolyFillRect = mfbPolyFillRect;
-
- if ((pGC->fillStyle == FillSolid) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))))
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- devPriv->FillArea = mfbSolidWhiteArea;
- break;
- case RROP_BLACK:
- devPriv->FillArea = mfbSolidBlackArea;
- break;
- case RROP_INVERT:
- devPriv->FillArea = mfbSolidInvertArea;
- break;
- case RROP_NOP:
- devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
- break;
- }
- }
- else if (pGC->fillStyle == FillStippled)
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- devPriv->FillArea = mfbStippleWhiteArea;
- break;
- case RROP_BLACK:
- devPriv->FillArea = mfbStippleBlackArea;
- break;
- case RROP_INVERT:
- devPriv->FillArea = mfbStippleInvertArea;
- break;
- case RROP_NOP:
- devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
- break;
- }
- }
- else /* deal with tiles */
- {
- switch (pGC->alu)
- {
- case GXcopy:
- devPriv->FillArea = mfbTileAreaPPWCopy;
- break;
- default:
- devPriv->FillArea = mfbTileAreaPPWGeneral;
- break;
- }
- }
- } /* end of natural rectangles */
- } /* end of new_fill */
-
-#else
-
- {
- /* install a suitable fillspans and pushpixels */
- pGC->ops->PushPixels = miPushPixels;
- pGC->ops->FillPolygon = miFillPolygon;
- if ((pGC->fillStyle == FillSolid) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))))
- {
- pGC->ops->PushPixels = miPushPixels;
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- pGC->ops->FillSpans = mfbWhiteSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyWhite;
- break;
- case RROP_BLACK:
- pGC->ops->FillSpans = mfbBlackSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyBlack;
- break;
- case RROP_INVERT:
- pGC->ops->FillSpans = mfbInvertSolidFS;
- pGC->ops->FillPolygon = mfbFillPolyInvert;
- break;
- case RROP_NOP:
- pGC->ops->FillSpans = (void (*)())NoopDDA;
- pGC->ops->FillPolygon = (void (*)())NoopDDA;
- break;
- }
- }
- /* beyond this point, opaqueStippled ==> fg != bg */
- else if (((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillOpaqueStippled)) &&
- !pGC->pRotatedPixmap)
- {
- pGC->ops->FillSpans = mfbUnnaturalTileFS;
- }
- else if ((pGC->fillStyle == FillStippled) && !pGC->pRotatedPixmap)
- {
- pGC->ops->FillSpans = mfbUnnaturalStippleFS;
- }
- else if (pGC->fillStyle == FillStippled)
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- pGC->ops->FillSpans = mfbWhiteStippleFS;
- case RROP_BLACK:
- pGC->ops->FillSpans = mfbBlackStippleFS;
- case RROP_INVERT:
- pGC->ops->FillSpans = mfbInvertStippleFS;
- case RROP_NOP:
- pGC->ops->FillSpans = (void (*)())NoopDDA;
- break;
- }
- }
- else /* overload tiles to do parti-colored opaque stipples */
- {
- pGC->ops->FillSpans = mfbTileFS;
- }
- pGC->ops->PolyFillArc = miPolyFillArc;
- /* the rectangle code doesn't deal with opaque stipples that
- are two colors -- we can fool it for fg==bg, though
- */
- if ((((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillStippled)) &&
- !pGC->pRotatedPixmap) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) != (pGC->bgPixel & 1)))
- )
- {
- pGC->ops->PolyFillRect = miPolyFillRect;
- }
- else /* deal with solids and natural stipples and tiles */
- {
- pGC->ops->PolyFillRect = mfbPolyFillRect;
-
- if ((pGC->fillStyle == FillSolid) ||
- ((pGC->fillStyle == FillOpaqueStippled) &&
- ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))))
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- devPriv->FillArea = mfbSolidWhiteArea;
- break;
- case RROP_BLACK:
- devPriv->FillArea = mfbSolidBlackArea;
- break;
- case RROP_INVERT:
- devPriv->FillArea = mfbSolidInvertArea;
- break;
- case RROP_NOP:
- devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
- break;
- }
- }
- else if (pGC->fillStyle == FillStippled)
- {
- switch(devPriv->rop)
- {
- case RROP_WHITE:
- devPriv->FillArea = mfbStippleWhiteArea;
- break;
- case RROP_BLACK:
- devPriv->FillArea = mfbStippleBlackArea;
- break;
- case RROP_INVERT:
- devPriv->FillArea = mfbStippleInvertArea;
- break;
- case RROP_NOP:
- devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
- break;
- }
- }
- else /* deal with tiles */
- {
- switch (pGC->alu)
- {
- case GXcopy:
- devPriv->FillArea = mfbTileAreaPPWCopy;
- break;
- default:
- devPriv->FillArea = mfbTileAreaPPWGeneral;
- break;
- }
- }
- } /* end of natural rectangles */
- } /* end of new_fill */
-
-#endif /* ifndef LOWMEMFTPT */
-
-}
-
-/* table to map alu(src, dst) to alu(~src, dst) */
-int InverseAlu[16] = {
- GXclear,
- GXandInverted,
- GXnor,
- GXcopyInverted,
- GXand,
- GXnoop,
- GXequiv,
- GXorInverted,
- GXandReverse,
- GXxor,
- GXinvert,
- GXnand,
- GXcopy,
- GXor,
- GXorReverse,
- GXset
-};
-
-int
-mfbReduceRop(alu, src)
- register int alu;
- register Pixel src;
-{
- int rop = 0;
- if ((src & 1) == 0) /* src is black */
- {
- switch(alu)
- {
- case GXclear:
- rop = RROP_BLACK;
- break;
- case GXand:
- rop = RROP_BLACK;
- break;
- case GXandReverse:
- rop = RROP_BLACK;
- break;
- case GXcopy:
- rop = RROP_BLACK;
- break;
- case GXandInverted:
- rop = RROP_NOP;
- break;
- case GXnoop:
- rop = RROP_NOP;
- break;
- case GXxor:
- rop = RROP_NOP;
- break;
- case GXor:
- rop = RROP_NOP;
- break;
- case GXnor:
- rop = RROP_INVERT;
- break;
- case GXequiv:
- rop = RROP_INVERT;
- break;
- case GXinvert:
- rop = RROP_INVERT;
- break;
- case GXorReverse:
- rop = RROP_INVERT;
- break;
- case GXcopyInverted:
- rop = RROP_WHITE;
- break;
- case GXorInverted:
- rop = RROP_WHITE;
- break;
- case GXnand:
- rop = RROP_WHITE;
- break;
- case GXset:
- rop = RROP_WHITE;
- break;
- }
- }
- else /* src is white */
- {
- switch(alu)
- {
- case GXclear:
- rop = RROP_BLACK;
- break;
- case GXand:
- rop = RROP_NOP;
- break;
- case GXandReverse:
- rop = RROP_INVERT;
- break;
- case GXcopy:
- rop = RROP_WHITE;
- break;
- case GXandInverted:
- rop = RROP_BLACK;
- break;
- case GXnoop:
- rop = RROP_NOP;
- break;
- case GXxor:
- rop = RROP_INVERT;
- break;
- case GXor:
- rop = RROP_WHITE;
- break;
- case GXnor:
- rop = RROP_BLACK;
- break;
- case GXequiv:
- rop = RROP_NOP;
- break;
- case GXinvert:
- rop = RROP_INVERT;
- break;
- case GXorReverse:
- rop = RROP_WHITE;
- break;
- case GXcopyInverted:
- rop = RROP_BLACK;
- break;
- case GXorInverted:
- rop = RROP_NOP;
- break;
- case GXnand:
- rop = RROP_INVERT;
- break;
- case GXset:
- rop = RROP_WHITE;
- break;
- }
- }
- return rop;
-}
diff --git a/mfb/mfbgetsp.c b/mfb/mfbgetsp.c
deleted file mode 100644
index 59bd7e538..000000000
--- a/mfb/mfbgetsp.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbgetsp.c,v 1.4 2003/02/18 21:30:01 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbgetsp.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "region.h"
-#include "gc.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
- * and continuing for pwidth[i] bits
- * Each scanline returned will be server scanline padded, i.e., it will come
- * out to an integral number of words.
- */
-/*ARGSUSED*/
-void
-mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pchardstStart; /* where to put the bits */
-{
- PixelType *pdstStart = (PixelType *)(pointer)pchardstStart;
- register PixelType *pdst; /* where to put the bits */
- register PixelType *psrc; /* where to get the bits */
- register PixelType tmpSrc; /* scratch buffer for bits */
- PixelType *psrcBase; /* start of src bitmap */
- int widthSrc; /* width of pixmap in bytes */
- register DDXPointPtr pptLast; /* one past last point to get */
- int xEnd; /* last pixel to copy from */
- register int nstart;
- int nend = 0;
- int srcStartOver;
- PixelType startmask, endmask;
- unsigned int srcBit;
- int nlMiddle, nl;
- int w;
-
- pptLast = ppt + nspans;
-
- mfbGetPixelWidthAndPointer(pDrawable, widthSrc, psrcBase);
- pdst = pdstStart;
-
- while(ppt < pptLast)
- {
- /* XXX should this really be << PWSH, or * 8, or * PGSZB? */
- xEnd = min(ppt->x + *pwidth, widthSrc << PWSH);
- pwidth++;
- psrc = mfbScanline(psrcBase, ppt->x, ppt->y, widthSrc);
- w = xEnd - ppt->x;
- srcBit = ppt->x & PIM;
-
- if (srcBit + w <= PPW)
- {
- getandputbits0(psrc, srcBit, w, pdst);
- pdst++;
- }
- else
- {
-
- maskbits(ppt->x, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - srcBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- srcStartOver = srcBit + nstart > PLST;
- if (startmask)
- {
- getandputbits0(psrc, srcBit, nstart, pdst);
- if(srcStartOver)
- psrc++;
- }
- nl = nlMiddle;
-#ifdef FASTPUTBITS
- Duff(nl, putbits(*psrc, nstart, PPW, pdst); psrc++; pdst++;);
-#else
- while (nl--)
- {
- tmpSrc = *psrc;
- putbits(tmpSrc, nstart, PPW, pdst);
- psrc++;
- pdst++;
- }
-#endif
- if (endmask)
- {
- putbits(*psrc, nstart, nend, pdst);
- if(nstart + nend > PPW)
- pdst++;
- }
- if (startmask || endmask)
- pdst++;
- }
- ppt++;
- }
-}
diff --git a/mfb/mfbhrzvert.c b/mfb/mfbhrzvert.c
deleted file mode 100644
index 237e337f5..000000000
--- a/mfb/mfbhrzvert.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbhrzvert.c,v 1.5 2001/12/14 20:00:08 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbhrzvert.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-
-#include "gc.h"
-#include "window.h"
-#include "pixmap.h"
-#include "region.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-/* horizontal solid line
- abs(len) > 1
-*/
-void
-mfbHorzS(rop, addrl, nlwidth, x1, y1, len)
-int rop; /* a reduced rasterop */
-register PixelType *addrl; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int x1; /* initial point */
-int y1;
-int len; /* length of line */
-{
- register PixelType startmask;
- register PixelType endmask;
- register int nlmiddle;
-
-
- /* force the line to go left to right
- but don't draw the last point
- */
- if (len < 0)
- {
- x1 += len;
- x1 += 1;
- len = -len;
- }
-
- addrl = mfbScanline(addrl, x1, y1, nlwidth);
-
- /* all bits inside same longword */
- if ( ((x1 & PIM) + len) < PPW)
- {
- maskpartialbits(x1, len, startmask);
- if (rop == RROP_BLACK)
- {
- *addrl &= ~startmask;
- }
- else if (rop == RROP_WHITE)
- {
- *addrl |= startmask;
- }
- else if (rop == RROP_INVERT)
- {
- *addrl ^= startmask;
- }
- }
- else
- {
- maskbits(x1, len, startmask, endmask, nlmiddle);
- if (rop == RROP_BLACK)
- {
- if (startmask)
- *addrl++ &= ~startmask;
- Duff (nlmiddle, *addrl++ = 0x0);
- if (endmask)
- *addrl &= ~endmask;
- }
- else if (rop == RROP_WHITE)
- {
- if (startmask)
- *addrl++ |= startmask;
- Duff (nlmiddle, *addrl++ = ~0);
- if (endmask)
- *addrl |= endmask;
- }
- else if (rop == RROP_INVERT)
- {
- if (startmask)
- *addrl++ ^= startmask;
- Duff (nlmiddle, *addrl++ ^= ~0);
- if (endmask)
- *addrl ^= endmask;
- }
- }
-}
-
-/* vertical solid line
- this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
- better code. sigh. we know that len will never be 0 or 1, so
- it's OK to use it.
-*/
-
-void
-mfbVertS(rop, addrl, nlwidth, x1, y1, len)
-int rop; /* a reduced rasterop */
-register PixelType *addrl; /* pointer to base of bitmap */
-register int nlwidth; /* width in longwords of bitmap */
-int x1, y1; /* initial point */
-register int len; /* length of line */
-{
- register PixelType bitmask;
-
- addrl = mfbScanline(addrl, x1, y1, nlwidth);
-
- if (len < 0)
- {
- nlwidth = -nlwidth;
- len = -len;
- }
-
- if (rop == RROP_BLACK)
- {
- bitmask = rmask[x1 & PIM];
- Duff(len, *addrl &= bitmask; mfbScanlineInc(addrl, nlwidth) );
- }
- else if (rop == RROP_WHITE)
- {
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl |= bitmask; mfbScanlineInc(addrl, nlwidth) );
- }
- else if (rop == RROP_INVERT)
- {
- bitmask = mask[x1 & PIM];
- Duff(len, *addrl ^= bitmask; mfbScanlineInc(addrl, nlwidth) );
- }
-}
diff --git a/mfb/mfbimage.c b/mfb/mfbimage.c
deleted file mode 100644
index 4d616ed8b..000000000
--- a/mfb/mfbimage.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbimage.c,v 1.6 2001/12/14 20:00:08 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbimage.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-
-#include "mfb.h"
-#include "mi.h"
-#include "Xmd.h"
-
-#include "maskbits.h"
-
-#include "servermd.h"
-
-/* Put and Get images on a monochrome frame buffer
- *
- * we do this by creating a temporary pixmap and making its
- * pointer to bits point to the buffer read in from the client.
- * this works because of the padding rules specified at startup
- *
- * Note that CopyArea must know how to copy a bitmap into the server-format
- * temporary pixmap.
- *
- * For speed, mfbPutImage should allocate the temporary pixmap on the stack.
- *
- * even though an XYBitmap and an XYPixmap have the same
- * format (for this device), PutImage has different semantics for the
- * two. XYPixmap just does the copy; XYBitmap takes gc.fgPixel for
- * a 1 bit, gc.bgPixel for a 0 bit, which we notice is exactly
- * like CopyPlane.
- *
- * written by drewry, september 1986
- */
-
-
-
-/*ARGSUSED*/
-void
-mfbPutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pImage)
- DrawablePtr dst;
- GCPtr pGC;
- int depth, x, y, w, h;
- int leftPad;
- int format;
- char *pImage;
-{
- PixmapPtr pPixmap;
-
- if (!(pGC->planemask & 1))
- return;
-
- /* 0 may confuse CreatePixmap, and will sometimes be
- passed by the mi text code
- */
- if ((w == 0) || (h == 0))
- return;
-
- pPixmap = GetScratchPixmapHeader(dst->pScreen, w+leftPad, h, 1, 1,
- BitmapBytePad(w+leftPad), (pointer)pImage);
- if (!pPixmap)
- return;
-
- pGC->fExpose = FALSE;
- if (format != XYBitmap)
- (*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, leftPad, 0,
- w, h, x, y);
- else
- (*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, leftPad, 0,
- w, h, x, y, 1);
- pGC->fExpose = TRUE;
- FreeScratchPixmapHeader(pPixmap);
-}
-
-
-/*
- * pdstLine points to space allocated by caller, which he can do since
- * he knows dimensions of the pixmap
- * we can call mfbDoBitblt because the dispatcher has promised not to send us
- * anything that would require going over the edge of the screen.
- *
- * XYPixmap and ZPixmap are the same for mfb.
- * For any planemask with bit 0 == 0, just fill the dst with 0.
- */
-/*ARGSUSED*/
-void
-mfbGetImage( pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char *pdstLine;
-{
- BoxRec box;
- DDXPointRec ptSrc;
- RegionRec rgnDst;
-
- if (planeMask & 0x1)
- {
- ScreenPtr pScreen = pDrawable->pScreen;
- PixmapPtr pPixmap;
-
- pPixmap = GetScratchPixmapHeader(pScreen, w, h, /*depth*/ 1, /*bpp*/ 1,
- BitmapBytePad(w), (pointer)pdstLine);
- if (!pPixmap)
- return;
-
- ptSrc.x = sx + pDrawable->x;
- ptSrc.y = sy + pDrawable->y;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- REGION_INIT(pScreen, &rgnDst, &box, 1);
- mfbDoBitblt(pDrawable, (DrawablePtr)pPixmap,
- GXcopy, &rgnDst, &ptSrc);
- REGION_UNINIT(pScreen, &rgnDst);
- FreeScratchPixmapHeader(pPixmap);
- }
- else
- {
- bzero(pdstLine, BitmapBytePad(w) * h);
- }
-}
diff --git a/mfb/mfbimggblt.c b/mfb/mfbimggblt.c
deleted file mode 100644
index 066ca3ce7..000000000
--- a/mfb/mfbimggblt.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbimggblt.c,v 3.6 2003/11/03 05:11:59 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbimggblt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- we should eventually special-case fixed-width fonts for ImageText.
-
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were wlle-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
- to avoid source proliferation, this file is compiled
-three times:
- MFBIMAGEGLYPHBLT OPEQ
- mfbImageGlyphBltWhite |=
- mfbImageGlyphBltBlack &=~
-
- the register allocations for startmask and endmask may not
-be the right thing. are there two other deserving candidates?
-xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
-*/
-
-void
-MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
- xRectangle backrect;/* backing rectangle to paint.
- in the general case, NOT necessarily
- the same as the string's bounding box
- */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst;
- /* pointer to current longword in dst */
-
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
-
- register int nFirst;/* bits of glyph in current longword */
- mfbPrivGC *pPrivGC;
- mfbFillAreaProcPtr oldFillArea;
- /* we might temporarily usurp this
- field in devPriv */
-
- if (!(pGC->planemask & 1))
- return;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- mfbGetPixelWidthAndPointer(pDrawable, widthDst, pdstBase);
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- backrect.x = x;
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.width = info.overallWidth;
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
- x += xorg;
- y += yorg;
-
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- /* UNCLEAN CODE
- we know the mfbPolyFillRect uses only two fields in
- devPrivate[mfbGCPrivateIndex].ptr, one of which (ropFillArea) is
- irrelevant for solid filling, so we just poke the FillArea
- field. the GC is now in an inconsistent state, but we'll fix
- it as soon as PolyFillRect returns. fortunately, the server
- is single threaded.
-
- NOTE:
- if you are not using the standard mfbFillRectangle code, you
- need to poke any fields in the GC the rectangle stuff need
- (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGCPrivateIndex].ptr
- (probably rop or ropFillArea.) You could just call ValidateGC,
- but that is usually not a cheap thing to do.
- */
-
- pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
- oldFillArea = pPrivGC->FillArea;
-
- if (pGC->bgPixel & 1)
- pPrivGC->FillArea = mfbSolidWhiteArea;
- else
- pPrivGC->FillArea = mfbSolidBlackArea;
-
-#ifndef LOWMEMFTPT
- mfbPolyFillRect(pDrawable, pGC, 1, &backrect);
-#else
- miPolyFillRect(pDrawable, pGC, 1, &backrect);
-#endif
- pPrivGC->FillArea = oldFillArea;
-
- /* the faint-hearted can open their eyes now */
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
- {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xchar = x & PIM;
-
- while(nglyph--)
- {
- pci = *ppci;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- h = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- /* start at top scanline of glyph */
- pdst = pdstBase;
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST)
- {
- pdst++;
- xoff &= PIM;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- pdst = mfbScanlineDelta(pdst, -pci->metrics.ascent, widthDst);
-
- if ((xoff + w) <= PPW)
- {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- else
- {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- } /* glyph crosses longwords boundary */
-
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar -= PPW;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- TEXTPOS *ppos;
- int nbox;
- BoxPtr pbox;
- RegionPtr cclip;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
-#if GETLEFTBITS_ALIGNMENT > 1
- int getWidth; /* bits to get from glyph */
-#endif
-
- if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
- return;
-
- pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i=0; i<nglyph; i++)
- {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar &= PIM;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- /* HACK ALERT
- since we continue out of the loop below so often, it
- is easier to increment pbox at the top than at the end.
- don't try this at home.
- */
- pbox--;
- while(nbox--)
- {
- pbox++;
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for(i=0; i<nglyph; i++)
- {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- h = bottomEdge - topEdge;
- if (h <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- pglyph += (glyphRow * widthGlyph);
-
- pdst = ppos[i].pdstBase;
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
-#if GETLEFTBITS_ALIGNMENT > 1
- getWidth = w + glyphCol;
-#endif
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST)
- {
- xoff &= PIM;
- pdst++;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- pdst = mfbScanlineDelta(pdst, -(y-topEdge), widthDst);
-
- if ((xoff + w) <= PPW)
- {
- maskpartialbits(xoff, w, startmask);
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- else
- {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
- default:
- break;
- }
-}
diff --git a/mfb/mfbline.c b/mfb/mfbline.c
deleted file mode 100644
index e7e678983..000000000
--- a/mfb/mfbline.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbline.c,v 1.7 2001/12/14 20:00:09 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbline.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-#include "miline.h"
-
-/* single-pixel lines on a color frame buffer
-
- NON-SLOPED LINES
- horizontal lines are always drawn left to right; we have to
-move the endpoints right by one after they're swapped.
- horizontal lines will be confined to a single band of a
-region. the code finds that band (giving up if the lower
-bound of the band is above the line we're drawing); then it
-finds the first box in that band that contains part of the
-line. we clip the line to subsequent boxes in that band.
- vertical lines are always drawn top to bottom (y-increasing.)
-this requires adding one to the y-coordinate of each endpoint
-after swapping.
-
- SLOPED LINES
- when clipping a sloped line, we bring the second point inside
-the clipping box, rather than one beyond it, and then add 1 to
-the length of the line before drawing it. this lets us use
-the same box for finding the outcodes for both endpoints. since
-the equation for clipping the second endpoint to an edge gives us
-1 beyond the edge, we then have to move the point towards the
-first point by one step on the major axis.
- eventually, there will be a diagram here to explain what's going
-on. the method uses Cohen-Sutherland outcodes to determine
-outsideness, and a method similar to Pike's layers for doing the
-actual clipping.
-
-*/
-
-void
-#ifdef POLYSEGMENT
-mfbSegmentSS (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-mfbLineSS (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- unsigned int oc1; /* outcode of point 1 */
- unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrlBase; /* pointer to start of drawable */
-#ifndef POLYSEGMENT
- PixelType *addrl; /* address of destination pixmap */
-#endif
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
-
- /* a bunch of temporaries */
- register int y1, y2;
- register int x1, x2;
- RegionPtr cclip;
- int alu;
-
- if (!(pGC->planemask & 1))
- return;
-
- cclip = pGC->pCompositeClip;
- alu = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- if (x1 == x2) /* vertical line */
- {
- /* make the line go top to bottom of screen, keeping
- endpoint semantics
- */
- if (y1 > y2)
- {
- register int tmp;
-
- tmp = y2;
- y2 = y1 + 1;
- y1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- y1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- y2++;
-#endif
- /* get to first band that might contain part of line */
- while ((nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- if (nbox)
- {
- /* stop when lower edge of box is beyond end of line */
- while((nbox) && (y2 >= pbox->y1))
- {
- if ((x1 >= pbox->x1) && (x1 < pbox->x2))
- {
- int y1t, y2t;
- /* this box has part of the line in it */
- y1t = max(y1, pbox->y1);
- y2t = min(y2, pbox->y2);
- if (y1t != y2t)
- {
- mfbVertS (alu,
- addrlBase, nlwidth,
- x1, y1t, y2t-y1t);
- }
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- y2 = ppt->y + yorg;
-#endif
- }
- else if (y1 == y2) /* horizontal line */
- {
- /* force line from left to right, keeping
- endpoint semantics
- */
- if (x1 > x2)
- {
- register int tmp;
-
- tmp = x2;
- x2 = x1 + 1;
- x1 = tmp + 1;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- x1--;
-#endif
- }
-#ifdef POLYSEGMENT
- else if (pGC->capStyle != CapNotLast)
- x2++;
-#endif
-
- /* find the correct band */
- while( (nbox) && (pbox->y2 <= y1))
- {
- pbox++;
- nbox--;
- }
-
- /* try to draw the line, if we haven't gone beyond it */
- if ((nbox) && (pbox->y1 <= y1))
- {
- int tmp;
-
- /* when we leave this band, we're done */
- tmp = pbox->y1;
- while((nbox) && (pbox->y1 == tmp))
- {
- int x1t, x2t;
-
- if (pbox->x2 <= x1)
- {
- /* skip boxes until one might contain start point */
- nbox--;
- pbox++;
- continue;
- }
-
- /* stop if left of box is beyond right of line */
- if (pbox->x1 >= x2)
- {
- nbox = 0;
- break;
- }
-
- x1t = max(x1, pbox->x1);
- x2t = min(x2, pbox->x2);
- if (x1t != x2t)
- {
- mfbHorzS (alu,
- addrlBase, nlwidth,
- x1t, y1, x2t-x1t);
- }
- nbox--;
- pbox++;
- }
- }
-#ifndef POLYSEGMENT
- x2 = ppt->x + xorg;
-#endif
- }
- else /* sloped line */
- {
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
- 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
- if (axis == X_AXIS)
- len = adx;
- else
- len = ady;
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- len++;
-#endif
- mfbBresS (alu,
- addrlBase, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, len);
- break;
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
- pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
-
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- mfbBresS
- (alu,
- addrlBase, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
- } /* sloped line */
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
-
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- PixelType _mask;
-
- if (alu == RROP_BLACK)
- _mask = rmask[x2 & PIM];
- else
- _mask = mask[x2 & PIM];
-
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- addrl = mfbScanline(addrlBase, x2, y2, nlwidth);
- switch(alu)
- {
- case RROP_BLACK:
- *addrl &= _mask;
- break;
- case RROP_WHITE:
- *addrl |= _mask;
- break;
- case RROP_INVERT:
- *addrl ^= _mask;
- break;
- }
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
-
-/*
- * Draw dashed 1-pixel lines.
- */
-
-void
-#ifdef POLYSEGMENT
-mfbSegmentSD (pDrawable, pGC, nseg, pSeg)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int nseg;
- register xSegment *pSeg;
-#else
-mfbLineSD( pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-#endif
-{
- int nboxInit;
- register int nbox;
- BoxPtr pboxInit;
- register BoxPtr pbox;
-#ifndef POLYSEGMENT
- register DDXPointPtr ppt; /* pointer to list of translated points */
-#endif
-
- register unsigned int oc1; /* outcode of point 1 */
- register unsigned int oc2; /* outcode of point 2 */
-
- PixelType *addrl; /* address of destination pixmap */
- int nlwidth; /* width in longwords of destination pixmap */
- int xorg, yorg; /* origin of window */
-
- int adx; /* abs values of dx and dy */
- int ady;
- int signdx; /* sign of dx and dy */
- int signdy;
- int e, e1, e2; /* bresenham error and increments */
- int len; /* length of segment */
- int axis; /* major axis */
- int octant;
- unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
- int x1, x2, y1, y2;
- RegionPtr cclip;
- int fgrop = 0, bgrop = 0;
- unsigned char *pDash;
- int dashOffset;
- int numInDashList;
- int dashIndex;
- int isDoubleDash;
- int dashIndexTmp, dashOffsetTmp;
- int unclippedlen;
-
- if (!(pGC->planemask & 1))
- return;
-
- cclip = pGC->pCompositeClip;
- fgrop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
- pboxInit = REGION_RECTS(cclip);
- nboxInit = REGION_NUM_RECTS(cclip);
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrl);
-
- /* compute initial dash values */
-
- pDash = (unsigned char *) pGC->dash;
- numInDashList = pGC->numInDashList;
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
- numInDashList, &dashOffset);
-
- if (isDoubleDash)
- bgrop = mfbReduceRop(pGC->alu, pGC->bgPixel);
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-#ifdef POLYSEGMENT
- while (nseg--)
-#else
- ppt = pptInit;
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
- while(--npt)
-#endif
- {
- nbox = nboxInit;
- pbox = pboxInit;
-
-#ifdef POLYSEGMENT
- x1 = pSeg->x1 + xorg;
- y1 = pSeg->y1 + yorg;
- x2 = pSeg->x2 + xorg;
- y2 = pSeg->y2 + yorg;
- pSeg++;
-#else
- x1 = x2;
- y1 = y2;
- ++ppt;
- if (mode == CoordModePrevious)
- {
- xorg = x1;
- yorg = y1;
- }
- x2 = ppt->x + xorg;
- y2 = ppt->y + yorg;
-#endif
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
-
- if (adx > ady)
- {
- axis = X_AXIS;
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- unclippedlen = adx;
- }
- else
- {
- axis = Y_AXIS;
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- unclippedlen = ady;
- SetYMajorOctant(octant);
- }
-
- FIXUP_ERROR(e, octant, bias);
-
- /* we have bresenham parameters and two points.
- all we have to do now is clip and draw.
- */
-
- while(nbox--)
- {
- oc1 = 0;
- oc2 = 0;
- OUTCODES(oc1, x1, y1, pbox);
- OUTCODES(oc2, x2, y2, pbox);
- if ((oc1 | oc2) == 0)
- {
-#ifdef POLYSEGMENT
- if (pGC->capStyle != CapNotLast)
- unclippedlen++;
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- mfbBresD (fgrop, bgrop,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- break;
-#else
- mfbBresD (fgrop, bgrop,
- &dashIndex, pDash, numInDashList,
- &dashOffset, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, x1, y1,
- e, e1, e2, unclippedlen);
- goto dontStep;
-#endif
- }
- else if (oc1 & oc2)
- {
- pbox++;
- }
- else /* have to clip */
- {
- int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
- int clip1 = 0, clip2 = 0;
- int clipdx, clipdy;
- int err;
-
- if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady, &clip1, &clip2,
- octant, bias, oc1, oc2) == -1)
- {
- pbox++;
- continue;
- }
- dashIndexTmp = dashIndex;
- dashOffsetTmp = dashOffset;
- if (clip1)
- {
- int dlen;
-
- if (axis == X_AXIS)
- dlen = abs(new_x1 - x1);
- else
- dlen = abs(new_y1 - y1);
- miStepDash (dlen, &dashIndexTmp, pDash,
- numInDashList, &dashOffsetTmp);
- }
- if (axis == X_AXIS)
- len = abs(new_x2 - new_x1);
- else
- len = abs(new_y2 - new_y1);
-#ifdef POLYSEGMENT
- if (clip2 != 0 || pGC->capStyle != CapNotLast)
- len++;
-#else
- len += (clip2 != 0);
-#endif
- if (len)
- {
- /* unwind bresenham error term to first point */
- if (clip1)
- {
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- if (axis == X_AXIS)
- err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
- else
- err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
- }
- else
- err = e;
- mfbBresD (fgrop, bgrop,
- &dashIndexTmp, pDash, numInDashList,
- &dashOffsetTmp, isDoubleDash,
- addrl, nlwidth,
- signdx, signdy, axis, new_x1, new_y1,
- err, e1, e2, len);
- }
- pbox++;
- }
- } /* while (nbox--) */
-#ifndef POLYSEGMENT
- /*
- * walk the dash list around to the next line
- */
- miStepDash (unclippedlen, &dashIndex, pDash,
- numInDashList, &dashOffset);
-dontStep: ;
-#endif
- } /* while (nline--) */
-
-#ifndef POLYSEGMENT
- /* paint the last point if the end style isn't CapNotLast.
- (Assume that a projecting, butt, or round cap that is one
- pixel wide is the same as the single pixel of the endpoint.)
- */
-
- if ((pGC->capStyle != CapNotLast) &&
- ((dashIndex & 1) == 0 || isDoubleDash) &&
- ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
- (ppt->y + yorg != pptInit->y + pDrawable->y) ||
- (ppt == pptInit + 1)))
- {
- nbox = nboxInit;
- pbox = pboxInit;
- while (nbox--)
- {
- if ((x2 >= pbox->x1) &&
- (y2 >= pbox->y1) &&
- (x2 < pbox->x2) &&
- (y2 < pbox->y2))
- {
- MfbBits _mask;
- int rop;
-
- rop = fgrop;
- if (dashIndex & 1)
- rop = bgrop;
- if (rop == RROP_BLACK)
- _mask = rmask[x2 & PIM];
- else
- _mask = mask[x2 & PIM];
- addrl = mfbScanline(addrl, x2, y2, nlwidth);
- if (rop == RROP_BLACK)
- *addrl &= _mask;
- else if (rop == RROP_WHITE)
- *addrl |= _mask;
- else
- *addrl ^= _mask;
- break;
- }
- else
- pbox++;
- }
- }
-#endif
-}
diff --git a/mfb/mfbmisc.c b/mfb/mfbmisc.c
deleted file mode 100644
index 67cbf6fc6..000000000
--- a/mfb/mfbmisc.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbmisc.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-#include "misc.h"
-#include "cursor.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-
-/*ARGSUSED*/
-void
-mfbQueryBestSize(class, pwidth, pheight, pScreen)
-int class;
-unsigned short *pwidth;
-unsigned short *pheight;
-ScreenPtr pScreen;
-{
- unsigned width, test;
-
- switch(class)
- {
- case CursorShape:
- if (*pwidth > pScreen->width)
- *pwidth = pScreen->width;
- if (*pheight > pScreen->height)
- *pheight = pScreen->height;
- break;
- case TileShape:
- case StippleShape:
- width = *pwidth;
- if (!width) break;
- /* Return the closes power of two not less than what they gave me */
- test = 0x80000000;
- /* Find the highest 1 bit in the width given */
- while(!(test & width))
- test >>= 1;
- /* If their number is greater than that, bump up to the next
- * power of two */
- if((test - 1) & width)
- test <<= 1;
- *pwidth = test;
- /* We don't care what height they use */
- break;
- }
-}
-
diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c
deleted file mode 100644
index b6ff40292..000000000
--- a/mfb/mfbpixmap.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbpixmap.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-/* pixmap management
- written by drewry, september 1986
-
- on a monchrome device, a pixmap is a bitmap.
-*/
-
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "maskbits.h"
-
-#include "mfb.h"
-#include "mi.h"
-
-#include "servermd.h"
-
-#ifndef LOWMEMFTPT
-
-PixmapPtr
-mfbCreatePixmap (pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
-{
- PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
-
- if (depth != 1)
- return NullPixmap;
- paddedWidth = BitmapBytePad(width);
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
- return NullPixmap;
- pPixmap->drawable.type = DRAWABLE_PIXMAP;
- pPixmap->drawable.class = 0;
- pPixmap->drawable.pScreen = pScreen;
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = depth;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = paddedWidth;
- pPixmap->refcnt = 1;
-#ifdef PIXPRIV
- pPixmap->devPrivate.ptr = datasize ?
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
- pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
- return pPixmap;
-}
-
-#endif /* ifndef LOWMEMFTPT */
-
-Bool
-mfbDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- if(--pPixmap->refcnt)
- return TRUE;
- xfree(pPixmap);
- return TRUE;
-}
-
-
-PixmapPtr
-mfbCopyPixmap(pSrc)
- register PixmapPtr pSrc;
-{
- register PixmapPtr pDst;
- int size;
- ScreenPtr pScreen;
-
- size = pSrc->drawable.height * pSrc->devKind;
- pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
- if (!pDst)
- return NullPixmap;
- memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
- return pDst;
-}
-
-
-/* replicates a pattern to be a full 32 bits wide.
- relies on the fact that each scnaline is longword padded.
- doesn't do anything if pixmap is not a factor of 32 wide.
- changes width field of pixmap if successful, so that the fast
- XRotatePixmap code gets used if we rotate the pixmap later.
-
- calculate number of times to repeat
- for each scanline of pattern
- zero out area to be filled with replicate
- left shift and or in original as many times as needed
-*/
-void
-mfbPadPixmap(pPixmap)
- PixmapPtr pPixmap;
-{
- register int width = pPixmap->drawable.width;
- register int h;
- register PixelType mask;
- register PixelType *p;
- register PixelType bits; /* real pattern bits */
- register int i;
- int rep; /* repeat count for pattern */
-
- if (width >= PPW)
- return;
-
- rep = PPW/width;
- if (rep*width != PPW)
- return;
-
- mask = endtab[width];
-
- p = (PixelType *)(pPixmap->devPrivate.ptr);
- for (h=0; h < pPixmap->drawable.height; h++)
- {
- *p &= mask;
- bits = *p;
- for(i=1; i<rep; i++)
- {
- bits = SCRRIGHT(bits, width);
- *p |= bits;
- }
- p++;
- }
- pPixmap->drawable.width = PPW;
-}
-
-/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
- * words are PPW bits wide, and that the least significant bit appears on the
- * left.
- */
-void
-mfbXRotatePixmap(pPix, rw)
- PixmapPtr pPix;
- register int rw;
-{
- register PixelType *pw, *pwFinal;
- register PixelType t;
-
- if (pPix == NullPixmap)
- return;
-
- pw = (PixelType *)pPix->devPrivate.ptr;
- rw %= (int)pPix->drawable.width;
- if (rw < 0)
- rw += (int)pPix->drawable.width;
- if(pPix->drawable.width == PPW)
- {
- pwFinal = pw + pPix->drawable.height;
- while(pw < pwFinal)
- {
- t = *pw;
- *pw++ = SCRRIGHT(t, rw) |
- (SCRLEFT(t, (PPW-rw)) & endtab[rw]);
- }
- }
- else
- {
- /* We no longer do this. Validate doesn't try to rotate odd-size
- * tiles or stipples. mfbUnnatural<tile/stipple>FS works directly off
- * the unrotate tile/stipple in the GC
- */
- ErrorF("X internal error: trying to rotate odd-sized pixmap.\n");
- }
-
-}
-
-/* Rotates pixmap pPix by h lines. Assumes that h is always less than
- pPix->height
- works on any width.
- */
-void
-mfbYRotatePixmap(pPix, rh)
- register PixmapPtr pPix;
- int rh;
-{
- int nbyDown; /* bytes to move down to row 0; also offset of
- row rh */
- int nbyUp; /* bytes to move up to line rh; also
- offset of first line moved down to 0 */
- char *pbase;
- char *ptmp;
- int height;
-
- if (pPix == NullPixmap)
- return;
- height = (int) pPix->drawable.height;
- rh %= height;
- if (rh < 0)
- rh += height;
-
- pbase = (char *)pPix->devPrivate.ptr;
-
- nbyDown = rh * pPix->devKind;
- nbyUp = (pPix->devKind * height) - nbyDown;
- if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
- return;
-
- memmove(ptmp, pbase, nbyUp); /* save the low rows */
- memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
- memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */
- DEALLOCATE_LOCAL(ptmp);
-}
-
-void
-mfbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
- register PixmapPtr psrcPix, *ppdstPix;
- int xrot, yrot;
-{
- register PixmapPtr pdstPix;
-
- if ((pdstPix = *ppdstPix) &&
- (pdstPix->devKind == psrcPix->devKind) &&
- (pdstPix->drawable.height == psrcPix->drawable.height))
- {
- memmove((char *)pdstPix->devPrivate.ptr,
- (char *)psrcPix->devPrivate.ptr,
- psrcPix->drawable.height * psrcPix->devKind);
- pdstPix->drawable.width = psrcPix->drawable.width;
- pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- else
- {
- if (pdstPix)
- /* FIX XBUG 6168 */
- (*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
- *ppdstPix = pdstPix = mfbCopyPixmap(psrcPix);
- if (!pdstPix)
- return;
- }
- mfbPadPixmap(pdstPix);
- if (xrot)
- mfbXRotatePixmap(pdstPix, xrot);
- if (yrot)
- mfbYRotatePixmap(pdstPix, yrot);
-}
diff --git a/mfb/mfbply1rct.c b/mfb/mfbply1rct.c
deleted file mode 100644
index 980e57246..000000000
--- a/mfb/mfbply1rct.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * $Xorg: mfbply1rct.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-/* $XFree86: xc/programs/Xserver/mfb/mfbply1rct.c,v 1.8 2002/12/09 04:10:57 tsi Exp $ */
-
-#include "X.h"
-
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "mistruct.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-#if defined(mips) || defined(sparc)
-#define GetHighWord(x) (((int) (x)) >> 16)
-#else
-#define GetHighWord(x) (((int) (x)) / 65536)
-#endif
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
-#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
-#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int) ((short) i))
-#else
-#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
-#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
-#define intToX(i) ((int) ((short) (i)))
-#define intToY(i) (GetHighWord(i))
-#endif
-
-void
-MFBFILLPOLY1RECT (pDrawable, pGC, shape, mode, count, ptsIn)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int shape;
- int mode;
- int count;
- DDXPointPtr ptsIn;
-{
- int nlwidth;
- PixelType *addrl, *addr;
- int maxy;
- int origin;
- register int vertex1, vertex2;
- int c;
- BoxPtr extents;
- int clip;
- int y;
- int *vertex1p = NULL, *vertex2p;
- int *endp;
- int x1 = 0, x2 = 0;
- int dx1 = 0, dx2 = 0;
- int dy1 = 0, dy2 = 0;
- int e1 = 0, e2 = 0;
- int step1 = 0, step2 = 0;
- int sign1 = 0, sign2 = 0;
- int h;
- int l, r;
- PixelType mask, bits = ~((PixelType)0);
- int nmiddle;
-
- if (mode == CoordModePrevious || shape != Convex ||
- REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
- return;
- }
- origin = *((int *) &pDrawable->x);
- vertex2 = origin - ((origin & 0x8000) << 1);
- extents = &pGC->pCompositeClip->extents;
- vertex1 = *((int *) &extents->x1) - vertex2;
- vertex2 = *((int *) &extents->x2) - vertex2 - 0x00010001;
- clip = 0;
- y = 32767;
- maxy = 0;
- vertex2p = (int *) ptsIn;
- endp = vertex2p + count;
- while (count--)
- {
- c = *vertex2p;
- clip |= (c - vertex1) | (vertex2 - c);
- c = intToY(c);
- if (c < y)
- {
- y = c;
- vertex1p = vertex2p;
- }
- vertex2p++;
- if (c > maxy)
- maxy = c;
- }
- if (y == maxy)
- return;
-
- if (clip & 0x80008000)
- {
- miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
- return;
- }
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrl);
- addrl = mfbScanlineDelta(addrl, y + pDrawable->y, nlwidth);
- origin = intToX(origin);
- vertex2p = vertex1p;
- vertex2 = vertex1 = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
-#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
- x = intToX(vertex); \
- if ((dy = intToY(c) - y)) { \
- dx = intToX(c) - x; \
- step = 0; \
- if (dx >= 0) \
- { \
- e = 0; \
- sign = 1; \
- if (dx >= dy) {\
- step = dx / dy; \
- dx = dx % dy; \
- } \
- } \
- else \
- { \
- e = 1 - dy; \
- sign = -1; \
- dx = -dx; \
- if (dx >= dy) { \
- step = - (dx / dy); \
- dx = dx % dy; \
- } \
- } \
- } \
- x += origin; \
- vertex = c; \
-}
-
-#define Step(x,dx,dy,e,sign,step) {\
- x += step; \
- if ((e += dx) > 0) \
- { \
- x += sign; \
- e -= dy; \
- } \
-}
- for (;;)
- {
- if (y == intToY(vertex1))
- {
- do
- {
- if (vertex1p == (int *) ptsIn)
- vertex1p = endp;
- c = *--vertex1p;
- Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
- } while (y >= intToY(vertex1));
- h = dy1;
- }
- else
- {
- Step(x1,dx1,dy1,e1,sign1,step1)
- h = intToY(vertex1) - y;
- }
- if (y == intToY(vertex2))
- {
- do
- {
- c = *vertex2p++;
- if (vertex2p == endp)
- vertex2p = (int *) ptsIn;
- Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
- } while (y >= intToY(vertex2));
- if (dy2 < h)
- h = dy2;
- }
- else
- {
- Step(x2,dx2,dy2,e2,sign2,step2)
- if ((c = (intToY(vertex2) - y)) < h)
- h = c;
- }
- /* fill spans for this segment */
- y += h;
- for (;;)
- {
- l = x1;
- r = x2;
- nmiddle = x2 - x1;
- if (nmiddle < 0)
- {
- nmiddle = -nmiddle;
- l = x2;
- r = x1;
- }
- c = l & PIM;
- l -= c;
- l = l >> PWSH;
- addr = addrl + l;
- if (c + nmiddle < PPW)
- {
- mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle);
- *addr OPEQ mask;
- }
- else
- {
- if (c)
- {
- mask = SCRRIGHT(bits, c);
- *addr OPEQ mask;
- nmiddle += c - PPW;
- addr++;
- }
- nmiddle >>= PWSH;
- Duff (nmiddle, *addr++ EQWHOLEWORD)
- if ((mask = ~SCRRIGHT(bits, r & PIM)))
- *addr OPEQ mask;
- }
- if (!--h)
- break;
- mfbScanlineInc(addrl, nlwidth);
- Step(x1,dx1,dy1,e1,sign1,step1)
- Step(x2,dx2,dy2,e2,sign2,step2)
- }
- if (y == maxy)
- break;
- mfbScanlineInc(addrl, nlwidth);
- }
-}
diff --git a/mfb/mfbplygblt.c b/mfb/mfbplygblt.c
deleted file mode 100644
index 61a7297f0..000000000
--- a/mfb/mfbplygblt.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbplygblt.c,v 3.5 2003/11/03 05:12:00 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbplygblt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-#include "miscstruct.h"
-
-/*
- we should eventually special-case fixed-width fonts, although
-its more important for ImageText, which is meant for terminal
-emulators.
-
- this works for fonts with glyphs <= 32 bits wide.
-
- the clipping calculations are done for worst-case fonts.
-we make no assumptions about the heights, widths, or bearings
-of the glyphs. if we knew that the glyphs are all the same height,
-we could clip the tops and bottoms per clipping box, rather
-than per character per clipping box. if we knew that the glyphs'
-left and right bearings were well-behaved, we could clip a single
-character at the start, output until the last unclipped
-character, and then clip the last one. this is all straightforward
-to determine based on max-bounds and min-bounds from the font.
- there is some inefficiency introduced in the per-character
-clipping to make what's going on clearer.
-
- (it is possible, for example, for a font to be defined in which the
-next-to-last character in a font would be clipped out, but the last
-one wouldn't. the code below deals with this.)
-
- PolyText looks at the fg color and the rasterop; mfbValidateGC
-swaps in the right routine after looking at the reduced ratserop
-in the private field of the GC.
-
- the register allocations are provisional; in particualr startmask and
-endmask might not be the right things. pglyph, xoff, pdst, and tmpSrc
-are fairly obvious, though.
-
- to avoid source proliferation, this file is compiled
-three times:
- MFBPOLYGLYPHBLT OPEQ
- mfbPolyGlyphBltWhite |=
- mfbPolyGlyphBltBlack &=~
- mfbPolyGlyphBltInvert ^=
-*/
-
-void
-MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs (unused in R5) */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- BoxRec bbox; /* string's bounding box */
-
- CharInfoPtr pci;
- int xorg, yorg; /* origin of drawable in bitmap */
- int widthDst; /* width of dst in longwords */
-
- /* these keep track of the character origin */
- PixelType *pdstBase;
- /* points to longword with character origin */
- int xchar; /* xorigin of char (mod 32) */
-
- /* these are used for placing the glyph */
- register int xoff; /* x offset of left edge of glyph (mod 32) */
- register PixelType *pdst;
- /* pointer to current longword in dst */
-
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- int widthGlyph; /* width of glyph, in bytes */
- register unsigned char *pglyph;
- /* pointer to current row of glyph */
-
- /* used for putting down glyph */
- register PixelType tmpSrc;
- /* for getting bits from glyph */
- register PixelType startmask;
- register PixelType endmask;
- register int nFirst;/* bits of glyph in current longword */
-
- if (!(pGC->planemask & 1))
- return;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- mfbGetPixelWidthAndPointer(pDrawable, widthDst, pdstBase);
-
- x += xorg;
- y += yorg;
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
- bbox.x1 = x + info.overallLeft;
- bbox.x2 = x + info.overallRight;
- bbox.y1 = y - info.overallAscent;
- bbox.y2 = y + info.overallDescent;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
- {
- case rgnOUT:
- break;
- case rgnIN:
- pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xchar = x & PIM;
-
- while(nglyph--)
- {
- pci = *ppci;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
- h = pci->metrics.ascent + pci->metrics.descent;
- widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- /* start at top scanline of glyph */
- pdst = pdstBase;
-
- /* find correct word in scanline and x offset within it
- for left edge of glyph
- */
- xoff = xchar + pci->metrics.leftSideBearing;
- if (xoff > PLST)
- {
- pdst++;
- xoff &= PIM;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- pdst = mfbScanlineDelta(pdst, -pci->metrics.ascent, widthDst);
-
- if ((xoff + w) <= PPW)
- {
- /* glyph all in one longword */
- maskpartialbits(xoff, w, startmask);
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- else
- {
- /* glyph crosses longword boundary */
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getleftbits(pglyph, w, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- } /* glyph crosses longwords boundary */
-
- /* update character origin */
- x += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar -= PPW;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- ppci++;
- } /* while nglyph-- */
- break;
- case rgnPART:
- {
- TEXTPOS *ppos;
- RegionPtr cclip;
- int nbox;
- BoxPtr pbox;
- int xpos; /* x position of char origin */
- int i;
- BoxRec clip;
- int leftEdge, rightEdge;
- int topEdge, bottomEdge;
- int glyphRow; /* first row of glyph not wholly
- clipped out */
- int glyphCol; /* leftmost visible column of glyph */
-#if GETLEFTBITS_ALIGNMENT > 1
- int getWidth; /* bits to get from glyph */
-#endif
-
- if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
- return;
-
- pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
- xpos = x;
- xchar = xpos & PIM;
-
- for (i=0; i<nglyph; i++)
- {
- pci = ppci[i];
-
- ppos[i].xpos = xpos;
- ppos[i].xchar = xchar;
- ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
- ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
- ppos[i].topEdge = y - pci->metrics.ascent;
- ppos[i].bottomEdge = y + pci->metrics.descent;
- ppos[i].pdstBase = pdstBase;
- ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
-
- xpos += pci->metrics.characterWidth;
- xchar += pci->metrics.characterWidth;
- if (xchar > PLST)
- {
- xchar &= PIM;
- pdstBase++;
- }
- else if (xchar < 0)
- {
- xchar += PPW;
- pdstBase--;
- }
- }
-
- cclip = pGC->pCompositeClip;
- pbox = REGION_RECTS(cclip);
- nbox = REGION_NUM_RECTS(cclip);
-
- for (; --nbox >= 0; pbox++)
- {
- clip.x1 = max(bbox.x1, pbox->x1);
- clip.y1 = max(bbox.y1, pbox->y1);
- clip.x2 = min(bbox.x2, pbox->x2);
- clip.y2 = min(bbox.y2, pbox->y2);
- if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
- continue;
-
- for(i=0; i<nglyph; i++)
- {
- pci = ppci[i];
- xchar = ppos[i].xchar;
-
- /* clip the left and right edges */
- if (ppos[i].leftEdge < clip.x1)
- leftEdge = clip.x1;
- else
- leftEdge = ppos[i].leftEdge;
-
- if (ppos[i].rightEdge > clip.x2)
- rightEdge = clip.x2;
- else
- rightEdge = ppos[i].rightEdge;
-
- w = rightEdge - leftEdge;
- if (w <= 0)
- continue;
-
- /* clip the top and bottom edges */
- if (ppos[i].topEdge < clip.y1)
- topEdge = clip.y1;
- else
- topEdge = ppos[i].topEdge;
-
- if (ppos[i].bottomEdge > clip.y2)
- bottomEdge = clip.y2;
- else
- bottomEdge = ppos[i].bottomEdge;
-
- h = bottomEdge - topEdge;
- if (h <= 0)
- continue;
-
- glyphRow = (topEdge - y) + pci->metrics.ascent;
- widthGlyph = ppos[i].widthGlyph;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- pglyph += (glyphRow * widthGlyph);
-
- pdst = ppos[i].pdstBase;
-
- glyphCol = (leftEdge - ppos[i].xpos) -
- (pci->metrics.leftSideBearing);
-#if GETLEFTBITS_ALIGNMENT > 1
- getWidth = w + glyphCol;
-#endif
- xoff = xchar + (leftEdge - ppos[i].xpos);
- if (xoff > PLST)
- {
- xoff &= PIM;
- pdst++;
- }
- else if (xoff < 0)
- {
- xoff += PPW;
- pdst--;
- }
-
- pdst = mfbScanlineDelta(pdst, -(y-topEdge), widthDst);
-
- if ((xoff + w) <= PPW)
- {
- maskpartialbits(xoff, w, startmask);
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- else
- {
- maskPPWbits(xoff, w, startmask, endmask);
- nFirst = PPW - xoff;
- while (h--)
- {
- getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
- *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
- *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
- pglyph += widthGlyph;
- mfbScanlineInc(pdst, widthDst);
- }
- }
- } /* for each glyph */
- } /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
- break;
- }
- default:
- break;
- }
-}
diff --git a/mfb/mfbpntarea.c b/mfb/mfbpntarea.c
deleted file mode 100644
index 6b45d3f48..000000000
--- a/mfb/mfbpntarea.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbpntarea.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-/*
- the solid fillers are called for rectangles and window backgrounds.
- the boxes are already translated.
- maybe this should always take a pixmap instead of a drawable?
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*
- MFBSOLIDFILLAREA OPEQ EQWHOLEOWRD
- mfbSolidWhiteArea |= = ~0
- mfbSolidBlackArea &=~ = 0
- mfbSolidInvertArea ^= ^= ~0
-
-EQWHOLEWORD is used to write whole longwords. it could use OPEQ,
-but *p++ |= ~0 on at least two compilers generates much
-worse code than *p++ = ~0. similarly for *p++ &= ~~0
-and *p++ = 0.
-
-*/
-
-/*ARGSUSED*/
-void
-MFBSOLIDFILLAREA(pDraw, nbox, pbox, alu, nop)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr nop;
-{
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int h; /* height of current box */
- register PixelType *p; /* pointer to bits we're writing */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType startmask;
- register PixelType endmask;/* masks for reggedy bits at either end of line */
- register int nlwExtra;
- /* to get from right of box to left of next span */
- int nlwMiddle; /* number of longwords between sides of boxes */
- PixelType *pbits; /* pointer to start of drawable */
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, pbits);
-
- while (nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
- p = mfbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
-
- if ( ((pbox->x1 & PIM) + w) < PPW)
- {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- Duff(h, *p OPEQ startmask; mfbScanlineInc(p, nlwExtra));
- }
- else
- {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- nlw = nlwMiddle;
- *p OPEQ startmask;
- p++;
- Duff(nlw, *p++ EQWHOLEWORD);
- *p OPEQ endmask;
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (startmask && !endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- nlw = nlwMiddle;
- *p OPEQ startmask;
- p++;
- Duff(nlw, *p++ EQWHOLEWORD);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (!startmask && endmask)
- {
- while (h--)
- {
- nlw = nlwMiddle;
- Duff(nlw, *p++ EQWHOLEWORD);
- *p OPEQ endmask;
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else /* no ragged bits at either end */
- {
- while (h--)
- {
- nlw = nlwMiddle;
- Duff(nlw, *p++ EQWHOLEWORD);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- }
- pbox++;
- }
-}
-
-
-
-/* stipple a list of boxes
-
-you can use the reduced rasterop for stipples. if rrop is
-black, AND the destination with (not stipple pattern). if rrop is
-white OR the destination with the stipple pattern. if rrop is invert,
-XOR the destination with the stipple pattern.
-
- MFBSTIPPLEFILLAREA OPEQ
- mfbStippleWhiteArea |=
- mfbStippleBlackArea &=~
- mfbStippleInveryArea ^=
-*/
-
-/*ARGSUSED*/
-void
-MFBSTIPPLEFILLAREA(pDraw, nbox, pbox, alu, pstipple)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr pstipple;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
-
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- register int h; /* height of current box */
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, pbits);
-
- tileHeight = pstipple->drawable.height;
- psrc = (PixelType *)(pstipple->devPrivate.ptr);
-
- while (nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
- iy = pbox->y1 % tileHeight;
- p = mfbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
-
- if ( ((pbox->x1 & PIM) + w) < PPW)
- {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- while (h--)
- {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- *p OPEQ (srcpix & startmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else
- {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p OPEQ (srcpix & startmask);
- p++;
- Duff (nlw, *p++ OPEQ srcpix);
- *p OPEQ (srcpix & endmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (startmask && !endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- *p OPEQ (srcpix & startmask);
- p++;
- Duff(nlw, *p++ OPEQ srcpix);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (!startmask && endmask)
- {
- while (h--)
- {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ OPEQ srcpix);
- *p OPEQ (srcpix & endmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else /* no ragged bits at either end */
- {
- while (h--)
- {
- srcpix = psrc[iy];
- iy = ++iy < tileHeight ? iy : 0;
- nlw = nlwMiddle;
- Duff(nlw, *p++ OPEQ srcpix);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- }
- pbox++;
- }
-}
diff --git a/mfb/mfbpntwin.c b/mfb/mfbpntwin.c
deleted file mode 100644
index 97db3bf79..000000000
--- a/mfb/mfbpntwin.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $Xorg: mfbpntwin.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-#include "mi.h"
-
-void
-mfbPaintWindow(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- register mfbPrivWin *pPrivWin;
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- return;
- case BackgroundPixmap:
- if (pPrivWin->fastBackground)
- {
- mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBackground);
- return;
- }
- break;
- case BackgroundPixel:
- if (pWin->background.pixel & 1)
- mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXset, NullPixmap);
- else
- mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXclear, NullPixmap);
- return;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- if (pWin->border.pixel & 1)
- mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXset, NullPixmap);
- else
- mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXclear, NullPixmap);
- return;
- }
- else if (pPrivWin->fastBorder)
- {
- mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion), GXcopy,
- pPrivWin->pRotatedBorder);
- return;
- }
- break;
- }
- miPaintWindow(pWin, pRegion, what);
-}
diff --git a/mfb/mfbpolypnt.c b/mfb/mfbpolypnt.c
deleted file mode 100644
index 38cd4aee8..000000000
--- a/mfb/mfbpolypnt.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbpolypnt.c,v 1.5 2001/12/14 20:00:11 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbpolypnt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "miscstruct.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-void
-mfbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- register DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
-
- register BoxPtr pbox;
- register int nbox;
-
- register PixelType *addrl;
- int nlwidth;
-
- int nptTmp;
- register xPoint *ppt;
-
- register int x;
- register int y;
- register int rop;
- mfbPrivGC *pGCPriv;
-
- if (!(pGC->planemask & 1))
- return;
-
- pGCPriv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
- rop = pGCPriv->rop;
-
- mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrl);
-
- if ((mode == CoordModePrevious) && (npt > 1))
- {
- for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++)
- {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- }
-
- nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
- pbox = REGION_RECTS(pGC->pCompositeClip);
- for (; --nbox >= 0; pbox++)
- {
- if (rop == RROP_BLACK)
- {
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++)
- {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *mfbScanline(addrl, x, y, nlwidth) &= rmask[x & PIM];
- }
- }
- else if (rop == RROP_WHITE)
- {
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++)
- {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *mfbScanline(addrl, x, y, nlwidth) |= mask[x & PIM];
- }
- }
- else if (rop == RROP_INVERT)
- {
- for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++)
- {
- x = ppt->x + pDrawable->x;
- y = ppt->y + pDrawable->y;
- if ((x >= pbox->x1) && (x < pbox->x2) &&
- (y >= pbox->y1) && (y < pbox->y2))
- *mfbScanline(addrl, x, y, nlwidth) ^= mask[x & PIM];
- }
- }
- }
-}
diff --git a/mfb/mfbpushpxl.c b/mfb/mfbpushpxl.c
deleted file mode 100644
index f10e39046..000000000
--- a/mfb/mfbpushpxl.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbpushpxl.c,v 1.7 2003/02/18 21:30:01 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbpushpxl.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "miscstruct.h"
-#include "maskbits.h"
-#include "regionstr.h"
-#include "mfb.h"
-
-/* mfbSolidPP is courtesy of xhacks@csri.toronto.edu
-
- For fillStyle==FillSolid, a monochrome PushPixels can be reduced to
- a ROP in the following way: (Note that the ROP is the same as the
- result of ROP(src=0x3,dst=0x5))
-
- src=0011 0000 0011
- dst=0101 0101 0101
- rop fg=0 fg=1
- GXclear 0x0 0000 0100 0100 0
- GXand 0x1 0001 0100 0101 s&d
- GXandReverse 0x2 0010 0100 0110 s&~d
- GXcopy 0x3 0011 0100 0111 s
- GXandInverted 0x4 0100 0101 0100 ~s&d
- GXnoop 0x5 0101 0101 0101 d
- GXxor 0x6 0110 0101 0110 s^d
- GXor 0x7 0111 0101 0111 s|d
- GXnor 0x8 1000 0110 0100 ~s&~d
- GXequiv 0x9 1001 0110 0101 ~s^d
- GXinvert 0xa 1010 0110 0110 ~d
- GXorReverse 0xb 1011 0110 0111 s|~d
- GXcopyInverted 0xc 1100 0111 0100 ~s
- GXorInverted 0xd 1101 0111 0101 ~s|d
- GXnand 0xe 1110 0111 0110 ~s|~d
- GXset 0xf 1111 0111 0111 1
-
-For src=0: newRop = 0x4|(rop>>2)
-For src=1: newRop = 0x4|(rop&3)
-*/
-
-/* mfbSolidPP -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- unsigned char alu;
- RegionRec rgnDst;
- DDXPointPtr pptSrc;
- BoxRec srcBox;
- register DDXPointPtr ppt;
- register BoxPtr pbox;
- int i;
-
- if (!(pGC->planemask & 1)) return;
-
- /* compute the reduced rop function */
- alu = pGC->alu;
- if (!(pGC->fgPixel&1)) alu >>= 2;
- alu = (alu & 0x3) | 0x4;
- if (alu == GXnoop) return;
-
- srcBox.x1 = xOrg;
- srcBox.y1 = yOrg;
- srcBox.x2 = xOrg + dx;
- srcBox.y2 = yOrg + dy;
- REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1);
-
- /* clip the shape of the dst to the destination composite clip */
- REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
-
- if (!REGION_NIL(&rgnDst))
- {
- i = REGION_NUM_RECTS(&rgnDst);
- pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
- if(pptSrc)
- {
- for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc;
- --i >= 0;
- pbox++, ppt++)
- {
- ppt->x = pbox->x1 - xOrg;
- ppt->y = pbox->y1 - yOrg;
- }
- mfbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc);
- DEALLOCATE_LOCAL(pptSrc);
- }
- }
- REGION_UNINIT(pGC->pScreen, &rgnDst);
-}
-
-#define NPT 128
-
-/* mfbPushPixels -- squeegees the forground color of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
- */
-void
-mfbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- int h, dxDivPPW, ibEnd;
- PixelType *pwLineStart;
- register PixelType *pw, *pwEnd;
- register PixelType mask;
- register int ib;
- register PixelType w;
- register int ipt; /* index into above arrays */
- Bool fInBox;
- DDXPointRec pt[NPT];
- int width[NPT];
-
- /* Now scan convert the pixmap and use the result to call fillspans in
- * in the drawable with the original GC */
- ipt = 0;
- dxDivPPW = dx/PPW;
- for(h = 0; h < dy; h++)
- {
-
- pw = (PixelType *)(pointer)
- (((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind));
- pwLineStart = pw;
- /* Process all words which are fully in the pixmap */
-
- fInBox = FALSE;
- pwEnd = pwLineStart + dxDivPPW;
- while(pw < pwEnd)
- {
- w = *pw;
- mask = endtab[1];
- for(ib = 0; ib < PPW; ib++)
- {
- if(w & mask)
- {
- if(!fInBox)
- {
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- /* end box */
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- pw++;
- }
- ibEnd = dx & PIM;
- if(ibEnd)
- {
- /* Process final partial word on line */
- w = *pw;
- mask = endtab[1];
- for(ib = 0; ib < ibEnd; ib++)
- {
- if(w & mask)
- {
- if(!fInBox)
- {
- /* start new box */
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
- width, TRUE);
- ipt = 0;
- }
- fInBox = FALSE;
- }
- }
- mask = SCRRIGHT(mask, 1);
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox)
- {
- width[ipt] = dx + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- }
- }
- /* Flush any remaining spans */
- if (ipt)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
- }
-}
diff --git a/mfb/mfbscrclse.c b/mfb/mfbscrclse.c
deleted file mode 100644
index 28b0c24c3..000000000
--- a/mfb/mfbscrclse.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* $Xorg: mfbscrclse.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/mfb/mfbscrclse.c,v 1.4 2003/02/18 21:30:01 tsi Exp $ */
-
-#include "mfb.h"
-#include "scrnintstr.h"
-
-/*ARGSUSED*/
-Bool
-mfbCloseScreen(index, pScreen)
- int index;
- register ScreenPtr pScreen;
-{
- xfree(pScreen->devPrivate);
- return TRUE;
-}
-
diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c
deleted file mode 100644
index d07aadb80..000000000
--- a/mfb/mfbscrinit.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbscrinit.c,v 3.9 2003/02/18 21:30:01 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbscrinit.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xproto.h" /* for xColorItem */
-#include "Xmd.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "colormap.h"
-#include "mfb.h"
-#include "mistruct.h"
-#include "dix.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "servermd.h"
-
-#ifdef PIXMAP_PER_WINDOW
-int frameWindowPrivateIndex;
-#endif
-int mfbWindowPrivateIndex;
-int mfbGCPrivateIndex;
-static unsigned long mfbGeneration = 0;
-
-static VisualRec visual = {
-/* vid class bpRGB cmpE nplan rMask gMask bMask oRed oGreen oBlue */
- 0, StaticGray, 1, 2, 1, 0, 0, 0, 0, 0, 0
-};
-
-static VisualID VID;
-
-static DepthRec depth = {
-/* depth numVid vids */
- 1, 1, &VID
-};
-
-#ifndef LOWMEMFTPT
-
-BSFuncRec mfbBSFuncRec = {
- mfbSaveAreas,
- mfbRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
-#endif /* ifndef LOWMEMFTPT */
-
-Bool
-mfbAllocatePrivates(pScreen, pWinIndex, pGCIndex)
- ScreenPtr pScreen;
- int *pWinIndex, *pGCIndex;
-{
- if (mfbGeneration != serverGeneration)
- {
-#ifdef PIXMAP_PER_WINDOW
- frameWindowPrivateIndex = AllocateWindowPrivateIndex();
-#endif
- mfbWindowPrivateIndex = AllocateWindowPrivateIndex();
- mfbGCPrivateIndex = miAllocateGCPrivateIndex();
- visual.vid = FakeClientID(0);
- VID = visual.vid;
- mfbGeneration = serverGeneration;
- }
- if (pWinIndex)
- *pWinIndex = mfbWindowPrivateIndex;
- if (pGCIndex)
- *pGCIndex = mfbGCPrivateIndex;
- pScreen->GetWindowPixmap = mfbGetWindowPixmap;
- pScreen->SetWindowPixmap = mfbSetWindowPixmap;
- return (AllocateWindowPrivate(pScreen, mfbWindowPrivateIndex,
- sizeof(mfbPrivWin)) &&
- AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC)));
-}
-
-#ifndef LOWMEMFTPT
-
-/* dts * (inch/dot) * (25.4 mm / inch) = mm */
-Bool
-mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bitmap */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
-{
- if (!mfbAllocatePrivates(pScreen, (int *)NULL, (int *)NULL))
- return FALSE;
- pScreen->defColormap = (Colormap) FakeClientID(0);
- /* whitePixel, blackPixel */
- pScreen->QueryBestSize = mfbQueryBestSize;
- /* SaveScreen */
- pScreen->GetImage = mfbGetImage;
- pScreen->GetSpans = mfbGetSpans;
- pScreen->CreateWindow = mfbCreateWindow;
- pScreen->DestroyWindow = mfbDestroyWindow;
- pScreen->PositionWindow = mfbPositionWindow;
- pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes;
- pScreen->RealizeWindow = mfbMapWindow;
- pScreen->UnrealizeWindow = mfbUnmapWindow;
- pScreen->PaintWindowBackground = mfbPaintWindow;
- pScreen->PaintWindowBorder = mfbPaintWindow;
- pScreen->CopyWindow = mfbCopyWindow;
- pScreen->CreatePixmap = mfbCreatePixmap;
- pScreen->DestroyPixmap = mfbDestroyPixmap;
- pScreen->RealizeFont = mfbRealizeFont;
- pScreen->UnrealizeFont = mfbUnrealizeFont;
- pScreen->CreateGC = mfbCreateGC;
- pScreen->CreateColormap = mfbCreateColormap;
- pScreen->DestroyColormap = mfbDestroyColormap;
- pScreen->InstallColormap = mfbInstallColormap;
- pScreen->UninstallColormap = mfbUninstallColormap;
- pScreen->ListInstalledColormaps = mfbListInstalledColormaps;
- pScreen->StoreColors = (StoreColorsProcPtr)NoopDDA;
- pScreen->ResolveColor = mfbResolveColor;
- pScreen->BitmapToRegion = mfbPixmapToRegion;
- if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- 1, 1, &depth, VID, 1, &visual))
- return FALSE;
- pScreen->BackingStoreFuncs = mfbBSFuncRec;
- return TRUE;
-}
-#endif /* ifndef LOWMEMFTPT */
-
-PixmapPtr
-mfbGetWindowPixmap(pWin)
- WindowPtr pWin;
-{
-#ifdef PIXMAP_PER_WINDOW
- return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
-#else
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- return (* pScreen->GetScreenPixmap)(pScreen);
-#endif
-}
-
-void
-mfbSetWindowPixmap(pWin, pPix)
- WindowPtr pWin;
- PixmapPtr pPix;
-{
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
-#else
- (* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
-#endif
-}
-
diff --git a/mfb/mfbsetsp.c b/mfb/mfbsetsp.c
deleted file mode 100644
index a56935dbe..000000000
--- a/mfb/mfbsetsp.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbsetsp.c,v 1.7 2003/02/18 21:30:01 tsi Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbsetsp.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-#include "servermd.h"
-
-
-/* mfbSetScanline -- copies the bits from psrc to the drawable starting at
- * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
- * starts on the scanline. (I.e., if this scanline passes through multiple
- * boxes, we may not want to start grabbing bits at psrc but at some offset
- * further on.)
- */
-void
-mfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register PixelType *psrc;
- register int alu; /* raster op */
- PixelType *pdstBase; /* start of the drawable */
- int widthDst; /* width of drawable in words */
-{
- int w; /* width of scanline in bits */
- register PixelType *pdst; /* where to put the bits */
- register PixelType tmpSrc; /* scratch buffer to collect bits in */
- int dstBit; /* offset in bits from beginning of
- * word */
- register int nstart; /* number of bits from first partial */
- register int nend; /* " " last partial word */
- int offSrc;
- PixelType startmask, endmask;
- int nlMiddle, nl;
-
- pdst = mfbScanline(pdstBase, xStart, y, widthDst);
- psrc += (xStart - xOrigin) >> PWSH;
- offSrc = (xStart - xOrigin) & PIM;
- w = xEnd - xStart;
- dstBit = xStart & PIM;
-
- if (dstBit + w <= PPW)
- {
- getandputrop(psrc, offSrc, dstBit, w, pdst, alu)
- }
- else
- {
-
- maskbits(xStart, w, startmask, endmask, nlMiddle);
- if (startmask)
- nstart = PPW - dstBit;
- else
- nstart = 0;
- if (endmask)
- nend = xEnd & PIM;
- else
- nend = 0;
- if (startmask)
- {
- getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
- pdst++;
- offSrc += nstart;
- if (offSrc > PLST)
- {
- psrc++;
- offSrc -= PPW;
- }
- }
- nl = nlMiddle;
- while (nl--)
- {
- getbits(psrc, offSrc, PPW, tmpSrc);
- DoRop(*pdst, alu, tmpSrc, *pdst);
- pdst++;
- psrc++;
- }
- if (endmask)
- {
- getandputrop0(psrc, offSrc, nend, pdst, alu);
- }
-
- }
-}
-
-
-
-/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
- * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
- * are in increasing Y order.
- * Source bit lines are server scanline padded so that they always begin
- * on a word boundary.
- */
-void
-mfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *pcharsrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- PixelType *psrc = (PixelType *)(pointer)pcharsrc;
- PixelType *pdstBase; /* start of dst bitmap */
- int widthDst; /* width of bitmap in words */
- register BoxPtr pbox, pboxLast, pboxTest;
- register DDXPointPtr pptLast;
- int alu;
- RegionPtr prgnDst;
- int xStart, xEnd;
- int yMax;
-
- alu = pGC->alu;
- prgnDst = pGC->pCompositeClip;
-
- pptLast = ppt + nspans;
-
- yMax = pDrawable->y + (int) pDrawable->height;
- mfbGetPixelWidthAndPointer(pDrawable, widthDst, pdstBase);
-
- pbox = REGION_RECTS(prgnDst);
- pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
-
- if(fSorted)
- {
- /* scan lines sorted in ascending order. Because they are sorted, we
- * don't have to check each scanline against each clip box. We can be
- * sure that this scanline only has to be clipped to boxes at or after the
- * beginning of this y-band
- */
- pboxTest = pbox;
- while(ppt < pptLast)
- {
- pbox = pboxTest;
- if(ppt->y >= yMax)
- break;
- while(pbox < pboxLast)
- {
- if(pbox->y1 > ppt->y)
- {
- /* scanline is before clip box */
- break;
- }
- else if(pbox->y2 <= ppt->y)
- {
- /* clip box is before scanline */
- pboxTest = ++pbox;
- continue;
- }
- else if(pbox->x1 > ppt->x + *pwidth)
- {
- /* clip box is to right of scanline */
- break;
- }
- else if(pbox->x2 <= ppt->x)
- {
- /* scanline is to right of clip box */
- pbox++;
- continue;
- }
-
- /* at least some of the scanline is in the current clip box */
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(ppt->x + *pwidth, pbox->x2);
- mfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
- pdstBase, widthDst);
- if(ppt->x + *pwidth <= pbox->x2)
- {
- /* End of the line, as it were */
- break;
- }
- else
- pbox++;
- }
- /* We've tried this line against every box; it must be outside them
- * all. move on to the next point */
- ppt++;
- psrc += PixmapWidthInPadUnits(*pwidth, 1);
- pwidth++;
- }
- }
- else
- {
- /* scan lines not sorted. We must clip each line against all the boxes */
- while(ppt < pptLast)
- {
- if(ppt->y >= 0 && ppt->y < yMax)
- {
-
- for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++)
- {
- if(pbox->y1 > ppt->y)
- {
- /* rest of clip region is above this scanline,
- * skip it */
- break;
- }
- if(pbox->y2 <= ppt->y)
- {
- /* clip box is below scanline */
- pbox++;
- break;
- }
- if(pbox->x1 <= ppt->x + *pwidth &&
- pbox->x2 > ppt->x)
- {
- xStart = max(pbox->x1, ppt->x);
- xEnd = min(pbox->x2, ppt->x + *pwidth);
- mfbSetScanline(ppt->y, ppt->x, xStart, xEnd,
- psrc, alu, pdstBase, widthDst);
- }
-
- }
- }
- psrc += PixmapWidthInPadUnits(*pwidth, 1);
- ppt++;
- pwidth++;
- }
- }
-}
diff --git a/mfb/mfbtegblt.c b/mfb/mfbtegblt.c
deleted file mode 100644
index 1e0da0f02..000000000
--- a/mfb/mfbtegblt.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/* $Xorg: mfbtegblt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $XFree86: xc/programs/Xserver/mfb/mfbtegblt.c,v 1.8 2001/12/14 20:00:12 dawes Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "mfb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-/*
- this works for fonts with glyphs <= PPW bits wide.
-
- This should be called only with a terminal-emulator font;
-this means that the FIXED_METRICS flag is set, and that
-glyphbounds == charbounds.
-
- in theory, this goes faster; even if it doesn't, it reduces the
-flicker caused by writing a string over itself with image text (since
-the background gets repainted per character instead of per string.)
-this seems to be important for some converted X10 applications.
-
- Image text looks at the bits in the glyph and the fg and bg in the
-GC. it paints a rectangle, as defined in the protocol dcoument,
-and the paints the characters.
-
- to avoid source proliferation, this file is compiled
-two times:
- MFBTEGLYPHBLT OP
- mfbTEGlyphBltWhite (white text, black bg )
- mfbTEGlyphBltBlack ~ (black text, white bg )
-
-*/
-
-#if defined(NO_3_60_CG4) && defined(FASTPUTBITS) && defined(FASTGETBITS)
-#define FASTCHARS
-#endif
-
-/*
- * this macro "knows" that only characters <= 8 bits wide will
- * fit this case (which is why it is independent of GLYPHPADBYTES)
- */
-
-#if (BITMAP_BIT_ORDER == MSBFirst) && (GLYPHPADBYTES != 4)
-#if GLYPHPADBYTES == 1
-#define ShiftAmnt 24
-#else
-#define ShiftAmnt 16
-#endif
-
-/*
- * XXX XXX XXX There is something horribly, massively wrong here. There are
- * hardcoded shifts by 64 below; these cannot work on any present-day
- * architecture.
- */
-
-/*
- * Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its
- * first argument more than once. Thus the imbedded char++ have to be moved.
- * (DHD)
- */
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#define GetBits4 c = (*char1++ << ShiftAmnt) | \
- SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \
- SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \
- SCRRIGHT (*char4 << ShiftAmnt, xoff4); \
- char2++; char3++; char4++;
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */
-
-#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2++, xoff2) | \
- SCRRIGHT (*char3++, xoff3) | \
- SCRRIGHT (*char4++, xoff4);
-#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
-#define GetBits4 c = *char1++ | \
- SCRRIGHT (*char2, xoff2) | \
- SCRRIGHT (*char3, xoff3) | \
- SCRRIGHT (*char4, xoff4); \
- char2++; char3++; char4++;
-#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
-
-#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */
-
-
-#if GLYPHPADBYTES == 1
-typedef unsigned char *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 2
-typedef unsigned short *glyphPointer;
-#define USE_LEFTBITS
-#endif
-
-#if GLYPHPADBYTES == 4
-typedef unsigned int *glyphPointer;
-#endif
-
-#ifdef USE_LEFTBITS
-#define GetBits1 getleftbits (char1, widthGlyph, c); \
- c &= glyphMask; \
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
-#define GetBits1 c = *char1++;
-#endif
-
-void
-MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- FontPtr pfont = pGC->font;
- int widthDst;
- PixelType *pdstBase; /* pointer to longword with top row
- of current glyph */
-
- int h; /* height of glyph and char */
- register int xpos; /* current x */
- int ypos; /* current y */
- int widthGlyph;
-
- int hTmp; /* counter for height */
- register PixelType startmask, endmask;
- int nfirst; /* used if glyphs spans a longword boundary */
- BoxRec bbox; /* for clipping */
- int widthGlyphs;
- register PixelType *dst;
- register PixelType c;
- register int xoff1, xoff2, xoff3, xoff4;
- register glyphPointer char1, char2, char3, char4;
-
-#ifdef USE_LEFTBITS
- register PixelType glyphMask;
- register PixelType tmpSrc;
- register int glyphBytes;
-#endif
-
- if (!(pGC->planemask & 1))
- return;
-
- mfbGetPixelWidthAndPointer(pDrawable, widthDst, pdstBase);
-
- xpos = x + pDrawable->x;
- ypos = y + pDrawable->y;
-
- widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
- h = FONTASCENT(pfont) + FONTDESCENT(pfont);
-
- xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
- ypos -= FONTASCENT(pfont);
-
- bbox.x1 = xpos;
- bbox.x2 = xpos + (widthGlyph * nglyph);
- bbox.y1 = ypos;
- bbox.y2 = ypos + h;
-
- switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
- {
- case rgnPART:
- /* this is the WRONG thing to do, but it works.
- calling the non-terminal text is easy, but slow, given
- what we know about the font.
-
- the right thing to do is something like:
- for each clip rectangle
- compute at which row the glyph starts to be in it,
- and at which row the glyph ceases to be in it
- compute which is the first glyph inside the left
- edge, and the last one inside the right edge
- draw a fractional first glyph, using only
- the rows we know are in
- draw all the whole glyphs, using the appropriate rows
- draw any pieces of the last glyph, using the right rows
-
- this way, the code would take advantage of knowing that
- all glyphs are the same height and don't overlap.
-
- one day...
- */
- CLIPTETEXT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- case rgnOUT:
- return;
- }
- pdstBase = mfbScanlineDeltaNoBankSwitch(pdstBase, ypos, widthDst);
- widthGlyphs = widthGlyph * PGSZB;
-
-#ifdef USE_LEFTBITS
- glyphMask = endtab[widthGlyph];
- glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
-#endif
-
- if (nglyph >= PGSZB && widthGlyphs <= PPW)
- {
- while (nglyph >= PGSZB)
- {
- nglyph -= PGSZB;
- xoff1 = xpos & PIM;
- xoff2 = widthGlyph;
- xoff3 = xoff2 + widthGlyph;
- xoff4 = xoff3 + widthGlyph;
- char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- char2 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- char3 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- char4 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
-
- hTmp = h;
- dst = mfbScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */
-
-#ifndef FASTCHARS
- if (xoff1 + widthGlyphs <= PPW)
- {
- maskpartialbits (xoff1, widthGlyphs, startmask);
-#endif
- while (hTmp--)
- {
- GetBits4
-#ifdef FASTCHARS
-# if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyphs;
-# endif
- FASTPUTBITS(OP(c), xoff1, widthGlyphs, dst);
-#else
- *(dst) = ((*dst) & ~startmask) | (OP(SCRRIGHT(c, xoff1)) & startmask);
-#endif
- mfbScanlineInc(dst, widthDst);
- }
-#ifndef FASTCHARS
- }
- else
- {
- maskPPWbits (xoff1, widthGlyphs, startmask, endmask);
- nfirst = PPW - xoff1;
- while (hTmp--)
- {
- GetBits4
- dst[0] = (dst[0] & ~startmask) |
- (OP(SCRRIGHT(c,xoff1)) & startmask);
- dst[1] = (dst[1] & ~endmask) |
- (OP(SCRLEFT(c,nfirst)) & endmask);
- mfbScanlineInc(dst, widthDst);
- }
- }
-#endif
- xpos += widthGlyphs;
- }
- }
-
- while(nglyph--)
- {
- xoff1 = xpos & PIM;
- char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
- hTmp = h;
- dst = mfbScanlineOffset(pdstBase, (xpos >> PWSH));
-
-#ifndef FASTCHARS
- if (xoff1 + widthGlyph <= PPW)
- {
- maskpartialbits (xoff1, widthGlyph, startmask);
-#endif
- while (hTmp--)
- {
-#ifdef FASTCHARS
-#ifdef USE_LEFTBITS
- FASTGETBITS (char1,0,widthGlyph,c);
- char1 = (glyphPointer) (((char *) char1) + glyphBytes);
-#else
- c = *char1++;
-#if BITMAP_BIT_ORDER == MSBFirst
- c >>= PPW - widthGlyph;
-#endif
-#endif
- FASTPUTBITS (OP(c),xoff1,widthGlyph,dst);
-#else
- GetBits1
- (*dst) = ((*dst) & ~startmask) | (OP(SCRRIGHT(c, xoff1)) & startmask);
-#endif
- mfbScanlineInc(dst, widthDst);
- }
-#ifndef FASTCHARS
- }
- else
- {
- maskPPWbits (xoff1, widthGlyph, startmask, endmask);
- nfirst = PPW - xoff1;
- while (hTmp--)
- {
- GetBits1
- dst[0] = (dst[0] & ~startmask) |
- (OP(SCRRIGHT(c,xoff1)) & startmask);
- dst[1] = (dst[1] & ~endmask) |
- (OP(SCRLEFT(c,nfirst)) & endmask);
- mfbScanlineInc(dst, widthDst);
- }
- }
-#endif
- xpos += widthGlyph;
- }
-}
diff --git a/mfb/mfbtile.c b/mfb/mfbtile.c
deleted file mode 100644
index e672f38c9..000000000
--- a/mfb/mfbtile.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbtile.c,v 1.4 2003/07/16 01:38:55 dawes Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mfbtile.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-#include "X.h"
-
-#include "windowstr.h"
-#include "regionstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-
-#include "mfb.h"
-#include "maskbits.h"
-
-#include "mergerop.h"
-/*
-
- the boxes are already translated.
-
- NOTE:
- iy = ++iy < tileHeight ? iy : 0
-is equivalent to iy%= tileheight, and saves a division.
-*/
-
-/*
- tile area with a PPW bit wide pixmap
-*/
-void
-MROP_NAME(mfbTileAreaPPW)(pDraw, nbox, pbox, alu, ptile)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
-{
- register PixelType *psrc;
- /* pointer to bits in tile, if needed */
- int tileHeight; /* height of the tile */
- register PixelType srcpix;
- int nlwidth; /* width in longwords of the drawable */
- int w; /* width of current box */
- MROP_DECLARE_REG ()
- register int h; /* height of current box */
- register int nlw; /* loop version of nlwMiddle */
- register PixelType *p; /* pointer to bits we're writing */
- PixelType startmask;
- PixelType endmask; /* masks for reggedy bits at either end of line */
- int nlwMiddle; /* number of longwords between sides of boxes */
- int nlwExtra; /* to get from right of box to left of next span */
- register int iy; /* index of current scanline in tile */
- PixelType *pbits; /* pointer to start of drawable */
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, pbits);
-
- MROP_INITIALIZE(alu,~0)
-
- tileHeight = ptile->drawable.height;
- psrc = (PixelType *)(ptile->devPrivate.ptr);
-
- while (nbox--)
- {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
- iy = pbox->y1 % tileHeight;
- p = mfbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
-
- if ( ((pbox->x1 & PIM) + w) < PPW)
- {
- maskpartialbits(pbox->x1, w, startmask);
- nlwExtra = nlwidth;
- while (h--)
- {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- *p = MROP_MASK(srcpix,*p,startmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else
- {
- maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
- nlwExtra = nlwidth - nlwMiddle;
-
- if (startmask && endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK (srcpix,*p,startmask);
- p++;
- while (nlw--)
- {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (startmask && !endmask)
- {
- nlwExtra -= 1;
- while (h--)
- {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- *p = MROP_MASK(srcpix,*p,startmask);
- p++;
- while (nlw--)
- {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else if (!startmask && endmask)
- {
- while (h--)
- {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--)
- {
- *p = MROP_SOLID(srcpix,*p);
- p++;
- }
-
- *p = MROP_MASK(srcpix,*p,endmask);
- mfbScanlineInc(p, nlwExtra);
- }
- }
- else /* no ragged bits at either end */
- {
- while (h--)
- {
- srcpix = psrc[iy];
- iy++;
- if (iy == tileHeight)
- iy = 0;
- nlw = nlwMiddle;
- while (nlw--)
- {
- *p = MROP_SOLID (srcpix,*p);
- p++;
- }
- mfbScanlineInc(p, nlwExtra);
- }
- }
- }
- pbox++;
- }
-}
-
-#if (MROP) == 0
-void
-mfbTileAreaPPW (pDraw, nbox, pbox, alu, ptile)
- DrawablePtr pDraw;
- int nbox;
- BoxPtr pbox;
- int alu;
- PixmapPtr ptile;
-{
- void (*f)(
- DrawablePtr /*pDraw*/,
- int /*nbox*/,
- BoxPtr /*pbox*/,
- int /*alu*/,
- PixmapPtr /*ptile*/);
-
- if (alu == GXcopy)
- f = mfbTileAreaPPWCopy;
- else
- f = mfbTileAreaPPWGeneral;
- (*f) (pDraw, nbox, pbox, alu, ptile);
-}
-#endif
diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c
deleted file mode 100644
index f7ff963c4..000000000
--- a/mfb/mfbwindow.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* $Xorg: mfbwindow.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/mfb/mfbwindow.c,v 1.4 2003/11/03 05:36:35 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "mfb.h"
-#include "mistruct.h"
-#include "regionstr.h"
-#include "maskbits.h"
-
-Bool
-mfbCreateWindow(pWin)
- register WindowPtr pWin;
-{
- register mfbPrivWin *pPrivWin;
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
- pPrivWin->pRotatedBorder = NullPixmap;
- pPrivWin->pRotatedBackground = NullPixmap;
- pPrivWin->fastBackground = FALSE;
- pPrivWin->fastBorder = FALSE;
-
- return (TRUE);
-}
-
-/* This always returns true, because Xfree can't fail. It might be possible
- * on some devices for Destroy to fail */
-Bool
-mfbDestroyWindow(pWin)
- WindowPtr pWin;
-{
- register mfbPrivWin *pPrivWin;
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
-
- if (pPrivWin->pRotatedBorder)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
- if (pPrivWin->pRotatedBackground)
- (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground);
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool mfbMapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* (x, y) is the upper left corner of the window on the screen
- do we really need to pass this? (is it a;ready in pWin->absCorner?)
- we only do the rotation for pixmaps that are 32 bits wide (padded
-or otherwise.)
- mfbChangeWindowAttributes() has already put a copy of the pixmap
-in pPrivWin->pRotated*
-*/
-
-/*ARGSUSED*/
-Bool
-mfbPositionWindow(pWin, x, y)
- register WindowPtr pWin;
- int x, y;
-{
- register mfbPrivWin *pPrivWin;
- int reset = 0;
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
- if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground)
- {
- mfbXRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- mfbYRotatePixmap(pPrivWin->pRotatedBackground,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
-
- if (!pWin->borderIsPixel && pPrivWin->fastBorder)
- {
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
- mfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- mfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- reset = 1;
- }
- if (reset)
- {
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
-
- /* This is the "wrong" fix to the right problem, but it doesn't really
- * cost very much. When the window is moved, we need to invalidate any
- * RotatedPixmap that exists in any GC currently validated against this
- * window.
- */
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
-
-/*ARGSUSED*/
-Bool
-mfbUnmapWindow(pWindow)
- WindowPtr pWindow;
-{
- return (TRUE);
-}
-
-/* UNCLEAN!
- this code calls the bitblt helper code directly.
-
- mfbCopyWindow copies only the parts of the destination that are
-visible in the source.
-*/
-
-
-void
-mfbCopyWindow(pWin, ptOldOrg, prgnSrc)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr prgnSrc;
-{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
- RegionPtr prgnDst;
- register BoxPtr pbox;
- register int dx, dy;
- register int i, nbox;
- WindowPtr pwinRoot;
-
- pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
-
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
- prgnSrc);
-
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
- if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
- return;
- ppt = pptSrc;
-
- for (i=nbox; --i >= 0; ppt++, pbox++)
- {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
-
- mfbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, prgnDst, pptSrc);
- DEALLOCATE_LOCAL(pptSrc);
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
-}
-
-
-
-/* swap in correct PaintWindow* routine. If we can use a fast output
-routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy
-of it in devPrivate.
-*/
-Bool
-mfbChangeWindowAttributes(pWin, mask)
- register WindowPtr pWin;
- register unsigned long mask;
-{
- register unsigned long index;
- register mfbPrivWin *pPrivWin;
- WindowPtr pBgWin;
-
- pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
- /*
- * When background state changes from ParentRelative and
- * we had previously rotated the fast border pixmap to match
- * the parent relative origin, rerotate to match window
- */
- if (mask & (CWBackPixmap | CWBackPixel) &&
- pWin->backgroundState != ParentRelative &&
- pPrivWin->fastBorder &&
- (pPrivWin->oldRotate.x != pWin->drawable.x ||
- pPrivWin->oldRotate.y != pWin->drawable.y))
- {
- mfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.x - pPrivWin->oldRotate.x);
- mfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- while(mask)
- {
- index = lowbit (mask);
- mask &= ~index;
- switch(index)
- {
- case CWBackPixmap:
- if (pWin->backgroundState == None)
- {
- pPrivWin->fastBackground = FALSE;
- }
- else if (pWin->backgroundState == ParentRelative)
- {
- pPrivWin->fastBackground = FALSE;
- /* Rotate border to match parent origin */
- if (pPrivWin->pRotatedBorder) {
- for (pBgWin = pWin->parent;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- mfbXRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.x - pPrivWin->oldRotate.x);
- mfbYRotatePixmap(pPrivWin->pRotatedBorder,
- pBgWin->drawable.y - pPrivWin->oldRotate.y);
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- }
- else if ((pWin->background.pixmap->drawable.width <= PPW) &&
- !(pWin->background.pixmap->drawable.width &
- (pWin->background.pixmap->drawable.width - 1)))
- {
- mfbCopyRotatePixmap(pWin->background.pixmap,
- &pPrivWin->pRotatedBackground,
- pWin->drawable.x,
- pWin->drawable.y);
- if (pPrivWin->pRotatedBackground)
- {
- pPrivWin->fastBackground = TRUE;
- pPrivWin->oldRotate.x = pWin->drawable.x;
- pPrivWin->oldRotate.y = pWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBackground = FALSE;
- }
- break;
-
- case CWBackPixel:
- pPrivWin->fastBackground = FALSE;
- break;
-
- case CWBorderPixmap:
- if ((pWin->border.pixmap->drawable.width <= PPW) &&
- !(pWin->border.pixmap->drawable.width &
- (pWin->border.pixmap->drawable.width - 1)))
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
- mfbCopyRotatePixmap(pWin->border.pixmap,
- &pPrivWin->pRotatedBorder,
- pBgWin->drawable.x,
- pBgWin->drawable.y);
- if (pPrivWin->pRotatedBorder)
- {
- pPrivWin->fastBorder = TRUE;
- pPrivWin->oldRotate.x = pBgWin->drawable.x;
- pPrivWin->oldRotate.y = pBgWin->drawable.y;
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- }
- else
- {
- pPrivWin->fastBorder = FALSE;
- }
- break;
- case CWBorderPixel:
- pPrivWin->fastBorder = FALSE;
- break;
- }
- }
- /* Again, we have no failure modes indicated by any of the routines
- * we've called, so we have to assume it worked */
- return (TRUE);
-}
diff --git a/mfb/mfbzerarc.c b/mfb/mfbzerarc.c
deleted file mode 100644
index 1ef9f1f56..000000000
--- a/mfb/mfbzerarc.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mfb/mfbzerarc.c,v 3.8 2003/07/16 01:38:55 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mfbzerarc.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "mfb.h"
-#include "maskbits.h"
-#include "mizerarc.h"
-#include "mi.h"
-
-/*
- * Note: LEFTMOST must be the bit leftmost in the actual screen
- * representation. This depends also on the IMAGE_BYTE_ORDER.
- * LONG2CHARS() takes care of the re-ordering as required. (DHD)
- */
-#if (BITMAP_BIT_ORDER == MSBFirst)
-#define LEFTMOST ((PixelType) LONG2CHARS(((MfbBits)1 << PLST)))
-#else
-#define LEFTMOST ((PixelType) LONG2CHARS(1))
-#endif
-
-#define PixelateWhite(addr,yoff,xoff) \
- *mfbScanlineOffset(addr, (yoff)+((xoff)>>PWSH)) |= \
- SCRRIGHT (LEFTMOST, ((xoff) & PIM))
-#define PixelateBlack(addr,yoff,xoff) \
- *mfbScanlineOffset(addr, (yoff)+((xoff)>>PWSH)) &= \
- ~(SCRRIGHT (LEFTMOST, ((xoff) & PIM)))
-
-#define Pixelate(base,yoff,xoff) \
-{ \
- paddr = mfbScanlineOffset(base, (yoff) + ((xoff)>>PWSH)); \
- pmask = SCRRIGHT(LEFTMOST, (xoff) & PIM); \
- *paddr = (*paddr & ~pmask) | (pixel & pmask); \
-}
-
-#define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff);
-
-static void
-mfbZeroArcSS(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc)
-{
- miZeroArcRec info;
- Bool do360;
- register int x, y, a, b, d, mask;
- register int k1, k3, dx, dy;
- PixelType *addrl;
- PixelType *yorgl, *yorgol;
- PixelType pixel;
- int nlwidth, yoffset, dyoffset;
- PixelType pmask;
- register PixelType *paddr;
-
- if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop ==
- RROP_BLACK)
- pixel = 0;
- else
- pixel = ~0;
-
- mfbGetPixelWidthAndPointer(pDraw, nlwidth, addrl);
- do360 = miZeroArcSetup(arc, &info, TRUE);
- yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
- yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
- info.xorg += pDraw->x;
- info.xorgo += pDraw->x;
- MIARCSETUP();
- yoffset = y ? nlwidth : 0;
- dyoffset = 0;
- mask = info.initialMask;
- if (!(arc->width & 1))
- {
- DoPix(2, yorgl, 0, info.xorgo);
- DoPix(8, yorgol, 0, info.xorgo);
- }
- if (!info.end.x || !info.end.y)
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1))
- {
- int xoffset = nlwidth;
- PixelType *yorghl = mfbScanlineDeltaNoBankSwitch(yorgl, info.h, nlwidth);
- int xorghp = info.xorg + info.h;
- int xorghn = info.xorg - info.h;
-
- if (pixel)
- {
- while (1)
- {
- PixelateWhite(yorgl, yoffset, info.xorg + x);
- PixelateWhite(yorgl, yoffset, info.xorg - x);
- PixelateWhite(yorgol, -yoffset, info.xorg - x);
- PixelateWhite(yorgol, -yoffset, info.xorg + x);
- if (a < 0)
- break;
- PixelateWhite(yorghl, -xoffset, xorghp - y);
- PixelateWhite(yorghl, -xoffset, xorghn + y);
- PixelateWhite(yorghl, xoffset, xorghn + y);
- PixelateWhite(yorghl, xoffset, xorghp - y);
- xoffset += nlwidth;
- MIARCCIRCLESTEP(yoffset += nlwidth;);
- }
- }
- else
- {
- while (1)
- {
- PixelateBlack(yorgl, yoffset, info.xorg + x);
- PixelateBlack(yorgl, yoffset, info.xorg - x);
- PixelateBlack(yorgol, -yoffset, info.xorg - x);
- PixelateBlack(yorgol, -yoffset, info.xorg + x);
- if (a < 0)
- break;
- PixelateBlack(yorghl, -xoffset, xorghp - y);
- PixelateBlack(yorghl, -xoffset, xorghn + y);
- PixelateBlack(yorghl, xoffset, xorghn + y);
- PixelateBlack(yorghl, xoffset, xorghp - y);
- xoffset += nlwidth;
- MIARCCIRCLESTEP(yoffset += nlwidth;);
- }
- }
- x = info.w;
- yoffset = info.h * nlwidth;
- }
- else if (do360)
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- Pixelate(yorgl, yoffset, info.xorg + x);
- Pixelate(yorgl, yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorgo - x);
- Pixelate(yorgol, -yoffset, info.xorg + x);
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- }
- else
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(dyoffset = nlwidth;);
- if ((x == info.start.x) || (y == info.start.y))
- {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- if ((x == info.end.x) || (y == info.end.y))
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- DoPix(1, yorgl, yoffset, info.xorg + x);
- DoPix(4, yorgol, -yoffset, info.xorgo - x);
- if (arc->height & 1)
- {
- DoPix(2, yorgl, yoffset, info.xorgo - x);
- DoPix(8, yorgol, -yoffset, info.xorg + x);
- }
-}
-
-void
-mfbZeroPolyArcSS(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register xArc *arc;
- register int i;
- BoxRec box;
- int x2, y2;
- RegionPtr cclip;
-
- if (!(pGC->planemask & 1))
- return;
- cclip = pGC->pCompositeClip;
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miCanZeroArc(arc))
- {
- box.x1 = arc->x + pDraw->x;
- box.y1 = arc->y + pDraw->y;
- /*
- * Because box.x2 and box.y2 get truncated to 16 bits, and the
- * RECT_IN_REGION test treats the resulting number as a signed
- * integer, the RECT_IN_REGION test alone can go the wrong way.
- * This can result in a server crash because the rendering
- * routines in this file deal directly with cpu addresses
- * of pixels to be stored, and do not clip or otherwise check
- * that all such addresses are within their respective pixmaps.
- * So we only allow the RECT_IN_REGION test to be used for
- * values that can be expressed correctly in a signed short.
- */
- x2 = box.x1 + (int)arc->width + 1;
- box.x2 = x2;
- y2 = box.y1 + (int)arc->height + 1;
- box.y2 = y2;
- if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
- (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
- mfbZeroArcSS(pDraw, pGC, arc);
- else
- miZeroPolyArc(pDraw, pGC, 1, arc);
- }
- else
- miPolyArc(pDraw, pGC, 1, arc);
- }
-}
diff --git a/mi/cbrt.c b/mi/cbrt.c
deleted file mode 100644
index 44c836e43..000000000
--- a/mi/cbrt.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $Xorg: cbrt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */
-/*
-
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/cbrt.c,v 3.4 2001/12/14 20:00:19 dawes Exp $ */
-
-/* simple cbrt, in case your math library doesn't have a good one */
-
-/*
- * Would normally include <math.h> for this, but for the sake of compiler
- * warnings, we don't want to get duplicate declarations for cbrt().
- */
-
-double pow(double, double);
-double cbrt(double);
-
-double
-cbrt(double x)
-{
- if (x > 0.0)
- return pow(x, 1.0/3.0);
- else
- return -pow(-x, 1.0/3.0);
-}
diff --git a/mi/mi.h b/mi/mi.h
deleted file mode 100644
index fba57567d..000000000
--- a/mi/mi.h
+++ /dev/null
@@ -1,635 +0,0 @@
-/* $Xorg: mi.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/mi/mi.h,v 3.10 2001/12/14 20:00:19 dawes Exp $ */
-
-#ifndef MI_H
-#define MI_H
-#include "X11/X.h"
-#include "region.h"
-#include "validate.h"
-#include "window.h"
-#include "gc.h"
-#include "font.h"
-#include "input.h"
-#include "cursor.h"
-
-#define MiBits CARD32
-
-typedef struct _miDash *miDashPtr;
-#define EVEN_DASH 0
-#define ODD_DASH ~0
-
-/* miarc.c */
-
-extern void miPolyArc(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-/* mibitblt.c */
-
-extern RegionPtr miCopyArea(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*xIn*/,
- int /*yIn*/,
- int /*widthSrc*/,
- int /*heightSrc*/,
- int /*xOut*/,
- int /*yOut*/
-);
-
-extern void miOpqStipDrawable(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- RegionPtr /*prgnSrc*/,
- MiBits * /*pbits*/,
- int /*srcx*/,
- int /*w*/,
- int /*h*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
-extern RegionPtr miCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*bitPlane*/
-);
-
-extern void miGetImage(
- DrawablePtr /*pDraw*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/
-);
-
-extern void miPutImage(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*depth*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*leftPad*/,
- int /*format*/,
- char * /*pImage*/
-);
-
-/* miclipn.c */
-
-extern void miClipNotify(
- void (* /*func*/)(
- WindowPtr /* pWin */,
- int /* dx */,
- int /* dy */
- )
-);
-
-/* micursor.c */
-
-extern void miRecolorCursor(
- ScreenPtr /*pScr*/,
- CursorPtr /*pCurs*/,
- Bool /*displayed*/
-);
-
-/* midash.c */
-
-extern miDashPtr miDashLine(
- int /*npt*/,
- DDXPointPtr /*ppt*/,
- unsigned int /*nDash*/,
- unsigned char * /*pDash*/,
- unsigned int /*offset*/,
- int * /*pnseg*/
-);
-
-extern void miStepDash(
- int /*dist*/,
- int * /*pDashIndex*/,
- unsigned char * /*pDash*/,
- int /*numInDashList*/,
- int * /*pDashOffset*/
-);
-
-/* mieq.c */
-
-
-#ifndef INPUT_H
-typedef struct _DeviceRec *DevicePtr;
-#endif
-
-extern Bool mieqInit(
- DevicePtr /*pKbd*/,
- DevicePtr /*pPtr*/
-);
-
-extern void mieqEnqueue(
- xEventPtr /*e*/
-);
-
-extern void mieqSwitchScreen(
- ScreenPtr /*pScreen*/,
- Bool /*fromDIX*/
-);
-
-extern void mieqProcessInputEvents(
- void
-);
-
-/* miexpose.c */
-
-extern RegionPtr miHandleExposures(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/
-);
-
-extern void miSendGraphicsExpose(
- ClientPtr /*client*/,
- RegionPtr /*pRgn*/,
- XID /*drawable*/,
- int /*major*/,
- int /*minor*/
-);
-
-extern void miSendExposures(
- WindowPtr /*pWin*/,
- RegionPtr /*pRgn*/,
- int /*dx*/,
- int /*dy*/
-);
-
-extern void miWindowExposures(
- WindowPtr /*pWin*/,
- RegionPtr /*prgn*/,
- RegionPtr /*other_exposed*/
-);
-
-extern void miPaintWindow(
- WindowPtr /*pWin*/,
- RegionPtr /*prgn*/,
- int /*what*/
-);
-
-extern void miClearDrawable(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/
-);
-
-/* mifillrct.c */
-
-extern void miPolyFillRect(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*nrectFill*/,
- xRectangle * /*prectInit*/
-);
-
-/* miglblt.c */
-
-extern void miPolyGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-
-extern void miImageGlyphBlt(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*nglyph*/,
- CharInfoPtr * /*ppci*/,
- pointer /*pglyphBase*/
-);
-
-/* mipoly.c */
-
-extern void miFillPolygon(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*shape*/,
- int /*mode*/,
- int /*count*/,
- DDXPointPtr /*pPts*/
-);
-
-/* mipolycon.c */
-
-extern Bool miFillConvexPoly(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-
-/* mipolygen.c */
-
-extern Bool miFillGeneralPoly(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*count*/,
- DDXPointPtr /*ptsIn*/
-);
-
-/* mipolypnt.c */
-
-extern void miPolyPoint(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- xPoint * /*pptInit*/
-);
-
-/* mipolyrect.c */
-
-extern void miPolyRectangle(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*nrects*/,
- xRectangle * /*pRects*/
-);
-
-/* mipolyseg.c */
-
-extern void miPolySegment(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*nseg*/,
- xSegment * /*pSegs*/
-);
-
-/* mipolytext.c */
-
-extern int miPolyText(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/,
- FontEncoding /*fontEncoding*/
-);
-
-extern int miPolyText8(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/
-);
-
-extern int miPolyText16(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- unsigned short * /*chars*/
-);
-
-extern int miImageText(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/,
- FontEncoding /*fontEncoding*/
-);
-
-extern void miImageText8(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/
-);
-
-extern void miImageText16(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- unsigned short * /*chars*/
-);
-
-/* mipushpxl.c */
-
-extern void miPushPixels(
- GCPtr /*pGC*/,
- PixmapPtr /*pBitMap*/,
- DrawablePtr /*pDrawable*/,
- int /*dx*/,
- int /*dy*/,
- int /*xOrg*/,
- int /*yOrg*/
-);
-
-/* miregion.c */
-
-/* see also region.h */
-
-extern Bool miRectAlloc(
- RegionPtr /*pRgn*/,
- int /*n*/
-);
-
-extern void miSetExtents(
- RegionPtr /*pReg*/
-);
-
-extern int miFindMaxBand(
- RegionPtr /*prgn*/
-);
-
-#ifdef DEBUG
-extern Bool miValidRegion(
- RegionPtr /*prgn*/
-);
-#endif
-
-extern Bool miRegionDataCopy(RegionPtr dst, RegionPtr src);
-extern Bool miRegionBroken(RegionPtr pReg);
-
-/* miscrinit.c */
-
-extern Bool miModifyPixmapHeader(
- PixmapPtr /*pPixmap*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/,
- int /*bitsPerPixel*/,
- int /*devKind*/,
- pointer /*pPixData*/
-);
-
-extern Bool miCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-
-extern Bool miCreateScreenResources(
- ScreenPtr /*pScreen*/
-);
-
-extern Bool miScreenDevPrivateInit(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- pointer /*pbits*/
-);
-
-extern Bool miScreenInit(
- ScreenPtr /*pScreen*/,
- pointer /*pbits*/,
- int /*xsize*/,
- int /*ysize*/,
- int /*dpix*/,
- int /*dpiy*/,
- int /*width*/,
- int /*rootDepth*/,
- int /*numDepths*/,
- DepthPtr /*depths*/,
- VisualID /*rootVisual*/,
- int /*numVisuals*/,
- VisualPtr /*visuals*/
-);
-
-extern int miAllocateGCPrivateIndex(
- void
-);
-
-extern PixmapPtr miGetScreenPixmap(
- ScreenPtr pScreen
-);
-
-extern void miSetScreenPixmap(
- PixmapPtr pPix
-);
-
-/* mivaltree.c */
-
-extern int miShapedWindowIn(
- ScreenPtr /*pScreen*/,
- RegionPtr /*universe*/,
- RegionPtr /*bounding*/,
- BoxPtr /*rect*/,
- int /*x*/,
- int /*y*/
-);
-
-extern int miValidateTree(
- WindowPtr /*pParent*/,
- WindowPtr /*pChild*/,
- VTKind /*kind*/
-);
-
-extern void miWideLine(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pPts*/
-);
-
-extern void miWideDash(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- int /*mode*/,
- int /*npt*/,
- DDXPointPtr /*pPts*/
-);
-
-extern void miMiter(
- void
-);
-
-extern void miNotMiter(
- void
-);
-
-/* miwindow.c */
-
-extern void miClearToBackground(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- Bool /*generateExposures*/
-);
-
-extern Bool miChangeSaveUnder(
- WindowPtr /*pWin*/,
- WindowPtr /*first*/
-);
-
-extern void miPostChangeSaveUnder(
- WindowPtr /*pWin*/,
- WindowPtr /*pFirst*/
-);
-
-extern void miMarkWindow(
- WindowPtr /*pWin*/
-);
-
-extern Bool miMarkOverlappedWindows(
- WindowPtr /*pWin*/,
- WindowPtr /*pFirst*/,
- WindowPtr * /*ppLayerWin*/
-);
-
-extern void miHandleValidateExposures(
- WindowPtr /*pWin*/
-);
-
-extern void miMoveWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- WindowPtr /*pNextSib*/,
- VTKind /*kind*/
-);
-
-extern void miSlideAndSizeWindow(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*w*/,
- unsigned int /*h*/,
- WindowPtr /*pSib*/
-);
-
-extern WindowPtr miGetLayerWindow(
- WindowPtr /*pWin*/
-);
-
-extern void miSetShape(
- WindowPtr /*pWin*/
-);
-
-extern void miChangeBorderWidth(
- WindowPtr /*pWin*/,
- unsigned int /*width*/
-);
-
-extern void miMarkUnrealizedWindow(
- WindowPtr /*pChild*/,
- WindowPtr /*pWin*/,
- Bool /*fromConfigure*/
-);
-
-extern void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth);
-
-/* mizerarc.c */
-
-extern void miZeroPolyArc(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-/* mizerline.c */
-
-extern void miZeroLine(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*mode*/,
- int /*nptInit*/,
- DDXPointRec * /*pptInit*/
-);
-
-extern void miZeroDashLine(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*mode*/,
- int /*nptInit*/,
- DDXPointRec * /*pptInit*/
-);
-
-extern void miPolyFillArc(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*narcs*/,
- xArc * /*parcs*/
-);
-
-#endif /* MI_H */
diff --git a/mi/miarc.c b/mi/miarc.c
deleted file mode 100644
index 832a056c3..000000000
--- a/mi/miarc.c
+++ /dev/null
@@ -1,3715 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miarc.c,v 3.14 2003/10/29 22:57:48 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: miarc.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-/* Author: Keith Packard and Bob Scheifler */
-/* Warning: this code is toxic, do not dally very long here. */
-
-#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
-#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-#include "X.h"
-#include "Xprotostr.h"
-#include "misc.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mifpoly.h"
-#include "mi.h"
-#include "mifillarc.h"
-#include "Xfuncproto.h"
-
-static double miDsin(double a);
-static double miDcos(double a);
-static double miDasin(double v);
-static double miDatan2(double dy, double dx);
-double cbrt(double);
-
-#ifdef ICEILTEMPDECL
-ICEILTEMPDECL
-#endif
-
-/*
- * some interesting sematic interpretation of the protocol:
- *
- * Self intersecting arcs (i.e. those spanning 360 degrees)
- * never join with other arcs, and are drawn without caps
- * (unless on/off dashed, in which case each dash segment
- * is capped, except when the last segment meets the
- * first segment, when no caps are drawn)
- *
- * double dash arcs are drawn in two parts, first the
- * odd dashes (drawn in background) then the even dashes
- * (drawn in foreground). This means that overlapping
- * sections of foreground/background are drawn twice,
- * first in background then in foreground. The double-draw
- * occurs even when the function uses the destination values
- * (e.g. xor mode). This is the same way the wide-line
- * code works and should be "fixed".
- *
- */
-
-#undef max
-#undef min
-
-#if defined (__GNUC__) && !defined (__STRICT_ANSI__)
-#define USE_INLINE
-#endif
-
-#ifdef USE_INLINE
-inline static const int max (const int x, const int y)
-{
- return x>y? x:y;
-}
-
-inline static const int min (const int x, const int y)
-{
- return x<y? x:y;
-}
-
-#else
-
-static int
-max (int x, int y)
-{
- return x>y? x:y;
-}
-
-static int
-min (int x, int y)
-{
- return x<y? x:y;
-}
-
-#endif
-
-struct bound {
- double min, max;
-};
-
-struct ibound {
- int min, max;
-};
-
-#define boundedLe(value, bounds)\
- ((bounds).min <= (value) && (value) <= (bounds).max)
-
-struct line {
- double m, b;
- int valid;
-};
-
-#define intersectLine(y,line) (line.m * (y) + line.b)
-
-/*
- * these are all y value bounds
- */
-
-struct arc_bound {
- struct bound ellipse;
- struct bound inner;
- struct bound outer;
- struct bound right;
- struct bound left;
- struct ibound inneri;
- struct ibound outeri;
-};
-
-struct accelerators {
- double tail_y;
- double h2;
- double w2;
- double h4;
- double w4;
- double h2mw2;
- double h2l;
- double w2l;
- double fromIntX;
- double fromIntY;
- struct line left, right;
- int yorgu;
- int yorgl;
- int xorg;
-};
-
-struct arc_def {
- double w, h, l;
- double a0, a1;
-};
-
-# define todeg(xAngle) (((double) (xAngle)) / 64.0)
-
-# define RIGHT_END 0
-# define LEFT_END 1
-
-typedef struct _miArcJoin {
- int arcIndex0, arcIndex1;
- int phase0, phase1;
- int end0, end1;
-} miArcJoinRec, *miArcJoinPtr;
-
-typedef struct _miArcCap {
- int arcIndex;
- int end;
-} miArcCapRec, *miArcCapPtr;
-
-typedef struct _miArcFace {
- SppPointRec clock;
- SppPointRec center;
- SppPointRec counterClock;
-} miArcFaceRec, *miArcFacePtr;
-
-typedef struct _miArcData {
- xArc arc;
- int render; /* non-zero means render after drawing */
- int join; /* related join */
- int cap; /* related cap */
- int selfJoin; /* final dash meets first dash */
- miArcFaceRec bounds[2];
- double x0, y0, x1, y1;
-} miArcDataRec, *miArcDataPtr;
-
-/*
- * This is an entire sequence of arcs, computed and categorized according
- * to operation. miDashArcs generates either one or two of these.
- */
-
-typedef struct _miPolyArc {
- int narcs;
- miArcDataPtr arcs;
- int ncaps;
- miArcCapPtr caps;
- int njoins;
- miArcJoinPtr joins;
-} miPolyArcRec, *miPolyArcPtr;
-
-#define GCValsFunction 0
-#define GCValsForeground 1
-#define GCValsBackground 2
-#define GCValsLineWidth 3
-#define GCValsCapStyle 4
-#define GCValsJoinStyle 5
-#define GCValsMask (GCFunction | GCForeground | GCBackground | \
- GCLineWidth | GCCapStyle | GCJoinStyle)
-static CARD32 gcvals[6];
-
-static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
-static void newFinalSpan(int y, register int xmin, register int xmax);
-static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right,
- miArcFacePtr left);
-static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc *tarc, int lw,
- miArcFacePtr left, miArcFacePtr right);
-static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
- miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
- double xFtransLeft, double yFtransLeft,
- int xOrgRight, int yOrgRight,
- double xFtransRight, double yFtransRight);
-static void miArcCap(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pFace,
- int end, int xOrg, int yOrg, double xFtrans,
- double yFtrans);
-static void miRoundCap(DrawablePtr pDraw, GCPtr pGC, SppPointRec pCenter,
- SppPointRec pEnd, SppPointRec pCorner,
- SppPointRec pOtherCorner, int fLineEnd,
- int xOrg, int yOrg, double xFtrans, double yFtrans);
-static void miFreeArcs(miPolyArcPtr arcs, GCPtr pGC);
-static miPolyArcPtr miComputeArcs(xArc *parcs, int narcs, GCPtr pGC);
-static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr *ppPts);
-
-# define CUBED_ROOT_2 1.2599210498948732038115849718451499938964
-# define CUBED_ROOT_4 1.5874010519681993173435330390930175781250
-
-/*
- * draw one segment of the arc using the arc spans generation routines
- */
-
-static void
-miArcSegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc tarc,
- miArcFacePtr right,
- miArcFacePtr left)
-{
- int l = pGC->lineWidth;
- int a0, a1, startAngle, endAngle;
- miArcFacePtr temp;
-
- if (!l)
- l = 1;
-
- if (tarc.width == 0 || tarc.height == 0) {
- drawZeroArc (pDraw, pGC, &tarc, l, left, right);
- return;
- }
-
- if (pGC->miTranslate) {
- tarc.x += pDraw->x;
- tarc.y += pDraw->y;
- }
-
- a0 = tarc.angle1;
- a1 = tarc.angle2;
- if (a1 > FULLCIRCLE)
- a1 = FULLCIRCLE;
- else if (a1 < -FULLCIRCLE)
- a1 = -FULLCIRCLE;
- if (a1 < 0) {
- startAngle = a0 + a1;
- endAngle = a0;
- temp = right;
- right = left;
- left = temp;
- } else {
- startAngle = a0;
- endAngle = a0 + a1;
- }
- /*
- * bounds check the two angles
- */
- if (startAngle < 0)
- startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
- if (startAngle >= FULLCIRCLE)
- startAngle = startAngle % FULLCIRCLE;
- if (endAngle < 0)
- endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE;
- if (endAngle > FULLCIRCLE)
- endAngle = (endAngle-1) % FULLCIRCLE + 1;
- if ((startAngle == endAngle) && a1) {
- startAngle = 0;
- endAngle = FULLCIRCLE;
- }
-
- drawArc (&tarc, l, startAngle, endAngle, right, left);
-}
-
-/*
-
-Three equations combine to describe the boundaries of the arc
-
-x^2/w^2 + y^2/h^2 = 1 ellipse itself
-(X-x)^2 + (Y-y)^2 = r^2 circle at (x, y) on the ellipse
-(Y-y) = (X-x)*w^2*y/(h^2*x) normal at (x, y) on the ellipse
-
-These lead to a quartic relating Y and y
-
-y^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2
- - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0
-
-The reducible cubic obtained from this quartic is
-
-z^3 - (3N)z^2 - 2V = 0
-
-where
-
-N = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6
-V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2)
-
-Let
-
-t = z - N
-p = -N^2
-q = -N^3 - V
-
-Then we get
-
-t^3 + 3pt + 2q = 0
-
-The discriminant of this cubic is
-
-D = q^2 + p^3
-
-When D > 0, a real root is obtained as
-
-z = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D))
-
-When D < 0, a real root is obtained as
-
-z = N - 2m*cos(acos(-q/m^3)/3)
-
-where
-
-m = sqrt(|p|) * sign(q)
-
-Given a real root Z of the cubic, the roots of the quartic are the roots
-of the two quadratics
-
-y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0
-
-where
-
-A = +/- sqrt(8Z + b^2 - 4c)
-b, c, d are the cubic, quadratic, and linear coefficients of the quartic
-
-Some experimentation is then required to determine which solutions
-correspond to the inner and outer boundaries.
-
-*/
-
-typedef struct {
- short lx, lw, rx, rw;
-} miArcSpan;
-
-typedef struct {
- miArcSpan *spans;
- int count1, count2, k;
- char top, bot, hole;
-} miArcSpanData;
-
-typedef struct {
- unsigned long lrustamp;
- unsigned short lw;
- unsigned short width, height;
- miArcSpanData *spdata;
-} arcCacheRec;
-
-#define CACHESIZE 25
-
-static void drawQuadrant(struct arc_def *def, struct accelerators *acc,
- int a0, int a1, int mask, miArcFacePtr right,
- miArcFacePtr left, miArcSpanData *spdata);
-
-static arcCacheRec arcCache[CACHESIZE];
-static unsigned long lrustamp;
-static arcCacheRec *lastCacheHit = &arcCache[0];
-static RESTYPE cacheType;
-
-/*
- * External so it can be called when low on memory.
- * Call with a zero ID in that case.
- */
-/*ARGSUSED*/
-int
-miFreeArcCache (data, id)
- pointer data;
- XID id;
-{
- int k;
- arcCacheRec *cent;
-
- if (id)
- cacheType = 0;
-
- for (k = CACHESIZE, cent = &arcCache[0]; --k >= 0; cent++)
- {
- if (cent->spdata)
- {
- cent->lrustamp = 0;
- cent->lw = 0;
- xfree(cent->spdata);
- cent->spdata = NULL;
- }
- }
- lrustamp = 0;
- return Success;
-}
-
-static void
-miComputeCircleSpans(
- int lw,
- xArc *parc,
- miArcSpanData *spdata)
-{
- register miArcSpan *span;
- int doinner;
- register int x, y, e;
- int xk, yk, xm, ym, dx, dy;
- register int slw, inslw;
- int inx = 0, iny, ine = 0;
- int inxk = 0, inyk = 0, inxm = 0, inym = 0;
-
- doinner = -lw;
- slw = parc->width - doinner;
- y = parc->height >> 1;
- dy = parc->height & 1;
- dx = 1 - dy;
- MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym);
- inslw = parc->width + doinner;
- if (inslw > 0)
- {
- spdata->hole = spdata->top;
- MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym);
- }
- else
- {
- spdata->hole = FALSE;
- doinner = -y;
- }
- spdata->count1 = -doinner - spdata->top;
- spdata->count2 = y + doinner;
- span = spdata->spans;
- while (y)
- {
- MIFILLARCSTEP(slw);
- span->lx = dy - x;
- if (++doinner <= 0)
- {
- span->lw = slw;
- span->rx = 0;
- span->rw = span->lx + slw;
- }
- else
- {
- MIFILLINARCSTEP(inslw);
- span->lw = x - inx;
- span->rx = dy - inx + inslw;
- span->rw = inx - x + slw - inslw;
- }
- span++;
- }
- if (spdata->bot)
- {
- if (spdata->count2)
- spdata->count2--;
- else
- {
- if (lw > (int)parc->height)
- span[-1].rx = span[-1].rw = -((lw - (int)parc->height) >> 1);
- else
- span[-1].rw = 0;
- spdata->count1--;
- }
- }
-}
-
-static void
-miComputeEllipseSpans(
- int lw,
- xArc *parc,
- miArcSpanData *spdata)
-{
- register miArcSpan *span;
- double w, h, r, xorg;
- double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
- double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;
- int flip, solution;
-
- w = (double)parc->width / 2.0;
- h = (double)parc->height / 2.0;
- r = lw / 2.0;
- rs = r * r;
- Hs = h * h;
- WH = w * w - Hs;
- Nk = w * r;
- Vk = (Nk * Hs) / (WH + WH);
- Hf = Hs * Hs;
- Nk = (Hf - Nk * Nk) / WH;
- Fk = Hf / WH;
- hepp = h + EPSILON;
- hepm = h - EPSILON;
- K = h + ((lw - 1) >> 1);
- span = spdata->spans;
- if (parc->width & 1)
- xorg = .5;
- else
- xorg = 0.0;
- if (spdata->top)
- {
- span->lx = 0;
- span->lw = 1;
- span++;
- }
- spdata->count1 = 0;
- spdata->count2 = 0;
- spdata->hole = (spdata->top &&
- (int)parc->height * lw <= (int)(parc->width * parc->width) &&
- lw < (int)parc->height);
- for (; K > 0.0; K -= 1.0)
- {
- N = (K * K + Nk) / 6.0;
- Nc = N * N * N;
- Vr = Vk * K;
- t = Nc + Vr * Vr;
- d = Nc + t;
- if (d < 0.0) {
- d = Nc;
- b = N;
- if ( (b < 0.0) == (t < 0.0) )
- {
- b = -b;
- d = -d;
- }
- Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
- if ( (Z < 0.0) == (Vr < 0.0) )
- flip = 2;
- else
- flip = 1;
- }
- else
- {
- d = Vr * sqrt(d);
- Z = N + cbrt(t + d) + cbrt(t - d);
- flip = 0;
- }
- A = sqrt((Z + Z) - Nk);
- T = (Fk - Z) * K / A;
- inx = 0.0;
- solution = FALSE;
- b = -A + K;
- d = b * b - 4 * (Z + T);
- if (d >= 0)
- {
- d = sqrt(d);
- y = (b + d) / 2;
- if ((y >= 0.0) && (y < hepp))
- {
- solution = TRUE;
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- if (flip == 2)
- inx = x - t;
- else
- outx = x + t;
- }
- }
- b = A + K;
- d = b * b - 4 * (Z - T);
- /* Because of the large magnitudes involved, we lose enough precision
- * that sometimes we end up with a negative value near the axis, when
- * it should be positive. This is a workaround.
- */
- if (d < 0 && !solution)
- d = 0.0;
- if (d >= 0) {
- d = sqrt(d);
- y = (b + d) / 2;
- if (y < hepp)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- inx = x - sqrt(rs - (t * t));
- else
- inx = x;
- }
- y = (b - d) / 2;
- if (y >= 0.0)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- if (flip == 1)
- inx = x - t;
- else
- outx = x + t;
- }
- }
- span->lx = ICEIL(xorg - outx);
- if (inx <= 0.0)
- {
- spdata->count1++;
- span->lw = ICEIL(xorg + outx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = -ICEIL(xorg - inx);
- }
- else
- {
- spdata->count2++;
- span->lw = ICEIL(xorg - inx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = ICEIL(xorg + outx) - span->rx;
- }
- span++;
- }
- if (spdata->bot)
- {
- outx = w + r;
- if (r >= h && r <= w)
- inx = 0.0;
- else if (Nk < 0.0 && -Nk < Hs)
- {
- inx = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
- if (inx > w - r)
- inx = w - r;
- }
- else
- inx = w - r;
- span->lx = ICEIL(xorg - outx);
- if (inx <= 0.0)
- {
- span->lw = ICEIL(xorg + outx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = -ICEIL(xorg - inx);
- }
- else
- {
- span->lw = ICEIL(xorg - inx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = ICEIL(xorg + outx) - span->rx;
- }
- }
- if (spdata->hole)
- {
- span = &spdata->spans[spdata->count1];
- span->lw = -span->lx;
- span->rx = 1;
- span->rw = span->lw;
- spdata->count1--;
- spdata->count2++;
- }
-}
-
-static double
-tailX(
- double K,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc)
-{
- double w, h, r;
- double Hs, Hf, WH, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
- double A, T, b, d, x, y, t, hepp, hepm;
- int flip, solution;
- double xs[2];
- double *xp;
-
- w = def->w;
- h = def->h;
- r = def->l;
- rs = r * r;
- Hs = acc->h2;
- WH = -acc->h2mw2;
- Nk = def->w * r;
- Vk = (Nk * Hs) / (WH + WH);
- Hf = acc->h4;
- Nk = (Hf - Nk * Nk) / WH;
- if (K == 0.0) {
- if (Nk < 0.0 && -Nk < Hs) {
- xs[0] = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
- xs[1] = w - r;
- if (acc->left.valid && boundedLe(K, bounds->left) &&
- !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
- return xs[1];
- if (acc->right.valid && boundedLe(K, bounds->right) &&
- !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
- return xs[1];
- return xs[0];
- }
- return w - r;
- }
- Fk = Hf / WH;
- hepp = h + EPSILON;
- hepm = h - EPSILON;
- N = (K * K + Nk) / 6.0;
- Nc = N * N * N;
- Vr = Vk * K;
- xp = xs;
- xs[0] = 0.0;
- t = Nc + Vr * Vr;
- d = Nc + t;
- if (d < 0.0) {
- d = Nc;
- b = N;
- if ( (b < 0.0) == (t < 0.0) )
- {
- b = -b;
- d = -d;
- }
- Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
- if ( (Z < 0.0) == (Vr < 0.0) )
- flip = 2;
- else
- flip = 1;
- }
- else
- {
- d = Vr * sqrt(d);
- Z = N + cbrt(t + d) + cbrt(t - d);
- flip = 0;
- }
- A = sqrt((Z + Z) - Nk);
- T = (Fk - Z) * K / A;
- solution = FALSE;
- b = -A + K;
- d = b * b - 4 * (Z + T);
- if (d >= 0 && flip == 2)
- {
- d = sqrt(d);
- y = (b + d) / 2;
- if ((y >= 0.0) && (y < hepp))
- {
- solution = TRUE;
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- *xp++ = x - t;
- }
- }
- b = A + K;
- d = b * b - 4 * (Z - T);
- /* Because of the large magnitudes involved, we lose enough precision
- * that sometimes we end up with a negative value near the axis, when
- * it should be positive. This is a workaround.
- */
- if (d < 0 && !solution)
- d = 0.0;
- if (d >= 0) {
- d = sqrt(d);
- y = (b + d) / 2;
- if (y < hepp)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- *xp++ = x - sqrt(rs - (t * t));
- else
- *xp++ = x;
- }
- y = (b - d) / 2;
- if (y >= 0.0 && flip == 1)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- *xp++ = x - t;
- }
- }
- if (xp > &xs[1]) {
- if (acc->left.valid && boundedLe(K, bounds->left) &&
- !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
- return xs[1];
- if (acc->right.valid && boundedLe(K, bounds->right) &&
- !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
- return xs[1];
- }
- return xs[0];
-}
-
-static miArcSpanData *
-miComputeWideEllipse(
- int lw,
- register xArc *parc,
- Bool *mustFree)
-{
- register miArcSpanData *spdata;
- register arcCacheRec *cent, *lruent;
- register int k;
- arcCacheRec fakeent;
-
- if (!lw)
- lw = 1;
- if (parc->height <= 1500)
- {
- *mustFree = FALSE;
- cent = lastCacheHit;
- if (cent->lw == lw &&
- cent->width == parc->width && cent->height == parc->height)
- {
- cent->lrustamp = ++lrustamp;
- return cent->spdata;
- }
- lruent = &arcCache[0];
- for (k = CACHESIZE, cent = lruent; --k >= 0; cent++)
- {
- if (cent->lw == lw &&
- cent->width == parc->width && cent->height == parc->height)
- {
- cent->lrustamp = ++lrustamp;
- lastCacheHit = cent;
- return cent->spdata;
- }
- if (cent->lrustamp < lruent->lrustamp)
- lruent = cent;
- }
- if (!cacheType)
- {
- cacheType = CreateNewResourceType(miFreeArcCache);
- (void) AddResource(FakeClientID(0), cacheType, NULL);
- }
- } else {
- lruent = &fakeent;
- lruent->spdata = NULL;
- *mustFree = TRUE;
- }
- k = (parc->height >> 1) + ((lw - 1) >> 1);
- spdata = lruent->spdata;
- if (!spdata || spdata->k != k)
- {
- if (spdata)
- xfree(spdata);
- spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) +
- sizeof(miArcSpan) * (k + 2));
- lruent->spdata = spdata;
- if (!spdata)
- {
- lruent->lrustamp = 0;
- lruent->lw = 0;
- return spdata;
- }
- spdata->spans = (miArcSpan *)(spdata + 1);
- spdata->k = k;
- }
- spdata->top = !(lw & 1) && !(parc->width & 1);
- spdata->bot = !(parc->height & 1);
- lruent->lrustamp = ++lrustamp;
- lruent->lw = lw;
- lruent->width = parc->width;
- lruent->height = parc->height;
- if (lruent != &fakeent)
- lastCacheHit = lruent;
- if (parc->width == parc->height)
- miComputeCircleSpans(lw, parc, spdata);
- else
- miComputeEllipseSpans(lw, parc, spdata);
- return spdata;
-}
-
-static void
-miFillWideEllipse(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *parc)
-{
- DDXPointPtr points;
- register DDXPointPtr pts;
- int *widths;
- register int *wids;
- miArcSpanData *spdata;
- Bool mustFree;
- register miArcSpan *span;
- register int xorg, yorgu, yorgl;
- register int n;
-
- yorgu = parc->height + pGC->lineWidth;
- n = (sizeof(int) * 2) * yorgu;
- widths = (int *)ALLOCATE_LOCAL(n + (sizeof(DDXPointRec) * 2) * yorgu);
- if (!widths)
- return;
- points = (DDXPointPtr)((char *)widths + n);
- spdata = miComputeWideEllipse((int)pGC->lineWidth, parc, &mustFree);
- if (!spdata)
- {
- DEALLOCATE_LOCAL(widths);
- return;
- }
- pts = points;
- wids = widths;
- span = spdata->spans;
- xorg = parc->x + (parc->width >> 1);
- yorgu = parc->y + (parc->height >> 1);
- yorgl = yorgu + (parc->height & 1);
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorgu += pDraw->y;
- yorgl += pDraw->y;
- }
- yorgu -= spdata->k;
- yorgl += spdata->k;
- if (spdata->top)
- {
- pts->x = xorg;
- pts->y = yorgu - 1;
- pts++;
- *wids++ = 1;
- span++;
- }
- for (n = spdata->count1; --n >= 0; )
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = pts[0].x;
- pts[1].y = yorgl;
- wids[1] = wids[0];
- yorgu++;
- yorgl--;
- pts += 2;
- wids += 2;
- span++;
- }
- if (spdata->hole)
- {
- pts[0].x = xorg;
- pts[0].y = yorgl;
- wids[0] = 1;
- pts++;
- wids++;
- }
- for (n = spdata->count2; --n >= 0; )
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = xorg + span->rx;
- pts[1].y = pts[0].y;
- wids[1] = span->rw;
- pts[2].x = pts[0].x;
- pts[2].y = yorgl;
- wids[2] = wids[0];
- pts[3].x = pts[1].x;
- pts[3].y = pts[2].y;
- wids[3] = wids[1];
- yorgu++;
- yorgl--;
- pts += 4;
- wids += 4;
- span++;
- }
- if (spdata->bot)
- {
- if (span->rw <= 0)
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts++;
- wids++;
- }
- else
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = xorg + span->rx;
- pts[1].y = pts[0].y;
- wids[1] = span->rw;
- pts += 2;
- wids += 2;
- }
- }
- if (mustFree)
- xfree(spdata);
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
-
- DEALLOCATE_LOCAL(widths);
-}
-
-/*
- * miPolyArc strategy:
- *
- * If arc is zero width and solid, we don't have to worry about the rasterop
- * or join styles. For wide solid circles, we use a fast integer algorithm.
- * For wide solid ellipses, we use special case floating point code.
- * Otherwise, we set up pDrawTo and pGCTo according to the rasterop, then
- * draw using pGCTo and pDrawTo. If the raster-op was "tricky," that is,
- * if it involves the destination, then we use PushPixels to move the bits
- * from the scratch drawable to pDraw. (See the wide line code for a
- * fuller explanation of this.)
- */
-
-void
-miPolyArc(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register int i;
- xArc *parc;
- int xMin, xMax, yMin, yMax;
- int pixmapWidth = 0, pixmapHeight = 0;
- int xOrg = 0, yOrg = 0;
- int width;
- Bool fTricky;
- DrawablePtr pDrawTo;
- CARD32 fg, bg;
- GCPtr pGCTo;
- miPolyArcPtr polyArcs;
- int cap[2], join[2];
- int iphase;
- int halfWidth;
-
- width = pGC->lineWidth;
- if(width == 0 && pGC->lineStyle == LineSolid)
- {
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- miArcSegment( pDraw, pGC, *parc,
- (miArcFacePtr) 0, (miArcFacePtr) 0 );
- fillSpans (pDraw, pGC);
- }
- else
- {
- if ((pGC->lineStyle == LineSolid) && narcs)
- {
- while (parcs->width && parcs->height &&
- (parcs->angle2 >= FULLCIRCLE ||
- parcs->angle2 <= -FULLCIRCLE))
- {
- miFillWideEllipse(pDraw, pGC, parcs);
- if (!--narcs)
- return;
- parcs++;
- }
- }
-
- /* Set up pDrawTo and pGCTo based on the rasterop */
- switch(pGC->alu)
- {
- case GXclear: /* 0 */
- case GXcopy: /* src */
- case GXcopyInverted: /* NOT src */
- case GXset: /* 1 */
- fTricky = FALSE;
- pDrawTo = pDraw;
- pGCTo = pGC;
- break;
- default:
- fTricky = TRUE;
-
- /* find bounding box around arcs */
- xMin = yMin = MAXSHORT;
- xMax = yMax = MINSHORT;
-
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- {
- xMin = min (xMin, parc->x);
- yMin = min (yMin, parc->y);
- xMax = max (xMax, (parc->x + (int) parc->width));
- yMax = max (yMax, (parc->y + (int) parc->height));
- }
-
- /* expand box to deal with line widths */
- halfWidth = (width + 1)/2;
- xMin -= halfWidth;
- yMin -= halfWidth;
- xMax += halfWidth;
- yMax += halfWidth;
-
- /* compute pixmap size; limit it to size of drawable */
- xOrg = max(xMin, 0);
- yOrg = max(yMin, 0);
- pixmapWidth = min(xMax, pDraw->width) - xOrg;
- pixmapHeight = min(yMax, pDraw->height) - yOrg;
-
- /* if nothing left, return */
- if ( (pixmapWidth <= 0) || (pixmapHeight <= 0) ) return;
-
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- {
- parc->x -= xOrg;
- parc->y -= yOrg;
- }
- if (pGC->miTranslate)
- {
- xOrg += pDraw->x;
- yOrg += pDraw->y;
- }
-
- /* set up scratch GC */
-
- pGCTo = GetScratchGC(1, pDraw->pScreen);
- if (!pGCTo)
- return;
- gcvals[GCValsFunction] = GXcopy;
- gcvals[GCValsForeground] = 1;
- gcvals[GCValsBackground] = 0;
- gcvals[GCValsLineWidth] = pGC->lineWidth;
- gcvals[GCValsCapStyle] = pGC->capStyle;
- gcvals[GCValsJoinStyle] = pGC->joinStyle;
- dixChangeGC(NullClient, pGCTo, GCValsMask, gcvals, NULL);
-
- /* allocate a 1 bit deep pixmap of the appropriate size, and
- * validate it */
- pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, pixmapWidth, pixmapHeight, 1);
- if (!pDrawTo)
- {
- FreeScratchGC(pGCTo);
- return;
- }
- ValidateGC(pDrawTo, pGCTo);
- miClearDrawable(pDrawTo, pGCTo);
- }
-
- fg = pGC->fgPixel;
- bg = pGC->bgPixel;
- if ((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillOpaqueStippled))
- bg = fg; /* the protocol sez these don't cause color changes */
-
- polyArcs = miComputeArcs (parcs, narcs, pGC);
-
- if (!polyArcs)
- {
- if (fTricky) {
- (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr)pDrawTo);
- FreeScratchGC (pGCTo);
- }
- return;
- }
-
- cap[0] = cap[1] = 0;
- join[0] = join[1] = 0;
- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
- iphase >= 0;
- iphase--)
- {
- if (iphase == 1) {
- dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL);
- ValidateGC (pDraw, pGC);
- } else if (pGC->lineStyle == LineDoubleDash) {
- dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
- ValidateGC (pDraw, pGC);
- }
- for (i = 0; i < polyArcs[iphase].narcs; i++) {
- miArcDataPtr arcData;
-
- arcData = &polyArcs[iphase].arcs[i];
- miArcSegment(pDrawTo, pGCTo, arcData->arc,
- &arcData->bounds[RIGHT_END],
- &arcData->bounds[LEFT_END]);
- if (polyArcs[iphase].arcs[i].render) {
- fillSpans (pDrawTo, pGCTo);
- /*
- * don't cap self-joining arcs
- */
- if (polyArcs[iphase].arcs[i].selfJoin &&
- cap[iphase] < polyArcs[iphase].arcs[i].cap)
- cap[iphase]++;
- while (cap[iphase] < polyArcs[iphase].arcs[i].cap) {
- int arcIndex, end;
- miArcDataPtr arcData0;
-
- arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex;
- end = polyArcs[iphase].caps[cap[iphase]].end;
- arcData0 = &polyArcs[iphase].arcs[arcIndex];
- miArcCap (pDrawTo, pGCTo,
- &arcData0->bounds[end], end,
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0);
- ++cap[iphase];
- }
- while (join[iphase] < polyArcs[iphase].arcs[i].join) {
- int arcIndex0, arcIndex1, end0, end1;
- int phase0, phase1;
- miArcDataPtr arcData0, arcData1;
- miArcJoinPtr joinp;
-
- joinp = &polyArcs[iphase].joins[join[iphase]];
- arcIndex0 = joinp->arcIndex0;
- end0 = joinp->end0;
- arcIndex1 = joinp->arcIndex1;
- end1 = joinp->end1;
- phase0 = joinp->phase0;
- phase1 = joinp->phase1;
- arcData0 = &polyArcs[phase0].arcs[arcIndex0];
- arcData1 = &polyArcs[phase1].arcs[arcIndex1];
- miArcJoin (pDrawTo, pGCTo,
- &arcData0->bounds[end0],
- &arcData1->bounds[end1],
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0,
- arcData1->arc.x, arcData1->arc.y,
- (double) arcData1->arc.width / 2.0,
- (double) arcData1->arc.height / 2.0);
- ++join[iphase];
- }
- if (fTricky) {
- if (pGC->serialNumber != pDraw->serialNumber)
- ValidateGC (pDraw, pGC);
- (*pGC->ops->PushPixels) (pGC, (PixmapPtr)pDrawTo,
- pDraw, pixmapWidth, pixmapHeight, xOrg, yOrg);
- miClearDrawable ((DrawablePtr) pDrawTo, pGCTo);
- }
- }
- }
- }
- miFreeArcs(polyArcs, pGC);
-
- if(fTricky)
- {
- (*pGCTo->pScreen->DestroyPixmap)((PixmapPtr)pDrawTo);
- FreeScratchGC(pGCTo);
- }
- }
-}
-
-static double
-angleBetween (SppPointRec center, SppPointRec point1, SppPointRec point2)
-{
- double a1, a2, a;
-
- /*
- * reflect from X coordinates back to ellipse
- * coordinates -- y increasing upwards
- */
- a1 = miDatan2 (- (point1.y - center.y), point1.x - center.x);
- a2 = miDatan2 (- (point2.y - center.y), point2.x - center.x);
- a = a2 - a1;
- if (a <= -180.0)
- a += 360.0;
- else if (a > 180.0)
- a -= 360.0;
- return a;
-}
-
-static void
-translateBounds (
- miArcFacePtr b,
- int x,
- int y,
- double fx,
- double fy)
-{
- fx += x;
- fy += y;
- b->clock.x -= fx;
- b->clock.y -= fy;
- b->center.x -= fx;
- b->center.y -= fy;
- b->counterClock.x -= fx;
- b->counterClock.y -= fy;
-}
-
-static void
-miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
- miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
- double xFtransLeft, double yFtransLeft,
- int xOrgRight, int yOrgRight,
- double xFtransRight, double yFtransRight)
-{
- SppPointRec center, corner, otherCorner;
- SppPointRec poly[5], e;
- SppPointPtr pArcPts;
- int cpt;
- SppArcRec arc;
- miArcFaceRec Right, Left;
- int polyLen = 0;
- int xOrg, yOrg;
- double xFtrans, yFtrans;
- double a;
- double ae, ac2, ec2, bc2, de;
- double width;
-
- xOrg = (xOrgRight + xOrgLeft) / 2;
- yOrg = (yOrgRight + yOrgLeft) / 2;
- xFtrans = (xFtransLeft + xFtransRight) / 2;
- yFtrans = (yFtransLeft + yFtransRight) / 2;
- Right = *pRight;
- translateBounds (&Right, xOrg - xOrgRight, yOrg - yOrgRight,
- xFtrans - xFtransRight, yFtrans - yFtransRight);
- Left = *pLeft;
- translateBounds (&Left, xOrg - xOrgLeft, yOrg - yOrgLeft,
- xFtrans - xFtransLeft, yFtrans - yFtransLeft);
- pRight = &Right;
- pLeft = &Left;
-
- if (pRight->clock.x == pLeft->counterClock.x &&
- pRight->clock.y == pLeft->counterClock.y)
- return;
- center = pRight->center;
- if (0 <= (a = angleBetween (center, pRight->clock, pLeft->counterClock))
- && a <= 180.0)
- {
- corner = pRight->clock;
- otherCorner = pLeft->counterClock;
- } else {
- a = angleBetween (center, pLeft->clock, pRight->counterClock);
- corner = pLeft->clock;
- otherCorner = pRight->counterClock;
- }
- switch (pGC->joinStyle) {
- case JoinRound:
- width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
-
- arc.x = center.x - width/2;
- arc.y = center.y - width/2;
- arc.width = width;
- arc.height = width;
- arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
- arc.angle2 = a;
- pArcPts = (SppPointPtr) xalloc (3 * sizeof (SppPointRec));
- if (!pArcPts)
- return;
- pArcPts[0].x = otherCorner.x;
- pArcPts[0].y = otherCorner.y;
- pArcPts[1].x = center.x;
- pArcPts[1].y = center.y;
- pArcPts[2].x = corner.x;
- pArcPts[2].y = corner.y;
- if( (cpt = miGetArcPts(&arc, 3, &pArcPts)) )
- {
- /* by drawing with miFillSppPoly and setting the endpoints of the arc
- * to be the corners, we assure that the cap will meet up with the
- * rest of the line */
- miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
- }
- xfree(pArcPts);
- return;
- case JoinMiter:
- /*
- * don't miter arcs with less than 11 degrees between them
- */
- if (a < 169.0) {
- poly[0] = corner;
- poly[1] = center;
- poly[2] = otherCorner;
- bc2 = (corner.x - otherCorner.x) * (corner.x - otherCorner.x) +
- (corner.y - otherCorner.y) * (corner.y - otherCorner.y);
- ec2 = bc2 / 4;
- ac2 = (corner.x - center.x) * (corner.x - center.x) +
- (corner.y - center.y) * (corner.y - center.y);
- ae = sqrt (ac2 - ec2);
- de = ec2 / ae;
- e.x = (corner.x + otherCorner.x) / 2;
- e.y = (corner.y + otherCorner.y) / 2;
- poly[3].x = e.x + de * (e.x - center.x) / ae;
- poly[3].y = e.y + de * (e.y - center.y) / ae;
- poly[4] = corner;
- polyLen = 5;
- break;
- }
- case JoinBevel:
- poly[0] = corner;
- poly[1] = center;
- poly[2] = otherCorner;
- poly[3] = corner;
- polyLen = 4;
- break;
- }
- miFillSppPoly (pDraw, pGC, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans);
-}
-
-/*ARGSUSED*/
-static void
-miArcCap (
- DrawablePtr pDraw,
- GCPtr pGC,
- miArcFacePtr pFace,
- int end,
- int xOrg,
- int yOrg,
- double xFtrans,
- double yFtrans)
-{
- SppPointRec corner, otherCorner, center, endPoint, poly[5];
-
- corner = pFace->clock;
- otherCorner = pFace->counterClock;
- center = pFace->center;
- switch (pGC->capStyle) {
- case CapProjecting:
- poly[0].x = otherCorner.x;
- poly[0].y = otherCorner.y;
- poly[1].x = corner.x;
- poly[1].y = corner.y;
- poly[2].x = corner.x -
- (center.y - corner.y);
- poly[2].y = corner.y +
- (center.x - corner.x);
- poly[3].x = otherCorner.x -
- (otherCorner.y - center.y);
- poly[3].y = otherCorner.y +
- (otherCorner.x - center.x);
- poly[4].x = otherCorner.x;
- poly[4].y = otherCorner.y;
- miFillSppPoly (pDraw, pGC, 5, poly, xOrg, yOrg, xFtrans, yFtrans);
- break;
- case CapRound:
- /*
- * miRoundCap just needs these to be unequal.
- */
- endPoint = center;
- endPoint.x = endPoint.x + 100;
- miRoundCap (pDraw, pGC, center, endPoint, corner, otherCorner, 0,
- -xOrg, -yOrg, xFtrans, yFtrans);
- break;
- }
-}
-
-/* MIROUNDCAP -- a private helper function
- * Put Rounded cap on end. pCenter is the center of this end of the line
- * pEnd is the center of the other end of the line. pCorner is one of the
- * two corners at this end of the line.
- * NOTE: pOtherCorner must be counter-clockwise from pCorner.
- */
-/*ARGSUSED*/
-static void
-miRoundCap(
- DrawablePtr pDraw,
- GCPtr pGC,
- SppPointRec pCenter,
- SppPointRec pEnd,
- SppPointRec pCorner,
- SppPointRec pOtherCorner,
- int fLineEnd,
- int xOrg,
- int yOrg,
- double xFtrans,
- double yFtrans)
-{
- int cpt;
- double width;
- SppArcRec arc;
- SppPointPtr pArcPts;
-
- width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
-
- arc.x = pCenter.x - width/2;
- arc.y = pCenter.y - width/2;
- arc.width = width;
- arc.height = width;
- arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x);
- if(PTISEQUAL(pCenter, pEnd))
- arc.angle2 = - 180.0;
- else {
- arc.angle2 = -miDatan2 (pOtherCorner.y - pCenter.y, pOtherCorner.x - pCenter.x) - arc.angle1;
- if (arc.angle2 < 0)
- arc.angle2 += 360.0;
- }
- pArcPts = (SppPointPtr) NULL;
- if( (cpt = miGetArcPts(&arc, 0, &pArcPts)) )
- {
- /* by drawing with miFillSppPoly and setting the endpoints of the arc
- * to be the corners, we assure that the cap will meet up with the
- * rest of the line */
- miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
- }
- xfree(pArcPts);
-}
-
-/*
- * To avoid inaccuracy at the cardinal points, use trig functions
- * which are exact for those angles
- */
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif
-
-# define Dsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
-# define Dcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
-# define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-static double
-miDcos (double a)
-{
- int i;
-
- if (floor (a/90) == a/90) {
- i = (int) (a/90.0);
- switch (mod (i, 4)) {
- case 0: return 1;
- case 1: return 0;
- case 2: return -1;
- case 3: return 0;
- }
- }
- return cos (a * M_PI / 180.0);
-}
-
-static double
-miDsin (double a)
-{
- int i;
-
- if (floor (a/90) == a/90) {
- i = (int) (a/90.0);
- switch (mod (i, 4)) {
- case 0: return 0;
- case 1: return 1;
- case 2: return 0;
- case 3: return -1;
- }
- }
- return sin (a * M_PI / 180.0);
-}
-
-static double
-miDasin (double v)
-{
- if (v == 0)
- return 0.0;
- if (v == 1.0)
- return 90.0;
- if (v == -1.0)
- return -90.0;
- return asin(v) * (180.0 / M_PI);
-}
-
-static double
-miDatan2 (double dy, double dx)
-{
- if (dy == 0) {
- if (dx >= 0)
- return 0.0;
- return 180.0;
- } else if (dx == 0) {
- if (dy > 0)
- return 90.0;
- return -90.0;
- } else if (Fabs (dy) == Fabs (dx)) {
- if (dy > 0) {
- if (dx > 0)
- return 45.0;
- return 135.0;
- } else {
- if (dx > 0)
- return 315.0;
- return 225.0;
- }
- } else {
- return atan2 (dy, dx) * (180.0 / M_PI);
- }
-}
-
-/* MIGETARCPTS -- Converts an arc into a set of line segments -- a helper
- * routine for filled arc and line (round cap) code.
- * Returns the number of points in the arc. Note that it takes a pointer
- * to a pointer to where it should put the points and an index (cpt).
- * This procedure allocates the space necessary to fit the arc points.
- * Sometimes it's convenient for those points to be at the end of an existing
- * array. (For example, if we want to leave a spare point to make sectors
- * instead of segments.) So we pass in the xalloc()ed chunk that contains the
- * array and an index saying where we should start stashing the points.
- * If there isn't an array already, we just pass in a null pointer and
- * count on xrealloc() to handle the null pointer correctly.
- */
-static int
-miGetArcPts(
- SppArcPtr parc, /* points to an arc */
- int cpt, /* number of points already in arc list */
- SppPointPtr *ppPts) /* pointer to pointer to arc-list -- modified */
-{
- double st, /* Start Theta, start angle */
- et, /* End Theta, offset from start theta */
- dt, /* Delta Theta, angle to sweep ellipse */
- cdt, /* Cos Delta Theta, actually 2 cos(dt) */
- x0, y0, /* the recurrence formula needs two points to start */
- x1, y1,
- x2, y2, /* this will be the new point generated */
- xc, yc; /* the center point */
- int count, i;
- SppPointPtr poly;
-
- /* The spec says that positive angles indicate counterclockwise motion.
- * Given our coordinate system (with 0,0 in the upper left corner),
- * the screen appears flipped in Y. The easiest fix is to negate the
- * angles given */
-
- st = - parc->angle1;
-
- et = - parc->angle2;
-
- /* Try to get a delta theta that is within 1/2 pixel. Then adjust it
- * so that it divides evenly into the total.
- * I'm just using cdt 'cause I'm lazy.
- */
- cdt = parc->width;
- if (parc->height > cdt)
- cdt = parc->height;
- cdt /= 2.0;
- if(cdt <= 0)
- return 0;
- if (cdt < 1.0)
- cdt = 1.0;
- dt = miDasin ( 1.0 / cdt ); /* minimum step necessary */
- count = et/dt;
- count = abs(count) + 1;
- dt = et/count;
- count++;
-
- cdt = 2 * miDcos(dt);
- if (!(poly = (SppPointPtr) xrealloc((pointer)*ppPts,
- (cpt + count) * sizeof(SppPointRec))))
- return(0);
- *ppPts = poly;
-
- xc = parc->width/2.0; /* store half width and half height */
- yc = parc->height/2.0;
-
- x0 = xc * miDcos(st);
- y0 = yc * miDsin(st);
- x1 = xc * miDcos(st + dt);
- y1 = yc * miDsin(st + dt);
- xc += parc->x; /* by adding initial point, these become */
- yc += parc->y; /* the center point */
-
- poly[cpt].x = (xc + x0);
- poly[cpt].y = (yc + y0);
-
- for(i = 2; i < count; i++)
- {
- x2 = cdt * x1 - x0;
- y2 = cdt * y1 - y0;
-
- poly[cpt + i].x = (xc + x2);
- poly[cpt + i].y = (yc + y2);
-
- x0 = x1; y0 = y1;
- x1 = x2; y1 = y2;
- }
- /* adjust the last point */
- if (abs(parc->angle2) >= 360.0)
- poly[cpt +i -1] = poly[0];
- else {
- poly[cpt +i -1].x = (miDcos(st + et) * parc->width/2.0 + xc);
- poly[cpt +i -1].y = (miDsin(st + et) * parc->height/2.0 + yc);
- }
-
- return(count);
-}
-
-struct arcData {
- double x0, y0, x1, y1;
- int selfJoin;
-};
-
-# define ADD_REALLOC_STEP 20
-
-static void
-addCap (
- miArcCapPtr *capsp,
- int *ncapsp,
- int *sizep,
- int end,
- int arcIndex)
-{
- int newsize;
- miArcCapPtr cap;
-
- if (*ncapsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- cap = (miArcCapPtr) xrealloc (*capsp,
- newsize * sizeof (**capsp));
- if (!cap)
- return;
- *sizep = newsize;
- *capsp = cap;
- }
- cap = &(*capsp)[*ncapsp];
- cap->end = end;
- cap->arcIndex = arcIndex;
- ++*ncapsp;
-}
-
-static void
-addJoin (
- miArcJoinPtr *joinsp,
- int *njoinsp,
- int *sizep,
- int end0,
- int index0,
- int phase0,
- int end1,
- int index1,
- int phase1)
-{
- int newsize;
- miArcJoinPtr join;
-
- if (*njoinsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- join = (miArcJoinPtr) xrealloc (*joinsp,
- newsize * sizeof (**joinsp));
- if (!join)
- return;
- *sizep = newsize;
- *joinsp = join;
- }
- join = &(*joinsp)[*njoinsp];
- join->end0 = end0;
- join->arcIndex0 = index0;
- join->phase0 = phase0;
- join->end1 = end1;
- join->arcIndex1 = index1;
- join->phase1 = phase1;
- ++*njoinsp;
-}
-
-static miArcDataPtr
-addArc (
- miArcDataPtr *arcsp,
- int *narcsp,
- int *sizep,
- xArc *xarc)
-{
- int newsize;
- miArcDataPtr arc;
-
- if (*narcsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- arc = (miArcDataPtr) xrealloc (*arcsp,
- newsize * sizeof (**arcsp));
- if (!arc)
- return (miArcDataPtr)NULL;
- *sizep = newsize;
- *arcsp = arc;
- }
- arc = &(*arcsp)[*narcsp];
- arc->arc = *xarc;
- ++*narcsp;
- return arc;
-}
-
-static void
-miFreeArcs(
- miPolyArcPtr arcs,
- GCPtr pGC)
-{
- int iphase;
-
- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
- iphase >= 0;
- iphase--)
- {
- if (arcs[iphase].narcs > 0)
- xfree(arcs[iphase].arcs);
- if (arcs[iphase].njoins > 0)
- xfree(arcs[iphase].joins);
- if (arcs[iphase].ncaps > 0)
- xfree(arcs[iphase].caps);
- }
- xfree(arcs);
-}
-
-/*
- * map angles to radial distance. This only deals with the first quadrant
- */
-
-/*
- * a polygonal approximation to the arc for computing arc lengths
- */
-
-# define DASH_MAP_SIZE 91
-
-# define dashIndexToAngle(di) ((((double) (di)) * 90.0) / ((double) DASH_MAP_SIZE - 1))
-# define xAngleToDashIndex(xa) ((((long) (xa)) * (DASH_MAP_SIZE - 1)) / (90 * 64))
-# define dashIndexToXAngle(di) ((((long) (di)) * (90 * 64)) / (DASH_MAP_SIZE - 1))
-# define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1)))
-
-typedef struct {
- double map[DASH_MAP_SIZE];
-} dashMap;
-
-static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map,
- int *lenp, int backwards);
-
-static void
-computeDashMap (
- xArc *arcp,
- dashMap *map)
-{
- int di;
- double a, x, y, prevx = 0.0, prevy = 0.0, dist;
-
- for (di = 0; di < DASH_MAP_SIZE; di++) {
- a = dashIndexToAngle (di);
- x = ((double) arcp->width / 2.0) * miDcos (a);
- y = ((double) arcp->height / 2.0) * miDsin (a);
- if (di == 0) {
- map->map[di] = 0.0;
- } else {
- dist = hypot (x - prevx, y - prevy);
- map->map[di] = map->map[di - 1] + dist;
- }
- prevx = x;
- prevy = y;
- }
-}
-
-typedef enum {HORIZONTAL, VERTICAL, OTHER} arcTypes;
-
-/* this routine is a bit gory */
-
-static miPolyArcPtr
-miComputeArcs (
- xArc *parcs,
- int narcs,
- GCPtr pGC)
-{
- int isDashed, isDoubleDash;
- int dashOffset;
- miPolyArcPtr arcs;
- int start, i, j, k = 0, nexti, nextk = 0;
- int joinSize[2];
- int capSize[2];
- int arcSize[2];
- int angle2;
- double a0, a1;
- struct arcData *data;
- miArcDataPtr arc;
- xArc xarc;
- int iphase, prevphase = 0, joinphase;
- int arcsJoin;
- int selfJoin;
-
- int iDash = 0, dashRemaining;
- int iDashStart = 0, dashRemainingStart = 0, iphaseStart;
- int startAngle, spanAngle, endAngle, backwards = 0;
- int prevDashAngle, dashAngle;
- dashMap map;
-
- isDashed = !(pGC->lineStyle == LineSolid);
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashOffset = pGC->dashOffset;
-
- data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData));
- if (!data)
- return (miPolyArcPtr)NULL;
- arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
- if (!arcs)
- {
- DEALLOCATE_LOCAL(data);
- return (miPolyArcPtr)NULL;
- }
- for (i = 0; i < narcs; i++) {
- a0 = todeg (parcs[i].angle1);
- angle2 = parcs[i].angle2;
- if (angle2 > FULLCIRCLE)
- angle2 = FULLCIRCLE;
- else if (angle2 < -FULLCIRCLE)
- angle2 = -FULLCIRCLE;
- data[i].selfJoin = angle2 == FULLCIRCLE || angle2 == -FULLCIRCLE;
- a1 = todeg (parcs[i].angle1 + angle2);
- data[i].x0 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a0));
- data[i].y0 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a0));
- data[i].x1 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a1));
- data[i].y1 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a1));
- }
-
- for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) {
- arcs[iphase].njoins = 0;
- arcs[iphase].joins = 0;
- joinSize[iphase] = 0;
-
- arcs[iphase].ncaps = 0;
- arcs[iphase].caps = 0;
- capSize[iphase] = 0;
-
- arcs[iphase].narcs = 0;
- arcs[iphase].arcs = 0;
- arcSize[iphase] = 0;
- }
-
- iphase = 0;
- if (isDashed) {
- iDash = 0;
- dashRemaining = pGC->dash[0];
- while (dashOffset > 0) {
- if (dashOffset >= dashRemaining) {
- dashOffset -= dashRemaining;
- iphase = iphase ? 0 : 1;
- iDash++;
- if (iDash == pGC->numInDashList)
- iDash = 0;
- dashRemaining = pGC->dash[iDash];
- } else {
- dashRemaining -= dashOffset;
- dashOffset = 0;
- }
- }
- iDashStart = iDash;
- dashRemainingStart = dashRemaining;
- }
- iphaseStart = iphase;
-
- for (i = narcs - 1; i >= 0; i--) {
- j = i + 1;
- if (j == narcs)
- j = 0;
- if (data[i].selfJoin || i == j ||
- (UNEQUAL (data[i].x1, data[j].x0) ||
- UNEQUAL (data[i].y1, data[j].y0)))
- {
- if (iphase == 0 || isDoubleDash)
- addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END, 0);
- break;
- }
- }
- start = i + 1;
- if (start == narcs)
- start = 0;
- i = start;
- for (;;) {
- j = i + 1;
- if (j == narcs)
- j = 0;
- nexti = i+1;
- if (nexti == narcs)
- nexti = 0;
- if (isDashed) {
- /*
- ** deal with dashed arcs. Use special rules for certain 0 area arcs.
- ** Presumably, the other 0 area arcs still aren't done right.
- */
- arcTypes arcType = OTHER;
- CARD16 thisLength;
-
- if (parcs[i].height == 0
- && (parcs[i].angle1 % FULLCIRCLE) == 0x2d00
- && parcs[i].angle2 == 0x2d00)
- arcType = HORIZONTAL;
- else if (parcs[i].width == 0
- && (parcs[i].angle1 % FULLCIRCLE) == 0x1680
- && parcs[i].angle2 == 0x2d00)
- arcType = VERTICAL;
- if (arcType == OTHER) {
- /*
- * precompute an approximation map
- */
- computeDashMap (&parcs[i], &map);
- /*
- * compute each individual dash segment using the path
- * length function
- */
- startAngle = parcs[i].angle1;
- spanAngle = parcs[i].angle2;
- if (spanAngle > FULLCIRCLE)
- spanAngle = FULLCIRCLE;
- else if (spanAngle < -FULLCIRCLE)
- spanAngle = -FULLCIRCLE;
- if (startAngle < 0)
- startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
- if (startAngle >= FULLCIRCLE)
- startAngle = startAngle % FULLCIRCLE;
- endAngle = startAngle + spanAngle;
- backwards = spanAngle < 0;
- } else {
- xarc = parcs[i];
- if (arcType == VERTICAL) {
- xarc.angle1 = 0x1680;
- startAngle = parcs[i].y;
- endAngle = startAngle + parcs[i].height;
- } else {
- xarc.angle1 = 0x2d00;
- startAngle = parcs[i].x;
- endAngle = startAngle + parcs[i].width;
- }
- }
- dashAngle = startAngle;
- selfJoin = data[i].selfJoin &&
- (iphase == 0 || isDoubleDash);
- /*
- * add dashed arcs to each bucket
- */
- arc = 0;
- while (dashAngle != endAngle) {
- prevDashAngle = dashAngle;
- if (arcType == OTHER) {
- dashAngle = computeAngleFromPath (prevDashAngle, endAngle,
- &map, &dashRemaining, backwards);
- /* avoid troubles with huge arcs and small dashes */
- if (dashAngle == prevDashAngle) {
- if (backwards)
- dashAngle--;
- else
- dashAngle++;
- }
- } else {
- thisLength = (dashAngle + dashRemaining <= endAngle) ?
- dashRemaining : endAngle - dashAngle;
- if (arcType == VERTICAL) {
- xarc.y = dashAngle;
- xarc.height = thisLength;
- } else {
- xarc.x = dashAngle;
- xarc.width = thisLength;
- }
- dashAngle += thisLength;
- dashRemaining -= thisLength;
- }
- if (iphase == 0 || isDoubleDash) {
- if (arcType == OTHER) {
- xarc = parcs[i];
- spanAngle = prevDashAngle;
- if (spanAngle < 0)
- spanAngle = FULLCIRCLE - (-spanAngle) % FULLCIRCLE;
- if (spanAngle >= FULLCIRCLE)
- spanAngle = spanAngle % FULLCIRCLE;
- xarc.angle1 = spanAngle;
- spanAngle = dashAngle - prevDashAngle;
- if (backwards) {
- if (dashAngle > prevDashAngle)
- spanAngle = - FULLCIRCLE + spanAngle;
- } else {
- if (dashAngle < prevDashAngle)
- spanAngle = FULLCIRCLE + spanAngle;
- }
- if (spanAngle > FULLCIRCLE)
- spanAngle = FULLCIRCLE;
- if (spanAngle < -FULLCIRCLE)
- spanAngle = -FULLCIRCLE;
- xarc.angle2 = spanAngle;
- }
- arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
- &arcSize[iphase], &xarc);
- if (!arc)
- goto arcfail;
- /*
- * cap each end of an on/off dash
- */
- if (!isDoubleDash) {
- if (prevDashAngle != startAngle) {
- addCap (&arcs[iphase].caps,
- &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END,
- arc - arcs[iphase].arcs);
-
- }
- if (dashAngle != endAngle) {
- addCap (&arcs[iphase].caps,
- &arcs[iphase].ncaps,
- &capSize[iphase], LEFT_END,
- arc - arcs[iphase].arcs);
- }
- }
- arc->cap = arcs[iphase].ncaps;
- arc->join = arcs[iphase].njoins;
- arc->render = 0;
- arc->selfJoin = 0;
- if (dashAngle == endAngle)
- arc->selfJoin = selfJoin;
- }
- prevphase = iphase;
- if (dashRemaining <= 0) {
- ++iDash;
- if (iDash == pGC->numInDashList)
- iDash = 0;
- iphase = iphase ? 0:1;
- dashRemaining = pGC->dash[iDash];
- }
- }
- /*
- * make sure a place exists for the position data when
- * drawing a zero-length arc
- */
- if (startAngle == endAngle) {
- prevphase = iphase;
- if (!isDoubleDash && iphase == 1)
- prevphase = 0;
- arc = addArc (&arcs[prevphase].arcs, &arcs[prevphase].narcs,
- &arcSize[prevphase], &parcs[i]);
- if (!arc)
- goto arcfail;
- arc->join = arcs[prevphase].njoins;
- arc->cap = arcs[prevphase].ncaps;
- arc->selfJoin = data[i].selfJoin;
- }
- } else {
- arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
- &arcSize[iphase], &parcs[i]);
- if (!arc)
- goto arcfail;
- arc->join = arcs[iphase].njoins;
- arc->cap = arcs[iphase].ncaps;
- arc->selfJoin = data[i].selfJoin;
- prevphase = iphase;
- }
- if (prevphase == 0 || isDoubleDash)
- k = arcs[prevphase].narcs - 1;
- if (iphase == 0 || isDoubleDash)
- nextk = arcs[iphase].narcs;
- if (nexti == start) {
- nextk = 0;
- if (isDashed) {
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- }
- arcsJoin = narcs > 1 && i != j &&
- ISEQUAL (data[i].x1, data[j].x0) &&
- ISEQUAL (data[i].y1, data[j].y0) &&
- !data[i].selfJoin && !data[j].selfJoin;
- if (arc)
- {
- if (arcsJoin)
- arc->render = 0;
- else
- arc->render = 1;
- }
- if (arcsJoin &&
- (prevphase == 0 || isDoubleDash) &&
- (iphase == 0 || isDoubleDash))
- {
- joinphase = iphase;
- if (isDoubleDash) {
- if (nexti == start)
- joinphase = iphaseStart;
- /*
- * if the join is right at the dash,
- * draw the join in foreground
- * This is because the foreground
- * arcs are computed second, the results
- * of which are needed to draw the join
- */
- if (joinphase != prevphase)
- joinphase = 0;
- }
- if (joinphase == 0 || isDoubleDash) {
- addJoin (&arcs[joinphase].joins,
- &arcs[joinphase].njoins,
- &joinSize[joinphase],
- LEFT_END, k, prevphase,
- RIGHT_END, nextk, iphase);
- arc->join = arcs[prevphase].njoins;
- }
- } else {
- /*
- * cap the left end of this arc
- * unless it joins itself
- */
- if ((prevphase == 0 || isDoubleDash) &&
- !arc->selfJoin)
- {
- addCap (&arcs[prevphase].caps, &arcs[prevphase].ncaps,
- &capSize[prevphase], LEFT_END, k);
- arc->cap = arcs[prevphase].ncaps;
- }
- if (isDashed && !arcsJoin) {
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- nextk = arcs[iphase].narcs;
- if (nexti == start) {
- nextk = 0;
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- /*
- * cap the right end of the next arc. If the
- * next arc is actually the first arc, only
- * cap it if it joins with this arc. This
- * case will occur when the final dash segment
- * of an on/off dash is off. Of course, this
- * cap will be drawn at a strange time, but that
- * hardly matters...
- */
- if ((iphase == 0 || isDoubleDash) &&
- (nexti != start || (arcsJoin && isDashed)))
- addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END, nextk);
- }
- i = nexti;
- if (i == start)
- break;
- }
- /*
- * make sure the last section is rendered
- */
- for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++)
- if (arcs[iphase].narcs > 0) {
- arcs[iphase].arcs[arcs[iphase].narcs-1].render = 1;
- arcs[iphase].arcs[arcs[iphase].narcs-1].join =
- arcs[iphase].njoins;
- arcs[iphase].arcs[arcs[iphase].narcs-1].cap =
- arcs[iphase].ncaps;
- }
- DEALLOCATE_LOCAL(data);
- return arcs;
-arcfail:
- miFreeArcs(arcs, pGC);
- DEALLOCATE_LOCAL(data);
- return (miPolyArcPtr)NULL;
-}
-
-static double
-angleToLength (
- int angle,
- dashMap *map)
-{
- double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen;
- int di;
- int excess;
- Bool oddSide = FALSE;
-
- totallen = 0;
- if (angle >= 0) {
- while (angle >= 90 * 64) {
- angle -= 90 * 64;
- totallen += sidelen;
- oddSide = !oddSide;
- }
- } else {
- while (angle < 0) {
- angle += 90 * 64;
- totallen -= sidelen;
- oddSide = !oddSide;
- }
- }
- if (oddSide)
- angle = 90 * 64 - angle;
-
- di = xAngleToDashIndex (angle);
- excess = angle - dashIndexToXAngle (di);
-
- len = map->map[di];
- /*
- * linearly interpolate between this point and the next
- */
- if (excess > 0) {
- excesslen = (map->map[di + 1] - map->map[di]) *
- ((double) excess) / dashXAngleStep;
- len += excesslen;
- }
- if (oddSide)
- totallen += (sidelen - len);
- else
- totallen += len;
- return totallen;
-}
-
-/*
- * len is along the arc, but may be more than one rotation
- */
-
-static int
-lengthToAngle (
- double len,
- dashMap *map)
-{
- double sidelen = map->map[DASH_MAP_SIZE - 1];
- int angle, angleexcess;
- Bool oddSide = FALSE;
- int a0, a1, a;
-
- angle = 0;
- /*
- * step around the ellipse, subtracting sidelens and
- * adding 90 degrees. oddSide will tell if the
- * map should be interpolated in reverse
- */
- if (len >= 0) {
- if (sidelen == 0)
- return 2 * FULLCIRCLE; /* infinity */
- while (len >= sidelen) {
- angle += 90 * 64;
- len -= sidelen;
- oddSide = !oddSide;
- }
- } else {
- if (sidelen == 0)
- return -2 * FULLCIRCLE; /* infinity */
- while (len < 0) {
- angle -= 90 * 64;
- len += sidelen;
- oddSide = !oddSide;
- }
- }
- if (oddSide)
- len = sidelen - len;
- a0 = 0;
- a1 = DASH_MAP_SIZE - 1;
- /*
- * binary search for the closest pre-computed length
- */
- while (a1 - a0 > 1) {
- a = (a0 + a1) / 2;
- if (len > map->map[a])
- a0 = a;
- else
- a1 = a;
- }
- angleexcess = dashIndexToXAngle (a0);
- /*
- * linearly interpolate to the next point
- */
- angleexcess += (len - map->map[a0]) /
- (map->map[a0+1] - map->map[a0]) * dashXAngleStep;
- if (oddSide)
- angle += (90 * 64) - angleexcess;
- else
- angle += angleexcess;
- return angle;
-}
-
-/*
- * compute the angle of an ellipse which cooresponds to
- * the given path length. Note that the correct solution
- * to this problem is an eliptic integral, we'll punt and
- * approximate (it's only for dashes anyway). This
- * approximation uses a polygon.
- *
- * The remaining portion of len is stored in *lenp -
- * this will be negative if the arc extends beyond
- * len and positive if len extends beyond the arc.
- */
-
-static int
-computeAngleFromPath (
- int startAngle,
- int endAngle, /* normalized absolute angles in *64 degrees */
- dashMap *map,
- int *lenp,
- int backwards)
-{
- int a0, a1, a;
- double len0;
- int len;
-
- a0 = startAngle;
- a1 = endAngle;
- len = *lenp;
- if (backwards) {
- /*
- * flip the problem around to always be
- * forwards
- */
- a0 = FULLCIRCLE - a0;
- a1 = FULLCIRCLE - a1;
- }
- if (a1 < a0)
- a1 += FULLCIRCLE;
- len0 = angleToLength (a0, map);
- a = lengthToAngle (len0 + len, map);
- if (a > a1) {
- a = a1;
- len -= angleToLength (a1, map) - len0;
- } else
- len = 0;
- if (backwards)
- a = FULLCIRCLE - a;
- *lenp = len;
- return a;
-}
-
-/*
- * scan convert wide arcs.
- */
-
-/*
- * draw zero width/height arcs
- */
-
-static void
-drawZeroArc (
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *tarc,
- int lw,
- miArcFacePtr left,
- miArcFacePtr right)
-{
- double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
- double xmax, ymax, xmin, ymin;
- int a0, a1;
- double a, startAngle, endAngle;
- double l, lx, ly;
-
- l = lw / 2.0;
- a0 = tarc->angle1;
- a1 = tarc->angle2;
- if (a1 > FULLCIRCLE)
- a1 = FULLCIRCLE;
- else if (a1 < -FULLCIRCLE)
- a1 = -FULLCIRCLE;
- w = (double)tarc->width / 2.0;
- h = (double)tarc->height / 2.0;
- /*
- * play in X coordinates right away
- */
- startAngle = - ((double) a0 / 64.0);
- endAngle = - ((double) (a0 + a1) / 64.0);
-
- xmax = -w;
- xmin = w;
- ymax = -h;
- ymin = h;
- a = startAngle;
- for (;;)
- {
- x = w * miDcos(a);
- y = h * miDsin(a);
- if (a == startAngle)
- {
- x0 = x;
- y0 = y;
- }
- if (a == endAngle)
- {
- x1 = x;
- y1 = y;
- }
- if (x > xmax)
- xmax = x;
- if (x < xmin)
- xmin = x;
- if (y > ymax)
- ymax = y;
- if (y < ymin)
- ymin = y;
- if (a == endAngle)
- break;
- if (a1 < 0) /* clockwise */
- {
- if (floor (a / 90.0) == floor (endAngle / 90.0))
- a = endAngle;
- else
- a = 90 * (floor (a/90.0) + 1);
- }
- else
- {
- if (ceil (a / 90.0) == ceil (endAngle / 90.0))
- a = endAngle;
- else
- a = 90 * (ceil (a/90.0) - 1);
- }
- }
- lx = ly = l;
- if ((x1 - x0) + (y1 - y0) < 0)
- lx = ly = -l;
- if (h)
- {
- ly = 0.0;
- lx = -lx;
- }
- else
- lx = 0.0;
- if (right)
- {
- right->center.x = x0;
- right->center.y = y0;
- right->clock.x = x0 - lx;
- right->clock.y = y0 - ly;
- right->counterClock.x = x0 + lx;
- right->counterClock.y = y0 + ly;
- }
- if (left)
- {
- left->center.x = x1;
- left->center.y = y1;
- left->clock.x = x1 + lx;
- left->clock.y = y1 + ly;
- left->counterClock.x = x1 - lx;
- left->counterClock.y = y1 - ly;
- }
-
- x0 = xmin;
- x1 = xmax;
- y0 = ymin;
- y1 = ymax;
- if (ymin != y1) {
- xmin = -l;
- xmax = l;
- } else {
- ymin = -l;
- ymax = l;
- }
- if (xmax != xmin && ymax != ymin) {
- int minx, maxx, miny, maxy;
- xRectangle rect;
-
- minx = ICEIL (xmin + w) + tarc->x;
- maxx = ICEIL (xmax + w) + tarc->x;
- miny = ICEIL (ymin + h) + tarc->y;
- maxy = ICEIL (ymax + h) + tarc->y;
- rect.x = minx;
- rect.y = miny;
- rect.width = maxx - minx;
- rect.height = maxy - miny;
- (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect);
- }
-}
-
-/*
- * this computes the ellipse y value associated with the
- * bottom of the tail.
- */
-
-static void
-tailEllipseY (
- struct arc_def *def,
- struct accelerators *acc)
-{
- double t;
-
- acc->tail_y = 0.0;
- if (def->w == def->h)
- return;
- t = def->l * def->w;
- if (def->w > def->h) {
- if (t < acc->h2)
- return;
- } else {
- if (t > acc->h2)
- return;
- }
- t = 2.0 * def->h * t;
- t = (CUBED_ROOT_4 * acc->h2 - cbrt(t * t)) / acc->h2mw2;
- if (t > 0.0)
- acc->tail_y = def->h / CUBED_ROOT_2 * sqrt(t);
-}
-
-/*
- * inverse functions -- compute edge coordinates
- * from the ellipse
- */
-
-static double
-outerXfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-outerYfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerXfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerYfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerYfromY (
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- double x;
-
- x = (def->w / def->h) * sqrt (acc->h2 - y*y);
-
- return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static void
-computeLine (
- double x1,
- double y1,
- double x2,
- double y2,
- struct line *line)
-{
- if (y1 == y2)
- line->valid = 0;
- else {
- line->m = (x1 - x2) / (y1 - y2);
- line->b = x1 - y1 * line->m;
- line->valid = 1;
- }
-}
-
-/*
- * compute various accelerators for an ellipse. These
- * are simply values that are used repeatedly in
- * the computations
- */
-
-static void
-computeAcc (
- xArc *tarc,
- int lw,
- struct arc_def *def,
- struct accelerators *acc)
-{
- def->w = ((double) tarc->width) / 2.0;
- def->h = ((double) tarc->height) / 2.0;
- def->l = ((double) lw) / 2.0;
- acc->h2 = def->h * def->h;
- acc->w2 = def->w * def->w;
- acc->h4 = acc->h2 * acc->h2;
- acc->w4 = acc->w2 * acc->w2;
- acc->h2l = acc->h2 * def->l;
- acc->w2l = acc->w2 * def->l;
- acc->h2mw2 = acc->h2 - acc->w2;
- acc->fromIntX = (tarc->width & 1) ? 0.5 : 0.0;
- acc->fromIntY = (tarc->height & 1) ? 0.5 : 0.0;
- acc->xorg = tarc->x + (tarc->width >> 1);
- acc->yorgu = tarc->y + (tarc->height >> 1);
- acc->yorgl = acc->yorgu + (tarc->height & 1);
- tailEllipseY (def, acc);
-}
-
-/*
- * compute y value bounds of various portions of the arc,
- * the outer edge, the ellipse and the inner edge.
- */
-
-static void
-computeBound (
- struct arc_def *def,
- struct arc_bound *bound,
- struct accelerators *acc,
- miArcFacePtr right,
- miArcFacePtr left)
-{
- double t;
- double innerTaily;
- double tail_y;
- struct bound innerx, outerx;
- struct bound ellipsex;
-
- bound->ellipse.min = Dsin (def->a0) * def->h;
- bound->ellipse.max = Dsin (def->a1) * def->h;
- if (def->a0 == 45 && def->w == def->h)
- ellipsex.min = bound->ellipse.min;
- else
- ellipsex.min = Dcos (def->a0) * def->w;
- if (def->a1 == 45 && def->w == def->h)
- ellipsex.max = bound->ellipse.max;
- else
- ellipsex.max = Dcos (def->a1) * def->w;
- bound->outer.min = outerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- bound->outer.max = outerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
- bound->inner.min = innerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- bound->inner.max = innerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
-
- outerx.min = outerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- outerx.max = outerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
- innerx.min = innerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- innerx.max = innerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
-
- /*
- * save the line end points for the
- * cap code to use. Careful here, these are
- * in cartesean coordinates (y increasing upwards)
- * while the cap code uses inverted coordinates
- * (y increasing downwards)
- */
-
- if (right) {
- right->counterClock.y = bound->outer.min;
- right->counterClock.x = outerx.min;
- right->center.y = bound->ellipse.min;
- right->center.x = ellipsex.min;
- right->clock.y = bound->inner.min;
- right->clock.x = innerx.min;
- }
-
- if (left) {
- left->clock.y = bound->outer.max;
- left->clock.x = outerx.max;
- left->center.y = bound->ellipse.max;
- left->center.x = ellipsex.max;
- left->counterClock.y = bound->inner.max;
- left->counterClock.x = innerx.max;
- }
-
- bound->left.min = bound->inner.max;
- bound->left.max = bound->outer.max;
- bound->right.min = bound->inner.min;
- bound->right.max = bound->outer.min;
-
- computeLine (innerx.min, bound->inner.min, outerx.min, bound->outer.min,
- &acc->right);
- computeLine (innerx.max, bound->inner.max, outerx.max, bound->outer.max,
- &acc->left);
-
- if (bound->inner.min > bound->inner.max) {
- t = bound->inner.min;
- bound->inner.min = bound->inner.max;
- bound->inner.max = t;
- }
- tail_y = acc->tail_y;
- if (tail_y > bound->ellipse.max)
- tail_y = bound->ellipse.max;
- else if (tail_y < bound->ellipse.min)
- tail_y = bound->ellipse.min;
- innerTaily = innerYfromY (tail_y, def, acc);
- if (bound->inner.min > innerTaily)
- bound->inner.min = innerTaily;
- if (bound->inner.max < innerTaily)
- bound->inner.max = innerTaily;
- bound->inneri.min = ICEIL(bound->inner.min - acc->fromIntY);
- bound->inneri.max = floor(bound->inner.max - acc->fromIntY);
- bound->outeri.min = ICEIL(bound->outer.min - acc->fromIntY);
- bound->outeri.max = floor(bound->outer.max - acc->fromIntY);
-}
-
-/*
- * this section computes the x value of the span at y
- * intersected with the specified face of the ellipse.
- *
- * this is the min/max X value over the set of normal
- * lines to the entire ellipse, the equation of the
- * normal lines is:
- *
- * ellipse_x h^2 h^2
- * x = ------------ y + ellipse_x (1 - --- )
- * ellipse_y w^2 w^2
- *
- * compute the derivative with-respect-to ellipse_y and solve
- * for zero:
- *
- * (w^2 - h^2) ellipse_y^3 + h^4 y
- * 0 = - ----------------------------------
- * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2)
- *
- * ( h^4 y )
- * ellipse_y = ( ---------- ) ^ (1/3)
- * ( (h^2 - w^2) )
- *
- * The other two solutions to the equation are imaginary.
- *
- * This gives the position on the ellipse which generates
- * the normal with the largest/smallest x intersection point.
- *
- * Now compute the second derivative to check whether
- * the intersection is a minimum or maximum:
- *
- * h (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
- * - -------------------------------------------
- * w y0^3 (sqrt (h^2 - y^2)) ^ 3
- *
- * as we only care about the sign,
- *
- * - (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
- *
- * or (to use accelerators),
- *
- * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2)
- *
- */
-
-/*
- * computes the position on the ellipse whose normal line
- * intersects the given scan line maximally
- */
-
-static double
-hookEllipseY (
- double scan_y,
- struct arc_bound *bound,
- struct accelerators *acc,
- int left)
-{
- double ret;
-
- if (acc->h2mw2 == 0) {
- if ( (scan_y > 0 && !left) || (scan_y < 0 && left) )
- return bound->ellipse.min;
- return bound->ellipse.max;
- }
- ret = (acc->h4 * scan_y) / (acc->h2mw2);
- if (ret >= 0)
- return cbrt (ret);
- else
- return -cbrt (-ret);
-}
-
-/*
- * computes the X value of the intersection of the
- * given scan line with the right side of the lower hook
- */
-
-static double
-hookX (
- double scan_y,
- struct arc_def *def,
- struct arc_bound *bound,
- struct accelerators *acc,
- int left)
-{
- double ellipse_y, x;
- double maxMin;
-
- if (def->w != def->h) {
- ellipse_y = hookEllipseY (scan_y, bound, acc, left);
- if (boundedLe (ellipse_y, bound->ellipse)) {
- /*
- * compute the value of the second
- * derivative
- */
- maxMin = ellipse_y*ellipse_y*ellipse_y * acc->h2mw2 -
- acc->h2 * scan_y * (3 * ellipse_y*ellipse_y - 2*acc->h2);
- if ((left && maxMin > 0) || (!left && maxMin < 0)) {
- if (ellipse_y == 0)
- return def->w + left ? -def->l : def->l;
- x = (acc->h2 * scan_y - ellipse_y * acc->h2mw2) *
- sqrt (acc->h2 - ellipse_y * ellipse_y) /
- (def->h * def->w * ellipse_y);
- return x;
- }
- }
- }
- if (left) {
- if (acc->left.valid && boundedLe (scan_y, bound->left)) {
- x = intersectLine (scan_y, acc->left);
- } else {
- if (acc->right.valid)
- x = intersectLine (scan_y, acc->right);
- else
- x = def->w - def->l;
- }
- } else {
- if (acc->right.valid && boundedLe (scan_y, bound->right)) {
- x = intersectLine (scan_y, acc->right);
- } else {
- if (acc->left.valid)
- x = intersectLine (scan_y, acc->left);
- else
- x = def->w - def->l;
- }
- }
- return x;
-}
-
-/*
- * generate the set of spans with
- * the given y coordinate
- */
-
-static void
-arcSpan (
- int y,
- int lx,
- int lw,
- int rx,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- int linx, loutx, rinx, routx;
- double x, altx;
-
- if (boundedLe (y, bounds->inneri)) {
- linx = -(lx + lw);
- rinx = rx;
- } else {
- /*
- * intersection with left face
- */
- x = hookX (y + acc->fromIntY, def, bounds, acc, 1);
- if (acc->right.valid &&
- boundedLe (y + acc->fromIntY, bounds->right))
- {
- altx = intersectLine (y + acc->fromIntY, acc->right);
- if (altx < x)
- x = altx;
- }
- linx = -ICEIL(acc->fromIntX - x);
- rinx = ICEIL(acc->fromIntX + x);
- }
- if (boundedLe (y, bounds->outeri)) {
- loutx = -lx;
- routx = rx + rw;
- } else {
- /*
- * intersection with right face
- */
- x = hookX (y + acc->fromIntY, def, bounds, acc, 0);
- if (acc->left.valid &&
- boundedLe (y + acc->fromIntY, bounds->left))
- {
- altx = x;
- x = intersectLine (y + acc->fromIntY, acc->left);
- if (x < altx)
- x = altx;
- }
- loutx = -ICEIL(acc->fromIntX - x);
- routx = ICEIL(acc->fromIntX + x);
- }
- if (routx > rinx) {
- if (mask & 1)
- newFinalSpan (acc->yorgu - y,
- acc->xorg + rinx, acc->xorg + routx);
- if (mask & 8)
- newFinalSpan (acc->yorgl + y,
- acc->xorg + rinx, acc->xorg + routx);
- }
- if (loutx > linx) {
- if (mask & 2)
- newFinalSpan (acc->yorgu - y,
- acc->xorg - loutx, acc->xorg - linx);
- if (mask & 4)
- newFinalSpan (acc->yorgl + y,
- acc->xorg - loutx, acc->xorg - linx);
- }
-}
-
-static void
-arcSpan0 (
- int lx,
- int lw,
- int rx,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- double x;
-
- if (boundedLe (0, bounds->inneri) &&
- acc->left.valid && boundedLe (0, bounds->left) &&
- acc->left.b > 0)
- {
- x = def->w - def->l;
- if (acc->left.b < x)
- x = acc->left.b;
- lw = ICEIL(acc->fromIntX - x) - lx;
- rw += rx;
- rx = ICEIL(acc->fromIntX + x);
- rw -= rx;
- }
- arcSpan (0, lx, lw, rx, rw, def, bounds, acc, mask);
-}
-
-static void
-tailSpan (
- int y,
- int lw,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- double yy, xalt, x, lx, rx;
- int n;
-
- if (boundedLe(y, bounds->outeri))
- arcSpan (y, 0, lw, -rw, rw, def, bounds, acc, mask);
- else if (def->w != def->h) {
- yy = y + acc->fromIntY;
- x = tailX(yy, def, bounds, acc);
- if (yy == 0.0 && x == -rw - acc->fromIntX)
- return;
- if (acc->right.valid && boundedLe (yy, bounds->right)) {
- rx = x;
- lx = -x;
- xalt = intersectLine (yy, acc->right);
- if (xalt >= -rw - acc->fromIntX && xalt <= rx)
- rx = xalt;
- n = ICEIL(acc->fromIntX + lx);
- if (lw > n) {
- if (mask & 2)
- newFinalSpan (acc->yorgu - y,
- acc->xorg + n, acc->xorg + lw);
- if (mask & 4)
- newFinalSpan (acc->yorgl + y,
- acc->xorg + n, acc->xorg + lw);
- }
- n = ICEIL(acc->fromIntX + rx);
- if (n > -rw) {
- if (mask & 1)
- newFinalSpan (acc->yorgu - y,
- acc->xorg - rw, acc->xorg + n);
- if (mask & 8)
- newFinalSpan (acc->yorgl + y,
- acc->xorg - rw, acc->xorg + n);
- }
- }
- arcSpan (y,
- ICEIL(acc->fromIntX - x), 0,
- ICEIL(acc->fromIntX + x), 0,
- def, bounds, acc, mask);
- }
-}
-
-/*
- * create whole arcs out of pieces. This code is
- * very bad.
- */
-
-static struct finalSpan **finalSpans = NULL;
-static int finalMiny = 0, finalMaxy = -1;
-static int finalSize = 0;
-
-static int nspans = 0; /* total spans, not just y coords */
-
-struct finalSpan {
- struct finalSpan *next;
- int min, max; /* x values */
-};
-
-static struct finalSpan *freeFinalSpans, *tmpFinalSpan;
-
-# define allocFinalSpan() (freeFinalSpans ?\
- ((tmpFinalSpan = freeFinalSpans), \
- (freeFinalSpans = freeFinalSpans->next), \
- (tmpFinalSpan->next = 0), \
- tmpFinalSpan) : \
- realAllocSpan ())
-
-# define SPAN_CHUNK_SIZE 128
-
-struct finalSpanChunk {
- struct finalSpan data[SPAN_CHUNK_SIZE];
- struct finalSpanChunk *next;
-};
-
-static struct finalSpanChunk *chunks;
-
-struct finalSpan *
-realAllocSpan ()
-{
- register struct finalSpanChunk *newChunk;
- register struct finalSpan *span;
- register int i;
-
- newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk));
- if (!newChunk)
- return (struct finalSpan *) NULL;
- newChunk->next = chunks;
- chunks = newChunk;
- freeFinalSpans = span = newChunk->data + 1;
- for (i = 1; i < SPAN_CHUNK_SIZE-1; i++) {
- span->next = span+1;
- span++;
- }
- span->next = 0;
- span = newChunk->data;
- span->next = 0;
- return span;
-}
-
-static void
-disposeFinalSpans (void)
-{
- struct finalSpanChunk *chunk, *next;
-
- for (chunk = chunks; chunk; chunk = next) {
- next = chunk->next;
- xfree (chunk);
- }
- chunks = 0;
- freeFinalSpans = 0;
- xfree(finalSpans);
- finalSpans = 0;
-}
-
-static void
-fillSpans (
- DrawablePtr pDrawable,
- GCPtr pGC)
-{
- register struct finalSpan *span;
- register DDXPointPtr xSpan;
- register int *xWidth;
- register int i;
- register struct finalSpan **f;
- register int spany;
- DDXPointPtr xSpans;
- int *xWidths;
-
- if (nspans == 0)
- return;
- xSpan = xSpans = (DDXPointPtr) ALLOCATE_LOCAL (nspans * sizeof (DDXPointRec));
- xWidth = xWidths = (int *) ALLOCATE_LOCAL (nspans * sizeof (int));
- if (xSpans && xWidths)
- {
- i = 0;
- f = finalSpans;
- for (spany = finalMiny; spany <= finalMaxy; spany++, f++) {
- for (span = *f; span; span=span->next) {
- if (span->max <= span->min)
- continue;
- xSpan->x = span->min;
- xSpan->y = spany;
- ++xSpan;
- *xWidth++ = span->max - span->min;
- ++i;
- }
- }
- (*pGC->ops->FillSpans) (pDrawable, pGC, i, xSpans, xWidths, TRUE);
- }
- disposeFinalSpans ();
- if (xSpans)
- DEALLOCATE_LOCAL (xSpans);
- if (xWidths)
- DEALLOCATE_LOCAL (xWidths);
- finalMiny = 0;
- finalMaxy = -1;
- finalSize = 0;
- nspans = 0;
-}
-
-# define SPAN_REALLOC 100
-
-# define findSpan(y) ((finalMiny <= (y) && (y) <= finalMaxy) ? \
- &finalSpans[(y) - finalMiny] : \
- realFindSpan (y))
-
-static struct finalSpan **
-realFindSpan (int y)
-{
- struct finalSpan **newSpans;
- int newSize, newMiny, newMaxy;
- int change;
- int i;
-
- if (y < finalMiny || y > finalMaxy) {
- if (!finalSize) {
- finalMiny = y;
- finalMaxy = y - 1;
- }
- if (y < finalMiny)
- change = finalMiny - y;
- else
- change = y - finalMaxy;
- if (change >= SPAN_REALLOC)
- change += SPAN_REALLOC;
- else
- change = SPAN_REALLOC;
- newSize = finalSize + change;
- newSpans = (struct finalSpan **) xalloc
- (newSize * sizeof (struct finalSpan *));
- if (!newSpans)
- return (struct finalSpan **)NULL;
- newMiny = finalMiny;
- newMaxy = finalMaxy;
- if (y < finalMiny)
- newMiny = finalMiny - change;
- else
- newMaxy = finalMaxy + change;
- if (finalSpans) {
- memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
- (char *) finalSpans,
- finalSize * sizeof (struct finalSpan *));
- xfree (finalSpans);
- }
- if ((i = finalMiny - newMiny) > 0)
- bzero ((char *)newSpans, i * sizeof (struct finalSpan *));
- if ((i = newMaxy - finalMaxy) > 0)
- bzero ((char *)(newSpans + newSize - i),
- i * sizeof (struct finalSpan *));
- finalSpans = newSpans;
- finalMaxy = newMaxy;
- finalMiny = newMiny;
- finalSize = newSize;
- }
- return &finalSpans[y - finalMiny];
-}
-
-static void
-newFinalSpan (
- int y,
- register int xmin,
- register int xmax)
-{
- register struct finalSpan *x;
- register struct finalSpan **f;
- struct finalSpan *oldx;
- struct finalSpan *prev;
-
- f = findSpan (y);
- if (!f)
- return;
- oldx = 0;
- for (;;) {
- prev = 0;
- for (x = *f; x; x=x->next) {
- if (x == oldx) {
- prev = x;
- continue;
- }
- if (x->min <= xmax && xmin <= x->max) {
- if (oldx) {
- oldx->min = min (x->min, xmin);
- oldx->max = max (x->max, xmax);
- if (prev)
- prev->next = x->next;
- else
- *f = x->next;
- --nspans;
- } else {
- x->min = min (x->min, xmin);
- x->max = max (x->max, xmax);
- oldx = x;
- }
- xmin = oldx->min;
- xmax = oldx->max;
- break;
- }
- prev = x;
- }
- if (!x)
- break;
- }
- if (!oldx) {
- x = allocFinalSpan ();
- if (x)
- {
- x->min = xmin;
- x->max = xmax;
- x->next = *f;
- *f = x;
- ++nspans;
- }
- }
-}
-
-static void
-mirrorSppPoint (
- int quadrant,
- SppPointPtr sppPoint)
-{
- switch (quadrant) {
- case 0:
- break;
- case 1:
- sppPoint->x = -sppPoint->x;
- break;
- case 2:
- sppPoint->x = -sppPoint->x;
- sppPoint->y = -sppPoint->y;
- break;
- case 3:
- sppPoint->y = -sppPoint->y;
- break;
- }
- /*
- * and translate to X coordinate system
- */
- sppPoint->y = -sppPoint->y;
-}
-
-/*
- * split an arc into pieces which are scan-converted
- * in the first-quadrant and mirrored into position.
- * This is necessary as the scan-conversion code can
- * only deal with arcs completely contained in the
- * first quadrant.
- */
-
-static void
-drawArc (
- xArc *tarc,
- int l,
- int a0,
- int a1,
- miArcFacePtr right,
- miArcFacePtr left) /* save end line points */
-{
- struct arc_def def;
- struct accelerators acc;
- int startq, endq, curq;
- int rightq, leftq = 0, righta = 0, lefta = 0;
- miArcFacePtr passRight, passLeft;
- int q0 = 0, q1 = 0, mask;
- struct band {
- int a0, a1;
- int mask;
- } band[5], sweep[20];
- int bandno, sweepno;
- int i, j;
- int flipRight = 0, flipLeft = 0;
- int copyEnd = 0;
- miArcSpanData *spdata;
- Bool mustFree;
-
- spdata = miComputeWideEllipse(l, tarc, &mustFree);
- if (!spdata)
- return;
-
- if (a1 < a0)
- a1 += 360 * 64;
- startq = a0 / (90 * 64);
- if (a0 == a1)
- endq = startq;
- else
- endq = (a1-1) / (90 * 64);
- bandno = 0;
- curq = startq;
- rightq = -1;
- for (;;) {
- switch (curq) {
- case 0:
- if (a0 > 90 * 64)
- q0 = 0;
- else
- q0 = a0;
- if (a1 < 360 * 64)
- q1 = min (a1, 90 * 64);
- else
- q1 = 90 * 64;
- if (curq == startq && a0 == q0 && rightq < 0) {
- righta = q0;
- rightq = curq;
- }
- if (curq == endq && a1 == q1) {
- lefta = q1;
- leftq = curq;
- }
- break;
- case 1:
- if (a1 < 90 * 64)
- q0 = 0;
- else
- q0 = 180 * 64 - min (a1, 180 * 64);
- if (a0 > 180 * 64)
- q1 = 90 * 64;
- else
- q1 = 180 * 64 - max (a0, 90 * 64);
- if (curq == startq && 180 * 64 - a0 == q1) {
- righta = q1;
- rightq = curq;
- }
- if (curq == endq && 180 * 64 - a1 == q0) {
- lefta = q0;
- leftq = curq;
- }
- break;
- case 2:
- if (a0 > 270 * 64)
- q0 = 0;
- else
- q0 = max (a0, 180 * 64) - 180 * 64;
- if (a1 < 180 * 64)
- q1 = 90 * 64;
- else
- q1 = min (a1, 270 * 64) - 180 * 64;
- if (curq == startq && a0 - 180*64 == q0) {
- righta = q0;
- rightq = curq;
- }
- if (curq == endq && a1 - 180 * 64 == q1) {
- lefta = q1;
- leftq = curq;
- }
- break;
- case 3:
- if (a1 < 270 * 64)
- q0 = 0;
- else
- q0 = 360 * 64 - min (a1, 360 * 64);
- q1 = 360 * 64 - max (a0, 270 * 64);
- if (curq == startq && 360 * 64 - a0 == q1) {
- righta = q1;
- rightq = curq;
- }
- if (curq == endq && 360 * 64 - a1 == q0) {
- lefta = q0;
- leftq = curq;
- }
- break;
- }
- band[bandno].a0 = q0;
- band[bandno].a1 = q1;
- band[bandno].mask = 1 << curq;
- bandno++;
- if (curq == endq)
- break;
- curq++;
- if (curq == 4) {
- a0 = 0;
- a1 -= 360 * 64;
- curq = 0;
- endq -= 4;
- }
- }
- sweepno = 0;
- for (;;) {
- q0 = 90 * 64;
- mask = 0;
- /*
- * find left-most point
- */
- for (i = 0; i < bandno; i++)
- if (band[i].a0 <= q0) {
- q0 = band[i].a0;
- q1 = band[i].a1;
- mask = band[i].mask;
- }
- if (!mask)
- break;
- /*
- * locate next point of change
- */
- for (i = 0; i < bandno; i++)
- if (!(mask & band[i].mask)) {
- if (band[i].a0 == q0) {
- if (band[i].a1 < q1)
- q1 = band[i].a1;
- mask |= band[i].mask;
- } else if (band[i].a0 < q1)
- q1 = band[i].a0;
- }
- /*
- * create a new sweep
- */
- sweep[sweepno].a0 = q0;
- sweep[sweepno].a1 = q1;
- sweep[sweepno].mask = mask;
- sweepno++;
- /*
- * subtract the sweep from the affected bands
- */
- for (i = 0; i < bandno; i++)
- if (band[i].a0 == q0) {
- band[i].a0 = q1;
- /*
- * check if this band is empty
- */
- if (band[i].a0 == band[i].a1)
- band[i].a1 = band[i].a0 = 90 * 64 + 1;
- }
- }
- computeAcc (tarc, l, &def, &acc);
- for (j = 0; j < sweepno; j++) {
- mask = sweep[j].mask;
- passRight = passLeft = 0;
- if (mask & (1 << rightq)) {
- if (sweep[j].a0 == righta)
- passRight = right;
- else if (sweep[j].a1 == righta) {
- passLeft = right;
- flipRight = 1;
- }
- }
- if (mask & (1 << leftq)) {
- if (sweep[j].a1 == lefta)
- {
- if (passLeft)
- copyEnd = 1;
- passLeft = left;
- }
- else if (sweep[j].a0 == lefta) {
- if (passRight)
- copyEnd = 1;
- passRight = left;
- flipLeft = 1;
- }
- }
- drawQuadrant (&def, &acc, sweep[j].a0, sweep[j].a1, mask,
- passRight, passLeft, spdata);
- }
- /*
- * when copyEnd is set, both ends of the arc were computed
- * at the same time; drawQuadrant only takes one end though,
- * so the left end will be the only one holding the data. Copy
- * it from there.
- */
- if (copyEnd)
- *right = *left;
- /*
- * mirror the coordinates generated for the
- * faces of the arc
- */
- if (right) {
- mirrorSppPoint (rightq, &right->clock);
- mirrorSppPoint (rightq, &right->center);
- mirrorSppPoint (rightq, &right->counterClock);
- if (flipRight) {
- SppPointRec temp;
-
- temp = right->clock;
- right->clock = right->counterClock;
- right->counterClock = temp;
- }
- }
- if (left) {
- mirrorSppPoint (leftq, &left->counterClock);
- mirrorSppPoint (leftq, &left->center);
- mirrorSppPoint (leftq, &left->clock);
- if (flipLeft) {
- SppPointRec temp;
-
- temp = left->clock;
- left->clock = left->counterClock;
- left->counterClock = temp;
- }
- }
- if (mustFree)
- xfree(spdata);
-}
-
-static void
-drawQuadrant (
- struct arc_def *def,
- struct accelerators *acc,
- int a0,
- int a1,
- int mask,
- miArcFacePtr right,
- miArcFacePtr left,
- miArcSpanData *spdata)
-{
- struct arc_bound bound;
- double yy, x, xalt;
- int y, miny, maxy;
- int n;
- miArcSpan *span;
-
- def->a0 = ((double) a0) / 64.0;
- def->a1 = ((double) a1) / 64.0;
- computeBound (def, &bound, acc, right, left);
- yy = bound.inner.min;
- if (bound.outer.min < yy)
- yy = bound.outer.min;
- miny = ICEIL(yy - acc->fromIntY);
- yy = bound.inner.max;
- if (bound.outer.max > yy)
- yy = bound.outer.max;
- maxy = floor(yy - acc->fromIntY);
- y = spdata->k;
- span = spdata->spans;
- if (spdata->top)
- {
- if (a1 == 90 * 64 && (mask & 1))
- newFinalSpan (acc->yorgu - y - 1, acc->xorg, acc->xorg + 1);
- span++;
- }
- for (n = spdata->count1; --n >= 0; )
- {
- if (y < miny)
- return;
- if (y <= maxy) {
- arcSpan (y,
- span->lx, -span->lx, 0, span->lx + span->lw,
- def, &bound, acc, mask);
- if (span->rw + span->rx)
- tailSpan (y, -span->rw, -span->rx, def, &bound, acc, mask);
- }
- y--;
- span++;
- }
- if (y < miny)
- return;
- if (spdata->hole)
- {
- if (y <= maxy)
- arcSpan (y, 0, 0, 0, 1, def, &bound, acc, mask & 0xc);
- }
- for (n = spdata->count2; --n >= 0; )
- {
- if (y < miny)
- return;
- if (y <= maxy)
- arcSpan (y, span->lx, span->lw, span->rx, span->rw,
- def, &bound, acc, mask);
- y--;
- span++;
- }
- if (spdata->bot && miny <= y && y <= maxy)
- {
- n = mask;
- if (y == miny)
- n &= 0xc;
- if (span->rw <= 0) {
- arcSpan0 (span->lx, -span->lx, 0, span->lx + span->lw,
- def, &bound, acc, n);
- if (span->rw + span->rx)
- tailSpan (y, -span->rw, -span->rx, def, &bound, acc, n);
- }
- else
- arcSpan0 (span->lx, span->lw, span->rx, span->rw,
- def, &bound, acc, n);
- y--;
- }
- while (y >= miny) {
- yy = y + acc->fromIntY;
- if (def->w == def->h) {
- xalt = def->w - def->l;
- x = -sqrt(xalt * xalt - yy * yy);
- } else {
- x = tailX(yy, def, &bound, acc);
- if (acc->left.valid && boundedLe (yy, bound.left)) {
- xalt = intersectLine (yy, acc->left);
- if (xalt < x)
- x = xalt;
- }
- if (acc->right.valid && boundedLe (yy, bound.right)) {
- xalt = intersectLine (yy, acc->right);
- if (xalt < x)
- x = xalt;
- }
- }
- arcSpan (y,
- ICEIL(acc->fromIntX - x), 0,
- ICEIL(acc->fromIntX + x), 0,
- def, &bound, acc, mask);
- y--;
- }
-}
diff --git a/mi/mibank.c b/mi/mibank.c
deleted file mode 100644
index cc2796edb..000000000
--- a/mi/mibank.c
+++ /dev/null
@@ -1,2573 +0,0 @@
-/*
- * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Copyright 1990,91,92,93 by Thomas Roell, Germany.
- * Copyright 1991,92,93 by SGCS (Snitily Graphics Consulting Services), USA.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation, and that the name of Thomas Roell nor
- * SGCS be used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Thomas Roell nor SGCS makes no representations about the suitability
- * of this software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * THOMAS ROELL AND SGCS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR SGCS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/mi/mibank.c,v 1.15 2003/11/10 18:39:16 tsi Exp $ */
-
-/*
- * This thing originated from an idea of Edwin Goei and his bank switching
- * code for the DEC TX board.
- */
-
-/*
- * Heavily modified for the XFree86 Project to turn this into an mi wrapper.
- * --- Marc Aurele La France (tsi@xfree86.org)
- */
-
-/*
- * "Heavily modified", indeed! By the time this is finalized, there probably
- * won't be much left of Roell's code...
- *
- * Miscellaneous notes:
- * - Pixels with imbedded bank boundaries are required to be off-screen. There
- * >might< be a way to fool the underlying framebuffer into dealing with
- * partial pixels.
- * - Plans to generalise this to do (hardware) colour plane switching have been
- * dropped due to colour flashing concerns.
- *
- * TODO:
- * - Allow miModifyBanking() to change BankSize and nBankDepth.
- * - Re-instate shared and double banking for framebuffers whose pixmap formats
- * don't describe how the server "sees" the screen.
- * - Remove remaining assumptions that a pixmap's devPrivate field points
- * directly to its pixel data.
- */
-
-/* #define NO_ALLOCA 1 */
-
-#include "servermd.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "mibank.h"
-
-#define BANK_SINGLE 0
-#define BANK_SHARED 1
-#define BANK_DOUBLE 2
-#define BANK_NOBANK 3
-
-typedef struct _miBankScreen
-{
- miBankInfoRec BankInfo;
- unsigned int nBankBPP;
- unsigned int type;
-
- unsigned long nBitsPerBank;
- unsigned long nBitsPerScanline;
- unsigned long nPixelsPerScanlinePadUnit;
-
- PixmapPtr pScreenPixmap;
- PixmapPtr pBankPixmap;
- GCPtr pBankGC;
-
- int nBanks, maxRects;
- RegionPtr *pBanks;
-
- pointer pbits;
-
- /*
- * Screen Wrappers
- */
- CreateScreenResourcesProcPtr CreateScreenResources;
- ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- CreateGCProcPtr CreateGC;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- BSFuncRec BackingStoreFuncs;
-} miBankScreenRec, *miBankScreenPtr;
-
-typedef struct _miBankGC
-{
- GCOps *wrappedOps, *unwrappedOps;
- GCFuncs *wrappedFuncs, *unwrappedFuncs;
-
- Bool fastCopy, fastPlane;
-
- RegionPtr pBankedClips[1];
-} miBankGCRec, *miBankGCPtr;
-
-typedef struct _miBankQueue
-{
- Bool fastBlit;
- unsigned short srcBankNo;
- unsigned short dstBankNo;
- short x;
- short y;
- short w;
- short h;
-} miBankQueue;
-
-/*
- * CAVEAT: This banking scheme requires that the DDX store Pixmap data in the
- * server's address space.
- */
-
-#define ModifyPixmap(_pPix, _width, _devKind, _pbits) \
- (*pScreen->ModifyPixmapHeader)((_pPix), \
- (_width), -1, -1, -1, (_devKind), (_pbits))
-
-#define SET_SINGLE_BANK(_pPix, _width, _devKind, _no) \
- ModifyPixmap(_pPix, _width, _devKind, \
- (char *)pScreenPriv->BankInfo.pBankA + \
- (*pScreenPriv->BankInfo.SetSourceAndDestinationBanks)(pScreen, (_no)) - \
- (pScreenPriv->BankInfo.BankSize * (_no)))
-
-#define SET_SOURCE_BANK(_pPix, _width, _devKind, _no) \
- ModifyPixmap(_pPix, _width, _devKind, \
- (char *)pScreenPriv->BankInfo.pBankA + \
- (*pScreenPriv->BankInfo.SetSourceBank)(pScreen, (_no)) - \
- (pScreenPriv->BankInfo.BankSize * (_no)))
-
-#define SET_DESTINATION_BANK(_pPix, _width, _devKind, _no) \
- ModifyPixmap(_pPix, _width, _devKind, \
- (char *)pScreenPriv->BankInfo.pBankB + \
- (*pScreenPriv->BankInfo.SetDestinationBank)(pScreen, (_no)) - \
- (pScreenPriv->BankInfo.BankSize * (_no)))
-
-#define ALLOCATE_LOCAL_ARRAY(atype, ntype) \
- (atype *)ALLOCATE_LOCAL((ntype) * sizeof(atype))
-
-static int miBankScreenIndex;
-static int miBankGCIndex;
-static unsigned long miBankGeneration = 0;
-
-#define BANK_SCRPRIVLVAL pScreen->devPrivates[miBankScreenIndex].ptr
-
-#define BANK_SCRPRIVATE ((miBankScreenPtr)(BANK_SCRPRIVLVAL))
-
-#define BANK_GCPRIVLVAL(pGC) (pGC)->devPrivates[miBankGCIndex].ptr
-
-#define BANK_GCPRIVATE(pGC) ((miBankGCPtr)(BANK_GCPRIVLVAL(pGC)))
-
-#define PIXMAP_STATUS(_pPix) \
- pointer pbits = (_pPix)->devPrivate.ptr
-
-#define PIXMAP_SAVE(_pPix) \
- PIXMAP_STATUS(_pPix); \
- if (pbits == (pointer)pScreenPriv) \
- (_pPix)->devPrivate.ptr = pScreenPriv->pbits
-
-#define PIXMAP_RESTORE(_pPix) \
- (_pPix)->devPrivate.ptr = pbits
-
-#define BANK_SAVE \
- int width = pScreenPriv->pBankPixmap->drawable.width; \
- int devKind = pScreenPriv->pBankPixmap->devKind; \
- PIXMAP_SAVE(pScreenPriv->pBankPixmap)
-
-#define BANK_RESTORE \
- pScreenPriv->pBankPixmap->drawable.width = width; \
- pScreenPriv->pBankPixmap->devKind = devKind; \
- PIXMAP_RESTORE(pScreenPriv->pBankPixmap)
-
-#define SCREEN_STATUS \
- PIXMAP_STATUS(pScreenPriv->pScreenPixmap)
-
-#define SCREEN_SAVE \
- PIXMAP_SAVE(pScreenPriv->pScreenPixmap)
-
-#define SCREEN_RESTORE \
- PIXMAP_RESTORE(pScreenPriv->pScreenPixmap)
-
-#define SCREEN_INIT \
- miBankScreenPtr pScreenPriv = BANK_SCRPRIVATE
-
-#define SCREEN_UNWRAP(field) \
- pScreen->field = pScreenPriv->field
-
-#define SCREEN_WRAP(field, wrapper) \
- pScreenPriv->field = pScreen->field; \
- pScreen->field = wrapper
-
-#define GC_INIT(pGC) \
- miBankGCPtr pGCPriv = BANK_GCPRIVATE(pGC)
-
-#define GC_UNWRAP(pGC) \
- pGCPriv->unwrappedOps = (pGC)->ops; \
- pGCPriv->unwrappedFuncs = (pGC)->funcs; \
- (pGC)->ops = pGCPriv->wrappedOps; \
- (pGC)->funcs = pGCPriv->wrappedFuncs
-
-#define GC_WRAP(pGC) \
- pGCPriv->wrappedOps = (pGC)->ops; \
- pGCPriv->wrappedFuncs = (pGC)->funcs; \
- (pGC)->ops = pGCPriv->unwrappedOps; \
- (pGC)->funcs = pGCPriv->unwrappedFuncs
-
-#define IS_BANKED(pDrawable) \
- ((pbits == (pointer)pScreenPriv) && \
- (((DrawablePtr)(pDrawable))->type == DRAWABLE_WINDOW))
-
-#define CLIP_SAVE \
- RegionPtr pOrigCompositeClip = pGC->pCompositeClip
-
-#define CLIP_RESTORE \
- pGC->pCompositeClip = pOrigCompositeClip
-
-#define GCOP_INIT \
- ScreenPtr pScreen = pGC->pScreen; \
- SCREEN_INIT; \
- GC_INIT(pGC)
-
-#define GCOP_UNWRAP \
- GC_UNWRAP(pGC)
-
-#define GCOP_WRAP \
- GC_WRAP(pGC)
-
-#define GCOP_TOP_PART \
- for (i = 0; i < pScreenPriv->nBanks; i++) \
- { \
- if (!(pGC->pCompositeClip = pGCPriv->pBankedClips[i])) \
- continue; \
- GCOP_UNWRAP; \
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i)
-
-#define GCOP_BOTTOM_PART \
- GCOP_WRAP; \
- }
-
-#define GCOP_SIMPLE(statement) \
- if (nArray > 0) \
- { \
- GCOP_INIT; \
- SCREEN_SAVE; \
- if (!IS_BANKED(pDrawable)) \
- { \
- GCOP_UNWRAP; \
- statement; \
- GCOP_WRAP; \
- } \
- else \
- { \
- int i; \
- CLIP_SAVE; \
- GCOP_TOP_PART; \
- statement; \
- GCOP_BOTTOM_PART; \
- CLIP_RESTORE; \
- } \
- SCREEN_RESTORE; \
- }
-
-#define GCOP_0D_ARGS mode,
-#define GCOP_1D_ARGS
-#define GCOP_2D_ARGS shape, mode,
-
-#define GCOP_COMPLEX(aop, atype) \
- if (nArray > 0) \
- { \
- GCOP_INIT; \
- SCREEN_SAVE; \
- if (!IS_BANKED(pDrawable)) \
- { \
- GCOP_UNWRAP; \
- (*pGC->ops->aop)(pDrawable, pGC, GCOP_ARGS nArray, pArray); \
- GCOP_WRAP; \
- } \
- else \
- { \
- atype *aarg = pArray, *acopy; \
- int i; \
- CLIP_SAVE; \
- if ((acopy = ALLOCATE_LOCAL_ARRAY(atype, nArray))) \
- aarg = acopy; \
- GCOP_TOP_PART; \
- if (acopy) \
- memcpy(acopy, pArray, nArray * sizeof(atype)); \
- (*pGC->ops->aop)(pDrawable, pGC, GCOP_ARGS nArray, aarg); \
- GCOP_BOTTOM_PART; \
- DEALLOCATE_LOCAL(acopy); \
- CLIP_RESTORE; \
- } \
- SCREEN_RESTORE; \
- }
-
-/*********************
- * Utility functions *
- *********************/
-
-static int
-miBankOf(
- miBankScreenPtr pScreenPriv,
- int x,
- int y
-)
-{
- int iBank = ((x * (int)pScreenPriv->nBankBPP) +
- (y * (long)pScreenPriv->nBitsPerScanline)) /
- (long)pScreenPriv->nBitsPerBank;
-
- if (iBank < 0)
- iBank = 0;
- else if (iBank >= pScreenPriv->nBanks)
- iBank = pScreenPriv->nBanks - 1;
-
- return iBank;
-}
-
-#define FirstBankOf(_x, _y) miBankOf(pScreenPriv, (_x), (_y))
-#define LastBankOf(_x, _y) miBankOf(pScreenPriv, (_x) - 1, (_y))
-
-/* Determine banking type from the BankInfoRec */
-static unsigned int
-miBankDeriveType(
- ScreenPtr pScreen,
- miBankInfoPtr pBankInfo
-)
-{
- unsigned int type;
-
- if (pBankInfo->pBankA == pBankInfo->pBankB)
- {
- if (pBankInfo->SetSourceBank == pBankInfo->SetDestinationBank)
- {
- if (pBankInfo->SetSourceAndDestinationBanks !=
- pBankInfo->SetSourceBank)
- return BANK_NOBANK;
-
- type = BANK_SINGLE;
- }
- else
- {
- if (pBankInfo->SetSourceAndDestinationBanks ==
- pBankInfo->SetDestinationBank)
- return BANK_NOBANK;
- if (pBankInfo->SetSourceAndDestinationBanks ==
- pBankInfo->SetSourceBank)
- return BANK_NOBANK;
-
- type = BANK_SHARED;
- }
- }
- else
- {
- if ((unsigned long)abs((char *)pBankInfo->pBankA -
- (char *)pBankInfo->pBankB) < pBankInfo->BankSize)
- return BANK_NOBANK;
-
- if (pBankInfo->SetSourceBank == pBankInfo->SetDestinationBank)
- {
- if (pBankInfo->SetSourceAndDestinationBanks !=
- pBankInfo->SetSourceBank)
- return BANK_NOBANK;
- }
- else
- {
- if (pBankInfo->SetSourceAndDestinationBanks ==
- pBankInfo->SetDestinationBank)
- return BANK_NOBANK;
- }
-
- type = BANK_DOUBLE;
- }
-
- /*
- * Internal limitation: Currently, only single banking is supported when
- * the pixmap format and the screen's pixel format are different. The
- * following test is only partially successful at detecting this condition.
- */
- if (pBankInfo->nBankDepth != pScreen->rootDepth)
- type = BANK_SINGLE;
-
- return type;
-}
-
-/* Least common multiple */
-static unsigned int
-miLCM(
- unsigned int x,
- unsigned int y
-)
-{
- unsigned int m = x, n = y, o;
-
- while ((o = m % n))
- {
- m = n;
- n = o;
- }
-
- return (x / n) * y;
-}
-
-/******************
- * GCOps wrappers *
- ******************/
-
-static void
-miBankFillSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-)
-{
- GCOP_SIMPLE((*pGC->ops->FillSpans)(pDrawable, pGC,
- nArray, pptInit, pwidthInit, fSorted));
-}
-
-static void
-miBankSetSpans(
- DrawablePtr pDrawable,
- GCPtr pGC,
- char *psrc,
- DDXPointPtr ppt,
- int *pwidth,
- int nArray,
- int fSorted
-)
-{
- GCOP_SIMPLE((*pGC->ops->SetSpans)(pDrawable, pGC, psrc,
- ppt, pwidth, nArray, fSorted));
-}
-
-static void
-miBankPutImage(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int depth,
- int x,
- int y,
- int w,
- int h,
- int leftPad,
- int format,
- char *pImage
-)
-{
- if ((w > 0) && (h > 0))
- {
- GCOP_INIT;
- SCREEN_SAVE;
-
- if (!IS_BANKED(pDrawable))
- {
- GCOP_UNWRAP;
-
- (*pGC->ops->PutImage)(pDrawable, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
-
- GCOP_WRAP;
- }
- else
- {
- int i, j;
-
- CLIP_SAVE;
-
- i = FirstBankOf(x + pDrawable->x, y + pDrawable->y);
- j = LastBankOf(x + pDrawable->x + w, y + pDrawable->y + h);
- for (; i <= j; i++)
- {
- if (!(pGC->pCompositeClip = pGCPriv->pBankedClips[i]))
- continue;
-
- GCOP_UNWRAP;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
-
- (*pGC->ops->PutImage)(pDrawable, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
-
- GCOP_WRAP;
- }
-
- CLIP_RESTORE;
- }
-
- SCREEN_RESTORE;
- }
-}
-
-/*
- * Here the CopyArea/CopyPlane wrappers. First off, we have to clip against
- * the source in order to make the minimal number of copies in case of slow
- * systems. Also the exposure handling is quite tricky. Special attention
- * is to be given to the way the copies are sequenced. The list of boxes after
- * the source clip is used to build a workqueue, that contains the atomic
- * copies (i.e. only from one bank to one bank). Doing so produces a minimal
- * list of things to do.
- */
-static RegionPtr
-miBankCopy(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int w,
- int h,
- int dstx,
- int dsty,
- unsigned long plane,
- Bool SinglePlane
-)
-{
- int cx1, cy1, cx2, cy2;
- int ns, nd, nse, nde, dx, dy, xorg = 0, yorg = 0;
- int maxWidth = 0, maxHeight = 0, paddedWidth = 0;
- int nBox, nBoxClipSrc, nBoxClipDst, nQueue;
- BoxPtr pBox, pBoxClipSrc, pBoxClipDst;
- BoxRec fastBox, ccBox;
- RegionPtr ret = NULL, prgnSrcClip = NULL;
- RegionRec rgnDst;
- char *pImage = NULL;
- miBankQueue *pQueue, *pQueueNew, *Queue;
- miBankQueue *pQueueTmp, *pQueueNext, *pQueueBase;
- Bool fastBlit, freeSrcClip, fastClip;
- Bool fExpose = FALSE, fastExpose = FALSE;
-
- GCOP_INIT;
- SCREEN_SAVE;
-
- if (!IS_BANKED(pSrc) && !IS_BANKED(pDst))
- {
- GCOP_UNWRAP;
-
- if (SinglePlane)
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC,
- srcx, srcy, w, h, dstx, dsty, plane);
- else
- ret = (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- srcx, srcy, w, h, dstx, dsty);
-
- GCOP_WRAP;
- }
- else if (!IS_BANKED(pDst))
- {
- fExpose = pGC->fExpose;
- pGC->fExpose = FALSE;
-
- xorg = pSrc->x;
- yorg = pSrc->y;
- dx = dstx - srcx;
- dy = dsty - srcy;
- srcx += xorg;
- srcy += yorg;
-
- ns = FirstBankOf(srcx, srcy);
- nse = LastBankOf(srcx + w, srcy + h);
- for (; ns <= nse; ns++)
- {
- if (!pScreenPriv->pBanks[ns])
- continue;
-
- nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]);
- pBox = REGION_RECTS(pScreenPriv->pBanks[ns]);
-
- for (; nBox--; pBox++)
- {
- cx1 = max(pBox->x1, srcx);
- cy1 = max(pBox->y1, srcy);
- cx2 = min(pBox->x2, srcx + w);
- cy2 = min(pBox->y2, srcy + h);
-
- if ((cx1 >= cx2) || (cy1 >= cy2))
- continue;
-
- GCOP_UNWRAP;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, ns);
-
- if (SinglePlane)
- (*pGC->ops->CopyPlane)(pSrc, pDst, pGC,
- cx1 - xorg, cy1 - yorg,
- cx2 - cx1, cy2 - cy1,
- cx1 + dx - xorg, cy1 + dy - yorg, plane);
- else
- (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- cx1 - xorg, cy1 - yorg,
- cx2 - cx1, cy2 - cy1,
- cx1 + dx - xorg, cy1 + dy - yorg);
-
- GCOP_WRAP;
- }
- }
-
- pGC->fExpose = fExpose;
- srcx -= xorg;
- srcy -= yorg;
- }
- else if (!IS_BANKED(pSrc))
- {
- CLIP_SAVE;
-
- if (pGC->miTranslate)
- {
- xorg = pDst->x;
- yorg = pDst->y;
- }
- dx = srcx - dstx;
- dy = srcy - dsty;
- dstx += xorg;
- dsty += yorg;
-
- nd = FirstBankOf(dstx, dsty);
- nde = LastBankOf(dstx + w, dsty + h);
- for (; nd <= nde; nd++)
- {
- if (!(pGC->pCompositeClip = pGCPriv->pBankedClips[nd]))
- continue;
-
- /*
- * It's faster to let the lower-level CopyArea do the clipping
- * within each bank.
- */
- nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[nd]);
- pBox = REGION_RECTS(pScreenPriv->pBanks[nd]);
-
- for (; nBox--; pBox++)
- {
- cx1 = max(pBox->x1, dstx);
- cy1 = max(pBox->y1, dsty);
- cx2 = min(pBox->x2, dstx + w);
- cy2 = min(pBox->y2, dsty + h);
-
- if ((cx1 >= cx2) || (cy1 >= cy2))
- continue;
-
- GCOP_UNWRAP;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, nd);
-
- if (SinglePlane)
- (*pGC->ops->CopyPlane)(pSrc, pDst, pGC,
- cx1 + dx - xorg, cy1 + dy - yorg,
- cx2 - cx1, cy2 - cy1,
- cx1 - xorg, cy1 - yorg, plane);
- else
- (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- cx1 + dx - xorg, cy1 + dy - yorg,
- cx2 - cx1, cy2 - cy1,
- cx1 - xorg, cy1 - yorg);
-
- GCOP_WRAP;
- }
- }
-
- CLIP_RESTORE;
- }
- else /* IS_BANKED(pSrc) && IS_BANKED(pDst) */
- {
- CLIP_SAVE;
-
- fExpose = pGC->fExpose;
-
- fastBox.x1 = srcx + pSrc->x;
- fastBox.y1 = srcy + pSrc->y;
- fastBox.x2 = fastBox.x1 + w;
- fastBox.y2 = fastBox.y1 + h;
-
- dx = dstx - fastBox.x1;
- dy = dsty - fastBox.y1;
- if (pGC->miTranslate)
- {
- xorg = pDst->x;
- yorg = pDst->y;
- }
-
- /*
- * Clip against the source. Otherwise we will blit too much for SINGLE
- * and SHARED banked systems.
- */
- freeSrcClip = FALSE;
- fastClip = FALSE;
- fastExpose = FALSE;
-
- if (pGC->subWindowMode != IncludeInferiors)
- prgnSrcClip = &((WindowPtr)pSrc)->clipList;
- else if (!((WindowPtr)pSrc)->parent)
- fastClip = TRUE;
- else if ((pSrc == pDst) && (pGC->clientClipType == CT_NONE))
- prgnSrcClip = pGC->pCompositeClip;
- else
- {
- prgnSrcClip = NotClippedByChildren((WindowPtr)pSrc);
- freeSrcClip = TRUE;
- }
-
- if (fastClip)
- {
- fastExpose = TRUE;
-
- /*
- * Clip the source. If regions extend beyond the source size, make
- * sure exposure events get sent.
- */
- if (fastBox.x1 < pSrc->x)
- {
- fastBox.x1 = pSrc->x;
- fastExpose = FALSE;
- }
- if (fastBox.y1 < pSrc->y)
- {
- fastBox.y1 = pSrc->y;
- fastExpose = FALSE;
- }
- if (fastBox.x2 > pSrc->x + (int) pSrc->width)
- {
- fastBox.x2 = pSrc->x + (int) pSrc->width;
- fastExpose = FALSE;
- }
- if (fastBox.y2 > pSrc->y + (int) pSrc->height)
- {
- fastBox.y2 = pSrc->y + (int) pSrc->height;
- fastExpose = FALSE;
- }
-
- nBox = 1;
- pBox = &fastBox;
- }
- else
- {
- REGION_INIT(pScreen, &rgnDst, &fastBox, 1);
- REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrcClip);
- pBox = REGION_RECTS(&rgnDst);
- nBox = REGION_NUM_RECTS(&rgnDst);
- }
-
- /*
- * fastBlit can only be TRUE if we don't need to worry about attempts
- * to read partial pixels through the destination bank.
- */
- if (SinglePlane)
- fastBlit = pGCPriv->fastPlane;
- else
- fastBlit = pGCPriv->fastCopy;
-
- nQueue = nBox * pScreenPriv->maxRects * 2;
- pQueue = Queue = ALLOCATE_LOCAL_ARRAY(miBankQueue, nQueue);
-
- if (Queue)
- {
- for (; nBox--; pBox++)
- {
- ns = FirstBankOf(pBox->x1, pBox->y1);
- nse = LastBankOf(pBox->x2, pBox->y2);
- for (; ns <= nse; ns++)
- {
- if (!pScreenPriv->pBanks[ns])
- continue;
-
- nBoxClipSrc = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]);
- pBoxClipSrc = REGION_RECTS(pScreenPriv->pBanks[ns]);
-
- for (; nBoxClipSrc--; pBoxClipSrc++)
- {
- cx1 = max(pBox->x1, pBoxClipSrc->x1);
- cy1 = max(pBox->y1, pBoxClipSrc->y1);
- cx2 = min(pBox->x2, pBoxClipSrc->x2);
- cy2 = min(pBox->y2, pBoxClipSrc->y2);
-
- /* Check to see if the region is empty */
- if ((cx1 >= cx2) || (cy1 >= cy2))
- continue;
-
- /* Translate c[xy]* to destination coordinates */
- cx1 += dx + xorg;
- cy1 += dy + yorg;
- cx2 += dx + xorg;
- cy2 += dy + yorg;
-
- nd = FirstBankOf(cx1, cy1);
- nde = LastBankOf(cx2, cy2);
- for (; nd <= nde; nd++)
- {
- if (!pGCPriv->pBankedClips[nd])
- continue;
-
- /*
- * Clients can send quite large clip descriptions,
- * so use the bank clips here instead.
- */
- nBoxClipDst =
- REGION_NUM_RECTS(pScreenPriv->pBanks[nd]);
- pBoxClipDst =
- REGION_RECTS(pScreenPriv->pBanks[nd]);
-
- for (; nBoxClipDst--; pBoxClipDst++)
- {
- ccBox.x1 = max(cx1, pBoxClipDst->x1);
- ccBox.y1 = max(cy1, pBoxClipDst->y1);
- ccBox.x2 = min(cx2, pBoxClipDst->x2);
- ccBox.y2 = min(cy2, pBoxClipDst->y2);
-
- /* Check to see if the region is empty */
- if ((ccBox.x1 >= ccBox.x2) ||
- (ccBox.y1 >= ccBox.y2))
- continue;
-
- pQueue->srcBankNo = ns;
- pQueue->dstBankNo = nd;
- pQueue->x = ccBox.x1 - xorg;
- pQueue->y = ccBox.y1 - yorg;
- pQueue->w = ccBox.x2 - ccBox.x1;
- pQueue->h = ccBox.y2 - ccBox.y1;
-
- if (maxWidth < pQueue->w)
- maxWidth = pQueue->w;
- if (maxHeight < pQueue->h)
- maxHeight = pQueue->h;
-
- /*
- * When shared banking is used and the source
- * and destination banks differ, prevent
- * attempts to fetch partial scanline pad units
- * through the destination bank.
- */
- pQueue->fastBlit = fastBlit;
- if (fastBlit &&
- (pScreenPriv->type == BANK_SHARED) &&
- (ns != nd) &&
- ((ccBox.x1 %
- pScreenPriv->nPixelsPerScanlinePadUnit) ||
- (ccBox.x2 %
- pScreenPriv->nPixelsPerScanlinePadUnit) ||
- (RECT_IN_REGION(pScreen,
- pGCPriv->pBankedClips[nd], &ccBox) !=
- rgnIN)))
- pQueue->fastBlit = FALSE;
- pQueue++;
- }
- }
- }
- }
- }
- }
-
- if (!fastClip)
- {
- REGION_UNINIT(pScreen, &rgnDst);
- if (freeSrcClip)
- REGION_DESTROY(pScreen, prgnSrcClip);
- }
-
- pQueueNew = pQueue;
- nQueue = pQueue - Queue;
-
- if (nQueue > 0)
- {
- BANK_SAVE;
-
- pQueue = Queue;
-
- if ((nQueue > 1) &&
- ((pSrc == pDst) || (pGC->subWindowMode == IncludeInferiors)))
- {
- if ((srcy + pSrc->y) < (dsty + yorg))
- {
- /* Sort from bottom to top */
- pQueueBase = pQueueNext = pQueue + nQueue - 1;
-
- while (pQueueBase >= pQueue)
- {
- while ((pQueueNext >= pQueue) &&
- (pQueueBase->y == pQueueNext->y))
- pQueueNext--;
-
- pQueueTmp = pQueueNext + 1;
- while (pQueueTmp <= pQueueBase)
- *pQueueNew++ = *pQueueTmp++;
-
- pQueueBase = pQueueNext;
- }
-
- pQueueNew -= nQueue;
- pQueue = pQueueNew;
- pQueueNew = Queue;
- }
-
- if ((srcx + pSrc->x) < (dstx + xorg))
- {
- /* Sort from right to left */
- pQueueBase = pQueueNext = pQueue;
-
- while (pQueueBase < pQueue + nQueue)
- {
- while ((pQueueNext < pQueue + nQueue) &&
- (pQueueNext->y == pQueueBase->y))
- pQueueNext++;
-
- pQueueTmp = pQueueNext;
- while (pQueueTmp != pQueueBase)
- *pQueueNew++ = *--pQueueTmp;
-
- pQueueBase = pQueueNext;
- }
-
- pQueueNew -= nQueue;
- pQueue = pQueueNew;
- }
- }
-
- paddedWidth = PixmapBytePad(maxWidth,
- pScreenPriv->pScreenPixmap->drawable.depth);
- pImage = (char *)ALLOCATE_LOCAL(paddedWidth * maxHeight);
-
- pGC->fExpose = FALSE;
-
- while (nQueue--)
- {
- pGC->pCompositeClip = pGCPriv->pBankedClips[pQueue->dstBankNo];
-
- GCOP_UNWRAP;
-
- if (pQueue->srcBankNo == pQueue->dstBankNo)
- {
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap,
- -1, -1, pQueue->srcBankNo);
-
- if (SinglePlane)
- (*pGC->ops->CopyPlane)(pSrc, pDst, pGC,
- pQueue->x - dx - pSrc->x, pQueue->y - dy - pSrc->y,
- pQueue->w, pQueue->h, pQueue->x, pQueue->y, plane);
- else
- (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- pQueue->x - dx - pSrc->x, pQueue->y - dy - pSrc->y,
- pQueue->w, pQueue->h, pQueue->x, pQueue->y);
- }
- else if (pQueue->fastBlit)
- {
- SET_SOURCE_BANK (pScreenPriv->pBankPixmap,
- pScreenPriv->pScreenPixmap->drawable.width,
- pScreenPriv->pScreenPixmap->devKind,
- pQueue->srcBankNo);
- SET_DESTINATION_BANK(pScreenPriv->pScreenPixmap,
- -1, -1, pQueue->dstBankNo);
-
- if (SinglePlane)
- (*pGC->ops->CopyPlane)(
- (DrawablePtr)pScreenPriv->pBankPixmap, pDst, pGC,
- pQueue->x - dx, pQueue->y - dy,
- pQueue->w, pQueue->h, pQueue->x, pQueue->y, plane);
- else
- (*pGC->ops->CopyArea)(
- (DrawablePtr)pScreenPriv->pBankPixmap, pDst, pGC,
- pQueue->x - dx, pQueue->y - dy,
- pQueue->w, pQueue->h, pQueue->x, pQueue->y);
- }
- else if (pImage)
- {
- ModifyPixmap(pScreenPriv->pBankPixmap,
- maxWidth, paddedWidth, pImage);
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap,
- -1, -1, pQueue->srcBankNo);
-
- (*pScreenPriv->pBankGC->ops->CopyArea)(
- pSrc, (DrawablePtr)pScreenPriv->pBankPixmap,
- pScreenPriv->pBankGC,
- pQueue->x - dx - pSrc->x, pQueue->y - dy - pSrc->y,
- pQueue->w, pQueue->h, 0, 0);
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap,
- -1, -1, pQueue->dstBankNo);
-
- if (SinglePlane)
- (*pGC->ops->CopyPlane)(
- (DrawablePtr)pScreenPriv->pBankPixmap,
- pDst, pGC, 0, 0, pQueue->w, pQueue->h,
- pQueue->x, pQueue->y, plane);
- else
- (*pGC->ops->CopyArea)(
- (DrawablePtr)pScreenPriv->pBankPixmap,
- pDst, pGC, 0, 0, pQueue->w, pQueue->h,
- pQueue->x, pQueue->y);
- }
-
- GCOP_WRAP;
-
- pQueue++;
- }
-
- DEALLOCATE_LOCAL(pImage);
-
- BANK_RESTORE;
- }
-
- CLIP_RESTORE;
-
- pGC->fExpose = fExpose;
-
- DEALLOCATE_LOCAL(Queue);
- }
-
- SCREEN_RESTORE;
-
- if (!fExpose || fastExpose)
- return ret;
-
- return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, 0);
-}
-
-static RegionPtr
-miBankCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int w,
- int h,
- int dstx,
- int dsty
-)
-{
- return miBankCopy(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, 0, FALSE);
-}
-
-static RegionPtr
-miBankCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx,
- int srcy,
- int w,
- int h,
- int dstx,
- int dsty,
- unsigned long plane
-)
-{
- return
- miBankCopy(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane, TRUE);
-}
-
-static void
-miBankPolyPoint(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nArray,
- xPoint *pArray
-)
-{
-# define GCOP_ARGS GCOP_0D_ARGS
- GCOP_COMPLEX(PolyPoint, xPoint);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolylines(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int mode,
- int nArray,
- DDXPointPtr pArray
-)
-{
-# define GCOP_ARGS GCOP_0D_ARGS
- GCOP_COMPLEX(Polylines, DDXPointRec);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolySegment(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- xSegment *pArray
-)
-{
-# define GCOP_ARGS GCOP_1D_ARGS
- GCOP_COMPLEX(PolySegment, xSegment);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolyRectangle(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- xRectangle *pArray
-)
-{
-# define GCOP_ARGS GCOP_1D_ARGS
- GCOP_COMPLEX(PolyRectangle, xRectangle);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolyArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- xArc *pArray
-)
-{
-# define GCOP_ARGS GCOP_1D_ARGS
- GCOP_COMPLEX(PolyArc, xArc);
-# undef GCOP_ARGS
-}
-
-static void
-miBankFillPolygon(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int shape,
- int mode,
- int nArray,
- DDXPointRec *pArray
-)
-{
-# define GCOP_ARGS GCOP_2D_ARGS
- GCOP_COMPLEX(FillPolygon, DDXPointRec);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolyFillRect(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- xRectangle *pArray
-)
-{
-# define GCOP_ARGS GCOP_1D_ARGS
- GCOP_COMPLEX(PolyFillRect, xRectangle);
-# undef GCOP_ARGS
-}
-
-static void
-miBankPolyFillArc(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int nArray,
- xArc *pArray
-)
-{
-# define GCOP_ARGS GCOP_1D_ARGS
- GCOP_COMPLEX(PolyFillArc, xArc);
-# undef GCOP_ARGS
-}
-
-static int
-miBankPolyText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int nArray,
- char *pchar
-)
-{
- int retval = x;
-
- GCOP_SIMPLE(retval =
- (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, nArray, pchar));
-
- return retval;
-}
-
-static int
-miBankPolyText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int nArray,
- unsigned short *pchar
-)
-{
- int retval = x;
-
- GCOP_SIMPLE(retval =
- (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, nArray, pchar));
-
- return retval;
-}
-
-static void
-miBankImageText8(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int nArray,
- char *pchar
-)
-{
- GCOP_SIMPLE((*pGC->ops->ImageText8)(pDrawable, pGC, x, y, nArray, pchar));
-}
-
-static void
-miBankImageText16(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int nArray,
- unsigned short *pchar
-)
-{
- GCOP_SIMPLE((*pGC->ops->ImageText16)(pDrawable, pGC, x, y, nArray, pchar));
-}
-
-static void
-miBankImageGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nArray,
- CharInfoPtr *ppci,
- pointer pglyphBase
-)
-{
- GCOP_SIMPLE((*pGC->ops->ImageGlyphBlt)(pDrawable, pGC,
- x, y, nArray, ppci, pglyphBase));
-}
-
-static void
-miBankPolyGlyphBlt(
- DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nArray,
- CharInfoPtr *ppci,
- pointer pglyphBase
-)
-{
- GCOP_SIMPLE((*pGC->ops->PolyGlyphBlt)(pDrawable, pGC,
- x, y, nArray, ppci, pglyphBase));
-}
-
-static void
-miBankPushPixels(
- GCPtr pGC,
- PixmapPtr pBitmap,
- DrawablePtr pDrawable,
- int w,
- int h,
- int x,
- int y
-)
-{
- if ((w > 0) && (h > 0))
- {
- GCOP_INIT;
- SCREEN_SAVE;
-
- if (!IS_BANKED(pDrawable))
- {
- GCOP_UNWRAP;
-
- (*pGC->ops->PushPixels)(pGC, pBitmap, pDrawable, w, h, x, y);
-
- GCOP_WRAP;
- }
- else
- {
- int i, j;
-
- CLIP_SAVE;
-
- i = FirstBankOf(x, y);
- j = LastBankOf(x + w, y + h);
- for (; i <= j; i++)
- {
- if (!(pGC->pCompositeClip = pGCPriv->pBankedClips[i]))
- continue;
-
- GCOP_UNWRAP;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
-
- (*pGC->ops->PushPixels)(pGC, pBitmap, pDrawable, w, h, x, y);
-
- GCOP_WRAP;
- }
-
- CLIP_RESTORE;
- }
-
- SCREEN_RESTORE;
- }
-}
-
-static GCOps miBankGCOps =
-{
- miBankFillSpans,
- miBankSetSpans,
- miBankPutImage,
- miBankCopyArea,
- miBankCopyPlane,
- miBankPolyPoint,
- miBankPolylines,
- miBankPolySegment,
- miBankPolyRectangle,
- miBankPolyArc,
- miBankFillPolygon,
- miBankPolyFillRect,
- miBankPolyFillArc,
- miBankPolyText8,
- miBankPolyText16,
- miBankImageText8,
- miBankImageText16,
- miBankImageGlyphBlt,
- miBankPolyGlyphBlt,
- miBankPushPixels,
-#ifdef NEED_LINEHELPER
- NULL, /* LineHelper */
-#endif
- {NULL} /* devPrivate */
-};
-
-/********************
- * GCFuncs wrappers *
- ********************/
-
-static void
-miBankValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDrawable
-)
-{
- GC_INIT(pGC);
- GC_UNWRAP(pGC);
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDrawable);
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
- {
- ScreenPtr pScreen = pGC->pScreen;
- RegionPtr prgnClip;
- unsigned long planemask;
- int i;
-
- SCREEN_INIT;
- SCREEN_SAVE;
-
- if (IS_BANKED(pDrawable))
- {
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pScreenPriv->pBanks[i])
- continue;
-
- if (!(prgnClip = pGCPriv->pBankedClips[i]))
- prgnClip = REGION_CREATE(pScreen, NULL, 1);
-
- REGION_INTERSECT(pScreen, prgnClip,
- pScreenPriv->pBanks[i], pGC->pCompositeClip);
-
- if ((REGION_NUM_RECTS(prgnClip) <= 1) &&
- ((prgnClip->extents.x1 == prgnClip->extents.x2) ||
- (prgnClip->extents.y1 == prgnClip->extents.y2)))
- {
- REGION_DESTROY(pScreen, prgnClip);
- pGCPriv->pBankedClips[i] = NULL;
- }
- else
- pGCPriv->pBankedClips[i] = prgnClip;
- }
-
- /*
- * fastCopy and fastPlane can only be TRUE if we don't need to
- * worry about attempts to read partial pixels through the
- * destination bank.
- */
- switch (pScreenPriv->type)
- {
- case BANK_SHARED:
- pGCPriv->fastCopy = pGCPriv->fastPlane = FALSE;
-
- if ((pGC->alu != GXclear) && (pGC->alu != GXcopy) &&
- (pGC->alu != GXcopyInverted) && (pGC->alu != GXset))
- break;
-
- if (pScreen->rootDepth == 1)
- pGCPriv->fastPlane = TRUE;
-
- /* This is probably paranoia */
- if ((pDrawable->depth != pScreen->rootDepth) ||
- (pDrawable->depth != pGC->depth))
- break;
-
- planemask = (1 << pGC->depth) - 1;
- if ((pGC->planemask & planemask) == planemask)
- pGCPriv->fastCopy = TRUE;
-
- break;
-
- case BANK_DOUBLE:
- pGCPriv->fastCopy = pGCPriv->fastPlane = TRUE;
- break;
-
- default:
- pGCPriv->fastCopy = pGCPriv->fastPlane = FALSE;
- break;
- }
- }
- else
- {
- /*
- * Here we are on a pixmap and don't need all that special clipping
- * stuff, hence free it.
- */
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pGCPriv->pBankedClips[i])
- continue;
-
- REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]);
- pGCPriv->pBankedClips[i] = NULL;
- }
- }
-
- SCREEN_RESTORE;
- }
-
- GC_WRAP(pGC);
-}
-
-static void
-miBankChangeGC(
- GCPtr pGC,
- unsigned long mask
-)
-{
- GC_INIT(pGC);
- GC_UNWRAP(pGC);
-
- (*pGC->funcs->ChangeGC)(pGC, mask);
-
- GC_WRAP(pGC);
-}
-
-static void
-miBankCopyGC(
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-)
-{
- GC_INIT(pGCDst);
- GC_UNWRAP(pGCDst);
-
- (*pGCDst->funcs->CopyGC)(pGCSrc, mask, pGCDst);
-
- GC_WRAP(pGCDst);
-}
-
-static void
-miBankDestroyGC(
- GCPtr pGC
-)
-{
- ScreenPtr pScreen = pGC->pScreen;
- int i;
-
- SCREEN_INIT;
- GC_INIT(pGC);
- GC_UNWRAP(pGC);
-
- (*pGC->funcs->DestroyGC)(pGC);
-
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pGCPriv->pBankedClips[i])
- continue;
-
- REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]);
- pGCPriv->pBankedClips[i] = NULL;
- }
-
- GC_WRAP(pGC);
-}
-
-static void
-miBankChangeClip(
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-)
-{
- GC_INIT(pGC);
- GC_UNWRAP(pGC);
-
- (*pGC->funcs->ChangeClip)(pGC, type, pvalue, nrects);
-
- GC_WRAP(pGC);
-}
-
-static void
-miBankDestroyClip(
- GCPtr pGC
-)
-{
- GC_INIT(pGC);
- GC_UNWRAP(pGC);
-
- (*pGC->funcs->DestroyClip)(pGC);
-
- GC_WRAP(pGC);
-}
-
-static void
-miBankCopyClip(
- GCPtr pGCDst,
- GCPtr pGCSrc
-)
-{
- GC_INIT(pGCDst);
- GC_UNWRAP(pGCDst);
-
- (*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc);
-
- GC_WRAP(pGCDst);
-}
-
-static GCFuncs miBankGCFuncs =
-{
- miBankValidateGC,
- miBankChangeGC,
- miBankCopyGC,
- miBankDestroyGC,
- miBankChangeClip,
- miBankDestroyClip,
- miBankCopyClip
-};
-
-/*******************
- * Screen Wrappers *
- *******************/
-
-static Bool
-miBankCreateScreenResources(
- ScreenPtr pScreen
-)
-{
- Bool retval;
-
- SCREEN_INIT;
- SCREEN_UNWRAP(CreateScreenResources);
-
- if ((retval = (*pScreen->CreateScreenResources)(pScreen)))
- {
- /* Set screen buffer address to something recognizable */
- pScreenPriv->pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen);
- pScreenPriv->pbits = pScreenPriv->pScreenPixmap->devPrivate.ptr;
- pScreenPriv->pScreenPixmap->devPrivate.ptr = (pointer)pScreenPriv;
-
- /* Get shadow pixmap; width & height of 0 means no pixmap data */
- pScreenPriv->pBankPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0,
- pScreenPriv->pScreenPixmap->drawable.depth);
- if (!pScreenPriv->pBankPixmap)
- retval = FALSE;
- }
-
- /* Shadow the screen */
- if (retval)
- retval = (*pScreen->ModifyPixmapHeader)(pScreenPriv->pBankPixmap,
- pScreenPriv->pScreenPixmap->drawable.width,
- pScreenPriv->pScreenPixmap->drawable.height,
- pScreenPriv->pScreenPixmap->drawable.depth,
- pScreenPriv->pScreenPixmap->drawable.bitsPerPixel,
- pScreenPriv->pScreenPixmap->devKind, NULL);
-
- /* Create shadow GC */
- if (retval)
- {
- pScreenPriv->pBankGC = CreateScratchGC(pScreen,
- pScreenPriv->pBankPixmap->drawable.depth);
- if (!pScreenPriv->pBankGC)
- retval = FALSE;
- }
-
- /* Validate shadow GC */
- if (retval)
- {
- pScreenPriv->pBankGC->graphicsExposures = FALSE;
- pScreenPriv->pBankGC->subWindowMode = IncludeInferiors;
- ValidateGC((DrawablePtr)pScreenPriv->pBankPixmap,
- pScreenPriv->pBankGC);
- }
-
- SCREEN_WRAP(CreateScreenResources, miBankCreateScreenResources);
-
- return retval;
-}
-
-static Bool
-miBankModifyPixmapHeader(
- PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData
-)
-{
- Bool retval = FALSE;
-
- if (pPixmap)
- {
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
-
- SCREEN_INIT;
- PIXMAP_SAVE(pPixmap);
- SCREEN_UNWRAP(ModifyPixmapHeader);
-
- retval = (*pScreen->ModifyPixmapHeader)(pPixmap, width, height,
- depth, bitsPerPixel, devKind, pPixData);
-
- SCREEN_WRAP(ModifyPixmapHeader, miBankModifyPixmapHeader);
-
- if (pbits == (pointer)pScreenPriv)
- {
- pScreenPriv->pbits = pPixmap->devPrivate.ptr;
- pPixmap->devPrivate.ptr = pbits;
- }
- }
-
- return retval;
-}
-
-static Bool
-miBankCloseScreen(
- int nIndex,
- ScreenPtr pScreen
-)
-{
- int i;
-
- SCREEN_INIT;
-
- /* Free shadow GC */
- FreeScratchGC(pScreenPriv->pBankGC);
-
- /* Free shadow pixmap */
- (*pScreen->DestroyPixmap)(pScreenPriv->pBankPixmap);
-
- /* Restore screen pixmap devPrivate pointer */
- pScreenPriv->pScreenPixmap->devPrivate.ptr = pScreenPriv->pbits;
-
- /* Delete bank clips */
- for (i = 0; i < pScreenPriv->nBanks; i++)
- if (pScreenPriv->pBanks[i])
- REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]);
-
- Xfree(pScreenPriv->pBanks);
-
- SCREEN_UNWRAP(CreateScreenResources);
- SCREEN_UNWRAP(ModifyPixmapHeader);
- SCREEN_UNWRAP(CloseScreen);
- SCREEN_UNWRAP(GetImage);
- SCREEN_UNWRAP(GetSpans);
- SCREEN_UNWRAP(CreateGC);
- SCREEN_UNWRAP(PaintWindowBackground);
- SCREEN_UNWRAP(PaintWindowBorder);
- SCREEN_UNWRAP(CopyWindow);
- SCREEN_UNWRAP(BackingStoreFuncs);
-
- Xfree(pScreenPriv);
- return (*pScreen->CloseScreen)(nIndex, pScreen);
-}
-
-static void
-miBankGetImage(
- DrawablePtr pDrawable,
- int sx,
- int sy,
- int w,
- int h,
- unsigned int format,
- unsigned long planemask,
- char *pImage
-)
-{
- if ((w > 0) && (h > 0))
- {
- ScreenPtr pScreen = pDrawable->pScreen;
-
- SCREEN_INIT;
- SCREEN_STATUS;
- SCREEN_UNWRAP(GetImage);
-
- if (!IS_BANKED(pDrawable))
- {
- (*pScreen->GetImage)(pDrawable, sx, sy, w, h,
- format, planemask, pImage);
- }
- else
- {
- int paddedWidth;
- char *pBankImage;
-
- paddedWidth = PixmapBytePad(w,
- pScreenPriv->pScreenPixmap->drawable.depth);
- pBankImage = (char *)ALLOCATE_LOCAL(paddedWidth * h);
-
- if (pBankImage)
- {
- BANK_SAVE;
-
- ModifyPixmap(pScreenPriv->pBankPixmap, w, paddedWidth,
- pBankImage);
-
- (*pScreenPriv->pBankGC->ops->CopyArea)(
- (DrawablePtr)WindowTable[pScreen->myNum],
- (DrawablePtr)pScreenPriv->pBankPixmap,
- pScreenPriv->pBankGC,
- sx + pDrawable->x, sy + pDrawable->y, w, h, 0, 0);
-
- (*pScreen->GetImage)((DrawablePtr)pScreenPriv->pBankPixmap,
- 0, 0, w, h, format, planemask, pImage);
-
- BANK_RESTORE;
-
- DEALLOCATE_LOCAL(pBankImage);
- }
- }
-
- SCREEN_WRAP(GetImage, miBankGetImage);
- }
-}
-
-static void
-miBankGetSpans(
- DrawablePtr pDrawable,
- int wMax,
- DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- char *pImage
-)
-{
- if (nspans > 0)
- {
- ScreenPtr pScreen = pDrawable->pScreen;
-
- SCREEN_INIT;
- SCREEN_STATUS;
- SCREEN_UNWRAP(GetSpans);
-
- if (!IS_BANKED(pDrawable))
- {
- (*pScreen->GetSpans)(pDrawable, wMax, ppt, pwidth, nspans, pImage);
- }
- else
- {
- char *pBankImage;
- int paddedWidth;
- DDXPointRec pt;
-
- pt.x = pt.y = 0;
-
- paddedWidth =
- PixmapBytePad(pScreenPriv->pScreenPixmap->drawable.width,
- pScreenPriv->pScreenPixmap->drawable.depth);
- pBankImage = (char *)ALLOCATE_LOCAL(paddedWidth);
-
- if (pBankImage)
- {
- BANK_SAVE;
-
- ModifyPixmap(pScreenPriv->pBankPixmap,
- pScreenPriv->pScreenPixmap->drawable.width,
- paddedWidth, pBankImage);
-
- for (; nspans--; ppt++, pwidth++)
- {
- if (*pwidth <= 0)
- continue;
-
- (*pScreenPriv->pBankGC->ops->CopyArea)(
- (DrawablePtr)WindowTable[pScreen->myNum],
- (DrawablePtr)pScreenPriv->pBankPixmap,
- pScreenPriv->pBankGC,
- ppt->x, ppt->y, *pwidth, 1, 0, 0);
-
- (*pScreen->GetSpans)((DrawablePtr)pScreenPriv->pBankPixmap,
- wMax, &pt, pwidth, 1, pImage);
-
- pImage = pImage + PixmapBytePad(*pwidth, pDrawable->depth);
- }
-
- BANK_RESTORE;
-
- DEALLOCATE_LOCAL(pBankImage);
- }
- }
-
- SCREEN_WRAP(GetSpans, miBankGetSpans);
- }
-}
-
-static Bool
-miBankCreateGC(
- GCPtr pGC
-)
-{
- ScreenPtr pScreen = pGC->pScreen;
- miBankGCPtr pGCPriv = BANK_GCPRIVATE(pGC);
- Bool ret;
-
- SCREEN_INIT;
- SCREEN_UNWRAP(CreateGC);
-
- if ((ret = (*pScreen->CreateGC)(pGC)))
- {
- pGCPriv->unwrappedOps = &miBankGCOps;
- pGCPriv->unwrappedFuncs = &miBankGCFuncs;
- GC_WRAP(pGC);
-
- memset(&pGCPriv->pBankedClips, 0,
- pScreenPriv->nBanks * sizeof(pGCPriv->pBankedClips));
- }
-
- SCREEN_WRAP(CreateGC, miBankCreateGC);
-
- return ret;
-}
-
-static void
-miBankPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what
-)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec tmpReg;
- int i;
- PaintWindowProcPtr PaintWindow;
-
- SCREEN_INIT;
- SCREEN_SAVE;
-
- if (what == PW_BORDER)
- {
- SCREEN_UNWRAP(PaintWindowBorder);
- PaintWindow = pScreen->PaintWindowBorder;
- }
- else
- {
- SCREEN_UNWRAP(PaintWindowBackground);
- PaintWindow = pScreen->PaintWindowBackground;
- }
-
- if (!IS_BANKED(pWin))
- {
- (*PaintWindow)(pWin, pRegion, what);
- }
- else
- {
- REGION_NULL(pScreen, &tmpReg);
-
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pScreenPriv->pBanks[i])
- continue;
-
- REGION_INTERSECT(pScreen, &tmpReg, pRegion,
- pScreenPriv->pBanks[i]);
-
- if (REGION_NIL(&tmpReg))
- continue;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
-
- (*PaintWindow)(pWin, &tmpReg, what);
- }
-
- REGION_UNINIT(pScreen, &tmpReg);
- }
-
- if (what == PW_BORDER)
- {
- SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow);
- }
- else
- {
- SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow);
- }
-
- SCREEN_RESTORE;
-}
-
-static void
-miBankCopyWindow(
- WindowPtr pWindow,
- DDXPointRec ptOldOrg,
- RegionPtr pRgnSrc
-)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- GCPtr pGC;
- int dx, dy, nBox;
- DrawablePtr pDrawable = (DrawablePtr)WindowTable[pScreen->myNum];
- RegionPtr pRgnDst;
- BoxPtr pBox, pBoxTmp, pBoxNext, pBoxBase, pBoxNew1, pBoxNew2;
- XID subWindowMode = IncludeInferiors;
-
- pGC = GetScratchGC(pDrawable->depth, pScreen);
-
- ChangeGC(pGC, GCSubwindowMode, &subWindowMode);
- ValidateGC(pDrawable, pGC);
-
- pRgnDst = REGION_CREATE(pScreen, NULL, 1);
-
- dx = ptOldOrg.x - pWindow->drawable.x;
- dy = ptOldOrg.y - pWindow->drawable.y;
- REGION_TRANSLATE(pScreen, pRgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, pRgnDst, &pWindow->borderClip, pRgnSrc);
-
- pBox = REGION_RECTS(pRgnDst);
- nBox = REGION_NUM_RECTS(pRgnDst);
-
- pBoxNew1 = NULL;
- pBoxNew2 = NULL;
-
- if (nBox > 1)
- {
- if (dy < 0)
- {
- /* Sort boxes from bottom to top */
- pBoxNew1 = ALLOCATE_LOCAL_ARRAY(BoxRec, nBox);
-
- if (pBoxNew1)
- {
- pBoxBase = pBoxNext = pBox + nBox - 1;
-
- while (pBoxBase >= pBox)
- {
- while ((pBoxNext >= pBox) &&
- (pBoxBase->y1 == pBoxNext->y1))
- pBoxNext--;
-
- pBoxTmp = pBoxNext + 1;
-
- while (pBoxTmp <= pBoxBase)
- *pBoxNew1++ = *pBoxTmp++;
-
- pBoxBase = pBoxNext;
- }
-
- pBoxNew1 -= nBox;
- pBox = pBoxNew1;
- }
- }
-
- if (dx < 0)
- {
- /* Sort boxes from right to left */
- pBoxNew2 = ALLOCATE_LOCAL_ARRAY(BoxRec, nBox);
-
- if (pBoxNew2)
- {
- pBoxBase = pBoxNext = pBox;
-
- while (pBoxBase < pBox + nBox)
- {
- while ((pBoxNext < pBox + nBox) &&
- (pBoxNext->y1 == pBoxBase->y1))
- pBoxNext++;
-
- pBoxTmp = pBoxNext;
-
- while (pBoxTmp != pBoxBase)
- *pBoxNew2++ = *--pBoxTmp;
-
- pBoxBase = pBoxNext;
- }
-
- pBoxNew2 -= nBox;
- pBox = pBoxNew2;
- }
- }
- }
-
- while (nBox--)
- {
- (*pGC->ops->CopyArea)(pDrawable, pDrawable, pGC,
- pBox->x1 + dx, pBox->y1 + dy,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1, pBox->y1);
-
- pBox++;
- }
-
- FreeScratchGC(pGC);
-
- REGION_DESTROY(pScreen, pRgnDst);
-
- DEALLOCATE_LOCAL(pBoxNew2);
- DEALLOCATE_LOCAL(pBoxNew1);
-}
-
-/**************************
- * Backing store wrappers *
- **************************/
-
-static void
-miBankSaveAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin
-)
-{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- RegionRec rgnClipped;
- int i;
-
- SCREEN_INIT;
- SCREEN_SAVE;
- SCREEN_UNWRAP(BackingStoreFuncs.SaveAreas);
-
- if (!IS_BANKED(pWin))
- {
- (*pScreen->BackingStoreFuncs.SaveAreas)(pPixmap, prgnSave, xorg, yorg,
- pWin);
- }
- else
- {
- REGION_NULL(pScreen, &rgnClipped);
- REGION_TRANSLATE(pScreen, prgnSave, xorg, yorg);
-
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pScreenPriv->pBanks[i])
- continue;
-
- REGION_INTERSECT(pScreen, &rgnClipped,
- prgnSave, pScreenPriv->pBanks[i]);
-
- if (REGION_NIL(&rgnClipped))
- continue;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
-
- REGION_TRANSLATE(pScreen, &rgnClipped, -xorg, -yorg);
-
- (*pScreen->BackingStoreFuncs.SaveAreas)(pPixmap, &rgnClipped,
- xorg, yorg, pWin);
- }
-
- REGION_TRANSLATE(pScreen, prgnSave, -xorg, -yorg);
- REGION_UNINIT(pScreen, &rgnClipped);
- }
-
- SCREEN_WRAP(BackingStoreFuncs.SaveAreas, miBankSaveAreas);
- SCREEN_RESTORE;
-}
-
-static void
-miBankRestoreAreas(
- PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin
-)
-{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- RegionRec rgnClipped;
- int i;
-
- SCREEN_INIT;
- SCREEN_SAVE;
- SCREEN_UNWRAP(BackingStoreFuncs.RestoreAreas);
-
- if (!IS_BANKED(pWin))
- {
- (*pScreen->BackingStoreFuncs.RestoreAreas)(pPixmap, prgnRestore,
- xorg, yorg, pWin);
- }
- else
- {
- REGION_NULL(pScreen, &rgnClipped);
-
- for (i = 0; i < pScreenPriv->nBanks; i++)
- {
- if (!pScreenPriv->pBanks[i])
- continue;
-
- REGION_INTERSECT(pScreen, &rgnClipped,
- prgnRestore, pScreenPriv->pBanks[i]);
-
- if (REGION_NIL(&rgnClipped))
- continue;
-
- SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
-
- (*pScreen->BackingStoreFuncs.RestoreAreas)(pPixmap, &rgnClipped,
- xorg, yorg, pWin);
- }
-
- REGION_UNINIT(pScreen, &rgnClipped);
- }
-
- SCREEN_WRAP(BackingStoreFuncs.RestoreAreas, miBankRestoreAreas);
- SCREEN_RESTORE;
-}
-
-Bool
-miInitializeBanking(
- ScreenPtr pScreen,
- unsigned int xsize,
- unsigned int ysize,
- unsigned int width,
- miBankInfoPtr pBankInfo
-)
-{
- miBankScreenPtr pScreenPriv;
- unsigned long nBitsPerBank, nBitsPerScanline, nPixelsPerScanlinePadUnit;
- unsigned long BankBase, ServerPad;
- unsigned int type, iBank, nBanks, maxRects, we, nBankBPP;
- int i;
-
- if (!pBankInfo || !pBankInfo->BankSize)
- return TRUE; /* No banking required */
-
- /* Sanity checks */
-
- if (!pScreen || !xsize || !ysize || (xsize > width) ||
- !pBankInfo->SetSourceBank || !pBankInfo->SetDestinationBank ||
- !pBankInfo->SetSourceAndDestinationBanks ||
- !pBankInfo->pBankA || !pBankInfo->pBankB ||
- !pBankInfo->nBankDepth)
- return FALSE;
-
- /*
- * DDX *must* have registered a pixmap format whose depth is
- * pBankInfo->nBankDepth. This is not necessarily the rootDepth
- * pixmap format.
- */
- i = 0;
- while (screenInfo.formats[i].depth != pBankInfo->nBankDepth)
- if (++i >= screenInfo.numPixmapFormats)
- return FALSE;
- nBankBPP = screenInfo.formats[i].bitsPerPixel;
-
- i = 0;
- while (screenInfo.formats[i].depth != pScreen->rootDepth)
- if (++i >= screenInfo.numPixmapFormats)
- return FALSE;
-
- if (nBankBPP > screenInfo.formats[i].bitsPerPixel)
- return FALSE;
-
- /* Determine banking type */
- if ((type = miBankDeriveType(pScreen, pBankInfo)) == BANK_NOBANK)
- return FALSE;
-
- /* Internal data */
-
- nBitsPerBank = pBankInfo->BankSize * 8;
- ServerPad = PixmapBytePad(1, pBankInfo->nBankDepth) * 8;
- if (nBitsPerBank % ServerPad)
- return FALSE;
- nBitsPerScanline = PixmapBytePad(width, pBankInfo->nBankDepth) * 8;
- nBanks = ((nBitsPerScanline * (ysize - 1)) +
- (nBankBPP * xsize) + nBitsPerBank - 1) / nBitsPerBank;
- nPixelsPerScanlinePadUnit = miLCM(ServerPad, nBankBPP) / nBankBPP;
-
- /* Private areas */
-
- if (miBankGeneration != serverGeneration)
- {
- if (((miBankScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((miBankGCIndex = AllocateGCPrivateIndex()) < 0))
- return FALSE;
-
- miBankGeneration = serverGeneration;
- }
-
- if (!AllocateGCPrivate(pScreen, miBankGCIndex,
- (nBanks * sizeof(RegionPtr)) +
- (sizeof(miBankGCRec) - sizeof(RegionPtr))))
- return FALSE;
-
- if (!(pScreenPriv = (miBankScreenPtr)Xcalloc(sizeof(miBankScreenRec))))
- return FALSE;
-
- if (!(pScreenPriv->pBanks = /* Allocate and clear */
- (RegionPtr *)Xcalloc(nBanks * sizeof(RegionPtr))))
- {
- Xfree(pScreenPriv);
- return FALSE;
- }
-
- /*
- * Translate banks into clipping regions which are themselves clipped
- * against the screen. This also ensures that pixels with imbedded bank
- * boundaries are off-screen.
- */
-
- BankBase = 0;
- maxRects = 0;
- we = 0;
- for (iBank = 0; iBank < nBanks; iBank++)
- {
- xRectangle pRects[3], *pRect = pRects;
- unsigned int xb, yb, xe, ye;
-
- xb = ((BankBase + nBankBPP - 1) % nBitsPerScanline) / nBankBPP;
- yb = (BankBase + nBankBPP - 1) / nBitsPerScanline;
- if (xb >= xsize)
- {
- xb = we = 0;
- yb++;
- }
- if (yb >= ysize)
- {
- we = 0;
- break;
- }
-
- if (we)
- break;
-
- BankBase += nBitsPerBank;
-
- we = (BankBase % nBitsPerScanline) % nBankBPP;
- xe = (BankBase % nBitsPerScanline) / nBankBPP;
- ye = BankBase / nBitsPerScanline;
- if (xe >= xsize)
- {
- we = xe = 0;
- ye++;
- }
- if (ye >= ysize)
- {
- we = xe = 0;
- ye = ysize;
- }
-
- if (yb == ye)
- {
- if (xb >= xe)
- continue;
-
- pRect->x = xb;
- pRect->y = yb;
- pRect->width = xe - xb;
- pRect->height = 1;
- maxRects += 2;
- pRect++;
- }
- else
- {
- if (xb)
- {
- pRect->x = xb;
- pRect->y = yb++;
- pRect->width = xsize - xb;
- pRect->height = 1;
- maxRects += 2;
- pRect++;
- }
-
- if (yb < ye)
- {
- pRect->x = 0;
- pRect->y = yb;
- pRect->width = xsize;
- pRect->height = ye - yb;
- maxRects += min(pRect->height, 3) + 1;
- pRect++;
- }
-
- if (xe)
- {
- pRect->x = 0;
- pRect->y = ye;
- pRect->width = xe;
- pRect->height = 1;
- maxRects += 2;
- pRect++;
- }
- }
-
- pScreenPriv->pBanks[iBank] =
- RECTS_TO_REGION(pScreen, pRect - pRects, pRects, 0);
- if (!pScreenPriv->pBanks[iBank] ||
- REGION_NAR(pScreenPriv->pBanks[iBank]))
- {
- we = 1;
- break;
- }
- }
-
- if (we && (iBank < nBanks))
- {
- for (i = iBank; i >= 0; i--)
- if (pScreenPriv->pBanks[i])
- REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]);
-
- Xfree(pScreenPriv->pBanks);
- Xfree(pScreenPriv);
-
- return FALSE;
- }
-
- /* Open for business */
-
- pScreenPriv->type = type;
- pScreenPriv->nBanks = nBanks;
- pScreenPriv->maxRects = maxRects;
- pScreenPriv->nBankBPP = nBankBPP;
- pScreenPriv->BankInfo = *pBankInfo;
- pScreenPriv->nBitsPerBank = nBitsPerBank;
- pScreenPriv->nBitsPerScanline = nBitsPerScanline;
- pScreenPriv->nPixelsPerScanlinePadUnit = nPixelsPerScanlinePadUnit;
-
- SCREEN_WRAP(CreateScreenResources, miBankCreateScreenResources);
- SCREEN_WRAP(ModifyPixmapHeader, miBankModifyPixmapHeader);
- SCREEN_WRAP(CloseScreen, miBankCloseScreen);
- SCREEN_WRAP(GetImage, miBankGetImage);
- SCREEN_WRAP(GetSpans, miBankGetSpans);
- SCREEN_WRAP(CreateGC, miBankCreateGC);
- SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow);
- SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow);
- SCREEN_WRAP(CopyWindow, miBankCopyWindow);
-
- pScreenPriv->BackingStoreFuncs = pScreen->BackingStoreFuncs;
-
- pScreen->BackingStoreFuncs.SaveAreas = miBankSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = miBankRestoreAreas;
- /* ??????????????????????????????????????????????????????????????
- pScreen->BackingStoreFuncs.SetClipmaskRgn = miBankSetClipmaskRgn;
- ?????????????????????????????????????????????????????????????? */
-
- BANK_SCRPRIVLVAL = (pointer)pScreenPriv;
-
- return TRUE;
-}
-
-/* This is used to force GC revalidation when the banking type is changed */
-/*ARGSUSED*/
-static int
-miBankNewSerialNumber(
- WindowPtr pWin,
- pointer unused
-)
-{
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- return WT_WALKCHILDREN;
-}
-
-/* This entry modifies the banking interface */
-Bool
-miModifyBanking(
- ScreenPtr pScreen,
- miBankInfoPtr pBankInfo
-)
-{
- unsigned int type;
-
- if (!pScreen)
- return FALSE;
-
- if (miBankGeneration == serverGeneration)
- {
- SCREEN_INIT;
-
- if (pScreenPriv)
- {
- if (!pBankInfo || !pBankInfo->BankSize ||
- !pBankInfo->pBankA || !pBankInfo->pBankB ||
- !pBankInfo->SetSourceBank || !pBankInfo->SetDestinationBank ||
- !pBankInfo->SetSourceAndDestinationBanks)
- return FALSE;
-
- /* BankSize and nBankDepth cannot, as yet, be changed */
- if ((pScreenPriv->BankInfo.BankSize != pBankInfo->BankSize) ||
- (pScreenPriv->BankInfo.nBankDepth != pBankInfo->nBankDepth))
- return FALSE;
-
- if ((type = miBankDeriveType(pScreen, pBankInfo)) == BANK_NOBANK)
- return FALSE;
-
- /* Reset banking info */
- pScreenPriv->BankInfo = *pBankInfo;
- if (type != pScreenPriv->type)
- {
- /*
- * Banking type is changing. Revalidate all window GC's.
- */
- pScreenPriv->type = type;
- WalkTree(pScreen, miBankNewSerialNumber, 0);
- }
-
- return TRUE;
- }
- }
-
- if (!pBankInfo || !pBankInfo->BankSize)
- return TRUE; /* No change requested */
-
- return FALSE;
-}
-
-/*
- * Given various screen attributes, determine the minimum scanline width such
- * that each scanline is server and DDX padded and any pixels with imbedded
- * bank boundaries are off-screen. This function returns -1 if such a width
- * cannot exist. This function exists because the DDX needs to be able to
- * determine this width before initializing a frame buffer.
- */
-int
-miScanLineWidth(
- unsigned int xsize, /* pixels */
- unsigned int ysize, /* pixels */
- unsigned int width, /* pixels */
- unsigned long BankSize, /* char's */
- PixmapFormatRec *pBankFormat,
- unsigned int nWidthUnit /* bits */
-)
-{
- unsigned long nBitsPerBank, nBitsPerScanline, nBitsPerScanlinePadUnit;
- unsigned long minBitsPerScanline, maxBitsPerScanline;
-
- /* Sanity checks */
-
- if (!nWidthUnit || !pBankFormat)
- return -1;
-
- nBitsPerBank = BankSize * 8;
- if (nBitsPerBank % pBankFormat->scanlinePad)
- return -1;
-
- if (xsize > width)
- width = xsize;
- nBitsPerScanlinePadUnit = miLCM(pBankFormat->scanlinePad, nWidthUnit);
- nBitsPerScanline =
- (((width * pBankFormat->bitsPerPixel) + nBitsPerScanlinePadUnit - 1) /
- nBitsPerScanlinePadUnit) * nBitsPerScanlinePadUnit;
- width = nBitsPerScanline / pBankFormat->bitsPerPixel;
-
- if (!xsize || !(nBitsPerBank % pBankFormat->bitsPerPixel))
- return (int)width;
-
- /*
- * Scanlines will be server-pad aligned at this point. They will also be
- * a multiple of nWidthUnit bits long. Ensure that pixels with imbedded
- * bank boundaries are off-screen.
- *
- * It seems reasonable to limit total frame buffer size to 1/16 of the
- * theoretical maximum address space size. On a machine with 32-bit
- * addresses (to 8-bit quantities) this turns out to be 256MB. Not only
- * does this provide a simple limiting condition for the loops below, but
- * it also prevents unsigned long wraparounds.
- */
- if (!ysize)
- return -1;
-
- minBitsPerScanline = xsize * pBankFormat->bitsPerPixel;
- if (minBitsPerScanline > nBitsPerBank)
- return -1;
-
- if (ysize == 1)
- return (int)width;
-
- maxBitsPerScanline =
- (((unsigned long)(-1) >> 1) - minBitsPerScanline) / (ysize - 1);
- while (nBitsPerScanline <= maxBitsPerScanline)
- {
- unsigned long BankBase, BankUnit;
-
- BankUnit = ((nBitsPerBank + nBitsPerScanline - 1) / nBitsPerBank) *
- nBitsPerBank;
- if (!(BankUnit % nBitsPerScanline))
- return (int)width;
-
- for (BankBase = BankUnit; ; BankBase += nBitsPerBank)
- {
- unsigned long x, y;
-
- y = BankBase / nBitsPerScanline;
- if (y >= ysize)
- return (int)width;
-
- x = BankBase % nBitsPerScanline;
- if (!(x % pBankFormat->bitsPerPixel))
- continue;
-
- if (x < minBitsPerScanline)
- {
- /*
- * Skip ahead certain widths by dividing the excess scanline
- * amongst the y's.
- */
- y *= nBitsPerScanlinePadUnit;
- nBitsPerScanline +=
- ((x + y - 1) / y) * nBitsPerScanlinePadUnit;
- width = nBitsPerScanline / pBankFormat->bitsPerPixel;
- break;
- }
-
- if (BankBase != BankUnit)
- continue;
-
- if (!(nBitsPerScanline % x))
- return (int)width;
-
- BankBase = ((nBitsPerScanline - minBitsPerScanline) /
- (nBitsPerScanline - x)) * BankUnit;
- }
- }
-
- return -1;
-}
diff --git a/mi/mibank.h b/mi/mibank.h
deleted file mode 100644
index c3aa69379..000000000
--- a/mi/mibank.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $XFree86: xc/programs/Xserver/mi/mibank.h,v 1.10 2003/01/01 19:16:42 tsi Exp $ */
-
-#ifndef __MIBANK_H__
-#define __MIBANK_H__ 1
-
-#include "scrnintstr.h"
-
-/*
- * Banking external interface.
- */
-
-/*
- * This is the banking function type. The return value is normally zero.
- * Non-zero returns can be used to implement the likes of scanline interleave,
- * etc.
- */
-typedef int miBankProc(
- ScreenPtr /*pScreen*/,
- unsigned int /*iBank*/
-);
-
-typedef miBankProc *miBankProcPtr;
-
-typedef struct _miBankInfo
-{
- /*
- * Banking refers to the use of one or more apertures (in the server's
- * address space) to access various parts of a potentially larger hardware
- * frame buffer.
- *
- * Three different banking schemes are supported:
- *
- * Single banking is indicated when pBankA and pBankB are equal and all
- * three miBankProcPtr's point to the same function. Here, both reads and
- * writes through the aperture access the same hardware location.
- *
- * Shared banking is indicated when pBankA and pBankB are equal but the
- * source and destination functions differ. Here reads through the
- * aperture do not necessarily access the same hardware location as writes.
- *
- * Double banking is indicated when pBankA and pBankB differ. Here two
- * independent apertures are used to provide read/write access to
- * potentially different hardware locations.
- *
- * Any other combination will result in no banking.
- */
- miBankProcPtr SetSourceBank; /* Set pBankA bank number */
- miBankProcPtr SetDestinationBank; /* Set pBankB bank number */
- miBankProcPtr SetSourceAndDestinationBanks; /* Set both bank numbers */
-
- pointer pBankA; /* First aperture location */
- pointer pBankB; /* First or second aperture location */
-
- /*
- * BankSize is in units of sizeof(char) and is the size of each bank.
- */
- unsigned long BankSize;
-
- /*
- * nBankDepth is the colour depth associated with the maximum number of a
- * pixel's bits that are simultaneously accessible through the frame buffer
- * aperture.
- */
- unsigned int nBankDepth;
-} miBankInfoRec, *miBankInfoPtr;
-
-Bool
-miInitializeBanking(
- ScreenPtr /*pScreen*/,
- unsigned int /*xsize*/,
- unsigned int /*ysize*/,
- unsigned int /*width*/,
- miBankInfoPtr /*pBankInfo*/
-);
-
-Bool
-miModifyBanking(
- ScreenPtr /*pScreen*/,
- miBankInfoPtr /*pBankInfo*/
-);
-
-/*
- * This function determines the minimum screen width, given a initial estimate
- * and various screen attributes. DDX needs to determine this width before
- * initializing the screen.
- */
-int
-miScanLineWidth(
- unsigned int /*xsize*/,
- unsigned int /*ysize*/,
- unsigned int /*width*/,
- unsigned long /*BankSize*/,
- PixmapFormatRec * /*pBankFormat*/,
- unsigned int /*nWidthUnit*/
-);
-
-#endif /* __MIBANK_H__ */
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
deleted file mode 100644
index f0228212c..000000000
--- a/mi/mibitblt.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mibitblt.c,v 3.11 2001/12/14 20:00:20 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mibitblt.c,v 1.5 2001/02/09 02:05:20 xorgcvs Exp $ */
-/* Author: Todd Newman (aided and abetted by Mr. Drewry) */
-
-#include "X.h"
-#include "Xprotostr.h"
-
-#include "misc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "Xmd.h"
-#include "servermd.h"
-
-/* MICOPYAREA -- public entry for the CopyArea request
- * For each rectangle in the source region
- * get the pixels with GetSpans
- * set them in the destination with SetSpans
- * We let SetSpans worry about clipping to the destination.
- */
-RegionPtr
-miCopyArea(pSrcDrawable, pDstDrawable,
- pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GCPtr pGC;
- int xIn, yIn;
- int widthSrc, heightSrc;
- int xOut, yOut;
-{
- DDXPointPtr ppt, pptFirst;
- unsigned int *pwidthFirst, *pwidth, *pbits;
- BoxRec srcBox, *prect;
- /* may be a new region, or just a copy */
- RegionPtr prgnSrcClip;
- /* non-0 if we've created a src clip */
- RegionPtr prgnExposed;
- int realSrcClip = 0;
- int srcx, srcy, dstx, dsty, i, j, y, width, height,
- xMin, xMax, yMin, yMax;
- unsigned int *ordering;
- int numRects;
- BoxPtr boxes;
-
- srcx = xIn + pSrcDrawable->x;
- srcy = yIn + pSrcDrawable->y;
-
- /* If the destination isn't realized, this is easy */
- if (pDstDrawable->type == DRAWABLE_WINDOW &&
- !((WindowPtr)pDstDrawable)->realized)
- return (RegionPtr)NULL;
-
- /* clip the source */
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- BoxRec box;
-
- box.x1 = pSrcDrawable->x;
- box.y1 = pSrcDrawable->y;
- box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
-
- prgnSrcClip = REGION_CREATE(pGC->pScreen, &box, 1);
- realSrcClip = 1;
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors) {
- prgnSrcClip = NotClippedByChildren ((WindowPtr) pSrcDrawable);
- realSrcClip = 1;
- } else
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
-
- /* If the src drawable is a window, we need to translate the srcBox so
- * that we can compare it with the window's clip region later on. */
- srcBox.x1 = srcx;
- srcBox.y1 = srcy;
- srcBox.x2 = srcx + widthSrc;
- srcBox.y2 = srcy + heightSrc;
-
- dstx = xOut;
- dsty = yOut;
- if (pGC->miTranslate)
- {
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
- }
-
- pptFirst = ppt = (DDXPointPtr)
- ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = (unsigned int *)
- ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int));
- numRects = REGION_NUM_RECTS(prgnSrcClip);
- boxes = REGION_RECTS(prgnSrcClip);
- ordering = (unsigned int *)
- ALLOCATE_LOCAL(numRects * sizeof(unsigned int));
- if(!pptFirst || !pwidthFirst || !ordering)
- {
- if (ordering)
- DEALLOCATE_LOCAL(ordering);
- if (pwidthFirst)
- DEALLOCATE_LOCAL(pwidthFirst);
- if (pptFirst)
- DEALLOCATE_LOCAL(pptFirst);
- return (RegionPtr)NULL;
- }
-
- /* If not the same drawable then order of move doesn't matter.
- Following assumes that boxes are sorted from top
- to bottom and left to right.
- */
- if ((pSrcDrawable != pDstDrawable) &&
- ((pGC->subWindowMode != IncludeInferiors) ||
- (pSrcDrawable->type == DRAWABLE_PIXMAP) ||
- (pDstDrawable->type == DRAWABLE_PIXMAP)))
- for (i=0; i < numRects; i++)
- ordering[i] = i;
- else { /* within same drawable, must sequence moves carefully! */
- if (dsty <= srcBox.y1) { /* Scroll up or stationary vertical.
- Vertical order OK */
- if (dstx <= srcBox.x1) /* Scroll left or stationary horizontal.
- Horizontal order OK as well */
- for (i=0; i < numRects; i++)
- ordering[i] = i;
- else { /* scroll right. must reverse horizontal banding of rects. */
- for (i=0, j=1, xMax=0; i < numRects; j=i+1, xMax=i) {
- /* find extent of current horizontal band */
- y=boxes[i].y1; /* band has this y coordinate */
- while ((j < numRects) && (boxes[j].y1 == y))
- j++;
- /* reverse the horizontal band in the output ordering */
- for (j-- ; j >= xMax; j--, i++)
- ordering[i] = j;
- }
- }
- }
- else { /* Scroll down. Must reverse vertical banding. */
- if (dstx < srcBox.x1) { /* Scroll left. Horizontal order OK. */
- for (i=numRects-1, j=i-1, yMin=i, yMax=0;
- i >= 0;
- j=i-1, yMin=i) {
- /* find extent of current horizontal band */
- y=boxes[i].y1; /* band has this y coordinate */
- while ((j >= 0) && (boxes[j].y1 == y))
- j--;
- /* reverse the horizontal band in the output ordering */
- for (j++ ; j <= yMin; j++, i--, yMax++)
- ordering[yMax] = j;
- }
- }
- else /* Scroll right or horizontal stationary.
- Reverse horizontal order as well (if stationary, horizontal
- order can be swapped without penalty and this is faster
- to compute). */
- for (i=0, j=numRects-1; i < numRects; i++, j--)
- ordering[i] = j;
- }
- }
-
- for(i = 0; i < numRects; i++)
- {
- prect = &boxes[ordering[i]];
- xMin = max(prect->x1, srcBox.x1);
- xMax = min(prect->x2, srcBox.x2);
- yMin = max(prect->y1, srcBox.y1);
- yMax = min(prect->y2, srcBox.y2);
- /* is there anything visible here? */
- if(xMax <= xMin || yMax <= yMin)
- continue;
-
- ppt = pptFirst;
- pwidth = pwidthFirst;
- y = yMin;
- height = yMax - yMin;
- width = xMax - xMin;
-
- for(j = 0; j < height; j++)
- {
- /* We must untranslate before calling GetSpans */
- ppt->x = xMin;
- ppt++->y = y++;
- *pwidth++ = width;
- }
- pbits = (unsigned int *)xalloc(height * PixmapBytePad(width,
- pSrcDrawable->depth));
- if (pbits)
- {
- (*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst,
- (int *)pwidthFirst, height, (char *)pbits);
- ppt = pptFirst;
- pwidth = pwidthFirst;
- xMin -= (srcx - dstx);
- y = yMin - (srcy - dsty);
- for(j = 0; j < height; j++)
- {
- ppt->x = xMin;
- ppt++->y = y++;
- *pwidth++ = width;
- }
-
- (*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
- (int *)pwidthFirst, height, TRUE);
- xfree(pbits);
- }
- }
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
- widthSrc, heightSrc, xOut, yOut, (unsigned long)0);
- if(realSrcClip)
- REGION_DESTROY(pGC->pScreen, prgnSrcClip);
-
- DEALLOCATE_LOCAL(ordering);
- DEALLOCATE_LOCAL(pwidthFirst);
- DEALLOCATE_LOCAL(pptFirst);
- return prgnExposed;
-}
-
-/* MIGETPLANE -- gets a bitmap representing one plane of pDraw
- * A helper used for CopyPlane and XY format GetImage
- * No clever strategy here, we grab a scanline at a time, pull out the
- * bits and then stuff them in a 1 bit deep map.
- */
-/*
- * This should be replaced with something more general. mi shouldn't have to
- * care about such things as scanline padding et alia.
- */
-static
-MiBits *
-miGetPlane(
- DrawablePtr pDraw,
- int planeNum, /* number of the bitPlane */
- int sx,
- int sy,
- int w,
- int h,
- MiBits *result)
-{
- int i, j, k, width, bitsPerPixel, widthInBytes;
- DDXPointRec pt = {0, 0};
- MiBits pixel;
- MiBits bit;
- unsigned char *pCharsOut = NULL;
-
-#if BITMAP_SCANLINE_UNIT == 8
-#define OUT_TYPE unsigned char
-#endif
-#if BITMAP_SCANLINE_UNIT == 16
-#define OUT_TYPE CARD16
-#endif
-#if BITMAP_SCANLINE_UNIT == 32
-#define OUT_TYPE CARD32
-#endif
-#if BITMAP_SCANLINE_UNIT == 64
-#define OUT_TYPE CARD64
-#endif
-
- OUT_TYPE *pOut;
- int delta = 0;
-
- sx += pDraw->x;
- sy += pDraw->y;
- widthInBytes = BitmapBytePad(w);
- if(!result)
- result = (MiBits *)xalloc(h * widthInBytes);
- if (!result)
- return (MiBits *)NULL;
- bitsPerPixel = pDraw->bitsPerPixel;
- bzero((char *)result, h * widthInBytes);
- pOut = (OUT_TYPE *) result;
- if(bitsPerPixel == 1)
- {
- pCharsOut = (unsigned char *) result;
- width = w;
- }
- else
- {
- delta = (widthInBytes / (BITMAP_SCANLINE_UNIT / 8)) -
- (w / BITMAP_SCANLINE_UNIT);
- width = 1;
-#if IMAGE_BYTE_ORDER == MSBFirst
- planeNum += (32 - bitsPerPixel);
-#endif
- }
- pt.y = sy;
- for (i = h; --i >= 0; pt.y++)
- {
- pt.x = sx;
- if(bitsPerPixel == 1)
- {
- (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
- (char *)pCharsOut);
- pCharsOut += widthInBytes;
- }
- else
- {
- k = 0;
- for(j = w; --j >= 0; pt.x++)
- {
- /* Fetch the next pixel */
- (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
- (char *)&pixel);
- /*
- * Now get the bit and insert into a bitmap in XY format.
- */
- bit = (pixel >> planeNum) & 1;
-#ifndef XFree86Server
- /* XXX assuming bit order == byte order */
-#if BITMAP_BIT_ORDER == LSBFirst
- bit <<= k;
-#else
- bit <<= ((BITMAP_SCANLINE_UNIT - 1) - k);
-#endif
-#else
- /* XXX assuming byte order == LSBFirst */
- if (screenInfo.bitmapBitOrder == LSBFirst)
- bit <<= k;
- else
- bit <<= ((screenInfo.bitmapScanlineUnit - 1) -
- (k % screenInfo.bitmapScanlineUnit)) +
- ((k / screenInfo.bitmapScanlineUnit) *
- screenInfo.bitmapScanlineUnit);
-#endif
- *pOut |= (OUT_TYPE) bit;
- k++;
- if (k == BITMAP_SCANLINE_UNIT)
- {
- pOut++;
- k = 0;
- }
- }
- pOut += delta;
- }
- }
- return(result);
-
-}
-
-/* MIOPQSTIPDRAWABLE -- use pbits as an opaque stipple for pDraw.
- * Drawing through the clip mask we SetSpans() the bits into a
- * bitmap and stipple those bits onto the destination drawable by doing a
- * PolyFillRect over the whole drawable,
- * then we invert the bitmap by copying it onto itself with an alu of
- * GXinvert, invert the foreground/background colors of the gc, and draw
- * the background bits.
- * Note how the clipped out bits of the bitmap are always the background
- * color so that the stipple never causes FillRect to draw them.
- */
-void
-miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
- DrawablePtr pDraw;
- GCPtr pGC;
- RegionPtr prgnSrc;
- MiBits *pbits;
- int srcx, w, h, dstx, dsty;
-{
- int oldfill, i;
- unsigned long oldfg;
- int *pwidth, *pwidthFirst;
- ChangeGCVal gcv[6];
- PixmapPtr pStipple, pPixmap;
- DDXPointRec oldOrg;
- GCPtr pGCT;
- DDXPointPtr ppt, pptFirst;
- xRectangle rect;
- RegionPtr prgnSrcClip;
-
- pPixmap = (*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, w + srcx, h, 1);
- if (!pPixmap)
- return;
-
- /* Put the image into a 1 bit deep pixmap */
- pGCT = GetScratchGC(1, pDraw->pScreen);
- if (!pGCT)
- {
- (*pDraw->pScreen->DestroyPixmap)(pPixmap);
- return;
- }
- /* First set the whole pixmap to 0 */
- gcv[0].val = 0;
- dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
- miClearDrawable((DrawablePtr)pPixmap, pGCT);
- ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int));
- if(!pptFirst || !pwidthFirst)
- {
- if (pwidthFirst) DEALLOCATE_LOCAL(pwidthFirst);
- if (pptFirst) DEALLOCATE_LOCAL(pptFirst);
- FreeScratchGC(pGCT);
- return;
- }
-
- /* we need a temporary region because ChangeClip must be assumed
- to destroy what it's sent. note that this means we don't
- have to free prgnSrcClip ourselves.
- */
- prgnSrcClip = REGION_CREATE(pGCT->pScreen, NULL, 0);
- REGION_COPY(pGCT->pScreen, prgnSrcClip, prgnSrc);
- REGION_TRANSLATE(pGCT->pScreen, prgnSrcClip, srcx, 0);
- (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
-
- /* Since we know pDraw is always a pixmap, we never need to think
- * about translation here */
- for(i = 0; i < h; i++)
- {
- ppt->x = 0;
- ppt++->y = i;
- *pwidth++ = w + srcx;
- }
-
- (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits,
- pptFirst, pwidthFirst, h, TRUE);
- DEALLOCATE_LOCAL(pwidthFirst);
- DEALLOCATE_LOCAL(pptFirst);
-
-
- /* Save current values from the client GC */
- oldfill = pGC->fillStyle;
- pStipple = pGC->stipple;
- if(pStipple)
- pStipple->refcnt++;
- oldOrg = pGC->patOrg;
-
- /* Set a new stipple in the drawable */
- gcv[0].val = FillStippled;
- gcv[1].ptr = pPixmap;
- gcv[2].val = dstx - srcx;
- gcv[3].val = dsty;
-
- dixChangeGC(NullClient, pGC,
- GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin,
- NULL, gcv);
- ValidateGC(pDraw, pGC);
-
- /* Fill the drawable with the stipple. This will draw the
- * foreground color whereever 1 bits are set, leaving everything
- * with 0 bits untouched. Note that the part outside the clip
- * region is all 0s. */
- rect.x = dstx;
- rect.y = dsty;
- rect.width = w;
- rect.height = h;
- (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-
- /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only
- * within the clipping region, the part outside is still all 0s */
- gcv[0].val = GXinvert;
- dixChangeGC(NullClient, pGCT, GCFunction, NULL, gcv);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
- (*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap,
- pGCT, 0, 0, w + srcx, h, 0, 0);
-
- /* Swap foreground and background colors on the GC for the drawable.
- * Now when we fill the drawable, we will fill in the "Background"
- * values */
- oldfg = pGC->fgPixel;
- gcv[0].val = pGC->bgPixel;
- gcv[1].val = oldfg;
- gcv[2].ptr = pPixmap;
- dixChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple,
- NULL, gcv);
- ValidateGC(pDraw, pGC);
- /* PolyFillRect might have bashed the rectangle */
- rect.x = dstx;
- rect.y = dsty;
- rect.width = w;
- rect.height = h;
- (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-
- /* Now put things back */
- if(pStipple)
- pStipple->refcnt--;
- gcv[0].val = oldfg;
- gcv[1].val = pGC->fgPixel;
- gcv[2].val = oldfill;
- gcv[3].ptr = pStipple;
- gcv[4].val = oldOrg.x;
- gcv[5].val = oldOrg.y;
- dixChangeGC(NullClient, pGC,
- GCForeground | GCBackground | GCFillStyle | GCStipple |
- GCTileStipXOrigin | GCTileStipYOrigin, NULL, gcv);
-
- ValidateGC(pDraw, pGC);
- /* put what we hope is a smaller clip region back in the scratch gc */
- (*pGCT->funcs->ChangeClip)(pGCT, CT_NONE, NULL, 0);
- FreeScratchGC(pGCT);
- (*pDraw->pScreen->DestroyPixmap)(pPixmap);
-
-}
-
-/* MICOPYPLANE -- public entry for the CopyPlane request.
- * strategy:
- * First build up a bitmap out of the bits requested
- * build a source clip
- * Use the bitmap we've built up as a Stipple for the destination
- */
-RegionPtr
-miCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GCPtr pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- unsigned long bitPlane;
-{
- MiBits *ptile;
- BoxRec box;
- RegionPtr prgnSrc, prgnExposed;
-
- /* incorporate the source clip */
-
- box.x1 = srcx + pSrcDrawable->x;
- box.y1 = srcy + pSrcDrawable->y;
- box.x2 = box.x1 + width;
- box.y2 = box.y1 + height;
- /* clip to visible drawable */
- if (box.x1 < pSrcDrawable->x)
- box.x1 = pSrcDrawable->x;
- if (box.y1 < pSrcDrawable->y)
- box.y1 = pSrcDrawable->y;
- if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1);
-
- if (pSrcDrawable->type != DRAWABLE_PIXMAP) {
- /* clip to visible drawable */
-
- if (pGC->subWindowMode == IncludeInferiors)
- {
- RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable);
- REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, clipList);
- REGION_DESTROY(pGC->pScreen, clipList);
- } else
- REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc,
- &((WindowPtr)pSrcDrawable)->clipList);
- }
-
- box = *REGION_EXTENTS(pGC->pScreen, prgnSrc);
- REGION_TRANSLATE(pGC->pScreen, prgnSrc, -box.x1, -box.y1);
-
- if ((box.x2 > box.x1) && (box.y2 > box.y1))
- {
- /* minimize the size of the data extracted */
- /* note that we convert the plane mask bitPlane into a plane number */
- box.x1 -= pSrcDrawable->x;
- box.x2 -= pSrcDrawable->x;
- box.y1 -= pSrcDrawable->y;
- box.y2 -= pSrcDrawable->y;
- ptile = miGetPlane(pSrcDrawable, ffs(bitPlane) - 1,
- box.x1, box.y1,
- box.x2 - box.x1, box.y2 - box.y1,
- (MiBits *) NULL);
- if (ptile)
- {
- miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
- box.x2 - box.x1, box.y2 - box.y1,
- dstx + box.x1 - srcx, dsty + box.y1 - srcy);
- xfree(ptile);
- }
- }
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
- width, height, dstx, dsty, bitPlane);
- REGION_DESTROY(pGC->pScreen, prgnSrc);
- return prgnExposed;
-}
-
-/* MIGETIMAGE -- public entry for the GetImage Request
- * We're getting the image into a memory buffer. While we have to use GetSpans
- * to read a line from the device (since we don't know what that looks like),
- * we can just write into the destination buffer
- *
- * two different strategies are used, depending on whether we're getting the
- * image in Z format or XY format
- * Z format:
- * Line at a time, GetSpans a line into the destination buffer, then if the
- * planemask is not all ones, we do a SetSpans into a temporary buffer (to get
- * bits turned off) and then another GetSpans to get stuff back (because
- * pixmaps are opaque, and we are passed in the memory to write into). This is
- * pretty ugly and slow but works. Life is hard.
- * XY format:
- * get the single plane specified in planemask
- */
-void
-miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
- DrawablePtr pDraw;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char * pDst;
-{
- unsigned char depth;
- int i, linelength, width, srcx, srcy;
- DDXPointRec pt = {0, 0};
- XID gcv[2];
- PixmapPtr pPixmap = (PixmapPtr)NULL;
- GCPtr pGC = NULL;
-
- depth = pDraw->depth;
- if(format == ZPixmap)
- {
- if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
- {
- xPoint pt;
-
- pGC = GetScratchGC(depth, pDraw->pScreen);
- if (!pGC)
- return;
- pPixmap = (*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, w, 1, depth);
- if (!pPixmap)
- {
- FreeScratchGC(pGC);
- return;
- }
- /*
- * Clear the pixmap before doing anything else
- */
- ValidateGC((DrawablePtr)pPixmap, pGC);
- pt.x = pt.y = 0;
- width = w;
- (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &pt, &width,
- TRUE);
-
- /* alu is already GXCopy */
- gcv[0] = (XID)planeMask;
- DoChangeGC(pGC, GCPlaneMask, gcv, 0);
- ValidateGC((DrawablePtr)pPixmap, pGC);
- }
-
- linelength = PixmapBytePad(w, depth);
- srcx = sx + pDraw->x;
- srcy = sy + pDraw->y;
- for(i = 0; i < h; i++)
- {
- pt.x = srcx;
- pt.y = srcy + i;
- width = w;
- (*pDraw->pScreen->GetSpans)(pDraw, w, &pt, &width, 1, pDst);
- if (pPixmap)
- {
- pt.x = 0;
- pt.y = 0;
- width = w;
- (*pGC->ops->SetSpans)((DrawablePtr)pPixmap, pGC, pDst,
- &pt, &width, 1, TRUE);
- (*pDraw->pScreen->GetSpans)((DrawablePtr)pPixmap, w, &pt,
- &width, 1, pDst);
- }
- pDst += linelength;
- }
- if (pPixmap)
- {
- (*pGC->pScreen->DestroyPixmap)(pPixmap);
- FreeScratchGC(pGC);
- }
- }
- else
- {
- (void) miGetPlane(pDraw, ffs(planeMask) - 1, sx, sy, w, h,
- (MiBits *)pDst);
- }
-}
-
-/* MIPUTIMAGE -- public entry for the PutImage request
- * Here we benefit from knowing the format of the bits pointed to by pImage,
- * even if we don't know how pDraw represents them.
- * Three different strategies are used depending on the format
- * XYBitmap Format:
- * we just use the Opaque Stipple helper function to cover the destination
- * Note that this covers all the planes of the drawable with the
- * foreground color (masked with the GC planemask) where there are 1 bits
- * and the background color (masked with the GC planemask) where there are
- * 0 bits
- * XYPixmap format:
- * what we're called with is a series of XYBitmaps, but we only want
- * each XYPixmap to update 1 plane, instead of updating all of them.
- * we set the foreground color to be all 1s and the background to all 0s
- * then for each plane, we set the plane mask to only effect that one
- * plane and recursive call ourself with the format set to XYBitmap
- * (This clever idea courtesy of RGD.)
- * ZPixmap format:
- * This part is simple, just call SetSpans
- */
-void
-miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
- DrawablePtr pDraw;
- GCPtr pGC;
- int depth, x, y, w, h, leftPad;
- int format;
- char *pImage;
-{
- DDXPointPtr pptFirst, ppt;
- int *pwidthFirst, *pwidth;
- RegionPtr prgnSrc;
- BoxRec box;
- unsigned long oldFg, oldBg;
- XID gcv[3];
- unsigned long oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- if (!w || !h)
- return;
- switch(format)
- {
- case XYBitmap:
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1);
-
- miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
- leftPad, w, h, x, y);
- REGION_DESTROY(pGC->pScreen, prgnSrc);
- break;
-
- case XYPixmap:
- depth = pGC->depth;
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0] = (XID)~0;
- gcv[1] = (XID)0;
- DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
- bytesPer = (long)h * BitmapBytePad(w + leftPad);
-
- for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
- {
- if (i & oldPlanemask)
- {
- gcv[0] = (XID)i;
- DoChangeGC(pGC, GCPlaneMask, gcv, 0);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
- XYBitmap, (char *)pImage);
- }
- }
- gcv[0] = (XID)oldPlanemask;
- gcv[1] = (XID)oldFg;
- gcv[2] = (XID)oldBg;
- DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
- ValidateGC(pDraw, pGC);
- break;
-
- case ZPixmap:
- ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int));
- if(!pptFirst || !pwidthFirst)
- {
- if (pwidthFirst)
- DEALLOCATE_LOCAL(pwidthFirst);
- if (pptFirst)
- DEALLOCATE_LOCAL(pptFirst);
- return;
- }
- if (pGC->miTranslate)
- {
- x += pDraw->x;
- y += pDraw->y;
- }
-
- for(i = 0; i < h; i++)
- {
- ppt->x = x;
- ppt->y = y + i;
- ppt++;
- *pwidth++ = w;
- }
-
- (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst,
- pwidthFirst, h, TRUE);
- DEALLOCATE_LOCAL(pwidthFirst);
- DEALLOCATE_LOCAL(pptFirst);
- break;
- }
-}
diff --git a/mi/mibstore.c b/mi/mibstore.c
deleted file mode 100644
index e04e5410c..000000000
--- a/mi/mibstore.c
+++ /dev/null
@@ -1,3901 +0,0 @@
-/* $Xorg: mibstore.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by the Regents of the University of California
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted, provided
-that the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name The Open Group not be used in advertising or publicity
-pertaining to distribution of the software without specific, written prior
-permission.
-
-The University of California makes no representations about the suitability
-of this software for any purpose. It is provided "as is" without express or
-implied warranty.
-
-******************************************************************/
-
-/* $XFree86: xc/programs/Xserver/mi/mibstore.c,v 1.11 2003/11/10 18:22:47 tsi Exp $ */
-
-#define NEED_EVENTS
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "dixstruct.h" /* For requestingClient */
-#include "mi.h"
-#include "mibstorest.h"
-
-/*
- * When the server fails to allocate a backing store pixmap, if you want
- * it to dynamically retry to allocate backing store on every subsequent
- * graphics op, you can enable BSEAGER; otherwise, backing store will be
- * disabled on the window until it is unmapped and then remapped.
- */
-/* #define BSEAGER */
-
-/*-
- * NOTES ON USAGE:
- *
- * The functions in this file implement a machine-independent backing-store
- * scheme. To use it, the output library must do the following:
- * - Provide a SaveAreas function that takes a destination pixmap, a
- * region of the areas to save (in the pixmap's coordinate system)
- * and the screen origin of the region. It should copy the areas from
- * the screen into the pixmap.
- * - Provide a RestoreAreas function that takes a source pixmap, a region
- * of the areas to restore (in the screen's coordinate system) and the
- * origin of the pixmap on the screen. It should copy the areas from
- * the pixmap into the screen.
- * - Provide a SetClipmaskRgn function that takes a gc and a region
- * and merges the region into any CT_PIXMAP client clip that
- * is specified in the GC. This routine is only needed if
- * miValidateBackingStore will see CT_PIXMAP clip lists; not
- * true for any of the sample servers (which convert the PIXMAP
- * clip lists into CT_REGION clip lists; an expensive but simple
- * to code option).
- * - The function placed in a window's ClearToBackground vector must call
- * pScreen->ClearBackingStore with the window, followed by
- * the window-relative x and y coordinates, followed by the width and
- * height of the area to be cleared, followed by the generateExposures
- * flag. This has been taken care of in miClearToBackground.
- * - Whatever determines GraphicsExpose events for the CopyArea and
- * CopyPlane requests should call pWin->backStorage->ExposeCopy
- * with the source and destination drawables, the GC used, a source-
- * window-relative region of exposed areas, the source and destination
- * coordinates and the bitplane copied, if CopyPlane, or 0, if
- * CopyArea.
- *
- * JUSTIFICATION
- * This is a cross between saving everything and just saving the
- * obscued areas (as in Pike's layers.) This method has the advantage
- * of only doing each output operation once per pixel, visible or
- * invisible, and avoids having to do all the crufty storage
- * management of keeping several separate rectangles. Since the
- * ddx layer ouput primitives are required to draw through clipping
- * rectangles anyway, sending multiple drawing requests for each of
- * several rectangles isn't necessary. (Of course, it could be argued
- * that the ddx routines should just take one rectangle each and
- * get called multiple times, but that would make taking advantage of
- * smart hardware harder, and probably be slower as well.)
- */
-
-#define SETUP_BACKING_TERSE(pGC) \
- miBSGCPtr pGCPrivate = (miBSGCPtr)(pGC)->devPrivates[miBSGCIndex].ptr; \
- GCFuncs *oldFuncs = pGC->funcs;
-
-#define SETUP_BACKING(pDrawable,pGC) \
- miBSWindowPtr pBackingStore = \
- (miBSWindowPtr)((WindowPtr)(pDrawable))->backStorage; \
- DrawablePtr pBackingDrawable = (DrawablePtr) \
- pBackingStore->pBackingPixmap; \
- SETUP_BACKING_TERSE(pGC) \
- GCPtr pBackingGC = pGCPrivate->pBackingGC;
-
-#define PROLOGUE(pGC) { \
- pGC->ops = pGCPrivate->wrapOps;\
- pGC->funcs = pGCPrivate->wrapFuncs; \
- }
-
-#define EPILOGUE(pGC) { \
- pGCPrivate->wrapOps = (pGC)->ops; \
- (pGC)->ops = &miBSGCOps; \
- (pGC)->funcs = oldFuncs; \
- }
-
-static void miCreateBSPixmap(WindowPtr pWin, BoxPtr pExtents);
-static void miDestroyBSPixmap(WindowPtr pWin);
-static void miTileVirtualBS(WindowPtr pWin);
-static void miBSAllocate(WindowPtr pWin), miBSFree(WindowPtr pWin);
-static Bool miBSCreateGCPrivate(GCPtr pGC);
-static void miBSClearBackingRegion(WindowPtr pWin, RegionPtr pRgn);
-
-#define MoreCopy0 ;
-#define MoreCopy2 *dstCopy++ = *srcCopy++; *dstCopy++ = *srcCopy++;
-#define MoreCopy4 MoreCopy2 MoreCopy2
-
-#define copyData(src,dst,n,morecopy) \
-{ \
- register short *srcCopy = (short *)(src); \
- register short *dstCopy = (short *)(dst); \
- register int i; \
- register int bsx = pBackingStore->x; \
- register int bsy = pBackingStore->y; \
- for (i = n; --i >= 0; ) \
- { \
- *dstCopy++ = *srcCopy++ - bsx; \
- *dstCopy++ = *srcCopy++ - bsy; \
- morecopy \
- } \
-}
-
-#define copyPoints(src,dst,n,mode) \
-if (mode == CoordModeOrigin) \
-{ \
- copyData(src,dst,n,MoreCopy0); \
-} \
-else \
-{ \
- memmove((char *)(dst), (char *)(src), (n) << 2); \
- *((short *)(dst)) -= pBackingStore->x; \
- *((short *)(dst) + 1) -= pBackingStore->y; \
-}
-
-/*
- * wrappers for screen funcs
- */
-
-static int miBSScreenIndex;
-static unsigned long miBSGeneration = 0;
-
-static Bool miBSCloseScreen(int i, ScreenPtr pScreen);
-static void miBSGetImage(DrawablePtr pDrawable, int sx, int sy,
- int w, int h, unsigned int format,
- unsigned long planemask, char *pdstLine);
-static void miBSGetSpans(DrawablePtr pDrawable, int wMax,
- DDXPointPtr ppt, int *pwidth, int nspans,
- char *pdstStart);
-static Bool miBSChangeWindowAttributes(WindowPtr pWin,
- unsigned long mask);
-static Bool miBSCreateGC(GCPtr pGC);
-static Bool miBSDestroyWindow(WindowPtr pWin);
-
-/*
- * backing store screen functions
- */
-
-static void miBSSaveDoomedAreas(WindowPtr pWin, RegionPtr pObscured,
- int dx, int dy);
-static RegionPtr miBSRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed);
-static void miBSExposeCopy(WindowPtr pSrc, DrawablePtr pDst,
- GCPtr pGC, RegionPtr prgnExposed,
- int srcx, int srcy, int dstx, int dsty,
- unsigned long plane);
-static RegionPtr miBSTranslateBackingStore(WindowPtr pWin, int windx,
- int windy, RegionPtr oldClip,
- int oldx, int oldy);
-static RegionPtr miBSClearBackingStore(WindowPtr pWin, int x, int y,
- int w, int h, Bool generateExposures);
-static void miBSDrawGuarantee(WindowPtr pWin, GCPtr pGC,
- int guarantee);
-
-/*
- * wrapper vectors for GC funcs and ops
- */
-
-static int miBSGCIndex;
-
-static void miBSValidateGC(GCPtr pGC, unsigned long stateChanges,
- DrawablePtr pDrawable);
-static void miBSCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void miBSDestroyGC(GCPtr pGC);
-static void miBSChangeGC(GCPtr pGC, unsigned long mask);
-static void miBSChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void miBSDestroyClip(GCPtr pGC);
-static void miBSCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-static GCFuncs miBSGCFuncs = {
- miBSValidateGC,
- miBSChangeGC,
- miBSCopyGC,
- miBSDestroyGC,
- miBSChangeClip,
- miBSDestroyClip,
- miBSCopyClip,
-};
-
-static void miBSFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
- DDXPointPtr pptInit, int *pwidthInit,
- int fSorted);
-static void miBSSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
- DDXPointPtr ppt, int *pwidth, int nspans,
- int fSorted);
-static void miBSPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad,
- int format, char *pBits);
-static RegionPtr miBSCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int w, int h,
- int dstx, int dsty);
-static RegionPtr miBSCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int w, int h,
- int dstx, int dsty, unsigned long plane);
-static void miBSPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, xPoint *pptInit);
-static void miBSPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
- int npt, DDXPointPtr pptInit);
-static void miBSPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
- xSegment *pSegs);
-static void miBSPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
- int nrects, xRectangle *pRects);
-static void miBSPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs,
- xArc *parcs);
-static void miBSFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr pPts);
-static void miBSPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
- int nrectFill, xRectangle *prectInit);
-static void miBSPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs);
-static int miBSPolyText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
-static int miBSPolyText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count,
- unsigned short *chars);
-static void miBSImageText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
-static void miBSImageText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count,
- unsigned short *chars);
-static void miBSImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
-static void miBSPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
-static void miBSPushPixels(GCPtr pGC, PixmapPtr pBitMap,
- DrawablePtr pDst, int w, int h,
- int x, int y);
-#ifdef NEED_LINEHELPER
-static void miBSLineHelper(void);
-#endif
-
-static GCOps miBSGCOps = {
- miBSFillSpans, miBSSetSpans, miBSPutImage,
- miBSCopyArea, miBSCopyPlane, miBSPolyPoint,
- miBSPolylines, miBSPolySegment, miBSPolyRectangle,
- miBSPolyArc, miBSFillPolygon, miBSPolyFillRect,
- miBSPolyFillArc, miBSPolyText8, miBSPolyText16,
- miBSImageText8, miBSImageText16, miBSImageGlyphBlt,
- miBSPolyGlyphBlt, miBSPushPixels
-#ifdef NEED_LINEHELPER
- , miBSLineHelper
-#endif
-};
-
-#define FUNC_PROLOGUE(pGC, pPriv) \
- ((pGC)->funcs = pPriv->wrapFuncs),\
- ((pGC)->ops = pPriv->wrapOps)
-
-#define FUNC_EPILOGUE(pGC, pPriv) \
- ((pGC)->funcs = &miBSGCFuncs),\
- ((pGC)->ops = &miBSGCOps)
-
-/*
- * every GC in the server is initially wrapped with these
- * "cheap" functions. This allocates no memory and is used
- * to discover GCs used with windows which have backing
- * store enabled
- */
-
-static void miBSCheapValidateGC(GCPtr pGC, unsigned long stateChanges,
- DrawablePtr pDrawable);
-static void miBSCheapCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void miBSCheapDestroyGC(GCPtr pGC);
-static void miBSCheapChangeGC(GCPtr pGC, unsigned long mask);
-static void miBSCheapChangeClip(GCPtr pGC, int type, pointer pvalue,
- int nrects);
-static void miBSCheapDestroyClip(GCPtr pGC);
-static void miBSCheapCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-static GCFuncs miBSCheapGCFuncs = {
- miBSCheapValidateGC,
- miBSCheapChangeGC,
- miBSCheapCopyGC,
- miBSCheapDestroyGC,
- miBSCheapChangeClip,
- miBSCheapDestroyClip,
- miBSCheapCopyClip,
-};
-
-#define CHEAP_FUNC_PROLOGUE(pGC) \
- ((pGC)->funcs = (GCFuncs *) (pGC)->devPrivates[miBSGCIndex].ptr)
-
-#define CHEAP_FUNC_EPILOGUE(pGC) \
- ((pGC)->funcs = &miBSCheapGCFuncs)
-
-/*
- * called from device screen initialization proc. Gets a GCPrivateIndex
- * and wraps appropriate per-screen functions. pScreen->BackingStoreFuncs
- * must be previously initialized.
- */
-
-void
-miInitializeBackingStore (pScreen)
- ScreenPtr pScreen;
-{
- miBSScreenPtr pScreenPriv;
-
- if (miBSGeneration != serverGeneration)
- {
- miBSScreenIndex = AllocateScreenPrivateIndex ();
- if (miBSScreenIndex < 0)
- return;
- miBSGCIndex = AllocateGCPrivateIndex ();
- miBSGeneration = serverGeneration;
- }
- if (!AllocateGCPrivate(pScreen, miBSGCIndex, 0))
- return;
- pScreenPriv = (miBSScreenPtr) xalloc (sizeof (miBSScreenRec));
- if (!pScreenPriv)
- return;
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreenPriv->GetImage = pScreen->GetImage;
- pScreenPriv->GetSpans = pScreen->GetSpans;
- pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pScreenPriv->CreateGC = pScreen->CreateGC;
- pScreenPriv->DestroyWindow = pScreen->DestroyWindow;
-
- pScreen->CloseScreen = miBSCloseScreen;
- pScreen->GetImage = miBSGetImage;
- pScreen->GetSpans = miBSGetSpans;
- pScreen->ChangeWindowAttributes = miBSChangeWindowAttributes;
- pScreen->CreateGC = miBSCreateGC;
- pScreen->DestroyWindow = miBSDestroyWindow;
-
- pScreen->SaveDoomedAreas = miBSSaveDoomedAreas;
- pScreen->RestoreAreas = miBSRestoreAreas;
- pScreen->ExposeCopy = miBSExposeCopy;
- pScreen->TranslateBackingStore = miBSTranslateBackingStore;
- pScreen->ClearBackingStore = miBSClearBackingStore;
- pScreen->DrawGuarantee = miBSDrawGuarantee;
-
- pScreen->devPrivates[miBSScreenIndex].ptr = (pointer) pScreenPriv;
-}
-
-/*
- * Screen function wrappers
- */
-
-#define SCREEN_PROLOGUE(pScreen, field)\
- ((pScreen)->field = \
- ((miBSScreenPtr) \
- (pScreen)->devPrivates[miBSScreenIndex].ptr)->field)
-
-#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
-
-/*
- * CloseScreen wrapper -- unwrap everything, free the private data
- * and call the wrapped function
- */
-
-static Bool
-miBSCloseScreen (i, pScreen)
- int i;
- ScreenPtr pScreen;
-{
- miBSScreenPtr pScreenPriv;
-
- pScreenPriv = (miBSScreenPtr) pScreen->devPrivates[miBSScreenIndex].ptr;
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->GetImage = pScreenPriv->GetImage;
- pScreen->GetSpans = pScreenPriv->GetSpans;
- pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
- pScreen->CreateGC = pScreenPriv->CreateGC;
-
- xfree ((pointer) pScreenPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void miBSFillVirtualBits(DrawablePtr pDrawable, GCPtr pGC,
- RegionPtr pRgn, int x, int y, int state,
- PixUnion pixunion, unsigned long planemask);
-
-static void
-miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planemask;
- char *pdstLine;
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- BoxRec bounds;
- unsigned char depth;
-
- SCREEN_PROLOGUE (pScreen, GetImage);
-
- if (pDrawable->type != DRAWABLE_PIXMAP &&
- ((WindowPtr) pDrawable)->visibility != VisibilityUnobscured)
- {
- PixmapPtr pPixmap;
- miBSWindowPtr pWindowPriv;
- GCPtr pGC = NULL;
- WindowPtr pWin, pSrcWin;
- int xoff, yoff;
- RegionRec Remaining;
- RegionRec Border;
- RegionRec Inside;
- BoxPtr pBox;
- int n;
-
- pWin = (WindowPtr) pDrawable;
- pPixmap = 0;
- depth = pDrawable->depth;
- bounds.x1 = sx + pDrawable->x;
- bounds.y1 = sy + pDrawable->y;
- bounds.x2 = bounds.x1 + w;
- bounds.y2 = bounds.y1 + h;
- REGION_INIT(pScreen, &Remaining, &bounds, 0);
- for (;;)
- {
- bounds.x1 = sx + pDrawable->x - pWin->drawable.x;
- bounds.y1 = sy + pDrawable->y - pWin->drawable.y;
- bounds.x2 = bounds.x1 + w;
- bounds.y2 = bounds.y1 + h;
- if (pWin->viewable && pWin->backStorage &&
- pWin->drawable.depth == depth &&
- (RECT_IN_REGION(pScreen, &(pWindowPriv =
- (miBSWindowPtr) pWin->backStorage)->SavedRegion,
- &bounds) != rgnOUT ||
- RECT_IN_REGION(pScreen, &Remaining,
- REGION_EXTENTS(pScreen, &pWin->borderSize)) != rgnOUT))
- {
- if (!pPixmap)
- {
- XID subWindowMode = IncludeInferiors;
- int x, y;
-
- pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
- if (!pPixmap)
- goto punt;
- pGC = GetScratchGC (depth, pScreen);
- if (!pGC)
- {
- (*pScreen->DestroyPixmap) (pPixmap);
- goto punt;
- }
- ChangeGC (pGC, GCSubwindowMode, &subWindowMode);
- ValidateGC ((DrawablePtr)pPixmap, pGC);
- REGION_NULL(pScreen, &Border);
- REGION_NULL(pScreen, &Inside);
- pSrcWin = (WindowPtr) pDrawable;
- x = sx;
- y = sy;
- if (pSrcWin->parent)
- {
- x += pSrcWin->origin.x;
- y += pSrcWin->origin.y;
- pSrcWin = pSrcWin->parent;
- }
- (*pGC->ops->CopyArea) ((DrawablePtr)pSrcWin,
- (DrawablePtr)pPixmap, pGC,
- x, y, w, h,
- 0, 0);
- REGION_SUBTRACT(pScreen, &Remaining, &Remaining,
- &((WindowPtr) pDrawable)->borderClip);
- }
-
- REGION_INTERSECT(pScreen, &Inside, &Remaining, &pWin->winSize);
- REGION_TRANSLATE(pScreen, &Inside,
- -pWin->drawable.x,
- -pWin->drawable.y);
- REGION_INTERSECT(pScreen, &Inside, &Inside,
- &pWindowPriv->SavedRegion);
-
- /* offset of sub-window in GetImage pixmap */
- xoff = pWin->drawable.x - pDrawable->x - sx;
- yoff = pWin->drawable.y - pDrawable->y - sy;
-
- if (REGION_NUM_RECTS(&Inside) > 0)
- {
- switch (pWindowPriv->status)
- {
- case StatusContents:
- pBox = REGION_RECTS(&Inside);
- for (n = REGION_NUM_RECTS(&Inside); --n >= 0;)
- {
- (*pGC->ops->CopyArea) (
- (DrawablePtr)pWindowPriv->pBackingPixmap,
- (DrawablePtr)pPixmap, pGC,
- pBox->x1 - pWindowPriv->x,
- pBox->y1 - pWindowPriv->y,
- pBox->x2 - pBox->x1,
- pBox->y2 - pBox->y1,
- pBox->x1 + xoff,
- pBox->y1 + yoff);
- ++pBox;
- }
- break;
- case StatusVirtual:
- case StatusVDirty:
- if (pWindowPriv->backgroundState == BackgroundPixmap ||
- pWindowPriv->backgroundState == BackgroundPixel)
- miBSFillVirtualBits ((DrawablePtr) pPixmap, pGC, &Inside,
- xoff, yoff,
- (int) pWindowPriv->backgroundState,
- pWindowPriv->background, ~0L);
- break;
- }
- }
- REGION_SUBTRACT(pScreen, &Border, &pWin->borderSize,
- &pWin->winSize);
- REGION_INTERSECT(pScreen, &Border, &Border, &Remaining);
- if (REGION_NUM_RECTS(&Border) > 0)
- {
- REGION_TRANSLATE(pScreen, &Border, -pWin->drawable.x,
- -pWin->drawable.y);
- miBSFillVirtualBits ((DrawablePtr) pPixmap, pGC, &Border,
- xoff, yoff,
- pWin->borderIsPixel ? (int)BackgroundPixel : (int)BackgroundPixmap,
- pWin->border, ~0L);
- }
- }
-
- if (pWin->viewable && pWin->firstChild)
- pWin = pWin->firstChild;
- else
- {
- while (!pWin->nextSib && pWin != (WindowPtr) pDrawable)
- pWin = pWin->parent;
- if (pWin == (WindowPtr) pDrawable)
- break;
- pWin = pWin->nextSib;
- }
- }
-
- REGION_UNINIT(pScreen, &Remaining);
-
- if (pPixmap)
- {
- REGION_UNINIT(pScreen, &Border);
- REGION_UNINIT(pScreen, &Inside);
- (*pScreen->GetImage) ((DrawablePtr) pPixmap,
- 0, 0, w, h, format, planemask, pdstLine);
- (*pScreen->DestroyPixmap) (pPixmap);
- FreeScratchGC (pGC);
- }
- else
- {
- goto punt;
- }
- }
- else
- {
-punt: ;
- (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
- format, planemask, pdstLine);
- }
-
- SCREEN_EPILOGUE (pScreen, GetImage, miBSGetImage);
-}
-
-static void
-miBSGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
- DrawablePtr pDrawable;
- int wMax;
- DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- char *pdstStart;
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- BoxRec bounds;
- int i;
- WindowPtr pWin;
- int dx, dy;
-
- SCREEN_PROLOGUE (pScreen, GetSpans);
-
- if (pDrawable->type != DRAWABLE_PIXMAP && ((WindowPtr) pDrawable)->backStorage)
- {
- PixmapPtr pPixmap;
- miBSWindowPtr pWindowPriv;
- GCPtr pGC;
-
- pWin = (WindowPtr) pDrawable;
- pWindowPriv = (miBSWindowPtr) pWin->backStorage;
- pPixmap = pWindowPriv->pBackingPixmap;
-
- bounds.x1 = ppt->x;
- bounds.y1 = ppt->y;
- bounds.x2 = bounds.x1 + *pwidth;
- bounds.y2 = ppt->y;
- for (i = 0; i < nspans; i++)
- {
- if (ppt[i].x < bounds.x1)
- bounds.x1 = ppt[i].x;
- if (ppt[i].x + pwidth[i] > bounds.x2)
- bounds.x2 = ppt[i].x + pwidth[i];
- if (ppt[i].y < bounds.y1)
- bounds.y1 = ppt[i].y;
- else if (ppt[i].y > bounds.y2)
- bounds.y2 = ppt[i].y;
- }
-
- switch (RECT_IN_REGION(pScreen, &pWindowPriv->SavedRegion, &bounds))
- {
- case rgnPART:
- if (!pPixmap)
- {
- miCreateBSPixmap (pWin, NullBox);
- if (!(pPixmap = pWindowPriv->pBackingPixmap))
- break;
- }
- pWindowPriv->status = StatusNoPixmap;
- pGC = GetScratchGC(pPixmap->drawable.depth,
- pPixmap->drawable.pScreen);
- if (pGC)
- {
- ValidateGC ((DrawablePtr) pPixmap, pGC);
- (*pGC->ops->CopyArea)
- (pDrawable, (DrawablePtr) pPixmap, pGC,
- bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1,
- bounds.x1 + pPixmap->drawable.x - pWin->drawable.x -
- pWindowPriv->x,
- bounds.y1 + pPixmap->drawable.y - pWin->drawable.y -
- pWindowPriv->y);
- FreeScratchGC(pGC);
- }
- pWindowPriv->status = StatusContents;
- /* fall through */
- case rgnIN:
- if (!pPixmap)
- {
- miCreateBSPixmap (pWin, NullBox);
- if (!(pPixmap = pWindowPriv->pBackingPixmap))
- break;
- }
- dx = pPixmap->drawable.x - pWin->drawable.x - pWindowPriv->x;
- dy = pPixmap->drawable.y - pWin->drawable.y - pWindowPriv->y;
- for (i = 0; i < nspans; i++)
- {
- ppt[i].x += dx;
- ppt[i].y += dy;
- }
- (*pScreen->GetSpans) ((DrawablePtr) pPixmap, wMax, ppt, pwidth,
- nspans, pdstStart);
- break;
- case rgnOUT:
- (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans,
- pdstStart);
- break;
- }
- }
- else
- {
- (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- }
-
- SCREEN_EPILOGUE (pScreen, GetSpans, miBSGetSpans);
-}
-
-static Bool
-miBSChangeWindowAttributes (pWin, mask)
- WindowPtr pWin;
- unsigned long mask;
-{
- ScreenPtr pScreen;
- Bool ret;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, ChangeWindowAttributes);
-
- ret = (*pScreen->ChangeWindowAttributes) (pWin, mask);
-
- if (ret && (mask & CWBackingStore))
- {
- if (pWin->backingStore != NotUseful || pWin->DIXsaveUnder)
- miBSAllocate (pWin);
- else
- miBSFree (pWin);
- }
-
- SCREEN_EPILOGUE (pScreen, ChangeWindowAttributes, miBSChangeWindowAttributes);
-
- return ret;
-}
-
-/*
- * GC Create wrapper. Set up the cheap GC func wrappers to track
- * GC validation on BackingStore windows
- */
-
-static Bool
-miBSCreateGC (pGC)
- GCPtr pGC;
-{
- ScreenPtr pScreen = pGC->pScreen;
- Bool ret;
-
- SCREEN_PROLOGUE (pScreen, CreateGC);
-
- if ( (ret = (*pScreen->CreateGC) (pGC)) )
- {
- pGC->devPrivates[miBSGCIndex].ptr = (pointer) pGC->funcs;
- pGC->funcs = &miBSCheapGCFuncs;
- }
-
- SCREEN_EPILOGUE (pScreen, CreateGC, miBSCreateGC);
-
- return ret;
-}
-
-static Bool
-miBSDestroyWindow (pWin)
- WindowPtr pWin;
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- Bool ret;
-
- SCREEN_PROLOGUE (pScreen, DestroyWindow);
-
- ret = (*pScreen->DestroyWindow) (pWin);
-
- miBSFree (pWin);
-
- SCREEN_EPILOGUE (pScreen, DestroyWindow, miBSDestroyWindow);
-
- return ret;
-}
-
-/*
- * cheap GC func wrappers. Simply track validation on windows
- * with backing store to enable the real func/op wrappers
- */
-
-static void
-miBSCheapValidateGC (pGC, stateChanges, pDrawable)
- GCPtr pGC;
- unsigned long stateChanges;
- DrawablePtr pDrawable;
-{
- CHEAP_FUNC_PROLOGUE (pGC);
-
- if (pDrawable->type != DRAWABLE_PIXMAP &&
- ((WindowPtr) pDrawable)->backStorage != NULL &&
- miBSCreateGCPrivate (pGC))
- {
- (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable);
- }
- else
- {
- (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable);
-
- /* rewrap funcs as Validate may have changed them */
- pGC->devPrivates[miBSGCIndex].ptr = (pointer) pGC->funcs;
-
- CHEAP_FUNC_EPILOGUE (pGC);
- }
-}
-
-static void
-miBSCheapChangeGC (pGC, mask)
- GCPtr pGC;
- unsigned long mask;
-{
- CHEAP_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->ChangeGC) (pGC, mask);
-
- CHEAP_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miBSCheapCopyGC (pGCSrc, mask, pGCDst)
- GCPtr pGCSrc, pGCDst;
- unsigned long mask;
-{
- CHEAP_FUNC_PROLOGUE (pGCDst);
-
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
-
- CHEAP_FUNC_EPILOGUE (pGCDst);
-}
-
-static void
-miBSCheapDestroyGC (pGC)
- GCPtr pGC;
-{
- CHEAP_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->DestroyGC) (pGC);
-
- /* leave it unwrapped */
-}
-
-static void
-miBSCheapChangeClip (pGC, type, pvalue, nrects)
- GCPtr pGC;
- int type;
- pointer pvalue;
- int nrects;
-{
- CHEAP_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-
- CHEAP_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miBSCheapCopyClip(pgcDst, pgcSrc)
- GCPtr pgcDst, pgcSrc;
-{
- CHEAP_FUNC_PROLOGUE (pgcDst);
-
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-
- CHEAP_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-miBSCheapDestroyClip(pGC)
- GCPtr pGC;
-{
- CHEAP_FUNC_PROLOGUE (pGC);
-
- (* pGC->funcs->DestroyClip)(pGC);
-
- CHEAP_FUNC_EPILOGUE (pGC);
-}
-
-/*
- * create the full func/op wrappers for a GC
- */
-
-static Bool
-miBSCreateGCPrivate (pGC)
- GCPtr pGC;
-{
- miBSGCRec *pPriv;
-
- pPriv = (miBSGCRec *) xalloc (sizeof (miBSGCRec));
- if (!pPriv)
- return FALSE;
- pPriv->pBackingGC = NULL;
- pPriv->guarantee = GuaranteeNothing;
- pPriv->serialNumber = 0;
- pPriv->stateChanges = (1 << (GCLastBit + 1)) - 1;
- pPriv->wrapOps = pGC->ops;
- pPriv->wrapFuncs = pGC->funcs;
- pGC->funcs = &miBSGCFuncs;
- pGC->ops = &miBSGCOps;
- pGC->devPrivates[miBSGCIndex].ptr = (pointer) pPriv;
- return TRUE;
-}
-
-static void
-miBSDestroyGCPrivate (GCPtr pGC)
-{
- miBSGCRec *pPriv;
-
- pPriv = (miBSGCRec *) pGC->devPrivates[miBSGCIndex].ptr;
- if (pPriv)
- {
- pGC->devPrivates[miBSGCIndex].ptr = (pointer) pPriv->wrapFuncs;
- pGC->funcs = &miBSCheapGCFuncs;
- pGC->ops = pPriv->wrapOps;
- if (pPriv->pBackingGC)
- FreeGC (pPriv->pBackingGC, (GContext) 0);
- xfree ((pointer) pPriv);
- }
-}
-
-/*
- * GC ops -- wrap each GC operation with our own function
- */
-
-/*-
- *-----------------------------------------------------------------------
- * miBSFillSpans --
- * Perform a FillSpans, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- DDXPointPtr pptCopy, pptReset;
- int *pwidthCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(nInit*sizeof(DDXPointRec));
- pwidthCopy=(int *)ALLOCATE_LOCAL(nInit*sizeof(int));
- if (pptCopy && pwidthCopy)
- {
- copyData(pptInit, pptCopy, nInit, MoreCopy0);
- memmove((char *)pwidthCopy,(char *)pwidthInit,nInit*sizeof(int));
-
- (* pGC->ops->FillSpans)(pDrawable, pGC, nInit, pptInit,
- pwidthInit, fSorted);
- if (pGC->miTranslate)
- {
- int dx, dy;
- int nReset;
-
- pptReset = pptCopy;
- dx = pDrawable->x - pBackingDrawable->x;
- dy = pDrawable->y - pBackingDrawable->y;
- nReset = nInit;
- while (nReset--)
- {
- pptReset->x -= dx;
- pptReset->y -= dy;
- ++pptReset;
- }
- }
- (* pBackingGC->ops->FillSpans)(pBackingDrawable,
- pBackingGC, nInit, pptCopy, pwidthCopy,
- fSorted);
- }
- if (pwidthCopy) DEALLOCATE_LOCAL(pwidthCopy);
- if (pptCopy) DEALLOCATE_LOCAL(pptCopy);
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSSetSpans --
- * Perform a SetSpans, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *psrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- DDXPointPtr pptCopy, pptReset;
- int *pwidthCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(nspans*sizeof(DDXPointRec));
- pwidthCopy=(int *)ALLOCATE_LOCAL(nspans*sizeof(int));
- if (pptCopy && pwidthCopy)
- {
- copyData(ppt, pptCopy, nspans, MoreCopy0);
- memmove((char *)pwidthCopy,(char *)pwidth,nspans*sizeof(int));
-
- (* pGC->ops->SetSpans)(pDrawable, pGC, psrc, ppt, pwidth,
- nspans, fSorted);
- if (pGC->miTranslate)
- {
- int dx, dy;
- int nReset;
-
- pptReset = pptCopy;
- dx = pDrawable->x - pBackingDrawable->x;
- dy = pDrawable->y - pBackingDrawable->y;
- nReset = nspans;
- while (nReset--)
- {
- pptReset->x -= dx;
- pptReset->y -= dy;
- ++pptReset;
- }
- }
- (* pBackingGC->ops->SetSpans)(pBackingDrawable, pBackingGC,
- psrc, pptCopy, pwidthCopy, nspans, fSorted);
- }
- if (pwidthCopy) DEALLOCATE_LOCAL(pwidthCopy);
- if (pptCopy) DEALLOCATE_LOCAL(pptCopy);
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPutImage --
- * Perform a PutImage, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pBits)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int depth;
- int x;
- int y;
- int w;
- int h;
- int leftPad;
- int format;
- char *pBits;
-{
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- (*pGC->ops->PutImage)(pDrawable, pGC,
- depth, x, y, w, h, leftPad, format, pBits);
- (*pBackingGC->ops->PutImage)(pBackingDrawable, pBackingGC,
- depth, x - pBackingStore->x, y - pBackingStore->y,
- w, h, leftPad, format, pBits);
-
- EPILOGUE (pGC);
-}
-
-typedef RegionPtr (* CopyAreaProcPtr)(DrawablePtr, DrawablePtr, GCPtr,
- int, int, int, int, int, int);
-typedef RegionPtr (* CopyPlaneProcPtr)(DrawablePtr, DrawablePtr, GCPtr,
- int, int, int, int, int, int,
- unsigned long bitPlane);
-/*-
- *-----------------------------------------------------------------------
- * miBSDoCopy --
- * Perform a CopyArea or CopyPlane within a window that has backing
- * store enabled.
- *
- * Results:
- * TRUE if the copy was performed or FALSE if a regular one should
- * be done.
- *
- * Side Effects:
- * Things are copied (no s***!)
- *
- * Notes:
- * The idea here is to form two regions that cover the source box.
- * One contains the exposed rectangles while the other contains
- * the obscured ones. An array of <box, drawable> pairs is then
- * formed where the <box> indicates the area to be copied and the
- * <drawable> indicates from where it is to be copied (exposed regions
- * come from the screen while obscured ones come from the backing
- * pixmap). The array 'sequence' is then filled with the indices of
- * the pairs in the order in which they should be copied to prevent
- * things from getting screwed up. A call is also made through the
- * backingGC to take care of any copying into the backing pixmap.
- *
- *-----------------------------------------------------------------------
- */
-static Bool
-miBSDoCopy(
- WindowPtr pWin, /* Window being scrolled */
- GCPtr pGC, /* GC we're called through */
- int srcx, /* X of source rectangle */
- int srcy, /* Y of source rectangle */
- int w, /* Width of source rectangle */
- int h, /* Height of source rectangle */
- int dstx, /* X of destination rectangle */
- int dsty, /* Y of destination rectangle */
- unsigned long plane, /* Plane to copy (0 for CopyArea) */
- CopyPlaneProcPtr copyProc, /* Procedure to call to perform the copy */
- RegionPtr *ppRgn) /* resultant Graphics Expose region */
-{
- RegionPtr pRgnExp; /* Exposed region */
- RegionPtr pRgnObs; /* Obscured region */
- BoxRec box; /* Source box (screen coord) */
- struct BoxDraw {
- BoxPtr pBox; /* Source box */
- enum {
- win, pix
- } source; /* Place from which to copy */
- } *boxes; /* Array of box/drawable pairs covering
- * source box. */
- int *sequence; /* Sequence of boxes to move */
- register int i, j, k, l, y;
- register BoxPtr pBox;
- int dx, dy, nrects;
- Bool graphicsExposures;
- CopyPlaneProcPtr pixCopyProc;
- int numRectsExp, numRectsObs;
- BoxPtr pBoxExp, pBoxObs;
-
- SETUP_BACKING (pWin, pGC);
- (void)oldFuncs;
-
- /*
- * Create a region of exposed boxes in pRgnExp.
- */
- box.x1 = srcx + pWin->drawable.x;
- box.x2 = box.x1 + w;
- box.y1 = srcy + pWin->drawable.y;
- box.y2 = box.y1 + h;
-
- pRgnExp = REGION_CREATE(pGC->pScreen, &box, 1);
- REGION_INTERSECT(pGC->pScreen, pRgnExp, pRgnExp, &pWin->clipList);
- pRgnObs = REGION_CREATE(pGC->pScreen, NULL, 1);
- REGION_INVERSE( pGC->pScreen, pRgnObs, pRgnExp, &box);
-
- /*
- * Translate regions into window coordinates for proper calls
- * to the copyProc, then make sure none of the obscured region sticks
- * into invalid areas of the backing pixmap.
- */
- REGION_TRANSLATE(pGC->pScreen, pRgnExp,
- -pWin->drawable.x,
- -pWin->drawable.y);
- REGION_TRANSLATE(pGC->pScreen, pRgnObs,
- -pWin->drawable.x,
- -pWin->drawable.y);
- REGION_INTERSECT(pGC->pScreen, pRgnObs, pRgnObs, &pBackingStore->SavedRegion);
-
- /*
- * If the obscured region is empty, there's no point being fancy.
- */
- if (!REGION_NOTEMPTY(pGC->pScreen, pRgnObs))
- {
- REGION_DESTROY(pGC->pScreen, pRgnExp);
- REGION_DESTROY(pGC->pScreen, pRgnObs);
-
- return (FALSE);
- }
-
- numRectsExp = REGION_NUM_RECTS(pRgnExp);
- pBoxExp = REGION_RECTS(pRgnExp);
- pBoxObs = REGION_RECTS(pRgnObs);
- numRectsObs = REGION_NUM_RECTS(pRgnObs);
- nrects = numRectsExp + numRectsObs;
-
- boxes = (struct BoxDraw *)ALLOCATE_LOCAL(nrects * sizeof(struct BoxDraw));
- sequence = (int *) ALLOCATE_LOCAL(nrects * sizeof(int));
- *ppRgn = NULL;
-
- if (!boxes || !sequence)
- {
- if (sequence) DEALLOCATE_LOCAL(sequence);
- if (boxes) DEALLOCATE_LOCAL(boxes);
- REGION_DESTROY(pGC->pScreen, pRgnExp);
- REGION_DESTROY(pGC->pScreen, pRgnObs);
-
- return(TRUE);
- }
-
- /*
- * Order the boxes in the two regions so we know from which drawable
- * to copy which box, storing the result in the boxes array
- */
- for (i = 0, j = 0, k = 0;
- (i < numRectsExp) && (j < numRectsObs);
- k++)
- {
- if (pBoxExp[i].y1 < pBoxObs[j].y1)
- {
- boxes[k].pBox = &pBoxExp[i];
- boxes[k].source = win;
- i++;
- }
- else if ((pBoxObs[j].y1 < pBoxExp[i].y1) ||
- (pBoxObs[j].x1 < pBoxExp[i].x1))
- {
- boxes[k].pBox = &pBoxObs[j];
- boxes[k].source = pix;
- j++;
- }
- else
- {
- boxes[k].pBox = &pBoxExp[i];
- boxes[k].source = win;
- i++;
- }
- }
-
- /*
- * Catch any leftover boxes from either region (note that only
- * one can have leftover boxes...)
- */
- if (i != numRectsExp)
- {
- do
- {
- boxes[k].pBox = &pBoxExp[i];
- boxes[k].source = win;
- i++;
- k++;
- } while (i < numRectsExp);
-
- }
- else
- {
- do
- {
- boxes[k].pBox = &pBoxObs[j];
- boxes[k].source = pix;
- j++;
- k++;
- } while (j < numRectsObs);
- }
-
- if (dsty <= srcy)
- {
- /*
- * Scroll up or vertically stationary, so vertical order is ok.
- */
- if (dstx <= srcx)
- {
- /*
- * Scroll left or horizontally stationary, so horizontal order
- * is ok as well.
- */
- for (i = 0; i < nrects; i++)
- {
- sequence[i] = i;
- }
- }
- else
- {
- /*
- * Scroll right. Need to reverse the rectangles within each
- * band.
- */
- for (i = 0, j = 1, k = 0;
- i < nrects;
- j = i + 1, k = i)
- {
- y = boxes[i].pBox->y1;
- while ((j < nrects) && (boxes[j].pBox->y1 == y))
- {
- j++;
- }
- for (j--; j >= k; j--, i++)
- {
- sequence[i] = j;
- }
- }
- }
- }
- else
- {
- /*
- * Scroll down. Must reverse vertical banding, at least.
- */
- if (dstx < srcx)
- {
- /*
- * Scroll left. Horizontal order is ok.
- */
- for (i = nrects - 1, j = i - 1, k = i, l = 0;
- i >= 0;
- j = i - 1, k = i)
- {
- /*
- * Find extent of current horizontal band, then reverse
- * the order of the whole band.
- */
- y = boxes[i].pBox->y1;
- while ((j >= 0) && (boxes[j].pBox->y1 == y))
- {
- j--;
- }
- for (j++; j <= k; j++, i--, l++)
- {
- sequence[l] = j;
- }
- }
- }
- else
- {
- /*
- * Scroll right or horizontal stationary.
- * Reverse horizontal order as well (if stationary, horizontal
- * order can be swapped without penalty and this is faster
- * to compute).
- */
- for (i = 0, j = nrects - 1; i < nrects; i++, j--)
- {
- sequence[i] = j;
- }
- }
- }
-
- /*
- * XXX: To avoid getting multiple NoExpose events from this operation,
- * we turn OFF graphicsExposures in the gc and deal with any uncopied
- * areas later, if there's something not in backing-store.
- */
-
- graphicsExposures = pGC->graphicsExposures;
- pGC->graphicsExposures = FALSE;
-
- dx = dstx - srcx;
- dy = dsty - srcy;
-
- /*
- * Figure out which copy procedure to use from the backing GC. Note we
- * must do this because some implementations (sun's, e.g.) have
- * pBackingGC a fake GC with the real one below it, thus the devPriv for
- * pBackingGC won't be what the output library expects.
- */
- if (plane != 0)
- {
- pixCopyProc = pBackingGC->ops->CopyPlane;
- }
- else
- {
- pixCopyProc = (CopyPlaneProcPtr)pBackingGC->ops->CopyArea;
- }
-
- for (i = 0; i < nrects; i++)
- {
- pBox = boxes[sequence[i]].pBox;
-
- /*
- * If we're copying from the pixmap, we need to place its contents
- * onto the screen before scrolling the pixmap itself. If we're copying
- * from the window, we need to copy its contents into the pixmap before
- * we scroll the window itself.
- */
- if (boxes[sequence[i]].source == pix)
- {
- (void) (* copyProc) (pBackingDrawable, &(pWin->drawable), pGC,
- pBox->x1 - pBackingStore->x,
- pBox->y1 - pBackingStore->y,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1 + dx, pBox->y1 + dy, plane);
- (void) (* pixCopyProc) (pBackingDrawable, pBackingDrawable, pBackingGC,
- pBox->x1 - pBackingStore->x,
- pBox->y1 - pBackingStore->y,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1 + dx - pBackingStore->x,
- pBox->y1 + dy - pBackingStore->y, plane);
- }
- else
- {
- (void) (* pixCopyProc) (&(pWin->drawable), pBackingDrawable, pBackingGC,
- pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1 + dx - pBackingStore->x,
- pBox->y1 + dy - pBackingStore->y, plane);
- (void) (* copyProc) (&(pWin->drawable), &(pWin->drawable), pGC,
- pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1 + dx, pBox->y1 + dy, plane);
- }
- }
- DEALLOCATE_LOCAL(sequence);
- DEALLOCATE_LOCAL(boxes);
-
- pGC->graphicsExposures = graphicsExposures;
- /*
- * Form union of rgnExp and rgnObs and see if covers entire area
- * to be copied. Store the resultant region for miBSCopyArea
- * to return to dispatch which will send the appropriate expose
- * events.
- */
- REGION_UNION(pGC->pScreen, pRgnExp, pRgnExp, pRgnObs);
- box.x1 = srcx;
- box.x2 = srcx + w;
- box.y1 = srcy;
- box.y2 = srcy + h;
- if (RECT_IN_REGION(pGC->pScreen, pRgnExp, &box) == rgnIN)
- {
- REGION_EMPTY(pGC->pScreen, pRgnExp);
- }
- else
- {
- REGION_INVERSE( pGC->pScreen, pRgnExp, pRgnExp, &box);
- REGION_TRANSLATE( pGC->pScreen, pRgnExp,
- dx + pWin->drawable.x,
- dy + pWin->drawable.y);
- REGION_INTERSECT( pGC->pScreen, pRgnObs, pRgnExp, &pWin->clipList);
- (*pWin->drawable.pScreen->PaintWindowBackground) (pWin,
- pRgnObs, PW_BACKGROUND);
- REGION_TRANSLATE( pGC->pScreen, pRgnExp,
- -pWin->drawable.x,
- -pWin->drawable.y);
- miBSClearBackingRegion (pWin, pRgnExp);
- }
- if (graphicsExposures)
- *ppRgn = pRgnExp;
- else
- REGION_DESTROY(pGC->pScreen, pRgnExp);
- REGION_DESTROY(pGC->pScreen, pRgnObs);
-
- return (TRUE);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSCopyArea --
- * Perform a CopyArea from the source to the destination, extracting
- * from the source's backing-store and storing into the destination's
- * backing-store without messing anything up. If the source and
- * destination are different, there's not too much to worry about:
- * we can just issue several calls to the regular CopyArea function.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static RegionPtr
-miBSCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty)
- DrawablePtr pSrc;
- DrawablePtr pDst;
- GCPtr pGC;
- int srcx;
- int srcy;
- int w;
- int h;
- int dstx;
- int dsty;
-{
- BoxPtr pExtents;
- long dx, dy;
- int bsrcx, bsrcy, bw, bh, bdstx, bdsty;
- RegionPtr pixExposed = 0, winExposed = 0;
-
- SETUP_BACKING(pDst, pGC);
-
- PROLOGUE(pGC);
-
- if ((pSrc != pDst) ||
- (!miBSDoCopy((WindowPtr)pSrc, pGC, srcx, srcy, w, h, dstx, dsty,
- (unsigned long) 0, (CopyPlaneProcPtr)pGC->ops->CopyArea,
- &winExposed)))
- {
- /*
- * always copy to the backing store first, miBSDoCopy
- * returns FALSE if the *source* region is disjoint
- * from the backing store saved region. So, copying
- * *to* the backing store is always safe
- */
- if (pGC->clientClipType != CT_PIXMAP)
- {
- /*
- * adjust srcx, srcy, w, h, dstx, dsty to be clipped to
- * the backing store. An unnecessary optimisation,
- * but a useful one when GetSpans is slow.
- */
- pExtents = REGION_EXTENTS(pDst->pScreen,
- (RegionPtr)pBackingGC->clientClip);
- bsrcx = srcx;
- bsrcy = srcy;
- bw = w;
- bh = h;
- bdstx = dstx;
- bdsty = dsty;
- dx = pExtents->x1 - bdstx;
- if (dx > 0)
- {
- bsrcx += dx;
- bdstx += dx;
- bw -= dx;
- }
- dy = pExtents->y1 - bdsty;
- if (dy > 0)
- {
- bsrcy += dy;
- bdsty += dy;
- bh -= dy;
- }
- dx = (bdstx + bw) - pExtents->x2;
- if (dx > 0)
- bw -= dx;
- dy = (bdsty + bh) - pExtents->y2;
- if (dy > 0)
- bh -= dy;
- if (bw > 0 && bh > 0)
- pixExposed = (* pBackingGC->ops->CopyArea) (pSrc,
- pBackingDrawable, pBackingGC,
- bsrcx, bsrcy, bw, bh, bdstx - pBackingStore->x,
- bdsty - pBackingStore->y);
- }
- else
- pixExposed = (* pBackingGC->ops->CopyArea) (pSrc,
- pBackingDrawable, pBackingGC,
- srcx, srcy, w, h,
- dstx - pBackingStore->x, dsty - pBackingStore->y);
-
- winExposed = (* pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
- }
-
- /*
- * compute the composite graphics exposure region
- */
- if (winExposed)
- {
- if (pixExposed){
- REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed);
- REGION_DESTROY(pDst->pScreen, pixExposed);
- }
- } else
- winExposed = pixExposed;
-
- EPILOGUE (pGC);
-
- return winExposed;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSCopyPlane --
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static RegionPtr
-miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane)
- DrawablePtr pSrc;
- DrawablePtr pDst;
- register GC *pGC;
- int srcx,
- srcy;
- int w,
- h;
- int dstx,
- dsty;
- unsigned long plane;
-{
- BoxPtr pExtents;
- long dx, dy;
- int bsrcx, bsrcy, bw, bh, bdstx, bdsty;
- RegionPtr winExposed = 0, pixExposed = 0;
- SETUP_BACKING(pDst, pGC);
-
- PROLOGUE(pGC);
-
- if ((pSrc != pDst) ||
- (!miBSDoCopy((WindowPtr)pSrc, pGC, srcx, srcy, w, h, dstx, dsty,
- plane, pGC->ops->CopyPlane, &winExposed)))
- {
- /*
- * always copy to the backing store first, miBSDoCopy
- * returns FALSE if the *source* region is disjoint
- * from the backing store saved region. So, copying
- * *to* the backing store is always safe
- */
- if (pGC->clientClipType != CT_PIXMAP)
- {
- /*
- * adjust srcx, srcy, w, h, dstx, dsty to be clipped to
- * the backing store. An unnecessary optimisation,
- * but a useful one when GetSpans is slow.
- */
- pExtents = REGION_EXTENTS(pDst->pScreen,
- (RegionPtr)pBackingGC->clientClip);
- bsrcx = srcx;
- bsrcy = srcy;
- bw = w;
- bh = h;
- bdstx = dstx;
- bdsty = dsty;
- dx = pExtents->x1 - bdstx;
- if (dx > 0)
- {
- bsrcx += dx;
- bdstx += dx;
- bw -= dx;
- }
- dy = pExtents->y1 - bdsty;
- if (dy > 0)
- {
- bsrcy += dy;
- bdsty += dy;
- bh -= dy;
- }
- dx = (bdstx + bw) - pExtents->x2;
- if (dx > 0)
- bw -= dx;
- dy = (bdsty + bh) - pExtents->y2;
- if (dy > 0)
- bh -= dy;
- if (bw > 0 && bh > 0)
- pixExposed = (* pBackingGC->ops->CopyPlane) (pSrc,
- pBackingDrawable,
- pBackingGC, bsrcx, bsrcy, bw, bh,
- bdstx - pBackingStore->x,
- bdsty - pBackingStore->y, plane);
- }
- else
- pixExposed = (* pBackingGC->ops->CopyPlane) (pSrc,
- pBackingDrawable,
- pBackingGC, srcx, srcy, w, h,
- dstx - pBackingStore->x,
- dsty - pBackingStore->y, plane);
-
- winExposed = (* pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, plane);
-
- }
-
- /*
- * compute the composite graphics exposure region
- */
- if (winExposed)
- {
- if (pixExposed)
- {
- REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed);
- REGION_DESTROY(pDst->pScreen, pixExposed);
- }
- } else
- winExposed = pixExposed;
-
- EPILOGUE (pGC);
-
- return winExposed;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyPoint --
- * Perform a PolyPoint, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyPoint (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
- xPoint *pptCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pptCopy = (xPoint *)ALLOCATE_LOCAL(npt*sizeof(xPoint));
- if (pptCopy)
- {
- copyPoints(pptInit, pptCopy, npt, mode);
-
- (* pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pptInit);
-
- (* pBackingGC->ops->PolyPoint) (pBackingDrawable,
- pBackingGC, mode, npt, pptCopy);
-
- DEALLOCATE_LOCAL(pptCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyLines --
- * Perform a Polylines, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolylines (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- DDXPointPtr pptInit;
-{
- DDXPointPtr pptCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));
- if (pptCopy)
- {
- copyPoints(pptInit, pptCopy, npt, mode);
-
- (* pGC->ops->Polylines)(pDrawable, pGC, mode, npt, pptInit);
- (* pBackingGC->ops->Polylines)(pBackingDrawable,
- pBackingGC, mode, npt, pptCopy);
- DEALLOCATE_LOCAL(pptCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolySegment --
- * Perform a PolySegment, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolySegment(pDrawable, pGC, nseg, pSegs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- xSegment *pSegs;
-{
- xSegment *pSegsCopy;
-
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pSegsCopy = (xSegment *)ALLOCATE_LOCAL(nseg*sizeof(xSegment));
- if (pSegsCopy)
- {
- copyData(pSegs, pSegsCopy, nseg << 1, MoreCopy0);
-
- (* pGC->ops->PolySegment)(pDrawable, pGC, nseg, pSegs);
- (* pBackingGC->ops->PolySegment)(pBackingDrawable,
- pBackingGC, nseg, pSegsCopy);
-
- DEALLOCATE_LOCAL(pSegsCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyRectangle --
- * Perform a PolyRectangle, routing output to backing-store as needed.
- *
- * Results:
- * None
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyRectangle(pDrawable, pGC, nrects, pRects)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- xRectangle *pRectsCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pRectsCopy =(xRectangle *)ALLOCATE_LOCAL(nrects*sizeof(xRectangle));
- if (pRectsCopy)
- {
- copyData(pRects, pRectsCopy, nrects, MoreCopy2);
-
- (* pGC->ops->PolyRectangle)(pDrawable, pGC, nrects, pRects);
- (* pBackingGC->ops->PolyRectangle)(pBackingDrawable,
- pBackingGC, nrects, pRectsCopy);
-
- DEALLOCATE_LOCAL(pRectsCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyArc --
- * Perform a PolyArc, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyArc(pDrawable, pGC, narcs, parcs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- xArc *pArcsCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc));
- if (pArcsCopy)
- {
- copyData(parcs, pArcsCopy, narcs, MoreCopy4);
-
- (* pGC->ops->PolyArc)(pDrawable, pGC, narcs, parcs);
- (* pBackingGC->ops->PolyArc)(pBackingDrawable, pBackingGC,
- narcs, pArcsCopy);
-
- DEALLOCATE_LOCAL(pArcsCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSFillPolygon --
- * Perform a FillPolygon, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int shape, mode;
- register int count;
- DDXPointPtr pPts;
-{
- DDXPointPtr pPtsCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pPtsCopy = (DDXPointPtr)ALLOCATE_LOCAL(count*sizeof(DDXPointRec));
- if (pPtsCopy)
- {
- copyPoints(pPts, pPtsCopy, count, mode);
- (* pGC->ops->FillPolygon)(pDrawable, pGC, shape, mode, count, pPts);
- (* pBackingGC->ops->FillPolygon)(pBackingDrawable,
- pBackingGC, shape, mode,
- count, pPtsCopy);
-
- DEALLOCATE_LOCAL(pPtsCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyFillRect --
- * Perform a PolyFillRect, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- xRectangle *pRectCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pRectCopy =
- (xRectangle *)ALLOCATE_LOCAL(nrectFill*sizeof(xRectangle));
- if (pRectCopy)
- {
- copyData(prectInit, pRectCopy, nrectFill, MoreCopy2);
-
- (* pGC->ops->PolyFillRect)(pDrawable, pGC, nrectFill, prectInit);
- (* pBackingGC->ops->PolyFillRect)(pBackingDrawable,
- pBackingGC, nrectFill, pRectCopy);
-
- DEALLOCATE_LOCAL(pRectCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyFillArc --
- * Perform a PolyFillArc, routing output to backing-store as needed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyFillArc(pDrawable, pGC, narcs, parcs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- xArc *pArcsCopy;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc));
- if (pArcsCopy)
- {
- copyData(parcs, pArcsCopy, narcs, MoreCopy4);
- (* pGC->ops->PolyFillArc)(pDrawable, pGC, narcs, parcs);
- (* pBackingGC->ops->PolyFillArc)(pBackingDrawable,
- pBackingGC, narcs, pArcsCopy);
- DEALLOCATE_LOCAL(pArcsCopy);
- }
-
- EPILOGUE (pGC);
-}
-
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyText8 --
- * Perform a PolyText8, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static int
-miBSPolyText8(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- int result;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- result = (* pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars);
- (* pBackingGC->ops->PolyText8)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- count, chars);
-
- EPILOGUE (pGC);
- return result;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyText16 --
- * Perform a PolyText16, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static int
-miBSPolyText16(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- int result;
- SETUP_BACKING (pDrawable, pGC);
-
- PROLOGUE(pGC);
-
- result = (* pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars);
- (* pBackingGC->ops->PolyText16)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- count, chars);
-
- EPILOGUE (pGC);
-
- return result;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSImageText8 --
- * Perform a ImageText8, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSImageText8(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- SETUP_BACKING (pDrawable, pGC);
- PROLOGUE(pGC);
-
- (* pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars);
- (* pBackingGC->ops->ImageText8)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- count, chars);
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSImageText16 --
- * Perform a ImageText16, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSImageText16(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- SETUP_BACKING (pDrawable, pGC);
- PROLOGUE(pGC);
-
- (* pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars);
- (* pBackingGC->ops->ImageText16)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- count, chars);
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSImageGlyphBlt --
- * Perform a ImageGlyphBlt, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- SETUP_BACKING (pDrawable, pGC);
- PROLOGUE(pGC);
-
- (* pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
- pglyphBase);
- (* pBackingGC->ops->ImageGlyphBlt)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- nglyph, ppci, pglyphBase);
-
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPolyGlyphBlt --
- * Perform a PolyGlyphBlt, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- SETUP_BACKING (pDrawable, pGC);
- PROLOGUE(pGC);
-
- (* pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph,
- ppci, pglyphBase);
- (* pBackingGC->ops->PolyGlyphBlt)(pBackingDrawable, pBackingGC,
- x - pBackingStore->x, y - pBackingStore->y,
- nglyph, ppci, pglyphBase);
- EPILOGUE (pGC);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSPushPixels --
- * Perform a PushPixels, routing output to backing-store as needed.
- *
- * Results:
- *
- * Side Effects:
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSPushPixels(pGC, pBitMap, pDst, w, h, x, y)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDst;
- int w, h, x, y;
-{
- SETUP_BACKING (pDst, pGC);
- PROLOGUE(pGC);
-
- (* pGC->ops->PushPixels)(pGC, pBitMap, pDst, w, h, x, y);
- if (pGC->miTranslate) {
- x -= pDst->x;
- y -= pDst->y;
- }
- (* pBackingGC->ops->PushPixels)(pBackingGC, pBitMap,
- pBackingDrawable, w, h,
- x - pBackingStore->x, y - pBackingStore->y);
-
- EPILOGUE (pGC);
-}
-
-#ifdef NEED_LINEHELPER
-/*-
- *-----------------------------------------------------------------------
- * miBSLineHelper --
- *
- * Results: should never be called
- *
- * Side Effects: server dies
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSLineHelper()
-{
- FatalError("miBSLineHelper called\n");
-}
-#endif
-
-/*-
- *-----------------------------------------------------------------------
- * miBSClearBackingStore --
- * Clear the given area of the backing pixmap with the background of
- * the window, whatever it is. If generateExposures is TRUE, generate
- * exposure events for the area. Note that if the area has any
- * part outside the saved portions of the window, we do not allow the
- * count in the expose events to be 0, since there will be more
- * expose events to come.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Areas of pixmap are cleared and Expose events are generated.
- *
- *-----------------------------------------------------------------------
- */
-static RegionPtr
-miBSClearBackingStore(pWin, x, y, w, h, generateExposures)
- WindowPtr pWin;
- int x;
- int y;
- int w;
- int h;
- Bool generateExposures;
-{
- RegionPtr pRgn;
- int i;
- miBSWindowPtr pBackingStore;
- ScreenPtr pScreen;
- GCPtr pGC;
- int ts_x_origin,
- ts_y_origin;
- pointer gcvalues[4];
- unsigned long gcmask;
- xRectangle *rects;
- BoxPtr pBox;
- BoxRec box;
- PixUnion background;
- char backgroundState;
- int numRects;
-
- pBackingStore = (miBSWindowPtr)pWin->backStorage;
- pScreen = pWin->drawable.pScreen;
-
- if ((pBackingStore->status == StatusNoPixmap) ||
- (pBackingStore->status == StatusBadAlloc))
- return NullRegion;
-
- if (w == 0)
- w = (int) pWin->drawable.width - x;
- if (h == 0)
- h = (int) pWin->drawable.height - y;
-
- box.x1 = x;
- box.y1 = y;
- box.x2 = x + w;
- box.y2 = y + h;
- pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
- if (!pRgn)
- return NullRegion;
- REGION_INTERSECT( pScreen, pRgn, pRgn, &pBackingStore->SavedRegion);
-
- if (REGION_NOTEMPTY( pScreen, pRgn))
- {
- /*
- * if clearing entire window, simply make new virtual
- * tile. For the root window, we also destroy the pixmap
- * to save a pile of memory
- */
- if (x == 0 && y == 0 &&
- w == pWin->drawable.width &&
- h == pWin->drawable.height)
- {
- if (!pWin->parent)
- miDestroyBSPixmap (pWin);
- if (pBackingStore->status != StatusContents)
- miTileVirtualBS (pWin);
- }
-
- ts_x_origin = ts_y_origin = 0;
-
- backgroundState = pWin->backgroundState;
- background = pWin->background;
- if (backgroundState == ParentRelative) {
- WindowPtr pParent;
-
- pParent = pWin;
- while (pParent->backgroundState == ParentRelative) {
- ts_x_origin -= pParent->origin.x;
- ts_y_origin -= pParent->origin.y;
- pParent = pParent->parent;
- }
- backgroundState = pParent->backgroundState;
- background = pParent->background;
- }
-
- if ((backgroundState != None) &&
- ((pBackingStore->status == StatusContents) ||
- !SameBackground (pBackingStore->backgroundState,
- pBackingStore->background,
- backgroundState,
- background)))
- {
- if (!pBackingStore->pBackingPixmap)
- miCreateBSPixmap(pWin, NullBox);
-
- pGC = GetScratchGC(pWin->drawable.depth, pScreen);
- if (pGC && pBackingStore->pBackingPixmap)
- {
- /*
- * First take care of any ParentRelative stuff by altering the
- * tile/stipple origin to match the coordinates of the upper-left
- * corner of the first ancestor without a ParentRelative background.
- * This coordinate is, of course, negative.
- */
-
- if (backgroundState == BackgroundPixel)
- {
- gcvalues[0] = (pointer) background.pixel;
- gcvalues[1] = (pointer)FillSolid;
- gcmask = GCForeground|GCFillStyle;
- }
- else
- {
- gcvalues[0] = (pointer)FillTiled;
- gcvalues[1] = (pointer) background.pixmap;
- gcmask = GCFillStyle|GCTile;
- }
- gcvalues[2] = (pointer)(long)(ts_x_origin - pBackingStore->x);
- gcvalues[3] = (pointer)(long)(ts_y_origin - pBackingStore->y);
- gcmask |= GCTileStipXOrigin|GCTileStipYOrigin;
- DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE);
- ValidateGC((DrawablePtr)pBackingStore->pBackingPixmap, pGC);
-
- /*
- * Figure out the array of rectangles to fill and fill them with
- * PolyFillRect in the proper mode, as set in the GC above.
- */
- numRects = REGION_NUM_RECTS(pRgn);
- rects = (xRectangle *)ALLOCATE_LOCAL(numRects*sizeof(xRectangle));
-
- if (rects)
- {
- for (i = 0, pBox = REGION_RECTS(pRgn);
- i < numRects;
- i++, pBox++)
- {
- rects[i].x = pBox->x1 - pBackingStore->x;
- rects[i].y = pBox->y1 - pBackingStore->y;
- rects[i].width = pBox->x2 - pBox->x1;
- rects[i].height = pBox->y2 - pBox->y1;
- }
- (* pGC->ops->PolyFillRect) (
- (DrawablePtr)pBackingStore->pBackingPixmap,
- pGC, numRects, rects);
- DEALLOCATE_LOCAL(rects);
- }
- FreeScratchGC(pGC);
- }
- }
-
- if (!generateExposures)
- {
- REGION_DESTROY(pScreen, pRgn);
- pRgn = NULL;
- }
- else
- {
- /*
- * result must be screen relative, but is currently
- * drawable relative.
- */
- REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x,
- pWin->drawable.y);
- }
- }
- else
- {
- REGION_DESTROY( pScreen, pRgn);
- pRgn = NULL;
- }
- return pRgn;
-}
-
-static void
-miBSClearBackingRegion (pWin, pRgn)
- WindowPtr pWin;
- RegionPtr pRgn;
-{
- BoxPtr pBox;
- int i;
-
- i = REGION_NUM_RECTS(pRgn);
- pBox = REGION_RECTS(pRgn);
- while (i--)
- {
- (void) miBSClearBackingStore(pWin, pBox->x1, pBox->y1,
- pBox->x2 - pBox->x1,
- pBox->y2 - pBox->y1,
- FALSE);
- pBox++;
- }
-}
-
-/*
- * fill a region of the destination with virtual bits
- *
- * pRgn is to be translated by (x,y)
- */
-
-static void
-miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask)
- DrawablePtr pDrawable;
- GCPtr pGC;
- RegionPtr pRgn;
- int x, y;
- int state;
- PixUnion pixunion;
- unsigned long planeMask;
-{
- int i;
- BITS32 gcmask;
- pointer gcval[5];
- xRectangle *pRect;
- BoxPtr pBox;
- WindowPtr pWin;
- int numRects;
-
- if (state == None)
- return;
- numRects = REGION_NUM_RECTS(pRgn);
- pRect = (xRectangle *)ALLOCATE_LOCAL(numRects * sizeof(xRectangle));
- if (!pRect)
- return;
- pWin = 0;
- if (pDrawable->type != DRAWABLE_PIXMAP)
- {
- pWin = (WindowPtr) pDrawable;
- if (!pWin->backStorage)
- pWin = 0;
- }
- i = 0;
- gcmask = 0;
- gcval[i++] = (pointer)planeMask;
- gcmask |= GCPlaneMask;
- if (state == BackgroundPixel)
- {
- if (pGC->fgPixel != pixunion.pixel)
- {
- gcval[i++] = (pointer)pixunion.pixel;
- gcmask |= GCForeground;
- }
- if (pGC->fillStyle != FillSolid)
- {
- gcval[i++] = (pointer)FillSolid;
- gcmask |= GCFillStyle;
- }
- }
- else
- {
- if (pGC->fillStyle != FillTiled)
- {
- gcval[i++] = (pointer)FillTiled;
- gcmask |= GCFillStyle;
- }
- if (pGC->tileIsPixel || pGC->tile.pixmap != pixunion.pixmap)
- {
- gcval[i++] = (pointer)pixunion.pixmap;
- gcmask |= GCTile;
- }
- if (pGC->patOrg.x != x)
- {
- gcval[i++] = (pointer)(long)x;
- gcmask |= GCTileStipXOrigin;
- }
- if (pGC->patOrg.y != y)
- {
- gcval[i++] = (pointer)(long)y;
- gcmask |= GCTileStipYOrigin;
- }
- }
- if (gcmask)
- DoChangeGC (pGC, gcmask, (XID *)gcval, 1);
-
- if (pWin)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
-
- if (pDrawable->serialNumber != pGC->serialNumber)
- ValidateGC (pDrawable, pGC);
-
- pBox = REGION_RECTS(pRgn);
- for (i = numRects; --i >= 0; pBox++, pRect++)
- {
- pRect->x = pBox->x1 + x;
- pRect->y = pBox->y1 + y;
- pRect->width = pBox->x2 - pBox->x1;
- pRect->height = pBox->y2 - pBox->y1;
- }
- pRect -= numRects;
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, numRects, pRect);
- if (pWin)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing);
- DEALLOCATE_LOCAL (pRect);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSAllocate --
- * Create and install backing store info for a window
- *
- *-----------------------------------------------------------------------
- */
-
-static void
-miBSAllocate(pWin)
- WindowPtr pWin;
-{
- register miBSWindowPtr pBackingStore;
- register ScreenPtr pScreen;
-
- if (pWin->drawable.pScreen->backingStoreSupport == NotUseful)
- return;
- pScreen = pWin->drawable.pScreen;
- if (!(pBackingStore = (miBSWindowPtr)pWin->backStorage))
- {
-
- pBackingStore = (miBSWindowPtr)xalloc(sizeof(miBSWindowRec));
- if (!pBackingStore)
- return;
-
- pBackingStore->pBackingPixmap = NullPixmap;
- pBackingStore->x = 0;
- pBackingStore->y = 0;
- REGION_NULL( pScreen, &pBackingStore->SavedRegion);
- pBackingStore->viewable = (char)pWin->viewable;
- pBackingStore->status = StatusNoPixmap;
- pBackingStore->backgroundState = None;
- pWin->backStorage = (pointer) pBackingStore;
- }
-
- /*
- * Now want to initialize the backing pixmap and SavedRegion if
- * necessary. The initialization consists of finding all the
- * currently-obscured regions, by taking the inverse of the window's
- * clip list, storing the result in SavedRegion, and exposing those
- * areas of the window.
- */
-
- if (pBackingStore->status == StatusNoPixmap &&
- ((pWin->backingStore == WhenMapped && pWin->viewable) ||
- (pWin->backingStore == Always)))
- {
- BoxRec box;
- RegionPtr pSavedRegion;
-
- pSavedRegion = &pBackingStore->SavedRegion;
-
- box.x1 = pWin->drawable.x;
- box.x2 = box.x1 + (int) pWin->drawable.width;
- box.y1 = pWin->drawable.y;
- box.y2 = pWin->drawable.y + (int) pWin->drawable.height;
-
- REGION_INVERSE( pScreen, pSavedRegion, &pWin->clipList, &box);
- REGION_TRANSLATE( pScreen, pSavedRegion,
- -pWin->drawable.x,
- -pWin->drawable.y);
-#ifdef SHAPE
- if (wBoundingShape (pWin))
- REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion,
- wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion,
- wClipShape (pWin));
-#endif
- /* if window is already on-screen, assume it has been drawn to */
- if (pWin->viewable)
- pBackingStore->status = StatusVDirty;
- miTileVirtualBS (pWin);
-
- /*
- * deliver all the newly available regions
- * as exposure events to the window
- */
-
- miSendExposures(pWin, pSavedRegion, 0, 0);
- }
- else if (!pWin->viewable)
- {
- /*
- * Turn off backing store when we're not supposed to
- * be saving anything
- */
- if (pBackingStore->status != StatusNoPixmap)
- {
- REGION_EMPTY( pScreen, &pBackingStore->SavedRegion);
- miDestroyBSPixmap (pWin);
- }
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSFree --
- * Destroy and free all the stuff associated with the backing-store
- * for the given window.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The backing pixmap and all the regions and GC's are destroyed.
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSFree(pWin)
- WindowPtr pWin;
-{
- miBSWindowPtr pBackingStore;
- register ScreenPtr pScreen;
-
- pScreen = pWin->drawable.pScreen;
-
- pBackingStore = (miBSWindowPtr)pWin->backStorage;
- if (pBackingStore)
- {
- miDestroyBSPixmap (pWin);
-
- REGION_UNINIT( pScreen, &pBackingStore->SavedRegion);
-
- xfree(pBackingStore);
- pWin->backStorage = NULL;
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miResizeBackingStore --
- * Alter the size of the backing pixmap as necessary when the
- * SavedRegion changes size. The contents of the old pixmap are
- * copied/shifted into the new/same pixmap.
- *
- * Results:
- * The new Pixmap is created as necessary.
- *
- * Side Effects:
- * The old pixmap is destroyed.
- *
- *-----------------------------------------------------------------------
- */
-static void
-miResizeBackingStore(
- WindowPtr pWin,
- int dx, /* bits are moving this far */
- int dy, /* bits are moving this far */
- Bool saveBits) /* bits are useful */
-{
- miBSWindowPtr pBackingStore;
- PixmapPtr pBackingPixmap;
- ScreenPtr pScreen;
- GC *pGC;
- BoxPtr extents;
- PixmapPtr pNewPixmap;
- int nx, ny;
- int nw, nh;
-
- pBackingStore = (miBSWindowPtr)(pWin->backStorage);
- pBackingPixmap = pBackingStore->pBackingPixmap;
- if (!pBackingPixmap)
- return;
- pScreen = pWin->drawable.pScreen;
- extents = REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion);
- pNewPixmap = pBackingPixmap;
-
- nw = extents->x2 - extents->x1;
- nh = extents->y2 - extents->y1;
-
- /* the policy here could be more sophisticated */
- if (nw != pBackingPixmap->drawable.width ||
- nh != pBackingPixmap->drawable.height)
- {
- if (!saveBits || !nw || !nh)
- {
- pNewPixmap = NullPixmap;
- pBackingStore->status = StatusNoPixmap;
- }
- else
- {
- pNewPixmap = (PixmapPtr)(*pScreen->CreatePixmap)
- (pScreen,
- nw, nh,
- pWin->drawable.depth);
- if (!pNewPixmap)
- {
-#ifdef BSEAGER
- pBackingStore->status = StatusNoPixmap;
-#else
- pBackingStore->status = StatusBadAlloc;
-#endif
- }
- }
- }
- if (!pNewPixmap)
- {
- pBackingStore->x = 0;
- pBackingStore->y = 0;
- }
- else
- {
- nx = pBackingStore->x - extents->x1 + dx;
- ny = pBackingStore->y - extents->y1 + dy;
- pBackingStore->x = extents->x1;
- pBackingStore->y = extents->y1;
-
- if (saveBits && (pNewPixmap != pBackingPixmap || nx != 0 || ny != 0))
- {
- pGC = GetScratchGC(pNewPixmap->drawable.depth, pScreen);
- if (pGC)
- {
- ValidateGC((DrawablePtr)pNewPixmap, pGC);
- /* if we implement a policy where the pixmap can be larger than
- * the region extents, we might want to optimize this copyarea
- * by only copying the old extents, rather than the entire
- * pixmap
- */
- (*pGC->ops->CopyArea)((DrawablePtr)pBackingPixmap,
- (DrawablePtr)pNewPixmap, pGC,
- 0, 0,
- pBackingPixmap->drawable.width,
- pBackingPixmap->drawable.height,
- nx, ny);
- FreeScratchGC(pGC);
- }
- }
- }
- /* SavedRegion is used in the backingGC clip; force an update */
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- if (pNewPixmap != pBackingPixmap)
- {
- (* pScreen->DestroyPixmap)(pBackingPixmap);
- pBackingStore->pBackingPixmap = pNewPixmap;
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSSaveDoomedAreas --
- * Saved the areas of the given window that are about to be
- * obscured. If the window has moved, pObscured is expected to
- * be at the new screen location and (dx,dy) is expected to be the offset
- * to the window's previous location.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The region is copied from the screen into pBackingPixmap and
- * SavedRegion is updated.
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSSaveDoomedAreas(pWin, pObscured, dx, dy)
- register WindowPtr pWin;
- RegionPtr pObscured;
- int dx, dy;
-{
- miBSWindowPtr pBackingStore;
- ScreenPtr pScreen;
- int x, y;
-
- pBackingStore = (miBSWindowPtr)pWin->backStorage;
- pScreen = pWin->drawable.pScreen;
-
- /*
- * If the window isn't realized, it's being unmapped, thus we don't
- * want to save anything if backingStore isn't Always.
- */
- if (!pWin->realized)
- {
- pBackingStore->viewable = (char)pWin->viewable;
- if (pWin->backingStore != Always)
- {
- REGION_EMPTY( pScreen, &pBackingStore->SavedRegion);
- miDestroyBSPixmap (pWin);
- return;
- }
- if (pBackingStore->status == StatusBadAlloc)
- pBackingStore->status = StatusNoPixmap;
- }
-
- /* Don't even pretend to save anything for a virtual background None */
- if ((pBackingStore->status == StatusVirtual) &&
- (pBackingStore->backgroundState == None))
- return;
-
- if (REGION_NOTEMPTY(pScreen, pObscured))
- {
- BoxRec oldExtents;
- x = pWin->drawable.x;
- y = pWin->drawable.y;
- REGION_TRANSLATE(pScreen, pObscured, -x, -y);
- oldExtents = *REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion);
- REGION_UNION( pScreen, &pBackingStore->SavedRegion,
- &pBackingStore->SavedRegion,
- pObscured);
- /*
- * only save the bits if we've actually
- * started using backing store
- */
- if (pBackingStore->status != StatusVirtual)
- {
- if (!pBackingStore->pBackingPixmap)
- miCreateBSPixmap (pWin, &oldExtents);
- else
- miResizeBackingStore(pWin, 0, 0, TRUE);
-
- if (pBackingStore->pBackingPixmap) {
- if (pBackingStore->x | pBackingStore->y)
- {
- REGION_TRANSLATE( pScreen, pObscured,
- -pBackingStore->x,
- -pBackingStore->y);
- x += pBackingStore->x;
- y += pBackingStore->y;
- }
- (* pScreen->BackingStoreFuncs.SaveAreas)
- (pBackingStore->pBackingPixmap, pObscured,
- x - dx, y - dy, pWin);
- }
- }
- REGION_TRANSLATE(pScreen, pObscured, x, y);
- }
- else
- {
- if (REGION_BROKEN (pScreen, pObscured))
- {
- REGION_EMPTY( pScreen, &pBackingStore->SavedRegion);
- miDestroyBSPixmap (pWin);
- return;
- }
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSRestoreAreas --
- * Restore areas from backing-store that are no longer obscured.
- * expects prgnExposed to contain a screen-relative area.
- *
- * Results:
- * The region to generate exposure events on (which may be
- * different from the region to paint).
- *
- * Side Effects:
- * Areas are copied from pBackingPixmap to the screen. prgnExposed
- * is altered to contain the region that could not be restored from
- * backing-store.
- *
- * Notes:
- * This is called before sending any exposure events to the client,
- * and so might be called if the window has grown. Changing the backing
- * pixmap doesn't require revalidating the backingGC because the
- * client's next output request will result in a call to ValidateGC,
- * since the window clip region has changed, which will in turn call
- * miValidateBackingStore.
- *-----------------------------------------------------------------------
- */
-static RegionPtr
-miBSRestoreAreas(pWin, prgnExposed)
- register WindowPtr pWin;
- RegionPtr prgnExposed;
-{
- PixmapPtr pBackingPixmap;
- miBSWindowPtr pBackingStore;
- RegionPtr prgnSaved;
- RegionPtr prgnRestored;
- register ScreenPtr pScreen;
- RegionPtr exposures = prgnExposed;
-
- pScreen = pWin->drawable.pScreen;
- pBackingStore = (miBSWindowPtr)pWin->backStorage;
- pBackingPixmap = pBackingStore->pBackingPixmap;
-
- prgnSaved = &pBackingStore->SavedRegion;
-
- if (pBackingStore->status == StatusContents)
- {
- REGION_TRANSLATE(pScreen, prgnSaved, pWin->drawable.x,
- pWin->drawable.y);
-
- prgnRestored = REGION_CREATE( pScreen, (BoxPtr)NULL, 1);
- REGION_INTERSECT( pScreen, prgnRestored, prgnExposed, prgnSaved);
-
- /*
- * Since prgnExposed is no longer obscured, we no longer
- * will have a valid copy of it in backing-store, but there is a valid
- * copy of it on screen, so subtract the area we just restored from
- * from the area to be exposed.
- */
-
- if (REGION_NOTEMPTY( pScreen, prgnRestored))
- {
- REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed);
- REGION_SUBTRACT( pScreen, prgnExposed, prgnExposed, prgnRestored);
-
- /*
- * Do the actual restoration
- */
- (* pScreen->BackingStoreFuncs.RestoreAreas) (pBackingPixmap,
- prgnRestored,
- pWin->drawable.x + pBackingStore->x,
- pWin->drawable.y + pBackingStore->y,
- pWin);
- /*
- * if the saved region is completely empty, dispose of the
- * backing pixmap, otherwise, retranslate the saved
- * region to window relative
- */
-
- if (REGION_NOTEMPTY(pScreen, prgnSaved))
- {
- REGION_TRANSLATE(pScreen, prgnSaved,
- -pWin->drawable.x,
- -pWin->drawable.y);
- miResizeBackingStore(pWin, 0, 0, TRUE);
- }
- else
- miDestroyBSPixmap (pWin);
- }
- else
- REGION_TRANSLATE(pScreen, prgnSaved,
- -pWin->drawable.x, -pWin->drawable.y);
- REGION_DESTROY( pScreen, prgnRestored);
-
- }
- else if ((pBackingStore->status == StatusVirtual) ||
- (pBackingStore->status == StatusVDirty))
- {
- REGION_TRANSLATE(pScreen, prgnSaved,
- pWin->drawable.x, pWin->drawable.y);
- exposures = REGION_CREATE( pScreen, NullBox, 1);
- if (SameBackground (pBackingStore->backgroundState,
- pBackingStore->background,
- pWin->backgroundState,
- pWin->background))
- {
- REGION_SUBTRACT( pScreen, exposures, prgnExposed, prgnSaved);
- }
- else
- {
- miTileVirtualBS(pWin);
-
- /* we need to expose all we have (virtually) retiled */
- REGION_UNION( pScreen, exposures, prgnExposed, prgnSaved);
- }
- REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed);
- REGION_TRANSLATE(pScreen, prgnSaved,
- -pWin->drawable.x, -pWin->drawable.y);
- }
- else if (pWin->viewable && !pBackingStore->viewable &&
- pWin->backingStore != Always)
- {
- /*
- * The window was just mapped and nothing has been saved in
- * backing-store from the last time it was mapped. We want to capture
- * any output to regions that are already obscured but there are no
- * bits to snag off the screen, so we initialize things just as we did
- * in miBSAllocate, above.
- */
- BoxRec box;
-
- prgnSaved = &pBackingStore->SavedRegion;
-
- box.x1 = pWin->drawable.x;
- box.x2 = box.x1 + (int) pWin->drawable.width;
- box.y1 = pWin->drawable.y;
- box.y2 = box.y1 + (int) pWin->drawable.height;
-
- REGION_INVERSE( pScreen, prgnSaved, &pWin->clipList, &box);
- REGION_TRANSLATE( pScreen, prgnSaved,
- -pWin->drawable.x,
- -pWin->drawable.y);
-#ifdef SHAPE
- if (wBoundingShape (pWin))
- REGION_INTERSECT(pScreen, prgnSaved, prgnSaved,
- wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_INTERSECT(pScreen, prgnSaved, prgnSaved,
- wClipShape (pWin));
-#endif
- miTileVirtualBS(pWin);
-
- exposures = REGION_CREATE( pScreen, &box, 1);
- }
- pBackingStore->viewable = (char)pWin->viewable;
- return exposures;
-}
-
-
-/*-
- *-----------------------------------------------------------------------
- * miBSTranslateBackingStore --
- * Shift the backing-store in the given direction. Called when bit
- * gravity is shifting things around.
- *
- * Results:
- * An occluded region of the window which should be sent exposure events.
- * This region should be in absolute coordinates (i.e. include
- * new window position).
- *
- * Side Effects:
- * If the window changed size as well as position, the backing pixmap
- * is resized. The contents of the backing pixmap are shifted
- *
- * Warning:
- * Bob and I have rewritten this routine quite a few times, each
- * time it gets a few more cases correct, and introducing some
- * interesting bugs. Naturally, I think the code is correct this
- * time.
- *
- * Let me try to explain what this routine is for:
- *
- * It's called from SlideAndSizeWindow whenever a window
- * with backing store is resized. There are two separate
- * possibilities:
- *
- * a) The window has ForgetGravity
- *
- * In this case, windx, windy will be 0 and oldClip will
- * be NULL. This indicates that all of the window contents
- * currently saved offscreen should be discarded, and the
- * entire window exposed. TranslateBackingStore, then, should
- * prepare a completely new backing store region based on the
- * new window clipList and return that region for exposure.
- *
- * b) The window has some other gravity
- *
- * In this case, windx, windy will be set to the distance
- * that the bits should move within the window. oldClip
- * will be set to the old visible portion of the window.
- * TranslateBackingStore, then, should adjust the backing
- * store to accommodate the portion of the existing backing
- * store bits which coorespond to backing store bits which
- * will still be occluded in the new configuration. oldx,oldy
- * are set to the old position of the window on the screen.
- *
- * Furthermore, in this case any contents of the screen which
- * are about to become occluded should be fetched from the screen
- * and placed in backing store. This is to avoid the eventual
- * occlusion by the win gravity shifting the child window bits around
- * on top of this window, and potentially losing information
- *
- * It's also called from SetShape, but I think (he says not
- * really knowing for sure) that this code will even work
- * in that case.
- *-----------------------------------------------------------------------
- */
-
-static RegionPtr
-miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy)
- WindowPtr pWin;
- int windx; /* bit translation distance in window */
- int windy;
- RegionPtr oldClip; /* Region being copied */
- int oldx; /* old window position */
- int oldy;
-{
- register miBSWindowPtr pBackingStore;
- register RegionPtr pSavedRegion;
- register RegionPtr newSaved, doomed;
- register ScreenPtr pScreen;
- BoxRec extents;
- int scrdx; /* bit translation distance on screen */
- int scrdy;
- int dx; /* distance window moved on screen */
- int dy;
-
- pScreen = pWin->drawable.pScreen;
- pBackingStore = (miBSWindowPtr)(pWin->backStorage);
- if ((pBackingStore->status == StatusNoPixmap) ||
- (pBackingStore->status == StatusBadAlloc))
- return NullRegion;
-
- /*
- * Compute the new saved region
- */
-
- newSaved = REGION_CREATE( pScreen, NullBox, 1);
- extents.x1 = pWin->drawable.x;
- extents.x2 = pWin->drawable.x + (int) pWin->drawable.width;
- extents.y1 = pWin->drawable.y;
- extents.y2 = pWin->drawable.y + (int) pWin->drawable.height;
- REGION_INVERSE( pScreen, newSaved, &pWin->clipList, &extents);
-
- REGION_TRANSLATE( pScreen, newSaved,
- -pWin->drawable.x, -pWin->drawable.y);
-#ifdef SHAPE
- if (wBoundingShape (pWin) || wClipShape (pWin)) {
- if (wBoundingShape (pWin))
- REGION_INTERSECT( pScreen, newSaved, newSaved,
- wBoundingShape (pWin));
- if (wClipShape (pWin))
- REGION_INTERSECT( pScreen, newSaved, newSaved, wClipShape (pWin));
- }
-#endif
-
- pSavedRegion = &pBackingStore->SavedRegion;
-
- /* now find any visible areas we can save from the screen */
- /* and then translate newSaved to old local coordinates */
- if (oldClip)
- {
- /* bit gravity makes things virtually too hard, punt */
- if (((windx != 0) || (windy != 0)) &&
- (pBackingStore->status != StatusContents))
- miCreateBSPixmap(pWin, NullBox);
-
- /*
- * The window is moving this far on the screen
- */
- dx = pWin->drawable.x - oldx;
- dy = pWin->drawable.y - oldy;
- /*
- * The bits will be moving on the screen by the
- * amount the window is moving + the amount the
- * bits are moving within the window
- */
- scrdx = windx + dx;
- scrdy = windy + dy;
-
- /*
- * intersect at old bit position to discover the
- * bits on the screen which can be put into the
- * new backing store
- */
- REGION_TRANSLATE( pScreen, oldClip, windx - oldx, windy - oldy);
- doomed = REGION_CREATE( pScreen, NullBox, 1);
- REGION_INTERSECT( pScreen, doomed, oldClip, newSaved);
- REGION_TRANSLATE( pScreen, oldClip, oldx - windx, oldy - windy);
-
- /*
- * Translate the old saved region to the position in the
- * window where it will appear to be
- */
- REGION_TRANSLATE( pScreen, pSavedRegion, windx, windy);
-
- /*
- * Add the old saved region to the new saved region, so
- * that calls to RestoreAreas will be able to fetch those
- * bits back
- */
- REGION_UNION( pScreen, newSaved, newSaved, pSavedRegion);
-
- /*
- * Swap the new saved region into the window
- */
- {
- RegionRec tmp;
-
- tmp = *pSavedRegion;
- *pSavedRegion = *newSaved;
- *newSaved = tmp;
- }
- miResizeBackingStore (pWin, windx, windy, TRUE);
-
- /*
- * Compute the newly enabled region
- * of backing store. This region will be
- * set to background in the backing pixmap and
- * sent as exposure events to the client.
- */
- REGION_SUBTRACT( pScreen, newSaved, pSavedRegion, newSaved);
-
- /*
- * Fetch bits which will be obscured from
- * the screen
- */
- if (REGION_NOTEMPTY( pScreen, doomed))
- {
- /*
- * Don't clear regions which have bits on the
- * screen
- */
- REGION_SUBTRACT( pScreen, newSaved, newSaved, doomed);
-
- /*
- * Make the region to SaveDoomedAreas absolute, instead
- * of window relative.
- */
- REGION_TRANSLATE( pScreen, doomed,
- pWin->drawable.x, pWin->drawable.y);
- (* pScreen->SaveDoomedAreas) (pWin, doomed, scrdx, scrdy);
- }
-
- REGION_DESTROY(pScreen, doomed);
-
- /*
- * and clear whatever there is that's new
- */
- if (REGION_NOTEMPTY( pScreen, newSaved))
- {
- miBSClearBackingRegion (pWin, newSaved);
- /*
- * Make the exposed region absolute
- */
- REGION_TRANSLATE(pScreen, newSaved,
- pWin->drawable.x,
- pWin->drawable.y);
- }
- else
- {
- REGION_DESTROY(pScreen, newSaved);
- newSaved = NullRegion;
- }
- }
- else
- {
- /*
- * ForgetGravity: just reset backing store and
- * expose the whole mess
- */
- REGION_COPY( pScreen, pSavedRegion, newSaved);
- REGION_TRANSLATE( pScreen, newSaved,
- pWin->drawable.x, pWin->drawable.y);
-
- miResizeBackingStore (pWin, 0, 0, FALSE);
- (void) miBSClearBackingStore (pWin, 0, 0, 0, 0, FALSE);
- }
-
- return newSaved;
-}
-
-/*
- * Inform the backing store layer that you are about to validate
- * a gc with a window, and that subsequent output to the window
- * is (or is not) guaranteed to be already clipped to the visible
- * regions of the window.
- */
-
-static void
-miBSDrawGuarantee (pWin, pGC, guarantee)
- WindowPtr pWin;
- GCPtr pGC;
- int guarantee;
-{
- miBSGCPtr pPriv;
-
- if (pWin->backStorage)
- {
- pPriv = (miBSGCPtr)pGC->devPrivates[miBSGCIndex].ptr;
- if (!pPriv)
- (void) miBSCreateGCPrivate (pGC);
- pPriv = (miBSGCPtr)pGC->devPrivates[miBSGCIndex].ptr;
- if (pPriv)
- {
- /*
- * XXX KLUDGE ALERT
- *
- * when the GC is Cheap pPriv will point
- * at some device's gc func structure. guarantee
- * will point at the ChangeGC entry of that struct
- * and will never match a valid guarantee value.
- */
- switch (pPriv->guarantee)
- {
- case GuaranteeNothing:
- case GuaranteeVisBack:
- pPriv->guarantee = guarantee;
- break;
- }
- }
- }
-}
-
-#define noBackingCopy (GCGraphicsExposures|GCClipXOrigin|GCClipYOrigin| \
- GCClipMask|GCSubwindowMode| \
- GCTileStipXOrigin|GCTileStipYOrigin)
-
-/*-
- *-----------------------------------------------------------------------
- * miBSValidateGC --
- * Wrapper around output-library's ValidateGC routine
- *
- * Results:
- * None.
- *
- * Side Effects:
- *
- * Notes:
- * The idea here is to perform several functions:
- * - All the output calls must be intercepted and routed to
- * backing-store as necessary.
- * - pGC in the window's devBackingStore must be set up with the
- * clip list appropriate for writing to pBackingPixmap (i.e.
- * the inverse of the window's clipList intersected with the
- * clientClip of the GC). Since the destination for this GC is
- * a pixmap, it is sufficient to set the clip list as its
- * clientClip.
- *-----------------------------------------------------------------------
- */
-
-static void
-miBSValidateGC (pGC, stateChanges, pDrawable)
- GCPtr pGC;
- unsigned long stateChanges;
- DrawablePtr pDrawable;
-{
- GCPtr pBackingGC;
- miBSWindowPtr pWindowPriv = NULL;
- miBSGCPtr pPriv;
- WindowPtr pWin;
- int lift_functions;
- RegionPtr backingCompositeClip = NULL;
-
- if (pDrawable->type != DRAWABLE_PIXMAP)
- {
- pWin = (WindowPtr) pDrawable;
- pWindowPriv = (miBSWindowPtr) pWin->backStorage;
- lift_functions = (pWindowPriv == (miBSWindowPtr) NULL);
- }
- else
- {
- pWin = (WindowPtr) NULL;
- lift_functions = TRUE;
- }
-
- pPriv = (miBSGCPtr)pGC->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGC, pPriv);
-
- (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable);
-
- /*
- * rewrap funcs and ops as Validate may have changed them
- */
-
- pPriv->wrapFuncs = pGC->funcs;
- pPriv->wrapOps = pGC->ops;
-
- if (!lift_functions && ((pPriv->guarantee == GuaranteeVisBack) ||
- (pWindowPriv->status == StatusNoPixmap) ||
- (pWindowPriv->status == StatusBadAlloc)))
- lift_functions = TRUE;
-
- /*
- * check to see if a new backingCompositeClip region must
- * be generated
- */
-
- if (!lift_functions &&
- ((pDrawable->serialNumber != pPriv->serialNumber) ||
- (stateChanges&(GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode))))
- {
- if (REGION_NOTEMPTY(pGC->pScreen, &pWindowPriv->SavedRegion))
- {
- backingCompositeClip = REGION_CREATE(pGC->pScreen, NULL, 1);
- if ((pGC->clientClipType == CT_NONE) ||
- (pGC->clientClipType == CT_PIXMAP))
- {
- REGION_COPY(pGC->pScreen, backingCompositeClip,
- &pWindowPriv->SavedRegion);
- }
- else
- {
- /*
- * Make a new copy of the client clip, translated to
- * its proper origin.
- */
-
- REGION_COPY(pGC->pScreen, backingCompositeClip,
- pGC->clientClip);
- REGION_TRANSLATE(pGC->pScreen, backingCompositeClip,
- pGC->clipOrg.x,
- pGC->clipOrg.y);
- REGION_INTERSECT(pGC->pScreen, backingCompositeClip,
- backingCompositeClip,
- &pWindowPriv->SavedRegion);
- }
- if (pGC->subWindowMode == IncludeInferiors)
- {
- RegionPtr translatedClip;
-
- /* XXX
- * any output in IncludeInferiors mode will not
- * be redirected to Inferiors backing store. This
- * can be fixed only at great cost to the shadow routines.
- */
- translatedClip = NotClippedByChildren (pWin);
- REGION_TRANSLATE(pGC->pScreen, translatedClip,
- -pDrawable->x,
- -pDrawable->y);
- REGION_SUBTRACT(pGC->pScreen, backingCompositeClip,
- backingCompositeClip, translatedClip);
- REGION_DESTROY(pGC->pScreen, translatedClip);
- }
- if (!REGION_NOTEMPTY(pGC->pScreen, backingCompositeClip))
- lift_functions = TRUE;
- }
- else
- {
- lift_functions = TRUE;
- }
-
- /* Reset the status when drawing to an unoccluded window so that
- * future SaveAreas will actually copy bits from the screen. Note that
- * output to root window in IncludeInferiors mode will not cause this
- * to change. This causes all transient graphics by the window
- * manager to the root window to not enable backing store.
- */
- if (lift_functions && (pWindowPriv->status == StatusVirtual) &&
- (pWin->parent || pGC->subWindowMode != IncludeInferiors))
- pWindowPriv->status = StatusVDirty;
- }
-
- /*
- * if no backing store has been allocated, and it's needed,
- * create it now.
- */
-
- if (!lift_functions && !pWindowPriv->pBackingPixmap)
- {
- miCreateBSPixmap (pWin, NullBox);
- if (!pWindowPriv->pBackingPixmap)
- lift_functions = TRUE;
- }
-
- /*
- * create the backing GC if needed, lift functions
- * if the creation fails
- */
-
- if (!lift_functions && !pPriv->pBackingGC)
- {
- int status;
- XID noexpose = xFalse;
-
- /* We never want ops with the backingGC to generate GraphicsExpose */
- pBackingGC = CreateGC ((DrawablePtr)pWindowPriv->pBackingPixmap,
- GCGraphicsExposures, &noexpose, &status);
- if (status != Success)
- lift_functions = TRUE;
- else
- pPriv->pBackingGC = pBackingGC;
- }
-
- pBackingGC = pPriv->pBackingGC;
-
- pPriv->stateChanges |= stateChanges;
-
- if (lift_functions)
- {
- if (backingCompositeClip)
- REGION_DESTROY( pGC->pScreen, backingCompositeClip);
-
- /* unwrap the GC again */
- miBSDestroyGCPrivate (pGC);
-
- return;
- }
-
- /*
- * the rest of this function gets the pBackingGC
- * into shape for possible draws
- */
-
- pPriv->stateChanges &= ~noBackingCopy;
- if (pPriv->stateChanges)
- CopyGC(pGC, pBackingGC, pPriv->stateChanges);
- if ((pGC->patOrg.x - pWindowPriv->x) != pBackingGC->patOrg.x ||
- (pGC->patOrg.y - pWindowPriv->y) != pBackingGC->patOrg.y)
- {
- XID vals[2];
- vals[0] = pGC->patOrg.x - pWindowPriv->x;
- vals[1] = pGC->patOrg.y - pWindowPriv->y;
- DoChangeGC(pBackingGC, GCTileStipXOrigin|GCTileStipYOrigin, vals, 0);
- }
- pPriv->stateChanges = 0;
-
- if (backingCompositeClip)
- {
- XID vals[2];
-
- if (pGC->clientClipType == CT_PIXMAP)
- {
- (*pBackingGC->funcs->CopyClip)(pBackingGC, pGC);
- REGION_TRANSLATE(pGC->pScreen, backingCompositeClip,
- -pGC->clipOrg.x, -pGC->clipOrg.y);
- vals[0] = pGC->clipOrg.x - pWindowPriv->x;
- vals[1] = pGC->clipOrg.y - pWindowPriv->y;
- DoChangeGC(pBackingGC, GCClipXOrigin|GCClipYOrigin, vals, 0);
- (* pGC->pScreen->BackingStoreFuncs.SetClipmaskRgn)
- (pBackingGC, backingCompositeClip);
- REGION_DESTROY( pGC->pScreen, backingCompositeClip);
- }
- else
- {
- vals[0] = -pWindowPriv->x;
- vals[1] = -pWindowPriv->y;
- DoChangeGC(pBackingGC, GCClipXOrigin|GCClipYOrigin, vals, 0);
- (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION, backingCompositeClip, 0);
- }
- pPriv->serialNumber = pDrawable->serialNumber;
- }
-
- if (pWindowPriv->pBackingPixmap->drawable.serialNumber
- != pBackingGC->serialNumber)
- {
- ValidateGC((DrawablePtr)pWindowPriv->pBackingPixmap, pBackingGC);
- }
-
- if (pBackingGC->clientClip == 0)
- ErrorF ("backing store clip list nil");
-
- FUNC_EPILOGUE (pGC, pPriv);
-}
-
-static void
-miBSChangeGC (pGC, mask)
- GCPtr pGC;
- unsigned long mask;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pGC)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGC, pPriv);
-
- (*pGC->funcs->ChangeGC) (pGC, mask);
-
- FUNC_EPILOGUE (pGC, pPriv);
-}
-
-static void
-miBSCopyGC (pGCSrc, mask, pGCDst)
- GCPtr pGCSrc, pGCDst;
- unsigned long mask;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pGCDst)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGCDst, pPriv);
-
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
-
- FUNC_EPILOGUE (pGCDst, pPriv);
-}
-
-static void
-miBSDestroyGC (pGC)
- GCPtr pGC;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pGC)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGC, pPriv);
-
- if (pPriv->pBackingGC)
- FreeGC(pPriv->pBackingGC, (GContext)0);
-
- (*pGC->funcs->DestroyGC) (pGC);
-
- FUNC_EPILOGUE (pGC, pPriv);
-
- xfree(pPriv);
-}
-
-static void
-miBSChangeClip(pGC, type, pvalue, nrects)
- GCPtr pGC;
- int type;
- pointer pvalue;
- int nrects;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pGC)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGC, pPriv);
-
- (* pGC->funcs->ChangeClip)(pGC, type, pvalue, nrects);
-
- FUNC_EPILOGUE (pGC, pPriv);
-}
-
-static void
-miBSCopyClip(pgcDst, pgcSrc)
- GCPtr pgcDst, pgcSrc;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pgcDst)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pgcDst, pPriv);
-
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-
- FUNC_EPILOGUE (pgcDst, pPriv);
-}
-
-static void
-miBSDestroyClip(pGC)
- GCPtr pGC;
-{
- miBSGCPtr pPriv = (miBSGCPtr) (pGC)->devPrivates[miBSGCIndex].ptr;
-
- FUNC_PROLOGUE (pGC, pPriv);
-
- (* pGC->funcs->DestroyClip)(pGC);
-
- FUNC_EPILOGUE (pGC, pPriv);
-}
-
-static void
-miDestroyBSPixmap (pWin)
- WindowPtr pWin;
-{
- miBSWindowPtr pBackingStore;
- ScreenPtr pScreen;
-
- pScreen = pWin->drawable.pScreen;
- pBackingStore = (miBSWindowPtr) pWin->backStorage;
- if (pBackingStore->pBackingPixmap)
- (* pScreen->DestroyPixmap)(pBackingStore->pBackingPixmap);
- pBackingStore->pBackingPixmap = NullPixmap;
- pBackingStore->x = 0;
- pBackingStore->y = 0;
- if (pBackingStore->backgroundState == BackgroundPixmap)
- (* pScreen->DestroyPixmap)(pBackingStore->background.pixmap);
- pBackingStore->backgroundState = None;
- pBackingStore->status = StatusNoPixmap;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-}
-
-static void
-miTileVirtualBS (pWin)
- WindowPtr pWin;
-{
- miBSWindowPtr pBackingStore;
-
- pBackingStore = (miBSWindowPtr) pWin->backStorage;
- if (pBackingStore->backgroundState == BackgroundPixmap)
- (* pWin->drawable.pScreen->DestroyPixmap)
- (pBackingStore->background.pixmap);
- pBackingStore->backgroundState = pWin->backgroundState;
- pBackingStore->background = pWin->background;
- if (pBackingStore->backgroundState == BackgroundPixmap)
- pBackingStore->background.pixmap->refcnt++;
-
- if (pBackingStore->status != StatusVDirty)
- pBackingStore->status = StatusVirtual;
-
- /*
- * punt parent relative tiles and do it now
- */
- if (pBackingStore->backgroundState == ParentRelative)
- miCreateBSPixmap (pWin, NullBox);
-}
-
-#ifdef DEBUG
-static int BSAllocationsFailed = 0;
-#define FAILEDSIZE 32
-static struct { int w, h; } failedRecord[FAILEDSIZE];
-static int failedIndex;
-#endif
-
-static void
-miCreateBSPixmap (pWin, pExtents)
- WindowPtr pWin;
- BoxPtr pExtents;
-{
- miBSWindowPtr pBackingStore;
- ScreenPtr pScreen;
- PixUnion background;
- char backgroundState = 0;
- BoxPtr extents;
- Bool backSet;
-
- pScreen = pWin->drawable.pScreen;
- pBackingStore = (miBSWindowPtr) pWin->backStorage;
- if (pBackingStore->status == StatusBadAlloc)
- return;
- backSet = ((pBackingStore->status == StatusVirtual) ||
- (pBackingStore->status == StatusVDirty));
-
- extents = REGION_EXTENTS( pScreen, &pBackingStore->SavedRegion);
-
- if (!pBackingStore->pBackingPixmap &&
- extents->x2 != extents->x1 &&
- extents->y2 != extents->y1)
- {
- /* the policy here could be more sophisticated */
- pBackingStore->x = extents->x1;
- pBackingStore->y = extents->y1;
- pBackingStore->pBackingPixmap =
- (PixmapPtr)(* pScreen->CreatePixmap)
- (pScreen,
- extents->x2 - extents->x1,
- extents->y2 - extents->y1,
- pWin->drawable.depth);
- }
- if (!pBackingStore->pBackingPixmap)
- {
-#ifdef DEBUG
- BSAllocationsFailed++;
- /*
- * record failed allocations
- */
- failedRecord[failedIndex].w = pWin->drawable.width;
- failedRecord[failedIndex].h = pWin->drawable.height;
- failedIndex++;
- if (failedIndex == FAILEDSIZE)
- failedIndex = 0;
-#endif
-#ifdef BSEAGER
- pBackingStore->status = StatusNoPixmap;
-#else
- pBackingStore->status = StatusBadAlloc;
-#endif
- return;
- }
-
- pBackingStore->status = StatusContents;
-
- if (backSet)
- {
- backgroundState = pWin->backgroundState;
- background = pWin->background;
-
- pWin->backgroundState = pBackingStore->backgroundState;
- pWin->background = pBackingStore->background;
- if (pWin->backgroundState == BackgroundPixmap)
- pWin->background.pixmap->refcnt++;
- }
-
- if (!pExtents)
- pExtents = extents;
-
- if (pExtents->y1 != pExtents->y2)
- {
- RegionPtr exposed;
-
- exposed = miBSClearBackingStore(pWin,
- pExtents->x1, pExtents->y1,
- pExtents->x2 - pExtents->x1,
- pExtents->y2 - pExtents->y1,
- !backSet);
- if (exposed)
- {
- miSendExposures(pWin, exposed, pWin->drawable.x, pWin->drawable.y);
- REGION_DESTROY( pScreen, exposed);
- }
- }
-
- if (backSet)
- {
- if (pWin->backgroundState == BackgroundPixmap)
- (* pScreen->DestroyPixmap) (pWin->background.pixmap);
- pWin->backgroundState = backgroundState;
- pWin->background = background;
- if (pBackingStore->backgroundState == BackgroundPixmap)
- (* pScreen->DestroyPixmap) (pBackingStore->background.pixmap);
- pBackingStore->backgroundState = None;
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miBSExposeCopy --
- * Handle the restoration of areas exposed by graphics operations.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * prgnExposed has the areas exposed from backing-store removed
- * from it.
- *
- *-----------------------------------------------------------------------
- */
-static void
-miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane)
- WindowPtr pSrc;
- DrawablePtr pDst;
- GCPtr pGC;
- RegionPtr prgnExposed;
- int srcx, srcy;
- int dstx, dsty;
- unsigned long plane;
-{
- RegionRec tempRgn;
- miBSWindowPtr pBackingStore;
- CopyPlaneProcPtr copyProc;
- GCPtr pScratchGC;
- register BoxPtr pBox;
- register int i;
- register int dx, dy;
- BITS32 gcMask;
-
- if (!REGION_NOTEMPTY(pGC->pScreen, prgnExposed))
- return;
- pBackingStore = (miBSWindowPtr)pSrc->backStorage;
-
- if ((pBackingStore->status == StatusNoPixmap) ||
- (pBackingStore->status == StatusBadAlloc))
- return;
-
- REGION_NULL( pGC->pScreen, &tempRgn);
- REGION_INTERSECT( pGC->pScreen, &tempRgn, prgnExposed,
- &pBackingStore->SavedRegion);
- REGION_SUBTRACT( pGC->pScreen, prgnExposed, prgnExposed, &tempRgn);
-
- if (plane != 0) {
- copyProc = pGC->ops->CopyPlane;
- } else {
- copyProc = (CopyPlaneProcPtr)pGC->ops->CopyArea;
- }
-
- dx = dstx - srcx;
- dy = dsty - srcy;
-
- switch (pBackingStore->status) {
- case StatusVirtual:
- case StatusVDirty:
- pScratchGC = GetScratchGC (pDst->depth, pDst->pScreen);
- if (pScratchGC)
- {
- gcMask = 0;
- if (pGC->alu != pScratchGC->alu)
- gcMask = GCFunction;
- if (pGC->planemask != pScratchGC->planemask)
- gcMask |= GCPlaneMask;
- if (gcMask)
- CopyGC (pGC, pScratchGC, gcMask);
- miBSFillVirtualBits (pDst, pScratchGC, &tempRgn, dx, dy,
- (int) pBackingStore->backgroundState,
- pBackingStore->background,
- ~0L);
- FreeScratchGC (pScratchGC);
- }
- break;
- case StatusContents:
- for (i = REGION_NUM_RECTS(&tempRgn), pBox = REGION_RECTS(&tempRgn);
- --i >= 0;
- pBox++)
- {
- (* copyProc) (&(pBackingStore->pBackingPixmap->drawable), pDst, pGC,
- pBox->x1 - pBackingStore->x,
- pBox->y1 - pBackingStore->y,
- pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
- pBox->x1 + dx, pBox->y1 + dy, plane);
- }
- break;
- }
- REGION_UNINIT( pGC->pScreen, &tempRgn);
-}
diff --git a/mi/mibstore.h b/mi/mibstore.h
deleted file mode 100644
index e8f197dbc..000000000
--- a/mi/mibstore.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * mibstore.h --
- * Header file for users of the MI backing-store scheme.
- *
- * Copyright (c) 1987 by the Regents of the University of California
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * "$Xorg: mibstore.h,v 1.3 2000/08/17 19:53:37 cpqbld Exp $
- */
-
-
-/* $XFree86: xc/programs/Xserver/mi/mibstore.h,v 1.5 2001/08/06 20:51:18 dawes Exp $ */
-
-#ifndef _MIBSTORE_H
-#define _MIBSTORE_H
-
-#include "screenint.h"
-
-extern void miInitializeBackingStore(
- ScreenPtr /*pScreen*/
-);
-
-#endif /* _MIBSTORE_H */
diff --git a/mi/mibstorest.h b/mi/mibstorest.h
deleted file mode 100644
index 249b4d4d3..000000000
--- a/mi/mibstorest.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * mibstorest.h
- *
- * internal structure definitions for mi backing store
- */
-
-/* $Xorg: mibstorest.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-
-/* $XFree86: xc/programs/Xserver/mi/mibstorest.h,v 1.5 2001/12/14 20:00:21 dawes Exp $ */
-
-#include "mibstore.h"
-#include "regionstr.h"
-
-/*
- * One of these structures is allocated per GC used with a backing-store
- * drawable.
- */
-
-typedef struct {
- GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures
- * set FALSE and the clientClip set to
- * clip output to the valid regions of the
- * backing pixmap. */
- int guarantee; /* GuaranteeNothing, etc. */
- unsigned long serialNumber; /* clientClip computed time */
- unsigned long stateChanges; /* changes in parent gc since last copy */
- GCOps *wrapOps; /* wrapped ops */
- GCFuncs *wrapFuncs; /* wrapped funcs */
-} miBSGCRec, *miBSGCPtr;
-
-/*
- * one of these structures is allocated per Window with backing store
- */
-
-typedef struct {
- PixmapPtr pBackingPixmap; /* Pixmap for saved areas */
- short x; /* origin of pixmap relative to window */
- short y;
- RegionRec SavedRegion; /* Valid area in pBackingPixmap */
- char viewable; /* Tracks pWin->viewable so SavedRegion may
- * be initialized correctly when the window
- * is first mapped */
- char status; /* StatusNoPixmap, etc. */
- char backgroundState; /* background type */
- PixUnion background; /* background pattern */
-} miBSWindowRec, *miBSWindowPtr;
-
-#define StatusNoPixmap 1 /* pixmap has not been created */
-#define StatusVirtual 2 /* pixmap is virtual, tiled with background */
-#define StatusVDirty 3 /* pixmap is virtual, visiblt has contents */
-#define StatusBadAlloc 4 /* pixmap create failed, do not try again */
-#define StatusContents 5 /* pixmap is created, has valid contents */
-
-typedef struct {
- /*
- * screen func wrappers
- */
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- CreateGCProcPtr CreateGC;
- DestroyWindowProcPtr DestroyWindow;
-} miBSScreenRec, *miBSScreenPtr;
diff --git a/mi/miclipn.c b/mi/miclipn.c
deleted file mode 100644
index 95272c176..000000000
--- a/mi/miclipn.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $Xorg: miclipn.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-/*
-
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/miclipn.c,v 1.4 2001/12/14 20:00:21 dawes Exp $ */
-
-#include "X.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "mi.h"
-
-static void (*clipNotify)(WindowPtr,int,int) = 0;
-static void (*ClipNotifies[MAXSCREENS])(WindowPtr,int,int);
-
-static void
-miClipNotifyWrapper(
- WindowPtr pWin,
- int dx,
- int dy )
-{
- if (clipNotify)
- (*clipNotify)(pWin, dx, dy);
- if (ClipNotifies[pWin->drawable.pScreen->myNum])
- (*ClipNotifies[pWin->drawable.pScreen->myNum])(pWin, dx, dy);
-}
-
-/*
- * miClipNotify --
- * Hook to let DDX request notification when the clipList of
- * a window is recomputed on any screen. For R4 compatibility;
- * better if you wrap the ClipNotify screen proc yourself.
- */
-
-static unsigned long clipGeneration = 0;
-
-void
-miClipNotify (
- void (*func)(
- WindowPtr /* pWin */,
- int /* dx */,
- int /* dy */
- ) )
-{
- int i;
-
- clipNotify = func;
- if (clipGeneration != serverGeneration)
- {
- clipGeneration = serverGeneration;
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ClipNotifies[i] = screenInfo.screens[i]->ClipNotify;
- screenInfo.screens[i]->ClipNotify = miClipNotifyWrapper;
- }
- }
-}
diff --git a/mi/micmap.c b/mi/micmap.c
deleted file mode 100644
index b3e925a09..000000000
--- a/mi/micmap.c
+++ /dev/null
@@ -1,674 +0,0 @@
-/* $XConsortium: cfbcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice appear in all copies and that both that copyright no-
-tice and this permission notice appear in supporting docu-
-mentation, and that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution of the software without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
-ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.11 2001/05/29 22:24:06 dawes Exp $ */
-
-/*
- * This is based on cfbcmap.c. The functions here are useful independently
- * of cfb, which is the reason for including them here. How "mi" these
- * are may be debatable.
- */
-
-
-#include "X.h"
-#include "Xproto.h"
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "globals.h"
-#include "micmap.h"
-
-ColormapPtr miInstalledMaps[MAXSCREENS];
-
-static Bool miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
- int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB, int preferredVis);
-
-miInitVisualsProcPtr miInitVisualsProc = miDoInitVisuals;
-
-int
-miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
- *pmaps = miInstalledMaps[pScreen->myNum]->mid;
- return (1);
-}
-
-void
-miInstallColormap(ColormapPtr pmap)
-{
- int index = pmap->pScreen->myNum;
- ColormapPtr oldpmap = miInstalledMaps[index];
-
- if(pmap != oldpmap)
- {
- /* Uninstall pInstalledMap. No hardware changes required, just
- * notify all interested parties. */
- if(oldpmap != (ColormapPtr)None)
- WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- /* Install pmap */
- miInstalledMaps[index] = pmap;
- WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
-
- }
-}
-
-void
-miUninstallColormap(ColormapPtr pmap)
-{
- int index = pmap->pScreen->myNum;
- ColormapPtr curpmap = miInstalledMaps[index];
-
- if(pmap == curpmap)
- {
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
- RT_COLORMAP);
- (*pmap->pScreen->InstallColormap)(curpmap);
- }
- }
-}
-
-void
-miResolveColor(unsigned short *pred, unsigned short *pgreen,
- unsigned short *pblue, VisualPtr pVisual)
-{
- int shift = 16 - pVisual->bitsPerRGBValue;
- unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1;
-
- if ((pVisual->class | DynamicClass) == GrayScale)
- {
- /* rescale to gray then rgb bits */
- *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
- *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
- }
- else
- {
- /* rescale to rgb bits */
- *pred = ((*pred >> shift) * 65535) / lim;
- *pgreen = ((*pgreen >> shift) * 65535) / lim;
- *pblue = ((*pblue >> shift) * 65535) / lim;
- }
-}
-
-Bool
-miInitializeColormap(ColormapPtr pmap)
-{
- register unsigned i;
- register VisualPtr pVisual;
- unsigned lim, maxent, shift;
-
- pVisual = pmap->pVisual;
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
- shift = 16 - pVisual->bitsPerRGBValue;
- maxent = pVisual->ColormapEntries - 1;
- if (pVisual->class == TrueColor)
- {
- unsigned limr, limg, limb;
-
- limr = pVisual->redMask >> pVisual->offsetRed;
- limg = pVisual->greenMask >> pVisual->offsetGreen;
- limb = pVisual->blueMask >> pVisual->offsetBlue;
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red =
- ((((i * 65535) / limr) >> shift) * 65535) / lim;
- pmap->green[i].co.local.green =
- ((((i * 65535) / limg) >> shift) * 65535) / lim;
- pmap->blue[i].co.local.blue =
- ((((i * 65535) / limb) >> shift) * 65535) / lim;
- }
- }
- else if (pVisual->class == StaticColor)
- {
- unsigned limr, limg, limb;
-
- limr = pVisual->redMask >> pVisual->offsetRed;
- limg = pVisual->greenMask >> pVisual->offsetGreen;
- limb = pVisual->blueMask >> pVisual->offsetBlue;
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red =
- ((((((i & pVisual->redMask) >> pVisual->offsetRed)
- * 65535) / limr) >> shift) * 65535) / lim;
- pmap->red[i].co.local.green =
- ((((((i & pVisual->greenMask) >> pVisual->offsetGreen)
- * 65535) / limg) >> shift) * 65535) / lim;
- pmap->red[i].co.local.blue =
- ((((((i & pVisual->blueMask) >> pVisual->offsetBlue)
- * 65535) / limb) >> shift) * 65535) / lim;
- }
- }
- else if (pVisual->class == StaticGray)
- {
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift)
- * 65535) / lim;
- pmap->red[i].co.local.green = pmap->red[i].co.local.red;
- pmap->red[i].co.local.blue = pmap->red[i].co.local.red;
- }
- }
- return TRUE;
-}
-
-/* When simulating DirectColor on PseudoColor hardware, multiple
- entries of the colormap must be updated
- */
-
-#define AddElement(mask) { \
- pixel = red | green | blue; \
- for (i = 0; i < nresult; i++) \
- if (outdefs[i].pixel == pixel) \
- break; \
- if (i == nresult) \
- { \
- nresult++; \
- outdefs[i].pixel = pixel; \
- outdefs[i].flags = 0; \
- } \
- outdefs[i].flags |= (mask); \
- outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
- outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
- outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
-}
-
-int
-miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs,
- xColorItem *outdefs)
-{
- register int red, green, blue;
- int maxred, maxgreen, maxblue;
- int stepred, stepgreen, stepblue;
- VisualPtr pVisual;
- register int pixel;
- register int nresult;
- register int i;
-
- pVisual = pmap->pVisual;
-
- stepred = 1 << pVisual->offsetRed;
- stepgreen = 1 << pVisual->offsetGreen;
- stepblue = 1 << pVisual->offsetBlue;
- maxred = pVisual->redMask;
- maxgreen = pVisual->greenMask;
- maxblue = pVisual->blueMask;
- nresult = 0;
- for (;ndef--; indefs++)
- {
- if (indefs->flags & DoRed)
- {
- red = indefs->pixel & pVisual->redMask;
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoRed)
- }
- }
- }
- if (indefs->flags & DoGreen)
- {
- green = indefs->pixel & pVisual->greenMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoGreen)
- }
- }
- }
- if (indefs->flags & DoBlue)
- {
- blue = indefs->pixel & pVisual->blueMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- AddElement (DoBlue)
- }
- }
- }
- }
- return nresult;
-}
-
-Bool
-miCreateDefColormap(ScreenPtr pScreen)
-{
-/*
- * In the following sources PC X server vendors may want to delete
- * "_not_tog" from "#ifdef WIN32_not_tog"
- */
-#ifdef WIN32_not_tog
- /*
- * these are the MS-Windows desktop colors, adjusted for X's 16-bit
- * color specifications.
- */
- static xColorItem citems[] = {
- { 0, 0, 0, 0, 0, 0 },
- { 1, 0x8000, 0, 0, 0, 0 },
- { 2, 0, 0x8000, 0, 0, 0 },
- { 3, 0x8000, 0x8000, 0, 0, 0 },
- { 4, 0, 0, 0x8000, 0, 0 },
- { 5, 0x8000, 0, 0x8000, 0, 0 },
- { 6, 0, 0x8000, 0x8000, 0, 0 },
- { 7, 0xc000, 0xc000, 0xc000, 0, 0 },
- { 8, 0xc000, 0xdc00, 0xc000, 0, 0 },
- { 9, 0xa600, 0xca00, 0xf000, 0, 0 },
- { 246, 0xff00, 0xfb00, 0xf000, 0, 0 },
- { 247, 0xa000, 0xa000, 0xa400, 0, 0 },
- { 248, 0x8000, 0x8000, 0x8000, 0, 0 },
- { 249, 0xff00, 0, 0, 0, 0 },
- { 250, 0, 0xff00, 0, 0, 0 },
- { 251, 0xff00, 0xff00, 0, 0, 0 },
- { 252, 0, 0, 0xff00, 0, 0 },
- { 253, 0xff00, 0, 0xff00, 0, 0 },
- { 254, 0, 0xff00, 0xff00, 0, 0 },
- { 255, 0xff00, 0xff00, 0xff00, 0, 0 }
- };
-#define NUM_DESKTOP_COLORS sizeof citems / sizeof citems[0]
- int i;
-#else
- unsigned short zero = 0, ones = 0xFFFF;
-#endif
- Pixel wp, bp;
- VisualPtr pVisual;
- ColormapPtr cmap;
- int alloctype;
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
-
- if (pScreen->rootDepth == 1 || (pVisual->class & DynamicClass))
- alloctype = AllocNone;
- else
- alloctype = AllocAll;
-
- if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
- alloctype, 0) != Success)
- return FALSE;
-
- if (pScreen->rootDepth > 1) {
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
-#ifdef WIN32_not_tog
- for (i = 0; i < NUM_DESKTOP_COLORS; i++) {
- if (AllocColor (cmap,
- &citems[i].red, &citems[i].green, &citems[i].blue,
- &citems[i].pixel, 0) != Success)
- return FALSE;
- }
-#else
- if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
- Success) ||
- (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
- Success))
- return FALSE;
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
-#endif
- }
-
- (*pScreen->InstallColormap)(cmap);
- return TRUE;
-}
-
-/*
- * Default true color bitmasks, should be overridden by
- * driver
- */
-
-#define _RZ(d) ((d + 2) / 3)
-#define _RS(d) 0
-#define _RM(d) ((1 << _RZ(d)) - 1)
-#define _GZ(d) ((d - _RZ(d) + 1) / 2)
-#define _GS(d) _RZ(d)
-#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
-#define _BZ(d) (d - _RZ(d) - _GZ(d))
-#define _BS(d) (_RZ(d) + _GZ(d))
-#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
-#define _CE(d) (1 << _RZ(d))
-
-typedef struct _miVisuals {
- struct _miVisuals *next;
- int depth;
- int bitsPerRGB;
- int visuals;
- int count;
- int preferredCVC;
- Pixel redMask, greenMask, blueMask;
-} miVisualsRec, *miVisualsPtr;
-
-static int miVisualPriority[] = {
- PseudoColor, GrayScale, StaticColor, TrueColor, DirectColor, StaticGray
-};
-
-#define NUM_PRIORITY 6
-
-static miVisualsPtr miVisuals;
-
-void
-miClearVisualTypes()
-{
- miVisualsPtr v;
-
- while ((v = miVisuals)) {
- miVisuals = v->next;
- xfree(v);
- }
-}
-
-
-Bool
-miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
- int preferredCVC,
- Pixel redMask, Pixel greenMask, Pixel blueMask)
-{
- miVisualsPtr new, *prev, v;
- int count;
-
- new = (miVisualsPtr) xalloc (sizeof *new);
- if (!new)
- return FALSE;
- if (!redMask || !greenMask || !blueMask)
- {
- redMask = _RM(depth);
- greenMask = _GM(depth);
- blueMask = _BM(depth);
- }
- new->next = 0;
- new->depth = depth;
- new->visuals = visuals;
- new->bitsPerRGB = bitsPerRGB;
- new->preferredCVC = preferredCVC;
- new->redMask = redMask;
- new->greenMask = greenMask;
- new->blueMask = blueMask;
- count = (visuals >> 1) & 033333333333;
- count = visuals - count - ((count >> 1) & 033333333333);
- count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */
- new->count = count;
- for (prev = &miVisuals; (v = *prev); prev = &v->next);
- *prev = new;
- return TRUE;
-}
-
-Bool
-miSetVisualTypes(int depth, int visuals, int bitsPerRGB, int preferredCVC)
-{
- return miSetVisualTypesAndMasks (depth, visuals, bitsPerRGB,
- preferredCVC, 0, 0, 0);
-}
-
-int
-miGetDefaultVisualMask(int depth)
-{
- if (depth > MAX_PSEUDO_DEPTH)
- return LARGE_VISUALS;
- else if (depth >= MIN_TRUE_DEPTH)
- return ALL_VISUALS;
- else if (depth == 1)
- return StaticGrayMask;
- else
- return SMALL_VISUALS;
-}
-
-static Bool
-miVisualTypesSet (int depth)
-{
- miVisualsPtr visuals;
-
- for (visuals = miVisuals; visuals; visuals = visuals->next)
- if (visuals->depth == depth)
- return TRUE;
- return FALSE;
-}
-
-Bool
-miSetPixmapDepths (void)
-{
- int d, f;
-
- /* Add any unlisted depths from the pixmap formats */
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- d = screenInfo.formats[f].depth;
- if (!miVisualTypesSet (d))
- {
- if (!miSetVisualTypes (d, 0, 0, -1))
- return FALSE;
- }
- }
- return TRUE;
-}
-
-Bool
-miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
- int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB, int preferredVis)
-
-{
- if (miInitVisualsProc)
- return miInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
- rootDepthp, defaultVisp, sizes, bitsPerRGB,
- preferredVis);
- else
- return FALSE;
-}
-
-/*
- * Distance to least significant one bit
- */
-static int
-maskShift (Pixel p)
-{
- int s;
-
- if (!p) return 0;
- s = 0;
- while (!(p & 1))
- {
- s++;
- p >>= 1;
- }
- return s;
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which corespond to
- * the set which can be used with this version of cfb.
- */
-
-static Bool
-miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
- int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
- unsigned long sizes, int bitsPerRGB, int preferredVis)
-{
- int i, j = 0, k;
- VisualPtr visual;
- DepthPtr depth;
- VisualID *vid;
- int d, b;
- int f;
- int ndepth, nvisual;
- int nvtype;
- int vtype;
- miVisualsPtr visuals, nextVisuals;
- int *preferredCVCs, *prefp;
-
- /* none specified, we'll guess from pixmap formats */
- if (!miVisuals)
- {
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- d = screenInfo.formats[f].depth;
- b = screenInfo.formats[f].bitsPerPixel;
- if (sizes & (1 << (b - 1)))
- vtype = miGetDefaultVisualMask(d);
- else
- vtype = 0;
- if (!miSetVisualTypes (d, vtype, bitsPerRGB, -1))
- return FALSE;
- }
- }
- nvisual = 0;
- ndepth = 0;
- for (visuals = miVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- ndepth++;
- nvisual += visuals->count;
- }
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
- preferredCVCs = (int *)xalloc(ndepth * sizeof(int));
- if (!depth || !visual || !preferredCVCs)
- {
- xfree (depth);
- xfree (visual);
- xfree (preferredCVCs);
- return FALSE;
- }
- *depthp = depth;
- *visualp = visual;
- *ndepthp = ndepth;
- *nvisualp = nvisual;
- prefp = preferredCVCs;
- for (visuals = miVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- d = visuals->depth;
- vtype = visuals->visuals;
- nvtype = visuals->count;
- *prefp = visuals->preferredCVC;
- prefp++;
- vid = NULL;
- if (nvtype)
- {
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
- if (!vid)
- return FALSE;
- }
- depth->depth = d;
- depth->numVids = nvtype;
- depth->vids = vid;
- depth++;
- for (i = 0; i < NUM_PRIORITY; i++) {
- if (! (vtype & (1 << miVisualPriority[i])))
- continue;
- visual->class = miVisualPriority[i];
- visual->bitsPerRGBValue = visuals->bitsPerRGB;
- visual->ColormapEntries = 1 << d;
- visual->nplanes = d;
- visual->vid = *vid = FakeClientID (0);
- switch (visual->class) {
- case PseudoColor:
- case GrayScale:
- case StaticGray:
- visual->redMask = 0;
- visual->greenMask = 0;
- visual->blueMask = 0;
- visual->offsetRed = 0;
- visual->offsetGreen = 0;
- visual->offsetBlue = 0;
- break;
- case DirectColor:
- case TrueColor:
- visual->ColormapEntries = _CE(d);
- /* fall through */
- case StaticColor:
- visual->redMask = visuals->redMask;
- visual->greenMask = visuals->greenMask;
- visual->blueMask = visuals->blueMask;
- visual->offsetRed = maskShift (visuals->redMask);
- visual->offsetGreen = maskShift (visuals->greenMask);
- visual->offsetBlue = maskShift (visuals->blueMask);
- }
- vid++;
- visual++;
- }
- xfree (visuals);
- }
- miVisuals = NULL;
- visual = *visualp;
- depth = *depthp;
- for (i = 0; i < ndepth; i++)
- {
- int prefColorVisualClass = -1;
-
- if (defaultColorVisualClass >= 0)
- prefColorVisualClass = defaultColorVisualClass;
- else if (preferredVis >= 0)
- prefColorVisualClass = preferredVis;
- else if (preferredCVCs[i] >= 0)
- prefColorVisualClass = preferredCVCs[i];
-
- if (*rootDepthp && *rootDepthp != depth[i].depth)
- continue;
-
- for (j = 0; j < depth[i].numVids; j++)
- {
- for (k = 0; k < nvisual; k++)
- if (visual[k].vid == depth[i].vids[j])
- break;
- if (k == nvisual)
- continue;
- if (prefColorVisualClass < 0 ||
- visual[k].class == prefColorVisualClass)
- break;
- }
- if (j != depth[i].numVids)
- break;
- }
- if (i == ndepth) {
- i = 0;
- j = 0;
- }
- *rootDepthp = depth[i].depth;
- *defaultVisp = depth[i].vids[j];
- xfree(preferredCVCs);
-
- return TRUE;
-}
-
-void
-miResetInitVisuals()
-{
- miInitVisualsProc = miDoInitVisuals;
-}
-
diff --git a/mi/micmap.h b/mi/micmap.h
deleted file mode 100644
index 557ae63d5..000000000
--- a/mi/micmap.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/micmap.h,v 1.7 2000/09/20 00:09:15 keithp Exp $ */
-
-#include "colormapst.h"
-
-#ifndef _MICMAP_H_
-#define _MICMAP_H_
-
-extern ColormapPtr miInstalledMaps[MAXSCREENS];
-
-typedef Bool (* miInitVisualsProcPtr)(VisualPtr *, DepthPtr *, int *, int *,
- int *, VisualID *, unsigned long, int,
- int);
-
-extern miInitVisualsProcPtr miInitVisualsProc;
-
-int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
-void miInstallColormap(ColormapPtr pmap);
-void miUninstallColormap(ColormapPtr pmap);
-
-void miResolveColor(unsigned short *, unsigned short *, unsigned short *,
- VisualPtr);
-Bool miInitializeColormap(ColormapPtr);
-int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *);
-Bool miCreateDefColormap(ScreenPtr);
-void miClearVisualTypes(void);
-Bool miSetVisualTypes(int, int, int, int);
-Bool miSetPixmapDepths(void);
-Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
- int preferredCVC,
- Pixel redMask, Pixel greenMask, Pixel blueMask);
-int miGetDefaultVisualMask(int);
-Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *,
- unsigned long, int, int);
-void miResetInitVisuals(void);
-
-void miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
- void (*new)(miInitVisualsProcPtr *));
-
-
-#define MAX_PSEUDO_DEPTH 10
-#define MIN_TRUE_DEPTH 6
-
-#define StaticGrayMask (1 << StaticGray)
-#define GrayScaleMask (1 << GrayScale)
-#define StaticColorMask (1 << StaticColor)
-#define PseudoColorMask (1 << PseudoColor)
-#define TrueColorMask (1 << TrueColor)
-#define DirectColorMask (1 << DirectColor)
-
-#define ALL_VISUALS (StaticGrayMask|\
- GrayScaleMask|\
- StaticColorMask|\
- PseudoColorMask|\
- TrueColorMask|\
- DirectColorMask)
-
-#define LARGE_VISUALS (TrueColorMask|\
- DirectColorMask)
-
-#define SMALL_VISUALS (StaticGrayMask|\
- GrayScaleMask|\
- StaticColorMask|\
- PseudoColorMask)
-
-#endif /* _MICMAP_H_ */
diff --git a/mi/micoord.h b/mi/micoord.h
deleted file mode 100644
index ffe2e1e53..000000000
--- a/mi/micoord.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/micoord.h,v 1.7 2003/10/29 22:57:48 tsi Exp $ */
-/*
- * Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- *
- */
-
-#ifndef _MICOORD_H_
-#define _MICOORD_H_ 1
-
-#include "servermd.h"
-
-/* Macros which handle a coordinate in a single register */
-
-/*
- * Most compilers will convert divisions by 65536 into shifts, if signed
- * shifts exist. If your machine does arithmetic shifts and your compiler
- * can't get it right, add to this line.
- */
-
-/*
- * mips compiler - what a joke - it CSEs the 65536 constant into a reg
- * forcing as to use div instead of shift. Let's be explicit.
- */
-
-#if defined(mips) || defined(sgi) || \
- defined(sparc) || defined(__sparc64__) || \
- defined(__alpha) || defined(__alpha__) || \
- defined(__i386__) || defined(i386) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__s390x__) || defined(__s390__) || \
- defined(__AMD64__) || defined(AMD64)
-#define GetHighWord(x) (((int) (x)) >> 16)
-#else
-#define GetHighWord(x) (((int) (x)) / 65536)
-#endif
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
-#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
-#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int) ((short) i))
-#else
-#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
-#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
-#define intToX(i) ((int) ((short) (i)))
-#define intToY(i) (GetHighWord(i))
-#endif
-
-#endif /* _MICOORD_H_ */
diff --git a/mi/micursor.c b/mi/micursor.c
deleted file mode 100644
index 4c95d2f49..000000000
--- a/mi/micursor.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/micursor.c,v 1.3 2001/12/14 20:00:21 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: micursor.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-#include "scrnintstr.h"
-#include "cursor.h"
-#include "misc.h"
-#include "mi.h"
-
-extern Bool Must_have_memory;
-
-void
-miRecolorCursor( pScr, pCurs, displayed)
- ScreenPtr pScr;
- CursorPtr pCurs;
- Bool displayed;
-{
- /*
- * This is guaranteed to correct any color-dependent state which may have
- * been bound up in private state created by RealizeCursor
- */
- (* pScr->UnrealizeCursor)( pScr, pCurs);
- Must_have_memory = TRUE; /* XXX */
- (* pScr->RealizeCursor)( pScr, pCurs);
- Must_have_memory = FALSE; /* XXX */
- if ( displayed)
- (* pScr->DisplayCursor)( pScr, pCurs);
-
-}
diff --git a/mi/midash.c b/mi/midash.c
deleted file mode 100644
index bc33b0c20..000000000
--- a/mi/midash.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/midash.c,v 1.5 2003/07/16 01:38:56 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: midash.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-#include "regionstr.h"
-#include "mistruct.h"
-#include "mifpoly.h"
-
-static miDashPtr CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax);
-
-/* return a list of DashRec. there will be an extra
-entry at the end holding the last point of the polyline.
- this means that the code that actually draws dashes can
-get a pair of points for every dash. only the point in the last
-dash record is useful; the other fields are not used.
- nseg is the number of segments, not the number of points.
-
-example:
-
- dash1.start
- dash2.start
- dash3.start
- last-point
-
-defines a list of segments
- (dash1.pt, dash2.pt)
- (dash2.pt, dash3.pt)
- (dash3.pt, last-point)
-and nseg == 3.
-
-NOTE:
- EVEN_DASH == ~ODD_DASH
-
-NOTE ALSO:
- miDashLines may return 0 segments, going from pt[0] to pt[0] with one dash.
-*/
-
-miDashPtr
-miDashLine(npt, ppt, nDash, pDash, offset, pnseg)
-int npt;
-DDXPointPtr ppt;
-unsigned int nDash;
-unsigned char *pDash;
-unsigned int offset;
-int *pnseg;
-{
- DDXPointRec pt1, pt2;
- int lenCur; /* npt used from this dash */
- int lenMax; /* npt in this dash */
- int iDash = 0; /* index of current dash */
- int which; /* EVEN_DASH or ODD_DASH */
- miDashPtr pseg; /* list of dash segments */
- miDashPtr psegBase; /* start of list */
- int nseg = 0; /* number of dashes so far */
- int nsegMax = 0; /* num segs we can fit in this list */
-
- int x, y, len;
- int adx, ady, signdx, signdy;
- int du, dv, e1, e2, e, base_e = 0;
-
- lenCur = offset;
- which = EVEN_DASH;
- while(lenCur >= pDash[iDash])
- {
- lenCur -= pDash[iDash];
- iDash++;
- if (iDash >= nDash)
- iDash = 0;
- which = ~which;
- }
- lenMax = pDash[iDash];
-
- psegBase = (miDashPtr)NULL;
- pt2 = ppt[0]; /* just in case there is only one point */
-
- while(--npt)
- {
- if (PtEqual(ppt[0], ppt[1]))
- {
- ppt++;
- continue; /* no duplicated points in polyline */
- }
- pt1 = *ppt++;
- pt2 = *ppt;
-
- adx = pt2.x - pt1.x;
- ady = pt2.y - pt1.y;
- signdx = sign(adx);
- signdy = sign(ady);
- adx = abs(adx);
- ady = abs(ady);
-
- if (adx > ady)
- {
- du = adx;
- dv = ady;
- len = adx;
- }
- else
- {
- du = ady;
- dv = adx;
- len = ady;
- }
-
- e1 = dv * 2;
- e2 = e1 - 2*du;
- e = e1 - du;
- x = pt1.x;
- y = pt1.y;
-
- nseg++;
- pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt = pt1;
- pseg->e1 = e1;
- pseg->e2 = e2;
- base_e = pseg->e = e;
- pseg->which = which;
- pseg->newLine = 1;
-
- while (len--)
- {
- if (adx > ady)
- {
- /* X_AXIS */
- if (((signdx > 0) && (e < 0)) ||
- ((signdx <=0) && (e <=0))
- )
- {
- e += e1;
- }
- else
- {
- y += signdy;
- e += e2;
- }
- x += signdx;
- }
- else
- {
- /* Y_AXIS */
- if (((signdx > 0) && (e < 0)) ||
- ((signdx <=0) && (e <=0))
- )
- {
- e +=e1;
- }
- else
- {
- x += signdx;
- e += e2;
- }
- y += signdy;
- }
-
- lenCur++;
- if (lenCur >= lenMax && (len || npt <= 1))
- {
- nseg++;
- pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt.x = x;
- pseg->pt.y = y;
- pseg->e1 = e1;
- pseg->e2 = e2;
- pseg->e = e;
- which = ~which;
- pseg->which = which;
- pseg->newLine = 0;
-
- /* move on to next dash */
- iDash++;
- if (iDash >= nDash)
- iDash = 0;
- lenMax = pDash[iDash];
- lenCur = 0;
- }
- } /* while len-- */
- } /* while --npt */
-
- if (lenCur == 0 && nseg != 0)
- {
- nseg--;
- which = ~which;
- }
- *pnseg = nseg;
- pseg = CheckDashStorage(&psegBase, nseg+1, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt = pt2;
- pseg->e = base_e;
- pseg->which = which;
- pseg->newLine = 0;
- return psegBase;
-}
-
-
-#define NSEGDELTA 16
-
-/* returns a pointer to the pseg[nseg-1], growing the storage as
-necessary. this interface seems unnecessarily cumbersome.
-
-*/
-
-static
-miDashPtr
-CheckDashStorage(
- miDashPtr *ppseg, /* base pointer */
- int nseg, /* number of segment we want to write to */
- int *pnsegMax) /* size (in segments) of list so far */
-{
- if (nseg > *pnsegMax)
- {
- miDashPtr newppseg;
-
- *pnsegMax += NSEGDELTA;
- newppseg = (miDashPtr)xrealloc(*ppseg,
- (*pnsegMax)*sizeof(miDashRec));
- if (!newppseg)
- {
- xfree(*ppseg);
- return (miDashPtr)NULL;
- }
- *ppseg = newppseg;
- }
- return(*ppseg+(nseg-1));
-}
-
-void
-miStepDash (dist, pDashIndex, pDash, numInDashList, pDashOffset)
- int dist; /* distance to step */
- int *pDashIndex; /* current dash */
- unsigned char *pDash; /* dash list */
- int numInDashList; /* total length of dash list */
- int *pDashOffset; /* offset into current dash */
-{
- int dashIndex, dashOffset;
- int totallen;
- int i;
-
- dashIndex = *pDashIndex;
- dashOffset = *pDashOffset;
- if (dist < pDash[dashIndex] - dashOffset)
- {
- *pDashOffset = dashOffset + dist;
- return;
- }
- dist -= pDash[dashIndex] - dashOffset;
- if (++dashIndex == numInDashList)
- dashIndex = 0;
- totallen = 0;
- for (i = 0; i < numInDashList; i++)
- totallen += pDash[i];
- if (totallen <= dist)
- dist = dist % totallen;
- while (dist >= pDash[dashIndex])
- {
- dist -= pDash[dashIndex];
- if (++dashIndex == numInDashList)
- dashIndex = 0;
- }
- *pDashIndex = dashIndex;
- *pDashOffset = dist;
-}
diff --git a/mi/midispcur.c b/mi/midispcur.c
deleted file mode 100644
index ca85fc3d1..000000000
--- a/mi/midispcur.c
+++ /dev/null
@@ -1,811 +0,0 @@
-/*
- * midispcur.c
- *
- * machine independent cursor display routines
- */
-
-/* $Xorg: midispcur.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/midispcur.c,v 1.10 2003/03/06 05:52:58 mvojkovi Exp $ */
-
-#define NEED_EVENTS
-# include "X.h"
-# include "misc.h"
-# include "input.h"
-# include "cursorstr.h"
-# include "windowstr.h"
-# include "regionstr.h"
-# include "dixstruct.h"
-# include "scrnintstr.h"
-# include "servermd.h"
-# include "mipointer.h"
-# include "misprite.h"
-# include "gcstruct.h"
-#ifdef ARGB_CURSOR
-# include "picturestr.h"
-#endif
-
-/* per-screen private data */
-
-static int miDCScreenIndex;
-static unsigned long miDCGeneration = 0;
-
-static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
-
-typedef struct {
- GCPtr pSourceGC, pMaskGC;
- GCPtr pSaveGC, pRestoreGC;
- GCPtr pMoveGC;
- GCPtr pPixSourceGC, pPixMaskGC;
- CloseScreenProcPtr CloseScreen;
- PixmapPtr pSave, pTemp;
-#ifdef ARGB_CURSOR
- PicturePtr pRootPicture;
- PicturePtr pTempPicture;
-#endif
-} miDCScreenRec, *miDCScreenPtr;
-
-/* per-cursor per-screen private data */
-typedef struct {
- PixmapPtr sourceBits; /* source bits */
- PixmapPtr maskBits; /* mask bits */
-#ifdef ARGB_CURSOR
- PicturePtr pPicture;
-#endif
-} miDCCursorRec, *miDCCursorPtr;
-
-/*
- * sprite/cursor method table
- */
-
-static Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static Bool miDCPutUpCursor(ScreenPtr pScreen, CursorPtr pCursor,
- int x, int y, unsigned long source,
- unsigned long mask);
-static Bool miDCSaveUnderCursor(ScreenPtr pScreen, int x, int y,
- int w, int h);
-static Bool miDCRestoreUnderCursor(ScreenPtr pScreen, int x, int y,
- int w, int h);
-static Bool miDCMoveCursor(ScreenPtr pScreen, CursorPtr pCursor,
- int x, int y, int w, int h, int dx, int dy,
- unsigned long source, unsigned long mask);
-static Bool miDCChangeSave(ScreenPtr pScreen, int x, int y, int w, int h,
- int dx, int dy);
-
-static miSpriteCursorFuncRec miDCFuncs = {
- miDCRealizeCursor,
- miDCUnrealizeCursor,
- miDCPutUpCursor,
- miDCSaveUnderCursor,
- miDCRestoreUnderCursor,
- miDCMoveCursor,
- miDCChangeSave,
-};
-
-Bool
-miDCInitialize (pScreen, screenFuncs)
- ScreenPtr pScreen;
- miPointerScreenFuncPtr screenFuncs;
-{
- miDCScreenPtr pScreenPriv;
-
- if (miDCGeneration != serverGeneration)
- {
- miDCScreenIndex = AllocateScreenPrivateIndex ();
- if (miDCScreenIndex < 0)
- return FALSE;
- miDCGeneration = serverGeneration;
- }
- pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec));
- if (!pScreenPriv)
- return FALSE;
-
- /*
- * initialize the entire private structure to zeros
- */
-
- pScreenPriv->pSourceGC =
- pScreenPriv->pMaskGC =
- pScreenPriv->pSaveGC =
- pScreenPriv->pRestoreGC =
- pScreenPriv->pMoveGC =
- pScreenPriv->pPixSourceGC =
- pScreenPriv->pPixMaskGC = NULL;
-#ifdef ARGB_CURSOR
- pScreenPriv->pRootPicture = NULL;
- pScreenPriv->pTempPicture = NULL;
-#endif
-
- pScreenPriv->pSave = pScreenPriv->pTemp = NULL;
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = miDCCloseScreen;
-
- pScreen->devPrivates[miDCScreenIndex].ptr = (pointer) pScreenPriv;
-
- if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs))
- {
- xfree ((pointer) pScreenPriv);
- return FALSE;
- }
- return TRUE;
-}
-
-#define tossGC(gc) (gc ? FreeGC (gc, (GContext) 0) : 0)
-#define tossPix(pix) (pix ? (*pScreen->DestroyPixmap) (pix) : TRUE)
-#define tossPict(pict) (pict ? FreePicture (pict, 0) : 0)
-
-static Bool
-miDCCloseScreen (index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- miDCScreenPtr pScreenPriv;
-
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- tossGC (pScreenPriv->pSourceGC);
- tossGC (pScreenPriv->pMaskGC);
- tossGC (pScreenPriv->pSaveGC);
- tossGC (pScreenPriv->pRestoreGC);
- tossGC (pScreenPriv->pMoveGC);
- tossGC (pScreenPriv->pPixSourceGC);
- tossGC (pScreenPriv->pPixMaskGC);
- tossPix (pScreenPriv->pSave);
- tossPix (pScreenPriv->pTemp);
-#ifdef ARGB_CURSOR
- tossPict (pScreenPriv->pRootPicture);
- tossPict (pScreenPriv->pTempPicture);
-#endif
- xfree ((pointer) pScreenPriv);
- return (*pScreen->CloseScreen) (index, pScreen);
-}
-
-static Bool
-miDCRealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- if (pCursor->bits->refcnt <= 1)
- pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL;
- return TRUE;
-}
-
-#ifdef ARGB_CURSOR
-#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
-
-static VisualPtr
-miDCGetWindowVisual (WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- VisualID vid = wVisual (pWin);
- int i;
-
- for (i = 0; i < pScreen->numVisuals; i++)
- if (pScreen->visuals[i].vid == vid)
- return &pScreen->visuals[i];
- return 0;
-}
-
-static PicturePtr
-miDCMakePicture (PicturePtr *ppPicture, DrawablePtr pDraw, WindowPtr pWin)
-{
- ScreenPtr pScreen = pDraw->pScreen;
- VisualPtr pVisual;
- PictFormatPtr pFormat;
- XID subwindow_mode = IncludeInferiors;
- PicturePtr pPicture;
- int error;
-
- pVisual = miDCGetWindowVisual (pWin);
- if (!pVisual)
- return 0;
- pFormat = PictureMatchVisual (pScreen, pDraw->depth, pVisual);
- if (!pFormat)
- return 0;
- pPicture = CreatePicture (0, pDraw, pFormat,
- CPSubwindowMode, &subwindow_mode,
- serverClient, &error);
- *ppPicture = pPicture;
- return pPicture;
-}
-#endif
-
-static miDCCursorPtr
-miDCRealize (
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- miDCCursorPtr pPriv;
- GCPtr pGC;
- XID gcvals[3];
-
- pPriv = (miDCCursorPtr) xalloc (sizeof (miDCCursorRec));
- if (!pPriv)
- return (miDCCursorPtr)NULL;
-#ifdef ARGB_CURSOR
- if (pCursor->bits->argb)
- {
- PixmapPtr pPixmap;
- PictFormatPtr pFormat;
- int error;
-
- pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
- if (!pFormat)
- {
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
-
- pPriv->sourceBits = 0;
- pPriv->maskBits = 0;
- pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
- pCursor->bits->height, 32);
- if (!pPixmap)
- {
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
- pGC = GetScratchGC (32, pScreen);
- if (!pGC)
- {
- (*pScreen->DestroyPixmap) (pPixmap);
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
- ValidateGC (&pPixmap->drawable, pGC);
- (*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32,
- 0, 0, pCursor->bits->width,
- pCursor->bits->height,
- 0, ZPixmap, (char *) pCursor->bits->argb);
- FreeScratchGC (pGC);
- pPriv->pPicture = CreatePicture (0, &pPixmap->drawable,
- pFormat, 0, 0, serverClient, &error);
- (*pScreen->DestroyPixmap) (pPixmap);
- if (!pPriv->pPicture)
- {
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
- pCursor->bits->devPriv[pScreen->myNum] = (pointer) pPriv;
- return pPriv;
- }
- pPriv->pPicture = 0;
-#endif
- pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
- if (!pPriv->sourceBits)
- {
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
- pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
- if (!pPriv->maskBits)
- {
- (*pScreen->DestroyPixmap) (pPriv->sourceBits);
- xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
- }
- pCursor->bits->devPriv[pScreen->myNum] = (pointer) pPriv;
-
- /* create the two sets of bits, clipping as appropriate */
-
- pGC = GetScratchGC (1, pScreen);
- if (!pGC)
- {
- (void) miDCUnrealizeCursor (pScreen, pCursor);
- return (miDCCursorPtr)NULL;
- }
-
- ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
- (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
- 0, 0, pCursor->bits->width, pCursor->bits->height,
- 0, XYPixmap, (char *)pCursor->bits->source);
- gcvals[0] = GXand;
- ChangeGC (pGC, GCFunction, gcvals);
- ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
- (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
- 0, 0, pCursor->bits->width, pCursor->bits->height,
- 0, XYPixmap, (char *)pCursor->bits->mask);
-
- /* mask bits -- pCursor->mask & ~pCursor->source */
- gcvals[0] = GXcopy;
- ChangeGC (pGC, GCFunction, gcvals);
- ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
- (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
- 0, 0, pCursor->bits->width, pCursor->bits->height,
- 0, XYPixmap, (char *)pCursor->bits->mask);
- gcvals[0] = GXandInverted;
- ChangeGC (pGC, GCFunction, gcvals);
- ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
- (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
- 0, 0, pCursor->bits->width, pCursor->bits->height,
- 0, XYPixmap, (char *)pCursor->bits->source);
- FreeScratchGC (pGC);
- return pPriv;
-}
-
-static Bool
-miDCUnrealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- miDCCursorPtr pPriv;
-
- pPriv = (miDCCursorPtr) pCursor->bits->devPriv[pScreen->myNum];
- if (pPriv && (pCursor->bits->refcnt <= 1))
- {
- if (pPriv->sourceBits)
- (*pScreen->DestroyPixmap) (pPriv->sourceBits);
- if (pPriv->maskBits)
- (*pScreen->DestroyPixmap) (pPriv->maskBits);
-#ifdef ARGB_CURSOR
- if (pPriv->pPicture)
- FreePicture (pPriv->pPicture, 0);
-#endif
- xfree ((pointer) pPriv);
- pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL;
- }
- return TRUE;
-}
-
-static void
-miDCPutBits (
- DrawablePtr pDrawable,
- miDCCursorPtr pPriv,
- GCPtr sourceGC,
- GCPtr maskGC,
- int x_org,
- int y_org,
- unsigned w,
- unsigned h,
- unsigned long source,
- unsigned long mask)
-{
- XID gcvals[1];
- int x, y;
-
- if (sourceGC->fgPixel != source)
- {
- gcvals[0] = source;
- DoChangeGC (sourceGC, GCForeground, gcvals, 0);
- }
- if (sourceGC->serialNumber != pDrawable->serialNumber)
- ValidateGC (pDrawable, sourceGC);
-
- if(sourceGC->miTranslate)
- {
- x = pDrawable->x + x_org;
- y = pDrawable->y + y_org;
- }
- else
- {
- x = x_org;
- y = y_org;
- }
-
- (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
- if (maskGC->fgPixel != mask)
- {
- gcvals[0] = mask;
- DoChangeGC (maskGC, GCForeground, gcvals, 0);
- }
- if (maskGC->serialNumber != pDrawable->serialNumber)
- ValidateGC (pDrawable, maskGC);
-
- if(maskGC->miTranslate)
- {
- x = pDrawable->x + x_org;
- y = pDrawable->y + y_org;
- }
- else
- {
- x = x_org;
- y = y_org;
- }
-
- (*maskGC->ops->PushPixels) (maskGC, pPriv->maskBits, pDrawable, w, h, x, y);
-}
-
-#define EnsureGC(gc,win) (gc || miDCMakeGC(&gc, win))
-
-static GCPtr
-miDCMakeGC(
- GCPtr *ppGC,
- WindowPtr pWin)
-{
- GCPtr pGC;
- int status;
- XID gcvals[2];
-
- gcvals[0] = IncludeInferiors;
- gcvals[1] = FALSE;
- pGC = CreateGC((DrawablePtr)pWin,
- GCSubwindowMode|GCGraphicsExposures, gcvals, &status);
- if (pGC && pWin->drawable.pScreen->DrawGuarantee)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
- *ppGC = pGC;
- return pGC;
-}
-
-
-static Bool
-miDCPutUpCursor (pScreen, pCursor, x, y, source, mask)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- int x, y;
- unsigned long source, mask;
-{
- miDCScreenPtr pScreenPriv;
- miDCCursorPtr pPriv;
- WindowPtr pWin;
-
- pPriv = (miDCCursorPtr) pCursor->bits->devPriv[pScreen->myNum];
- if (!pPriv)
- {
- pPriv = miDCRealize(pScreen, pCursor);
- if (!pPriv)
- return FALSE;
- }
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pWin = WindowTable[pScreen->myNum];
-#ifdef ARGB_CURSOR
- if (pPriv->pPicture)
- {
- if (!EnsurePicture(pScreenPriv->pRootPicture, &pWin->drawable, pWin))
- return FALSE;
- CompositePicture (PictOpOver,
- pPriv->pPicture,
- NULL,
- pScreenPriv->pRootPicture,
- 0, 0, 0, 0,
- x, y,
- pCursor->bits->width,
- pCursor->bits->height);
- }
- else
-#endif
- {
- if (!EnsureGC(pScreenPriv->pSourceGC, pWin))
- return FALSE;
- if (!EnsureGC(pScreenPriv->pMaskGC, pWin))
- {
- FreeGC (pScreenPriv->pSourceGC, (GContext) 0);
- pScreenPriv->pSourceGC = 0;
- return FALSE;
- }
- miDCPutBits ((DrawablePtr)pWin, pPriv,
- pScreenPriv->pSourceGC, pScreenPriv->pMaskGC,
- x, y, pCursor->bits->width, pCursor->bits->height,
- source, mask);
- }
- return TRUE;
-}
-
-static Bool
-miDCSaveUnderCursor (pScreen, x, y, w, h)
- ScreenPtr pScreen;
- int x, y, w, h;
-{
- miDCScreenPtr pScreenPriv;
- PixmapPtr pSave;
- WindowPtr pWin;
- GCPtr pGC;
-
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pSave = pScreenPriv->pSave;
- pWin = WindowTable[pScreen->myNum];
- if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h)
- {
- if (pSave)
- (*pScreen->DestroyPixmap) (pSave);
- pScreenPriv->pSave = pSave =
- (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth);
- if (!pSave)
- return FALSE;
- }
- if (!EnsureGC(pScreenPriv->pSaveGC, pWin))
- return FALSE;
- pGC = pScreenPriv->pSaveGC;
- if (pSave->drawable.serialNumber != pGC->serialNumber)
- ValidateGC ((DrawablePtr) pSave, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
- x, y, w, h, 0, 0);
- return TRUE;
-}
-
-static Bool
-miDCRestoreUnderCursor (pScreen, x, y, w, h)
- ScreenPtr pScreen;
- int x, y, w, h;
-{
- miDCScreenPtr pScreenPriv;
- PixmapPtr pSave;
- WindowPtr pWin;
- GCPtr pGC;
-
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pSave = pScreenPriv->pSave;
- pWin = WindowTable[pScreen->myNum];
- if (!pSave)
- return FALSE;
- if (!EnsureGC(pScreenPriv->pRestoreGC, pWin))
- return FALSE;
- pGC = pScreenPriv->pRestoreGC;
- if (pWin->drawable.serialNumber != pGC->serialNumber)
- ValidateGC ((DrawablePtr) pWin, pGC);
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
- 0, 0, w, h, x, y);
- return TRUE;
-}
-
-static Bool
-miDCChangeSave (pScreen, x, y, w, h, dx, dy)
- ScreenPtr pScreen;
- int x, y, w, h, dx, dy;
-{
- miDCScreenPtr pScreenPriv;
- PixmapPtr pSave;
- WindowPtr pWin;
- GCPtr pGC;
- int sourcex, sourcey, destx, desty, copyw, copyh;
-
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pSave = pScreenPriv->pSave;
- pWin = WindowTable[pScreen->myNum];
- /*
- * restore the bits which are about to get trashed
- */
- if (!pSave)
- return FALSE;
- if (!EnsureGC(pScreenPriv->pRestoreGC, pWin))
- return FALSE;
- pGC = pScreenPriv->pRestoreGC;
- if (pWin->drawable.serialNumber != pGC->serialNumber)
- ValidateGC ((DrawablePtr) pWin, pGC);
- /*
- * copy the old bits to the screen.
- */
- if (dy > 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
- 0, h - dy, w, dy, x + dx, y + h);
- }
- else if (dy < 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
- 0, 0, w, -dy, x + dx, y + dy);
- }
- if (dy >= 0)
- {
- desty = y + dy;
- sourcey = 0;
- copyh = h - dy;
- }
- else
- {
- desty = y;
- sourcey = - dy;
- copyh = h + dy;
- }
- if (dx > 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
- w - dx, sourcey, dx, copyh, x + w, desty);
- }
- else if (dx < 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
- 0, sourcey, -dx, copyh, x + dx, desty);
- }
- if (!EnsureGC(pScreenPriv->pSaveGC, pWin))
- return FALSE;
- pGC = pScreenPriv->pSaveGC;
- if (pSave->drawable.serialNumber != pGC->serialNumber)
- ValidateGC ((DrawablePtr) pSave, pGC);
- /*
- * move the bits that are still valid within the pixmap
- */
- if (dx >= 0)
- {
- sourcex = 0;
- destx = dx;
- copyw = w - dx;
- }
- else
- {
- destx = 0;
- sourcex = - dx;
- copyw = w + dx;
- }
- if (dy >= 0)
- {
- sourcey = 0;
- desty = dy;
- copyh = h - dy;
- }
- else
- {
- desty = 0;
- sourcey = -dy;
- copyh = h + dy;
- }
- (*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pSave, pGC,
- sourcex, sourcey, copyw, copyh, destx, desty);
- /*
- * copy the new bits from the screen into the remaining areas of the
- * pixmap
- */
- if (dy > 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
- x, y, w, dy, 0, 0);
- }
- else if (dy < 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
- x, y + h + dy, w, -dy, 0, h + dy);
- }
- if (dy >= 0)
- {
- desty = dy;
- sourcey = y + dy;
- copyh = h - dy;
- }
- else
- {
- desty = 0;
- sourcey = y;
- copyh = h + dy;
- }
- if (dx > 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
- x, sourcey, dx, copyh, 0, desty);
- }
- else if (dx < 0)
- {
- (*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
- x + w + dx, sourcey, -dx, copyh, w + dx, desty);
- }
- return TRUE;
-}
-
-static Bool
-miDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- int x, y, w, h, dx, dy;
- unsigned long source, mask;
-{
- miDCCursorPtr pPriv;
- miDCScreenPtr pScreenPriv;
- int status;
- WindowPtr pWin;
- GCPtr pGC;
- XID gcval = FALSE;
- PixmapPtr pTemp;
-
- pPriv = (miDCCursorPtr) pCursor->bits->devPriv[pScreen->myNum];
- if (!pPriv)
- {
- pPriv = miDCRealize(pScreen, pCursor);
- if (!pPriv)
- return FALSE;
- }
- pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
- pWin = WindowTable[pScreen->myNum];
- pTemp = pScreenPriv->pTemp;
- if (!pTemp ||
- pTemp->drawable.width != pScreenPriv->pSave->drawable.width ||
- pTemp->drawable.height != pScreenPriv->pSave->drawable.height)
- {
- if (pTemp)
- (*pScreen->DestroyPixmap) (pTemp);
-#ifdef ARGB_CURSOR
- if (pScreenPriv->pTempPicture)
- {
- FreePicture (pScreenPriv->pTempPicture, 0);
- pScreenPriv->pTempPicture = 0;
- }
-#endif
- pScreenPriv->pTemp = pTemp = (*pScreen->CreatePixmap)
- (pScreen, w, h, pScreenPriv->pSave->drawable.depth);
- if (!pTemp)
- return FALSE;
- }
- if (!pScreenPriv->pMoveGC)
- {
- pScreenPriv->pMoveGC = CreateGC ((DrawablePtr)pTemp,
- GCGraphicsExposures, &gcval, &status);
- if (!pScreenPriv->pMoveGC)
- return FALSE;
- }
- /*
- * copy the saved area to a temporary pixmap
- */
- pGC = pScreenPriv->pMoveGC;
- if (pGC->serialNumber != pTemp->drawable.serialNumber)
- ValidateGC ((DrawablePtr) pTemp, pGC);
- (*pGC->ops->CopyArea)((DrawablePtr)pScreenPriv->pSave,
- (DrawablePtr)pTemp, pGC, 0, 0, w, h, 0, 0);
-
- /*
- * draw the cursor in the temporary pixmap
- */
-#ifdef ARGB_CURSOR
- if (pPriv->pPicture)
- {
- if (!EnsurePicture(pScreenPriv->pTempPicture, &pTemp->drawable, pWin))
- return FALSE;
- CompositePicture (PictOpOver,
- pPriv->pPicture,
- NULL,
- pScreenPriv->pTempPicture,
- 0, 0, 0, 0,
- dx, dy,
- pCursor->bits->width,
- pCursor->bits->height);
- }
- else
-#endif
- {
- if (!pScreenPriv->pPixSourceGC)
- {
- pScreenPriv->pPixSourceGC = CreateGC ((DrawablePtr)pTemp,
- GCGraphicsExposures, &gcval, &status);
- if (!pScreenPriv->pPixSourceGC)
- return FALSE;
- }
- if (!pScreenPriv->pPixMaskGC)
- {
- pScreenPriv->pPixMaskGC = CreateGC ((DrawablePtr)pTemp,
- GCGraphicsExposures, &gcval, &status);
- if (!pScreenPriv->pPixMaskGC)
- return FALSE;
- }
- miDCPutBits ((DrawablePtr)pTemp, pPriv,
- pScreenPriv->pPixSourceGC, pScreenPriv->pPixMaskGC,
- dx, dy, pCursor->bits->width, pCursor->bits->height,
- source, mask);
- }
-
- /*
- * copy the temporary pixmap onto the screen
- */
-
- if (!EnsureGC(pScreenPriv->pRestoreGC, pWin))
- return FALSE;
- pGC = pScreenPriv->pRestoreGC;
- if (pWin->drawable.serialNumber != pGC->serialNumber)
- ValidateGC ((DrawablePtr) pWin, pGC);
-
- (*pGC->ops->CopyArea) ((DrawablePtr) pTemp, (DrawablePtr) pWin,
- pGC,
- 0, 0, w, h, x, y);
- return TRUE;
-}
diff --git a/mi/mieq.c b/mi/mieq.c
deleted file mode 100644
index 699d4130c..000000000
--- a/mi/mieq.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * $Xorg: mieq.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $
- *
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/programs/Xserver/mi/mieq.c,v 1.3 2001/12/14 20:00:22 dawes Exp $ */
-
-/*
- * mieq.c
- *
- * Machine independent event queue
- *
- */
-
-# define NEED_EVENTS
-# include "X.h"
-# include "Xmd.h"
-# include "Xproto.h"
-# include "misc.h"
-# include "windowstr.h"
-# include "pixmapstr.h"
-# include "inputstr.h"
-# include "mi.h"
-# include "scrnintstr.h"
-
-#define QUEUE_SIZE 256
-
-typedef struct _Event {
- xEvent event;
- ScreenPtr pScreen;
-} EventRec, *EventPtr;
-
-typedef struct _EventQueue {
- HWEventQueueType head, tail; /* long for SetInputCheck */
- CARD32 lastEventTime; /* to avoid time running backwards */
- Bool lastMotion;
- EventRec events[QUEUE_SIZE]; /* static allocation for signals */
- DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
- ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
- ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
-} EventQueueRec, *EventQueuePtr;
-
-static EventQueueRec miEventQueue;
-
-Bool
-mieqInit (pKbd, pPtr)
- DevicePtr pKbd, pPtr;
-{
- miEventQueue.head = miEventQueue.tail = 0;
- miEventQueue.lastEventTime = GetTimeInMillis ();
- miEventQueue.pKbd = pKbd;
- miEventQueue.pPtr = pPtr;
- miEventQueue.lastMotion = FALSE;
- miEventQueue.pEnqueueScreen = screenInfo.screens[0];
- miEventQueue.pDequeueScreen = miEventQueue.pEnqueueScreen;
- SetInputCheck (&miEventQueue.head, &miEventQueue.tail);
- return TRUE;
-}
-
-/*
- * Must be reentrant with ProcessInputEvents. Assumption: mieqEnqueue
- * will never be interrupted. If this is called from both signal
- * handlers and regular code, make sure the signal is suspended when
- * called from regular code.
- */
-
-void
-mieqEnqueue (e)
- xEvent *e;
-{
- HWEventQueueType oldtail, newtail;
- Bool isMotion;
-
- oldtail = miEventQueue.tail;
- isMotion = e->u.u.type == MotionNotify;
- if (isMotion && miEventQueue.lastMotion && oldtail != miEventQueue.head)
- {
- if (oldtail == 0)
- oldtail = QUEUE_SIZE;
- oldtail = oldtail - 1;
- }
- else
- {
- newtail = oldtail + 1;
- if (newtail == QUEUE_SIZE)
- newtail = 0;
- /* Toss events which come in late */
- if (newtail == miEventQueue.head)
- return;
- miEventQueue.tail = newtail;
- }
- miEventQueue.lastMotion = isMotion;
- miEventQueue.events[oldtail].event = *e;
- /*
- * Make sure that event times don't go backwards - this
- * is "unnecessary", but very useful
- */
- if (e->u.keyButtonPointer.time < miEventQueue.lastEventTime &&
- miEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
- {
- miEventQueue.events[oldtail].event.u.keyButtonPointer.time =
- miEventQueue.lastEventTime;
- }
- miEventQueue.events[oldtail].pScreen = miEventQueue.pEnqueueScreen;
-}
-
-void
-mieqSwitchScreen (pScreen, fromDIX)
- ScreenPtr pScreen;
- Bool fromDIX;
-{
- miEventQueue.pEnqueueScreen = pScreen;
- if (fromDIX)
- miEventQueue.pDequeueScreen = pScreen;
-}
-
-/*
- * Call this from ProcessInputEvents()
- */
-
-void mieqProcessInputEvents ()
-{
- EventRec *e;
- int x, y;
- xEvent xe;
-
- while (miEventQueue.head != miEventQueue.tail)
- {
- if (screenIsSaved == SCREEN_SAVER_ON)
- SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
-
- e = &miEventQueue.events[miEventQueue.head];
- /*
- * Assumption - screen switching can only occur on motion events
- */
- if (e->pScreen != miEventQueue.pDequeueScreen)
- {
- miEventQueue.pDequeueScreen = e->pScreen;
- x = e->event.u.keyButtonPointer.rootX;
- y = e->event.u.keyButtonPointer.rootY;
- if (miEventQueue.head == QUEUE_SIZE - 1)
- miEventQueue.head = 0;
- else
- ++miEventQueue.head;
- NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
- }
- else
- {
- xe = e->event;
- if (miEventQueue.head == QUEUE_SIZE - 1)
- miEventQueue.head = 0;
- else
- ++miEventQueue.head;
- switch (xe.u.u.type)
- {
- case KeyPress:
- case KeyRelease:
- (*miEventQueue.pKbd->processInputProc)
- (&xe, (DeviceIntPtr)miEventQueue.pKbd, 1);
- break;
- default:
- (*miEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)miEventQueue.pPtr, 1);
- break;
- }
- }
- }
-}
diff --git a/mi/miexpose.c b/mi/miexpose.c
deleted file mode 100644
index 07efa754c..000000000
--- a/mi/miexpose.c
+++ /dev/null
@@ -1,873 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.10 2003/11/10 18:22:49 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "Xprotostr.h"
-
-#include "misc.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmap.h"
-#include "input.h"
-
-#include "dixstruct.h"
-#include "mi.h"
-#include "Xmd.h"
-
-#include "globals.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-/*
- machine-independent graphics exposure code. any device that uses
-the region package can call this.
-*/
-
-#ifndef RECTLIMIT
-#define RECTLIMIT 25 /* pick a number, any number > 8 */
-#endif
-
-/* miHandleExposures
- generate a region for exposures for areas that were copied from obscured or
-non-existent areas to non-obscured areas of the destination. Paint the
-background for the region, if the destination is a window.
-
-NOTE:
- this should generally be called, even if graphicsExposures is false,
-because this is where bits get recovered from backing store.
-
-NOTE:
- added argument 'plane' is used to indicate how exposures from backing
-store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea
-should be used, else a CopyPlane of the indicated plane will be used. The
-exposing is done by the backing store's GraphicsExpose function, of course.
-
-*/
-
-RegionPtr
-miHandleExposures(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, plane)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GCPtr pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- unsigned long plane;
-{
- register ScreenPtr pscr;
- RegionPtr prgnSrcClip; /* drawable-relative source clip */
- RegionRec rgnSrcRec;
- RegionPtr prgnDstClip; /* drawable-relative dest clip */
- RegionRec rgnDstRec;
- BoxRec srcBox; /* unclipped source */
- RegionRec rgnExposed; /* exposed region, calculated source-
- relative, made dst relative to
- intersect with visible parts of
- dest and send events to client,
- and then screen relative to paint
- the window background
- */
- WindowPtr pSrcWin;
- BoxRec expBox;
- Bool extents;
-
- /* This prevents warning about pscr not being used. */
- pGC->pScreen = pscr = pGC->pScreen;
-
- /* avoid work if we can */
- if (!pGC->graphicsExposures &&
- (pDstDrawable->type == DRAWABLE_PIXMAP) &&
- ((pSrcDrawable->type == DRAWABLE_PIXMAP) ||
- (((WindowPtr)pSrcDrawable)->backStorage == NULL)))
- return NULL;
-
- srcBox.x1 = srcx;
- srcBox.y1 = srcy;
- srcBox.x2 = srcx+width;
- srcBox.y2 = srcy+height;
-
- if (pSrcDrawable->type != DRAWABLE_PIXMAP)
- {
- BoxRec TsrcBox;
-
- TsrcBox.x1 = srcx + pSrcDrawable->x;
- TsrcBox.y1 = srcy + pSrcDrawable->y;
- TsrcBox.x2 = TsrcBox.x1 + width;
- TsrcBox.y2 = TsrcBox.y1 + height;
- pSrcWin = (WindowPtr) pSrcDrawable;
- if (pGC->subWindowMode == IncludeInferiors)
- {
- prgnSrcClip = NotClippedByChildren (pSrcWin);
- if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN)
- {
- REGION_DESTROY(pscr, prgnSrcClip);
- return NULL;
- }
- }
- else
- {
- if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN)
- return NULL;
- prgnSrcClip = &rgnSrcRec;
- REGION_NULL(pscr, prgnSrcClip);
- REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList);
- }
- REGION_TRANSLATE(pscr, prgnSrcClip,
- -pSrcDrawable->x, -pSrcDrawable->y);
- }
- else
- {
- BoxRec box;
-
- if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) &&
- (srcBox.x2 <= pSrcDrawable->width) &&
- (srcBox.y2 <= pSrcDrawable->height))
- return NULL;
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pSrcDrawable->width;
- box.y2 = pSrcDrawable->height;
- prgnSrcClip = &rgnSrcRec;
- REGION_INIT(pscr, prgnSrcClip, &box, 1);
- pSrcWin = (WindowPtr)NULL;
- }
-
- if (pDstDrawable == pSrcDrawable)
- {
- prgnDstClip = prgnSrcClip;
- }
- else if (pDstDrawable->type != DRAWABLE_PIXMAP)
- {
- if (pGC->subWindowMode == IncludeInferiors)
- {
- prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable);
- }
- else
- {
- prgnDstClip = &rgnDstRec;
- REGION_NULL(pscr, prgnDstClip);
- REGION_COPY(pscr, prgnDstClip,
- &((WindowPtr)pDstDrawable)->clipList);
- }
- REGION_TRANSLATE(pscr, prgnDstClip,
- -pDstDrawable->x, -pDstDrawable->y);
- }
- else
- {
- BoxRec box;
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pDstDrawable->width;
- box.y2 = pDstDrawable->height;
- prgnDstClip = &rgnDstRec;
- REGION_INIT(pscr, prgnDstClip, &box, 1);
- }
-
- /* drawable-relative source region */
- REGION_INIT(pscr, &rgnExposed, &srcBox, 1);
-
- /* now get the hidden parts of the source box*/
- REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip);
-
- if (pSrcWin && pSrcWin->backStorage)
- {
- /*
- * Copy any areas from the source backing store. Modifies
- * rgnExposed.
- */
- (* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable,
- pDstDrawable,
- pGC,
- &rgnExposed,
- srcx, srcy,
- dstx, dsty,
- plane);
- }
-
- /* move them over the destination */
- REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy);
-
- /* intersect with visible areas of dest */
- REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip);
-
- /*
- * If we have LOTS of rectangles, we decide to take the extents
- * and force an exposure on that. This should require much less
- * work overall, on both client and server. This is cheating, but
- * isn't prohibited by the protocol ("spontaneous combustion" :-)
- * for windows.
- */
- extents = pGC->graphicsExposures &&
- (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) &&
- (pDstDrawable->type != DRAWABLE_PIXMAP);
-#ifdef SHAPE
- if (pSrcWin)
- {
- RegionPtr region;
- if (!(region = wClipShape (pSrcWin)))
- region = wBoundingShape (pSrcWin);
- /*
- * If you try to CopyArea the extents of a shaped window, compacting the
- * exposed region will undo all our work!
- */
- if (extents && pSrcWin && region &&
- (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN))
- extents = FALSE;
- }
-#endif
- if (extents)
- {
- WindowPtr pWin = (WindowPtr)pDstDrawable;
-
- expBox = *REGION_EXTENTS(pscr, &rgnExposed);
- REGION_RESET(pscr, &rgnExposed, &expBox);
- /* need to clear out new areas of backing store */
- if (pWin->backStorage)
- (void) (* pWin->drawable.pScreen->ClearBackingStore)(
- pWin,
- expBox.x1,
- expBox.y1,
- expBox.x2 - expBox.x1,
- expBox.y2 - expBox.y1,
- FALSE);
- }
- if ((pDstDrawable->type != DRAWABLE_PIXMAP) &&
- (((WindowPtr)pDstDrawable)->backgroundState != None))
- {
- WindowPtr pWin = (WindowPtr)pDstDrawable;
-
- /* make the exposed area screen-relative */
- REGION_TRANSLATE(pscr, &rgnExposed,
- pDstDrawable->x, pDstDrawable->y);
-
- if (extents)
- {
- /* PaintWindowBackground doesn't clip, so we have to */
- REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList);
- }
- (*pWin->drawable.pScreen->PaintWindowBackground)(
- (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND);
-
- if (extents)
- {
- REGION_RESET(pscr, &rgnExposed, &expBox);
- }
- else
- REGION_TRANSLATE(pscr, &rgnExposed,
- -pDstDrawable->x, -pDstDrawable->y);
- }
- if (prgnDstClip == &rgnDstRec)
- {
- REGION_UNINIT(pscr, prgnDstClip);
- }
- else if (prgnDstClip != prgnSrcClip)
- {
- REGION_DESTROY(pscr, prgnDstClip);
- }
-
- if (prgnSrcClip == &rgnSrcRec)
- {
- REGION_UNINIT(pscr, prgnSrcClip);
- }
- else
- {
- REGION_DESTROY(pscr, prgnSrcClip);
- }
-
- if (pGC->graphicsExposures)
- {
- /* don't look */
- RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0);
- *exposed = rgnExposed;
- return exposed;
- }
- else
- {
- REGION_UNINIT(pscr, &rgnExposed);
- return NULL;
- }
-}
-
-/* send GraphicsExpose events, or a NoExpose event, based on the region */
-
-void
-miSendGraphicsExpose (client, pRgn, drawable, major, minor)
- ClientPtr client;
- RegionPtr pRgn;
- XID drawable;
- int major;
- int minor;
-{
- if (pRgn && !REGION_NIL(pRgn))
- {
- xEvent *pEvent;
- register xEvent *pe;
- register BoxPtr pBox;
- register int i;
- int numRects;
-
- numRects = REGION_NUM_RECTS(pRgn);
- pBox = REGION_RECTS(pRgn);
- if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent))))
- return;
- pe = pEvent;
-
- for (i=1; i<=numRects; i++, pe++, pBox++)
- {
- pe->u.u.type = GraphicsExpose;
- pe->u.graphicsExposure.drawable = drawable;
- pe->u.graphicsExposure.x = pBox->x1;
- pe->u.graphicsExposure.y = pBox->y1;
- pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
- pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
- pe->u.graphicsExposure.count = numRects - i;
- pe->u.graphicsExposure.majorEvent = major;
- pe->u.graphicsExposure.minorEvent = minor;
- }
- TryClientEvents(client, pEvent, numRects,
- (Mask)0, NoEventMask, NullGrab);
- DEALLOCATE_LOCAL(pEvent);
- }
- else
- {
- xEvent event;
- event.u.u.type = NoExpose;
- event.u.noExposure.drawable = drawable;
- event.u.noExposure.majorEvent = major;
- event.u.noExposure.minorEvent = minor;
- TryClientEvents(client, &event, 1,
- (Mask)0, NoEventMask, NullGrab);
- }
-}
-
-
-void
-miSendExposures(pWin, pRgn, dx, dy)
- WindowPtr pWin;
- RegionPtr pRgn;
- register int dx, dy;
-{
- register BoxPtr pBox;
- int numRects;
- register xEvent *pEvent, *pe;
- register int i;
-
- pBox = REGION_RECTS(pRgn);
- numRects = REGION_NUM_RECTS(pRgn);
- if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent))))
- return;
-
- for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
- {
- pe->u.u.type = Expose;
- pe->u.expose.window = pWin->drawable.id;
- pe->u.expose.x = pBox->x1 - dx;
- pe->u.expose.y = pBox->y1 - dy;
- pe->u.expose.width = pBox->x2 - pBox->x1;
- pe->u.expose.height = pBox->y2 - pBox->y1;
- pe->u.expose.count = i;
- }
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- int scrnum = pWin->drawable.pScreen->myNum;
- int x = 0, y = 0;
- XID realWin = 0;
-
- if(!pWin->parent) {
- x = panoramiXdataPtr[scrnum].x;
- y = panoramiXdataPtr[scrnum].y;
- pWin = WindowTable[0];
- realWin = pWin->drawable.id;
- } else if (scrnum) {
- PanoramiXRes *win;
- win = PanoramiXFindIDByScrnum(XRT_WINDOW,
- pWin->drawable.id, scrnum);
- if(!win) {
- DEALLOCATE_LOCAL(pEvent);
- return;
- }
- realWin = win->info[0].id;
- pWin = LookupIDByType(realWin, RT_WINDOW);
- }
- if(x || y || scrnum)
- for (i = 0; i < numRects; i++) {
- pEvent[i].u.expose.window = realWin;
- pEvent[i].u.expose.x += x;
- pEvent[i].u.expose.y += y;
- }
- }
-#endif
-
- DeliverEvents(pWin, pEvent, numRects, NullWindow);
-
- DEALLOCATE_LOCAL(pEvent);
-}
-
-void
-miWindowExposures(pWin, prgn, other_exposed)
- WindowPtr pWin;
- register RegionPtr prgn, other_exposed;
-{
- RegionPtr exposures = prgn;
- if (pWin->backStorage && prgn)
- /*
- * in some cases, backing store will cause a different
- * region to be exposed than needs to be repainted
- * (like when a window is mapped). RestoreAreas is
- * allowed to return a region other than prgn,
- * in which case this routine will free the resultant
- * region. If exposures is null, then no events will
- * be sent to the client; if prgn is empty
- * no areas will be repainted.
- */
- exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn);
- if ((prgn && !REGION_NIL(prgn)) ||
- (exposures && !REGION_NIL(exposures)) || other_exposed)
- {
- RegionRec expRec;
- int clientInterested;
-
- /*
- * Restore from backing-store FIRST.
- */
- clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask;
- if (other_exposed)
- {
- if (exposures)
- {
- REGION_UNION(pWin->drawable.pScreen, other_exposed,
- exposures,
- other_exposed);
- if (exposures != prgn)
- REGION_DESTROY(pWin->drawable.pScreen, exposures);
- }
- exposures = other_exposed;
- }
- if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT))
- {
- /*
- * If we have LOTS of rectangles, we decide to take the extents
- * and force an exposure on that. This should require much less
- * work overall, on both client and server. This is cheating, but
- * isn't prohibited by the protocol ("spontaneous combustion" :-).
- */
- BoxRec box;
-
- box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures);
- if (exposures == prgn) {
- exposures = &expRec;
- REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1);
- REGION_RESET( pWin->drawable.pScreen, prgn, &box);
- } else {
- REGION_RESET( pWin->drawable.pScreen, exposures, &box);
- REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures);
- }
- /* PaintWindowBackground doesn't clip, so we have to */
- REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList);
- /* need to clear out new areas of backing store, too */
- if (pWin->backStorage)
- (void) (* pWin->drawable.pScreen->ClearBackingStore)(
- pWin,
- box.x1 - pWin->drawable.x,
- box.y1 - pWin->drawable.y,
- box.x2 - box.x1,
- box.y2 - box.y1,
- FALSE);
- }
- if (prgn && !REGION_NIL(prgn))
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND);
- if (clientInterested && exposures && !REGION_NIL(exposures))
- miSendExposures(pWin, exposures,
- pWin->drawable.x, pWin->drawable.y);
- if (exposures == &expRec)
- {
- REGION_UNINIT( pWin->drawable.pScreen, exposures);
- }
- else if (exposures && exposures != prgn && exposures != other_exposed)
- REGION_DESTROY( pWin->drawable.pScreen, exposures);
- if (prgn)
- REGION_EMPTY( pWin->drawable.pScreen, prgn);
- }
- else if (exposures && exposures != prgn)
- REGION_DESTROY( pWin->drawable.pScreen, exposures);
-}
-
-
-/*
- this code is highly unlikely. it is not haile selassie.
-
- there is some hair here. we can't just use the window's
-clip region as it is, because if we are painting the border,
-the border is not in the client area and so we will be excluded
-when we validate the GC, and if we are painting a parent-relative
-background, the area we want to paint is in some other window.
-since we trust the code calling us to tell us to paint only areas
-that are really ours, we will temporarily give the window a
-clipList the size of the whole screen and an origin at (0,0).
-this more or less assumes that ddX code will do translation
-based on the window's absolute position, and that ValidateGC will
-look at clipList, and that no other fields from the
-window will be used. it's not possible to just draw
-in the root because it may be a different depth.
-
-to get the tile to align correctly we set the GC's tile origin to
-be the (x,y) of the window's upper left corner, after which we
-get the right bits when drawing into the root.
-
-because the clip_mask is being set to None, we may call DoChangeGC with
-fPointer set true, thus we no longer need to install the background or
-border tile in the resource table.
-*/
-
-static RESTYPE ResType = 0;
-static int numGCs = 0;
-static GCPtr screenContext[MAXSCREENS];
-
-/*ARGSUSED*/
-static int
-tossGC (
- pointer value,
- XID id)
-{
- GCPtr pGC = (GCPtr)value;
- screenContext[pGC->pScreen->myNum] = (GCPtr)NULL;
- FreeGC (pGC, id);
- numGCs--;
- if (!numGCs)
- ResType = 0;
-
- return 0;
-}
-
-
-void
-miPaintWindow(pWin, prgn, what)
-register WindowPtr pWin;
-RegionPtr prgn;
-int what;
-{
- int status;
-
- Bool usingScratchGC = FALSE;
- WindowPtr pRoot;
-
-#define FUNCTION 0
-#define FOREGROUND 1
-#define TILE 2
-#define FILLSTYLE 3
-#define ABSX 4
-#define ABSY 5
-#define CLIPMASK 6
-#define SUBWINDOW 7
-#define COUNT_BITS 8
-
- ChangeGCVal gcval[7];
- ChangeGCVal newValues [COUNT_BITS];
-
- BITS32 gcmask, index, mask;
- RegionRec prgnWin;
- DDXPointRec oldCorner;
- BoxRec box;
- WindowPtr pBgWin;
- GCPtr pGC;
- register int i;
- register BoxPtr pbox;
- register ScreenPtr pScreen = pWin->drawable.pScreen;
- register xRectangle *prect;
- int numRects;
-
- gcmask = 0;
-
- if (what == PW_BACKGROUND)
- {
- switch (pWin->backgroundState) {
- case None:
- return;
- case ParentRelative:
- (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what);
- return;
- case BackgroundPixel:
- newValues[FOREGROUND].val = pWin->background.pixel;
- newValues[FILLSTYLE].val = FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- break;
- case BackgroundPixmap:
- newValues[TILE].ptr = (pointer)pWin->background.pixmap;
- newValues[FILLSTYLE].val = FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- break;
- }
- }
- else
- {
- if (pWin->borderIsPixel)
- {
- newValues[FOREGROUND].val = pWin->border.pixel;
- newValues[FILLSTYLE].val = FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- }
- else
- {
- newValues[TILE].ptr = (pointer)pWin->border.pixmap;
- newValues[FILLSTYLE].val = FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- }
- }
-
- prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) *
- sizeof(xRectangle));
- if (!prect)
- return;
-
- newValues[FUNCTION].val = GXcopy;
- gcmask |= GCFunction | GCClipMask;
-
- i = pScreen->myNum;
- pRoot = WindowTable[i];
-
- pBgWin = pWin;
- if (what == PW_BORDER)
- {
- while (pBgWin->backgroundState == ParentRelative)
- pBgWin = pBgWin->parent;
- }
-
- if ((pWin->drawable.depth != pRoot->drawable.depth) ||
- (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel))
- {
- usingScratchGC = TRUE;
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
- if (!pGC)
- {
- DEALLOCATE_LOCAL(prect);
- return;
- }
- /*
- * mash the clip list so we can paint the border by
- * mangling the window in place, pretending it
- * spans the entire screen
- */
- if (what == PW_BORDER)
- {
- prgnWin = pWin->clipList;
- oldCorner.x = pWin->drawable.x;
- oldCorner.y = pWin->drawable.y;
- pWin->drawable.x = pWin->drawable.y = 0;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT(pScreen, &pWin->clipList, &box, 1);
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- newValues[ABSX].val = pBgWin->drawable.x;
- newValues[ABSY].val = pBgWin->drawable.y;
- }
- else
- {
- newValues[ABSX].val = 0;
- newValues[ABSY].val = 0;
- }
- } else {
- /*
- * draw the background to the root window
- */
- if (screenContext[i] == (GCPtr)NULL)
- {
- if (!ResType && !(ResType = CreateNewResourceType(tossGC)))
- return;
- screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0,
- (XID *)NULL, &status);
- if (!screenContext[i])
- return;
- numGCs++;
- if (!AddResource(FakeClientID(0), ResType,
- (pointer)screenContext[i]))
- return;
- }
- pGC = screenContext[i];
- newValues[SUBWINDOW].val = IncludeInferiors;
- newValues[ABSX].val = pBgWin->drawable.x;
- newValues[ABSY].val = pBgWin->drawable.y;
- gcmask |= GCSubwindowMode;
- pWin = pRoot;
- }
-
- if (pWin->backStorage)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
-
- mask = gcmask;
- gcmask = 0;
- i = 0;
- while (mask) {
- index = lowbit (mask);
- mask &= ~index;
- switch (index) {
- case GCFunction:
- if (pGC->alu != newValues[FUNCTION].val) {
- gcmask |= index;
- gcval[i++].val = newValues[FUNCTION].val;
- }
- break;
- case GCTileStipXOrigin:
- if ( pGC->patOrg.x != newValues[ABSX].val) {
- gcmask |= index;
- gcval[i++].val = newValues[ABSX].val;
- }
- break;
- case GCTileStipYOrigin:
- if ( pGC->patOrg.y != newValues[ABSY].val) {
- gcmask |= index;
- gcval[i++].val = newValues[ABSY].val;
- }
- break;
- case GCClipMask:
- if ( pGC->clientClipType != CT_NONE) {
- gcmask |= index;
- gcval[i++].val = CT_NONE;
- }
- break;
- case GCSubwindowMode:
- if ( pGC->subWindowMode != newValues[SUBWINDOW].val) {
- gcmask |= index;
- gcval[i++].val = newValues[SUBWINDOW].val;
- }
- break;
- case GCTile:
- if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr)
- {
- gcmask |= index;
- gcval[i++].ptr = newValues[TILE].ptr;
- }
- break;
- case GCFillStyle:
- if ( pGC->fillStyle != newValues[FILLSTYLE].val) {
- gcmask |= index;
- gcval[i++].val = newValues[FILLSTYLE].val;
- }
- break;
- case GCForeground:
- if ( pGC->fgPixel != newValues[FOREGROUND].val) {
- gcmask |= index;
- gcval[i++].val = newValues[FOREGROUND].val;
- }
- break;
- }
- }
-
- if (gcmask)
- dixChangeGC(NullClient, pGC, gcmask, NULL, gcval);
-
- if (pWin->drawable.serialNumber != pGC->serialNumber)
- ValidateGC((DrawablePtr)pWin, pGC);
-
- numRects = REGION_NUM_RECTS(prgn);
- pbox = REGION_RECTS(prgn);
- for (i= numRects; --i >= 0; pbox++, prect++)
- {
- prect->x = pbox->x1 - pWin->drawable.x;
- prect->y = pbox->y1 - pWin->drawable.y;
- prect->width = pbox->x2 - pbox->x1;
- prect->height = pbox->y2 - pbox->y1;
- }
- prect -= numRects;
- (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect);
- DEALLOCATE_LOCAL(prect);
-
- if (pWin->backStorage)
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing);
-
- if (usingScratchGC)
- {
- if (what == PW_BORDER)
- {
- REGION_UNINIT(pScreen, &pWin->clipList);
- pWin->clipList = prgnWin;
- pWin->drawable.x = oldCorner.x;
- pWin->drawable.y = oldCorner.y;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- FreeScratchGC(pGC);
- }
-}
-
-
-/* MICLEARDRAWABLE -- sets the entire drawable to the background color of
- * the GC. Useful when we have a scratch drawable and need to initialize
- * it. */
-void
-miClearDrawable(pDraw, pGC)
- DrawablePtr pDraw;
- GCPtr pGC;
-{
- XID fg = pGC->fgPixel;
- XID bg = pGC->bgPixel;
- xRectangle rect;
-
- rect.x = 0;
- rect.y = 0;
- rect.width = pDraw->width;
- rect.height = pDraw->height;
- DoChangeGC(pGC, GCForeground, &bg, 0);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
- DoChangeGC(pGC, GCForeground, &fg, 0);
- ValidateGC(pDraw, pGC);
-}
diff --git a/mi/mifillarc.c b/mi/mifillarc.c
deleted file mode 100644
index fa37d45be..000000000
--- a/mi/mifillarc.c
+++ /dev/null
@@ -1,813 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mifillarc.c,v 3.8 2003/07/16 01:38:56 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Bob Scheifler, MIT X Consortium
-
-********************************************************/
-
-/* $Xorg: mifillarc.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-#include <math.h>
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mifpoly.h"
-#include "mi.h"
-#include "mifillarc.h"
-
-#define QUADRANT (90 * 64)
-#define HALFCIRCLE (180 * 64)
-#define QUADRANT3 (270 * 64)
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define Dsin(d) sin((double)d*(M_PI/11520.0))
-#define Dcos(d) cos((double)d*(M_PI/11520.0))
-
-void
-miFillArcSetup(arc, info)
- register xArc *arc;
- register miFillArcRec *info;
-{
- info->y = arc->height >> 1;
- info->dy = arc->height & 1;
- info->yorg = arc->y + info->y;
- info->dx = arc->width & 1;
- info->xorg = arc->x + (arc->width >> 1) + info->dx;
- info->dx = 1 - info->dx;
- if (arc->width == arc->height)
- {
- /* (2x - 2xorg)^2 = d^2 - (2y - 2yorg)^2 */
- /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
- info->ym = 8;
- info->xm = 8;
- info->yk = info->y << 3;
- if (!info->dx)
- {
- info->xk = 0;
- info->e = -1;
- }
- else
- {
- info->y++;
- info->yk += 4;
- info->xk = -4;
- info->e = - (info->y << 3);
- }
- }
- else
- {
- /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
- /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
- info->ym = (arc->width * arc->width) << 3;
- info->xm = (arc->height * arc->height) << 3;
- info->yk = info->y * info->ym;
- if (!info->dy)
- info->yk -= info->ym >> 1;
- if (!info->dx)
- {
- info->xk = 0;
- info->e = - (info->xm >> 3);
- }
- else
- {
- info->y++;
- info->yk += info->ym;
- info->xk = -(info->xm >> 1);
- info->e = info->xk - info->yk;
- }
- }
-}
-
-void
-miFillArcDSetup(arc, info)
- register xArc *arc;
- register miFillArcDRec *info;
-{
- /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
- /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
- info->y = arc->height >> 1;
- info->dy = arc->height & 1;
- info->yorg = arc->y + info->y;
- info->dx = arc->width & 1;
- info->xorg = arc->x + (arc->width >> 1) + info->dx;
- info->dx = 1 - info->dx;
- info->ym = ((double)arc->width) * (arc->width * 8);
- info->xm = ((double)arc->height) * (arc->height * 8);
- info->yk = info->y * info->ym;
- if (!info->dy)
- info->yk -= info->ym / 2.0;
- if (!info->dx)
- {
- info->xk = 0;
- info->e = - (info->xm / 8.0);
- }
- else
- {
- info->y++;
- info->yk += info->ym;
- info->xk = -info->xm / 2.0;
- info->e = info->xk - info->yk;
- }
-}
-
-static void
-miGetArcEdge(
- register xArc *arc,
- register miSliceEdgePtr edge,
- int k,
- Bool top,
- Bool left )
-{
- register int xady, y;
-
- y = arc->height >> 1;
- if (!(arc->width & 1))
- y++;
- if (!top)
- {
- y = -y;
- if (arc->height & 1)
- y--;
- }
- xady = k + y * edge->dx;
- if (xady <= 0)
- edge->x = - ((-xady) / edge->dy + 1);
- else
- edge->x = (xady - 1) / edge->dy;
- edge->e = xady - edge->x * edge->dy;
- if ((top && (edge->dx < 0)) || (!top && (edge->dx > 0)))
- edge->e = edge->dy - edge->e + 1;
- if (left)
- edge->x++;
- edge->x += arc->x + (arc->width >> 1);
- if (edge->dx > 0)
- {
- edge->deltax = 1;
- edge->stepx = edge->dx / edge->dy;
- edge->dx = edge->dx % edge->dy;
- }
- else
- {
- edge->deltax = -1;
- edge->stepx = - ((-edge->dx) / edge->dy);
- edge->dx = (-edge->dx) % edge->dy;
- }
- if (!top)
- {
- edge->deltax = -edge->deltax;
- edge->stepx = -edge->stepx;
- }
-}
-
-void
-miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
- int angle;
- int width;
- int height;
- int *dxp;
- int *dyp;
- double *d_dxp;
- double *d_dyp;
-{
- int dx, dy;
- double d_dx, d_dy, scale;
- Bool negative_dx, negative_dy;
-
- switch (angle) {
- case 0:
- *dxp = -1;
- *dyp = 0;
- if (d_dxp) {
- *d_dxp = width / 2.0;
- *d_dyp = 0;
- }
- break;
- case QUADRANT:
- *dxp = 0;
- *dyp = 1;
- if (d_dxp) {
- *d_dxp = 0;
- *d_dyp = - height / 2.0;
- }
- break;
- case HALFCIRCLE:
- *dxp = 1;
- *dyp = 0;
- if (d_dxp) {
- *d_dxp = - width / 2.0;
- *d_dyp = 0;
- }
- break;
- case QUADRANT3:
- *dxp = 0;
- *dyp = -1;
- if (d_dxp) {
- *d_dxp = 0;
- *d_dyp = height / 2.0;
- }
- break;
- default:
- d_dx = Dcos(angle) * width;
- d_dy = Dsin(angle) * height;
- if (d_dxp) {
- *d_dxp = d_dx / 2.0;
- *d_dyp = - d_dy / 2.0;
- }
- negative_dx = FALSE;
- if (d_dx < 0.0)
- {
- d_dx = -d_dx;
- negative_dx = TRUE;
- }
- negative_dy = FALSE;
- if (d_dy < 0.0)
- {
- d_dy = -d_dy;
- negative_dy = TRUE;
- }
- scale = d_dx;
- if (d_dy > d_dx)
- scale = d_dy;
- dx = floor ((d_dx * 32768) / scale + 0.5);
- if (negative_dx)
- dx = -dx;
- *dxp = dx;
- dy = floor ((d_dy * 32768) / scale + 0.5);
- if (negative_dy)
- dy = -dy;
- *dyp = dy;
- break;
- }
-}
-
-static void
-miGetPieEdge(
- register xArc *arc,
- register int angle,
- register miSliceEdgePtr edge,
- Bool top,
- Bool left )
-{
- register int k;
- int dx, dy;
-
- miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, 0, 0);
-
- if (dy == 0)
- {
- edge->x = left ? -65536 : 65536;
- edge->stepx = 0;
- edge->e = 0;
- edge->dx = -1;
- return;
- }
- if (dx == 0)
- {
- edge->x = arc->x + (arc->width >> 1);
- if (left && (arc->width & 1))
- edge->x++;
- else if (!left && !(arc->width & 1))
- edge->x--;
- edge->stepx = 0;
- edge->e = 0;
- edge->dx = -1;
- return;
- }
- if (dy < 0) {
- dx = -dx;
- dy = -dy;
- }
- k = (arc->height & 1) ? dx : 0;
- if (arc->width & 1)
- k += dy;
- edge->dx = dx << 1;
- edge->dy = dy << 1;
- miGetArcEdge(arc, edge, k, top, left);
-}
-
-void
-miFillArcSliceSetup(arc, slice, pGC)
- register xArc *arc;
- register miArcSliceRec *slice;
- GCPtr pGC;
-{
- register int angle1, angle2;
-
- angle1 = arc->angle1;
- if (arc->angle2 < 0)
- {
- angle2 = angle1;
- angle1 += arc->angle2;
- }
- else
- angle2 = angle1 + arc->angle2;
- while (angle1 < 0)
- angle1 += FULLCIRCLE;
- while (angle1 >= FULLCIRCLE)
- angle1 -= FULLCIRCLE;
- while (angle2 < 0)
- angle2 += FULLCIRCLE;
- while (angle2 >= FULLCIRCLE)
- angle2 -= FULLCIRCLE;
- slice->min_top_y = 0;
- slice->max_top_y = arc->height >> 1;
- slice->min_bot_y = 1 - (arc->height & 1);
- slice->max_bot_y = slice->max_top_y - 1;
- slice->flip_top = FALSE;
- slice->flip_bot = FALSE;
- if (pGC->arcMode == ArcPieSlice)
- {
- slice->edge1_top = (angle1 < HALFCIRCLE);
- slice->edge2_top = (angle2 <= HALFCIRCLE);
- if ((angle2 == 0) || (angle1 == HALFCIRCLE))
- {
- if (angle2 ? slice->edge2_top : slice->edge1_top)
- slice->min_top_y = slice->min_bot_y;
- else
- slice->min_top_y = arc->height;
- slice->min_bot_y = 0;
- }
- else if ((angle1 == 0) || (angle2 == HALFCIRCLE))
- {
- slice->min_top_y = slice->min_bot_y;
- if (angle1 ? slice->edge1_top : slice->edge2_top)
- slice->min_bot_y = arc->height;
- else
- slice->min_bot_y = 0;
- }
- else if (slice->edge1_top == slice->edge2_top)
- {
- if (angle2 < angle1)
- {
- slice->flip_top = slice->edge1_top;
- slice->flip_bot = !slice->edge1_top;
- }
- else if (slice->edge1_top)
- {
- slice->min_top_y = 1;
- slice->min_bot_y = arc->height;
- }
- else
- {
- slice->min_bot_y = 0;
- slice->min_top_y = arc->height;
- }
- }
- miGetPieEdge(arc, angle1, &slice->edge1,
- slice->edge1_top, !slice->edge1_top);
- miGetPieEdge(arc, angle2, &slice->edge2,
- slice->edge2_top, slice->edge2_top);
- }
- else
- {
- double w2, h2, x1, y1, x2, y2, dx, dy, scale;
- int signdx, signdy, y, k;
- Bool isInt1 = TRUE, isInt2 = TRUE;
-
- w2 = (double)arc->width / 2.0;
- h2 = (double)arc->height / 2.0;
- if ((angle1 == 0) || (angle1 == HALFCIRCLE))
- {
- x1 = angle1 ? -w2 : w2;
- y1 = 0.0;
- }
- else if ((angle1 == QUADRANT) || (angle1 == QUADRANT3))
- {
- x1 = 0.0;
- y1 = (angle1 == QUADRANT) ? h2 : -h2;
- }
- else
- {
- isInt1 = FALSE;
- x1 = Dcos(angle1) * w2;
- y1 = Dsin(angle1) * h2;
- }
- if ((angle2 == 0) || (angle2 == HALFCIRCLE))
- {
- x2 = angle2 ? -w2 : w2;
- y2 = 0.0;
- }
- else if ((angle2 == QUADRANT) || (angle2 == QUADRANT3))
- {
- x2 = 0.0;
- y2 = (angle2 == QUADRANT) ? h2 : -h2;
- }
- else
- {
- isInt2 = FALSE;
- x2 = Dcos(angle2) * w2;
- y2 = Dsin(angle2) * h2;
- }
- dx = x2 - x1;
- dy = y2 - y1;
- if (arc->height & 1)
- {
- y1 -= 0.5;
- y2 -= 0.5;
- }
- if (arc->width & 1)
- {
- x1 += 0.5;
- x2 += 0.5;
- }
- if (dy < 0.0)
- {
- dy = -dy;
- signdy = -1;
- }
- else
- signdy = 1;
- if (dx < 0.0)
- {
- dx = -dx;
- signdx = -1;
- }
- else
- signdx = 1;
- if (isInt1 && isInt2)
- {
- slice->edge1.dx = dx * 2;
- slice->edge1.dy = dy * 2;
- }
- else
- {
- scale = (dx > dy) ? dx : dy;
- slice->edge1.dx = floor((dx * 32768) / scale + .5);
- slice->edge1.dy = floor((dy * 32768) / scale + .5);
- }
- if (!slice->edge1.dy)
- {
- if (signdx < 0)
- {
- y = floor(y1 + 1.0);
- if (y >= 0)
- {
- slice->min_top_y = y;
- slice->min_bot_y = arc->height;
- }
- else
- {
- slice->max_bot_y = -y - (arc->height & 1);
- }
- }
- else
- {
- y = floor(y1);
- if (y >= 0)
- slice->max_top_y = y;
- else
- {
- slice->min_top_y = arc->height;
- slice->min_bot_y = -y - (arc->height & 1);
- }
- }
- slice->edge1_top = TRUE;
- slice->edge1.x = 65536;
- slice->edge1.stepx = 0;
- slice->edge1.e = 0;
- slice->edge1.dx = -1;
- slice->edge2 = slice->edge1;
- slice->edge2_top = FALSE;
- }
- else if (!slice->edge1.dx)
- {
- if (signdy < 0)
- x1 -= 1.0;
- slice->edge1.x = ceil(x1);
- slice->edge1_top = signdy < 0;
- slice->edge1.x += arc->x + (arc->width >> 1);
- slice->edge1.stepx = 0;
- slice->edge1.e = 0;
- slice->edge1.dx = -1;
- slice->edge2_top = !slice->edge1_top;
- slice->edge2 = slice->edge1;
- }
- else
- {
- if (signdx < 0)
- slice->edge1.dx = -slice->edge1.dx;
- if (signdy < 0)
- slice->edge1.dx = -slice->edge1.dx;
- k = ceil(((x1 + x2) * slice->edge1.dy - (y1 + y2) * slice->edge1.dx) / 2.0);
- slice->edge2.dx = slice->edge1.dx;
- slice->edge2.dy = slice->edge1.dy;
- slice->edge1_top = signdy < 0;
- slice->edge2_top = !slice->edge1_top;
- miGetArcEdge(arc, &slice->edge1, k,
- slice->edge1_top, !slice->edge1_top);
- miGetArcEdge(arc, &slice->edge2, k,
- slice->edge2_top, slice->edge2_top);
- }
- }
-}
-
-#define ADDSPANS() \
- pts->x = xorg - x; \
- pts->y = yorg - y; \
- *wids = slw; \
- pts++; \
- wids++; \
- if (miFillArcLower(slw)) \
- { \
- pts->x = xorg - x; \
- pts->y = yorg + y + dy; \
- pts++; \
- *wids++ = slw; \
- }
-
-static void
-miFillEllipseI(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc )
-{
- register int x, y, e;
- int yk, xk, ym, xm, dx, dy, xorg, yorg;
- int slw;
- miFillArcRec info;
- DDXPointPtr points;
- register DDXPointPtr pts;
- int *widths;
- register int *wids;
-
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height);
- if (!points)
- return;
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height);
- if (!widths)
- {
- DEALLOCATE_LOCAL(points);
- return;
- }
- miFillArcSetup(arc, &info);
- MIFILLARCSETUP();
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- }
- pts = points;
- wids = widths;
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- ADDSPANS();
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- DEALLOCATE_LOCAL(widths);
- DEALLOCATE_LOCAL(points);
-}
-
-static void
-miFillEllipseD(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc )
-{
- register int x, y;
- int xorg, yorg, dx, dy, slw;
- double e, yk, xk, ym, xm;
- miFillArcDRec info;
- DDXPointPtr points;
- register DDXPointPtr pts;
- int *widths;
- register int *wids;
-
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height);
- if (!points)
- return;
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height);
- if (!widths)
- {
- DEALLOCATE_LOCAL(points);
- return;
- }
- miFillArcDSetup(arc, &info);
- MIFILLARCSETUP();
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- }
- pts = points;
- wids = widths;
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- ADDSPANS();
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- DEALLOCATE_LOCAL(widths);
- DEALLOCATE_LOCAL(points);
-}
-
-#define ADDSPAN(l,r) \
- if (r >= l) \
- { \
- pts->x = l; \
- pts->y = ya; \
- pts++; \
- *wids++ = r - l + 1; \
- }
-
-#define ADDSLICESPANS(flip) \
- if (!flip) \
- { \
- ADDSPAN(xl, xr); \
- } \
- else \
- { \
- xc = xorg - x; \
- ADDSPAN(xc, xr); \
- xc += slw - 1; \
- ADDSPAN(xl, xc); \
- }
-
-static void
-miFillArcSliceI(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc )
-{
- int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
- register int x, y, e;
- miFillArcRec info;
- miArcSliceRec slice;
- int ya, xl, xr, xc;
- DDXPointPtr points;
- register DDXPointPtr pts;
- int *widths;
- register int *wids;
-
- miFillArcSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- slw = arc->height;
- if (slice.flip_top || slice.flip_bot)
- slw += (arc->height >> 1) + 1;
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw);
- if (!points)
- return;
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw);
- if (!widths)
- {
- DEALLOCATE_LOCAL(points);
- return;
- }
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- }
- pts = points;
- wids = widths;
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- ya = yorg - y;
- MIARCSLICEUPPER(xl, xr, slice, slw);
- ADDSLICESPANS(slice.flip_top);
- }
- if (miFillSliceLower(slice))
- {
- ya = yorg + y + dy;
- MIARCSLICELOWER(xl, xr, slice, slw);
- ADDSLICESPANS(slice.flip_bot);
- }
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- DEALLOCATE_LOCAL(widths);
- DEALLOCATE_LOCAL(points);
-}
-
-static void
-miFillArcSliceD(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *arc )
-{
- register int x, y;
- int dx, dy, xorg, yorg, slw;
- double e, yk, xk, ym, xm;
- miFillArcDRec info;
- miArcSliceRec slice;
- int ya, xl, xr, xc;
- DDXPointPtr points;
- register DDXPointPtr pts;
- int *widths;
- register int *wids;
-
- miFillArcDSetup(arc, &info);
- miFillArcSliceSetup(arc, &slice, pGC);
- MIFILLARCSETUP();
- slw = arc->height;
- if (slice.flip_top || slice.flip_bot)
- slw += (arc->height >> 1) + 1;
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw);
- if (!points)
- return;
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw);
- if (!widths)
- {
- DEALLOCATE_LOCAL(points);
- return;
- }
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- slice.edge1.x += pDraw->x;
- slice.edge2.x += pDraw->x;
- }
- pts = points;
- wids = widths;
- while (y > 0)
- {
- MIFILLARCSTEP(slw);
- MIARCSLICESTEP(slice.edge1);
- MIARCSLICESTEP(slice.edge2);
- if (miFillSliceUpper(slice))
- {
- ya = yorg - y;
- MIARCSLICEUPPER(xl, xr, slice, slw);
- ADDSLICESPANS(slice.flip_top);
- }
- if (miFillSliceLower(slice))
- {
- ya = yorg + y + dy;
- MIARCSLICELOWER(xl, xr, slice, slw);
- ADDSLICESPANS(slice.flip_bot);
- }
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
- DEALLOCATE_LOCAL(widths);
- DEALLOCATE_LOCAL(points);
-}
-
-/* MIPOLYFILLARC -- The public entry for the PolyFillArc request.
- * Since we don't have to worry about overlapping segments, we can just
- * fill each arc as it comes.
- */
-void
-miPolyFillArc(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- register int i;
- register xArc *arc;
-
- for(i = narcs, arc = parcs; --i >= 0; arc++)
- {
- if (miFillArcEmpty(arc))
- continue;;
- if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE))
- {
- if (miCanFillArc(arc))
- miFillEllipseI(pDraw, pGC, arc);
- else
- miFillEllipseD(pDraw, pGC, arc);
- }
- else
- {
- if (miCanFillArc(arc))
- miFillArcSliceI(pDraw, pGC, arc);
- else
- miFillArcSliceD(pDraw, pGC, arc);
- }
- }
-}
diff --git a/mi/mifillarc.h b/mi/mifillarc.h
deleted file mode 100644
index ed8503f15..000000000
--- a/mi/mifillarc.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mifillarc.h,v 3.7 2001/12/14 20:00:22 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mifillarc.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-#ifndef __MIFILLARC_H__
-#define __MIFILLARC_H__
-
-#define FULLCIRCLE (360 * 64)
-
-typedef struct _miFillArc {
- int xorg, yorg;
- int y;
- int dx, dy;
- int e;
- int ym, yk, xm, xk;
-} miFillArcRec;
-
-/* could use 64-bit integers */
-typedef struct _miFillArcD {
- int xorg, yorg;
- int y;
- int dx, dy;
- double e;
- double ym, yk, xm, xk;
-} miFillArcDRec;
-
-#define miFillArcEmpty(arc) (!(arc)->angle2 || \
- !(arc)->width || !(arc)->height || \
- (((arc)->width == 1) && ((arc)->height & 1)))
-
-#define miCanFillArc(arc) (((arc)->width == (arc)->height) || \
- (((arc)->width <= 800) && ((arc)->height <= 800)))
-
-#define MIFILLARCSETUP() \
- x = 0; \
- y = info.y; \
- e = info.e; \
- xk = info.xk; \
- xm = info.xm; \
- yk = info.yk; \
- ym = info.ym; \
- dx = info.dx; \
- dy = info.dy; \
- xorg = info.xorg; \
- yorg = info.yorg
-
-#define MIFILLARCSTEP(slw) \
- e += yk; \
- while (e >= 0) \
- { \
- x++; \
- xk -= xm; \
- e += xk; \
- } \
- y--; \
- yk -= ym; \
- slw = (x << 1) + dx; \
- if ((e == xk) && (slw > 1)) \
- slw--
-
-#define MIFILLCIRCSTEP(slw) MIFILLARCSTEP(slw)
-#define MIFILLELLSTEP(slw) MIFILLARCSTEP(slw)
-
-#define miFillArcLower(slw) (((y + dy) != 0) && ((slw > 1) || (e != xk)))
-
-typedef struct _miSliceEdge {
- int x;
- int stepx;
- int deltax;
- int e;
- int dy;
- int dx;
-} miSliceEdgeRec, *miSliceEdgePtr;
-
-typedef struct _miArcSlice {
- miSliceEdgeRec edge1, edge2;
- int min_top_y, max_top_y;
- int min_bot_y, max_bot_y;
- Bool edge1_top, edge2_top;
- Bool flip_top, flip_bot;
-} miArcSliceRec;
-
-#define MIARCSLICESTEP(edge) \
- edge.x -= edge.stepx; \
- edge.e -= edge.dx; \
- if (edge.e <= 0) \
- { \
- edge.x -= edge.deltax; \
- edge.e += edge.dy; \
- }
-
-#define miFillSliceUpper(slice) \
- ((y >= slice.min_top_y) && (y <= slice.max_top_y))
-
-#define miFillSliceLower(slice) \
- ((y >= slice.min_bot_y) && (y <= slice.max_bot_y))
-
-#define MIARCSLICEUPPER(xl,xr,slice,slw) \
- xl = xorg - x; \
- xr = xl + slw - 1; \
- if (slice.edge1_top && (slice.edge1.x < xr)) \
- xr = slice.edge1.x; \
- if (slice.edge2_top && (slice.edge2.x > xl)) \
- xl = slice.edge2.x;
-
-#define MIARCSLICELOWER(xl,xr,slice,slw) \
- xl = xorg - x; \
- xr = xl + slw - 1; \
- if (!slice.edge1_top && (slice.edge1.x > xl)) \
- xl = slice.edge1.x; \
- if (!slice.edge2_top && (slice.edge2.x < xr)) \
- xr = slice.edge2.x;
-
-#define MIWIDEARCSETUP(x,y,dy,slw,e,xk,xm,yk,ym) \
- x = 0; \
- y = slw >> 1; \
- yk = y << 3; \
- xm = 8; \
- ym = 8; \
- if (dy) \
- { \
- xk = 0; \
- if (slw & 1) \
- e = -1; \
- else \
- e = -(y << 2) - 2; \
- } \
- else \
- { \
- y++; \
- yk += 4; \
- xk = -4; \
- if (slw & 1) \
- e = -(y << 2) - 3; \
- else \
- e = - (y << 3); \
- }
-
-#define MIFILLINARCSTEP(slw) \
- ine += inyk; \
- while (ine >= 0) \
- { \
- inx++; \
- inxk -= inxm; \
- ine += inxk; \
- } \
- iny--; \
- inyk -= inym; \
- slw = (inx << 1) + dx; \
- if ((ine == inxk) && (slw > 1)) \
- slw--
-
-#define miFillInArcLower(slw) (((iny + dy) != 0) && \
- ((slw > 1) || (ine != inxk)))
-
-extern int miFreeArcCache(
- pointer /*data*/,
- XID /*id*/
-);
-
-extern struct finalSpan *realAllocSpan(
- void
-);
-
-extern void miFillArcSetup(
- xArc * /*arc*/,
- miFillArcRec * /*info*/
-);
-
-extern void miFillArcDSetup(
- xArc * /*arc*/,
- miFillArcDRec * /*info*/
-);
-
-extern void miEllipseAngleToSlope(
- int /*angle*/,
- int /*width*/,
- int /*height*/,
- int * /*dxp*/,
- int * /*dyp*/,
- double * /*d_dxp*/,
- double * /*d_dyp*/
-);
-
-extern void miFillArcSliceSetup(
- xArc * /*arc*/,
- miArcSliceRec * /*slice*/,
- GCPtr /*pGC*/
-);
-
-#endif /* __MIFILLARC_H__ */
diff --git a/mi/mifillrct.c b/mi/mifillrct.c
deleted file mode 100644
index be2c58dfe..000000000
--- a/mi/mifillrct.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mifillrct.c,v 1.3 2001/12/14 20:00:22 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mifillrct.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xprotostr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmap.h"
-#include "mi.h"
-#include "misc.h"
-
-/* mi rectangles
- written by newman, with debts to all and sundry
-*/
-
-/* MIPOLYFILLRECT -- public entry for PolyFillRect request
- * very straight forward: translate rectangles if necessary
- * then call FillSpans to fill each rectangle. We let FillSpans worry about
- * clipping to the destination
- */
-void
-miPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- int i;
- register int height;
- register int width;
- register xRectangle *prect;
- int xorg;
- register int yorg;
- int maxheight;
- DDXPointPtr pptFirst;
- register DDXPointPtr ppt;
- int *pwFirst;
- register int *pw;
-
- if (pGC->miTranslate)
- {
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- prect = prectInit;
- maxheight = 0;
- for (i = 0; i<nrectFill; i++, prect++)
- {
- prect->x += xorg;
- prect->y += yorg;
- maxheight = max(maxheight, prect->height);
- }
- }
- else
- {
- prect = prectInit;
- maxheight = 0;
- for (i = 0; i<nrectFill; i++, prect++)
- maxheight = max(maxheight, prect->height);
- }
-
- pptFirst = (DDXPointPtr) ALLOCATE_LOCAL(maxheight * sizeof(DDXPointRec));
- pwFirst = (int *) ALLOCATE_LOCAL(maxheight * sizeof(int));
- if(!pptFirst || !pwFirst)
- {
- if (pwFirst) DEALLOCATE_LOCAL(pwFirst);
- if (pptFirst) DEALLOCATE_LOCAL(pptFirst);
- return;
- }
-
- prect = prectInit;
- while(nrectFill--)
- {
- ppt = pptFirst;
- pw = pwFirst;
- height = prect->height;
- width = prect->width;
- xorg = prect->x;
- yorg = prect->y;
- while(height--)
- {
- *pw++ = width;
- ppt->x = xorg;
- ppt->y = yorg;
- ppt++;
- yorg++;
- }
- (* pGC->ops->FillSpans)(pDrawable, pGC,
- prect->height, pptFirst, pwFirst,
- 1);
- prect++;
- }
- DEALLOCATE_LOCAL(pwFirst);
- DEALLOCATE_LOCAL(pptFirst);
-}
diff --git a/mi/mifpoly.h b/mi/mifpoly.h
deleted file mode 100644
index 837cf7b20..000000000
--- a/mi/mifpoly.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $Xorg: mifpoly.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/mi/mifpoly.h,v 1.4 2001/12/14 20:00:22 dawes Exp $ */
-
-#ifndef __MIFPOLY_H__
-#define __MIFPOLY_H__
-
-#define EPSILON 0.000001
-#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON)
-#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON)
-#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
- (b) - (a) <= 0.5)
-#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
-#define ISZERO(x) (Fabs((x)) <= EPSILON)
-#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
-#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
-#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
-
-#define NotEnd 0
-#define FirstEnd 1
-#define SecondEnd 2
-
-#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */
-#define D2SECANT 5.21671526231167 /* 1/2*sin(11/2) - max extension per width */
-
-#ifdef NOINLINEICEIL
-#define ICEIL(x) ((int)ceil(x))
-#else
-#ifdef __GNUC__
-static __inline int ICEIL(double x)
-{
- int _cTmp = x;
- return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
-}
-#else
-#define ICEIL(x) ((((x) == (_cTmp = (x))) || ((x) < 0.0)) ? _cTmp : _cTmp+1)
-#define ICEILTEMPDECL static int _cTmp;
-#endif
-#endif
-
-/* Point with sub-pixel positioning. In this case we use doubles, but
- * see mifpolycon.c for other suggestions
- */
-typedef struct _SppPoint {
- double x, y;
-} SppPointRec, *SppPointPtr;
-
-typedef struct _SppArc {
- double x, y, width, height;
- double angle1, angle2;
-} SppArcRec, *SppArcPtr;
-
-/* mifpolycon.c */
-
-extern void miFillSppPoly(
- DrawablePtr /*dst*/,
- GCPtr /*pgc*/,
- int /*count*/,
- SppPointPtr /*ptsIn*/,
- int /*xTrans*/,
- int /*yTrans*/,
- double /*xFtrans*/,
- double /*yFtrans*/
-);
-
-#endif /* __MIFPOLY_H__ */
diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c
deleted file mode 100644
index 93999ea7d..000000000
--- a/mi/mifpolycon.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mifpolycon.c,v 1.3 2001/12/14 20:00:23 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mifpolycon.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include <math.h>
-#include "X.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "mifpoly.h"
-
-static int GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans,
- int *by, int *ty);
-
-#ifdef ICEILTEMPDECL
-ICEILTEMPDECL
-#endif
-
-/*
- * Written by Todd Newman; April. 1987.
- *
- * Fill a convex polygon. If the given polygon
- * is not convex, then the result is undefined.
- * The algorithm is to order the edges from smallest
- * y to largest by partitioning the array into a left
- * edge list and a right edge list. The algorithm used
- * to traverse each edge is digital differencing analyzer
- * line algorithm with y as the major axis. There's some funny linear
- * interpolation involved because of the subpixel postioning.
- */
-void
-miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans)
- DrawablePtr dst;
- GCPtr pgc;
- int count; /* number of points */
- SppPointPtr ptsIn; /* the points */
- int xTrans, yTrans; /* Translate each point by this */
- double xFtrans, yFtrans; /* translate before conversion
- by this amount. This provides
- a mechanism to match rounding
- errors with any shape that must
- meet the polygon exactly.
- */
-{
- double xl = 0.0, xr = 0.0, /* x vals of left and right edges */
- ml = 0.0, /* left edge slope */
- mr = 0.0, /* right edge slope */
- dy, /* delta y */
- i; /* loop counter */
- int y, /* current scanline */
- j,
- imin, /* index of vertex with smallest y */
- ymin, /* y-extents of polygon */
- ymax,
- *width,
- *FirstWidth, /* output buffer */
- *Marked; /* set if this vertex has been used */
- register int left, right, /* indices to first endpoints */
- nextleft,
- nextright; /* indices to second endpoints */
- DDXPointPtr ptsOut,
- FirstPoint; /* output buffer */
-
- if (pgc->miTranslate)
- {
- xTrans += dst->x;
- yTrans += dst->y;
- }
-
- imin = GetFPolyYBounds(ptsIn, count, yFtrans, &ymin, &ymax);
-
- y = ymax - ymin + 1;
- if ((count < 3) || (y <= 0))
- return;
- ptsOut = FirstPoint = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * y);
- width = FirstWidth = (int *) ALLOCATE_LOCAL(sizeof(int) * y);
- Marked = (int *) ALLOCATE_LOCAL(sizeof(int) * count);
-
- if(!ptsOut || !width || !Marked)
- {
- if (Marked) DEALLOCATE_LOCAL(Marked);
- if (width) DEALLOCATE_LOCAL(width);
- if (ptsOut) DEALLOCATE_LOCAL(ptsOut);
- return;
- }
-
- for(j = 0; j < count; j++)
- Marked[j] = 0;
- nextleft = nextright = imin;
- Marked[imin] = -1;
- y = ICEIL(ptsIn[nextleft].y + yFtrans);
-
- /*
- * loop through all edges of the polygon
- */
- do
- {
- /* add a left edge if we need to */
- if ((y > (ptsIn[nextleft].y + yFtrans) ||
- ISEQUAL(y, ptsIn[nextleft].y + yFtrans)) &&
- Marked[nextleft] != 1)
- {
- Marked[nextleft]++;
- left = nextleft++;
-
- /* find the next edge, considering the end conditions */
- if (nextleft >= count)
- nextleft = 0;
-
- /* now compute the starting point and slope */
- dy = ptsIn[nextleft].y - ptsIn[left].y;
- if (dy != 0.0)
- {
- ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy;
- dy = y - (ptsIn[left].y + yFtrans);
- xl = (ptsIn[left].x + xFtrans) + ml * max(dy, 0);
- }
- }
-
- /* add a right edge if we need to */
- if ((y > ptsIn[nextright].y + yFtrans) ||
- (ISEQUAL(y, ptsIn[nextright].y + yFtrans)
- && Marked[nextright] != 1))
- {
- Marked[nextright]++;
- right = nextright--;
-
- /* find the next edge, considering the end conditions */
- if (nextright < 0)
- nextright = count - 1;
-
- /* now compute the starting point and slope */
- dy = ptsIn[nextright].y - ptsIn[right].y;
- if (dy != 0.0)
- {
- mr = (ptsIn[nextright].x - ptsIn[right].x) / dy;
- dy = y - (ptsIn[right].y + yFtrans);
- xr = (ptsIn[right].x + xFtrans) + mr * max(dy, 0);
- }
- }
-
-
- /*
- * generate scans to fill while we still have
- * a right edge as well as a left edge.
- */
- i = (min(ptsIn[nextleft].y, ptsIn[nextright].y) + yFtrans) - y;
-
- if (i < EPSILON)
- {
- if(Marked[nextleft] && Marked[nextright])
- {
- /* Arrgh, we're trapped! (no more points)
- * Out, we've got to get out of here before this decadence saps
- * our will completely! */
- break;
- }
- continue;
- }
- else
- {
- j = (int) i;
- if(!j)
- j++;
- }
- while (j > 0)
- {
- int cxl, cxr;
-
- ptsOut->y = (y) + yTrans;
-
- cxl = ICEIL(xl);
- cxr = ICEIL(xr);
- /* reverse the edges if necessary */
- if (xl < xr)
- {
- *(width++) = cxr - cxl;
- (ptsOut++)->x = cxl + xTrans;
- }
- else
- {
- *(width++) = cxl - cxr;
- (ptsOut++)->x = cxr + xTrans;
- }
- y++;
-
- /* increment down the edges */
- xl += ml;
- xr += mr;
- j--;
- }
- } while (y <= ymax);
-
- /* Finally, fill the spans we've collected */
- (*pgc->ops->FillSpans)(dst, pgc,
- ptsOut-FirstPoint, FirstPoint, FirstWidth, 1);
- DEALLOCATE_LOCAL(Marked);
- DEALLOCATE_LOCAL(FirstWidth);
- DEALLOCATE_LOCAL(FirstPoint);
-}
-
-
-/* Find the index of the point with the smallest y.also return the
- * smallest and largest y */
-static
-int
-GetFPolyYBounds(
- register SppPointPtr pts,
- int n,
- double yFtrans,
- int *by,
- int *ty)
-{
- register SppPointPtr ptMin;
- double ymin, ymax;
- SppPointPtr ptsStart = pts;
-
- ptMin = pts;
- ymin = ymax = (pts++)->y;
-
- while (--n > 0) {
- if (pts->y < ymin)
- {
- ptMin = pts;
- ymin = pts->y;
- }
- if(pts->y > ymax)
- ymax = pts->y;
-
- pts++;
- }
-
- *by = ICEIL(ymin + yFtrans);
- *ty = ICEIL(ymax + yFtrans - 1);
- return(ptMin-ptsStart);
-}
diff --git a/mi/migc.c b/mi/migc.c
deleted file mode 100644
index 29eec9749..000000000
--- a/mi/migc.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Xorg: migc.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-/* $XFree86: xc/programs/Xserver/mi/migc.c,v 1.9 2001/12/14 20:00:23 dawes Exp $ */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "migc.h"
-
-/* ARGSUSED */
-void
-miChangeGC(pGC, mask)
- GCPtr pGC;
- unsigned long mask;
-{
- return;
-}
-
-void
-miDestroyGC(pGC)
- GCPtr pGC;
-{
- if (pGC->pRotatedPixmap)
- (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap);
- if (pGC->freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- miDestroyGCOps(pGC->ops);
-}
-
-/*
- * create a private op array for a gc
- */
-
-GCOpsPtr
-miCreateGCOps(prototype)
- GCOpsPtr prototype;
-{
- GCOpsPtr ret;
-
- /* XXX */ Must_have_memory = TRUE;
- ret = (GCOpsPtr) xalloc(sizeof(GCOps));
- /* XXX */ Must_have_memory = FALSE;
- if (!ret)
- return 0;
- *ret = *prototype;
- ret->devPrivate.val = 1;
- return ret;
-}
-
-void
-miDestroyGCOps(ops)
- GCOpsPtr ops;
-{
- if (ops->devPrivate.val)
- xfree(ops);
-}
-
-
-void
-miDestroyClip(pGC)
- GCPtr pGC;
-{
- if (pGC->clientClipType == CT_NONE)
- return;
- else if (pGC->clientClipType == CT_PIXMAP)
- {
- (*pGC->pScreen->DestroyPixmap) ((PixmapPtr) (pGC->clientClip));
- }
- else
- {
- /*
- * we know we'll never have a list of rectangles, since ChangeClip
- * immediately turns them into a region
- */
- REGION_DESTROY(pGC->pScreen, pGC->clientClip);
- }
- pGC->clientClip = NULL;
- pGC->clientClipType = CT_NONE;
-}
-
-void
-miChangeClip(pGC, type, pvalue, nrects)
- GCPtr pGC;
- int type;
- pointer pvalue;
- int nrects;
-{
- (*pGC->funcs->DestroyClip) (pGC);
- if (type == CT_PIXMAP)
- {
- /* convert the pixmap to a region */
- pGC->clientClip = (pointer) BITMAP_TO_REGION(pGC->pScreen,
- (PixmapPtr) pvalue);
- (*pGC->pScreen->DestroyPixmap) (pvalue);
- }
- else if (type == CT_REGION)
- {
- /* stuff the region in the GC */
- pGC->clientClip = pvalue;
- }
- else if (type != CT_NONE)
- {
- pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects,
- (xRectangle *) pvalue,
- type);
- xfree(pvalue);
- }
- pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE;
- pGC->stateChanges |= GCClipMask;
-}
-
-void
-miCopyClip(pgcDst, pgcSrc)
- GCPtr pgcDst, pgcSrc;
-{
- RegionPtr prgnNew;
-
- switch (pgcSrc->clientClipType)
- {
- case CT_PIXMAP:
- ((PixmapPtr) pgcSrc->clientClip)->refcnt++;
- /* Fall through !! */
- case CT_NONE:
- (*pgcDst->funcs->ChangeClip) (pgcDst, (int) pgcSrc->clientClipType,
- pgcSrc->clientClip, 0);
- break;
- case CT_REGION:
- prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1);
- REGION_COPY(pgcDst->pScreen, prgnNew,
- (RegionPtr) (pgcSrc->clientClip));
- (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0);
- break;
- }
-}
-
-/* ARGSUSED */
-void
-miCopyGC(pGCSrc, changes, pGCDst)
- GCPtr pGCSrc;
- unsigned long changes;
- GCPtr pGCDst;
-{
- return;
-}
-
-void
-miComputeCompositeClip(pGC, pDrawable)
- GCPtr pGC;
- DrawablePtr pDrawable;
-{
- ScreenPtr pScreen;
-
- /* This prevents warnings about pScreen not being used. */
- pGC->pScreen = pScreen = pGC->pScreen;
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors)
- {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- }
- else
- {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy (or
- * maybe re-use) it later. this way, we avoid unnecessary copying of
- * regions. (this wins especially if many clients clip by children
- * and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE)
- {
- if (freeCompClip)
- REGION_DESTROY(pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- }
- else
- {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip)
- {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pScreen, pregWin);
- }
- else if (freeTmpClip)
- {
- REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- }
- else
- {
- pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- }
- } /* end of composite clip for a window */
- else
- {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- /* If you want pixmaps in offscreen memory, yes */
- pixbounds.x1 = pDrawable->x;
- pixbounds.y1 = pDrawable->y;
- pixbounds.x2 = pDrawable->x + pDrawable->width;
- pixbounds.y2 = pDrawable->y + pDrawable->height;
-
- if (pGC->freeCompClip)
- {
- REGION_RESET(pScreen, pGC->pCompositeClip, &pixbounds);
- }
- else
- {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION)
- {
- if(pDrawable->x || pDrawable->y) {
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- } else {
- REGION_TRANSLATE(pScreen, pGC->pCompositeClip,
- -pGC->clipOrg.x, -pGC->clipOrg.y);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pScreen, pGC->pCompositeClip,
- pGC->clipOrg.x, pGC->clipOrg.y);
- }
- }
- } /* end of composite clip for pixmap */
-} /* end miComputeCompositeClip */
diff --git a/mi/migc.h b/mi/migc.h
deleted file mode 100644
index 8cb5a56c9..000000000
--- a/mi/migc.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $Xorg: migc.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-/* $XFree86: xc/programs/Xserver/mi/migc.h,v 1.8 2001/12/14 20:00:23 dawes Exp $ */
-
-extern void miChangeGC(
- GCPtr /*pGC*/,
- unsigned long /*mask*/
-);
-
-extern void miDestroyGC(
- GCPtr /*pGC*/
-);
-
-extern GCOpsPtr miCreateGCOps(
- GCOpsPtr /*prototype*/
-);
-
-extern void miDestroyGCOps(
- GCOpsPtr /*ops*/
-);
-
-extern void miDestroyClip(
- GCPtr /*pGC*/
-);
-
-extern void miChangeClip(
- GCPtr /*pGC*/,
- int /*type*/,
- pointer /*pvalue*/,
- int /*nrects*/
-);
-
-extern void miCopyClip(
- GCPtr /*pgcDst*/,
- GCPtr /*pgcSrc*/
-);
-
-extern void miCopyGC(
- GCPtr /*pGCSrc*/,
- unsigned long /*changes*/,
- GCPtr /*pGCDst*/
-);
-
-extern void miComputeCompositeClip(
- GCPtr /*pGC*/,
- DrawablePtr /*pDrawable*/
-);
diff --git a/mi/miglblt.c b/mi/miglblt.c
deleted file mode 100644
index 3e7e5da1b..000000000
--- a/mi/miglblt.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miglblt.c,v 1.6 2001/12/14 20:00:23 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: miglblt.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmap.h"
-#include "servermd.h"
-#include "mi.h"
-
-/*
- machine-independent glyph blt.
- assumes that glyph bits in snf are written in bytes,
-have same bit order as the server's bitmap format,
-and are byte padded. this corresponds to the snf distributed
-with the sample server.
-
- get a scratch GC.
- in the scratch GC set alu = GXcopy, fg = 1, bg = 0
- allocate a bitmap big enough to hold the largest glyph in the font
- validate the scratch gc with the bitmap
- for each glyph
- carefully put the bits of the glyph in a buffer,
- padded to the server pixmap scanline padding rules
- fake a call to PutImage from the buffer into the bitmap
- use the bitmap in a call to PushPixels
-*/
-
-void
-miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- int width, height;
- PixmapPtr pPixmap;
- int nbyLine; /* bytes per line of padded pixmap */
- FontPtr pfont;
- GCPtr pGCtmp;
- register int i;
- register int j;
- unsigned char *pbits; /* buffer for PutImage */
- register unsigned char *pb; /* temp pointer into buffer */
- register CharInfoPtr pci; /* currect char info */
- register unsigned char *pglyph; /* pointer bits in glyph */
- int gWidth, gHeight; /* width and height of glyph */
- register int nbyGlyphWidth; /* bytes per scanline of glyph */
- int nbyPadGlyph; /* server padded line of glyph */
-
- XID gcvals[3];
-
- if (pGC->miTranslate)
- {
- x += pDrawable->x;
- y += pDrawable->y;
- }
-
- pfont = pGC->font;
- width = FONTMAXBOUNDS(pfont,rightSideBearing) -
- FONTMINBOUNDS(pfont,leftSideBearing);
- height = FONTMAXBOUNDS(pfont,ascent) +
- FONTMAXBOUNDS(pfont,descent);
-
- pPixmap = (*pDrawable->pScreen->CreatePixmap)(pDrawable->pScreen,
- width, height, 1);
- if (!pPixmap)
- return;
-
- pGCtmp = GetScratchGC(1, pDrawable->pScreen);
- if (!pGCtmp)
- {
- (*pDrawable->pScreen->DestroyPixmap)(pPixmap);
- return;
- }
-
- gcvals[0] = GXcopy;
- gcvals[1] = 1;
- gcvals[2] = 0;
-
- DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0);
-
- nbyLine = BitmapBytePad(width);
- pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine);
- if (!pbits)
- {
- (*pDrawable->pScreen->DestroyPixmap)(pPixmap);
- FreeScratchGC(pGCtmp);
- return;
- }
- while(nglyph--)
- {
- pci = *ppci++;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- gWidth = GLYPHWIDTHPIXELS(pci);
- gHeight = GLYPHHEIGHTPIXELS(pci);
- if (gWidth && gHeight)
- {
- nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci);
- nbyPadGlyph = BitmapBytePad(gWidth);
-
- if (nbyGlyphWidth == nbyPadGlyph
-#if GLYPHPADBYTES != 4
- && (((int) pglyph) & 3) == 0
-#endif
- )
- {
- pb = pglyph;
- }
- else
- {
- for (i=0, pb = pbits; i<gHeight; i++, pb = pbits+(i*nbyPadGlyph))
- for (j = 0; j < nbyGlyphWidth; j++)
- *pb++ = *pglyph++;
- pb = pbits;
- }
-
- if ((pGCtmp->serialNumber) != (pPixmap->drawable.serialNumber))
- ValidateGC((DrawablePtr)pPixmap, pGCtmp);
- (*pGCtmp->ops->PutImage)((DrawablePtr)pPixmap, pGCtmp,
- pPixmap->drawable.depth,
- 0, 0, gWidth, gHeight,
- 0, XYBitmap, (char *)pb);
-
- if ((pGC->serialNumber) != (pDrawable->serialNumber))
- ValidateGC(pDrawable, pGC);
- (*pGC->ops->PushPixels)(pGC, pPixmap, pDrawable,
- gWidth, gHeight,
- x + pci->metrics.leftSideBearing,
- y - pci->metrics.ascent);
- }
- x += pci->metrics.characterWidth;
- }
- (*pDrawable->pScreen->DestroyPixmap)(pPixmap);
- DEALLOCATE_LOCAL(pbits);
- FreeScratchGC(pGCtmp);
-}
-
-
-void
-miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GC *pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- ExtentInfoRec info; /* used by QueryGlyphExtents() */
- XID gcvals[3];
- int oldAlu, oldFS;
- unsigned long oldFG;
- xRectangle backrect;
-
- QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
-
- if (info.overallWidth >= 0)
- {
- backrect.x = x;
- backrect.width = info.overallWidth;
- }
- else
- {
- backrect.x = x + info.overallWidth;
- backrect.width = -info.overallWidth;
- }
- backrect.y = y - FONTASCENT(pGC->font);
- backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
-
- oldAlu = pGC->alu;
- oldFG = pGC->fgPixel;
- oldFS = pGC->fillStyle;
-
- /* fill in the background */
- gcvals[0] = GXcopy;
- gcvals[1] = pGC->bgPixel;
- gcvals[2] = FillSolid;
- DoChangeGC(pGC, GCFunction|GCForeground|GCFillStyle, gcvals, 0);
- ValidateGC(pDrawable, pGC);
- (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
-
- /* put down the glyphs */
- gcvals[0] = oldFG;
- DoChangeGC(pGC, GCForeground, gcvals, 0);
- ValidateGC(pDrawable, pGC);
- (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
- pglyphBase);
-
- /* put all the toys away when done playing */
- gcvals[0] = oldAlu;
- gcvals[1] = oldFG;
- gcvals[2] = oldFS;
- DoChangeGC(pGC, GCFunction|GCForeground|GCFillStyle, gcvals, 0);
- ValidateGC(pDrawable, pGC);
-
-}
diff --git a/mi/miinitext.c b/mi/miinitext.c
deleted file mode 100644
index ee63aa41b..000000000
--- a/mi/miinitext.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.68 2003/01/15 02:34:14 torrey Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: miinitext.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-#include "misc.h"
-#include "extension.h"
-#include "micmap.h"
-
-#ifdef NOPEXEXT /* sleaze for Solaris cpp building XsunMono */
-#undef PEXEXT
-#endif
-
-#if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
-#undef PEXEXT
-#undef XIE
-#undef GLXEXT
-#endif
-
-#ifdef PANORAMIX
-extern Bool noPanoramiXExtension;
-#endif
-extern Bool noTestExtensions;
-#ifdef XKB
-extern Bool noXkbExtension;
-#endif
-
-#ifndef XFree86LOADER
-#define INITARGS void
-typedef void (*InitExtension)(INITARGS);
-#else /* XFree86Loader */
-#include "loaderProcs.h"
-#endif
-
-#ifdef MITSHM
-#define _XSHM_SERVER_
-#include "shmstr.h"
-#endif
-#ifdef XTEST
-#define _XTEST_SERVER_
-#include "XTest.h"
-#endif
-#ifdef XKB
-#include "XKB.h"
-#endif
-#ifdef LBX
-#define _XLBX_SERVER_
-#include "lbxstr.h"
-#endif
-#ifdef XPRINT
-#include "Print.h"
-#endif
-#ifdef XAPPGROUP
-#define _XAG_SERVER_
-#include "Xagstr.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "securstr.h"
-#endif
-#ifdef PANORAMIX
-#include "panoramiXproto.h"
-#endif
-#ifdef XF86BIGFONT
-#include "xf86bigfstr.h"
-#endif
-#ifdef RES
-#include "XResproto.h"
-#endif
-
-/* FIXME: this whole block of externs should be from the appropriate headers */
-#ifdef BEZIER
-extern void BezierExtensionInit(INITARGS);
-#endif
-#ifdef XTESTEXT1
-extern void XTestExtension1Init(INITARGS);
-#endif
-#ifdef SHAPE
-extern void ShapeExtensionInit(INITARGS);
-#endif
-#ifdef EVI
-extern void EVIExtensionInit(INITARGS);
-#endif
-#ifdef MITSHM
-extern void ShmExtensionInit(INITARGS);
-#endif
-#ifdef PEXEXT
-extern void PexExtensionInit(INITARGS);
-#endif
-#ifdef MULTIBUFFER
-extern void MultibufferExtensionInit(INITARGS);
-#endif
-#ifdef PANORAMIX
-extern void PanoramiXExtensionInit(INITARGS);
-#endif
-#ifdef XINPUT
-extern void XInputExtensionInit(INITARGS);
-#endif
-#ifdef XTEST
-extern void XTestExtensionInit(INITARGS);
-#endif
-#ifdef BIGREQS
-extern void BigReqExtensionInit(INITARGS);
-#endif
-#ifdef MITMISC
-extern void MITMiscExtensionInit(INITARGS);
-#endif
-#ifdef XIDLE
-extern void XIdleExtensionInit(INITARGS);
-#endif
-#ifdef XTRAP
-extern void DEC_XTRAPInit(INITARGS);
-#endif
-#ifdef SCREENSAVER
-extern void ScreenSaverExtensionInit (INITARGS);
-#endif
-#ifdef XV
-extern void XvExtensionInit(INITARGS);
-extern void XvMCExtensionInit(INITARGS);
-#endif
-#ifdef XIE
-extern void XieInit(INITARGS);
-#endif
-#ifdef XSYNC
-extern void SyncExtensionInit(INITARGS);
-#endif
-#ifdef XKB
-extern void XkbExtensionInit(INITARGS);
-#endif
-#ifdef XCMISC
-extern void XCMiscExtensionInit(INITARGS);
-#endif
-#ifdef XRECORD
-extern void RecordExtensionInit(INITARGS);
-#endif
-#ifdef LBX
-extern void LbxExtensionInit(INITARGS);
-#endif
-#ifdef DBE
-extern void DbeExtensionInit(INITARGS);
-#endif
-#ifdef XAPPGROUP
-extern void XagExtensionInit(INITARGS);
-#endif
-#ifdef XCSECURITY
-extern void SecurityExtensionInit(INITARGS);
-#endif
-#ifdef XPRINT
-extern void XpExtensionInit(INITARGS);
-#endif
-#ifdef XF86BIGFONT
-extern void XFree86BigfontExtensionInit(INITARGS);
-#endif
-#ifdef XF86VIDMODE
-extern void XFree86VidModeExtensionInit(INITARGS);
-#endif
-#ifdef XF86MISC
-extern void XFree86MiscExtensionInit(INITARGS);
-#endif
-#ifdef XFreeXDGA
-extern void XFree86DGAExtensionInit(INITARGS);
-#endif
-#ifdef GLXEXT
-#ifndef __DARWIN__
-extern void GlxExtensionInit(INITARGS);
-extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
-#else
-extern void DarwinGlxExtensionInit(INITARGS);
-extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *);
-#endif
-#endif
-#ifdef XF86DRI
-extern void XFree86DRIExtensionInit(INITARGS);
-#endif
-#ifdef TOGCUP
-extern void XcupExtensionInit(INITARGS);
-#endif
-#ifdef DPMSExtension
-extern void DPMSExtensionInit(INITARGS);
-#endif
-#ifdef DPSEXT
-extern void DPSExtensionInit(INITARGS);
-#endif
-#ifdef FONTCACHE
-extern void FontCacheExtensionInit(INITARGS);
-#endif
-#ifdef RENDER
-extern void RenderExtensionInit(INITARGS);
-#endif
-#ifdef RANDR
-extern void RRExtensionInit(INITARGS);
-#endif
-#ifdef RES
-extern void ResExtensionInit(INITARGS);
-#endif
-
-#ifndef XFree86LOADER
-
-/*ARGSUSED*/
-void
-InitExtensions(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef PANORAMIX
-# if !defined(PRINT_ONLY_SERVER) && !defined(NO_PANORAMIX)
- if (!noPanoramiXExtension) PanoramiXExtensionInit();
-# endif
-#endif
-#ifdef BEZIER
- BezierExtensionInit();
-#endif
-#ifdef XTESTEXT1
- if (!noTestExtensions) XTestExtension1Init();
-#endif
-#ifdef SHAPE
- ShapeExtensionInit();
-#endif
-#ifdef MITSHM
- ShmExtensionInit();
-#endif
-#ifdef EVI
- EVIExtensionInit();
-#endif
-#ifdef PEXEXT
- PexExtensionInit();
-#endif
-#ifdef MULTIBUFFER
- MultibufferExtensionInit();
-#endif
-#if defined(XINPUT) && !defined(NO_HW_ONLY_EXTS)
- XInputExtensionInit();
-#endif
-#ifdef XTEST
- if (!noTestExtensions) XTestExtensionInit();
-#endif
-#ifdef BIGREQS
- BigReqExtensionInit();
-#endif
-#ifdef MITMISC
- MITMiscExtensionInit();
-#endif
-#ifdef XIDLE
- XIdleExtensionInit();
-#endif
-#ifdef XTRAP
- if (!noTestExtensions) DEC_XTRAPInit();
-#endif
-#if defined(SCREENSAVER) && !defined(PRINT_ONLY_SERVER)
- ScreenSaverExtensionInit ();
-#endif
-#ifdef XV
- XvExtensionInit();
- XvMCExtensionInit();
-#endif
-#ifdef XIE
- XieInit();
-#endif
-#ifdef XSYNC
- SyncExtensionInit();
-#endif
-#if defined(XKB) && !defined(PRINT_ONLY_SERVER) && !defined(NO_HW_ONLY_EXTS)
- if (!noXkbExtension) XkbExtensionInit();
-#endif
-#ifdef XCMISC
- XCMiscExtensionInit();
-#endif
-#ifdef XRECORD
- if (!noTestExtensions) RecordExtensionInit();
-#endif
-#ifdef LBX
- LbxExtensionInit();
-#endif
-#ifdef DBE
- DbeExtensionInit();
-#endif
-#ifdef XAPPGROUP
- XagExtensionInit();
-#endif
-#ifdef XCSECURITY
- SecurityExtensionInit();
-#endif
-#ifdef XPRINT
- XpExtensionInit();
-#endif
-#ifdef TOGCUP
- XcupExtensionInit();
-#endif
-#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
- DPMSExtensionInit();
-#endif
-#ifdef FONTCACHE
- FontCacheExtensionInit();
-#endif
-#ifdef XF86BIGFONT
- XFree86BigfontExtensionInit();
-#endif
-#if !defined(PRINT_ONLY_SERVER) && !defined(NO_HW_ONLY_EXTS)
-#if defined(XF86VIDMODE)
- XFree86VidModeExtensionInit();
-#endif
-#if defined(XF86MISC)
- XFree86MiscExtensionInit();
-#endif
-#if defined(XFreeXDGA)
- XFree86DGAExtensionInit();
-#endif
-#ifdef XF86DRI
- XFree86DRIExtensionInit();
-#endif
-#endif
-#ifdef GLXEXT
-#ifndef XPRINT /* we don't want Glx in the Xprint server */
-#ifndef __DARWIN__
- GlxExtensionInit();
-#else
- DarwinGlxExtensionInit();
-#endif
-#endif
-#endif
-#ifdef DPSEXT
-#ifndef XPRINT
- DPSExtensionInit();
-#endif
-#endif
-#ifdef RENDER
- RenderExtensionInit();
-#endif
-#ifdef RANDR
- RRExtensionInit();
-#endif
-#ifdef RES
- ResExtensionInit();
-#endif
-}
-
-void
-InitVisualWrap()
-{
- miResetInitVisuals();
-#ifdef GLXEXT
-#ifndef XPRINT
-#ifndef __DARWIN__
- GlxWrapInitVisuals(&miInitVisualsProc);
-#else
- DarwinGlxWrapInitVisuals(&miInitVisualsProc);
-#endif
-#endif
-#endif
-}
-
-#else /* XFree86LOADER */
-#if 0
-/* FIXME:The names here must come from the headers. those with ?? are
- not included in X11R6.3 sample implementation, so there's a problem... */
-/* XXX use the correct #ifdefs for symbols not present when an extension
- is disabled */
-ExtensionModule extension[] =
-{
- { NULL, "BEZIER", NULL, NULL }, /* ?? */
- { NULL, "XTEST1", &noTestExtensions, NULL }, /* ?? */
- { NULL, "SHAPE", NULL, NULL },
- { NULL, "MIT-SHM", NULL, NULL },
- { NULL, "X3D-PEX", NULL, NULL },
- { NULL, "Multi-Buffering", NULL, NULL },
- { NULL, "XInputExtension", NULL, NULL },
- { NULL, "XTEST", &noTestExtensions, NULL },
- { NULL, "BIG-REQUESTS", NULL, NULL },
- { NULL, "MIT-SUNDRY-NONSTANDARD", NULL, NULL },
- { NULL, "XIDLE", NULL, NULL }, /* ?? */
- { NULL, "XTRAP", &noTestExtensions, NULL }, /* ?? */
- { NULL, "MIT-SCREEN-SAVER", NULL, NULL },
- { NULL, "XVideo", NULL, NULL }, /* ?? */
- { NULL, "XIE", NULL, NULL },
- { NULL, "SYNC", NULL, NULL },
-#ifdef XKB
- { NULL, "XKEYBOARD", &noXkbExtension, NULL },
-#else
- { NULL, "NOXKEYBOARD", NULL, NULL },
-#endif
- { NULL, "XC-MISC", NULL, NULL },
- { NULL, "RECORD", &noTestExtensions, NULL },
- { NULL, "LBX", NULL, NULL },
- { NULL, "DOUBLE-BUFFER", NULL, NULL },
- { NULL, "XC-APPGROUP", NULL, NULL },
- { NULL, "SECURITY", NULL, NULL },
- { NULL, "XpExtension", NULL, NULL },
- { NULL, "XFree86-VidModeExtension", NULL, NULL },
- { NULL, "XFree86-Misc", NULL, NULL },
- { NULL, "XFree86-DGA", NULL, NULL },
- { NULL, "DPMS", NULL, NULL },
- { NULL, "GLX", NULL, NULL },
- { NULL, "TOG-CUP", NULL, NULL },
- { NULL, "Extended-Visual-Information", NULL, NULL },
-#ifdef PANORAMIX
- { NULL, "XINERAMA", &noPanoramiXExtension, NULL },
-#else
- { NULL, "NOXINERAMA", NULL, NULL },
-#endif
- { NULL, "XFree86-Bigfont", NULL, NULL },
- { NULL, "XFree86-DRI", NULL, NULL },
- { NULL, "Adobe-DPS-Extension", NULL, NULL },
- { NULL, "FontCache", NULL, NULL },
- { NULL, "RENDER", NULL, NULL },
- { NULL, "RANDR", NULL, NULL },
- { NULL, "X-Resource", NULL, NULL },
- { NULL, NULL, NULL, NULL }
-};
-#endif
-
-/* List of built-in (statically linked) extensions */
-static ExtensionModule staticExtensions[] = {
-#ifdef BEZIER
- { BezierExtensionInit, "BEZIER", NULL, NULL, NULL },
-#endif
-#ifdef XTESTEXT1
- { XTestExtension1Init, "XTEST1", &noTestExtensions, NULL, NULL },
-#endif
-#ifdef MITSHM
- { ShmExtensionInit, SHMNAME, NULL, NULL, NULL },
-#endif
-#ifdef XINPUT
- { XInputExtensionInit, "XInputExtension", NULL, NULL, NULL },
-#endif
-#ifdef XTEST
- { XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL },
-#endif
-#ifdef XIDLE
- { XIdleExtensionInit, "XIDLE", NULL, NULL, NULL },
-#endif
-#ifdef XKB
- { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL },
-#endif
-#ifdef LBX
- { LbxExtensionInit, LBXNAME, NULL, NULL, NULL },
-#endif
-#ifdef XAPPGROUP
- { XagExtensionInit, XAGNAME, NULL, NULL, NULL },
-#endif
-#ifdef XCSECURITY
- { SecurityExtensionInit, SECURITY_EXTENSION_NAME, NULL, NULL, NULL },
-#endif
-#ifdef XPRINT
- { XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL },
-#endif
-#ifdef PANORAMIX
- { PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL },
-#endif
-#ifdef XF86BIGFONT
- { XFree86BigfontExtensionInit, XF86BIGFONTNAME, NULL, NULL, NULL },
-#endif
-#ifdef RENDER
- { RenderExtensionInit, "RENDER", NULL, NULL, NULL },
-#endif
-#ifdef RANDR
- { RRExtensionInit, "RANDR", NULL, NULL, NULL },
-#endif
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-/*ARGSUSED*/
-void
-InitExtensions(argc, argv)
- int argc;
- char *argv[];
-{
- int i;
- ExtensionModule *ext;
- static Bool listInitialised = FALSE;
-
- if (!listInitialised) {
- /* Add built-in extensions to the list. */
- for (i = 0; staticExtensions[i].name; i++)
- LoadExtension(&staticExtensions[i], TRUE);
-
- /* Sort the extensions according the init dependencies. */
- LoaderSortExtensions();
- listInitialised = TRUE;
- }
-
- for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
- ext = &ExtensionModuleList[i];
- if (ext->initFunc != NULL &&
- (ext->disablePtr == NULL ||
- (ext->disablePtr != NULL && !*ext->disablePtr))) {
- (ext->initFunc)();
- }
- }
-}
-
-static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *);
-
-void
-InitVisualWrap()
-{
- miResetInitVisuals();
- if (__miHookInitVisualsFunction)
- (*__miHookInitVisualsFunction)(&miInitVisualsProc);
-}
-
-void miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
- void (*new)(miInitVisualsProcPtr *))
-{
- if (old)
- *old = __miHookInitVisualsFunction;
- __miHookInitVisualsFunction = new;
-}
-
-#endif /* XFree86LOADER */
diff --git a/mi/miline.h b/mi/miline.h
deleted file mode 100644
index 8977550b3..000000000
--- a/mi/miline.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* $Xorg: miline.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-/*
-
-Copyright 1994, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/miline.h,v 1.7 2001/12/14 20:00:24 dawes Exp $ */
-
-#ifndef MILINE_H
-
-#include "screenint.h"
-
-/*
- * Public definitions used for configuring basic pixelization aspects
- * of the sample implementation line-drawing routines provided in
- * {mfb,mi,cfb*} at run-time.
- */
-
-#define XDECREASING 4
-#define YDECREASING 2
-#define YMAJOR 1
-
-#define OCTANT1 (1 << (YDECREASING))
-#define OCTANT2 (1 << (YDECREASING|YMAJOR))
-#define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR))
-#define OCTANT4 (1 << (XDECREASING|YDECREASING))
-#define OCTANT5 (1 << (XDECREASING))
-#define OCTANT6 (1 << (XDECREASING|YMAJOR))
-#define OCTANT7 (1 << (YMAJOR))
-#define OCTANT8 (1 << (0))
-
-#define XMAJOROCTANTS (OCTANT1 | OCTANT4 | OCTANT5 | OCTANT8)
-
-#define DEFAULTZEROLINEBIAS (OCTANT2 | OCTANT3 | OCTANT4 | OCTANT5)
-
-/*
- * Devices can configure the rendering of routines in mi, mfb, and cfb*
- * by specifying a thin line bias to be applied to a particular screen
- * using the following function. The bias parameter is an OR'ing of
- * the appropriate OCTANT constants defined above to indicate which
- * octants to bias a line to prefer an axial step when the Bresenham
- * error term is exactly zero. The octants are mapped as follows:
- *
- * \ | /
- * \ 3 | 2 /
- * \ | /
- * 4 \ | / 1
- * \|/
- * -----------
- * /|\
- * 5 / | \ 8
- * / | \
- * / 6 | 7 \
- * / | \
- *
- * For more information, see "Ambiguities in Incremental Line Rastering,"
- * Jack E. Bresenham, IEEE CG&A, May 1987.
- */
-
-extern void miSetZeroLineBias(
- ScreenPtr /* pScreen */,
- unsigned int /* bias */
-);
-
-/*
- * Private definitions needed for drawing thin (zero width) lines
- * Used by the mi, mfb, and all cfb* components.
- */
-
-#define X_AXIS 0
-#define Y_AXIS 1
-
-#define OUT_LEFT 0x08
-#define OUT_RIGHT 0x04
-#define OUT_ABOVE 0x02
-#define OUT_BELOW 0x01
-
-#define OUTCODES(_result, _x, _y, _pbox) \
- if ( (_x) < (_pbox)->x1) (_result) |= OUT_LEFT; \
- else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \
- if ( (_y) < (_pbox)->y1) (_result) |= OUT_ABOVE; \
- else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW;
-
-#define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \
-{\
- if (x < xmin) outcode |= OUT_LEFT;\
- if (x > xmax) outcode |= OUT_RIGHT;\
- if (y < ymin) outcode |= OUT_ABOVE;\
- if (y > ymax) outcode |= OUT_BELOW;\
-}
-
-#define SWAPINT(i, j) \
-{ register int _t = i; i = j; j = _t; }
-
-#define SWAPPT(i, j) \
-{ DDXPointRec _t; _t = i; i = j; j = _t; }
-
-#define SWAPINT_PAIR(x1, y1, x2, y2)\
-{ int t = x1; x1 = x2; x2 = t;\
- t = y1; y1 = y2; y2 = t;\
-}
-
-#define miGetZeroLineBias(_pScreen) \
- ((miZeroLineScreenIndex < 0) ? \
- 0 : ((_pScreen)->devPrivates[miZeroLineScreenIndex].uval))
-
-#define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \
- (_octant) = 0; \
- (_sx) = (_SX); \
- if (((_adx) = (_x2) - (_x1)) < 0) { \
- (_adx) = -(_adx); \
- (_sx = -(_sx)); \
- (_octant) |= XDECREASING; \
- } \
- (_sy) = (_SY); \
- if (((_ady) = (_y2) - (_y1)) < 0) { \
- (_ady) = -(_ady); \
- (_sy = -(_sy)); \
- (_octant) |= YDECREASING; \
- }
-
-#define SetYMajorOctant(_octant) ((_octant) |= YMAJOR)
-
-#define FIXUP_ERROR(_e, _octant, _bias) \
- (_e) -= (((_bias) >> (_octant)) & 1)
-
-#define IsXMajorOctant(_octant) (!((_octant) & YMAJOR))
-#define IsYMajorOctant(_octant) ((_octant) & YMAJOR)
-#define IsXDecreasingOctant(_octant) ((_octant) & XDECREASING)
-#define IsYDecreasingOctant(_octant) ((_octant) & YDECREASING)
-
-extern int miZeroLineScreenIndex;
-
-extern int miZeroClipLine(
- int /*xmin*/,
- int /*ymin*/,
- int /*xmax*/,
- int /*ymax*/,
- int * /*new_x1*/,
- int * /*new_y1*/,
- int * /*new_x2*/,
- int * /*new_y2*/,
- unsigned int /*adx*/,
- unsigned int /*ady*/,
- int * /*pt1_clipped*/,
- int * /*pt2_clipped*/,
- int /*octant*/,
- unsigned int /*bias*/,
- int /*oc1*/,
- int /*oc2*/
-);
-
-#endif /* MILINE_H */
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
deleted file mode 100644
index cdb2058b1..000000000
--- a/mi/mioverlay.c
+++ /dev/null
@@ -1,2075 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mioverlay.c,v 3.16 2003/11/10 18:22:49 tsi Exp $ */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "mivalidate.h"
-#include "mioverlay.h"
-#include "migc.h"
-
-#include "globals.h"
-
-
-typedef struct {
- RegionRec exposed;
- RegionRec borderExposed;
- RegionPtr borderVisible;
- DDXPointRec oldAbsCorner;
-} miOverlayValDataRec, *miOverlayValDataPtr;
-
-typedef struct _TreeRec {
- WindowPtr pWin;
- struct _TreeRec *parent;
- struct _TreeRec *firstChild;
- struct _TreeRec *lastChild;
- struct _TreeRec *prevSib;
- struct _TreeRec *nextSib;
- RegionRec borderClip;
- RegionRec clipList;
- unsigned visibility;
- miOverlayValDataPtr valdata;
-} miOverlayTreeRec, *miOverlayTreePtr;
-
-typedef struct {
- miOverlayTreePtr tree;
-} miOverlayWindowRec, *miOverlayWindowPtr;
-
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- RealizeWindowProcPtr RealizeWindow;
- miOverlayTransFunc MakeTransparent;
- miOverlayInOverlayFunc InOverlay;
- Bool underlayMarked;
- Bool copyUnderlay;
-} miOverlayScreenRec, *miOverlayScreenPtr;
-
-static unsigned long miOverlayGeneration = 0;
-int miOverlayWindowIndex = -1;
-int miOverlayScreenIndex = -1;
-
-static void RebuildTree(WindowPtr);
-static Bool HasUnderlayChildren(WindowPtr);
-static void MarkUnderlayWindow(WindowPtr);
-static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr);
-
-static Bool miOverlayCloseScreen(int, ScreenPtr);
-static Bool miOverlayCreateWindow(WindowPtr);
-static Bool miOverlayDestroyWindow(WindowPtr);
-static Bool miOverlayUnrealizeWindow(WindowPtr);
-static Bool miOverlayRealizeWindow(WindowPtr);
-static void miOverlayMarkWindow(WindowPtr);
-static void miOverlayReparentWindow(WindowPtr, WindowPtr);
-static void miOverlayRestackWindow(WindowPtr, WindowPtr);
-static Bool miOverlayMarkOverlappedWindows(WindowPtr, WindowPtr, WindowPtr*);
-static void miOverlayMarkUnrealizedWindow(WindowPtr, WindowPtr, Bool);
-static int miOverlayValidateTree(WindowPtr, WindowPtr, VTKind);
-static void miOverlayHandleExposures(WindowPtr);
-static void miOverlayMoveWindow(WindowPtr, int, int, WindowPtr, VTKind);
-static void miOverlayWindowExposures(WindowPtr, RegionPtr, RegionPtr);
-static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int,
- unsigned int, WindowPtr);
-static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
-
-#ifdef SHAPE
-static void miOverlaySetShape(WindowPtr);
-#endif
-static void miOverlayChangeBorderWidth(WindowPtr, unsigned int);
-
-#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) \
- ((miOverlayScreenPtr)((pScreen)->devPrivates[miOverlayScreenIndex].ptr))
-#define MIOVERLAY_GET_WINDOW_PRIVATE(pWin) \
- ((miOverlayWindowPtr)((pWin)->devPrivates[miOverlayWindowIndex].ptr))
-#define MIOVERLAY_GET_WINDOW_TREE(pWin) \
- (MIOVERLAY_GET_WINDOW_PRIVATE(pWin)->tree)
-
-#define IN_UNDERLAY(w) MIOVERLAY_GET_WINDOW_TREE(w)
-#define IN_OVERLAY(w) !MIOVERLAY_GET_WINDOW_TREE(w)
-
-#define MARK_OVERLAY(w) miMarkWindow(w)
-#define MARK_UNDERLAY(w) MarkUnderlayWindow(w)
-
-#define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \
- HasBorder(w) && \
- (w)->backgroundState == ParentRelative)
-
-Bool
-miInitOverlay(
- ScreenPtr pScreen,
- miOverlayInOverlayFunc inOverlayFunc,
- miOverlayTransFunc transFunc
-){
- miOverlayScreenPtr pScreenPriv;
-
- if(!inOverlayFunc || !transFunc) return FALSE;
-
- if(miOverlayGeneration != serverGeneration) {
- if(((miOverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((miOverlayWindowIndex = AllocateWindowPrivateIndex()) < 0))
- return FALSE;
-
- miOverlayGeneration = serverGeneration;
- }
-
- if(!AllocateWindowPrivate(pScreen, miOverlayWindowIndex,
- sizeof(miOverlayWindowRec)))
- return FALSE;
-
- if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec))))
- return FALSE;
-
- pScreen->devPrivates[miOverlayScreenIndex].ptr = (pointer)pScreenPriv;
-
- pScreenPriv->InOverlay = inOverlayFunc;
- pScreenPriv->MakeTransparent = transFunc;
- pScreenPriv->underlayMarked = FALSE;
-
-
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreenPriv->CreateWindow = pScreen->CreateWindow;
- pScreenPriv->DestroyWindow = pScreen->DestroyWindow;
- pScreenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreenPriv->RealizeWindow = pScreen->RealizeWindow;
-
- pScreen->CloseScreen = miOverlayCloseScreen;
- pScreen->CreateWindow = miOverlayCreateWindow;
- pScreen->DestroyWindow = miOverlayDestroyWindow;
- pScreen->UnrealizeWindow = miOverlayUnrealizeWindow;
- pScreen->RealizeWindow = miOverlayRealizeWindow;
-
- pScreen->ReparentWindow = miOverlayReparentWindow;
- pScreen->RestackWindow = miOverlayRestackWindow;
- pScreen->MarkOverlappedWindows = miOverlayMarkOverlappedWindows;
- pScreen->MarkUnrealizedWindow = miOverlayMarkUnrealizedWindow;
- pScreen->ValidateTree = miOverlayValidateTree;
- pScreen->HandleExposures = miOverlayHandleExposures;
- pScreen->MoveWindow = miOverlayMoveWindow;
- pScreen->WindowExposures = miOverlayWindowExposures;
- pScreen->ResizeWindow = miOverlayResizeWindow;
- pScreen->MarkWindow = miOverlayMarkWindow;
- pScreen->ClearToBackground = miOverlayClearToBackground;
-#ifdef SHAPE
- pScreen->SetShape = miOverlaySetShape;
-#endif
- pScreen->ChangeBorderWidth = miOverlayChangeBorderWidth;
-
- return TRUE;
-}
-
-
-static Bool
-miOverlayCloseScreen(int i, ScreenPtr pScreen)
-{
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->CreateWindow = pScreenPriv->CreateWindow;
- pScreen->DestroyWindow = pScreenPriv->DestroyWindow;
- pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow;
- pScreen->RealizeWindow = pScreenPriv->RealizeWindow;
-
- xfree(pScreenPriv);
-
- return (*pScreen->CloseScreen)(i, pScreen);
-}
-
-
-static Bool
-miOverlayCreateWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- miOverlayWindowPtr pWinPriv = MIOVERLAY_GET_WINDOW_PRIVATE(pWin);
- miOverlayTreePtr pTree = NULL;
- Bool result = TRUE;
-
- pWinPriv->tree = NULL;
-
- if(!pWin->parent || !((*pScreenPriv->InOverlay)(pWin))) {
- if(!(pTree = (miOverlayTreePtr)xcalloc(1, sizeof(miOverlayTreeRec))))
- return FALSE;
- }
-
- if(pScreenPriv->CreateWindow) {
- pScreen->CreateWindow = pScreenPriv->CreateWindow;
- result = (*pScreen->CreateWindow)(pWin);
- pScreen->CreateWindow = miOverlayCreateWindow;
- }
-
- if (pTree) {
- if(result) {
- pTree->pWin = pWin;
- pTree->visibility = VisibilityNotViewable;
- pWinPriv->tree = pTree;
- if(pWin->parent) {
- REGION_NULL(pScreen, &(pTree->borderClip));
- REGION_NULL(pScreen, &(pTree->clipList));
- RebuildTree(pWin);
- } else {
- BoxRec fullBox;
- fullBox.x1 = 0;
- fullBox.y1 = 0;
- fullBox.x2 = pScreen->width;
- fullBox.y2 = pScreen->height;
- REGION_INIT(pScreen, &(pTree->borderClip), &fullBox, 1);
- REGION_INIT(pScreen, &(pTree->clipList), &fullBox, 1);
- }
- } else xfree(pTree);
- }
-
- return TRUE;
-}
-
-
-static Bool
-miOverlayDestroyWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- Bool result = TRUE;
-
- if (pTree) {
- if(pTree->prevSib)
- pTree->prevSib->nextSib = pTree->nextSib;
- else if(pTree->parent)
- pTree->parent->firstChild = pTree->nextSib;
-
- if(pTree->nextSib)
- pTree->nextSib->prevSib = pTree->prevSib;
- else if(pTree->parent)
- pTree->parent->lastChild = pTree->prevSib;
-
- REGION_UNINIT(pScreen, &(pTree->borderClip));
- REGION_UNINIT(pScreen, &(pTree->clipList));
- xfree(pTree);
- }
-
- if(pScreenPriv->DestroyWindow) {
- pScreen->DestroyWindow = pScreenPriv->DestroyWindow;
- result = (*pScreen->DestroyWindow)(pWin);
- pScreen->DestroyWindow = miOverlayDestroyWindow;
- }
-
- return result;
-}
-
-static Bool
-miOverlayUnrealizeWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- Bool result = TRUE;
-
- if(pTree) pTree->visibility = VisibilityNotViewable;
-
- if(pScreenPriv->UnrealizeWindow) {
- pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow;
- result = (*pScreen->UnrealizeWindow)(pWin);
- pScreen->UnrealizeWindow = miOverlayUnrealizeWindow;
- }
-
- return result;
-}
-
-
-static Bool
-miOverlayRealizeWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- Bool result = TRUE;
-
- if(pScreenPriv->RealizeWindow) {
- pScreen->RealizeWindow = pScreenPriv->RealizeWindow;
- result = (*pScreen->RealizeWindow)(pWin);
- pScreen->RealizeWindow = miOverlayRealizeWindow;
- }
-
- /* we only need to catch the root window realization */
-
- if(result && !pWin->parent && !((*pScreenPriv->InOverlay)(pWin)))
- {
- BoxRec box;
- box.x1 = box.y1 = 0;
- box.x2 = pWin->drawable.width;
- box.y2 = pWin->drawable.height;
- (*pScreenPriv->MakeTransparent)(pScreen, 1, &box);
- }
-
- return result;
-}
-
-
-static void
-miOverlayReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
-{
- if(IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)) {
- /* This could probably be more optimal */
- RebuildTree(WindowTable[pWin->drawable.pScreen->myNum]->firstChild);
- }
-}
-
-static void
-miOverlayRestackWindow(WindowPtr pWin, WindowPtr oldNextSib)
-{
- if(IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)) {
- /* This could probably be more optimal */
- RebuildTree(pWin);
- }
-}
-
-
-static Bool
-miOverlayMarkOverlappedWindows(
- WindowPtr pWin,
- WindowPtr pFirst,
- WindowPtr *pLayerWin
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr pChild, pLast;
- Bool overMarked, underMarked, doUnderlay, markAll;
- miOverlayTreePtr pTree = NULL, tLast, tChild;
- BoxPtr box;
-
- overMarked = underMarked = markAll = FALSE;
-
- if(pLayerWin) *pLayerWin = pWin; /* hah! */
-
- doUnderlay = (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin));
-
- box = REGION_EXTENTS(pScreen, &pWin->borderSize);
-
- if((pChild = pFirst)) {
- pLast = pChild->parent->lastChild;
- while (1) {
- if (pChild == pWin) markAll = TRUE;
-
- if(doUnderlay && IN_UNDERLAY(pChild))
- pTree = MIOVERLAY_GET_WINDOW_TREE(pChild);
-
- if(pChild->viewable) {
- if (REGION_BROKEN (pScreen, &pChild->winSize))
- SetWinSize (pChild);
- if (REGION_BROKEN (pScreen, &pChild->borderSize))
- SetBorderSize (pChild);
-
- if (markAll ||
- RECT_IN_REGION(pScreen, &pChild->borderSize, box))
- {
- MARK_OVERLAY(pChild);
- overMarked = TRUE;
- if(doUnderlay && IN_UNDERLAY(pChild)) {
- MARK_UNDERLAY(pChild);
- underMarked = TRUE;
- }
- if (pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
- }
- }
- while (!pChild->nextSib && (pChild != pLast)) {
- pChild = pChild->parent;
- if(doUnderlay && IN_UNDERLAY(pChild))
- pTree = MIOVERLAY_GET_WINDOW_TREE(pChild);
- }
-
- if(pChild == pWin) markAll = FALSE;
-
- if (pChild == pLast) break;
-
- pChild = pChild->nextSib;
- }
- if(overMarked)
- MARK_OVERLAY(pWin->parent);
- }
-
- if(doUnderlay && !pTree) {
- if(!(pTree = MIOVERLAY_GET_WINDOW_TREE(pWin))) {
- pChild = pWin->lastChild;
- while(1) {
- if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild)))
- break;
-
- if(pChild->lastChild) {
- pChild = pChild->lastChild;
- continue;
- }
-
- while(!pChild->prevSib) pChild = pChild->parent;
-
- pChild = pChild->prevSib;
- }
- }
- }
-
- if(pTree && pTree->nextSib) {
- tChild = pTree->parent->lastChild;
- tLast = pTree->nextSib;
-
- while(1) {
- if(tChild->pWin->viewable) {
- if (REGION_BROKEN (pScreen, &tChild->pWin->winSize))
- SetWinSize (tChild->pWin);
- if (REGION_BROKEN (pScreen, &tChild->pWin->borderSize))
- SetBorderSize (tChild->pWin);
-
- if(RECT_IN_REGION(pScreen, &(tChild->pWin->borderSize), box))
- {
- MARK_UNDERLAY(tChild->pWin);
- underMarked = TRUE;
- }
- }
-
- if(tChild->lastChild) {
- tChild = tChild->lastChild;
- continue;
- }
-
- while(!tChild->prevSib && (tChild != tLast))
- tChild = tChild->parent;
-
- if(tChild == tLast) break;
-
- tChild = tChild->prevSib;
- }
- }
-
- if(underMarked) {
- MARK_UNDERLAY(pTree->parent->pWin);
- MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->underlayMarked = TRUE;
- }
-
- return (underMarked || overMarked);
-}
-
-
-static void
-miOverlayComputeClips(
- WindowPtr pParent,
- RegionPtr universe,
- VTKind kind,
- RegionPtr exposed
-){
- ScreenPtr pScreen = pParent->drawable.pScreen;
- int oldVis, newVis, dx, dy;
- BoxRec borderSize;
- RegionPtr borderVisible;
- RegionRec childUniverse, childUnion;
- miOverlayTreePtr tParent = MIOVERLAY_GET_WINDOW_TREE(pParent);
- miOverlayTreePtr tChild;
- Bool overlap;
-
- borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent);
- borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent);
- dx = (int) pParent->drawable.x + (int) pParent->drawable.width +
- wBorderWidth(pParent);
- if (dx > 32767) dx = 32767;
- borderSize.x2 = dx;
- dy = (int) pParent->drawable.y + (int) pParent->drawable.height +
- wBorderWidth(pParent);
- if (dy > 32767) dy = 32767;
- borderSize.y2 = dy;
-
- oldVis = tParent->visibility;
- switch (RECT_IN_REGION( pScreen, universe, &borderSize)) {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnPART:
- newVis = VisibilityPartiallyObscured;
-#ifdef SHAPE
- {
- RegionPtr pBounding;
-
- if ((pBounding = wBoundingShape (pParent))) {
- switch (miShapedWindowIn (pScreen, universe, pBounding,
- &borderSize,
- pParent->drawable.x,
- pParent->drawable.y))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnOUT:
- newVis = VisibilityFullyObscured;
- break;
- }
- }
- }
-#endif
- break;
- default:
- newVis = VisibilityFullyObscured;
- break;
- }
- tParent->visibility = newVis;
-
- dx = pParent->drawable.x - tParent->valdata->oldAbsCorner.x;
- dy = pParent->drawable.y - tParent->valdata->oldAbsCorner.y;
-
- switch (kind) {
- case VTMap:
- case VTStack:
- case VTUnmap:
- break;
- case VTMove:
- if ((oldVis == newVis) &&
- ((oldVis == VisibilityFullyObscured) ||
- (oldVis == VisibilityUnobscured)))
- {
- tChild = tParent;
- while (1) {
- if (tChild->pWin->viewable) {
- if (tChild->visibility != VisibilityFullyObscured) {
- REGION_TRANSLATE( pScreen, &tChild->borderClip, dx, dy);
- REGION_TRANSLATE( pScreen, &tChild->clipList, dx, dy);
-
- tChild->pWin->drawable.serialNumber =
- NEXT_SERIAL_NUMBER;
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (tChild->pWin, dx, dy);
- }
- if (tChild->valdata) {
- REGION_NULL(pScreen, &tChild->valdata->borderExposed);
- if (HasParentRelativeBorder(tChild->pWin)){
- REGION_SUBTRACT(pScreen,
- &tChild->valdata->borderExposed,
- &tChild->borderClip,
- &tChild->pWin->winSize);
- }
- REGION_NULL(pScreen, &tChild->valdata->exposed);
- }
- if (tChild->firstChild) {
- tChild = tChild->firstChild;
- continue;
- }
- }
- while (!tChild->nextSib && (tChild != tParent))
- tChild = tChild->parent;
- if (tChild == tParent)
- break;
- tChild = tChild->nextSib;
- }
- return;
- }
- /* fall through */
- default:
- if (dx || dy) {
- REGION_TRANSLATE( pScreen, &tParent->borderClip, dx, dy);
- REGION_TRANSLATE( pScreen, &tParent->clipList, dx, dy);
- }
- break;
- case VTBroken:
- REGION_EMPTY (pScreen, &tParent->borderClip);
- REGION_EMPTY (pScreen, &tParent->clipList);
- break;
- }
-
- borderVisible = tParent->valdata->borderVisible;
- REGION_NULL(pScreen, &tParent->valdata->borderExposed);
- REGION_NULL(pScreen, &tParent->valdata->exposed);
-
- if (HasBorder (pParent)) {
- if (borderVisible) {
- REGION_SUBTRACT( pScreen, exposed, universe, borderVisible);
- REGION_DESTROY( pScreen, borderVisible);
- } else
- REGION_SUBTRACT( pScreen, exposed, universe, &tParent->borderClip);
-
- if (HasParentRelativeBorder(pParent) && (dx || dy))
- REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed,
- universe, &pParent->winSize);
- else
- REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed,
- exposed, &pParent->winSize);
-
- REGION_COPY( pScreen, &tParent->borderClip, universe);
- REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize);
- }
- else
- REGION_COPY( pScreen, &tParent->borderClip, universe);
-
- if ((tChild = tParent->firstChild) && pParent->mapped) {
- REGION_NULL(pScreen, &childUniverse);
- REGION_NULL(pScreen, &childUnion);
-
- for (; tChild; tChild = tChild->nextSib) {
- if (tChild->pWin->viewable)
- REGION_APPEND( pScreen, &childUnion, &tChild->pWin->borderSize);
- }
-
- REGION_VALIDATE( pScreen, &childUnion, &overlap);
-
- for (tChild = tParent->firstChild;
- tChild;
- tChild = tChild->nextSib)
- {
- if (tChild->pWin->viewable) {
- if (tChild->valdata) {
- REGION_INTERSECT( pScreen, &childUniverse, universe,
- &tChild->pWin->borderSize);
- miOverlayComputeClips (tChild->pWin, &childUniverse,
- kind, exposed);
- }
- if (overlap)
- REGION_SUBTRACT( pScreen, universe, universe,
- &tChild->pWin->borderSize);
- }
- }
- if (!overlap)
- REGION_SUBTRACT( pScreen, universe, universe, &childUnion);
- REGION_UNINIT( pScreen, &childUnion);
- REGION_UNINIT( pScreen, &childUniverse);
- }
-
- if (oldVis == VisibilityFullyObscured ||
- oldVis == VisibilityNotViewable)
- {
- REGION_COPY( pScreen, &tParent->valdata->exposed, universe);
- }
- else if (newVis != VisibilityFullyObscured &&
- newVis != VisibilityNotViewable)
- {
- REGION_SUBTRACT( pScreen, &tParent->valdata->exposed,
- universe, &tParent->clipList);
- }
-
- /* HACK ALERT - copying contents of regions, instead of regions */
- {
- RegionRec tmp;
-
- tmp = tParent->clipList;
- tParent->clipList = *universe;
- *universe = tmp;
- }
-
- pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pParent, dx, dy);
-}
-
-
-static void
-miOverlayMarkWindow(WindowPtr pWin)
-{
- miOverlayTreePtr pTree = NULL;
- WindowPtr pChild, pGrandChild;
-
- miMarkWindow(pWin);
-
- /* look for UnmapValdata among immediate children */
-
- if(!(pChild = pWin->firstChild)) return;
-
- for( ; pChild; pChild = pChild->nextSib) {
- if(pChild->valdata == UnmapValData) {
- if(IN_UNDERLAY(pChild)) {
- pTree = MIOVERLAY_GET_WINDOW_TREE(pChild);
- pTree->valdata = (miOverlayValDataPtr)UnmapValData;
- continue;
- } else {
- if(!(pGrandChild = pChild->firstChild))
- continue;
-
- while(1) {
- if(IN_UNDERLAY(pGrandChild)) {
- pTree = MIOVERLAY_GET_WINDOW_TREE(pGrandChild);
- pTree->valdata = (miOverlayValDataPtr)UnmapValData;
- } else if(pGrandChild->firstChild) {
- pGrandChild = pGrandChild->firstChild;
- continue;
- }
-
- while(!pGrandChild->nextSib && (pGrandChild != pChild))
- pGrandChild = pGrandChild->parent;
-
- if(pChild == pGrandChild) break;
-
- pGrandChild = pGrandChild->nextSib;
- }
- }
- }
- }
-
- if(pTree) {
- MARK_UNDERLAY(pTree->parent->pWin);
- MIOVERLAY_GET_SCREEN_PRIVATE(
- pWin->drawable.pScreen)->underlayMarked = TRUE;
- }
-}
-
-static void
-miOverlayMarkUnrealizedWindow(
- WindowPtr pChild,
- WindowPtr pWin,
- Bool fromConfigure
-){
- if ((pChild != pWin) || fromConfigure) {
- miOverlayTreePtr pTree;
-
- REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList);
- if (pChild->drawable.pScreen->ClipNotify)
- (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0);
- REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip);
- if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) {
- if(pTree->valdata != (miOverlayValDataPtr)UnmapValData) {
- REGION_EMPTY(pChild->drawable.pScreen, &pTree->clipList);
- REGION_EMPTY(pChild->drawable.pScreen, &pTree->borderClip);
- }
- }
- }
-}
-
-
-static int
-miOverlayValidateTree(
- WindowPtr pParent,
- WindowPtr pChild, /* first child effected */
- VTKind kind
-){
- ScreenPtr pScreen = pParent->drawable.pScreen;
- miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- RegionRec totalClip, childClip, exposed;
- miOverlayTreePtr tParent, tChild, tWin;
- Bool overlap;
- WindowPtr newParent;
-
- if(!pPriv->underlayMarked)
- goto SKIP_UNDERLAY;
-
- if (!pChild) pChild = pParent->firstChild;
-
- REGION_NULL(pScreen, &totalClip);
- REGION_NULL(pScreen, &childClip);
- REGION_NULL(pScreen, &exposed);
-
- newParent = pParent;
-
- while(IN_OVERLAY(newParent))
- newParent = newParent->parent;
-
- tParent = MIOVERLAY_GET_WINDOW_TREE(newParent);
-
- if(IN_UNDERLAY(pChild))
- tChild = MIOVERLAY_GET_WINDOW_TREE(pChild);
- else
- tChild = tParent->firstChild;
-
- if (REGION_BROKEN (pScreen, &tParent->clipList) &&
- !REGION_BROKEN (pScreen, &tParent->borderClip))
- {
- kind = VTBroken;
- REGION_COPY (pScreen, &totalClip, &tParent->borderClip);
- REGION_INTERSECT (pScreen, &totalClip, &totalClip,
- &tParent->pWin->winSize);
-
- for (tWin = tParent->firstChild; tWin != tChild; tWin = tWin->nextSib) {
- if (tWin->pWin->viewable)
- REGION_SUBTRACT (pScreen, &totalClip, &totalClip,
- &tWin->pWin->borderSize);
- }
- REGION_EMPTY (pScreen, &tParent->clipList);
- } else {
- for(tWin = tChild; tWin; tWin = tWin->nextSib) {
- if(tWin->valdata)
- REGION_APPEND(pScreen, &totalClip, &tWin->borderClip);
- }
- REGION_VALIDATE(pScreen, &totalClip, &overlap);
- }
-
- if(kind != VTStack)
- REGION_UNION(pScreen, &totalClip, &totalClip, &tParent->clipList);
-
- for(tWin = tChild; tWin; tWin = tWin->nextSib) {
- if(tWin->valdata) {
- if(tWin->pWin->viewable) {
- REGION_INTERSECT(pScreen, &childClip, &totalClip,
- &tWin->pWin->borderSize);
- miOverlayComputeClips(tWin->pWin, &childClip, kind, &exposed);
- REGION_SUBTRACT(pScreen, &totalClip, &totalClip,
- &tWin->pWin->borderSize);
- } else { /* Means we are unmapping */
- REGION_EMPTY(pScreen, &tWin->clipList);
- REGION_EMPTY( pScreen, &tWin->borderClip);
- tWin->valdata = NULL;
- }
- }
- }
-
- REGION_UNINIT(pScreen, &childClip);
-
- if(!((*pPriv->InOverlay)(newParent))) {
- REGION_NULL(pScreen, &tParent->valdata->exposed);
- REGION_NULL(pScreen, &tParent->valdata->borderExposed);
- }
-
- switch (kind) {
- case VTStack:
- break;
- default:
- if(!((*pPriv->InOverlay)(newParent)))
- REGION_SUBTRACT(pScreen, &tParent->valdata->exposed, &totalClip,
- &tParent->clipList);
- /* fall through */
- case VTMap:
- REGION_COPY( pScreen, &tParent->clipList, &totalClip);
- if(!((*pPriv->InOverlay)(newParent)))
- newParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- break;
- }
-
- REGION_UNINIT( pScreen, &totalClip);
- REGION_UNINIT( pScreen, &exposed);
-
-SKIP_UNDERLAY:
-
- miValidateTree(pParent, pChild, kind);
-
- return 1;
-}
-
-
-static void
-miOverlayHandleExposures(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- WindowPtr pChild;
- ValidatePtr val;
- void (* WindowExposures)(WindowPtr, RegionPtr, RegionPtr);
-
- WindowExposures = pWin->drawable.pScreen->WindowExposures;
- if(pPriv->underlayMarked) {
- miOverlayTreePtr pTree;
- miOverlayValDataPtr mival;
-
- pChild = pWin;
- while(IN_OVERLAY(pChild))
- pChild = pChild->parent;
-
- pTree = MIOVERLAY_GET_WINDOW_TREE(pChild);
-
- while (1) {
- if((mival = pTree->valdata)) {
- if(!((*pPriv->InOverlay)(pTree->pWin))) {
- if (REGION_NOTEMPTY(pScreen, &mival->borderExposed))
- (*pWin->drawable.pScreen->PaintWindowBorder)(
- pTree->pWin, &mival->borderExposed, PW_BORDER);
- REGION_UNINIT(pScreen, &mival->borderExposed);
-
- (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion);
- REGION_UNINIT(pScreen, &mival->exposed);
- }
- xfree(mival);
- pTree->valdata = NULL;
- if (pTree->firstChild) {
- pTree = pTree->firstChild;
- continue;
- }
- }
- while (!pTree->nextSib && (pTree->pWin != pChild))
- pTree = pTree->parent;
- if (pTree->pWin == pChild)
- break;
- pTree = pTree->nextSib;
- }
- pPriv->underlayMarked = FALSE;
- }
-
- pChild = pWin;
- while (1) {
- if ( (val = pChild->valdata) ) {
- if(!((*pPriv->InOverlay)(pChild))) {
- REGION_UNION(pScreen, &val->after.exposed, &val->after.exposed,
- &val->after.borderExposed);
-
- if (REGION_NOTEMPTY(pScreen, &val->after.exposed)) {
- (*(MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent))(
- pScreen,
- REGION_NUM_RECTS(&val->after.exposed),
- REGION_RECTS(&val->after.exposed));
- }
- } else {
- if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed))
- (*pChild->drawable.pScreen->PaintWindowBorder)(pChild,
- &val->after.borderExposed,
- PW_BORDER);
- (*WindowExposures)(pChild, &val->after.exposed, NullRegion);
- }
- REGION_UNINIT(pScreen, &val->after.borderExposed);
- REGION_UNINIT(pScreen, &val->after.exposed);
- xfree(val);
- pChild->valdata = (ValidatePtr)NULL;
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-
-static void
-miOverlayMoveWindow(
- WindowPtr pWin,
- int x,
- int y,
- WindowPtr pNextSib,
- VTKind kind
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- WindowPtr pParent, windowToValidate;
- Bool WasViewable = (Bool)(pWin->viewable);
- short bw;
- RegionRec overReg, underReg;
- DDXPointRec oldpt;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
-
- if (!(pParent = pWin->parent))
- return ;
- bw = wBorderWidth (pWin);
-
- oldpt.x = pWin->drawable.x;
- oldpt.y = pWin->drawable.y;
- if (WasViewable) {
- REGION_NULL(pScreen, &overReg);
- REGION_NULL(pScreen, &underReg);
- if(pTree) {
- REGION_COPY(pScreen, &overReg, &pWin->borderClip);
- REGION_COPY(pScreen, &underReg, &pTree->borderClip);
- } else {
- REGION_COPY(pScreen, &overReg, &pWin->borderClip);
- CollectUnderlayChildrenRegions(pWin, &underReg);
- }
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
- }
- pWin->origin.x = x + (int)bw;
- pWin->origin.y = y + (int)bw;
- x = pWin->drawable.x = pParent->drawable.x + x + (int)bw;
- y = pWin->drawable.y = pParent->drawable.y + y + (int)bw;
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- (*pScreen->PositionWindow)(pWin, x, y);
-
- windowToValidate = MoveWindowInStack(pWin, pNextSib);
-
- ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0);
-
- if (WasViewable) {
- miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- (*pScreen->MarkOverlappedWindows) (pWin, windowToValidate, NULL);
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- dosave = (*pScreen->ChangeSaveUnder)(pWin, windowToValidate);
-#endif /* DO_SAVE_UNDERS */
-
- (*pScreen->ValidateTree)(pWin->parent, NullWindow, kind);
- if(REGION_NOTEMPTY(pScreen, &underReg)) {
- pPriv->copyUnderlay = TRUE;
- (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &underReg);
- }
- REGION_UNINIT(pScreen, &underReg);
- if(REGION_NOTEMPTY(pScreen, &overReg)) {
- pPriv->copyUnderlay = FALSE;
- (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &overReg);
- }
- REGION_UNINIT(pScreen, &overReg);
- (*pScreen->HandleExposures)(pWin->parent);
-
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pWin, windowToValidate);
-#endif /* DO_SAVE_UNDERS */
- if (pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin->parent, NullWindow, kind);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-#ifndef RECTLIMIT
-#define RECTLIMIT 25
-#endif
-
-static void
-miOverlayWindowExposures(
- WindowPtr pWin,
- register RegionPtr prgn,
- RegionPtr other_exposed
-){
- RegionPtr exposures = prgn;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (pWin->backStorage && prgn)
- exposures = (*pScreen->RestoreAreas)(pWin, prgn);
- if ((prgn && !REGION_NIL(prgn)) ||
- (exposures && !REGION_NIL(exposures)) || other_exposed)
- {
- RegionRec expRec;
- int clientInterested;
-
- clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) &
- ExposureMask;
- if (other_exposed) {
- if (exposures) {
- REGION_UNION(pScreen, other_exposed, exposures, other_exposed);
- if (exposures != prgn)
- REGION_DESTROY(pScreen, exposures);
- }
- exposures = other_exposed;
- }
- if (clientInterested && exposures &&
- (REGION_NUM_RECTS(exposures) > RECTLIMIT))
- {
- miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- BoxRec box;
-
- box = *REGION_EXTENTS(pScreen, exposures);
- if (exposures == prgn) {
- exposures = &expRec;
- REGION_INIT(pScreen, exposures, &box, 1);
- REGION_RESET(pScreen, prgn, &box);
- } else {
- REGION_RESET(pScreen, exposures, &box);
- REGION_UNION(pScreen, prgn, prgn, exposures);
- }
- /* This is the only reason why we are replacing mi's version
- of this file */
-
- if(!((*pPriv->InOverlay)(pWin))) {
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- REGION_INTERSECT(pScreen, prgn, prgn, &pTree->clipList);
- } else
- REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList);
-
- /* need to clear out new areas of backing store, too */
- if (pWin->backStorage)
- (void) (*pScreen->ClearBackingStore)(
- pWin,
- box.x1 - pWin->drawable.x,
- box.y1 - pWin->drawable.y,
- box.x2 - box.x1,
- box.y2 - box.y1,
- FALSE);
- }
- if (prgn && !REGION_NIL(prgn))
- (*pScreen->PaintWindowBackground)(
- pWin, prgn, PW_BACKGROUND);
- if (clientInterested && exposures && !REGION_NIL(exposures))
- miSendExposures(pWin, exposures,
- pWin->drawable.x, pWin->drawable.y);
- if (exposures == &expRec) {
- REGION_UNINIT(pScreen, exposures);
- }
- else if (exposures && exposures != prgn && exposures != other_exposed)
- REGION_DESTROY(pScreen, exposures);
- if (prgn)
- REGION_EMPTY(pScreen, prgn);
- }
- else if (exposures && exposures != prgn)
- REGION_DESTROY(pScreen, exposures);
-}
-
-
-typedef struct {
- RegionPtr over;
- RegionPtr under;
-} miOverlayTwoRegions;
-
-static int
-miOverlayRecomputeExposures (
- WindowPtr pWin,
- pointer value
-){
- register ScreenPtr pScreen;
- miOverlayTwoRegions *pValid = (miOverlayTwoRegions*)value;
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- /* This prevents warning about pScreen not being used. */
- pWin->drawable.pScreen = pScreen = pWin->drawable.pScreen;
-
- if (pWin->valdata) {
- /*
- * compute exposed regions of this window
- */
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed,
- &pWin->clipList, pValid->over);
- /*
- * compute exposed regions of the border
- */
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed,
- &pWin->borderClip, &pWin->winSize);
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed,
- &pWin->valdata->after.borderExposed, pValid->over);
- }
-
- if(pTree && pTree->valdata) {
- REGION_SUBTRACT(pScreen, &pTree->valdata->exposed,
- &pTree->clipList, pValid->under);
- REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed,
- &pTree->borderClip, &pWin->winSize);
- REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed,
- &pTree->valdata->borderExposed, pValid->under);
- } else if (!pWin->valdata)
- return WT_NOMATCH;
-
- return WT_WALKCHILDREN;
-}
-
-static void
-miOverlayResizeWindow(
- WindowPtr pWin,
- int x, int y,
- unsigned int w, unsigned int h,
- WindowPtr pSib
-){
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr pParent;
- miOverlayTreePtr tChild, pTree;
- Bool WasViewable = (Bool)(pWin->viewable);
- unsigned short width = pWin->drawable.width;
- unsigned short height = pWin->drawable.height;
- short oldx = pWin->drawable.x;
- short oldy = pWin->drawable.y;
- int bw = wBorderWidth (pWin);
- short dw, dh;
- DDXPointRec oldpt;
- RegionPtr oldRegion = NULL, oldRegion2 = NULL;
- WindowPtr pFirstChange;
- register WindowPtr pChild;
- RegionPtr gravitate[StaticGravity + 1];
- RegionPtr gravitate2[StaticGravity + 1];
- register unsigned g;
- int nx, ny; /* destination x,y */
- int newx, newy; /* new inner window position */
- RegionPtr pRegion = NULL;
- RegionPtr destClip, destClip2;
- RegionPtr oldWinClip = NULL, oldWinClip2 = NULL;
- RegionPtr borderVisible = NullRegion;
- RegionPtr borderVisible2 = NullRegion;
- RegionPtr bsExposed = NullRegion; /* backing store exposures */
- Bool shrunk = FALSE; /* shrunk in an inner dimension */
- Bool moved = FALSE; /* window position changed */
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- Bool doUnderlay;
-
- /* if this is a root window, can't be resized */
- if (!(pParent = pWin->parent))
- return ;
-
- pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- doUnderlay = ((pTree) || HasUnderlayChildren(pWin));
- newx = pParent->drawable.x + x + bw;
- newy = pParent->drawable.y + y + bw;
- if (WasViewable)
- {
- /*
- * save the visible region of the window
- */
- oldRegion = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldRegion, &pWin->winSize);
- if(doUnderlay) {
- oldRegion2 = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldRegion2, &pWin->winSize);
- }
-
- /*
- * categorize child windows into regions to be moved
- */
- for (g = 0; g <= StaticGravity; g++)
- gravitate[g] = gravitate2[g] = NULL;
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
- g = pChild->winGravity;
- if (g != UnmapGravity) {
- if (!gravitate[g])
- gravitate[g] = REGION_CREATE(pScreen, NullBox, 1);
- REGION_UNION(pScreen, gravitate[g],
- gravitate[g], &pChild->borderClip);
-
- if(doUnderlay) {
- if (!gravitate2[g])
- gravitate2[g] = REGION_CREATE(pScreen, NullBox, 0);
-
- if((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) {
- REGION_UNION(pScreen, gravitate2[g],
- gravitate2[g], &tChild->borderClip);
- } else
- CollectUnderlayChildrenRegions(pChild, gravitate2[g]);
- }
- } else {
- UnmapWindow(pChild, TRUE);
- }
- }
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
-
-
- oldWinClip = oldWinClip2 = NULL;
- if (pWin->bitGravity != ForgetGravity) {
- oldWinClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldWinClip, &pWin->clipList);
- if(pTree) {
- oldWinClip2 = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldWinClip2, &pTree->clipList);
- }
- }
- /*
- * if the window is changing size, borderExposed
- * can't be computed correctly without some help.
- */
- if (pWin->drawable.height > h || pWin->drawable.width > w)
- shrunk = TRUE;
-
- if (newx != oldx || newy != oldy)
- moved = TRUE;
-
- if ((pWin->drawable.height != h || pWin->drawable.width != w) &&
- HasBorder (pWin))
- {
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- if(pTree)
- borderVisible2 = REGION_CREATE(pScreen, NullBox, 1);
- /* for tiled borders, we punt and draw the whole thing */
- if (pWin->borderIsPixel || !moved)
- {
- if (shrunk || moved)
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip,
- &pWin->winSize);
- else
- REGION_COPY(pScreen, borderVisible,
- &pWin->borderClip);
- if(pTree) {
- if (shrunk || moved)
- REGION_SUBTRACT(pScreen, borderVisible,
- &pTree->borderClip,
- &pWin->winSize);
- else
- REGION_COPY(pScreen, borderVisible,
- &pTree->borderClip);
- }
- }
- }
- }
- pWin->origin.x = x + bw;
- pWin->origin.y = y + bw;
- pWin->drawable.height = h;
- pWin->drawable.width = w;
-
- x = pWin->drawable.x = newx;
- y = pWin->drawable.y = newy;
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- dw = (int)w - (int)width;
- dh = (int)h - (int)height;
- ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh);
-
- /* let the hardware adjust background and border pixmaps, if any */
- (*pScreen->PositionWindow)(pWin, x, y);
-
- pFirstChange = MoveWindowInStack(pWin, pSib);
-
- if (WasViewable) {
- pRegion = REGION_CREATE(pScreen, NullBox, 1);
- if (pWin->backStorage)
- REGION_COPY(pScreen, pRegion, &pWin->clipList);
-
- (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, NULL);
-
- pWin->valdata->before.resized = TRUE;
- pWin->valdata->before.borderVisible = borderVisible;
- if(pTree)
- pTree->valdata->borderVisible = borderVisible2;
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- dosave = (*pScreen->ChangeSaveUnder)(pWin, pFirstChange);
-#endif /* DO_SAVE_UNDERS */
-
- (*pScreen->ValidateTree)(pWin->parent, pFirstChange, VTOther);
- /*
- * the entire window is trashed unless bitGravity
- * recovers portions of it
- */
- REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList);
- if(pTree)
- REGION_COPY(pScreen, &pTree->valdata->exposed, &pTree->clipList);
- }
-
- GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny);
-
- if (pWin->backStorage && ((pWin->backingStore == Always) || WasViewable)) {
- if (!WasViewable)
- pRegion = &pWin->clipList; /* a convenient empty region */
- if (pWin->bitGravity == ForgetGravity)
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, NullRegion, oldx, oldy);
- else
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, nx - x, ny - y, pRegion, oldx, oldy);
- }
-
- if (WasViewable) {
- miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- miOverlayTwoRegions TwoRegions;
-
- /* avoid the border */
- if (HasBorder (pWin)) {
- int offx, offy, dx, dy;
-
- /* kruft to avoid double translates for each gravity */
- offx = 0;
- offy = 0;
- for (g = 0; g <= StaticGravity; g++) {
- if (!gravitate[g] && !gravitate2[g])
- continue;
-
- /* align winSize to gravitate[g].
- * winSize is in new coordinates,
- * gravitate[g] is still in old coordinates */
- GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
-
- dx = (oldx - nx) - offx;
- dy = (oldy - ny) - offy;
- if (dx || dy) {
- REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy);
- offx += dx;
- offy += dy;
- }
- if(gravitate[g])
- REGION_INTERSECT(pScreen, gravitate[g], gravitate[g],
- &pWin->winSize);
- if(gravitate2[g])
- REGION_INTERSECT(pScreen, gravitate2[g], gravitate2[g],
- &pWin->winSize);
- }
- /* get winSize back where it belongs */
- if (offx || offy)
- REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy);
- }
- /*
- * add screen bits to the appropriate bucket
- */
-
- if (oldWinClip2)
- {
- REGION_COPY(pScreen, pRegion, oldWinClip2);
- REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy);
- REGION_INTERSECT(pScreen, oldWinClip2, pRegion, &pTree->clipList);
-
- for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) {
- if (gravitate2[g])
- REGION_SUBTRACT(pScreen, oldWinClip2, oldWinClip2,
- gravitate2[g]);
- }
- REGION_TRANSLATE(pScreen, oldWinClip2, oldx - nx, oldy - ny);
- g = pWin->bitGravity;
- if (!gravitate2[g])
- gravitate2[g] = oldWinClip2;
- else {
- REGION_UNION(pScreen,gravitate2[g],gravitate2[g],oldWinClip2);
- REGION_DESTROY(pScreen, oldWinClip2);
- }
- }
-
- if (oldWinClip)
- {
- /*
- * clip to new clipList
- */
- REGION_COPY(pScreen, pRegion, oldWinClip);
- REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy);
- REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList);
- /*
- * don't step on any gravity bits which will be copied after this
- * region. Note -- this assumes that the regions will be copied
- * in gravity order.
- */
- for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) {
- if (gravitate[g])
- REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip,
- gravitate[g]);
- }
- REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny);
- g = pWin->bitGravity;
- if (!gravitate[g])
- gravitate[g] = oldWinClip;
- else {
- REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip);
- REGION_DESTROY(pScreen, oldWinClip);
- }
- }
-
- /*
- * move the bits on the screen
- */
-
- destClip = destClip2 = NULL;
-
- for (g = 0; g <= StaticGravity; g++) {
- if (!gravitate[g] && !gravitate2[g])
- continue;
-
- GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
-
- oldpt.x = oldx + (x - nx);
- oldpt.y = oldy + (y - ny);
-
- /* Note that gravitate[g] is *translated* by CopyWindow */
-
- /* only copy the remaining useful bits */
-
- if(gravitate[g])
- REGION_INTERSECT(pScreen, gravitate[g],
- gravitate[g], oldRegion);
- if(gravitate2[g])
- REGION_INTERSECT(pScreen, gravitate2[g],
- gravitate2[g], oldRegion2);
-
- /* clip to not overwrite already copied areas */
-
- if (destClip && gravitate[g]) {
- REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y);
- REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip);
- REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y);
- }
- if (destClip2 && gravitate2[g]) {
- REGION_TRANSLATE(pScreen, destClip2, oldpt.x - x, oldpt.y - y);
- REGION_SUBTRACT(pScreen,gravitate2[g],gravitate2[g],destClip2);
- REGION_TRANSLATE(pScreen, destClip2, x - oldpt.x, y - oldpt.y);
- }
-
- /* and move those bits */
-
- if (oldpt.x != x || oldpt.y != y) {
- if(gravitate2[g]) {
- pPriv->copyUnderlay = TRUE;
- (*pWin->drawable.pScreen->CopyWindow)(
- pWin, oldpt, gravitate2[g]);
- }
- if(gravitate[g]) {
- pPriv->copyUnderlay = FALSE;
- (*pWin->drawable.pScreen->CopyWindow)(
- pWin, oldpt, gravitate[g]);
- }
- }
-
- /* remove any overwritten bits from the remaining useful bits */
-
- if(gravitate[g])
- REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]);
- if(gravitate2[g])
- REGION_SUBTRACT(pScreen, oldRegion2, oldRegion2, gravitate2[g]);
-
- /*
- * recompute exposed regions of child windows
- */
-
-
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
- if (pChild->winGravity != g)
- continue;
-
- TwoRegions.over = gravitate[g];
- TwoRegions.under = gravitate2[g];
-
- TraverseTree (pChild, miOverlayRecomputeExposures,
- (pointer)(&TwoRegions));
- }
-
- /*
- * remove the successfully copied regions of the
- * window from its exposed region
- */
-
- if (g == pWin->bitGravity) {
- if(gravitate[g])
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed,
- &pWin->valdata->after.exposed, gravitate[g]);
- if(gravitate2[g] && pTree)
- REGION_SUBTRACT(pScreen, &pTree->valdata->exposed,
- &pTree->valdata->exposed, gravitate2[g]);
- }
- if(gravitate[g]) {
- if (!destClip)
- destClip = gravitate[g];
- else {
- REGION_UNION(pScreen, destClip, destClip, gravitate[g]);
- REGION_DESTROY(pScreen, gravitate[g]);
- }
- }
- if(gravitate2[g]) {
- if (!destClip2)
- destClip2 = gravitate2[g];
- else {
- REGION_UNION(pScreen, destClip2, destClip2, gravitate2[g]);
- REGION_DESTROY(pScreen, gravitate2[g]);
- }
- }
- }
-
- REGION_DESTROY(pScreen, pRegion);
- REGION_DESTROY(pScreen, oldRegion);
- if(doUnderlay)
- REGION_DESTROY(pScreen, oldRegion2);
- if (destClip)
- REGION_DESTROY(pScreen, destClip);
- if (destClip2)
- REGION_DESTROY(pScreen, destClip2);
- if (bsExposed) {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- (*pScreen->HandleExposures)(pWin->parent);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pWin, pFirstChange);
-#endif /* DO_SAVE_UNDERS */
- if (pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin->parent, pFirstChange, VTOther);
- }
- else if (bsExposed) {
- (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-
-#ifdef SHAPE
-static void
-miOverlaySetShape(WindowPtr pWin)
-{
- Bool WasViewable = (Bool)(pWin->viewable);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionPtr pOldClip = NULL, bsExposed;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
-
- if (WasViewable) {
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
-
- if (HasBorder (pWin)) {
- RegionPtr borderVisible;
-
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- pWin->valdata->before.resized = TRUE;
- if(IN_UNDERLAY(pWin)) {
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- RegionPtr borderVisible2;
-
- borderVisible2 = REGION_CREATE(pScreen, NULL, 1);
- REGION_SUBTRACT(pScreen, borderVisible2,
- &pTree->borderClip, &pWin->winSize);
- pTree->valdata->borderVisible = borderVisible2;
- }
- }
- }
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
-
- if (WasViewable) {
- if (pWin->backStorage) {
- pOldClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, pOldClip, &pWin->clipList);
- }
-
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- dosave = (*pScreen->ChangeSaveUnder)(pWin, pWin);
-#endif /* DO_SAVE_UNDERS */
-
- (*pScreen->ValidateTree)(pWin->parent, NullWindow, VTOther);
- }
-
- if (pWin->backStorage && ((pWin->backingStore == Always) || WasViewable)) {
- if (!WasViewable)
- pOldClip = &pWin->clipList; /* a convenient empty region */
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, pOldClip,
- pWin->drawable.x, pWin->drawable.y);
- if (WasViewable)
- REGION_DESTROY(pScreen, pOldClip);
- if (bsExposed)
- {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- }
- if (WasViewable) {
- (*pScreen->HandleExposures)(pWin->parent);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pWin, pWin);
-#endif /* DO_SAVE_UNDERS */
- if (pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
- CheckCursorConfinement(pWin);
-}
-#endif
-
-
-
-static void
-miOverlayChangeBorderWidth(
- WindowPtr pWin,
- unsigned int width
-){
- int oldwidth;
- register ScreenPtr pScreen;
- Bool WasViewable = (Bool)(pWin->viewable);
- Bool HadBorder;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
-
- oldwidth = wBorderWidth (pWin);
- if (oldwidth == width)
- return;
- HadBorder = HasBorder(pWin);
- pScreen = pWin->drawable.pScreen;
- if (WasViewable && (width < oldwidth))
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
-
- pWin->borderWidth = width;
- SetBorderSize (pWin);
-
- if (WasViewable) {
- if (width > oldwidth) {
- (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
-
- if (HadBorder) {
- RegionPtr borderVisible;
- borderVisible = REGION_CREATE(pScreen, NULL, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- if(IN_UNDERLAY(pWin)) {
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- RegionPtr borderVisible2;
-
- borderVisible2 = REGION_CREATE(pScreen, NULL, 1);
- REGION_SUBTRACT(pScreen, borderVisible2,
- &pTree->borderClip, &pWin->winSize);
- pTree->valdata->borderVisible = borderVisible2;
- }
- }
- }
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- dosave = (*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib);
-#endif /* DO_SAVE_UNDERS */
- (*pScreen->ValidateTree)(pWin->parent, pWin, VTOther);
- (*pScreen->HandleExposures)(pWin->parent);
-
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pWin, pWin->nextSib);
-#endif /* DO_SAVE_UNDERS */
- if (pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pWin->parent, pWin, VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-/* We need this as an addition since the xf86 common code doesn't
- know about the second tree which is static to this file. */
-
-void
-miOverlaySetRootClip(ScreenPtr pScreen, Bool enable)
-{
- WindowPtr pRoot = WindowTable[pScreen->myNum];
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pRoot);
-
- MARK_UNDERLAY(pRoot);
-
- if(enable) {
- BoxRec box;
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
-
- REGION_RESET(pScreen, &pTree->borderClip, &box);
- } else
- REGION_EMPTY(pScreen, &pTree->borderClip);
-
- REGION_BREAK(pScreen, &pTree->clipList);
-}
-
-static void
-miOverlayClearToBackground(
- WindowPtr pWin,
- int x, int y,
- int w, int h,
- Bool generateExposures
-)
-{
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- BoxRec box;
- RegionRec reg;
- RegionPtr pBSReg = NullRegion;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
- RegionPtr clipList;
- BoxPtr extents;
- int x1, y1, x2, y2;
-
- x1 = pWin->drawable.x + x;
- y1 = pWin->drawable.y + y;
- if (w)
- x2 = x1 + (int) w;
- else
- x2 = x1 + (int) pWin->drawable.width - (int) x;
- if (h)
- y2 = y1 + h;
- else
- y2 = y1 + (int) pWin->drawable.height - (int) y;
-
- clipList = ((*pScreenPriv->InOverlay)(pWin)) ? &pWin->clipList :
- &pTree->clipList;
-
- extents = REGION_EXTENTS(pScreen, clipList);
-
- if (x1 < extents->x1) x1 = extents->x1;
- if (x2 > extents->x2) x2 = extents->x2;
- if (y1 < extents->y1) y1 = extents->y1;
- if (y2 > extents->y2) y2 = extents->y2;
-
- if (x2 <= x1 || y2 <= y1)
- x2 = x1 = y2 = y1 = 0;
-
- box.x1 = x1; box.x2 = x2;
- box.y1 = y1; box.y2 = y2;
-
- REGION_INIT(pScreen, &reg, &box, 1);
- if (pWin->backStorage) {
- pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h,
- generateExposures);
- }
-
- REGION_INTERSECT(pScreen, &reg, &reg, clipList);
- if (generateExposures)
- (*pScreen->WindowExposures)(pWin, &reg, pBSReg);
- else if (pWin->backgroundState != None)
- (*pScreen->PaintWindowBackground)(pWin, &reg, PW_BACKGROUND);
- REGION_UNINIT(pScreen, &reg);
- if (pBSReg)
- REGION_DESTROY(pScreen, pBSReg);
-}
-
-
-/****************************************************************/
-
-/* not used */
-Bool
-miOverlayGetPrivateClips(
- WindowPtr pWin,
- RegionPtr *borderClip,
- RegionPtr *clipList
-){
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- if(pTree) {
- *borderClip = &(pTree->borderClip);
- *clipList = &(pTree->clipList);
- return TRUE;
- }
-
- *borderClip = *clipList = NULL;
-
- return FALSE;
-}
-
-void
-miOverlaySetTransFunction (
- ScreenPtr pScreen,
- miOverlayTransFunc transFunc
-){
- MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent = transFunc;
-}
-
-Bool
-miOverlayCopyUnderlay(ScreenPtr pScreen)
-{
- return MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->copyUnderlay;
-}
-
-void
-miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
-{
- ScreenPtr pScreen = pGC->pScreen;
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if(!pTree) {
- miComputeCompositeClip(pGC, &pWin->drawable);
- return;
- }
-
- if (pGC->subWindowMode == IncludeInferiors) {
- pregWin = REGION_CREATE(pScreen, NullBox, 1);
- freeTmpClip = TRUE;
- if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) ||
- !HasSaverWindow (pScreen->myNum))
- {
- REGION_INTERSECT(pScreen,pregWin,&pTree->borderClip,&pWin->winSize);
- }
- } else {
- pregWin = &pTree->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
- if (pGC->clientClipType == CT_NONE) {
- if (freeCompClip)
- REGION_DESTROY(pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- } else {
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- pWin->drawable.x + pGC->clipOrg.x,
- pWin->drawable.y + pGC->clipOrg.y);
-
- if (freeCompClip) {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pScreen, pregWin);
- } else if (freeTmpClip) {
- REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- } else {
- pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
- REGION_INTERSECT(pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pScreen, pGC->clientClip,
- -(pWin->drawable.x + pGC->clipOrg.x),
- -(pWin->drawable.y + pGC->clipOrg.y));
- }
-}
-
-Bool
-miOverlayCollectUnderlayRegions(
- WindowPtr pWin,
- RegionPtr *region
-){
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- if(pTree) {
- *region = &pTree->borderClip;
- return FALSE;
- }
-
- *region = REGION_CREATE(pWin->drawable.pScreen, NullBox, 0);
-
- CollectUnderlayChildrenRegions(pWin, *region);
-
- return TRUE;
-}
-
-
-static miOverlayTreePtr
-DoLeaf(
- WindowPtr pWin,
- miOverlayTreePtr parent,
- miOverlayTreePtr prevSib
-){
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- pTree->parent = parent;
- pTree->firstChild = NULL;
- pTree->lastChild = NULL;
- pTree->prevSib = prevSib;
- pTree->nextSib = NULL;
-
- if(prevSib)
- prevSib->nextSib = pTree;
-
- if(!parent->firstChild)
- parent->firstChild = parent->lastChild = pTree;
- else if(parent->lastChild == prevSib)
- parent->lastChild = pTree;
-
- return pTree;
-}
-
-static void
-RebuildTree(WindowPtr pWin)
-{
- miOverlayTreePtr parent, prevSib, tChild;
- WindowPtr pChild;
-
- prevSib = tChild = NULL;
-
- pWin = pWin->parent;
-
- while(IN_OVERLAY(pWin))
- pWin = pWin->parent;
-
- parent = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- pChild = pWin->firstChild;
- parent->firstChild = parent->lastChild = NULL;
-
- while(1) {
- if(IN_UNDERLAY(pChild))
- prevSib = tChild = DoLeaf(pChild, parent, prevSib);
-
- if(pChild->firstChild) {
- if(IN_UNDERLAY(pChild)) {
- parent = tChild;
- prevSib = NULL;
- }
- pChild = pChild->firstChild;
- continue;
- }
-
- while(!pChild->nextSib) {
- pChild = pChild->parent;
- if(pChild == pWin) return;
- if(IN_UNDERLAY(pChild)) {
- prevSib = tChild = MIOVERLAY_GET_WINDOW_TREE(pChild);
- parent = tChild->parent;
- }
- }
-
- pChild = pChild->nextSib;
- }
-}
-
-
-static Bool
-HasUnderlayChildren(WindowPtr pWin)
-{
- WindowPtr pChild;
-
- if(!(pChild = pWin->firstChild))
- return FALSE;
-
- while(1) {
- if(IN_UNDERLAY(pChild))
- return TRUE;
-
- if(pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
-
- while(!pChild->nextSib && (pWin != pChild))
- pChild = pChild->parent;
-
- if(pChild == pWin) break;
-
- pChild = pChild->nextSib;
- }
-
- return FALSE;
-}
-
-
-static Bool
-CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr pChild;
- miOverlayTreePtr pTree;
- Bool hasUnderlay;
-
- if(!(pChild = pWin->firstChild))
- return FALSE;
-
- hasUnderlay = FALSE;
-
- while(1) {
- if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) {
- REGION_APPEND(pScreen, pReg, &pTree->borderClip);
- hasUnderlay = TRUE;
- } else
- if(pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
-
- while(!pChild->nextSib && (pWin != pChild))
- pChild = pChild->parent;
-
- if(pChild == pWin) break;
-
- pChild = pChild->nextSib;
- }
-
- if(hasUnderlay) {
- Bool overlap;
- REGION_VALIDATE(pScreen, pReg, &overlap);
- }
-
- return hasUnderlay;
-}
-
-
-static void
-MarkUnderlayWindow(WindowPtr pWin)
-{
- miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
-
- if(pTree->valdata) return;
- pTree->valdata = (miOverlayValDataPtr)xnfalloc(sizeof(miOverlayValDataRec));
- pTree->valdata->oldAbsCorner.x = pWin->drawable.x;
- pTree->valdata->oldAbsCorner.y = pWin->drawable.y;
- pTree->valdata->borderVisible = NullRegion;
-}
diff --git a/mi/mioverlay.h b/mi/mioverlay.h
deleted file mode 100644
index 6098f9c39..000000000
--- a/mi/mioverlay.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mioverlay.h,v 3.4 2001/04/14 21:15:26 mvojkovi Exp $ */
-
-#ifndef __MIOVERLAY_H
-#define __MIOVERLAY_H
-
-typedef void (*miOverlayTransFunc)(ScreenPtr, int, BoxPtr);
-typedef Bool (*miOverlayInOverlayFunc)(WindowPtr);
-
-Bool
-miInitOverlay(
- ScreenPtr pScreen,
- miOverlayInOverlayFunc inOverlay,
- miOverlayTransFunc trans
-);
-
-Bool
-miOverlayGetPrivateClips(
- WindowPtr pWin,
- RegionPtr *borderClip,
- RegionPtr *clipList
-);
-
-Bool miOverlayCollectUnderlayRegions(WindowPtr, RegionPtr*);
-void miOverlayComputeCompositeClip(GCPtr, WindowPtr);
-Bool miOverlayCopyUnderlay(ScreenPtr);
-void miOverlaySetTransFunction(ScreenPtr, miOverlayTransFunc);
-void miOverlaySetRootClip(ScreenPtr, Bool);
-
-#endif /* __MIOVERLAY_H */
diff --git a/mi/mipointer.c b/mi/mipointer.c
deleted file mode 100644
index 58d93b80b..000000000
--- a/mi/mipointer.c
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * mipointer.c
- */
-
-/* $Xorg: mipointer.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/mipointer.c,v 3.10 2001/12/14 20:00:24 dawes Exp $ */
-
-# define NEED_EVENTS
-# include "X.h"
-# include "Xmd.h"
-# include "Xproto.h"
-# include "misc.h"
-# include "windowstr.h"
-# include "pixmapstr.h"
-# include "mi.h"
-# include "scrnintstr.h"
-# include "mipointrst.h"
-# include "cursorstr.h"
-# include "dixstruct.h"
-
-int miPointerScreenIndex;
-static unsigned long miPointerGeneration = 0;
-
-#define GetScreenPrivate(s) ((miPointerScreenPtr) ((s)->devPrivates[miPointerScreenIndex].ptr))
-#define SetupScreen(s) miPointerScreenPtr pScreenPriv = GetScreenPrivate(s)
-
-/*
- * until more than one pointer device exists.
- */
-
-static miPointerRec miPointer;
-
-static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static void miPointerConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
-static void miPointerPointerNonInterestBox(ScreenPtr pScreen, BoxPtr pBox);
-static void miPointerCursorLimits(ScreenPtr pScreen, CursorPtr pCursor,
- BoxPtr pHotBox, BoxPtr pTopLeftBox);
-static Bool miPointerSetCursorPosition(ScreenPtr pScreen, int x, int y,
- Bool generateEvent);
-static Bool miPointerCloseScreen(int index, ScreenPtr pScreen);
-static void miPointerMove(ScreenPtr pScreen, int x, int y, unsigned long time);
-
-Bool
-miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
- ScreenPtr pScreen;
- miPointerSpriteFuncPtr spriteFuncs;
- miPointerScreenFuncPtr screenFuncs;
- Bool waitForUpdate;
-{
- miPointerScreenPtr pScreenPriv;
-
- if (miPointerGeneration != serverGeneration)
- {
- miPointerScreenIndex = AllocateScreenPrivateIndex();
- if (miPointerScreenIndex < 0)
- return FALSE;
- miPointerGeneration = serverGeneration;
- }
- pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec));
- if (!pScreenPriv)
- return FALSE;
- pScreenPriv->spriteFuncs = spriteFuncs;
- pScreenPriv->screenFuncs = screenFuncs;
- /*
- * check for uninitialized methods
- */
- if (!screenFuncs->EnqueueEvent)
- screenFuncs->EnqueueEvent = mieqEnqueue;
- if (!screenFuncs->NewEventScreen)
- screenFuncs->NewEventScreen = mieqSwitchScreen;
- pScreenPriv->waitForUpdate = waitForUpdate;
- pScreenPriv->showTransparent = FALSE;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = miPointerCloseScreen;
- pScreen->devPrivates[miPointerScreenIndex].ptr = (pointer) pScreenPriv;
- /*
- * set up screen cursor method table
- */
- pScreen->ConstrainCursor = miPointerConstrainCursor;
- pScreen->CursorLimits = miPointerCursorLimits;
- pScreen->DisplayCursor = miPointerDisplayCursor;
- pScreen->RealizeCursor = miPointerRealizeCursor;
- pScreen->UnrealizeCursor = miPointerUnrealizeCursor;
- pScreen->SetCursorPosition = miPointerSetCursorPosition;
- pScreen->RecolorCursor = miRecolorCursor;
- pScreen->PointerNonInterestBox = miPointerPointerNonInterestBox;
- /*
- * set up the pointer object
- */
- miPointer.pScreen = NULL;
- miPointer.pSpriteScreen = NULL;
- miPointer.pCursor = NULL;
- miPointer.pSpriteCursor = NULL;
- miPointer.limits.x1 = 0;
- miPointer.limits.x2 = 32767;
- miPointer.limits.y1 = 0;
- miPointer.limits.y2 = 32767;
- miPointer.confined = FALSE;
- miPointer.x = 0;
- miPointer.y = 0;
- miPointer.history_start = miPointer.history_end = 0;
- return TRUE;
-}
-
-static Bool
-miPointerCloseScreen (index, pScreen)
- int index;
- ScreenPtr pScreen;
-{
- SetupScreen(pScreen);
-
- if (pScreen == miPointer.pScreen)
- miPointer.pScreen = 0;
- if (pScreen == miPointer.pSpriteScreen)
- miPointer.pSpriteScreen = 0;
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- xfree ((pointer) pScreenPriv);
- return (*pScreen->CloseScreen) (index, pScreen);
-}
-
-/*
- * DIX/DDX interface routines
- */
-
-static Bool
-miPointerRealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- SetupScreen(pScreen);
-
- return (*pScreenPriv->spriteFuncs->RealizeCursor) (pScreen, pCursor);
-}
-
-static Bool
-miPointerUnrealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- SetupScreen(pScreen);
-
- return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pScreen, pCursor);
-}
-
-static Bool
-miPointerDisplayCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- miPointer.pCursor = pCursor;
- miPointer.pScreen = pScreen;
- miPointerUpdate ();
- return TRUE;
-}
-
-static void
-miPointerConstrainCursor (pScreen, pBox)
- ScreenPtr pScreen;
- BoxPtr pBox;
-{
- miPointer.limits = *pBox;
- miPointer.confined = PointerConfinedToScreen();
-}
-
-/*ARGSUSED*/
-static void
-miPointerPointerNonInterestBox (pScreen, pBox)
- ScreenPtr pScreen;
- BoxPtr pBox;
-{
- /* until DIX uses this, this will remain a stub */
-}
-
-/*ARGSUSED*/
-static void
-miPointerCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- BoxPtr pHotBox;
- BoxPtr pTopLeftBox;
-{
- *pTopLeftBox = *pHotBox;
-}
-
-static Bool GenerateEvent;
-
-static Bool
-miPointerSetCursorPosition(pScreen, x, y, generateEvent)
- ScreenPtr pScreen;
- int x, y;
- Bool generateEvent;
-{
- SetupScreen (pScreen);
-
- GenerateEvent = generateEvent;
- /* device dependent - must pend signal and call miPointerWarpCursor */
- (*pScreenPriv->screenFuncs->WarpCursor) (pScreen, x, y);
- if (!generateEvent)
- miPointerUpdate();
- return TRUE;
-}
-
-/* Once signals are ignored, the WarpCursor function can call this */
-
-void
-miPointerWarpCursor (pScreen, x, y)
- ScreenPtr pScreen;
- int x, y;
-{
- SetupScreen (pScreen);
-
- if (miPointer.pScreen != pScreen)
- (*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, TRUE);
-
- if (GenerateEvent)
- {
- miPointerMove (pScreen, x, y, GetTimeInMillis());
- }
- else
- {
- /* everything from miPointerMove except the event and history */
-
- if (!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
- {
- miPointer.devx = x;
- miPointer.devy = y;
- if(!miPointer.pCursor->bits->emptyMask)
- (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
- }
- miPointer.x = x;
- miPointer.y = y;
- miPointer.pScreen = pScreen;
- }
-}
-
-/*
- * Pointer/CursorDisplay interface routines
- */
-
-int
-miPointerGetMotionBufferSize ()
-{
- return MOTION_SIZE;
-}
-
-int
-miPointerGetMotionEvents (pPtr, coords, start, stop, pScreen)
- DeviceIntPtr pPtr;
- xTimecoord *coords;
- unsigned long start, stop;
- ScreenPtr pScreen;
-{
- int i;
- int count = 0;
- miHistoryPtr h;
-
- for (i = miPointer.history_start; i != miPointer.history_end;)
- {
- h = &miPointer.history[i];
- if (h->event.time >= stop)
- break;
- if (h->event.time >= start)
- {
- *coords++ = h->event;
- count++;
- }
- if (++i == MOTION_SIZE) i = 0;
- }
- return count;
-}
-
-
-/*
- * miPointerUpdate
- *
- * Syncronize the sprite with the cursor - called from ProcessInputEvents
- */
-
-void
-miPointerUpdate ()
-{
- ScreenPtr pScreen;
- miPointerScreenPtr pScreenPriv;
- CursorPtr pCursor;
- int x, y, devx, devy;
-
- pScreen = miPointer.pScreen;
- x = miPointer.x;
- y = miPointer.y;
- devx = miPointer.devx;
- devy = miPointer.devy;
- if (!pScreen)
- return;
- pScreenPriv = GetScreenPrivate (pScreen);
- /*
- * if the cursor has switched screens, disable the sprite
- * on the old screen
- */
- if (pScreen != miPointer.pSpriteScreen)
- {
- if (miPointer.pSpriteScreen)
- {
- miPointerScreenPtr pOldPriv;
-
- pOldPriv = GetScreenPrivate (miPointer.pSpriteScreen);
- if (miPointer.pCursor)
- {
- (*pOldPriv->spriteFuncs->SetCursor)
- (miPointer.pSpriteScreen, NullCursor, 0, 0);
- }
- (*pOldPriv->screenFuncs->CrossScreen) (miPointer.pSpriteScreen, FALSE);
- }
- (*pScreenPriv->screenFuncs->CrossScreen) (pScreen, TRUE);
- (*pScreenPriv->spriteFuncs->SetCursor)
- (pScreen, miPointer.pCursor, x, y);
- miPointer.devx = x;
- miPointer.devy = y;
- miPointer.pSpriteCursor = miPointer.pCursor;
- miPointer.pSpriteScreen = pScreen;
- }
- /*
- * if the cursor has changed, display the new one
- */
- else if (miPointer.pCursor != miPointer.pSpriteCursor)
- {
- pCursor = miPointer.pCursor;
- if (pCursor->bits->emptyMask && !pScreenPriv->showTransparent)
- pCursor = NullCursor;
- (*pScreenPriv->spriteFuncs->SetCursor) (pScreen, pCursor, x, y);
-
- miPointer.devx = x;
- miPointer.devy = y;
- miPointer.pSpriteCursor = miPointer.pCursor;
- }
- else if (x != devx || y != devy)
- {
- miPointer.devx = x;
- miPointer.devy = y;
- if(!miPointer.pCursor->bits->emptyMask)
- (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
- }
-}
-
-/*
- * miPointerDeltaCursor. The pointer has moved dx,dy from it's previous
- * position.
- */
-
-void
-miPointerDeltaCursor (dx, dy, time)
- int dx, dy;
- unsigned long time;
-{
- miPointerAbsoluteCursor (miPointer.x + dx, miPointer.y + dy, time);
-}
-
-void
-miPointerSetNewScreen(int screen_no, int x, int y)
-{
- miPointerScreenPtr pScreenPriv;
- ScreenPtr pScreen;
-
- pScreen = screenInfo.screens[screen_no];
- pScreenPriv = GetScreenPrivate (pScreen);
- (*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
- NewCurrentScreen (pScreen, x, y);
- miPointer.limits.x2 = pScreen->width;
- miPointer.limits.y2 = pScreen->height;
-}
-
-ScreenPtr
-miPointerCurrentScreen ()
-{
- return (miPointer.pScreen);
-}
-
-/*
- * miPointerAbsoluteCursor. The pointer has moved to x,y
- */
-
-void
-miPointerAbsoluteCursor (x, y, time)
- int x, y;
- unsigned long time;
-{
- miPointerScreenPtr pScreenPriv;
- ScreenPtr pScreen;
- ScreenPtr newScreen;
-
- pScreen = miPointer.pScreen;
- if (!pScreen)
- return; /* called before ready */
- if (x < 0 || x >= pScreen->width || y < 0 || y >= pScreen->height)
- {
- pScreenPriv = GetScreenPrivate (pScreen);
- if (!miPointer.confined)
- {
- newScreen = pScreen;
- (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y);
- if (newScreen != pScreen)
- {
- pScreen = newScreen;
- (*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
- pScreenPriv = GetScreenPrivate (pScreen);
- /* Smash the confine to the new screen */
- miPointer.limits.x2 = pScreen->width;
- miPointer.limits.y2 = pScreen->height;
- }
- }
- }
- /*
- * constrain the hot-spot to the current
- * limits
- */
- if (x < miPointer.limits.x1)
- x = miPointer.limits.x1;
- if (x >= miPointer.limits.x2)
- x = miPointer.limits.x2 - 1;
- if (y < miPointer.limits.y1)
- y = miPointer.limits.y1;
- if (y >= miPointer.limits.y2)
- y = miPointer.limits.y2 - 1;
- if (miPointer.x == x && miPointer.y == y && miPointer.pScreen == pScreen)
- return;
- miPointerMove (pScreen, x, y, time);
-}
-
-void
-miPointerPosition (x, y)
- int *x, *y;
-{
- *x = miPointer.x;
- *y = miPointer.y;
-}
-
-/*
- * miPointerMove. The pointer has moved to x,y on current screen
- */
-
-static void
-miPointerMove (pScreen, x, y, time)
- ScreenPtr pScreen;
- int x, y;
- unsigned long time;
-{
- SetupScreen(pScreen);
- xEvent xE;
- miHistoryPtr history;
- int prev, end, start;
-
- if (!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
- {
- miPointer.devx = x;
- miPointer.devy = y;
- if(!miPointer.pCursor->bits->emptyMask)
- (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
- }
- miPointer.x = x;
- miPointer.y = y;
- miPointer.pScreen = pScreen;
-
- xE.u.u.type = MotionNotify;
- xE.u.keyButtonPointer.rootX = x;
- xE.u.keyButtonPointer.rootY = y;
- xE.u.keyButtonPointer.time = time;
- (*pScreenPriv->screenFuncs->EnqueueEvent) (&xE);
-
- end = miPointer.history_end;
- start = miPointer.history_start;
- prev = end - 1;
- if (end == 0)
- prev = MOTION_SIZE - 1;
- history = &miPointer.history[prev];
- if (end == start || history->event.time != time)
- {
- history = &miPointer.history[end];
- if (++end == MOTION_SIZE)
- end = 0;
- if (end == start)
- {
- start = end + 1;
- if (start == MOTION_SIZE)
- start = 0;
- miPointer.history_start = start;
- }
- miPointer.history_end = end;
- }
- history->event.x = x;
- history->event.y = y;
- history->event.time = time;
- history->pScreen = pScreen;
-}
-
-void
-_miRegisterPointerDevice (pScreen, pDevice)
- ScreenPtr pScreen;
- DeviceIntPtr pDevice;
-{
- miPointer.pPointer = (DevicePtr)pDevice;
-}
-
-/* obsolete: for binary compatibility */
-#ifdef miRegisterPointerDevice
-#undef miRegisterPointerDevice
-void
-miRegisterPointerDevice (pScreen, pDevice)
- ScreenPtr pScreen;
- DevicePtr pDevice;
-{
- miPointer.pPointer = pDevice;
-}
-#endif /* miRegisterPointerDevice */
diff --git a/mi/mipointer.h b/mi/mipointer.h
deleted file mode 100644
index 0486fc5a3..000000000
--- a/mi/mipointer.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * mipointer.h
- *
- */
-
-/* $Xorg: mipointer.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/mipointer.h,v 3.9 2001/12/14 20:00:24 dawes Exp $ */
-
-#ifndef MIPOINTER_H
-#define MIPOINTER_H
-
-#include "cursor.h"
-#include "input.h"
-
-typedef struct _miPointerSpriteFuncRec {
- Bool (*RealizeCursor)(
- ScreenPtr /* pScr */,
- CursorPtr /* pCurs */
- );
- Bool (*UnrealizeCursor)(
- ScreenPtr /* pScr */,
- CursorPtr /* pCurs */
- );
- void (*SetCursor)(
- ScreenPtr /* pScr */,
- CursorPtr /* pCurs */,
- int /* x */,
- int /* y */
- );
- void (*MoveCursor)(
- ScreenPtr /* pScr */,
- int /* x */,
- int /* y */
- );
-} miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
-
-typedef struct _miPointerScreenFuncRec {
- Bool (*CursorOffScreen)(
- ScreenPtr* /* ppScr */,
- int* /* px */,
- int* /* py */
- );
- void (*CrossScreen)(
- ScreenPtr /* pScr */,
- int /* entering */
- );
- void (*WarpCursor)(
- ScreenPtr /* pScr */,
- int /* x */,
- int /* y */
- );
- void (*EnqueueEvent)(
- xEventPtr /* event */
- );
- void (*NewEventScreen)(
- ScreenPtr /* pScr */,
- Bool /* fromDIX */
- );
-} miPointerScreenFuncRec, *miPointerScreenFuncPtr;
-
-extern Bool miDCInitialize(
- ScreenPtr /*pScreen*/,
- miPointerScreenFuncPtr /*screenFuncs*/
-);
-
-extern Bool miPointerInitialize(
- ScreenPtr /*pScreen*/,
- miPointerSpriteFuncPtr /*spriteFuncs*/,
- miPointerScreenFuncPtr /*screenFuncs*/,
- Bool /*waitForUpdate*/
-);
-
-extern void miPointerWarpCursor(
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/
-);
-
-extern int miPointerGetMotionBufferSize(
- void
-);
-
-extern int miPointerGetMotionEvents(
- DeviceIntPtr /*pPtr*/,
- xTimecoord * /*coords*/,
- unsigned long /*start*/,
- unsigned long /*stop*/,
- ScreenPtr /*pScreen*/
-);
-
-extern void miPointerUpdate(
- void
-);
-
-extern void miPointerDeltaCursor(
- int /*dx*/,
- int /*dy*/,
- unsigned long /*time*/
-);
-
-extern void miPointerAbsoluteCursor(
- int /*x*/,
- int /*y*/,
- unsigned long /*time*/
-);
-
-extern void miPointerPosition(
- int * /*x*/,
- int * /*y*/
-);
-
-#undef miRegisterPointerDevice
-extern void miRegisterPointerDevice(
- ScreenPtr /*pScreen*/,
- DevicePtr /*pDevice*/
-);
-
-extern void miPointerSetNewScreen(
- int, /*screen_no*/
- int, /*x*/
- int /*y*/
-);
-extern ScreenPtr miPointerCurrentScreen(
- void
-);
-
-#define miRegisterPointerDevice(pScreen,pDevice) \
- _miRegisterPointerDevice(pScreen,pDevice)
-
-extern void _miRegisterPointerDevice(
- ScreenPtr /*pScreen*/,
- DeviceIntPtr /*pDevice*/
-);
-
-extern int miPointerScreenIndex;
-
-#endif /* MIPOINTER_H */
diff --git a/mi/mipointrst.h b/mi/mipointrst.h
deleted file mode 100644
index ab5372229..000000000
--- a/mi/mipointrst.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * mipointrst.h
- *
- */
-
-/* $Xorg: mipointrst.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/mipointrst.h,v 1.4 2001/12/14 20:00:25 dawes Exp $ */
-
-#include "mipointer.h"
-#include "scrnintstr.h"
-
-#define MOTION_SIZE 256
-
-typedef struct {
- xTimecoord event;
- ScreenPtr pScreen;
-} miHistoryRec, *miHistoryPtr;
-
-typedef struct {
- ScreenPtr pScreen; /* current screen */
- ScreenPtr pSpriteScreen;/* screen containing current sprite */
- CursorPtr pCursor; /* current cursor */
- CursorPtr pSpriteCursor;/* cursor on screen */
- BoxRec limits; /* current constraints */
- Bool confined; /* pointer can't change screens */
- int x, y; /* hot spot location */
- int devx, devy; /* sprite position */
- DevicePtr pPointer; /* pointer device structure */
- miHistoryRec history[MOTION_SIZE];
- int history_start, history_end;
-} miPointerRec, *miPointerPtr;
-
-typedef struct {
- miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
- miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
- CloseScreenProcPtr CloseScreen;
- Bool waitForUpdate; /* don't move cursor in SIGIO */
- Bool showTransparent; /* show empty cursors */
-} miPointerScreenRec, *miPointerScreenPtr;
diff --git a/mi/mipoly.c b/mi/mipoly.c
deleted file mode 100644
index ad69d7062..000000000
--- a/mi/mipoly.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipoly.c,v 1.3 2003/07/16 01:38:56 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipoly.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
- * mipoly.c
- *
- * Written by Brian Kelleher; June 1986
- *
- * Draw polygons. This routine translates the point by the
- * origin if pGC->miTranslate is non-zero, and calls
- * to the appropriate routine to actually scan convert the
- * polygon.
- */
-#include "X.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mi.h"
-#include "regionstr.h"
-
-
-void
-miFillPolygon(dst, pgc, shape, mode, count, pPts)
- DrawablePtr dst;
- register GCPtr pgc;
- int shape, mode;
- register int count;
- DDXPointPtr pPts;
-{
- int i;
- register int xorg, yorg;
- register DDXPointPtr ppt;
-
- if (count == 0)
- return;
-
- ppt = pPts;
- if (pgc->miTranslate)
- {
- xorg = dst->x;
- yorg = dst->y;
-
- if (mode == CoordModeOrigin)
- {
- for (i = 0; i<count; i++)
- {
- ppt->x += xorg;
- ppt++->y += yorg;
- }
- }
- else
- {
- ppt->x += xorg;
- ppt++->y += yorg;
- for (i = 1; i<count; i++)
- {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- ppt++;
- }
- }
- }
- else
- {
- if (mode == CoordModePrevious)
- {
- ppt++;
- for (i = 1; i<count; i++)
- {
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- ppt++;
- }
- }
- }
- if (shape == Convex)
- miFillConvexPoly(dst, pgc, count, pPts);
- else
- miFillGeneralPoly(dst, pgc, count, pPts);
-}
diff --git a/mi/mipoly.h b/mi/mipoly.h
deleted file mode 100644
index 42d973477..000000000
--- a/mi/mipoly.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $Xorg: mipoly.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/mipoly.h,v 1.3 2001/12/14 20:00:25 dawes Exp $ */
-
-
-/*
- * fill.h
- *
- * Created by Brian Kelleher; Oct 1985
- *
- * Include file for filled polygon routines.
- *
- * These are the data structures needed to scan
- * convert regions. Two different scan conversion
- * methods are available -- the even-odd method, and
- * the winding number method.
- * The even-odd rule states that a point is inside
- * the polygon if a ray drawn from that point in any
- * direction will pass through an odd number of
- * path segments.
- * By the winding number rule, a point is decided
- * to be inside the polygon if a ray drawn from that
- * point in any direction passes through a different
- * number of clockwise and counter-clockwise path
- * segments.
- *
- * These data structures are adapted somewhat from
- * the algorithm in (Foley/Van Dam) for scan converting
- * polygons.
- * The basic algorithm is to start at the top (smallest y)
- * of the polygon, stepping down to the bottom of
- * the polygon by incrementing the y coordinate. We
- * keep a list of edges which the current scanline crosses,
- * sorted by x. This list is called the Active Edge Table (AET)
- * As we change the y-coordinate, we update each entry in
- * in the active edge table to reflect the edges new xcoord.
- * This list must be sorted at each scanline in case
- * two edges intersect.
- * We also keep a data structure known as the Edge Table (ET),
- * which keeps track of all the edges which the current
- * scanline has not yet reached. The ET is basically a
- * list of ScanLineList structures containing a list of
- * edges which are entered at a given scanline. There is one
- * ScanLineList per scanline at which an edge is entered.
- * When we enter a new edge, we move it from the ET to the AET.
- *
- * From the AET, we can implement the even-odd rule as in
- * (Foley/Van Dam).
- * The winding number rule is a little trickier. We also
- * keep the EdgeTableEntries in the AET linked by the
- * nextWETE (winding EdgeTableEntry) link. This allows
- * the edges to be linked just as before for updating
- * purposes, but only uses the edges linked by the nextWETE
- * link as edges representing spans of the polygon to
- * drawn (as with the even-odd rule).
- */
-
-/*
- * for the winding number rule
- */
-#define CLOCKWISE 1
-#define COUNTERCLOCKWISE -1
-
-typedef struct _EdgeTableEntry {
- int ymax; /* ycoord at which we exit this edge. */
- BRESINFO bres; /* Bresenham info to run the edge */
- struct _EdgeTableEntry *next; /* next in the list */
- struct _EdgeTableEntry *back; /* for insertion sort */
- struct _EdgeTableEntry *nextWETE; /* for winding num rule */
- int ClockWise; /* flag for winding number rule */
-} EdgeTableEntry;
-
-
-typedef struct _ScanLineList{
- int scanline; /* the scanline represented */
- EdgeTableEntry *edgelist; /* header node */
- struct _ScanLineList *next; /* next in the list */
-} ScanLineList;
-
-
-typedef struct {
- int ymax; /* ymax for the polygon */
- int ymin; /* ymin for the polygon */
- ScanLineList scanlines; /* header node */
-} EdgeTable;
-
-
-/*
- * Here is a struct to help with storage allocation
- * so we can allocate a big chunk at a time, and then take
- * pieces from this heap when we need to.
- */
-#define SLLSPERBLOCK 25
-
-typedef struct _ScanLineListBlock {
- ScanLineList SLLs[SLLSPERBLOCK];
- struct _ScanLineListBlock *next;
-} ScanLineListBlock;
-
-/*
- * number of points to buffer before sending them off
- * to scanlines() : Must be an even number
- */
-#define NUMPTSTOBUFFER 200
-
-
-/*
- *
- * a few macros for the inner loops of the fill code where
- * performance considerations don't allow a procedure call.
- *
- * Evaluate the given edge at the given scanline.
- * If the edge has expired, then we leave it and fix up
- * the active edge table; otherwise, we increment the
- * x value to be ready for the next scanline.
- * The winding number rule is in effect, so we must notify
- * the caller when the edge has been removed so he
- * can reorder the Winding Active Edge Table.
- */
-#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
- if (pAET->ymax == y) { /* leaving this edge */ \
- pPrevAET->next = pAET->next; \
- pAET = pPrevAET->next; \
- fixWAET = 1; \
- if (pAET) \
- pAET->back = pPrevAET; \
- } \
- else { \
- BRESINCRPGONSTRUCT(pAET->bres); \
- pPrevAET = pAET; \
- pAET = pAET->next; \
- } \
-}
-
-
-/*
- * Evaluate the given edge at the given scanline.
- * If the edge has expired, then we leave it and fix up
- * the active edge table; otherwise, we increment the
- * x value to be ready for the next scanline.
- * The even-odd rule is in effect.
- */
-#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
- if (pAET->ymax == y) { /* leaving this edge */ \
- pPrevAET->next = pAET->next; \
- pAET = pPrevAET->next; \
- if (pAET) \
- pAET->back = pPrevAET; \
- } \
- else { \
- BRESINCRPGONSTRUCT(pAET->bres); \
- pPrevAET = pAET; \
- pAET = pAET->next; \
- } \
-}
-
-/* mipolyutil.c */
-
-extern Bool miInsertEdgeInET(
- EdgeTable * /*ET*/,
- EdgeTableEntry * /*ETE*/,
- int /*scanline*/,
- ScanLineListBlock ** /*SLLBlock*/,
- int * /*iSLLBlock*/
-);
-
-extern Bool miCreateETandAET(
- int /*count*/,
- DDXPointPtr /*pts*/,
- EdgeTable * /*ET*/,
- EdgeTableEntry * /*AET*/,
- EdgeTableEntry * /*pETEs*/,
- ScanLineListBlock * /*pSLLBlock*/
-);
-
-extern void miloadAET(
- EdgeTableEntry * /*AET*/,
- EdgeTableEntry * /*ETEs*/
-);
-
-extern void micomputeWAET(
- EdgeTableEntry * /*AET*/
-);
-
-extern int miInsertionSort(
- EdgeTableEntry * /*AET*/
-);
-
-extern void miFreeStorage(
- ScanLineListBlock * /*pSLLBlock*/
-);
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
deleted file mode 100644
index d99ed83d7..000000000
--- a/mi/mipolycon.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolycon.c,v 1.4 2001/12/14 20:00:25 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolycon.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-#include "gcstruct.h"
-#include "pixmap.h"
-#include "mi.h"
-#include "miscanfill.h"
-
-static int getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty);
-
-/*
- * convexpoly.c
- *
- * Written by Brian Kelleher; Dec. 1985.
- *
- * Fill a convex polygon. If the given polygon
- * is not convex, then the result is undefined.
- * The algorithm is to order the edges from smallest
- * y to largest by partitioning the array into a left
- * edge list and a right edge list. The algorithm used
- * to traverse each edge is an extension of Bresenham's
- * line algorithm with y as the major axis.
- * For a derivation of the algorithm, see the author of
- * this code.
- */
-Bool
-miFillConvexPoly(dst, pgc, count, ptsIn)
- DrawablePtr dst;
- GCPtr pgc;
- int count; /* number of points */
- DDXPointPtr ptsIn; /* the points */
-{
- register int xl = 0, xr = 0; /* x vals of left and right edges */
- register int dl = 0, dr = 0; /* decision variables */
- register int ml = 0, m1l = 0;/* left edge slope and slope+1 */
- int mr = 0, m1r = 0; /* right edge slope and slope+1 */
- int incr1l = 0, incr2l = 0; /* left edge error increments */
- int incr1r = 0, incr2r = 0; /* right edge error increments */
- int dy; /* delta y */
- int y; /* current scanline */
- int left, right; /* indices to first endpoints */
- int i; /* loop counter */
- int nextleft, nextright; /* indices to second endpoints */
- DDXPointPtr ptsOut, FirstPoint; /* output buffer */
- int *width, *FirstWidth; /* output buffer */
- int imin; /* index of smallest vertex (in y) */
- int ymin; /* y-extents of polygon */
- int ymax;
-
- /*
- * find leftx, bottomy, rightx, topy, and the index
- * of bottomy. Also translate the points.
- */
- imin = getPolyYBounds(ptsIn, count, &ymin, &ymax);
-
- dy = ymax - ymin + 1;
- if ((count < 3) || (dy < 0))
- return(TRUE);
- ptsOut = FirstPoint = (DDXPointPtr )ALLOCATE_LOCAL(sizeof(DDXPointRec)*dy);
- width = FirstWidth = (int *)ALLOCATE_LOCAL(sizeof(int) * dy);
- if(!FirstPoint || !FirstWidth)
- {
- if (FirstWidth) DEALLOCATE_LOCAL(FirstWidth);
- if (FirstPoint) DEALLOCATE_LOCAL(FirstPoint);
- return(FALSE);
- }
-
- nextleft = nextright = imin;
- y = ptsIn[nextleft].y;
-
- /*
- * loop through all edges of the polygon
- */
- do {
- /*
- * add a left edge if we need to
- */
- if (ptsIn[nextleft].y == y) {
- left = nextleft;
-
- /*
- * find the next edge, considering the end
- * conditions of the array.
- */
- nextleft++;
- if (nextleft >= count)
- nextleft = 0;
-
- /*
- * now compute all of the random information
- * needed to run the iterative algorithm.
- */
- BRESINITPGON(ptsIn[nextleft].y-ptsIn[left].y,
- ptsIn[left].x,ptsIn[nextleft].x,
- xl, dl, ml, m1l, incr1l, incr2l);
- }
-
- /*
- * add a right edge if we need to
- */
- if (ptsIn[nextright].y == y) {
- right = nextright;
-
- /*
- * find the next edge, considering the end
- * conditions of the array.
- */
- nextright--;
- if (nextright < 0)
- nextright = count-1;
-
- /*
- * now compute all of the random information
- * needed to run the iterative algorithm.
- */
- BRESINITPGON(ptsIn[nextright].y-ptsIn[right].y,
- ptsIn[right].x,ptsIn[nextright].x,
- xr, dr, mr, m1r, incr1r, incr2r);
- }
-
- /*
- * generate scans to fill while we still have
- * a right edge as well as a left edge.
- */
- i = min(ptsIn[nextleft].y, ptsIn[nextright].y) - y;
- /* in case we're called with non-convex polygon */
- if(i < 0)
- {
- DEALLOCATE_LOCAL(FirstWidth);
- DEALLOCATE_LOCAL(FirstPoint);
- return(TRUE);
- }
- while (i-- > 0)
- {
- ptsOut->y = y;
-
- /*
- * reverse the edges if necessary
- */
- if (xl < xr)
- {
- *(width++) = xr - xl;
- (ptsOut++)->x = xl;
- }
- else
- {
- *(width++) = xl - xr;
- (ptsOut++)->x = xr;
- }
- y++;
-
- /* increment down the edges */
- BRESINCRPGON(dl, xl, ml, m1l, incr1l, incr2l);
- BRESINCRPGON(dr, xr, mr, m1r, incr1r, incr2r);
- }
- } while (y != ymax);
-
- /*
- * Finally, fill the <remaining> spans
- */
- (*pgc->ops->FillSpans)(dst, pgc,
- ptsOut-FirstPoint,FirstPoint,FirstWidth,
- 1);
- DEALLOCATE_LOCAL(FirstWidth);
- DEALLOCATE_LOCAL(FirstPoint);
- return(TRUE);
-}
-
-
-/*
- * Find the index of the point with the smallest y.
- */
-static int
-getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty)
-{
- register DDXPointPtr ptMin;
- int ymin, ymax;
- DDXPointPtr ptsStart = pts;
-
- ptMin = pts;
- ymin = ymax = (pts++)->y;
-
- while (--n > 0) {
- if (pts->y < ymin)
- {
- ptMin = pts;
- ymin = pts->y;
- }
- if(pts->y > ymax)
- ymax = pts->y;
-
- pts++;
- }
-
- *by = ymin;
- *ty = ymax;
- return(ptMin-ptsStart);
-}
diff --git a/mi/mipolygen.c b/mi/mipolygen.c
deleted file mode 100644
index bbeb05dc3..000000000
--- a/mi/mipolygen.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolygen.c,v 1.3 2001/12/14 20:00:25 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolygen.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "X.h"
-#include "gcstruct.h"
-#include "miscanfill.h"
-#include "mipoly.h"
-#include "pixmap.h"
-#include "mi.h"
-
-/*
- *
- * Written by Brian Kelleher; Oct. 1985
- *
- * Routine to fill a polygon. Two fill rules are
- * supported: frWINDING and frEVENODD.
- *
- * See fillpoly.h for a complete description of the algorithm.
- */
-
-Bool
-miFillGeneralPoly(dst, pgc, count, ptsIn)
- DrawablePtr dst;
- GCPtr pgc;
- int count; /* number of points */
- DDXPointPtr ptsIn; /* the points */
-{
- register EdgeTableEntry *pAET; /* the Active Edge Table */
- register int y; /* the current scanline */
- register int nPts = 0; /* number of pts in buffer */
- register EdgeTableEntry *pWETE; /* Winding Edge Table */
- register ScanLineList *pSLL; /* Current ScanLineList */
- register DDXPointPtr ptsOut; /* ptr to output buffers */
- int *width;
- DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */
- int FirstWidth[NUMPTSTOBUFFER];
- EdgeTableEntry *pPrevAET; /* previous AET entry */
- EdgeTable ET; /* Edge Table header node */
- EdgeTableEntry AET; /* Active ET header node */
- EdgeTableEntry *pETEs; /* Edge Table Entries buff */
- ScanLineListBlock SLLBlock; /* header for ScanLineList */
- int fixWAET = 0;
-
- if (count < 3)
- return(TRUE);
-
- if(!(pETEs = (EdgeTableEntry *)
- ALLOCATE_LOCAL(sizeof(EdgeTableEntry) * count)))
- return(FALSE);
- ptsOut = FirstPoint;
- width = FirstWidth;
- if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock))
- {
- DEALLOCATE_LOCAL(pETEs);
- return(FALSE);
- }
- pSLL = ET.scanlines.next;
-
- if (pgc->fillRule == EvenOddRule)
- {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; y++)
- {
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL && y == pSLL->scanline)
- {
- miloadAET(&AET, pSLL->edgelist);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
-
- /*
- * for each active edge
- */
- while (pAET)
- {
- ptsOut->x = pAET->bres.minor;
- ptsOut++->y = y;
- *width++ = pAET->next->bres.minor - pAET->bres.minor;
- nPts++;
-
- /*
- * send out the buffer when its full
- */
- if (nPts == NUMPTSTOBUFFER)
- {
- (*pgc->ops->FillSpans)(dst, pgc,
- nPts, FirstPoint, FirstWidth,
- 1);
- ptsOut = FirstPoint;
- width = FirstWidth;
- nPts = 0;
- }
- EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
- EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
- }
- miInsertionSort(&AET);
- }
- }
- else /* default to WindingNumber */
- {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; y++)
- {
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL && y == pSLL->scanline)
- {
- miloadAET(&AET, pSLL->edgelist);
- micomputeWAET(&AET);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
- pWETE = pAET;
-
- /*
- * for each active edge
- */
- while (pAET)
- {
- /*
- * if the next edge in the active edge table is
- * also the next edge in the winding active edge
- * table.
- */
- if (pWETE == pAET)
- {
- ptsOut->x = pAET->bres.minor;
- ptsOut++->y = y;
- *width++ = pAET->nextWETE->bres.minor - pAET->bres.minor;
- nPts++;
-
- /*
- * send out the buffer
- */
- if (nPts == NUMPTSTOBUFFER)
- {
- (*pgc->ops->FillSpans)(dst, pgc, nPts, FirstPoint,
- FirstWidth, 1);
- ptsOut = FirstPoint;
- width = FirstWidth;
- nPts = 0;
- }
-
- pWETE = pWETE->nextWETE;
- while (pWETE != pAET)
- EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
- pWETE = pWETE->nextWETE;
- }
- EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
- }
-
- /*
- * reevaluate the Winding active edge table if we
- * just had to resort it or if we just exited an edge.
- */
- if (miInsertionSort(&AET) || fixWAET)
- {
- micomputeWAET(&AET);
- fixWAET = 0;
- }
- }
- }
-
- /*
- * Get any spans that we missed by buffering
- */
- (*pgc->ops->FillSpans)(dst, pgc, nPts, FirstPoint, FirstWidth, 1);
- DEALLOCATE_LOCAL(pETEs);
- miFreeStorage(SLLBlock.next);
- return(TRUE);
-}
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
deleted file mode 100644
index ed19f5f68..000000000
--- a/mi/mipolypnt.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolypnt.c,v 1.3 2001/12/14 20:00:25 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolypnt.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "X.h"
-#include "Xprotostr.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "mi.h"
-
-void
-miPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
-
- int xorg;
- int yorg;
- int nptTmp;
- XID fsOld, fsNew;
- int *pwidthInit, *pwidth;
- int i;
- register xPoint *ppt;
-
- /* make pointlist origin relative */
- if (mode == CoordModePrevious)
- {
- ppt = pptInit;
- nptTmp = npt;
- nptTmp--;
- while(nptTmp--)
- {
- ppt++;
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- }
-
- if(pGC->miTranslate)
- {
- ppt = pptInit;
- nptTmp = npt;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- while(nptTmp--)
- {
- ppt->x += xorg;
- ppt++->y += yorg;
- }
- }
-
- fsOld = pGC->fillStyle;
- fsNew = FillSolid;
- if(pGC->fillStyle != FillSolid)
- {
- DoChangeGC(pGC, GCFillStyle, &fsNew, 0);
- ValidateGC(pDrawable, pGC);
- }
- if(!(pwidthInit = (int *)ALLOCATE_LOCAL(npt * sizeof(int))))
- return;
- pwidth = pwidthInit;
- for(i = 0; i < npt; i++)
- *pwidth++ = 1;
- (*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE);
-
- if(fsOld != FillSolid)
- {
- DoChangeGC(pGC, GCFillStyle, &fsOld, 0);
- ValidateGC(pDrawable, pGC);
- }
- DEALLOCATE_LOCAL(pwidthInit);
-}
-
diff --git a/mi/mipolyrect.c b/mi/mipolyrect.c
deleted file mode 100644
index 298ba2385..000000000
--- a/mi/mipolyrect.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolyrect.c,v 1.4 2003/07/16 01:38:57 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolyrect.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmap.h"
-#include "mi.h"
-
-void
-miPolyRectangle(pDraw, pGC, nrects, pRects)
- DrawablePtr pDraw;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- int i;
- xRectangle *pR = pRects;
- DDXPointRec rect[5];
- int bound_tmp;
-
-#define MINBOUND(dst,eqn) bound_tmp = eqn; \
- if (bound_tmp < -32768) \
- bound_tmp = -32768; \
- dst = bound_tmp;
-
-#define MAXBOUND(dst,eqn) bound_tmp = eqn; \
- if (bound_tmp > 32767) \
- bound_tmp = 32767; \
- dst = bound_tmp;
-
-#define MAXUBOUND(dst,eqn) bound_tmp = eqn; \
- if (bound_tmp > 65535) \
- bound_tmp = 65535; \
- dst = bound_tmp;
-
- if (pGC->lineStyle == LineSolid && pGC->joinStyle == JoinMiter &&
- pGC->lineWidth != 0)
- {
- xRectangle *tmp, *t;
- int ntmp;
- int offset1, offset2, offset3;
- int x, y, width, height;
-
- ntmp = (nrects << 2);
- offset2 = pGC->lineWidth;
- offset1 = offset2 >> 1;
- offset3 = offset2 - offset1;
- tmp = (xRectangle *) ALLOCATE_LOCAL(ntmp * sizeof (xRectangle));
- if (!tmp)
- return;
- t = tmp;
- for (i = 0; i < nrects; i++)
- {
- x = pR->x;
- y = pR->y;
- width = pR->width;
- height = pR->height;
- pR++;
- if (width == 0 && height == 0)
- {
- rect[0].x = x;
- rect[0].y = y;
- rect[1].x = x;
- rect[1].y = y;
- (*pGC->ops->Polylines)(pDraw, pGC, CoordModeOrigin, 2, rect);
- }
- else if (height < offset2 || width < offset1)
- {
- if (height == 0)
- {
- t->x = x;
- t->width = width;
- }
- else
- {
- MINBOUND (t->x, x - offset1)
- MAXUBOUND (t->width, width + offset2)
- }
- if (width == 0)
- {
- t->y = y;
- t->height = height;
- }
- else
- {
- MINBOUND (t->y, y - offset1)
- MAXUBOUND (t->height, height + offset2)
- }
- t++;
- }
- else
- {
- MINBOUND(t->x, x - offset1)
- MINBOUND(t->y, y - offset1)
- MAXUBOUND(t->width, width + offset2)
- t->height = offset2;
- t++;
- MINBOUND(t->x, x - offset1)
- MAXBOUND(t->y, y + offset3);
- t->width = offset2;
- t->height = height - offset2;
- t++;
- MAXBOUND(t->x, x + width - offset1);
- MAXBOUND(t->y, y + offset3)
- t->width = offset2;
- t->height = height - offset2;
- t++;
- MINBOUND(t->x, x - offset1)
- MAXBOUND(t->y, y + height - offset1)
- MAXUBOUND(t->width, width + offset2)
- t->height = offset2;
- t++;
- }
- }
- (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp);
- DEALLOCATE_LOCAL ((pointer) tmp);
- }
- else
- {
-
- for (i=0; i<nrects; i++)
- {
- rect[0].x = pR->x;
- rect[0].y = pR->y;
-
- MAXBOUND(rect[1].x, pR->x + (int) pR->width)
- rect[1].y = rect[0].y;
-
- rect[2].x = rect[1].x;
- MAXBOUND(rect[2].y, pR->y + (int) pR->height);
-
- rect[3].x = rect[0].x;
- rect[3].y = rect[2].y;
-
- rect[4].x = rect[0].x;
- rect[4].y = rect[0].y;
-
- (*pGC->ops->Polylines)(pDraw, pGC, CoordModeOrigin, 5, rect);
- pR++;
- }
- }
-}
diff --git a/mi/mipolyseg.c b/mi/mipolyseg.c
deleted file mode 100644
index cb6bb7550..000000000
--- a/mi/mipolyseg.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolyseg.c,v 1.4 2003/07/16 01:38:57 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolyseg.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmap.h"
-#include "mi.h"
-
-/*****************************************************************
- * miPolySegment
- *
- * For each segment, draws a line between (x1, y1) and (x2, y2). The
- * lines are drawn in the order listed.
- *
- * Walks the segments, compressing them into format for PolyLines.
- *
- *****************************************************************/
-
-
-void
-miPolySegment(pDraw, pGC, nseg, pSegs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int nseg;
- xSegment *pSegs;
-{
- int i;
-
- for (i=0; i<nseg; i++)
- {
- (*pGC->ops->Polylines)(pDraw, pGC, CoordModeOrigin, 2,(DDXPointPtr)pSegs);
- pSegs++;
- }
-}
diff --git a/mi/mipolytext.c b/mi/mipolytext.c
deleted file mode 100644
index 9084fe180..000000000
--- a/mi/mipolytext.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolytext.c,v 1.3 2001/12/14 20:00:26 dawes Exp $ */
-/*******************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-************************************************************************/
-/* $Xorg: mipolytext.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
- * mipolytext.c - text routines
- *
- * Author: haynes
- * Digital Equipment Corporation
- * Western Software Laboratory
- * Date: Thu Feb 5 1987
- */
-
-#include "X.h"
-#include "Xmd.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "gcstruct.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "mi.h"
-
-int
-miPolyText(pDraw, pGC, x, y, count, chars, fontEncoding)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
- FontEncoding fontEncoding;
-{
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- fontEncoding, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- (*pGC->ops->PolyGlyphBlt)(
- pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
- return x+w;
-}
-
-
-int
-miPolyText8(pDraw, pGC, x, y, count, chars)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- Linear8Bit, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- (*pGC->ops->PolyGlyphBlt)(
- pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
- return x+w;
-}
-
-
-int
-miPolyText16(pDraw, pGC, x, y, count, chars)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- (*pGC->ops->PolyGlyphBlt)(
- pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
- return x+w;
-}
-
-
-int
-miImageText(pDraw, pGC, x, y, count, chars, fontEncoding)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
- FontEncoding fontEncoding;
-{
- unsigned long n, i;
- FontPtr font = pGC->font;
- int w;
- CharInfoPtr charinfo[255];
-
- GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
- fontEncoding, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n !=0 )
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
- return x+w;
-}
-
-
-void
-miImageText8(pDraw, pGC, x, y, count, chars)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- unsigned long n;
- FontPtr font = pGC->font;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
- Linear8Bit, &n, charinfo);
- if (n !=0 )
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
-}
-
-
-void
-miImageText16(pDraw, pGC, x, y, count, chars)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- unsigned long n;
- FontPtr font = pGC->font;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
- if (n !=0 )
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
-}
diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c
deleted file mode 100644
index 7ffeadd86..000000000
--- a/mi/mipolyutil.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipolyutil.c,v 1.10 2003/07/16 01:38:57 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipolyutil.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "regionstr.h"
-#include "gc.h"
-#include "miscanfill.h"
-#include "mipoly.h"
-#include "misc.h" /* MAXINT */
-
-/*
- * fillUtils.c
- *
- * Written by Brian Kelleher; Oct. 1985
- *
- * This module contains all of the utility functions
- * needed to scan convert a polygon.
- *
- */
-
-/*
- * InsertEdgeInET
- *
- * Insert the given edge into the edge table.
- * First we must find the correct bucket in the
- * Edge table, then find the right slot in the
- * bucket. Finally, we can insert it.
- *
- */
-Bool
-miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
- EdgeTable *ET;
- EdgeTableEntry *ETE;
- int scanline;
- ScanLineListBlock **SLLBlock;
- int *iSLLBlock;
-{
- register EdgeTableEntry *start, *prev;
- register ScanLineList *pSLL, *pPrevSLL;
- ScanLineListBlock *tmpSLLBlock;
-
- /*
- * find the right bucket to put the edge into
- */
- pPrevSLL = &ET->scanlines;
- pSLL = pPrevSLL->next;
- while (pSLL && (pSLL->scanline < scanline))
- {
- pPrevSLL = pSLL;
- pSLL = pSLL->next;
- }
-
- /*
- * reassign pSLL (pointer to ScanLineList) if necessary
- */
- if ((!pSLL) || (pSLL->scanline > scanline))
- {
- if (*iSLLBlock > SLLSPERBLOCK-1)
- {
- tmpSLLBlock =
- (ScanLineListBlock *)xalloc(sizeof(ScanLineListBlock));
- if (!tmpSLLBlock)
- return FALSE;
- (*SLLBlock)->next = tmpSLLBlock;
- tmpSLLBlock->next = (ScanLineListBlock *)NULL;
- *SLLBlock = tmpSLLBlock;
- *iSLLBlock = 0;
- }
- pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
-
- pSLL->next = pPrevSLL->next;
- pSLL->edgelist = (EdgeTableEntry *)NULL;
- pPrevSLL->next = pSLL;
- }
- pSLL->scanline = scanline;
-
- /*
- * now insert the edge in the right bucket
- */
- prev = (EdgeTableEntry *)NULL;
- start = pSLL->edgelist;
- while (start && (start->bres.minor < ETE->bres.minor))
- {
- prev = start;
- start = start->next;
- }
- ETE->next = start;
-
- if (prev)
- prev->next = ETE;
- else
- pSLL->edgelist = ETE;
- return TRUE;
-}
-
-/*
- * CreateEdgeTable
- *
- * This routine creates the edge table for
- * scan converting polygons.
- * The Edge Table (ET) looks like:
- *
- * EdgeTable
- * --------
- * | ymax | ScanLineLists
- * |scanline|-->------------>-------------->...
- * -------- |scanline| |scanline|
- * |edgelist| |edgelist|
- * --------- ---------
- * | |
- * | |
- * V V
- * list of ETEs list of ETEs
- *
- * where ETE is an EdgeTableEntry data structure,
- * and there is one ScanLineList per scanline at
- * which an edge is initially entered.
- *
- */
-
-Bool
-miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
- register int count;
- register DDXPointPtr pts;
- EdgeTable *ET;
- EdgeTableEntry *AET;
- register EdgeTableEntry *pETEs;
- ScanLineListBlock *pSLLBlock;
-{
- register DDXPointPtr top, bottom;
- register DDXPointPtr PrevPt, CurrPt;
- int iSLLBlock = 0;
-
- int dy;
-
- if (count < 2) return TRUE;
-
- /*
- * initialize the Active Edge Table
- */
- AET->next = (EdgeTableEntry *)NULL;
- AET->back = (EdgeTableEntry *)NULL;
- AET->nextWETE = (EdgeTableEntry *)NULL;
- AET->bres.minor = MININT;
-
- /*
- * initialize the Edge Table.
- */
- ET->scanlines.next = (ScanLineList *)NULL;
- ET->ymax = MININT;
- ET->ymin = MAXINT;
- pSLLBlock->next = (ScanLineListBlock *)NULL;
-
- PrevPt = &pts[count-1];
-
- /*
- * for each vertex in the array of points.
- * In this loop we are dealing with two vertices at
- * a time -- these make up one edge of the polygon.
- */
- while (count--)
- {
- CurrPt = pts++;
-
- /*
- * find out which point is above and which is below.
- */
- if (PrevPt->y > CurrPt->y)
- {
- bottom = PrevPt, top = CurrPt;
- pETEs->ClockWise = 0;
- }
- else
- {
- bottom = CurrPt, top = PrevPt;
- pETEs->ClockWise = 1;
- }
-
- /*
- * don't add horizontal edges to the Edge table.
- */
- if (bottom->y != top->y)
- {
- pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
-
- /*
- * initialize integer edge algorithm
- */
- dy = bottom->y - top->y;
- BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
-
- if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock))
- {
- miFreeStorage(pSLLBlock->next);
- return FALSE;
- }
-
- ET->ymax = max(ET->ymax, PrevPt->y);
- ET->ymin = min(ET->ymin, PrevPt->y);
- pETEs++;
- }
-
- PrevPt = CurrPt;
- }
- return TRUE;
-}
-
-/*
- * loadAET
- *
- * This routine moves EdgeTableEntries from the
- * EdgeTable into the Active Edge Table,
- * leaving them sorted by smaller x coordinate.
- *
- */
-
-void
-miloadAET(AET, ETEs)
- register EdgeTableEntry *AET, *ETEs;
-{
- register EdgeTableEntry *pPrevAET;
- register EdgeTableEntry *tmp;
-
- pPrevAET = AET;
- AET = AET->next;
- while (ETEs)
- {
- while (AET && (AET->bres.minor < ETEs->bres.minor))
- {
- pPrevAET = AET;
- AET = AET->next;
- }
- tmp = ETEs->next;
- ETEs->next = AET;
- if (AET)
- AET->back = ETEs;
- ETEs->back = pPrevAET;
- pPrevAET->next = ETEs;
- pPrevAET = ETEs;
-
- ETEs = tmp;
- }
-}
-
-/*
- * computeWAET
- *
- * This routine links the AET by the
- * nextWETE (winding EdgeTableEntry) link for
- * use by the winding number rule. The final
- * Active Edge Table (AET) might look something
- * like:
- *
- * AET
- * ---------- --------- ---------
- * |ymax | |ymax | |ymax |
- * | ... | |... | |... |
- * |next |->|next |->|next |->...
- * |nextWETE| |nextWETE| |nextWETE|
- * --------- --------- ^--------
- * | | |
- * V-------------------> V---> ...
- *
- */
-void
-micomputeWAET(AET)
- register EdgeTableEntry *AET;
-{
- register EdgeTableEntry *pWETE;
- register int inside = 1;
- register int isInside = 0;
-
- AET->nextWETE = (EdgeTableEntry *)NULL;
- pWETE = AET;
- AET = AET->next;
- while (AET)
- {
- if (AET->ClockWise)
- isInside++;
- else
- isInside--;
-
- if ((!inside && !isInside) ||
- ( inside && isInside))
- {
- pWETE->nextWETE = AET;
- pWETE = AET;
- inside = !inside;
- }
- AET = AET->next;
- }
- pWETE->nextWETE = (EdgeTableEntry *)NULL;
-}
-
-/*
- * InsertionSort
- *
- * Just a simple insertion sort using
- * pointers and back pointers to sort the Active
- * Edge Table.
- *
- */
-
-int
-miInsertionSort(AET)
- register EdgeTableEntry *AET;
-{
- register EdgeTableEntry *pETEchase;
- register EdgeTableEntry *pETEinsert;
- register EdgeTableEntry *pETEchaseBackTMP;
- register int changed = 0;
-
- AET = AET->next;
- while (AET)
- {
- pETEinsert = AET;
- pETEchase = AET;
- while (pETEchase->back->bres.minor > AET->bres.minor)
- pETEchase = pETEchase->back;
-
- AET = AET->next;
- if (pETEchase != pETEinsert)
- {
- pETEchaseBackTMP = pETEchase->back;
- pETEinsert->back->next = AET;
- if (AET)
- AET->back = pETEinsert->back;
- pETEinsert->next = pETEchase;
- pETEchase->back->next = pETEinsert;
- pETEchase->back = pETEinsert;
- pETEinsert->back = pETEchaseBackTMP;
- changed = 1;
- }
- }
- return(changed);
-}
-
-/*
- * Clean up our act.
- */
-void
-miFreeStorage(pSLLBlock)
- register ScanLineListBlock *pSLLBlock;
-{
- register ScanLineListBlock *tmpSLLBlock;
-
- while (pSLLBlock)
- {
- tmpSLLBlock = pSLLBlock->next;
- xfree(pSLLBlock);
- pSLLBlock = tmpSLLBlock;
- }
-}
diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c
deleted file mode 100644
index 0c8d32ae6..000000000
--- a/mi/mipushpxl.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mipushpxl.c,v 3.13 2003/07/16 01:38:57 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mipushpxl.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-#include "X.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "regionstr.h"
-#include "../mfb/maskbits.h"
-#include "mi.h"
-
-#define NPT 128
-
-/* miPushPixels -- squeegees the fill style of pGC through pBitMap
- * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
- * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
- * is set in the bitmap, the fill style is put onto the drawable using
- * the GC's logical function. The drawable is not changed where the bitmap
- * has a zero bit or outside the area covered by the stencil.
-
-WARNING:
- this code works if the 1-bit deep pixmap format returned by GetSpans
-is the same as the format defined by the mfb code (i.e. 32-bit padding
-per scanline, scanline unit = 32 bits; later, this might mean
-bitsizeof(int) padding and sacnline unit == bitsizeof(int).)
-
- */
-
-/*
- * in order to have both (MSB_FIRST and LSB_FIRST) versions of this
- * in the server, we need to rename one of them
- */
-void
-miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int dx, dy, xOrg, yOrg;
-{
- int h, dxDivPPW, ibEnd;
- MiBits *pwLineStart;
- register MiBits *pw, *pwEnd;
- register MiBits msk;
- register int ib, w;
- register int ipt; /* index into above arrays */
- Bool fInBox;
- DDXPointRec pt[NPT], ptThisLine;
- int width[NPT];
-#ifdef XFree86Server
- PixelType startmask;
- if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER)
- if (screenInfo.bitmapBitOrder == LSBFirst)
- startmask = (MiBits)(-1) ^
- LONG2CHARSSAMEORDER((MiBits)(-1) << 1);
- else
- startmask = (MiBits)(-1) ^
- LONG2CHARSSAMEORDER((MiBits)(-1) >> 1);
- else
- if (screenInfo.bitmapBitOrder == LSBFirst)
- startmask = (MiBits)(-1) ^
- LONG2CHARSDIFFORDER((MiBits)(-1) << 1);
- else
- startmask = (MiBits)(-1) ^
- LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
-#endif
-
- pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx));
- if (!pwLineStart)
- return;
- ipt = 0;
- dxDivPPW = dx/PPW;
-
- for(h = 0, ptThisLine.x = 0, ptThisLine.y = 0;
- h < dy;
- h++, ptThisLine.y++)
- {
-
- (*pBitMap->drawable.pScreen->GetSpans)((DrawablePtr)pBitMap, dx,
- &ptThisLine, &dx, 1, (char *)pwLineStart);
-
- pw = pwLineStart;
- /* Process all words which are fully in the pixmap */
-
- fInBox = FALSE;
- pwEnd = pwLineStart + dxDivPPW;
- while(pw < pwEnd)
- {
- w = *pw;
-#ifdef XFree86Server
- msk = startmask;
-#else
- msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
-#endif
- for(ib = 0; ib < PPW; ib++)
- {
- if(w & msk)
- {
- if(!fInBox)
- {
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- /* start new box */
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC,
- NPT, pt, width, TRUE);
- ipt = 0;
- }
- /* end box */
- fInBox = FALSE;
- }
- }
-#ifdef XFree86Server
- /* This is not quite right, but it'll do for now */
- if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER)
- if (screenInfo.bitmapBitOrder == LSBFirst)
- msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) << 1);
- else
- msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) >> 1);
- else
- if (screenInfo.bitmapBitOrder == LSBFirst)
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) << 1);
- else
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
-#else
- msk = SCRRIGHT(msk, 1);
-#endif
- }
- pw++;
- }
- ibEnd = dx & PIM;
- if(ibEnd)
- {
- /* Process final partial word on line */
- w = *pw;
-#ifdef XFree86Server
- msk = startmask;
-#else
- msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
-#endif
- for(ib = 0; ib < ibEnd; ib++)
- {
- if(w & msk)
- {
- if(!fInBox)
- {
- /* start new box */
- pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
- pt[ipt].y = h + yOrg;
- fInBox = TRUE;
- }
- }
- else
- {
- if(fInBox)
- {
- /* end box */
- width[ipt] = ((pw - pwLineStart) << PWSH) +
- ib + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable,
- pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- fInBox = FALSE;
- }
- }
-#ifdef XFree86Server
- /* This is not quite right, but it'll do for now */
- if (screenInfo.bitmapBitOrder == IMAGE_BYTE_ORDER)
- if (screenInfo.bitmapBitOrder == LSBFirst)
- msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) << 1);
- else
- msk = LONG2CHARSSAMEORDER(LONG2CHARSSAMEORDER(msk) >> 1);
- else
- if (screenInfo.bitmapBitOrder == LSBFirst)
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) << 1);
- else
- msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
-#else
- msk = SCRRIGHT(msk, 1);
-#endif
- }
- }
- /* If scanline ended with last bit set, end the box */
- if(fInBox)
- {
- width[ipt] = dx + xOrg - pt[ipt].x;
- if (++ipt >= NPT)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
- ipt = 0;
- }
- }
- }
- xfree(pwLineStart);
- /* Flush any remaining spans */
- if (ipt)
- {
- (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
- }
-}
diff --git a/mi/miregion.c b/mi/miregion.c
deleted file mode 100644
index ef666c321..000000000
--- a/mi/miregion.c
+++ /dev/null
@@ -1,2552 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miregion.c,v 1.10 2003/07/16 01:38:57 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1988, 1989 by
-Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: miregion.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-#include "regionstr.h"
-#include "Xprotostr.h"
-#include "gc.h"
-#include "mi.h"
-#include "mispans.h"
-
-#if defined (__GNUC__) && !defined (NO_INLINES)
-#define INLINE __inline
-#else
-#define INLINE
-#endif
-
-#undef assert
-#ifdef DEBUG
-#define assert(expr) {if (!(expr)) \
- FatalError("Assertion failed file %s, line %d: expr\n", \
- __FILE__, __LINE__); }
-#else
-#define assert(expr)
-#endif
-
-#define good(reg) assert(miValidRegion(reg))
-
-/*
- * The functions in this file implement the Region abstraction used extensively
- * throughout the X11 sample server. A Region is simply a set of disjoint
- * (non-overlapping) rectangles, plus an "extent" rectangle which is the
- * smallest single rectangle that contains all the non-overlapping rectangles.
- *
- * A Region is implemented as a "y-x-banded" array of rectangles. This array
- * imposes two degrees of order. First, all rectangles are sorted by top side
- * y coordinate first (y1), and then by left side x coordinate (x1).
- *
- * Furthermore, the rectangles are grouped into "bands". Each rectangle in a
- * band has the same top y coordinate (y1), and each has the same bottom y
- * coordinate (y2). Thus all rectangles in a band differ only in their left
- * and right side (x1 and x2). Bands are implicit in the array of rectangles:
- * there is no separate list of band start pointers.
- *
- * The y-x band representation does not minimize rectangles. In particular,
- * if a rectangle vertically crosses a band (the rectangle has scanlines in
- * the y1 to y2 area spanned by the band), then the rectangle may be broken
- * down into two or more smaller rectangles stacked one atop the other.
- *
- * ----------- -----------
- * | | | | band 0
- * | | -------- ----------- --------
- * | | | | in y-x banded | | | | band 1
- * | | | | form is | | | |
- * ----------- | | ----------- --------
- * | | | | band 2
- * -------- --------
- *
- * An added constraint on the rectangles is that they must cover as much
- * horizontal area as possible: no two rectangles within a band are allowed
- * to touch.
- *
- * Whenever possible, bands will be merged together to cover a greater vertical
- * distance (and thus reduce the number of rectangles). Two bands can be merged
- * only if the bottom of one touches the top of the other and they have
- * rectangles in the same places (of the same width, of course).
- *
- * Adam de Boor wrote most of the original region code. Joel McCormack
- * substantially modified or rewrote most of the core arithmetic routines,
- * and added miRegionValidate in order to support several speed improvements
- * to miValidateTree. Bob Scheifler changed the representation to be more
- * compact when empty or a single rectangle, and did a bunch of gratuitous
- * reformatting.
- */
-
-/* true iff two Boxes overlap */
-#define EXTENTCHECK(r1,r2) \
- (!( ((r1)->x2 <= (r2)->x1) || \
- ((r1)->x1 >= (r2)->x2) || \
- ((r1)->y2 <= (r2)->y1) || \
- ((r1)->y1 >= (r2)->y2) ) )
-
-/* true iff (x,y) is in Box */
-#define INBOX(r,x,y) \
- ( ((r)->x2 > x) && \
- ((r)->x1 <= x) && \
- ((r)->y2 > y) && \
- ((r)->y1 <= y) )
-
-/* true iff Box r1 contains Box r2 */
-#define SUBSUMES(r1,r2) \
- ( ((r1)->x1 <= (r2)->x1) && \
- ((r1)->x2 >= (r2)->x2) && \
- ((r1)->y1 <= (r2)->y1) && \
- ((r1)->y2 >= (r2)->y2) )
-
-#define xallocData(n) (RegDataPtr)xalloc(REGION_SZOF(n))
-#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
-
-#define RECTALLOC_BAIL(pReg,n,bail) \
-if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
- if (!miRectAlloc(pReg, n)) { goto bail; }
-
-#define RECTALLOC(pReg,n) \
-if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
- if (!miRectAlloc(pReg, n)) { return FALSE; }
-
-#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \
-{ \
- pNextRect->x1 = nx1; \
- pNextRect->y1 = ny1; \
- pNextRect->x2 = nx2; \
- pNextRect->y2 = ny2; \
- pNextRect++; \
-}
-
-#define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2) \
-{ \
- if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\
- { \
- if (!miRectAlloc(pReg, 1)) \
- return FALSE; \
- pNextRect = REGION_TOP(pReg); \
- } \
- ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \
- pReg->data->numRects++; \
- assert(pReg->data->numRects<=pReg->data->size); \
-}
-
-
-#define DOWNSIZE(reg,numRects) \
-if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
-{ \
- RegDataPtr NewData; \
- NewData = (RegDataPtr)xrealloc((reg)->data, REGION_SZOF(numRects)); \
- if (NewData) \
- { \
- NewData->size = (numRects); \
- (reg)->data = NewData; \
- } \
-}
-
-
-BoxRec miEmptyBox = {0, 0, 0, 0};
-RegDataRec miEmptyData = {0, 0};
-
-RegDataRec miBrokenData = {0, 0};
-RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
-
-#ifdef DEBUG
-int
-miPrintRegion(rgn)
- RegionPtr rgn;
-{
- int num, size;
- register int i;
- BoxPtr rects;
-
- num = REGION_NUM_RECTS(rgn);
- size = REGION_SIZE(rgn);
- rects = REGION_RECTS(rgn);
- ErrorF("num: %d size: %d\n", num, size);
- ErrorF("extents: %d %d %d %d\n",
- rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2);
- for (i = 0; i < num; i++)
- ErrorF("%d %d %d %d \n",
- rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
- ErrorF("\n");
- return(num);
-}
-#endif /* DEBUG */
-
-Bool
-miRegionEqual(reg1, reg2)
- RegionPtr reg1;
- RegionPtr reg2;
-{
- int i, num;
- BoxPtr rects1, rects2;
-
- if (reg1->extents.x1 != reg2->extents.x1) return FALSE;
- if (reg1->extents.x2 != reg2->extents.x2) return FALSE;
- if (reg1->extents.y1 != reg2->extents.y1) return FALSE;
- if (reg1->extents.y2 != reg2->extents.y2) return FALSE;
-
- num = REGION_NUM_RECTS(reg1);
- if (num != REGION_NUM_RECTS(reg2)) return FALSE;
-
- rects1 = REGION_RECTS(reg1);
- rects2 = REGION_RECTS(reg2);
- for (i = 0; i != num; i++) {
- if (rects1[i].x1 != rects2[i].x1) return FALSE;
- if (rects1[i].x2 != rects2[i].x2) return FALSE;
- if (rects1[i].y1 != rects2[i].y1) return FALSE;
- if (rects1[i].y2 != rects2[i].y2) return FALSE;
- }
- return TRUE;
-}
-
-#ifdef DEBUG
-Bool
-miValidRegion(reg)
- RegionPtr reg;
-{
- register int i, numRects;
-
- if ((reg->extents.x1 > reg->extents.x2) ||
- (reg->extents.y1 > reg->extents.y2))
- return FALSE;
- numRects = REGION_NUM_RECTS(reg);
- if (!numRects)
- return ((reg->extents.x1 == reg->extents.x2) &&
- (reg->extents.y1 == reg->extents.y2) &&
- (reg->data->size || (reg->data == &miEmptyData)));
- else if (numRects == 1)
- return (!reg->data);
- else
- {
- register BoxPtr pboxP, pboxN;
- BoxRec box;
-
- pboxP = REGION_RECTS(reg);
- box = *pboxP;
- box.y2 = pboxP[numRects-1].y2;
- pboxN = pboxP + 1;
- for (i = numRects; --i > 0; pboxP++, pboxN++)
- {
- if ((pboxN->x1 >= pboxN->x2) ||
- (pboxN->y1 >= pboxN->y2))
- return FALSE;
- if (pboxN->x1 < box.x1)
- box.x1 = pboxN->x1;
- if (pboxN->x2 > box.x2)
- box.x2 = pboxN->x2;
- if ((pboxN->y1 < pboxP->y1) ||
- ((pboxN->y1 == pboxP->y1) &&
- ((pboxN->x1 < pboxP->x2) || (pboxN->y2 != pboxP->y2))))
- return FALSE;
- }
- return ((box.x1 == reg->extents.x1) &&
- (box.x2 == reg->extents.x2) &&
- (box.y1 == reg->extents.y1) &&
- (box.y2 == reg->extents.y2));
- }
-}
-
-#endif /* DEBUG */
-
-
-/*****************************************************************
- * RegionCreate(rect, size)
- * This routine does a simple malloc to make a structure of
- * REGION of "size" number of rectangles.
- *****************************************************************/
-
-RegionPtr
-miRegionCreate(rect, size)
- BoxPtr rect;
- int size;
-{
- register RegionPtr pReg;
-
- pReg = (RegionPtr)xalloc(sizeof(RegionRec));
- if (!pReg)
- return &miBrokenRegion;
- if (rect)
- {
- pReg->extents = *rect;
- pReg->data = (RegDataPtr)NULL;
- }
- else
- {
- pReg->extents = miEmptyBox;
- if ((size > 1) && (pReg->data = xallocData(size)))
- {
- pReg->data->size = size;
- pReg->data->numRects = 0;
- }
- else
- pReg->data = &miEmptyData;
- }
- return(pReg);
-}
-
-/*****************************************************************
- * RegionInit(pReg, rect, size)
- * Outer region rect is statically allocated.
- *****************************************************************/
-
-void
-miRegionInit(pReg, rect, size)
- RegionPtr pReg;
- BoxPtr rect;
- int size;
-{
- if (rect)
- {
- pReg->extents = *rect;
- pReg->data = (RegDataPtr)NULL;
- }
- else
- {
- pReg->extents = miEmptyBox;
- if ((size > 1) && (pReg->data = xallocData(size)))
- {
- pReg->data->size = size;
- pReg->data->numRects = 0;
- }
- else
- pReg->data = &miEmptyData;
- }
-}
-
-void
-miRegionDestroy(pReg)
- RegionPtr pReg;
-{
- good(pReg);
- xfreeData(pReg);
- if (pReg != &miBrokenRegion)
- xfree(pReg);
-}
-
-void
-miRegionUninit(pReg)
- RegionPtr pReg;
-{
- good(pReg);
- xfreeData(pReg);
-}
-
-Bool
-miRegionBreak (pReg)
- RegionPtr pReg;
-{
- xfreeData (pReg);
- pReg->extents = miEmptyBox;
- pReg->data = &miBrokenData;
- return FALSE;
-}
-
-Bool
-miRectAlloc(
- register RegionPtr pRgn,
- int n)
-{
- RegDataPtr data;
-
- if (!pRgn->data)
- {
- n++;
- pRgn->data = xallocData(n);
- if (!pRgn->data)
- return miRegionBreak (pRgn);
- pRgn->data->numRects = 1;
- *REGION_BOXPTR(pRgn) = pRgn->extents;
- }
- else if (!pRgn->data->size)
- {
- pRgn->data = xallocData(n);
- if (!pRgn->data)
- return miRegionBreak (pRgn);
- pRgn->data->numRects = 0;
- }
- else
- {
- if (n == 1)
- {
- n = pRgn->data->numRects;
- if (n > 500) /* XXX pick numbers out of a hat */
- n = 250;
- }
- n += pRgn->data->numRects;
- data = (RegDataPtr)xrealloc(pRgn->data, REGION_SZOF(n));
- if (!data)
- return miRegionBreak (pRgn);
- pRgn->data = data;
- }
- pRgn->data->size = n;
- return TRUE;
-}
-
-Bool
-miRegionCopy(dst, src)
- register RegionPtr dst;
- register RegionPtr src;
-{
- good(dst);
- good(src);
- if (dst == src)
- return TRUE;
- dst->extents = src->extents;
- if (!src->data || !src->data->size)
- {
- xfreeData(dst);
- dst->data = src->data;
- return TRUE;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- xfreeData(dst);
- dst->data = xallocData(src->data->numRects);
- if (!dst->data)
- return miRegionBreak (dst);
- dst->data->size = src->data->numRects;
- }
- dst->data->numRects = src->data->numRects;
- memmove((char *)REGION_BOXPTR(dst),(char *)REGION_BOXPTR(src),
- dst->data->numRects * sizeof(BoxRec));
- return TRUE;
-}
-
-
-/*======================================================================
- * Generic Region Operator
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * miCoalesce --
- * Attempt to merge the boxes in the current band with those in the
- * previous one. We are guaranteed that the current band extends to
- * the end of the rects array. Used only by miRegionOp.
- *
- * Results:
- * The new index for the previous band.
- *
- * Side Effects:
- * If coalescing takes place:
- * - rectangles in the previous band will have their y2 fields
- * altered.
- * - pReg->data->numRects will be decreased.
- *
- *-----------------------------------------------------------------------
- */
-INLINE static int
-miCoalesce (
- register RegionPtr pReg, /* Region to coalesce */
- int prevStart, /* Index of start of previous band */
- int curStart) /* Index of start of current band */
-{
- register BoxPtr pPrevBox; /* Current box in previous band */
- register BoxPtr pCurBox; /* Current box in current band */
- register int numRects; /* Number rectangles in both bands */
- register int y2; /* Bottom of current band */
- /*
- * Figure out how many rectangles are in the band.
- */
- numRects = curStart - prevStart;
- assert(numRects == pReg->data->numRects - curStart);
-
- if (!numRects) return curStart;
-
- /*
- * The bands may only be coalesced if the bottom of the previous
- * matches the top scanline of the current.
- */
- pPrevBox = REGION_BOX(pReg, prevStart);
- pCurBox = REGION_BOX(pReg, curStart);
- if (pPrevBox->y2 != pCurBox->y1) return curStart;
-
- /*
- * Make sure the bands have boxes in the same places. This
- * assumes that boxes have been added in such a way that they
- * cover the most area possible. I.e. two boxes in a band must
- * have some horizontal space between them.
- */
- y2 = pCurBox->y2;
-
- do {
- if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) {
- return (curStart);
- }
- pPrevBox++;
- pCurBox++;
- numRects--;
- } while (numRects);
-
- /*
- * The bands may be merged, so set the bottom y of each box
- * in the previous band to the bottom y of the current band.
- */
- numRects = curStart - prevStart;
- pReg->data->numRects -= numRects;
- do {
- pPrevBox--;
- pPrevBox->y2 = y2;
- numRects--;
- } while (numRects);
- return prevStart;
-}
-
-
-/* Quicky macro to avoid trivial reject procedure calls to miCoalesce */
-
-#define Coalesce(newReg, prevBand, curBand) \
- if (curBand - prevBand == newReg->data->numRects - curBand) { \
- prevBand = miCoalesce(newReg, prevBand, curBand); \
- } else { \
- prevBand = curBand; \
- }
-
-/*-
- *-----------------------------------------------------------------------
- * miAppendNonO --
- * Handle a non-overlapping band for the union and subtract operations.
- * Just adds the (top/bottom-clipped) rectangles into the region.
- * Doesn't have to check for subsumption or anything.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * pReg->data->numRects is incremented and the rectangles overwritten
- * with the rectangles we're passed.
- *
- *-----------------------------------------------------------------------
- */
-
-INLINE static Bool
-miAppendNonO (
- register RegionPtr pReg,
- register BoxPtr r,
- BoxPtr rEnd,
- register int y1,
- register int y2)
-{
- register BoxPtr pNextRect;
- register int newRects;
-
- newRects = rEnd - r;
-
- assert(y1 < y2);
- assert(newRects != 0);
-
- /* Make sure we have enough space for all rectangles to be added */
- RECTALLOC(pReg, newRects);
- pNextRect = REGION_TOP(pReg);
- pReg->data->numRects += newRects;
- do {
- assert(r->x1 < r->x2);
- ADDRECT(pNextRect, r->x1, y1, r->x2, y2);
- r++;
- } while (r != rEnd);
-
- return TRUE;
-}
-
-#define FindBand(r, rBandEnd, rEnd, ry1) \
-{ \
- ry1 = r->y1; \
- rBandEnd = r+1; \
- while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) { \
- rBandEnd++; \
- } \
-}
-
-#define AppendRegions(newReg, r, rEnd) \
-{ \
- int newRects; \
- if ((newRects = rEnd - r)) { \
- RECTALLOC(newReg, newRects); \
- memmove((char *)REGION_TOP(newReg),(char *)r, \
- newRects * sizeof(BoxRec)); \
- newReg->data->numRects += newRects; \
- } \
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miRegionOp --
- * Apply an operation to two regions. Called by miUnion, miInverse,
- * miSubtract, miIntersect.... Both regions MUST have at least one
- * rectangle, and cannot be the same object.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * The new region is overwritten.
- * pOverlap set to TRUE if overlapFunc ever returns TRUE.
- *
- * Notes:
- * The idea behind this function is to view the two regions as sets.
- * Together they cover a rectangle of area that this function divides
- * into horizontal bands where points are covered only by one region
- * or by both. For the first case, the nonOverlapFunc is called with
- * each the band and the band's upper and lower extents. For the
- * second, the overlapFunc is called to process the entire band. It
- * is responsible for clipping the rectangles in the band, though
- * this function provides the boundaries.
- * At the end of each band, the new region is coalesced, if possible,
- * to reduce the number of rectangles in the region.
- *
- *-----------------------------------------------------------------------
- */
-
-typedef Bool (*OverlapProcPtr)(
- RegionPtr pReg,
- BoxPtr r1,
- BoxPtr r1End,
- BoxPtr r2,
- BoxPtr r2End,
- short y1,
- short y2,
- Bool *pOverlap);
-
-static Bool
-miRegionOp(
- RegionPtr newReg, /* Place to store result */
- RegionPtr reg1, /* First region in operation */
- RegionPtr reg2, /* 2d region in operation */
- OverlapProcPtr overlapFunc, /* Function to call for over-
- * lapping bands */
- Bool appendNon1, /* Append non-overlapping bands */
- /* in region 1 ? */
- Bool appendNon2, /* Append non-overlapping bands */
- /* in region 2 ? */
- Bool *pOverlap)
-{
- register BoxPtr r1; /* Pointer into first region */
- register BoxPtr r2; /* Pointer into 2d region */
- BoxPtr r1End; /* End of 1st region */
- BoxPtr r2End; /* End of 2d region */
- short ybot; /* Bottom of intersection */
- short ytop; /* Top of intersection */
- RegDataPtr oldData; /* Old data for newReg */
- int prevBand; /* Index of start of
- * previous band in newReg */
- int curBand; /* Index of start of current
- * band in newReg */
- register BoxPtr r1BandEnd; /* End of current band in r1 */
- register BoxPtr r2BandEnd; /* End of current band in r2 */
- short top; /* Top of non-overlapping band */
- short bot; /* Bottom of non-overlapping band*/
- register int r1y1; /* Temps for r1->y1 and r2->y1 */
- register int r2y1;
- int newSize;
- int numRects;
-
- /*
- * Break any region computed from a broken region
- */
- if (REGION_NAR (reg1) || REGION_NAR(reg2))
- return miRegionBreak (newReg);
-
- /*
- * Initialization:
- * set r1, r2, r1End and r2End appropriately, save the rectangles
- * of the destination region until the end in case it's one of
- * the two source regions, then mark the "new" region empty, allocating
- * another array of rectangles for it to use.
- */
-
- r1 = REGION_RECTS(reg1);
- newSize = REGION_NUM_RECTS(reg1);
- r1End = r1 + newSize;
- numRects = REGION_NUM_RECTS(reg2);
- r2 = REGION_RECTS(reg2);
- r2End = r2 + numRects;
- assert(r1 != r1End);
- assert(r2 != r2End);
-
- oldData = (RegDataPtr)NULL;
- if (((newReg == reg1) && (newSize > 1)) ||
- ((newReg == reg2) && (numRects > 1)))
- {
- oldData = newReg->data;
- newReg->data = &miEmptyData;
- }
- /* guess at new size */
- if (numRects > newSize)
- newSize = numRects;
- newSize <<= 1;
- if (!newReg->data)
- newReg->data = &miEmptyData;
- else if (newReg->data->size)
- newReg->data->numRects = 0;
- if (newSize > newReg->data->size)
- if (!miRectAlloc(newReg, newSize))
- return FALSE;
-
- /*
- * Initialize ybot.
- * In the upcoming loop, ybot and ytop serve different functions depending
- * on whether the band being handled is an overlapping or non-overlapping
- * band.
- * In the case of a non-overlapping band (only one of the regions
- * has points in the band), ybot is the bottom of the most recent
- * intersection and thus clips the top of the rectangles in that band.
- * ytop is the top of the next intersection between the two regions and
- * serves to clip the bottom of the rectangles in the current band.
- * For an overlapping band (where the two regions intersect), ytop clips
- * the top of the rectangles of both regions and ybot clips the bottoms.
- */
-
- ybot = min(r1->y1, r2->y1);
-
- /*
- * prevBand serves to mark the start of the previous band so rectangles
- * can be coalesced into larger rectangles. qv. miCoalesce, above.
- * In the beginning, there is no previous band, so prevBand == curBand
- * (curBand is set later on, of course, but the first band will always
- * start at index 0). prevBand and curBand must be indices because of
- * the possible expansion, and resultant moving, of the new region's
- * array of rectangles.
- */
- prevBand = 0;
-
- do {
- /*
- * This algorithm proceeds one source-band (as opposed to a
- * destination band, which is determined by where the two regions
- * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the
- * rectangle after the last one in the current band for their
- * respective regions.
- */
- assert(r1 != r1End);
- assert(r2 != r2End);
-
- FindBand(r1, r1BandEnd, r1End, r1y1);
- FindBand(r2, r2BandEnd, r2End, r2y1);
-
- /*
- * First handle the band that doesn't intersect, if any.
- *
- * Note that attention is restricted to one band in the
- * non-intersecting region at once, so if a region has n
- * bands between the current position and the next place it overlaps
- * the other, this entire loop will be passed through n times.
- */
- if (r1y1 < r2y1) {
- if (appendNon1) {
- top = max(r1y1, ybot);
- bot = min(r1->y2, r2y1);
- if (top != bot) {
- curBand = newReg->data->numRects;
- miAppendNonO(newReg, r1, r1BandEnd, top, bot);
- Coalesce(newReg, prevBand, curBand);
- }
- }
- ytop = r2y1;
- } else if (r2y1 < r1y1) {
- if (appendNon2) {
- top = max(r2y1, ybot);
- bot = min(r2->y2, r1y1);
- if (top != bot) {
- curBand = newReg->data->numRects;
- miAppendNonO(newReg, r2, r2BandEnd, top, bot);
- Coalesce(newReg, prevBand, curBand);
- }
- }
- ytop = r1y1;
- } else {
- ytop = r1y1;
- }
-
- /*
- * Now see if we've hit an intersecting band. The two bands only
- * intersect if ybot > ytop
- */
- ybot = min(r1->y2, r2->y2);
- if (ybot > ytop) {
- curBand = newReg->data->numRects;
- (* overlapFunc)(newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot,
- pOverlap);
- Coalesce(newReg, prevBand, curBand);
- }
-
- /*
- * If we've finished with a band (y2 == ybot) we skip forward
- * in the region to the next band.
- */
- if (r1->y2 == ybot) r1 = r1BandEnd;
- if (r2->y2 == ybot) r2 = r2BandEnd;
-
- } while (r1 != r1End && r2 != r2End);
-
- /*
- * Deal with whichever region (if any) still has rectangles left.
- *
- * We only need to worry about banding and coalescing for the very first
- * band left. After that, we can just group all remaining boxes,
- * regardless of how many bands, into one final append to the list.
- */
-
- if ((r1 != r1End) && appendNon1) {
- /* Do first nonOverlap1Func call, which may be able to coalesce */
- FindBand(r1, r1BandEnd, r1End, r1y1);
- curBand = newReg->data->numRects;
- miAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2);
- Coalesce(newReg, prevBand, curBand);
- /* Just append the rest of the boxes */
- AppendRegions(newReg, r1BandEnd, r1End);
-
- } else if ((r2 != r2End) && appendNon2) {
- /* Do first nonOverlap2Func call, which may be able to coalesce */
- FindBand(r2, r2BandEnd, r2End, r2y1);
- curBand = newReg->data->numRects;
- miAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2);
- Coalesce(newReg, prevBand, curBand);
- /* Append rest of boxes */
- AppendRegions(newReg, r2BandEnd, r2End);
- }
-
- if (oldData)
- xfree(oldData);
-
- if (!(numRects = newReg->data->numRects))
- {
- xfreeData(newReg);
- newReg->data = &miEmptyData;
- }
- else if (numRects == 1)
- {
- newReg->extents = *REGION_BOXPTR(newReg);
- xfreeData(newReg);
- newReg->data = (RegDataPtr)NULL;
- }
- else
- {
- DOWNSIZE(newReg, numRects);
- }
-
- return TRUE;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miSetExtents --
- * Reset the extents of a region to what they should be. Called by
- * miSubtract and miIntersect as they can't figure it out along the
- * way or do so easily, as miUnion can.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The region's 'extents' structure is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-void
-miSetExtents (pReg)
- register RegionPtr pReg;
-{
- register BoxPtr pBox, pBoxEnd;
-
- if (!pReg->data)
- return;
- if (!pReg->data->size)
- {
- pReg->extents.x2 = pReg->extents.x1;
- pReg->extents.y2 = pReg->extents.y1;
- return;
- }
-
- pBox = REGION_BOXPTR(pReg);
- pBoxEnd = REGION_END(pReg);
-
- /*
- * Since pBox is the first rectangle in the region, it must have the
- * smallest y1 and since pBoxEnd is the last rectangle in the region,
- * it must have the largest y2, because of banding. Initialize x1 and
- * x2 from pBox and pBoxEnd, resp., as good things to initialize them
- * to...
- */
- pReg->extents.x1 = pBox->x1;
- pReg->extents.y1 = pBox->y1;
- pReg->extents.x2 = pBoxEnd->x2;
- pReg->extents.y2 = pBoxEnd->y2;
-
- assert(pReg->extents.y1 < pReg->extents.y2);
- while (pBox <= pBoxEnd) {
- if (pBox->x1 < pReg->extents.x1)
- pReg->extents.x1 = pBox->x1;
- if (pBox->x2 > pReg->extents.x2)
- pReg->extents.x2 = pBox->x2;
- pBox++;
- };
-
- assert(pReg->extents.x1 < pReg->extents.x2);
-}
-
-/*======================================================================
- * Region Intersection
- *====================================================================*/
-/*-
- *-----------------------------------------------------------------------
- * miIntersectO --
- * Handle an overlapping band for miIntersect.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * Rectangles may be added to the region.
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Bool
-miIntersectO (
- register RegionPtr pReg,
- register BoxPtr r1,
- BoxPtr r1End,
- register BoxPtr r2,
- BoxPtr r2End,
- short y1,
- short y2,
- Bool *pOverlap)
-{
- register int x1;
- register int x2;
- register BoxPtr pNextRect;
-
- pNextRect = REGION_TOP(pReg);
-
- assert(y1 < y2);
- assert(r1 != r1End && r2 != r2End);
-
- do {
- x1 = max(r1->x1, r2->x1);
- x2 = min(r1->x2, r2->x2);
-
- /*
- * If there's any overlap between the two rectangles, add that
- * overlap to the new region.
- */
- if (x1 < x2)
- NEWRECT(pReg, pNextRect, x1, y1, x2, y2);
-
- /*
- * Advance the pointer(s) with the leftmost right side, since the next
- * rectangle on that list may still overlap the other region's
- * current rectangle.
- */
- if (r1->x2 == x2) {
- r1++;
- }
- if (r2->x2 == x2) {
- r2++;
- }
- } while ((r1 != r1End) && (r2 != r2End));
-
- return TRUE;
-}
-
-
-Bool
-miIntersect(newReg, reg1, reg2)
- register RegionPtr newReg; /* destination Region */
- register RegionPtr reg1;
- register RegionPtr reg2; /* source regions */
-{
- good(reg1);
- good(reg2);
- good(newReg);
- /* check for trivial reject */
- if (REGION_NIL(reg1) || REGION_NIL(reg2) ||
- !EXTENTCHECK(&reg1->extents, &reg2->extents))
- {
- /* Covers about 20% of all cases */
- xfreeData(newReg);
- newReg->extents.x2 = newReg->extents.x1;
- newReg->extents.y2 = newReg->extents.y1;
- if (REGION_NAR(reg1) || REGION_NAR(reg2))
- {
- newReg->data = &miBrokenData;
- return FALSE;
- }
- else
- newReg->data = &miEmptyData;
- }
- else if (!reg1->data && !reg2->data)
- {
- /* Covers about 80% of cases that aren't trivially rejected */
- newReg->extents.x1 = max(reg1->extents.x1, reg2->extents.x1);
- newReg->extents.y1 = max(reg1->extents.y1, reg2->extents.y1);
- newReg->extents.x2 = min(reg1->extents.x2, reg2->extents.x2);
- newReg->extents.y2 = min(reg1->extents.y2, reg2->extents.y2);
- xfreeData(newReg);
- newReg->data = (RegDataPtr)NULL;
- }
- else if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
- {
- return miRegionCopy(newReg, reg1);
- }
- else if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
- {
- return miRegionCopy(newReg, reg2);
- }
- else if (reg1 == reg2)
- {
- return miRegionCopy(newReg, reg1);
- }
- else
- {
- /* General purpose intersection */
- Bool overlap; /* result ignored */
- if (!miRegionOp(newReg, reg1, reg2, miIntersectO, FALSE, FALSE,
- &overlap))
- return FALSE;
- miSetExtents(newReg);
- }
-
- good(newReg);
- return(TRUE);
-}
-
-#define MERGERECT(r) \
-{ \
- if (r->x1 <= x2) { \
- /* Merge with current rectangle */ \
- if (r->x1 < x2) *pOverlap = TRUE; \
- if (x2 < r->x2) x2 = r->x2; \
- } else { \
- /* Add current rectangle, start new one */ \
- NEWRECT(pReg, pNextRect, x1, y1, x2, y2); \
- x1 = r->x1; \
- x2 = r->x2; \
- } \
- r++; \
-}
-
-/*======================================================================
- * Region Union
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * miUnionO --
- * Handle an overlapping band for the union operation. Picks the
- * left-most rectangle each time and merges it into the region.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * pReg is overwritten.
- * pOverlap is set to TRUE if any boxes overlap.
- *
- *-----------------------------------------------------------------------
- */
-static Bool
-miUnionO (
- register RegionPtr pReg,
- register BoxPtr r1,
- BoxPtr r1End,
- register BoxPtr r2,
- BoxPtr r2End,
- short y1,
- short y2,
- Bool *pOverlap)
-{
- register BoxPtr pNextRect;
- register int x1; /* left and right side of current union */
- register int x2;
-
- assert (y1 < y2);
- assert(r1 != r1End && r2 != r2End);
-
- pNextRect = REGION_TOP(pReg);
-
- /* Start off current rectangle */
- if (r1->x1 < r2->x1)
- {
- x1 = r1->x1;
- x2 = r1->x2;
- r1++;
- }
- else
- {
- x1 = r2->x1;
- x2 = r2->x2;
- r2++;
- }
- while (r1 != r1End && r2 != r2End)
- {
- if (r1->x1 < r2->x1) MERGERECT(r1) else MERGERECT(r2);
- }
-
- /* Finish off whoever (if any) is left */
- if (r1 != r1End)
- {
- do
- {
- MERGERECT(r1);
- } while (r1 != r1End);
- }
- else if (r2 != r2End)
- {
- do
- {
- MERGERECT(r2);
- } while (r2 != r2End);
- }
-
- /* Add current rectangle */
- NEWRECT(pReg, pNextRect, x1, y1, x2, y2);
-
- return TRUE;
-}
-
-Bool
-miUnion(newReg, reg1, reg2)
- RegionPtr newReg; /* destination Region */
- register RegionPtr reg1;
- register RegionPtr reg2; /* source regions */
-{
- Bool overlap; /* result ignored */
-
- /* Return TRUE if some overlap between reg1, reg2 */
- good(reg1);
- good(reg2);
- good(newReg);
- /* checks all the simple cases */
-
- /*
- * Region 1 and 2 are the same
- */
- if (reg1 == reg2)
- {
- return miRegionCopy(newReg, reg1);
- }
-
- /*
- * Region 1 is empty
- */
- if (REGION_NIL(reg1))
- {
- if (REGION_NAR(reg1))
- return miRegionBreak (newReg);
- if (newReg != reg2)
- return miRegionCopy(newReg, reg2);
- return TRUE;
- }
-
- /*
- * Region 2 is empty
- */
- if (REGION_NIL(reg2))
- {
- if (REGION_NAR(reg2))
- return miRegionBreak (newReg);
- if (newReg != reg1)
- return miRegionCopy(newReg, reg1);
- return TRUE;
- }
-
- /*
- * Region 1 completely subsumes region 2
- */
- if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
- {
- if (newReg != reg1)
- return miRegionCopy(newReg, reg1);
- return TRUE;
- }
-
- /*
- * Region 2 completely subsumes region 1
- */
- if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
- {
- if (newReg != reg2)
- return miRegionCopy(newReg, reg2);
- return TRUE;
- }
-
- if (!miRegionOp(newReg, reg1, reg2, miUnionO, TRUE, TRUE, &overlap))
- return FALSE;
-
- newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1);
- newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1);
- newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2);
- newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2);
- good(newReg);
- return TRUE;
-}
-
-
-/*======================================================================
- * Batch Rectangle Union
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * miRegionAppend --
- *
- * "Append" the rgn rectangles onto the end of dstrgn, maintaining
- * knowledge of YX-banding when it's easy. Otherwise, dstrgn just
- * becomes a non-y-x-banded random collection of rectangles, and not
- * yet a true region. After a sequence of appends, the caller must
- * call miRegionValidate to ensure that a valid region is constructed.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * dstrgn is modified if rgn has rectangles.
- *
- */
-Bool
-miRegionAppend(dstrgn, rgn)
- register RegionPtr dstrgn;
- register RegionPtr rgn;
-{
- int numRects, dnumRects, size;
- BoxPtr new, old;
- Bool prepend;
-
- if (REGION_NAR(rgn))
- return miRegionBreak (dstrgn);
-
- if (!rgn->data && (dstrgn->data == &miEmptyData))
- {
- dstrgn->extents = rgn->extents;
- dstrgn->data = (RegDataPtr)NULL;
- return TRUE;
- }
-
- numRects = REGION_NUM_RECTS(rgn);
- if (!numRects)
- return TRUE;
- prepend = FALSE;
- size = numRects;
- dnumRects = REGION_NUM_RECTS(dstrgn);
- if (!dnumRects && (size < 200))
- size = 200; /* XXX pick numbers out of a hat */
- RECTALLOC(dstrgn, size);
- old = REGION_RECTS(rgn);
- if (!dnumRects)
- dstrgn->extents = rgn->extents;
- else if (dstrgn->extents.x2 > dstrgn->extents.x1)
- {
- register BoxPtr first, last;
-
- first = old;
- last = REGION_BOXPTR(dstrgn) + (dnumRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y2 = rgn->extents.y2;
- }
- else
- {
- first = REGION_BOXPTR(dstrgn);
- last = old + (numRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- prepend = TRUE;
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y1 = rgn->extents.y1;
- }
- else
- dstrgn->extents.x2 = dstrgn->extents.x1;
- }
- }
- if (prepend)
- {
- new = REGION_BOX(dstrgn, numRects);
- if (dnumRects == 1)
- *new = *REGION_BOXPTR(dstrgn);
- else
- memmove((char *)new,(char *)REGION_BOXPTR(dstrgn),
- dnumRects * sizeof(BoxRec));
- new = REGION_BOXPTR(dstrgn);
- }
- else
- new = REGION_BOXPTR(dstrgn) + dnumRects;
- if (numRects == 1)
- *new = *old;
- else
- memmove((char *)new, (char *)old, numRects * sizeof(BoxRec));
- dstrgn->data->numRects += numRects;
- return TRUE;
-}
-
-
-#define ExchangeRects(a, b) \
-{ \
- BoxRec t; \
- t = rects[a]; \
- rects[a] = rects[b]; \
- rects[b] = t; \
-}
-
-static void
-QuickSortRects(
- register BoxRec rects[],
- register int numRects)
-{
- register int y1;
- register int x1;
- register int i, j;
- register BoxPtr r;
-
- /* Always called with numRects > 1 */
-
- do
- {
- if (numRects == 2)
- {
- if (rects[0].y1 > rects[1].y1 ||
- (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1))
- ExchangeRects(0, 1);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- ExchangeRects(0, numRects >> 1);
- y1 = rects[0].y1;
- x1 = rects[0].x1;
-
- /* Partition array */
- i = 0;
- j = numRects;
- do
- {
- r = &(rects[i]);
- do
- {
- r++;
- i++;
- } while (i != numRects &&
- (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1)));
- r = &(rects[j]);
- do
- {
- r--;
- j--;
- } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1));
- if (i < j)
- ExchangeRects(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeRects(0, j);
-
- /* Recurse */
- if (numRects-j-1 > 1)
- QuickSortRects(&rects[j+1], numRects-j-1);
- numRects = j;
- } while (numRects > 1);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miRegionValidate --
- *
- * Take a ``region'' which is a non-y-x-banded random collection of
- * rectangles, and compute a nice region which is the union of all the
- * rectangles.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * The passed-in ``region'' may be modified.
- * pOverlap set to TRUE if any retangles overlapped, else FALSE;
- *
- * Strategy:
- * Step 1. Sort the rectangles into ascending order with primary key y1
- * and secondary key x1.
- *
- * Step 2. Split the rectangles into the minimum number of proper y-x
- * banded regions. This may require horizontally merging
- * rectangles, and vertically coalescing bands. With any luck,
- * this step in an identity tranformation (ala the Box widget),
- * or a coalescing into 1 box (ala Menus).
- *
- * Step 3. Merge the separate regions down to a single region by calling
- * miUnion. Maximize the work each miUnion call does by using
- * a binary merge.
- *
- *-----------------------------------------------------------------------
- */
-
-Bool
-miRegionValidate(badreg, pOverlap)
- RegionPtr badreg;
- Bool *pOverlap;
-{
- /* Descriptor for regions under construction in Step 2. */
- typedef struct {
- RegionRec reg;
- int prevBand;
- int curBand;
- } RegionInfo;
-
- int numRects; /* Original numRects for badreg */
- RegionInfo *ri; /* Array of current regions */
- int numRI; /* Number of entries used in ri */
- int sizeRI; /* Number of entries available in ri */
- int i; /* Index into rects */
- register int j; /* Index into ri */
- register RegionInfo *rit; /* &ri[j] */
- register RegionPtr reg; /* ri[j].reg */
- register BoxPtr box; /* Current box in rects */
- register BoxPtr riBox; /* Last box in ri[j].reg */
- register RegionPtr hreg; /* ri[j_half].reg */
- Bool ret = TRUE;
-
- *pOverlap = FALSE;
- if (!badreg->data)
- {
- good(badreg);
- return TRUE;
- }
- numRects = badreg->data->numRects;
- if (!numRects)
- {
- if (REGION_NAR(badreg))
- return FALSE;
- good(badreg);
- return TRUE;
- }
- if (badreg->extents.x1 < badreg->extents.x2)
- {
- if ((numRects) == 1)
- {
- xfreeData(badreg);
- badreg->data = (RegDataPtr) NULL;
- }
- else
- {
- DOWNSIZE(badreg, numRects);
- }
- good(badreg);
- return TRUE;
- }
-
- /* Step 1: Sort the rects array into ascending (y1, x1) order */
- QuickSortRects(REGION_BOXPTR(badreg), numRects);
-
- /* Step 2: Scatter the sorted array into the minimum number of regions */
-
- /* Set up the first region to be the first rectangle in badreg */
- /* Note that step 2 code will never overflow the ri[0].reg rects array */
- ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo));
- if (!ri)
- return miRegionBreak (badreg);
- sizeRI = 4;
- numRI = 1;
- ri[0].prevBand = 0;
- ri[0].curBand = 0;
- ri[0].reg = *badreg;
- box = REGION_BOXPTR(&ri[0].reg);
- ri[0].reg.extents = *box;
- ri[0].reg.data->numRects = 1;
-
- /* Now scatter rectangles into the minimum set of valid regions. If the
- next rectangle to be added to a region would force an existing rectangle
- in the region to be split up in order to maintain y-x banding, just
- forget it. Try the next region. If it doesn't fit cleanly into any
- region, make a new one. */
-
- for (i = numRects; --i > 0;)
- {
- box++;
- /* Look for a region to append box to */
- for (j = numRI, rit = ri; --j >= 0; rit++)
- {
- reg = &rit->reg;
- riBox = REGION_END(reg);
-
- if (box->y1 == riBox->y1 && box->y2 == riBox->y2)
- {
- /* box is in same band as riBox. Merge or append it */
- if (box->x1 <= riBox->x2)
- {
- /* Merge it with riBox */
- if (box->x1 < riBox->x2) *pOverlap = TRUE;
- if (box->x2 > riBox->x2) riBox->x2 = box->x2;
- }
- else
- {
- RECTALLOC_BAIL(reg, 1, bail);
- *REGION_TOP(reg) = *box;
- reg->data->numRects++;
- }
- goto NextRect; /* So sue me */
- }
- else if (box->y1 >= riBox->y2)
- {
- /* Put box into new band */
- if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
- if (reg->extents.x1 > box->x1) reg->extents.x1 = box->x1;
- Coalesce(reg, rit->prevBand, rit->curBand);
- rit->curBand = reg->data->numRects;
- RECTALLOC_BAIL(reg, 1, bail);
- *REGION_TOP(reg) = *box;
- reg->data->numRects++;
- goto NextRect;
- }
- /* Well, this region was inappropriate. Try the next one. */
- } /* for j */
-
- /* Uh-oh. No regions were appropriate. Create a new one. */
- if (sizeRI == numRI)
- {
- /* Oops, allocate space for new region information */
- sizeRI <<= 1;
- rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo));
- if (!rit)
- goto bail;
- ri = rit;
- rit = &ri[numRI];
- }
- numRI++;
- rit->prevBand = 0;
- rit->curBand = 0;
- rit->reg.extents = *box;
- rit->reg.data = (RegDataPtr)NULL;
- if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
- goto bail;
-NextRect: ;
- } /* for i */
-
- /* Make a final pass over each region in order to Coalesce and set
- extents.x2 and extents.y2 */
-
- for (j = numRI, rit = ri; --j >= 0; rit++)
- {
- reg = &rit->reg;
- riBox = REGION_END(reg);
- reg->extents.y2 = riBox->y2;
- if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
- Coalesce(reg, rit->prevBand, rit->curBand);
- if (reg->data->numRects == 1) /* keep unions happy below */
- {
- xfreeData(reg);
- reg->data = (RegDataPtr)NULL;
- }
- }
-
- /* Step 3: Union all regions into a single region */
- while (numRI > 1)
- {
- int half = numRI/2;
- for (j = numRI & 1; j < (half + (numRI & 1)); j++)
- {
- reg = &ri[j].reg;
- hreg = &ri[j+half].reg;
- if (!miRegionOp(reg, reg, hreg, miUnionO, TRUE, TRUE, pOverlap))
- ret = FALSE;
- if (hreg->extents.x1 < reg->extents.x1)
- reg->extents.x1 = hreg->extents.x1;
- if (hreg->extents.y1 < reg->extents.y1)
- reg->extents.y1 = hreg->extents.y1;
- if (hreg->extents.x2 > reg->extents.x2)
- reg->extents.x2 = hreg->extents.x2;
- if (hreg->extents.y2 > reg->extents.y2)
- reg->extents.y2 = hreg->extents.y2;
- xfreeData(hreg);
- }
- numRI -= half;
- }
- *badreg = ri[0].reg;
- xfree(ri);
- good(badreg);
- return ret;
-bail:
- for (i = 0; i < numRI; i++)
- xfreeData(&ri[i].reg);
- xfree (ri);
- return miRegionBreak (badreg);
-}
-
-RegionPtr
-miRectsToRegion(nrects, prect, ctype)
- int nrects;
- register xRectangle *prect;
- int ctype;
-{
- register RegionPtr pRgn;
- register RegDataPtr pData;
- register BoxPtr pBox;
- register int i;
- int x1, y1, x2, y2;
-
- pRgn = miRegionCreate(NullBox, 0);
- if (REGION_NAR (pRgn))
- return pRgn;
- if (!nrects)
- return pRgn;
- if (nrects == 1)
- {
- x1 = prect->x;
- y1 = prect->y;
- if ((x2 = x1 + (int) prect->width) > MAXSHORT)
- x2 = MAXSHORT;
- if ((y2 = y1 + (int) prect->height) > MAXSHORT)
- y2 = MAXSHORT;
- if (x1 != x2 && y1 != y2)
- {
- pRgn->extents.x1 = x1;
- pRgn->extents.y1 = y1;
- pRgn->extents.x2 = x2;
- pRgn->extents.y2 = y2;
- pRgn->data = (RegDataPtr)NULL;
- }
- return pRgn;
- }
- pData = xallocData(nrects);
- if (!pData)
- {
- miRegionBreak (pRgn);
- return pRgn;
- }
- pBox = (BoxPtr) (pData + 1);
- for (i = nrects; --i >= 0; prect++)
- {
- x1 = prect->x;
- y1 = prect->y;
- if ((x2 = x1 + (int) prect->width) > MAXSHORT)
- x2 = MAXSHORT;
- if ((y2 = y1 + (int) prect->height) > MAXSHORT)
- y2 = MAXSHORT;
- if (x1 != x2 && y1 != y2)
- {
- pBox->x1 = x1;
- pBox->y1 = y1;
- pBox->x2 = x2;
- pBox->y2 = y2;
- pBox++;
- }
- }
- if (pBox != (BoxPtr) (pData + 1))
- {
- pData->size = nrects;
- pData->numRects = pBox - (BoxPtr) (pData + 1);
- pRgn->data = pData;
- if (ctype != CT_YXBANDED)
- {
- Bool overlap; /* result ignored */
- pRgn->extents.x1 = pRgn->extents.x2 = 0;
- miRegionValidate(pRgn, &overlap);
- }
- else
- miSetExtents(pRgn);
- good(pRgn);
- }
- else
- {
- xfree (pData);
- }
- return pRgn;
-}
-
-/*======================================================================
- * Region Subtraction
- *====================================================================*/
-
-
-/*-
- *-----------------------------------------------------------------------
- * miSubtractO --
- * Overlapping band subtraction. x1 is the left-most point not yet
- * checked.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * pReg may have rectangles added to it.
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Bool
-miSubtractO (
- register RegionPtr pReg,
- register BoxPtr r1,
- BoxPtr r1End,
- register BoxPtr r2,
- BoxPtr r2End,
- register short y1,
- short y2,
- Bool *pOverlap)
-{
- register BoxPtr pNextRect;
- register int x1;
-
- x1 = r1->x1;
-
- assert(y1<y2);
- assert(r1 != r1End && r2 != r2End);
-
- pNextRect = REGION_TOP(pReg);
-
- do
- {
- if (r2->x2 <= x1)
- {
- /*
- * Subtrahend entirely to left of minuend: go to next subtrahend.
- */
- r2++;
- }
- else if (r2->x1 <= x1)
- {
- /*
- * Subtrahend preceeds minuend: nuke left edge of minuend.
- */
- x1 = r2->x2;
- if (x1 >= r1->x2)
- {
- /*
- * Minuend completely covered: advance to next minuend and
- * reset left fence to edge of new minuend.
- */
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- else
- {
- /*
- * Subtrahend now used up since it doesn't extend beyond
- * minuend
- */
- r2++;
- }
- }
- else if (r2->x1 < r1->x2)
- {
- /*
- * Left part of subtrahend covers part of minuend: add uncovered
- * part of minuend to region and skip to next subtrahend.
- */
- assert(x1<r2->x1);
- NEWRECT(pReg, pNextRect, x1, y1, r2->x1, y2);
-
- x1 = r2->x2;
- if (x1 >= r1->x2)
- {
- /*
- * Minuend used up: advance to new...
- */
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- else
- {
- /*
- * Subtrahend used up
- */
- r2++;
- }
- }
- else
- {
- /*
- * Minuend used up: add any remaining piece before advancing.
- */
- if (r1->x2 > x1)
- NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2);
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- } while ((r1 != r1End) && (r2 != r2End));
-
-
- /*
- * Add remaining minuend rectangles to region.
- */
- while (r1 != r1End)
- {
- assert(x1<r1->x2);
- NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2);
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- return TRUE;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miSubtract --
- * Subtract regS from regM and leave the result in regD.
- * S stands for subtrahend, M for minuend and D for difference.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * regD is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-Bool
-miSubtract(regD, regM, regS)
- register RegionPtr regD;
- register RegionPtr regM;
- register RegionPtr regS;
-{
- Bool overlap; /* result ignored */
-
- good(regM);
- good(regS);
- good(regD);
- /* check for trivial rejects */
- if (REGION_NIL(regM) || REGION_NIL(regS) ||
- !EXTENTCHECK(&regM->extents, &regS->extents))
- {
- if (REGION_NAR (regS))
- return miRegionBreak (regD);
- return miRegionCopy(regD, regM);
- }
- else if (regM == regS)
- {
- xfreeData(regD);
- regD->extents.x2 = regD->extents.x1;
- regD->extents.y2 = regD->extents.y1;
- regD->data = &miEmptyData;
- return TRUE;
- }
-
- /* Add those rectangles in region 1 that aren't in region 2,
- do yucky substraction for overlaps, and
- just throw away rectangles in region 2 that aren't in region 1 */
- if (!miRegionOp(regD, regM, regS, miSubtractO, TRUE, FALSE, &overlap))
- return FALSE;
-
- /*
- * Can't alter RegD's extents before we call miRegionOp because
- * it might be one of the source regions and miRegionOp depends
- * on the extents of those regions being unaltered. Besides, this
- * way there's no checking against rectangles that will be nuked
- * due to coalescing, so we have to examine fewer rectangles.
- */
- miSetExtents(regD);
- good(regD);
- return TRUE;
-}
-
-/*======================================================================
- * Region Inversion
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * miInverse --
- * Take a region and a box and return a region that is everything
- * in the box but not in the region. The careful reader will note
- * that this is the same as subtracting the region from the box...
- *
- * Results:
- * TRUE.
- *
- * Side Effects:
- * newReg is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-Bool
-miInverse(newReg, reg1, invRect)
- RegionPtr newReg; /* Destination region */
- RegionPtr reg1; /* Region to invert */
- BoxPtr invRect; /* Bounding box for inversion */
-{
- RegionRec invReg; /* Quick and dirty region made from the
- * bounding box */
- Bool overlap; /* result ignored */
-
- good(reg1);
- good(newReg);
- /* check for trivial rejects */
- if (REGION_NIL(reg1) || !EXTENTCHECK(invRect, &reg1->extents))
- {
- if (REGION_NAR(reg1))
- return miRegionBreak (newReg);
- newReg->extents = *invRect;
- xfreeData(newReg);
- newReg->data = (RegDataPtr)NULL;
- return TRUE;
- }
-
- /* Add those rectangles in region 1 that aren't in region 2,
- do yucky substraction for overlaps, and
- just throw away rectangles in region 2 that aren't in region 1 */
- invReg.extents = *invRect;
- invReg.data = (RegDataPtr)NULL;
- if (!miRegionOp(newReg, &invReg, reg1, miSubtractO, TRUE, FALSE, &overlap))
- return FALSE;
-
- /*
- * Can't alter newReg's extents before we call miRegionOp because
- * it might be one of the source regions and miRegionOp depends
- * on the extents of those regions being unaltered. Besides, this
- * way there's no checking against rectangles that will be nuked
- * due to coalescing, so we have to examine fewer rectangles.
- */
- miSetExtents(newReg);
- good(newReg);
- return TRUE;
-}
-
-/*
- * RectIn(region, rect)
- * This routine takes a pointer to a region and a pointer to a box
- * and determines if the box is outside/inside/partly inside the region.
- *
- * The idea is to travel through the list of rectangles trying to cover the
- * passed box with them. Anytime a piece of the rectangle isn't covered
- * by a band of rectangles, partOut is set TRUE. Any time a rectangle in
- * the region covers part of the box, partIn is set TRUE. The process ends
- * when either the box has been completely covered (we reached a band that
- * doesn't overlap the box, partIn is TRUE and partOut is false), the
- * box has been partially covered (partIn == partOut == TRUE -- because of
- * the banding, the first time this is true we know the box is only
- * partially in the region) or is outside the region (we reached a band
- * that doesn't overlap the box at all and partIn is false)
- */
-
-int
-miRectIn(region, prect)
- register RegionPtr region;
- register BoxPtr prect;
-{
- register int x;
- register int y;
- register BoxPtr pbox;
- register BoxPtr pboxEnd;
- int partIn, partOut;
- int numRects;
-
- good(region);
- numRects = REGION_NUM_RECTS(region);
- /* useful optimization */
- if (!numRects || !EXTENTCHECK(&region->extents, prect))
- return(rgnOUT);
-
- if (numRects == 1)
- {
- /* We know that it must be rgnIN or rgnPART */
- if (SUBSUMES(&region->extents, prect))
- return(rgnIN);
- else
- return(rgnPART);
- }
-
- partOut = FALSE;
- partIn = FALSE;
-
- /* (x,y) starts at upper left of rect, moving to the right and down */
- x = prect->x1;
- y = prect->y1;
-
- /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */
- for (pbox = REGION_BOXPTR(region), pboxEnd = pbox + numRects;
- pbox != pboxEnd;
- pbox++)
- {
-
- if (pbox->y2 <= y)
- continue; /* getting up to speed or skipping remainder of band */
-
- if (pbox->y1 > y)
- {
- partOut = TRUE; /* missed part of rectangle above */
- if (partIn || (pbox->y1 >= prect->y2))
- break;
- y = pbox->y1; /* x guaranteed to be == prect->x1 */
- }
-
- if (pbox->x2 <= x)
- continue; /* not far enough over yet */
-
- if (pbox->x1 > x)
- {
- partOut = TRUE; /* missed part of rectangle to left */
- if (partIn)
- break;
- }
-
- if (pbox->x1 < prect->x2)
- {
- partIn = TRUE; /* definitely overlap */
- if (partOut)
- break;
- }
-
- if (pbox->x2 >= prect->x2)
- {
- y = pbox->y2; /* finished with this band */
- if (y >= prect->y2)
- break;
- x = prect->x1; /* reset x out to left again */
- }
- else
- {
- /*
- * Because boxes in a band are maximal width, if the first box
- * to overlap the rectangle doesn't completely cover it in that
- * band, the rectangle must be partially out, since some of it
- * will be uncovered in that band. partIn will have been set true
- * by now...
- */
- partOut = TRUE;
- break;
- }
- }
-
- return(partIn ? ((y < prect->y2) ? rgnPART : rgnIN) : rgnOUT);
-}
-
-/* TranslateRegion(pReg, x, y)
- translates in place
-*/
-
-void
-miTranslateRegion(pReg, x, y)
- register RegionPtr pReg;
- register int x;
- register int y;
-{
- int x1, x2, y1, y2;
- register int nbox;
- register BoxPtr pbox;
-
- good(pReg);
- pReg->extents.x1 = x1 = pReg->extents.x1 + x;
- pReg->extents.y1 = y1 = pReg->extents.y1 + y;
- pReg->extents.x2 = x2 = pReg->extents.x2 + x;
- pReg->extents.y2 = y2 = pReg->extents.y2 + y;
- if (((x1 - MINSHORT)|(y1 - MINSHORT)|(MAXSHORT - x2)|(MAXSHORT - y2)) >= 0)
- {
- if (pReg->data && (nbox = pReg->data->numRects))
- {
- for (pbox = REGION_BOXPTR(pReg); nbox--; pbox++)
- {
- pbox->x1 += x;
- pbox->y1 += y;
- pbox->x2 += x;
- pbox->y2 += y;
- }
- }
- return;
- }
- if (((x2 - MINSHORT)|(y2 - MINSHORT)|(MAXSHORT - x1)|(MAXSHORT - y1)) <= 0)
- {
- pReg->extents.x2 = pReg->extents.x1;
- pReg->extents.y2 = pReg->extents.y1;
- xfreeData(pReg);
- pReg->data = &miEmptyData;
- return;
- }
- if (x1 < MINSHORT)
- pReg->extents.x1 = MINSHORT;
- else if (x2 > MAXSHORT)
- pReg->extents.x2 = MAXSHORT;
- if (y1 < MINSHORT)
- pReg->extents.y1 = MINSHORT;
- else if (y2 > MAXSHORT)
- pReg->extents.y2 = MAXSHORT;
- if (pReg->data && (nbox = pReg->data->numRects))
- {
- register BoxPtr pboxout;
-
- for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++)
- {
- pboxout->x1 = x1 = pbox->x1 + x;
- pboxout->y1 = y1 = pbox->y1 + y;
- pboxout->x2 = x2 = pbox->x2 + x;
- pboxout->y2 = y2 = pbox->y2 + y;
- if (((x2 - MINSHORT)|(y2 - MINSHORT)|
- (MAXSHORT - x1)|(MAXSHORT - y1)) <= 0)
- {
- pReg->data->numRects--;
- continue;
- }
- if (x1 < MINSHORT)
- pboxout->x1 = MINSHORT;
- else if (x2 > MAXSHORT)
- pboxout->x2 = MAXSHORT;
- if (y1 < MINSHORT)
- pboxout->y1 = MINSHORT;
- else if (y2 > MAXSHORT)
- pboxout->y2 = MAXSHORT;
- pboxout++;
- }
- if (pboxout != pbox)
- {
- if (pReg->data->numRects == 1)
- {
- pReg->extents = *REGION_BOXPTR(pReg);
- xfreeData(pReg);
- pReg->data = (RegDataPtr)NULL;
- }
- else
- miSetExtents(pReg);
- }
- }
-}
-
-Bool
-miRegionDataCopy(
- register RegionPtr dst,
- register RegionPtr src)
-{
- good(dst);
- good(src);
- if (dst->data)
- return TRUE;
- if (dst == src)
- return TRUE;
- if (!src->data || !src->data->size)
- {
- xfreeData(dst);
- dst->data = (RegDataPtr)NULL;
- return TRUE;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- xfreeData(dst);
- dst->data = xallocData(src->data->numRects);
- if (!dst->data)
- return miRegionBreak (dst);
- }
- dst->data->size = src->data->size;
- dst->data->numRects = src->data->numRects;
- return TRUE;
-}
-
-void
-miRegionReset(pReg, pBox)
- RegionPtr pReg;
- BoxPtr pBox;
-{
- good(pReg);
- assert(pBox->x1<=pBox->x2);
- assert(pBox->y1<=pBox->y2);
- pReg->extents = *pBox;
- xfreeData(pReg);
- pReg->data = (RegDataPtr)NULL;
-}
-
-Bool
-miPointInRegion(pReg, x, y, box)
- register RegionPtr pReg;
- register int x, y;
- BoxPtr box; /* "return" value */
-{
- register BoxPtr pbox, pboxEnd;
- int numRects;
-
- good(pReg);
- numRects = REGION_NUM_RECTS(pReg);
- if (!numRects || !INBOX(&pReg->extents, x, y))
- return(FALSE);
- if (numRects == 1)
- {
- *box = pReg->extents;
- return(TRUE);
- }
- for (pbox = REGION_BOXPTR(pReg), pboxEnd = pbox + numRects;
- pbox != pboxEnd;
- pbox++)
- {
- if (y >= pbox->y2)
- continue; /* not there yet */
- if ((y < pbox->y1) || (x < pbox->x1))
- break; /* missed it */
- if (x >= pbox->x2)
- continue; /* not there yet */
- *box = *pbox;
- return(TRUE);
- }
- return(FALSE);
-}
-
-Bool
-miRegionNotEmpty(pReg)
- RegionPtr pReg;
-{
- good(pReg);
- return(!REGION_NIL(pReg));
-}
-
-Bool
-miRegionBroken(RegionPtr pReg)
-{
- good(pReg);
- return (REGION_NAR(pReg));
-}
-
-void
-miRegionEmpty(pReg)
- RegionPtr pReg;
-{
- good(pReg);
- xfreeData(pReg);
- pReg->extents.x2 = pReg->extents.x1;
- pReg->extents.y2 = pReg->extents.y1;
- pReg->data = &miEmptyData;
-}
-
-BoxPtr
-miRegionExtents(pReg)
- RegionPtr pReg;
-{
- good(pReg);
- return(&pReg->extents);
-}
-
-#define ExchangeSpans(a, b) \
-{ \
- DDXPointRec tpt; \
- register int tw; \
- \
- tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \
- tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
- if mapping time can be improved. But right now I've been at work 12 hours,
- so forget it.
-*/
-
-static void QuickSortSpans(
- register DDXPointRec spans[],
- register int widths[],
- register int numSpans)
-{
- register int y;
- register int i, j, m;
- register DDXPointPtr r;
-
- /* Always called with numSpans > 1 */
- /* Sorts only by y, doesn't bother to sort by x */
-
- do
- {
- if (numSpans < 9)
- {
- /* Do insertion sort */
- register int yprev;
-
- yprev = spans[0].y;
- i = 1;
- do
- { /* while i != numSpans */
- y = spans[i].y;
- if (yprev > y)
- {
- /* spans[i] is out of order. Move into proper location. */
- DDXPointRec tpt;
- int tw, k;
-
- for (j = 0; y >= spans[j].y; j++) {}
- tpt = spans[i];
- tw = widths[i];
- for (k = i; k != j; k--)
- {
- spans[k] = spans[k-1];
- widths[k] = widths[k-1];
- }
- spans[j] = tpt;
- widths[j] = tw;
- y = spans[i].y;
- } /* if out of order */
- yprev = y;
- i++;
- } while (i != numSpans);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- m = numSpans / 2;
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1);
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- y = spans[0].y;
-
- /* Partition array */
- i = 0;
- j = numSpans;
- do
- {
- r = &(spans[i]);
- do
- {
- r++;
- i++;
- } while (i != numSpans && r->y < y);
- r = &(spans[j]);
- do
- {
- r--;
- j--;
- } while (y < r->y);
- if (i < j)
- ExchangeSpans(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeSpans(0, j);
-
- /* Recurse */
- if (numSpans-j-1 > 1)
- QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);
- numSpans = j;
- } while (numSpans > 1);
-}
-
-#define NextBand() \
-{ \
- clipy1 = pboxBandStart->y1; \
- clipy2 = pboxBandStart->y2; \
- pboxBandEnd = pboxBandStart + 1; \
- while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \
- pboxBandEnd++; \
- } \
- for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \
-}
-
-/*
- Clip a list of scanlines to a region. The caller has allocated the
- space. FSorted is non-zero if the scanline origins are in ascending
- order.
- returns the number of new, clipped scanlines.
-*/
-
-int
-miClipSpans(
- RegionPtr prgnDst,
- register DDXPointPtr ppt,
- register int *pwidth,
- int nspans,
- register DDXPointPtr pptNew,
- int *pwidthNew,
- int fSorted)
-{
- register DDXPointPtr pptLast;
- int *pwidthNewStart; /* the vengeance of Xerox! */
- register int y, x1, x2;
- register int numRects;
-
- good(prgnDst);
- pptLast = ppt + nspans;
- pwidthNewStart = pwidthNew;
-
- if (!prgnDst->data)
- {
- /* Do special fast code with clip boundaries in registers(?) */
- /* It doesn't pay much to make use of fSorted in this case,
- so we lump everything together. */
-
- register int clipx1, clipx2, clipy1, clipy2;
-
- clipx1 = prgnDst->extents.x1;
- clipy1 = prgnDst->extents.y1;
- clipx2 = prgnDst->extents.x2;
- clipy2 = prgnDst->extents.y2;
-
- for (; ppt != pptLast; ppt++, pwidth++)
- {
- y = ppt->y;
- x1 = ppt->x;
- if (clipy1 <= y && y < clipy2)
- {
- x2 = x1 + *pwidth;
- if (x1 < clipx1) x1 = clipx1;
- if (x2 > clipx2) x2 = clipx2;
- if (x1 < x2)
- {
- /* part of span in clip rectangle */
- pptNew->x = x1;
- pptNew->y = y;
- *pwidthNew = x2 - x1;
- pptNew++;
- pwidthNew++;
- }
- }
- } /* end for */
-
- }
- else if ((numRects = prgnDst->data->numRects))
- {
- /* Have to clip against many boxes */
- BoxPtr pboxBandStart, pboxBandEnd;
- register BoxPtr pbox;
- register BoxPtr pboxLast;
- register int clipy1, clipy2;
-
- /* In this case, taking advantage of sorted spans gains more than
- the sorting costs. */
- if ((! fSorted) && (nspans > 1))
- QuickSortSpans(ppt, pwidth, nspans);
-
- pboxBandStart = REGION_BOXPTR(prgnDst);
- pboxLast = pboxBandStart + numRects;
-
- NextBand();
-
- for (; ppt != pptLast; )
- {
- y = ppt->y;
- if (y < clipy2)
- {
- /* span is in the current band */
- pbox = pboxBandStart;
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- do
- { /* For each box in band */
- register int newx1, newx2;
-
- newx1 = x1;
- newx2 = x2;
- if (newx1 < pbox->x1) newx1 = pbox->x1;
- if (newx2 > pbox->x2) newx2 = pbox->x2;
- if (newx1 < newx2)
- {
- /* Part of span in clip rectangle */
- pptNew->x = newx1;
- pptNew->y = y;
- *pwidthNew = newx2 - newx1;
- pptNew++;
- pwidthNew++;
- }
- pbox++;
- } while (pbox != pboxBandEnd);
- ppt++;
- pwidth++;
- }
- else
- {
- /* Move to next band, adjust ppt as needed */
- pboxBandStart = pboxBandEnd;
- if (pboxBandStart == pboxLast)
- break; /* We're completely done */
- NextBand();
- }
- }
- }
- return (pwidthNew - pwidthNewStart);
-}
-
-/* find the band in a region with the most rectangles */
-int
-miFindMaxBand(prgn)
- RegionPtr prgn;
-{
- register int nbox;
- register BoxPtr pbox;
- register int nThisBand;
- register int nMaxBand = 0;
- short yThisBand;
-
- good(prgn);
- nbox = REGION_NUM_RECTS(prgn);
- pbox = REGION_RECTS(prgn);
-
- while(nbox > 0)
- {
- yThisBand = pbox->y1;
- nThisBand = 0;
- while((nbox > 0) && (pbox->y1 == yThisBand))
- {
- nbox--;
- pbox++;
- nThisBand++;
- }
- if (nThisBand > nMaxBand)
- nMaxBand = nThisBand;
- }
- return (nMaxBand);
-}
diff --git a/mi/miscanfill.h b/mi/miscanfill.h
deleted file mode 100644
index 06baee399..000000000
--- a/mi/miscanfill.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $Xorg: miscanfill.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-
-#ifndef SCANFILLINCLUDED
-#define SCANFILLINCLUDED
-/*
- * scanfill.h
- *
- * Written by Brian Kelleher; Jan 1985
- *
- * This file contains a few macros to help track
- * the edge of a filled object. The object is assumed
- * to be filled in scanline order, and thus the
- * algorithm used is an extension of Bresenham's line
- * drawing algorithm which assumes that y is always the
- * major axis.
- * Since these pieces of code are the same for any filled shape,
- * it is more convenient to gather the library in one
- * place, but since these pieces of code are also in
- * the inner loops of output primitives, procedure call
- * overhead is out of the question.
- * See the author for a derivation if needed.
- */
-
-
-/*
- * In scan converting polygons, we want to choose those pixels
- * which are inside the polygon. Thus, we add .5 to the starting
- * x coordinate for both left and right edges. Now we choose the
- * first pixel which is inside the pgon for the left edge and the
- * first pixel which is outside the pgon for the right edge.
- * Draw the left pixel, but not the right.
- *
- * How to add .5 to the starting x coordinate:
- * If the edge is moving to the right, then subtract dy from the
- * error term from the general form of the algorithm.
- * If the edge is moving to the left, then add dy to the error term.
- *
- * The reason for the difference between edges moving to the left
- * and edges moving to the right is simple: If an edge is moving
- * to the right, then we want the algorithm to flip immediately.
- * If it is moving to the left, then we don't want it to flip until
- * we traverse an entire pixel.
- */
-#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
- int dx; /* local storage */ \
-\
- /* \
- * if the edge is horizontal, then it is ignored \
- * and assumed not to be processed. Otherwise, do this stuff. \
- */ \
- if ((dy) != 0) { \
- xStart = (x1); \
- dx = (x2) - xStart; \
- if (dx < 0) { \
- m = dx / (dy); \
- m1 = m - 1; \
- incr1 = -2 * dx + 2 * (dy) * m1; \
- incr2 = -2 * dx + 2 * (dy) * m; \
- d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
- } else { \
- m = dx / (dy); \
- m1 = m + 1; \
- incr1 = 2 * dx - 2 * (dy) * m1; \
- incr2 = 2 * dx - 2 * (dy) * m; \
- d = -2 * m * (dy) + 2 * dx; \
- } \
- } \
-}
-
-#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
- if (m1 > 0) { \
- if (d > 0) { \
- minval += m1; \
- d += incr1; \
- } \
- else { \
- minval += m; \
- d += incr2; \
- } \
- } else {\
- if (d >= 0) { \
- minval += m1; \
- d += incr1; \
- } \
- else { \
- minval += m; \
- d += incr2; \
- } \
- } \
-}
-
-
-/*
- * This structure contains all of the information needed
- * to run the bresenham algorithm.
- * The variables may be hardcoded into the declarations
- * instead of using this structure to make use of
- * register declarations.
- */
-typedef struct {
- int minor; /* minor axis */
- int d; /* decision variable */
- int m, m1; /* slope and slope+1 */
- int incr1, incr2; /* error increments */
-} BRESINFO;
-
-
-#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
- BRESINITPGON(dmaj, min1, min2, bres.minor, bres.d, \
- bres.m, bres.m1, bres.incr1, bres.incr2)
-
-#define BRESINCRPGONSTRUCT(bres) \
- BRESINCRPGON(bres.d, bres.minor, bres.m, bres.m1, bres.incr1, bres.incr2)
-
-
-#endif
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
deleted file mode 100644
index edb5f7d78..000000000
--- a/mi/miscrinit.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* $Xorg: miscrinit.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-/*
-
-Copyright 1990, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/miscrinit.c,v 3.16 2003/04/23 21:51:53 tsi Exp $ */
-
-#include "X.h"
-#include "servermd.h"
-#include "misc.h"
-#include "mi.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "dix.h"
-#include "miline.h"
-#ifdef MITSHM
-#define _XSHM_SERVER_
-#include "XShm.h"
-#endif
-
-/* We use this structure to propogate some information from miScreenInit to
- * miCreateScreenResources. miScreenInit allocates the structure, fills it
- * in, and puts it into pScreen->devPrivate. miCreateScreenResources
- * extracts the info and frees the structure. We could've accomplished the
- * same thing by adding fields to the screen structure, but they would have
- * ended up being redundant, and would have exposed this mi implementation
- * detail to the whole server.
- */
-
-typedef struct
-{
- pointer pbits; /* pointer to framebuffer */
- int width; /* delta to add to a framebuffer addr to move one row down */
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
-
-
-/* this plugs into pScreen->ModifyPixmapHeader */
-Bool
-miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind,
- pPixData)
- PixmapPtr pPixmap;
- int width;
- int height;
- int depth;
- int bitsPerPixel;
- int devKind;
- pointer pPixData;
-{
- if (!pPixmap)
- return FALSE;
-
- /*
- * If all arguments are specified, reinitialize everything (including
- * validated state).
- */
- if ((width > 0) && (height > 0) && (depth > 0) && (bitsPerPixel > 0) &&
- (devKind > 0) && pPixData) {
- pPixmap->drawable.depth = depth;
- pPixmap->drawable.bitsPerPixel = bitsPerPixel;
- pPixmap->drawable.id = 0;
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pPixmap->drawable.x = 0;
- pPixmap->drawable.y = 0;
- pPixmap->drawable.width = width;
- pPixmap->drawable.height = height;
- pPixmap->devKind = devKind;
- pPixmap->refcnt = 1;
- pPixmap->devPrivate.ptr = pPixData;
- } else {
- /*
- * Only modify specified fields, keeping all others intact.
- */
-
- if (width > 0)
- pPixmap->drawable.width = width;
-
- if (height > 0)
- pPixmap->drawable.height = height;
-
- if (depth > 0)
- pPixmap->drawable.depth = depth;
-
- if (bitsPerPixel > 0)
- pPixmap->drawable.bitsPerPixel = bitsPerPixel;
- else if ((bitsPerPixel < 0) && (depth > 0))
- pPixmap->drawable.bitsPerPixel = BitsPerPixel(depth);
-
- /*
- * CAVEAT: Non-SI DDXen may use devKind and devPrivate fields for
- * other purposes.
- */
- if (devKind > 0)
- pPixmap->devKind = devKind;
- else if ((devKind < 0) && ((width > 0) || (depth > 0)))
- pPixmap->devKind = PixmapBytePad(pPixmap->drawable.width,
- pPixmap->drawable.depth);
-
- if (pPixData)
- pPixmap->devPrivate.ptr = pPixData;
- }
- return TRUE;
-}
-
-
-/*ARGSUSED*/
-Bool
-miCloseScreen (iScreen, pScreen)
- int iScreen;
- ScreenPtr pScreen;
-{
- return ((*pScreen->DestroyPixmap)((PixmapPtr)pScreen->devPrivate));
-}
-
-/* With the introduction of pixmap privates, the "screen pixmap" can no
- * longer be created in miScreenInit, since all the modules that could
- * possibly ask for pixmap private space have not been initialized at
- * that time. pScreen->CreateScreenResources is called after all
- * possible private-requesting modules have been inited; we create the
- * screen pixmap here.
- */
-Bool
-miCreateScreenResources(pScreen)
- ScreenPtr pScreen;
-{
- miScreenInitParmsPtr pScrInitParms;
- pointer value;
-
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
-
- /* if width is non-zero, pScreen->devPrivate will be a pixmap
- * else it will just take the value pbits
- */
- if (pScrInitParms->width)
- {
- PixmapPtr pPixmap;
-
- /* create a pixmap with no data, then redirect it to point to
- * the screen
- */
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
- if (!pPixmap)
- return FALSE;
-
- if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
- pScreen->height, pScreen->rootDepth,
- BitsPerPixel(pScreen->rootDepth),
- PixmapBytePad(pScrInitParms->width, pScreen->rootDepth),
- pScrInitParms->pbits))
- return FALSE;
- value = (pointer)pPixmap;
- }
- else
- {
- value = pScrInitParms->pbits;
- }
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
- pScreen->devPrivate = value; /* pPixmap or pbits */
- return TRUE;
-}
-
-Bool
-miScreenDevPrivateInit(pScreen, width, pbits)
- register ScreenPtr pScreen;
- int width;
- pointer pbits;
-{
- miScreenInitParmsPtr pScrInitParms;
-
- /* Stash pbits and width in a short-lived miScreenInitParmsRec attached
- * to the screen, until CreateScreenResources can put them in the
- * screen pixmap.
- */
- pScrInitParms = (miScreenInitParmsPtr)xalloc(sizeof(miScreenInitParmsRec));
- if (!pScrInitParms)
- return FALSE;
- pScrInitParms->pbits = pbits;
- pScrInitParms->width = width;
- pScreen->devPrivate = (pointer)pScrInitParms;
- return TRUE;
-}
-
-Bool
-miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
- rootDepth, numDepths, depths, rootVisual, numVisuals, visuals)
- register ScreenPtr pScreen;
- pointer pbits; /* pointer to screen bits */
- int xsize, ysize; /* in pixels */
- int dpix, dpiy; /* dots per inch */
- int width; /* pixel width of frame buffer */
- int rootDepth; /* depth of root window */
- int numDepths; /* number of depths supported */
- DepthRec *depths; /* supported depths */
- VisualID rootVisual; /* root visual */
- int numVisuals; /* number of visuals supported */
- VisualRec *visuals; /* supported visuals */
-{
- pScreen->width = xsize;
- pScreen->height = ysize;
- pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10);
- pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10);
- pScreen->numDepths = numDepths;
- pScreen->rootDepth = rootDepth;
- pScreen->allowedDepths = depths;
- pScreen->rootVisual = rootVisual;
- /* defColormap */
- pScreen->minInstalledCmaps = 1;
- pScreen->maxInstalledCmaps = 1;
- pScreen->backingStoreSupport = NotUseful;
- pScreen->saveUnderSupport = NotUseful;
- /* whitePixel, blackPixel */
- pScreen->ModifyPixmapHeader = miModifyPixmapHeader;
- pScreen->CreateScreenResources = miCreateScreenResources;
- pScreen->GetScreenPixmap = miGetScreenPixmap;
- pScreen->SetScreenPixmap = miSetScreenPixmap;
- pScreen->numVisuals = numVisuals;
- pScreen->visuals = visuals;
- if (width)
- {
-#ifdef MITSHM
- ShmRegisterFbFuncs(pScreen);
-#endif
- pScreen->CloseScreen = miCloseScreen;
- }
- /* else CloseScreen */
- /* QueryBestSize, SaveScreen, GetImage, GetSpans */
- pScreen->PointerNonInterestBox = (PointerNonInterestBoxProcPtr) 0;
- pScreen->SourceValidate = (SourceValidateProcPtr) 0;
- /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
- /* RealizeWindow, UnrealizeWindow */
- pScreen->ValidateTree = miValidateTree;
- pScreen->PostValidateTree = (PostValidateTreeProcPtr) 0;
- pScreen->WindowExposures = miWindowExposures;
- /* PaintWindowBackground, PaintWindowBorder, CopyWindow */
- pScreen->ClearToBackground = miClearToBackground;
- pScreen->ClipNotify = (ClipNotifyProcPtr) 0;
- pScreen->RestackWindow = (RestackWindowProcPtr) 0;
- /* CreatePixmap, DestroyPixmap */
- /* RealizeFont, UnrealizeFont */
- /* CreateGC */
- /* CreateColormap, DestroyColormap, InstallColormap, UninstallColormap */
- /* ListInstalledColormaps, StoreColors, ResolveColor */
-#ifdef NEED_SCREEN_REGIONS
- pScreen->RegionCreate = miRegionCreate;
- pScreen->RegionInit = miRegionInit;
- pScreen->RegionCopy = miRegionCopy;
- pScreen->RegionDestroy = miRegionDestroy;
- pScreen->RegionUninit = miRegionUninit;
- pScreen->Intersect = miIntersect;
- pScreen->Union = miUnion;
- pScreen->Subtract = miSubtract;
- pScreen->Inverse = miInverse;
- pScreen->RegionReset = miRegionReset;
- pScreen->TranslateRegion = miTranslateRegion;
- pScreen->RectIn = miRectIn;
- pScreen->PointInRegion = miPointInRegion;
- pScreen->RegionNotEmpty = miRegionNotEmpty;
- pScreen->RegionEqual = miRegionEqual;
- pScreen->RegionBroken = miRegionBroken;
- pScreen->RegionBreak = miRegionBreak;
- pScreen->RegionEmpty = miRegionEmpty;
- pScreen->RegionExtents = miRegionExtents;
- pScreen->RegionAppend = miRegionAppend;
- pScreen->RegionValidate = miRegionValidate;
-#endif /* NEED_SCREEN_REGIONS */
- /* BitmapToRegion */
-#ifdef NEED_SCREEN_REGIONS
- pScreen->RectsToRegion = miRectsToRegion;
-#endif /* NEED_SCREEN_REGIONS */
- pScreen->SendGraphicsExpose = miSendGraphicsExpose;
- pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA;
- pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
- pScreen->blockData = (pointer)0;
- pScreen->wakeupData = (pointer)0;
- pScreen->MarkWindow = miMarkWindow;
- pScreen->MarkOverlappedWindows = miMarkOverlappedWindows;
- pScreen->ChangeSaveUnder = miChangeSaveUnder;
- pScreen->PostChangeSaveUnder = miPostChangeSaveUnder;
- pScreen->MoveWindow = miMoveWindow;
- pScreen->ResizeWindow = miSlideAndSizeWindow;
- pScreen->GetLayerWindow = miGetLayerWindow;
- pScreen->HandleExposures = miHandleValidateExposures;
- pScreen->ReparentWindow = (ReparentWindowProcPtr) 0;
- pScreen->ChangeBorderWidth = miChangeBorderWidth;
-#ifdef SHAPE
- pScreen->SetShape = miSetShape;
-#endif
- pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow;
-
- pScreen->SaveDoomedAreas = 0;
- pScreen->RestoreAreas = 0;
- pScreen->ExposeCopy = 0;
- pScreen->TranslateBackingStore = 0;
- pScreen->ClearBackingStore = 0;
- pScreen->DrawGuarantee = 0;
-
- miSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS);
-
- return miScreenDevPrivateInit(pScreen, width, pbits);
-}
-
-int
-miAllocateGCPrivateIndex()
-{
- static int privateIndex = -1;
- static unsigned long miGeneration = 0;
-
- if (miGeneration != serverGeneration)
- {
- privateIndex = AllocateGCPrivateIndex();
- miGeneration = serverGeneration;
- }
- return privateIndex;
-}
-
-int miZeroLineScreenIndex;
-unsigned int miZeroLineGeneration = 0;
-
-void
-miSetZeroLineBias(pScreen, bias)
- ScreenPtr pScreen;
- unsigned int bias;
-{
- if (miZeroLineGeneration != serverGeneration)
- {
- miZeroLineScreenIndex = AllocateScreenPrivateIndex();
- miZeroLineGeneration = serverGeneration;
- }
- if (miZeroLineScreenIndex >= 0)
- pScreen->devPrivates[miZeroLineScreenIndex].uval = bias;
-}
-
-PixmapPtr
-miGetScreenPixmap(pScreen)
- ScreenPtr pScreen;
-{
- return (PixmapPtr)(pScreen->devPrivate);
-}
-
-void
-miSetScreenPixmap(pPix)
- PixmapPtr pPix;
-{
- if (pPix)
- pPix->drawable.pScreen->devPrivate = (pointer)pPix;
-}
diff --git a/mi/mispans.c b/mi/mispans.c
deleted file mode 100644
index 81fa45da7..000000000
--- a/mi/mispans.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mispans.c,v 3.4 2001/12/14 20:00:26 dawes Exp $ */
-/***********************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: mispans.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-#include "misc.h"
-#include "pixmapstr.h"
-#include "gcstruct.h"
-#include "mispans.h"
-
-/*
-
-These routines maintain lists of Spans, in order to implement the
-``touch-each-pixel-once'' rules of wide lines and arcs.
-
-Written by Joel McCormack, Summer 1989.
-
-*/
-
-
-void miInitSpanGroup(spanGroup)
- SpanGroup *spanGroup;
-{
- spanGroup->size = 0;
- spanGroup->count = 0;
- spanGroup->group = NULL;
- spanGroup->ymin = MAXSHORT;
- spanGroup->ymax = MINSHORT;
-} /* InitSpanGroup */
-
-#define YMIN(spans) (spans->points[0].y)
-#define YMAX(spans) (spans->points[spans->count-1].y)
-
-void miSubtractSpans (spanGroup, sub)
- SpanGroup *spanGroup;
- Spans *sub;
-{
- int i, subCount, spansCount;
- int ymin, ymax, xmin, xmax;
- Spans *spans;
- DDXPointPtr subPt, spansPt;
- int *subWid, *spansWid;
- int extra;
-
- ymin = YMIN(sub);
- ymax = YMAX(sub);
- spans = spanGroup->group;
- for (i = spanGroup->count; i; i--, spans++) {
- if (YMIN(spans) <= ymax && ymin <= YMAX(spans)) {
- subCount = sub->count;
- subPt = sub->points;
- subWid = sub->widths;
- spansCount = spans->count;
- spansPt = spans->points;
- spansWid = spans->widths;
- extra = 0;
- for (;;)
- {
- while (spansCount && spansPt->y < subPt->y)
- {
- spansPt++; spansWid++; spansCount--;
- }
- if (!spansCount)
- break;
- while (subCount && subPt->y < spansPt->y)
- {
- subPt++; subWid++; subCount--;
- }
- if (!subCount)
- break;
- if (subPt->y == spansPt->y)
- {
- xmin = subPt->x;
- xmax = xmin + *subWid;
- if (xmin >= spansPt->x + *spansWid || spansPt->x >= xmax)
- {
- ;
- }
- else if (xmin <= spansPt->x)
- {
- if (xmax >= spansPt->x + *spansWid)
- {
- memmove (spansPt, spansPt + 1, sizeof *spansPt * (spansCount - 1));
- memmove (spansWid, spansWid + 1, sizeof *spansWid * (spansCount - 1));
- spansPt--;
- spansWid--;
- spans->count--;
- extra++;
- }
- else
- {
- *spansWid = *spansWid - (xmax - spansPt->x);
- spansPt->x = xmax;
- }
- }
- else
- {
- if (xmax >= spansPt->x + *spansWid)
- {
- *spansWid = xmin - spansPt->x;
- }
- else
- {
- if (!extra) {
- DDXPointPtr newPt;
- int *newwid;
-
-#define EXTRA 8
- newPt = (DDXPointPtr) xrealloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec));
- if (!newPt)
- break;
- spansPt = newPt + (spansPt - spans->points);
- spans->points = newPt;
- newwid = (int *) xrealloc (spans->widths, (spans->count + EXTRA) * sizeof (int));
- if (!newwid)
- break;
- spansWid = newwid + (spansWid - spans->widths);
- spans->widths = newwid;
- extra = EXTRA;
- }
- memmove (spansPt + 1, spansPt, sizeof *spansPt * (spansCount));
- memmove (spansWid + 1, spansWid, sizeof *spansWid * (spansCount));
- spans->count++;
- extra--;
- *spansWid = xmin - spansPt->x;
- spansWid++;
- spansPt++;
- *spansWid = *spansWid - (xmax - spansPt->x);
- spansPt->x = xmax;
- }
- }
- }
- spansPt++; spansWid++; spansCount--;
- }
- }
- }
-}
-
-void miAppendSpans(spanGroup, otherGroup, spans)
- SpanGroup *spanGroup;
- SpanGroup *otherGroup;
- Spans *spans;
-{
- register int ymin, ymax;
- register int spansCount;
-
- spansCount = spans->count;
- if (spansCount > 0) {
- if (spanGroup->size == spanGroup->count) {
- spanGroup->size = (spanGroup->size + 8) * 2;
- spanGroup->group = (Spans *)
- xrealloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
- }
-
- spanGroup->group[spanGroup->count] = *spans;
- (spanGroup->count)++;
- ymin = spans->points[0].y;
- if (ymin < spanGroup->ymin) spanGroup->ymin = ymin;
- ymax = spans->points[spansCount - 1].y;
- if (ymax > spanGroup->ymax) spanGroup->ymax = ymax;
- if (otherGroup &&
- otherGroup->ymin < ymax &&
- ymin < otherGroup->ymax)
- {
- miSubtractSpans (otherGroup, spans);
- }
- }
- else
- {
- xfree (spans->points);
- xfree (spans->widths);
- }
-} /* AppendSpans */
-
-void miFreeSpanGroup(spanGroup)
- SpanGroup *spanGroup;
-{
- if (spanGroup->group != NULL) xfree(spanGroup->group);
-}
-
-static void QuickSortSpansX(
- register DDXPointRec points[],
- register int widths[],
- register int numSpans )
-{
- register int x;
- register int i, j, m;
- register DDXPointPtr r;
-
-/* Always called with numSpans > 1 */
-/* Sorts only by x, as all y should be the same */
-
-#define ExchangeSpans(a, b) \
-{ \
- DDXPointRec tpt; \
- register int tw; \
- \
- tpt = points[a]; points[a] = points[b]; points[b] = tpt; \
- tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \
-}
-
- do {
- if (numSpans < 9) {
- /* Do insertion sort */
- register int xprev;
-
- xprev = points[0].x;
- i = 1;
- do { /* while i != numSpans */
- x = points[i].x;
- if (xprev > x) {
- /* points[i] is out of order. Move into proper location. */
- DDXPointRec tpt;
- int tw, k;
-
- for (j = 0; x >= points[j].x; j++) {}
- tpt = points[i];
- tw = widths[i];
- for (k = i; k != j; k--) {
- points[k] = points[k-1];
- widths[k] = widths[k-1];
- }
- points[j] = tpt;
- widths[j] = tw;
- x = points[i].x;
- } /* if out of order */
- xprev = x;
- i++;
- } while (i != numSpans);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- m = numSpans / 2;
- if (points[m].x > points[0].x) ExchangeSpans(m, 0);
- if (points[m].x > points[numSpans-1].x) ExchangeSpans(m, numSpans-1);
- if (points[m].x > points[0].x) ExchangeSpans(m, 0);
- x = points[0].x;
-
- /* Partition array */
- i = 0;
- j = numSpans;
- do {
- r = &(points[i]);
- do {
- r++;
- i++;
- } while (i != numSpans && r->x < x);
- r = &(points[j]);
- do {
- r--;
- j--;
- } while (x < r->x);
- if (i < j) ExchangeSpans(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeSpans(0, j);
-
- /* Recurse */
- if (numSpans-j-1 > 1)
- QuickSortSpansX(&points[j+1], &widths[j+1], numSpans-j-1);
- numSpans = j;
- } while (numSpans > 1);
-} /* QuickSortSpans */
-
-
-static int UniquifySpansX(
- Spans *spans,
- register DDXPointRec *newPoints,
- register int *newWidths )
-{
- register int newx1, newx2, oldpt, i, y;
- register DDXPointRec *oldPoints;
- register int *oldWidths;
- int *startNewWidths;
-
-/* Always called with numSpans > 1 */
-/* Uniquify the spans, and stash them into newPoints and newWidths. Return the
- number of unique spans. */
-
-
- startNewWidths = newWidths;
-
- oldPoints = spans->points;
- oldWidths = spans->widths;
-
- y = oldPoints->y;
- newx1 = oldPoints->x;
- newx2 = newx1 + *oldWidths;
-
- for (i = spans->count-1; i != 0; i--) {
- oldPoints++;
- oldWidths++;
- oldpt = oldPoints->x;
- if (oldpt > newx2) {
- /* Write current span, start a new one */
- newPoints->x = newx1;
- newPoints->y = y;
- *newWidths = newx2 - newx1;
- newPoints++;
- newWidths++;
- newx1 = oldpt;
- newx2 = oldpt + *oldWidths;
- } else {
- /* extend current span, if old extends beyond new */
- oldpt = oldpt + *oldWidths;
- if (oldpt > newx2) newx2 = oldpt;
- }
- } /* for */
-
- /* Write final span */
- newPoints->x = newx1;
- *newWidths = newx2 - newx1;
- newPoints->y = y;
-
- return (newWidths - startNewWidths) + 1;
-} /* UniquifySpansX */
-
-void
-miDisposeSpanGroup (spanGroup)
- SpanGroup *spanGroup;
-{
- int i;
- Spans *spans;
-
- for (i = 0; i < spanGroup->count; i++)
- {
- spans = spanGroup->group + i;
- xfree (spans->points);
- xfree (spans->widths);
- }
-}
-
-void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
- DrawablePtr pDraw;
- GCPtr pGC;
- SpanGroup *spanGroup;
-{
- register int i;
- register Spans *spans;
- register Spans *yspans;
- register int *ysizes;
- register int ymin, ylength;
-
- /* Outgoing spans for one big call to FillSpans */
- register DDXPointPtr points;
- register int *widths;
- register int count;
-
- if (spanGroup->count == 0) return;
-
- if (spanGroup->count == 1) {
- /* Already should be sorted, unique */
- spans = spanGroup->group;
- (*pGC->ops->FillSpans)
- (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
- }
- else
- {
- /* Yuck. Gross. Radix sort into y buckets, then sort x and uniquify */
- /* This seems to be the fastest thing to do. I've tried sorting on
- both x and y at the same time rather than creating into all those
- y buckets, but it was somewhat slower. */
-
- ymin = spanGroup->ymin;
- ylength = spanGroup->ymax - ymin + 1;
-
- /* Allocate Spans for y buckets */
- yspans = (Spans *) xalloc(ylength * sizeof(Spans));
- ysizes = (int *) xalloc(ylength * sizeof (int));
-
- if (!yspans || !ysizes)
- {
- if (yspans)
- xfree (yspans);
- if (ysizes)
- xfree (ysizes);
- miDisposeSpanGroup (spanGroup);
- return;
- }
-
- for (i = 0; i != ylength; i++) {
- ysizes[i] = 0;
- yspans[i].count = 0;
- yspans[i].points = NULL;
- yspans[i].widths = NULL;
- }
-
- /* Go through every single span and put it into the correct bucket */
- count = 0;
- for (i = 0, spans = spanGroup->group;
- i != spanGroup->count;
- i++, spans++) {
- int index;
- int j;
-
- for (j = 0, points = spans->points, widths = spans->widths;
- j != spans->count;
- j++, points++, widths++) {
- index = points->y - ymin;
- if (index >= 0 && index < ylength) {
- Spans *newspans = &(yspans[index]);
- if (newspans->count == ysizes[index]) {
- DDXPointPtr newpoints;
- int *newwidths;
- ysizes[index] = (ysizes[index] + 8) * 2;
- newpoints = (DDXPointPtr) xrealloc(
- newspans->points,
- ysizes[index] * sizeof(DDXPointRec));
- newwidths = (int *) xrealloc(
- newspans->widths,
- ysizes[index] * sizeof(int));
- if (!newpoints || !newwidths)
- {
- int i;
-
- for (i = 0; i < ylength; i++)
- {
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
- }
- xfree (yspans);
- xfree (ysizes);
- miDisposeSpanGroup (spanGroup);
- return;
- }
- newspans->points = newpoints;
- newspans->widths = newwidths;
- }
- newspans->points[newspans->count] = *points;
- newspans->widths[newspans->count] = *widths;
- (newspans->count)++;
- } /* if y value of span in range */
- } /* for j through spans */
- count += spans->count;
- xfree(spans->points);
- spans->points = NULL;
- xfree(spans->widths);
- spans->widths = NULL;
- } /* for i thorough Spans */
-
- /* Now sort by x and uniquify each bucket into the final array */
- points = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec));
- widths = (int *) xalloc(count * sizeof(int));
- if (!points || !widths)
- {
- int i;
-
- for (i = 0; i < ylength; i++)
- {
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
- }
- xfree (yspans);
- xfree (ysizes);
- if (points)
- xfree (points);
- if (widths)
- xfree (widths);
- return;
- }
- count = 0;
- for (i = 0; i != ylength; i++) {
- int ycount = yspans[i].count;
- if (ycount > 0) {
- if (ycount > 1) {
- QuickSortSpansX(yspans[i].points, yspans[i].widths, ycount);
- count += UniquifySpansX
- (&(yspans[i]), &(points[count]), &(widths[count]));
- } else {
- points[count] = yspans[i].points[0];
- widths[count] = yspans[i].widths[0];
- count++;
- }
- xfree(yspans[i].points);
- xfree(yspans[i].widths);
- }
- }
-
- (*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE);
- xfree(points);
- xfree(widths);
- xfree(yspans);
- xfree(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */
- }
-
- spanGroup->count = 0;
- spanGroup->ymin = MAXSHORT;
- spanGroup->ymax = MINSHORT;
-}
-
-
-void miFillSpanGroup(pDraw, pGC, spanGroup)
- DrawablePtr pDraw;
- GCPtr pGC;
- SpanGroup *spanGroup;
-{
- register int i;
- register Spans *spans;
-
- for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
- (*pGC->ops->FillSpans)
- (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
- }
-
- spanGroup->count = 0;
- spanGroup->ymin = MAXSHORT;
- spanGroup->ymax = MINSHORT;
-} /* FillSpanGroup */
diff --git a/mi/mispans.h b/mi/mispans.h
deleted file mode 100644
index 5ae2d014a..000000000
--- a/mi/mispans.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mispans.h,v 1.3 2001/12/14 20:00:26 dawes Exp $ */
-/***********************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: mispans.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */
-
-typedef struct {
- int count; /* number of spans */
- DDXPointPtr points; /* pointer to list of start points */
- int *widths; /* pointer to list of widths */
-} Spans;
-
-typedef struct {
- int size; /* Total number of *Spans allocated */
- int count; /* Number of *Spans actually in group */
- Spans *group; /* List of Spans */
- int ymin, ymax; /* Min, max y values encountered */
-} SpanGroup;
-
-/* Initialize SpanGroup. MUST BE DONE before use. */
-extern void miInitSpanGroup(
- SpanGroup * /*spanGroup*/
-);
-
-/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */
-extern void miAppendSpans(
- SpanGroup * /*spanGroup*/,
- SpanGroup * /*otherGroup*/,
- Spans * /*spans*/
-);
-
-/* Paint a span group, possibly with some overlap */
-extern void miFillSpanGroup(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- SpanGroup * /*spanGroup*/
-);
-
-/* Paint a span group, insuring that each pixel is painted at most once */
-extern void miFillUniqueSpanGroup(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- SpanGroup * /*spanGroup*/
-);
-
-/* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */
-extern void miFreeSpanGroup(
- SpanGroup * /*spanGroup*/
-);
-
-extern void miSubtractSpans(
- SpanGroup * /*spanGroup*/,
- Spans * /*sub*/
-);
-
-extern void miDisposeSpanGroup(
- SpanGroup * /*spanGroup*/
-);
-
-extern int miClipSpans(
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*ppt*/,
- int * /*pwidth*/,
- int /*nspans*/,
- DDXPointPtr /*pptNew*/,
- int * /*pwidthNew*/,
- int /*fSorted*/
-);
-
-/* Rops which must use span groups */
-#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2)
-#define miSpansEasyRop(rop) (!miSpansCarefulRop(rop))
-
diff --git a/mi/misprite.c b/mi/misprite.c
deleted file mode 100644
index d323f1168..000000000
--- a/mi/misprite.c
+++ /dev/null
@@ -1,2324 +0,0 @@
-/*
- * misprite.c
- *
- * machine independent software sprite routines
- */
-
-/* $Xorg: misprite.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/misprite.c,v 3.11 2002/12/09 04:10:58 tsi Exp $ */
-
-# include "X.h"
-# include "Xproto.h"
-# include "misc.h"
-# include "pixmapstr.h"
-# include "input.h"
-# include "mi.h"
-# include "cursorstr.h"
-# include "font.h"
-# include "scrnintstr.h"
-# include "colormapst.h"
-# include "windowstr.h"
-# include "gcstruct.h"
-# include "mipointer.h"
-# include "mispritest.h"
-# include "dixfontstr.h"
-# include "fontstruct.h"
-#ifdef RENDER
-# include "mipict.h"
-#endif
-
-/*
- * screen wrappers
- */
-
-static int miSpriteScreenIndex;
-static unsigned long miSpriteGeneration = 0;
-
-static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
-static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
- int w, int h, unsigned int format,
- unsigned long planemask, char *pdstLine);
-static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax,
- DDXPointPtr ppt, int *pwidth, int nspans,
- char *pdstStart);
-static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
- int width, int height);
-static Bool miSpriteCreateGC(GCPtr pGC);
-static void miSpriteBlockHandler(int i, pointer blockData,
- pointer pTimeout,
- pointer pReadMask);
-static void miSpriteInstallColormap(ColormapPtr pMap);
-static void miSpriteStoreColors(ColormapPtr pMap, int ndef,
- xColorItem *pdef);
-
-static void miSpritePaintWindowBackground(WindowPtr pWin,
- RegionPtr pRegion, int what);
-static void miSpritePaintWindowBorder(WindowPtr pWin,
- RegionPtr pRegion, int what);
-static void miSpriteCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr pRegion);
-static void miSpriteClearToBackground(WindowPtr pWin, int x, int y,
- int w, int h,
- Bool generateExposures);
-
-#ifdef RENDER
-static void miSpriteComposite(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-static void miSpriteGlyphs(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-#endif
-
-static void miSpriteSaveDoomedAreas(WindowPtr pWin,
- RegionPtr pObscured, int dx,
- int dy);
-static RegionPtr miSpriteRestoreAreas(WindowPtr pWin, RegionPtr pRgnExposed);
-static void miSpriteComputeSaved(ScreenPtr pScreen);
-
-#define SCREEN_PROLOGUE(pScreen, field)\
- ((pScreen)->field = \
- ((miSpriteScreenPtr) (pScreen)->devPrivates[miSpriteScreenIndex].ptr)->field)
-
-#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
-
-/*
- * GC func wrappers
- */
-
-static int miSpriteGCIndex;
-
-static void miSpriteValidateGC(GCPtr pGC, unsigned long stateChanges,
- DrawablePtr pDrawable);
-static void miSpriteCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void miSpriteDestroyGC(GCPtr pGC);
-static void miSpriteChangeGC(GCPtr pGC, unsigned long mask);
-static void miSpriteChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void miSpriteDestroyClip(GCPtr pGC);
-static void miSpriteCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-static GCFuncs miSpriteGCFuncs = {
- miSpriteValidateGC,
- miSpriteChangeGC,
- miSpriteCopyGC,
- miSpriteDestroyGC,
- miSpriteChangeClip,
- miSpriteDestroyClip,
- miSpriteCopyClip,
-};
-
-#define GC_FUNC_PROLOGUE(pGC) \
- miSpriteGCPtr pGCPriv = \
- (miSpriteGCPtr) (pGC)->devPrivates[miSpriteGCIndex].ptr;\
- (pGC)->funcs = pGCPriv->wrapFuncs; \
- if (pGCPriv->wrapOps) \
- (pGC)->ops = pGCPriv->wrapOps;
-
-#define GC_FUNC_EPILOGUE(pGC) \
- pGCPriv->wrapFuncs = (pGC)->funcs; \
- (pGC)->funcs = &miSpriteGCFuncs; \
- if (pGCPriv->wrapOps) \
- { \
- pGCPriv->wrapOps = (pGC)->ops; \
- (pGC)->ops = &miSpriteGCOps; \
- }
-
-/*
- * GC op wrappers
- */
-
-static void miSpriteFillSpans(DrawablePtr pDrawable, GCPtr pGC,
- int nInit, DDXPointPtr pptInit,
- int *pwidthInit, int fSorted);
-static void miSpriteSetSpans(DrawablePtr pDrawable, GCPtr pGC,
- char *psrc, DDXPointPtr ppt, int *pwidth,
- int nspans, int fSorted);
-static void miSpritePutImage(DrawablePtr pDrawable, GCPtr pGC,
- int depth, int x, int y, int w, int h,
- int leftPad, int format, char *pBits);
-static RegionPtr miSpriteCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int w,
- int h, int dstx, int dsty);
-static RegionPtr miSpriteCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int w,
- int h, int dstx, int dsty,
- unsigned long plane);
-static void miSpritePolyPoint(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, xPoint *pptInit);
-static void miSpritePolylines(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit);
-static void miSpritePolySegment(DrawablePtr pDrawable, GCPtr pGC,
- int nseg, xSegment *pSegs);
-static void miSpritePolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
- int nrects, xRectangle *pRects);
-static void miSpritePolyArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs);
-static void miSpriteFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr pPts);
-static void miSpritePolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
- int nrectFill, xRectangle *prectInit);
-static void miSpritePolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs);
-static int miSpritePolyText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
-static int miSpritePolyText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count,
- unsigned short *chars);
-static void miSpriteImageText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
-static void miSpriteImageText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count,
- unsigned short *chars);
-static void miSpriteImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase);
-static void miSpritePolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase);
-static void miSpritePushPixels(GCPtr pGC, PixmapPtr pBitMap,
- DrawablePtr pDst, int w, int h,
- int x, int y);
-#ifdef NEED_LINEHELPER
-static void miSpriteLineHelper(void);
-#endif
-
-static GCOps miSpriteGCOps = {
- miSpriteFillSpans, miSpriteSetSpans, miSpritePutImage,
- miSpriteCopyArea, miSpriteCopyPlane, miSpritePolyPoint,
- miSpritePolylines, miSpritePolySegment, miSpritePolyRectangle,
- miSpritePolyArc, miSpriteFillPolygon, miSpritePolyFillRect,
- miSpritePolyFillArc, miSpritePolyText8, miSpritePolyText16,
- miSpriteImageText8, miSpriteImageText16, miSpriteImageGlyphBlt,
- miSpritePolyGlyphBlt, miSpritePushPixels
-#ifdef NEED_LINEHELPER
- , miSpriteLineHelper
-#endif
-};
-
-/*
- * testing only -- remove cursor for every draw. Eventually,
- * each draw operation will perform a bounding box check against
- * the saved cursor area
- */
-
-#define GC_SETUP_CHEAP(pDrawable) \
- miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr) \
- (pDrawable)->pScreen->devPrivates[miSpriteScreenIndex].ptr; \
-
-#define GC_SETUP(pDrawable, pGC) \
- GC_SETUP_CHEAP(pDrawable) \
- miSpriteGCPtr pGCPrivate = (miSpriteGCPtr) \
- (pGC)->devPrivates[miSpriteGCIndex].ptr; \
- GCFuncs *oldFuncs = pGC->funcs;
-
-#define GC_SETUP_AND_CHECK(pDrawable, pGC) \
- GC_SETUP(pDrawable, pGC); \
- if (GC_CHECK((WindowPtr)pDrawable)) \
- miSpriteRemoveCursor (pDrawable->pScreen);
-
-#define GC_CHECK(pWin) \
- (pScreenPriv->isUp && \
- (pScreenPriv->pCacheWin == pWin ? \
- pScreenPriv->isInCacheWin : ( \
- (pScreenPriv->pCacheWin = (pWin)), \
- (pScreenPriv->isInCacheWin = \
- (pWin)->drawable.x < pScreenPriv->saved.x2 && \
- pScreenPriv->saved.x1 < (pWin)->drawable.x + \
- (int) (pWin)->drawable.width && \
- (pWin)->drawable.y < pScreenPriv->saved.y2 && \
- pScreenPriv->saved.y1 < (pWin)->drawable.y + \
- (int) (pWin)->drawable.height &&\
- RECT_IN_REGION((pWin)->drawable.pScreen, &(pWin)->borderClip, \
- &pScreenPriv->saved) != rgnOUT))))
-
-#define GC_OP_PROLOGUE(pGC) { \
- (pGC)->funcs = pGCPrivate->wrapFuncs; \
- (pGC)->ops = pGCPrivate->wrapOps; \
- }
-
-#define GC_OP_EPILOGUE(pGC) { \
- pGCPrivate->wrapOps = (pGC)->ops; \
- (pGC)->funcs = oldFuncs; \
- (pGC)->ops = &miSpriteGCOps; \
- }
-
-/*
- * pointer-sprite method table
- */
-
-static Bool miSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static Bool miSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static void miSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor,
- int x, int y);
-static void miSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
-
-miPointerSpriteFuncRec miSpritePointerFuncs = {
- miSpriteRealizeCursor,
- miSpriteUnrealizeCursor,
- miSpriteSetCursor,
- miSpriteMoveCursor,
-};
-
-/*
- * other misc functions
- */
-
-static void miSpriteRemoveCursor(ScreenPtr pScreen);
-static void miSpriteRestoreCursor(ScreenPtr pScreen);
-
-/*
- * miSpriteInitialize -- called from device-dependent screen
- * initialization proc after all of the function pointers have
- * been stored in the screen structure.
- */
-
-Bool
-miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
- ScreenPtr pScreen;
- miSpriteCursorFuncPtr cursorFuncs;
- miPointerScreenFuncPtr screenFuncs;
-{
- miSpriteScreenPtr pPriv;
- VisualPtr pVisual;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- if (miSpriteGeneration != serverGeneration)
- {
- miSpriteScreenIndex = AllocateScreenPrivateIndex ();
- if (miSpriteScreenIndex < 0)
- return FALSE;
- miSpriteGeneration = serverGeneration;
- miSpriteGCIndex = AllocateGCPrivateIndex ();
- }
- if (!AllocateGCPrivate(pScreen, miSpriteGCIndex, sizeof(miSpriteGCRec)))
- return FALSE;
- pPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec));
- if (!pPriv)
- return FALSE;
- if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
- {
- xfree ((pointer) pPriv);
- return FALSE;
- }
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
- pPriv->pVisual = pVisual;
- pPriv->CloseScreen = pScreen->CloseScreen;
- pPriv->GetImage = pScreen->GetImage;
- pPriv->GetSpans = pScreen->GetSpans;
- pPriv->SourceValidate = pScreen->SourceValidate;
- pPriv->CreateGC = pScreen->CreateGC;
- pPriv->BlockHandler = pScreen->BlockHandler;
- pPriv->InstallColormap = pScreen->InstallColormap;
- pPriv->StoreColors = pScreen->StoreColors;
-
- pPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
- pPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
- pPriv->CopyWindow = pScreen->CopyWindow;
- pPriv->ClearToBackground = pScreen->ClearToBackground;
-
- pPriv->SaveDoomedAreas = pScreen->SaveDoomedAreas;
- pPriv->RestoreAreas = pScreen->RestoreAreas;
-#ifdef RENDER
- if (ps)
- {
- pPriv->Composite = ps->Composite;
- pPriv->Glyphs = ps->Glyphs;
- }
-#endif
-
- pPriv->pCursor = NULL;
- pPriv->x = 0;
- pPriv->y = 0;
- pPriv->isUp = FALSE;
- pPriv->shouldBeUp = FALSE;
- pPriv->pCacheWin = NullWindow;
- pPriv->isInCacheWin = FALSE;
- pPriv->checkPixels = TRUE;
- pPriv->pInstalledMap = NULL;
- pPriv->pColormap = NULL;
- pPriv->funcs = cursorFuncs;
- pPriv->colors[SOURCE_COLOR].red = 0;
- pPriv->colors[SOURCE_COLOR].green = 0;
- pPriv->colors[SOURCE_COLOR].blue = 0;
- pPriv->colors[MASK_COLOR].red = 0;
- pPriv->colors[MASK_COLOR].green = 0;
- pPriv->colors[MASK_COLOR].blue = 0;
- pScreen->devPrivates[miSpriteScreenIndex].ptr = (pointer) pPriv;
- pScreen->CloseScreen = miSpriteCloseScreen;
- pScreen->GetImage = miSpriteGetImage;
- pScreen->GetSpans = miSpriteGetSpans;
- pScreen->SourceValidate = miSpriteSourceValidate;
- pScreen->CreateGC = miSpriteCreateGC;
- pScreen->BlockHandler = miSpriteBlockHandler;
- pScreen->InstallColormap = miSpriteInstallColormap;
- pScreen->StoreColors = miSpriteStoreColors;
-
- pScreen->PaintWindowBackground = miSpritePaintWindowBackground;
- pScreen->PaintWindowBorder = miSpritePaintWindowBorder;
- pScreen->CopyWindow = miSpriteCopyWindow;
- pScreen->ClearToBackground = miSpriteClearToBackground;
-
- pScreen->SaveDoomedAreas = miSpriteSaveDoomedAreas;
- pScreen->RestoreAreas = miSpriteRestoreAreas;
-#ifdef RENDER
- if (ps)
- {
- ps->Composite = miSpriteComposite;
- ps->Glyphs = miSpriteGlyphs;
- }
-#endif
-
- return TRUE;
-}
-
-/*
- * Screen wrappers
- */
-
-/*
- * CloseScreen wrapper -- unwrap everything, free the private data
- * and call the wrapped function
- */
-
-static Bool
-miSpriteCloseScreen (i, pScreen)
- int i;
- ScreenPtr pScreen;
-{
- miSpriteScreenPtr pScreenPriv;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
- pScreen->GetImage = pScreenPriv->GetImage;
- pScreen->GetSpans = pScreenPriv->GetSpans;
- pScreen->SourceValidate = pScreenPriv->SourceValidate;
- pScreen->CreateGC = pScreenPriv->CreateGC;
- pScreen->BlockHandler = pScreenPriv->BlockHandler;
- pScreen->InstallColormap = pScreenPriv->InstallColormap;
- pScreen->StoreColors = pScreenPriv->StoreColors;
-
- pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
- pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
- pScreen->CopyWindow = pScreenPriv->CopyWindow;
- pScreen->ClearToBackground = pScreenPriv->ClearToBackground;
-
- pScreen->SaveDoomedAreas = pScreenPriv->SaveDoomedAreas;
- pScreen->RestoreAreas = pScreenPriv->RestoreAreas;
-#ifdef RENDER
- if (ps)
- {
- ps->Composite = pScreenPriv->Composite;
- ps->Glyphs = pScreenPriv->Glyphs;
- }
-#endif
- xfree ((pointer) pScreenPriv);
-
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void
-miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planemask;
- char *pdstLine;
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
-
- SCREEN_PROLOGUE (pScreen, GetImage);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- if (pDrawable->type == DRAWABLE_WINDOW &&
- pScreenPriv->isUp &&
- ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y, sx, sy, w, h))
- {
- miSpriteRemoveCursor (pScreen);
- }
-
- (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
- format, planemask, pdstLine);
-
- SCREEN_EPILOGUE (pScreen, GetImage, miSpriteGetImage);
-}
-
-static void
-miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
- DrawablePtr pDrawable;
- int wMax;
- DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- char *pdstStart;
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
-
- SCREEN_PROLOGUE (pScreen, GetSpans);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
- {
- register DDXPointPtr pts;
- register int *widths;
- register int nPts;
- register int xorg,
- yorg;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-
- for (pts = ppt, widths = pwidth, nPts = nspans;
- nPts--;
- pts++, widths++)
- {
- if (SPN_OVERLAP(&pScreenPriv->saved,pts->y+yorg,
- pts->x+xorg,*widths))
- {
- miSpriteRemoveCursor (pScreen);
- break;
- }
- }
- }
-
- (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
-
- SCREEN_EPILOGUE (pScreen, GetSpans, miSpriteGetSpans);
-}
-
-static void
-miSpriteSourceValidate (pDrawable, x, y, width, height)
- DrawablePtr pDrawable;
- int x, y, width, height;
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
-
- SCREEN_PROLOGUE (pScreen, SourceValidate);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp &&
- ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y,
- x, y, width, height))
- {
- miSpriteRemoveCursor (pScreen);
- }
-
- if (pScreen->SourceValidate)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height);
-
- SCREEN_EPILOGUE (pScreen, SourceValidate, miSpriteSourceValidate);
-}
-
-static Bool
-miSpriteCreateGC (pGC)
- GCPtr pGC;
-{
- ScreenPtr pScreen = pGC->pScreen;
- Bool ret;
- miSpriteGCPtr pPriv;
-
- SCREEN_PROLOGUE (pScreen, CreateGC);
-
- pPriv = (miSpriteGCPtr)pGC->devPrivates[miSpriteGCIndex].ptr;
-
- ret = (*pScreen->CreateGC) (pGC);
-
- pPriv->wrapOps = NULL;
- pPriv->wrapFuncs = pGC->funcs;
- pGC->funcs = &miSpriteGCFuncs;
-
- SCREEN_EPILOGUE (pScreen, CreateGC, miSpriteCreateGC);
-
- return ret;
-}
-
-static void
-miSpriteBlockHandler (i, blockData, pTimeout, pReadmask)
- int i;
- pointer blockData;
- pointer pTimeout;
- pointer pReadmask;
-{
- ScreenPtr pScreen = screenInfo.screens[i];
- miSpriteScreenPtr pPriv;
-
- pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- SCREEN_PROLOGUE(pScreen, BlockHandler);
-
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
-
- SCREEN_EPILOGUE(pScreen, BlockHandler, miSpriteBlockHandler);
-
- if (!pPriv->isUp && pPriv->shouldBeUp)
- miSpriteRestoreCursor (pScreen);
-}
-
-static void
-miSpriteInstallColormap (pMap)
- ColormapPtr pMap;
-{
- ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv;
-
- pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- SCREEN_PROLOGUE(pScreen, InstallColormap);
-
- (*pScreen->InstallColormap) (pMap);
-
- SCREEN_EPILOGUE(pScreen, InstallColormap, miSpriteInstallColormap);
-
- pPriv->pInstalledMap = pMap;
- if (pPriv->pColormap != pMap)
- {
- pPriv->checkPixels = TRUE;
- if (pPriv->isUp)
- miSpriteRemoveCursor (pScreen);
- }
-}
-
-static void
-miSpriteStoreColors (pMap, ndef, pdef)
- ColormapPtr pMap;
- int ndef;
- xColorItem *pdef;
-{
- ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv;
- int i;
- int updated;
- VisualPtr pVisual;
-
- pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
-
- SCREEN_PROLOGUE(pScreen, StoreColors);
-
- (*pScreen->StoreColors) (pMap, ndef, pdef);
-
- SCREEN_EPILOGUE(pScreen, StoreColors, miSpriteStoreColors);
-
- if (pPriv->pColormap == pMap)
- {
- updated = 0;
- pVisual = pMap->pVisual;
- if (pVisual->class == DirectColor)
- {
- /* Direct color - match on any of the subfields */
-
-#define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask)))
-
-#define UpdateDAC(plane,dac,mask) {\
- if (MaskMatch (pPriv->colors[plane].pixel,pdef[i].pixel,mask)) {\
- pPriv->colors[plane].dac = pdef[i].dac; \
- updated = 1; \
- } \
-}
-
-#define CheckDirect(plane) \
- UpdateDAC(plane,red,redMask) \
- UpdateDAC(plane,green,greenMask) \
- UpdateDAC(plane,blue,blueMask)
-
- for (i = 0; i < ndef; i++)
- {
- CheckDirect (SOURCE_COLOR)
- CheckDirect (MASK_COLOR)
- }
- }
- else
- {
- /* PseudoColor/GrayScale - match on exact pixel */
- for (i = 0; i < ndef; i++)
- {
- if (pdef[i].pixel == pPriv->colors[SOURCE_COLOR].pixel)
- {
- pPriv->colors[SOURCE_COLOR] = pdef[i];
- if (++updated == 2)
- break;
- }
- if (pdef[i].pixel == pPriv->colors[MASK_COLOR].pixel)
- {
- pPriv->colors[MASK_COLOR] = pdef[i];
- if (++updated == 2)
- break;
- }
- }
- }
- if (updated)
- {
- pPriv->checkPixels = TRUE;
- if (pPriv->isUp)
- miSpriteRemoveCursor (pScreen);
- }
- }
-}
-
-static void
-miSpriteFindColors (ScreenPtr pScreen)
-{
- miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr)
- pScreen->devPrivates[miSpriteScreenIndex].ptr;
- CursorPtr pCursor;
- xColorItem *sourceColor, *maskColor;
-
- pCursor = pScreenPriv->pCursor;
- sourceColor = &pScreenPriv->colors[SOURCE_COLOR];
- maskColor = &pScreenPriv->colors[MASK_COLOR];
- if (pScreenPriv->pColormap != pScreenPriv->pInstalledMap ||
- !(pCursor->foreRed == sourceColor->red &&
- pCursor->foreGreen == sourceColor->green &&
- pCursor->foreBlue == sourceColor->blue &&
- pCursor->backRed == maskColor->red &&
- pCursor->backGreen == maskColor->green &&
- pCursor->backBlue == maskColor->blue))
- {
- pScreenPriv->pColormap = pScreenPriv->pInstalledMap;
- sourceColor->red = pCursor->foreRed;
- sourceColor->green = pCursor->foreGreen;
- sourceColor->blue = pCursor->foreBlue;
- FakeAllocColor (pScreenPriv->pColormap, sourceColor);
- maskColor->red = pCursor->backRed;
- maskColor->green = pCursor->backGreen;
- maskColor->blue = pCursor->backBlue;
- FakeAllocColor (pScreenPriv->pColormap, maskColor);
- /* "free" the pixels right away, don't let this confuse you */
- FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel);
- FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel);
- }
- pScreenPriv->checkPixels = FALSE;
-}
-
-/*
- * BackingStore wrappers
- */
-
-static void
-miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
- WindowPtr pWin;
- RegionPtr pObscured;
- int dx, dy;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
- BoxRec cursorBox;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, SaveDoomedAreas);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->isUp)
- {
- cursorBox = pScreenPriv->saved;
-
- if (dx || dy)
- {
- cursorBox.x1 += dx;
- cursorBox.y1 += dy;
- cursorBox.x2 += dx;
- cursorBox.y2 += dy;
- }
- if (RECT_IN_REGION( pScreen, pObscured, &cursorBox) != rgnOUT)
- miSpriteRemoveCursor (pScreen);
- }
-
- (*pScreen->SaveDoomedAreas) (pWin, pObscured, dx, dy);
-
- SCREEN_EPILOGUE (pScreen, SaveDoomedAreas, miSpriteSaveDoomedAreas);
-}
-
-static RegionPtr
-miSpriteRestoreAreas (pWin, prgnExposed)
- WindowPtr pWin;
- RegionPtr prgnExposed;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
- RegionPtr result;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, RestoreAreas);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->isUp)
- {
- if (RECT_IN_REGION( pScreen, prgnExposed, &pScreenPriv->saved) != rgnOUT)
- miSpriteRemoveCursor (pScreen);
- }
-
- result = (*pScreen->RestoreAreas) (pWin, prgnExposed);
-
- SCREEN_EPILOGUE (pScreen, RestoreAreas, miSpriteRestoreAreas);
-
- return result;
-}
-
-/*
- * Window wrappers
- */
-
-static void
-miSpritePaintWindowBackground (pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->isUp)
- {
- /*
- * If the cursor is on the same screen as the window, check the
- * region to paint for the cursor and remove it as necessary
- */
- if (RECT_IN_REGION( pScreen, pRegion, &pScreenPriv->saved) != rgnOUT)
- miSpriteRemoveCursor (pScreen);
- }
-
- (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
-
- SCREEN_EPILOGUE (pScreen, PaintWindowBackground, miSpritePaintWindowBackground);
-}
-
-static void
-miSpritePaintWindowBorder (pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->isUp)
- {
- /*
- * If the cursor is on the same screen as the window, check the
- * region to paint for the cursor and remove it as necessary
- */
- if (RECT_IN_REGION( pScreen, pRegion, &pScreenPriv->saved) != rgnOUT)
- miSpriteRemoveCursor (pScreen);
- }
-
- (*pScreen->PaintWindowBorder) (pWin, pRegion, what);
-
- SCREEN_EPILOGUE (pScreen, PaintWindowBorder, miSpritePaintWindowBorder);
-}
-
-static void
-miSpriteCopyWindow (pWin, ptOldOrg, pRegion)
- WindowPtr pWin;
- DDXPointRec ptOldOrg;
- RegionPtr pRegion;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
- BoxRec cursorBox;
- int dx, dy;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, CopyWindow);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pScreenPriv->isUp)
- {
- /*
- * check both the source and the destination areas. The given
- * region is source relative, so offset the cursor box by
- * the delta position
- */
- cursorBox = pScreenPriv->saved;
- dx = pWin->drawable.x - ptOldOrg.x;
- dy = pWin->drawable.y - ptOldOrg.y;
- cursorBox.x1 -= dx;
- cursorBox.x2 -= dx;
- cursorBox.y1 -= dy;
- cursorBox.y2 -= dy;
- if (RECT_IN_REGION( pScreen, pRegion, &pScreenPriv->saved) != rgnOUT ||
- RECT_IN_REGION( pScreen, pRegion, &cursorBox) != rgnOUT)
- miSpriteRemoveCursor (pScreen);
- }
-
- (*pScreen->CopyWindow) (pWin, ptOldOrg, pRegion);
-
- SCREEN_EPILOGUE (pScreen, CopyWindow, miSpriteCopyWindow);
-}
-
-static void
-miSpriteClearToBackground (pWin, x, y, w, h, generateExposures)
- WindowPtr pWin;
- int x,y;
- int w,h;
- Bool generateExposures;
-{
- ScreenPtr pScreen;
- miSpriteScreenPtr pScreenPriv;
- int realw, realh;
-
- pScreen = pWin->drawable.pScreen;
-
- SCREEN_PROLOGUE (pScreen, ClearToBackground);
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (GC_CHECK(pWin))
- {
- if (!(realw = w))
- realw = (int) pWin->drawable.width - x;
- if (!(realh = h))
- realh = (int) pWin->drawable.height - y;
- if (ORG_OVERLAP(&pScreenPriv->saved, pWin->drawable.x, pWin->drawable.y,
- x, y, realw, realh))
- {
- miSpriteRemoveCursor (pScreen);
- }
- }
-
- (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
-
- SCREEN_EPILOGUE (pScreen, ClearToBackground, miSpriteClearToBackground);
-}
-
-/*
- * GC Func wrappers
- */
-
-static void
-miSpriteValidateGC (pGC, changes, pDrawable)
- GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
-{
- GC_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable);
-
- pGCPriv->wrapOps = NULL;
- if (pDrawable->type == DRAWABLE_WINDOW && ((WindowPtr) pDrawable)->viewable)
- {
- WindowPtr pWin;
- RegionPtr pRegion;
-
- pWin = (WindowPtr) pDrawable;
- pRegion = &pWin->clipList;
- if (pGC->subWindowMode == IncludeInferiors)
- pRegion = &pWin->borderClip;
- if (REGION_NOTEMPTY(pDrawable->pScreen, pRegion))
- pGCPriv->wrapOps = pGC->ops;
- }
-
- GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miSpriteChangeGC (pGC, mask)
- GCPtr pGC;
- unsigned long mask;
-{
- GC_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->ChangeGC) (pGC, mask);
-
- GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miSpriteCopyGC (pGCSrc, mask, pGCDst)
- GCPtr pGCSrc, pGCDst;
- unsigned long mask;
-{
- GC_FUNC_PROLOGUE (pGCDst);
-
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
-
- GC_FUNC_EPILOGUE (pGCDst);
-}
-
-static void
-miSpriteDestroyGC (pGC)
- GCPtr pGC;
-{
- GC_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->DestroyGC) (pGC);
-
- GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miSpriteChangeClip (pGC, type, pvalue, nrects)
- GCPtr pGC;
- int type;
- pointer pvalue;
- int nrects;
-{
- GC_FUNC_PROLOGUE (pGC);
-
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-
- GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-miSpriteCopyClip(pgcDst, pgcSrc)
- GCPtr pgcDst, pgcSrc;
-{
- GC_FUNC_PROLOGUE (pgcDst);
-
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-
- GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-miSpriteDestroyClip(pGC)
- GCPtr pGC;
-{
- GC_FUNC_PROLOGUE (pGC);
-
- (* pGC->funcs->DestroyClip)(pGC);
-
- GC_FUNC_EPILOGUE (pGC);
-}
-
-/*
- * GC Op wrappers
- */
-
-static void
-miSpriteFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nInit; /* number of spans to fill */
- DDXPointPtr pptInit; /* pointer to list of start points */
- int *pwidthInit; /* pointer to list of n widths */
- int fSorted;
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- register DDXPointPtr pts;
- register int *widths;
- register int nPts;
-
- for (pts = pptInit, widths = pwidthInit, nPts = nInit;
- nPts--;
- pts++, widths++)
- {
- if (SPN_OVERLAP(&pScreenPriv->saved,pts->y,pts->x,*widths))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->FillSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpriteSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- char *psrc;
- register DDXPointPtr ppt;
- int *pwidth;
- int nspans;
- int fSorted;
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- register DDXPointPtr pts;
- register int *widths;
- register int nPts;
-
- for (pts = ppt, widths = pwidth, nPts = nspans;
- nPts--;
- pts++, widths++)
- {
- if (SPN_OVERLAP(&pScreenPriv->saved,pts->y,pts->x,*widths))
- {
- miSpriteRemoveCursor(pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->SetSpans) (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pBits)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int depth;
- int x;
- int y;
- int w;
- int h;
- int leftPad;
- int format;
- char *pBits;
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- if (ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y,
- x,y,w,h))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format, pBits);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static RegionPtr
-miSpriteCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty)
- DrawablePtr pSrc;
- DrawablePtr pDst;
- GCPtr pGC;
- int srcx;
- int srcy;
- int w;
- int h;
- int dstx;
- int dsty;
-{
- RegionPtr rgn;
-
- GC_SETUP(pDst, pGC);
-
- /* check destination/source overlap. */
- if (GC_CHECK((WindowPtr) pDst) &&
- (ORG_OVERLAP(&pScreenPriv->saved,pDst->x,pDst->y,dstx,dsty,w,h) ||
- ((pDst == pSrc) &&
- ORG_OVERLAP(&pScreenPriv->saved,pSrc->x,pSrc->y,srcx,srcy,w,h))))
- {
- miSpriteRemoveCursor (pDst->pScreen);
- }
-
- GC_OP_PROLOGUE (pGC);
-
- rgn = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty);
-
- GC_OP_EPILOGUE (pGC);
-
- return rgn;
-}
-
-static RegionPtr
-miSpriteCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane)
- DrawablePtr pSrc;
- DrawablePtr pDst;
- register GCPtr pGC;
- int srcx,
- srcy;
- int w,
- h;
- int dstx,
- dsty;
- unsigned long plane;
-{
- RegionPtr rgn;
-
- GC_SETUP(pDst, pGC);
-
- /*
- * check destination/source for overlap.
- */
- if (GC_CHECK((WindowPtr) pDst) &&
- (ORG_OVERLAP(&pScreenPriv->saved,pDst->x,pDst->y,dstx,dsty,w,h) ||
- ((pDst == pSrc) &&
- ORG_OVERLAP(&pScreenPriv->saved,pSrc->x,pSrc->y,srcx,srcy,w,h))))
- {
- miSpriteRemoveCursor (pDst->pScreen);
- }
-
- GC_OP_PROLOGUE (pGC);
-
- rgn = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, plane);
-
- GC_OP_EPILOGUE (pGC);
-
- return rgn;
-}
-
-static void
-miSpritePolyPoint (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt;
- xPoint *pptInit;
-{
- xPoint t;
- int n;
- BoxRec cursor;
- register xPoint *pts;
-
- GC_SETUP (pDrawable, pGC);
-
- if (npt && GC_CHECK((WindowPtr) pDrawable))
- {
- cursor.x1 = pScreenPriv->saved.x1 - pDrawable->x;
- cursor.y1 = pScreenPriv->saved.y1 - pDrawable->y;
- cursor.x2 = pScreenPriv->saved.x2 - pDrawable->x;
- cursor.y2 = pScreenPriv->saved.y2 - pDrawable->y;
-
- if (mode == CoordModePrevious)
- {
- t.x = 0;
- t.y = 0;
- for (pts = pptInit, n = npt; n--; pts++)
- {
- t.x += pts->x;
- t.y += pts->y;
- if (cursor.x1 <= t.x && t.x <= cursor.x2 &&
- cursor.y1 <= t.y && t.y <= cursor.y2)
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
- else
- {
- for (pts = pptInit, n = npt; n--; pts++)
- {
- if (cursor.x1 <= pts->x && pts->x <= cursor.x2 &&
- cursor.y1 <= pts->y && pts->y <= cursor.y2)
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pptInit);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolylines (pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- DDXPointPtr pptInit;
-{
- BoxPtr cursor;
- register DDXPointPtr pts;
- int n;
- int x, y, x1, y1, x2, y2;
- int lw;
- int extra;
-
- GC_SETUP (pDrawable, pGC);
-
- if (npt && GC_CHECK((WindowPtr) pDrawable))
- {
- cursor = &pScreenPriv->saved;
- lw = pGC->lineWidth;
- x = pptInit->x + pDrawable->x;
- y = pptInit->y + pDrawable->y;
-
- if (npt == 1)
- {
- extra = lw >> 1;
- if (LINE_OVERLAP(cursor, x, y, x, y, extra))
- miSpriteRemoveCursor (pDrawable->pScreen);
- }
- else
- {
- extra = lw >> 1;
- /*
- * mitered joins can project quite a way from
- * the line end; the 11 degree miter limit limits
- * this extension to 10.43 * lw / 2, rounded up
- * and converted to int yields 6 * lw
- */
- if (pGC->joinStyle == JoinMiter)
- extra = 6 * lw;
- else if (pGC->capStyle == CapProjecting)
- extra = lw;
- for (pts = pptInit + 1, n = npt - 1; n--; pts++)
- {
- x1 = x;
- y1 = y;
- if (mode == CoordModeOrigin)
- {
- x2 = pDrawable->x + pts->x;
- y2 = pDrawable->y + pts->y;
- }
- else
- {
- x2 = x + pts->x;
- y2 = y + pts->y;
- }
- x = x2;
- y = y2;
- LINE_SORT(x1, y1, x2, y2);
- if (LINE_OVERLAP(cursor, x1, y1, x2, y2, extra))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
- }
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, pptInit);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolySegment(pDrawable, pGC, nseg, pSegs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nseg;
- xSegment *pSegs;
-{
- int n;
- register xSegment *segs;
- BoxPtr cursor;
- int x1, y1, x2, y2;
- int extra;
-
- GC_SETUP(pDrawable, pGC);
-
- if (nseg && GC_CHECK((WindowPtr) pDrawable))
- {
- cursor = &pScreenPriv->saved;
- extra = pGC->lineWidth >> 1;
- if (pGC->capStyle == CapProjecting)
- extra = pGC->lineWidth;
- for (segs = pSegs, n = nseg; n--; segs++)
- {
- x1 = segs->x1 + pDrawable->x;
- y1 = segs->y1 + pDrawable->y;
- x2 = segs->x2 + pDrawable->x;
- y2 = segs->y2 + pDrawable->y;
- LINE_SORT(x1, y1, x2, y2);
- if (LINE_OVERLAP(cursor, x1, y1, x2, y2, extra))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolySegment) (pDrawable, pGC, nseg, pSegs);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolyRectangle(pDrawable, pGC, nrects, pRects)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- register xRectangle *rects;
- BoxPtr cursor;
- int lw;
- int n;
- int x1, y1, x2, y2;
-
- GC_SETUP (pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- lw = pGC->lineWidth >> 1;
- cursor = &pScreenPriv->saved;
- for (rects = pRects, n = nrects; n--; rects++)
- {
- x1 = rects->x + pDrawable->x;
- y1 = rects->y + pDrawable->y;
- x2 = x1 + (int)rects->width;
- y2 = y1 + (int)rects->height;
- if (LINE_OVERLAP(cursor, x1, y1, x2, y1, lw) ||
- LINE_OVERLAP(cursor, x2, y1, x2, y2, lw) ||
- LINE_OVERLAP(cursor, x1, y2, x2, y2, lw) ||
- LINE_OVERLAP(cursor, x1, y1, x1, y2, lw))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolyRectangle) (pDrawable, pGC, nrects, pRects);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolyArc(pDrawable, pGC, narcs, parcs)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- BoxPtr cursor;
- int lw;
- int n;
- register xArc *arcs;
-
- GC_SETUP (pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- lw = pGC->lineWidth >> 1;
- cursor = &pScreenPriv->saved;
- for (arcs = parcs, n = narcs; n--; arcs++)
- {
- if (ORG_OVERLAP (cursor, pDrawable->x, pDrawable->y,
- arcs->x - lw, arcs->y - lw,
- (int) arcs->width + pGC->lineWidth,
- (int) arcs->height + pGC->lineWidth))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolyArc) (pDrawable, pGC, narcs, parcs);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpriteFillPolygon(pDrawable, pGC, shape, mode, count, pPts)
- register DrawablePtr pDrawable;
- register GCPtr pGC;
- int shape, mode;
- int count;
- DDXPointPtr pPts;
-{
- int x, y, minx, miny, maxx, maxy;
- register DDXPointPtr pts;
- int n;
-
- GC_SETUP (pDrawable, pGC);
-
- if (count && GC_CHECK((WindowPtr) pDrawable))
- {
- x = pDrawable->x;
- y = pDrawable->y;
- pts = pPts;
- minx = maxx = pts->x;
- miny = maxy = pts->y;
- pts++;
- n = count - 1;
-
- if (mode == CoordModeOrigin)
- {
- for (; n--; pts++)
- {
- if (pts->x < minx)
- minx = pts->x;
- else if (pts->x > maxx)
- maxx = pts->x;
- if (pts->y < miny)
- miny = pts->y;
- else if (pts->y > maxy)
- maxy = pts->y;
- }
- minx += x;
- miny += y;
- maxx += x;
- maxy += y;
- }
- else
- {
- x += minx;
- y += miny;
- minx = maxx = x;
- miny = maxy = y;
- for (; n--; pts++)
- {
- x += pts->x;
- y += pts->y;
- if (x < minx)
- minx = x;
- else if (x > maxx)
- maxx = x;
- if (y < miny)
- miny = y;
- else if (y > maxy)
- maxy = y;
- }
- }
- if (BOX_OVERLAP(&pScreenPriv->saved,minx,miny,maxx,maxy))
- miSpriteRemoveCursor (pDrawable->pScreen);
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, count, pPts);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolyFillRect(pDrawable, pGC, nrectFill, prectInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nrectFill; /* number of rectangles to fill */
- xRectangle *prectInit; /* Pointer to first rectangle to fill */
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- register int nRect;
- register xRectangle *pRect;
- register int xorg, yorg;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-
- for (nRect = nrectFill, pRect = prectInit; nRect--; pRect++) {
- if (ORGRECT_OVERLAP(&pScreenPriv->saved,xorg,yorg,pRect)){
- miSpriteRemoveCursor(pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, nrectFill, prectInit);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolyFillArc(pDrawable, pGC, narcs, parcs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- {
- register int n;
- BoxPtr cursor;
- register xArc *arcs;
-
- cursor = &pScreenPriv->saved;
-
- for (arcs = parcs, n = narcs; n--; arcs++)
- {
- if (ORG_OVERLAP(cursor, pDrawable->x, pDrawable->y,
- arcs->x, arcs->y,
- (int) arcs->width, (int) arcs->height))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- break;
- }
- }
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PolyFillArc) (pDrawable, pGC, narcs, parcs);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-/*
- * general Poly/Image text function. Extract glyph information,
- * compute bounding box and remove cursor if it is overlapped.
- */
-
-static Bool
-miSpriteTextOverlap (
- DrawablePtr pDraw,
- FontPtr font,
- int x,
- int y,
- unsigned int n,
- CharInfoPtr *charinfo,
- Bool imageblt,
- unsigned int w,
- BoxPtr cursorBox)
-{
- ExtentInfoRec extents;
-
- x += pDraw->x;
- y += pDraw->y;
-
- if (FONTMINBOUNDS(font,characterWidth) >= 0)
- {
- /* compute an approximate (but covering) bounding box */
- if (!imageblt || (charinfo[0]->metrics.leftSideBearing < 0))
- extents.overallLeft = charinfo[0]->metrics.leftSideBearing;
- else
- extents.overallLeft = 0;
- if (w)
- extents.overallRight = w - charinfo[n-1]->metrics.characterWidth;
- else
- extents.overallRight = FONTMAXBOUNDS(font,characterWidth)
- * (n - 1);
- if (imageblt && (charinfo[n-1]->metrics.characterWidth >
- charinfo[n-1]->metrics.rightSideBearing))
- extents.overallRight += charinfo[n-1]->metrics.characterWidth;
- else
- extents.overallRight += charinfo[n-1]->metrics.rightSideBearing;
- if (imageblt && FONTASCENT(font) > FONTMAXBOUNDS(font,ascent))
- extents.overallAscent = FONTASCENT(font);
- else
- extents.overallAscent = FONTMAXBOUNDS(font, ascent);
- if (imageblt && FONTDESCENT(font) > FONTMAXBOUNDS(font,descent))
- extents.overallDescent = FONTDESCENT(font);
- else
- extents.overallDescent = FONTMAXBOUNDS(font,descent);
- if (!BOX_OVERLAP(cursorBox,
- x + extents.overallLeft,
- y - extents.overallAscent,
- x + extents.overallRight,
- y + extents.overallDescent))
- return FALSE;
- else if (imageblt && w)
- return TRUE;
- /* if it does overlap, fall through and compute exactly, because
- * taking down the cursor is expensive enough to make this worth it
- */
- }
- QueryGlyphExtents(font, charinfo, n, &extents);
- if (imageblt)
- {
- if (extents.overallWidth > extents.overallRight)
- extents.overallRight = extents.overallWidth;
- if (extents.overallWidth < extents.overallLeft)
- extents.overallLeft = extents.overallWidth;
- if (extents.overallLeft > 0)
- extents.overallLeft = 0;
- if (extents.fontAscent > extents.overallAscent)
- extents.overallAscent = extents.fontAscent;
- if (extents.fontDescent > extents.overallDescent)
- extents.overallDescent = extents.fontDescent;
- }
- return (BOX_OVERLAP(cursorBox,
- x + extents.overallLeft,
- y - extents.overallAscent,
- x + extents.overallRight,
- y + extents.overallDescent));
-}
-
-/*
- * values for textType:
- */
-#define TT_POLY8 0
-#define TT_IMAGE8 1
-#define TT_POLY16 2
-#define TT_IMAGE16 3
-
-static int
-miSpriteText (
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- unsigned long count,
- char *chars,
- FontEncoding fontEncoding,
- Bool textType,
- BoxPtr cursorBox)
-{
- CharInfoPtr *charinfo;
- register CharInfoPtr *info;
- unsigned long i;
- unsigned int n;
- int w;
-
- Bool imageblt;
-
- imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
-
- charinfo = (CharInfoPtr *) ALLOCATE_LOCAL(count * sizeof(CharInfoPtr));
- if (!charinfo)
- return x;
-
- GetGlyphs(pGC->font, count, (unsigned char *)chars,
- fontEncoding, &i, charinfo);
- n = (unsigned int)i;
- w = 0;
- if (!imageblt)
- for (info = charinfo; i--; info++)
- w += (*info)->metrics.characterWidth;
-
- if (n != 0) {
- if (miSpriteTextOverlap(pDraw, pGC->font, x, y, n, charinfo, imageblt, w, cursorBox))
- miSpriteRemoveCursor(pDraw->pScreen);
-
-#ifdef AVOID_GLYPHBLT
- /*
- * On displays like Apollos, which do not optimize the GlyphBlt functions because they
- * convert fonts to their internal form in RealizeFont and optimize text directly, we
- * want to invoke the text functions here, not the GlyphBlt functions.
- */
- switch (textType)
- {
- case TT_POLY8:
- (*pGC->ops->PolyText8)(pDraw, pGC, x, y, (int)count, chars);
- break;
- case TT_IMAGE8:
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, (int)count, chars);
- break;
- case TT_POLY16:
- (*pGC->ops->PolyText16)(pDraw, pGC, x, y, (int)count,
- (unsigned short *)chars);
- break;
- case TT_IMAGE16:
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, (int)count,
- (unsigned short *)chars);
- break;
- }
-#else /* don't AVOID_GLYPHBLT */
- /*
- * On the other hand, if the device does use GlyphBlt ultimately to do text, we
- * don't want to slow it down by invoking the text functions and having them call
- * GetGlyphs all over again, so we go directly to the GlyphBlt functions here.
- */
- if (imageblt) {
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo,
- FONTGLYPHS(pGC->font));
- } else {
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, n, charinfo,
- FONTGLYPHS(pGC->font));
- }
-#endif /* AVOID_GLYPHBLT */
- }
- DEALLOCATE_LOCAL(charinfo);
- return x + w;
-}
-
-static int
-miSpritePolyText8(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- int ret;
-
- GC_SETUP (pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- ret = miSpriteText (pDrawable, pGC, x, y, (unsigned long)count, chars,
- Linear8Bit, TT_POLY8, &pScreenPriv->saved);
- else
- ret = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
-
- GC_OP_EPILOGUE (pGC);
- return ret;
-}
-
-static int
-miSpritePolyText16(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- int ret;
-
- GC_SETUP(pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- ret = miSpriteText (pDrawable, pGC, x, y, (unsigned long)count,
- (char *)chars,
- FONTLASTROW(pGC->font) == 0 ?
- Linear16Bit : TwoD16Bit, TT_POLY16, &pScreenPriv->saved);
- else
- ret = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
-
- GC_OP_EPILOGUE (pGC);
- return ret;
-}
-
-static void
-miSpriteImageText8(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
-{
- GC_SETUP(pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- (void) miSpriteText (pDrawable, pGC, x, y, (unsigned long)count,
- chars, Linear8Bit, TT_IMAGE8, &pScreenPriv->saved);
- else
- (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpriteImageText16(pDrawable, pGC, x, y, count, chars)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- unsigned short *chars;
-{
- GC_SETUP(pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable))
- (void) miSpriteText (pDrawable, pGC, x, y, (unsigned long)count,
- (char *)chars,
- FONTLASTROW(pGC->font) == 0 ?
- Linear16Bit : TwoD16Bit, TT_IMAGE16, &pScreenPriv->saved);
- else
- (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpriteImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- GC_SETUP(pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable) &&
- miSpriteTextOverlap (pDrawable, pGC->font, x, y, nglyph, ppci, TRUE, 0, &pScreenPriv->saved))
- {
- miSpriteRemoveCursor(pDrawable->pScreen);
- }
- (*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- pointer pglyphBase; /* start of array of glyphs */
-{
- GC_SETUP (pDrawable, pGC);
-
- GC_OP_PROLOGUE (pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable) &&
- miSpriteTextOverlap (pDrawable, pGC->font, x, y, nglyph, ppci, FALSE, 0, &pScreenPriv->saved))
- {
- miSpriteRemoveCursor(pDrawable->pScreen);
- }
- (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-static void
-miSpritePushPixels(pGC, pBitMap, pDrawable, w, h, x, y)
- GCPtr pGC;
- PixmapPtr pBitMap;
- DrawablePtr pDrawable;
- int w, h, x, y;
-{
- GC_SETUP(pDrawable, pGC);
-
- if (GC_CHECK((WindowPtr) pDrawable) &&
- ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y,x,y,w,h))
- {
- miSpriteRemoveCursor (pDrawable->pScreen);
- }
-
- GC_OP_PROLOGUE (pGC);
-
- (*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, w, h, x, y);
-
- GC_OP_EPILOGUE (pGC);
-}
-
-#ifdef NEED_LINEHELPER
-/*
- * I don't expect this routine will ever be called, as the GC
- * will have been unwrapped for the line drawing
- */
-
-static void
-miSpriteLineHelper()
-{
- FatalError("miSpriteLineHelper called\n");
-}
-#endif
-
-#ifdef RENDER
-
-# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-static void
-miSpritePictureOverlap (PicturePtr pPict,
- INT16 x,
- INT16 y,
- CARD16 w,
- CARD16 h)
-{
- if (pPict->pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) (pPict->pDrawable);
- miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr)
- pPict->pDrawable->pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (GC_CHECK(pWin))
- {
- if (pPict->repeat)
- {
- x = mod(x,pWin->drawable.width);
- y = mod(y,pWin->drawable.height);
- }
- if (ORG_OVERLAP (&pScreenPriv->saved, pWin->drawable.x, pWin->drawable.y,
- x, y, w, h))
- miSpriteRemoveCursor (pWin->drawable.pScreen);
- }
- }
-}
-
-#define PICTURE_PROLOGUE(ps, pScreenPriv, field) \
- ps->field = pScreenPriv->field
-
-#define PICTURE_EPILOGUE(ps, field, wrap) \
- ps->field = wrap
-
-static void
-miSpriteComposite(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- PICTURE_PROLOGUE(ps, pScreenPriv, Composite);
- miSpritePictureOverlap (pSrc, xSrc, ySrc, width, height);
- if (pMask)
- miSpritePictureOverlap (pMask, xMask, yMask, width, height);
- miSpritePictureOverlap (pDst, xDst, yDst, width, height);
-
- (*ps->Composite) (op,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height);
-
- PICTURE_EPILOGUE(ps, Composite, miSpriteComposite);
-}
-
-static void
-miSpriteGlyphs(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- PICTURE_PROLOGUE(ps, pScreenPriv, Glyphs);
- if (pSrc->pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pSrcWin = (WindowPtr) (pSrc->pDrawable);
-
- if (GC_CHECK(pSrcWin))
- miSpriteRemoveCursor (pScreen);
- }
- if (pDst->pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pDstWin = (WindowPtr) (pDst->pDrawable);
-
- if (GC_CHECK(pDstWin))
- {
- BoxRec extents;
-
- miGlyphExtents (nlist, list, glyphs, &extents);
- if (BOX_OVERLAP(&pScreenPriv->saved,
- extents.x1 + pDstWin->drawable.x,
- extents.y1 + pDstWin->drawable.y,
- extents.x2 + pDstWin->drawable.x,
- extents.y2 + pDstWin->drawable.y))
- {
- miSpriteRemoveCursor (pScreen);
- }
- }
- }
-
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
-
- PICTURE_EPILOGUE (ps, Glyphs, miSpriteGlyphs);
-}
-#endif
-
-/*
- * miPointer interface routines
- */
-
-#define SPRITE_PAD 8
-
-static Bool
-miSpriteRealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (pCursor == pScreenPriv->pCursor)
- pScreenPriv->checkPixels = TRUE;
- return (*pScreenPriv->funcs->RealizeCursor) (pScreen, pCursor);
-}
-
-static Bool
-miSpriteUnrealizeCursor (pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
-{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor);
-}
-
-static void
-miSpriteSetCursor (pScreen, pCursor, x, y)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- int x;
- int y;
-{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- if (!pCursor)
- {
- pScreenPriv->shouldBeUp = FALSE;
- if (pScreenPriv->isUp)
- miSpriteRemoveCursor (pScreen);
- pScreenPriv->pCursor = 0;
- return;
- }
- pScreenPriv->shouldBeUp = TRUE;
- if (pScreenPriv->x == x &&
- pScreenPriv->y == y &&
- pScreenPriv->pCursor == pCursor &&
- !pScreenPriv->checkPixels)
- {
- return;
- }
- pScreenPriv->x = x;
- pScreenPriv->y = y;
- pScreenPriv->pCacheWin = NullWindow;
- if (pScreenPriv->checkPixels || pScreenPriv->pCursor != pCursor)
- {
- pScreenPriv->pCursor = pCursor;
- miSpriteFindColors (pScreen);
- }
- if (pScreenPriv->isUp) {
- int sx, sy;
- /*
- * check to see if the old saved region
- * encloses the new sprite, in which case we use
- * the flicker-free MoveCursor primitive.
- */
- sx = pScreenPriv->x - (int)pCursor->bits->xhot;
- sy = pScreenPriv->y - (int)pCursor->bits->yhot;
- if (sx + (int) pCursor->bits->width >= pScreenPriv->saved.x1 &&
- sx < pScreenPriv->saved.x2 &&
- sy + (int) pCursor->bits->height >= pScreenPriv->saved.y1 &&
- sy < pScreenPriv->saved.y2 &&
- (int) pCursor->bits->width + (2 * SPRITE_PAD) ==
- pScreenPriv->saved.x2 - pScreenPriv->saved.x1 &&
- (int) pCursor->bits->height + (2 * SPRITE_PAD) ==
- pScreenPriv->saved.y2 - pScreenPriv->saved.y1
- )
- {
- pScreenPriv->isUp = FALSE;
- if (!(sx >= pScreenPriv->saved.x1 &&
- sx + (int)pCursor->bits->width < pScreenPriv->saved.x2 &&
- sy >= pScreenPriv->saved.y1 &&
- sy + (int)pCursor->bits->height < pScreenPriv->saved.y2))
- {
- int oldx1, oldy1, dx, dy;
-
- oldx1 = pScreenPriv->saved.x1;
- oldy1 = pScreenPriv->saved.y1;
- dx = oldx1 - (sx - SPRITE_PAD);
- dy = oldy1 - (sy - SPRITE_PAD);
- pScreenPriv->saved.x1 -= dx;
- pScreenPriv->saved.y1 -= dy;
- pScreenPriv->saved.x2 -= dx;
- pScreenPriv->saved.y2 -= dy;
- (void) (*pScreenPriv->funcs->ChangeSave) (pScreen,
- pScreenPriv->saved.x1,
- pScreenPriv->saved.y1,
- pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
- pScreenPriv->saved.y2 - pScreenPriv->saved.y1,
- dx, dy);
- }
- (void) (*pScreenPriv->funcs->MoveCursor) (pScreen, pCursor,
- pScreenPriv->saved.x1,
- pScreenPriv->saved.y1,
- pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
- pScreenPriv->saved.y2 - pScreenPriv->saved.y1,
- sx - pScreenPriv->saved.x1,
- sy - pScreenPriv->saved.y1,
- pScreenPriv->colors[SOURCE_COLOR].pixel,
- pScreenPriv->colors[MASK_COLOR].pixel);
- pScreenPriv->isUp = TRUE;
- }
- else
- {
- miSpriteRemoveCursor (pScreen);
- }
- }
- if (!pScreenPriv->isUp && pScreenPriv->pCursor)
- miSpriteRestoreCursor (pScreen);
-}
-
-static void
-miSpriteMoveCursor (pScreen, x, y)
- ScreenPtr pScreen;
- int x, y;
-{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- miSpriteSetCursor (pScreen, pScreenPriv->pCursor, x, y);
-}
-
-/*
- * undraw/draw cursor
- */
-
-static void
-miSpriteRemoveCursor (pScreen)
- ScreenPtr pScreen;
-{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- pScreenPriv->isUp = FALSE;
- pScreenPriv->pCacheWin = NullWindow;
- if (!(*pScreenPriv->funcs->RestoreUnderCursor) (pScreen,
- pScreenPriv->saved.x1,
- pScreenPriv->saved.y1,
- pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
- pScreenPriv->saved.y2 - pScreenPriv->saved.y1))
- {
- pScreenPriv->isUp = TRUE;
- }
-}
-
-/*
- * Called from the block handler, restores the cursor
- * before waiting for something to do.
- */
-
-static void
-miSpriteRestoreCursor (pScreen)
- ScreenPtr pScreen;
-{
- miSpriteScreenPtr pScreenPriv;
- int x, y;
- CursorPtr pCursor;
-
- miSpriteComputeSaved (pScreen);
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- pCursor = pScreenPriv->pCursor;
- x = pScreenPriv->x - (int)pCursor->bits->xhot;
- y = pScreenPriv->y - (int)pCursor->bits->yhot;
- if ((*pScreenPriv->funcs->SaveUnderCursor) (pScreen,
- pScreenPriv->saved.x1,
- pScreenPriv->saved.y1,
- pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
- pScreenPriv->saved.y2 - pScreenPriv->saved.y1))
- {
- if (pScreenPriv->checkPixels)
- miSpriteFindColors (pScreen);
- if ((*pScreenPriv->funcs->PutUpCursor) (pScreen, pCursor, x, y,
- pScreenPriv->colors[SOURCE_COLOR].pixel,
- pScreenPriv->colors[MASK_COLOR].pixel))
- pScreenPriv->isUp = TRUE;
- }
-}
-
-/*
- * compute the desired area of the screen to save
- */
-
-static void
-miSpriteComputeSaved (pScreen)
- ScreenPtr pScreen;
-{
- miSpriteScreenPtr pScreenPriv;
- int x, y, w, h;
- int wpad, hpad;
- CursorPtr pCursor;
-
- pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
- pCursor = pScreenPriv->pCursor;
- x = pScreenPriv->x - (int)pCursor->bits->xhot;
- y = pScreenPriv->y - (int)pCursor->bits->yhot;
- w = pCursor->bits->width;
- h = pCursor->bits->height;
- wpad = SPRITE_PAD;
- hpad = SPRITE_PAD;
- pScreenPriv->saved.x1 = x - wpad;
- pScreenPriv->saved.y1 = y - hpad;
- pScreenPriv->saved.x2 = pScreenPriv->saved.x1 + w + wpad * 2;
- pScreenPriv->saved.y2 = pScreenPriv->saved.y1 + h + hpad * 2;
-}
diff --git a/mi/misprite.h b/mi/misprite.h
deleted file mode 100644
index a7e19f7cb..000000000
--- a/mi/misprite.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * misprite.h
- *
- * software-sprite/sprite drawing interface spec
- *
- * mi versions of these routines exist.
- */
-
-/* $Xorg: misprite.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/misprite.h,v 1.3 2001/12/14 20:00:27 dawes Exp $ */
-
-typedef struct {
- Bool (*RealizeCursor)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/
-);
- Bool (*UnrealizeCursor)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/
-);
- Bool (*PutUpCursor)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- int /*x*/,
- int /*y*/,
- unsigned long /*source*/,
- unsigned long /*mask*/
-);
- Bool (*SaveUnderCursor)(
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/
-);
- Bool (*RestoreUnderCursor)(
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/
-);
- Bool (*MoveCursor)(
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*dx*/,
- int /*dy*/,
- unsigned long /*source*/,
- unsigned long /*mask*/
-);
- Bool (*ChangeSave)(
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*dx*/,
- int /*dy*/
-);
-
-} miSpriteCursorFuncRec, *miSpriteCursorFuncPtr;
-
-extern Bool miSpriteInitialize(
- ScreenPtr /*pScreen*/,
- miSpriteCursorFuncPtr /*cursorFuncs*/,
- miPointerScreenFuncPtr /*screenFuncs*/
-);
diff --git a/mi/mispritest.h b/mi/mispritest.h
deleted file mode 100644
index eddc16c2d..000000000
--- a/mi/mispritest.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * mispritest.h
- *
- * mi sprite structures
- */
-
-/* $Xorg: mispritest.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-/*
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/mi/mispritest.h,v 1.5 2001/12/14 20:00:27 dawes Exp $ */
-
-# include "misprite.h"
-#ifdef RENDER
-# include "picturestr.h"
-#endif
-
-/*
- * per screen information
- */
-
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
- CreateGCProcPtr CreateGC;
- ScreenBlockHandlerProcPtr BlockHandler;
- InstallColormapProcPtr InstallColormap;
- StoreColorsProcPtr StoreColors;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- SaveDoomedAreasProcPtr SaveDoomedAreas;
- RestoreAreasProcPtr RestoreAreas;
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
-
- CursorPtr pCursor;
- int x;
- int y;
- BoxRec saved;
- Bool isUp;
- Bool shouldBeUp;
- WindowPtr pCacheWin;
- Bool isInCacheWin;
- Bool checkPixels;
- xColorItem colors[2];
- ColormapPtr pInstalledMap;
- ColormapPtr pColormap;
- VisualPtr pVisual;
- miSpriteCursorFuncPtr funcs;
-} miSpriteScreenRec, *miSpriteScreenPtr;
-
-#define SOURCE_COLOR 0
-#define MASK_COLOR 1
-
-typedef struct {
- GCFuncs *wrapFuncs;
- GCOps *wrapOps;
-} miSpriteGCRec, *miSpriteGCPtr;
-
-/*
- * Overlap BoxPtr and Box elements
- */
-#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
- (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
- ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
-
-/*
- * Overlap BoxPtr, origins, and rectangle
- */
-#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
- BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
-
-/*
- * Overlap BoxPtr, origins and RectPtr
- */
-#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
- ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
- (int)((pRect)->width), (int)((pRect)->height))
-/*
- * Overlap BoxPtr and horizontal span
- */
-#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
-
-#define LINE_SORT(x1,y1,x2,y2) \
-{ int _t; \
- if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
- if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
-
-#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
- BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
diff --git a/mi/mistruct.h b/mi/mistruct.h
deleted file mode 100644
index 0744b2593..000000000
--- a/mi/mistruct.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* $Xorg: mistruct.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/mi/mistruct.h,v 1.3 2003/07/16 01:38:57 dawes Exp $ */
-
-#ifndef MISTRUCT_H
-#define MISTRUCT_H
-
-#include "mi.h"
-#include "regionstr.h"
-
-/* information about dashes */
-typedef struct _miDash {
- DDXPointRec pt;
- int e1, e2; /* keep these, so we don't have to do it again */
- int e; /* bresenham error term for this point on line */
- int which;
- int newLine;/* 0 if part of same original line as previous dash */
- } miDashRec;
-
-#endif /* MISTRUCT_H */
diff --git a/mi/mivalidate.h b/mi/mivalidate.h
deleted file mode 100644
index c1ef15bb1..000000000
--- a/mi/mivalidate.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $Xorg: mivalidate.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/mivalidate.h,v 1.3 2003/07/16 01:38:57 dawes Exp $ */
-
-
-#ifndef MIVALIDATE_H
-#define MIVALIDATE_H
-
-#include "regionstr.h"
-
-typedef union _Validate {
- struct BeforeValidate {
- DDXPointRec oldAbsCorner; /* old window position */
- RegionPtr borderVisible; /* visible region of border, */
- /* non-null when size changes */
- Bool resized; /* unclipped winSize has changed - */
- /* don't call SaveDoomedAreas */
- } before;
- struct AfterValidate {
- RegionRec exposed; /* exposed regions, absolute pos */
- RegionRec borderExposed;
- } after;
-} ValidateRec;
-
-#endif /* MIVALIDATE_H */
diff --git a/mi/mivaltree.c b/mi/mivaltree.c
deleted file mode 100644
index 90ba5d98e..000000000
--- a/mi/mivaltree.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/* $Xorg: mivaltree.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-/*
- * mivaltree.c --
- * Functions for recalculating window clip lists. Main function
- * is miValidateTree.
- *
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
- *
- * Copyright 1987, 1988, 1989 by
- * Digital Equipment Corporation, Maynard, Massachusetts,
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- ******************************************************************/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
-/* $XFree86: xc/programs/Xserver/mi/mivaltree.c,v 1.10 2003/11/10 18:22:49 tsi Exp $ */
-
- /*
- * Aug '86: Susan Angebranndt -- original code
- * July '87: Adam de Boor -- substantially modified and commented
- * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible.
- * In particular, much improved code for window mapping and
- * circulating.
- * Bob Scheifler -- avoid miComputeClips for unmapped windows,
- * valdata changes
- */
-#include "X.h"
-#include "scrnintstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "mivalidate.h"
-
-#include "globals.h"
-
-#ifdef SHAPE
-/*
- * Compute the visibility of a shaped window
- */
-int
-miShapedWindowIn (pScreen, universe, bounding, rect, x, y)
- ScreenPtr pScreen;
- RegionPtr universe, bounding;
- BoxPtr rect;
- register int x, y;
-{
- BoxRec box;
- register BoxPtr boundBox;
- int nbox;
- Bool someIn, someOut;
- register int t, x1, y1, x2, y2;
-
- nbox = REGION_NUM_RECTS (bounding);
- boundBox = REGION_RECTS (bounding);
- someIn = someOut = FALSE;
- x1 = rect->x1;
- y1 = rect->y1;
- x2 = rect->x2;
- y2 = rect->y2;
- while (nbox--)
- {
- if ((t = boundBox->x1 + x) < x1)
- t = x1;
- box.x1 = t;
- if ((t = boundBox->y1 + y) < y1)
- t = y1;
- box.y1 = t;
- if ((t = boundBox->x2 + x) > x2)
- t = x2;
- box.x2 = t;
- if ((t = boundBox->y2 + y) > y2)
- t = y2;
- box.y2 = t;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- switch (RECT_IN_REGION(pScreen, universe, &box))
- {
- case rgnIN:
- if (someOut)
- return rgnPART;
- someIn = TRUE;
- break;
- case rgnOUT:
- if (someIn)
- return rgnPART;
- someOut = TRUE;
- break;
- default:
- return rgnPART;
- }
- boundBox++;
- }
- if (someIn)
- return rgnIN;
- return rgnOUT;
-}
-#endif
-
-#define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \
- HasBorder(w) && \
- (w)->backgroundState == ParentRelative)
-
-
-/*
- *-----------------------------------------------------------------------
- * miComputeClips --
- * Recompute the clipList, borderClip, exposed and borderExposed
- * regions for pParent and its children. Only viewable windows are
- * taken into account.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * clipList, borderClip, exposed and borderExposed are altered.
- * A VisibilityNotify event may be generated on the parent window.
- *
- *-----------------------------------------------------------------------
- */
-static void
-miComputeClips (
- register WindowPtr pParent,
- register ScreenPtr pScreen,
- register RegionPtr universe,
- VTKind kind,
- RegionPtr exposed ) /* for intermediate calculations */
-{
- int dx,
- dy;
- RegionRec childUniverse;
- register WindowPtr pChild;
- int oldVis, newVis;
- BoxRec borderSize;
- RegionRec childUnion;
- Bool overlap;
- RegionPtr borderVisible;
- Bool resized;
- /*
- * Figure out the new visibility of this window.
- * The extent of the universe should be the same as the extent of
- * the borderSize region. If the window is unobscured, this rectangle
- * will be completely inside the universe (the universe will cover it
- * completely). If the window is completely obscured, none of the
- * universe will cover the rectangle.
- */
- borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent);
- borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent);
- dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent);
- if (dx > 32767)
- dx = 32767;
- borderSize.x2 = dx;
- dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent);
- if (dy > 32767)
- dy = 32767;
- borderSize.y2 = dy;
-
- oldVis = pParent->visibility;
- switch (RECT_IN_REGION( pScreen, universe, &borderSize))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnPART:
- newVis = VisibilityPartiallyObscured;
-#ifdef SHAPE
- {
- RegionPtr pBounding;
-
- if ((pBounding = wBoundingShape (pParent)))
- {
- switch (miShapedWindowIn (pScreen, universe, pBounding,
- &borderSize,
- pParent->drawable.x,
- pParent->drawable.y))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnOUT:
- newVis = VisibilityFullyObscured;
- break;
- }
- }
- }
-#endif
- break;
- default:
- newVis = VisibilityFullyObscured;
- break;
- }
- pParent->visibility = newVis;
- if (oldVis != newVis &&
- ((pParent->eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
- SendVisibilityNotify(pParent);
-
- dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
- dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
-
- /*
- * avoid computations when dealing with simple operations
- */
-
- switch (kind) {
- case VTMap:
- case VTStack:
- case VTUnmap:
- break;
- case VTMove:
- if ((oldVis == newVis) &&
- ((oldVis == VisibilityFullyObscured) ||
- (oldVis == VisibilityUnobscured)))
- {
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- if (pChild->visibility != VisibilityFullyObscured)
- {
- REGION_TRANSLATE( pScreen, &pChild->borderClip,
- dx, dy);
- REGION_TRANSLATE( pScreen, &pChild->clipList,
- dx, dy);
- pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pChild, dx, dy);
-
- }
- if (pChild->valdata)
- {
- REGION_NULL(pScreen,
- &pChild->valdata->after.borderExposed);
- if (HasParentRelativeBorder(pChild))
- {
- REGION_SUBTRACT(pScreen,
- &pChild->valdata->after.borderExposed,
- &pChild->borderClip,
- &pChild->winSize);
- }
- REGION_NULL(pScreen, &pChild->valdata->after.exposed);
- }
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
- return;
- }
- /* fall through */
- default:
- /*
- * To calculate exposures correctly, we have to translate the old
- * borderClip and clipList regions to the window's new location so there
- * is a correspondence between pieces of the new and old clipping regions.
- */
- if (dx || dy)
- {
- /*
- * We translate the old clipList because that will be exposed or copied
- * if gravity is right.
- */
- REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy);
- REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy);
- }
- break;
- case VTBroken:
- REGION_EMPTY (pScreen, &pParent->borderClip);
- REGION_EMPTY (pScreen, &pParent->clipList);
- break;
- }
-
- borderVisible = pParent->valdata->before.borderVisible;
- resized = pParent->valdata->before.resized;
- REGION_NULL(pScreen, &pParent->valdata->after.borderExposed);
- REGION_NULL(pScreen, &pParent->valdata->after.exposed);
-
- /*
- * Since the borderClip must not be clipped by the children, we do
- * the border exposure first...
- *
- * 'universe' is the window's borderClip. To figure the exposures, remove
- * the area that used to be exposed from the new.
- * This leaves a region of pieces that weren't exposed before.
- */
-
- if (HasBorder (pParent))
- {
- if (borderVisible)
- {
- /*
- * when the border changes shape, the old visible portions
- * of the border will be saved by DIX in borderVisible --
- * use that region and destroy it
- */
- REGION_SUBTRACT( pScreen, exposed, universe, borderVisible);
- REGION_DESTROY( pScreen, borderVisible);
- }
- else
- {
- REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip);
- }
- if (HasParentRelativeBorder(pParent) && (dx || dy))
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- universe,
- &pParent->winSize);
- else
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- exposed, &pParent->winSize);
-
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- /*
- * To get the right clipList for the parent, and to make doubly sure
- * that no child overlaps the parent's border, we remove the parent's
- * border from the universe before proceeding.
- */
-
- REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize);
- }
- else
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- if ((pChild = pParent->firstChild) && pParent->mapped)
- {
- REGION_NULL(pScreen, &childUniverse);
- REGION_NULL(pScreen, &childUnion);
- if ((pChild->drawable.y < pParent->lastChild->drawable.y) ||
- ((pChild->drawable.y == pParent->lastChild->drawable.y) &&
- (pChild->drawable.x < pParent->lastChild->drawable.x)))
- {
- for (; pChild; pChild = pChild->nextSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- else
- {
- for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- REGION_VALIDATE( pScreen, &childUnion, &overlap);
-
- for (pChild = pParent->firstChild;
- pChild;
- pChild = pChild->nextSib)
- {
- if (pChild->viewable) {
- /*
- * If the child is viewable, we want to remove its extents
- * from the current universe, but we only re-clip it if
- * it's been marked.
- */
- if (pChild->valdata) {
- /*
- * Figure out the new universe from the child's
- * perspective and recurse.
- */
- REGION_INTERSECT( pScreen, &childUniverse,
- universe,
- &pChild->borderSize);
- miComputeClips (pChild, pScreen, &childUniverse, kind,
- exposed);
- }
- /*
- * Once the child has been processed, we remove its extents
- * from the current universe, thus denying its space to any
- * other sibling.
- */
- if (overlap)
- REGION_SUBTRACT( pScreen, universe, universe,
- &pChild->borderSize);
- }
- }
- if (!overlap)
- REGION_SUBTRACT( pScreen, universe, universe, &childUnion);
- REGION_UNINIT( pScreen, &childUnion);
- REGION_UNINIT( pScreen, &childUniverse);
- } /* if any children */
-
- /*
- * 'universe' now contains the new clipList for the parent window.
- *
- * To figure the exposure of the window we subtract the old clip from the
- * new, just as for the border.
- */
-
- if (oldVis == VisibilityFullyObscured ||
- oldVis == VisibilityNotViewable)
- {
- REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe);
- }
- else if (newVis != VisibilityFullyObscured &&
- newVis != VisibilityNotViewable)
- {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed,
- universe, &pParent->clipList);
- }
-
- /*
- * One last thing: backing storage. We have to try to save what parts of
- * the window are about to be obscured. We can just subtract the universe
- * from the old clipList and get the areas that were in the old but aren't
- * in the new and, hence, are about to be obscured.
- */
- if (pParent->backStorage && !resized)
- {
- REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe);
- (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy);
- }
-
- /* HACK ALERT - copying contents of regions, instead of regions */
- {
- RegionRec tmp;
-
- tmp = pParent->clipList;
- pParent->clipList = *universe;
- *universe = tmp;
- }
-
-#ifdef NOTDEF
- REGION_COPY( pScreen, &pParent->clipList, universe);
-#endif
-
- pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pParent, dx, dy);
-}
-
-static void
-miTreeObscured(
- register WindowPtr pParent )
-{
- register WindowPtr pChild;
- register int oldVis;
-
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- oldVis = pChild->visibility;
- if (oldVis != (pChild->visibility = VisibilityFullyObscured) &&
- ((pChild->eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask))
- SendVisibilityNotify(pChild);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-/*
- *-----------------------------------------------------------------------
- * miValidateTree --
- * Recomputes the clip list for pParent and all its inferiors.
- *
- * Results:
- * Always returns 1.
- *
- * Side Effects:
- * The clipList, borderClip, exposed, and borderExposed regions for
- * each marked window are altered.
- *
- * Notes:
- * This routine assumes that all affected windows have been marked
- * (valdata created) and their winSize and borderSize regions
- * adjusted to correspond to their new positions. The borderClip and
- * clipList regions should not have been touched.
- *
- * The top-most level is treated differently from all lower levels
- * because pParent is unchanged. For the top level, we merge the
- * regions taken up by the marked children back into the clipList
- * for pParent, thus forming a region from which the marked children
- * can claim their areas. For lower levels, where the old clipList
- * and borderClip are invalid, we can't do this and have to do the
- * extra operations done in miComputeClips, but this is much faster
- * e.g. when only one child has moved...
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-miValidateTree (pParent, pChild, kind)
- WindowPtr pParent; /* Parent to validate */
- WindowPtr pChild; /* First child of pParent that was
- * affected */
- VTKind kind; /* What kind of configuration caused call */
-{
- RegionRec totalClip; /* Total clipping region available to
- * the marked children. pParent's clipList
- * merged with the borderClips of all
- * the marked children. */
- RegionRec childClip; /* The new borderClip for the current
- * child */
- RegionRec childUnion; /* the space covered by borderSize for
- * all marked children */
- RegionRec exposed; /* For intermediate calculations */
- register ScreenPtr pScreen;
- register WindowPtr pWin;
- Bool overlap;
- int viewvals;
- Bool forward;
-
- pScreen = pParent->drawable.pScreen;
- if (pChild == NullWindow)
- pChild = pParent->firstChild;
-
- REGION_NULL(pScreen, &childClip);
- REGION_NULL(pScreen, &exposed);
-
- /*
- * compute the area of the parent window occupied
- * by the marked children + the parent itself. This
- * is the area which can be divied up among the marked
- * children in their new configuration.
- */
- REGION_NULL(pScreen, &totalClip);
- viewvals = 0;
- if (REGION_BROKEN (pScreen, &pParent->clipList) &&
- !REGION_BROKEN (pScreen, &pParent->borderClip))
- {
- kind = VTBroken;
- /*
- * When rebuilding clip lists after out of memory,
- * assume everything is busted.
- */
- forward = TRUE;
- REGION_COPY (pScreen, &totalClip, &pParent->borderClip);
- REGION_INTERSECT (pScreen, &totalClip, &totalClip, &pParent->winSize);
-
- for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib)
- {
- if (pWin->viewable)
- REGION_SUBTRACT (pScreen, &totalClip, &totalClip, &pWin->borderSize);
- }
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- if (pWin->valdata && pWin->viewable)
- viewvals++;
-
- REGION_EMPTY (pScreen, &pParent->clipList);
- }
- else
- {
- if ((pChild->drawable.y < pParent->lastChild->drawable.y) ||
- ((pChild->drawable.y == pParent->lastChild->drawable.y) &&
- (pChild->drawable.x < pParent->lastChild->drawable.x)))
- {
- forward = TRUE;
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- {
- if (pWin->valdata)
- {
- REGION_APPEND( pScreen, &totalClip, &pWin->borderClip);
- if (pWin->viewable)
- viewvals++;
- }
- }
- }
- else
- {
- forward = FALSE;
- pWin = pParent->lastChild;
- while (1)
- {
- if (pWin->valdata)
- {
- REGION_APPEND( pScreen, &totalClip, &pWin->borderClip);
- if (pWin->viewable)
- viewvals++;
- }
- if (pWin == pChild)
- break;
- pWin = pWin->prevSib;
- }
- }
- REGION_VALIDATE( pScreen, &totalClip, &overlap);
- }
-
- /*
- * Now go through the children of the root and figure their new
- * borderClips from the totalClip, passing that off to miComputeClips
- * to handle recursively. Once that's done, we remove the child
- * from the totalClip to clip any siblings below it.
- */
-
- overlap = TRUE;
- if (kind != VTStack)
- {
- REGION_UNION( pScreen, &totalClip, &totalClip, &pParent->clipList);
- if (viewvals > 1)
- {
- /*
- * precompute childUnion to discover whether any of them
- * overlap. This seems redundant, but performance studies
- * have demonstrated that the cost of this loop is
- * lower than the cost of multiple Subtracts in the
- * loop below.
- */
- REGION_NULL(pScreen, &childUnion);
- if (forward)
- {
- for (pWin = pChild; pWin; pWin = pWin->nextSib)
- if (pWin->valdata && pWin->viewable)
- REGION_APPEND( pScreen, &childUnion,
- &pWin->borderSize);
- }
- else
- {
- pWin = pParent->lastChild;
- while (1)
- {
- if (pWin->valdata && pWin->viewable)
- REGION_APPEND( pScreen, &childUnion,
- &pWin->borderSize);
- if (pWin == pChild)
- break;
- pWin = pWin->prevSib;
- }
- }
- REGION_VALIDATE(pScreen, &childUnion, &overlap);
- if (overlap)
- REGION_UNINIT(pScreen, &childUnion);
- }
- }
-
- for (pWin = pChild;
- pWin != NullWindow;
- pWin = pWin->nextSib)
- {
- if (pWin->viewable) {
- if (pWin->valdata) {
- REGION_INTERSECT( pScreen, &childClip,
- &totalClip,
- &pWin->borderSize);
- miComputeClips (pWin, pScreen, &childClip, kind, &exposed);
- if (overlap)
- {
- REGION_SUBTRACT( pScreen, &totalClip,
- &totalClip,
- &pWin->borderSize);
- }
- } else if (pWin->visibility == VisibilityNotViewable) {
- miTreeObscured(pWin);
- }
- } else {
- if (pWin->valdata) {
- REGION_EMPTY( pScreen, &pWin->clipList);
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pWin, 0, 0);
- REGION_EMPTY( pScreen, &pWin->borderClip);
- pWin->valdata = (ValidatePtr)NULL;
- }
- }
- }
-
- REGION_UNINIT( pScreen, &childClip);
- if (!overlap)
- {
- REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion);
- REGION_UNINIT(pScreen, &childUnion);
- }
-
- REGION_NULL(pScreen, &pParent->valdata->after.exposed);
- REGION_NULL(pScreen, &pParent->valdata->after.borderExposed);
-
- /*
- * each case below is responsible for updating the
- * clipList and serial number for the parent window
- */
-
- switch (kind) {
- case VTStack:
- break;
- default:
- /*
- * totalClip contains the new clipList for the parent. Figure out
- * exposures and obscures as per miComputeClips and reset the parent's
- * clipList.
- */
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed,
- &totalClip, &pParent->clipList);
- /* fall through */
- case VTMap:
- if (pParent->backStorage) {
- REGION_SUBTRACT( pScreen, &exposed, &pParent->clipList, &totalClip);
- (* pScreen->SaveDoomedAreas)(pParent, &exposed, 0, 0);
- }
-
- REGION_COPY( pScreen, &pParent->clipList, &totalClip);
- pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- break;
- }
-
- REGION_UNINIT( pScreen, &totalClip);
- REGION_UNINIT( pScreen, &exposed);
- if (pScreen->ClipNotify)
- (*pScreen->ClipNotify) (pParent, 0, 0);
- return (1);
-}
diff --git a/mi/miwideline.c b/mi/miwideline.c
deleted file mode 100644
index 84b4346f2..000000000
--- a/mi/miwideline.c
+++ /dev/null
@@ -1,2234 +0,0 @@
-/* $Xorg: miwideline.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/miwideline.c,v 1.13 2003/07/16 01:38:57 dawes Exp $ */
-
-/* Author: Keith Packard, MIT X Consortium */
-
-/*
- * Mostly integer wideline code. Uses a technique similar to
- * bresenham zero-width lines, except walks an X edge
- */
-
-#include <stdio.h>
-#ifdef _XOPEN_SOURCE
-#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-#include "X.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "miwideline.h"
-#include "mi.h"
-
-#ifdef ICEILTEMPDECL
-ICEILTEMPDECL
-#endif
-
-static void miLineArc(DrawablePtr pDraw, register GCPtr pGC,
- unsigned long pixel, SpanDataPtr spanData,
- register LineFacePtr leftFace,
- register LineFacePtr rightFace,
- double xorg, double yorg, Bool isInt);
-
-
-/*
- * spans-based polygon filler
- */
-
-void
-miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
- left, right, left_count, right_count)
- DrawablePtr pDrawable;
- GCPtr pGC;
- unsigned long pixel;
- SpanDataPtr spanData;
- int y; /* start y coordinate */
- int overall_height; /* height of entire segment */
- PolyEdgePtr left, right;
- int left_count, right_count;
-{
- register int left_x = 0, left_e = 0;
- int left_stepx = 0;
- int left_signdx = 0;
- int left_dy = 0, left_dx = 0;
-
- register int right_x = 0, right_e = 0;
- int right_stepx = 0;
- int right_signdx = 0;
- int right_dy = 0, right_dx = 0;
-
- int height = 0;
- int left_height = 0, right_height = 0;
-
- register DDXPointPtr ppt;
- DDXPointPtr pptInit = NULL;
- register int *pwidth;
- int *pwidthInit = NULL;
- XID oldPixel;
- int xorg;
- Spans spanRec;
-
- left_height = 0;
- right_height = 0;
-
- if (!spanData)
- {
- pptInit = (DDXPointPtr) ALLOCATE_LOCAL (overall_height * sizeof(*ppt));
- if (!pptInit)
- return;
- pwidthInit = (int *) ALLOCATE_LOCAL (overall_height * sizeof(*pwidth));
- if (!pwidthInit)
- {
- DEALLOCATE_LOCAL (pptInit);
- return;
- }
- ppt = pptInit;
- pwidth = pwidthInit;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, (XID *)&pixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- }
- else
- {
- spanRec.points = (DDXPointPtr) xalloc (overall_height * sizeof (*ppt));
- if (!spanRec.points)
- return;
- spanRec.widths = (int *) xalloc (overall_height * sizeof (int));
- if (!spanRec.widths)
- {
- xfree (spanRec.points);
- return;
- }
- ppt = spanRec.points;
- pwidth = spanRec.widths;
- }
-
- xorg = 0;
- if (pGC->miTranslate)
- {
- y += pDrawable->y;
- xorg = pDrawable->x;
- }
- while ((left_count || left_height) &&
- (right_count || right_height))
- {
- MIPOLYRELOADLEFT
- MIPOLYRELOADRIGHT
-
- height = left_height;
- if (height > right_height)
- height = right_height;
-
- left_height -= height;
- right_height -= height;
-
- while (--height >= 0)
- {
- if (right_x >= left_x)
- {
- ppt->y = y;
- ppt->x = left_x + xorg;
- ppt++;
- *pwidth++ = right_x - left_x + 1;
- }
- y++;
-
- MIPOLYSTEPLEFT
-
- MIPOLYSTEPRIGHT
- }
- }
- if (!spanData)
- {
- (*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE);
- DEALLOCATE_LOCAL (pwidthInit);
- DEALLOCATE_LOCAL (pptInit);
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- }
- else
- {
- spanRec.count = ppt - spanRec.points;
- AppendSpanGroup (pGC, pixel, &spanRec, spanData)
- }
-}
-
-static void
-miFillRectPolyHelper (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- int x,
- int y,
- int w,
- int h)
-{
- register DDXPointPtr ppt;
- register int *pwidth;
- XID oldPixel;
- Spans spanRec;
- xRectangle rect;
-
- if (!spanData)
- {
- rect.x = x;
- rect.y = y;
- rect.width = w;
- rect.height = h;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, (XID *)&pixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- }
- else
- {
- spanRec.points = (DDXPointPtr) xalloc (h * sizeof (*ppt));
- if (!spanRec.points)
- return;
- spanRec.widths = (int *) xalloc (h * sizeof (int));
- if (!spanRec.widths)
- {
- xfree (spanRec.points);
- return;
- }
- ppt = spanRec.points;
- pwidth = spanRec.widths;
-
- if (pGC->miTranslate)
- {
- y += pDrawable->y;
- x += pDrawable->x;
- }
- while (h--)
- {
- ppt->x = x;
- ppt->y = y;
- ppt++;
- *pwidth++ = w;
- y++;
- }
- spanRec.count = ppt - spanRec.points;
- AppendSpanGroup (pGC, pixel, &spanRec, spanData)
- }
-}
-
-/* static */ int
-miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge)
- double x0, y0;
- double k; /* x0 * dy - y0 * dx */
- register int dx, dy;
- int xi, yi;
- int left;
- register PolyEdgePtr edge;
-{
- int x, y, e;
- int xady;
-
- if (dy < 0)
- {
- dy = -dy;
- dx = -dx;
- k = -k;
- }
-
-#ifdef NOTDEF
- {
- double realk, kerror;
- realk = x0 * dy - y0 * dx;
- kerror = Fabs (realk - k);
- if (kerror > .1)
- printf ("realk: %g k: %g\n", realk, k);
- }
-#endif
- y = ICEIL (y0);
- xady = ICEIL (k) + y * dx;
-
- if (xady <= 0)
- x = - (-xady / dy) - 1;
- else
- x = (xady - 1) / dy;
-
- e = xady - x * dy;
-
- if (dx >= 0)
- {
- edge->signdx = 1;
- edge->stepx = dx / dy;
- edge->dx = dx % dy;
- }
- else
- {
- edge->signdx = -1;
- edge->stepx = - (-dx / dy);
- edge->dx = -dx % dy;
- e = dy - e + 1;
- }
- edge->dy = dy;
- edge->x = x + left + xi;
- edge->e = e - dy; /* bias to compare against 0 instead of dy */
- return y + yi;
-}
-
-#define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr)))
-
-/* static */ int
-miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, h)
- register PolyVertexPtr vertices;
- register PolySlopePtr slopes;
- int count;
- int xi, yi;
- PolyEdgePtr left, right;
- int *pnleft, *pnright;
- int *h;
-{
- int top, bottom;
- double miny, maxy;
- register int i;
- int j;
- int clockwise;
- int slopeoff;
- register int s;
- register int nright, nleft;
- int y, lasty = 0, bottomy, topy = 0;
-
- /* find the top of the polygon */
- maxy = miny = vertices[0].y;
- bottom = top = 0;
- for (i = 1; i < count; i++)
- {
- if (vertices[i].y < miny)
- {
- top = i;
- miny = vertices[i].y;
- }
- if (vertices[i].y >= maxy)
- {
- bottom = i;
- maxy = vertices[i].y;
- }
- }
- clockwise = 1;
- slopeoff = 0;
-
- i = top;
- j = StepAround (top, -1, count);
-
- if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx)
- {
- clockwise = -1;
- slopeoff = -1;
- }
-
- bottomy = ICEIL (maxy) + yi;
-
- nright = 0;
-
- s = StepAround (top, slopeoff, count);
- i = top;
- while (i != bottom)
- {
- if (slopes[s].dy != 0)
- {
- y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
- slopes[s].k,
- slopes[s].dx, slopes[s].dy,
- xi, yi, 0,
- &right[nright]);
- if (nright != 0)
- right[nright-1].height = y - lasty;
- else
- topy = y;
- nright++;
- lasty = y;
- }
-
- i = StepAround (i, clockwise, count);
- s = StepAround (s, clockwise, count);
- }
- if (nright != 0)
- right[nright-1].height = bottomy - lasty;
-
- if (slopeoff == 0)
- slopeoff = -1;
- else
- slopeoff = 0;
-
- nleft = 0;
- s = StepAround (top, slopeoff, count);
- i = top;
- while (i != bottom)
- {
- if (slopes[s].dy != 0)
- {
- y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
- slopes[s].k,
- slopes[s].dx, slopes[s].dy, xi, yi, 1,
- &left[nleft]);
-
- if (nleft != 0)
- left[nleft-1].height = y - lasty;
- nleft++;
- lasty = y;
- }
- i = StepAround (i, -clockwise, count);
- s = StepAround (s, -clockwise, count);
- }
- if (nleft != 0)
- left[nleft-1].height = bottomy - lasty;
- *pnleft = nleft;
- *pnright = nright;
- *h = bottomy - topy;
- return topy;
-}
-
-static void
-miLineOnePoint (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- int x,
- int y)
-{
- DDXPointRec pt;
- int wid;
- unsigned long oldPixel;
-
- MILINESETPIXEL (pDrawable, pGC, pixel, oldPixel);
- if (pGC->fillStyle == FillSolid)
- {
- pt.x = x;
- pt.y = y;
- (*pGC->ops->PolyPoint) (pDrawable, pGC, CoordModeOrigin, 1, &pt);
- }
- else
- {
- wid = 1;
- if (pGC->miTranslate)
- {
- x += pDrawable->x;
- y += pDrawable->y;
- }
- pt.x = x;
- pt.y = y;
- (*pGC->ops->FillSpans) (pDrawable, pGC, 1, &pt, &wid, TRUE);
- }
- MILINERESETPIXEL (pDrawable, pGC, pixel, oldPixel);
-}
-
-static void
-miLineJoin (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- register LineFacePtr pLeft,
- register LineFacePtr pRight)
-{
- double mx = 0, my = 0;
- double denom = 0.0;
- PolyVertexRec vertices[4];
- PolySlopeRec slopes[4];
- int edgecount;
- PolyEdgeRec left[4], right[4];
- int nleft, nright;
- int y, height;
- int swapslopes;
- int joinStyle = pGC->joinStyle;
- int lw = pGC->lineWidth;
-
- if (lw == 1 && !spanData) {
- /* See if one of the lines will draw the joining pixel */
- if (pLeft->dx > 0 || (pLeft->dx == 0 && pLeft->dy > 0))
- return;
- if (pRight->dx > 0 || (pRight->dx == 0 && pRight->dy > 0))
- return;
- if (joinStyle != JoinRound) {
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
- if (denom == 0)
- return; /* no join to draw */
- }
- if (joinStyle != JoinMiter) {
- miLineOnePoint (pDrawable, pGC, pixel, spanData, pLeft->x, pLeft->y);
- return;
- }
- } else {
- if (joinStyle == JoinRound)
- {
- miLineArc(pDrawable, pGC, pixel, spanData,
- pLeft, pRight,
- (double)0.0, (double)0.0, TRUE);
- return;
- }
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
- if (denom == 0.0)
- return; /* no join to draw */
- }
-
- swapslopes = 0;
- if (denom > 0)
- {
- pLeft->xa = -pLeft->xa;
- pLeft->ya = -pLeft->ya;
- pLeft->dx = -pLeft->dx;
- pLeft->dy = -pLeft->dy;
- }
- else
- {
- swapslopes = 1;
- pRight->xa = -pRight->xa;
- pRight->ya = -pRight->ya;
- pRight->dx = -pRight->dx;
- pRight->dy = -pRight->dy;
- }
-
- vertices[0].x = pRight->xa;
- vertices[0].y = pRight->ya;
- slopes[0].dx = -pRight->dy;
- slopes[0].dy = pRight->dx;
- slopes[0].k = 0;
-
- vertices[1].x = 0;
- vertices[1].y = 0;
- slopes[1].dx = pLeft->dy;
- slopes[1].dy = -pLeft->dx;
- slopes[1].k = 0;
-
- vertices[2].x = pLeft->xa;
- vertices[2].y = pLeft->ya;
-
- if (joinStyle == JoinMiter)
- {
- my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
- pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx )) /
- denom;
- if (pLeft->dy != 0)
- {
- mx = pLeft->xa + (my - pLeft->ya) *
- (double) pLeft->dx / (double) pLeft->dy;
- }
- else
- {
- mx = pRight->xa + (my - pRight->ya) *
- (double) pRight->dx / (double) pRight->dy;
- }
- /* check miter limit */
- if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
- joinStyle = JoinBevel;
- }
-
- if (joinStyle == JoinMiter)
- {
- slopes[2].dx = pLeft->dx;
- slopes[2].dy = pLeft->dy;
- slopes[2].k = pLeft->k;
- if (swapslopes)
- {
- slopes[2].dx = -slopes[2].dx;
- slopes[2].dy = -slopes[2].dy;
- slopes[2].k = -slopes[2].k;
- }
- vertices[3].x = mx;
- vertices[3].y = my;
- slopes[3].dx = pRight->dx;
- slopes[3].dy = pRight->dy;
- slopes[3].k = pRight->k;
- if (swapslopes)
- {
- slopes[3].dx = -slopes[3].dx;
- slopes[3].dy = -slopes[3].dy;
- slopes[3].k = -slopes[3].k;
- }
- edgecount = 4;
- }
- else
- {
- double scale, dx, dy, adx, ady;
-
- adx = dx = pRight->xa - pLeft->xa;
- ady = dy = pRight->ya - pLeft->ya;
- if (adx < 0)
- adx = -adx;
- if (ady < 0)
- ady = -ady;
- scale = ady;
- if (adx > ady)
- scale = adx;
- slopes[2].dx = (dx * 65536) / scale;
- slopes[2].dy = (dy * 65536) / scale;
- slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
- (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
- edgecount = 3;
- }
-
- y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y,
- left, right, &nleft, &nright, &height);
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, height, left, right, nleft, nright);
-}
-
-static int
-miLineArcI (
- DrawablePtr pDraw,
- GCPtr pGC,
- int xorg,
- int yorg,
- DDXPointPtr points,
- int *widths)
-{
- register DDXPointPtr tpts, bpts;
- register int *twids, *bwids;
- register int x, y, e, ex, slw;
-
- tpts = points;
- twids = widths;
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- }
- slw = pGC->lineWidth;
- if (slw == 1)
- {
- tpts->x = xorg;
- tpts->y = yorg;
- *twids = 1;
- return 1;
- }
- bpts = tpts + slw;
- bwids = twids + slw;
- y = (slw >> 1) + 1;
- if (slw & 1)
- e = - ((y << 2) + 3);
- else
- e = - (y << 3);
- ex = -4;
- x = 0;
- while (y)
- {
- e += (y << 3) - 4;
- while (e >= 0)
- {
- x++;
- e += (ex = -((x << 3) + 4));
- }
- y--;
- slw = (x << 1) + 1;
- if ((e == ex) && (slw > 1))
- slw--;
- tpts->x = xorg - x;
- tpts->y = yorg - y;
- tpts++;
- *twids++ = slw;
- if ((y != 0) && ((slw > 1) || (e != ex)))
- {
- bpts--;
- bpts->x = xorg - x;
- bpts->y = yorg + y;
- *--bwids = slw;
- }
- }
- return (pGC->lineWidth);
-}
-
-#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
- if (ybase == edgey) \
- { \
- if (edgeleft) \
- { \
- if (edge->x > xcl) \
- xcl = edge->x; \
- } \
- else \
- { \
- if (edge->x < xcr) \
- xcr = edge->x; \
- } \
- edgey++; \
- edge->x += edge->stepx; \
- edge->e += edge->dx; \
- if (edge->e > 0) \
- { \
- edge->x += edge->signdx; \
- edge->e -= edge->dy; \
- } \
- }
-
-static int
-miLineArcD (
- DrawablePtr pDraw,
- GCPtr pGC,
- double xorg,
- double yorg,
- DDXPointPtr points,
- int *widths,
- PolyEdgePtr edge1,
- int edgey1,
- Bool edgeleft1,
- PolyEdgePtr edge2,
- int edgey2,
- Bool edgeleft2)
-{
- register DDXPointPtr pts;
- register int *wids;
- double radius, x0, y0, el, er, yk, xlk, xrk, k;
- int xbase, ybase, y, boty, xl, xr, xcl, xcr;
- int ymin, ymax;
- Bool edge1IsMin, edge2IsMin;
- int ymin1, ymin2;
-
- pts = points;
- wids = widths;
- xbase = floor(xorg);
- x0 = xorg - xbase;
- ybase = ICEIL (yorg);
- y0 = yorg - ybase;
- if (pGC->miTranslate)
- {
- xbase += pDraw->x;
- ybase += pDraw->y;
- edge1->x += pDraw->x;
- edge2->x += pDraw->x;
- edgey1 += pDraw->y;
- edgey2 += pDraw->y;
- }
- xlk = x0 + x0 + 1.0;
- xrk = x0 + x0 - 1.0;
- yk = y0 + y0 - 1.0;
- radius = ((double)pGC->lineWidth) / 2.0;
- y = floor(radius - y0 + 1.0);
- ybase -= y;
- ymin = ybase;
- ymax = 65536;
- edge1IsMin = FALSE;
- ymin1 = edgey1;
- if (edge1->dy >= 0)
- {
- if (!edge1->dy)
- {
- if (edgeleft1)
- edge1IsMin = TRUE;
- else
- ymax = edgey1;
- edgey1 = 65536;
- }
- else
- {
- if ((edge1->signdx < 0) == edgeleft1)
- edge1IsMin = TRUE;
- }
- }
- edge2IsMin = FALSE;
- ymin2 = edgey2;
- if (edge2->dy >= 0)
- {
- if (!edge2->dy)
- {
- if (edgeleft2)
- edge2IsMin = TRUE;
- else
- ymax = edgey2;
- edgey2 = 65536;
- }
- else
- {
- if ((edge2->signdx < 0) == edgeleft2)
- edge2IsMin = TRUE;
- }
- }
- if (edge1IsMin)
- {
- ymin = ymin1;
- if (edge2IsMin && ymin1 > ymin2)
- ymin = ymin2;
- } else if (edge2IsMin)
- ymin = ymin2;
- el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
- er = el + xrk;
- xl = 1;
- xr = 0;
- if (x0 < 0.5)
- {
- xl = 0;
- el -= xlk;
- }
- boty = (y0 < -0.5) ? 1 : 0;
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty)
- {
- k = (y << 1) + yk;
- er += k;
- while (er > 0.0)
- {
- xr++;
- er += xrk - (xr << 1);
- }
- el += k;
- while (el >= 0.0)
- {
- xl--;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if (xcr >= xcl)
- {
- pts->x = xcl;
- pts->y = ybase;
- pts++;
- *wids++ = xcr - xcl + 1;
- }
- }
- er = xrk - (xr << 1) - er;
- el = (xl << 1) - xlk - el;
- boty = floor(-y0 - radius + 1.0);
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty)
- {
- k = (y << 1) + yk;
- er -= k;
- while ((er >= 0.0) && (xr >= 0))
- {
- xr--;
- er += xrk - (xr << 1);
- }
- el -= k;
- while ((el > 0.0) && (xl <= 0))
- {
- xl++;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if (xcr >= xcl)
- {
- pts->x = xcl;
- pts->y = ybase;
- pts++;
- *wids++ = xcr - xcl + 1;
- }
- }
- return (pts - points);
-}
-
-int
-miRoundJoinFace (face, edge, leftEdge)
- register LineFacePtr face;
- register PolyEdgePtr edge;
- Bool *leftEdge;
-{
- int y;
- int dx, dy;
- double xa, ya;
- Bool left;
-
- dx = -face->dy;
- dy = face->dx;
- xa = face->xa;
- ya = face->ya;
- left = 1;
- if (ya > 0)
- {
- ya = 0.0;
- xa = 0.0;
- }
- if (dy < 0 || (dy == 0 && dx > 0))
- {
- dx = -dx;
- dy = -dy;
- left = !left;
- }
- if (dx == 0 && dy == 0)
- dy = 1;
- if (dy == 0)
- {
- y = ICEIL (face->ya) + face->y;
- edge->x = -32767;
- edge->stepx = 0;
- edge->signdx = 0;
- edge->e = -1;
- edge->dy = 0;
- edge->dx = 0;
- edge->height = 0;
- }
- else
- {
- y = miPolyBuildEdge (xa, ya, 0.0, dx, dy, face->x, face->y, !left, edge);
- edge->height = 32767;
- }
- *leftEdge = !left;
- return y;
-}
-
-void
-miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2)
- register LineFacePtr pLeft, pRight;
- PolyEdgePtr edge1, edge2;
- int *y1, *y2;
- Bool *left1, *left2;
-{
- double denom;
-
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
-
- if (denom >= 0)
- {
- pLeft->xa = -pLeft->xa;
- pLeft->ya = -pLeft->ya;
- }
- else
- {
- pRight->xa = -pRight->xa;
- pRight->ya = -pRight->ya;
- }
- *y1 = miRoundJoinFace (pLeft, edge1, left1);
- *y2 = miRoundJoinFace (pRight, edge2, left2);
-}
-
-int
-miRoundCapClip (face, isInt, edge, leftEdge)
- register LineFacePtr face;
- Bool isInt;
- register PolyEdgePtr edge;
- Bool *leftEdge;
-{
- int y;
- register int dx, dy;
- double xa, ya, k;
- Bool left;
-
- dx = -face->dy;
- dy = face->dx;
- xa = face->xa;
- ya = face->ya;
- k = 0.0;
- if (!isInt)
- k = face->k;
- left = 1;
- if (dy < 0 || (dy == 0 && dx > 0))
- {
- dx = -dx;
- dy = -dy;
- xa = -xa;
- ya = -ya;
- left = !left;
- }
- if (dx == 0 && dy == 0)
- dy = 1;
- if (dy == 0)
- {
- y = ICEIL (face->ya) + face->y;
- edge->x = -32767;
- edge->stepx = 0;
- edge->signdx = 0;
- edge->e = -1;
- edge->dy = 0;
- edge->dx = 0;
- edge->height = 0;
- }
- else
- {
- y = miPolyBuildEdge (xa, ya, k, dx, dy, face->x, face->y, !left, edge);
- edge->height = 32767;
- }
- *leftEdge = !left;
- return y;
-}
-
-static void
-miLineArc (
- DrawablePtr pDraw,
- register GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- register LineFacePtr leftFace,
- register LineFacePtr rightFace,
- double xorg,
- double yorg,
- Bool isInt)
-{
- DDXPointPtr points;
- int *widths;
- int xorgi = 0, yorgi = 0;
- XID oldPixel;
- Spans spanRec;
- int n;
- PolyEdgeRec edge1, edge2;
- int edgey1, edgey2;
- Bool edgeleft1, edgeleft2;
-
- if (isInt)
- {
- xorgi = leftFace ? leftFace->x : rightFace->x;
- yorgi = leftFace ? leftFace->y : rightFace->y;
- }
- edgey1 = 65536;
- edgey2 = 65536;
- edge1.x = 0; /* not used, keep memory checkers happy */
- edge1.dy = -1;
- edge2.x = 0; /* not used, keep memory checkers happy */
- edge2.dy = -1;
- edgeleft1 = FALSE;
- edgeleft2 = FALSE;
- if ((pGC->lineStyle != LineSolid || pGC->lineWidth > 2) &&
- ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
- (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt)))
- {
- if (isInt)
- {
- xorg = (double) xorgi;
- yorg = (double) yorgi;
- }
- if (leftFace && rightFace)
- {
- miRoundJoinClip (leftFace, rightFace, &edge1, &edge2,
- &edgey1, &edgey2, &edgeleft1, &edgeleft2);
- }
- else if (leftFace)
- {
- edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1);
- }
- else if (rightFace)
- {
- edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2);
- }
- isInt = FALSE;
- }
- if (!spanData)
- {
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * pGC->lineWidth);
- if (!points)
- return;
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * pGC->lineWidth);
- if (!widths)
- {
- DEALLOCATE_LOCAL(points);
- return;
- }
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
- {
- DoChangeGC(pGC, GCForeground, (XID *)&pixel, FALSE);
- ValidateGC (pDraw, pGC);
- }
- }
- else
- {
- points = (DDXPointPtr) xalloc (pGC->lineWidth * sizeof (DDXPointRec));
- if (!points)
- return;
- widths = (int *) xalloc (pGC->lineWidth * sizeof (int));
- if (!widths)
- {
- xfree (points);
- return;
- }
- spanRec.points = points;
- spanRec.widths = widths;
- }
- if (isInt)
- n = miLineArcI(pDraw, pGC, xorgi, yorgi, points, widths);
- else
- n = miLineArcD(pDraw, pGC, xorg, yorg, points, widths,
- &edge1, edgey1, edgeleft1,
- &edge2, edgey2, edgeleft2);
-
- if (!spanData)
- {
- (*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE);
- DEALLOCATE_LOCAL(widths);
- DEALLOCATE_LOCAL(points);
- if (pixel != oldPixel)
- {
- DoChangeGC(pGC, GCForeground, &oldPixel, FALSE);
- ValidateGC (pDraw, pGC);
- }
- }
- else
- {
- spanRec.count = n;
- AppendSpanGroup (pGC, pixel, &spanRec, spanData)
- }
-}
-
-void
-miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- unsigned long pixel;
- SpanDataPtr spanData;
- register LineFacePtr face;
- Bool isLeft;
- double xorg, yorg;
- Bool isInt;
-{
- int xorgi = 0, yorgi = 0;
- int lw;
- PolyEdgeRec lefts[2], rights[2];
- int lefty, righty, topy, bottomy;
- PolyEdgePtr left, right;
- PolyEdgePtr top, bottom;
- double xa,ya;
- double k;
- double xap, yap;
- int dx, dy;
- double projectXoff, projectYoff;
- double maxy;
- int finaly;
-
- if (isInt)
- {
- xorgi = face->x;
- yorgi = face->y;
- }
- lw = pGC->lineWidth;
- dx = face->dx;
- dy = face->dy;
- k = face->k;
- if (dy == 0)
- {
- lefts[0].height = lw;
- lefts[0].x = xorgi;
- if (isLeft)
- lefts[0].x -= (lw >> 1);
- lefts[0].stepx = 0;
- lefts[0].signdx = 1;
- lefts[0].e = -lw;
- lefts[0].dx = 0;
- lefts[0].dy = lw;
- rights[0].height = lw;
- rights[0].x = xorgi;
- if (!isLeft)
- rights[0].x += ((lw + 1) >> 1);
- rights[0].stepx = 0;
- rights[0].signdx = 1;
- rights[0].e = -lw;
- rights[0].dx = 0;
- rights[0].dy = lw;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, yorgi - (lw >> 1), lw,
- lefts, rights, 1, 1);
- }
- else if (dx == 0)
- {
- topy = yorgi;
- bottomy = yorgi + dy;
- if (isLeft)
- topy -= (lw >> 1);
- else
- bottomy += (lw >> 1);
- lefts[0].height = bottomy - topy;
- lefts[0].x = xorgi - (lw >> 1);
- lefts[0].stepx = 0;
- lefts[0].signdx = 1;
- lefts[0].e = -dy;
- lefts[0].dx = dx;
- lefts[0].dy = dy;
-
- rights[0].height = bottomy - topy;
- rights[0].x = lefts[0].x + (lw-1);
- rights[0].stepx = 0;
- rights[0].signdx = 1;
- rights[0].e = -dy;
- rights[0].dx = dx;
- rights[0].dy = dy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy, bottomy - topy, lefts, rights, 1, 1);
- }
- else
- {
- xa = face->xa;
- ya = face->ya;
- projectXoff = -ya;
- projectYoff = xa;
- if (dx < 0)
- {
- right = &rights[1];
- left = &lefts[0];
- top = &rights[0];
- bottom = &lefts[1];
- }
- else
- {
- right = &rights[0];
- left = &lefts[1];
- top = &lefts[0];
- bottom = &rights[1];
- }
- if (isLeft)
- {
- righty = miPolyBuildEdge (xa, ya,
- k, dx, dy, xorgi, yorgi, 0, right);
-
- xa = -xa;
- ya = -ya;
- k = -k;
- lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, xorgi, yorgi, 1, left);
- if (dx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
- xap = xa - projectXoff;
- yap = ya - projectYoff;
- topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, xorgi, yorgi, dx > 0, top);
- bottomy = miPolyBuildEdge (xa, ya,
- 0.0, -dy, dx, xorgi, yorgi, dx < 0, bottom);
- maxy = -ya;
- }
- else
- {
- righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, xorgi, yorgi, 0, right);
-
- xa = -xa;
- ya = -ya;
- k = -k;
- lefty = miPolyBuildEdge (xa, ya,
- k, dx, dy, xorgi, yorgi, 1, left);
- if (dx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
- xap = xa - projectXoff;
- yap = ya - projectYoff;
- topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, xorgi, xorgi, dx > 0, top);
- bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, xorgi, xorgi, dx < 0, bottom);
- maxy = -ya + projectYoff;
- }
- finaly = ICEIL(maxy) + yorgi;
- if (dx < 0)
- {
- left->height = bottomy - lefty;
- right->height = finaly - righty;
- top->height = righty - topy;
- }
- else
- {
- right->height = bottomy - righty;
- left->height = finaly - lefty;
- top->height = lefty - topy;
- }
- bottom->height = finaly - bottomy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
- bottom->height + bottomy - topy, lefts, rights, 2, 2);
- }
-}
-
-static void
-miWideSegment (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- register int x1,
- register int y1,
- register int x2,
- register int y2,
- Bool projectLeft,
- Bool projectRight,
- register LineFacePtr leftFace,
- register LineFacePtr rightFace)
-{
- double l, L, r;
- double xa, ya;
- double projectXoff = 0.0, projectYoff = 0.0;
- double k;
- double maxy;
- int x, y;
- int dx, dy;
- int finaly;
- PolyEdgePtr left, right;
- PolyEdgePtr top, bottom;
- int lefty, righty, topy, bottomy;
- int signdx;
- PolyEdgeRec lefts[2], rights[2];
- LineFacePtr tface;
- int lw = pGC->lineWidth;
-
- /* draw top-to-bottom always */
- if (y2 < y1 || (y2 == y1 && x2 < x1))
- {
- x = x1;
- x1 = x2;
- x2 = x;
-
- y = y1;
- y1 = y2;
- y2 = y;
-
- x = projectLeft;
- projectLeft = projectRight;
- projectRight = x;
-
- tface = leftFace;
- leftFace = rightFace;
- rightFace = tface;
- }
-
- dy = y2 - y1;
- signdx = 1;
- dx = x2 - x1;
- if (dx < 0)
- signdx = -1;
-
- leftFace->x = x1;
- leftFace->y = y1;
- leftFace->dx = dx;
- leftFace->dy = dy;
-
- rightFace->x = x2;
- rightFace->y = y2;
- rightFace->dx = -dx;
- rightFace->dy = -dy;
-
- if (dy == 0)
- {
- rightFace->xa = 0;
- rightFace->ya = (double) lw / 2.0;
- rightFace->k = -(double) (lw * dx) / 2.0;
- leftFace->xa = 0;
- leftFace->ya = -rightFace->ya;
- leftFace->k = rightFace->k;
- x = x1;
- if (projectLeft)
- x -= (lw >> 1);
- y = y1 - (lw >> 1);
- dx = x2 - x;
- if (projectRight)
- dx += ((lw + 1) >> 1);
- dy = lw;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x, y, dx, dy);
- }
- else if (dx == 0)
- {
- leftFace->xa = (double) lw / 2.0;
- leftFace->ya = 0;
- leftFace->k = (double) (lw * dy) / 2.0;
- rightFace->xa = -leftFace->xa;
- rightFace->ya = 0;
- rightFace->k = leftFace->k;
- y = y1;
- if (projectLeft)
- y -= lw >> 1;
- x = x1 - (lw >> 1);
- dy = y2 - y;
- if (projectRight)
- dy += ((lw + 1) >> 1);
- dx = lw;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x, y, dx, dy);
- }
- else
- {
- l = ((double) lw) / 2.0;
- L = hypot ((double) dx, (double) dy);
-
- if (dx < 0)
- {
- right = &rights[1];
- left = &lefts[0];
- top = &rights[0];
- bottom = &lefts[1];
- }
- else
- {
- right = &rights[0];
- left = &lefts[1];
- top = &lefts[0];
- bottom = &rights[1];
- }
- r = l / L;
-
- /* coord of upper bound at integral y */
- ya = -r * dx;
- xa = r * dy;
-
- if (projectLeft | projectRight)
- {
- projectXoff = -ya;
- projectYoff = xa;
- }
-
- /* xa * dy - ya * dx */
- k = l * L;
-
- leftFace->xa = xa;
- leftFace->ya = ya;
- leftFace->k = k;
- rightFace->xa = -xa;
- rightFace->ya = -ya;
- rightFace->k = k;
-
- if (projectLeft)
- righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 0, right);
- else
- righty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 0, right);
-
- /* coord of lower bound at integral y */
- ya = -ya;
- xa = -xa;
-
- /* xa * dy - ya * dx */
- k = - k;
-
- if (projectLeft)
- lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 1, left);
- else
- lefty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 1, left);
-
- /* coord of top face at integral y */
-
- if (signdx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
-
- if (projectLeft)
- {
- double xap = xa - projectXoff;
- double yap = ya - projectYoff;
- topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x1, y1, dx > 0, top);
- }
- else
- topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, x1, y1, dx > 0, top);
-
- /* coord of bottom face at integral y */
-
- if (projectRight)
- {
- double xap = xa + projectXoff;
- double yap = ya + projectYoff;
- bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya + projectYoff;
- }
- else
- {
- bottomy = miPolyBuildEdge (xa, ya,
- 0.0, -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya;
- }
-
- finaly = ICEIL (maxy) + y2;
-
- if (dx < 0)
- {
- left->height = bottomy - lefty;
- right->height = finaly - righty;
- top->height = righty - topy;
- }
- else
- {
- right->height = bottomy - righty;
- left->height = finaly - lefty;
- top->height = lefty - topy;
- }
- bottom->height = finaly - bottomy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
- bottom->height + bottomy - topy, lefts, rights, 2, 2);
- }
-}
-
-SpanDataPtr
-miSetupSpanData (pGC, spanData, npt)
- register GCPtr pGC;
- SpanDataPtr spanData;
- int npt;
-{
- if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu))
- return (SpanDataPtr) NULL;
- if (pGC->lineStyle == LineDoubleDash)
- miInitSpanGroup (&spanData->bgGroup);
- miInitSpanGroup (&spanData->fgGroup);
- return spanData;
-}
-
-void
-miCleanupSpanData (pDrawable, pGC, spanData)
- DrawablePtr pDrawable;
- GCPtr pGC;
- SpanDataPtr spanData;
-{
- if (pGC->lineStyle == LineDoubleDash)
- {
- XID oldPixel, pixel;
-
- pixel = pGC->bgPixel;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, &pixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
- miFreeSpanGroup (&spanData->bgGroup);
- if (pixel != oldPixel)
- {
- DoChangeGC (pGC, GCForeground, &oldPixel, FALSE);
- ValidateGC (pDrawable, pGC);
- }
- }
- miFillUniqueSpanGroup (pDrawable, pGC, &spanData->fgGroup);
- miFreeSpanGroup (&spanData->fgGroup);
-}
-
-void
-miWideLine (pDrawable, pGC, mode, npt, pPts)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode;
- register int npt;
- register DDXPointPtr pPts;
-{
- int x1, y1, x2, y2;
- SpanDataRec spanDataRec;
- SpanDataPtr spanData;
- unsigned long pixel;
- Bool projectLeft, projectRight;
- LineFaceRec leftFace, rightFace, prevRightFace;
- LineFaceRec firstFace;
- register int first;
- Bool somethingDrawn = FALSE;
- Bool selfJoin;
-
- spanData = miSetupSpanData (pGC, &spanDataRec, npt);
- pixel = pGC->fgPixel;
- x2 = pPts->x;
- y2 = pPts->y;
- first = TRUE;
- selfJoin = FALSE;
- if (npt > 1)
- {
- if (mode == CoordModePrevious)
- {
- int nptTmp;
- DDXPointPtr pPtsTmp;
-
- x1 = x2;
- y1 = y2;
- nptTmp = npt;
- pPtsTmp = pPts + 1;
- while (--nptTmp)
- {
- x1 += pPtsTmp->x;
- y1 += pPtsTmp->y;
- ++pPtsTmp;
- }
- if (x2 == x1 && y2 == y1)
- selfJoin = TRUE;
- }
- else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
- {
- selfJoin = TRUE;
- }
- }
- projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
- projectRight = FALSE;
- while (--npt)
- {
- x1 = x2;
- y1 = y2;
- ++pPts;
- x2 = pPts->x;
- y2 = pPts->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- if (x1 != x2 || y1 != y2)
- {
- somethingDrawn = TRUE;
- if (npt == 1 && pGC->capStyle == CapProjecting && !selfJoin)
- projectRight = TRUE;
- miWideSegment (pDrawable, pGC, pixel, spanData, x1, y1, x2, y2,
- projectLeft, projectRight, &leftFace, &rightFace);
- if (first)
- {
- if (selfJoin)
- firstFace = leftFace;
- else if (pGC->capStyle == CapRound)
- {
- if (pGC->lineWidth == 1 && !spanData)
- miLineOnePoint (pDrawable, pGC, pixel, spanData, x1, y1);
- else
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- else
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
- &prevRightFace);
- }
- prevRightFace = rightFace;
- first = FALSE;
- projectLeft = FALSE;
- }
- if (npt == 1 && somethingDrawn)
- {
- if (selfJoin)
- miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
- &rightFace);
- else if (pGC->capStyle == CapRound)
- {
- if (pGC->lineWidth == 1 && !spanData)
- miLineOnePoint (pDrawable, pGC, pixel, spanData, x2, y2);
- else
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- }
- /* handle crock where all points are coincedent */
- if (!somethingDrawn)
- {
- projectLeft = pGC->capStyle == CapProjecting;
- miWideSegment (pDrawable, pGC, pixel, spanData,
- x2, y2, x2, y2, projectLeft, projectLeft,
- &leftFace, &rightFace);
- if (pGC->capStyle == CapRound)
- {
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0,
- TRUE);
- rightFace.dx = -1; /* sleezy hack to make it work */
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- if (spanData)
- miCleanupSpanData (pDrawable, pGC, spanData);
-}
-
-#define V_TOP 0
-#define V_RIGHT 1
-#define V_BOTTOM 2
-#define V_LEFT 3
-
-static void
-miWideDashSegment (
- DrawablePtr pDrawable,
- register GCPtr pGC,
- SpanDataPtr spanData,
- int *pDashOffset,
- int *pDashIndex,
- int x1,
- int y1,
- int x2,
- int y2,
- Bool projectLeft,
- Bool projectRight,
- LineFacePtr leftFace,
- LineFacePtr rightFace)
-{
- int dashIndex, dashRemain;
- unsigned char *pDash;
- double L, l;
- double k;
- PolyVertexRec vertices[4];
- PolyVertexRec saveRight, saveBottom;
- PolySlopeRec slopes[4];
- PolyEdgeRec left[2], right[2];
- LineFaceRec lcapFace, rcapFace;
- int nleft, nright;
- int h;
- int y;
- int dy, dx;
- unsigned long pixel;
- double LRemain;
- double r;
- double rdx, rdy;
- double dashDx, dashDy;
- double saveK = 0.0;
- Bool first = TRUE;
- double lcenterx, lcentery, rcenterx = 0.0, rcentery = 0.0;
- unsigned long fgPixel, bgPixel;
-
- dx = x2 - x1;
- dy = y2 - y1;
- dashIndex = *pDashIndex;
- pDash = pGC->dash;
- dashRemain = pDash[dashIndex] - *pDashOffset;
- fgPixel = pGC->fgPixel;
- bgPixel = pGC->bgPixel;
- if (pGC->fillStyle == FillOpaqueStippled ||
- pGC->fillStyle == FillTiled)
- {
- bgPixel = fgPixel;
- }
-
- l = ((double) pGC->lineWidth) / 2.0;
- if (dx == 0)
- {
- L = dy;
- rdx = 0;
- rdy = l;
- if (dy < 0)
- {
- L = -dy;
- rdy = -l;
- }
- }
- else if (dy == 0)
- {
- L = dx;
- rdx = l;
- rdy = 0;
- if (dx < 0)
- {
- L = -dx;
- rdx = -l;
- }
- }
- else
- {
- L = hypot ((double) dx, (double) dy);
- r = l / L;
-
- rdx = r * dx;
- rdy = r * dy;
- }
- k = l * L;
- LRemain = L;
- /* All position comments are relative to a line with dx and dy > 0,
- * but the code does not depend on this */
- /* top */
- slopes[V_TOP].dx = dx;
- slopes[V_TOP].dy = dy;
- slopes[V_TOP].k = k;
- /* right */
- slopes[V_RIGHT].dx = -dy;
- slopes[V_RIGHT].dy = dx;
- slopes[V_RIGHT].k = 0;
- /* bottom */
- slopes[V_BOTTOM].dx = -dx;
- slopes[V_BOTTOM].dy = -dy;
- slopes[V_BOTTOM].k = k;
- /* left */
- slopes[V_LEFT].dx = dy;
- slopes[V_LEFT].dy = -dx;
- slopes[V_LEFT].k = 0;
-
- /* preload the start coordinates */
- vertices[V_RIGHT].x = vertices[V_TOP].x = rdy;
- vertices[V_RIGHT].y = vertices[V_TOP].y = -rdx;
-
- vertices[V_BOTTOM].x = vertices[V_LEFT].x = -rdy;
- vertices[V_BOTTOM].y = vertices[V_LEFT].y = rdx;
-
- if (projectLeft)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
-
- slopes[V_LEFT].k = rdx * dx + rdy * dy;
- }
-
- lcenterx = x1;
- lcentery = y1;
-
- if (pGC->capStyle == CapRound)
- {
- lcapFace.dx = dx;
- lcapFace.dy = dy;
- lcapFace.x = x1;
- lcapFace.y = y1;
-
- rcapFace.dx = -dx;
- rcapFace.dy = -dy;
- rcapFace.x = x1;
- rcapFace.y = y1;
- }
- while (LRemain > dashRemain)
- {
- dashDx = (dashRemain * dx) / L;
- dashDy = (dashRemain * dy) / L;
-
- rcenterx = lcenterx + dashDx;
- rcentery = lcentery + dashDy;
-
- vertices[V_RIGHT].x += dashDx;
- vertices[V_RIGHT].y += dashDy;
-
- vertices[V_BOTTOM].x += dashDx;
- vertices[V_BOTTOM].y += dashDy;
-
- slopes[V_RIGHT].k = vertices[V_RIGHT].x * dx + vertices[V_RIGHT].y * dy;
-
- if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
- {
- if (pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapProjecting)
- {
- saveRight = vertices[V_RIGHT];
- saveBottom = vertices[V_BOTTOM];
- saveK = slopes[V_RIGHT].k;
-
- if (!first)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
-
- slopes[V_LEFT].k = vertices[V_LEFT].x *
- slopes[V_LEFT].dy -
- vertices[V_LEFT].y *
- slopes[V_LEFT].dx;
- }
-
- vertices[V_RIGHT].x += rdx;
- vertices[V_RIGHT].y += rdy;
-
- vertices[V_BOTTOM].x += rdx;
- vertices[V_BOTTOM].y += rdy;
-
- slopes[V_RIGHT].k = vertices[V_RIGHT].x *
- slopes[V_RIGHT].dy -
- vertices[V_RIGHT].y *
- slopes[V_RIGHT].dx;
- }
- y = miPolyBuildPoly (vertices, slopes, 4, x1, y1,
- left, right, &nleft, &nright, &h);
- pixel = (dashIndex & 1) ? bgPixel : fgPixel;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
-
- if (pGC->lineStyle == LineOnOffDash)
- {
- switch (pGC->capStyle)
- {
- case CapProjecting:
- vertices[V_BOTTOM] = saveBottom;
- vertices[V_RIGHT] = saveRight;
- slopes[V_RIGHT].k = saveK;
- break;
- case CapRound:
- if (!first)
- {
- if (dx < 0)
- {
- lcapFace.xa = -vertices[V_LEFT].x;
- lcapFace.ya = -vertices[V_LEFT].y;
- lcapFace.k = slopes[V_LEFT].k;
- }
- else
- {
- lcapFace.xa = vertices[V_TOP].x;
- lcapFace.ya = vertices[V_TOP].y;
- lcapFace.k = -slopes[V_LEFT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- &lcapFace, (LineFacePtr) NULL,
- lcenterx, lcentery, FALSE);
- }
- if (dx < 0)
- {
- rcapFace.xa = vertices[V_BOTTOM].x;
- rcapFace.ya = vertices[V_BOTTOM].y;
- rcapFace.k = slopes[V_RIGHT].k;
- }
- else
- {
- rcapFace.xa = -vertices[V_RIGHT].x;
- rcapFace.ya = -vertices[V_RIGHT].y;
- rcapFace.k = -slopes[V_RIGHT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rcapFace,
- rcenterx, rcentery, FALSE);
- break;
- }
- }
- }
- LRemain -= dashRemain;
- ++dashIndex;
- if (dashIndex == pGC->numInDashList)
- dashIndex = 0;
- dashRemain = pDash[dashIndex];
-
- lcenterx = rcenterx;
- lcentery = rcentery;
-
- vertices[V_TOP] = vertices[V_RIGHT];
- vertices[V_LEFT] = vertices[V_BOTTOM];
- slopes[V_LEFT].k = -slopes[V_RIGHT].k;
- first = FALSE;
- }
-
- if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
- {
- vertices[V_TOP].x -= dx;
- vertices[V_TOP].y -= dy;
-
- vertices[V_LEFT].x -= dx;
- vertices[V_LEFT].y -= dy;
-
- vertices[V_RIGHT].x = rdy;
- vertices[V_RIGHT].y = -rdx;
-
- vertices[V_BOTTOM].x = -rdy;
- vertices[V_BOTTOM].y = rdx;
-
-
- if (projectRight)
- {
- vertices[V_RIGHT].x += rdx;
- vertices[V_RIGHT].y += rdy;
-
- vertices[V_BOTTOM].x += rdx;
- vertices[V_BOTTOM].y += rdy;
- slopes[V_RIGHT].k = vertices[V_RIGHT].x *
- slopes[V_RIGHT].dy -
- vertices[V_RIGHT].y *
- slopes[V_RIGHT].dx;
- }
- else
- slopes[V_RIGHT].k = 0;
-
- if (!first && pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapProjecting)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
- slopes[V_LEFT].k = vertices[V_LEFT].x *
- slopes[V_LEFT].dy -
- vertices[V_LEFT].y *
- slopes[V_LEFT].dx;
- }
- else
- slopes[V_LEFT].k += dx * dx + dy * dy;
-
-
- y = miPolyBuildPoly (vertices, slopes, 4, x2, y2,
- left, right, &nleft, &nright, &h);
-
- pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
- if (!first && pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapRound)
- {
- lcapFace.x = x2;
- lcapFace.y = y2;
- if (dx < 0)
- {
- lcapFace.xa = -vertices[V_LEFT].x;
- lcapFace.ya = -vertices[V_LEFT].y;
- lcapFace.k = slopes[V_LEFT].k;
- }
- else
- {
- lcapFace.xa = vertices[V_TOP].x;
- lcapFace.ya = vertices[V_TOP].y;
- lcapFace.k = -slopes[V_LEFT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- &lcapFace, (LineFacePtr) NULL,
- rcenterx, rcentery, FALSE);
- }
- }
- dashRemain = ((double) dashRemain) - LRemain;
- if (dashRemain == 0)
- {
- dashIndex++;
- if (dashIndex == pGC->numInDashList)
- dashIndex = 0;
- dashRemain = pDash[dashIndex];
- }
-
- leftFace->x = x1;
- leftFace->y = y1;
- leftFace->dx = dx;
- leftFace->dy = dy;
- leftFace->xa = rdy;
- leftFace->ya = -rdx;
- leftFace->k = k;
-
- rightFace->x = x2;
- rightFace->y = y2;
- rightFace->dx = -dx;
- rightFace->dy = -dy;
- rightFace->xa = -rdy;
- rightFace->ya = rdx;
- rightFace->k = k;
-
- *pDashIndex = dashIndex;
- *pDashOffset = pDash[dashIndex] - dashRemain;
-}
-
-void
-miWideDash (pDrawable, pGC, mode, npt, pPts)
- DrawablePtr pDrawable;
- register GCPtr pGC;
- int mode;
- register int npt;
- register DDXPointPtr pPts;
-{
- int x1, y1, x2, y2;
- unsigned long pixel;
- Bool projectLeft, projectRight;
- LineFaceRec leftFace, rightFace, prevRightFace;
- LineFaceRec firstFace;
- int first;
- int dashIndex, dashOffset;
- register int prevDashIndex;
- SpanDataRec spanDataRec;
- SpanDataPtr spanData;
- Bool somethingDrawn = FALSE;
- Bool selfJoin;
- Bool endIsFg = FALSE, startIsFg = FALSE;
- Bool firstIsFg = FALSE, prevIsFg = FALSE;
-
-#ifndef XFree86Server
- /* XXX backward compatibility */
- if (pGC->lineWidth == 0)
- {
- miZeroDashLine (pDrawable, pGC, mode, npt, pPts);
- return;
- }
-#endif
- if (pGC->lineStyle == LineDoubleDash &&
- (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled))
- {
- miWideLine (pDrawable, pGC, mode, npt, pPts);
- return;
- }
- if (npt == 0)
- return;
- spanData = miSetupSpanData (pGC, &spanDataRec, npt);
- x2 = pPts->x;
- y2 = pPts->y;
- first = TRUE;
- selfJoin = FALSE;
- if (mode == CoordModePrevious)
- {
- int nptTmp;
- DDXPointPtr pPtsTmp;
-
- x1 = x2;
- y1 = y2;
- nptTmp = npt;
- pPtsTmp = pPts + 1;
- while (--nptTmp)
- {
- x1 += pPtsTmp->x;
- y1 += pPtsTmp->y;
- ++pPtsTmp;
- }
- if (x2 == x1 && y2 == y1)
- selfJoin = TRUE;
- }
- else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
- {
- selfJoin = TRUE;
- }
- projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
- projectRight = FALSE;
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex,
- pGC->dash, (int)pGC->numInDashList, &dashOffset);
- while (--npt)
- {
- x1 = x2;
- y1 = y2;
- ++pPts;
- x2 = pPts->x;
- y2 = pPts->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- if (x1 != x2 || y1 != y2)
- {
- somethingDrawn = TRUE;
- if (npt == 1 && pGC->capStyle == CapProjecting &&
- (!selfJoin || !firstIsFg))
- projectRight = TRUE;
- prevDashIndex = dashIndex;
- miWideDashSegment (pDrawable, pGC, spanData, &dashOffset, &dashIndex,
- x1, y1, x2, y2,
- projectLeft, projectRight, &leftFace, &rightFace);
- startIsFg = !(prevDashIndex & 1);
- endIsFg = (dashIndex & 1) ^ (dashOffset != 0);
- if (pGC->lineStyle == LineDoubleDash || startIsFg)
- {
- pixel = startIsFg ? pGC->fgPixel : pGC->bgPixel;
- if (first || (pGC->lineStyle == LineOnOffDash && !prevIsFg))
- {
- if (first && selfJoin)
- {
- firstFace = leftFace;
- firstIsFg = startIsFg;
- }
- else if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0, TRUE);
- }
- else
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
- &prevRightFace);
- }
- }
- prevRightFace = rightFace;
- prevIsFg = endIsFg;
- first = FALSE;
- projectLeft = FALSE;
- }
- if (npt == 1 && somethingDrawn)
- {
- if (pGC->lineStyle == LineDoubleDash || endIsFg)
- {
- pixel = endIsFg ? pGC->fgPixel : pGC->bgPixel;
- if (selfJoin && (pGC->lineStyle == LineDoubleDash || firstIsFg))
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
- &rightFace);
- }
- else
- {
- if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0, TRUE);
- }
- }
- else
- {
- /* glue a cap to the start of the line if
- * we're OnOffDash and ended on odd dash
- */
- if (selfJoin && firstIsFg)
- {
- pixel = pGC->fgPixel;
- if (pGC->capStyle == CapProjecting)
- miLineProjectingCap (pDrawable, pGC, pixel, spanData,
- &firstFace, TRUE,
- (double)0.0, (double)0.0, TRUE);
- else if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- &firstFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0, TRUE);
- }
- }
- }
- }
- /* handle crock where all points are coincident */
- if (!somethingDrawn && (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1)))
- {
- /* not the same as endIsFg computation above */
- pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
- switch (pGC->capStyle) {
- case CapRound:
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, (LineFacePtr) NULL,
- (double)x2, (double)y2,
- FALSE);
- break;
- case CapProjecting:
- x1 = pGC->lineWidth;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x2 - (x1 >> 1), y2 - (x1 >> 1), x1, x1);
- break;
- }
- }
- if (spanData)
- miCleanupSpanData (pDrawable, pGC, spanData);
-}
-
-/* these are stubs to allow old ddx ValidateGCs to work without change */
-
-void
-miMiter()
-{
-}
-
-void
-miNotMiter()
-{
-}
diff --git a/mi/miwideline.h b/mi/miwideline.h
deleted file mode 100644
index f32a1e8fe..000000000
--- a/mi/miwideline.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/* $Xorg: miwideline.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/mi/miwideline.h,v 1.12 2001/12/14 20:00:28 dawes Exp $ */
-
-/* Author: Keith Packard, MIT X Consortium */
-
-#include "mispans.h"
-#include "mifpoly.h" /* for ICEIL */
-
-/*
- * interface data to span-merging polygon filler
- */
-
-typedef struct _SpanData {
- SpanGroup fgGroup, bgGroup;
-} SpanDataRec, *SpanDataPtr;
-
-#define AppendSpanGroup(pGC, pixel, spanPtr, spanData) { \
- SpanGroup *group, *othergroup = NULL; \
- if (pixel == pGC->fgPixel) \
- { \
- group = &spanData->fgGroup; \
- if (pGC->lineStyle == LineDoubleDash) \
- othergroup = &spanData->bgGroup; \
- } \
- else \
- { \
- group = &spanData->bgGroup; \
- othergroup = &spanData->fgGroup; \
- } \
- miAppendSpans (group, othergroup, spanPtr); \
-}
-
-/*
- * Polygon edge description for integer wide-line routines
- */
-
-typedef struct _PolyEdge {
- int height; /* number of scanlines to process */
- int x; /* starting x coordinate */
- int stepx; /* fixed integral dx */
- int signdx; /* variable dx sign */
- int e; /* initial error term */
- int dy;
- int dx;
-} PolyEdgeRec, *PolyEdgePtr;
-
-#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - miter limit constant */
-
-/*
- * types for general polygon routines
- */
-
-typedef struct _PolyVertex {
- double x, y;
-} PolyVertexRec, *PolyVertexPtr;
-
-typedef struct _PolySlope {
- int dx, dy;
- double k; /* x0 * dy - y0 * dx */
-} PolySlopeRec, *PolySlopePtr;
-
-/*
- * Line face description for caps/joins
- */
-
-typedef struct _LineFace {
- double xa, ya;
- int dx, dy;
- int x, y;
- double k;
-} LineFaceRec, *LineFacePtr;
-
-/*
- * macros for polygon fillers
- */
-
-#define MIPOLYRELOADLEFT if (!left_height && left_count) { \
- left_height = left->height; \
- left_x = left->x; \
- left_stepx = left->stepx; \
- left_signdx = left->signdx; \
- left_e = left->e; \
- left_dy = left->dy; \
- left_dx = left->dx; \
- --left_count; \
- ++left; \
- }
-
-#define MIPOLYRELOADRIGHT if (!right_height && right_count) { \
- right_height = right->height; \
- right_x = right->x; \
- right_stepx = right->stepx; \
- right_signdx = right->signdx; \
- right_e = right->e; \
- right_dy = right->dy; \
- right_dx = right->dx; \
- --right_count; \
- ++right; \
- }
-
-#define MIPOLYSTEPLEFT left_x += left_stepx; \
- left_e += left_dx; \
- if (left_e > 0) \
- { \
- left_x += left_signdx; \
- left_e -= left_dy; \
- }
-
-#define MIPOLYSTEPRIGHT right_x += right_stepx; \
- right_e += right_dx; \
- if (right_e > 0) \
- { \
- right_x += right_signdx; \
- right_e -= right_dy; \
- }
-
-#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
- oldPixel = pGC->fgPixel; \
- if (pixel != oldPixel) { \
- DoChangeGC (pGC, GCForeground, (XID *) &pixel, FALSE); \
- ValidateGC (pDrawable, pGC); \
- } \
-}
-#define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
- if (pixel != oldPixel) { \
- DoChangeGC (pGC, GCForeground, (XID *) &oldPixel, FALSE); \
- ValidateGC (pDrawable, pGC); \
- } \
-}
-
-extern void miFillPolyHelper(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- unsigned long /*pixel*/,
- SpanDataPtr /*spanData*/,
- int /*y*/,
- int /*overall_height*/,
- PolyEdgePtr /*left*/,
- PolyEdgePtr /*right*/,
- int /*left_count*/,
- int /*right_count*/
-);
-extern int miRoundJoinFace(
- LineFacePtr /*face*/,
- PolyEdgePtr /*edge*/,
- Bool * /*leftEdge*/
-);
-
-extern void miRoundJoinClip(
- LineFacePtr /*pLeft*/,
- LineFacePtr /*pRight*/,
- PolyEdgePtr /*edge1*/,
- PolyEdgePtr /*edge2*/,
- int * /*y1*/,
- int * /*y2*/,
- Bool * /*left1*/,
- Bool * /*left2*/
-);
-
-extern int miRoundCapClip(
- LineFacePtr /*face*/,
- Bool /*isInt*/,
- PolyEdgePtr /*edge*/,
- Bool * /*leftEdge*/
-);
-
-extern void miLineProjectingCap(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- unsigned long /*pixel*/,
- SpanDataPtr /*spanData*/,
- LineFacePtr /*face*/,
- Bool /*isLeft*/,
- double /*xorg*/,
- double /*yorg*/,
- Bool /*isInt*/
-);
-
-extern SpanDataPtr miSetupSpanData(
- GCPtr /*pGC*/,
- SpanDataPtr /*spanData*/,
- int /*npt*/
-);
-
-extern void miCleanupSpanData(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- SpanDataPtr /*spanData*/
-);
-
-extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
- int xi, int yi, int left, PolyEdgePtr edge);
-extern int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes,
- int count, int xi, int yi, PolyEdgePtr left,
- PolyEdgePtr right, int *pnleft, int *pnright,
- int *h);
-
diff --git a/mi/miwindow.c b/mi/miwindow.c
deleted file mode 100644
index 9c962ee4e..000000000
--- a/mi/miwindow.c
+++ /dev/null
@@ -1,1174 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.10 2003/11/10 18:22:49 tsi Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-#include "X.h"
-#include "regionstr.h"
-#include "region.h"
-#include "mi.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "mivalidate.h"
-
-void
-miClearToBackground(pWin, x, y, w, h, generateExposures)
- WindowPtr pWin;
- int x,y;
- int w,h;
- Bool generateExposures;
-{
- BoxRec box;
- RegionRec reg;
- RegionPtr pBSReg = NullRegion;
- ScreenPtr pScreen;
- BoxPtr extents;
- int x1, y1, x2, y2;
-
- /* compute everything using ints to avoid overflow */
-
- x1 = pWin->drawable.x + x;
- y1 = pWin->drawable.y + y;
- if (w)
- x2 = x1 + (int) w;
- else
- x2 = x1 + (int) pWin->drawable.width - (int) x;
- if (h)
- y2 = y1 + h;
- else
- y2 = y1 + (int) pWin->drawable.height - (int) y;
-
- extents = &pWin->clipList.extents;
-
- /* clip the resulting rectangle to the window clipList extents. This
- * makes sure that the result will fit in a box, given that the
- * screen is < 32768 on a side.
- */
-
- if (x1 < extents->x1)
- x1 = extents->x1;
- if (x2 > extents->x2)
- x2 = extents->x2;
- if (y1 < extents->y1)
- y1 = extents->y1;
- if (y2 > extents->y2)
- y2 = extents->y2;
-
- if (x2 <= x1 || y2 <= y1)
- {
- x2 = x1 = 0;
- y2 = y1 = 0;
- }
-
- box.x1 = x1;
- box.x2 = x2;
- box.y1 = y1;
- box.y2 = y2;
-
- pScreen = pWin->drawable.pScreen;
- REGION_INIT(pScreen, &reg, &box, 1);
- if (pWin->backStorage)
- {
- /*
- * If the window has backing-store on, call through the
- * ClearToBackground vector to handle the special semantics
- * (i.e. things backing store is to be cleared out and
- * an Expose event is to be generated for those areas in backing
- * store if generateExposures is TRUE).
- */
- pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h,
- generateExposures);
- }
-
- REGION_INTERSECT(pScreen, &reg, &reg, &pWin->clipList);
- if (generateExposures)
- (*pScreen->WindowExposures)(pWin, &reg, pBSReg);
- else if (pWin->backgroundState != None)
- (*pScreen->PaintWindowBackground)(pWin, &reg, PW_BACKGROUND);
- REGION_UNINIT(pScreen, &reg);
- if (pBSReg)
- REGION_DESTROY(pScreen, pBSReg);
-}
-
-/*
- * For SaveUnders using backing-store. The idea is that when a window is mapped
- * with saveUnder set TRUE, any windows it obscures will have its backing
- * store turned on setting the DIXsaveUnder bit,
- * The backing-store code must be written to allow for this
- */
-
-/*-
- *-----------------------------------------------------------------------
- * miCheckSubSaveUnder --
- * Check all the inferiors of a window for coverage by saveUnder
- * windows. Called from ChangeSaveUnder and CheckSaveUnder.
- * This code is very inefficient.
- *
- * Results:
- * TRUE if any windows need to have backing-store removed.
- *
- * Side Effects:
- * Windows may have backing-store turned on or off.
- *
- *-----------------------------------------------------------------------
- */
-static Bool
-miCheckSubSaveUnder(
- register WindowPtr pParent, /* Parent to check */
- WindowPtr pFirst, /* first reconfigured window */
- RegionPtr pRegion) /* Initial area obscured by saveUnder */
-{
- register WindowPtr pChild; /* Current child */
- register ScreenPtr pScreen; /* Screen to use */
- RegionRec SubRegion; /* Area of children obscured */
- Bool res = FALSE; /* result */
- Bool subInited=FALSE;/* SubRegion initialized */
-
- pScreen = pParent->drawable.pScreen;
- if ( (pChild = pParent->firstChild) )
- {
- /*
- * build region above first changed window
- */
-
- for (; pChild != pFirst; pChild = pChild->nextSib)
- if (pChild->viewable && pChild->saveUnder)
- REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize);
-
- /*
- * check region below and including first changed window
- */
-
- for (; pChild; pChild = pChild->nextSib)
- {
- if (pChild->viewable)
- {
- /*
- * don't save under nephew/niece windows;
- * use a separate region
- */
-
- if (pChild->firstChild)
- {
- if (!subInited)
- {
- REGION_NULL(pScreen, &SubRegion);
- subInited = TRUE;
- }
- REGION_COPY(pScreen, &SubRegion, pRegion);
- res |= miCheckSubSaveUnder(pChild, pChild->firstChild,
- &SubRegion);
- }
- else
- {
- res |= miCheckSubSaveUnder(pChild, pChild->firstChild,
- pRegion);
- }
-
- if (pChild->saveUnder)
- REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize);
- }
- }
-
- if (subInited)
- REGION_UNINIT(pScreen, &SubRegion);
- }
-
- /*
- * Check the state of this window. DIX save unders are
- * enabled for viewable windows with some client expressing
- * exposure interest and which intersect the save under region
- */
-
- if (pParent->viewable &&
- ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) &&
- REGION_NOTEMPTY(pScreen, &pParent->borderSize) &&
- RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen,
- &pParent->borderSize)) != rgnOUT)
- {
- if (!pParent->DIXsaveUnder)
- {
- pParent->DIXsaveUnder = TRUE;
- (*pScreen->ChangeWindowAttributes) (pParent, CWBackingStore);
- }
- }
- else
- {
- if (pParent->DIXsaveUnder)
- {
- res = TRUE;
- pParent->DIXsaveUnder = FALSE;
- }
- }
- return res;
-}
-
-
-/*-
- *-----------------------------------------------------------------------
- * miChangeSaveUnder --
- * Change the save-under state of a tree of windows. Called when
- * a window with saveUnder TRUE is mapped/unmapped/reconfigured.
- *
- * Results:
- * TRUE if any windows need to have backing-store removed (which
- * means that PostChangeSaveUnder needs to be called later to
- * finish the job).
- *
- * Side Effects:
- * Windows may have backing-store turned on or off.
- *
- *-----------------------------------------------------------------------
- */
-Bool
-miChangeSaveUnder(pWin, first)
- register WindowPtr pWin;
- WindowPtr first; /* First window to check.
- * Used when pWin was restacked */
-{
- RegionRec rgn; /* Area obscured by saveUnder windows */
- register ScreenPtr pScreen;
- Bool res;
-
- if (!deltaSaveUndersViewable && !numSaveUndersViewable)
- return FALSE;
- numSaveUndersViewable += deltaSaveUndersViewable;
- deltaSaveUndersViewable = 0;
- pScreen = pWin->drawable.pScreen;
- REGION_NULL(pScreen, &rgn);
- res = miCheckSubSaveUnder (pWin->parent,
- pWin->saveUnder ? first : pWin->nextSib,
- &rgn);
- REGION_UNINIT(pScreen, &rgn);
- return res;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * miPostChangeSaveUnder --
- * Actually turn backing-store off for those windows that no longer
- * need to have it on.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Backing-store and SAVE_UNDER_CHANGE_BIT are turned off for those
- * windows affected.
- *
- *-----------------------------------------------------------------------
- */
-void
-miPostChangeSaveUnder(pWin, pFirst)
- WindowPtr pWin;
- WindowPtr pFirst;
-{
- register WindowPtr pParent, pChild;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
-
- if (!(pParent = pWin->parent))
- return;
- ChangeWindowAttributes = pParent->drawable.pScreen->ChangeWindowAttributes;
- if (!pParent->DIXsaveUnder &&
- (pParent->backingStore == NotUseful) && pParent->backStorage)
- (*ChangeWindowAttributes)(pParent, CWBackingStore);
- if (!(pChild = pFirst))
- return;
- while (1)
- {
- if (!pChild->DIXsaveUnder &&
- (pChild->backingStore == NotUseful) && pChild->backStorage)
- (*ChangeWindowAttributes)(pChild, CWBackingStore);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- while (!pChild->nextSib)
- {
- pChild = pChild->parent;
- if (pChild == pParent)
- return;
- }
- pChild = pChild->nextSib;
- }
-}
-
-void
-miMarkWindow(pWin)
- register WindowPtr pWin;
-{
- register ValidatePtr val;
-
- if (pWin->valdata)
- return;
- val = (ValidatePtr)xnfalloc(sizeof(ValidateRec));
- val->before.oldAbsCorner.x = pWin->drawable.x;
- val->before.oldAbsCorner.y = pWin->drawable.y;
- val->before.borderVisible = NullRegion;
- val->before.resized = FALSE;
- pWin->valdata = val;
-}
-
-Bool
-miMarkOverlappedWindows(pWin, pFirst, ppLayerWin)
- WindowPtr pWin;
- WindowPtr pFirst;
- WindowPtr *ppLayerWin;
-{
- register BoxPtr box;
- register WindowPtr pChild, pLast;
- Bool anyMarked = FALSE;
- MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow;
- ScreenPtr pScreen;
-
- pScreen = pWin->drawable.pScreen;
-
- /* single layered systems are easy */
- if (ppLayerWin) *ppLayerWin = pWin;
-
- if (pWin == pFirst)
- {
- /* Blindly mark pWin and all of its inferiors. This is a slight
- * overkill if there are mapped windows that outside pWin's border,
- * but it's better than wasting time on RectIn checks.
- */
- pChild = pWin;
- while (1)
- {
- if (pChild->viewable)
- {
- if (REGION_BROKEN (pScreen, &pChild->winSize))
- SetWinSize (pChild);
- if (REGION_BROKEN (pScreen, &pChild->borderSize))
- SetBorderSize (pChild);
- (* MarkWindow)(pChild);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
- anyMarked = TRUE;
- pFirst = pFirst->nextSib;
- }
- if ( (pChild = pFirst) )
- {
- box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize);
- pLast = pChild->parent->lastChild;
- while (1)
- {
- if (pChild->viewable)
- {
- if (REGION_BROKEN (pScreen, &pChild->winSize))
- SetWinSize (pChild);
- if (REGION_BROKEN (pScreen, &pChild->borderSize))
- SetBorderSize (pChild);
- if (RECT_IN_REGION(pScreen, &pChild->borderSize, box))
- {
- (* MarkWindow)(pChild);
- anyMarked = TRUE;
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- }
- while (!pChild->nextSib && (pChild != pLast))
- pChild = pChild->parent;
- if (pChild == pLast)
- break;
- pChild = pChild->nextSib;
- }
- }
- if (anyMarked)
- (* MarkWindow)(pWin->parent);
- return anyMarked;
-}
-
-/*****
- * miHandleValidateExposures(pWin)
- * starting at pWin, draw background in any windows that have exposure
- * regions, translate the regions, restore any backing store,
- * and then send any regions still exposed to the client
- *****/
-void
-miHandleValidateExposures(pWin)
- WindowPtr pWin;
-{
- register WindowPtr pChild;
- register ValidatePtr val;
- ScreenPtr pScreen;
- WindowExposuresProcPtr WindowExposures;
-
- pScreen = pWin->drawable.pScreen;
-
- pChild = pWin;
- WindowExposures = pChild->drawable.pScreen->WindowExposures;
- while (1)
- {
- if ( (val = pChild->valdata) )
- {
- if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed))
- (*pChild->drawable.pScreen->PaintWindowBorder)(pChild,
- &val->after.borderExposed,
- PW_BORDER);
- REGION_UNINIT(pScreen, &val->after.borderExposed);
- (*WindowExposures)(pChild, &val->after.exposed, NullRegion);
- REGION_UNINIT(pScreen, &val->after.exposed);
- xfree(val);
- pChild->valdata = (ValidatePtr)NULL;
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-void
-miMoveWindow(pWin, x, y, pNextSib, kind)
- register WindowPtr pWin;
- int x,y;
- WindowPtr pNextSib;
- VTKind kind;
-{
- WindowPtr pParent;
- Bool WasViewable = (Bool)(pWin->viewable);
- short bw;
- RegionPtr oldRegion = NULL;
- DDXPointRec oldpt;
- Bool anyMarked = FALSE;
- register ScreenPtr pScreen;
- WindowPtr windowToValidate;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- /* if this is a root window, can't be moved */
- if (!(pParent = pWin->parent))
- return ;
- pScreen = pWin->drawable.pScreen;
- bw = wBorderWidth (pWin);
-
- oldpt.x = pWin->drawable.x;
- oldpt.y = pWin->drawable.y;
- if (WasViewable)
- {
- oldRegion = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldRegion, &pWin->borderClip);
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin);
- }
- pWin->origin.x = x + (int)bw;
- pWin->origin.y = y + (int)bw;
- x = pWin->drawable.x = pParent->drawable.x + x + (int)bw;
- y = pWin->drawable.y = pParent->drawable.y + y + (int)bw;
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- (*pScreen->PositionWindow)(pWin, x, y);
-
- windowToValidate = MoveWindowInStack(pWin, pNextSib);
-
- ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0);
-
- if (WasViewable)
- {
- if (pLayerWin == pWin)
- anyMarked |= (*pScreen->MarkOverlappedWindows)
- (pWin, windowToValidate, (WindowPtr *)NULL);
- else
- anyMarked |= (*pScreen->MarkOverlappedWindows)
- (pWin, pLayerWin, (WindowPtr *)NULL);
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, windowToValidate);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- {
- (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind);
- (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion);
- REGION_DESTROY(pScreen, oldRegion);
- /* XXX need to retile border if ParentRelative origin */
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, windowToValidate);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-
-/*
- * pValid is a region of the screen which has been
- * successfully copied -- recomputed exposed regions for affected windows
- */
-
-static int
-miRecomputeExposures (
- register WindowPtr pWin,
- pointer value) /* must conform to VisitWindowProcPtr */
-{
- register ScreenPtr pScreen;
- RegionPtr pValid = (RegionPtr)value;
-
- if (pWin->valdata)
- {
- pScreen = pWin->drawable.pScreen;
- /*
- * compute exposed regions of this window
- */
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed,
- &pWin->clipList, pValid);
- /*
- * compute exposed regions of the border
- */
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed,
- &pWin->borderClip, &pWin->winSize);
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed,
- &pWin->valdata->after.borderExposed, pValid);
- return WT_WALKCHILDREN;
- }
- return WT_NOMATCH;
-}
-
-void
-miSlideAndSizeWindow(pWin, x, y, w, h, pSib)
- register WindowPtr pWin;
- int x,y;
- unsigned int w, h;
- WindowPtr pSib;
-{
- WindowPtr pParent;
- Bool WasViewable = (Bool)(pWin->viewable);
- unsigned short width = pWin->drawable.width,
- height = pWin->drawable.height;
- short oldx = pWin->drawable.x,
- oldy = pWin->drawable.y;
- int bw = wBorderWidth (pWin);
- short dw, dh;
- DDXPointRec oldpt;
- RegionPtr oldRegion = NULL;
- Bool anyMarked = FALSE;
- register ScreenPtr pScreen;
- WindowPtr pFirstChange;
- register WindowPtr pChild;
- RegionPtr gravitate[StaticGravity + 1];
- register unsigned g;
- int nx, ny; /* destination x,y */
- int newx, newy; /* new inner window position */
- RegionPtr pRegion = NULL;
- RegionPtr destClip; /* portions of destination already written */
- RegionPtr oldWinClip = NULL; /* old clip list for window */
- RegionPtr borderVisible = NullRegion; /* visible area of the border */
- RegionPtr bsExposed = NullRegion; /* backing store exposures */
- Bool shrunk = FALSE; /* shrunk in an inner dimension */
- Bool moved = FALSE; /* window position changed */
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- /* if this is a root window, can't be resized */
- if (!(pParent = pWin->parent))
- return ;
-
- pScreen = pWin->drawable.pScreen;
- newx = pParent->drawable.x + x + bw;
- newy = pParent->drawable.y + y + bw;
- if (WasViewable)
- {
- anyMarked = FALSE;
- /*
- * save the visible region of the window
- */
- oldRegion = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldRegion, &pWin->winSize);
-
- /*
- * categorize child windows into regions to be moved
- */
- for (g = 0; g <= StaticGravity; g++)
- gravitate[g] = (RegionPtr) NULL;
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
- {
- g = pChild->winGravity;
- if (g != UnmapGravity)
- {
- if (!gravitate[g])
- gravitate[g] = REGION_CREATE(pScreen, NullBox, 1);
- REGION_UNION(pScreen, gravitate[g],
- gravitate[g], &pChild->borderClip);
- }
- else
- {
- UnmapWindow(pChild, TRUE);
- anyMarked = TRUE;
- }
- }
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- &pLayerWin);
-
- oldWinClip = NULL;
- if (pWin->bitGravity != ForgetGravity)
- {
- oldWinClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, oldWinClip, &pWin->clipList);
- }
- /*
- * if the window is changing size, borderExposed
- * can't be computed correctly without some help.
- */
- if (pWin->drawable.height > h || pWin->drawable.width > w)
- shrunk = TRUE;
-
- if (newx != oldx || newy != oldy)
- moved = TRUE;
-
- if ((pWin->drawable.height != h || pWin->drawable.width != w) &&
- HasBorder (pWin))
- {
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- /* for tiled borders, we punt and draw the whole thing */
- if (pWin->borderIsPixel || !moved)
- {
- if (shrunk || moved)
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip,
- &pWin->winSize);
- else
- REGION_COPY(pScreen, borderVisible,
- &pWin->borderClip);
- }
- }
- }
- pWin->origin.x = x + bw;
- pWin->origin.y = y + bw;
- pWin->drawable.height = h;
- pWin->drawable.width = w;
-
- x = pWin->drawable.x = newx;
- y = pWin->drawable.y = newy;
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- dw = (int)w - (int)width;
- dh = (int)h - (int)height;
- ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh);
-
- /* let the hardware adjust background and border pixmaps, if any */
- (*pScreen->PositionWindow)(pWin, x, y);
-
- pFirstChange = MoveWindowInStack(pWin, pSib);
-
- if (WasViewable)
- {
- pRegion = REGION_CREATE(pScreen, NullBox, 1);
- if (pWin->backStorage)
- REGION_COPY(pScreen, pRegion, &pWin->clipList);
-
- if (pLayerWin == pWin)
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange,
- (WindowPtr *)NULL);
- else
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin,
- (WindowPtr *)NULL);
-
- if (pWin->valdata)
- {
- pWin->valdata->before.resized = TRUE;
- pWin->valdata->before.borderVisible = borderVisible;
- }
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther);
- /*
- * the entire window is trashed unless bitGravity
- * recovers portions of it
- */
- REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList);
- }
-
- GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny);
-
- if (pWin->backStorage &&
- ((pWin->backingStore == Always) || WasViewable))
- {
- if (!WasViewable)
- pRegion = &pWin->clipList; /* a convenient empty region */
- if (pWin->bitGravity == ForgetGravity)
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, NullRegion, oldx, oldy);
- else
- {
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, nx - x, ny - y, pRegion, oldx, oldy);
- }
- }
-
- if (WasViewable)
- {
- /* avoid the border */
- if (HasBorder (pWin))
- {
- int offx, offy, dx, dy;
-
- /* kruft to avoid double translates for each gravity */
- offx = 0;
- offy = 0;
- for (g = 0; g <= StaticGravity; g++)
- {
- if (!gravitate[g])
- continue;
-
- /* align winSize to gravitate[g].
- * winSize is in new coordinates,
- * gravitate[g] is still in old coordinates */
- GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
-
- dx = (oldx - nx) - offx;
- dy = (oldy - ny) - offy;
- if (dx || dy)
- {
- REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy);
- offx += dx;
- offy += dy;
- }
- REGION_INTERSECT(pScreen, gravitate[g], gravitate[g],
- &pWin->winSize);
- }
- /* get winSize back where it belongs */
- if (offx || offy)
- REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy);
- }
- /*
- * add screen bits to the appropriate bucket
- */
-
- if (oldWinClip)
- {
- /*
- * clip to new clipList
- */
- REGION_COPY(pScreen, pRegion, oldWinClip);
- REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy);
- REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList);
- /*
- * don't step on any gravity bits which will be copied after this
- * region. Note -- this assumes that the regions will be copied
- * in gravity order.
- */
- for (g = pWin->bitGravity + 1; g <= StaticGravity; g++)
- {
- if (gravitate[g])
- REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip,
- gravitate[g]);
- }
- REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny);
- g = pWin->bitGravity;
- if (!gravitate[g])
- gravitate[g] = oldWinClip;
- else
- {
- REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip);
- REGION_DESTROY(pScreen, oldWinClip);
- }
- }
-
- /*
- * move the bits on the screen
- */
-
- destClip = NULL;
-
- for (g = 0; g <= StaticGravity; g++)
- {
- if (!gravitate[g])
- continue;
-
- GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny);
-
- oldpt.x = oldx + (x - nx);
- oldpt.y = oldy + (y - ny);
-
- /* Note that gravitate[g] is *translated* by CopyWindow */
-
- /* only copy the remaining useful bits */
-
- REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion);
-
- /* clip to not overwrite already copied areas */
-
- if (destClip) {
- REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y);
- REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip);
- REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y);
- }
-
- /* and move those bits */
-
- if (oldpt.x != x || oldpt.y != y)
- (*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]);
-
- /* remove any overwritten bits from the remaining useful bits */
-
- REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]);
-
- /*
- * recompute exposed regions of child windows
- */
-
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
- {
- if (pChild->winGravity != g)
- continue;
- REGION_INTERSECT(pScreen, pRegion,
- &pChild->borderClip, gravitate[g]);
- TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion);
- }
-
- /*
- * remove the successfully copied regions of the
- * window from its exposed region
- */
-
- if (g == pWin->bitGravity)
- REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed,
- &pWin->valdata->after.exposed, gravitate[g]);
- if (!destClip)
- destClip = gravitate[g];
- else
- {
- REGION_UNION(pScreen, destClip, destClip, gravitate[g]);
- REGION_DESTROY(pScreen, gravitate[g]);
- }
- }
-
- REGION_DESTROY(pScreen, oldRegion);
- REGION_DESTROY(pScreen, pRegion);
- if (destClip)
- REGION_DESTROY(pScreen, destClip);
- if (bsExposed)
- {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- if (anyMarked)
- (*pScreen->HandleExposures)(pLayerWin->parent);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- {
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange);
- }
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange,
- VTOther);
- }
- else if (bsExposed)
- {
- (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-WindowPtr
-miGetLayerWindow(pWin)
- WindowPtr pWin;
-{
- return pWin->firstChild;
-}
-
-#ifdef SHAPE
-/******
- *
- * miSetShape
- * The border/window shape has changed. Recompute winSize/borderSize
- * and send appropriate exposure events
- */
-
-void
-miSetShape(pWin)
- register WindowPtr pWin;
-{
- Bool WasViewable = (Bool)(pWin->viewable);
- register ScreenPtr pScreen = pWin->drawable.pScreen;
- Bool anyMarked = FALSE;
- RegionPtr pOldClip = NULL, bsExposed;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- if (WasViewable)
- {
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- &pLayerWin);
- if (pWin->valdata)
- {
- if (HasBorder (pWin))
- {
- RegionPtr borderVisible;
-
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- }
- pWin->valdata->before.resized = TRUE;
- }
- }
-
- SetWinSize (pWin);
- SetBorderSize (pWin);
-
- ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
-
- if (WasViewable)
- {
- if (pWin->backStorage)
- {
- pOldClip = REGION_CREATE(pScreen, NullBox, 1);
- REGION_COPY(pScreen, pOldClip, &pWin->clipList);
- }
-
- anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- (WindowPtr *)NULL);
-
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther);
- }
-
- if (pWin->backStorage &&
- ((pWin->backingStore == Always) || WasViewable))
- {
- if (!WasViewable)
- pOldClip = &pWin->clipList; /* a convenient empty region */
- bsExposed = (*pScreen->TranslateBackingStore)
- (pWin, 0, 0, pOldClip,
- pWin->drawable.x, pWin->drawable.y);
- if (WasViewable)
- REGION_DESTROY(pScreen, pOldClip);
- if (bsExposed)
- {
- RegionPtr valExposed = NullRegion;
-
- if (pWin->valdata)
- valExposed = &pWin->valdata->after.exposed;
- (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
- if (valExposed)
- REGION_EMPTY(pScreen, valExposed);
- REGION_DESTROY(pScreen, bsExposed);
- }
- }
- if (WasViewable)
- {
- if (anyMarked)
- (*pScreen->HandleExposures)(pLayerWin->parent);
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
- CheckCursorConfinement(pWin);
-}
-#endif
-
-/* Keeps the same inside(!) origin */
-
-void
-miChangeBorderWidth(pWin, width)
- register WindowPtr pWin;
- unsigned int width;
-{
- int oldwidth;
- Bool anyMarked = FALSE;
- register ScreenPtr pScreen;
- Bool WasViewable = (Bool)(pWin->viewable);
- Bool HadBorder;
-#ifdef DO_SAVE_UNDERS
- Bool dosave = FALSE;
-#endif
- WindowPtr pLayerWin;
-
- oldwidth = wBorderWidth (pWin);
- if (oldwidth == width)
- return;
- HadBorder = HasBorder(pWin);
- pScreen = pWin->drawable.pScreen;
- if (WasViewable && width < oldwidth)
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin);
-
- pWin->borderWidth = width;
- SetBorderSize (pWin);
-
- if (WasViewable)
- {
- if (width > oldwidth)
- {
- anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- &pLayerWin);
- /*
- * save the old border visible region to correctly compute
- * borderExposed.
- */
- if (pWin->valdata && HadBorder)
- {
- RegionPtr borderVisible;
- borderVisible = REGION_CREATE(pScreen, NULL, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
- &pWin->borderClip, &pWin->winSize);
- pWin->valdata->before.borderVisible = borderVisible;
- }
- }
-#ifdef DO_SAVE_UNDERS
- if (DO_SAVE_UNDERS(pWin))
- {
- dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib);
- }
-#endif /* DO_SAVE_UNDERS */
-
- if (anyMarked)
- {
- (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther);
- (*pScreen->HandleExposures)(pLayerWin->parent);
- }
-#ifdef DO_SAVE_UNDERS
- if (dosave)
- (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib);
-#endif /* DO_SAVE_UNDERS */
- if (anyMarked && pScreen->PostValidateTree)
- (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin,
- VTOther);
- }
- if (pWin->realized)
- WindowsRestructured ();
-}
-
-void
-miMarkUnrealizedWindow(pChild, pWin, fromConfigure)
- WindowPtr pChild;
- WindowPtr pWin;
- Bool fromConfigure;
-{
- if ((pChild != pWin) || fromConfigure)
- {
- REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList);
- if (pChild->drawable.pScreen->ClipNotify)
- (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0);
- REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip);
- }
-}
-
-void
-miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth)
-{
- ScreenPtr pScreen;
- WindowPtr pChild;
-
- pScreen = pWin->drawable.pScreen;
-
- for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
- {
- if (pChild->drawable.depth == depth)
- REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip);
-
- if (pChild->firstChild)
- miSegregateChildren(pChild, pReg, depth);
- }
-}
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
deleted file mode 100644
index e2233e78e..000000000
--- a/mi/mizerarc.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mizerarc.c,v 1.7 2003/07/16 01:38:59 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Author: Bob Scheifler, MIT X Consortium
-
-********************************************************/
-
-/* $Xorg: mizerarc.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-/* Derived from:
- * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
- * by M. L. V. Pitteway
- * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
- */
-
-#include <math.h>
-#include "X.h"
-#include "Xprotostr.h"
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mi.h"
-#include "mizerarc.h"
-
-#define FULLCIRCLE (360 * 64)
-#define OCTANT (45 * 64)
-#define QUADRANT (90 * 64)
-#define HALFCIRCLE (180 * 64)
-#define QUADRANT3 (270 * 64)
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define Dsin(d) ((d) == 0 ? 0.0 : ((d) == QUADRANT ? 1.0 : \
- ((d) == HALFCIRCLE ? 0.0 : \
- ((d) == QUADRANT3 ? -1.0 : sin((double)d*(M_PI/11520.0))))))
-
-#define Dcos(d) ((d) == 0 ? 1.0 : ((d) == QUADRANT ? 0.0 : \
- ((d) == HALFCIRCLE ? -1.0 : \
- ((d) == QUADRANT3 ? 0.0 : cos((double)d*(M_PI/11520.0))))))
-
-#define EPSILON45 64
-
-typedef struct {
- int skipStart;
- int haveStart;
- DDXPointRec startPt;
- int haveLast;
- int skipLast;
- DDXPointRec endPt;
- int dashIndex;
- int dashOffset;
- int dashIndexInit;
- int dashOffsetInit;
-} DashInfo;
-
-static miZeroArcPtRec oob = {65536, 65536, 0};
-
-/*
- * (x - l)^2 / (W/2)^2 + (y + H/2)^2 / (H/2)^2 = 1
- *
- * where l is either 0 or .5
- *
- * alpha = 4(W^2)
- * beta = 4(H^2)
- * gamma = 0
- * u = 2(W^2)H
- * v = 4(H^2)l
- * k = -4(H^2)(l^2)
- *
- */
-
-Bool
-miZeroArcSetup(arc, info, ok360)
- register xArc *arc;
- register miZeroArcRec *info;
- Bool ok360;
-{
- int l;
- int angle1, angle2;
- int startseg, endseg;
- int startAngle, endAngle;
- int i, overlap;
- miZeroArcPtRec start, end;
-
- l = arc->width & 1;
- if (arc->width == arc->height)
- {
- info->alpha = 4;
- info->beta = 4;
- info->k1 = -8;
- info->k3 = -16;
- info->b = 12;
- info->a = (arc->width << 2) - 12;
- info->d = 17 - (arc->width << 1);
- if (l)
- {
- info->b -= 4;
- info->a += 4;
- info->d -= 7;
- }
- }
- else if (!arc->width || !arc->height)
- {
- info->alpha = 0;
- info->beta = 0;
- info->k1 = 0;
- info->k3 = 0;
- info->a = -(int)arc->height;
- info->b = 0;
- info->d = -1;
- }
- else
- {
- /* initial conditions */
- info->alpha = (arc->width * arc->width) << 2;
- info->beta = (arc->height * arc->height) << 2;
- info->k1 = info->beta << 1;
- info->k3 = info->k1 + (info->alpha << 1);
- info->b = l ? 0 : -info->beta;
- info->a = info->alpha * arc->height;
- info->d = info->b - (info->a >> 1) - (info->alpha >> 2);
- if (l)
- info->d -= info->beta >> 2;
- info->a -= info->b;
- /* take first step, d < 0 always */
- info->b -= info->k1;
- info->a += info->k1;
- info->d += info->b;
- /* octant change, b < 0 always */
- info->k1 = -info->k1;
- info->k3 = -info->k3;
- info->b = -info->b;
- info->d = info->b - info->a - info->d;
- info->a = info->a - (info->b << 1);
- }
- info->dx = 1;
- info->dy = 0;
- info->w = (arc->width + 1) >> 1;
- info->h = arc->height >> 1;
- info->xorg = arc->x + (arc->width >> 1);
- info->yorg = arc->y;
- info->xorgo = info->xorg + l;
- info->yorgo = info->yorg + arc->height;
- if (!arc->width)
- {
- if (!arc->height)
- {
- info->x = 0;
- info->y = 0;
- info->initialMask = 0;
- info->startAngle = 0;
- info->endAngle = 0;
- info->start = oob;
- info->end = oob;
- return FALSE;
- }
- info->x = 0;
- info->y = 1;
- }
- else
- {
- info->x = 1;
- info->y = 0;
- }
- angle1 = arc->angle1;
- angle2 = arc->angle2;
- if ((angle1 == 0) && (angle2 >= FULLCIRCLE))
- {
- startAngle = 0;
- endAngle = 0;
- }
- else
- {
- if (angle2 > FULLCIRCLE)
- angle2 = FULLCIRCLE;
- else if (angle2 < -FULLCIRCLE)
- angle2 = -FULLCIRCLE;
- if (angle2 < 0)
- {
- startAngle = angle1 + angle2;
- endAngle = angle1;
- }
- else
- {
- startAngle = angle1;
- endAngle = angle1 + angle2;
- }
- if (startAngle < 0)
- startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
- if (startAngle >= FULLCIRCLE)
- startAngle = startAngle % FULLCIRCLE;
- if (endAngle < 0)
- endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE;
- if (endAngle >= FULLCIRCLE)
- endAngle = endAngle % FULLCIRCLE;
- }
- info->startAngle = startAngle;
- info->endAngle = endAngle;
- if (ok360 && (startAngle == endAngle) && arc->angle2 &&
- arc->width && arc->height)
- {
- info->initialMask = 0xf;
- info->start = oob;
- info->end = oob;
- return TRUE;
- }
- startseg = startAngle / OCTANT;
- if (!arc->height || (((startseg + 1) & 2) && arc->width))
- {
- start.x = Dcos(startAngle) * ((arc->width + 1) / 2.0);
- if (start.x < 0)
- start.x = -start.x;
- start.y = -1;
- }
- else
- {
- start.y = Dsin(startAngle) * (arc->height / 2.0);
- if (start.y < 0)
- start.y = -start.y;
- start.y = info->h - start.y;
- start.x = 65536;
- }
- endseg = endAngle / OCTANT;
- if (!arc->height || (((endseg + 1) & 2) && arc->width))
- {
- end.x = Dcos(endAngle) * ((arc->width + 1) / 2.0);
- if (end.x < 0)
- end.x = -end.x;
- end.y = -1;
- }
- else
- {
- end.y = Dsin(endAngle) * (arc->height / 2.0);
- if (end.y < 0)
- end.y = -end.y;
- end.y = info->h - end.y;
- end.x = 65536;
- }
- info->firstx = start.x;
- info->firsty = start.y;
- info->initialMask = 0;
- overlap = arc->angle2 && (endAngle <= startAngle);
- for (i = 0; i < 4; i++)
- {
- if (overlap ?
- ((i * QUADRANT <= endAngle) || ((i + 1) * QUADRANT > startAngle)) :
- ((i * QUADRANT <= endAngle) && ((i + 1) * QUADRANT > startAngle)))
- info->initialMask |= (1 << i);
- }
- start.mask = info->initialMask;
- end.mask = info->initialMask;
- startseg >>= 1;
- endseg >>= 1;
- overlap = overlap && (endseg == startseg);
- if (start.x != end.x || start.y != end.y || !overlap)
- {
- if (startseg & 1)
- {
- if (!overlap)
- info->initialMask &= ~(1 << startseg);
- if (start.x > end.x || start.y > end.y)
- end.mask &= ~(1 << startseg);
- }
- else
- {
- start.mask &= ~(1 << startseg);
- if (((start.x < end.x || start.y < end.y) ||
- (start.x == end.x && start.y == end.y && (endseg & 1))) &&
- !overlap)
- end.mask &= ~(1 << startseg);
- }
- if (endseg & 1)
- {
- end.mask &= ~(1 << endseg);
- if (((start.x > end.x || start.y > end.y) ||
- (start.x == end.x && start.y == end.y && !(startseg & 1))) &&
- !overlap)
- start.mask &= ~(1 << endseg);
- }
- else
- {
- if (!overlap)
- info->initialMask &= ~(1 << endseg);
- if (start.x < end.x || start.y < end.y)
- start.mask &= ~(1 << endseg);
- }
- }
- /* take care of case when start and stop are both near 45 */
- /* handle here rather than adding extra code to pixelization loops */
- if (startAngle &&
- ((start.y < 0 && end.y >= 0) || (start.y >= 0 && end.y < 0)))
- {
- i = (startAngle + OCTANT) % OCTANT;
- if (i < EPSILON45 || i > OCTANT - EPSILON45)
- {
- i = (endAngle + OCTANT) % OCTANT;
- if (i < EPSILON45 || i > OCTANT - EPSILON45)
- {
- if (start.y < 0)
- {
- i = Dsin(startAngle) * (arc->height / 2.0);
- if (i < 0)
- i = -i;
- if (info->h - i == end.y)
- start.mask = end.mask;
- }
- else
- {
- i = Dsin(endAngle) * (arc->height / 2.0);
- if (i < 0)
- i = -i;
- if (info->h - i == start.y)
- end.mask = start.mask;
- }
- }
- }
- }
- if (startseg & 1)
- {
- info->start = start;
- info->end = oob;
- }
- else
- {
- info->end = start;
- info->start = oob;
- }
- if (endseg & 1)
- {
- info->altend = end;
- if (info->altend.x < info->end.x || info->altend.y < info->end.y)
- {
- miZeroArcPtRec tmp;
- tmp = info->altend;
- info->altend = info->end;
- info->end = tmp;
- }
- info->altstart = oob;
- }
- else
- {
- info->altstart = end;
- if (info->altstart.x < info->start.x ||
- info->altstart.y < info->start.y)
- {
- miZeroArcPtRec tmp;
- tmp = info->altstart;
- info->altstart = info->start;
- info->start = tmp;
- }
- info->altend = oob;
- }
- if (!info->start.x || !info->start.y)
- {
- info->initialMask = info->start.mask;
- info->start = info->altstart;
- }
- if (!arc->width && (arc->height == 1))
- {
- /* kludge! */
- info->initialMask |= info->end.mask;
- info->initialMask |= info->initialMask << 1;
- info->end.x = 0;
- info->end.mask = 0;
- }
- return FALSE;
-}
-
-#define Pixelate(xval,yval) \
- { \
- pts->x = xval; \
- pts->y = yval; \
- pts++; \
- }
-
-#define DoPix(idx,xval,yval) if (mask & (1 << idx)) Pixelate(xval, yval);
-
-DDXPointPtr
-miZeroArcPts(arc, pts)
- xArc *arc;
- register DDXPointPtr pts;
-{
- miZeroArcRec info;
- register int x, y, a, b, d, mask;
- register int k1, k3, dx, dy;
- Bool do360;
-
- do360 = miZeroArcSetup(arc, &info, TRUE);
- MIARCSETUP();
- mask = info.initialMask;
- if (!(arc->width & 1))
- {
- DoPix(1, info.xorgo, info.yorg);
- DoPix(3, info.xorgo, info.yorgo);
- }
- if (!info.end.x || !info.end.y)
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- if (do360 && (arc->width == arc->height) && !(arc->width & 1))
- {
- int yorgh = info.yorg + info.h;
- int xorghp = info.xorg + info.h;
- int xorghn = info.xorg - info.h;
-
- while (1)
- {
- Pixelate(info.xorg + x, info.yorg + y);
- Pixelate(info.xorg - x, info.yorg + y);
- Pixelate(info.xorg - x, info.yorgo - y);
- Pixelate(info.xorg + x, info.yorgo - y);
- if (a < 0)
- break;
- Pixelate(xorghp - y, yorgh - x);
- Pixelate(xorghn + y, yorgh - x);
- Pixelate(xorghn + y, yorgh + x);
- Pixelate(xorghp - y, yorgh + x);
- MIARCCIRCLESTEP(;);
- }
- if (x > 1 && pts[-1].x == pts[-5].x && pts[-1].y == pts[-5].y)
- pts -= 4;
- x = info.w;
- y = info.h;
- }
- else if (do360)
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(;);
- Pixelate(info.xorg + x, info.yorg + y);
- Pixelate(info.xorgo - x, info.yorg + y);
- Pixelate(info.xorgo - x, info.yorgo - y);
- Pixelate(info.xorg + x, info.yorgo - y);
- MIARCSTEP(;,;);
- }
- }
- else
- {
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(;);
- if ((x == info.start.x) || (y == info.start.y))
- {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(0, info.xorg + x, info.yorg + y);
- DoPix(1, info.xorgo - x, info.yorg + y);
- DoPix(2, info.xorgo - x, info.yorgo - y);
- DoPix(3, info.xorg + x, info.yorgo - y);
- if ((x == info.end.x) || (y == info.end.y))
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(;,;);
- }
- }
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- DoPix(0, info.xorg + x, info.yorg + y);
- DoPix(2, info.xorgo - x, info.yorgo - y);
- if (arc->height & 1)
- {
- DoPix(1, info.xorgo - x, info.yorg + y);
- DoPix(3, info.xorg + x, info.yorgo - y);
- }
- return pts;
-}
-
-#undef DoPix
-#define DoPix(idx,xval,yval) \
- if (mask & (1 << idx)) \
- { \
- arcPts[idx]->x = xval; \
- arcPts[idx]->y = yval; \
- arcPts[idx]++; \
- }
-
-static void
-miZeroArcDashPts(
- GCPtr pGC,
- xArc *arc,
- DashInfo *dinfo,
- register DDXPointPtr points,
- int maxPts,
- register DDXPointPtr *evenPts,
- register DDXPointPtr *oddPts )
-{
- miZeroArcRec info;
- register int x, y, a, b, d, mask;
- register int k1, k3, dx, dy;
- int dashRemaining;
- DDXPointPtr arcPts[4];
- DDXPointPtr startPts[5], endPts[5];
- int deltas[5];
- DDXPointPtr startPt, pt, lastPt, pts;
- int i, j, delta, ptsdelta, seg, startseg;
-
- for (i = 0; i < 4; i++)
- arcPts[i] = points + (i * maxPts);
- (void)miZeroArcSetup(arc, &info, FALSE);
- MIARCSETUP();
- mask = info.initialMask;
- startseg = info.startAngle / QUADRANT;
- startPt = arcPts[startseg];
- if (!(arc->width & 1))
- {
- DoPix(1, info.xorgo, info.yorg);
- DoPix(3, info.xorgo, info.yorgo);
- }
- if (!info.end.x || !info.end.y)
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- while (y < info.h || x < info.w)
- {
- MIARCOCTANTSHIFT(;);
- if ((x == info.firstx) || (y == info.firsty))
- startPt = arcPts[startseg];
- if ((x == info.start.x) || (y == info.start.y))
- {
- mask = info.start.mask;
- info.start = info.altstart;
- }
- DoPix(0, info.xorg + x, info.yorg + y);
- DoPix(1, info.xorgo - x, info.yorg + y);
- DoPix(2, info.xorgo - x, info.yorgo - y);
- DoPix(3, info.xorg + x, info.yorgo - y);
- if ((x == info.end.x) || (y == info.end.y))
- {
- mask = info.end.mask;
- info.end = info.altend;
- }
- MIARCSTEP(;,;);
- }
- if ((x == info.firstx) || (y == info.firsty))
- startPt = arcPts[startseg];
- if ((x == info.start.x) || (y == info.start.y))
- mask = info.start.mask;
- DoPix(0, info.xorg + x, info.yorg + y);
- DoPix(2, info.xorgo - x, info.yorgo - y);
- if (arc->height & 1)
- {
- DoPix(1, info.xorgo - x, info.yorg + y);
- DoPix(3, info.xorg + x, info.yorgo - y);
- }
- for (i = 0; i < 4; i++)
- {
- seg = (startseg + i) & 3;
- pt = points + (seg * maxPts);
- if (seg & 1)
- {
- startPts[i] = pt;
- endPts[i] = arcPts[seg];
- deltas[i] = 1;
- }
- else
- {
- startPts[i] = arcPts[seg] - 1;
- endPts[i] = pt - 1;
- deltas[i] = -1;
- }
- }
- startPts[4] = startPts[0];
- endPts[4] = startPt;
- startPts[0] = startPt;
- if (startseg & 1)
- {
- if (startPts[4] != endPts[4])
- endPts[4]--;
- deltas[4] = 1;
- }
- else
- {
- if (startPts[0] > startPts[4])
- startPts[0]--;
- if (startPts[4] < endPts[4])
- endPts[4]--;
- deltas[4] = -1;
- }
- if (arc->angle2 < 0)
- {
- DDXPointPtr tmps, tmpe;
- int tmpd;
-
- tmpd = deltas[0];
- tmps = startPts[0] - tmpd;
- tmpe = endPts[0] - tmpd;
- startPts[0] = endPts[4] - deltas[4];
- endPts[0] = startPts[4] - deltas[4];
- deltas[0] = -deltas[4];
- startPts[4] = tmpe;
- endPts[4] = tmps;
- deltas[4] = -tmpd;
- tmpd = deltas[1];
- tmps = startPts[1] - tmpd;
- tmpe = endPts[1] - tmpd;
- startPts[1] = endPts[3] - deltas[3];
- endPts[1] = startPts[3] - deltas[3];
- deltas[1] = -deltas[3];
- startPts[3] = tmpe;
- endPts[3] = tmps;
- deltas[3] = -tmpd;
- tmps = startPts[2] - deltas[2];
- startPts[2] = endPts[2] - deltas[2];
- endPts[2] = tmps;
- deltas[2] = -deltas[2];
- }
- for (i = 0; i < 5 && startPts[i] == endPts[i]; i++)
- ;
- if (i == 5)
- return;
- pt = startPts[i];
- for (j = 4; startPts[j] == endPts[j]; j--)
- ;
- lastPt = endPts[j] - deltas[j];
- if (dinfo->haveLast &&
- (pt->x == dinfo->endPt.x) && (pt->y == dinfo->endPt.y))
- {
- startPts[i] += deltas[i];
- }
- else
- {
- dinfo->dashIndex = dinfo->dashIndexInit;
- dinfo->dashOffset = dinfo->dashOffsetInit;
- }
- if (!dinfo->skipStart && (info.startAngle != info.endAngle))
- {
- dinfo->startPt = *pt;
- dinfo->haveStart = TRUE;
- }
- else if (!dinfo->skipLast && dinfo->haveStart &&
- (lastPt->x == dinfo->startPt.x) &&
- (lastPt->y == dinfo->startPt.y) &&
- (lastPt != startPts[i]))
- endPts[j] = lastPt;
- if (info.startAngle != info.endAngle)
- {
- dinfo->haveLast = TRUE;
- dinfo->endPt = *lastPt;
- }
- dashRemaining = pGC->dash[dinfo->dashIndex] - dinfo->dashOffset;
- for (i = 0; i < 5; i++)
- {
- pt = startPts[i];
- lastPt = endPts[i];
- delta = deltas[i];
- while (pt != lastPt)
- {
- if (dinfo->dashIndex & 1)
- {
- pts = *oddPts;
- ptsdelta = -1;
- }
- else
- {
- pts = *evenPts;
- ptsdelta = 1;
- }
- while ((pt != lastPt) && --dashRemaining >= 0)
- {
- *pts = *pt;
- pts += ptsdelta;
- pt += delta;
- }
- if (dinfo->dashIndex & 1)
- *oddPts = pts;
- else
- *evenPts = pts;
- if (dashRemaining <= 0)
- {
- if (++(dinfo->dashIndex) == pGC->numInDashList)
- dinfo->dashIndex = 0;
- dashRemaining = pGC->dash[dinfo->dashIndex];
- }
- }
- }
- dinfo->dashOffset = pGC->dash[dinfo->dashIndex] - dashRemaining;
-}
-
-void
-miZeroPolyArc(pDraw, pGC, narcs, parcs)
- DrawablePtr pDraw;
- GCPtr pGC;
- int narcs;
- xArc *parcs;
-{
- int maxPts = 0;
- register int n, maxw = 0;
- register xArc *arc;
- register int i;
- DDXPointPtr points, pts, oddPts;
- register DDXPointPtr pt;
- int numPts;
- Bool dospans;
- int *widths = NULL;
- XID fgPixel = pGC->fgPixel;
- DashInfo dinfo;
-
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (!miCanZeroArc(arc))
- miPolyArc(pDraw, pGC, 1, arc);
- else
- {
- if (arc->width > arc->height)
- n = arc->width + (arc->height >> 1);
- else
- n = arc->height + (arc->width >> 1);
- if (n > maxPts)
- maxPts = n;
- }
- }
- if (!maxPts)
- return;
- numPts = maxPts << 2;
- dospans = (pGC->fillStyle != FillSolid);
- if (dospans)
- {
- widths = (int *)ALLOCATE_LOCAL(sizeof(int) * numPts);
- if (!widths)
- return;
- maxw = 0;
- }
- if (pGC->lineStyle != LineSolid)
- {
- numPts <<= 1;
- dinfo.haveStart = FALSE;
- dinfo.skipStart = FALSE;
- dinfo.haveLast = FALSE;
- dinfo.dashIndexInit = 0;
- dinfo.dashOffsetInit = 0;
- miStepDash((int)pGC->dashOffset, &dinfo.dashIndexInit,
- (unsigned char *) pGC->dash, (int)pGC->numInDashList,
- &dinfo.dashOffsetInit);
- }
- points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * numPts);
- if (!points)
- {
- if (dospans)
- {
- DEALLOCATE_LOCAL(widths);
- }
- return;
- }
- for (arc = parcs, i = narcs; --i >= 0; arc++)
- {
- if (miCanZeroArc(arc))
- {
- if (pGC->lineStyle == LineSolid)
- pts = miZeroArcPts(arc, points);
- else
- {
- pts = points;
- oddPts = &points[(numPts >> 1) - 1];
- dinfo.skipLast = i;
- miZeroArcDashPts(pGC, arc, &dinfo,
- oddPts + 1, maxPts, &pts, &oddPts);
- dinfo.skipStart = TRUE;
- }
- n = pts - points;
- if (!dospans)
- (*pGC->ops->PolyPoint)(pDraw, pGC, CoordModeOrigin, n, points);
- else
- {
- if (n > maxw)
- {
- while (maxw < n)
- widths[maxw++] = 1;
- }
- if (pGC->miTranslate)
- {
- for (pt = points; pt != pts; pt++)
- {
- pt->x += pDraw->x;
- pt->y += pDraw->y;
- }
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, FALSE);
- }
- if (pGC->lineStyle != LineDoubleDash)
- continue;
- if ((pGC->fillStyle == FillSolid) ||
- (pGC->fillStyle == FillStippled))
- {
- DoChangeGC(pGC, GCForeground, (XID *)&pGC->bgPixel, 0);
- ValidateGC(pDraw, pGC);
- }
- pts = &points[numPts >> 1];
- oddPts++;
- n = pts - oddPts;
- if (!dospans)
- (*pGC->ops->PolyPoint)(pDraw, pGC, CoordModeOrigin, n, oddPts);
- else
- {
- if (n > maxw)
- {
- while (maxw < n)
- widths[maxw++] = 1;
- }
- if (pGC->miTranslate)
- {
- for (pt = oddPts; pt != pts; pt++)
- {
- pt->x += pDraw->x;
- pt->y += pDraw->y;
- }
- }
- (*pGC->ops->FillSpans)(pDraw, pGC, n, oddPts, widths, FALSE);
- }
- if ((pGC->fillStyle == FillSolid) ||
- (pGC->fillStyle == FillStippled))
- {
- DoChangeGC(pGC, GCForeground, &fgPixel, 0);
- ValidateGC(pDraw, pGC);
- }
- }
- }
- DEALLOCATE_LOCAL(points);
- if (dospans)
- {
- DEALLOCATE_LOCAL(widths);
- }
-}
diff --git a/mi/mizerarc.h b/mi/mizerarc.h
deleted file mode 100644
index 4a52efa29..000000000
--- a/mi/mizerarc.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mizerarc.h,v 1.3 2001/12/14 20:00:28 dawes Exp $ */
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-/* $Xorg: mizerarc.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-typedef struct {
- int x;
- int y;
- int mask;
-} miZeroArcPtRec;
-
-typedef struct {
- int x, y, k1, k3, a, b, d, dx, dy;
- int alpha, beta;
- int xorg, yorg;
- int xorgo, yorgo;
- int w, h;
- int initialMask;
- miZeroArcPtRec start, altstart, end, altend;
- int firstx, firsty;
- int startAngle, endAngle;
-} miZeroArcRec;
-
-#define miCanZeroArc(arc) (((arc)->width == (arc)->height) || \
- (((arc)->width <= 800) && ((arc)->height <= 800)))
-
-#define MIARCSETUP() \
- x = info.x; \
- y = info.y; \
- k1 = info.k1; \
- k3 = info.k3; \
- a = info.a; \
- b = info.b; \
- d = info.d; \
- dx = info.dx; \
- dy = info.dy
-
-#define MIARCOCTANTSHIFT(clause) \
- if (a < 0) \
- { \
- if (y == info.h) \
- { \
- d = -1; \
- a = b = k1 = 0; \
- } \
- else \
- { \
- dx = (k1 << 1) - k3; \
- k1 = dx - k1; \
- k3 = -k3; \
- b = b + a - (k1 >> 1); \
- d = b + ((-a) >> 1) - d + (k3 >> 3); \
- if (dx < 0) \
- a = -((-dx) >> 1) - a; \
- else \
- a = (dx >> 1) - a; \
- dx = 0; \
- dy = 1; \
- clause \
- } \
- }
-
-#define MIARCSTEP(move1,move2) \
- b -= k1; \
- if (d < 0) \
- { \
- x += dx; \
- y += dy; \
- a += k1; \
- d += b; \
- move1 \
- } \
- else \
- { \
- x++; \
- y++; \
- a += k3; \
- d -= a; \
- move2 \
- }
-
-#define MIARCCIRCLESTEP(clause) \
- b -= k1; \
- x++; \
- if (d < 0) \
- { \
- a += k1; \
- d += b; \
- } \
- else \
- { \
- y++; \
- a += k3; \
- d -= a; \
- clause \
- }
-
-/* mizerarc.c */
-
-extern Bool miZeroArcSetup(
- xArc * /*arc*/,
- miZeroArcRec * /*info*/,
- Bool /*ok360*/
-);
-
-extern DDXPointPtr miZeroArcPts(
- xArc * /*arc*/,
- DDXPointPtr /*pts*/
-);
-
diff --git a/mi/mizerclip.c b/mi/mizerclip.c
deleted file mode 100644
index fa1863b54..000000000
--- a/mi/mizerclip.c
+++ /dev/null
@@ -1,632 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mizerclip.c,v 1.3 2001/12/14 20:00:29 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#include "X.h"
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmap.h"
-#include "mi.h"
-#include "miline.h"
-
-/*
-
-The bresenham error equation used in the mi/mfb/cfb line routines is:
-
- e = error
- dx = difference in raw X coordinates
- dy = difference in raw Y coordinates
- M = # of steps in X direction
- N = # of steps in Y direction
- B = 0 to prefer diagonal steps in a given octant,
- 1 to prefer axial steps in a given octant
-
- For X major lines:
- e = 2Mdy - 2Ndx - dx - B
- -2dx <= e < 0
-
- For Y major lines:
- e = 2Ndx - 2Mdy - dy - B
- -2dy <= e < 0
-
-At the start of the line, we have taken 0 X steps and 0 Y steps,
-so M = 0 and N = 0:
-
- X major e = 2Mdy - 2Ndx - dx - B
- = -dx - B
-
- Y major e = 2Ndx - 2Mdy - dy - B
- = -dy - B
-
-At the end of the line, we have taken dx X steps and dy Y steps,
-so M = dx and N = dy:
-
- X major e = 2Mdy - 2Ndx - dx - B
- = 2dxdy - 2dydx - dx - B
- = -dx - B
- Y major e = 2Ndx - 2Mdy - dy - B
- = 2dydx - 2dxdy - dy - B
- = -dy - B
-
-Thus, the error term is the same at the start and end of the line.
-
-Let us consider clipping an X coordinate. There are 4 cases which
-represent the two independent cases of clipping the start vs. the
-end of the line and an X major vs. a Y major line. In any of these
-cases, we know the number of X steps (M) and we wish to find the
-number of Y steps (N). Thus, we will solve our error term equation.
-If we are clipping the start of the line, we will find the smallest
-N that satisfies our error term inequality. If we are clipping the
-end of the line, we will find the largest number of Y steps that
-satisfies the inequality. In that case, since we are representing
-the Y steps as (dy - N), we will actually want to solve for the
-smallest N in that equation.
-
-Case 1: X major, starting X coordinate moved by M steps
-
- -2dx <= 2Mdy - 2Ndx - dx - B < 0
- 2Ndx <= 2Mdy - dx - B + 2dx 2Ndx > 2Mdy - dx - B
- 2Ndx <= 2Mdy + dx - B N > (2Mdy - dx - B) / 2dx
- N <= (2Mdy + dx - B) / 2dx
-
-Since we are trying to find the smallest N that satisfies these
-equations, we should use the > inequality to find the smallest:
-
- N = floor((2Mdy - dx - B) / 2dx) + 1
- = floor((2Mdy - dx - B + 2dx) / 2dx)
- = floor((2Mdy + dx - B) / 2dx)
-
-Case 1b: X major, ending X coordinate moved to M steps
-
-Same derivations as Case 1, but we want the largest N that satisfies
-the equations, so we use the <= inequality:
-
- N = floor((2Mdy + dx - B) / 2dx)
-
-Case 2: X major, ending X coordinate moved by M steps
-
- -2dx <= 2(dx - M)dy - 2(dy - N)dx - dx - B < 0
- -2dx <= 2dxdy - 2Mdy - 2dxdy + 2Ndx - dx - B < 0
- -2dx <= 2Ndx - 2Mdy - dx - B < 0
- 2Ndx >= 2Mdy + dx + B - 2dx 2Ndx < 2Mdy + dx + B
- 2Ndx >= 2Mdy - dx + B N < (2Mdy + dx + B) / 2dx
- N >= (2Mdy - dx + B) / 2dx
-
-Since we are trying to find the highest number of Y steps that
-satisfies these equations, we need to find the smallest N, so
-we should use the >= inequality to find the smallest:
-
- N = ceiling((2Mdy - dx + B) / 2dx)
- = floor((2Mdy - dx + B + 2dx - 1) / 2dx)
- = floor((2Mdy + dx + B - 1) / 2dx)
-
-Case 2b: X major, starting X coordinate moved to M steps from end
-
-Same derivations as Case 2, but we want the smallest number of Y
-steps, so we want the highest N, so we use the < inequality:
-
- N = ceiling((2Mdy + dx + B) / 2dx) - 1
- = floor((2Mdy + dx + B + 2dx - 1) / 2dx) - 1
- = floor((2Mdy + dx + B + 2dx - 1 - 2dx) / 2dx)
- = floor((2Mdy + dx + B - 1) / 2dx)
-
-Case 3: Y major, starting X coordinate moved by M steps
-
- -2dy <= 2Ndx - 2Mdy - dy - B < 0
- 2Ndx >= 2Mdy + dy + B - 2dy 2Ndx < 2Mdy + dy + B
- 2Ndx >= 2Mdy - dy + B N < (2Mdy + dy + B) / 2dx
- N >= (2Mdy - dy + B) / 2dx
-
-Since we are trying to find the smallest N that satisfies these
-equations, we should use the >= inequality to find the smallest:
-
- N = ceiling((2Mdy - dy + B) / 2dx)
- = floor((2Mdy - dy + B + 2dx - 1) / 2dx)
- = floor((2Mdy - dy + B - 1) / 2dx) + 1
-
-Case 3b: Y major, ending X coordinate moved to M steps
-
-Same derivations as Case 3, but we want the largest N that satisfies
-the equations, so we use the < inequality:
-
- N = ceiling((2Mdy + dy + B) / 2dx) - 1
- = floor((2Mdy + dy + B + 2dx - 1) / 2dx) - 1
- = floor((2Mdy + dy + B + 2dx - 1 - 2dx) / 2dx)
- = floor((2Mdy + dy + B - 1) / 2dx)
-
-Case 4: Y major, ending X coordinate moved by M steps
-
- -2dy <= 2(dy - N)dx - 2(dx - M)dy - dy - B < 0
- -2dy <= 2dxdy - 2Ndx - 2dxdy + 2Mdy - dy - B < 0
- -2dy <= 2Mdy - 2Ndx - dy - B < 0
- 2Ndx <= 2Mdy - dy - B + 2dy 2Ndx > 2Mdy - dy - B
- 2Ndx <= 2Mdy + dy - B N > (2Mdy - dy - B) / 2dx
- N <= (2Mdy + dy - B) / 2dx
-
-Since we are trying to find the highest number of Y steps that
-satisfies these equations, we need to find the smallest N, so
-we should use the > inequality to find the smallest:
-
- N = floor((2Mdy - dy - B) / 2dx) + 1
-
-Case 4b: Y major, starting X coordinate moved to M steps from end
-
-Same analysis as Case 4, but we want the smallest number of Y steps
-which means the largest N, so we use the <= inequality:
-
- N = floor((2Mdy + dy - B) / 2dx)
-
-Now let's try the Y coordinates, we have the same 4 cases.
-
-Case 5: X major, starting Y coordinate moved by N steps
-
- -2dx <= 2Mdy - 2Ndx - dx - B < 0
- 2Mdy >= 2Ndx + dx + B - 2dx 2Mdy < 2Ndx + dx + B
- 2Mdy >= 2Ndx - dx + B M < (2Ndx + dx + B) / 2dy
- M >= (2Ndx - dx + B) / 2dy
-
-Since we are trying to find the smallest M, we use the >= inequality:
-
- M = ceiling((2Ndx - dx + B) / 2dy)
- = floor((2Ndx - dx + B + 2dy - 1) / 2dy)
- = floor((2Ndx - dx + B - 1) / 2dy) + 1
-
-Case 5b: X major, ending Y coordinate moved to N steps
-
-Same derivations as Case 5, but we want the largest M that satisfies
-the equations, so we use the < inequality:
-
- M = ceiling((2Ndx + dx + B) / 2dy) - 1
- = floor((2Ndx + dx + B + 2dy - 1) / 2dy) - 1
- = floor((2Ndx + dx + B + 2dy - 1 - 2dy) / 2dy)
- = floor((2Ndx + dx + B - 1) / 2dy)
-
-Case 6: X major, ending Y coordinate moved by N steps
-
- -2dx <= 2(dx - M)dy - 2(dy - N)dx - dx - B < 0
- -2dx <= 2dxdy - 2Mdy - 2dxdy + 2Ndx - dx - B < 0
- -2dx <= 2Ndx - 2Mdy - dx - B < 0
- 2Mdy <= 2Ndx - dx - B + 2dx 2Mdy > 2Ndx - dx - B
- 2Mdy <= 2Ndx + dx - B M > (2Ndx - dx - B) / 2dy
- M <= (2Ndx + dx - B) / 2dy
-
-Largest # of X steps means smallest M, so use the > inequality:
-
- M = floor((2Ndx - dx - B) / 2dy) + 1
-
-Case 6b: X major, starting Y coordinate moved to N steps from end
-
-Same derivations as Case 6, but we want the smallest # of X steps
-which means the largest M, so use the <= inequality:
-
- M = floor((2Ndx + dx - B) / 2dy)
-
-Case 7: Y major, starting Y coordinate moved by N steps
-
- -2dy <= 2Ndx - 2Mdy - dy - B < 0
- 2Mdy <= 2Ndx - dy - B + 2dy 2Mdy > 2Ndx - dy - B
- 2Mdy <= 2Ndx + dy - B M > (2Ndx - dy - B) / 2dy
- M <= (2Ndx + dy - B) / 2dy
-
-To find the smallest M, use the > inequality:
-
- M = floor((2Ndx - dy - B) / 2dy) + 1
- = floor((2Ndx - dy - B + 2dy) / 2dy)
- = floor((2Ndx + dy - B) / 2dy)
-
-Case 7b: Y major, ending Y coordinate moved to N steps
-
-Same derivations as Case 7, but we want the largest M that satisfies
-the equations, so use the <= inequality:
-
- M = floor((2Ndx + dy - B) / 2dy)
-
-Case 8: Y major, ending Y coordinate moved by N steps
-
- -2dy <= 2(dy - N)dx - 2(dx - M)dy - dy - B < 0
- -2dy <= 2dxdy - 2Ndx - 2dxdy + 2Mdy - dy - B < 0
- -2dy <= 2Mdy - 2Ndx - dy - B < 0
- 2Mdy >= 2Ndx + dy + B - 2dy 2Mdy < 2Ndx + dy + B
- 2Mdy >= 2Ndx - dy + B M < (2Ndx + dy + B) / 2dy
- M >= (2Ndx - dy + B) / 2dy
-
-To find the highest X steps, find the smallest M, use the >= inequality:
-
- M = ceiling((2Ndx - dy + B) / 2dy)
- = floor((2Ndx - dy + B + 2dy - 1) / 2dy)
- = floor((2Ndx + dy + B - 1) / 2dy)
-
-Case 8b: Y major, starting Y coordinate moved to N steps from the end
-
-Same derivations as Case 8, but we want to find the smallest # of X
-steps which means the largest M, so we use the < inequality:
-
- M = ceiling((2Ndx + dy + B) / 2dy) - 1
- = floor((2Ndx + dy + B + 2dy - 1) / 2dy) - 1
- = floor((2Ndx + dy + B + 2dy - 1 - 2dy) / 2dy)
- = floor((2Ndx + dy + B - 1) / 2dy)
-
-So, our equations are:
-
- 1: X major move x1 to x1+M floor((2Mdy + dx - B) / 2dx)
- 1b: X major move x2 to x1+M floor((2Mdy + dx - B) / 2dx)
- 2: X major move x2 to x2-M floor((2Mdy + dx + B - 1) / 2dx)
- 2b: X major move x1 to x2-M floor((2Mdy + dx + B - 1) / 2dx)
-
- 3: Y major move x1 to x1+M floor((2Mdy - dy + B - 1) / 2dx) + 1
- 3b: Y major move x2 to x1+M floor((2Mdy + dy + B - 1) / 2dx)
- 4: Y major move x2 to x2-M floor((2Mdy - dy - B) / 2dx) + 1
- 4b: Y major move x1 to x2-M floor((2Mdy + dy - B) / 2dx)
-
- 5: X major move y1 to y1+N floor((2Ndx - dx + B - 1) / 2dy) + 1
- 5b: X major move y2 to y1+N floor((2Ndx + dx + B - 1) / 2dy)
- 6: X major move y2 to y2-N floor((2Ndx - dx - B) / 2dy) + 1
- 6b: X major move y1 to y2-N floor((2Ndx + dx - B) / 2dy)
-
- 7: Y major move y1 to y1+N floor((2Ndx + dy - B) / 2dy)
- 7b: Y major move y2 to y1+N floor((2Ndx + dy - B) / 2dy)
- 8: Y major move y2 to y2-N floor((2Ndx + dy + B - 1) / 2dy)
- 8b: Y major move y1 to y2-N floor((2Ndx + dy + B - 1) / 2dy)
-
-We have the following constraints on all of the above terms:
-
- 0 < M,N <= 2^15 2^15 can be imposed by miZeroClipLine
- 0 <= dx/dy <= 2^16 - 1
- 0 <= B <= 1
-
-The floor in all of the above equations can be accomplished with a
-simple C divide operation provided that both numerator and denominator
-are positive.
-
-Since dx,dy >= 0 and since moving an X coordinate implies that dx != 0
-and moving a Y coordinate implies dy != 0, we know that the denominators
-are all > 0.
-
-For all lines, (-B) and (B-1) are both either 0 or -1, depending on the
-bias. Thus, we have to show that the 2MNdxy +/- dxy terms are all >= 1
-or > 0 to prove that the numerators are positive (or zero).
-
-For X Major lines we know that dx > 0 and since 2Mdy is >= 0 due to the
-constraints, the first four equations all have numerators >= 0.
-
-For the second four equations, M > 0, so 2Mdy >= 2dy so (2Mdy - dy) >= dy
-So (2Mdy - dy) > 0, since they are Y major lines. Also, (2Mdy + dy) >= 3dy
-or (2Mdy + dy) > 0. So all of their numerators are >= 0.
-
-For the third set of four equations, N > 0, so 2Ndx >= 2dx so (2Ndx - dx)
->= dx > 0. Similarly (2Ndx + dx) >= 3dx > 0. So all numerators >= 0.
-
-For the fourth set of equations, dy > 0 and 2Ndx >= 0, so all numerators
-are > 0.
-
-To consider overflow, consider the case of 2 * M,N * dx,dy + dx,dy. This
-is bounded <= 2 * 2^15 * (2^16 - 1) + (2^16 - 1)
- <= 2^16 * (2^16 - 1) + (2^16 - 1)
- <= 2^32 - 2^16 + 2^16 - 1
- <= 2^32 - 1
-Since the (-B) and (B-1) terms are all 0 or -1, the maximum value of
-the numerator is therefore (2^32 - 1), which does not overflow an unsigned
-32 bit variable.
-
-*/
-
-/* Bit codes for the terms of the 16 clipping equations defined below. */
-
-#define T_2NDX (1 << 0)
-#define T_2MDY (0) /* implicit term */
-#define T_DXNOTY (1 << 1)
-#define T_DYNOTX (0) /* implicit term */
-#define T_SUBDXORY (1 << 2)
-#define T_ADDDX (T_DXNOTY) /* composite term */
-#define T_SUBDX (T_DXNOTY | T_SUBDXORY) /* composite term */
-#define T_ADDDY (T_DYNOTX) /* composite term */
-#define T_SUBDY (T_DYNOTX | T_SUBDXORY) /* composite term */
-#define T_BIASSUBONE (1 << 3)
-#define T_SUBBIAS (0) /* implicit term */
-#define T_DIV2DX (1 << 4)
-#define T_DIV2DY (0) /* implicit term */
-#define T_ADDONE (1 << 5)
-
-/* Bit masks defining the 16 equations used in miZeroClipLine. */
-
-#define EQN1 (T_2MDY | T_ADDDX | T_SUBBIAS | T_DIV2DX)
-#define EQN1B (T_2MDY | T_ADDDX | T_SUBBIAS | T_DIV2DX)
-#define EQN2 (T_2MDY | T_ADDDX | T_BIASSUBONE | T_DIV2DX)
-#define EQN2B (T_2MDY | T_ADDDX | T_BIASSUBONE | T_DIV2DX)
-
-#define EQN3 (T_2MDY | T_SUBDY | T_BIASSUBONE | T_DIV2DX | T_ADDONE)
-#define EQN3B (T_2MDY | T_ADDDY | T_BIASSUBONE | T_DIV2DX)
-#define EQN4 (T_2MDY | T_SUBDY | T_SUBBIAS | T_DIV2DX | T_ADDONE)
-#define EQN4B (T_2MDY | T_ADDDY | T_SUBBIAS | T_DIV2DX)
-
-#define EQN5 (T_2NDX | T_SUBDX | T_BIASSUBONE | T_DIV2DY | T_ADDONE)
-#define EQN5B (T_2NDX | T_ADDDX | T_BIASSUBONE | T_DIV2DY)
-#define EQN6 (T_2NDX | T_SUBDX | T_SUBBIAS | T_DIV2DY | T_ADDONE)
-#define EQN6B (T_2NDX | T_ADDDX | T_SUBBIAS | T_DIV2DY)
-
-#define EQN7 (T_2NDX | T_ADDDY | T_SUBBIAS | T_DIV2DY)
-#define EQN7B (T_2NDX | T_ADDDY | T_SUBBIAS | T_DIV2DY)
-#define EQN8 (T_2NDX | T_ADDDY | T_BIASSUBONE | T_DIV2DY)
-#define EQN8B (T_2NDX | T_ADDDY | T_BIASSUBONE | T_DIV2DY)
-
-/* miZeroClipLine
- *
- * returns: 1 for partially clipped line
- * -1 for completely clipped line
- *
- */
-int
-miZeroClipLine(xmin, ymin, xmax, ymax,
- new_x1, new_y1, new_x2, new_y2,
- adx, ady,
- pt1_clipped, pt2_clipped, octant, bias, oc1, oc2)
- int xmin, ymin, xmax, ymax;
- int *new_x1, *new_y1, *new_x2, *new_y2;
- int *pt1_clipped, *pt2_clipped;
- unsigned int adx, ady;
- int octant;
- unsigned int bias;
- int oc1, oc2;
-{
- int swapped = 0;
- int clipDone = 0;
- CARD32 utmp = 0;
- int clip1, clip2;
- int x1, y1, x2, y2;
- int x1_orig, y1_orig, x2_orig, y2_orig;
- int xmajor;
- int negslope = 0, anchorval = 0;
- unsigned int eqn = 0;
-
- x1 = x1_orig = *new_x1;
- y1 = y1_orig = *new_y1;
- x2 = x2_orig = *new_x2;
- y2 = y2_orig = *new_y2;
-
- clip1 = 0;
- clip2 = 0;
-
- xmajor = IsXMajorOctant(octant);
- bias = ((bias >> octant) & 1);
-
- while (1)
- {
- if ((oc1 & oc2) != 0) /* trivial reject */
- {
- clipDone = -1;
- clip1 = oc1;
- clip2 = oc2;
- break;
- }
- else if ((oc1 | oc2) == 0) /* trivial accept */
- {
- clipDone = 1;
- if (swapped)
- {
- SWAPINT_PAIR(x1, y1, x2, y2);
- SWAPINT(clip1, clip2);
- }
- break;
- }
- else /* have to clip */
- {
- /* only clip one point at a time */
- if (oc1 == 0)
- {
- SWAPINT_PAIR(x1, y1, x2, y2);
- SWAPINT_PAIR(x1_orig, y1_orig, x2_orig, y2_orig);
- SWAPINT(oc1, oc2);
- SWAPINT(clip1, clip2);
- swapped = !swapped;
- }
-
- clip1 |= oc1;
- if (oc1 & OUT_LEFT)
- {
- negslope = IsYDecreasingOctant(octant);
- utmp = xmin - x1_orig;
- if (utmp <= 32767) /* clip based on near endpt */
- {
- if (xmajor)
- eqn = (swapped) ? EQN2 : EQN1;
- else
- eqn = (swapped) ? EQN4 : EQN3;
- anchorval = y1_orig;
- }
- else /* clip based on far endpt */
- {
- utmp = x2_orig - xmin;
- if (xmajor)
- eqn = (swapped) ? EQN1B : EQN2B;
- else
- eqn = (swapped) ? EQN3B : EQN4B;
- anchorval = y2_orig;
- negslope = !negslope;
- }
- x1 = xmin;
- }
- else if (oc1 & OUT_ABOVE)
- {
- negslope = IsXDecreasingOctant(octant);
- utmp = ymin - y1_orig;
- if (utmp <= 32767) /* clip based on near endpt */
- {
- if (xmajor)
- eqn = (swapped) ? EQN6 : EQN5;
- else
- eqn = (swapped) ? EQN8 : EQN7;
- anchorval = x1_orig;
- }
- else /* clip based on far endpt */
- {
- utmp = y2_orig - ymin;
- if (xmajor)
- eqn = (swapped) ? EQN5B : EQN6B;
- else
- eqn = (swapped) ? EQN7B : EQN8B;
- anchorval = x2_orig;
- negslope = !negslope;
- }
- y1 = ymin;
- }
- else if (oc1 & OUT_RIGHT)
- {
- negslope = IsYDecreasingOctant(octant);
- utmp = x1_orig - xmax;
- if (utmp <= 32767) /* clip based on near endpt */
- {
- if (xmajor)
- eqn = (swapped) ? EQN2 : EQN1;
- else
- eqn = (swapped) ? EQN4 : EQN3;
- anchorval = y1_orig;
- }
- else /* clip based on far endpt */
- {
- /*
- * Technically since the equations can handle
- * utmp == 32768, this overflow code isn't
- * needed since X11 protocol can't generate
- * a line which goes more than 32768 pixels
- * to the right of a clip rectangle.
- */
- utmp = xmax - x2_orig;
- if (xmajor)
- eqn = (swapped) ? EQN1B : EQN2B;
- else
- eqn = (swapped) ? EQN3B : EQN4B;
- anchorval = y2_orig;
- negslope = !negslope;
- }
- x1 = xmax;
- }
- else if (oc1 & OUT_BELOW)
- {
- negslope = IsXDecreasingOctant(octant);
- utmp = y1_orig - ymax;
- if (utmp <= 32767) /* clip based on near endpt */
- {
- if (xmajor)
- eqn = (swapped) ? EQN6 : EQN5;
- else
- eqn = (swapped) ? EQN8 : EQN7;
- anchorval = x1_orig;
- }
- else /* clip based on far endpt */
- {
- /*
- * Technically since the equations can handle
- * utmp == 32768, this overflow code isn't
- * needed since X11 protocol can't generate
- * a line which goes more than 32768 pixels
- * below the bottom of a clip rectangle.
- */
- utmp = ymax - y2_orig;
- if (xmajor)
- eqn = (swapped) ? EQN5B : EQN6B;
- else
- eqn = (swapped) ? EQN7B : EQN8B;
- anchorval = x2_orig;
- negslope = !negslope;
- }
- y1 = ymax;
- }
-
- if (swapped)
- negslope = !negslope;
-
- utmp <<= 1; /* utmp = 2N or 2M */
- if (eqn & T_2NDX)
- utmp = (utmp * adx);
- else /* (eqn & T_2MDY) */
- utmp = (utmp * ady);
- if (eqn & T_DXNOTY)
- if (eqn & T_SUBDXORY)
- utmp -= adx;
- else
- utmp += adx;
- else /* (eqn & T_DYNOTX) */
- if (eqn & T_SUBDXORY)
- utmp -= ady;
- else
- utmp += ady;
- if (eqn & T_BIASSUBONE)
- utmp += bias - 1;
- else /* (eqn & T_SUBBIAS) */
- utmp -= bias;
- if (eqn & T_DIV2DX)
- utmp /= (adx << 1);
- else /* (eqn & T_DIV2DY) */
- utmp /= (ady << 1);
- if (eqn & T_ADDONE)
- utmp++;
-
- if (negslope)
- utmp = -utmp;
-
- if (eqn & T_2NDX) /* We are calculating X steps */
- x1 = anchorval + utmp;
- else /* else, Y steps */
- y1 = anchorval + utmp;
-
- oc1 = 0;
- MIOUTCODES(oc1, x1, y1, xmin, ymin, xmax, ymax);
- }
- }
-
- *new_x1 = x1;
- *new_y1 = y1;
- *new_x2 = x2;
- *new_y2 = y2;
-
- *pt1_clipped = clip1;
- *pt2_clipped = clip2;
-
- return clipDone;
-}
diff --git a/mi/mizerline.c b/mi/mizerline.c
deleted file mode 100644
index d1fbf631e..000000000
--- a/mi/mizerline.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/* $XFree86: xc/programs/Xserver/mi/mizerline.c,v 3.7 2001/12/14 20:00:29 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: mizerline.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-#include "X.h"
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmap.h"
-#include "mi.h"
-#include "miline.h"
-
-/* Draw lineSolid, fillStyle-independent zero width lines.
- *
- * Must keep X and Y coordinates in "ints" at least until after they're
- * translated and clipped to accomodate CoordModePrevious lines with very
- * large coordinates.
- *
- * Draws the same pixels regardless of sign(dx) or sign(dy).
- *
- * Ken Whaley
- *
- */
-
-/* largest positive value that can fit into a component of a point.
- * Assumes that the point structure is {type x, y;} where type is
- * a signed type.
- */
-#define MAX_COORDINATE ((1 << (((sizeof(DDXPointRec) >> 1) << 3) - 1)) - 1)
-
-#define MI_OUTPUT_POINT(xx, yy)\
-{\
- if ( !new_span && yy == current_y)\
- {\
- if (xx < spans->x)\
- spans->x = xx;\
- ++*widths;\
- }\
- else\
- {\
- ++Nspans;\
- ++spans;\
- ++widths;\
- spans->x = xx;\
- spans->y = yy;\
- *widths = 1;\
- current_y = yy;\
- new_span = FALSE;\
- }\
-}
-
-void
-miZeroLine(pDraw, pGC, mode, npt, pptInit)
- DrawablePtr pDraw;
- GCPtr pGC;
- int mode; /* Origin or Previous */
- int npt; /* number of points */
- DDXPointPtr pptInit;
-{
- int Nspans, current_y = 0;
- DDXPointPtr ppt;
- DDXPointPtr pspanInit, spans;
- int *pwidthInit, *widths, list_len;
- int xleft, ytop, xright, ybottom;
- int new_x1, new_y1, new_x2, new_y2;
- int x = 0, y = 0, x1, y1, x2, y2, xstart, ystart;
- int oc1, oc2;
- int result;
- int pt1_clipped, pt2_clipped = 0;
- Bool new_span;
- int signdx, signdy;
- int clipdx, clipdy;
- int width, height;
- int adx, ady;
- int octant;
- unsigned int bias = miGetZeroLineBias(pDraw->pScreen);
- int e, e1, e2, e3; /* Bresenham error terms */
- int length; /* length of lines == # of pixels on major axis */
-
- xleft = pDraw->x;
- ytop = pDraw->y;
- xright = pDraw->x + pDraw->width - 1;
- ybottom = pDraw->y + pDraw->height - 1;
-
- if (!pGC->miTranslate)
- {
- /* do everything in drawable-relative coordinates */
- xleft = 0;
- ytop = 0;
- xright -= pDraw->x;
- ybottom -= pDraw->y;
- }
-
- /* it doesn't matter whether we're in drawable or screen coordinates,
- * FillSpans simply cannot take starting coordinates outside of the
- * range of a DDXPointRec component.
- */
- if (xright > MAX_COORDINATE)
- xright = MAX_COORDINATE;
- if (ybottom > MAX_COORDINATE)
- ybottom = MAX_COORDINATE;
-
- /* since we're clipping to the drawable's boundaries & coordinate
- * space boundaries, we're guaranteed that the larger of width/height
- * is the longest span we'll need to output
- */
- width = xright - xleft + 1;
- height = ybottom - ytop + 1;
- list_len = (height >= width) ? height : width;
- pspanInit = (DDXPointPtr)ALLOCATE_LOCAL(list_len * sizeof(DDXPointRec));
- pwidthInit = (int *)ALLOCATE_LOCAL(list_len * sizeof(int));
- if (!pspanInit || !pwidthInit)
- return;
-
- Nspans = 0;
- new_span = TRUE;
- spans = pspanInit - 1;
- widths = pwidthInit - 1;
- ppt = pptInit;
-
- xstart = ppt->x;
- ystart = ppt->y;
- if (pGC->miTranslate)
- {
- xstart += pDraw->x;
- ystart += pDraw->y;
- }
-
- /* x2, y2, oc2 copied to x1, y1, oc1 at top of loop to simplify
- * iteration logic
- */
- x2 = xstart;
- y2 = ystart;
- oc2 = 0;
- MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom);
-
- while (--npt > 0)
- {
- if (Nspans > 0)
- (*pGC->ops->FillSpans)(pDraw, pGC, Nspans, pspanInit,
- pwidthInit, FALSE);
- Nspans = 0;
- new_span = TRUE;
- spans = pspanInit - 1;
- widths = pwidthInit - 1;
-
- x1 = x2;
- y1 = y2;
- oc1 = oc2;
- ++ppt;
-
- x2 = ppt->x;
- y2 = ppt->y;
- if (pGC->miTranslate && (mode != CoordModePrevious))
- {
- x2 += pDraw->x;
- y2 += pDraw->y;
- }
- else if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
-
- oc2 = 0;
- MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom);
-
- CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
-
- if (adx > ady)
- {
- e1 = ady << 1;
- e2 = e1 - (adx << 1);
- e = e1 - adx;
- length = adx; /* don't draw endpoint in main loop */
-
- FIXUP_ERROR(e, octant, bias);
-
- new_x1 = x1;
- new_y1 = y1;
- new_x2 = x2;
- new_y2 = y2;
- pt1_clipped = 0;
- pt2_clipped = 0;
-
- if ((oc1 | oc2) != 0)
- {
- result = miZeroClipLine(xleft, ytop, xright, ybottom,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady,
- &pt1_clipped, &pt2_clipped,
- octant, bias, oc1, oc2);
- if (result == -1)
- continue;
-
- length = abs(new_x2 - new_x1);
-
- /* if we've clipped the endpoint, always draw the full length
- * of the segment, because then the capstyle doesn't matter
- */
- if (pt2_clipped)
- length++;
-
- if (pt1_clipped)
- {
- /* must calculate new error terms */
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- e += (clipdy * e2) + ((clipdx - clipdy) * e1);
- }
- }
-
- /* draw the segment */
-
- x = new_x1;
- y = new_y1;
-
- e3 = e2 - e1;
- e = e - e1;
-
- while (length--)
- {
- MI_OUTPUT_POINT(x, y);
- e += e1;
- if (e >= 0)
- {
- y += signdy;
- e += e3;
- }
- x += signdx;
- }
- }
- else /* Y major line */
- {
- e1 = adx << 1;
- e2 = e1 - (ady << 1);
- e = e1 - ady;
- length = ady; /* don't draw endpoint in main loop */
-
- SetYMajorOctant(octant);
- FIXUP_ERROR(e, octant, bias);
-
- new_x1 = x1;
- new_y1 = y1;
- new_x2 = x2;
- new_y2 = y2;
- pt1_clipped = 0;
- pt2_clipped = 0;
-
- if ((oc1 | oc2) != 0)
- {
- result = miZeroClipLine(xleft, ytop, xright, ybottom,
- &new_x1, &new_y1, &new_x2, &new_y2,
- adx, ady,
- &pt1_clipped, &pt2_clipped,
- octant, bias, oc1, oc2);
- if (result == -1)
- continue;
-
- length = abs(new_y2 - new_y1);
-
- /* if we've clipped the endpoint, always draw the full length
- * of the segment, because then the capstyle doesn't matter
- */
- if (pt2_clipped)
- length++;
-
- if (pt1_clipped)
- {
- /* must calculate new error terms */
- clipdx = abs(new_x1 - x1);
- clipdy = abs(new_y1 - y1);
- e += (clipdx * e2) + ((clipdy - clipdx) * e1);
- }
- }
-
- /* draw the segment */
-
- x = new_x1;
- y = new_y1;
-
- e3 = e2 - e1;
- e = e - e1;
-
- while (length--)
- {
- MI_OUTPUT_POINT(x, y);
- e += e1;
- if (e >= 0)
- {
- x += signdx;
- e += e3;
- }
- y += signdy;
- }
- }
- }
-
- /* only do the capnotlast check on the last segment
- * and only if the endpoint wasn't clipped. And then, if the last
- * point is the same as the first point, do not draw it, unless the
- * line is degenerate
- */
- if ( (! pt2_clipped) && (pGC->capStyle != CapNotLast) &&
- (((xstart != x2) || (ystart != y2)) || (ppt == pptInit + 1)))
- {
- MI_OUTPUT_POINT(x, y);
- }
-
- if (Nspans > 0)
- (*pGC->ops->FillSpans)(pDraw, pGC, Nspans, pspanInit,
- pwidthInit, FALSE);
-
- DEALLOCATE_LOCAL(pwidthInit);
- DEALLOCATE_LOCAL(pspanInit);
-}
-
-void
-miZeroDashLine(dst, pgc, mode, nptInit, pptInit)
-DrawablePtr dst;
-GCPtr pgc;
-int mode;
-int nptInit; /* number of points in polyline */
-DDXPointRec *pptInit; /* points in the polyline */
-{
- /* XXX kludge until real zero-width dash code is written */
- pgc->lineWidth = 1;
- miWideDash (dst, pgc, mode, nptInit, pptInit);
- pgc->lineWidth = 0;
-}
diff --git a/miext/layer/layer.h b/miext/layer/layer.h
deleted file mode 100644
index 630438057..000000000
--- a/miext/layer/layer.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layer.h,v 1.5 2002/10/03 22:50:21 keithp Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _LAYER_H_
-#define _LAYER_H_
-
-#include <shadow.h>
-
-#define LAYER_FB 0
-#define LAYER_SHADOW 1
-
-typedef struct _LayerKind *LayerKindPtr;
-typedef struct _LayerWin *LayerWinPtr;
-typedef struct _LayerList *LayerListPtr;
-typedef struct _LayerGC *LayerGCPtr;
-typedef struct _Layer *LayerPtr;
-typedef struct _LayerScreen *LayerScreenPtr;
-
-/*
- * We'll try to work without a list of windows in each layer
- * for now, this will make computing bounding boxes for each
- * layer rather expensive, so that may need to change at some point.
- */
-
-#define LAYER_SCREEN_PIXMAP ((PixmapPtr) 1)
-
-typedef struct _Layer {
- LayerPtr pNext; /* a list of all layers for this screen */
- LayerKindPtr pKind; /* characteristics of this layer */
- int refcnt; /* reference count, layer is freed when zero */
- int windows; /* number of windows, free pixmap when zero */
- int depth; /* window depth in this layer */
- PixmapPtr pPixmap; /* pixmap for this layer (may be frame buffer) */
- Bool freePixmap; /* whether to free this pixmap when done */
- RegionRec region; /* valid set of pPixmap for drawing */
- ShadowUpdateProc update; /* for shadow layers, update/window/closure values */
- ShadowWindowProc window;
- int randr;
- void *closure;
-} LayerRec;
-
-/*
- * Call this before wrapping stuff for acceleration, it
- * gives layer pointers to the raw frame buffer functions
- */
-
-Bool
-LayerStartInit (ScreenPtr pScreen);
-
-/*
- * Initialize wrappers for each acceleration type and
- * call this function, it will move the needed functions
- * into a new LayerKind and replace them with the generic
- * functions.
- */
-
-int
-LayerNewKind (ScreenPtr pScreen);
-
-/*
- * Finally, call this function and layer
- * will wrap the screen functions and prepare for execution
- */
-
-Bool
-LayerFinishInit (ScreenPtr pScreen);
-
-/*
- * At any point after LayerStartInit, a new layer can be created.
- */
-LayerPtr
-LayerCreate (ScreenPtr pScreen,
- int kind,
- int depth,
- PixmapPtr pPixmap,
- ShadowUpdateProc update,
- ShadowWindowProc window,
- int randr,
- void *closure);
-
-/*
- * Create a layer pixmap
- */
-Bool
-LayerCreatePixmap (ScreenPtr pScreen, LayerPtr pLayer);
-
-/*
- * Change a layer pixmap
- */
-void
-LayerSetPixmap (ScreenPtr pScreen, LayerPtr pLayer, PixmapPtr pPixmap);
-
-/*
- * Destroy a layer pixmap
- */
-void
-LayerDestroyPixmap (ScreenPtr pScreen, LayerPtr pLayer);
-
-/*
- * Change a layer kind
- */
-void
-LayerSetKind (ScreenPtr pScreen, LayerPtr pLayer, int kind);
-
-/*
- * Destroy a layer. The layer must not contain any windows.
- */
-void
-LayerDestroy (ScreenPtr pScreen, LayerPtr layer);
-
-/*
- * Add a window to a layer
- */
-Bool
-LayerWindowAdd (ScreenPtr pScreen, LayerPtr pLayer, WindowPtr pWin);
-
-/*
- * Remove a window from a layer
- */
-
-void
-LayerWindowRemove (ScreenPtr pScreen, LayerPtr pLayer, WindowPtr pWin);
-
-#endif /* _LAYER_H_ */
diff --git a/miext/layer/layergc.c b/miext/layer/layergc.c
deleted file mode 100644
index 52490d286..000000000
--- a/miext/layer/layergc.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layergc.c,v 1.5 2001/10/28 03:34:15 tsi Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "layerstr.h"
-
-GCFuncs layerGCFuncs = {
- layerValidateGC, layerChangeGC, layerCopyGC, layerDestroyGC,
- layerChangeClip, layerDestroyClip, layerCopyClip
-};
-
-#if 0
-/*
- * XXX dont need this until this supports
- * separate clipping and multiple layers
- */
-GCOps layerGCOps = {
- layerFillSpans, layerSetSpans,
- layerPutImage, layerCopyArea,
- layerCopyPlane, layerPolyPoint,
- layerPolylines, layerPolySegment,
- layerPolyRectangle, layerPolyArc,
- layerFillPolygon, layerPolyFillRect,
- layerPolyFillArc, layerPolyText8,
- layerPolyText16, layerImageText8,
- layerImageText16, layerImageGlyphBlt,
- layerPolyGlyphBlt, layerPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-#endif
-
-Bool
-layerCreateGC (GCPtr pGC)
-{
- Bool ret = TRUE;
- LayerKindPtr pLayKind;
- ScreenPtr pScreen = pGC->pScreen;
- layerScrPriv(pScreen);
- layerGCPriv(pGC);
-
- /*
- * XXX assume the first layer can handle all GCs
- */
- pLayKind = &pLayScr->kinds[0];
- if (pLayScr->pLayers)
- pLayKind = pLayScr->pLayers->pKind;
- pLayGC->pKind = pLayKind;
- LayerUnwrap (pScreen,pLayGC->pKind,CreateGC);
-
- if (!(*pScreen->CreateGC) (pGC))
- ret = FALSE;
- LayerWrap (pScreen,pLayKind,CreateGC,layerCreateGC);
-
- LayerWrap (pGC,pLayGC,funcs,&layerGCFuncs);
-
- return ret;
-}
-
-void
-layerValidateGC(GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw)
-{
- layerGCPriv(pGC);
- LayerKindPtr pKind;
-
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- layerWinPriv ((WindowPtr) pDraw);
- pKind = layerWinLayer (pLayWin)->pKind;
- }
- else
- {
- /* XXX assume the first layer can handle all pixmaps */
- layerScrPriv (pDraw->pScreen);
- pKind = &pLayScr->kinds[0];
- if (pLayScr->pLayers)
- pKind = pLayScr->pLayers->pKind;
- }
-
- LayerUnwrap (pGC,pLayGC,funcs);
- if (pKind != pLayGC->pKind)
- {
- /*
- * Clean up the previous user
- */
- CreateGCProcPtr CreateGC;
- (*pGC->funcs->DestroyGC) (pGC);
-
- pGC->serialNumber = GC_CHANGE_SERIAL_BIT;
-
- pLayGC->pKind = pKind;
-
- /*
- * Temporarily unwrap Create GC and let
- * the new code setup the GC
- */
- CreateGC = pGC->pScreen->CreateGC;
- LayerUnwrap (pGC->pScreen, pLayGC->pKind, CreateGC);
- (*pGC->pScreen->CreateGC) (pGC);
- LayerWrap (pGC->pScreen, pLayGC->pKind, CreateGC, CreateGC);
- }
-
- (*pGC->funcs->ValidateGC) (pGC, changes, pDraw);
- LayerWrap(pGC,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerDestroyGC(GCPtr pGC)
-{
- layerGCPriv(pGC);
- LayerUnwrap (pGC,pLayGC,funcs);
- (*pGC->funcs->DestroyGC)(pGC);
- LayerWrap(pGC,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerChangeGC (GCPtr pGC,
- unsigned long mask)
-{
- layerGCPriv(pGC);
- LayerUnwrap (pGC,pLayGC,funcs);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- LayerWrap(pGC,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerCopyGC (GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst)
-{
- layerGCPriv(pGCDst);
- LayerUnwrap (pGCDst,pLayGC,funcs);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- LayerWrap(pGCDst,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerChangeClip (GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects)
-{
- layerGCPriv(pGC);
- LayerUnwrap (pGC,pLayGC,funcs);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- LayerWrap(pGC,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
- layerGCPriv(pGCDst);
- LayerUnwrap (pGCDst,pLayGC,funcs);
- (*pGCDst->funcs->CopyClip) (pGCDst, pGCSrc);
- LayerWrap(pGCDst,pLayGC,funcs,&layerGCFuncs);
-}
-
-void
-layerDestroyClip(GCPtr pGC)
-{
- layerGCPriv(pGC);
- LayerUnwrap (pGC,pLayGC,funcs);
- (*pGC->funcs->DestroyClip) (pGC);
- LayerWrap(pGC,pLayGC,funcs,&layerGCFuncs);
-}
-
diff --git a/miext/layer/layerinit.c b/miext/layer/layerinit.c
deleted file mode 100644
index 6cbca7150..000000000
--- a/miext/layer/layerinit.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layerinit.c,v 1.7 2003/11/10 18:22:49 tsi Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "layerstr.h"
-
-int layerScrPrivateIndex;
-int layerGCPrivateIndex;
-int layerWinPrivateIndex;
-int layerGeneration;
-
-/*
- * Call this before wrapping stuff for acceleration, it
- * gives layer pointers to the raw frame buffer functions
- */
-
-extern const GCFuncs fbGCFuncs;
-extern GCFuncs shadowGCFuncs;
-
-Bool
-LayerStartInit (ScreenPtr pScreen)
-{
- LayerScreenPtr pScrPriv;
-
- if (layerGeneration != serverGeneration)
- {
- layerScrPrivateIndex = AllocateScreenPrivateIndex ();
- if (layerScrPrivateIndex == -1)
- return FALSE;
- layerGCPrivateIndex = AllocateGCPrivateIndex ();
- if (layerGCPrivateIndex == -1)
- return FALSE;
- layerWinPrivateIndex = AllocateWindowPrivateIndex ();
- if (layerWinPrivateIndex == -1)
- return FALSE;
- layerGeneration = serverGeneration;
- }
- if (!AllocateGCPrivate (pScreen, layerGCPrivateIndex, sizeof (LayerGCRec)))
- return FALSE;
- if (!AllocateWindowPrivate (pScreen, layerWinPrivateIndex, sizeof (LayerWinRec)))
- return FALSE;
- pScrPriv = (LayerScreenPtr) xalloc (sizeof (LayerScreenRec));
- if (!pScrPriv)
- return FALSE;
- pScrPriv->nkinds = 0;
- pScrPriv->kinds = 0;
- pScrPriv->pLayers = 0;
- pScreen->devPrivates[layerScrPrivateIndex].ptr = (pointer) pScrPriv;
- /*
- * Add fb kind -- always 0
- */
- if (LayerNewKind (pScreen) < 0)
- {
- pScreen->devPrivates[layerScrPrivateIndex].ptr = 0;
- xfree (pScrPriv);
- return FALSE;
- }
- /*
- * Add shadow kind -- always 1
- */
- if (!shadowSetup (pScreen))
- return FALSE;
- if (LayerNewKind (pScreen) < 0)
- {
- pScreen->devPrivates[layerScrPrivateIndex].ptr = 0;
- xfree (pScrPriv->kinds);
- xfree (pScrPriv);
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * Initialize wrappers for each acceleration type and
- * call this function, it will move the needed functions
- * into a new LayerKind and replace them with the generic
- * functions.
- */
-
-int
-LayerNewKind (ScreenPtr pScreen)
-{
- layerScrPriv(pScreen);
- LayerKindPtr pLayKind, pLayKinds;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreen (pScreen);
-#endif
- LayerPtr pLayer;
-
- /*
- * Allocate a new kind structure
- */
- if (pLayScr->kinds)
- pLayKinds = (LayerKindPtr) xrealloc ((pointer) pLayScr->kinds,
- (pLayScr->nkinds + 1) * sizeof (LayerKindRec));
- else
- pLayKinds = (LayerKindPtr) xalloc (sizeof (LayerKindRec));
- if (!pLayKinds)
- return -1;
-
- /*
- * Fix up existing layers to point at the new kind
- */
- for (pLayer = pLayScr->pLayers; pLayer; pLayer = pLayer->pNext)
- {
- int kind = pLayer->pKind - pLayScr->kinds;
-
- pLayer->pKind = &pLayKinds[kind];
- }
-
- pLayScr->kinds = pLayKinds;
- pLayKind = &pLayScr->kinds[pLayScr->nkinds];
- pLayKind->kind = pLayScr->nkinds;
-
- /*
- * Extract wrapped functions from screen and stick in kind
- */
- pLayKind->CloseScreen = pScreen->CloseScreen;
-
- pLayKind->CreateWindow = pScreen->CreateWindow;
- pLayKind->DestroyWindow = pScreen->DestroyWindow;
- pLayKind->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
- pLayKind->PaintWindowBackground = pScreen->PaintWindowBackground;
- pLayKind->PaintWindowBorder = pScreen->PaintWindowBorder;
- pLayKind->CopyWindow = pScreen->CopyWindow;
-
- pLayKind->CreatePixmap = pScreen->CreatePixmap;
- pLayKind->DestroyPixmap = pScreen->DestroyPixmap;
-
- pLayKind->CreateGC = pScreen->CreateGC;
-
-#ifdef RENDER
- if (ps)
- {
- pLayKind->Composite = ps->Composite;
- pLayKind->Glyphs = ps->Glyphs;
- pLayKind->CompositeRects = ps->CompositeRects;
- }
-#endif
- /*
- * If not underlying frame buffer kind,
- * replace screen functions with those
- */
- if (pLayKind->kind != 0)
- {
- pScreen->CloseScreen = pLayKinds->CloseScreen;
-
- pScreen->CreateWindow = pLayKinds->CreateWindow;
- pScreen->DestroyWindow = pLayKinds->DestroyWindow;
- pScreen->ChangeWindowAttributes = pLayKinds->ChangeWindowAttributes;
- pScreen->PaintWindowBackground = pLayKinds->PaintWindowBackground;
- pScreen->PaintWindowBorder = pLayKinds->PaintWindowBorder;
- pScreen->CopyWindow = pLayKinds->CopyWindow;
-
- pScreen->CreatePixmap = pLayKinds->CreatePixmap;
- pScreen->DestroyPixmap = pLayKinds->DestroyPixmap;
-
- pScreen->CreateGC = pLayKinds->CreateGC;
-
-#ifdef RENDER
- if (ps)
- {
- ps->Composite = pLayKinds->Composite;
- ps->Glyphs = pLayKinds->Glyphs;
- ps->CompositeRects = pLayKinds->CompositeRects;
- }
-#endif
- }
-
- pLayScr->nkinds++;
- return pLayKind->kind;
-}
-
-/*
- * Finally, call this function and layer
- * will wrap the screen functions and prepare for execution
- */
-
-Bool
-LayerFinishInit (ScreenPtr pScreen)
-{
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreen (pScreen);
-#endif
-
- pScreen->CloseScreen = layerCloseScreen;
-
- pScreen->CreateWindow = layerCreateWindow;
- pScreen->DestroyWindow = layerDestroyWindow;
- pScreen->ChangeWindowAttributes = layerChangeWindowAttributes;
- pScreen->PaintWindowBackground = layerPaintWindowBackground;
- pScreen->PaintWindowBorder = layerPaintWindowBorder;
- pScreen->CopyWindow = layerCopyWindow;
-
- pScreen->CreatePixmap = layerCreatePixmap;
- pScreen->DestroyPixmap = layerDestroyPixmap;
-
- pScreen->CreateGC = layerCreateGC;
-
-#ifdef RENDER
- if (ps)
- {
- ps->Composite = layerComposite;
- ps->Glyphs = layerGlyphs;
- ps->CompositeRects = layerCompositeRects;
- }
-#endif
-
- return TRUE;
-}
-
-/*
- * At any point after LayerStartInit, a new layer can be created.
- */
-LayerPtr
-LayerCreate (ScreenPtr pScreen,
- int kind,
- int depth,
- PixmapPtr pPixmap,
- ShadowUpdateProc update,
- ShadowWindowProc window,
- int randr,
- void *closure)
-{
- layerScrPriv(pScreen);
- LayerPtr pLay, *pPrev;
- LayerKindPtr pLayKind;
-
- if (kind < 0 || pLayScr->nkinds <= kind)
- return 0;
- pLayKind = &pLayScr->kinds[kind];
- pLay = (LayerPtr) xalloc (sizeof (LayerRec));
- if (!pLay)
- return 0;
- /*
- * Initialize the layer
- */
- pLay->pNext = 0;
- pLay->pKind = pLayKind;
- pLay->refcnt = 1;
- pLay->windows = 0;
- pLay->depth = depth;
- pLay->pPixmap = pPixmap;
- pLay->update = update;
- pLay->window = window;
- pLay->randr = randr;
- pLay->closure = closure;
- if (pPixmap == LAYER_SCREEN_PIXMAP)
- pLay->freePixmap = FALSE;
- else
- {
- pLay->freePixmap = TRUE;
- if (pPixmap)
- pPixmap->refcnt++;
- }
- REGION_NULL(pScreen, &pLay->region);
- /*
- * Hook the layer at the end of the list
- */
- for (pPrev = &pLayScr->pLayers; *pPrev; pPrev = &(*pPrev)->pNext)
- ;
- *pPrev = pLay;
- return pLay;
-}
-
-/*
- * Change a layer pixmap
- */
-void
-LayerSetPixmap (ScreenPtr pScreen, LayerPtr pLayer, PixmapPtr pPixmap)
-{
- LayerDestroyPixmap (pScreen, pLayer);
- pLayer->pPixmap = pPixmap;
- if (pPixmap == LAYER_SCREEN_PIXMAP)
- pLayer->freePixmap = FALSE;
- else
- {
- if (pPixmap)
- pPixmap->refcnt++;
- pLayer->freePixmap = TRUE;
- }
-}
-
-/*
- * Destroy a layer. The layer must not contain any windows.
- */
-void
-LayerDestroy (ScreenPtr pScreen, LayerPtr pLay)
-{
- layerScrPriv(pScreen);
- LayerPtr *pPrev;
-
- --pLay->refcnt;
- if (pLay->refcnt > 0)
- return;
- /*
- * Unhook the layer from the list
- */
- for (pPrev = &pLayScr->pLayers; *pPrev; pPrev = &(*pPrev)->pNext)
- if (*pPrev == pLay)
- {
- *pPrev = pLay->pNext;
- break;
- }
- /*
- * Free associated storage
- */
- LayerDestroyPixmap (pScreen, pLay);
- REGION_UNINIT (pScreen, &pLay->region);
- xfree (pLay);
-}
-
-/*
- * CloseScreen wrapper
- */
-Bool
-layerCloseScreen (int index, ScreenPtr pScreen)
-{
- layerScrPriv(pScreen);
- int kind;
-
- /* XXX this is a mess -- fbCloseScreen can only be called once,
- * and yet the intervening layers need to be called as well.
- */
- kind = pLayScr->nkinds - 1;
- pScreen->CloseScreen = pLayScr->kinds[kind].CloseScreen;
- (*pScreen->CloseScreen) (index, pScreen);
-
- /*
- * make sure the shadow layer is cleaned up as well
- */
- if (kind != LAYER_SHADOW)
- xfree (shadowGetScrPriv (pScreen));
-
- xfree (pLayScr->kinds);
- xfree (pLayScr);
- pScreen->devPrivates[layerScrPrivateIndex].ptr = 0;
- return TRUE;
-}
diff --git a/miext/layer/layerpict.c b/miext/layer/layerpict.c
deleted file mode 100644
index ef412a2c5..000000000
--- a/miext/layer/layerpict.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layerpict.c,v 1.2 2003/08/22 19:27:32 eich Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "layerstr.h"
-
-void
-layerComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- LayerPtr pLayer;
- LayerWinLoopRec loop;
- DrawablePtr pDstDrawable = pDst->pDrawable;
- ScreenPtr pScreen = pDstDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen (pScreen);
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDstDrawable;
- for (pLayer = LayerWindowFirst (pWin, &loop);
- pLayer;
- pLayer = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap (ps, pLayer->pKind, Composite);
- (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height);
- LayerWrap (ps, pLayer->pKind, Composite, layerComposite);
- }
- LayerWindowDone (pWin, &loop);
- }
- else
- {
- layerScrPriv (pScreen);
- LayerUnwrap (ps, &pLayScr->kinds[LAYER_FB], Composite);
- (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height);
- LayerWrap (ps, &pLayScr->kinds[LAYER_FB], Composite, layerComposite);
- }
-}
-
-void
-layerGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- LayerPtr pLayer;
- LayerWinLoopRec loop;
- DrawablePtr pDstDrawable = pDst->pDrawable;
- ScreenPtr pScreen = pDstDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen (pScreen);
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDstDrawable;
- for (pLayer = LayerWindowFirst (pWin, &loop);
- pLayer;
- pLayer = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap (ps, pLayer->pKind, Glyphs);
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc,
- nlist, list, glyphs);
- LayerWrap (ps, pLayer->pKind, Glyphs, layerGlyphs);
- }
- LayerWindowDone (pWin, &loop);
- }
- else
- {
- layerScrPriv (pScreen);
- LayerUnwrap (ps, &pLayScr->kinds[LAYER_FB], Glyphs);
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc,
- nlist, list, glyphs);
- LayerWrap (ps, &pLayScr->kinds[LAYER_FB], Glyphs, layerGlyphs);
- }
-}
-
-void
-layerCompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects)
-{
- LayerPtr pLayer;
- LayerWinLoopRec loop;
- DrawablePtr pDstDrawable = pDst->pDrawable;
- ScreenPtr pScreen = pDstDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen (pScreen);
-
- if (pDstDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDstDrawable;
- for (pLayer = LayerWindowFirst (pWin, &loop);
- pLayer;
- pLayer = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap (ps, pLayer->pKind, CompositeRects);
- (*ps->CompositeRects) (op, pDst, color, nRect, rects);
- LayerWrap (ps, pLayer->pKind, CompositeRects, layerCompositeRects);
- }
- LayerWindowDone (pWin, &loop);
- }
- else
- {
- layerScrPriv (pScreen);
- LayerUnwrap (ps, &pLayScr->kinds[LAYER_FB], CompositeRects);
- (*ps->CompositeRects) (op, pDst, color, nRect, rects);
- LayerWrap (ps, &pLayScr->kinds[LAYER_FB], CompositeRects, layerCompositeRects);
- }
-}
diff --git a/miext/layer/layerstr.h b/miext/layer/layerstr.h
deleted file mode 100644
index 401dfd96f..000000000
--- a/miext/layer/layerstr.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layerstr.h,v 1.4 2003/08/22 19:27:32 eich Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _LAYERSTR_H_
-#define _LAYERSTR_H_
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "layer.h"
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-extern int layerScrPrivateIndex;
-extern int layerGCPrivateIndex;
-extern int layerWinPrivateIndex;
-
-/*
- * One of these for each possible set of underlying
- * rendering code. The first kind always points at the
- * underlying frame buffer code and is created in LayerStartInit
- * so that LayerNewKind can unwrap the screen and prepare it
- * for another wrapping sequence.
- *
- * The set of functions wrapped here must be at least the union
- * of all functions wrapped by any rendering layer in use; they're
- * easy to add, so don't be shy
- */
-
-typedef struct _LayerKind {
- int kind; /* kind index */
-
- CloseScreenProcPtr CloseScreen;
-
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
-
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
-
- CreateGCProcPtr CreateGC;
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
- CompositeRectsProcPtr CompositeRects;
-#endif
-} LayerKindRec;
-
-#define LayerWrap(orig,lay,member,func) \
- (((lay)->member = (orig)->member),\
- ((orig)->member = (func)))
-#define LayerUnwrap(orig,lay,member) \
- ((orig)->member = (lay)->member)
-
-/*
- * This is the window private structure allocated for
- * all windows. There are two possible alternatives here,
- * either the window belongs to a single layer and uses its
- * internal clip/borderClip lists or the window belongs to one
- * or more layers and uses a separate clip/borderclip for each
- * layer. When this is integrated into the core window struct,
- * the LayerWinKind can become a single bit saving 8 bytes per
- * window.
- */
-
-typedef struct _LayerWin {
- Bool isList;
- union {
- LayerPtr pLayer;
- LayerListPtr pLayList;
- } u;
-} LayerWinRec;
-
-typedef struct _LayerList {
- LayerListPtr pNext; /* list of layers for this window */
- LayerPtr pLayer; /* the layer */
- Bool inheritClip; /* use the window clipList/borderClip */
- RegionRec clipList; /* per-layer clip/border clip lists */
- RegionRec borderClip;
-} LayerListRec;
-
-#define layerGetWinPriv(pWin) ((LayerWinPtr) (pWin)->devPrivates[layerWinPrivateIndex].ptr)
-#define layerWinPriv(pWin) LayerWinPtr pLayWin = layerGetWinPriv(pWin)
-
-#define layerWinLayer(pLayWin) ((pLayWin)->isList ? (pLayWin)->u.pLayList->pLayer : (pLayWin)->u.pLayer)
-
-typedef struct _LayerWinLoop {
- LayerWinPtr pLayWin;
- LayerListPtr pLayList;
- PixmapPtr pPixmap; /* original window pixmap */
- RegionRec clipList; /* saved original clipList contents */
- RegionRec borderClip; /* saved original borderClip contents */
-} LayerWinLoopRec, *LayerWinLoopPtr;
-
-#define layerWinFirstLayer(pLayWin,pLayList) ((pLayWin)->isList ? ((pLayList) = (pLayWin)->u.pLayList)->pLayer : pLayWin->u.pLayer)
-#define layerWinNextLayer(pLayWin,pLayList) ((pLayWin)->isList ? ((pLayList) = (pLayList)->pNext)->pLayer : 0)
-
-LayerPtr
-LayerWindowFirst (WindowPtr pWin, LayerWinLoopPtr pLoop);
-
-LayerPtr
-LayerWindowNext (WindowPtr pWin, LayerWinLoopPtr pLoop);
-
-void
-LayerWindowDone (WindowPtr pWin, LayerWinLoopPtr pLoop);
-
-
-/*
- * This is the GC private structure allocated for all GCs.
- * XXX this is really messed up; I'm not sure how to fix it yet
- */
-
-typedef struct _LayerGC {
- GCFuncs *funcs;
- LayerKindPtr pKind;
-} LayerGCRec;
-
-#define layerGetGCPriv(pGC) ((LayerGCPtr) (pGC)->devPrivates[layerGCPrivateIndex].ptr)
-#define layerGCPriv(pGC) LayerGCPtr pLayGC = layerGetGCPriv(pGC)
-
-/*
- * This is the screen private, it contains
- * the layer kinds and the layers themselves
- */
-typedef struct _LayerScreen {
- int nkinds; /* number of elements in kinds array */
- LayerKindPtr kinds; /* created kinds; reallocated when new ones added */
- LayerPtr pLayers; /* list of layers for this screen */
-} LayerScreenRec;
-
-#define layerGetScrPriv(pScreen) ((LayerScreenPtr) (pScreen)->devPrivates[layerScrPrivateIndex].ptr)
-#define layerScrPriv(pScreen) LayerScreenPtr pLayScr = layerGetScrPriv(pScreen)
-
-Bool
-layerCloseScreen (int index, ScreenPtr pScreen);
-
-Bool
-layerCreateWindow (WindowPtr pWin);
-
-Bool
-layerDestroyWindow (WindowPtr pWin);
-
-Bool
-layerChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
-
-void
-layerPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what);
-
-void
-layerPaintWindowBorder (WindowPtr pWin, RegionPtr pRegion, int what);
-
-void
-layerCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
-
-PixmapPtr
-layerCreatePixmap (ScreenPtr pScreen, int width, int height, int depth);
-
-Bool
-layerDestroyPixmap (PixmapPtr pPixmap);
-
-Bool
-layerCreateGC (GCPtr pGC);
-
-#ifdef RENDER
-void
-layerComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void
-layerGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-
-void
-layerCompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects);
-#endif
-void layerValidateGC(GCPtr, unsigned long, DrawablePtr);
-void layerChangeGC(GCPtr, unsigned long);
-void layerCopyGC(GCPtr, unsigned long, GCPtr);
-void layerDestroyGC(GCPtr);
-void layerChangeClip(GCPtr, int, pointer, int);
-void layerDestroyClip(GCPtr);
-void layerCopyClip(GCPtr, GCPtr);
-
-void
-layerFillSpans(DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted);
-
-void
-layerSetSpans(DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int nspans,
- int fSorted);
-
-void
-layerPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-);
-
-RegionPtr
-layerCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-);
-
-RegionPtr
-layerCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-);
-
-void
-layerPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-);
-void
-layerPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-);
-
-void
-layerPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-);
-
-void
-layerPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects
-);
-
-void
-layerPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-);
-
-void
-layerFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr pptInit
-);
-
-void
-layerPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-);
-
-void
-layerPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-);
-
-int
-layerPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-);
-
-int
-layerPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-);
-
-void
-layerImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-);
-
-void
-layerImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-);
-
-void
-layerImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-void
-layerPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-);
-
-void
-layerPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-);
-
-#endif /* _LAYERSTR_H_ */
diff --git a/miext/layer/layerwin.c b/miext/layer/layerwin.c
deleted file mode 100644
index 44a5df24c..000000000
--- a/miext/layer/layerwin.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/layer/layerwin.c,v 1.8 2003/11/10 18:22:49 tsi Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "layerstr.h"
-
-static LayerListPtr
-NewLayerList (ScreenPtr pScreen, LayerPtr pLayer)
-{
- LayerListPtr pLayList;
-
- pLayList = (LayerListPtr) xalloc (sizeof (LayerListRec));
- if (!pLayList)
- return 0;
- pLayList->pNext = 0;
- pLayList->pLayer = pLayer;
- pLayList->inheritClip = TRUE;
- REGION_NULL (pScreen, &pLayList->clipList);
- REGION_NULL (pScreen, &pLayList->borderClip);
- return pLayList;
-}
-
-static void
-FreeLayerList (ScreenPtr pScreen, LayerListPtr pLayList)
-{
- REGION_UNINIT (pScreen, &pLayList->clipList);
- REGION_UNINIT (pScreen, &pLayList->borderClip);
- xfree (pLayList);
-}
-
-/*
- * Create pixmap for a layer
- */
-
-Bool
-LayerCreatePixmap (ScreenPtr pScreen, LayerPtr pLayer)
-{
- LayerKindPtr pKind = pLayer->pKind;
-
- LayerUnwrap (pScreen, pKind, CreatePixmap);
- /* XXX create full-screen sized layers all around */
- pLayer->pPixmap = (*pScreen->CreatePixmap) (pScreen, pScreen->width,
- pScreen->height, pLayer->depth);
- LayerWrap (pScreen, pKind, CreatePixmap, layerCreatePixmap);
- if (!pLayer->pPixmap)
- return FALSE;
- if (pLayer->pKind->kind == LAYER_SHADOW)
- {
- if (!shadowAdd (pScreen, pLayer->pPixmap, pLayer->update,
- pLayer->window, pLayer->randr,
- pLayer->closure))
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * Destroy pixmap for a layer
- */
-
-void
-LayerDestroyPixmap (ScreenPtr pScreen, LayerPtr pLayer)
-{
- if (pLayer->pPixmap)
- {
- if (pLayer->pKind->kind == LAYER_SHADOW)
- shadowRemove (pScreen, pLayer->pPixmap);
- if (pLayer->freePixmap)
- {
- LayerKindPtr pKind = pLayer->pKind;
-
- LayerUnwrap (pScreen, pKind, DestroyPixmap);
- (*pScreen->DestroyPixmap) (pLayer->pPixmap);
- LayerWrap (pScreen, pKind, DestroyPixmap, layerDestroyPixmap);
- }
- pLayer->pPixmap = 0;
- }
-}
-
-/*
- * Add a window to a layer
- */
-Bool
-LayerWindowAdd (ScreenPtr pScreen, LayerPtr pLayer, WindowPtr pWin)
-{
- layerWinPriv(pWin);
-
- if (pLayer->pPixmap == LAYER_SCREEN_PIXMAP)
- pLayer->pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
- else if (!pLayer->pPixmap && !LayerCreatePixmap (pScreen, pLayer))
- return FALSE;
- /*
- * Add a new layer list if needed
- */
- if (pLayWin->isList || pLayWin->u.pLayer)
- {
- LayerListPtr pPrev;
- LayerListPtr pLayList;
-
- if (!pLayWin->isList)
- {
- pPrev = NewLayerList (pScreen, pLayWin->u.pLayer);
- if (!pPrev)
- return FALSE;
- }
- else
- {
- for (pPrev = pLayWin->u.pLayList; pPrev->pNext; pPrev = pPrev->pNext)
- ;
- }
- pLayList = NewLayerList (pScreen, pLayer);
- if (!pLayList)
- {
- if (!pLayWin->isList)
- FreeLayerList (pScreen, pPrev);
- return FALSE;
- }
- pPrev->pNext = pLayList;
- if (!pLayWin->isList)
- {
- pLayWin->isList = TRUE;
- pLayWin->u.pLayList = pPrev;
- }
- }
- else
- pLayWin->u.pLayer = pLayer;
- /*
- * XXX only one layer supported for drawing, last one wins
- */
- (*pScreen->SetWindowPixmap) (pWin, pLayer->pPixmap);
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pLayer->refcnt++;
- pLayer->windows++;
- return TRUE;
-}
-
-/*
- * Remove a window from a layer
- */
-
-void
-LayerWindowRemove (ScreenPtr pScreen, LayerPtr pLayer, WindowPtr pWin)
-{
- layerWinPriv(pWin);
-
- if (pLayWin->isList)
- {
- LayerListPtr *pPrev;
- LayerListPtr pLayList;
-
- for (pPrev = &pLayWin->u.pLayList; (pLayList = *pPrev); pPrev = &pLayList->pNext)
- {
- if (pLayList->pLayer == pLayer)
- {
- *pPrev = pLayList->pNext;
- FreeLayerList (pScreen, pLayList);
- --pLayer->windows;
- if (pLayer->windows <= 0)
- LayerDestroyPixmap (pScreen, pLayer);
- LayerDestroy (pScreen, pLayer);
- break;
- }
- }
- pLayList = pLayWin->u.pLayList;
- if (!pLayList)
- {
- /*
- * List is empty, set isList back to false
- */
- pLayWin->isList = FALSE;
- pLayWin->u.pLayer = 0;
- }
- else if (!pLayList->pNext && pLayList->inheritClip)
- {
- /*
- * List contains a single element using the
- * window clip, free the list structure and
- * host the layer back to the window private
- */
- pLayer = pLayList->pLayer;
- FreeLayerList (pScreen, pLayList);
- pLayWin->isList = FALSE;
- pLayWin->u.pLayer = pLayer;
- }
- }
- else
- {
- if (pLayWin->u.pLayer == pLayer)
- {
- --pLayer->windows;
- if (pLayer->windows <= 0)
- LayerDestroyPixmap (pScreen, pLayer);
- LayerDestroy (pScreen, pLayer);
- pLayWin->u.pLayer = 0;
- }
- }
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-}
-
-/*
- * Looping primitives for window layering. Usage:
- *
- * for (pLayer = LayerWindowFirst (pWin, &loop);
- * pLayer;
- * pLayer = LayerWindowNext (&loop))
- * {
- * ...
- * }
- * LayerWindowDone (pWin, &loop);
- */
-
-LayerPtr
-LayerWindowFirst (WindowPtr pWin, LayerWinLoopPtr pLoop)
-{
- layerWinPriv (pWin);
-
- pLoop->pLayWin = pLayWin;
- if (!pLayWin->isList)
- return pLayWin->u.pLayer;
-
- /*
- * Preserve original state
- */
- pLoop->clipList = pWin->clipList;
- pLoop->borderClip = pWin->borderClip;
- pLoop->pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
-
- /*
- * Set initial list element
- */
- pLoop->pLayList = pLayWin->u.pLayList;
-
- /*
- * Return first layer
- */
- return LayerWindowNext (pWin, pLoop);
-}
-
-LayerPtr
-LayerWindowNext (WindowPtr pWin, LayerWinLoopPtr pLoop)
-{
- LayerPtr pLayer;
- LayerWinPtr pLayWin = pLoop->pLayWin;
- LayerListPtr pLayList;
-
- if (!pLayWin->isList)
- return 0;
-
- pLayList = pLoop->pLayList;
- pLayer = pLayList->pLayer;
- /*
- * Configure window for this layer
- */
- (*pWin->drawable.pScreen->SetWindowPixmap) (pWin, pLayer->pPixmap);
- if (!pLayList->inheritClip)
- {
- pWin->clipList = pLayList->clipList;
- pWin->borderClip = pLayList->borderClip;
- }
- /*
- * Step to next layer list
- */
- pLoop->pLayList = pLayList->pNext;
- /*
- * Return layer
- */
- return pLayer;
-}
-
-void
-LayerWindowDone (WindowPtr pWin, LayerWinLoopPtr pLoop)
-{
- LayerWinPtr pLayWin = pLoop->pLayWin;
-
- if (!pLayWin->isList)
- return;
- /*
- * clean up after the loop
- */
- pWin->clipList = pLoop->clipList;
- pWin->borderClip = pLoop->clipList;
- (*pWin->drawable.pScreen->SetWindowPixmap) (pWin, pLoop->pPixmap);
-}
-
-Bool
-layerCreateWindow (WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- layerWinPriv(pWin);
- layerScrPriv(pScreen);
- LayerPtr pLayer;
- Bool ret;
-
- pLayWin->isList = FALSE;
- pLayWin->u.pLayer = 0;
-
- /*
- * input only windows don't live in any layer
- */
- if (pWin->drawable.type == UNDRAWABLE_WINDOW)
- return TRUE;
- /*
- * Use a reasonable default layer -- the first
- * layer matching the windows depth. Subsystems needing
- * alternative layering semantics can override this by
- * replacing this function. Perhaps a new screen function
- * could be used to select the correct initial window
- * layer instead.
- */
- for (pLayer = pLayScr->pLayers; pLayer; pLayer = pLayer->pNext)
- if (pLayer->depth == pWin->drawable.depth)
- break;
- ret = TRUE;
- if (pLayer)
- {
- pScreen->CreateWindow = pLayer->pKind->CreateWindow;
- ret = (*pScreen->CreateWindow) (pWin);
- pLayer->pKind->CreateWindow = pScreen->CreateWindow;
- pScreen->CreateWindow = layerCreateWindow;
- LayerWindowAdd (pScreen, pLayer, pWin);
- }
- return ret;
-}
-
-Bool
-layerDestroyWindow (WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- layerWinPriv(pWin);
- LayerPtr pLayer;
- Bool ret = TRUE;
-
- while ((pLayer = layerWinLayer (pLayWin)))
- {
- LayerUnwrap (pScreen, pLayer->pKind, DestroyWindow);
- ret = (*pScreen->DestroyWindow) (pWin);
- LayerWrap (pScreen, pLayer->pKind, DestroyWindow, layerDestroyWindow);
- LayerWindowRemove (pWin->drawable.pScreen, pLayer, pWin);
- }
- return ret;
-}
-
-Bool
-layerChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLay;
- LayerWinLoopRec loop;
- Bool ret = TRUE;
-
- for (pLay = LayerWindowFirst (pWin, &loop);
- pLay;
- pLay = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap(pScreen,pLay->pKind,ChangeWindowAttributes);
- if (!(*pScreen->ChangeWindowAttributes) (pWin, mask))
- ret = FALSE;
- LayerWrap(pScreen,pLay->pKind,ChangeWindowAttributes,layerChangeWindowAttributes);
- }
- LayerWindowDone (pWin, &loop);
- return ret;
-}
-
-void
-layerPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLay;
- LayerWinLoopRec loop;
-
- for (pLay = LayerWindowFirst (pWin, &loop);
- pLay;
- pLay = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap(pScreen,pLay->pKind,PaintWindowBackground);
- (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
- LayerWrap(pScreen,pLay->pKind,PaintWindowBackground,layerPaintWindowBackground);
- }
- LayerWindowDone (pWin, &loop);
-}
-
-void
-layerPaintWindowBorder (WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLay;
- LayerWinLoopRec loop;
-
- for (pLay = LayerWindowFirst (pWin, &loop);
- pLay;
- pLay = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap(pScreen,pLay->pKind,PaintWindowBorder);
- (*pScreen->PaintWindowBorder) (pWin, pRegion, what);
- LayerWrap(pScreen,pLay->pKind,PaintWindowBorder,layerPaintWindowBorder);
- }
- LayerWindowDone (pWin, &loop);
-}
-
-void
-layerCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLay;
- LayerWinLoopRec loop;
- int dx = 0, dy = 0;
-
- for (pLay = LayerWindowFirst (pWin, &loop);
- pLay;
- pLay = LayerWindowNext (pWin, &loop))
- {
- LayerUnwrap(pScreen,pLay->pKind,CopyWindow);
- /*
- * Undo the translation done within the last CopyWindow proc (sigh)
- */
- if (dx || dy)
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, dx, dy);
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- LayerWrap(pScreen,pLay->pKind,CopyWindow,layerCopyWindow);
- /*
- * Save offset to undo translation next time around
- */
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- }
- LayerWindowDone (pWin, &loop);
-}
-
-PixmapPtr
-layerCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
-{
- /* XXX assume the first layer can handle all pixmaps */
- layerScrPriv (pScreen);
- LayerKindPtr pKind;
- PixmapPtr pPixmap;
-
- pKind = &pLayScr->kinds[0];
- if (pLayScr->pLayers)
- pKind = pLayScr->pLayers->pKind;
- LayerUnwrap (pScreen, pKind, CreatePixmap);
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth);
- LayerWrap (pScreen,pKind,CreatePixmap,layerCreatePixmap);
- return pPixmap;
-}
-
-Bool
-layerDestroyPixmap (PixmapPtr pPixmap)
-{
- /* XXX assume the first layer can handle all pixmaps */
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- layerScrPriv (pScreen);
- LayerKindPtr pKind;
- Bool ret;
-
- pKind = &pLayScr->kinds[0];
- if (pLayScr->pLayers)
- pKind = pLayScr->pLayers->pKind;
- LayerUnwrap (pScreen, pKind, DestroyPixmap);
- ret = (*pScreen->DestroyPixmap) (pPixmap);
- LayerWrap (pScreen,pKind,DestroyPixmap,layerDestroyPixmap);
- return ret;
-}
-
diff --git a/miext/rootless/accel/rlAccel.h b/miext/rootless/accel/rlAccel.h
deleted file mode 100644
index 56afd7331..000000000
--- a/miext/rootless/accel/rlAccel.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Rootless Acceleration Code
- */
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlAccel.h,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-/*
- * rlBlt.c
- */
-void
-rlBlt (FbBits *srcLine,
- FbStride srcStride,
- int srcX,
-
- ScreenPtr pDstScreen,
- FbBits *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp,
-
- Bool reverse,
- Bool upsidedown);
-
-/*
- * rlCopy.c
- */
-RegionPtr
-rlCopyArea (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut);
-
-/*
- * rlFill.c
- */
-void
-rlFill (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int width,
- int height);
-
-void
-rlSolidBoxClipped (DrawablePtr pDrawable,
- RegionPtr pClip,
- int x1,
- int y1,
- int x2,
- int y2,
- FbBits and,
- FbBits xor);
-
-/*
- * rlFillRect.c
- */
-void
-rlPolyFillRect(DrawablePtr pDrawable,
- GCPtr pGC,
- int nrect,
- xRectangle *prect);
-
-/*
- * rlFillSpans.c
- */
-void
-rlFillSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted);
-
-/*
- * rlGlyph.c
- */
-void
-rlImageGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppciInit,
- pointer pglyphBase);
-
-/*
- * rlSolid.c
- */
-void
-rlSolid (ScreenPtr pScreen,
- FbBits *dst,
- FbStride dstStride,
- int dstX,
- int bpp,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor);
diff --git a/miext/rootless/accel/rlBlt.c b/miext/rootless/accel/rlBlt.c
deleted file mode 100644
index ba6fdf227..000000000
--- a/miext/rootless/accel/rlBlt.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Accelerated rootless blit
- */
-/*
- * This code is largely copied from fbBlt.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlBlt.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rootlessCommon.h"
-#include "rlAccel.h"
-
-
-void
-rlBlt (FbBits *srcLine,
- FbStride srcStride,
- int srcX,
-
- ScreenPtr pDstScreen,
- FbBits *dstLine,
- FbStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- FbBits pm,
- int bpp,
-
- Bool reverse,
- Bool upsidedown)
-{
- FbBits *src, *dst;
- int leftShift, rightShift;
- FbBits startmask, endmask;
- FbBits bits, bits1;
- int n, nmiddle;
- Bool destInvarient;
- int startbyte, endbyte;
- FbDeclareMergeRop ();
-
-#ifdef FB_24BIT
- if (bpp == 24 && !FbCheck24Pix (pm))
- {
- fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX,
- width, height, alu, pm, reverse, upsidedown);
- return;
- }
-#endif
- FbInitializeMergeRop(alu, pm);
- destInvarient = FbDestInvarientMergeRop();
- if (upsidedown)
- {
- srcLine += (height - 1) * (srcStride);
- dstLine += (height - 1) * (dstStride);
- srcStride = -srcStride;
- dstStride = -dstStride;
- }
- FbMaskBitsBytes (dstX, width, destInvarient, startmask, startbyte,
- nmiddle, endmask, endbyte);
-
- /*
- * Beginning of the rootless acceleration code
- */
- if (!startmask && !endmask && alu == GXcopy &&
- height * nmiddle * sizeof(*dst) > rootless_CopyBytes_threshold)
- {
- if (pm == FB_ALLONES && SCREENREC(pDstScreen)->imp->CopyBytes)
- {
- SCREENREC(pDstScreen)->imp->CopyBytes(
- nmiddle * sizeof(*dst), height,
- (char *) srcLine + (srcX >> 3),
- srcStride * sizeof (*src),
- (char *) dstLine + (dstX >> 3),
- dstStride * sizeof (*dst));
- return;
- }
-
- /* FIXME: the pm test here isn't super-wonderful - just because
- we don't care about the top eight bits doesn't necessarily
- mean we want them set to 255. But doing this does give a
- factor of two performance improvement when copying from a
- pixmap to a window, which is pretty common.. */
-
- else if (bpp == 32 && sizeof(FbBits) == 4 &&
- pm == 0x00FFFFFFUL && !reverse &&
- SCREENREC(pDstScreen)->imp->CompositePixels)
- {
- /* need to copy XRGB to ARGB. */
-
- void *src[2], *dest[2];
- unsigned int src_rowbytes[2], dest_rowbytes[2];
- unsigned int fn;
-
- src[0] = (char *) srcLine + (srcX >> 3);
- src[1] = NULL;
- src_rowbytes[0] = srcStride * sizeof(*src);
- src_rowbytes[1] = 0;
-
- dest[0] = (char *) dstLine + (dstX >> 3);
- dest[1] = dest[0];
- dest_rowbytes[0] = dstStride * sizeof(*dst);
- dest_rowbytes[1] = dest_rowbytes[0];
-
- fn = RL_COMPOSITE_FUNCTION(RL_COMPOSITE_SRC, RL_DEPTH_ARGB8888,
- RL_DEPTH_NIL, RL_DEPTH_ARGB8888);
-
- if (SCREENREC(pDstScreen)->imp->CompositePixels(
- nmiddle, height,
- fn, src, src_rowbytes,
- NULL, 0, dest, dest_rowbytes) == Success)
- {
- return;
- }
- }
- }
- /* End of the rootless acceleration code */
-
- if (reverse)
- {
- srcLine += ((srcX + width - 1) >> FB_SHIFT) + 1;
- dstLine += ((dstX + width - 1) >> FB_SHIFT) + 1;
- srcX = (srcX + width - 1) & FB_MASK;
- dstX = (dstX + width - 1) & FB_MASK;
- }
- else
- {
- srcLine += srcX >> FB_SHIFT;
- dstLine += dstX >> FB_SHIFT;
- srcX &= FB_MASK;
- dstX &= FB_MASK;
- }
- if (srcX == dstX)
- {
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
- if (reverse)
- {
- if (endmask)
- {
- bits = *--src;
- --dst;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- *--dst = FbDoDestInvarientMergeRop(*--src);
- }
- else
- {
- while (n--)
- {
- bits = *--src;
- --dst;
- *dst = FbDoMergeRop (bits, *dst);
- }
- }
- if (startmask)
- {
- bits = *--src;
- --dst;
- FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (startmask)
- {
- bits = *src++;
- FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
-#if 0
- /*
- * This provides some speedup on screen->screen blts
- * over the PCI bus, usually about 10%. But fb
- * isn't usually used for this operation...
- */
- if (_ca2 + 1 == 0 && _cx2 == 0)
- {
- FbBits t1, t2, t3, t4;
- while (n >= 4)
- {
- t1 = *src++;
- t2 = *src++;
- t3 = *src++;
- t4 = *src++;
- *dst++ = t1;
- *dst++ = t2;
- *dst++ = t3;
- *dst++ = t4;
- n -= 4;
- }
- }
-#endif
- while (n--)
- *dst++ = FbDoDestInvarientMergeRop(*src++);
- }
- else
- {
- while (n--)
- {
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = *src;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- }
- }
- }
- else
- {
- if (srcX > dstX)
- {
- leftShift = srcX - dstX;
- rightShift = FB_UNIT - leftShift;
- }
- else
- {
- rightShift = dstX - srcX;
- leftShift = FB_UNIT - rightShift;
- }
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
-
- bits1 = 0;
- if (reverse)
- {
- if (srcX < dstX)
- bits1 = *--src;
- if (endmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(endmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- --dst;
- *dst = FbDoDestInvarientMergeRop(bits);
- }
- }
- else
- {
- while (n--)
- {
- bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- --dst;
- *dst = FbDoMergeRop(bits, *dst);
- }
- }
- if (startmask)
- {
- bits = FbScrRight(bits1, rightShift);
- if (FbScrRight(startmask, leftShift))
- {
- bits1 = *--src;
- bits |= FbScrLeft(bits1, leftShift);
- }
- --dst;
- FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (srcX > dstX)
- bits1 = *src++;
- if (startmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMergeRop(bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = FbScrLeft(bits1, leftShift);
- if (FbScrLeft(endmask, rightShift))
- {
- bits1 = *src;
- bits |= FbScrRight(bits1, rightShift);
- }
- FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
- }
- }
- }
- }
-}
diff --git a/miext/rootless/accel/rlCopy.c b/miext/rootless/accel/rlCopy.c
deleted file mode 100644
index cbd58b4cf..000000000
--- a/miext/rootless/accel/rlCopy.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This code is largely copied from fbcopy.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlCopy.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rlAccel.h"
-
-
-void
-rlCopyNtoN (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- BoxPtr pbox,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown,
- Pixel bitplane,
- void *closure)
-{
- CARD8 alu = pGC ? pGC->alu : GXcopy;
- FbBits pm = pGC ? fbGetGCPrivate(pGC)->pm : FB_ALLONES;
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
- int srcXoff, srcYoff;
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
-
- fbGetDrawable (pSrcDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
- fbGetDrawable (pDstDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- while (nbox--)
- {
- rlBlt (src + (pbox->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (pbox->x1 + dx + srcXoff) * srcBpp,
-
- pDstDrawable->pScreen,
- dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
-
- (pbox->x2 - pbox->x1) * dstBpp,
- (pbox->y2 - pbox->y1),
-
- alu,
- pm,
- dstBpp,
-
- reverse,
- upsidedown);
- pbox++;
- }
-}
-
-RegionPtr
-rlCopyArea (DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut)
-{
- fbCopyProc copy;
-
-#ifdef FB_24_32BIT
- if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
- copy = fb24_32CopyMtoN;
- else
-#endif
- copy = rlCopyNtoN;
- return fbDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
- widthSrc, heightSrc, xOut, yOut, copy, 0, 0);
-}
diff --git a/miext/rootless/accel/rlFill.c b/miext/rootless/accel/rlFill.c
deleted file mode 100644
index 7fd7adfa8..000000000
--- a/miext/rootless/accel/rlFill.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * This code is largely copied from fbfill.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlFill.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rlAccel.h"
-
-
-void
-rlFill (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int width,
- int height)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- switch (pGC->fillStyle) {
- case FillSolid:
- rlSolid (pDrawable->pScreen,
- dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- dstBpp,
- width * dstBpp, height,
- pPriv->and, pPriv->xor);
- break;
- case FillStippled:
- case FillOpaqueStippled: {
- PixmapPtr pStip = pGC->stipple;
- int stipWidth = pStip->drawable.width;
- int stipHeight = pStip->drawable.height;
-
- if (dstBpp == 1)
- {
- int alu;
- FbBits *stip;
- FbStride stipStride;
- int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
-
- if (pGC->fillStyle == FillStippled)
- alu = FbStipple1Rop(pGC->alu,pGC->fgPixel);
- else
- alu = FbOpaqueStipple1Rop(pGC->alu,pGC->fgPixel,pGC->bgPixel);
- fbGetDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
- fbTile (dst + (y + dstYoff) * dstStride,
- dstStride,
- x + dstXoff,
- width, height,
- stip,
- stipStride,
- stipWidth,
- stipHeight,
- alu,
- pPriv->pm,
- dstBpp,
-
- (pGC->patOrg.x + pDrawable->x + dstXoff),
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- }
- else
- {
- FbStip *stip;
- FbStride stipStride;
- int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
- FbBits fgand, fgxor, bgand, bgxor;
-
- fgand = pPriv->and;
- fgxor = pPriv->xor;
- if (pGC->fillStyle == FillStippled)
- {
- bgand = fbAnd(GXnoop,(FbBits) 0,FB_ALLONES);
- bgxor = fbXor(GXnoop,(FbBits) 0,FB_ALLONES);
- }
- else
- {
- bgand = pPriv->bgand;
- bgxor = pPriv->bgxor;
- }
-
- fbGetStipDrawable (&pStip->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
- fbStipple (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- dstBpp,
- width * dstBpp, height,
- stip,
- stipStride,
- stipWidth,
- stipHeight,
- pPriv->evenStipple,
- fgand, fgxor,
- bgand, bgxor,
- pGC->patOrg.x + pDrawable->x + dstXoff,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- }
- break;
- }
- case FillTiled: {
- PixmapPtr pTile = pGC->tile.pixmap;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileWidth;
- int tileHeight;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
-
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- fbTile (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- width * dstBpp, height,
- tile,
- tileStride,
- tileWidth * tileBpp,
- tileHeight,
- pGC->alu,
- pPriv->pm,
- dstBpp,
- (pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
- break;
- }
- }
- fbValidateDrawable (pDrawable);
-}
-
-void
-rlSolidBoxClipped (DrawablePtr pDrawable,
- RegionPtr pClip,
- int x1,
- int y1,
- int x2,
- int y2,
- FbBits and,
- FbBits xor)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- BoxPtr pbox;
- int nbox;
- int partX1, partX2, partY1, partY2;
-
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
- for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
- nbox--;
- pbox++)
- {
- partX1 = pbox->x1;
- if (partX1 < x1)
- partX1 = x1;
-
- partX2 = pbox->x2;
- if (partX2 > x2)
- partX2 = x2;
-
- if (partX2 <= partX1)
- continue;
-
- partY1 = pbox->y1;
- if (partY1 < y1)
- partY1 = y1;
-
- partY2 = pbox->y2;
- if (partY2 > y2)
- partY2 = y2;
-
- if (partY2 <= partY1)
- continue;
-
- rlSolid (pDrawable->pScreen,
- dst + (partY1 + dstYoff) * dstStride,
- dstStride,
- (partX1 + dstXoff) * dstBpp,
- dstBpp,
-
- (partX2 - partX1) * dstBpp,
- (partY2 - partY1),
- and, xor);
- }
-}
diff --git a/miext/rootless/accel/rlFillRect.c b/miext/rootless/accel/rlFillRect.c
deleted file mode 100644
index 2ce9eae2b..000000000
--- a/miext/rootless/accel/rlFillRect.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This code is largely copied from fbfillrect.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlFillRect.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rlAccel.h"
-
-
-void
-rlPolyFillRect(DrawablePtr pDrawable,
- GCPtr pGC,
- int nrect,
- xRectangle *prect)
-{
- RegionPtr pClip = fbGetCompositeClip(pGC);
- register BoxPtr pbox;
- BoxPtr pextent;
- int extentX1, extentX2, extentY1, extentY2;
- int fullX1, fullX2, fullY1, fullY2;
- int partX1, partX2, partY1, partY2;
- int xorg, yorg;
- int n;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
- extentX1 = pextent->x1;
- extentY1 = pextent->y1;
- extentX2 = pextent->x2;
- extentY2 = pextent->y2;
- while (nrect--)
- {
- fullX1 = prect->x + xorg;
- fullY1 = prect->y + yorg;
- fullX2 = fullX1 + (int) prect->width;
- fullY2 = fullY1 + (int) prect->height;
- prect++;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
-
- if (fullY1 < extentY1)
- fullY1 = extentY1;
-
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullY2 > extentY2)
- fullY2 = extentY2;
-
- if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
- continue;
- n = REGION_NUM_RECTS (pClip);
- if (n == 1)
- {
- rlFill (pDrawable,
- pGC,
- fullX1, fullY1, fullX2-fullX1, fullY2-fullY1);
- }
- else
- {
- pbox = REGION_RECTS(pClip);
- /*
- * clip the rectangle to each box in the clip region
- * this is logically equivalent to calling Intersect()
- */
- while(n--)
- {
- partX1 = pbox->x1;
- if (partX1 < fullX1)
- partX1 = fullX1;
- partY1 = pbox->y1;
- if (partY1 < fullY1)
- partY1 = fullY1;
- partX2 = pbox->x2;
- if (partX2 > fullX2)
- partX2 = fullX2;
- partY2 = pbox->y2;
- if (partY2 > fullY2)
- partY2 = fullY2;
-
- pbox++;
-
- if (partX1 < partX2 && partY1 < partY2)
- rlFill (pDrawable, pGC,
- partX1, partY1,
- partX2 - partX1, partY2 - partY1);
- }
- }
- }
-}
diff --git a/miext/rootless/accel/rlFillSpans.c b/miext/rootless/accel/rlFillSpans.c
deleted file mode 100644
index fd5ee35f5..000000000
--- a/miext/rootless/accel/rlFillSpans.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This code is largely copied from fbfillsp.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlFillSpans.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rlAccel.h"
-
-
-void
-rlFillSpans (DrawablePtr pDrawable,
- GCPtr pGC,
- int n,
- DDXPointPtr ppt,
- int *pwidth,
- int fSorted)
-{
- RegionPtr pClip = fbGetCompositeClip(pGC);
- BoxPtr pextent, pbox;
- int nbox;
- int extentX1, extentX2, extentY1, extentY2;
- int fullX1, fullX2, fullY1;
- int partX1, partX2;
-
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
- extentX1 = pextent->x1;
- extentY1 = pextent->y1;
- extentX2 = pextent->x2;
- extentY2 = pextent->y2;
- while (n--)
- {
- fullX1 = ppt->x;
- fullY1 = ppt->y;
- fullX2 = fullX1 + (int) *pwidth;
- ppt++;
- pwidth++;
-
- if (fullY1 < extentY1 || extentY2 <= fullY1)
- continue;
-
- if (fullX1 < extentX1)
- fullX1 = extentX1;
-
- if (fullX2 > extentX2)
- fullX2 = extentX2;
-
- if (fullX1 >= fullX2)
- continue;
-
- nbox = REGION_NUM_RECTS (pClip);
- if (nbox == 1)
- {
- rlFill (pDrawable,
- pGC,
- fullX1, fullY1, fullX2-fullX1, 1);
- }
- else
- {
- pbox = REGION_RECTS(pClip);
- while(nbox--)
- {
- if (pbox->y1 <= fullY1 && fullY1 < pbox->y2)
- {
- partX1 = pbox->x1;
- if (partX1 < fullX1)
- partX1 = fullX1;
- partX2 = pbox->x2;
- if (partX2 > fullX2)
- partX2 = fullX2;
- if (partX2 > partX1)
- {
- rlFill (pDrawable, pGC,
- partX1, fullY1,
- partX2 - partX1, 1);
- }
- }
- pbox++;
- }
- }
- }
-}
diff --git a/miext/rootless/accel/rlGlyph.c b/miext/rootless/accel/rlGlyph.c
deleted file mode 100644
index 2bf2da64b..000000000
--- a/miext/rootless/accel/rlGlyph.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * This code is largely copied from fbglyph.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlGlyph.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "fontstruct.h"
-#include "dixfontstr.h"
-#include "rlAccel.h"
-
-
-void
-rlImageGlyphBlt (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned int nglyph,
- CharInfoPtr *ppciInit,
- pointer pglyphBase)
-{
- FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
- CharInfoPtr *ppci;
- CharInfoPtr pci;
- unsigned char *pglyph; /* pointer bits in glyph */
- int gWidth, gHeight; /* width and height of glyph */
- FbStride gStride; /* stride of glyph */
- Bool opaque;
- int n;
- int gx, gy;
-#ifndef FBNOPIXADDR
- void (*glyph) (FbBits *,
- FbStride,
- int,
- FbStip *,
- FbBits,
- int,
- int);
- FbBits *dst = 0;
- FbStride dstStride = 0;
- int dstBpp = 0;
- int dstXoff = 0, dstYoff = 0;
-
- glyph = 0;
- if (pPriv->and == 0)
- {
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- switch (dstBpp) {
- case 8: glyph = fbGlyph8; break;
- case 16: glyph = fbGlyph16; break;
-#ifdef FB_24BIT
- case 24: glyph = fbGlyph24; break;
-#endif
- case 32: glyph = fbGlyph32; break;
- }
- }
-#endif
-
- x += pDrawable->x;
- y += pDrawable->y;
-
- if (TERMINALFONT (pGC->font)
-#ifndef FBNOPIXADDR
- && !glyph
-#endif
- )
- {
- opaque = TRUE;
- }
- else
- {
- int xBack, widthBack;
- int yBack, heightBack;
-
- ppci = ppciInit;
- n = nglyph;
- widthBack = 0;
- while (n--)
- widthBack += (*ppci++)->metrics.characterWidth;
-
- xBack = x;
- if (widthBack < 0)
- {
- xBack += widthBack;
- widthBack = -widthBack;
- }
- yBack = y - FONTASCENT(pGC->font);
- heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
- rlSolidBoxClipped (pDrawable,
- fbGetCompositeClip(pGC),
- xBack,
- yBack,
- xBack + widthBack,
- yBack + heightBack,
- fbAnd(GXcopy,pPriv->bg,pPriv->pm),
- fbXor(GXcopy,pPriv->bg,pPriv->pm));
- opaque = FALSE;
- }
-
- ppci = ppciInit;
- while (nglyph--)
- {
- pci = *ppci++;
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
- gWidth = GLYPHWIDTHPIXELS(pci);
- gHeight = GLYPHHEIGHTPIXELS(pci);
- if (gWidth && gHeight)
- {
- gx = x + pci->metrics.leftSideBearing;
- gy = y - pci->metrics.ascent;
-#ifndef FBNOPIXADDR
- if (glyph && gWidth <= sizeof (FbStip) * 8 &&
- fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
- {
- (*glyph) (dst + (gy + dstYoff) * dstStride,
- dstStride,
- dstBpp,
- (FbStip *) pglyph,
- pPriv->fg,
- gx + dstXoff,
- gHeight);
- }
- else
-#endif
- {
- gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
- fbPutXYImage (pDrawable,
- fbGetCompositeClip(pGC),
- pPriv->fg,
- pPriv->bg,
- pPriv->pm,
- GXcopy,
- opaque,
-
- gx,
- gy,
- gWidth, gHeight,
-
- (FbStip *) pglyph,
- gStride,
- 0);
- }
- }
- x += pci->metrics.characterWidth;
- }
-}
diff --git a/miext/rootless/accel/rlSolid.c b/miext/rootless/accel/rlSolid.c
deleted file mode 100644
index e2249569b..000000000
--- a/miext/rootless/accel/rlSolid.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Accelerated rootless fill
- */
-/*
- * This code is largely copied from fbsolid.c.
- *
- * Copyright © 1998 Keith Packard
- * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/accel/rlSolid.c,v 1.1 2003/10/24 00:33:15 torrey Exp $ */
-
-#include "fb.h"
-#include "rootlessCommon.h"
-
-
-void
-rlSolid (ScreenPtr pScreen,
- FbBits *dst,
- FbStride dstStride,
- int dstX,
- int bpp,
-
- int width,
- int height,
-
- FbBits and,
- FbBits xor)
-{
- FbBits startmask, endmask;
- int n, nmiddle;
- int startbyte, endbyte;
-
-#ifdef FB_24BIT
- if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor)))
- {
- fbSolid24 (dst, dstStride, dstX, width, height, and, xor);
- return;
- }
-#endif
-
- dst += dstX >> FB_SHIFT;
- dstX &= FB_MASK;
- FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte,
- nmiddle, endmask, endbyte);
-
- /*
- * Beginning of the rootless acceleration code
- */
- if (!startmask && !endmask && !and &&
- height * nmiddle * sizeof (*dst) > rootless_FillBytes_threshold &&
- SCREENREC(pScreen)->imp->FillBytes)
- {
- if (bpp <= 8)
- xor |= xor << 8;
- if (bpp <= 16)
- xor |= xor << 16;
-
- SCREENREC(pScreen)->imp->FillBytes(nmiddle * sizeof (*dst), height,
- xor, (char *) dst + (dstX >> 3),
- dstStride * sizeof (*dst));
- return;
- }
- /* End of the rootless acceleration code */
-
- if (startmask)
- dstStride--;
- dstStride -= nmiddle;
- while (height--)
- {
- if (startmask)
- {
- FbDoLeftMaskByteRRop(dst,startbyte,startmask,and,xor);
- dst++;
- }
- n = nmiddle;
- if (!and)
- while (n--)
- *dst++ = xor;
- else
- while (n--)
- {
- *dst = FbDoRRop (*dst, and, xor);
- dst++;
- }
- if (endmask)
- FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
- dst += dstStride;
- }
-}
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
deleted file mode 100644
index 2b375706f..000000000
--- a/miext/rootless/rootless.h
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * External interface to generic rootless mode
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootless.h,v 1.6 2003/10/24 00:33:14 torrey Exp $ */
-
-#ifndef _ROOTLESS_H
-#define _ROOTLESS_H
-
-#include "rootlessConfig.h"
-#include "mi.h"
-#include "gcstruct.h"
-
-/*
- Each top-level rootless window has a one-to-one correspondence to a physical
- on-screen window. The physical window is refered to as a "frame".
- */
-
-typedef void * RootlessFrameID;
-
-/*
- * RootlessWindowRec
- * This structure stores the per-frame data used by the rootless code.
- * Each top-level X window has one RootlessWindowRec associated with it.
- */
-typedef struct _RootlessWindowRec {
- // Position and size includes the window border
- // Position is in per-screen coordinates
- int x, y;
- unsigned int width, height;
- unsigned int borderWidth;
-
- RootlessFrameID wid; // implementation specific frame id
- WindowPtr win; // underlying X window
-
- // Valid only when drawing (ie. is_drawing is set)
- char *pixelData;
- int bytesPerRow;
-
- PixmapPtr pixmap;
- PixmapPtr oldPixmap;
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- RegionRec damage;
-#endif
-
- unsigned int is_drawing :1; // Currently drawing?
- unsigned int is_reorder_pending :1;
-} RootlessWindowRec, *RootlessWindowPtr;
-
-
-/* Offset for screen-local to global coordinate transforms */
-#ifdef ROOTLESS_GLOBAL_COORDS
-extern int rootlessGlobalOffsetX;
-extern int rootlessGlobalOffsetY;
-#endif
-
-/* The minimum number of bytes or pixels for which to use the
- implementation's accelerated functions. */
-extern unsigned int rootless_CopyBytes_threshold;
-extern unsigned int rootless_FillBytes_threshold;
-extern unsigned int rootless_CompositePixels_threshold;
-extern unsigned int rootless_CopyWindow_threshold;
-
-/* Operations used by CompositePixels */
-enum rl_composite_op_enum {
- RL_COMPOSITE_SRC = 0,
- RL_COMPOSITE_OVER,
-};
-
-/* Data formats for depth field and composite functions */
-enum rl_depth_enum {
- RL_DEPTH_NIL = 0, /* null source when compositing */
- RL_DEPTH_ARGB8888,
- RL_DEPTH_RGB555,
- RL_DEPTH_A8, /* for masks when compositing */
- RL_DEPTH_INDEX8,
-};
-
-/* Macro to form the composite function for CompositePixels */
-#define RL_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
- (((op) << 24) | ((src_depth) << 16) \
- | ((mask_depth) << 8) | ((dest_depth) << 0))
-
-/* Gravity for window contents during resizing */
-enum rl_gravity_enum {
- RL_GRAVITY_NONE = 0, /* no gravity, fill everything */
- RL_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
- RL_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
- RL_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
- RL_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
-};
-
-
-/*------------------------------------------
- Rootless Implementation Functions
- ------------------------------------------*/
-
-/*
- * Create a new frame.
- * The frame is created unmapped.
- *
- * pFrame RootlessWindowPtr for this frame should be completely
- * initialized before calling except for pFrame->wid, which
- * is set by this function.
- * pScreen Screen on which to place the new frame
- * newX, newY Position of the frame. These will be identical to pFrame-x,
- * pFrame->y unless ROOTLESS_GLOBAL_COORDS is set.
- * pNewShape Shape for the frame (in frame-local coordinates). NULL for
- * unshaped frames.
- */
-typedef Bool (*RootlessCreateFrameProc)
- (RootlessWindowPtr pFrame, ScreenPtr pScreen, int newX, int newY,
- RegionPtr pNewShape);
-
-/*
- * Destroy a frame.
- * Drawing is stopped and all updates are flushed before this is called.
- *
- * wid Frame id
- */
-typedef void (*RootlessDestroyFrameProc)
- (RootlessFrameID wid);
-
-/*
- * Move a frame on screen.
- * Drawing is stopped and all updates are flushed before this is called.
- *
- * wid Frame id
- * pScreen Screen to move the new frame to
- * newX, newY New position of the frame
- */
-typedef void (*RootlessMoveFrameProc)
- (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY);
-
-/*
- * Resize and move a frame.
- * Drawing is stopped and all updates are flushed before this is called.
- *
- * wid Frame id
- * pScreen Screen to move the new frame to
- * newX, newY New position of the frame
- * newW, newH New size of the frame
- * gravity Gravity for window contents (rl_gravity_enum). This is always
- * RL_GRAVITY_NONE unless ROOTLESS_RESIZE_GRAVITY is set.
- */
-typedef void (*RootlessResizeFrameProc)
- (RootlessFrameID wid, ScreenPtr pScreen,
- int newX, int newY, unsigned int newW, unsigned int newH,
- unsigned int gravity);
-
-/*
- * Change frame ordering (AKA stacking, layering).
- * Drawing is stopped before this is called. Unmapped frames are mapped by
- * setting their ordering.
- *
- * wid Frame id
- * nextWid Frame id of frame that is now above this one or NULL if this
- * frame is at the top.
- */
-typedef void (*RootlessRestackFrameProc)
- (RootlessFrameID wid, RootlessFrameID nextWid);
-
-/*
- * Change frame's shape.
- * Drawing is stopped before this is called.
- *
- * wid Frame id
- * pNewShape New shape for the frame (in frame-local coordinates)
- * or NULL if now unshaped.
- */
-typedef void (*RootlessReshapeFrameProc)
- (RootlessFrameID wid, RegionPtr pNewShape);
-
-/*
- * Unmap a frame.
- *
- * wid Frame id
- */
-typedef void (*RootlessUnmapFrameProc)
- (RootlessFrameID wid);
-
-/*
- * Start drawing to a frame.
- * Prepare a frame for direct access to its backing buffer.
- *
- * wid Frame id
- * pixelData Address of the backing buffer (returned)
- * bytesPerRow Width in bytes of the backing buffer (returned)
- */
-typedef void (*RootlessStartDrawingProc)
- (RootlessFrameID wid, char **pixelData, int *bytesPerRow);
-
-/*
- * Stop drawing to a frame.
- * No drawing to the frame's backing buffer will occur until drawing
- * is started again.
- *
- * wid Frame id
- * flush Flush drawing updates for this frame to the screen. This
- * will always be FALSE if ROOTLESS_TRACK_DAMAGE is set.
- */
-typedef void (*RootlessStopDrawingProc)
- (RootlessFrameID wid, Bool flush);
-
-/*
- * Flush drawing updates to the screen.
- * Drawing is stopped before this is called.
- *
- * wid Frame id
- * pDamage Region containing all the changed pixels in frame-lcoal
- * coordinates. This is clipped to the window's clip. This
- * will be NULL if ROOTLESS_TRACK_DAMAGE is not set.
- */
-typedef void (*RootlessUpdateRegionProc)
- (RootlessFrameID wid, RegionPtr pDamage);
-
-/*
- * Mark damaged rectangles as requiring redisplay to screen.
- * This will only be called if ROOTLESS_TRACK_DAMAGE is not set.
- *
- * wid Frame id
- * nrects Number of damaged rectangles
- * rects Array of damaged rectangles in frame-local coordinates
- * shift_x, Vector to shift rectangles by
- * shift_y
- */
-typedef void (*RootlessDamageRectsProc)
- (RootlessFrameID wid, int nrects, const BoxRec *rects,
- int shift_x, int shift_y);
-
-/*
- * Switch the window associated with a frame. (Optional)
- * When a framed window is reparented, the frame is resized and set to
- * use the new top-level parent. If defined this function will be called
- * afterwards for implementation specific bookkeeping.
- *
- * pFrame Frame whose window has switched
- * oldWin Previous window wrapped by this frame
- */
-typedef void (*RootlessSwitchWindowProc)
- (RootlessWindowPtr pFrame, WindowPtr oldWin);
-
-/*
- * Copy bytes. (Optional)
- * Source and destinate may overlap and the right thing should happen.
- *
- * width Bytes to copy per row
- * height Number of rows
- * src Source data
- * srcRowBytes Width of source in bytes
- * dst Destination data
- * dstRowBytes Width of destination in bytes
- */
-typedef void (*RootlessCopyBytesProc)
- (unsigned int width, unsigned int height,
- const void *src, unsigned int srcRowBytes,
- void *dst, unsigned int dstRowBytes);
-
-/*
- * Fill memory with 32-bit pattern. (Optional)
- *
- * width Bytes to fill per row
- * height Number of rows
- * value 32-bit pattern to fill with
- * dst Destination data
- * dstRowBytes Width of destination in bytes
- */
-typedef void (*RootlessFillBytesProc)
- (unsigned int width, unsigned int height, unsigned int value,
- void *dst, unsigned int dstRowBytes);
-
-/*
- * Composite pixels from source and mask to destination. (Optional)
- *
- * width, height Size of area to composite to in pizels
- * function Composite function built with RL_COMPOSITE_FUNCTION
- * src Source data
- * srcRowBytes Width of source in bytes (Passing NULL means source
- * is a single pixel.
- * mask Mask data
- * maskRowBytes Width of mask in bytes
- * dst Destination data
- * dstRowBytes Width of destination in bytes
- *
- * For src and dst, the first element of the array is the color data. If
- * the second element is non-null it implies there is alpha data (which
- * may be meshed or planar). Data without alpha is assumed to be opaque.
- *
- * An X11 error code is returned.
- */
-typedef int (*RootlessCompositePixelsProc)
- (unsigned int width, unsigned int height, unsigned int function,
- void *src[2], unsigned int srcRowBytes[2],
- void *mask, unsigned int maskRowBytes,
- void *dst[2], unsigned int dstRowBytes[2]);
-
-/*
- * Copy area in frame to another part of frame. (Optional)
- *
- * wid Frame id
- * dstNrects Number of rectangles to copy
- * dstRects Array of rectangles to copy
- * dx, dy Number of pixels away to copy area
- */
-typedef void (*RootlessCopyWindowProc)
- (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
- int dx, int dy);
-
-/*
- * Rootless implementation function list
- */
-typedef struct _RootlessFrameProcs {
- RootlessCreateFrameProc CreateFrame;
- RootlessDestroyFrameProc DestroyFrame;
-
- RootlessMoveFrameProc MoveFrame;
- RootlessResizeFrameProc ResizeFrame;
- RootlessRestackFrameProc RestackFrame;
- RootlessReshapeFrameProc ReshapeFrame;
- RootlessUnmapFrameProc UnmapFrame;
-
- RootlessStartDrawingProc StartDrawing;
- RootlessStopDrawingProc StopDrawing;
- RootlessUpdateRegionProc UpdateRegion;
-#ifndef ROOTLESS_TRACK_DAMAGE
- RootlessDamageRectsProc DamageRects;
-#endif
-
- /* Optional frame functions */
- RootlessSwitchWindowProc SwitchWindow;
-
- /* Optional acceleration functions */
- RootlessCopyBytesProc CopyBytes;
- RootlessFillBytesProc FillBytes;
- RootlessCompositePixelsProc CompositePixels;
- RootlessCopyWindowProc CopyWindow;
-} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
-
-
-/*
- * Initialize rootless mode on the given screen.
- */
-Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
-
-/*
- * Return the frame ID for the physical window displaying the given window.
- *
- * create If true and the window has no frame, attempt to create one
- */
-RootlessFrameID RootlessFrameForWindow(WindowPtr pWin, Bool create);
-
-/*
- * Return the top-level parent of a window.
- * The root is the top-level parent of itself, even though the root is
- * not otherwise considered to be a top-level window.
- */
-WindowPtr TopLevelParent(WindowPtr pWindow);
-
-/*
- * Prepare a window for direct access to its backing buffer.
- */
-void RootlessStartDrawing(WindowPtr pWindow);
-
-/*
- * Finish drawing to a window's backing buffer.
- *
- * flush If true and ROOTLESS_TRACK_DAMAGE is set, damaged areas
- * are flushed to the screen.
- */
-void RootlessStopDrawing(WindowPtr pWindow, Bool flush);
-
-
-#endif /* _ROOTLESS_H */
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
deleted file mode 100644
index bc6259ea6..000000000
--- a/miext/rootless/rootlessCommon.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Common rootless definitions and code
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessCommon.c,v 1.5 2003/11/10 18:22:50 tsi Exp $ */
-
-#include "rootlessCommon.h"
-
-unsigned int rootless_CopyBytes_threshold = 0;
-unsigned int rootless_FillBytes_threshold = 0;
-unsigned int rootless_CompositePixels_threshold = 0;
-unsigned int rootless_CopyWindow_threshold = 0;
-#ifdef ROOTLESS_GLOBAL_COORDS
-int rootlessGlobalOffsetX = 0;
-int rootlessGlobalOffsetY = 0;
-#endif
-
-RegionRec rootlessHugeRoot = {{-32767, -32767, 32767, 32767}, NULL};
-
-/* Following macro from miregion.c */
-
-/* true iff two Boxes overlap */
-#define EXTENTCHECK(r1,r2) \
- (!( ((r1)->x2 <= (r2)->x1) || \
- ((r1)->x1 >= (r2)->x2) || \
- ((r1)->y2 <= (r2)->y1) || \
- ((r1)->y1 >= (r2)->y2) ) )
-
-
-/*
- * TopLevelParent
- * Returns the top-level parent of pWindow.
- * The root is the top-level parent of itself, even though the root is
- * not otherwise considered to be a top-level window.
- */
-WindowPtr
-TopLevelParent(WindowPtr pWindow)
-{
- WindowPtr top;
-
- if (IsRoot(pWindow))
- return pWindow;
-
- top = pWindow;
- while (top && ! IsTopLevel(top))
- top = top->parent;
-
- return top;
-}
-
-
-/*
- * IsFramedWindow
- * Returns TRUE if this window is visible inside a frame
- * (e.g. it is visible and has a top-level or root parent)
- */
-Bool
-IsFramedWindow(WindowPtr pWin)
-{
- WindowPtr top;
-
- if (!pWin->realized)
- return FALSE;
- top = TopLevelParent(pWin);
-
- return (top && WINREC(top));
-}
-
-
-/*
- * RootlessStartDrawing
- * Prepare a window for direct access to its backing buffer.
- * Each top-level parent has a Pixmap representing its backing buffer,
- * which all of its children inherit.
- */
-void RootlessStartDrawing(WindowPtr pWindow)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- WindowPtr top = TopLevelParent(pWindow);
- RootlessWindowRec *winRec;
-
- if (top == NULL)
- return;
- winRec = WINREC(top);
- if (winRec == NULL)
- return;
-
- // Make sure the window's top-level parent is prepared for drawing.
- if (!winRec->is_drawing) {
- int bw = wBorderWidth(top);
-
- SCREENREC(pScreen)->imp->StartDrawing(winRec->wid, &winRec->pixelData,
- &winRec->bytesPerRow);
-
- winRec->pixmap =
- GetScratchPixmapHeader(pScreen, winRec->width, winRec->height,
- top->drawable.depth,
- top->drawable.bitsPerPixel,
- winRec->bytesPerRow,
- winRec->pixelData);
- SetPixmapBaseToScreen(winRec->pixmap,
- top->drawable.x - bw, top->drawable.y - bw);
-
- winRec->is_drawing = TRUE;
- }
-
- winRec->oldPixmap = pScreen->GetWindowPixmap(pWindow);
- pScreen->SetWindowPixmap(pWindow, winRec->pixmap);
-}
-
-
-/*
- * RootlessStopDrawing
- * Stop drawing to a window's backing buffer. If flush is true,
- * damaged regions are flushed to the screen.
- */
-void RootlessStopDrawing(WindowPtr pWindow, Bool flush)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- WindowPtr top = TopLevelParent(pWindow);
- RootlessWindowRec *winRec;
-
- if (top == NULL)
- return;
- winRec = WINREC(top);
- if (winRec == NULL)
- return;
-
- if (winRec->is_drawing) {
- SCREENREC(pScreen)->imp->StopDrawing(winRec->wid, flush);
-
- FreeScratchPixmapHeader(winRec->pixmap);
- pScreen->SetWindowPixmap(pWindow, winRec->oldPixmap);
- winRec->pixmap = NULL;
-
- winRec->is_drawing = FALSE;
- }
- else if (flush) {
- SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, NULL);
- }
-
- if (flush && winRec->is_reorder_pending) {
- winRec->is_reorder_pending = FALSE;
- RootlessReorderWindow(pWindow);
- }
-}
-
-
-/*
- * RootlessDamageRegion
- * Mark a damaged region as requiring redisplay to screen.
- * pRegion is in GLOBAL coordinates.
- */
-void
-RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- RootlessWindowRec *winRec;
- RegionRec clipped;
- WindowPtr pTop;
- BoxPtr b1, b2;
-
- RL_DEBUG_MSG("Damaged win 0x%x ", pWindow);
-
- pTop = TopLevelParent(pWindow);
- if (pTop == NULL)
- return;
-
- winRec = WINREC(pTop);
- if (winRec == NULL)
- return;
-
- /* We need to intersect the drawn region with the clip of the window
- to avoid marking places we didn't actually draw (which can cause
- problems when the window has an extra client-side backing store)
-
- But this is a costly operation and since we'll normally just be
- drawing inside the clip, go to some lengths to avoid the general
- case intersection. */
-
- b1 = REGION_EXTENTS(pScreen, &pWindow->borderClip);
- b2 = REGION_EXTENTS(pScreen, pRegion);
-
- if (EXTENTCHECK(b1, b2)) {
- /* Regions may overlap. */
-
- if (REGION_NUM_RECTS(pRegion) == 1) {
- int in;
-
- /* Damaged region only has a single rect, so we can
- just compare that against the region */
-
- in = RECT_IN_REGION(pScreen, &pWindow->borderClip,
- REGION_RECTS (pRegion));
- if (in == rgnIN) {
- /* clip totally contains pRegion */
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_UNION(pScreen, &winRec->damage,
- &winRec->damage, (pRegion));
-#else
- SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
- REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
- -winRec->x, -winRec->y);
-#endif
-
- RootlessQueueRedisplay(pTop->drawable.pScreen);
- goto out;
- }
- else if (in == rgnOUT) {
- /* clip doesn't contain pRegion */
-
- goto out;
- }
- }
-
- /* clip overlaps pRegion, need to intersect */
-
- REGION_NULL(pScreen, &clipped);
- REGION_INTERSECT(pScreen, &clipped, &pWindow->borderClip, pRegion);
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_UNION(pScreen, &winRec->damage,
- &winRec->damage, (pRegion));
-#else
- SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
- REGION_NUM_RECTS(&clipped),
- REGION_RECTS(&clipped),
- -winRec->x, -winRec->y);
-#endif
-
- REGION_UNINIT(pScreen, &clipped);
-
- RootlessQueueRedisplay(pTop->drawable.pScreen);
- }
-
-out:
-#ifdef ROOTLESSDEBUG
- {
- BoxRec *box = REGION_RECTS(pRegion), *end;
- int numBox = REGION_NUM_RECTS(pRegion);
-
- for (end = box+numBox; box < end; box++) {
- RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n",
- box->x1, box->x2, box->y1, box->y2);
- }
- }
-#endif
- return;
-}
-
-
-/*
- * RootlessDamageBox
- * Mark a damaged box as requiring redisplay to screen.
- * pRegion is in GLOBAL coordinates.
- */
-void
-RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox)
-{
- RegionRec region;
-
- REGION_INIT(pWindow->drawable.pScreen, &region, pBox, 1);
-
- RootlessDamageRegion(pWindow, &region);
-
- REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
-}
-
-
-/*
- * RootlessDamageRect
- * Mark a damaged rectangle as requiring redisplay to screen.
- * (x, y, w, h) is in window-local coordinates.
- */
-void
-RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h)
-{
- BoxRec box;
- RegionRec region;
-
- x += pWindow->drawable.x;
- y += pWindow->drawable.y;
-
- box.x1 = x;
- box.x2 = x + w;
- box.y1 = y;
- box.y2 = y + h;
-
- REGION_INIT(pWindow->drawable.pScreen, &region, &box, 1);
-
- RootlessDamageRegion(pWindow, &region);
-
- REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
-}
-
-
-/*
- * RootlessRedisplay
- * Stop drawing and redisplay the damaged region of a window.
- */
-void
-RootlessRedisplay(WindowPtr pWindow)
-{
-#ifdef ROOTLESS_TRACK_DAMAGE
-
- RootlessWindowRec *winRec = WINREC(pWindow);
- ScreenPtr pScreen = pWindow->drawable.pScreen;
-
- RootlessStopDrawing(pWindow, FALSE);
-
- if (REGION_NOTEMPTY(pScreen, &winRec->damage)) {
- RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n",
- pWindow, winRec->width, winRec->height,
- winRec->x, winRec->y);
-
- // move region to window local coords
- REGION_TRANSLATE(pScreen, &winRec->damage,
- -winRec->x, -winRec->y);
-
- SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, &winRec->damage);
-
- REGION_EMPTY(pScreen, &winRec->damage);
- }
-
-#else /* !ROOTLESS_TRACK_DAMAGE */
-
- RootlessStopDrawing(pWindow, TRUE);
-
-#endif
-}
-
-
-/*
- * RootlessRedisplayScreen
- * Walk every window on a screen and redisplay the damaged regions.
- */
-void
-RootlessRedisplayScreen(ScreenPtr pScreen)
-{
- WindowPtr root = WindowTable[pScreen->myNum];
-
- if (root != NULL) {
- WindowPtr win;
-
- RootlessRedisplay(root);
- for (win = root->firstChild; win; win = win->nextSib) {
- if (WINREC(win) != NULL) {
- RootlessRedisplay(win);
- }
- }
- }
-}
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
deleted file mode 100644
index 973ec6291..000000000
--- a/miext/rootless/rootlessCommon.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Common internal rootless definitions and code
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessCommon.h,v 1.4 2003/09/16 00:36:20 torrey Exp $ */
-
-#ifndef _ROOTLESSCOMMON_H
-#define _ROOTLESSCOMMON_H
-
-#include "rootless.h"
-#include "fb.h"
-
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-
-// Debug output, or not.
-#ifdef ROOTLESSDEBUG
-#define RL_DEBUG_MSG ErrorF
-#else
-#define RL_DEBUG_MSG(a, ...)
-#endif
-
-
-// Global variables
-extern int rootlessGCPrivateIndex;
-extern int rootlessScreenPrivateIndex;
-extern int rootlessWindowPrivateIndex;
-
-
-// RootlessGCRec: private per-gc data
-typedef struct {
- GCFuncs *originalFuncs;
- GCOps *originalOps;
-} RootlessGCRec;
-
-
-// RootlessScreenRec: per-screen private data
-typedef struct _RootlessScreenRec {
- // Rootless implementation functions
- RootlessFrameProcsPtr imp;
-
- // Wrapped screen functions
- CreateScreenResourcesProcPtr CreateScreenResources;
- CloseScreenProcPtr CloseScreen;
-
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- MoveWindowProcPtr MoveWindow;
- ResizeWindowProcPtr ResizeWindow;
- RestackWindowProcPtr RestackWindow;
- ReparentWindowProcPtr ReparentWindow;
- ChangeBorderWidthProcPtr ChangeBorderWidth;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
-
- CreateGCProcPtr CreateGC;
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- GetImageProcPtr GetImage;
- SourceValidateProcPtr SourceValidate;
-
- MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
- ValidateTreeProcPtr ValidateTree;
-
-#ifdef SHAPE
- SetShapeProcPtr SetShape;
-#endif
-
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
-
- void *pixmap_data;
- unsigned int pixmap_data_size;
-
- void *redisplay_timer;
- unsigned int redisplay_timer_set :1;
- unsigned int redisplay_queued :1;
- unsigned int redisplay_expired :1;
-} RootlessScreenRec, *RootlessScreenPtr;
-
-
-#undef MIN
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#undef MAX
-#define MAX(x,y) ((x) > (y) ? (x) : (y))
-
-// "Definition of the Porting Layer for the X11 Sample Server" says
-// unwrap and rewrap of screen functions is unnecessary, but
-// screen->CreateGC changes after a call to cfbCreateGC.
-
-#define SCREEN_UNWRAP(screen, fn) \
- screen->fn = SCREENREC(screen)->fn;
-
-#define SCREEN_WRAP(screen, fn) \
- SCREENREC(screen)->fn = screen->fn; \
- screen->fn = Rootless##fn
-
-
-// Accessors for screen and window privates
-
-#define SCREENREC(pScreen) \
- ((RootlessScreenRec *)(pScreen)->devPrivates[rootlessScreenPrivateIndex].ptr)
-
-#define WINREC(pWin) \
- ((RootlessWindowRec *)(pWin)->devPrivates[rootlessWindowPrivateIndex].ptr)
-
-
-// Call a rootless implementation function.
-// Many rootless implementation functions are allowed to be NULL.
-#define CallFrameProc(pScreen, proc, params) \
- if (SCREENREC(pScreen)->frameProcs.proc) { \
- RL_DEBUG_MSG("calling frame proc " #proc " "); \
- SCREENREC(pScreen)->frameProcs.proc params; \
- }
-
-
-// BoxRec manipulators
-// Copied from shadowfb
-
-#define TRIM_BOX(box, pGC) { \
- BoxPtr extents = &pGC->pCompositeClip->extents;\
- if(box.x1 < extents->x1) box.x1 = extents->x1; \
- if(box.x2 > extents->x2) box.x2 = extents->x2; \
- if(box.y1 < extents->y1) box.y1 = extents->y1; \
- if(box.y2 > extents->y2) box.y2 = extents->y2; \
-}
-
-#define TRANSLATE_BOX(box, pDraw) { \
- box.x1 += pDraw->x; \
- box.x2 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.y2 += pDraw->y; \
-}
-
-#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
- TRANSLATE_BOX(box, pDraw); \
- TRIM_BOX(box, pGC); \
-}
-
-#define BOX_NOT_EMPTY(box) \
- (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
-
-
-// HUGE_ROOT and NORMAL_ROOT
-// We don't want to clip windows to the edge of the screen.
-// HUGE_ROOT temporarily makes the root window really big.
-// This is needed as a wrapper around any function that calls
-// SetWinSize or SetBorderSize which clip a window against its
-// parents, including the root.
-
-extern RegionRec rootlessHugeRoot;
-
-#define HUGE_ROOT(pWin) \
- do { \
- WindowPtr w = pWin; \
- while (w->parent) \
- w = w->parent; \
- saveRoot = w->winSize; \
- w->winSize = rootlessHugeRoot; \
- } while (0)
-
-#define NORMAL_ROOT(pWin) \
- do { \
- WindowPtr w = pWin; \
- while (w->parent) \
- w = w->parent; \
- w->winSize = saveRoot; \
- } while (0)
-
-
-// Returns TRUE if this window is a top-level window (i.e. child of the root)
-// The root is not a top-level window.
-#define IsTopLevel(pWin) \
- ((pWin) && (pWin)->parent && !(pWin)->parent->parent)
-
-// Returns TRUE if this window is a root window
-#define IsRoot(pWin) \
- ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum])
-
-
-/*
- * SetPixmapBaseToScreen
- * Move the given pixmap's base address to where pixel (0, 0)
- * would be if the pixmap's actual data started at (x, y).
- * Can't access the bits before the first word of the drawable's data in
- * rootless mode, so make sure our base address is always 32-bit aligned.
- */
-#define SetPixmapBaseToScreen(pix, _x, _y) { \
- PixmapPtr _pPix = (PixmapPtr) (pix); \
- _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \
- ((int)(_x) * _pPix->drawable.bitsPerPixel/8 + \
- (int)(_y) * _pPix->devKind); \
- if (_pPix->drawable.bitsPerPixel != FB_UNIT) { \
- unsigned _diff = ((unsigned) _pPix->devPrivate.ptr) & \
- (FB_UNIT / CHAR_BIT - 1); \
- _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \
- _diff; \
- _pPix->drawable.x = _diff / \
- (_pPix->drawable.bitsPerPixel / CHAR_BIT); \
- } \
-}
-
-
-// Returns TRUE if this window is visible inside a frame
-// (e.g. it is visible and has a top-level or root parent)
-Bool IsFramedWindow(WindowPtr pWin);
-
-// Routines that cause regions to get redrawn.
-// DamageRegion and DamageRect are in global coordinates.
-// DamageBox is in window-local coordinates.
-void RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion);
-void RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h);
-void RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox);
-void RootlessRedisplay(WindowPtr pWindow);
-void RootlessRedisplayScreen(ScreenPtr pScreen);
-
-void RootlessQueueRedisplay (ScreenPtr pScreen);
-
-// Move the window to it's correct place in the physical stacking order.
-void RootlessReorderWindow (WindowPtr pWin);
-
-#endif /* _ROOTLESSCOMMON_H */
diff --git a/miext/rootless/rootlessConfig.h b/miext/rootless/rootlessConfig.h
deleted file mode 100644
index 1a1a48a4a..000000000
--- a/miext/rootless/rootlessConfig.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Platform specific rootless configuration
- */
-/*
- * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessConfig.h,v 1.2 2003/10/24 00:33:14 torrey Exp $ */
-
-#ifndef _ROOTLESSCONFIG_H
-#define _ROOTLESSCONFIG_H
-
-#ifdef __DARWIN__
-
-# define ROOTLESS_ACCEL TRUE
-# define ROOTLESS_GLOBAL_COORDS TRUE
-# define ROOTLESS_PROTECT_ALPHA TRUE
-# define ROOTLESS_REDISPLAY_DELAY 10
-# define ROOTLESS_RESIZE_GRAVITY TRUE
-# undef ROOTLESS_TRACK_DAMAGE
-
-/* Bit mask for alpha channel with a particular number of bits per
- pixel. Note that we only care for 32bpp data. Mac OS X uses planar
- alpha for 16bpp. */
-# define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-
-#endif /* __DARWIN__ */
-
-#endif /* _ROOTLESSCONFIG_H */
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
deleted file mode 100644
index 8c70135a1..000000000
--- a/miext/rootless/rootlessGC.c
+++ /dev/null
@@ -1,1515 +0,0 @@
-/*
- * Graphics Context support for generic rootless X server
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessGC.c,v 1.2 2003/10/24 00:33:14 torrey Exp $ */
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "dixfontstr.h"
-#include "mivalidate.h"
-#include "fb.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "rootlessCommon.h"
-
-#if ROOTLESS_ACCEL
-#include "rlAccel.h"
-#endif
-
-
-// GC functions
-static void RootlessValidateGC(GCPtr pGC, unsigned long changes,
- DrawablePtr pDrawable);
-static void RootlessChangeGC(GCPtr pGC, unsigned long mask);
-static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void RootlessDestroyGC(GCPtr pGC);
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue,
- int nrects);
-static void RootlessDestroyClip(GCPtr pGC);
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-GCFuncs rootlessGCFuncs = {
- RootlessValidateGC,
- RootlessChangeGC,
- RootlessCopyGC,
- RootlessDestroyGC,
- RootlessChangeClip,
- RootlessDestroyClip,
- RootlessCopyClip,
-};
-
-// GC operations
-static void RootlessFillSpans();
-static void RootlessSetSpans();
-static void RootlessPutImage();
-static RegionPtr RootlessCopyArea();
-static RegionPtr RootlessCopyPlane();
-static void RootlessPolyPoint();
-static void RootlessPolylines();
-static void RootlessPolySegment();
-static void RootlessPolyRectangle();
-static void RootlessPolyArc();
-static void RootlessFillPolygon();
-static void RootlessPolyFillRect();
-static void RootlessPolyFillArc();
-static int RootlessPolyText8();
-static int RootlessPolyText16();
-static void RootlessImageText8();
-static void RootlessImageText16();
-static void RootlessImageGlyphBlt();
-static void RootlessPolyGlyphBlt();
-static void RootlessPushPixels();
-
-static GCOps rootlessGCOps = {
- RootlessFillSpans,
- RootlessSetSpans,
- RootlessPutImage,
- RootlessCopyArea,
- RootlessCopyPlane,
- RootlessPolyPoint,
- RootlessPolylines,
- RootlessPolySegment,
- RootlessPolyRectangle,
- RootlessPolyArc,
- RootlessFillPolygon,
- RootlessPolyFillRect,
- RootlessPolyFillArc,
- RootlessPolyText8,
- RootlessPolyText16,
- RootlessImageText8,
- RootlessImageText16,
- RootlessImageGlyphBlt,
- RootlessPolyGlyphBlt,
- RootlessPushPixels
-#ifdef NEED_LINEHELPER
- , NULL
-#endif
-};
-
-/*
- There are two issues we must contend with when drawing. These are
- controlled with ROOTLESS_PROTECT_ALPHA and ROOTLESS_ACCEL.
-
- If ROOTLESS_PROTECT_ALPHA is set, we have to make sure that the alpha
- channel of the on screen windows is always opaque. fb makes this harder
- than it would otherwise be by noticing that a planemask of 0x00ffffff
- includes all bits when depth==24, and so it "optimizes" the planemask to
- 0xffffffff. We work around this by temporarily setting depth=bpp while
- changing the GC.
-
- So the normal situation (in 32 bit mode) is that the planemask is
- 0x00ffffff and thus fb leaves the alpha channel alone. The rootless
- implementation is responsible for setting the alpha channel opaque
- initially.
-
- Unfortunately drawing with a planemask that doesn't have all bits set
- normally causes fb to fall off its fastest paths when blitting and
- filling. So we try to recognize when we can relax the planemask back to
- 0xffffffff, and do that for the duration of the drawing operation,
- setting the alpha channel in fg/bg pixels to opaque at the same time. We
- can do this when drawing op is GXcopy. We can also do this when copying
- from another window since its alpha channel must also be opaque.
-
- The other issue to consider is that the rootless implementation may
- provide accelerated drawing functions if ROOTLESS_ACCEL is set. For some
- drawing primitives we swap in rootless acceleration functions, which use
- the accelerated drawing functions where possible.
-
- Where both alpha protection and acceleration is used, it is even a bigger
- win to relax the planemask to all ones because most accelerated drawing
- functions can only be used in this case. However, even if we can't set
- the planemask to all ones, we can still use the accelerated
- CompositePixels function for GXcopy if it is a forward copy. This is
- mainly intended for copying from pixmaps to windows. The CompositePixels
- operation used sets alpha to 0xFF during the copy.
-
- The three macros below are used to implement this, potentially accelerated
- drawing ops look something like this:
-
- OP {
- GC_SAVE(gc);
- GCOP_UNWRAP(gc);
-
- ...
-
- if (can_accel_xxx(..) && otherwise-suitable)
- GC_UNSET_PM(gc, dst);
-
- gc->funcs->OP(gc, ...);
-
- GC_RESTORE(gc, dst);
- GCOP_WRAP(gc);
- }
-
- */
-
-#define GC_SAVE(pGC) \
- unsigned long _save_fg = (pGC)->fgPixel; \
- unsigned long _save_bg = (pGC)->bgPixel; \
- unsigned long _save_pm = (pGC)->planemask; \
- Bool _changed = FALSE
-
-#define GC_RESTORE(pGC, pDraw) \
- do { \
- if (_changed) { \
- unsigned int depth = (pDraw)->depth; \
- (pGC)->fgPixel = _save_fg; \
- (pGC)->bgPixel = _save_bg; \
- (pGC)->planemask = _save_pm; \
- (pDraw)->depth = (pDraw)->bitsPerPixel; \
- VALIDATE_GC(pGC, GCForeground | GCBackground | \
- GCPlaneMask, pDraw); \
- (pDraw)->depth = depth; \
- } \
- } while (0)
-
-#define GC_UNSET_PM(pGC, pDraw) \
- do { \
- unsigned int mask = RootlessAlphaMask ((pDraw)->bitsPerPixel); \
- if (((pGC)->planemask & mask) != mask) { \
- unsigned int depth = (pDraw)->depth; \
- (pGC)->fgPixel |= mask; \
- (pGC)->bgPixel |= mask; \
- (pGC)->planemask |= mask; \
- (pDraw)->depth = (pDraw)->bitsPerPixel; \
- VALIDATE_GC(pGC, GCForeground | \
- GCBackground | GCPlaneMask, pDraw); \
- (pDraw)->depth = depth; \
- _changed = TRUE; \
- } \
- } while (0)
-
-#define VALIDATE_GC(pGC, changes, pDrawable) \
- do { \
- pGC->funcs->ValidateGC(pGC, changes, pDrawable); \
- if (((WindowPtr) pDrawable)->viewable) { \
- gcrec->originalOps = pGC->ops; \
- } \
- } while(0)
-
-static RootlessWindowRec *
-canAccelBlit (DrawablePtr pDraw, GCPtr pGC)
-{
- WindowPtr pTop;
- RootlessWindowRec *winRec;
- unsigned int pm;
-
- if (pGC->alu != GXcopy)
- return NULL;
-
- if (pDraw->type != DRAWABLE_WINDOW)
- return NULL;
-
- pm = ~RootlessAlphaMask(pDraw->bitsPerPixel);
- if ((pGC->planemask & pm) != pm)
- return NULL;
-
- pTop = TopLevelParent((WindowPtr) pDraw);
- if (pTop == NULL)
- return NULL;
-
- winRec = WINREC(pTop);
- if (winRec == NULL)
- return NULL;
-
- return winRec;
-}
-
-static inline RootlessWindowRec *
-canAccelFill(DrawablePtr pDraw, GCPtr pGC)
-{
- if (pGC->fillStyle != FillSolid)
- return NULL;
-
- return canAccelBlit(pDraw, pGC);
-}
-
-static unsigned int
-boxBytes(DrawablePtr pDraw, BoxRec *box)
-{
- unsigned int pixels;
-
- pixels = (box->x2 - box->x1) * (box->y2 - box->y1);
-
- return pixels * (pDraw->bitsPerPixel >> 3);
-}
-
-
-/*
- * Screen function to create a graphics context
- */
-Bool
-RootlessCreateGC(GCPtr pGC)
-{
- RootlessGCRec *gcrec;
- RootlessScreenRec *s;
- Bool result;
-
- SCREEN_UNWRAP(pGC->pScreen, CreateGC);
- s = (RootlessScreenRec *) pGC->pScreen->
- devPrivates[rootlessScreenPrivateIndex].ptr;
- result = s->CreateGC(pGC);
-
-#if ROOTLESS_ACCEL
- pGC->ops->FillSpans = rlFillSpans;
- pGC->ops->CopyArea = rlCopyArea;
- pGC->ops->PolyFillRect = rlPolyFillRect;
- pGC->ops->ImageGlyphBlt = rlImageGlyphBlt;
-#endif
-
- gcrec = (RootlessGCRec *) pGC->devPrivates[rootlessGCPrivateIndex].ptr;
- gcrec->originalOps = NULL; // don't wrap ops yet
- gcrec->originalFuncs = pGC->funcs;
- pGC->funcs = &rootlessGCFuncs;
-
- SCREEN_WRAP(pGC->pScreen, CreateGC);
- return result;
-}
-
-
-/*
- * GC funcs
- *
- * These wrap lower level GC funcs.
- * ValidateGC wraps the GC ops iff dest is viewable.
- * All the others just unwrap and call.
- */
-
-// GCFUNC_UNRAP assumes funcs have been wrapped and
-// does not assume ops have been wrapped
-#define GCFUNC_UNWRAP(pGC) \
- RootlessGCRec *gcrec = (RootlessGCRec *) \
- (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \
- (pGC)->funcs = gcrec->originalFuncs; \
- if (gcrec->originalOps) { \
- (pGC)->ops = gcrec->originalOps; \
-}
-
-#define GCFUNC_WRAP(pGC) \
- gcrec->originalFuncs = (pGC)->funcs; \
- (pGC)->funcs = &rootlessGCFuncs; \
- if (gcrec->originalOps) { \
- gcrec->originalOps = (pGC)->ops; \
- (pGC)->ops = &rootlessGCOps; \
-}
-
-
-static void
-RootlessValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
- GCFUNC_UNWRAP(pGC);
-
- gcrec->originalOps = NULL;
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
-#ifdef ROOTLESS_PROTECT_ALPHA
- unsigned int depth = pDrawable->depth;
-
- // We force a planemask so fb doesn't overwrite the alpha channel.
- // Left to its own devices, fb will optimize away the planemask.
- pDrawable->depth = pDrawable->bitsPerPixel;
- pGC->planemask &= ~RootlessAlphaMask(pDrawable->bitsPerPixel);
- VALIDATE_GC(pGC, changes | GCPlaneMask, pDrawable);
- pDrawable->depth = depth;
-#else
- VALIDATE_GC(pGC, changes, pDrawable);
-#endif
- } else {
- pGC->funcs->ValidateGC(pGC, changes, pDrawable);
- }
-
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessChangeGC(GCPtr pGC, unsigned long mask)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->ChangeGC(pGC, mask);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
- GCFUNC_UNWRAP(pGCDst);
- pGCDst->funcs->CopyGC(pGCSrc, mask, pGCDst);
- GCFUNC_WRAP(pGCDst);
-}
-
-static void RootlessDestroyGC(GCPtr pGC)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->DestroyGC(pGC);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->ChangeClip(pGC, type, pvalue, nrects);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessDestroyClip(GCPtr pGC)
-{
- GCFUNC_UNWRAP(pGC);
- pGC->funcs->DestroyClip(pGC);
- GCFUNC_WRAP(pGC);
-}
-
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- GCFUNC_UNWRAP(pgcDst);
- pgcDst->funcs->CopyClip(pgcDst, pgcSrc);
- GCFUNC_WRAP(pgcDst);
-}
-
-
-/*
- * GC ops
- *
- * We can't use shadowfb because shadowfb assumes one pixmap
- * and our root window is a special case.
- * However, much of this code is copied from shadowfb.
- */
-
-// assumes both funcs and ops are wrapped
-#define GCOP_UNWRAP(pGC) \
- RootlessGCRec *gcrec = (RootlessGCRec *) \
- (pGC)->devPrivates[rootlessGCPrivateIndex].ptr; \
- GCFuncs *saveFuncs = pGC->funcs; \
- (pGC)->funcs = gcrec->originalFuncs; \
- (pGC)->ops = gcrec->originalOps;
-
-#define GCOP_WRAP(pGC) \
- gcrec->originalOps = (pGC)->ops; \
- (pGC)->funcs = saveFuncs; \
- (pGC)->ops = &rootlessGCOps;
-
-/* Turn drawing on the root into a no-op */
-#define GC_IS_ROOT(pDst) ((pDst)->type == DRAWABLE_WINDOW \
- && IsRoot ((WindowPtr) (pDst)))
-
-#define GC_SKIP_ROOT(pDst) \
- do { \
- if (GC_IS_ROOT (pDst)) \
- return; \
- } while (0)
-
-
-static void
-RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit,
- DDXPointPtr pptInit, int *pwidthInit, int sorted)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("fill spans start ");
-
- if (nInit <= 0) {
- pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted);
- } else {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nInit;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while (--i) {
- ppt++;
- pwidth++;
- if (box.x1 > ppt->x)
- box.x1 = ppt->x;
- if (box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if (box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if (box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
-
- box.y2++;
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill spans end\n");
-}
-
-static void
-RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc,
- DDXPointPtr pptInit, int *pwidthInit,
- int nspans, int sorted)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("set spans start ");
-
- if (nspans <= 0) {
- pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit,
- nspans, sorted);
- } else {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nspans;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while (--i) {
- ppt++;
- pwidth++;
- if (box.x1 > ppt->x)
- box.x1 = ppt->x;
- if (box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if (box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if (box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
-
- box.y2++;
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit,
- nspans, sorted);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("set spans end\n");
-}
-
-static void
-RootlessPutImage(DrawablePtr dst, GCPtr pGC,
- int depth, int x, int y, int w, int h,
- int leftPad, int format, char *pBits)
-{
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("put image start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PutImage(dst, pGC, depth, x,y,w,h, leftPad, format, pBits);
-
- box.x1 = x + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = y + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("put image end\n");
-}
-
-/* changed area is *dest* rect */
-static RegionPtr
-RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
- int srcx, int srcy, int w, int h,
- int dstx, int dsty)
-{
- RegionPtr result;
- BoxRec box;
-
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
-
- if (GC_IS_ROOT(dst) || GC_IS_ROOT(pSrc))
- return NULL; /* nothing exposed */
-
- RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
-
- if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) {
- unsigned int bytes;
-
- /* If both source and dest are windows, and we're doing
- a simple copy operation, we can remove the alpha-protecting
- planemask (since source has opaque alpha as well) */
-
- bytes = w * h * (pSrc->depth >> 3);
-
- if (bytes >= rootless_CopyBytes_threshold && canAccelBlit(pSrc, pGC))
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- RootlessStartDrawing((WindowPtr) pSrc);
- }
- RootlessStartDrawing((WindowPtr) dst);
- result = pGC->ops->CopyArea(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty);
-
- box.x1 = dstx + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = dsty + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("copy area end\n");
- return result;
-}
-
-/* changed area is *dest* rect */
-static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst,
- GCPtr pGC, int srcx, int srcy,
- int w, int h, int dstx, int dsty,
- unsigned long plane)
-{
- RegionPtr result;
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
-
- if (GC_IS_ROOT(dst) || GC_IS_ROOT(pSrc))
- return NULL; /* nothing exposed */
-
- RL_DEBUG_MSG("copy plane start ");
-
- if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) {
- RootlessStartDrawing((WindowPtr) pSrc);
- }
- RootlessStartDrawing((WindowPtr) dst);
- result = pGC->ops->CopyPlane(pSrc, dst, pGC, srcx, srcy, w, h,
- dstx, dsty, plane);
-
- box.x1 = dstx + dst->x;
- box.x2 = box.x1 + w;
- box.y1 = dsty + dst->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("copy plane end\n");
- return result;
-}
-
-// Options for size of changed area:
-// 0 = box per point
-// 1 = big box around all points
-// 2 = accumulate point in 20 pixel radius
-#define ROOTLESS_CHANGED_AREA 1
-#define abs(a) ((a) > 0 ? (a) : -(a))
-
-/* changed area is box around all points */
-static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("polypoint start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit);
-
- if (npt > 0) {
-#if ROOTLESS_CHANGED_AREA==0
- // box per point
- BoxRec box;
-
- while (npt) {
- box.x1 = pptInit->x;
- box.y1 = pptInit->y;
- box.x2 = box.x1 + 1;
- box.y2 = box.y1 + 1;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- npt--;
- pptInit++;
- }
-
-#elif ROOTLESS_CHANGED_AREA==1
- // one big box
- BoxRec box;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
- while (--npt) {
- pptInit++;
- if (box.x1 > pptInit->x)
- box.x1 = pptInit->x;
- else if (box.x2 < pptInit->x)
- box.x2 = pptInit->x;
- if (box.y1 > pptInit->y)
- box.y1 = pptInit->y;
- else if (box.y2 < pptInit->y)
- box.y2 = pptInit->y;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
-#elif ROOTLESS_CHANGED_AREA==2
- // clever(?) method: accumulate point in 20-pixel radius
- BoxRec box;
- int firstx, firsty;
-
- box.x2 = box.x1 = firstx = pptInit->x;
- box.y2 = box.y1 = firsty = pptInit->y;
- while (--npt) {
- pptInit++;
- if (abs(pptInit->x - firstx) > 20 ||
- abs(pptInit->y - firsty) > 20) {
- box.x2++;
- box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- box.x2 = box.x1 = firstx = pptInit->x;
- box.y2 = box.y1 = firsty = pptInit->y;
- } else {
- if (box.x1 > pptInit->x) box.x1 = pptInit->x;
- else if (box.x2 < pptInit->x) box.x2 = pptInit->x;
- if (box.y1 > pptInit->y) box.y1 = pptInit->y;
- else if (box.y2 < pptInit->y) box.y2 = pptInit->y;
- }
- }
- box.x2++;
- box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox((WindowPtr) dst, &box);
-#endif /* ROOTLESS_CHANGED_AREA */
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polypoint end\n");
-}
-
-#undef ROOTLESS_CHANGED_AREA
-
-/* changed area is box around each line */
-static void RootlessPolylines(DrawablePtr dst, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("poly lines start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->Polylines(dst, pGC, mode, npt, pptInit);
-
- if (npt > 0) {
- BoxRec box;
- int extra = pGC->lineWidth >> 1;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- if (npt > 1) {
- if (pGC->joinStyle == JoinMiter)
- extra = 6 * pGC->lineWidth;
- else if (pGC->capStyle == CapProjecting)
- extra = pGC->lineWidth;
- }
-
- if (mode == CoordModePrevious) {
- int x = box.x1;
- int y = box.y1;
-
- while (--npt) {
- pptInit++;
- x += pptInit->x;
- y += pptInit->y;
- if (box.x1 > x)
- box.x1 = x;
- else if (box.x2 < x)
- box.x2 = x;
- if (box.y1 > y)
- box.y1 = y;
- else if (box.y2 < y)
- box.y2 = y;
- }
- } else {
- while (--npt) {
- pptInit++;
- if (box.x1 > pptInit->x)
- box.x1 = pptInit->x;
- else if (box.x2 < pptInit->x)
- box.x2 = pptInit->x;
- if (box.y1 > pptInit->y)
- box.y1 = pptInit->y;
- else if (box.y2 < pptInit->y)
- box.y2 = pptInit->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if (extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly lines end\n");
-}
-
-/* changed area is box around each line segment */
-static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC,
- int nseg, xSegment *pSeg)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("poly segment start (win 0x%x)", dst);
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PolySegment(dst, pGC, nseg, pSeg);
-
- if (nseg > 0) {
- BoxRec box;
- int extra = pGC->lineWidth;
-
- if (pGC->capStyle != CapProjecting)
- extra >>= 1;
-
- if (pSeg->x2 > pSeg->x1) {
- box.x1 = pSeg->x1;
- box.x2 = pSeg->x2;
- } else {
- box.x2 = pSeg->x1;
- box.x1 = pSeg->x2;
- }
-
- if (pSeg->y2 > pSeg->y1) {
- box.y1 = pSeg->y1;
- box.y2 = pSeg->y2;
- } else {
- box.y2 = pSeg->y1;
- box.y1 = pSeg->y2;
- }
-
- while (--nseg) {
- pSeg++;
- if (pSeg->x2 > pSeg->x1) {
- if (pSeg->x1 < box.x1) box.x1 = pSeg->x1;
- if (pSeg->x2 > box.x2) box.x2 = pSeg->x2;
- } else {
- if (pSeg->x2 < box.x1) box.x1 = pSeg->x2;
- if (pSeg->x1 > box.x2) box.x2 = pSeg->x1;
- }
- if (pSeg->y2 > pSeg->y1) {
- if (pSeg->y1 < box.y1) box.y1 = pSeg->y1;
- if (pSeg->y2 > box.y2) box.y2 = pSeg->y2;
- } else {
- if (pSeg->y2 < box.y1) box.y1 = pSeg->y2;
- if (pSeg->y1 > box.y2) box.y2 = pSeg->y1;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if (extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly segment end\n");
-}
-
-/* changed area is box around each line (not entire rects) */
-static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC,
- int nRects, xRectangle *pRects)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("poly rectangle start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PolyRectangle(dst, pGC, nRects, pRects);
-
- if (nRects > 0) {
- BoxRec box;
- int offset1, offset2, offset3;
-
- offset2 = pGC->lineWidth;
- if (!offset2) offset2 = 1;
- offset1 = offset2 >> 1;
- offset3 = offset2 - offset1;
-
- while (nRects--) {
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x + pRects->width - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + pRects->height - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- pRects++;
- }
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly rectangle end\n");
-}
-
-
-/* changed area is box around each arc (assumes all arcs are 360 degrees) */
-static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc *parcs)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("poly arc start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PolyArc(dst, pGC, narcs, parcs);
-
- if (narcs > 0) {
- int extra = pGC->lineWidth >> 1;
- BoxRec box;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while (--narcs) {
- parcs++;
- if (box.x1 > parcs->x)
- box.x1 = parcs->x;
- if (box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if (box.y1 > parcs->y)
- box.y1 = parcs->y;
- if (box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- if (extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("poly arc end\n");
-}
-
-
-/* changed area is box around each poly */
-static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
- int shape, int mode, int count,
- DDXPointPtr pptInit)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("fill poly start (win 0x%x, fillStyle 0x%x)", dst,
- pGC->fillStyle);
-
- if (count <= 2) {
- pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
- } else {
- DDXPointPtr ppt = pptInit;
- int i = count;
- BoxRec box;
-
- box.x2 = box.x1 = ppt->x;
- box.y2 = box.y1 = ppt->y;
-
- if (mode != CoordModeOrigin) {
- int x = box.x1;
- int y = box.y1;
-
- while (--i) {
- ppt++;
- x += ppt->x;
- y += ppt->y;
- if (box.x1 > x)
- box.x1 = x;
- else if (box.x2 < x)
- box.x2 = x;
- if (box.y1 > y)
- box.y1 = y;
- else if (box.y2 < y)
- box.y2 = y;
- }
- } else {
- while (--i) {
- ppt++;
- if (box.x1 > ppt->x)
- box.x1 = ppt->x;
- else if (box.x2 < ppt->x)
- box.x2 = ppt->x;
- if (box.y1 > ppt->y)
- box.y1 = ppt->y;
- else if (box.y2 < ppt->y)
- box.y2 = ppt->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill poly end\n");
-}
-
-/* changed area is the rects */
-static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
- int nRectsInit, xRectangle *pRectsInit)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("fill rect start (win 0x%x, fillStyle 0x%x)", dst,
- pGC->fillStyle);
-
- if (nRectsInit <= 0) {
- pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit);
- } else {
- BoxRec box;
- xRectangle *pRects = pRectsInit;
- int nRects = nRectsInit;
-
- box.x1 = pRects->x;
- box.x2 = box.x1 + pRects->width;
- box.y1 = pRects->y;
- box.y2 = box.y1 + pRects->height;
-
- while (--nRects) {
- pRects++;
- if (box.x1 > pRects->x)
- box.x1 = pRects->x;
- if (box.x2 < (pRects->x + pRects->width))
- box.x2 = pRects->x + pRects->width;
- if (box.y1 > pRects->y)
- box.y1 = pRects->y;
- if (box.y2 < (pRects->y + pRects->height))
- box.y2 = pRects->y + pRects->height;
- }
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill rect end\n");
-}
-
-
-/* changed area is box around each arc (assuming arcs are all 360 degrees) */
-static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC,
- int narcsInit, xArc *parcsInit)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("fill arc start ");
-
- if (narcsInit > 0) {
- BoxRec box;
- int narcs = narcsInit;
- xArc *parcs = parcsInit;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while (--narcs) {
- parcs++;
- if (box.x1 > parcs->x)
- box.x1 = parcs->x;
- if (box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if (box.y1 > parcs->y)
- box.y1 = parcs->y;
- if (box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->PolyFillArc(dst, pGC, narcsInit, parcsInit);
-
- TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- } else {
- pGC->ops->PolyFillArc(dst, pGC, narcsInit, parcsInit);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("fill arc end\n");
-}
-
-
-static void RootlessImageText8(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, char *chars)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("imagetext8 start ");
-
- if (count > 0) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if (Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if (Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = dst->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->ImageText8(dst, pGC, x, y, count, chars);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- } else {
- pGC->ops->ImageText8(dst, pGC, x, y, count, chars);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imagetext8 end\n");
-}
-
-static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, char *chars)
-{
- int width; // the result, sorta
-
- GCOP_UNWRAP(pGC);
-
- if (GC_IS_ROOT(dst))
- return 0;
-
- RL_DEBUG_MSG("polytext8 start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- width = pGC->ops->PolyText8(dst, pGC, x, y, count, chars);
- width -= x;
-
- if (width > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if (count > 1) {
- if (width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polytext8 end\n");
- return (width + x);
-}
-
-static void RootlessImageText16(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("imagetext16 start ");
-
- if (count > 0) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if (Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if (Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = dst->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->ImageText16(dst, pGC, x, y, count, chars);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- } else {
- pGC->ops->ImageText16(dst, pGC, x, y, count, chars);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imagetext16 end\n");
-}
-
-static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
-{
- int width; // the result, sorta
-
- GCOP_UNWRAP(pGC);
-
- if (GC_IS_ROOT(dst))
- return 0;
-
- RL_DEBUG_MSG("polytext16 start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- width = pGC->ops->PolyText16(dst, pGC, x, y, count, chars);
- width -= x;
-
- if (width > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if (count > 1) {
- if (width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polytext16 end\n");
- return width + x;
-}
-
-static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC,
- int x, int y, unsigned int nglyphInit,
- CharInfoPtr *ppciInit, pointer unused)
-{
- GC_SAVE(pGC);
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("imageglyph start ");
-
- if (nglyphInit > 0) {
- int top, bot, width = 0;
- BoxRec box;
- unsigned int nglyph = nglyphInit;
- CharInfoPtr *ppci = ppciInit;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- box.x1 = ppci[0]->metrics.leftSideBearing;
- if (box.x1 > 0) box.x1 = 0;
- box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing -
- ppci[nglyph - 1]->metrics.characterWidth;
- if (box.x2 < 0) box.x2 = 0;
-
- box.x2 += dst->x + x;
- box.x1 += dst->x + x;
-
- while (nglyph--) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if (width > 0)
- box.x2 += width;
- else
- box.x1 += width;
-
- box.y1 = dst->y + y - top;
- box.y2 = dst->y + y + bot;
-
- RootlessStartDrawing((WindowPtr) dst);
-
- if (canAccelFill(dst, pGC) &&
- boxBytes(dst, &box) >= rootless_FillBytes_threshold)
- {
- GC_UNSET_PM(pGC, dst);
- }
-
- pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyphInit, ppciInit, unused);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- } else {
- pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyphInit, ppciInit, unused);
- }
-
- GC_RESTORE(pGC, dst);
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("imageglyph end\n");
-}
-
-static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
-{
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("polyglyph start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PolyGlyphBlt(dst, pGC, x, y, nglyph, ppci, pglyphBase);
-
- if (nglyph > 0) {
- BoxRec box;
-
- /* ugh */
- box.x1 = dst->x + x + ppci[0]->metrics.leftSideBearing;
- box.x2 = dst->x + x + ppci[nglyph - 1]->metrics.rightSideBearing;
-
- if (nglyph > 1) {
- int width = 0;
-
- while (--nglyph) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if (width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = dst->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = dst->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
- }
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("polyglyph end\n");
-}
-
-
-/* changed area is in dest */
-static void
-RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst,
- int dx, int dy, int xOrg, int yOrg)
-{
- BoxRec box;
-
- GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
- RL_DEBUG_MSG("push pixels start ");
-
- RootlessStartDrawing((WindowPtr) dst);
- pGC->ops->PushPixels(pGC, pBitMap, dst, dx, dy, xOrg, yOrg);
-
- box.x1 = xOrg + dst->x;
- box.x2 = box.x1 + dx;
- box.y1 = yOrg + dst->y;
- box.y2 = box.y1 + dy;
-
- TRIM_BOX(box, pGC);
- if (BOX_NOT_EMPTY(box))
- RootlessDamageBox ((WindowPtr) dst, &box);
-
- GCOP_WRAP(pGC);
- RL_DEBUG_MSG("push pixels end\n");
-}
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
deleted file mode 100644
index beb737df1..000000000
--- a/miext/rootless/rootlessScreen.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
- * Screen routines for generic rootless X server
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessScreen.c,v 1.3 2003/06/30 01:45:13 torrey Exp $ */
-
-
-#include "mi.h"
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "mivalidate.h"
-#include "picturestr.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-#include "rootlessCommon.h"
-#include "rootlessWindow.h"
-
-/* In milliseconds */
-#ifndef ROOTLESS_REDISPLAY_DELAY
-#define ROOTLESS_REDISPLAY_DELAY 10
-#endif
-
-extern int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild,
- VTKind kind);
-extern Bool RootlessCreateGC(GCPtr pGC);
-
-// Initialize globals
-int rootlessGCPrivateIndex = -1;
-int rootlessScreenPrivateIndex = -1;
-int rootlessWindowPrivateIndex = -1;
-
-
-/*
- * RootlessUpdateScreenPixmap
- * miCreateScreenResources does not like a null framebuffer pointer,
- * it leaves the screen pixmap with an uninitialized data pointer.
- * Thus, rootless implementations typically set the framebuffer width
- * to zero so that miCreateScreenResources does not allocate a screen
- * pixmap for us. We allocate our own screen pixmap here since we need
- * the screen pixmap to be valid (e.g. CopyArea from the root window).
- */
-void
-RootlessUpdateScreenPixmap(ScreenPtr pScreen)
-{
- RootlessScreenRec *s = SCREENREC(pScreen);
- PixmapPtr pPix;
- unsigned int rowbytes;
-
- pPix = (*pScreen->GetScreenPixmap)(pScreen);
- if (pPix == NULL) {
- pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
- (*pScreen->SetScreenPixmap)(pPix);
- }
-
- rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
-
- if (s->pixmap_data_size < rowbytes) {
- if (s->pixmap_data != NULL)
- xfree(s->pixmap_data);
-
- s->pixmap_data_size = rowbytes;
- s->pixmap_data = xalloc(s->pixmap_data_size);
- if (s->pixmap_data == NULL)
- return;
-
- memset(s->pixmap_data, 0xFF, s->pixmap_data_size);
-
- pScreen->ModifyPixmapHeader(pPix, pScreen->width, pScreen->height,
- pScreen->rootDepth,
- BitsPerPixel(pScreen->rootDepth),
- 0, s->pixmap_data);
- /* ModifyPixmapHeader ignores zero arguments, so install rowbytes
- by hand. */
- pPix->devKind = 0;
- }
-}
-
-
-/*
- * RootlessCreateScreenResources
- * Rootless implementations typically set a null framebuffer pointer, which
- * causes problems with miCreateScreenResources. We fix things up here.
- */
-static Bool
-RootlessCreateScreenResources(ScreenPtr pScreen)
-{
- Bool ret = TRUE;
-
- SCREEN_UNWRAP(pScreen, CreateScreenResources);
-
- if (pScreen->CreateScreenResources != NULL)
- ret = (*pScreen->CreateScreenResources)(pScreen);
-
- SCREEN_WRAP(pScreen, CreateScreenResources);
-
- if (!ret)
- return ret;
-
- /* Make sure we have a valid screen pixmap. */
-
- RootlessUpdateScreenPixmap(pScreen);
-
- return ret;
-}
-
-
-static Bool
-RootlessCloseScreen(int i, ScreenPtr pScreen)
-{
- RootlessScreenRec *s;
-
- s = SCREENREC(pScreen);
-
- // fixme unwrap everything that was wrapped?
- pScreen->CloseScreen = s->CloseScreen;
-
- if (s->pixmap_data != NULL) {
- xfree (s->pixmap_data);
- s->pixmap_data = NULL;
- s->pixmap_data_size = 0;
- }
-
- xfree(s);
- return pScreen->CloseScreen(i, pScreen);
-}
-
-
-static void
-RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask, char *pdstLine)
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- SCREEN_UNWRAP(pScreen, GetImage);
-
- if (pDrawable->type == DRAWABLE_WINDOW) {
- int x0, y0, x1, y1;
- RootlessWindowRec *winRec;
-
- // Many apps use GetImage to sync with the visible frame buffer
- // FIXME: entire screen or just window or all screens?
- RootlessRedisplayScreen(pScreen);
-
- // RedisplayScreen stops drawing, so we need to start it again
- RootlessStartDrawing((WindowPtr)pDrawable);
-
- /* Check that we have some place to read from. */
- winRec = WINREC(TopLevelParent((WindowPtr) pDrawable));
- if (winRec == NULL)
- goto out;
-
- /* Clip to top-level window bounds. */
- /* FIXME: fbGetImage uses the width parameter to calculate the
- stride of the destination pixmap. If w is clipped, the data
- returned will be garbage, although we will not crash. */
-
- x0 = pDrawable->x + sx;
- y0 = pDrawable->y + sy;
- x1 = x0 + w;
- y1 = y0 + h;
-
- x0 = MAX (x0, winRec->x);
- y0 = MAX (y0, winRec->y);
- x1 = MIN (x1, winRec->x + winRec->width);
- y1 = MIN (y1, winRec->y + winRec->height);
-
- sx = x0 - pDrawable->x;
- sy = y0 - pDrawable->y;
- w = x1 - x0;
- h = y1 - y0;
-
- if (w <= 0 || h <= 0)
- goto out;
- }
-
- pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
-
-out:
- SCREEN_WRAP(pScreen, GetImage);
-}
-
-
-/*
- * RootlessSourceValidate
- * CopyArea and CopyPlane use a GC tied to the destination drawable.
- * StartDrawing/StopDrawing wrappers won't be called if source is
- * a visible window but the destination isn't. So, we call StartDrawing
- * here and leave StopDrawing for the block handler.
- */
-static void
-RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h)
-{
- SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate);
- if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDrawable;
- RootlessStartDrawing(pWin);
- }
- if (pDrawable->pScreen->SourceValidate) {
- pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h);
- }
- SCREEN_WRAP(pDrawable->pScreen, SourceValidate);
-}
-
-#ifdef RENDER
-
-static void
-RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- WindowPtr srcWin, dstWin, maskWin = NULL;
-
- if (pMask) { // pMask can be NULL
- maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pMask->pDrawable : NULL;
- }
- srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pSrc->pDrawable : NULL;
- dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pDst->pDrawable : NULL;
-
- // SCREEN_UNWRAP(ps, Composite);
- ps->Composite = SCREENREC(pScreen)->Composite;
-
- if (srcWin && IsFramedWindow(srcWin))
- RootlessStartDrawing(srcWin);
- if (maskWin && IsFramedWindow(maskWin))
- RootlessStartDrawing(maskWin);
- if (dstWin && IsFramedWindow(dstWin))
- RootlessStartDrawing(dstWin);
-
- ps->Composite(op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask,
- xDst, yDst, width, height);
-
- if (dstWin && IsFramedWindow(dstWin)) {
- RootlessDamageRect(dstWin, xDst, yDst, width, height);
- }
-
- ps->Composite = RootlessComposite;
- // SCREEN_WRAP(ps, Composite);
-}
-
-
-static void
-RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
- int nlist, GlyphListPtr list, GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- int x, y;
- int n;
- GlyphPtr glyph;
- WindowPtr srcWin, dstWin;
-
- srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pSrc->pDrawable : NULL;
- dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
- (WindowPtr)pDst->pDrawable : NULL;
-
- if (srcWin && IsFramedWindow(srcWin)) RootlessStartDrawing(srcWin);
- if (dstWin && IsFramedWindow(dstWin)) RootlessStartDrawing(dstWin);
-
- //SCREEN_UNWRAP(ps, Glyphs);
- ps->Glyphs = SCREENREC(pScreen)->Glyphs;
- ps->Glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
- ps->Glyphs = RootlessGlyphs;
- //SCREEN_WRAP(ps, Glyphs);
-
- if (dstWin && IsFramedWindow(dstWin)) {
- x = xSrc;
- y = ySrc;
-
- while (nlist--) {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
-
- /* Calling DamageRect for the bounding box of each glyph is
- inefficient. So compute the union of all glyphs in a list
- and damage that. */
-
- if (n > 0) {
- BoxRec box;
-
- glyph = *glyphs++;
-
- box.x1 = x - glyph->info.x;
- box.y1 = y - glyph->info.y;
- box.x2 = box.x1 + glyph->info.width;
- box.y2 = box.y2 + glyph->info.height;
-
- x += glyph->info.xOff;
- y += glyph->info.yOff;
-
- while (--n > 0) {
- short x1, y1, x2, y2;
-
- glyph = *glyphs++;
-
- x1 = x - glyph->info.x;
- y1 = y - glyph->info.y;
- x2 = x1 + glyph->info.width;
- y2 = y1 + glyph->info.height;
-
- box.x1 = MAX (box.x1, x1);
- box.y1 = MAX (box.y1, y1);
- box.x2 = MAX (box.x2, x2);
- box.y2 = MAX (box.y2, y2);
-
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
-
- RootlessDamageBox(dstWin, &box);
- }
- list++;
- }
- }
-}
-
-#endif // RENDER
-
-
-/*
- * RootlessValidateTree
- * ValidateTree is modified in two ways:
- * - top-level windows don't clip each other
- * - windows aren't clipped against root.
- * These only matter when validating from the root.
- */
-static int
-RootlessValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
-{
- int result;
- RegionRec saveRoot;
- ScreenPtr pScreen = pParent->drawable.pScreen;
-
- SCREEN_UNWRAP(pScreen, ValidateTree);
- RL_DEBUG_MSG("VALIDATETREE start ");
-
- // Use our custom version to validate from root
- if (IsRoot(pParent)) {
- RL_DEBUG_MSG("custom ");
- result = RootlessMiValidateTree(pParent, pChild, kind);
- } else {
- HUGE_ROOT(pParent);
- result = pScreen->ValidateTree(pParent, pChild, kind);
- NORMAL_ROOT(pParent);
- }
-
- SCREEN_WRAP(pScreen, ValidateTree);
- RL_DEBUG_MSG("VALIDATETREE end\n");
-
- return result;
-}
-
-
-/*
- * RootlessMarkOverlappedWindows
- * MarkOverlappedWindows is modified to ignore overlapping
- * top-level windows.
- */
-static Bool
-RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst,
- WindowPtr *ppLayerWin)
-{
- RegionRec saveRoot;
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- SCREEN_UNWRAP(pScreen, MarkOverlappedWindows);
- RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS start ");
-
- HUGE_ROOT(pWin);
- if (IsRoot(pWin)) {
- // root - mark nothing
- RL_DEBUG_MSG("is root not marking ");
- result = FALSE;
- }
- else if (! IsTopLevel(pWin)) {
- // not top-level window - mark normally
- result = pScreen->MarkOverlappedWindows(pWin, pFirst, ppLayerWin);
- }
- else {
- //top-level window - mark children ONLY - NO overlaps with sibs (?)
- // This code copied from miMarkOverlappedWindows()
-
- register WindowPtr pChild;
- Bool anyMarked = FALSE;
- void (* MarkWindow)() = pScreen->MarkWindow;
-
- RL_DEBUG_MSG("is top level! ");
- /* single layered systems are easy */
- if (ppLayerWin) *ppLayerWin = pWin;
-
- if (pWin == pFirst) {
- /* Blindly mark pWin and all of its inferiors. This is a slight
- * overkill if there are mapped windows that outside pWin's border,
- * but it's better than wasting time on RectIn checks.
- */
- pChild = pWin;
- while (1) {
- if (pChild->viewable) {
- if (REGION_BROKEN (pScreen, &pChild->winSize))
- SetWinSize (pChild);
- if (REGION_BROKEN (pScreen, &pChild->borderSize))
- SetBorderSize (pChild);
- (* MarkWindow)(pChild);
- if (pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pWin))
- pChild = pChild->parent;
- if (pChild == pWin)
- break;
- pChild = pChild->nextSib;
- }
- anyMarked = TRUE;
- pFirst = pFirst->nextSib;
- }
- if (anyMarked)
- (* MarkWindow)(pWin->parent);
- result = anyMarked;
- }
- NORMAL_ROOT(pWin);
- SCREEN_WRAP(pScreen, MarkOverlappedWindows);
- RL_DEBUG_MSG("MARKOVERLAPPEDWINDOWS end\n");
-
- return result;
-}
-
-
-static CARD32
-RootlessRedisplayCallback(OsTimerPtr timer, CARD32 time, void *arg)
-{
- RootlessScreenRec *screenRec = arg;
-
- if (!screenRec->redisplay_queued) {
- /* No update needed. Stop the timer. */
-
- screenRec->redisplay_timer_set = FALSE;
- return 0;
- }
-
- screenRec->redisplay_queued = FALSE;
-
- /* Mark that we should redisplay before waiting for I/O next time */
- screenRec->redisplay_expired = TRUE;
-
- /* Reinstall the timer immediately, so we get as close to our
- redisplay interval as possible. */
-
- return ROOTLESS_REDISPLAY_DELAY;
-}
-
-
-/*
- * RootlessQueueRedisplay
- * Queue a redisplay after a timer delay to ensure we do not redisplay
- * too frequently.
- */
-void
-RootlessQueueRedisplay(ScreenPtr pScreen)
-{
- RootlessScreenRec *screenRec = SCREENREC(pScreen);
-
- screenRec->redisplay_queued = TRUE;
-
- if (screenRec->redisplay_timer_set)
- return;
-
- screenRec->redisplay_timer = TimerSet(screenRec->redisplay_timer,
- 0, ROOTLESS_REDISPLAY_DELAY,
- RootlessRedisplayCallback,
- screenRec);
- screenRec->redisplay_timer_set = TRUE;
-}
-
-
-/*
- * RootlessBlockHandler
- * If the redisplay timer has expired, flush drawing before blocking
- * on select().
- */
-static void
-RootlessBlockHandler(pointer pbdata, OSTimePtr pTimeout, pointer pReadmask)
-{
- ScreenPtr pScreen = pbdata;
- RootlessScreenRec *screenRec = SCREENREC(pScreen);
-
- if (screenRec->redisplay_expired) {
- screenRec->redisplay_expired = FALSE;
-
- RootlessRedisplayScreen(pScreen);
- }
-}
-
-
-static void
-RootlessWakeupHandler(pointer data, int i, pointer LastSelectMask)
-{
- // nothing here
-}
-
-
-static Bool
-RootlessAllocatePrivates(ScreenPtr pScreen)
-{
- RootlessScreenRec *s;
- static unsigned long rootlessGeneration = 0;
-
- if (rootlessGeneration != serverGeneration) {
- rootlessScreenPrivateIndex = AllocateScreenPrivateIndex();
- if (rootlessScreenPrivateIndex == -1) return FALSE;
- rootlessGCPrivateIndex = AllocateGCPrivateIndex();
- if (rootlessGCPrivateIndex == -1) return FALSE;
- rootlessWindowPrivateIndex = AllocateWindowPrivateIndex();
- if (rootlessWindowPrivateIndex == -1) return FALSE;
- rootlessGeneration = serverGeneration;
- }
-
- // no allocation needed for screen privates
- if (!AllocateGCPrivate(pScreen, rootlessGCPrivateIndex,
- sizeof(RootlessGCRec)))
- return FALSE;
- if (!AllocateWindowPrivate(pScreen, rootlessWindowPrivateIndex, 0))
- return FALSE;
-
- s = xalloc(sizeof(RootlessScreenRec));
- if (! s) return FALSE;
- SCREENREC(pScreen) = s;
-
- s->pixmap_data = NULL;
- s->pixmap_data_size = 0;
-
- s->redisplay_timer = NULL;
- s->redisplay_timer_set = FALSE;
-
- return TRUE;
-}
-
-
-static void
-RootlessWrap(ScreenPtr pScreen)
-{
- RootlessScreenRec *s = (RootlessScreenRec*)
- pScreen->devPrivates[rootlessScreenPrivateIndex].ptr;
-
-#define WRAP(a) \
- if (pScreen->a) { \
- s->a = pScreen->a; \
- } else { \
- RL_DEBUG_MSG("null screen fn " #a "\n"); \
- s->a = NULL; \
- } \
- pScreen->a = Rootless##a
-
- WRAP(CreateScreenResources);
- WRAP(CloseScreen);
- WRAP(CreateGC);
- WRAP(PaintWindowBackground);
- WRAP(PaintWindowBorder);
- WRAP(CopyWindow);
- WRAP(GetImage);
- WRAP(SourceValidate);
- WRAP(CreateWindow);
- WRAP(DestroyWindow);
- WRAP(RealizeWindow);
- WRAP(UnrealizeWindow);
- WRAP(MoveWindow);
- WRAP(PositionWindow);
- WRAP(ResizeWindow);
- WRAP(RestackWindow);
- WRAP(ReparentWindow);
- WRAP(ChangeBorderWidth);
- WRAP(MarkOverlappedWindows);
- WRAP(ValidateTree);
- WRAP(ChangeWindowAttributes);
-
-#ifdef SHAPE
- WRAP(SetShape);
-#endif
-
-#ifdef RENDER
- {
- // Composite and Glyphs don't use normal screen wrapping
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- s->Composite = ps->Composite;
- ps->Composite = RootlessComposite;
- s->Glyphs = ps->Glyphs;
- ps->Glyphs = RootlessGlyphs;
- }
-#endif
-
- // WRAP(ClearToBackground); fixme put this back? useful for shaped wins?
- // WRAP(RestoreAreas); fixme put this back?
-
-#undef WRAP
-}
-
-
-/*
- * RootlessInit
- * Called by the rootless implementation to initialize the rootless layer.
- * Rootless wraps lots of stuff and needs a bunch of devPrivates.
- */
-Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs)
-{
- RootlessScreenRec *s;
-
- if (!RootlessAllocatePrivates(pScreen))
- return FALSE;
-
- s = (RootlessScreenRec*)
- pScreen->devPrivates[rootlessScreenPrivateIndex].ptr;
-
- s->imp = procs;
-
- RootlessWrap(pScreen);
-
- if (!RegisterBlockAndWakeupHandlers(RootlessBlockHandler,
- RootlessWakeupHandler,
- (pointer) pScreen))
- {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c
deleted file mode 100644
index a95917939..000000000
--- a/miext/rootless/rootlessValTree.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Calculate window clip lists for rootless mode
- *
- * This file is very closely based on mivaltree.c.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessValTree.c,v 1.2 2003/11/10 18:22:50 tsi Exp $ */
-
-/*
- * mivaltree.c --
- * Functions for recalculating window clip lists. Main function
- * is miValidateTree.
- *
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-
-All Rights Reserved.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
- *
- * Copyright 1987, 1988, 1989 by
- * Digital Equipment Corporation, Maynard, Massachusetts,
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- ******************************************************************/
-
-/* The panoramix components contained the following notice */
-/****************************************************************
-* *
-* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
-* *
-* All Rights Reserved. Unpublished rights reserved under *
-* the copyright laws of the United States. *
-* *
-* The software contained on this media is proprietary to *
-* and embodies the confidential technology of Digital *
-* Equipment Corporation. Possession, use, duplication or *
-* dissemination of the software and media is authorized only *
-* pursuant to a valid written license from Digital Equipment *
-* Corporation. *
-* *
-* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
-* by the U.S. Government is subject to restrictions as set *
-* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
-* or in FAR 52.227-19, as applicable. *
-* *
-*****************************************************************/
-
- /*
- * Aug '86: Susan Angebranndt -- original code
- * July '87: Adam de Boor -- substantially modified and commented
- * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible.
- * In particular, much improved code for window mapping and
- * circulating.
- * Bob Scheifler -- avoid miComputeClips for unmapped windows,
- * valdata changes
- */
-#include "X.h"
-#include "scrnintstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "mivalidate.h"
-
-#include "globals.h"
-
-#ifdef SHAPE
-/*
- * Compute the visibility of a shaped window
- */
-int
-RootlessShapedWindowIn (pScreen, universe, bounding, rect, x, y)
- ScreenPtr pScreen;
- RegionPtr universe, bounding;
- BoxPtr rect;
- register int x, y;
-{
- BoxRec box;
- register BoxPtr boundBox;
- int nbox;
- Bool someIn, someOut;
- register int t, x1, y1, x2, y2;
-
- nbox = REGION_NUM_RECTS (bounding);
- boundBox = REGION_RECTS (bounding);
- someIn = someOut = FALSE;
- x1 = rect->x1;
- y1 = rect->y1;
- x2 = rect->x2;
- y2 = rect->y2;
- while (nbox--)
- {
- if ((t = boundBox->x1 + x) < x1)
- t = x1;
- box.x1 = t;
- if ((t = boundBox->y1 + y) < y1)
- t = y1;
- box.y1 = t;
- if ((t = boundBox->x2 + x) > x2)
- t = x2;
- box.x2 = t;
- if ((t = boundBox->y2 + y) > y2)
- t = y2;
- box.y2 = t;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- switch (RECT_IN_REGION(pScreen, universe, &box))
- {
- case rgnIN:
- if (someOut)
- return rgnPART;
- someIn = TRUE;
- break;
- case rgnOUT:
- if (someIn)
- return rgnPART;
- someOut = TRUE;
- break;
- default:
- return rgnPART;
- }
- boundBox++;
- }
- if (someIn)
- return rgnIN;
- return rgnOUT;
-}
-#endif
-
-#define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \
- HasBorder(w) && \
- (w)->backgroundState == ParentRelative)
-
-
-/*
- *-----------------------------------------------------------------------
- * RootlessComputeClips --
- * Recompute the clipList, borderClip, exposed and borderExposed
- * regions for pParent and its children. Only viewable windows are
- * taken into account.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * clipList, borderClip, exposed and borderExposed are altered.
- * A VisibilityNotify event may be generated on the parent window.
- *
- *-----------------------------------------------------------------------
- */
-static void
-RootlessComputeClips (pParent, pScreen, universe, kind, exposed)
- register WindowPtr pParent;
- register ScreenPtr pScreen;
- register RegionPtr universe;
- VTKind kind;
- RegionPtr exposed; /* for intermediate calculations */
-{
- int dx,
- dy;
- RegionRec childUniverse;
- register WindowPtr pChild;
- int oldVis, newVis;
- BoxRec borderSize;
- RegionRec childUnion;
- Bool overlap;
- RegionPtr borderVisible;
- Bool resized;
- /*
- * Figure out the new visibility of this window.
- * The extent of the universe should be the same as the extent of
- * the borderSize region. If the window is unobscured, this rectangle
- * will be completely inside the universe (the universe will cover it
- * completely). If the window is completely obscured, none of the
- * universe will cover the rectangle.
- */
- borderSize.x1 = pParent->drawable.x - wBorderWidth(pParent);
- borderSize.y1 = pParent->drawable.y - wBorderWidth(pParent);
- dx = (int) pParent->drawable.x + (int) pParent->drawable.width + wBorderWidth(pParent);
- if (dx > 32767)
- dx = 32767;
- borderSize.x2 = dx;
- dy = (int) pParent->drawable.y + (int) pParent->drawable.height + wBorderWidth(pParent);
- if (dy > 32767)
- dy = 32767;
- borderSize.y2 = dy;
-
- oldVis = pParent->visibility;
- switch (RECT_IN_REGION( pScreen, universe, &borderSize))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnPART:
- newVis = VisibilityPartiallyObscured;
-#ifdef SHAPE
- {
- RegionPtr pBounding;
-
- if ((pBounding = wBoundingShape (pParent)))
- {
- switch (RootlessShapedWindowIn (pScreen, universe,
- pBounding, &borderSize,
- pParent->drawable.x,
- pParent->drawable.y))
- {
- case rgnIN:
- newVis = VisibilityUnobscured;
- break;
- case rgnOUT:
- newVis = VisibilityFullyObscured;
- break;
- }
- }
- }
-#endif
- break;
- default:
- newVis = VisibilityFullyObscured;
- break;
- }
-
- pParent->visibility = newVis;
- if (oldVis != newVis &&
- ((pParent->eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
- SendVisibilityNotify(pParent);
-
- dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
- dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
-
- /*
- * avoid computations when dealing with simple operations
- */
-
- switch (kind) {
- case VTMap:
- case VTStack:
- case VTUnmap:
- break;
- case VTMove:
- if ((oldVis == newVis) &&
- ((oldVis == VisibilityFullyObscured) ||
- (oldVis == VisibilityUnobscured)))
- {
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- if (pChild->visibility != VisibilityFullyObscured)
- {
- REGION_TRANSLATE( pScreen, &pChild->borderClip,
- dx, dy);
- REGION_TRANSLATE( pScreen, &pChild->clipList,
- dx, dy);
- pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pChild, dx, dy);
-
- }
- if (pChild->valdata)
- {
- REGION_NULL(pScreen,
- &pChild->valdata->after.borderExposed);
- if (HasParentRelativeBorder(pChild))
- {
- REGION_SUBTRACT(pScreen,
- &pChild->valdata->after.borderExposed,
- &pChild->borderClip,
- &pChild->winSize);
- }
- REGION_NULL(pScreen, &pChild->valdata->after.exposed);
- }
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
- return;
- }
- /* fall through */
- default:
- /*
- * To calculate exposures correctly, we have to translate the old
- * borderClip and clipList regions to the window's new location so there
- * is a correspondence between pieces of the new and old clipping regions.
- */
- if (dx || dy)
- {
- /*
- * We translate the old clipList because that will be exposed or copied
- * if gravity is right.
- */
- REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy);
- REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy);
- }
- break;
- case VTBroken:
- REGION_EMPTY (pScreen, &pParent->borderClip);
- REGION_EMPTY (pScreen, &pParent->clipList);
- break;
- }
-
- borderVisible = pParent->valdata->before.borderVisible;
- resized = pParent->valdata->before.resized;
- REGION_NULL(pScreen, &pParent->valdata->after.borderExposed);
- REGION_NULL(pScreen, &pParent->valdata->after.exposed);
-
- /*
- * Since the borderClip must not be clipped by the children, we do
- * the border exposure first...
- *
- * 'universe' is the window's borderClip. To figure the exposures, remove
- * the area that used to be exposed from the new.
- * This leaves a region of pieces that weren't exposed before.
- */
-
- if (HasBorder (pParent))
- {
- if (borderVisible)
- {
- /*
- * when the border changes shape, the old visible portions
- * of the border will be saved by DIX in borderVisible --
- * use that region and destroy it
- */
- REGION_SUBTRACT( pScreen, exposed, universe, borderVisible);
- REGION_DESTROY( pScreen, borderVisible);
- }
- else
- {
- REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip);
- }
- if (HasParentRelativeBorder(pParent) && (dx || dy)) {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- universe,
- &pParent->winSize);
- } else {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed,
- exposed, &pParent->winSize);
- }
-
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- /*
- * To get the right clipList for the parent, and to make doubly sure
- * that no child overlaps the parent's border, we remove the parent's
- * border from the universe before proceeding.
- */
-
- REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize);
- }
- else
- REGION_COPY( pScreen, &pParent->borderClip, universe);
-
- if ((pChild = pParent->firstChild) && pParent->mapped)
- {
- REGION_NULL(pScreen, &childUniverse);
- REGION_NULL(pScreen, &childUnion);
- if ((pChild->drawable.y < pParent->lastChild->drawable.y) ||
- ((pChild->drawable.y == pParent->lastChild->drawable.y) &&
- (pChild->drawable.x < pParent->lastChild->drawable.x)))
- {
- for (; pChild; pChild = pChild->nextSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- else
- {
- for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib)
- {
- if (pChild->viewable)
- REGION_APPEND( pScreen, &childUnion, &pChild->borderSize);
- }
- }
- REGION_VALIDATE( pScreen, &childUnion, &overlap);
-
- for (pChild = pParent->firstChild;
- pChild;
- pChild = pChild->nextSib)
- {
- if (pChild->viewable) {
- /*
- * If the child is viewable, we want to remove its extents
- * from the current universe, but we only re-clip it if
- * it's been marked.
- */
- if (pChild->valdata) {
- /*
- * Figure out the new universe from the child's
- * perspective and recurse.
- */
- REGION_INTERSECT( pScreen, &childUniverse,
- universe,
- &pChild->borderSize);
- RootlessComputeClips (pChild, pScreen, &childUniverse,
- kind, exposed);
- }
- /*
- * Once the child has been processed, we remove its extents
- * from the current universe, thus denying its space to any
- * other sibling.
- */
- if (overlap)
- REGION_SUBTRACT( pScreen, universe, universe,
- &pChild->borderSize);
- }
- }
- if (!overlap)
- REGION_SUBTRACT( pScreen, universe, universe, &childUnion);
- REGION_UNINIT( pScreen, &childUnion);
- REGION_UNINIT( pScreen, &childUniverse);
- } /* if any children */
-
- /*
- * 'universe' now contains the new clipList for the parent window.
- *
- * To figure the exposure of the window we subtract the old clip from the
- * new, just as for the border.
- */
-
- if (oldVis == VisibilityFullyObscured ||
- oldVis == VisibilityNotViewable)
- {
- REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe);
- }
- else if (newVis != VisibilityFullyObscured &&
- newVis != VisibilityNotViewable)
- {
- REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed,
- universe, &pParent->clipList);
- }
-
- /*
- * One last thing: backing storage. We have to try to save what parts of
- * the window are about to be obscured. We can just subtract the universe
- * from the old clipList and get the areas that were in the old but aren't
- * in the new and, hence, are about to be obscured.
- */
- if (pParent->backStorage && !resized)
- {
- REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe);
- (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy);
- }
-
- /* HACK ALERT - copying contents of regions, instead of regions */
- {
- RegionRec tmp;
-
- tmp = pParent->clipList;
- pParent->clipList = *universe;
- *universe = tmp;
- }
-
-#ifdef NOTDEF
- REGION_COPY( pScreen, &pParent->clipList, universe);
-#endif
-
- pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pParent, dx, dy);
-}
-
-static void
-RootlessTreeObscured(pParent)
- register WindowPtr pParent;
-{
- register WindowPtr pChild;
- register int oldVis;
-
- pChild = pParent;
- while (1)
- {
- if (pChild->viewable)
- {
- oldVis = pChild->visibility;
- if (oldVis != (pChild->visibility = VisibilityFullyObscured) &&
- ((pChild->eventMask | wOtherEventMasks(pChild)) & VisibilityChangeMask))
- SendVisibilityNotify(pChild);
- if (pChild->firstChild)
- {
- pChild = pChild->firstChild;
- continue;
- }
- }
- while (!pChild->nextSib && (pChild != pParent))
- pChild = pChild->parent;
- if (pChild == pParent)
- break;
- pChild = pChild->nextSib;
- }
-}
-
-/*
- *-----------------------------------------------------------------------
- * RootlessMiValidateTree --
- * Recomputes the clip list for pParent and all its inferiors.
- *
- * Results:
- * Always returns 1.
- *
- * Side Effects:
- * The clipList, borderClip, exposed, and borderExposed regions for
- * each marked window are altered.
- *
- * Notes:
- * This routine assumes that all affected windows have been marked
- * (valdata created) and their winSize and borderSize regions
- * adjusted to correspond to their new positions. The borderClip and
- * clipList regions should not have been touched.
- *
- * The top-most level is treated differently from all lower levels
- * because pParent is unchanged. For the top level, we merge the
- * regions taken up by the marked children back into the clipList
- * for pParent, thus forming a region from which the marked children
- * can claim their areas. For lower levels, where the old clipList
- * and borderClip are invalid, we can't do this and have to do the
- * extra operations done in miComputeClips, but this is much faster
- * e.g. when only one child has moved...
- *
- *-----------------------------------------------------------------------
- */
-/*
- Quartz version: used for validate from root in rootless mode.
- We need to make sure top-level windows don't clip each other,
- and that top-level windows aren't clipped to the root window.
-*/
-/*ARGSUSED*/
-// fixme this is ugly
-// Xprint/ValTree.c doesn't work, but maybe that method can?
-int
-RootlessMiValidateTree (pRoot, pChild, kind)
- WindowPtr pRoot; /* Parent to validate */
- WindowPtr pChild; /* First child of pRoot that was
- * affected */
- VTKind kind; /* What kind of configuration caused call */
-{
- RegionRec childClip; /* The new borderClip for the current
- * child */
- RegionRec exposed; /* For intermediate calculations */
- register ScreenPtr pScreen;
- register WindowPtr pWin;
-
- pScreen = pRoot->drawable.pScreen;
- if (pChild == NullWindow)
- pChild = pRoot->firstChild;
-
- REGION_NULL(pScreen, &childClip);
- REGION_NULL(pScreen, &exposed);
-
- if (REGION_BROKEN (pScreen, &pRoot->clipList) &&
- !REGION_BROKEN (pScreen, &pRoot->borderClip))
- {
- // fixme this might not work, but hopefully doesn't happen anyway.
- kind = VTBroken;
- REGION_EMPTY (pScreen, &pRoot->clipList);
- ErrorF("ValidateTree: BUSTED!\n");
- }
-
- /*
- * Recursively compute the clips for all children of the root.
- * They don't clip against each other or the root itself, so
- * childClip is always reset to that child's size.
- */
-
- for (pWin = pChild;
- pWin != NullWindow;
- pWin = pWin->nextSib)
- {
- if (pWin->viewable) {
- if (pWin->valdata) {
- REGION_COPY( pScreen, &childClip, &pWin->borderSize);
- RootlessComputeClips (pWin, pScreen, &childClip, kind, &exposed);
- } else if (pWin->visibility == VisibilityNotViewable) {
- RootlessTreeObscured(pWin);
- }
- } else {
- if (pWin->valdata) {
- REGION_EMPTY( pScreen, &pWin->clipList);
- if (pScreen->ClipNotify)
- (* pScreen->ClipNotify) (pWin, 0, 0);
- REGION_EMPTY( pScreen, &pWin->borderClip);
- pWin->valdata = (ValidatePtr)NULL;
- }
- }
- }
-
- REGION_UNINIT(pScreen, &childClip);
-
- /* The root is never clipped by its children, so nothing on the root
- is ever exposed by moving or mapping its children. */
- REGION_NULL(pScreen, &pRoot->valdata->after.exposed);
- REGION_NULL(pScreen, &pRoot->valdata->after.borderExposed);
-
- return 1;
-}
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
deleted file mode 100644
index ac0f9f0b1..000000000
--- a/miext/rootless/rootlessWindow.c
+++ /dev/null
@@ -1,1435 +0,0 @@
-/*
- * Rootless window management
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessWindow.c,v 1.10 2003/11/13 20:26:31 torrey Exp $ */
-
-#include "rootlessCommon.h"
-#include "rootlessWindow.h"
-
-#include "fb.h"
-
-
-#ifdef ROOTLESS_GLOBAL_COORDS
-#define SCREEN_TO_GLOBAL_X \
- (dixScreenOrigins[pScreen->myNum].x + rootlessGlobalOffsetX)
-#define SCREEN_TO_GLOBAL_Y \
- (dixScreenOrigins[pScreen->myNum].y + rootlessGlobalOffsetY)
-#else
-#define SCREEN_TO_GLOBAL_X 0
-#define SCREEN_TO_GLOBAL_Y 0
-#endif
-
-
-/*
- * RootlessCreateWindow
- * For now, don't create a physical window until either the window is
- * realized, or we really need it (e.g. to attach VRAM surfaces to).
- * Do reset the window size so it's not clipped by the root window.
- */
-Bool
-RootlessCreateWindow(WindowPtr pWin)
-{
- Bool result;
- RegionRec saveRoot;
-
- WINREC(pWin) = NULL;
-
- SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow);
-
- if (!IsRoot(pWin)) {
- /* win/border size set by DIX, not by wrapped CreateWindow, so
- correct it here. Don't HUGE_ROOT when pWin is the root! */
-
- HUGE_ROOT(pWin);
- SetWinSize(pWin);
- SetBorderSize(pWin);
- }
-
- result = pWin->drawable.pScreen->CreateWindow(pWin);
-
- if (pWin->parent) {
- NORMAL_ROOT(pWin);
- }
-
- SCREEN_WRAP(pWin->drawable.pScreen, CreateWindow);
-
- return result;
-}
-
-
-/*
- * RootlessDestroyFrame
- * Destroy the physical window associated with the given window.
- */
-static void
-RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- SCREENREC(pScreen)->imp->DestroyFrame(winRec->wid);
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_UNINIT(pScreen, &winRec->damage);
-#endif
-
- xfree(winRec);
- WINREC(pWin) = NULL;
-}
-
-
-/*
- * RootlessDestroyWindow
- * Destroy the physical window associated with the given window.
- */
-Bool
-RootlessDestroyWindow(WindowPtr pWin)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- Bool result;
-
- if (winRec != NULL) {
- RootlessDestroyFrame(pWin, winRec);
- }
-
- SCREEN_UNWRAP(pWin->drawable.pScreen, DestroyWindow);
- result = pWin->drawable.pScreen->DestroyWindow(pWin);
- SCREEN_WRAP(pWin->drawable.pScreen, DestroyWindow);
-
- return result;
-}
-
-
-#ifdef SHAPE
-
-static Bool
-RootlessGetShape(WindowPtr pWin, RegionPtr pShape)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (wBoundingShape(pWin) == NULL)
- return FALSE;
-
- /* wBoundingShape is relative to *inner* origin of window.
- Translate by borderWidth to get the outside-relative position. */
-
- REGION_NULL(pScreen, pShape);
- REGION_COPY(pScreen, pShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen, pShape, pWin->borderWidth, pWin->borderWidth);
-
- return TRUE;
-}
-
-
-/*
- * RootlessReshapeFrame
- * Set the frame shape.
- */
-static void RootlessReshapeFrame(WindowPtr pWin)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec newShape;
- RegionPtr pShape;
-
- // If the window is not yet framed, do nothing
- if (winRec == NULL)
- return;
-
- if (IsRoot(pWin))
- return;
-
- RootlessStopDrawing(pWin, FALSE);
-
- pShape = RootlessGetShape(pWin, &newShape) ? &newShape : NULL;
-
-#ifdef ROOTLESSDEBUG
- RL_DEBUG_MSG("reshaping...");
- if (pShape != NULL) {
- RL_DEBUG_MSG("numrects %d, extents %d %d %d %d ",
- REGION_NUM_RECTS(&newShape),
- newShape.extents.x1, newShape.extents.y1,
- newShape.extents.x2, newShape.extents.y2);
- } else {
- RL_DEBUG_MSG("no shape ");
- }
-#endif
-
- SCREENREC(pScreen)->imp->ReshapeFrame(winRec->wid, pShape);
-
- if (pShape != NULL)
- REGION_UNINIT(pScreen, &newShape);
-}
-
-
-/*
- * RootlessSetShape
- * Shape is usually set before a window is mapped and the window will
- * not have a frame associated with it. In this case, the frame will be
- * shaped when the window is framed.
- */
-void
-RootlessSetShape(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- SCREEN_UNWRAP(pScreen, SetShape);
- pScreen->SetShape(pWin);
- SCREEN_WRAP(pScreen, SetShape);
-
- RootlessReshapeFrame(pWin);
-}
-
-#endif // SHAPE
-
-
-/* Disallow ParentRelative background on top-level windows
- because the root window doesn't really have the right background
- and fb will try to draw on the root instead of on the window.
- ParentRelative prevention is also in PaintWindowBackground/Border()
- so it is no longer really needed here. */
-Bool
-RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask)
-{
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("change window attributes start ");
-
- SCREEN_UNWRAP(pScreen, ChangeWindowAttributes);
- result = pScreen->ChangeWindowAttributes(pWin, vmask);
- SCREEN_WRAP(pScreen, ChangeWindowAttributes);
-
- if (WINREC(pWin)) {
- // disallow ParentRelative background state
- if (pWin->backgroundState == ParentRelative) {
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- }
- }
-
- RL_DEBUG_MSG("change window attributes end\n");
- return result;
-}
-
-
-/*
- * RootlessPositionWindow
- * This is a hook for when DIX moves or resizes a window.
- * Update the frame position now although the physical window is moved
- * in RootlessMoveWindow. (x, y) are *inside* position. After this,
- * mi and fb are expecting the pixmap to be at the new location.
- */
-Bool
-RootlessPositionWindow(WindowPtr pWin, int x, int y)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
- Bool result;
-
- RL_DEBUG_MSG("positionwindow start (win 0x%x @ %i, %i)\n", pWin, x, y);
-
- if (winRec) {
- if (winRec->is_drawing) {
- // Reset frame's pixmap and move it to the new position.
- int bw = wBorderWidth(pWin);
-
- winRec->pixmap->devPrivate.ptr = winRec->pixelData;
- SetPixmapBaseToScreen(winRec->pixmap, x - bw, y - bw);
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- // Move damaged region to correspond to new window position
- if (REGION_NOTEMPTY(pScreen, &winRec->damage)) {
- REGION_TRANSLATE(pScreen, &winRec->damage,
- x - bw - winRec->x,
- y - bw - winRec->y);
- }
-#endif
- }
- }
-
- SCREEN_UNWRAP(pScreen, PositionWindow);
- result = pScreen->PositionWindow(pWin, x, y);
- SCREEN_WRAP(pScreen, PositionWindow);
-
- RL_DEBUG_MSG("positionwindow end\n");
- return result;
-}
-
-
-/*
- * RootlessInitializeFrame
- * Initialize some basic attributes of the frame. Note that winRec
- * may already have valid data in it, so don't overwrite anything
- * valuable.
- */
-static void
-RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
-{
- DrawablePtr d = &pWin->drawable;
- int bw = wBorderWidth(pWin);
-
- winRec->win = pWin;
-
- winRec->x = d->x - bw;
- winRec->y = d->y - bw;
- winRec->width = d->width + 2*bw;
- winRec->height = d->height + 2*bw;
- winRec->borderWidth = bw;
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_NULL(pScreen, &winRec->damage);
-#endif
-}
-
-
-/*
- * RootlessEnsureFrame
- * Make sure the given window is framed. If the window doesn't have a
- * physical window associated with it, attempt to create one. If that
- * is unsuccessful, return NULL.
- */
-static RootlessWindowRec *
-RootlessEnsureFrame(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec;
-#ifdef SHAPE
- RegionRec shape;
- RegionPtr pShape = NULL;
-#endif
-
- if (WINREC(pWin) != NULL)
- return WINREC(pWin);
-
- if (!IsTopLevel(pWin))
- return NULL;
-
- if (pWin->drawable.class != InputOutput)
- return NULL;
-
- winRec = xalloc(sizeof(RootlessWindowRec));
-
- if (!winRec)
- return NULL;
-
- RootlessInitializeFrame(pWin, winRec);
-
- winRec->is_drawing = FALSE;
- winRec->is_reorder_pending = FALSE;
- winRec->pixmap = NULL;
- winRec->wid = NULL;
-
- WINREC(pWin) = winRec;
-
-#ifdef SHAPE
- // Set the frame's shape if the window is shaped
- if (RootlessGetShape(pWin, &shape))
- pShape = &shape;
-#endif
-
- RL_DEBUG_MSG("creating frame ");
-
- if (!SCREENREC(pScreen)->imp->CreateFrame(winRec, pScreen,
- winRec->x + SCREEN_TO_GLOBAL_X,
- winRec->y + SCREEN_TO_GLOBAL_Y,
- pShape))
- {
- RL_DEBUG_MSG("implementation failed to create frame!\n");
- xfree(winRec);
- WINREC(pWin) = NULL;
- return NULL;
- }
-
-#ifdef SHAPE
- if (pShape != NULL)
- REGION_UNINIT(pScreen, &shape);
-#endif
-
- return winRec;
-}
-
-
-/*
- * RootlessRealizeWindow
- * The frame is usually created here and not in CreateWindow so that
- * windows do not eat memory until they are realized.
- */
-Bool
-RootlessRealizeWindow(WindowPtr pWin)
-{
- Bool result;
- RegionRec saveRoot;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("realizewindow start (win 0x%x) ", pWin);
-
- if ((IsTopLevel(pWin) && pWin->drawable.class == InputOutput)) {
- RootlessWindowRec *winRec;
-
- winRec = RootlessEnsureFrame(pWin);
- if (winRec == NULL)
- return FALSE;
-
- winRec->is_reorder_pending = TRUE;
-
- RL_DEBUG_MSG("Top level window ");
-
- // Disallow ParentRelative background state on top-level windows.
- // This might have been set before the window was mapped.
- if (pWin->backgroundState == ParentRelative) {
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- }
- }
-
- if (!IsRoot(pWin)) HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, RealizeWindow);
- result = pScreen->RealizeWindow(pWin);
- SCREEN_WRAP(pScreen, RealizeWindow);
- if (!IsRoot(pWin)) NORMAL_ROOT(pWin);
-
- RL_DEBUG_MSG("realizewindow end\n");
- return result;
-}
-
-
-/*
- * RootlessFrameForWindow
- * Returns the frame ID for the physical window displaying the given window.
- * If CREATE is true and the window has no frame, attempt to create one.
- */
-RootlessFrameID
-RootlessFrameForWindow(WindowPtr pWin, Bool create)
-{
- WindowPtr pTopWin;
- RootlessWindowRec *winRec;
-
- pTopWin = TopLevelParent(pWin);
- if (pTopWin == NULL)
- return NULL;
-
- winRec = WINREC(pTopWin);
-
- if (winRec == NULL && create && pWin->drawable.class == InputOutput) {
- winRec = RootlessEnsureFrame(pTopWin);
- }
-
- if (winRec == NULL)
- return NULL;
-
- return winRec->wid;
-}
-
-
-/*
- * RootlessUnrealizeWindow
- * Unmap the physical window.
- */
-Bool
-RootlessUnrealizeWindow(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
- Bool result;
-
- RL_DEBUG_MSG("unrealizewindow start ");
-
- if (winRec) {
- RootlessStopDrawing(pWin, FALSE);
-
- SCREENREC(pScreen)->imp->UnmapFrame(winRec->wid);
-
- winRec->is_reorder_pending = FALSE;
- }
-
- SCREEN_UNWRAP(pScreen, UnrealizeWindow);
- result = pScreen->UnrealizeWindow(pWin);
- SCREEN_WRAP(pScreen, UnrealizeWindow);
-
- RL_DEBUG_MSG("unrealizewindow end\n");
- return result;
-}
-
-
-/*
- * RootlessReorderWindow
- * Reorder the window associated with the given frame so that it's
- * physically above the window below it in the X stacking order.
- */
-void
-RootlessReorderWindow(WindowPtr pWin)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
-
- if (winRec != NULL && !winRec->is_reorder_pending) {
- WindowPtr newPrevW;
- RootlessWindowRec *newPrev;
- RootlessFrameID newPrevID;
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RootlessStopDrawing(pWin, FALSE);
-
- /* Find the next window above this one that has a mapped frame. */
-
- newPrevW = pWin->prevSib;
- while (newPrevW && (WINREC(newPrevW) == NULL || !newPrevW->realized))
- newPrevW = newPrevW->prevSib;
-
- newPrev = newPrevW != NULL ? WINREC(newPrevW) : NULL;
- newPrevID = newPrev != NULL ? newPrev->wid : 0;
-
- /* If it exists, reorder the frame above us first. */
-
- if (newPrev && newPrev->is_reorder_pending) {
- newPrev->is_reorder_pending = FALSE;
- RootlessReorderWindow(newPrevW);
- }
-
- SCREENREC(pScreen)->imp->RestackFrame(winRec->wid, newPrevID);
- }
-}
-
-
-/*
- * RootlessRestackWindow
- * This is a hook for when DIX changes the window stacking order.
- * The window has already been inserted into its new position in the
- * DIX window stack. We need to change the order of the physical
- * window to match.
- */
-void
-RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
-{
- RegionRec saveRoot;
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- RL_DEBUG_MSG("restackwindow start ");
- if (winRec)
- RL_DEBUG_MSG("restack top level \n");
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, RestackWindow);
-
- if (pScreen->RestackWindow)
- pScreen->RestackWindow(pWin, pOldNextSib);
-
- SCREEN_WRAP(pScreen, RestackWindow);
- NORMAL_ROOT(pWin);
-
- if (winRec && pWin->viewable) {
- RootlessReorderWindow(pWin);
- }
-
- RL_DEBUG_MSG("restackwindow end\n");
-}
-
-
-/*
- * Specialized window copy procedures
- */
-
-// Globals needed during window resize and move.
-static pointer gResizeDeathBits = NULL;
-static int gResizeDeathCount = 0;
-static PixmapPtr gResizeDeathPix[2] = {NULL, NULL};
-static BoxRec gResizeDeathBounds[2];
-static CopyWindowProcPtr gResizeOldCopyWindowProc = NULL;
-
-/*
- * RootlessNoCopyWindow
- * CopyWindow() that doesn't do anything. For MoveWindow() of
- * top-level windows.
- */
-static void
-RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- // some code expects the region to be translated
- int dx = ptOldOrg.x - pWin->drawable.x;
- int dy = ptOldOrg.y - pWin->drawable.y;
-
- RL_DEBUG_MSG("ROOTLESSNOCOPYWINDOW ");
-
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
-}
-
-
-/*
- * RootlessResizeCopyWindow
- * CopyWindow used during ResizeWindow for gravity moves. Based on
- * fbCopyWindow. The original always draws on the root pixmap, which
- * we don't have. Instead, draw on the parent window's pixmap.
- * Resize version: the old location's pixels are in gResizeCopyWindowSource.
- */
-static void
-RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec rgnDst;
- int dx, dy;
-
- RL_DEBUG_MSG("resizecopywindowFB start (win 0x%x) ", pWin);
-
- /* Don't unwrap pScreen->CopyWindow.
- The bogus rewrap with RootlessCopyWindow causes a crash if
- CopyWindow is called again during the same resize. */
-
- if (gResizeDeathCount == 0)
- return;
-
- RootlessStartDrawing(pWin);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_NULL(pScreen, &rgnDst);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- if (gResizeDeathCount == 1) {
- /* Simple case, we only have a single source pixmap. */
-
- fbCopyRegion(&gResizeDeathPix[0]->drawable,
- &pScreen->GetWindowPixmap(pWin)->drawable, 0,
- &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
- }
- else {
- int i;
- RegionRec clip, clipped;
-
- /* More complex case, N source pixmaps (usually two). So we
- intersect the destination with each source and copy those bits. */
-
- for (i = 0; i < gResizeDeathCount; i++) {
- REGION_INIT(pScreen, &clip, gResizeDeathBounds + 0, 1);
- REGION_NULL(pScreen, &clipped);
- REGION_INTERSECT(pScreen, &rgnDst, &clip, &clipped);
-
- fbCopyRegion(&gResizeDeathPix[i]->drawable,
- &pScreen->GetWindowPixmap(pWin)->drawable, 0,
- &clipped, dx, dy, fbCopyWindowProc, 0, 0);
-
- REGION_UNINIT(pScreen, &clipped);
- REGION_UNINIT(pScreen, &clip);
- }
- }
-
- /* Don't update - resize will update everything */
- REGION_UNINIT(pScreen, &rgnDst);
-
- fbValidateDrawable(&pWin->drawable);
-
- RL_DEBUG_MSG("resizecopywindowFB end\n");
-}
-
-
-/*
- * RootlessCopyWindow
- * Update *new* location of window. Old location is redrawn with
- * PaintWindowBackground/Border. Cloned from fbCopyWindow.
- * The original always draws on the root pixmap, which we don't have.
- * Instead, draw on the parent window's pixmap.
- */
-void
-RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec rgnDst;
- int dx, dy;
- BoxPtr extents;
- int area;
-
- RL_DEBUG_MSG("copywindowFB start (win 0x%x) ", pWin);
-
- SCREEN_UNWRAP(pScreen, CopyWindow);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
-
- REGION_NULL(pScreen, &rgnDst);
- REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
-
- extents = REGION_EXTENTS(pScreen, &rgnDst);
- area = (extents->x2 - extents->x1) * (extents->y2 - extents->y1);
-
- /* If the area exceeds threshold, use the implementation's
- accelerated version. */
- if (area > rootless_CopyWindow_threshold &&
- SCREENREC(pScreen)->imp->CopyWindow)
- {
- RootlessWindowRec *winRec;
- WindowPtr top;
-
- top = TopLevelParent(pWin);
- if (top == NULL) {
- RL_DEBUG_MSG("no parent\n");
- return;
- }
-
- winRec = WINREC(top);
- if (winRec == NULL) {
- RL_DEBUG_MSG("not framed\n");
- return;
- }
-
- /* Move region to window local coords */
- REGION_TRANSLATE(pScreen, &rgnDst, -winRec->x, -winRec->y);
-
- RootlessStopDrawing(pWin, FALSE);
-
- SCREENREC(pScreen)->imp->CopyWindow(winRec->wid,
- REGION_NUM_RECTS(&rgnDst),
- REGION_RECTS(&rgnDst),
- dx, dy);
- }
- else {
- RootlessStartDrawing(pWin);
-
- fbCopyRegion((DrawablePtr) pWin, (DrawablePtr) pWin,
- 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
-
- /* prgnSrc has been translated to dst position */
- RootlessDamageRegion(pWin, prgnSrc);
- }
-
- REGION_UNINIT(pScreen, &rgnDst);
- fbValidateDrawable(&pWin->drawable);
-
- SCREEN_WRAP(pScreen, CopyWindow);
-
- RL_DEBUG_MSG("copywindowFB end\n");
-}
-
-
-/*
- * Window resize procedures
- */
-
-enum {
- WIDTH_SMALLER = 1,
- HEIGHT_SMALLER = 2,
-};
-
-
-/*
- * ResizeWeighting
- * Choose gravity to avoid local copies. Do that by looking for
- * a corner that doesn't move _relative to the screen_.
- */
-static inline unsigned int
-ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW,
- int newX1, int newY1, int newX2, int newY2, int newBW)
-{
-#ifdef ROOTLESS_RESIZE_GRAVITY
- if (newBW != oldBW)
- return RL_GRAVITY_NONE;
-
- if (newX1 == oldX1 && newY1 == oldY1)
- return RL_GRAVITY_NORTH_WEST;
- else if (newX1 == oldX1 && newY2 == oldY2)
- return RL_GRAVITY_SOUTH_WEST;
- else if (newX2 == oldX2 && newY2 == oldY2)
- return RL_GRAVITY_SOUTH_EAST;
- else if (newX2 == oldX2 && newY1 == oldY1)
- return RL_GRAVITY_NORTH_EAST;
- else
- return RL_GRAVITY_NONE;
-#else
- return RL_GRAVITY_NONE;
-#endif
-}
-
-
-/*
- * StartFrameResize
- * Prepare to resize a top-level window. The old window's pixels are
- * saved and the implementation is told to change the window size.
- * (x,y,w,h) is outer frame of window (outside border)
- */
-static Bool
-StartFrameResize(WindowPtr pWin, Bool gravity,
- int oldX, int oldY, int oldW, int oldH, int oldBW,
- int newX, int newY, int newW, int newH, int newBW)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
- Bool need_window_source = FALSE, resize_after = FALSE;
-
- BoxRec rect;
- int oldX2, newX2;
- int oldY2, newY2;
- unsigned int weight;
-
- oldX2 = oldX + oldW, newX2 = newX + newW;
- oldY2 = oldY + oldH, newY2 = newY + newH;
-
- /* Decide which resize weighting to use */
- weight = ResizeWeighting(oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
-
- /* Compute intersection between old and new rects */
- rect.x1 = max(oldX, newX);
- rect.y1 = max(oldY, newY);
- rect.x2 = min(oldX2, newX2);
- rect.y2 = min(oldY2, newY2);
-
- RL_DEBUG_MSG("RESIZE TOPLEVEL WINDOW with gravity %i ", gravity);
- RL_DEBUG_MSG("%d %d %d %d %d %d %d %d %d %d\n",
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
-
- RootlessRedisplay(pWin);
-
- /* If gravity is true, then we need to have a way of recovering all
- the original bits in the window for when X rearranges the contents
- based on the various gravity settings. The obvious way is to just
- snapshot the entire backing store before resizing it, but that
- it slow on large windows.
-
- So the optimization here is to use the implementation's resize
- weighting options (if available) to allow us to reason about what
- is left in the backing store after the resize. We can then only
- copy what won't be there after the resize, and do a two-stage copy
- operation.
-
- Most of these optimizations are only applied when the top-left
- corner of the window is fixed, since that's the common case. They
- could probably be extended with some thought. */
-
- gResizeDeathCount = 0;
-
- if (gravity && weight == RL_GRAVITY_NORTH_WEST) {
- unsigned int code = 0;
-
- /* Top left corner is anchored. We never need to copy the
- entire window. */
-
- need_window_source = TRUE;
-
- /* These comparisons were chosen to avoid setting bits when the sizes
- are the same. (So the fastest case automatically gets taken when
- dimensions are unchanging.) */
-
- if (newW < oldW)
- code |= WIDTH_SMALLER;
- if (newH < oldH)
- code |= HEIGHT_SMALLER;
-
- if (((code ^ (code >> 1)) & 1) == 0) {
- /* Both dimensions are either getting larger, or both
- are getting smaller. No need to copy anything. */
-
- if (code == (WIDTH_SMALLER | HEIGHT_SMALLER)) {
- /* Since the window is getting smaller, we can do gravity
- repair on it with it's current size, then resize it
- afterwards. */
-
- resize_after = TRUE;
- }
-
- gResizeDeathCount = 1;
- }
- else {
- unsigned int copy_rowbytes, Bpp;
- unsigned int copy_rect_width, copy_rect_height;
- BoxRec copy_rect;
-
- /* We can get away with a partial copy. 'rect' is the
- intersection between old and new bounds, so copy
- everything to the right of or below the intersection. */
-
- RootlessStartDrawing(pWin);
-
- if (code == WIDTH_SMALLER) {
- copy_rect.x1 = rect.x2;
- copy_rect.y1 = rect.y1;
- copy_rect.x2 = oldX2;
- copy_rect.y2 = oldY2;
- }
- else if (code == HEIGHT_SMALLER) {
- copy_rect.x1 = rect.x1;
- copy_rect.y1 = rect.y2;
- copy_rect.x2 = oldX2;
- copy_rect.y2 = oldY2;
- }
- else
- abort();
-
- Bpp = winRec->win->drawable.bitsPerPixel / 8;
- copy_rect_width = copy_rect.x2 - copy_rect.x1;
- copy_rect_height = copy_rect.y2 - copy_rect.y1;
- copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31;
- gResizeDeathBits = xalloc(copy_rowbytes
- * copy_rect_height);
-
- if (copy_rect_width * copy_rect_height >
- rootless_CopyBytes_threshold &&
- SCREENREC(pScreen)->imp->CopyBytes)
- {
- SCREENREC(pScreen)->imp->CopyBytes(
- copy_rect_width * Bpp, copy_rect_height,
- ((char *) winRec->pixelData)
- + ((copy_rect.y1 - oldY) * winRec->bytesPerRow)
- + (copy_rect.x1 - oldX) * Bpp, winRec->bytesPerRow,
- gResizeDeathBits, copy_rowbytes);
- } else {
- fbBlt((FbBits *) (winRec->pixelData
- + ((copy_rect.y1 - oldY) * winRec->bytesPerRow)
- + (copy_rect.x1 - oldX) * Bpp),
- winRec->bytesPerRow / sizeof(FbBits), 0,
- (FbBits *) gResizeDeathBits,
- copy_rowbytes / sizeof(FbBits), 0,
- copy_rect_width * Bpp, copy_rect_height,
- GXcopy, FB_ALLONES, Bpp, 0, 0);
- }
-
- gResizeDeathBounds[1] = copy_rect;
- gResizeDeathPix[1]
- = GetScratchPixmapHeader(pScreen, copy_rect_width,
- copy_rect_height,
- winRec->win->drawable.depth,
- winRec->win->drawable.bitsPerPixel,
- winRec->bytesPerRow,
- (void *) gResizeDeathBits);
-
- SetPixmapBaseToScreen(gResizeDeathPix[1],
- copy_rect.x1, copy_rect.y1);
-
- gResizeDeathCount = 2;
- }
- }
- else if (gravity) {
- /* The general case. Just copy everything. */
-
- RootlessStartDrawing(pWin);
-
- gResizeDeathBits = xalloc(winRec->bytesPerRow * winRec->height);
-
- memcpy(gResizeDeathBits, winRec->pixelData,
- winRec->bytesPerRow * winRec->height);
-
- gResizeDeathBounds[0] = (BoxRec) {oldX, oldY, oldX2, oldY2};
- gResizeDeathPix[0]
- = GetScratchPixmapHeader(pScreen, winRec->width,
- winRec->height,
- winRec->win->drawable.depth,
- winRec->win->drawable.bitsPerPixel,
- winRec->bytesPerRow,
- (void *) gResizeDeathBits);
-
- SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY);
- gResizeDeathCount = 1;
- }
-
- RootlessStopDrawing(pWin, FALSE);
-
- winRec->x = newX;
- winRec->y = newY;
- winRec->width = newW;
- winRec->height = newH;
- winRec->borderWidth = newBW;
-
- /* Unless both dimensions are getting smaller, Resize the frame
- before doing gravity repair */
-
- if (!resize_after) {
- SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
- newX + SCREEN_TO_GLOBAL_X,
- newY + SCREEN_TO_GLOBAL_Y,
- newW, newH, weight);
- }
-
- RootlessStartDrawing(pWin);
-
- /* If necessary, create a source pixmap pointing at the current
- window bits. */
-
- if (need_window_source) {
- gResizeDeathBounds[0] = (BoxRec) {oldX, oldY, oldX2, oldY2};
- gResizeDeathPix[0]
- = GetScratchPixmapHeader(pScreen, oldW, oldH,
- winRec->win->drawable.depth,
- winRec->win->drawable.bitsPerPixel,
- winRec->bytesPerRow, winRec->pixelData);
-
- SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY);
- }
-
- /* Use custom CopyWindow when moving gravity bits around
- ResizeWindow assumes the old window contents are in the same
- pixmap, but here they're in deathPix instead. */
-
- if (gravity) {
- gResizeOldCopyWindowProc = pScreen->CopyWindow;
- pScreen->CopyWindow = RootlessResizeCopyWindow;
- }
-
- /* If we can't rely on the window server preserving the bits we
- need in the position we need, copy the pixels in the
- intersection from src to dst. ResizeWindow assumes these pixels
- are already present when making gravity adjustments. pWin
- currently has new-sized pixmap but is in old position.
-
- FIXME: border width change! (?) */
-
- if (gravity && weight == RL_GRAVITY_NONE) {
- PixmapPtr src, dst;
-
- assert(gResizeDeathCount == 1);
-
- src = gResizeDeathPix[0];
- dst = pScreen->GetWindowPixmap(pWin);
-
- RL_DEBUG_MSG("Resize copy rect %d %d %d %d\n",
- rect.x1, rect.y1, rect.x2, rect.y2);
-
- /* rect is the intersection of the old location and new location */
- if (BOX_NOT_EMPTY(rect) && src != NULL && dst != NULL) {
- /* The window drawable still has the old frame position, which
- means that DST doesn't actually point at the origin of our
- physical backing store when adjusted by the drawable.x,y
- position. So sneakily adjust it temporarily while copying.. */
-
- ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData;
- SetPixmapBaseToScreen(dst, newX, newY);
-
- fbCopyWindowProc(&src->drawable, &dst->drawable, NULL,
- &rect, 1, 0, 0, FALSE, FALSE, 0, 0);
-
- ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData;
- SetPixmapBaseToScreen(dst, oldX, oldY);
- }
- }
-
- return resize_after;
-}
-
-
-static void
-FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY,
- unsigned int oldW, unsigned int oldH, unsigned int oldBW,
- int newX, int newY, unsigned int newW, unsigned int newH,
- unsigned int newBW, Bool resize_now)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
- BoxRec box;
- int i;
-
- RootlessStopDrawing(pWin, FALSE);
-
- if (resize_now) {
- unsigned int weight;
-
- /* We didn't resize anything earlier, so do it now, now that
- we've finished gravitating the bits. */
-
- weight = ResizeWeighting(oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
-
- SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
- newX + SCREEN_TO_GLOBAL_X,
- newY + SCREEN_TO_GLOBAL_Y,
- newW, newH, weight);
- }
-
- /* Redraw everything. FIXME: there must be times when we don't need
- to do this. Perhaps when top-left weighting and no gravity? */
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = winRec->width;
- box.y2 = winRec->height;
-
- RootlessDamageBox(pWin, &box);
-
- for (i = 0; i < 2; i++) {
- if (gResizeDeathPix[i] != NULL) {
- FreeScratchPixmapHeader(gResizeDeathPix[i]);
- gResizeDeathPix[i] = NULL;
- }
- }
-
- if (gResizeDeathBits != NULL) {
- xfree(gResizeDeathBits);
- gResizeDeathBits = NULL;
- }
-
- if (gravity) {
- pScreen->CopyWindow = gResizeOldCopyWindowProc;
- }
-}
-
-
-/*
- * RootlessMoveWindow
- * If kind==VTOther, window border is resizing (and borderWidth is
- * already changed!!@#$) This case works like window resize, not move.
- */
-void
-RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- CopyWindowProcPtr oldCopyWindowProc = NULL;
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0;
- unsigned int newW = 0, newH = 0, newBW = 0;
- Bool resize_after = FALSE;
- RegionRec saveRoot;
-
- RL_DEBUG_MSG("movewindow start \n");
-
- if (winRec) {
- if (kind == VTMove) {
- oldX = winRec->x;
- oldY = winRec->y;
- RootlessRedisplay(pWin);
- RootlessStartDrawing(pWin);
- } else {
- RL_DEBUG_MSG("movewindow border resizing ");
-
- oldBW = winRec->borderWidth;
- oldX = winRec->x;
- oldY = winRec->y;
- oldW = winRec->width;
- oldH = winRec->height;
-
- newBW = wBorderWidth(pWin);
- newX = x;
- newY = y;
- newW = pWin->drawable.width + 2*newBW;
- newH = pWin->drawable.height + 2*newBW;
-
- resize_after = StartFrameResize(pWin, FALSE,
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, MoveWindow);
-
- if (winRec) {
- oldCopyWindowProc = pScreen->CopyWindow;
- pScreen->CopyWindow = RootlessNoCopyWindow;
- }
- pScreen->MoveWindow(pWin, x, y, pSib, kind);
- if (winRec) {
- pScreen->CopyWindow = oldCopyWindowProc;
- }
-
- NORMAL_ROOT(pWin);
- SCREEN_WRAP(pScreen, MoveWindow);
-
- if (winRec) {
- if (kind == VTMove) {
- winRec->x = x;
- winRec->y = y;
- RootlessStopDrawing(pWin, FALSE);
- SCREENREC(pScreen)->imp->MoveFrame(winRec->wid, pScreen,
- x + SCREEN_TO_GLOBAL_X,
- y + SCREEN_TO_GLOBAL_Y);
- } else {
- FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW, resize_after);
- }
- }
-
- RL_DEBUG_MSG("movewindow end\n");
-}
-
-
-/*
- * RootlessResizeWindow
- * Note: (x, y, w, h) as passed to this procedure don't match the frame
- * definition. (x,y) is corner of very outer edge, *outside* border.
- * w,h is width and height *inside* border, *ignoring* border width.
- * The rect (x, y, w, h) doesn't mean anything. (x, y, w+2*bw, h+2*bw)
- * is total rect and (x+bw, y+bw, w, h) is inner rect.
- */
-void
-RootlessResizeWindow(WindowPtr pWin, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib)
-{
- RootlessWindowRec *winRec = WINREC(pWin);
- ScreenPtr pScreen = pWin->drawable.pScreen;
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0;
- Bool resize_after = FALSE;
- RegionRec saveRoot;
-
- RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin);
-
- if (winRec) {
- oldBW = winRec->borderWidth;
- oldX = winRec->x;
- oldY = winRec->y;
- oldW = winRec->width;
- oldH = winRec->height;
-
- newBW = oldBW;
- newX = x;
- newY = y;
- newW = w + 2*newBW;
- newH = h + 2*newBW;
-
- resize_after = StartFrameResize(pWin, TRUE,
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, ResizeWindow);
- pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
- SCREEN_WRAP(pScreen, ResizeWindow);
- NORMAL_ROOT(pWin);
-
- if (winRec) {
- FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW, resize_after);
- }
-
- RL_DEBUG_MSG("resizewindow end\n");
-}
-
-
-/*
- * RootlessReparentWindow
- * Called after a window has been reparented. Generally windows are not
- * framed until they are mapped. However, a window may be framed early by the
- * implementation calling RootlessFrameForWindow. (e.g. this could be needed
- * to attach a VRAM surface to it.) If the window is subsequently reparented
- * by the window manager before being mapped, we need to give the frame to
- * the new top-level window.
- */
-void
-RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RootlessWindowRec *winRec = WINREC(pWin);
- WindowPtr pTopWin;
-
- /* Check that window is not top-level now, but used to be. */
- if (IsRoot(pWin) || IsRoot(pWin->parent)
- || IsTopLevel(pWin) || winRec == NULL)
- {
- goto out;
- }
-
- /* If the formerly top-level window has a frame, we want to give the
- frame to its new top-level parent. If we can't do that, we'll just
- have to jettison it... */
-
- pTopWin = TopLevelParent(pWin);
- assert(pTopWin != pWin);
-
- if (WINREC(pTopWin) != NULL) {
- /* We're screwed. */
- RootlessDestroyFrame(pWin, winRec);
- } else {
- if (!pTopWin->realized && pWin->realized) {
- SCREENREC(pScreen)->imp->UnmapFrame(winRec->wid);
- }
-
- /* Switch the frame record from one to the other. */
-
- WINREC(pWin) = NULL;
- WINREC(pTopWin) = winRec;
-
- RootlessInitializeFrame(pTopWin, winRec);
- RootlessReshapeFrame(pTopWin);
-
- SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
- winRec->x + SCREEN_TO_GLOBAL_X,
- winRec->y + SCREEN_TO_GLOBAL_Y,
- winRec->width, winRec->height,
- RL_GRAVITY_NONE);
-
- if (SCREENREC(pScreen)->imp->SwitchWindow) {
- SCREENREC(pScreen)->imp->SwitchWindow(winRec, pWin);
- }
-
- if (pTopWin->realized && !pWin->realized)
- winRec->is_reorder_pending = TRUE;
- }
-
-out:
- if (SCREENREC(pScreen)->ReparentWindow) {
- SCREEN_UNWRAP(pScreen, ReparentWindow);
- pScreen->ReparentWindow(pWin, pPriorParent);
- SCREEN_WRAP(pScreen, ReparentWindow);
- }
-}
-
-
-/*
- * SetPixmapOfAncestors
- * Set the Pixmaps on all ParentRelative windows up the ancestor chain.
- */
-static void
-SetPixmapOfAncestors(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- WindowPtr topWin = TopLevelParent(pWin);
- RootlessWindowRec *topWinRec = WINREC(topWin);
-
- while (pWin->backgroundState == ParentRelative) {
- if (pWin == topWin) {
- // disallow ParentRelative background state on top level
- XID pixel = 0;
- ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
- RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
- break;
- }
-
- pWin = pWin->parent;
- pScreen->SetWindowPixmap(pWin, topWinRec->pixmap);
- }
-}
-
-
-/*
- * RootlessPaintWindowBackground
- */
-void
-RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- if (IsRoot(pWin))
- return;
-
- RL_DEBUG_MSG("paintwindowbackground start (win 0x%x, framed %i) ",
- pWin, IsFramedWindow(pWin));
-
- if (IsFramedWindow(pWin)) {
- RootlessStartDrawing(pWin);
- RootlessDamageRegion(pWin, pRegion);
-
- // For ParentRelative windows, we have to make sure the window
- // pixmap is set correctly all the way up the ancestor chain.
- if (pWin->backgroundState == ParentRelative) {
- SetPixmapOfAncestors(pWin);
- }
- }
-
- SCREEN_UNWRAP(pScreen, PaintWindowBackground);
- pScreen->PaintWindowBackground(pWin, pRegion, what);
- SCREEN_WRAP(pScreen, PaintWindowBackground);
-
- RL_DEBUG_MSG("paintwindowbackground end\n");
-}
-
-
-/*
- * RootlessPaintWindowBorder
- */
-void
-RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin);
-
- if (IsFramedWindow(pWin)) {
- RootlessStartDrawing(pWin);
- RootlessDamageRegion(pWin, pRegion);
-
- // For ParentRelative windows with tiled borders, we have to make
- // sure the window pixmap is set correctly all the way up the
- // ancestor chain.
- if (!pWin->borderIsPixel &&
- pWin->backgroundState == ParentRelative)
- {
- SetPixmapOfAncestors(pWin);
- }
- }
-
- SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder);
- pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what);
- SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder);
-
- RL_DEBUG_MSG("paintwindowborder end\n");
-}
-
-
-/*
- * RootlessChangeBorderWidth
- * FIXME: untested!
- * pWin inside corner stays the same; pWin->drawable.[xy] stays the same
- * Frame moves and resizes.
- */
-void
-RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
-{
- RegionRec saveRoot;
- Bool resize_after = FALSE;
-
- RL_DEBUG_MSG("change border width ");
-
- if (width != wBorderWidth(pWin)) {
- RootlessWindowRec *winRec = WINREC(pWin);
- int oldX = 0, oldY = 0, newX = 0, newY = 0;
- unsigned int oldW = 0, oldH = 0, oldBW = 0;
- unsigned int newW = 0, newH = 0, newBW = 0;
-
- if (winRec) {
- oldBW = winRec->borderWidth;
- oldX = winRec->x;
- oldY = winRec->y;
- oldW = winRec->width;
- oldH = winRec->height;
-
- newBW = width;
- newX = pWin->drawable.x - newBW;
- newY = pWin->drawable.y - newBW;
- newW = pWin->drawable.width + 2*newBW;
- newH = pWin->drawable.height + 2*newBW;
-
- resize_after = StartFrameResize(pWin, FALSE,
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
-
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pWin->drawable.pScreen, ChangeBorderWidth);
- pWin->drawable.pScreen->ChangeBorderWidth(pWin, width);
- SCREEN_WRAP(pWin->drawable.pScreen, ChangeBorderWidth);
- NORMAL_ROOT(pWin);
-
- if (winRec) {
- FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW, resize_after);
- }
- }
-
- RL_DEBUG_MSG("change border width end\n");
-}
diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h
deleted file mode 100644
index f6736f544..000000000
--- a/miext/rootless/rootlessWindow.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Rootless window management
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/rootlessWindow.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#ifndef _ROOTLESSWINDOW_H
-#define _ROOTLESSWINDOW_H
-
-#include "rootlessCommon.h"
-
-
-Bool RootlessCreateWindow(WindowPtr pWin);
-Bool RootlessDestroyWindow(WindowPtr pWin);
-
-#ifdef SHAPE
-void RootlessSetShape(WindowPtr pWin);
-#endif // SHAPE
-
-Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask);
-Bool RootlessPositionWindow(WindowPtr pWin, int x, int y);
-Bool RootlessRealizeWindow(WindowPtr pWin);
-Bool RootlessUnrealizeWindow(WindowPtr pWin);
-void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
-void RootlessCopyWindow(WindowPtr pWin,DDXPointRec ptOldOrg,RegionPtr prgnSrc);
-void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind);
-void RootlessResizeWindow(WindowPtr pWin, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib);
-void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent);
-void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion,
- int what);
-void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion,
- int what);
-void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
-
-#endif
diff --git a/miext/rootless/safeAlpha/safeAlpha.h b/miext/rootless/safeAlpha/safeAlpha.h
deleted file mode 100644
index 440a5ecc9..000000000
--- a/miext/rootless/safeAlpha/safeAlpha.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Replacement functions to protect the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/safeAlpha/safeAlpha.h,v 1.2 2003/10/18 00:00:34 torrey Exp $ */
-
-#ifndef _SAFEALPHA_H
-#define _SAFEALPHA_H
-
-#include "picturestr.h"
-#include "rootlessCommon.h"
-
-void SafeAlphaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
-#ifdef RENDER
-void
-SafeAlphaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-#endif /* RENDER */
-
-#endif /* _SAFEALPHA_H */
diff --git a/miext/rootless/safeAlpha/safeAlphaPicture.c b/miext/rootless/safeAlpha/safeAlphaPicture.c
deleted file mode 100644
index ad9360c7e..000000000
--- a/miext/rootless/safeAlpha/safeAlphaPicture.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Support for RENDER extension while protecting the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc. All Rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* This file is largely based on fbcompose.c and fbpict.c, which contain
- * the following copyright:
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- */
- /* $XFree86: xc/programs/Xserver/miext/rootless/safeAlpha/safeAlphaPicture.c,v 1.3 2003/10/24 00:33:15 torrey Exp $ */
-
-#ifdef RENDER
-
-#include "fb.h"
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-#include "safeAlpha.h"
-
-# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-
-// Replacement for fbStore_x8r8g8b8 that sets the alpha channel
-void
-SafeAlphaStore_x8r8g8b8 (FbCompositeOperand *op, CARD32 value)
-{
- FbBits *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
- ((CARD32 *)line)[offset >> 5] = (value & ~RootlessAlphaMask(32)) |
- RootlessAlphaMask(32);
-}
-
-
-// Defined in fbcompose.c
-extern FbCombineFunc fbCombineFuncU[];
-extern FbCombineFunc fbCombineFuncC[];
-
-/* A bunch of macros from fbpict.c */
-#define cvt0565to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
- ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
- ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a) << 16) | *((CARD16 *) ((a)+1))) : \
- ((*((CARD16 *) (a)) << 8) | *((a)+2)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) ((v) >> 16)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) (v))) : \
- ((*((CARD16 *) (a)) = (CARD16) ((v) >> 8)), \
- (*((a)+2) = (CARD8) (v))))
-#else
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a)) | (*((CARD16 *) ((a)+1)) << 8)) : \
- ((*((CARD16 *) (a))) | (*((a)+2) << 16)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) (v)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) ((v) >> 8))) : \
- ((*((CARD16 *) (a)) = (CARD16) (v)),\
- (*((a)+2) = (CARD8) ((v) >> 16))))
-#endif
-
-#define fbComposeGetSolid(pict, bits) { \
- FbBits *__bits__; \
- FbStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- switch (__bpp__) { \
- case 32: \
- (bits) = *(CARD32 *) __bits__; \
- break; \
- case 24: \
- (bits) = Fetch24 ((CARD8 *) __bits__); \
- break; \
- case 16: \
- (bits) = *(CARD16 *) __bits__; \
- (bits) = cvt0565to8888(bits); \
- break; \
- default: \
- return; \
- } \
- /* manage missing src alpha */ \
- if ((pict)->pFormat->direct.alphaMask == 0) \
- (bits) |= 0xff000000; \
-}
-
-#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\
- FbBits *__bits__; \
- FbStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \
- (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + (mul) * ((x) - __xoff__); \
-}
-
-
-/* Optimized version of fbCompositeSolidMask_nx8x8888 */
-void
-SafeAlphaCompositeSolidMask_nx8x8888(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- if (dstMask == FB_ALLONES && pDst->pDrawable->bitsPerPixel == 32 &&
- width * height > rootless_CompositePixels_threshold &&
- SCREENREC(pDst->pDrawable->pScreen)->imp->CompositePixels)
- {
- void *srcp[2], *destp[2];
- unsigned int dest_rowbytes[2];
- unsigned int fn;
-
- srcp[0] = &src; srcp[1] = &src;
- /* null rowbytes pointer means use first value as a constant */
- destp[0] = dstLine; destp[1] = dstLine;
- dest_rowbytes[0] = dstStride * 4; dest_rowbytes[1] = dest_rowbytes[0];
- fn = RL_COMPOSITE_FUNCTION(RL_COMPOSITE_OVER, RL_DEPTH_ARGB8888,
- RL_DEPTH_A8, RL_DEPTH_ARGB8888);
-
- if (SCREENREC(pDst->pDrawable->pScreen)->imp->CompositePixels(
- width, height, fn, srcp, NULL,
- maskLine, maskStride,
- destp, dest_rowbytes) == Success)
- {
- return;
- }
- }
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (m)
- {
- d = fbIn (src, m);
- *dst = fbOver (d, *dst) & dstMask;
- }
- dst++;
- }
- }
-}
-
-
-void
-SafeAlphaCompositeGeneral(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbCompositeOperand src[4],msk[4],dst[4],*pmsk;
- FbCompositeOperand *srcPict, *srcAlpha;
- FbCompositeOperand *dstPict, *dstAlpha;
- FbCompositeOperand *mskPict = 0, *mskAlpha = 0;
- FbCombineFunc f;
- int w;
-
- if (!fbBuildCompositeOperand (pSrc, src, xSrc, ySrc, TRUE, TRUE))
- return;
- if (!fbBuildCompositeOperand (pDst, dst, xDst, yDst, FALSE, TRUE))
- return;
-
- // Use SafeAlpha operands for on screen picture formats
- if (pDst->format == PICT_x8r8g8b8) {
- dst[0].store = SafeAlphaStore_x8r8g8b8;
- }
-
- if (pSrc->alphaMap)
- {
- srcPict = &src[1];
- srcAlpha = &src[2];
- }
- else
- {
- srcPict = &src[0];
- srcAlpha = 0;
- }
- if (pDst->alphaMap)
- {
- dstPict = &dst[1];
- dstAlpha = &dst[2];
- }
- else
- {
- dstPict = &dst[0];
- dstAlpha = 0;
- }
- f = fbCombineFuncU[op];
- if (pMask)
- {
- if (!fbBuildCompositeOperand (pMask, msk, xMask, yMask, TRUE, TRUE))
- return;
- pmsk = msk;
- if (pMask->componentAlpha)
- f = fbCombineFuncC[op];
- if (pMask->alphaMap)
- {
- mskPict = &msk[1];
- mskAlpha = &msk[2];
- }
- else
- {
- mskPict = &msk[0];
- mskAlpha = 0;
- }
- }
- else
- pmsk = 0;
- while (height--)
- {
- w = width;
-
- while (w--)
- {
- (*f) (src, pmsk, dst);
- (*src->over) (src);
- (*dst->over) (dst);
- if (pmsk)
- (*pmsk->over) (pmsk);
- }
- (*src->down) (src);
- (*dst->down) (dst);
- if (pmsk)
- (*pmsk->down) (pmsk);
- }
-}
-
-
-void
-SafeAlphaComposite(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- CompositeFunc func;
- Bool srcRepeat = pSrc->repeat;
- Bool maskRepeat = FALSE;
- Bool srcAlphaMap = pSrc->alphaMap != 0;
- Bool maskAlphaMap = FALSE;
- Bool dstAlphaMap = pDst->alphaMap != 0;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
- int w, h, w_this, h_this;
- int dstDepth = pDst->pDrawable->depth;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
- if (pMask)
- {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
- maskRepeat = pMask->repeat;
- maskAlphaMap = pMask->alphaMap != 0;
- }
-
- if (!miComputeCompositeRegion (&region,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
- return;
-
- // To preserve the alpha channel we have a special,
- // non-optimzied compositor.
- func = SafeAlphaCompositeGeneral;
-
- /*
- * We can use the more optimized fbpict code, but it sets bits above
- * the depth to zero. Temporarily adjust destination depth if needed.
- */
- if (pDst->pDrawable->type == DRAWABLE_WINDOW
- && pDst->pDrawable->depth == 24
- && pDst->pDrawable->bitsPerPixel == 32)
- {
- pDst->pDrawable->depth = 32;
- }
-
- if (!pSrc->transform && !(pMask && pMask->transform))
- if (!maskAlphaMap && !srcAlphaMap && !dstAlphaMap)
- switch (op) {
- case PictOpOver:
- if (pMask)
- {
- if (srcRepeat &&
- pSrc->pDrawable->width == 1 &&
- pSrc->pDrawable->height == 1)
- {
- srcRepeat = FALSE;
- if (PICT_FORMAT_COLOR(pSrc->format)) {
- switch (pMask->format) {
- case PICT_a8:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- func = fbCompositeSolidMask_nx8x0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- func = fbCompositeSolidMask_nx8x0888;
- break;
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = SafeAlphaCompositeSolidMask_nx8x8888;
- break;
- }
- break;
- case PICT_a8r8g8b8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a8b8g8r8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx1xn;
- break;
- }
- }
- }
- }
- }
- else
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_r8g8b8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_b8g8r8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_r5g6b5:
- switch (pDst->format) {
- case PICT_r5g6b5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- case PICT_b5g6r5:
- switch (pDst->format) {
- case PICT_b5g6r5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- }
- }
- break;
- case PictOpAdd:
- if (pMask == 0)
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8:
- switch (pDst->format) {
- case PICT_a8:
- func = fbCompositeSrcAdd_8000x8000;
- break;
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_a1:
- func = fbCompositeSrcAdd_1000x1000;
- break;
- }
- break;
- }
- }
- break;
- }
- n = REGION_NUM_RECTS (&region);
- pbox = REGION_RECTS (&region);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = mod (y_msk, pMask->pDrawable->height);
- if (h_this > pMask->pDrawable->height - y_msk)
- h_this = pMask->pDrawable->height - y_msk;
- }
- if (srcRepeat)
- {
- y_src = mod (y_src, pSrc->pDrawable->height);
- if (h_this > pSrc->pDrawable->height - y_src)
- h_this = pSrc->pDrawable->height - y_src;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = mod (x_msk, pMask->pDrawable->width);
- if (w_this > pMask->pDrawable->width - x_msk)
- w_this = pMask->pDrawable->width - x_msk;
- }
- if (srcRepeat)
- {
- x_src = mod (x_src, pSrc->pDrawable->width);
- if (w_this > pSrc->pDrawable->width - x_src)
- w_this = pSrc->pDrawable->width - x_src;
- }
- (*func) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- REGION_UNINIT (pDst->pDrawable->pScreen, &region);
-
- // Reset destination depth to its true value
- pDst->pDrawable->depth = dstDepth;
-}
-
-#endif /* RENDER */
diff --git a/miext/rootless/safeAlpha/safeAlphaWindow.c b/miext/rootless/safeAlpha/safeAlphaWindow.c
deleted file mode 100644
index 2c3761875..000000000
--- a/miext/rootless/safeAlpha/safeAlphaWindow.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Specialized window functions to protect the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-/* Portions of this file are based on fbwindow.c, which contains the
- * following copyright:
- *
- * Copyright © 1998 Keith Packard
- */
-/* $XFree86: xc/programs/Xserver/miext/rootless/safeAlpha/safeAlphaWindow.c,v 1.1 2003/09/16 00:36:20 torrey Exp $ */
-
-#include "fb.h"
-#include "safeAlpha.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-/*
- * SafeAlphaFillRegionTiled
- * Fill using a tile while leaving the alpha channel untouched.
- * Based on fbfillRegionTiled.
- */
-void
-SafeAlphaFillRegionTiled(
- DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
- int tileWidth, tileHeight;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
- int xRot = pDrawable->x;
- int yRot = pDrawable->y;
- FbBits planeMask;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- {
- int index = pDrawable->pScreen->myNum;
- if(&WindowTable[index]->drawable == pDrawable)
- {
- xRot -= panoramiXdataPtr[index].x;
- yRot -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp,
- tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- xRot += dstXoff;
- yRot += dstYoff;
- planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp);
-
- while (n--)
- {
- fbTile (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- tile,
- tileStride,
- tileWidth * dstBpp,
- tileHeight,
- GXcopy,
- planeMask,
- dstBpp,
- xRot * dstBpp,
- yRot - pbox->y1);
- pbox++;
- }
-}
-
-
-/*
- * SafeAlphaPaintWindow
- * Paint the window while filling in the alpha channel with all on.
- * We can't use fbPaintWindow because it zeros the alpha channel.
- */
-void
-SafeAlphaPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
- switch (what) {
- case PW_BACKGROUND:
-
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- SafeAlphaFillRegionTiled (&pWin->drawable,
- pRegion,
- pWin->background.pixmap);
- break;
- case BackgroundPixel:
- {
- Pixel pixel = pWin->background.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- break;
- }
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- Pixel pixel = pWin->border.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- }
- else
- {
- WindowPtr pBgWin;
- for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- SafeAlphaFillRegionTiled (&pBgWin->drawable,
- pRegion,
- pWin->border.pixmap);
- }
- break;
- }
- fbValidateDrawable (&pWin->drawable);
-}
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
deleted file mode 100644
index 38a92953f..000000000
--- a/miext/shadow/shadow.c
+++ /dev/null
@@ -1,1539 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shadow.c,v 1.15 2003/11/10 18:22:51 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-
-typedef struct _shadowGCPriv {
- GCOps *ops;
- GCFuncs *funcs;
-} shadowGCPrivRec, *shadowGCPrivPtr;
-
-int shadowScrPrivateIndex;
-int shadowGCPrivateIndex;
-int shadowGeneration;
-
-#define shadowGetGCPriv(pGC) \
- ((shadowGCPrivPtr) (pGC)->devPrivates[shadowGCPrivateIndex].ptr)
-#define shadowGCPriv(pGC) \
- shadowGCPrivPtr pGCPriv = shadowGetGCPriv(pGC)
-
-#define wrap(priv, real, mem, func) {\
- priv->mem = real->mem; \
- real->mem = func; \
-}
-
-#define unwrap(priv, real, mem) {\
- real->mem = priv->mem; \
-}
-
-static void
-shadowRedisplay (ScreenPtr pScreen)
-{
- shadowScrPriv(pScreen);
- shadowBufPtr pBuf;
-
- for (pBuf = pScrPriv->pBuf; pBuf; pBuf = pBuf->pNext)
- {
- if (REGION_NOTEMPTY (pScreen, &pBuf->damage))
- {
- REGION_INTERSECT (pScreen, &pBuf->damage, &pBuf->damage,
- &WindowTable[pScreen->myNum]->borderClip);
- (*pBuf->update) (pScreen, pBuf);
- REGION_EMPTY (pScreen, &pBuf->damage);
- }
- }
-}
-
-static void
-shadowBlockHandler (pointer data,
- OSTimePtr pTimeout,
- pointer pRead)
-{
- ScreenPtr pScreen = (ScreenPtr) data;
-
- shadowRedisplay (pScreen);
-}
-
-static void
-shadowWakeupHandler (pointer data, int i, pointer LastSelectMask)
-{
-}
-
-static void
-shadowDamageRegion (WindowPtr pWindow, RegionPtr pRegion)
-{
- shadowBufPtr pBuf = shadowFindBuf (pWindow);
-
- if (!pBuf)
- abort ();
-
- REGION_INTERSECT(pWindow->drawable.pScreen, pRegion, pRegion,
- &pWindow->borderClip);
- REGION_UNION(pWindow->drawable.pScreen, &pBuf->damage, &pBuf->damage,
- pRegion);
-#ifdef ALWAYS_DISPLAY
- shadowRedisplay (pWindow->drawable.pScreen);
-#endif
-}
-
-static void
-shadowDamageBox (WindowPtr pWindow, BoxPtr pBox)
-{
- RegionRec region;
-
- REGION_INIT (pWindow->drawable.pScreen, &region, pBox, 1);
- shadowDamageRegion (pWindow, &region);
-}
-
-static void
-shadowDamageRect (WindowPtr pWindow, int x, int y, int w, int h)
-{
- BoxRec box;
-
- x += pWindow->drawable.x;
- y += pWindow->drawable.y;
- box.x1 = x;
- box.x2 = x + w;
- box.y1 = y;
- box.y2 = y + h;
- shadowDamageBox (pWindow, &box);
-}
-
-static void shadowValidateGC(GCPtr, unsigned long, DrawablePtr);
-static void shadowChangeGC(GCPtr, unsigned long);
-static void shadowCopyGC(GCPtr, unsigned long, GCPtr);
-static void shadowDestroyGC(GCPtr);
-static void shadowChangeClip(GCPtr, int, pointer, int);
-static void shadowDestroyClip(GCPtr);
-static void shadowCopyClip(GCPtr, GCPtr);
-
-GCFuncs shadowGCFuncs = {
- shadowValidateGC, shadowChangeGC, shadowCopyGC, shadowDestroyGC,
- shadowChangeClip, shadowDestroyClip, shadowCopyClip
-};
-
-extern GCOps shadowGCOps;
-
-static Bool
-shadowCreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- shadowScrPriv(pScreen);
- shadowGCPriv(pGC);
- Bool ret;
-
- unwrap (pScrPriv, pScreen, CreateGC);
- if((ret = (*pScreen->CreateGC) (pGC))) {
- pGCPriv->ops = NULL;
- pGCPriv->funcs = pGC->funcs;
- pGC->funcs = &shadowGCFuncs;
- }
- wrap (pScrPriv, pScreen, CreateGC, shadowCreateGC);
-
- return ret;
-}
-
-void
-shadowWrapGC (GCPtr pGC)
-{
- shadowGCPriv(pGC);
-
- pGCPriv->ops = NULL;
- pGCPriv->funcs = pGC->funcs;
- pGC->funcs = &shadowGCFuncs;
-}
-
-void
-shadowUnwrapGC (GCPtr pGC)
-{
- shadowGCPriv(pGC);
-
- pGC->funcs = pGCPriv->funcs;
- if (pGCPriv->ops)
- pGC->ops = pGCPriv->ops;
-}
-
-#define SHADOW_GC_OP_PROLOGUE(pGC, pDraw) \
- shadowGCPriv(pGC); \
- GCFuncs *oldFuncs = pGC->funcs; \
- unwrap(pGCPriv, pGC, funcs); \
- unwrap(pGCPriv, pGC, ops); \
-
-#define SHADOW_GC_OP_EPILOGUE(pGC, pDraw) \
- wrap(pGCPriv, pGC, funcs, oldFuncs); \
- wrap(pGCPriv, pGC, ops, &shadowGCOps)
-
-#define SHADOW_GC_FUNC_PROLOGUE(pGC) \
- shadowGCPriv(pGC); \
- unwrap(pGCPriv, pGC, funcs); \
- if (pGCPriv->ops) unwrap(pGCPriv, pGC, ops)
-
-#define SHADOW_GC_FUNC_EPILOGUE(pGC) \
- wrap(pGCPriv, pGC, funcs, &shadowGCFuncs); \
- if (pGCPriv->ops) wrap(pGCPriv, pGC, ops, &shadowGCOps)
-
-static void
-shadowValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
- if(pDraw->type == DRAWABLE_WINDOW)
- pGCPriv->ops = pGC->ops; /* just so it's not NULL */
- else
- pGCPriv->ops = NULL;
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-shadowDestroyGC(GCPtr pGC)
-{
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->DestroyGC)(pGC);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-shadowChangeGC (
- GCPtr pGC,
- unsigned long mask
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-shadowCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-){
- SHADOW_GC_FUNC_PROLOGUE (pGCDst);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- SHADOW_GC_FUNC_EPILOGUE (pGCDst);
-}
-
-static void
-shadowChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-){
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-shadowCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- SHADOW_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- SHADOW_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-shadowDestroyClip(GCPtr pGC)
-{
- SHADOW_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-#define IS_VISIBLE(pWin) 1
-
-
-#define TRIM_BOX(box, pGC) { \
- BoxPtr extents = &pGC->pCompositeClip->extents;\
- if(box.x1 < extents->x1) box.x1 = extents->x1; \
- if(box.x2 > extents->x2) box.x2 = extents->x2; \
- if(box.y1 < extents->y1) box.y1 = extents->y1; \
- if(box.y2 > extents->y2) box.y2 = extents->y2; \
- }
-
-#define TRANSLATE_BOX(box, pDraw) { \
- box.x1 += pDraw->x; \
- box.x2 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.y2 += pDraw->y; \
- }
-
-#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
- TRANSLATE_BOX(box, pDraw); \
- TRIM_BOX(box, pGC); \
- }
-
-#define BOX_NOT_EMPTY(box) \
- (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
-
-#ifdef RENDER
-static void
-shadowComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- shadowScrPriv(pScreen);
-
- unwrap (pScrPriv, ps, Composite);
- (*ps->Composite) (op,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height);
- wrap (pScrPriv, ps, Composite, shadowComposite);
- if (pDst->pDrawable->type == DRAWABLE_WINDOW)
- shadowDamageRect ((WindowPtr) pDst->pDrawable, xDst, yDst,
- width, height);
-}
-
-static void
-shadowGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- shadowScrPriv(pScreen);
- int x, y;
- int n;
- GlyphPtr glyph;
-
- unwrap (pScrPriv, ps, Glyphs);
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
- wrap (pScrPriv, ps, Glyphs, shadowGlyphs);
- if (pDst->pDrawable->type == DRAWABLE_WINDOW)
- {
- x = xSrc;
- y = ySrc;
- while (nlist--)
- {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- while (n--)
- {
- glyph = *glyphs++;
- shadowDamageRect ((WindowPtr) pDst->pDrawable,
- x - glyph->info.x,
- y - glyph->info.y,
- glyph->info.width,
- glyph->info.height);
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- list++;
- }
- }
-}
-#endif
-
-/**********************************************************/
-
-
-static void
-shadowFillSpans(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nInit) {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nInit;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidth++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
-
- box.y2++;
-
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-
- if(!pGC->miTranslate) {
- TRANSLATE_BOX(box, pDraw);
- }
- TRIM_BOX(box, pGC);
-
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- } else
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-}
-
-static void
-shadowSetSpans(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int nspans,
- int fSorted
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nspans) {
- DDXPointPtr ppt = pptInit;
- int *pwidth = pwidthInit;
- int i = nspans;
- BoxRec box;
-
- box.x1 = ppt->x;
- box.x2 = box.x1 + *pwidth;
- box.y2 = box.y1 = ppt->y;
-
- while(--i) {
- ppt++;
- pwidth++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- if(box.x2 < (ppt->x + *pwidth))
- box.x2 = ppt->x + *pwidth;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
-
- box.y2++;
-
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
- pwidthInit, nspans, fSorted);
-
- if(!pGC->miTranslate) {
- TRANSLATE_BOX(box, pDraw);
- }
- TRIM_BOX(box, pGC);
-
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- } else
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
- pwidthInit, nspans, fSorted);
-
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-}
-
-static void
-shadowPutImage(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw)) {
- BoxRec box;
-
- box.x1 = x + pDraw->x;
- box.x2 = box.x1 + w;
- box.y1 = y + pDraw->y;
- box.y2 = box.y1 + h;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static RegionPtr
-shadowCopyArea(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- RegionPtr ret;
- SHADOW_GC_OP_PROLOGUE(pGC, pDst);
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- SHADOW_GC_OP_EPILOGUE(pGC, pDst);
-
- if(IS_VISIBLE(pDst)) {
- BoxRec box;
-
- box.x1 = dstx + pDst->x;
- box.x2 = box.x1 + width;
- box.y1 = dsty + pDst->y;
- box.y2 = box.y1 + height;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDst, &box);
- }
-
- return ret;
-}
-
-static RegionPtr
-shadowCopyPlane(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- RegionPtr ret;
- SHADOW_GC_OP_PROLOGUE(pGC, pDst);
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- SHADOW_GC_OP_EPILOGUE(pGC, pDst);
-
- if(IS_VISIBLE(pDst)) {
- BoxRec box;
-
- box.x1 = dstx + pDst->x;
- box.x2 = box.x1 + width;
- box.y1 = dsty + pDst->y;
- box.y2 = box.y1 + height;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDst, &box);
- }
-
- return ret;
-}
-
-static void
-shadowPolyPoint(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && npt) {
- BoxRec box;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- /* this could be slow if the points were spread out */
-
- while(--npt) {
- pptInit++;
- if(box.x1 > pptInit->x) box.x1 = pptInit->x;
- else if(box.x2 < pptInit->x) box.x2 = pptInit->x;
- if(box.y1 > pptInit->y) box.y1 = pptInit->y;
- else if(box.y2 < pptInit->y) box.y2 = pptInit->y;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowPolylines(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
-
- if(IS_VISIBLE(pDraw) && npt) {
- BoxRec box;
- int extra = pGC->lineWidth >> 1;
-
- box.x2 = box.x1 = pptInit->x;
- box.y2 = box.y1 = pptInit->y;
-
- if(npt > 1) {
- if(pGC->joinStyle == JoinMiter)
- extra = 6 * pGC->lineWidth;
- else if(pGC->capStyle == CapProjecting)
- extra = pGC->lineWidth;
- }
-
- if(mode == CoordModePrevious) {
- int x = box.x1;
- int y = box.y1;
- while(--npt) {
- pptInit++;
- x += pptInit->x;
- y += pptInit->y;
- if(box.x1 > x) box.x1 = x;
- else if(box.x2 < x) box.x2 = x;
- if(box.y1 > y) box.y1 = y;
- else if(box.y2 < y) box.y2 = y;
- }
- } else {
- while(--npt) {
- pptInit++;
- if(box.x1 > pptInit->x) box.x1 = pptInit->x;
- else if(box.x2 < pptInit->x) box.x2 = pptInit->x;
- if(box.y1 > pptInit->y) box.y1 = pptInit->y;
- else if(box.y2 < pptInit->y) box.y2 = pptInit->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowPolySegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nseg) {
- BoxRec box;
- int extra = pGC->lineWidth;
-
- if(pGC->capStyle != CapProjecting)
- extra >>= 1;
-
- if(pSeg->x2 > pSeg->x1) {
- box.x1 = pSeg->x1;
- box.x2 = pSeg->x2;
- } else {
- box.x2 = pSeg->x1;
- box.x1 = pSeg->x2;
- }
-
- if(pSeg->y2 > pSeg->y1) {
- box.y1 = pSeg->y1;
- box.y2 = pSeg->y2;
- } else {
- box.y2 = pSeg->y1;
- box.y1 = pSeg->y2;
- }
-
- while(--nseg) {
- pSeg++;
- if(pSeg->x2 > pSeg->x1) {
- if(pSeg->x1 < box.x1) box.x1 = pSeg->x1;
- if(pSeg->x2 > box.x2) box.x2 = pSeg->x2;
- } else {
- if(pSeg->x2 < box.x1) box.x1 = pSeg->x2;
- if(pSeg->x1 > box.x2) box.x2 = pSeg->x1;
- }
- if(pSeg->y2 > pSeg->y1) {
- if(pSeg->y1 < box.y1) box.y1 = pSeg->y1;
- if(pSeg->y2 > box.y2) box.y2 = pSeg->y2;
- } else {
- if(pSeg->y2 < box.y1) box.y1 = pSeg->y2;
- if(pSeg->y1 > box.y2) box.y2 = pSeg->y1;
- }
- }
-
- box.x2++;
- box.y2++;
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowPolyRectangle(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRects,
- xRectangle *pRects
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRects, pRects);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nRects)
- {
- BoxRec box;
- int offset1, offset2, offset3;
-
- offset2 = pGC->lineWidth;
- if(!offset2) offset2 = 1;
- offset1 = offset2 >> 1;
- offset3 = offset2 - offset1;
-
- while(nRects--)
- {
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
-
- box.x1 = pRects->x + pRects->width - offset1;
- box.y1 = pRects->y + offset3;
- box.x2 = box.x1 + offset2;
- box.y2 = box.y1 + pRects->height - offset2;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
-
- box.x1 = pRects->x - offset1;
- box.y1 = pRects->y + pRects->height - offset1;
- box.x2 = box.x1 + pRects->width + offset2;
- box.y2 = box.y1 + offset2;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
-
- pRects++;
- }
- }
- }
-
-static void
-shadowPolyArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && narcs) {
- int extra = pGC->lineWidth >> 1;
- BoxRec box;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x) box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y) box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- if(extra) {
- box.x1 -= extra;
- box.x2 += extra;
- box.y1 -= extra;
- box.y2 += extra;
- }
-
- box.x2++;
- box.y2++;
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowFillPolygon(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr pptInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && (count > 2)) {
- DDXPointPtr ppt = pptInit;
- int i = count;
- BoxRec box;
-
- box.x2 = box.x1 = ppt->x;
- box.y2 = box.y1 = ppt->y;
-
- if(mode != CoordModeOrigin) {
- int x = box.x1;
- int y = box.y1;
- while(--i) {
- ppt++;
- x += ppt->x;
- y += ppt->y;
- if(box.x1 > x) box.x1 = x;
- else if(box.x2 < x) box.x2 = x;
- if(box.y1 > y) box.y1 = y;
- else if(box.y2 < y) box.y2 = y;
- }
- } else {
- while(--i) {
- ppt++;
- if(box.x1 > ppt->x) box.x1 = ppt->x;
- else if(box.x2 < ppt->x) box.x2 = ppt->x;
- if(box.y1 > ppt->y) box.y1 = ppt->y;
- else if(box.y2 < ppt->y) box.y2 = ppt->y;
- }
- }
-
- box.x2++;
- box.y2++;
-
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- } else
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
-
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-}
-
-
-static void
-shadowPolyFillRect(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nRectsInit) {
- BoxRec box;
- xRectangle *pRects = pRectsInit;
- int nRects = nRectsInit;
-
- box.x1 = pRects->x;
- box.x2 = box.x1 + pRects->width;
- box.y1 = pRects->y;
- box.y2 = box.y1 + pRects->height;
-
- while(--nRects) {
- pRects++;
- if(box.x1 > pRects->x) box.x1 = pRects->x;
- if(box.x2 < (pRects->x + pRects->width))
- box.x2 = pRects->x + pRects->width;
- if(box.y1 > pRects->y) box.y1 = pRects->y;
- if(box.y2 < (pRects->y + pRects->height))
- box.y2 = pRects->y + pRects->height;
- }
-
- /* cfb messes with the pRectsInit so we have to do our
- calculations first */
-
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- } else
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
-
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-}
-
-
-static void
-shadowPolyFillArc(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && narcs) {
- BoxRec box;
-
- box.x1 = parcs->x;
- box.x2 = box.x1 + parcs->width;
- box.y1 = parcs->y;
- box.y2 = box.y1 + parcs->height;
-
- /* should I break these up instead ? */
-
- while(--narcs) {
- parcs++;
- if(box.x1 > parcs->x) box.x1 = parcs->x;
- if(box.x2 < (parcs->x + parcs->width))
- box.x2 = parcs->x + parcs->width;
- if(box.y1 > parcs->y) box.y1 = parcs->y;
- if(box.y2 < (parcs->y + parcs->height))
- box.y2 = parcs->y + parcs->height;
- }
-
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-
-}
-
-static int
-shadowPolyText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int width;
-
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- width = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- width -= x;
-
- if(IS_VISIBLE(pDraw) && (width > 0)) {
- BoxRec box;
-
- /* ugh */
- box.x1 = pDraw->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if(count > 1) {
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-
- return (width + x);
-}
-
-static int
-shadowPolyText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int width;
-
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- width = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- width -= x;
-
- if(IS_VISIBLE(pDraw) && (width > 0)) {
- BoxRec box;
-
- /* ugh */
- box.x1 = pDraw->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- if(count > 1) {
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-
- return (width + x);
-}
-
-static void
-shadowImageText8(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && count) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = pDraw->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-static void
-shadowImageText16(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && count) {
- int top, bot, Min, Max;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
- if(Min > 0) Min = 0;
- Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
- if(Max < 0) Max = 0;
-
- /* ugh */
- box.x1 = pDraw->x + x + Min +
- FONTMINBOUNDS(pGC->font, leftSideBearing);
- box.x2 = pDraw->x + x + Max +
- FONTMAXBOUNDS(pGC->font, rightSideBearing);
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-
-static void
-shadowImageGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, nglyph,
- ppci, pglyphBase);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nglyph) {
- int top, bot, width = 0;
- BoxRec box;
-
- top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
- bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
-
- box.x1 = ppci[0]->metrics.leftSideBearing;
- if(box.x1 > 0) box.x1 = 0;
- box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing -
- ppci[nglyph - 1]->metrics.characterWidth;
- if(box.x2 < 0) box.x2 = 0;
-
- box.x2 += pDraw->x + x;
- box.x1 += pDraw->x + x;
-
- while(nglyph--) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0)
- box.x2 += width;
- else
- box.x1 += width;
-
- box.y1 = pDraw->y + y - top;
- box.y2 = pDraw->y + y + bot;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowPolyGlyphBlt(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, nglyph,
- ppci, pglyphBase);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw) && nglyph) {
- BoxRec box;
-
- /* ugh */
- box.x1 = pDraw->x + x + ppci[0]->metrics.leftSideBearing;
- box.x2 = pDraw->x + x + ppci[nglyph - 1]->metrics.rightSideBearing;
-
- if(nglyph > 1) {
- int width = 0;
-
- while(--nglyph) {
- width += (*ppci)->metrics.characterWidth;
- ppci++;
- }
-
- if(width > 0) box.x2 += width;
- else box.x1 += width;
- }
-
- box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent);
- box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent);
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-static void
-shadowPushPixels(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- SHADOW_GC_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- SHADOW_GC_OP_EPILOGUE(pGC, pDraw);
-
- if(IS_VISIBLE(pDraw)) {
- BoxRec box;
-
- box.x1 = xOrg;
- box.y1 = yOrg;
-
- if(!pGC->miTranslate) {
- box.x1 += pDraw->x;
- box.y1 += pDraw->y;
- }
-
- box.x2 = box.x1 + dx;
- box.y2 = box.y1 + dy;
-
- TRIM_BOX(box, pGC);
- if(BOX_NOT_EMPTY(box))
- shadowDamageBox ((WindowPtr) pDraw, &box);
- }
-}
-
-
-static void
-shadowPaintWindow(
- WindowPtr pWindow,
- RegionPtr prgn,
- int what
-){
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- shadowScrPriv(pScreen);
-
- if(what == PW_BACKGROUND) {
- unwrap (pScrPriv, pScreen, PaintWindowBackground);
- (*pScreen->PaintWindowBackground) (pWindow, prgn, what);
- wrap (pScrPriv, pScreen, PaintWindowBackground, shadowPaintWindow);
- } else {
- unwrap (pScrPriv, pScreen, PaintWindowBorder);
- (*pScreen->PaintWindowBorder) (pWindow, prgn, what);
- wrap (pScrPriv, pScreen, PaintWindowBorder, shadowPaintWindow);
- }
- shadowDamageRegion (pWindow, prgn);
-}
-
-
-static void
-shadowCopyWindow(
- WindowPtr pWindow,
- DDXPointRec ptOldOrg,
- RegionPtr prgn
-){
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- shadowScrPriv(pScreen);
-
- unwrap (pScrPriv, pScreen, CopyWindow);
- (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgn);
- wrap (pScrPriv, pScreen, CopyWindow, shadowCopyWindow);
- shadowDamageRegion (pWindow, prgn);
-}
-
-GCOps shadowGCOps = {
- shadowFillSpans, shadowSetSpans,
- shadowPutImage, shadowCopyArea,
- shadowCopyPlane, shadowPolyPoint,
- shadowPolylines, shadowPolySegment,
- shadowPolyRectangle, shadowPolyArc,
- shadowFillPolygon, shadowPolyFillRect,
- shadowPolyFillArc, shadowPolyText8,
- shadowPolyText16, shadowImageText8,
- shadowImageText16, shadowImageGlyphBlt,
- shadowPolyGlyphBlt, shadowPushPixels,
-#ifdef NEED_LINEHELPER
- NULL,
-#endif
- {NULL} /* devPrivate */
-};
-
-static void
-shadowGetImage (DrawablePtr pDrawable,
- int sx,
- int sy,
- int w,
- int h,
- unsigned int format,
- unsigned long planeMask,
- char * pdstLine)
-{
- ScreenPtr pScreen = pDrawable->pScreen;
- shadowScrPriv(pScreen);
-
- /* Many apps use GetImage to sync with the visable frame buffer */
- if (pDrawable->type == DRAWABLE_WINDOW)
- shadowRedisplay (pScreen);
- unwrap (pScrPriv, pScreen, GetImage);
- (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
- wrap (pScrPriv, pScreen, GetImage, shadowGetImage);
-}
-
-static void
-shadowRestoreAreas (PixmapPtr pPixmap,
- RegionPtr prgn,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- shadowScrPriv(pScreen);
-
- unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas);
- (*pScreen->BackingStoreFuncs.RestoreAreas) (pPixmap, prgn,
- xorg, yorg, pWin);
- wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas,
- shadowRestoreAreas);
- shadowDamageRegion (pWin, prgn);
-}
-
-static Bool
-shadowCloseScreen (int i, ScreenPtr pScreen)
-{
- shadowScrPriv(pScreen);
-
- unwrap (pScrPriv, pScreen, CreateGC);
- unwrap (pScrPriv, pScreen, PaintWindowBackground);
- unwrap (pScrPriv, pScreen, PaintWindowBorder);
- unwrap (pScrPriv, pScreen, CopyWindow);
- unwrap (pScrPriv, pScreen, CloseScreen);
- unwrap (pScrPriv, pScreen, GetImage);
- unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas);
- xfree (pScrPriv);
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-Bool
-shadowSetup (ScreenPtr pScreen)
-{
- shadowScrPrivPtr pScrPriv;
-#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
-
- if (shadowGeneration != serverGeneration)
- {
- shadowScrPrivateIndex = AllocateScreenPrivateIndex ();
- if (shadowScrPrivateIndex == -1)
- return FALSE;
- shadowGCPrivateIndex = AllocateGCPrivateIndex ();
- if (shadowGCPrivateIndex == -1)
- return FALSE;
- shadowGeneration = serverGeneration;
- }
- if (!AllocateGCPrivate (pScreen, shadowGCPrivateIndex, sizeof (shadowGCPrivRec)))
- return FALSE;
- pScrPriv = (shadowScrPrivPtr) xalloc (sizeof (shadowScrPrivRec));
- if (!pScrPriv)
- return FALSE;
-
- if (!RegisterBlockAndWakeupHandlers (shadowBlockHandler,
- shadowWakeupHandler,
- (pointer) pScreen))
- return FALSE;
-
- wrap (pScrPriv, pScreen, CreateGC, shadowCreateGC);
- wrap (pScrPriv, pScreen, PaintWindowBackground, shadowPaintWindow);
- wrap (pScrPriv, pScreen, PaintWindowBorder, shadowPaintWindow);
- wrap (pScrPriv, pScreen, CopyWindow, shadowCopyWindow);
- wrap (pScrPriv, pScreen, CloseScreen, shadowCloseScreen);
- wrap (pScrPriv, pScreen, GetImage, shadowGetImage);
- wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas,
- shadowRestoreAreas);
-#ifdef RENDER
- if (ps) {
- wrap (pScrPriv, ps, Glyphs, shadowGlyphs);
- wrap (pScrPriv, ps, Composite, shadowComposite);
- }
-#endif
- pScrPriv->pBuf = 0;
-
- pScreen->devPrivates[shadowScrPrivateIndex].ptr = (pointer) pScrPriv;
- return TRUE;
-}
-
-Bool
-shadowAdd (ScreenPtr pScreen,
- PixmapPtr pPixmap,
- ShadowUpdateProc update,
- ShadowWindowProc window,
- int randr,
- void *closure)
-{
- shadowScrPriv(pScreen);
- shadowBufPtr pBuf;
-
- pBuf = (shadowBufPtr) xalloc (sizeof (shadowBufRec));
- if (!pBuf)
- return FALSE;
- /*
- * Map simple rotation values to bitmasks; fortunately,
- * these are all unique
- */
- switch (randr) {
- case 0:
- randr = SHADOW_ROTATE_0;
- break;
- case 90:
- randr = SHADOW_ROTATE_90;
- break;
- case 180:
- randr = SHADOW_ROTATE_180;
- break;
- case 270:
- randr = SHADOW_ROTATE_270;
- break;
- }
- pBuf->pPixmap = pPixmap;
- pBuf->update = update;
- pBuf->window = window;
- REGION_NULL(pScreen, &pBuf->damage);
- pBuf->pNext = pScrPriv->pBuf;
- pBuf->randr = randr;
- pBuf->closure = 0;
- pScrPriv->pBuf = pBuf;
- return TRUE;
-}
-
-void
-shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap)
-{
- shadowScrPriv(pScreen);
- shadowBufPtr pBuf, *pPrev;
-
- for (pPrev = &pScrPriv->pBuf; (pBuf = *pPrev); pPrev = &pBuf->pNext)
- if (pBuf->pPixmap == pPixmap)
- {
- REGION_UNINIT (pScreen, &pBuf->damage);
- *pPrev = pBuf->pNext;
- xfree (pBuf);
- break;
- }
-}
-
-shadowBufPtr
-shadowFindBuf (WindowPtr pWindow)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- shadowScrPriv(pScreen);
- shadowBufPtr pBuf, *pPrev;
- PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWindow);
-
- for (pPrev = &pScrPriv->pBuf; (pBuf = *pPrev); pPrev = &pBuf->pNext)
- {
- if (!pBuf->pPixmap)
- pBuf->pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
- if (pBuf->pPixmap == pPixmap)
- {
- /*
- * Reorder so this one is first next time
- */
- if (pPrev != &pScrPriv->pBuf)
- {
- *pPrev = pBuf->pNext;
- pBuf->pNext = pScrPriv->pBuf;
- pScrPriv->pBuf = pBuf;
- }
- return pBuf;
- }
- }
- return 0;
-}
-
-Bool
-shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window)
-{
- if (!shadowSetup (pScreen))
- return FALSE;
-
- if (!shadowAdd (pScreen, 0, update, window, SHADOW_ROTATE_0, 0))
- return FALSE;
-
- return TRUE;
-}
diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h
deleted file mode 100644
index d8ade93dc..000000000
--- a/miext/shadow/shadow.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shadow.h,v 1.7 2002/12/02 20:37:24 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _SHADOW_H_
-#define _SHADOW_H_
-
-#include "scrnintstr.h"
-
-#ifdef RENDER
-#include "picturestr.h"
-#endif
-
-typedef struct _shadowBuf *shadowBufPtr;
-
-typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-#define SHADOW_WINDOW_RELOCATE 1
-#define SHADOW_WINDOW_READ 2
-#define SHADOW_WINDOW_WRITE 4
-
-typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
- CARD32 row,
- CARD32 offset,
- int mode,
- CARD32 *size,
- void *closure);
-
-typedef struct _shadowBuf {
- shadowBufPtr pNext;
- ShadowUpdateProc update;
- ShadowWindowProc window;
- RegionRec damage;
- PixmapPtr pPixmap;
- void *closure;
- int randr;
-} shadowBufRec;
-
-/* Match defines from randr extension */
-#define SHADOW_ROTATE_0 1
-#define SHADOW_ROTATE_90 2
-#define SHADOW_ROTATE_180 4
-#define SHADOW_ROTATE_270 8
-#define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
- SHADOW_ROTATE_180|SHADOW_ROTATE_270)
-#define SHADOW_REFLECT_X 16
-#define SHADOW_REFLECT_Y 32
-#define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
-
-typedef struct _shadowScrPriv {
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- CloseScreenProcPtr CloseScreen;
- CreateGCProcPtr CreateGC;
- GetImageProcPtr GetImage;
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
- shadowBufPtr pBuf;
- BSFuncRec BackingStoreFuncs;
-} shadowScrPrivRec, *shadowScrPrivPtr;
-
-extern int shadowScrPrivateIndex;
-
-#define shadowGetScrPriv(pScr) ((shadowScrPrivPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr)
-#define shadowScrPriv(pScr) shadowScrPrivPtr pScrPriv = shadowGetScrPriv(pScr)
-
-Bool
-shadowSetup (ScreenPtr pScreen);
-
-Bool
-shadowAdd (ScreenPtr pScreen,
- PixmapPtr pPixmap,
- ShadowUpdateProc update,
- ShadowWindowProc window,
- int randr,
- void *closure);
-
-void
-shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
-
-shadowBufPtr
-shadowFindBuf (WindowPtr pWindow);
-
-Bool
-shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
-
-void *
-shadowAlloc (int width, int height, int bpp);
-
-void
-shadowUpdatePacked (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdatePlanar4 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdatePlanar4x8 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotatePacked (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate8_90 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate16_90 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate32_90 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate8_180 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate16_180 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate32_180 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate8_270 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate16_270 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowUpdateRotate32_270 (ScreenPtr pScreen,
- shadowBufPtr pBuf);
-
-void
-shadowWrapGC (GCPtr pGC);
-
-void
-shadowUnwrapGC (GCPtr pGC);
-
-#endif /* _SHADOW_H_ */
diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c
deleted file mode 100644
index 028ec26a5..000000000
--- a/miext/shadow/shalloc.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shalloc.c,v 1.1 2000/09/07 23:12:15 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-
-void *
-shadowAlloc (int width, int height, int bpp)
-{
- int stride;
- void *fb;
-
- /* Cant use PixmapBytePad -- the structure is probably not initialized yet */
- stride = BitmapBytePad (width * bpp);
- fb = xalloc (stride * height);
- return fb;
-}
diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
deleted file mode 100644
index 818a37a8e..000000000
--- a/miext/shadow/shpacked.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shpacked.c,v 1.5 2001/10/28 03:34:16 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-#include "fb.h"
-
-void
-shadowUpdatePacked (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- RegionPtr damage = &pBuf->damage;
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = REGION_NUM_RECTS (damage);
- BoxPtr pbox = REGION_RECTS (damage);
- FbBits *shaBase, *shaLine, *sha;
- FbStride shaStride;
- int scrBase, scrLine, scr;
- int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
- int x, y, w, h, width;
- int i;
- FbBits *winBase = NULL, *win;
- CARD32 winSize;
-
- fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
- while (nbox--)
- {
- x = pbox->x1 * shaBpp;
- y = pbox->y1;
- w = (pbox->x2 - pbox->x1) * shaBpp;
- h = pbox->y2 - pbox->y1;
-
- scrLine = (x >> FB_SHIFT);
- shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
-
- x &= FB_MASK;
- w = (w + x + FB_MASK) >> FB_SHIFT;
-
- while (h--)
- {
- winSize = 0;
- scrBase = 0;
- width = w;
- scr = scrLine;
- sha = shaLine;
- while (width) {
- /* how much remains in this window */
- i = scrBase + winSize - scr;
- if (i <= 0 || scr < scrBase)
- {
- winBase = (FbBits *) (*pBuf->window) (pScreen,
- y,
- scr * sizeof (FbBits),
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- if(!winBase)
- return;
- scrBase = scr;
- winSize /= sizeof (FbBits);
- i = winSize;
- }
- win = winBase + (scr - scrBase);
- if (i > width)
- i = width;
- width -= i;
- scr += i;
-#define PickBit(a,i) (((a) >> (i)) & 1)
- while (i--)
- *win++ = *sha++;
- }
- shaLine += shaStride;
- y++;
- }
- pbox++;
- }
-}
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
deleted file mode 100644
index 148782956..000000000
--- a/miext/shadow/shplanar.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shplanar.c,v 1.4 2001/10/28 03:34:16 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-#include "fb.h"
-
-/*
- * 32 4-bit pixels per write
- */
-
-#define PL_SHIFT 7
-#define PL_UNIT (1 << PL_SHIFT)
-#define PL_MASK (PL_UNIT - 1)
-
-/*
- * 32->8 conversion:
- *
- * 7 6 5 4 3 2 1 0
- * A B C D E F G H
- *
- * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- * m . . . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A
- * m1 G . . . F . . . E . . . D . . . C . . . B . . . A . . . . . . . m << (7 - (p))
- * m2 . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A . . (m >> (p)) << 2
- * m3 G E C A m1 & 0x80808080
- * m4 H F D B m2 & 0x40404040
- * m5 G H E F C D A B m3 | m4
- * m6 G H E F C D G H A B E F m5 | (m5 >> 20)
- * m7 G H E F C D G H A B C D E F G H m6 | (m6 >> 10)
- */
-
-#if 0
-#define GetBits(p,o,d) {\
- m = sha[o]; \
- m1 = m << (7 - (p)); \
- m2 = (m >> (p)) << 2; \
- m3 = m1 & 0x80808080; \
- m4 = m2 & 0x40404040; \
- m5 = m3 | m4; \
- m6 = m5 | (m5 >> 20); \
- d = m6 | (m6 >> 10); \
-}
-#else
-#define GetBits(p,o,d) {\
- m = sha[o]; \
- m5 = ((m << (7 - (p))) & 0x80808080) | (((m >> (p)) << 2) & 0x40404040); \
- m6 = m5 | (m5 >> 20); \
- d = m6 | (m6 >> 10); \
-}
-#endif
-
-void
-shadowUpdatePlanar4 (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- RegionPtr damage = &pBuf->damage;
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = REGION_NUM_RECTS (damage);
- BoxPtr pbox = REGION_RECTS (damage);
- CARD32 *shaBase, *shaLine, *sha;
- FbStride shaStride;
- int scrBase, scrLine, scr;
- int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
- int x, y, w, h, width;
- int i;
- CARD32 *winBase = NULL, *win;
- CARD32 winSize;
- int plane;
- CARD32 m,m5,m6;
- CARD8 s1, s2, s3, s4;
-
- fbGetStipDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
- while (nbox--)
- {
- x = (pbox->x1) * shaBpp;
- y = (pbox->y1);
- w = (pbox->x2 - pbox->x1) * shaBpp;
- h = pbox->y2 - pbox->y1;
-
- w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT;
- x &= ~PL_MASK;
-
- scrLine = (x >> PL_SHIFT);
- shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
-
- while (h--)
- {
- for (plane = 0; plane < 4; plane++)
- {
- width = w;
- scr = scrLine;
- sha = shaLine;
- winSize = 0;
- scrBase = 0;
- while (width) {
- /* how much remains in this window */
- i = scrBase + winSize - scr;
- if (i <= 0 || scr < scrBase)
- {
- winBase = (CARD32 *) (*pBuf->window) (pScreen,
- y,
- (scr << 4) | (plane),
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- if(!winBase)
- return;
- winSize >>= 2;
- scrBase = scr;
- i = winSize;
- }
- win = winBase + (scr - scrBase);
- if (i > width)
- i = width;
- width -= i;
- scr += i;
-
- while (i--)
- {
- GetBits(plane,0,s1);
- GetBits(plane,1,s2);
- GetBits(plane,2,s3);
- GetBits(plane,3,s4);
- *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- sha += 4;
- }
- }
- }
- shaLine += shaStride;
- y++;
- }
- pbox++;
- }
-}
-
diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c
deleted file mode 100644
index c82b5f931..000000000
--- a/miext/shadow/shplanar8.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shplanar8.c,v 1.4 2001/10/28 03:34:16 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-#include "fb.h"
-
-/*
- * Expose 8bpp depth 4
- */
-
-/*
- * 32->8 conversion:
- *
- * 7 6 5 4 3 2 1 0
- * A B C D E F G H
- *
- * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- * m1 D x x x x x x x C x x x x x x x B x x x x x x x A x x x x x x x sha[0] << (7-(p))
- * m2 x x x x H x x x x x x x G x x x x x x x F x x x x x x x E x x x sha[1] << (3-(p))
- * m3 D C B A m1 & 0x80808080
- * m4 H G F E m2 & 0x08080808
- * m5 D H C G B F A E m3 | m4
- * m6 D H C G B F m5 >> 9
- * m7 D H C D G H B C F G A B E F m5 | m6
- * m8 D H C D G H m7 >> 18
- * m9 D H C D G H B C D F G H A B C D E F G H m7 | m8
- */
-
-#define PL_SHIFT 8
-#define PL_UNIT (1 << PL_SHIFT)
-#define PL_MASK (PL_UNIT - 1)
-
-#if 0
-#define GetBits(p,o,d) { \
- CARD32 m1,m2,m3,m4,m5,m6,m7,m8; \
- m1 = sha[o] << (7 - (p)); \
- m2 = sha[(o)+1] << (3 - (p)); \
- m3 = m1 & 0x80808080; \
- m4 = m2 & 0x08080808; \
- m5 = m3 | m4; \
- m6 = m5 >> 9; \
- m7 = m5 | m6; \
- m8 = m7 >> 18; \
- d = m7 | m8; \
-}
-#else
-#define GetBits(p,o,d) { \
- CARD32 m5,m7; \
- m5 = ((sha[o] << (7 - (p))) & 0x80808080) | ((sha[(o)+1] << (3 - (p))) & 0x08080808); \
- m7 = m5 | (m5 >> 9); \
- d = m7 | (m7 >> 18); \
-}
-#endif
-
-void
-shadowUpdatePlanar4x8 (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- RegionPtr damage = &pBuf->damage;
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = REGION_NUM_RECTS (damage);
- BoxPtr pbox = REGION_RECTS (damage);
- CARD32 *shaBase, *shaLine, *sha;
- CARD8 s1, s2, s3, s4;
- FbStride shaStride;
- int scrBase, scrLine, scr;
- int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
- int x, y, w, h, width;
- int i;
- CARD32 *winBase = NULL, *win;
- CARD32 winSize;
- int plane;
-
- fbGetStipDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
- while (nbox--)
- {
- x = pbox->x1 * shaBpp;
- y = pbox->y1;
- w = (pbox->x2 - pbox->x1) * shaBpp;
- h = pbox->y2 - pbox->y1;
-
- w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT;
- x &= ~PL_MASK;
-
- scrLine = (x >> PL_SHIFT);
- shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
-
- while (h--)
- {
- for (plane = 0; plane < 4; plane++)
- {
- width = w;
- scr = scrLine;
- sha = shaLine;
- winSize = 0;
- scrBase = 0;
- while (width) {
- /* how much remains in this window */
- i = scrBase + winSize - scr;
- if (i <= 0 || scr < scrBase)
- {
- winBase = (CARD32 *) (*pBuf->window) (pScreen,
- y,
- (scr << 4) | (plane),
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- if(!winBase)
- return;
- winSize >>= 2;
- scrBase = scr;
- i = winSize;
- }
- win = winBase + (scr - scrBase);
- if (i > width)
- i = width;
- width -= i;
- scr += i;
-
- while (i--)
- {
- GetBits(plane,0,s1);
- GetBits(plane,2,s2);
- GetBits(plane,4,s3);
- GetBits(plane,6,s4);
- *win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- sha += 8;
- }
- }
- }
- shaLine += shaStride;
- y++;
- }
- pbox++;
- }
-}
-
diff --git a/miext/shadow/shrot16pack_180.c b/miext/shadow/shrot16pack_180.c
deleted file mode 100644
index 7ba41833e..000000000
--- a/miext/shadow/shrot16pack_180.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot16pack_180.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate16_180
-#define Data CARD16
-#define ROTATE 180
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot16pack_270.c b/miext/shadow/shrot16pack_270.c
deleted file mode 100644
index 0b3c4e0ac..000000000
--- a/miext/shadow/shrot16pack_270.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot16pack_270.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate16_270
-#define Data CARD16
-#define ROTATE 270
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot16pack_90.c b/miext/shadow/shrot16pack_90.c
deleted file mode 100644
index 574b3a157..000000000
--- a/miext/shadow/shrot16pack_90.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot16pack_90.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate16_90
-#define Data CARD16
-#define ROTATE 90
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot32pack.c b/miext/shadow/shrot32pack.c
deleted file mode 100644
index 327636efb..000000000
--- a/miext/shadow/shrot32pack.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot32pack.c,v 1.1 2000/09/08 21:46:45 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate32
-#define Data CARD32
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot32pack_180.c b/miext/shadow/shrot32pack_180.c
deleted file mode 100644
index 838622267..000000000
--- a/miext/shadow/shrot32pack_180.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot32pack_180.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate32_180
-#define Data CARD32
-#define ROTATE 180
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot32pack_270.c b/miext/shadow/shrot32pack_270.c
deleted file mode 100644
index b0dd28316..000000000
--- a/miext/shadow/shrot32pack_270.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot32pack_270.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate32_270
-#define Data CARD32
-#define ROTATE 270
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot32pack_90.c b/miext/shadow/shrot32pack_90.c
deleted file mode 100644
index 9bdb18e25..000000000
--- a/miext/shadow/shrot32pack_90.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot32pack_90.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate32_90
-#define Data CARD32
-#define ROTATE 90
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot8pack.c b/miext/shadow/shrot8pack.c
deleted file mode 100644
index 7af181f19..000000000
--- a/miext/shadow/shrot8pack.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot8pack.c,v 1.1 2000/09/08 21:46:46 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate8
-#define Data CARD8
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot8pack_180.c b/miext/shadow/shrot8pack_180.c
deleted file mode 100644
index 316c0c690..000000000
--- a/miext/shadow/shrot8pack_180.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot8pack_180.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate8_180
-#define Data CARD8
-#define ROTATE 180
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot8pack_270.c b/miext/shadow/shrot8pack_270.c
deleted file mode 100644
index bed542f6d..000000000
--- a/miext/shadow/shrot8pack_270.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot8pack_270.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate8_270
-#define Data CARD8
-#define ROTATE 270
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrot8pack_90.c b/miext/shadow/shrot8pack_90.c
deleted file mode 100644
index f2618fc47..000000000
--- a/miext/shadow/shrot8pack_90.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrot8pack_90.c,v 1.1 2001/05/29 04:54:13 keithp Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define FUNC shadowUpdateRotate8_90
-#define Data CARD8
-#define ROTATE 90
-
-#include "shrotpack.h"
diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c
deleted file mode 100644
index 1277c2ee1..000000000
--- a/miext/shadow/shrotate.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrotate.c,v 1.5 2002/10/09 17:00:11 tsi Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-#include "fb.h"
-
-/*
- * These indicate which way the source (shadow) is scanned when
- * walking the screen in a particular direction
- */
-
-#define LEFT_TO_RIGHT 1
-#define RIGHT_TO_LEFT -1
-#define TOP_TO_BOTTOM 2
-#define BOTTOM_TO_TOP -2
-
-void
-shadowUpdateRotatePacked (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- RegionPtr damage = &pBuf->damage;
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = REGION_NUM_RECTS (damage);
- BoxPtr pbox = REGION_RECTS (damage);
- FbBits *shaBits;
- FbStride shaStride;
- int shaBpp;
- int shaXoff, shaYoff;
- int box_x1, box_x2, box_y1, box_y2;
- int sha_x1 = 0, sha_y1 = 0;
- int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h;
- int scr_x, scr_y;
- int w;
- int pixelsPerBits;
- int pixelsMask;
- FbStride shaStepOverY = 0, shaStepDownY = 0;
- FbStride shaStepOverX = 0, shaStepDownX = 0;
- FbBits *shaLine, *sha;
- int shaHeight = pShadow->drawable.height;
- int shaWidth = pShadow->drawable.width;
- FbBits shaMask;
- int shaFirstShift, shaShift;
- int o_x_dir;
- int o_y_dir;
- int x_dir;
- int y_dir;
-
- fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff);
- pixelsPerBits = (sizeof (FbBits) * 8) / shaBpp;
- pixelsMask = ~(pixelsPerBits - 1);
- shaMask = FbBitsMask (FB_UNIT-shaBpp, shaBpp);
- /*
- * Compute rotation related constants to walk the shadow
- */
- o_x_dir = LEFT_TO_RIGHT;
- o_y_dir = TOP_TO_BOTTOM;
- if (pBuf->randr & SHADOW_REFLECT_X)
- o_x_dir = -o_x_dir;
- if (pBuf->randr & SHADOW_REFLECT_Y)
- o_y_dir = -o_y_dir;
- switch (pBuf->randr & (SHADOW_ROTATE_ALL)) {
- case SHADOW_ROTATE_0: /* upper left shadow -> upper left screen */
- default:
- x_dir = o_x_dir;
- y_dir = o_y_dir;
- break;
- case SHADOW_ROTATE_90: /* upper right shadow -> upper left screen */
- x_dir = o_y_dir;
- y_dir = -o_x_dir;
- break;
- case SHADOW_ROTATE_180: /* lower right shadow -> upper left screen */
- x_dir = -o_x_dir;
- y_dir = -o_y_dir;
- break;
- case SHADOW_ROTATE_270: /* lower left shadow -> upper left screen */
- x_dir = -o_y_dir;
- y_dir = o_x_dir;
- break;
- }
- switch (x_dir) {
- case LEFT_TO_RIGHT:
- shaStepOverX = shaBpp;
- shaStepOverY = 0;
- break;
- case TOP_TO_BOTTOM:
- shaStepOverX = 0;
- shaStepOverY = shaStride;
- break;
- case RIGHT_TO_LEFT:
- shaStepOverX = -shaBpp;
- shaStepOverY = 0;
- break;
- case BOTTOM_TO_TOP:
- shaStepOverX = 0;
- shaStepOverY = -shaStride;
- break;
- }
- switch (y_dir) {
- case TOP_TO_BOTTOM:
- shaStepDownX = 0;
- shaStepDownY = shaStride;
- break;
- case RIGHT_TO_LEFT:
- shaStepDownX = -shaBpp;
- shaStepDownY = 0;
- break;
- case BOTTOM_TO_TOP:
- shaStepDownX = 0;
- shaStepDownY = -shaStride;
- break;
- case LEFT_TO_RIGHT:
- shaStepDownX = shaBpp;
- shaStepDownY = 0;
- break;
- }
-
- while (nbox--)
- {
- box_x1 = pbox->x1;
- box_y1 = pbox->y1;
- box_x2 = pbox->x2;
- box_y2 = pbox->y2;
- pbox++;
-
- /*
- * Compute screen and shadow locations for this box
- */
- switch (x_dir) {
- case LEFT_TO_RIGHT:
- scr_x1 = box_x1 & pixelsMask;
- scr_x2 = (box_x2 + pixelsPerBits - 1) & pixelsMask;
-
- sha_x1 = scr_x1;
- break;
- case TOP_TO_BOTTOM:
- scr_x1 = box_y1 & pixelsMask;
- scr_x2 = (box_y2 + pixelsPerBits - 1) & pixelsMask;
-
- sha_y1 = scr_x1;
- break;
- case RIGHT_TO_LEFT:
- scr_x1 = (shaWidth - box_x2) & pixelsMask;
- scr_x2 = (shaWidth - box_x1 + pixelsPerBits - 1) & pixelsMask;
-
- sha_x1 = (shaWidth - scr_x1 - 1);
- break;
- case BOTTOM_TO_TOP:
- scr_x1 = (shaHeight - box_y2) & pixelsMask;
- scr_x2 = (shaHeight - box_y1 + pixelsPerBits - 1) & pixelsMask;
-
- sha_y1 = (shaHeight - scr_x1 - 1);
- break;
- }
- switch (y_dir) {
- case TOP_TO_BOTTOM:
- scr_y1 = box_y1;
- scr_y2 = box_y2;
-
- sha_y1 = scr_y1;
- break;
- case RIGHT_TO_LEFT:
- scr_y1 = (shaWidth - box_x2);
- scr_y2 = (shaWidth - box_x1);
-
- sha_x1 = box_x2 - 1;
- break;
- case BOTTOM_TO_TOP:
- scr_y1 = shaHeight - box_y2;
- scr_y2 = shaHeight - box_y1;
-
- sha_y1 = box_y2 - 1;
- break;
- case LEFT_TO_RIGHT:
- scr_y1 = box_x1;
- scr_y2 = box_x2;
-
- sha_x1 = box_x1;
- break;
- }
- scr_w = ((scr_x2 - scr_x1) * shaBpp) >> FB_SHIFT;
- scr_h = scr_y2 - scr_y1;
- scr_y = scr_y1;
-
- /* shift amount for first pixel on screen */
- shaFirstShift = FB_UNIT - ((sha_x1 * shaBpp) & FB_MASK) - shaBpp;
-
- /* pointer to shadow data first placed on screen */
- shaLine = (shaBits +
- sha_y1 * shaStride +
- ((sha_x1 * shaBpp) >> FB_SHIFT));
-
- /*
- * Copy the bits, always write across the physical frame buffer
- * to take advantage of write combining.
- */
- while (scr_h--)
- {
- int p;
- FbBits bits;
- FbBits *win;
- int i;
- CARD32 winSize;
-
- sha = shaLine;
- shaShift = shaFirstShift;
- w = scr_w;
- scr_x = scr_x1 * shaBpp >> FB_SHIFT;
-
- while (w)
- {
- /*
- * Map some of this line
- */
- win = (FbBits *) (*pBuf->window) (pScreen,
- scr_y,
- scr_x << 2,
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- i = (winSize >> 2);
- if (i > w)
- i = w;
- w -= i;
- scr_x += i;
- /*
- * Copy the portion of the line mapped
- */
- while (i--)
- {
- bits = 0;
- p = pixelsPerBits;
- /*
- * Build one word of output from multiple inputs
- *
- * Note that for 90/270 rotations, this will walk
- * down the shadow hitting each scanline once.
- * This is probably not very efficient.
- */
- while (p--)
- {
- bits = FbScrLeft(bits, shaBpp);
- bits |= FbScrRight (*sha, shaShift) & shaMask;
-
- shaShift -= shaStepOverX;
- if (shaShift >= FB_UNIT)
- {
- shaShift -= FB_UNIT;
- sha--;
- }
- else if (shaShift < 0)
- {
- shaShift += FB_UNIT;
- sha++;
- }
- sha += shaStepOverY;
- }
- *win++ = bits;
- }
- }
- scr_y++;
- shaFirstShift -= shaStepDownX;
- if (shaFirstShift >= FB_UNIT)
- {
- shaFirstShift -= FB_UNIT;
- shaLine--;
- }
- else if (shaFirstShift < 0)
- {
- shaFirstShift += FB_UNIT;
- shaLine++;
- }
- shaLine += shaStepDownY;
- }
- }
-}
diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h
deleted file mode 100644
index ce9b4c561..000000000
--- a/miext/shadow/shrotpack.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/miext/shadow/shrotpack.h,v 1.4 2001/10/28 03:34:16 tsi Exp $
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Thanks to Daniel Chemko <dchemko@intrinsyc.com> for making the 90 and 180
- * orientations work.
- */
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "font.h"
-#include "dixfontstr.h"
-#include "fontstruct.h"
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-#include "fb.h"
-
-#define DANDEBUG 0
-
-#if ROTATE == 270
-
-#define SCRLEFT(x,y,w,h) (pScreen->height - ((y) + (h)))
-#define SCRY(x,y,w,h) (x)
-#define SCRWIDTH(x,y,w,h) (h)
-#define FIRSTSHA(x,y,w,h) (((y) + (h) - 1) * shaStride + (x))
-#define STEPDOWN(x,y,w,h) ((w)--)
-#define NEXTY(x,y,w,h) ((x)++)
-#define SHASTEPX(stride) -(stride)
-#define SHASTEPY(stride) (1)
-
-#elif ROTATE == 90
-
-#define SCRLEFT(x,y,w,h) (y)
-#define SCRY(x,y,w,h) (pScreen->width - ((x) + (w)) - 1)
-#define SCRWIDTH(x,y,w,h) (h)
-#define FIRSTSHA(x,y,w,h) ((y) * shaStride + (x + w - 1))
-#define STEPDOWN(x,y,w,h) ((w)--)
-#define NEXTY(x,y,w,h) ((void)(x))
-#define SHASTEPX(stride) (stride)
-#define SHASTEPY(stride) (-1)
-
-#elif ROTATE == 180
-
-#define SCRLEFT(x,y,w,h) (pScreen->width - ((x) + (w)))
-#define SCRY(x,y,w,h) (pScreen->height - ((y) + (h)) - 1)
-#define SCRWIDTH(x,y,w,h) (w)
-#define FIRSTSHA(x,y,w,h) ((y + h - 1) * shaStride + (x + w - 1))
-#define STEPDOWN(x,y,w,h) ((h)--)
-#define NEXTY(x,y,w,h) ((void)(y))
-#define SHASTEPX(stride) (-1)
-#define SHASTEPY(stride) -(stride)
-
-#else
-
-#define SCRLEFT(x,y,w,h) (x)
-#define SCRY(x,y,w,h) (y)
-#define SCRWIDTH(x,y,w,h) (w)
-#define FIRSTSHA(x,y,w,h) ((y) * shaStride + (x))
-#define STEPDOWN(x,y,w,h) ((h)--)
-#define NEXTY(x,y,w,h) ((y)++)
-#define SHASTEPX(stride) (1)
-#define SHASTEPY(stride) (stride)
-
-#endif
-
-void
-FUNC (ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- RegionPtr damage = &pBuf->damage;
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = REGION_NUM_RECTS (damage);
- BoxPtr pbox = REGION_RECTS (damage);
- FbBits *shaBits;
- Data *shaBase, *shaLine, *sha;
- FbStride shaStride;
- int scrBase, scrLine, scr;
- int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
- int x, y, w, h, width;
- int i;
- Data *winBase = NULL, *win;
- CARD32 winSize;
-
- fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff);
- shaBase = (Data *) shaBits;
- shaStride = shaStride * sizeof (FbBits) / sizeof (Data);
-#if (DANDEBUG > 1)
- ErrorF ("-> Entering Shadow Update:\r\n |- Origins: pShadow=%x, pScreen=%x, damage=%x\r\n |- Metrics: shaStride=%d, shaBase=%x, shaBpp=%d\r\n | \n", pShadow, pScreen, damage, shaStride, shaBase, shaBpp);
-#endif
- while (nbox--)
- {
- x = pbox->x1;
- y = pbox->y1;
- w = (pbox->x2 - pbox->x1);
- h = pbox->y2 - pbox->y1;
-
-#if (DANDEBUG > 2)
- ErrorF (" |-> Redrawing box - Metrics: X=%d, Y=%d, Width=%d, Height=%d\n", x, y, w, h);
-#endif
- scrLine = SCRLEFT(x,y,w,h);
- shaLine = shaBase + FIRSTSHA(x,y,w,h);
-
- while (STEPDOWN(x,y,w,h))
- {
- winSize = 0;
- scrBase = 0;
- width = SCRWIDTH(x,y,w,h);
- scr = scrLine;
- sha = shaLine;
-#if (DANDEBUG > 3)
- ErrorF (" | |-> StepDown - Metrics: width=%d, scr=%x, sha=%x\n", width, scr, sha);
-#endif
- while (width)
- {
- /* how much remains in this window */
- i = scrBase + winSize - scr;
- if (i <= 0 || scr < scrBase)
- {
- winBase = (Data *) (*pBuf->window) (pScreen,
- SCRY(x,y,w,h),
- scr * sizeof (Data),
- SHADOW_WINDOW_WRITE,
- &winSize,
- pBuf->closure);
- if(!winBase)
- return;
- scrBase = scr;
- winSize /= sizeof (Data);
- i = winSize;
-#if(DANDEBUG > 4)
- ErrorF (" | | |-> Starting New Line - Metrics: winBase=%x, scrBase=%x, winSize=%d\r\n | | | Xstride=%d, Ystride=%d, w=%d h=%d\n", winBase, scrBase, winSize, SHASTEPX(shaStride), SHASTEPY(shaStride), w, h);
-#endif
- }
- win = winBase + (scr - scrBase);
- if (i > width)
- i = width;
- width -= i;
- scr += i;
-#if(DANDEBUG > 5)
- ErrorF (" | | |-> Writing Line - Metrics: win=%x, sha=%x\n", win, sha);
-#endif
- while (i--)
- {
-#if(DANDEBUG > 6)
- ErrorF (" | | |-> Writing Pixel - Metrics: win=%x, sha=%d, remaining=%d\n", win, sha, i);
-#endif
- *win++ = *sha;
- sha += SHASTEPX(shaStride);
- } /* i */
- } /* width */
- shaLine += SHASTEPY(shaStride);
- NEXTY(x,y,w,h);
- } /* STEPDOWN */
- pbox++;
- } /* nbox */
-}
diff --git a/os/WaitFor.c b/os/WaitFor.c
deleted file mode 100644
index 221296d11..000000000
--- a/os/WaitFor.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/* $XFree86: xc/programs/Xserver/os/WaitFor.c,v 3.43 2003/10/29 04:17:22 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* $Xorg: WaitFor.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
-
-/*****************************************************************
- * OS Dependent input routines:
- *
- * WaitForSomething
- * TimerForce, TimerSet, TimerCheck, TimerFree
- *
- *****************************************************************/
-
-#ifdef WIN32
-#include <X11/Xwinsock.h>
-#endif
-#include "Xos.h" /* for strings, fcntl, time */
-#include <errno.h>
-#include <stdio.h>
-#include "X.h"
-#include "misc.h"
-
-#ifdef __UNIXOS2__
-#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t)
-#endif
-#include "osdep.h"
-#include <X11/Xpoll.h>
-#include "dixstruct.h"
-#include "opaque.h"
-#ifdef DPMSExtension
-#include "dpmsproc.h"
-#endif
-
-/* modifications by raphael */
-int
-mffs(fd_mask mask)
-{
- int i;
-
- if (!mask) return 0;
- i = 1;
- while (!(mask & 1))
- {
- i++;
- mask >>= 1;
- }
- return i;
-}
-
-#ifdef DPMSExtension
-#define DPMS_SERVER
-#include "dpms.h"
-#endif
-
-#ifdef XTESTEXT1
-/*
- * defined in xtestext1dd.c
- */
-extern int playback_on;
-#endif /* XTESTEXT1 */
-
-struct _OsTimerRec {
- OsTimerPtr next;
- CARD32 expires;
- OsTimerCallback callback;
- pointer arg;
-};
-
-static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
-static OsTimerPtr timers = NULL;
-
-/*****************
- * WaitForSomething:
- * Make the server suspend until there is
- * 1. data from clients or
- * 2. input events available or
- * 3. ddx notices something of interest (graphics
- * queue ready, etc.) or
- * 4. clients that have buffered replies/events are ready
- *
- * If the time between INPUT events is
- * greater than ScreenSaverTime, the display is turned off (or
- * saved, depending on the hardware). So, WaitForSomething()
- * has to handle this also (that's why the select() has a timeout.
- * For more info on ClientsWithInput, see ReadRequestFromClient().
- * pClientsReady is an array to store ready client->index values into.
- *****************/
-
-int
-WaitForSomething(int *pClientsReady)
-{
- int i;
- struct timeval waittime, *wt;
- INT32 timeout = 0;
- fd_set clientsReadable;
- fd_set clientsWritable;
- int curclient;
- int selecterr;
- int nready;
- fd_set devicesReadable;
- CARD32 now = 0;
-#ifdef SMART_SCHEDULE
- Bool someReady = FALSE;
-#endif
-
- FD_ZERO(&clientsReadable);
-
- /* We need a while loop here to handle
- crashed connections and the screen saver timeout */
- while (1)
- {
- /* deal with any blocked jobs */
- if (workQueue)
- ProcessWorkQueue();
- if (XFD_ANYSET (&ClientsWithInput))
- {
-#ifdef SMART_SCHEDULE
- if (!SmartScheduleDisable)
- {
- someReady = TRUE;
- waittime.tv_sec = 0;
- waittime.tv_usec = 0;
- wt = &waittime;
- }
- else
-#endif
- {
- XFD_COPYSET (&ClientsWithInput, &clientsReadable);
- break;
- }
- }
-#ifdef SMART_SCHEDULE
- if (someReady)
- {
- XFD_COPYSET(&AllSockets, &LastSelectMask);
- XFD_UNSET(&LastSelectMask, &ClientsWithInput);
- }
- else
- {
-#endif
- wt = NULL;
- if (timers)
- {
- now = GetTimeInMillis();
- timeout = timers->expires - now;
- if (timeout < 0)
- timeout = 0;
- waittime.tv_sec = timeout / MILLI_PER_SECOND;
- waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
- (1000000 / MILLI_PER_SECOND);
- wt = &waittime;
- }
- XFD_COPYSET(&AllSockets, &LastSelectMask);
-#ifdef SMART_SCHEDULE
- }
- SmartScheduleIdle = TRUE;
-#endif
- BlockHandler((pointer)&wt, (pointer)&LastSelectMask);
- if (NewOutputPending)
- FlushAllOutput();
-#ifdef XTESTEXT1
- /* XXX how does this interact with new write block handling? */
- if (playback_on) {
- wt = &waittime;
- XTestComputeWaitTime (&waittime);
- }
-#endif /* XTESTEXT1 */
- /* keep this check close to select() call to minimize race */
- if (dispatchException)
- i = -1;
- else if (AnyClientsWriteBlocked)
- {
- XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable);
- i = Select (MaxClients, &LastSelectMask, &clientsWritable, NULL, wt);
- }
- else
- {
- i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt);
- }
- selecterr = errno;
- WakeupHandler(i, (pointer)&LastSelectMask);
-#ifdef XTESTEXT1
- if (playback_on) {
- i = XTestProcessInputAction (i, &waittime);
- }
-#endif /* XTESTEXT1 */
-#ifdef SMART_SCHEDULE
- if (i >= 0)
- {
- SmartScheduleIdle = FALSE;
- SmartScheduleIdleCount = 0;
- if (SmartScheduleTimerStopped)
- (void) SmartScheduleStartTimer ();
- }
-#endif
- if (i <= 0) /* An error or timeout occurred */
- {
- if (dispatchException)
- return 0;
- if (i < 0)
- {
- if (selecterr == EBADF) /* Some client disconnected */
- {
- CheckConnections ();
- if (! XFD_ANYSET (&AllClients))
- return 0;
- }
- else if (selecterr == EINVAL)
- {
- FatalError("WaitForSomething(): select: errno=%d\n",
- selecterr);
- }
- else if (selecterr != EINTR)
- {
- ErrorF("WaitForSomething(): select: errno=%d\n",
- selecterr);
- }
- }
-#ifdef SMART_SCHEDULE
- else if (someReady)
- {
- /*
- * If no-one else is home, bail quickly
- */
- XFD_COPYSET(&ClientsWithInput, &LastSelectMask);
- XFD_COPYSET(&ClientsWithInput, &clientsReadable);
- break;
- }
-#endif
- if (*checkForInput[0] != *checkForInput[1])
- return 0;
-
- if (timers)
- {
- int expired = 0;
- now = GetTimeInMillis();
- if ((int) (timers->expires - now) <= 0)
- expired = 1;
-
- while (timers && (int) (timers->expires - now) <= 0)
- DoTimer(timers, now, &timers);
-
- if (expired)
- return 0;
- }
- }
- else
- {
- fd_set tmp_set;
-
- if (*checkForInput[0] == *checkForInput[1]) {
- if (timers)
- {
- int expired = 0;
- now = GetTimeInMillis();
- if ((int) (timers->expires - now) <= 0)
- expired = 1;
-
- while (timers && (int) (timers->expires - now) <= 0)
- DoTimer(timers, now, &timers);
-
- if (expired)
- return 0;
- }
- }
-#ifdef SMART_SCHEDULE
- if (someReady)
- XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask);
-#endif
- if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable))
- {
- NewOutputPending = TRUE;
- XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending);
- XFD_UNSET(&ClientsWriteBlocked, &clientsWritable);
- if (! XFD_ANYSET(&ClientsWriteBlocked))
- AnyClientsWriteBlocked = FALSE;
- }
-
- XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices);
- XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients);
- XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections);
- if (XFD_ANYSET(&tmp_set))
- QueueWorkProc(EstablishNewConnections, NULL,
- (pointer)&LastSelectMask);
-#ifdef DPMSExtension
- if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn))
- DPMSSet(DPMSModeOn);
-#endif
- if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable))
- break;
- }
- }
-
- nready = 0;
- if (XFD_ANYSET (&clientsReadable))
- {
-#ifndef WIN32
- for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
- {
- int highest_priority = 0;
-
- while (clientsReadable.fds_bits[i])
- {
- int client_priority, client_index;
-
- curclient = ffs (clientsReadable.fds_bits[i]) - 1;
- client_index = /* raphael: modified */
- ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
-#else
- int highest_priority = 0;
- fd_set savedClientsReadable;
- XFD_COPYSET(&clientsReadable, &savedClientsReadable);
- for (i = 0; i < XFD_SETCOUNT(&savedClientsReadable); i++)
- {
- int client_priority, client_index;
-
- curclient = XFD_FD(&savedClientsReadable, i);
- client_index = ConnectionTranslation[curclient];
-#endif
-#ifdef XSYNC
- /* We implement "strict" priorities.
- * Only the highest priority client is returned to
- * dix. If multiple clients at the same priority are
- * ready, they are all returned. This means that an
- * aggressive client could take over the server.
- * This was not considered a big problem because
- * aggressive clients can hose the server in so many
- * other ways :)
- */
- client_priority = clients[client_index]->priority;
- if (nready == 0 || client_priority > highest_priority)
- {
- /* Either we found the first client, or we found
- * a client whose priority is greater than all others
- * that have been found so far. Either way, we want
- * to initialize the list of clients to contain just
- * this client.
- */
- pClientsReady[0] = client_index;
- highest_priority = client_priority;
- nready = 1;
- }
- /* the following if makes sure that multiple same-priority
- * clients get batched together
- */
- else if (client_priority == highest_priority)
-#endif
- {
- pClientsReady[nready++] = client_index;
- }
-#ifndef WIN32
- clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient);
- }
-#else
- FD_CLR(curclient, &clientsReadable);
-#endif
- }
- }
- return nready;
-}
-
-#if 0
-/*
- * This is not always a macro.
- */
-ANYSET(FdMask *src)
-{
- int i;
-
- for (i=0; i<mskcnt; i++)
- if (src[ i ])
- return (TRUE);
- return (FALSE);
-}
-#endif
-
-
-static void
-DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
-{
- CARD32 newTime;
-
- *prev = timer->next;
- timer->next = NULL;
- newTime = (*timer->callback)(timer, now, timer->arg);
- if (newTime)
- TimerSet(timer, 0, newTime, timer->callback, timer->arg);
-}
-
-OsTimerPtr
-TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
- OsTimerCallback func, pointer arg)
-{
- register OsTimerPtr *prev;
- CARD32 now = GetTimeInMillis();
-
- if (!timer)
- {
- timer = (OsTimerPtr)xalloc(sizeof(struct _OsTimerRec));
- if (!timer)
- return NULL;
- }
- else
- {
- for (prev = &timers; *prev; prev = &(*prev)->next)
- {
- if (*prev == timer)
- {
- *prev = timer->next;
- if (flags & TimerForceOld)
- (void)(*timer->callback)(timer, now, timer->arg);
- break;
- }
- }
- }
- if (!millis)
- return timer;
- if (!(flags & TimerAbsolute))
- millis += now;
- timer->expires = millis;
- timer->callback = func;
- timer->arg = arg;
- if ((int) (millis - now) <= 0)
- {
- timer->next = NULL;
- millis = (*timer->callback)(timer, now, timer->arg);
- if (!millis)
- return timer;
- }
- for (prev = &timers;
- *prev && (int) ((*prev)->expires - millis) <= 0;
- prev = &(*prev)->next)
- ;
- timer->next = *prev;
- *prev = timer;
- return timer;
-}
-
-Bool
-TimerForce(OsTimerPtr timer)
-{
- OsTimerPtr *prev;
-
- for (prev = &timers; *prev; prev = &(*prev)->next)
- {
- if (*prev == timer)
- {
- DoTimer(timer, GetTimeInMillis(), prev);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-void
-TimerCancel(OsTimerPtr timer)
-{
- OsTimerPtr *prev;
-
- if (!timer)
- return;
- for (prev = &timers; *prev; prev = &(*prev)->next)
- {
- if (*prev == timer)
- {
- *prev = timer->next;
- break;
- }
- }
-}
-
-void
-TimerFree(OsTimerPtr timer)
-{
- if (!timer)
- return;
- TimerCancel(timer);
- xfree(timer);
-}
-
-void
-TimerCheck(void)
-{
- CARD32 now = GetTimeInMillis();
-
- while (timers && (int) (timers->expires - now) <= 0)
- DoTimer(timers, now, &timers);
-}
-
-void
-TimerInit(void)
-{
- OsTimerPtr timer;
-
- while ((timer = timers))
- {
- timers = timer->next;
- xfree(timer);
- }
-}
-
-static CARD32
-ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
- INT32 timeout = now - lastDeviceEventTime.milliseconds;
-
- if (timeout < ScreenSaverTime) {
- return ScreenSaverTime - timeout;
- }
-
- ResetOsBuffers(); /* not ideal, but better than nothing */
- SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive);
-
-#ifdef DPMSExtension
- if (ScreenSaverInterval > 0 && DPMSPowerLevel == DPMSModeOn)
-#else
- if (ScreenSaverInterval > 0)
-#endif /* DPMSExtension */
- return ScreenSaverInterval;
-
- return 0;
-}
-
-static OsTimerPtr ScreenSaverTimer = NULL;
-
-void
-FreeScreenSaverTimer(void)
-{
- if (ScreenSaverTimer) {
- TimerFree(ScreenSaverTimer);
- ScreenSaverTimer = NULL;
- }
-}
-
-void
-SetScreenSaverTimer(void)
-{
- if (ScreenSaverTime > 0) {
- ScreenSaverTimer = TimerSet(ScreenSaverTimer, 0, ScreenSaverTime,
- ScreenSaverTimeoutExpire, NULL);
- } else if (ScreenSaverTimer) {
- FreeScreenSaverTimer();
- }
-}
-
-#ifdef DPMSExtension
-
-static OsTimerPtr DPMSStandbyTimer = NULL;
-static OsTimerPtr DPMSSuspendTimer = NULL;
-static OsTimerPtr DPMSOffTimer = NULL;
-
-static CARD32
-DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
- INT32 timeout = now - lastDeviceEventTime.milliseconds;
-
- if (timeout < DPMSStandbyTime) {
- return DPMSStandbyTime - timeout;
- }
- if (DPMSPowerLevel < DPMSModeStandby) {
- DPMSSet(DPMSModeStandby);
- }
- return DPMSStandbyTime;
-}
-
-static CARD32
-DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
- INT32 timeout = now - lastDeviceEventTime.milliseconds;
-
- if (timeout < DPMSSuspendTime) {
- return DPMSSuspendTime - timeout;
- }
- if (DPMSPowerLevel < DPMSModeSuspend) {
- DPMSSet(DPMSModeSuspend);
- }
- return DPMSSuspendTime;
-}
-
-static CARD32
-DPMSOffTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
- INT32 timeout = now - lastDeviceEventTime.milliseconds;
-
- if (timeout < DPMSOffTime) {
- return DPMSOffTime - timeout;
- }
- if (DPMSPowerLevel < DPMSModeOff) {
- DPMSSet(DPMSModeOff);
- }
- return DPMSOffTime;
-}
-
-void
-FreeDPMSTimers(void)
-{
- if (DPMSStandbyTimer) {
- TimerFree(DPMSStandbyTimer);
- DPMSStandbyTimer = NULL;
- }
- if (DPMSSuspendTimer) {
- TimerFree(DPMSSuspendTimer);
- DPMSSuspendTimer = NULL;
- }
- if (DPMSOffTimer) {
- TimerFree(DPMSOffTimer);
- DPMSOffTimer = NULL;
- }
-}
-
-void
-SetDPMSTimers(void)
-{
- if (!DPMSEnabled)
- return;
-
- if (DPMSStandbyTime > 0) {
- DPMSStandbyTimer = TimerSet(DPMSStandbyTimer, 0, DPMSStandbyTime,
- DPMSStandbyTimerExpire, NULL);
- }
- if (DPMSSuspendTime > 0) {
- DPMSSuspendTimer = TimerSet(DPMSSuspendTimer, 0, DPMSSuspendTime,
- DPMSSuspendTimerExpire, NULL);
- }
- if (DPMSOffTime > 0) {
- DPMSOffTimer = TimerSet(DPMSOffTimer, 0, DPMSOffTime,
- DPMSOffTimerExpire, NULL);
- }
-}
-#endif
diff --git a/os/access.c b/os/access.c
deleted file mode 100644
index 77dcebe20..000000000
--- a/os/access.c
+++ /dev/null
@@ -1,1708 +0,0 @@
-/* $Xorg: access.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/os/access.c,v 3.50 2003/11/03 05:12:00 tsi Exp $ */
-
-#ifdef WIN32
-#include <X11/Xwinsock.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <X11/Xtrans.h>
-#include <X11/Xauth.h>
-#include <X.h>
-#include <Xproto.h>
-#include "misc.h"
-#include "site.h"
-#include <errno.h>
-#include <sys/types.h>
-#ifndef WIN32
-#ifndef Lynx
-#include <sys/socket.h>
-#else
-#include <socket.h>
-#endif
-#include <sys/ioctl.h>
-#include <ctype.h>
-
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(ISC) || defined(SCO)
-#include <netinet/in.h>
-#endif /* TCPCONN || STREAMSCONN || ISC || SCO */
-#ifdef DNETCONN
-#include <netdnet/dn.h>
-#include <netdnet/dnetdb.h>
-#endif
-
-
-#if defined(DGUX)
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <ctype.h>
-#include <sys/utsname.h>
-#include <sys/stream.h>
-#include <sys/stropts.h>
-#include <sys/param.h>
-#include <sys/sockio.h>
-#endif
-
-
-#if defined(hpux) || defined(QNX4)
-# include <sys/utsname.h>
-# ifdef HAS_IFREQ
-# include <net/if.h>
-# endif
-#else
-#if defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__GNU__)
-# include <sys/utsname.h>
-#endif
-#if defined(SYSV) && defined(i386)
-# include <sys/stream.h>
-# ifdef ISC
-# include <sys/stropts.h>
-# include <sys/sioctl.h>
-# endif /* ISC */
-#endif
-#ifdef __GNU__
-#undef SIOCGIFCONF
-#include <netdb.h>
-#else /*!__GNU__*/
-# include <net/if.h>
-#endif /*__GNU__ */
-#endif /* hpux */
-
-#ifdef SVR4
-#ifndef SCO
-#include <sys/sockio.h>
-#endif
-#include <sys/stropts.h>
-#endif
-
-#include <netdb.h>
-
-#ifdef CSRG_BASED
-#include <sys/param.h>
-#if (BSD >= 199103)
-#define VARIABLE_IFREQ
-#endif
-#endif
-
-#ifdef BSD44SOCKETS
-#ifndef VARIABLE_IFREQ
-#define VARIABLE_IFREQ
-#endif
-#endif
-
-#ifdef HAS_GETIFADDRS
-#include <ifaddrs.h>
-#endif
-
-/* Solaris provides an extended interface SIOCGLIFCONF. Other systems
- * may have this as well, but the code has only been tested on Solaris
- * so far, so we only enable it there. Other platforms may be added as
- * needed.
- *
- * Test for Solaris commented out -- TSI @ UQV 2003.06.13
- */
-#ifdef SIOCGLIFCONF
-/* #if defined(sun) */
-#define USE_SIOCGLIFCONF
-/* #endif */
-#endif
-
-#endif /* WIN32 */
-
-#ifndef PATH_MAX
-#ifndef Lynx
-#include <sys/param.h>
-#else
-#include <param.h>
-#endif
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif
-
-#define X_INCLUDE_NETDB_H
-#include <X11/Xos_r.h>
-
-#include "dixstruct.h"
-#include "osdep.h"
-
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "extensions/security.h"
-#endif
-
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
-Bool defeatAccessControl = FALSE;
-
-#define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len)
-#define acopy(a1, a2, len) memmove((char *)(a2), (char *)(a1), len)
-#define addrEqual(fam, address, length, host) \
- ((fam) == (host)->family &&\
- (length) == (host)->len &&\
- !acmp (address, (host)->addr, length))
-
-static int ConvertAddr(struct sockaddr */*saddr*/,
- int */*len*/,
- pointer */*addr*/);
-
-static int CheckAddr(int /*family*/,
- pointer /*pAddr*/,
- unsigned /*length*/);
-
-static Bool NewHost(int /*family*/,
- pointer /*addr*/,
- int /*len*/,
- int /* addingLocalHosts */);
-
-/* XFree86 bug #156: To keep track of which hosts were explicitly requested in
- /etc/X<display>.hosts, we've added a requested field to the HOST struct,
- and a LocalHostRequested variable. These default to FALSE, but are set
- to TRUE in ResetHosts when reading in /etc/X<display>.hosts. They are
- checked in DisableLocalHost(), which is called to disable the default
- local host entries when stronger authentication is turned on. */
-
-typedef struct _host {
- short family;
- short len;
- unsigned char *addr;
- struct _host *next;
- int requested;
-} HOST;
-
-#define MakeHost(h,l) (h)=(HOST *) xalloc(sizeof *(h)+(l));\
- if (h) { \
- (h)->addr=(unsigned char *) ((h) + 1);\
- (h)->requested = FALSE; \
- }
-#define FreeHost(h) xfree(h)
-static HOST *selfhosts = NULL;
-static HOST *validhosts = NULL;
-static int AccessEnabled = DEFAULT_ACCESS_CONTROL;
-static int LocalHostEnabled = FALSE;
-static int LocalHostRequested = FALSE;
-static int UsingXdmcp = FALSE;
-
-
-/*
- * called when authorization is not enabled to add the
- * local host to the access list
- */
-
-void
-EnableLocalHost (void)
-{
- if (!UsingXdmcp)
- {
- LocalHostEnabled = TRUE;
- AddLocalHosts ();
- }
-}
-
-/*
- * called when authorization is enabled to keep us secure
- */
-void
-DisableLocalHost (void)
-{
- HOST *self;
-
- if (!LocalHostRequested) /* Fix for XFree86 bug #156 */
- LocalHostEnabled = FALSE;
- for (self = selfhosts; self; self = self->next) {
- if (!self->requested) /* Fix for XFree86 bug #156 */
- (void) RemoveHost ((ClientPtr)NULL, self->family, self->len, (pointer)self->addr);
- }
-}
-
-/*
- * called at init time when XDMCP will be used; xdmcp always
- * adds local hosts manually when needed
- */
-
-void
-AccessUsingXdmcp (void)
-{
- UsingXdmcp = TRUE;
- LocalHostEnabled = FALSE;
-}
-
-
-#if ((defined(SVR4) && !defined(DGUX) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
-
-/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
-
-static int
-ifioctl (int fd, int cmd, char *arg)
-{
- struct strioctl ioc;
- int ret;
-
- bzero((char *) &ioc, sizeof(ioc));
- ioc.ic_cmd = cmd;
- ioc.ic_timout = 0;
- if (cmd == SIOCGIFCONF)
- {
- ioc.ic_len = ((struct ifconf *) arg)->ifc_len;
- ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf;
-#ifdef ISC
- /* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
- * buffer must contain the ifconf structure as header. Ifc_req
- * is also not a pointer but a one element array of ifreq
- * structures. On return this array is extended by enough
- * ifreq fields to hold all interfaces. The return buffer length
- * is placed in the buffer header.
- */
- ((struct ifconf *) ioc.ic_dp)->ifc_len =
- ioc.ic_len - sizeof(struct ifconf);
-#endif
- }
- else
- {
- ioc.ic_len = sizeof(struct ifreq);
- ioc.ic_dp = arg;
- }
- ret = ioctl(fd, I_STR, (char *) &ioc);
- if (ret >= 0 && cmd == SIOCGIFCONF)
-#ifdef SVR4
- ((struct ifconf *) arg)->ifc_len = ioc.ic_len;
-#endif
-#ifdef ISC
- {
- ((struct ifconf *) arg)->ifc_len =
- ((struct ifconf *)ioc.ic_dp)->ifc_len;
- ((struct ifconf *) arg)->ifc_buf =
- (caddr_t)((struct ifconf *)ioc.ic_dp)->ifc_req;
- }
-#endif
- return(ret);
-}
-#else /* Case DGUX, sun, SCO325 NCR and others */
-#define ifioctl ioctl
-#endif /* ((SVR4 && !DGUX !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */
-
-/*
- * DefineSelf (fd):
- *
- * Define this host for access control. Find all the hosts the OS knows about
- * for this fd and add them to the selfhosts list.
- */
-
-#ifdef WINTCP /* NCR Wollongong based TCP */
-
-#include <sys/un.h>
-#include <stropts.h>
-#include <tiuser.h>
-
-#include <sys/stream.h>
-#include <net/if.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-
-void
-DefineSelf (int fd)
-{
- /*
- * The Wolongong drivers used by NCR SVR4/MP-RAS don't understand the
- * socket IO calls that most other drivers seem to like. Because of
- * this, this routine must be special cased for NCR. Eventually,
- * this will be cleared up.
- */
-
- struct ipb ifnet;
- struct in_ifaddr ifaddr;
- struct strioctl str;
- unsigned char *addr;
- register HOST *host;
- int family, len;
-
- if ((fd = open ("/dev/ip", O_RDWR, 0 )) < 0)
- Error ("Getting interface configuration (1)");
-
- /* Indicate that we want to start at the begining */
- ifnet.ib_next = (struct ipb *) 1;
-
- while (ifnet.ib_next)
- {
- str.ic_cmd = IPIOC_GETIPB;
- str.ic_timout = 0;
- str.ic_len = sizeof (struct ipb);
- str.ic_dp = (char *) &ifnet;
-
- if (ioctl (fd, (int) I_STR, (char *) &str) < 0)
- {
- close (fd);
- Error ("Getting interface configuration (2)");
- }
-
- ifaddr.ia_next = (struct in_ifaddr *) ifnet.if_addrlist;
- str.ic_cmd = IPIOC_GETINADDR;
- str.ic_timout = 0;
- str.ic_len = sizeof (struct in_ifaddr);
- str.ic_dp = (char *) &ifaddr;
-
- if (ioctl (fd, (int) I_STR, (char *) &str) < 0)
- {
- close (fd);
- Error ("Getting interface configuration (3)");
- }
-
- len = sizeof(struct sockaddr_in);
- family = ConvertAddr (IA_SIN(&ifaddr), &len, (pointer *)&addr);
- if (family == -1 || family == FamilyLocal)
- continue;
- for (host = selfhosts;
- host && !addrEqual (family, addr, len, host);
- host = host->next)
- ;
- if (host)
- continue;
- MakeHost(host,len)
- if (host)
- {
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
- }
-#ifdef XDMCP
- {
- struct sockaddr broad_addr;
-
- /*
- * If this isn't an Internet Address, don't register it.
- */
- if (family != FamilyInternet)
- continue;
-
- /*
- * ignore 'localhost' entries as they're not useful
- * on the other end of the wire
- */
- if (len == 4 &&
- addr[0] == 127 && addr[1] == 0 &&
- addr[2] == 0 && addr[3] == 1)
- continue;
-
- XdmcpRegisterConnection (family, (char *)addr, len);
-
-
-#define IA_BROADADDR(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_broadaddr))
-
- XdmcpRegisterBroadcastAddress (
- (struct sockaddr_in *) IA_BROADADDR(&ifaddr));
-
-#undef IA_BROADADDR
- }
-#endif /* XDMCP */
- }
-
- close(fd);
-
- /*
- * add something of FamilyLocalHost
- */
- for (host = selfhosts;
- host && !addrEqual(FamilyLocalHost, "", 0, host);
- host = host->next);
- if (!host)
- {
- MakeHost(host, 0);
- if (host)
- {
- host->family = FamilyLocalHost;
- host->len = 0;
- acopy("", host->addr, 0);
- host->next = selfhosts;
- selfhosts = host;
- }
- }
-}
-
-#else /* WINTCP */
-
-#if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ)) || defined(QNX4)
-void
-DefineSelf (int fd)
-{
-#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) && !defined(MNX_TCPCONN)
- return;
-#else
- register int n;
- int len;
- caddr_t addr;
- int family;
- register HOST *host;
-
- struct utsname name;
- register struct hostent *hp;
-
- union {
- struct sockaddr sa;
- struct sockaddr_in in;
-#if defined(IPv6) && defined(AF_INET6)
- struct sockaddr_in6 in6;
-#endif
- } saddr;
-
- struct sockaddr_in *inetaddr;
- struct sockaddr_in6 *inet6addr;
- struct sockaddr_in broad_addr;
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
-#endif
-
- /* Why not use gethostname()? Well, at least on my system, I've had to
- * make an ugly kernel patch to get a name longer than 8 characters, and
- * uname() lets me access to the whole string (it smashes release, you
- * see), whereas gethostname() kindly truncates it for me.
- */
-#ifndef QNX4
- uname(&name);
-#else
- /* QNX4's uname returns node number in name.nodename, not the hostname
- have to overwrite it */
- char hname[1024];
- gethostname(hname, 1024);
- name.nodename = hname;
-#endif
-
- hp = _XGethostbyname(name.nodename, hparams);
- if (hp != NULL)
- {
- saddr.sa.sa_family = hp->h_addrtype;
- switch (hp->h_addrtype) {
- case AF_INET:
- inetaddr = (struct sockaddr_in *) (&(saddr.sa));
- acopy ( hp->h_addr, &(inetaddr->sin_addr), hp->h_length);
- len = sizeof(saddr.sa);
- break;
-#if defined(IPv6) && defined(AF_INET6)
- case AF_INET6:
- inet6addr = (struct sockaddr_in6 *) (&(saddr.sa));
- acopy ( hp->h_addr, &(inet6addr->sin6_addr), hp->h_length);
- len = sizeof(saddr.in6);
- break;
-#endif
- default:
- goto DefineLocalHost;
- }
- family = ConvertAddr ( &(saddr.sa), &len, (pointer *)&addr);
- if ( family != -1 && family != FamilyLocal )
- {
- for (host = selfhosts;
- host && !addrEqual (family, addr, len, host);
- host = host->next) ;
- if (!host)
- {
- /* add this host to the host list. */
- MakeHost(host,len)
- if (host)
- {
- host->family = family;
- host->len = len;
- acopy ( addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
- }
-#ifdef XDMCP
- /*
- * If this is an Internet Address, but not the localhost
- * address (127.0.0.1), register it.
- */
- if (family == FamilyInternet &&
- !(len == 4 && addr[0] == 127 && addr[1] == 0 &&
- addr[2] == 0 && addr[3] == 1)
- )
- {
- XdmcpRegisterConnection (family, (char *)addr, len);
- broad_addr = *inetaddr;
- ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr =
- htonl (INADDR_BROADCAST);
- XdmcpRegisterBroadcastAddress ((struct sockaddr_in *)
- &broad_addr);
- }
-#if defined(IPv6) && defined(AF_INET6)
- else if (family == FamilyInternet6 &&
- !(IN6_IS_ADDR_LOOPBACK((struct in6_addr *)addr)))
- {
- XdmcpRegisterConnection (family, (char *)addr, len);
- }
-#endif
-
-#endif /* XDMCP */
- }
- }
- }
- /*
- * now add a host of family FamilyLocalHost...
- */
-DefineLocalHost:
- for (host = selfhosts;
- host && !addrEqual(FamilyLocalHost, "", 0, host);
- host = host->next);
- if (!host)
- {
- MakeHost(host, 0);
- if (host)
- {
- host->family = FamilyLocalHost;
- host->len = 0;
- acopy("", host->addr, 0);
- host->next = selfhosts;
- selfhosts = host;
- }
- }
-#endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN && !MNX_TCPCONN */
-}
-
-#else
-
-#ifdef USE_SIOCGLIFCONF
-#define ifr_type struct lifreq
-#else
-#define ifr_type struct ifreq
-#endif
-
-#ifdef VARIABLE_IFREQ
-#define ifr_size(p) (sizeof (struct ifreq) + \
- (p->ifr_addr.sa_len > sizeof (p->ifr_addr) ? \
- p->ifr_addr.sa_len - sizeof (p->ifr_addr) : 0))
-#define ifraddr_size(a) (a.sa_len)
-#else
-#ifdef QNX4
-#define ifr_size(p) (p->ifr_addr.sa_len + IFNAMSIZ)
-#define ifraddr_size(a) (a.sa_len)
-#else
-#define ifr_size(p) (sizeof (ifr_type))
-#define ifraddr_size(a) (sizeof (a))
-#endif
-#endif
-
-#ifdef DEF_SELF_DEBUG
-#include <arpa/inet.h>
-#endif
-
-void
-DefineSelf (int fd)
-{
-#ifndef HAS_GETIFADDRS
- char buf[2048], *cp, *cplim;
- void * bufptr = buf;
-#ifdef USE_SIOCGLIFCONF
- struct lifconf ifc;
- register struct lifreq *ifr;
-#ifdef SIOCGLIFNUM
- struct lifnum ifn;
-#endif
-#else
- struct ifconf ifc;
- register struct ifreq *ifr;
-#endif
-#else
- struct ifaddrs * ifap, *ifr;
-#endif
- int len;
- unsigned char * addr;
- int family;
- register HOST *host;
-
-#ifdef DNETCONN
- struct dn_naddr *dnaddr = getnodeadd();
- /*
- * AF_DECnet may not be listed in the interface list. Instead use
- * the supported library call to find out the local address (if any).
- */
- if (dnaddr)
- {
- addr = (unsigned char *) dnaddr;
- len = dnaddr->a_len + sizeof(dnaddr->a_len);
- family = FamilyDECnet;
- for (host = selfhosts;
- host && !addrEqual (family, addr, len, host);
- host = host->next)
- ;
- if (!host)
- {
- MakeHost(host,len)
- if (host)
- {
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
- }
- }
- }
-#endif /* DNETCONN */
-#ifndef HAS_GETIFADDRS
-
- len = sizeof(buf);
-
-#ifdef USE_SIOCGLIFCONF
-
-#ifdef SIOCGLIFNUM
- ifn.lifn_family = AF_UNSPEC;
- ifn.lifn_flags = 0;
- if (ioctl (fd, SIOCGLIFNUM, (char *) &ifn) < 0)
- Error ("Getting interface count");
- if (len < (ifn.lifn_count * sizeof(struct lifreq))) {
- len = ifn.lifn_count * sizeof(struct lifreq);
- bufptr = xalloc(len);
- }
-#endif
-
- ifc.lifc_family = AF_UNSPEC;
- ifc.lifc_flags = 0;
- ifc.lifc_len = len;
- ifc.lifc_buf = bufptr;
-
-#define IFC_IOCTL_REQ SIOCGLIFCONF
-#define IFC_IFC_REQ ifc.lifc_req
-#define IFC_IFC_LEN ifc.lifc_len
-#define IFR_IFR_ADDR ifr->lifr_addr
-#define IFR_IFR_NAME ifr->lifr_name
-
-#else /* Use SIOCGIFCONF */
- ifc.ifc_len = len;
- ifc.ifc_buf = bufptr;
-
-#define IFC_IOCTL_REQ SIOCGIFCONF
-#ifdef ISC
-#define IFC_IFC_REQ (struct ifreq *) ifc.ifc_buf
-#else
-#define IFC_IFC_REQ ifc.ifc_req
-#endif /* ISC */
-#define IFC_IFC_LEN ifc.ifc_len
-#define IFR_IFR_ADDR ifr->ifr_addr
-#define IFR_IFR_NAME ifr->ifr_name
-#endif
-
- if (ifioctl (fd, IFC_IOCTL_REQ, (pointer) &ifc) < 0)
- Error ("Getting interface configuration (4)");
-
- cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN;
-
- for (cp = (char *) IFC_IFC_REQ; cp < cplim; cp += ifr_size (ifr))
- {
- ifr = (ifr_type *) cp;
- len = ifraddr_size (IFR_IFR_ADDR);
- family = ConvertAddr ((struct sockaddr *) &IFR_IFR_ADDR,
- &len, (pointer *)&addr);
-#ifdef DNETCONN
- /*
- * DECnet was handled up above.
- */
- if (family == AF_DECnet)
- continue;
-#endif /* DNETCONN */
- if (family == -1 || family == FamilyLocal)
- continue;
-#ifdef DEF_SELF_DEBUG
- if (family == FamilyInternet)
- ErrorF("Xserver: DefineSelf(): ifname = %s, addr = %d.%d.%d.%d\n",
- IFR_IFR_NAME, addr[0], addr[1], addr[2], addr[3]);
-#if defined(IPv6) && defined(AF_INET6)
- else if (family == FamilyInternet6) {
- char cp[INET6_ADDRSTRLEN] = "";
- inet_ntop(AF_INET6, addr, cp, sizeof(cp));
- ErrorF("Xserver: DefineSelf(): ifname = %s, addr = %s\n",
- IFR_IFR_NAME, cp);
- }
-#endif
-#endif /* DEF_SELF_DEBUG */
- for (host = selfhosts;
- host && !addrEqual (family, addr, len, host);
- host = host->next)
- ;
- if (host)
- continue;
- MakeHost(host,len)
- if (host)
- {
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
- }
-#ifdef XDMCP
- {
-#ifdef USE_SIOCGLIFCONF
- struct sockaddr_storage broad_addr;
-#else
- struct sockaddr broad_addr;
-#endif
-
- /*
- * If this isn't an Internet Address, don't register it.
- */
- if (family != FamilyInternet
-#if defined(IPv6) && defined(AF_INET6)
- && family != FamilyInternet6
-#endif
- )
- continue;
-
- /*
- * ignore 'localhost' entries as they're not useful
- * on the other end of the wire
- */
- if (family == FamilyInternet &&
- addr[0] == 127 && addr[1] == 0 &&
- addr[2] == 0 && addr[3] == 1)
- continue;
-#if defined(IPv6) && defined(AF_INET6)
- else if (family == FamilyInternet6 &&
- IN6_IS_ADDR_LOOPBACK((struct in6_addr *)addr))
- continue;
-#endif
-
- XdmcpRegisterConnection (family, (char *)addr, len);
-
-#if defined(IPv6) && defined(AF_INET6)
- /* IPv6 doesn't support broadcasting, so we drop out here */
- if (family == FamilyInternet6)
- continue;
-#endif
-
- broad_addr = IFR_IFR_ADDR;
-
- ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr =
- htonl (INADDR_BROADCAST);
-#if defined(USE_SIOCGLIFCONF) && defined(SIOCGLIFBRDADDR)
- {
- struct lifreq broad_req;
-
- broad_req = *ifr;
- if (ioctl (fd, SIOCGLIFFLAGS, (char *) &broad_req) != -1 &&
- (broad_req.lifr_flags & IFF_BROADCAST) &&
- (broad_req.lifr_flags & IFF_UP)
- )
- {
- broad_req = *ifr;
- if (ioctl (fd, SIOCGLIFBRDADDR, &broad_req) != -1)
- broad_addr = broad_req.lifr_broadaddr;
- else
- continue;
- }
- else
- continue;
- }
-
-#elif defined(SIOCGIFBRDADDR)
- {
- struct ifreq broad_req;
-
- broad_req = *ifr;
- if (ifioctl (fd, SIOCGIFFLAGS, (pointer) &broad_req) != -1 &&
- (broad_req.ifr_flags & IFF_BROADCAST) &&
- (broad_req.ifr_flags & IFF_UP)
- )
- {
- broad_req = *ifr;
- if (ifioctl (fd, SIOCGIFBRDADDR, (pointer) &broad_req) != -1)
- broad_addr = broad_req.ifr_addr;
- else
- continue;
- }
- else
- continue;
- }
-#endif /* SIOCGIFBRDADDR */
-#ifdef DEF_SELF_DEBUG
- ErrorF("Xserver: DefineSelf(): ifname = %s, baddr = %s\n",
- IFR_IFR_NAME,
- inet_ntoa(((struct sockaddr_in *) &broad_addr)->sin_addr));
-#endif /* DEF_SELF_DEBUG */
- XdmcpRegisterBroadcastAddress ((struct sockaddr_in *) &broad_addr);
- }
-#endif /* XDMCP */
- }
- if (bufptr != buf)
- free(bufptr);
-#else /* HAS_GETIFADDRS */
- if (getifaddrs(&ifap) < 0) {
- ErrorF("Warning: getifaddrs returns %s\n", strerror(errno));
- return;
- }
- for (ifr = ifap; ifr != NULL; ifr = ifr->ifa_next) {
-#ifdef DNETCONN
- if (ifr->ifa_addr.sa_family == AF_DECnet)
- continue;
-#endif /* DNETCONN */
- len = sizeof(*(ifr->ifa_addr));
- family = ConvertAddr(ifr->ifa_addr, &len, (pointer *)&addr);
- if (family == -1 || family == FamilyLocal)
- continue;
-#ifdef DEF_SELF_DEBUG
- if (family == FamilyInternet)
- ErrorF("Xserver: DefineSelf(): ifname = %s, addr = %d.%d.%d.%d\n",
- ifr->ifa_name, addr[0], addr[1], addr[2], addr[3]);
-#endif /* DEF_SELF_DEBUG */
- for (host = selfhosts;
- host != NULL && !addrEqual(family, addr, len, host);
- host = host->next)
- ;
- if (host != NULL)
- continue;
- MakeHost(host, len);
- if (host != NULL) {
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
- }
-#ifdef XDMCP
- {
- struct sockaddr broad_addr;
- /*
- * If this isn't an Internet Address, don't register it.
- */
- if (family != FamilyInternet)
- continue;
- /*
- * ignore 'localhost' entries as they're not usefule
- * on the other end of the wire
- */
- if (len == 4 &&
- addr[0] == 127 && addr[1] == 0 &&
- addr[2] == 0 && addr[2] == 1)
- continue;
- XdmcpRegisterConnection(family, (char *)addr, len);
- if ((ifr->ifa_flags & IFF_BROADCAST) &&
- (ifr->ifa_flags & IFF_UP))
- broad_addr = *ifr->ifa_broadaddr;
- else
- continue;
-#ifdef DEF_SELF_DEBUG
- ErrorF("Xserver: DefineSelf(): ifname = %s, baddr = %s\n",
- ifr->ifa_name,
- inet_ntoa(((struct sockaddr_in *) &broad_addr)->sin_addr));
-#endif /* DEF_SELF_DEBUG */
- XdmcpRegisterBroadcastAddress((struct sockaddr_in *)
- &broad_addr);
- }
-#endif /* XDMCP */
-
- } /* for */
- freeifaddrs(ifap);
-#endif /* HAS_GETIFADDRS */
-
- /*
- * add something of FamilyLocalHost
- */
- for (host = selfhosts;
- host && !addrEqual(FamilyLocalHost, "", 0, host);
- host = host->next);
- if (!host)
- {
- MakeHost(host, 0);
- if (host)
- {
- host->family = FamilyLocalHost;
- host->len = 0;
- acopy("", host->addr, 0);
- host->next = selfhosts;
- selfhosts = host;
- }
- }
-}
-#endif /* hpux && !HAS_IFREQ */
-#endif /* WINTCP */
-
-#ifdef XDMCP
-void
-AugmentSelf(pointer from, int len)
-{
- int family;
- pointer addr;
- register HOST *host;
-
- family = ConvertAddr(from, &len, (pointer *)&addr);
- if (family == -1 || family == FamilyLocal)
- return;
- for (host = selfhosts; host; host = host->next)
- {
- if (addrEqual(family, addr, len, host))
- return;
- }
- MakeHost(host,len)
- if (!host)
- return;
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = selfhosts;
- selfhosts = host;
-}
-#endif
-
-void
-AddLocalHosts (void)
-{
- HOST *self;
-
- for (self = selfhosts; self; self = self->next)
- /* Fix for XFree86 bug #156: pass addingLocal = TRUE to
- * NewHost to tell that we are adding the default local
- * host entries and not to flag the entries as being
- * explicitely requested */
- (void) NewHost (self->family, self->addr, self->len, TRUE);
-}
-
-/* Reset access control list to initial hosts */
-void
-ResetHosts (char *display)
-{
- register HOST *host;
- char lhostname[120], ohostname[120];
- char *hostname = ohostname;
- char fname[PATH_MAX + 1];
- int fnamelen;
- FILE *fd;
- char *ptr;
- int i, hostlen;
-#if ((defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)) && \
- (!defined(IPv6) || !defined(AF_INET6))) || defined(DNETCONN)
- union {
- struct sockaddr sa;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
- struct sockaddr_in in;
-#endif /* TCPCONN || STREAMSCONN */
-#ifdef DNETCONN
- struct sockaddr_dn dn;
-#endif
- } saddr;
-#endif
-#ifdef DNETCONN
- struct nodeent *np;
- struct dn_naddr dnaddr, *dnaddrp, *dnet_addr();
-#endif
-#ifdef K5AUTH
- krb5_principal princ;
- krb5_data kbuf;
-#endif
- int family = 0;
- pointer addr;
- int len;
-
- AccessEnabled = defeatAccessControl ? FALSE : DEFAULT_ACCESS_CONTROL;
- LocalHostEnabled = FALSE;
- while ((host = validhosts) != 0)
- {
- validhosts = host->next;
- FreeHost (host);
- }
-#define ETC_HOST_PREFIX "/etc/X"
-#define ETC_HOST_SUFFIX ".hosts"
- fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) +
- strlen(display) + 1;
- if (fnamelen > sizeof(fname))
- FatalError("Display name `%s' is too long\n", display);
- sprintf(fname, ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display);
-#ifdef __UNIXOS2__
- strcpy(fname, (char*)__XOS2RedirRoot(fname));
-#endif /* __UNIXOS2__ */
-
- if ((fd = fopen (fname, "r")) != 0)
- {
- while (fgets (ohostname, sizeof (ohostname), fd))
- {
- family = FamilyWild;
- if (*ohostname == '#')
- continue;
- if ((ptr = strchr(ohostname, '\n')) != 0)
- *ptr = 0;
-#ifdef __UNIXOS2__
- if ((ptr = strchr(ohostname, '\r')) != 0)
- *ptr = 0;
-#endif
- hostlen = strlen(ohostname) + 1;
- for (i = 0; i < hostlen; i++)
- lhostname[i] = tolower(ohostname[i]);
- hostname = ohostname;
- if (!strncmp("local:", lhostname, 6))
- {
- family = FamilyLocalHost;
- NewHost(family, "", 0, FALSE);
- LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */
- }
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
- else if (!strncmp("inet:", lhostname, 5))
- {
- family = FamilyInternet;
- hostname = ohostname + 5;
- }
-#if defined(IPv6) && defined(AF_INET6)
- else if (!strncmp("inet6:", lhostname, 6))
- {
- family = FamilyInternet6;
- hostname = ohostname + 6;
- }
-#endif
-#endif
-#ifdef DNETCONN
- else if (!strncmp("dnet:", lhostname, 5))
- {
- family = FamilyDECnet;
- hostname = ohostname + 5;
- }
-#endif
-#ifdef SECURE_RPC
- else if (!strncmp("nis:", lhostname, 4))
- {
- family = FamilyNetname;
- hostname = ohostname + 4;
- }
-#endif
-#ifdef K5AUTH
- else if (!strncmp("krb:", lhostname, 4))
- {
- family = FamilyKrb5Principal;
- hostname = ohostname + 4;
- }
-#endif
-#ifdef DNETCONN
- if ((family == FamilyDECnet) ||
- (ptr = strchr(hostname, ':')) && (*(ptr + 1) == ':') &&
- !(*ptr = '\0')) /* bash trailing colons if necessary */
- {
- /* node name (DECnet names end in "::") */
- dnaddrp = dnet_addr(hostname);
- if (!dnaddrp && (np = getnodebyname (hostname)))
- {
- /* node was specified by name */
- saddr.sa.sa_family = np->n_addrtype;
- len = sizeof(saddr.sa);
- if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet)
- {
- bzero ((char *) &dnaddr, sizeof (dnaddr));
- dnaddr.a_len = np->n_length;
- acopy (np->n_addr, dnaddr.a_addr, np->n_length);
- dnaddrp = &dnaddr;
- }
- }
- if (dnaddrp)
- (void) NewHost(FamilyDECnet, (pointer)dnaddrp,
- (int)(dnaddrp->a_len + sizeof(dnaddrp->a_len)), FALSE);
- }
- else
-#endif /* DNETCONN */
-#ifdef K5AUTH
- if (family == FamilyKrb5Principal)
- {
- krb5_parse_name(hostname, &princ);
- XauKrb5Encode(princ, &kbuf);
- (void) NewHost(FamilyKrb5Principal, kbuf.data, kbuf.length, FALSE);
- krb5_free_principal(princ);
- }
- else
-#endif
-#ifdef SECURE_RPC
- if ((family == FamilyNetname) || (strchr(hostname, '@')))
- {
- SecureRPCInit ();
- (void) NewHost (FamilyNetname, hostname, strlen (hostname), FALSE);
- }
- else
-#endif /* SECURE_RPC */
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
- {
-#if defined(IPv6) && defined(AF_INET6)
- if ( (family == FamilyInternet) || (family == FamilyInternet6) ||
- (family == FamilyWild) )
- {
- struct addrinfo *addresses;
- struct addrinfo *a;
- int f;
-
- if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) {
- for (a = addresses ; a != NULL ; a = a->ai_next) {
- len = a->ai_addrlen;
- f = ConvertAddr(a->ai_addr,&len,(pointer *)&addr);
- if ( (family == f) ||
- ((family == FamilyWild) && (f != -1)) ) {
- NewHost(f, addr, len, FALSE);
- }
- }
- freeaddrinfo(addresses);
- }
- }
-#else
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
-#endif
- register struct hostent *hp;
-
- /* host name */
- if ((family == FamilyInternet &&
- ((hp = _XGethostbyname(hostname, hparams)) != 0)) ||
- ((hp = _XGethostbyname(hostname, hparams)) != 0))
- {
- saddr.sa.sa_family = hp->h_addrtype;
- len = sizeof(saddr.sa);
- if ((family = ConvertAddr (&saddr.sa, &len, (pointer *)&addr)) != -1)
- {
-#ifdef h_addr /* new 4.3bsd version of gethostent */
- char **list;
-
- /* iterate over the addresses */
- for (list = hp->h_addr_list; *list; list++)
- (void) NewHost (family, (pointer)*list, len, FALSE);
-#else
- (void) NewHost (family, (pointer)hp->h_addr, len, FALSE);
-#endif
- }
- }
-#endif /* IPv6 */
- }
-#endif /* TCPCONN || STREAMSCONN */
- family = FamilyWild;
- }
- fclose (fd);
- }
-}
-
-/* Is client on the local host */
-Bool LocalClient(ClientPtr client)
-{
- int alen, family, notused;
- Xtransaddr *from = NULL;
- pointer addr;
- register HOST *host;
-
-#ifdef XCSECURITY
- /* untrusted clients can't change host access */
- if (client->trustLevel != XSecurityClientTrusted)
- {
- SecurityAudit("client %d attempted to change host access\n",
- client->index);
- return FALSE;
- }
-#endif
-#ifdef LBX
- if (!((OsCommPtr)client->osPrivate)->trans_conn)
- return FALSE;
-#endif
- if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn,
- &notused, &alen, &from))
- {
- family = ConvertAddr ((struct sockaddr *) from,
- &alen, (pointer *)&addr);
- if (family == -1)
- {
- xfree ((char *) from);
- return FALSE;
- }
- if (family == FamilyLocal)
- {
- xfree ((char *) from);
- return TRUE;
- }
- for (host = selfhosts; host; host = host->next)
- {
- if (addrEqual (family, addr, alen, host))
- return TRUE;
- }
- xfree ((char *) from);
- }
- return FALSE;
-}
-
-/*
- * Return the uid and gid of a connected local client
- * or the uid/gid for nobody those ids cannot be determinded
- *
- * Used by XShm to test access rights to shared memory segments
- */
-int
-LocalClientCred(ClientPtr client, int *pUid, int *pGid)
-{
-#if defined(HAS_GETPEEREID) || defined(SO_PEERCRED)
- int fd;
- XtransConnInfo ci;
-#ifdef HAS_GETPEEREID
- uid_t uid;
- gid_t gid;
-#elif defined(SO_PEERCRED)
- struct ucred peercred;
- socklen_t so_len = sizeof(peercred);
-#endif
-
- if (client == NULL)
- return -1;
- ci = ((OsCommPtr)client->osPrivate)->trans_conn;
- /* We can only determine peer credentials for Unix domain sockets */
- if (!_XSERVTransIsLocal(ci)) {
- return -1;
- }
- fd = _XSERVTransGetConnectionNumber(ci);
-#ifdef HAS_GETPEEREID
- if (getpeereid(fd, &uid, &gid) == -1)
- return -1;
- if (pUid != NULL)
- *pUid = uid;
- if (pGid != NULL)
- *pGid = gid;
- return 0;
-#elif defined(SO_PEERCRED)
- if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &peercred, &so_len) == -1)
- return -1;
- if (pUid != NULL)
- *pUid = peercred.uid;
- if (pGid != NULL)
- *pGid = peercred.gid;
- return 0;
-#endif
-#else
- /* No system call available to get the credentials of the peer */
- return -1;
-#endif
-}
-
-static Bool
-AuthorizedClient(ClientPtr client)
-{
- if (!client || defeatAccessControl)
- return TRUE;
- return LocalClient(client);
-}
-
-/* Add a host to the access control list. This is the external interface
- * called from the dispatcher */
-
-int
-AddHost (ClientPtr client,
- int family,
- unsigned length, /* of bytes in pAddr */
- pointer pAddr)
-{
- int len;
-
- if (!AuthorizedClient(client))
- return(BadAccess);
- switch (family) {
- case FamilyLocalHost:
- len = length;
- LocalHostEnabled = TRUE;
- break;
-#ifdef K5AUTH
- case FamilyKrb5Principal:
- len = length;
- break;
-#endif
-#ifdef SECURE_RPC
- case FamilyNetname:
- len = length;
- SecureRPCInit ();
- break;
-#endif
- case FamilyInternet:
-#if defined(IPv6) && defined(AF_INET6)
- case FamilyInternet6:
-#endif
- case FamilyDECnet:
- case FamilyChaos:
- if ((len = CheckAddr (family, pAddr, length)) < 0)
- {
- client->errorValue = length;
- return (BadValue);
- }
- break;
- case FamilyLocal:
- default:
- client->errorValue = family;
- return (BadValue);
- }
- if (NewHost (family, pAddr, len, FALSE))
- return Success;
- return BadAlloc;
-}
-
-Bool
-ForEachHostInFamily (int family,
- Bool (*func)(
- unsigned char * /* addr */,
- short /* len */,
- pointer /* closure */),
- pointer closure)
-{
- HOST *host;
-
- for (host = validhosts; host; host = host->next)
- if (family == host->family && func (host->addr, host->len, closure))
- return TRUE;
- return FALSE;
-}
-
-/* Add a host to the access control list. This is the internal interface
- * called when starting or resetting the server */
-static Bool
-NewHost (int family,
- pointer addr,
- int len,
- int addingLocalHosts)
-{
- register HOST *host;
-
- for (host = validhosts; host; host = host->next)
- {
- if (addrEqual (family, addr, len, host))
- return TRUE;
- }
- if (!addingLocalHosts) { /* Fix for XFree86 bug #156 */
- for (host = selfhosts; host; host = host->next) {
- if (addrEqual (family, addr, len, host)) {
- host->requested = TRUE;
- break;
- }
- }
- }
- MakeHost(host,len)
- if (!host)
- return FALSE;
- host->family = family;
- host->len = len;
- acopy(addr, host->addr, len);
- host->next = validhosts;
- validhosts = host;
- return TRUE;
-}
-
-/* Remove a host from the access control list */
-
-int
-RemoveHost (
- ClientPtr client,
- int family,
- unsigned length, /* of bytes in pAddr */
- pointer pAddr)
-{
- int len;
- register HOST *host, **prev;
-
- if (!AuthorizedClient(client))
- return(BadAccess);
- switch (family) {
- case FamilyLocalHost:
- len = length;
- LocalHostEnabled = FALSE;
- break;
-#ifdef K5AUTH
- case FamilyKrb5Principal:
- len = length;
- break;
-#endif
-#ifdef SECURE_RPC
- case FamilyNetname:
- len = length;
- break;
-#endif
- case FamilyInternet:
-#if defined(IPv6) && defined(AF_INET6)
- case FamilyInternet6:
-#endif
- case FamilyDECnet:
- case FamilyChaos:
- if ((len = CheckAddr (family, pAddr, length)) < 0)
- {
- client->errorValue = length;
- return(BadValue);
- }
- break;
- case FamilyLocal:
- default:
- client->errorValue = family;
- return(BadValue);
- }
- for (prev = &validhosts;
- (host = *prev) && (!addrEqual (family, pAddr, len, host));
- prev = &host->next)
- ;
- if (host)
- {
- *prev = host->next;
- FreeHost (host);
- }
- return (Success);
-}
-
-/* Get all hosts in the access control list */
-int
-GetHosts (
- pointer *data,
- int *pnHosts,
- int *pLen,
- BOOL *pEnabled)
-{
- int len;
- register int n = 0;
- register unsigned char *ptr;
- register HOST *host;
- int nHosts = 0;
-
- *pEnabled = AccessEnabled ? EnableAccess : DisableAccess;
- for (host = validhosts; host; host = host->next)
- {
- nHosts++;
- n += (((host->len + 3) >> 2) << 2) + sizeof(xHostEntry);
- }
- if (n)
- {
- *data = ptr = (pointer) xalloc (n);
- if (!ptr)
- {
- return(BadAlloc);
- }
- for (host = validhosts; host; host = host->next)
- {
- len = host->len;
- ((xHostEntry *)ptr)->family = host->family;
- ((xHostEntry *)ptr)->length = len;
- ptr += sizeof(xHostEntry);
- acopy (host->addr, ptr, len);
- ptr += ((len + 3) >> 2) << 2;
- }
- } else {
- *data = NULL;
- }
- *pnHosts = nHosts;
- *pLen = n;
- return(Success);
-}
-
-/* Check for valid address family and length, and return address length. */
-
-/*ARGSUSED*/
-static int
-CheckAddr (
- int family,
- pointer pAddr,
- unsigned length)
-{
- int len;
-
- switch (family)
- {
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(AMTCPCONN) || defined(MNX_TCPCONN)
- case FamilyInternet:
- if (length == sizeof (struct in_addr))
- len = length;
- else
- len = -1;
- break;
-#if defined(IPv6) && defined(AF_INET6)
- case FamilyInternet6:
- if (length == sizeof (struct in6_addr))
- len = length;
- else
- len = -1;
- break;
-#endif
-#endif
-#ifdef DNETCONN
- case FamilyDECnet:
- {
- struct dn_naddr *dnaddr = (struct dn_naddr *) pAddr;
-
- if ((length < sizeof(dnaddr->a_len)) ||
- (length < dnaddr->a_len + sizeof(dnaddr->a_len)))
- len = -1;
- else
- len = dnaddr->a_len + sizeof(dnaddr->a_len);
- if (len > sizeof(struct dn_naddr))
- len = -1;
- }
- break;
-#endif
- default:
- len = -1;
- }
- return (len);
-}
-
-/* Check if a host is not in the access control list.
- * Returns 1 if host is invalid, 0 if we've found it. */
-
-int
-InvalidHost (
- register struct sockaddr *saddr,
- int len)
-{
- int family;
- pointer addr;
- register HOST *selfhost, *host;
-
- if (!AccessEnabled) /* just let them in */
- return(0);
- family = ConvertAddr (saddr, &len, (pointer *)&addr);
- if (family == -1)
- return 1;
- if (family == FamilyLocal)
- {
- if (!LocalHostEnabled)
- {
- /*
- * check to see if any local address is enabled. This
- * implicitly enables local connections.
- */
- for (selfhost = selfhosts; selfhost; selfhost=selfhost->next)
- {
- for (host = validhosts; host; host=host->next)
- {
- if (addrEqual (selfhost->family, selfhost->addr,
- selfhost->len, host))
- return 0;
- }
- }
- return 1;
- } else
- return 0;
- }
- for (host = validhosts; host; host = host->next)
- {
- if (addrEqual (family, addr, len, host))
- return (0);
- }
- return (1);
-}
-
-static int
-ConvertAddr (
- register struct sockaddr *saddr,
- int *len,
- pointer *addr)
-{
- if (*len == 0)
- return (FamilyLocal);
- switch (saddr->sa_family)
- {
- case AF_UNSPEC:
-#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
- case AF_UNIX:
-#endif
- return FamilyLocal;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
- case AF_INET:
- *len = sizeof (struct in_addr);
- *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr);
- return FamilyInternet;
-#if defined(IPv6) && defined(AF_INET6)
- case AF_INET6:
- {
- struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) saddr;
- if (IN6_IS_ADDR_V4MAPPED(&(saddr6->sin6_addr))) {
- *len = sizeof (struct in_addr);
- *addr = (pointer) &(saddr6->sin6_addr.s6_addr[12]);
- return FamilyInternet;
- } else {
- *len = sizeof (struct in6_addr);
- *addr = (pointer) &(saddr6->sin6_addr);
- return FamilyInternet6;
- }
- }
-#endif
-#endif
-#ifdef DNETCONN
- case AF_DECnet:
- {
- struct sockaddr_dn *sdn = (struct sockaddr_dn *) saddr;
- *len = sdn->sdn_nodeaddrl + sizeof(sdn->sdn_nodeaddrl);
- *addr = (pointer) &(sdn->sdn_add);
- }
- return FamilyDECnet;
-#endif
-#ifdef CHAOSCONN
- case AF_CHAOS:
- {
- not implemented
- }
- return FamilyChaos;
-#endif
- default:
- return -1;
- }
-}
-
-int
-ChangeAccessControl(
- ClientPtr client,
- int fEnabled)
-{
- if (!AuthorizedClient(client))
- return BadAccess;
- AccessEnabled = fEnabled;
- return Success;
-}
-
-/* returns FALSE if xhost + in effect, else TRUE */
-int
-GetAccessControl(void)
-{
- return AccessEnabled;
-}
diff --git a/os/auth.c b/os/auth.c
deleted file mode 100644
index a1cbc8c1f..000000000
--- a/os/auth.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* $Xorg: auth.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/auth.c,v 1.14 2003/08/27 19:57:21 herrb Exp $ */
-
-/*
- * authorization hooks for the server
- * Author: Keith Packard, MIT X Consortium
- */
-
-#ifdef K5AUTH
-# include <krb5/krb5.h>
-#endif
-# include <X11/X.h>
-# include <X11/Xauth.h>
-# include "misc.h"
-# include "osdep.h"
-# include "dixstruct.h"
-# include <sys/types.h>
-# include <sys/stat.h>
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-# include "extensions/security.h"
-#endif
-#ifdef WIN32
-#include "Xw32defs.h"
-#endif
-
-struct protocol {
- unsigned short name_length;
- char *name;
- AuthAddCFunc Add; /* new authorization data */
- AuthCheckFunc Check; /* verify client authorization data */
- AuthRstCFunc Reset; /* delete all authorization data entries */
- AuthToIDFunc ToID; /* convert cookie to ID */
- AuthFromIDFunc FromID; /* convert ID to cookie */
- AuthRemCFunc Remove; /* remove a specific cookie */
-#ifdef XCSECURITY
- AuthGenCFunc Generate;
-#endif
-};
-
-static struct protocol protocols[] = {
-{ (unsigned short) 18, "MIT-MAGIC-COOKIE-1",
- MitAddCookie, MitCheckCookie, MitResetCookie,
- MitToID, MitFromID, MitRemoveCookie,
-#ifdef XCSECURITY
- MitGenerateCookie
-#endif
-},
-#ifdef HASXDMAUTH
-{ (unsigned short) 19, "XDM-AUTHORIZATION-1",
- XdmAddCookie, XdmCheckCookie, XdmResetCookie,
- XdmToID, XdmFromID, XdmRemoveCookie,
-#ifdef XCSECURITY
- NULL
-#endif
-},
-#endif
-#ifdef SECURE_RPC
-{ (unsigned short) 9, "SUN-DES-1",
- SecureRPCAdd, SecureRPCCheck, SecureRPCReset,
- SecureRPCToID, SecureRPCFromID,SecureRPCRemove,
-#ifdef XCSECURITY
- NULL
-#endif
-},
-#endif
-#ifdef K5AUTH
-{ (unsigned short) 14, "MIT-KERBEROS-5",
- K5Add, K5Check, K5Reset,
- K5ToID, K5FromID, K5Remove,
-#ifdef XCSECURITY
- NULL
-#endif
-},
-#endif
-#ifdef XCSECURITY
-{ (unsigned short) XSecurityAuthorizationNameLen,
- XSecurityAuthorizationName,
- NULL, AuthSecurityCheck, NULL,
- NULL, NULL, NULL,
- NULL
-},
-#endif
-};
-
-# define NUM_AUTHORIZATION (sizeof (protocols) /\
- sizeof (struct protocol))
-
-/*
- * Initialize all classes of authorization by reading the
- * specified authorization file
- */
-
-static char *authorization_file = (char *)NULL;
-
-static Bool ShouldLoadAuth = TRUE;
-
-void
-InitAuthorization (char *file_name)
-{
- authorization_file = file_name;
-}
-
-static int
-LoadAuthorization (void)
-{
- FILE *f;
- Xauth *auth;
- int i;
- int count = 0;
-
- ShouldLoadAuth = FALSE;
- if (!authorization_file)
- return 0;
-
- f = Fopen (authorization_file, "r");
- if (!f)
- return -1;
-
- while ((auth = XauReadAuth (f)) != 0) {
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == auth->name_length &&
- memcmp (protocols[i].name, auth->name, (int) auth->name_length) == 0 &&
- protocols[i].Add)
- {
- ++count;
- (*protocols[i].Add) (auth->data_length, auth->data,
- FakeClientID(0));
- }
- }
- XauDisposeAuth (auth);
- }
-
- Fclose (f);
- return count;
-}
-
-#ifdef XDMCP
-/*
- * XdmcpInit calls this function to discover all authorization
- * schemes supported by the display
- */
-void
-RegisterAuthorizations (void)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++)
- XdmcpRegisterAuthorization (protocols[i].name,
- (int)protocols[i].name_length);
-}
-#endif
-
-XID
-CheckAuthorization (
- unsigned int name_length,
- char *name,
- unsigned int data_length,
- char *data,
- ClientPtr client,
- char **reason) /* failure message. NULL for default msg */
-{
- int i;
- struct stat buf;
- static time_t lastmod = 0;
- static Bool loaded = FALSE;
-
- if (!authorization_file || stat(authorization_file, &buf))
- {
- if (lastmod != 0) {
- lastmod = 0;
- ShouldLoadAuth = TRUE; /* stat lost, so force reload */
- }
- }
- else if (buf.st_mtime > lastmod)
- {
- lastmod = buf.st_mtime;
- ShouldLoadAuth = TRUE;
- }
- if (ShouldLoadAuth)
- {
- int loadauth = LoadAuthorization();
-
- /*
- * If the authorization file has at least one entry for this server,
- * disable local host access. (loadauth > 0)
- *
- * If there are zero entries (either initially or when the
- * authorization file is later reloaded), or if a valid
- * authorization file was never loaded, enable local host access.
- * (loadauth == 0 || !loaded)
- *
- * If the authorization file was loaded initially (with valid
- * entries for this server), and reloading it later fails, don't
- * change anything. (loadauth == -1 && loaded)
- */
-
- if (loadauth > 0)
- {
- DisableLocalHost(); /* got at least one */
- loaded = TRUE;
- }
- else if (loadauth == 0 || !loaded)
- EnableLocalHost ();
- }
- if (name_length) {
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0)
- {
- return (*protocols[i].Check) (data_length, data, client, reason);
- }
- *reason = "Protocol not supported by server\n";
- }
- } else *reason = "No protocol specified\n";
- return (XID) ~0L;
-}
-
-void
-ResetAuthorization (void)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++)
- if (protocols[i].Reset)
- (*protocols[i].Reset)();
- ShouldLoadAuth = TRUE;
-}
-
-XID
-AuthorizationToID (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0 &&
- protocols[i].ToID)
- {
- return (*protocols[i].ToID) (data_length, data);
- }
- }
- return (XID) ~0L;
-}
-
-int
-AuthorizationFromID (
- XID id,
- unsigned short *name_lenp,
- char **namep,
- unsigned short *data_lenp,
- char **datap)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].FromID &&
- (*protocols[i].FromID) (id, data_lenp, datap)) {
- *name_lenp = protocols[i].name_length;
- *namep = protocols[i].name;
- return 1;
- }
- }
- return 0;
-}
-
-int
-RemoveAuthorization (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0 &&
- protocols[i].Remove)
- {
- return (*protocols[i].Remove) (data_length, data);
- }
- }
- return 0;
-}
-
-int
-AddAuthorization (unsigned name_length, char *name, unsigned data_length, char *data)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0 &&
- protocols[i].Add)
- {
- return (*protocols[i].Add) (data_length, data, FakeClientID(0));
- }
- }
- return 0;
-}
-
-#ifdef XCSECURITY
-
-XID
-GenerateAuthorization(
- unsigned name_length,
- char *name,
- unsigned data_length,
- char *data,
- unsigned *data_length_return,
- char **data_return)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0 &&
- protocols[i].Generate)
- {
- return (*protocols[i].Generate) (data_length, data,
- FakeClientID(0), data_length_return, data_return);
- }
- }
- return -1;
-}
-
-/* A random number generator that is more unpredictable
- than that shipped with some systems.
- This code is taken from the C standard. */
-
-static unsigned long int next = 1;
-
-static int
-xdm_rand(void)
-{
- next = next * 1103515245 + 12345;
- return (unsigned int)(next/65536) % 32768;
-}
-
-static void
-xdm_srand(unsigned int seed)
-{
- next = seed;
-}
-
-void
-GenerateRandomData (int len, char *buf)
-{
- static int seed;
- int value;
- int i;
-
- seed += GetTimeInMillis();
- xdm_srand (seed);
- for (i = 0; i < len; i++)
- {
- value = xdm_rand ();
- buf[i] ^= (value & 0xff00) >> 8;
- }
-
- /* XXX add getrusage, popen("ps -ale") */
-}
-
-#endif /* XCSECURITY */
diff --git a/os/connection.c b/os/connection.c
deleted file mode 100644
index 7465e7eff..000000000
--- a/os/connection.c
+++ /dev/null
@@ -1,1307 +0,0 @@
-/* $Xorg: connection.c,v 1.6 2001/02/09 02:05:23 xorgcvs Exp $ */
-/***********************************************************
-
-Copyright 1987, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/programs/Xserver/os/connection.c,v 3.65 2003/10/30 21:21:10 herrb Exp $ */
-/*****************************************************************
- * Stuff to create connections --- OS dependent
- *
- * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets,
- * CloseDownConnection, CheckConnections, AddEnabledDevice,
- * RemoveEnabledDevice, OnlyListToOneClient,
- * ListenToAllClients,
- *
- * (WaitForSomething is in its own file)
- *
- * In this implementation, a client socket table is not kept.
- * Instead, what would be the index into the table is just the
- * file descriptor of the socket. This won't work for if the
- * socket ids aren't small nums (0 - 2^8)
- *
- *****************************************************************/
-
-#ifdef WIN32
-#include <X11/Xwinsock.h>
-#endif
-#include "X.h"
-#include "Xproto.h"
-#include <X11/Xtrans.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef WIN32
-#if defined(Lynx)
-#include <socket.h>
-#else
-#include <sys/socket.h>
-#endif
-
-#ifdef hpux
-#include <sys/utsname.h>
-#include <sys/ioctl.h>
-#endif
-
-#if defined(DGUX)
-#include <sys/ioctl.h>
-#include <sys/utsname.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <sys/param.h>
-#include <unistd.h>
-#endif
-
-
-#ifdef AIXV3
-#include <sys/ioctl.h>
-#endif
-
-#ifdef __UNIXOS2__
-#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t)
-extern __const__ int _nfiles;
-#endif
-
-#if defined(TCPCONN) || defined(STREAMSCONN)
-# include <netinet/in.h>
-# include <arpa/inet.h>
-# if !defined(hpux)
-# ifdef apollo
-# ifndef NO_TCP_H
-# include <netinet/tcp.h>
-# endif
-# else
-# ifdef CSRG_BASED
-# include <sys/param.h>
-# endif
-# ifndef __UNIXOS2__
-# include <netinet/tcp.h>
-# endif
-# endif
-# endif
-# include <arpa/inet.h>
-#endif
-
-#ifdef AMTCPCONN
-#include <server/ip/types.h>
-#include <server/ip/gen/in.h>
-#include <server/ip/gen/inet.h>
-#endif
-
-#if !defined(__UNIXOS2__)
-#ifndef Lynx
-#include <sys/uio.h>
-#else
-#include <uio.h>
-#endif
-#endif
-#endif /* WIN32 */
-#include "misc.h" /* for typedef of pointer */
-#include "osdep.h"
-#include <X11/Xpoll.h>
-#include "opaque.h"
-#include "dixstruct.h"
-#ifdef XAPPGROUP
-#include "extensions/Xagsrv.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "extensions/security.h"
-#endif
-#ifdef LBX
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxserve.h"
-#include "osdep.h"
-#endif
-
-#ifdef X_NOT_POSIX
-#define Pid_t int
-#else
-#define Pid_t pid_t
-#endif
-
-#ifdef DNETCONN
-#include <netdnet/dn.h>
-#endif /* DNETCONN */
-
-int lastfdesc; /* maximum file descriptor */
-
-fd_set WellKnownConnections; /* Listener mask */
-fd_set EnabledDevices; /* mask for input devices that are on */
-fd_set AllSockets; /* select on this */
-fd_set AllClients; /* available clients */
-fd_set LastSelectMask; /* mask returned from last select call */
-fd_set ClientsWithInput; /* clients with FULL requests in buffer */
-fd_set ClientsWriteBlocked; /* clients who cannot receive output */
-fd_set OutputPending; /* clients with reply/event data ready to go */
-int MaxClients = 0;
-Bool NewOutputPending; /* not yet attempted to write some new output */
-Bool AnyClientsWriteBlocked; /* true if some client blocked on write */
-
-Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
-Bool PartialNetwork; /* continue even if unable to bind all addrs */
-static Pid_t ParentProcess;
-#ifdef __UNIXOS2__
-Pid_t GetPPID(Pid_t pid);
-#endif
-
-static Bool debug_conns = FALSE;
-
-fd_set IgnoredClientsWithInput;
-static fd_set GrabImperviousClients;
-static fd_set SavedAllClients;
-static fd_set SavedAllSockets;
-static fd_set SavedClientsWithInput;
-int GrabInProgress = 0;
-
-int *ConnectionTranslation = NULL;
-#if defined(WIN32)
-/* SPAM ALERT !!!
- * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is
- * not even a known maximum value, so use something quite arbitrary for now.
- * This is clearly boggus and another form of storage which doesn't use the fd
- * as a direct index should really be implemented for NT.
- */
-#define MAXFD 500
-#endif
-
-XtransConnInfo *ListenTransConns = NULL;
-int *ListenTransFds = NULL;
-int ListenTransCount;
-
-static void ErrorConnMax(XtransConnInfo /* trans_conn */);
-
-#ifndef LBX
-static
-void CloseDownFileDescriptor(
- OsCommPtr /*oc*/
-);
-#endif
-
-
-static XtransConnInfo
-lookup_trans_conn (int fd)
-{
- if (ListenTransFds)
- {
- int i;
- for (i = 0; i < ListenTransCount; i++)
- if (ListenTransFds[i] == fd)
- return ListenTransConns[i];
- }
-
- return (NULL);
-}
-
-/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */
-
-void
-InitConnectionLimits(void)
-{
- lastfdesc = -1;
-
-#ifndef __CYGWIN__
-
-#ifndef __UNIXOS2__
-
-#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX)
- lastfdesc = sysconf(_SC_OPEN_MAX) - 1;
-#endif
-
-#ifdef HAS_GETDTABLESIZE
- if (lastfdesc < 0)
- lastfdesc = getdtablesize() - 1;
-#endif
-
-#ifdef _NFILE
- if (lastfdesc < 0)
- lastfdesc = _NFILE - 1;
-#endif
-
-#else /* __UNIXOS2__ */
- lastfdesc = _nfiles - 1;
-#endif
-
-#endif /* __CYGWIN__ */
-
- /* This is the fallback */
- if (lastfdesc < 0)
- lastfdesc = MAXSOCKS;
-
- if (lastfdesc > MAXSELECT)
- lastfdesc = MAXSELECT;
-
- if (lastfdesc > MAXCLIENTS)
- {
- lastfdesc = MAXCLIENTS;
- if (debug_conns)
- ErrorF( "REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS);
- }
- MaxClients = lastfdesc;
-
-#ifdef DEBUG
- ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients);
-#endif
-
-#if !defined(WIN32)
- ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1));
-#else
- ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(MAXFD));
-#endif
-}
-
-
-/*****************
- * CreateWellKnownSockets
- * At initialization, create the sockets to listen on for new clients.
- *****************/
-
-void
-CreateWellKnownSockets(void)
-{
- int i;
- int partial;
- char port[20];
- OsSigHandlerPtr handler;
-
- FD_ZERO(&AllSockets);
- FD_ZERO(&AllClients);
- FD_ZERO(&LastSelectMask);
- FD_ZERO(&ClientsWithInput);
-
-#if !defined(WIN32)
- for (i=0; i<MaxClients; i++) ConnectionTranslation[i] = 0;
-#else
- for (i=0; i<MAXFD; i++) ConnectionTranslation[i] = 0;
-#endif
-
- FD_ZERO (&WellKnownConnections);
-
- sprintf (port, "%d", atoi (display));
-
- if ((_XSERVTransMakeAllCOTSServerListeners (port, &partial,
- &ListenTransCount, &ListenTransConns) >= 0) &&
- (ListenTransCount >= 1))
- {
- if (!PartialNetwork && partial)
- {
- FatalError ("Failed to establish all listening sockets");
- }
- else
- {
- ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int));
-
- for (i = 0; i < ListenTransCount; i++)
- {
- int fd = _XSERVTransGetConnectionNumber (ListenTransConns[i]);
-
- ListenTransFds[i] = fd;
- FD_SET (fd, &WellKnownConnections);
-
- if (!_XSERVTransIsLocal (ListenTransConns[i]))
- {
- DefineSelf (fd);
- }
- }
- }
- }
-
- if (!XFD_ANYSET (&WellKnownConnections))
- FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running");
-#if !defined(WIN32)
- OsSignal (SIGPIPE, SIG_IGN);
- OsSignal (SIGHUP, AutoResetServer);
-#endif
- OsSignal (SIGINT, GiveUp);
- OsSignal (SIGTERM, GiveUp);
- XFD_COPYSET (&WellKnownConnections, &AllSockets);
- ResetHosts(display);
- /*
- * Magic: If SIGUSR1 was set to SIG_IGN when
- * the server started, assume that either
- *
- * a- The parent process is ignoring SIGUSR1
- *
- * or
- *
- * b- The parent process is expecting a SIGUSR1
- * when the server is ready to accept connections
- *
- * In the first case, the signal will be harmless,
- * in the second case, the signal will be quite
- * useful
- */
-#if !defined(WIN32)
- handler = OsSignal (SIGUSR1, SIG_IGN);
- if ( handler == SIG_IGN)
- RunFromSmartParent = TRUE;
- OsSignal(SIGUSR1, handler);
- ParentProcess = getppid ();
-#ifdef __UNIXOS2__
- /*
- * fg030505: under OS/2, xinit is not the parent process but
- * the "grant parent" process of the server because execvpe()
- * presents us an additional process number;
- * GetPPID(pid) is part of libemxfix
- */
- ParentProcess = GetPPID (ParentProcess);
-#endif /* __UNIXOS2__ */
- if (RunFromSmartParent) {
- if (ParentProcess > 1) {
- kill (ParentProcess, SIGUSR1);
- }
- }
-#endif
-#ifdef XDMCP
- XdmcpInit ();
-#endif
-}
-
-void
-ResetWellKnownSockets (void)
-{
- int i;
-
- ResetOsBuffers();
-
- for (i = 0; i < ListenTransCount; i++)
- {
- int status = _XSERVTransResetListener (ListenTransConns[i]);
-
- if (status != TRANS_RESET_NOOP)
- {
- if (status == TRANS_RESET_FAILURE)
- {
- /*
- * ListenTransConns[i] freed by xtrans.
- * Remove it from out list.
- */
-
- FD_CLR (ListenTransFds[i], &WellKnownConnections);
- ListenTransFds[i] = ListenTransFds[ListenTransCount - 1];
- ListenTransConns[i] = ListenTransConns[ListenTransCount - 1];
- ListenTransCount -= 1;
- i -= 1;
- }
- else if (status == TRANS_RESET_NEW_FD)
- {
- /*
- * A new file descriptor was allocated (the old one was closed)
- */
-
- int newfd = _XSERVTransGetConnectionNumber (ListenTransConns[i]);
-
- FD_CLR (ListenTransFds[i], &WellKnownConnections);
- ListenTransFds[i] = newfd;
- FD_SET(newfd, &WellKnownConnections);
- }
- }
- }
-
- ResetAuthorization ();
- ResetHosts(display);
- /*
- * See above in CreateWellKnownSockets about SIGUSR1
- */
-#if !defined(WIN32)
- if (RunFromSmartParent) {
- if (ParentProcess > 1) {
- kill (ParentProcess, SIGUSR1);
- }
- }
-#endif
- /*
- * restart XDMCP
- */
-#ifdef XDMCP
- XdmcpReset ();
-#endif
-}
-
-void
-CloseWellKnownConnections(void)
-{
- int i;
-
- for (i = 0; i < ListenTransCount; i++)
- _XSERVTransClose (ListenTransConns[i]);
-}
-
-static void
-AuthAudit (ClientPtr client, Bool letin,
- struct sockaddr *saddr, int len,
- unsigned int proto_n, char *auth_proto, int auth_id)
-{
- char addr[128];
- char *out = addr;
-
- if (!((OsCommPtr)client->osPrivate)->trans_conn) {
- strcpy(addr, "LBX proxy at ");
- out += strlen(addr);
- }
- if (!len)
- strcpy(out, "local host");
- else
- switch (saddr->sa_family)
- {
- case AF_UNSPEC:
-#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
- case AF_UNIX:
-#endif
- strcpy(out, "local host");
- break;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
- case AF_INET:
- sprintf(out, "IP %s",
- inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr));
- break;
-#if defined(IPv6) && defined(AF_INET6)
- case AF_INET6: {
- char ipaddr[INET6_ADDRSTRLEN];
- inet_ntop(AF_INET6, &((struct sockaddr_in6 *) saddr)->sin6_addr,
- ipaddr, sizeof(ipaddr));
- sprintf(out, "IP %s", ipaddr);
- }
- break;
-#endif
-#endif
-#ifdef DNETCONN
- case AF_DECnet:
- sprintf(out, "DN %s",
- dnet_ntoa(&((struct sockaddr_dn *) saddr)->sdn_add));
- break;
-#endif
-#ifdef AMRPCCONN
- case FamilyAmoeba:
- sprintf(addr, "AM %s", saddr);
- break;
-#endif
-#if defined(AMTCPCONN) && !(defined(TCPCONN) || defined(STREAMSCONN))
- case AF_INET:
- sprintf(addr, "AMIP %s", inet_ntoa(*((ipaddr_t *) saddr)));
- break;
-#endif
- default:
- strcpy(out, "unknown address");
- }
-
- if (proto_n)
- AuditF("client %d %s from %s\n Auth name: %.*s ID: %d\n",
- client->index, letin ? "connected" : "rejected", addr,
- (int)proto_n, auth_proto, auth_id);
- else
- AuditF("client %d %s from %s\n",
- client->index, letin ? "connected" : "rejected", addr);
-}
-
-XID
-AuthorizationIDOfClient(ClientPtr client)
-{
- if (client->osPrivate)
- return ((OsCommPtr)client->osPrivate)->auth_id;
- else
- return None;
-}
-
-
-/*****************************************************************
- * ClientAuthorized
- *
- * Sent by the client at connection setup:
- * typedef struct _xConnClientPrefix {
- * CARD8 byteOrder;
- * BYTE pad;
- * CARD16 majorVersion, minorVersion;
- * CARD16 nbytesAuthProto;
- * CARD16 nbytesAuthString;
- * } xConnClientPrefix;
- *
- * It is hoped that eventually one protocol will be agreed upon. In the
- * mean time, a server that implements a different protocol than the
- * client expects, or a server that only implements the host-based
- * mechanism, will simply ignore this information.
- *
- *****************************************************************/
-
-char *
-ClientAuthorized(ClientPtr client,
- unsigned int proto_n, char *auth_proto,
- unsigned int string_n, char *auth_string)
-{
- OsCommPtr priv;
- Xtransaddr *from = NULL;
- int family;
- int fromlen;
- XID auth_id;
- char *reason = NULL;
- XtransConnInfo trans_conn;
- int restore_trans_conn = 0;
- ClientPtr lbxpc = NULL;
-
- priv = (OsCommPtr)client->osPrivate;
- trans_conn = priv->trans_conn;
-
-#ifdef LBX
- if (!trans_conn) {
- /*
- * Since trans_conn is NULL, this must be a proxy's client for
- * which we have NO address. Therefore, we will temporarily
- * set the client's trans_conn to the proxy's trans_conn and
- * after CheckAuthorization the client's trans_conn will be
- * restored.
- *
- * If XDM-AUTHORIZATION-1 is being used, CheckAuthorization
- * will eventually call XdmAuthorizationValidate and this
- * later function may use the client's trans_conn to get the
- * client's address. Since a XDM-AUTH-1 auth string includes
- * the client's address, this address is compared to the address
- * in the client's trans_conn. If the proxy and client are
- * on the same host, the comparison will fail; otherwise the
- * comparison will fail and the client will not be authorized
- * to connect to the server.
- *
- * The basis for this additional code is to prevent a
- * NULL pointer dereference of the client's trans_conn.
- * The fundamental problem - the fact that the client's
- * trans_conn is NULL - is because the NewClient
- * request in version 1.0 of the LBX protocol does not
- * send the client's address to the server. When the
- * spec is changed and the client's address is sent to
- * server in the NewClient request, this additional code
- * should be removed.
- *
- * See defect number XWSog08218 for more information.
- */
- lbxpc = LbxProxyClient(priv->proxy);
- trans_conn = ((OsCommPtr)lbxpc->osPrivate)->trans_conn;
- priv->trans_conn = trans_conn;
- restore_trans_conn = 1;
- }
-#endif
-
- auth_id = CheckAuthorization (proto_n, auth_proto,
- string_n, auth_string, client, &reason);
-
-#ifdef LBX
- if (! priv->trans_conn) {
- if (auth_id == (XID) ~0L && !GetAccessControl())
- auth_id = ((OsCommPtr)lbxpc->osPrivate)->auth_id;
-#ifdef XCSECURITY
- else if (auth_id != (XID) ~0L && !SecuritySameLevel(lbxpc, auth_id)) {
- auth_id = (XID) ~0L;
- reason = "Client trust level differs from that of LBX Proxy";
- }
-#endif
- }
-#endif
- if (auth_id == (XID) ~0L)
- {
- if (
-#ifdef XCSECURITY
- (proto_n == 0 ||
- strncmp (auth_proto, XSecurityAuthorizationName, proto_n) != 0) &&
-#endif
- _XSERVTransGetPeerAddr (trans_conn,
- &family, &fromlen, &from) != -1)
- {
-#ifdef AMRPCCONN
- /* Amoeba RPC connections are already checked by the capability. */
- if (family == FamilyAmoeba) {
- auth_id = (XID) 0;
- }
- else
-#endif
- if (
-#ifdef LBX
- !trans_conn ||
-#endif
- InvalidHost ((struct sockaddr *) from, fromlen))
- AuthAudit(client, FALSE, (struct sockaddr *) from,
- fromlen, proto_n, auth_proto, auth_id);
- else
- {
- auth_id = (XID) 0;
- if (auditTrailLevel > 1)
- AuthAudit(client, TRUE,
- (struct sockaddr *) from, fromlen,
- proto_n, auth_proto, auth_id);
- }
-
- xfree ((char *) from);
- }
-
- if (auth_id == (XID) ~0L) {
-#ifdef LBX
- /*
- * Restore client's trans_conn state
- */
- if (restore_trans_conn) {
- priv->trans_conn = NULL;
- }
-#endif
- if (reason)
- return reason;
- else
- return "Client is not authorized to connect to Server";
- }
- }
- else if (auditTrailLevel > 1)
- {
- if (_XSERVTransGetPeerAddr (trans_conn,
- &family, &fromlen, &from) != -1)
- {
- AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen,
- proto_n, auth_proto, auth_id);
-
- xfree ((char *) from);
- }
- }
- priv->auth_id = auth_id;
- priv->conn_time = 0;
-
-#ifdef XDMCP
- /* indicate to Xdmcp protocol that we've opened new client */
- XdmcpOpenDisplay(priv->fd);
-#endif /* XDMCP */
-#ifdef XAPPGROUP
- if (ClientStateCallback)
- XagCallClientStateChange (client);
-#endif
- /* At this point, if the client is authorized to change the access control
- * list, we should getpeername() information, and add the client to
- * the selfhosts list. It's not really the host machine, but the
- * true purpose of the selfhosts list is to see who may change the
- * access control list.
- */
-#ifdef LBX
- if (restore_trans_conn) {
- priv->trans_conn = NULL;
- }
-#endif
- return((char *)NULL);
-}
-
-static ClientPtr
-#ifdef LBX
-AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time,
- int (*Flush)(
- ClientPtr /*who*/, OsCommPtr /*oc*/,
- char */*extraBuf*/, int /*extraCount*/),
- void (*Close)(
- ClientPtr /*client*/),
- LbxProxyPtr proxy)
-#else
-AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
-#endif
-{
- OsCommPtr oc;
- ClientPtr client;
-
- if (
-#ifdef LBX
- trans_conn &&
-#endif
-#ifndef WIN32
- fd >= lastfdesc
-#else
- XFD_SETCOUNT(&AllClients) >= MaxClients
-#endif
- )
- return NullClient;
- oc = (OsCommPtr)xalloc(sizeof(OsCommRec));
- if (!oc)
- return NullClient;
- oc->trans_conn = trans_conn;
- oc->fd = fd;
- oc->input = (ConnectionInputPtr)NULL;
- oc->output = (ConnectionOutputPtr)NULL;
- oc->auth_id = None;
- oc->conn_time = conn_time;
-#ifdef LBX
- oc->proxy = proxy;
- oc->Flush = Flush;
- oc->Close = Close;
- oc->largereq = (ConnectionInputPtr) NULL;
-#endif
- if (!(client = NextAvailableClient((pointer)oc)))
- {
- xfree (oc);
- return NullClient;
- }
-#ifdef LBX
- if (trans_conn)
-#endif
- {
- ConnectionTranslation[fd] = client->index;
- if (GrabInProgress)
- {
- FD_SET(fd, &SavedAllClients);
- FD_SET(fd, &SavedAllSockets);
- }
- else
- {
- FD_SET(fd, &AllClients);
- FD_SET(fd, &AllSockets);
- }
- }
-
-#ifdef DEBUG
- ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n",
- client->index, fd);
-#endif
-
- return client;
-}
-
-#ifdef LBX
-
-int
-ClientConnectionNumber (ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr) client->osPrivate;
-
- return oc->fd;
-}
-
-ClientPtr
-AllocLbxClientConnection (ClientPtr client, LbxProxyPtr proxy)
-{
- OsCommPtr oc = (OsCommPtr) client->osPrivate;
-
- return AllocNewConnection ((XtransConnInfo)NULL, oc->fd, GetTimeInMillis(),
- LbxFlushClient, LbxCloseClient, proxy);
-}
-
-void
-LbxProxyConnection (ClientPtr client, LbxProxyPtr proxy)
-{
- OsCommPtr oc = (OsCommPtr) client->osPrivate;
-
- FlushClient(client, oc, (char *)NULL, 0);
- oc->proxy = proxy;
- oc->Flush = LbxFlushClient;
- oc->Close = LbxCloseClient;
- LbxPrimeInput(client, proxy);
-}
-
-#endif
-
-/*****************
- * EstablishNewConnections
- * If anyone is waiting on listened sockets, accept them.
- * Returns a mask with indices of new clients. Updates AllClients
- * and AllSockets.
- *****************/
-
-/*ARGSUSED*/
-Bool
-EstablishNewConnections(ClientPtr clientUnused, pointer closure)
-{
- fd_set readyconnections; /* set of listeners that are ready */
- int curconn; /* fd of listener that's ready */
- register int newconn; /* fd of new client */
- CARD32 connect_time;
- register int i;
- register ClientPtr client;
- register OsCommPtr oc;
- fd_set tmask;
-
- XFD_ANDSET (&tmask, (fd_set*)closure, &WellKnownConnections);
- XFD_COPYSET(&tmask, &readyconnections);
- if (!XFD_ANYSET(&readyconnections))
- return TRUE;
- connect_time = GetTimeInMillis();
- /* kill off stragglers */
- for (i=1; i<currentMaxClients; i++)
- {
- if ((client = clients[i]))
- {
- oc = (OsCommPtr)(client->osPrivate);
- if ((oc && (oc->conn_time != 0) &&
- (connect_time - oc->conn_time) >= TimeOutValue) ||
- (client->noClientException != Success && !client->clientGone))
- CloseDownClient(client);
- }
- }
-#ifndef WIN32
- for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++)
- {
- while (readyconnections.fds_bits[i])
-#else
- for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++)
-#endif
- {
- XtransConnInfo trans_conn, new_trans_conn;
- int status;
-
-#ifndef WIN32
- curconn = ffs (readyconnections.fds_bits[i]) - 1;
- readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn);
- curconn += (i * (sizeof(fd_mask)*8));
-#else
- curconn = XFD_FD(&readyconnections, i);
-#endif
-
- if ((trans_conn = lookup_trans_conn (curconn)) == NULL)
- continue;
-
- if ((new_trans_conn = _XSERVTransAccept (trans_conn, &status)) == NULL)
- continue;
-
- newconn = _XSERVTransGetConnectionNumber (new_trans_conn);
-
- if (newconn < lastfdesc)
- {
- int clientid;
- clientid = ConnectionTranslation[newconn];
- if(clientid && (client = clients[clientid]))
- CloseDownClient(client);
- }
-
- _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1);
-
- if (!AllocNewConnection (new_trans_conn, newconn, connect_time
-#ifdef LBX
- , StandardFlushClient,
- CloseDownFileDescriptor, (LbxProxyPtr)NULL
-#endif
- ))
- {
- ErrorConnMax(new_trans_conn);
- _XSERVTransClose(new_trans_conn);
- }
- }
-#ifndef WIN32
- }
-#endif
- return TRUE;
-}
-
-#define NOROOM "Maximum number of clients reached"
-
-/************
- * ErrorConnMax
- * Fail a connection due to lack of client or file descriptor space
- ************/
-
-static void
-ErrorConnMax(XtransConnInfo trans_conn)
-{
- int fd = _XSERVTransGetConnectionNumber (trans_conn);
- xConnSetupPrefix csp;
- char pad[3];
- struct iovec iov[3];
- char byteOrder = 0;
- int whichbyte = 1;
- struct timeval waittime;
- fd_set mask;
-
- /* if these seems like a lot of trouble to go to, it probably is */
- waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND;
- waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) *
- (1000000 / MILLI_PER_SECOND);
- FD_ZERO(&mask);
- FD_SET(fd, &mask);
- (void)Select(fd + 1, &mask, NULL, NULL, &waittime);
- /* try to read the byte-order of the connection */
- (void)_XSERVTransRead(trans_conn, &byteOrder, 1);
- if ((byteOrder == 'l') || (byteOrder == 'B'))
- {
- csp.success = xFalse;
- csp.lengthReason = sizeof(NOROOM) - 1;
- csp.length = (sizeof(NOROOM) + 2) >> 2;
- csp.majorVersion = X_PROTOCOL;
- csp.minorVersion = X_PROTOCOL_REVISION;
- if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (byteOrder == 'l')))
- {
- swaps(&csp.majorVersion, whichbyte);
- swaps(&csp.minorVersion, whichbyte);
- swaps(&csp.length, whichbyte);
- }
- iov[0].iov_len = sz_xConnSetupPrefix;
- iov[0].iov_base = (char *) &csp;
- iov[1].iov_len = csp.lengthReason;
- iov[1].iov_base = NOROOM;
- iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3;
- iov[2].iov_base = pad;
- (void)_XSERVTransWritev(trans_conn, iov, 3);
- }
-}
-
-/************
- * CloseDownFileDescriptor:
- * Remove this file descriptor and it's I/O buffers, etc.
- ************/
-
-#ifdef LBX
-void
-CloseDownFileDescriptor(ClientPtr client)
-#else
-static void
-CloseDownFileDescriptor(OsCommPtr oc)
-#endif
-{
-#ifdef LBX
- OsCommPtr oc = (OsCommPtr) client->osPrivate;
-#endif
- int connection = oc->fd;
-
- if (oc->trans_conn) {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- }
-#ifndef LBX
- FreeOsBuffers(oc);
- xfree(oc);
-#endif
- ConnectionTranslation[connection] = 0;
- FD_CLR(connection, &AllSockets);
- FD_CLR(connection, &AllClients);
- FD_CLR(connection, &ClientsWithInput);
- FD_CLR(connection, &GrabImperviousClients);
- if (GrabInProgress)
- {
- FD_CLR(connection, &SavedAllSockets);
- FD_CLR(connection, &SavedAllClients);
- FD_CLR(connection, &SavedClientsWithInput);
- }
- FD_CLR(connection, &ClientsWriteBlocked);
- if (!XFD_ANYSET(&ClientsWriteBlocked))
- AnyClientsWriteBlocked = FALSE;
- FD_CLR(connection, &OutputPending);
-}
-
-/*****************
- * CheckConnections
- * Some connection has died, go find which one and shut it down
- * The file descriptor has been closed, but is still in AllClients.
- * If would truly be wonderful if select() would put the bogus
- * file descriptors in the exception mask, but nooooo. So we have
- * to check each and every socket individually.
- *****************/
-
-void
-CheckConnections(void)
-{
-#ifndef WIN32
- fd_mask mask;
-#endif
- fd_set tmask;
- int curclient, curoff;
- int i;
- struct timeval notime;
- int r;
-#ifdef WIN32
- fd_set savedAllClients;
-#endif
-
- notime.tv_sec = 0;
- notime.tv_usec = 0;
-
-#ifndef WIN32
- for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
- {
- mask = AllClients.fds_bits[i];
- while (mask)
- {
- curoff = ffs (mask) - 1;
- curclient = curoff + (i * (sizeof(fd_mask)*8));
- FD_ZERO(&tmask);
- FD_SET(curclient, &tmask);
- r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
- if (r < 0)
- CloseDownClient(clients[ConnectionTranslation[curclient]]);
- mask &= ~((fd_mask)1 << curoff);
- }
- }
-#else
- XFD_COPYSET(&AllClients, &savedAllClients);
- for (i = 0; i < XFD_SETCOUNT(&savedAllClients); i++)
- {
- curclient = XFD_FD(&savedAllClients, i);
- FD_ZERO(&tmask);
- FD_SET(curclient, &tmask);
- r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
- if (r < 0)
- CloseDownClient(clients[ConnectionTranslation[curclient]]);
- }
-#endif
-}
-
-
-/*****************
- * CloseDownConnection
- * Delete client from AllClients and free resources
- *****************/
-
-void
-CloseDownConnection(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
-
- if (oc->output && oc->output->count)
- FlushClient(client, oc, (char *)NULL, 0);
-#ifdef XDMCP
- XdmcpCloseDisplay(oc->fd);
-#endif
-#ifndef LBX
- CloseDownFileDescriptor(oc);
-#else
- (*oc->Close) (client);
- FreeOsBuffers(oc);
- xfree(oc);
-#endif
- client->osPrivate = (pointer)NULL;
- if (auditTrailLevel > 1)
- AuditF("client %d disconnected\n", client->index);
-}
-
-void
-AddEnabledDevice(int fd)
-{
- FD_SET(fd, &EnabledDevices);
- FD_SET(fd, &AllSockets);
- if (GrabInProgress)
- FD_SET(fd, &SavedAllSockets);
-}
-
-void
-RemoveEnabledDevice(int fd)
-{
- FD_CLR(fd, &EnabledDevices);
- FD_CLR(fd, &AllSockets);
- if (GrabInProgress)
- FD_CLR(fd, &SavedAllSockets);
-}
-
-/*****************
- * OnlyListenToOneClient:
- * Only accept requests from one client. Continue to handle new
- * connections, but don't take any protocol requests from the new
- * ones. Note that if GrabInProgress is set, EstablishNewConnections
- * needs to put new clients into SavedAllSockets and SavedAllClients.
- * Note also that there is no timeout for this in the protocol.
- * This routine is "undone" by ListenToAllClients()
- *****************/
-
-void
-OnlyListenToOneClient(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- int connection = oc->fd;
-
- if (! GrabInProgress)
- {
- XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput);
- XFD_ANDSET(&ClientsWithInput,
- &ClientsWithInput, &GrabImperviousClients);
- if (FD_ISSET(connection, &SavedClientsWithInput))
- {
- FD_CLR(connection, &SavedClientsWithInput);
- FD_SET(connection, &ClientsWithInput);
- }
- XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients);
- XFD_COPYSET(&AllSockets, &SavedAllSockets);
- XFD_COPYSET(&AllClients, &SavedAllClients);
- XFD_UNSET(&AllSockets, &AllClients);
- XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients);
- FD_SET(connection, &AllClients);
- XFD_ORSET(&AllSockets, &AllSockets, &AllClients);
- GrabInProgress = client->index;
- }
-}
-
-/****************
- * ListenToAllClients:
- * Undoes OnlyListentToOneClient()
- ****************/
-
-void
-ListenToAllClients(void)
-{
- if (GrabInProgress)
- {
- XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets);
- XFD_ORSET(&AllClients, &AllClients, &SavedAllClients);
- XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput);
- GrabInProgress = 0;
- }
-}
-
-/****************
- * IgnoreClient
- * Removes one client from input masks.
- * Must have cooresponding call to AttendClient.
- ****************/
-
-void
-IgnoreClient (ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- int connection = oc->fd;
-#ifdef LBX
- LbxClientPtr lbxClient = LbxClient(client);
-#endif
-
- isItTimeToYield = TRUE;
-#ifdef LBX
- if (lbxClient) {
- lbxClient->ignored = TRUE;
- return;
- }
-#endif
- if (!GrabInProgress || FD_ISSET(connection, &AllClients))
- {
- if (FD_ISSET (connection, &ClientsWithInput))
- FD_SET(connection, &IgnoredClientsWithInput);
- else
- FD_CLR(connection, &IgnoredClientsWithInput);
- FD_CLR(connection, &ClientsWithInput);
- FD_CLR(connection, &AllSockets);
- FD_CLR(connection, &AllClients);
- FD_CLR(connection, &LastSelectMask);
- }
- else
- {
- if (FD_ISSET (connection, &SavedClientsWithInput))
- FD_SET(connection, &IgnoredClientsWithInput);
- else
- FD_CLR(connection, &IgnoredClientsWithInput);
- FD_CLR(connection, &SavedClientsWithInput);
- FD_CLR(connection, &SavedAllSockets);
- FD_CLR(connection, &SavedAllClients);
- }
-}
-
-/****************
- * AttendClient
- * Adds one client back into the input masks.
- ****************/
-
-void
-AttendClient (ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- int connection = oc->fd;
-#ifdef LBX
- LbxClientPtr lbxClient = LbxClient(client);
-
- if (lbxClient) {
- lbxClient->ignored = FALSE;
- return;
- }
-#endif
- if (!GrabInProgress || GrabInProgress == client->index ||
- FD_ISSET(connection, &GrabImperviousClients))
- {
- FD_SET(connection, &AllClients);
- FD_SET(connection, &AllSockets);
- FD_SET(connection, &LastSelectMask);
- if (FD_ISSET (connection, &IgnoredClientsWithInput))
- FD_SET(connection, &ClientsWithInput);
- }
- else
- {
- FD_SET(connection, &SavedAllClients);
- FD_SET(connection, &SavedAllSockets);
- if (FD_ISSET(connection, &IgnoredClientsWithInput))
- FD_SET(connection, &SavedClientsWithInput);
- }
-}
-
-/* make client impervious to grabs; assume only executing client calls this */
-
-void
-MakeClientGrabImpervious(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- int connection = oc->fd;
-
- FD_SET(connection, &GrabImperviousClients);
-
- if (ServerGrabCallback)
- {
- ServerGrabInfoRec grabinfo;
- grabinfo.client = client;
- grabinfo.grabstate = CLIENT_IMPERVIOUS;
- CallCallbacks(&ServerGrabCallback, &grabinfo);
- }
-}
-
-/* make client pervious to grabs; assume only executing client calls this */
-
-void
-MakeClientGrabPervious(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- int connection = oc->fd;
-
- FD_CLR(connection, &GrabImperviousClients);
- if (GrabInProgress && (GrabInProgress != client->index))
- {
- if (FD_ISSET(connection, &ClientsWithInput))
- {
- FD_SET(connection, &SavedClientsWithInput);
- FD_CLR(connection, &ClientsWithInput);
- }
- FD_CLR(connection, &AllSockets);
- FD_CLR(connection, &AllClients);
- isItTimeToYield = TRUE;
- }
-
- if (ServerGrabCallback)
- {
- ServerGrabInfoRec grabinfo;
- grabinfo.client = client;
- grabinfo.grabstate = CLIENT_PERVIOUS;
- CallCallbacks(&ServerGrabCallback, &grabinfo);
- }
-}
-
diff --git a/os/io.c b/os/io.c
deleted file mode 100644
index cf8a0343e..000000000
--- a/os/io.c
+++ /dev/null
@@ -1,1339 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-******************************************************************/
-/* $Xorg: io.c,v 1.6 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*****************************************************************
- * i/o functions
- *
- * WriteToClient, ReadRequestFromClient
- * InsertFakeRequest, ResetCurrentRequest
- *
- *****************************************************************/
-/* $XFree86: xc/programs/Xserver/os/io.c,v 3.35 2003/04/27 21:31:08 herrb Exp $ */
-
-#if 0
-#define DEBUG_COMMUNICATION
-#endif
-#ifdef WIN32
-#include <X11/Xwinsock.h>
-#endif
-#include <stdio.h>
-#include <X11/Xtrans.h>
-#include "Xmd.h"
-#include <errno.h>
-#if !defined(__UNIXOS2__) && !defined(WIN32)
-#ifndef Lynx
-#include <sys/uio.h>
-#else
-#include <uio.h>
-#endif
-#endif
-#include "X.h"
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "os.h"
-#include "osdep.h"
-#include "Xpoll.h"
-#include "opaque.h"
-#include "dixstruct.h"
-#include "misc.h"
-#ifdef LBX
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxserve.h"
-#endif
-
-CallbackListPtr ReplyCallback;
-CallbackListPtr FlushCallback;
-
-/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
- * systems are broken and return EWOULDBLOCK when they should return EAGAIN
- */
-#ifndef __UNIXOS2__
-#if defined(EAGAIN) && defined(EWOULDBLOCK)
-#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
-#else
-#ifdef EAGAIN
-#define ETEST(err) (err == EAGAIN)
-#else
-#define ETEST(err) (err == EWOULDBLOCK)
-#endif
-#endif
-#else /* __UNIXOS2__ Writing to full pipes may return ENOSPC */
-#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK || err == ENOSPC)
-#endif
-
-Bool CriticalOutputPending;
-int timesThisConnection = 0;
-ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
-ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
-OsCommPtr AvailableInput = (OsCommPtr)NULL;
-
-#define get_req_len(req,cli) ((cli)->swapped ? \
- lswaps((req)->length) : (req)->length)
-
-#ifdef BIGREQS
-#include "bigreqstr.h"
-
-#define get_big_req_len(req,cli) ((cli)->swapped ? \
- lswapl(((xBigReq *)(req))->length) : \
- ((xBigReq *)(req))->length)
-#endif
-
-#define MAX_TIMES_PER 10
-
-/*
- * A lot of the code in this file manipulates a ConnectionInputPtr:
- *
- * -----------------------------------------------
- * |------- bufcnt ------->| | |
- * | |- gotnow ->| | |
- * | |-------- needed ------>| |
- * |-----------+--------- size --------+---------->|
- * -----------------------------------------------
- * ^ ^
- * | |
- * buffer bufptr
- *
- * buffer is a pointer to the start of the buffer.
- * bufptr points to the start of the current request.
- * bufcnt counts how many bytes are in the buffer.
- * size is the size of the buffer in bytes.
- *
- * In several of the functions, gotnow and needed are local variables
- * that do the following:
- *
- * gotnow is the number of bytes of the request that we're
- * trying to read that are currently in the buffer.
- * Typically, gotnow = (buffer + bufcnt) - bufptr
- *
- * needed = the length of the request that we're trying to
- * read. Watch out: needed sometimes counts bytes and sometimes
- * counts CARD32's.
- */
-
-
-/*****************************************************************
- * ReadRequestFromClient
- * Returns one request in client->requestBuffer. The request
- * length will be in client->req_len. Return status is:
- *
- * > 0 if successful, specifies length in bytes of the request
- * = 0 if entire request is not yet available
- * < 0 if client should be terminated
- *
- * The request returned must be contiguous so that it can be
- * cast in the dispatcher to the correct request type. Because requests
- * are variable length, ReadRequestFromClient() must look at the first 4
- * or 8 bytes of a request to determine the length (the request length is
- * in the 3rd and 4th bytes of the request unless it is a Big Request
- * (see the Big Request Extension), in which case the 3rd and 4th bytes
- * are zero and the following 4 bytes are the request length.
- *
- * Note: in order to make the server scheduler (WaitForSomething())
- * "fair", the ClientsWithInput mask is used. This mask tells which
- * clients have FULL requests left in their buffers. Clients with
- * partial requests require a read. Basically, client buffers
- * are drained before select() is called again. But, we can't keep
- * reading from a client that is sending buckets of data (or has
- * a partial request) because others clients need to be scheduled.
- *****************************************************************/
-
-#define YieldControl() \
- { isItTimeToYield = TRUE; \
- timesThisConnection = 0; }
-#define YieldControlNoInput() \
- { YieldControl(); \
- FD_CLR(fd, &ClientsWithInput); }
-#define YieldControlDeath() \
- { timesThisConnection = 0; }
-
-#ifdef hpux_not_tog
-#define LBX_NEED_OLD_SYMBOL_FOR_LOADABLES
-#endif
-
-#ifdef LBX
-#ifdef LBX_NEED_OLD_SYMBOL_FOR_LOADABLES
-#undef ReadRequestFromClient
-int
-ReadRequestFromClient(ClientPtr client)
-{
- return (*client->readRequest)(client);
-}
-#endif
-int
-StandardReadRequestFromClient(ClientPtr client)
-#else
-int
-ReadRequestFromClient(ClientPtr client)
-#endif
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- unsigned int gotnow, needed;
- int result;
- register xReq *request;
- Bool need_header;
-#ifdef BIGREQS
- Bool move_header;
-#endif
-
- /* If an input buffer was empty, either free it if it is too big
- * or link it into our list of free input buffers. This means that
- * different clients can share the same input buffer (at different
- * times). This was done to save memory.
- */
-
- if (AvailableInput)
- {
- if (AvailableInput != oc)
- {
- register ConnectionInputPtr aci = AvailableInput->input;
- if (aci->size > BUFWATERMARK)
- {
- xfree(aci->buffer);
- xfree(aci);
- }
- else
- {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr)NULL;
- }
- AvailableInput = (OsCommPtr)NULL;
- }
-
- /* make sure we have an input buffer */
-
- if (!oci)
- {
- if ((oci = FreeInputs))
- {
- FreeInputs = oci->next;
- }
- else if (!(oci = AllocateInputBuffer()))
- {
- YieldControlDeath();
- return -1;
- }
- oc->input = oci;
- }
-
- /* advance to start of next request */
-
- oci->bufptr += oci->lenLastReq;
-
- need_header = FALSE;
-#ifdef BIGREQS
- move_header = FALSE;
-#endif
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if (gotnow < sizeof(xReq))
- {
- /* We don't have an entire xReq yet. Can't tell how big
- * the request will be until we get the whole xReq.
- */
- needed = sizeof(xReq);
- need_header = TRUE;
- }
- else
- {
- /* We have a whole xReq. We can tell how big the whole
- * request will be unless it is a Big Request.
- */
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
-#ifdef BIGREQS
- if (!needed && client->big_requests)
- {
- /* It's a Big Request. */
- move_header = TRUE;
- if (gotnow < sizeof(xBigReq))
- {
- /* Still need more data to tell just how big. */
- needed = sizeof(xBigReq) >> 2; /* needed is in CARD32s now */
- need_header = TRUE;
- }
- else
- needed = get_big_req_len(request, client);
- }
-#endif
- client->req_len = needed;
- needed <<= 2; /* needed is in bytes now */
- }
- if (gotnow < needed)
- {
- /* Need to read more data, either so that we can get a
- * complete xReq (if need_header is TRUE), a complete
- * xBigReq (if move_header is TRUE), or the rest of the
- * request (if need_header and move_header are both FALSE).
- */
-
- oci->lenLastReq = 0;
- if (needed > MAXBUFSIZE)
- {
- /* request is too big for us to handle */
- YieldControlDeath();
- return -1;
- }
- if ((gotnow == 0) ||
- ((oci->bufptr - oci->buffer + needed) > oci->size))
- {
- /* no data, or 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;
- }
- 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;
- }
-#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;
- }
- oci->bufcnt += result;
- gotnow += result;
- /* 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;
- }
- }
- if (need_header && gotnow >= needed)
- {
- /* We wanted an xReq, now we've gotten it. */
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
-#ifdef BIGREQS
- if (!needed && client->big_requests)
- {
- move_header = TRUE;
- if (gotnow < sizeof(xBigReq))
- needed = sizeof(xBigReq) >> 2;
- else
- needed = get_big_req_len(request, client);
- }
-#endif
- client->req_len = needed;
- needed <<= 2;
- }
- if (gotnow < needed)
- {
- /* Still don't have enough; punt. */
- YieldControlNoInput();
- return 0;
- }
- }
- if (needed == 0)
- {
-#ifdef BIGREQS
- if (client->big_requests)
- needed = sizeof(xBigReq);
- else
-#endif
- needed = sizeof(xReq);
- }
- oci->lenLastReq = needed;
-
- /*
- * Check to see if client has at least one whole request in the
- * buffer beyond the request we're returning to the caller.
- * If there is only a partial request, treat like buffer
- * is empty so that select() will be called again and other clients
- * can get into the queue.
- */
-
- gotnow -= needed;
- if (gotnow >= sizeof(xReq))
- {
- request = (xReq *)(oci->bufptr + needed);
- if (gotnow >= (result = (get_req_len(request, client) << 2))
-#ifdef BIGREQS
- && (result ||
- (client->big_requests &&
- (gotnow >= sizeof(xBigReq) &&
- gotnow >= (get_big_req_len(request, client) << 2))))
-#endif
- )
- FD_SET(fd, &ClientsWithInput);
- else
- {
-#ifdef SMART_SCHEDULE
- if (!SmartScheduleDisable)
- FD_CLR(fd, &ClientsWithInput);
- else
-#endif
- YieldControlNoInput();
- }
- }
- else
- {
- if (!gotnow)
- AvailableInput = oc;
-#ifdef SMART_SCHEDULE
- if (!SmartScheduleDisable)
- FD_CLR(fd, &ClientsWithInput);
- else
-#endif
- YieldControlNoInput();
- }
-#ifdef SMART_SCHEDULE
- if (SmartScheduleDisable)
-#endif
- if (++timesThisConnection >= MAX_TIMES_PER)
- YieldControl();
-#ifdef BIGREQS
- if (move_header)
- {
- request = (xReq *)oci->bufptr;
- oci->bufptr += (sizeof(xBigReq) - sizeof(xReq));
- *(xReq *)oci->bufptr = *request;
- oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
- 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",
- client->index,req->reqType,req->data,req->length);
- }
-#endif
- return needed;
-}
-
-/*****************************************************************
- * InsertFakeRequest
- * Splice a consed up (possibly partial) request in as the next request.
- *
- **********************/
-
-Bool
-InsertFakeRequest(ClientPtr client, char *data, int count)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- int gotnow, moveup;
-
- if (AvailableInput)
- {
- if (AvailableInput != oc)
- {
- ConnectionInputPtr aci = AvailableInput->input;
- if (aci->size > BUFWATERMARK)
- {
- xfree(aci->buffer);
- xfree(aci);
- }
- else
- {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr)NULL;
- }
- AvailableInput = (OsCommPtr)NULL;
- }
- if (!oci)
- {
- if ((oci = FreeInputs))
- FreeInputs = oci->next;
- else if (!(oci = AllocateInputBuffer()))
- return FALSE;
- oc->input = oci;
- }
- oci->bufptr += oci->lenLastReq;
- oci->lenLastReq = 0;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if ((gotnow + count) > oci->size)
- {
- char *ibuf;
-
- ibuf = (char *)xrealloc(oci->buffer, gotnow + count);
- if (!ibuf)
- return(FALSE);
- oci->size = gotnow + count;
- oci->buffer = ibuf;
- oci->bufptr = ibuf + oci->bufcnt - gotnow;
- }
- moveup = count - (oci->bufptr - oci->buffer);
- if (moveup > 0)
- {
- if (gotnow > 0)
- memmove(oci->bufptr + moveup, oci->bufptr, gotnow);
- oci->bufptr += moveup;
- oci->bufcnt += moveup;
- }
- memmove(oci->bufptr - count, data, count);
- oci->bufptr -= count;
- gotnow += count;
- if ((gotnow >= sizeof(xReq)) &&
- (gotnow >= (int)(get_req_len((xReq *)oci->bufptr, client) << 2)))
- FD_SET(fd, &ClientsWithInput);
- else
- YieldControlNoInput();
- return(TRUE);
-}
-
-/*****************************************************************
- * ResetRequestFromClient
- * Reset to reexecute the current request, and yield.
- *
- **********************/
-
-void
-ResetCurrentRequest(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- register ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- register xReq *request;
- int gotnow, needed;
-#ifdef LBX
- LbxClientPtr lbxClient = LbxClient(client);
-
- if (lbxClient) {
- LbxSetForBlock(lbxClient);
- if (!oci) {
- AppendFakeRequest(client,
- client->requestBuffer, client->req_len << 2);
- return;
- }
- }
-#endif
- if (AvailableInput == oc)
- AvailableInput = (OsCommPtr)NULL;
- oci->lenLastReq = 0;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if (gotnow < sizeof(xReq))
- {
- YieldControlNoInput();
- }
- else
- {
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
-#ifdef BIGREQS
- if (!needed && client->big_requests)
- {
- oci->bufptr -= sizeof(xBigReq) - sizeof(xReq);
- *(xReq *)oci->bufptr = *request;
- ((xBigReq *)oci->bufptr)->length = client->req_len;
- if (client->swapped)
- {
- char n;
- swapl(&((xBigReq *)oci->bufptr)->length, n);
- }
- }
-#endif
- if (gotnow >= (needed << 2))
- {
- if (FD_ISSET(fd, &AllClients))
- {
- FD_SET(fd, &ClientsWithInput);
- }
- else
- {
- FD_SET(fd, &IgnoredClientsWithInput);
- }
- YieldControl();
- }
- else
- YieldControlNoInput();
- }
-}
-
-
-
-/*****************************************************************
- * PeekNextRequest and SkipRequests were implemented to support DBE
- * idioms, but can certainly be used outside of DBE. There are two
- * related macros in os.h, ReqLen and CastxReq. See the porting
- * layer document for more details.
- *
- **********************/
-
-
-/*****************************************************************
- * PeekNextRequest
- * lets you look ahead at the unexecuted requests in a
- * client's request buffer.
- *
- * Note: this implementation of PeekNextRequest ignores the
- * readmore parameter.
- *
- **********************/
-
-xReqPtr
-PeekNextRequest(
- xReqPtr req, /* request we're starting from */
- ClientPtr client, /* client whose requests we're skipping */
- Bool readmore) /* attempt to read more if next request isn't there? */
-{
- register ConnectionInputPtr oci = ((OsCommPtr)client->osPrivate)->input;
- xReqPtr pnextreq;
- int needed, gotnow, reqlen;
-
- if (!oci) return NULL;
-
- if (!req)
- {
- /* caller wants the request after the one currently being executed */
- pnextreq = (xReqPtr)
- (((CARD32 *)client->requestBuffer) + client->req_len);
- }
- else
- {
- /* caller wants the request after the one specified by req */
- reqlen = get_req_len(req, client);
-#ifdef BIGREQS
- if (!reqlen) reqlen = get_big_req_len(req, client);
-#endif
- pnextreq = (xReqPtr)(((char *)req) + (reqlen << 2));
- }
-
- /* see how much of the next request we have available */
-
- gotnow = oci->bufcnt - (((char *)pnextreq) - oci->buffer);
-
- if (gotnow < sizeof(xReq))
- return NULL;
-
- needed = get_req_len(pnextreq, client) << 2;
-#ifdef BIGREQS
- if (!needed)
- {
- /* it's a big request */
- if (gotnow < sizeof(xBigReq))
- return NULL;
- needed = get_big_req_len(pnextreq, client) << 2;
- }
-#endif
-
- /* if we have less than we need, return NULL */
-
- return (gotnow < needed) ? NULL : pnextreq;
-}
-
-/*****************************************************************
- * SkipRequests
- * lets you skip over some of the requests in a client's
- * request buffer. Presumably the caller has used PeekNextRequest
- * to examine the requests being skipped and has performed whatever
- * actions they dictate.
- *
- **********************/
-
-CallbackListPtr SkippedRequestsCallback = NULL;
-
-void
-SkipRequests(
- xReqPtr req, /* last request being skipped */
- ClientPtr client, /* client whose requests we're skipping */
- int numskipped) /* how many requests we're skipping */
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- register ConnectionInputPtr oci = oc->input;
- int reqlen;
-
- /* see if anyone wants to snoop the skipped requests */
-
- if (SkippedRequestsCallback)
- {
- SkippedRequestInfoRec skipinfo;
- skipinfo.req = req;
- skipinfo.client = client;
- skipinfo.numskipped = numskipped;
- CallCallbacks(&SkippedRequestsCallback, &skipinfo);
- }
-
- /* adjust the sequence number */
- client->sequence += numskipped;
-
- /* twiddle the oci to skip over the requests */
-
- reqlen = get_req_len(req, client);
-#ifdef BIGREQS
- if (!reqlen) reqlen = get_big_req_len(req, client);
-#endif
- reqlen <<= 2;
- oci->bufptr = (char *)req;
- oci->lenLastReq = reqlen;
-
- /* see if any requests left in the buffer */
-
- if ( ((char *)req + reqlen) == (oci->buffer + oci->bufcnt) )
- {
- /* no requests; mark input buffer as available and client
- * as having no input
- */
- int fd = oc->fd;
- AvailableInput = oc;
- YieldControlNoInput();
- }
-}
-
-
- /* lookup table for adding padding bytes to data that is read from
- or written to the X socket. */
-static int padlength[4] = {0, 3, 2, 1};
-
- /********************
- * FlushAllOutput()
- * Flush all clients with output. However, if some client still
- * has input in the queue (more requests), then don't flush. This
- * will prevent the output queue from being flushed every time around
- * the round robin queue. Now, some say that it SHOULD be flushed
- * every time around, but...
- *
- **********************/
-
-void
-FlushAllOutput(void)
-{
- register int index, base;
- register fd_mask mask; /* raphael */
- OsCommPtr oc;
- register ClientPtr client;
- Bool newoutput = NewOutputPending;
-#if defined(WIN32)
- fd_set newOutputPending;
-#endif
-
- if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
-
- if (!newoutput)
- return;
-
- /*
- * It may be that some client still has critical output pending,
- * but he is not yet ready to receive it anyway, so we will
- * simply wait for the select to tell us when he's ready to receive.
- */
- CriticalOutputPending = FALSE;
- NewOutputPending = FALSE;
-
-#ifndef WIN32
- for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
- {
- mask = OutputPending.fds_bits[ base ];
- OutputPending.fds_bits[ base ] = 0;
- while (mask)
- {
- index = ffs(mask) - 1;
- mask &= ~lowbit(mask);
- if ((index = ConnectionTranslation[(base * (sizeof(fd_mask)*8)) + index]) == 0)
- continue;
- client = clients[index];
- if (client->clientGone)
- continue;
- oc = (OsCommPtr)client->osPrivate;
- if (
-#ifdef LBX
- !oc->proxy &&
-#endif
- FD_ISSET(oc->fd, &ClientsWithInput))
- {
- FD_SET(oc->fd, &OutputPending); /* set the bit again */
- NewOutputPending = TRUE;
- }
- else
- (void)FlushClient(client, oc, (char *)NULL, 0);
- }
- }
-#else /* WIN32 */
- FD_ZERO(&newOutputPending);
- for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++)
- {
- index = XFD_FD(&OutputPending, base);
- if ((index = ConnectionTranslation[index]) == 0)
- continue;
- client = clients[index];
- if (client->clientGone)
- continue;
- oc = (OsCommPtr)client->osPrivate;
- if (
-#ifdef LBX
- !oc->proxy &&
-#endif
- FD_ISSET(oc->fd, &ClientsWithInput))
- {
- FD_SET(oc->fd, &newOutputPending); /* set the bit again */
- NewOutputPending = TRUE;
- }
- else
- (void)FlushClient(client, oc, (char *)NULL, 0);
- }
- XFD_COPYSET(&newOutputPending, &OutputPending);
-#endif /* WIN32 */
-}
-
-void
-FlushIfCriticalOutputPending(void)
-{
- if (CriticalOutputPending)
- FlushAllOutput();
-}
-
-void
-SetCriticalOutputPending(void)
-{
- CriticalOutputPending = TRUE;
-}
-
-/*****************
- * WriteToClient
- * Copies buf into ClientPtr.buf if it fits (with padding), else
- * flushes ClientPtr.buf and buf to client. As of this writing,
- * every use of WriteToClient is cast to void, and the result
- * is ignored. Potentially, this could be used by requests
- * that are sending several chunks of data and want to break
- * out of a loop on error. Thus, we will leave the type of
- * this routine as int.
- *****************/
-
-int
-WriteToClient (ClientPtr who, int count, char *buf)
-{
- OsCommPtr oc = (OsCommPtr)who->osPrivate;
- ConnectionOutputPtr oco = oc->output;
- int padBytes;
-#ifdef DEBUG_COMMUNICATION
- Bool multicount = FALSE;
-#endif
- if (!count)
- return(0);
-#ifdef DEBUG_COMMUNICATION
- {
- char info[128];
- xError *err;
- xGenericReply *rep;
- xEvent *ev;
-
- if (!who->replyBytesRemaining) {
- switch(buf[0]) {
- case X_Reply:
- rep = (xGenericReply*)buf;
- if (rep->sequenceNumber == who->sequence) {
- snprintf(info,127,"Xreply: type: 0x%x data: 0x%x "
- "len: %i seq#: 0x%x", rep->type, rep->data1,
- rep->length, rep->sequenceNumber);
- multicount = TRUE;
- }
- break;
- case X_Error:
- err = (xError*)buf;
- snprintf(info,127,"Xerror: Code: 0x%x resID: 0x%x maj: 0x%x "
- "min: %x", err->errorCode,err->resourceID,
- err->minorCode,err->majorCode);
- break;
- default:
- if ((buf[0] & 0x7f) == KeymapNotify)
- snprintf(info,127,"KeymapNotifyEvent: %i",buf[0]);
- else {
- ev = (xEvent*)buf;
- snprintf(info,127,"XEvent: type: 0x%x detail: 0x%x "
- "seq#: 0x%x", ev->u.u.type, ev->u.u.detail,
- ev->u.u.sequenceNumber);
- }
- }
- ErrorF("REPLY: ClientIDX: %i %s\n",who->index, info);
- } else
- multicount = TRUE;
- }
-#endif
-
- if (!oco)
- {
- if ((oco = FreeOutputs))
- {
- FreeOutputs = oco->next;
- }
- else if (!(oco = AllocateOutputBuffer()))
- {
- if (oc->trans_conn) {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- }
- MarkClientException(who);
- return -1;
- }
- oc->output = oco;
- }
-
- padBytes = padlength[count & 3];
-
- if(ReplyCallback)
- {
- ReplyInfoRec replyinfo;
-
- replyinfo.client = who;
- replyinfo.replyData = buf;
- replyinfo.dataLenBytes = count + padBytes;
- if (who->replyBytesRemaining)
- { /* still sending data of an earlier reply */
- who->replyBytesRemaining -= count + padBytes;
- replyinfo.startOfReply = FALSE;
- replyinfo.bytesRemaining = who->replyBytesRemaining;
- CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
- }
- else if (who->clientState == ClientStateRunning
- && buf[0] == X_Reply)
- { /* start of new reply */
- CARD32 replylen;
- unsigned long bytesleft;
- char n;
-
- replylen = ((xGenericReply *)buf)->length;
- if (who->swapped)
- swapl(&replylen, n);
- bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
- replyinfo.startOfReply = TRUE;
- replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
- CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
- }
- }
-#ifdef DEBUG_COMMUNICATION
- else if (multicount) {
- if (who->replyBytesRemaining) {
- who->replyBytesRemaining -= (count + padBytes);
- } else {
- CARD32 replylen;
- replylen = ((xGenericReply *)buf)->length;
- who->replyBytesRemaining =
- (replylen * 4) + SIZEOF(xReply) - count - padBytes;
- }
- }
-#endif
- if (oco->count + count + padBytes > oco->size)
- {
- FD_CLR(oc->fd, &OutputPending);
- if(!XFD_ANYSET(&OutputPending)) {
- CriticalOutputPending = FALSE;
- NewOutputPending = FALSE;
- }
- return FlushClient(who, oc, buf, count);
- }
-
- NewOutputPending = TRUE;
- FD_SET(oc->fd, &OutputPending);
- memmove((char *)oco->buf + oco->count, buf, count);
- oco->count += count + padBytes;
- return(count);
-}
-
- /********************
- * FlushClient()
- * If the client isn't keeping up with us, then we try to continue
- * buffering the data and set the apropriate bit in ClientsWritable
- * (which is used by WaitFor in the select). If the connection yields
- * a permanent error, or we can't allocate any more space, we then
- * close the connection.
- *
- **********************/
-
-#ifdef LBX
-#ifdef LBX_NEED_OLD_SYMBOL_FOR_LOADABLES
-#undef FlushClient
-int
-FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
-{
- return (*oc->Flush)(who, oc, extraBuf, extraCount);
-}
-#endif
-int
-StandardFlushClient(ClientPtr who, OsCommPtr oc,
- char *extraBuf, int extraCount)
-#else
-int
-FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
-#endif
-{
- ConnectionOutputPtr oco = oc->output;
- int connection = oc->fd;
- XtransConnInfo trans_conn = oc->trans_conn;
- struct iovec iov[3];
- static char padBuffer[3];
- long written;
- long padsize;
- long notWritten;
- long todo;
-
- if (!oco)
- return 0;
- written = 0;
- padsize = padlength[extraCount & 3];
- notWritten = oco->count + extraCount + padsize;
- todo = notWritten;
- while (notWritten) {
- long before = written; /* amount of whole thing written */
- long remain = todo; /* amount to try this time, <= notWritten */
- int i = 0;
- long len;
-
- /* You could be very general here and have "in" and "out" iovecs
- * and write a loop without using a macro, but what the heck. This
- * translates to:
- *
- * how much of this piece is new?
- * if more new then we are trying this time, clamp
- * if nothing new
- * then bump down amount already written, for next piece
- * else put new stuff in iovec, will need all of next piece
- *
- * Note that todo had better be at least 1 or else we'll end up
- * writing 0 iovecs.
- */
-#define InsertIOV(pointer, length) \
- len = (length) - before; \
- if (len > remain) \
- len = remain; \
- if (len <= 0) { \
- before = (-len); \
- } else { \
- iov[i].iov_len = len; \
- iov[i].iov_base = (pointer) + before; \
- i++; \
- remain -= len; \
- before = 0; \
- }
-
- InsertIOV ((char *)oco->buf, oco->count)
- InsertIOV (extraBuf, extraCount)
- InsertIOV (padBuffer, padsize)
-
- errno = 0;
- if (trans_conn && (len = _XSERVTransWritev(trans_conn, iov, i)) >= 0)
- {
- written += len;
- notWritten -= len;
- todo = notWritten;
- }
- else if (ETEST(errno)
-#ifdef SUNSYSV /* check for another brain-damaged OS bug */
- || (errno == 0)
-#endif
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- || ((errno == EMSGSIZE) && (todo == 1))
-#endif
- )
- {
- /* If we've arrived here, then the client is stuffed to the gills
- and not ready to accept more. Make a note of it and buffer
- the rest. */
- FD_SET(connection, &ClientsWriteBlocked);
- AnyClientsWriteBlocked = TRUE;
-
- if (written < oco->count)
- {
- if (written > 0)
- {
- oco->count -= written;
- memmove((char *)oco->buf,
- (char *)oco->buf + written,
- oco->count);
- written = 0;
- }
- }
- else
- {
- written -= oco->count;
- oco->count = 0;
- }
-
- if (notWritten > oco->size)
- {
- unsigned char *obuf;
-
- obuf = (unsigned char *)xrealloc(oco->buf,
- notWritten + BUFSIZE);
- if (!obuf)
- {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- MarkClientException(who);
- oco->count = 0;
- return(-1);
- }
- oco->size = notWritten + BUFSIZE;
- oco->buf = obuf;
- }
-
- /* If the amount written extended into the padBuffer, then the
- difference "extraCount - written" may be less than 0 */
- if ((len = extraCount - written) > 0)
- memmove ((char *)oco->buf + oco->count,
- extraBuf + written,
- len);
-
- oco->count = notWritten; /* this will include the pad */
- /* return only the amount explicitly requested */
- return extraCount;
- }
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- else if (errno == EMSGSIZE)
- {
- todo >>= 1;
- }
-#endif
- else
- {
- if (oc->trans_conn)
- {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- }
- MarkClientException(who);
- oco->count = 0;
- return(-1);
- }
- }
-
- /* everything was flushed out */
- oco->count = 0;
- /* check to see if this client was write blocked */
- if (AnyClientsWriteBlocked)
- {
- FD_CLR(oc->fd, &ClientsWriteBlocked);
- if (! XFD_ANYSET(&ClientsWriteBlocked))
- AnyClientsWriteBlocked = FALSE;
- }
- if (oco->size > BUFWATERMARK)
- {
- xfree(oco->buf);
- xfree(oco);
- }
- else
- {
- oco->next = FreeOutputs;
- FreeOutputs = oco;
- }
- oc->output = (ConnectionOutputPtr)NULL;
- return extraCount; /* return only the amount explicitly requested */
-}
-
-ConnectionInputPtr
-AllocateInputBuffer(void)
-{
- ConnectionInputPtr oci;
-
- oci = (ConnectionInputPtr)xalloc(sizeof(ConnectionInput));
- if (!oci)
- return (ConnectionInputPtr)NULL;
- oci->buffer = (char *)xalloc(BUFSIZE);
- if (!oci->buffer)
- {
- xfree(oci);
- return (ConnectionInputPtr)NULL;
- }
- oci->size = BUFSIZE;
- oci->bufptr = oci->buffer;
- oci->bufcnt = 0;
- oci->lenLastReq = 0;
- return oci;
-}
-
-ConnectionOutputPtr
-AllocateOutputBuffer(void)
-{
- ConnectionOutputPtr oco;
-
- oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput));
- if (!oco)
- return (ConnectionOutputPtr)NULL;
- oco->buf = (unsigned char *) xalloc(BUFSIZE);
- if (!oco->buf)
- {
- xfree(oco);
- return (ConnectionOutputPtr)NULL;
- }
- oco->size = BUFSIZE;
- oco->count = 0;
-#ifdef LBX
- oco->nocompress = FALSE;
-#endif
- return oco;
-}
-
-void
-FreeOsBuffers(OsCommPtr oc)
-{
- ConnectionInputPtr oci;
- ConnectionOutputPtr oco;
-
- if (AvailableInput == oc)
- AvailableInput = (OsCommPtr)NULL;
- if ((oci = oc->input))
- {
- if (FreeInputs)
- {
- xfree(oci->buffer);
- xfree(oci);
- }
- else
- {
- FreeInputs = oci;
- oci->next = (ConnectionInputPtr)NULL;
- oci->bufptr = oci->buffer;
- oci->bufcnt = 0;
- oci->lenLastReq = 0;
- }
- }
- if ((oco = oc->output))
- {
- if (FreeOutputs)
- {
- xfree(oco->buf);
- xfree(oco);
- }
- else
- {
- FreeOutputs = oco;
- oco->next = (ConnectionOutputPtr)NULL;
- oco->count = 0;
- }
- }
-#ifdef LBX
- if ((oci = oc->largereq)) {
- xfree(oci->buffer);
- xfree(oci);
- }
-#endif
-}
-
-void
-ResetOsBuffers(void)
-{
- ConnectionInputPtr oci;
- ConnectionOutputPtr oco;
-
- while ((oci = FreeInputs))
- {
- FreeInputs = oci->next;
- xfree(oci->buffer);
- xfree(oci);
- }
- while ((oco = FreeOutputs))
- {
- FreeOutputs = oco->next;
- xfree(oco->buf);
- xfree(oco);
- }
-}
diff --git a/os/k5auth.c b/os/k5auth.c
deleted file mode 100644
index 8c59fe8ab..000000000
--- a/os/k5auth.c
+++ /dev/null
@@ -1,797 +0,0 @@
-/* $Xorg: k5auth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*
-
-Copyright 1993, 1994, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/k5auth.c,v 3.5 2001/12/14 20:00:34 dawes Exp $ */
-
-/*
- * Kerberos V5 authentication scheme
- * Author: Tom Yu <tlyu@MIT.EDU>
- *
- * Mostly snarfed wholesale from the user_user demo in the
- * krb5 distribution. (At least the checking part)
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifdef TCPCONN
-#include <netinet/in.h>
-#endif
-#ifdef DNETCONN
-#include <netdnet/dn.h>
-#endif
-#include <arpa/inet.h>
-#include <krb5/krb5.h>
-/* 9/93: krb5.h leaks some symbols */
-#undef BITS32
-#undef xfree
-#include <krb5/los-proto.h>
-#include "X.h"
-#include "os.h"
-#include "osdep.h"
-#include "Xproto.h"
-#include "Xfuncs.h"
-#include "dixstruct.h"
-#include <com_err.h>
-#include "Xauth.h"
-
-extern int (*k5_Vector[256])();
-extern int SendConnSetup();
-extern char *display; /* need this to generate rcache name */
-
-static XID krb5_id = ~0L;
-static krb5_principal srvname = NULL; /* service name */
-static char *ccname = NULL;
-static char *ktname = NULL; /* key table name */
-static char kerror[256];
-
-/*
- * tgt_keyproc:
- *
- * extract session key from a credentials struct
- */
-krb5_error_code tgt_keyproc(keyprocarg, principal, vno, key)
- krb5_pointer keyprocarg;
- krb5_principal principal;
- krb5_kvno vno;
- krb5_keyblock **key;
-{
- krb5_creds *creds = (krb5_creds *)keyprocarg;
-
- return krb5_copy_keyblock(&creds->keyblock, key);
-}
-
-/*
- * k5_cmpenc:
- *
- * compare "encoded" principals
- */
-Bool k5_cmpenc(pname, plen, buf)
- unsigned char *pname;
- short plen;
- krb5_data *buf;
-{
- return (plen == buf->length &&
- memcmp(pname, buf->data, plen) == 0);
-}
-
-/*
- * K5Check:
- *
- * This is stage 0 of the krb5 authentication protocol. It
- * goes through the current credentials cache and extracts the
- * primary principal and tgt to send to the client, or as
- * appropriate, extracts from a keytab.
- *
- * The packet sent to the client has the following format:
- *
- * CARD8 reqType = 2
- * CARD8 data = 0
- * CARD16 length = total length of packet (in 32 bit units)
- * CARD16 plen = length of encoded principal following
- * STRING8 princ = encoded principal
- * STRING8 ticket = server tgt
- *
- * For client-server authentication, the packet is as follows:
- *
- * CARD8 reqType = 3
- * CARD8 data = 0
- * CARD16 length = total length
- * STRING8 princ = encoded principal of server
- */
-XID K5Check(data_length, data, client, reason)
- unsigned short data_length;
- char *data;
- ClientPtr client;
- char **reason;
-{
- krb5_error_code retval;
- CARD16 tlen;
- krb5_principal sprinc, cprinc;
- krb5_ccache cc;
- krb5_creds *creds;
- char *outbuf, *cp;
- krb5_data princ;
- register char n;
- xReq prefix;
-
- if (krb5_id == ~0L)
- return ~0L;
- if (!ccname && !srvname)
- return ~0L;
- if (ccname)
- {
- if ((creds = (krb5_creds *)malloc(sizeof(krb5_creds))) == NULL)
- return ~0L;
- if (retval = krb5_cc_resolve(ccname, &cc))
- return ~0L;
- bzero((char*)creds, sizeof (krb5_creds));
- if (retval = krb5_cc_get_principal(cc, &cprinc))
- {
- krb5_free_creds(creds);
- krb5_cc_close(cc);
- return ~0L;
- }
- creds->client = cprinc;
- if (retval =
- krb5_build_principal_ext(&sprinc,
- krb5_princ_realm(creds->client)->length,
- krb5_princ_realm(creds->client)->data,
- 6, "krbtgt",
- krb5_princ_realm(creds->client)->length,
- krb5_princ_realm(creds->client)->data,
- 0))
- {
- krb5_free_creds(creds);
- krb5_cc_close(cc);
- return ~0L;
- }
- creds->server = sprinc;
- retval = krb5_get_credentials(KRB5_GC_CACHED, cc, creds);
- krb5_cc_close(cc);
- if (retval)
- {
- krb5_free_creds(creds);
- return ~0L;
- }
- if (retval = XauKrb5Encode(cprinc, &princ))
- {
- krb5_free_creds(creds);
- return ~0L;
- }
- tlen = sz_xReq + 2 + princ.length + creds->ticket.length;
- prefix.reqType = 2; /* opcode = authenticate user-to-user */
- }
- else if (srvname)
- {
- if (retval = XauKrb5Encode(srvname, &princ))
- {
- return ~0L;
- }
- tlen = sz_xReq + princ.length;
- prefix.reqType = 3; /* opcode = authenticate client-server */
- }
- prefix.data = 0; /* stage = 0 */
- prefix.length = (tlen + 3) >> 2; /* round up to nearest multiple
- of 4 bytes */
- if (client->swapped)
- {
- swaps(&prefix.length, n);
- }
- if ((cp = outbuf = (char *)malloc(tlen)) == NULL)
- {
- if (ccname)
- {
- krb5_free_creds(creds);
- }
- free(princ.data);
- return ~0L;
- }
- memcpy(cp, &prefix, sz_xReq);
- cp += sz_xReq;
- if (ccname)
- {
- memcpy(cp, &princ.length, 2);
- if (client->swapped)
- {
- swaps((CARD16 *)cp, n);
- }
- cp += 2;
- }
- memcpy(cp, princ.data, princ.length);
- cp += princ.length;
- free(princ.data); /* we don't need that anymore */
- if (ccname)
- memcpy(cp, creds->ticket.data, creds->ticket.length);
- WriteToClient(client, tlen, outbuf);
- free(outbuf);
- client->requestVector = k5_Vector; /* hack in our dispatch vector */
- client->clientState = ClientStateAuthenticating;
- if (ccname)
- {
- ((OsCommPtr)client->osPrivate)->authstate.srvcreds = (pointer)creds; /* save tgt creds */
- ((OsCommPtr)client->osPrivate)->authstate.ktname = NULL;
- ((OsCommPtr)client->osPrivate)->authstate.srvname = NULL;
- }
- if (srvname)
- {
- ((OsCommPtr)client->osPrivate)->authstate.srvcreds = NULL;
- ((OsCommPtr)client->osPrivate)->authstate.ktname = (pointer)ktname;
- ((OsCommPtr)client->osPrivate)->authstate.srvname = (pointer)srvname;
- }
- ((OsCommPtr)client->osPrivate)->authstate.stageno = 1; /* next stage is 1 */
- return krb5_id;
-}
-
-/*
- * k5_stage1:
- *
- * This gets called out of the dispatcher after K5Check frobs with the
- * client->requestVector. It accepts the ap_req from the client and verifies
- * it. In addition, if the client has set AP_OPTS_MUTUAL_REQUIRED, it then
- * sends an ap_rep to the client to achieve mutual authentication.
- *
- * client stage1 packet format is as follows:
- *
- * CARD8 reqType = 1
- * CARD8 data = ignored
- * CARD16 length = total length
- * STRING8 data = the actual ap_req
- *
- * stage2 packet sent back to client for mutual authentication:
- *
- * CARD8 reqType = 2
- * CARD8 data = 2
- * CARD16 length = total length
- * STRING8 data = the ap_rep
- */
-int k5_stage1(client)
- register ClientPtr client;
-{
- long addrlen;
- krb5_error_code retval, retval2;
- register char n;
- struct sockaddr cli_net_addr;
- xReq prefix;
- krb5_principal cprinc;
- krb5_data buf;
- krb5_creds *creds = (krb5_creds *)((OsCommPtr)client->osPrivate)->authstate.srvcreds;
- krb5_keyblock *skey;
- krb5_address cli_addr, **localaddrs = NULL;
- krb5_tkt_authent *authdat;
- krb5_ap_rep_enc_part rep;
- krb5_int32 ctime, cusec;
- krb5_rcache rcache = NULL;
- char *cachename = NULL, *rc_type = NULL, *rc_base = "rcX", *kt = NULL;
- REQUEST(xReq);
-
- if (((OsCommPtr)client->osPrivate)->authstate.stageno != 1)
- {
- if (creds)
- krb5_free_creds(creds);
- return(SendConnSetup(client, "expected Krb5 stage1 packet"));
- }
- addrlen = sizeof (cli_net_addr);
- if (getpeername(((OsCommPtr)client->osPrivate)->fd,
- &cli_net_addr, &addrlen) == -1)
- {
- if (creds)
- krb5_free_creds(creds);
- return(SendConnSetup(client, "Krb5 stage1: getpeername failed"));
- }
- if (cli_net_addr.sa_family == AF_UNSPEC
-#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)
- || cli_net_addr.sa_family == AF_UNIX
-#endif
- ) /* assume local host */
- {
- krb5_os_localaddr(&localaddrs);
- if (!localaddrs || !localaddrs[0])
- {
- if (creds)
- krb5_free_creds(creds);
- return(SendConnSetup(client, "Krb5 failed to get localaddrs"));
- }
- cli_addr.addrtype = localaddrs[0]->addrtype;
- cli_addr.length = localaddrs[0]->length;
- cli_addr.contents = localaddrs[0]->contents;
- }
- else
- {
- cli_addr.addrtype = cli_net_addr.sa_family; /* the values
- are compatible */
- switch (cli_net_addr.sa_family)
- {
-#ifdef TCPCONN
- case AF_INET:
- cli_addr.length = sizeof (struct in_addr);
- cli_addr.contents =
- (krb5_octet *)&((struct sockaddr_in *)&cli_net_addr)->sin_addr;
- break;
-#endif
-#ifdef DNETCONN
- case AF_DECnet:
- cli_addr.length = sizeof (struct dn_naddr);
- cli_addr.contents =
- (krb5_octet *)&((struct sockaddr_dn *)&cli_net_addr)->sdn_add;
- break;
-#endif
- default:
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- sprintf(kerror, "Krb5 stage1: unknown address family %d from getpeername",
- cli_net_addr.sa_family);
- return(SendConnSetup(client, kerror));
- }
- }
- if ((rcache = (krb5_rcache)malloc(sizeof(*rcache))) == NULL)
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- return(SendConnSetup(client, "malloc bombed for krb5_rcache"));
- }
- if ((rc_type = krb5_rc_default_type()) == NULL)
- rc_type = "dfl";
- if (retval = krb5_rc_resolve_type(&rcache, rc_type))
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- free(rcache);
- strcpy(kerror, "krb5_rc_resolve_type failed: ");
- strncat(kerror, error_message(retval), 231);
- return(SendConnSetup(client, kerror));
- }
- if ((cachename = (char *)malloc(strlen(rc_base) + strlen(display) + 1))
- == NULL)
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- free(rcache);
- return(SendConnSetup(client, "Krb5: malloc bombed for cachename"));
- }
- strcpy(cachename, rc_base);
- strcat(cachename, display);
- if (retval = krb5_rc_resolve(rcache, cachename))
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- free(rcache);
- free(cachename);
- strcpy(kerror, "krb5_rc_resolve failed: ");
- strncat(kerror, error_message(retval), 236);
- return(SendConnSetup(client, kerror));
- }
- free(cachename);
- if (krb5_rc_recover(rcache))
- {
- extern krb5_deltat krb5_clockskew;
- if (retval = krb5_rc_initialize(rcache, krb5_clockskew))
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (creds)
- krb5_free_creds(creds);
- if (retval2 = krb5_rc_close(rcache))
- {
- strcpy(kerror, "krb5_rc_close failed: ");
- strncat(kerror, error_message(retval2), 238);
- return(SendConnSetup(client, kerror));
- }
- free(rcache);
- strcpy(kerror, "krb5_rc_initialize failed: ");
- strncat(kerror, error_message(retval), 233);
- return(SendConnSetup(client, kerror));
- }
- }
- buf.length = (stuff->length << 2) - sz_xReq;
- buf.data = (char *)stuff + sz_xReq;
- if (creds)
- {
- retval = krb5_rd_req(&buf,
- NULL, /* don't bother with server name */
- &cli_addr,
- NULL, /* no fetchfrom */
- tgt_keyproc,
- creds, /* credentials as arg to
- keyproc */
- rcache,
- &authdat);
- krb5_free_creds(creds);
- }
- else if (kt = (char *)((OsCommPtr)client->osPrivate)->authstate.ktname)
- {
- retval = krb5_rd_req(&buf, srvname, &cli_addr, kt, NULL, NULL,
- rcache, &authdat);
- ((OsCommPtr)client->osPrivate)->authstate.ktname = NULL;
- }
- else
- {
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- return(SendConnSetup(client, "Krb5: neither srvcreds nor ktname set"));
- }
- if (localaddrs)
- krb5_free_addresses(localaddrs);
- if (rcache)
- {
- if (retval2 = krb5_rc_close(rcache))
- {
- strcpy(kerror, "krb5_rc_close failed (2): ");
- strncat(kerror, error_message(retval2), 230);
- return(SendConnSetup(client, kerror));
- }
- free(rcache);
- }
- if (retval)
- {
- strcpy(kerror, "Krb5: Bad application request: ");
- strncat(kerror, error_message(retval), 224);
- return(SendConnSetup(client, kerror));
- }
- cprinc = authdat->ticket->enc_part2->client;
- skey = authdat->ticket->enc_part2->session;
- if (XauKrb5Encode(cprinc, &buf))
- {
- krb5_free_tkt_authent(authdat);
- return(SendConnSetup(client, "XauKrb5Encode bombed"));
- }
- /*
- * Now check to see if the principal we got is one that we want to let in
- */
- if (ForEachHostInFamily(FamilyKrb5Principal, k5_cmpenc, (pointer)&buf))
- {
- free(buf.data);
- /*
- * The following deals with sending an ap_rep to the client to
- * achieve mutual authentication. The client sends back a stage 3
- * packet if all is ok.
- */
- if (authdat->ap_options | AP_OPTS_MUTUAL_REQUIRED)
- {
- /*
- * stage 2: send ap_rep to client
- */
- if (retval = krb5_us_timeofday(&ctime, &cusec))
- {
- krb5_free_tkt_authent(authdat);
- strcpy(kerror, "error in krb5_us_timeofday: ");
- strncat(kerror, error_message(retval), 234);
- return(SendConnSetup(client, kerror));
- }
- rep.ctime = ctime;
- rep.cusec = cusec;
- rep.subkey = NULL;
- rep.seq_number = 0;
- if (retval = krb5_mk_rep(&rep, skey, &buf))
- {
- krb5_free_tkt_authent(authdat);
- strcpy(kerror, "error in krb5_mk_rep: ");
- strncat(kerror, error_message(retval), 238);
- return(SendConnSetup(client, kerror));
- }
- prefix.reqType = 2; /* opcode = authenticate */
- prefix.data = 2; /* stage = 2 */
- prefix.length = (buf.length + sz_xReq + 3) >> 2;
- if (client->swapped)
- {
- swaps(&prefix.length, n);
- }
- WriteToClient(client, sz_xReq, (char *)&prefix);
- WriteToClient(client, buf.length, buf.data);
- free(buf.data);
- krb5_free_tkt_authent(authdat);
- ((OsCommPtr)client->osPrivate)->authstate.stageno = 3; /* expect stage3 packet */
- return(Success);
- }
- else
- {
- free(buf.data);
- krb5_free_tkt_authent(authdat);
- return(SendConnSetup(client, NULL)); /* success! */
- }
- }
- else
- {
- char *kname;
-
- krb5_free_tkt_authent(authdat);
- free(buf.data);
- retval = krb5_unparse_name(cprinc, &kname);
- if (retval == 0)
- {
- sprintf(kerror, "Principal \"%s\" is not authorized to connect",
- kname);
- if (kname)
- free(kname);
- return(SendConnSetup(client, kerror));
- }
- else
- return(SendConnSetup(client,"Principal is not authorized to connect to Server"));
- }
-}
-
-/*
- * k5_stage3:
- *
- * Get the short ack packet from the client. This packet can conceivably
- * be expanded to allow for switching on end-to-end encryption.
- *
- * stage3 packet format:
- *
- * CARD8 reqType = 3
- * CARD8 data = ignored (for now)
- * CARD16 length = should be zero
- */
-int k5_stage3(client)
- register ClientPtr client;
-{
- REQUEST(xReq);
-
- if (((OsCommPtr)client->osPrivate)->authstate.stageno != 3)
- {
- return(SendConnSetup(client, "expected Krb5 stage3 packet"));
- }
- else
- return(SendConnSetup(client, NULL)); /* success! */
-}
-
-k5_bad(client)
- register ClientPtr client;
-{
- if (((OsCommPtr)client->osPrivate)->authstate.srvcreds)
- krb5_free_creds((krb5_creds *)((OsCommPtr)client->osPrivate)->authstate.srvcreds);
- sprintf(kerror, "unrecognized Krb5 auth packet %d, expecting %d",
- ((xReq *)client->requestBuffer)->reqType,
- ((OsCommPtr)client->osPrivate)->authstate.stageno);
- return(SendConnSetup(client, kerror));
-}
-
-/*
- * K5Add:
- *
- * Takes the name of a credentials cache and resolves it. Also adds the
- * primary principal of the ccache to the acl.
- *
- * Now will also take a service name.
- */
-int K5Add(data_length, data, id)
- unsigned short data_length;
- char *data;
- XID id;
-{
- krb5_principal princ;
- krb5_error_code retval;
- krb5_keytab_entry tmp_entry;
- krb5_keytab keytab;
- krb5_kvno kvno = 0;
- krb5_ccache cc;
- char *nbuf, *cp;
- krb5_data kbuf;
- int i, ktlen;
-
- krb5_init_ets(); /* can't think of a better place to put it */
- krb5_id = ~0L;
- if (data_length < 3)
- return 0;
- if ((nbuf = (char *)malloc(data_length - 2)) == NULL)
- return 0;
- memcpy(nbuf, data + 3, data_length - 3);
- nbuf[data_length - 3] = '\0';
- if (ccname)
- {
- free(ccname);
- ccname = NULL;
- }
- if (srvname)
- {
- krb5_free_principal(srvname);
- srvname = NULL;
- }
- if (ktname)
- {
- free(ktname);
- ktname = NULL;
- }
- if (!strncmp(data, "UU:", 3))
- {
- if (retval = krb5_cc_resolve(nbuf, &cc))
- {
- ErrorF("K5Add: krb5_cc_resolve of \"%s\" failed: %s\n",
- nbuf, error_message(retval));
- free(nbuf);
- return 0;
- }
- if (cc && !(retval = krb5_cc_get_principal(cc, &princ)))
- {
- if (XauKrb5Encode(princ, &kbuf))
- {
- free(nbuf);
- krb5_free_principal(princ);
- krb5_cc_close(cc);
- return 0;
- }
- if (krb5_cc_close(cc))
- return 0;
- AddHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
- krb5_free_principal(princ);
- free(kbuf.data);
- ccname = nbuf;
- krb5_id = id;
- return 1;
- }
- else
- {
- ErrorF("K5Add: getting principal from cache \"%s\" failed: %s\n",
- nbuf, error_message(retval));
- }
- }
- else if (!strncmp(data, "CS:", 3))
- {
- if ((cp = strchr(nbuf, ',')) == NULL)
- {
- free(nbuf);
- return 0;
- }
- *cp = '\0'; /* gross but it works :-) */
- ktlen = strlen(cp + 1);
- if ((ktname = (char *)malloc(ktlen + 1)) == NULL)
- {
- free(nbuf);
- return 0;
- }
- strcpy(ktname, cp + 1);
- retval = krb5_sname_to_principal(NULL, /* NULL for hostname uses
- local host name*/
- nbuf, KRB5_NT_SRV_HST,
- &srvname);
- free(nbuf);
- if (retval)
- {
- free(ktname);
- ktname = NULL;
- return 0;
- }
- if (retval = krb5_kt_resolve(ktname, &keytab))
- {
- free(ktname);
- ktname = NULL;
- krb5_free_principal(srvname);
- srvname = NULL;
- return 0;
- }
- retval = krb5_kt_get_entry(keytab, srvname, kvno, &tmp_entry);
- krb5_kt_free_entry(&tmp_entry);
- if (retval)
- {
- free(ktname);
- ktname = NULL;
- krb5_free_principal(srvname);
- srvname = NULL;
- return 0;
- }
- if (XauKrb5Encode(srvname, &kbuf))
- {
- free(ktname);
- ktname = NULL;
- krb5_free_principal(srvname);
- srvname = NULL;
- return 0;
- }
- AddHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
- krb5_id = id;
- return 1;
- }
- else
- {
- ErrorF("K5Add: credentials cache name \"%.*s\" in auth file: unknown type\n",
- data_length, data);
- }
- return 0;
-}
-
-/*
- * K5Reset:
- *
- * Reset krb5_id, also nuke the current principal from the acl.
- */
-int K5Reset()
-{
- krb5_principal princ;
- krb5_error_code retval;
- krb5_ccache cc;
- krb5_data kbuf;
- int i;
-
- if (ccname)
- {
- if (retval = krb5_cc_resolve(ccname, &cc))
- {
- free(ccname);
- ccname = NULL;
- }
- if (cc && !(retval = krb5_cc_get_principal(cc, &princ)))
- {
- if (XauKrb5Encode(princ, &kbuf))
- return 1;
- RemoveHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
- krb5_free_principal(princ);
- free(kbuf.data);
- if (krb5_cc_close(cc))
- return 1;
- free(ccname);
- ccname = NULL;
- }
- }
- if (srvname)
- {
- if (XauKrb5Encode(srvname, &kbuf))
- return 1;
- RemoveHost(NULL, FamilyKrb5Principal, kbuf.length, kbuf.data);
- krb5_free_principal(srvname);
- free(kbuf.data);
- srvname = NULL;
- }
- if (ktname)
- {
- free(ktname);
- ktname = NULL;
- }
- krb5_id = ~0L;
- return 0;
-}
-
-XID K5ToID(data_length, data)
- unsigned short data_length;
- char *data;
-{
- return krb5_id;
-}
-
-int K5FromID(id, data_lenp, datap)
- XID id;
- unsigned short *data_lenp;
- char **datap;
-{
- return 0;
-}
-
-int K5Remove(data_length, data)
- unsigned short data_length;
- char *data;
-{
- return 0;
-}
diff --git a/os/lbxio.c b/os/lbxio.c
deleted file mode 100644
index ae4d4355f..000000000
--- a/os/lbxio.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/* $XFree86: xc/programs/Xserver/os/lbxio.c,v 3.18 2003/04/27 21:31:09 herrb Exp $ */
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/***********************************************************
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: lbxio.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-
-#include <stdio.h>
-#include <X11/Xtrans.h>
-#include "Xmd.h"
-#include <errno.h>
-#ifndef Lynx
-#include <sys/param.h>
-#ifndef __UNIXOS2__
-#include <sys/uio.h>
-#endif
-#else
-#include <uio.h>
-#endif
-#include "X.h"
-#include "Xproto.h"
-#include "os.h"
-#include "Xpoll.h"
-#include "osdep.h"
-#include "opaque.h"
-#include "dixstruct.h"
-#include "misc.h"
-#include "colormapst.h"
-#include "propertyst.h"
-#include "lbxserve.h"
-
-/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
- * systems are broken and return EWOULDBLOCK when they should return EAGAIN
- */
-#if defined(EAGAIN) && defined(EWOULDBLOCK)
-#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
-#else
-#ifdef EAGAIN
-#define ETEST(err) (err == EAGAIN)
-#else
-#define ETEST(err) (err == EWOULDBLOCK)
-#endif
-#endif
-
-#define get_req_len(req,cli) ((cli)->swapped ? \
- lswaps((req)->length) : (req)->length)
-
-#define YieldControl() \
- { isItTimeToYield = TRUE; \
- timesThisConnection = 0; }
-#define YieldControlNoInput() \
- { YieldControl(); \
- FD_CLR(fd, &ClientsWithInput); }
-
-void
-SwitchClientInput (ClientPtr client, Bool pending)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
-
- ConnectionTranslation[oc->fd] = client->index;
- if (pending)
- FD_SET(oc->fd, &ClientsWithInput);
- else
- YieldControl();
-}
-
-void
-LbxPrimeInput(ClientPtr client, LbxProxyPtr proxy)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
-
- if (oci && proxy->compHandle) {
- char *extra = oci->bufptr + oci->lenLastReq;
- int left = oci->bufcnt + oci->buffer - extra;
-
- (*proxy->streamOpts.streamCompStuffInput)(oc->fd,
- (unsigned char *)extra,
- left);
- oci->bufcnt -= left;
- AvailableInput = oc;
- }
-}
-
-void
-AvailableClientInput (ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
-
- if (FD_ISSET(oc->fd, &AllSockets))
- FD_SET(oc->fd, &ClientsWithInput);
-}
-
-/*****************************************************************
- * AppendFakeRequest
- * Append a (possibly partial) request in as the last request.
- *
- **********************/
-
-Bool
-AppendFakeRequest (ClientPtr client, char *data, int count)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- int gotnow;
-
- if (!oci)
- {
- if ((oci = FreeInputs))
- FreeInputs = oci->next;
- else if (!(oci = AllocateInputBuffer()))
- return FALSE;
- oc->input = oci;
- } else if (AvailableInput == oc)
- AvailableInput = (OsCommPtr)NULL;
- /* do not free AvailableInput here, it could be proxy's */
- oci->bufptr += oci->lenLastReq;
- oci->lenLastReq = 0;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if ((gotnow + count) > oci->size)
- {
- char *ibuf;
-
- ibuf = (char *)xrealloc(oci->buffer, gotnow + count);
- if (!ibuf)
- return(FALSE);
- oci->size = gotnow + count;
- oci->buffer = ibuf;
- oci->bufptr = ibuf + oci->bufcnt - gotnow;
- }
- if (oci->bufcnt + count > oci->size) {
- memmove(oci->buffer, oci->bufptr, gotnow);
- oci->bufcnt = gotnow;
- oci->bufptr = oci->buffer;
- }
- memmove(oci->bufptr + gotnow, data, count);
- oci->bufcnt += count;
- gotnow += count;
- if ((gotnow >= sizeof(xReq)) &&
- (gotnow >= (int)(get_req_len((xReq *)oci->bufptr, client) << 2)))
- FD_SET(fd, &ClientsWithInput);
- else
- YieldControlNoInput();
- return(TRUE);
-}
-
-static int
-LbxWrite(XtransConnInfo trans_conn, LbxProxyPtr proxy,
- char *buf, int len)
-{
- struct iovec iov;
- int n;
- int notWritten;
-
- notWritten = len;
- iov.iov_base = buf;
- iov.iov_len = len;
- while (notWritten) {
- errno = 0;
- if (proxy->compHandle)
- n = (*proxy->streamOpts.streamCompWriteV)(proxy->fd, &iov, 1);
- else
- n = _XSERVTransWritev(trans_conn, &iov, 1);
- if (n >= 0) {
- iov.iov_base = (char *)iov.iov_base + n;
- notWritten -= n;
- iov.iov_len = notWritten;
- }
- else if (ETEST(errno)
-#ifdef SUNSYSV /* check for another brain-damaged OS bug */
- || (errno == 0)
-#endif
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- || ((errno == EMSGSIZE) && (iov.iov_len == 1))
-#endif
- )
- break;
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- else if (errno == EMSGSIZE)
- iov.iov_len >>= 1;
-#endif
- else
- return -1;
- }
- return len - notWritten;
-}
-
-static Bool
-LbxAppendOutput(LbxProxyPtr proxy, ClientPtr client, ConnectionOutputPtr oco)
-{
- ConnectionOutputPtr noco = proxy->olast;
- LbxClientPtr lbxClient = LbxClient(client);
-
- if (!lbxClient) {
- xfree(oco->buf);
- xfree(oco);
- return TRUE;
- }
- if (noco)
- LbxReencodeOutput(client,
- (char *)noco->buf, &noco->count,
- (char *)oco->buf, &oco->count);
- else
- LbxReencodeOutput(client,
- (char *)NULL, (int *)NULL,
- (char *)oco->buf, &oco->count);
- if (!oco->count) {
- if (oco->size > BUFWATERMARK)
- {
- xfree(oco->buf);
- xfree(oco);
- }
- else
- {
- oco->next = FreeOutputs;
- FreeOutputs = oco;
- }
- return TRUE;
- }
- if ((lbxClient->id != proxy->cur_send_id) && proxy->lbxClients[0]) {
- xLbxSwitchEvent *ev;
- int n;
-
- if (!noco || (noco->size - noco->count) < sz_xLbxSwitchEvent) {
- if ((noco = FreeOutputs))
- FreeOutputs = noco->next;
- else
- noco = AllocateOutputBuffer();
- if (!noco) {
- MarkClientException(client);
- return FALSE;
- }
- noco->next = NULL;
- if (proxy->olast)
- proxy->olast->next = noco;
- else
- proxy->ofirst = noco;
- proxy->olast = noco;
- }
- ev = (xLbxSwitchEvent *) (noco->buf + noco->count);
- noco->count += sz_xLbxSwitchEvent;
- proxy->cur_send_id = lbxClient->id;
- ev->type = LbxEventCode;
- ev->lbxType = LbxSwitchEvent;
- ev->pad = 0;
- ev->client = proxy->cur_send_id;
- if (LbxProxyClient(proxy)->swapped) {
- swapl(&ev->client, n);
- }
- }
- oco->next = NULL;
- if (proxy->olast)
- proxy->olast->next = oco;
- else
- proxy->ofirst = oco;
- proxy->olast = oco;
- return TRUE;
-}
-
-static int
-LbxClientOutput(ClientPtr client, OsCommPtr oc,
- char *extraBuf, int extraCount, Bool nocompress)
-{
- ConnectionOutputPtr oco;
- int len;
-
- if ((oco = oc->output)) {
- oc->output = NULL;
- if (!LbxAppendOutput(oc->proxy, client, oco))
- return -1;
- }
-
- if (extraCount) {
- NewOutputPending = TRUE;
- FD_SET(oc->fd, &OutputPending);
- len = (extraCount + 3) & ~3;
- if ((oco = FreeOutputs) && (oco->size >= len))
- FreeOutputs = oco->next;
- else {
- oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput));
- if (!oco) {
- MarkClientException(client);
- return -1;
- }
- oco->size = len;
- if (oco->size < BUFSIZE)
- oco->size = BUFSIZE;
- oco->buf = (unsigned char *) xalloc(oco->size);
- if (!oco->buf) {
- xfree(oco);
- MarkClientException(client);
- return -1;
- }
- }
- oco->count = len;
- oco->nocompress = nocompress;
- memmove((char *)oco->buf, extraBuf, extraCount);
- if (!nocompress && oco->count < oco->size)
- oc->output = oco;
- else if (!LbxAppendOutput(oc->proxy, client, oco))
- return -1;
- }
- return extraCount;
-}
-
-void
-LbxForceOutput(LbxProxyPtr proxy)
-{
- int i;
- LbxClientPtr lbxClient;
- OsCommPtr coc;
- ConnectionOutputPtr oco;
-
- for (i = proxy->maxIndex; i >= 0; i--) { /* proxy must be last */
- lbxClient = proxy->lbxClients[i];
- if (!lbxClient)
- continue;
- coc = (OsCommPtr)lbxClient->client->osPrivate;
- if ((oco = coc->output)) {
- coc->output = NULL;
- LbxAppendOutput(proxy, lbxClient->client, oco);
- }
- }
-}
-
-int
-LbxFlushClient(ClientPtr who, OsCommPtr oc,
- char *extraBuf, int extraCount)
-{
- LbxProxyPtr proxy;
- ConnectionOutputPtr oco;
- int n;
- XtransConnInfo trans_conn = NULL;
-
- if (extraBuf)
- return LbxClientOutput(who, oc, extraBuf, extraCount, FALSE);
- proxy = oc->proxy;
- if (!proxy->lbxClients[0])
- return 0;
- LbxForceOutput(proxy);
- if (!proxy->compHandle)
- trans_conn = ((OsCommPtr)LbxProxyClient(proxy)->osPrivate)->trans_conn;
- while ((oco = proxy->ofirst)) {
- /* XXX bundle up into writev someday */
- if (proxy->compHandle) {
- if (oco->nocompress)
- (*proxy->streamOpts.streamCompOff)(proxy->fd);
- n = LbxWrite(NULL, proxy, (char *)oco->buf, oco->count);
- if (oco->nocompress)
- (*proxy->streamOpts.streamCompOn)(proxy->fd);
- } else
- n = LbxWrite(trans_conn, proxy, (char *)oco->buf, oco->count);
- if (n < 0) {
- ClientPtr pclient = LbxProxyClient(proxy);
- if (proxy->compHandle)
- trans_conn = ((OsCommPtr)pclient->osPrivate)->trans_conn;
- _XSERVTransDisconnect(trans_conn);
- _XSERVTransClose(trans_conn);
- ((OsCommPtr)pclient->osPrivate)->trans_conn = NULL;
- MarkClientException(pclient);
- return 0;
- } else if (n == oco->count) {
- proxy->ofirst = oco->next;
- if (!proxy->ofirst)
- proxy->olast = NULL;
- if (oco->size > BUFWATERMARK)
- {
- xfree(oco->buf);
- xfree(oco);
- }
- else
- {
- oco->next = FreeOutputs;
- oco->count = 0;
- FreeOutputs = oco;
- }
- } else {
- if (n) {
- oco->count -= n;
- memmove((char *)oco->buf, (char *)oco->buf + n, oco->count);
- }
- break;
- }
- }
- if ((proxy->compHandle &&
- (*proxy->streamOpts.streamCompFlush)(proxy->fd)) ||
- proxy->ofirst) {
- FD_SET(proxy->fd, &ClientsWriteBlocked);
- AnyClientsWriteBlocked = TRUE;
- }
- return 0;
-}
-
-int
-UncompressedWriteToClient (ClientPtr who, int count, char *buf)
-{
- return LbxClientOutput(who, (OsCommPtr)who->osPrivate, buf, count, TRUE);
-}
-
-void
-LbxFreeOsBuffers(LbxProxyPtr proxy)
-{
- ConnectionOutputPtr oco;
-
- while ((oco = proxy->ofirst)) {
- proxy->ofirst = oco->next;
- xfree(oco->buf);
- xfree(oco);
- }
-}
-
-Bool
-AllocateLargeReqBuffer(ClientPtr client, int size)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci;
-
- if (!(oci = oc->largereq)) {
- if ((oci = FreeInputs))
- FreeInputs = oci->next;
- else {
- oci = (ConnectionInputPtr)xalloc(sizeof(ConnectionInput));
- if (!oci)
- return FALSE;
- oci->buffer = NULL;
- oci->size = 0;
- }
- }
- if (oci->size < size) {
- char *ibuf;
-
- oci->size = size;
- if (size < BUFSIZE)
- oci->size = BUFSIZE;
- if (!(ibuf = (char *)xrealloc(oci->buffer, oci->size)))
- {
- xfree(oci->buffer);
- xfree(oci);
- oc->largereq = NULL;
- return FALSE;
- }
- oci->buffer = ibuf;
- }
- oci->bufptr = oci->buffer;
- oci->bufcnt = 0;
- oci->lenLastReq = size;
- oc->largereq = oci;
- return TRUE;
-}
-
-Bool
-AddToLargeReqBuffer(ClientPtr client, char *data, int size)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->largereq;
-
- if (!oci || (oci->bufcnt + size > oci->lenLastReq))
- return FALSE;
- memcpy(oci->buffer + oci->bufcnt, data, size);
- oci->bufcnt += size;
- return TRUE;
-}
-
-static OsCommRec lbxAvailableInput;
-
-int
-PrepareLargeReqBuffer(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->largereq;
-
- if (!oci)
- return client->req_len << 2;
- oc->largereq = NULL;
- if (oci->bufcnt != oci->lenLastReq) {
- xfree(oci->buffer);
- xfree(oci);
- return client->req_len << 2;
- }
- client->requestBuffer = oci->buffer;
- client->req_len = oci->lenLastReq >> 2;
- oci->bufcnt = 0;
- oci->lenLastReq = 0;
- if (AvailableInput)
- {
- ConnectionInputPtr aci = AvailableInput->input;
- if (aci->size > BUFWATERMARK)
- {
- xfree(aci->buffer);
- xfree(aci);
- }
- else
- {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr)NULL;
- }
- lbxAvailableInput.input = oci;
- AvailableInput = &lbxAvailableInput;
- return client->req_len << 2;
-}
diff --git a/os/log.c b/os/log.c
deleted file mode 100644
index e537f8c41..000000000
--- a/os/log.c
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-Copyright 1994 Quarterdeck Office Systems.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital and
-Quarterdeck not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT
-OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
-OR PERFORMANCE OF THIS SOFTWARE.
-
-*/
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* $XFree86: xc/programs/Xserver/os/log.c,v 1.6 2003/11/07 13:45:27 tsi Exp $ */
-
-#include "Xos.h"
-#include <stdio.h>
-#include <time.h>
-#include <sys/stat.h>
-#include <stdarg.h>
-#include <stdlib.h> /* for malloc() */
-#include <errno.h>
-
-#include "site.h"
-#include "opaque.h"
-
-
-#ifdef DDXOSVERRORF
-void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL;
-#endif
-
-static FILE *logFile = NULL;
-static Bool logFlush = FALSE;
-static Bool logSync = FALSE;
-static int logVerbosity = DEFAULT_LOG_VERBOSITY;
-static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
-
-/* Buffer to information logged before the log file is opened. */
-static char *saveBuffer = NULL;
-static int bufferSize = 0, bufferUnused = 0, bufferPos = 0;
-static Bool needBuffer = TRUE;
-
-/* Prefix strings for log messages. */
-#ifndef X_UNKNOWN_STRING
-#define X_UNKNOWN_STRING "(\?\?)"
-#endif
-#ifndef X_PROBE_STRING
-#define X_PROBE_STRING "(--)"
-#endif
-#ifndef X_CONFIG_STRING
-#define X_CONFIG_STRING "(**)"
-#endif
-#ifndef X_DEFAULT_STRING
-#define X_DEFAULT_STRING "(==)"
-#endif
-#ifndef X_CMDLINE_STRING
-#define X_CMDLINE_STRING "(++)"
-#endif
-#ifndef X_NOTICE_STRING
-#define X_NOTICE_STRING "(!!)"
-#endif
-#ifndef X_ERROR_STRING
-#define X_ERROR_STRING "(EE)"
-#endif
-#ifndef X_WARNING_STRING
-#define X_WARNING_STRING "(WW)"
-#endif
-#ifndef X_INFO_STRING
-#define X_INFO_STRING "(II)"
-#endif
-#ifndef X_NOT_IMPLEMENTED_STRING
-#define X_NOT_IMPLEMENTED_STRING "(NI)"
-#endif
-
-/*
- * LogInit is called to start logging to a file. It is also called (with
- * NULL arguments) when logging to a file is not wanted. It must always be
- * called, otherwise log messages will continue to accumulate in a buffer.
- *
- * %s, if present in the fname or backup strings, is expanded to the display
- * string.
- */
-
-const char *
-LogInit(const char *fname, const char *backup)
-{
- char *logFileName = NULL;
-
- if (fname && *fname) {
- /* xalloc() can't be used yet. */
- logFileName = malloc(strlen(fname) + strlen(display) + 1);
- if (!logFileName)
- FatalError("Cannot allocate space for the log file name\n");
- sprintf(logFileName, fname, display);
-
- if (backup && *backup) {
- struct stat buf;
-
- if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
- char *suffix;
- char *oldLog;
-
- oldLog = malloc(strlen(logFileName) + strlen(backup) +
- strlen(display) + 1);
- suffix = malloc(strlen(backup) + strlen(display) + 1);
- if (!oldLog || !suffix)
- FatalError("Cannot allocate space for the log file name\n");
- sprintf(suffix, backup, display);
- sprintf(oldLog, "%s%s", logFileName, suffix);
- free(suffix);
-#ifdef __UNIXOS2__
- remove(oldLog);
-#endif
- if (rename(logFileName, oldLog) == -1) {
- FatalError("Cannot move old log file (\"%s\" to \"%s\"\n",
- logFileName, oldLog);
- }
- free(oldLog);
- }
- }
- if ((logFile = fopen(logFileName, "w")) == NULL)
- FatalError("Cannot open log file \"%s\"\n", logFileName);
- setvbuf(logFile, NULL, _IONBF, 0);
-
- /* Flush saved log information. */
- if (saveBuffer && bufferSize > 0) {
- fwrite(saveBuffer, bufferPos, 1, logFile);
- fflush(logFile);
- fsync(fileno(logFile));
- }
- }
-
- /*
- * Unconditionally free the buffer, and flag that the buffer is no longer
- * needed.
- */
- if (saveBuffer && bufferSize > 0) {
- free(saveBuffer); /* Must be free(), not xfree() */
- saveBuffer = NULL;
- bufferSize = 0;
- }
- needBuffer = FALSE;
-
- return logFileName;
-}
-
-void
-LogClose()
-{
- if (logFile) {
- fclose(logFile);
- logFile = NULL;
- }
-}
-
-Bool
-LogSetParameter(LogParameter param, int value)
-{
- switch (param) {
- case XLOG_FLUSH:
- logFlush = value ? TRUE : FALSE;
- return TRUE;
- case XLOG_SYNC:
- logSync = value ? TRUE : FALSE;
- return TRUE;
- case XLOG_VERBOSITY:
- logVerbosity = value;
- return TRUE;
- case XLOG_FILE_VERBOSITY:
- logFileVerbosity = value;
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-/* This function does the actual log message writes. */
-
-void
-LogVWrite(int verb, const char *f, va_list args)
-{
- static char tmpBuffer[1024];
- int len = 0;
-
- /*
- * Since a va_list can only be processed once, write the string to a
- * buffer, and then write the buffer out to the appropriate output
- * stream(s).
- */
- if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) {
- vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args);
- len = strlen(tmpBuffer);
- }
- if ((verb < 0 || logVerbosity >= verb) && len > 0)
- fwrite(tmpBuffer, len, 1, stderr);
- if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
- if (logFile) {
- fwrite(tmpBuffer, len, 1, logFile);
- if (logFlush) {
- fflush(logFile);
- if (logSync)
- fsync(fileno(logFile));
- }
- } else if (needBuffer) {
- /*
- * Note, this code is used before OsInit() has been called, so
- * xalloc() and friends can't be used.
- */
- if (len > bufferUnused) {
- bufferSize += 1024;
- bufferUnused += 1024;
- if (saveBuffer)
- saveBuffer = realloc(saveBuffer, bufferSize);
- else
- saveBuffer = malloc(bufferSize);
- if (!saveBuffer)
- FatalError("realloc() failed while saving log messages\n");
- }
- bufferUnused -= len;
- memcpy(saveBuffer + bufferPos, tmpBuffer, len);
- bufferPos += len;
- }
- }
-}
-
-void
-LogWrite(int verb, const char *f, ...)
-{
- va_list args;
-
- va_start(args, f);
- LogVWrite(verb, f, args);
- va_end(args);
-}
-
-void
-LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
-{
- const char *s = X_UNKNOWN_STRING;
- char *tmpBuf = NULL;
-
- /* Ignore verbosity for X_ERROR */
- if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) {
- switch (type) {
- case X_PROBED:
- s = X_PROBE_STRING;
- break;
- case X_CONFIG:
- s = X_CONFIG_STRING;
- break;
- case X_DEFAULT:
- s = X_DEFAULT_STRING;
- break;
- case X_CMDLINE:
- s = X_CMDLINE_STRING;
- break;
- case X_NOTICE:
- s = X_NOTICE_STRING;
- break;
- case X_ERROR:
- s = X_ERROR_STRING;
- if (verb > 0)
- verb = 0;
- break;
- case X_WARNING:
- s = X_WARNING_STRING;
- break;
- case X_INFO:
- s = X_INFO_STRING;
- break;
- case X_NOT_IMPLEMENTED:
- s = X_NOT_IMPLEMENTED_STRING;
- break;
- case X_UNKNOWN:
- s = X_UNKNOWN_STRING;
- break;
- case X_NONE:
- s = NULL;
- break;
- }
-
- /*
- * Prefix the format string with the message type. We do it this way
- * so that LogVWrite() is only called once per message.
- */
- if (s) {
- tmpBuf = malloc(strlen(format) + strlen(s) + 1 + 1);
- /* Silently return if malloc fails here. */
- if (!tmpBuf)
- return;
- sprintf(tmpBuf, "%s ", s);
- strcat(tmpBuf, format);
- LogVWrite(verb, tmpBuf, args);
- free(tmpBuf);
- } else
- LogVWrite(verb, format, args);
- }
-}
-
-/* Log message with verbosity level specified. */
-void
-LogMessageVerb(MessageType type, int verb, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVMessageVerb(type, verb, format, ap);
- va_end(ap);
-}
-
-/* Log a message with the standard verbosity level of 1. */
-void
-LogMessage(MessageType type, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- LogVMessageVerb(type, 1, format, ap);
- va_end(ap);
-}
-
-#ifdef __GNUC__
-static void AbortServer(void) __attribute__((noreturn));
-#endif
-
-static void
-AbortServer(void)
-{
- OsCleanup(TRUE);
- AbortDDX();
- fflush(stderr);
- if (CoreDump)
- abort();
- exit (1);
-}
-
-#ifndef AUDIT_PREFIX
-#define AUDIT_PREFIX "AUDIT: %s: %ld %s: "
-#endif
-#ifndef AUDIT_TIMEOUT
-#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
-#endif
-
-static int nrepeat = 0;
-static int oldlen = -1;
-static OsTimerPtr auditTimer = NULL;
-
-void
-FreeAuditTimer(void)
-{
- if (auditTimer != NULL) {
- /* Force output of pending messages */
- TimerForce(auditTimer);
- TimerFree(auditTimer);
- auditTimer = NULL;
- }
-}
-
-static char *
-AuditPrefix(void)
-{
- time_t tm;
- char *autime, *s;
- char *tmpBuf;
- int len;
-
- time(&tm);
- autime = ctime(&tm);
- if ((s = strchr(autime, '\n')))
- *s = '\0';
- if ((s = strrchr(argvGlobal[0], '/')))
- s++;
- else
- s = argvGlobal[0];
- len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + strlen(s) + 1;
- tmpBuf = malloc(len);
- if (!tmpBuf)
- return NULL;
- snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid(), s);
- return tmpBuf;
-}
-
-void
-AuditF(const char * f, ...)
-{
- va_list args;
-
- va_start(args, f);
-
- VAuditF(f, args);
- va_end(args);
-}
-
-static CARD32
-AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
-{
- char *prefix;
-
- if (nrepeat > 0) {
- prefix = AuditPrefix();
- ErrorF("%slast message repeated %d times\n",
- prefix != NULL ? prefix : "", nrepeat);
- nrepeat = 0;
- if (prefix != NULL)
- free(prefix);
- return AUDIT_TIMEOUT;
- } else {
- /* if the timer expires without anything to print, flush the message */
- oldlen = -1;
- return 0;
- }
-}
-
-void
-VAuditF(const char *f, va_list args)
-{
- char *prefix;
- char buf[1024];
- int len;
- static char oldbuf[1024];
-
- prefix = AuditPrefix();
- len = vsnprintf(buf, sizeof(buf), f, args);
-
- if (len == oldlen && strcmp(buf, oldbuf) == 0) {
- /* Message already seen */
- nrepeat++;
- } else {
- /* new message */
- if (auditTimer != NULL)
- TimerForce(auditTimer);
- ErrorF("%s%s", prefix != NULL ? prefix : "", buf);
- strlcpy(oldbuf, buf, sizeof(oldbuf));
- oldlen = len;
- nrepeat = 0;
- auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
- }
- if (prefix != NULL)
- free(prefix);
-}
-
-void
-FatalError(const char *f, ...)
-{
- va_list args;
- static Bool beenhere = FALSE;
-
- if (beenhere)
- ErrorF("\nFatalError re-entered, aborting\n");
- else
- ErrorF("\nFatal server error:\n");
-
- va_start(args, f);
- VErrorF(f, args);
- va_end(args);
- ErrorF("\n");
-#ifdef DDXOSFATALERROR
- if (!beenhere)
- OsVendorFatalError();
-#endif
-#ifdef ABORTONFATALERROR
- abort();
-#endif
- if (!beenhere) {
- beenhere = TRUE;
- AbortServer();
- } else
- abort();
- /*NOTREACHED*/
-}
-
-void
-VErrorF(const char *f, va_list args)
-{
-#ifdef DDXOSVERRORF
- if (OsVendorVErrorFProc)
- OsVendorVErrorFProc(f, args);
- else
- LogVWrite(-1, f, args);
-#else
- LogVWrite(-1, f, args);
-#endif
-}
-
-void
-ErrorF(const char * f, ...)
-{
- va_list args;
-
- va_start(args, f);
- VErrorF(f, args);
- va_end(args);
-}
-
-/* A perror() workalike. */
-
-#ifndef NEED_STRERROR
-#ifdef SYSV
-#if !defined(ISC) || defined(ISC202) || defined(ISC22)
-#define NEED_STRERROR
-#endif
-#endif
-#endif
-
-#if defined(NEED_STRERROR) && !defined(strerror)
-extern char *sys_errlist[];
-extern int sys_nerr;
-#define strerror(n) \
- ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[(n)] : "unknown error"
-#endif
-
-void
-Error(char *str)
-{
- char *err = NULL;
- int saveErrno = errno;
-
- if (str) {
- err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1);
- if (!err)
- return;
- sprintf(err, "%s: ", str);
- strcat(err, strerror(saveErrno));
- LogWrite(-1, err);
- } else
- LogWrite(-1, strerror(saveErrno));
-}
-
-void
-LogPrintMarkers()
-{
- /* Show what the message marker symbols mean. */
- ErrorF("Markers: ");
- LogMessageVerb(X_PROBED, -1, "probed, ");
- LogMessageVerb(X_CONFIG, -1, "from config file, ");
- LogMessageVerb(X_DEFAULT, -1, "default setting,\n\t");
- LogMessageVerb(X_CMDLINE, -1, "from command line, ");
- LogMessageVerb(X_NOTICE, -1, "notice, ");
- LogMessageVerb(X_INFO, -1, "informational,\n\t");
- LogMessageVerb(X_WARNING, -1, "warning, ");
- LogMessageVerb(X_ERROR, -1, "error, ");
- LogMessageVerb(X_NOT_IMPLEMENTED, -1, "not implemented, ");
- LogMessageVerb(X_UNKNOWN, -1, "unknown.\n");
-}
-
diff --git a/os/mitauth.c b/os/mitauth.c
deleted file mode 100644
index bddbdf1d6..000000000
--- a/os/mitauth.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* $Xorg: mitauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/mitauth.c,v 1.5 2001/12/14 20:00:34 dawes Exp $ */
-
-/*
- * MIT-MAGIC-COOKIE-1 authorization scheme
- * Author: Keith Packard, MIT X Consortium
- */
-
-#include "X.h"
-#include "os.h"
-#include "osdep.h"
-#include "dixstruct.h"
-
-static struct auth {
- struct auth *next;
- unsigned short len;
- char *data;
- XID id;
-} *mit_auth;
-
-int
-MitAddCookie (
- unsigned short data_length,
- char *data,
- XID id)
-{
- struct auth *new;
-
- new = (struct auth *) xalloc (sizeof (struct auth));
- if (!new)
- return 0;
- new->data = (char *) xalloc ((unsigned) data_length);
- if (!new->data) {
- xfree(new);
- return 0;
- }
- new->next = mit_auth;
- mit_auth = new;
- memmove(new->data, data, (int) data_length);
- new->len = data_length;
- new->id = id;
- return 1;
-}
-
-XID
-MitCheckCookie (
- unsigned short data_length,
- char *data,
- ClientPtr client,
- char **reason)
-{
- struct auth *auth;
-
- for (auth = mit_auth; auth; auth=auth->next) {
- if (data_length == auth->len &&
- memcmp (data, auth->data, (int) data_length) == 0)
- return auth->id;
- }
- *reason = "Invalid MIT-MAGIC-COOKIE-1 key";
- return (XID) -1;
-}
-
-int
-MitResetCookie (void)
-{
- struct auth *auth, *next;
-
- for (auth = mit_auth; auth; auth=next) {
- next = auth->next;
- xfree (auth->data);
- xfree (auth);
- }
- mit_auth = 0;
- return 0;
-}
-
-XID
-MitToID (
- unsigned short data_length,
- char *data)
-{
- struct auth *auth;
-
- for (auth = mit_auth; auth; auth=auth->next) {
- if (data_length == auth->len &&
- memcmp (data, auth->data, data_length) == 0)
- return auth->id;
- }
- return (XID) -1;
-}
-
-int
-MitFromID (
- XID id,
- unsigned short *data_lenp,
- char **datap)
-{
- struct auth *auth;
-
- for (auth = mit_auth; auth; auth=auth->next) {
- if (id == auth->id) {
- *data_lenp = auth->len;
- *datap = auth->data;
- return 1;
- }
- }
- return 0;
-}
-
-int
-MitRemoveCookie (
- unsigned short data_length,
- char *data)
-{
- struct auth *auth, *prev;
-
- prev = 0;
- for (auth = mit_auth; auth; prev = auth, auth=auth->next) {
- if (data_length == auth->len &&
- memcmp (data, auth->data, data_length) == 0)
- {
- if (prev)
- prev->next = auth->next;
- else
- mit_auth = auth->next;
- xfree (auth->data);
- xfree (auth);
- return 1;
- }
- }
- return 0;
-}
-
-#ifdef XCSECURITY
-
-static char cookie[16]; /* 128 bits */
-
-XID
-MitGenerateCookie (
- unsigned data_length,
- char *data,
- XID id,
- unsigned *data_length_return,
- char **data_return)
-{
- int i = 0;
- int status;
-
- while (data_length--)
- {
- cookie[i++] += *data++;
- if (i >= sizeof (cookie)) i = 0;
- }
- GenerateRandomData(sizeof (cookie), cookie);
- status = MitAddCookie(sizeof (cookie), cookie, id);
- if (!status)
- {
- id = -1;
- }
- else
- {
- *data_return = cookie;
- *data_length_return = sizeof (cookie);
- }
- return id;
-}
-
-#endif /* XCSECURITY */
diff --git a/os/oscolor.c b/os/oscolor.c
deleted file mode 100644
index f6e941fb8..000000000
--- a/os/oscolor.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* $XFree86: xc/programs/Xserver/os/oscolor.c,v 3.11 2003/09/24 02:43:36 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: oscolor.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-
-#ifndef USE_RGB_TXT
-
-#ifdef NDBM
-#include <ndbm.h>
-#else
-#ifdef SVR4
-#include <rpcsvc/dbm.h>
-#else
-#include <dbm.h>
-#endif
-#endif
-#include "rgb.h"
-#include "os.h"
-#include "opaque.h"
-
-/* Note that we are assuming there is only one database for all the screens. */
-
-#ifdef NDBM
-DBM *rgb_dbm = (DBM *)NULL;
-#else
-int rgb_dbm = 0;
-#endif
-
-extern void CopyISOLatin1Lowered(
- unsigned char * /*dest*/,
- unsigned char * /*source*/,
- int /*length*/);
-
-int
-OsInitColors(void)
-{
- if (!rgb_dbm)
- {
-#ifdef NDBM
- rgb_dbm = dbm_open(rgbPath, 0, 0);
-#else
- if (dbminit(rgbPath) == 0)
- rgb_dbm = 1;
-#endif
- if (!rgb_dbm) {
- ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath );
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/*ARGSUSED*/
-int
-OsLookupColor(int screen, char *name, unsigned int len,
- unsigned short *pred, unsigned short *pgreen, unsigned short *pblue)
-{
- datum dbent;
- RGB rgb;
- char buf[64];
- char *lowername;
-
- if(!rgb_dbm)
- return(0);
-
- /* we use xalloc here so that we can compile with cc without alloca
- * when otherwise using gcc */
- if (len < sizeof(buf))
- lowername = buf;
- else if (!(lowername = (char *)xalloc(len + 1)))
- return(0);
- CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name,
- (int)len);
-
- dbent.dptr = lowername;
- dbent.dsize = len;
-#ifdef NDBM
- dbent = dbm_fetch(rgb_dbm, dbent);
-#else
- dbent = fetch (dbent);
-#endif
-
- if (len >= sizeof(buf))
- xfree(lowername);
-
- if(dbent.dptr)
- {
- memmove((char *) &rgb, dbent.dptr, sizeof (RGB));
- *pred = rgb.red;
- *pgreen = rgb.green;
- *pblue = rgb.blue;
- return (1);
- }
- return(0);
-}
-
-#else /* USE_RGB_TXT */
-
-
-/*
- * The dbm routines are a porting hassle. This implementation will do
- * the same thing by reading the rgb.txt file directly, which is much
- * more portable.
- */
-
-#include <stdio.h>
-#include "os.h"
-#include "opaque.h"
-
-#define HASHSIZE 511
-
-typedef struct _dbEntry * dbEntryPtr;
-typedef struct _dbEntry {
- dbEntryPtr link;
- unsigned short red;
- unsigned short green;
- unsigned short blue;
- char name[1]; /* some compilers complain if [0] */
-} dbEntry;
-
-
-extern void CopyISOLatin1Lowered(
- unsigned char * /*dest*/,
- unsigned char * /*source*/,
- int /*length*/);
-
-static dbEntryPtr hashTab[HASHSIZE];
-
-
-static dbEntryPtr
-lookup(char *name, int len, Bool create)
-{
- unsigned int h = 0, g;
- dbEntryPtr entry, *prev = NULL;
- char *str = name;
-
- if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL;
- CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len);
- name[len] = '\0';
-
- for(str = name; *str; str++) {
- h = (h << 4) + *str;
- if ((g = h) & 0xf0000000) h ^= (g >> 24);
- h &= g;
- }
- h %= HASHSIZE;
-
- if ( (entry = hashTab[h]) )
- {
- for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link )
- if (! strcmp(name, entry->name) ) break;
- }
- else
- prev = &(hashTab[h]);
-
- if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len)))
- {
- *prev = entry;
- entry->link = NULL;
- strcpy( entry->name, name );
- }
-
- DEALLOCATE_LOCAL(name);
-
- return entry;
-}
-
-
-Bool
-OsInitColors(void)
-{
- FILE *rgb;
- char *path;
- char line[BUFSIZ];
- char name[BUFSIZ];
- int red, green, blue, lineno = 0;
- dbEntryPtr entry;
-
- static Bool was_here = FALSE;
-
- if (!was_here)
- {
-#ifndef __UNIXOS2__
- path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5);
- strcpy(path, rgbPath);
- strcat(path, ".txt");
-#else
- char *tmp = (char*)__XOS2RedirRoot(rgbPath);
- path = (char*)ALLOCATE_LOCAL(strlen(tmp) +5);
- strcpy(path, tmp);
- strcat(path, ".txt");
-#endif
- if (!(rgb = fopen(path, "r")))
- {
- ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath );
- DEALLOCATE_LOCAL(path);
- return FALSE;
- }
-
- while(fgets(line, sizeof(line), rgb))
- {
- lineno++;
-#ifndef __UNIXOS2__
- if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4)
-#else
- if (sscanf(line,"%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4)
-#endif
- {
- if (red >= 0 && red <= 0xff &&
- green >= 0 && green <= 0xff &&
- blue >= 0 && blue <= 0xff)
- {
- if ((entry = lookup(name, strlen(name), TRUE)))
- {
- entry->red = (red * 65535) / 255;
- entry->green = (green * 65535) / 255;
- entry->blue = (blue * 65535) / 255;
- }
- }
- else
- ErrorF("Value out of range: %s:%d\n", path, lineno);
- }
- else if (*line && *line != '#' && *line != '!')
- ErrorF("Syntax Error: %s:%d\n", path, lineno);
- }
-
- fclose(rgb);
- DEALLOCATE_LOCAL(path);
-
- was_here = TRUE;
- }
-
- return TRUE;
-}
-
-
-
-Bool
-OsLookupColor(int screen, char *name, unsigned int len,
- unsigned short *pred, unsigned short *pgreen, unsigned short *pblue)
-{
- dbEntryPtr entry;
-
- if ((entry = lookup(name, len, FALSE)))
- {
- *pred = entry->red;
- *pgreen = entry->green;
- *pblue = entry->blue;
- return TRUE;
- }
-
- return FALSE;
-}
-
-#endif /* USE_RGB_TXT */
diff --git a/os/osdep.h b/os/osdep.h
deleted file mode 100644
index a5392ffc3..000000000
--- a/os/osdep.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/* $XFree86: xc/programs/Xserver/os/osdep.h,v 3.18 2003/04/27 21:31:09 herrb Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: osdep.h,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */
-
-#ifndef _OSDEP_H_
-#define _OSDEP_H_ 1
-
-#define BOTIMEOUT 200 /* in milliseconds */
-#define BUFSIZE 4096
-#define BUFWATERMARK 8192
-#ifndef MAXBUFSIZE
-#define MAXBUFSIZE (1 << 22)
-#endif
-
-#include <X11/Xdmcp.h>
-
-#ifndef sgi /* SGI defines OPEN_MAX in a useless way */
-#ifndef X_NOT_POSIX
-#ifdef _POSIX_SOURCE
-#include <limits.h>
-#else
-#define _POSIX_SOURCE
-#include <limits.h>
-#undef _POSIX_SOURCE
-#endif
-#else /* X_NOT_POSIX */
-#ifdef WIN32
-#define _POSIX_
-#include <limits.h>
-#undef _POSIX_
-#endif
-#endif /* X_NOT_POSIX */
-#endif
-
-#ifdef __QNX__
-#define NOFILES_MAX 256
-#endif
-#ifndef OPEN_MAX
-#ifdef SVR4
-#define OPEN_MAX 256
-#else
-#include <sys/param.h>
-#ifndef OPEN_MAX
-#if defined(NOFILE) && !defined(NOFILES_MAX)
-#define OPEN_MAX NOFILE
-#else
-#ifndef __UNIXOS2__
-#define OPEN_MAX NOFILES_MAX
-#else
-#define OPEN_MAX 256
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#include <X11/Xpoll.h>
-
-/*
- * MAXSOCKS is used only for initialising MaxClients when no other method
- * like sysconf(_SC_OPEN_MAX) is not supported.
- */
-
-#if OPEN_MAX <= 256
-#define MAXSOCKS (OPEN_MAX - 1)
-#else
-#define MAXSOCKS 256
-#endif
-
-/* MAXSELECT is the number of fds that select() can handle */
-#define MAXSELECT (sizeof(fd_set) * NBBY)
-
-#if !defined(hpux) && !defined(SVR4) && !defined(SYSV)
-#define HAS_GETDTABLESIZE
-#endif
-
-#include <stddef.h>
-
-typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
-typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
-typedef Bool (*AddAuthorFunc)(unsigned name_length, char *name, unsigned data_length, char *data);
-
-typedef struct _connectionInput {
- struct _connectionInput *next;
- char *buffer; /* contains current client input */
- char *bufptr; /* pointer to current start of data */
- int bufcnt; /* count of bytes in buffer */
- int lenLastReq;
- int size;
-} ConnectionInput, *ConnectionInputPtr;
-
-typedef struct _connectionOutput {
- struct _connectionOutput *next;
- int size;
- unsigned char *buf;
- int count;
-#ifdef LBX
- Bool nocompress;
-#endif
-} ConnectionOutput, *ConnectionOutputPtr;
-
-#ifdef K5AUTH
-typedef struct _k5_state {
- int stageno; /* current stage of auth protocol */
- pointer srvcreds; /* server credentials */
- pointer srvname; /* server principal name */
- pointer ktname; /* key table: principal-key pairs */
- pointer skey; /* session key */
-} k5_state;
-#endif
-
-#ifdef LBX
-typedef struct _LbxProxy *OsProxyPtr;
-#endif
-
-struct _osComm;
-
-#define AuthInitArgs void
-typedef void (*AuthInitFunc) (AuthInitArgs);
-
-#define AuthAddCArgs unsigned short data_length, char *data, XID id
-typedef int (*AuthAddCFunc) (AuthAddCArgs);
-
-#define AuthCheckArgs unsigned short data_length, char *data, ClientPtr client, char **reason
-typedef XID (*AuthCheckFunc) (AuthCheckArgs);
-
-#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
-typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
-
-#define AuthGenCArgs unsigned data_length, char *data, XID id, unsigned *data_length_return, char **data_return
-typedef XID (*AuthGenCFunc) (AuthGenCArgs);
-
-#define AuthRemCArgs unsigned short data_length, char *data
-typedef int (*AuthRemCFunc) (AuthRemCArgs);
-
-#define AuthRstCArgs void
-typedef int (*AuthRstCFunc) (AuthRstCArgs);
-
-#define AuthToIDArgs unsigned short data_length, char *data
-typedef XID (*AuthToIDFunc) (AuthToIDArgs);
-
-typedef void (*OsCloseFunc)(ClientPtr);
-
-typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
-
-typedef struct _osComm {
- int fd;
- ConnectionInputPtr input;
- ConnectionOutputPtr output;
- XID auth_id; /* authorization id */
-#ifdef K5AUTH
- k5_state authstate; /* state of setup auth conversation */
-#endif
- CARD32 conn_time; /* timestamp if not established, else 0 */
- struct _XtransConnInfo *trans_conn; /* transport connection object */
-#ifdef LBX
- OsProxyPtr proxy;
- ConnectionInputPtr largereq;
- OsCloseFunc Close;
- OsFlushFunc Flush;
-#endif
-} OsCommRec, *OsCommPtr;
-
-#ifdef LBX
-#define FlushClient(who, oc, extraBuf, extraCount) \
- (*(oc)->Flush)(who, oc, extraBuf, extraCount)
-extern int StandardFlushClient(
- ClientPtr /*who*/,
- OsCommPtr /*oc*/,
- char* /*extraBuf*/,
- int /*extraCount*/
-);
-extern int LbxFlushClient(ClientPtr /*who*/, OsCommPtr /*oc*/,
- char */*extraBuf*/, int /*extraCount*/);
-#else
-extern int FlushClient(
- ClientPtr /*who*/,
- OsCommPtr /*oc*/,
- char* /*extraBuf*/,
- int /*extraCount*/
-);
-#endif
-
-extern void FreeOsBuffers(
- OsCommPtr /*oc*/
-);
-
-#include "dix.h"
-
-extern ConnectionInputPtr AllocateInputBuffer(void);
-
-extern ConnectionOutputPtr AllocateOutputBuffer(void);
-
-extern fd_set AllSockets;
-extern fd_set AllClients;
-extern fd_set LastSelectMask;
-extern fd_set WellKnownConnections;
-extern fd_set EnabledDevices;
-extern fd_set ClientsWithInput;
-extern fd_set ClientsWriteBlocked;
-extern fd_set OutputPending;
-extern fd_set IgnoredClientsWithInput;
-
-extern int *ConnectionTranslation;
-
-extern Bool NewOutputPending;
-extern Bool AnyClientsWriteBlocked;
-extern Bool CriticalOutputPending;
-
-extern int timesThisConnection;
-extern ConnectionInputPtr FreeInputs;
-extern ConnectionOutputPtr FreeOutputs;
-extern OsCommPtr AvailableInput;
-
-extern WorkQueuePtr workQueue;
-
-/* added by raphael */
-#define ffs mffs
-extern int mffs(fd_mask);
-
-/* in auth.c */
-extern void GenerateRandomData (int len, char *buf);
-
-/* in mitauth.c */
-extern XID MitCheckCookie (AuthCheckArgs);
-extern XID MitGenerateCookie (AuthGenCArgs);
-extern XID MitToID (AuthToIDArgs);
-extern int MitAddCookie (AuthAddCArgs);
-extern int MitFromID (AuthFromIDArgs);
-extern int MitRemoveCookie (AuthRemCArgs);
-extern int MitResetCookie (AuthRstCArgs);
-
-/* in xdmauth.c */
-#ifdef HASXDMAUTH
-extern XID XdmCheckCookie (AuthCheckArgs);
-extern XID XdmToID (AuthToIDArgs);
-extern int XdmAddCookie (AuthAddCArgs);
-extern int XdmFromID (AuthFromIDArgs);
-extern int XdmRemoveCookie (AuthRemCArgs);
-extern int XdmResetCookie (AuthRstCArgs);
-#endif
-
-/* in rpcauth.c */
-#ifdef SECURE_RPC
-extern void SecureRPCInit (AuthInitArgs);
-extern XID SecureRPCCheck (AuthCheckArgs);
-extern XID SecureRPCToID (AuthToIDArgs);
-extern int SecureRPCAdd (AuthAddCArgs);
-extern int SecureRPCFromID (AuthFromIDArgs);
-extern int SecureRPCRemove (AuthRemCArgs);
-extern int SecureRPCReset (AuthRstCArgs);
-#endif
-
-/* in k5auth.c */
-#ifdef K5AUTH
-extern XID K5Check (AuthCheckArgs);
-extern XID K5ToID (AuthToIDArgs);
-extern int K5Add (AuthAddCArgs);
-extern int K5FromID (AuthFromIDArgs);
-extern int K5Remove (AuthRemCArgs);
-extern int K5Reset (AuthRstCArgs);
-#endif
-
-/* in secauth.c */
-extern XID AuthSecurityCheck (AuthCheckArgs);
-
-/* in xdmcp.c */
-extern void XdmcpUseMsg (void);
-extern int XdmcpOptions(int argc, char **argv, int i);
-extern void XdmcpSetAuthentication (ARRAY8Ptr name);
-extern void XdmcpRegisterConnection (
- int type,
- char *address,
- int addrlen);
-extern void XdmcpRegisterAuthorizations (void);
-extern void XdmcpRegisterAuthorization (char *name, int namelen);
-extern void XdmcpRegisterDisplayClass (char *name, int length);
-extern void XdmcpInit (void);
-extern void XdmcpReset (void);
-extern void XdmcpOpenDisplay(int sock);
-extern void XdmcpCloseDisplay(int sock);
-extern void XdmcpRegisterAuthentication (
- char *name,
- int namelen,
- char *data,
- int datalen,
- ValidatorFunc Validator,
- GeneratorFunc Generator,
- AddAuthorFunc AddAuth);
-extern int XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type);
-extern int XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data);
-
-struct sockaddr_in;
-extern void XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr);
-
-#endif /* _OSDEP_H_ */
diff --git a/os/osinit.c b/os/osinit.c
deleted file mode 100644
index 1c56d0af7..000000000
--- a/os/osinit.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.30 2003/10/29 04:17:22 dawes Exp $ */
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Xorg: osinit.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#include "os.h"
-#include "osdep.h"
-#include "Xos.h"
-
-#ifdef SMART_SCHEDULE
-#include "dixstruct.h"
-#endif
-
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
-#if defined(Lynx) || defined(SCO) || defined(SCO325)
-#include <sys/wait.h>
-#endif
-
-#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4)
-#include <sys/resource.h>
-#endif
-
-#ifndef ADMPATH
-#define ADMPATH "/usr/adm/X%smsgs"
-#endif
-
-extern char *display;
-#ifdef RLIMIT_DATA
-int limitDataSpace = -1;
-#endif
-#ifdef RLIMIT_STACK
-int limitStackSpace = -1;
-#endif
-#ifdef RLIMIT_NOFILE
-int limitNoFile = -1;
-#endif
-
-Bool OsDelayInitColors = FALSE;
-
-#ifdef XFree86LOADER
-extern void xf86WrapperInit(void);
-#endif
-
-void
-OsInit(void)
-{
- static Bool been_here = FALSE;
- static char* admpath = ADMPATH;
- static char* devnull = "/dev/null";
- char fname[PATH_MAX];
-
-#ifdef macII
- set42sig();
-#endif
-
- if (!been_here) {
-#ifdef XFree86LOADER
- xf86WrapperInit();
-#endif
-#if !defined(SCO) && !defined(__CYGWIN__)
- fclose(stdin);
- fclose(stdout);
-#endif
- /*
- * If a write of zero bytes to stderr returns non-zero, i.e. -1,
- * then writing to stderr failed, and we'll write somewhere else
- * instead. (Apparently this never happens in the Real World.)
- */
- if (write (2, fname, 0) == -1)
- {
- FILE *err;
-
- if (strlen (display) + strlen (admpath) + 1 < sizeof fname)
- sprintf (fname, admpath, display);
- else
- strcpy (fname, devnull);
- /*
- * uses stdio to avoid os dependencies here,
- * a real os would use
- * open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666)
- */
- if (!(err = fopen (fname, "a+")))
- err = fopen (devnull, "w");
- if (err && (fileno(err) != 2)) {
- dup2 (fileno (err), 2);
- fclose (err);
- }
-#if defined(SYSV) || defined(SVR4) || defined(__UNIXOS2__) || defined(WIN32) || defined(__CYGWIN__)
- {
- static char buf[BUFSIZ];
- setvbuf (stderr, buf, _IOLBF, BUFSIZ);
- }
-#else
- setlinebuf(stderr);
-#endif
- }
-
-#ifndef X_NOT_POSIX
- if (getpgrp () == 0)
- setpgid (0, 0);
-#else
-#if !defined(SYSV) && !defined(WIN32)
- if (getpgrp (0) == 0)
- setpgrp (0, getpid ());
-#endif
-#endif
-
-#ifdef RLIMIT_DATA
- if (limitDataSpace >= 0)
- {
- struct rlimit rlim;
-
- if (!getrlimit(RLIMIT_DATA, &rlim))
- {
- if ((limitDataSpace > 0) && (limitDataSpace < rlim.rlim_max))
- rlim.rlim_cur = limitDataSpace;
- else
- rlim.rlim_cur = rlim.rlim_max;
- (void)setrlimit(RLIMIT_DATA, &rlim);
- }
- }
-#endif
-#ifdef RLIMIT_STACK
- if (limitStackSpace >= 0)
- {
- struct rlimit rlim;
-
- if (!getrlimit(RLIMIT_STACK, &rlim))
- {
- if ((limitStackSpace > 0) && (limitStackSpace < rlim.rlim_max))
- rlim.rlim_cur = limitStackSpace;
- else
- rlim.rlim_cur = rlim.rlim_max;
- (void)setrlimit(RLIMIT_STACK, &rlim);
- }
- }
-#endif
-#ifdef RLIMIT_NOFILE
- if (limitNoFile >= 0)
- {
- struct rlimit rlim;
-
- if (!getrlimit(RLIMIT_NOFILE, &rlim))
- {
- if ((limitNoFile > 0) && (limitNoFile < rlim.rlim_max))
- rlim.rlim_cur = limitNoFile;
- else
- rlim.rlim_cur = rlim.rlim_max;
-#if 0
- if (rlim.rlim_cur > MAXSOCKS)
- rlim.rlim_cur = MAXSOCKS;
-#endif
- (void)setrlimit(RLIMIT_NOFILE, &rlim);
- }
- }
-#endif
-#ifdef SERVER_LOCK
- LockServer();
-#endif
- been_here = TRUE;
- }
- TimerInit();
-#ifdef DDXOSINIT
- OsVendorInit();
-#endif
- /*
- * No log file by default. OsVendorInit() should call LogInit() with the
- * log file name if logging to a file is desired.
- */
- LogInit(NULL, NULL);
-#ifdef SMART_SCHEDULE
- if (!SmartScheduleDisable)
- if (!SmartScheduleInit ())
- SmartScheduleDisable = TRUE;
-#endif
- OsInitAllocator();
- if (!OsDelayInitColors) OsInitColors();
-}
-
-void
-OsCleanup(Bool terminating)
-{
-#ifdef SERVER_LOCK
- if (terminating)
- {
- UnlockServer();
- }
-#endif
-}
diff --git a/os/rpcauth.c b/os/rpcauth.c
deleted file mode 100644
index 512b3ecb5..000000000
--- a/os/rpcauth.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $Xorg: rpcauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*
-
-Copyright 1991, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/rpcauth.c,v 3.8 2003/04/27 21:31:09 herrb Exp $ */
-
-/*
- * SUN-DES-1 authentication mechanism
- * Author: Mayank Choudhary, Sun Microsystems
- */
-
-
-#ifdef SECURE_RPC
-
-#include "X.h"
-#include "Xauth.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-
-#include <rpc/rpc.h>
-
-#ifdef sun
-/* <rpc/auth.h> only includes this if _KERNEL is #defined... */
-extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
-#endif
-
-#if defined(DGUX)
-#include <time.h>
-#include <rpc/auth_des.h>
-#endif /* DGUX */
-
-#ifdef ultrix
-#include <time.h>
-#include <rpc/auth_des.h>
-#endif
-
-static enum auth_stat why;
-
-static char *
-authdes_ezdecode(char *inmsg, int len)
-{
- struct rpc_msg msg;
- char cred_area[MAX_AUTH_BYTES];
- char verf_area[MAX_AUTH_BYTES];
- char *temp_inmsg;
- struct svc_req r;
- bool_t res0, res1;
- XDR xdr;
- SVCXPRT xprt;
-
- temp_inmsg = (char *) xalloc(len);
- memmove(temp_inmsg, inmsg, len);
-
- memset((char *)&msg, 0, sizeof(msg));
- memset((char *)&r, 0, sizeof(r));
- memset(cred_area, 0, sizeof(cred_area));
- memset(verf_area, 0, sizeof(verf_area));
-
- msg.rm_call.cb_cred.oa_base = cred_area;
- msg.rm_call.cb_verf.oa_base = verf_area;
- why = AUTH_FAILED;
- xdrmem_create(&xdr, temp_inmsg, len, XDR_DECODE);
-
- if ((r.rq_clntcred = (caddr_t) xalloc(MAX_AUTH_BYTES)) == NULL)
- goto bad1;
- r.rq_xprt = &xprt;
-
- /* decode into msg */
- res0 = xdr_opaque_auth(&xdr, &(msg.rm_call.cb_cred));
- res1 = xdr_opaque_auth(&xdr, &(msg.rm_call.cb_verf));
- if ( ! (res0 && res1) )
- goto bad2;
-
- /* do the authentication */
-
- r.rq_cred = msg.rm_call.cb_cred; /* read by opaque stuff */
- if (r.rq_cred.oa_flavor != AUTH_DES) {
- why = AUTH_TOOWEAK;
- goto bad2;
- }
-#ifdef SVR4
- if ((why = __authenticate(&r, &msg)) != AUTH_OK) {
-#else
- if ((why = _authenticate(&r, &msg)) != AUTH_OK) {
-#endif
- goto bad2;
- }
- return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name);
-
-bad2:
- xfree(r.rq_clntcred);
-bad1:
- return ((char *)0); /* ((struct authdes_cred *) NULL); */
-}
-
-static XID rpc_id = (XID) ~0L;
-
-static Bool
-CheckNetName (
- unsigned char *addr,
- short len,
- pointer closure
-)
-{
- return (len == strlen ((char *) closure) &&
- strncmp ((char *) addr, (char *) closure, len) == 0);
-}
-
-static char rpc_error[MAXNETNAMELEN+50];
-
-XID
-SecureRPCCheck (unsigned short data_length, char *data,
- ClientPtr client, char **reason)
-{
- char *fullname;
-
- if (rpc_id == (XID) ~0L) {
- *reason = "Secure RPC authorization not initialized";
- } else {
- fullname = authdes_ezdecode(data, data_length);
- if (fullname == (char *)0) {
- sprintf(rpc_error, "Unable to authenticate secure RPC client (why=%d)", why);
- *reason = rpc_error;
- } else {
- if (ForEachHostInFamily (FamilyNetname, CheckNetName, fullname))
- return rpc_id;
- sprintf(rpc_error, "Principal \"%s\" is not authorized to connect",
- fullname);
- *reason = rpc_error;
- }
- }
- return (XID) ~0L;
-}
-
-void
-SecureRPCInit (void)
-{
- if (rpc_id == ~0L)
- AddAuthorization (9, "SUN-DES-1", 0, (char *) 0);
-}
-
-int
-SecureRPCAdd (unsigned short data_length, char *data, XID id)
-{
- if (data_length)
- AddHost ((pointer) 0, FamilyNetname, data_length, data);
- rpc_id = id;
- return 1;
-}
-
-int
-SecureRPCReset (void)
-{
- rpc_id = (XID) ~0L;
- return 1;
-}
-
-XID
-SecureRPCToID (unsigned short data_length, char *data)
-{
- return rpc_id;
-}
-
-int
-SecureRPCFromID (XID id, unsigned short *data_lenp, char **datap)
-{
- return 0;
-}
-
-int
-SecureRPCRemove (unsigned short data_length, char *data)
-{
- return 0;
-}
-#endif /* SECURE_RPC */
diff --git a/os/secauth.c b/os/secauth.c
deleted file mode 100644
index 4f90fe9a9..000000000
--- a/os/secauth.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* $Xorg: secauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */
-/*
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-/* $XFree86: xc/programs/Xserver/os/secauth.c,v 1.11 2001/12/14 20:00:35 dawes Exp $ */
-
-#include "X.h"
-#include "os.h"
-#include "osdep.h"
-#include "dixstruct.h"
-#include "swaprep.h"
-
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "extensions/security.h"
-#endif
-
-static char InvalidPolicyReason[] = "invalid policy specification";
-static char PolicyViolationReason[] = "policy violation";
-
-static Bool
-AuthCheckSitePolicy(
- unsigned short *data_lengthP,
- char **dataP,
- ClientPtr client,
- char **reason)
-{
- CARD8 *policy = *(CARD8 **)dataP;
- int length;
- Bool permit;
- int nPolicies;
- char **sitePolicies;
- int nSitePolicies;
- Bool found = FALSE;
-
- if ((length = *data_lengthP) < 2) {
- *reason = InvalidPolicyReason;
- return FALSE;
- }
-
- permit = (*policy++ == 0);
- nPolicies = (CARD8) *policy++;
-
- length -= 2;
-
- sitePolicies = SecurityGetSitePolicyStrings(&nSitePolicies);
-
- while (nPolicies) {
- int strLen, sitePolicy;
-
- if (length == 0) {
- *reason = InvalidPolicyReason;
- return FALSE;
- }
-
- strLen = (CARD8) *policy++;
- if (--length < strLen) {
- *reason = InvalidPolicyReason;
- return FALSE;
- }
-
- if (!found)
- {
- for (sitePolicy = 0; sitePolicy < nSitePolicies; sitePolicy++)
- {
- char *testPolicy = sitePolicies[sitePolicy];
- if ((strLen == strlen(testPolicy)) &&
- (strncmp((char *)policy, testPolicy, strLen) == 0))
- {
- found = TRUE; /* need to continue parsing the policy... */
- break;
- }
- }
- }
-
- policy += strLen;
- length -= strLen;
- nPolicies--;
- }
-
- if (found != permit)
- {
- *reason = PolicyViolationReason;
- return FALSE;
- }
-
- *data_lengthP = length;
- *dataP = (char *)policy;
- return TRUE;
-}
-
-XID
-AuthSecurityCheck (
- unsigned short data_length,
- char *data,
- ClientPtr client,
- char **reason)
-{
-#ifdef XCSECURITY
- xConnSetupPrefix csp;
- xReq freq;
-
- if (client->clientState == ClientStateCheckedSecurity)
- {
- *reason = "repeated security check not permitted";
- return (XID) -1;
- }
- else if (data_length > 0)
- {
- char policy_mask = *data++;
-
- if (--data_length == 1) {
- *reason = InvalidPolicyReason;
- return (XID) -1;
- }
-
- if (policy_mask & 0x01) /* Extensions policy */
- {
- /* AuthCheckExtensionPolicy(&data_length, &data, client, reason) */
- *reason = "security policy not implemented";
- return (XID) -1;
- }
-
- if (policy_mask & 0x02) /* Site policy */
- {
- if (!AuthCheckSitePolicy(&data_length, &data, client, reason))
- return (XID) -1;
- }
-
- if (data_length > 0) { /* did we consume the whole policy? */
- *reason = InvalidPolicyReason;
- return (XID) -1;
- }
-
- }
- else if (!GetAccessControl())
- {
- /*
- * The client - possibly the X FireWall Proxy - gave
- * no auth data and host-based authorization is turned
- * off. In this case, the client should be denied
- * access to the X server.
- */
- *reason = "server host access control is disabled";
- return (XID) -1;
- }
-
- client->clientState = ClientStateCheckingSecurity;
-
- csp.success = 2 /* Authenticate */;
- csp.lengthReason = 0;
- csp.length = 0;
- csp.majorVersion = X_PROTOCOL;
- csp.minorVersion = X_PROTOCOL_REVISION;
- if (client->swapped)
- WriteSConnSetupPrefix(client, &csp);
- else
- (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp);
-
- /*
- * Next time the client sends the real auth data, we want
- * ProcEstablishConnection to be called.
- */
-
- freq.reqType = 1;
- freq.length = (sz_xReq + sz_xConnClientPrefix) >> 2;
- client->swapped = FALSE;
- if (!InsertFakeRequest(client, (char *)&freq, sz_xReq))
- {
- *reason = "internal error";
- return (XID) -1;
- }
-
- return (XID) 0;
-#else
- *reason = "method not supported";
- return (XID) -1;
-#endif
-}
diff --git a/os/strlcat.c b/os/strlcat.c
deleted file mode 100644
index cda5c6ab9..000000000
--- a/os/strlcat.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/lib/misc/strlcat.c,v 1.1 2003/10/26 12:17:14 herrb Exp $ */
-
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
diff --git a/os/strlcpy.c b/os/strlcpy.c
deleted file mode 100644
index 14e45ef8c..000000000
--- a/os/strlcpy.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/* $XFree86: xc/lib/misc/strlcpy.c,v 1.1 2003/10/26 12:17:14 herrb Exp $ */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
diff --git a/os/utils.c b/os/utils.c
deleted file mode 100644
index e01793604..000000000
--- a/os/utils.c
+++ /dev/null
@@ -1,2044 +0,0 @@
-/* $Xorg: utils.c,v 1.5 2001/02/09 02:05:24 xorgcvs Exp $ */
-/*
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-Copyright 1994 Quarterdeck Office Systems.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital and
-Quarterdeck not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT
-OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
-OR PERFORMANCE OF THIS SOFTWARE.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.95 2003/10/01 18:36:38 alanh Exp $ */
-
-#ifdef __CYGWIN__
-#include <stdlib.h>
-#include <signal.h>
-#endif
-
-#if defined(WIN32) && !defined(__CYGWIN__)
-#include <X11/Xwinsock.h>
-#endif
-#include "Xos.h"
-#include <stdio.h>
-#include "misc.h"
-#include "X.h"
-#include <X11/Xtrans.h>
-#include "input.h"
-#include "dixfont.h"
-#include "osdep.h"
-#ifdef X_POSIX_C_SOURCE
-#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
-#include <signal.h>
-#undef _POSIX_C_SOURCE
-#else
-#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
-#include <signal.h>
-#else
-#define _POSIX_SOURCE
-#include <signal.h>
-#undef _POSIX_SOURCE
-#endif
-#endif
-#include <sys/wait.h>
-#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4)
-#include <sys/resource.h>
-#endif
-#include <time.h>
-#include <sys/stat.h>
-#include <ctype.h> /* for isspace */
-#include <stdarg.h>
-
-#if defined(DGUX)
-#include <sys/resource.h>
-#include <netdb.h>
-#endif
-
-#include <stdlib.h> /* for malloc() */
-
-#if defined(TCPCONN) || defined(STREAMSCONN)
-# ifndef WIN32
-# include <netdb.h>
-# endif
-#endif
-
-#include "opaque.h"
-
-#ifdef SMART_SCHEDULE
-#include "dixstruct.h"
-#endif
-
-#ifdef XKB
-#include "XKBsrv.h"
-#endif
-#ifdef XCSECURITY
-#define _SECURITY_SERVER
-#include "security.h"
-#endif
-
-#ifdef RENDER
-#include "picture.h"
-#endif
-
-#define X_INCLUDE_NETDB_H
-#include <X11/Xos_r.h>
-
-#include <errno.h>
-
-Bool CoreDump;
-Bool noTestExtensions;
-
-#ifdef PANORAMIX
-Bool noPanoramiXExtension = TRUE;
-Bool PanoramiXVisibilityNotifySent = FALSE;
-Bool PanoramiXMapped = FALSE;
-Bool PanoramiXWindowExposureSent = FALSE;
-Bool PanoramiXOneExposeRequest = FALSE;
-#endif
-
-int auditTrailLevel = 1;
-
-Bool Must_have_memory = FALSE;
-
-#ifdef AIXV3
-int SyncOn = 0;
-extern int SelectWaitTime;
-#endif
-
-#ifdef DEBUG
-#ifndef SPECIAL_MALLOC
-#define MEMBUG
-#endif
-#endif
-
-#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
-#define HAS_SAVED_IDS_AND_SETEUID
-#endif
-
-#ifdef MEMBUG
-#define MEM_FAIL_SCALE 100000
-long Memory_fail = 0;
-#include <stdlib.h> /* for random() */
-#endif
-
-#ifdef sgi
-int userdefinedfontpath = 0;
-#endif /* sgi */
-
-char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
-
-extern int dispatchExceptionAtReset;
-
-OsSigHandlerPtr
-OsSignal(sig, handler)
- int sig;
- OsSigHandlerPtr handler;
-{
-#ifdef X_NOT_POSIX
- return signal(sig, handler);
-#else
- struct sigaction act, oact;
-
- sigemptyset(&act.sa_mask);
- if (handler != SIG_IGN)
- sigaddset(&act.sa_mask, sig);
- act.sa_flags = 0;
- act.sa_handler = handler;
- sigaction(sig, &act, &oact);
- return oact.sa_handler;
-#endif
-}
-
-#ifdef SERVER_LOCK
-/*
- * Explicit support for a server lock file like the ones used for UUCP.
- * For architectures with virtual terminals that can run more than one
- * server at a time. This keeps the servers from stomping on each other
- * if the user forgets to give them different display numbers.
- */
-#ifndef __UNIXOS2__
-#define LOCK_DIR "/tmp"
-#endif
-#define LOCK_TMP_PREFIX "/.tX"
-#define LOCK_PREFIX "/.X"
-#define LOCK_SUFFIX "-lock"
-
-#if defined(DGUX)
-#include <limits.h>
-#include <sys/param.h>
-#endif
-
-#ifdef __UNIXOS2__
-#define link rename
-#endif
-
-#ifndef PATH_MAX
-#ifndef Lynx
-#include <sys/param.h>
-#else
-#include <param.h>
-#endif
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif
-
-static Bool StillLocking = FALSE;
-static char LockFile[PATH_MAX];
-static Bool nolock = FALSE;
-
-/*
- * LockServer --
- * Check if the server lock file exists. If so, check if the PID
- * contained inside is valid. If so, then die. Otherwise, create
- * the lock file containing the PID.
- */
-void
-LockServer(void)
-{
- char tmp[PATH_MAX], pid_str[12];
- int lfd, i, haslock, l_pid, t;
- char *tmppath = NULL;
- int len;
-
- if (nolock) return;
- /*
- * Path names
- */
-#ifndef __UNIXOS2__
- tmppath = LOCK_DIR;
-#else
- /* OS/2 uses TMP directory, must also prepare for 8.3 names */
- tmppath = getenv("TMP");
- if (!tmppath)
- FatalError("No TMP dir found\n");
-#endif
-
- len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) :
- strlen(LOCK_TMP_PREFIX);
- len += strlen(tmppath) + strlen(display) + strlen(LOCK_SUFFIX) + 1;
- if (len > sizeof(LockFile))
- FatalError("Display name `%s' is too long\n", display);
- (void)sprintf(tmp, "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, display);
- (void)sprintf(LockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, display);
-
- /*
- * Create a temporary file containing our PID. Attempt three times
- * to create the file.
- */
- StillLocking = TRUE;
- i = 0;
- do {
- i++;
- lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644);
- if (lfd < 0)
- sleep(2);
- else
- break;
- } while (i < 3);
- if (lfd < 0) {
- unlink(tmp);
- i = 0;
- do {
- i++;
- lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644);
- if (lfd < 0)
- sleep(2);
- else
- break;
- } while (i < 3);
- }
- if (lfd < 0)
- FatalError("Could not create lock file in %s\n", tmp);
- (void) sprintf(pid_str, "%10ld\n", (long)getpid());
- (void) write(lfd, pid_str, 11);
-#ifndef __UNIXOS2__
-#ifndef USE_CHMOD
- (void) fchmod(lfd, 0444);
-#else
- (void) chmod(tmp, 0444);
-#endif
-#endif
- (void) close(lfd);
-
- /*
- * OK. Now the tmp file exists. Try three times to move it in place
- * for the lock.
- */
- i = 0;
- haslock = 0;
- while ((!haslock) && (i++ < 3)) {
- haslock = (link(tmp,LockFile) == 0);
- if (haslock) {
- /*
- * We're done.
- */
- break;
- }
- else {
- /*
- * Read the pid from the existing file
- */
- lfd = open(LockFile, O_RDONLY);
- if (lfd < 0) {
- unlink(tmp);
- FatalError("Can't read lock file %s\n", LockFile);
- }
- pid_str[0] = '\0';
- if (read(lfd, pid_str, 11) != 11) {
- /*
- * Bogus lock file.
- */
- unlink(LockFile);
- close(lfd);
- continue;
- }
- pid_str[11] = '\0';
- sscanf(pid_str, "%d", &l_pid);
- close(lfd);
-
- /*
- * Now try to kill the PID to see if it exists.
- */
- errno = 0;
- t = kill(l_pid, 0);
- if ((t< 0) && (errno == ESRCH)) {
- /*
- * Stale lock file.
- */
- unlink(LockFile);
- continue;
- }
- else if (((t < 0) && (errno == EPERM)) || (t == 0)) {
- /*
- * Process is still active.
- */
- unlink(tmp);
- FatalError("Server is already active for display %s\n%s %s\n%s\n",
- display, "\tIf this server is no longer running, remove",
- LockFile, "\tand start again.");
- }
- }
- }
- unlink(tmp);
- if (!haslock)
- FatalError("Could not create server lock file: %s\n", LockFile);
- StillLocking = FALSE;
-}
-
-/*
- * UnlockServer --
- * Remove the server lock file.
- */
-void
-UnlockServer(void)
-{
- if (nolock) return;
-
- if (!StillLocking){
-
-#ifdef __UNIXOS2__
- (void) chmod(LockFile,S_IREAD|S_IWRITE);
-#endif /* __UNIXOS2__ */
- (void) unlink(LockFile);
- }
-}
-#endif /* SERVER_LOCK */
-
-/* Force connections to close on SIGHUP from init */
-
-/*ARGSUSED*/
-SIGVAL
-AutoResetServer (int sig)
-{
- int olderrno = errno;
-
- dispatchException |= DE_RESET;
- isItTimeToYield = TRUE;
-#ifdef GPROF
- chdir ("/tmp");
- exit (0);
-#endif
-#if defined(SYSV) && defined(X_NOT_POSIX)
- OsSignal (SIGHUP, AutoResetServer);
-#endif
- errno = olderrno;
-}
-
-/* Force connections to close and then exit on SIGTERM, SIGINT */
-
-/*ARGSUSED*/
-SIGVAL
-GiveUp(int sig)
-{
- int olderrno = errno;
-
- dispatchException |= DE_TERMINATE;
- isItTimeToYield = TRUE;
-#if defined(SYSV) && defined(X_NOT_POSIX)
- if (sig)
- OsSignal(sig, SIG_IGN);
-#endif
- errno = olderrno;
-}
-
-#ifndef DDXTIME
-CARD32
-GetTimeInMillis(void)
-{
- struct timeval tp;
-
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
-}
-#endif
-
-void
-AdjustWaitForDelay (pointer waitTime, unsigned long newdelay)
-{
- static struct timeval delay_val;
- struct timeval **wt = (struct timeval **) waitTime;
- unsigned long olddelay;
-
- if (*wt == NULL)
- {
- delay_val.tv_sec = newdelay / 1000;
- delay_val.tv_usec = 1000 * (newdelay % 1000);
- *wt = &delay_val;
- }
- else
- {
- olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000;
- if (newdelay < olddelay)
- {
- (*wt)->tv_sec = newdelay / 1000;
- (*wt)->tv_usec = 1000 * (newdelay % 1000);
- }
- }
-}
-
-void UseMsg(void)
-{
-#if !defined(AIXrt) && !defined(AIX386)
- ErrorF("use: X [:<display>] [option]\n");
- ErrorF("-a # mouse acceleration (pixels)\n");
- ErrorF("-ac disable access control restrictions\n");
-#ifdef MEMBUG
- ErrorF("-alloc int chance alloc should fail\n");
-#endif
- ErrorF("-audit int set audit trail level\n");
- ErrorF("-auth file select authorization file\n");
- ErrorF("bc enable bug compatibility\n");
- ErrorF("-br create root window with black background\n");
- ErrorF("+bs enable any backing store support\n");
- ErrorF("-bs disable any backing store support\n");
- ErrorF("-c turns off key-click\n");
- ErrorF("c # key-click volume (0-100)\n");
- ErrorF("-cc int default color visual class\n");
- ErrorF("-co file color database file\n");
-#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
- ErrorF("-config file read options from file\n");
-#endif
- ErrorF("-core generate core dump on fatal error\n");
- ErrorF("-dpi int screen resolution in dots per inch\n");
-#ifdef DPMSExtension
- ErrorF("dpms enables VESA DPMS monitor control\n");
- ErrorF("-dpms disables VESA DPMS monitor control\n");
-#endif
- ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
- ErrorF("-f # bell base (0-100)\n");
- ErrorF("-fc string cursor font\n");
- ErrorF("-fn string default font name\n");
- ErrorF("-fp string default font path\n");
- ErrorF("-help prints message with these options\n");
- ErrorF("-I ignore all remaining arguments\n");
-#ifdef RLIMIT_DATA
- ErrorF("-ld int limit data space to N Kb\n");
-#endif
-#ifdef RLIMIT_NOFILE
- ErrorF("-lf int limit number of open files to N\n");
-#endif
-#ifdef RLIMIT_STACK
- ErrorF("-ls int limit stack space to N Kb\n");
-#endif
-#ifdef SERVER_LOCK
- ErrorF("-nolock disable the locking mechanism\n");
-#endif
-#ifndef NOLOGOHACK
- ErrorF("-logo enable logo in screen saver\n");
- ErrorF("nologo disable logo in screen saver\n");
-#endif
- ErrorF("-nolisten string don't listen on protocol\n");
- ErrorF("-p # screen-saver pattern duration (minutes)\n");
- ErrorF("-pn accept failure to listen on all ports\n");
- ErrorF("-nopn reject failure to listen on all ports\n");
- ErrorF("-r turns off auto-repeat\n");
- ErrorF("r turns on auto-repeat \n");
-#ifdef RENDER
- ErrorF("-render [default|mono|gray|color] set render color alloc policy\n");
-#endif
- ErrorF("-s # screen-saver timeout (minutes)\n");
-#ifdef XCSECURITY
- ErrorF("-sp file security policy file\n");
-#endif
- ErrorF("-su disable any save under support\n");
- ErrorF("-t # mouse threshold (pixels)\n");
- ErrorF("-terminate terminate at server reset\n");
- ErrorF("-to # connection time out\n");
- ErrorF("-tst disable testing extensions\n");
- ErrorF("ttyxx server started from init on /dev/ttyxx\n");
- ErrorF("v video blanking for screen-saver\n");
- ErrorF("-v screen-saver without video blanking\n");
- ErrorF("-wm WhenMapped default backing-store\n");
- ErrorF("-x string loads named extension at init time \n");
- ErrorF("-maxbigreqsize set maximal bigrequest size \n");
-#ifdef PANORAMIX
- ErrorF("+xinerama Enable XINERAMA extension\n");
- ErrorF("-xinerama Disable XINERAMA extension\n");
-#endif
-#ifdef SMART_SCHEDULE
- ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n");
- ErrorF("-schedInterval int Set scheduler interval in msec\n");
-#endif
-#ifdef XDMCP
- XdmcpUseMsg();
-#endif
-#endif /* !AIXrt && ! AIX386 */
-#ifdef XKB
- XkbUseMsg();
-#endif
- ddxUseMsg();
-}
-
-/* This function performs a rudimentary sanity check
- * on the display name passed in on the command-line,
- * since this string is used to generate filenames.
- * It is especially important that the display name
- * not contain a "/" and not start with a "-".
- * --kvajk
- */
-static int
-VerifyDisplayName(const char *d)
-{
- if ( d == (char *)0 ) return( 0 ); /* null */
- if ( *d == '\0' ) return( 0 ); /* empty */
- if ( *d == '-' ) return( 0 ); /* could be confused for an option */
- if ( *d == '.' ) return( 0 ); /* must not equal "." or ".." */
- if ( strchr(d, '/') != (char *)0 ) return( 0 ); /* very important!!! */
- return( 1 );
-}
-
-/*
- * This function parses the command line. Handles device-independent fields
- * and allows ddx to handle additional fields. It is not allowed to modify
- * argc or any of the strings pointed to by argv.
- */
-void
-ProcessCommandLine(int argc, char *argv[])
-{
- int i, skip;
-
- defaultKeyboardControl.autoRepeat = TRUE;
-
-#ifdef PART_NET
- PartialNetwork = TRUE;
-#endif
-
- for ( i = 1; i < argc; i++ )
- {
- /* call ddx first, so it can peek/override if it wants */
- if((skip = ddxProcessArgument(argc, argv, i)))
- {
- i += (skip - 1);
- }
- else if(argv[i][0] == ':')
- {
- /* initialize display */
- display = argv[i];
- display++;
- if( ! VerifyDisplayName( display ) ) {
- ErrorF("Bad display name: %s\n", display);
- UseMsg();
- exit(1);
- }
- }
- else if ( strcmp( argv[i], "-a") == 0)
- {
- if(++i < argc)
- defaultPointerControl.num = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-ac") == 0)
- {
- defeatAccessControl = TRUE;
- }
-#ifdef MEMBUG
- else if ( strcmp( argv[i], "-alloc") == 0)
- {
- if(++i < argc)
- Memory_fail = atoi(argv[i]);
- else
- UseMsg();
- }
-#endif
- else if ( strcmp( argv[i], "-audit") == 0)
- {
- if(++i < argc)
- auditTrailLevel = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-auth") == 0)
- {
- if(++i < argc)
- InitAuthorization (argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "bc") == 0)
- permitOldBugs = TRUE;
- else if ( strcmp( argv[i], "-br") == 0)
- blackRoot = TRUE;
- else if ( strcmp( argv[i], "+bs") == 0)
- enableBackingStore = TRUE;
- else if ( strcmp( argv[i], "-bs") == 0)
- disableBackingStore = TRUE;
- else if ( strcmp( argv[i], "c") == 0)
- {
- if(++i < argc)
- defaultKeyboardControl.click = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-c") == 0)
- {
- defaultKeyboardControl.click = 0;
- }
- else if ( strcmp( argv[i], "-cc") == 0)
- {
- if(++i < argc)
- defaultColorVisualClass = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-co") == 0)
- {
- if(++i < argc)
- rgbPath = argv[i];
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-core") == 0)
- CoreDump = TRUE;
- else if ( strcmp( argv[i], "-dpi") == 0)
- {
- if(++i < argc)
- monitorResolution = atoi(argv[i]);
- else
- UseMsg();
- }
-#ifdef DPMSExtension
- else if ( strcmp( argv[i], "dpms") == 0)
- DPMSEnabledSwitch = TRUE;
- else if ( strcmp( argv[i], "-dpms") == 0)
- DPMSDisabledSwitch = TRUE;
-#endif
- else if ( strcmp( argv[i], "-deferglyphs") == 0)
- {
- if(++i >= argc || !ParseGlyphCachingMode(argv[i]))
- UseMsg();
- }
- else if ( strcmp( argv[i], "-f") == 0)
- {
- if(++i < argc)
- defaultKeyboardControl.bell = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-fc") == 0)
- {
- if(++i < argc)
- defaultCursorFont = argv[i];
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-fn") == 0)
- {
- if(++i < argc)
- defaultTextFont = argv[i];
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-fp") == 0)
- {
- if(++i < argc)
- {
-#ifdef sgi
- userdefinedfontpath = 1;
-#endif /* sgi */
- defaultFontPath = argv[i];
- }
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-help") == 0)
- {
- UseMsg();
- exit(0);
- }
-#ifdef XKB
- else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) {
- if (skip>0)
- i+= skip-1;
- else UseMsg();
- }
-#endif
-#ifdef RLIMIT_DATA
- else if ( strcmp( argv[i], "-ld") == 0)
- {
- if(++i < argc)
- {
- limitDataSpace = atoi(argv[i]);
- if (limitDataSpace > 0)
- limitDataSpace *= 1024;
- }
- else
- UseMsg();
- }
-#endif
-#ifdef RLIMIT_NOFILE
- else if ( strcmp( argv[i], "-lf") == 0)
- {
- if(++i < argc)
- limitNoFile = atoi(argv[i]);
- else
- UseMsg();
- }
-#endif
-#ifdef RLIMIT_STACK
- else if ( strcmp( argv[i], "-ls") == 0)
- {
- if(++i < argc)
- {
- limitStackSpace = atoi(argv[i]);
- if (limitStackSpace > 0)
- limitStackSpace *= 1024;
- }
- else
- UseMsg();
- }
-#endif
-#ifdef SERVER_LOCK
- else if ( strcmp ( argv[i], "-nolock") == 0)
- {
-#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__)
- if (getuid() != 0)
- ErrorF("Warning: the -nolock option can only be used by root\n");
- else
-#endif
- nolock = TRUE;
- }
-#endif
-#ifndef NOLOGOHACK
- else if ( strcmp( argv[i], "-logo") == 0)
- {
- logoScreenSaver = 1;
- }
- else if ( strcmp( argv[i], "nologo") == 0)
- {
- logoScreenSaver = 0;
- }
-#endif
- else if ( strcmp( argv[i], "-nolisten") == 0)
- {
- if(++i < argc) {
- if (_XSERVTransNoListen(argv[i]))
- FatalError ("Failed to disable listen for %s transport",
- argv[i]);
- } else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-noreset") == 0)
- {
- dispatchExceptionAtReset = 0;
- }
- else if ( strcmp( argv[i], "-p") == 0)
- {
- if(++i < argc)
- defaultScreenSaverInterval = ((CARD32)atoi(argv[i])) *
- MILLI_PER_MIN;
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-pn") == 0)
- PartialNetwork = TRUE;
- else if ( strcmp( argv[i], "-nopn") == 0)
- PartialNetwork = FALSE;
- else if ( strcmp( argv[i], "r") == 0)
- defaultKeyboardControl.autoRepeat = TRUE;
- else if ( strcmp( argv[i], "-r") == 0)
- defaultKeyboardControl.autoRepeat = FALSE;
- else if ( strcmp( argv[i], "-s") == 0)
- {
- if(++i < argc)
- defaultScreenSaverTime = ((CARD32)atoi(argv[i])) *
- MILLI_PER_MIN;
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-su") == 0)
- disableSaveUnders = TRUE;
- else if ( strcmp( argv[i], "-t") == 0)
- {
- if(++i < argc)
- defaultPointerControl.threshold = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-terminate") == 0)
- {
- dispatchExceptionAtReset = DE_TERMINATE;
- }
- else if ( strcmp( argv[i], "-to") == 0)
- {
- if(++i < argc)
- TimeOutValue = ((CARD32)atoi(argv[i])) * MILLI_PER_SECOND;
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-tst") == 0)
- {
- noTestExtensions = TRUE;
- }
- else if ( strcmp( argv[i], "v") == 0)
- defaultScreenSaverBlanking = PreferBlanking;
- else if ( strcmp( argv[i], "-v") == 0)
- defaultScreenSaverBlanking = DontPreferBlanking;
- else if ( strcmp( argv[i], "-wm") == 0)
- defaultBackingStore = WhenMapped;
- else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
- if(++i < argc) {
- int reqSizeArg = atoi(argv[i]);
-
- /* Request size > 128MB does not make much sense... */
- if( reqSizeArg > 0 && reqSizeArg < 128 ) {
- maxBigRequestSize = (reqSizeArg * 1048576) - 1;
- }
- else
- {
- UseMsg();
- }
- }
- else
- {
- UseMsg();
- }
- }
-#ifdef PANORAMIX
- else if ( strcmp( argv[i], "+xinerama") == 0){
- noPanoramiXExtension = FALSE;
- }
- else if ( strcmp( argv[i], "-xinerama") == 0){
- noPanoramiXExtension = TRUE;
- }
-#endif
- else if ( strcmp( argv[i], "-x") == 0)
- {
- if(++i >= argc)
- UseMsg();
- /* For U**x, which doesn't support dynamic loading, there's nothing
- * to do when we see a -x. Either the extension is linked in or
- * it isn't */
- }
- else if ( strcmp( argv[i], "-I") == 0)
- {
- /* ignore all remaining arguments */
- break;
- }
- else if (strncmp (argv[i], "tty", 3) == 0)
- {
- /* just in case any body is interested */
- dev_tty_from_init = argv[i];
- }
-#ifdef XDMCP
- else if ((skip = XdmcpOptions(argc, argv, i)) != i)
- {
- i = skip - 1;
- }
-#endif
-#ifdef XPRINT
- else if ((skip = XprintOptions(argc, argv, i)) != i)
- {
- i = skip - 1;
- }
-#endif
-#ifdef XCSECURITY
- else if ((skip = XSecurityOptions(argc, argv, i)) != i)
- {
- i = skip - 1;
- }
-#endif
-#ifdef AIXV3
- else if ( strcmp( argv[i], "-timeout") == 0)
- {
- if(++i < argc)
- SelectWaitTime = atoi(argv[i]);
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-sync") == 0)
- {
- SyncOn++;
- }
-#endif
-#ifdef SMART_SCHEDULE
- else if ( strcmp( argv[i], "-dumbSched") == 0)
- {
- SmartScheduleDisable = TRUE;
- }
- else if ( strcmp( argv[i], "-schedInterval") == 0)
- {
- if (++i < argc)
- {
- SmartScheduleInterval = atoi(argv[i]);
- SmartScheduleSlice = SmartScheduleInterval;
- }
- else
- UseMsg();
- }
- else if ( strcmp( argv[i], "-schedMax") == 0)
- {
- if (++i < argc)
- {
- SmartScheduleMaxSlice = atoi(argv[i]);
- }
- else
- UseMsg();
- }
-#endif
-#ifdef RENDER
- else if ( strcmp( argv[i], "-render" ) == 0)
- {
- if (++i < argc)
- {
- int policy = PictureParseCmapPolicy (argv[i]);
-
- if (policy != PictureCmapPolicyInvalid)
- PictureCmapPolicy = policy;
- else
- UseMsg ();
- }
- else
- UseMsg ();
- }
-#endif
- else
- {
- ErrorF("Unrecognized option: %s\n", argv[i]);
- UseMsg();
- exit (1);
- }
- }
-}
-
-#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
-static void
-InsertFileIntoCommandLine(
- int *resargc, char ***resargv,
- int prefix_argc, char **prefix_argv,
- char *filename,
- int suffix_argc, char **suffix_argv)
-{
- struct stat st;
- FILE *f;
- char *p;
- char *q;
- int insert_argc;
- char *buf;
- int len;
- int i;
-
- f = fopen(filename, "r");
- if (!f)
- FatalError("Can't open option file %s\n", filename);
-
- fstat(fileno(f), &st);
-
- buf = (char *) xalloc((unsigned) st.st_size + 1);
- if (!buf)
- FatalError("Out of Memory\n");
-
- len = fread(buf, 1, (unsigned) st.st_size, f);
-
- fclose(f);
-
- if (len < 0)
- FatalError("Error reading option file %s\n", filename);
-
- buf[len] = '\0';
-
- p = buf;
- q = buf;
- insert_argc = 0;
-
- while (*p)
- {
- while (isspace(*p))
- p++;
- if (!*p)
- break;
- if (*p == '#')
- {
- while (*p && *p != '\n')
- p++;
- } else
- {
- while (*p && !isspace(*p))
- *q++ = *p++;
- /* Since p and q might still be pointing at the same place, we */
- /* need to step p over the whitespace now before we add the null. */
- if (*p)
- p++;
- *q++ = '\0';
- insert_argc++;
- }
- }
-
- buf = (char *) xrealloc(buf, q - buf);
- if (!buf)
- FatalError("Out of memory reallocing option buf\n");
-
- *resargc = prefix_argc + insert_argc + suffix_argc;
- *resargv = (char **) xalloc((*resargc + 1) * sizeof(char *));
- if (!*resargv)
- FatalError("Out of Memory\n");
-
- memcpy(*resargv, prefix_argv, prefix_argc * sizeof(char *));
-
- p = buf;
- for (i = 0; i < insert_argc; i++)
- {
- (*resargv)[prefix_argc + i] = p;
- p += strlen(p) + 1;
- }
-
- memcpy(*resargv + prefix_argc + insert_argc,
- suffix_argv, suffix_argc * sizeof(char *));
-
- (*resargv)[*resargc] = NULL;
-} /* end InsertFileIntoCommandLine */
-
-
-void
-ExpandCommandLine(int *pargc, char ***pargv)
-{
- int i;
-
-#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__)
- if (getuid() != geteuid())
- return;
-#endif
-
- for (i = 1; i < *pargc; i++)
- {
- if ( (0 == strcmp((*pargv)[i], "-config")) && (i < (*pargc - 1)) )
- {
- InsertFileIntoCommandLine(pargc, pargv,
- i, *pargv,
- (*pargv)[i+1], /* filename */
- *pargc - i - 2, *pargv + i + 2);
- i--;
- }
- }
-} /* end ExpandCommandLine */
-#endif
-
-/* Implement a simple-minded font authorization scheme. The authorization
- name is "hp-hostname-1", the contents are simply the host name. */
-int
-set_font_authorizations(char **authorizations, int *authlen, pointer client)
-{
-#define AUTHORIZATION_NAME "hp-hostname-1"
-#if defined(TCPCONN) || defined(STREAMSCONN)
- static char *result = NULL;
- static char *p = NULL;
-
- if (p == NULL)
- {
- char hname[1024], *hnameptr;
- unsigned int len;
-#if defined(IPv6) && defined(AF_INET6)
- struct addrinfo hints, *ai = NULL;
-#else
- struct hostent *host;
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
-#endif
-#endif
-
- gethostname(hname, 1024);
-#if defined(IPv6) && defined(AF_INET6)
- bzero(&hints, sizeof(hints));
- hints.ai_flags = AI_CANONNAME;
- if (getaddrinfo(hname, NULL, &hints, &ai) == 0) {
- hnameptr = ai->ai_canonname;
- } else {
- hnameptr = hname;
- }
-#else
- host = _XGethostbyname(hname, hparams);
- if (host == NULL)
- hnameptr = hname;
- else
- hnameptr = host->h_name;
-#endif
-
- len = strlen(hnameptr) + 1;
- result = xalloc(len + sizeof(AUTHORIZATION_NAME) + 4);
-
- p = result;
- *p++ = sizeof(AUTHORIZATION_NAME) >> 8;
- *p++ = sizeof(AUTHORIZATION_NAME) & 0xff;
- *p++ = (len) >> 8;
- *p++ = (len & 0xff);
-
- memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME));
- p += sizeof(AUTHORIZATION_NAME);
- memmove(p, hnameptr, len);
- p += len;
-#if defined(IPv6) && defined(AF_INET6)
- if (ai) {
- freeaddrinfo(ai);
- }
-#endif
- }
- *authlen = p - result;
- *authorizations = result;
- return 1;
-#else /* TCPCONN */
- return 0;
-#endif /* TCPCONN */
-}
-
-/* XALLOC -- X's internal memory allocator. Why does it return unsigned
- * long * instead of the more common char *? Well, if you read K&R you'll
- * see they say that alloc must return a pointer "suitable for conversion"
- * to whatever type you really want. In a full-blown generic allocator
- * there's no way to solve the alignment problems without potentially
- * wasting lots of space. But we have a more limited problem. We know
- * we're only ever returning pointers to structures which will have to
- * be long word aligned. So we are making a stronger guarantee. It might
- * have made sense to make Xalloc return char * to conform with people's
- * expectations of malloc, but this makes lint happier.
- */
-
-#ifndef INTERNAL_MALLOC
-
-void *
-Xalloc(unsigned long amount)
-{
- register pointer ptr;
-
- if ((long)amount <= 0) {
- return (unsigned long *)NULL;
- }
- /* aligned extra on long word boundary */
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
-#ifdef MEMBUG
- if (!Must_have_memory && Memory_fail &&
- ((random() % MEM_FAIL_SCALE) < Memory_fail))
- return (unsigned long *)NULL;
-#endif
- if ((ptr = (pointer)malloc(amount))) {
- return (unsigned long *)ptr;
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- return (unsigned long *)NULL;
-}
-
-/*****************
- * XNFalloc
- * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory
- *****************/
-
-void *
-XNFalloc(unsigned long amount)
-{
- register pointer ptr;
-
- if ((long)amount <= 0)
- {
- return (unsigned long *)NULL;
- }
- /* aligned extra on long word boundary */
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
- ptr = (pointer)malloc(amount);
- if (!ptr)
- {
- FatalError("Out of memory");
- }
- return ((unsigned long *)ptr);
-}
-
-/*****************
- * Xcalloc
- *****************/
-
-void *
-Xcalloc(unsigned long amount)
-{
- unsigned long *ret;
-
- ret = Xalloc (amount);
- if (ret)
- bzero ((char *) ret, (int) amount);
- return ret;
-}
-
-/*****************
- * XNFcalloc
- *****************/
-
-void *
-XNFcalloc(unsigned long amount)
-{
- unsigned long *ret;
-
- ret = Xalloc (amount);
- if (ret)
- bzero ((char *) ret, (int) amount);
- else if ((long)amount > 0)
- FatalError("Out of memory");
- return ret;
-}
-
-/*****************
- * Xrealloc
- *****************/
-
-void *
-Xrealloc(pointer ptr, unsigned long amount)
-{
-#ifdef MEMBUG
- if (!Must_have_memory && Memory_fail &&
- ((random() % MEM_FAIL_SCALE) < Memory_fail))
- return (unsigned long *)NULL;
-#endif
- if ((long)amount <= 0)
- {
- if (ptr && !amount)
- free(ptr);
- return (unsigned long *)NULL;
- }
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
- if (ptr)
- ptr = (pointer)realloc((char *)ptr, amount);
- else
- ptr = (pointer)malloc(amount);
- if (ptr)
- return (unsigned long *)ptr;
- if (Must_have_memory)
- FatalError("Out of memory");
- return (unsigned long *)NULL;
-}
-
-/*****************
- * XNFrealloc
- * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory
- *****************/
-
-void *
-XNFrealloc(pointer ptr, unsigned long amount)
-{
- if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL)
- {
- if ((long)amount > 0)
- FatalError( "Out of memory" );
- }
- return ((unsigned long *)ptr);
-}
-
-/*****************
- * Xfree
- * calls free
- *****************/
-
-void
-Xfree(pointer ptr)
-{
- if (ptr)
- free((char *)ptr);
-}
-
-void
-OsInitAllocator (void)
-{
-#ifdef MEMBUG
- static int been_here;
-
- /* Check the memory system after each generation */
- if (been_here)
- CheckMemory ();
- else
- been_here = 1;
-#endif
-}
-#endif /* !INTERNAL_MALLOC */
-
-
-char *
-Xstrdup(const char *s)
-{
- char *sd;
-
- if (s == NULL)
- return NULL;
-
- sd = (char *)Xalloc(strlen(s) + 1);
- if (sd != NULL)
- strcpy(sd, s);
- return sd;
-}
-
-
-char *
-XNFstrdup(const char *s)
-{
- char *sd;
-
- if (s == NULL)
- return NULL;
-
- sd = (char *)XNFalloc(strlen(s) + 1);
- strcpy(sd, s);
- return sd;
-}
-
-#ifdef SMART_SCHEDULE
-
-unsigned long SmartScheduleIdleCount;
-Bool SmartScheduleIdle;
-Bool SmartScheduleTimerStopped;
-
-#ifdef SIGVTALRM
-#define SMART_SCHEDULE_POSSIBLE
-#endif
-
-#ifdef SMART_SCHEDULE_POSSIBLE
-#define SMART_SCHEDULE_SIGNAL SIGALRM
-#define SMART_SCHEDULE_TIMER ITIMER_REAL
-#endif
-
-static void
-SmartScheduleStopTimer (void)
-{
-#ifdef SMART_SCHEDULE_POSSIBLE
- struct itimerval timer;
-
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 0;
- timer.it_value.tv_sec = 0;
- timer.it_value.tv_usec = 0;
- (void) setitimer (ITIMER_REAL, &timer, 0);
- SmartScheduleTimerStopped = TRUE;
-#endif
-}
-
-Bool
-SmartScheduleStartTimer (void)
-{
-#ifdef SMART_SCHEDULE_POSSIBLE
- struct itimerval timer;
-
- SmartScheduleTimerStopped = FALSE;
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = SmartScheduleInterval * 1000;
- timer.it_value.tv_sec = 0;
- timer.it_value.tv_usec = SmartScheduleInterval * 1000;
- return setitimer (ITIMER_REAL, &timer, 0) >= 0;
-#endif
- return FALSE;
-}
-
-#ifdef SMART_SCHEDULE_POSSIBLE
-static void
-SmartScheduleTimer (int sig)
-{
- int olderrno = errno;
-
- SmartScheduleTime += SmartScheduleInterval;
- if (SmartScheduleIdle)
- {
- SmartScheduleStopTimer ();
- }
- errno = olderrno;
-}
-#endif
-
-Bool
-SmartScheduleInit (void)
-{
-#ifdef SMART_SCHEDULE_POSSIBLE
- struct sigaction act;
-
- if (SmartScheduleDisable)
- return TRUE;
-
- bzero ((char *) &act, sizeof(struct sigaction));
-
- /* Set up the timer signal function */
- act.sa_handler = SmartScheduleTimer;
- sigemptyset (&act.sa_mask);
- sigaddset (&act.sa_mask, SMART_SCHEDULE_SIGNAL);
- if (sigaction (SMART_SCHEDULE_SIGNAL, &act, 0) < 0)
- {
- perror ("sigaction for smart scheduler");
- return FALSE;
- }
- /* Set up the virtual timer */
- if (!SmartScheduleStartTimer ())
- {
- perror ("scheduling timer");
- return FALSE;
- }
- /* stop the timer and wait for WaitForSomething to start it */
- SmartScheduleStopTimer ();
- return TRUE;
-#else
- return FALSE;
-#endif
-}
-#endif
-
-#ifdef SIG_BLOCK
-static sigset_t PreviousSignalMask;
-static int BlockedSignalCount;
-#endif
-
-void
-OsBlockSignals (void)
-{
-#ifdef SIG_BLOCK
- if (BlockedSignalCount++ == 0)
- {
- sigset_t set;
-
- sigemptyset (&set);
-#ifdef SIGALRM
- sigaddset (&set, SIGALRM);
-#endif
-#ifdef SIGVTALRM
- sigaddset (&set, SIGVTALRM);
-#endif
-#ifdef SIGWINCH
- sigaddset (&set, SIGWINCH);
-#endif
-#ifdef SIGIO
- sigaddset (&set, SIGIO);
-#endif
-#ifdef SIGTSTP
- sigaddset (&set, SIGTSTP);
-#endif
-#ifdef SIGTTIN
- sigaddset (&set, SIGTTIN);
-#endif
-#ifdef SIGTTOU
- sigaddset (&set, SIGTTOU);
-#endif
- sigprocmask (SIG_BLOCK, &set, &PreviousSignalMask);
- }
-#endif
-}
-
-void
-OsReleaseSignals (void)
-{
-#ifdef SIG_BLOCK
- if (--BlockedSignalCount == 0)
- {
- sigprocmask (SIG_SETMASK, &PreviousSignalMask, 0);
- }
-#endif
-}
-
-#if !defined(WIN32) && !defined(__UNIXOS2__)
-/*
- * "safer" versions of system(3), popen(3) and pclose(3) which give up
- * all privs before running a command.
- *
- * This is based on the code in FreeBSD 2.2 libc.
- *
- * XXX It'd be good to redirect stderr so that it ends up in the log file
- * as well. As it is now, xkbcomp messages don't end up in the log file.
- */
-
-int
-System(char *command)
-{
- int pid, p;
-#ifdef SIGCHLD
- void (*csig)(int);
-#endif
- int status;
-
- if (!command)
- return(1);
-
-#ifdef SIGCHLD
- csig = signal(SIGCHLD, SIG_DFL);
-#endif
-
-#ifdef DEBUG
- ErrorF("System: `%s'\n", command);
-#endif
-
- switch (pid = fork()) {
- case -1: /* error */
- p = -1;
- case 0: /* child */
- setgid(getgid());
- setuid(getuid());
- execl("/bin/sh", "sh", "-c", command, (char *)NULL);
- _exit(127);
- default: /* parent */
- do {
- p = waitpid(pid, &status, 0);
- } while (p == -1 && errno == EINTR);
-
- }
-
-#ifdef SIGCHLD
- signal(SIGCHLD, csig);
-#endif
-
- return p == -1 ? -1 : status;
-}
-
-static struct pid {
- struct pid *next;
- FILE *fp;
- int pid;
-} *pidlist;
-
-pointer
-Popen(char *command, char *type)
-{
- struct pid *cur;
- FILE *iop;
- int pdes[2], pid;
-
- if (command == NULL || type == NULL)
- return NULL;
-
- if ((*type != 'r' && *type != 'w') || type[1])
- return NULL;
-
- if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL)
- return NULL;
-
- if (pipe(pdes) < 0) {
- xfree(cur);
- return NULL;
- }
-
- switch (pid = fork()) {
- case -1: /* error */
- close(pdes[0]);
- close(pdes[1]);
- xfree(cur);
- return NULL;
- case 0: /* child */
- setgid(getgid());
- setuid(getuid());
- if (*type == 'r') {
- if (pdes[1] != 1) {
- /* stdout */
- dup2(pdes[1], 1);
- close(pdes[1]);
- }
- close(pdes[0]);
- } else {
- if (pdes[0] != 0) {
- /* stdin */
- dup2(pdes[0], 0);
- close(pdes[0]);
- }
- close(pdes[1]);
- }
- execl("/bin/sh", "sh", "-c", command, (char *)NULL);
- _exit(127);
- }
-
- /* Avoid EINTR during stdio calls */
- OsBlockSignals ();
-
- /* parent */
- if (*type == 'r') {
- iop = fdopen(pdes[0], type);
- close(pdes[1]);
- } else {
- iop = fdopen(pdes[1], type);
- close(pdes[0]);
- }
-
- cur->fp = iop;
- cur->pid = pid;
- cur->next = pidlist;
- pidlist = cur;
-
-#ifdef DEBUG
- ErrorF("Popen: `%s', fp = %p\n", command, iop);
-#endif
-
- return iop;
-}
-
-/* fopen that drops privileges */
-pointer
-Fopen(char *file, char *type)
-{
- FILE *iop;
-#ifndef HAS_SAVED_IDS_AND_SETEUID
- struct pid *cur;
- int pdes[2], pid;
-
- if (file == NULL || type == NULL)
- return NULL;
-
- if ((*type != 'r' && *type != 'w') || type[1])
- return NULL;
-
- if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL)
- return NULL;
-
- if (pipe(pdes) < 0) {
- xfree(cur);
- return NULL;
- }
-
- switch (pid = fork()) {
- case -1: /* error */
- close(pdes[0]);
- close(pdes[1]);
- xfree(cur);
- return NULL;
- case 0: /* child */
- setgid(getgid());
- setuid(getuid());
- if (*type == 'r') {
- if (pdes[1] != 1) {
- /* stdout */
- dup2(pdes[1], 1);
- close(pdes[1]);
- }
- close(pdes[0]);
- } else {
- if (pdes[0] != 0) {
- /* stdin */
- dup2(pdes[0], 0);
- close(pdes[0]);
- }
- close(pdes[1]);
- }
- execl("/bin/cat", "cat", file, (char *)NULL);
- _exit(127);
- }
-
- /* Avoid EINTR during stdio calls */
- OsBlockSignals ();
-
- /* parent */
- if (*type == 'r') {
- iop = fdopen(pdes[0], type);
- close(pdes[1]);
- } else {
- iop = fdopen(pdes[1], type);
- close(pdes[0]);
- }
-
- cur->fp = iop;
- cur->pid = pid;
- cur->next = pidlist;
- pidlist = cur;
-
-#ifdef DEBUG
- ErrorF("Popen: `%s', fp = %p\n", command, iop);
-#endif
-
- return iop;
-#else
- int ruid, euid;
-
- ruid = getuid();
- euid = geteuid();
-
- if (seteuid(ruid) == -1) {
- return NULL;
- }
- iop = fopen(file, type);
-
- if (seteuid(euid) == -1) {
- fclose(iop);
- return NULL;
- }
- return iop;
-#endif /* HAS_SAVED_IDS_AND_SETEUID */
-}
-
-int
-Pclose(pointer iop)
-{
- struct pid *cur, *last;
- int pstat;
- int pid;
-
-#ifdef DEBUG
- ErrorF("Pclose: fp = %p\n", iop);
-#endif
-
- fclose(iop);
-
- for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next)
- if (cur->fp == iop)
- break;
- if (cur == NULL)
- return -1;
-
- do {
- pid = waitpid(cur->pid, &pstat, 0);
- } while (pid == -1 && errno == EINTR);
-
- if (last == NULL)
- pidlist = cur->next;
- else
- last->next = cur->next;
- xfree(cur);
-
- /* allow EINTR again */
- OsReleaseSignals ();
-
- return pid == -1 ? -1 : pstat;
-}
-
-int
-Fclose(pointer iop)
-{
-#ifdef HAS_SAVED_IDS_AND_SETEUID
- return fclose(iop);
-#else
- return Pclose(iop);
-#endif
-}
-
-#endif /* !WIN32 && !__UNIXOS2__ */
-
-
-/*
- * CheckUserParameters: check for long command line arguments and long
- * environment variables. By default, these checks are only done when
- * the server's euid != ruid. In 3.3.x, these checks were done in an
- * external wrapper utility.
- */
-
-/* Consider LD* variables insecure? */
-#ifndef REMOVE_ENV_LD
-#define REMOVE_ENV_LD 1
-#endif
-
-/* Remove long environment variables? */
-#ifndef REMOVE_LONG_ENV
-#define REMOVE_LONG_ENV 1
-#endif
-
-/*
- * Disallow stdout or stderr as pipes? It's possible to block the X server
- * when piping stdout+stderr to a pipe.
- *
- * Don't enable this because it looks like it's going to cause problems.
- */
-#ifndef NO_OUTPUT_PIPES
-#define NO_OUTPUT_PIPES 0
-#endif
-
-
-/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
-#ifndef CHECK_EUID
-#define CHECK_EUID 1
-#endif
-
-/*
- * Maybe the locale can be faked to make isprint(3) report that everything
- * is printable? Avoid it by default.
- */
-#ifndef USE_ISPRINT
-#define USE_ISPRINT 0
-#endif
-
-#define MAX_ARG_LENGTH 128
-#define MAX_ENV_LENGTH 256
-#define MAX_ENV_PATH_LENGTH 2048 /* Limit for *PATH and TERMCAP */
-
-#if USE_ISPRINT
-#include <ctype.h>
-#define checkPrintable(c) isprint(c)
-#else
-#define checkPrintable(c) (((c) & 0x7f) >= 0x20 && ((c) & 0x7f) != 0x7f)
-#endif
-
-enum BadCode {
- NotBad = 0,
- UnsafeArg,
- ArgTooLong,
- UnprintableArg,
- EnvTooLong,
- OutputIsPipe,
- InternalError
-};
-
-#define ARGMSG \
- "\nIf the arguments used are valid, and have been rejected incorrectly\n" \
- "please send details of the arguments and why they are valid to\n" \
- "XFree86@XFree86.org. In the meantime, you can start the Xserver as\n" \
- "the \"super user\" (root).\n"
-
-#define ENVMSG \
- "\nIf the environment is valid, and have been rejected incorrectly\n" \
- "please send details of the environment and why it is valid to\n" \
- "XFree86@XFree86.org. In the meantime, you can start the Xserver as\n" \
- "the \"super user\" (root).\n"
-
-void
-CheckUserParameters(int argc, char **argv, char **envp)
-{
- enum BadCode bad = NotBad;
- int i = 0, j;
- char *a, *e = NULL;
-#if defined(__QNX__) && !defined(__QNXNTO__)
- char cmd_name[64];
-#endif
-
-#if CHECK_EUID
- if (geteuid() == 0 && getuid() != geteuid())
-#endif
- {
- /* Check each argv[] */
- for (i = 1; i < argc; i++) {
- if (strlen(argv[i]) > MAX_ARG_LENGTH) {
- bad = ArgTooLong;
- break;
- }
- a = argv[i];
- while (*a) {
- if (checkPrintable(*a) == 0) {
- bad = UnprintableArg;
- break;
- }
- a++;
- }
- if (bad)
- break;
- }
- if (!bad) {
- /* Check each envp[] */
- for (i = 0; envp[i]; i++) {
-
- /* Check for bad environment variables and values */
-#if REMOVE_ENV_LD
- while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) {
-#ifdef ENVDEBUG
- ErrorF("CheckUserParameters: removing %s from the "
- "environment\n", strtok(envp[i], "="));
-#endif
- for (j = i; envp[j]; j++) {
- envp[j] = envp[j+1];
- }
- }
-#endif
- if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) {
-#if REMOVE_LONG_ENV
-#ifdef ENVDEBUG
- ErrorF("CheckUserParameters: removing %s from the "
- "environment\n", strtok(envp[i], "="));
-#endif
- for (j = i; envp[j]; j++) {
- envp[j] = envp[j+1];
- }
- i--;
-#else
- char *eq;
- int len;
-
- eq = strchr(envp[i], '=');
- if (!eq)
- continue;
- len = eq - envp[i];
- e = malloc(len + 1);
- if (!e) {
- bad = InternalError;
- break;
- }
- strncpy(e, envp[i], len);
- e[len] = 0;
- if (len >= 4 &&
- (strcmp(e + len - 4, "PATH") == 0 ||
- strcmp(e, "TERMCAP") == 0)) {
- if (strlen(envp[i]) > MAX_ENV_PATH_LENGTH) {
- bad = EnvTooLong;
- break;
- } else {
- free(e);
- }
- } else {
- bad = EnvTooLong;
- break;
- }
-#endif
- }
- }
- }
-#if NO_OUTPUT_PIPES
- if (!bad) {
- struct stat buf;
-
- if (fstat(fileno(stdout), &buf) == 0 && S_ISFIFO(buf.st_mode))
- bad = OutputIsPipe;
- if (fstat(fileno(stderr), &buf) == 0 && S_ISFIFO(buf.st_mode))
- bad = OutputIsPipe;
- }
-#endif
- }
- switch (bad) {
- case NotBad:
- return;
- case UnsafeArg:
- ErrorF("Command line argument number %d is unsafe\n", i);
- ErrorF(ARGMSG);
- break;
- case ArgTooLong:
- ErrorF("Command line argument number %d is too long\n", i);
- ErrorF(ARGMSG);
- break;
- case UnprintableArg:
- ErrorF("Command line argument number %d contains unprintable"
- " characters\n", i);
- ErrorF(ARGMSG);
- break;
- case EnvTooLong:
- ErrorF("Environment variable `%s' is too long\n", e);
- ErrorF(ENVMSG);
- break;
- case OutputIsPipe:
- ErrorF("Stdout and/or stderr is a pipe\n");
- break;
- case InternalError:
- ErrorF("Internal Error\n");
- break;
- default:
- ErrorF("Unknown error\n");
- ErrorF(ARGMSG);
- ErrorF(ENVMSG);
- break;
- }
- FatalError("X server aborted because of unsafe environment\n");
-}
-
-/*
- * CheckUserAuthorization: check if the user is allowed to start the
- * X server. This usually means some sort of PAM checking, and it is
- * usually only done for setuid servers (uid != euid).
- */
-
-#ifdef USE_PAM
-#include <security/pam_appl.h>
-#include <security/pam_misc.h>
-#include <pwd.h>
-#endif /* USE_PAM */
-
-void
-CheckUserAuthorization(void)
-{
-#ifdef USE_PAM
- static struct pam_conv conv = {
- misc_conv,
- NULL
- };
-
- pam_handle_t *pamh = NULL;
- struct passwd *pw;
- int retval;
-
- if (getuid() != geteuid()) {
- pw = getpwuid(getuid());
- if (pw == NULL)
- FatalError("getpwuid() failed for uid %d\n", getuid());
-
- retval = pam_start("xserver", pw->pw_name, &conv, &pamh);
- if (retval != PAM_SUCCESS)
- FatalError("pam_start() failed.\n"
- "\tMissing or mangled PAM config file or module?\n");
-
- retval = pam_authenticate(pamh, 0);
- if (retval != PAM_SUCCESS) {
- pam_end(pamh, retval);
- FatalError("PAM authentication failed, cannot start X server.\n"
- "\tPerhaps you do not have console ownership?\n");
- }
-
- retval = pam_acct_mgmt(pamh, 0);
- if (retval != PAM_SUCCESS) {
- pam_end(pamh, retval);
- FatalError("PAM authentication failed, cannot start X server.\n"
- "\tPerhaps you do not have console ownership?\n");
- }
-
- /* this is not a session, so do not do session management */
- pam_end(pamh, PAM_SUCCESS);
- }
-#endif
-}
diff --git a/os/xalloc.c b/os/xalloc.c
deleted file mode 100644
index 8bb46e2c9..000000000
--- a/os/xalloc.c
+++ /dev/null
@@ -1,812 +0,0 @@
-#define FATALERRORS 1
-/*
-Copyright (C) 1995 Pascal Haible. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-PASCAL HAIBLE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-Except as contained in this notice, the name of Pascal Haible shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from
-Pascal Haible.
-*/
-
-/* $XFree86: xc/programs/Xserver/os/xalloc.c,v 3.36 2003/11/03 05:12:00 tsi Exp $ */
-
-/* Only used if INTERNAL_MALLOC is defined
- * - otherwise xalloc() in utils.c is used
- */
-#ifdef INTERNAL_MALLOC
-
-#include <stdlib.h> /* for malloc() etc. */
-
-#include "Xos.h"
-#include "misc.h"
-#include "X.h"
-
-#ifdef XALLOC_LOG
-#include <stdio.h>
-#endif
-
-extern Bool Must_have_memory;
-
-/*
- ***** New malloc approach for the X server *****
- * Pascal Haible 1995
- *
- * Some statistics about memory allocation of the X server
- * The test session included several clients of different size, including
- * xv, emacs and xpaint with a new canvas of 3000x2000, zoom 5.
- * All clients were running together.
- * A protocolling version of Xalloc recorded 318917 allocating actions
- * (191573 Xalloc, 85942 XNFalloc, 41438 Xrealloc, 279727 Xfree).
- * Results grouped by size, excluding the next lower size
- * (i.e. size=32 means 16<size<=32):
- *
- * size nr of alloc max nr of blocks allocated together
- * 8 1114 287
- * 16 17341 4104
- * 32 147352 2068
- * 64 59053 2518
- * 128 46882 1230
- * 256 20544 1217
- * 512 6808 117
- * 1024 8254 171
- * 2048 4841 287
- * 4096 2429 84
- * 8192 3364 85
- * 16384 573 22
- * 32768 49 7
- * 65536 45 5
- * 131072 48 2
- * 262144 209 2
- * 524288 7 4
- * 1048576 2 1
- * 8388608 2 2
- *
- * The most used sizes:
- * count size
- * 24 136267
- * 40 37055
- * 72 17278
- * 56 13504
- * 80 9372
- * 16 8966
- * 32 8411
- * 136 8399
- * 104 7690
- * 12 7630
- * 120 5512
- * 88 4634
- * 152 3062
- * 52 2881
- * 48 2736
- * 156 1569
- * 168 1487
- * 160 1483
- * 28 1446
- * 1608 1379
- * 184 1305
- * 552 1270
- * 64 934
- * 320 891
- * 8 754
- *
- * Conclusions: more than the half of all allocations are <= 32 bytes.
- * But of these about 150,000 blocks, only a maximum of about 6,000 are
- * allocated together (including memory leaks..).
- * On the other side, only 935 of the 191573 or 0.5% were larger than 8kB
- * (362 or 0.2% larger than 16k).
- *
- * What makes the server really grow is the fragmentation of the heap,
- * and the fact that it can't shrink.
- * To cure this, we do the following:
- * - large blocks (>=11k) are mmapped on xalloc, and unmapped on xfree,
- * so we don't need any free lists etc.
- * As this needs 2 system calls, we only do this for the quite
- * infrequent large (>=11k) blocks.
- * - instead of reinventing the wheel, we use system malloc for medium
- * sized blocks (>256, <11k).
- * - for small blocks (<=256) we use an other approach:
- * As we need many small blocks, and most ones for a short time,
- * we don't go through the system malloc:
- * for each fixed sizes a seperate list of free blocks is kept.
- * to KISS (Keep it Small and Simple), we don't free them
- * (not freeing a block of 32 bytes won't be worse than having fragmented
- * a larger area on allocation).
- * This way, we (almost) allways have a fitting free block right at hand,
- * and don't have to walk any lists.
- */
-
-/*
- * structure layout of a allocated block
- * unsigned long size:
- * rounded up netto size for small and medium blocks
- * brutto size == mmap'ed area for large blocks
- * unsigned long DEBUG ? MAGIC : unused
- * .... data
- * ( unsigned long MAGIC2 ) only if SIZE_TAIL defined
- *
- */
-
-/* use otherwise unused long in the header to store a magic */
-/* shouldn't this be removed for production release ? */
-#define XALLOC_DEBUG
-
-#ifdef XALLOC_DEBUG
-/* Xfree fills the memory with a certain pattern (currently 0xF0) */
-/* this should really be removed for production release! */
-#define XFREE_ERASES
-#endif
-
-/* this must be a multiple of SIZE_STEPS below */
-#define MAX_SMALL 264 /* quite many blocks of 264 */
-
-#define MIN_LARGE (11*1024)
-/* worst case is 25% loss with a page size of 4k */
-
-/* SIZE_STEPS defines the granularity of size of small blocks -
- * this makes blocks align to that, too! */
-#define SIZE_STEPS (sizeof(double))
-#define SIZE_HEADER (2*sizeof(long)) /* = sizeof(double) for 32bit */
-#ifdef XALLOC_DEBUG
-#if defined(__sparc__)
-#define SIZE_TAIL (2*sizeof(long)) /* = sizeof(double) for 32bit */
-#else
-#define SIZE_TAIL (sizeof(long))
-#endif
-#endif
-
-#undef TAIL_SIZE
-#ifdef SIZE_TAIL
-#define TAIL_SIZE SIZE_TAIL
-#else
-#define TAIL_SIZE 0
-#endif
-
-#if defined (_LP64) || \
- defined(__alpha__) || defined(__alpha) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(__AMD64__) || defined(AMD64) || \
- (defined(sgi) && _MIPS_SZLONG == 64))
-#define MAGIC 0x1404196414071968
-#define MAGIC_FREE 0x1506196615061966
-#define MAGIC2 0x2515207525182079
-#else
-#define MAGIC 0x14071968
-#define MAGIC_FREE 0x15061966
-#define MAGIC2 0x25182079
-#endif
-
-/* To get some statistics about memory allocation */
-
-#ifdef XALLOC_LOG
-#define XALLOC_LOG_FILE "/tmp/Xalloc.log" /* unsecure... */
-#define LOG_BODY(_body) \
- { FILE *f; \
- f = fopen(XALLOC_LOG_FILE, "a"); \
- if (NULL!=f) { \
- _body; \
- fclose(f); \
- } \
- }
-#if defined(linux) && defined(i386)
-#define LOG_ALLOC(_fun, _size, _ret) \
- { unsigned long *from; \
- __asm__("movl %%ebp,%0" : /*OUT*/ "=r" (from) : /*IN*/ ); \
- LOG_BODY(fprintf(f, "%s\t%i\t%p\t[%lu]\n", _fun, _size, _ret, *(from+1))) \
- }
-#else
-#define LOG_ALLOC(_fun, _size, _ret) \
- LOG_BODY(fprintf(f, "%s\t%i\t%p\n", _fun, _size, _ret))
-#endif
-#define LOG_REALLOC(_fun, _ptr, _size, _ret) \
- LOG_BODY(fprintf(f, "%s\t%p\t%i\t%p\n", _fun, _ptr, _size, _ret))
-#define LOG_FREE(_fun, _ptr) \
- LOG_BODY(fprintf(f, "%s\t%p\n", _fun, _ptr))
-#else
-#define LOG_ALLOC(_fun, _size, _ret)
-#define LOG_REALLOC(_fun, _ptr, _size, _ret)
-#define LOG_FREE(_fun, _ptr)
-#endif /* XALLOC_LOG */
-
-static unsigned long *free_lists[MAX_SMALL/SIZE_STEPS];
-
-/*
- * systems that support it should define HAS_MMAP_ANON or MMAP_DEV_ZERO
- * and include the appropriate header files for
- * mmap(), munmap(), PROT_READ, PROT_WRITE, MAP_PRIVATE,
- * PAGE_SIZE or _SC_PAGESIZE (and MAP_ANON for HAS_MMAP_ANON).
- *
- * systems that don't support MAP_ANON fall through to the 2 fold behaviour
- */
-
-#if defined(linux)
-#define HAS_MMAP_ANON
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <asm/page.h> /* PAGE_SIZE */
-#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
-#define HAS_GETPAGESIZE
-#endif /* linux */
-
-#if defined(__GNU__)
-#define HAS_MMAP_ANON
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <mach/vm_param.h> /* PAGE_SIZE */
-#define HAS_SC_PAGESIZE
-#define HAS_GETPAGESIZE
-#endif /* __GNU__ */
-
-#if defined(CSRG_BASED)
-#define HAS_MMAP_ANON
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* CSRG_BASED */
-
-#if defined(DGUX)
-#define HAS_GETPAGESIZE
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* DGUX */
-
-#if defined(SVR4) && !defined(DGUX)
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* SVR4 && !DGUX */
-
-#if defined(sun) && !defined(SVR4) /* SunOS */
-#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* sun && !SVR4 */
-
-#ifdef XNO_SYSCONF
-#undef _SC_PAGESIZE
-#endif
-
-#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO)
-static int pagesize;
-#endif
-
-#ifdef MMAP_DEV_ZERO
-static int devzerofd = -1;
-#include <errno.h>
-#endif
-
-/*
- * empty trap function for gdb. Breakpoint here
- * to find who tries to free a free area
- */
-void XfreeTrap(void)
-{
-}
-
-void *
-Xalloc (unsigned long amount)
-{
- register unsigned long *ptr;
- int indx;
-
- /* sanity checks */
-
- /* zero size requested */
- if (amount == 0) {
- LOG_ALLOC("Xalloc=0", amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: Xalloc(<0)\n");
-#else
- ErrorF("Xalloc warning: Xalloc(<0) ignored..\n");
-#endif
- LOG_ALLOC("Xalloc<0", amount, 0);
- return NULL;
- }
-
- /* alignment check */
-#if defined(__alpha__) || defined(__alpha) || \
- defined(__sparc__) || \
- defined(__mips__) || \
- defined(__powerpc__) || \
- defined(__arm32__) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__s390x__) || defined(__s390__)
- amount = (amount + (sizeof(long)-1)) & ~(sizeof(long)-1);
-#endif
-
- if (amount <= MAX_SMALL) {
- /*
- * small block
- */
- /* pick a ready to use small chunk */
- indx = (amount-1) / SIZE_STEPS;
- ptr = free_lists[indx];
- if (NULL == ptr) {
- /* list empty - get 20 or 40 more */
- /* amount = size rounded up */
- amount = (indx+1) * SIZE_STEPS;
- ptr = (unsigned long *)calloc(1,(amount+SIZE_HEADER+TAIL_SIZE)
- * (amount<100 ? 40 : 20));
- if (NULL!=ptr) {
- int i;
- unsigned long *p1, *p2;
- p1 = 0;
- p2 = (unsigned long *)((char *)ptr + SIZE_HEADER);
- for (i=0; i<(amount<100 ? 40 : 20); i++) {
- p1 = p2;
- p1[-2] = amount;
-#ifdef XALLOC_DEBUG
- p1[-1] = MAGIC_FREE;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- *(unsigned long *)((unsigned char *)p1 + amount) = MAGIC2;
-#endif /* SIZE_TAIL */
- p2 = (unsigned long *)((char *)p1 + SIZE_HEADER + amount + TAIL_SIZE);
- *(unsigned long **)p1 = p2;
- }
- /* last one has no next one */
- *(unsigned long **)p1 = NULL;
- /* put the second in the list */
- free_lists[indx] = (unsigned long *)((char *)ptr + SIZE_HEADER + amount + TAIL_SIZE + SIZE_HEADER);
- /* take the fist one */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-S", amount, ptr);
- ptr[-1] = MAGIC;
- return (void *)ptr;
- } /* else fall through to 'Out of memory' */
- } else {
- /* take that piece of mem out of the list */
- free_lists[indx] = *((unsigned long **)ptr);
- /* already has size (and evtl. magic) filled in */
-#ifdef XALLOC_DEBUG
- ptr[-1] = MAGIC;
-#endif /* XALLOC_DEBUG */
- LOG_ALLOC("Xalloc-S", amount, ptr);
- return (void *)ptr;
- }
-
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- } else if (amount >= MIN_LARGE) {
- /*
- * large block
- */
- /* mmapped malloc */
- /* round up amount */
- amount += SIZE_HEADER + TAIL_SIZE;
- /* round up brutto amount to a multiple of the page size */
- amount = (amount + pagesize-1) & ~(pagesize-1);
-#ifdef MMAP_DEV_ZERO
- ptr = (unsigned long *)mmap((caddr_t)0,
- (size_t)amount,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE,
- devzerofd,
- (off_t)0);
-#else
- ptr = (unsigned long *)mmap((caddr_t)0,
- (size_t)amount,
- PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE,
- -1,
- (off_t)0);
-#endif
- if (-1!=(long)ptr) {
- ptr[0] = amount - SIZE_HEADER - TAIL_SIZE;
-#ifdef XALLOC_DEBUG
- ptr[1] = MAGIC;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- ((unsigned long *)((char *)ptr + amount - TAIL_SIZE))[0] = MAGIC2;
-#endif /* SIZE_TAIL */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-L", amount, ptr);
- return (void *)ptr;
- } /* else fall through to 'Out of memory' */
-#endif /* HAS_MMAP_ANON || MMAP_DEV_ZERO */
- } else {
- /*
- * medium sized block
- */
- /* 'normal' malloc() */
- ptr=(unsigned long *)calloc(1,amount+SIZE_HEADER+TAIL_SIZE);
- if (ptr != (unsigned long *)NULL) {
- ptr[0] = amount;
-#ifdef XALLOC_DEBUG
- ptr[1] = MAGIC;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- *(unsigned long *)((char *)ptr + amount + SIZE_HEADER) = MAGIC2;
-#endif /* SIZE_TAIL */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-M", amount, ptr);
- return (void *)ptr;
- }
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- LOG_ALLOC("Xalloc-oom", amount, 0);
- return NULL;
-}
-
-/*****************
- * XNFalloc
- * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory
- *****************/
-
-pointer
-XNFalloc (unsigned long amount)
-{
- register pointer ptr;
-
- /* zero size requested */
- if (amount == 0) {
- LOG_ALLOC("XNFalloc=0", amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: XNFalloc(<0)\n");
-#else
- ErrorF("Xalloc warning: XNFalloc(<0) ignored..\n");
-#endif
- LOG_ALLOC("XNFalloc<0", amount, 0);
- return (unsigned long *)NULL;
- }
- ptr = Xalloc(amount);
- if (!ptr)
- {
- FatalError("Out of memory");
- }
- return ptr;
-}
-
-/*****************
- * Xcalloc
- *****************/
-
-pointer
-Xcalloc (unsigned long amount)
-{
- pointer ret;
-
- ret = Xalloc (amount);
- if (ret != 0
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */
-#endif
- )
- bzero ((char *) ret, (int) amount);
- return ret;
-}
-
-/*****************
- * XNFcalloc
- *****************/
-void *
-XNFcalloc (unsigned long amount)
-{
- pointer ret;
-
- ret = XNFalloc (amount);
- if (ret != 0
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */
-#endif
- )
- bzero ((char *) ret, (int) amount);
- return ret;
-}
-
-/*****************
- * Xrealloc
- *****************/
-
-void *
-Xrealloc (pointer ptr, unsigned long amount)
-{
- register unsigned long *new_ptr;
-
- /* zero size requested */
- if (amount == 0) {
- if (ptr)
- Xfree(ptr);
- LOG_REALLOC("Xrealloc=0", ptr, amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: Xrealloc(<0)\n");
-#else
- ErrorF("Xalloc warning: Xrealloc(<0) ignored..\n");
-#endif
- if (ptr)
- Xfree(ptr); /* ?? */
- LOG_REALLOC("Xrealloc<0", ptr, amount, 0);
- return NULL;
- }
-
- new_ptr = Xalloc(amount);
- if ( (new_ptr) && (ptr) ) {
- unsigned long old_size;
- old_size = ((unsigned long *)ptr)[-2];
-#ifdef XALLOC_DEBUG
- if (MAGIC != ((unsigned long *)ptr)[-1]) {
- if (MAGIC_FREE == ((unsigned long *)ptr)[-1]) {
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: range already freed in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n");
- sleep(5);
- XfreeTrap();
-#endif
- LOG_REALLOC("Xalloc error: ranged already freed in Xrealloc() :-(",
- ptr, amount, 0);
- return NULL;
- }
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: header corrupt in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: header corrupt in Xrealloc() :-(\n");
- XfreeTrap();
-#endif
- LOG_REALLOC("Xalloc error: header corrupt in Xrealloc() :-(",
- ptr, amount, 0);
- return NULL;
- }
-#endif /* XALLOC_DEBUG */
- /* copy min(old size, new size) */
- memcpy((char *)new_ptr, (char *)ptr, (amount < old_size ? amount : old_size));
- }
- if (ptr)
- Xfree(ptr);
- if (new_ptr) {
- LOG_REALLOC("Xrealloc", ptr, amount, new_ptr);
- return (void *)new_ptr;
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- LOG_REALLOC("Xrealloc", ptr, amount, 0);
- return NULL;
-}
-
-/*****************
- * XNFrealloc
- * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory
- *****************/
-
-void *
-XNFrealloc (pointer ptr, unsigned long amount)
-{
- if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL)
- {
- FatalError( "Out of memory" );
- }
- return ptr;
-}
-
-/*****************
- * Xfree
- * calls free
- *****************/
-
-void
-Xfree(pointer ptr)
-{
- unsigned long size;
- unsigned long *pheader;
-
- /* free(NULL) IS valid :-( - and widely used throughout the server.. */
- if (!ptr)
- return;
-
- pheader = (unsigned long *)((char *)ptr - SIZE_HEADER);
-#ifdef XALLOC_DEBUG
- if (MAGIC != pheader[1]) {
- /* Diagnostic */
- if (MAGIC_FREE == pheader[1]) {
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: range already freed in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n");
- sleep(5);
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: ranged already freed in Xrealloc() :-(", ptr);
- return;
- }
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Header corrupt in Xfree() :-(\n");
-#else
- ErrorF("Xalloc error: Header corrupt in Xfree() :-(\n");
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Header corrupt in Xfree() :-(", ptr);
- return;
- }
-#endif /* XALLOC_DEBUG */
-
- size = pheader[0];
- if (size <= MAX_SMALL) {
- int indx;
- /*
- * small block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for small block", ptr);
- return;
- }
-#endif /* SIZE_TAIL */
-
-#ifdef XFREE_ERASES
- memset(ptr,0xF0,size);
-#endif /* XFREE_ERASES */
-#ifdef XALLOC_DEBUG
- pheader[1] = MAGIC_FREE;
-#endif
- /* put this small block at the head of the list */
- indx = (size-1) / SIZE_STEPS;
- *(unsigned long **)(ptr) = free_lists[indx];
- free_lists[indx] = (unsigned long *)ptr;
- LOG_FREE("Xfree", ptr);
- return;
-
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- } else if (size >= MIN_LARGE) {
- /*
- * large block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != ((unsigned long *)((char *)ptr + size))[0]) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]);
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]);
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for big block", ptr);
- return;
- }
- size += SIZE_TAIL;
-#endif /* SIZE_TAIL */
-
- LOG_FREE("Xfree", ptr);
- size += SIZE_HEADER;
- munmap((caddr_t)pheader, (size_t)size);
- /* no need to clear - mem is inaccessible after munmap.. */
-#endif /* HAS_MMAP_ANON */
-
- } else {
- /*
- * medium sized block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for medium block", ptr);
- return;
- }
-#endif /* SIZE_TAIL */
-
-#ifdef XFREE_ERASES
- memset(pheader,0xF0,size+SIZE_HEADER);
-#endif /* XFREE_ERASES */
-#ifdef XALLOC_DEBUG
- pheader[1] = MAGIC_FREE;
-#endif
-
- LOG_FREE("Xfree", ptr);
- free((char *)pheader);
- }
-}
-
-void
-OsInitAllocator (void)
-{
- static Bool beenhere = FALSE;
-
- if (beenhere)
- return;
- beenhere = TRUE;
-
-#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO)
- pagesize = -1;
-#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
- pagesize = sysconf(_SC_PAGESIZE);
-#endif
-#ifdef _SC_PAGE_SIZE
- if (pagesize == -1)
- pagesize = sysconf(_SC_PAGE_SIZE);
-#endif
-#ifdef HAS_GETPAGESIZE
- if (pagesize == -1)
- pagesize = getpagesize();
-#endif
-#ifdef PAGE_SIZE
- if (pagesize == -1)
- pagesize = PAGE_SIZE;
-#endif
- if (pagesize == -1)
- FatalError("OsInitAllocator: Cannot determine page size\n");
-#endif
-
- /* set up linked lists of free blocks */
- bzero ((char *) free_lists, MAX_SMALL/SIZE_STEPS*sizeof(unsigned long *));
-
-#ifdef MMAP_DEV_ZERO
- /* open /dev/zero on systems that have mmap, but not MAP_ANON */
- if (devzerofd < 0) {
- if ((devzerofd = open("/dev/zero", O_RDWR, 0)) < 0)
- FatalError("OsInitAllocator: Cannot open /dev/zero (errno=%d)\n",
- errno);
- }
-#endif
-
-#ifdef XALLOC_LOG
- /* reset the log file to zero length */
- {
- FILE *f;
- f = fopen(XALLOC_LOG_FILE, "w");
- if (NULL!=f)
- fclose(f);
- }
-#endif
-}
-
-#else /* !INTERNAL_MALLOC */
-/* This is to avoid an empty .o */
-static int no_internal_xalloc;
-#endif /* INTERNAL_MALLOC */
diff --git a/os/xdmauth.c b/os/xdmauth.c
deleted file mode 100644
index 13695c13c..000000000
--- a/os/xdmauth.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/* $Xorg: xdmauth.c,v 1.4 2001/02/09 02:05:24 xorgcvs Exp $ */
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/os/xdmauth.c,v 1.9 2003/06/24 15:44:48 eich Exp $ */
-
-/*
- * XDM-AUTHENTICATION-1 (XDMCP authentication) and
- * XDM-AUTHORIZATION-1 (client authorization) protocols
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-#include <stdio.h>
-#include "X.h"
-#include "Xtrans.h"
-#include "os.h"
-#include "osdep.h"
-#include "dixstruct.h"
-
-#ifdef HASXDMAUTH
-
-static Bool authFromXDMCP;
-
-#ifdef XDMCP
-#include "Xmd.h"
-#undef REQUEST
-#include "Xdmcp.h"
-
-/* XDM-AUTHENTICATION-1 */
-
-static XdmAuthKeyRec privateKey;
-static char XdmAuthenticationName[] = "XDM-AUTHENTICATION-1";
-#define XdmAuthenticationNameLen (sizeof XdmAuthenticationName - 1)
-static XdmAuthKeyRec rho;
-
-static Bool
-XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData,
- xdmOpCode packet_type)
-{
- XdmAuthKeyPtr incoming;
-
- XdmcpUnwrap (incomingData->data, &privateKey,
- incomingData->data,incomingData->length);
- switch (packet_type)
- {
- case ACCEPT:
- if (incomingData->length != 8)
- return FALSE;
- incoming = (XdmAuthKeyPtr) incomingData->data;
- XdmcpDecrementKey (incoming);
- return XdmcpCompareKeys (incoming, &rho);
- }
- return FALSE;
-}
-
-static Bool
-XdmAuthenticationGenerator (ARRAY8Ptr privateData, ARRAY8Ptr outgoingData,
- xdmOpCode packet_type)
-{
- outgoingData->length = 0;
- outgoingData->data = 0;
- switch (packet_type)
- {
- case REQUEST:
- if (XdmcpAllocARRAY8 (outgoingData, 8))
- XdmcpWrap (&rho, &privateKey, outgoingData->data, 8);
- }
- return TRUE;
-}
-
-static Bool
-XdmAuthenticationAddAuth (int name_len, char *name,
- int data_len, char *data)
-{
- Bool ret;
- XdmcpUnwrap (data, (unsigned char *)&privateKey, data, data_len);
- authFromXDMCP = TRUE;
- ret = AddAuthorization (name_len, name, data_len, data);
- authFromXDMCP = FALSE;
- return ret;
-}
-
-
-#define atox(c) ('0' <= c && c <= '9' ? c - '0' : \
- 'a' <= c && c <= 'f' ? c - 'a' + 10 : \
- 'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
-
-static int
-HexToBinary (char *in, char *out, int len)
-{
- int top, bottom;
-
- while (len > 0)
- {
- top = atox(in[0]);
- if (top == -1)
- return 0;
- bottom = atox(in[1]);
- if (bottom == -1)
- return 0;
- *out++ = (top << 4) | bottom;
- in += 2;
- len -= 2;
- }
- if (len)
- return 0;
- *out++ = '\0';
- return 1;
-}
-
-void
-XdmAuthenticationInit (char *cookie, int cookie_len)
-{
- bzero (privateKey.data, 8);
- if (!strncmp (cookie, "0x", 2) || !strncmp (cookie, "0X", 2))
- {
- if (cookie_len > 2 + 2 * 8)
- cookie_len = 2 + 2 * 8;
- HexToBinary (cookie + 2, (char *)privateKey.data, cookie_len - 2);
- }
- else
- {
- if (cookie_len > 7)
- cookie_len = 7;
- memmove (privateKey.data + 1, cookie, cookie_len);
- }
- XdmcpGenerateKey (&rho);
- XdmcpRegisterAuthentication (XdmAuthenticationName, XdmAuthenticationNameLen,
- (unsigned char *)&rho,
- sizeof (rho),
- XdmAuthenticationValidator,
- XdmAuthenticationGenerator,
- XdmAuthenticationAddAuth);
-}
-
-#endif /* XDMCP */
-
-/* XDM-AUTHORIZATION-1 */
-typedef struct _XdmAuthorization {
- struct _XdmAuthorization *next;
- XdmAuthKeyRec rho;
- XdmAuthKeyRec key;
- XID id;
-} XdmAuthorizationRec, *XdmAuthorizationPtr;
-
-static XdmAuthorizationPtr xdmAuth;
-
-typedef struct _XdmClientAuth {
- struct _XdmClientAuth *next;
- XdmAuthKeyRec rho;
- char client[6];
- long time;
-} XdmClientAuthRec, *XdmClientAuthPtr;
-
-static XdmClientAuthPtr xdmClients;
-static long clockOffset;
-static Bool gotClock;
-
-#define TwentyMinutes (20 * 60)
-#define TwentyFiveMinutes (25 * 60)
-
-static Bool
-XdmClientAuthCompare (XdmClientAuthPtr a, XdmClientAuthPtr b)
-{
- int i;
-
- if (!XdmcpCompareKeys (&a->rho, &b->rho))
- return FALSE;
- for (i = 0; i < 6; i++)
- if (a->client[i] != b->client[i])
- return FALSE;
- return a->time == b->time;
-}
-
-static void
-XdmClientAuthDecode (unsigned char *plain, XdmClientAuthPtr auth)
-{
- int i, j;
-
- j = 0;
- for (i = 0; i < 8; i++)
- {
- auth->rho.data[i] = plain[j];
- ++j;
- }
- for (i = 0; i < 6; i++)
- {
- auth->client[i] = plain[j];
- ++j;
- }
- auth->time = 0;
- for (i = 0; i < 4; i++)
- {
- auth->time |= plain[j] << ((3 - i) << 3);
- j++;
- }
-}
-
-static void
-XdmClientAuthTimeout (long now)
-{
- XdmClientAuthPtr client, next, prev;
-
- prev = 0;
- for (client = xdmClients; client; client=next)
- {
- next = client->next;
- if (abs (now - client->time) > TwentyFiveMinutes)
- {
- if (prev)
- prev->next = next;
- else
- xdmClients = next;
- xfree (client);
- }
- else
- prev = client;
- }
-}
-
-static XdmClientAuthPtr
-XdmAuthorizationValidate (unsigned char *plain, int length,
- XdmAuthKeyPtr rho, ClientPtr xclient, char **reason)
-{
- XdmClientAuthPtr client, existing;
- long now;
- int i;
-
- if (length != (192 / 8)) {
- if (reason)
- *reason = "Bad XDM authorization key length";
- return NULL;
- }
- client = (XdmClientAuthPtr) xalloc (sizeof (XdmClientAuthRec));
- if (!client)
- return NULL;
- XdmClientAuthDecode (plain, client);
- if (!XdmcpCompareKeys (&client->rho, rho))
- {
- xfree (client);
- if (reason)
- *reason = "Invalid XDM-AUTHORIZATION-1 key (failed key comparison)";
- return NULL;
- }
- for (i = 18; i < 24; i++)
- if (plain[i] != 0) {
- xfree (client);
- if (reason)
- *reason = "Invalid XDM-AUTHORIZATION-1 key (failed NULL check)";
- return NULL;
- }
- if (xclient) {
- int family, addr_len;
- Xtransaddr *addr;
-
- if (_XSERVTransGetPeerAddr(((OsCommPtr)xclient->osPrivate)->trans_conn,
- &family, &addr_len, &addr) == 0
- && _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) {
-#if defined(TCPCONN) || defined(STREAMSCONN)
- if (family == FamilyInternet &&
- memcmp((char *)addr, client->client, 4) != 0) {
- xfree (client);
- xfree (addr);
- if (reason)
- *reason = "Invalid XDM-AUTHORIZATION-1 key (failed address comparison)";
- return NULL;
-
- }
-#endif
- xfree (addr);
- }
- }
- now = time(0);
- if (!gotClock)
- {
- clockOffset = client->time - now;
- gotClock = TRUE;
- }
- now += clockOffset;
- XdmClientAuthTimeout (now);
- if (abs (client->time - now) > TwentyMinutes)
- {
- xfree (client);
- if (reason)
- *reason = "Excessive XDM-AUTHORIZATION-1 time offset";
- return NULL;
- }
- for (existing = xdmClients; existing; existing=existing->next)
- {
- if (XdmClientAuthCompare (existing, client))
- {
- xfree (client);
- if (reason)
- *reason = "XDM authorization key matches an existing client!";
- return NULL;
- }
- }
- return client;
-}
-
-int
-XdmAddCookie (unsigned short data_length, char *data, XID id)
-{
- XdmAuthorizationPtr new;
- unsigned char *rho_bits, *key_bits;
-
- switch (data_length)
- {
- case 16: /* auth from files is 16 bytes long */
-#ifdef XDMCP
- if (authFromXDMCP)
- {
- /* R5 xdm sent bogus authorization data in the accept packet,
- * but we can recover */
- rho_bits = rho.data;
- key_bits = (unsigned char *) data;
- key_bits[0] = '\0';
- }
- else
-#endif
- {
- rho_bits = (unsigned char *) data;
- key_bits = (unsigned char *) (data + 8);
- }
- break;
-#ifdef XDMCP
- case 8: /* auth from XDMCP is 8 bytes long */
- rho_bits = rho.data;
- key_bits = (unsigned char *) data;
- break;
-#endif
- default:
- return 0;
- }
- /* the first octet of the key must be zero */
- if (key_bits[0] != '\0')
- return 0;
- new = (XdmAuthorizationPtr) xalloc (sizeof (XdmAuthorizationRec));
- if (!new)
- return 0;
- new->next = xdmAuth;
- xdmAuth = new;
- memmove (new->key.data, key_bits, (int) 8);
- memmove (new->rho.data, rho_bits, (int) 8);
- new->id = id;
- return 1;
-}
-
-XID
-XdmCheckCookie (unsigned short cookie_length, char *cookie,
- ClientPtr xclient, char **reason)
-{
- XdmAuthorizationPtr auth;
- XdmClientAuthPtr client;
- unsigned char *plain;
-
- /* Auth packets must be a multiple of 8 bytes long */
- if (cookie_length & 7)
- return (XID) -1;
- plain = (unsigned char *) xalloc (cookie_length);
- if (!plain)
- return (XID) -1;
- for (auth = xdmAuth; auth; auth=auth->next) {
- XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length);
- if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, xclient, reason)) != NULL)
- {
- client->next = xdmClients;
- xdmClients = client;
- xfree (plain);
- return auth->id;
- }
- }
- xfree (plain);
- return (XID) -1;
-}
-
-int
-XdmResetCookie (void)
-{
- XdmAuthorizationPtr auth, next_auth;
- XdmClientAuthPtr client, next_client;
-
- for (auth = xdmAuth; auth; auth=next_auth)
- {
- next_auth = auth->next;
- xfree (auth);
- }
- xdmAuth = 0;
- for (client = xdmClients; client; client=next_client)
- {
- next_client = client->next;
- xfree (client);
- }
- xdmClients = (XdmClientAuthPtr) 0;
- return 1;
-}
-
-XID
-XdmToID (unsigned short cookie_length, char *cookie)
-{
- XdmAuthorizationPtr auth;
- XdmClientAuthPtr client;
- unsigned char *plain;
-
- plain = (unsigned char *) xalloc (cookie_length);
- if (!plain)
- return (XID) -1;
- for (auth = xdmAuth; auth; auth=auth->next) {
- XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length);
- if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, NULL, NULL)) != NULL)
- {
- xfree (client);
- xfree (cookie);
- return auth->id;
- }
- }
- xfree (cookie);
- return (XID) -1;
-}
-
-int
-XdmFromID (XID id, unsigned short *data_lenp, char **datap)
-{
- XdmAuthorizationPtr auth;
-
- for (auth = xdmAuth; auth; auth=auth->next) {
- if (id == auth->id) {
- *data_lenp = 16;
- *datap = (char *) &auth->rho;
- return 1;
- }
- }
- return 0;
-}
-
-int
-XdmRemoveCookie (unsigned short data_length, char *data)
-{
- XdmAuthorizationPtr auth, prev;
- XdmAuthKeyPtr key_bits, rho_bits;
-
- prev = 0;
- switch (data_length)
- {
- case 16:
- rho_bits = (XdmAuthKeyPtr) data;
- key_bits = (XdmAuthKeyPtr) (data + 8);
- break;
-#ifdef XDMCP
- case 8:
- rho_bits = &rho;
- key_bits = (XdmAuthKeyPtr) data;
- break;
-#endif
- default:
- return 0;
- }
- for (auth = xdmAuth; auth; auth=auth->next) {
- if (XdmcpCompareKeys (rho_bits, &auth->rho) &&
- XdmcpCompareKeys (key_bits, &auth->key))
- {
- if (prev)
- prev->next = auth->next;
- else
- xdmAuth = auth->next;
- xfree (auth);
- return 1;
- }
- }
- return 0;
-}
-
-#endif
diff --git a/os/xdmcp.c b/os/xdmcp.c
deleted file mode 100644
index 43af268e4..000000000
--- a/os/xdmcp.c
+++ /dev/null
@@ -1,1679 +0,0 @@
-/* $Xorg: xdmcp.c,v 1.4 2001/01/31 13:37:19 pookie Exp $ */
-/*
- * Copyright 1989 Network Computing Devices, Inc., Mountain View, California.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of N.C.D. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. N.C.D. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- */
-/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.28 2003/11/11 00:27:14 dawes Exp $ */
-
-#ifdef WIN32
-/* avoid conflicting definitions */
-#define BOOL wBOOL
-#define ATOM wATOM
-#define FreeResource wFreeResource
-#include <winsock.h>
-#undef BOOL
-#undef ATOM
-#undef FreeResource
-#undef CreateWindowA
-#undef RT_FONT
-#undef RT_CURSOR
-#endif
-
-#include "Xos.h"
-
-#if !defined(WIN32)
-#ifndef Lynx
-#include <sys/param.h>
-#include <sys/socket.h>
-#else
-#include <socket.h>
-#endif
-#include <netinet/in.h>
-#include <netdb.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "X.h"
-#include "Xmd.h"
-#include "misc.h"
-#include "Xpoll.h"
-#include "osdep.h"
-#include "input.h"
-#include "dixstruct.h"
-#include "opaque.h"
-
-#if defined(DGUX)
-#include <net/net_ioctl.h>
-#include <sys/ioctl.h>
-#endif
-
-#ifdef STREAMSCONN
-#include <tiuser.h>
-#include <netconfig.h>
-#include <netdir.h>
-#endif
-
-#ifdef XDMCP
-#undef REQUEST
-
-#ifdef XDMCP_NO_IPV6
-#undef IPv6
-#endif
-
-#include <X11/Xdmcp.h>
-
-#define X_INCLUDE_NETDB_H
-#include <X11/Xos_r.h>
-
-extern char *defaultDisplayClass;
-
-static int xdmcpSocket, sessionSocket;
-static xdmcp_states state;
-#if defined(IPv6) && defined(AF_INET6)
-static int xdmcpSocket6;
-static struct sockaddr_storage req_sockaddr;
-#else
-static struct sockaddr_in req_sockaddr;
-#endif
-static int req_socklen;
-static CARD32 SessionID;
-static CARD32 timeOutTime;
-static int timeOutRtx;
-static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY;
-static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY;
-static CARD16 DisplayNumber;
-static xdmcp_states XDM_INIT_STATE = XDM_OFF;
-#ifdef HASXDMAUTH
-static char *xdmAuthCookie;
-#endif
-
-static XdmcpBuffer buffer;
-
-#if defined(IPv6) && defined(AF_INET6)
-
-static struct addrinfo *mgrAddr;
-static struct addrinfo *mgrAddrFirst;
-
-#define SOCKADDR_TYPE struct sockaddr_storage
-#define SOCKADDR_FAMILY(s) ((struct sockaddr *)&(s))->sa_family
-
-#ifdef BSD44SOCKETS
-#define SOCKLEN_FIELD(s) ((struct sockaddr *)&(s))->sa_len
-#define SOCKLEN_TYPE unsigned char
-#else
-#define SOCKLEN_TYPE unsigned int
-#endif
-
-#else
-
-#define SOCKADDR_TYPE struct sockaddr_in
-#define SOCKADDR_FAMILY(s) (s).sin_family
-
-#ifdef BSD44SOCKETS
-#define SOCKLEN_FIELD(s) (s).sin_len
-#define SOCKLEN_TYPE unsigned char
-#else
-#define SOCKLEN_TYPE size_t
-#endif
-
-#endif
-
-static SOCKADDR_TYPE ManagerAddress;
-static SOCKADDR_TYPE FromAddress;
-
-#ifdef SOCKLEN_FIELD
-#define ManagerAddressLen SOCKLEN_FIELD(ManagerAddress)
-#define FromAddressLen SOCKLEN_FIELD(FromAddress)
-#else
-static SOCKLEN_TYPE ManagerAddressLen, FromAddressLen;
-#endif
-
-#if defined(IPv6) && defined(AF_INET6)
-static struct multicastinfo {
- struct multicastinfo *next;
- struct addrinfo *ai;
- int hops;
-} *mcastlist;
-#endif
-
-static void XdmcpAddHost(
- struct sockaddr *from,
- int fromlen,
- ARRAY8Ptr AuthenticationName,
- ARRAY8Ptr hostname,
- ARRAY8Ptr status);
-
-static void XdmcpSelectHost(
- struct sockaddr *host_sockaddr,
- int host_len,
- ARRAY8Ptr AuthenticationName);
-
-static void get_xdmcp_sock(void);
-
-static void send_query_msg(void);
-
-static void recv_willing_msg(
- struct sockaddr */*from*/,
- int /*fromlen*/,
- unsigned /*length*/);
-
-static void send_request_msg(void);
-
-static void recv_accept_msg(unsigned /*length*/);
-
-static void recv_decline_msg(unsigned /*length*/);
-
-static void send_manage_msg(void);
-
-static void recv_refuse_msg(unsigned /*length*/);
-
-static void recv_failed_msg(unsigned /*length*/);
-
-static void send_keepalive_msg(void);
-
-static void recv_alive_msg(unsigned /*length*/);
-
-static void XdmcpFatal(
- char */*type*/,
- ARRAY8Ptr /*status*/);
-
-static void XdmcpWarning(char */*str*/);
-
-static void get_manager_by_name(
- int /*argc*/,
- char **/*argv*/,
- int /*i*/);
-
-static void get_fromaddr_by_name(int /*argc*/, char **/*argv*/, int /*i*/);
-
-#if defined(IPv6) && defined(AF_INET6)
-static int get_mcast_options(int /*argc*/, char **/*argv*/, int /*i*/);
-#endif
-
-static void receive_packet(int /*socketfd*/);
-
-static void send_packet(void);
-
-extern void XdmcpDeadSession(char */*reason*/);
-
-static void timeout(void);
-
-static void restart(void);
-
-static void XdmcpBlockHandler(
- pointer /*data*/,
- struct timeval **/*wt*/,
- pointer /*LastSelectMask*/);
-
-static void XdmcpWakeupHandler(
- pointer /*data*/,
- int /*i*/,
- pointer /*LastSelectMask*/);
-
-void XdmcpRegisterManufacturerDisplayID(
- char * /*name*/,
- int /*length*/);
-
-
-static unsigned short xdm_udp_port = XDM_UDP_PORT;
-static Bool OneSession = FALSE;
-static const char *xdm_from = NULL;
-
-void
-XdmcpUseMsg (void)
-{
- ErrorF("-query host-name contact named host for XDMCP\n");
- ErrorF("-broadcast broadcast for XDMCP\n");
-#if defined(IPv6) && defined(AF_INET6)
- ErrorF("-multicast [addr [hops]] IPv6 multicast for XDMCP\n");
-#endif
- ErrorF("-indirect host-name contact named host for indirect XDMCP\n");
- ErrorF("-port port-num UDP port number to send messages to\n");
- ErrorF("-from local-address specify the local address to connect from\n");
- ErrorF("-once Terminate server after one session\n");
- ErrorF("-class display-class specify display class to send in manage\n");
-#ifdef HASXDMAUTH
- ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n");
-#endif
- ErrorF("-displayID display-id manufacturer display ID for request\n");
-}
-
-int
-XdmcpOptions(int argc, char **argv, int i)
-{
- if (strcmp(argv[i], "-query") == 0) {
- get_manager_by_name(argc, argv, i++);
- XDM_INIT_STATE = XDM_QUERY;
- AccessUsingXdmcp ();
- return (i + 1);
- }
- if (strcmp(argv[i], "-broadcast") == 0) {
- XDM_INIT_STATE = XDM_BROADCAST;
- AccessUsingXdmcp ();
- return (i + 1);
- }
-#if defined(IPv6) && defined(AF_INET6)
- if (strcmp(argv[i], "-multicast") == 0) {
- i = get_mcast_options(argc, argv, ++i);
- XDM_INIT_STATE = XDM_MULTICAST;
- AccessUsingXdmcp ();
- return (i + 1);
- }
-#endif
- if (strcmp(argv[i], "-indirect") == 0) {
- get_manager_by_name(argc, argv, i++);
- XDM_INIT_STATE = XDM_INDIRECT;
- AccessUsingXdmcp ();
- return (i + 1);
- }
- if (strcmp(argv[i], "-port") == 0) {
- if (++i == argc) {
- ErrorF("Xserver: missing port number in command line\n");
- exit(1);
- }
- xdm_udp_port = (unsigned short) atoi(argv[i]);
- return (i + 1);
- }
- if (strcmp(argv[i], "-from") == 0) {
- get_fromaddr_by_name(argc, argv, ++i);
- return (i + 1);
- }
- if (strcmp(argv[i], "-once") == 0) {
- OneSession = TRUE;
- return (i + 1);
- }
- if (strcmp(argv[i], "-class") == 0) {
- if (++i == argc) {
- ErrorF("Xserver: missing class name in command line\n");
- exit(1);
- }
- defaultDisplayClass = argv[i];
- return (i + 1);
- }
-#ifdef HASXDMAUTH
- if (strcmp(argv[i], "-cookie") == 0) {
- if (++i == argc) {
- ErrorF("Xserver: missing cookie data in command line\n");
- exit(1);
- }
- xdmAuthCookie = argv[i];
- return (i + 1);
- }
-#endif
- if (strcmp(argv[i], "-displayID") == 0) {
- if (++i == argc) {
- ErrorF("Xserver: missing displayID in command line\n");
- exit(1);
- }
- XdmcpRegisterManufacturerDisplayID (argv[i], strlen (argv[i]));
- return (i + 1);
- }
- return (i);
-}
-
-/*
- * This section is a collection of routines for
- * registering server-specific data with the XDMCP
- * state machine.
- */
-
-
-/*
- * Save all broadcast addresses away so BroadcastQuery
- * packets get sent everywhere
- */
-
-#define MAX_BROADCAST 10
-
-/* This stays sockaddr_in since IPv6 doesn't support broadcast */
-static struct sockaddr_in BroadcastAddresses[MAX_BROADCAST];
-static int NumBroadcastAddresses;
-
-void
-XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr)
-{
- struct sockaddr_in *bcast;
- if (NumBroadcastAddresses >= MAX_BROADCAST)
- return;
- bcast = &BroadcastAddresses[NumBroadcastAddresses++];
- bzero (bcast, sizeof (struct sockaddr_in));
-#ifdef BSD44SOCKETS
- bcast->sin_len = addr->sin_len;
-#endif
- bcast->sin_family = addr->sin_family;
- bcast->sin_port = htons (xdm_udp_port);
- bcast->sin_addr = addr->sin_addr;
-}
-
-/*
- * Each authentication type is registered here; Validator
- * will be called to check all access attempts using
- * the specified authentication type
- */
-
-static ARRAYofARRAY8 AuthenticationNames, AuthenticationDatas;
-typedef struct _AuthenticationFuncs {
- ValidatorFunc Validator;
- GeneratorFunc Generator;
- AddAuthorFunc AddAuth;
-} AuthenticationFuncsRec, *AuthenticationFuncsPtr;
-
-static AuthenticationFuncsPtr AuthenticationFuncsList;
-
-void
-XdmcpRegisterAuthentication (
- char *name,
- int namelen,
- char *data,
- int datalen,
- ValidatorFunc Validator,
- GeneratorFunc Generator,
- AddAuthorFunc AddAuth)
-{
- int i;
- ARRAY8 AuthenticationName, AuthenticationData;
- static AuthenticationFuncsPtr newFuncs;
-
- if (!XdmcpAllocARRAY8 (&AuthenticationName, namelen))
- return;
- if (!XdmcpAllocARRAY8 (&AuthenticationData, datalen))
- {
- XdmcpDisposeARRAY8 (&AuthenticationName);
- return;
- }
- for (i = 0; i < namelen; i++)
- AuthenticationName.data[i] = name[i];
- for (i = 0; i < datalen; i++)
- AuthenticationData.data[i] = data[i];
- if (!(XdmcpReallocARRAYofARRAY8 (&AuthenticationNames,
- AuthenticationNames.length + 1) &&
- XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas,
- AuthenticationDatas.length + 1) &&
- (newFuncs = (AuthenticationFuncsPtr) xalloc (
- (AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec)))))
- {
- XdmcpDisposeARRAY8 (&AuthenticationName);
- XdmcpDisposeARRAY8 (&AuthenticationData);
- return;
- }
- for (i = 0; i < AuthenticationNames.length - 1; i++)
- newFuncs[i] = AuthenticationFuncsList[i];
- newFuncs[AuthenticationNames.length-1].Validator = Validator;
- newFuncs[AuthenticationNames.length-1].Generator = Generator;
- newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth;
- xfree (AuthenticationFuncsList);
- AuthenticationFuncsList = newFuncs;
- AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName;
- AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData;
-}
-
-/*
- * Select the authentication type to be used; this is
- * set by the manager of the host to be connected to.
- */
-
-ARRAY8 noAuthenticationName = {(CARD16) 0, (CARD8Ptr) 0};
-ARRAY8 noAuthenticationData = {(CARD16) 0, (CARD8Ptr) 0};
-ARRAY8Ptr AuthenticationName = &noAuthenticationName;
-ARRAY8Ptr AuthenticationData = &noAuthenticationData;
-AuthenticationFuncsPtr AuthenticationFuncs;
-
-void
-XdmcpSetAuthentication (ARRAY8Ptr name)
-{
- int i;
-
- for (i = 0; i < AuthenticationNames.length; i++)
- if (XdmcpARRAY8Equal (&AuthenticationNames.data[i], name))
- {
- AuthenticationName = &AuthenticationNames.data[i];
- AuthenticationData = &AuthenticationDatas.data[i];
- AuthenticationFuncs = &AuthenticationFuncsList[i];
- break;
- }
-}
-
-/*
- * Register the host address for the display
- */
-
-static ARRAY16 ConnectionTypes;
-static ARRAYofARRAY8 ConnectionAddresses;
-static long xdmcpGeneration;
-
-void
-XdmcpRegisterConnection (
- int type,
- char *address,
- int addrlen)
-{
- int i;
- CARD8 *newAddress;
-
- if (xdmcpGeneration != serverGeneration)
- {
- XdmcpDisposeARRAY16 (&ConnectionTypes);
- XdmcpDisposeARRAYofARRAY8 (&ConnectionAddresses);
- xdmcpGeneration = serverGeneration;
- }
- if (xdm_from != NULL) { /* Only register the requested address */
- const void *regAddr = address;
- const void *fromAddr = NULL;
- int regAddrlen = addrlen;
-
- if (addrlen == sizeof(struct in_addr)) {
- if (SOCKADDR_FAMILY(FromAddress) == AF_INET) {
- fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr;
- }
-#if defined(IPv6) && defined(AF_INET6)
- else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET6) &&
- IN6_IS_ADDR_V4MAPPED(
- &((struct sockaddr_in6 *)&FromAddress)->sin6_addr)) {
- fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr.s6_addr[12];
- }
-#endif
- }
-#if defined(IPv6) && defined(AF_INET6)
- else if (addrlen == sizeof(struct in6_addr)) {
- if (SOCKADDR_FAMILY(FromAddress) == AF_INET6) {
- fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr;
- } else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET) &&
- IN6_IS_ADDR_V4MAPPED((struct in6_addr *) address)) {
- fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr;
- regAddr = &((struct sockaddr_in6 *)&address)->sin6_addr.s6_addr[12];
- regAddrlen = sizeof(struct in_addr);
- }
- }
-#endif
- if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) {
- return;
- }
- }
- newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8));
- if (!newAddress)
- return;
- if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1))
- {
- xfree (newAddress);
- return;
- }
- if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses,
- ConnectionAddresses.length + 1))
- {
- xfree (newAddress);
- return;
- }
- ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type;
- for (i = 0; i < addrlen; i++)
- newAddress[i] = address[i];
- ConnectionAddresses.data[ConnectionAddresses.length-1].data = newAddress;
- ConnectionAddresses.data[ConnectionAddresses.length-1].length = addrlen;
-}
-
-/*
- * Register an Authorization Name. XDMCP advertises this list
- * to the manager.
- */
-
-static ARRAYofARRAY8 AuthorizationNames;
-
-void
-XdmcpRegisterAuthorizations (void)
-{
- XdmcpDisposeARRAYofARRAY8 (&AuthorizationNames);
- RegisterAuthorizations ();
-}
-
-void
-XdmcpRegisterAuthorization (char *name, int namelen)
-{
- ARRAY8 authName;
- int i;
-
- authName.data = (CARD8 *) xalloc (namelen * sizeof (CARD8));
- if (!authName.data)
- return;
- if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1))
- {
- xfree (authName.data);
- return;
- }
- for (i = 0; i < namelen; i++)
- authName.data[i] = (CARD8) name[i];
- authName.length = namelen;
- AuthorizationNames.data[AuthorizationNames.length-1] = authName;
-}
-
-/*
- * Register the DisplayClass string
- */
-
-ARRAY8 DisplayClass;
-
-void
-XdmcpRegisterDisplayClass (char *name, int length)
-{
- int i;
-
- XdmcpDisposeARRAY8 (&DisplayClass);
- if (!XdmcpAllocARRAY8 (&DisplayClass, length))
- return;
- for (i = 0; i < length; i++)
- DisplayClass.data[i] = (CARD8) name[i];
-}
-
-/*
- * Register the Manufacturer display ID
- */
-
-ARRAY8 ManufacturerDisplayID;
-
-void
-XdmcpRegisterManufacturerDisplayID (char *name, int length)
-{
- int i;
-
- XdmcpDisposeARRAY8 (&ManufacturerDisplayID);
- if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length))
- return;
- for (i = 0; i < length; i++)
- ManufacturerDisplayID.data[i] = (CARD8) name[i];
-}
-
-/*
- * initialize XDMCP; create the socket, compute the display
- * number, set up the state machine
- */
-
-void
-XdmcpInit(void)
-{
- state = XDM_INIT_STATE;
-#ifdef HASXDMAUTH
- if (xdmAuthCookie)
- XdmAuthenticationInit (xdmAuthCookie, strlen (xdmAuthCookie));
-#endif
- if (state != XDM_OFF)
- {
- XdmcpRegisterAuthorizations();
- XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass));
- AccessUsingXdmcp();
- RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler,
- (pointer) 0);
- timeOutRtx = 0;
- DisplayNumber = (CARD16) atoi(display);
- get_xdmcp_sock();
- send_packet();
- }
-}
-
-void
-XdmcpReset (void)
-{
- state = XDM_INIT_STATE;
- if (state != XDM_OFF)
- {
- RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler,
- (pointer) 0);
- timeOutRtx = 0;
- send_packet();
- }
-}
-
-/*
- * Called whenever a new connection is created; notices the
- * first connection and saves it to terminate the session
- * when it is closed
- */
-
-void
-XdmcpOpenDisplay(int sock)
-{
- if (state != XDM_AWAIT_MANAGE_RESPONSE)
- return;
- state = XDM_RUN_SESSION;
- sessionSocket = sock;
-}
-
-void
-XdmcpCloseDisplay(int sock)
-{
- if ((state != XDM_RUN_SESSION && state != XDM_AWAIT_ALIVE_RESPONSE)
- || sessionSocket != sock)
- return;
- state = XDM_INIT_STATE;
- if (OneSession)
- dispatchException |= DE_TERMINATE;
- else
- dispatchException |= DE_RESET;
- isItTimeToYield = TRUE;
-}
-
-/*
- * called before going to sleep, this routine
- * may modify the timeout value about to be sent
- * to select; in this way XDMCP can do appropriate things
- * dynamically while starting up
- */
-
-/*ARGSUSED*/
-static void
-XdmcpBlockHandler(
- pointer data, /* unused */
- struct timeval **wt,
- pointer pReadmask)
-{
- fd_set *LastSelectMask = (fd_set*)pReadmask;
- CARD32 millisToGo;
-
- if (state == XDM_OFF)
- return;
- FD_SET(xdmcpSocket, LastSelectMask);
-#if defined(IPv6) && defined(AF_INET6)
- if (xdmcpSocket6 >= 0)
- FD_SET(xdmcpSocket6, LastSelectMask);
-#endif
- if (timeOutTime == 0)
- return;
- millisToGo = timeOutTime - GetTimeInMillis();
- if ((int) millisToGo < 0)
- millisToGo = 0;
- AdjustWaitForDelay (wt, millisToGo);
-}
-
-/*
- * called after select returns; this routine will
- * recognise when XDMCP packets await and
- * process them appropriately
- */
-
-/*ARGSUSED*/
-static void
-XdmcpWakeupHandler(
- pointer data, /* unused */
- int i,
- pointer pReadmask)
-{
- fd_set* LastSelectMask = (fd_set*)pReadmask;
- fd_set devicesReadable;
-
- if (state == XDM_OFF)
- return;
- if (i > 0)
- {
- if (FD_ISSET(xdmcpSocket, LastSelectMask))
- {
- receive_packet(xdmcpSocket);
- FD_CLR(xdmcpSocket, LastSelectMask);
- }
-#if defined(IPv6) && defined(AF_INET6)
- if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, LastSelectMask))
- {
- receive_packet(xdmcpSocket6);
- FD_CLR(xdmcpSocket6, LastSelectMask);
- }
-#endif
- XFD_ANDSET(&devicesReadable, LastSelectMask, &EnabledDevices);
- if (XFD_ANYSET(&devicesReadable))
- {
- if (state == XDM_AWAIT_USER_INPUT)
- restart();
- else if (state == XDM_RUN_SESSION)
- keepaliveDormancy = defaultKeepaliveDormancy;
- }
- if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION)
- timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000;
- }
- else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0)
- {
- if (state == XDM_RUN_SESSION)
- {
- state = XDM_KEEPALIVE;
- send_packet();
- }
- else
- timeout();
- }
-}
-
-/*
- * This routine should be called from the routine that drives the
- * user's host menu when the user selects a host
- */
-
-static void
-XdmcpSelectHost(
- struct sockaddr *host_sockaddr,
- int host_len,
- ARRAY8Ptr AuthenticationName)
-{
-#if defined(IPv6) && defined(AF_INET6)
- /* Don't need list of addresses for host anymore */
- if (mgrAddrFirst != NULL) {
- freeaddrinfo(mgrAddrFirst);
- mgrAddrFirst = NULL;
- mgrAddr = NULL;
- }
-#endif
- state = XDM_START_CONNECTION;
- memmove(&req_sockaddr, host_sockaddr, host_len);
- req_socklen = host_len;
- XdmcpSetAuthentication (AuthenticationName);
- send_packet();
-}
-
-/*
- * !!! this routine should be replaced by a routine that adds
- * the host to the user's host menu. the current version just
- * selects the first host to respond with willing message.
- */
-
-/*ARGSUSED*/
-static void
-XdmcpAddHost(
- struct sockaddr *from,
- int fromlen,
- ARRAY8Ptr AuthenticationName,
- ARRAY8Ptr hostname,
- ARRAY8Ptr status)
-{
- XdmcpSelectHost(from, fromlen, AuthenticationName);
-}
-
-/*
- * A message is queued on the socket; read it and
- * do the appropriate thing
- */
-
-ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" };
-
-static void
-receive_packet(int socketfd)
-{
-#if defined(IPv6) && defined(AF_INET6)
- struct sockaddr_storage from;
-#else
- struct sockaddr_in from;
-#endif
- int fromlen = sizeof(from);
- XdmcpHeader header;
-
- /* read message off socket */
- if (!XdmcpFill (socketfd, &buffer, (XdmcpNetaddr) &from, &fromlen))
- return;
-
- /* reset retransmission backoff */
- timeOutRtx = 0;
-
- if (!XdmcpReadHeader (&buffer, &header))
- return;
-
- if (header.version != XDM_PROTOCOL_VERSION)
- return;
-
- switch (header.opcode) {
- case WILLING:
- recv_willing_msg((struct sockaddr *) &from, fromlen, header.length);
- break;
- case UNWILLING:
- XdmcpFatal("Manager unwilling", &UnwillingMessage);
- break;
- case ACCEPT:
- recv_accept_msg(header.length);
- break;
- case DECLINE:
- recv_decline_msg(header.length);
- break;
- case REFUSE:
- recv_refuse_msg(header.length);
- break;
- case FAILED:
- recv_failed_msg(header.length);
- break;
- case ALIVE:
- recv_alive_msg(header.length);
- break;
- }
-}
-
-/*
- * send the appropriate message given the current state
- */
-
-static void
-send_packet(void)
-{
- int rtx;
- switch (state) {
- case XDM_QUERY:
- case XDM_BROADCAST:
- case XDM_INDIRECT:
-#if defined(IPv6) && defined(AF_INET6)
- case XDM_MULTICAST:
-#endif
- send_query_msg();
- break;
- case XDM_START_CONNECTION:
- send_request_msg();
- break;
- case XDM_MANAGE:
- send_manage_msg();
- break;
- case XDM_KEEPALIVE:
- send_keepalive_msg();
- break;
- default:
- break;
- }
- rtx = (XDM_MIN_RTX << timeOutRtx);
- if (rtx > XDM_MAX_RTX)
- rtx = XDM_MAX_RTX;
- timeOutTime = GetTimeInMillis() + rtx * 1000;
-}
-
-/*
- * The session is declared dead for some reason; too many
- * timeouts, or Keepalive failure.
- */
-
-void
-XdmcpDeadSession (char *reason)
-{
- ErrorF ("XDM: %s, declaring session dead\n", reason);
- state = XDM_INIT_STATE;
- isItTimeToYield = TRUE;
- dispatchException |= DE_RESET;
- timeOutTime = 0;
- timeOutRtx = 0;
- send_packet();
-}
-
-/*
- * Timeout waiting for an XDMCP response.
- */
-
-static void
-timeout(void)
-{
- timeOutRtx++;
- if (state == XDM_AWAIT_ALIVE_RESPONSE && timeOutRtx >= XDM_KA_RTX_LIMIT )
- {
- XdmcpDeadSession ("too many keepalive retransmissions");
- return;
- }
- else if (timeOutRtx >= XDM_RTX_LIMIT)
- {
- /* Quit if "-once" specified, otherwise reset and try again. */
- if (OneSession) {
- dispatchException |= DE_TERMINATE;
- ErrorF("XDM: too many retransmissions\n");
- } else {
- XdmcpDeadSession("too many retransmissions");
- }
- return;
- }
-
-#if defined(IPv6) && defined(AF_INET6)
- if (state == XDM_COLLECT_QUERY || state == XDM_COLLECT_INDIRECT_QUERY) {
- /* Try next address */
- for (mgrAddr = mgrAddr->ai_next; ; mgrAddr = mgrAddr->ai_next) {
- if (mgrAddr == NULL) {
- mgrAddr = mgrAddrFirst;
- }
- if (mgrAddr->ai_family == AF_INET
- || mgrAddr->ai_family == AF_INET6)
- break;
- }
-#ifndef SIN6_LEN
- ManagerAddressLen = mgrAddr->ai_addrlen;
-#endif
- memcpy(&ManagerAddress, mgrAddr->ai_addr, mgrAddr->ai_addrlen);
- }
-#endif
-
- switch (state) {
- case XDM_COLLECT_QUERY:
- state = XDM_QUERY;
- break;
- case XDM_COLLECT_BROADCAST_QUERY:
- state = XDM_BROADCAST;
- break;
-#if defined(IPv6) && defined(AF_INET6)
- case XDM_COLLECT_MULTICAST_QUERY:
- state = XDM_MULTICAST;
- break;
-#endif
- case XDM_COLLECT_INDIRECT_QUERY:
- state = XDM_INDIRECT;
- break;
- case XDM_AWAIT_REQUEST_RESPONSE:
- state = XDM_START_CONNECTION;
- break;
- case XDM_AWAIT_MANAGE_RESPONSE:
- state = XDM_MANAGE;
- break;
- case XDM_AWAIT_ALIVE_RESPONSE:
- state = XDM_KEEPALIVE;
- break;
- default:
- break;
- }
- send_packet();
-}
-
-static void
-restart(void)
-{
- state = XDM_INIT_STATE;
- timeOutRtx = 0;
- send_packet();
-}
-
-int
-XdmcpCheckAuthentication (
- ARRAY8Ptr Name,
- ARRAY8Ptr Data,
- int packet_type)
-{
- return (XdmcpARRAY8Equal (Name, AuthenticationName) &&
- (AuthenticationName->length == 0 ||
- (*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type)));
-}
-
-int
-XdmcpAddAuthorization (
- ARRAY8Ptr name,
- ARRAY8Ptr data)
-{
- AddAuthorFunc AddAuth;
-
- if (AuthenticationFuncs && AuthenticationFuncs->AddAuth)
- AddAuth = AuthenticationFuncs->AddAuth;
- else
- AddAuth = AddAuthorization;
- return (*AddAuth) ((unsigned short)name->length,
- (char *)name->data,
- (unsigned short)data->length,
- (char *)data->data);
-}
-
-/*
- * from here to the end of this file are routines private
- * to the state machine.
- */
-
-static void
-get_xdmcp_sock(void)
-{
-#ifdef STREAMSCONN
- struct netconfig *nconf;
-
- if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) {
- XdmcpWarning("t_open() of /dev/udp failed");
- return;
- }
-
- if( t_bind(xdmcpSocket,NULL,NULL) < 0 ) {
- XdmcpWarning("UDP socket creation failed");
- t_error("t_bind(xdmcpSocket) failed" );
- t_close(xdmcpSocket);
- return;
- }
-
- /*
- * This part of the code looks contrived. It will actually fit in nicely
- * when the CLTS part of Xtrans is implemented.
- */
-
- if( (nconf=getnetconfigent("udp")) == NULL ) {
- XdmcpWarning("UDP socket creation failed: getnetconfigent()");
- t_unbind(xdmcpSocket);
- t_close(xdmcpSocket);
- return;
- }
-
- if( netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL) ) {
- XdmcpWarning("UDP set broadcast option failed: netdir_options()");
- freenetconfigent(nconf);
- t_unbind(xdmcpSocket);
- t_close(xdmcpSocket);
- return;
- }
-
- freenetconfigent(nconf);
-#else
- int soopts = 1;
-
-#if defined(IPv6) && defined(AF_INET6)
- if ((xdmcpSocket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
- XdmcpWarning("INET6 UDP socket creation failed");
-#endif
- if ((xdmcpSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
- XdmcpWarning("UDP socket creation failed");
-#ifdef SO_BROADCAST
- else if (setsockopt(xdmcpSocket, SOL_SOCKET, SO_BROADCAST, (char *)&soopts,
- sizeof(soopts)) < 0)
- XdmcpWarning("UDP set broadcast socket-option failed");
-#endif /* SO_BROADCAST */
- if (xdmcpSocket >= 0 && xdm_from != NULL) {
- if (bind(xdmcpSocket, (struct sockaddr *)&FromAddress,
- FromAddressLen) < 0) {
- ErrorF("Xserver: failed to bind to -from address: %s\n", xdm_from);
- exit(1);
- }
- }
-#endif /* STREAMSCONN */
-}
-
-static void
-send_query_msg(void)
-{
- XdmcpHeader header;
- Bool broadcast = FALSE;
-#if defined(IPv6) && defined(AF_INET6)
- Bool multicast = FALSE;
-#endif
- int i;
- int socketfd = xdmcpSocket;
-
- header.version = XDM_PROTOCOL_VERSION;
- switch(state){
- case XDM_QUERY:
- header.opcode = (CARD16) QUERY;
- state = XDM_COLLECT_QUERY;
- break;
- case XDM_BROADCAST:
- header.opcode = (CARD16) BROADCAST_QUERY;
- state = XDM_COLLECT_BROADCAST_QUERY;
- broadcast = TRUE;
- break;
-#if defined(IPv6) && defined(AF_INET6)
- case XDM_MULTICAST:
- header.opcode = (CARD16) BROADCAST_QUERY;
- state = XDM_COLLECT_MULTICAST_QUERY;
- multicast = TRUE;
- break;
-#endif
- case XDM_INDIRECT:
- header.opcode = (CARD16) INDIRECT_QUERY;
- state = XDM_COLLECT_INDIRECT_QUERY;
- break;
- default:
- break;
- }
- header.length = 1;
- for (i = 0; i < AuthenticationNames.length; i++)
- header.length += 2 + AuthenticationNames.data[i].length;
-
- XdmcpWriteHeader (&buffer, &header);
- XdmcpWriteARRAYofARRAY8 (&buffer, &AuthenticationNames);
- if (broadcast)
- {
- int i;
-
- for (i = 0; i < NumBroadcastAddresses; i++)
- XdmcpFlush (xdmcpSocket, &buffer, (XdmcpNetaddr) &BroadcastAddresses[i],
- sizeof (struct sockaddr_in));
- }
-#if defined(IPv6) && defined(AF_INET6)
- else if (multicast)
- {
- struct multicastinfo *mcl;
- struct addrinfo *ai;
-
- for (mcl = mcastlist; mcl != NULL; mcl = mcl->next) {
- for (ai = mcl->ai ; ai != NULL; ai = ai->ai_next) {
- if (ai->ai_family == AF_INET) {
- unsigned char hopflag = (unsigned char) mcl->hops;
- socketfd = xdmcpSocket;
- setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL,
- &hopflag, sizeof(hopflag));
- } else if (ai->ai_family == AF_INET6) {
- int hopflag6 = mcl->hops;
- socketfd = xdmcpSocket6;
- setsockopt(socketfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
- &hopflag6, sizeof(hopflag6));
- } else {
- continue;
- }
- XdmcpFlush (socketfd, &buffer,
- (XdmcpNetaddr) ai->ai_addr, ai->ai_addrlen);
- break;
- }
- }
- }
-#endif
- else
- {
-#if defined(IPv6) && defined(AF_INET6)
- if (SOCKADDR_FAMILY(ManagerAddress) == AF_INET6)
- socketfd = xdmcpSocket6;
-#endif
- XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &ManagerAddress,
- sizeof (ManagerAddress));
- }
-}
-
-static void
-recv_willing_msg(
- struct sockaddr *from,
- int fromlen,
- unsigned length)
-{
- ARRAY8 authenticationName;
- ARRAY8 hostname;
- ARRAY8 status;
-
- authenticationName.data = 0;
- hostname.data = 0;
- status.data = 0;
- if (XdmcpReadARRAY8 (&buffer, &authenticationName) &&
- XdmcpReadARRAY8 (&buffer, &hostname) &&
- XdmcpReadARRAY8 (&buffer, &status))
- {
- if (length == 6 + authenticationName.length +
- hostname.length + status.length)
- {
- switch (state)
- {
- case XDM_COLLECT_QUERY:
- XdmcpSelectHost(from, fromlen, &authenticationName);
- break;
- case XDM_COLLECT_BROADCAST_QUERY:
-#if defined(IPv6) && defined(AF_INET6)
- case XDM_COLLECT_MULTICAST_QUERY:
-#endif
- case XDM_COLLECT_INDIRECT_QUERY:
- XdmcpAddHost(from, fromlen, &authenticationName, &hostname, &status);
- break;
- default:
- break;
- }
- }
- }
- XdmcpDisposeARRAY8 (&authenticationName);
- XdmcpDisposeARRAY8 (&hostname);
- XdmcpDisposeARRAY8 (&status);
-}
-
-static void
-send_request_msg(void)
-{
- XdmcpHeader header;
- int length;
- int i;
- ARRAY8 authenticationData;
- int socketfd = xdmcpSocket;
-
- header.version = XDM_PROTOCOL_VERSION;
- header.opcode = (CARD16) REQUEST;
-
- length = 2; /* display number */
- length += 1 + 2 * ConnectionTypes.length; /* connection types */
- length += 1; /* connection addresses */
- for (i = 0; i < ConnectionAddresses.length; i++)
- length += 2 + ConnectionAddresses.data[i].length;
- authenticationData.length = 0;
- authenticationData.data = 0;
- if (AuthenticationFuncs)
- {
- (*AuthenticationFuncs->Generator) (AuthenticationData,
- &authenticationData,
- REQUEST);
- }
- length += 2 + AuthenticationName->length; /* authentication name */
- length += 2 + authenticationData.length; /* authentication data */
- length += 1; /* authorization names */
- for (i = 0; i < AuthorizationNames.length; i++)
- length += 2 + AuthorizationNames.data[i].length;
- length += 2 + ManufacturerDisplayID.length; /* display ID */
- header.length = length;
-
- if (!XdmcpWriteHeader (&buffer, &header))
- {
- XdmcpDisposeARRAY8 (&authenticationData);
- return;
- }
- XdmcpWriteCARD16 (&buffer, DisplayNumber);
- XdmcpWriteARRAY16 (&buffer, &ConnectionTypes);
- XdmcpWriteARRAYofARRAY8 (&buffer, &ConnectionAddresses);
-
- XdmcpWriteARRAY8 (&buffer, AuthenticationName);
- XdmcpWriteARRAY8 (&buffer, &authenticationData);
- XdmcpDisposeARRAY8 (&authenticationData);
- XdmcpWriteARRAYofARRAY8 (&buffer, &AuthorizationNames);
- XdmcpWriteARRAY8 (&buffer, &ManufacturerDisplayID);
-#if defined(IPv6) && defined(AF_INET6)
- if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6)
- socketfd = xdmcpSocket6;
-#endif
- if (XdmcpFlush (socketfd, &buffer,
- (XdmcpNetaddr) &req_sockaddr, req_socklen))
- state = XDM_AWAIT_REQUEST_RESPONSE;
-}
-
-static void
-recv_accept_msg(unsigned length)
-{
- CARD32 AcceptSessionID;
- ARRAY8 AcceptAuthenticationName, AcceptAuthenticationData;
- ARRAY8 AcceptAuthorizationName, AcceptAuthorizationData;
-
- if (state != XDM_AWAIT_REQUEST_RESPONSE)
- return;
- AcceptAuthenticationName.data = 0;
- AcceptAuthenticationData.data = 0;
- AcceptAuthorizationName.data = 0;
- AcceptAuthorizationData.data = 0;
- if (XdmcpReadCARD32 (&buffer, &AcceptSessionID) &&
- XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationName) &&
- XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationData) &&
- XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationName) &&
- XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationData))
- {
- if (length == 12 + AcceptAuthenticationName.length +
- AcceptAuthenticationData.length +
- AcceptAuthorizationName.length +
- AcceptAuthorizationData.length)
- {
- if (!XdmcpCheckAuthentication (&AcceptAuthenticationName,
- &AcceptAuthenticationData, ACCEPT))
- {
- XdmcpFatal ("Authentication Failure", &AcceptAuthenticationName);
- }
- /* permit access control manipulations from this host */
- AugmentSelf (&req_sockaddr, req_socklen);
- /* if the authorization specified in the packet fails
- * to be acceptable, enable the local addresses
- */
- if (!XdmcpAddAuthorization (&AcceptAuthorizationName,
- &AcceptAuthorizationData))
- {
- AddLocalHosts ();
- }
- SessionID = AcceptSessionID;
- state = XDM_MANAGE;
- send_packet();
- }
- }
- XdmcpDisposeARRAY8 (&AcceptAuthenticationName);
- XdmcpDisposeARRAY8 (&AcceptAuthenticationData);
- XdmcpDisposeARRAY8 (&AcceptAuthorizationName);
- XdmcpDisposeARRAY8 (&AcceptAuthorizationData);
-}
-
-static void
-recv_decline_msg(unsigned length)
-{
- ARRAY8 status, DeclineAuthenticationName, DeclineAuthenticationData;
-
- status.data = 0;
- DeclineAuthenticationName.data = 0;
- DeclineAuthenticationData.data = 0;
- if (XdmcpReadARRAY8 (&buffer, &status) &&
- XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationName) &&
- XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationData))
- {
- if (length == 6 + status.length +
- DeclineAuthenticationName.length +
- DeclineAuthenticationData.length &&
- XdmcpCheckAuthentication (&DeclineAuthenticationName,
- &DeclineAuthenticationData, DECLINE))
- {
- XdmcpFatal ("Session declined", &status);
- }
- }
- XdmcpDisposeARRAY8 (&status);
- XdmcpDisposeARRAY8 (&DeclineAuthenticationName);
- XdmcpDisposeARRAY8 (&DeclineAuthenticationData);
-}
-
-static void
-send_manage_msg(void)
-{
- XdmcpHeader header;
- int socketfd = xdmcpSocket;
-
- header.version = XDM_PROTOCOL_VERSION;
- header.opcode = (CARD16) MANAGE;
- header.length = 8 + DisplayClass.length;
-
- if (!XdmcpWriteHeader (&buffer, &header))
- return;
- XdmcpWriteCARD32 (&buffer, SessionID);
- XdmcpWriteCARD16 (&buffer, DisplayNumber);
- XdmcpWriteARRAY8 (&buffer, &DisplayClass);
- state = XDM_AWAIT_MANAGE_RESPONSE;
-#if defined(IPv6) && defined(AF_INET6)
- if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6)
- socketfd = xdmcpSocket6;
-#endif
- XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen);
-}
-
-static void
-recv_refuse_msg(unsigned length)
-{
- CARD32 RefusedSessionID;
-
- if (state != XDM_AWAIT_MANAGE_RESPONSE)
- return;
- if (length != 4)
- return;
- if (XdmcpReadCARD32 (&buffer, &RefusedSessionID))
- {
- if (RefusedSessionID == SessionID)
- {
- state = XDM_START_CONNECTION;
- send_packet();
- }
- }
-}
-
-static void
-recv_failed_msg(unsigned length)
-{
- CARD32 FailedSessionID;
- ARRAY8 status;
-
- if (state != XDM_AWAIT_MANAGE_RESPONSE)
- return;
- status.data = 0;
- if (XdmcpReadCARD32 (&buffer, &FailedSessionID) &&
- XdmcpReadARRAY8 (&buffer, &status))
- {
- if (length == 6 + status.length &&
- SessionID == FailedSessionID)
- {
- XdmcpFatal ("Session failed", &status);
- }
- }
- XdmcpDisposeARRAY8 (&status);
-}
-
-static void
-send_keepalive_msg(void)
-{
- XdmcpHeader header;
- int socketfd = xdmcpSocket;
-
- header.version = XDM_PROTOCOL_VERSION;
- header.opcode = (CARD16) KEEPALIVE;
- header.length = 6;
-
- XdmcpWriteHeader (&buffer, &header);
- XdmcpWriteCARD16 (&buffer, DisplayNumber);
- XdmcpWriteCARD32 (&buffer, SessionID);
-
- state = XDM_AWAIT_ALIVE_RESPONSE;
-#if defined(IPv6) && defined(AF_INET6)
- if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6)
- socketfd = xdmcpSocket6;
-#endif
- XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen);
-}
-
-static void
-recv_alive_msg (unsigned length)
-{
- CARD8 SessionRunning;
- CARD32 AliveSessionID;
-
- if (state != XDM_AWAIT_ALIVE_RESPONSE)
- return;
- if (length != 5)
- return;
- if (XdmcpReadCARD8 (&buffer, &SessionRunning) &&
- XdmcpReadCARD32 (&buffer, &AliveSessionID))
- {
- if (SessionRunning && AliveSessionID == SessionID)
- {
- /* backoff dormancy period */
- state = XDM_RUN_SESSION;
- if ((GetTimeInMillis() - lastDeviceEventTime.milliseconds) >
- keepaliveDormancy * 1000)
- {
- keepaliveDormancy <<= 1;
- if (keepaliveDormancy > XDM_MAX_DORMANCY)
- keepaliveDormancy = XDM_MAX_DORMANCY;
- }
- timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000;
- }
- else
- {
- XdmcpDeadSession ("Alive respose indicates session dead");
- }
- }
-}
-
-static void
-XdmcpFatal (
- char *type,
- ARRAY8Ptr status)
-{
- FatalError ("XDMCP fatal error: %s %*.*s\n", type,
- status->length, status->length, status->data);
-}
-
-static void
-XdmcpWarning(char *str)
-{
- ErrorF("XDMCP warning: %s\n", str);
-}
-
-static void
-get_addr_by_name(
- char * argtype,
- char * namestr,
- int port,
- int socktype,
- SOCKADDR_TYPE *addr,
- SOCKLEN_TYPE *addrlen
-#if defined(IPv6) && defined(AF_INET6)
- ,
- struct addrinfo **aip,
- struct addrinfo **aifirstp
-#endif
- )
-{
-#if defined(IPv6) && defined(AF_INET6)
- struct addrinfo *ai;
- struct addrinfo hints;
- char portstr[6];
- char *pport = portstr;
- int gaierr;
-
- bzero(&hints, sizeof(hints));
- hints.ai_socktype = socktype;
-
- if (port == 0) {
- pport = NULL;
- } else if (port > 0 && port < 65535) {
- sprintf(portstr, "%d", port);
- } else {
- ErrorF("Xserver: port out of range: %d\n", port);
- exit(1);
- }
-
- if (*aifirstp != NULL) {
- freeaddrinfo(*aifirstp);
- *aifirstp = NULL;
- }
-
- if ((gaierr = getaddrinfo(namestr, pport, &hints, aifirstp)) == 0) {
- for (ai = *aifirstp; ai != NULL; ai = ai->ai_next) {
- if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6)
- break;
- }
- if ((ai == NULL) || (ai->ai_addrlen > sizeof(SOCKADDR_TYPE))) {
- ErrorF ("Xserver: %s host %s not on supported network type\n",
- argtype, namestr);
- exit (1);
- } else {
- *aip = ai;
- *addrlen = ai->ai_addrlen;
- memcpy(addr, ai->ai_addr, ai->ai_addrlen);
- }
- } else {
- ErrorF("Xserver: %s: %s %s\n", gai_strerror(gaierr), argtype, namestr);
- exit(1);
- }
-#else
- struct hostent *hep;
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
-#endif
-
- if (!(hep = _XGethostbyname(namestr, hparams)))
- {
- ErrorF("Xserver: %s unknown host: %s\n", argtype, namestr);
- exit(1);
- }
- if (hep->h_length == sizeof (struct in_addr))
- {
- memmove(&addr->sin_addr, hep->h_addr, hep->h_length);
- *addrlen = sizeof(struct sockaddr_in);
- addr->sin_family = AF_INET;
- addr->sin_port = htons (xdm_udp_port);
- }
- else
- {
- ErrorF ("Xserver: %s host on strange network %s\n", argtype, namestr);
- exit (1);
- }
-#endif
-}
-
-static void
-get_manager_by_name(
- int argc,
- char **argv,
- int i)
-{
-
- if ((i + 1) == argc)
- {
- ErrorF("Xserver: missing %s host name in command line\n", argv[i]);
- exit(1);
- }
-
- get_addr_by_name(argv[i], argv[i+1], xdm_udp_port, SOCK_DGRAM,
- &ManagerAddress, &ManagerAddressLen
-#if defined(IPv6) && defined(AF_INET6)
- , &mgrAddr, &mgrAddrFirst
-#endif
- );
-}
-
-
-static void
-get_fromaddr_by_name(
- int argc,
- char **argv,
- int i)
-{
-#if defined(IPv6) && defined(AF_INET6)
- struct addrinfo *ai = NULL;
- struct addrinfo *aifirst = NULL;
-#endif
- if (i == argc)
- {
- ErrorF("Xserver: missing -from host name in command line\n");
- exit(1);
- }
- get_addr_by_name("-from", argv[i], 0, 0, &FromAddress, &FromAddressLen
-#if defined(IPv6) && defined(AF_INET6)
- , &ai, &aifirst
-#endif
- );
- xdm_from = argv[i];
-}
-
-
-#if defined(IPv6) && defined(AF_INET6)
-static int
-get_mcast_options(argc, argv, i)
- int argc, i;
- char **argv;
-{
- char *address = "ff02::1"; /* Default address until IANA assigns one */
- int hopcount = 1;
- struct addrinfo hints;
- char portstr[6];
- int gaierr;
- struct addrinfo *ai, *firstai;
-
- if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) {
- address = argv[i++];
- if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) {
- hopcount = strtol(argv[i++], NULL, 10);
- if ((hopcount < 1) || (hopcount > 255)) {
- ErrorF("Xserver: multicast hop count out of range: %d\n",
- hopcount);
- exit(1);
- }
- }
- }
-
- if (xdm_udp_port > 0 && xdm_udp_port < 65535) {
- sprintf(portstr, "%d", xdm_udp_port);
- } else {
- ErrorF("Xserver: port out of range: %d\n", xdm_udp_port);
- exit(1);
- }
- bzero(&hints, sizeof(hints));
- hints.ai_socktype = SOCK_DGRAM;
-
- if ((gaierr = getaddrinfo(address, portstr, &hints, &firstai)) == 0) {
- for (ai = firstai; ai != NULL; ai = ai->ai_next) {
- if (((ai->ai_family == AF_INET) &&
- IN_MULTICAST(((struct sockaddr_in *) ai->ai_addr)
- ->sin_addr.s_addr))
- || ((ai->ai_family == AF_INET6) &&
- IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *) ai->ai_addr)
- ->sin6_addr)))
- break;
- }
- if (ai == NULL) {
- ErrorF ("Xserver: address not supported multicast type %s\n",
- address);
- exit (1);
- } else {
- struct multicastinfo *mcastinfo, *mcl;
-
- mcastinfo = malloc(sizeof(struct multicastinfo));
- mcastinfo->next = NULL;
- mcastinfo->ai = firstai;
- mcastinfo->hops = hopcount;
-
- if (mcastlist == NULL) {
- mcastlist = mcastinfo;
- } else {
- for (mcl = mcastlist; mcl->next != NULL; mcl = mcl->next) {
- /* Do nothing - just find end of list */
- }
- mcl->next = mcastinfo;
- }
- }
- } else {
- ErrorF("Xserver: %s: %s\n", gai_strerror(gaierr), address);
- exit(1);
- }
- return i;
-}
-#endif
-
-#else
-static int xdmcp_non_empty; /* avoid complaint by ranlib */
-#endif /* XDMCP */
diff --git a/randr/mirandr.c b/randr/mirandr.c
deleted file mode 100644
index b45a1f9a8..000000000
--- a/randr/mirandr.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/randr/mirandr.c,v 1.7 2002/10/14 18:01:42 keithp Exp $
- *
- * Copyright © 2000, Compaq Computer Corporation,
- * Copyright © 2002, Hewlett Packard, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq or HP not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. HP makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
- */
-
-
-#include "scrnintstr.h"
-#include "mi.h"
-#include "randr.h"
-#include "randrstr.h"
-#include <stdio.h>
-
-/*
- * This function assumes that only a single depth can be
- * displayed at a time, but that all visuals of that depth
- * can be displayed simultaneously. It further assumes that
- * only a single size is available. Hardware providing
- * additional capabilties should use different code.
- * XXX what to do here....
- */
-
-Bool
-miRRGetInfo (ScreenPtr pScreen, Rotation *rotations)
-{
- int i;
- Bool setConfig = FALSE;
-
- *rotations = RR_Rotate_0;
- for (i = 0; i < pScreen->numDepths; i++)
- {
- if (pScreen->allowedDepths[i].numVids)
- {
- RRScreenSizePtr pSize;
-
- pSize = RRRegisterSize (pScreen,
- pScreen->width,
- pScreen->height,
- pScreen->mmWidth,
- pScreen->mmHeight);
- if (!pSize)
- return FALSE;
- if (!setConfig)
- {
- RRSetCurrentConfig (pScreen, RR_Rotate_0, 0, pSize);
- setConfig = TRUE;
- }
- }
- }
- return TRUE;
-}
-
-/*
- * Any hardware that can actually change anything will need something
- * different here
- */
-Bool
-miRRSetConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize)
-{
- return TRUE;
-}
-
-
-Bool
-miRandRInit (ScreenPtr pScreen)
-{
- rrScrPrivPtr rp;
-
- if (!RRScreenInit (pScreen))
- return FALSE;
- rp = rrGetScrPriv(pScreen);
- rp->rrGetInfo = miRRGetInfo;
- rp->rrSetConfig = miRRSetConfig;
- return TRUE;
-}
diff --git a/randr/randr.c b/randr/randr.c
deleted file mode 100644
index c0a8c4bf8..000000000
--- a/randr/randr.c
+++ /dev/null
@@ -1,1212 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.22 2003/11/06 18:38:15 tsi Exp $
- *
- * Copyright © 2000, Compaq Computer Corporation,
- * Copyright © 2002, Hewlett Packard, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq or HP not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. HP makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
- */
-
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "servermd.h"
-#include "randr.h"
-#include "randrproto.h"
-#include "randrstr.h"
-#ifdef RENDER
-#include "render.h" /* we share subpixel order information */
-#include "picturestr.h"
-#endif
-#include "Xfuncproto.h"
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-/* From render.h */
-#ifndef SubPixelUnknown
-#define SubPixelUnknown 0
-#endif
-
-#define RR_VALIDATE
-int RRGeneration;
-int RRNScreens;
-
-static int ProcRRQueryVersion (ClientPtr pClient);
-static int ProcRRDispatch (ClientPtr pClient);
-static int SProcRRDispatch (ClientPtr pClient);
-static int SProcRRQueryVersion (ClientPtr pClient);
-
-#define wrap(priv,real,mem,func) {\
- priv->mem = real->mem; \
- real->mem = func; \
-}
-
-#define unwrap(priv,real,mem) {\
- real->mem = priv->mem; \
-}
-
-#if 0
-static CARD8 RRReqCode;
-static int RRErrBase;
-#endif
-static int RREventBase;
-static RESTYPE ClientType, EventType; /* resource types for event masks */
-static int RRClientPrivateIndex;
-
-typedef struct _RRTimes {
- TimeStamp setTime;
- TimeStamp configTime;
-} RRTimesRec, *RRTimesPtr;
-
-typedef struct _RRClient {
- int major_version;
- int minor_version;
-/* RRTimesRec times[0]; */
-} RRClientRec, *RRClientPtr;
-
-/*
- * each window has a list of clients requesting
- * RRNotify events. Each client has a resource
- * for each window it selects RRNotify input for,
- * this resource is used to delete the RRNotifyRec
- * entry from the per-window queue.
- */
-
-typedef struct _RREvent *RREventPtr;
-
-typedef struct _RREvent {
- RREventPtr next;
- ClientPtr client;
- WindowPtr window;
- XID clientResource;
- int mask;
-} RREventRec;
-
-int rrPrivIndex = -1;
-
-#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr)
-#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
-
-static Bool
-RRClientKnowsRates (ClientPtr pClient)
-{
- rrClientPriv(pClient);
-
- return (pRRClient->major_version > 1 ||
- (pRRClient->major_version == 1 && pRRClient->minor_version >= 1));
-}
-
-static void
-RRClientCallback (CallbackListPtr *list,
- pointer closure,
- pointer data)
-{
- NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
- ClientPtr pClient = clientinfo->client;
- rrClientPriv(pClient);
- RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1);
- int i;
-
- pRRClient->major_version = 0;
- pRRClient->minor_version = 0;
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ScreenPtr pScreen = screenInfo.screens[i];
- rrScrPriv(pScreen);
-
- if (pScrPriv)
- {
- pTimes[i].setTime = pScrPriv->lastSetTime;
- pTimes[i].configTime = pScrPriv->lastConfigTime;
- }
- }
-}
-
-static void
-RRResetProc (ExtensionEntry *extEntry)
-{
-}
-
-static Bool
-RRCloseScreen (int i, ScreenPtr pScreen)
-{
- rrScrPriv(pScreen);
-
- unwrap (pScrPriv, pScreen, CloseScreen);
- if (pScrPriv->pSizes)
- xfree (pScrPriv->pSizes);
- xfree (pScrPriv);
- RRNScreens -= 1; /* ok, one fewer screen with RandR running */
- return (*pScreen->CloseScreen) (i, pScreen);
-}
-
-static void
-SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from,
- xRRScreenChangeNotifyEvent *to)
-{
- to->type = from->type;
- to->rotation = from->rotation;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->timestamp, to->timestamp);
- cpswapl(from->configTimestamp, to->configTimestamp);
- cpswapl(from->root, to->root);
- cpswapl(from->window, to->window);
- cpswaps(from->sizeID, to->sizeID);
- cpswaps(from->widthInPixels, to->widthInPixels);
- cpswaps(from->heightInPixels, to->heightInPixels);
- cpswaps(from->widthInMillimeters, to->widthInMillimeters);
- cpswaps(from->heightInMillimeters, to->heightInMillimeters);
- cpswaps(from->subpixelOrder, to->subpixelOrder);
-}
-
-Bool RRScreenInit(ScreenPtr pScreen)
-{
- rrScrPrivPtr pScrPriv;
-
- if (RRGeneration != serverGeneration)
- {
- if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- RRGeneration = serverGeneration;
- }
-
- pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec));
- if (!pScrPriv)
- return FALSE;
-
- SetRRScreen(pScreen, pScrPriv);
-
- /*
- * Calling function best set these function vectors
- */
- pScrPriv->rrSetConfig = 0;
- pScrPriv->rrGetInfo = 0;
- /*
- * This value doesn't really matter -- any client must call
- * GetScreenInfo before reading it which will automatically update
- * the time
- */
- pScrPriv->lastSetTime = currentTime;
- pScrPriv->lastConfigTime = currentTime;
-
- wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen);
-
- pScrPriv->rotations = RR_Rotate_0;
-
- pScrPriv->nSizes = 0;
- pScrPriv->nSizesInUse = 0;
- pScrPriv->pSizes = 0;
-
- pScrPriv->rotation = RR_Rotate_0;
- pScrPriv->size = -1;
-
- RRNScreens += 1; /* keep count of screens that implement randr */
- return TRUE;
-}
-
-/*ARGSUSED*/
-static int
-RRFreeClient (pointer data, XID id)
-{
- RREventPtr pRREvent;
- WindowPtr pWin;
- RREventPtr *pHead, pCur, pPrev;
-
- pRREvent = (RREventPtr) data;
- pWin = pRREvent->window;
- pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType);
- if (pHead) {
- pPrev = 0;
- for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next)
- pPrev = pCur;
- if (pCur)
- {
- if (pPrev)
- pPrev->next = pRREvent->next;
- else
- *pHead = pRREvent->next;
- }
- }
- xfree ((pointer) pRREvent);
- return 1;
-}
-
-/*ARGSUSED*/
-static int
-RRFreeEvents (pointer data, XID id)
-{
- RREventPtr *pHead, pCur, pNext;
-
- pHead = (RREventPtr *) data;
- for (pCur = *pHead; pCur; pCur = pNext) {
- pNext = pCur->next;
- FreeResource (pCur->clientResource, ClientType);
- xfree ((pointer) pCur);
- }
- xfree ((pointer) pHead);
- return 1;
-}
-
-void
-RRExtensionInit (void)
-{
- ExtensionEntry *extEntry;
-
- if (RRNScreens == 0) return;
-
- RRClientPrivateIndex = AllocateClientPrivateIndex ();
- if (!AllocateClientPrivate (RRClientPrivateIndex,
- sizeof (RRClientRec) +
- screenInfo.numScreens * sizeof (RRTimesRec)))
- return;
- if (!AddCallback (&ClientStateCallback, RRClientCallback, 0))
- return;
-
- ClientType = CreateNewResourceType(RRFreeClient);
- if (!ClientType)
- return;
- EventType = CreateNewResourceType(RRFreeEvents);
- if (!EventType)
- return;
- extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors,
- ProcRRDispatch, SProcRRDispatch,
- RRResetProc, StandardMinorOpcode);
- if (!extEntry)
- return;
-#if 0
- RRReqCode = (CARD8) extEntry->base;
- RRErrBase = extEntry->errorBase;
-#endif
- RREventBase = extEntry->eventBase;
- EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr)
- SRRScreenChangeNotifyEvent;
-
- return;
-}
-
-static int
-TellChanged (WindowPtr pWin, pointer value)
-{
- RREventPtr *pHead, pRREvent;
- ClientPtr client;
- xRRScreenChangeNotifyEvent se;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- rrScrPriv(pScreen);
- RRScreenSizePtr pSize;
- WindowPtr pRoot = WindowTable[pScreen->myNum];
-
- pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType);
- if (!pHead)
- return WT_WALKCHILDREN;
-
- se.type = RRScreenChangeNotify + RREventBase;
- se.rotation = (CARD8) pScrPriv->rotation;
- se.timestamp = pScrPriv->lastSetTime.milliseconds;
- se.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
- se.root = pRoot->drawable.id;
- se.window = pWin->drawable.id;
-#ifdef RENDER
- se.subpixelOrder = PictureGetSubpixelOrder (pScreen);
-#else
- se.subpixelOrder = SubPixelUnknown;
-#endif
- if (pScrPriv->size >= 0)
- {
- pSize = &pScrPriv->pSizes[pScrPriv->size];
- se.sizeID = pSize->id;
- se.widthInPixels = pSize->width;
- se.heightInPixels = pSize->height;
- se.widthInMillimeters = pSize->mmWidth;
- se.heightInMillimeters = pSize->mmHeight;
- }
- else
- {
- /*
- * This "shouldn't happen", but a broken DDX can
- * forget to set the current configuration on GetInfo
- */
- se.sizeID = 0xffff;
- se.widthInPixels = 0;
- se.heightInPixels = 0;
- se.widthInMillimeters = 0;
- se.heightInMillimeters = 0;
- }
- for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
- {
- client = pRREvent->client;
- if (client == serverClient || client->clientGone)
- continue;
- se.sequenceNumber = client->sequence;
- if(pRREvent->mask & RRScreenChangeNotifyMask)
- WriteEventsToClient (client, 1, (xEvent *) &se);
- }
- return WT_WALKCHILDREN;
-}
-
-static Bool
-RRGetInfo (ScreenPtr pScreen)
-{
- rrScrPriv (pScreen);
- int i, j, k, l;
- Bool changed;
- Rotation rotations;
- RRScreenSizePtr pSize;
- RRScreenRatePtr pRate;
-
- for (i = 0; i < pScrPriv->nSizes; i++)
- {
- pSize = &pScrPriv->pSizes[i];
- pSize->oldReferenced = pSize->referenced;
- pSize->referenced = FALSE;
- for (k = 0; k < pSize->nRates; k++)
- {
- pRate = &pSize->pRates[k];
- pRate->oldReferenced = pRate->referenced;
- pRate->referenced = FALSE;
- }
- }
- if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations))
- return FALSE;
-
- changed = FALSE;
-
- /*
- * Check whether anything changed and simultaneously generate
- * the protocol id values for the objects
- */
- if (rotations != pScrPriv->rotations)
- {
- pScrPriv->rotations = rotations;
- changed = TRUE;
- }
-
- j = 0;
- for (i = 0; i < pScrPriv->nSizes; i++)
- {
- pSize = &pScrPriv->pSizes[i];
- if (pSize->oldReferenced != pSize->referenced)
- changed = TRUE;
- if (pSize->referenced)
- pSize->id = j++;
- l = 0;
- for (k = 0; k < pSize->nRates; k++)
- {
- pRate = &pSize->pRates[k];
- if (pRate->oldReferenced != pRate->referenced)
- changed = TRUE;
- if (pRate->referenced)
- l++;
- }
- pSize->nRatesInUse = l;
- }
- pScrPriv->nSizesInUse = j;
- if (changed)
- {
- UpdateCurrentTime ();
- pScrPriv->lastConfigTime = currentTime;
- WalkTree (pScreen, TellChanged, (pointer) pScreen);
- }
- return TRUE;
-}
-
-static void
-RRSendConfigNotify (ScreenPtr pScreen)
-{
- WindowPtr pWin = WindowTable[pScreen->myNum];
- xEvent event;
-
- event.u.u.type = ConfigureNotify;
- event.u.configureNotify.window = pWin->drawable.id;
- event.u.configureNotify.aboveSibling = None;
- event.u.configureNotify.x = 0;
- event.u.configureNotify.y = 0;
-
- /* XXX xinerama stuff ? */
-
- event.u.configureNotify.width = pWin->drawable.width;
- event.u.configureNotify.height = pWin->drawable.height;
- event.u.configureNotify.borderWidth = wBorderWidth (pWin);
- event.u.configureNotify.override = pWin->overrideRedirect;
- DeliverEvents(pWin, &event, 1, NullWindow);
-}
-
-static int
-ProcRRQueryVersion (ClientPtr client)
-{
- xRRQueryVersionReply rep;
- register int n;
- REQUEST(xRRQueryVersionReq);
- rrClientPriv(client);
-
- REQUEST_SIZE_MATCH(xRRQueryVersionReq);
- pRRClient->major_version = stuff->majorVersion;
- pRRClient->minor_version = stuff->minorVersion;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = RANDR_MAJOR;
- rep.minorVersion = RANDR_MINOR;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-
-extern char *ConnectionInfo;
-
-static int padlength[4] = {0, 3, 2, 1};
-
-static void
-RREditConnectionInfo (ScreenPtr pScreen)
-{
- xConnSetup *connSetup;
- char *vendor;
- xPixmapFormat *formats;
- xWindowRoot *root;
- xDepth *depth;
- xVisualType *visual;
- int screen = 0;
- int d;
-
- connSetup = (xConnSetup *) ConnectionInfo;
- vendor = (char *) connSetup + sizeof (xConnSetup);
- formats = (xPixmapFormat *) ((char *) vendor +
- connSetup->nbytesVendor +
- padlength[connSetup->nbytesVendor & 3]);
- root = (xWindowRoot *) ((char *) formats +
- sizeof (xPixmapFormat) * screenInfo.numPixmapFormats);
- while (screen != pScreen->myNum)
- {
- depth = (xDepth *) ((char *) root +
- sizeof (xWindowRoot));
- for (d = 0; d < root->nDepths; d++)
- {
- visual = (xVisualType *) ((char *) depth +
- sizeof (xDepth));
- depth = (xDepth *) ((char *) visual +
- depth->nVisuals * sizeof (xVisualType));
- }
- root = (xWindowRoot *) ((char *) depth);
- screen++;
- }
- root->pixWidth = pScreen->width;
- root->pixHeight = pScreen->height;
- root->mmWidth = pScreen->mmWidth;
- root->mmHeight = pScreen->mmHeight;
-}
-
-static int
-ProcRRGetScreenInfo (ClientPtr client)
-{
- REQUEST(xRRGetScreenInfoReq);
- xRRGetScreenInfoReply rep;
- WindowPtr pWin;
- int n;
- ScreenPtr pScreen;
- rrScrPrivPtr pScrPriv;
- CARD8 *extra;
- unsigned long extraLen;
-
- REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityReadAccess);
-
- if (!pWin)
- return BadWindow;
-
- pScreen = pWin->drawable.pScreen;
- pScrPriv = rrGetScrPriv(pScreen);
- rep.pad = 0;
- if (!pScrPriv)
- {
- rep.type = X_Reply;
- rep.setOfRotations = RR_Rotate_0;;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id;
- rep.timestamp = currentTime.milliseconds;
- rep.configTimestamp = currentTime.milliseconds;
- rep.nSizes = 0;
- rep.sizeID = 0;
- rep.rotation = RR_Rotate_0;
- rep.rate = 0;
- rep.nrateEnts = 0;
- extra = 0;
- extraLen = 0;
- }
- else
- {
- int i, j;
- xScreenSizes *size;
- CARD16 *rates;
- CARD8 *data8;
- Bool has_rate = RRClientKnowsRates (client);
-
- RRGetInfo (pScreen);
-
- rep.type = X_Reply;
- rep.setOfRotations = pScrPriv->rotations;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id;
- rep.timestamp = pScrPriv->lastSetTime.milliseconds;
- rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
- rep.rotation = pScrPriv->rotation;
- rep.nSizes = pScrPriv->nSizesInUse;
- rep.rate = pScrPriv->rate;
- rep.nrateEnts = 0;
- if (has_rate)
- {
- for (i = 0; i < pScrPriv->nSizes; i++)
- {
- RRScreenSizePtr pSize = &pScrPriv->pSizes[i];
- if (pSize->referenced)
- {
- rep.nrateEnts += (1 + pSize->nRatesInUse);
- }
- }
- }
-
- if (pScrPriv->size >= 0)
- rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id;
- else
- return BadImplementation;
-
- extraLen = (rep.nSizes * sizeof (xScreenSizes) +
- rep.nrateEnts * sizeof (CARD16));
-
- extra = (CARD8 *) xalloc (extraLen);
- if (!extra)
- return BadAlloc;
- /*
- * First comes the size information
- */
- size = (xScreenSizes *) extra;
- rates = (CARD16 *) (size + rep.nSizes);
- for (i = 0; i < pScrPriv->nSizes; i++)
- {
- RRScreenSizePtr pSize = &pScrPriv->pSizes[i];
- if (pSize->referenced)
- {
- size->widthInPixels = pSize->width;
- size->heightInPixels = pSize->height;
- size->widthInMillimeters = pSize->mmWidth;
- size->heightInMillimeters = pSize->mmHeight;
- if (client->swapped)
- {
- swaps (&size->widthInPixels, n);
- swaps (&size->heightInPixels, n);
- swaps (&size->widthInMillimeters, n);
- swaps (&size->heightInMillimeters, n);
- }
- size++;
- if (has_rate)
- {
- *rates = pSize->nRatesInUse;
- if (client->swapped)
- {
- swaps (rates, n);
- }
- rates++;
- for (j = 0; j < pSize->nRates; j++)
- {
- RRScreenRatePtr pRate = &pSize->pRates[j];
- if (pRate->referenced)
- {
- *rates = pRate->rate;
- if (client->swapped)
- {
- swaps (rates, n);
- }
- rates++;
- }
- }
- }
- }
- }
- data8 = (CARD8 *) rates;
-
- if (data8 - (CARD8 *) extra != extraLen)
- FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n",
- (unsigned long)(data8 - (CARD8 *) extra), extraLen);
- rep.length = (extraLen + 3) >> 2;
- }
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.timestamp, n);
- swaps(&rep.rotation, n);
- swaps(&rep.nSizes, n);
- swaps(&rep.sizeID, n);
- swaps(&rep.rate, n);
- swaps(&rep.nrateEnts, n);
- }
- WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep);
- if (extraLen)
- {
- WriteToClient (client, extraLen, (char *) extra);
- xfree (extra);
- }
- return (client->noClientException);
-}
-
-static int
-ProcRRSetScreenConfig (ClientPtr client)
-{
- REQUEST(xRRSetScreenConfigReq);
- xRRSetScreenConfigReply rep;
- DrawablePtr pDraw;
- int n;
- ScreenPtr pScreen;
- rrScrPrivPtr pScrPriv;
- TimeStamp configTime;
- TimeStamp time;
- RRScreenSizePtr pSize;
- int i;
- Rotation rotation;
- int rate;
- short oldWidth, oldHeight;
- Bool has_rate;
-
- UpdateCurrentTime ();
-
- if (RRClientKnowsRates (client))
- {
- REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
- has_rate = TRUE;
- }
- else
- {
- REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
- has_rate = FALSE;
- }
-
- SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client,
- SecurityWriteAccess);
-
- pScreen = pDraw->pScreen;
-
- pScrPriv= rrGetScrPriv(pScreen);
-
- time = ClientTimeToServerTime(stuff->timestamp);
- configTime = ClientTimeToServerTime(stuff->configTimestamp);
-
- oldWidth = pScreen->width;
- oldHeight = pScreen->height;
-
- if (!pScrPriv)
- {
- time = currentTime;
- rep.status = RRSetConfigFailed;
- goto sendReply;
- }
- if (!RRGetInfo (pScreen))
- return BadAlloc;
-
- /*
- * if the client's config timestamp is not the same as the last config
- * timestamp, then the config information isn't up-to-date and
- * can't even be validated
- */
- if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0)
- {
- rep.status = RRSetConfigInvalidConfigTime;
- goto sendReply;
- }
-
- /*
- * Search for the requested size
- */
- pSize = 0;
- for (i = 0; i < pScrPriv->nSizes; i++)
- {
- pSize = &pScrPriv->pSizes[i];
- if (pSize->referenced && pSize->id == stuff->sizeID)
- {
- break;
- }
- }
- if (i == pScrPriv->nSizes)
- {
- /*
- * Invalid size ID
- */
- client->errorValue = stuff->sizeID;
- return BadValue;
- }
-
- /*
- * Validate requested rotation
- */
- rotation = (Rotation) stuff->rotation;
-
- /* test the rotation bits only! */
- switch (rotation & 0xf) {
- case RR_Rotate_0:
- case RR_Rotate_90:
- case RR_Rotate_180:
- case RR_Rotate_270:
- break;
- default:
- /*
- * Invalid rotation
- */
- client->errorValue = stuff->rotation;
- return BadValue;
- }
-
- if ((~pScrPriv->rotations) & rotation)
- {
- /*
- * requested rotation or reflection not supported by screen
- */
- client->errorValue = stuff->rotation;
- return BadMatch;
- }
-
- /*
- * Validate requested refresh
- */
- if (has_rate)
- rate = (int) stuff->rate;
- else
- rate = 0;
-
- if (rate)
- {
- for (i = 0; i < pSize->nRates; i++)
- {
- RRScreenRatePtr pRate = &pSize->pRates[i];
- if (pRate->referenced && pRate->rate == rate)
- break;
- }
- if (i == pSize->nRates)
- {
- /*
- * Invalid rate
- */
- client->errorValue = rate;
- return BadValue;
- }
- }
-
- /*
- * Make sure the requested set-time is not older than
- * the last set-time
- */
- if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0)
- {
- rep.status = RRSetConfigInvalidTime;
- goto sendReply;
- }
-
- /*
- * call out to ddx routine to effect the change
- */
- if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate,
- pSize))
- {
- /*
- * unknown DDX failure, report to client
- */
- rep.status = RRSetConfigFailed;
- goto sendReply;
- }
-
- /*
- * set current extension configuration pointers
- */
- RRSetCurrentConfig (pScreen, rotation, rate, pSize);
-
- /*
- * Deliver ScreenChangeNotify events whenever
- * the configuration is updated
- */
- WalkTree (pScreen, TellChanged, (pointer) pScreen);
-
- /*
- * Deliver ConfigureNotify events when root changes
- * pixel size
- */
- if (oldWidth != pScreen->width || oldHeight != pScreen->height)
- RRSendConfigNotify (pScreen);
- RREditConnectionInfo (pScreen);
-
- /*
- * Fix pointer bounds and location
- */
- ScreenRestructured (pScreen);
- pScrPriv->lastSetTime = time;
-
- /*
- * Report Success
- */
- rep.status = RRSetConfigSuccess;
-
-sendReply:
-
- rep.type = X_Reply;
- /* rep.status has already been filled in */
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
- rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds;
- rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.newTimestamp, n);
- swapl(&rep.newConfigTimestamp, n);
- swapl(&rep.root, n);
- }
- WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep);
-
- return (client->noClientException);
-}
-
-static int
-ProcRRSelectInput (ClientPtr client)
-{
- REQUEST(xRRSelectInputReq);
- rrClientPriv(client);
- RRTimesPtr pTimes;
- WindowPtr pWin;
- RREventPtr pRREvent, pNewRREvent, *pHead;
- XID clientResource;
-
- REQUEST_SIZE_MATCH(xRRSelectInputReq);
- pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess);
- if (!pWin)
- return BadWindow;
- pHead = (RREventPtr *)SecurityLookupIDByType(client,
- pWin->drawable.id, EventType,
- SecurityWriteAccess);
-
- if (stuff->enable & (RRScreenChangeNotifyMask))
- {
- ScreenPtr pScreen = pWin->drawable.pScreen;
- rrScrPriv (pScreen);
-
- if (pHead)
- {
- /* check for existing entry. */
- for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
- if (pRREvent->client == client)
- return Success;
- }
-
- /* build the entry */
- pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec));
- if (!pNewRREvent)
- return BadAlloc;
- pNewRREvent->next = 0;
- pNewRREvent->client = client;
- pNewRREvent->window = pWin;
- pNewRREvent->mask = stuff->enable;
- /*
- * add a resource that will be deleted when
- * the client goes away
- */
- clientResource = FakeClientID (client->index);
- pNewRREvent->clientResource = clientResource;
- if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent))
- return BadAlloc;
- /*
- * create a resource to contain a pointer to the list
- * of clients selecting input. This must be indirect as
- * the list may be arbitrarily rearranged which cannot be
- * done through the resource database.
- */
- if (!pHead)
- {
- pHead = (RREventPtr *) xalloc (sizeof (RREventPtr));
- if (!pHead ||
- !AddResource (pWin->drawable.id, EventType, (pointer)pHead))
- {
- FreeResource (clientResource, RT_NONE);
- return BadAlloc;
- }
- *pHead = 0;
- }
- pNewRREvent->next = *pHead;
- *pHead = pNewRREvent;
- /*
- * Now see if the client needs an event
- */
- if (pScrPriv)
- {
- pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum];
- if (CompareTimeStamps (pTimes->setTime,
- pScrPriv->lastSetTime) != 0 ||
- CompareTimeStamps (pTimes->configTime,
- pScrPriv->lastConfigTime) != 0)
- {
- TellChanged (pWin, (pointer) pScreen);
- }
- }
- }
- else if (stuff->enable == xFalse)
- {
- /* delete the interest */
- if (pHead) {
- pNewRREvent = 0;
- for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) {
- if (pRREvent->client == client)
- break;
- pNewRREvent = pRREvent;
- }
- if (pRREvent) {
- FreeResource (pRREvent->clientResource, ClientType);
- if (pNewRREvent)
- pNewRREvent->next = pRREvent->next;
- else
- *pHead = pRREvent->next;
- xfree (pRREvent);
- }
- }
- }
- else
- {
- client->errorValue = stuff->enable;
- return BadValue;
- }
- return Success;
-}
-
-
-static int
-ProcRRDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_RRQueryVersion:
- return ProcRRQueryVersion(client);
- case X_RRSetScreenConfig:
- return ProcRRSetScreenConfig(client);
- case X_RRSelectInput:
- return ProcRRSelectInput(client);
- case X_RRGetScreenInfo:
- return ProcRRGetScreenInfo(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcRRQueryVersion (ClientPtr client)
-{
- register int n;
- REQUEST(xRRQueryVersionReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
- return ProcRRQueryVersion(client);
-}
-
-static int
-SProcRRGetScreenInfo (ClientPtr client)
-{
- register int n;
- REQUEST(xRRGetScreenInfoReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- return ProcRRGetScreenInfo(client);
-}
-
-static int
-SProcRRSetScreenConfig (ClientPtr client)
-{
- register int n;
- REQUEST(xRRSetScreenConfigReq);
-
- if (RRClientKnowsRates (client))
- {
- REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
- swaps (&stuff->rate, n);
- }
- else
- {
- REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
- }
-
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->timestamp, n);
- swaps(&stuff->sizeID, n);
- swaps(&stuff->rotation, n);
- return ProcRRSetScreenConfig(client);
-}
-
-static int
-SProcRRSelectInput (ClientPtr client)
-{
- register int n;
- REQUEST(xRRSelectInputReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- return ProcRRSelectInput(client);
-}
-
-
-static int
-SProcRRDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_RRQueryVersion:
- return SProcRRQueryVersion(client);
- case X_RRSetScreenConfig:
- return SProcRRSetScreenConfig(client);
- case X_RRSelectInput:
- return SProcRRSelectInput(client);
- case X_RRGetScreenInfo:
- return SProcRRGetScreenInfo(client);
- default:
- return BadRequest;
- }
-}
-
-
-static Bool
-RRScreenSizeMatches (RRScreenSizePtr a,
- RRScreenSizePtr b)
-{
- if (a->width != b->width)
- return FALSE;
- if (a->height != b->height)
- return FALSE;
- if (a->mmWidth != b->mmWidth)
- return FALSE;
- if (a->mmHeight != b->mmHeight)
- return FALSE;
- return TRUE;
-}
-
-RRScreenSizePtr
-RRRegisterSize (ScreenPtr pScreen,
- short width,
- short height,
- short mmWidth,
- short mmHeight)
-{
- rrScrPriv (pScreen);
- int i;
- RRScreenSize tmp;
- RRScreenSizePtr pNew;
-
- if (!pScrPriv)
- return 0;
-
- tmp.width = width;
- tmp.height= height;
- tmp.mmWidth = mmWidth;
- tmp.mmHeight = mmHeight;
- tmp.pRates = 0;
- tmp.nRates = 0;
- tmp.nRatesInUse = 0;
- tmp.referenced = TRUE;
- tmp.oldReferenced = FALSE;
- for (i = 0; i < pScrPriv->nSizes; i++)
- if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i]))
- {
- pScrPriv->pSizes[i].referenced = TRUE;
- return &pScrPriv->pSizes[i];
- }
- pNew = xrealloc (pScrPriv->pSizes,
- (pScrPriv->nSizes + 1) * sizeof (RRScreenSize));
- if (!pNew)
- return 0;
- pNew[pScrPriv->nSizes++] = tmp;
- pScrPriv->pSizes = pNew;
- return &pNew[pScrPriv->nSizes-1];
-}
-
-Bool RRRegisterRate (ScreenPtr pScreen,
- RRScreenSizePtr pSize,
- int rate)
-{
- rrScrPriv(pScreen);
- int i;
- RRScreenRatePtr pNew, pRate;
-
- if (!pScrPriv)
- return FALSE;
-
- for (i = 0; i < pSize->nRates; i++)
- {
- pRate = &pSize->pRates[i];
- if (pRate->rate == rate)
- {
- pRate->referenced = TRUE;
- return TRUE;
- }
- }
-
- pNew = xrealloc (pSize->pRates,
- (pSize->nRates + 1) * sizeof (RRScreenRate));
- if (!pNew)
- return FALSE;
- pRate = &pNew[pSize->nRates++];
- pRate->rate = rate;
- pRate->referenced = TRUE;
- pRate->oldReferenced = FALSE;
- pSize->pRates = pNew;
- return TRUE;
-}
-
-void
-RRSetCurrentConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize)
-{
- rrScrPriv (pScreen);
-
- if (!pScrPriv)
- return;
-
- pScrPriv->rotation = rotation;
- pScrPriv->size = pSize - pScrPriv->pSizes;
- pScrPriv->rate = rate;
-}
diff --git a/randr/randrstr.h b/randr/randrstr.h
deleted file mode 100644
index d966cd5b7..000000000
--- a/randr/randrstr.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/randr/randrstr.h,v 1.7 2002/10/14 18:01:42 keithp Exp $
- *
- * Copyright © 2000 Compaq Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Compaq makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * COMPAQ DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL COMPAQ BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _RANDRSTR_H_
-#define _RANDRSTR_H_
-
-#include "randr.h"
-
-typedef struct _rrScreenRate {
- int rate;
- Bool referenced;
- Bool oldReferenced;
-} RRScreenRate, *RRScreenRatePtr;
-
-typedef struct _rrScreenSize {
- int id;
- short width, height;
- short mmWidth, mmHeight;
- RRScreenRatePtr pRates;
- int nRates;
- int nRatesInUse;
- Bool referenced;
- Bool oldReferenced;
-} RRScreenSize, *RRScreenSizePtr;
-
-typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize);
-
-typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
-typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
-
-typedef struct _rrScrPriv {
- RRSetConfigProcPtr rrSetConfig;
- RRGetInfoProcPtr rrGetInfo;
-
- TimeStamp lastSetTime; /* last changed by client */
- TimeStamp lastConfigTime; /* possible configs changed */
- RRCloseScreenProcPtr CloseScreen;
-
- /*
- * Configuration information
- */
- Rotation rotations;
-
- int nSizes;
- int nSizesInUse;
- RRScreenSizePtr pSizes;
-
- /*
- * Current state
- */
- Rotation rotation;
- int size;
- int rate;
-} rrScrPrivRec, *rrScrPrivPtr;
-
-extern int rrPrivIndex;
-
-#define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr)
-#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
-#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
-
-/* Initialize the extension */
-void
-RRExtensionInit (void);
-
-/*
- * Then, register the specific size with the screen
- */
-
-RRScreenSizePtr
-RRRegisterSize (ScreenPtr pScreen,
- short width,
- short height,
- short mmWidth,
- short mmHeight);
-
-Bool RRRegisterRate (ScreenPtr pScreen,
- RRScreenSizePtr pSize,
- int rate);
-
-/*
- * Finally, set the current configuration of the screen
- */
-
-void
-RRSetCurrentConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize);
-
-Bool RRScreenInit(ScreenPtr pScreen);
-
-Bool
-miRandRInit (ScreenPtr pScreen);
-
-Bool
-miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
-
-Bool
-miRRSetConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr size);
-
-Bool
-miRRGetScreenInfo (ScreenPtr pScreen);
-
-#endif /* _RANDRSTR_H_ */
diff --git a/record/record.c b/record/record.c
deleted file mode 100644
index 3657ef42b..000000000
--- a/record/record.c
+++ /dev/null
@@ -1,3048 +0,0 @@
-/* $Xorg: record.c,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */
-
-/*
-
-Copyright 1995, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-Author: David P. Wiggins, The Open Group
-
-This work benefited from earlier work done by Martha Zimet of NCD
-and Jim Haggerty of Metheus.
-
-*/
-/* $XFree86: xc/programs/Xserver/record/record.c,v 1.12 2003/11/17 22:20:44 dawes Exp $ */
-
-#define NEED_EVENTS
-#include "dixstruct.h"
-#include "extnsionst.h"
-#define _XRECORD_SERVER_
-#include "recordstr.h"
-#include "set.h"
-
-#ifndef XFree86LOADER
-#include <stdio.h>
-#include <assert.h>
-#else
-#include "xf86_ansic.h"
-#endif
-
-#ifdef PANORAMIX
-#include "globals.h"
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#include "cursor.h"
-#endif
-
-static RESTYPE RTContext; /* internal resource type for Record contexts */
-static int RecordErrorBase; /* first Record error number */
-
-/* How many bytes of protocol data to buffer in a context. Don't set to less
- * than 32.
- */
-#define REPLY_BUF_SIZE 1024
-
-/* Record Context structure */
-
-typedef struct {
- XID id; /* resource id of context */
- ClientPtr pRecordingClient; /* client that has context enabled */
- struct _RecordClientsAndProtocolRec *pListOfRCAP; /* all registered info */
- ClientPtr pBufClient; /* client whose protocol is in replyBuffer*/
- unsigned int continuedReply:1; /* recording a reply that is split up? */
- char elemHeaders; /* element header flags (time/seq no.) */
- char bufCategory; /* category of protocol in replyBuffer */
- int numBufBytes; /* number of bytes in replyBuffer */
- char replyBuffer[REPLY_BUF_SIZE]; /* buffered recorded protocol */
-} RecordContextRec, *RecordContextPtr;
-
-/* RecordMinorOpRec - to hold minor opcode selections for extension requests
- * and replies
- */
-
-typedef union {
- int count; /* first element of array: how many "major" structs to follow */
- struct { /* rest of array elements are this */
- short first; /* first major opcode */
- short last; /* last major opcode */
- RecordSetPtr pMinOpSet; /* minor opcode set for above major range */
- } major;
-} RecordMinorOpRec, *RecordMinorOpPtr;
-
-
-/* RecordClientsAndProtocolRec, nicknamed RCAP - holds all the client and
- * protocol selections passed in a single CreateContext or RegisterClients.
- * Generally, a context will have one of these from the create and an
- * additional one for each RegisterClients. RCAPs are freed when all their
- * clients are unregistered.
- */
-
-typedef struct _RecordClientsAndProtocolRec {
- RecordContextPtr pContext; /* context that owns this RCAP */
- struct _RecordClientsAndProtocolRec *pNextRCAP; /* next RCAP on context */
- RecordSetPtr pRequestMajorOpSet; /* requests to record */
- RecordMinorOpPtr pRequestMinOpInfo; /* extension requests to record */
- RecordSetPtr pReplyMajorOpSet; /* replies to record */
- RecordMinorOpPtr pReplyMinOpInfo; /* extension replies to record */
- RecordSetPtr pDeviceEventSet; /* device events to record */
- RecordSetPtr pDeliveredEventSet; /* delivered events to record */
- RecordSetPtr pErrorSet; /* errors to record */
- XID * pClientIDs; /* array of clients to record */
- short numClients; /* number of clients in pClientIDs */
- short sizeClients; /* size of pClientIDs array */
- unsigned int clientStarted:1; /* record new client connections? */
- unsigned int clientDied:1; /* record client disconnections? */
- unsigned int clientIDsSeparatelyAllocated:1; /* pClientIDs malloced? */
-} RecordClientsAndProtocolRec, *RecordClientsAndProtocolPtr;
-
-/* how much bigger to make pRCAP->pClientIDs when reallocing */
-#define CLIENT_ARRAY_GROWTH_INCREMENT 4
-
-/* counts the total number of RCAPs belonging to enabled contexts. */
-static int numEnabledRCAPs;
-
-/* void VERIFY_CONTEXT(RecordContextPtr, XID, ClientPtr)
- * In the spirit of the VERIFY_* macros in dix.h, this macro fills in
- * the context pointer if the given ID is a valid Record Context, else it
- * returns an error.
- */
-#define VERIFY_CONTEXT(_pContext, _contextid, _client) { \
- (_pContext) = (RecordContextPtr)LookupIDByType((_contextid), RTContext); \
- if (!(_pContext)) { \
- (_client)->errorValue = (_contextid); \
- return RecordErrorBase + XRecordBadContext; \
- } \
-}
-
-static int RecordDeleteContext(
- pointer /*value*/,
- XID /*id*/
-);
-
-
-/***************************************************************************/
-
-/* client private stuff */
-
-/* To make declarations less obfuscated, have a typedef for a pointer to a
- * Proc function.
- */
-typedef int (*ProcFunctionPtr)(
- ClientPtr /*pClient*/
-);
-
-/* Record client private. Generally a client only has one of these if
- * any of its requests are being recorded.
- */
-typedef struct {
-/* ptr to client's proc vector before Record stuck its nose in */
- ProcFunctionPtr *originalVector;
-
-/* proc vector with pointers for recorded requests redirected to the
- * function RecordARequest
- */
- ProcFunctionPtr recordVector[256];
-} RecordClientPrivateRec, *RecordClientPrivatePtr;
-
-static int RecordClientPrivateIndex;
-
-/* RecordClientPrivatePtr RecordClientPrivate(ClientPtr)
- * gets the client private of the given client. Syntactic sugar.
- */
-#define RecordClientPrivate(_pClient) (RecordClientPrivatePtr) \
- ((_pClient)->devPrivates[RecordClientPrivateIndex].ptr)
-
-
-/***************************************************************************/
-
-/* global list of all contexts */
-
-static RecordContextPtr *ppAllContexts;
-
-static int numContexts;/* number of contexts in ppAllContexts */
-
-/* number of currently enabled contexts. All enabled contexts are bunched
- * up at the front of the ppAllContexts array, from ppAllContexts[0] to
- * ppAllContexts[numEnabledContexts-1], to eliminate time spent skipping
- * past disabled contexts.
- */
-static int numEnabledContexts;
-
-/* RecordFindContextOnAllContexts
- *
- * Arguments:
- * pContext is the context to search for.
- *
- * Returns:
- * The index into the array ppAllContexts at which pContext is stored.
- * If pContext is not found in ppAllContexts, returns -1.
- *
- * Side Effects: none.
- */
-static int
-RecordFindContextOnAllContexts(pContext)
- RecordContextPtr pContext;
-{
- int i;
-
- assert(numContexts >= numEnabledContexts);
- for (i = 0; i < numContexts; i++)
- {
- if (ppAllContexts[i] == pContext)
- return i;
- }
- return -1;
-} /* RecordFindContextOnAllContexts */
-
-
-/***************************************************************************/
-
-/* RecordFlushReplyBuffer
- *
- * Arguments:
- * pContext is the context to flush.
- * data1 is a pointer to additional data, and len1 is its length in bytes.
- * data2 is a pointer to additional data, and len2 is its length in bytes.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * If the context is enabled, any buffered (recorded) protocol is written
- * to the recording client, and the number of buffered bytes is set to
- * zero. If len1 is not zero, data1/len1 are then written to the
- * recording client, and similarly for data2/len2 (written after
- * data1/len1).
- */
-static void
-RecordFlushReplyBuffer(
- RecordContextPtr pContext,
- pointer data1,
- int len1,
- pointer data2,
- int len2
-)
-{
- if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone)
- return;
- if (pContext->numBufBytes)
- WriteToClient(pContext->pRecordingClient, pContext->numBufBytes,
- (char *)pContext->replyBuffer);
- pContext->numBufBytes = 0;
- if (len1)
- WriteToClient(pContext->pRecordingClient, len1, (char *)data1);
- if (len2)
- WriteToClient(pContext->pRecordingClient, len2, (char *)data2);
-} /* RecordFlushReplyBuffer */
-
-
-/* RecordAProtocolElement
- *
- * Arguments:
- * pContext is the context that is recording a protocol element.
- * pClient is the client whose protocol is being recorded. For
- * device events and EndOfData, pClient is NULL.
- * category is the category of the protocol element, as defined
- * by the RECORD spec.
- * data is a pointer to the protocol data, and datalen is its length
- * in bytes.
- * futurelen is the number of bytes that will be sent in subsequent
- * calls to this function to complete this protocol element.
- * In those subsequent calls, futurelen will be -1 to indicate
- * that the current data is a continuation of the same protocol
- * element.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The context may be flushed. The new protocol element will be
- * added to the context's protocol buffer with appropriate element
- * headers prepended (sequence number and timestamp). If the data
- * is continuation data (futurelen == -1), element headers won't
- * be added. If the protocol element and headers won't fit in
- * the context's buffer, it is sent directly to the recording
- * client (after any buffered data).
- */
-static void
-RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
- int category, pointer data, int datalen, int futurelen)
-{
- CARD32 elemHeaderData[2];
- int numElemHeaders = 0;
- Bool recordingClientSwapped = pContext->pRecordingClient->swapped;
- int n;
- CARD32 serverTime = 0;
- Bool gotServerTime = FALSE;
- int replylen;
-
- if (futurelen >= 0)
- { /* start of new protocol element */
- xRecordEnableContextReply *pRep = (xRecordEnableContextReply *)
- pContext->replyBuffer;
- if (pContext->pBufClient != pClient ||
- pContext->bufCategory != category)
- {
- RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
- pContext->pBufClient = pClient;
- pContext->bufCategory = category;
- }
-
- if (!pContext->numBufBytes)
- {
- serverTime = GetTimeInMillis();
- gotServerTime = TRUE;
- pRep->type = X_Reply;
- pRep->category = category;
- pRep->sequenceNumber = pContext->pRecordingClient->sequence;
- pRep->length = 0;
- pRep->elementHeader = pContext->elemHeaders;
- pRep->serverTime = serverTime;
- if (pClient)
- {
- pRep->clientSwapped =
- (pClient->swapped != recordingClientSwapped);
- pRep->idBase = pClient->clientAsMask;
- pRep->recordedSequenceNumber = pClient->sequence;
- }
- else /* it's a device event, StartOfData, or EndOfData */
- {
- pRep->clientSwapped = (category != XRecordFromServer) &&
- recordingClientSwapped;
- pRep->idBase = 0;
- pRep->recordedSequenceNumber = 0;
- }
-
- if (recordingClientSwapped)
- {
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->idBase, n);
- swapl(&pRep->serverTime, n);
- swapl(&pRep->recordedSequenceNumber, n);
- }
- pContext->numBufBytes = SIZEOF(xRecordEnableContextReply);
- }
-
- /* generate element headers if needed */
-
- if ( ( (pContext->elemHeaders & XRecordFromClientTime)
- && category == XRecordFromClient)
- ||
- ( (pContext->elemHeaders & XRecordFromServerTime)
- && category == XRecordFromServer))
- {
- if (gotServerTime)
- elemHeaderData[numElemHeaders] = serverTime;
- else
- elemHeaderData[numElemHeaders] = GetTimeInMillis();
- if (recordingClientSwapped)
- swapl(&elemHeaderData[numElemHeaders], n);
- numElemHeaders++;
- }
-
- if ( (pContext->elemHeaders & XRecordFromClientSequence)
- &&
- (category == XRecordFromClient || category == XRecordClientDied))
- {
- elemHeaderData[numElemHeaders] = pClient->sequence;
- if (recordingClientSwapped)
- swapl(&elemHeaderData[numElemHeaders], n);
- numElemHeaders++;
- }
-
- /* adjust reply length */
-
- replylen = pRep->length;
- if (recordingClientSwapped) swapl(&replylen, n);
- replylen += numElemHeaders + (datalen >> 2) + (futurelen >> 2);
- if (recordingClientSwapped) swapl(&replylen, n);
- pRep->length = replylen;
- } /* end if not continued reply */
-
- numElemHeaders *= 4;
-
- /* if space available >= space needed, buffer the data */
-
- if (REPLY_BUF_SIZE - pContext->numBufBytes >= datalen + numElemHeaders)
- {
- if (numElemHeaders)
- {
- memcpy(pContext->replyBuffer + pContext->numBufBytes,
- elemHeaderData, numElemHeaders);
- pContext->numBufBytes += numElemHeaders;
- }
- if (datalen)
- {
- memcpy(pContext->replyBuffer + pContext->numBufBytes,
- data, datalen);
- pContext->numBufBytes += datalen;
- }
- }
- else
- RecordFlushReplyBuffer(pContext, (pointer)elemHeaderData,
- numElemHeaders, (pointer)data, datalen);
-
-} /* RecordAProtocolElement */
-
-
-/* RecordFindClientOnContext
- *
- * Arguments:
- * pContext is the context to search.
- * clientspec is the resource ID mask identifying the client to search
- * for, or XRecordFutureClients.
- * pposition is a pointer to an int, or NULL. See Returns.
- *
- * Returns:
- * The RCAP on which clientspec was found, or NULL if not found on
- * any RCAP on the given context.
- * If pposition was not NULL and the returned RCAP is not NULL,
- * *pposition will be set to the index into the returned the RCAP's
- * pClientIDs array that holds clientspec.
- *
- * Side Effects: none.
- */
-static RecordClientsAndProtocolPtr
-RecordFindClientOnContext(
- RecordContextPtr pContext,
- XID clientspec,
- int *pposition
-)
-{
- RecordClientsAndProtocolPtr pRCAP;
-
- for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP)
- {
- int i;
- for (i = 0; i < pRCAP->numClients; i++)
- {
- if (pRCAP->pClientIDs[i] == clientspec)
- {
- if (pposition)
- *pposition = i;
- return pRCAP;
- }
- }
- }
- return NULL;
-} /* RecordFindClientOnContext */
-
-
-/* RecordABigRequest
- *
- * Arguments:
- * pContext is the recording context.
- * client is the client being recorded.
- * stuff is a pointer to the big request of client (see the Big Requests
- * extension for details.)
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The big request is recorded with the correct length field re-inserted.
- *
- * Note: this function exists mainly to make RecordARequest smaller.
- */
-static void
-RecordABigRequest(pContext, client, stuff)
- RecordContextPtr pContext;
- ClientPtr client;
- xReq *stuff;
-{
- CARD32 bigLength;
- char n;
- int bytesLeft;
-
- /* note: client->req_len has been frobbed by ReadRequestFromClient
- * (os/io.c) to discount the extra 4 bytes taken by the extended length
- * field in a big request. The actual request length to record is
- * client->req_len + 1 (measured in CARD32s).
- */
-
- /* record the request header */
- bytesLeft = client->req_len << 2;
- RecordAProtocolElement(pContext, client, XRecordFromClient,
- (pointer)stuff, SIZEOF(xReq), bytesLeft);
-
- /* reinsert the extended length field that was squished out */
- bigLength = client->req_len + (sizeof(bigLength) >> 2);
- if (client->swapped)
- swapl(&bigLength, n);
- RecordAProtocolElement(pContext, client, XRecordFromClient,
- (pointer)&bigLength, sizeof(bigLength), /* continuation */ -1);
- bytesLeft -= sizeof(bigLength);
-
- /* record the rest of the request after the length */
- RecordAProtocolElement(pContext, client, XRecordFromClient,
- (pointer)(stuff + 1), bytesLeft, /* continuation */ -1);
-} /* RecordABigRequest */
-
-
-/* RecordARequest
- *
- * Arguments:
- * client is a client that the server has dispatched a request to by
- * calling client->requestVector[request opcode] .
- * The request is in client->requestBuffer.
- *
- * Returns:
- * Whatever is returned by the "real" Proc function for this request.
- * The "real" Proc function is the function that was in
- * client->requestVector[request opcode] before it was replaced by
- * RecordARequest. (See the function RecordInstallHooks.)
- *
- * Side Effects:
- * The request is recorded by all contexts that have registered this
- * request for this client. The real Proc function is called.
- */
-static int
-RecordARequest(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- RecordClientsAndProtocolPtr pRCAP;
- int i;
- RecordClientPrivatePtr pClientPriv;
- REQUEST(xReq);
- int majorop;
-
- majorop = stuff->reqType;
- for (i = 0; i < numEnabledContexts; i++)
- {
- pContext = ppAllContexts[i];
- pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask,
- NULL);
- if (pRCAP && pRCAP->pRequestMajorOpSet &&
- RecordIsMemberOfSet(pRCAP->pRequestMajorOpSet, majorop))
- {
- if (majorop <= 127)
- { /* core request */
-
- if (stuff->length == 0)
- RecordABigRequest(pContext, client, stuff);
- else
- RecordAProtocolElement(pContext, client, XRecordFromClient,
- (pointer)stuff, client->req_len << 2, 0);
- }
- else /* extension, check minor opcode */
- {
- int minorop = MinorOpcodeOfRequest(client);
- int numMinOpInfo;
- RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo;
-
- assert (pMinorOpInfo);
- numMinOpInfo = pMinorOpInfo->count;
- pMinorOpInfo++;
- assert (numMinOpInfo);
- for ( ; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++)
- {
- if (majorop >= pMinorOpInfo->major.first &&
- majorop <= pMinorOpInfo->major.last &&
- RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet,
- minorop))
- {
- if (stuff->length == 0)
- RecordABigRequest(pContext, client, stuff);
- else
- RecordAProtocolElement(pContext, client,
- XRecordFromClient, (pointer)stuff,
- client->req_len << 2, 0);
- break;
- }
- } /* end for each minor op info */
- } /* end extension request */
- } /* end this RCAP wants this major opcode */
- } /* end for each context */
- pClientPriv = RecordClientPrivate(client);
- assert(pClientPriv);
- return (* pClientPriv->originalVector[majorop])(client);
-} /* RecordARequest */
-
-
-/* RecordASkippedRequest
- *
- * Arguments:
- * pcbl is &SkippedRequestCallback.
- * nulldata is NULL.
- * calldata is a pointer to a SkippedRequestInfoRec (include/os.h)
- * which provides information about requests that the server is
- * skipping. The client's proc vector won't be called for skipped
- * requests, so that's why we have to catch them here.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The skipped requests are recorded by all contexts that have
- * registered those requests for this client.
- *
- * Note: most servers don't skip requests, so calls to this will probably
- * be rare. For more information on skipped requests, search for
- * the word skip in ddx.tbl.ms (the porting layer document).
- */
-static void
-RecordASkippedRequest(pcbl , nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
-{
- SkippedRequestInfoRec *psi = (SkippedRequestInfoRec *)calldata;
- RecordContextPtr pContext;
- RecordClientsAndProtocolPtr pRCAP;
- xReqPtr stuff = psi->req;
- ClientPtr client = psi->client;
- int numSkippedRequests = psi->numskipped;
- int reqlen;
- int i;
- int majorop;
-
- while (numSkippedRequests--)
- {
- majorop = stuff->reqType;
- reqlen = ReqLen(stuff, client);
- /* handle big request */
- if (stuff->length == 0)
- reqlen += 4;
- for (i = 0; i < numEnabledContexts; i++)
- {
- pContext = ppAllContexts[i];
- pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask,
- NULL);
- if (pRCAP && pRCAP->pRequestMajorOpSet &&
- RecordIsMemberOfSet(pRCAP->pRequestMajorOpSet, majorop))
- {
- if (majorop <= 127)
- { /* core request */
-
- RecordAProtocolElement(pContext, client, XRecordFromClient,
- (pointer)stuff, reqlen, 0);
- }
- else /* extension, check minor opcode */
- {
- int minorop = MinorOpcodeOfRequest(client);
- int numMinOpInfo;
- RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo;
-
- assert (pMinorOpInfo);
- numMinOpInfo = pMinorOpInfo->count;
- pMinorOpInfo++;
- assert (numMinOpInfo);
- for ( ; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++)
- {
- if (majorop >= pMinorOpInfo->major.first &&
- majorop <= pMinorOpInfo->major.last &&
- RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet,
- minorop))
- {
- RecordAProtocolElement(pContext, client,
- XRecordFromClient, (pointer)stuff,
- reqlen, 0);
- break;
- }
- } /* end for each minor op info */
- } /* end extension request */
- } /* end this RCAP wants this major opcode */
- } /* end for each context */
-
- /* go to next request */
- stuff = (xReqPtr)( ((char *)stuff) + reqlen);
-
- } /* end for each skipped request */
-} /* RecordASkippedRequest */
-
-
-/* RecordAReply
- *
- * Arguments:
- * pcbl is &ReplyCallback.
- * nulldata is NULL.
- * calldata is a pointer to a ReplyInfoRec (include/os.h)
- * which provides information about replies that are being sent
- * to clients.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The reply is recorded by all contexts that have registered this
- * reply type for this client. If more data belonging to the same
- * reply is expected, and if the reply is being recorded by any
- * context, pContext->continuedReply is set to 1.
- * If pContext->continuedReply was already 1 and this is the last
- * chunk of data belonging to this reply, it is set to 0.
- */
-static void
-RecordAReply(pcbl, nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
-{
- RecordContextPtr pContext;
- RecordClientsAndProtocolPtr pRCAP;
- int eci;
- int majorop;
- ReplyInfoRec *pri = (ReplyInfoRec *)calldata;
- ClientPtr client = pri->client;
- REQUEST(xReq);
-
- majorop = stuff->reqType;
- for (eci = 0; eci < numEnabledContexts; eci++)
- {
- pContext = ppAllContexts[eci];
- pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask,
- NULL);
- if (pRCAP)
- {
- if (pContext->continuedReply)
- {
- RecordAProtocolElement(pContext, client, XRecordFromServer,
- pri->replyData, pri->dataLenBytes, /* continuation */ -1);
- if (!pri->bytesRemaining)
- pContext->continuedReply = 0;
- }
- else if (pri->startOfReply && pRCAP->pReplyMajorOpSet &&
- RecordIsMemberOfSet(pRCAP->pReplyMajorOpSet, majorop))
- {
- if (majorop <= 127)
- { /* core reply */
- RecordAProtocolElement(pContext, client, XRecordFromServer,
- pri->replyData, pri->dataLenBytes, pri->bytesRemaining);
- if (pri->bytesRemaining)
- pContext->continuedReply = 1;
- }
- else /* extension, check minor opcode */
- {
- int minorop = MinorOpcodeOfRequest(client);
- int numMinOpInfo;
- RecordMinorOpPtr pMinorOpInfo = pRCAP->pReplyMinOpInfo;
- assert (pMinorOpInfo);
- numMinOpInfo = pMinorOpInfo->count;
- pMinorOpInfo++;
- assert (numMinOpInfo);
- for ( ; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++)
- {
- if (majorop >= pMinorOpInfo->major.first &&
- majorop <= pMinorOpInfo->major.last &&
- RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet,
- minorop))
- {
- RecordAProtocolElement(pContext, client,
- XRecordFromServer, pri->replyData,
- pri->dataLenBytes, pri->bytesRemaining);
- if (pri->bytesRemaining)
- pContext->continuedReply = 1;
- break;
- }
- } /* end for each minor op info */
- } /* end extension reply */
- } /* end continued reply vs. start of reply */
- } /* end client is registered on this context */
- } /* end for each context */
-} /* RecordAReply */
-
-
-/* RecordADeliveredEventOrError
- *
- * Arguments:
- * pcbl is &EventCallback.
- * nulldata is NULL.
- * calldata is a pointer to a EventInfoRec (include/dix.h)
- * which provides information about events that are being sent
- * to clients.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The event or error is recorded by all contexts that have registered
- * it for this client.
- */
-static void
-RecordADeliveredEventOrError(pcbl, nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
-{
- EventInfoRec *pei = (EventInfoRec *)calldata;
- RecordContextPtr pContext;
- RecordClientsAndProtocolPtr pRCAP;
- int eci; /* enabled context index */
- ClientPtr pClient = pei->client;
-
- for (eci = 0; eci < numEnabledContexts; eci++)
- {
- pContext = ppAllContexts[eci];
- pRCAP = RecordFindClientOnContext(pContext, pClient->clientAsMask,
- NULL);
- if (pRCAP && (pRCAP->pDeliveredEventSet || pRCAP->pErrorSet))
- {
- int ev; /* event index */
- xEvent *pev = pei->events;
- for (ev = 0; ev < pei->count; ev++, pev++)
- {
- int recordit;
- if (pev->u.u.type == X_Error)
- {
- recordit = RecordIsMemberOfSet(pRCAP->pErrorSet,
- ((xError *)(pev))->errorCode);
- }
- else
- {
- recordit = RecordIsMemberOfSet(pRCAP->pDeliveredEventSet,
- pev->u.u.type & 0177);
- }
- if (recordit)
- {
- xEvent swappedEvent;
- xEvent *pEvToRecord = pev;
-
- if (pClient->swapped)
- {
- (*EventSwapVector[pev->u.u.type & 0177])
- (pev, &swappedEvent);
- pEvToRecord = &swappedEvent;
-
- }
- RecordAProtocolElement(pContext, pClient,
- XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0);
- }
- } /* end for each event */
- } /* end this client is on this context */
- } /* end for each enabled context */
-} /* RecordADeliveredEventOrError */
-
-
-/* RecordADeviceEvent
- *
- * Arguments:
- * pcbl is &DeviceEventCallback.
- * nulldata is NULL.
- * calldata is a pointer to a DeviceEventInfoRec (include/dix.h)
- * which provides information about device events that occur.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The device event is recorded by all contexts that have registered
- * it for this client.
- */
-static void
-RecordADeviceEvent(pcbl, nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
-{
- DeviceEventInfoRec *pei = (DeviceEventInfoRec *)calldata;
- RecordContextPtr pContext;
- RecordClientsAndProtocolPtr pRCAP;
- int eci; /* enabled context index */
-
- for (eci = 0; eci < numEnabledContexts; eci++)
- {
- pContext = ppAllContexts[eci];
- for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP)
- {
- if (pRCAP->pDeviceEventSet)
- {
- int ev; /* event index */
- xEvent *pev = pei->events;
- for (ev = 0; ev < pei->count; ev++, pev++)
- {
- if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
- pev->u.u.type & 0177))
- {
- xEvent swappedEvent;
- xEvent *pEvToRecord = pev;
-#ifdef PANORAMIX
- xEvent shiftedEvent;
-
- if (!noPanoramiXExtension &&
- (pev->u.u.type == MotionNotify ||
- pev->u.u.type == ButtonPress ||
- pev->u.u.type == ButtonRelease ||
- pev->u.u.type == KeyPress ||
- pev->u.u.type == KeyRelease)) {
- int scr = XineramaGetCursorScreen();
- memcpy(&shiftedEvent, pev, sizeof(xEvent));
- shiftedEvent.u.keyButtonPointer.rootX +=
- panoramiXdataPtr[scr].x -
- panoramiXdataPtr[0].x;
- shiftedEvent.u.keyButtonPointer.rootY +=
- panoramiXdataPtr[scr].y -
- panoramiXdataPtr[0].y;
- pEvToRecord = &shiftedEvent;
- }
-#endif /* PANORAMIX */
-
- if (pContext->pRecordingClient->swapped)
- {
- (*EventSwapVector[pEvToRecord->u.u.type & 0177])
- (pEvToRecord, &swappedEvent);
- pEvToRecord = &swappedEvent;
- }
-
- RecordAProtocolElement(pContext, NULL,
- XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0);
- /* make sure device events get flushed in the absence
- * of other client activity
- */
- SetCriticalOutputPending();
- }
- } /* end for each event */
- } /* end this RCAP selects device events */
- } /* end for each RCAP on this context */
- } /* end for each enabled context */
-} /* RecordADeviceEvent */
-
-
-/* RecordFlushAllContexts
- *
- * Arguments:
- * pcbl is &FlushCallback.
- * nulldata and calldata are NULL.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * All buffered reply data of all enabled contexts is written to
- * the recording clients.
- */
-static void
-RecordFlushAllContexts(
- CallbackListPtr *pcbl,
- pointer nulldata,
- pointer calldata
-)
-{
- int eci; /* enabled context index */
- RecordContextPtr pContext;
-
- for (eci = 0; eci < numEnabledContexts; eci++)
- {
- pContext = ppAllContexts[eci];
-
- /* In most cases we leave it to RecordFlushReplyBuffer to make
- * this check, but this function could be called very often, so we
- * check before calling hoping to save the function call cost
- * most of the time.
- */
- if (pContext->numBufBytes)
- RecordFlushReplyBuffer(ppAllContexts[eci], NULL, 0, NULL, 0);
- }
-} /* RecordFlushAllContexts */
-
-
-/* RecordInstallHooks
- *
- * Arguments:
- * pRCAP is an RCAP on an enabled or being-enabled context.
- * oneclient can be zero or the resource ID mask identifying a client.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * Recording hooks needed by RCAP are installed.
- * If oneclient is zero, recording hooks needed for all clients and
- * protocol on the RCAP are installed. If oneclient is non-zero,
- * only those hooks needed for the specified client are installed.
- *
- * Client requestVectors may be altered. numEnabledRCAPs will be
- * incremented if oneclient == 0. Callbacks may be added to
- * various callback lists.
- */
-static int
-RecordInstallHooks(pRCAP, oneclient)
- RecordClientsAndProtocolPtr pRCAP;
- XID oneclient;
-{
- int i = 0;
- XID client;
-
- if (oneclient)
- client = oneclient;
- else
- client = pRCAP->numClients ? pRCAP->pClientIDs[i++] : 0;
-
- while (client)
- {
- if (client != XRecordFutureClients)
- {
- if (pRCAP->pRequestMajorOpSet)
- {
- RecordSetIteratePtr pIter = NULL;
- RecordSetInterval interval;
- ClientPtr pClient = clients[CLIENT_ID(client)];
-
- if (pClient && !RecordClientPrivate(pClient))
- {
- RecordClientPrivatePtr pClientPriv;
- /* no Record proc vector; allocate one */
- pClientPriv = (RecordClientPrivatePtr)
- xalloc(sizeof(RecordClientPrivateRec));
- if (!pClientPriv)
- return BadAlloc;
- /* copy old proc vector to new */
- memcpy(pClientPriv->recordVector, pClient->requestVector,
- sizeof (pClientPriv->recordVector));
- pClientPriv->originalVector = pClient->requestVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr =
- (pointer)pClientPriv;
- pClient->requestVector = pClientPriv->recordVector;
- }
- while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet,
- pIter, &interval)))
- {
- unsigned int j;
- for (j = interval.first; j <= interval.last; j++)
- pClient->requestVector[j] = RecordARequest;
- }
- }
- }
- if (oneclient)
- client = 0;
- else
- client = (i < pRCAP->numClients) ? pRCAP->pClientIDs[i++] : 0;
- }
-
- assert(numEnabledRCAPs >= 0);
- if (!oneclient && ++numEnabledRCAPs == 1)
- { /* we're enabling the first context */
- if (!AddCallback(&EventCallback, RecordADeliveredEventOrError, NULL))
- return BadAlloc;
- if (!AddCallback(&DeviceEventCallback, RecordADeviceEvent, NULL))
- return BadAlloc;
- if (!AddCallback(&ReplyCallback, RecordAReply, NULL))
- return BadAlloc;
- if (!AddCallback(&SkippedRequestsCallback, RecordASkippedRequest,
- NULL))
- return BadAlloc;
- if (!AddCallback(&FlushCallback, RecordFlushAllContexts, NULL))
- return BadAlloc;
- /* Alternate context flushing scheme: delete the line above
- * and call RegisterBlockAndWakeupHandlers here passing
- * RecordFlushAllContexts. Is this any better?
- */
- }
- return Success;
-} /* RecordInstallHooks */
-
-
-/* RecordUninstallHooks
- *
- * Arguments:
- * pRCAP is an RCAP on an enabled or being-disabled context.
- * oneclient can be zero or the resource ID mask identifying a client.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Recording hooks needed by RCAP may be uninstalled.
- * If oneclient is zero, recording hooks needed for all clients and
- * protocol on the RCAP may be uninstalled. If oneclient is non-zero,
- * only those hooks needed for the specified client may be uninstalled.
- *
- * Client requestVectors may be altered. numEnabledRCAPs will be
- * decremented if oneclient == 0. Callbacks may be deleted from
- * various callback lists.
- */
-static void
-RecordUninstallHooks(pRCAP, oneclient)
- RecordClientsAndProtocolPtr pRCAP;
- XID oneclient;
-{
- int i = 0;
- XID client;
-
- if (oneclient)
- client = oneclient;
- else
- client = pRCAP->numClients ? pRCAP->pClientIDs[i++] : 0;
-
- while (client)
- {
- if (client != XRecordFutureClients)
- {
- if (pRCAP->pRequestMajorOpSet)
- {
- ClientPtr pClient = clients[CLIENT_ID(client)];
- int c;
- Bool otherRCAPwantsProcVector = FALSE;
- RecordClientPrivatePtr pClientPriv =
- RecordClientPrivate(pClient);
-
- assert (pClient && RecordClientPrivate(pClient));
- memcpy(pClientPriv->recordVector, pClientPriv->originalVector,
- sizeof (pClientPriv->recordVector));
-
- for (c = 0; c < numEnabledContexts; c++)
- {
- RecordClientsAndProtocolPtr pOtherRCAP;
- RecordContextPtr pContext = ppAllContexts[c];
-
- if (pContext == pRCAP->pContext) continue;
- pOtherRCAP = RecordFindClientOnContext(pContext, client,
- NULL);
- if (pOtherRCAP && pOtherRCAP->pRequestMajorOpSet)
- {
- RecordSetIteratePtr pIter = NULL;
- RecordSetInterval interval;
-
- otherRCAPwantsProcVector = TRUE;
- while ((pIter = RecordIterateSet(
- pOtherRCAP->pRequestMajorOpSet,
- pIter, &interval)))
- {
- unsigned int j;
- for (j = interval.first; j <= interval.last; j++)
- pClient->requestVector[j] = RecordARequest;
- }
- }
- }
- if (!otherRCAPwantsProcVector)
- { /* nobody needs it, so free it */
- pClient->requestVector = pClientPriv->originalVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr = NULL;
- xfree(pClientPriv);
- }
- } /* end if this RCAP specifies any requests */
- } /* end if not future clients */
- if (oneclient)
- client = 0;
- else
- client = (i < pRCAP->numClients) ? pRCAP->pClientIDs[i++] : 0;
- }
-
- assert(numEnabledRCAPs >= 1);
- if (!oneclient && --numEnabledRCAPs == 0)
- { /* we're disabling the last context */
- DeleteCallback(&EventCallback, RecordADeliveredEventOrError, NULL);
- DeleteCallback(&DeviceEventCallback, RecordADeviceEvent, NULL);
- DeleteCallback(&ReplyCallback, RecordAReply, NULL);
- DeleteCallback(&SkippedRequestsCallback, RecordASkippedRequest, NULL);
- DeleteCallback(&FlushCallback, RecordFlushAllContexts, NULL);
- /* Alternate context flushing scheme: delete the line above
- * and call RemoveBlockAndWakeupHandlers here passing
- * RecordFlushAllContexts. Is this any better?
- */
- /* Having deleted the callback, call it one last time. -gildea */
- RecordFlushAllContexts(&FlushCallback, NULL, NULL);
- }
-} /* RecordUninstallHooks */
-
-
-/* RecordDeleteClientFromRCAP
- *
- * Arguments:
- * pRCAP is an RCAP to delete the client from.
- * position is the index into the array pRCAP->pClientIDs of the
- * client to delete.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Recording hooks needed by client will be uninstalled if the context
- * is enabled. The designated client will be removed from the
- * pRCAP->pClientIDs array. If it was the only client on the RCAP,
- * the RCAP is removed from the context and freed. (Invariant: RCAPs
- * have at least one client.)
- */
-static void
-RecordDeleteClientFromRCAP(pRCAP, position)
- RecordClientsAndProtocolPtr pRCAP;
- int position;
-{
- if (pRCAP->pContext->pRecordingClient)
- RecordUninstallHooks(pRCAP, pRCAP->pClientIDs[position]);
- if (position != pRCAP->numClients - 1)
- pRCAP->pClientIDs[position] = pRCAP->pClientIDs[pRCAP->numClients - 1];
- if (--pRCAP->numClients == 0)
- { /* no more clients; remove RCAP from context's list */
- RecordContextPtr pContext = pRCAP->pContext;
- if (pContext->pRecordingClient)
- RecordUninstallHooks(pRCAP, 0);
- if (pContext->pListOfRCAP == pRCAP)
- pContext->pListOfRCAP = pRCAP->pNextRCAP;
- else
- {
- RecordClientsAndProtocolPtr prevRCAP;
- for (prevRCAP = pContext->pListOfRCAP;
- prevRCAP->pNextRCAP != pRCAP;
- prevRCAP = prevRCAP->pNextRCAP)
- ;
- prevRCAP->pNextRCAP = pRCAP->pNextRCAP;
- }
- /* free the RCAP */
- if (pRCAP->clientIDsSeparatelyAllocated)
- xfree(pRCAP->pClientIDs);
- xfree(pRCAP);
- }
-} /* RecordDeleteClientFromRCAP */
-
-
-/* RecordAddClientToRCAP
- *
- * Arguments:
- * pRCAP is an RCAP to add the client to.
- * clientspec is the resource ID mask identifying a client, or
- * XRecordFutureClients.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Recording hooks needed by client will be installed if the context
- * is enabled. The designated client will be added to the
- * pRCAP->pClientIDs array, which may be realloced.
- * pRCAP->clientIDsSeparatelyAllocated may be set to 1 if there
- * is no more room to hold clients internal to the RCAP.
- */
-static void
-RecordAddClientToRCAP(pRCAP, clientspec)
- RecordClientsAndProtocolPtr pRCAP;
- XID clientspec;
-{
- if (pRCAP->numClients == pRCAP->sizeClients)
- {
- if (pRCAP->clientIDsSeparatelyAllocated)
- {
- XID *pNewIDs = (XID *)xrealloc(pRCAP->pClientIDs,
- (pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) *
- sizeof(XID));
- if (!pNewIDs)
- return;
- pRCAP->pClientIDs = pNewIDs;
- pRCAP->sizeClients += CLIENT_ARRAY_GROWTH_INCREMENT;
- }
- else
- {
- XID *pNewIDs = (XID *)xalloc((pRCAP->sizeClients +
- CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID));
- if (!pNewIDs)
- return;
- memcpy(pNewIDs, pRCAP->pClientIDs, pRCAP->numClients *sizeof(XID));
- pRCAP->pClientIDs = pNewIDs;
- pRCAP->sizeClients += CLIENT_ARRAY_GROWTH_INCREMENT;
- pRCAP->clientIDsSeparatelyAllocated = 1;
- }
- }
- pRCAP->pClientIDs[pRCAP->numClients++] = clientspec;
- if (pRCAP->pContext->pRecordingClient)
- RecordInstallHooks(pRCAP, clientspec);
-} /* RecordDeleteClientFromRCAP */
-
-
-/* RecordDeleteClientFromContext
- *
- * Arguments:
- * pContext is the context to delete from.
- * clientspec is the resource ID mask identifying a client, or
- * XRecordFutureClients.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * If clientspec is on any RCAP of the context, it is deleted from that
- * RCAP. (A given clientspec can only be on one RCAP of a context.)
- */
-static void
-RecordDeleteClientFromContext(pContext, clientspec)
- RecordContextPtr pContext;
- XID clientspec;
-{
- RecordClientsAndProtocolPtr pRCAP;
- int position;
-
- if ((pRCAP = RecordFindClientOnContext(pContext, clientspec, &position)))
- RecordDeleteClientFromRCAP(pRCAP, position);
-} /* RecordDeleteClientFromContext */
-
-
-/* RecordSanityCheckClientSpecifiers
- *
- * Arguments:
- * clientspecs is an array of alleged CLIENTSPECs passed by the client.
- * nspecs is the number of elements in clientspecs.
- * errorspec, if non-zero, is the resource id base of a client that
- * must not appear in clienspecs.
- *
- * Returns: BadMatch if any of the clientspecs are invalid, else Success.
- *
- * Side Effects: none.
- */
-static int
-RecordSanityCheckClientSpecifiers(clientspecs, nspecs, errorspec)
- XID *clientspecs;
- int nspecs;
- XID errorspec;
-{
- int i;
- int clientIndex;
-
- for (i = 0; i < nspecs; i++)
- {
- if (clientspecs[i] == XRecordCurrentClients ||
- clientspecs[i] == XRecordFutureClients ||
- clientspecs[i] == XRecordAllClients)
- continue;
- if (errorspec && (CLIENT_BITS(clientspecs[i]) == errorspec) )
- return BadMatch;
- clientIndex = CLIENT_ID(clientspecs[i]);
- if (clientIndex && clients[clientIndex] &&
- clients[clientIndex]->clientState == ClientStateRunning)
- {
- if (clientspecs[i] == clients[clientIndex]->clientAsMask)
- continue;
- if (!LookupIDByClass(clientspecs[i], RC_ANY))
- return BadMatch;
- }
- else
- return BadMatch;
- }
- return Success;
-} /* RecordSanityCheckClientSpecifiers */
-
-
-/* RecordCanonicalizeClientSpecifiers
- *
- * Arguments:
- * pClientspecs is an array of CLIENTSPECs that have been sanity
- * checked.
- * pNumClientspecs is a pointer to the number of elements in pClientspecs.
- * excludespec, if non-zero, is the resource id base of a client that
- * should not be included in the expansion of XRecordAllClients or
- * XRecordCurrentClients.
- *
- * Returns:
- * A pointer to an array of CLIENTSPECs that is the same as the
- * passed array with the following modifications:
- * - all but the client id bits of resource IDs are stripped off.
- * - duplicates removed.
- * - XRecordAllClients expanded to a list of all currently connected
- * clients + XRecordFutureClients - excludespec (if non-zero)
- * - XRecordCurrentClients expanded to a list of all currently
- * connected clients - excludespec (if non-zero)
- * The returned array may be the passed array modified in place, or
- * it may be an Xalloc'ed array. The caller should keep a pointer to the
- * original array and free the returned array if it is different.
- *
- * *pNumClientspecs is set to the number of elements in the returned
- * array.
- *
- * Side Effects:
- * pClientspecs may be modified in place.
- */
-static XID *
-RecordCanonicalizeClientSpecifiers(pClientspecs, pNumClientspecs, excludespec)
- XID *pClientspecs;
- int *pNumClientspecs;
- XID excludespec;
-{
- int i;
- int numClients = *pNumClientspecs;
-
- /* first pass strips off the resource index bits, leaving just the
- * client id bits. This makes searching for a particular client simpler
- * (and faster.)
- */
- for (i = 0; i < numClients; i++)
- {
- XID cs = pClientspecs[i];
- if (cs > XRecordAllClients)
- pClientspecs[i] = CLIENT_BITS(cs);
- }
-
- for (i = 0; i < numClients; i++)
- {
- if (pClientspecs[i] == XRecordAllClients ||
- pClientspecs[i] == XRecordCurrentClients)
- { /* expand All/Current */
- int j, nc;
- XID *pCanon = (XID *)xalloc(sizeof(XID) * (currentMaxClients + 1));
- if (!pCanon) return NULL;
- for (nc = 0, j = 1; j < currentMaxClients; j++)
- {
- ClientPtr client = clients[j];
- if (client != NullClient &&
- client->clientState == ClientStateRunning &&
- client->clientAsMask != excludespec)
- {
- pCanon[nc++] = client->clientAsMask;
- }
- }
- if (pClientspecs[i] == XRecordAllClients)
- pCanon[nc++] = XRecordFutureClients;
- *pNumClientspecs = nc;
- return pCanon;
- }
- else /* not All or Current */
- {
- int j;
- for (j = i + 1; j < numClients; )
- {
- if (pClientspecs[i] == pClientspecs[j])
- {
- pClientspecs[j] = pClientspecs[--numClients];
- }
- else
- j++;
- }
- }
- } /* end for each clientspec */
- *pNumClientspecs = numClients;
- return pClientspecs;
-} /* RecordCanonicalizeClientSpecifiers */
-
-
-/****************************************************************************/
-
-/* stuff for RegisterClients */
-
-/* RecordPadAlign
- *
- * Arguments:
- * size is the number of bytes taken by an object.
- * align is a byte boundary (e.g. 4, 8)
- *
- * Returns:
- * the number of pad bytes to add at the end of an object of the
- * given size so that an object placed immediately behind it will
- * begin on an <align>-byte boundary.
- *
- * Side Effects: none.
- */
-static int
-RecordPadAlign(int size, int align)
-{
- return (align - (size & (align - 1))) & (align - 1);
-} /* RecordPadAlign */
-
-
-/* RecordSanityCheckRegisterClients
- *
- * Arguments:
- * pContext is the context being registered on.
- * client is the client that issued a RecordCreateContext or
- * RecordRegisterClients request.
- * stuff is a pointer to the request.
- *
- * Returns:
- * Any one of several possible error values if any of the request
- * arguments are invalid. Success if everything is OK.
- *
- * Side Effects: none.
- */
-static int
-RecordSanityCheckRegisterClients(pContext, client, stuff)
- RecordContextPtr pContext;
- ClientPtr client;
- xRecordRegisterClientsReq *stuff;
-{
- int err;
- xRecordRange *pRange;
- int i;
- XID recordingClient;
-
- if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) !=
- 4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges)
- return BadLength;
-
- if (stuff->elementHeader &
- ~(XRecordFromClientSequence|XRecordFromClientTime|XRecordFromServerTime))
- {
- client->errorValue = stuff->elementHeader;
- return BadValue;
- }
-
- recordingClient = pContext->pRecordingClient ?
- pContext->pRecordingClient->clientAsMask : 0;
- err = RecordSanityCheckClientSpecifiers((XID *)&stuff[1], stuff->nClients,
- recordingClient);
- if (err != Success) return err;
-
- pRange = (xRecordRange *)(((XID *)&stuff[1]) + stuff->nClients);
- for (i = 0; i < stuff->nRanges; i++, pRange++)
- {
- if (pRange->coreRequestsFirst > pRange->coreRequestsLast)
- {
- client->errorValue = pRange->coreRequestsFirst;
- return BadValue;
- }
- if (pRange->coreRepliesFirst > pRange->coreRepliesLast)
- {
- client->errorValue = pRange->coreRepliesFirst;
- return BadValue;
- }
- if ((pRange->extRequestsMajorFirst || pRange->extRequestsMajorLast) &&
- (pRange->extRequestsMajorFirst < 128 ||
- pRange->extRequestsMajorLast < 128 ||
- pRange->extRequestsMajorFirst > pRange->extRequestsMajorLast))
- {
- client->errorValue = pRange->extRequestsMajorFirst;
- return BadValue;
- }
- if (pRange->extRequestsMinorFirst > pRange->extRequestsMinorLast)
- {
- client->errorValue = pRange->extRequestsMinorFirst;
- return BadValue;
- }
- if ((pRange->extRepliesMajorFirst || pRange->extRepliesMajorLast) &&
- (pRange->extRepliesMajorFirst < 128 ||
- pRange->extRepliesMajorLast < 128 ||
- pRange->extRepliesMajorFirst > pRange->extRepliesMajorLast))
- {
- client->errorValue = pRange->extRepliesMajorFirst;
- return BadValue;
- }
- if (pRange->extRepliesMinorFirst > pRange->extRepliesMinorLast)
- {
- client->errorValue = pRange->extRepliesMinorFirst;
- return BadValue;
- }
- if ((pRange->deliveredEventsFirst || pRange->deliveredEventsLast) &&
- (pRange->deliveredEventsFirst < 2 ||
- pRange->deliveredEventsLast < 2 ||
- pRange->deliveredEventsFirst > pRange->deliveredEventsLast))
- {
- client->errorValue = pRange->deliveredEventsFirst;
- return BadValue;
- }
- if ((pRange->deviceEventsFirst || pRange->deviceEventsLast) &&
- (pRange->deviceEventsFirst < 2 ||
- pRange->deviceEventsLast < 2 ||
- pRange->deviceEventsFirst > pRange->deviceEventsLast))
- {
- client->errorValue = pRange->deviceEventsFirst;
- return BadValue;
- }
- if (pRange->errorsFirst > pRange->errorsLast)
- {
- client->errorValue = pRange->errorsFirst;
- return BadValue;
- }
- if (pRange->clientStarted != xFalse && pRange->clientStarted != xTrue)
- {
- client->errorValue = pRange->clientStarted;
- return BadValue;
- }
- if (pRange->clientDied != xFalse && pRange->clientDied != xTrue)
- {
- client->errorValue = pRange->clientDied;
- return BadValue;
- }
- } /* end for each range */
- return Success;
-} /* end RecordSanityCheckRegisterClients */
-
-/* This is a tactical structure used to gather information about all the sets
- * (RecordSetPtr) that need to be created for an RCAP in the process of
- * digesting a list of RECORDRANGEs (converting it to the internal
- * representation).
- */
-typedef struct
-{
- int nintervals; /* number of intervals in following array */
- RecordSetInterval *intervals; /* array of intervals for this set */
- int size; /* size of intevals array; >= nintervals */
- int align; /* alignment restriction for set */
- int offset; /* where to store set pointer rel. to start of RCAP */
- short first, last; /* if for extension, major opcode interval */
-} SetInfoRec, *SetInfoPtr;
-
-/* These constant are used to index into an array of SetInfoRec. */
-enum {REQ, /* set info for requests */
- REP, /* set info for replies */
- ERR, /* set info for errors */
- DEV, /* set info for device events */
- DLEV, /* set info for delivered events */
- PREDEFSETS}; /* number of predefined array entries */
-
-
-/* RecordAllocIntervals
- *
- * Arguments:
- * psi is a pointer to a SetInfoRec whose intervals pointer is NULL.
- * nIntervals is the desired size of the intervals array.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * If Success is returned, psi->intervals is a pointer to size
- * RecordSetIntervals, all zeroed, and psi->size is set to size.
- */
-static int
-RecordAllocIntervals(psi, nIntervals)
- SetInfoPtr psi;
- int nIntervals;
-{
- assert(!psi->intervals);
- psi->intervals = (RecordSetInterval *)
- xalloc(nIntervals * sizeof(RecordSetInterval));
- if (!psi->intervals)
- return BadAlloc;
- bzero(psi->intervals, nIntervals * sizeof(RecordSetInterval));
- psi->size = nIntervals;
- return Success;
-} /* end RecordAllocIntervals */
-
-
-/* RecordConvertRangesToIntervals
- *
- * Arguments:
- * psi is a pointer to the SetInfoRec we are building.
- * pRanges is an array of xRecordRanges.
- * nRanges is the number of elements in pRanges.
- * byteoffset is the offset from the start of an xRecordRange of the
- * two bytes (1 for first, 1 for last) we are interested in.
- * pExtSetInfo, if non-NULL, indicates that the two bytes mentioned
- * above are followed by four bytes (2 for first, 2 for last)
- * representing a minor opcode range, and this information should be
- * stored in one of the SetInfoRecs starting at pExtSetInfo.
- * pnExtSetInfo is the number of elements in the pExtSetInfo array.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * The slice of pRanges indicated by byteoffset is stored in psi.
- * If pExtSetInfo is non-NULL, minor opcode intervals are stored
- * in an existing SetInfoRec if the major opcode interval matches, else
- * they are stored in a new SetInfoRec, and *pnExtSetInfo is
- * increased accordingly.
- */
-static int
-RecordConvertRangesToIntervals(
- SetInfoPtr psi,
- xRecordRange *pRanges,
- int nRanges,
- int byteoffset,
- SetInfoPtr pExtSetInfo,
- int *pnExtSetInfo
-)
-{
- int i;
- CARD8 *pCARD8;
- int first, last;
- int err;
-
- for (i = 0; i < nRanges; i++, pRanges++)
- {
- pCARD8 = ((CARD8 *)pRanges) + byteoffset;
- first = pCARD8[0];
- last = pCARD8[1];
- if (first || last)
- {
- if (!psi->intervals)
- {
- err = RecordAllocIntervals(psi, 2 * (nRanges - i));
- if (err != Success)
- return err;
- }
- psi->intervals[psi->nintervals].first = first;
- psi->intervals[psi->nintervals].last = last;
- psi->nintervals++;
- assert(psi->nintervals <= psi->size);
- if (pExtSetInfo)
- {
- SetInfoPtr pesi = pExtSetInfo;
- CARD16 *pCARD16 = (CARD16 *)(pCARD8 + 2);
- int j;
-
- for (j = 0; j < *pnExtSetInfo; j++, pesi++)
- {
- if ( (first == pesi->first) && (last == pesi->last) )
- break;
- }
- if (j == *pnExtSetInfo)
- {
- err = RecordAllocIntervals(pesi, 2 * (nRanges - i));
- if (err != Success)
- return err;
- pesi->first = first;
- pesi->last = last;
- (*pnExtSetInfo)++;
- }
- pesi->intervals[pesi->nintervals].first = pCARD16[0];
- pesi->intervals[pesi->nintervals].last = pCARD16[1];
- pesi->nintervals++;
- assert(pesi->nintervals <= pesi->size);
- }
- }
- }
- return Success;
-} /* end RecordConvertRangesToIntervals */
-
-#define offset_of(_structure, _field) \
- ((char *)(& (_structure . _field)) - (char *)(&_structure))
-
-/* RecordRegisterClients
- *
- * Arguments:
- * pContext is the context on which to register the clients.
- * client is the client that issued the RecordCreateContext or
- * RecordRegisterClients request.
- * stuff is a pointer to the request.
- *
- * Returns:
- * Any one of several possible error values defined by the protocol.
- * Success if everything is OK.
- *
- * Side Effects:
- * If different element headers are specified, the context is flushed.
- * If any of the specified clients are already registered on the
- * context, they are first unregistered. A new RCAP is created to
- * hold the specified protocol and clients, and it is linked onto the
- * context. If the context is enabled, appropriate hooks are installed
- * to record the new clients and protocol.
- */
-static int
-RecordRegisterClients(pContext, client, stuff)
- RecordContextPtr pContext;
- ClientPtr client;
- xRecordRegisterClientsReq *stuff;
-{
- int err;
- int i;
- SetInfoPtr si;
- int maxSets;
- int nExtReqSets = 0;
- int nExtRepSets = 0;
- int extReqSetsOffset = 0;
- int extRepSetsOffset = 0;
- SetInfoPtr pExtReqSets, pExtRepSets;
- int clientListOffset;
- XID *pCanonClients;
- int clientStarted = 0, clientDied = 0;
- xRecordRange *pRanges, rr;
- int nClients;
- int sizeClients;
- int totRCAPsize;
- RecordClientsAndProtocolPtr pRCAP;
- int pad;
- XID recordingClient;
-
- /* do all sanity checking up front */
-
- err = RecordSanityCheckRegisterClients(pContext, client, stuff);
- if (err != Success)
- return err;
-
- /* if element headers changed, flush buffer */
-
- if (pContext->elemHeaders != stuff->elementHeader)
- {
- RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
- pContext->elemHeaders = stuff->elementHeader;
- }
-
- nClients = stuff->nClients;
- if (!nClients)
- /* if empty clients list, we're done. */
- return Success;
-
- recordingClient = pContext->pRecordingClient ?
- pContext->pRecordingClient->clientAsMask : 0;
- pCanonClients = RecordCanonicalizeClientSpecifiers((XID *)&stuff[1],
- &nClients, recordingClient);
- if (!pCanonClients)
- return BadAlloc;
-
- /* We may have to create as many as one set for each "predefined"
- * protocol types, plus one per range for extension reuests, plus one per
- * range for extension replies.
- */
- maxSets = PREDEFSETS + 2 * stuff->nRanges;
- si = (SetInfoPtr)ALLOCATE_LOCAL(sizeof(SetInfoRec) * maxSets);
- if (!si)
- {
- err = BadAlloc;
- goto bailout;
- }
- bzero(si, sizeof(SetInfoRec) * maxSets);
-
- /* theoretically you must do this because NULL may not be all-bits-zero */
- for (i = 0; i < maxSets; i++)
- si[i].intervals = NULL;
-
- pExtReqSets = si + PREDEFSETS;
- pExtRepSets = pExtReqSets + stuff->nRanges;
-
- pRanges = (xRecordRange *)(((XID *)&stuff[1]) + stuff->nClients);
-
- err = RecordConvertRangesToIntervals(&si[REQ], pRanges, stuff->nRanges,
- offset_of(rr, coreRequestsFirst), NULL, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[REQ], pRanges, stuff->nRanges,
- offset_of(rr, extRequestsMajorFirst), pExtReqSets, &nExtReqSets);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[REP], pRanges, stuff->nRanges,
- offset_of(rr, coreRepliesFirst), NULL, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[REP], pRanges, stuff->nRanges,
- offset_of(rr, extRepliesMajorFirst), pExtRepSets, &nExtRepSets);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[ERR], pRanges, stuff->nRanges,
- offset_of(rr, errorsFirst), NULL, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[DLEV], pRanges, stuff->nRanges,
- offset_of(rr, deliveredEventsFirst), NULL, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertRangesToIntervals(&si[DEV], pRanges, stuff->nRanges,
- offset_of(rr, deviceEventsFirst), NULL, NULL);
- if (err != Success) goto bailout;
-
- /* collect client-started and client-died */
-
- for (i = 0; i < stuff->nRanges; i++)
- {
- if (pRanges[i].clientStarted) clientStarted = TRUE;
- if (pRanges[i].clientDied) clientDied = TRUE;
- }
-
- /* We now have all the information collected to create all the sets,
- * and we can compute the total memory required for the RCAP.
- */
-
- totRCAPsize = sizeof(RecordClientsAndProtocolRec);
-
- /* leave a little room to grow before forcing a separate allocation */
- sizeClients = nClients + CLIENT_ARRAY_GROWTH_INCREMENT;
- pad = RecordPadAlign(totRCAPsize, sizeof(XID));
- clientListOffset = totRCAPsize + pad;
- totRCAPsize += pad + sizeClients * sizeof(XID);
-
- if (nExtReqSets)
- {
- pad = RecordPadAlign(totRCAPsize, sizeof(RecordSetPtr));
- extReqSetsOffset = totRCAPsize + pad;
- totRCAPsize += pad + (nExtReqSets + 1) * sizeof(RecordMinorOpRec);
- }
- if (nExtRepSets)
- {
- pad = RecordPadAlign(totRCAPsize, sizeof(RecordSetPtr));
- extRepSetsOffset = totRCAPsize + pad;
- totRCAPsize += pad + (nExtRepSets + 1) * sizeof(RecordMinorOpRec);
- }
-
- for (i = 0; i < maxSets; i++)
- {
- if (si[i].nintervals)
- {
- si[i].size = RecordSetMemoryRequirements(
- si[i].intervals, si[i].nintervals, &si[i].align);
- pad = RecordPadAlign(totRCAPsize, si[i].align);
- si[i].offset = pad + totRCAPsize;
- totRCAPsize += pad + si[i].size;
- }
- }
-
- /* allocate memory for the whole RCAP */
-
- pRCAP = (RecordClientsAndProtocolPtr)xalloc(totRCAPsize);
- if (!pRCAP)
- {
- err = BadAlloc;
- goto bailout;
- }
-
- /* fill in the RCAP */
-
- pRCAP->pContext = pContext;
- pRCAP->pClientIDs = (XID *)((char *)pRCAP + clientListOffset);
- pRCAP->numClients = nClients;
- pRCAP->sizeClients = sizeClients;
- pRCAP->clientIDsSeparatelyAllocated = 0;
- for (i = 0; i < nClients; i++)
- {
- RecordDeleteClientFromContext(pContext, pCanonClients[i]);
- pRCAP->pClientIDs[i] = pCanonClients[i];
- }
-
- /* create all the sets */
-
- if (si[REQ].intervals)
- {
- pRCAP->pRequestMajorOpSet =
- RecordCreateSet(si[REQ].intervals, si[REQ].nintervals,
- (RecordSetPtr)((char *)pRCAP + si[REQ].offset), si[REQ].size);
- }
- else pRCAP->pRequestMajorOpSet = NULL;
-
- if (si[REP].intervals)
- {
- pRCAP->pReplyMajorOpSet =
- RecordCreateSet(si[REP].intervals, si[REP].nintervals,
- (RecordSetPtr)((char *)pRCAP + si[REP].offset), si[REP].size);
- }
- else pRCAP->pReplyMajorOpSet = NULL;
-
- if (si[ERR].intervals)
- {
- pRCAP->pErrorSet =
- RecordCreateSet(si[ERR].intervals, si[ERR].nintervals,
- (RecordSetPtr)((char *)pRCAP + si[ERR].offset), si[ERR].size);
- }
- else pRCAP->pErrorSet = NULL;
-
- if (si[DEV].intervals)
- {
- pRCAP->pDeviceEventSet =
- RecordCreateSet(si[DEV].intervals, si[DEV].nintervals,
- (RecordSetPtr)((char *)pRCAP + si[DEV].offset), si[DEV].size);
- }
- else pRCAP->pDeviceEventSet = NULL;
-
- if (si[DLEV].intervals)
- {
- pRCAP->pDeliveredEventSet =
- RecordCreateSet(si[DLEV].intervals, si[DLEV].nintervals,
- (RecordSetPtr)((char *)pRCAP + si[DLEV].offset), si[DLEV].size);
- }
- else pRCAP->pDeliveredEventSet = NULL;
-
- if (nExtReqSets)
- {
- pRCAP->pRequestMinOpInfo = (RecordMinorOpPtr)
- ((char *)pRCAP + extReqSetsOffset);
- pRCAP->pRequestMinOpInfo[0].count = nExtReqSets;
- for (i = 0; i < nExtReqSets; i++, pExtReqSets++)
- {
- pRCAP->pRequestMinOpInfo[i+1].major.first = pExtReqSets->first;
- pRCAP->pRequestMinOpInfo[i+1].major.last = pExtReqSets->last;
- pRCAP->pRequestMinOpInfo[i+1].major.pMinOpSet =
- RecordCreateSet(pExtReqSets->intervals,
- pExtReqSets->nintervals,
- (RecordSetPtr)((char *)pRCAP + pExtReqSets->offset),
- pExtReqSets->size);
- }
- }
- else pRCAP->pRequestMinOpInfo = NULL;
-
- if (nExtRepSets)
- {
- pRCAP->pReplyMinOpInfo = (RecordMinorOpPtr)
- ((char *)pRCAP + extRepSetsOffset);
- pRCAP->pReplyMinOpInfo[0].count = nExtRepSets;
- for (i = 0; i < nExtRepSets; i++, pExtRepSets++)
- {
- pRCAP->pReplyMinOpInfo[i+1].major.first = pExtRepSets->first;
- pRCAP->pReplyMinOpInfo[i+1].major.last = pExtRepSets->last;
- pRCAP->pReplyMinOpInfo[i+1].major.pMinOpSet =
- RecordCreateSet(pExtRepSets->intervals,
- pExtRepSets->nintervals,
- (RecordSetPtr)((char *)pRCAP + pExtRepSets->offset),
- pExtRepSets->size);
- }
- }
- else pRCAP->pReplyMinOpInfo = NULL;
-
- pRCAP->clientStarted = clientStarted;
- pRCAP->clientDied = clientDied;
-
- /* link the RCAP onto the context */
-
- pRCAP->pNextRCAP = pContext->pListOfRCAP;
- pContext->pListOfRCAP = pRCAP;
-
- if (pContext->pRecordingClient) /* context enabled */
- RecordInstallHooks(pRCAP, 0);
-
-bailout:
- if (si)
- {
- for (i = 0; i < maxSets; i++)
- if (si[i].intervals)
- xfree(si[i].intervals);
- DEALLOCATE_LOCAL(si);
- }
- if (pCanonClients && pCanonClients != (XID *)&stuff[1])
- xfree(pCanonClients);
- return err;
-} /* RecordRegisterClients */
-
-
-/* Proc functions all take a client argument, execute the request in
- * client->requestBuffer, and return a protocol error status.
- */
-
-static int
-ProcRecordQueryVersion(client)
- ClientPtr client;
-{
- /* REQUEST(xRecordQueryVersionReq); */
- xRecordQueryVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = RECORD_MAJOR_VERSION;
- rep.minorVersion = RECORD_MINOR_VERSION;
- if(client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- (void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
- (char *)&rep);
- return (client->noClientException);
-} /* ProcRecordQueryVersion */
-
-
-static int
-ProcRecordCreateContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordCreateContextReq);
- RecordContextPtr pContext;
- RecordContextPtr *ppNewAllContexts = NULL;
- int err = BadAlloc;
-
- REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
- LEGAL_NEW_RESOURCE(stuff->context, client);
-
- pContext = (RecordContextPtr)xalloc(sizeof(RecordContextRec));
- if (!pContext)
- goto bailout;
-
- /* make sure there is room in ppAllContexts to store the new context */
-
- ppNewAllContexts = (RecordContextPtr *)
- xrealloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
- if (!ppNewAllContexts)
- goto bailout;
- ppAllContexts = ppNewAllContexts;
-
- pContext->id = stuff->context;
- pContext->pRecordingClient = NULL;
- pContext->pListOfRCAP = NULL;
- pContext->elemHeaders = 0;
- pContext->bufCategory = 0;
- pContext->numBufBytes = 0;
- pContext->pBufClient = NULL;
- pContext->continuedReply = 0;
-
- err = RecordRegisterClients(pContext, client,
- (xRecordRegisterClientsReq *)stuff);
- if (err != Success)
- goto bailout;
-
- if (AddResource(pContext->id, RTContext, pContext))
- {
- ppAllContexts[numContexts++] = pContext;
- return Success;
- }
- else
- {
- RecordDeleteContext((pointer)pContext, pContext->id);
- err = BadAlloc;
- }
-bailout:
- if (pContext)
- xfree(pContext);
- return err;
-} /* ProcRecordCreateContext */
-
-
-static int
-ProcRecordRegisterClients(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- REQUEST(xRecordRegisterClientsReq);
-
- REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
- VERIFY_CONTEXT(pContext, stuff->context, client);
-
- return RecordRegisterClients(pContext, client, stuff);
-} /* ProcRecordRegisterClients */
-
-
-static int
-ProcRecordUnregisterClients(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- int err;
- REQUEST(xRecordUnregisterClientsReq);
- XID *pCanonClients;
- int nClients;
- int i;
-
- REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
- if ((client->req_len << 2) - SIZEOF(xRecordUnregisterClientsReq) !=
- 4 * stuff->nClients)
- return BadLength;
- VERIFY_CONTEXT(pContext, stuff->context, client);
- err = RecordSanityCheckClientSpecifiers((XID *)&stuff[1],
- stuff->nClients, 0);
- if (err != Success)
- return err;
-
- nClients = stuff->nClients;
- pCanonClients = RecordCanonicalizeClientSpecifiers((XID *)&stuff[1],
- &nClients, 0);
- if (!pCanonClients)
- return BadAlloc;
-
- for (i = 0; i < nClients; i++)
- {
- RecordDeleteClientFromContext(pContext, pCanonClients[i]);
- }
- if (pCanonClients != (XID *)&stuff[1])
- xfree(pCanonClients);
- return Success;
-} /* ProcRecordUnregisterClients */
-
-
-/****************************************************************************/
-
-/* stuff for GetContext */
-
-/* This is a tactical structure used to hold the xRecordRanges as they are
- * being reconstituted from the sets in the RCAPs.
- */
-
-typedef struct {
- xRecordRange *pRanges; /* array of xRecordRanges for one RCAP */
- int size; /* number of elements in pRanges, >= nRanges */
- int nRanges; /* number of occupied element of pRanges */
-} GetContextRangeInfoRec, *GetContextRangeInfoPtr;
-
-
-/* RecordAllocRanges
- *
- * Arguments:
- * pri is a pointer to a GetContextRangeInfoRec to allocate for.
- * nRanges is the number of xRecordRanges desired for pri.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * If Success is returned, pri->pRanges points to at least nRanges
- * ranges. pri->nRanges is set to nRanges. pri->size is the actual
- * number of ranges. Newly allocated ranges are zeroed.
- */
-static int
-RecordAllocRanges(pri, nRanges)
- GetContextRangeInfoPtr pri;
- int nRanges;
-{
- int newsize;
- xRecordRange *pNewRange;
-#define SZINCR 8
-
- newsize = max(pri->size + SZINCR, nRanges);
- pNewRange = (xRecordRange *)xrealloc(pri->pRanges,
- newsize * sizeof(xRecordRange));
- if (!pNewRange)
- return BadAlloc;
-
- pri->pRanges = pNewRange;
- pri->size = newsize;
- bzero(&pri->pRanges[pri->size - SZINCR], SZINCR * sizeof(xRecordRange));
- if (pri->nRanges < nRanges)
- pri->nRanges = nRanges;
- return Success;
-} /* RecordAllocRanges */
-
-
-/* RecordConvertSetToRanges
- *
- * Arguments:
- * pSet is the set to be converted.
- * pri is where the result should be stored.
- * byteoffset is the offset from the start of an xRecordRange of the
- * two vales (first, last) we are interested in.
- * card8 is TRUE if the vales are one byte each and FALSE if two bytes
- * each.
- * imax is the largest set value to store in pri->pRanges.
- * pStartIndex, if non-NULL, is the index of the first range in
- * pri->pRanges that should be stored to. If NULL,
- * start at index 0.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * If Success is returned, the slice of pri->pRanges indicated by
- * byteoffset and card8 is filled in with the intervals from pSet.
- * if pStartIndex was non-NULL, *pStartIndex is filled in with one
- * more than the index of the last xRecordRange that was touched.
- */
-static int
-RecordConvertSetToRanges(
- RecordSetPtr pSet,
- GetContextRangeInfoPtr pri,
- int byteoffset,
- Bool card8,
- unsigned int imax,
- int *pStartIndex
-)
-{
- int nRanges;
- RecordSetIteratePtr pIter = NULL;
- RecordSetInterval interval;
- CARD8 *pCARD8;
- CARD16 *pCARD16;
- int err;
-
- if (!pSet)
- return Success;
-
- nRanges = pStartIndex ? *pStartIndex : 0;
- while ((pIter = RecordIterateSet(pSet, pIter, &interval)))
- {
- if (interval.first > imax) break;
- if (interval.last > imax) interval.last = imax;
- nRanges++;
- if (nRanges > pri->size)
- {
- err = RecordAllocRanges(pri, nRanges);
- if (err != Success)
- return err;
- }
- else
- pri->nRanges = max(pri->nRanges, nRanges);
- if (card8)
- {
- pCARD8 = ((CARD8 *)&pri->pRanges[nRanges-1]) + byteoffset;
- *pCARD8++ = interval.first;
- *pCARD8 = interval.last;
- }
- else
- {
- pCARD16 = (CARD16 *)
- (((char *)&pri->pRanges[nRanges-1]) + byteoffset);
- *pCARD16++ = interval.first;
- *pCARD16 = interval.last;
- }
- }
- if (pStartIndex)
- *pStartIndex = nRanges;
- return Success;
-} /* RecordConvertSetToRanges */
-
-
-/* RecordConvertMinorOpInfoToRanges
- *
- * Arguments:
- * pMinOpInfo is the minor opcode info to convert to xRecordRanges.
- * pri is where the result should be stored.
- * byteoffset is the offset from the start of an xRecordRange of the
- * four vales (CARD8 major_first, CARD8 major_last,
- * CARD16 minor_first, CARD16 minor_last) we are going to store.
- *
- * Returns: BadAlloc if a memory allocation error occurred, else Success.
- *
- * Side Effects:
- * If Success is returned, the slice of pri->pRanges indicated by
- * byteoffset is filled in with the information from pMinOpInfo.
- */
-static int
-RecordConvertMinorOpInfoToRanges(
- RecordMinorOpPtr pMinOpInfo,
- GetContextRangeInfoPtr pri,
- int byteoffset
-)
-{
- int nsets;
- int start;
- int i;
- int err;
-
- if (!pMinOpInfo)
- return Success;
-
- nsets = pMinOpInfo->count;
- pMinOpInfo++;
- start = 0;
- for (i = 0; i < nsets; i++)
- {
- int j, s;
- s = start;
- err = RecordConvertSetToRanges(pMinOpInfo[i].major.pMinOpSet, pri,
- byteoffset + 2, FALSE, 65535, &start);
- if (err != Success) return err;
- for (j = s; j < start; j++)
- {
- CARD8 *pCARD8 = ((CARD8 *)&pri->pRanges[j]) + byteoffset;
- *pCARD8++ = pMinOpInfo[i].major.first;
- *pCARD8 = pMinOpInfo[i].major.last;
- }
- }
- return Success;
-} /* RecordConvertMinorOpInfoToRanges */
-
-
-/* RecordSwapRanges
- *
- * Arguments:
- * pRanges is an array of xRecordRanges.
- * nRanges is the number of elements in pRanges.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The 16 bit fields of each xRecordRange are byte swapped.
- */
-static void
-RecordSwapRanges(pRanges, nRanges)
- xRecordRange *pRanges;
- int nRanges;
-{
- int i;
- register char n;
- for (i = 0; i < nRanges; i++, pRanges++)
- {
- swaps(&pRanges->extRequestsMinorFirst, n);
- swaps(&pRanges->extRequestsMinorLast, n);
- swaps(&pRanges->extRepliesMinorFirst, n);
- swaps(&pRanges->extRepliesMinorLast, n);
- }
-} /* RecordSwapRanges */
-
-
-static int
-ProcRecordGetContext(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- REQUEST(xRecordGetContextReq);
- xRecordGetContextReply rep;
- int n;
- RecordClientsAndProtocolPtr pRCAP;
- int nRCAPs = 0;
- GetContextRangeInfoPtr pRangeInfo;
- GetContextRangeInfoPtr pri;
- int i;
- int err;
-
- REQUEST_SIZE_MATCH(xRecordGetContextReq);
- VERIFY_CONTEXT(pContext, stuff->context, client);
-
- /* how many RCAPs are there on this context? */
-
- for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP)
- nRCAPs++;
-
- /* allocate and initialize space for record range info */
-
- pRangeInfo = (GetContextRangeInfoPtr)ALLOCATE_LOCAL(
- nRCAPs * sizeof(GetContextRangeInfoRec));
- if (!pRangeInfo && nRCAPs > 0)
- return BadAlloc;
- for (i = 0; i < nRCAPs; i++)
- {
- pRangeInfo[i].pRanges = NULL;
- pRangeInfo[i].size = 0;
- pRangeInfo[i].nRanges = 0;
- }
-
- /* convert the RCAP (internal) representation of the recorded protocol
- * to the wire protocol (external) representation, storing the information
- * for the ith RCAP in pri[i]
- */
-
- for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo;
- pRCAP;
- pRCAP = pRCAP->pNextRCAP, pri++)
- {
- xRecordRange rr;
-
- err = RecordConvertSetToRanges(pRCAP->pRequestMajorOpSet, pri,
- offset_of(rr, coreRequestsFirst), TRUE, 127, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertSetToRanges(pRCAP->pReplyMajorOpSet, pri,
- offset_of(rr, coreRepliesFirst), TRUE, 127, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertSetToRanges(pRCAP->pDeliveredEventSet, pri,
- offset_of(rr, deliveredEventsFirst), TRUE, 255, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertSetToRanges(pRCAP->pDeviceEventSet, pri,
- offset_of(rr, deviceEventsFirst), TRUE, 255, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertSetToRanges(pRCAP->pErrorSet, pri,
- offset_of(rr, errorsFirst), TRUE, 255, NULL);
- if (err != Success) goto bailout;
-
- err = RecordConvertMinorOpInfoToRanges(pRCAP->pRequestMinOpInfo,
- pri, offset_of(rr, extRequestsMajorFirst));
- if (err != Success) goto bailout;
-
- err = RecordConvertMinorOpInfoToRanges(pRCAP->pReplyMinOpInfo,
- pri, offset_of(rr, extRepliesMajorFirst));
- if (err != Success) goto bailout;
-
- if (pRCAP->clientStarted || pRCAP->clientDied)
- {
- if (pri->nRanges == 0)
- RecordAllocRanges(pri, 1);
- pri->pRanges[0].clientStarted = pRCAP->clientStarted;
- pri->pRanges[0].clientDied = pRCAP->clientDied;
- }
- }
-
- /* calculate number of clients and reply length */
-
- rep.nClients = 0;
- rep.length = 0;
- for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo;
- pRCAP;
- pRCAP = pRCAP->pNextRCAP, pri++)
- {
- rep.nClients += pRCAP->numClients;
- rep.length += pRCAP->numClients *
- ( (sizeof(xRecordClientInfo) >> 2) +
- pri->nRanges * (sizeof(xRecordRange) >> 2));
- }
-
- /* write the reply header */
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.enabled = pContext->pRecordingClient != NULL;
- rep.elementHeader = pContext->elemHeaders;
- if(client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.nClients, n);
- }
- (void)WriteToClient(client, sizeof(xRecordGetContextReply),
- (char *)&rep);
-
- /* write all the CLIENT_INFOs */
-
- for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo;
- pRCAP;
- pRCAP = pRCAP->pNextRCAP, pri++)
- {
- xRecordClientInfo rci;
- rci.nRanges = pri->nRanges;
- if (client->swapped)
- {
- swapl(&rci.nRanges, n);
- RecordSwapRanges(pri->pRanges, pri->nRanges);
- }
- for (i = 0; i < pRCAP->numClients; i++)
- {
- rci.clientResource = pRCAP->pClientIDs[i];
- if (client->swapped) swapl(&rci.clientResource, n);
- WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci);
- WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
- (char *)pri->pRanges);
- }
- }
- err = client->noClientException;
-
-bailout:
- for (i = 0; i < nRCAPs; i++)
- {
- if (pRangeInfo[i].pRanges) xfree(pRangeInfo[i].pRanges);
- }
- DEALLOCATE_LOCAL(pRangeInfo);
- return err;
-} /* ProcRecordGetContext */
-
-
-static int
-ProcRecordEnableContext(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- REQUEST(xRecordEnableContextReq);
- int i;
- RecordClientsAndProtocolPtr pRCAP;
-
- REQUEST_SIZE_MATCH(xRecordGetContextReq);
- VERIFY_CONTEXT(pContext, stuff->context, client);
- if (pContext->pRecordingClient)
- return BadMatch; /* already enabled */
-
- /* install record hooks for each RCAP */
-
- for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP)
- {
- int err = RecordInstallHooks(pRCAP, 0);
- if (err != Success)
- { /* undo the previous installs */
- RecordClientsAndProtocolPtr pUninstallRCAP;
- for (pUninstallRCAP = pContext->pListOfRCAP;
- pUninstallRCAP != pRCAP;
- pUninstallRCAP = pUninstallRCAP->pNextRCAP)
- {
- RecordUninstallHooks(pUninstallRCAP, 0);
- }
- return err;
- }
- }
-
- /* Disallow further request processing on this connection until
- * the context is disabled.
- */
- IgnoreClient(client);
- pContext->pRecordingClient = client;
-
- /* Don't allow the data connection to record itself; unregister it. */
- RecordDeleteClientFromContext(pContext,
- pContext->pRecordingClient->clientAsMask);
-
- /* move the newly enabled context to the front part of ppAllContexts,
- * where all the enabled contexts are
- */
- i = RecordFindContextOnAllContexts(pContext);
- assert(i >= numEnabledContexts);
- if (i != numEnabledContexts)
- {
- ppAllContexts[i] = ppAllContexts[numEnabledContexts];
- ppAllContexts[numEnabledContexts] = pContext;
- }
-
- ++numEnabledContexts;
- assert(numEnabledContexts > 0);
-
- /* send StartOfData */
- RecordAProtocolElement(pContext, NULL, XRecordStartOfData, NULL, 0, 0);
- RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
- return Success;
-} /* ProcRecordEnableContext */
-
-
-/* RecordDisableContext
- *
- * Arguments:
- * pContext is the context to disable.
- * nRanges is the number of elements in pRanges.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * If the context was enabled, it is disabled. An EndOfData
- * message is sent to the recording client. Recording hooks for
- * this context are uninstalled. The context is moved to the
- * rear part of the ppAllContexts array. numEnabledContexts is
- * decremented. Request processing for the formerly recording client
- * is resumed.
- */
-static void
-RecordDisableContext(pContext)
- RecordContextPtr pContext;
-{
- RecordClientsAndProtocolPtr pRCAP;
- int i;
-
- if (!pContext->pRecordingClient) return;
- if (!pContext->pRecordingClient->clientGone)
- {
- RecordAProtocolElement(pContext, NULL, XRecordEndOfData, NULL, 0, 0);
- RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
- /* Re-enable request processing on this connection. */
- AttendClient(pContext->pRecordingClient);
- }
-
- for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP)
- {
- RecordUninstallHooks(pRCAP, 0);
- }
-
- pContext->pRecordingClient = NULL;
-
- /* move the newly disabled context to the rear part of ppAllContexts,
- * where all the disabled contexts are
- */
- i = RecordFindContextOnAllContexts(pContext);
- assert( (i != -1) && (i < numEnabledContexts) );
- if (i != (numEnabledContexts - 1) )
- {
- ppAllContexts[i] = ppAllContexts[numEnabledContexts-1];
- ppAllContexts[numEnabledContexts-1] = pContext;
- }
- --numEnabledContexts;
- assert(numEnabledContexts >= 0);
-} /* RecordDisableContext */
-
-
-static int
-ProcRecordDisableContext(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- REQUEST(xRecordDisableContextReq);
-
- REQUEST_SIZE_MATCH(xRecordDisableContextReq);
- VERIFY_CONTEXT(pContext, stuff->context, client);
- RecordDisableContext(pContext);
- return Success;
-} /* ProcRecordDisableContext */
-
-
-/* RecordDeleteContext
- *
- * Arguments:
- * value is the context to delete.
- * id is its resource ID.
- *
- * Returns: Success.
- *
- * Side Effects:
- * Disables the context, frees all associated memory, and removes
- * it from the ppAllContexts array.
- */
-static int
-RecordDeleteContext(value, id)
- pointer value;
- XID id;
-{
- int i;
- RecordContextPtr pContext = (RecordContextPtr)value;
- RecordClientsAndProtocolPtr pRCAP;
-
- RecordDisableContext(pContext);
-
- /* Remove all the clients from all the RCAPs.
- * As a result, the RCAPs will be freed.
- */
-
- while ((pRCAP = pContext->pListOfRCAP))
- {
- int numClients = pRCAP->numClients;
- /* when the last client is deleted, the RCAP will go away. */
- while(numClients--)
- {
- RecordDeleteClientFromRCAP(pRCAP, numClients);
- }
- }
-
- xfree(pContext);
-
- /* remove context from AllContexts list */
-
- if (-1 != (i = RecordFindContextOnAllContexts(pContext)))
- {
- ppAllContexts[i] = ppAllContexts[numContexts - 1];
- if (--numContexts == 0)
- {
- xfree(ppAllContexts);
- ppAllContexts = NULL;
- }
- }
- return Success;
-} /* RecordDeleteContext */
-
-
-static int
-ProcRecordFreeContext(client)
- ClientPtr client;
-{
- RecordContextPtr pContext;
- REQUEST(xRecordFreeContextReq);
-
- REQUEST_SIZE_MATCH(xRecordFreeContextReq);
- VERIFY_CONTEXT(pContext, stuff->context, client);
- FreeResource(stuff->context, RT_NONE);
- return Success;
-} /* ProcRecordFreeContext */
-
-
-static int
-ProcRecordDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_RecordQueryVersion:
- return ProcRecordQueryVersion(client);
- case X_RecordCreateContext:
- return ProcRecordCreateContext(client);
- case X_RecordRegisterClients:
- return ProcRecordRegisterClients(client);
- case X_RecordUnregisterClients:
- return ProcRecordUnregisterClients(client);
- case X_RecordGetContext:
- return ProcRecordGetContext(client);
- case X_RecordEnableContext:
- return ProcRecordEnableContext(client);
- case X_RecordDisableContext:
- return ProcRecordDisableContext(client);
- case X_RecordFreeContext:
- return ProcRecordFreeContext(client);
- default:
- return BadRequest;
- }
-} /* ProcRecordDispatch */
-
-
-static int
-SProcRecordQueryVersion(client)
- ClientPtr client;
-{
- REQUEST(xRecordQueryVersionReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion,n);
- return ProcRecordQueryVersion(client);
-} /* SProcRecordQueryVersion */
-
-
-static void
-SwapCreateRegister(xRecordRegisterClientsReq *stuff)
-{
- register char n;
- int i;
- XID *pClientID;
-
- swapl(&stuff->context, n);
- swapl(&stuff->nClients, n);
- swapl(&stuff->nRanges, n);
- pClientID = (XID *)&stuff[1];
- for (i = 0; i < stuff->nClients; i++, pClientID++)
- {
- swapl(pClientID, n);
- }
- RecordSwapRanges((xRecordRange *)pClientID, stuff->nRanges);
-} /* SwapCreateRegister */
-
-
-static int
-SProcRecordCreateContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordCreateContextReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
- SwapCreateRegister((pointer)stuff);
- return ProcRecordCreateContext(client);
-} /* SProcRecordCreateContext */
-
-
-static int
-SProcRecordRegisterClients(client)
- ClientPtr client;
-{
- REQUEST(xRecordRegisterClientsReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
- SwapCreateRegister((pointer)stuff);
- return ProcRecordRegisterClients(client);
-} /* SProcRecordRegisterClients */
-
-
-static int
-SProcRecordUnregisterClients(client)
- ClientPtr client;
-{
- REQUEST(xRecordUnregisterClientsReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
- swapl(&stuff->context, n);
- swapl(&stuff->nClients, n);
- SwapRestL(stuff);
- return ProcRecordUnregisterClients(client);
-} /* SProcRecordUnregisterClients */
-
-
-static int
-SProcRecordGetContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordGetContextReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecordGetContextReq);
- swapl(&stuff->context, n);
- return ProcRecordGetContext(client);
-} /* SProcRecordGetContext */
-
-static int
-SProcRecordEnableContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordEnableContextReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecordEnableContextReq);
- swapl(&stuff->context, n);
- return ProcRecordEnableContext(client);
-} /* SProcRecordEnableContext */
-
-
-static int
-SProcRecordDisableContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordDisableContextReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecordDisableContextReq);
- swapl(&stuff->context, n);
- return ProcRecordDisableContext(client);
-} /* SProcRecordDisableContext */
-
-
-static int
-SProcRecordFreeContext(client)
- ClientPtr client;
-{
- REQUEST(xRecordFreeContextReq);
- register char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecordFreeContextReq);
- swapl(&stuff->context, n);
- return ProcRecordFreeContext(client);
-} /* SProcRecordFreeContext */
-
-
-static int
-SProcRecordDispatch(client)
- ClientPtr client;
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_RecordQueryVersion:
- return SProcRecordQueryVersion(client);
- case X_RecordCreateContext:
- return SProcRecordCreateContext(client);
- case X_RecordRegisterClients:
- return SProcRecordRegisterClients(client);
- case X_RecordUnregisterClients:
- return SProcRecordUnregisterClients(client);
- case X_RecordGetContext:
- return SProcRecordGetContext(client);
- case X_RecordEnableContext:
- return SProcRecordEnableContext(client);
- case X_RecordDisableContext:
- return SProcRecordDisableContext(client);
- case X_RecordFreeContext:
- return SProcRecordFreeContext(client);
- default:
- return BadRequest;
- }
-} /* SProcRecordDispatch */
-
-/* XXX goes in header file */
-extern void SwapConnSetupInfo(), SwapConnSetupPrefix();
-
-/* RecordConnectionSetupInfo
- *
- * Arguments:
- * pContext is an enabled context that specifies recording of
- * connection setup info.
- * pci holds the connection setup info.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * The connection setup info is sent to the recording client.
- */
-static void
-RecordConnectionSetupInfo(pContext, pci)
- RecordContextPtr pContext;
- NewClientInfoRec *pci;
-{
- int prefixsize = SIZEOF(xConnSetupPrefix);
- int restsize = pci->prefix->length * 4;
-
- if (pci->client->swapped)
- {
- char * pConnSetup = (char *)ALLOCATE_LOCAL(prefixsize + restsize);
- if (!pConnSetup)
- return;
- SwapConnSetupPrefix(pci->prefix, pConnSetup);
- SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize);
- RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
- (pointer)pConnSetup, prefixsize + restsize, 0);
- DEALLOCATE_LOCAL(pConnSetup);
- }
- else
- {
- /* don't alloc and copy as in the swapped case; just send the
- * data in two pieces
- */
- RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
- (pointer)pci->prefix, prefixsize, restsize);
- RecordAProtocolElement(pContext, pci->client, XRecordClientStarted,
- (pointer)pci->setup, restsize, /* continuation */ -1);
- }
-} /* RecordConnectionSetupInfo */
-
-
-/* RecordDeleteContext
- *
- * Arguments:
- * pcbl is &ClientStateCallback.
- * nullata is NULL.
- * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h)
- * which contains information about client state changes.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * If a new client has connected and any contexts have specified
- * XRecordFutureClients, the new client is registered on those contexts.
- * If any of those contexts specify recording of the connection setup
- * info, it is recorded.
- *
- * If an existing client has disconnected, it is deleted from any
- * contexts that it was registered on. If any of those contexts
- * specified XRecordClientDied, they record a ClientDied protocol element.
- * If the disconnectiong client happened to be the data connection of an
- * enabled context, the context is disabled.
- */
-
-static void
-RecordAClientStateChange(pcbl, nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
-{
- NewClientInfoRec *pci = (NewClientInfoRec *)calldata;
- int i;
- ClientPtr pClient = pci->client;
-
- switch (pClient->clientState)
- {
- case ClientStateRunning: /* new client */
- for (i = 0; i < numContexts; i++)
- {
- RecordClientsAndProtocolPtr pRCAP;
- RecordContextPtr pContext = ppAllContexts[i];
-
- if ((pRCAP = RecordFindClientOnContext(pContext,
- XRecordFutureClients, NULL)))
- {
- RecordAddClientToRCAP(pRCAP, pClient->clientAsMask);
- if (pContext->pRecordingClient && pRCAP->clientStarted)
- RecordConnectionSetupInfo(pContext, pci);
- }
- }
- break;
-
- case ClientStateGone:
- case ClientStateRetained: /* client disconnected */
- for (i = 0; i < numContexts; i++)
- {
- RecordClientsAndProtocolPtr pRCAP;
- RecordContextPtr pContext = ppAllContexts[i];
- int pos;
-
- if (pContext->pRecordingClient == pClient)
- RecordDisableContext(pContext);
- if ((pRCAP = RecordFindClientOnContext(pContext,
- pClient->clientAsMask, &pos)))
- {
- if (pContext->pRecordingClient && pRCAP->clientDied)
- RecordAProtocolElement(pContext, pClient,
- XRecordClientDied, NULL, 0, 0);
- RecordDeleteClientFromRCAP(pRCAP, pos);
- }
- }
- break;
-
- default:
- break;
- } /* end switch on client state */
-} /* RecordAClientStateChange */
-
-
-/* RecordCloseDown
- *
- * Arguments:
- * extEntry is the extension information for RECORD.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Performs any cleanup needed by RECORD at server shutdown time.
- *
- */
-static void
-RecordCloseDown(extEntry)
- ExtensionEntry *extEntry;
-{
- DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL);
-} /* RecordCloseDown */
-
-
-/* RecordExtensionInit
- *
- * Arguments: none.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Enables the RECORD extension if possible.
- */
-void
-RecordExtensionInit()
-{
- ExtensionEntry *extentry;
-
- RTContext = CreateNewResourceType(RecordDeleteContext);
- if (!RTContext)
- return;
-
- RecordClientPrivateIndex = AllocateClientPrivateIndex();
- if (!AllocateClientPrivate(RecordClientPrivateIndex, 0))
- return;
-
- ppAllContexts = NULL;
- numContexts = numEnabledContexts = numEnabledRCAPs = 0;
-
- if (!AddCallback(&ClientStateCallback, RecordAClientStateChange, NULL))
- return;
-
- extentry = AddExtension(RECORD_NAME, RecordNumEvents, RecordNumErrors,
- ProcRecordDispatch, SProcRecordDispatch,
- RecordCloseDown, StandardMinorOpcode);
- if (!extentry)
- {
- DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL);
- return;
- }
- RecordErrorBase = extentry->errorBase;
-
-} /* RecordExtensionInit */
-
diff --git a/record/set.c b/record/set.c
deleted file mode 100644
index 847a1b28d..000000000
--- a/record/set.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/* $Xorg: set.c,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */
-
-/*
-
-Copyright 1995, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/record/set.c,v 1.8 2003/11/17 22:20:44 dawes Exp $ */
-
-/*
-
- See the header set.h for a description of the set ADT.
-
- Implementation Strategy
-
- A bit vector is an obvious choice to represent the set, but may take
- too much memory, depending on the numerically largest member in the
- set. One expected common case is for the client to ask for *all*
- protocol. This means it would ask for minor opcodes 0 through 65535.
- Representing this as a bit vector takes 8K -- and there may be
- multiple minor opcode intervals, as many as one per major (extension)
- opcode). In such cases, a list-of-intervals representation would be
- preferable to reduce memory consumption. Both representations will be
- implemented, and RecordCreateSet will decide heuristically which one
- to use based on the set members.
-
- Note: When compiling for use in the server, do not use -DTESTING.
- When compiling for stand-alone testing of the set ADT, use -DTESTING.
-
-*/
-
-#ifndef TESTING
-#include "misc.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* stuff that you normally get from the X Server's environment */
-
-typedef int Bool;
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-typedef unsigned short CARD16;
-
-#define xalloc malloc
-#define xfree free
-#define ALLOCATE_LOCAL malloc
-#define DEALLOCATE_LOCAL free
-
-void *Xcalloc(size)
- int size;
-{
- void *p = malloc(size);
- if (p) memset(p, 0, size);
- return p;
-}
-
-#ifndef max
-#define max(_a, _b) ( ((_a) > (_b)) ? (_a) : (_b) )
-#endif
-
-#endif /* TESTING */
-
-#include "set.h"
-
-#ifdef XFree86LOADER
-#include "xf86_libc.h"
-#include "xf86_ansic.h"
-#endif
-
-static int
-maxMemberInInterval(pIntervals, nIntervals)
- RecordSetInterval *pIntervals;
- int nIntervals;
-{
- int i;
- int maxMember = -1;
- for (i = 0; i < nIntervals; i++)
- {
- if (maxMember < (int)pIntervals[i].last)
- maxMember = pIntervals[i].last;
- }
- return maxMember;
-}
-
-static void
-NoopDestroySet(pSet)
- RecordSetPtr pSet;
-{
-}
-
-/***************************************************************************/
-
-/* set operations for bit vector representation */
-
-typedef struct {
- RecordSetRec baseSet;
- int maxMember;
- /* followed by the bit vector itself */
-} BitVectorSet, *BitVectorSetPtr;
-
-#define BITS_PER_LONG (sizeof(unsigned long) * 8)
-
-static void
-BitVectorDestroySet(pSet)
- RecordSetPtr pSet;
-{
- xfree(pSet);
-}
-
-static unsigned long
-BitVectorIsMemberOfSet(pSet, pm)
- RecordSetPtr pSet;
- int pm;
-{
- BitVectorSetPtr pbvs = (BitVectorSetPtr)pSet;
- unsigned long *pbitvec;
-
- if ((int)pm > pbvs->maxMember) return FALSE;
- pbitvec = (unsigned long *)(&pbvs[1]);
- return (pbitvec[pm / BITS_PER_LONG] & ((unsigned long)1 << (pm % BITS_PER_LONG)));
-}
-
-
-static int
-BitVectorFindBit(pSet, iterbit, bitval)
- RecordSetPtr pSet;
- int iterbit;
- Bool bitval;
-{
- BitVectorSetPtr pbvs = (BitVectorSetPtr)pSet;
- unsigned long *pbitvec = (unsigned long *)(&pbvs[1]);
- int startlong;
- int startbit;
- int walkbit;
- int maxMember;
- unsigned long skipval;
- unsigned long bits;
- unsigned long usefulbits;
-
- startlong = iterbit / BITS_PER_LONG;
- pbitvec += startlong;
- startbit = startlong * BITS_PER_LONG;
- skipval = bitval ? 0L : ~0L;
- maxMember = pbvs->maxMember;
-
-
- if (startbit > maxMember) return -1;
- bits = *pbitvec;
- usefulbits = ~(((unsigned long)1 << (iterbit - startbit)) - 1);
- if ( (bits & usefulbits) == (skipval & usefulbits) )
- {
- pbitvec++;
- startbit += BITS_PER_LONG;
-
- while (startbit <= maxMember && *pbitvec == skipval)
- {
- pbitvec++;
- startbit += BITS_PER_LONG;
- }
- if (startbit > maxMember) return -1;
- }
-
- walkbit = (startbit < iterbit) ? iterbit - startbit : 0;
-
- bits = *pbitvec;
- while (walkbit < BITS_PER_LONG && ((!(bits & ((unsigned long)1 << walkbit))) == bitval))
- walkbit++;
-
- return startbit + walkbit;
-}
-
-
-static RecordSetIteratePtr
-BitVectorIterateSet(pSet, pIter, pInterval)
- RecordSetPtr pSet;
- RecordSetIteratePtr pIter;
- RecordSetInterval *pInterval;
-{
- int iterbit = (int)(long)pIter;
- int b;
-
- b = BitVectorFindBit(pSet, iterbit, TRUE);
- if (b == -1) return (RecordSetIteratePtr)0;
- pInterval->first = b;
-
- b = BitVectorFindBit(pSet, b, FALSE);
- pInterval->last = (b < 0) ? ((BitVectorSetPtr)pSet)->maxMember : b - 1;
- return (RecordSetIteratePtr)(long)(pInterval->last + 1);
-}
-
-RecordSetOperations BitVectorSetOperations = {
- BitVectorDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet };
-
-RecordSetOperations BitVectorNoFreeOperations = {
- NoopDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet };
-
-static int
-BitVectorSetMemoryRequirements(pIntervals, nIntervals, maxMember, alignment)
- RecordSetInterval *pIntervals;
- int nIntervals;
- int maxMember;
- int *alignment;
-{
- int nlongs;
-
- *alignment = sizeof(unsigned long);
- nlongs = (maxMember + BITS_PER_LONG) / BITS_PER_LONG;
- return (sizeof(BitVectorSet) + nlongs * sizeof(unsigned long));
-}
-
-static RecordSetPtr
-BitVectorCreateSet(pIntervals, nIntervals, pMem, memsize)
- RecordSetInterval *pIntervals;
- int nIntervals;
- void *pMem;
- int memsize;
-{
- BitVectorSetPtr pbvs;
- int i, j;
- unsigned long *pbitvec;
-
- /* allocate all storage needed by this set in one chunk */
-
- if (pMem)
- {
- memset(pMem, 0, memsize);
- pbvs = (BitVectorSetPtr)pMem;
- pbvs->baseSet.ops = &BitVectorNoFreeOperations;
- }
- else
- {
- pbvs = (BitVectorSetPtr)Xcalloc(memsize);
- if (!pbvs) return NULL;
- pbvs->baseSet.ops = &BitVectorSetOperations;
- }
-
- pbvs->maxMember = maxMemberInInterval(pIntervals, nIntervals);
-
- /* fill in the set */
-
- pbitvec = (unsigned long *)(&pbvs[1]);
- for (i = 0; i < nIntervals; i++)
- {
- for (j = pIntervals[i].first; j <= (int)pIntervals[i].last; j++)
- {
- pbitvec[j/BITS_PER_LONG] |= ((unsigned long)1 << (j % BITS_PER_LONG));
- }
- }
- return (RecordSetPtr)pbvs;
-}
-
-
-/***************************************************************************/
-
-/* set operations for interval list representation */
-
-typedef struct {
- RecordSetRec baseSet;
- int nIntervals;
- /* followed by the intervals (RecordSetInterval) */
-} IntervalListSet, *IntervalListSetPtr;
-
-static void
-IntervalListDestroySet(pSet)
- RecordSetPtr pSet;
-{
- xfree(pSet);
-}
-
-static unsigned long
-IntervalListIsMemberOfSet(pSet, pm)
- RecordSetPtr pSet;
- int pm;
-{
- IntervalListSetPtr prls = (IntervalListSetPtr)pSet;
- RecordSetInterval *pInterval = (RecordSetInterval *)(&prls[1]);
- int hi, lo, probe;
-
- /* binary search */
- lo = 0; hi = prls->nIntervals - 1;
- while (lo <= hi)
- {
- probe = (hi + lo) / 2;
- if (pm >= pInterval[probe].first && pm <= pInterval[probe].last) return 1;
- else if (pm < pInterval[probe].first) hi = probe - 1;
- else lo = probe + 1;
- }
- return 0;
-}
-
-
-static RecordSetIteratePtr
-IntervalListIterateSet(pSet, pIter, pIntervalReturn)
- RecordSetPtr pSet;
- RecordSetIteratePtr pIter;
- RecordSetInterval *pIntervalReturn;
-{
- RecordSetInterval *pInterval = (RecordSetInterval *)pIter;
- IntervalListSetPtr prls = (IntervalListSetPtr)pSet;
-
- if (pInterval == NULL)
- {
- pInterval = (RecordSetInterval *)(&prls[1]);
- }
-
- if ( (pInterval - (RecordSetInterval *)(&prls[1])) < prls->nIntervals )
- {
- *pIntervalReturn = *pInterval;
- return (RecordSetIteratePtr)(++pInterval);
- }
- else
- return (RecordSetIteratePtr)NULL;
-}
-
-RecordSetOperations IntervalListSetOperations = {
- IntervalListDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet };
-
-RecordSetOperations IntervalListNoFreeOperations = {
- NoopDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet };
-
-static int
-IntervalListMemoryRequirements(pIntervals, nIntervals, maxMember, alignment)
- RecordSetInterval *pIntervals;
- int nIntervals;
- int maxMember;
- int *alignment;
-{
- *alignment = sizeof(unsigned long);
- return sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval);
-}
-
-static RecordSetPtr
-IntervalListCreateSet(pIntervals, nIntervals, pMem, memsize)
- RecordSetInterval *pIntervals;
- int nIntervals;
- void *pMem;
- int memsize;
-{
- IntervalListSetPtr prls;
- int i, j, k;
- RecordSetInterval *stackIntervals = NULL;
- CARD16 first;
-
- if (nIntervals > 0)
- {
- stackIntervals = (RecordSetInterval *)ALLOCATE_LOCAL(
- sizeof(RecordSetInterval) * nIntervals);
- if (!stackIntervals) return NULL;
-
- /* sort intervals, store in stackIntervals (insertion sort) */
-
- for (i = 0; i < nIntervals; i++)
- {
- first = pIntervals[i].first;
- for (j = 0; j < i; j++)
- {
- if (first < stackIntervals[j].first)
- break;
- }
- for (k = i; k > j; k--)
- {
- stackIntervals[k] = stackIntervals[k-1];
- }
- stackIntervals[j] = pIntervals[i];
- }
-
- /* merge abutting/overlapping intervals */
-
- for (i = 0; i < nIntervals - 1; )
- {
- if ( (stackIntervals[i].last + (unsigned int)1) <
- stackIntervals[i + 1].first)
- {
- i++; /* disjoint intervals */
- }
- else
- {
- stackIntervals[i].last = max(stackIntervals[i].last,
- stackIntervals[i + 1].last);
- nIntervals--;
- for (j = i + 1; j < nIntervals; j++)
- stackIntervals[j] = stackIntervals[j + 1];
- }
- }
- }
-
- /* allocate and fill in set structure */
-
- if (pMem)
- {
- prls = (IntervalListSetPtr)pMem;
- prls->baseSet.ops = &IntervalListNoFreeOperations;
- }
- else
- {
- prls = (IntervalListSetPtr)
- xalloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval));
- if (!prls) goto bailout;
- prls->baseSet.ops = &IntervalListSetOperations;
- }
- memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
- prls->nIntervals = nIntervals;
-bailout:
- if (stackIntervals) DEALLOCATE_LOCAL(stackIntervals);
- return (RecordSetPtr)prls;
-}
-
-#ifdef TESTING
-typedef enum {
- BitVectorImplementation, IntervalListImplementation} RecordSetImplementation;
-
-RecordSetImplementation _RecordSetImpl;
-
-static void
-_RecordForceSetImplementation(setimpl)
- RecordSetImplementation setimpl;
-{
- _RecordSetImpl = setimpl;
-}
-#endif
-
-typedef RecordSetPtr (*RecordCreateSetProcPtr)(
- RecordSetInterval *pIntervals,
- int nIntervals,
- void *pMem,
- int memsize
-);
-
-static int
-_RecordSetMemoryRequirements(pIntervals, nIntervals, alignment, ppCreateSet)
- RecordSetInterval *pIntervals;
- int nIntervals;
- int *alignment;
- RecordCreateSetProcPtr *ppCreateSet;
-{
- int bmsize, rlsize, bma, rla;
- int maxMember;
-
- /* find maximum member of set so we know how big to make the bit vector */
- maxMember = maxMemberInInterval(pIntervals, nIntervals);
-
- bmsize = BitVectorSetMemoryRequirements(pIntervals, nIntervals, maxMember,
- &bma);
- rlsize = IntervalListMemoryRequirements(pIntervals, nIntervals, maxMember,
- &rla);
-#ifdef TESTING
- if (_RecordSetImpl == BitVectorImplementation)
-#else
- if ( ( (nIntervals > 1) && (maxMember <= 255) )
- || (bmsize < rlsize) )
-#endif
- {
- *alignment = bma;
- *ppCreateSet = BitVectorCreateSet;
- return bmsize;
- }
- else
- {
- *alignment = rla;
- *ppCreateSet = IntervalListCreateSet;
- return rlsize;
- }
-}
-
-/***************************************************************************/
-
-/* user-visible functions */
-
-int
-RecordSetMemoryRequirements(pIntervals, nIntervals, alignment)
- RecordSetInterval *pIntervals;
- int nIntervals;
- int *alignment;
-{
- RecordCreateSetProcPtr pCreateSet;
- return _RecordSetMemoryRequirements(pIntervals, nIntervals, alignment,
- &pCreateSet);
-}
-
-RecordSetPtr
-RecordCreateSet(pIntervals, nIntervals, pMem, memsize)
- RecordSetInterval *pIntervals;
- int nIntervals;
- void *pMem;
- int memsize;
-{
- RecordCreateSetProcPtr pCreateSet;
- int alignment;
- int size;
-
- size = _RecordSetMemoryRequirements(pIntervals, nIntervals, &alignment,
- &pCreateSet);
- if (pMem)
- {
- if ( ((long)pMem & (alignment-1) ) || memsize < size)
- return NULL;
- }
- return (*pCreateSet)(pIntervals, nIntervals, pMem, size);
-}
-
-/***************************************************************************/
-
-#ifdef TESTING
-
-/*
-
-Test Strategy
-
-Having two set representations is convenient for testing because we
-can play them against each other. The test code will be able to
-specify which implementation to use. This breaks the encapsulation,
-but that seems acceptable for testing. The crux of the test loop
-looks like this:
-
-loop:
- generate random list of Intervals
-
- create set A using bit vector implementation
- create set B using Interval list implementation
-
- for each possible set member
- if set A and set B disagree on whether this is a member error;
-
- iterate over both sets, comparing the intervals returned by each.
- if intervals or number of intervals are different error;
-
- iterate over intervals of set A
- for i = interval.first to interval.last
- if i is not a member of set B error;
-
- iterate over intervals of set B
- for i = interval.first to interval.last
- if i is not a member of set A error;
-
- destroy sets A, B
-
-*/
-
-int GenerateRandomIntervals(pIntervals, maxintervals)
- RecordSetInterval *pIntervals;
- int maxintervals;
-{
- int i, nIntervals;
-
- nIntervals = rand() % maxintervals;
-
- for (i = 0; i < nIntervals; i++)
- {
- pIntervals[i].first = rand();
- pIntervals[i].last = pIntervals[i].first + rand();
- }
- return nIntervals;
-}
-
-#define MAXINTERVALS 100
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- RecordSetPtr bs, rs;
- RecordSetInterval br, rr;
- RecordSetIteratePtr bi, ri;
- CARD16 i;
- int testcount;
- RecordSetInterval intervals[MAXINTERVALS];
- int nIntervals;
- int bsize, rsize;
- int balign, ralign;
- int pad;
-
- for (testcount = 0; 1; testcount++)
- {
- nIntervals = GenerateRandomIntervals(intervals, MAXINTERVALS);
- printf("%d nIntervals %d\n", testcount, nIntervals);
-
- if (testcount & 1)
- {
- _RecordForceSetImplementation(BitVectorImplementation);
- bsize = RecordSetMemoryRequirements(intervals, nIntervals, &balign);
- _RecordForceSetImplementation(IntervalListImplementation);
- rsize = RecordSetMemoryRequirements(intervals, nIntervals, &ralign);
- pad = (ralign - (bsize & (ralign - 1))) & (ralign - 1);
- bs = (RecordSetPtr)xalloc(bsize + pad + rsize );
- if (!bs)
- {
- fprintf(stderr, "%d: failed to alloc memory for sets\n",
- testcount);
- continue;
- }
- rs = (RecordSetPtr)(((char *)bs) + bsize + pad);
- }
- else
- {
- bs = rs = NULL;
- bsize = rsize = 0;
- }
-
- _RecordForceSetImplementation(BitVectorImplementation);
- bs = RecordCreateSet(intervals, nIntervals, bs, bsize);
- _RecordForceSetImplementation(IntervalListImplementation);
- rs = RecordCreateSet(intervals, nIntervals, rs, rsize);
-
- if (!bs || !rs)
- {
- fprintf(stderr, "%d: failed to create sets\n", testcount);
- continue;
- }
-
- for (i = 0; i < 65535; i++)
- {
- unsigned long b, r;
-
- b = RecordIsMemberOfSet(bs, i);
- r = RecordIsMemberOfSet(rs, i);
- if ( (b && !r) || (!b && r) )
- {
- fprintf(stderr, "%d: isMemberOfSet %d\n",
- testcount, (int)i);
- }
- }
-
- bi = RecordIterateSet(bs, NULL, &br);
- ri = RecordIterateSet(rs, NULL, &rr);
-
- while (bi && ri)
- {
- if ( (rr.first != br.first) || (rr.last != br.last) )
- {
- fprintf(stderr, "%d: iterateSet interval value mismatch\n",
- testcount);
- }
- bi = RecordIterateSet(bs, bi, &br);
- ri = RecordIterateSet(rs, ri, &rr);
- }
- if (bi != ri)
- {
- fprintf(stderr, "%d: iterateSet interval count mismatch\n",
- testcount);
- }
-
-
- bi = NULL;
- while (bi = RecordIterateSet(bs, bi, &br))
- {
- for (i = br.first; i <= br.last; i++)
- {
- if (!RecordIsMemberOfSet(rs, i))
- {
- fprintf(stderr, "%d: iterateSet b / isMemberOfSet r %d\n",
- testcount, (int)i);
- }
- }
- }
-
- ri = NULL;
- while (ri = RecordIterateSet(rs, ri, &rr))
- {
- for (i = rr.first; i <= rr.last; i++)
- {
- if (!RecordIsMemberOfSet(bs, i) )
- {
- fprintf(stderr, "%d: iterateSet r / isMemberOfSet b %d\n",
- testcount, (int)i);
- }
- }
- }
-
- RecordDestroySet(bs);
- RecordDestroySet(rs);
-
- if (testcount & 1)
- {
- xfree(bs);
- }
- }
-}
-
-#endif /* TESTING */
diff --git a/record/set.h b/record/set.h
deleted file mode 100644
index 169077720..000000000
--- a/record/set.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* $Xorg: set.h,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */
-
-/*
-
-Copyright 1995, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-/* $XFree86: xc/programs/Xserver/record/set.h,v 1.3 2003/11/17 22:20:44 dawes Exp $ */
-
-/*
- A Set Abstract Data Type (ADT) for the RECORD Extension
- David P. Wiggins
- 7/25/95
-
- The RECORD extension server code needs to maintain sets of numbers
- that designate protocol message types. In most cases the interval of
- numbers starts at 0 and does not exceed 255, but in a few cases (minor
- opcodes of extension requests) the maximum is 65535. This disparity
- suggests that a single set representation may not be suitable for all
- sets, especially given that server memory is precious. We introduce a
- set ADT to hide implementation differences so that multiple
- simultaneous set representations can exist. A single interface is
- presented to the set user regardless of the implementation in use for
- a particular set.
-
- The existing RECORD SI appears to require only four set operations:
- create (given a list of members), destroy, see if a particular number
- is a member of the set, and iterate over the members of a set. Though
- many more set operations are imaginable, to keep the code space down,
- we won't provide any more operations than are needed.
-
- The following types and functions/macros define the ADT.
-*/
-
-/* an interval of set members */
-typedef struct {
- CARD16 first;
- CARD16 last;
-} RecordSetInterval;
-
-typedef struct _RecordSetRec *RecordSetPtr; /* primary set type */
-
-typedef void *RecordSetIteratePtr;
-
-/* table of function pointers for set operations.
- set users should never declare a variable of this type.
-*/
-typedef struct {
- void (*DestroySet)(
- RecordSetPtr pSet
-);
- unsigned long (*IsMemberOfSet)(
- RecordSetPtr pSet,
- int possible_member
-);
- RecordSetIteratePtr (*IterateSet)(
- RecordSetPtr pSet,
- RecordSetIteratePtr pIter,
- RecordSetInterval *interval
-);
-} RecordSetOperations;
-
-/* "base class" for sets.
- set users should never declare a variable of this type.
- */
-typedef struct _RecordSetRec {
- RecordSetOperations *ops;
-} RecordSetRec;
-
-RecordSetPtr RecordCreateSet(
- RecordSetInterval *intervals,
- int nintervals,
- void *pMem,
- int memsize
-);
-/*
- RecordCreateSet creates and returns a new set having members specified
- by intervals and nintervals. nintervals is the number of RecordSetInterval
- structures pointed to by intervals. The elements belonging to the new
- set are determined as follows. For each RecordSetInterval structure, the
- elements between first and last inclusive are members of the new set.
- If a RecordSetInterval's first field is greater than its last field, the
- results are undefined. It is valid to create an empty set (nintervals ==
- 0). If RecordCreateSet returns NULL, the set could not be created due
- to resource constraints.
-*/
-
-int RecordSetMemoryRequirements(
- RecordSetInterval * /*pIntervals*/,
- int /*nintervals*/,
- int * /*alignment*/
-);
-
-#define RecordDestroySet(_pSet) \
- /* void */ (*_pSet->ops->DestroySet)(/* RecordSetPtr */ _pSet)
-/*
- RecordDestroySet frees all resources used by _pSet. _pSet should not be
- used after it is destroyed.
-*/
-
-#define RecordIsMemberOfSet(_pSet, _m) \
- /* unsigned long */ (*_pSet->ops->IsMemberOfSet)(/* RecordSetPtr */ _pSet, \
- /* int */ _m)
-/*
- RecordIsMemberOfSet returns a non-zero value if _m is a member of
- _pSet, else it returns zero.
-*/
-
-#define RecordIterateSet(_pSet, _pIter, _interval) \
- /* RecordSetIteratePtr */ (*_pSet->ops->IterateSet)(/* RecordSetPtr */ _pSet,\
- /* RecordSetIteratePtr */ _pIter, /* RecordSetInterval */ _interval)
-/*
- RecordIterateSet returns successive intervals of members of _pSet. If
- _pIter is NULL, the first interval of set members is copied into _interval.
- The return value should be passed as _pIter in the next call to
- RecordIterateSet to obtain the next interval. When the return value is
- NULL, there were no more intervals in the set, and nothing is copied into
- the _interval parameter. Intervals appear in increasing numerical order
- with no overlap between intervals. As such, the list of intervals produced
- by RecordIterateSet may not match the list of intervals that were passed
- in RecordCreateSet. Typical usage:
-
- pIter = NULL;
- while (pIter = RecordIterateSet(pSet, pIter, &interval))
- {
- process interval;
- }
-*/
diff --git a/render/animcur.c b/render/animcur.c
deleted file mode 100644
index fcf6a25a7..000000000
--- a/render/animcur.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/animcur.c,v 1.6 2003/11/03 05:12:01 tsi Exp $
- *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Animated cursors for X. Not specific to Render in any way, but
- * stuck there because Render has the other cool cursor extension.
- * Besides, everyone has Render.
- *
- * Implemented as a simple layer over the core cursor code; it
- * creates composite cursors out of a set of static cursors and
- * delta times between each image.
- */
-
-#include "X.h"
-#include "Xmd.h"
-#include "servermd.h"
-#include "scrnintstr.h"
-#include "dixstruct.h"
-#include "cursorstr.h"
-#include "dixfontstr.h"
-#include "opaque.h"
-#include "picturestr.h"
-
-typedef struct _AnimCurElt {
- CursorPtr pCursor; /* cursor to show */
- CARD32 delay; /* in ms */
-} AnimCurElt;
-
-typedef struct _AnimCur {
- int nelt; /* number of elements in the elts array */
- AnimCurElt *elts; /* actually allocated right after the structure */
-} AnimCurRec, *AnimCurPtr;
-
-typedef struct _AnimScrPriv {
- CursorPtr pCursor;
- int elt;
- CARD32 time;
-
- CloseScreenProcPtr CloseScreen;
-
- ScreenBlockHandlerProcPtr BlockHandler;
-
- CursorLimitsProcPtr CursorLimits;
- DisplayCursorProcPtr DisplayCursor;
- SetCursorPositionProcPtr SetCursorPosition;
- RealizeCursorProcPtr RealizeCursor;
- UnrealizeCursorProcPtr UnrealizeCursor;
- RecolorCursorProcPtr RecolorCursor;
-} AnimCurScreenRec, *AnimCurScreenPtr;
-
-typedef struct _AnimCurState {
- CursorPtr pCursor;
- ScreenPtr pScreen;
- int elt;
- CARD32 time;
-} AnimCurStateRec, *AnimCurStatePtr;
-
-static AnimCurStateRec animCurState;
-
-static unsigned char empty[4];
-
-static CursorBits animCursorBits = {
- empty, empty, 2, 1, 1, 0, 0, 1
-};
-
-int AnimCurScreenPrivateIndex = -1;
-int AnimCurGeneration;
-
-#define IsAnimCur(c) ((c)->bits == &animCursorBits)
-#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
-#define GetAnimCurScreen(s) ((AnimCurScreenPtr) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr))
-#define GetAnimCurScreenIfSet(s) ((AnimCurScreenPrivateIndex != -1) ? GetAnimCurScreen(s) : NULL)
-#define SetAnimCurScreen(s,p) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr = (pointer) (p))
-
-#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
-#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
-
-static Bool
-AnimCurDisplayCursor (ScreenPtr pScreen,
- CursorPtr pCursor);
-
-static Bool
-AnimCurSetCursorPosition (ScreenPtr pScreen,
- int x,
- int y,
- Bool generateEvent);
-
-static Bool
-AnimCurCloseScreen (int index, ScreenPtr pScreen)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
-
- Unwrap(as, pScreen, CloseScreen);
-
- Unwrap(as, pScreen, BlockHandler);
-
- Unwrap(as, pScreen, CursorLimits);
- Unwrap(as, pScreen, DisplayCursor);
- Unwrap(as, pScreen, SetCursorPosition);
- Unwrap(as, pScreen, RealizeCursor);
- Unwrap(as, pScreen, UnrealizeCursor);
- Unwrap(as, pScreen, RecolorCursor);
- SetAnimCurScreen(pScreen,0);
- ret = (*pScreen->CloseScreen) (index, pScreen);
- xfree (as);
- if (index == 0)
- AnimCurScreenPrivateIndex = -1;
- return ret;
-}
-
-static void
-AnimCurCursorLimits (ScreenPtr pScreen,
- CursorPtr pCursor,
- BoxPtr pHotBox,
- BoxPtr pTopLeftBox)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
-
- Unwrap (as, pScreen, CursorLimits);
- if (IsAnimCur(pCursor))
- {
- AnimCurPtr ac = GetAnimCur(pCursor);
-
- (*pScreen->CursorLimits) (pScreen, ac->elts[0].pCursor, pHotBox, pTopLeftBox);
- }
- else
- {
- (*pScreen->CursorLimits) (pScreen, pCursor, pHotBox, pTopLeftBox);
- }
- Wrap (as, pScreen, CursorLimits, AnimCurCursorLimits);
-}
-
-/*
- * This has to be a screen block handler instead of a generic
- * block handler so that it is well ordered with respect to the DRI
- * block handler responsible for releasing the hardware to DRI clients
- */
-
-static void
-AnimCurScreenBlockHandler (int screenNum,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask)
-{
- ScreenPtr pScreen = screenInfo.screens[screenNum];
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
-
- if (pScreen == animCurState.pScreen)
- {
- CARD32 now = GetTimeInMillis ();
-
- if ((INT32) (now - animCurState.time) >= 0)
- {
- AnimCurPtr ac = GetAnimCur(animCurState.pCursor);
- int elt = (animCurState.elt + 1) % ac->nelt;
- DisplayCursorProcPtr DisplayCursor;
-
- /*
- * Not a simple Unwrap/Wrap as this
- * isn't called along the DisplayCursor
- * wrapper chain.
- */
- DisplayCursor = pScreen->DisplayCursor;
- pScreen->DisplayCursor = as->DisplayCursor;
- (void) (*pScreen->DisplayCursor) (pScreen, ac->elts[elt].pCursor);
- as->DisplayCursor = pScreen->DisplayCursor;
- pScreen->DisplayCursor = DisplayCursor;
-
- animCurState.elt = elt;
- animCurState.time = now + ac->elts[elt].delay;
- }
- AdjustWaitForDelay (pTimeout, animCurState.time - now);
- }
- Unwrap (as, pScreen, BlockHandler);
- (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
- Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
-}
-
-static Bool
-AnimCurDisplayCursor (ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
-
- Unwrap (as, pScreen, DisplayCursor);
- if (IsAnimCur(pCursor))
- {
- if (pCursor != animCurState.pCursor)
- {
- AnimCurPtr ac = GetAnimCur(pCursor);
-
- ret = (*pScreen->DisplayCursor) (pScreen, ac->elts[0].pCursor);
- if (ret)
- {
- animCurState.elt = 0;
- animCurState.time = GetTimeInMillis () + ac->elts[0].delay;
- animCurState.pCursor = pCursor;
- animCurState.pScreen = pScreen;
- }
- }
- else
- ret = TRUE;
- }
- else
- {
- animCurState.pCursor = 0;
- animCurState.pScreen = 0;
- ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
- }
- Wrap (as, pScreen, DisplayCursor, AnimCurDisplayCursor);
- return ret;
-}
-
-static Bool
-AnimCurSetCursorPosition (ScreenPtr pScreen,
- int x,
- int y,
- Bool generateEvent)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
-
- Unwrap (as, pScreen, SetCursorPosition);
- if (animCurState.pCursor)
- animCurState.pScreen = pScreen;
- ret = (*pScreen->SetCursorPosition) (pScreen, x, y, generateEvent);
- Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
- return ret;
-}
-
-static Bool
-AnimCurRealizeCursor (ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
-
- Unwrap (as, pScreen, RealizeCursor);
- if (IsAnimCur(pCursor))
- ret = TRUE;
- else
- ret = (*pScreen->RealizeCursor) (pScreen, pCursor);
- Wrap (as, pScreen, RealizeCursor, AnimCurRealizeCursor);
- return ret;
-}
-
-static Bool
-AnimCurUnrealizeCursor (ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
-
- Unwrap (as, pScreen, UnrealizeCursor);
- if (IsAnimCur(pCursor))
- {
- AnimCurPtr ac = GetAnimCur(pCursor);
- int i;
-
- if (pScreen->myNum == 0)
- for (i = 0; i < ac->nelt; i++)
- FreeCursor (ac->elts[i].pCursor, 0);
- ret = TRUE;
- }
- else
- ret = (*pScreen->UnrealizeCursor) (pScreen, pCursor);
- Wrap (as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
- return ret;
-}
-
-static void
-AnimCurRecolorCursor (ScreenPtr pScreen,
- CursorPtr pCursor,
- Bool displayed)
-{
- AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
-
- Unwrap (as, pScreen, RecolorCursor);
- if (IsAnimCur(pCursor))
- {
- AnimCurPtr ac = GetAnimCur(pCursor);
- int i;
-
- for (i = 0; i < ac->nelt; i++)
- (*pScreen->RecolorCursor) (pScreen, ac->elts[i].pCursor,
- displayed &&
- animCurState.elt == i);
- }
- else
- (*pScreen->RecolorCursor) (pScreen, pCursor, displayed);
- Wrap (as, pScreen, RecolorCursor, AnimCurRecolorCursor);
-}
-
-Bool
-AnimCurInit (ScreenPtr pScreen)
-{
- AnimCurScreenPtr as;
-
- if (AnimCurGeneration != serverGeneration)
- {
- AnimCurScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (AnimCurScreenPrivateIndex < 0)
- return FALSE;
- AnimCurGeneration = serverGeneration;
- animCurState.pCursor = 0;
- animCurState.pScreen = 0;
- animCurState.elt = 0;
- animCurState.time = 0;
- }
- as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec));
- if (!as)
- return FALSE;
- Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
-
- Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
-
- Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits);
- Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor);
- Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
- Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
- Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
- Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
- SetAnimCurScreen(pScreen,as);
- return TRUE;
-}
-
-int
-AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor)
-{
- CursorPtr pCursor;
- int i;
- AnimCurPtr ac;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- if (!GetAnimCurScreenIfSet (screenInfo.screens[i]))
- return BadImplementation;
-
- for (i = 0; i < ncursor; i++)
- if (IsAnimCur (cursors[i]))
- return BadMatch;
-
- pCursor = (CursorPtr) xalloc (sizeof (CursorRec) +
- sizeof (AnimCurRec) +
- ncursor * sizeof (AnimCurElt));
- if (!pCursor)
- return BadAlloc;
- pCursor->bits = &animCursorBits;
- animCursorBits.refcnt++;
- pCursor->refcnt = 1;
-
- pCursor->foreRed = cursors[0]->foreRed;
- pCursor->foreGreen = cursors[0]->foreGreen;
- pCursor->foreBlue = cursors[0]->foreBlue;
-
- pCursor->backRed = cursors[0]->backRed;
- pCursor->backGreen = cursors[0]->backGreen;
- pCursor->backBlue = cursors[0]->backBlue;
-
- /*
- * Fill in the AnimCurRec
- */
- ac = GetAnimCur (pCursor);
- ac->nelt = ncursor;
- ac->elts = (AnimCurElt *) (ac + 1);
-
- for (i = 0; i < ncursor; i++)
- {
- cursors[i]->refcnt++;
- ac->elts[i].pCursor = cursors[i];
- ac->elts[i].delay = deltas[i];
- }
-
- *ppCursor = pCursor;
- return Success;
-}
diff --git a/render/filter.c b/render/filter.c
deleted file mode 100644
index a2f7563cb..000000000
--- a/render/filter.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/filter.c,v 1.1 2002/09/26 02:56:52 keithp Exp $
- *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "os.h"
-#include "regionstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "input.h"
-#include "resource.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "servermd.h"
-#include "picturestr.h"
-
-static char **filterNames;
-static int nfilterNames;
-
-int
-PictureGetFilterId (char *filter, int len, Bool makeit)
-{
- int i;
- char *name;
- char **names;
-
- if (len < 0)
- len = strlen (filter);
- for (i = 0; i < nfilterNames; i++)
- if (len == strlen (filterNames[i]) &&
- !strncmp (filterNames[i], filter, len))
- return i;
- if (!makeit)
- return -1;
- name = xalloc (strlen (filter) + 1);
- if (!name)
- return -1;
- strncpy (name, filter, len);
- name[len] = '\0';
- if (filterNames)
- names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
- else
- names = xalloc (sizeof (char *));
- if (!names)
- {
- xfree (name);
- return -1;
- }
- filterNames = names;
- i = nfilterNames++;
- filterNames[i] = name;
- return i;
-}
-
-static Bool
-PictureSetDefaultIds (void)
-{
- /* careful here -- this list must match the #define values */
-
- if (PictureGetFilterId (FilterNearest, -1, TRUE) != PictFilterNearest)
- return FALSE;
- if (PictureGetFilterId (FilterBilinear, -1, TRUE) != PictFilterBilinear)
- return FALSE;
-
- if (PictureGetFilterId (FilterFast, -1, TRUE) != PictFilterFast)
- return FALSE;
- if (PictureGetFilterId (FilterGood, -1, TRUE) != PictFilterGood)
- return FALSE;
- if (PictureGetFilterId (FilterBest, -1, TRUE) != PictFilterBest)
- return FALSE;
- return TRUE;
-}
-
-char *
-PictureGetFilterName (int id)
-{
- if (0 <= id && id < nfilterNames)
- return filterNames[id];
- else
- return 0;
-}
-
-static void
-PictureFreeFilterIds (void)
-{
- int i;
-
- for (i = 0; i < nfilterNames; i++)
- xfree (filterNames[i]);
- xfree (filterNames);
- nfilterNames = 0;
- filterNames = 0;
-}
-
-int
-PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- int id = PictureGetFilterId (filter, -1, TRUE);
- int i;
- PictFilterPtr filters;
-
- if (id < 0)
- return -1;
- /*
- * It's an error to attempt to reregister a filter
- */
- for (i = 0; i < ps->nfilters; i++)
- if (ps->filters[i].id == id)
- return -1;
- if (ps->filters)
- filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
- else
- filters = xalloc (sizeof (PictFilterRec));
- if (!filters)
- return -1;
- ps->filters = filters;
- i = ps->nfilters++;
- ps->filters[i].name = PictureGetFilterName (id);
- ps->filters[i].params = params;
- ps->filters[i].nparams = nparams;
- ps->filters[i].id = id;
- return id;
-}
-
-Bool
-PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- int filter_id = PictureGetFilterId (filter, -1, FALSE);
- int alias_id = PictureGetFilterId (alias, -1, TRUE);
- int i;
-
- if (filter_id < 0 || alias_id < 0)
- return FALSE;
- for (i = 0; i < ps->nfilterAliases; i++)
- if (ps->filterAliases[i].alias_id == alias_id)
- break;
- if (i == ps->nfilterAliases)
- {
- PictFilterAliasPtr aliases;
-
- if (ps->filterAliases)
- aliases = xrealloc (ps->filterAliases,
- (ps->nfilterAliases + 1) *
- sizeof (PictFilterAliasRec));
- else
- aliases = xalloc (sizeof (PictFilterAliasRec));
- if (!aliases)
- return FALSE;
- ps->filterAliases = aliases;
- ps->filterAliases[i].alias = PictureGetFilterName (alias_id);
- ps->filterAliases[i].alias_id = alias_id;
- ps->nfilterAliases++;
- }
- ps->filterAliases[i].filter_id = filter_id;
- return TRUE;
-}
-
-PictFilterPtr
-PictureFindFilter (ScreenPtr pScreen, char *name, int len)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- int id = PictureGetFilterId (name, len, FALSE);
- int i;
-
- if (id < 0)
- return 0;
- /* Check for an alias, allow them to recurse */
- for (i = 0; i < ps->nfilterAliases; i++)
- if (ps->filterAliases[i].alias_id == id)
- {
- id = ps->filterAliases[i].filter_id;
- i = 0;
- }
- /* find the filter */
- for (i = 0; i < ps->nfilters; i++)
- if (ps->filters[i].id == id)
- return &ps->filters[i];
- return 0;
-}
-
-Bool
-PictureSetDefaultFilters (ScreenPtr pScreen)
-{
- if (!filterNames)
- if (!PictureSetDefaultIds ())
- return FALSE;
- if (PictureAddFilter (pScreen, FilterNearest, 0, 0) < 0)
- return FALSE;
- if (PictureAddFilter (pScreen, FilterBilinear, 0, 0) < 0)
- return FALSE;
-
- if (!PictureSetFilterAlias (pScreen, FilterNearest, FilterFast))
- return FALSE;
- if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterGood))
- return FALSE;
- if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterBest))
- return FALSE;
- return TRUE;
-}
-
-void
-PictureResetFilters (ScreenPtr pScreen)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- xfree (ps->filters);
- xfree (ps->filterAliases);
- PictureFreeFilterIds ();
-}
-
-int
-SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictFilterPtr pFilter = PictureFindFilter (pScreen, name, len);
- xFixed *new_params;
- int i;
-
- if (!pFilter)
- return BadName;
- if (nparams > pFilter->nparams)
- return BadMatch;
- if (pFilter->nparams != pPicture->filter_nparams)
- {
- new_params = xalloc (pFilter->nparams * sizeof (xFixed));
- if (!new_params)
- return BadAlloc;
- xfree (pPicture->filter_params);
- pPicture->filter_params = new_params;
- pPicture->filter_nparams = pFilter->nparams;
- }
- for (i = 0; i < nparams; i++)
- pPicture->filter_params[i] = params[i];
- for (; i < pFilter->nparams; i++)
- pPicture->filter_params[i] = pFilter->params[i];
- pPicture->filter = pFilter->id;
- return Success;
-}
diff --git a/render/glyph.c b/render/glyph.c
deleted file mode 100644
index b4f08c223..000000000
--- a/render/glyph.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.6 2001/10/28 03:34:19 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "os.h"
-#include "regionstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "input.h"
-#include "resource.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "servermd.h"
-#include "picturestr.h"
-#include "glyphstr.h"
-
-/*
- * From Knuth -- a good choice for hash/rehash values is p, p-2 where
- * p and p-2 are both prime. These tables are sized to have an extra 10%
- * free to avoid exponential performance degradation as the hash table fills
- */
-static GlyphHashSetRec glyphHashSets[] = {
- { 32, 43, 41 },
- { 64, 73, 71 },
- { 128, 151, 149 },
- { 256, 283, 281 },
- { 512, 571, 569 },
- { 1024, 1153, 1151 },
- { 2048, 2269, 2267 },
- { 4096, 4519, 4517 },
- { 8192, 9013, 9011 },
- { 16384, 18043, 18041 },
- { 32768, 36109, 36107 },
- { 65536, 72091, 72089 },
- { 131072, 144409, 144407 },
- { 262144, 288361, 288359 },
- { 524288, 576883, 576881 },
- { 1048576, 1153459, 1153457 },
- { 2097152, 2307163, 2307161 },
- { 4194304, 4613893, 4613891 },
- { 8388608, 9227641, 9227639 },
- { 16777216, 18455029, 18455027 },
- { 33554432, 36911011, 36911009 },
- { 67108864, 73819861, 73819859 },
- { 134217728, 147639589, 147639587 },
- { 268435456, 295279081, 295279079 },
- { 536870912, 590559793, 590559791 }
-};
-
-#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0]))
-
-const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
-
-GlyphHashRec globalGlyphs[GlyphFormatNum];
-
-GlyphHashSetPtr
-FindGlyphHashSet (CARD32 filled)
-{
- int i;
-
- for (i = 0; i < NGLYPHHASHSETS; i++)
- if (glyphHashSets[i].entries >= filled)
- return &glyphHashSets[i];
- return 0;
-}
-
-Bool
-GlyphInit (ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-GlyphRefPtr
-FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare)
-{
- CARD32 elt, step, s;
- GlyphPtr glyph;
- GlyphRefPtr table, gr, del;
- CARD32 tableSize = hash->hashSet->size;
-
- table = hash->table;
- elt = signature % tableSize;
- step = 0;
- del = 0;
- for (;;)
- {
- gr = &table[elt];
- s = gr->signature;
- glyph = gr->glyph;
- if (!glyph)
- {
- if (del)
- gr = del;
- break;
- }
- if (glyph == DeletedGlyph)
- {
- if (!del)
- del = gr;
- else if (gr == del)
- break;
- }
- else if (s == signature &&
- (!match ||
- memcmp (&compare->info, &glyph->info, compare->size) == 0))
- {
- break;
- }
- if (!step)
- {
- step = signature % hash->hashSet->rehash;
- if (!step)
- step = 1;
- }
- elt += step;
- if (elt >= tableSize)
- elt -= tableSize;
- }
- return gr;
-}
-
-CARD32
-HashGlyph (GlyphPtr glyph)
-{
- CARD32 *bits = (CARD32 *) &(glyph->info);
- CARD32 hash;
- int n = glyph->size / sizeof (CARD32);
-
- hash = 0;
- while (n--)
- hash ^= *bits++;
- return hash;
-}
-
-#ifdef CHECK_DUPLICATES
-void
-DuplicateRef (GlyphPtr glyph, char *where)
-{
- ErrorF ("Duplicate Glyph 0x%x from %s\n", glyph, where);
-}
-
-void
-CheckDuplicates (GlyphHashPtr hash, char *where)
-{
- GlyphPtr g;
- int i, j;
-
- for (i = 0; i < hash->hashSet->size; i++)
- {
- g = hash->table[i].glyph;
- if (!g || g == DeletedGlyph)
- continue;
- for (j = i + 1; j < hash->hashSet->size; j++)
- if (hash->table[j].glyph == g)
- DuplicateRef (g, where);
- }
-}
-#else
-#define CheckDuplicates(a,b)
-#define DuplicateRef(a,b)
-#endif
-
-void
-FreeGlyph (GlyphPtr glyph, int format)
-{
- CheckDuplicates (&globalGlyphs[format], "FreeGlyph");
- if (--glyph->refcnt == 0)
- {
- GlyphRefPtr gr;
- int i;
- int first;
-
- first = -1;
- for (i = 0; i < globalGlyphs[format].hashSet->size; i++)
- if (globalGlyphs[format].table[i].glyph == glyph)
- {
- if (first != -1)
- DuplicateRef (glyph, "FreeGlyph check");
- first = i;
- }
-
- gr = FindGlyphRef (&globalGlyphs[format],
- HashGlyph (glyph), TRUE, glyph);
- if (gr - globalGlyphs[format].table != first)
- DuplicateRef (glyph, "Found wrong one");
- if (gr->glyph && gr->glyph != DeletedGlyph)
- {
- gr->glyph = DeletedGlyph;
- gr->signature = 0;
- globalGlyphs[format].tableEntries--;
- }
- xfree (glyph);
- }
-}
-
-void
-AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
-{
- GlyphRefPtr gr;
- CARD32 hash;
-
- CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph top global");
- /* Locate existing matching glyph */
- hash = HashGlyph (glyph);
- gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph);
- if (gr->glyph && gr->glyph != DeletedGlyph)
- {
- xfree (glyph);
- glyph = gr->glyph;
- }
- else
- {
- gr->glyph = glyph;
- gr->signature = hash;
- globalGlyphs[glyphSet->fdepth].tableEntries++;
- }
-
- /* Insert/replace glyphset value */
- gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0);
- ++glyph->refcnt;
- if (gr->glyph && gr->glyph != DeletedGlyph)
- FreeGlyph (gr->glyph, glyphSet->fdepth);
- else
- glyphSet->hash.tableEntries++;
- gr->glyph = glyph;
- gr->signature = id;
- CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom");
-}
-
-Bool
-DeleteGlyph (GlyphSetPtr glyphSet, Glyph id)
-{
- GlyphRefPtr gr;
- GlyphPtr glyph;
-
- gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0);
- glyph = gr->glyph;
- if (glyph && glyph != DeletedGlyph)
- {
- gr->glyph = DeletedGlyph;
- glyphSet->hash.tableEntries--;
- FreeGlyph (glyph, glyphSet->fdepth);
- return TRUE;
- }
- return FALSE;
-}
-
-GlyphPtr
-FindGlyph (GlyphSetPtr glyphSet, Glyph id)
-{
- GlyphPtr glyph;
-
- glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph;
- if (glyph == DeletedGlyph)
- glyph = 0;
- return glyph;
-}
-
-GlyphPtr
-AllocateGlyph (xGlyphInfo *gi, int fdepth)
-{
- int size;
- GlyphPtr glyph;
-
- size = gi->height * PixmapBytePad (gi->width, glyphDepths[fdepth]);
- glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec));
- if (!glyph)
- return 0;
- glyph->refcnt = 0;
- glyph->size = size + sizeof (xGlyphInfo);
- glyph->info = *gi;
- return glyph;
-}
-
-Bool
-AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet)
-{
- hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec));
- if (!hash->table)
- return FALSE;
- memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec));
- hash->hashSet = hashSet;
- hash->tableEntries = 0;
- return TRUE;
-}
-
-Bool
-ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
-{
- CARD32 tableEntries;
- GlyphHashSetPtr hashSet;
- GlyphHashRec newHash;
- GlyphRefPtr gr;
- GlyphPtr glyph;
- int i;
- int oldSize;
- CARD32 s;
-
- tableEntries = hash->tableEntries + change;
- hashSet = FindGlyphHashSet (tableEntries);
- if (hashSet == hash->hashSet)
- return TRUE;
- if (global)
- CheckDuplicates (hash, "ResizeGlyphHash top");
- if (!AllocateGlyphHash (&newHash, hashSet))
- return FALSE;
- if (hash->table)
- {
- oldSize = hash->hashSet->size;
- for (i = 0; i < oldSize; i++)
- {
- glyph = hash->table[i].glyph;
- if (glyph && glyph != DeletedGlyph)
- {
- s = hash->table[i].signature;
- gr = FindGlyphRef (&newHash, s, global, glyph);
- gr->signature = s;
- gr->glyph = glyph;
- ++newHash.tableEntries;
- }
- }
- xfree (hash->table);
- }
- *hash = newHash;
- if (global)
- CheckDuplicates (hash, "ResizeGlyphHash bottom");
- return TRUE;
-}
-
-Bool
-ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change)
-{
- return (ResizeGlyphHash (&glyphSet->hash, change, FALSE) &&
- ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], change, TRUE));
-}
-
-GlyphSetPtr
-AllocateGlyphSet (int fdepth, PictFormatPtr format)
-{
- GlyphSetPtr glyphSet;
-
- if (!globalGlyphs[fdepth].hashSet)
- {
- if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0]))
- return FALSE;
- }
- glyphSet = xalloc (sizeof (GlyphSetRec));
- if (!glyphSet)
- return FALSE;
- if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0]))
- {
- xfree (glyphSet);
- return FALSE;
- }
- glyphSet->refcnt = 1;
- glyphSet->fdepth = fdepth;
- glyphSet->format = format;
- return glyphSet;
-}
-
-int
-FreeGlyphSet (pointer value,
- XID gid)
-{
- GlyphSetPtr glyphSet = (GlyphSetPtr) value;
-
- if (--glyphSet->refcnt == 0)
- {
- CARD32 i, tableSize = glyphSet->hash.hashSet->size;
- GlyphRefPtr table = glyphSet->hash.table;
- GlyphPtr glyph;
-
- for (i = 0; i < tableSize; i++)
- {
- glyph = table[i].glyph;
- if (glyph && glyph != DeletedGlyph)
- FreeGlyph (glyph, glyphSet->fdepth);
- }
- if (!globalGlyphs[glyphSet->fdepth].tableEntries)
- {
- xfree (globalGlyphs[glyphSet->fdepth].table);
- globalGlyphs[glyphSet->fdepth].table = 0;
- globalGlyphs[glyphSet->fdepth].hashSet = 0;
- }
- else
- ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
- xfree (table);
- xfree (glyphSet);
- }
- return Success;
-}
diff --git a/render/glyphstr.h b/render/glyphstr.h
deleted file mode 100644
index 99f55e3eb..000000000
--- a/render/glyphstr.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.4 2001/01/21 21:19:39 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _GLYPHSTR_H_
-#define _GLYPHSTR_H_
-
-#include "renderproto.h"
-#include "picture.h"
-#include "screenint.h"
-
-#define GlyphFormat1 0
-#define GlyphFormat4 1
-#define GlyphFormat8 2
-#define GlyphFormat16 3
-#define GlyphFormat32 4
-#define GlyphFormatNum 5
-
-typedef struct _Glyph {
- CARD32 refcnt;
- CARD32 size; /* info + bitmap */
- xGlyphInfo info;
- /* bits follow */
-} GlyphRec, *GlyphPtr;
-
-typedef struct _GlyphRef {
- CARD32 signature;
- GlyphPtr glyph;
-} GlyphRefRec, *GlyphRefPtr;
-
-#define DeletedGlyph ((GlyphPtr) 1)
-
-typedef struct _GlyphHashSet {
- CARD32 entries;
- CARD32 size;
- CARD32 rehash;
-} GlyphHashSetRec, *GlyphHashSetPtr;
-
-typedef struct _GlyphHash {
- GlyphRefPtr table;
- GlyphHashSetPtr hashSet;
- CARD32 tableEntries;
-} GlyphHashRec, *GlyphHashPtr;
-
-typedef struct _GlyphSet {
- CARD32 refcnt;
- PictFormatPtr format;
- int fdepth;
- GlyphHashRec hash;
-} GlyphSetRec, *GlyphSetPtr;
-
-typedef struct _GlyphList {
- INT16 xOff;
- INT16 yOff;
- CARD8 len;
- PictFormatPtr format;
-} GlyphListRec, *GlyphListPtr;
-
-extern GlyphHashRec globalGlyphs[GlyphFormatNum];
-
-GlyphHashSetPtr
-FindGlyphHashSet (CARD32 filled);
-
-Bool
-GlyphInit (ScreenPtr pScreen);
-
-GlyphRefPtr
-FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare);
-
-CARD32
-HashGlyph (GlyphPtr glyph);
-
-void
-FreeGlyph (GlyphPtr glyph, int format);
-
-void
-AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
-
-Bool
-DeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
-
-GlyphPtr
-FindGlyph (GlyphSetPtr glyphSet, Glyph id);
-
-GlyphPtr
-AllocateGlyph (xGlyphInfo *gi, int format);
-
-Bool
-AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
-
-Bool
-ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
-
-Bool
-ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
-
-GlyphSetPtr
-AllocateGlyphSet (int fdepth, PictFormatPtr format);
-
-int
-FreeGlyphSet (pointer value,
- XID gid);
-
-
-
-#endif /* _GLYPHSTR_H_ */
diff --git a/render/miglyph.c b/render/miglyph.c
deleted file mode 100644
index 00b6764d6..000000000
--- a/render/miglyph.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.6 2000/12/05 03:13:31 keithp Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-void
-miGlyphExtents (int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs,
- BoxPtr extents)
-{
- int x1, x2, y1, y2;
- int n;
- GlyphPtr glyph;
- int x, y;
-
- x = 0;
- y = 0;
- extents->x1 = MAXSHORT;
- extents->x2 = MINSHORT;
- extents->y1 = MAXSHORT;
- extents->y2 = MINSHORT;
- while (nlist--)
- {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- list++;
- while (n--)
- {
- glyph = *glyphs++;
- x1 = x - glyph->info.x;
- if (x1 < MINSHORT)
- x1 = MINSHORT;
- y1 = y - glyph->info.y;
- if (y1 < MINSHORT)
- y1 = MINSHORT;
- x2 = x1 + glyph->info.width;
- if (x2 > MAXSHORT)
- x2 = MAXSHORT;
- y2 = y1 + glyph->info.height;
- if (y2 > MAXSHORT)
- y2 = MAXSHORT;
- if (x1 < extents->x1)
- extents->x1 = x1;
- if (x2 > extents->x2)
- extents->x2 = x2;
- if (y1 < extents->y1)
- extents->y1 = y1;
- if (y2 > extents->y2)
- extents->y2 = y2;
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- }
-}
-
-#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
-
-void
-miGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
-{
- PixmapPtr pPixmap = 0;
- PicturePtr pPicture;
- PixmapPtr pMaskPixmap = 0;
- PicturePtr pMask;
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- int width = 0, height = 0;
- int x, y;
- int xDst = list->xOff, yDst = list->yOff;
- int n;
- GlyphPtr glyph;
- int error;
- BoxRec extents;
- CARD32 component_alpha;
-
- if (maskFormat)
- {
- GCPtr pGC;
- xRectangle rect;
-
- miGlyphExtents (nlist, list, glyphs, &extents);
-
- if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
- return;
- width = extents.x2 - extents.x1;
- height = extents.y2 - extents.y1;
- pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth);
- if (!pMaskPixmap)
- return;
- component_alpha = NeedsComponent(maskFormat->format);
- pMask = CreatePicture (0, &pMaskPixmap->drawable,
- maskFormat, CPComponentAlpha, &component_alpha,
- serverClient, &error);
- if (!pMask)
- {
- (*pScreen->DestroyPixmap) (pMaskPixmap);
- return;
- }
- pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen);
- ValidateGC (&pMaskPixmap->drawable, pGC);
- rect.x = 0;
- rect.y = 0;
- rect.width = width;
- rect.height = height;
- (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect);
- FreeScratchGC (pGC);
- x = -extents.x1;
- y = -extents.y1;
- }
- else
- {
- pMask = pDst;
- x = 0;
- y = 0;
- }
- pPicture = 0;
- while (nlist--)
- {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- while (n--)
- {
- glyph = *glyphs++;
- if (!pPicture)
- {
- pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height,
- list->format->depth,
- list->format->depth,
- 0, (pointer) (glyph + 1));
- if (!pPixmap)
- return;
- component_alpha = NeedsComponent(list->format->format);
- pPicture = CreatePicture (0, &pPixmap->drawable, list->format,
- CPComponentAlpha, &component_alpha,
- serverClient, &error);
- if (!pPicture)
- {
- FreeScratchPixmapHeader (pPixmap);
- return;
- }
- }
- (*pScreen->ModifyPixmapHeader) (pPixmap,
- glyph->info.width, glyph->info.height,
- 0, 0, -1, (pointer) (glyph + 1));
- pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- if (maskFormat)
- {
- CompositePicture (PictOpAdd,
- pPicture,
- None,
- pMask,
- 0, 0,
- 0, 0,
- x - glyph->info.x,
- y - glyph->info.y,
- glyph->info.width,
- glyph->info.height);
- }
- else
- {
- CompositePicture (op,
- pSrc,
- pPicture,
- pDst,
- xSrc + (x - glyph->info.x) - xDst,
- ySrc + (y - glyph->info.y) - yDst,
- 0, 0,
- x - glyph->info.x,
- y - glyph->info.y,
- glyph->info.width,
- glyph->info.height);
- }
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- list++;
- if (pPicture)
- {
- FreeScratchPixmapHeader (pPixmap);
- FreePicture ((pointer) pPicture, 0);
- pPicture = 0;
- pPixmap = 0;
- }
- }
- if (maskFormat)
- {
- x = extents.x1;
- y = extents.y1;
- CompositePicture (op,
- pSrc,
- pMask,
- pDst,
- xSrc + x - xDst,
- ySrc + y - yDst,
- 0, 0,
- x, y,
- width, height);
- FreePicture ((pointer) pMask, (XID) 0);
- (*pScreen->DestroyPixmap) (pMaskPixmap);
- }
-}
diff --git a/render/miindex.c b/render/miindex.c
deleted file mode 100644
index 739348273..000000000
--- a/render/miindex.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/miindex.c,v 1.8 2002/11/06 22:45:36 keithp Exp $
- *
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _MIINDEX_H_
-#define _MIINDEX_H_
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-#include "colormapst.h"
-
-#define NUM_CUBE_LEVELS 4
-#define NUM_GRAY_LEVELS 13
-
-static Bool
-miBuildRenderColormap (ColormapPtr pColormap, Pixel *pixels, int *nump)
-{
- int r, g, b;
- unsigned short red, green, blue;
- Pixel pixel;
- Bool used[MI_MAX_INDEXED];
- int needed;
- int policy;
- int cube, gray;
- int i, n;
-
- if (pColormap->mid != pColormap->pScreen->defColormap)
- {
- policy = PictureCmapPolicyAll;
- }
- else
- {
- int avail = pColormap->pVisual->ColormapEntries;
- policy = PictureCmapPolicy;
- if (policy == PictureCmapPolicyDefault)
- {
- if (avail >= 256 && (pColormap->pVisual->class|DynamicClass) == PseudoColor)
- policy = PictureCmapPolicyColor;
- else if (avail >= 64)
- policy = PictureCmapPolicyGray;
- else
- policy = PictureCmapPolicyMono;
- }
- }
- /*
- * Make sure enough cells are free for the chosen policy
- */
- for (;;)
- {
- switch (policy) {
- case PictureCmapPolicyAll:
- needed = 0;
- break;
- case PictureCmapPolicyColor:
- needed = 71;
- break;
- case PictureCmapPolicyGray:
- needed = 11;
- break;
- case PictureCmapPolicyMono:
- default:
- needed = 0;
- break;
- }
- if (needed <= pColormap->freeRed)
- break;
- policy--;
- }
-
- /*
- * Compute size of cube and gray ramps
- */
- cube = gray = 0;
- switch (policy) {
- case PictureCmapPolicyAll:
- /*
- * Allocate as big a cube as possible
- */
- if ((pColormap->pVisual->class|DynamicClass) == PseudoColor)
- {
- for (cube = 1; cube * cube * cube < pColormap->pVisual->ColormapEntries; cube++)
- ;
- cube--;
- if (cube == 1)
- cube = 0;
- }
- else
- cube = 0;
- /*
- * Figure out how many gray levels to use so that they
- * line up neatly with the cube
- */
- if (cube)
- {
- needed = pColormap->pVisual->ColormapEntries - (cube*cube*cube);
- /* levels to fill in with */
- gray = needed / (cube - 1);
- /* total levels */
- gray = (gray + 1) * (cube - 1) + 1;
- }
- else
- gray = pColormap->pVisual->ColormapEntries;
- break;
-
- case PictureCmapPolicyColor:
- cube = NUM_CUBE_LEVELS;
- /* fall through ... */
- case PictureCmapPolicyGray:
- gray = NUM_GRAY_LEVELS;
- break;
- case PictureCmapPolicyMono:
- default:
- gray = 2;
- break;
- }
-
- memset (used, '\0', pColormap->pVisual->ColormapEntries * sizeof (Bool));
- for (r = 0; r < cube; r++)
- for (g = 0; g < cube; g++)
- for (b = 0; b < cube; b++)
- {
- red = (r * 65535 + (cube-1)/2) / (cube - 1);
- green = (g * 65535 + (cube-1)/2) / (cube - 1);
- blue = (b * 65535 + (cube-1)/2) / (cube - 1);
- if (AllocColor (pColormap, &red, &green,
- &blue, &pixel, 0) != Success)
- return FALSE;
- used[pixel] = TRUE;
- }
- for (g = 0; g < gray; g++)
- {
- red = green = blue = (g * 65535 + (gray-1)/2) / (gray - 1);
- if (AllocColor (pColormap, &red, &green, &blue, &pixel, 0) != Success)
- return FALSE;
- used[pixel] = TRUE;
- }
- n = 0;
- for (i = 0; i < pColormap->pVisual->ColormapEntries; i++)
- if (used[i])
- pixels[n++] = i;
-
- *nump = n;
-
- return TRUE;
-}
-
-/* 0 <= red, green, blue < 32 */
-static Pixel
-FindBestColor (miIndexedPtr pIndexed, Pixel *pixels, int num,
- int red, int green, int blue)
-{
- Pixel best = pixels[0];
- int bestDist = 1 << 30;
- int dist;
- int dr, dg, db;
- while (num--)
- {
- Pixel pixel = *pixels++;
- CARD32 v = pIndexed->rgba[pixel];
-
- dr = ((v >> 19) & 0x1f);
- dg = ((v >> 11) & 0x1f);
- db = ((v >> 3) & 0x1f);
- dr = dr - red;
- dg = dg - green;
- db = db - blue;
- dist = dr * dr + dg * dg + db * db;
- if (dist < bestDist)
- {
- bestDist = dist;
- best = pixel;
- }
- }
- return best;
-}
-
-/* 0 <= gray < 32768 */
-static Pixel
-FindBestGray (miIndexedPtr pIndexed, Pixel *pixels, int num, int gray)
-{
- Pixel best = pixels[0];
- int bestDist = 1 << 30;
- int dist;
- int dr;
- int r;
-
- while (num--)
- {
- Pixel pixel = *pixels++;
- CARD32 v = pIndexed->rgba[pixel];
-
- r = v & 0xff;
- r = r | (r << 8);
- dr = gray - (r >> 1);
- dist = dr * dr;
- if (dist < bestDist)
- {
- bestDist = dist;
- best = pixel;
- }
- }
- return best;
-}
-
-Bool
-miInitIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat)
-{
- ColormapPtr pColormap = pFormat->index.pColormap;
- VisualPtr pVisual = pColormap->pVisual;
- miIndexedPtr pIndexed;
- Pixel pixels[MI_MAX_INDEXED];
- xrgb rgb[MI_MAX_INDEXED];
- int num;
- int i;
- Pixel p, r, g, b;
-
- if (pVisual->ColormapEntries > MI_MAX_INDEXED)
- return FALSE;
-
- if (pVisual->class & DynamicClass)
- {
- if (!miBuildRenderColormap (pColormap, pixels, &num))
- return FALSE;
- }
- else
- {
- num = pVisual->ColormapEntries;
- for (p = 0; p < num; p++)
- pixels[p] = p;
- }
-
- pIndexed = xalloc (sizeof (miIndexedRec));
- if (!pIndexed)
- return FALSE;
-
- pFormat->index.nvalues = num;
- pFormat->index.pValues = xalloc (num * sizeof (xIndexValue));
- if (!pFormat->index.pValues)
- {
- xfree (pIndexed);
- return FALSE;
- }
-
-
- /*
- * Build mapping from pixel value to ARGB
- */
- QueryColors (pColormap, num, pixels, rgb);
- for (i = 0; i < num; i++)
- {
- p = pixels[i];
- pFormat->index.pValues[i].pixel = p;
- pFormat->index.pValues[i].red = rgb[i].red;
- pFormat->index.pValues[i].green = rgb[i].green;
- pFormat->index.pValues[i].blue = rgb[i].blue;
- pFormat->index.pValues[i].alpha = 0xffff;
- pIndexed->rgba[p] = (0xff000000 |
- ((rgb[i].red & 0xff00) << 8) |
- ((rgb[i].green & 0xff00) ) |
- ((rgb[i].blue & 0xff00) >> 8));
- }
-
- /*
- * Build mapping from RGB to pixel value. This could probably be
- * done a bit quicker...
- */
- switch (pVisual->class | DynamicClass) {
- case GrayScale:
- pIndexed->color = FALSE;
- for (r = 0; r < 32768; r++)
- pIndexed->ent[r] = FindBestGray (pIndexed, pixels, num, r);
- break;
- case PseudoColor:
- pIndexed->color = TRUE;
- p = 0;
- for (r = 0; r < 32; r++)
- for (g = 0; g < 32; g++)
- for (b = 0; b < 32; b++)
- {
- pIndexed->ent[p] = FindBestColor (pIndexed, pixels, num,
- r, g, b);
- p++;
- }
- break;
- }
- pFormat->index.devPrivate = pIndexed;
- return TRUE;
-}
-
-void
-miCloseIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat)
-{
- if (pFormat->index.devPrivate)
- {
- xfree (pFormat->index.devPrivate);
- pFormat->index.devPrivate = 0;
- }
- if (pFormat->index.pValues)
- {
- xfree (pFormat->index.pValues);
- pFormat->index.pValues = 0;
- }
-}
-
-void
-miUpdateIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat,
- int ndef,
- xColorItem *pdef)
-{
- miIndexedPtr pIndexed = pFormat->index.devPrivate;
-
- if (pIndexed)
- {
- while (ndef--)
- {
- pIndexed->rgba[pdef->pixel] = (0xff000000 |
- ((pdef->red & 0xff00) << 8) |
- ((pdef->green & 0xff00) ) |
- ((pdef->blue & 0xff00) >> 8));
- pdef++;
- }
- }
-}
-
-#endif /* _MIINDEX_H_ */
diff --git a/render/mipict.c b/render/mipict.c
deleted file mode 100644
index 0f0cf6c8b..000000000
--- a/render/mipict.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.16 2003/11/10 18:22:52 tsi Exp $
- *
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-#ifndef __GNUC__
-#define __inline
-#endif
-
-int
-miCreatePicture (PicturePtr pPicture)
-{
- return Success;
-}
-
-void
-miDestroyPicture (PicturePtr pPicture)
-{
- if (pPicture->freeCompClip)
- REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip);
-}
-
-void
-miDestroyPictureClip (PicturePtr pPicture)
-{
- switch (pPicture->clientClipType) {
- case CT_NONE:
- return;
- case CT_PIXMAP:
- (*pPicture->pDrawable->pScreen->DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
- break;
- default:
- /*
- * we know we'll never have a list of rectangles, since ChangeClip
- * immediately turns them into a region
- */
- REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip);
- break;
- }
- pPicture->clientClip = NULL;
- pPicture->clientClipType = CT_NONE;
-}
-
-int
-miChangePictureClip (PicturePtr pPicture,
- int type,
- pointer value,
- int n)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- pointer clientClip;
- int clientClipType;
-
- switch (type) {
- case CT_PIXMAP:
- /* convert the pixmap to a region */
- clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value);
- if (!clientClip)
- return BadAlloc;
- clientClipType = CT_REGION;
- (*pScreen->DestroyPixmap) ((PixmapPtr) value);
- break;
- case CT_REGION:
- clientClip = value;
- clientClipType = CT_REGION;
- break;
- case CT_NONE:
- clientClip = 0;
- clientClipType = CT_NONE;
- break;
- default:
- clientClip = (pointer) RECTS_TO_REGION(pScreen, n,
- (xRectangle *) value,
- type);
- if (!clientClip)
- return BadAlloc;
- clientClipType = CT_REGION;
- xfree(value);
- break;
- }
- (*ps->DestroyPictureClip) (pPicture);
- pPicture->clientClip = clientClip;
- pPicture->clientClipType = clientClipType;
- pPicture->stateChanges |= CPClipMask;
- return Success;
-}
-
-void
-miChangePicture (PicturePtr pPicture,
- Mask mask)
-{
- return;
-}
-
-void
-miValidatePicture (PicturePtr pPicture,
- Mask mask)
-{
- DrawablePtr pDrawable = pPicture->pDrawable;
- ScreenPtr pScreen = pDrawable->pScreen;
-
- if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) ||
- (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS)))
- {
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pPicture->subWindowMode == IncludeInferiors)
- {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- }
- else
- {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pPicture->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy
- * (or maybe re-use) it later. this way, we avoid unnecessary
- * copying of regions. (this wins especially if many clients clip
- * by children and have no client clip.)
- */
- if (pPicture->clientClipType == CT_NONE)
- {
- if (freeCompClip)
- REGION_DESTROY(pScreen, pPicture->pCompositeClip);
- pPicture->pCompositeClip = pregWin;
- pPicture->freeCompClip = freeTmpClip;
- }
- else
- {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
- pDrawable->x + pPicture->clipOrigin.x,
- pDrawable->y + pPicture->clipOrigin.y);
-
- if (freeCompClip)
- {
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
- pregWin, pPicture->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pScreen, pregWin);
- }
- else if (freeTmpClip)
- {
- REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip);
- pPicture->pCompositeClip = pregWin;
- }
- else
- {
- pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
- pregWin, pPicture->clientClip);
- }
- pPicture->freeCompClip = TRUE;
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
- -(pDrawable->x + pPicture->clipOrigin.x),
- -(pDrawable->y + pPicture->clipOrigin.y));
- }
- } /* end of composite clip for a window */
- else
- {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- /* If you want pixmaps in offscreen memory, yes */
- pixbounds.x1 = pDrawable->x;
- pixbounds.y1 = pDrawable->y;
- pixbounds.x2 = pDrawable->x + pDrawable->width;
- pixbounds.y2 = pDrawable->y + pDrawable->height;
-
- if (pPicture->freeCompClip)
- {
- REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds);
- }
- else
- {
- pPicture->freeCompClip = TRUE;
- pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1);
- }
-
- if (pPicture->clientClipType == CT_REGION)
- {
- if(pDrawable->x || pDrawable->y) {
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
- pDrawable->x + pPicture->clipOrigin.x,
- pDrawable->y + pPicture->clipOrigin.y);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
- pPicture->pCompositeClip, pPicture->clientClip);
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
- -(pDrawable->x + pPicture->clipOrigin.x),
- -(pDrawable->y + pPicture->clipOrigin.y));
- } else {
- REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
- -pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
- pPicture->pCompositeClip, pPicture->clientClip);
- REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
- pPicture->clipOrigin.x, pPicture->clipOrigin.y);
- }
- }
- } /* end of composite clip for pixmap */
- }
-}
-
-#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
-
-static __inline Bool
-miClipPictureReg (ScreenPtr pScreen,
- RegionPtr pRegion,
- RegionPtr pClip,
- int dx,
- int dy)
-{
- if (REGION_NUM_RECTS(pRegion) == 1 &&
- REGION_NUM_RECTS(pClip) == 1)
- {
- BoxPtr pRbox = REGION_RECTS(pRegion);
- BoxPtr pCbox = REGION_RECTS(pClip);
- int v;
-
- if (pRbox->x1 < (v = pCbox->x1 + dx))
- pRbox->x1 = BOUND(v);
- if (pRbox->x2 > (v = pCbox->x2 + dx))
- pRbox->x2 = BOUND(v);
- if (pRbox->y1 < (v = pCbox->y1 + dy))
- pRbox->y1 = BOUND(v);
- if (pRbox->y2 > (v = pCbox->y2 + dy))
- pRbox->y2 = BOUND(v);
- if (pRbox->x1 >= pRbox->x2 ||
- pRbox->y1 >= pRbox->y2)
- {
- REGION_EMPTY(pScreen, pRegion);
- }
- }
- else
- {
- REGION_TRANSLATE(pScreen, pRegion, dx, dy);
- if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
- return FALSE;
- REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
- }
- return TRUE;
-}
-
-static __inline Bool
-miClipPictureSrc (ScreenPtr pScreen,
- RegionPtr pRegion,
- PicturePtr pPicture,
- int dx,
- int dy)
-{
- /* XXX what to do with clipping from transformed pictures? */
- if (pPicture->transform)
- return TRUE;
- if (pPicture->repeat)
- {
- if (pPicture->clientClipType != CT_NONE)
- {
- REGION_TRANSLATE(pScreen, pRegion,
- dx - pPicture->clipOrigin.x,
- dy - pPicture->clipOrigin.y);
- if (!REGION_INTERSECT (pScreen, pRegion, pRegion,
- (RegionPtr) pPicture->clientClip))
- return FALSE;
- REGION_TRANSLATE(pScreen, pRegion,
- - (dx - pPicture->clipOrigin.x),
- - (dy - pPicture->clipOrigin.y));
- }
- return TRUE;
- }
- else
- {
- return miClipPictureReg (pScreen, pRegion, pPicture->pCompositeClip,
- dx, dy);
- }
-}
-
-Bool
-miComputeCompositeRegion (RegionPtr pRegion,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- ScreenPtr pScreen = pSrc->pDrawable->pScreen;
- int v;
-
- pRegion->extents.x1 = xDst;
- v = xDst + width;
- pRegion->extents.x2 = BOUND(v);
- pRegion->extents.y1 = yDst;
- v = yDst + height;
- pRegion->extents.y2 = BOUND(v);
- pRegion->data = 0;
- /* Check for empty operation */
- if (pRegion->extents.x1 >= pRegion->extents.x2 ||
- pRegion->extents.y1 >= pRegion->extents.y2)
- {
- REGION_EMPTY (pScreen, pRegion);
- return TRUE;
- }
- /* clip against src */
- if (!miClipPictureSrc (pScreen, pRegion, pSrc, xDst - xSrc, yDst - ySrc))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- if (pSrc->alphaMap)
- {
- if (!miClipPictureSrc (pScreen, pRegion, pSrc->alphaMap,
- xDst - (xSrc + pSrc->alphaOrigin.x),
- yDst - (ySrc + pSrc->alphaOrigin.y)))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- }
- /* clip against mask */
- if (pMask)
- {
- if (!miClipPictureSrc (pScreen, pRegion, pMask,
- xDst - xMask, yDst - yMask))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- if (pMask->alphaMap)
- {
- if (!miClipPictureSrc (pScreen, pRegion, pMask->alphaMap,
- xDst - (xMask + pMask->alphaOrigin.x),
- yDst - (yMask + pMask->alphaOrigin.y)))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- }
- }
- if (!miClipPictureReg (pScreen, pRegion, pDst->pCompositeClip, 0, 0))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- if (pDst->alphaMap)
- {
- if (!miClipPictureReg (pScreen,
- pRegion, pDst->alphaMap->pCompositeClip,
- -pDst->alphaOrigin.x,
- -pDst->alphaOrigin.y))
- {
- REGION_UNINIT (pScreen, pRegion);
- return FALSE;
- }
- }
- return TRUE;
-}
-
-void
-miRenderColorToPixel (PictFormatPtr format,
- xRenderColor *color,
- CARD32 *pixel)
-{
- CARD32 r, g, b, a;
- miIndexedPtr pIndexed;
-
- switch (format->type) {
- case PictTypeDirect:
- r = color->red >> (16 - Ones (format->direct.redMask));
- g = color->green >> (16 - Ones (format->direct.greenMask));
- b = color->blue >> (16 - Ones (format->direct.blueMask));
- a = color->alpha >> (16 - Ones (format->direct.alphaMask));
- r = r << format->direct.red;
- g = g << format->direct.green;
- b = b << format->direct.blue;
- a = a << format->direct.alpha;
- *pixel = r|g|b|a;
- break;
- case PictTypeIndexed:
- pIndexed = (miIndexedPtr) (format->index.devPrivate);
- if (pIndexed->color)
- {
- r = color->red >> 11;
- g = color->green >> 11;
- b = color->blue >> 11;
- *pixel = miIndexToEnt15 (pIndexed, (r << 10) | (g << 5) | b);
- }
- else
- {
- r = color->red >> 8;
- g = color->green >> 8;
- b = color->blue >> 8;
- *pixel = miIndexToEntY24 (pIndexed, (r << 16) | (g << 8) | b);
- }
- break;
- }
-}
-
-static CARD16
-miFillColor (CARD32 pixel, int bits)
-{
- while (bits < 16)
- {
- pixel |= pixel << bits;
- bits <<= 1;
- }
- return (CARD16) pixel;
-}
-
-void
-miRenderPixelToColor (PictFormatPtr format,
- CARD32 pixel,
- xRenderColor *color)
-{
- CARD32 r, g, b, a;
- miIndexedPtr pIndexed;
-
- switch (format->type) {
- case PictTypeDirect:
- r = (pixel >> format->direct.red) & format->direct.redMask;
- g = (pixel >> format->direct.green) & format->direct.greenMask;
- b = (pixel >> format->direct.blue) & format->direct.blueMask;
- a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
- color->red = miFillColor (r, Ones (format->direct.redMask));
- color->green = miFillColor (g, Ones (format->direct.greenMask));
- color->blue = miFillColor (b, Ones (format->direct.blueMask));
- color->alpha = miFillColor (a, Ones (format->direct.alphaMask));
- break;
- case PictTypeIndexed:
- pIndexed = (miIndexedPtr) (format->index.devPrivate);
- pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED-1)];
- r = (pixel >> 16) & 0xff;
- g = (pixel >> 8) & 0xff;
- b = (pixel ) & 0xff;
- color->red = miFillColor (r, 8);
- color->green = miFillColor (g, 8);
- color->blue = miFillColor (b, 8);
- color->alpha = 0xffff;
- break;
- }
-}
-
-Bool
-miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
-{
- PictureScreenPtr ps;
-
- if (!PictureInit (pScreen, formats, nformats))
- return FALSE;
- ps = GetPictureScreen(pScreen);
- ps->CreatePicture = miCreatePicture;
- ps->DestroyPicture = miDestroyPicture;
- ps->ChangePictureClip = miChangePictureClip;
- ps->DestroyPictureClip = miDestroyPictureClip;
- ps->ChangePicture = miChangePicture;
- ps->ValidatePicture = miValidatePicture;
- ps->InitIndexed = miInitIndexed;
- ps->CloseIndexed = miCloseIndexed;
- ps->UpdateIndexed = miUpdateIndexed;
-
- /* MI rendering routines */
- ps->Composite = 0; /* requires DDX support */
- ps->Glyphs = miGlyphs;
- ps->CompositeRects = miCompositeRects;
- ps->Trapezoids = miTrapezoids;
- ps->Triangles = miTriangles;
- ps->TriStrip = miTriStrip;
- ps->TriFan = miTriFan;
-
- return TRUE;
-}
diff --git a/render/mipict.h b/render/mipict.h
deleted file mode 100644
index 0154fb5f0..000000000
--- a/render/mipict.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/mipict.h,v 1.13 2002/11/06 22:45:36 keithp Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _MIPICT_H_
-#define _MIPICT_H_
-
-#include "picturestr.h"
-
-#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
-
-#if MI_MAX_INDEXED <= 256
-typedef CARD8 miIndexType;
-#endif
-
-typedef struct _miIndexed {
- Bool color;
- CARD32 rgba[MI_MAX_INDEXED];
- miIndexType ent[32768];
-} miIndexedRec, *miIndexedPtr;
-
-#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 6) & 0x03e0) | \
- (((s) >> 9) & 0x7c00))
-#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
-#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
-
-#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
-
-int
-miCreatePicture (PicturePtr pPicture);
-
-void
-miDestroyPicture (PicturePtr pPicture);
-
-void
-miDestroyPictureClip (PicturePtr pPicture);
-
-int
-miChangePictureClip (PicturePtr pPicture,
- int type,
- pointer value,
- int n);
-
-void
-miChangePicture (PicturePtr pPicture,
- Mask mask);
-
-void
-miValidatePicture (PicturePtr pPicture,
- Mask mask);
-
-
-Bool
-miClipPicture (RegionPtr pRegion,
- PicturePtr pPicture,
- INT16 xReg,
- INT16 yReg,
- INT16 xPict,
- INT16 yPict);
-
-Bool
-miComputeCompositeRegion (RegionPtr pRegion,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-Bool
-miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
-
-void
-miGlyphExtents (int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs,
- BoxPtr extents);
-
-void
-miGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-
-void
-miRenderColorToPixel (PictFormatPtr pPict,
- xRenderColor *color,
- CARD32 *pixel);
-
-void
-miRenderPixelToColor (PictFormatPtr pPict,
- CARD32 pixel,
- xRenderColor *color);
-
-void
-miCompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects);
-
-void
-miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
-
-void
-miTrapezoids (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntrap,
- xTrapezoid *traps);
-
-void
-miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
-
-void
-miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
-
-void
-miRasterizeTriangle (PicturePtr pMask,
- xTriangle *tri,
- int x_off,
- int y_off);
-
-void
-miTriangles (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntri,
- xTriangle *tris);
-
-void
-miTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-void
-miTriFan (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-PicturePtr
-miCreateAlphaPicture (ScreenPtr pScreen,
- PicturePtr pDst,
- PictFormatPtr pPictFormat,
- CARD16 width,
- CARD16 height);
-
-Bool
-miInitIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat);
-
-void
-miCloseIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat);
-
-void
-miUpdateIndexed (ScreenPtr pScreen,
- PictFormatPtr pFormat,
- int ndef,
- xColorItem *pdef);
-
-#endif /* _MIPICT_H_ */
diff --git a/render/mirect.c b/render/mirect.c
deleted file mode 100644
index 33c7a9f14..000000000
--- a/render/mirect.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/mirect.c,v 1.4 2001/06/08 19:36:34 keithp Exp $
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-static void
-miColorRects (PicturePtr pDst,
- PicturePtr pClipPict,
- xRenderColor *color,
- int nRect,
- xRectangle *rects,
- int xoff,
- int yoff)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- CARD32 pixel;
- GCPtr pGC;
- CARD32 tmpval[4];
- RegionPtr pClip;
- unsigned long mask;
-
- miRenderColorToPixel (pDst->pFormat, color, &pixel);
-
- pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
- if (!pGC)
- return;
- tmpval[0] = GXcopy;
- tmpval[1] = pixel;
- mask = GCFunction | GCForeground;
- if (pClipPict->clientClipType == CT_REGION)
- {
- tmpval[2] = pDst->clipOrigin.x - xoff;
- tmpval[3] = pDst->clipOrigin.y - yoff;
- mask |= CPClipXOrigin|CPClipYOrigin;
-
- pClip = REGION_CREATE (pScreen, NULL, 1);
- REGION_COPY (pScreen, pClip,
- (RegionPtr) pClipPict->clientClip);
- (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
- }
-
- ChangeGC (pGC, mask, tmpval);
- ValidateGC (pDst->pDrawable, pGC);
- if (xoff || yoff)
- {
- int i;
- for (i = 0; i < nRect; i++)
- {
- rects[i].x -= xoff;
- rects[i].y -= yoff;
- }
- }
- (*pGC->ops->PolyFillRect) (pDst->pDrawable, pGC, nRect, rects);
- if (xoff || yoff)
- {
- int i;
- for (i = 0; i < nRect; i++)
- {
- rects[i].x += xoff;
- rects[i].y += yoff;
- }
- }
- FreeScratchGC (pGC);
-}
-
-void
-miCompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
-
- if (color->alpha == 0xffff)
- {
- if (op == PictOpOver)
- op = PictOpSrc;
- }
- if (op == PictOpClear)
- color->red = color->green = color->blue = color->alpha = 0;
-
- if (op == PictOpSrc || op == PictOpClear)
- {
- miColorRects (pDst, pDst, color, nRect, rects, 0, 0);
- if (pDst->alphaMap)
- miColorRects (pDst->alphaMap, pDst,
- color, nRect, rects,
- pDst->alphaOrigin.x,
- pDst->alphaOrigin.y);
- }
- else
- {
- PictFormatPtr rgbaFormat;
- PixmapPtr pPixmap;
- PicturePtr pSrc;
- xRectangle one;
- int error;
- Pixel pixel;
- GCPtr pGC;
- CARD32 tmpval[2];
-
- rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
- if (!rgbaFormat)
- goto bail1;
-
- pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1,
- rgbaFormat->depth);
- if (!pPixmap)
- goto bail2;
-
- miRenderColorToPixel (rgbaFormat, color, &pixel);
-
- pGC = GetScratchGC (rgbaFormat->depth, pScreen);
- if (!pGC)
- goto bail3;
- tmpval[0] = GXcopy;
- tmpval[1] = pixel;
-
- ChangeGC (pGC, GCFunction | GCForeground, tmpval);
- ValidateGC (&pPixmap->drawable, pGC);
- one.x = 0;
- one.y = 0;
- one.width = 1;
- one.height = 1;
- (*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
-
- tmpval[0] = xTrue;
- pSrc = CreatePicture (0, &pPixmap->drawable, rgbaFormat,
- CPRepeat, tmpval, 0, &error);
-
- if (!pSrc)
- goto bail4;
-
- while (nRect--)
- {
- CompositePicture (op, pSrc, 0, pDst, 0, 0, 0, 0,
- rects->x,
- rects->y,
- rects->width,
- rects->height);
- rects++;
- }
-
- FreePicture ((pointer) pSrc, 0);
-bail4:
- FreeScratchGC (pGC);
-bail3:
- (*pScreen->DestroyPixmap) (pPixmap);
-bail2:
-bail1:
- ;
- }
-}
diff --git a/render/mitrap.c b/render/mitrap.c
deleted file mode 100644
index 7f592ccd4..000000000
--- a/render/mitrap.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.9 2002/11/05 23:39:16 keithp Exp $
- *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "servermd.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-PicturePtr
-miCreateAlphaPicture (ScreenPtr pScreen,
- PicturePtr pDst,
- PictFormatPtr pPictFormat,
- CARD16 width,
- CARD16 height)
-{
- PixmapPtr pPixmap;
- PicturePtr pPicture;
- GCPtr pGC;
- int error;
- xRectangle rect;
-
- if (width > 32767 || height > 32767)
- return 0;
-
- if (!pPictFormat)
- {
- if (pDst->polyEdge == PolyEdgeSharp)
- pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
- else
- pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
- if (!pPictFormat)
- return 0;
- }
-
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
- pPictFormat->depth);
- if (!pPixmap)
- return 0;
- pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
- if (!pGC)
- {
- (*pScreen->DestroyPixmap) (pPixmap);
- return 0;
- }
- ValidateGC (&pPixmap->drawable, pGC);
- rect.x = 0;
- rect.y = 0;
- rect.width = width;
- rect.height = height;
- (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
- FreeScratchGC (pGC);
- pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
- 0, 0, serverClient, &error);
- (*pScreen->DestroyPixmap) (pPixmap);
- return pPicture;
-}
-
-static xFixed
-miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
-{
- xFixed dx = l->p2.x - l->p1.x;
- xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
- xFixed dy = l->p2.y - l->p1.y;
- if (ceil)
- ex += (dy - 1);
- return l->p1.x + (xFixed) (ex / dy);
-}
-
-void
-miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box)
-{
- box->y1 = MAXSHORT;
- box->y2 = MINSHORT;
- box->x1 = MAXSHORT;
- box->x2 = MINSHORT;
- for (; ntrap; ntrap--, traps++)
- {
- INT16 x1, y1, x2, y2;
-
- if (!xTrapezoidValid(traps))
- continue;
- y1 = xFixedToInt (traps->top);
- if (y1 < box->y1)
- box->y1 = y1;
-
- y2 = xFixedToInt (xFixedCeil (traps->bottom));
- if (y2 > box->y2)
- box->y2 = y2;
-
- x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE),
- miLineFixedX (&traps->left, traps->bottom, FALSE)));
- if (x1 < box->x1)
- box->x1 = x1;
-
- x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE),
- miLineFixedX (&traps->right, traps->bottom, TRUE))));
- if (x2 > box->x2)
- box->x2 = x2;
- }
-}
-
-void
-miTrapezoids (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntrap,
- xTrapezoid *traps)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- PicturePtr pPicture = 0;
- BoxRec bounds;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
- xDst = traps[0].left.p1.x >> 16;
- yDst = traps[0].left.p1.y >> 16;
-
- if (maskFormat)
- {
- miTrapezoidBounds (ntrap, traps, &bounds);
- if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
- return;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- return;
- }
- for (; ntrap; ntrap--, traps++)
- {
- if (!xTrapezoidValid(traps))
- continue;
- if (!maskFormat)
- {
- miTrapezoidBounds (1, traps, &bounds);
- if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
- continue;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- continue;
- }
- (*ps->RasterizeTrapezoid) (pPicture, traps,
- -bounds.x1, -bounds.y1);
- if (!maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
- }
- if (maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
-}
diff --git a/render/mitri.c b/render/mitri.c
deleted file mode 100644
index fc706f117..000000000
--- a/render/mitri.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/mitri.c,v 1.6 2002/08/12 04:03:21 keithp Exp $
- *
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-void
-miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds)
-{
- bounds->x1 = xFixedToInt (points->x);
- bounds->x2 = xFixedToInt (xFixedCeil (points->x));
- bounds->y1 = xFixedToInt (points->y);
- bounds->y2 = xFixedToInt (xFixedCeil (points->y));
- points++;
- npoint--;
- while (npoint-- > 0)
- {
- INT16 x1 = xFixedToInt (points->x);
- INT16 x2 = xFixedToInt (xFixedCeil (points->x));
- INT16 y1 = xFixedToInt (points->y);
- INT16 y2 = xFixedToInt (xFixedCeil (points->y));
-
- if (x1 < bounds->x1)
- bounds->x1 = x1;
- else if (x2 > bounds->x2)
- bounds->x2 = x2;
- if (y1 < bounds->y1)
- bounds->y1 = y1;
- else if (y2 > bounds->y2)
- bounds->y2 = y2;
- points++;
- }
-}
-
-void
-miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds)
-{
- miPointFixedBounds (ntri * 3, (xPointFixed *) tris, bounds);
-}
-
-void
-miRasterizeTriangle (PicturePtr pPicture,
- xTriangle *tri,
- int x_off,
- int y_off)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- xPointFixed *top, *left, *right, *t;
- xTrapezoid trap[2];
-
- top = &tri->p1;
- left = &tri->p2;
- right = &tri->p3;
- if (left->y < top->y) {
- t = left; left = top; top = t;
- }
- if (right->y < top->y) {
- t = right; right = top; top = t;
- }
- if (right->x < left->x) {
- t = right; right = left; left = t;
- }
-
- /*
- * Two cases:
- *
- * + +
- * / \ / \
- * / \ / \
- * / + + \
- * / -- -- \
- * / -- -- \
- * / --- --- \
- * +-- --+
- */
-
- trap[0].top = top->y;
-
- trap[0].left.p1.x = top->x;
- trap[0].left.p1.y = trap[0].top;
- trap[0].left.p2.x = left->x;
- trap[0].left.p2.y = left->y;
-
- trap[0].right.p1 = trap[0].left.p1;
- trap[0].right.p2.x = right->x;
- trap[0].right.p2.y = right->y;
-
- if (right->y < left->y)
- {
- trap[0].bottom = trap[0].right.p2.y;
-
- trap[1].top = trap[0].bottom;
- trap[1].bottom = trap[0].left.p2.y;
-
- trap[1].left = trap[0].left;
- trap[1].right.p1 = trap[0].right.p2;
- trap[1].right.p2 = trap[0].left.p2;
- }
- else
- {
- trap[0].bottom = trap[0].left.p2.y;
-
- trap[1].top = trap[0].bottom;
- trap[1].bottom = trap[0].right.p2.y;
-
- trap[1].right = trap[0].right;
- trap[1].left.p1 = trap[0].left.p2;
- trap[1].left.p2 = trap[0].right.p2;
- }
- if (trap[0].top != trap[0].bottom)
- (*ps->RasterizeTrapezoid) (pPicture, &trap[0], x_off, y_off);
- if (trap[1].top != trap[1].bottom)
- (*ps->RasterizeTrapezoid) (pPicture, &trap[1], x_off, y_off);
-}
-
-void
-miTriangles (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntri,
- xTriangle *tris)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- BoxRec bounds;
- PicturePtr pPicture = 0;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
- xDst = tris[0].p1.x >> 16;
- yDst = tris[0].p1.y >> 16;
-
- if (maskFormat)
- {
- miTriangleBounds (ntri, tris, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- return;
- }
- for (; ntri; ntri--, tris++)
- {
- if (!maskFormat)
- {
- miTriangleBounds (1, tris, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- break;
- }
- miRasterizeTriangle (pPicture, tris, -bounds.x1, -bounds.y1);
- if (!maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
- /* XXX adjust xSrc and ySrc */
- }
- if (maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
-}
-
-void
-miTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- xTriangle tri;
- BoxRec bounds;
- PicturePtr pPicture = 0;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
- xDst = points[0].x >> 16;
- yDst = points[0].y >> 16;
-
- if (npoint < 3)
- return;
- if (maskFormat)
- {
- miPointFixedBounds (npoint, points, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- return;
- }
- for (; npoint >= 3; npoint--, points++)
- {
- tri.p1 = points[0];
- tri.p2 = points[1];
- tri.p3 = points[2];
- if (!maskFormat)
- {
- miTriangleBounds (1, &tri, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- continue;
- }
- miRasterizeTriangle (pPicture, &tri, -bounds.x1, -bounds.y1);
- if (!maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
- }
- if (maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
-}
-
-void
-miTriFan (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points)
-{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- xTriangle tri;
- BoxRec bounds;
- PicturePtr pPicture = 0;
- xPointFixed *first;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
- xDst = points[0].x >> 16;
- yDst = points[0].y >> 16;
-
- if (npoint < 3)
- return;
- if (maskFormat)
- {
- miPointFixedBounds (npoint, points, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- return;
- }
- first = points++;
- npoint--;
- for (; npoint >= 2; npoint--, points++)
- {
- tri.p1 = *first;
- tri.p2 = points[0];
- tri.p3 = points[1];
- if (!maskFormat)
- {
- miTriangleBounds (1, &tri, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- continue;
- }
- miRasterizeTriangle (pPicture, &tri, -bounds.x1, -bounds.y1);
- if (!maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
- }
- if (maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
-}
diff --git a/render/picture.c b/render/picture.c
deleted file mode 100644
index b2ef69bdf..000000000
--- a/render/picture.c
+++ /dev/null
@@ -1,1305 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/picture.c,v 1.30 2003/01/26 16:40:43 eich Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "misc.h"
-#include "scrnintstr.h"
-#include "os.h"
-#include "regionstr.h"
-#include "validate.h"
-#include "windowstr.h"
-#include "input.h"
-#include "resource.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "servermd.h"
-#include "picturestr.h"
-
-int PictureScreenPrivateIndex = -1;
-int PictureWindowPrivateIndex;
-int PictureGeneration;
-RESTYPE PictureType;
-RESTYPE PictFormatType;
-RESTYPE GlyphSetType;
-int PictureCmapPolicy = PictureCmapPolicyDefault;
-
-Bool
-PictureDestroyWindow (WindowPtr pWindow)
-{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- PicturePtr pPicture;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- Bool ret;
-
- while ((pPicture = GetPictureWindow(pWindow)))
- {
- SetPictureWindow(pWindow, pPicture->pNext);
- if (pPicture->id)
- FreeResource (pPicture->id, PictureType);
- FreePicture ((pointer) pPicture, pPicture->id);
- }
- pScreen->DestroyWindow = ps->DestroyWindow;
- ret = (*pScreen->DestroyWindow) (pWindow);
- ps->DestroyWindow = pScreen->DestroyWindow;
- pScreen->DestroyWindow = PictureDestroyWindow;
- return ret;
-}
-
-Bool
-PictureCloseScreen (int index, ScreenPtr pScreen)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- Bool ret;
- int n;
-
- pScreen->CloseScreen = ps->CloseScreen;
- ret = (*pScreen->CloseScreen) (index, pScreen);
- PictureResetFilters (pScreen);
- for (n = 0; n < ps->nformats; n++)
- if (ps->formats[n].type == PictTypeIndexed)
- (*ps->CloseIndexed) (pScreen, &ps->formats[n]);
- SetPictureScreen(pScreen, 0);
- xfree (ps->formats);
- xfree (ps);
- return ret;
-}
-
-void
-PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef)
-{
- ScreenPtr pScreen = pColormap->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- pScreen->StoreColors = ps->StoreColors;
- (*pScreen->StoreColors) (pColormap, ndef, pdef);
- ps->StoreColors = pScreen->StoreColors;
- pScreen->StoreColors = PictureStoreColors;
-
- if (pColormap->class == PseudoColor || pColormap->class == GrayScale)
- {
- PictFormatPtr format = ps->formats;
- int nformats = ps->nformats;
-
- while (nformats--)
- {
- if (format->type == PictTypeIndexed &&
- format->index.pColormap == pColormap)
- {
- (*ps->UpdateIndexed) (pScreen, format, ndef, pdef);
- break;
- }
- format++;
- }
- }
-}
-
-static int
-visualDepth (ScreenPtr pScreen, VisualPtr pVisual)
-{
- int d, v;
- DepthPtr pDepth;
-
- for (d = 0; d < pScreen->numDepths; d++)
- {
- pDepth = &pScreen->allowedDepths[d];
- for (v = 0; v < pDepth->numVids; v++)
- if (pDepth->vids[v] == pVisual->vid)
- return pDepth->depth;
- }
- return 0;
-}
-
-typedef struct _formatInit {
- CARD32 format;
- CARD8 depth;
-} FormatInitRec, *FormatInitPtr;
-
-static int
-addFormat (FormatInitRec formats[256],
- int nformat,
- CARD32 format,
- CARD8 depth)
-{
- int n;
-
- for (n = 0; n < nformat; n++)
- if (formats[n].format == format && formats[n].depth == depth)
- return nformat;
- formats[nformat].format = format;
- formats[nformat].depth = depth;
- return ++nformat;
-}
-
-#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1))
-
-PictFormatPtr
-PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
-{
- int nformats, f;
- PictFormatPtr pFormats;
- FormatInitRec formats[1024];
- CARD32 format;
- CARD8 depth;
- VisualPtr pVisual;
- int v;
- int bpp;
- int type;
- int r, g, b;
- int d;
- DepthPtr pDepth;
-
- nformats = 0;
- /* formats required by protocol */
- formats[nformats].format = PICT_a1;
- formats[nformats].depth = 1;
- nformats++;
- formats[nformats].format = PICT_a8;
- formats[nformats].depth = 8;
- nformats++;
- formats[nformats].format = PICT_a4;
- formats[nformats].depth = 4;
- nformats++;
- formats[nformats].format = PICT_a8r8g8b8;
- formats[nformats].depth = 32;
- nformats++;
- formats[nformats].format = PICT_x8r8g8b8;
- formats[nformats].depth = 32;
- nformats++;
-
- /* now look through the depths and visuals adding other formats */
- for (v = 0; v < pScreen->numVisuals; v++)
- {
- pVisual = &pScreen->visuals[v];
- depth = visualDepth (pScreen, pVisual);
- if (!depth)
- continue;
- bpp = BitsPerPixel (depth);
- switch (pVisual->class) {
- case DirectColor:
- case TrueColor:
- r = Ones (pVisual->redMask);
- g = Ones (pVisual->greenMask);
- b = Ones (pVisual->blueMask);
- type = PICT_TYPE_OTHER;
- /*
- * Current rendering code supports only two direct formats,
- * fields must be packed together at the bottom of the pixel
- * and must be either RGB or BGR
- */
- if (pVisual->offsetBlue == 0 &&
- pVisual->offsetGreen == b &&
- pVisual->offsetRed == b + g)
- {
- type = PICT_TYPE_ARGB;
- }
- else if (pVisual->offsetRed == 0 &&
- pVisual->offsetGreen == r &&
- pVisual->offsetBlue == r + g)
- {
- type = PICT_TYPE_ABGR;
- }
- if (type != PICT_TYPE_OTHER)
- {
- format = PICT_FORMAT(bpp, type, 0, r, g, b);
- nformats = addFormat (formats, nformats, format, depth);
- }
- break;
- case StaticColor:
- case PseudoColor:
- format = PICT_VISFORMAT (bpp, PICT_TYPE_COLOR, v);
- nformats = addFormat (formats, nformats, format, depth);
- break;
- case StaticGray:
- case GrayScale:
- format = PICT_VISFORMAT (bpp, PICT_TYPE_GRAY, v);
- nformats = addFormat (formats, nformats, format, depth);
- break;
- }
- }
- /*
- * Walk supported depths and add useful Direct formats
- */
- for (d = 0; d < pScreen->numDepths; d++)
- {
- pDepth = &pScreen->allowedDepths[d];
- bpp = BitsPerPixel (pDepth->depth);
- format = 0;
- switch (bpp) {
- case 16:
- /* depth 12 formats */
- if (pDepth->depth >= 12)
- {
- nformats = addFormat (formats, nformats,
- PICT_x4r4g4b4, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_x4b4g4r4, pDepth->depth);
- }
- /* depth 15 formats */
- if (pDepth->depth >= 15)
- {
- nformats = addFormat (formats, nformats,
- PICT_x1r5g5b5, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_x1b5g5r5, pDepth->depth);
- }
- /* depth 16 formats */
- if (pDepth->depth >= 16)
- {
- nformats = addFormat (formats, nformats,
- PICT_a1r5g5b5, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_a1b5g5r5, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_r5g6b5, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_b5g6r5, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_a4r4g4b4, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_a4b4g4r4, pDepth->depth);
- }
- break;
- case 24:
- if (pDepth->depth >= 24)
- {
- nformats = addFormat (formats, nformats,
- PICT_r8g8b8, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_b8g8r8, pDepth->depth);
- }
- break;
- case 32:
- if (pDepth->depth >= 24)
- {
- nformats = addFormat (formats, nformats,
- PICT_x8r8g8b8, pDepth->depth);
- nformats = addFormat (formats, nformats,
- PICT_x8b8g8r8, pDepth->depth);
- }
- break;
- }
- }
-
-
- pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec));
- if (!pFormats)
- return 0;
- memset (pFormats, '\0', nformats * sizeof (PictFormatRec));
- for (f = 0; f < nformats; f++)
- {
- pFormats[f].id = FakeClientID (0);
- pFormats[f].depth = formats[f].depth;
- format = formats[f].format;
- pFormats[f].format = format;
- switch (PICT_FORMAT_TYPE(format)) {
- case PICT_TYPE_ARGB:
- pFormats[f].type = PictTypeDirect;
-
- pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format));
- if (pFormats[f].direct.alphaMask)
- pFormats[f].direct.alpha = (PICT_FORMAT_R(format) +
- PICT_FORMAT_G(format) +
- PICT_FORMAT_B(format));
-
- pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format));
- pFormats[f].direct.red = (PICT_FORMAT_G(format) +
- PICT_FORMAT_B(format));
-
- pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format));
- pFormats[f].direct.green = PICT_FORMAT_B(format);
-
- pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format));
- pFormats[f].direct.blue = 0;
- break;
-
- case PICT_TYPE_ABGR:
- pFormats[f].type = PictTypeDirect;
-
- pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format));
- if (pFormats[f].direct.alphaMask)
- pFormats[f].direct.alpha = (PICT_FORMAT_B(format) +
- PICT_FORMAT_G(format) +
- PICT_FORMAT_R(format));
-
- pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format));
- pFormats[f].direct.blue = (PICT_FORMAT_G(format) +
- PICT_FORMAT_R(format));
-
- pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format));
- pFormats[f].direct.green = PICT_FORMAT_R(format);
-
- pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format));
- pFormats[f].direct.red = 0;
- break;
-
- case PICT_TYPE_A:
- pFormats[f].type = PictTypeDirect;
-
- pFormats[f].direct.alpha = 0;
- pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format));
-
- /* remaining fields already set to zero */
- break;
-
- case PICT_TYPE_COLOR:
- case PICT_TYPE_GRAY:
- pFormats[f].type = PictTypeIndexed;
- pFormats[f].index.pVisual = &pScreen->visuals[PICT_FORMAT_VIS(format)];
- break;
- }
- }
- *nformatp = nformats;
- return pFormats;
-}
-
-Bool
-PictureInitIndexedFormats (ScreenPtr pScreen)
-{
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
- PictFormatPtr format;
- int nformat;
-
- if (!ps)
- return FALSE;
- format = ps->formats;
- nformat = ps->nformats;
- while (nformat--)
- {
- if (format->type == PictTypeIndexed && !format->index.pColormap)
- {
- if (format->index.pVisual->vid == pScreen->rootVisual)
- format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap,
- RT_COLORMAP);
- else
- {
- if (CreateColormap (FakeClientID (0), pScreen,
- format->index.pVisual,
- &format->index.pColormap, AllocNone,
- 0) != Success)
- {
- return FALSE;
- }
- }
- if (!(*ps->InitIndexed) (pScreen, format))
- return FALSE;
- }
- format++;
- }
- return TRUE;
-}
-
-Bool
-PictureFinishInit (void)
-{
- int s;
-
- for (s = 0; s < screenInfo.numScreens; s++)
- {
- if (!PictureInitIndexedFormats (screenInfo.screens[s]))
- return FALSE;
- (void) AnimCurInit (screenInfo.screens[s]);
- }
-
- return TRUE;
-}
-
-Bool
-PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel)
-{
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-
- if (!ps)
- return FALSE;
- ps->subpixel = subpixel;
- return TRUE;
-
-}
-
-int
-PictureGetSubpixelOrder (ScreenPtr pScreen)
-{
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-
- if (!ps)
- return SubPixelUnknown;
- return ps->subpixel;
-}
-
-PictFormatPtr
-PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual)
-{
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
- PictFormatPtr format;
- int nformat;
- int type;
-
- if (!ps)
- return 0;
- format = ps->formats;
- nformat = ps->nformats;
- switch (pVisual->class) {
- case StaticGray:
- case GrayScale:
- case StaticColor:
- case PseudoColor:
- type = PictTypeIndexed;
- break;
- case TrueColor:
- type = PictTypeDirect;
- break;
- case DirectColor:
- default:
- return 0;
- }
- while (nformat--)
- {
- if (format->depth == depth && format->type == type)
- {
- if (type == PictTypeIndexed)
- {
- if (format->index.pVisual == pVisual)
- return format;
- }
- else
- {
- if (format->direct.redMask << format->direct.red ==
- pVisual->redMask &&
- format->direct.greenMask << format->direct.green ==
- pVisual->greenMask &&
- format->direct.blueMask << format->direct.blue ==
- pVisual->blueMask)
- {
- return format;
- }
- }
- }
- format++;
- }
- return 0;
-}
-
-PictFormatPtr
-PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 f)
-{
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
- PictFormatPtr format;
- int nformat;
-
- if (!ps)
- return 0;
- format = ps->formats;
- nformat = ps->nformats;
- while (nformat--)
- {
- if (format->depth == depth && format->format == (f & 0xffffff))
- return format;
- format++;
- }
- return 0;
-}
-
-int
-PictureParseCmapPolicy (const char *name)
-{
- if ( strcmp (name, "default" ) == 0)
- return PictureCmapPolicyDefault;
- else if ( strcmp (name, "mono" ) == 0)
- return PictureCmapPolicyMono;
- else if ( strcmp (name, "gray" ) == 0)
- return PictureCmapPolicyGray;
- else if ( strcmp (name, "color" ) == 0)
- return PictureCmapPolicyColor;
- else if ( strcmp (name, "all" ) == 0)
- return PictureCmapPolicyAll;
- else
- return PictureCmapPolicyInvalid;
-}
-
-Bool
-PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
-{
- PictureScreenPtr ps;
- int n;
- CARD32 type, a, r, g, b;
-
- if (PictureGeneration != serverGeneration)
- {
- PictureType = CreateNewResourceType (FreePicture);
- if (!PictureType)
- return FALSE;
- PictFormatType = CreateNewResourceType (FreePictFormat);
- if (!PictFormatType)
- return FALSE;
- GlyphSetType = CreateNewResourceType (FreeGlyphSet);
- if (!GlyphSetType)
- return FALSE;
- PictureScreenPrivateIndex = AllocateScreenPrivateIndex();
- if (PictureScreenPrivateIndex < 0)
- return FALSE;
- PictureWindowPrivateIndex = AllocateWindowPrivateIndex();
- PictureGeneration = serverGeneration;
-#ifdef XResExtension
- RegisterResourceName (PictureType, "PICTURE");
- RegisterResourceName (PictFormatType, "PICTFORMAT");
- RegisterResourceName (GlyphSetType, "GLYPHSET");
-#endif
- }
- if (!AllocateWindowPrivate (pScreen, PictureWindowPrivateIndex, 0))
- return FALSE;
-
- if (!formats)
- {
- formats = PictureCreateDefaultFormats (pScreen, &nformats);
- if (!formats)
- return FALSE;
- }
- for (n = 0; n < nformats; n++)
- {
- if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n)))
- {
- xfree (formats);
- return FALSE;
- }
- if (formats[n].type == PictTypeIndexed)
- {
- if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor)
- type = PICT_TYPE_COLOR;
- else
- type = PICT_TYPE_GRAY;
- a = r = g = b = 0;
- }
- else
- {
- if ((formats[n].direct.redMask|
- formats[n].direct.blueMask|
- formats[n].direct.greenMask) == 0)
- type = PICT_TYPE_A;
- else if (formats[n].direct.red > formats[n].direct.blue)
- type = PICT_TYPE_ARGB;
- else
- type = PICT_TYPE_ABGR;
- a = Ones (formats[n].direct.alphaMask);
- r = Ones (formats[n].direct.redMask);
- g = Ones (formats[n].direct.greenMask);
- b = Ones (formats[n].direct.blueMask);
- }
- formats[n].format = PICT_FORMAT(0,type,a,r,g,b);
- }
- ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec));
- if (!ps)
- {
- xfree (formats);
- return FALSE;
- }
- SetPictureScreen(pScreen, ps);
- if (!GlyphInit (pScreen))
- {
- SetPictureScreen(pScreen, 0);
- xfree (formats);
- xfree (ps);
- return FALSE;
- }
-
- ps->totalPictureSize = sizeof (PictureRec);
- ps->PicturePrivateSizes = 0;
- ps->PicturePrivateLen = 0;
-
- ps->formats = formats;
- ps->fallback = formats;
- ps->nformats = nformats;
-
- ps->filters = 0;
- ps->nfilters = 0;
- ps->filterAliases = 0;
- ps->nfilterAliases = 0;
-
- ps->subpixel = SubPixelUnknown;
-
- ps->CloseScreen = pScreen->CloseScreen;
- ps->DestroyWindow = pScreen->DestroyWindow;
- ps->StoreColors = pScreen->StoreColors;
- pScreen->DestroyWindow = PictureDestroyWindow;
- pScreen->CloseScreen = PictureCloseScreen;
- pScreen->StoreColors = PictureStoreColors;
-
- if (!PictureSetDefaultFilters (pScreen))
- {
- PictureResetFilters (pScreen);
- SetPictureScreen(pScreen, 0);
- xfree (formats);
- xfree (ps);
- return FALSE;
- }
-
- return TRUE;
-}
-
-void
-SetPictureToDefaults (PicturePtr pPicture)
-{
- pPicture->refcnt = 1;
- pPicture->repeat = 0;
- pPicture->graphicsExposures = FALSE;
- pPicture->subWindowMode = ClipByChildren;
- pPicture->polyEdge = PolyEdgeSharp;
- pPicture->polyMode = PolyModePrecise;
- pPicture->freeCompClip = FALSE;
- pPicture->clientClipType = CT_NONE;
- pPicture->componentAlpha = FALSE;
-
- pPicture->alphaMap = 0;
- pPicture->alphaOrigin.x = 0;
- pPicture->alphaOrigin.y = 0;
-
- pPicture->clipOrigin.x = 0;
- pPicture->clipOrigin.y = 0;
- pPicture->clientClip = 0;
-
- pPicture->transform = 0;
-
- pPicture->dither = None;
- pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE);
- pPicture->filter_params = 0;
- pPicture->filter_nparams = 0;
-
- pPicture->serialNumber = GC_CHANGE_SERIAL_BIT;
- pPicture->stateChanges = (1 << (CPLastBit+1)) - 1;
-}
-
-PicturePtr
-AllocatePicture (ScreenPtr pScreen)
-{
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- PicturePtr pPicture;
- char *ptr;
- DevUnion *ppriv;
- unsigned int *sizes;
- unsigned int size;
- int i;
-
- pPicture = (PicturePtr) xalloc (ps->totalPictureSize);
- if (!pPicture)
- return 0;
- ppriv = (DevUnion *)(pPicture + 1);
- pPicture->devPrivates = ppriv;
- sizes = ps->PicturePrivateSizes;
- ptr = (char *)(ppriv + ps->PicturePrivateLen);
- for (i = ps->PicturePrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
- return pPicture;
-}
-
-PicturePtr
-CreatePicture (Picture pid,
- DrawablePtr pDrawable,
- PictFormatPtr pFormat,
- Mask vmask,
- XID *vlist,
- ClientPtr client,
- int *error)
-{
- PicturePtr pPicture;
- PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
-
- pPicture = AllocatePicture (pDrawable->pScreen);
- if (!pPicture)
- {
- *error = BadAlloc;
- return 0;
- }
-
- pPicture->id = pid;
- pPicture->pDrawable = pDrawable;
- pPicture->pFormat = pFormat;
- pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
- if (pDrawable->type == DRAWABLE_PIXMAP)
- {
- ++((PixmapPtr)pDrawable)->refcnt;
- pPicture->pNext = 0;
- }
- else
- {
- pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable));
- SetPictureWindow(((WindowPtr) pDrawable), pPicture);
- }
-
- SetPictureToDefaults (pPicture);
-
- if (vmask)
- *error = ChangePicture (pPicture, vmask, vlist, 0, client);
- else
- *error = Success;
- if (*error == Success)
- *error = (*ps->CreatePicture) (pPicture);
- if (*error != Success)
- {
- FreePicture (pPicture, (XID) 0);
- pPicture = 0;
- }
- return pPicture;
-}
-
-#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val)
-
-#define NEXT_PTR(_type) ((_type) ulist++->ptr)
-
-int
-ChangePicture (PicturePtr pPicture,
- Mask vmask,
- XID *vlist,
- DevUnion *ulist,
- ClientPtr client)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- BITS32 index2;
- int error = 0;
- BITS32 maskQ;
-
- pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
- maskQ = vmask;
- while (vmask && !error)
- {
- index2 = (BITS32) lowbit (vmask);
- vmask &= ~index2;
- pPicture->stateChanges |= index2;
- switch (index2)
- {
- case CPRepeat:
- {
- unsigned int newr;
- newr = NEXT_VAL(unsigned int);
- if (newr <= xTrue)
- pPicture->repeat = newr;
- else
- {
- client->errorValue = newr;
- error = BadValue;
- }
- }
- break;
- case CPAlphaMap:
- {
- PicturePtr pAlpha;
-
- if (vlist)
- {
- Picture pid = NEXT_VAL(Picture);
-
- if (pid == None)
- pAlpha = 0;
- else
- {
- pAlpha = (PicturePtr) SecurityLookupIDByType(client,
- pid,
- PictureType,
- SecurityWriteAccess|SecurityReadAccess);
- if (!pAlpha)
- {
- client->errorValue = pid;
- error = BadPixmap;
- break;
- }
- if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
- {
- client->errorValue = pid;
- error = BadMatch;
- break;
- }
- }
- }
- else
- pAlpha = NEXT_PTR(PicturePtr);
- if (!error)
- {
- if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP)
- pAlpha->refcnt++;
- if (pPicture->alphaMap)
- FreePicture ((pointer) pPicture->alphaMap, (XID) 0);
- pPicture->alphaMap = pAlpha;
- }
- }
- break;
- case CPAlphaXOrigin:
- pPicture->alphaOrigin.x = NEXT_VAL(INT16);
- break;
- case CPAlphaYOrigin:
- pPicture->alphaOrigin.y = NEXT_VAL(INT16);
- break;
- case CPClipXOrigin:
- pPicture->clipOrigin.x = NEXT_VAL(INT16);
- break;
- case CPClipYOrigin:
- pPicture->clipOrigin.y = NEXT_VAL(INT16);
- break;
- case CPClipMask:
- {
- Pixmap pid;
- PixmapPtr pPixmap;
- int clipType;
-
- if (vlist)
- {
- pid = NEXT_VAL(Pixmap);
- if (pid == None)
- {
- clipType = CT_NONE;
- pPixmap = NullPixmap;
- }
- else
- {
- clipType = CT_PIXMAP;
- pPixmap = (PixmapPtr)SecurityLookupIDByType(client,
- pid,
- RT_PIXMAP,
- SecurityReadAccess);
- if (!pPixmap)
- {
- client->errorValue = pid;
- error = BadPixmap;
- break;
- }
- }
- }
- else
- {
- pPixmap = NEXT_PTR(PixmapPtr);
- if (pPixmap)
- clipType = CT_PIXMAP;
- else
- clipType = CT_NONE;
- }
-
- if (pPixmap)
- {
- if ((pPixmap->drawable.depth != 1) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- error = BadMatch;
- break;
- }
- else
- {
- clipType = CT_PIXMAP;
- pPixmap->refcnt++;
- }
- }
- error = (*ps->ChangePictureClip)(pPicture, clipType,
- (pointer)pPixmap, 0);
- break;
- }
- case CPGraphicsExposure:
- {
- unsigned int newe;
- newe = NEXT_VAL(unsigned int);
- if (newe <= xTrue)
- pPicture->graphicsExposures = newe;
- else
- {
- client->errorValue = newe;
- error = BadValue;
- }
- }
- break;
- case CPSubwindowMode:
- {
- unsigned int news;
- news = NEXT_VAL(unsigned int);
- if (news == ClipByChildren || news == IncludeInferiors)
- pPicture->subWindowMode = news;
- else
- {
- client->errorValue = news;
- error = BadValue;
- }
- }
- break;
- case CPPolyEdge:
- {
- unsigned int newe;
- newe = NEXT_VAL(unsigned int);
- if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth)
- pPicture->polyEdge = newe;
- else
- {
- client->errorValue = newe;
- error = BadValue;
- }
- }
- break;
- case CPPolyMode:
- {
- unsigned int newm;
- newm = NEXT_VAL(unsigned int);
- if (newm == PolyModePrecise || newm == PolyModeImprecise)
- pPicture->polyMode = newm;
- else
- {
- client->errorValue = newm;
- error = BadValue;
- }
- }
- break;
- case CPDither:
- pPicture->dither = NEXT_VAL(Atom);
- break;
- case CPComponentAlpha:
- {
- unsigned int newca;
-
- newca = NEXT_VAL (unsigned int);
- if (newca <= xTrue)
- pPicture->componentAlpha = newca;
- else
- {
- client->errorValue = newca;
- error = BadValue;
- }
- }
- break;
- default:
- client->errorValue = maskQ;
- error = BadValue;
- break;
- }
- }
- (*ps->ChangePicture) (pPicture, maskQ);
- return error;
-}
-
-int
-SetPictureClipRects (PicturePtr pPicture,
- int xOrigin,
- int yOrigin,
- int nRect,
- xRectangle *rects)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- RegionPtr clientClip;
- int result;
-
- clientClip = RECTS_TO_REGION(pScreen,
- nRect, rects, CT_UNSORTED);
- if (!clientClip)
- return BadAlloc;
- result =(*ps->ChangePictureClip) (pPicture, CT_REGION,
- (pointer) clientClip, 0);
- if (result == Success)
- {
- pPicture->clipOrigin.x = xOrigin;
- pPicture->clipOrigin.y = yOrigin;
- pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask;
- pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
- }
- return result;
-}
-
-int
-SetPictureTransform (PicturePtr pPicture,
- PictTransform *transform)
-{
- static const PictTransform identity = { {
- { xFixed1, 0x00000, 0x00000 },
- { 0x00000, xFixed1, 0x00000 },
- { 0x00000, 0x00000, xFixed1 },
- } };
-
- if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0)
- transform = 0;
-
- if (transform)
- {
- if (!pPicture->transform)
- {
- pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform));
- if (!pPicture->transform)
- return BadAlloc;
- }
- *pPicture->transform = *transform;
- }
- else
- {
- if (pPicture->transform)
- {
- xfree (pPicture->transform);
- pPicture->transform = 0;
- }
- }
- return Success;
-}
-
-static void
-ValidateOnePicture (PicturePtr pPicture)
-{
- if (pPicture->serialNumber != pPicture->pDrawable->serialNumber)
- {
- PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
-
- (*ps->ValidatePicture) (pPicture, pPicture->stateChanges);
- pPicture->stateChanges = 0;
- pPicture->serialNumber = pPicture->pDrawable->serialNumber;
- }
-}
-
-void
-ValidatePicture(PicturePtr pPicture)
-{
- ValidateOnePicture (pPicture);
- if (pPicture->alphaMap)
- ValidateOnePicture (pPicture->alphaMap);
-}
-
-int
-FreePicture (pointer value,
- XID pid)
-{
- PicturePtr pPicture = (PicturePtr) value;
-
- if (--pPicture->refcnt == 0)
- {
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
-
- if (pPicture->alphaMap)
- FreePicture ((pointer) pPicture->alphaMap, (XID) 0);
- (*ps->DestroyPicture) (pPicture);
- (*ps->DestroyPictureClip) (pPicture);
- if (pPicture->transform)
- xfree (pPicture->transform);
- if (pPicture->pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWindow = (WindowPtr) pPicture->pDrawable;
- PicturePtr *pPrev;
-
- for (pPrev = (PicturePtr *) &((pWindow)->devPrivates[PictureWindowPrivateIndex].ptr);
- *pPrev;
- pPrev = &(*pPrev)->pNext)
- {
- if (*pPrev == pPicture)
- {
- *pPrev = pPicture->pNext;
- break;
- }
- }
- }
- else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP)
- {
- (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
- }
- xfree (pPicture);
- }
- return Success;
-}
-
-int
-FreePictFormat (pointer pPictFormat,
- XID pid)
-{
- return Success;
-}
-
-void
-CompositePicture (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- if (pMask)
- ValidatePicture (pMask);
- ValidatePicture (pDst);
- (*ps->Composite) (op,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height);
-}
-
-void
-CompositeGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr lists,
- GlyphPtr *glyphs)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs);
-}
-
-void
-CompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pDst);
- (*ps->CompositeRects) (op, pDst, color, nRect, rects);
-}
-
-void
-CompositeTrapezoids (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntrap,
- xTrapezoid *traps)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
-}
-
-void
-CompositeTriangles (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntriangles,
- xTriangle *triangles)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles);
-}
-
-void
-CompositeTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoints,
- xPointFixed *points)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
-}
-
-void
-CompositeTriFan (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoints,
- xPointFixed *points)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
-}
-
-typedef xFixed_32_32 xFixed_48_16;
-
-#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
-#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
-
-Bool
-PictureTransformPoint (PictTransformPtr transform,
- PictVectorPtr vector)
-{
- PictVector result;
- int i, j;
- xFixed_32_32 partial;
- xFixed_48_16 v;
-
- for (j = 0; j < 3; j++)
- {
- v = 0;
- for (i = 0; i < 3; i++)
- {
- partial = ((xFixed_48_16) transform->matrix[j][i] *
- (xFixed_48_16) vector->vector[i]);
- v += partial >> 16;
- }
- if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
- return FALSE;
- result.vector[j] = (xFixed) v;
- }
- if (!result.vector[2])
- return FALSE;
- for (j = 0; j < 2; j++)
- {
- partial = (xFixed_48_16) result.vector[j] << 16;
- v = partial / result.vector[2];
- if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
- return FALSE;
- vector->vector[j] = (xFixed) v;
- }
- vector->vector[2] = xFixed1;
- return TRUE;
-}
diff --git a/render/picture.h b/render/picture.h
deleted file mode 100644
index c47d51941..000000000
--- a/render/picture.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/picture.h,v 1.21 2003/11/03 05:12:01 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _PICTURE_H_
-#define _PICTURE_H_
-
-typedef struct _DirectFormat *DirectFormatPtr;
-typedef struct _PictFormat *PictFormatPtr;
-typedef struct _Picture *PicturePtr;
-
-/*
- * While the protocol is generous in format support, the
- * sample implementation allows only packed RGB and GBR
- * representations for data to simplify software rendering,
- */
-#define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
- ((type) << 16) | \
- ((a) << 12) | \
- ((r) << 8) | \
- ((g) << 4) | \
- ((b)))
-
-/*
- * gray/color formats use a visual index instead of argb
- */
-#define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \
- ((type) << 16) | \
- ((vi)))
-
-#define PICT_FORMAT_BPP(f) (((f) >> 24) )
-#define PICT_FORMAT_TYPE(f) (((f) >> 16) & 0xff)
-#define PICT_FORMAT_A(f) (((f) >> 12) & 0x0f)
-#define PICT_FORMAT_R(f) (((f) >> 8) & 0x0f)
-#define PICT_FORMAT_G(f) (((f) >> 4) & 0x0f)
-#define PICT_FORMAT_B(f) (((f) ) & 0x0f)
-#define PICT_FORMAT_RGB(f) (((f) ) & 0xfff)
-#define PICT_FORMAT_VIS(f) (((f) ) & 0xffff)
-
-#define PICT_TYPE_OTHER 0
-#define PICT_TYPE_A 1
-#define PICT_TYPE_ARGB 2
-#define PICT_TYPE_ABGR 3
-#define PICT_TYPE_COLOR 4
-#define PICT_TYPE_GRAY 5
-
-#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
-
-/* 32bpp formats */
-#define PICT_a8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8)
-#define PICT_x8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_a8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8)
-#define PICT_x8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8)
-
-/* 24bpp formats */
-#define PICT_r8g8b8 PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_b8g8r8 PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8)
-
-/* 16bpp formats */
-#define PICT_r5g6b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5)
-#define PICT_b5g6r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5)
-
-#define PICT_a1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5)
-#define PICT_x1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5)
-#define PICT_a1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5)
-#define PICT_x1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5)
-#define PICT_a4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_x4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_a4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_x4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-
-/* 8bpp formats */
-#define PICT_a8 PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0)
-#define PICT_r3g3b2 PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2)
-#define PICT_b2g3r3 PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2)
-#define PICT_a2r2g2b2 PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2)
-#define PICT_a2b2g2r2 PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2)
-
-#define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
-
-/* 4bpp formats */
-#define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
-#define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
-#define PICT_b1g2r1 PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1)
-#define PICT_a1r1g1b1 PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1)
-#define PICT_a1b1g1r1 PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1)
-
-#define PICT_c4 PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g4 PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0)
-
-/* 1bpp formats */
-#define PICT_a1 PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0)
-
-#define PICT_g1 PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0)
-
-/*
- * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
- * selection of colors allocated for drawing to Pictures. The default
- * policy depends on the size of the colormap:
- *
- * Size Default Policy
- * ----------------------------
- * < 64 PolicyMono
- * < 256 PolicyGray
- * 256 PolicyColor (only on PseudoColor)
- *
- * The actual allocation code lives in miindex.c, and so is
- * austensibly server dependent, but that code does:
- *
- * PolicyMono Allocate no additional colors, use black and white
- * PolicyGray Allocate 13 gray levels (11 cells used)
- * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used)
- * PolicyAll Allocate as big a cube as possible, fill with gray (all)
- *
- * Here's a picture to help understand how many colors are
- * actually allocated (this is just the gray ramp):
- *
- * gray level
- * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff
- * b/w 0000 ffff
- * 4x4x4 5555 aaaa
- * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa
- *
- * The default colormap supplies two gray levels (black/white), the
- * 4x4x4 cube allocates another two and nine more are allocated to fill
- * in the 13 levels. When the 4x4x4 cube is not allocated, a total of
- * 11 cells are allocated.
- */
-
-#define PictureCmapPolicyInvalid -1
-#define PictureCmapPolicyDefault 0
-#define PictureCmapPolicyMono 1
-#define PictureCmapPolicyGray 2
-#define PictureCmapPolicyColor 3
-#define PictureCmapPolicyAll 4
-
-extern int PictureCmapPolicy;
-
-int PictureParseCmapPolicy (const char *name);
-
-/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
-
-#ifdef WIN32
-typedef __int64 xFixed_32_32;
-#else
-# if defined (_LP64) || \
- defined(__alpha__) || defined(__alpha) || \
- defined(ia64) || defined(__ia64__) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(AMD64) || defined (__AMD64__) || \
- (defined(sgi) && (_MIPS_SZLONG == 64))
-typedef long xFixed_32_32;
-# else
-# if defined(__GNUC__) && \
- ((__GNUC__ > 2) || \
- ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 7)))
-__extension__
-# endif
-typedef long long int xFixed_32_32;
-# endif
-#endif
-
-typedef CARD32 xFixed_1_31;
-typedef CARD32 xFixed_1_16;
-typedef INT32 xFixed_16_16;
-
-/*
- * An unadorned "xFixed" is the same as xFixed_16_16,
- * (since it's quite common in the code)
- */
-typedef xFixed_16_16 xFixed;
-#define XFIXED_BITS 16
-
-#define xFixedToInt(f) (int) ((f) >> XFIXED_BITS)
-#define IntToxFixed(i) ((xFixed) (i) << XFIXED_BITS)
-#define xFixedE ((xFixed) 1)
-#define xFixed1 (IntToxFixed(1))
-#define xFixed1MinusE (xFixed1 - xFixedE)
-#define xFixedFrac(f) ((f) & xFixed1MinusE)
-#define xFixedFloor(f) ((f) & ~xFixed1MinusE)
-#define xFixedCeil(f) xFixedFloor((f) + xFixed1MinusE)
-
-#define xFixedFraction(f) ((f) & xFixed1MinusE)
-#define xFixedMod2(f) ((f) & (xFixed1 | xFixed1MinusE))
-
-/* whether 't' is a well defined not obviously empty trapezoid */
-#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
- (t)->right.p1.y != (t)->right.p2.y && \
- (int) ((t)->bottom - (t)->top) > 0)
-
-/*
- * Standard NTSC luminance conversions:
- *
- * y = r * 0.299 + g * 0.587 + b * 0.114
- *
- * Approximate this for a bit more speed:
- *
- * y = (r * 153 + g * 301 + b * 58) / 512
- *
- * This gives 17 bits of luminance; to get 15 bits, lop the low two
- */
-
-#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
- (((s) >> 8) & 0xff) * 301 + \
- (((s) ) & 0xff) * 58) >> 2)
-
-#endif /* _PICTURE_H_ */
diff --git a/render/picturestr.h b/render/picturestr.h
deleted file mode 100644
index cb5ea0ac9..000000000
--- a/render/picturestr.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/picturestr.h,v 1.22 2002/11/23 02:38:15 keithp Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#ifndef _PICTURESTR_H_
-#define _PICTURESTR_H_
-
-#include "glyphstr.h"
-#include "scrnintstr.h"
-#include "resource.h"
-
-typedef struct _DirectFormat {
- CARD16 red, redMask;
- CARD16 green, greenMask;
- CARD16 blue, blueMask;
- CARD16 alpha, alphaMask;
-} DirectFormatRec;
-
-typedef struct _IndexFormat {
- VisualPtr pVisual;
- ColormapPtr pColormap;
- int nvalues;
- xIndexValue *pValues;
- void *devPrivate;
-} IndexFormatRec;
-
-typedef struct _PictFormat {
- CARD32 id;
- CARD32 format; /* except bpp */
- unsigned char type;
- unsigned char depth;
- DirectFormatRec direct;
- IndexFormatRec index;
-} PictFormatRec;
-
-typedef struct _PictVector {
- xFixed vector[3];
-} PictVector, *PictVectorPtr;
-
-typedef struct _PictTransform {
- xFixed matrix[3][3];
-} PictTransform, *PictTransformPtr;
-
-typedef struct _Picture {
- DrawablePtr pDrawable;
- PictFormatPtr pFormat;
- CARD32 format; /* PICT_FORMAT */
- int refcnt;
- CARD32 id;
- PicturePtr pNext; /* chain on same drawable */
-
- unsigned int repeat : 1;
- unsigned int graphicsExposures : 1;
- unsigned int subWindowMode : 1;
- unsigned int polyEdge : 1;
- unsigned int polyMode : 1;
- unsigned int freeCompClip : 1;
- unsigned int clientClipType : 2;
- unsigned int componentAlpha : 1;
- unsigned int unused : 23;
-
- PicturePtr alphaMap;
- DDXPointRec alphaOrigin;
-
- DDXPointRec clipOrigin;
- pointer clientClip;
-
- Atom dither;
-
- unsigned long stateChanges;
- unsigned long serialNumber;
-
- RegionPtr pCompositeClip;
-
- DevUnion *devPrivates;
-
- PictTransform *transform;
-
- int filter;
- xFixed *filter_params;
- int filter_nparams;
-} PictureRec;
-
-typedef struct {
- char *name;
- xFixed *params;
- int nparams;
- int id;
-} PictFilterRec, *PictFilterPtr;
-
-#define PictFilterNearest 0
-#define PictFilterBilinear 1
-
-#define PictFilterFast 2
-#define PictFilterGood 3
-#define PictFilterBest 4
-
-typedef struct {
- char *alias;
- int alias_id;
- int filter_id;
-} PictFilterAliasRec, *PictFilterAliasPtr;
-
-typedef int (*CreatePictureProcPtr) (PicturePtr pPicture);
-typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture);
-typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture,
- int clipType,
- pointer value,
- int n);
-typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture);
-
-typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture,
- PictTransform *transform);
-
-typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture,
- int filter,
- xFixed *params,
- int nparams);
-
-typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture);
-
-typedef void (*ChangePictureProcPtr) (PicturePtr pPicture,
- Mask mask);
-typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture,
- Mask mask);
-typedef void (*CompositeProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-typedef void (*GlyphsProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlists,
- GlyphListPtr lists,
- GlyphPtr *glyphs);
-
-typedef void (*CompositeRectsProcPtr) (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects);
-
-typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask,
- xTrapezoid *trap,
- int x_off,
- int y_off);
-
-typedef void (*TrapezoidsProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntrap,
- xTrapezoid *traps);
-
-typedef void (*TrianglesProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntri,
- xTriangle *tris);
-
-typedef void (*TriStripProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-typedef void (*TriFanProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen,
- PictFormatPtr pFormat);
-
-typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen,
- PictFormatPtr pFormat);
-
-typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
- PictFormatPtr pFormat,
- int ndef,
- xColorItem *pdef);
-
-typedef struct _PictureScreen {
- int totalPictureSize;
- unsigned int *PicturePrivateSizes;
- int PicturePrivateLen;
-
- PictFormatPtr formats;
- PictFormatPtr fallback;
- int nformats;
-
- CreatePictureProcPtr CreatePicture;
- DestroyPictureProcPtr DestroyPicture;
- ChangePictureClipProcPtr ChangePictureClip;
- DestroyPictureClipProcPtr DestroyPictureClip;
-
- ChangePictureProcPtr ChangePicture;
- ValidatePictureProcPtr ValidatePicture;
-
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
- CompositeRectsProcPtr CompositeRects;
-
- DestroyWindowProcPtr DestroyWindow;
- CloseScreenProcPtr CloseScreen;
-
- StoreColorsProcPtr StoreColors;
-
- InitIndexedProcPtr InitIndexed;
- CloseIndexedProcPtr CloseIndexed;
- UpdateIndexedProcPtr UpdateIndexed;
-
- int subpixel;
-
- PictFilterPtr filters;
- int nfilters;
- PictFilterAliasPtr filterAliases;
- int nfilterAliases;
-
- ChangePictureTransformProcPtr ChangePictureTransform;
- ChangePictureFilterProcPtr ChangePictureFilter;
- DestroyPictureFilterProcPtr DestroyPictureFilter;
-
- TrapezoidsProcPtr Trapezoids;
- TrianglesProcPtr Triangles;
- TriStripProcPtr TriStrip;
- TriFanProcPtr TriFan;
-
- RasterizeTrapezoidProcPtr RasterizeTrapezoid;
-} PictureScreenRec, *PictureScreenPtr;
-
-extern int PictureScreenPrivateIndex;
-extern int PictureWindowPrivateIndex;
-extern RESTYPE PictureType;
-extern RESTYPE PictFormatType;
-extern RESTYPE GlyphSetType;
-
-#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr))
-#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL)
-#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p))
-#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr))
-#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p))
-
-#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\
- pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\
- if (!pPicture) { \
- client->errorValue = pid; \
- return err; \
- } \
-}
-
-#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\
- if (pid == None) \
- pPicture = 0; \
- else { \
- VERIFY_PICTURE(pPicture, pid, client, mode, err); \
- } \
-} \
-
-Bool
-PictureDestroyWindow (WindowPtr pWindow);
-
-Bool
-PictureCloseScreen (int Index, ScreenPtr pScreen);
-
-void
-PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
-
-Bool
-PictureInitIndexedFormats (ScreenPtr pScreen);
-
-Bool
-PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
-
-int
-PictureGetSubpixelOrder (ScreenPtr pScreen);
-
-PictFormatPtr
-PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
-
-PictFormatPtr
-PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
-
-PictFormatPtr
-PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
-
-Bool
-PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
-
-int
-PictureGetFilterId (char *filter, int len, Bool makeit);
-
-char *
-PictureGetFilterName (int id);
-
-int
-PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams);
-
-Bool
-PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
-
-Bool
-PictureSetDefaultFilters (ScreenPtr pScreen);
-
-void
-PictureResetFilters (ScreenPtr pScreen);
-
-PictFilterPtr
-PictureFindFilter (ScreenPtr pScreen, char *name, int len);
-
-int
-SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams);
-
-Bool
-PictureFinishInit (void);
-
-void
-SetPictureToDefaults (PicturePtr pPicture);
-
-PicturePtr
-AllocatePicture (ScreenPtr pScreen);
-
-#if 0
-Bool
-miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
-#endif
-
-
-PicturePtr
-CreatePicture (Picture pid,
- DrawablePtr pDrawable,
- PictFormatPtr pFormat,
- Mask mask,
- XID *list,
- ClientPtr client,
- int *error);
-
-int
-ChangePicture (PicturePtr pPicture,
- Mask vmask,
- XID *vlist,
- DevUnion *ulist,
- ClientPtr client);
-
-int
-SetPictureClipRects (PicturePtr pPicture,
- int xOrigin,
- int yOrigin,
- int nRect,
- xRectangle *rects);
-
-int
-SetPictureTransform (PicturePtr pPicture,
- PictTransform *transform);
-
-void
-ValidatePicture(PicturePtr pPicture);
-
-int
-FreePicture (pointer pPicture,
- XID pid);
-
-int
-FreePictFormat (pointer pPictFormat,
- XID pid);
-
-void
-CompositePicture (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-CompositeGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr lists,
- GlyphPtr *glyphs);
-
-void
-CompositeRects (CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects);
-
-void
-CompositeTrapezoids (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntrap,
- xTrapezoid *traps);
-
-void
-CompositeTriangles (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int ntriangles,
- xTriangle *triangles);
-
-void
-CompositeTriStrip (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoints,
- xPointFixed *points);
-
-void
-CompositeTriFan (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoints,
- xPointFixed *points);
-
-Bool
-PictureTransformPoint (PictTransformPtr transform,
- PictVectorPtr vector);
-
-void RenderExtensionInit (void);
-
-Bool
-AnimCurInit (ScreenPtr pScreen);
-
-int
-AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
-
-#ifdef PANORAMIX
-void PanoramiXRenderInit (void);
-void PanoramiXRenderReset (void);
-#endif
-
-#endif /* _PICTURESTR_H_ */
diff --git a/render/render.c b/render/render.c
deleted file mode 100644
index 0d89885c3..000000000
--- a/render/render.c
+++ /dev/null
@@ -1,2957 +0,0 @@
-/*
- * $XFree86: xc/programs/Xserver/render/render.c,v 1.28 2003/11/03 05:12:02 tsi Exp $
- *
- * Copyright © 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "colormapst.h"
-#include "extnsionst.h"
-#include "servermd.h"
-#include "render.h"
-#include "renderproto.h"
-#include "picturestr.h"
-#include "glyphstr.h"
-#include "Xfuncproto.h"
-#include "cursorstr.h"
-#ifdef EXTMODULE
-#include "xf86_ansic.h"
-#endif
-
-static int ProcRenderQueryVersion (ClientPtr pClient);
-static int ProcRenderQueryPictFormats (ClientPtr pClient);
-static int ProcRenderQueryPictIndexValues (ClientPtr pClient);
-static int ProcRenderQueryDithers (ClientPtr pClient);
-static int ProcRenderCreatePicture (ClientPtr pClient);
-static int ProcRenderChangePicture (ClientPtr pClient);
-static int ProcRenderSetPictureClipRectangles (ClientPtr pClient);
-static int ProcRenderFreePicture (ClientPtr pClient);
-static int ProcRenderComposite (ClientPtr pClient);
-static int ProcRenderScale (ClientPtr pClient);
-static int ProcRenderTrapezoids (ClientPtr pClient);
-static int ProcRenderTriangles (ClientPtr pClient);
-static int ProcRenderTriStrip (ClientPtr pClient);
-static int ProcRenderTriFan (ClientPtr pClient);
-static int ProcRenderColorTrapezoids (ClientPtr pClient);
-static int ProcRenderColorTriangles (ClientPtr pClient);
-static int ProcRenderTransform (ClientPtr pClient);
-static int ProcRenderCreateGlyphSet (ClientPtr pClient);
-static int ProcRenderReferenceGlyphSet (ClientPtr pClient);
-static int ProcRenderFreeGlyphSet (ClientPtr pClient);
-static int ProcRenderAddGlyphs (ClientPtr pClient);
-static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient);
-static int ProcRenderFreeGlyphs (ClientPtr pClient);
-static int ProcRenderCompositeGlyphs (ClientPtr pClient);
-static int ProcRenderFillRectangles (ClientPtr pClient);
-static int ProcRenderCreateCursor (ClientPtr pClient);
-static int ProcRenderSetPictureTransform (ClientPtr pClient);
-static int ProcRenderQueryFilters (ClientPtr pClient);
-static int ProcRenderSetPictureFilter (ClientPtr pClient);
-static int ProcRenderCreateAnimCursor (ClientPtr pClient);
-
-static int ProcRenderDispatch (ClientPtr pClient);
-
-static int SProcRenderQueryVersion (ClientPtr pClient);
-static int SProcRenderQueryPictFormats (ClientPtr pClient);
-static int SProcRenderQueryPictIndexValues (ClientPtr pClient);
-static int SProcRenderQueryDithers (ClientPtr pClient);
-static int SProcRenderCreatePicture (ClientPtr pClient);
-static int SProcRenderChangePicture (ClientPtr pClient);
-static int SProcRenderSetPictureClipRectangles (ClientPtr pClient);
-static int SProcRenderFreePicture (ClientPtr pClient);
-static int SProcRenderComposite (ClientPtr pClient);
-static int SProcRenderScale (ClientPtr pClient);
-static int SProcRenderTrapezoids (ClientPtr pClient);
-static int SProcRenderTriangles (ClientPtr pClient);
-static int SProcRenderTriStrip (ClientPtr pClient);
-static int SProcRenderTriFan (ClientPtr pClient);
-static int SProcRenderColorTrapezoids (ClientPtr pClient);
-static int SProcRenderColorTriangles (ClientPtr pClient);
-static int SProcRenderTransform (ClientPtr pClient);
-static int SProcRenderCreateGlyphSet (ClientPtr pClient);
-static int SProcRenderReferenceGlyphSet (ClientPtr pClient);
-static int SProcRenderFreeGlyphSet (ClientPtr pClient);
-static int SProcRenderAddGlyphs (ClientPtr pClient);
-static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient);
-static int SProcRenderFreeGlyphs (ClientPtr pClient);
-static int SProcRenderCompositeGlyphs (ClientPtr pClient);
-static int SProcRenderFillRectangles (ClientPtr pClient);
-static int SProcRenderCreateCursor (ClientPtr pClient);
-static int SProcRenderSetPictureTransform (ClientPtr pClient);
-static int SProcRenderQueryFilters (ClientPtr pClient);
-static int SProcRenderSetPictureFilter (ClientPtr pClient);
-static int SProcRenderCreateAnimCursor (ClientPtr pClient);
-
-static int SProcRenderDispatch (ClientPtr pClient);
-
-int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = {
- ProcRenderQueryVersion,
- ProcRenderQueryPictFormats,
- ProcRenderQueryPictIndexValues,
- ProcRenderQueryDithers,
- ProcRenderCreatePicture,
- ProcRenderChangePicture,
- ProcRenderSetPictureClipRectangles,
- ProcRenderFreePicture,
- ProcRenderComposite,
- ProcRenderScale,
- ProcRenderTrapezoids,
- ProcRenderTriangles,
- ProcRenderTriStrip,
- ProcRenderTriFan,
- ProcRenderColorTrapezoids,
- ProcRenderColorTriangles,
- ProcRenderTransform,
- ProcRenderCreateGlyphSet,
- ProcRenderReferenceGlyphSet,
- ProcRenderFreeGlyphSet,
- ProcRenderAddGlyphs,
- ProcRenderAddGlyphsFromPicture,
- ProcRenderFreeGlyphs,
- ProcRenderCompositeGlyphs,
- ProcRenderCompositeGlyphs,
- ProcRenderCompositeGlyphs,
- ProcRenderFillRectangles,
- ProcRenderCreateCursor,
- ProcRenderSetPictureTransform,
- ProcRenderQueryFilters,
- ProcRenderSetPictureFilter,
- ProcRenderCreateAnimCursor,
-};
-
-int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = {
- SProcRenderQueryVersion,
- SProcRenderQueryPictFormats,
- SProcRenderQueryPictIndexValues,
- SProcRenderQueryDithers,
- SProcRenderCreatePicture,
- SProcRenderChangePicture,
- SProcRenderSetPictureClipRectangles,
- SProcRenderFreePicture,
- SProcRenderComposite,
- SProcRenderScale,
- SProcRenderTrapezoids,
- SProcRenderTriangles,
- SProcRenderTriStrip,
- SProcRenderTriFan,
- SProcRenderColorTrapezoids,
- SProcRenderColorTriangles,
- SProcRenderTransform,
- SProcRenderCreateGlyphSet,
- SProcRenderReferenceGlyphSet,
- SProcRenderFreeGlyphSet,
- SProcRenderAddGlyphs,
- SProcRenderAddGlyphsFromPicture,
- SProcRenderFreeGlyphs,
- SProcRenderCompositeGlyphs,
- SProcRenderCompositeGlyphs,
- SProcRenderCompositeGlyphs,
- SProcRenderFillRectangles,
- SProcRenderCreateCursor,
- SProcRenderSetPictureTransform,
- SProcRenderQueryFilters,
- SProcRenderSetPictureFilter,
- SProcRenderCreateAnimCursor,
-};
-
-static void
-RenderResetProc (ExtensionEntry *extEntry);
-
-#if 0
-static CARD8 RenderReqCode;
-#endif
-int RenderErrBase;
-int RenderClientPrivateIndex;
-
-typedef struct _RenderClient {
- int major_version;
- int minor_version;
-} RenderClientRec, *RenderClientPtr;
-
-#define GetRenderClient(pClient) ((RenderClientPtr) (pClient)->devPrivates[RenderClientPrivateIndex].ptr)
-
-static void
-RenderClientCallback (CallbackListPtr *list,
- pointer closure,
- pointer data)
-{
- NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
- ClientPtr pClient = clientinfo->client;
- RenderClientPtr pRenderClient = GetRenderClient (pClient);
-
- pRenderClient->major_version = 0;
- pRenderClient->minor_version = 0;
-}
-
-void
-RenderExtensionInit (void)
-{
- ExtensionEntry *extEntry;
-
- if (!PictureType)
- return;
- if (!PictureFinishInit ())
- return;
- RenderClientPrivateIndex = AllocateClientPrivateIndex ();
- if (!AllocateClientPrivate (RenderClientPrivateIndex,
- sizeof (RenderClientRec)))
- return;
- if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0))
- return;
-
- extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors,
- ProcRenderDispatch, SProcRenderDispatch,
- RenderResetProc, StandardMinorOpcode);
- if (!extEntry)
- return;
-#if 0
- RenderReqCode = (CARD8) extEntry->base;
-#endif
- RenderErrBase = extEntry->errorBase;
-}
-
-static void
-RenderResetProc (ExtensionEntry *extEntry)
-{
-}
-
-static int
-ProcRenderQueryVersion (ClientPtr client)
-{
- RenderClientPtr pRenderClient = GetRenderClient (client);
- xRenderQueryVersionReply rep;
- register int n;
- REQUEST(xRenderQueryVersionReq);
-
- pRenderClient->major_version = stuff->majorVersion;
- pRenderClient->minor_version = stuff->minorVersion;
-
- REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = RENDER_MAJOR;
- rep.minorVersion = RENDER_MINOR;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-#if 0
-static int
-VisualDepth (ScreenPtr pScreen, VisualPtr pVisual)
-{
- DepthPtr pDepth;
- int d, v;
-
- for (d = 0; d < pScreen->numDepths; d++)
- {
- pDepth = pScreen->allowedDepths + d;
- for (v = 0; v < pDepth->numVids; v++)
- {
- if (pDepth->vids[v] == pVisual->vid)
- return pDepth->depth;
- }
- }
- return 0;
-}
-#endif
-
-static VisualPtr
-findVisual (ScreenPtr pScreen, VisualID vid)
-{
- VisualPtr pVisual;
- int v;
-
- for (v = 0; v < pScreen->numVisuals; v++)
- {
- pVisual = pScreen->visuals + v;
- if (pVisual->vid == vid)
- return pVisual;
- }
- return 0;
-}
-
-extern char *ConnectionInfo;
-
-static int
-ProcRenderQueryPictFormats (ClientPtr client)
-{
- RenderClientPtr pRenderClient = GetRenderClient (client);
- xRenderQueryPictFormatsReply *reply;
- xPictScreen *pictScreen;
- xPictDepth *pictDepth;
- xPictVisual *pictVisual;
- xPictFormInfo *pictForm;
- CARD32 *pictSubpixel;
- ScreenPtr pScreen;
- VisualPtr pVisual;
- DepthPtr pDepth;
- int v, d;
- PictureScreenPtr ps;
- PictFormatPtr pFormat;
- int nformat;
- int ndepth;
- int nvisual;
- int rlength;
- int s;
- int n;
- int numScreens;
- int numSubpixel;
-/* REQUEST(xRenderQueryPictFormatsReq); */
-
- REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
-
-#ifdef PANORAMIX
- if (noPanoramiXExtension)
- numScreens = screenInfo.numScreens;
- else
- numScreens = ((xConnSetup *)ConnectionInfo)->numRoots;
-#else
- numScreens = screenInfo.numScreens;
-#endif
- ndepth = nformat = nvisual = 0;
- for (s = 0; s < numScreens; s++)
- {
- pScreen = screenInfo.screens[s];
- for (d = 0; d < pScreen->numDepths; d++)
- {
- pDepth = pScreen->allowedDepths + d;
- ++ndepth;
-
- for (v = 0; v < pDepth->numVids; v++)
- {
- pVisual = findVisual (pScreen, pDepth->vids[v]);
- if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual))
- ++nvisual;
- }
- }
- ps = GetPictureScreenIfSet(pScreen);
- if (ps)
- nformat += ps->nformats;
- }
- if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6)
- numSubpixel = 0;
- else
- numSubpixel = numScreens;
-
- rlength = (sizeof (xRenderQueryPictFormatsReply) +
- nformat * sizeof (xPictFormInfo) +
- numScreens * sizeof (xPictScreen) +
- ndepth * sizeof (xPictDepth) +
- nvisual * sizeof (xPictVisual) +
- numSubpixel * sizeof (CARD32));
- reply = (xRenderQueryPictFormatsReply *) xalloc (rlength);
- if (!reply)
- return BadAlloc;
- reply->type = X_Reply;
- reply->sequenceNumber = client->sequence;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
- reply->numFormats = nformat;
- reply->numScreens = numScreens;
- reply->numDepths = ndepth;
- reply->numVisuals = nvisual;
- reply->numSubpixel = numSubpixel;
-
- pictForm = (xPictFormInfo *) (reply + 1);
-
- for (s = 0; s < numScreens; s++)
- {
- pScreen = screenInfo.screens[s];
- ps = GetPictureScreenIfSet(pScreen);
- if (ps)
- {
- for (nformat = 0, pFormat = ps->formats;
- nformat < ps->nformats;
- nformat++, pFormat++)
- {
- pictForm->id = pFormat->id;
- pictForm->type = pFormat->type;
- pictForm->depth = pFormat->depth;
- pictForm->direct.red = pFormat->direct.red;
- pictForm->direct.redMask = pFormat->direct.redMask;
- pictForm->direct.green = pFormat->direct.green;
- pictForm->direct.greenMask = pFormat->direct.greenMask;
- pictForm->direct.blue = pFormat->direct.blue;
- pictForm->direct.blueMask = pFormat->direct.blueMask;
- pictForm->direct.alpha = pFormat->direct.alpha;
- pictForm->direct.alphaMask = pFormat->direct.alphaMask;
- if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap)
- pictForm->colormap = pFormat->index.pColormap->mid;
- else
- pictForm->colormap = None;
- if (client->swapped)
- {
- swapl (&pictForm->id, n);
- swaps (&pictForm->direct.red, n);
- swaps (&pictForm->direct.redMask, n);
- swaps (&pictForm->direct.green, n);
- swaps (&pictForm->direct.greenMask, n);
- swaps (&pictForm->direct.blue, n);
- swaps (&pictForm->direct.blueMask, n);
- swaps (&pictForm->direct.alpha, n);
- swaps (&pictForm->direct.alphaMask, n);
- swapl (&pictForm->colormap, n);
- }
- pictForm++;
- }
- }
- }
-
- pictScreen = (xPictScreen *) pictForm;
- for (s = 0; s < numScreens; s++)
- {
- pScreen = screenInfo.screens[s];
- pictDepth = (xPictDepth *) (pictScreen + 1);
- ndepth = 0;
- for (d = 0; d < pScreen->numDepths; d++)
- {
- pictVisual = (xPictVisual *) (pictDepth + 1);
- pDepth = pScreen->allowedDepths + d;
-
- nvisual = 0;
- for (v = 0; v < pDepth->numVids; v++)
- {
- pVisual = findVisual (pScreen, pDepth->vids[v]);
- if (pVisual && (pFormat = PictureMatchVisual (pScreen,
- pDepth->depth,
- pVisual)))
- {
- pictVisual->visual = pVisual->vid;
- pictVisual->format = pFormat->id;
- if (client->swapped)
- {
- swapl (&pictVisual->visual, n);
- swapl (&pictVisual->format, n);
- }
- pictVisual++;
- nvisual++;
- }
- }
- pictDepth->depth = pDepth->depth;
- pictDepth->nPictVisuals = nvisual;
- if (client->swapped)
- {
- swaps (&pictDepth->nPictVisuals, n);
- }
- ndepth++;
- pictDepth = (xPictDepth *) pictVisual;
- }
- pictScreen->nDepth = ndepth;
- ps = GetPictureScreenIfSet(pScreen);
- if (ps)
- pictScreen->fallback = ps->fallback->id;
- else
- pictScreen->fallback = 0;
- if (client->swapped)
- {
- swapl (&pictScreen->nDepth, n);
- swapl (&pictScreen->fallback, n);
- }
- pictScreen = (xPictScreen *) pictDepth;
- }
- pictSubpixel = (CARD32 *) pictScreen;
-
- for (s = 0; s < numSubpixel; s++)
- {
- pScreen = screenInfo.screens[s];
- ps = GetPictureScreenIfSet(pScreen);
- if (ps)
- *pictSubpixel = ps->subpixel;
- else
- *pictSubpixel = SubPixelUnknown;
- if (client->swapped)
- {
- swapl (pictSubpixel, n);
- }
- ++pictSubpixel;
- }
-
- if (client->swapped)
- {
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- swapl (&reply->numFormats, n);
- swapl (&reply->numScreens, n);
- swapl (&reply->numDepths, n);
- swapl (&reply->numVisuals, n);
- swapl (&reply->numSubpixel, n);
- }
- WriteToClient(client, rlength, (char *) reply);
- xfree (reply);
- return client->noClientException;
-}
-
-static int
-ProcRenderQueryPictIndexValues (ClientPtr client)
-{
- PictFormatPtr pFormat;
- int num;
- int rlength;
- int i, n;
- REQUEST(xRenderQueryPictIndexValuesReq);
- xRenderQueryPictIndexValuesReply *reply;
- xIndexValue *values;
-
- REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
-
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->format,
- PictFormatType,
- SecurityReadAccess);
-
- if (!pFormat)
- {
- client->errorValue = stuff->format;
- return RenderErrBase + BadPictFormat;
- }
- if (pFormat->type != PictTypeIndexed)
- {
- client->errorValue = stuff->format;
- return BadMatch;
- }
- num = pFormat->index.nvalues;
- rlength = (sizeof (xRenderQueryPictIndexValuesReply) +
- num * sizeof(xIndexValue));
- reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength);
- if (!reply)
- return BadAlloc;
-
- reply->type = X_Reply;
- reply->sequenceNumber = client->sequence;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
- reply->numIndexValues = num;
-
- values = (xIndexValue *) (reply + 1);
-
- memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue));
-
- if (client->swapped)
- {
- for (i = 0; i < num; i++)
- {
- swapl (&values[i].pixel, n);
- swaps (&values[i].red, n);
- swaps (&values[i].green, n);
- swaps (&values[i].blue, n);
- swaps (&values[i].alpha, n);
- }
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- swapl (&reply->numIndexValues, n);
- }
-
- WriteToClient(client, rlength, (char *) reply);
- xfree(reply);
- return (client->noClientException);
-}
-
-static int
-ProcRenderQueryDithers (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderCreatePicture (ClientPtr client)
-{
- PicturePtr pPicture;
- DrawablePtr pDrawable;
- PictFormatPtr pFormat;
- int len;
- int error;
- REQUEST(xRenderCreatePictureReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
-
- LEGAL_NEW_RESOURCE(stuff->pid, client);
- SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client,
- SecurityWriteAccess);
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->format,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->format;
- return RenderErrBase + BadPictFormat;
- }
- if (pFormat->depth != pDrawable->depth)
- return BadMatch;
- len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- pPicture = CreatePicture (stuff->pid,
- pDrawable,
- pFormat,
- stuff->mask,
- (XID *) (stuff + 1),
- client,
- &error);
- if (!pPicture)
- return error;
- if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
- return BadAlloc;
- return Success;
-}
-
-static int
-ProcRenderChangePicture (ClientPtr client)
-{
- PicturePtr pPicture;
- REQUEST(xRenderChangePictureReq);
- int len;
-
- REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
- VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- return ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1),
- (DevUnion *) 0, client);
-}
-
-static int
-ProcRenderSetPictureClipRectangles (ClientPtr client)
-{
- REQUEST(xRenderSetPictureClipRectanglesReq);
- PicturePtr pPicture;
- int nr;
- int result;
-
- REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
- VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq);
- if (nr & 4)
- return BadLength;
- nr >>= 3;
- result = SetPictureClipRects (pPicture,
- stuff->xOrigin, stuff->yOrigin,
- nr, (xRectangle *) &stuff[1]);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-static int
-ProcRenderFreePicture (ClientPtr client)
-{
- PicturePtr pPicture;
- REQUEST(xRenderFreePictureReq);
-
- REQUEST_SIZE_MATCH(xRenderFreePictureReq);
-
- VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
- RenderErrBase + BadPicture);
- FreeResource (stuff->picture, RT_NONE);
- return(client->noClientException);
-}
-
-static Bool
-PictOpValid (CARD8 op)
-{
- if (/*PictOpMinimum <= op && */ op <= PictOpMaximum)
- return TRUE;
- if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum)
- return TRUE;
- if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum)
- return TRUE;
- return FALSE;
-}
-
-static int
-ProcRenderComposite (ClientPtr client)
-{
- PicturePtr pSrc, pMask, pDst;
- REQUEST(xRenderCompositeReq);
-
- REQUEST_SIZE_MATCH(xRenderCompositeReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen ||
- (pMask && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
- return BadMatch;
- CompositePicture (stuff->op,
- pSrc,
- pMask,
- pDst,
- stuff->xSrc,
- stuff->ySrc,
- stuff->xMask,
- stuff->yMask,
- stuff->xDst,
- stuff->yDst,
- stuff->width,
- stuff->height);
- return Success;
-}
-
-static int
-ProcRenderScale (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderTrapezoids (ClientPtr client)
-{
- int ntraps;
- PicturePtr pSrc, pDst;
- PictFormatPtr pFormat;
- REQUEST(xRenderTrapezoidsReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
- return BadMatch;
- if (stuff->maskFormat)
- {
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->maskFormat,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->maskFormat;
- return RenderErrBase + BadPictFormat;
- }
- }
- else
- pFormat = 0;
- ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
- if (ntraps % sizeof (xTrapezoid))
- return BadLength;
- ntraps /= sizeof (xTrapezoid);
- if (ntraps)
- CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat,
- stuff->xSrc, stuff->ySrc,
- ntraps, (xTrapezoid *) &stuff[1]);
- return client->noClientException;
-}
-
-static int
-ProcRenderTriangles (ClientPtr client)
-{
- int ntris;
- PicturePtr pSrc, pDst;
- PictFormatPtr pFormat;
- REQUEST(xRenderTrianglesReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
- return BadMatch;
- if (stuff->maskFormat)
- {
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->maskFormat,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->maskFormat;
- return RenderErrBase + BadPictFormat;
- }
- }
- else
- pFormat = 0;
- ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
- if (ntris % sizeof (xTriangle))
- return BadLength;
- ntris /= sizeof (xTriangle);
- if (ntris)
- CompositeTriangles (stuff->op, pSrc, pDst, pFormat,
- stuff->xSrc, stuff->ySrc,
- ntris, (xTriangle *) &stuff[1]);
- return client->noClientException;
-}
-
-static int
-ProcRenderTriStrip (ClientPtr client)
-{
- int npoints;
- PicturePtr pSrc, pDst;
- PictFormatPtr pFormat;
- REQUEST(xRenderTrianglesReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
- return BadMatch;
- if (stuff->maskFormat)
- {
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->maskFormat,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->maskFormat;
- return RenderErrBase + BadPictFormat;
- }
- }
- else
- pFormat = 0;
- npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
- if (npoints & 4)
- return(BadLength);
- npoints >>= 3;
- if (npoints >= 3)
- CompositeTriStrip (stuff->op, pSrc, pDst, pFormat,
- stuff->xSrc, stuff->ySrc,
- npoints, (xPointFixed *) &stuff[1]);
- return client->noClientException;
-}
-
-static int
-ProcRenderTriFan (ClientPtr client)
-{
- int npoints;
- PicturePtr pSrc, pDst;
- PictFormatPtr pFormat;
- REQUEST(xRenderTrianglesReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
- return BadMatch;
- if (stuff->maskFormat)
- {
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->maskFormat,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->maskFormat;
- return RenderErrBase + BadPictFormat;
- }
- }
- else
- pFormat = 0;
- npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
- if (npoints & 4)
- return(BadLength);
- npoints >>= 3;
- if (npoints >= 3)
- CompositeTriFan (stuff->op, pSrc, pDst, pFormat,
- stuff->xSrc, stuff->ySrc,
- npoints, (xPointFixed *) &stuff[1]);
- return client->noClientException;
-}
-
-static int
-ProcRenderColorTrapezoids (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderColorTriangles (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderTransform (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderCreateGlyphSet (ClientPtr client)
-{
- GlyphSetPtr glyphSet;
- PictFormatPtr format;
- int f;
- REQUEST(xRenderCreateGlyphSetReq);
-
- REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
-
- LEGAL_NEW_RESOURCE(stuff->gsid, client);
- format = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->format,
- PictFormatType,
- SecurityReadAccess);
- if (!format)
- {
- client->errorValue = stuff->format;
- return RenderErrBase + BadPictFormat;
- }
- switch (format->depth) {
- case 1:
- f = GlyphFormat1;
- break;
- case 4:
- f = GlyphFormat4;
- break;
- case 8:
- f = GlyphFormat8;
- break;
- case 16:
- f = GlyphFormat16;
- break;
- case 32:
- f = GlyphFormat32;
- break;
- default:
- return BadMatch;
- }
- if (format->type != PictTypeDirect)
- return BadMatch;
- glyphSet = AllocateGlyphSet (f, format);
- if (!glyphSet)
- return BadAlloc;
- if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
- return BadAlloc;
- return Success;
-}
-
-static int
-ProcRenderReferenceGlyphSet (ClientPtr client)
-{
- GlyphSetPtr glyphSet;
- REQUEST(xRenderReferenceGlyphSetReq);
-
- REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
-
- LEGAL_NEW_RESOURCE(stuff->gsid, client);
-
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- stuff->existing,
- GlyphSetType,
- SecurityWriteAccess);
- if (!glyphSet)
- {
- client->errorValue = stuff->existing;
- return RenderErrBase + BadGlyphSet;
- }
- glyphSet->refcnt++;
- if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
- return BadAlloc;
- return client->noClientException;
-}
-
-#define NLOCALDELTA 64
-#define NLOCALGLYPH 256
-
-static int
-ProcRenderFreeGlyphSet (ClientPtr client)
-{
- GlyphSetPtr glyphSet;
- REQUEST(xRenderFreeGlyphSetReq);
-
- REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- stuff->glyphset,
- GlyphSetType,
- SecurityDestroyAccess);
- if (!glyphSet)
- {
- client->errorValue = stuff->glyphset;
- return RenderErrBase + BadGlyphSet;
- }
- FreeResource (stuff->glyphset, RT_NONE);
- return client->noClientException;
-}
-
-typedef struct _GlyphNew {
- Glyph id;
- GlyphPtr glyph;
-} GlyphNewRec, *GlyphNewPtr;
-
-static int
-ProcRenderAddGlyphs (ClientPtr client)
-{
- GlyphSetPtr glyphSet;
- REQUEST(xRenderAddGlyphsReq);
- GlyphNewRec glyphsLocal[NLOCALGLYPH];
- GlyphNewPtr glyphsBase, glyphs;
- GlyphPtr glyph;
- int remain, nglyphs;
- CARD32 *gids;
- xGlyphInfo *gi;
- CARD8 *bits;
- int size;
- int err = BadAlloc;
-
- REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- stuff->glyphset,
- GlyphSetType,
- SecurityWriteAccess);
- if (!glyphSet)
- {
- client->errorValue = stuff->glyphset;
- return RenderErrBase + BadGlyphSet;
- }
-
- nglyphs = stuff->nglyphs;
- if (nglyphs <= NLOCALGLYPH)
- glyphsBase = glyphsLocal;
- else
- {
- glyphsBase = (GlyphNewPtr) ALLOCATE_LOCAL (nglyphs * sizeof (GlyphNewRec));
- if (!glyphsBase)
- return BadAlloc;
- }
-
- remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq);
-
- glyphs = glyphsBase;
-
- gids = (CARD32 *) (stuff + 1);
- gi = (xGlyphInfo *) (gids + nglyphs);
- bits = (CARD8 *) (gi + nglyphs);
- remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
- while (remain >= 0 && nglyphs)
- {
- glyph = AllocateGlyph (gi, glyphSet->fdepth);
- if (!glyph)
- {
- err = BadAlloc;
- goto bail;
- }
-
- glyphs->glyph = glyph;
- glyphs->id = *gids;
-
- size = glyph->size - sizeof (xGlyphInfo);
- if (remain < size)
- break;
- memcpy ((CARD8 *) (glyph + 1), bits, size);
-
- if (size & 3)
- size += 4 - (size & 3);
- bits += size;
- remain -= size;
- gi++;
- gids++;
- glyphs++;
- nglyphs--;
- }
- if (nglyphs || remain)
- {
- err = BadLength;
- goto bail;
- }
- nglyphs = stuff->nglyphs;
- if (!ResizeGlyphSet (glyphSet, nglyphs))
- {
- err = BadAlloc;
- goto bail;
- }
- glyphs = glyphsBase;
- while (nglyphs--)
- AddGlyph (glyphSet, glyphs->glyph, glyphs->id);
-
- if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
- return client->noClientException;
-bail:
- while (glyphs != glyphsBase)
- {
- --glyphs;
- xfree (glyphs->glyph);
- }
- if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
- return err;
-}
-
-static int
-ProcRenderAddGlyphsFromPicture (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-ProcRenderFreeGlyphs (ClientPtr client)
-{
- REQUEST(xRenderFreeGlyphsReq);
- GlyphSetPtr glyphSet;
- int nglyph;
- CARD32 *gids;
- CARD32 glyph;
-
- REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- stuff->glyphset,
- GlyphSetType,
- SecurityWriteAccess);
- if (!glyphSet)
- {
- client->errorValue = stuff->glyphset;
- return RenderErrBase + BadGlyphSet;
- }
- nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2;
- gids = (CARD32 *) (stuff + 1);
- while (nglyph-- > 0)
- {
- glyph = *gids++;
- if (!DeleteGlyph (glyphSet, glyph))
- {
- client->errorValue = glyph;
- return RenderErrBase + BadGlyph;
- }
- }
- return client->noClientException;
-}
-
-static int
-ProcRenderCompositeGlyphs (ClientPtr client)
-{
- GlyphSetPtr glyphSet;
- GlyphSet gs;
- PicturePtr pSrc, pDst;
- PictFormatPtr pFormat;
- GlyphListRec listsLocal[NLOCALDELTA];
- GlyphListPtr lists, listsBase;
- GlyphPtr glyphsLocal[NLOCALGLYPH];
- Glyph glyph;
- GlyphPtr *glyphs, *glyphsBase;
- xGlyphElt *elt;
- CARD8 *buffer, *end;
- int nglyph;
- int nlist;
- int space;
- int size;
- int n;
-
- REQUEST(xRenderCompositeGlyphsReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
-
- switch (stuff->renderReqType) {
- default: size = 1; break;
- case X_RenderCompositeGlyphs16: size = 2; break;
- case X_RenderCompositeGlyphs32: size = 4; break;
- }
-
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
- return BadMatch;
- if (stuff->maskFormat)
- {
- pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
- stuff->maskFormat,
- PictFormatType,
- SecurityReadAccess);
- if (!pFormat)
- {
- client->errorValue = stuff->maskFormat;
- return RenderErrBase + BadPictFormat;
- }
- }
- else
- pFormat = 0;
-
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- stuff->glyphset,
- GlyphSetType,
- SecurityReadAccess);
- if (!glyphSet)
- {
- client->errorValue = stuff->glyphset;
- return RenderErrBase + BadGlyphSet;
- }
-
- buffer = (CARD8 *) (stuff + 1);
- end = (CARD8 *) stuff + (client->req_len << 2);
- nglyph = 0;
- nlist = 0;
- while (buffer + sizeof (xGlyphElt) < end)
- {
- elt = (xGlyphElt *) buffer;
- buffer += sizeof (xGlyphElt);
-
- if (elt->len == 0xff)
- {
- buffer += 4;
- }
- else
- {
- nlist++;
- nglyph += elt->len;
- space = size * elt->len;
- if (space & 3)
- space += 4 - (space & 3);
- buffer += space;
- }
- }
- if (nglyph <= NLOCALGLYPH)
- glyphsBase = glyphsLocal;
- else
- {
- glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr));
- if (!glyphsBase)
- return BadAlloc;
- }
- if (nlist <= NLOCALDELTA)
- listsBase = listsLocal;
- else
- {
- listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec));
- if (!listsBase)
- return BadAlloc;
- }
- buffer = (CARD8 *) (stuff + 1);
- glyphs = glyphsBase;
- lists = listsBase;
- while (buffer + sizeof (xGlyphElt) < end)
- {
- elt = (xGlyphElt *) buffer;
- buffer += sizeof (xGlyphElt);
-
- if (elt->len == 0xff)
- {
- if (buffer + sizeof (GlyphSet) < end)
- {
- gs = *(GlyphSet *) buffer;
- glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
- gs,
- GlyphSetType,
- SecurityReadAccess);
- if (!glyphSet)
- {
- client->errorValue = gs;
- if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
- if (listsBase != listsLocal)
- DEALLOCATE_LOCAL (listsBase);
- return RenderErrBase + BadGlyphSet;
- }
- }
- buffer += 4;
- }
- else
- {
- lists->xOff = elt->deltax;
- lists->yOff = elt->deltay;
- lists->format = glyphSet->format;
- lists->len = 0;
- n = elt->len;
- while (n--)
- {
- if (buffer + size <= end)
- {
- switch (size) {
- case 1:
- glyph = *((CARD8 *)buffer); break;
- case 2:
- glyph = *((CARD16 *)buffer); break;
- case 4:
- default:
- glyph = *((CARD32 *)buffer); break;
- }
- if ((*glyphs = FindGlyph (glyphSet, glyph)))
- {
- lists->len++;
- glyphs++;
- }
- }
- buffer += size;
- }
- space = size * elt->len;
- if (space & 3)
- buffer += 4 - (space & 3);
- lists++;
- }
- }
- if (buffer > end)
- return BadLength;
-
- CompositeGlyphs (stuff->op,
- pSrc,
- pDst,
- pFormat,
- stuff->xSrc,
- stuff->ySrc,
- nlist,
- listsBase,
- glyphsBase);
-
- if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
- if (listsBase != listsLocal)
- DEALLOCATE_LOCAL (listsBase);
-
- return client->noClientException;
-}
-
-static int
-ProcRenderFillRectangles (ClientPtr client)
-{
- PicturePtr pDst;
- int things;
- REQUEST(xRenderFillRectanglesReq);
-
- REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
- if (!PictOpValid (stuff->op))
- {
- client->errorValue = stuff->op;
- return BadValue;
- }
- VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq);
- if (things & 4)
- return(BadLength);
- things >>= 3;
-
- CompositeRects (stuff->op,
- pDst,
- &stuff->color,
- things,
- (xRectangle *) &stuff[1]);
-
- return client->noClientException;
-}
-
-static void
-SetBit (unsigned char *line, int x, int bit)
-{
- unsigned char mask;
-
- if (screenInfo.bitmapBitOrder == LSBFirst)
- mask = (1 << (x & 7));
- else
- mask = (0x80 >> (x & 7));
- /* XXX assumes byte order is host byte order */
- line += (x >> 3);
- if (bit)
- *line |= mask;
- else
- *line &= ~mask;
-}
-
-#define DITHER_DIM 2
-
-static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = {
- { 1, 3, },
- { 4, 2, },
-};
-
-#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1)
-
-static int
-ProcRenderCreateCursor (ClientPtr client)
-{
- REQUEST(xRenderCreateCursorReq);
- PicturePtr pSrc;
- ScreenPtr pScreen;
- unsigned short width, height;
- CARD32 *argbbits, *argb;
- unsigned char *srcbits, *srcline;
- unsigned char *mskbits, *mskline;
- int stride;
- int x, y;
- int nbytes_mono;
- CursorMetricRec cm;
- CursorPtr pCursor;
- CARD32 twocolor[3];
- int ncolor;
-
- REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
- LEGAL_NEW_RESOURCE(stuff->cid, client);
-
- VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- pScreen = pSrc->pDrawable->pScreen;
- width = pSrc->pDrawable->width;
- height = pSrc->pDrawable->height;
- if ( stuff->x > width
- || stuff->y > height )
- return (BadMatch);
- argbbits = xalloc (width * height * sizeof (CARD32));
- if (!argbbits)
- return (BadAlloc);
-
- stride = BitmapBytePad(width);
- nbytes_mono = stride*height;
- srcbits = (unsigned char *)xalloc(nbytes_mono);
- if (!srcbits)
- {
- xfree (argbbits);
- return (BadAlloc);
- }
- mskbits = (unsigned char *)xalloc(nbytes_mono);
- if (!mskbits)
- {
- xfree(argbbits);
- xfree(srcbits);
- return (BadAlloc);
- }
- bzero ((char *) mskbits, nbytes_mono);
- bzero ((char *) srcbits, nbytes_mono);
-
- if (pSrc->format == PICT_a8r8g8b8)
- {
- (*pScreen->GetImage) (pSrc->pDrawable,
- 0, 0, width, height, ZPixmap,
- 0xffffffff, (pointer) argbbits);
- }
- else
- {
- PixmapPtr pPixmap;
- PicturePtr pPicture;
- PictFormatPtr pFormat;
- int error;
-
- pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
- if (!pFormat)
- {
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
- return (BadImplementation);
- }
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
- if (!pPixmap)
- {
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
- return (BadAlloc);
- }
- pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
- client, &error);
- if (!pPicture);
- {
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
- return error;
- }
- (*pScreen->DestroyPixmap) (pPixmap);
- CompositePicture (PictOpSrc,
- pSrc, 0, pPicture,
- 0, 0, 0, 0, 0, 0, width, height);
- (*pScreen->GetImage) (pPicture->pDrawable,
- 0, 0, width, height, ZPixmap,
- 0xffffffff, (pointer) argbbits);
- FreePicture (pPicture, 0);
- }
- /*
- * Check whether the cursor can be directly supported by
- * the core cursor code
- */
- ncolor = 0;
- argb = argbbits;
- for (y = 0; ncolor <= 2 && y < height; y++)
- {
- for (x = 0; ncolor <= 2 && x < width; x++)
- {
- CARD32 p = *argb++;
- CARD32 a = (p >> 24);
-
- if (a == 0) /* transparent */
- continue;
- if (a == 0xff) /* opaque */
- {
- int n;
- for (n = 0; n < ncolor; n++)
- if (p == twocolor[n])
- break;
- if (n == ncolor)
- twocolor[ncolor++] = p;
- }
- else
- ncolor = 3;
- }
- }
-
- /*
- * Convert argb image to two plane cursor
- */
- srcline = srcbits;
- mskline = mskbits;
- argb = argbbits;
- for (y = 0; y < height; y++)
- {
- for (x = 0; x < width; x++)
- {
- CARD32 p = *argb++;
-
- if (ncolor <= 2)
- {
- CARD32 a = ((p >> 24));
-
- SetBit (mskline, x, a != 0);
- SetBit (srcline, x, a != 0 && p == twocolor[0]);
- }
- else
- {
- CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255;
- CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255;
- CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)];
- /* Set mask from dithered alpha value */
- SetBit(mskline, x, a > d);
- /* Set src from dithered intensity value */
- SetBit(srcline, x, a > d && i <= d);
- }
- }
- srcline += stride;
- mskline += stride;
- }
- /*
- * Dither to white and black if the cursor has more than two colors
- */
- if (ncolor > 2)
- {
- twocolor[0] = 0xff000000;
- twocolor[1] = 0xffffffff;
- }
- else
- {
- xfree (argbbits);
- argbbits = 0;
- }
-
-#define GetByte(p,s) (((p) >> (s)) & 0xff)
-#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8))
-
- cm.width = width;
- cm.height = height;
- cm.xhot = stuff->x;
- cm.yhot = stuff->y;
- pCursor = AllocCursorARGB (srcbits, mskbits, argbbits, &cm,
- GetColor(twocolor[0], 16),
- GetColor(twocolor[0], 8),
- GetColor(twocolor[0], 0),
- GetColor(twocolor[1], 16),
- GetColor(twocolor[1], 8),
- GetColor(twocolor[1], 0));
- if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
- return (client->noClientException);
- return BadAlloc;
-}
-
-static int
-ProcRenderSetPictureTransform (ClientPtr client)
-{
- REQUEST(xRenderSetPictureTransformReq);
- PicturePtr pPicture;
- int result;
-
- REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
- VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
-}
-
-static int
-ProcRenderQueryFilters (ClientPtr client)
-{
- REQUEST (xRenderQueryFiltersReq);
- DrawablePtr pDrawable;
- xRenderQueryFiltersReply *reply;
- int nbytesName;
- int nnames;
- ScreenPtr pScreen;
- PictureScreenPtr ps;
- int i, j;
- int len;
- int total_bytes;
- INT16 *aliases;
- char *names;
-
- REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
- SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess);
-
- pScreen = pDrawable->pScreen;
- nbytesName = 0;
- nnames = 0;
- ps = GetPictureScreenIfSet(pScreen);
- if (ps)
- {
- for (i = 0; i < ps->nfilters; i++)
- nbytesName += 1 + strlen (ps->filters[i].name);
- for (i = 0; i < ps->nfilterAliases; i++)
- nbytesName += 1 + strlen (ps->filterAliases[i].alias);
- nnames = ps->nfilters + ps->nfilterAliases;
- }
- len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2);
- total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
- reply = (xRenderQueryFiltersReply *) xalloc (total_bytes);
- if (!reply)
- return BadAlloc;
- aliases = (INT16 *) (reply + 1);
- names = (char *) (aliases + ((nnames + 1) & ~1));
-
- reply->type = X_Reply;
- reply->sequenceNumber = client->sequence;
- reply->length = len;
- reply->numAliases = nnames;
- reply->numFilters = nnames;
- if (ps)
- {
-
- /* fill in alias values */
- for (i = 0; i < ps->nfilters; i++)
- aliases[i] = FilterAliasNone;
- for (i = 0; i < ps->nfilterAliases; i++)
- {
- for (j = 0; j < ps->nfilters; j++)
- if (ps->filterAliases[i].filter_id == ps->filters[j].id)
- break;
- if (j == ps->nfilters)
- {
- for (j = 0; j < ps->nfilterAliases; j++)
- if (ps->filterAliases[i].filter_id ==
- ps->filterAliases[j].alias_id)
- {
- break;
- }
- if (j == ps->nfilterAliases)
- j = FilterAliasNone;
- else
- j = j + ps->nfilters;
- }
- aliases[i + ps->nfilters] = j;
- }
-
- /* fill in filter names */
- for (i = 0; i < ps->nfilters; i++)
- {
- j = strlen (ps->filters[i].name);
- *names++ = j;
- strncpy (names, ps->filters[i].name, j);
- names += j;
- }
-
- /* fill in filter alias names */
- for (i = 0; i < ps->nfilterAliases; i++)
- {
- j = strlen (ps->filterAliases[i].alias);
- *names++ = j;
- strncpy (names, ps->filterAliases[i].alias, j);
- names += j;
- }
- }
-
- if (client->swapped)
- {
- register int n;
-
- for (i = 0; i < reply->numAliases; i++)
- {
- swaps (&aliases[i], n);
- }
- swaps(&reply->sequenceNumber, n);
- swapl(&reply->length, n);
- swapl(&reply->numAliases, n);
- swapl(&reply->numFilters, n);
- }
- WriteToClient(client, total_bytes, (char *) reply);
- xfree (reply);
-
- return(client->noClientException);
-}
-
-static int
-ProcRenderSetPictureFilter (ClientPtr client)
-{
- REQUEST (xRenderSetPictureFilterReq);
- PicturePtr pPicture;
- int result;
- xFixed *params;
- int nparams;
- char *name;
-
- REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
- VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- name = (char *) (stuff + 1);
- params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
- nparams = ((xFixed *) stuff + client->req_len) - params;
- result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams);
- return result;
-}
-
-static int
-ProcRenderCreateAnimCursor (ClientPtr client)
-{
- REQUEST(xRenderCreateAnimCursorReq);
- CursorPtr *cursors;
- CARD32 *deltas;
- CursorPtr pCursor;
- int ncursor;
- xAnimCursorElt *elt;
- int i;
- int ret;
-
- REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq);
- LEGAL_NEW_RESOURCE(stuff->cid, client);
- if (client->req_len & 1)
- return BadLength;
- ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1;
- cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
- if (!cursors)
- return BadAlloc;
- deltas = (CARD32 *) (cursors + ncursor);
- elt = (xAnimCursorElt *) (stuff + 1);
- for (i = 0; i < ncursor; i++)
- {
- cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor,
- RT_CURSOR, SecurityReadAccess);
- if (!cursors[i])
- {
- xfree (cursors);
- client->errorValue = elt->cursor;
- return BadCursor;
- }
- deltas[i] = elt->delay;
- elt++;
- }
- ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor);
- xfree (cursors);
- if (ret != Success)
- return ret;
-
- if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor))
- return client->noClientException;
- return BadAlloc;
-}
-
-static int
-ProcRenderDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if (stuff->data < RenderNumberRequests)
- return (*ProcRenderVector[stuff->data]) (client);
- else
- return BadRequest;
-}
-
-static int
-SProcRenderQueryVersion (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderQueryVersionReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
- return (*ProcRenderVector[stuff->renderReqType])(client);
-}
-
-static int
-SProcRenderQueryPictFormats (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderQueryPictFormatsReq);
- swaps(&stuff->length, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderQueryPictIndexValues (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderQueryPictIndexValuesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->format, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderQueryDithers (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-SProcRenderCreatePicture (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderCreatePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->format, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderChangePicture (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderChangePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderSetPictureClipRectangles (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderSetPictureClipRectanglesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- SwapRestS(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderFreePicture (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderFreePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderComposite (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderCompositeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->mask, n);
- swapl(&stuff->dst, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
- swaps(&stuff->xMask, n);
- swaps(&stuff->yMask, n);
- swaps(&stuff->xDst, n);
- swaps(&stuff->yDst, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderScale (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderScaleReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->dst, n);
- swapl(&stuff->colorScale, n);
- swapl(&stuff->alphaScale, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
- swaps(&stuff->xDst, n);
- swaps(&stuff->yDst, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderTrapezoids (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderTrapezoidsReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderTriangles (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderTrianglesReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderTriStrip (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderTriStripReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderTriFan (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderTriFanReq);
-
- REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderColorTrapezoids (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-SProcRenderColorTriangles (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-SProcRenderTransform (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-SProcRenderCreateGlyphSet (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderCreateGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->gsid, n);
- swapl(&stuff->format, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderReferenceGlyphSet (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderReferenceGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->gsid, n);
- swapl(&stuff->existing, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderFreeGlyphSet (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderFreeGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderAddGlyphs (ClientPtr client)
-{
- register int n;
- register int i;
- CARD32 *gids;
- void *end;
- xGlyphInfo *gi;
- REQUEST(xRenderAddGlyphsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
- swapl(&stuff->nglyphs, n);
- if (stuff->nglyphs & 0xe0000000)
- return BadLength;
- end = (CARD8 *) stuff + (client->req_len << 2);
- gids = (CARD32 *) (stuff + 1);
- gi = (xGlyphInfo *) (gids + stuff->nglyphs);
- if ((char *) end - (char *) (gids + stuff->nglyphs) < 0)
- return BadLength;
- if ((char *) end - (char *) (gi + stuff->nglyphs) < 0)
- return BadLength;
- for (i = 0; i < stuff->nglyphs; i++)
- {
- swapl (&gids[i], n);
- swaps (&gi[i].width, n);
- swaps (&gi[i].height, n);
- swaps (&gi[i].x, n);
- swaps (&gi[i].y, n);
- swaps (&gi[i].xOff, n);
- swaps (&gi[i].yOff, n);
- }
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderAddGlyphsFromPicture (ClientPtr client)
-{
- return BadImplementation;
-}
-
-static int
-SProcRenderFreeGlyphs (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderFreeGlyphsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderCompositeGlyphs (ClientPtr client)
-{
- register int n;
- xGlyphElt *elt;
- CARD8 *buffer;
- CARD8 *end;
- int space;
- int i;
- int size;
-
- REQUEST(xRenderCompositeGlyphsReq);
-
- switch (stuff->renderReqType) {
- default: size = 1; break;
- case X_RenderCompositeGlyphs16: size = 2; break;
- case X_RenderCompositeGlyphs32: size = 4; break;
- }
-
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->dst, n);
- swapl(&stuff->maskFormat, n);
- swapl(&stuff->glyphset, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
- buffer = (CARD8 *) (stuff + 1);
- end = (CARD8 *) stuff + (client->req_len << 2);
- while (buffer + sizeof (xGlyphElt) < end)
- {
- elt = (xGlyphElt *) buffer;
- buffer += sizeof (xGlyphElt);
-
- swaps (&elt->deltax, n);
- swaps (&elt->deltay, n);
-
- i = elt->len;
- if (i == 0xff)
- {
- swapl (buffer, n);
- buffer += 4;
- }
- else
- {
- space = size * i;
- switch (size) {
- case 1:
- buffer += i;
- break;
- case 2:
- while (i--)
- {
- swaps (buffer, n);
- buffer += 2;
- }
- break;
- case 4:
- while (i--)
- {
- swapl (buffer, n);
- buffer += 4;
- }
- break;
- }
- if (space & 3)
- buffer += 4 - (space & 3);
- }
- }
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderFillRectangles (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderFillRectanglesReq);
-
- REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->dst, n);
- swaps(&stuff->color.red, n);
- swaps(&stuff->color.green, n);
- swaps(&stuff->color.blue, n);
- swaps(&stuff->color.alpha, n);
- SwapRestS(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderCreateCursor (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderCreateCursorReq);
- REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cid, n);
- swapl(&stuff->src, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderSetPictureTransform (ClientPtr client)
-{
- register int n;
- REQUEST(xRenderSetPictureTransformReq);
- REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swapl(&stuff->transform.matrix11, n);
- swapl(&stuff->transform.matrix12, n);
- swapl(&stuff->transform.matrix13, n);
- swapl(&stuff->transform.matrix21, n);
- swapl(&stuff->transform.matrix22, n);
- swapl(&stuff->transform.matrix23, n);
- swapl(&stuff->transform.matrix31, n);
- swapl(&stuff->transform.matrix32, n);
- swapl(&stuff->transform.matrix33, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderQueryFilters (ClientPtr client)
-{
- register int n;
- REQUEST (xRenderQueryFiltersReq);
- REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderSetPictureFilter (ClientPtr client)
-{
- register int n;
- REQUEST (xRenderSetPictureFilterReq);
- REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swaps(&stuff->nbytes, n);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderCreateAnimCursor (ClientPtr client)
-{
- register int n;
- REQUEST (xRenderCreateAnimCursorReq);
- REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->cid, n);
- SwapRestL(stuff);
- return (*ProcRenderVector[stuff->renderReqType]) (client);
-}
-
-static int
-SProcRenderDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if (stuff->data < RenderNumberRequests)
- return (*SProcRenderVector[stuff->data]) (client);
- else
- return BadRequest;
-}
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-
-#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\
- pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\
- if (!pPicture) { \
- client->errorValue = pid; \
- return err; \
- } \
-}
-
-#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\
- if (pid == None) \
- pPicture = 0; \
- else { \
- VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \
- } \
-} \
-
-int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr);
-
-unsigned long XRT_PICTURE;
-
-static int
-PanoramiXRenderCreatePicture (ClientPtr client)
-{
- REQUEST(xRenderCreatePictureReq);
- PanoramiXRes *refDraw, *newPict;
- int result = Success, j;
-
- REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
- if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
- client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
- return BadDrawable;
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
- return BadAlloc;
- newPict->type = XRT_PICTURE;
- newPict->info[0].id = stuff->pid;
-
- if (refDraw->type == XRT_WINDOW &&
- stuff->drawable == WindowTable[0]->drawable.id)
- {
- newPict->u.pict.root = TRUE;
- }
- else
- newPict->u.pict.root = FALSE;
-
- for(j = 1; j < PanoramiXNumScreens; j++)
- newPict->info[j].id = FakeClientID(client->index);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->pid = newPict->info[j].id;
- stuff->drawable = refDraw->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client);
- if(result != Success) break;
- }
-
- if (result == Success)
- AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
- else
- xfree(newPict);
-
- return (result);
-}
-
-static int
-PanoramiXRenderChangePicture (ClientPtr client)
-{
- PanoramiXRes *pict;
- int result = Success, j;
- REQUEST(xRenderChangePictureReq);
-
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
-
- VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->picture = pict->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-static int
-PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
-{
- REQUEST(xRenderSetPictureClipRectanglesReq);
- int result = Success, j;
- PanoramiXRes *pict;
-
- REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
-
- VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->picture = pict->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-static int
-PanoramiXRenderSetPictureTransform (ClientPtr client)
-{
- REQUEST(xRenderSetPictureTransformReq);
- int result = Success, j;
- PanoramiXRes *pict;
-
- REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq);
-
- VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->picture = pict->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-static int
-PanoramiXRenderSetPictureFilter (ClientPtr client)
-{
- REQUEST(xRenderSetPictureFilterReq);
- int result = Success, j;
- PanoramiXRes *pict;
-
- REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
-
- VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->picture = pict->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client);
- if(result != Success) break;
- }
-
- return (result);
-}
-
-static int
-PanoramiXRenderFreePicture (ClientPtr client)
-{
- PanoramiXRes *pict;
- int result = Success, j;
- REQUEST(xRenderFreePictureReq);
-
- REQUEST_SIZE_MATCH(xRenderFreePictureReq);
-
- client->errorValue = stuff->picture;
-
- VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess,
- RenderErrBase + BadPicture);
-
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->picture = pict->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client);
- if(result != Success) break;
- }
-
- /* Since ProcRenderFreePicture is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
- return (result);
-}
-
-static int
-PanoramiXRenderComposite (ClientPtr client)
-{
- PanoramiXRes *src, *msk, *dst;
- int result = Success, j;
- xRenderCompositeReq orig;
- REQUEST(xRenderCompositeReq);
-
- REQUEST_SIZE_MATCH(xRenderCompositeReq);
-
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- orig = *stuff;
-
- FOR_NSCREENS_FORWARD(j) {
- stuff->src = src->info[j].id;
- if (src->u.pict.root)
- {
- stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x;
- stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y;
- }
- stuff->dst = dst->info[j].id;
- if (dst->u.pict.root)
- {
- stuff->xDst = orig.xDst - panoramiXdataPtr[j].x;
- stuff->yDst = orig.yDst - panoramiXdataPtr[j].y;
- }
- if (msk)
- {
- stuff->mask = msk->info[j].id;
- if (msk->u.pict.root)
- {
- stuff->xMask = orig.xMask - panoramiXdataPtr[j].x;
- stuff->yMask = orig.yMask - panoramiXdataPtr[j].y;
- }
- }
- result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
- if(result != Success) break;
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderCompositeGlyphs (ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderCompositeGlyphsReq);
- xGlyphElt origElt, *elt;
- INT16 xSrc, ySrc;
-
- REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) +
- sizeof (xGlyphElt)))
- {
- elt = (xGlyphElt *) (stuff + 1);
- origElt = *elt;
- xSrc = stuff->xSrc;
- ySrc = stuff->ySrc;
- FOR_NSCREENS_FORWARD(j) {
- stuff->src = src->info[j].id;
- if (src->u.pict.root)
- {
- stuff->xSrc = xSrc - panoramiXdataPtr[j].x;
- stuff->ySrc = ySrc - panoramiXdataPtr[j].y;
- }
- stuff->dst = dst->info[j].id;
- if (dst->u.pict.root)
- {
- elt->deltax = origElt.deltax - panoramiXdataPtr[j].x;
- elt->deltay = origElt.deltay - panoramiXdataPtr[j].y;
- }
- result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
- if(result != Success) break;
- }
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderFillRectangles (ClientPtr client)
-{
- PanoramiXRes *dst;
- int result = Success, j;
- REQUEST(xRenderFillRectanglesReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
- extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len)))
- {
- memcpy (extra, stuff + 1, extra_len);
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root)
- {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xRectangle *rects = (xRectangle *) (stuff + 1);
- int i = extra_len / sizeof (xRectangle);
-
- while (i--)
- {
- rects->x -= x_off;
- rects->y -= y_off;
- rects++;
- }
- }
- }
- stuff->dst = dst->info[j].id;
- result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client);
- if(result != Success) break;
- }
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderTrapezoids(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderTrapezoidsReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq);
-
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xTrapezoid *trap = (xTrapezoid *) (stuff + 1);
- int i = extra_len / sizeof (xTrapezoid);
-
- while (i--) {
- trap->top -= y_off;
- trap->bottom -= y_off;
- trap->left.p1.x -= x_off;
- trap->left.p1.y -= y_off;
- trap->left.p2.x -= x_off;
- trap->left.p2.y -= y_off;
- trap->right.p1.x -= x_off;
- trap->right.p1.y -= y_off;
- trap->right.p2.x -= x_off;
- trap->right.p2.y -= y_off;
- trap++;
- }
- }
- }
-
- stuff->src = src->info[j].id;
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderTriangles(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderTrianglesReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq);
-
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xTriangle *tri = (xTriangle *) (stuff + 1);
- int i = extra_len / sizeof (xTriangle);
-
- while (i--) {
- tri->p1.x -= x_off;
- tri->p1.y -= y_off;
- tri->p2.x -= x_off;
- tri->p2.y -= y_off;
- tri->p3.x -= x_off;
- tri->p3.y -= y_off;
- tri++;
- }
- }
- }
-
- stuff->src = src->info[j].id;
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderTriStrip(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderTriStripReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderTriStripReq);
-
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xPointFixed *fixed = (xPointFixed *) (stuff + 1);
- int i = extra_len / sizeof (xPointFixed);
-
- while (i--) {
- fixed->x -= x_off;
- fixed->y -= y_off;
- fixed++;
- }
- }
- }
-
- stuff->src = src->info[j].id;
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderTriFan(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderTriFanReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderTriFanReq);
-
- VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess,
- RenderErrBase + BadPicture);
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- xPointFixed *fixed = (xPointFixed *) (stuff + 1);
- int i = extra_len / sizeof (xPointFixed);
-
- while (i--) {
- fixed->x -= x_off;
- fixed->y -= y_off;
- fixed++;
- }
- }
- }
-
- stuff->src = src->info[j].id;
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-#if 0 /* Not implemented yet */
-
-static int
-PanoramiXRenderColorTrapezoids(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderColorTrapezoidsReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq);
-
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- ....;
- }
- }
-
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderColorTrapezoids]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-static int
-PanoramiXRenderColorTriangles(ClientPtr client)
-{
- PanoramiXRes *src, *dst;
- int result = Success, j;
- REQUEST(xRenderColorTrianglesReq);
- char *extra;
- int extra_len;
-
- REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq);
-
- VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess,
- RenderErrBase + BadPicture);
-
- extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
-
- if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
- memcpy (extra, stuff + 1, extra_len);
-
- FOR_NSCREENS_FORWARD(j) {
- if (j) memcpy (stuff + 1, extra, extra_len);
- if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
-
- if(x_off || y_off) {
- ....;
- }
- }
-
- stuff->dst = dst->info[j].id;
- result =
- (*PanoramiXSaveRenderVector[X_RenderColorTriangles]) (client);
-
- if(result != Success) break;
- }
-
- DEALLOCATE_LOCAL(extra);
- }
-
- return result;
-}
-
-#endif
-
-void
-PanoramiXRenderInit (void)
-{
- int i;
-
- XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource);
- for (i = 0; i < RenderNumberRequests; i++)
- PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
- /*
- * Stuff in Xinerama aware request processing hooks
- */
- ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture;
- ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture;
- ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform;
- ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter;
- ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles;
- ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture;
- ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite;
- ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs;
- ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs;
- ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs;
- ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles;
-
- ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids;
- ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles;
- ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip;
- ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan;
-}
-
-void
-PanoramiXRenderReset (void)
-{
- int i;
- for (i = 0; i < RenderNumberRequests; i++)
- ProcRenderVector[i] = PanoramiXSaveRenderVector[i];
-}
-
-#endif /* PANORAMIX */
diff --git a/xkb/README.compiled b/xkb/README.compiled
deleted file mode 100644
index 71caa2f63..000000000
--- a/xkb/README.compiled
+++ /dev/null
@@ -1,13 +0,0 @@
-
-The X server uses this directory to store the compiled version of the
-current keymap and/or any scratch keymaps used by clients. The X server
-or some other tool might destroy or replace the files in this directory,
-so it is not a safe place to store compiled keymaps for long periods of
-time. The default keymap for any server is usually stored in:
- X<num>-default.xkm
-where <num> is the display number of the server in question, which makes
-it possible for several servers *on the same host* to share the same
-directory.
-
-Unless the X server is modified, sharing this directory between servers on
-different hosts could cause problems.
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
deleted file mode 100644
index 5bc7f65fc..000000000
--- a/xkb/XKBAlloc.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/* $Xorg: XKBAlloc.c,v 1.4 2000/08/17 19:44:59 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/lib/X11/XKBAlloc.c,v 3.6 2003/11/17 22:20:09 dawes Exp $ */
-
-#ifndef XKB_IN_SERVER
-
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xlibint.h"
-#include "XKBlibint.h"
-#include <X11/extensions/XKBgeom.h>
-#include <X11/extensions/XKBproto.h>
-#include "XKBlibint.h"
-
-#else
-
-#include <stdio.h>
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-#include "XKBgeom.h"
-
-#endif /* XKB_IN_SERVER */
-
-/***===================================================================***/
-
-/*ARGSUSED*/
-Status
-XkbAllocCompatMap(XkbDescPtr xkb,unsigned which,unsigned nSI)
-{
-XkbCompatMapPtr compat;
-XkbSymInterpretRec *prev_interpret;
-
- if (!xkb)
- return BadMatch;
- if (xkb->compat) {
- if (xkb->compat->size_si>=nSI)
- return Success;
- compat= xkb->compat;
- compat->size_si= nSI;
- if (compat->sym_interpret==NULL)
- compat->num_si= 0;
- prev_interpret = compat->sym_interpret;
- compat->sym_interpret= _XkbTypedRealloc(compat->sym_interpret,
- nSI,XkbSymInterpretRec);
- if (compat->sym_interpret==NULL) {
- _XkbFree(prev_interpret);
- compat->size_si= compat->num_si= 0;
- return BadAlloc;
- }
- if (compat->num_si!=0) {
- _XkbClearElems(compat->sym_interpret,compat->num_si,
- compat->size_si-1,XkbSymInterpretRec);
- }
- return Success;
- }
- compat= _XkbTypedCalloc(1,XkbCompatMapRec);
- if (compat==NULL)
- return BadAlloc;
- if (nSI>0) {
- compat->sym_interpret= _XkbTypedCalloc(nSI,XkbSymInterpretRec);
- if (!compat->sym_interpret) {
- _XkbFree(compat);
- return BadAlloc;
- }
- }
- compat->size_si= nSI;
- compat->num_si= 0;
- bzero((char *)&compat->groups[0],XkbNumKbdGroups*sizeof(XkbModsRec));
- xkb->compat= compat;
- return Success;
-}
-
-
-void
-XkbFreeCompatMap(XkbDescPtr xkb,unsigned which,Bool freeMap)
-{
-register XkbCompatMapPtr compat;
-
- if ((xkb==NULL)||(xkb->compat==NULL))
- return;
- compat= xkb->compat;
- if (freeMap)
- which= XkbAllCompatMask;
- if (which&XkbGroupCompatMask)
- bzero((char *)&compat->groups[0],XkbNumKbdGroups*sizeof(XkbModsRec));
- if (which&XkbSymInterpMask) {
- if ((compat->sym_interpret)&&(compat->size_si>0))
- _XkbFree(compat->sym_interpret);
- compat->size_si= compat->num_si= 0;
- compat->sym_interpret= NULL;
- }
- if (freeMap) {
- _XkbFree(compat);
- xkb->compat= NULL;
- }
- return;
-}
-
-/***===================================================================***/
-
-Status
-XkbAllocNames(XkbDescPtr xkb,unsigned which,int nTotalRG,int nTotalAliases)
-{
-XkbNamesPtr names;
-
- if (xkb==NULL)
- return BadMatch;
- if (xkb->names==NULL) {
- xkb->names = _XkbTypedCalloc(1,XkbNamesRec);
- if (xkb->names==NULL)
- return BadAlloc;
- }
- names= xkb->names;
- if ((which&XkbKTLevelNamesMask)&&(xkb->map!=NULL)&&(xkb->map->types!=NULL)){
- register int i;
- XkbKeyTypePtr type;
-
- type= xkb->map->types;
- for (i=0;i<xkb->map->num_types;i++,type++) {
- if (type->level_names==NULL) {
- type->level_names= _XkbTypedCalloc(type->num_levels,Atom);
- if (type->level_names==NULL)
- return BadAlloc;
- }
- }
- }
- if ((which&XkbKeyNamesMask)&&(names->keys==NULL)) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadValue;
- names->keys= _XkbTypedCalloc((xkb->max_key_code+1),XkbKeyNameRec);
- if (names->keys==NULL)
- return BadAlloc;
- }
- if ((which&XkbKeyAliasesMask)&&(nTotalAliases>0)) {
- if (names->key_aliases==NULL) {
- names->key_aliases= _XkbTypedCalloc(nTotalAliases,XkbKeyAliasRec);
- }
- else if (nTotalAliases>names->num_key_aliases) {
- XkbKeyAliasRec *prev_aliases = names->key_aliases;
-
- names->key_aliases= _XkbTypedRealloc(names->key_aliases,
- nTotalAliases,XkbKeyAliasRec);
- if (names->key_aliases!=NULL) {
- _XkbClearElems(names->key_aliases,names->num_key_aliases,
- nTotalAliases-1,XkbKeyAliasRec);
- } else {
- _XkbFree(prev_aliases);
- }
- }
- if (names->key_aliases==NULL) {
- names->num_key_aliases= 0;
- return BadAlloc;
- }
- names->num_key_aliases= nTotalAliases;
- }
- if ((which&XkbRGNamesMask)&&(nTotalRG>0)) {
- if (names->radio_groups==NULL) {
- names->radio_groups= _XkbTypedCalloc(nTotalRG,Atom);
- }
- else if (nTotalRG>names->num_rg) {
- Atom *prev_radio_groups = names->radio_groups;
-
- names->radio_groups= _XkbTypedRealloc(names->radio_groups,nTotalRG,
- Atom);
- if (names->radio_groups!=NULL) {
- _XkbClearElems(names->radio_groups,names->num_rg,nTotalRG-1,
- Atom);
- } else {
- _XkbFree(prev_radio_groups);
- }
- }
- if (names->radio_groups==NULL)
- return BadAlloc;
- names->num_rg= nTotalRG;
- }
- return Success;
-}
-
-void
-XkbFreeNames(XkbDescPtr xkb,unsigned which,Bool freeMap)
-{
-XkbNamesPtr names;
-
- if ((xkb==NULL)||(xkb->names==NULL))
- return;
- names= xkb->names;
- if (freeMap)
- which= XkbAllNamesMask;
- if (which&XkbKTLevelNamesMask) {
- XkbClientMapPtr map= xkb->map;
- if ((map!=NULL)&&(map->types!=NULL)) {
- register int i;
- register XkbKeyTypePtr type;
- type= map->types;
- for (i=0;i<map->num_types;i++,type++) {
- if (type->level_names!=NULL) {
- _XkbFree(type->level_names);
- type->level_names= NULL;
- }
- }
- }
- }
- if ((which&XkbKeyNamesMask)&&(names->keys!=NULL)) {
- _XkbFree(names->keys);
- names->keys= NULL;
- names->num_keys= 0;
- }
- if ((which&XkbKeyAliasesMask)&&(names->key_aliases)){
- _XkbFree(names->key_aliases);
- names->key_aliases=NULL;
- names->num_key_aliases=0;
- }
- if ((which&XkbRGNamesMask)&&(names->radio_groups)) {
- _XkbFree(names->radio_groups);
- names->radio_groups= NULL;
- names->num_rg= 0;
- }
- if (freeMap) {
- _XkbFree(names);
- xkb->names= NULL;
- }
- return;
-}
-
-/***===================================================================***/
-
-/*ARGSUSED*/
-Status
-XkbAllocControls(XkbDescPtr xkb,unsigned which)
-{
- if (xkb==NULL)
- return BadMatch;
-
- if (xkb->ctrls==NULL) {
- xkb->ctrls= _XkbTypedCalloc(1,XkbControlsRec);
- if (!xkb->ctrls)
- return BadAlloc;
- }
- return Success;
-}
-
-/*ARGSUSED*/
-void
-XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap)
-{
- if (freeMap && (xkb!=NULL) && (xkb->ctrls!=NULL)) {
- _XkbFree(xkb->ctrls);
- xkb->ctrls= NULL;
- }
- return;
-}
-
-/***===================================================================***/
-
-Status
-XkbAllocIndicatorMaps(XkbDescPtr xkb)
-{
- if (xkb==NULL)
- return BadMatch;
- if (xkb->indicators==NULL) {
- xkb->indicators= _XkbTypedCalloc(1,XkbIndicatorRec);
- if (!xkb->indicators)
- return BadAlloc;
- }
- return Success;
-}
-
-void
-XkbFreeIndicatorMaps(XkbDescPtr xkb)
-{
- if ((xkb!=NULL)&&(xkb->indicators!=NULL)) {
- _XkbFree(xkb->indicators);
- xkb->indicators= NULL;
- }
- return;
-}
-
-/***====================================================================***/
-
-XkbDescRec *
-XkbAllocKeyboard(void)
-{
-XkbDescRec *xkb;
-
- xkb = _XkbTypedCalloc(1,XkbDescRec);
- if (xkb)
- xkb->device_spec= XkbUseCoreKbd;
- return xkb;
-}
-
-void
-XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
-{
- if (xkb==NULL)
- return;
- if (freeAll)
- which= XkbAllComponentsMask;
- if (which&XkbClientMapMask)
- XkbFreeClientMap(xkb,XkbAllClientInfoMask,True);
- if (which&XkbServerMapMask)
- XkbFreeServerMap(xkb,XkbAllServerInfoMask,True);
- if (which&XkbCompatMapMask)
- XkbFreeCompatMap(xkb,XkbAllCompatMask,True);
- if (which&XkbIndicatorMapMask)
- XkbFreeIndicatorMaps(xkb);
- if (which&XkbNamesMask)
- XkbFreeNames(xkb,XkbAllNamesMask,True);
- if ((which&XkbGeometryMask) && (xkb->geom!=NULL))
- XkbFreeGeometry(xkb->geom,XkbGeomAllMask,True);
- if (which&XkbControlsMask)
- XkbFreeControls(xkb,XkbAllControlsMask,True);
- if (freeAll)
- _XkbFree(xkb);
- return;
-}
-
-/***====================================================================***/
-
-XkbDeviceLedInfoPtr
-XkbAddDeviceLedInfo(XkbDeviceInfoPtr devi,unsigned ledClass,unsigned ledId)
-{
-XkbDeviceLedInfoPtr devli;
-register int i;
-
- if ((!devi)||(!XkbSingleXIClass(ledClass))||(!XkbSingleXIId(ledId)))
- return NULL;
- for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
- if ((devli->led_class==ledClass)&&(devli->led_id==ledId))
- return devli;
- }
- if (devi->num_leds>=devi->sz_leds) {
- XkbDeviceLedInfoRec *prev_leds = devi->leds;
-
- if (devi->sz_leds>0) devi->sz_leds*= 2;
- else devi->sz_leds= 1;
- devi->leds= _XkbTypedRealloc(devi->leds,devi->sz_leds,
- XkbDeviceLedInfoRec);
- if (!devi->leds) {
- _XkbFree(prev_leds);
- devi->sz_leds= devi->num_leds= 0;
- return NULL;
- }
- i= devi->num_leds;
- for (devli=&devi->leds[i];i<devi->sz_leds;i++,devli++) {
- bzero(devli,sizeof(XkbDeviceLedInfoRec));
- devli->led_class= XkbXINone;
- devli->led_id= XkbXINone;
- }
- }
- devli= &devi->leds[devi->num_leds++];
- bzero(devli,sizeof(XkbDeviceLedInfoRec));
- devli->led_class= ledClass;
- devli->led_id= ledId;
- return devli;
-}
-
-Status
-XkbResizeDeviceButtonActions(XkbDeviceInfoPtr devi,unsigned newTotal)
-{
- XkbAction *prev_btn_acts;
-
- if ((!devi)||(newTotal>255))
- return BadValue;
- if ((devi->btn_acts!=NULL)&&(newTotal==devi->num_btns))
- return Success;
- if (newTotal==0) {
- if (devi->btn_acts!=NULL) {
- _XkbFree(devi->btn_acts);
- devi->btn_acts= NULL;
- }
- devi->num_btns= 0;
- return Success;
- }
- prev_btn_acts = devi->btn_acts;
- devi->btn_acts= _XkbTypedRealloc(devi->btn_acts,newTotal,XkbAction);
- if (devi->btn_acts==NULL) {
- _XkbFree(prev_btn_acts);
- devi->num_btns= 0;
- return BadAlloc;
- }
- if (newTotal>devi->num_btns) {
- XkbAction *act;
- act= &devi->btn_acts[devi->num_btns];
- bzero((char *)act,(newTotal-devi->num_btns)*sizeof(XkbAction));
- }
- devi->num_btns= newTotal;
- return Success;
-}
-
-/*ARGSUSED*/
-XkbDeviceInfoPtr
-XkbAllocDeviceInfo(unsigned deviceSpec,unsigned nButtons,unsigned szLeds)
-{
-XkbDeviceInfoPtr devi;
-
- devi= _XkbTypedCalloc(1,XkbDeviceInfoRec);
- if (devi!=NULL) {
- devi->device_spec= deviceSpec;
- devi->has_own_state= False;
- devi->num_btns= 0;
- devi->btn_acts= NULL;
- if (nButtons>0) {
- devi->num_btns= nButtons;
- devi->btn_acts= _XkbTypedCalloc(nButtons,XkbAction);
- if (!devi->btn_acts) {
- _XkbFree(devi);
- return NULL;
- }
- }
- devi->dflt_kbd_fb= XkbXINone;
- devi->dflt_led_fb= XkbXINone;
- devi->num_leds= 0;
- devi->sz_leds= 0;
- devi->leds= NULL;
- if (szLeds>0) {
- devi->sz_leds= szLeds;
- devi->leds= _XkbTypedCalloc(szLeds,XkbDeviceLedInfoRec);
- if (!devi->leds) {
- if (devi->btn_acts)
- _XkbFree(devi->btn_acts);
- _XkbFree(devi);
- return NULL;
- }
- }
- }
- return devi;
-}
-
-
-void
-XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI)
-{
- if (devi) {
- if (freeDevI) {
- which= XkbXI_AllDeviceFeaturesMask;
- if (devi->name) {
- _XkbFree(devi->name);
- devi->name= NULL;
- }
- }
- if ((which&XkbXI_ButtonActionsMask)&&(devi->btn_acts)) {
- _XkbFree(devi->btn_acts);
- devi->num_btns= 0;
- devi->btn_acts= NULL;
- }
- if ((which&XkbXI_IndicatorsMask)&&(devi->leds)) {
- register int i;
- if ((which&XkbXI_IndicatorsMask)==XkbXI_IndicatorsMask) {
- _XkbFree(devi->leds);
- devi->sz_leds= devi->num_leds= 0;
- devi->leds= NULL;
- }
- else {
- XkbDeviceLedInfoPtr devli;
- for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
- if (which&XkbXI_IndicatorMapsMask)
- bzero((char *)&devli->maps[0],sizeof(devli->maps));
- else bzero((char *)&devli->names[0],sizeof(devli->names));
- }
- }
- }
- if (freeDevI)
- _XkbFree(devi);
- }
- return;
-}
diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
deleted file mode 100644
index 209631e72..000000000
--- a/xkb/XKBGAlloc.c
+++ /dev/null
@@ -1,1015 +0,0 @@
-/* $Xorg: XKBGAlloc.c,v 1.3 2000/08/17 19:45:01 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/lib/X11/XKBGAlloc.c,v 3.5 2003/11/17 22:20:09 dawes Exp $ */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#ifndef XKB_IN_SERVER
-
-#include <stdio.h>
-#include "Xlibint.h"
-#include "XKBlibint.h"
-#include <X11/extensions/XKBgeom.h>
-#include <X11/extensions/XKBproto.h>
-
-#else
-
-#include <stdio.h>
-#include "X.h"
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-#include "XKBgeom.h"
-
-#endif /* XKB_IN_SERVER */
-
-#ifdef X_NOT_POSIX
-#define Size_t unsigned int
-#else
-#define Size_t size_t
-#endif
-
-/***====================================================================***/
-
-static void
-_XkbFreeGeomLeafElems( Bool freeAll,
- int first,
- int count,
- unsigned short * num_inout,
- unsigned short * sz_inout,
- char ** elems,
- unsigned int elem_sz)
-{
- if ((freeAll)||(*elems==NULL)) {
- *num_inout= *sz_inout= 0;
- if (*elems!=NULL) {
- _XkbFree(*elems);
- *elems= NULL;
- }
- return;
- }
-
- if ((first>=(*num_inout))||(first<0)||(count<1))
- return;
-
- if (first+count>=(*num_inout)) {
- /* truncating the array is easy */
- (*num_inout)= first;
- }
- else {
- char * ptr;
- int extra;
- ptr= *elems;
- extra= ((*num_inout)-(first+count))*elem_sz;
- if (extra>0)
- memmove(&ptr[first*elem_sz],&ptr[(first+count)*elem_sz],extra);
- (*num_inout)-= count;
- }
- return;
-}
-
-typedef void (*ContentsClearFunc)(
- char * /* priv */
-);
-
-static void
-_XkbFreeGeomNonLeafElems( Bool freeAll,
- int first,
- int count,
- unsigned short * num_inout,
- unsigned short * sz_inout,
- char ** elems,
- unsigned int elem_sz,
- ContentsClearFunc freeFunc)
-{
-register int i;
-register char *ptr;
-
- if (freeAll) {
- first= 0;
- count= (*num_inout);
- }
- else if ((first>=(*num_inout))||(first<0)||(count<1))
- return;
- else if (first+count>(*num_inout))
- count= (*num_inout)-first;
- if (*elems==NULL)
- return;
-
- if (freeFunc) {
- ptr= *elems;
- ptr+= first*elem_sz;
- for (i=0;i<count;i++) {
- (*freeFunc)(ptr);
- ptr+= elem_sz;
- }
- }
- if (freeAll) {
- (*num_inout)= (*sz_inout)= 0;
- if (*elems) {
- _XkbFree(*elems);
- *elems= NULL;
- }
- }
- else if (first+count>=(*num_inout))
- *num_inout= first;
- else {
- i= ((*num_inout)-(first+count))*elem_sz;
- ptr= *elems;
- memmove(&ptr[first*elem_sz],&ptr[(first+count)*elem_sz],i);
- (*num_inout)-= count;
- }
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearProperty(char *prop_in)
-{
-XkbPropertyPtr prop= (XkbPropertyPtr)prop_in;
-
- if (prop->name) {
- _XkbFree(prop->name);
- prop->name= NULL;
- }
- if (prop->value) {
- _XkbFree(prop->value);
- prop->value= NULL;
- }
- return;
-}
-
-void
-XkbFreeGeomProperties( XkbGeometryPtr geom,
- int first,
- int count,
- Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &geom->num_properties,&geom->sz_properties,
- (char **)&geom->properties,
- sizeof(XkbPropertyRec),_XkbClearProperty);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbFreeGeomKeyAliases( XkbGeometryPtr geom,
- int first,
- int count,
- Bool freeAll)
-{
- _XkbFreeGeomLeafElems(freeAll,first,count,
- &geom->num_key_aliases,&geom->sz_key_aliases,
- (char **)&geom->key_aliases,
- sizeof(XkbKeyAliasRec));
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearColor(char *color_in)
-{
-XkbColorPtr color= (XkbColorPtr)color_in;
-
- if (color->spec)
- _XkbFree(color->spec);
- return;
-}
-
-void
-XkbFreeGeomColors(XkbGeometryPtr geom,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &geom->num_colors,&geom->sz_colors,
- (char **)&geom->colors,
- sizeof(XkbColorRec),_XkbClearColor);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbFreeGeomPoints(XkbOutlinePtr outline,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomLeafElems(freeAll,first,count,
- &outline->num_points,&outline->sz_points,
- (char **)&outline->points,
- sizeof(XkbPointRec));
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearOutline(char *outline_in)
-{
-XkbOutlinePtr outline= (XkbOutlinePtr)outline_in;
-
- if (outline->points!=NULL)
- XkbFreeGeomPoints(outline,0,outline->num_points,True);
- return;
-}
-
-void
-XkbFreeGeomOutlines(XkbShapePtr shape,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &shape->num_outlines,&shape->sz_outlines,
- (char **)&shape->outlines,
- sizeof(XkbOutlineRec),_XkbClearOutline);
-
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearShape(char *shape_in)
-{
-XkbShapePtr shape= (XkbShapePtr)shape_in;
-
- if (shape->outlines)
- XkbFreeGeomOutlines(shape,0,shape->num_outlines,True);
- return;
-}
-
-void
-XkbFreeGeomShapes(XkbGeometryPtr geom,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &geom->num_shapes,&geom->sz_shapes,
- (char **)&geom->shapes,
- sizeof(XkbShapeRec),_XkbClearShape);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomLeafElems(freeAll,first,count,
- &row->num_keys,&row->sz_keys,
- (char **)&row->keys,
- sizeof(XkbOverlayKeyRec));
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearOverlayRow(char *row_in)
-{
-XkbOverlayRowPtr row= (XkbOverlayRowPtr)row_in;
-
- if (row->keys!=NULL)
- XkbFreeGeomOverlayKeys(row,0,row->num_keys,True);
- return;
-}
-
-void
-XkbFreeGeomOverlayRows(XkbOverlayPtr overlay,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &overlay->num_rows,&overlay->sz_rows,
- (char **)&overlay->rows,
- sizeof(XkbOverlayRowRec),_XkbClearOverlayRow);
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearOverlay(char *overlay_in)
-{
-XkbOverlayPtr overlay= (XkbOverlayPtr)overlay_in;
-
- if (overlay->rows!=NULL)
- XkbFreeGeomOverlayRows(overlay,0,overlay->num_rows,True);
- return;
-}
-
-void
-XkbFreeGeomOverlays(XkbSectionPtr section,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &section->num_overlays,&section->sz_overlays,
- (char **)&section->overlays,
- sizeof(XkbOverlayRec),_XkbClearOverlay);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbFreeGeomKeys(XkbRowPtr row,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomLeafElems(freeAll,first,count,
- &row->num_keys,&row->sz_keys,
- (char **)&row->keys,
- sizeof(XkbKeyRec));
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearRow(char *row_in)
-{
-XkbRowPtr row= (XkbRowPtr)row_in;
-
- if (row->keys!=NULL)
- XkbFreeGeomKeys(row,0,row->num_keys,True);
- return;
-}
-
-void
-XkbFreeGeomRows(XkbSectionPtr section,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &section->num_rows,&section->sz_rows,
- (char **)&section->rows,
- sizeof(XkbRowRec),_XkbClearRow);
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearSection(char *section_in)
-{
-XkbSectionPtr section= (XkbSectionPtr)section_in;
-
- if (section->rows!=NULL)
- XkbFreeGeomRows(section,0,section->num_rows,True);
- if (section->doodads!=NULL) {
- XkbFreeGeomDoodads(section->doodads,section->num_doodads,True);
- section->doodads= NULL;
- }
- return;
-}
-
-void
-XkbFreeGeomSections(XkbGeometryPtr geom,int first,int count,Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll,first,count,
- &geom->num_sections,&geom->sz_sections,
- (char **)&geom->sections,
- sizeof(XkbSectionRec),_XkbClearSection);
- return;
-}
-
-/***====================================================================***/
-
-static void
-_XkbClearDoodad(char *doodad_in)
-{
-XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in;
-
- switch (doodad->any.type) {
- case XkbTextDoodad:
- {
- if (doodad->text.text!=NULL) {
- _XkbFree(doodad->text.text);
- doodad->text.text= NULL;
- }
- if (doodad->text.font!=NULL) {
- _XkbFree(doodad->text.font);
- doodad->text.font= NULL;
- }
- }
- break;
- case XkbLogoDoodad:
- {
- if (doodad->logo.logo_name!=NULL) {
- _XkbFree(doodad->logo.logo_name);
- doodad->logo.logo_name= NULL;
- }
- }
- break;
- }
- return;
-}
-
-void
-XkbFreeGeomDoodads(XkbDoodadPtr doodads,int nDoodads,Bool freeAll)
-{
-register int i;
-register XkbDoodadPtr doodad;
-
- if (doodads) {
- for (i=0,doodad= doodads;i<nDoodads;i++,doodad++) {
- _XkbClearDoodad((char *)doodad);
- }
- if (freeAll)
- _XkbFree(doodads);
- }
- return;
-}
-
-void
-XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap)
-{
- if (geom==NULL)
- return;
- if (freeMap)
- which= XkbGeomAllMask;
- if ((which&XkbGeomPropertiesMask)&&(geom->properties!=NULL))
- XkbFreeGeomProperties(geom,0,geom->num_properties,True);
- if ((which&XkbGeomColorsMask)&&(geom->colors!=NULL))
- XkbFreeGeomColors(geom,0,geom->num_colors,True);
- if ((which&XkbGeomShapesMask)&&(geom->shapes!=NULL))
- XkbFreeGeomShapes(geom,0,geom->num_shapes,True);
- if ((which&XkbGeomSectionsMask)&&(geom->sections!=NULL))
- XkbFreeGeomSections(geom,0,geom->num_sections,True);
- if ((which&XkbGeomDoodadsMask)&&(geom->doodads!= NULL)) {
- XkbFreeGeomDoodads(geom->doodads,geom->num_doodads,True);
- geom->doodads= NULL;
- geom->num_doodads= geom->sz_doodads= 0;
- }
- if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL))
- XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,True);
- if (freeMap) {
- if (geom->label_font!=NULL) {
- _XkbFree(geom->label_font);
- geom->label_font= NULL;
- }
- _XkbFree(geom);
- }
- return;
-}
-
-/***====================================================================***/
-
-static Status
-_XkbGeomAlloc( XPointer * old,
- unsigned short * num,
- unsigned short * total,
- int num_new,
- Size_t sz_elem)
-{
- if (num_new<1)
- return Success;
- if ((*old)==NULL)
- *num= *total= 0;
-
- if ((*num)+num_new<=(*total))
- return Success;
-
- *total= (*num)+num_new;
- if ((*old)!=NULL)
- (*old)= (XPointer)_XkbRealloc((*old),(*total)*sz_elem);
- else (*old)= (XPointer)_XkbCalloc((*total),sz_elem);
- if ((*old)==NULL) {
- *total= *num= 0;
- return BadAlloc;
- }
-
- if (*num>0) {
- char *tmp= (char *)(*old);
- bzero(&tmp[sz_elem*(*num)],(num_new*sz_elem));
- }
- return Success;
-}
-
-#define _XkbAllocProps(g,n) _XkbGeomAlloc((XPointer *)&(g)->properties,\
- &(g)->num_properties,&(g)->sz_properties,\
- (n),sizeof(XkbPropertyRec))
-#define _XkbAllocColors(g,n) _XkbGeomAlloc((XPointer *)&(g)->colors,\
- &(g)->num_colors,&(g)->sz_colors,\
- (n),sizeof(XkbColorRec))
-#define _XkbAllocShapes(g,n) _XkbGeomAlloc((XPointer *)&(g)->shapes,\
- &(g)->num_shapes,&(g)->sz_shapes,\
- (n),sizeof(XkbShapeRec))
-#define _XkbAllocSections(g,n) _XkbGeomAlloc((XPointer *)&(g)->sections,\
- &(g)->num_sections,&(g)->sz_sections,\
- (n),sizeof(XkbSectionRec))
-#define _XkbAllocDoodads(g,n) _XkbGeomAlloc((XPointer *)&(g)->doodads,\
- &(g)->num_doodads,&(g)->sz_doodads,\
- (n),sizeof(XkbDoodadRec))
-#define _XkbAllocKeyAliases(g,n) _XkbGeomAlloc((XPointer *)&(g)->key_aliases,\
- &(g)->num_key_aliases,&(g)->sz_key_aliases,\
- (n),sizeof(XkbKeyAliasRec))
-
-#define _XkbAllocOutlines(s,n) _XkbGeomAlloc((XPointer *)&(s)->outlines,\
- &(s)->num_outlines,&(s)->sz_outlines,\
- (n),sizeof(XkbOutlineRec))
-#define _XkbAllocRows(s,n) _XkbGeomAlloc((XPointer *)&(s)->rows,\
- &(s)->num_rows,&(s)->sz_rows,\
- (n),sizeof(XkbRowRec))
-#define _XkbAllocPoints(o,n) _XkbGeomAlloc((XPointer *)&(o)->points,\
- &(o)->num_points,&(o)->sz_points,\
- (n),sizeof(XkbPointRec))
-#define _XkbAllocKeys(r,n) _XkbGeomAlloc((XPointer *)&(r)->keys,\
- &(r)->num_keys,&(r)->sz_keys,\
- (n),sizeof(XkbKeyRec))
-#define _XkbAllocOverlays(s,n) _XkbGeomAlloc((XPointer *)&(s)->overlays,\
- &(s)->num_overlays,&(s)->sz_overlays,\
- (n),sizeof(XkbOverlayRec))
-#define _XkbAllocOverlayRows(o,n) _XkbGeomAlloc((XPointer *)&(o)->rows,\
- &(o)->num_rows,&(o)->sz_rows,\
- (n),sizeof(XkbOverlayRowRec))
-#define _XkbAllocOverlayKeys(r,n) _XkbGeomAlloc((XPointer *)&(r)->keys,\
- &(r)->num_keys,&(r)->sz_keys,\
- (n),sizeof(XkbOverlayKeyRec))
-
-Status
-XkbAllocGeomProps(XkbGeometryPtr geom,int nProps)
-{
- return _XkbAllocProps(geom,nProps);
-}
-
-Status
-XkbAllocGeomColors(XkbGeometryPtr geom,int nColors)
-{
- return _XkbAllocColors(geom,nColors);
-}
-
-Status
-XkbAllocGeomKeyAliases(XkbGeometryPtr geom,int nKeyAliases)
-{
- return _XkbAllocKeyAliases(geom,nKeyAliases);
-}
-
-Status
-XkbAllocGeomShapes(XkbGeometryPtr geom,int nShapes)
-{
- return _XkbAllocShapes(geom,nShapes);
-}
-
-Status
-XkbAllocGeomSections(XkbGeometryPtr geom,int nSections)
-{
- return _XkbAllocSections(geom,nSections);
-}
-
-Status
-XkbAllocGeomOverlays(XkbSectionPtr section,int nOverlays)
-{
- return _XkbAllocOverlays(section,nOverlays);
-}
-
-Status
-XkbAllocGeomOverlayRows(XkbOverlayPtr overlay,int nRows)
-{
- return _XkbAllocOverlayRows(overlay,nRows);
-}
-
-Status
-XkbAllocGeomOverlayKeys(XkbOverlayRowPtr row,int nKeys)
-{
- return _XkbAllocOverlayKeys(row,nKeys);
-}
-
-Status
-XkbAllocGeomDoodads(XkbGeometryPtr geom,int nDoodads)
-{
- return _XkbAllocDoodads(geom,nDoodads);
-}
-
-Status
-XkbAllocGeomSectionDoodads(XkbSectionPtr section,int nDoodads)
-{
- return _XkbAllocDoodads(section,nDoodads);
-}
-
-Status
-XkbAllocGeomOutlines(XkbShapePtr shape,int nOL)
-{
- return _XkbAllocOutlines(shape,nOL);
-}
-
-Status
-XkbAllocGeomRows(XkbSectionPtr section,int nRows)
-{
- return _XkbAllocRows(section,nRows);
-}
-
-Status
-XkbAllocGeomPoints(XkbOutlinePtr ol,int nPts)
-{
- return _XkbAllocPoints(ol,nPts);
-}
-
-Status
-XkbAllocGeomKeys(XkbRowPtr row,int nKeys)
-{
- return _XkbAllocKeys(row,nKeys);
-}
-
-Status
-XkbAllocGeometry(XkbDescPtr xkb,XkbGeometrySizesPtr sizes)
-{
-XkbGeometryPtr geom;
-Status rtrn;
-
- if (xkb->geom==NULL) {
- xkb->geom= _XkbTypedCalloc(1,XkbGeometryRec);
- if (!xkb->geom)
- return BadAlloc;
- }
- geom= xkb->geom;
- if ((sizes->which&XkbGeomPropertiesMask)&&
- ((rtrn=_XkbAllocProps(geom,sizes->num_properties))!=Success)) {
- goto BAIL;
- }
- if ((sizes->which&XkbGeomColorsMask)&&
- ((rtrn=_XkbAllocColors(geom,sizes->num_colors))!=Success)) {
- goto BAIL;
- }
- if ((sizes->which&XkbGeomShapesMask)&&
- ((rtrn=_XkbAllocShapes(geom,sizes->num_shapes))!=Success)) {
- goto BAIL;
- }
- if ((sizes->which&XkbGeomSectionsMask)&&
- ((rtrn=_XkbAllocSections(geom,sizes->num_sections))!=Success)) {
- goto BAIL;
- }
- if ((sizes->which&XkbGeomDoodadsMask)&&
- ((rtrn=_XkbAllocDoodads(geom,sizes->num_doodads))!=Success)) {
- goto BAIL;
- }
- if ((sizes->which&XkbGeomKeyAliasesMask)&&
- ((rtrn=_XkbAllocKeyAliases(geom,sizes->num_key_aliases))!=Success)) {
- goto BAIL;
- }
- return Success;
-BAIL:
- XkbFreeGeometry(geom,XkbGeomAllMask,True);
- xkb->geom= NULL;
- return rtrn;
-}
-
-/***====================================================================***/
-
-XkbPropertyPtr
-XkbAddGeomProperty(XkbGeometryPtr geom,char *name,char *value)
-{
-register int i;
-register XkbPropertyPtr prop;
-
- if ((!geom)||(!name)||(!value))
- return NULL;
- for (i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
- if ((prop->name)&&(strcmp(name,prop->name)==0)) {
- if (prop->value)
- _XkbFree(prop->value);
- prop->value= (char *)_XkbAlloc(strlen(value)+1);
- if (prop->value)
- strcpy(prop->value,value);
- return prop;
- }
- }
- if ((geom->num_properties>=geom->sz_properties)&&
- (_XkbAllocProps(geom,1)!=Success)) {
- return NULL;
- }
- prop= &geom->properties[geom->num_properties];
- prop->name= (char *)_XkbAlloc(strlen(name)+1);
- if (!name)
- return NULL;
- strcpy(prop->name,name);
- prop->value= (char *)_XkbAlloc(strlen(value)+1);
- if (!value) {
- _XkbFree(prop->name);
- prop->name= NULL;
- return NULL;
- }
- strcpy(prop->value,value);
- geom->num_properties++;
- return prop;
-}
-
-XkbKeyAliasPtr
-XkbAddGeomKeyAlias(XkbGeometryPtr geom,char *aliasStr,char *realStr)
-{
-register int i;
-register XkbKeyAliasPtr alias;
-
- if ((!geom)||(!aliasStr)||(!realStr)||(!aliasStr[0])||(!realStr[0]))
- return NULL;
- for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) {
- if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) {
- bzero(alias->real,XkbKeyNameLength);
- strncpy(alias->real,realStr,XkbKeyNameLength);
- return alias;
- }
- }
- if ((geom->num_key_aliases>=geom->sz_key_aliases)&&
- (_XkbAllocKeyAliases(geom,1)!=Success)) {
- return NULL;
- }
- alias= &geom->key_aliases[geom->num_key_aliases];
- bzero(alias,sizeof(XkbKeyAliasRec));
- strncpy(alias->alias,aliasStr,XkbKeyNameLength);
- strncpy(alias->real,realStr,XkbKeyNameLength);
- geom->num_key_aliases++;
- return alias;
-}
-
-XkbColorPtr
-XkbAddGeomColor(XkbGeometryPtr geom,char *spec,unsigned int pixel)
-{
-register int i;
-register XkbColorPtr color;
-
- if ((!geom)||(!spec))
- return NULL;
- for (i=0,color=geom->colors;i<geom->num_colors;i++,color++) {
- if ((color->spec)&&(strcmp(color->spec,spec)==0)) {
- color->pixel= pixel;
- return color;
- }
- }
- if ((geom->num_colors>=geom->sz_colors)&&
- (_XkbAllocColors(geom,1)!=Success)) {
- return NULL;
- }
- color= &geom->colors[geom->num_colors];
- color->pixel= pixel;
- color->spec= (char *)_XkbAlloc(strlen(spec)+1);
- if (!color->spec)
- return NULL;
- strcpy(color->spec,spec);
- geom->num_colors++;
- return color;
-}
-
-XkbOutlinePtr
-XkbAddGeomOutline(XkbShapePtr shape,int sz_points)
-{
-XkbOutlinePtr outline;
-
- if ((!shape)||(sz_points<0))
- return NULL;
- if ((shape->num_outlines>=shape->sz_outlines)&&
- (_XkbAllocOutlines(shape,1)!=Success)) {
- return NULL;
- }
- outline= &shape->outlines[shape->num_outlines];
- bzero(outline,sizeof(XkbOutlineRec));
- if ((sz_points>0)&&(_XkbAllocPoints(outline,sz_points)!=Success))
- return NULL;
- shape->num_outlines++;
- return outline;
-}
-
-XkbShapePtr
-XkbAddGeomShape(XkbGeometryPtr geom,Atom name,int sz_outlines)
-{
-XkbShapePtr shape;
-register int i;
-
- if ((!geom)||(!name)||(sz_outlines<0))
- return NULL;
- if (geom->num_shapes>0) {
- for (shape=geom->shapes,i=0;i<geom->num_shapes;i++,shape++) {
- if (name==shape->name)
- return shape;
- }
- }
- if ((geom->num_shapes>=geom->sz_shapes)&&
- (_XkbAllocShapes(geom,1)!=Success))
- return NULL;
- shape= &geom->shapes[geom->num_shapes];
- bzero(shape,sizeof(XkbShapeRec));
- if ((sz_outlines>0)&&(_XkbAllocOutlines(shape,sz_outlines)!=Success))
- return NULL;
- shape->name= name;
- shape->primary= shape->approx= NULL;
- geom->num_shapes++;
- return shape;
-}
-
-XkbKeyPtr
-XkbAddGeomKey(XkbRowPtr row)
-{
-XkbKeyPtr key;
- if (!row)
- return NULL;
- if ((row->num_keys>=row->sz_keys)&&(_XkbAllocKeys(row,1)!=Success))
- return NULL;
- key= &row->keys[row->num_keys++];
- bzero(key,sizeof(XkbKeyRec));
- return key;
-}
-
-XkbRowPtr
-XkbAddGeomRow(XkbSectionPtr section,int sz_keys)
-{
-XkbRowPtr row;
-
- if ((!section)||(sz_keys<0))
- return NULL;
- if ((section->num_rows>=section->sz_rows)&&
- (_XkbAllocRows(section,1)!=Success))
- return NULL;
- row= &section->rows[section->num_rows];
- bzero(row,sizeof(XkbRowRec));
- if ((sz_keys>0)&&(_XkbAllocKeys(row,sz_keys)!=Success))
- return NULL;
- section->num_rows++;
- return row;
-}
-
-XkbSectionPtr
-XkbAddGeomSection( XkbGeometryPtr geom,
- Atom name,
- int sz_rows,
- int sz_doodads,
- int sz_over)
-{
-register int i;
-XkbSectionPtr section;
-
- if ((!geom)||(name==None)||(sz_rows<0))
- return NULL;
- for (i=0,section=geom->sections;i<geom->num_sections;i++,section++) {
- if (section->name!=name)
- continue;
- if (((sz_rows>0)&&(_XkbAllocRows(section,sz_rows)!=Success))||
- ((sz_doodads>0)&&(_XkbAllocDoodads(section,sz_doodads)!=Success))||
- ((sz_over>0)&&(_XkbAllocOverlays(section,sz_over)!=Success)))
- return NULL;
- return section;
- }
- if ((geom->num_sections>=geom->sz_sections)&&
- (_XkbAllocSections(geom,1)!=Success))
- return NULL;
- section= &geom->sections[geom->num_sections];
- if ((sz_rows>0)&&(_XkbAllocRows(section,sz_rows)!=Success))
- return NULL;
- if ((sz_doodads>0)&&(_XkbAllocDoodads(section,sz_doodads)!=Success)) {
- if (section->rows) {
- _XkbFree(section->rows);
- section->rows= NULL;
- section->sz_rows= section->num_rows= 0;
- }
- return NULL;
- }
- section->name= name;
- geom->num_sections++;
- return section;
-}
-
-XkbDoodadPtr
-XkbAddGeomDoodad(XkbGeometryPtr geom,XkbSectionPtr section,Atom name)
-{
-XkbDoodadPtr old,doodad;
-register int i,nDoodads;
-
- if ((!geom)||(name==None))
- return NULL;
- if ((section!=NULL)&&(section->num_doodads>0)) {
- old= section->doodads;
- nDoodads= section->num_doodads;
- }
- else {
- old= geom->doodads;
- nDoodads= geom->num_doodads;
- }
- for (i=0,doodad=old;i<nDoodads;i++,doodad++) {
- if (doodad->any.name==name)
- return doodad;
- }
- if (section) {
- if ((section->num_doodads>=geom->sz_doodads)&&
- (_XkbAllocDoodads(section,1)!=Success)) {
- return NULL;
- }
- doodad= &section->doodads[section->num_doodads++];
- }
- else {
- if ((geom->num_doodads>=geom->sz_doodads)&&
- (_XkbAllocDoodads(geom,1)!=Success))
- return NULL;
- doodad= &geom->doodads[geom->num_doodads++];
- }
- bzero(doodad,sizeof(XkbDoodadRec));
- doodad->any.name= name;
- return doodad;
-}
-
-XkbOverlayKeyPtr
-XkbAddGeomOverlayKey( XkbOverlayPtr overlay,
- XkbOverlayRowPtr row,
- char * over,
- char * under)
-{
-register int i;
-XkbOverlayKeyPtr key;
-XkbSectionPtr section;
-XkbRowPtr row_under;
-Bool found;
-
- if ((!overlay)||(!row)||(!over)||(!under))
- return NULL;
- section= overlay->section_under;
- if (row->row_under>=section->num_rows)
- return NULL;
- row_under= &section->rows[row->row_under];
- for (i=0,found=False;i<row_under->num_keys;i++) {
- if (strncmp(under,row_under->keys[i].name.name,XkbKeyNameLength)==0) {
- found= True;
- break;
- }
- }
- if (!found)
- return NULL;
- if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
- return NULL;
- key= &row->keys[row->num_keys];
- strncpy(key->under.name,under,XkbKeyNameLength);
- strncpy(key->over.name,over,XkbKeyNameLength);
- row->num_keys++;
- return key;
-}
-
-XkbOverlayRowPtr
-XkbAddGeomOverlayRow(XkbOverlayPtr overlay,int row_under,int sz_keys)
-{
-register int i;
-XkbOverlayRowPtr row;
-
- if ((!overlay)||(sz_keys<0))
- return NULL;
- if (row_under>=overlay->section_under->num_rows)
- return NULL;
- for (i=0;i<overlay->num_rows;i++) {
- if (overlay->rows[i].row_under==row_under) {
- row= &overlay->rows[i];
- if ((row->sz_keys<sz_keys)&&
- (_XkbAllocOverlayKeys(row,sz_keys)!=Success)) {
- return NULL;
- }
- return &overlay->rows[i];
- }
- }
- if ((overlay->num_rows>=overlay->sz_rows)&&
- (_XkbAllocOverlayRows(overlay,1)!=Success))
- return NULL;
- row= &overlay->rows[overlay->num_rows];
- bzero(row,sizeof(XkbOverlayRowRec));
- if ((sz_keys>0)&&(_XkbAllocOverlayKeys(row,sz_keys)!=Success))
- return NULL;
- row->row_under= row_under;
- overlay->num_rows++;
- return row;
-}
-
-XkbOverlayPtr
-XkbAddGeomOverlay(XkbSectionPtr section,Atom name,int sz_rows)
-{
-register int i;
-XkbOverlayPtr overlay;
-
- if ((!section)||(name==None)||(sz_rows==0))
- return NULL;
-
- for (i=0,overlay=section->overlays;i<section->num_overlays;i++,overlay++) {
- if (overlay->name==name) {
- if ((sz_rows>0)&&(_XkbAllocOverlayRows(overlay,sz_rows)!=Success))
- return NULL;
- return overlay;
- }
- }
- if ((section->num_overlays>=section->sz_overlays)&&
- (_XkbAllocOverlays(section,1)!=Success))
- return NULL;
- overlay= &section->overlays[section->num_overlays];
- if ((sz_rows>0)&&(_XkbAllocOverlayRows(overlay,sz_rows)!=Success))
- return NULL;
- overlay->name= name;
- overlay->section_under= section;
- section->num_overlays++;
- return overlay;
-}
diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c
deleted file mode 100644
index 20def46ba..000000000
--- a/xkb/XKBMAlloc.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/* $Xorg: XKBMAlloc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.12 2003/11/17 22:20:09 dawes Exp $ */
-
-#ifndef XKB_IN_SERVER
-
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xlibint.h"
-#include <X11/extensions/XKBproto.h>
-#include <X11/keysym.h>
-#include "XKBlibint.h"
-
-#else
-
-#include <stdio.h>
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include <X11/keysym.h>
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-
-#endif /* XKB_IN_SERVER */
-
-/***====================================================================***/
-
-Status
-XkbAllocClientMap(XkbDescPtr xkb,unsigned which,unsigned nTotalTypes)
-{
-register int i;
-XkbClientMapPtr map;
-
- if ((xkb==NULL)||((nTotalTypes>0)&&(nTotalTypes<XkbNumRequiredTypes)))
- return BadValue;
- if ((which&XkbKeySymsMask)&&
- ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))) {
-#ifdef DEBUG
-fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n",
- xkb->min_key_code,xkb->max_key_code);
-#endif
- return BadValue;
- }
-
- if (xkb->map==NULL) {
- map= _XkbTypedCalloc(1,XkbClientMapRec);
- if (map==NULL)
- return BadAlloc;
- xkb->map= map;
- }
- else map= xkb->map;
-
- if ((which&XkbKeyTypesMask)&&(nTotalTypes>0)) {
- if (map->types==NULL) {
- map->types= _XkbTypedCalloc(nTotalTypes,XkbKeyTypeRec);
- if (map->types==NULL)
- return BadAlloc;
- map->num_types= 0;
- map->size_types= nTotalTypes;
- }
- else if (map->size_types<nTotalTypes) {
- XkbKeyTypeRec *prev_types = map->types;
-
- map->types= _XkbTypedRealloc(map->types,nTotalTypes,XkbKeyTypeRec);
- if (map->types==NULL) {
- _XkbFree(prev_types);
- map->num_types= map->size_types= 0;
- return BadAlloc;
- }
- map->size_types= nTotalTypes;
- bzero(&map->types[map->num_types],
- ((map->size_types-map->num_types)*sizeof(XkbKeyTypeRec)));
- }
- }
- if (which&XkbKeySymsMask) {
- int nKeys= XkbNumKeys(xkb);
- if (map->syms==NULL) {
- map->size_syms= (nKeys*15)/10;
- map->syms= _XkbTypedCalloc(map->size_syms,KeySym);
- if (!map->syms) {
- map->size_syms= 0;
- return BadAlloc;
- }
- map->num_syms= 1;
- map->syms[0]= NoSymbol;
- }
- if (map->key_sym_map==NULL) {
- i= xkb->max_key_code+1;
- map->key_sym_map= _XkbTypedCalloc(i,XkbSymMapRec);
- if (map->key_sym_map==NULL)
- return BadAlloc;
- }
- }
- if (which&XkbModifierMapMask) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadMatch;
- if (map->modmap==NULL) {
- i= xkb->max_key_code+1;
- map->modmap= _XkbTypedCalloc(i,unsigned char);
- if (map->modmap==NULL)
- return BadAlloc;
- }
- }
- return Success;
-}
-
-Status
-XkbAllocServerMap(XkbDescPtr xkb,unsigned which,unsigned nNewActions)
-{
-register int i;
-XkbServerMapPtr map;
-
- if (xkb==NULL)
- return BadMatch;
- if (xkb->server==NULL) {
- map= _XkbTypedCalloc(1,XkbServerMapRec);
- if (map==NULL)
- return BadAlloc;
- for (i=0;i<XkbNumVirtualMods;i++) {
- map->vmods[i]= XkbNoModifierMask;
- }
- xkb->server= map;
- }
- else map= xkb->server;
- if (which&XkbExplicitComponentsMask) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadMatch;
- if (map->explicit==NULL) {
- i= xkb->max_key_code+1;
- map->explicit= _XkbTypedCalloc(i,unsigned char);
- if (map->explicit==NULL)
- return BadAlloc;
- }
- }
- if (which&XkbKeyActionsMask) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadMatch;
- if (nNewActions<1)
- nNewActions= 1;
- if (map->acts==NULL) {
- map->acts= _XkbTypedCalloc((nNewActions+1),XkbAction);
- if (map->acts==NULL)
- return BadAlloc;
- map->num_acts= 1;
- map->size_acts= nNewActions+1;
- }
- else if ((map->size_acts-map->num_acts)<nNewActions) {
- unsigned need;
- XkbAction *prev_acts = map->acts;
- need= map->num_acts+nNewActions;
- map->acts= _XkbTypedRealloc(map->acts,need,XkbAction);
- if (map->acts==NULL) {
- _XkbFree(prev_acts);
- map->num_acts= map->size_acts= 0;
- return BadAlloc;
- }
- map->size_acts= need;
- bzero(&map->acts[map->num_acts],
- ((map->size_acts-map->num_acts)*sizeof(XkbAction)));
- }
- if (map->key_acts==NULL) {
- i= xkb->max_key_code+1;
- map->key_acts= _XkbTypedCalloc(i,unsigned short);
- if (map->key_acts==NULL)
- return BadAlloc;
- }
- }
- if (which&XkbKeyBehaviorsMask) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadMatch;
- if (map->behaviors==NULL) {
- i= xkb->max_key_code+1;
- map->behaviors= _XkbTypedCalloc(i,XkbBehavior);
- if (map->behaviors==NULL)
- return BadAlloc;
- }
- }
- if (which&XkbVirtualModMapMask) {
- if ((!XkbIsLegalKeycode(xkb->min_key_code))||
- (!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
- return BadMatch;
- if (map->vmodmap==NULL) {
- i= xkb->max_key_code+1;
- map->vmodmap= _XkbTypedCalloc(i,unsigned short);
- if (map->vmodmap==NULL)
- return BadAlloc;
- }
- }
- return Success;
-}
-
-/***====================================================================***/
-
-Status
-XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into)
-{
- if ((!from)||(!into))
- return BadMatch;
- if (into->map) {
- _XkbFree(into->map);
- into->map= NULL;
- }
- if (into->preserve) {
- _XkbFree(into->preserve);
- into->preserve= NULL;
- }
- if (into->level_names) {
- _XkbFree(into->level_names);
- into->level_names= NULL;
- }
- *into= *from;
- if ((from->map)&&(into->map_count>0)) {
- into->map= _XkbTypedCalloc(into->map_count,XkbKTMapEntryRec);
- if (!into->map)
- return BadAlloc;
- memcpy(into->map,from->map,into->map_count*sizeof(XkbKTMapEntryRec));
- }
- if ((from->preserve)&&(into->map_count>0)) {
- into->preserve= _XkbTypedCalloc(into->map_count,XkbModsRec);
- if (!into->preserve)
- return BadAlloc;
- memcpy(into->preserve,from->preserve,
- into->map_count*sizeof(XkbModsRec));
- }
- if ((from->level_names)&&(into->num_levels>0)) {
- into->level_names= _XkbTypedCalloc(into->num_levels,Atom);
- if (!into->level_names)
- return BadAlloc;
- memcpy(into->level_names,from->level_names,
- into->num_levels*sizeof(Atom));
- }
- return Success;
-}
-
-Status
-XkbCopyKeyTypes(XkbKeyTypePtr from,XkbKeyTypePtr into,int num_types)
-{
-register int i,rtrn;
-
- if ((!from)||(!into)||(num_types<0))
- return BadMatch;
- for (i=0;i<num_types;i++) {
- if ((rtrn= XkbCopyKeyType(from++,into++))!=Success)
- return rtrn;
- }
- return Success;
-}
-
-XkbKeyTypePtr
-XkbAddKeyType( XkbDescPtr xkb,
- Atom name,
- int map_count,
- Bool want_preserve,
- int num_lvls)
-{
-register int i;
-unsigned tmp;
-XkbKeyTypePtr type;
-XkbClientMapPtr map;
-
- if ((!xkb)||(num_lvls<1))
- return NULL;
- map= xkb->map;
- if ((map)&&(map->types)) {
- for (i=0;i<map->num_types;i++) {
- if (map->types[i].name==name) {
- Status status;
- status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
- return (status==Success?&map->types[i]:NULL);
- }
- }
- }
- if ((!map)||(!map->types)||(!map->num_types<XkbNumRequiredTypes)) {
- tmp= XkbNumRequiredTypes+1;
- if (XkbAllocClientMap(xkb,XkbKeyTypesMask,tmp)!=Success)
- return NULL;
- tmp= 0;
- if (map->num_types<=XkbKeypadIndex)
- tmp|= XkbKeypadMask;
- if (map->num_types<=XkbAlphabeticIndex)
- tmp|= XkbAlphabeticMask;
- if (map->num_types<=XkbTwoLevelIndex)
- tmp|= XkbTwoLevelMask;
- if (map->num_types<=XkbOneLevelIndex)
- tmp|= XkbOneLevelMask;
- if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) {
- for (i=0;i<map->num_types;i++) {
- Status status;
- if (map->types[i].name!=name)
- continue;
- status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
- return (status==Success?&map->types[i]:NULL);
- }
- }
- }
- if ((map->num_types<=map->size_types)&&
- (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) {
- return NULL;
- }
- type= &map->types[map->num_types];
- map->num_types++;
- bzero((char *)type,sizeof(XkbKeyTypeRec));
- type->num_levels= num_lvls;
- type->map_count= map_count;
- type->name= name;
- if (map_count>0) {
- type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec);
- if (!type->map) {
- map->num_types--;
- return NULL;
- }
- if (want_preserve) {
- type->preserve= _XkbTypedCalloc(map_count,XkbModsRec);
- if (!type->preserve) {
- _XkbFree(type->map);
- map->num_types--;
- return NULL;
- }
- }
- }
- return type;
-}
-
-Status
-XkbResizeKeyType( XkbDescPtr xkb,
- int type_ndx,
- int map_count,
- Bool want_preserve,
- int new_num_lvls)
-{
-XkbKeyTypePtr type;
-KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
-
- if ((type_ndx<0)||(type_ndx>=xkb->map->num_types)||(map_count<0)||
- (new_num_lvls<1))
- return BadValue;
- switch (type_ndx) {
- case XkbOneLevelIndex:
- if (new_num_lvls!=1)
- return BadMatch;
- break;
- case XkbTwoLevelIndex:
- case XkbAlphabeticIndex:
- case XkbKeypadIndex:
- if (new_num_lvls!=2)
- return BadMatch;
- break;
- }
- type= &xkb->map->types[type_ndx];
- if (map_count==0) {
- if (type->map!=NULL)
- _XkbFree(type->map);
- type->map= NULL;
- if (type->preserve!=NULL)
- _XkbFree(type->preserve);
- type->preserve= NULL;
- type->map_count= 0;
- }
- else {
- XkbKTMapEntryRec *prev_map = type->map;
-
- if ((map_count>type->map_count)||(type->map==NULL))
- type->map=_XkbTypedRealloc(type->map,map_count,XkbKTMapEntryRec);
- if (!type->map) {
- if (prev_map)
- _XkbFree(prev_map);
- return BadAlloc;
- }
- if (want_preserve) {
- XkbModsRec *prev_preserve = type->preserve;
-
- if ((map_count>type->map_count)||(type->preserve==NULL)) {
- type->preserve= _XkbTypedRealloc(type->preserve,map_count,
- XkbModsRec);
- }
- if (!type->preserve) {
- if (prev_preserve)
- _XkbFree(prev_preserve);
- return BadAlloc;
- }
- }
- else if (type->preserve!=NULL) {
- _XkbFree(type->preserve);
- type->preserve= NULL;
- }
- type->map_count= map_count;
- }
-
- if ((new_num_lvls>type->num_levels)||(type->level_names==NULL)) {
- Atom * prev_level_names = type->level_names;
-
- type->level_names=_XkbTypedRealloc(type->level_names,new_num_lvls,Atom);
- if (!type->level_names) {
- if (prev_level_names)
- _XkbFree(prev_level_names);
- return BadAlloc;
- }
- }
- /*
- * Here's the theory:
- * If the width of the type changed, we might have to resize the symbol
- * maps for any keys that use the type for one or more groups. This is
- * expensive, so we'll try to cull out any keys that are obviously okay:
- * In any case:
- * - keys that have a group width <= the old width are okay (because
- * they could not possibly have been associated with the old type)
- * If the key type increased in size:
- * - keys that already have a group width >= to the new width are okay
- * + keys that have a group width >= the old width but < the new width
- * might have to be enlarged.
- * If the key type decreased in size:
- * - keys that have a group width > the old width don't have to be
- * resized (because they must have some other wider type associated
- * with some group).
- * + keys that have a group width == the old width might have to be
- * shrunk.
- * The possibilities marked with '+' require us to examine the key types
- * associated with each group for the key.
- */
- bzero(matchingKeys,XkbMaxKeyCount*sizeof(KeyCode));
- nMatchingKeys= 0;
- if (new_num_lvls>type->num_levels) {
- int nTotal;
- KeySym * newSyms;
- int width,match,nResize;
- register int i,g,nSyms;
-
- nResize= 0;
- for (nTotal=1,i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- width= XkbKeyGroupsWidth(xkb,i);
- if (width<type->num_levels)
- continue;
- for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) {
- if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) {
- matchingKeys[nMatchingKeys++]= i;
- match= 1;
- }
- }
- if ((!match)||(width>=new_num_lvls))
- nTotal+= XkbKeyNumSyms(xkb,i);
- else {
- nTotal+= XkbKeyNumGroups(xkb,i)*new_num_lvls;
- nResize++;
- }
- }
- if (nResize>0) {
- int nextMatch;
- xkb->map->size_syms= (nTotal*12)/10;
- newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym);
- if (newSyms==NULL)
- return BadAlloc;
- nextMatch= 0;
- nSyms= 1;
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (matchingKeys[nextMatch]==i) {
- KeySym *pOld;
- nextMatch++;
- width= XkbKeyGroupsWidth(xkb,i);
- pOld= XkbKeySymsPtr(xkb,i);
- for (g=XkbKeyNumGroups(xkb,i)-1;g>=0;g--) {
- memcpy(&newSyms[nSyms+(new_num_lvls*g)],&pOld[width*g],
- width*sizeof(KeySym));
- }
- xkb->map->key_sym_map[i].offset= nSyms;
- nSyms+= XkbKeyNumGroups(xkb,i)*new_num_lvls;
- }
- else {
- memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i),
- XkbKeyNumSyms(xkb,i)*sizeof(KeySym));
- xkb->map->key_sym_map[i].offset= nSyms;
- nSyms+= XkbKeyNumSyms(xkb,i);
- }
- }
- type->num_levels= new_num_lvls;
- _XkbFree(xkb->map->syms);
- xkb->map->syms= newSyms;
- xkb->map->num_syms= nSyms;
- return Success;
- }
- }
- else if (new_num_lvls<type->num_levels) {
- int width,match;
- register int g,i;
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- width= XkbKeyGroupsWidth(xkb,i);
- if (width<type->num_levels)
- continue;
- for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) {
- if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) {
- matchingKeys[nMatchingKeys++]= i;
- match= 1;
- }
- }
- }
- }
- if (nMatchingKeys>0) {
- int key,firstClear;
- register int i,g;
- if (new_num_lvls>type->num_levels)
- firstClear= type->num_levels;
- else firstClear= new_num_lvls;
- for (i=0;i<nMatchingKeys;i++) {
- KeySym * pSyms;
- int width,nClear;
-
- key= matchingKeys[i];
- width= XkbKeyGroupsWidth(xkb,key);
- nClear= width-firstClear;
- pSyms= XkbKeySymsPtr(xkb,key);
- for (g=XkbKeyNumGroups(xkb,key)-1;g>=0;g--) {
- if (XkbKeyKeyTypeIndex(xkb,key,g)==type_ndx) {
- if (nClear>0)
- bzero(&pSyms[g*width+firstClear],nClear*sizeof(KeySym));
- }
- }
- }
- }
- type->num_levels= new_num_lvls;
- return Success;
-}
-
-KeySym *
-XkbResizeKeySyms(XkbDescPtr xkb,int key,int needed)
-{
-register int i,nSyms,nKeySyms;
-unsigned nOldSyms;
-KeySym *newSyms;
-
- if (needed==0) {
- xkb->map->key_sym_map[key].offset= 0;
- return xkb->map->syms;
- }
- nOldSyms= XkbKeyNumSyms(xkb,key);
- if (nOldSyms>=(unsigned)needed) {
- return XkbKeySymsPtr(xkb,key);
- }
- if (xkb->map->size_syms-xkb->map->num_syms>=(unsigned)needed) {
- if (nOldSyms>0) {
- memcpy(&xkb->map->syms[xkb->map->num_syms],XkbKeySymsPtr(xkb,key),
- nOldSyms*sizeof(KeySym));
- }
- if ((needed-nOldSyms)>0) {
- bzero(&xkb->map->syms[xkb->map->num_syms+XkbKeyNumSyms(xkb,key)],
- (needed-nOldSyms)*sizeof(KeySym));
- }
- xkb->map->key_sym_map[key].offset = xkb->map->num_syms;
- xkb->map->num_syms+= needed;
- return &xkb->map->syms[xkb->map->key_sym_map[key].offset];
- }
- xkb->map->size_syms+= (needed>32?needed:32);
- newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym);
- if (newSyms==NULL)
- return NULL;
- newSyms[0]= NoSymbol;
- nSyms = 1;
- for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) {
- int nCopy;
-
- nCopy= nKeySyms= XkbKeyNumSyms(xkb,i);
- if ((nKeySyms==0)&&(i!=key))
- continue;
- if (i==key)
- nKeySyms= needed;
- if (nCopy!=0)
- memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i),nCopy*sizeof(KeySym));
- if (nKeySyms>nCopy)
- bzero(&newSyms[nSyms+nCopy],(nKeySyms-nCopy)*sizeof(KeySym));
- xkb->map->key_sym_map[i].offset = nSyms;
- nSyms+= nKeySyms;
- }
- _XkbFree(xkb->map->syms);
- xkb->map->syms = newSyms;
- xkb->map->num_syms = nSyms;
- return &xkb->map->syms[xkb->map->key_sym_map[key].offset];
-}
-
-static unsigned
-_ExtendRange( unsigned int old_flags,
- unsigned int flag,
- KeyCode newKC,
- KeyCode * old_min,
- unsigned char * old_num)
-{
- if ((old_flags&flag)==0) {
- old_flags|= flag;
- *old_min= newKC;
- *old_num= 1;
- }
- else {
- int last= (*old_min)+(*old_num)-1;
- if (newKC<*old_min) {
- *old_min= newKC;
- *old_num= (last-newKC)+1;
- }
- else if (newKC>last) {
- *old_num= (newKC-(*old_min))+1;
- }
- }
- return old_flags;
-}
-
-Status
-XkbChangeKeycodeRange( XkbDescPtr xkb,
- int minKC,
- int maxKC,
- XkbChangesPtr changes)
-{
-int tmp;
-
- if ((!xkb)||(minKC<XkbMinLegalKeyCode)||(maxKC>XkbMaxLegalKeyCode))
- return BadValue;
- if (minKC>maxKC)
- return BadMatch;
- if (minKC<xkb->min_key_code) {
- if (changes)
- changes->map.min_key_code= minKC;
- tmp= xkb->min_key_code-minKC;
- if (xkb->map) {
- if (xkb->map->key_sym_map) {
- bzero((char *)&xkb->map->key_sym_map[minKC],
- tmp*sizeof(XkbSymMapRec));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeySymsMask,minKC,
- &changes->map.first_key_sym,
- &changes->map.num_key_syms);
- }
- }
- if (xkb->map->modmap) {
- bzero((char *)&xkb->map->modmap[minKC],tmp);
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbModifierMapMask,minKC,
- &changes->map.first_modmap_key,
- &changes->map.num_modmap_keys);
- }
- }
- }
- if (xkb->server) {
- if (xkb->server->behaviors) {
- bzero((char *)&xkb->server->behaviors[minKC],
- tmp*sizeof(XkbBehavior));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeyBehaviorsMask,minKC,
- &changes->map.first_key_behavior,
- &changes->map.num_key_behaviors);
- }
- }
- if (xkb->server->key_acts) {
- bzero((char *)&xkb->server->key_acts[minKC],
- tmp*sizeof(unsigned short));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeyActionsMask,minKC,
- &changes->map.first_key_act,
- &changes->map.num_key_acts);
- }
- }
- if (xkb->server->vmodmap) {
- bzero((char *)&xkb->server->vmodmap[minKC],
- tmp*sizeof(unsigned short));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbVirtualModMapMask,minKC,
- &changes->map.first_modmap_key,
- &changes->map.num_vmodmap_keys);
- }
- }
- }
- if ((xkb->names)&&(xkb->names->keys)) {
- bzero((char *)&xkb->names->keys[minKC],tmp*sizeof(XkbKeyNameRec));
- if (changes) {
- changes->names.changed= _ExtendRange(changes->names.changed,
- XkbKeyNamesMask,minKC,
- &changes->names.first_key,
- &changes->names.num_keys);
- }
- }
- xkb->min_key_code= minKC;
- }
- if (maxKC>xkb->max_key_code) {
- if (changes)
- changes->map.max_key_code= maxKC;
- tmp= maxKC-xkb->max_key_code;
- if (xkb->map) {
- if (xkb->map->key_sym_map) {
- XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map;
-
- xkb->map->key_sym_map= _XkbTypedRealloc(xkb->map->key_sym_map,
- (maxKC+1),XkbSymMapRec);
- if (!xkb->map->key_sym_map) {
- _XkbFree(prev_key_sym_map);
- return BadAlloc;
- }
- bzero((char *)&xkb->map->key_sym_map[xkb->max_key_code],
- tmp*sizeof(XkbSymMapRec));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeySymsMask,maxKC,
- &changes->map.first_key_sym,
- &changes->map.num_key_syms);
- }
- }
- if (xkb->map->modmap) {
- unsigned char *prev_modmap = xkb->map->modmap;
-
- xkb->map->modmap= _XkbTypedRealloc(xkb->map->modmap,
- (maxKC+1),unsigned char);
- if (!xkb->map->modmap) {
- _XkbFree(prev_modmap);
- return BadAlloc;
- }
- bzero((char *)&xkb->map->modmap[xkb->max_key_code],tmp);
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbModifierMapMask,maxKC,
- &changes->map.first_modmap_key,
- &changes->map.num_modmap_keys);
- }
- }
- }
- if (xkb->server) {
- if (xkb->server->behaviors) {
- XkbBehavior *prev_behaviors = xkb->server->behaviors;
-
- xkb->server->behaviors=_XkbTypedRealloc(xkb->server->behaviors,
- (maxKC+1),XkbBehavior);
- if (!xkb->server->behaviors) {
- _XkbFree(prev_behaviors);
- return BadAlloc;
- }
- bzero((char *)&xkb->server->behaviors[xkb->max_key_code],
- tmp*sizeof(XkbBehavior));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeyBehaviorsMask,maxKC,
- &changes->map.first_key_behavior,
- &changes->map.num_key_behaviors);
- }
- }
- if (xkb->server->key_acts) {
- unsigned short *prev_key_acts = xkb->server->key_acts;
-
- xkb->server->key_acts= _XkbTypedRealloc(xkb->server->key_acts,
- (maxKC+1),unsigned short);
- if (!xkb->server->key_acts) {
- _XkbFree(prev_key_acts);
- return BadAlloc;
- }
- bzero((char *)&xkb->server->key_acts[xkb->max_key_code],
- tmp*sizeof(unsigned short));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbKeyActionsMask,maxKC,
- &changes->map.first_key_act,
- &changes->map.num_key_acts);
- }
- }
- if (xkb->server->vmodmap) {
- unsigned short *prev_vmodmap = xkb->server->vmodmap;
-
- xkb->server->vmodmap= _XkbTypedRealloc(xkb->server->vmodmap,
- (maxKC+1),unsigned short);
- if (!xkb->server->vmodmap) {
- _XkbFree(prev_vmodmap);
- return BadAlloc;
- }
- bzero((char *)&xkb->server->vmodmap[xkb->max_key_code],
- tmp*sizeof(unsigned short));
- if (changes) {
- changes->map.changed= _ExtendRange(changes->map.changed,
- XkbVirtualModMapMask,maxKC,
- &changes->map.first_modmap_key,
- &changes->map.num_vmodmap_keys);
- }
- }
- }
- if ((xkb->names)&&(xkb->names->keys)) {
- XkbKeyNameRec *prev_keys = xkb->names->keys;
-
- xkb->names->keys= _XkbTypedRealloc(xkb->names->keys,
- (maxKC+1),XkbKeyNameRec);
- if (!xkb->names->keys) {
- _XkbFree(prev_keys);
- return BadAlloc;
- }
- bzero((char *)&xkb->names->keys[xkb->max_key_code],
- tmp*sizeof(XkbKeyNameRec));
- if (changes) {
- changes->names.changed= _ExtendRange(changes->names.changed,
- XkbKeyNamesMask,maxKC,
- &changes->names.first_key,
- &changes->names.num_keys);
- }
- }
- xkb->max_key_code= maxKC;
- }
- return Success;
-}
-
-XkbAction *
-XkbResizeKeyActions(XkbDescPtr xkb,int key,int needed)
-{
-register int i,nActs;
-XkbAction *newActs;
-
- if (needed==0) {
- xkb->server->key_acts[key]= 0;
- return NULL;
- }
- if (XkbKeyHasActions(xkb,key)&&(XkbKeyNumSyms(xkb,key)>=(unsigned)needed))
- return XkbKeyActionsPtr(xkb,key);
- if (xkb->server->size_acts-xkb->server->num_acts>=(unsigned)needed) {
- xkb->server->key_acts[key]= xkb->server->num_acts;
- xkb->server->num_acts+= needed;
- return &xkb->server->acts[xkb->server->key_acts[key]];
- }
- xkb->server->size_acts= xkb->server->num_acts+needed+8;
- newActs = _XkbTypedCalloc(xkb->server->size_acts,XkbAction);
- if (newActs==NULL)
- return NULL;
- newActs[0].type = XkbSA_NoAction;
- nActs = 1;
- for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) {
- int nKeyActs,nCopy;
-
- if ((xkb->server->key_acts[i]==0)&&(i!=key))
- continue;
-
- nCopy= nKeyActs= XkbKeyNumActions(xkb,i);
- if (i==key) {
- nKeyActs= needed;
- if (needed<nCopy)
- nCopy= needed;
- }
-
- if (nCopy>0)
- memcpy(&newActs[nActs],XkbKeyActionsPtr(xkb,i),
- nCopy*sizeof(XkbAction));
- if (nCopy<nKeyActs)
- bzero(&newActs[nActs+nCopy],(nKeyActs-nCopy)*sizeof(XkbAction));
- xkb->server->key_acts[i]= nActs;
- nActs+= nKeyActs;
- }
- _XkbFree(xkb->server->acts);
- xkb->server->acts = newActs;
- xkb->server->num_acts= nActs;
- return &xkb->server->acts[xkb->server->key_acts[key]];
-}
-
-void
-XkbFreeClientMap(XkbDescPtr xkb,unsigned what,Bool freeMap)
-{
-XkbClientMapPtr map;
-
- if ((xkb==NULL)||(xkb->map==NULL))
- return;
- if (freeMap)
- what= XkbAllClientInfoMask;
- map= xkb->map;
- if (what&XkbKeyTypesMask) {
- if (map->types!=NULL) {
- if (map->num_types>0) {
- register int i;
- XkbKeyTypePtr type;
- for (i=0,type=map->types;i<map->num_types;i++,type++) {
- if (type->map!=NULL) {
- _XkbFree(type->map);
- type->map= NULL;
- }
- if (type->preserve!=NULL) {
- _XkbFree(type->preserve);
- type->preserve= NULL;
- }
- type->map_count= 0;
- if (type->level_names!=NULL) {
- _XkbFree(type->level_names);
- type->level_names= NULL;
- }
- }
- }
- _XkbFree(map->types);
- map->num_types= map->size_types= 0;
- map->types= NULL;
- }
- }
- if (what&XkbKeySymsMask) {
- if (map->key_sym_map!=NULL) {
- _XkbFree(map->key_sym_map);
- map->key_sym_map= NULL;
- }
- if (map->syms!=NULL) {
- _XkbFree(map->syms);
- map->size_syms= map->num_syms= 0;
- map->syms= NULL;
- }
- }
- if ((what&XkbModifierMapMask)&&(map->modmap!=NULL)) {
- _XkbFree(map->modmap);
- map->modmap= NULL;
- }
- if (freeMap) {
- _XkbFree(xkb->map);
- xkb->map= NULL;
- }
- return;
-}
-
-void
-XkbFreeServerMap(XkbDescPtr xkb,unsigned what,Bool freeMap)
-{
-XkbServerMapPtr map;
-
- if ((xkb==NULL)||(xkb->server==NULL))
- return;
- if (freeMap)
- what= XkbAllServerInfoMask;
- map= xkb->server;
- if ((what&XkbExplicitComponentsMask)&&(map->explicit!=NULL)) {
- _XkbFree(map->explicit);
- map->explicit= NULL;
- }
- if (what&XkbKeyActionsMask) {
- if (map->key_acts!=NULL) {
- _XkbFree(map->key_acts);
- map->key_acts= NULL;
- }
- if (map->acts!=NULL) {
- _XkbFree(map->acts);
- map->num_acts= map->size_acts= 0;
- map->acts= NULL;
- }
- }
- if ((what&XkbKeyBehaviorsMask)&&(map->behaviors!=NULL)) {
- _XkbFree(map->behaviors);
- map->behaviors= NULL;
- }
- if ((what&XkbVirtualModMapMask)&&(map->vmodmap!=NULL)) {
- _XkbFree(map->vmodmap);
- map->vmodmap= NULL;
- }
-
- if (freeMap) {
- _XkbFree(xkb->server);
- xkb->server= NULL;
- }
- return;
-}
diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c
deleted file mode 100644
index 06660ff89..000000000
--- a/xkb/XKBMisc.c
+++ /dev/null
@@ -1,975 +0,0 @@
-/* $Xorg: XKBMisc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/lib/X11/XKBMisc.c,v 3.6 2003/11/17 22:20:09 dawes Exp $ */
-
-#ifndef XKB_IN_SERVER
-
-#include <stdio.h>
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include "Xlibint.h"
-#include <X11/extensions/XKBproto.h>
-#include <X11/keysym.h>
-#include "XKBlibint.h"
-
-#else
-
-#include <stdio.h>
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include <X11/keysym.h>
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-
-#endif /* XKB_IN_SERVER */
-
-/***====================================================================***/
-
-#define mapSize(m) (sizeof(m)/sizeof(XkbKTMapEntryRec))
-static XkbKTMapEntryRec map2Level[]= {
- { True, ShiftMask, {1, ShiftMask, 0} }
-};
-
-static XkbKTMapEntryRec mapAlpha[]= {
- { True, ShiftMask, { 1, ShiftMask, 0 } },
- { True, LockMask, { 0, LockMask, 0 } }
-};
-
-static XkbModsRec preAlpha[]= {
- { 0, 0, 0 },
- { LockMask, LockMask, 0 }
-};
-
-#define NL_VMOD_MASK 0
-static XkbKTMapEntryRec mapKeypad[]= {
- { True, ShiftMask, { 1, ShiftMask, 0 } },
- { False, 0, { 1, 0, NL_VMOD_MASK } }
-};
-
-static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
- { { 0, 0, 0 },
- 1, /* num_levels */
- 0, /* map_count */
- NULL, NULL,
- None, NULL
- },
- { { ShiftMask, ShiftMask, 0 },
- 2, /* num_levels */
- mapSize(map2Level), /* map_count */
- map2Level, NULL,
- None, NULL
- },
- { { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
- 2, /* num_levels */
- mapSize(mapAlpha), /* map_count */
- mapAlpha, preAlpha,
- None, NULL
- },
- { { ShiftMask, ShiftMask, NL_VMOD_MASK },
- 2, /* num_levels */
- mapSize(mapKeypad), /* map_count */
- mapKeypad, NULL,
- None, NULL
- }
-};
-
-Status
-XkbInitCanonicalKeyTypes(XkbDescPtr xkb,unsigned which,int keypadVMod)
-{
-XkbClientMapPtr map;
-XkbKeyTypePtr from,to;
-Status rtrn;
-
- if (!xkb)
- return BadMatch;
- rtrn= XkbAllocClientMap(xkb,XkbKeyTypesMask,XkbNumRequiredTypes);
- if (rtrn!=Success)
- return rtrn;
- map= xkb->map;
- if ((which&XkbAllRequiredTypes)==0)
- return Success;
- rtrn= Success;
- from= canonicalTypes;
- to= map->types;
- if (which&XkbOneLevelMask)
- rtrn= XkbCopyKeyType(&from[XkbOneLevelIndex],&to[XkbOneLevelIndex]);
- if ((which&XkbTwoLevelMask)&&(rtrn==Success))
- rtrn= XkbCopyKeyType(&from[XkbTwoLevelIndex],&to[XkbTwoLevelIndex]);
- if ((which&XkbAlphabeticMask)&&(rtrn==Success))
- rtrn= XkbCopyKeyType(&from[XkbAlphabeticIndex],&to[XkbAlphabeticIndex]);
- if ((which&XkbKeypadMask)&&(rtrn==Success)) {
- XkbKeyTypePtr type;
- rtrn= XkbCopyKeyType(&from[XkbKeypadIndex],&to[XkbKeypadIndex]);
- type= &to[XkbKeypadIndex];
- if ((keypadVMod>=0)&&(keypadVMod<XkbNumVirtualMods)&&(rtrn==Success)) {
- type->mods.vmods= (1<<keypadVMod);
- type->map[0].active= True;
- type->map[0].mods.mask= ShiftMask;
- type->map[0].mods.real_mods= ShiftMask;
- type->map[0].mods.vmods= 0;
- type->map[0].level= 1;
- type->map[1].active= False;
- type->map[1].mods.mask= 0;
- type->map[1].mods.real_mods= 0;
- type->map[1].mods.vmods= (1<<keypadVMod);
- type->map[1].level= 1;
- }
- }
- return Success;
-}
-
-/***====================================================================***/
-
-#define CORE_SYM(i) (i<map_width?core_syms[i]:NoSymbol)
-#define XKB_OFFSET(g,l) (((g)*groupsWidth)+(l))
-
-int
-XkbKeyTypesForCoreSymbols( XkbDescPtr xkb,
- int map_width,
- KeySym * core_syms,
- unsigned int protected,
- int * types_inout,
- KeySym * xkb_syms_rtrn)
-{
-register int i;
-unsigned int empty;
-int nSyms[XkbNumKbdGroups];
-int nGroups,tmp,groupsWidth;
-
- /* Section 12.2 of the protocol describes this process in more detail */
- /* Step 1: find the # of symbols in the core mapping per group */
- groupsWidth= 2;
- for (i=0;i<XkbNumKbdGroups;i++) {
- if ((protected&(1<<i))&&(types_inout[i]<xkb->map->num_types)) {
- nSyms[i]= xkb->map->types[types_inout[i]].num_levels;
- if (nSyms[i]>groupsWidth)
- groupsWidth= nSyms[i];
- }
- else {
- types_inout[i]= XkbTwoLevelIndex; /* don't really know, yet */
- nSyms[i]= 2;
- }
- }
- if (nSyms[XkbGroup1Index]<2)
- nSyms[XkbGroup1Index]= 2;
- if (nSyms[XkbGroup2Index]<2)
- nSyms[XkbGroup2Index]= 2;
- /* Step 2: Copy the symbols from the core ordering to XKB ordering */
- /* symbols in the core are in the order: */
- /* G1L1 G1L2 G2L1 G2L2 [G1L[3-n]] [G2L[3-n]] [G3L*] [G3L*] */
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index,0)]= CORE_SYM(0);
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index,1)]= CORE_SYM(1);
- for (i=2;i<nSyms[XkbGroup1Index];i++) {
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup1Index,i)]= CORE_SYM(2+i);
- }
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index,0)]= CORE_SYM(2);
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index,1)]= CORE_SYM(3);
- tmp= 2+(nSyms[XkbGroup1Index]-2); /* offset to extra group2 syms */
- for (i=2;i<nSyms[XkbGroup2Index];i++) {
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup2Index,i)]= CORE_SYM(tmp+i);
- }
- tmp= nSyms[XkbGroup1Index]+nSyms[XkbGroup2Index];
- if ((tmp>=map_width)&&
- ((protected&(XkbExplicitKeyType3Mask|XkbExplicitKeyType4Mask))==0)) {
- nSyms[XkbGroup3Index]= 0;
- nSyms[XkbGroup4Index]= 0;
- nGroups= 2;
- }
- else {
- nGroups= 3;
- for (i=0;i<nSyms[XkbGroup3Index];i++,tmp++) {
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup3Index,i)]= CORE_SYM(tmp);
- }
- if ((tmp<map_width)||(protected&XkbExplicitKeyType4Mask)) {
- nGroups= 4;
- for (i=0;i<nSyms[XkbGroup4Index];i++,tmp++) {
- xkb_syms_rtrn[XKB_OFFSET(XkbGroup4Index,i)]= CORE_SYM(tmp);
- }
- }
- else {
- nSyms[XkbGroup4Index]= 0;
- }
- }
- /* steps 3&4: alphanumeric expansion, assign canonical types */
- empty= 0;
- for (i=0;i<nGroups;i++) {
- KeySym *syms;
- syms= &xkb_syms_rtrn[XKB_OFFSET(i,0)];
- if ((nSyms[i]>1)&&(syms[1]==NoSymbol)&&(syms[0]!=NoSymbol)) {
- KeySym upper,lower;
- XConvertCase(syms[0],&lower,&upper);
- if (upper!=lower) {
- xkb_syms_rtrn[XKB_OFFSET(i,0)]= lower;
- xkb_syms_rtrn[XKB_OFFSET(i,1)]= upper;
- if ((protected&(1<<i))==0)
- types_inout[i]= XkbAlphabeticIndex;
- }
- else if ((protected&(1<<i))==0) {
- types_inout[i]= XkbOneLevelIndex;
- /* nSyms[i]= 1;*/
- }
- }
- if (((protected&(1<<i))==0)&&(types_inout[i]==XkbTwoLevelIndex)) {
- if (IsKeypadKey(syms[0])||IsKeypadKey(syms[1]))
- types_inout[i]= XkbKeypadIndex;
- else {
- KeySym upper,lower;
- XConvertCase(syms[0],&lower,&upper);
- if ((syms[0]==lower)&&(syms[1]==upper))
- types_inout[i]= XkbAlphabeticIndex;
- }
- }
- if (syms[0]==NoSymbol) {
- register int n;
- Bool found;
- for (n=1,found=False;(!found)&&(n<nSyms[i]);n++) {
- found= (syms[n]!=NoSymbol);
- }
- if (!found)
- empty|= (1<<i);
- }
- }
- /* step 5: squoosh out empty groups */
- if (empty) {
- for (i=nGroups-1;i>=0;i--) {
- if (((empty&(1<<i))==0)||(protected&(1<<i)))
- break;
- nGroups--;
- }
- }
- if (nGroups<1)
- return 0;
-
- /* step 6: replicate group 1 into group two, if necessary */
- if ((nGroups>1)&&((empty&(XkbGroup1Mask|XkbGroup2Mask))==XkbGroup2Mask)) {
- if ((protected&(XkbExplicitKeyType1Mask|XkbExplicitKeyType2Mask))==0) {
- nSyms[XkbGroup2Index]= nSyms[XkbGroup1Index];
- types_inout[XkbGroup2Index]= types_inout[XkbGroup1Index];
- memcpy((char *)&xkb_syms_rtrn[2],(char *)xkb_syms_rtrn,
- 2*sizeof(KeySym));
- }
- else if (types_inout[XkbGroup1Index]==types_inout[XkbGroup2Index]) {
- memcpy((char *)&xkb_syms_rtrn[nSyms[XkbGroup1Index]],
- (char *)xkb_syms_rtrn,
- nSyms[XkbGroup1Index]*sizeof(KeySym));
- }
- }
-
- /* step 7: check for all groups identical or all width 1 */
- if (nGroups>1) {
- Bool sameType,allOneLevel;
- allOneLevel= (xkb->map->types[types_inout[0]].num_levels==1);
- for (i=1,sameType=True;(allOneLevel||sameType)&&(i<nGroups);i++) {
- sameType=(sameType&&(types_inout[i]==types_inout[XkbGroup1Index]));
- if (allOneLevel)
- allOneLevel= (xkb->map->types[types_inout[i]].num_levels==1);
- }
- if ((sameType)&&
- (!(protected&(XkbExplicitKeyTypesMask&~XkbExplicitKeyType1Mask)))){
- register int s;
- Bool identical;
- for (i=1,identical=True;identical&&(i<nGroups);i++) {
- KeySym *syms;
- syms= &xkb_syms_rtrn[XKB_OFFSET(i,0)];
- for (s=0;identical&&(s<nSyms[i]);s++) {
- if (syms[s]!=xkb_syms_rtrn[s])
- identical= False;
- }
- }
- if (identical)
- nGroups= 1;
- }
- if (allOneLevel && (nGroups>1)) {
- KeySym *syms;
- syms= &xkb_syms_rtrn[nSyms[XkbGroup1Index]];
- nSyms[XkbGroup1Index]= 1;
- for (i=1;i<nGroups;i++) {
- xkb_syms_rtrn[i]= syms[0];
- syms+= nSyms[i];
- nSyms[i]= 1;
- }
- }
- }
- return nGroups;
-}
-
-static XkbSymInterpretPtr
-_XkbFindMatchingInterp( XkbDescPtr xkb,
- KeySym sym,
- unsigned int real_mods,
- unsigned int level)
-{
-register unsigned i;
-XkbSymInterpretPtr interp,rtrn;
-CARD8 mods;
-
- rtrn= NULL;
- interp= xkb->compat->sym_interpret;
- for (i=0;i<xkb->compat->num_si;i++,interp++) {
- if ((interp->sym==NoSymbol)||(sym==interp->sym)) {
- int match;
- if ((level==0)||((interp->match&XkbSI_LevelOneOnly)==0))
- mods= real_mods;
- else mods= 0;
- switch (interp->match&XkbSI_OpMask) {
- case XkbSI_NoneOf:
- match= ((interp->mods&mods)==0);
- break;
- case XkbSI_AnyOfOrNone:
- match= ((mods==0)||((interp->mods&mods)!=0));
- break;
- case XkbSI_AnyOf:
- match= ((interp->mods&mods)!=0);
- break;
- case XkbSI_AllOf:
- match= ((interp->mods&mods)==interp->mods);
- break;
- case XkbSI_Exactly:
- match= (interp->mods==mods);
- break;
- default:
- match= 0;
- break;
- }
- if (match) {
- if (interp->sym!=NoSymbol) {
- return interp;
- }
- else if (rtrn==NULL) {
- rtrn= interp;
- }
- }
- }
- }
- return rtrn;
-}
-
-static void
-_XkbAddKeyChange(KeyCode *pFirst,unsigned char *pNum,KeyCode newKey)
-{
-KeyCode last;
-
- last= (*pFirst)+(*pNum);
- if (newKey<*pFirst) {
- *pFirst= newKey;
- *pNum= (last-newKey)+1;
- }
- else if (newKey>last) {
- *pNum= (last-*pFirst)+1;
- }
- return;
-}
-
-static void
-_XkbSetActionKeyMods(XkbDescPtr xkb,XkbAction *act,unsigned mods)
-{
-unsigned tmp;
-
- switch (act->type) {
- case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
- if (act->mods.flags&XkbSA_UseModMapMods)
- act->mods.real_mods= act->mods.mask= mods;
- if ((tmp= XkbModActionVMods(&act->mods))!=0) {
- XkbVirtualModsToReal(xkb,tmp,&tmp);
- act->mods.mask|= tmp;
- }
- break;
- case XkbSA_ISOLock:
- if (act->iso.flags&XkbSA_UseModMapMods)
- act->iso.real_mods= act->iso.mask= mods;
- if ((tmp= XkbModActionVMods(&act->iso))!=0) {
- XkbVirtualModsToReal(xkb,tmp,&tmp);
- act->iso.mask|= tmp;
- }
- break;
- }
- return;
-}
-
-#define IBUF_SIZE 8
-
-Bool
-XkbApplyCompatMapToKey(XkbDescPtr xkb,KeyCode key,XkbChangesPtr changes)
-{
-KeySym * syms;
-unsigned char explicit,mods;
-XkbSymInterpretPtr *interps,ibuf[IBUF_SIZE];
-int n,nSyms,found;
-unsigned changed,tmp;
-
- if ((!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)||
- (!xkb->compat)||(!xkb->compat->sym_interpret)||
- (key<xkb->min_key_code)||(key>xkb->max_key_code)) {
- return False;
- }
- if (((!xkb->server)||(!xkb->server->key_acts))&&
- (XkbAllocServerMap(xkb,XkbAllServerInfoMask,0)!=Success)) {
- return False;
- }
- changed= 0; /* keeps track of what has changed in _this_ call */
- explicit= xkb->server->explicit[key];
- if (explicit&XkbExplicitInterpretMask) /* nothing to do */
- return True;
- mods= (xkb->map->modmap?xkb->map->modmap[key]:0);
- nSyms= XkbKeyNumSyms(xkb,key);
- syms= XkbKeySymsPtr(xkb,key);
- if (nSyms>IBUF_SIZE) {
- interps= _XkbTypedCalloc(nSyms,XkbSymInterpretPtr);
- if (interps==NULL) {
- interps= ibuf;
- nSyms= IBUF_SIZE;
- }
- }
- else {
- interps= ibuf;
- }
- found= 0;
- for (n=0;n<nSyms;n++) {
- unsigned level= (n%XkbKeyGroupsWidth(xkb,key));
- interps[n]= NULL;
- if (syms[n]!=NoSymbol) {
- interps[n]= _XkbFindMatchingInterp(xkb,syms[n],mods,level);
- if (interps[n]&&interps[n]->act.type!=XkbSA_NoAction)
- found++;
- else interps[n]= NULL;
- }
- }
- /* 1/28/96 (ef) -- XXX! WORKING HERE */
- if (!found) {
- if (xkb->server->key_acts[key]!=0) {
- xkb->server->key_acts[key]= 0;
- changed|= XkbKeyActionsMask;
- }
- }
- else {
- XkbAction *pActs;
- unsigned int new_vmodmask;
- changed|= XkbKeyActionsMask;
- pActs= XkbResizeKeyActions(xkb,key,nSyms);
- if (!pActs)
- return False;
- new_vmodmask= 0;
- for (n=0;n<nSyms;n++) {
- if (interps[n]) {
- unsigned effMods;
-
- pActs[n]= *((XkbAction *)&interps[n]->act);
- if ((n==0)||((interps[n]->match&XkbSI_LevelOneOnly)==0)) {
- effMods= mods;
- if (interps[n]->virtual_mod!=XkbNoModifier)
- new_vmodmask|= (1<<interps[n]->virtual_mod);
- }
- else effMods= 0;
- _XkbSetActionKeyMods(xkb,&pActs[n],effMods);
- }
- else pActs[n].type= XkbSA_NoAction;
- }
- if (((explicit&XkbExplicitVModMapMask)==0)&&
- (xkb->server->vmodmap[key]!=new_vmodmask)) {
- changed|= XkbVirtualModMapMask;
- xkb->server->vmodmap[key]= new_vmodmask;
- }
- if (interps[0]) {
- if ((interps[0]->flags&XkbSI_LockingKey)&&
- ((explicit&XkbExplicitBehaviorMask)==0)) {
- xkb->server->behaviors[key].type= XkbKB_Lock;
- changed|= XkbKeyBehaviorsMask;
- }
- if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) {
- CARD8 old;
- old= xkb->ctrls->per_key_repeat[key/8];
- if (interps[0]->flags&XkbSI_AutoRepeat)
- xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
- else xkb->ctrls->per_key_repeat[key/8]&= ~(1<<(key%8));
- if (changes && (old!=xkb->ctrls->per_key_repeat[key/8]))
- changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask;
- }
- }
- }
- if ((!found)||(interps[0]==NULL)) {
- if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) {
- CARD8 old;
- old= xkb->ctrls->per_key_repeat[key/8];
-#ifdef RETURN_SHOULD_REPEAT
- if (*XkbKeySymsPtr(xkb,key) != XK_Return)
-#endif
- xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
- if (changes && (old!=xkb->ctrls->per_key_repeat[key/8]))
- changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask;
- }
- if (((explicit&XkbExplicitBehaviorMask)==0)&&
- (xkb->server->behaviors[key].type==XkbKB_Lock)) {
- xkb->server->behaviors[key].type= XkbKB_Default;
- changed|= XkbKeyBehaviorsMask;
- }
- }
- if (changes) {
- XkbMapChangesPtr mc;
- mc= &changes->map;
- tmp= (changed&mc->changed);
- if (tmp&XkbKeyActionsMask)
- _XkbAddKeyChange(&mc->first_key_act,&mc->num_key_acts,key);
- else if (changed&XkbKeyActionsMask) {
- mc->changed|= XkbKeyActionsMask;
- mc->first_key_act= key;
- mc->num_key_acts= 1;
- }
- if (tmp&XkbKeyBehaviorsMask) {
- _XkbAddKeyChange(&mc->first_key_behavior,&mc->num_key_behaviors,
- key);
- }
- else if (changed&XkbKeyBehaviorsMask) {
- mc->changed|= XkbKeyBehaviorsMask;
- mc->first_key_behavior= key;
- mc->num_key_behaviors= 1;
- }
- if (tmp&XkbVirtualModMapMask)
- _XkbAddKeyChange(&mc->first_vmodmap_key,&mc->num_vmodmap_keys,key);
- else if (changed&XkbVirtualModMapMask) {
- mc->changed|= XkbVirtualModMapMask;
- mc->first_vmodmap_key= key;
- mc->num_vmodmap_keys= 1;
- }
- mc->changed|= changed;
- }
- if (interps!=ibuf)
- _XkbFree(interps);
- return True;
-}
-
-Bool
-XkbUpdateMapFromCore( XkbDescPtr xkb,
- KeyCode first_key,
- int num_keys,
- int map_width,
- KeySym * core_keysyms,
- XkbChangesPtr changes)
-{
-register int key,last_key;
-KeySym * syms;
-
- syms= &core_keysyms[(first_key-xkb->min_key_code)*map_width];
- if (changes) {
- if (changes->map.changed&XkbKeySymsMask) {
- _XkbAddKeyChange(&changes->map.first_key_sym,
- &changes->map.num_key_syms,first_key);
- if (num_keys>1) {
- _XkbAddKeyChange(&changes->map.first_key_sym,
- &changes->map.num_key_syms,
- first_key+num_keys-1);
- }
- }
- else {
- changes->map.changed|= XkbKeySymsMask;
- changes->map.first_key_sym= first_key;
- changes->map.num_key_syms= num_keys;
- }
- }
- last_key= first_key+num_keys-1;
- for (key=first_key;key<=last_key;key++,syms+= map_width) {
- XkbMapChangesPtr mc;
- unsigned explicit;
- KeySym tsyms[XkbMaxSymsPerKey];
- int types[XkbNumKbdGroups];
- int nG;
-
- explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask;
- types[XkbGroup1Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index);
- types[XkbGroup2Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup2Index);
- types[XkbGroup3Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup3Index);
- types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index);
- nG= XkbKeyTypesForCoreSymbols(xkb,map_width,syms,explicit,types,tsyms);
- if (changes)
- mc= &changes->map;
- else mc= NULL;
- XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc);
- memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms,
- XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
- XkbApplyCompatMapToKey(xkb,key,changes);
- }
-
- if ((xkb->server->vmods!=NULL)&&(xkb->map->modmap!=NULL)&&(changes)&&
- (changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask))) {
- unsigned char newVMods[XkbNumVirtualMods];
- register unsigned bit,i;
- unsigned present;
-
- bzero(newVMods,XkbNumVirtualMods);
- present= 0;
- for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) {
- if (xkb->server->vmodmap[key]==0)
- continue;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (bit&xkb->server->vmodmap[key]) {
- present|= bit;
- newVMods[i]|= xkb->map->modmap[key];
- }
- }
- }
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if ((bit&present)&&(newVMods[i]!=xkb->server->vmods[i])) {
- changes->map.changed|= XkbVirtualModsMask;
- changes->map.vmods|= bit;
- xkb->server->vmods[i]= newVMods[i];
- }
- }
- }
- if (changes && (changes->map.changed&XkbVirtualModsMask))
- XkbApplyVirtualModChanges(xkb,changes->map.vmods,changes);
- return True;
-}
-
-Status
-XkbChangeTypesOfKey( XkbDescPtr xkb,
- int key,
- int nGroups,
- unsigned groups,
- int * newTypesIn,
- XkbMapChangesPtr changes)
-{
-XkbKeyTypePtr pOldType,pNewType;
-register int i;
-int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups];
-
- if ((!xkb) || (!XkbKeycodeInRange(xkb,key)) || (!xkb->map) ||
- (!xkb->map->types)||(!newTypes)||((groups&XkbAllGroupsMask)==0)||
- (nGroups>XkbNumKbdGroups)) {
- return BadMatch;
- }
- if (nGroups==0) {
- for (i=0;i<XkbNumKbdGroups;i++) {
- xkb->map->key_sym_map[key].kt_index[i]= XkbOneLevelIndex;
- }
- i= xkb->map->key_sym_map[key].group_info;
- i= XkbSetNumGroups(i,0);
- xkb->map->key_sym_map[key].group_info= i;
- XkbResizeKeySyms(xkb,key,0);
- return Success;
- }
-
- nOldGroups= XkbKeyNumGroups(xkb,key);
- oldWidth= XkbKeyGroupsWidth(xkb,key);
- for (width=i=0;i<nGroups;i++) {
- if (groups&(1<<i))
- newTypes[i]= newTypesIn[i];
- else if (i<nOldGroups)
- newTypes[i]= XkbKeyKeyTypeIndex(xkb,key,i);
- else if (nOldGroups>0)
- newTypes[i]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index);
- else newTypes[i]= XkbTwoLevelIndex;
- if (newTypes[i]>xkb->map->num_types)
- return BadMatch;
- pNewType= &xkb->map->types[newTypes[i]];
- if (pNewType->num_levels>width)
- width= pNewType->num_levels;
- }
- if ((xkb->ctrls)&&(nGroups>xkb->ctrls->num_groups))
- xkb->ctrls->num_groups= nGroups;
- if ((width!=oldWidth)||(nGroups!=nOldGroups)) {
- KeySym oldSyms[XkbMaxSymsPerKey],*pSyms;
- int nCopy;
-
- if (nOldGroups==0) {
- pSyms= XkbResizeKeySyms(xkb,key,width*nGroups);
- if (pSyms!=NULL) {
- i= xkb->map->key_sym_map[key].group_info;
- i= XkbSetNumGroups(i,nGroups);
- xkb->map->key_sym_map[key].group_info= i;
- xkb->map->key_sym_map[key].width= width;
- for (i=0;i<nGroups;i++) {
- xkb->map->key_sym_map[key].kt_index[i]= newTypes[i];
- }
- return Success;
- }
- return BadAlloc;
- }
- pSyms= XkbKeySymsPtr(xkb,key);
- memcpy(oldSyms,pSyms,XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
- pSyms= XkbResizeKeySyms(xkb,key,width*nGroups);
- if (pSyms==NULL)
- return BadAlloc;
- bzero(pSyms,width*nGroups*sizeof(KeySym));
- for (i=0;(i<nGroups)&&(i<nOldGroups);i++) {
- pOldType= XkbKeyKeyType(xkb,key,i);
- pNewType= &xkb->map->types[newTypes[i]];
- if (pNewType->num_levels>pOldType->num_levels)
- nCopy= pOldType->num_levels;
- else nCopy= pNewType->num_levels;
- memcpy(&pSyms[i*width],&oldSyms[i*oldWidth],nCopy*sizeof(KeySym));
- }
- if (XkbKeyHasActions(xkb,key)) {
- XkbAction oldActs[XkbMaxSymsPerKey],*pActs;
- pActs= XkbKeyActionsPtr(xkb,key);
- memcpy(oldActs,pActs,XkbKeyNumSyms(xkb,key)*sizeof(XkbAction));
- pActs= XkbResizeKeyActions(xkb,key,width*nGroups);
- if (pActs==NULL)
- return BadAlloc;
- bzero(pActs,width*nGroups*sizeof(XkbAction));
- for (i=0;(i<nGroups)&&(i<nOldGroups);i++) {
- pOldType= XkbKeyKeyType(xkb,key,i);
- pNewType= &xkb->map->types[newTypes[i]];
- if (pNewType->num_levels>pOldType->num_levels)
- nCopy= pOldType->num_levels;
- else nCopy= pNewType->num_levels;
- memcpy(&pActs[i*width],&oldActs[i*oldWidth],
- nCopy*sizeof(XkbAction));
- }
- }
- i= xkb->map->key_sym_map[key].group_info;
- i= XkbSetNumGroups(i,nGroups);
- xkb->map->key_sym_map[key].group_info= i;
- xkb->map->key_sym_map[key].width= width;
- }
- width= 0;
- for (i=0;i<nGroups;i++) {
- xkb->map->key_sym_map[key].kt_index[i]= newTypes[i];
- if (xkb->map->types[newTypes[i]].num_levels>width)
- width= xkb->map->types[newTypes[i]].num_levels;
- }
- xkb->map->key_sym_map[key].width= width;
- if (changes!=NULL) {
- if (changes->changed&XkbKeySymsMask) {
- _XkbAddKeyChange(&changes->first_key_sym,&changes->num_key_syms,
- key);
- }
- else {
- changes->changed|= XkbKeySymsMask;
- changes->first_key_sym= key;
- changes->num_key_syms= 1;
- }
- }
- return Success;
-}
-
-/***====================================================================***/
-
-Bool
-XkbVirtualModsToReal(XkbDescPtr xkb,unsigned virtual_mask,unsigned *mask_rtrn)
-{
-register int i,bit;
-register unsigned mask;
-
- if (xkb==NULL)
- return False;
- if (virtual_mask==0) {
- *mask_rtrn= 0;
- return True;
- }
- if (xkb->server==NULL)
- return False;
- for (i=mask=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (virtual_mask&bit)
- mask|= xkb->server->vmods[i];
- }
- *mask_rtrn= mask;
- return True;
-}
-
-/***====================================================================***/
-
-Bool
-XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed)
-{
-unsigned int tmp;
-
- switch (act->type) {
- case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
- if (((tmp= XkbModActionVMods(&act->mods))&changed)!=0) {
- XkbVirtualModsToReal(xkb,tmp,&tmp);
- act->mods.mask= act->mods.real_mods;
- act->mods.mask|= tmp;
- return True;
- }
- break;
- case XkbSA_ISOLock:
- if ((((tmp= XkbModActionVMods(&act->iso))!=0)&changed)!=0) {
- XkbVirtualModsToReal(xkb,tmp,&tmp);
- act->iso.mask= act->iso.real_mods;
- act->iso.mask|= tmp;
- return True;
- }
- break;
- }
- return False;
-}
-
-void
-XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb,
- XkbKeyTypePtr type,
- unsigned int changed,
- XkbChangesPtr changes)
-{
-register unsigned int i;
-unsigned int mask;
-
- XkbVirtualModsToReal(xkb,type->mods.vmods,&mask);
- type->mods.mask= type->mods.real_mods|mask;
- if ((type->map_count>0)&&(type->mods.vmods!=0)) {
- XkbKTMapEntryPtr entry;
- for (i=0,entry=type->map;i<type->map_count;i++,entry++) {
- if (entry->mods.vmods!=0) {
- XkbVirtualModsToReal(xkb,entry->mods.vmods,&mask);
- entry->mods.mask=entry->mods.real_mods|mask;
- /* entry is active if vmods are bound*/
- entry->active= (mask!=0);
- }
- else entry->active= 1;
- }
- }
- if (changes) {
- int type_ndx;
- type_ndx= type-xkb->map->types;
- if ((type_ndx<0)||(type_ndx>xkb->map->num_types))
- return;
- if (changes->map.changed&XkbKeyTypesMask) {
- int last;
- last= changes->map.first_type+changes->map.num_types-1;
- if (type_ndx<changes->map.first_type) {
- changes->map.first_type= type_ndx;
- changes->map.num_types= (last-type_ndx)+1;
- }
- else if (type_ndx>last) {
- changes->map.num_types= (type_ndx-changes->map.first_type)+1;
- }
- }
- else {
- changes->map.changed|= XkbKeyTypesMask;
- changes->map.first_type= type_ndx;
- changes->map.num_types= 1;
- }
- }
- return;
-}
-
-Bool
-XkbApplyVirtualModChanges(XkbDescPtr xkb,unsigned changed,XkbChangesPtr changes)
-{
-register int i;
-unsigned int checkState = 0;
-
- if ((!xkb) || (!xkb->map) || (changed==0))
- return False;
- for (i=0;i<xkb->map->num_types;i++) {
- if (xkb->map->types[i].mods.vmods & changed)
- XkbUpdateKeyTypeVirtualMods(xkb,&xkb->map->types[i],changed,changes);
- }
- if (changed&xkb->ctrls->internal.vmods) {
- unsigned int newMask;
- XkbVirtualModsToReal(xkb,xkb->ctrls->internal.vmods,&newMask);
- newMask|= xkb->ctrls->internal.real_mods;
- if (xkb->ctrls->internal.mask!=newMask) {
- xkb->ctrls->internal.mask= newMask;
- if (changes) {
- changes->ctrls.changed_ctrls|= XkbInternalModsMask;
- checkState= True;
- }
- }
- }
- if (changed&xkb->ctrls->ignore_lock.vmods) {
- unsigned int newMask;
- XkbVirtualModsToReal(xkb,xkb->ctrls->ignore_lock.vmods,&newMask);
- newMask|= xkb->ctrls->ignore_lock.real_mods;
- if (xkb->ctrls->ignore_lock.mask!=newMask) {
- xkb->ctrls->ignore_lock.mask= newMask;
- if (changes) {
- changes->ctrls.changed_ctrls|= XkbIgnoreLockModsMask;
- checkState= True;
- }
- }
- }
- if (xkb->indicators!=NULL) {
- XkbIndicatorMapPtr map;
- map= &xkb->indicators->maps[0];
- for (i=0;i<XkbNumIndicators;i++,map++) {
- if (map->mods.vmods&changed) {
- unsigned int newMask;
- XkbVirtualModsToReal(xkb,map->mods.vmods,&newMask);
- newMask|= map->mods.real_mods;
- if (newMask!=map->mods.mask) {
- map->mods.mask= newMask;
- if (changes) {
- changes->indicators.map_changes|= (1<<i);
- checkState= True;
- }
- }
- }
- }
- }
- if (xkb->compat!=NULL) {
- XkbCompatMapPtr compat;
- compat= xkb->compat;
- for (i=0;i<XkbNumKbdGroups;i++) {
- unsigned int newMask;
- XkbVirtualModsToReal(xkb,compat->groups[i].vmods,&newMask);
- newMask|= compat->groups[i].real_mods;
- if (compat->groups[i].mask!=newMask) {
- compat->groups[i].mask= newMask;
- if (changes) {
- changes->compat.changed_groups|= (1<<i);
- checkState= True;
- }
- }
- }
- }
- if (xkb->map && xkb->server) {
- int highChange = 0, lowChange = -1;
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (XkbKeyHasActions(xkb,i)) {
- register XkbAction *pAct;
- register int n;
-
- pAct= XkbKeyActionsPtr(xkb,i);
- for (n=XkbKeyNumActions(xkb,i);n>0;n--,pAct++) {
- if ((pAct->type!=XkbSA_NoAction)&&
- XkbUpdateActionVirtualMods(xkb,pAct,changed)) {
- if (lowChange<0)
- lowChange= i;
- highChange= i;
- }
- }
- }
- }
- if (changes && (lowChange>0)) { /* something changed */
- if (changes->map.changed&XkbKeyActionsMask) {
- int last;
- if (changes->map.first_key_act<lowChange)
- lowChange= changes->map.first_key_act;
- last= changes->map.first_key_act+changes->map.num_key_acts-1;
- if (last>highChange)
- highChange= last;
- }
- changes->map.changed|= XkbKeyActionsMask;
- changes->map.first_key_act= lowChange;
- changes->map.num_key_acts= (highChange-lowChange)+1;
- }
- }
- return checkState;
-}
diff --git a/xkb/ddxBeep.c b/xkb/ddxBeep.c
deleted file mode 100644
index bb02619f3..000000000
--- a/xkb/ddxBeep.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/* $Xorg: ddxBeep.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxBeep.c,v 3.10 2003/11/17 22:20:44 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-#if (defined(__osf__) && defined(__alpha))
-#include <sys/sysinfo.h>
-#include <alpha/hal_sysinfo.h>
-#include <alpha/prom.h>
-#endif
-
-/*#define FALLING_TONE 1*/
-/*#define RISING_TONE 1*/
-#define FALLING_TONE 10
-#define RISING_TONE 10
-#define SHORT_TONE 50
-#define SHORT_DELAY 60
-#define LONG_TONE 75
-#define VERY_LONG_TONE 100
-#define LONG_DELAY 85
-#define CLICK_DURATION 1
-
-#define DEEP_PITCH 250
-#define LOW_PITCH 500
-#define MID_PITCH 1000
-#define HIGH_PITCH 2000
-#define CLICK_PITCH 1500
-
-static unsigned long atomGeneration= 0;
-static Atom featureOn;
-static Atom featureOff;
-static Atom featureChange;
-static Atom ledOn;
-static Atom ledOff;
-static Atom ledChange;
-static Atom slowWarn;
-static Atom slowPress;
-static Atom slowReject;
-static Atom slowAccept;
-static Atom slowRelease;
-static Atom stickyLatch;
-static Atom stickyLock;
-static Atom stickyUnlock;
-static Atom bounceReject;
-static char doesPitch = 1;
-
-#define FEATURE_ON "AX_FeatureOn"
-#define FEATURE_OFF "AX_FeatureOff"
-#define FEATURE_CHANGE "AX_FeatureChange"
-#define LED_ON "AX_IndicatorOn"
-#define LED_OFF "AX_IndicatorOff"
-#define LED_CHANGE "AX_IndicatorChange"
-#define SLOW_WARN "AX_SlowKeysWarning"
-#define SLOW_PRESS "AX_SlowKeyPress"
-#define SLOW_REJECT "AX_SlowKeyReject"
-#define SLOW_ACCEPT "AX_SlowKeyAccept"
-#define SLOW_RELEASE "AX_SlowKeyRelease"
-#define STICKY_LATCH "AX_StickyLatch"
-#define STICKY_LOCK "AX_StickyLock"
-#define STICKY_UNLOCK "AX_StickyUnlock"
-#define BOUNCE_REJECT "AX_BounceKeyReject"
-
-#define MAKE_ATOM(a) MakeAtom(a,sizeof(a)-1,True)
-
-static void
-_XkbDDXBeepInitAtoms(void)
-{
- featureOn= MAKE_ATOM(FEATURE_ON);
- featureOff= MAKE_ATOM(FEATURE_OFF);
- featureChange= MAKE_ATOM(FEATURE_CHANGE);
- ledOn= MAKE_ATOM(LED_ON);
- ledOff= MAKE_ATOM(LED_OFF);
- ledChange= MAKE_ATOM(LED_CHANGE);
- slowWarn= MAKE_ATOM(SLOW_WARN);
- slowPress= MAKE_ATOM(SLOW_PRESS);
- slowReject= MAKE_ATOM(SLOW_REJECT);
- slowAccept= MAKE_ATOM(SLOW_ACCEPT);
- slowRelease= MAKE_ATOM(SLOW_RELEASE);
- stickyLatch= MAKE_ATOM(STICKY_LATCH);
- stickyLock= MAKE_ATOM(STICKY_LOCK);
- stickyUnlock= MAKE_ATOM(STICKY_UNLOCK);
- bounceReject= MAKE_ATOM(BOUNCE_REJECT);
-#if (defined(__osf__) && defined(__alpha))
- /* [[[ WDW - Some bells do not allow for pitch changes.
- * Maybe this could become part of the keymap? ]]]
- */
- {
- char keyboard[8];
-
- /* Find the class of keyboard being used.
- */
- keyboard[0] = '\0';
- if (-1 == getsysinfo(GSI_KEYBOARD,
- keyboard, sizeof(keyboard),
- 0, NULL))
- keyboard[0] = '\0';
-
- if ((strcmp(keyboard,"LK201") == 0) ||
- (strcmp(keyboard,"LK401") == 0) ||
- (strcmp(keyboard,"LK421") == 0) ||
- (strcmp(keyboard,"LK443") == 0))
- doesPitch = 0;
- }
-#else
-#if defined(sun)
- doesPitch = 0;
-#endif
-#endif
- return;
-}
-
-static CARD32
-_XkbDDXBeepExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-DeviceIntPtr dev= (DeviceIntPtr)arg;
-KbdFeedbackPtr feed;
-KeybdCtrl * ctrl;
-XkbSrvInfoPtr xkbInfo;
-CARD32 next;
-int pitch,duration;
-int oldPitch,oldDuration;
-Atom name;
-
- if ((dev==NULL)||(dev->key==NULL)||(dev->key->xkbInfo==NULL)||
- (dev->kbdfeed==NULL))
- return 0;
- if (atomGeneration!=serverGeneration) {
- _XkbDDXBeepInitAtoms();
- atomGeneration= serverGeneration;
- }
-
- feed= dev->kbdfeed;
- ctrl= &feed->ctrl;
- xkbInfo= dev->key->xkbInfo;
- next= 0;
- pitch= oldPitch= ctrl->bell_pitch;
- duration= oldDuration= ctrl->bell_duration;
-#ifdef DEBUG
- if (xkbDebugFlags>1)
- ErrorF("beep: %d (count= %d)\n",xkbInfo->beepType,xkbInfo->beepCount);
-#endif
- name= None;
- switch (xkbInfo->beepType) {
- default:
- ErrorF("Unknown beep type %d\n",xkbInfo->beepType);
- case _BEEP_NONE:
- duration= 0;
- break;
-
- /* When an LED is turned on, we want a high-pitched beep.
- * When the LED it turned off, we want a low-pitched beep.
- * If we cannot do pitch, we want a single beep for on and two
- * beeps for off.
- */
- case _BEEP_LED_ON:
- if (name==None) name= ledOn;
- duration= SHORT_TONE;
- pitch= HIGH_PITCH;
- break;
- case _BEEP_LED_OFF:
- if (name==None) name= ledOff;
- duration= SHORT_TONE;
- pitch= LOW_PITCH;
- if (!doesPitch && xkbInfo->beepCount<1)
- next = SHORT_DELAY;
- break;
-
- /* When a Feature is turned on, we want an up-siren.
- * When a Feature is turned off, we want a down-siren.
- * If we cannot do pitch, we want a single beep for on and two
- * beeps for off.
- */
- case _BEEP_FEATURE_ON:
- if (name==None) name= featureOn;
- if (xkbInfo->beepCount<1) {
- pitch= LOW_PITCH;
- duration= VERY_LONG_TONE;
- if (doesPitch)
- next= SHORT_DELAY;
- }
- else {
- pitch= MID_PITCH;
- duration= SHORT_TONE;
- }
- break;
-
- case _BEEP_FEATURE_OFF:
- if (name==None) name= featureOff;
- if (xkbInfo->beepCount<1) {
- pitch= MID_PITCH;
- if (doesPitch)
- duration= VERY_LONG_TONE;
- else duration= SHORT_TONE;
- next= SHORT_DELAY;
- }
- else {
- pitch= LOW_PITCH;
- duration= SHORT_TONE;
- }
- break;
-
- /* Two high beeps indicate an LED or Feature changed
- * state, but that another LED or Feature is also on.
- * [[[WDW - This is not in AccessDOS ]]]
- */
- case _BEEP_LED_CHANGE:
- if (name==None) name= ledChange;
- case _BEEP_FEATURE_CHANGE:
- if (name==None) name= featureChange;
- duration= SHORT_TONE;
- pitch= HIGH_PITCH;
- if (xkbInfo->beepCount<1) {
- next= SHORT_DELAY;
- }
- break;
-
- /* Three high-pitched beeps are the warning that SlowKeys
- * is going to be turned on or off.
- */
- case _BEEP_SLOW_WARN:
- if (name==None) name= slowWarn;
- duration= SHORT_TONE;
- pitch= HIGH_PITCH;
- if (xkbInfo->beepCount<2)
- next= SHORT_DELAY;
- break;
-
- /* Click on SlowKeys press and accept.
- * Deep pitch when a SlowKey or BounceKey is rejected.
- * [[[WDW - Rejects are not in AccessDOS ]]]
- * If we cannot do pitch, we want single beeps.
- */
- case _BEEP_SLOW_PRESS:
- if (name==None) name= slowPress;
- case _BEEP_SLOW_ACCEPT:
- if (name==None) name= slowAccept;
- case _BEEP_SLOW_RELEASE:
- if (name==None) name= slowRelease;
- duration= CLICK_DURATION;
- pitch= CLICK_PITCH;
- break;
- case _BEEP_BOUNCE_REJECT:
- if (name==None) name= bounceReject;
- case _BEEP_SLOW_REJECT:
- if (name==None) name= slowReject;
- duration= SHORT_TONE;
- pitch= DEEP_PITCH;
- break;
-
- /* Low followed by high pitch when a StickyKey is latched.
- * High pitch when a StickyKey is locked.
- * Low pitch when unlocked.
- * If we cannot do pitch, two beeps for latch, nothing for
- * lock, and two for unlock.
- */
- case _BEEP_STICKY_LATCH:
- if (name==None) name= stickyLatch;
- duration= SHORT_TONE;
- if (xkbInfo->beepCount<1) {
- next= SHORT_DELAY;
- pitch= LOW_PITCH;
- }
- else pitch= HIGH_PITCH;
- break;
- case _BEEP_STICKY_LOCK:
- if (name==None) name= stickyLock;
- if (doesPitch) {
- duration= SHORT_TONE;
- pitch= HIGH_PITCH;
- }
- break;
- case _BEEP_STICKY_UNLOCK:
- if (name==None) name= stickyUnlock;
- duration= SHORT_TONE;
- pitch= LOW_PITCH;
- if (!doesPitch && xkbInfo->beepCount<1)
- next = SHORT_DELAY;
- break;
- }
- if (timer == NULL && duration>0) {
- CARD32 starttime = GetTimeInMillis();
- CARD32 elapsedtime;
-
- ctrl->bell_duration= duration;
- ctrl->bell_pitch= pitch;
- if (xkbInfo->beepCount==0) {
- XkbHandleBell(0,0,dev,ctrl->bell,(pointer)ctrl,KbdFeedbackClass,name,None,
- NULL);
- }
- else if (xkbInfo->desc->ctrls->enabled_ctrls&XkbAudibleBellMask) {
- (*dev->kbdfeed->BellProc)(ctrl->bell,dev,(pointer)ctrl,KbdFeedbackClass);
- }
- ctrl->bell_duration= oldDuration;
- ctrl->bell_pitch= oldPitch;
- xkbInfo->beepCount++;
-
- /* Some DDX schedule the beep and return immediately, others don't
- return until the beep is completed. We measure the time and if
- it's less than the beep duration, make sure not to schedule the
- next beep until after the current one finishes. */
-
- elapsedtime = GetTimeInMillis();
- if (elapsedtime > starttime) { /* watch out for millisecond counter
- overflow! */
- elapsedtime -= starttime;
- } else {
- elapsedtime = 0;
- }
- if (elapsedtime < duration) {
- next += duration - elapsedtime;
- }
-
- }
- return next;
-}
-
-int
-XkbDDXAccessXBeep(DeviceIntPtr dev,unsigned what,unsigned which)
-{
-XkbSrvInfoRec *xkbInfo= dev->key->xkbInfo;
-CARD32 next;
-
- xkbInfo->beepType= what;
- xkbInfo->beepCount= 0;
- next= _XkbDDXBeepExpire(NULL,0,(pointer)dev);
- if (next>0) {
- xkbInfo->beepTimer= TimerSet(xkbInfo->beepTimer,
- 0, next,
- _XkbDDXBeepExpire, (pointer)dev);
- }
- return 1;
-}
diff --git a/xkb/ddxConfig.c b/xkb/ddxConfig.c
deleted file mode 100644
index 2485488d2..000000000
--- a/xkb/ddxConfig.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $Xorg: ddxConfig.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxConfig.c,v 3.9 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "os.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include <X11/extensions/XKBconfig.h>
-
-Bool
-XkbDDXApplyConfig(XPointer cfg_in,XkbSrvInfoPtr info)
-{
-XkbConfigRtrnPtr rtrn;
-XkbDescPtr xkb;
-Bool ok;
-XkbEventCauseRec cause;
-
- xkb= info->desc;
- rtrn= (XkbConfigRtrnPtr)cfg_in;
- if (rtrn==NULL)
- return True;
- ok= XkbCFApplyRtrnValues(rtrn,XkbCFDflts,xkb);
- if (rtrn->initial_mods.replace) {
- info->state.locked_mods= rtrn->initial_mods.mods;
- }
- else {
- info->state.locked_mods|= rtrn->initial_mods.mods;
- if (rtrn->initial_mods.mods_clear)
- info->state.locked_mods&= ~rtrn->initial_mods.mods_clear;
- }
- XkbComputeDerivedState(info);
- XkbSetCauseUnknown(&cause);
- XkbUpdateIndicators(info->device,XkbAllIndicatorsMask,False,NULL,&cause);
- if (info->device && info->device->kbdfeed) {
- DeviceIntPtr dev;
- KeybdCtrl newCtrl;
- dev= info->device;
- newCtrl= dev->kbdfeed->ctrl;
- if (rtrn->click_volume>=0)
- newCtrl.click= rtrn->click_volume;
- if (rtrn->bell_volume>=0)
- newCtrl.bell= rtrn->bell_volume;
- if (rtrn->bell_pitch>0)
- newCtrl.bell_pitch= rtrn->bell_pitch;
- if (rtrn->bell_duration>0)
- newCtrl.bell_duration= rtrn->bell_duration;
- if (dev->kbdfeed->CtrlProc)
- (*dev->kbdfeed->CtrlProc)(dev,&newCtrl);
- }
- XkbCFFreeRtrn(rtrn,XkbCFDflts,xkb);
- return ok;
-}
-
-XPointer
-XkbDDXPreloadConfig( char ** rulesRtrn,
- XkbRF_VarDefsPtr defs,
- XkbComponentNamesPtr names,
- DeviceIntPtr dev)
-{
-char buf[PATH_MAX];
-char * dName;
-FILE * file;
-XkbConfigRtrnPtr rtrn;
-
-#if defined(MetroLink)
- if (dev && dev->name)
- dName= dev->name;
- else dName= "";
- /* It doesn't appear that XkbBaseDirectory could ever get set to NULL */
- sprintf(buf,"%s/X%s-config%s%s",XkbBaseDirectory,display,
- (dName[0]?".":""),dName);
-#else
- if (dev && dev->name)
- dName= dev->name;
- else dName= "";
- if (XkbBaseDirectory!=NULL) {
- if (strlen(XkbBaseDirectory)+strlen(display)
- +strlen(dName)+10+(dName[0]?1:0) > PATH_MAX)
- {
-#ifdef DEBUG
- ErrorF("path exceeds max length\n");
-#endif
- return NULL;
- }
- sprintf(buf,"%s/X%s-config%s%s",XkbBaseDirectory,display,
- (dName[0]?".":""),dName);
- }
- else {
- if (strlen(display)+strlen(dName)+10+(dName[0]?1:0) > PATH_MAX)
- {
-#ifdef DEBUG
- ErrorF("path exceeds max length\n");
-#endif
- return NULL;
- }
- sprintf(buf,"X%s-config%s%s",display,(dName[0]?".":""),dName);
- }
-#endif
-#ifdef __UNIXOS2__
- strcpy(buf,(char*)__XOS2RedirRoot(buf));
-#endif
-#ifdef DEBUG
- ErrorF("Looking for keyboard configuration in %s...",buf);
-#endif
- file= fopen(buf,"r");
- if (file==NULL) {
-#ifdef DEBUG
- ErrorF("file not found\n");
-#endif
- return NULL;
- }
- rtrn= _XkbTypedCalloc(1,XkbConfigRtrnRec);
- if (rtrn!=NULL) {
- if (!XkbCFParse(file,XkbCFDflts,NULL,rtrn)) {
-#ifdef DEBUG
- ErrorF("error\n");
-#endif
- ErrorF("Error parsing config file: ");
- XkbCFReportError(stderr,buf,rtrn->error,rtrn->line);
- _XkbFree(rtrn);
- fclose(file);
- return NULL;
- }
-#ifdef DEBUG
- ErrorF("found it\n");
-#endif
- if (rtrn->rules_file) {
- *rulesRtrn= rtrn->rules_file;
- rtrn->rules_file= NULL;
- }
- if (rtrn->model) {
- defs->model= rtrn->model;
- rtrn->model= NULL;
- }
- if (rtrn->layout) {
- defs->layout= rtrn->layout;
- rtrn->layout= NULL;
- }
- if (rtrn->variant) {
- defs->variant= rtrn->variant;
- rtrn->variant= NULL;
- }
- if (rtrn->options) {
- defs->options= rtrn->options;
- rtrn->options= NULL;
- }
- XkbSetRulesUsed(defs);
-
- if (rtrn->keycodes!=NULL) {
- if (names->keycodes) _XkbFree(names->keycodes);
- names->keycodes= rtrn->keycodes;
- rtrn->keycodes= NULL;
- }
- if (rtrn->geometry!=NULL) {
- if (names->geometry) _XkbFree(names->geometry);
- names->geometry= rtrn->geometry;
- rtrn->geometry= NULL;
- }
- if (rtrn->symbols!=NULL) {
- if (rtrn->phys_symbols==NULL)
- rtrn->phys_symbols= _XkbDupString(names->symbols);
- if (names->symbols) _XkbFree(names->symbols);
- names->symbols= rtrn->symbols;
- rtrn->symbols= NULL;
- }
- if (rtrn->types!=NULL) {
- if (names->types) _XkbFree(names->types);
- names->types= rtrn->types;
- rtrn->types= NULL;
- }
- if (rtrn->compat!=NULL) {
- if (names->compat) _XkbFree(names->compat);
- names->compat= rtrn->compat;
- rtrn->compat= NULL;
- }
- }
- fclose(file);
- return (XPointer)rtrn;
-}
diff --git a/xkb/ddxCtrls.c b/xkb/ddxCtrls.c
deleted file mode 100644
index c7c8f18b8..000000000
--- a/xkb/ddxCtrls.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $Xorg: ddxCtrls.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxCtrls.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-void
-XkbDDXKeybdCtrlProc(DeviceIntPtr dev,KeybdCtrl *ctrl)
-{
-int realRepeat;
-
- realRepeat= ctrl->autoRepeat;
- if ((dev->kbdfeed)&&(XkbDDXUsesSoftRepeat(dev)))
- ctrl->autoRepeat= 0;
-#ifdef DEBUG
-if (xkbDebugFlags&0x4) {
- ErrorF("XkbDDXKeybdCtrlProc: setting repeat to %d (real repeat is %d)\n",
- ctrl->autoRepeat,realRepeat);
-}
-#endif
- if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc)
- (*dev->key->xkbInfo->kbdProc)(dev,ctrl);
- ctrl->autoRepeat= realRepeat;
- return;
-}
-
-
-int
-XkbDDXUsesSoftRepeat(DeviceIntPtr pXDev)
-{
-#ifndef XKB_ALWAYS_USES_SOFT_REPEAT
- if (pXDev && pXDev->kbdfeed ) {
- if (pXDev->kbdfeed->ctrl.autoRepeat) {
- if (pXDev->key && pXDev->key->xkbInfo) {
- XkbDescPtr xkb;
- xkb= pXDev->key->xkbInfo->desc;
- if ((xkb->ctrls->repeat_delay == 660) &&
- (xkb->ctrls->repeat_interval == 40) &&
- ((xkb->ctrls->enabled_ctrls&(XkbSlowKeysMask|
- XkbBounceKeysMask|
- XkbMouseKeysMask))==0)) {
- return 0;
- }
- return ((xkb->ctrls->enabled_ctrls&XkbRepeatKeysMask)!=0);
- }
- }
- }
- return 0;
-#else
- return 1;
-#endif
-}
-
-void
-XkbDDXChangeControls(DeviceIntPtr dev,XkbControlsPtr old,XkbControlsPtr new)
-{
-unsigned changed, i;
-unsigned char *rep_old, *rep_new, *rep_fb;
-
- changed= new->enabled_ctrls^old->enabled_ctrls;
-#ifdef NOTDEF
- if (changed&XkbRepeatKeysMask) {
- if (dev->kbdfeed) {
- int realRepeat;
-
- if (new->enabled_ctrls&XkbRepeatKeysMask)
- dev->kbdfeed->ctrl.autoRepeat= realRepeat= 1;
- else dev->kbdfeed->ctrl.autoRepeat= realRepeat= 0;
-
- if (XkbDDXUsesSoftRepeat(dev))
- dev->kbdfeed->ctrl.autoRepeat= FALSE;
- if (dev->kbdfeed->CtrlProc)
- (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
- dev->kbdfeed->ctrl.autoRepeat= realRepeat;
- }
- }
-#endif
- for (rep_old = old->per_key_repeat,
- rep_new = new->per_key_repeat,
- rep_fb = dev->kbdfeed->ctrl.autoRepeats,
- i = 0; i < XkbPerKeyBitArraySize; i++) {
- if (rep_old[i] != rep_new[i]) {
- rep_fb[i] = rep_new[i];
- changed &= XkbPerKeyRepeatMask;
- }
- }
-
- if (changed&XkbPerKeyRepeatMask) {
- if (dev->kbdfeed->CtrlProc)
- (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
- }
- return;
-}
-
diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
deleted file mode 100644
index 5f5ebc9b4..000000000
--- a/xkb/ddxDevBtn.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $Xorg: ddxDevBtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxDevBtn.c,v 3.4 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-#include "XIproto.h"
-
-extern int DeviceValuator;
-
-void
-XkbDDXFakeDeviceButton(DeviceIntPtr dev,Bool press,int button)
-{
-int * devVal;
-INT32 * evVal;
-xEvent events[2];
-deviceKeyButtonPointer *btn;
-deviceValuator * val;
-int x,y;
-int nAxes, i, count;
-
- if ((dev==(DeviceIntPtr)LookupPointerDevice())||(!dev->public.on))
- return;
-
- nAxes = (dev->valuator?dev->valuator->numAxes:0);
- if (nAxes > 6)
- nAxes = 6;
-
- GetSpritePosition(&x,&y);
- btn= (deviceKeyButtonPointer *) &events[0];
- val= (deviceValuator *) &events[1];
- if (press) btn->type= DeviceButtonPress;
- else btn->type= DeviceButtonRelease;
- btn->detail= button;
- btn->time= GetTimeInMillis();
- btn->root_x= x;
- btn->root_y= y;
- btn->deviceid= dev->id;
- count= 1;
- if (nAxes>0) {
- btn->deviceid|= 0x80;
- val->type = DeviceValuator;
- val->deviceid = dev->id;
- val->first_valuator = 0;
-
- evVal= &val->valuator0;
- devVal= dev->valuator->axisVal;
- for (i=nAxes;i>0;i--) {
- *evVal++ = *devVal++;
- if (evVal > &val->valuator5) {
- int tmp = val->first_valuator+6;
- val->num_valuators = 6;
- val++;
- evVal= &val->valuator0;
- val->first_valuator= tmp;
- }
- }
- if ((nAxes % 6) != 0) {
- val->num_valuators = (nAxes % 6);
- }
- count= 1+((nAxes+5)/6);
- }
-
- (*dev->public.processInputProc)((xEventPtr)btn, dev, count);
- return;
-}
diff --git a/xkb/ddxFakeBtn.c b/xkb/ddxFakeBtn.c
deleted file mode 100644
index 9f54cae6f..000000000
--- a/xkb/ddxFakeBtn.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $Xorg: ddxFakeBtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxFakeBtn.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-void
-XkbDDXFakePointerButton(int event,int button)
-{
-xEvent ev;
-int x,y;
-DevicePtr ptr;
-
- if ((ptr = LookupPointerDevice())==NULL)
- return;
- GetSpritePosition(&x,&y);
- ev.u.u.type = event;
- ev.u.u.detail = button;
- ev.u.keyButtonPointer.time = GetTimeInMillis();
- ev.u.keyButtonPointer.rootX = x;
- ev.u.keyButtonPointer.rootY = y;
- (*ptr->processInputProc)( &ev, (DeviceIntPtr)ptr, 1 );
- return;
-}
diff --git a/xkb/ddxFakeMtn.c b/xkb/ddxFakeMtn.c
deleted file mode 100644
index 289fa3bfb..000000000
--- a/xkb/ddxFakeMtn.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* $Xorg: ddxFakeMtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxFakeMtn.c,v 1.6 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-#include "mipointer.h"
-#include "mipointrst.h"
-
-void
-XkbDDXFakePointerMotion(unsigned flags,int x,int y)
-{
-int oldX,oldY;
-ScreenPtr pScreen, oldScreen;
-
- GetSpritePosition(&oldX, &oldY);
- pScreen = oldScreen = GetSpriteWindow()->drawable.pScreen;
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- BoxRec box;
- int i;
-
- if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- oldX, oldY, &box)) {
- FOR_NSCREENS(i) {
- if(i == pScreen->myNum)
- continue;
- if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i],
- oldX, oldY, &box)) {
- pScreen = screenInfo.screens[i];
- break;
- }
- }
- }
- oldScreen = pScreen;
-
- if (flags&XkbSA_MoveAbsoluteX)
- oldX= x;
- else oldX+= x;
- if (flags&XkbSA_MoveAbsoluteY)
- oldY= y;
- else oldY+= y;
-
- if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- oldX, oldY, &box)) {
- FOR_NSCREENS(i) {
- if(i == pScreen->myNum)
- continue;
- if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i],
- oldX, oldY, &box)) {
- pScreen = screenInfo.screens[i];
- break;
- }
- }
- }
- oldX -= panoramiXdataPtr[pScreen->myNum].x;
- oldY -= panoramiXdataPtr[pScreen->myNum].y;
- }
- else
-#endif
- {
- if (flags&XkbSA_MoveAbsoluteX)
- oldX= x;
- else oldX+= x;
- if (flags&XkbSA_MoveAbsoluteY)
- oldY= y;
- else oldY+= y;
-
-#define GetScreenPrivate(s) ((miPointerScreenPtr) ((s)->devPrivates[miPointerScreenIndex].ptr))
- (*(GetScreenPrivate(oldScreen))->screenFuncs->CursorOffScreen)
- (&pScreen, &oldX, &oldY);
- }
-
- if (pScreen != oldScreen)
- NewCurrentScreen(pScreen, oldX, oldY);
- if (pScreen->SetCursorPosition)
- (*pScreen->SetCursorPosition)(pScreen, oldX, oldY, TRUE);
-}
diff --git a/xkb/ddxInit.c b/xkb/ddxInit.c
deleted file mode 100644
index a8c436ea2..000000000
--- a/xkb/ddxInit.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Xorg: ddxInit.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxInit.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-int
-XkbDDXInitDevice(DeviceIntPtr dev)
-{
- return 1;
-}
diff --git a/xkb/ddxKeyClick.c b/xkb/ddxKeyClick.c
deleted file mode 100644
index afd028fcd..000000000
--- a/xkb/ddxKeyClick.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $Xorg: ddxKeyClick.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxKeyClick.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-void
-XkbDDXKeyClick(DeviceIntPtr pXDev,int keycode,int synthetic)
-{
-#ifdef DEBUG
- if (xkbDebugFlags)
- ErrorF("Click.\n");
-#endif
- return;
-}
diff --git a/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c
deleted file mode 100644
index 9ac7d3300..000000000
--- a/xkb/ddxKillSrv.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $Xorg: ddxKillSrv.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-#ifdef XF86DDXACTIONS
-#include "xf86.h"
-#endif
-
-int
-XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
-{
-#ifdef XF86DDXACTIONS
- xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
-#else
- GiveUp(1);
-#endif
- return 0;
-}
diff --git a/xkb/ddxLEDs.c b/xkb/ddxLEDs.c
deleted file mode 100644
index ab757c6fc..000000000
--- a/xkb/ddxLEDs.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $Xorg: ddxLEDs.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxLEDs.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-void
-XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new)
-{
- dev->kbdfeed->ctrl.leds= new;
- (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
- return;
-}
-
-void
-XkbDDXUpdateDeviceIndicators( DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- CARD32 new)
-{
- if (sli->fb.kf==dev->kbdfeed)
- XkbDDXUpdateIndicators(dev,new);
- else if (sli->class==KbdFeedbackClass) {
- KbdFeedbackPtr kf;
- kf= sli->fb.kf;
- if (kf && kf->CtrlProc) {
- (*kf->CtrlProc)(dev,&kf->ctrl);
- }
- }
- else if (sli->class==LedFeedbackClass) {
- LedFeedbackPtr lf;
- lf= sli->fb.lf;
- if (lf && lf->CtrlProc) {
- (*lf->CtrlProc)(dev,&lf->ctrl);
- }
- }
- return;
-}
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
deleted file mode 100644
index 5101de53b..000000000
--- a/xkb/ddxList.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* $Xorg: ddxList.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxList.c,v 3.9 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include <X11/extensions/XKM.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "XI.h"
-
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
-/***====================================================================***/
-
-static char *componentDirs[_XkbListNumComponents] = {
- "keymap", "keycodes", "types", "compat", "symbols", "geometry"
-};
-
-/***====================================================================***/
-
-static Status
-_AddListComponent( XkbSrvListInfoPtr list,
- int what,
- unsigned flags,
- char * str,
- ClientPtr client)
-{
-int slen,wlen;
-unsigned char * wire8;
-unsigned short *wire16;
-char * tmp;
-
- if (list->nTotal>=list->maxRtrn) {
- list->nTotal++;
- return Success;
- }
- tmp= strchr(str,')');
- if ((tmp==NULL)&&((tmp=strchr(str,'('))==NULL)) {
- slen= strlen(str);
- while ((slen>0) && isspace(str[slen-1])) {
- slen--;
- }
- }
- else {
- slen= (tmp-str+1);
- }
- wlen= (((slen+1)/2)*2)+4; /* four bytes for flags and length, pad to */
- /* 2-byte boundary */
- if ((list->szPool-list->nPool)<wlen) {
- if (wlen>1024) list->szPool+= XkbPaddedSize(wlen*2);
- else list->szPool+= 1024;
- list->pool= _XkbTypedRealloc(list->pool,list->szPool,char);
- if (!list->pool)
- return BadAlloc;
- }
- wire16= (unsigned short *)&list->pool[list->nPool];
- wire8= (unsigned char *)&wire16[2];
- wire16[0]= flags;
- wire16[1]= slen;
- memcpy(wire8,str,slen);
- if (client->swapped) {
- register int n;
- swaps(&wire16[0],n);
- swaps(&wire16[1],n);
- }
- list->nPool+= wlen;
- list->nFound[what]++;
- list->nTotal++;
- return Success;
-}
-
-/***====================================================================***/
-static Status
-XkbDDXListComponent( DeviceIntPtr dev,
- int what,
- XkbSrvListInfoPtr list,
- ClientPtr client)
-{
-char *file,*map,*tmp,buf[PATH_MAX];
-FILE *in;
-Status status;
-int rval;
-Bool haveDir;
-#ifdef WIN32
-char tmpname[32];
-#endif
-
- if ((list->pattern[what]==NULL)||(list->pattern[what][0]=='\0'))
- return Success;
- file= list->pattern[what];
- map= strrchr(file,'(');
- if (map!=NULL) {
- char *tmp;
- map++;
- tmp= strrchr(map,')');
- if ((tmp==NULL)||(tmp[1]!='\0')) {
- /* illegal pattern. No error, but no match */
- return Success;
- }
- }
-
- in= NULL;
- haveDir= True;
-#ifdef WIN32
- strcpy(tmpname, "\\temp\\xkb_XXXXXX");
- (void) mktemp(tmpname);
-#endif
- if (XkbBaseDirectory!=NULL) {
- if (strlen(XkbBaseDirectory)+strlen(componentDirs[what])+6 > PATH_MAX)
- return BadImplementation;
- if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
- sprintf(buf,"%s/%s.dir",XkbBaseDirectory,componentDirs[what]);
- in= fopen(buf,"r");
- }
- if (!in) {
- haveDir= False;
- if (strlen(XkbBaseDirectory)*2+strlen(componentDirs[what])
- +(xkbDebugFlags>9?2:1)+strlen(file)+31 > PATH_MAX)
- return BadImplementation;
-#ifndef WIN32
- sprintf(buf,"%s/xkbcomp -R%s/%s -w %ld -l -vlfhpR '%s'",
- XkbBaseDirectory,XkbBaseDirectory,componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file);
-#else
- sprintf(buf,"%s/xkbcomp -R%s/%s -w %ld -l -vlfhpR '%s' %s",
- XkbBaseDirectory,XkbBaseDirectory,componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file, tmpname);
-#endif
- }
- }
- else {
- if (strlen(XkbBaseDirectory)+strlen(componentDirs[what])+6 > PATH_MAX)
- return BadImplementation;
- if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
- sprintf(buf,"%s.dir",componentDirs[what]);
- in= fopen(buf,"r");
- }
- if (!in) {
- haveDir= False;
- if (strlen(componentDirs[what])
- +(xkbDebugFlags>9?2:1)+strlen(file)+29 > PATH_MAX)
- return BadImplementation;
-#ifndef WIN32
- sprintf(buf,"xkbcomp -R%s -w %ld -l -vlfhpR '%s'",
- componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file);
-#else
- sprintf(buf,"xkbcomp -R%s -w %ld -l -vlfhpR '%s' %s",
- componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file, tmpname);
-#endif
- }
- }
- status= Success;
- if (!haveDir)
-#ifndef WIN32
- in= Popen(buf,"r");
-#else
- {
- if (System(buf) < 0)
- ErrorF("Could not invoke keymap compiler\n");
- else
- in= fopen(tmpname, "r");
- }
-#endif
- if (!in)
- return BadImplementation;
- list->nFound[what]= 0;
- while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
- unsigned flags;
- register unsigned int i;
- if (*tmp=='#') /* comment, skip it */
- continue;
- if (!strncmp(tmp, "Warning:", 8) || !strncmp(tmp, " ", 8))
- /* skip warnings too */
- continue;
- flags= 0;
- /* each line in the listing is supposed to start with two */
- /* groups of eight characters, which specify the general */
- /* flags and the flags that are specific to the component */
- /* if they're missing, fail with BadImplementation */
- for (i=0;(i<8)&&(status==Success);i++) { /* read the general flags */
- if (isalpha(*tmp)) flags|= (1L<<i);
- else if (*tmp!='-') status= BadImplementation;
- tmp++;
- }
- if (status != Success) break;
- if (!isspace(*tmp)) {
- status= BadImplementation;
- break;
- }
- else tmp++;
- for (i=0;(i<8)&&(status==Success);i++) { /* read the component flags */
- if (isalpha(*tmp)) flags|= (1L<<(i+8));
- else if (*tmp!='-') status= BadImplementation;
- tmp++;
- }
- if (status != Success) break;
- if (isspace(*tmp)) {
- while (isspace(*tmp)) {
- tmp++;
- }
- }
- else {
- status= BadImplementation;
- break;
- }
- status= _AddListComponent(list,what,flags,tmp,client);
- }
-#ifndef WIN32
- if (haveDir)
- fclose(in);
- else if ((rval=pclose(in))!=0) {
- if (xkbDebugFlags)
- ErrorF("xkbcomp returned exit code %d\n",rval);
- }
-#else
- fclose(in);
-#endif
- return status;
-}
-
-/***====================================================================***/
-
-/* ARGSUSED */
-Status
-XkbDDXList(DeviceIntPtr dev,XkbSrvListInfoPtr list,ClientPtr client)
-{
-Status status;
-
- status= XkbDDXListComponent(dev,_XkbListKeymaps,list,client);
- if (status==Success)
- status= XkbDDXListComponent(dev,_XkbListKeycodes,list,client);
- if (status==Success)
- status= XkbDDXListComponent(dev,_XkbListTypes,list,client);
- if (status==Success)
- status= XkbDDXListComponent(dev,_XkbListCompat,list,client);
- if (status==Success)
- status= XkbDDXListComponent(dev,_XkbListSymbols,list,client);
- if (status==Success)
- status= XkbDDXListComponent(dev,_XkbListGeometry,list,client);
- return status;
-}
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
deleted file mode 100644
index 9f7704c5a..000000000
--- a/xkb/ddxLoad.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/* $Xorg: ddxLoad.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.36 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include <X11/extensions/XKM.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "XI.h"
-#include "xkb.h"
-
-#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__)
-#include <paths.h>
-#endif
-
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
- /*
- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
- * relative to the top-level XKB configuration directory.
- * Making the server write to a subdirectory of that directory
- * requires some work in the general case (install procedure
- * has to create links to /var or somesuch on many machines),
- * so we just compile into /usr/tmp for now.
- */
-#ifndef XKM_OUTPUT_DIR
-#define XKM_OUTPUT_DIR "compiled/"
-#endif
-
-#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
-#define ERROR_PREFIX "\"> \""
-#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
-#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\""
-
-static void
-OutputDirectory(
- char* outdir)
-{
-#ifndef WIN32
- if (getuid() == 0) {
- /* if server running as root it *may* be able to write */
- /* FIXME: check whether directory is writable at all */
- (void) strcpy (outdir, XKM_OUTPUT_DIR);
- } else
-#endif
- {
-#ifdef _PATH_VARTMP
- (void) strcpy (outdir, _PATH_VARTMP);
- if (outdir[strlen(outdir) - 1] != '/') /* Hi IBM, Digital */
- (void) strcat (outdir, "/");
-#else
- (void) strcpy (outdir, "/tmp/");
-#endif
- }
-}
-
-Bool
-XkbDDXCompileNamedKeymap( XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- char * nameRtrn,
- int nameRtrnLen)
-{
-char cmd[PATH_MAX],file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
-
- if (names->keymap==NULL)
- return False;
- strncpy(file,names->keymap,PATH_MAX); file[PATH_MAX-1]= '\0';
- if ((map= strrchr(file,'('))!=NULL) {
- char *tmp;
- if ((tmp= strrchr(map,')'))!=NULL) {
- *map++= '\0';
- *tmp= '\0';
- }
- else {
- map= NULL;
- }
- }
- if ((outFile= strrchr(file,'/'))!=NULL)
- outFile= _XkbDupString(&outFile[1]);
- else outFile= _XkbDupString(file);
- XkbEnsureSafeMapName(outFile);
- OutputDirectory(xkm_output_dir);
-
- if (XkbBaseDirectory!=NULL) {
-#ifdef __UNIXOS2__
- char *tmpbase = (char*)__XOS2RedirRoot(XkbBaseDirectory);
- int i;
- if (strlen(tmpbase)*2+(xkbDebugFlags>9?2:1)
-#else
- if (strlen(XkbBaseDirectory)*2+(xkbDebugFlags>9?2:1)
-#endif
- +(map?strlen(map)+3:0)+strlen(PRE_ERROR_MSG)
- +strlen(ERROR_PREFIX)+strlen(POST_ERROR_MSG1)
- +strlen(file)+strlen(xkm_output_dir)
- +strlen(outFile)+53 > PATH_MAX)
- {
- ErrorF("compiler command for keymap (%s) exceeds max length\n",
- names->keymap);
- return False;
- }
-#ifndef __UNIXOS2__
- sprintf(cmd,"%s/xkbcomp -w %d -R%s -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s %s%s.xkm",
- XkbBaseDirectory,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- XkbBaseDirectory,(map?"-m ":""),(map?map:""),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file,
- xkm_output_dir,outFile);
-#else
- for (i=0; i<strlen(tmpbase); i++) if (tmpbase[i]=='/') tmpbase[i]='\\';
- sprintf(cmd,"%s\\xkbcomp -w %d -R%s -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s %s%s.xkm",
- tmpbase,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- tmpbase,(map?"-m ":""),(map?map:""),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file,
- xkm_output_dir,outFile);
- ErrorF("Command line for XKB is %s\n",cmd);
-#endif
- }
- else {
- if ((xkbDebugFlags>9?2:1)+(map?strlen(map)+3:0)+strlen(PRE_ERROR_MSG)
- +strlen(ERROR_PREFIX)+strlen(POST_ERROR_MSG1)
- +strlen(file)+strlen(xkm_output_dir)
- +strlen(outFile)+49 > PATH_MAX)
- {
- ErrorF("compiler command for keymap (%s) exceeds max length\n",
- names->keymap);
- return False;
- }
- sprintf(cmd,"xkbcomp -w %d -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s %s%s.xkm",
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- (map?"-m ":""),(map?map:""),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file,
- xkm_output_dir,outFile);
- }
-#ifdef DEBUG
- if (xkbDebugFlags) {
- ErrorF("XkbDDXCompileNamedKeymap compiling keymap using:\n");
- ErrorF(" \"cmd\"\n");
- }
-#endif
- if (System(cmd)==0) {
- if (nameRtrn) {
- strncpy(nameRtrn,outFile,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
- }
- if (outFile!=NULL)
- _XkbFree(outFile);
- return True;
- }
-#ifdef DEBUG
- ErrorF("Error compiling keymap (%s)\n",names->keymap);
-#endif
- if (outFile!=NULL)
- _XkbFree(outFile);
- return False;
-}
-
-Bool
-XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- char * nameRtrn,
- int nameRtrnLen)
-{
-FILE * out;
-char buf[PATH_MAX],keymap[PATH_MAX],xkm_output_dir[PATH_MAX];
-#ifdef WIN32
-char tmpname[32];
-#endif
-#ifdef __UNIXOS2__
-char *tmpbase;
-int i;
-#endif
- if ((names->keymap==NULL)||(names->keymap[0]=='\0')) {
- sprintf(keymap,"server-%s",display);
- }
- else {
- if (strlen(names->keymap) > PATH_MAX - 1) {
- ErrorF("name of keymap (%s) exceeds max length\n", names->keymap);
- return False;
- }
- strcpy(keymap,names->keymap);
- }
-
- XkbEnsureSafeMapName(keymap);
- OutputDirectory(xkm_output_dir);
-#ifdef WIN32
- strcpy(tmpname, "\\temp\\xkb_XXXXXX");
- (void) mktemp(tmpname);
-#endif
-#ifdef __UNIXOS2__
- tmpbase = (char*)__XOS2RedirRoot(XkbBaseDirectory);
-#endif
- if (XkbBaseDirectory!=NULL) {
- if (strlen(XkbBaseDirectory)*2+(xkbDebugFlags>9?2:1)
- +strlen(PRE_ERROR_MSG)+strlen(ERROR_PREFIX)
- +strlen(POST_ERROR_MSG1)+strlen(xkm_output_dir)
- +strlen(keymap)+48 > PATH_MAX)
- {
- ErrorF("compiler command for keymap (%s) exceeds max length\n",
- names->keymap);
- return False;
- }
-#ifndef WIN32
-#ifndef __UNIXOS2__
- sprintf(buf,
- "%s/xkbcomp -w %d -R%s -xkm - -em1 %s -emp %s -eml %s \"%s%s.xkm\"",
- XkbBaseDirectory,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- XkbBaseDirectory,
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,
- xkm_output_dir,keymap);
-#else
- for (i=0; i<strlen(tmpbase); i++) if (tmpbase[i]=='/') tmpbase[i]='\\';
- sprintf(buf,
- "%s\\xkbcomp -w %d -R%s -xkm - -em1 %s -emp %s -eml %s \"%s%s.xkm\"",
- tmpbase,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- tmpbase,
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,
- xkm_output_dir,keymap);
-#endif
-#else
- sprintf(buf,
- "%s/xkbcomp -w %d -R%s -xkm - -em1 %s -emp %s -eml %s \"%s%s.xkm\" < %s",
- XkbBaseDirectory,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- XkbBaseDirectory,
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,
- xkm_output_dir,keymap,tmpname);
-#endif
- }
- else {
- if ((xkbDebugFlags>9?2:1)+strlen(PRE_ERROR_MSG)
- +strlen(ERROR_PREFIX)+strlen(POST_ERROR_MSG1)
- +strlen(xkm_output_dir)+strlen(keymap)+44 > PATH_MAX)
- {
- ErrorF("compiler command for keymap (%s) exceeds max length\n",
- names->keymap);
- return False;
- }
-#ifndef WIN32
- sprintf(buf,
- "xkbcomp -w %d -xkm - -em1 %s -emp %s -eml %s \"%s%s.xkm\"",
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,
- xkm_output_dir,keymap);
-#else
- sprintf(buf,
- "xkbcomp -w %d -xkm - -em1 %s -emp %s -eml %s \"%s%s.xkm\" < %s",
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,
- xkm_output_dir,keymap,tmpname);
-#endif
- }
-#ifndef WIN32
- out= Popen(buf,"w");
-#else
- out= fopen(tmpname, "w");
-#endif
- if (out!=NULL) {
-#ifdef DEBUG
- if (xkbDebugFlags) {
- ErrorF("XkbDDXCompileKeymapByNames compiling keymap:\n");
- XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need);
- }
-#endif
- XkbWriteXKBKeymapForNames(out,names,NULL,xkb,want,need);
-#ifndef WIN32
- if (Pclose(out)==0)
-#else
- if (fclose(out)==0)
-#endif
- {
-#ifdef WIN32
- if (System(buf) < 0)
- ErrorF("Could not invoke keymap compiler\n");
- else {
-#endif
- if (nameRtrn) {
- strncpy(nameRtrn,keymap,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
- }
-#if defined(Lynx) && defined(__i386__) && defined(NEED_POPEN_WORKAROUND)
- /* somehow popen/pclose is broken on LynxOS AT 2.3.0/2.4.0!
- * the problem usually shows up with XF86Setup
- * this hack waits at max 5 seconds after pclose() returns
- * for the output of the xkbcomp output file.
- * I didn't manage to get a patch in time for the 3.2 release
- */
- {
- int i;
- char name[PATH_MAX];
- if (XkbBaseDirectory!=NULL)
- sprintf(name,"%s/%s%s.xkm", XkbBaseDirectory
- ,xkm_output_dir, keymap);
- else
- sprintf(name,"%s%s.xkm", xkm_output_dir, keymap);
- for (i = 0; i < 10; i++) {
- if (access(name, 0) == 0) break;
- usleep(500000);
- }
-#ifdef DEBUG
- if (i) ErrorF(">>>> Waited %d times for %s\n", i, name);
-#endif
- }
-#endif
- return True;
-#ifdef WIN32
- }
-#endif
- }
-#ifdef DEBUG
- else
- ErrorF("Error compiling keymap (%s)\n",keymap);
-#endif
- }
-#ifdef DEBUG
- else {
-#ifndef WIN32
- ErrorF("Could not invoke keymap compiler\n");
-#else
- ErrorF("Could not open file %s\n", tmpname);
-#endif
- }
-#endif
- if (nameRtrn)
- nameRtrn[0]= '\0';
- return False;
-}
-
-FILE *
-XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen)
-{
-char buf[PATH_MAX],xkm_output_dir[PATH_MAX];
-FILE * file;
-
- buf[0]= '\0';
- if (mapName!=NULL) {
- OutputDirectory(xkm_output_dir);
- if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/')) {
- if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir)
- +strlen(mapName)+6 <= PATH_MAX)
- {
- sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory,
- xkm_output_dir,mapName);
- }
- }
- else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX)
- sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName);
- if (buf[0] != '\0')
- file= fopen(buf,"rb");
- else file= NULL;
- }
- else file= NULL;
- if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) {
- strncpy(fileNameRtrn,buf,fileNameRtrnLen);
- buf[fileNameRtrnLen-1]= '\0';
- }
- return file;
-}
-
-unsigned
-XkbDDXLoadKeymapByNames( DeviceIntPtr keybd,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- XkbFileInfo * finfoRtrn,
- char * nameRtrn,
- int nameRtrnLen)
-{
-XkbDescPtr xkb;
-FILE * file;
-char fileName[PATH_MAX];
-unsigned missing;
-
- bzero(finfoRtrn,sizeof(XkbFileInfo));
- if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL))
- xkb= NULL;
- else xkb= keybd->key->xkbInfo->desc;
- if ((names->keycodes==NULL)&&(names->types==NULL)&&
- (names->compat==NULL)&&(names->symbols==NULL)&&
- (names->geometry==NULL)) {
- if (names->keymap==NULL) {
- bzero(finfoRtrn,sizeof(XkbFileInfo));
- if (xkb && XkbDetermineFileType(finfoRtrn,XkbXKMFile,NULL) &&
- ((finfoRtrn->defined&need)==need) ) {
- finfoRtrn->xkb= xkb;
- nameRtrn[0]= '\0';
- return finfoRtrn->defined;
- }
- return 0;
- }
- else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) {
-#ifdef NOISY
- ErrorF("Couldn't compile keymap file\n");
-#endif
- return 0;
- }
- }
- else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
- nameRtrn,nameRtrnLen)){
-#ifdef NOISY
- ErrorF("Couldn't compile keymap file\n");
-#endif
- return 0;
- }
- file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
- if (file==NULL) {
- LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName);
- return 0;
- }
- missing= XkmReadFile(file,need,want,finfoRtrn);
- if (finfoRtrn->xkb==NULL) {
- LogMessage(X_ERROR, "Error loading keymap %s\n",fileName);
- fclose(file);
- (void) unlink (fileName);
- return 0;
- }
-#ifdef DEBUG
- else if (xkbDebugFlags) {
- ErrorF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined);
- }
-#endif
- fclose(file);
- (void) unlink (fileName);
- return (need|want)&(~missing);
-}
-
-Bool
-XkbDDXNamesFromRules( DeviceIntPtr keybd,
- char * rules_name,
- XkbRF_VarDefsPtr defs,
- XkbComponentNamesPtr names)
-{
-char buf[PATH_MAX];
-FILE * file;
-Bool complete;
-XkbRF_RulesPtr rules;
-
- if (!rules_name)
- return False;
- if (XkbBaseDirectory==NULL) {
- if (strlen(rules_name)+7 > PATH_MAX)
- return False;
- sprintf(buf,"rules/%s",rules_name);
- }
- else {
- if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX)
- return False;
- sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name);
- }
- if ((file= fopen(buf,"r"))==NULL)
- return False;
- if ((rules= XkbRF_Create(0,0))==NULL) {
- fclose(file);
- return False;
- }
- if (!XkbRF_LoadRules(file,rules)) {
- fclose(file);
- XkbRF_Free(rules,True);
- return False;
- }
- bzero((char *)names,sizeof(XkbComponentNamesRec));
- complete= XkbRF_GetComponents(rules,defs,names);
- fclose(file);
- XkbRF_Free(rules,True);
- return complete;
-}
-
-
diff --git a/xkb/ddxPrivate.c b/xkb/ddxPrivate.c
deleted file mode 100644
index dd7ef4630..000000000
--- a/xkb/ddxPrivate.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.3 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include "windowstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-
-#ifdef XF86DDXACTIONS
-#include "xf86.h"
-#endif
-
-int
-XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
-{
-#ifdef XF86DDXACTIONS
- XkbAnyAction *xf86act = &(act->any);
- char msgbuf[XkbAnyActionDataSize+1];
-
- if (xf86act->type == XkbSA_XFree86Private) {
- memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
- msgbuf[XkbAnyActionDataSize]= '\0';
- if (_XkbStrCaseCmp(msgbuf, "-vmode")==0)
- xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
- else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0)
- xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
- else if (_XkbStrCaseCmp(msgbuf, "ungrab")==0)
- xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
- else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0)
- xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
- else
- xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);
- }
-#endif
- return 0;
-}
-
diff --git a/xkb/ddxVT.c b/xkb/ddxVT.c
deleted file mode 100644
index ec43f79db..000000000
--- a/xkb/ddxVT.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $Xorg: ddxVT.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/ddxVT.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "XI.h"
-
-#ifdef XF86DDXACTIONS
-#include "xf86.h"
-#endif
-
-int
-XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act)
-{
-#ifdef XF86DDXACTIONS
- {
- int scrnnum = XkbSAScreen(&act->screen);
-
- if (act->screen.flags & XkbSA_SwitchApplication) {
- if (act->screen.flags & XkbSA_SwitchAbsolute)
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN,(void *) &scrnnum);
- else {
- if (scrnnum < 0)
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN_PREV,NULL);
- else
- xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT,NULL);
- }
- }
- }
-#endif
- return 1;
-}
diff --git a/xkb/maprules.c b/xkb/maprules.c
deleted file mode 100644
index c588ae399..000000000
--- a/xkb/maprules.c
+++ /dev/null
@@ -1,1476 +0,0 @@
-/* $Xorg: maprules.c,v 1.4 2000/08/17 19:46:43 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/maprules.c,v 3.18 2003/11/17 22:20:23 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#define X_INCLUDE_STRING_H
-#define XOS_USE_NO_LOCKING
-#include <X11/Xos_r.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <X11/Xproto.h>
-#include <X11/Xlib.h>
-#include <X11/Xos.h>
-#include <X11/Xfuncs.h>
-#include <X11/Xatom.h>
-#include <X11/keysym.h>
-#include <X11/XKBlib.h>
-#include <X11/extensions/XKBgeom.h>
-#include "XKMformat.h"
-#include "XKBfileInt.h"
-#include "XKBrules.h"
-
-#else
-
-#define NEED_EVENTS
-#include <X11/Xproto.h>
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xfuncs.h>
-#include <X11/Xatom.h>
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "dix.h"
-#include "XKBstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-
-#endif
-
-#ifdef DEBUG
-#define PR_DEBUG(s) fprintf(stderr,s)
-#define PR_DEBUG1(s,a) fprintf(stderr,s,a)
-#define PR_DEBUG2(s,a,b) fprintf(stderr,s,a,b)
-#else
-#define PR_DEBUG(s)
-#define PR_DEBUG1(s,a)
-#define PR_DEBUG2(s,a,b)
-#endif
-
-/***====================================================================***/
-
-#define DFLT_LINE_SIZE 128
-
-typedef struct {
- int line_num;
- int sz_line;
- int num_line;
- char buf[DFLT_LINE_SIZE];
- char * line;
-} InputLine;
-
-static void
-InitInputLine(InputLine *line)
-{
- line->line_num= 1;
- line->num_line= 0;
- line->sz_line= DFLT_LINE_SIZE;
- line->line= line->buf;
- return;
-}
-
-static void
-FreeInputLine(InputLine *line)
-{
- if (line->line!=line->buf)
- _XkbFree(line->line);
- line->line_num= 1;
- line->num_line= 0;
- line->sz_line= DFLT_LINE_SIZE;
- line->line= line->buf;
- return;
-}
-
-static int
-InputLineAddChar(InputLine *line,int ch)
-{
- if (line->num_line>=line->sz_line) {
- if (line->line==line->buf) {
- line->line= (char *)_XkbAlloc(line->sz_line*2);
- memcpy(line->line,line->buf,line->sz_line);
- }
- else {
- line->line=(char *)_XkbRealloc((char *)line->line,line->sz_line*2);
- }
- line->sz_line*= 2;
- }
- line->line[line->num_line++]= ch;
- return ch;
-}
-
-#define ADD_CHAR(l,c) ((l)->num_line<(l)->sz_line?\
- (int)((l)->line[(l)->num_line++]= (c)):\
- InputLineAddChar(l,c))
-
-static Bool
-GetInputLine(FILE *file,InputLine *line,Bool checkbang)
-{
-int ch;
-Bool endOfFile,spacePending,slashPending,inComment;
-
- endOfFile= False;
- while ((!endOfFile)&&(line->num_line==0)) {
- spacePending= slashPending= inComment= False;
- while (((ch=getc(file))!='\n')&&(ch!=EOF)) {
- if (ch=='\\') {
- if ((ch=getc(file))==EOF)
- break;
- if (ch=='\n') {
- inComment= False;
- ch= ' ';
- line->line_num++;
- }
- }
- if (inComment)
- continue;
- if (ch=='/') {
- if (slashPending) {
- inComment= True;
- slashPending= False;
- }
- else {
- slashPending= True;
- }
- continue;
- }
- else if (slashPending) {
- if (spacePending) {
- ADD_CHAR(line,' ');
- spacePending= False;
- }
- ADD_CHAR(line,'/');
- slashPending= False;
- }
- if (isspace(ch)) {
- while (isspace(ch)&&(ch!='\n')&&(ch!=EOF)) {
- ch= getc(file);
- }
- if (ch==EOF)
- break;
- if ((ch!='\n')&&(line->num_line>0))
- spacePending= True;
- ungetc(ch,file);
- }
- else {
- if (spacePending) {
- ADD_CHAR(line,' ');
- spacePending= False;
- }
- if (checkbang && ch=='!') {
- if (line->num_line!=0) {
- PR_DEBUG("The '!' legal only at start of line\n");
- PR_DEBUG("Line containing '!' ignored\n");
- line->num_line= 0;
- inComment= 0;
- break;
- }
-
- }
- ADD_CHAR(line,ch);
- }
- }
- if (ch==EOF)
- endOfFile= True;
-/* else line->num_line++;*/
- }
- if ((line->num_line==0)&&(endOfFile))
- return False;
- ADD_CHAR(line,'\0');
- return True;
-}
-
-/***====================================================================***/
-
-#define MODEL 0
-#define LAYOUT 1
-#define VARIANT 2
-#define OPTION 3
-#define KEYCODES 4
-#define SYMBOLS 5
-#define TYPES 6
-#define COMPAT 7
-#define GEOMETRY 8
-#define KEYMAP 9
-#define MAX_WORDS 10
-
-#define PART_MASK 0x000F
-#define COMPONENT_MASK 0x03F0
-
-static char * cname[MAX_WORDS] = {
- "model", "layout", "variant", "option",
- "keycodes", "symbols", "types", "compat", "geometry", "keymap"
-};
-
-typedef struct _RemapSpec {
- int number;
- int num_remap;
- struct {
- int word;
- int index;
- } remap[MAX_WORDS];
-} RemapSpec;
-
-typedef struct _FileSpec {
- char * name[MAX_WORDS];
- struct _FileSpec * pending;
-} FileSpec;
-
-typedef struct {
- char * model;
- char * layout[XkbNumKbdGroups+1];
- char * variant[XkbNumKbdGroups+1];
- char * options;
-} XkbRF_MultiDefsRec, *XkbRF_MultiDefsPtr;
-
-#define NDX_BUFF_SIZE 4
-
-/***====================================================================***/
-
-static char*
-get_index(char *str, int *ndx)
-{
- char ndx_buf[NDX_BUFF_SIZE];
- char *end;
-
- if (*str != '[') {
- *ndx = 0;
- return str;
- }
- str++;
- end = strchr(str, ']');
- if (end == NULL) {
- *ndx = -1;
- return str - 1;
- }
- if ( (end - str) >= NDX_BUFF_SIZE) {
- *ndx = -1;
- return end + 1;
- }
- strncpy(ndx_buf, str, end - str);
- ndx_buf[end - str] = '\0';
- *ndx = atoi(ndx_buf);
- return end + 1;
-}
-
-static void
-SetUpRemap(InputLine *line,RemapSpec *remap)
-{
-char * tok,*str;
-unsigned present, l_ndx_present, v_ndx_present;
-register int i;
-int len, ndx;
-_Xstrtokparams strtok_buf;
-#ifdef DEBUG
-Bool found;
-#endif
-
-
- l_ndx_present = v_ndx_present = present= 0;
- str= &line->line[1];
- len = remap->number;
- bzero((char *)remap,sizeof(RemapSpec));
- remap->number = len;
- while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) {
-#ifdef DEBUG
- found= False;
-#endif
- str= NULL;
- if (strcmp(tok,"=")==0)
- continue;
- for (i=0;i<MAX_WORDS;i++) {
- len = strlen(cname[i]);
- if (strncmp(cname[i],tok,len)==0) {
- if(strlen(tok) > len) {
- char *end = get_index(tok+len, &ndx);
- if ((i != LAYOUT && i != VARIANT) ||
- *end != '\0' || ndx == -1)
- break;
- if (ndx < 1 || ndx > XkbNumKbdGroups) {
- PR_DEBUG2("Illegal %s index: %d\n", cname[i], ndx);
- PR_DEBUG1("Index must be in range 1..%d\n",
- XkbNumKbdGroups);
- break;
- }
- } else {
- ndx = 0;
- }
-#ifdef DEBUG
- found= True;
-#endif
- if (present&(1<<i)) {
- if ((i == LAYOUT && l_ndx_present&(1<<ndx)) ||
- (i == VARIANT && v_ndx_present&(1<<ndx)) ) {
- PR_DEBUG1("Component \"%s\" listed twice\n",tok);
- PR_DEBUG("Second definition ignored\n");
- break;
- }
- }
- present |= (1<<i);
- if (i == LAYOUT)
- l_ndx_present |= 1 << ndx;
- if (i == VARIANT)
- v_ndx_present |= 1 << ndx;
- remap->remap[remap->num_remap].word= i;
- remap->remap[remap->num_remap++].index= ndx;
- break;
- }
- }
-#ifdef DEBUG
- if (!found) {
- fprintf(stderr,"Unknown component \"%s\" ignored\n",tok);
- }
-#endif
- }
- if ((present&PART_MASK)==0) {
-#ifdef DEBUG
- unsigned mask= PART_MASK;
- fprintf(stderr,"Mapping needs at least one of ");
- for (i=0; (i<MAX_WORDS); i++) {
- if ((1L<<i)&mask) {
- mask&= ~(1L<<i);
- if (mask) fprintf(stderr,"\"%s,\" ",cname[i]);
- else fprintf(stderr,"or \"%s\"\n",cname[i]);
- }
- }
- fprintf(stderr,"Illegal mapping ignored\n");
-#endif
- remap->num_remap= 0;
- return;
- }
- if ((present&COMPONENT_MASK)==0) {
- PR_DEBUG("Mapping needs at least one component\n");
- PR_DEBUG("Illegal mapping ignored\n");
- remap->num_remap= 0;
- return;
- }
- if (((present&PART_MASK)&(1<<OPTION))&&
- ((present&PART_MASK)!=(1<<OPTION))) {
- PR_DEBUG("Options cannot appear with other parts\n");
- PR_DEBUG("Illegal mapping ignored\n");
- remap->num_remap= 0;
- return;
- }
- if (((present&COMPONENT_MASK)&(1<<KEYMAP))&&
- ((present&COMPONENT_MASK)!=(1<<KEYMAP))) {
- PR_DEBUG("Keymap cannot appear with other components\n");
- PR_DEBUG("Illegal mapping ignored\n");
- remap->num_remap= 0;
- return;
- }
- remap->number++;
- return;
-}
-
-static Bool
-MatchOneOf(char *wanted,char *vals_defined)
-{
-char *str,*next;
-int want_len= strlen(wanted);
-
- for (str=vals_defined,next=NULL;str!=NULL;str=next) {
- int len;
- next= strchr(str,',');
- if (next) {
- len= next-str;
- next++;
- }
- else {
- len= strlen(str);
- }
- if ((len==want_len)&&(strncmp(wanted,str,len)==0))
- return True;
- }
- return False;
-}
-
-/***====================================================================***/
-
-static Bool
-CheckLine( InputLine * line,
- RemapSpec * remap,
- XkbRF_RulePtr rule,
- XkbRF_GroupPtr group)
-{
-char * str,*tok;
-register int nread, i;
-FileSpec tmp;
-_Xstrtokparams strtok_buf;
-Bool append = False;
-
- if (line->line[0]=='!') {
- if (line->line[1] == '$' ||
- (line->line[1] == ' ' && line->line[2] == '$')) {
- char *gname = strchr(line->line, '$');
- char *words = strchr(gname, ' ');
- if(!words)
- return False;
- *words++ = '\0';
- for (; *words; words++) {
- if (*words != '=' && *words != ' ')
- break;
- }
- if (*words == '\0')
- return False;
- group->name = _XkbDupString(gname);
- group->words = _XkbDupString(words);
- for (i = 1, words = group->words; *words; words++) {
- if ( *words == ' ') {
- *words++ = '\0';
- i++;
- }
- }
- group->number = i;
- return True;
- } else {
- SetUpRemap(line,remap);
- return False;
- }
- }
-
- if (remap->num_remap==0) {
- PR_DEBUG("Must have a mapping before first line of data\n");
- PR_DEBUG("Illegal line of data ignored\n");
- return False;
- }
- bzero((char *)&tmp,sizeof(FileSpec));
- str= line->line;
- for (nread= 0;(tok=_XStrtok(str," ",strtok_buf))!=NULL;nread++) {
- str= NULL;
- if (strcmp(tok,"=")==0) {
- nread--;
- continue;
- }
- if (nread>remap->num_remap) {
- PR_DEBUG("Too many words on a line\n");
- PR_DEBUG1("Extra word \"%s\" ignored\n",tok);
- continue;
- }
- tmp.name[remap->remap[nread].word]= tok;
- if (*tok == '+' || *tok == '|')
- append = True;
- }
- if (nread<remap->num_remap) {
- PR_DEBUG1("Too few words on a line: %s\n", line->line);
- PR_DEBUG("line ignored\n");
- return False;
- }
-
- rule->flags= 0;
- rule->number = remap->number;
- if (tmp.name[OPTION])
- rule->flags|= XkbRF_Option;
- else if (append)
- rule->flags|= XkbRF_Append;
- else
- rule->flags|= XkbRF_Normal;
- rule->model= _XkbDupString(tmp.name[MODEL]);
- rule->layout= _XkbDupString(tmp.name[LAYOUT]);
- rule->variant= _XkbDupString(tmp.name[VARIANT]);
- rule->option= _XkbDupString(tmp.name[OPTION]);
-
- rule->keycodes= _XkbDupString(tmp.name[KEYCODES]);
- rule->symbols= _XkbDupString(tmp.name[SYMBOLS]);
- rule->types= _XkbDupString(tmp.name[TYPES]);
- rule->compat= _XkbDupString(tmp.name[COMPAT]);
- rule->geometry= _XkbDupString(tmp.name[GEOMETRY]);
- rule->keymap= _XkbDupString(tmp.name[KEYMAP]);
-
- rule->layout_num = rule->variant_num = 0;
- for (i = 0; i < nread; i++) {
- if (remap->remap[i].index) {
- if (remap->remap[i].word == LAYOUT)
- rule->layout_num = remap->remap[i].index;
- if (remap->remap[i].word == VARIANT)
- rule->variant_num = remap->remap[i].index;
- }
- }
- return True;
-}
-
-static char *
-_Concat(char *str1,char *str2)
-{
-int len;
-
- if ((!str1)||(!str2))
- return str1;
- len= strlen(str1)+strlen(str2)+1;
- str1= _XkbTypedRealloc(str1,len,char);
- if (str1)
- strcat(str1,str2);
- return str1;
-}
-
-static void
-squeeze_spaces(char *p1)
-{
- char *p2;
- for (p2 = p1; *p2; p2++) {
- *p1 = *p2;
- if (*p1 != ' ') p1++;
- }
- *p1 = '\0';
-}
-
-static Bool
-MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
-{
-
- bzero((char *)mdefs,sizeof(XkbRF_MultiDefsRec));
- mdefs->model = defs->model;
- mdefs->options = _XkbDupString(defs->options);
- if (mdefs->options) squeeze_spaces(mdefs->options);
-
- if (defs->layout) {
- if (!strchr(defs->layout, ',')) {
- mdefs->layout[0] = defs->layout;
- } else {
- char *p;
- int i;
- mdefs->layout[1] = _XkbDupString(defs->layout);
- if (mdefs->layout[1] == NULL)
- return False;
- squeeze_spaces(mdefs->layout[1]);
- p = mdefs->layout[1];
- for (i = 2; i <= XkbNumKbdGroups; i++) {
- if ((p = strchr(p, ','))) {
- *p++ = '\0';
- mdefs->layout[i] = p;
- } else {
- break;
- }
- }
- if (p && (p = strchr(p, ',')))
- *p = '\0';
- }
- }
-
- if (defs->variant) {
- if (!strchr(defs->variant, ',')) {
- mdefs->variant[0] = defs->variant;
- } else {
- char *p;
- int i;
- mdefs->variant[1] = _XkbDupString(defs->variant);
- if (mdefs->variant[1] == NULL)
- return False;
- squeeze_spaces(mdefs->variant[1]);
- p = mdefs->variant[1];
- for (i = 2; i <= XkbNumKbdGroups; i++) {
- if ((p = strchr(p, ','))) {
- *p++ = '\0';
- mdefs->variant[i] = p;
- } else {
- break;
- }
- }
- if (p && (p = strchr(p, ',')))
- *p = '\0';
- }
- }
- return True;
-}
-
-static void
-FreeMultiDefs(XkbRF_MultiDefsPtr defs)
-{
- if (defs->options) _XkbFree(defs->options);
- if (defs->layout[1]) _XkbFree(defs->layout[1]);
- if (defs->variant[1]) _XkbFree(defs->variant[1]);
-}
-
-static void
-Apply(char *src, char **dst)
-{
- if (src) {
- if (*src == '+' || *src == '!') {
- *dst= _Concat(*dst, src);
- } else {
- if (*dst == NULL)
- *dst= _XkbDupString(src);
- }
- }
-}
-
-static void
-XkbRF_ApplyRule( XkbRF_RulePtr rule,
- XkbComponentNamesPtr names)
-{
- rule->flags&= ~XkbRF_PendingMatch; /* clear the flag because it's applied */
-
- Apply(rule->keycodes, &names->keycodes);
- Apply(rule->symbols, &names->symbols);
- Apply(rule->types, &names->types);
- Apply(rule->compat, &names->compat);
- Apply(rule->geometry, &names->geometry);
- Apply(rule->keymap, &names->keymap);
-}
-
-static Bool
-CheckGroup( XkbRF_RulesPtr rules,
- char * group_name,
- char * name)
-{
- int i;
- char *p;
- XkbRF_GroupPtr group;
-
- for (i = 0, group = rules->groups; i < rules->num_groups; i++, group++) {
- if (! strcmp(group->name, group_name)) {
- break;
- }
- }
- if (i == rules->num_groups)
- return False;
- for (i = 0, p = group->words; i < group->number; i++, p += strlen(p)+1) {
- if (! strcmp(p, name)) {
- return True;
- }
- }
- return False;
-}
-
-static int
-XkbRF_CheckApplyRule( XkbRF_RulePtr rule,
- XkbRF_MultiDefsPtr mdefs,
- XkbComponentNamesPtr names,
- XkbRF_RulesPtr rules)
-{
- Bool pending = False;
-
- if (rule->model != NULL) {
- if(mdefs->model == NULL)
- return 0;
- if (strcmp(rule->model, "*") == 0) {
- pending = True;
- } else {
- if (rule->model[0] == '$') {
- if (!CheckGroup(rules, rule->model, mdefs->model))
- return 0;
- } else {
- if (strcmp(rule->model, mdefs->model) != 0)
- return 0;
- }
- }
- }
- if (rule->option != NULL) {
- if (mdefs->options == NULL)
- return 0;
- if ((!MatchOneOf(rule->option,mdefs->options)))
- return 0;
- }
-
- if (rule->layout != NULL) {
- if(mdefs->layout[rule->layout_num] == NULL ||
- *mdefs->layout[rule->layout_num] == '\0')
- return 0;
- if (strcmp(rule->layout, "*") == 0) {
- pending = True;
- } else {
- if (rule->layout[0] == '$') {
- if (!CheckGroup(rules, rule->layout,
- mdefs->layout[rule->layout_num]))
- return 0;
- } else {
- if (strcmp(rule->layout, mdefs->layout[rule->layout_num]) != 0)
- return 0;
- }
- }
- }
- if (rule->variant != NULL) {
- if (mdefs->variant[rule->variant_num] == NULL ||
- *mdefs->variant[rule->variant_num] == '\0')
- return 0;
- if (strcmp(rule->variant, "*") == 0) {
- pending = True;
- } else {
- if (rule->variant[0] == '$') {
- if (!CheckGroup(rules, rule->variant,
- mdefs->variant[rule->variant_num]))
- return 0;
- } else {
- if (strcmp(rule->variant,
- mdefs->variant[rule->variant_num]) != 0)
- return 0;
- }
- }
- }
- if (pending) {
- rule->flags|= XkbRF_PendingMatch;
- return rule->number;
- }
- /* exact match, apply it now */
- XkbRF_ApplyRule(rule,names);
- return rule->number;
-}
-
-static void
-XkbRF_ClearPartialMatches(XkbRF_RulesPtr rules)
-{
-register int i;
-XkbRF_RulePtr rule;
-
- for (i=0,rule=rules->rules;i<rules->num_rules;i++,rule++) {
- rule->flags&= ~XkbRF_PendingMatch;
- }
-}
-
-static void
-XkbRF_ApplyPartialMatches(XkbRF_RulesPtr rules,XkbComponentNamesPtr names)
-{
-int i;
-XkbRF_RulePtr rule;
-
- for (rule = rules->rules, i = 0; i < rules->num_rules; i++, rule++) {
- if ((rule->flags&XkbRF_PendingMatch)==0)
- continue;
- XkbRF_ApplyRule(rule,names);
- }
-}
-
-static void
-XkbRF_CheckApplyRules( XkbRF_RulesPtr rules,
- XkbRF_MultiDefsPtr mdefs,
- XkbComponentNamesPtr names,
- int flags)
-{
-int i;
-XkbRF_RulePtr rule;
-int skip;
-
- for (rule = rules->rules, i=0; i < rules->num_rules; rule++, i++) {
- if ((rule->flags & flags) != flags)
- continue;
- skip = XkbRF_CheckApplyRule(rule, mdefs, names, rules);
- if (skip && !(flags & XkbRF_Option)) {
- for ( ;(i < rules->num_rules) && (rule->number == skip);
- rule++, i++);
- rule--; i--;
- }
- }
-}
-
-/***====================================================================***/
-
-static char *
-XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs)
-{
-char *str, *outstr, *orig, *var;
-int len, ndx;
-
- orig= name;
- str= index(name,'%');
- if (str==NULL)
- return name;
- len= strlen(name);
- while (str!=NULL) {
- char pfx= str[1];
- int extra_len= 0;
- if ((pfx=='+')||(pfx=='|')||(pfx=='_')||(pfx=='-')) {
- extra_len= 1;
- str++;
- }
- else if (pfx=='(') {
- extra_len= 2;
- str++;
- }
- var = str + 1;
- str = get_index(var + 1, &ndx);
- if (ndx == -1) {
- str = index(str,'%');
- continue;
- }
- if ((*var=='l') && mdefs->layout[ndx] && *mdefs->layout[ndx])
- len+= strlen(mdefs->layout[ndx])+extra_len;
- else if ((*var=='m')&&mdefs->model)
- len+= strlen(mdefs->model)+extra_len;
- else if ((*var=='v') && mdefs->variant[ndx] && *mdefs->variant[ndx])
- len+= strlen(mdefs->variant[ndx])+extra_len;
- if ((pfx=='(')&&(*str==')')) {
- str++;
- }
- str= index(&str[0],'%');
- }
- name= (char *)_XkbAlloc(len+1);
- str= orig;
- outstr= name;
- while (*str!='\0') {
- if (str[0]=='%') {
- char pfx,sfx;
- str++;
- pfx= str[0];
- sfx= '\0';
- if ((pfx=='+')||(pfx=='|')||(pfx=='_')||(pfx=='-')) {
- str++;
- }
- else if (pfx=='(') {
- sfx= ')';
- str++;
- }
- else pfx= '\0';
-
- var = str;
- str = get_index(var + 1, &ndx);
- if (ndx == -1) {
- continue;
- }
- if ((*var=='l') && mdefs->layout[ndx] && *mdefs->layout[ndx]) {
- if (pfx) *outstr++= pfx;
- strcpy(outstr,mdefs->layout[ndx]);
- outstr+= strlen(mdefs->layout[ndx]);
- if (sfx) *outstr++= sfx;
- }
- else if ((*var=='m')&&(mdefs->model)) {
- if (pfx) *outstr++= pfx;
- strcpy(outstr,mdefs->model);
- outstr+= strlen(mdefs->model);
- if (sfx) *outstr++= sfx;
- }
- else if ((*var=='v') && mdefs->variant[ndx] && *mdefs->variant[ndx]) {
- if (pfx) *outstr++= pfx;
- strcpy(outstr,mdefs->variant[ndx]);
- outstr+= strlen(mdefs->variant[ndx]);
- if (sfx) *outstr++= sfx;
- }
- if ((pfx=='(')&&(*str==')'))
- str++;
- }
- else {
- *outstr++= *str++;
- }
- }
- *outstr++= '\0';
- if (orig!=name)
- _XkbFree(orig);
- return name;
-}
-
-/***====================================================================***/
-
-Bool
-XkbRF_GetComponents( XkbRF_RulesPtr rules,
- XkbRF_VarDefsPtr defs,
- XkbComponentNamesPtr names)
-{
- XkbRF_MultiDefsRec mdefs;
-
- MakeMultiDefs(&mdefs, defs);
-
- bzero((char *)names,sizeof(XkbComponentNamesRec));
- XkbRF_ClearPartialMatches(rules);
- XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Normal);
- XkbRF_ApplyPartialMatches(rules, names);
- XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Append);
- XkbRF_ApplyPartialMatches(rules, names);
- XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option);
-
- if (names->keycodes)
- names->keycodes= XkbRF_SubstituteVars(names->keycodes, &mdefs);
- if (names->symbols)
- names->symbols= XkbRF_SubstituteVars(names->symbols, &mdefs);
- if (names->types)
- names->types= XkbRF_SubstituteVars(names->types, &mdefs);
- if (names->compat)
- names->compat= XkbRF_SubstituteVars(names->compat, &mdefs);
- if (names->geometry)
- names->geometry= XkbRF_SubstituteVars(names->geometry, &mdefs);
- if (names->keymap)
- names->keymap= XkbRF_SubstituteVars(names->keymap, &mdefs);
-
- FreeMultiDefs(&mdefs);
- return (names->keycodes && names->symbols && names->types &&
- names->compat && names->geometry ) || names->keymap;
-}
-
-XkbRF_RulePtr
-XkbRF_AddRule(XkbRF_RulesPtr rules)
-{
- if (rules->sz_rules<1) {
- rules->sz_rules= 16;
- rules->num_rules= 0;
- rules->rules= _XkbTypedCalloc(rules->sz_rules,XkbRF_RuleRec);
- }
- else if (rules->num_rules>=rules->sz_rules) {
- rules->sz_rules*= 2;
- rules->rules= _XkbTypedRealloc(rules->rules,rules->sz_rules,
- XkbRF_RuleRec);
- }
- if (!rules->rules) {
- rules->sz_rules= rules->num_rules= 0;
-#ifdef DEBUG
- fprintf(stderr,"Allocation failure in XkbRF_AddRule\n");
-#endif
- return NULL;
- }
- bzero((char *)&rules->rules[rules->num_rules],sizeof(XkbRF_RuleRec));
- return &rules->rules[rules->num_rules++];
-}
-
-XkbRF_GroupPtr
-XkbRF_AddGroup(XkbRF_RulesPtr rules)
-{
- if (rules->sz_groups<1) {
- rules->sz_groups= 16;
- rules->num_groups= 0;
- rules->groups= _XkbTypedCalloc(rules->sz_groups,XkbRF_GroupRec);
- }
- else if (rules->num_groups >= rules->sz_groups) {
- rules->sz_groups *= 2;
- rules->groups= _XkbTypedRealloc(rules->groups,rules->sz_groups,
- XkbRF_GroupRec);
- }
- if (!rules->groups) {
- rules->sz_groups= rules->num_groups= 0;
- return NULL;
- }
-
- bzero((char *)&rules->groups[rules->num_groups],sizeof(XkbRF_GroupRec));
- return &rules->groups[rules->num_groups++];
-}
-
-Bool
-XkbRF_LoadRules(FILE *file, XkbRF_RulesPtr rules)
-{
-InputLine line;
-RemapSpec remap;
-XkbRF_RuleRec trule,*rule;
-XkbRF_GroupRec tgroup,*group;
-
- if (!(rules && file))
- return False;
- bzero((char *)&remap,sizeof(RemapSpec));
- bzero((char *)&tgroup,sizeof(XkbRF_GroupRec));
- InitInputLine(&line);
- while (GetInputLine(file,&line,True)) {
- if (CheckLine(&line,&remap,&trule,&tgroup)) {
- if (tgroup.number) {
- if ((group= XkbRF_AddGroup(rules))!=NULL) {
- *group= tgroup;
- bzero((char *)&tgroup,sizeof(XkbRF_GroupRec));
- }
- } else {
- if ((rule= XkbRF_AddRule(rules))!=NULL) {
- *rule= trule;
- bzero((char *)&trule,sizeof(XkbRF_RuleRec));
- }
- }
- }
- line.num_line= 0;
- }
- FreeInputLine(&line);
- return True;
-}
-
-Bool
-XkbRF_LoadRulesByName(char *base,char *locale,XkbRF_RulesPtr rules)
-{
-FILE * file;
-char buf[PATH_MAX];
-Bool ok;
-
- if ((!base)||(!rules))
- return False;
- if (locale) {
- if (strlen(base)+strlen(locale)+2 > PATH_MAX)
- return False;
- sprintf(buf,"%s-%s", base, locale);
- }
- else {
- if (strlen(base)+1 > PATH_MAX)
- return False;
- strcpy(buf,base);
- }
-
- file= fopen(buf, "r");
- if ((!file)&&(locale)) { /* fallback if locale was specified */
- strcpy(buf,base);
- file= fopen(buf, "r");
- }
- if (!file)
- return False;
- ok= XkbRF_LoadRules(file,rules);
- fclose(file);
- return ok;
-}
-
-/***====================================================================***/
-
-#define HEAD_NONE 0
-#define HEAD_MODEL 1
-#define HEAD_LAYOUT 2
-#define HEAD_VARIANT 3
-#define HEAD_OPTION 4
-#define HEAD_EXTRA 5
-
-XkbRF_VarDescPtr
-XkbRF_AddVarDesc(XkbRF_DescribeVarsPtr vars)
-{
- if (vars->sz_desc<1) {
- vars->sz_desc= 16;
- vars->num_desc= 0;
- vars->desc= _XkbTypedCalloc(vars->sz_desc,XkbRF_VarDescRec);
- }
- else if (vars->num_desc>=vars->sz_desc) {
- vars->sz_desc*= 2;
- vars->desc= _XkbTypedRealloc(vars->desc,vars->sz_desc,XkbRF_VarDescRec);
- }
- if (!vars->desc) {
- vars->sz_desc= vars->num_desc= 0;
- PR_DEBUG("Allocation failure in XkbRF_AddVarDesc\n");
- return NULL;
- }
- vars->desc[vars->num_desc].name= NULL;
- vars->desc[vars->num_desc].desc= NULL;
- return &vars->desc[vars->num_desc++];
-}
-
-XkbRF_VarDescPtr
-XkbRF_AddVarDescCopy(XkbRF_DescribeVarsPtr vars,XkbRF_VarDescPtr from)
-{
-XkbRF_VarDescPtr nd;
-
- if ((nd=XkbRF_AddVarDesc(vars))!=NULL) {
- nd->name= _XkbDupString(from->name);
- nd->desc= _XkbDupString(from->desc);
- }
- return nd;
-}
-
-XkbRF_DescribeVarsPtr
-XkbRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name)
-{
- if (rules->sz_extra<1) {
- rules->num_extra= 0;
- rules->sz_extra= 1;
- rules->extra_names= _XkbTypedCalloc(rules->sz_extra,char *);
- rules->extra= _XkbTypedCalloc(rules->sz_extra, XkbRF_DescribeVarsRec);
- }
- else if (rules->num_extra>=rules->sz_extra) {
- rules->sz_extra*= 2;
- rules->extra_names= _XkbTypedRealloc(rules->extra_names,rules->sz_extra,
- char *);
- rules->extra=_XkbTypedRealloc(rules->extra, rules->sz_extra,
- XkbRF_DescribeVarsRec);
- }
- if ((!rules->extra_names)||(!rules->extra)) {
- PR_DEBUG("allocation error in extra parts\n");
- rules->sz_extra= rules->num_extra= 0;
- rules->extra_names= NULL;
- rules->extra= NULL;
- return NULL;
- }
- rules->extra_names[rules->num_extra]= _XkbDupString(name);
- bzero(&rules->extra[rules->num_extra],sizeof(XkbRF_DescribeVarsRec));
- return &rules->extra[rules->num_extra++];
-}
-
-Bool
-XkbRF_LoadDescriptions(FILE *file,XkbRF_RulesPtr rules)
-{
-InputLine line;
-XkbRF_VarDescRec tmp;
-char *tok;
-int len,headingtype,extra_ndx = 0;
-
- bzero((char *)&tmp, sizeof(XkbRF_VarDescRec));
- headingtype = HEAD_NONE;
- InitInputLine(&line);
- for ( ; GetInputLine(file,&line,False); line.num_line= 0) {
- if (line.line[0]=='!') {
- tok = strtok(&(line.line[1]), " \t");
- if (!_XkbStrCaseCmp(tok,"model"))
- headingtype = HEAD_MODEL;
- else if (!_XkbStrCaseCmp(tok,"layout"))
- headingtype = HEAD_LAYOUT;
- else if (!_XkbStrCaseCmp(tok,"variant"))
- headingtype = HEAD_VARIANT;
- else if (!_XkbStrCaseCmp(tok,"option"))
- headingtype = HEAD_OPTION;
- else {
- int i;
- headingtype = HEAD_EXTRA;
- extra_ndx= -1;
- for (i=0;(i<rules->num_extra)&&(extra_ndx<0);i++) {
- if (!_XkbStrCaseCmp(tok,rules->extra_names[i]))
- extra_ndx= i;
- }
- if (extra_ndx<0) {
- XkbRF_DescribeVarsPtr var;
- PR_DEBUG1("Extra heading \"%s\" encountered\n",tok);
- var= XkbRF_AddVarToDescribe(rules,tok);
- if (var)
- extra_ndx= var-rules->extra;
- else headingtype= HEAD_NONE;
- }
- }
- continue;
- }
-
- if (headingtype == HEAD_NONE) {
- PR_DEBUG("Must have a heading before first line of data\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
-
- len = strlen(line.line);
- if ((tmp.name= strtok(line.line, " \t")) == NULL) {
- PR_DEBUG("Huh? No token on line\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
- if (strlen(tmp.name) == len) {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
-
- tok = line.line + strlen(tmp.name) + 1;
- while ((*tok!='\n')&&isspace(*tok))
- tok++;
- if (*tok == '\0') {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
- tmp.desc= tok;
- switch (headingtype) {
- case HEAD_MODEL:
- XkbRF_AddVarDescCopy(&rules->models,&tmp);
- break;
- case HEAD_LAYOUT:
- XkbRF_AddVarDescCopy(&rules->layouts,&tmp);
- break;
- case HEAD_VARIANT:
- XkbRF_AddVarDescCopy(&rules->variants,&tmp);
- break;
- case HEAD_OPTION:
- XkbRF_AddVarDescCopy(&rules->options,&tmp);
- break;
- case HEAD_EXTRA:
- XkbRF_AddVarDescCopy(&rules->extra[extra_ndx],&tmp);
- break;
- }
- }
- FreeInputLine(&line);
- if ((rules->models.num_desc==0) && (rules->layouts.num_desc==0) &&
- (rules->variants.num_desc==0) && (rules->options.num_desc==0) &&
- (rules->num_extra==0)) {
- return False;
- }
- return True;
-}
-
-Bool
-XkbRF_LoadDescriptionsByName(char *base,char *locale,XkbRF_RulesPtr rules)
-{
-FILE * file;
-char buf[PATH_MAX];
-Bool ok;
-
- if ((!base)||(!rules))
- return False;
- if (locale) {
- if (strlen(base)+strlen(locale)+6 > PATH_MAX)
- return False;
- sprintf(buf,"%s-%s.lst", base, locale);
- }
- else {
- if (strlen(base)+5 > PATH_MAX)
- return False;
- sprintf(buf,"%s.lst", base);
- }
-
- file= fopen(buf, "r");
- if ((!file)&&(locale)) { /* fallback if locale was specified */
- sprintf(buf,"%s.lst", base);
-
- file= fopen(buf, "r");
- }
- if (!file)
- return False;
- ok= XkbRF_LoadDescriptions(file,rules);
- fclose(file);
- return ok;
-}
-
-/***====================================================================***/
-
-XkbRF_RulesPtr
-XkbRF_Load(char *base,char *locale,Bool wantDesc,Bool wantRules)
-{
-XkbRF_RulesPtr rules;
-
- if ((!base)||((!wantDesc)&&(!wantRules)))
- return NULL;
- if ((rules=_XkbTypedCalloc(1,XkbRF_RulesRec))==NULL)
- return NULL;
- if (wantDesc&&(!XkbRF_LoadDescriptionsByName(base,locale,rules))) {
- XkbRF_Free(rules,True);
- return NULL;
- }
- if (wantRules&&(!XkbRF_LoadRulesByName(base,locale,rules))) {
- XkbRF_Free(rules,True);
- return NULL;
- }
- return rules;
-}
-
-XkbRF_RulesPtr
-XkbRF_Create(int szRules,int szExtra)
-{
-XkbRF_RulesPtr rules;
-
- if ((rules=_XkbTypedCalloc(1,XkbRF_RulesRec))==NULL)
- return NULL;
- if (szRules>0) {
- rules->sz_rules= szRules;
- rules->rules= _XkbTypedCalloc(rules->sz_rules,XkbRF_RuleRec);
- if (!rules->rules) {
- _XkbFree(rules);
- return NULL;
- }
- }
- if (szExtra>0) {
- rules->sz_extra= szExtra;
- rules->extra= _XkbTypedCalloc(rules->sz_extra,XkbRF_DescribeVarsRec);
- if (!rules->extra) {
- if (rules->rules)
- _XkbFree(rules->rules);
- _XkbFree(rules);
- return NULL;
- }
- }
- return rules;
-}
-
-/***====================================================================***/
-
-static void
-XkbRF_ClearVarDescriptions(XkbRF_DescribeVarsPtr var)
-{
-register int i;
-
- for (i=0;i<var->num_desc;i++) {
- if (var->desc[i].name)
- _XkbFree(var->desc[i].name);
- if (var->desc[i].desc)
- _XkbFree(var->desc[i].desc);
- var->desc[i].name= var->desc[i].desc= NULL;
- }
- if (var->desc)
- _XkbFree(var->desc);
- var->desc= NULL;
- return;
-}
-
-void
-XkbRF_Free(XkbRF_RulesPtr rules,Bool freeRules)
-{
-int i;
-XkbRF_RulePtr rule;
-XkbRF_GroupPtr group;
-
- if (!rules)
- return;
- XkbRF_ClearVarDescriptions(&rules->models);
- XkbRF_ClearVarDescriptions(&rules->layouts);
- XkbRF_ClearVarDescriptions(&rules->variants);
- XkbRF_ClearVarDescriptions(&rules->options);
- if (rules->extra) {
- for (i = 0; i < rules->num_extra; i++) {
- XkbRF_ClearVarDescriptions(&rules->extra[i]);
- }
- _XkbFree(rules->extra);
- rules->num_extra= rules->sz_extra= 0;
- rules->extra= NULL;
- }
- if (rules->rules) {
- for (i=0,rule=rules->rules;i<rules->num_rules;i++,rule++) {
- if (rule->model) _XkbFree(rule->model);
- if (rule->layout) _XkbFree(rule->layout);
- if (rule->variant) _XkbFree(rule->variant);
- if (rule->option) _XkbFree(rule->option);
- if (rule->keycodes) _XkbFree(rule->keycodes);
- if (rule->symbols) _XkbFree(rule->symbols);
- if (rule->types) _XkbFree(rule->types);
- if (rule->compat) _XkbFree(rule->compat);
- if (rule->geometry) _XkbFree(rule->geometry);
- if (rule->keymap) _XkbFree(rule->keymap);
- bzero((char *)rule,sizeof(XkbRF_RuleRec));
- }
- _XkbFree(rules->rules);
- rules->num_rules= rules->sz_rules= 0;
- rules->rules= NULL;
- }
-
- if (rules->groups) {
- for (i=0, group=rules->groups;i<rules->num_groups;i++,group++) {
- if (group->name) _XkbFree(group->name);
- if (group->words) _XkbFree(group->words);
- }
- _XkbFree(rules->groups);
- rules->num_groups= 0;
- rules->groups= NULL;
- }
- if (freeRules)
- _XkbFree(rules);
- return;
-}
-
-#ifndef XKB_IN_SERVER
-
-Bool
-XkbRF_GetNamesProp(Display *dpy,char **rf_rtrn,XkbRF_VarDefsPtr vd_rtrn)
-{
-Atom rules_atom,actual_type;
-int fmt;
-unsigned long nitems,bytes_after;
-char *data,*out;
-Status rtrn;
-
- rules_atom= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,True);
- if (rules_atom==None) /* property cannot exist */
- return False;
- rtrn= XGetWindowProperty(dpy,DefaultRootWindow(dpy),rules_atom,
- 0L,_XKB_RF_NAMES_PROP_MAXLEN,False,
- XA_STRING,&actual_type,
- &fmt,&nitems,&bytes_after,
- (unsigned char **)&data);
- if (rtrn!=Success)
- return False;
- if (rf_rtrn)
- *rf_rtrn= NULL;
- (void)bzero((char *)vd_rtrn,sizeof(XkbRF_VarDefsRec));
- if ((bytes_after>0)||(actual_type!=XA_STRING)||(fmt!=8)) {
- if (data) XFree(data);
- return (fmt==0?True:False);
- }
-
- out= data;
- if (out && (*out) && rf_rtrn)
- *rf_rtrn= _XkbDupString(out);
- out+=strlen(out)+1;
-
- if ((out-data)<nitems) {
- if (*out)
- vd_rtrn->model= _XkbDupString(out);
- out+=strlen(out)+1;
- }
-
- if ((out-data)<nitems) {
- if (*out)
- vd_rtrn->layout= _XkbDupString(out);
- out+=strlen(out)+1;
- }
-
- if ((out-data)<nitems) {
- if (*out)
- vd_rtrn->variant= _XkbDupString(out);
- out+=strlen(out)+1;
- }
-
-
- if ((out-data)<nitems) {
- if (*out)
- vd_rtrn->options= _XkbDupString(out);
- out+=strlen(out)+1;
- }
- XFree(data);
- return True;
-}
-
-Bool
-XkbRF_SetNamesProp(Display *dpy,char *rules_file,XkbRF_VarDefsPtr var_defs)
-{
-int len,out;
-Atom name;
-char * pval;
-
- len= (rules_file?strlen(rules_file):0);
- len+= (var_defs->model?strlen(var_defs->model):0);
- len+= (var_defs->layout?strlen(var_defs->layout):0);
- len+= (var_defs->variant?strlen(var_defs->variant):0);
- len+= (var_defs->options?strlen(var_defs->options):0);
- if (len<1)
- return True;
-
- len+= 5; /* trailing NULs */
-
- name= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,False);
- if (name==None) { /* should never happen */
- _XkbLibError(_XkbErrXReqFailure,"XkbRF_SetNamesProp",X_InternAtom);
- return False;
- }
- pval= (char *)_XkbAlloc(len);
- if (!pval) {
- _XkbLibError(_XkbErrBadAlloc,"XkbRF_SetNamesProp",len);
- return False;
- }
- out= 0;
- if (rules_file) {
- strcpy(&pval[out],rules_file);
- out+= strlen(rules_file);
- }
- pval[out++]= '\0';
- if (var_defs->model) {
- strcpy(&pval[out],var_defs->model);
- out+= strlen(var_defs->model);
- }
- pval[out++]= '\0';
- if (var_defs->layout) {
- strcpy(&pval[out],var_defs->layout);
- out+= strlen(var_defs->layout);
- }
- pval[out++]= '\0';
- if (var_defs->variant) {
- strcpy(&pval[out],var_defs->variant);
- out+= strlen(var_defs->variant);
- }
- pval[out++]= '\0';
- if (var_defs->options) {
- strcpy(&pval[out],var_defs->options);
- out+= strlen(var_defs->options);
- }
- pval[out++]= '\0';
- if (out!=len) {
- _XkbLibError(_XkbErrBadLength,"XkbRF_SetNamesProp",out);
- _XkbFree(pval);
- return False;
- }
-
- XChangeProperty(dpy,DefaultRootWindow(dpy),name,XA_STRING,8,PropModeReplace,
- (unsigned char *)pval,len);
- _XkbFree(pval);
- return True;
-}
-
-#endif
diff --git a/xkb/xkb.c b/xkb/xkb.c
deleted file mode 100644
index 273385ef6..000000000
--- a/xkb/xkb.c
+++ /dev/null
@@ -1,6231 +0,0 @@
-/* $Xorg: xkb.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.22 2003/11/17 22:20:45 dawes Exp $ */
-
-#include <stdio.h>
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "extnsionst.h"
-#include "modinit.h"
-#include "xkb.h"
-
-#include "XI.h"
-
- int XkbEventBase;
- int XkbErrorBase;
- int XkbReqCode;
- int XkbKeyboardErrorCode;
-Atom xkbONE_LEVEL;
-Atom xkbTWO_LEVEL;
-Atom xkbKEYPAD;
-CARD32 xkbDebugFlags = 0;
-CARD32 xkbDebugCtrls = 0;
-
-#ifndef XKB_SRV_UNSUPPORTED_XI_FEATURES
-#define XKB_SRV_UNSUPPORTED_XI_FEATURES XkbXI_KeyboardsMask
-#endif
-
-unsigned XkbXIUnsupported= XKB_SRV_UNSUPPORTED_XI_FEATURES;
-
-RESTYPE RT_XKBCLIENT;
-
-/***====================================================================***/
-
-#define CHK_DEVICE(d,sp,lf) {\
- int why;\
- d = (DeviceIntPtr)lf((sp),&why);\
- if (!dev) {\
- client->errorValue = _XkbErrCode2(why,(sp));\
- return XkbKeyboardErrorCode;\
- }\
-}
-
-#define CHK_KBD_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupKeyboard)
-#define CHK_LED_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupLedDevice)
-#define CHK_BELL_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupBellDevice)
-#define CHK_ANY_DEVICE(d,sp) CHK_DEVICE(d,sp,_XkbLookupAnyDevice)
-
-#define CHK_ATOM_ONLY2(a,ev,er) {\
- if (((a)==None)||(!ValidAtom((a)))) {\
- (ev)= (XID)(a);\
- return er;\
- }\
-}
-#define CHK_ATOM_ONLY(a) \
- CHK_ATOM_ONLY2(a,client->errorValue,BadAtom)
-
-#define CHK_ATOM_OR_NONE3(a,ev,er,ret) {\
- if (((a)!=None)&&(!ValidAtom((a)))) {\
- (ev)= (XID)(a);\
- (er)= BadAtom;\
- return ret;\
- }\
-}
-#define CHK_ATOM_OR_NONE2(a,ev,er) {\
- if (((a)!=None)&&(!ValidAtom((a)))) {\
- (ev)= (XID)(a);\
- return er;\
- }\
-}
-#define CHK_ATOM_OR_NONE(a) \
- CHK_ATOM_OR_NONE2(a,client->errorValue,BadAtom)
-
-#define CHK_MASK_LEGAL3(err,mask,legal,ev,er,ret) {\
- if ((mask)&(~(legal))) { \
- (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\
- (er)= BadValue;\
- return ret;\
- }\
-}
-#define CHK_MASK_LEGAL2(err,mask,legal,ev,er) {\
- if ((mask)&(~(legal))) { \
- (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\
- return er;\
- }\
-}
-#define CHK_MASK_LEGAL(err,mask,legal) \
- CHK_MASK_LEGAL2(err,mask,legal,client->errorValue,BadValue)
-
-#define CHK_MASK_MATCH(err,affect,value) {\
- if ((value)&(~(affect))) { \
- client->errorValue= _XkbErrCode2((err),((value)&(~(affect))));\
- return BadMatch;\
- }\
-}
-#define CHK_MASK_OVERLAP(err,m1,m2) {\
- if ((m1)&(m2)) { \
- client->errorValue= _XkbErrCode2((err),((m1)&(m2)));\
- return BadMatch;\
- }\
-}
-#define CHK_KEY_RANGE2(err,first,num,x,ev,er) {\
- if (((unsigned)(first)+(num)-1)>(x)->max_key_code) {\
- (ev)=_XkbErrCode4(err,(first),(num),(x)->max_key_code);\
- return er;\
- }\
- else if ( (first)<(x)->min_key_code ) {\
- (ev)=_XkbErrCode3(err+1,(first),xkb->min_key_code);\
- return er;\
- }\
-}
-#define CHK_KEY_RANGE(err,first,num,x) \
- CHK_KEY_RANGE2(err,first,num,x,client->errorValue,BadValue)
-
-#define CHK_REQ_KEY_RANGE2(err,first,num,r,ev,er) {\
- if (((unsigned)(first)+(num)-1)>(r)->maxKeyCode) {\
- (ev)=_XkbErrCode4(err,(first),(num),(r)->maxKeyCode);\
- return er;\
- }\
- else if ( (first)<(r)->minKeyCode ) {\
- (ev)=_XkbErrCode3(err+1,(first),(r)->minKeyCode);\
- return er;\
- }\
-}
-#define CHK_REQ_KEY_RANGE(err,first,num,r) \
- CHK_REQ_KEY_RANGE2(err,first,num,r,client->errorValue,BadValue)
-
-/***====================================================================***/
-
-int
-ProcXkbUseExtension(ClientPtr client)
-{
- REQUEST(xkbUseExtensionReq);
- xkbUseExtensionReply rep;
- register int n;
- int supported;
-
- REQUEST_SIZE_MATCH(xkbUseExtensionReq);
- if (stuff->wantedMajor != XkbMajorVersion) {
- /* pre-release version 0.65 is compatible with 1.00 */
- supported= ((XkbMajorVersion==1)&&
- (stuff->wantedMajor==0)&&(stuff->wantedMinor==65));
- }
- else supported = 1;
-
-#ifdef XKB_SWAPPING_BUSTED
- if (client->swapped)
- supported= 0;
-#endif
-
- if ((supported) && (!(client->xkbClientFlags&_XkbClientInitialized))) {
- client->xkbClientFlags= _XkbClientInitialized;
- client->vMajor= stuff->wantedMajor;
- client->vMinor= stuff->wantedMinor;
- }
- else if (xkbDebugFlags&0x1) {
- ErrorF("Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n",
- client->index,
- (long)client->clientAsMask,
- stuff->wantedMajor,stuff->wantedMinor,
- XkbMajorVersion,XkbMinorVersion);
- }
- rep.type = X_Reply;
- rep.supported = supported;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.serverMajor = XkbMajorVersion;
- rep.serverMinor = XkbMinorVersion;
- if ( client->swapped ) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.serverMajor, n);
- swaps(&rep.serverMinor, n);
- }
- WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbSelectEvents(ClientPtr client)
-{
- unsigned legal;
- DeviceIntPtr dev;
- XkbInterestPtr masks;
- REQUEST(xkbSelectEventsReq);
-
- REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_ANY_DEVICE(dev,stuff->deviceSpec);
-
- if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) {
- client->mapNotifyMask&= ~stuff->affectMap;
- client->mapNotifyMask|= (stuff->affectMap&stuff->map);
- }
- if ((stuff->affectWhich&(~XkbMapNotifyMask))==0)
- return client->noClientException;
-
- masks = XkbFindClientResource((DevicePtr)dev,client);
- if (!masks){
- XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
- masks= XkbAddClientResource((DevicePtr)dev,client,id);
- }
- if (masks) {
- union {
- CARD8 *c8;
- CARD16 *c16;
- CARD32 *c32;
- } from,to;
- register unsigned bit,ndx,maskLeft,dataLeft,size;
-
- from.c8= (CARD8 *)&stuff[1];
- dataLeft= (stuff->length*4)-SIZEOF(xkbSelectEventsReq);
- maskLeft= (stuff->affectWhich&(~XkbMapNotifyMask));
- for (ndx=0,bit=1; (maskLeft!=0); ndx++, bit<<=1) {
- if ((bit&maskLeft)==0)
- continue;
- maskLeft&= ~bit;
- switch (ndx) {
- case XkbNewKeyboardNotify:
- to.c16= &client->newKeyboardNotifyMask;
- legal= XkbAllNewKeyboardEventsMask;
- size= 2;
- break;
- case XkbStateNotify:
- to.c16= &masks->stateNotifyMask;
- legal= XkbAllStateEventsMask;
- size= 2;
- break;
- case XkbControlsNotify:
- to.c32= &masks->ctrlsNotifyMask;
- legal= XkbAllControlEventsMask;
- size= 4;
- break;
- case XkbIndicatorStateNotify:
- to.c32= &masks->iStateNotifyMask;
- legal= XkbAllIndicatorEventsMask;
- size= 4;
- break;
- case XkbIndicatorMapNotify:
- to.c32= &masks->iMapNotifyMask;
- legal= XkbAllIndicatorEventsMask;
- size= 4;
- break;
- case XkbNamesNotify:
- to.c16= &masks->namesNotifyMask;
- legal= XkbAllNameEventsMask;
- size= 2;
- break;
- case XkbCompatMapNotify:
- to.c8= &masks->compatNotifyMask;
- legal= XkbAllCompatMapEventsMask;
- size= 1;
- break;
- case XkbBellNotify:
- to.c8= &masks->bellNotifyMask;
- legal= XkbAllBellEventsMask;
- size= 1;
- break;
- case XkbActionMessage:
- to.c8= &masks->actionMessageMask;
- legal= XkbAllActionMessagesMask;
- size= 1;
- break;
- case XkbAccessXNotify:
- to.c16= &masks->accessXNotifyMask;
- legal= XkbAllAccessXEventsMask;
- size= 2;
- break;
- case XkbExtensionDeviceNotify:
- to.c16= &masks->extDevNotifyMask;
- legal= XkbAllExtensionDeviceEventsMask;
- size= 2;
- break;
- default:
- client->errorValue = _XkbErrCode2(33,bit);
- return BadValue;
- }
-
- if (stuff->clear&bit) {
- if (size==2) to.c16[0]= 0;
- else if (size==4) to.c32[0]= 0;
- else to.c8[0]= 0;
- }
- else if (stuff->selectAll&bit) {
- if (size==2) to.c16[0]= ~0;
- else if (size==4) to.c32[0]= ~0;
- else to.c8[0]= ~0;
- }
- else {
- if (dataLeft<(size*2))
- return BadLength;
- if (size==2) {
- CHK_MASK_MATCH(ndx,from.c16[0],from.c16[1]);
- CHK_MASK_LEGAL(ndx,from.c16[0],legal);
- to.c16[0]&= ~from.c16[0];
- to.c16[0]|= (from.c16[0]&from.c16[1]);
- }
- else if (size==4) {
- CHK_MASK_MATCH(ndx,from.c32[0],from.c32[1]);
- CHK_MASK_LEGAL(ndx,from.c32[0],legal);
- to.c32[0]&= ~from.c32[0];
- to.c32[0]|= (from.c32[0]&from.c32[1]);
- }
- else {
- CHK_MASK_MATCH(ndx,from.c8[0],from.c8[1]);
- CHK_MASK_LEGAL(ndx,from.c8[0],legal);
- to.c8[0]&= ~from.c8[0];
- to.c8[0]|= (from.c8[0]&from.c8[1]);
- size= 2;
- }
- from.c8+= (size*2);
- dataLeft-= (size*2);
- }
- }
- if (dataLeft>2) {
- ErrorF("Extra data (%d bytes) after SelectEvents\n",dataLeft);
- return BadLength;
- }
- return client->noClientException;
- }
- return BadAlloc;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbBell(ClientPtr client)
-{
- REQUEST(xkbBellReq);
- DeviceIntPtr dev;
- WindowPtr pWin;
- int base;
- int newPercent,oldPitch,oldDuration;
- pointer ctrl;
-
- REQUEST_SIZE_MATCH(xkbBellReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_BELL_DEVICE(dev,stuff->deviceSpec);
- CHK_ATOM_OR_NONE(stuff->name);
-
- if ((stuff->forceSound)&&(stuff->eventOnly)) {
- client->errorValue=_XkbErrCode3(0x1,stuff->forceSound,stuff->eventOnly);
- return BadMatch;
- }
- if (stuff->percent < -100 || stuff->percent > 100) {
- client->errorValue = _XkbErrCode2(0x2,stuff->percent);
- return BadValue;
- }
- if (stuff->duration<-1) {
- client->errorValue = _XkbErrCode2(0x3,stuff->duration);
- return BadValue;
- }
- if (stuff->pitch<-1) {
- client->errorValue = _XkbErrCode2(0x4,stuff->pitch);
- return BadValue;
- }
-
- if (stuff->bellClass == XkbDfltXIClass) {
- if (dev->kbdfeed!=NULL)
- stuff->bellClass= KbdFeedbackClass;
- else stuff->bellClass= BellFeedbackClass;
- }
- if (stuff->bellClass == KbdFeedbackClass) {
- KbdFeedbackPtr k;
- if (stuff->bellID==XkbDfltXIId)
- k= dev->kbdfeed;
- else {
- for (k=dev->kbdfeed; k; k=k->next) {
- if (k->ctrl.id == stuff->bellID)
- break;
- }
- }
- if (!k) {
- client->errorValue= _XkbErrCode2(0x5,stuff->bellID);
- return BadValue;
- }
- base = k->ctrl.bell;
- ctrl = (pointer) &(k->ctrl);
- oldPitch= k->ctrl.bell_pitch;
- oldDuration= k->ctrl.bell_duration;
- if (stuff->pitch!=0) {
- if (stuff->pitch==-1)
- k->ctrl.bell_pitch= defaultKeyboardControl.bell_pitch;
- else k->ctrl.bell_pitch= stuff->pitch;
- }
- if (stuff->duration!=0) {
- if (stuff->duration==-1)
- k->ctrl.bell_duration= defaultKeyboardControl.bell_duration;
- else k->ctrl.bell_duration= stuff->duration;
- }
- }
- else if (stuff->bellClass == BellFeedbackClass) {
- BellFeedbackPtr b;
- if (stuff->bellID==XkbDfltXIId)
- b= dev->bell;
- else {
- for (b=dev->bell; b; b=b->next) {
- if (b->ctrl.id == stuff->bellID)
- break;
- }
- }
- if (!b) {
- client->errorValue = _XkbErrCode2(0x6,stuff->bellID);
- return BadValue;
- }
- base = b->ctrl.percent;
- ctrl = (pointer) &(b->ctrl);
- oldPitch= b->ctrl.pitch;
- oldDuration= b->ctrl.duration;
- if (stuff->pitch!=0) {
- if (stuff->pitch==-1)
- b->ctrl.pitch= defaultKeyboardControl.bell_pitch;
- else b->ctrl.pitch= stuff->pitch;
- }
- if (stuff->duration!=0) {
- if (stuff->duration==-1)
- b->ctrl.duration= defaultKeyboardControl.bell_duration;
- else b->ctrl.duration= stuff->duration;
- }
- }
- else {
- client->errorValue = _XkbErrCode2(0x7,stuff->bellClass);;
- return BadValue;
- }
- if (stuff->window!=None) {
- pWin= (WindowPtr)LookupIDByType(stuff->window,RT_WINDOW);
- if (pWin==NULL) {
- client->errorValue= stuff->window;
- return BadValue;
- }
- }
- else pWin= NULL;
-
- newPercent= (base*stuff->percent)/100;
- if (stuff->percent < 0)
- newPercent= base+newPercent;
- else newPercent= base-newPercent+stuff->percent;
- XkbHandleBell(stuff->forceSound, stuff->eventOnly,
- dev, newPercent, ctrl, stuff->bellClass,
- stuff->name, pWin, client);
- if ((stuff->pitch!=0)||(stuff->duration!=0)) {
- if (stuff->bellClass == KbdFeedbackClass) {
- KbdFeedbackPtr k;
- k= (KbdFeedbackPtr)ctrl;
- if (stuff->pitch!=0)
- k->ctrl.bell_pitch= oldPitch;
- if (stuff->duration!=0)
- k->ctrl.bell_duration= oldDuration;
- }
- else {
- BellFeedbackPtr b;
- b= (BellFeedbackPtr)ctrl;
- if (stuff->pitch!=0)
- b->ctrl.pitch= oldPitch;
- if (stuff->duration!=0)
- b->ctrl.duration= oldDuration;
- }
- }
- return Success;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbGetState(ClientPtr client)
-{
- REQUEST(xkbGetStateReq);
- DeviceIntPtr dev;
- xkbGetStateReply rep;
- XkbStateRec *xkb;
-
- REQUEST_SIZE_MATCH(xkbGetStateReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- xkb= &dev->key->xkbInfo->state;
- bzero(&rep,sizeof(xkbGetStateReply));
- rep.type= X_Reply;
- rep.sequenceNumber= client->sequence;
- rep.length = 0;
- rep.deviceID = dev->id;
- rep.mods = dev->key->state&0xff;
- rep.baseMods = xkb->base_mods;
- rep.lockedMods = xkb->locked_mods;
- rep.latchedMods = xkb->latched_mods;
- rep.group = xkb->group;
- rep.baseGroup = xkb->base_group;
- rep.latchedGroup = xkb->latched_group;
- rep.lockedGroup = xkb->locked_group;
- rep.compatState = xkb->compat_state;
- rep.ptrBtnState = xkb->ptr_buttons;
- if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swaps(&rep.ptrBtnState,n);
- }
- WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbLatchLockState(ClientPtr client)
-{
- int status;
- DeviceIntPtr dev;
- XkbStateRec oldState,*newState;
- CARD16 changed;
-
- REQUEST(xkbLatchLockStateReq);
- REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_MATCH(0x01,stuff->affectModLocks,stuff->modLocks);
- CHK_MASK_MATCH(0x01,stuff->affectModLatches,stuff->modLatches);
-
- status = Success;
- oldState= dev->key->xkbInfo->state;
- newState= &dev->key->xkbInfo->state;
- if ( stuff->affectModLocks ) {
- newState->locked_mods&= ~stuff->affectModLocks;
- newState->locked_mods|= (stuff->affectModLocks&stuff->modLocks);
- }
- if (( status == Success ) && stuff->lockGroup )
- newState->locked_group = stuff->groupLock;
- if (( status == Success ) && stuff->affectModLatches )
- status=XkbLatchModifiers(dev,stuff->affectModLatches,stuff->modLatches);
- if (( status == Success ) && stuff->latchGroup )
- status=XkbLatchGroup(dev,stuff->groupLatch);
-
- if ( status != Success )
- return status;
-
- XkbComputeDerivedState(dev->key->xkbInfo);
- dev->key->state= XkbStateFieldFromRec(newState);
-
- changed = XkbStateChangedFlags(&oldState,newState);
- if (changed) {
- xkbStateNotify sn;
- sn.keycode= 0;
- sn.eventType= 0;
- sn.requestMajor = XkbReqCode;
- sn.requestMinor = X_kbLatchLockState;
- sn.changed= changed;
- XkbSendStateNotify(dev,&sn);
- changed= XkbIndicatorsToUpdate(dev,changed,False);
- if (changed) {
- XkbEventCauseRec cause;
- XkbSetCauseXkbReq(&cause,X_kbLatchLockState,client);
- XkbUpdateIndicators(dev,changed,True,NULL,&cause);
- }
- }
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbGetControls(ClientPtr client)
-{
- xkbGetControlsReply rep;
- XkbControlsPtr xkb;
- DeviceIntPtr dev;
- register int n;
-
- REQUEST(xkbGetControlsReq);
- REQUEST_SIZE_MATCH(xkbGetControlsReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- xkb = dev->key->xkbInfo->desc->ctrls;
- rep.type = X_Reply;
- rep.length = (SIZEOF(xkbGetControlsReply)-
- SIZEOF(xGenericReply)) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.deviceID = ((DeviceIntPtr)dev)->id;
- rep.numGroups = xkb->num_groups;
- rep.groupsWrap = xkb->groups_wrap;
- rep.internalMods = xkb->internal.mask;
- rep.ignoreLockMods = xkb->ignore_lock.mask;
- rep.internalRealMods = xkb->internal.real_mods;
- rep.ignoreLockRealMods = xkb->ignore_lock.real_mods;
- rep.internalVMods = xkb->internal.vmods;
- rep.ignoreLockVMods = xkb->ignore_lock.vmods;
- rep.enabledCtrls = xkb->enabled_ctrls;
- rep.repeatDelay = xkb->repeat_delay;
- rep.repeatInterval = xkb->repeat_interval;
- rep.slowKeysDelay = xkb->slow_keys_delay;
- rep.debounceDelay = xkb->debounce_delay;
- rep.mkDelay = xkb->mk_delay;
- rep.mkInterval = xkb->mk_interval;
- rep.mkTimeToMax = xkb->mk_time_to_max;
- rep.mkMaxSpeed = xkb->mk_max_speed;
- rep.mkCurve = xkb->mk_curve;
- rep.mkDfltBtn = xkb->mk_dflt_btn;
- rep.axTimeout = xkb->ax_timeout;
- rep.axtCtrlsMask = xkb->axt_ctrls_mask;
- rep.axtCtrlsValues = xkb->axt_ctrls_values;
- rep.axtOptsMask = xkb->axt_opts_mask;
- rep.axtOptsValues = xkb->axt_opts_values;
- rep.axOptions = xkb->ax_options;
- memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length,n);
- swaps(&rep.internalVMods, n);
- swaps(&rep.ignoreLockVMods, n);
- swapl(&rep.enabledCtrls, n);
- swaps(&rep.repeatDelay, n);
- swaps(&rep.repeatInterval, n);
- swaps(&rep.slowKeysDelay, n);
- swaps(&rep.debounceDelay, n);
- swaps(&rep.mkDelay, n);
- swaps(&rep.mkInterval, n);
- swaps(&rep.mkTimeToMax, n);
- swaps(&rep.mkMaxSpeed, n);
- swaps(&rep.mkCurve, n);
- swaps(&rep.axTimeout, n);
- swapl(&rep.axtCtrlsMask, n);
- swapl(&rep.axtCtrlsValues, n);
- swaps(&rep.axtOptsMask, n);
- swaps(&rep.axtOptsValues, n);
- swaps(&rep.axOptions, n);
- }
- WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep);
- return(client->noClientException);
-}
-
-int
-ProcXkbSetControls(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbSrvInfoPtr xkbi;
- XkbControlsPtr ctrl;
- XkbControlsRec new,old;
- xkbControlsNotify cn;
- XkbEventCauseRec cause;
- XkbSrvLedInfoPtr sli;
-
- REQUEST(xkbSetControlsReq);
- REQUEST_SIZE_MATCH(xkbSetControlsReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,stuff->changeCtrls,XkbAllControlsMask);
-
- xkbi = dev->key->xkbInfo;
- ctrl = xkbi->desc->ctrls;
- new = *ctrl;
- XkbSetCauseXkbReq(&cause,X_kbSetControls,client);
- if (stuff->changeCtrls&XkbInternalModsMask) {
- CHK_MASK_MATCH(0x02,stuff->affectInternalMods,stuff->internalMods);
- CHK_MASK_MATCH(0x03,stuff->affectInternalVMods,stuff->internalVMods);
- new.internal.real_mods&=~stuff->affectInternalMods;
- new.internal.real_mods|=(stuff->affectInternalMods&stuff->internalMods);
- new.internal.vmods&=~stuff->affectInternalVMods;
- new.internal.vmods|= (stuff->affectInternalVMods&stuff->internalVMods);
- new.internal.mask= new.internal.real_mods|
- XkbMaskForVMask(xkbi->desc,new.internal.vmods);
- }
- if (stuff->changeCtrls&XkbIgnoreLockModsMask) {
- CHK_MASK_MATCH(0x4,stuff->affectIgnoreLockMods,stuff->ignoreLockMods);
- CHK_MASK_MATCH(0x5,stuff->affectIgnoreLockVMods,stuff->ignoreLockVMods);
- new.ignore_lock.real_mods&=~stuff->affectIgnoreLockMods;
- new.ignore_lock.real_mods|=
- (stuff->affectIgnoreLockMods&stuff->ignoreLockMods);
- new.ignore_lock.vmods&= ~stuff->affectIgnoreLockVMods;
- new.ignore_lock.vmods|=
- (stuff->affectIgnoreLockVMods&stuff->ignoreLockVMods);
- new.ignore_lock.mask= new.ignore_lock.real_mods|
- XkbMaskForVMask(xkbi->desc,new.ignore_lock.vmods);
- }
- CHK_MASK_MATCH(0x06,stuff->affectEnabledCtrls,stuff->enabledCtrls);
- if (stuff->affectEnabledCtrls) {
- CHK_MASK_LEGAL(0x07,stuff->affectEnabledCtrls,XkbAllBooleanCtrlsMask);
- new.enabled_ctrls&= ~stuff->affectEnabledCtrls;
- new.enabled_ctrls|= (stuff->affectEnabledCtrls&stuff->enabledCtrls);
- }
- if (stuff->changeCtrls&XkbRepeatKeysMask) {
- if ((stuff->repeatDelay<1)||(stuff->repeatInterval<1)) {
- client->errorValue = _XkbErrCode3(0x08,stuff->repeatDelay,
- stuff->repeatInterval);
- return BadValue;
- }
- new.repeat_delay = stuff->repeatDelay;
- new.repeat_interval = stuff->repeatInterval;
- }
- if (stuff->changeCtrls&XkbSlowKeysMask) {
- if (stuff->slowKeysDelay<1) {
- client->errorValue = _XkbErrCode2(0x09,stuff->slowKeysDelay);
- return BadValue;
- }
- new.slow_keys_delay = stuff->slowKeysDelay;
- }
- if (stuff->changeCtrls&XkbBounceKeysMask) {
- if (stuff->debounceDelay<1) {
- client->errorValue = _XkbErrCode2(0x0A,stuff->debounceDelay);
- return BadValue;
- }
- new.debounce_delay = stuff->debounceDelay;
- }
- if (stuff->changeCtrls&XkbMouseKeysMask) {
- if (stuff->mkDfltBtn>XkbMaxMouseKeysBtn) {
- client->errorValue = _XkbErrCode2(0x0B,stuff->mkDfltBtn);
- return BadValue;
- }
- new.mk_dflt_btn = stuff->mkDfltBtn;
- }
- if (stuff->changeCtrls&XkbMouseKeysAccelMask) {
- if ((stuff->mkDelay<1) || (stuff->mkInterval<1) ||
- (stuff->mkTimeToMax<1) || (stuff->mkMaxSpeed<1)||
- (stuff->mkCurve<-1000)) {
- client->errorValue = _XkbErrCode2(0x0C,0);
- return BadValue;
- }
- new.mk_delay = stuff->mkDelay;
- new.mk_interval = stuff->mkInterval;
- new.mk_time_to_max = stuff->mkTimeToMax;
- new.mk_max_speed = stuff->mkMaxSpeed;
- new.mk_curve = stuff->mkCurve;
- AccessXComputeCurveFactor(xkbi,&new);
- }
- if (stuff->changeCtrls&XkbGroupsWrapMask) {
- unsigned act,num;
- act= XkbOutOfRangeGroupAction(stuff->groupsWrap);
- switch (act) {
- case XkbRedirectIntoRange:
- num= XkbOutOfRangeGroupNumber(stuff->groupsWrap);
- if (num>=new.num_groups) {
- client->errorValue= _XkbErrCode3(0x0D,new.num_groups,num);
- return BadValue;
- }
- case XkbWrapIntoRange:
- case XkbClampIntoRange:
- break;
- default:
- client->errorValue= _XkbErrCode2(0x0E,act);
- return BadValue;
- }
- new.groups_wrap= stuff->groupsWrap;
- }
- CHK_MASK_LEGAL(0x0F,stuff->axOptions,XkbAX_AllOptionsMask);
- if (stuff->changeCtrls&XkbAccessXKeysMask)
- new.ax_options = stuff->axOptions&XkbAX_AllOptionsMask;
- else {
- if (stuff->changeCtrls&XkbStickyKeysMask) {
- new.ax_options&= ~XkbAX_SKOptionsMask;
- new.ax_options|= stuff->axOptions&XkbAX_SKOptionsMask;
- }
- if (stuff->changeCtrls&XkbAccessXFeedbackMask) {
- new.ax_options&= ~XkbAX_FBOptionsMask;
- new.ax_options|= stuff->axOptions&XkbAX_FBOptionsMask;
- }
- }
-
- if (stuff->changeCtrls&XkbAccessXTimeoutMask) {
- if (stuff->axTimeout<1) {
- client->errorValue = _XkbErrCode2(0x10,stuff->axTimeout);
- return BadValue;
- }
- CHK_MASK_MATCH(0x11,stuff->axtCtrlsMask,stuff->axtCtrlsValues);
- CHK_MASK_LEGAL(0x12,stuff->axtCtrlsMask,XkbAllBooleanCtrlsMask);
- CHK_MASK_MATCH(0x13,stuff->axtOptsMask,stuff->axtOptsValues);
- CHK_MASK_LEGAL(0x14,stuff->axtOptsMask,XkbAX_AllOptionsMask);
- new.ax_timeout = stuff->axTimeout;
- new.axt_ctrls_mask = stuff->axtCtrlsMask;
- new.axt_ctrls_values = (stuff->axtCtrlsValues&stuff->axtCtrlsMask);
- new.axt_opts_mask = stuff->axtOptsMask;
- new.axt_opts_values= (stuff->axtOptsValues&stuff->axtOptsMask);
- }
- if (stuff->changeCtrls&XkbPerKeyRepeatMask) {
- memcpy(new.per_key_repeat,stuff->perKeyRepeat,XkbPerKeyBitArraySize);
- }
- old= *ctrl;
- *ctrl= new;
- XkbDDXChangeControls(dev,&old,ctrl);
- if (XkbComputeControlsNotify(dev,&old,ctrl,&cn,False)) {
- cn.keycode= 0;
- cn.eventType = 0;
- cn.requestMajor = XkbReqCode;
- cn.requestMinor = X_kbSetControls;
- XkbSendControlsNotify(dev,&cn);
- }
- if ((sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0))!=NULL)
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
-#ifndef NO_CLEAR_LATCHES_FOR_STICKY_KEYS_OFF
- /* If sticky keys were disabled, clear all locks and latches */
- if ((old.enabled_ctrls&XkbStickyKeysMask)&&
- (!(ctrl->enabled_ctrls&XkbStickyKeysMask))) {
- XkbClearAllLatchesAndLocks(dev,xkbi,True,&cause);
- }
-#endif
- return client->noClientException;
-}
-
-int
-XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor)
-{
-int changed= 0;
-XkbControlsRec old,*xkb;
-
- if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
- return 0;
- xkb= dev->key->xkbInfo->desc->ctrls;
- old= *xkb;
- if ((timeout!=0) && (xkb->repeat_delay!=timeout)) {
- xkb->repeat_delay= timeout;
- changed++;
- }
- if ((interval!=0) && (xkb->repeat_interval!=interval)) {
- xkb->repeat_interval= interval;
- changed++;
- }
- if (changed) {
- xkbControlsNotify cn;
- XkbDDXChangeControls(dev,&old,xkb);
- if (XkbComputeControlsNotify(dev,&old,xkb,&cn,False)) {
- cn.keycode= 0;
- cn.eventType = 0;
- cn.requestMajor = major;
- cn.requestMinor = minor;
- XkbSendControlsNotify(dev,&cn);
- }
- }
- return 1;
-}
-
-int
-XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval)
-{
-XkbControlsPtr xkb;
-
- if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
- return 0;
- xkb= dev->key->xkbInfo->desc->ctrls;
- if (timeout) *timeout= xkb->repeat_delay;
- if (interval) *interval= xkb->repeat_interval;
- return 1;
-}
-
-/***====================================================================***/
-
-static int
-XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- XkbKeyTypeRec *type;
- unsigned i,len;
-
- len= 0;
- if (((rep->present&XkbKeyTypesMask)==0)||(rep->nTypes<1)||
- (!xkb)||(!xkb->map)||(!xkb->map->types)) {
- rep->present&= ~XkbKeyTypesMask;
- rep->firstType= rep->nTypes= 0;
- return 0;
- }
- type= &xkb->map->types[rep->firstType];
- for (i=0;i<rep->nTypes;i++,type++){
- len+= SIZEOF(xkbKeyTypeWireDesc);
- if (type->map_count>0) {
- len+= (type->map_count*SIZEOF(xkbKTMapEntryWireDesc));
- if (type->preserve)
- len+= (type->map_count*SIZEOF(xkbModsWireDesc));
- }
- }
- return len;
-}
-
-static char *
-XkbWriteKeyTypes( XkbDescPtr xkb,
- xkbGetMapReply * rep,
- char * buf,
- ClientPtr client)
-{
- XkbKeyTypePtr type;
- unsigned i;
- xkbKeyTypeWireDesc *wire;
-
- type= &xkb->map->types[rep->firstType];
- for (i=0;i<rep->nTypes;i++,type++) {
- register unsigned n;
- wire= (xkbKeyTypeWireDesc *)buf;
- wire->mask = type->mods.mask;
- wire->realMods = type->mods.real_mods;
- wire->virtualMods = type->mods.vmods;
- wire->numLevels = type->num_levels;
- wire->nMapEntries = type->map_count;
- wire->preserve = (type->preserve!=NULL);
- if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
- }
-
- buf= (char *)&wire[1];
- if (wire->nMapEntries>0) {
- xkbKTMapEntryWireDesc * wire;
- XkbKTMapEntryPtr entry;
- wire= (xkbKTMapEntryWireDesc *)buf;
- entry= type->map;
- for (n=0;n<type->map_count;n++,wire++,entry++) {
- wire->active= entry->active;
- wire->mask= entry->mods.mask;
- wire->level= entry->level;
- wire->realMods= entry->mods.real_mods;
- wire->virtualMods= entry->mods.vmods;
- if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
- }
- }
- buf= (char *)wire;
- if (type->preserve!=NULL) {
- xkbModsWireDesc * pwire;
- XkbModsPtr preserve;
- pwire= (xkbModsWireDesc *)buf;
- preserve= type->preserve;
- for (n=0;n<type->map_count;n++,pwire++,preserve++) {
- pwire->mask= preserve->mask;
- pwire->realMods= preserve->real_mods;
- pwire->virtualMods= preserve->vmods;
- if (client->swapped) {
- register int n;
- swaps(&pwire->virtualMods,n);
- }
- }
- buf= (char *)pwire;
- }
- }
- }
- return buf;
-}
-
-static int
-XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- XkbSymMapPtr symMap;
- unsigned i,len;
- unsigned nSyms,nSymsThisKey;
-
- if (((rep->present&XkbKeySymsMask)==0)||(rep->nKeySyms<1)||
- (!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)) {
- rep->present&= ~XkbKeySymsMask;
- rep->firstKeySym= rep->nKeySyms= 0;
- rep->totalSyms= 0;
- return 0;
- }
- len= rep->nKeySyms*SIZEOF(xkbSymMapWireDesc);
- symMap = &xkb->map->key_sym_map[rep->firstKeySym];
- for (i=nSyms=0;i<rep->nKeySyms;i++,symMap++) {
- if (symMap->offset!=0) {
- nSymsThisKey= XkbNumGroups(symMap->group_info)*symMap->width;
- nSyms+= nSymsThisKey;
- }
- }
- len+= nSyms*4;
- rep->totalSyms= nSyms;
- return len;
-}
-
-static int
-XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
-register unsigned i,nMods,bit;
-
- if (((rep->present&XkbVirtualModsMask)==0)||(rep->virtualMods==0)||
- (!xkb)||(!xkb->server)) {
- rep->present&= ~XkbVirtualModsMask;
- rep->virtualMods= 0;
- return 0;
- }
- for (i=nMods=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (rep->virtualMods&bit)
- nMods++;
- }
- return XkbPaddedSize(nMods);
-}
-
-static char *
-XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client)
-{
-register KeySym * pSym;
-XkbSymMapPtr symMap;
-xkbSymMapWireDesc * outMap;
-register unsigned i;
-
- symMap = &xkb->map->key_sym_map[rep->firstKeySym];
- for (i=0;i<rep->nKeySyms;i++,symMap++) {
- outMap = (xkbSymMapWireDesc *)buf;
- outMap->ktIndex[0] = symMap->kt_index[0];
- outMap->ktIndex[1] = symMap->kt_index[1];
- outMap->ktIndex[2] = symMap->kt_index[2];
- outMap->ktIndex[3] = symMap->kt_index[3];
- outMap->groupInfo = symMap->group_info;
- outMap->width= symMap->width;
- outMap->nSyms = symMap->width*XkbNumGroups(symMap->group_info);
- buf= (char *)&outMap[1];
- if (outMap->nSyms==0)
- continue;
-
- pSym = &xkb->map->syms[symMap->offset];
- memcpy((char *)buf,(char *)pSym,outMap->nSyms*4);
- if (client->swapped) {
- register int n,nSyms= outMap->nSyms;
- swaps(&outMap->nSyms,n);
- while (nSyms-->0) {
- swapl(buf,n);
- buf+= 4;
- }
- }
- else buf+= outMap->nSyms*4;
- }
- return buf;
-}
-
-static int
-XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- unsigned i,len,nActs;
- register KeyCode firstKey;
-
- if (((rep->present&XkbKeyActionsMask)==0)||(rep->nKeyActs<1)||
- (!xkb)||(!xkb->server)||(!xkb->server->key_acts)) {
- rep->present&= ~XkbKeyActionsMask;
- rep->firstKeyAct= rep->nKeyActs= 0;
- rep->totalActs= 0;
- return 0;
- }
- firstKey= rep->firstKeyAct;
- for (nActs=i=0;i<rep->nKeyActs;i++) {
- if (xkb->server->key_acts[i+firstKey]!=0)
- nActs+= XkbKeyNumActions(xkb,i+firstKey);
- }
- len= XkbPaddedSize(rep->nKeyActs)+(nActs*SIZEOF(xkbActionWireDesc));
- rep->totalActs= nActs;
- return len;
-}
-
-static char *
-XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,
- ClientPtr client)
-{
- unsigned i;
- CARD8 * numDesc;
- XkbAnyAction * actDesc;
-
- numDesc = (CARD8 *)buf;
- for (i=0;i<rep->nKeyActs;i++) {
- if (xkb->server->key_acts[i+rep->firstKeyAct]==0)
- numDesc[i] = 0;
- else numDesc[i] = XkbKeyNumActions(xkb,(i+rep->firstKeyAct));
- }
- buf+= XkbPaddedSize(rep->nKeyActs);
-
- actDesc = (XkbAnyAction *)buf;
- for (i=0;i<rep->nKeyActs;i++) {
- if (xkb->server->key_acts[i+rep->firstKeyAct]!=0) {
- unsigned int num;
- num = XkbKeyNumActions(xkb,(i+rep->firstKeyAct));
- memcpy((char *)actDesc,
- (char*)XkbKeyActionsPtr(xkb,(i+rep->firstKeyAct)),
- num*SIZEOF(xkbActionWireDesc));
- actDesc+= num;
- }
- }
- buf = (char *)actDesc;
- return buf;
-}
-
-static int
-XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- unsigned i,len,nBhvr;
- XkbBehavior * bhv;
-
- if (((rep->present&XkbKeyBehaviorsMask)==0)||(rep->nKeyBehaviors<1)||
- (!xkb)||(!xkb->server)||(!xkb->server->behaviors)) {
- rep->present&= ~XkbKeyBehaviorsMask;
- rep->firstKeyBehavior= rep->nKeyBehaviors= 0;
- rep->totalKeyBehaviors= 0;
- return 0;
- }
- bhv= &xkb->server->behaviors[rep->firstKeyBehavior];
- for (nBhvr=i=0;i<rep->nKeyBehaviors;i++,bhv++) {
- if (bhv->type!=XkbKB_Default)
- nBhvr++;
- }
- len= nBhvr*SIZEOF(xkbBehaviorWireDesc);
- rep->totalKeyBehaviors= nBhvr;
- return len;
-}
-
-static char *
-XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,
- ClientPtr client)
-{
- unsigned i;
- xkbBehaviorWireDesc *wire;
- XkbBehavior *pBhvr;
-
- wire = (xkbBehaviorWireDesc *)buf;
- pBhvr= &xkb->server->behaviors[rep->firstKeyBehavior];
- for (i=0;i<rep->nKeyBehaviors;i++,pBhvr++) {
- if (pBhvr->type!=XkbKB_Default) {
- wire->key= i+rep->firstKeyBehavior;
- wire->type= pBhvr->type;
- wire->data= pBhvr->data;
- wire++;
- }
- }
- buf = (char *)wire;
- return buf;
-}
-
-static int
-XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- unsigned i,len,nRtrn;
-
- if (((rep->present&XkbExplicitComponentsMask)==0)||(rep->nKeyExplicit<1)||
- (!xkb)||(!xkb->server)||(!xkb->server->explicit)) {
- rep->present&= ~XkbExplicitComponentsMask;
- rep->firstKeyExplicit= rep->nKeyExplicit= 0;
- rep->totalKeyExplicit= 0;
- return 0;
- }
- for (nRtrn=i=0;i<rep->nKeyExplicit;i++) {
- if (xkb->server->explicit[i+rep->firstKeyExplicit]!=0)
- nRtrn++;
- }
- rep->totalKeyExplicit= nRtrn;
- len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero explicit component */
- return len;
-}
-
-static char *
-XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client)
-{
-unsigned i;
-char * start;
-unsigned char * pExp;
-
- start= buf;
- pExp= &xkb->server->explicit[rep->firstKeyExplicit];
- for (i=0;i<rep->nKeyExplicit;i++,pExp++) {
- if (*pExp!=0) {
- *buf++= i+rep->firstKeyExplicit;
- *buf++= *pExp;
- }
- }
- i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */
- return buf+i;
-}
-
-static int
-XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- unsigned i,len,nRtrn;
-
- if (((rep->present&XkbModifierMapMask)==0)||(rep->nModMapKeys<1)||
- (!xkb)||(!xkb->map)||(!xkb->map->modmap)) {
- rep->present&= ~XkbModifierMapMask;
- rep->firstModMapKey= rep->nModMapKeys= 0;
- rep->totalModMapKeys= 0;
- return 0;
- }
- for (nRtrn=i=0;i<rep->nModMapKeys;i++) {
- if (xkb->map->modmap[i+rep->firstModMapKey]!=0)
- nRtrn++;
- }
- rep->totalModMapKeys= nRtrn;
- len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero modmap component */
- return len;
-}
-
-static char *
-XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,
- ClientPtr client)
-{
-unsigned i;
-char * start;
-unsigned char * pMap;
-
- start= buf;
- pMap= &xkb->map->modmap[rep->firstModMapKey];
- for (i=0;i<rep->nModMapKeys;i++,pMap++) {
- if (*pMap!=0) {
- *buf++= i+rep->firstModMapKey;
- *buf++= *pMap;
- }
- }
- i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */
- return buf+i;
-}
-
-static int
-XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
- unsigned i,len,nRtrn;
-
- if (((rep->present&XkbVirtualModMapMask)==0)||(rep->nVModMapKeys<1)||
- (!xkb)||(!xkb->server)||(!xkb->server->vmodmap)) {
- rep->present&= ~XkbVirtualModMapMask;
- rep->firstVModMapKey= rep->nVModMapKeys= 0;
- rep->totalVModMapKeys= 0;
- return 0;
- }
- for (nRtrn=i=0;i<rep->nVModMapKeys;i++) {
- if (xkb->server->vmodmap[i+rep->firstVModMapKey]!=0)
- nRtrn++;
- }
- rep->totalVModMapKeys= nRtrn;
- len= nRtrn*SIZEOF(xkbVModMapWireDesc);
- return len;
-}
-
-static char *
-XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,
- ClientPtr client)
-{
-unsigned i;
-xkbVModMapWireDesc * wire;
-unsigned short * pMap;
-
- wire= (xkbVModMapWireDesc *)buf;
- pMap= &xkb->server->vmodmap[rep->firstVModMapKey];
- for (i=0;i<rep->nVModMapKeys;i++,pMap++) {
- if (*pMap!=0) {
- wire->key= i+rep->firstVModMapKey;
- wire->vmods= *pMap;
- wire++;
- }
- }
- return (char *)wire;
-}
-
-static Status
-XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep)
-{
-int len;
-
- rep->minKeyCode= xkb->min_key_code;
- rep->maxKeyCode= xkb->max_key_code;
- len= XkbSizeKeyTypes(xkb,rep);
- len+= XkbSizeKeySyms(xkb,rep);
- len+= XkbSizeKeyActions(xkb,rep);
- len+= XkbSizeKeyBehaviors(xkb,rep);
- len+= XkbSizeVirtualMods(xkb,rep);
- len+= XkbSizeExplicit(xkb,rep);
- len+= XkbSizeModifierMap(xkb,rep);
- len+= XkbSizeVirtualModMap(xkb,rep);
- rep->length+= (len/4);
- return Success;
-}
-
-static int
-XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep)
-{
-unsigned i,len;
-char *desc,*start;
-
- len= (rep->length*4)-(SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply));
- start= desc= (char *)ALLOCATE_LOCAL(len);
- if (!start)
- return BadAlloc;
- if ( rep->nTypes>0 )
- desc = XkbWriteKeyTypes(xkb,rep,desc,client);
- if ( rep->nKeySyms>0 )
- desc = XkbWriteKeySyms(xkb,rep,desc,client);
- if ( rep->nKeyActs>0 )
- desc = XkbWriteKeyActions(xkb,rep,desc,client);
- if ( rep->totalKeyBehaviors>0 )
- desc = XkbWriteKeyBehaviors(xkb,rep,desc,client);
- if ( rep->virtualMods ) {
- register int sz,bit;
- for (i=sz=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (rep->virtualMods&bit) {
- desc[sz++]= xkb->server->vmods[i];
- }
- }
- desc+= XkbPaddedSize(sz);
- }
- if ( rep->totalKeyExplicit>0 )
- desc= XkbWriteExplicit(xkb,rep,desc,client);
- if ( rep->totalModMapKeys>0 )
- desc= XkbWriteModifierMap(xkb,rep,desc,client);
- if ( rep->totalVModMapKeys>0 )
- desc= XkbWriteVirtualModMap(xkb,rep,desc,client);
- if ((desc-start)!=(len)) {
- ErrorF("BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n",
- len, (unsigned long)(desc-start));
- }
- if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swaps(&rep->present,n);
- swaps(&rep->totalSyms,n);
- swaps(&rep->totalActs,n);
- }
- WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep);
- WriteToClient(client, len, start);
- DEALLOCATE_LOCAL((char *)start);
- return client->noClientException;
-}
-
-int
-ProcXkbGetMap(ClientPtr client)
-{
- DeviceIntPtr dev;
- xkbGetMapReply rep;
- XkbDescRec *xkb;
- int n,status;
-
- REQUEST(xkbGetMapReq);
- REQUEST_SIZE_MATCH(xkbGetMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_OVERLAP(0x01,stuff->full,stuff->partial);
- CHK_MASK_LEGAL(0x02,stuff->full,XkbAllMapComponentsMask);
- CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask);
-
- xkb= dev->key->xkbInfo->desc;
- bzero(&rep,sizeof(xkbGetMapReply));
- rep.type= X_Reply;
- rep.sequenceNumber= client->sequence;
- rep.length = (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2;
- rep.deviceID = dev->id;
- rep.present = stuff->partial|stuff->full;
- rep.minKeyCode = xkb->min_key_code;
- rep.maxKeyCode = xkb->max_key_code;
- if ( stuff->full&XkbKeyTypesMask ) {
- rep.firstType = 0;
- rep.nTypes = xkb->map->num_types;
- }
- else if (stuff->partial&XkbKeyTypesMask) {
- if (((unsigned)stuff->firstType+stuff->nTypes)>xkb->map->num_types) {
- client->errorValue = _XkbErrCode4(0x04,xkb->map->num_types,
- stuff->firstType,stuff->nTypes);
- return BadValue;
- }
- rep.firstType = stuff->firstType;
- rep.nTypes = stuff->nTypes;
- }
- else rep.nTypes = 0;
- rep.totalTypes = xkb->map->num_types;
-
- n= XkbNumKeys(xkb);
- if ( stuff->full&XkbKeySymsMask ) {
- rep.firstKeySym = xkb->min_key_code;
- rep.nKeySyms = n;
- }
- else if (stuff->partial&XkbKeySymsMask) {
- CHK_KEY_RANGE(0x05,stuff->firstKeySym,stuff->nKeySyms,xkb);
- rep.firstKeySym = stuff->firstKeySym;
- rep.nKeySyms = stuff->nKeySyms;
- }
- else rep.nKeySyms = 0;
- rep.totalSyms= 0;
-
- if ( stuff->full&XkbKeyActionsMask ) {
- rep.firstKeyAct= xkb->min_key_code;
- rep.nKeyActs= n;
- }
- else if (stuff->partial&XkbKeyActionsMask) {
- CHK_KEY_RANGE(0x07,stuff->firstKeyAct,stuff->nKeyActs,xkb);
- rep.firstKeyAct= stuff->firstKeyAct;
- rep.nKeyActs= stuff->nKeyActs;
- }
- else rep.nKeyActs= 0;
- rep.totalActs= 0;
-
- if ( stuff->full&XkbKeyBehaviorsMask ) {
- rep.firstKeyBehavior = xkb->min_key_code;
- rep.nKeyBehaviors = n;
- }
- else if (stuff->partial&XkbKeyBehaviorsMask) {
- CHK_KEY_RANGE(0x09,stuff->firstKeyBehavior,stuff->nKeyBehaviors,xkb);
- rep.firstKeyBehavior= stuff->firstKeyBehavior;
- rep.nKeyBehaviors= stuff->nKeyBehaviors;
- }
- else rep.nKeyBehaviors = 0;
- rep.totalKeyBehaviors= 0;
-
- if (stuff->full&XkbVirtualModsMask)
- rep.virtualMods= ~0;
- else if (stuff->partial&XkbVirtualModsMask)
- rep.virtualMods= stuff->virtualMods;
-
- if (stuff->full&XkbExplicitComponentsMask) {
- rep.firstKeyExplicit= xkb->min_key_code;
- rep.nKeyExplicit= n;
- }
- else if (stuff->partial&XkbExplicitComponentsMask) {
- CHK_KEY_RANGE(0x0B,stuff->firstKeyExplicit,stuff->nKeyExplicit,xkb);
- rep.firstKeyExplicit= stuff->firstKeyExplicit;
- rep.nKeyExplicit= stuff->nKeyExplicit;
- }
- else rep.nKeyExplicit = 0;
- rep.totalKeyExplicit= 0;
-
- if (stuff->full&XkbModifierMapMask) {
- rep.firstModMapKey= xkb->min_key_code;
- rep.nModMapKeys= n;
- }
- else if (stuff->partial&XkbModifierMapMask) {
- CHK_KEY_RANGE(0x0D,stuff->firstModMapKey,stuff->nModMapKeys,xkb);
- rep.firstModMapKey= stuff->firstModMapKey;
- rep.nModMapKeys= stuff->nModMapKeys;
- }
- else rep.nModMapKeys = 0;
- rep.totalModMapKeys= 0;
-
- if (stuff->full&XkbVirtualModMapMask) {
- rep.firstVModMapKey= xkb->min_key_code;
- rep.nVModMapKeys= n;
- }
- else if (stuff->partial&XkbVirtualModMapMask) {
- CHK_KEY_RANGE(0x0F,stuff->firstVModMapKey,stuff->nVModMapKeys,xkb);
- rep.firstVModMapKey= stuff->firstVModMapKey;
- rep.nVModMapKeys= stuff->nVModMapKeys;
- }
- else rep.nVModMapKeys = 0;
- rep.totalVModMapKeys= 0;
-
- if ((status=XkbComputeGetMapReplySize(xkb,&rep))!=Success)
- return status;
- return XkbSendMap(client,xkb,&rep);
-}
-
-/***====================================================================***/
-
-static int
-CheckKeyTypes( ClientPtr client,
- XkbDescPtr xkb,
- xkbSetMapReq * req,
- xkbKeyTypeWireDesc **wireRtrn,
- int * nMapsRtrn,
- CARD8 * mapWidthRtrn)
-{
-unsigned nMaps;
-register unsigned i,n;
-register CARD8 * map;
-register xkbKeyTypeWireDesc *wire = *wireRtrn;
-
- if (req->firstType>((unsigned)xkb->map->num_types)) {
- *nMapsRtrn = _XkbErrCode3(0x01,req->firstType,xkb->map->num_types);
- return 0;
- }
- if (req->flags&XkbSetMapResizeTypes) {
- nMaps = req->firstType+req->nTypes;
- if (nMaps<XkbNumRequiredTypes) { /* canonical types must be there */
- *nMapsRtrn= _XkbErrCode4(0x02,req->firstType,req->nTypes,4);
- return 0;
- }
- }
- else if (req->present&XkbKeyTypesMask) {
- nMaps = xkb->map->num_types;
- if ((req->firstType+req->nTypes)>nMaps) {
- *nMapsRtrn = req->firstType+req->nTypes;
- return 0;
- }
- }
- else {
- *nMapsRtrn = xkb->map->num_types;
- for (i=0;i<xkb->map->num_types;i++) {
- mapWidthRtrn[i] = xkb->map->types[i].num_levels;
- }
- return 1;
- }
-
- for (i=0;i<req->firstType;i++) {
- mapWidthRtrn[i] = xkb->map->types[i].num_levels;
- }
- for (i=0;i<req->nTypes;i++) {
- unsigned width;
- if (client->swapped) {
- register int s;
- swaps(&wire->virtualMods,s);
- }
- n= i+req->firstType;
- width= wire->numLevels;
- if (width<1) {
- *nMapsRtrn= _XkbErrCode3(0x04,n,width);
- return 0;
- }
- else if ((n==XkbOneLevelIndex)&&(width!=1)) { /* must be width 1 */
- *nMapsRtrn= _XkbErrCode3(0x05,n,width);
- return 0;
- }
- else if ((width!=2)&&
- ((n==XkbTwoLevelIndex)||(n==XkbKeypadIndex)||
- (n==XkbAlphabeticIndex))) {
- /* TWO_LEVEL, ALPHABETIC and KEYPAD must be width 2 */
- *nMapsRtrn= _XkbErrCode3(0x05,n,width);
- return 0;
- }
- if (wire->nMapEntries>0) {
- xkbKTSetMapEntryWireDesc * mapWire;
- xkbModsWireDesc * preWire;
- mapWire= (xkbKTSetMapEntryWireDesc *)&wire[1];
- preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries];
- for (n=0;n<wire->nMapEntries;n++) {
- if (client->swapped) {
- register int s;
- swaps(&mapWire[n].virtualMods,s);
- }
- if (mapWire[n].realMods&(~wire->realMods)) {
- *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods,
- wire->realMods);
- return 0;
- }
- if (mapWire[n].virtualMods&(~wire->virtualMods)) {
- *nMapsRtrn= _XkbErrCode3(0x07,n,mapWire[n].virtualMods);
- return 0;
- }
- if (mapWire[n].level>=wire->numLevels) {
- *nMapsRtrn= _XkbErrCode4(0x08,n,wire->numLevels,
- mapWire[n].level);
- return 0;
- }
- if (wire->preserve) {
- if (client->swapped) {
- register int s;
- swaps(&preWire[n].virtualMods,s);
- }
- if (preWire[n].realMods&(~mapWire[n].realMods)) {
- *nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods,
- mapWire[n].realMods);
- return 0;
- }
- if (preWire[n].virtualMods&(~mapWire[n].virtualMods)) {
- *nMapsRtrn=_XkbErrCode3(0x0a,n,preWire[n].virtualMods);
- return 0;
- }
- }
- }
- if (wire->preserve)
- map= (CARD8 *)&preWire[wire->nMapEntries];
- else map= (CARD8 *)&mapWire[wire->nMapEntries];
- }
- else map= (CARD8 *)&wire[1];
- mapWidthRtrn[i+req->firstType] = wire->numLevels;
- wire= (xkbKeyTypeWireDesc *)map;
- }
- for (i=req->firstType+req->nTypes;i<nMaps;i++) {
- mapWidthRtrn[i] = xkb->map->types[i].num_levels;
- }
- *nMapsRtrn = nMaps;
- *wireRtrn = wire;
- return 1;
-}
-
-static int
-CheckKeySyms( ClientPtr client,
- XkbDescPtr xkb,
- xkbSetMapReq * req,
- int nTypes,
- CARD8 * mapWidths,
- CARD16 * symsPerKey,
- xkbSymMapWireDesc ** wireRtrn,
- int * errorRtrn)
-{
-register unsigned i;
-XkbSymMapPtr map;
-xkbSymMapWireDesc* wire = *wireRtrn;
-
- if (!(XkbKeySymsMask&req->present))
- return 1;
- CHK_REQ_KEY_RANGE2(0x11,req->firstKeySym,req->nKeySyms,req,(*errorRtrn),0);
- map = &xkb->map->key_sym_map[xkb->min_key_code];
- for (i=xkb->min_key_code;i<(unsigned)req->firstKeySym;i++,map++) {
- register int g,ng,w;
- ng= XkbNumGroups(map->group_info);
- for (w=g=0;g<ng;g++) {
- if (map->kt_index[g]>=(unsigned)nTypes) {
- *errorRtrn = _XkbErrCode4(0x13,i,g,map->kt_index[g]);
- return 0;
- }
- if (mapWidths[map->kt_index[g]]>w)
- w= mapWidths[map->kt_index[g]];
- }
- symsPerKey[i] = w*ng;
- }
- for (i=0;i<req->nKeySyms;i++) {
- KeySym *pSyms;
- register unsigned nG;
- if (client->swapped) {
- swaps(&wire->nSyms,nG);
- }
- nG = XkbNumGroups(wire->groupInfo);
- if (nG>XkbNumKbdGroups) {
- *errorRtrn = _XkbErrCode3(0x14,i+req->firstKeySym,nG);
- return 0;
- }
- if (nG>0) {
- register int g,w;
- for (g=w=0;g<nG;g++) {
- if (wire->ktIndex[g]>=(unsigned)nTypes) {
- *errorRtrn= _XkbErrCode4(0x15,i+req->firstKeySym,g,
- wire->ktIndex[g]);
- return 0;
- }
- if (mapWidths[wire->ktIndex[g]]>w)
- w= mapWidths[wire->ktIndex[g]];
- }
- if (wire->width!=w) {
- *errorRtrn= _XkbErrCode3(0x16,i+req->firstKeySym,wire->width);
- return 0;
- }
- w*= nG;
- symsPerKey[i+req->firstKeySym] = w;
- if (w!=wire->nSyms) {
- *errorRtrn=_XkbErrCode4(0x16,i+req->firstKeySym,wire->nSyms,w);
- return 0;
- }
- }
- else if (wire->nSyms!=0) {
- *errorRtrn = _XkbErrCode3(0x17,i+req->firstKeySym,wire->nSyms);
- return 0;
- }
- pSyms = (KeySym *)&wire[1];
- wire = (xkbSymMapWireDesc *)&pSyms[wire->nSyms];
- }
-
- map = &xkb->map->key_sym_map[i];
- for (;i<=(unsigned)xkb->max_key_code;i++,map++) {
- register int g,nG,w;
- nG= XkbKeyNumGroups(xkb,i);
- for (w=g=0;g<nG;g++) {
- if (map->kt_index[g]>=(unsigned)nTypes) {
- *errorRtrn = _XkbErrCode4(0x18,i,g,map->kt_index[g]);
- return 0;
- }
- if (mapWidths[map->kt_index[g]]>w)
- w= mapWidths[map->kt_index[g]];
- }
- symsPerKey[i] = w*nG;
- }
- *wireRtrn = wire;
- return 1;
-}
-
-static int
-CheckKeyActions( XkbDescPtr xkb,
- xkbSetMapReq * req,
- int nTypes,
- CARD8 * mapWidths,
- CARD16 * symsPerKey,
- CARD8 ** wireRtrn,
- int * nActsRtrn)
-{
-int nActs;
-CARD8 * wire = *wireRtrn;
-register unsigned i;
-
- if (!(XkbKeyActionsMask&req->present))
- return 1;
- CHK_REQ_KEY_RANGE2(0x21,req->firstKeyAct,req->nKeyActs,req,(*nActsRtrn),0);
- for (nActs=i=0;i<req->nKeyActs;i++) {
- if (wire[0]!=0) {
- if (wire[0]==symsPerKey[i+req->firstKeyAct])
- nActs+= wire[0];
- else {
- *nActsRtrn= _XkbErrCode3(0x23,i+req->firstKeyAct,wire[0]);
- return 0;
- }
- }
- wire++;
- }
- if (req->nKeyActs%4)
- wire+= 4-(req->nKeyActs%4);
- *wireRtrn = (CARD8 *)(((XkbAnyAction *)wire)+nActs);
- *nActsRtrn = nActs;
- return 1;
-}
-
-static int
-CheckKeyBehaviors( XkbDescPtr xkb,
- xkbSetMapReq * req,
- xkbBehaviorWireDesc ** wireRtrn,
- int * errorRtrn)
-{
-register xkbBehaviorWireDesc * wire = *wireRtrn;
-register XkbServerMapPtr server = xkb->server;
-register unsigned i;
-unsigned first,last;
-
- if (((req->present&XkbKeyBehaviorsMask)==0)||(req->nKeyBehaviors<1)) {
- req->present&= ~XkbKeyBehaviorsMask;
- req->nKeyBehaviors= 0;
- return 1;
- }
- first= req->firstKeyBehavior;
- last= req->firstKeyBehavior+req->nKeyBehaviors-1;
- if (first<req->minKeyCode) {
- *errorRtrn = _XkbErrCode3(0x31,first,req->minKeyCode);
- return 0;
- }
- if (last>req->maxKeyCode) {
- *errorRtrn = _XkbErrCode3(0x32,last,req->maxKeyCode);
- return 0;
- }
-
- for (i=0;i<req->totalKeyBehaviors;i++,wire++) {
- if ((wire->key<first)||(wire->key>last)) {
- *errorRtrn = _XkbErrCode4(0x33,first,last,wire->key);
- return 0;
- }
- if ((wire->type&XkbKB_Permanent)&&
- ((server->behaviors[wire->key].type!=wire->type)||
- (server->behaviors[wire->key].data!=wire->data))) {
- *errorRtrn = _XkbErrCode3(0x33,wire->key,wire->type);
- return 0;
- }
- if ((wire->type==XkbKB_RadioGroup)&&
- ((wire->data&(~XkbKB_RGAllowNone))>XkbMaxRadioGroups)) {
- *errorRtrn= _XkbErrCode4(0x34,wire->key,wire->data,
- XkbMaxRadioGroups);
- return 0;
- }
- if ((wire->type==XkbKB_Overlay1)||(wire->type==XkbKB_Overlay2)) {
- CHK_KEY_RANGE2(0x35,wire->key,1,xkb,*errorRtrn,0);
- }
- }
- *wireRtrn = wire;
- return 1;
-}
-
-static int
-CheckVirtualMods( XkbDescRec * xkb,
- xkbSetMapReq * req,
- CARD8 ** wireRtrn,
- int * errorRtrn)
-{
-register CARD8 *wire = *wireRtrn;
-register unsigned i,nMods,bit;
-
- if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0))
- return 1;
- for (i=nMods=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (req->virtualMods&bit)
- nMods++;
- }
- *wireRtrn= (wire+XkbPaddedSize(nMods));
- return 1;
-}
-
-static int
-CheckKeyExplicit( XkbDescPtr xkb,
- xkbSetMapReq * req,
- CARD8 ** wireRtrn,
- int * errorRtrn)
-{
-register CARD8 * wire = *wireRtrn;
-CARD8 * start;
-register unsigned i;
-int first,last;
-
- if (((req->present&XkbExplicitComponentsMask)==0)||(req->nKeyExplicit<1)) {
- req->present&= ~XkbExplicitComponentsMask;
- req->nKeyExplicit= 0;
- return 1;
- }
- first= req->firstKeyExplicit;
- last= first+req->nKeyExplicit-1;
- if (first<req->minKeyCode) {
- *errorRtrn = _XkbErrCode3(0x51,first,req->minKeyCode);
- return 0;
- }
- if (last>req->maxKeyCode) {
- *errorRtrn = _XkbErrCode3(0x52,last,req->maxKeyCode);
- return 0;
- }
- start= wire;
- for (i=0;i<req->totalKeyExplicit;i++,wire+=2) {
- if ((wire[0]<first)||(wire[0]>last)) {
- *errorRtrn = _XkbErrCode4(0x53,first,last,wire[0]);
- return 0;
- }
- if (wire[1]&(~XkbAllExplicitMask)) {
- *errorRtrn= _XkbErrCode3(0x52,~XkbAllExplicitMask,wire[1]);
- return 0;
- }
- }
- wire+= XkbPaddedSize(wire-start)-(wire-start);
- *wireRtrn= wire;
- return 1;
-}
-
-static int
-CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn)
-{
-register CARD8 * wire = *wireRtrn;
-CARD8 * start;
-register unsigned i;
-int first,last;
-
- if (((req->present&XkbModifierMapMask)==0)||(req->nModMapKeys<1)) {
- req->present&= ~XkbModifierMapMask;
- req->nModMapKeys= 0;
- return 1;
- }
- first= req->firstModMapKey;
- last= first+req->nModMapKeys-1;
- if (first<req->minKeyCode) {
- *errRtrn = _XkbErrCode3(0x61,first,req->minKeyCode);
- return 0;
- }
- if (last>req->maxKeyCode) {
- *errRtrn = _XkbErrCode3(0x62,last,req->maxKeyCode);
- return 0;
- }
- start= wire;
- for (i=0;i<req->totalModMapKeys;i++,wire+=2) {
- if ((wire[0]<first)||(wire[0]>last)) {
- *errRtrn = _XkbErrCode4(0x63,first,last,wire[0]);
- return 0;
- }
- }
- wire+= XkbPaddedSize(wire-start)-(wire-start);
- *wireRtrn= wire;
- return 1;
-}
-
-static int
-CheckVirtualModMap( XkbDescPtr xkb,
- xkbSetMapReq *req,
- xkbVModMapWireDesc **wireRtrn,
- int *errRtrn)
-{
-register xkbVModMapWireDesc * wire = *wireRtrn;
-register unsigned i;
-int first,last;
-
- if (((req->present&XkbVirtualModMapMask)==0)||(req->nVModMapKeys<1)) {
- req->present&= ~XkbVirtualModMapMask;
- req->nVModMapKeys= 0;
- return 1;
- }
- first= req->firstVModMapKey;
- last= first+req->nVModMapKeys-1;
- if (first<req->minKeyCode) {
- *errRtrn = _XkbErrCode3(0x71,first,req->minKeyCode);
- return 0;
- }
- if (last>req->maxKeyCode) {
- *errRtrn = _XkbErrCode3(0x72,last,req->maxKeyCode);
- return 0;
- }
- for (i=0;i<req->totalVModMapKeys;i++,wire++) {
- if ((wire->key<first)||(wire->key>last)) {
- *errRtrn = _XkbErrCode4(0x73,first,last,wire->key);
- return 0;
- }
- }
- *wireRtrn= wire;
- return 1;
-}
-
-static char *
-SetKeyTypes( XkbDescPtr xkb,
- xkbSetMapReq * req,
- xkbKeyTypeWireDesc * wire,
- XkbChangesPtr changes)
-{
-register unsigned i;
-unsigned first,last;
-CARD8 *map;
-
- if ((unsigned)(req->firstType+req->nTypes)>xkb->map->size_types) {
- i= req->firstType+req->nTypes;
- if (XkbAllocClientMap(xkb,XkbKeyTypesMask,i)!=Success) {
- return NULL;
- }
- }
- if ((unsigned)(req->firstType+req->nTypes)>xkb->map->num_types)
- xkb->map->num_types= req->firstType+req->nTypes;
-
- for (i=0;i<req->nTypes;i++) {
- XkbKeyTypePtr pOld;
- register unsigned n;
-
- if (XkbResizeKeyType(xkb,i+req->firstType,wire->nMapEntries,
- wire->preserve,wire->numLevels)!=Success) {
- return NULL;
- }
- pOld = &xkb->map->types[i+req->firstType];
- map = (CARD8 *)&wire[1];
-
- pOld->mods.real_mods = wire->realMods;
- pOld->mods.vmods= wire->virtualMods;
- pOld->num_levels = wire->numLevels;
- pOld->map_count= wire->nMapEntries;
-
- pOld->mods.mask= pOld->mods.real_mods|
- XkbMaskForVMask(xkb,pOld->mods.vmods);
-
- if (wire->nMapEntries) {
- xkbKTSetMapEntryWireDesc *mapWire;
- xkbModsWireDesc *preWire;
- unsigned tmp;
- mapWire= (xkbKTSetMapEntryWireDesc *)map;
- preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries];
- for (n=0;n<wire->nMapEntries;n++) {
- pOld->map[n].active= 1;
- pOld->map[n].mods.mask= mapWire[n].realMods;
- pOld->map[n].mods.real_mods= mapWire[n].realMods;
- pOld->map[n].mods.vmods= mapWire[n].virtualMods;
- pOld->map[n].level= mapWire[n].level;
- if (mapWire[n].virtualMods!=0) {
- tmp= XkbMaskForVMask(xkb,mapWire[n].virtualMods);
- pOld->map[n].active= (tmp!=0);
- pOld->map[n].mods.mask|= tmp;
- }
- if (wire->preserve) {
- pOld->preserve[n].real_mods= preWire[n].realMods;
- pOld->preserve[n].vmods= preWire[n].virtualMods;
- tmp= XkbMaskForVMask(xkb,preWire[n].virtualMods);
- pOld->preserve[n].mask= preWire[n].realMods|tmp;
- }
- }
- if (wire->preserve)
- map= (CARD8 *)&preWire[wire->nMapEntries];
- else map= (CARD8 *)&mapWire[wire->nMapEntries];
- }
- else map= (CARD8 *)&wire[1];
- wire = (xkbKeyTypeWireDesc *)map;
- }
- first= req->firstType;
- last= first+req->nTypes-1; /* last changed type */
- if (changes->map.changed&XkbKeyTypesMask) {
- int oldLast;
- oldLast= changes->map.first_type+changes->map.num_types-1;
- if (changes->map.first_type<first)
- first= changes->map.first_type;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.changed|= XkbKeyTypesMask;
- changes->map.first_type = first;
- changes->map.num_types = (last-first)+1;
- return (char *)wire;
-}
-
-static char *
-SetKeySyms( ClientPtr client,
- XkbDescPtr xkb,
- xkbSetMapReq * req,
- xkbSymMapWireDesc * wire,
- XkbChangesPtr changes,
- DeviceIntPtr dev)
-{
-register unsigned i,s;
-XkbSymMapPtr oldMap;
-KeySym * newSyms;
-KeySym * pSyms;
-unsigned first,last;
-
- oldMap = &xkb->map->key_sym_map[req->firstKeySym];
- for (i=0;i<req->nKeySyms;i++,oldMap++) {
- pSyms = (KeySym *)&wire[1];
- if (wire->nSyms>0) {
- newSyms = XkbResizeKeySyms(xkb,i+req->firstKeySym,wire->nSyms);
- for (s=0;s<wire->nSyms;s++) {
- newSyms[s]= pSyms[s];
- }
- if (client->swapped) {
- int n;
- for (s=0;s<wire->nSyms;s++) {
- swapl(&newSyms[s],n);
- }
- }
- }
- oldMap->kt_index[0] = wire->ktIndex[0];
- oldMap->kt_index[1] = wire->ktIndex[1];
- oldMap->kt_index[2] = wire->ktIndex[2];
- oldMap->kt_index[3] = wire->ktIndex[3];
- oldMap->group_info = wire->groupInfo;
- oldMap->width = wire->width;
- wire= (xkbSymMapWireDesc *)&pSyms[wire->nSyms];
- }
- first= req->firstKeySym;
- last= first+req->nKeySyms-1;
- if (changes->map.changed&XkbKeySymsMask) {
- int oldLast= (changes->map.first_key_sym+changes->map.num_key_syms-1);
- if (changes->map.first_key_sym<first)
- first= changes->map.first_key_sym;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.changed|= XkbKeySymsMask;
- changes->map.first_key_sym = first;
- changes->map.num_key_syms = (last-first+1);
-
- s= 0;
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (XkbKeyNumGroups(xkb,i)>s)
- s= XkbKeyNumGroups(xkb,i);
- }
- if (s!=xkb->ctrls->num_groups) {
- xkbControlsNotify cn;
- XkbControlsRec old;
- cn.keycode= 0;
- cn.eventType= 0;
- cn.requestMajor= XkbReqCode;
- cn.requestMinor= X_kbSetMap;
- old= *xkb->ctrls;
- xkb->ctrls->num_groups= s;
- if (XkbComputeControlsNotify(dev,&old,xkb->ctrls,&cn,False))
- XkbSendControlsNotify(dev,&cn);
- }
- return (char *)wire;
-}
-
-static char *
-SetKeyActions( XkbDescPtr xkb,
- xkbSetMapReq * req,
- CARD8 * wire,
- XkbChangesPtr changes)
-{
-register unsigned i,first,last;
-CARD8 * nActs = wire;
-XkbAction * newActs;
-
- wire+= XkbPaddedSize(req->nKeyActs);
- for (i=0;i<req->nKeyActs;i++) {
- if (nActs[i]==0)
- xkb->server->key_acts[i+req->firstKeyAct]= 0;
- else {
- newActs= XkbResizeKeyActions(xkb,i+req->firstKeyAct,nActs[i]);
- memcpy((char *)newActs,(char *)wire,
- nActs[i]*SIZEOF(xkbActionWireDesc));
- wire+= nActs[i]*SIZEOF(xkbActionWireDesc);
- }
- }
- first= req->firstKeyAct;
- last= (first+req->nKeyActs-1);
- if (changes->map.changed&XkbKeyActionsMask) {
- int oldLast;
- oldLast= changes->map.first_key_act+changes->map.num_key_acts-1;
- if (changes->map.first_key_act<first)
- first= changes->map.first_key_act;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.changed|= XkbKeyActionsMask;
- changes->map.first_key_act= first;
- changes->map.num_key_acts= (last-first+1);
- return (char *)wire;
-}
-
-static char *
-SetKeyBehaviors( XkbSrvInfoPtr xkbi,
- xkbSetMapReq *req,
- xkbBehaviorWireDesc *wire,
- XkbChangesPtr changes)
-{
-register unsigned i;
-int maxRG = -1;
-XkbDescPtr xkb = xkbi->desc;
-XkbServerMapPtr server = xkb->server;
-unsigned first,last;
-
- first= req->firstKeyBehavior;
- last= req->firstKeyBehavior+req->nKeyBehaviors-1;
- bzero(&server->behaviors[first],req->nKeyBehaviors*sizeof(XkbBehavior));
- for (i=0;i<req->totalKeyBehaviors;i++) {
- if ((server->behaviors[wire->key].type&XkbKB_Permanent)==0) {
- server->behaviors[wire->key].type= wire->type;
- server->behaviors[wire->key].data= wire->data;
- if ((wire->type==XkbKB_RadioGroup)&&(((int)wire->data)>maxRG))
- maxRG= wire->data + 1;
- }
- wire++;
- }
-
- if (maxRG>(int)xkbi->nRadioGroups) {
- int sz = maxRG*sizeof(XkbRadioGroupRec);
- if (xkbi->radioGroups)
- xkbi->radioGroups=(XkbRadioGroupPtr)_XkbRealloc(xkbi->radioGroups,sz);
- else xkbi->radioGroups= (XkbRadioGroupPtr)_XkbCalloc(1, sz);
- if (xkbi->radioGroups) {
- if (xkbi->nRadioGroups)
- bzero(&xkbi->radioGroups[xkbi->nRadioGroups],
- (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec));
- xkbi->nRadioGroups= maxRG;
- }
- else xkbi->nRadioGroups= 0;
- /* should compute members here */
- }
- if (changes->map.changed&XkbKeyBehaviorsMask) {
- unsigned oldLast;
- oldLast= changes->map.first_key_behavior+
- changes->map.num_key_behaviors-1;
- if (changes->map.first_key_behavior<req->firstKeyBehavior)
- first= changes->map.first_key_behavior;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.changed|= XkbKeyBehaviorsMask;
- changes->map.first_key_behavior = first;
- changes->map.num_key_behaviors = (last-first+1);
- return (char *)wire;
-}
-
-static char *
-SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire,
- XkbChangesPtr changes)
-{
-register int i,bit,nMods;
-XkbServerMapPtr srv = xkbi->desc->server;
-
- if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0))
- return (char *)wire;
- for (i=nMods=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (req->virtualMods&bit) {
- if (srv->vmods[i]!=wire[nMods]) {
- changes->map.changed|= XkbVirtualModsMask;
- changes->map.vmods|= bit;
- srv->vmods[i]= wire[nMods];
- }
- nMods++;
- }
- }
- return (char *)(wire+XkbPaddedSize(nMods));
-}
-
-static char *
-SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire,
- XkbChangesPtr changes)
-{
-register unsigned i,first,last;
-XkbServerMapPtr xkb = xkbi->desc->server;
-CARD8 * start;
-
- start= wire;
- first= req->firstKeyExplicit;
- last= req->firstKeyExplicit+req->nKeyExplicit-1;
- bzero(&xkb->explicit[first],req->nKeyExplicit);
- for (i=0;i<req->totalKeyExplicit;i++,wire+= 2) {
- xkb->explicit[wire[0]]= wire[1];
- }
- if (first>0) {
- if (changes->map.changed&XkbExplicitComponentsMask) {
- int oldLast;
- oldLast= changes->map.first_key_explicit+
- changes->map.num_key_explicit-1;
- if (changes->map.first_key_explicit<first)
- first= changes->map.first_key_explicit;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.first_key_explicit= first;
- changes->map.num_key_explicit= (last-first)+1;
- }
- wire+= XkbPaddedSize(wire-start)-(wire-start);
- return (char *)wire;
-}
-
-static char *
-SetModifierMap( XkbSrvInfoPtr xkbi,
- xkbSetMapReq * req,
- CARD8 * wire,
- XkbChangesPtr changes)
-{
-register unsigned i,first,last;
-XkbClientMapPtr xkb = xkbi->desc->map;
-CARD8 * start;
-
- start= wire;
- first= req->firstModMapKey;
- last= req->firstModMapKey+req->nModMapKeys-1;
- bzero(&xkb->modmap[first],req->nModMapKeys);
- for (i=0;i<req->totalModMapKeys;i++,wire+= 2) {
- xkb->modmap[wire[0]]= wire[1];
- }
- if (first>0) {
- if (changes->map.changed&XkbModifierMapMask) {
- int oldLast;
- oldLast= changes->map.first_modmap_key+
- changes->map.num_modmap_keys-1;
- if (changes->map.first_modmap_key<first)
- first= changes->map.first_modmap_key;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.first_modmap_key= first;
- changes->map.num_modmap_keys= (last-first)+1;
- }
- wire+= XkbPaddedSize(wire-start)-(wire-start);
- return (char *)wire;
-}
-
-static char *
-SetVirtualModMap( XkbSrvInfoPtr xkbi,
- xkbSetMapReq * req,
- xkbVModMapWireDesc * wire,
- XkbChangesPtr changes)
-{
-register unsigned i,first,last;
-XkbServerMapPtr srv = xkbi->desc->server;
-
- first= req->firstVModMapKey;
- last= req->firstVModMapKey+req->nVModMapKeys-1;
- bzero(&srv->vmodmap[first],req->nVModMapKeys*sizeof(unsigned short));
- for (i=0;i<req->totalVModMapKeys;i++,wire++) {
- srv->vmodmap[wire->key]= wire->vmods;
- }
- if (first>0) {
- if (changes->map.changed&XkbVirtualModMapMask) {
- int oldLast;
- oldLast= changes->map.first_vmodmap_key+
- changes->map.num_vmodmap_keys-1;
- if (changes->map.first_vmodmap_key<first)
- first= changes->map.first_vmodmap_key;
- if (oldLast>last)
- last= oldLast;
- }
- changes->map.first_vmodmap_key= first;
- changes->map.num_vmodmap_keys= (last-first)+1;
- }
- return (char *)wire;
-}
-
-int
-ProcXkbSetMap(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbSrvInfoPtr xkbi;
- XkbDescPtr xkb;
- XkbChangesRec change;
- XkbEventCauseRec cause;
- int nTypes,nActions,error;
- char * tmp;
- CARD8 mapWidths[XkbMaxLegalKeyCode+1];
- CARD16 symsPerKey[XkbMaxLegalKeyCode+1];
- Bool sentNKN;
-
- REQUEST(xkbSetMapReq);
- REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask);
-
- XkbSetCauseXkbReq(&cause,X_kbSetMap,client);
- xkbi= dev->key->xkbInfo;
- xkb = xkbi->desc;
-
- if ((xkb->min_key_code!=stuff->minKeyCode)||
- (xkb->max_key_code!=stuff->maxKeyCode)) {
- if (client->vMajor!=1) { /* pre 1.0 versions of Xlib have a bug */
- stuff->minKeyCode= xkb->min_key_code;
- stuff->maxKeyCode= xkb->max_key_code;
- }
- else {
- if ((stuff->minKeyCode<XkbMinLegalKeyCode)||
- (stuff->maxKeyCode>XkbMaxLegalKeyCode)) {
- client->errorValue= _XkbErrCode3(2,stuff->minKeyCode,
- stuff->maxKeyCode);
- return BadValue;
- }
- if (stuff->minKeyCode>stuff->maxKeyCode) {
- client->errorValue= _XkbErrCode3(3,stuff->minKeyCode,
- stuff->maxKeyCode);
- return BadMatch;
- }
- }
- }
-
- tmp = (char *)&stuff[1];
- if ((stuff->present&XkbKeyTypesMask)&&
- (!CheckKeyTypes(client,xkb,stuff,(xkbKeyTypeWireDesc **)&tmp,
- &nTypes,mapWidths))) {
- client->errorValue = nTypes;
- return BadValue;
- }
- if ((stuff->present&XkbKeySymsMask)&&
- (!CheckKeySyms(client,xkb,stuff,nTypes,mapWidths,symsPerKey,
- (xkbSymMapWireDesc **)&tmp,&error))) {
- client->errorValue = error;
- return BadValue;
- }
-
- if ((stuff->present&XkbKeyActionsMask)&&
- (!CheckKeyActions(xkb,stuff,nTypes,mapWidths,symsPerKey,
- (CARD8 **)&tmp,&nActions))) {
- client->errorValue = nActions;
- return BadValue;
- }
-
- if ((stuff->present&XkbKeyBehaviorsMask)&&
- (!CheckKeyBehaviors(xkb,stuff,(xkbBehaviorWireDesc**)&tmp,&error))) {
- client->errorValue = error;
- return BadValue;
- }
-
- if ((stuff->present&XkbVirtualModsMask)&&
- (!CheckVirtualMods(xkb,stuff,(CARD8 **)&tmp,&error))) {
- client->errorValue= error;
- return BadValue;
- }
- if ((stuff->present&XkbExplicitComponentsMask)&&
- (!CheckKeyExplicit(xkb,stuff,(CARD8 **)&tmp,&error))) {
- client->errorValue= error;
- return BadValue;
- }
- if ((stuff->present&XkbModifierMapMask)&&
- (!CheckModifierMap(xkb,stuff,(CARD8 **)&tmp,&error))) {
- client->errorValue= error;
- return BadValue;
- }
- if ((stuff->present&XkbVirtualModMapMask)&&
- (!CheckVirtualModMap(xkb,stuff,(xkbVModMapWireDesc **)&tmp,&error))) {
- client->errorValue= error;
- return BadValue;
- }
- if (((tmp-((char *)stuff))/4)!=stuff->length) {
- ErrorF("Internal error! Bad length in XkbSetMap (after check)\n");
- client->errorValue = tmp-((char *)&stuff[1]);
- return BadLength;
- }
- bzero(&change,sizeof(change));
- sentNKN= False;
- if ((xkb->min_key_code!=stuff->minKeyCode)||
- (xkb->max_key_code!=stuff->maxKeyCode)) {
- Status status;
- xkbNewKeyboardNotify nkn;
- nkn.deviceID= nkn.oldDeviceID= dev->id;
- nkn.oldMinKeyCode= xkb->min_key_code;
- nkn.oldMaxKeyCode= xkb->max_key_code;
- status= XkbChangeKeycodeRange(xkb,stuff->minKeyCode,stuff->maxKeyCode,
- &change);
- if (status!=Success)
- return status;
- nkn.minKeyCode= xkb->min_key_code;
- nkn.maxKeyCode= xkb->max_key_code;
- nkn.requestMajor= XkbReqCode;
- nkn.requestMinor= X_kbSetMap;
- nkn.changed= XkbNKN_KeycodesMask;
- XkbSendNewKeyboardNotify(dev,&nkn);
- sentNKN= True;
- }
- tmp = (char *)&stuff[1];
- if (stuff->present&XkbKeyTypesMask) {
- tmp = SetKeyTypes(xkb,stuff,(xkbKeyTypeWireDesc *)tmp,&change);
- if (!tmp) goto allocFailure;
- }
- if (stuff->present&XkbKeySymsMask) {
- tmp = SetKeySyms(client,xkb,stuff,(xkbSymMapWireDesc *)tmp,&change,dev);
- if (!tmp) goto allocFailure;
- }
- if (stuff->present&XkbKeyActionsMask) {
- tmp = SetKeyActions(xkb,stuff,(CARD8 *)tmp,&change);
- if (!tmp) goto allocFailure;
- }
- if (stuff->present&XkbKeyBehaviorsMask) {
- tmp= SetKeyBehaviors(xkbi,stuff,(xkbBehaviorWireDesc *)tmp,&change);
- if (!tmp) goto allocFailure;
- }
- if (stuff->present&XkbVirtualModsMask)
- tmp= SetVirtualMods(xkbi,stuff,(CARD8 *)tmp,&change);
- if (stuff->present&XkbExplicitComponentsMask)
- tmp= SetKeyExplicit(xkbi,stuff,(CARD8 *)tmp,&change);
- if (stuff->present&XkbModifierMapMask)
- tmp= SetModifierMap(xkbi,stuff,(CARD8 *)tmp,&change);
- if (stuff->present&XkbVirtualModMapMask)
- tmp= SetVirtualModMap(xkbi,stuff,(xkbVModMapWireDesc *)tmp,&change);
- if (((tmp-((char *)stuff))/4)!=stuff->length) {
- ErrorF("Internal error! Bad length in XkbSetMap (after set)\n");
- client->errorValue = tmp-((char *)&stuff[1]);
- return BadLength;
- }
- if (stuff->flags&XkbSetMapRecomputeActions) {
- KeyCode first,last,firstMM,lastMM;
- if (change.map.num_key_syms>0) {
- first= change.map.first_key_sym;
- last= first+change.map.num_key_syms-1;
- }
- else first= last= 0;
- if (change.map.num_modmap_keys>0) {
- firstMM= change.map.first_modmap_key;
- lastMM= first+change.map.num_modmap_keys-1;
- }
- else firstMM= lastMM= 0;
- if ((last>0) && (lastMM>0)) {
- if (firstMM<first)
- first= firstMM;
- if (lastMM>last)
- last= lastMM;
- }
- else if (lastMM>0) {
- first= firstMM;
- last= lastMM;
- }
- if (last>0) {
- unsigned check= 0;
- XkbUpdateActions(dev,first,(last-first+1),&change,&check,&cause);
- if (check)
- XkbCheckSecondaryEffects(xkbi,check,&change,&cause);
- }
- }
- if (!sentNKN)
- XkbSendNotification(dev,&change,&cause);
-
- XkbUpdateCoreDescription(dev,False);
- return client->noClientException;
-allocFailure:
- return BadAlloc;
-}
-
-/***====================================================================***/
-
-static Status
-XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat,
- xkbGetCompatMapReply * rep)
-{
-unsigned size,nGroups;
-
- nGroups= 0;
- if (rep->groups!=0) {
- register int i,bit;
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if (rep->groups&bit)
- nGroups++;
- }
- }
- size= nGroups*SIZEOF(xkbModsWireDesc);
- size+= (rep->nSI*SIZEOF(xkbSymInterpretWireDesc));
- rep->length= size/4;
- return Success;
-}
-
-static int
-XkbSendCompatMap( ClientPtr client,
- XkbCompatMapPtr compat,
- xkbGetCompatMapReply * rep)
-{
-char * data;
-int size;
-
- size= rep->length*4;
- if (size>0) {
- data = (char *)ALLOCATE_LOCAL(size);
- if (data) {
- register unsigned i,bit;
- xkbModsWireDesc * grp;
- XkbSymInterpretPtr sym= &compat->sym_interpret[rep->firstSI];
- xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data;
- for (i=0;i<rep->nSI;i++,sym++,wire++) {
- wire->sym= sym->sym;
- wire->mods= sym->mods;
- wire->match= sym->match;
- wire->virtualMod= sym->virtual_mod;
- wire->flags= sym->flags;
- memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc);
- if (client->swapped) {
- register int n;
- swapl(&wire->sym,n);
- }
- }
- if (rep->groups) {
- grp = (xkbModsWireDesc *)wire;
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if (rep->groups&bit) {
- grp->mask= compat->groups[i].mask;
- grp->realMods= compat->groups[i].real_mods;
- grp->virtualMods= compat->groups[i].vmods;
- if (client->swapped) {
- register int n;
- swaps(&grp->virtualMods,n);
- }
- grp++;
- }
- }
- wire= (xkbSymInterpretWireDesc*)grp;
- }
- }
- else return BadAlloc;
- }
- else data= NULL;
-
- if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swaps(&rep->firstSI,n);
- swaps(&rep->nSI,n);
- swaps(&rep->nTotalSI,n);
- }
-
- WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep);
- if (data) {
- WriteToClient(client, size, data);
- DEALLOCATE_LOCAL((char *)data);
- }
- return client->noClientException;
-}
-
-int
-ProcXkbGetCompatMap(ClientPtr client)
-{
- xkbGetCompatMapReply rep;
- DeviceIntPtr dev;
- XkbDescPtr xkb;
- XkbCompatMapPtr compat;
-
- REQUEST(xkbGetCompatMapReq);
- REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- xkb = dev->key->xkbInfo->desc;
- compat= xkb->compat;
-
- rep.type = X_Reply;
- rep.deviceID = dev->id;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.firstSI = stuff->firstSI;
- rep.nSI = stuff->nSI;
- if (stuff->getAllSI) {
- rep.firstSI = 0;
- rep.nSI = compat->num_si;
- }
- else if ((((unsigned)stuff->nSI)>0)&&
- ((unsigned)(stuff->firstSI+stuff->nSI-1)>=compat->num_si)) {
- client->errorValue = _XkbErrCode2(0x05,compat->num_si);
- return BadValue;
- }
- rep.nTotalSI = compat->num_si;
- rep.groups= stuff->groups;
- XkbComputeGetCompatMapReplySize(compat,&rep);
- return XkbSendCompatMap(client,compat,&rep);
-}
-
-int
-ProcXkbSetCompatMap(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbSrvInfoPtr xkbi;
- XkbDescPtr xkb;
- XkbCompatMapPtr compat;
- char * data;
- int nGroups;
- register unsigned i,bit;
-
- REQUEST(xkbSetCompatMapReq);
- REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- data = (char *)&stuff[1];
- xkbi = dev->key->xkbInfo;
- xkb= xkbi->desc;
- compat= xkb->compat;
- if ((stuff->nSI>0)||(stuff->truncateSI)) {
- xkbSymInterpretWireDesc *wire;
- if (stuff->firstSI>compat->num_si) {
- client->errorValue = _XkbErrCode2(0x02,compat->num_si);
- return BadValue;
- }
- wire= (xkbSymInterpretWireDesc *)data;
- wire+= stuff->nSI;
- data = (char *)wire;
- }
- nGroups= 0;
- if (stuff->groups!=0) {
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if ( stuff->groups&bit )
- nGroups++;
- }
- }
- data+= nGroups*SIZEOF(xkbModsWireDesc);
- if (((data-((char *)stuff))/4)!=stuff->length) {
- return BadLength;
- }
- data = (char *)&stuff[1];
- if (stuff->nSI>0) {
- xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data;
- XkbSymInterpretPtr sym;
- if ((unsigned)(stuff->firstSI+stuff->nSI)>compat->num_si) {
- compat->num_si= stuff->firstSI+stuff->nSI;
- compat->sym_interpret= _XkbTypedRealloc(compat->sym_interpret,
- compat->num_si,
- XkbSymInterpretRec);
- if (!compat->sym_interpret) {
- compat->num_si= 0;
- return BadAlloc;
- }
- }
- else if (stuff->truncateSI) {
- compat->num_si = stuff->firstSI+stuff->nSI;
- }
- sym = &compat->sym_interpret[stuff->firstSI];
- for (i=0;i<stuff->nSI;i++,wire++,sym++) {
- if (client->swapped) {
- register int n;
- swapl(&wire->sym,n);
- }
- sym->sym= wire->sym;
- sym->mods= wire->mods;
- sym->match= wire->match;
- sym->flags= wire->flags;
- sym->virtual_mod= wire->virtualMod;
- memcpy((char *)&sym->act,(char *)&wire->act,
- SIZEOF(xkbActionWireDesc));
- }
- data = (char *)wire;
- }
- else if (stuff->truncateSI) {
- compat->num_si = stuff->firstSI;
- }
-
- if (stuff->groups!=0) {
- register unsigned i,bit;
- xkbModsWireDesc *wire = (xkbModsWireDesc *)data;
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if (stuff->groups&bit) {
- if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
- }
- compat->groups[i].mask= wire->realMods;
- compat->groups[i].real_mods= wire->realMods;
- compat->groups[i].vmods= wire->virtualMods;
- if (wire->virtualMods!=0) {
- unsigned tmp;
- tmp= XkbMaskForVMask(xkb,wire->virtualMods);
- compat->groups[i].mask|= tmp;
- }
- data+= SIZEOF(xkbModsWireDesc);
- wire= (xkbModsWireDesc *)data;
- }
- }
- }
- i= XkbPaddedSize((data-((char *)stuff)));
- if ((i/4)!=stuff->length) {
- ErrorF("Internal length error on read in ProcXkbSetCompatMap\n");
- return BadLength;
- }
-
- if (dev->xkb_interest) {
- xkbCompatMapNotify ev;
- ev.deviceID = dev->id;
- ev.changedGroups = stuff->groups;
- ev.firstSI = stuff->firstSI;
- ev.nSI = stuff->nSI;
- ev.nTotalSI = compat->num_si;
- XkbSendCompatMapNotify(dev,&ev);
- }
-
- if (stuff->recomputeActions) {
- XkbChangesRec change;
- unsigned check;
- XkbEventCauseRec cause;
-
- XkbSetCauseXkbReq(&cause,X_kbSetCompatMap,client);
- bzero(&change,sizeof(XkbChangesRec));
- XkbUpdateActions(dev,xkb->min_key_code,XkbNumKeys(xkb),&change,&check,
- &cause);
- if (check)
- XkbCheckSecondaryEffects(xkbi,check,&change,&cause);
- XkbUpdateCoreDescription(dev,False);
- XkbSendNotification(dev,&change,&cause);
- }
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbGetIndicatorState(ClientPtr client)
-{
- xkbGetIndicatorStateReply rep;
- XkbSrvLedInfoPtr sli;
- DeviceIntPtr dev;
- register int i;
-
- REQUEST(xkbGetIndicatorStateReq);
- REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,
- XkbXI_IndicatorStateMask);
- if (!sli)
- return BadAlloc;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.deviceID = dev->id;
- rep.state = sli->effectiveState;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber,i);
- swapl(&rep.state,i);
- }
- WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-Status
-XkbComputeGetIndicatorMapReplySize(
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply *rep)
-{
-register int i,bit;
-int nIndicators;
-
- rep->realIndicators = indicators->phys_indicators;
- for (i=nIndicators=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (rep->which&bit)
- nIndicators++;
- }
- rep->length = (nIndicators*SIZEOF(xkbIndicatorMapWireDesc))/4;
- return Success;
-}
-
-int
-XkbSendIndicatorMap( ClientPtr client,
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply * rep)
-{
-int length;
-CARD8 * map;
-register int i;
-register unsigned bit;
-
- length = rep->length*4;
- if (length>0) {
- CARD8 *to;
- to= map= (CARD8 *)ALLOCATE_LOCAL(length);
- if (map) {
- xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *)to;
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (rep->which&bit) {
- wire->flags= indicators->maps[i].flags;
- wire->whichGroups= indicators->maps[i].which_groups;
- wire->groups= indicators->maps[i].groups;
- wire->whichMods= indicators->maps[i].which_mods;
- wire->mods= indicators->maps[i].mods.mask;
- wire->realMods= indicators->maps[i].mods.real_mods;
- wire->virtualMods= indicators->maps[i].mods.vmods;
- wire->ctrls= indicators->maps[i].ctrls;
- if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
- swapl(&wire->ctrls,n);
- }
- wire++;
- }
- }
- to = (CARD8 *)wire;
- if ((to-map)!=length) {
- client->errorValue = _XkbErrCode2(0xff,length);
- return BadLength;
- }
- }
- else return BadAlloc;
- }
- else map = NULL;
- if (client->swapped) {
- swaps(&rep->sequenceNumber,i);
- swapl(&rep->length,i);
- swapl(&rep->which,i);
- swapl(&rep->realIndicators,i);
- }
- WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep);
- if (map) {
- WriteToClient(client, length, (char *)map);
- DEALLOCATE_LOCAL((char *)map);
- }
- return client->noClientException;
-}
-
-int
-ProcXkbGetIndicatorMap(ClientPtr client)
-{
-xkbGetIndicatorMapReply rep;
-DeviceIntPtr dev;
-XkbDescPtr xkb;
-XkbIndicatorPtr leds;
-
- REQUEST(xkbGetIndicatorMapReq);
- REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- xkb= dev->key->xkbInfo->desc;
- leds= xkb->indicators;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.deviceID = dev->id;
- rep.which = stuff->which;
- XkbComputeGetIndicatorMapReplySize(leds,&rep);
- return XkbSendIndicatorMap(client,leds,&rep);
-}
-
-int
-ProcXkbSetIndicatorMap(ClientPtr client)
-{
- register int i,bit;
- int nIndicators,why;
- DeviceIntPtr dev;
- XkbSrvInfoPtr xkbi;
- xkbIndicatorMapWireDesc *from;
- XkbSrvLedInfoPtr sli;
- XkbEventCauseRec cause;
-
- REQUEST(xkbSetIndicatorMapReq);
- REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- dev = _XkbLookupKeyboard(stuff->deviceSpec,&why);
- if (!dev) {
- client->errorValue = _XkbErrCode2(why,stuff->deviceSpec);
- return XkbKeyboardErrorCode;
- }
- xkbi= dev->key->xkbInfo;
-
- if (stuff->which==0)
- return client->noClientException;
-
- for (nIndicators=i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (stuff->which&bit)
- nIndicators++;
- }
- if (stuff->length!=((SIZEOF(xkbSetIndicatorMapReq)+
- (nIndicators*SIZEOF(xkbIndicatorMapWireDesc)))/4)) {
- return BadLength;
- }
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,
- XkbXI_IndicatorMapsMask);
- if (!sli)
- return BadAlloc;
-
- from = (xkbIndicatorMapWireDesc *)&stuff[1];
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (stuff->which&bit) {
- if (client->swapped) {
- register int n;
- swaps(&from->virtualMods,n);
- swapl(&from->ctrls,n);
- }
- CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup);
- CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods);
- from++;
- }
- }
-
- from = (xkbIndicatorMapWireDesc *)&stuff[1];
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (stuff->which&bit) {
- sli->maps[i].flags = from->flags;
- sli->maps[i].which_groups = from->whichGroups;
- sli->maps[i].groups = from->groups;
- sli->maps[i].which_mods = from->whichMods;
- sli->maps[i].mods.mask = from->mods;
- sli->maps[i].mods.real_mods = from->mods;
- sli->maps[i].mods.vmods= from->virtualMods;
- sli->maps[i].ctrls = from->ctrls;
- if (from->virtualMods!=0) {
- unsigned tmp;
- tmp= XkbMaskForVMask(xkbi->desc,from->virtualMods);
- sli->maps[i].mods.mask= from->mods|tmp;
- }
- from++;
- }
- }
-
- XkbSetCauseXkbReq(&cause,X_kbSetIndicatorMap,client);
- XkbApplyLedMapChanges(dev,sli,stuff->which,NULL,NULL,&cause);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbGetNamedIndicator(ClientPtr client)
-{
- DeviceIntPtr dev;
- xkbGetNamedIndicatorReply rep;
- register int i = 0;
- XkbSrvLedInfoPtr sli;
- XkbIndicatorMapPtr map = NULL;
- Bool supported;
-
- REQUEST(xkbGetNamedIndicatorReq);
- REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_LED_DEVICE(dev,stuff->deviceSpec);
- CHK_ATOM_ONLY(stuff->indicator);
-
- sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,0);
- if (!sli)
- return BadAlloc;
-
- supported= True;
- if (XkbXIUnsupported&XkbXI_IndicatorsMask) {
- if ((dev!=(DeviceIntPtr)LookupKeyboardDevice())||
- ((sli->flags&XkbSLI_IsDefault)==0)) {
- supported= False;
- }
- }
-
- if (supported) {
- i= 0;
- map= NULL;
- if ((sli->names)&&(sli->maps)) {
- for (i=0;i<XkbNumIndicators;i++) {
- if (stuff->indicator==sli->names[i]) {
- map= &sli->maps[i];
- break;
- }
- }
- }
- }
-
- rep.type= X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.deviceID = dev->id;
- rep.indicator= stuff->indicator;
- if ((map!=NULL)&&(supported)) {
- rep.found= True;
- rep.on= ((sli->effectiveState&(1<<i))!=0);
- rep.realIndicator= ((sli->physIndicators&(1<<i))!=0);
- rep.ndx= i;
- rep.flags= map->flags;
- rep.whichGroups= map->which_groups;
- rep.groups= map->groups;
- rep.whichMods= map->which_mods;
- rep.mods= map->mods.mask;
- rep.realMods= map->mods.real_mods;
- rep.virtualMods= map->mods.vmods;
- rep.ctrls= map->ctrls;
- rep.supported= True;
- }
- else {
- rep.found= False;
- rep.on= False;
- rep.realIndicator= False;
- rep.ndx= XkbNoIndicator;
- rep.flags= 0;
- rep.whichGroups= 0;
- rep.groups= 0;
- rep.whichMods= 0;
- rep.mods= 0;
- rep.realMods= 0;
- rep.virtualMods= 0;
- rep.ctrls= 0;
- rep.supported= supported;
- }
- if ( client->swapped ) {
- register int n;
- swapl(&rep.length,n);
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.indicator,n);
- swaps(&rep.virtualMods,n);
- swapl(&rep.ctrls,n);
- }
-
- WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep);
- if (!supported) {
- xkbExtensionDeviceNotify edev;
-
- bzero(&edev,sizeof(xkbExtensionDeviceNotify));
- edev.reason= XkbXI_UnsupportedFeatureMask;
- edev.ledClass= stuff->ledClass;
- edev.ledID= stuff->ledID;
- edev.ledsDefined= sli->namesPresent|sli->mapsPresent;
- edev.ledState= sli->effectiveState;
- edev.firstBtn= 0;
- edev.nBtns= 0;
- edev.unsupported= XkbXIUnsupported&XkbXI_IndicatorsMask;
- edev.supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
- XkbSendExtensionDeviceNotify(dev,client,&edev);
- }
- return client->noClientException;
-}
-
-int
-ProcXkbSetNamedIndicator(ClientPtr client)
-{
- DeviceIntPtr dev,kbd;
- XkbIndicatorMapPtr map;
- XkbSrvLedInfoPtr sli;
- register int led = 0;
- unsigned extDevReason;
- unsigned statec,namec,mapc;
- XkbEventCauseRec cause;
- xkbExtensionDeviceNotify ed;
- XkbChangesRec changes;
-
- REQUEST(xkbSetNamedIndicatorReq);
- REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_LED_DEVICE(dev,stuff->deviceSpec);
- CHK_ATOM_ONLY(stuff->indicator);
- CHK_MASK_LEGAL(0x10,stuff->whichGroups,XkbIM_UseAnyGroup);
- CHK_MASK_LEGAL(0x11,stuff->whichMods,XkbIM_UseAnyMods);
-
- extDevReason= 0;
-
- sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,
- XkbXI_IndicatorsMask);
- if (!sli)
- return BadAlloc;
-
- if (XkbXIUnsupported&XkbXI_IndicatorsMask) {
- if ((dev!=(DeviceIntPtr)LookupKeyboardDevice())||
- ((sli->flags&XkbSLI_IsDefault)==0)) {
- bzero(&ed,sizeof(xkbExtensionDeviceNotify));
- ed.reason= XkbXI_UnsupportedFeatureMask;
- ed.ledClass= stuff->ledClass;
- ed.ledID= stuff->ledID;
- ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed.ledState= sli->effectiveState;
- ed.firstBtn= 0;
- ed.nBtns= 0;
- ed.unsupported= XkbXIUnsupported&XkbXI_IndicatorsMask;
- ed.supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
- XkbSendExtensionDeviceNotify(dev,client,&ed);
- return client->noClientException;
- }
- }
-
- statec= mapc= namec= 0;
- map= NULL;
- if (sli->names && sli->maps) {
- for (led=0;(led<XkbNumIndicators)&&(map==NULL);led++) {
- if (sli->names[led]==stuff->indicator) {
- map= &sli->maps[led];
- break;
- }
- }
- }
- if (map==NULL) {
- if (!stuff->createMap)
- return client->noClientException;
- for (led=0,map=NULL;(led<XkbNumIndicators)&&(map==NULL);led++) {
- if ((sli->names[led]==None)&&(!XkbIM_InUse(&sli->maps[led]))) {
- map= &sli->maps[led];
- sli->names[led]= stuff->indicator;
- break;
- }
- }
- if (map==NULL)
- return client->noClientException;
- namec|= (1<<led);
- sli->namesPresent|= ((stuff->indicator!=None)?(1<<led):0);
- extDevReason|= XkbXI_IndicatorNamesMask;
- }
-
- if (stuff->setMap) {
- map->flags = stuff->flags;
- map->which_groups = stuff->whichGroups;
- map->groups = stuff->groups;
- map->which_mods = stuff->whichMods;
- map->mods.mask = stuff->realMods;
- map->mods.real_mods = stuff->realMods;
- map->mods.vmods= stuff->virtualMods;
- map->ctrls = stuff->ctrls;
- mapc|= (1<<led);
- }
- if ((stuff->setState)&&((map->flags&XkbIM_NoExplicit)==0)) {
- if (stuff->on) sli->explicitState|= (1<<led);
- else sli->explicitState&= ~(1<<led);
- statec|= ((sli->effectiveState^sli->explicitState)&(1<<led));
- }
- bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
- bzero((char *)&changes,sizeof(XkbChangesRec));
- XkbSetCauseXkbReq(&cause,X_kbSetNamedIndicator,client);
- if (namec)
- XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause);
- if (mapc)
- XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause);
- if (statec)
- XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause);
-
- kbd= dev;
- if ((sli->flags&XkbSLI_HasOwnState)==0)
- kbd= (DeviceIntPtr)LookupKeyboardDevice();
- XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-static CARD32
-_XkbCountAtoms(Atom *atoms,int maxAtoms,int *count)
-{
-register unsigned int i,bit,nAtoms;
-register CARD32 atomsPresent;
-
- for (i=nAtoms=atomsPresent=0,bit=1;i<maxAtoms;i++,bit<<=1) {
- if (atoms[i]!=None) {
- atomsPresent|= bit;
- nAtoms++;
- }
- }
- if (count)
- *count= nAtoms;
- return atomsPresent;
-}
-
-static char *
-_XkbWriteAtoms(char *wire,Atom *atoms,int maxAtoms,int swap)
-{
-register unsigned int i;
-Atom *atm;
-
- atm = (Atom *)wire;
- for (i=0;i<maxAtoms;i++) {
- if (atoms[i]!=None) {
- *atm= atoms[i];
- if (swap) {
- register int n;
- swapl(atm,n);
- }
- atm++;
- }
- }
- return (char *)atm;
-}
-
-static Status
-XkbComputeGetNamesReplySize(XkbDescPtr xkb,xkbGetNamesReply *rep)
-{
-register unsigned which,length;
-register int i;
-
- rep->minKeyCode= xkb->min_key_code;
- rep->maxKeyCode= xkb->max_key_code;
- which= rep->which;
- length= 0;
- if (xkb->names!=NULL) {
- if (which&XkbKeycodesNameMask) length++;
- if (which&XkbGeometryNameMask) length++;
- if (which&XkbSymbolsNameMask) length++;
- if (which&XkbPhysSymbolsNameMask) length++;
- if (which&XkbTypesNameMask) length++;
- if (which&XkbCompatNameMask) length++;
- }
- else which&= ~XkbComponentNamesMask;
-
- if (xkb->map!=NULL) {
- if (which&XkbKeyTypeNamesMask)
- length+= xkb->map->num_types;
- rep->nTypes= xkb->map->num_types;
- if (which&XkbKTLevelNamesMask) {
- XkbKeyTypePtr pType = xkb->map->types;
- int nKTLevels = 0;
-
- length+= XkbPaddedSize(xkb->map->num_types)/4;
- for (i=0;i<xkb->map->num_types;i++,pType++) {
- if (pType->level_names!=NULL)
- nKTLevels+= pType->num_levels;
- }
- rep->nKTLevels= nKTLevels;
- length+= nKTLevels;
- }
- }
- else {
- rep->nTypes= 0;
- rep->nKTLevels= 0;
- which&= ~(XkbKeyTypeNamesMask|XkbKTLevelNamesMask);
- }
-
- rep->minKeyCode= xkb->min_key_code;
- rep->maxKeyCode= xkb->max_key_code;
- rep->indicators= 0;
- rep->virtualMods= 0;
- rep->groupNames= 0;
- if (xkb->names!=NULL) {
- if (which&XkbIndicatorNamesMask) {
- int nLeds;
- rep->indicators=
- _XkbCountAtoms(xkb->names->indicators,XkbNumIndicators,&nLeds);
- length+= nLeds;
- if (nLeds==0)
- which&= ~XkbIndicatorNamesMask;
- }
-
- if (which&XkbVirtualModNamesMask) {
- int nVMods;
- rep->virtualMods=
- _XkbCountAtoms(xkb->names->vmods,XkbNumVirtualMods,&nVMods);
- length+= nVMods;
- if (nVMods==0)
- which&= ~XkbVirtualModNamesMask;
- }
-
- if (which&XkbGroupNamesMask) {
- int nGroups;
- rep->groupNames=
- _XkbCountAtoms(xkb->names->groups,XkbNumKbdGroups,&nGroups);
- length+= nGroups;
- if (nGroups==0)
- which&= ~XkbGroupNamesMask;
- }
-
- if ((which&XkbKeyNamesMask)&&(xkb->names->keys))
- length+= rep->nKeys;
- else which&= ~XkbKeyNamesMask;
-
- if ((which&XkbKeyAliasesMask)&&
- (xkb->names->key_aliases)&&(xkb->names->num_key_aliases>0)) {
- rep->nKeyAliases= xkb->names->num_key_aliases;
- length+= rep->nKeyAliases*2;
- }
- else {
- which&= ~XkbKeyAliasesMask;
- rep->nKeyAliases= 0;
- }
-
- if ((which&XkbRGNamesMask)&&(xkb->names->num_rg>0))
- length+= xkb->names->num_rg;
- else which&= ~XkbRGNamesMask;
- }
- else {
- which&= ~(XkbIndicatorNamesMask|XkbVirtualModNamesMask);
- which&= ~(XkbGroupNamesMask|XkbKeyNamesMask|XkbKeyAliasesMask);
- which&= ~XkbRGNamesMask;
- }
-
- rep->length= length;
- rep->which= which;
- return Success;
-}
-
-static int
-XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep)
-{
-register unsigned i,length,which;
-char * start;
-char * desc;
-
- length= rep->length*4;
- which= rep->which;
- if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swapl(&rep->which,n);
- swaps(&rep->virtualMods,n);
- swapl(&rep->indicators,n);
- }
-
- start = desc = (char *)ALLOCATE_LOCAL(length);
- if ( !start )
- return BadAlloc;
- if (which&XkbKeycodesNameMask) {
- *((CARD32 *)desc)= xkb->names->keycodes;
- if (client->swapped) {
- register int n;
- swapl(desc,n);
- }
- desc+= 4;
- }
- if (which&XkbGeometryNameMask) {
- *((CARD32 *)desc)= xkb->names->geometry;
- if (client->swapped) {
- register int n;
- swapl(desc,n);
- }
- desc+= 4;
- }
- if (which&XkbSymbolsNameMask) {
- *((CARD32 *)desc)= xkb->names->symbols;
- if (client->swapped) {
- register int n;
- swapl(desc,n);
- }
- desc+= 4;
- }
- if (which&XkbPhysSymbolsNameMask) {
- register CARD32 *atm= (CARD32 *)desc;
- atm[0]= (CARD32)xkb->names->phys_symbols;
- if (client->swapped) {
- register int n;
- swapl(&atm[0],n);
- }
- desc+= 4;
- }
- if (which&XkbTypesNameMask) {
- *((CARD32 *)desc)= (CARD32)xkb->names->types;
- if (client->swapped) {
- register int n;
- swapl(desc,n);
- }
- desc+= 4;
- }
- if (which&XkbCompatNameMask) {
- *((CARD32 *)desc)= (CARD32)xkb->names->compat;
- if (client->swapped) {
- register int n;
- swapl(desc,n);
- }
- desc+= 4;
- }
- if (which&XkbKeyTypeNamesMask) {
- register CARD32 *atm= (CARD32 *)desc;
- register XkbKeyTypePtr type= xkb->map->types;
-
- for (i=0;i<xkb->map->num_types;i++,atm++,type++) {
- *atm= (CARD32)type->name;
- if (client->swapped) {
- register int n;
- swapl(atm,n);
- }
- }
- desc= (char *)atm;
- }
- if (which&XkbKTLevelNamesMask) {
- XkbKeyTypePtr type = xkb->map->types;
- register CARD32 *atm;
- for (i=0;i<rep->nTypes;i++,type++) {
- *desc++ = type->num_levels;
- }
- desc+= XkbPaddedSize(rep->nTypes)-rep->nTypes;
-
- atm= (CARD32 *)desc;
- type = xkb->map->types;
- for (i=0;i<xkb->map->num_types;i++,type++) {
- register unsigned l;
- if (type->level_names) {
- for (l=0;l<type->num_levels;l++,atm++) {
- *atm= type->level_names[l];
- if (client->swapped) {
- register unsigned n;
- swapl(atm,n);
- }
- }
- desc+= type->num_levels*4;
- }
- }
- }
- if (which&XkbIndicatorNamesMask) {
- desc= _XkbWriteAtoms(desc,xkb->names->indicators,XkbNumIndicators,
- client->swapped);
- }
- if (which&XkbVirtualModNamesMask) {
- desc= _XkbWriteAtoms(desc,xkb->names->vmods,XkbNumVirtualMods,
- client->swapped);
- }
- if (which&XkbGroupNamesMask) {
- desc= _XkbWriteAtoms(desc,xkb->names->groups,XkbNumKbdGroups,
- client->swapped);
- }
- if (which&XkbKeyNamesMask) {
- for (i=0;i<rep->nKeys;i++,desc+= sizeof(XkbKeyNameRec)) {
- *((XkbKeyNamePtr)desc)= xkb->names->keys[i+rep->firstKey];
- }
- }
- if (which&XkbKeyAliasesMask) {
- XkbKeyAliasPtr pAl;
- pAl= xkb->names->key_aliases;
- for (i=0;i<rep->nKeyAliases;i++,pAl++,desc+=2*XkbKeyNameLength) {
- *((XkbKeyAliasPtr)desc)= *pAl;
- }
- }
- if ((which&XkbRGNamesMask)&&(rep->nRadioGroups>0)) {
- register CARD32 *atm= (CARD32 *)desc;
- for (i=0;i<rep->nRadioGroups;i++,atm++) {
- *atm= (CARD32)xkb->names->radio_groups[i];
- if (client->swapped) {
- register unsigned n;
- swapl(atm,n);
- }
- }
- desc+= rep->nRadioGroups*4;
- }
- if ((desc-start)!=(length)) {
- ErrorF("BOGUS LENGTH in write names, expected %d, got %ld\n",
- length, (unsigned long)(desc-start));
- }
- WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep);
- WriteToClient(client, length, start);
- DEALLOCATE_LOCAL((char *)start);
- return client->noClientException;
-}
-
-int
-ProcXkbGetNames(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbDescPtr xkb;
- xkbGetNamesReply rep;
-
- REQUEST(xkbGetNamesReq);
- REQUEST_SIZE_MATCH(xkbGetNamesReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
-
- xkb = dev->key->xkbInfo->desc;
- rep.type= X_Reply;
- rep.sequenceNumber= client->sequence;
- rep.length = 0;
- rep.deviceID = dev->id;
- rep.which = stuff->which;
- rep.nTypes = xkb->map->num_types;
- rep.firstKey = xkb->min_key_code;
- rep.nKeys = XkbNumKeys(xkb);
- if (xkb->names!=NULL) {
- rep.nKeyAliases= xkb->names->num_key_aliases;
- rep.nRadioGroups = xkb->names->num_rg;
- }
- else {
- rep.nKeyAliases= rep.nRadioGroups= 0;
- }
- XkbComputeGetNamesReplySize(xkb,&rep);
- return XkbSendNames(client,xkb,&rep);
-}
-
-/***====================================================================***/
-
-static CARD32 *
-_XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError)
-{
-register int i;
-
- for (i=0;i<nAtoms;i++,wire++) {
- if (swapped) {
- register int n;
- swapl(wire,n);
- }
- if ((((Atom)*wire)!=None)&&(!ValidAtom((Atom)*wire))) {
- *pError= ((Atom)*wire);
- return NULL;
- }
- }
- return wire;
-}
-
-static CARD32 *
-_XkbCheckMaskedAtoms(CARD32 *wire,int nAtoms,CARD32 present,int swapped,
- Atom *pError)
-{
-register unsigned i,bit;
-
- for (i=0,bit=1;(i<nAtoms)&&(present);i++,bit<<=1) {
- if ((present&bit)==0)
- continue;
- if (swapped) {
- register int n;
- swapl(wire,n);
- }
- if ((((Atom)*wire)!=None)&&(!ValidAtom(((Atom)*wire)))) {
- *pError= (Atom)*wire;
- return NULL;
- }
- wire++;
- }
- return wire;
-}
-
-static Atom *
-_XkbCopyMaskedAtoms( Atom *wire,
- Atom *dest,
- int nAtoms,
- CARD32 present)
-{
-register int i,bit;
-
- for (i=0,bit=1;(i<nAtoms)&&(present);i++,bit<<=1) {
- if ((present&bit)==0)
- continue;
- dest[i]= *wire++;
- }
- return wire;
-}
-
-static Bool
-_XkbCheckTypeName(Atom name,int typeNdx)
-{
-char * str;
-
- str= NameForAtom(name);
- if ((strcmp(str,"ONE_LEVEL")==0)||(strcmp(str,"TWO_LEVEL")==0)||
- (strcmp(str,"ALPHABETIC")==0)||(strcmp(str,"KEYPAD")==0))
- return False;
- return True;
-}
-
-int
-ProcXkbSetNames(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbDescRec *xkb;
- XkbNamesRec *names;
- xkbNamesNotify nn;
- CARD32 *tmp;
- Atom bad;
-
- REQUEST(xkbSetNamesReq);
- REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask);
-
- xkb = dev->key->xkbInfo->desc;
- names = xkb->names;
- tmp = (CARD32 *)&stuff[1];
-
- if (stuff->which&XkbKeycodesNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbGeometryNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbSymbolsNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbPhysSymbolsNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue= bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbTypesNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbCompatNameMask) {
- tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbKeyTypeNamesMask) {
- register int i;
- CARD32 *old;
- if ( stuff->nTypes<1 ) {
- client->errorValue = _XkbErrCode2(0x02,stuff->nTypes);
- return BadValue;
- }
- if ((unsigned)(stuff->firstType+stuff->nTypes-1)>=xkb->map->num_types) {
- client->errorValue = _XkbErrCode4(0x03,stuff->firstType,
- stuff->nTypes,
- xkb->map->num_types);
- return BadValue;
- }
- if (((unsigned)stuff->firstType)<=XkbLastRequiredType) {
- client->errorValue = _XkbErrCode2(0x04,stuff->firstType);
- return BadAccess;
- }
- old= tmp;
- tmp= _XkbCheckAtoms(tmp,stuff->nTypes,client->swapped,&bad);
- if (!tmp) {
- client->errorValue= bad;
- return BadAtom;
- }
- for (i=0;i<stuff->nTypes;i++,old++) {
- if (!_XkbCheckTypeName((Atom)*old,stuff->firstType+i))
- client->errorValue= _XkbErrCode2(0x05,i);
- }
- }
- if (stuff->which&XkbKTLevelNamesMask) {
- register unsigned i;
- XkbKeyTypePtr type;
- CARD8 * width;
- if ( stuff->nKTLevels<1 ) {
- client->errorValue = _XkbErrCode2(0x05,stuff->nKTLevels);
- return BadValue;
- }
- if ((unsigned)(stuff->firstKTLevel+stuff->nKTLevels-1)>=
- xkb->map->num_types) {
- client->errorValue = _XkbErrCode4(0x06,stuff->firstKTLevel,
- stuff->nKTLevels,xkb->map->num_types);
- return BadValue;
- }
- width = (CARD8 *)tmp;
- tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels));
- type = &xkb->map->types[stuff->firstKTLevel];
- for (i=0;i<stuff->nKTLevels;i++,type++) {
- if (width[i]==0)
- continue;
- else if (width[i]!=type->num_levels) {
- client->errorValue= _XkbErrCode4(0x07,i+stuff->firstKTLevel,
- type->num_levels,width[i]);
- return BadMatch;
- }
- tmp= _XkbCheckAtoms(tmp,width[i],client->swapped,&bad);
- if (!tmp) {
- client->errorValue= bad;
- return BadAtom;
- }
- }
- }
- if (stuff->which&XkbIndicatorNamesMask) {
- if (stuff->indicators==0) {
- client->errorValue= 0x08;
- return BadMatch;
- }
- tmp= _XkbCheckMaskedAtoms(tmp,XkbNumIndicators,stuff->indicators,
- client->swapped,&bad);
- if (!tmp) {
- client->errorValue= bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbVirtualModNamesMask) {
- if (stuff->virtualMods==0) {
- client->errorValue= 0x09;
- return BadMatch;
- }
- tmp= _XkbCheckMaskedAtoms(tmp,XkbNumVirtualMods,
- (CARD32)stuff->virtualMods,
- client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbGroupNamesMask) {
- if (stuff->groupNames==0) {
- client->errorValue= 0x0a;
- return BadMatch;
- }
- tmp= _XkbCheckMaskedAtoms(tmp,XkbNumKbdGroups,
- (CARD32)stuff->groupNames,
- client->swapped,&bad);
- if (!tmp) {
- client->errorValue = bad;
- return BadAtom;
- }
- }
- if (stuff->which&XkbKeyNamesMask) {
- if (stuff->firstKey<(unsigned)xkb->min_key_code) {
- client->errorValue= _XkbErrCode3(0x0b,xkb->min_key_code,
- stuff->firstKey);
- return BadValue;
- }
- if (((unsigned)(stuff->firstKey+stuff->nKeys-1)>xkb->max_key_code)||
- (stuff->nKeys<1)) {
- client->errorValue= _XkbErrCode4(0x0c,xkb->max_key_code,
- stuff->firstKey,stuff->nKeys);
- return BadValue;
- }
- tmp+= stuff->nKeys;
- }
- if ((stuff->which&XkbKeyAliasesMask)&&(stuff->nKeyAliases>0)) {
- tmp+= stuff->nKeyAliases*2;
- }
- if (stuff->which&XkbRGNamesMask) {
- if ( stuff->nRadioGroups<1 ) {
- client->errorValue= _XkbErrCode2(0x0d,stuff->nRadioGroups);
- return BadValue;
- }
- tmp= _XkbCheckAtoms(tmp,stuff->nRadioGroups,client->swapped,&bad);
- if (!tmp) {
- client->errorValue= bad;
- return BadAtom;
- }
- }
- if ((tmp-((CARD32 *)stuff))!=stuff->length) {
- client->errorValue = stuff->length;
- return BadLength;
- }
- if (XkbAllocNames(xkb,stuff->which,stuff->nRadioGroups,
- stuff->nKeyAliases)!=Success) {
- return BadAlloc;
- }
-
- /* everything is okay -- update names */
- bzero(&nn,sizeof(xkbNamesNotify));
- nn.changed= stuff->which;
- tmp = (CARD32 *)&stuff[1];
- if (stuff->which&XkbKeycodesNameMask)
- names->keycodes= *tmp++;
- if (stuff->which&XkbGeometryNameMask)
- names->geometry= *tmp++;
- if (stuff->which&XkbSymbolsNameMask)
- names->symbols= *tmp++;
- if (stuff->which&XkbPhysSymbolsNameMask)
- names->phys_symbols= *tmp++;
- if (stuff->which&XkbTypesNameMask)
- names->types= *tmp++;
- if (stuff->which&XkbCompatNameMask)
- names->compat= *tmp++;
- if ((stuff->which&XkbKeyTypeNamesMask)&&(stuff->nTypes>0)) {
- register unsigned i;
- register XkbKeyTypePtr type;
-
- type= &xkb->map->types[stuff->firstType];
- for (i=0;i<stuff->nTypes;i++,type++) {
- type->name= *tmp++;
- }
- nn.firstType= stuff->firstType;
- nn.nTypes= stuff->nTypes;
- }
- if (stuff->which&XkbKTLevelNamesMask) {
- register XkbKeyTypePtr type;
- register unsigned i;
- CARD8 *width;
-
- width = (CARD8 *)tmp;
- tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels));
- type= &xkb->map->types[stuff->firstKTLevel];
- for (i=0;i<stuff->nKTLevels;i++,type++) {
- if (width[i]>0) {
- if (type->level_names) {
- register unsigned n;
- for (n=0;n<width[i];n++) {
- type->level_names[n]= tmp[n];
- }
- }
- tmp+= width[i];
- }
- }
- nn.firstLevelName= 0;
- nn.nLevelNames= stuff->nTypes;
- }
- if (stuff->which&XkbIndicatorNamesMask) {
- tmp= _XkbCopyMaskedAtoms(tmp,names->indicators,XkbNumIndicators,
- stuff->indicators);
- nn.changedIndicators= stuff->indicators;
- }
- if (stuff->which&XkbVirtualModNamesMask) {
- tmp= _XkbCopyMaskedAtoms(tmp,names->vmods,XkbNumVirtualMods,
- stuff->virtualMods);
- nn.changedVirtualMods= stuff->virtualMods;
- }
- if (stuff->which&XkbGroupNamesMask) {
- tmp= _XkbCopyMaskedAtoms(tmp,names->groups,XkbNumKbdGroups,
- stuff->groupNames);
- nn.changedVirtualMods= stuff->groupNames;
- }
- if (stuff->which&XkbKeyNamesMask) {
- memcpy((char*)&names->keys[stuff->firstKey],(char *)tmp,
- stuff->nKeys*XkbKeyNameLength);
- tmp+= stuff->nKeys;
- nn.firstKey= stuff->firstKey;
- nn.nKeys= stuff->nKeys;
- }
- if (stuff->which&XkbKeyAliasesMask) {
- if (stuff->nKeyAliases>0) {
- register int na= stuff->nKeyAliases;
- if (XkbAllocNames(xkb,XkbKeyAliasesMask,0,na)!=Success)
- return BadAlloc;
- memcpy((char *)names->key_aliases,(char *)tmp,
- stuff->nKeyAliases*sizeof(XkbKeyAliasRec));
- tmp+= stuff->nKeyAliases*2;
- }
- else if (names->key_aliases!=NULL) {
- _XkbFree(names->key_aliases);
- names->key_aliases= NULL;
- names->num_key_aliases= 0;
- }
- nn.nAliases= names->num_key_aliases;
- }
- if (stuff->which&XkbRGNamesMask) {
- if (stuff->nRadioGroups>0) {
- register unsigned i,nrg;
- nrg= stuff->nRadioGroups;
- if (XkbAllocNames(xkb,XkbRGNamesMask,nrg,0)!=Success)
- return BadAlloc;
-
- for (i=0;i<stuff->nRadioGroups;i++) {
- names->radio_groups[i]= tmp[i];
- }
- tmp+= stuff->nRadioGroups;
- }
- else if (names->radio_groups) {
- _XkbFree(names->radio_groups);
- names->radio_groups= NULL;
- names->num_rg= 0;
- }
- nn.nRadioGroups= names->num_rg;
- }
- if (nn.changed) {
- Bool needExtEvent;
- needExtEvent= (nn.changed&XkbIndicatorNamesMask)!=0;
- XkbSendNamesNotify(dev,&nn);
- if (needExtEvent) {
- XkbSrvLedInfoPtr sli;
- xkbExtensionDeviceNotify edev;
- register int i;
- register unsigned bit;
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,
- XkbXI_IndicatorsMask);
- sli->namesPresent= 0;
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (names->indicators[i]!=None)
- sli->namesPresent|= bit;
- }
- bzero(&edev,sizeof(xkbExtensionDeviceNotify));
- edev.reason= XkbXI_IndicatorNamesMask;
- edev.ledClass= KbdFeedbackClass;
- edev.ledID= dev->kbdfeed->ctrl.id;
- edev.ledsDefined= sli->namesPresent|sli->mapsPresent;
- edev.ledState= sli->effectiveState;
- edev.firstBtn= 0;
- edev.nBtns= 0;
- edev.supported= XkbXI_AllFeaturesMask;
- edev.unsupported= 0;
- XkbSendExtensionDeviceNotify(dev,client,&edev);
- }
- }
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-#include "XKBgeom.h"
-
-#define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4)
-
-static char *
-XkbWriteCountedString(char *wire,char *str,Bool swap)
-{
-CARD16 len,*pLen;
-
- len= (str?strlen(str):0);
- pLen= (CARD16 *)wire;
- *pLen= len;
- if (swap) {
- register int n;
- swaps(pLen,n);
- }
- memcpy(&wire[2],str,len);
- wire+= ((2+len+3)/4)*4;
- return wire;
-}
-
-static int
-XkbSizeGeomProperties(XkbGeometryPtr geom)
-{
-register int i,size;
-XkbPropertyPtr prop;
-
- for (size=i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
- size+= XkbSizeCountedString(prop->name);
- size+= XkbSizeCountedString(prop->value);
- }
- return size;
-}
-
-static char *
-XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap)
-{
-register int i;
-register XkbPropertyPtr prop;
-
- for (i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
- wire= XkbWriteCountedString(wire,prop->name,swap);
- wire= XkbWriteCountedString(wire,prop->value,swap);
- }
- return wire;
-}
-
-static int
-XkbSizeGeomKeyAliases(XkbGeometryPtr geom)
-{
- return geom->num_key_aliases*(2*XkbKeyNameLength);
-}
-
-static char *
-XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap)
-{
-register int sz;
-
- sz= geom->num_key_aliases*(XkbKeyNameLength*2);
- if (sz>0) {
- memcpy(wire,(char *)geom->key_aliases,sz);
- wire+= sz;
- }
- return wire;
-}
-
-static int
-XkbSizeGeomColors(XkbGeometryPtr geom)
-{
-register int i,size;
-register XkbColorPtr color;
-
- for (i=size=0,color=geom->colors;i<geom->num_colors;i++,color++) {
- size+= XkbSizeCountedString(color->spec);
- }
- return size;
-}
-
-static char *
-XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap)
-{
-register int i;
-register XkbColorPtr color;
-
- for (i=0,color=geom->colors;i<geom->num_colors;i++,color++) {
- wire= XkbWriteCountedString(wire,color->spec,swap);
- }
- return wire;
-}
-
-static int
-XkbSizeGeomShapes(XkbGeometryPtr geom)
-{
-register int i,size;
-register XkbShapePtr shape;
-
- for (i=size=0,shape=geom->shapes;i<geom->num_shapes;i++,shape++) {
- register int n;
- register XkbOutlinePtr ol;
- size+= SIZEOF(xkbShapeWireDesc);
- for (n=0,ol=shape->outlines;n<shape->num_outlines;n++,ol++) {
- size+= SIZEOF(xkbOutlineWireDesc);
- size+= ol->num_points*SIZEOF(xkbPointWireDesc);
- }
- }
- return size;
-}
-
-static char *
-XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap)
-{
-int i;
-XkbShapePtr shape;
-xkbShapeWireDesc * shapeWire;
-
- for (i=0,shape=geom->shapes;i<geom->num_shapes;i++,shape++) {
- register int o;
- XkbOutlinePtr ol;
- xkbOutlineWireDesc * olWire;
- shapeWire= (xkbShapeWireDesc *)wire;
- shapeWire->name= shape->name;
- shapeWire->nOutlines= shape->num_outlines;
- if (shape->primary!=NULL)
- shapeWire->primaryNdx= XkbOutlineIndex(shape,shape->primary);
- else shapeWire->primaryNdx= XkbNoShape;
- if (shape->approx!=NULL)
- shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx);
- else shapeWire->approxNdx= XkbNoShape;
- if (swap) {
- register int n;
- swapl(&shapeWire->name,n);
- }
- wire= (char *)&shapeWire[1];
- for (o=0,ol=shape->outlines;o<shape->num_outlines;o++,ol++) {
- register int p;
- XkbPointPtr pt;
- xkbPointWireDesc * ptWire;
- olWire= (xkbOutlineWireDesc *)wire;
- olWire->nPoints= ol->num_points;
- olWire->cornerRadius= ol->corner_radius;
- wire= (char *)&olWire[1];
- ptWire= (xkbPointWireDesc *)wire;
- for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) {
- ptWire[p].x= pt->x;
- ptWire[p].y= pt->y;
- if (swap) {
- register int n;
- swaps(&ptWire[p].x,n);
- swaps(&ptWire[p].y,n);
- }
- }
- wire= (char *)&ptWire[ol->num_points];
- }
- }
- return wire;
-}
-
-static int
-XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad)
-{
-register int i,size;
-
- for (i=size=0;i<num_doodads;i++,doodad++) {
- size+= SIZEOF(xkbAnyDoodadWireDesc);
- if (doodad->any.type==XkbTextDoodad) {
- size+= XkbSizeCountedString(doodad->text.text);
- size+= XkbSizeCountedString(doodad->text.font);
- }
- else if (doodad->any.type==XkbLogoDoodad) {
- size+= XkbSizeCountedString(doodad->logo.logo_name);
- }
- }
- return size;
-}
-
-static char *
-XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap)
-{
-register int i;
-xkbDoodadWireDesc * doodadWire;
-
- for (i=0;i<num_doodads;i++,doodad++) {
- doodadWire= (xkbDoodadWireDesc *)wire;
- wire= (char *)&doodadWire[1];
- bzero(doodadWire,SIZEOF(xkbDoodadWireDesc));
- doodadWire->any.name= doodad->any.name;
- doodadWire->any.type= doodad->any.type;
- doodadWire->any.priority= doodad->any.priority;
- doodadWire->any.top= doodad->any.top;
- doodadWire->any.left= doodad->any.left;
- if (swap) {
- register int n;
- swapl(&doodadWire->any.name,n);
- swaps(&doodadWire->any.top,n);
- swaps(&doodadWire->any.left,n);
- }
- switch (doodad->any.type) {
- case XkbOutlineDoodad:
- case XkbSolidDoodad:
- doodadWire->shape.angle= doodad->shape.angle;
- doodadWire->shape.colorNdx= doodad->shape.color_ndx;
- doodadWire->shape.shapeNdx= doodad->shape.shape_ndx;
- if (swap) {
- register int n;
- swaps(&doodadWire->shape.angle,n);
- }
- break;
- case XkbTextDoodad:
- doodadWire->text.angle= doodad->text.angle;
- doodadWire->text.width= doodad->text.width;
- doodadWire->text.height= doodad->text.height;
- doodadWire->text.colorNdx= doodad->text.color_ndx;
- if (swap) {
- register int n;
- swaps(&doodadWire->text.angle,n);
- swaps(&doodadWire->text.width,n);
- swaps(&doodadWire->text.height,n);
- }
- wire= XkbWriteCountedString(wire,doodad->text.text,swap);
- wire= XkbWriteCountedString(wire,doodad->text.font,swap);
- break;
- case XkbIndicatorDoodad:
- doodadWire->indicator.shapeNdx= doodad->indicator.shape_ndx;
- doodadWire->indicator.onColorNdx=doodad->indicator.on_color_ndx;
- doodadWire->indicator.offColorNdx=
- doodad->indicator.off_color_ndx;
- break;
- case XkbLogoDoodad:
- doodadWire->logo.angle= doodad->logo.angle;
- doodadWire->logo.colorNdx= doodad->logo.color_ndx;
- doodadWire->logo.shapeNdx= doodad->logo.shape_ndx;
- wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap);
- break;
- default:
- ErrorF("Unknown doodad type %d in XkbWriteGeomDoodads\n",
- doodad->any.type);
- ErrorF("Ignored\n");
- break;
- }
- }
- return wire;
-}
-
-static char *
-XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap)
-{
-register int r;
-XkbOverlayRowPtr row;
-xkbOverlayWireDesc * olWire;
-
- olWire= (xkbOverlayWireDesc *)wire;
- olWire->name= ol->name;
- olWire->nRows= ol->num_rows;
- if (swap) {
- register int n;
- swapl(&olWire->name,n);
- }
- wire= (char *)&olWire[1];
- for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
- unsigned int k;
- XkbOverlayKeyPtr key;
- xkbOverlayRowWireDesc * rowWire;
- rowWire= (xkbOverlayRowWireDesc *)wire;
- rowWire->rowUnder= row->row_under;
- rowWire->nKeys= row->num_keys;
- wire= (char *)&rowWire[1];
- for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
- xkbOverlayKeyWireDesc * keyWire;
- keyWire= (xkbOverlayKeyWireDesc *)wire;
- memcpy(keyWire->over,key->over.name,XkbKeyNameLength);
- memcpy(keyWire->under,key->under.name,XkbKeyNameLength);
- wire= (char *)&keyWire[1];
- }
- }
- return wire;
-}
-
-static int
-XkbSizeGeomSections(XkbGeometryPtr geom)
-{
-register int i,size;
-XkbSectionPtr section;
-
- for (i=size=0,section=geom->sections;i<geom->num_sections;i++,section++) {
- size+= SIZEOF(xkbSectionWireDesc);
- if (section->rows) {
- int r;
- XkbRowPtr row;
- for (r=0,row=section->rows;r<section->num_rows;row++,r++) {
- size+= SIZEOF(xkbRowWireDesc);
- size+= row->num_keys*SIZEOF(xkbKeyWireDesc);
- }
- }
- if (section->doodads)
- size+= XkbSizeGeomDoodads(section->num_doodads,section->doodads);
- if (section->overlays) {
- int o;
- XkbOverlayPtr ol;
- for (o=0,ol=section->overlays;o<section->num_overlays;o++,ol++) {
- int r;
- XkbOverlayRowPtr row;
- size+= SIZEOF(xkbOverlayWireDesc);
- for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
- size+= SIZEOF(xkbOverlayRowWireDesc);
- size+= row->num_keys*SIZEOF(xkbOverlayKeyWireDesc);
- }
- }
- }
- }
- return size;
-}
-
-static char *
-XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap)
-{
-register int i;
-XkbSectionPtr section;
-xkbSectionWireDesc * sectionWire;
-
- for (i=0,section=geom->sections;i<geom->num_sections;i++,section++) {
- sectionWire= (xkbSectionWireDesc *)wire;
- sectionWire->name= section->name;
- sectionWire->top= section->top;
- sectionWire->left= section->left;
- sectionWire->width= section->width;
- sectionWire->height= section->height;
- sectionWire->angle= section->angle;
- sectionWire->priority= section->priority;
- sectionWire->nRows= section->num_rows;
- sectionWire->nDoodads= section->num_doodads;
- sectionWire->nOverlays= section->num_overlays;
- sectionWire->pad= 0;
- if (swap) {
- register int n;
- swapl(&sectionWire->name,n);
- swaps(&sectionWire->top,n);
- swaps(&sectionWire->left,n);
- swaps(&sectionWire->width,n);
- swaps(&sectionWire->height,n);
- swaps(&sectionWire->angle,n);
- }
- wire= (char *)&sectionWire[1];
- if (section->rows) {
- int r;
- XkbRowPtr row;
- xkbRowWireDesc * rowWire;
- for (r=0,row=section->rows;r<section->num_rows;r++,row++) {
- rowWire= (xkbRowWireDesc *)wire;
- rowWire->top= row->top;
- rowWire->left= row->left;
- rowWire->nKeys= row->num_keys;
- rowWire->vertical= row->vertical;
- rowWire->pad= 0;
- if (swap) {
- register int n;
- swaps(&rowWire->top,n);
- swaps(&rowWire->left,n);
- }
- wire= (char *)&rowWire[1];
- if (row->keys) {
- int k;
- XkbKeyPtr key;
- xkbKeyWireDesc * keyWire;
- keyWire= (xkbKeyWireDesc *)wire;
- for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
- memcpy(keyWire[k].name,key->name.name,XkbKeyNameLength);
- keyWire[k].gap= key->gap;
- keyWire[k].shapeNdx= key->shape_ndx;
- keyWire[k].colorNdx= key->color_ndx;
- if (swap) {
- register int n;
- swaps(&keyWire[k].gap,n);
- }
- }
- wire= (char *)&keyWire[row->num_keys];
- }
- }
- }
- if (section->doodads) {
- wire= XkbWriteGeomDoodads(wire,
- section->num_doodads,section->doodads,
- swap);
- }
- if (section->overlays) {
- register int o;
- for (o=0;o<section->num_overlays;o++) {
- wire= XkbWriteGeomOverlay(wire,&section->overlays[o],swap);
- }
- }
- }
- return wire;
-}
-
-static Status
-XkbComputeGetGeometryReplySize( XkbGeometryPtr geom,
- xkbGetGeometryReply * rep,
- Atom name)
-{
-int len;
-
- if (geom!=NULL) {
- len= XkbSizeCountedString(geom->label_font);
- len+= XkbSizeGeomProperties(geom);
- len+= XkbSizeGeomColors(geom);
- len+= XkbSizeGeomShapes(geom);
- len+= XkbSizeGeomSections(geom);
- len+= XkbSizeGeomDoodads(geom->num_doodads,geom->doodads);
- len+= XkbSizeGeomKeyAliases(geom);
- rep->length= len/4;
- rep->found= True;
- rep->name= geom->name;
- rep->widthMM= geom->width_mm;
- rep->heightMM= geom->height_mm;
- rep->nProperties= geom->num_properties;
- rep->nColors= geom->num_colors;
- rep->nShapes= geom->num_shapes;
- rep->nSections= geom->num_sections;
- rep->nDoodads= geom->num_doodads;
- rep->nKeyAliases= geom->num_key_aliases;
- rep->baseColorNdx= XkbGeomColorIndex(geom,geom->base_color);
- rep->labelColorNdx= XkbGeomColorIndex(geom,geom->label_color);
- }
- else {
- rep->length= 0;
- rep->found= False;
- rep->name= name;
- rep->widthMM= rep->heightMM= 0;
- rep->nProperties= rep->nColors= rep->nShapes= 0;
- rep->nSections= rep->nDoodads= 0;
- rep->nKeyAliases= 0;
- rep->labelColorNdx= rep->baseColorNdx= 0;
- }
- return Success;
-}
-
-static int
-XkbSendGeometry( ClientPtr client,
- XkbGeometryPtr geom,
- xkbGetGeometryReply * rep,
- Bool freeGeom)
-{
- char *desc,*start;
- int len;
-
- if (geom!=NULL) {
- len= rep->length*4;
- start= desc= (char *)ALLOCATE_LOCAL(len);
- if (!start)
- return BadAlloc;
- desc= XkbWriteCountedString(desc,geom->label_font,client->swapped);
- if ( rep->nProperties>0 )
- desc = XkbWriteGeomProperties(desc,geom,client->swapped);
- if ( rep->nColors>0 )
- desc = XkbWriteGeomColors(desc,geom,client->swapped);
- if ( rep->nShapes>0 )
- desc = XkbWriteGeomShapes(desc,geom,client->swapped);
- if ( rep->nSections>0 )
- desc = XkbWriteGeomSections(desc,geom,client->swapped);
- if ( rep->nDoodads>0 )
- desc = XkbWriteGeomDoodads(desc,geom->num_doodads,geom->doodads,
- client->swapped);
- if ( rep->nKeyAliases>0 )
- desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped);
- if ((desc-start)!=(len)) {
- ErrorF("BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n",
- len, (unsigned long)(desc-start));
- }
- }
- else {
- len= 0;
- start= NULL;
- }
- if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swapl(&rep->name,n);
- swaps(&rep->widthMM,n);
- swaps(&rep->heightMM,n);
- swaps(&rep->nProperties,n);
- swaps(&rep->nColors,n);
- swaps(&rep->nShapes,n);
- swaps(&rep->nSections,n);
- swaps(&rep->nDoodads,n);
- swaps(&rep->nKeyAliases,n);
- }
- WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep);
- if (len>0)
- WriteToClient(client, len, start);
- if (start!=NULL)
- DEALLOCATE_LOCAL((char *)start);
- if (freeGeom)
- XkbFreeGeometry(geom,XkbGeomAllMask,True);
- return client->noClientException;
-}
-
-int
-ProcXkbGetGeometry(ClientPtr client)
-{
- DeviceIntPtr dev;
- xkbGetGeometryReply rep;
- XkbGeometryPtr geom;
- Bool shouldFree;
- Status status;
-
- REQUEST(xkbGetGeometryReq);
- REQUEST_SIZE_MATCH(xkbGetGeometryReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_ATOM_OR_NONE(stuff->name);
-
- geom= XkbLookupNamedGeometry(dev,stuff->name,&shouldFree);
- rep.type= X_Reply;
- rep.deviceID= dev->id;
- rep.sequenceNumber= client->sequence;
- rep.length= 0;
- status= XkbComputeGetGeometryReplySize(geom,&rep,stuff->name);
- if (status!=Success)
- return status;
- else return XkbSendGeometry(client,geom,&rep,shouldFree);
-}
-
-/***====================================================================***/
-
-static char *
-_GetCountedString(char **wire_inout,Bool swap)
-{
-char * wire,*str;
-CARD16 len,*plen;
-
- wire= *wire_inout;
- plen= (CARD16 *)wire;
- if (swap) {
- register int n;
- swaps(plen,n);
- }
- len= *plen;
- str= (char *)_XkbAlloc(len+1);
- if (str) {
- memcpy(str,&wire[2],len);
- str[len]= '\0';
- }
- wire+= XkbPaddedSize(len+2);
- *wire_inout= wire;
- return str;
-}
-
-static Status
-_CheckSetDoodad( char ** wire_inout,
- XkbGeometryPtr geom,
- XkbSectionPtr section,
- ClientPtr client)
-{
-char * wire;
-xkbDoodadWireDesc * dWire;
-XkbDoodadPtr doodad;
-
- dWire= (xkbDoodadWireDesc *)(*wire_inout);
- wire= (char *)&dWire[1];
- if (client->swapped) {
- register int n;
- swapl(&dWire->any.name,n);
- swaps(&dWire->any.top,n);
- swaps(&dWire->any.left,n);
- swaps(&dWire->any.angle,n);
- }
- CHK_ATOM_ONLY(dWire->any.name);
- doodad= XkbAddGeomDoodad(geom,section,dWire->any.name);
- if (!doodad)
- return BadAlloc;
- doodad->any.type= dWire->any.type;
- doodad->any.priority= dWire->any.priority;
- doodad->any.top= dWire->any.top;
- doodad->any.left= dWire->any.left;
- doodad->any.angle= dWire->any.angle;
- switch (doodad->any.type) {
- case XkbOutlineDoodad:
- case XkbSolidDoodad:
- if (dWire->shape.colorNdx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x40,geom->num_colors,
- dWire->shape.colorNdx);
- return BadMatch;
- }
- if (dWire->shape.shapeNdx>=geom->num_shapes) {
- client->errorValue= _XkbErrCode3(0x41,geom->num_shapes,
- dWire->shape.shapeNdx);
- return BadMatch;
- }
- doodad->shape.color_ndx= dWire->shape.colorNdx;
- doodad->shape.shape_ndx= dWire->shape.shapeNdx;
- break;
- case XkbTextDoodad:
- if (dWire->text.colorNdx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x42,geom->num_colors,
- dWire->text.colorNdx);
- return BadMatch;
- }
- if (client->swapped) {
- register int n;
- swaps(&dWire->text.width,n);
- swaps(&dWire->text.height,n);
- }
- doodad->text.width= dWire->text.width;
- doodad->text.height= dWire->text.height;
- doodad->text.color_ndx= dWire->text.colorNdx;
- doodad->text.text= _GetCountedString(&wire,client->swapped);
- doodad->text.font= _GetCountedString(&wire,client->swapped);
- break;
- case XkbIndicatorDoodad:
- if (dWire->indicator.onColorNdx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x43,geom->num_colors,
- dWire->indicator.onColorNdx);
- return BadMatch;
- }
- if (dWire->indicator.offColorNdx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x44,geom->num_colors,
- dWire->indicator.offColorNdx);
- return BadMatch;
- }
- if (dWire->indicator.shapeNdx>=geom->num_shapes) {
- client->errorValue= _XkbErrCode3(0x45,geom->num_shapes,
- dWire->indicator.shapeNdx);
- return BadMatch;
- }
- doodad->indicator.shape_ndx= dWire->indicator.shapeNdx;
- doodad->indicator.on_color_ndx= dWire->indicator.onColorNdx;
- doodad->indicator.off_color_ndx= dWire->indicator.offColorNdx;
- break;
- case XkbLogoDoodad:
- if (dWire->logo.colorNdx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x46,geom->num_colors,
- dWire->logo.colorNdx);
- return BadMatch;
- }
- if (dWire->logo.shapeNdx>=geom->num_shapes) {
- client->errorValue= _XkbErrCode3(0x47,geom->num_shapes,
- dWire->logo.shapeNdx);
- return BadMatch;
- }
- doodad->logo.color_ndx= dWire->logo.colorNdx;
- doodad->logo.shape_ndx= dWire->logo.shapeNdx;
- doodad->logo.logo_name= _GetCountedString(&wire,client->swapped);
- break;
- default:
- client->errorValue= _XkbErrCode2(0x4F,dWire->any.type);
- return BadValue;
- }
- *wire_inout= wire;
- return Success;
-}
-
-static Status
-_CheckSetOverlay( char ** wire_inout,
- XkbGeometryPtr geom,
- XkbSectionPtr section,
- ClientPtr client)
-{
-register int r;
-char * wire;
-XkbOverlayPtr ol;
-xkbOverlayWireDesc * olWire;
-xkbOverlayRowWireDesc * rWire;
-
- wire= *wire_inout;
- olWire= (xkbOverlayWireDesc *)wire;
- if (client->swapped) {
- register int n;
- swapl(&olWire->name,n);
- }
- CHK_ATOM_ONLY(olWire->name);
- ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows);
- rWire= (xkbOverlayRowWireDesc *)&olWire[1];
- for (r=0;r<olWire->nRows;r++) {
- register int k;
- xkbOverlayKeyWireDesc * kWire;
- XkbOverlayRowPtr row;
-
- if (rWire->rowUnder>section->num_rows) {
- client->errorValue= _XkbErrCode4(0x20,r,section->num_rows,
- rWire->rowUnder);
- return BadMatch;
- }
- row= XkbAddGeomOverlayRow(ol,rWire->rowUnder,rWire->nKeys);
- kWire= (xkbOverlayKeyWireDesc *)&rWire[1];
- for (k=0;k<rWire->nKeys;k++,kWire++) {
- if (XkbAddGeomOverlayKey(ol,row,
- (char *)kWire->over,(char *)kWire->under)==NULL) {
- client->errorValue= _XkbErrCode3(0x21,r,k);
- return BadMatch;
- }
- }
- rWire= (xkbOverlayRowWireDesc *)kWire;
- }
- olWire= (xkbOverlayWireDesc *)rWire;
- wire= (char *)olWire;
- *wire_inout= wire;
- return Success;
-}
-
-static Status
-_CheckSetSections( XkbGeometryPtr geom,
- xkbSetGeometryReq * req,
- char ** wire_inout,
- ClientPtr client)
-{
-Status status;
-register int s;
-char * wire;
-xkbSectionWireDesc * sWire;
-XkbSectionPtr section;
-
- wire= *wire_inout;
- if (req->nSections<1)
- return Success;
- sWire= (xkbSectionWireDesc *)wire;
- for (s=0;s<req->nSections;s++) {
- register int r;
- xkbRowWireDesc * rWire;
- if (client->swapped) {
- register int n;
- swapl(&sWire->name,n);
- swaps(&sWire->top,n);
- swaps(&sWire->left,n);
- swaps(&sWire->width,n);
- swaps(&sWire->height,n);
- swaps(&sWire->angle,n);
- }
- CHK_ATOM_ONLY(sWire->name);
- section= XkbAddGeomSection(geom,sWire->name,sWire->nRows,
- sWire->nDoodads,sWire->nOverlays);
- if (!section)
- return BadAlloc;
- section->priority= sWire->priority;
- section->top= sWire->top;
- section->left= sWire->left;
- section->width= sWire->width;
- section->height= sWire->height;
- section->angle= sWire->angle;
- rWire= (xkbRowWireDesc *)&sWire[1];
- for (r=0;r<sWire->nRows;r++) {
- register int k;
- XkbRowPtr row;
- xkbKeyWireDesc * kWire;
- if (client->swapped) {
- register int n;
- swaps(&rWire->top,n);
- swaps(&rWire->left,n);
- }
- row= XkbAddGeomRow(section,rWire->nKeys);
- if (!row)
- return BadAlloc;
- row->top= rWire->top;
- row->left= rWire->left;
- row->vertical= rWire->vertical;
- kWire= (xkbKeyWireDesc *)&rWire[1];
- for (k=0;k<rWire->nKeys;k++) {
- XkbKeyPtr key;
- key= XkbAddGeomKey(row);
- if (!key)
- return BadAlloc;
- memcpy(key->name.name,kWire[k].name,XkbKeyNameLength);
- key->gap= kWire[k].gap;
- key->shape_ndx= kWire[k].shapeNdx;
- key->color_ndx= kWire[k].colorNdx;
- if (key->shape_ndx>=geom->num_shapes) {
- client->errorValue= _XkbErrCode3(0x10,key->shape_ndx,
- geom->num_shapes);
- return BadMatch;
- }
- if (key->color_ndx>=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x11,key->color_ndx,
- geom->num_colors);
- return BadMatch;
- }
- }
- rWire= (xkbRowWireDesc *)&kWire[rWire->nKeys];
- }
- wire= (char *)rWire;
- if (sWire->nDoodads>0) {
- register int d;
- for (d=0;d<sWire->nDoodads;d++) {
- status=_CheckSetDoodad(&wire,geom,section,client);
- if (status!=Success)
- return status;
- }
- }
- if (sWire->nOverlays>0) {
- register int o;
- for (o=0;o<sWire->nOverlays;o++) {
- status= _CheckSetOverlay(&wire,geom,section,client);
- if (status!=Success)
- return status;
- }
- }
- sWire= (xkbSectionWireDesc *)wire;
- }
- wire= (char *)sWire;
- *wire_inout= wire;
- return Success;
-}
-
-static Status
-_CheckSetShapes( XkbGeometryPtr geom,
- xkbSetGeometryReq * req,
- char ** wire_inout,
- ClientPtr client)
-{
-register int i;
-char * wire;
-
- wire= *wire_inout;
- if (req->nShapes<1) {
- client->errorValue= _XkbErrCode2(0x06,req->nShapes);
- return BadValue;
- }
- else {
- xkbShapeWireDesc * shapeWire;
- XkbShapePtr shape;
- register int o;
- shapeWire= (xkbShapeWireDesc *)wire;
- for (i=0;i<req->nShapes;i++) {
- xkbOutlineWireDesc * olWire;
- XkbOutlinePtr ol;
- shape= XkbAddGeomShape(geom,shapeWire->name,shapeWire->nOutlines);
- if (!shape)
- return BadAlloc;
- olWire= (xkbOutlineWireDesc *)(&shapeWire[1]);
- for (o=0;o<shapeWire->nOutlines;o++) {
- register int p;
- XkbPointPtr pt;
- xkbPointWireDesc * ptWire;
-
- ol= XkbAddGeomOutline(shape,olWire->nPoints);
- if (!ol)
- return BadAlloc;
- ol->corner_radius= olWire->cornerRadius;
- ptWire= (xkbPointWireDesc *)&olWire[1];
- for (p=0,pt=ol->points;p<olWire->nPoints;p++,pt++) {
- pt->x= ptWire[p].x;
- pt->y= ptWire[p].y;
- if (client->swapped) {
- register int n;
- swaps(&pt->x,n);
- swaps(&pt->y,n);
- }
- }
- ol->num_points= olWire->nPoints;
- olWire= (xkbOutlineWireDesc *)(&ptWire[olWire->nPoints]);
- }
- if (shapeWire->primaryNdx!=XkbNoShape)
- shape->primary= &shape->outlines[shapeWire->primaryNdx];
- if (shapeWire->approxNdx!=XkbNoShape)
- shape->approx= &shape->outlines[shapeWire->approxNdx];
- shapeWire= (xkbShapeWireDesc *)olWire;
- }
- wire= (char *)shapeWire;
- }
- if (geom->num_shapes!=req->nShapes) {
- client->errorValue= _XkbErrCode3(0x07,geom->num_shapes,req->nShapes);
- return BadMatch;
- }
-
- *wire_inout= wire;
- return Success;
-}
-
-static Status
-_CheckSetGeom( XkbGeometryPtr geom,
- xkbSetGeometryReq * req,
- ClientPtr client)
-{
-register int i;
-Status status;
-char * wire;
-
- wire= (char *)&req[1];
- geom->label_font= _GetCountedString(&wire,client->swapped);
-
- for (i=0;i<req->nProperties;i++) {
- char *name,*val;
- name= _GetCountedString(&wire,client->swapped);
- val= _GetCountedString(&wire,client->swapped);
- if ((!name)||(!val)||(XkbAddGeomProperty(geom,name,val)==NULL))
- return BadAlloc;
- }
-
- if (req->nColors<2) {
- client->errorValue= _XkbErrCode3(0x01,2,req->nColors);
- return BadValue;
- }
- if (req->baseColorNdx>req->nColors) {
- client->errorValue=_XkbErrCode3(0x03,req->nColors,req->baseColorNdx);
- return BadMatch;
- }
- if (req->labelColorNdx>req->nColors) {
- client->errorValue= _XkbErrCode3(0x03,req->nColors,req->labelColorNdx);
- return BadMatch;
- }
- if (req->labelColorNdx==req->baseColorNdx) {
- client->errorValue= _XkbErrCode3(0x04,req->baseColorNdx,
- req->labelColorNdx);
- return BadMatch;
- }
-
- for (i=0;i<req->nColors;i++) {
- char *name;
- name= _GetCountedString(&wire,client->swapped);
- if ((!name)||(!XkbAddGeomColor(geom,name,geom->num_colors)))
- return BadAlloc;
- }
- if (req->nColors!=geom->num_colors) {
- client->errorValue= _XkbErrCode3(0x05,req->nColors,geom->num_colors);
- return BadMatch;
- }
- geom->label_color= &geom->colors[req->labelColorNdx];
- geom->base_color= &geom->colors[req->baseColorNdx];
-
- if ((status=_CheckSetShapes(geom,req,&wire,client))!=Success)
- return status;
-
- if ((status=_CheckSetSections(geom,req,&wire,client))!=Success)
- return status;
-
- for (i=0;i<req->nDoodads;i++) {
- status=_CheckSetDoodad(&wire,geom,NULL,client);
- if (status!=Success)
- return status;
- }
-
- for (i=0;i<req->nKeyAliases;i++) {
- if (XkbAddGeomKeyAlias(geom,&wire[XkbKeyNameLength],wire)==NULL)
- return BadAlloc;
- wire+= 2*XkbKeyNameLength;
- }
- return Success;
-}
-
-int
-ProcXkbSetGeometry(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbGeometryPtr geom,old;
- XkbGeometrySizesRec sizes;
- Status status;
- XkbDescPtr xkb;
- Bool new_name;
- xkbNewKeyboardNotify nkn;
-
- REQUEST(xkbSetGeometryReq);
- REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_ATOM_OR_NONE(stuff->name);
-
- xkb= dev->key->xkbInfo->desc;
- old= xkb->geom;
- xkb->geom= NULL;
-
- sizes.which= XkbGeomAllMask;
- sizes.num_properties= stuff->nProperties;
- sizes.num_colors= stuff->nColors;
- sizes.num_shapes= stuff->nShapes;
- sizes.num_sections= stuff->nSections;
- sizes.num_doodads= stuff->nDoodads;
- sizes.num_key_aliases= stuff->nKeyAliases;
- if ((status= XkbAllocGeometry(xkb,&sizes))!=Success) {
- xkb->geom= old;
- return status;
- }
- geom= xkb->geom;
- geom->name= stuff->name;
- geom->width_mm= stuff->widthMM;
- geom->height_mm= stuff->heightMM;
- if ((status= _CheckSetGeom(geom,stuff,client))!=Success) {
- XkbFreeGeometry(geom,XkbGeomAllMask,True);
- xkb->geom= old;
- return status;
- }
- new_name= (xkb->names->geometry!=geom->name);
- xkb->names->geometry= geom->name;
- if (old)
- XkbFreeGeometry(old,XkbGeomAllMask,True);
- if (new_name) {
- xkbNamesNotify nn;
- bzero(&nn,sizeof(xkbNamesNotify));
- nn.changed= XkbGeometryNameMask;
- XkbSendNamesNotify(dev,&nn);
- }
- nkn.deviceID= nkn.oldDeviceID= dev->id;
- nkn.minKeyCode= nkn.oldMinKeyCode= xkb->min_key_code;
- nkn.maxKeyCode= nkn.oldMaxKeyCode= xkb->max_key_code;
- nkn.requestMajor= XkbReqCode;
- nkn.requestMinor= X_kbSetGeometry;
- nkn.changed= XkbNKN_GeometryMask;
- XkbSendNewKeyboardNotify(dev,&nkn);
- return Success;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbPerClientFlags(ClientPtr client)
-{
- DeviceIntPtr dev;
- xkbPerClientFlagsReply rep;
- XkbInterestPtr interest;
-
- REQUEST(xkbPerClientFlagsReq);
- REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,stuff->change,XkbPCF_AllFlagsMask);
- CHK_MASK_MATCH(0x02,stuff->change,stuff->value);
-
- interest = XkbFindClientResource((DevicePtr)dev,client);
- rep.type= X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (stuff->change) {
- client->xkbClientFlags&= ~stuff->change;
- client->xkbClientFlags|= stuff->value;
- }
- if (stuff->change&XkbPCF_AutoResetControlsMask) {
- Bool want;
- want= stuff->value&XkbPCF_AutoResetControlsMask;
- if (interest && !want) {
- interest->autoCtrls= interest->autoCtrlValues= 0;
- }
- else if (want && (!interest)) {
- XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
- interest= XkbAddClientResource((DevicePtr)dev,client,id);
- if (!interest)
- return BadAlloc;
- }
- if (interest && want ) {
- register unsigned affect;
- affect= stuff->ctrlsToChange;
-
- CHK_MASK_LEGAL(0x03,affect,XkbAllBooleanCtrlsMask);
- CHK_MASK_MATCH(0x04,affect,stuff->autoCtrls);
- CHK_MASK_MATCH(0x05,stuff->autoCtrls,stuff->autoCtrlValues);
-
- interest->autoCtrls&= ~affect;
- interest->autoCtrlValues&= ~affect;
- interest->autoCtrls|= stuff->autoCtrls&affect;
- interest->autoCtrlValues|= stuff->autoCtrlValues&affect;
- }
- }
- rep.supported = XkbPCF_AllFlagsMask;
- rep.value= client->xkbClientFlags&XkbPCF_AllFlagsMask;
- if (interest) {
- rep.autoCtrls= interest->autoCtrls;
- rep.autoCtrlValues= interest->autoCtrlValues;
- }
- else {
- rep.autoCtrls= rep.autoCtrlValues= 0;
- }
- if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.supported,n);
- swapl(&rep.value,n);
- swapl(&rep.autoCtrls,n);
- swapl(&rep.autoCtrlValues,n);
- }
- WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-/* all latin-1 alphanumerics, plus parens, minus, underscore, slash */
-/* and wildcards */
-static unsigned char componentSpecLegal[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x87,
- 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
-};
-
-/* same as above but accepts percent, plus and bar too */
-static unsigned char componentExprLegal[] = {
- 0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x87,
- 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
-};
-
-static char *
-GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn)
-{
-int len;
-register int i;
-unsigned char *wire,*str,*tmp,*legal;
-
- if (allowExpr) legal= &componentExprLegal[0];
- else legal= &componentSpecLegal[0];
-
- wire= *pWire;
- len= (*(unsigned char *)wire++);
- if (len>0) {
- str= (unsigned char *)_XkbCalloc(1, len+1);
- if (str) {
- tmp= str;
- for (i=0;i<len;i++) {
- if (legal[(*wire)/8]&(1<<((*wire)%8)))
- *tmp++= *wire++;
- else wire++;
- }
- if (tmp!=str)
- *tmp++= '\0';
- else {
- _XkbFree(str);
- str= NULL;
- }
- }
- else {
- *errRtrn= BadAlloc;
- }
- }
- else {
- str= NULL;
- }
- *pWire= wire;
- return (char *)str;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbListComponents(ClientPtr client)
-{
- DeviceIntPtr dev;
- xkbListComponentsReply rep;
- unsigned len;
- int status;
- unsigned char * str;
- XkbSrvListInfoRec list;
-
- REQUEST(xkbListComponentsReq);
- REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- status= Success;
- str= (unsigned char *)&stuff[1];
- bzero(&list,sizeof(XkbSrvListInfoRec));
- list.maxRtrn= stuff->maxNames;
- list.pattern[_XkbListKeymaps]= GetComponentSpec(&str,False,&status);
- list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,False,&status);
- list.pattern[_XkbListTypes]= GetComponentSpec(&str,False,&status);
- list.pattern[_XkbListCompat]= GetComponentSpec(&str,False,&status);
- list.pattern[_XkbListSymbols]= GetComponentSpec(&str,False,&status);
- list.pattern[_XkbListGeometry]= GetComponentSpec(&str,False,&status);
- if (status!=Success)
- return status;
- len= str-((unsigned char *)stuff);
- if ((XkbPaddedSize(len)/4)!=stuff->length)
- return BadLength;
- if ((status=XkbDDXList(dev,&list,client))!=Success) {
- if (list.pool) {
- _XkbFree(list.pool);
- list.pool= NULL;
- }
- return status;
- }
- bzero(&rep,sizeof(xkbListComponentsReply));
- rep.type= X_Reply;
- rep.deviceID = dev->id;
- rep.sequenceNumber = client->sequence;
- rep.length = XkbPaddedSize(list.nPool)/4;
- rep.nKeymaps = list.nFound[_XkbListKeymaps];
- rep.nKeycodes = list.nFound[_XkbListKeycodes];
- rep.nTypes = list.nFound[_XkbListTypes];
- rep.nCompatMaps = list.nFound[_XkbListCompat];
- rep.nSymbols = list.nFound[_XkbListSymbols];
- rep.nGeometries = list.nFound[_XkbListGeometry];
- rep.extra= 0;
- if (list.nTotal>list.maxRtrn)
- rep.extra = (list.nTotal-list.maxRtrn);
- if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.nKeymaps,n);
- swaps(&rep.nKeycodes,n);
- swaps(&rep.nTypes,n);
- swaps(&rep.nCompatMaps,n);
- swaps(&rep.nSymbols,n);
- swaps(&rep.nGeometries,n);
- swaps(&rep.extra,n);
- }
- WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep);
- if (list.nPool && list.pool) {
- WriteToClient(client,XkbPaddedSize(list.nPool), (char *)list.pool);
- _XkbFree(list.pool);
- list.pool= NULL;
- }
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbGetKbdByName(ClientPtr client)
-{
- DeviceIntPtr dev;
- XkbFileInfo finfo;
- xkbGetKbdByNameReply rep;
- xkbGetMapReply mrep;
- xkbGetCompatMapReply crep;
- xkbGetIndicatorMapReply irep;
- xkbGetNamesReply nrep;
- xkbGetGeometryReply grep;
- XkbComponentNamesRec names;
- XkbDescPtr xkb;
- unsigned char * str;
- char mapFile[PATH_MAX];
- unsigned len;
- unsigned fwant,fneed,reported;
- int status;
- Bool geom_changed;
-
- REQUEST(xkbGetKbdByNameReq);
- REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- CHK_KBD_DEVICE(dev,stuff->deviceSpec);
-
- xkb = dev->key->xkbInfo->desc;
- status= Success;
- str= (unsigned char *)&stuff[1];
- names.keymap= GetComponentSpec(&str,True,&status);
- names.keycodes= GetComponentSpec(&str,True,&status);
- names.types= GetComponentSpec(&str,True,&status);
- names.compat= GetComponentSpec(&str,True,&status);
- names.symbols= GetComponentSpec(&str,True,&status);
- names.geometry= GetComponentSpec(&str,True,&status);
- if (status!=Success)
- return status;
- len= str-((unsigned char *)stuff);
- if ((XkbPaddedSize(len)/4)!=stuff->length)
- return BadLength;
-
- CHK_MASK_LEGAL(0x01,stuff->want,XkbGBN_AllComponentsMask);
- CHK_MASK_LEGAL(0x02,stuff->need,XkbGBN_AllComponentsMask);
-
- if (stuff->load)
- fwant= XkbGBN_AllComponentsMask;
- else fwant= stuff->want|stuff->need;
- if (!names.keymap) {
- if ((!names.compat)&&
- (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) {
- names.compat= _XkbDupString("%");
- }
- if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) {
- names.types= _XkbDupString("%");
- }
- if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) {
- names.symbols= _XkbDupString("%");
- }
- geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0));
- if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) {
- names.geometry= _XkbDupString("%");
- geom_changed= False;
- }
- }
- else {
- geom_changed= True;
- }
-
- bzero(mapFile,PATH_MAX);
- rep.type= X_Reply;
- rep.deviceID = dev->id;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.minKeyCode = xkb->min_key_code;
- rep.maxKeyCode = xkb->max_key_code;
- rep.loaded= False;
- fwant= XkbConvertGetByNameComponents(True,stuff->want)|XkmVirtualModsMask;
- fneed= XkbConvertGetByNameComponents(True,stuff->need);
- rep.reported= XkbConvertGetByNameComponents(False,fwant|fneed);
- if (stuff->load) {
- fneed|= XkmKeymapRequired;
- fwant|= XkmKeymapLegal;
- }
- if ((fwant|fneed)&XkmSymbolsMask) {
- fneed|= XkmKeyNamesIndex|XkmTypesIndex;
- fwant|= XkmIndicatorsIndex;
- }
- rep.found = XkbDDXLoadKeymapByNames(dev,&names,fwant,fneed,&finfo,
- mapFile,PATH_MAX);
- rep.newKeyboard= False;
- rep.pad1= rep.pad2= rep.pad3= rep.pad4= 0;
-
- stuff->want|= stuff->need;
- if (finfo.xkb==NULL)
- rep.reported= 0;
- else {
- if (stuff->load)
- rep.loaded= True;
- if (stuff->load ||
- ((rep.reported&XkbGBN_SymbolsMask) && (finfo.xkb->compat))) {
- XkbChangesRec changes;
- bzero(&changes,sizeof(changes));
- XkbUpdateDescActions(finfo.xkb,
- finfo.xkb->min_key_code,XkbNumKeys(finfo.xkb),
- &changes);
- }
-
- if (finfo.xkb->map==NULL)
- rep.reported&= ~(XkbGBN_SymbolsMask|XkbGBN_TypesMask);
- else if (rep.reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) {
- mrep.type= X_Reply;
- mrep.deviceID = dev->id;
- mrep.sequenceNumber= client->sequence;
- mrep.length = ((SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2);
- mrep.minKeyCode = finfo.xkb->min_key_code;
- mrep.maxKeyCode = finfo.xkb->max_key_code;
- mrep.present = 0;
- mrep.totalSyms = mrep.totalActs =
- mrep.totalKeyBehaviors= mrep.totalKeyExplicit=
- mrep.totalModMapKeys= 0;
- if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) {
- mrep.present|= XkbKeyTypesMask;
- mrep.firstType = 0;
- mrep.nTypes = mrep.totalTypes= finfo.xkb->map->num_types;
- }
- else {
- mrep.firstType = mrep.nTypes= 0;
- mrep.totalTypes= 0;
- }
- if (rep.reported&XkbGBN_ClientSymbolsMask) {
- mrep.present|= (XkbKeySymsMask|XkbModifierMapMask);
- mrep.firstKeySym = mrep.firstModMapKey= finfo.xkb->min_key_code;
- mrep.nKeySyms = mrep.nModMapKeys= XkbNumKeys(finfo.xkb);
- }
- else {
- mrep.firstKeySym= mrep.firstModMapKey= 0;
- mrep.nKeySyms= mrep.nModMapKeys= 0;
- }
- if (rep.reported&XkbGBN_ServerSymbolsMask) {
- mrep.present|= XkbAllServerInfoMask;
- mrep.virtualMods= ~0;
- mrep.firstKeyAct = mrep.firstKeyBehavior =
- mrep.firstKeyExplicit = finfo.xkb->min_key_code;
- mrep.nKeyActs = mrep.nKeyBehaviors =
- mrep.nKeyExplicit = XkbNumKeys(finfo.xkb);
- }
- else {
- mrep.virtualMods= 0;
- mrep.firstKeyAct= mrep.firstKeyBehavior=
- mrep.firstKeyExplicit = 0;
- mrep.nKeyActs= mrep.nKeyBehaviors= mrep.nKeyExplicit= 0;
- }
- XkbComputeGetMapReplySize(finfo.xkb,&mrep);
- rep.length+= SIZEOF(xGenericReply)/4+mrep.length;
- }
- if (finfo.xkb->compat==NULL)
- rep.reported&= ~XkbGBN_CompatMapMask;
- else if (rep.reported&XkbGBN_CompatMapMask) {
- crep.type= X_Reply;
- crep.deviceID= dev->id;
- crep.sequenceNumber= client->sequence;
- crep.length= 0;
- crep.groups= XkbAllGroupsMask;
- crep.firstSI= 0;
- crep.nSI= crep.nTotalSI= finfo.xkb->compat->num_si;
- XkbComputeGetCompatMapReplySize(finfo.xkb->compat,&crep);
- rep.length+= SIZEOF(xGenericReply)/4+crep.length;
- }
- if (finfo.xkb->indicators==NULL)
- rep.reported&= ~XkbGBN_IndicatorMapMask;
- else if (rep.reported&XkbGBN_IndicatorMapMask) {
- irep.type= X_Reply;
- irep.deviceID= dev->id;
- irep.sequenceNumber= client->sequence;
- irep.length= 0;
- irep.which= XkbAllIndicatorsMask;
- XkbComputeGetIndicatorMapReplySize(finfo.xkb->indicators,&irep);
- rep.length+= SIZEOF(xGenericReply)/4+irep.length;
- }
- if (finfo.xkb->names==NULL)
- rep.reported&= ~(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask);
- else if (rep.reported&(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask)) {
- nrep.type= X_Reply;
- nrep.deviceID= dev->id;
- nrep.sequenceNumber= client->sequence;
- nrep.length= 0;
- nrep.minKeyCode= finfo.xkb->min_key_code;
- nrep.maxKeyCode= finfo.xkb->max_key_code;
- if (rep.reported&XkbGBN_OtherNamesMask) {
- nrep.which= XkbAllNamesMask;
- if (finfo.xkb->map!=NULL)
- nrep.nTypes= finfo.xkb->map->num_types;
- else nrep.nTypes= 0;
- nrep.nKTLevels= 0;
- nrep.groupNames= XkbAllGroupsMask;
- nrep.virtualMods= XkbAllVirtualModsMask;
- nrep.indicators= XkbAllIndicatorsMask;
- nrep.nRadioGroups= finfo.xkb->names->num_rg;
- }
- else {
- nrep.which= 0;
- nrep.nTypes= 0;
- nrep.nKTLevels= 0;
- nrep.groupNames= 0;
- nrep.virtualMods= 0;
- nrep.indicators= 0;
- nrep.nRadioGroups= 0;
- }
- if (rep.reported&XkbGBN_KeyNamesMask) {
- nrep.which|= XkbKeyNamesMask;
- nrep.firstKey= finfo.xkb->min_key_code;
- nrep.nKeys= XkbNumKeys(finfo.xkb);
- nrep.nKeyAliases= finfo.xkb->names->num_key_aliases;
- if (nrep.nKeyAliases)
- nrep.which|= XkbKeyAliasesMask;
- }
- else {
- nrep.which&= ~(XkbKeyNamesMask|XkbKeyAliasesMask);
- nrep.firstKey= nrep.nKeys= 0;
- nrep.nKeyAliases= 0;
- }
- XkbComputeGetNamesReplySize(finfo.xkb,&nrep);
- rep.length+= SIZEOF(xGenericReply)/4+nrep.length;
- }
- if (finfo.xkb->geom==NULL)
- rep.reported&= ~XkbGBN_GeometryMask;
- else if (rep.reported&XkbGBN_GeometryMask) {
- grep.type= X_Reply;
- grep.deviceID= dev->id;
- grep.sequenceNumber= client->sequence;
- grep.length= 0;
- grep.found= True;
- grep.pad= 0;
- grep.widthMM= grep.heightMM= 0;
- grep.nProperties= grep.nColors= grep.nShapes= 0;
- grep.nSections= grep.nDoodads= 0;
- grep.baseColorNdx= grep.labelColorNdx= 0;
- XkbComputeGetGeometryReplySize(finfo.xkb->geom,&grep,None);
- rep.length+= SIZEOF(xGenericReply)/4+grep.length;
- }
- }
-
- reported= rep.reported;
- if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.found,n);
- swaps(&rep.reported,n);
- }
- WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep);
- if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask))
- XkbSendMap(client,finfo.xkb,&mrep);
- if (reported&XkbGBN_CompatMapMask)
- XkbSendCompatMap(client,finfo.xkb->compat,&crep);
- if (reported&XkbGBN_IndicatorMapMask)
- XkbSendIndicatorMap(client,finfo.xkb->indicators,&irep);
- if (reported&(XkbGBN_KeyNamesMask|XkbGBN_OtherNamesMask))
- XkbSendNames(client,finfo.xkb,&nrep);
- if (reported&XkbGBN_GeometryMask)
- XkbSendGeometry(client,finfo.xkb->geom,&grep,False);
- if (rep.loaded) {
- XkbDescPtr old_xkb;
- xkbNewKeyboardNotify nkn;
- int i,nG,nTG;
- old_xkb= xkb;
- xkb= finfo.xkb;
- dev->key->xkbInfo->desc= xkb;
- finfo.xkb= old_xkb; /* so it'll get freed automatically */
-
- *xkb->ctrls= *old_xkb->ctrls;
- for (nG=nTG=0,i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- nG= XkbKeyNumGroups(xkb,i);
- if (nG>=XkbNumKbdGroups) {
- nTG= XkbNumKbdGroups;
- break;
- }
- if (nG>nTG) {
- nTG= nG;
- }
- }
- xkb->ctrls->num_groups= nTG;
-
- memcpy(dev->key->modifierMap,xkb->map->modmap,xkb->max_key_code+1);
- XkbUpdateCoreDescription(dev,True);
-
- if (dev->kbdfeed && dev->kbdfeed->xkb_sli) {
- XkbSrvLedInfoPtr old_sli;
- XkbSrvLedInfoPtr sli;
- old_sli = dev->kbdfeed->xkb_sli;
- dev->kbdfeed->xkb_sli = NULL;
- sli = XkbAllocSrvLedInfo(dev,dev->kbdfeed,NULL,0);
- if (sli) {
- sli->explicitState = old_sli->explicitState;
- sli->effectiveState = old_sli->effectiveState;
- }
- dev->kbdfeed->xkb_sli = sli;
- XkbFreeSrvLedInfo(old_sli);
- }
-
- nkn.deviceID= nkn.oldDeviceID= dev->id;
- nkn.minKeyCode= finfo.xkb->min_key_code;
- nkn.maxKeyCode= finfo.xkb->max_key_code;
- nkn.oldMinKeyCode= xkb->min_key_code;
- nkn.oldMaxKeyCode= xkb->max_key_code;
- nkn.requestMajor= XkbReqCode;
- nkn.requestMinor= X_kbGetKbdByName;
- nkn.changed= XkbNKN_KeycodesMask;
- if (geom_changed)
- nkn.changed|= XkbNKN_GeometryMask;
- XkbSendNewKeyboardNotify(dev,&nkn);
- }
- if ((finfo.xkb!=NULL)&&(finfo.xkb!=xkb)) {
- XkbFreeKeyboard(finfo.xkb,XkbAllComponentsMask,True);
- finfo.xkb= NULL;
- }
- if (names.keymap) { _XkbFree(names.keymap); names.keymap= NULL; }
- if (names.keycodes) { _XkbFree(names.keycodes); names.keycodes= NULL; }
- if (names.types) { _XkbFree(names.types); names.types= NULL; }
- if (names.compat) { _XkbFree(names.compat); names.compat= NULL; }
- if (names.symbols) { _XkbFree(names.symbols); names.symbols= NULL; }
- if (names.geometry) { _XkbFree(names.geometry); names.geometry= NULL; }
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-static int
-ComputeDeviceLedInfoSize( DeviceIntPtr dev,
- unsigned int what,
- XkbSrvLedInfoPtr sli)
-{
-int nNames,nMaps;
-register unsigned n,bit;
-
- if (sli==NULL)
- return 0;
- nNames= nMaps= 0;
- if ((what&XkbXI_IndicatorNamesMask)==0)
- sli->namesPresent= 0;
- if ((what&XkbXI_IndicatorMapsMask)==0)
- sli->mapsPresent= 0;
-
- for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) {
- if (sli->names && sli->names[n]!=None) {
- sli->namesPresent|= bit;
- nNames++;
- }
- if (sli->maps && XkbIM_InUse(&sli->maps[n])) {
- sli->mapsPresent|= bit;
- nMaps++;
- }
- }
- return (nNames*4)+(nMaps*SIZEOF(xkbIndicatorMapWireDesc));
-}
-
-static int
-CheckDeviceLedFBs( DeviceIntPtr dev,
- int class,
- int id,
- xkbGetDeviceInfoReply * rep,
- ClientPtr client)
-{
-int nFBs= 0;
-int length= 0;
-Bool classOk;
-
- if (class==XkbDfltXIClass) {
- if (dev->kbdfeed) class= KbdFeedbackClass;
- else if (dev->leds) class= LedFeedbackClass;
- else {
- client->errorValue= _XkbErrCode2(XkbErr_BadClass,class);
- return XkbKeyboardErrorCode;
- }
- }
- classOk= False;
- if ((dev->kbdfeed)&&((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) {
- KbdFeedbackPtr kf;
- classOk= True;
- for (kf= dev->kbdfeed;(kf);kf=kf->next) {
- if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=kf->ctrl.id))
- continue;
- nFBs++;
- length+= SIZEOF(xkbDeviceLedsWireDesc);
- if (!kf->xkb_sli)
- kf->xkb_sli= XkbAllocSrvLedInfo(dev,kf,NULL,0);
- length+= ComputeDeviceLedInfoSize(dev,rep->present,kf->xkb_sli);
- if (id!=XkbAllXIIds)
- break;
- }
- }
- if ((dev->leds)&&((class==LedFeedbackClass)||(class==XkbAllXIClasses))) {
- LedFeedbackPtr lf;
- classOk= True;
- for (lf= dev->leds;(lf);lf=lf->next) {
- if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=lf->ctrl.id))
- continue;
- nFBs++;
- length+= SIZEOF(xkbDeviceLedsWireDesc);
- if (!lf->xkb_sli)
- lf->xkb_sli= XkbAllocSrvLedInfo(dev,NULL,lf,0);
- length+= ComputeDeviceLedInfoSize(dev,rep->present,lf->xkb_sli);
- if (id!=XkbAllXIIds)
- break;
- }
- }
- if (nFBs>0) {
- if (rep->supported&XkbXI_IndicatorsMask) {
- rep->nDeviceLedFBs= nFBs;
- rep->length+= (length/4);
- }
- return Success;
- }
- if (classOk) client->errorValue= _XkbErrCode2(XkbErr_BadId,id);
- else client->errorValue= _XkbErrCode2(XkbErr_BadClass,class);
- return XkbKeyboardErrorCode;
-}
-
-static int
-SendDeviceLedInfo( XkbSrvLedInfoPtr sli,
- ClientPtr client)
-{
-xkbDeviceLedsWireDesc wire;
-int length;
-
- length= 0;
- wire.ledClass= sli->class;
- wire.ledID= sli->id;
- wire.namesPresent= sli->namesPresent;
- wire.mapsPresent= sli->mapsPresent;
- wire.physIndicators= sli->physIndicators;
- wire.state= sli->effectiveState;
- if (client->swapped) {
- register int n;
- swaps(&wire.ledClass,n);
- swaps(&wire.ledID,n);
- swapl(&wire.namesPresent,n);
- swapl(&wire.mapsPresent,n);
- swapl(&wire.physIndicators,n);
- swapl(&wire.state,n);
- }
- WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire);
- length+= SIZEOF(xkbDeviceLedsWireDesc);
- if (sli->namesPresent|sli->mapsPresent) {
- register unsigned i,bit;
- if (sli->namesPresent) {
- CARD32 awire;
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (sli->namesPresent&bit) {
- awire= (CARD32)sli->names[i];
- if (client->swapped) {
- register int n;
- swapl(&awire,n);
- }
- WriteToClient(client,4,(char *)&awire);
- length+= 4;
- }
- }
- }
- if (sli->mapsPresent) {
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- xkbIndicatorMapWireDesc iwire;
- if (sli->mapsPresent&bit) {
- iwire.flags= sli->maps[i].flags;
- iwire.whichGroups= sli->maps[i].which_groups;
- iwire.groups= sli->maps[i].groups;
- iwire.whichMods= sli->maps[i].which_mods;
- iwire.mods= sli->maps[i].mods.mask;
- iwire.realMods= sli->maps[i].mods.real_mods;
- iwire.virtualMods= sli->maps[i].mods.vmods;
- iwire.ctrls= sli->maps[i].ctrls;
- if (client->swapped) {
- register int n;
- swaps(&iwire.virtualMods,n);
- swapl(&iwire.ctrls,n);
- }
- WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc),
- (char *)&iwire);
- length+= SIZEOF(xkbIndicatorMapWireDesc);
- }
- }
- }
- }
- return length;
-}
-
-static int
-SendDeviceLedFBs( DeviceIntPtr dev,
- int class,
- int id,
- unsigned wantLength,
- ClientPtr client)
-{
-int length= 0;
-
- if (class==XkbDfltXIClass) {
- if (dev->kbdfeed) class= KbdFeedbackClass;
- else if (dev->leds) class= LedFeedbackClass;
- }
- if ((dev->kbdfeed)&&
- ((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) {
- KbdFeedbackPtr kf;
- for (kf= dev->kbdfeed;(kf);kf=kf->next) {
- if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==kf->ctrl.id)) {
- length+= SendDeviceLedInfo(kf->xkb_sli,client);
- if (id!=XkbAllXIIds)
- break;
- }
- }
- }
- if ((dev->leds)&&
- ((class==LedFeedbackClass)||(class==XkbAllXIClasses))) {
- LedFeedbackPtr lf;
- for (lf= dev->leds;(lf);lf=lf->next) {
- if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==lf->ctrl.id)) {
- length+= SendDeviceLedInfo(lf->xkb_sli,client);
- if (id!=XkbAllXIIds)
- break;
- }
- }
- }
- if (length==wantLength)
- return Success;
- else return BadLength;
-}
-
-int
-ProcXkbGetDeviceInfo(ClientPtr client)
-{
-DeviceIntPtr dev;
-xkbGetDeviceInfoReply rep;
-int status,nDeviceLedFBs;
-unsigned length,nameLen;
-CARD16 ledClass,ledID;
-unsigned wanted,supported;
-char * str;
-
- REQUEST(xkbGetDeviceInfoReq);
- REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- wanted= stuff->wanted;
-
- CHK_ANY_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,wanted,XkbXI_AllDeviceFeaturesMask);
-
- if ((!dev->button)||((stuff->nBtns<1)&&(!stuff->allBtns)))
- wanted&= ~XkbXI_ButtonActionsMask;
- if ((!dev->kbdfeed)&&(!dev->leds))
- wanted&= ~XkbXI_IndicatorsMask;
- wanted&= ~XkbXIUnsupported;
-
- nameLen= XkbSizeCountedString(dev->name);
- bzero((char *)&rep,SIZEOF(xkbGetDeviceInfoReply));
- rep.type = X_Reply;
- rep.deviceID= dev->id;
- rep.sequenceNumber = client->sequence;
- rep.length = nameLen/4;
- rep.present = wanted;
- rep.supported = XkbXI_AllDeviceFeaturesMask&(~XkbXIUnsupported);
- rep.unsupported = XkbXIUnsupported;
- rep.firstBtnWanted = rep.nBtnsWanted = 0;
- rep.firstBtnRtrn = rep.nBtnsRtrn = 0;
- if (dev->button)
- rep.totalBtns= dev->button->numButtons;
- else rep.totalBtns= 0;
- rep.devType= dev->type;
- rep.hasOwnState= (dev->key && dev->key->xkbInfo);
- rep.nDeviceLedFBs = 0;
- if (dev->kbdfeed) rep.dfltKbdFB= dev->kbdfeed->ctrl.id;
- else rep.dfltKbdFB= XkbXINone;
- if (dev->leds) rep.dfltLedFB= dev->leds->ctrl.id;
- else rep.dfltLedFB= XkbXINone;
-
- ledClass= stuff->ledClass;
- ledID= stuff->ledID;
-
- rep.firstBtnWanted= rep.nBtnsWanted= 0;
- rep.firstBtnRtrn= rep.nBtnsRtrn= 0;
- if (wanted&XkbXI_ButtonActionsMask) {
- if (stuff->allBtns) {
- stuff->firstBtn= 0;
- stuff->nBtns= dev->button->numButtons;
- }
-
- if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) {
- client->errorValue = _XkbErrCode4(0x02,dev->button->numButtons,
- stuff->firstBtn,
- stuff->nBtns);
- return BadValue;
- }
- else {
- rep.firstBtnWanted= stuff->firstBtn;
- rep.nBtnsWanted= stuff->nBtns;
- if (dev->button->xkb_acts!=NULL) {
- XkbAction *act;
- register int i;
-
- rep.firstBtnRtrn= stuff->firstBtn;
- rep.nBtnsRtrn= stuff->nBtns;
- act= &dev->button->xkb_acts[rep.firstBtnWanted];
- for (i=0;i<rep.nBtnsRtrn;i++,act++) {
- if (act->type!=XkbSA_NoAction)
- break;
- }
- rep.firstBtnRtrn+= i;
- rep.nBtnsRtrn-= i;
- act= &dev->button->xkb_acts[rep.firstBtnRtrn+rep.nBtnsRtrn-1];
- for (i=0;i<rep.nBtnsRtrn;i++,act--) {
- if (act->type!=XkbSA_NoAction)
- break;
- }
- rep.nBtnsRtrn-= i;
- }
- rep.length+= (rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc))/4;
- }
- }
-
- if (wanted&XkbXI_IndicatorsMask) {
- status= CheckDeviceLedFBs(dev,ledClass,ledID,&rep,client);
- if (status!=Success)
- return status;
- }
- length= rep.length*4;
- supported= rep.supported;
- nDeviceLedFBs = rep.nDeviceLedFBs;
- if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.present,n);
- swaps(&rep.supported,n);
- swaps(&rep.unsupported,n);
- swaps(&rep.nDeviceLedFBs,n);
- swapl(&rep.type,n);
- }
- WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
-
- str= (char*) ALLOCATE_LOCAL(nameLen);
- if (!str)
- return BadAlloc;
- XkbWriteCountedString(str,dev->name,client->swapped);
- WriteToClient(client,nameLen,str);
- DEALLOCATE_LOCAL(str);
- length-= nameLen;
-
- if (rep.nBtnsRtrn>0) {
- int sz;
- xkbActionWireDesc * awire;
- sz= rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc);
- awire= (xkbActionWireDesc *)&dev->button->xkb_acts[rep.firstBtnRtrn];
- WriteToClient(client,sz,(char *)awire);
- length-= sz;
- }
- if (nDeviceLedFBs>0) {
- status= SendDeviceLedFBs(dev,ledClass,ledID,length,client);
- if (status!=Success)
- return status;
- }
- else if (length!=0) {
-#ifdef DEBUG
- ErrorF("Internal Error! BadLength in ProcXkbGetDeviceInfo\n");
- ErrorF(" Wrote %d fewer bytes than expected\n",length);
-#endif
- return BadLength;
- }
- if (stuff->wanted&(~supported)) {
- xkbExtensionDeviceNotify ed;
- bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify));
- ed.ledClass= ledClass;
- ed.ledID= ledID;
- ed.ledsDefined= 0;
- ed.ledState= 0;
- ed.firstBtn= ed.nBtns= 0;
- ed.reason= XkbXI_UnsupportedFeatureMask;
- ed.supported= supported;
- ed.unsupported= stuff->wanted&(~supported);
- XkbSendExtensionDeviceNotify(dev,client,&ed);
- }
- return client->noClientException;
-}
-
-static char *
-CheckSetDeviceIndicators( char * wire,
- DeviceIntPtr dev,
- int num,
- int * status_rtrn,
- ClientPtr client)
-{
-xkbDeviceLedsWireDesc * ledWire;
-int i;
-XkbSrvLedInfoPtr sli;
-
- ledWire= (xkbDeviceLedsWireDesc *)wire;
- for (i=0;i<num;i++) {
- if (client->swapped) {
- register int n;
- swaps(&ledWire->ledClass,n);
- swaps(&ledWire->ledID,n);
- swapl(&ledWire->namesPresent,n);
- swapl(&ledWire->mapsPresent,n);
- swapl(&ledWire->physIndicators,n);
- }
-
- sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID,
- XkbXI_IndicatorsMask);
- if (sli!=NULL) {
- register int n;
- register unsigned bit;
- int nMaps,nNames;
- CARD32 *atomWire;
- xkbIndicatorMapWireDesc *mapWire;
-
- nMaps= nNames= 0;
- for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) {
- if (ledWire->namesPresent&bit)
- nNames++;
- if (ledWire->mapsPresent&bit)
- nMaps++;
- }
- atomWire= (CARD32 *)&ledWire[1];
- if (nNames>0) {
- for (n=0;n<nNames;n++) {
- if (client->swapped) {
- register int t;
- swapl(atomWire,t);
- }
- CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue,
- *status_rtrn,NULL);
- atomWire++;
- }
- }
- mapWire= (xkbIndicatorMapWireDesc *)atomWire;
- if (nMaps>0) {
- for (n=0;n<nMaps;n++) {
- if (client->swapped) {
- register int t;
- swaps(&mapWire->virtualMods,t);
- swapl(&mapWire->ctrls,t);
- }
- CHK_MASK_LEGAL3(0x21,mapWire->whichGroups,
- XkbIM_UseAnyGroup,
- client->errorValue,
- *status_rtrn,NULL);
- CHK_MASK_LEGAL3(0x22,mapWire->whichMods,XkbIM_UseAnyMods,
- client->errorValue,
- *status_rtrn,NULL);
- mapWire++;
- }
- }
- ledWire= (xkbDeviceLedsWireDesc *)mapWire;
- }
- else {
- /* SHOULD NEVER HAPPEN */
- return (char *)ledWire;
- }
- }
- return (char *)ledWire;
-}
-
-static char *
-SetDeviceIndicators( char * wire,
- DeviceIntPtr dev,
- unsigned changed,
- int num,
- int * status_rtrn,
- ClientPtr client,
- xkbExtensionDeviceNotify *ev)
-{
-xkbDeviceLedsWireDesc * ledWire;
-int i;
-XkbEventCauseRec cause;
-unsigned namec,mapc,statec;
-xkbExtensionDeviceNotify ed;
-XkbChangesRec changes;
-DeviceIntPtr kbd;
-
- bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
- bzero((char *)&changes,sizeof(XkbChangesRec));
- XkbSetCauseXkbReq(&cause,X_kbSetDeviceInfo,client);
- ledWire= (xkbDeviceLedsWireDesc *)wire;
- for (i=0;i<num;i++) {
- register int n;
- register unsigned bit;
- CARD32 * atomWire;
- xkbIndicatorMapWireDesc * mapWire;
- XkbSrvLedInfoPtr sli;
-
- namec= mapc= statec= 0;
- sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID,
- XkbXI_IndicatorMapsMask);
- if (!sli) {
- /* SHOULD NEVER HAPPEN!! */
- return (char *)ledWire;
- }
-
- atomWire= (CARD32 *)&ledWire[1];
- if (changed&XkbXI_IndicatorNamesMask) {
- namec= sli->namesPresent|ledWire->namesPresent;
- bzero((char *)sli->names,XkbNumIndicators*sizeof(Atom));
- }
- if (ledWire->namesPresent) {
- sli->namesPresent= ledWire->namesPresent;
- bzero((char *)sli->names,XkbNumIndicators*sizeof(Atom));
- for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) {
- if (ledWire->namesPresent&bit) {
- sli->names[n]= (Atom)*atomWire;
- if (sli->names[n]==None)
- ledWire->namesPresent&= ~bit;
- atomWire++;
- }
- }
- }
- mapWire= (xkbIndicatorMapWireDesc *)atomWire;
- if (changed&XkbXI_IndicatorMapsMask) {
- mapc= sli->mapsPresent|ledWire->mapsPresent;
- sli->mapsPresent= ledWire->mapsPresent;
- bzero((char*)sli->maps,XkbNumIndicators*sizeof(XkbIndicatorMapRec));
- }
- if (ledWire->mapsPresent) {
- for (n=0,bit=1;n<XkbNumIndicators;n++,bit<<=1) {
- if (ledWire->mapsPresent&bit) {
- sli->maps[n].flags= mapWire->flags;
- sli->maps[n].which_groups= mapWire->whichGroups;
- sli->maps[n].groups= mapWire->groups;
- sli->maps[n].which_mods= mapWire->whichMods;
- sli->maps[n].mods.mask= mapWire->mods;
- sli->maps[n].mods.real_mods=mapWire->realMods;
- sli->maps[n].mods.vmods= mapWire->virtualMods;
- sli->maps[n].ctrls= mapWire->ctrls;
- mapWire++;
- }
- }
- }
- if (changed&XkbXI_IndicatorStateMask) {
- statec= sli->effectiveState^ledWire->state;
- sli->explicitState&= ~statec;
- sli->explicitState|= (ledWire->state&statec);
- }
- if (namec)
- XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause);
- if (mapc)
- XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause);
- if (statec)
- XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause);
-
- kbd= dev;
- if ((sli->flags&XkbSLI_HasOwnState)==0)
- kbd= (DeviceIntPtr)LookupKeyboardDevice();
-
- XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause);
- ledWire= (xkbDeviceLedsWireDesc *)mapWire;
- }
- return (char *)ledWire;
-}
-
-int
-ProcXkbSetDeviceInfo(ClientPtr client)
-{
-DeviceIntPtr dev;
-unsigned change;
-char * wire;
-xkbExtensionDeviceNotify ed;
-
- REQUEST(xkbSetDeviceInfoReq);
- REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
-
- if (!(client->xkbClientFlags&_XkbClientInitialized))
- return BadAccess;
-
- change= stuff->change;
-
- CHK_ANY_DEVICE(dev,stuff->deviceSpec);
- CHK_MASK_LEGAL(0x01,change,(XkbXI_AllFeaturesMask&(~XkbXI_KeyboardsMask)));
-
- wire= (char *)&stuff[1];
- if (change&XkbXI_ButtonActionsMask) {
- if (!dev->button) {
- client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass);
- return XkbKeyboardErrorCode;
- }
- if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) {
- client->errorValue= _XkbErrCode4(0x02,stuff->firstBtn,stuff->nBtns,
- dev->button->numButtons);
- return BadMatch;
- }
- wire+= (stuff->nBtns*SIZEOF(xkbActionWireDesc));
- }
- if (stuff->change&XkbXI_IndicatorsMask) {
- int status= Success;
- wire= CheckSetDeviceIndicators(wire,dev,stuff->nDeviceLedFBs,
- &status,client);
- if (status!=Success)
- return status;
- }
- if (((wire-((char *)stuff))/4)!=stuff->length)
- return BadLength;
-
- bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify));
- ed.deviceID= dev->id;
- wire= (char *)&stuff[1];
- if (change&XkbXI_ButtonActionsMask) {
- int nBtns,sz,i;
- XkbAction * acts;
- DeviceIntPtr kbd;
-
- nBtns= dev->button->numButtons;
- acts= dev->button->xkb_acts;
- if (acts==NULL) {
- acts= _XkbTypedCalloc(nBtns,XkbAction);
- if (!acts)
- return BadAlloc;
- dev->button->xkb_acts= acts;
- }
- sz= stuff->nBtns*SIZEOF(xkbActionWireDesc);
- memcpy((char *)&acts[stuff->firstBtn],(char *)wire,sz);
- wire+= sz;
- ed.reason|= XkbXI_ButtonActionsMask;
- ed.firstBtn= stuff->firstBtn;
- ed.nBtns= stuff->nBtns;
-
- if (dev->key) kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
- acts= &dev->button->xkb_acts[stuff->firstBtn];
- for (i=0;i<stuff->nBtns;i++,acts++) {
- if (acts->type!=XkbSA_NoAction)
- XkbSetActionKeyMods(kbd->key->xkbInfo->desc,acts,0);
- }
- }
- if (stuff->change&XkbXI_IndicatorsMask) {
- int status= Success;
- wire= SetDeviceIndicators(wire,dev,change,stuff->nDeviceLedFBs,
- &status,client,&ed);
- if (status!=Success)
- return status;
- }
- if ((stuff->change)&&(ed.reason))
- XkbSendExtensionDeviceNotify(dev,client,&ed);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-int
-ProcXkbSetDebuggingFlags(ClientPtr client)
-{
-CARD32 newFlags,newCtrls,extraLength;
-xkbSetDebuggingFlagsReply rep;
-
- REQUEST(xkbSetDebuggingFlagsReq);
- REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
-
- newFlags= xkbDebugFlags&(~stuff->affectFlags);
- newFlags|= (stuff->flags&stuff->affectFlags);
- newCtrls= xkbDebugCtrls&(~stuff->affectCtrls);
- newCtrls|= (stuff->ctrls&stuff->affectCtrls);
- if (xkbDebugFlags || newFlags || stuff->msgLength) {
- ErrorF("XkbDebug: Setting debug flags to 0x%lx\n",(long)newFlags);
- if (newCtrls!=xkbDebugCtrls)
- ErrorF("XkbDebug: Setting debug controls to 0x%lx\n",(long)newCtrls);
- }
- extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq;
- if (stuff->msgLength>0) {
- char *msg;
- if (extraLength<XkbPaddedSize(stuff->msgLength)) {
- ErrorF("XkbDebug: msgLength= %d, length= %ld (should be %d)\n",
- stuff->msgLength,(long)extraLength,
- XkbPaddedSize(stuff->msgLength));
- return BadLength;
- }
- msg= (char *)&stuff[1];
- if (msg[stuff->msgLength-1]!='\0') {
- ErrorF("XkbDebug: message not null-terminated\n");
- return BadValue;
- }
- ErrorF("XkbDebug: %s\n",msg);
- }
- xkbDebugFlags = newFlags;
- xkbDebugCtrls = newCtrls;
-
- XkbDisableLockActions= (xkbDebugCtrls&XkbDF_DisableLocks);
-
- rep.type= X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.currentFlags = newFlags;
- rep.currentCtrls = newCtrls;
- rep.supportedFlags = ~0;
- rep.supportedCtrls = ~0;
- if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.currentFlags, n);
- swapl(&rep.currentCtrls, n);
- swapl(&rep.supportedFlags, n);
- swapl(&rep.supportedCtrls, n);
- }
- WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep);
- return client->noClientException;
-}
-
-/***====================================================================***/
-
-static int
-ProcXkbDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_kbUseExtension:
- return ProcXkbUseExtension(client);
- case X_kbSelectEvents:
- return ProcXkbSelectEvents(client);
- case X_kbBell:
- return ProcXkbBell(client);
- case X_kbGetState:
- return ProcXkbGetState(client);
- case X_kbLatchLockState:
- return ProcXkbLatchLockState(client);
- case X_kbGetControls:
- return ProcXkbGetControls(client);
- case X_kbSetControls:
- return ProcXkbSetControls(client);
- case X_kbGetMap:
- return ProcXkbGetMap(client);
- case X_kbSetMap:
- return ProcXkbSetMap(client);
- case X_kbGetCompatMap:
- return ProcXkbGetCompatMap(client);
- case X_kbSetCompatMap:
- return ProcXkbSetCompatMap(client);
- case X_kbGetIndicatorState:
- return ProcXkbGetIndicatorState(client);
- case X_kbGetIndicatorMap:
- return ProcXkbGetIndicatorMap(client);
- case X_kbSetIndicatorMap:
- return ProcXkbSetIndicatorMap(client);
- case X_kbGetNamedIndicator:
- return ProcXkbGetNamedIndicator(client);
- case X_kbSetNamedIndicator:
- return ProcXkbSetNamedIndicator(client);
- case X_kbGetNames:
- return ProcXkbGetNames(client);
- case X_kbSetNames:
- return ProcXkbSetNames(client);
- case X_kbGetGeometry:
- return ProcXkbGetGeometry(client);
- case X_kbSetGeometry:
- return ProcXkbSetGeometry(client);
- case X_kbPerClientFlags:
- return ProcXkbPerClientFlags(client);
- case X_kbListComponents:
- return ProcXkbListComponents(client);
- case X_kbGetKbdByName:
- return ProcXkbGetKbdByName(client);
- case X_kbGetDeviceInfo:
- return ProcXkbGetDeviceInfo(client);
- case X_kbSetDeviceInfo:
- return ProcXkbSetDeviceInfo(client);
- case X_kbSetDebuggingFlags:
- return ProcXkbSetDebuggingFlags(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-XkbClientGone(pointer data,XID id)
-{
- DevicePtr pXDev = (DevicePtr)data;
-
- if (!XkbRemoveResourceClient(pXDev,id)) {
- ErrorF("Internal Error! bad RemoveResourceClient in XkbClientGone\n");
- }
- return 1;
-}
-
-/*ARGSUSED*/
-static void
-XkbResetProc(ExtensionEntry *extEntry)
-{
-}
-
-void
-XkbExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors,
- ProcXkbDispatch, SProcXkbDispatch,
- XkbResetProc, StandardMinorOpcode))) {
- XkbReqCode = (unsigned char)extEntry->base;
- XkbEventBase = (unsigned char)extEntry->eventBase;
- XkbErrorBase = (unsigned char)extEntry->errorBase;
- XkbKeyboardErrorCode = XkbErrorBase+XkbKeyboard;
- RT_XKBCLIENT = CreateNewResourceType(XkbClientGone);
- }
- return;
-}
-
-
diff --git a/xkb/xkb.h b/xkb/xkb.h
deleted file mode 100644
index 4eeb781db..000000000
--- a/xkb/xkb.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $XFree86: xc/programs/Xserver/xkb/xkb.h,v 1.1 2003/07/16 01:39:08 dawes Exp $ */
-
-/* #include "XKBfile.h" */
-
-extern int ProcXkbUseExtension(ClientPtr client);
-extern int ProcXkbSelectEvents(ClientPtr client);
-extern int ProcXkbBell(ClientPtr client);
-extern int ProcXkbGetState(ClientPtr client);
-extern int ProcXkbLatchLockState(ClientPtr client);
-extern int ProcXkbGetControls(ClientPtr client);
-extern int ProcXkbSetControls(ClientPtr client);
-extern int ProcXkbGetMap(ClientPtr client);
-extern int ProcXkbSetMap(ClientPtr client);
-extern int ProcXkbGetCompatMap(ClientPtr client);
-extern int ProcXkbSetCompatMap(ClientPtr client);
-extern int ProcXkbGetIndicatorState(ClientPtr client);
-extern int ProcXkbGetIndicatorMap(ClientPtr client);
-extern int ProcXkbSetIndicatorMap(ClientPtr client);
-extern int ProcXkbGetNamedIndicator(ClientPtr client);
-extern int ProcXkbSetNamedIndicator(ClientPtr client);
-extern int ProcXkbGetNames(ClientPtr client);
-extern int ProcXkbSetNames(ClientPtr client);
-extern int ProcXkbGetGeometry(ClientPtr client);
-extern int ProcXkbSetGeometry(ClientPtr client);
-extern int ProcXkbPerClientFlags(ClientPtr client);
-extern int ProcXkbListComponents(ClientPtr client);
-extern int ProcXkbGetKbdByName(ClientPtr client);
-extern int ProcXkbGetDeviceInfo(ClientPtr client);
-extern int ProcXkbSetDeviceInfo(ClientPtr client);
-extern int ProcXkbSetDebuggingFlags(ClientPtr client);
-
-extern int XkbSetRepeatRate(DeviceIntPtr dev, int timeout, int interval, int major, int minor);
-extern int XkbGetRepeatRate(DeviceIntPtr dev, int *timeout, int *interval);
-
-extern Status XkbComputeGetIndicatorMapReplySize(
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply *rep);
-extern int XkbSendIndicatorMap(
- ClientPtr client,
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply *rep);
-
-extern void XkbComputeCompatState(XkbSrvInfoPtr xkbi);
-extern void XkbSetPhysicalLockingKey(DeviceIntPtr dev, unsigned key);
-
-extern Bool XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE);
-
-extern Bool XkbApplyLEDChangeToKeyboard(
- XkbSrvInfoPtr xkbi,
- XkbIndicatorMapPtr map,
- Bool on,
- XkbChangesPtr change);
-
-extern Bool XkbWriteRulesProp(ClientPtr client, pointer closure);
-
-extern XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button);
-
-/* extern Status XkbMergeFile(XkbDescPtr xkb, XkbFileInfo finfo); */
-
-extern Bool XkbDDXCompileNamedKeymap(
- XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- char * nameRtrn,
- int nameRtrnLen);
-
-extern Bool XkbDDXCompileKeymapByNames(
- XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- char * nameRtrn,
- int nameRtrnLen);
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
deleted file mode 100644
index 096ebe2e4..000000000
--- a/xkb/xkbAccessX.c
+++ /dev/null
@@ -1,750 +0,0 @@
-/* $Xorg: xkbAccessX.c,v 1.4 2001/02/05 18:50:20 coskrey Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbAccessX.c,v 1.10 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <math.h>
-#ifdef __QNX__
-#include <limits.h>
-#endif
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "XKBsrv.h"
-#if !defined(WIN32) && !defined(Lynx)
-#include <sys/time.h>
-#endif
-
-int XkbDfltRepeatDelay= 660;
-int XkbDfltRepeatInterval= 40;
-pointer XkbLastRepeatEvent= NULL;
-
-#define DFLT_TIMEOUT_CTRLS (XkbAX_KRGMask|XkbStickyKeysMask|XkbMouseKeysMask)
-#define DFLT_TIMEOUT_OPTS (XkbAX_IndicatorFBMask)
-
-unsigned short XkbDfltAccessXTimeout= 120;
-unsigned int XkbDfltAccessXTimeoutMask= DFLT_TIMEOUT_CTRLS;
-unsigned int XkbDfltAccessXTimeoutValues= 0;
-unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
-unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
-unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask;
-unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask);
-
-void
-AccessXComputeCurveFactor(XkbSrvInfoPtr xkbi,XkbControlsPtr ctrls)
-{
- xkbi->mouseKeysCurve= 1.0+(((double)ctrls->mk_curve)*0.001);
- xkbi->mouseKeysCurveFactor= ( ((double)ctrls->mk_max_speed)/
- pow((double)ctrls->mk_time_to_max,xkbi->mouseKeysCurve));
- return;
-}
-
-void
-AccessXInit(DeviceIntPtr keybd)
-{
-XkbSrvInfoPtr xkbi = keybd->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-
- xkbi->shiftKeyCount= 0;
- xkbi->mouseKeysCounter= 0;
- xkbi->inactiveKey= 0;
- xkbi->slowKey= 0;
- xkbi->repeatKey= 0;
- xkbi->krgTimerActive= _OFF_TIMER;
- xkbi->beepType= _BEEP_NONE;
- xkbi->beepCount= 0;
- xkbi->mouseKeyTimer= NULL;
- xkbi->slowKeysTimer= NULL;
- xkbi->bounceKeysTimer= NULL;
- xkbi->repeatKeyTimer= NULL;
- xkbi->krgTimer= NULL;
- xkbi->beepTimer= NULL;
- ctrls->repeat_delay = XkbDfltRepeatDelay;
- ctrls->repeat_interval = XkbDfltRepeatInterval;
- ctrls->debounce_delay = 300;
- ctrls->slow_keys_delay = 300;
- ctrls->mk_delay = 160;
- ctrls->mk_interval = 40;
- ctrls->mk_time_to_max = 30;
- ctrls->mk_max_speed = 30;
- ctrls->mk_curve = 500;
- ctrls->mk_dflt_btn = 1;
- ctrls->ax_timeout = XkbDfltAccessXTimeout;
- ctrls->axt_ctrls_mask = XkbDfltAccessXTimeoutMask;
- ctrls->axt_ctrls_values = XkbDfltAccessXTimeoutValues;
- ctrls->axt_opts_mask = XkbDfltAccessXTimeoutOptionsMask;
- ctrls->axt_opts_values = XkbDfltAccessXTimeoutOptionsValues;
- if (XkbDfltAccessXTimeout)
- ctrls->enabled_ctrls |= XkbAccessXTimeoutMask;
- else
- ctrls->enabled_ctrls &= ~XkbAccessXTimeoutMask;
- ctrls->enabled_ctrls |= XkbDfltAccessXFeedback;
- ctrls->ax_options = XkbDfltAccessXOptions;
- AccessXComputeCurveFactor(xkbi,ctrls);
- return;
-}
-
-/************************************************************************/
-/* */
-/* AccessXKeyboardEvent */
-/* */
-/* Generate a synthetic keyboard event. */
-/* */
-/************************************************************************/
-static void
-AccessXKeyboardEvent(DeviceIntPtr keybd,
- BYTE type,
- BYTE keyCode,
- Bool isRepeat)
-{
-xEvent xE;
-
- xE.u.u.type = type;
- xE.u.u.detail = keyCode;
- xE.u.keyButtonPointer.time = GetTimeInMillis();
-#ifdef DEBUG
- if (xkbDebugFlags&0x8) {
- ErrorF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
- }
-#endif
-
- if (_XkbIsPressEvent(type))
- XkbDDXKeyClick(keybd,keyCode,TRUE);
- else if (isRepeat)
- XkbLastRepeatEvent= (pointer)&xE;
- XkbProcessKeyboardEvent(&xE,keybd,1L);
- XkbLastRepeatEvent= NULL;
- return;
-
-} /* AccessXKeyboardEvent */
-
-/************************************************************************/
-/* */
-/* AccessXKRGTurnOn */
-/* */
-/* Turn the keyboard response group on. */
-/* */
-/************************************************************************/
-static void
-AccessXKRGTurnOn(DeviceIntPtr dev,CARD16 KRGControl,xkbControlsNotify *pCN)
-{
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-XkbControlsRec old;
-XkbEventCauseRec cause;
-XkbSrvLedInfoPtr sli;
-
- old= *ctrls;
- ctrls->enabled_ctrls |= (KRGControl&XkbAX_KRGMask);
- if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False))
- XkbSendControlsNotify(dev,pCN);
- cause.kc= pCN->keycode;
- cause.event= pCN->eventType;
- cause.mjr= pCN->requestMajor;
- cause.mnr= pCN->requestMinor;
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
- XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,KRGControl);
- return;
-
-} /* AccessXKRGTurnOn */
-
-/************************************************************************/
-/* */
-/* AccessXKRGTurnOff */
-/* */
-/* Turn the keyboard response group off. */
-/* */
-/************************************************************************/
-static void
-AccessXKRGTurnOff(DeviceIntPtr dev,xkbControlsNotify *pCN)
-{
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-XkbControlsRec old;
-XkbEventCauseRec cause;
-XkbSrvLedInfoPtr sli;
-
- old = *ctrls;
- ctrls->enabled_ctrls &= ~XkbAX_KRGMask;
- if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False))
- XkbSendControlsNotify(dev,pCN);
- cause.kc= pCN->keycode;
- cause.event= pCN->eventType;
- cause.mjr= pCN->requestMajor;
- cause.mnr= pCN->requestMinor;
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
- unsigned changes= old.enabled_ctrls^ctrls->enabled_ctrls;
- XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,changes);
- }
- return;
-
-} /* AccessXKRGTurnOff */
-
-/************************************************************************/
-/* */
-/* AccessXStickyKeysTurnOn */
-/* */
-/* Turn StickyKeys on. */
-/* */
-/************************************************************************/
-static void
-AccessXStickyKeysTurnOn(DeviceIntPtr dev,xkbControlsNotify *pCN)
-{
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-XkbControlsRec old;
-XkbEventCauseRec cause;
-XkbSrvLedInfoPtr sli;
-
- old = *ctrls;
- ctrls->enabled_ctrls |= XkbStickyKeysMask;
- xkbi->shiftKeyCount = 0;
- if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False))
- XkbSendControlsNotify(dev,pCN);
- cause.kc= pCN->keycode;
- cause.event= pCN->eventType;
- cause.mjr= pCN->requestMajor;
- cause.mnr= pCN->requestMinor;
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
- XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,XkbStickyKeysMask);
- }
- return;
-
-} /* AccessXStickyKeysTurnOn */
-
-/************************************************************************/
-/* */
-/* AccessXStickyKeysTurnOff */
-/* */
-/* Turn StickyKeys off. */
-/* */
-/************************************************************************/
-static void
-AccessXStickyKeysTurnOff(DeviceIntPtr dev,xkbControlsNotify *pCN)
-{
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-XkbControlsRec old;
-XkbEventCauseRec cause;
-XkbSrvLedInfoPtr sli;
-
- old = *ctrls;
- ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
- xkbi->shiftKeyCount = 0;
- if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False))
- XkbSendControlsNotify(dev,pCN);
-
- cause.kc= pCN->keycode;
- cause.event= pCN->eventType;
- cause.mjr= pCN->requestMajor;
- cause.mnr= pCN->requestMinor;
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
- XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,XkbStickyKeysMask);
- }
-#ifndef NO_CLEAR_LATCHES_FOR_STICKY_KEYS_OFF
- XkbClearAllLatchesAndLocks(dev,xkbi,False,&cause);
-#endif
- return;
-} /* AccessXStickyKeysTurnOff */
-
-static CARD32
-AccessXKRGExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo;
-xkbControlsNotify cn;
-
- if (xkbi->krgTimerActive==_KRG_WARN_TIMER) {
- XkbDDXAccessXBeep((DeviceIntPtr)arg,_BEEP_SLOW_WARN,XkbStickyKeysMask);
- xkbi->krgTimerActive= _KRG_TIMER;
- return 4000;
- }
- xkbi->krgTimerActive= _OFF_TIMER;
- cn.keycode = 0;
- cn.eventType = 0;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- if (xkbi->desc->ctrls->enabled_ctrls&XkbSlowKeysMask)
- AccessXKRGTurnOff((DeviceIntPtr)arg,&cn);
- else AccessXKRGTurnOn((DeviceIntPtr)arg,XkbSlowKeysMask,&cn);
- return 0;
-}
-
-static CARD32
-AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo;
-KeyCode key;
-
- if (xkbi->repeatKey==0)
- return 0;
- key= xkbi->repeatKey;
- AccessXKeyboardEvent((DeviceIntPtr)arg,KeyRelease,key,True);
- AccessXKeyboardEvent((DeviceIntPtr)arg,KeyPress,key,True);
- return xkbi->desc->ctrls->repeat_interval;
-}
-
-void
-AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi,KeyCode key)
-{
- if (xkbi->repeatKey==key)
- xkbi->repeatKey= 0;
- return;
-}
-
-static CARD32
-AccessXSlowKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-DeviceIntPtr keybd;
-XkbSrvInfoPtr xkbi;
-XkbDescPtr xkb;
-XkbControlsPtr ctrls;
-
- keybd= (DeviceIntPtr)arg;
- xkbi= keybd->key->xkbInfo;
- xkb= xkbi->desc;
- ctrls= xkb->ctrls;
- if (xkbi->slowKey!=0) {
- xkbAccessXNotify ev;
- KeySym *sym= XkbKeySymsPtr(xkb,xkbi->slowKey);
- ev.detail= XkbAXN_SKAccept;
- ev.keycode= xkbi->slowKey;
- ev.slowKeysDelay= ctrls->slow_keys_delay;
- ev.debounceDelay= ctrls->debounce_delay;
- XkbSendAccessXNotify(keybd,&ev);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask))
- XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask);
- AccessXKeyboardEvent(keybd,KeyPress,xkbi->slowKey,False);
- /* check for magic sequences */
- if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) &&
- ((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L)))
- xkbi->shiftKeyCount++;
-
- /* Start repeating if necessary. Stop autorepeating if the user
- * presses a non-modifier key that doesn't autorepeat.
- */
- if (keybd->kbdfeed->ctrl.autoRepeat &&
- ((xkbi->slowKey != xkbi->mouseKey) || (!xkbi->mouseKeysAccel)) &&
- (ctrls->enabled_ctrls&XkbRepeatKeysMask)) {
-#ifndef AIXV3
- if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,xkbi->slowKey))
-#endif
- {
- xkbi->repeatKey = xkbi->slowKey;
- xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
- 0, ctrls->repeat_delay,
- AccessXRepeatKeyExpire, (pointer)keybd);
- }
- }
- }
- return 0;
-}
-
-static CARD32
-AccessXBounceKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo;
-
- xkbi->inactiveKey= 0;
- return 0;
-}
-
-static CARD32
-AccessXTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-DeviceIntPtr dev = (DeviceIntPtr)arg;
-XkbSrvInfoPtr xkbi= dev->key->xkbInfo;
-XkbControlsPtr ctrls= xkbi->desc->ctrls;
-XkbControlsRec old;
-xkbControlsNotify cn;
-XkbEventCauseRec cause;
-XkbSrvLedInfoPtr sli;
-
- if (xkbi->lastPtrEventTime) {
- unsigned timeToWait = (ctrls->ax_timeout*1000);
- unsigned timeElapsed = (now-xkbi->lastPtrEventTime);
-
- if (timeToWait > timeElapsed)
- return (timeToWait - timeElapsed);
- }
- old= *ctrls;
- xkbi->shiftKeyCount= 0;
- ctrls->enabled_ctrls&= ~ctrls->axt_ctrls_mask;
- ctrls->enabled_ctrls|=
- (ctrls->axt_ctrls_values&ctrls->axt_ctrls_mask);
- if (ctrls->axt_opts_mask) {
- ctrls->ax_options&= ~ctrls->axt_opts_mask;
- ctrls->ax_options|= (ctrls->axt_opts_values&ctrls->axt_opts_mask);
- }
- if (XkbComputeControlsNotify(dev,&old,ctrls,&cn,False)) {
- cn.keycode = 0;
- cn.eventType = 0;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- XkbSendControlsNotify(dev,&cn);
- }
- XkbSetCauseUnknown(&cause);
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause);
- if (ctrls->ax_options!=old.ax_options) {
- unsigned set,cleared,bell;
- set= ctrls->ax_options&(~old.ax_options);
- cleared= (~ctrls->ax_options)&old.ax_options;
- if (set && cleared) bell= _BEEP_FEATURE_CHANGE;
- else if (set) bell= _BEEP_FEATURE_ON;
- else bell= _BEEP_FEATURE_OFF;
- XkbDDXAccessXBeep(dev,bell,XkbAccessXTimeoutMask);
- }
- xkbi->krgTimerActive= _OFF_TIMER;
- return 0;
-}
-
-
-/************************************************************************/
-/* */
-/* AccessXFilterPressEvent */
-/* */
-/* Filter events before they get any further if SlowKeys is turned on. */
-/* In addition, this routine handles the ever so popular magic key */
-/* acts for turning various accessibility features on/off. */
-/* */
-/* Returns TRUE if this routine has discarded the event. */
-/* Returns FALSE if the event needs further processing. */
-/* */
-/************************************************************************/
-Bool
-AccessXFilterPressEvent( register xEvent * xE,
- register DeviceIntPtr keybd,
- int count)
-{
-XkbSrvInfoPtr xkbi = keybd->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-Bool ignoreKeyEvent = FALSE;
-KeyCode key = xE->u.u.detail;
-KeySym * sym = XkbKeySymsPtr(xkbi->desc,key);
-
- if (ctrls->enabled_ctrls&XkbAccessXKeysMask) {
- /* check for magic sequences */
- if ((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L)) {
- if (XkbAX_NeedFeedback(ctrls,XkbAX_SlowWarnFBMask)) {
- xkbi->krgTimerActive = _KRG_WARN_TIMER;
- xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, 4000,
- AccessXKRGExpire, (pointer)keybd);
- }
- else {
- xkbi->krgTimerActive = _KRG_TIMER;
- xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, 8000,
- AccessXKRGExpire, (pointer)keybd);
- }
- if (!(ctrls->enabled_ctrls & XkbSlowKeysMask)) {
- CARD32 now= GetTimeInMillis();
- if ((now-xkbi->lastShiftEventTime)>15000)
- xkbi->shiftKeyCount= 1;
- else xkbi->shiftKeyCount++;
- xkbi->lastShiftEventTime= now;
- }
- }
- else {
- if (xkbi->krgTimerActive) {
- xkbi->krgTimer= TimerSet(xkbi->krgTimer,0, 0, NULL, NULL);
- xkbi->krgTimerActive= _OFF_TIMER;
- }
- }
- }
-
- /* Don't transmit the KeyPress if SlowKeys is turned on;
- * The wakeup handler will synthesize one for us if the user
- * has held the key long enough.
- */
- if (ctrls->enabled_ctrls & XkbSlowKeysMask) {
- xkbAccessXNotify ev;
- /* If key was already pressed, ignore subsequent press events
- * from the server's autorepeat
- */
- if(xkbi->slowKey == key)
- return TRUE;
- ev.detail= XkbAXN_SKPress;
- ev.keycode= key;
- ev.slowKeysDelay= ctrls->slow_keys_delay;
- ev.debounceDelay= ctrls->debounce_delay;
- XkbSendAccessXNotify(keybd,&ev);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_SKPressFBMask))
- XkbDDXAccessXBeep(keybd,_BEEP_SLOW_PRESS,XkbSlowKeysMask);
- xkbi->slowKey= key;
- xkbi->slowKeysTimer = TimerSet(xkbi->slowKeysTimer,
- 0, ctrls->slow_keys_delay,
- AccessXSlowKeyExpire, (pointer)keybd);
- ignoreKeyEvent = TRUE;
- }
-
- /* Don't transmit the KeyPress if BounceKeys is turned on
- * and the user pressed the same key within a given time period
- * from the last release.
- */
- else if ((ctrls->enabled_ctrls & XkbBounceKeysMask) &&
- (key == xkbi->inactiveKey)) {
- if (XkbAX_NeedFeedback(ctrls,XkbAX_BKRejectFBMask))
- XkbDDXAccessXBeep(keybd,_BEEP_BOUNCE_REJECT,XkbBounceKeysMask);
- ignoreKeyEvent = TRUE;
- }
-
- /* Start repeating if necessary. Stop autorepeating if the user
- * presses a non-modifier key that doesn't autorepeat.
- */
- if (XkbDDXUsesSoftRepeat(keybd)) {
- if ((keybd->kbdfeed->ctrl.autoRepeat) &&
- ((ctrls->enabled_ctrls&(XkbSlowKeysMask|XkbRepeatKeysMask))==
- XkbRepeatKeysMask)) {
-#ifndef AIXV3
- if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key))
-#endif
- {
-#ifdef DEBUG
- if (xkbDebugFlags&0x10)
- ErrorF("Starting software autorepeat...\n");
-#endif
- xkbi->repeatKey = key;
- xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
- 0, ctrls->repeat_delay,
- AccessXRepeatKeyExpire, (pointer)keybd);
- }
- }
- }
-
- /* Check for two keys being pressed at the same time. This section
- * essentially says the following:
- *
- * If StickyKeys is on, and a modifier is currently being held down,
- * and one of the following is true: the current key is not a modifier
- * or the currentKey is a modifier, but not the only modifier being
- * held down, turn StickyKeys off if the TwoKeys off ctrl is set.
- */
- if ((ctrls->enabled_ctrls & XkbStickyKeysMask) &&
- (xkbi->state.base_mods!=0) &&
- (XkbAX_NeedOption(ctrls,XkbAX_TwoKeysMask))) {
- xkbControlsNotify cn;
- cn.keycode = key;
- cn.eventType = KeyPress;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- AccessXStickyKeysTurnOff(keybd,&cn);
- }
-
- if (!ignoreKeyEvent)
- XkbProcessKeyboardEvent(xE,keybd,count);
- return ignoreKeyEvent;
-} /* AccessXFilterPressEvent */
-
-/************************************************************************/
-/* */
-/* AccessXFilterReleaseEvent */
-/* */
-/* Filter events before they get any further if SlowKeys is turned on. */
-/* In addition, this routine handles the ever so popular magic key */
-/* acts for turning various accessibility features on/off. */
-/* */
-/* Returns TRUE if this routine has discarded the event. */
-/* Returns FALSE if the event needs further processing. */
-/* */
-/************************************************************************/
-Bool
-AccessXFilterReleaseEvent( register xEvent * xE,
- register DeviceIntPtr keybd,
- int count)
-{
-XkbSrvInfoPtr xkbi = keybd->key->xkbInfo;
-XkbControlsPtr ctrls = xkbi->desc->ctrls;
-KeyCode key = xE->u.u.detail;
-Bool ignoreKeyEvent = FALSE;
-
- /* Don't transmit the KeyRelease if BounceKeys is on and
- * this is the release of a key that was ignored due to
- * BounceKeys.
- */
- if (ctrls->enabled_ctrls & XkbBounceKeysMask) {
- if ((key!=xkbi->mouseKey)&&(!BitIsOn(keybd->key->down,key)))
- ignoreKeyEvent = TRUE;
- xkbi->inactiveKey= key;
- xkbi->bounceKeysTimer= TimerSet(xkbi->bounceKeysTimer, 0,
- ctrls->debounce_delay,
- AccessXBounceKeyExpire, (pointer)keybd);
- }
-
- /* Don't transmit the KeyRelease if SlowKeys is turned on and
- * the user didn't hold the key long enough. We know we passed
- * the key if the down bit was set by CoreProcessKeyboadEvent.
- */
- if (ctrls->enabled_ctrls & XkbSlowKeysMask) {
- xkbAccessXNotify ev;
- unsigned beep_type;
- ev.keycode= key;
- ev.slowKeysDelay= ctrls->slow_keys_delay;
- ev.debounceDelay= ctrls->debounce_delay;
- if (BitIsOn(keybd->key->down,key) | (xkbi->mouseKey == key)) {
- ev.detail= XkbAXN_SKRelease;
- beep_type= _BEEP_SLOW_RELEASE;
- }
- else {
- ev.detail= XkbAXN_SKReject;
- beep_type= _BEEP_SLOW_REJECT;
- ignoreKeyEvent = TRUE;
- }
- XkbSendAccessXNotify(keybd,&ev);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_SKRejectFBMask)) {
- XkbDDXAccessXBeep(keybd,beep_type,XkbSlowKeysMask);
- }
- if (xkbi->slowKey==key)
- xkbi->slowKey= 0;
- }
-
- /* Stop Repeating if the user releases the key that is currently
- * repeating.
- */
- if (xkbi->repeatKey==key) {
- xkbi->repeatKey= 0;
- }
-
- if ((ctrls->enabled_ctrls&XkbAccessXTimeoutMask)&&(ctrls->ax_timeout>0)) {
- xkbi->lastPtrEventTime= 0;
- xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0,
- ctrls->ax_timeout*1000,
- AccessXTimeoutExpire, (pointer)keybd);
- xkbi->krgTimerActive= _ALL_TIMEOUT_TIMER;
- }
- else if (xkbi->krgTimerActive!=_OFF_TIMER) {
- xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, 0, NULL, NULL);
- xkbi->krgTimerActive= _OFF_TIMER;
- }
-
- /* Keep track of how many times the Shift key has been pressed.
- * If it has been pressed and released 5 times in a row, toggle
- * the state of StickyKeys.
- */
- if ((!ignoreKeyEvent)&&(xkbi->shiftKeyCount)) {
- KeySym *pSym= XkbKeySymsPtr(xkbi->desc,key);
- if ((pSym[0]!=XK_Shift_L)&&(pSym[0]!=XK_Shift_R)) {
- xkbi->shiftKeyCount= 0;
- }
- else if (xkbi->shiftKeyCount>=5) {
- xkbControlsNotify cn;
- cn.keycode = key;
- cn.eventType = KeyPress;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- if (ctrls->enabled_ctrls & XkbStickyKeysMask)
- AccessXStickyKeysTurnOff(keybd,&cn);
- else
- AccessXStickyKeysTurnOn(keybd,&cn);
- xkbi->shiftKeyCount= 0;
- }
- }
-
- if (!ignoreKeyEvent)
- XkbProcessKeyboardEvent(xE,keybd,count);
- return ignoreKeyEvent;
-
-} /* AccessXFilterReleaseEvent */
-
-/************************************************************************/
-/* */
-/* ProcessPointerEvent */
-/* */
-/* This routine merely sets the shiftKeyCount and clears the keyboard */
-/* response group timer (if necessary) on a mouse event. This is so */
-/* multiple shifts with just the mouse and shift-drags with the mouse */
-/* don't accidentally turn on StickyKeys or the Keyboard Response Group.*/
-/* */
-/************************************************************************/
-void
-ProcessPointerEvent( register xEvent * xE,
- register DeviceIntPtr mouse,
- int count)
-{
-DeviceIntPtr dev = (DeviceIntPtr)LookupKeyboardDevice();
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-unsigned changed = 0;
-
- xkbi->shiftKeyCount = 0;
- xkbi->lastPtrEventTime= xE->u.keyButtonPointer.time;
-
- if (xE->u.u.type==ButtonPress) {
- changed |= XkbPointerButtonMask;
- }
- else if (xE->u.u.type==ButtonRelease) {
- xkbi->lockedPtrButtons&= ~(1<<(xE->u.u.detail&0x7));
- changed |= XkbPointerButtonMask;
- }
- CoreProcessPointerEvent(xE,mouse,count);
-
- xkbi->state.ptr_buttons = mouse->button->state;
-
- /* clear any latched modifiers */
- if ( xkbi->state.latched_mods && (xE->u.u.type==ButtonRelease) ) {
- unsigned changed_leds;
- XkbStateRec oldState;
- XkbSrvLedInfoPtr sli;
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- oldState= xkbi->state;
- XkbLatchModifiers(dev,0xFF,0x00);
-
- XkbComputeDerivedState(xkbi);
- changed |= XkbStateChangedFlags(&oldState,&xkbi->state);
- if (changed&sli->usedComponents) {
- changed_leds= XkbIndicatorsToUpdate(dev,changed,False);
- if (changed_leds) {
- XkbEventCauseRec cause;
- XkbSetCauseKey(&cause,(xE->u.u.detail&0x7),xE->u.u.type);
- XkbUpdateIndicators(dev,changed_leds,True,NULL,&cause);
- }
- }
- dev->key->state= XkbStateFieldFromRec(&xkbi->state);
- }
-
- if (((xkbi->flags&_XkbStateNotifyInProgress)==0)&&(changed!=0)) {
- xkbStateNotify sn;
- sn.keycode= xE->u.u.detail;
- sn.eventType= xE->u.u.type;
- sn.requestMajor = sn.requestMinor = 0;
- sn.changed= changed;
- XkbSendStateNotify(dev,&sn);
- }
-
-} /* ProcessPointerEvent */
-
-
-
-
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
deleted file mode 100644
index 403c2fb89..000000000
--- a/xkb/xkbActions.c
+++ /dev/null
@@ -1,1373 +0,0 @@
-/* $Xorg: xkbActions.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbActions.c,v 3.14 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-#include "xkb.h"
-#include <ctype.h>
-
-#ifdef XINPUT
-extern void ProcessOtherEvent(
- xEvent * /* xE */,
- DeviceIntPtr /* dev */,
- int /* count */
-);
-#endif
-
-/***====================================================================***/
-
-static XkbAction
-_FixUpAction(XkbDescPtr xkb,XkbAction *act)
-{
-static XkbAction fake;
-
- if (XkbIsPtrAction(act)&&(!(xkb->ctrls->enabled_ctrls&XkbMouseKeysMask))) {
- fake.type = XkbSA_NoAction;
- return fake;
- }
- if (XkbDisableLockActions) {
- switch (act->type) {
- case XkbSA_LockMods:
- fake.mods.type = XkbSA_SetMods;
- fake.mods.flags = 0;
- fake.mods.mask = act->mods.mask;
- return fake;
- case XkbSA_LatchMods:
- fake.mods.type = XkbSA_SetMods;
- fake.mods.flags = 0;
- fake.mods.mask = act->mods.mask;
- return fake;
- case XkbSA_ISOLock:
- if (act->iso.flags&XkbSA_ISODfltIsGroup) {
- fake.group.type = XkbSA_SetGroup;
- fake.group.flags = act->iso.flags&XkbSA_GroupAbsolute;
- XkbSASetGroup(&fake.group,XkbSAGroup(&act->iso));
- }
- else {
- fake.mods.type = XkbSA_SetMods;
- fake.mods.flags = 0;
- fake.mods.mask = act->iso.mask;
- }
- return fake;
- case XkbSA_LockGroup:
- case XkbSA_LatchGroup:
- /* We want everything from the latch/lock action except the
- * type should be changed to set.
- */
- fake = *act;
- fake.group.type = XkbSA_SetGroup;
- return fake;
- }
- }
- else
- if (xkb->ctrls->enabled_ctrls&XkbStickyKeysMask) {
- if (act->any.type==XkbSA_SetMods) {
- fake.mods.type = XkbSA_LatchMods;
- fake.mods.mask = act->mods.mask;
- if (XkbAX_NeedOption(xkb->ctrls,XkbAX_LatchToLockMask))
- fake.mods.flags= XkbSA_ClearLocks|XkbSA_LatchToLock;
- else fake.mods.flags= XkbSA_ClearLocks;
- return fake;
- }
- if (act->any.type==XkbSA_SetGroup) {
- fake.group.type = XkbSA_LatchGroup;
- if (XkbAX_NeedOption(xkb->ctrls,XkbAX_LatchToLockMask))
- fake.group.flags= XkbSA_ClearLocks|XkbSA_LatchToLock;
- else fake.group.flags= XkbSA_ClearLocks;
- XkbSASetGroup(&fake.group,XkbSAGroup(&act->group));
- return fake;
- }
- }
- return *act;
-}
-
-static XkbAction
-XkbGetKeyAction(XkbSrvInfoPtr xkbi,XkbStatePtr xkbState,CARD8 key)
-{
-int effectiveGroup;
-int col;
-XkbDescPtr xkb;
-XkbKeyTypePtr type;
-XkbAction * pActs;
-static XkbAction fake;
-
- xkb= xkbi->desc;
- if (!XkbKeyHasActions(xkb,key) || !XkbKeycodeInRange(xkb,key)) {
- fake.type = XkbSA_NoAction;
- return fake;
- }
- pActs= XkbKeyActionsPtr(xkb,key);
- col= 0;
- effectiveGroup= xkbState->group;
- if (effectiveGroup!=XkbGroup1Index) {
- if (XkbKeyNumGroups(xkb,key)>(unsigned)1) {
- if (effectiveGroup>=XkbKeyNumGroups(xkb,key)) {
- unsigned gi= XkbKeyGroupInfo(xkb,key);
- switch (XkbOutOfRangeGroupAction(gi)) {
- default:
- case XkbWrapIntoRange:
- effectiveGroup %= XkbKeyNumGroups(xkb,key);
- break;
- case XkbClampIntoRange:
- effectiveGroup = XkbKeyNumGroups(xkb,key)-1;
- break;
- case XkbRedirectIntoRange:
- effectiveGroup= XkbOutOfRangeGroupInfo(gi);
- if (effectiveGroup>=XkbKeyNumGroups(xkb,key))
- effectiveGroup= 0;
- break;
- }
- }
- }
- else effectiveGroup= XkbGroup1Index;
- col+= (effectiveGroup*XkbKeyGroupsWidth(xkb,key));
- }
- type= XkbKeyKeyType(xkb,key,effectiveGroup);
- if (type->map!=NULL) {
- register unsigned i,mods;
- register XkbKTMapEntryPtr entry;
- mods= xkbState->mods&type->mods.mask;
- for (entry= type->map,i=0;i<type->map_count;i++,entry++) {
- if ((entry->active)&&(entry->mods.mask==mods)) {
- col+= entry->level;
- break;
- }
- }
- }
- if (pActs[col].any.type==XkbSA_NoAction)
- return pActs[col];
- fake= _FixUpAction(xkb,&pActs[col]);
- return fake;
-}
-
-XkbAction
-XkbGetButtonAction(DeviceIntPtr kbd,DeviceIntPtr dev,int button)
-{
-XkbAction fake;
- if ((dev->button)&&(dev->button->xkb_acts)) {
- if (dev->button->xkb_acts[button-1].any.type!=XkbSA_NoAction) {
- fake= _FixUpAction(kbd->key->xkbInfo->desc,
- &dev->button->xkb_acts[button-1]);
- return fake;
- }
- }
- fake.any.type= XkbSA_NoAction;
- return fake;
-}
-
-/***====================================================================***/
-
-#define SYNTHETIC_KEYCODE 1
-#define BTN_ACT_FLAG 0x100
-
-typedef struct _XkbFilter {
- CARD16 keycode;
- CARD8 what;
- CARD8 active;
- CARD8 filterOthers;
- CARD32 priv;
- XkbAction upAction;
- int (*filter)(
- XkbSrvInfoPtr /* xkbi */,
- struct _XkbFilter * /* filter */,
- unsigned /* keycode */,
- XkbAction * /* action */
- );
- struct _XkbFilter *next;
-} XkbFilterRec,*XkbFilterPtr;
-
-static int
-_XkbFilterSetState( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction *pAction)
-{
- if (filter->keycode==0) { /* initial press */
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = ((pAction->mods.mask&XkbSA_ClearLocks)!=0);
- filter->priv = 0;
- filter->filter = _XkbFilterSetState;
- if (pAction->type==XkbSA_SetMods) {
- filter->upAction = *pAction;
- xkbi->setMods= pAction->mods.mask;
- }
- else {
- xkbi->groupChange = XkbSAGroup(&pAction->group);
- if (pAction->group.flags&XkbSA_GroupAbsolute)
- xkbi->groupChange-= xkbi->state.base_group;
- filter->upAction= *pAction;
- XkbSASetGroup(&filter->upAction.group,xkbi->groupChange);
- }
- }
- else if (filter->keycode==keycode) {
- if (filter->upAction.type==XkbSA_SetMods) {
- xkbi->clearMods = filter->upAction.mods.mask;
- if (filter->upAction.mods.flags&XkbSA_ClearLocks) {
- xkbi->state.locked_mods&= ~filter->upAction.mods.mask;
- }
- }
- else {
- if (filter->upAction.group.flags&XkbSA_ClearLocks) {
- xkbi->state.locked_group = 0;
- }
- xkbi->groupChange = -XkbSAGroup(&filter->upAction.group);
- }
- filter->active = 0;
- }
- else {
- filter->upAction.mods.flags&= ~XkbSA_ClearLocks;
- filter->filterOthers = 0;
- }
- return 1;
-}
-
-#define LATCH_KEY_DOWN 1
-#define LATCH_PENDING 2
-#define NO_LATCH 3
-
-static int
-_XkbFilterLatchState( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-
- if (filter->keycode==0) { /* initial press */
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 1;
- filter->priv = LATCH_KEY_DOWN;
- filter->filter = _XkbFilterLatchState;
- if (pAction->type==XkbSA_LatchMods) {
- filter->upAction = *pAction;
- xkbi->setMods = pAction->mods.mask;
- }
- else {
- xkbi->groupChange = XkbSAGroup(&pAction->group);
- if (pAction->group.flags&XkbSA_GroupAbsolute)
- xkbi->groupChange-= xkbi->state.base_group;
- filter->upAction= *pAction;
- XkbSASetGroup(&filter->upAction.group,xkbi->groupChange);
- }
- }
- else if ( pAction && (filter->priv==LATCH_PENDING) ) {
- if (((1<<pAction->type)&XkbSA_BreakLatch)!=0) {
- filter->active = 0;
- if (filter->upAction.type==XkbSA_LatchMods)
- xkbi->state.latched_mods&= ~filter->upAction.mods.mask;
- else xkbi->state.latched_group-=XkbSAGroup(&filter->upAction.group);
- }
- else if ((pAction->type==filter->upAction.type)&&
- (pAction->mods.flags==filter->upAction.mods.flags)&&
- (pAction->mods.mask==filter->upAction.mods.mask)) {
- if (filter->upAction.mods.flags&XkbSA_LatchToLock) {
- XkbControlsPtr ctrls= xkbi->desc->ctrls;
- if (filter->upAction.type==XkbSA_LatchMods)
- pAction->mods.type= XkbSA_LockMods;
- else pAction->group.type= XkbSA_LockGroup;
- if (XkbAX_NeedFeedback(ctrls,XkbAX_StickyKeysFBMask)&&
- (ctrls->enabled_ctrls&XkbStickyKeysMask)) {
- XkbDDXAccessXBeep(xkbi->device,_BEEP_STICKY_LOCK,
- XkbStickyKeysMask);
- }
- }
- else {
- if (filter->upAction.type==XkbSA_LatchMods)
- pAction->mods.type= XkbSA_SetMods;
- else pAction->group.type= XkbSA_SetGroup;
- }
- if (filter->upAction.type==XkbSA_LatchMods)
- xkbi->state.latched_mods&= ~filter->upAction.mods.mask;
- else xkbi->state.latched_group-=XkbSAGroup(&filter->upAction.group);
- filter->active = 0;
- }
- }
- else if (filter->keycode==keycode) { /* release */
- XkbControlsPtr ctrls= xkbi->desc->ctrls;
- int needBeep;
- int beepType= _BEEP_NONE;
-
- needBeep= ((ctrls->enabled_ctrls&XkbStickyKeysMask)&&
- XkbAX_NeedFeedback(ctrls,XkbAX_StickyKeysFBMask));
- if (filter->upAction.type==XkbSA_LatchMods) {
- xkbi->clearMods = filter->upAction.mods.mask;
- if ((filter->upAction.mods.flags&XkbSA_ClearLocks)&&
- (xkbi->clearMods&xkbi->state.locked_mods)==xkbi->clearMods) {
- xkbi->state.locked_mods&= ~xkbi->clearMods;
- filter->priv= NO_LATCH;
- beepType= _BEEP_STICKY_UNLOCK;
- }
- }
- else {
- xkbi->groupChange = -XkbSAGroup(&filter->upAction.group);
- if ((filter->upAction.group.flags&XkbSA_ClearLocks)&&
- (xkbi->state.locked_group)) {
- xkbi->state.locked_group = 0;
- filter->priv = NO_LATCH;
- beepType= _BEEP_STICKY_UNLOCK;
- }
- }
- if (filter->priv==NO_LATCH) {
- filter->active= 0;
- }
- else {
- filter->priv= LATCH_PENDING;
- if (filter->upAction.type==XkbSA_LatchMods) {
- xkbi->state.latched_mods |= filter->upAction.mods.mask;
- needBeep = xkbi->state.latched_mods ? needBeep : 0;
- xkbi->state.latched_mods |= filter->upAction.mods.mask;
- }
- else {
- xkbi->state.latched_group+= XkbSAGroup(&filter->upAction.group);
- }
- if (needBeep && (beepType==_BEEP_NONE))
- beepType= _BEEP_STICKY_LATCH;
- }
- if (needBeep && (beepType!=_BEEP_NONE))
- XkbDDXAccessXBeep(xkbi->device,beepType,XkbStickyKeysMask);
- }
- else if (filter->priv==LATCH_KEY_DOWN) {
- filter->priv= NO_LATCH;
- filter->filterOthers = 0;
- }
- return 1;
-}
-
-static int
-_XkbFilterLockState( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-
- if (pAction&&(pAction->type==XkbSA_LockGroup)) {
- if (pAction->group.flags&XkbSA_GroupAbsolute)
- xkbi->state.locked_group= XkbSAGroup(&pAction->group);
- else xkbi->state.locked_group+= XkbSAGroup(&pAction->group);
- return 1;
- }
- if (filter->keycode==0) { /* initial press */
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv = 0;
- filter->filter = _XkbFilterLockState;
- filter->upAction = *pAction;
- xkbi->state.locked_mods^= pAction->mods.mask;
- xkbi->setMods = pAction->mods.mask;
- }
- else if (filter->keycode==keycode) {
- filter->active = 0;
- xkbi->clearMods = filter->upAction.mods.mask;
- }
- return 1;
-}
-
-#define ISO_KEY_DOWN 0
-#define NO_ISO_LOCK 1
-
-static int
-_XkbFilterISOLock( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-
- if (filter->keycode==0) { /* initial press */
- CARD8 flags= pAction->iso.flags;
-
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 1;
- filter->priv = ISO_KEY_DOWN;
- filter->upAction = *pAction;
- filter->filter = _XkbFilterISOLock;
- if (flags&XkbSA_ISODfltIsGroup) {
- xkbi->groupChange = XkbSAGroup(&pAction->iso);
- xkbi->setMods = 0;
- }
- else {
- xkbi->setMods = pAction->iso.mask;
- xkbi->groupChange = 0;
- }
- if ((!(flags&XkbSA_ISONoAffectMods))&&(xkbi->state.base_mods)) {
- filter->priv= NO_ISO_LOCK;
- xkbi->state.locked_mods^= xkbi->state.base_mods;
- }
- if ((!(flags&XkbSA_ISONoAffectGroup))&&(xkbi->state.base_group)) {
-/* 6/22/93 (ef) -- lock groups if group key is down first */
- }
- if (!(flags&XkbSA_ISONoAffectPtr)) {
-/* 6/22/93 (ef) -- lock mouse buttons if they're down */
- }
- }
- else if (filter->keycode==keycode) {
- CARD8 flags= filter->upAction.iso.flags;
-
- if (flags&XkbSA_ISODfltIsGroup) {
- xkbi->groupChange = -XkbSAGroup(&filter->upAction.iso);
- xkbi->clearMods = 0;
- if (filter->priv==ISO_KEY_DOWN)
- xkbi->state.locked_group+= XkbSAGroup(&filter->upAction.iso);
- }
- else {
- xkbi->clearMods= filter->upAction.iso.mask;
- xkbi->groupChange= 0;
- if (filter->priv==ISO_KEY_DOWN)
- xkbi->state.locked_mods^= filter->upAction.iso.mask;
- }
- filter->active = 0;
- }
- else if (pAction) {
- CARD8 flags= filter->upAction.iso.flags;
-
- switch (pAction->type) {
- case XkbSA_SetMods: case XkbSA_LatchMods:
- if (!(flags&XkbSA_ISONoAffectMods)) {
- pAction->type= XkbSA_LockMods;
- filter->priv= NO_ISO_LOCK;
- }
- break;
- case XkbSA_SetGroup: case XkbSA_LatchGroup:
- if (!(flags&XkbSA_ISONoAffectGroup)) {
- pAction->type= XkbSA_LockGroup;
- filter->priv= NO_ISO_LOCK;
- }
- break;
- case XkbSA_PtrBtn:
- if (!(flags&XkbSA_ISONoAffectPtr)) {
- pAction->type= XkbSA_LockPtrBtn;
- filter->priv= NO_ISO_LOCK;
- }
- break;
- case XkbSA_SetControls:
- if (!(flags&XkbSA_ISONoAffectCtrls)) {
- pAction->type= XkbSA_LockControls;
- filter->priv= NO_ISO_LOCK;
- }
- break;
- }
- }
- return 1;
-}
-
-
-static CARD32
-_XkbPtrAccelExpire(OsTimerPtr timer,CARD32 now,pointer arg)
-{
-XkbSrvInfoPtr xkbi= (XkbSrvInfoPtr)arg;
-XkbControlsPtr ctrls= xkbi->desc->ctrls;
-int dx,dy;
-
- if (xkbi->mouseKey==0)
- return 0;
-
- if (xkbi->mouseKeysAccel) {
- if ((xkbi->mouseKeysCounter)<ctrls->mk_time_to_max) {
- double step;
- xkbi->mouseKeysCounter++;
- step= xkbi->mouseKeysCurveFactor*
- pow((double)xkbi->mouseKeysCounter,xkbi->mouseKeysCurve);
- if (xkbi->mouseKeysDX<0)
- dx= floor( ((double)xkbi->mouseKeysDX)*step );
- else dx= ceil( ((double)xkbi->mouseKeysDX)*step );
- if (xkbi->mouseKeysDY<0)
- dy= floor( ((double)xkbi->mouseKeysDY)*step );
- else dy= ceil( ((double)xkbi->mouseKeysDY)*step );
- }
- else {
- dx= xkbi->mouseKeysDX*ctrls->mk_max_speed;
- dy= xkbi->mouseKeysDY*ctrls->mk_max_speed;
- }
- if (xkbi->mouseKeysFlags&XkbSA_MoveAbsoluteX)
- dx= xkbi->mouseKeysDX;
- if (xkbi->mouseKeysFlags&XkbSA_MoveAbsoluteY)
- dy= xkbi->mouseKeysDY;
- }
- else {
- dx= xkbi->mouseKeysDX;
- dy= xkbi->mouseKeysDY;
- }
- XkbDDXFakePointerMotion(xkbi->mouseKeysFlags,dx,dy);
- return xkbi->desc->ctrls->mk_interval;
-}
-
-static int
-_XkbFilterPointerMove( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-int x,y;
-Bool accel;
-
- if (filter->keycode==0) { /* initial press */
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv=0;
- filter->filter = _XkbFilterPointerMove;
- filter->upAction= *pAction;
- xkbi->mouseKeysCounter= 0;
- xkbi->mouseKey= keycode;
- accel= ((pAction->ptr.flags&XkbSA_NoAcceleration)==0);
- x= XkbPtrActionX(&pAction->ptr);
- y= XkbPtrActionY(&pAction->ptr);
- XkbDDXFakePointerMotion(pAction->ptr.flags,x,y);
- AccessXCancelRepeatKey(xkbi,keycode);
- xkbi->mouseKeysAccel= accel&&
- (xkbi->desc->ctrls->enabled_ctrls&XkbMouseKeysAccelMask);
- xkbi->mouseKeysFlags= pAction->ptr.flags;
- xkbi->mouseKeysDX= XkbPtrActionX(&pAction->ptr);
- xkbi->mouseKeysDY= XkbPtrActionY(&pAction->ptr);
- xkbi->mouseKeyTimer= TimerSet(xkbi->mouseKeyTimer, 0,
- xkbi->desc->ctrls->mk_delay,
- _XkbPtrAccelExpire,(pointer)xkbi);
- }
- else if (filter->keycode==keycode) {
- filter->active = 0;
- if (xkbi->mouseKey==keycode) {
- xkbi->mouseKey= 0;
- xkbi->mouseKeyTimer= TimerSet(xkbi->mouseKeyTimer, 0, 0,
- NULL, NULL);
- }
- }
- return 0;
-}
-
-static int
-_XkbFilterPointerBtn( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
- if (filter->keycode==0) { /* initial press */
- int button= pAction->btn.button;
-
- if (button==XkbSA_UseDfltButton)
- button = xkbi->desc->ctrls->mk_dflt_btn;
-
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv=0;
- filter->filter = _XkbFilterPointerBtn;
- filter->upAction= *pAction;
- filter->upAction.btn.button= button;
- switch (pAction->type) {
- case XkbSA_LockPtrBtn:
- if (((xkbi->lockedPtrButtons&(1<<button))==0)&&
- ((pAction->btn.flags&XkbSA_LockNoLock)==0)) {
- xkbi->lockedPtrButtons|= (1<<button);
- AccessXCancelRepeatKey(xkbi,keycode);
- XkbDDXFakePointerButton(ButtonPress,button);
- filter->upAction.type= XkbSA_NoAction;
- }
- break;
- case XkbSA_PtrBtn:
- {
- register int i,nClicks;
- AccessXCancelRepeatKey(xkbi,keycode);
- if (pAction->btn.count>0) {
- nClicks= pAction->btn.count;
- for (i=0;i<nClicks;i++) {
- XkbDDXFakePointerButton(ButtonPress,button);
- XkbDDXFakePointerButton(ButtonRelease,button);
- }
- filter->upAction.type= XkbSA_NoAction;
- }
- else XkbDDXFakePointerButton(ButtonPress,button);
- }
- break;
- case XkbSA_SetPtrDflt:
- {
- XkbControlsPtr ctrls= xkbi->desc->ctrls;
- XkbControlsRec old;
- xkbControlsNotify cn;
-
- old= *ctrls;
- AccessXCancelRepeatKey(xkbi,keycode);
- switch (pAction->dflt.affect) {
- case XkbSA_AffectDfltBtn:
- if (pAction->dflt.flags&XkbSA_DfltBtnAbsolute)
- ctrls->mk_dflt_btn=
- XkbSAPtrDfltValue(&pAction->dflt);
- else {
- ctrls->mk_dflt_btn+=
- XkbSAPtrDfltValue(&pAction->dflt);
- if (ctrls->mk_dflt_btn>5)
- ctrls->mk_dflt_btn= 5;
- else if (ctrls->mk_dflt_btn<1)
- ctrls->mk_dflt_btn= 1;
- }
- break;
- default:
- ErrorF(
- "Attempt to change unknown pointer default (%d) ignored\n",
- pAction->dflt.affect);
- break;
- }
- if (XkbComputeControlsNotify(xkbi->device,
- &old,xkbi->desc->ctrls,
- &cn,False)) {
- cn.keycode = keycode;
- cn.eventType = KeyPress;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- XkbSendControlsNotify(xkbi->device,&cn);
- }
- }
- break;
- }
- }
- else if (filter->keycode==keycode) {
- int button= filter->upAction.btn.button;
-
- switch (filter->upAction.type) {
- case XkbSA_LockPtrBtn:
- if (((filter->upAction.btn.flags&XkbSA_LockNoUnlock)!=0)||
- ((xkbi->lockedPtrButtons&(1<<button))==0)) {
- break;
- }
- xkbi->lockedPtrButtons&= ~(1<<button);
- case XkbSA_PtrBtn:
- XkbDDXFakePointerButton(ButtonRelease,button);
- break;
- }
- filter->active = 0;
- }
- return 0;
-}
-
-static int
-_XkbFilterControls( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-XkbControlsRec old;
-XkbControlsPtr ctrls;
-DeviceIntPtr kbd;
-unsigned int change;
-XkbEventCauseRec cause;
-
- kbd= xkbi->device;
- ctrls= xkbi->desc->ctrls;
- old= *ctrls;
- if (filter->keycode==0) { /* initial press */
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- change= XkbActionCtrls(&pAction->ctrls);
- filter->priv = change;
- filter->filter = _XkbFilterControls;
- filter->upAction = *pAction;
-
- if (pAction->type==XkbSA_LockControls) {
- filter->priv= (ctrls->enabled_ctrls&change);
- change&= ~ctrls->enabled_ctrls;
- }
-
- if (change) {
- xkbControlsNotify cn;
- XkbSrvLedInfoPtr sli;
-
- ctrls->enabled_ctrls|= change;
- if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,False)) {
- cn.keycode = keycode;
- cn.eventType = KeyPress;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- XkbSendControlsNotify(kbd,&cn);
- }
-
- XkbSetCauseKey(&cause,keycode,KeyPress);
-
- /* If sticky keys were disabled, clear all locks and latches */
- if ((old.enabled_ctrls&XkbStickyKeysMask)&&
- (!(ctrls->enabled_ctrls&XkbStickyKeysMask))) {
- XkbClearAllLatchesAndLocks(kbd,xkbi,False,&cause);
- }
- sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(kbd,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
- XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_ON,change);
- }
- }
- else if (filter->keycode==keycode) {
- change= filter->priv;
- if (change) {
- xkbControlsNotify cn;
- XkbSrvLedInfoPtr sli;
-
- ctrls->enabled_ctrls&= ~change;
- if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,False)) {
- cn.keycode = keycode;
- cn.eventType = KeyRelease;
- cn.requestMajor = 0;
- cn.requestMinor = 0;
- XkbSendControlsNotify(kbd,&cn);
- }
-
- XkbSetCauseKey(&cause,keycode,KeyRelease);
- /* If sticky keys were disabled, clear all locks and latches */
- if ((old.enabled_ctrls&XkbStickyKeysMask)&&
- (!(ctrls->enabled_ctrls&XkbStickyKeysMask))) {
- XkbClearAllLatchesAndLocks(kbd,xkbi,False,&cause);
- }
- sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(kbd,sli->usesControls,True,NULL,&cause);
- if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
- XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_OFF,change);
- }
- filter->keycode= 0;
- filter->active= 0;
- }
- return 1;
-}
-
-static int
-_XkbFilterActionMessage(XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-XkbMessageAction * pMsg;
-DeviceIntPtr kbd;
-
- kbd= xkbi->device;
- if (filter->keycode==0) { /* initial press */
- pMsg= &pAction->msg;
- if ((pMsg->flags&XkbSA_MessageOnRelease)||
- ((pMsg->flags&XkbSA_MessageGenKeyEvent)==0)) {
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv = 0;
- filter->filter = _XkbFilterActionMessage;
- filter->upAction = *pAction;
- }
- if (pMsg->flags&XkbSA_MessageOnPress) {
- xkbActionMessage msg;
-
- msg.keycode= keycode;
- msg.press= 1;
- msg.keyEventFollows=((pMsg->flags&XkbSA_MessageGenKeyEvent)!=0);
- memcpy((char *)msg.message,
- (char *)pMsg->message,XkbActionMessageLength);
- XkbSendActionMessage(kbd,&msg);
- }
- return ((pAction->msg.flags&XkbSA_MessageGenKeyEvent)!=0);
- }
- else if (filter->keycode==keycode) {
- pMsg= &filter->upAction.msg;
- if (pMsg->flags&XkbSA_MessageOnRelease) {
- xkbActionMessage msg;
-
- msg.keycode= keycode;
- msg.press= 0;
- msg.keyEventFollows=((pMsg->flags&XkbSA_MessageGenKeyEvent)!=0);
- memcpy((char *)msg.message,(char *)pMsg->message,
- XkbActionMessageLength);
- XkbSendActionMessage(kbd,&msg);
- }
- filter->keycode= 0;
- filter->active= 0;
- return ((pMsg->flags&XkbSA_MessageGenKeyEvent)!=0);
- }
- return 0;
-}
-
-static int
-_XkbFilterRedirectKey( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-unsigned realMods;
-xEvent ev;
-int x,y;
-XkbStateRec old;
-unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0;
-
- if ((filter->keycode!=0)&&(filter->keycode!=keycode))
- return 1;
-
- GetSpritePosition(&x,&y);
- ev.u.keyButtonPointer.time = GetTimeInMillis();
- ev.u.keyButtonPointer.rootX = x;
- ev.u.keyButtonPointer.rootY = y;
-
- if (filter->keycode==0) { /* initial press */
- if ((pAction->redirect.new_key<xkbi->desc->min_key_code)||
- (pAction->redirect.new_key>xkbi->desc->max_key_code)) {
- return 1;
- }
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv = 0;
- filter->filter = _XkbFilterRedirectKey;
- filter->upAction = *pAction;
-
- ev.u.u.type = KeyPress;
- ev.u.u.detail = pAction->redirect.new_key;
-
- mask= XkbSARedirectVModsMask(&pAction->redirect);
- mods= XkbSARedirectVMods(&pAction->redirect);
- if (mask) XkbVirtualModsToReal(xkbi->desc,mask,&mask);
- if (mods) XkbVirtualModsToReal(xkbi->desc,mods,&mods);
- mask|= pAction->redirect.mods_mask;
- mods|= pAction->redirect.mods;
-
- if ( mask || mods ) {
- old= xkbi->state;
- oldCoreState= xkbi->device->key->state;
- oldCorePrevState= xkbi->device->key->prev_state;
- xkbi->state.base_mods&= ~mask;
- xkbi->state.base_mods|= (mods&mask);
- xkbi->state.latched_mods&= ~mask;
- xkbi->state.latched_mods|= (mods&mask);
- xkbi->state.locked_mods&= ~mask;
- xkbi->state.locked_mods|= (mods&mask);
- XkbComputeDerivedState(xkbi);
- xkbi->device->key->state= xkbi->device->key->prev_state=
- xkbi->state.mods;
- }
-
- realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
- xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
- CoreProcessKeyboardEvent(&ev,xkbi->device,1);
- xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
-
- if ( mask || mods ) {
- xkbi->device->key->state= oldCoreState;
- xkbi->device->key->prev_state= oldCorePrevState;
- xkbi->state= old;
- }
- }
- else if (filter->keycode==keycode) {
-
- ev.u.u.type = KeyRelease;
- ev.u.u.detail = filter->upAction.redirect.new_key;
-
- mask= XkbSARedirectVModsMask(&filter->upAction.redirect);
- mods= XkbSARedirectVMods(&filter->upAction.redirect);
- if (mask) XkbVirtualModsToReal(xkbi->desc,mask,&mask);
- if (mods) XkbVirtualModsToReal(xkbi->desc,mods,&mods);
- mask|= filter->upAction.redirect.mods_mask;
- mods|= filter->upAction.redirect.mods;
-
- if ( mask || mods ) {
- old= xkbi->state;
- oldCoreState= xkbi->device->key->state;
- oldCorePrevState= xkbi->device->key->prev_state;
- xkbi->state.base_mods&= ~mask;
- xkbi->state.base_mods|= (mods&mask);
- xkbi->state.latched_mods&= ~mask;
- xkbi->state.latched_mods|= (mods&mask);
- xkbi->state.locked_mods&= ~mask;
- xkbi->state.locked_mods|= (mods&mask);
- XkbComputeDerivedState(xkbi);
- xkbi->device->key->state= xkbi->device->key->prev_state=
- xkbi->state.mods;
- }
-
- realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
- xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
- CoreProcessKeyboardEvent(&ev,xkbi->device,1);
- xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
-
- if ( mask || mods ) {
- xkbi->device->key->state= oldCoreState;
- xkbi->device->key->prev_state= oldCorePrevState;
- xkbi->state= old;
- }
-
- filter->keycode= 0;
- filter->active= 0;
- }
- return 0;
-}
-
-static int
-_XkbFilterSwitchScreen( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
- if (filter->keycode==0) { /* initial press */
- DeviceIntPtr dev = xkbi->device;
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->filter = _XkbFilterSwitchScreen;
- AccessXCancelRepeatKey(xkbi, keycode);
- XkbDDXSwitchScreen(dev,keycode,pAction);
- return 0;
- }
- else if (filter->keycode==keycode) {
- filter->active= 0;
- return 0;
- }
- return 1;
-}
-
-#ifdef XFree86Server
-static int
-_XkbFilterXF86Private( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
- if (filter->keycode==0) { /* initial press */
- DeviceIntPtr dev = xkbi->device;
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->filter = _XkbFilterXF86Private;
- XkbDDXPrivate(dev,keycode,pAction);
- return 0;
- }
- else if (filter->keycode==keycode) {
- filter->active= 0;
- return 0;
- }
- return 1;
-}
-#endif
-
-#ifdef XINPUT
-
-static int
-_XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
- XkbFilterPtr filter,
- unsigned keycode,
- XkbAction * pAction)
-{
-DeviceIntPtr dev;
-int button;
-
- if (filter->keycode==0) { /* initial press */
- dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL);
- if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))
- return 1;
-
- button= pAction->devbtn.button;
- if ((button<1)||(button>dev->button->numButtons))
- return 1;
-
- filter->keycode = keycode;
- filter->active = 1;
- filter->filterOthers = 0;
- filter->priv=0;
- filter->filter = _XkbFilterDeviceBtn;
- filter->upAction= *pAction;
- switch (pAction->type) {
- case XkbSA_LockDeviceBtn:
- if ((pAction->devbtn.flags&XkbSA_LockNoLock)||
- (dev->button->down[button/8]&(1L<<(button%8))))
- return 0;
- XkbDDXFakeDeviceButton(dev,True,button);
- filter->upAction.type= XkbSA_NoAction;
- break;
- case XkbSA_DeviceBtn:
- if (pAction->devbtn.count>0) {
- int nClicks,i;
- nClicks= pAction->btn.count;
- for (i=0;i<nClicks;i++) {
- XkbDDXFakeDeviceButton(dev,True,button);
- XkbDDXFakeDeviceButton(dev,False,button);
- }
- filter->upAction.type= XkbSA_NoAction;
- }
- else XkbDDXFakeDeviceButton(dev,True,button);
- break;
- }
- }
- else if (filter->keycode==keycode) {
- int button;
-
- filter->active= 0;
- dev= _XkbLookupButtonDevice(filter->upAction.devbtn.device,NULL);
- if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))
- return 1;
-
- button= filter->upAction.btn.button;
- switch (filter->upAction.type) {
- case XkbSA_LockDeviceBtn:
- if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)||
- ((dev->button->down[button/8]&(1L<<(button%8)))==0))
- return 0;
- XkbDDXFakeDeviceButton(dev,False,button);
- break;
- case XkbSA_DeviceBtn:
- XkbDDXFakeDeviceButton(dev,False,button);
- break;
- }
- filter->active = 0;
- }
- return 0;
-}
-#endif
-
-static int szFilters = 0;
-static XkbFilterPtr filters = NULL;
-
-static XkbFilterPtr
-_XkbNextFreeFilter(
- void
-)
-{
-register int i;
-
- if (szFilters==0) {
- szFilters = 4;
- filters = _XkbTypedCalloc(szFilters,XkbFilterRec);
- /* 6/21/93 (ef) -- XXX! deal with allocation failure */
- }
- for (i=0;i<szFilters;i++) {
- if (!filters[i].active) {
- filters[i].keycode = 0;
- return &filters[i];
- }
- }
- szFilters*=2;
- filters= _XkbTypedRealloc(filters,szFilters,XkbFilterRec);
- /* 6/21/93 (ef) -- XXX! deal with allocation failure */
- bzero(&filters[szFilters/2],(szFilters/2)*sizeof(XkbFilterRec));
- return &filters[szFilters/2];
-}
-
-static int
-_XkbApplyFilters(XkbSrvInfoPtr xkbi,unsigned kc,XkbAction *pAction)
-{
-register int i,send;
-
- send= 1;
- for (i=0;i<szFilters;i++) {
- if ((filters[i].active)&&(filters[i].filter))
- send= ((*filters[i].filter)(xkbi,&filters[i],kc,pAction)&&send);
- }
- return send;
-}
-
-void
-XkbHandleActions(DeviceIntPtr dev,DeviceIntPtr kbd,xEvent *xE,int count)
-{
-int key,bit,i;
-CARD8 realMods;
-XkbSrvInfoPtr xkbi;
-KeyClassPtr keyc;
-int changed,sendEvent;
-Bool genStateNotify;
-XkbStateRec oldState;
-XkbAction act;
-XkbFilterPtr filter;
-Bool keyEvent;
-Bool pressEvent;
-#ifdef XINPUT
-Bool xiEvent;
-#endif
-
- keyc= kbd->key;
- xkbi= keyc->xkbInfo;
- key= xE->u.u.detail;
- if ((xkbi->flags&_XkbStateNotifyInProgress)==0) {
- oldState= xkbi->state;
- xkbi->flags|= _XkbStateNotifyInProgress;
- genStateNotify= True;
- }
- else genStateNotify= False;
-
- xkbi->clearMods = xkbi->setMods = 0;
- xkbi->groupChange = 0;
-
- sendEvent = 1;
-#ifdef XINPUT
- keyEvent= ((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress)||
- (xE->u.u.type==KeyRelease)||(xE->u.u.type==DeviceKeyRelease));
- pressEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress)||
- (xE->u.u.type==ButtonPress)||(xE->u.u.type==DeviceButtonPress);
- xiEvent= (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease)||
- (xE->u.u.type==DeviceButtonPress)||
- (xE->u.u.type==DeviceButtonRelease);
-#else
- keyEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease);
- pressEvent= (xE->u.u.type==KeyPress)||(xE->u.u.type==ButtonPress);
-#endif
-
- if (pressEvent) {
- if (keyEvent)
- act = XkbGetKeyAction(xkbi,&xkbi->state,key);
- else {
- act = XkbGetButtonAction(kbd,dev,key);
- key|= BTN_ACT_FLAG;
- }
- sendEvent = _XkbApplyFilters(xkbi,key,&act);
- if (sendEvent) {
- switch (act.type) {
- case XkbSA_SetMods:
- case XkbSA_SetGroup:
- filter = _XkbNextFreeFilter();
- sendEvent = _XkbFilterSetState(xkbi,filter,key,&act);
- break;
- case XkbSA_LatchMods:
- case XkbSA_LatchGroup:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterLatchState(xkbi,filter,key,&act);
- break;
- case XkbSA_LockMods:
- case XkbSA_LockGroup:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterLockState(xkbi,filter,key,&act);
- break;
- case XkbSA_ISOLock:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterISOLock(xkbi,filter,key,&act);
- break;
- case XkbSA_MovePtr:
- filter = _XkbNextFreeFilter();
- sendEvent= _XkbFilterPointerMove(xkbi,filter,key,&act);
- break;
- case XkbSA_PtrBtn:
- case XkbSA_LockPtrBtn:
- case XkbSA_SetPtrDflt:
- filter = _XkbNextFreeFilter();
- sendEvent= _XkbFilterPointerBtn(xkbi,filter,key,&act);
- break;
- case XkbSA_Terminate:
- sendEvent= XkbDDXTerminateServer(dev,key,&act);
- break;
- case XkbSA_SwitchScreen:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterSwitchScreen(xkbi,filter,key,&act);
- break;
- case XkbSA_SetControls:
- case XkbSA_LockControls:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterControls(xkbi,filter,key,&act);
- break;
- case XkbSA_ActionMessage:
- filter = _XkbNextFreeFilter();
- sendEvent=_XkbFilterActionMessage(xkbi,filter,key,&act);
- break;
- case XkbSA_RedirectKey:
- filter = _XkbNextFreeFilter();
- sendEvent= _XkbFilterRedirectKey(xkbi,filter,key,&act);
- break;
-#ifdef XINPUT
- case XkbSA_DeviceBtn:
- case XkbSA_LockDeviceBtn:
- filter = _XkbNextFreeFilter();
- sendEvent= _XkbFilterDeviceBtn(xkbi,filter,key,&act);
- break;
-#endif
-#ifdef XFree86Server
- case XkbSA_XFree86Private:
- filter = _XkbNextFreeFilter();
- sendEvent= _XkbFilterXF86Private(xkbi,filter,key,&act);
- break;
-#endif
- }
- }
- }
- else {
- if (!keyEvent)
- key|= BTN_ACT_FLAG;
- sendEvent = _XkbApplyFilters(xkbi,key,NULL);
- }
-
- if (xkbi->groupChange!=0)
- xkbi->state.base_group+= xkbi->groupChange;
- if (xkbi->setMods) {
- for (i=0,bit=1; xkbi->setMods; i++,bit<<=1 ) {
- if (xkbi->setMods&bit) {
- keyc->modifierKeyCount[i]++;
- xkbi->state.base_mods|= bit;
- xkbi->setMods&= ~bit;
- }
- }
- }
- if (xkbi->clearMods) {
- for (i=0,bit=1; xkbi->clearMods; i++,bit<<=1 ) {
- if (xkbi->clearMods&bit) {
- keyc->modifierKeyCount[i]--;
- if (keyc->modifierKeyCount[i]<=0) {
- xkbi->state.base_mods&= ~bit;
- keyc->modifierKeyCount[i] = 0;
- }
- xkbi->clearMods&= ~bit;
- }
- }
- }
-
- if (sendEvent) {
-#ifdef XINPUT
- if (xiEvent)
- ProcessOtherEvent(xE,dev,count);
- else
-#endif
- if (keyEvent) {
- realMods = keyc->modifierMap[key];
- keyc->modifierMap[key] = 0;
- CoreProcessKeyboardEvent(xE,dev,count);
- keyc->modifierMap[key] = realMods;
- }
- else CoreProcessPointerEvent(xE,dev,count);
- }
- else if (keyEvent)
- FixKeyState(xE,dev);
-
- xkbi->prev_state= oldState;
- XkbComputeDerivedState(xkbi);
- keyc->prev_state= keyc->state;
- keyc->state= XkbStateFieldFromRec(&xkbi->state);
- changed = XkbStateChangedFlags(&oldState,&xkbi->state);
- if (genStateNotify) {
- if (changed) {
- xkbStateNotify sn;
- sn.keycode= key;
- sn.eventType= xE->u.u.type;
- sn.requestMajor = sn.requestMinor = 0;
- sn.changed= changed;
- XkbSendStateNotify(dev,&sn);
- }
- xkbi->flags&= ~_XkbStateNotifyInProgress;
- }
- changed= XkbIndicatorsToUpdate(dev,changed,False);
- if (changed) {
- XkbEventCauseRec cause;
- XkbSetCauseKey(&cause,key,xE->u.u.type);
- XkbUpdateIndicators(dev,changed,True,NULL,&cause);
- }
- return;
-}
-
-int
-XkbLatchModifiers(DeviceIntPtr pXDev,CARD8 mask,CARD8 latches)
-{
-XkbSrvInfoPtr xkbi;
-XkbFilterPtr filter;
-XkbAction act;
-unsigned clear;
-
- if ( pXDev && pXDev->key && pXDev->key->xkbInfo ) {
- xkbi = pXDev->key->xkbInfo;
- clear= (mask&(~latches));
- xkbi->state.latched_mods&= ~clear;
- /* Clear any pending latch to locks.
- */
- act.type = XkbSA_NoAction;
- _XkbApplyFilters(xkbi,SYNTHETIC_KEYCODE,&act);
- act.type = XkbSA_LatchMods;
- act.mods.flags = 0;
- act.mods.mask = mask&latches;
- filter = _XkbNextFreeFilter();
- _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,&act);
- _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,(XkbAction *)NULL);
- return Success;
- }
- return BadValue;
-}
-
-int
-XkbLatchGroup(DeviceIntPtr pXDev,int group)
-{
-XkbSrvInfoPtr xkbi;
-XkbFilterPtr filter;
-XkbAction act;
-
- if ( pXDev && pXDev->key && pXDev->key->xkbInfo ) {
- xkbi = pXDev->key->xkbInfo;
- act.type = XkbSA_LatchGroup;
- act.group.flags = 0;
- XkbSASetGroup(&act.group,group);
- filter = _XkbNextFreeFilter();
- _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,&act);
- _XkbFilterLatchState(xkbi,filter,SYNTHETIC_KEYCODE,(XkbAction *)NULL);
- return Success;
- }
- return BadValue;
-}
-
-/***====================================================================***/
-
-void
-XkbClearAllLatchesAndLocks( DeviceIntPtr dev,
- XkbSrvInfoPtr xkbi,
- Bool genEv,
- XkbEventCausePtr cause)
-{
-XkbStateRec os;
-xkbStateNotify sn;
-
- sn.changed= 0;
- os= xkbi->state;
- if (os.latched_mods) { /* clear all latches */
- XkbLatchModifiers(dev,~0,0);
- sn.changed|= XkbModifierLatchMask;
- }
- if (os.latched_group) {
- XkbLatchGroup(dev,0);
- sn.changed|= XkbGroupLatchMask;
- }
- if (os.locked_mods) {
- xkbi->state.locked_mods= 0;
- sn.changed|= XkbModifierLockMask;
- }
- if (os.locked_group) {
- xkbi->state.locked_group= 0;
- sn.changed|= XkbGroupLockMask;
- }
- if ( genEv && sn.changed) {
- CARD32 changed;
-
- XkbComputeDerivedState(xkbi);
- sn.keycode= cause->kc;
- sn.eventType= cause->event;
- sn.requestMajor= cause->mjr;
- sn.requestMinor= cause->mnr;
- sn.changed= XkbStateChangedFlags(&os,&xkbi->state);
- XkbSendStateNotify(dev,&sn);
- changed= XkbIndicatorsToUpdate(dev,sn.changed,False);
- if (changed) {
- XkbUpdateIndicators(dev,changed,True,NULL,cause);
- }
- }
- return;
-}
-
diff --git a/xkb/xkbDflts.h b/xkb/xkbDflts.h
deleted file mode 100644
index 910616e60..000000000
--- a/xkb/xkbDflts.h
+++ /dev/null
@@ -1,509 +0,0 @@
-/* $Xorg: xkbDflts.h,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */
-/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.3 2003/11/17 22:20:46 dawes Exp $ */
-/* This file generated automatically by xkbcomp */
-/* DO NOT EDIT */
-#ifndef DEFAULT_H
-#define DEFAULT_H 1
-
-#ifndef XKB_IN_SERVER
-#define GET_ATOM(d,s) XInternAtom(d,s,0)
-#define DPYTYPE Display *
-#else
-#define GET_ATOM(d,s) MakeAtom(s,strlen(s),1)
-#define DPYTYPE char *
-#endif
-#define NUM_KEYS 1
-
-#define vmod_NumLock 0
-#define vmod_Alt 1
-#define vmod_LevelThree 2
-#define vmod_AltGr 3
-#define vmod_ScrollLock 4
-
-#define vmod_NumLockMask (1<<0)
-#define vmod_AltMask (1<<1)
-#define vmod_LevelThreeMask (1<<2)
-#define vmod_AltGrMask (1<<3)
-#define vmod_ScrollLockMask (1<<4)
-
-/* types name is "default" */
-static Atom lnames_ONE_LEVEL[1];
-
-static XkbKTMapEntryRec map_TWO_LEVEL[1]= {
- { 1, 1, { ShiftMask, ShiftMask, 0 } }
-};
-static Atom lnames_TWO_LEVEL[2];
-
-static XkbKTMapEntryRec map_ALPHABETIC[2]= {
- { 1, 1, { ShiftMask, ShiftMask, 0 } },
- { 1, 0, { LockMask, LockMask, 0 } }
-};
-static XkbModsRec preserve_ALPHABETIC[2]= {
- { 0, 0, 0 },
- { LockMask, LockMask, 0 }
-};
-static Atom lnames_ALPHABETIC[2];
-
-static XkbKTMapEntryRec map_KEYPAD[2]= {
- { 1, 1, { ShiftMask, ShiftMask, 0 } },
- { 0, 1, { 0, 0, vmod_NumLockMask } }
-};
-static Atom lnames_KEYPAD[2];
-
-static XkbKTMapEntryRec map_PC_BREAK[1]= {
- { 1, 1, { ControlMask, ControlMask, 0 } }
-};
-static Atom lnames_PC_BREAK[2];
-
-static XkbKTMapEntryRec map_PC_SYSRQ[1]= {
- { 0, 1, { 0, 0, vmod_AltMask } }
-};
-static Atom lnames_PC_SYSRQ[2];
-
-static XkbKTMapEntryRec map_CTRL_ALT[1]= {
- { 0, 1, { ControlMask, ControlMask, vmod_AltMask } }
-};
-static Atom lnames_CTRL_ALT[2];
-
-static XkbKTMapEntryRec map_THREE_LEVEL[3]= {
- { 1, 1, { ShiftMask, ShiftMask, 0 } },
- { 0, 2, { 0, 0, vmod_LevelThreeMask } },
- { 0, 2, { ShiftMask, ShiftMask, vmod_LevelThreeMask } }
-};
-static Atom lnames_THREE_LEVEL[3];
-
-static XkbKTMapEntryRec map_SHIFT_ALT[1]= {
- { 0, 1, { ShiftMask, ShiftMask, vmod_AltMask } }
-};
-static Atom lnames_SHIFT_ALT[2];
-
-static XkbKeyTypeRec dflt_types[]= {
- {
- { 0, 0, 0 },
- 1,
- 0, NULL, NULL,
- None, lnames_ONE_LEVEL
- },
- {
- { ShiftMask, ShiftMask, 0 },
- 2,
- 1, map_TWO_LEVEL, NULL,
- None, lnames_TWO_LEVEL
- },
- {
- { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
- 2,
- 2, map_ALPHABETIC, preserve_ALPHABETIC,
- None, lnames_ALPHABETIC
- },
- {
- { ShiftMask, ShiftMask, vmod_NumLockMask },
- 2,
- 2, map_KEYPAD, NULL,
- None, lnames_KEYPAD
- },
- {
- { ControlMask, ControlMask, 0 },
- 2,
- 1, map_PC_BREAK, NULL,
- None, lnames_PC_BREAK
- },
- {
- { 0, 0, vmod_AltMask },
- 2,
- 1, map_PC_SYSRQ, NULL,
- None, lnames_PC_SYSRQ
- },
- {
- { ControlMask, ControlMask, vmod_AltMask },
- 2,
- 1, map_CTRL_ALT, NULL,
- None, lnames_CTRL_ALT
- },
- {
- { ShiftMask, ShiftMask, vmod_LevelThreeMask },
- 3,
- 3, map_THREE_LEVEL, NULL,
- None, lnames_THREE_LEVEL
- },
- {
- { ShiftMask, ShiftMask, vmod_AltMask },
- 2,
- 1, map_SHIFT_ALT, NULL,
- None, lnames_SHIFT_ALT
- }
-};
-#define num_dflt_types (sizeof(dflt_types)/sizeof(XkbKeyTypeRec))
-
-
-static void
-initTypeNames(DPYTYPE dpy)
-{
- dflt_types[0].name= GET_ATOM(dpy,"ONE_LEVEL");
- lnames_ONE_LEVEL[0]= GET_ATOM(dpy,"Any");
- dflt_types[1].name= GET_ATOM(dpy,"TWO_LEVEL");
- lnames_TWO_LEVEL[0]= GET_ATOM(dpy,"Base");
- lnames_TWO_LEVEL[1]= GET_ATOM(dpy,"Shift");
- dflt_types[2].name= GET_ATOM(dpy,"ALPHABETIC");
- lnames_ALPHABETIC[0]= GET_ATOM(dpy,"Base");
- lnames_ALPHABETIC[1]= GET_ATOM(dpy,"Caps");
- dflt_types[3].name= GET_ATOM(dpy,"KEYPAD");
- lnames_KEYPAD[0]= GET_ATOM(dpy,"Base");
- lnames_KEYPAD[1]= GET_ATOM(dpy,"Number");
- dflt_types[4].name= GET_ATOM(dpy,"PC_BREAK");
- lnames_PC_BREAK[0]= GET_ATOM(dpy,"Base");
- lnames_PC_BREAK[1]= GET_ATOM(dpy,"Control");
- dflt_types[5].name= GET_ATOM(dpy,"PC_SYSRQ");
- lnames_PC_SYSRQ[0]= GET_ATOM(dpy,"Base");
- lnames_PC_SYSRQ[1]= GET_ATOM(dpy,"Alt");
- dflt_types[6].name= GET_ATOM(dpy,"CTRL+ALT");
- lnames_CTRL_ALT[0]= GET_ATOM(dpy,"Base");
- lnames_CTRL_ALT[1]= GET_ATOM(dpy,"Ctrl+Alt");
- dflt_types[7].name= GET_ATOM(dpy,"THREE_LEVEL");
- lnames_THREE_LEVEL[0]= GET_ATOM(dpy,"Base");
- lnames_THREE_LEVEL[1]= GET_ATOM(dpy,"Shift");
- lnames_THREE_LEVEL[2]= GET_ATOM(dpy,"Level3");
- dflt_types[8].name= GET_ATOM(dpy,"SHIFT+ALT");
- lnames_SHIFT_ALT[0]= GET_ATOM(dpy,"Base");
- lnames_SHIFT_ALT[1]= GET_ATOM(dpy,"Shift+Alt");
-}
-/* compat name is "default" */
-static XkbSymInterpretRec dfltSI[69]= {
- { XK_ISO_Level2_Latch, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_Exactly, ShiftMask,
- 255,
- { XkbSA_LatchMods, { 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Eisu_Shift, 0x0000,
- XkbSI_Exactly, LockMask,
- 255,
- { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Eisu_toggle, 0x0000,
- XkbSI_Exactly, LockMask,
- 255,
- { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Kana_Shift, 0x0000,
- XkbSI_Exactly, LockMask,
- 255,
- { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Kana_Lock, 0x0000,
- XkbSI_Exactly, LockMask,
- 255,
- { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Shift_Lock, 0x0000,
- XkbSI_AnyOf, ShiftMask|LockMask,
- 255,
- { XkbSA_LockMods, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Num_Lock, 0x0000,
- XkbSI_AnyOf, 0xff,
- 0,
- { XkbSA_LockMods, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_Alt_L, 0x0000,
- XkbSI_AnyOf, 0xff,
- 1,
- { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Alt_R, 0x0000,
- XkbSI_AnyOf, 0xff,
- 1,
- { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Scroll_Lock, 0x0000,
- XkbSI_AnyOf, 0xff,
- 4,
- { XkbSA_LockMods, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Lock, 0x0000,
- XkbSI_AnyOf, 0xff,
- 255,
- { XkbSA_ISOLock, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Level3_Shift, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff,
- 2,
- { XkbSA_SetMods, { 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } },
- { XK_ISO_Level3_Latch, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff,
- 2,
- { XkbSA_LatchMods, { 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } },
- { XK_Mode_switch, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff,
- 3,
- { XkbSA_SetGroup, { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_1, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_End, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_2, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_Down, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_3, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_Next, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } },
- { XK_KP_4, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Left, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_6, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Right, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_7, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_Home, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_8, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_Up, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_9, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_Prior, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00 } } },
- { XK_KP_5, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Begin, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_F1, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Divide, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_F2, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Multiply, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_F3, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Subtract, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Separator, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Add, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_0, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Insert, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Decimal, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_KP_Delete, 0x0001,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Button_Dflt, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Button1, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Button2, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Button3, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_DblClick_Dflt, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_DblClick1, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_DblClick2, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_DblClick3, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_PtrBtn, { 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Drag_Dflt, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Drag1, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Drag2, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_Drag3, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_EnableKeys, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00 } } },
- { XK_Pointer_Accelerate, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 } } },
- { XK_Pointer_DfltBtnNext, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_Pointer_DfltBtnPrev, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_SetPtrDflt, { 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_AccessX_Enable, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } },
- { XK_Terminate_Server, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_Terminate, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Group_Latch, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff,
- 3,
- { XkbSA_LatchGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Next_Group, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff,
- 3,
- { XkbSA_LockGroup, { 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Prev_Group, 0x0000,
- XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff,
- 3,
- { XkbSA_LockGroup, { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_First_Group, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockGroup, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { XK_ISO_Last_Group, 0x0000,
- XkbSI_AnyOfOrNone, 0xff,
- 255,
- { XkbSA_LockGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
- { NoSymbol, 0x0000,
- XkbSI_Exactly, LockMask,
- 255,
- { XkbSA_LockMods, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } },
- { NoSymbol, 0x0000,
- XkbSI_AnyOf, 0xff,
- 255,
- { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }
-};
-#define num_dfltSI (sizeof(dfltSI)/sizeof(XkbSymInterpretRec))
-
-static XkbCompatMapRec compatMap= {
- dfltSI,
- { /* group compatibility */
- { 0, 0, 0 },
- { 0, 0, vmod_AltGrMask },
- { 0, 0, vmod_AltGrMask },
- { 0, 0, vmod_AltGrMask }
- },
- num_dfltSI, num_dfltSI
-};
-
-static XkbIndicatorRec indicators= {
- 0x0,
- {
- { 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 },
- { 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 },
- { 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 },
- { 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask },
- { 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 },
- { 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }
- }
-};
-static void
-initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb)
-{
- xkb->names->indicators[ 0]= GET_ATOM(dpy,"Caps Lock");
- xkb->names->indicators[ 1]= GET_ATOM(dpy,"Num Lock");
- xkb->names->indicators[ 2]= GET_ATOM(dpy,"Shift Lock");
- xkb->names->indicators[ 3]= GET_ATOM(dpy,"Mouse Keys");
- xkb->names->indicators[ 4]= GET_ATOM(dpy,"Scroll Lock");
- xkb->names->indicators[ 5]= GET_ATOM(dpy,"Group 2");
-}
-#endif /* DEFAULT_H */
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
deleted file mode 100644
index 0cd1becac..000000000
--- a/xkb/xkbEvents.c
+++ /dev/null
@@ -1,1053 +0,0 @@
-/* $Xorg: xkbEvents.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbEvents.c,v 3.12 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "XI.h"
-#include "inputstr.h"
-#include "windowstr.h"
-#include "XKBsrv.h"
-#include "xkb.h"
-
-/***====================================================================***/
-
-void
-XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN)
-{
-register int i;
-Time time;
-CARD16 changed;
-
- pNKN->type = XkbEventCode + XkbEventBase;
- pNKN->xkbType = XkbNewKeyboardNotify;
- pNKN->time = time = GetTimeInMillis();
- changed = pNKN->changed;
-
- for (i=1; i<currentMaxClients; i++) {
- if ((!clients[i]) || clients[i]->clientGone ||
- (clients[i]->requestVector==InitialVector)) {
- continue;
- }
-
- if (clients[i]->xkbClientFlags&_XkbClientInitialized) {
- if (clients[i]->newKeyboardNotifyMask&changed) {
- pNKN->sequenceNumber = clients[i]->sequence;
- pNKN->time = time;
- pNKN->changed = changed;
- if ( clients[i]->swapped ) {
- register int n;
- swaps(&pNKN->sequenceNumber,n);
- swapl(&pNKN->time,n);
- swaps(&pNKN->changed,n);
- }
- WriteToClient(clients[i],sizeof(xEvent),(char *)pNKN);
- if (changed&XkbNKN_KeycodesMask) {
- clients[i]->minKC= pNKN->minKeyCode;
- clients[i]->maxKC= pNKN->maxKeyCode;
- }
- }
- }
- else if (changed&XkbNKN_KeycodesMask) {
- xEvent event;
- event.u.u.type= MappingNotify;
- event.u.mappingNotify.request= MappingKeyboard;
- event.u.mappingNotify.firstKeyCode= clients[i]->minKC;
- event.u.mappingNotify.count= clients[i]->maxKC-clients[i]->minKC+1;
- event.u.u.sequenceNumber= clients[i]->sequence;
- if (clients[i]->swapped) {
- int n;
- swaps(&event.u.u.sequenceNumber,n);
- }
- WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event);
- event.u.mappingNotify.request= MappingModifier;
- WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event);
- }
- }
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbSendStateNotify(DeviceIntPtr kbd,xkbStateNotify *pSN)
-{
-XkbSrvInfoPtr xkbi;
-XkbStatePtr state;
-XkbInterestPtr interest;
-Time time;
-register CARD16 changed,bState;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
- xkbi = kbd->key->xkbInfo;
- state= &xkbi->state;
-
- pSN->type = XkbEventCode + XkbEventBase;
- pSN->xkbType = XkbStateNotify;
- pSN->deviceID = kbd->id;
- pSN->time = time = GetTimeInMillis();
- pSN->mods = state->mods;
- pSN->baseMods = state->base_mods;
- pSN->latchedMods = state->latched_mods;
- pSN->lockedMods = state->locked_mods;
- pSN->group = state->group;
- pSN->baseGroup = state->base_group;
- pSN->latchedGroup = state->latched_group;
- pSN->lockedGroup = state->locked_group;
- pSN->compatState = state->compat_state;
- pSN->grabMods = state->grab_mods;
- pSN->compatGrabMods = state->compat_grab_mods;
- pSN->lookupMods = state->lookup_mods;
- pSN->compatLookupMods = state->compat_lookup_mods;
- pSN->ptrBtnState = state->ptr_buttons;
- changed = pSN->changed;
- bState= pSN->ptrBtnState;
-
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->stateNotifyMask&changed)) {
- pSN->sequenceNumber = interest->client->sequence;
- pSN->time = time;
- pSN->changed = changed;
- pSN->ptrBtnState = bState;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pSN->sequenceNumber,n);
- swapl(&pSN->time,n);
- swaps(&pSN->changed,n);
- swaps(&pSN->ptrBtnState,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pSN);
- }
- interest= interest->next;
- }
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbSendMapNotify(DeviceIntPtr kbd,xkbMapNotify *pMN)
-{
-int i;
-XkbSrvInfoPtr xkbi;
-unsigned time = 0,initialized;
-CARD16 changed;
-
- xkbi = kbd->key->xkbInfo;
- initialized= 0;
-
- changed = pMN->changed;
- pMN->minKeyCode= xkbi->desc->min_key_code;
- pMN->maxKeyCode= xkbi->desc->max_key_code;
- for (i=1; i<currentMaxClients; i++) {
- if (clients[i] && ! clients[i]->clientGone &&
- (clients[i]->requestVector != InitialVector) &&
- (clients[i]->xkbClientFlags&_XkbClientInitialized) &&
- (clients[i]->mapNotifyMask&changed))
- {
- if (!initialized) {
- pMN->type = XkbEventCode + XkbEventBase;
- pMN->xkbType = XkbMapNotify;
- pMN->deviceID = kbd->id;
- time = GetTimeInMillis();
- initialized= 1;
- }
- pMN->time= time;
- pMN->sequenceNumber = clients[i]->sequence;
- pMN->changed = changed;
- if ( clients[i]->swapped ) {
- register int n;
- swaps(&pMN->sequenceNumber,n);
- swapl(&pMN->time,n);
- swaps(&pMN->changed,n);
- }
- WriteToClient(clients[i],sizeof(xEvent),(char *)pMN);
- }
- }
- return;
-}
-
-int
-XkbComputeControlsNotify( DeviceIntPtr kbd,
- XkbControlsPtr old,
- XkbControlsPtr new,
- xkbControlsNotify * pCN,
- Bool forceCtrlProc)
-{
-int i;
-CARD32 changedControls;
-
- changedControls= 0;
- if (old->enabled_ctrls!=new->enabled_ctrls)
- changedControls|= XkbControlsEnabledMask;
- if ((old->repeat_delay!=new->repeat_delay)||
- (old->repeat_interval!=new->repeat_interval))
- changedControls|= XkbRepeatKeysMask;
- for (i = 0; i < XkbPerKeyBitArraySize; i++)
- if (old->per_key_repeat[i] != new->per_key_repeat[i])
- changedControls|= XkbPerKeyRepeatMask;
- if (old->slow_keys_delay!=new->slow_keys_delay)
- changedControls|= XkbSlowKeysMask;
- if (old->debounce_delay!=new->debounce_delay)
- changedControls|= XkbBounceKeysMask;
- if ((old->mk_delay!=new->mk_delay)||
- (old->mk_interval!=new->mk_interval)||
- (old->mk_dflt_btn!=new->mk_dflt_btn))
- changedControls|= XkbMouseKeysMask;
- if ((old->mk_time_to_max!=new->mk_time_to_max)||
- (old->mk_curve!=new->mk_curve)||
- (old->mk_max_speed!=new->mk_max_speed))
- changedControls|= XkbMouseKeysAccelMask;
- if (old->ax_options!=new->ax_options)
- changedControls|= XkbAccessXKeysMask;
- if ((old->ax_options^new->ax_options) & XkbAX_SKOptionsMask)
- changedControls|= XkbStickyKeysMask;
- if ((old->ax_options^new->ax_options) & XkbAX_FBOptionsMask)
- changedControls|= XkbAccessXFeedbackMask;
- if ((old->ax_timeout!=new->ax_timeout)||
- (old->axt_ctrls_mask!=new->axt_ctrls_mask)||
- (old->axt_ctrls_values!=new->axt_ctrls_values)||
- (old->axt_opts_mask!=new->axt_opts_mask)||
- (old->axt_opts_values!= new->axt_opts_values)) {
- changedControls|= XkbAccessXTimeoutMask;
- }
- if ((old->internal.mask!=new->internal.mask)||
- (old->internal.real_mods!=new->internal.real_mods)||
- (old->internal.vmods!=new->internal.vmods))
- changedControls|= XkbInternalModsMask;
- if ((old->ignore_lock.mask!=new->ignore_lock.mask)||
- (old->ignore_lock.real_mods!=new->ignore_lock.real_mods)||
- (old->ignore_lock.vmods!=new->ignore_lock.vmods))
- changedControls|= XkbIgnoreLockModsMask;
-
- if (new->enabled_ctrls&XkbRepeatKeysMask)
- kbd->kbdfeed->ctrl.autoRepeat=TRUE;
- else kbd->kbdfeed->ctrl.autoRepeat=FALSE;
-
- if (kbd->kbdfeed && kbd->kbdfeed->CtrlProc &&
- (changedControls || forceCtrlProc))
- (*kbd->kbdfeed->CtrlProc)(kbd, &kbd->kbdfeed->ctrl);
-
- if ((!changedControls)&&(old->num_groups==new->num_groups))
- return 0;
-
- if (!kbd->xkb_interest)
- return 0;
-
- pCN->changedControls = changedControls;
- pCN->enabledControls = new->enabled_ctrls;
- pCN->enabledControlChanges = (new->enabled_ctrls^old->enabled_ctrls);
- pCN->numGroups = new->num_groups;
-
- return 1;
-}
-
-void
-XkbSendControlsNotify(DeviceIntPtr kbd,xkbControlsNotify *pCN)
-{
-int initialized;
-CARD32 changedControls, enabledControls, enabledChanges = 0;
-XkbSrvInfoPtr xkbi;
-XkbInterestPtr interest;
-Time time = 0;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
- xkbi = kbd->key->xkbInfo;
-
- initialized = 0;
- enabledControls = xkbi->desc->ctrls->enabled_ctrls;
- changedControls = pCN->changedControls;
- pCN->numGroups= xkbi->desc->ctrls->num_groups;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->ctrlsNotifyMask&changedControls)) {
- if (!initialized) {
- pCN->type = XkbEventCode + XkbEventBase;
- pCN->xkbType = XkbControlsNotify;
- pCN->deviceID = kbd->id;
- pCN->time = time = GetTimeInMillis();
- enabledChanges = pCN->enabledControlChanges;
- initialized= 1;
- }
- pCN->changedControls = changedControls;
- pCN->enabledControls = enabledControls;
- pCN->enabledControlChanges = enabledChanges;
- pCN->sequenceNumber = interest->client->sequence;
- pCN->time = time;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pCN->sequenceNumber,n);
- swapl(&pCN->changedControls,n);
- swapl(&pCN->enabledControls,n);
- swapl(&pCN->enabledControlChanges,n);
- swapl(&pCN->time,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pCN);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendIndicatorNotify(DeviceIntPtr kbd,int xkbType,xkbIndicatorNotify *pEv)
-{
-int initialized;
-XkbInterestPtr interest;
-Time time = 0;
-CARD32 state,changed;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- state = pEv->state;
- changed = pEv->changed;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (((xkbType==XkbIndicatorStateNotify)&&
- (interest->iStateNotifyMask&changed))||
- ((xkbType==XkbIndicatorMapNotify)&&
- (interest->iMapNotifyMask&changed)))) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = xkbType;
- pEv->deviceID = kbd->id;
- pEv->time = time = GetTimeInMillis();
- initialized= 1;
- }
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- pEv->changed = changed;
- pEv->state = state;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swapl(&pEv->changed,n);
- swapl(&pEv->state,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-
-void
-XkbHandleBell( BOOL force,
- BOOL eventOnly,
- DeviceIntPtr kbd,
- CARD8 percent,
- pointer pCtrl,
- CARD8 class,
- Atom name,
- WindowPtr pWin,
- ClientPtr pClient)
-{
-xkbBellNotify bn;
-int initialized;
-XkbSrvInfoPtr xkbi;
-XkbInterestPtr interest;
-CARD8 id;
-CARD16 pitch,duration;
-Time time = 0;
-XID winID = 0;
-
- xkbi = kbd->key->xkbInfo;
-
- if ((force||(xkbi->desc->ctrls->enabled_ctrls&XkbAudibleBellMask))&&
- (!eventOnly)) {
- (*kbd->kbdfeed->BellProc)(percent,kbd,(pointer)pCtrl,class);
- }
- interest = kbd->xkb_interest;
- if ((!interest)||(force))
- return;
-
- if ((class==0)||(class==KbdFeedbackClass)) {
- KeybdCtrl *pKeyCtrl= (KeybdCtrl *)pCtrl;
- id= pKeyCtrl->id;
- pitch= pKeyCtrl->bell_pitch;
- duration= pKeyCtrl->bell_duration;
- }
- else if (class==BellFeedbackClass) {
- BellCtrl *pBellCtrl= (BellCtrl *)pCtrl;
- id= pBellCtrl->id;
- pitch= pBellCtrl->pitch;
- duration= pBellCtrl->duration;
- }
- else return;
-
- initialized = 0;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->bellNotifyMask)) {
- if (!initialized) {
- time = GetTimeInMillis();
- bn.type = XkbEventCode + XkbEventBase;
- bn.xkbType = XkbBellNotify;
- bn.deviceID = kbd->id;
- bn.bellClass = class;
- bn.bellID = id;
- bn.percent= percent;
- bn.eventOnly = (eventOnly!=0);
- winID= (pWin?pWin->drawable.id:None);
- initialized= 1;
- }
- bn.sequenceNumber = interest->client->sequence;
- bn.time = time;
- bn.pitch = pitch;
- bn.duration = duration;
- bn.name = name;
- bn.window= winID;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&bn.sequenceNumber,n);
- swapl(&bn.time,n);
- swaps(&bn.pitch,n);
- swaps(&bn.duration,n);
- swapl(&bn.name,n);
- swapl(&bn.window,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)&bn);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendAccessXNotify(DeviceIntPtr kbd,xkbAccessXNotify *pEv)
-{
-int initialized;
-XkbInterestPtr interest;
-Time time = 0;
-CARD16 sk_delay,db_delay;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- sk_delay= pEv->slowKeysDelay;
- db_delay= pEv->debounceDelay;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->accessXNotifyMask&(1<<pEv->detail))) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = XkbAccessXNotify;
- pEv->deviceID = kbd->id;
- pEv->time = time = GetTimeInMillis();
- initialized= 1;
- }
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- pEv->slowKeysDelay = sk_delay;
- pEv->debounceDelay = db_delay;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->slowKeysDelay,n);
- swaps(&pEv->debounceDelay,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendNamesNotify(DeviceIntPtr kbd,xkbNamesNotify *pEv)
-{
-int initialized;
-XkbInterestPtr interest;
-Time time = 0;
-CARD16 changed,changedVirtualMods;
-CARD32 changedIndicators;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- changed= pEv->changed;
- changedIndicators= pEv->changedIndicators;
- changedVirtualMods= pEv->changedVirtualMods;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->namesNotifyMask&pEv->changed)) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = XkbNamesNotify;
- pEv->deviceID = kbd->id;
- pEv->time = time = GetTimeInMillis();
- initialized= 1;
- }
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- pEv->changed = changed;
- pEv->changedIndicators = changedIndicators;
- pEv->changedVirtualMods= changedVirtualMods;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->changed,n);
- swapl(&pEv->changedIndicators,n);
- swaps(&pEv->changedVirtualMods,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendCompatMapNotify(DeviceIntPtr kbd,xkbCompatMapNotify *pEv)
-{
-int initialized;
-XkbInterestPtr interest;
-Time time = 0;
-CARD16 firstSI = 0, nSI = 0, nTotalSI = 0;
-
- interest = kbd->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->compatNotifyMask)) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = XkbCompatMapNotify;
- pEv->deviceID = kbd->id;
- pEv->time = time = GetTimeInMillis();
- firstSI= pEv->firstSI;
- nSI= pEv->nSI;
- nTotalSI= pEv->nTotalSI;
- initialized= 1;
- }
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- pEv->firstSI = firstSI;
- pEv->nSI = nSI;
- pEv->nTotalSI = nTotalSI;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->firstSI,n);
- swaps(&pEv->nSI,n);
- swaps(&pEv->nTotalSI,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendActionMessage(DeviceIntPtr kbd,xkbActionMessage *pEv)
-{
-int initialized;
-XkbSrvInfoPtr xkbi;
-XkbInterestPtr interest;
-Time time = 0;
-
- xkbi = kbd->key->xkbInfo;
- interest = kbd->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- pEv->mods= xkbi->state.mods;
- pEv->group= xkbi->state.group;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->actionMessageMask)) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = XkbActionMessage;
- pEv->deviceID = kbd->id;
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time = GetTimeInMillis();
- initialized= 1;
- }
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendExtensionDeviceNotify( DeviceIntPtr dev,
- ClientPtr client,
- xkbExtensionDeviceNotify * pEv)
-{
-int initialized;
-XkbInterestPtr interest;
-Time time = 0;
-CARD32 defined, state;
-CARD16 reason, supported = 0;
-
- interest = dev->xkb_interest;
- if (!interest)
- return;
-
- initialized = 0;
- reason= pEv->reason;
- defined= pEv->ledsDefined;
- state= pEv->ledState;
- while (interest) {
- if ((!interest->client->clientGone) &&
- (interest->client->requestVector != InitialVector) &&
- (interest->client->xkbClientFlags&_XkbClientInitialized) &&
- (interest->extDevNotifyMask&reason)) {
- if (!initialized) {
- pEv->type = XkbEventCode + XkbEventBase;
- pEv->xkbType = XkbExtensionDeviceNotify;
- pEv->deviceID = dev->id;
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time = GetTimeInMillis();
- supported= pEv->supported;
- initialized= 1;
- }
- else {
- pEv->sequenceNumber = interest->client->sequence;
- pEv->time = time;
- pEv->ledsDefined= defined;
- pEv->ledState= state;
- pEv->reason= reason;
- pEv->supported= supported;
- }
- if (client!=interest->client) {
- /* only report UnsupportedFeature to the client that */
- /* issued the failing request */
- pEv->reason&= ~XkbXI_UnsupportedFeatureMask;
- if ((interest->extDevNotifyMask&reason)==0)
- continue;
- }
- if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swapl(&pEv->ledsDefined,n);
- swapl(&pEv->ledState,n);
- swaps(&pEv->reason,n);
- swaps(&pEv->supported,n);
- }
- WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
- }
- interest= interest->next;
- }
- return;
-}
-
-void
-XkbSendNotification( DeviceIntPtr kbd,
- XkbChangesPtr pChanges,
- XkbEventCausePtr cause)
-{
-XkbSrvLedInfoPtr sli;
-
- sli= NULL;
- if (pChanges->state_changes) {
- xkbStateNotify sn;
- sn.changed= pChanges->state_changes;
- sn.keycode= cause->kc;
- sn.eventType= cause->event;
- sn.requestMajor= cause->mjr;
- sn.requestMinor= cause->mnr;
- XkbSendStateNotify(kbd,&sn);
- }
- if (pChanges->map.changed) {
- xkbMapNotify mn;
- mn.changed= pChanges->map.changed;
- mn.firstType= pChanges->map.first_type;
- mn.nTypes= pChanges->map.num_types;
- mn.firstKeySym= pChanges->map.first_key_sym;
- mn.nKeySyms= pChanges->map.num_key_syms;
- mn.firstKeyAct= pChanges->map.first_key_act;
- mn.nKeyActs= pChanges->map.num_key_acts;
- mn.firstKeyBehavior= pChanges->map.first_key_behavior;
- mn.nKeyBehaviors= pChanges->map.num_key_behaviors;
- mn.virtualMods= pChanges->map.vmods;
- mn.firstKeyExplicit= pChanges->map.first_key_explicit;
- mn.nKeyExplicit= pChanges->map.num_key_explicit;
- mn.firstModMapKey= pChanges->map.first_modmap_key;
- mn.nModMapKeys= pChanges->map.num_modmap_keys;
- mn.firstVModMapKey= pChanges->map.first_vmodmap_key;
- mn.nVModMapKeys= pChanges->map.num_vmodmap_keys;
- XkbSendMapNotify(kbd,&mn);
- }
- if ((pChanges->ctrls.changed_ctrls)||
- (pChanges->ctrls.enabled_ctrls_changes)) {
- xkbControlsNotify cn;
- cn.changedControls= pChanges->ctrls.changed_ctrls;
- cn.enabledControlChanges= pChanges->ctrls.enabled_ctrls_changes;
- cn.keycode= cause->kc;
- cn.eventType= cause->event;
- cn.requestMajor= cause->mjr;
- cn.requestMinor= cause->mnr;
- XkbSendControlsNotify(kbd,&cn);
- }
- if (pChanges->indicators.map_changes) {
- xkbIndicatorNotify in;
- if (sli==NULL)
- sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
- in.state= sli->effectiveState;
- in.changed= pChanges->indicators.map_changes;
- XkbSendIndicatorNotify(kbd,XkbIndicatorMapNotify,&in);
- }
- if (pChanges->indicators.state_changes) {
- xkbIndicatorNotify in;
- if (sli==NULL)
- sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
- in.state= sli->effectiveState;
- in.changed= pChanges->indicators.state_changes;
- XkbSendIndicatorNotify(kbd,XkbIndicatorStateNotify,&in);
- }
- if (pChanges->names.changed) {
- xkbNamesNotify nn;
- nn.changed= pChanges->names.changed;
- nn.firstType= pChanges->names.first_type;
- nn.nTypes= pChanges->names.num_types;
- nn.firstLevelName= pChanges->names.first_lvl;
- nn.nLevelNames= pChanges->names.num_lvls;
- nn.nRadioGroups= pChanges->names.num_rg;
- nn.changedVirtualMods= pChanges->names.changed_vmods;
- nn.changedIndicators= pChanges->names.changed_indicators;
- XkbSendNamesNotify(kbd,&nn);
- }
- if ((pChanges->compat.changed_groups)||(pChanges->compat.num_si>0)) {
- xkbCompatMapNotify cmn;
- cmn.changedGroups= pChanges->compat.changed_groups;
- cmn.firstSI= pChanges->compat.first_si;
- cmn.nSI= pChanges->compat.num_si;
- cmn.nTotalSI= kbd->key->xkbInfo->desc->compat->num_si;
- XkbSendCompatMapNotify(kbd,&cmn);
- }
- return;
-}
-
-/***====================================================================***/
-
-Bool
-XkbFilterEvents(ClientPtr pClient,int nEvents,xEvent *xE)
-{
-int i, button_mask;
-DeviceIntPtr pXDev = (DeviceIntPtr)LookupKeyboardDevice();
-XkbSrvInfoPtr xkbi;
-
- xkbi= pXDev->key->xkbInfo;
- if ( pClient->xkbClientFlags & _XkbClientInitialized ) {
-#ifdef DEBUG
- if ((xkbDebugFlags&0x10)&&
- ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
- ErrorF("XKbFilterWriteEvents:\n");
- ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
- ErrorF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n",
- XkbLastRepeatEvent,xE,
- ((XkbLastRepeatEvent!=(pointer)xE)?"True":"False"));
- ErrorF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
- pClient->xkbClientFlags,
- (_XkbWantsDetectableAutoRepeat(pClient)?"True":"False"));
- ErrorF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
- (!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False");
- }
-#endif /* DEBUG */
- if ( (XkbLastRepeatEvent==(pointer)xE) &&
- (_XkbWantsDetectableAutoRepeat(pClient)) &&
- (_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
- return False;
- }
- if ((pXDev->grab != NullGrab) && pXDev->fromPassiveGrab &&
- ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
- register unsigned state,flags;
-
- flags= pClient->xkbClientFlags;
- state= xkbi->state.compat_grab_mods;
- if (flags & XkbPCF_GrabsUseXKBStateMask) {
- int group;
- if (flags&XkbPCF_LookupStateWhenGrabbed) {
- group= xkbi->state.group;
- state= xkbi->state.lookup_mods;
- }
- else {
- state= xkbi->state.grab_mods;
- group= xkbi->state.base_group+xkbi->state.latched_group;
- if ((group<0)||(group>=xkbi->desc->ctrls->num_groups)) {
- group= XkbAdjustGroup(group,xkbi->desc->ctrls);
- }
- }
- state = XkbBuildCoreState(state, group);
- }
- else if (flags&XkbPCF_LookupStateWhenGrabbed)
- state= xkbi->state.compat_lookup_mods;
- xE[0].u.keyButtonPointer.state= state;
- }
- button_mask = 1 << xE[0].u.u.detail;
- if (xE[0].u.u.type == ButtonPress &&
- ((xE[0].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
- (xkbi->lockedPtrButtons & button_mask) == button_mask) {
-#ifdef DEBUG
- /* If the MouseKeys is pressed, and the "real" mouse is also pressed
- * when the mouse is released, the server does not behave properly.
- * Faking a release of the button here solves the problem.
- */
- ErrorF("Faking release of button %d\n", xE[0].u.u.detail);
-#endif
- XkbDDXFakePointerButton(ButtonRelease, xE[0].u.u.detail);
- }
- }
- else {
- register CARD8 type;
-
- for (i=0;i<nEvents;i++) {
- type= xE[i].u.u.type;
-#ifdef DEBUG
- if ((xkbDebugFlags&0x4)&&
- ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
- XkbStatePtr s= &xkbi->state;
- ErrorF("XKbFilterWriteEvents (non-XKB):\n");
- ErrorF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state);
- ErrorF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods,
- s->grab_mods);
- ErrorF("compat lookup= 0x%02x, grab= 0x%02x\n",
- s->compat_lookup_mods,
- s->compat_grab_mods);
- }
-#endif
- if ( (type>=KeyPress)&&(type<=MotionNotify) ) {
- CARD16 old,new;
-
- old= xE[i].u.keyButtonPointer.state&(~0x1f00);
- new= xE[i].u.keyButtonPointer.state&0x1F00;
-
- if (old==XkbStateFieldFromRec(&xkbi->state))
- new|= xkbi->state.compat_lookup_mods;
- else new|= xkbi->state.compat_grab_mods;
- xE[i].u.keyButtonPointer.state= new;
- }
- else if ((type==EnterNotify)||(type==LeaveNotify)) {
- xE->u.enterLeave.state&= 0x1F00;
- xE->u.enterLeave.state|= xkbi->state.compat_grab_mods;
- }
- button_mask = 1 << xE[i].u.u.detail;
- if (type == ButtonPress &&
- ((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
- (xkbi->lockedPtrButtons & button_mask) == button_mask) {
-#ifdef DEBUG
- ErrorF("Faking release of button %d\n", xE[i].u.u.detail);
-#endif
- XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail);
- }
- }
- }
- return True;
-}
-
-/***====================================================================***/
-
-XkbInterestPtr
-XkbFindClientResource(DevicePtr inDev,ClientPtr client)
-{
-DeviceIntPtr dev = (DeviceIntPtr)inDev;
-XkbInterestPtr interest;
-
- if ( dev->xkb_interest ) {
- interest = dev->xkb_interest;
- while (interest){
- if (interest->client==client) {
- return interest;
- }
- interest = interest->next;
- }
- }
- return NULL;
-}
-
-XkbInterestPtr
-XkbAddClientResource(DevicePtr inDev,ClientPtr client,XID id)
-{
-DeviceIntPtr dev = (DeviceIntPtr)inDev;
-XkbInterestPtr interest;
-
- interest = dev->xkb_interest;
- while (interest) {
- if (interest->client==client)
- return ((interest->resource==id)?interest:NULL);
- interest = interest->next;
- }
- interest = _XkbTypedAlloc(XkbInterestRec);
- bzero(interest,sizeof(XkbInterestRec));
- if (interest) {
- interest->dev = dev;
- interest->client = client;
- interest->resource = id;
- interest->stateNotifyMask= 0;
- interest->ctrlsNotifyMask= 0;
- interest->namesNotifyMask= 0;
- interest->compatNotifyMask= 0;
- interest->bellNotifyMask= FALSE;
- interest->accessXNotifyMask= 0;
- interest->iStateNotifyMask= 0;
- interest->iMapNotifyMask= 0;
- interest->altSymsNotifyMask= 0;
- interest->next = dev->xkb_interest;
- dev->xkb_interest= interest;
- return interest;
- }
- return NULL;
-}
-
-int
-XkbRemoveClient(DevicePtr inDev,ClientPtr client)
-{
-XkbSrvInfoPtr xkbi;
-DeviceIntPtr dev = (DeviceIntPtr)inDev;
-XkbInterestPtr interest;
-unsigned long autoCtrls,autoValues;
-Bool found;
-
- found= False;
- autoCtrls= autoValues= 0;
- if ( dev->xkb_interest ) {
- interest = dev->xkb_interest;
- if (interest && (interest->client==client)){
- dev->xkb_interest = interest->next;
- autoCtrls= interest->autoCtrls;
- autoValues= interest->autoCtrlValues;
- _XkbFree(interest);
- found= True;
- }
- while ((!found)&&(interest->next)) {
- if (interest->next->client==client) {
- XkbInterestPtr victim = interest->next;
- interest->next = victim->next;
- autoCtrls= victim->autoCtrls;
- autoValues= victim->autoCtrlValues;
- _XkbFree(victim);
- found= True;
- }
- interest = interest->next;
- }
- }
- if (found && autoCtrls && dev->key && dev->key->xkbInfo ) {
- XkbEventCauseRec cause;
-
- xkbi= dev->key->xkbInfo;
- XkbSetCauseXkbReq(&cause,X_kbPerClientFlags,client);
- XkbEnableDisableControls(xkbi,autoCtrls,autoValues,NULL,&cause);
- }
- return found;
-}
-
-int
-XkbRemoveResourceClient(DevicePtr inDev,XID id)
-{
-XkbSrvInfoPtr xkbi;
-DeviceIntPtr dev = (DeviceIntPtr)inDev;
-XkbInterestPtr interest;
-Bool found;
-unsigned long autoCtrls,autoValues;
-ClientPtr client = NULL;
-
- found= False;
- autoCtrls= autoValues= 0;
- if ( dev->xkb_interest ) {
- interest = dev->xkb_interest;
- if (interest && (interest->resource==id)){
- dev->xkb_interest = interest->next;
- autoCtrls= interest->autoCtrls;
- autoValues= interest->autoCtrlValues;
- client= interest->client;
- _XkbFree(interest);
- found= True;
- }
- while ((!found)&&(interest->next)) {
- if (interest->next->resource==id) {
- XkbInterestPtr victim = interest->next;
- interest->next = victim->next;
- autoCtrls= victim->autoCtrls;
- autoValues= victim->autoCtrlValues;
- client= victim->client;
- _XkbFree(victim);
- found= True;
- }
- interest = interest->next;
- }
- }
- if (found && autoCtrls && dev->key && dev->key->xkbInfo ) {
- XkbEventCauseRec cause;
-
- xkbi= dev->key->xkbInfo;
- XkbSetCauseXkbReq(&cause,X_kbPerClientFlags,client);
- XkbEnableDisableControls(xkbi,autoCtrls,autoValues,NULL,&cause);
- }
- return found;
-}
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
deleted file mode 100644
index 064311d5e..000000000
--- a/xkb/xkbInit.c
+++ /dev/null
@@ -1,1021 +0,0 @@
-/* $Xorg: xkbInit.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbInit.c,v 3.32 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include <X11/Xatom.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "opaque.h"
-#include "property.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "XKBgeom.h"
-#include <X11/extensions/XKMformat.h>
-#include <X11/extensions/XKBfile.h>
-#include "xkb.h"
-
-#define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1)
-
-#ifdef sgi
-#define LED_CAPS 5
-#define LED_NUM 6
-#define LED_SCROLL 7
-#define PHYS_LEDS 0x7f
-#define LED_COMPOSE 8
-#else
-#if defined(ultrix) || defined(__osf__) || defined(__alpha) || defined(__alpha__)
-#define LED_COMPOSE 2
-#define LED_CAPS 3
-#define LED_SCROLL 4
-#define LED_NUM 5
-#define PHYS_LEDS 0x1f
-#else
-#ifdef sun
-#define LED_NUM 1
-#define LED_SCROLL 2
-#define LED_COMPOSE 3
-#define LED_CAPS 4
-#define PHYS_LEDS 0x0f
-#else
-#define LED_CAPS 1
-#define LED_NUM 2
-#define LED_SCROLL 3
-#define PHYS_LEDS 0x07
-#endif
-#endif
-#endif
-
-#define MAX_TOC 16
-typedef struct _SrvXkmInfo {
- DeviceIntPtr dev;
- FILE * file;
- XkbFileInfo xkbinfo;
-} SrvXkmInfo;
-
-
-/***====================================================================***/
-
-#ifndef XKB_BASE_DIRECTORY
-#define XKB_BASE_DIRECTORY "/usr/lib/X11/xkb"
-#endif
-#ifndef XKB_DFLT_RULES_FILE
-#define XKB_DFLT_RULES_FILE "rules"
-#endif
-#ifndef XKB_DFLT_KB_LAYOUT
-#define XKB_DFLT_KB_LAYOUT "us"
-#endif
-#ifndef XKB_DFLT_KB_MODEL
-#define XKB_DFLT_KB_MODEL "dflt"
-#endif
-#ifndef XKB_DFLT_KB_VARIANT
-#define XKB_DFLT_KB_VARIANT NULL
-#endif
-#ifndef XKB_DFLT_KB_OPTIONS
-#define XKB_DFLT_KB_OPTIONS NULL
-#endif
-#ifndef XKB_DFLT_DISABLED
-#define XKB_DFLT_DISABLED True
-#endif
-#ifndef XKB_DFLT_RULES_PROP
-#define XKB_DFLT_RULES_PROP True
-#endif
-
-char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
-char * XkbInitialMap= NULL;
-int XkbWantAccessX= 0;
-static XkbFileInfo * _XkbInitFileInfo= NULL;
-char * XkbDB= NULL;
-int XkbAutoLoad= 1;
-
-static Bool rulesDefined= False;
-static char * XkbRulesFile= NULL;
-static char * XkbModelDflt= NULL;
-static char * XkbLayoutDflt= NULL;
-static char * XkbVariantDflt= NULL;
-static char * XkbOptionsDflt= NULL;
-
-char * XkbModelUsed= NULL;
-char * XkbLayoutUsed= NULL;
-char * XkbVariantUsed= NULL;
-char * XkbOptionsUsed= NULL;
-
-int _XkbClientMajor= XkbMajorVersion;
-int _XkbClientMinor= XkbMinorVersion;
-
-Bool noXkbExtension= XKB_DFLT_DISABLED;
-Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
-
-/***====================================================================***/
-
-char *
-XkbGetRulesDflts(XkbRF_VarDefsPtr defs)
-{
- if (XkbModelDflt) defs->model= XkbModelDflt;
- else defs->model= XKB_DFLT_KB_MODEL;
- if (XkbLayoutDflt) defs->layout= XkbLayoutDflt;
- else defs->layout= XKB_DFLT_KB_LAYOUT;
- if (XkbVariantDflt) defs->variant= XkbVariantDflt;
- else defs->variant= XKB_DFLT_KB_VARIANT;
- if (XkbOptionsDflt) defs->options= XkbOptionsDflt;
- else defs->options= XKB_DFLT_KB_OPTIONS;
- return (rulesDefined?XkbRulesFile:XKB_DFLT_RULES_FILE);
-}
-
-Bool
-XkbWriteRulesProp(ClientPtr client, pointer closure)
-{
-int len,out;
-Atom name;
-char * pval;
-
- if (rulesDefined && (!XkbRulesFile))
- return False;
- len= (XkbRulesFile?strlen(XkbRulesFile):strlen(XKB_DFLT_RULES_FILE));
- len+= (XkbModelUsed?strlen(XkbModelUsed):0);
- len+= (XkbLayoutUsed?strlen(XkbLayoutUsed):0);
- len+= (XkbVariantUsed?strlen(XkbVariantUsed):0);
- len+= (XkbOptionsUsed?strlen(XkbOptionsUsed):0);
- if (len<1)
- return True;
-
- len+= 5; /* trailing NULs */
-
- name= MakeAtom(_XKB_RF_NAMES_PROP_ATOM,strlen(_XKB_RF_NAMES_PROP_ATOM),1);
- if (name==None) {
- ErrorF("Atom error: %s not created\n",_XKB_RF_NAMES_PROP_ATOM);
- return True;
- }
- pval= (char*) ALLOCATE_LOCAL(len);
- if (!pval) {
- ErrorF("Allocation error: %s proprerty not created\n",
- _XKB_RF_NAMES_PROP_ATOM);
- return True;
- }
- out= 0;
- if (XkbRulesFile) {
- strcpy(&pval[out],XkbRulesFile);
- out+= strlen(XkbRulesFile);
- }
- pval[out++]= '\0';
- if (XkbModelUsed) {
- strcpy(&pval[out],XkbModelUsed);
- out+= strlen(XkbModelUsed);
- }
- pval[out++]= '\0';
- if (XkbLayoutUsed) {
- strcpy(&pval[out],XkbLayoutUsed);
- out+= strlen(XkbLayoutUsed);
- }
- pval[out++]= '\0';
- if (XkbVariantUsed) {
- strcpy(&pval[out],XkbVariantUsed);
- out+= strlen(XkbVariantUsed);
- }
- pval[out++]= '\0';
- if (XkbOptionsUsed) {
- strcpy(&pval[out],XkbOptionsUsed);
- out+= strlen(XkbOptionsUsed);
- }
- pval[out++]= '\0';
- if (out!=len) {
- ErrorF("Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n",
- out,len);
- }
- ChangeWindowProperty(WindowTable[0],name,XA_STRING,8,PropModeReplace,
- len,pval,True);
- DEALLOCATE_LOCAL(pval);
- return True;
-}
-
-void
-XkbSetRulesUsed(XkbRF_VarDefsPtr defs)
-{
- if (XkbModelUsed)
- _XkbFree(XkbModelUsed);
- XkbModelUsed= (defs->model?_XkbDupString(defs->model):NULL);
- if (XkbLayoutUsed)
- _XkbFree(XkbLayoutUsed);
- XkbLayoutUsed= (defs->layout?_XkbDupString(defs->layout):NULL);
- if (XkbVariantUsed)
- _XkbFree(XkbVariantUsed);
- XkbVariantUsed= (defs->variant?_XkbDupString(defs->variant):NULL);
- if (XkbOptionsUsed)
- _XkbFree(XkbOptionsUsed);
- XkbOptionsUsed= (defs->options?_XkbDupString(defs->options):NULL);
- if (XkbWantRulesProp)
- QueueWorkProc(XkbWriteRulesProp,NULL,NULL);
- return;
-}
-
-void
-XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
- char *variant,char *options)
-{
- if (XkbRulesFile)
- _XkbFree(XkbRulesFile);
- XkbRulesFile= _XkbDupString(rulesFile);
- rulesDefined= True;
- if (model) {
- if (XkbModelDflt)
- _XkbFree(XkbModelDflt);
- XkbModelDflt= _XkbDupString(model);
- }
- if (layout) {
- if (XkbLayoutDflt)
- _XkbFree(XkbLayoutDflt);
- XkbLayoutDflt= _XkbDupString(layout);
- }
- if (variant) {
- if (XkbVariantDflt)
- _XkbFree(XkbVariantDflt);
- XkbVariantDflt= _XkbDupString(variant);
- }
- if (options) {
- if (XkbOptionsDflt)
- _XkbFree(XkbOptionsDflt);
- XkbOptionsDflt= _XkbDupString(options);
- }
- return;
-}
-
-/***====================================================================***/
-
-#if defined(luna)
-#define XKB_DDX_PERMANENT_LOCK 1
-#endif
-
-#include "xkbDflts.h"
-
-/* A dummy to keep the compiler quiet */
-pointer xkbBogus = &indicators;
-
-static Bool
-XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file)
-{
- if (file->xkbinfo.defined&XkmTypesMask)
- return True;
- initTypeNames(NULL);
- if (XkbAllocClientMap(xkb,XkbKeyTypesMask,num_dflt_types)!=Success)
- return False;
- if (XkbCopyKeyTypes(dflt_types,xkb->map->types,num_dflt_types)!=
- Success) {
- return False;
- }
- xkb->map->size_types= xkb->map->num_types= num_dflt_types;
- return True;
-}
-
-static void
-XkbInitRadioGroups(XkbSrvInfoPtr xkbi,SrvXkmInfo *file)
-{
- xkbi->nRadioGroups = 0;
- xkbi->radioGroups = NULL;
- return;
-}
-
-
-static Status
-XkbInitCompatStructs(XkbDescPtr xkb,SrvXkmInfo *file)
-{
-register int i;
-XkbCompatMapPtr compat;
-
- if (file->xkbinfo.defined&XkmCompatMapMask)
- return Success;
- if (XkbAllocCompatMap(xkb,XkbAllCompatMask,num_dfltSI)!=Success)
- return BadAlloc;
- compat = xkb->compat;
- if (compat->sym_interpret) {
- compat->num_si = num_dfltSI;
- memcpy((char *)compat->sym_interpret,(char *)dfltSI,sizeof(dfltSI));
- }
- for (i=0;i<XkbNumKbdGroups;i++) {
- compat->groups[i]= compatMap.groups[i];
- if (compat->groups[i].vmods!=0) {
- unsigned mask;
- mask= XkbMaskForVMask(xkb,compat->groups[i].vmods);
- compat->groups[i].mask= compat->groups[i].real_mods|mask;
- }
- else compat->groups[i].mask= compat->groups[i].real_mods;
- }
- return Success;
-}
-
-static void
-XkbInitSemantics(XkbDescPtr xkb,SrvXkmInfo *file)
-{
- XkbInitKeyTypes(xkb,file);
- XkbInitCompatStructs(xkb,file);
- return;
-}
-
-/***====================================================================***/
-
-static Status
-XkbInitNames(XkbSrvInfoPtr xkbi,SrvXkmInfo *file)
-{
-XkbDescPtr xkb;
-XkbNamesPtr names;
-Status rtrn;
-Atom unknown;
-
- xkb= xkbi->desc;
- if ((rtrn=XkbAllocNames(xkb,XkbAllNamesMask,0,0))!=Success)
- return rtrn;
- unknown= CREATE_ATOM("unknown");
- names = xkb->names;
- if (names->keycodes==None) names->keycodes= unknown;
- if (names->geometry==None) names->geometry= unknown;
- if (names->phys_symbols==None) names->phys_symbols= unknown;
- if (names->symbols==None) names->symbols= unknown;
- if (names->types==None) names->types= unknown;
- if (names->compat==None) names->compat= unknown;
- if ((file->xkbinfo.defined&XkmVirtualModsMask)==0) {
- if (names->vmods[vmod_NumLock]==None)
- names->vmods[vmod_NumLock]= CREATE_ATOM("NumLock");
- if (names->vmods[vmod_Alt]==None)
- names->vmods[vmod_Alt]= CREATE_ATOM("Alt");
- if (names->vmods[vmod_AltGr]==None)
- names->vmods[vmod_AltGr]= CREATE_ATOM("ModeSwitch");
- }
-
- if (((file->xkbinfo.defined&XkmIndicatorsMask)==0)||
- ((file->xkbinfo.defined&XkmGeometryMask)==0)) {
- initIndicatorNames(NULL,xkb);
- if (names->indicators[LED_CAPS-1]==None)
- names->indicators[LED_CAPS-1] = CREATE_ATOM("Caps Lock");
- if (names->indicators[LED_NUM-1]==None)
- names->indicators[LED_NUM-1] = CREATE_ATOM("Num Lock");
- if (names->indicators[LED_SCROLL-1]==None)
- names->indicators[LED_SCROLL-1] = CREATE_ATOM("Scroll Lock");
-#ifdef LED_COMPOSE
- if (names->indicators[LED_COMPOSE-1]==None)
- names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose");
-#endif
- }
-#ifdef DEBUG_RADIO_GROUPS
- if (names->num_rg<1) {
- names->radio_groups= (Atom *)_XkbCalloc(RG_COUNT, sizeof(Atom));
- if (names->radio_groups) {
- names->num_rg = RG_COUNT;
- names->radio_groups[RG_BOGUS_FUNCTION_GROUP]= CREATE_ATOM("BOGUS");
- }
- }
-#endif
- if (xkb->geom!=NULL)
- names->geometry= xkb->geom->name;
- else names->geometry= unknown;
- return Success;
-}
-
-static Status
-XkbInitIndicatorMap(XkbSrvInfoPtr xkbi,SrvXkmInfo *file)
-{
-XkbDescPtr xkb;
-XkbIndicatorPtr map;
-XkbSrvLedInfoPtr sli;
-
- xkb= xkbi->desc;
- if (XkbAllocIndicatorMaps(xkb)!=Success)
- return BadAlloc;
- if ((file->xkbinfo.defined&XkmIndicatorsMask)==0) {
- map= xkb->indicators;
- map->phys_indicators = PHYS_LEDS;
- map->maps[LED_CAPS-1].flags= XkbIM_NoExplicit;
- map->maps[LED_CAPS-1].which_mods= XkbIM_UseLocked;
- map->maps[LED_CAPS-1].mods.mask= LockMask;
- map->maps[LED_CAPS-1].mods.real_mods= LockMask;
-
- map->maps[LED_NUM-1].flags= XkbIM_NoExplicit;
- map->maps[LED_NUM-1].which_mods= XkbIM_UseLocked;
- map->maps[LED_NUM-1].mods.mask= 0;
- map->maps[LED_NUM-1].mods.real_mods= 0;
- map->maps[LED_NUM-1].mods.vmods= vmod_NumLockMask;
-
-/* Metro Link */
- map->maps[LED_SCROLL-1].flags= XkbIM_NoExplicit;
- map->maps[LED_SCROLL-1].which_mods= XkbIM_UseLocked;
- map->maps[LED_SCROLL-1].mods.mask= Mod3Mask;
- map->maps[LED_SCROLL-1].mods.real_mods= Mod3Mask;
-/* Metro Link */
- }
- sli= XkbFindSrvLedInfo(xkbi->device,XkbDfltXIClass,XkbDfltXIId,0);
- if (sli)
- XkbCheckIndicatorMaps(xkbi->device,sli,XkbAllIndicatorsMask);
- return Success;
-}
-
-static Status
-XkbInitControls(DeviceIntPtr pXDev,XkbSrvInfoPtr xkbi,SrvXkmInfo *file)
-{
-XkbDescPtr xkb;
-XkbControlsPtr ctrls;
-
- xkb= xkbi->desc;
- /* 12/31/94 (ef) -- XXX! Should check if controls loaded from file */
- if (XkbAllocControls(xkb,XkbAllControlsMask)!=Success)
- FatalError("Couldn't allocate keyboard controls\n");
- ctrls= xkb->ctrls;
- if ((file->xkbinfo.defined&XkmSymbolsMask)==0)
- ctrls->num_groups = 1;
- ctrls->groups_wrap = XkbSetGroupInfo(1,XkbWrapIntoRange,0);
- ctrls->internal.mask = 0;
- ctrls->internal.real_mods = 0;
- ctrls->internal.vmods = 0;
- ctrls->ignore_lock.mask = 0;
- ctrls->ignore_lock.real_mods = 0;
- ctrls->ignore_lock.vmods = 0;
- ctrls->enabled_ctrls = XkbAccessXTimeoutMask|XkbRepeatKeysMask|
- XkbMouseKeysAccelMask|XkbAudibleBellMask|
- XkbIgnoreGroupLockMask;
- if (XkbWantAccessX)
- ctrls->enabled_ctrls|= XkbAccessXKeysMask;
- AccessXInit(pXDev);
- return Success;
-}
-
-void
-XkbInitDevice(DeviceIntPtr pXDev)
-{
-int i;
-XkbSrvInfoPtr xkbi;
-XkbChangesRec changes;
-SrvXkmInfo file;
-unsigned check;
-XkbEventCauseRec cause;
-
- file.dev= pXDev;
- file.file=NULL;
- bzero(&file.xkbinfo,sizeof(XkbFileInfo));
- bzero(&changes,sizeof(XkbChangesRec));
- if (XkbAutoLoad && (XkbInitialMap!=NULL)) {
- if ((file.file=XkbDDXOpenConfigFile(XkbInitialMap,NULL,0))!=NULL) {
- XkmReadFile(file.file,0,XkmKeymapLegal,&file.xkbinfo);
- if (file.xkbinfo.xkb==NULL) {
- LogMessage(X_ERROR,
- "Error loading keymap file %s (%s in %s)\n"
- "\treverting to defaults\n",
- XkbInitialMap, _XkbErrMessages[_XkbErrCode],
- (_XkbErrLocation?_XkbErrLocation:"unknown"));
- fclose(file.file);
- file.file= NULL;
- bzero(&file.xkbinfo,sizeof(XkbFileInfo));
- }
- else {
- if (_XkbInitFileInfo!=NULL) {
- XkbDescPtr tmp;
- if ((tmp=_XkbInitFileInfo->xkb)!=NULL) {
- XkbFreeKeyboard(tmp,XkbAllComponentsMask,True);
- _XkbInitFileInfo->xkb= NULL;
- }
- }
- _XkbInitFileInfo= &file.xkbinfo;
- }
- }
- else {
- LogMessage(X_ERROR, "Error opening keymap file %s, reverting to defaults\n",
- XkbInitialMap);
- }
- }
- pXDev->key->xkbInfo= xkbi= _XkbTypedCalloc(1,XkbSrvInfoRec);
- if ( xkbi ) {
- XkbDescPtr xkb;
- if ((_XkbInitFileInfo!=NULL)&&(_XkbInitFileInfo->xkb!=NULL)) {
- file.xkbinfo= *_XkbInitFileInfo;
- xkbi->desc= _XkbInitFileInfo->xkb;
- _XkbInitFileInfo= NULL;
- }
- else {
- xkbi->desc= XkbAllocKeyboard();
- if (!xkbi->desc)
- FatalError("Couldn't allocate keyboard description\n");
- xkbi->desc->min_key_code = pXDev->key->curKeySyms.minKeyCode;
- xkbi->desc->max_key_code = pXDev->key->curKeySyms.maxKeyCode;
- }
- xkb= xkbi->desc;
- if (xkb->min_key_code == 0)
- xkb->min_key_code = pXDev->key->curKeySyms.minKeyCode;
- if (xkb->max_key_code == 0)
- xkb->max_key_code = pXDev->key->curKeySyms.maxKeyCode;
- if ((pXDev->key->curKeySyms.minKeyCode!=xkbi->desc->min_key_code)||
- (pXDev->key->curKeySyms.maxKeyCode!=xkbi->desc->max_key_code)) {
- /* 12/9/95 (ef) -- XXX! Maybe we should try to fix up one or */
- /* the other here, but for now just complain */
- /* can't just update the core range without */
- /* reallocating the KeySymsRec (pain) */
- ErrorF("Internal Error!! XKB and core keymap have different range\n");
- }
- if (XkbAllocClientMap(xkb,XkbAllClientInfoMask,0)!=Success)
- FatalError("Couldn't allocate client map in XkbInitDevice\n");
- i= XkbNumKeys(xkb)/3+1;
- if (XkbAllocServerMap(xkb,XkbAllServerInfoMask,i)!=Success)
- FatalError("Couldn't allocate server map in XkbInitDevice\n");
-
- xkbi->dfltPtrDelta=1;
- xkbi->device = pXDev;
-
- file.xkbinfo.xkb= xkb;
- XkbInitSemantics(xkb,&file);
- XkbInitNames(xkbi,&file);
- XkbInitRadioGroups(xkbi,&file);
-
- /* 12/31/94 (ef) -- XXX! Should check if state loaded from file */
- bzero(&xkbi->state,sizeof(XkbStateRec));
-
- XkbInitControls(pXDev,xkbi,&file);
-
- if (file.xkbinfo.defined&XkmSymbolsMask)
- memcpy(pXDev->key->modifierMap,xkb->map->modmap,xkb->max_key_code+1);
- else
- memcpy(xkb->map->modmap,pXDev->key->modifierMap,xkb->max_key_code+1);
-
- XkbInitIndicatorMap(xkbi,&file);
-
- XkbDDXInitDevice(pXDev);
-
- if (!(file.xkbinfo.defined&XkmSymbolsMask)) {
- XkbUpdateKeyTypesFromCore(pXDev,xkb->min_key_code,XkbNumKeys(xkb),
- &changes);
- }
- else {
- XkbUpdateCoreDescription(pXDev,True);
- }
- XkbSetCauseUnknown(&cause);
- XkbUpdateActions(pXDev,xkb->min_key_code, XkbNumKeys(xkb),&changes,
- &check,&cause);
- /* For sanity. The first time the connection
- * is opened, the client side min and max are set
- * using QueryMinMaxKeyCodes() which grabs them
- * from pXDev.
- */
- pXDev->key->curKeySyms.minKeyCode = xkb->min_key_code;
- pXDev->key->curKeySyms.maxKeyCode = xkb->max_key_code;
- }
- if (file.file!=NULL)
- fclose(file.file);
- return;
-}
-
-#if MAP_LENGTH > XkbMaxKeyCount
-#undef XkbMaxKeyCount
-#define XkbMaxKeyCount MAP_LENGTH
-#endif
-
-Bool
-XkbInitKeyboardDeviceStruct(
- DeviceIntPtr dev,
- XkbComponentNamesPtr names,
- KeySymsPtr pSymsIn,
- CARD8 pModsIn[],
- void (*bellProc)(
- int /*percent*/,
- DeviceIntPtr /*device*/,
- pointer /*ctrl*/,
- int),
- void (*ctrlProc)(
- DeviceIntPtr /*device*/,
- KeybdCtrl * /*ctrl*/))
-{
-XkbFileInfo finfo;
-KeySymsRec tmpSyms,*pSyms;
-CARD8 tmpMods[XkbMaxLegalKeyCode+1],*pMods;
-char name[PATH_MAX],*rules;
-Bool ok=False;
-XPointer config;
-XkbComponentNamesRec cfgNames;
-XkbRF_VarDefsRec defs;
-
- if ((dev->key!=NULL)||(dev->kbdfeed!=NULL))
- return False;
- pSyms= pSymsIn;
- pMods= pModsIn;
- bzero(&defs,sizeof(XkbRF_VarDefsRec));
- bzero(&cfgNames,sizeof(XkbComponentNamesRec));
- rules= XkbGetRulesDflts(&defs);
- config= XkbDDXPreloadConfig(&rules,&defs,&cfgNames,dev);
-
- /*
- * The strings are duplicated because it is not guaranteed that
- * they are allocated, or that they are allocated for every server
- * generation. Eventually they will be freed at the end of this
- * function.
- */
- if (names->keymap) names->keymap = _XkbDupString(names->keymap);
- if (names->keycodes) names->keycodes = _XkbDupString(names->keycodes);
- if (names->types) names->types = _XkbDupString(names->types);
- if (names->compat) names->compat = _XkbDupString(names->compat);
- if (names->geometry) names->geometry = _XkbDupString(names->geometry);
- if (names->symbols) names->symbols = _XkbDupString(names->symbols);
-
- if (defs.model && defs.layout && rules) {
- XkbComponentNamesRec rNames;
- bzero(&rNames,sizeof(XkbComponentNamesRec));
- if (XkbDDXNamesFromRules(dev,rules,&defs,&rNames)) {
- if (rNames.keymap) {
- if (!names->keymap)
- names->keymap = rNames.keymap;
- else _XkbFree(rNames.keymap);
- }
- if (rNames.keycodes) {
- if (!names->keycodes)
- names->keycodes = rNames.keycodes;
- else
- _XkbFree(rNames.keycodes);
- }
- if (rNames.types) {
- if (!names->types)
- names->types = rNames.types;
- else _XkbFree(rNames.types);
- }
- if (rNames.compat) {
- if (!names->compat)
- names->compat = rNames.compat;
- else _XkbFree(rNames.compat);
- }
- if (rNames.symbols) {
- if (!names->symbols)
- names->symbols = rNames.symbols;
- else _XkbFree(rNames.symbols);
- }
- if (rNames.geometry) {
- if (!names->geometry)
- names->geometry = rNames.geometry;
- else _XkbFree(rNames.geometry);
- }
- XkbSetRulesUsed(&defs);
- }
- }
- if (cfgNames.keymap){
- if (names->keymap) _XkbFree(names->keymap);
- names->keymap= cfgNames.keymap;
- }
- if (cfgNames.keycodes){
- if (names->keycodes) _XkbFree(names->keycodes);
- names->keycodes= cfgNames.keycodes;
- }
- if (cfgNames.types) {
- if (names->types) _XkbFree(names->types);
- names->types= cfgNames.types;
- }
- if (cfgNames.compat) {
- if (names->compat) _XkbFree(names->compat);
- names->compat= cfgNames.compat;
- }
- if (cfgNames.symbols){
- if (names->symbols) _XkbFree(names->symbols);
- names->symbols= cfgNames.symbols;
- }
- if (cfgNames.geometry) {
- if (names->geometry) _XkbFree(names->geometry);
- names->geometry= cfgNames.geometry;
- }
-
- if (names->keymap) {
- XkbComponentNamesRec tmpNames;
- bzero(&tmpNames,sizeof(XkbComponentNamesRec));
- tmpNames.keymap = names->keymap;
- ok = (Bool) XkbDDXLoadKeymapByNames(dev,&tmpNames,XkmAllIndicesMask,0,
- &finfo,name,PATH_MAX);
- }
- if (!(ok && (finfo.xkb!=NULL)))
- ok = (Bool) XkbDDXLoadKeymapByNames(dev,names,XkmAllIndicesMask,0,
- &finfo,name,PATH_MAX);
-
- if (ok && (finfo.xkb!=NULL)) {
- XkbDescPtr xkb;
- int minKC,maxKC;
-
- xkb= finfo.xkb;
- minKC= xkb->min_key_code;
- maxKC= xkb->max_key_code;
- if (XkbIsLegalKeycode(minKC)&&XkbIsLegalKeycode(maxKC)&&(minKC<=maxKC)&&
- ((minKC!=pSyms->minKeyCode)||(maxKC!=pSyms->maxKeyCode))) {
- if (xkb->map!=NULL) {
- KeySym *inSym,*outSym;
- int width= pSymsIn->mapWidth;
-
- tmpSyms.minKeyCode= minKC;
- tmpSyms.maxKeyCode= maxKC;
-
- if (minKC<pSymsIn->minKeyCode)
- minKC= pSymsIn->minKeyCode;
- if (maxKC>pSymsIn->maxKeyCode)
- maxKC= pSymsIn->maxKeyCode;
-
- tmpSyms.mapWidth= width;
- tmpSyms.map= _XkbTypedCalloc(width*XkbNumKeys(xkb),KeySym);
- inSym= &pSymsIn->map[(minKC-pSymsIn->minKeyCode)*width];
- outSym= &tmpSyms.map[(minKC-tmpSyms.minKeyCode)*width];
- memcpy(outSym,inSym,((maxKC-minKC+1)*width)*sizeof(KeySym));
- pSyms= &tmpSyms;
- }
- if ((xkb->map!=NULL)&&(xkb->map->modmap!=NULL)) {
- bzero(tmpMods,XkbMaxKeyCount);
- memcpy(tmpMods,xkb->map->modmap,maxKC+1);
- pMods= tmpMods;
- }
- }
- _XkbInitFileInfo= &finfo;
- }
- else {
- LogMessage(X_ERROR, "Couldn't load XKB keymap, falling back to pre-XKB keymap\n");
- }
- ok= InitKeyboardDeviceStruct((DevicePtr)dev,pSyms,pMods,bellProc,ctrlProc);
- if ((config!=NULL)&&(dev && dev->key && dev->key->xkbInfo))
- XkbDDXApplyConfig(config,dev->key->xkbInfo);
- _XkbInitFileInfo= NULL;
- if ((pSyms==&tmpSyms)&&(pSyms->map!=NULL)) {
- _XkbFree(pSyms->map);
- pSyms->map= NULL;
- }
-
- if (names->keymap) _XkbFree(names->keymap);
- names->keymap = NULL;
- if (names->keycodes) _XkbFree(names->keycodes);
- names->keycodes = NULL;
- if (names->types) _XkbFree(names->types);
- names->types = NULL;
- if (names->compat) _XkbFree(names->compat);
- names->compat = NULL;
- if (names->geometry) _XkbFree(names->geometry);
- names->geometry = NULL;
- if (names->symbols) _XkbFree(names->symbols);
- names->symbols = NULL;
-
- return ok;
-}
-
-/***====================================================================***/
-
- /*
- * InitKeyClassDeviceStruct initializes the key class before it
- * initializes the keyboard feedback class for a device.
- * UpdateActions can't set up the correct autorepeat for keyboard
- * initialization because the keyboard feedback isn't created yet.
- * Instead, UpdateActions notes the "correct" autorepeat in the
- * SrvInfo structure and InitKbdFeedbackClass calls UpdateAutoRepeat
- * to apply the computed autorepeat once the feedback class exists.
- *
- * DIX will apply the changed autorepeat, so there's no need to
- * do so here. This function returns True if both RepeatKeys and
- * the core protocol autorepeat ctrls are set (i.e. should use
- * software autorepeat), false otherwise.
- *
- * This function also computes the autorepeat accelerators for the
- * default indicator feedback.
- */
-int
-XkbFinishDeviceInit(DeviceIntPtr pXDev)
-{
-XkbSrvInfoPtr xkbi;
-XkbDescPtr xkb;
-int softRepeat;
-XkbSrvLedInfoPtr sli;
-
- xkbi = NULL;
- if (pXDev && pXDev->key && pXDev->key->xkbInfo && pXDev->kbdfeed) {
- xkbi= pXDev->key->xkbInfo;
- xkb= xkbi->desc;
- if (pXDev->kbdfeed) {
- xkbi->kbdProc= pXDev->kbdfeed->CtrlProc;
- pXDev->kbdfeed->CtrlProc= XkbDDXKeybdCtrlProc;
- }
- if (pXDev->kbdfeed->ctrl.autoRepeat)
- xkb->ctrls->enabled_ctrls|= XkbRepeatKeysMask;
- softRepeat= (xkb->ctrls->enabled_ctrls&XkbRepeatKeysMask)!=0;
- if (pXDev->kbdfeed) {
- memcpy(pXDev->kbdfeed->ctrl.autoRepeats,
- xkb->ctrls->per_key_repeat,XkbPerKeyBitArraySize);
- softRepeat= softRepeat&&pXDev->kbdfeed->ctrl.autoRepeat;
- }
- }
- else softRepeat= 0;
- sli= XkbFindSrvLedInfo(pXDev,XkbDfltXIClass,XkbDfltXIId,0);
- if (sli && xkbi)
- XkbCheckIndicatorMaps(xkbi->device,sli,XkbAllIndicatorsMask);
-#ifdef DEBUG
- else ErrorF("No indicator feedback in XkbFinishInit (shouldn't happen)!\n");
-#endif
- return softRepeat;
-}
-
- /*
- * Be very careful about what does and doesn't get freed by this
- * function. To reduce fragmentation, XkbInitDevice allocates a
- * single huge block per device and divides it up into most of the
- * fixed-size structures for the device. Don't free anything that
- * is part of this larger block.
- */
-void
-XkbFreeInfo(XkbSrvInfoPtr xkbi)
-{
- if (xkbi->radioGroups) {
- _XkbFree(xkbi->radioGroups);
- xkbi->radioGroups= NULL;
- }
- if (xkbi->mouseKeyTimer) {
- TimerFree(xkbi->mouseKeyTimer);
- xkbi->mouseKeyTimer= NULL;
- }
- if (xkbi->slowKeysTimer) {
- TimerFree(xkbi->slowKeysTimer);
- xkbi->slowKeysTimer= NULL;
- }
- if (xkbi->bounceKeysTimer) {
- TimerFree(xkbi->bounceKeysTimer);
- xkbi->bounceKeysTimer= NULL;
- }
- if (xkbi->repeatKeyTimer) {
- TimerFree(xkbi->repeatKeyTimer);
- xkbi->repeatKeyTimer= NULL;
- }
- if (xkbi->krgTimer) {
- TimerFree(xkbi->krgTimer);
- xkbi->krgTimer= NULL;
- }
- xkbi->beepType= _BEEP_NONE;
- if (xkbi->beepTimer) {
- TimerFree(xkbi->beepTimer);
- xkbi->beepTimer= NULL;
- }
- if (xkbi->desc) {
- XkbFreeKeyboard(xkbi->desc,XkbAllComponentsMask,True);
- xkbi->desc= NULL;
- }
- _XkbFree(xkbi);
- return;
-}
-
-/***====================================================================***/
-
-extern int XkbDfltRepeatDelay;
-extern int XkbDfltRepeatInterval;
-
-extern unsigned short XkbDfltAccessXTimeout;
-extern unsigned int XkbDfltAccessXTimeoutMask;
-extern unsigned int XkbDfltAccessXFeedback;
-extern unsigned char XkbDfltAccessXOptions;
-
-int
-XkbProcessArguments(int argc,char *argv[],int i)
-{
- if (strcmp(argv[i],"-kb")==0) {
- noXkbExtension= True;
- return 1;
- }
- else if (strcmp(argv[i],"+kb")==0) {
- noXkbExtension= False;
- return 1;
- }
- else if (strncmp(argv[i], "-xkbdir", 7) == 0) {
- if(++i < argc) {
-#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__)
- if (getuid() != geteuid()) {
- LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n");
- return -1;
- } else
-#endif
- {
- if (strlen(argv[i]) < PATH_MAX) {
- XkbBaseDirectory= argv[i];
- return 2;
- } else {
- LogMessage(X_ERROR, "-xkbdir pathname too long\n");
- return -1;
- }
- }
- }
- else {
- return -1;
- }
- }
- else if (strncmp(argv[i], "-xkbmap", 7) == 0) {
- if(++i < argc) {
- if (strlen(argv[i]) < PATH_MAX) {
- XkbInitialMap= argv[i];
- return 2;
- } else {
- LogMessage(X_ERROR, "-xkbmap pathname too long\n");
- return -1;
- }
- }
- else {
- return -1;
- }
- }
- else if (strncmp(argv[i], "-xkbdb", 7) == 0) {
- if(++i < argc) {
- if (strlen(argv[i]) < PATH_MAX) {
- XkbDB= argv[i];
- return 2;
- } else {
- LogMessage(X_ERROR, "-xkbdb pathname too long\n");
- return -1;
- }
- }
- else {
- return -1;
- }
- }
- else if (strncmp(argv[i], "-noloadxkb", 7) == 0) {
- XkbAutoLoad= 0;
- return 1;
- }
- else if ((strncmp(argv[i],"-accessx",8)==0)||
- (strncmp(argv[i],"+accessx",8)==0)) {
- int j=1;
- if (argv[i][0]=='-')
- XkbWantAccessX= 0;
- else {
- XkbWantAccessX= 1;
-
- if ( ((i+1)<argc) && (isdigit(argv[i+1][0])) ) {
- XkbDfltAccessXTimeout = atoi(argv[++i]);
- j++;
-
- if ( ((i+1)<argc) && (isdigit(argv[i+1][0])) ) {
- /*
- * presumption that the reasonably useful range of
- * values fits in 0..MAXINT since SunOS 4 doesn't
- * have strtoul.
- */
- XkbDfltAccessXTimeoutMask=(unsigned int)
- strtol(argv[++i],NULL,16);
- j++;
- }
- if ( ((i+1)<argc) && (isdigit(argv[i+1][0])) ) {
- if (argv[++i][0] == '1' )
- XkbDfltAccessXFeedback=XkbAccessXFeedbackMask;
- else
- XkbDfltAccessXFeedback=0;
- j++;
- }
- if ( ((i+1)<argc) && (isdigit(argv[i+1][0])) ) {
- XkbDfltAccessXOptions=(unsigned char)
- strtol(argv[++i],NULL,16);
- j++;
- }
- }
- }
- return j;
- }
- if (strcmp (argv[i], "-ar1") == 0) { /* -ar1 int */
- if (++i >= argc) UseMsg ();
- XkbDfltRepeatDelay = (long)atoi(argv[i]);
- return 2;
- }
- if (strcmp (argv[i], "-ar2") == 0) { /* -ar2 int */
- if (++i >= argc) UseMsg ();
- XkbDfltRepeatInterval = (long)atoi(argv[i]);
- return 2;
- }
- return 0;
-}
-
-void
-XkbUseMsg(void)
-{
- ErrorF("The X Keyboard Extension adds the following arguments:\n");
- ErrorF("-kb disable the X Keyboard Extension\n");
- ErrorF("+kb enable the X Keyboard Extension\n");
- ErrorF("[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ]\n");
- ErrorF(" enable/disable accessx key sequences\n");
- ErrorF("-ar1 set XKB autorepeat delay\n");
- ErrorF("-ar2 set XKB autorepeat interval\n");
- ErrorF("-noloadxkb don't load XKB keymap description\n");
- ErrorF("-xkbdb file that contains default XKB keymaps\n");
- ErrorF("-xkbmap XKB keyboard description to load on startup\n");
-}
diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
deleted file mode 100644
index f75db6918..000000000
--- a/xkb/xkbLEDs.c
+++ /dev/null
@@ -1,1063 +0,0 @@
-/* $Xorg: xkbLEDs.c,v 1.4 2001/05/10 19:54:01 steve Exp $ */
-/************************************************************
-Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbLEDs.c,v 3.8 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "inputstr.h"
-
-#include "XI.h"
-#include "XKBsrv.h"
-#include "xkb.h"
-
-/***====================================================================***/
-
- /*
- * unsigned
- * XkbIndicatorsToUpdate(dev,changed,check_devs_rtrn)
- *
- * Given a keyboard and a set of state components that have changed,
- * this function returns the indicators on the default keyboard
- * feedback that might be affected. It also reports whether or not
- * any extension devices might be affected in check_devs_rtrn.
- */
-
-unsigned
-XkbIndicatorsToUpdate( DeviceIntPtr dev,
- unsigned long state_changes,
- Bool enable_changes)
-{
-register unsigned update= 0;
-XkbSrvLedInfoPtr sli;
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
-
- if (state_changes&(XkbModifierStateMask|XkbGroupStateMask))
- update|= sli->usesEffective;
- if (state_changes&(XkbModifierBaseMask|XkbGroupBaseMask))
- update|= sli->usesBase;
- if (state_changes&(XkbModifierLatchMask|XkbGroupLatchMask))
- update|= sli->usesLatched;
- if (state_changes&(XkbModifierLockMask|XkbGroupLockMask))
- update|= sli->usesLocked;
- if (state_changes&XkbCompatStateMask)
- update|= sli->usesCompat;
- if (enable_changes)
- update|= sli->usesControls;
- return update;
-}
-
-/***====================================================================***/
-
- /*
- * Bool
- * XkbApplyLEDChangeToKeyboard(xkbi,map,on,change)
- *
- * Some indicators "drive" the keyboard when their state is explicitly
- * changed, as described in section 9.2.1 of the XKB protocol spec.
- * This function updates the state and controls for the keyboard
- * specified by 'xkbi' to reflect any changes that are required
- * when the indicator described by 'map' is turned on or off. The
- * extent of the changes is reported in change, which must be defined.
- */
-Bool
-XkbApplyLEDChangeToKeyboard( XkbSrvInfoPtr xkbi,
- XkbIndicatorMapPtr map,
- Bool on,
- XkbChangesPtr change)
-{
-Bool ctrlChange,stateChange;
-XkbStatePtr state;
-
- if ((map->flags&XkbIM_NoExplicit)||((map->flags&XkbIM_LEDDrivesKB)==0))
- return False;
- ctrlChange= stateChange= False;
- if (map->ctrls) {
- XkbControlsPtr ctrls= xkbi->desc->ctrls;
- unsigned old;
-
- old= ctrls->enabled_ctrls;
- if (on) ctrls->enabled_ctrls|= map->ctrls;
- else ctrls->enabled_ctrls&= ~map->ctrls;
- if (old!=ctrls->enabled_ctrls) {
- change->ctrls.changed_ctrls= XkbControlsEnabledMask;
- change->ctrls.enabled_ctrls_changes= old^ctrls->enabled_ctrls;
- ctrlChange= True;
- }
- }
- state= &xkbi->state;
- if ((map->groups)&&((map->which_groups&(~XkbIM_UseBase))!=0)) {
- register int i;
- register unsigned bit,match;
-
- if (on) match= (map->groups)&XkbAllGroupsMask;
- else match= (~map->groups)&XkbAllGroupsMask;
- if (map->which_groups&(XkbIM_UseLocked|XkbIM_UseEffective)) {
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if (bit&match)
- break;
- }
- if (map->which_groups&XkbIM_UseLatched)
- XkbLatchGroup(xkbi->device,0); /* unlatch group */
- state->locked_group= i;
- stateChange= True;
- }
- else if (map->which_groups&(XkbIM_UseLatched|XkbIM_UseEffective)) {
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- if (bit&match)
- break;
- }
- state->locked_group= 0;
- XkbLatchGroup(xkbi->device,i);
- stateChange= True;
- }
- }
- if ((map->mods.mask)&&((map->which_mods&(~XkbIM_UseBase))!=0)) {
- if (map->which_mods&(XkbIM_UseLocked|XkbIM_UseEffective)) {
- register unsigned long old;
- old= state->locked_mods;
- if (on) state->locked_mods|= map->mods.mask;
- else state->locked_mods&= ~map->mods.mask;
- if (state->locked_mods!=old)
- stateChange= True;
- }
- if (map->which_mods&(XkbIM_UseLatched|XkbIM_UseEffective)) {
- register unsigned long newmods;
- newmods= state->latched_mods;
- if (on) newmods|= map->mods.mask;
- else newmods&= ~map->mods.mask;
- if (newmods!=state->locked_mods) {
- newmods&= map->mods.mask;
- XkbLatchModifiers(xkbi->device,map->mods.mask,newmods);
- stateChange= True;
- }
- }
- }
- return (stateChange || ctrlChange);
-}
-
-/***====================================================================***/
-
- /*
- * void
- * XkbSetIndicators(dev,affect,values,cause)
- *
- * Attempts to change the indicators specified in 'affect' to the
- * states specified in 'values' for the default keyboard feedback
- * on the keyboard specified by 'dev.' Attempts to change indicator
- * state might be ignored or have no affect, depending on the XKB
- * indicator map for any affected indicators, as described in section
- * 9.2 of the XKB protocol specification.
- *
- * If 'changes' is non-NULL, this function notes any changes to the
- * keyboard state, controls, or indicator state that result from this
- * attempted change. If 'changes' is NULL, this function generates
- * XKB events to report any such changes to interested clients.
- *
- * If 'cause' is non-NULL, it specifies the reason for the change,
- * as reported in some XKB events. If it is NULL, this function
- * assumes that the change is the result of a core protocol
- * ChangeKeyboardMapping request.
- */
-
-void
-XkbSetIndicators( DeviceIntPtr dev,
- CARD32 affect,
- CARD32 values,
- XkbEventCausePtr cause)
-{
-XkbSrvLedInfoPtr sli;
-XkbChangesRec changes;
-xkbExtensionDeviceNotify ed;
-unsigned side_affected;
-
- bzero((char *)&changes,sizeof(XkbChangesRec));
- bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- sli->explicitState&= ~affect;
- sli->explicitState|= (affect&values);
- XkbApplyLedStateChanges(dev,sli,affect,&ed,&changes,cause);
-
- side_affected= 0;
- if (changes.state_changes!=0)
- side_affected|= XkbIndicatorsToUpdate(dev,changes.state_changes,False);
- if (changes.ctrls.enabled_ctrls_changes)
- side_affected|= sli->usesControls;
-
- if (side_affected) {
- XkbUpdateLedAutoState(dev,sli,side_affected,&ed,&changes,cause);
- affect|= side_affected;
- }
- if (changes.state_changes || changes.ctrls.enabled_ctrls_changes)
- XkbUpdateAllDeviceIndicators(NULL,cause);
-
- XkbFlushLedEvents(dev,dev,sli,&ed,&changes,cause);
- return;
-}
-
-/***====================================================================***/
-
- /*
- * Bool
- * ComputeAutoState(map,state,ctrls)
- *
- * This function reports the effect of applying the specified
- * indicator map given the specified state and controls, as
- * described in section 9.2 of the XKB protocol specification.
- */
-
-static Bool
-ComputeAutoState( XkbIndicatorMapPtr map,
- XkbStatePtr state,
- XkbControlsPtr ctrls)
-{
-Bool on;
-CARD8 mods,group;
-
- on= False;
- mods= group= 0;
- if (map->which_mods&XkbIM_UseAnyMods) {
- if (map->which_mods&XkbIM_UseBase)
- mods|= state->base_mods;
- if (map->which_mods&XkbIM_UseLatched)
- mods|= state->latched_mods;
- if (map->which_mods&XkbIM_UseLocked)
- mods|= state->locked_mods;
- if (map->which_mods&XkbIM_UseEffective)
- mods|= state->mods;
- if (map->which_mods&XkbIM_UseCompat)
- mods|= state->compat_state;
- on = ((map->mods.mask&mods)!=0);
- on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0));
- }
- if (map->which_groups&XkbIM_UseAnyGroup) {
- if (map->which_groups&XkbIM_UseBase)
- group|= (1L << state->base_group);
- if (map->which_groups&XkbIM_UseLatched)
- group|= (1L << state->latched_group);
- if (map->which_groups&XkbIM_UseLocked)
- group|= (1L << state->locked_group);
- if (map->which_groups&XkbIM_UseEffective)
- group|= (1L << state->group);
- on = on||(((map->groups&group)!=0)||(map->groups==0));
- }
- if (map->ctrls)
- on = on||(ctrls->enabled_ctrls&map->ctrls);
- return on;
-}
-
-/***====================================================================***/
-
- /*
- * void
- * XkbUpdateIndicators(dev,update,check_edevs,changes,cause)
- *
- * Applies the indicator maps for any indicators specified in
- * 'update' from the default keyboard feedback on the device
- * specified by 'dev.'
- *
- * If 'changes' is NULL, this function generates and XKB events
- * required to report the necessary changes, otherwise it simply
- * notes the indicators with changed state.
- *
- * If 'check_edevs' is True, this function also checks the indicator
- * maps for any open extension devices that have them, and updates
- * the state of any extension device indicators as necessary.
- */
-
-void
-XkbUpdateIndicators( DeviceIntPtr dev,
- register CARD32 update,
- Bool check_edevs,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-XkbSrvLedInfoPtr sli;
-
- sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateLedAutoState(dev,sli,update,NULL,changes,cause);
- if (check_edevs)
- XkbUpdateAllDeviceIndicators(changes,cause);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause)
-{
-DeviceIntPtr edev;
-XkbSrvLedInfoPtr sli;
-
- for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
- if (edev->kbdfeed) {
- KbdFeedbackPtr kf;
- for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) {
- if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
- continue;
- sli= kf->xkb_sli;
- XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
- changes,cause);
-
- }
- }
- if (edev->leds) {
- LedFeedbackPtr lf;
- for (lf=edev->leds;lf!=NULL;lf=lf->next) {
- if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
- continue;
- sli= lf->xkb_sli;
- XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
- changes,cause);
-
- }
- }
- }
- return;
-}
-
-/***====================================================================***/
-
- /*
- * void
- * XkbCheckIndicatorMaps(dev,sli,which)
- *
- * Updates the 'indicator accelerators' for the indicators specified
- * by 'which' in the feedback specified by 'sli.' The indicator
- * accelerators are internal to the server and are used to simplify
- * and speed up the process of figuring out which indicators might
- * be affected by a particular change in keyboard state or controls.
- */
-
-void
-XkbCheckIndicatorMaps(DeviceIntPtr dev,XkbSrvLedInfoPtr sli,unsigned which)
-{
-register unsigned i,bit;
-XkbIndicatorMapPtr map;
-XkbDescPtr xkb;
-
- if ((sli->flags&XkbSLI_HasOwnState)==0)
- dev= (DeviceIntPtr)LookupKeyboardDevice();
-
- sli->usesBase&= ~which;
- sli->usesLatched&= ~which;
- sli->usesLocked&= ~which;
- sli->usesEffective&= ~which;
- sli->usesCompat&= ~which;
- sli->usesControls&= ~which;
- sli->mapsPresent&= ~which;
-
- xkb= dev->key->xkbInfo->desc;
- for (i=0,bit=1,map=sli->maps;i<XkbNumIndicators;i++,bit<<=1,map++) {
- if (which&bit) {
- CARD8 what;
-
- if (!XkbIM_InUse(map))
- continue;
- sli->mapsPresent|= bit;
-
- what= (map->which_mods|map->which_groups);
- if (what&XkbIM_UseBase)
- sli->usesBase|= bit;
- if (what&XkbIM_UseLatched)
- sli->usesLatched|= bit;
- if (what&XkbIM_UseLocked)
- sli->usesLocked|= bit;
- if (what&XkbIM_UseEffective)
- sli->usesEffective|= bit;
- if (what&XkbIM_UseCompat)
- sli->usesCompat|= bit;
- if (map->ctrls)
- sli->usesControls|= bit;
-
- map->mods.mask= map->mods.real_mods;
- if (map->mods.vmods!=0) {
- map->mods.mask|= XkbMaskForVMask(xkb,map->mods.vmods);
- }
- }
- }
- sli->usedComponents= 0;
- if (sli->usesBase)
- sli->usedComponents|= XkbModifierBaseMask|XkbGroupBaseMask;
- if (sli->usesLatched)
- sli->usedComponents|= XkbModifierLatchMask|XkbGroupLatchMask;
- if (sli->usesLocked)
- sli->usedComponents|= XkbModifierLockMask|XkbGroupLockMask;
- if (sli->usesEffective)
- sli->usedComponents|= XkbModifierStateMask|XkbGroupStateMask;
- if (sli->usesCompat)
- sli->usedComponents|= XkbCompatStateMask;
- return;
-}
-
-/***====================================================================***/
-
- /*
- * XkbSrvLedInfoPtr
- * XkbAllocSrvLedInfo(dev,kf,lf,needed_parts)
- *
- * Allocates an XkbSrvLedInfoPtr for the feedback specified by either
- * 'kf' or 'lf' on the keyboard specified by 'dev.'
- *
- * If 'needed_parts' is non-zero, this function makes sure that any
- * of the parts speicified therein are allocated.
- */
-XkbSrvLedInfoPtr
-XkbAllocSrvLedInfo( DeviceIntPtr dev,
- KbdFeedbackPtr kf,
- LedFeedbackPtr lf,
- unsigned needed_parts)
-{
-XkbSrvLedInfoPtr sli;
-Bool checkAccel;
-Bool checkNames;
-
- sli= NULL;
- checkAccel= checkNames= False;
- if ((kf!=NULL)&&(kf->xkb_sli==NULL)) {
- kf->xkb_sli= sli= _XkbTypedCalloc(1,XkbSrvLedInfoRec);
- if (sli==NULL)
- return NULL; /* ALLOCATION ERROR */
- if (dev->key && dev->key->xkbInfo)
- sli->flags= XkbSLI_HasOwnState;
- else sli->flags= 0;
- sli->class= KbdFeedbackClass;
- sli->id= kf->ctrl.id;
- sli->fb.kf= kf;
-
- sli->autoState= 0;
- sli->explicitState= kf->ctrl.leds;
- sli->effectiveState= kf->ctrl.leds;
-
- if ((kf==dev->kbdfeed) && (dev->key) && (dev->key->xkbInfo)) {
- XkbDescPtr xkb;
- xkb= dev->key->xkbInfo->desc;
- sli->flags|= XkbSLI_IsDefault;
- sli->physIndicators= xkb->indicators->phys_indicators;
- sli->names= xkb->names->indicators;
- sli->maps= xkb->indicators->maps;
- checkNames= checkAccel= True;
- }
- else {
- sli->physIndicators= XkbAllIndicatorsMask;
- sli->names= NULL;
- sli->maps= NULL;
- }
- }
- else if ((kf!=NULL)&&((kf->xkb_sli->flags&XkbSLI_IsDefault)!=0)) {
- XkbDescPtr xkb;
- xkb= dev->key->xkbInfo->desc;
- sli->physIndicators= xkb->indicators->phys_indicators;
- if (xkb->names->indicators!=sli->names) {
- checkNames= True;
- sli->names= xkb->names->indicators;
- }
- if (xkb->indicators->maps!=sli->maps) {
- checkAccel= True;
- sli->maps= xkb->indicators->maps;
- }
- }
- else if ((lf!=NULL)&&(lf->xkb_sli==NULL)) {
- lf->xkb_sli= sli= _XkbTypedCalloc(1,XkbSrvLedInfoRec);
- if (sli==NULL)
- return NULL; /* ALLOCATION ERROR */
- if (dev->key && dev->key->xkbInfo)
- sli->flags= XkbSLI_HasOwnState;
- else sli->flags= 0;
- sli->class= LedFeedbackClass;
- sli->id= lf->ctrl.id;
- sli->fb.lf= lf;
-
- sli->physIndicators= lf->ctrl.led_mask;
- sli->autoState= 0;
- sli->explicitState= lf->ctrl.led_values;
- sli->effectiveState= lf->ctrl.led_values;
- sli->maps= NULL;
- sli->names= NULL;
- }
- if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
- sli->names= _XkbTypedCalloc(XkbNumIndicators,Atom);
- if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
- sli->maps= _XkbTypedCalloc(XkbNumIndicators,XkbIndicatorMapRec);
- if (checkNames) {
- register unsigned i,bit;
- sli->namesPresent= 0;
- for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
- if (sli->names[i]!=None)
- sli->namesPresent|= bit;
- }
- }
- if (checkAccel)
- XkbCheckIndicatorMaps(dev,sli,XkbAllIndicatorsMask);
- return sli;
-}
-
-void
-XkbFreeSrvLedInfo(XkbSrvLedInfoPtr sli)
-{
- if ((sli->flags&XkbSLI_IsDefault)==0) {
- if (sli->maps) _XkbFree(sli->maps);
- if (sli->names) _XkbFree(sli->names);
- }
- sli->maps= NULL;
- sli->names= NULL;
- _XkbFree(sli);
- return;
-}
-
-
-/***====================================================================***/
-
- /*
- * XkbSrvLedInfoPtr
- * XkbFindSrvLedInfo(dev,class,id,needed_parts)
- *
- * Finds the XkbSrvLedInfoPtr for the specified 'class' and 'id'
- * on the device specified by 'dev.' If the class and id specify
- * a valid device feedback, this function returns the existing
- * feedback or allocates a new one.
- *
- */
-
-XkbSrvLedInfoPtr
-XkbFindSrvLedInfo( DeviceIntPtr dev,
- unsigned class,
- unsigned id,
- unsigned needed_parts)
-{
-XkbSrvLedInfoPtr sli;
-
- /* optimization to check for most common case */
- if (((class==XkbDfltXIClass)&&(id==XkbDfltXIId))&&(dev->kbdfeed)) {
- XkbSrvLedInfoPtr sli;
- sli= dev->kbdfeed->xkb_sli;
- if (dev->kbdfeed->xkb_sli==NULL) {
- sli= XkbAllocSrvLedInfo(dev,dev->kbdfeed,NULL,needed_parts);
- dev->kbdfeed->xkb_sli= sli;
- }
- return dev->kbdfeed->xkb_sli;
- }
-
- sli= NULL;
- if (class==XkbDfltXIClass) {
- if (dev->kbdfeed) class= KbdFeedbackClass;
- else if (dev->leds) class= LedFeedbackClass;
- else return NULL;
- }
- if (class==KbdFeedbackClass) {
- KbdFeedbackPtr kf;
- for (kf=dev->kbdfeed;kf!=NULL;kf=kf->next) {
- if ((id==XkbDfltXIId)||(id==kf->ctrl.id)) {
- if (kf->xkb_sli==NULL)
- kf->xkb_sli= XkbAllocSrvLedInfo(dev,kf,NULL,needed_parts);
- sli= kf->xkb_sli;
- break;
- }
- }
- }
- else if (class==LedFeedbackClass) {
- LedFeedbackPtr lf;
- for (lf=dev->leds;lf!=NULL;lf=lf->next) {
- if ((id==XkbDfltXIId)||(id==lf->ctrl.id)) {
- if (lf->xkb_sli==NULL)
- lf->xkb_sli= XkbAllocSrvLedInfo(dev,NULL,lf,needed_parts);
- sli= lf->xkb_sli;
- break;
- }
- }
- }
- if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
- sli->names= _XkbTypedCalloc(XkbNumIndicators,Atom);
- if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
- sli->maps= _XkbTypedCalloc(XkbNumIndicators,XkbIndicatorMapRec);
- return sli;
-}
-
-/***====================================================================***/
-
-void
-XkbFlushLedEvents( DeviceIntPtr dev,
- DeviceIntPtr kbd,
- XkbSrvLedInfoPtr sli,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
- if (changes) {
- if (changes->indicators.state_changes)
- XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
- XkbSendNotification(kbd,changes,cause);
- bzero((char *)changes,sizeof(XkbChangesRec));
-
- if (XkbAX_NeedFeedback(kbd->key->xkbInfo->desc->ctrls, XkbAX_IndicatorFBMask)) {
- if (sli->effectiveState)
- /* it appears that the which parameter is not used */
- XkbDDXAccessXBeep(dev, _BEEP_LED_ON, XkbAccessXFeedbackMask);
- else
- XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask);
- }
- }
- if (ed && (ed->reason)) {
- if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
- XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
- XkbSendExtensionDeviceNotify(dev,cause->client,ed);
- }
- bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbApplyLedNameChanges( DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- unsigned changed_names,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr kbd;
-XkbChangesRec my_changes;
-xkbExtensionDeviceNotify my_ed;
-
- if (changed_names==0)
- return;
- if (dev->key && dev->key->xkbInfo)
- kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
-
- if (ed==NULL) {
- ed= &my_ed;
- bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
- }
- else if ((ed->reason&XkbXI_IndicatorsMask)&&
- ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- }
-
- if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
- if (changes==NULL) {
- changes= &my_changes;
- bzero((char *)changes,sizeof(XkbChangesRec));
- }
- changes->names.changed|= XkbIndicatorNamesMask;
- changes->names.changed_indicators|= changed_names;
- }
-
- ed->reason|= (XkbXI_IndicatorNamesMask&(~XkbXIUnsupported));
- ed->ledClass= sli->class;
- ed->ledID= sli->id;
- ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed->ledState= sli->effectiveState;
- ed->unsupported|= XkbXIUnsupported&XkbXI_IndicatorNamesMask;
- ed->supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
-
- if (changes!=&my_changes) changes= NULL;
- if (ed!=&my_ed) ed= NULL;
- if (changes || ed)
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- return;
-}
-/***====================================================================***/
-
- /*
- * void
- * XkbApplyLedMapChanges(dev,sli,changed_maps,changes,cause)
- *
- * Handles all of the secondary effects of the changes to the
- * feedback specified by 'sli' on the device specified by 'dev.'
- *
- * If 'changed_maps' specifies any indicators, this function generates
- * XkbExtensionDeviceNotify events and possibly IndicatorMapNotify
- * events to report the changes, and recalculates the effective
- * state of each indicator with a changed map. If any indicators
- * change state, the server generates XkbExtensionDeviceNotify and
- * XkbIndicatorStateNotify events as appropriate.
- *
- * If 'changes' is non-NULL, this function updates it to reflect
- * any changes to the keyboard state or controls or to the 'core'
- * indicator names, maps, or state. If 'changes' is NULL, this
- * function generates XKB events as needed to report the changes.
- * If 'dev' is not a keyboard device, any changes are reported
- * for the core keyboard.
- *
- * The 'cause' specifies the reason for the event (key event or
- * request) for the change, as reported in some XKB events.
- */
-
-void
-XkbApplyLedMapChanges( DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- unsigned changed_maps,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr kbd;
-XkbChangesRec my_changes;
-xkbExtensionDeviceNotify my_ed;
-
- if (changed_maps==0)
- return;
- if (dev->key && dev->key->xkbInfo)
- kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
-
- if (ed==NULL) {
- ed= &my_ed;
- bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
- }
- else if ((ed->reason&XkbXI_IndicatorsMask)&&
- ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- }
-
- if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
- if (changes==NULL) {
- changes= &my_changes;
- bzero((char *)changes,sizeof(XkbChangesRec));
- }
- changes->indicators.map_changes|= changed_maps;
- }
-
- XkbCheckIndicatorMaps(dev,sli,changed_maps);
-
- ed->reason|= (XkbXI_IndicatorMapsMask&(~XkbXIUnsupported));
- ed->ledClass= sli->class;
- ed->ledID= sli->id;
- ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed->ledState= sli->effectiveState;
- ed->unsupported|= XkbXIUnsupported&XkbXI_IndicatorMapsMask;
- ed->supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
-
- XkbUpdateLedAutoState(dev,sli,changed_maps,ed,changes,cause);
-
- if (changes!=&my_changes) changes= NULL;
- if (ed!=&my_ed) ed= NULL;
- if (changes || ed)
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbApplyLedStateChanges(DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- unsigned changed_leds,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-XkbSrvInfoPtr xkbi;
-DeviceIntPtr kbd;
-XkbChangesRec my_changes;
-xkbExtensionDeviceNotify my_ed;
-register unsigned i,bit,affected;
-XkbIndicatorMapPtr map;
-unsigned oldState;
-Bool kb_changed;
-
- if (changed_leds==0)
- return;
- if (dev->key && dev->key->xkbInfo)
- kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
- xkbi= kbd->key->xkbInfo;
-
- if (changes==NULL) {
- changes= &my_changes;
- bzero((char *)changes,sizeof(XkbChangesRec));
- }
-
- kb_changed= False;
- affected= changed_leds;
- oldState= sli->effectiveState;
- for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
- if ((affected&bit)==0)
- continue;
- affected&= ~bit;
- map= &sli->maps[i];
- if (map->flags&XkbIM_NoExplicit) {
- sli->explicitState&= ~bit;
- continue;
- }
- if (map->flags&XkbIM_LEDDrivesKB) {
- Bool on= ((sli->explicitState&bit)!=0);
- if (XkbApplyLEDChangeToKeyboard(xkbi,map,on,changes))
- kb_changed= True;
- }
- }
- sli->effectiveState= (sli->autoState|sli->explicitState);
- affected= sli->effectiveState^oldState;
-
- if (ed==NULL) {
- ed= &my_ed;
- bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
- }
- else if (affected&&(ed->reason&XkbXI_IndicatorsMask)&&
- ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- }
-
- if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault))
- changes->indicators.state_changes|= affected;
- if (affected) {
- ed->reason|= (XkbXI_IndicatorStateMask&(~XkbXIUnsupported));
- ed->ledClass= sli->class;
- ed->ledID= sli->id;
- ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed->ledState= sli->effectiveState;
- ed->unsupported|= XkbXIUnsupported&XkbXI_IndicatorStateMask;
- ed->supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
- }
-
- if (kb_changed) {
- XkbComputeDerivedState(kbd->key->xkbInfo);
- XkbUpdateLedAutoState(dev,sli,sli->mapsPresent,ed,changes,cause);
- }
-
- if (changes!=&my_changes) changes= NULL;
- if (ed!=&my_ed) ed= NULL;
- if (changes || ed)
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- if (kb_changed)
- XkbUpdateAllDeviceIndicators(NULL,cause);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbUpdateLedAutoState( DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- unsigned maps_to_check,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr kbd;
-XkbStatePtr state;
-XkbControlsPtr ctrls;
-XkbChangesRec my_changes;
-xkbExtensionDeviceNotify my_ed;
-register unsigned i,bit,affected;
-register XkbIndicatorMapPtr map;
-unsigned oldState;
-
- if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0))
- return;
-
- if (dev->key && dev->key->xkbInfo)
- kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
-
- state= &kbd->key->xkbInfo->state;
- ctrls= kbd->key->xkbInfo->desc->ctrls;
- affected= maps_to_check;
- oldState= sli->effectiveState;
- sli->autoState&= ~affected;
- for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
- if ((affected&bit)==0)
- continue;
- affected&= ~bit;
- map= &sli->maps[i];
- if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls))
- sli->autoState|= bit;
- }
- sli->effectiveState= (sli->autoState|sli->explicitState);
- affected= sli->effectiveState^oldState;
- if (affected==0)
- return;
-
- if (ed==NULL) {
- ed= &my_ed;
- bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
- }
- else if ((ed->reason&XkbXI_IndicatorsMask)&&
- ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- }
-
- if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
- if (changes==NULL) {
- changes= &my_changes;
- bzero((char *)changes,sizeof(XkbChangesRec));
- }
- changes->indicators.state_changes|= affected;
- }
-
- ed->reason|= (XkbXI_IndicatorStateMask&(~XkbXIUnsupported));
- ed->ledClass= sli->class;
- ed->ledID= sli->id;
- ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed->ledState= sli->effectiveState;
- ed->unsupported|= XkbXIUnsupported&XkbXI_IndicatorStateMask;
- ed->supported= XkbXI_AllFeaturesMask&(~XkbXIUnsupported);
-
- if (changes!=&my_changes) changes= NULL;
- if (ed!=&my_ed) ed= NULL;
- if (changes || ed)
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- return;
-}
-
-/***====================================================================***/
-
-static void
-_UpdateButtonVMods( XkbDescPtr xkb,
- unsigned num_btns,
- XkbAction * acts,
- unsigned changed,
- xkbExtensionDeviceNotify * ed_inout)
-{
-register int i;
-
- for (i=0;i<num_btns;i++,acts++) {
- if ((acts->any.type!=XkbSA_NoAction)&&
- XkbUpdateActionVirtualMods(xkb,acts,changed)) {
- if ((ed_inout->reason&XkbXI_ButtonActionsMask)==0) {
- ed_inout->reason|= XkbXI_ButtonActionsMask;
- ed_inout->firstBtn= i;
- ed_inout->nBtns= 1;
- }
- else {
- ed_inout->nBtns= (i-ed_inout->firstBtn)+1;
- }
- }
- }
- return;
-}
-
-static void
-_UpdateMapVMods( XkbDescPtr xkb,
- register XkbIndicatorMapPtr map,
- unsigned changed_vmods,
- unsigned * changed_maps_rtrn)
-{
-register int i;
-
- *changed_maps_rtrn= 0;
- for (i=0;i<XkbNumIndicators;i++,map++) {
- if (map->mods.vmods&changed_vmods) {
- map->mods.mask= map->mods.real_mods;
- map->mods.mask|= XkbMaskForVMask(xkb,map->mods.vmods);
- *changed_maps_rtrn|= (1L<<i);
- }
- }
- return;
-}
-
-static void
-_UpdateDeviceVMods( DeviceIntPtr dev,
- XkbDescPtr xkb,
- unsigned changed,
- XkbEventCausePtr cause)
-{
-xkbExtensionDeviceNotify ed;
-XkbSrvLedInfoPtr sli;
-unsigned changed_maps;
-
- bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
- ed.deviceID= dev->id;
- if ((dev->button)&&(dev->button->xkb_acts)) {
- _UpdateButtonVMods(xkb,dev->button->numButtons,
- dev->button->xkb_acts,changed,&ed);
- }
- if (dev->kbdfeed) {
- KbdFeedbackPtr kf;
- for (kf=dev->kbdfeed;kf!=NULL;kf=kf->next) {
- if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
- continue;
- sli= kf->xkb_sli;
- _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
- if (changed_maps) {
- if (ed.reason&XkbXI_IndicatorsMask) {
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- ed.reason= 0;
- ed.firstBtn= ed.nBtns;
- }
- ed.ledClass= sli->class;
- ed.ledID= sli->id;
- ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed.reason|= XkbXI_IndicatorMapsMask;
- XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
- }
- }
- }
- if (dev->leds) {
- LedFeedbackPtr lf;
- for (lf=dev->leds;lf!=NULL;lf=lf->next) {
- if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
- continue;
- sli= lf->xkb_sli;
- _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
- if (changed_maps) {
- if (ed.reason&XkbXI_IndicatorsMask) {
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- ed.reason= 0;
- ed.firstBtn= ed.nBtns;
- }
- ed.ledClass= sli->class;
- ed.ledID= sli->id;
- ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed.reason|= XkbXI_IndicatorMapsMask;
- XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
- }
- }
- }
- if (ed.reason!=0)
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- return;
-}
-
-void
-XkbApplyVModChangesToAllDevices( DeviceIntPtr dev,
- XkbDescPtr xkb,
- unsigned changed,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr edev;
- if (dev!=(DeviceIntPtr)LookupKeyboardDevice())
- return;
- for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
- if (edev->key)
- continue;
- _UpdateDeviceVMods(edev,xkb,changed,cause);
- }
- for (edev=inputInfo.off_devices;edev!=NULL;edev=edev->next) {
- if (edev->key)
- continue;
- _UpdateDeviceVMods(edev,xkb,changed,cause);
- }
- return;
-}
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
deleted file mode 100644
index 3a9fc11f8..000000000
--- a/xkb/xkbPrKeyEv.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* $Xorg: xkbPrKeyEv.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbPrKeyEv.c,v 3.9 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-#include <ctype.h>
-
-
-/***====================================================================***/
-
-void
-XkbProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
-{
-KeyClassPtr keyc = keybd->key;
-XkbSrvInfoPtr xkbi;
-int key;
-XkbBehavior behavior;
-unsigned ndx;
-
- xkbi= keyc->xkbInfo;
- key= xE->u.u.detail;
-#ifdef DEBUG
- if (xkbDebugFlags&0x8) {
- ErrorF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
- }
-#endif
-
- if ( (xkbi->repeatKey==key) && (xE->u.u.type==KeyRelease) &&
- ((xkbi->desc->ctrls->enabled_ctrls&XkbRepeatKeysMask)==0) ) {
- AccessXCancelRepeatKey(xkbi,key);
- }
-
- behavior= xkbi->desc->server->behaviors[key];
- /* The "permanent" flag indicates a hard-wired behavior that occurs */
- /* below XKB, such as a key that physically locks. XKB does not */
- /* do anything to implement the behavior, but it *does* report that */
- /* key is hardwired */
- if ((behavior.type&XkbKB_Permanent)==0) {
- switch (behavior.type) {
- case XkbKB_Default:
- if (( xE->u.u.type == KeyPress ) &&
- (keyc->down[key>>3] & (1<<(key&7)))) {
- XkbLastRepeatEvent= (pointer)xE;
- xE->u.u.type = KeyRelease;
- XkbHandleActions(keybd,keybd,xE,count);
- xE->u.u.type = KeyPress;
- XkbHandleActions(keybd,keybd,xE,count);
- XkbLastRepeatEvent= NULL;
- return;
- }
- else if ((xE->u.u.type==KeyRelease) &&
- (!(keyc->down[key>>3]&(1<<(key&7))))) {
- XkbLastRepeatEvent= (pointer)&xE;
- xE->u.u.type = KeyPress;
- XkbHandleActions(keybd,keybd,xE,count);
- xE->u.u.type = KeyRelease;
- XkbHandleActions(keybd,keybd,xE,count);
- XkbLastRepeatEvent= NULL;
- return;
- }
- break;
- case XkbKB_Lock:
- if ( xE->u.u.type == KeyRelease )
- return;
- else {
- int bit= 1<<(key&7);
- if ( keyc->down[key>>3]&bit )
- xE->u.u.type= KeyRelease;
- }
- break;
- case XkbKB_RadioGroup:
- ndx= (behavior.data&(~XkbKB_RGAllowNone));
- if ( ndx<xkbi->nRadioGroups ) {
- XkbRadioGroupPtr rg;
-
- if ( xE->u.u.type == KeyRelease )
- return;
-
- rg = &xkbi->radioGroups[ndx];
- if ( rg->currentDown == xE->u.u.detail ) {
- if (behavior.data&XkbKB_RGAllowNone) {
- xE->u.u.type = KeyRelease;
- XkbHandleActions(keybd,keybd,xE,count);
- rg->currentDown= 0;
- }
- return;
- }
- if ( rg->currentDown!=0 ) {
- int key = xE->u.u.detail;
- xE->u.u.type= KeyRelease;
- xE->u.u.detail= rg->currentDown;
- XkbHandleActions(keybd,keybd,xE,count);
- xE->u.u.type= KeyPress;
- xE->u.u.detail= key;
- }
- rg->currentDown= key;
- }
- else ErrorF("InternalError! Illegal radio group %d\n",ndx);
- break;
- case XkbKB_Overlay1: case XkbKB_Overlay2:
- {
- unsigned which;
- if (behavior.type==XkbKB_Overlay1) which= XkbOverlay1Mask;
- else which= XkbOverlay2Mask;
- if ( (xkbi->desc->ctrls->enabled_ctrls&which)==0 )
- break;
- if ((behavior.data>=xkbi->desc->min_key_code)&&
- (behavior.data<=xkbi->desc->max_key_code)) {
- xE->u.u.detail= behavior.data;
- /* 9/11/94 (ef) -- XXX! need to match release with */
- /* press even if the state of the */
- /* corresponding overlay control */
- /* changes while the key is down */
- }
- }
- break;
- default:
- ErrorF("unknown key behavior 0x%04x\n",behavior.type);
-#if defined(MetroLink)
- return;
-#else
- break;
-#endif
- }
- }
- XkbHandleActions(keybd,keybd,xE,count);
- return;
-}
-
-void
-ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
-{
-KeyClassPtr keyc = keybd->key;
-XkbSrvInfoPtr xkbi;
-
- xkbi= keyc->xkbInfo;
-
-#ifdef DEBUG
- if (xkbDebugFlags&0x8) {
- int key= xE->u.u.detail;
- ErrorF("PKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
- }
-#endif
- if ((xkbi->desc->ctrls->enabled_ctrls&XkbAllFilteredEventsMask)==0)
- XkbProcessKeyboardEvent(xE,keybd,count);
- else if (xE->u.u.type==KeyPress)
- AccessXFilterPressEvent(xE,keybd,count);
- else if (xE->u.u.type==KeyRelease)
- AccessXFilterReleaseEvent(xE,keybd,count);
- return;
-}
-
diff --git a/xkb/xkbPrOtherEv.c b/xkb/xkbPrOtherEv.c
deleted file mode 100644
index 0a077f4c1..000000000
--- a/xkb/xkbPrOtherEv.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $Xorg: xkbPrOtherEv.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbPrOtherEv.c,v 1.2 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-
-#include "XI.h"
-#include "XIproto.h"
-
-extern void ProcessOtherEvent(
- xEvent * /* xE */,
- DeviceIntPtr /* dev */,
- int /* count */
-);
-
-/***====================================================================***/
-
-void
-XkbProcessOtherEvent(xEvent *xE,DeviceIntPtr dev,int count)
-{
-Bool xkbCares,isBtn;
-
- xkbCares= True;
- isBtn= False;
- switch ( xE->u.u.type ) {
- case KeyPress: xE->u.u.type= DeviceKeyPress; break;
- case KeyRelease: xE->u.u.type= DeviceKeyRelease; break;
- case ButtonPress: xE->u.u.type= DeviceButtonPress;
- isBtn= True;
- break;
- case ButtonRelease: xE->u.u.type= DeviceButtonRelease;
- isBtn= True;
- break;
- default: xkbCares= False; break;
- }
- if (xkbCares) {
- if ((!isBtn)||((dev->button)&&(dev->button->xkb_acts))) {
- DeviceIntPtr kbd;
- if (dev->key) kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
- XkbHandleActions(dev,kbd,xE,count);
- return;
- }
- }
- ProcessOtherEvent(xE,dev,count);
- return;
-}
-
diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c
deleted file mode 100644
index 6f4ffe8a9..000000000
--- a/xkb/xkbSwap.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/* $Xorg: xkbSwap.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbSwap.c,v 3.5 2003/11/17 22:20:46 dawes Exp $ */
-
-#include "stdio.h"
-#include "X.h"
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBsrv.h"
-#include "XKBstr.h"
-#include "extnsionst.h"
-#include "xkb.h"
-
- /*
- * REQUEST SWAPPING
- */
-static int
-SProcXkbUseExtension(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbUseExtensionReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbUseExtensionReq);
- swaps(&stuff->wantedMajor,n);
- swaps(&stuff->wantedMinor,n);
- return ProcXkbUseExtension(client);
-}
-
-static int
-SProcXkbSelectEvents(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSelectEventsReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->affectWhich,n);
- swaps(&stuff->clear,n);
- swaps(&stuff->selectAll,n);
- swaps(&stuff->affectMap,n);
- swaps(&stuff->map,n);
- if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) {
- union {
- BOOL *b;
- CARD8 *c8;
- CARD16 *c16;
- CARD32 *c32;
- } from;
- register unsigned bit,ndx,maskLeft,dataLeft,size;
-
- from.c8= (CARD8 *)&stuff[1];
- dataLeft= (stuff->length*4)-SIZEOF(xkbSelectEventsReq);
- maskLeft= (stuff->affectWhich&(~XkbMapNotifyMask));
- for (ndx=0,bit=1; (maskLeft!=0); ndx++, bit<<=1) {
- if (((bit&maskLeft)==0)||(ndx==XkbMapNotify))
- continue;
- maskLeft&= ~bit;
- if ((stuff->selectAll&bit)||(stuff->clear&bit))
- continue;
- switch (ndx) {
- case XkbNewKeyboardNotify:
- case XkbStateNotify:
- case XkbNamesNotify:
- case XkbAccessXNotify:
- case XkbExtensionDeviceNotify:
- size= 2;
- break;
- case XkbControlsNotify:
- case XkbIndicatorStateNotify:
- case XkbIndicatorMapNotify:
- size= 4;
- break;
- case XkbBellNotify:
- case XkbActionMessage:
- case XkbCompatMapNotify:
- size= 1;
- break;
- default:
- client->errorValue = _XkbErrCode2(0x1,bit);
- return BadValue;
- }
- if (dataLeft<(size*2))
- return BadLength;
- if (size==2) {
- swaps(&from.c16[0],n);
- swaps(&from.c16[1],n);
- }
- else if (size==4) {
- swapl(&from.c32[0],n);
- swapl(&from.c32[1],n);
- }
- else {
- size= 2;
- }
- from.c8+= (size*2);
- dataLeft-= (size*2);
- }
- if (dataLeft>2) {
- ErrorF("Extra data (%d bytes) after SelectEvents\n",dataLeft);
- return BadLength;
- }
- }
- return ProcXkbSelectEvents(client);
-}
-
-static int
-SProcXkbBell(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbBellReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbBellReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->bellClass,n);
- swaps(&stuff->bellID,n);
- swapl(&stuff->name,n);
- swapl(&stuff->window,n);
- swaps(&stuff->pitch,n);
- swaps(&stuff->duration,n);
- return ProcXkbBell(client);
-}
-
-static int
-SProcXkbGetState(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetStateReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetStateReq);
- swaps(&stuff->deviceSpec,n);
- return ProcXkbGetState(client);
-}
-
-static int
-SProcXkbLatchLockState(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbLatchLockStateReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->groupLatch,n);
- return ProcXkbLatchLockState(client);
-}
-
-static int
-SProcXkbGetControls(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetControlsReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetControlsReq);
- swaps(&stuff->deviceSpec,n);
- return ProcXkbGetControls(client);
-}
-
-static int
-SProcXkbSetControls(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetControlsReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbSetControlsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->affectInternalVMods,n);
- swaps(&stuff->internalVMods,n);
- swaps(&stuff->affectIgnoreLockVMods,n);
- swaps(&stuff->ignoreLockVMods,n);
- swaps(&stuff->axOptions,n);
- swapl(&stuff->affectEnabledCtrls,n);
- swapl(&stuff->enabledCtrls,n);
- swapl(&stuff->changeCtrls,n);
- swaps(&stuff->repeatDelay,n);
- swaps(&stuff->repeatInterval,n);
- swaps(&stuff->slowKeysDelay,n);
- swaps(&stuff->debounceDelay,n);
- swaps(&stuff->mkDelay,n);
- swaps(&stuff->mkInterval,n);
- swaps(&stuff->mkTimeToMax,n);
- swaps(&stuff->mkMaxSpeed,n);
- swaps(&stuff->mkCurve,n);
- swaps(&stuff->axTimeout,n);
- swapl(&stuff->axtCtrlsMask,n);
- swapl(&stuff->axtCtrlsValues,n);
- swaps(&stuff->axtOptsMask,n);
- swaps(&stuff->axtOptsValues,n);
- return ProcXkbSetControls(client);
-}
-
-static int
-SProcXkbGetMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->full,n);
- swaps(&stuff->partial,n);
- swaps(&stuff->virtualMods,n);
- return ProcXkbGetMap(client);
-}
-
-static int
-SProcXkbSetMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->present,n);
- swaps(&stuff->flags,n);
- swaps(&stuff->totalSyms,n);
- swaps(&stuff->totalActs,n);
- swaps(&stuff->virtualMods,n);
- return ProcXkbSetMap(client);
-}
-
-
-static int
-SProcXkbGetCompatMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetCompatMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->firstSI,n);
- swaps(&stuff->nSI,n);
- return ProcXkbGetCompatMap(client);
-}
-
-static int
-SProcXkbSetCompatMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetCompatMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->firstSI,n);
- swaps(&stuff->nSI,n);
- return ProcXkbSetCompatMap(client);
-}
-
-static int
-SProcXkbGetIndicatorState(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetIndicatorStateReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
- swaps(&stuff->deviceSpec,n);
- return ProcXkbGetIndicatorState(client);
-}
-
-static int
-SProcXkbGetIndicatorMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetIndicatorMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
- return ProcXkbGetIndicatorMap(client);
-}
-
-static int
-SProcXkbSetIndicatorMap(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetIndicatorMapReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
- return ProcXkbSetIndicatorMap(client);
-}
-
-static int
-SProcXkbGetNamedIndicator(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetNamedIndicatorReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
- swapl(&stuff->indicator,n);
- return ProcXkbGetNamedIndicator(client);
-}
-
-static int
-SProcXkbSetNamedIndicator(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetNamedIndicatorReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
- swapl(&stuff->indicator,n);
- swaps(&stuff->virtualMods,n);
- swapl(&stuff->ctrls,n);
- return ProcXkbSetNamedIndicator(client);
-}
-
-
-static int
-SProcXkbGetNames(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetNamesReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetNamesReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
- return ProcXkbGetNames(client);
-}
-
-static int
-SProcXkbSetNames(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetNamesReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->virtualMods,n);
- swapl(&stuff->which,n);
- swapl(&stuff->indicators,n);
- swaps(&stuff->totalKTLevelNames,n);
- return ProcXkbSetNames(client);
-}
-
-static int
-SProcXkbGetGeometry(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetGeometryReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetGeometryReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->name,n);
- return ProcXkbGetGeometry(client);
-}
-
-static int
-SProcXkbSetGeometry(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetGeometryReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->name,n);
- swaps(&stuff->widthMM,n);
- swaps(&stuff->heightMM,n);
- swaps(&stuff->nProperties,n);
- swaps(&stuff->nColors,n);
- swaps(&stuff->nDoodads,n);
- swaps(&stuff->nKeyAliases,n);
- return ProcXkbSetGeometry(client);
-}
-
-static int
-SProcXkbPerClientFlags(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbPerClientFlagsReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->change,n);
- swapl(&stuff->value,n);
- swapl(&stuff->ctrlsToChange,n);
- swapl(&stuff->autoCtrls,n);
- swapl(&stuff->autoCtrlValues,n);
- return ProcXkbPerClientFlags(client);
-}
-
-static int
-SProcXkbListComponents(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbListComponentsReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->maxNames,n);
- return ProcXkbListComponents(client);
-}
-
-static int
-SProcXkbGetKbdByName(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetKbdByNameReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->want,n);
- swaps(&stuff->need,n);
- return ProcXkbGetKbdByName(client);
-}
-
-static int
-SProcXkbGetDeviceInfo(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbGetDeviceInfoReq);
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->wanted,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
- return ProcXkbGetDeviceInfo(client);
-}
-
-static int
-SProcXkbSetDeviceInfo(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetDeviceInfoReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->change,n);
- swaps(&stuff->nDeviceLedFBs,n);
- return ProcXkbSetDeviceInfo(client);
-}
-
-static int
-SProcXkbSetDebuggingFlags(ClientPtr client)
-{
-register int n;
-
- REQUEST(xkbSetDebuggingFlagsReq);
-
- swaps(&stuff->length,n);
- REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
- swapl(&stuff->affectFlags,n);
- swapl(&stuff->flags,n);
- swapl(&stuff->affectCtrls,n);
- swapl(&stuff->ctrls,n);
- swaps(&stuff->msgLength,n);
- return ProcXkbSetDebuggingFlags(client);
-}
-
-int
-SProcXkbDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_kbUseExtension:
- return SProcXkbUseExtension(client);
- case X_kbSelectEvents:
- return SProcXkbSelectEvents(client);
- case X_kbBell:
- return SProcXkbBell(client);
- case X_kbGetState:
- return SProcXkbGetState(client);
- case X_kbLatchLockState:
- return SProcXkbLatchLockState(client);
- case X_kbGetControls:
- return SProcXkbGetControls(client);
- case X_kbSetControls:
- return SProcXkbSetControls(client);
- case X_kbGetMap:
- return SProcXkbGetMap(client);
- case X_kbSetMap:
- return SProcXkbSetMap(client);
- case X_kbGetCompatMap:
- return SProcXkbGetCompatMap(client);
- case X_kbSetCompatMap:
- return SProcXkbSetCompatMap(client);
- case X_kbGetIndicatorState:
- return SProcXkbGetIndicatorState(client);
- case X_kbGetIndicatorMap:
- return SProcXkbGetIndicatorMap(client);
- case X_kbSetIndicatorMap:
- return SProcXkbSetIndicatorMap(client);
- case X_kbGetNamedIndicator:
- return SProcXkbGetNamedIndicator(client);
- case X_kbSetNamedIndicator:
- return SProcXkbSetNamedIndicator(client);
- case X_kbGetNames:
- return SProcXkbGetNames(client);
- case X_kbSetNames:
- return SProcXkbSetNames(client);
- case X_kbGetGeometry:
- return SProcXkbGetGeometry(client);
- case X_kbSetGeometry:
- return SProcXkbSetGeometry(client);
- case X_kbPerClientFlags:
- return SProcXkbPerClientFlags(client);
- case X_kbListComponents:
- return SProcXkbListComponents(client);
- case X_kbGetKbdByName:
- return SProcXkbGetKbdByName(client);
- case X_kbGetDeviceInfo:
- return SProcXkbGetDeviceInfo(client);
- case X_kbSetDeviceInfo:
- return SProcXkbSetDeviceInfo(client);
- case X_kbSetDebuggingFlags:
- return SProcXkbSetDebuggingFlags(client);
- default:
- return BadRequest;
- }
-}
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
deleted file mode 100644
index f3ba6bc17..000000000
--- a/xkb/xkbUtils.c
+++ /dev/null
@@ -1,983 +0,0 @@
-/* $Xorg: xkbUtils.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/* $XFree86: xc/programs/Xserver/xkb/xkbUtils.c,v 3.17 2003/11/17 22:20:46 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#define NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#define XK_CYRILLIC
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "extensions/XKBgeom.h"
-#include "xkb.h"
-
-#ifdef MODE_SWITCH
-extern Bool noKME; /* defined in os/utils.c */
-#endif
-
-int XkbDisableLockActions = 0;
-
-/***====================================================================***/
-
-#ifndef RETURN_SHOULD_REPEAT
-#if (defined(__osf__) && defined(__alpha))
-#define RETURN_SHOULD_REPEAT 1
-#else
-#define RETURN_SHOULD_REPEAT 0
-#endif
-#endif
-
-/***====================================================================***/
-
-DeviceIntPtr
-_XkbLookupAnyDevice(int id,int *why_rtrn)
-{
-DeviceIntPtr dev = NULL;
-
- dev= (DeviceIntPtr)LookupKeyboardDevice();
- if ((id==XkbUseCoreKbd)||(dev->id==id))
- return dev;
-
- dev= (DeviceIntPtr)LookupPointerDevice();
- if ((id==XkbUseCorePtr)||(dev->id==id))
- return dev;
-
- if (id&(~0xff))
- dev = NULL;
-
- dev= (DeviceIntPtr)LookupDevice(id);
- if (dev!=NULL)
- return dev;
- if ((!dev)&&(why_rtrn))
- *why_rtrn= XkbErr_BadDevice;
- return dev;
-}
-
-DeviceIntPtr
-_XkbLookupKeyboard(int id,int *why_rtrn)
-{
-DeviceIntPtr dev = NULL;
-
- if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
- return NULL;
- else if ((!dev->key)||(!dev->key->xkbInfo)) {
- if (why_rtrn)
- *why_rtrn= XkbErr_BadClass;
- return NULL;
- }
- return dev;
-}
-
-DeviceIntPtr
-_XkbLookupBellDevice(int id,int *why_rtrn)
-{
-DeviceIntPtr dev = NULL;
-
- if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
- return NULL;
- else if ((!dev->kbdfeed)&&(!dev->bell)) {
- if (why_rtrn)
- *why_rtrn= XkbErr_BadClass;
- return NULL;
- }
- return dev;
-}
-
-DeviceIntPtr
-_XkbLookupLedDevice(int id,int *why_rtrn)
-{
-DeviceIntPtr dev = NULL;
-
- if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
- return NULL;
- else if ((!dev->kbdfeed)&&(!dev->leds)) {
- if (why_rtrn)
- *why_rtrn= XkbErr_BadClass;
- return NULL;
- }
- return dev;
-}
-
-DeviceIntPtr
-_XkbLookupButtonDevice(int id,int *why_rtrn)
-{
-DeviceIntPtr dev = NULL;
-
- if ((dev= _XkbLookupAnyDevice(id,why_rtrn))==NULL)
- return NULL;
- else if (!dev->button) {
- if (why_rtrn)
- *why_rtrn= XkbErr_BadClass;
- return NULL;
- }
- return dev;
-}
-
-void
-XkbSetActionKeyMods(XkbDescPtr xkb,XkbAction *act,unsigned mods)
-{
-register unsigned tmp;
-
- switch (act->type) {
- case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
- if (act->mods.flags&XkbSA_UseModMapMods)
- act->mods.real_mods= act->mods.mask= mods;
- if ((tmp= XkbModActionVMods(&act->mods))!=0)
- act->mods.mask|= XkbMaskForVMask(xkb,tmp);
- break;
- case XkbSA_ISOLock:
- if (act->iso.flags&XkbSA_UseModMapMods)
- act->iso.real_mods= act->iso.mask= mods;
- if ((tmp= XkbModActionVMods(&act->iso))!=0)
- act->iso.mask|= XkbMaskForVMask(xkb,tmp);
- break;
- }
- return;
-}
-
-unsigned
-XkbMaskForVMask(XkbDescPtr xkb,unsigned vmask)
-{
-register int i,bit;
-register unsigned mask;
-
- for (mask=i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (vmask&bit)
- mask|= xkb->server->vmods[i];
- }
- return mask;
-}
-
-
-Bool
-XkbApplyVModChanges( XkbSrvInfoPtr xkbi,
- unsigned changed,
- XkbChangesPtr changes,
- unsigned * needChecksRtrn,
- XkbEventCausePtr cause)
-{
-XkbDescPtr xkb;
-Bool check;
-
- xkb= xkbi->desc;
-#ifdef DEBUG
-{
-register unsigned i,bit;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if ((changed&bit)==0)
- continue;
- if (xkbDebugFlags)
- ErrorF("Should be applying: change vmod %d to 0x%x\n",i,
- xkb->server->vmods[i]);
- }
-}
-#endif
- check= XkbApplyVirtualModChanges(xkb,changed,changes);
- XkbApplyVModChangesToAllDevices(xkbi->device,xkb,changed,cause);
-
- if (needChecksRtrn!=NULL) {
- if (check)
- *needChecksRtrn= XkbStateNotifyMask|XkbIndicatorStateNotifyMask;
- else *needChecksRtrn= 0;
- }
- else if (check) {
- /* 7/12/95 (ef) -- XXX check compatibility and/or indicator state */
- }
- return 1;
-}
-
-/***====================================================================***/
-
-void
-XkbUpdateKeyTypesFromCore( DeviceIntPtr pXDev,
- KeyCode first,
- CARD8 num,
- XkbChangesPtr changes)
-{
-XkbDescPtr xkb;
-unsigned key,nG,explicit;
-KeySymsPtr pCore;
-int types[XkbNumKbdGroups];
-KeySym tsyms[XkbMaxSymsPerKey],*syms;
-XkbMapChangesPtr mc;
-
- xkb= pXDev->key->xkbInfo->desc;
-#ifdef NOTYET
- if (first<xkb->min_key_code) {
- if (first>=XkbMinLegalKeyCode) {
- xkb->min_key_code= first;
- /* 1/12/95 (ef) -- XXX! should zero out the new maps */
- changes->map.changed|= XkbKeycodesMask;
-generate a NewKeyboard notify here?
- }
- }
-#endif
- if (first+num-1>xkb->max_key_code) {
- /* 1/12/95 (ef) -- XXX! should allow XKB structures to grow */
- num= xkb->max_key_code-first+1;
- }
-
- mc= (changes?(&changes->map):NULL);
-
- pCore= &pXDev->key->curKeySyms;
- syms= &pCore->map[(first-xkb->min_key_code)*pCore->mapWidth];
- for (key=first; key<(first+num); key++,syms+= pCore->mapWidth) {
- explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask;
- types[XkbGroup1Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index);
- types[XkbGroup2Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup2Index);
- types[XkbGroup3Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup3Index);
- types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index);
- nG= XkbKeyTypesForCoreSymbols(xkb,pCore->mapWidth,syms,explicit,types,
- tsyms);
- XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc);
- memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms,
- XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
- }
- if (changes->map.changed&XkbKeySymsMask) {
- CARD8 oldLast,newLast;
- oldLast = changes->map.first_key_sym+changes->map.num_key_syms-1;
- newLast = first+num-1;
-
- if (first<changes->map.first_key_sym)
- changes->map.first_key_sym = first;
- if (oldLast>newLast)
- newLast= oldLast;
- changes->map.num_key_syms = newLast-changes->map.first_key_sym+1;
- }
- else {
- changes->map.changed|= XkbKeySymsMask;
- changes->map.first_key_sym = first;
- changes->map.num_key_syms = num;
- }
- return;
-}
-
-void
-XkbUpdateDescActions( XkbDescPtr xkb,
- KeyCode first,
- CARD8 num,
- XkbChangesPtr changes)
-{
-register unsigned key;
-
- for (key=first;key<(first+num);key++) {
- XkbApplyCompatMapToKey(xkb,key,changes);
- }
-
- if (changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask)) {
- unsigned char newVMods[XkbNumVirtualMods];
- register unsigned bit,i;
- unsigned present;
-
- bzero(newVMods,XkbNumVirtualMods);
- present= 0;
- for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) {
- if (xkb->server->vmodmap[key]==0)
- continue;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (bit&xkb->server->vmodmap[key]) {
- present|= bit;
- newVMods[i]|= xkb->map->modmap[key];
- }
- }
- }
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if ((bit&present)&&(newVMods[i]!=xkb->server->vmods[i])) {
- changes->map.changed|= XkbVirtualModsMask;
- changes->map.vmods|= bit;
- xkb->server->vmods[i]= newVMods[i];
- }
- }
- }
- if (changes->map.changed&XkbVirtualModsMask)
- XkbApplyVirtualModChanges(xkb,changes->map.vmods,changes);
-
- if (changes->map.changed&XkbKeyActionsMask) {
- CARD8 oldLast,newLast;
- oldLast= changes->map.first_key_act+changes->map.num_key_acts-1;
- newLast = first+num-1;
-
- if (first<changes->map.first_key_act)
- changes->map.first_key_act = first;
- if (newLast>oldLast)
- newLast= oldLast;
- changes->map.num_key_acts= newLast-changes->map.first_key_act+1;
- }
- else {
- changes->map.changed|= XkbKeyActionsMask;
- changes->map.first_key_act = first;
- changes->map.num_key_acts = num;
- }
- return;
-}
-
-void
-XkbUpdateActions( DeviceIntPtr pXDev,
- KeyCode first,
- CARD8 num,
- XkbChangesPtr changes,
- unsigned * needChecksRtrn,
- XkbEventCausePtr cause)
-{
-XkbSrvInfoPtr xkbi;
-XkbDescPtr xkb;
-CARD8 * repeat;
-
- if (needChecksRtrn)
- *needChecksRtrn= 0;
- xkbi= pXDev->key->xkbInfo;
- xkb= xkbi->desc;
- repeat= xkb->ctrls->per_key_repeat;
-
- if (pXDev->kbdfeed)
- memcpy(repeat,pXDev->kbdfeed->ctrl.autoRepeats,32);
-
- XkbUpdateDescActions(xkb,first,num,changes);
-
- if ((pXDev->kbdfeed)&&
- (changes->ctrls.enabled_ctrls_changes&XkbPerKeyRepeatMask)) {
- memcpy(pXDev->kbdfeed->ctrl.autoRepeats,repeat, 32);
- (*pXDev->kbdfeed->CtrlProc)(pXDev, &pXDev->kbdfeed->ctrl);
- }
- return;
-}
-
-void
-XkbUpdateCoreDescription(DeviceIntPtr keybd,Bool resize)
-{
-register int key,tmp;
-int maxSymsPerKey,maxKeysPerMod;
-int first,last,firstCommon,lastCommon;
-XkbDescPtr xkb;
-KeyClassPtr keyc;
-CARD8 keysPerMod[XkbNumModifiers];
-
- if (!keybd || !keybd->key || !keybd->key->xkbInfo)
- return;
- xkb= keybd->key->xkbInfo->desc;
- keyc= keybd->key;
- maxSymsPerKey= maxKeysPerMod= 0;
- bzero(keysPerMod,sizeof(keysPerMod));
- memcpy(keyc->modifierMap,xkb->map->modmap,xkb->max_key_code+1);
- if ((xkb->min_key_code==keyc->curKeySyms.minKeyCode)&&
- (xkb->max_key_code==keyc->curKeySyms.maxKeyCode)) {
- first= firstCommon= xkb->min_key_code;
- last= lastCommon= xkb->max_key_code;
- }
- else if (resize) {
- keyc->curKeySyms.minKeyCode= xkb->min_key_code;
- keyc->curKeySyms.maxKeyCode= xkb->max_key_code;
- tmp= keyc->curKeySyms.mapWidth*_XkbCoreNumKeys(keyc);
- keyc->curKeySyms.map= _XkbTypedRealloc(keyc->curKeySyms.map,tmp,KeySym);
- if (!keyc->curKeySyms.map)
- FatalError("Couldn't allocate keysyms\n");
- first= firstCommon= xkb->min_key_code;
- last= lastCommon= xkb->max_key_code;
- }
- else {
- if (xkb->min_key_code<keyc->curKeySyms.minKeyCode) {
- first= xkb->min_key_code;
- firstCommon= keyc->curKeySyms.minKeyCode;
- }
- else {
- firstCommon= xkb->min_key_code;
- first= keyc->curKeySyms.minKeyCode;
- }
- if (xkb->max_key_code>keyc->curKeySyms.maxKeyCode) {
- lastCommon= keyc->curKeySyms.maxKeyCode;
- last= xkb->max_key_code;
- }
- else {
- lastCommon= xkb->max_key_code;
- last= keyc->curKeySyms.maxKeyCode;
- }
- }
-
- /* determine sizes */
- for (key=first;key<=last;key++) {
- if (XkbKeycodeInRange(xkb,key)) {
- int nGroups;
- int w;
- nGroups= XkbKeyNumGroups(xkb,key);
- tmp= 0;
- if (nGroups>0) {
- if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup1Index))<=2)
- tmp+= 2;
- else tmp+= w + 2;
- }
- if (nGroups>1) {
- if (tmp <= 2) {
- if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup2Index))<2)
- tmp+= 2;
- else tmp+= w;
- } else {
- if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup2Index))>2)
- tmp+= w - 2;
- }
- }
- if (nGroups>2)
- tmp+= XkbKeyGroupWidth(xkb,key,XkbGroup3Index);
- if (nGroups>3)
- tmp+= XkbKeyGroupWidth(xkb,key,XkbGroup4Index);
- if (tmp>maxSymsPerKey)
- maxSymsPerKey= tmp;
- }
- if (_XkbCoreKeycodeInRange(keyc,key)) {
- if (keyc->modifierMap[key]!=0) {
- register unsigned bit,i,mask;
- mask= keyc->modifierMap[key];
- for (i=0,bit=1;i<XkbNumModifiers;i++,bit<<=1) {
- if (mask&bit) {
- keysPerMod[i]++;
- if (keysPerMod[i]>maxKeysPerMod)
- maxKeysPerMod= keysPerMod[i];
- }
- }
- }
- }
- }
-
- if (maxKeysPerMod>0) {
- tmp= maxKeysPerMod*XkbNumModifiers;
- if (keyc->modifierKeyMap==NULL)
- keyc->modifierKeyMap= (KeyCode *)_XkbCalloc(1, tmp);
- else if (keyc->maxKeysPerModifier<maxKeysPerMod)
- keyc->modifierKeyMap= (KeyCode *)_XkbRealloc(keyc->modifierKeyMap,tmp);
- if (keyc->modifierKeyMap==NULL)
- FatalError("Couldn't allocate modifierKeyMap in UpdateCore\n");
- bzero(keyc->modifierKeyMap,tmp);
- }
- else if ((keyc->maxKeysPerModifier>0)&&(keyc->modifierKeyMap!=NULL)) {
- _XkbFree(keyc->modifierKeyMap);
- keyc->modifierKeyMap= NULL;
- }
- keyc->maxKeysPerModifier= maxKeysPerMod;
-
- if (maxSymsPerKey>0) {
- tmp= maxSymsPerKey*_XkbCoreNumKeys(keyc);
- keyc->curKeySyms.map= _XkbTypedRealloc(keyc->curKeySyms.map,tmp,KeySym);
- if (keyc->curKeySyms.map==NULL)
- FatalError("Couldn't allocate symbols map in UpdateCore\n");
- }
- else if ((keyc->curKeySyms.mapWidth>0)&&(keyc->curKeySyms.map!=NULL)) {
- _XkbFree(keyc->curKeySyms.map);
- keyc->curKeySyms.map= NULL;
- }
- keyc->curKeySyms.mapWidth= maxSymsPerKey;
-
- bzero(keysPerMod,sizeof(keysPerMod));
- for (key=firstCommon;key<=lastCommon;key++) {
- if (keyc->curKeySyms.map!=NULL) {
- KeySym *pCore,*pXKB;
- unsigned nGroups,groupWidth,n,nOut;
-
- nGroups= XkbKeyNumGroups(xkb,key);
- n= (key-keyc->curKeySyms.minKeyCode)*maxSymsPerKey;
- pCore= &keyc->curKeySyms.map[n];
- bzero(pCore,maxSymsPerKey*sizeof(KeySym));
- pXKB= XkbKeySymsPtr(xkb,key);
- nOut= 2;
- if (nGroups>0) {
- groupWidth= XkbKeyGroupWidth(xkb,key,XkbGroup1Index);
- if (groupWidth>0) pCore[0]= pXKB[0];
- if (groupWidth>1) pCore[1]= pXKB[1];
- for (n=2;n<groupWidth;n++) {
- pCore[2+n]= pXKB[n];
- }
- if (groupWidth>2)
- nOut= groupWidth;
- }
- pXKB+= XkbKeyGroupsWidth(xkb,key);
- nOut+= 2;
- if (nGroups>1) {
- groupWidth= XkbKeyGroupWidth(xkb,key,XkbGroup2Index);
- if (groupWidth>0) pCore[2]= pXKB[0];
- if (groupWidth>1) pCore[3]= pXKB[1];
- for (n=2;n<groupWidth;n++) {
- pCore[nOut+(n-2)]= pXKB[n];
- }
- if (groupWidth>2)
- nOut+= (groupWidth-2);
- }
- pXKB+= XkbKeyGroupsWidth(xkb,key);
- for (n=XkbGroup3Index;n<nGroups;n++) {
- register int s;
- groupWidth= XkbKeyGroupWidth(xkb,key,n);
- for (s=0;s<groupWidth;s++) {
- pCore[nOut++]= pXKB[s];
- }
- pXKB+= XkbKeyGroupsWidth(xkb,key);
- }
- if (!pCore[2] && !pCore[3] && maxSymsPerKey >= 6 &&
- (pCore[4] || pCore[5])) {
- pCore[2] = pCore[4];
- pCore[3] = pCore[5];
- }
- }
- if (keyc->modifierMap[key]!=0) {
- register unsigned bit,i,mask;
- mask= keyc->modifierMap[key];
- for (i=0,bit=1;i<XkbNumModifiers;i++,bit<<=1) {
- if (mask&bit) {
- tmp= i*maxKeysPerMod+keysPerMod[i];
- keyc->modifierKeyMap[tmp]= key;
- keysPerMod[i]++;
- }
- }
- }
- }
-#ifdef MODE_SWITCH
- /* Fix up any of the KME stuff if we changed the core description.
- */
- if (!noKME)
- HandleKeyBinding(keyc, &keyc->curKeySyms);
-#endif
- return;
-}
-
-void
-XkbSetRepeatKeys(DeviceIntPtr pXDev,int key,int onoff)
-{
- if (pXDev && pXDev->key && pXDev->key->xkbInfo) {
- xkbControlsNotify cn;
- XkbControlsPtr ctrls = pXDev->key->xkbInfo->desc->ctrls;
- XkbControlsRec old;
- old = *ctrls;
-
- if (key== -1) { /* global autorepeat setting changed */
- if (onoff) ctrls->enabled_ctrls |= XkbRepeatKeysMask;
- else ctrls->enabled_ctrls &= ~XkbRepeatKeysMask;
- }
- else if (pXDev->kbdfeed) {
- ctrls->per_key_repeat[key/8] =
- pXDev->kbdfeed->ctrl.autoRepeats[key/8];
- }
-
- if (XkbComputeControlsNotify(pXDev,&old,ctrls,&cn,True))
- XkbSendControlsNotify(pXDev,&cn);
- }
- return;
-}
-
-void
-XkbApplyMappingChange( DeviceIntPtr kbd,
- CARD8 request,
- KeyCode firstKey,
- CARD8 num,
- ClientPtr client)
-{
-XkbEventCauseRec cause;
-XkbChangesRec changes;
-unsigned check;
-
- if (kbd->key->xkbInfo==NULL)
- XkbInitDevice(kbd);
- bzero(&changes,sizeof(XkbChangesRec));
- check= 0;
- if (request==MappingKeyboard) {
- XkbSetCauseCoreReq(&cause,X_ChangeKeyboardMapping,client);
- XkbUpdateKeyTypesFromCore(kbd,firstKey,num,&changes);
- XkbUpdateActions(kbd,firstKey,num,&changes,&check,&cause);
- if (check)
- XkbCheckSecondaryEffects(kbd->key->xkbInfo,check,&changes,&cause);
- }
- else if (request==MappingModifier) {
- XkbDescPtr xkb= kbd->key->xkbInfo->desc;
-
- XkbSetCauseCoreReq(&cause,X_SetModifierMapping,client);
-
- num = xkb->max_key_code-xkb->min_key_code+1;
- memcpy(xkb->map->modmap,kbd->key->modifierMap,xkb->max_key_code+1);
-
- changes.map.changed|= XkbModifierMapMask;
- changes.map.first_modmap_key= xkb->min_key_code;
- changes.map.num_modmap_keys= num;
- XkbUpdateActions(kbd,xkb->min_key_code,num,&changes,&check,&cause);
- if (check)
- XkbCheckSecondaryEffects(kbd->key->xkbInfo,check,&changes,&cause);
- }
- /* 3/26/94 (ef) -- XXX! Doesn't deal with input extension requests */
- XkbSendNotification(kbd,&changes,&cause);
- return;
-}
-
-void
-XkbDisableComputedAutoRepeats(DeviceIntPtr dev,unsigned key)
-{
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
-xkbMapNotify mn;
-
- xkbi->desc->server->explicit[key]|= XkbExplicitAutoRepeatMask;
- bzero(&mn,sizeof(mn));
- mn.changed= XkbExplicitComponentsMask;
- mn.firstKeyExplicit= key;
- mn.nKeyExplicit= 1;
- XkbSendMapNotify(dev,&mn);
- return;
-}
-
-unsigned
-XkbStateChangedFlags(XkbStatePtr old,XkbStatePtr new)
-{
-int changed;
-
- changed=(old->group!=new->group?XkbGroupStateMask:0);
- changed|=(old->base_group!=new->base_group?XkbGroupBaseMask:0);
- changed|=(old->latched_group!=new->latched_group?XkbGroupLatchMask:0);
- changed|=(old->locked_group!=new->locked_group?XkbGroupLockMask:0);
- changed|=(old->mods!=new->mods?XkbModifierStateMask:0);
- changed|=(old->base_mods!=new->base_mods?XkbModifierBaseMask:0);
- changed|=(old->latched_mods!=new->latched_mods?XkbModifierLatchMask:0);
- changed|=(old->locked_mods!=new->locked_mods?XkbModifierLockMask:0);
- changed|=(old->compat_state!=new->compat_state?XkbCompatStateMask:0);
- changed|=(old->grab_mods!=new->grab_mods?XkbGrabModsMask:0);
- if (old->compat_grab_mods!=new->compat_grab_mods)
- changed|= XkbCompatGrabModsMask;
- changed|=(old->lookup_mods!=new->lookup_mods?XkbLookupModsMask:0);
- if (old->compat_lookup_mods!=new->compat_lookup_mods)
- changed|= XkbCompatLookupModsMask;
- changed|=(old->ptr_buttons!=new->ptr_buttons?XkbPointerButtonMask:0);
- return changed;
-}
-
-void
-XkbComputeCompatState(XkbSrvInfoPtr xkbi)
-{
-CARD16 grp_mask;
-XkbStatePtr state= &xkbi->state;
-XkbCompatMapPtr map;
-
- map= xkbi->desc->compat;
- grp_mask= map->groups[state->group].mask;
- state->compat_state = state->mods|grp_mask;
- state->compat_lookup_mods= state->lookup_mods|grp_mask;
-
- if (xkbi->desc->ctrls->enabled_ctrls&XkbIgnoreGroupLockMask)
- grp_mask= map->groups[state->base_group].mask;
- state->compat_grab_mods= state->grab_mods|grp_mask;
- return;
-}
-
-unsigned
-XkbAdjustGroup(int group,XkbControlsPtr ctrls)
-{
-unsigned act;
-
- act= XkbOutOfRangeGroupAction(ctrls->groups_wrap);
- if (group<0) {
- while ( group < 0 ) {
- if (act==XkbClampIntoRange) {
- group= XkbGroup1Index;
- }
- else if (act==XkbRedirectIntoRange) {
- int newGroup;
- newGroup= XkbOutOfRangeGroupNumber(ctrls->groups_wrap);
- if (newGroup>=ctrls->num_groups)
- group= XkbGroup1Index;
- else group= newGroup;
- }
- else {
- group+= ctrls->num_groups;
- }
- }
- }
- else if (group>=ctrls->num_groups) {
- if (act==XkbClampIntoRange) {
- group= ctrls->num_groups-1;
- }
- else if (act==XkbRedirectIntoRange) {
- int newGroup;
- newGroup= XkbOutOfRangeGroupNumber(ctrls->groups_wrap);
- if (newGroup>=ctrls->num_groups)
- group= XkbGroup1Index;
- else group= newGroup;
- }
- else {
- group%= ctrls->num_groups;
- }
- }
- return group;
-}
-
-void
-XkbComputeDerivedState(XkbSrvInfoPtr xkbi)
-{
-XkbStatePtr state= &xkbi->state;
-XkbControlsPtr ctrls= xkbi->desc->ctrls;
-unsigned char grp;
-
- state->mods= (state->base_mods|state->latched_mods);
- state->mods|= state->locked_mods;
- state->lookup_mods= state->mods&(~ctrls->internal.mask);
- state->grab_mods= state->lookup_mods&(~ctrls->ignore_lock.mask);
- state->grab_mods|=
- ((state->base_mods|state->latched_mods)&ctrls->ignore_lock.mask);
-
-
- grp= state->locked_group;
- if (grp>=ctrls->num_groups)
- state->locked_group= XkbAdjustGroup(grp,ctrls);
-
- grp= state->locked_group+state->base_group+state->latched_group;
- if (grp>=ctrls->num_groups)
- state->group= XkbAdjustGroup(grp,ctrls);
- else state->group= grp;
- XkbComputeCompatState(xkbi);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbCheckSecondaryEffects( XkbSrvInfoPtr xkbi,
- unsigned which,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
- if (which&XkbStateNotifyMask) {
- XkbStateRec old;
- old= xkbi->state;
- changes->state_changes|= XkbStateChangedFlags(&old,&xkbi->state);
- XkbComputeDerivedState(xkbi);
- }
- if (which&XkbIndicatorStateNotifyMask)
- XkbUpdateIndicators(xkbi->device,XkbAllIndicatorsMask,True,changes,
- cause);
- return;
-}
-
-/***====================================================================***/
-
-void
-XkbSetPhysicalLockingKey(DeviceIntPtr dev,unsigned key)
-{
-XkbDescPtr xkb;
-
- xkb= dev->key->xkbInfo->desc;
- if ((key>=xkb->min_key_code) && (key<=xkb->max_key_code)) {
- xkb->server->behaviors[key].type= XkbKB_Lock|XkbKB_Permanent;
- }
- else ErrorF("Internal Error! Bad XKB info in SetPhysicalLockingKey\n");
- return;
-}
-
-/***====================================================================***/
-
-Bool
-XkbEnableDisableControls( XkbSrvInfoPtr xkbi,
- unsigned long change,
- unsigned long newValues,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-XkbControlsPtr ctrls;
-unsigned old;
-XkbSrvLedInfoPtr sli;
-
- ctrls= xkbi->desc->ctrls;
- old= ctrls->enabled_ctrls;
- ctrls->enabled_ctrls&= ~change;
- ctrls->enabled_ctrls|= (change&newValues);
- if (old==ctrls->enabled_ctrls)
- return False;
- if (cause!=NULL) {
- xkbControlsNotify cn;
- cn.numGroups= ctrls->num_groups;
- cn.changedControls|= XkbControlsEnabledMask;
- cn.enabledControls= ctrls->enabled_ctrls;
- cn.enabledControlChanges= (ctrls->enabled_ctrls^old);
- cn.keycode= cause->kc;
- cn.eventType= cause->event;
- cn.requestMajor= cause->mjr;
- cn.requestMinor= cause->mnr;
- XkbSendControlsNotify(xkbi->device,&cn);
- }
- else {
- /* Yes, this really should be an XOR. If ctrls->enabled_ctrls_changes*/
- /* is non-zero, the controls in question changed already in "this" */
- /* request and this change merely undoes the previous one. By the */
- /* same token, we have to figure out whether or not ControlsEnabled */
- /* should be set or not in the changes structure */
- changes->ctrls.enabled_ctrls_changes^= (ctrls->enabled_ctrls^old);
- if (changes->ctrls.enabled_ctrls_changes)
- changes->ctrls.changed_ctrls|= XkbControlsEnabledMask;
- else changes->ctrls.changed_ctrls&= ~XkbControlsEnabledMask;
- }
- sli= XkbFindSrvLedInfo(xkbi->device,XkbDfltXIClass,XkbDfltXIId,0);
- XkbUpdateIndicators(xkbi->device,sli->usesControls,True,changes,cause);
- return True;
-}
-
-/***====================================================================***/
-
-#define MAX_TOC 16
-
-XkbGeometryPtr
-XkbLookupNamedGeometry(DeviceIntPtr dev,Atom name,Bool *shouldFree)
-{
-XkbSrvInfoPtr xkbi= dev->key->xkbInfo;
-XkbDescPtr xkb= xkbi->desc;
-
- *shouldFree= 0;
- if (name==None) {
- if (xkb->geom!=NULL)
- return xkb->geom;
- name= xkb->names->geometry;
- }
- if ((xkb->geom!=NULL)&&(xkb->geom->name==name))
- return xkb->geom;
- else if ((name==xkb->names->geometry)&&(xkb->geom==NULL)) {
- FILE *file= XkbDDXOpenConfigFile(XkbInitialMap,NULL,0);
- if (file!=NULL) {
- XkbFileInfo xkbFInfo;
- xkmFileInfo finfo;
- xkmSectionInfo toc[MAX_TOC],*entry;
- bzero(&xkbFInfo,sizeof(xkbFInfo));
- xkbFInfo.xkb= xkb;
- if (XkmReadTOC(file,&finfo,MAX_TOC,toc)) {
- entry= XkmFindTOCEntry(&finfo,toc,XkmGeometryIndex);
- if (entry!=NULL)
- XkmReadFileSection(file,entry,&xkbFInfo,NULL);
- }
- fclose(file);
- if (xkb->geom) {
- *shouldFree= 0;
- return xkb->geom;
- }
- }
- }
- *shouldFree= 1;
- return NULL;
-}
-
-void
-XkbConvertCase(register KeySym sym, KeySym *lower, KeySym *upper)
-{
- *lower = sym;
- *upper = sym;
- switch(sym >> 8) {
- case 0: /* Latin 1 */
- if ((sym >= XK_A) && (sym <= XK_Z))
- *lower += (XK_a - XK_A);
- else if ((sym >= XK_a) && (sym <= XK_z))
- *upper -= (XK_a - XK_A);
- else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
- *lower += (XK_agrave - XK_Agrave);
- else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
- *upper -= (XK_agrave - XK_Agrave);
- else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
- *lower += (XK_oslash - XK_Ooblique);
- else if ((sym >= XK_oslash) && (sym <= XK_thorn))
- *upper -= (XK_oslash - XK_Ooblique);
- break;
- case 1: /* Latin 2 */
- /* Assume the KeySym is a legal value (ignore discontinuities) */
- if (sym == XK_Aogonek)
- *lower = XK_aogonek;
- else if (sym >= XK_Lstroke && sym <= XK_Sacute)
- *lower += (XK_lstroke - XK_Lstroke);
- else if (sym >= XK_Scaron && sym <= XK_Zacute)
- *lower += (XK_scaron - XK_Scaron);
- else if (sym >= XK_Zcaron && sym <= XK_Zabovedot)
- *lower += (XK_zcaron - XK_Zcaron);
- else if (sym == XK_aogonek)
- *upper = XK_Aogonek;
- else if (sym >= XK_lstroke && sym <= XK_sacute)
- *upper -= (XK_lstroke - XK_Lstroke);
- else if (sym >= XK_scaron && sym <= XK_zacute)
- *upper -= (XK_scaron - XK_Scaron);
- else if (sym >= XK_zcaron && sym <= XK_zabovedot)
- *upper -= (XK_zcaron - XK_Zcaron);
- else if (sym >= XK_Racute && sym <= XK_Tcedilla)
- *lower += (XK_racute - XK_Racute);
- else if (sym >= XK_racute && sym <= XK_tcedilla)
- *upper -= (XK_racute - XK_Racute);
- break;
- case 2: /* Latin 3 */
- /* Assume the KeySym is a legal value (ignore discontinuities) */
- if (sym >= XK_Hstroke && sym <= XK_Hcircumflex)
- *lower += (XK_hstroke - XK_Hstroke);
- else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex)
- *lower += (XK_gbreve - XK_Gbreve);
- else if (sym >= XK_hstroke && sym <= XK_hcircumflex)
- *upper -= (XK_hstroke - XK_Hstroke);
- else if (sym >= XK_gbreve && sym <= XK_jcircumflex)
- *upper -= (XK_gbreve - XK_Gbreve);
- else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
- *lower += (XK_cabovedot - XK_Cabovedot);
- else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
- *upper -= (XK_cabovedot - XK_Cabovedot);
- break;
- case 3: /* Latin 4 */
- /* Assume the KeySym is a legal value (ignore discontinuities) */
- if (sym >= XK_Rcedilla && sym <= XK_Tslash)
- *lower += (XK_rcedilla - XK_Rcedilla);
- else if (sym >= XK_rcedilla && sym <= XK_tslash)
- *upper -= (XK_rcedilla - XK_Rcedilla);
- else if (sym == XK_ENG)
- *lower = XK_eng;
- else if (sym == XK_eng)
- *upper = XK_ENG;
- else if (sym >= XK_Amacron && sym <= XK_Umacron)
- *lower += (XK_amacron - XK_Amacron);
- else if (sym >= XK_amacron && sym <= XK_umacron)
- *upper -= (XK_amacron - XK_Amacron);
- break;
- case 6: /* Cyrillic */
- /* Assume the KeySym is a legal value (ignore discontinuities) */
- if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE)
- *lower -= (XK_Serbian_DJE - XK_Serbian_dje);
- else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze)
- *upper += (XK_Serbian_DJE - XK_Serbian_dje);
- else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN)
- *lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
- else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign)
- *upper += (XK_Cyrillic_YU - XK_Cyrillic_yu);
- break;
- case 7: /* Greek */
- /* Assume the KeySym is a legal value (ignore discontinuities) */
- if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent)
- *lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
- else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent &&
- sym != XK_Greek_iotaaccentdieresis &&
- sym != XK_Greek_upsilonaccentdieresis)
- *upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
- else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA)
- *lower += (XK_Greek_alpha - XK_Greek_ALPHA);
- else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega &&
- sym != XK_Greek_finalsmallsigma)
- *upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
- break;
- }
-}
diff --git a/xkb/xkbconfig.c b/xkb/xkbconfig.c
deleted file mode 100644
index 0e480b4df..000000000
--- a/xkb/xkbconfig.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/* $Xorg: xkbconfig.c,v 1.4 2000/08/17 19:46:43 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkbconfig.c,v 3.8 2003/11/17 22:20:23 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#include <X11/Xfuncs.h>
-
-#include <X11/Xfuncs.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <X11/Xos.h>
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
-#include <X11/XKBlib.h>
-#include "XKBfileInt.h"
-
-#else
-
-#include "X.h"
-#define NEED_EVENTS
-#include <X11/keysym.h>
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "dix.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#endif
-
-#include <X11/extensions/XKBconfig.h>
-
-/***====================================================================***/
-
-#define XKBCF_MAX_STR_LEN 100
-static char _XkbCF_rtrn[XKBCF_MAX_STR_LEN+1];
-
-static int
-ScanIdent(FILE *file,int ch,XkbCFScanResultPtr val_rtrn)
-{
-register int i;
-char * str;
-
- val_rtrn->str= str= _XkbCF_rtrn;
- for (i=0;(isalpha(ch)||isdigit(ch)||(ch=='_'));ch=getc(file)) {
- if (i<XKBCF_MAX_STR_LEN)
- str[i++]= ch;
- }
- if ((ch!=EOF)&&(ch!=' ')&&(ch!='\t'))
- ungetc(ch,file);
- str[i]= '\0';
- return XkbCF_Ident;
-}
-
-static int
-ScanString(FILE *file,int quote,XkbCFScanResultPtr val_rtrn)
-{
-int ch,nInBuf;
-
- nInBuf = 0;
- while ( ((ch=getc(file))!=EOF) && (ch!='\n') && (ch!=quote) ) {
- if ( ch == '\\' ) {
- if ((ch = getc(file))!=EOF) {
- if ( ch=='n' ) ch = '\n';
- else if ( ch == 't' ) ch = '\t';
- else if ( ch == 'v' ) ch = '\v';
- else if ( ch == 'b' ) ch = '\b';
- else if ( ch == 'r' ) ch = '\r';
- else if ( ch == 'f' ) ch = '\f';
- else if ( ch == 'e' ) ch = '\033';
- else if ( ch == '0' ) {
- int tmp,stop;
- ch = stop = 0;
- if (((tmp=getc(file))!=EOF) && (isdigit(tmp)) &&
- (tmp!='8') && (tmp!='9')) {
- ch= (ch*8)+(tmp-'0');
- }
- else {
- stop= 1;
- ungetc(tmp,file);
- }
- if ((!stop) && ((tmp=getc(file))!=EOF) && (isdigit(tmp)) &&
- (tmp!='8') && (tmp!='9')) {
- ch= (ch*8)+(tmp-'0');
- }
- else {
- stop= 1;
- ungetc(tmp,file);
- }
- if ((!stop) && ((tmp=getc(file))!=EOF) && (isdigit(tmp)) &&
- (tmp!='8') && (tmp!='9')) {
- ch= (ch*8)+(tmp-'0');
- }
- else {
- stop= 1;
- ungetc(tmp,file);
- }
- }
- }
- else return XkbCF_EOF;
- }
-
- if ( nInBuf < XKBCF_MAX_STR_LEN-1 )
- _XkbCF_rtrn[nInBuf++] = ch;
- }
- if ( ch == quote ) {
- _XkbCF_rtrn[nInBuf++] = '\0';
- val_rtrn->str= _XkbCF_rtrn;
- return XkbCF_String;
- }
- return XkbCF_UnterminatedString;
-}
-
-static int
-ScanInteger(FILE *file,int ch,XkbCFScanResultPtr val_rtrn)
-{
-int i;
-
- if (isdigit(ch))
- ungetc(ch,file);
- if (fscanf(file,"%i",&i)==1) {
- val_rtrn->ival= i;
- return XkbCF_Integer;
- }
- return XkbCF_Unknown;
-}
-
-int
-XkbCFScan(FILE *file,XkbCFScanResultPtr val_rtrn,XkbConfigRtrnPtr rtrn)
-{
-int ch;
-
- do {
- ch= getc(file);
- } while ((ch=='\t')||(ch==' '));
- if (isalpha(ch))
- return ScanIdent(file,ch,val_rtrn);
- else if (isdigit(ch))
- return ScanInteger(file,ch,val_rtrn);
- else if (ch=='"')
- return ScanString(file,ch,val_rtrn);
- else if (ch=='\n') {
- rtrn->line++;
- return XkbCF_EOL;
- }
- else if (ch==';')
- return XkbCF_Semi;
- else if (ch=='=')
- return XkbCF_Equals;
- else if (ch=='+') {
- ch= getc(file);
- if (ch=='=')
- return XkbCF_PlusEquals;
- if ((ch!=EOF)&&(ch!=' ')&&(ch!='\t'))
- ungetc(ch,file);
- return XkbCF_Plus;
- }
- else if (ch=='-') {
- ch= getc(file);
- if (ch=='=')
- return XkbCF_MinusEquals;
- if ((ch!=EOF)&&(ch!=' ')&&(ch!='\t'))
- ungetc(ch,file);
- return XkbCF_Minus;
- }
- else if (ch==EOF)
- return XkbCF_EOF;
- else if ((ch=='#')||((ch=='/')&&(getc(file)=='/'))) {
- while ((ch!='\n')&&(ch!=EOF))
- ch= getc(file);
- rtrn->line++;
- return XkbCF_EOL;
- }
- return XkbCF_Unknown;
-}
-
-/***====================================================================***/
-
-#define _XkbCF_Illegal 0
-#define _XkbCF_Keymap 1
-#define _XkbCF_Keycodes 2
-#define _XkbCF_Geometry 3
-#define _XkbCF_PhysSymbols 4
-#define _XkbCF_Symbols 5
-#define _XkbCF_Types 6
-#define _XkbCF_CompatMap 7
-
-#define _XkbCF_RulesFile 8
-#define _XkbCF_Model 9
-#define _XkbCF_Layout 10
-#define _XkbCF_Variant 11
-#define _XkbCF_Options 12
-
-#define _XkbCF_InitialMods 13
-#define _XkbCF_InitialCtrls 14
-
-#define _XkbCF_ClickVolume 15
-#define _XkbCF_BellVolume 16
-#define _XkbCF_BellPitch 17
-#define _XkbCF_BellDuration 18
-#define _XkbCF_RepeatDelay 19
-#define _XkbCF_RepeatInterval 20
-#define _XkbCF_SlowKeysDelay 21
-#define _XkbCF_DebounceDelay 22
-#define _XkbCF_MouseKeysDelay 23
-#define _XkbCF_MouseKeysInterval 24
-#define _XkbCF_MouseKeysTimeToMax 25
-#define _XkbCF_MouseKeysMaxSpeed 26
-#define _XkbCF_MouseKeysCurve 27
-#define _XkbCF_AccessXTimeout 28
-#define _XkbCF_AccessXTimeoutCtrlsOn 29
-#define _XkbCF_AccessXTimeoutCtrlsOff 30
-#define _XkbCF_AccessXTimeoutOptsOn 31
-#define _XkbCF_AccessXTimeoutOptsOff 32
-
-#define _XkbCF_IgnoreLockMods 33
-#define _XkbCF_IgnoreGroupLock 34
-#define _XkbCF_InternalMods 35
-
-#define _XkbCF_GroupsWrap 36
-#define _XkbCF_InitialFeedback 37
-
-static Bool
-AddCtrlByName(XkbConfigRtrnPtr rtrn,char *name,unsigned long *ctrls_rtrn)
-{
- if ((_XkbStrCaseCmp(name,"repeat")==0)||
- (_XkbStrCaseCmp(name,"repeatkeys")==0))
- *ctrls_rtrn= XkbRepeatKeysMask;
- else if (_XkbStrCaseCmp(name,"slowkeys")==0)
- *ctrls_rtrn= XkbSlowKeysMask;
- else if (_XkbStrCaseCmp(name,"bouncekeys")==0)
- *ctrls_rtrn= XkbBounceKeysMask;
- else if (_XkbStrCaseCmp(name,"stickykeys")==0)
- *ctrls_rtrn= XkbStickyKeysMask;
- else if (_XkbStrCaseCmp(name,"mousekeys")==0)
- *ctrls_rtrn= XkbMouseKeysMask;
- else if (_XkbStrCaseCmp(name,"mousekeysaccel")==0)
- *ctrls_rtrn= XkbMouseKeysAccelMask;
- else if (_XkbStrCaseCmp(name,"accessxkeys")==0)
- *ctrls_rtrn= XkbAccessXKeysMask;
- else if (_XkbStrCaseCmp(name,"accessxtimeout")==0)
- *ctrls_rtrn= XkbAccessXTimeoutMask;
- else if (_XkbStrCaseCmp(name,"accessxfeedback")==0)
- *ctrls_rtrn= XkbAccessXFeedbackMask;
- else if (_XkbStrCaseCmp(name,"audiblebell")==0)
- *ctrls_rtrn= XkbAudibleBellMask;
- else if (_XkbStrCaseCmp(name,"overlay1")==0)
- *ctrls_rtrn= XkbOverlay1Mask;
- else if (_XkbStrCaseCmp(name,"overlay2")==0)
- *ctrls_rtrn= XkbOverlay2Mask;
- else if (_XkbStrCaseCmp(name,"ignoregrouplock")==0)
- *ctrls_rtrn= XkbIgnoreGroupLockMask;
- else {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- return True;
-}
-
-static Bool
-AddAXTimeoutOptByName( XkbConfigRtrnPtr rtrn,
- char * name,
- unsigned short * opts_rtrn)
-{
- if (_XkbStrCaseCmp(name,"slowkeyspress")==0)
- *opts_rtrn= XkbAX_SKPressFBMask;
- else if (_XkbStrCaseCmp(name,"slowkeysaccept")==0)
- *opts_rtrn= XkbAX_SKAcceptFBMask;
- else if (_XkbStrCaseCmp(name,"feature")==0)
- *opts_rtrn= XkbAX_FeatureFBMask;
- else if (_XkbStrCaseCmp(name,"slowwarn")==0)
- *opts_rtrn= XkbAX_SlowWarnFBMask;
- else if (_XkbStrCaseCmp(name,"indicator")==0)
- *opts_rtrn= XkbAX_IndicatorFBMask;
- else if (_XkbStrCaseCmp(name,"stickykeys")==0)
- *opts_rtrn= XkbAX_StickyKeysFBMask;
- else if (_XkbStrCaseCmp(name,"twokeys")==0)
- *opts_rtrn= XkbAX_TwoKeysMask;
- else if (_XkbStrCaseCmp(name,"latchtolock")==0)
- *opts_rtrn= XkbAX_LatchToLockMask;
- else if (_XkbStrCaseCmp(name,"slowkeysrelease")==0)
- *opts_rtrn= XkbAX_SKReleaseFBMask;
- else if (_XkbStrCaseCmp(name,"slowkeysreject")==0)
- *opts_rtrn= XkbAX_SKRejectFBMask;
- else if (_XkbStrCaseCmp(name,"bouncekeysreject")==0)
- *opts_rtrn= XkbAX_BKRejectFBMask;
- else if (_XkbStrCaseCmp(name,"dumbbell")==0)
- *opts_rtrn= XkbAX_DumbBellFBMask;
- else {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- return True;
-}
-
-XkbConfigUnboundModPtr
-XkbCFAddModByName( XkbConfigRtrnPtr rtrn,
- int what,
- char * name,
- Bool merge,
- XkbConfigUnboundModPtr last)
-{
- if (rtrn->num_unbound_mods>=rtrn->sz_unbound_mods) {
- rtrn->sz_unbound_mods+= 5;
- rtrn->unbound_mods= _XkbTypedRealloc(rtrn->unbound_mods,
- rtrn->sz_unbound_mods,
- XkbConfigUnboundModRec);
- if (rtrn->unbound_mods==NULL) {
- rtrn->error= XkbCF_BadAlloc;
- return False;
- }
- }
- if (last==NULL) {
- last= &rtrn->unbound_mods[rtrn->num_unbound_mods++];
- last->what= what;
- last->mods= 0;
- last->vmods= 0;
- last->merge= merge;
- last->name= NULL;
- }
- if (_XkbStrCaseCmp(name,"shift")==0)
- last->mods|= ShiftMask;
- else if (_XkbStrCaseCmp(name,"lock")==0)
- last->mods|= LockMask;
- else if ((_XkbStrCaseCmp(name,"control")==0)||
- (_XkbStrCaseCmp(name,"ctrl")==0))
- last->mods|= ControlMask;
- else if (_XkbStrCaseCmp(name,"mod1")==0)
- last->mods|= Mod1Mask;
- else if (_XkbStrCaseCmp(name,"mod2")==0)
- last->mods|= Mod2Mask;
- else if (_XkbStrCaseCmp(name,"mod3")==0)
- last->mods|= Mod3Mask;
- else if (_XkbStrCaseCmp(name,"mod4")==0)
- last->mods|= Mod4Mask;
- else if (_XkbStrCaseCmp(name,"mod5")==0)
- last->mods|= Mod5Mask;
- else {
- if (last->name!=NULL) {
- last= &rtrn->unbound_mods[rtrn->num_unbound_mods++];
- last->what= what;
- last->mods= 0;
- last->vmods= 0;
- last->merge= merge;
- last->name= NULL;
- }
- last->name= _XkbDupString(name);
- }
- return last;
-}
-
-int
-XkbCFBindMods(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb)
-{
-register int n,v;
-Atom name;
-XkbConfigUnboundModPtr mod;
-int missing;
-
- if (rtrn->num_unbound_mods<1)
- return 0;
- if ((xkb==NULL) || (xkb->names==NULL))
- return -1;
-
- missing= 0;
- for (n=0,mod=rtrn->unbound_mods;n<rtrn->num_unbound_mods;n++,mod++) {
- if (mod->name!=NULL) {
- name= XkbInternAtom(xkb->dpy,mod->name,True);
- if (name==None)
- continue;
- for (v=0;v<XkbNumVirtualMods;v++) {
- if (xkb->names->vmods[v]==name) {
- mod->vmods= (1<<v);
- _XkbFree(mod->name);
- mod->name= NULL;
- break;
- }
- }
- if (mod->name!=NULL)
- missing++;
- }
- }
- return missing;
-}
-
-Bool
-XkbCFApplyMods(XkbConfigRtrnPtr rtrn,int what,XkbConfigModInfoPtr info)
-{
-register int n;
-XkbConfigUnboundModPtr mod;
-
- if (rtrn->num_unbound_mods<1)
- return True;
-
- for (n=0,mod=rtrn->unbound_mods;n<rtrn->num_unbound_mods;n++,mod++) {
- if (mod->what!=what)
- continue;
- if (mod->merge==XkbCF_MergeRemove) {
- info->mods_clear|= mod->mods;
- info->vmods_clear|= mod->vmods;
- }
- else {
- if (mod->merge==XkbCF_MergeSet)
- info->replace= True;
- info->mods|= mod->mods;
- info->vmods|= mod->vmods;
- }
- if (mod->name==NULL) {
- mod->what= _XkbCF_Illegal;
- }
- else {
- mod->mods= 0;
- mod->vmods= 0;
- }
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-DefaultParser( FILE * file,
- XkbConfigFieldsPtr fields,
- XkbConfigFieldPtr field,
- XkbDescPtr xkb,
- XkbConfigRtrnPtr rtrn)
-{
-int tok;
-XkbCFScanResultRec val;
-char ** str;
-int merge;
-unsigned long * ctrls, ctrls_mask;
-unsigned short * opts, opts_mask;
-int * pival, sign;
-int onoff;
-XkbConfigUnboundModPtr last;
-unsigned what;
-
- tok= XkbCFScan(file,&val,rtrn);
- str= NULL;
- onoff= 0;
- pival= NULL;
- switch (field->field_id) {
- case _XkbCF_RulesFile: if (!str) str= &rtrn->rules_file;
- case _XkbCF_Model: if (!str) str= &rtrn->model;
- case _XkbCF_Layout: if (!str) str= &rtrn->layout;
- case _XkbCF_Variant: if (!str) str= &rtrn->variant;
- case _XkbCF_Options: if (!str) str= &rtrn->options;
- case _XkbCF_Keymap: if (!str) str= &rtrn->keymap;
- case _XkbCF_Keycodes: if (!str) str= &rtrn->keycodes;
- case _XkbCF_Geometry: if (!str) str= &rtrn->geometry;
- case _XkbCF_PhysSymbols:if (!str) str= &rtrn->phys_symbols;
- case _XkbCF_Symbols: if (!str) str= &rtrn->symbols;
- case _XkbCF_Types: if (!str) str= &rtrn->types;
- case _XkbCF_CompatMap: if (!str) str= &rtrn->compat;
- if (tok!=XkbCF_Equals) {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_String)&&(tok!=XkbCF_Ident)) {
- rtrn->error= XkbCF_ExpectedString;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedEOS;
- return False;
- }
- if (*str!=NULL)
- _XkbFree(*str);
- *str= _XkbDupString(val.str);
- break;
- case _XkbCF_InitialMods:
- case _XkbCF_IgnoreLockMods:
- case _XkbCF_InternalMods:
- what= XkbCF_InitialMods;
- if (field->field_id==_XkbCF_InitialMods)
- rtrn->defined|= (what=XkbCF_InitialMods);
- else if (field->field_id==_XkbCF_InternalMods)
- rtrn->defined|= (what=XkbCF_InternalMods);
- else if (field->field_id==_XkbCF_IgnoreLockMods)
- rtrn->defined|= (what=XkbCF_IgnoreLockMods);
- if (tok==XkbCF_Equals) merge= XkbCF_MergeSet;
- else if (tok==XkbCF_MinusEquals) merge= XkbCF_MergeRemove;
- else if (tok==XkbCF_PlusEquals) merge= XkbCF_MergeAdd;
- else {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok==XkbCF_EOL)||(tok==XkbCF_Semi)||(tok==XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedModifier;
- return False;
- }
- last= NULL;
- while ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- if ((tok!=XkbCF_Ident)&&(tok!=XkbCF_String)) {
- rtrn->error= XkbCF_ExpectedModifier;
- return False;
- }
- last=XkbCFAddModByName(rtrn,what,val.str,merge,last);
- if (last==NULL)
- return False;
- if (merge==XkbCF_MergeSet)
- merge= XkbCF_MergeAdd;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_EOF)&&(tok!=XkbCF_Semi)) {
- if (tok!=XkbCF_Plus) {
- rtrn->error= XkbCF_ExpectedOperator;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- }
- }
- break;
- case _XkbCF_InitialCtrls:
- rtrn->defined|= XkbCF_InitialCtrls;
- ctrls= NULL;
- if (tok==XkbCF_PlusEquals)
- ctrls= &rtrn->initial_ctrls;
- else if (tok==XkbCF_MinusEquals)
- ctrls= &rtrn->initial_ctrls_clear;
- else if (tok==XkbCF_Equals) {
- ctrls= &rtrn->initial_ctrls;
- rtrn->replace_initial_ctrls= True;
- *ctrls= 0;
- }
- else {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok==XkbCF_EOL)||(tok==XkbCF_Semi)||(tok==XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- while ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- if ((tok!=XkbCF_Ident)&&(tok!=XkbCF_String)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- if (!AddCtrlByName(rtrn,val.str,&ctrls_mask)) {
- return False;
- }
- *ctrls |= ctrls_mask;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_EOF)&&(tok!=XkbCF_Semi)) {
- if (tok!=XkbCF_Plus) {
- rtrn->error= XkbCF_ExpectedOperator;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- }
- }
- break;
- case _XkbCF_AccessXTimeoutCtrlsOn:
- case _XkbCF_AccessXTimeoutCtrlsOff:
- opts= NULL;
- if (tok==XkbCF_MinusEquals) {
- ctrls= &rtrn->axt_ctrls_ignore;
- opts= &rtrn->axt_opts_ignore;
- }
- else if ((tok==XkbCF_PlusEquals)||(tok==XkbCF_Equals)) {
- if (field->field_id==_XkbCF_AccessXTimeoutCtrlsOff) {
- ctrls= &rtrn->axt_ctrls_off;
- opts= &rtrn->axt_opts_off;
- if (tok==XkbCF_Equals)
- rtrn->replace_axt_ctrls_off= True;
- }
- else {
- ctrls= &rtrn->axt_ctrls_on;
- opts= &rtrn->axt_opts_on;
- if (tok==XkbCF_Equals)
- rtrn->replace_axt_ctrls_on= True;
- }
- *ctrls= 0;
- }
- else {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok==XkbCF_EOL)||(tok==XkbCF_Semi)||(tok==XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- while ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- if ((tok!=XkbCF_Ident)&&(tok!=XkbCF_String)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- if (!AddCtrlByName(rtrn,val.str,&ctrls_mask)) {
- if (!AddAXTimeoutOptByName(rtrn,val.str,&opts_mask))
- return False;
- *opts |= opts_mask;
- if (field->field_id==_XkbCF_AccessXTimeoutCtrlsOff) {
- rtrn->defined|= XkbCF_AccessXTimeoutOptsOff;
- if (rtrn->replace_axt_ctrls_off)
- rtrn->replace_axt_opts_off= True;
- }
- else {
- rtrn->defined|= XkbCF_AccessXTimeoutOptsOn;
- if (rtrn->replace_axt_ctrls_on)
- rtrn->replace_axt_opts_on= True;
- }
- }
- else
- *ctrls |= ctrls_mask;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_EOF)&&(tok!=XkbCF_Semi)) {
- if (tok!=XkbCF_Plus) {
- rtrn->error= XkbCF_ExpectedOperator;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- }
- }
- break;
- case _XkbCF_InitialFeedback:
- rtrn->defined|= XkbCF_InitialOpts;
- opts= NULL;
- if (tok==XkbCF_PlusEquals)
- opts= &rtrn->initial_opts;
- else if (tok==XkbCF_MinusEquals)
- opts= &rtrn->initial_opts_clear;
- else if (tok==XkbCF_Equals) {
- opts= &rtrn->initial_opts;
- rtrn->replace_initial_opts= True;
- *opts= 0;
- }
- else {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok==XkbCF_EOL)||(tok==XkbCF_Semi)||(tok==XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedAXOption;
- return False;
- }
- while ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- if ((tok!=XkbCF_Ident)&&(tok!=XkbCF_String)) {
- rtrn->error= XkbCF_ExpectedAXOption;
- return False;
- }
- if (!AddAXTimeoutOptByName(rtrn,val.str,&opts_mask)) {
- return False;
- }
- *opts |= opts_mask;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_EOF)&&(tok!=XkbCF_Semi)) {
- if (tok!=XkbCF_Plus) {
- rtrn->error= XkbCF_ExpectedOperator;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- }
- }
- break;
- case _XkbCF_AccessXTimeoutOptsOff:
- case _XkbCF_AccessXTimeoutOptsOn:
- opts= NULL;
- if (tok==XkbCF_MinusEquals)
- opts= &rtrn->axt_opts_ignore;
- else if ((tok==XkbCF_PlusEquals)||(tok==XkbCF_Equals)) {
- if (field->field_id==_XkbCF_AccessXTimeoutOptsOff) {
- opts= &rtrn->axt_opts_off;
- if (tok==XkbCF_Equals)
- rtrn->replace_axt_opts_off= True;
- }
- else {
- opts= &rtrn->axt_opts_on;
- if (tok==XkbCF_Equals)
- rtrn->replace_axt_opts_on= True;
- }
- *opts = 0;
- }
- else {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok==XkbCF_EOL)||(tok==XkbCF_Semi)||(tok==XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- while ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- if ((tok!=XkbCF_Ident)&&(tok!=XkbCF_String)) {
- rtrn->error= XkbCF_ExpectedControl;
- return False;
- }
- if (!AddAXTimeoutOptByName(rtrn,val.str,&opts_mask))
- return False;
- *opts |= opts_mask;
-
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_EOF)&&(tok!=XkbCF_Semi)) {
- if (tok!=XkbCF_Plus) {
- rtrn->error= XkbCF_ExpectedOperator;
- return False;
- }
- tok= XkbCFScan(file,&val,rtrn);
- }
- }
- break;
- case _XkbCF_ClickVolume:
- if (!pival) {
- pival= &rtrn->click_volume;
- onoff= 100;
- }
- case _XkbCF_BellVolume:
- if (!pival) {
- pival= &rtrn->bell_volume;
- onoff= 100;
- }
- case _XkbCF_BellPitch:
- if (!pival)
- pival= &rtrn->bell_pitch;
- case _XkbCF_BellDuration:
- if (!pival)
- pival= &rtrn->bell_duration;
- case _XkbCF_RepeatDelay:
- if (!pival)
- pival= &rtrn->repeat_delay;
- case _XkbCF_RepeatInterval:
- if (!pival)
- pival= &rtrn->repeat_interval;
- case _XkbCF_SlowKeysDelay:
- if (!pival)
- pival= &rtrn->slow_keys_delay;
- case _XkbCF_DebounceDelay:
- if (!pival)
- pival= &rtrn->debounce_delay;
- case _XkbCF_MouseKeysDelay:
- if (!pival)
- pival= &rtrn->mk_delay;
- case _XkbCF_MouseKeysInterval:
- if (!pival)
- pival= &rtrn->mk_interval;
- case _XkbCF_MouseKeysTimeToMax:
- if (!pival)
- pival= &rtrn->mk_time_to_max;
- case _XkbCF_MouseKeysMaxSpeed:
- if (!pival)
- pival= &rtrn->mk_max_speed;
- case _XkbCF_MouseKeysCurve:
- if (!pival)
- pival= &rtrn->mk_curve;
- case _XkbCF_AccessXTimeout:
- if (!pival)
- pival= &rtrn->ax_timeout;
- if (tok!=XkbCF_Equals) {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if (tok == XkbCF_Minus && field->field_id == _XkbCF_MouseKeysCurve) {
- /* This can be a negative value */
- tok = XkbCFScan(file,&val,rtrn);
- sign = -1;
- }
- else
- sign = 1;
- if (tok!=XkbCF_Integer) {
- Bool ok= False;
- if ((onoff)&&(tok==XkbCF_Ident)&&(val.str!=NULL)) {
- if (_XkbStrCaseCmp(val.str,"on")) {
- val.ival= onoff;
- ok= True;
- }
- else if (_XkbStrCaseCmp(val.str,"off")) {
- val.ival= 0;
- ok= True;
- }
- }
- if (!ok) {
- rtrn->error= XkbCF_ExpectedInteger;
- goto BAILOUT;
- }
- }
- *pival= val.ival * sign;
- if (field->field_id == _XkbCF_AccessXTimeout)
- rtrn->defined|=XkbCF_AccessXTimeout;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedEOS;
- return False;
- }
- break;
- case _XkbCF_GroupsWrap:
- if (tok!=XkbCF_Equals) {
- rtrn->error= XkbCF_MissingEquals;
- goto BAILOUT;
- }
- tok= XkbCFScan(file,&val,rtrn);
- if (tok==XkbCF_Ident) {
- if (_XkbStrCaseCmp(val.str,"wrap")==0) {
- rtrn->groups_wrap= XkbSetGroupInfo(0,XkbWrapIntoRange,0);
- }
- else if (_XkbStrCaseCmp(val.str,"clamp")==0) {
- rtrn->groups_wrap= XkbSetGroupInfo(0,XkbClampIntoRange,0);
- }
- else {
- rtrn->error= XkbCF_ExpectedOORGroupBehavior;
- return False;
- }
- }
- else if ((tok==XkbCF_Integer)&&(XkbIsLegalGroup(val.ival-1))) {
- rtrn->groups_wrap= XkbSetGroupInfo(0,XkbRedirectIntoRange,
- val.ival-1);
- }
- else {
- rtrn->error= XkbCF_ExpectedOORGroupBehavior;
- return False;
- }
- rtrn->defined|= XkbCF_GroupsWrap;
- tok= XkbCFScan(file,&val,rtrn);
- if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)&&(tok!=XkbCF_EOF)) {
- rtrn->error= XkbCF_ExpectedEOS;
- return False;
- }
- break;
- default:
- rtrn->error= XkbCF_ExpectedInteger;
- goto BAILOUT;
-
- }
- return True;
-BAILOUT:
- return False;
-}
-
-static Bool
-DefaultCleanUp(XkbConfigRtrnPtr rtrn)
-{
- if (rtrn->keymap) _XkbFree(rtrn->keymap);
- if (rtrn->keycodes) _XkbFree(rtrn->keycodes);
- if (rtrn->geometry) _XkbFree(rtrn->geometry);
- if (rtrn->phys_symbols) _XkbFree(rtrn->phys_symbols);
- if (rtrn->symbols) _XkbFree(rtrn->symbols);
- if (rtrn->types) _XkbFree(rtrn->types);
- if (rtrn->compat) _XkbFree(rtrn->compat);
- rtrn->keycodes= rtrn->geometry= NULL;
- rtrn->symbols= rtrn->phys_symbols= NULL;
- rtrn->types= rtrn->compat= NULL;
- if ((rtrn->unbound_mods!=NULL)&&(rtrn->num_unbound_mods>0)) {
- register int i;
- for (i=0;i<rtrn->num_unbound_mods;i++) {
- if (rtrn->unbound_mods[i].name!=NULL) {
- _XkbFree(rtrn->unbound_mods[i].name);
- rtrn->unbound_mods[i].name= NULL;
- }
- }
- _XkbFree(rtrn->unbound_mods);
- rtrn->sz_unbound_mods= 0;
- rtrn->num_unbound_mods= 0;
- rtrn->unbound_mods= NULL;
- }
- return True;
-}
-
-static Bool
-DefaultApplyNames(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb)
-{
-char *str;
-
- if (XkbAllocNames(xkb,XkbComponentNamesMask,0,0)!=Success)
- return False;
- if ((str=rtrn->keycodes)!=NULL) {
- xkb->names->keycodes= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->keycodes= NULL;
- }
- if ((str=rtrn->geometry)!=NULL) {
- xkb->names->geometry= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->geometry= NULL;
- }
- if ((str=rtrn->symbols)!=NULL) {
- xkb->names->symbols= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->symbols= NULL;
- }
- if ((str=rtrn->phys_symbols)!=NULL) {
- xkb->names->phys_symbols= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->phys_symbols= NULL;
- }
- if ((str=rtrn->types)!=NULL) {
- xkb->names->types= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->types= NULL;
- }
- if ((str=rtrn->compat)!=NULL) {
- xkb->names->compat= XkbInternAtom(xkb->dpy,str,False);
- _XkbFree(str);
- rtrn->compat= NULL;
- }
- return True;
-}
-
-static Bool
-DefaultApplyControls(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb)
-{
-unsigned on,off;
-XkbControlsPtr ctrls;
-unsigned int mask;
-
- if (XkbAllocControls(xkb,XkbAllControlsMask)!=Success)
- return False;
- ctrls= xkb->ctrls;
- if (rtrn->replace_initial_ctrls)
- ctrls->enabled_ctrls= rtrn->initial_ctrls;
- else ctrls->enabled_ctrls|= rtrn->initial_ctrls;
- ctrls->enabled_ctrls&= ~rtrn->initial_ctrls_clear;
- if (rtrn->internal_mods.replace) {
- ctrls->internal.real_mods= rtrn->internal_mods.mods;
- ctrls->internal.vmods= rtrn->internal_mods.vmods;
- }
- else {
- ctrls->internal.real_mods&= ~rtrn->internal_mods.mods_clear;
- ctrls->internal.vmods&= ~rtrn->internal_mods.vmods_clear;
- ctrls->internal.real_mods|= rtrn->internal_mods.mods;
- ctrls->internal.vmods|= rtrn->internal_mods.vmods;
- }
- mask= 0;
- (void)XkbVirtualModsToReal(xkb,ctrls->internal.vmods,&mask);
- ctrls->internal.mask= (ctrls->internal.real_mods|mask);
-
- if (rtrn->ignore_lock_mods.replace) {
- ctrls->ignore_lock.real_mods= rtrn->ignore_lock_mods.mods;
- ctrls->ignore_lock.vmods= rtrn->ignore_lock_mods.vmods;
- }
- else {
- ctrls->ignore_lock.real_mods&= ~rtrn->ignore_lock_mods.mods_clear;
- ctrls->ignore_lock.vmods&= ~rtrn->ignore_lock_mods.vmods_clear;
- ctrls->ignore_lock.real_mods|= rtrn->ignore_lock_mods.mods;
- ctrls->ignore_lock.vmods|= rtrn->ignore_lock_mods.vmods;
- }
- mask= 0;
- (void)XkbVirtualModsToReal(xkb,ctrls->ignore_lock.vmods,&mask);
- ctrls->ignore_lock.mask= (ctrls->ignore_lock.real_mods|mask);
-
- if (rtrn->repeat_delay>0)
- ctrls->repeat_delay= rtrn->repeat_delay;
- if (rtrn->repeat_interval>0)
- ctrls->repeat_interval= rtrn->repeat_interval;
- if (rtrn->slow_keys_delay>0)
- ctrls->slow_keys_delay= rtrn->slow_keys_delay;
- if (rtrn->debounce_delay>0)
- ctrls->debounce_delay= rtrn->debounce_delay;
- if (rtrn->mk_delay>0)
- ctrls->mk_delay= rtrn->mk_delay;
- if (rtrn->mk_interval>0)
- ctrls->mk_interval= rtrn->mk_interval;
- if (rtrn->mk_time_to_max>0)
- ctrls->mk_time_to_max= rtrn->mk_time_to_max;
- if (rtrn->mk_max_speed>0)
- ctrls->mk_max_speed= rtrn->mk_max_speed;
- if (rtrn->mk_curve>0)
- ctrls->mk_curve= rtrn->mk_curve;
- if (rtrn->defined&XkbCF_AccessXTimeout && rtrn->ax_timeout > 0)
- ctrls->ax_timeout= rtrn->ax_timeout;
-
- /* any value set to both off and on is reset to ignore */
- if ((off=(rtrn->axt_ctrls_on&rtrn->axt_ctrls_off))!=0)
- rtrn->axt_ctrls_ignore|= off;
-
- /* ignore takes priority over on and off */
- rtrn->axt_ctrls_on&= ~rtrn->axt_ctrls_ignore;
- rtrn->axt_ctrls_off&= ~rtrn->axt_ctrls_ignore;
-
- if (!rtrn->replace_axt_ctrls_off) {
- off= (ctrls->axt_ctrls_mask&(~ctrls->axt_ctrls_values));
- off&= ~rtrn->axt_ctrls_on;
- off|= rtrn->axt_ctrls_off;
- }
- else off= rtrn->axt_ctrls_off;
- if (!rtrn->replace_axt_ctrls_on) {
- on= (ctrls->axt_ctrls_mask&ctrls->axt_ctrls_values);
- on&= ~rtrn->axt_ctrls_off;
- on|= rtrn->axt_ctrls_on;
- }
- else on= rtrn->axt_ctrls_on;
- ctrls->axt_ctrls_mask= (on|off)&~rtrn->axt_ctrls_ignore;
- ctrls->axt_ctrls_values= on&~rtrn->axt_ctrls_ignore;
-
- /* any value set to both off and on is reset to ignore */
- if ((off=(rtrn->axt_opts_on&rtrn->axt_opts_off))!=0)
- rtrn->axt_opts_ignore|= off;
-
- /* ignore takes priority over on and off */
- rtrn->axt_opts_on&= ~rtrn->axt_opts_ignore;
- rtrn->axt_opts_off&= ~rtrn->axt_opts_ignore;
-
- if (rtrn->replace_axt_opts_off) {
- off= (ctrls->axt_opts_mask&(~ctrls->axt_opts_values));
- off&= ~rtrn->axt_opts_on;
- off|= rtrn->axt_opts_off;
- }
- else off= rtrn->axt_opts_off;
- if (!rtrn->replace_axt_opts_on) {
- on= (ctrls->axt_opts_mask&ctrls->axt_opts_values);
- on&= ~rtrn->axt_opts_off;
- on|= rtrn->axt_opts_on;
- }
- else on= rtrn->axt_opts_on;
- ctrls->axt_opts_mask= (unsigned short)((on|off)&~rtrn->axt_ctrls_ignore);
- ctrls->axt_opts_values= (unsigned short)(on&~rtrn->axt_ctrls_ignore);
-
- if (rtrn->defined&XkbCF_GroupsWrap) {
- int n;
- n= XkbNumGroups(ctrls->groups_wrap);
- rtrn->groups_wrap= XkbSetNumGroups(rtrn->groups_wrap,n);
- ctrls->groups_wrap= rtrn->groups_wrap;
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-DefaultFinish( XkbConfigFieldsPtr fields,
- XkbDescPtr xkb,
- XkbConfigRtrnPtr rtrn,
- int what)
-{
- if ((what==XkbCF_Destroy)||(what==XkbCF_CleanUp))
- return DefaultCleanUp(rtrn);
- if (what==XkbCF_Check) {
- if ((rtrn->symbols==NULL)&&(rtrn->phys_symbols!=NULL))
- rtrn->symbols= _XkbDupString(rtrn->phys_symbols);
- }
- if ((what==XkbCF_Apply)||(what==XkbCF_Check)) {
- if (xkb && xkb->names && (rtrn->num_unbound_mods>0))
- XkbCFBindMods(rtrn,xkb);
- XkbCFApplyMods(rtrn,XkbCF_InitialMods,&rtrn->initial_mods);
- XkbCFApplyMods(rtrn,XkbCF_InternalMods,&rtrn->internal_mods);
- XkbCFApplyMods(rtrn,XkbCF_IgnoreLockMods,&rtrn->ignore_lock_mods);
- }
- if (what==XkbCF_Apply) {
- if (xkb!=NULL) {
- DefaultApplyNames(rtrn,xkb);
- DefaultApplyControls(rtrn,xkb);
- XkbCFBindMods(rtrn,xkb);
- }
- }
- return True;
-}
-
-static XkbConfigFieldRec _XkbCFDfltFields[] = {
- { "rules", _XkbCF_RulesFile },
- { "model", _XkbCF_Model },
- { "layout", _XkbCF_Layout },
- { "variant", _XkbCF_Variant },
- { "options", _XkbCF_Options },
- { "keymap", _XkbCF_Keymap },
- { "keycodes", _XkbCF_Keycodes },
- { "geometry", _XkbCF_Geometry },
- { "realsymbols",_XkbCF_PhysSymbols },
- { "actualsymbols",_XkbCF_PhysSymbols },
- { "symbols", _XkbCF_Symbols },
- { "symbolstouse",_XkbCF_Symbols },
- { "types", _XkbCF_Types },
- { "compat", _XkbCF_CompatMap },
- { "modifiers", _XkbCF_InitialMods },
- { "controls", _XkbCF_InitialCtrls },
- { "click", _XkbCF_ClickVolume },
- { "clickvolume",_XkbCF_ClickVolume },
- { "bell", _XkbCF_BellVolume },
- { "bellvolume", _XkbCF_BellVolume },
- { "bellpitch", _XkbCF_BellPitch },
- { "bellduration",_XkbCF_BellDuration },
- { "repeatdelay",_XkbCF_RepeatDelay },
- { "repeatinterval",_XkbCF_RepeatInterval },
- { "slowkeysdelay",_XkbCF_SlowKeysDelay },
- { "debouncedelay",_XkbCF_DebounceDelay },
- { "mousekeysdelay",_XkbCF_MouseKeysDelay },
- { "mousekeysinterval",_XkbCF_MouseKeysInterval },
- { "mousekeystimetomax",_XkbCF_MouseKeysTimeToMax },
- { "mousekeysmaxspeed",_XkbCF_MouseKeysMaxSpeed },
- { "mousekeyscurve",_XkbCF_MouseKeysCurve },
- { "accessxtimeout",_XkbCF_AccessXTimeout },
- { "axtimeout",_XkbCF_AccessXTimeout },
- { "accessxtimeoutctrlson",_XkbCF_AccessXTimeoutCtrlsOn },
- { "axtctrlson", _XkbCF_AccessXTimeoutCtrlsOn },
- { "accessxtimeoutctrlsoff",_XkbCF_AccessXTimeoutCtrlsOff },
- { "axtctrlsoff",_XkbCF_AccessXTimeoutCtrlsOff },
- { "accessxtimeoutfeedbackon", _XkbCF_AccessXTimeoutOptsOn },
- { "axtfeedbackon", _XkbCF_AccessXTimeoutOptsOn },
- { "accessxtimeoutfeedbackoff", _XkbCF_AccessXTimeoutOptsOff },
- { "axtfeedbackoff", _XkbCF_AccessXTimeoutOptsOff },
- { "ignorelockmods",_XkbCF_IgnoreLockMods },
- { "ignorelockmodifiers",_XkbCF_IgnoreLockMods },
- { "ignoregrouplock",_XkbCF_IgnoreGroupLock },
- { "internalmods",_XkbCF_InternalMods },
- { "internalmodifiers",_XkbCF_InternalMods },
- { "outofrangegroups",_XkbCF_GroupsWrap },
- { "groups", _XkbCF_GroupsWrap },
- { "feedback", _XkbCF_InitialFeedback },
-};
-#define _XkbCFNumDfltFields (sizeof(_XkbCFDfltFields)/sizeof(XkbConfigFieldRec))
-
-static XkbConfigFieldsRec _XkbCFDflts = {
- 0, /* cfg_id */
- _XkbCFNumDfltFields, /* num_fields */
- _XkbCFDfltFields, /* fields */
- DefaultParser, /* parser */
- DefaultFinish, /* finish */
- NULL, /* priv */
- NULL /* next */
-};
-
-XkbConfigFieldsPtr XkbCFDflts= &_XkbCFDflts;
-
-/***====================================================================***/
-
-XkbConfigFieldsPtr
-XkbCFDup(XkbConfigFieldsPtr fields)
-{
-XkbConfigFieldsPtr pNew;
-
- pNew= _XkbTypedAlloc(XkbConfigFieldsRec);
- if (pNew!=NULL) {
- memcpy(pNew,fields,sizeof(XkbConfigFieldsRec));
- if ((pNew->fields!=NULL)&&(pNew->num_fields>0)) {
- pNew->fields= _XkbTypedCalloc(pNew->num_fields,XkbConfigFieldRec);
- if (pNew->fields) {
- memcpy(fields->fields,pNew->fields,
- (pNew->num_fields*sizeof(XkbConfigFieldRec)));
- }
- else {
- _XkbFree(pNew);
- return NULL;
- }
- }
- else {
- pNew->num_fields= 0;
- pNew->fields= NULL;
- }
- pNew->next= NULL;
- }
- return pNew;
-}
-
-XkbConfigFieldsPtr
-XkbCFFree(XkbConfigFieldsPtr fields,Bool all)
-{
-XkbConfigFieldsPtr next;
-
- next= NULL;
- while (fields!=NULL) {
- next= fields->next;
- if (fields!=XkbCFDflts) {
- if (fields->fields) {
- _XkbFree(fields->fields);
- fields->fields= NULL;
- fields->num_fields= 0;
- }
- _XkbFree(fields);
- }
- fields= (all?next:NULL);
- }
- return next;
-}
-
-Bool
-XkbCFApplyRtrnValues( XkbConfigRtrnPtr rtrn,
- XkbConfigFieldsPtr fields,
- XkbDescPtr xkb)
-{
-Bool ok;
-
- if ((fields==NULL)||(rtrn==NULL)||(xkb==NULL))
- return False;
- for (ok=True;fields!=NULL;fields=fields->next) {
- if (fields->finish!=NULL)
- ok= (*fields->finish)(fields,xkb,rtrn,XkbCF_Apply)&&ok;
- }
- return ok;
-}
-
-XkbConfigRtrnPrivPtr
-XkbCFAddPrivate( XkbConfigRtrnPtr rtrn,
- XkbConfigFieldsPtr fields,
- XPointer ptr)
-{
-XkbConfigRtrnPrivPtr priv;
-
- if ((rtrn==NULL)||(fields==NULL))
- return NULL;
- priv= _XkbTypedAlloc(XkbConfigRtrnPrivRec);
- if (priv!=NULL) {
- priv->cfg_id= fields->cfg_id;
- priv->priv= ptr;
- priv->next= rtrn->priv;
- rtrn->priv= priv;
- }
- return priv;
-}
-
-void
-XkbCFFreeRtrn( XkbConfigRtrnPtr rtrn,
- XkbConfigFieldsPtr fields,
- XkbDescPtr xkb)
-{
-XkbConfigRtrnPrivPtr tmp,next;
-
- if ((fields==NULL)||(rtrn==NULL))
- return;
- while (fields!=NULL) {
- if (fields->finish!=NULL)
- (*fields->finish)(fields,xkb,rtrn,XkbCF_Destroy);
- fields= fields->next;
- }
- for (tmp=rtrn->priv;tmp!=NULL;tmp=next) {
- next= tmp->next;
- bzero((char *)tmp,sizeof(XkbConfigRtrnPrivRec));
- _XkbFree(tmp);
- }
- bzero((char *)rtrn,sizeof(XkbConfigRtrnRec));
- return;
-}
-
-Bool
-XkbCFParse( FILE * file,
- XkbConfigFieldsPtr fields,
- XkbDescPtr xkb,
- XkbConfigRtrnPtr rtrn)
-{
-int tok;
-XkbCFScanResultRec val;
-XkbConfigFieldsPtr tmp;
-
- if ((file==NULL)||(fields==NULL)||(rtrn==NULL))
- return False;
- for (tok=0,tmp=fields;tmp!=NULL;tmp=tmp->next,tok++) {
- fields->cfg_id= tok;
- }
- bzero((char *)rtrn,sizeof(XkbConfigRtrnRec));
- rtrn->line= 1;
- rtrn->click_volume= -1;
- rtrn->bell_volume= -1;
- while ((tok=XkbCFScan(file,&val,rtrn))!=XkbCF_EOF) {
- if (tok==XkbCF_Ident) {
- Bool done;
- for (tmp=fields,done=False;(tmp!=NULL)&&(!done);tmp=tmp->next) {
- register int i;
- XkbConfigFieldPtr f;
-
- for (i=0,f=tmp->fields;(i<tmp->num_fields)&&(!done);i++,f++) {
- if (_XkbStrCaseCmp(val.str,f->field)!=0)
- continue;
- if ((*tmp->parser)(file,tmp,f,xkb,rtrn))
- done= True;
- else goto BAILOUT;
- }
- }
- }
- else if ((tok!=XkbCF_EOL)&&(tok!=XkbCF_Semi)) {
- rtrn->error= XkbCF_MissingIdent;
- goto BAILOUT;
- }
- }
- for (tmp=fields;tmp!=NULL;tmp=tmp->next) {
- if ((tmp->finish)&&(!(*tmp->finish)(tmp,xkb,rtrn,XkbCF_Check)))
- goto BAILOUT;
- }
- return True;
-BAILOUT:
- for (tmp=fields;tmp!=NULL;tmp=tmp->next) {
- if (tmp->finish)
- (*tmp->finish)(tmp,xkb,rtrn,XkbCF_CleanUp);
- }
- return False;
-}
-
-/*ARGSUSED*/
-void
-XkbCFReportError(FILE *file,char *name,int error,int line)
-{
-char * msg;
-
- switch(error) {
- case XkbCF_BadAlloc:
- msg= "allocation failed\n"; break;
- case XkbCF_UnterminatedString:
- msg= "unterminated string on line %d"; break;
- case XkbCF_MissingIdent:
- msg= "expected identifier on line %d"; break;
- case XkbCF_MissingEquals:
- msg= "expected '=' on line %d"; break;
- case XkbCF_ExpectedEOS:
- msg= "expected ';' or newline on line %d"; break;
- case XkbCF_ExpectedBoolean:
- msg= "expected a boolean value on line %d"; break;
- case XkbCF_ExpectedInteger:
- msg= "expected a numeric value on line %d"; break;
- case XkbCF_ExpectedString:
- msg= "expected a string on line %d"; break;
- case XkbCF_ExpectedModifier:
- msg= "expected a modifier name on line %d"; break;
- case XkbCF_ExpectedControl:
- msg= "expected a control name on line %d"; break;
- case XkbCF_ExpectedAXOption:
- msg= "expected an AccessX option on line %d"; break;
- case XkbCF_ExpectedOperator:
- msg= "expected '+' or '-' on line %d"; break;
- case XkbCF_ExpectedOORGroupBehavior:
- msg= "expected wrap, clamp or group number on line %d"; break;
- default:
- msg= "unknown error on line %d"; break;
- }
-#ifndef XKB_IN_SERVER
- fprintf(file,msg,line);
- if (name) fprintf(file," of %s\n",name);
- else fprintf(file,"\n");
-#else
- ErrorF(msg,line);
- if (name) ErrorF(" of %s\n",name);
- else ErrorF("\n");
-#endif
- return;
-}
diff --git a/xkb/xkberrs.c b/xkb/xkberrs.c
deleted file mode 100644
index d12467ff7..000000000
--- a/xkb/xkberrs.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $Xorg: xkberrs.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkberrs.c,v 3.5 2002/11/08 13:35:43 alanh Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-char * _XkbErrMessages[] = {
- "success", /* _XkbSuccess */
- "key names not defined", /* _XkbErrMissingNames */
- "key types not defined", /* _XkbErrMissingTypes */
- "required key types not present", /* _XkbErrMissingReqTypes */
- "symbols not defined", /* _XkbErrMissingSymbols */
- "virtual modifier bindings not defined",/* _XkbErrMissingVMods */
- "indicators not defined", /* _XkbErrMissingIndicators */
- "compatibility map not defined", /* _XkbErrMissingCompatMap */
- "symbol interpretations not defined", /* _XkbErrMissingSymInterps */
- "geometry not defined", /* _XkbErrMissingGeometry */
- "illegal doodad type", /* _XkbErrIllegalDoodad */
- "illegal TOC type", /* _XkbErrIllegalTOCType */
- "illegal contents", /* _XkbErrIllegalContents */
- "empty file", /* _XkbErrEmptyFile */
- "file not found", /* _XkbErrFileNotFound */
- "cannot open", /* _XkbErrFileCannotOpen */
- "bad value", /* _XkbErrBadValue */
- "bad match", /* _XkbErrBadMatch */
- "illegal name for type", /* _XkbErrBadTypeName */
- "illegal width for type", /* _XkbErrBadTypeWidth */
- "bad file type", /* _XkbErrBadFileType */
- "bad file version", /* _XkbErrBadFileVersion */
- "error in Xkm file", /* _XkbErrBadFileFormat */
- "allocation failed", /* _XkbErrBadAlloc */
- "bad length", /* _XkbErrBadLength */
- "X request failed", /* _XkbErrXReqFailure */
- "not implemented" /* _XkbErrBadImplementation */
-};
-
-unsigned _XkbErrCode;
-char * _XkbErrLocation= NULL;
-unsigned _XkbErrData;
-
diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c
deleted file mode 100644
index 2a6d836aa..000000000
--- a/xkb/xkbfmisc.c
+++ /dev/null
@@ -1,683 +0,0 @@
-/* $Xorg: xkbmisc.c,v 1.4 2000/08/17 19:46:44 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkbmisc.c,v 1.8 2003/11/17 22:20:24 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#include <X11/Xos.h>
-#include <X11/Xfuncs.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
-#include <X11/XKBlib.h>
-#include <X11/extensions/XKBgeom.h>
-#include "XKMformat.h"
-#include "XKBfileInt.h"
-
-#else
-
-#include "X.h"
-#define NEED_EVENTS
-#include <X11/keysym.h>
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "dix.h"
-#include "XKBstr.h"
-#define XKBSRV_NEED_FILE_FUNCS 1
-#include "XKBsrv.h"
-#include <X11/extensions/XKBgeom.h>
-#include "xkb.h"
-
-#endif
-
-unsigned
-_XkbKSCheckCase(KeySym ks)
-{
-unsigned set,rtrn;
-
- set= (ks & (~0xff)) >> 8;
- rtrn= 0;
- switch (set) {
- case 0: /* latin 1 */
- if (((ks>=XK_A)&&(ks<=XK_Z))||
- ((ks>=XK_Agrave)&&(ks<=XK_THORN)&&(ks!=XK_multiply))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_a)&&(ks<=XK_z))||
- ((ks>=XK_agrave)&&(ks<=XK_ydiaeresis))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 1: /* latin 2 */
- if (((ks>=XK_Aogonek)&&(ks<=XK_Zabovedot)&&(ks!=XK_breve))||
- ((ks>=XK_Racute)&&(ks<=XK_Tcedilla))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_aogonek)&&(ks<=XK_zabovedot)&&(ks!=XK_caron))||
- ((ks>=XK_racute)&&(ks<=XK_tcedilla))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 2: /* latin 3 */
- if (((ks>=XK_Hstroke)&&(ks<=XK_Jcircumflex))||
- ((ks>=XK_Cabovedot)&&(ks<=XK_Scircumflex))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_hstroke)&&(ks<=XK_jcircumflex))||
- ((ks>=XK_cabovedot)&&(ks<=XK_scircumflex))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 3: /* latin 4 */
- if (((ks>=XK_Rcedilla)&&(ks<=XK_Tslash))||
- (ks==XK_ENG)||
- ((ks>=XK_Amacron)&&(ks<=XK_Umacron))) {
- rtrn|= _XkbKSUpper;
- }
- if (((ks>=XK_rcedilla)&&(ks<=XK_tslash))||
- (ks==XK_eng)||
- ((ks>=XK_amacron)&&(ks<=XK_umacron))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 18: /* latin 8 */
- if ((ks==XK_Babovedot)||
- ((ks>=XK_Dabovedot)&&(ks<=XK_Wacute))||
- ((ks>=XK_Ygrave)&&(ks<=XK_Fabovedot))||
- (ks==XK_Mabovedot)||
- (ks==XK_Pabovedot)||
- (ks==XK_Sabovedot)||
- (ks==XK_Wdiaeresis)||
- ((ks>=XK_Wcircumflex)&&(ks<=XK_Ycircumflex))) {
- rtrn|= _XkbKSUpper;
- }
- if ((ks==XK_babovedot)||
- (ks==XK_dabovedot)||
- (ks==XK_fabovedot)||
- (ks==XK_mabovedot)||
- ((ks>=XK_wgrave)&&(ks<=XK_wacute))||
- (ks==XK_ygrave)||
- ((ks>=XK_wdiaeresis)&&(ks<=XK_ycircumflex))) {
- rtrn|= _XkbKSLower;
- }
- break;
- case 19: /* latin 9 */
- if ((ks==XK_OE)||(ks==XK_Ydiaeresis)) {
- rtrn|= _XkbKSUpper;
- }
- if (ks==XK_oe) {
- rtrn|= _XkbKSLower;
- }
- break;
- }
- return rtrn;
-}
-
-/***===================================================================***/
-
-int
-_XkbStrCaseCmp(char *str1,char *str2)
-{
- char buf1[512],buf2[512];
- char c, *s;
- register int n;
-
- for (n=0, s = buf1; (c = *str1++); n++) {
- if (isupper(c))
- c = tolower(c);
- if (n>510)
- break;
- *s++ = c;
- }
- *s = '\0';
- for (n=0, s = buf2; (c = *str2++); n++) {
- if (isupper(c))
- c = tolower(c);
- if (n>510)
- break;
- *s++ = c;
- }
- *s = '\0';
- return (strcmp(buf1, buf2));
-}
-
-/***===================================================================***/
-
-Bool
-XkbLookupGroupAndLevel( XkbDescPtr xkb,
- int key,
- int * mods_inout,
- int * grp_inout,
- int * lvl_rtrn)
-{
-int nG,eG;
-
- if ((!xkb)||(!XkbKeycodeInRange(xkb,key))||(!grp_inout))
- return False;
-
- nG= XkbKeyNumGroups(xkb,key);
- eG= *grp_inout;
-
- if ( nG==0 ) {
- *grp_inout= 0;
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= 0;
- return False;
- }
- else if ( nG==1 ) {
- eG= 0;
- }
- else if ( eG>=nG ) {
- unsigned gI= XkbKeyGroupInfo(xkb,key);
- switch (XkbOutOfRangeGroupAction(gI)) {
- default:
- eG %= nG;
- break;
- case XkbClampIntoRange:
- eG = nG-1;
- break;
- case XkbRedirectIntoRange:
- eG = XkbOutOfRangeGroupNumber(gI);
- if (eG>=nG)
- eG= 0;
- break;
- }
- }
- *grp_inout= eG;
- if (mods_inout!=NULL) {
- XkbKeyTypePtr type;
- int preserve;
-
- type = XkbKeyKeyType(xkb,key,eG);
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= 0;
- preserve= 0;
- if (type->map) { /* find the shift level */
- register int i;
- register XkbKTMapEntryPtr entry;
- for (i=0,entry=type->map;i<type->map_count;i++,entry++) {
- if ((entry->active)&&
- (((*mods_inout)&type->mods.mask)==entry->mods.mask)){
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= entry->level;
- if (type->preserve)
- preserve= type->preserve[i].mask;
- break;
- }
- }
- }
- (*mods_inout)&= ~(type->mods.mask&(~preserve));
- }
- return True;
-}
-
-/***===================================================================***/
-
-static Bool
-XkbWriteSectionFromName(FILE *file,char *sectionName,char *name)
-{
- fprintf(file," xkb_%-20s { include \"%s\" };\n",sectionName,name);
- return True;
-}
-
-#define NEED_DESC(n) ((!n)||((n)[0]=='+')||((n)[0]=='|')||(strchr((n),'%')))
-#define COMPLETE(n) ((n)&&(!NEED_DESC(n)))
-
-/* ARGSUSED */
-static void
-_AddIncl( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- int index,
- void * priv)
-{
- if ((priv)&&(strcmp((char *)priv,"%")!=0))
- fprintf(file," include \"%s\"\n",(char *)priv);
- return;
-}
-
-Bool
-XkbWriteXKBKeymapForNames( FILE * file,
- XkbComponentNamesPtr names,
- Display * dpy,
- XkbDescPtr xkb,
- unsigned want,
- unsigned need)
-{
-char * name,*tmp;
-unsigned complete;
-XkbNamesPtr old_names;
-int multi_section;
-unsigned wantNames,wantConfig,wantDflts;
-XkbFileInfo finfo;
-
- bzero(&finfo,sizeof(XkbFileInfo));
-
- complete= 0;
- if ((name=names->keymap)==NULL) name= "default";
- if (COMPLETE(names->keycodes)) complete|= XkmKeyNamesMask;
- if (COMPLETE(names->types)) complete|= XkmTypesMask;
- if (COMPLETE(names->compat)) complete|= XkmCompatMapMask;
- if (COMPLETE(names->symbols)) complete|= XkmSymbolsMask;
- if (COMPLETE(names->geometry)) complete|= XkmGeometryMask;
- want|= (complete|need);
- if (want&XkmSymbolsMask)
- want|= XkmKeyNamesMask|XkmTypesMask;
-
- if (want==0)
- return False;
-
- if (xkb!=NULL) {
- old_names= xkb->names;
- finfo.type= 0;
- finfo.defined= 0;
- finfo.xkb= xkb;
- if (!XkbDetermineFileType(&finfo,XkbXKBFile,NULL))
- return False;
- }
- else old_names= NULL;
-
- wantConfig= want&(~complete);
- if (xkb!=NULL) {
- if (wantConfig&XkmTypesMask) {
- if ((!xkb->map) || (xkb->map->num_types<XkbNumRequiredTypes))
- wantConfig&= ~XkmTypesMask;
- }
- if (wantConfig&XkmCompatMapMask) {
- if ((!xkb->compat) || (xkb->compat->num_si<1))
- wantConfig&= ~XkmCompatMapMask;
- }
- if (wantConfig&XkmSymbolsMask) {
- if ((!xkb->map) || (!xkb->map->key_sym_map))
- wantConfig&= ~XkmSymbolsMask;
- }
- if (wantConfig&XkmIndicatorsMask) {
- if (!xkb->indicators)
- wantConfig&= ~XkmIndicatorsMask;
- }
- if (wantConfig&XkmKeyNamesMask) {
- if ((!xkb->names)||(!xkb->names->keys))
- wantConfig&= ~XkmKeyNamesMask;
- }
- if ((wantConfig&XkmGeometryMask)&&(!xkb->geom))
- wantConfig&= ~XkmGeometryMask;
- }
- else {
- wantConfig= 0;
- }
- complete|= wantConfig;
-
- wantDflts= 0;
- wantNames= want&(~complete);
- if ((xkb!=NULL) && (old_names!=NULL)) {
- if (wantNames&XkmTypesMask) {
- if (old_names->types!=None) {
- tmp= XkbAtomGetString(dpy,old_names->types);
- names->types= _XkbDupString(tmp);
- }
- else {
- wantDflts|= XkmTypesMask;
- }
- complete|= XkmTypesMask;
- }
- if (wantNames&XkmCompatMapMask) {
- if (old_names->compat!=None) {
- tmp= XkbAtomGetString(dpy,old_names->compat);
- names->compat= _XkbDupString(tmp);
- }
- else wantDflts|= XkmCompatMapMask;
- complete|= XkmCompatMapMask;
- }
- if (wantNames&XkmSymbolsMask) {
- if (old_names->symbols==None)
- return False;
- tmp= XkbAtomGetString(dpy,old_names->symbols);
- names->symbols= _XkbDupString(tmp);
- complete|= XkmSymbolsMask;
- }
- if (wantNames&XkmKeyNamesMask) {
- if (old_names->keycodes!=None) {
- tmp= XkbAtomGetString(dpy,old_names->keycodes);
- names->keycodes= _XkbDupString(tmp);
- }
- else wantDflts|= XkmKeyNamesMask;
- complete|= XkmKeyNamesMask;
- }
- if (wantNames&XkmGeometryMask) {
- if (old_names->geometry==None)
- return False;
- tmp= XkbAtomGetString(dpy,old_names->geometry);
- names->geometry= _XkbDupString(tmp);
- complete|= XkmGeometryMask;
- wantNames&= ~XkmGeometryMask;
- }
- }
- if (complete&XkmCompatMapMask)
- complete|= XkmIndicatorsMask|XkmVirtualModsMask;
- else if (complete&(XkmSymbolsMask|XkmTypesMask))
- complete|= XkmVirtualModsMask;
- if (need & (~complete))
- return False;
- if ((complete&XkmSymbolsMask)&&((XkmKeyNamesMask|XkmTypesMask)&(~complete)))
- return False;
-
- multi_section= 1;
- if (((complete&XkmKeymapRequired)==XkmKeymapRequired)&&
- ((complete&(~XkmKeymapLegal))==0)) {
- fprintf(file,"xkb_keymap \"%s\" {\n",name);
- }
- else if (((complete&XkmSemanticsRequired)==XkmSemanticsRequired)&&
- ((complete&(~XkmSemanticsLegal))==0)) {
- fprintf(file,"xkb_semantics \"%s\" {\n",name);
- }
- else if (((complete&XkmLayoutRequired)==XkmLayoutRequired)&&
- ((complete&(~XkmLayoutLegal))==0)) {
- fprintf(file,"xkb_layout \"%s\" {\n",name);
- }
- else if (XkmSingleSection(complete&(~XkmVirtualModsMask))) {
- multi_section= 0;
- }
- else {
- return False;
- }
-
- wantNames= complete&(~(wantConfig|wantDflts));
- name= names->keycodes;
- if (wantConfig&XkmKeyNamesMask)
- XkbWriteXKBKeycodes(file,&finfo,False,False,_AddIncl,name);
- else if (wantDflts&XkmKeyNamesMask)
- fprintf(stderr,"Default symbols not implemented yet!\n");
- else if (wantNames&XkmKeyNamesMask)
- XkbWriteSectionFromName(file,"keycodes",name);
-
- name= names->types;
- if (wantConfig&XkmTypesMask)
- XkbWriteXKBKeyTypes(file,&finfo,False,False,_AddIncl,name);
- else if (wantDflts&XkmTypesMask)
- fprintf(stderr,"Default types not implemented yet!\n");
- else if (wantNames&XkmTypesMask)
- XkbWriteSectionFromName(file,"types",name);
-
- name= names->compat;
- if (wantConfig&XkmCompatMapMask)
- XkbWriteXKBCompatMap(file,&finfo,False,False,_AddIncl,name);
- else if (wantDflts&XkmCompatMapMask)
- fprintf(stderr,"Default interps not implemented yet!\n");
- else if (wantNames&XkmCompatMapMask)
- XkbWriteSectionFromName(file,"compatibility",name);
-
- name= names->symbols;
- if (wantConfig&XkmSymbolsMask)
- XkbWriteXKBSymbols(file,&finfo,False,False,_AddIncl,name);
- else if (wantNames&XkmSymbolsMask)
- XkbWriteSectionFromName(file,"symbols",name);
-
- name= names->geometry;
- if (wantConfig&XkmGeometryMask)
- XkbWriteXKBGeometry(file,&finfo,False,False,_AddIncl,name);
- else if (wantNames&XkmGeometryMask)
- XkbWriteSectionFromName(file,"geometry",name);
-
- if (multi_section)
- fprintf(file,"};\n");
- return True;
-}
-
-/***====================================================================***/
-
-/*ARGSUSED*/
-Status
-XkbMergeFile(XkbDescPtr xkb,XkbFileInfo finfo)
-{
- return BadImplementation;
-}
-
-/***====================================================================***/
-
-int
-XkbFindKeycodeByName(XkbDescPtr xkb,char *name,Bool use_aliases)
-{
-register int i;
-
- if ((!xkb)||(!xkb->names)||(!xkb->names->keys))
- return 0;
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (strncmp(xkb->names->keys[i].name,name,XkbKeyNameLength)==0)
- return i;
- }
- if (!use_aliases)
- return 0;
- if (xkb->geom && xkb->geom->key_aliases) {
- XkbKeyAliasPtr a;
- a= xkb->geom->key_aliases;
- for (i=0;i<xkb->geom->num_key_aliases;i++,a++) {
- if (strncmp(name,a->alias,XkbKeyNameLength)==0)
- return XkbFindKeycodeByName(xkb,a->real,False);
- }
- }
- if (xkb->names && xkb->names->key_aliases) {
- XkbKeyAliasPtr a;
- a= xkb->names->key_aliases;
- for (i=0;i<xkb->names->num_key_aliases;i++,a++) {
- if (strncmp(name,a->alias,XkbKeyNameLength)==0)
- return XkbFindKeycodeByName(xkb,a->real,False);
- }
- }
- return 0;
-}
-
-
-unsigned
-XkbConvertGetByNameComponents(Bool toXkm,unsigned orig)
-{
-unsigned rtrn;
-
- rtrn= 0;
- if (toXkm) {
- if (orig&XkbGBN_TypesMask) rtrn|= XkmTypesMask;
- if (orig&XkbGBN_CompatMapMask) rtrn|= XkmCompatMapMask;
- if (orig&XkbGBN_SymbolsMask) rtrn|= XkmSymbolsMask;
- if (orig&XkbGBN_IndicatorMapMask) rtrn|= XkmIndicatorsMask;
- if (orig&XkbGBN_KeyNamesMask) rtrn|= XkmKeyNamesMask;
- if (orig&XkbGBN_GeometryMask) rtrn|= XkmGeometryMask;
- }
- else {
- if (orig&XkmTypesMask) rtrn|= XkbGBN_TypesMask;
- if (orig&XkmCompatMapMask) rtrn|= XkbGBN_CompatMapMask;
- if (orig&XkmSymbolsMask) rtrn|= XkbGBN_SymbolsMask;
- if (orig&XkmIndicatorsMask) rtrn|= XkbGBN_IndicatorMapMask;
- if (orig&XkmKeyNamesMask) rtrn|= XkbGBN_KeyNamesMask;
- if (orig&XkmGeometryMask) rtrn|= XkbGBN_GeometryMask;
- if (orig!=0) rtrn|= XkbGBN_OtherNamesMask;
- }
- return rtrn;
-}
-
-unsigned
-XkbConvertXkbComponents(Bool toXkm,unsigned orig)
-{
-unsigned rtrn;
-
- rtrn= 0;
- if (toXkm) {
- if (orig&XkbClientMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
- if (orig&XkbServerMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
- if (orig&XkbCompatMapMask) rtrn|= XkmCompatMapMask;
- if (orig&XkbIndicatorMapMask) rtrn|= XkmIndicatorsMask;
- if (orig&XkbNamesMask) rtrn|= XkmKeyNamesMask;
- if (orig&XkbGeometryMask) rtrn|= XkmGeometryMask;
- }
- else {
- if (orig!=0) rtrn|= XkbNamesMask;
- if (orig&XkmTypesMask) rtrn|= XkbClientMapMask;
- if (orig&XkmCompatMapMask)
- rtrn|= XkbCompatMapMask|XkbIndicatorMapMask;
- if (orig&XkmSymbolsMask) rtrn|=XkbClientMapMask|XkbServerMapMask;
- if (orig&XkmIndicatorsMask) rtrn|= XkbIndicatorMapMask;
- if (orig&XkmKeyNamesMask)
- rtrn|= XkbNamesMask|XkbIndicatorMapMask;
- if (orig&XkmGeometryMask) rtrn|= XkbGeometryMask;
- }
- return rtrn;
-}
-
-Bool
-XkbDetermineFileType(XkbFileInfoPtr finfo,int format,int *opts_missing)
-{
-unsigned present;
-XkbDescPtr xkb;
-
- if ((!finfo)||(!finfo->xkb))
- return False;
- if (opts_missing)
- *opts_missing= 0;
- xkb= finfo->xkb;
- present= 0;
- if ((xkb->names)&&(xkb->names->keys)) present|= XkmKeyNamesMask;
- if ((xkb->map)&&(xkb->map->types)) present|= XkmTypesMask;
- if (xkb->compat) present|= XkmCompatMapMask;
- if ((xkb->map)&&(xkb->map->num_syms>1)) present|= XkmSymbolsMask;
- if (xkb->indicators) present|= XkmIndicatorsMask;
- if (xkb->geom) present|= XkmGeometryMask;
- if (!present)
- return False;
- else switch (present) {
- case XkmKeyNamesMask:
- finfo->type= XkmKeyNamesIndex;
- finfo->defined= present;
- return True;
- case XkmTypesMask:
- finfo->type= XkmTypesIndex;
- finfo->defined= present;
- return True;
- case XkmCompatMapMask:
- finfo->type= XkmCompatMapIndex;
- finfo->defined= present;
- return True;
- case XkmSymbolsMask:
- if (format!=XkbXKMFile) {
- finfo->type= XkmSymbolsIndex;
- finfo->defined= present;
- return True;
- }
- break;
- case XkmGeometryMask:
- finfo->type= XkmGeometryIndex;
- finfo->defined= present;
- return True;
- }
- if ((present&(~XkmSemanticsLegal))==0) {
- if ((XkmSemanticsRequired&present)==XkmSemanticsRequired) {
- if (opts_missing)
- *opts_missing= XkmSemanticsOptional&(~present);
- finfo->type= XkmSemanticsFile;
- finfo->defined= present;
- return True;
- }
- }
- else if ((present&(~XkmLayoutLegal))==0) {
- if ((XkmLayoutRequired&present)==XkmLayoutRequired) {
- if (opts_missing)
- *opts_missing= XkmLayoutOptional&(~present);
- finfo->type= XkmLayoutFile;
- finfo->defined= present;
- return True;
- }
- }
- else if ((present&(~XkmKeymapLegal))==0) {
- if ((XkmKeymapRequired&present)==XkmKeymapRequired) {
- if (opts_missing)
- *opts_missing= XkmKeymapOptional&(~present);
- finfo->type= XkmKeymapFile;
- finfo->defined= present;
- return True;
- }
- }
- return False;
-}
-
-/* all latin-1 alphanumerics, plus parens, slash, minus, underscore and */
-/* wildcards */
-
-static unsigned char componentSpecLegal[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83,
- 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
-};
-
-void
-XkbEnsureSafeMapName(char *name)
-{
- if (name==NULL)
- return;
- while (*name!='\0') {
- if ((componentSpecLegal[(*name)/8]&(1<<((*name)%8)))==0)
- *name= '_';
- name++;
- }
- return;
-}
-
-/***====================================================================***/
-
-#define UNMATCHABLE(c) (((c)=='(')||((c)==')')||((c)=='/'))
-
-Bool
-XkbNameMatchesPattern(char *name,char *ptrn)
-{
- while (ptrn[0]!='\0') {
- if (name[0]=='\0') {
- if (ptrn[0]=='*') {
- ptrn++;
- continue;
- }
- return False;
- }
- if (ptrn[0]=='?') {
- if (UNMATCHABLE(name[0]))
- return False;
- }
- else if (ptrn[0]=='*') {
- if ((!UNMATCHABLE(name[0]))&&XkbNameMatchesPattern(name+1,ptrn))
- return True;
- return XkbNameMatchesPattern(name,ptrn+1);
- }
- else if (ptrn[0]!=name[0])
- return False;
- name++;
- ptrn++;
- }
- /* if we get here, the pattern is exhausted (-:just like me:-) */
- return (name[0]=='\0');
-}
diff --git a/xkb/xkbout.c b/xkb/xkbout.c
deleted file mode 100644
index d688aca01..000000000
--- a/xkb/xkbout.c
+++ /dev/null
@@ -1,1060 +0,0 @@
-/* $Xorg: xkbout.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkbout.c,v 3.10 2003/11/17 22:20:24 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <X11/Xfuncs.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <X11/Xlib.h>
-#include <X11/XKBlib.h>
-#include <X11/extensions/XKBgeom.h>
-
-#include "XKMformat.h"
-#include "XKBfileInt.h"
-
-#else
-
-#include "X.h"
-#define NEED_EVENTS
-#include <X11/keysym.h>
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "dix.h"
-#include "XKBstr.h"
-#define XKBSRV_NEED_FILE_FUNCS 1
-#include "XKBsrv.h"
-
-#include <X11/extensions/XKBgeom.h>
-#include "extensions/XKBfile.h"
-
-#endif
-
-#define VMOD_HIDE_VALUE 0
-#define VMOD_SHOW_VALUE 1
-#define VMOD_COMMENT_VALUE 2
-
-static Bool
-WriteXKBVModDecl(FILE *file,Display *dpy,XkbDescPtr xkb,int showValue)
-{
-register int i,nMods;
-Atom * vmodNames;
-
- if (xkb==NULL)
- return False;
- if (xkb->names!=NULL)
- vmodNames= xkb->names->vmods;
- else vmodNames= NULL;
-
- for (i=nMods=0;i<XkbNumVirtualMods;i++) {
- if ((vmodNames!=NULL)&&(vmodNames[i]!=None)) {
- if (nMods==0) fprintf(file," virtual_modifiers ");
- else fprintf(file,",");
- fprintf(file,"%s",XkbAtomText(dpy,vmodNames[i],XkbXKBFile));
- if ((showValue!=VMOD_HIDE_VALUE)&&
- (xkb->server)&&(xkb->server->vmods[i]!=XkbNoModifierMask)) {
- if (showValue==VMOD_COMMENT_VALUE) {
- fprintf(file,"/* = %s */",
- XkbModMaskText(xkb->server->vmods[i],XkbXKBFile));
- }
- else {
- fprintf(file,"= %s",
- XkbModMaskText(xkb->server->vmods[i],XkbXKBFile));
- }
- }
- nMods++;
- }
- }
- if (nMods>0)
- fprintf(file,";\n\n");
- return True;
-}
-
-/***====================================================================***/
-
-static Bool
-WriteXKBAction(FILE *file,XkbFileInfo *result,XkbAnyAction *action)
-{
-XkbDescPtr xkb;
-Display * dpy;
-
- xkb= result->xkb;
- dpy= xkb->dpy;
- fprintf(file,"%s",XkbActionText(dpy,xkb,(XkbAction *)action,XkbXKBFile));
- return True;
-}
-
-/***====================================================================***/
-
-Bool
-XkbWriteXKBKeycodes( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Atom kcName;
-register unsigned i;
-XkbDescPtr xkb;
-Display * dpy;
-char * alternate;
-
- xkb= result->xkb;
- dpy= xkb->dpy;
- if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) {
- _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0);
- return False;
- }
- kcName= xkb->names->keycodes;
- if (kcName!=None)
- fprintf(file,"xkb_keycodes \"%s\" {\n",
- XkbAtomText(dpy,kcName,XkbXKBFile));
- else fprintf(file,"xkb_keycodes {\n");
- fprintf(file," minimum = %d;\n",xkb->min_key_code);
- fprintf(file," maximum = %d;\n",xkb->max_key_code);
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (xkb->names->keys[i].name[0]!='\0') {
- if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,True)!=i)
- alternate= "alternate ";
- else alternate= "";
- fprintf(file," %s%6s = %d;\n",alternate,
- XkbKeyNameText(xkb->names->keys[i].name,XkbXKBFile),
- i);
- }
- }
- if (xkb->indicators!=NULL) {
- for (i=0;i<XkbNumIndicators;i++) {
- char *type;
- if (xkb->indicators->phys_indicators&(1<<i))
- type= " ";
- else type= " virtual ";
- if (xkb->names->indicators[i]!=None) {
- fprintf(file,"%sindicator %d = \"%s\";\n",type,i+1,
- XkbAtomText(dpy,xkb->names->indicators[i],XkbXKBFile));
- }
- }
- }
- if (xkb->names->key_aliases!=NULL) {
- XkbKeyAliasPtr pAl;
- pAl= xkb->names->key_aliases;
- for (i=0;i<xkb->names->num_key_aliases;i++,pAl++) {
- fprintf(file," alias %6s = %6s;\n",
- XkbKeyNameText(pAl->alias,XkbXKBFile),
- XkbKeyNameText(pAl->real,XkbXKBFile));
- }
- }
- if (addOn)
- (*addOn)(file,result,topLevel,showImplicit,XkmKeyNamesIndex,priv);
- fprintf(file,"};\n\n");
- return True;
-}
-
-Bool
-XkbWriteXKBKeyTypes( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Display * dpy;
-register unsigned i,n;
-XkbKeyTypePtr type;
-XkbKTMapEntryPtr entry;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- dpy= xkb->dpy;
- if ((!xkb)||(!xkb->map)||(!xkb->map->types)) {
- _XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0);
- return False;
- }
- if (xkb->map->num_types<XkbNumRequiredTypes) {
- _XkbLibError(_XkbErrMissingReqTypes,"XkbWriteXKBKeyTypes",0);
- return 0;
- }
- if ((xkb->names==NULL)||(xkb->names->types==None))
- fprintf(file,"xkb_types {\n\n");
- else fprintf(file,"xkb_types \"%s\" {\n\n",
- XkbAtomText(dpy,xkb->names->types,XkbXKBFile));
- WriteXKBVModDecl(file,dpy,xkb,
- (showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
-
- type= xkb->map->types;
- for (i=0;i<xkb->map->num_types;i++,type++) {
- fprintf(file," type \"%s\" {\n",
- XkbAtomText(dpy,type->name,XkbXKBFile));
- fprintf(file," modifiers= %s;\n",
- XkbVModMaskText(dpy,xkb,type->mods.real_mods,type->mods.vmods,
- XkbXKBFile));
- entry= type->map;
- for (n=0;n<type->map_count;n++,entry++) {
- char *str;
- str=XkbVModMaskText(dpy,xkb,entry->mods.real_mods,entry->mods.vmods,
- XkbXKBFile);
- fprintf(file," map[%s]= Level%d;\n",str,entry->level+1);
- if ((type->preserve)&&((type->preserve[n].real_mods)||
- (type->preserve[n].vmods))) {
- fprintf(file," preserve[%s]= ",str);
- fprintf(file,"%s;\n",XkbVModMaskText(dpy,xkb,
- type->preserve[n].real_mods,
- type->preserve[n].vmods,
- XkbXKBFile));
- }
- }
- if (type->level_names!=NULL) {
- Atom *name= type->level_names;
- for (n=0;n<type->num_levels;n++,name++) {
- if ((*name)==None)
- continue;
- fprintf(file," level_name[Level%d]= \"%s\";\n",n+1,
- XkbAtomText(dpy,*name,XkbXKBFile));
- }
- }
- fprintf(file," };\n");
- }
- if (addOn)
- (*addOn)(file,result,topLevel,showImplicit,XkmTypesIndex,priv);
- fprintf(file,"};\n\n");
- return True;
-}
-
-static Bool
-WriteXKBIndicatorMap( FILE * file,
- XkbFileInfo * result,
- Atom name,
- XkbIndicatorMapPtr led,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- fprintf(file," indicator \"%s\" {\n",XkbAtomGetString(xkb->dpy,name));
- if (led->flags&XkbIM_NoExplicit)
- fprintf(file," !allowExplicit;\n");
- if (led->flags&XkbIM_LEDDrivesKB)
- fprintf(file," indicatorDrivesKeyboard;\n");
- if (led->which_groups!=0) {
- if (led->which_groups!=XkbIM_UseEffective) {
- fprintf(file," whichGroupState= %s;\n",
- XkbIMWhichStateMaskText(led->which_groups,XkbXKBFile));
- }
- fprintf(file," groups= 0x%02x;\n",led->groups);
- }
- if (led->which_mods!=0) {
- if (led->which_mods!=XkbIM_UseEffective) {
- fprintf(file," whichModState= %s;\n",
- XkbIMWhichStateMaskText(led->which_mods,XkbXKBFile));
- }
- fprintf(file," modifiers= %s;\n",
- XkbVModMaskText(xkb->dpy,xkb,
- led->mods.real_mods,led->mods.vmods,
- XkbXKBFile));
- }
- if (led->ctrls!=0) {
- fprintf(file," controls= %s;\n",
- XkbControlsMaskText(led->ctrls,XkbXKBFile));
- }
- if (addOn)
- (*addOn)(file,result,False,True,XkmIndicatorsIndex,priv);
- fprintf(file," };\n");
- return True;
-}
-
-Bool
-XkbWriteXKBCompatMap( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Display * dpy;
-register unsigned i;
-XkbSymInterpretPtr interp;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- dpy= xkb->dpy;
- if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) {
- _XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0);
- return False;
- }
- if ((xkb->names==NULL)||(xkb->names->compat==None))
- fprintf(file,"xkb_compatibility {\n\n");
- else fprintf(file,"xkb_compatibility \"%s\" {\n\n",
- XkbAtomText(dpy,xkb->names->compat,XkbXKBFile));
- WriteXKBVModDecl(file,dpy,xkb,
- (showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
-
- fprintf(file," interpret.useModMapMods= AnyLevel;\n");
- fprintf(file," interpret.repeat= False;\n");
- fprintf(file," interpret.locking= False;\n");
- interp= xkb->compat->sym_interpret;
- for (i=0;i<xkb->compat->num_si;i++,interp++) {
- fprintf(file," interpret %s+%s(%s) {\n",
- ((interp->sym==NoSymbol)?"Any":
- XkbKeysymText(interp->sym,XkbXKBFile)),
- XkbSIMatchText(interp->match,XkbXKBFile),
- XkbModMaskText(interp->mods,XkbXKBFile));
- if (interp->virtual_mod!=XkbNoModifier) {
- fprintf(file," virtualModifier= %s;\n",
- XkbVModIndexText(dpy,xkb,interp->virtual_mod,XkbXKBFile));
- }
- if (interp->match&XkbSI_LevelOneOnly)
- fprintf(file," useModMapMods=level1;\n");
- if (interp->flags&XkbSI_LockingKey)
- fprintf(file," locking= True;\n");
- if (interp->flags&XkbSI_AutoRepeat)
- fprintf(file," repeat= True;\n");
- fprintf(file," action= ");
- WriteXKBAction(file,result,&interp->act);
- fprintf(file,";\n");
- fprintf(file," };\n");
- }
- for (i=0;i<XkbNumKbdGroups;i++) {
- XkbModsPtr gc;
-
- gc= &xkb->compat->groups[i];
- if ((gc->real_mods==0)&&(gc->vmods==0))
- continue;
- fprintf(file," group %d = %s;\n",i+1,XkbVModMaskText(xkb->dpy,xkb,
- gc->real_mods,gc->vmods,
- XkbXKBFile));
- }
- if (xkb->indicators) {
- for (i=0;i<XkbNumIndicators;i++) {
- XkbIndicatorMapPtr map= &xkb->indicators->maps[i];
- if ((map->flags!=0)||(map->which_groups!=0)||(map->groups!=0)||
- (map->which_mods!=0)||
- (map->mods.real_mods!=0)||(map->mods.vmods!=0)||
- (map->ctrls!=0)) {
- WriteXKBIndicatorMap(file,result,xkb->names->indicators[i],map,
- addOn,priv);
- }
- }
- }
- if (addOn)
- (*addOn)(file,result,topLevel,showImplicit,XkmCompatMapIndex,priv);
- fprintf(file,"};\n\n");
- return True;
-}
-
-Bool
-XkbWriteXKBSymbols( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Display * dpy;
-register unsigned i,tmp;
-XkbDescPtr xkb;
-XkbClientMapPtr map;
-XkbServerMapPtr srv;
-Bool showActions;
-
- xkb= result->xkb;
- map= xkb->map;
- srv= xkb->server;
- dpy= xkb->dpy;
- if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
- _XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
- return False;
- }
- if ((!xkb->names)||(!xkb->names->keys)) {
- _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBSymbols",0);
- return False;
- }
- if ((xkb->names==NULL)||(xkb->names->symbols==None))
- fprintf(file,"xkb_symbols {\n\n");
- else fprintf(file,"xkb_symbols \"%s\" {\n\n",
- XkbAtomText(dpy,xkb->names->symbols,XkbXKBFile));
- for (tmp=i=0;i<XkbNumKbdGroups;i++) {
- if (xkb->names->groups[i]!=None) {
- fprintf(file," name[group%d]=\"%s\";\n",i+1,
- XkbAtomText(dpy,xkb->names->groups[i],XkbXKBFile));
- tmp++;
- }
- }
- if (tmp>0)
- fprintf(file,"\n");
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- Bool simple;
- if ((int)XkbKeyNumSyms(xkb,i)<1)
- continue;
- if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,True)!=i)
- continue;
- simple= True;
- fprintf(file," key %6s {",
- XkbKeyNameText(xkb->names->keys[i].name,XkbXKBFile));
- if (srv->explicit) {
- if (((srv->explicit[i]&XkbExplicitKeyTypesMask)!=0)||
- (showImplicit)) {
- int typeNdx,g;
- Bool multi;
- char * comment=" ";
-
- if ((srv->explicit[i]&XkbExplicitKeyTypesMask)==0)
- comment= "//";
- multi= False;
- typeNdx= XkbKeyKeyTypeIndex(xkb,i,0);
- for (g=1;(g<XkbKeyNumGroups(xkb,i))&&(!multi);g++) {
- if (XkbKeyKeyTypeIndex(xkb,i,g)!=typeNdx)
- multi= True;
- }
- if (multi) {
- for (g=0;g<XkbKeyNumGroups(xkb,i);g++) {
- typeNdx= XkbKeyKeyTypeIndex(xkb,i,g);
- if (srv->explicit[i]&(1<<g)) {
- fprintf(file,"\n%s type[group%d]= \"%s\",",
- comment,g+1,
- XkbAtomText(dpy,map->types[typeNdx].name,
- XkbXKBFile));
- }
- else if (showImplicit) {
- fprintf(file,"\n// type[group%d]= \"%s\",",g+1,
- XkbAtomText(dpy,map->types[typeNdx].name,
- XkbXKBFile));
- }
- }
- }
- else {
- fprintf(file,"\n%s type= \"%s\",",comment,
- XkbAtomText(dpy,map->types[typeNdx].name,
- XkbXKBFile));
- }
- simple= False;
- }
- if (((srv->explicit[i]&XkbExplicitAutoRepeatMask)!=0)&&
- (xkb->ctrls!=NULL)) {
- if (xkb->ctrls->per_key_repeat[i/8]&(1<<(i%8)))
- fprintf(file,"\n repeat= Yes,");
- else fprintf(file,"\n repeat= No,");
- simple= False;
- }
- if ((xkb->server!=NULL)&&(xkb->server->vmodmap!=NULL)&&
- (xkb->server->vmodmap[i]!=0)) {
- if ((srv->explicit[i]&XkbExplicitVModMapMask)!=0) {
- fprintf(file,"\n virtualMods= %s,",
- XkbVModMaskText(dpy,xkb,0,
- xkb->server->vmodmap[i],
- XkbXKBFile));
- }
- else if (showImplicit) {
- fprintf(file,"\n// virtualMods= %s,",
- XkbVModMaskText(dpy,xkb,0,
- xkb->server->vmodmap[i],
- XkbXKBFile));
- }
- }
- }
- switch (XkbOutOfRangeGroupAction(XkbKeyGroupInfo(xkb,i))) {
- case XkbClampIntoRange:
- fprintf(file,"\n groupsClamp,");
- break;
- case XkbRedirectIntoRange:
- fprintf(file,"\n groupsRedirect= Group%d,",
- XkbOutOfRangeGroupNumber(XkbKeyGroupInfo(xkb,i))+1);
- break;
- }
- if (srv->behaviors!=NULL) {
- unsigned type;
- type= srv->behaviors[i].type&XkbKB_OpMask;
-
- if (type!=XkbKB_Default) {
- simple= False;
- fprintf(file,"\n %s,",
- XkbBehaviorText(xkb,&srv->behaviors[i],XkbXKBFile));
- }
- }
- if ((srv->explicit==NULL) || showImplicit ||
- ((srv->explicit[i]&XkbExplicitInterpretMask)!=0))
- showActions= XkbKeyHasActions(xkb,i);
- else showActions= False;
-
- if (((unsigned)XkbKeyNumGroups(xkb,i)>1)||showActions)
- simple= False;
- if (simple) {
- KeySym *syms;
- unsigned s;
-
- syms= XkbKeySymsPtr(xkb,i);
- fprintf(file," [ ");
- for (s=0;s<XkbKeyGroupWidth(xkb,i,XkbGroup1Index);s++) {
- if (s!=0)
- fprintf(file,", ");
- fprintf(file,"%15s",XkbKeysymText(*syms++,XkbXKBFile));
- }
- fprintf(file," ] };\n");
- }
- else {
- unsigned g,s;
- KeySym *syms;
- XkbAction *acts;
- syms= XkbKeySymsPtr(xkb,i);
- acts= XkbKeyActionsPtr(xkb,i);
- for (g=0;g<XkbKeyNumGroups(xkb,i);g++) {
- if (g!=0)
- fprintf(file,",");
- fprintf(file,"\n symbols[Group%d]= [ ",g+1);
- for (s=0;s<XkbKeyGroupWidth(xkb,i,g);s++) {
- if (s!=0)
- fprintf(file,", ");
- fprintf(file,"%15s",XkbKeysymText(syms[s],XkbXKBFile));
- }
- fprintf(file," ]");
- syms+= XkbKeyGroupsWidth(xkb,i);
- if (showActions) {
- fprintf(file,",\n actions[Group%d]= [ ",g+1);
- for (s=0;s<XkbKeyGroupWidth(xkb,i,g);s++) {
- if (s!=0)
- fprintf(file,", ");
- WriteXKBAction(file,result,(XkbAnyAction *)&acts[s]);
- }
- fprintf(file," ]");
- acts+= XkbKeyGroupsWidth(xkb,i);
- }
- }
- fprintf(file,"\n };\n");
- }
- }
- if (map && map->modmap) {
- for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
- if (map->modmap[i]!=0) {
- register int n,bit;
- for (bit=1,n=0;n<XkbNumModifiers;n++,bit<<=1) {
- if (map->modmap[i]&bit) {
- char buf[5];
- memcpy(buf,xkb->names->keys[i].name,4);
- buf[4]= '\0';
- fprintf(file," modifier_map %s { <%s> };\n",
- XkbModIndexText(n,XkbXKBFile),buf);
- }
- }
- }
- }
- }
- if (addOn)
- (*addOn)(file,result,topLevel,showImplicit,XkmSymbolsIndex,priv);
- fprintf(file,"};\n\n");
- return True;
-}
-
-static Bool
-WriteXKBOutline( FILE * file,
- XkbShapePtr shape,
- XkbOutlinePtr outline,
- int lastRadius,
- int first,
- int indent)
-{
-register int i;
-XkbPointPtr pt;
-char * iStr;
-
- fprintf(file,"%s",iStr= XkbIndentText(first));
- if (first!=indent)
- iStr= XkbIndentText(indent);
- if (outline->corner_radius!=lastRadius) {
- fprintf(file,"corner= %s,",
- XkbGeomFPText(outline->corner_radius,XkbMessage));
- if (shape!=NULL) {
- fprintf(file,"\n%s",iStr);
- }
- }
- if (shape) {
- if (outline==shape->approx)
- fprintf(file,"approx= ");
- else if (outline==shape->primary)
- fprintf(file,"primary= ");
- }
- fprintf(file,"{");
- for (pt=outline->points,i=0;i<outline->num_points;i++,pt++) {
- if (i==0) fprintf(file," ");
- else if ((i%4)==0) fprintf(file,",\n%s ",iStr);
- else fprintf(file,", ");
- fprintf(file,"[ %3s, %3s ]",XkbGeomFPText(pt->x,XkbXKBFile),
- XkbGeomFPText(pt->y,XkbXKBFile));
- }
- fprintf(file," }");
- return True;
-}
-
-static Bool
-WriteXKBDoodad( FILE * file,
- Display * dpy,
- unsigned indent,
- XkbGeometryPtr geom,
- XkbDoodadPtr doodad)
-{
-register char * i_str;
-XkbShapePtr shape;
-XkbColorPtr color;
-
- i_str= XkbIndentText(indent);
- fprintf(file,"%s%s \"%s\" {\n",i_str,
- XkbDoodadTypeText(doodad->any.type,XkbMessage),
- XkbAtomText(dpy,doodad->any.name,XkbMessage));
- fprintf(file,"%s top= %s;\n",i_str,
- XkbGeomFPText(doodad->any.top,XkbXKBFile));
- fprintf(file,"%s left= %s;\n",i_str,
- XkbGeomFPText(doodad->any.left,XkbXKBFile));
- fprintf(file,"%s priority= %d;\n",i_str,doodad->any.priority);
- switch (doodad->any.type) {
- case XkbOutlineDoodad:
- case XkbSolidDoodad:
- if (doodad->shape.angle!=0) {
- fprintf(file,"%s angle= %s;\n",i_str,
- XkbGeomFPText(doodad->shape.angle,XkbXKBFile));
- }
- if (doodad->shape.color_ndx!=0) {
- fprintf(file,"%s color= \"%s\";\n",i_str,
- XkbShapeDoodadColor(geom,&doodad->shape)->spec);
- }
- shape= XkbShapeDoodadShape(geom,&doodad->shape);
- fprintf(file,"%s shape= \"%s\";\n",i_str,
- XkbAtomText(dpy,shape->name,XkbXKBFile));
- break;
- case XkbTextDoodad:
- if (doodad->text.angle!=0) {
- fprintf(file,"%s angle= %s;\n",i_str,
- XkbGeomFPText(doodad->text.angle,XkbXKBFile));
- }
- if (doodad->text.width!=0) {
- fprintf(file,"%s width= %s;\n",i_str,
- XkbGeomFPText(doodad->text.width,XkbXKBFile));
-
- }
- if (doodad->text.height!=0) {
- fprintf(file,"%s height= %s;\n",i_str,
- XkbGeomFPText(doodad->text.height,XkbXKBFile));
-
- }
- if (doodad->text.color_ndx!=0) {
- color= XkbTextDoodadColor(geom,&doodad->text);
- fprintf(file,"%s color= \"%s\";\n",i_str,
- XkbStringText(color->spec,XkbXKBFile));
- }
- fprintf(file,"%s XFont= \"%s\";\n",i_str,
- XkbStringText(doodad->text.font,XkbXKBFile));
- fprintf(file,"%s text= \"%s\";\n",i_str,
- XkbStringText(doodad->text.text,XkbXKBFile));
- break;
- case XkbIndicatorDoodad:
- shape= XkbIndicatorDoodadShape(geom,&doodad->indicator);
- color= XkbIndicatorDoodadOnColor(geom,&doodad->indicator);
- fprintf(file,"%s onColor= \"%s\";\n",i_str,
- XkbStringText(color->spec,XkbXKBFile));
- color= XkbIndicatorDoodadOffColor(geom,&doodad->indicator);
- fprintf(file,"%s offColor= \"%s\";\n",i_str,
- XkbStringText(color->spec,XkbXKBFile));
- fprintf(file,"%s shape= \"%s\";\n",i_str,
- XkbAtomText(dpy,shape->name,XkbXKBFile));
- break;
- case XkbLogoDoodad:
- fprintf(file,"%s logoName= \"%s\";\n",i_str,
- XkbStringText(doodad->logo.logo_name,XkbXKBFile));
- if (doodad->shape.angle!=0) {
- fprintf(file,"%s angle= %s;\n",i_str,
- XkbGeomFPText(doodad->logo.angle,XkbXKBFile));
- }
- if (doodad->shape.color_ndx!=0) {
- fprintf(file,"%s color= \"%s\";\n",i_str,
- XkbLogoDoodadColor(geom,&doodad->logo)->spec);
- }
- shape= XkbLogoDoodadShape(geom,&doodad->logo);
- fprintf(file,"%s shape= \"%s\";\n",i_str,
- XkbAtomText(dpy,shape->name,XkbXKBFile));
- break;
- }
- fprintf(file,"%s};\n",i_str);
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-WriteXKBOverlay( FILE * file,
- Display * dpy,
- unsigned indent,
- XkbGeometryPtr geom,
- XkbOverlayPtr ol)
-{
-register char * i_str;
-int r,k,nOut;
-XkbOverlayRowPtr row;
-XkbOverlayKeyPtr key;
-
- i_str= XkbIndentText(indent);
- if (ol->name!=None) {
- fprintf(file,"%soverlay \"%s\" {\n",i_str,
- XkbAtomText(dpy,ol->name,XkbMessage));
- }
- else fprintf(file,"%soverlay {\n",i_str);
- for (nOut=r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
- for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
- char *over,*under;
- over= XkbKeyNameText(key->over.name,XkbXKBFile);
- under= XkbKeyNameText(key->under.name,XkbXKBFile);
- if (nOut==0)
- fprintf(file,"%s %6s=%6s",i_str,under,over);
- else if ((nOut%4)==0)
- fprintf(file,",\n%s %6s=%6s",i_str,under,over);
- else fprintf(file,", %6s=%6s",under,over);
- nOut++;
- }
- }
- fprintf(file,"\n%s};\n",i_str);
- return True;
-}
-
-static Bool
-WriteXKBSection( FILE * file,
- Display * dpy,
- XkbSectionPtr s,
- XkbGeometryPtr geom)
-{
-register int i;
-XkbRowPtr row;
-int dfltKeyColor = 0;
-
- fprintf(file," section \"%s\" {\n",
- XkbAtomText(dpy,s->name,XkbXKBFile));
- if (s->rows&&(s->rows->num_keys>0)) {
- dfltKeyColor= s->rows->keys[0].color_ndx;
- fprintf(file," key.color= \"%s\";\n",
- XkbStringText(geom->colors[dfltKeyColor].spec,XkbXKBFile));
- }
- fprintf(file," priority= %d;\n",s->priority);
- fprintf(file," top= %s;\n",XkbGeomFPText(s->top,XkbXKBFile));
- fprintf(file," left= %s;\n",XkbGeomFPText(s->left,XkbXKBFile));
- fprintf(file," width= %s;\n",XkbGeomFPText(s->width,XkbXKBFile));
- fprintf(file," height= %s;\n",
- XkbGeomFPText(s->height,XkbXKBFile));
- if (s->angle!=0) {
- fprintf(file," angle= %s;\n",
- XkbGeomFPText(s->angle,XkbXKBFile));
- }
- for (i=0,row=s->rows;i<s->num_rows;i++,row++) {
- fprintf(file," row {\n");
- fprintf(file," top= %s;\n",
- XkbGeomFPText(row->top,XkbXKBFile));
- fprintf(file," left= %s;\n",
- XkbGeomFPText(row->left,XkbXKBFile));
- if (row->vertical)
- fprintf(file," vertical;\n");
- if (row->num_keys>0) {
- register int k;
- register XkbKeyPtr key;
- int forceNL=0;
- int nThisLine= 0;
- fprintf(file," keys {\n");
- for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
- XkbShapePtr shape;
- if (key->color_ndx!=dfltKeyColor)
- forceNL= 1;
- if (k==0) {
- fprintf(file," ");
- nThisLine= 0;
- }
- else if (((nThisLine%2)==1)||(forceNL)) {
- fprintf(file,",\n ");
- forceNL= nThisLine= 0;
- }
- else {
- fprintf(file,", ");
- nThisLine++;
- }
- shape= XkbKeyShape(geom,key);
- fprintf(file,"{ %6s, \"%s\", %3s",
- XkbKeyNameText(key->name.name,XkbXKBFile),
- XkbAtomText(dpy,shape->name,XkbXKBFile),
- XkbGeomFPText(key->gap,XkbXKBFile));
- if (key->color_ndx!=dfltKeyColor) {
- fprintf(file,", color=\"%s\"",XkbKeyColor(geom,key)->spec);
- forceNL= 1;
- }
- fprintf(file," }");
- }
- fprintf(file,"\n };\n");
- }
- fprintf(file," };\n");
- }
- if (s->doodads!=NULL) {
- XkbDoodadPtr doodad;
- for (i=0,doodad=s->doodads;i<s->num_doodads;i++,doodad++) {
- WriteXKBDoodad(file,dpy,8,geom,doodad);
- }
- }
- if (s->overlays!=NULL) {
- XkbOverlayPtr ol;
- for (i=0,ol=s->overlays;i<s->num_overlays;i++,ol++) {
- WriteXKBOverlay(file,dpy,8,geom,ol);
- }
- }
- fprintf(file," }; // End of \"%s\" section\n\n",
- XkbAtomText(dpy,s->name,XkbXKBFile));
- return True;
-}
-
-Bool
-XkbWriteXKBGeometry( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Display * dpy;
-register unsigned i,n;
-XkbDescPtr xkb;
-XkbGeometryPtr geom;
-
- xkb= result->xkb;
- if ((!xkb)||(!xkb->geom)) {
- _XkbLibError(_XkbErrMissingGeometry,"XkbWriteXKBGeometry",0);
- return False;
- }
- dpy= xkb->dpy;
- geom= xkb->geom;
- if (geom->name==None)
- fprintf(file,"xkb_geometry {\n\n");
- else fprintf(file,"xkb_geometry \"%s\" {\n\n",
- XkbAtomText(dpy,geom->name,XkbXKBFile));
- fprintf(file," width= %s;\n",
- XkbGeomFPText(geom->width_mm,XkbXKBFile));
- fprintf(file," height= %s;\n\n",
- XkbGeomFPText(geom->height_mm,XkbXKBFile));
-
- if (geom->key_aliases!=NULL) {
- XkbKeyAliasPtr pAl;
- pAl= geom->key_aliases;
- for (i=0;i<geom->num_key_aliases;i++,pAl++) {
- fprintf(file," alias %6s = %6s;\n",
- XkbKeyNameText(pAl->alias,XkbXKBFile),
- XkbKeyNameText(pAl->real,XkbXKBFile));
- }
- fprintf(file,"\n");
- }
-
- if (geom->base_color!=NULL)
- fprintf(file," baseColor= \"%s\";\n",
- XkbStringText(geom->base_color->spec,XkbXKBFile));
- if (geom->label_color!=NULL)
- fprintf(file," labelColor= \"%s\";\n",
- XkbStringText(geom->label_color->spec,XkbXKBFile));
- if (geom->label_font!=NULL)
- fprintf(file," xfont= \"%s\";\n",
- XkbStringText(geom->label_font,XkbXKBFile));
- if ((geom->num_colors>0)&&(showImplicit)) {
- XkbColorPtr color;
- for (color=geom->colors,i=0;i<geom->num_colors;i++,color++) {
- fprintf(file,"// color[%d]= \"%s\"\n",i,
- XkbStringText(color->spec,XkbXKBFile));
- }
- fprintf(file,"\n");
- }
- if (geom->num_properties>0) {
- XkbPropertyPtr prop;
- for (prop=geom->properties,i=0;i<geom->num_properties;i++,prop++) {
- fprintf(file," %s= \"%s\";\n",prop->name,
- XkbStringText(prop->value,XkbXKBFile));
- }
- fprintf(file,"\n");
- }
- if (geom->num_shapes>0) {
- XkbShapePtr shape;
- XkbOutlinePtr outline;
- int lastR;
- for (shape=geom->shapes,i=0;i<geom->num_shapes;i++,shape++) {
- lastR=0;
- fprintf(file," shape \"%s\" {",
- XkbAtomText(dpy,shape->name,XkbXKBFile));
- outline= shape->outlines;
- if (shape->num_outlines>1) {
- for (n=0;n<shape->num_outlines;n++,outline++) {
- if (n==0) fprintf(file,"\n");
- else fprintf(file,",\n");
- WriteXKBOutline(file,shape,outline,lastR,8,8);
- lastR= outline->corner_radius;
- }
- fprintf(file,"\n };\n");
- }
- else {
- WriteXKBOutline(file,NULL,outline,lastR,1,8);
- fprintf(file," };\n");
- }
- }
- }
- if (geom->num_sections>0) {
- XkbSectionPtr section;
- for (section=geom->sections,i=0;i<geom->num_sections;i++,section++){
- WriteXKBSection(file,dpy,section,geom);
- }
- }
- if (geom->num_doodads>0) {
- XkbDoodadPtr doodad;
- for (i=0,doodad=geom->doodads;i<geom->num_doodads;i++,doodad++) {
- WriteXKBDoodad(file,dpy,4,geom,doodad);
- }
- }
- if (addOn)
- (*addOn)(file,result,topLevel,showImplicit,XkmGeometryIndex,priv);
- fprintf(file,"};\n\n");
- return True;
-}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBSemantics( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-
- fprintf(file,"xkb_semantics {\n");
- ok= XkbWriteXKBKeyTypes(file,result,False,False,addOn,priv);
- ok= ok&&XkbWriteXKBCompatMap(file,result,False,False,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBLayout( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- fprintf(file,"xkb_layout {\n");
- ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
- if (xkb->geom)
- ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBKeymap( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- fprintf(file,"xkb_keymap {\n");
- ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBCompatMap(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
- if (xkb->geom)
- ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-Bool
-XkbWriteXKBFile( FILE * out,
- XkbFileInfo * result,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok = False;
-Bool (*func)(
- FILE * /* file */,
- XkbFileInfo * /* result */,
- Bool /* topLevel */,
- Bool /* showImplicit */,
- XkbFileAddOnFunc /* addOn */,
- void * /* priv */
-) = NULL;
-
- switch (result->type) {
- case XkmSemanticsFile:
- func= XkbWriteXKBSemantics;
- break;
- case XkmLayoutFile:
- func= XkbWriteXKBLayout;
- break;
- case XkmKeymapFile:
- func= XkbWriteXKBKeymap;
- break;
- case XkmTypesIndex:
- func= XkbWriteXKBKeyTypes;
- break;
- case XkmCompatMapIndex:
- func= XkbWriteXKBCompatMap;
- break;
- case XkmSymbolsIndex:
- func= XkbWriteXKBSymbols;
- break;
- case XkmKeyNamesIndex:
- func= XkbWriteXKBKeycodes;
- break;
- case XkmGeometryFile:
- case XkmGeometryIndex:
- func= XkbWriteXKBGeometry;
- break;
- case XkmVirtualModsIndex:
- case XkmIndicatorsIndex:
- _XkbLibError(_XkbErrBadImplementation,
- XkbConfigText(result->type,XkbMessage),0);
- return False;
- }
- if (out==NULL) {
- _XkbLibError(_XkbErrFileCannotOpen,"XkbWriteXkbFile",0);
- ok= False;
- }
- else if (func) {
- ok= (*func)(out,result,True,showImplicit,addOn,priv);
- }
- return ok;
-}
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
deleted file mode 100644
index fc593e796..000000000
--- a/xkb/xkbtext.c
+++ /dev/null
@@ -1,1434 +0,0 @@
-/* $Xorg: xkbtext.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkbtext.c,v 3.12 2003/11/17 22:20:24 dawes Exp $ */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#include <X11/Xos.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <X11/Xlib.h>
-#include <X11/XKBlib.h>
-#include <X11/extensions/XKBgeom.h>
-
-#include "XKMformat.h"
-#include "XKBfileInt.h"
-
-#else
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include "misc.h"
-#include "inputstr.h"
-#include "dix.h"
-#include "XKBstr.h"
-#define XKBSRV_NEED_FILE_FUNCS 1
-#include "XKBsrv.h"
-#include "XKBgeom.h"
-
-#endif
-
-/***====================================================================***/
-
-#define BUFFER_SIZE 512
-
-static char textBuffer[BUFFER_SIZE];
-static int tbNext= 0;
-
-static char *
-tbGetBuffer(unsigned size)
-{
-char *rtrn;
-
- if (size>=BUFFER_SIZE)
- return NULL;
- if ((BUFFER_SIZE-tbNext)<=size)
- tbNext= 0;
- rtrn= &textBuffer[tbNext];
- tbNext+= size;
- return rtrn;
-}
-
-/***====================================================================***/
-
-char *
-XkbAtomText(Display *dpy,Atom atm,unsigned format)
-{
-char *rtrn,*tmp;
-
- tmp= XkbAtomGetString(dpy,atm);
- if (tmp!=NULL) {
- int len;
- len= strlen(tmp)+1;
- if (len>BUFFER_SIZE)
- len= BUFFER_SIZE-2;
- rtrn= tbGetBuffer(len);
- strncpy(rtrn,tmp,len);
- rtrn[len]= '\0';
- }
- else {
- rtrn= tbGetBuffer(1);
- rtrn[0]= '\0';
- }
- if (format==XkbCFile) {
- for (tmp=rtrn;*tmp!='\0';tmp++) {
- if ((tmp==rtrn)&&(!isalpha(*tmp)))
- *tmp= '_';
- else if (!isalnum(*tmp))
- *tmp= '_';
- }
- }
- return XkbStringText(rtrn,format);
-}
-
-/***====================================================================***/
-
-char *
-XkbVModIndexText(Display *dpy,XkbDescPtr xkb,unsigned ndx,unsigned format)
-{
-register int len;
-register Atom *vmodNames;
-char *rtrn,*tmp;
-char numBuf[20];
-
- if (xkb && xkb->names)
- vmodNames= xkb->names->vmods;
- else vmodNames= NULL;
-
- tmp= NULL;
- if (ndx>=XkbNumVirtualMods)
- tmp= "illegal";
- else if (vmodNames&&(vmodNames[ndx]!=None))
- tmp= XkbAtomGetString(dpy,vmodNames[ndx]);
- if (tmp==NULL)
- sprintf(tmp=numBuf,"%d",ndx);
-
- len= strlen(tmp)+1;
- if (format==XkbCFile)
- len+= 4;
- if (len>=BUFFER_SIZE)
- len= BUFFER_SIZE-1;
- rtrn= tbGetBuffer(len);
- if (format==XkbCFile) {
- strcpy(rtrn,"vmod_");
- strncpy(&rtrn[5],tmp,len-4);
- }
- else strncpy(rtrn,tmp,len);
- return rtrn;
-}
-
-char *
-XkbVModMaskText( Display * dpy,
- XkbDescPtr xkb,
- unsigned modMask,
- unsigned mask,
- unsigned format)
-{
-register int i,bit;
-int len;
-char *mm,*rtrn;
-char *str,buf[BUFFER_SIZE];
-
- if ((modMask==0)&&(mask==0)) {
- rtrn= tbGetBuffer(5);
- if (format==XkbCFile)
- sprintf(rtrn,"0");
- else sprintf(rtrn,"none");
- return rtrn;
- }
- if (modMask!=0)
- mm= XkbModMaskText(modMask,format);
- else mm= NULL;
-
- str= buf;
- buf[0]= '\0';
- if (mask) {
- char *tmp;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (mask&bit) {
- tmp= XkbVModIndexText(dpy,xkb,i,format);
- len= strlen(tmp)+1+(str==buf?0:1);
- if (format==XkbCFile)
- len+= 4;
- if ((str-(buf+len))<=BUFFER_SIZE) {
- if (str!=buf) {
- if (format==XkbCFile) *str++= '|';
- else *str++= '+';
- len--;
- }
- }
- if (format==XkbCFile)
- sprintf(str,"%sMask",tmp);
- else strcpy(str,tmp);
- str= &str[len-1];
- }
- }
- str= buf;
- }
- else str= NULL;
- if (mm)
- len= strlen(mm);
- else len= 0;
- if (str)
- len+= strlen(str)+(mm==NULL?0:1);
- if (len>=BUFFER_SIZE)
- len= BUFFER_SIZE-1;
- rtrn= tbGetBuffer(len+1);
- rtrn[0]= '\0';
-
- if (mm!=NULL) {
- i= strlen(mm);
- if (i>len)
- i= len;
- strcpy(rtrn,mm);
- }
- else {
- i=0;
- }
- if (str!=NULL) {
- if (mm!=NULL) {
- if (format==XkbCFile) strcat(rtrn,"|");
- else strcat(rtrn,"+");
- }
- strncat(rtrn,str,len-i);
- }
- rtrn[len]= '\0';
- return rtrn;
-}
-
-static char *modNames[XkbNumModifiers] = {
- "Shift", "Lock", "Control", "Mod1", "Mod2", "Mod3", "Mod4", "Mod5"
-};
-
-char *
-XkbModIndexText(unsigned ndx,unsigned format)
-{
-char * rtrn;
-char buf[100];
-
- if (format==XkbCFile) {
- if (ndx<XkbNumModifiers)
- sprintf(buf,"%sMapIndex",modNames[ndx]);
- else if (ndx==XkbNoModifier)
- sprintf(buf,"XkbNoModifier");
- else sprintf(buf,"0x%02x",ndx);
- }
- else {
- if (ndx<XkbNumModifiers)
- strcpy(buf,modNames[ndx]);
- else if (ndx==XkbNoModifier)
- strcpy(buf,"none");
- else sprintf(buf,"ILLEGAL_%02x",ndx);
- }
- rtrn= tbGetBuffer(strlen(buf)+1);
- strcpy(rtrn,buf);
- return rtrn;
-}
-
-char *
-XkbModMaskText(unsigned mask,unsigned format)
-{
-register int i,bit;
-char buf[64],*rtrn;
-
- if ((mask&0xff)==0xff) {
- if (format==XkbCFile) strcpy(buf,"0xff");
- else strcpy(buf,"all");
- }
- else if ((mask&0xff)==0) {
- if (format==XkbCFile) strcpy(buf,"0");
- else strcpy(buf,"none");
- }
- else {
- char *str= buf;
- buf[0]= '\0';
- for (i=0,bit=1;i<XkbNumModifiers;i++,bit<<=1) {
- if (mask&bit) {
- if (str!=buf) {
- if (format==XkbCFile) *str++= '|';
- else *str++= '+';
- }
- strcpy(str,modNames[i]);
- str= &str[strlen(str)];
- if (format==XkbCFile) {
- strcpy(str,"Mask");
- str+= 4;
- }
- }
- }
- }
- rtrn= tbGetBuffer(strlen(buf)+1);
- strcpy(rtrn,buf);
- return rtrn;
-}
-
-/***====================================================================***/
-
-/*ARGSUSED*/
-char *
-XkbConfigText(unsigned config,unsigned format)
-{
-static char *buf;
-
- buf= tbGetBuffer(32);
- switch (config) {
- case XkmSemanticsFile:
- strcpy(buf,"Semantics");
- break;
- case XkmLayoutFile:
- strcpy(buf,"Layout");
- break;
- case XkmKeymapFile:
- strcpy(buf,"Keymap");
- break;
- case XkmGeometryFile:
- case XkmGeometryIndex:
- strcpy(buf,"Geometry");
- break;
- case XkmTypesIndex:
- strcpy(buf,"Types");
- break;
- case XkmCompatMapIndex:
- strcpy(buf,"CompatMap");
- break;
- case XkmSymbolsIndex:
- strcpy(buf,"Symbols");
- break;
- case XkmIndicatorsIndex:
- strcpy(buf,"Indicators");
- break;
- case XkmKeyNamesIndex:
- strcpy(buf,"KeyNames");
- break;
- case XkmVirtualModsIndex:
- strcpy(buf,"VirtualMods");
- break;
- default:
- sprintf(buf,"unknown(%d)",config);
- break;
- }
- return buf;
-}
-
-/***====================================================================***/
-
-char *
-XkbKeysymText(KeySym sym,unsigned format)
-{
-static char buf[32],*rtrn;
-
-#ifndef XKB_IN_SERVER
- if (sym==NoSymbol)
- strcpy(rtrn=buf,"NoSymbol");
- else if ((rtrn=XKeysymToString(sym))==NULL)
- sprintf(rtrn=buf, "0x%lx", (long)sym);
- else if (format==XkbCFile) {
- sprintf(buf,"XK_%s",rtrn);
- rtrn= buf;
- }
- return rtrn;
-#else /* def XKB_IN_SERVER */
- if (sym==NoSymbol)
- strcpy(rtrn=buf,"NoSymbol");
- else sprintf(rtrn=buf, "0x%lx", (long)sym);
- return rtrn;
-#endif /* XKB_IN_SERVER */
-}
-
-char *
-XkbKeyNameText(char *name,unsigned format)
-{
-char *buf;
-
- if (format==XkbCFile) {
- buf= tbGetBuffer(5);
- memcpy(buf,name,4);
- buf[4]= '\0';
- }
- else {
- int len;
- buf= tbGetBuffer(7);
- buf[0]= '<';
- memcpy(&buf[1],name,4);
- buf[5]= '\0';
- len= strlen(buf);
- buf[len++]= '>';
- buf[len]= '\0';
- }
- return buf;
-}
-
-/***====================================================================***/
-
-static char *siMatchText[5] = {
- "NoneOf", "AnyOfOrNone", "AnyOf", "AllOf", "Exactly"
-};
-
-char *
-XkbSIMatchText(unsigned type,unsigned format)
-{
-static char buf[40];
-char *rtrn;
-
- switch (type&XkbSI_OpMask) {
- case XkbSI_NoneOf: rtrn= siMatchText[0]; break;
- case XkbSI_AnyOfOrNone: rtrn= siMatchText[1]; break;
- case XkbSI_AnyOf: rtrn= siMatchText[2]; break;
- case XkbSI_AllOf: rtrn= siMatchText[3]; break;
- case XkbSI_Exactly: rtrn= siMatchText[4]; break;
- default: sprintf(buf,"0x%x",type&XkbSI_OpMask);
- return buf;
- }
- if (format==XkbCFile) {
- if (type&XkbSI_LevelOneOnly)
- sprintf(buf,"XkbSI_LevelOneOnly|XkbSI_%s",rtrn);
- else sprintf(buf,"XkbSI_%s",rtrn);
- rtrn= buf;
- }
- return rtrn;
-}
-
-/***====================================================================***/
-
-static char *imWhichNames[]= {
- "base",
- "latched",
- "locked",
- "effective",
- "compat"
-};
-
-char *
-XkbIMWhichStateMaskText(unsigned use_which,unsigned format)
-{
-int len;
-unsigned i,bit,tmp;
-char * buf;
-
- if (use_which==0) {
- buf= tbGetBuffer(2);
- strcpy(buf,"0");
- return buf;
- }
- tmp= use_which&XkbIM_UseAnyMods;
- for (len=i=0,bit=1;tmp!=0;i++,bit<<=1) {
- if (tmp&bit) {
- tmp&= ~bit;
- len+= strlen(imWhichNames[i])+1;
- if (format==XkbCFile)
- len+= 9;
- }
- }
- buf= tbGetBuffer(len+1);
- tmp= use_which&XkbIM_UseAnyMods;
- for (len=i=0,bit=1;tmp!=0;i++,bit<<=1) {
- if (tmp&bit) {
- tmp&= ~bit;
- if (format==XkbCFile) {
- if (len!=0)
- buf[len++]= '|';
- sprintf(&buf[len],"XkbIM_Use%s",imWhichNames[i]);
- buf[len+9]= toupper(buf[len+9]);
- }
- else {
- if (len!=0)
- buf[len++]= '+';
- sprintf(&buf[len],"%s",imWhichNames[i]);
- }
- len+= strlen(&buf[len]);
- }
- }
- return buf;
-}
-
-char *
-XkbAccessXDetailText(unsigned state,unsigned format)
-{
-char *buf,*prefix;
-
- buf= tbGetBuffer(32);
- if (format==XkbMessage) prefix= "";
- else prefix= "XkbAXN_";
- switch (state){
- case XkbAXN_SKPress: sprintf(buf,"%sSKPress",prefix); break;
- case XkbAXN_SKAccept: sprintf(buf,"%sSKAccept",prefix); break;
- case XkbAXN_SKRelease: sprintf(buf,"%sSKRelease",prefix); break;
- case XkbAXN_SKReject: sprintf(buf,"%sSKReject",prefix); break;
- case XkbAXN_BKAccept: sprintf(buf,"%sBKAccept",prefix); break;
- case XkbAXN_BKReject: sprintf(buf,"%sBKReject",prefix); break;
- case XkbAXN_AXKWarning: sprintf(buf,"%sAXKWarning",prefix); break;
- default: sprintf(buf,"ILLEGAL"); break;
- }
- return buf;
-}
-
-static char *nknNames[] = {
- "keycodes", "geometry", "deviceID"
-};
-#define NUM_NKN (sizeof(nknNames)/sizeof(char *))
-
-char *
-XkbNKNDetailMaskText(unsigned detail,unsigned format)
-{
-char *buf,*prefix,*suffix;
-register int i;
-register unsigned bit;
-int len,plen,slen;
-
-
- if ((detail&XkbAllNewKeyboardEventsMask)==0) {
- char *tmp = "";
- if (format==XkbCFile) tmp= "0";
- else if (format==XkbMessage) tmp= "none";
- buf= tbGetBuffer(strlen(tmp)+1);
- strcpy(buf,tmp);
- return buf;
- }
- else if ((detail&XkbAllNewKeyboardEventsMask)==XkbAllNewKeyboardEventsMask){
- char * tmp;
- if (format==XkbCFile) tmp= "XkbAllNewKeyboardEventsMask";
- else tmp= "all";
- buf= tbGetBuffer(strlen(tmp)+1);
- strcpy(buf,tmp);
- return buf;
- }
- if (format==XkbMessage) {
- prefix= "";
- suffix= "";
- slen= plen= 0;
- }
- else {
- prefix= "XkbNKN_";
- plen= 7;
- if (format==XkbCFile)
- suffix= "Mask";
- else suffix= "";
- slen= strlen(suffix);
- }
- for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
- if (detail&bit) {
- if (len!=0) len+= 1; /* room for '+' or '|' */
- len+= plen+slen+strlen(nknNames[i]);
- }
- }
- buf= tbGetBuffer(len+1);
- buf[0]= '\0';
- for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
- if (detail&bit) {
- if (len!=0) {
- if (format==XkbCFile) buf[len++]= '|';
- else buf[len++]= '+';
- }
- if (plen) {
- strcpy(&buf[len],prefix);
- len+= plen;
- }
- strcpy(&buf[len],nknNames[i]);
- len+= strlen(nknNames[i]);
- if (slen) {
- strcpy(&buf[len],suffix);
- len+= slen;
- }
- }
- }
- buf[len++]= '\0';
- return buf;
-}
-
-static char *ctrlNames[] = {
- "repeatKeys",
- "slowKeys",
- "bounceKeys",
- "stickyKeys",
- "mouseKeys",
- "mouseKeysAccel",
- "accessXKeys",
- "accessXTimeout",
- "accessXFeedback",
- "audibleBell",
- "overlay1",
- "overlay2",
- "ignoreGroupLock"
-};
-
-char *
-XkbControlsMaskText(unsigned ctrls,unsigned format)
-{
-int len;
-unsigned i,bit,tmp;
-char * buf;
-
- if (ctrls==0) {
- buf= tbGetBuffer(5);
- if (format==XkbCFile)
- strcpy(buf,"0");
- else strcpy(buf,"none");
- return buf;
- }
- tmp= ctrls&XkbAllBooleanCtrlsMask;
- for (len=i=0,bit=1;tmp!=0;i++,bit<<=1) {
- if (tmp&bit) {
- tmp&= ~bit;
- len+= strlen(ctrlNames[i])+1;
- if (format==XkbCFile)
- len+= 7;
- }
- }
- buf= tbGetBuffer(len+1);
- tmp= ctrls&XkbAllBooleanCtrlsMask;
- for (len=i=0,bit=1;tmp!=0;i++,bit<<=1) {
- if (tmp&bit) {
- tmp&= ~bit;
- if (format==XkbCFile) {
- if (len!=0)
- buf[len++]= '|';
- sprintf(&buf[len],"Xkb%sMask",ctrlNames[i]);
- buf[len+3]= toupper(buf[len+3]);
- }
- else {
- if (len!=0)
- buf[len++]= '+';
- sprintf(&buf[len],"%s",ctrlNames[i]);
- }
- len+= strlen(&buf[len]);
- }
- }
- return buf;
-}
-
-/***====================================================================***/
-
-char *
-XkbStringText(char *str,unsigned format)
-{
-char * buf;
-register char *in,*out;
-int len;
-Bool ok;
-
- if (str==NULL) {
- buf= tbGetBuffer(2);
- buf[0]='\0';
- return buf;
- }
- else if (format==XkbXKMFile)
- return str;
- for (ok= True,len=0,in=str;*in!='\0';in++,len++) {
- if (!isprint(*in)) {
- ok= False;
- switch (*in) {
- case '\n': case '\t': case '\v':
- case '\b': case '\r': case '\f':
- len++;
- break;
- default:
- len+= 4;
- break;
- }
- }
- }
- if (ok)
- return str;
- buf= tbGetBuffer(len+1);
- for (in=str,out=buf;*in!='\0';in++) {
- if (isprint(*in))
- *out++= *in;
- else {
- *out++= '\\';
- if (*in=='\n') *out++= 'n';
- else if (*in=='\t') *out++= 't';
- else if (*in=='\v') *out++= 'v';
- else if (*in=='\b') *out++= 'b';
- else if (*in=='\r') *out++= 'r';
- else if (*in=='\f') *out++= 'f';
- else if ((*in=='\033')&&(format==XkbXKMFile)) {
- *out++= 'e';
- }
- else {
- *out++= '0';
- sprintf(out,"%o",*in);
- while (*out!='\0')
- out++;
- }
- }
- }
- *out++= '\0';
- return buf;
-}
-
-/***====================================================================***/
-
-char *
-XkbGeomFPText(int val,unsigned format)
-{
-int whole,frac;
-char * buf;
-
- buf= tbGetBuffer(12);
- if (format==XkbCFile) {
- sprintf(buf,"%d",val);
- }
- else {
- whole= val/XkbGeomPtsPerMM;
- frac= val%XkbGeomPtsPerMM;
- if (frac!=0)
- sprintf(buf,"%d.%d",whole,frac);
- else sprintf(buf,"%d",whole);
- }
- return buf;
-}
-
-char *
-XkbDoodadTypeText(unsigned type,unsigned format)
-{
-char * buf;
- if (format==XkbCFile) {
- buf= tbGetBuffer(24);
- if (type==XkbOutlineDoodad) strcpy(buf,"XkbOutlineDoodad");
- else if (type==XkbSolidDoodad) strcpy(buf,"XkbSolidDoodad");
- else if (type==XkbTextDoodad) strcpy(buf,"XkbTextDoodad");
- else if (type==XkbIndicatorDoodad) strcpy(buf,"XkbIndicatorDoodad");
- else if (type==XkbLogoDoodad) strcpy(buf,"XkbLogoDoodad");
- else sprintf(buf,"UnknownDoodad%d",type);
- }
- else {
- buf= tbGetBuffer(12);
- if (type==XkbOutlineDoodad) strcpy(buf,"outline");
- else if (type==XkbSolidDoodad) strcpy(buf,"solid");
- else if (type==XkbTextDoodad) strcpy(buf,"text");
- else if (type==XkbIndicatorDoodad) strcpy(buf,"indicator");
- else if (type==XkbLogoDoodad) strcpy(buf,"logo");
- else sprintf(buf,"unknown%d",type);
- }
- return buf;
-}
-
-static char *actionTypeNames[XkbSA_NumActions]= {
- "NoAction",
- "SetMods", "LatchMods", "LockMods",
- "SetGroup", "LatchGroup", "LockGroup",
- "MovePtr",
- "PtrBtn", "LockPtrBtn",
- "SetPtrDflt",
- "ISOLock",
- "Terminate", "SwitchScreen",
- "SetControls", "LockControls",
- "ActionMessage",
- "RedirectKey",
- "DeviceBtn", "LockDeviceBtn"
-};
-
-char *
-XkbActionTypeText(unsigned type,unsigned format)
-{
-static char buf[32];
-char *rtrn;
-
- if (type<=XkbSA_LastAction) {
- rtrn= actionTypeNames[type];
- if (format==XkbCFile) {
- sprintf(buf,"XkbSA_%s",rtrn);
- return buf;
- }
- return rtrn;
- }
- sprintf(buf,"Private");
- return buf;
-}
-
-/***====================================================================***/
-
-static int
-TryCopyStr(char *to,char *from,int *pLeft)
-{
-register int len;
- if (*pLeft>0) {
- len= strlen(from);
- if (len<((*pLeft)-3)) {
- strcat(to,from);
- *pLeft-= len;
- return True;
- }
- }
- *pLeft= -1;
- return False;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyNoActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int*sz)
-{
- return True;
-}
-
-static Bool
-CopyModActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int* sz)
-{
-XkbModAction * act;
-unsigned tmp;
-
- act= &action->mods;
- tmp= XkbModActionVMods(act);
- TryCopyStr(buf,"modifiers=",sz);
- if (act->flags&XkbSA_UseModMapMods)
- TryCopyStr(buf,"modMapMods",sz);
- else if (act->real_mods || tmp) {
- TryCopyStr(buf,
- XkbVModMaskText(dpy,xkb,act->real_mods,tmp,XkbXKBFile),
- sz);
- }
- else TryCopyStr(buf,"none",sz);
- if (act->type==XkbSA_LockMods)
- return True;
- if (act->flags&XkbSA_ClearLocks)
- TryCopyStr(buf,",clearLocks",sz);
- if (act->flags&XkbSA_LatchToLock)
- TryCopyStr(buf,",latchToLock",sz);
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyGroupActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbGroupAction * act;
-char tbuf[32];
-
- act= &action->group;
- TryCopyStr(buf,"group=",sz);
- if (act->flags&XkbSA_GroupAbsolute)
- sprintf(tbuf,"%d",XkbSAGroup(act)+1);
- else if (XkbSAGroup(act)<0)
- sprintf(tbuf,"%d",XkbSAGroup(act));
- else sprintf(tbuf,"+%d",XkbSAGroup(act));
- TryCopyStr(buf,tbuf,sz);
- if (act->type==XkbSA_LockGroup)
- return True;
- if (act->flags&XkbSA_ClearLocks)
- TryCopyStr(buf,",clearLocks",sz);
- if (act->flags&XkbSA_LatchToLock)
- TryCopyStr(buf,",latchToLock",sz);
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyMovePtrArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
-{
-XkbPtrAction * act;
-int x,y;
-char tbuf[32];
-
- act= &action->ptr;
- x= XkbPtrActionX(act);
- y= XkbPtrActionY(act);
- if ((act->flags&XkbSA_MoveAbsoluteX)||(x<0))
- sprintf(tbuf,"x=%d",x);
- else sprintf(tbuf,"x=+%d",x);
- TryCopyStr(buf,tbuf,sz);
-
- if ((act->flags&XkbSA_MoveAbsoluteY)||(y<0))
- sprintf(tbuf,",y=%d",y);
- else sprintf(tbuf,",y=+%d",y);
- TryCopyStr(buf,tbuf,sz);
- if (act->flags&XkbSA_NoAcceleration)
- TryCopyStr(buf,",!accel",sz);
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyPtrBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
-{
-XkbPtrBtnAction * act;
-char tbuf[32];
-
- act= &action->btn;
- TryCopyStr(buf,"button=",sz);
- if ((act->button>0)&&(act->button<6)) {
- sprintf(tbuf,"%d",act->button);
- TryCopyStr(buf,tbuf,sz);
- }
- else TryCopyStr(buf,"default",sz);
- if (act->count>0) {
- sprintf(tbuf,",count=%d",act->count);
- TryCopyStr(buf,tbuf,sz);
- }
- if (action->type==XkbSA_LockPtrBtn) {
- switch (act->flags&(XkbSA_LockNoUnlock|XkbSA_LockNoLock)) {
- case XkbSA_LockNoLock:
- sprintf(tbuf,",affect=unlock"); break;
- case XkbSA_LockNoUnlock:
- sprintf(tbuf,",affect=lock"); break;
- case XkbSA_LockNoUnlock|XkbSA_LockNoLock:
- sprintf(tbuf,",affect=neither"); break;
- default:
- sprintf(tbuf,",affect=both"); break;
- }
- TryCopyStr(buf,tbuf,sz);
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopySetPtrDfltArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbPtrDfltAction * act;
-char tbuf[32];
-
- act= &action->dflt;
- if (act->affect==XkbSA_AffectDfltBtn) {
- TryCopyStr(buf,"affect=button,button=",sz);
- if ((act->flags&XkbSA_DfltBtnAbsolute)||(XkbSAPtrDfltValue(act)<0))
- sprintf(tbuf,"%d",XkbSAPtrDfltValue(act));
- else sprintf(tbuf,"+%d",XkbSAPtrDfltValue(act));
- TryCopyStr(buf,tbuf,sz);
- }
- return True;
-}
-
-static Bool
-CopyISOLockArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
-{
-XkbISOAction * act;
-char tbuf[64];
-
- act= &action->iso;
- if (act->flags&XkbSA_ISODfltIsGroup) {
- TryCopyStr(tbuf,"group=",sz);
- if (act->flags&XkbSA_GroupAbsolute)
- sprintf(tbuf,"%d",XkbSAGroup(act)+1);
- else if (XkbSAGroup(act)<0)
- sprintf(tbuf,"%d",XkbSAGroup(act));
- else sprintf(tbuf,"+%d",XkbSAGroup(act));
- TryCopyStr(buf,tbuf,sz);
- }
- else {
- unsigned tmp;
- tmp= XkbModActionVMods(act);
- TryCopyStr(buf,"modifiers=",sz);
- if (act->flags&XkbSA_UseModMapMods)
- TryCopyStr(buf,"modMapMods",sz);
- else if (act->real_mods || tmp) {
- if (act->real_mods) {
- TryCopyStr(buf,XkbModMaskText(act->real_mods,XkbXKBFile),sz);
- if (tmp)
- TryCopyStr(buf,"+",sz);
- }
- if (tmp)
- TryCopyStr(buf,XkbVModMaskText(dpy,xkb,0,tmp,XkbXKBFile),sz);
- }
- else TryCopyStr(buf,"none",sz);
- }
- TryCopyStr(buf,",affect=",sz);
- if ((act->affect&XkbSA_ISOAffectMask)==0)
- TryCopyStr(buf,"all",sz);
- else {
- int nOut= 0;
- if ((act->affect&XkbSA_ISONoAffectMods)==0) {
- TryCopyStr(buf,"mods",sz);
- nOut++;
- }
- if ((act->affect&XkbSA_ISONoAffectGroup)==0) {
- sprintf(tbuf,"%sgroups",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if ((act->affect&XkbSA_ISONoAffectPtr)==0) {
- sprintf(tbuf,"%spointer",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if ((act->affect&XkbSA_ISONoAffectCtrls)==0) {
- sprintf(tbuf,"%scontrols",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopySwitchScreenArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbSwitchScreenAction * act;
-char tbuf[32];
-
- act= &action->screen;
- if ((act->flags&XkbSA_SwitchAbsolute)||(XkbSAScreen(act)<0))
- sprintf(tbuf,"screen=%d",XkbSAScreen(act));
- else sprintf(tbuf,"screen=+%d",XkbSAScreen(act));
- TryCopyStr(buf,tbuf,sz);
- if (act->flags&XkbSA_SwitchApplication)
- TryCopyStr(buf,",!same",sz);
- else TryCopyStr(buf,",same",sz);
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopySetLockControlsArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,
- char *buf,int *sz)
-{
-XkbCtrlsAction * act;
-unsigned tmp;
-char tbuf[32];
-
- act= &action->ctrls;
- tmp= XkbActionCtrls(act);
- TryCopyStr(buf,"controls=",sz);
- if (tmp==0)
- TryCopyStr(buf,"none",sz);
- else if ((tmp&XkbAllBooleanCtrlsMask)==XkbAllBooleanCtrlsMask)
- TryCopyStr(buf,"all",sz);
- else {
- int nOut= 0;
- if (tmp&XkbRepeatKeysMask) {
- sprintf(tbuf,"%sRepeatKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbSlowKeysMask) {
- sprintf(tbuf,"%sSlowKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbBounceKeysMask) {
- sprintf(tbuf,"%sBounceKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbStickyKeysMask) {
- sprintf(tbuf,"%sStickyKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbMouseKeysMask) {
- sprintf(tbuf,"%sMouseKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbMouseKeysAccelMask) {
- sprintf(tbuf,"%sMouseKeysAccel",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbAccessXKeysMask) {
- sprintf(tbuf,"%sAccessXKeys",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbAccessXTimeoutMask) {
- sprintf(tbuf,"%sAccessXTimeout",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbAccessXFeedbackMask) {
- sprintf(tbuf,"%sAccessXFeedback",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbAudibleBellMask) {
- sprintf(tbuf,"%sAudibleBell",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbOverlay1Mask) {
- sprintf(tbuf,"%sOverlay1",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbOverlay2Mask) {
- sprintf(tbuf,"%sOverlay2",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- if (tmp&XkbIgnoreGroupLockMask) {
- sprintf(tbuf,"%sIgnoreGroupLock",(nOut>0?"+":""));
- TryCopyStr(buf,tbuf,sz);
- nOut++;
- }
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyActionMessageArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbMessageAction * act;
-unsigned all;
-char tbuf[32];
-
- act= &action->msg;
- all= XkbSA_MessageOnPress|XkbSA_MessageOnRelease;
- TryCopyStr(buf,"report=",sz);
- if ((act->flags&all)==0)
- TryCopyStr(buf,"none",sz);
- else if ((act->flags&all)==all)
- TryCopyStr(buf,"all",sz);
- else if (act->flags&XkbSA_MessageOnPress)
- TryCopyStr(buf,"KeyPress",sz);
- else TryCopyStr(buf,"KeyRelease",sz);
- sprintf(tbuf,",data[0]=0x%02x",act->message[0]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[1]=0x%02x",act->message[1]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[2]=0x%02x",act->message[2]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[3]=0x%02x",act->message[3]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[4]=0x%02x",act->message[4]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[5]=0x%02x",act->message[5]); TryCopyStr(buf,tbuf,sz);
- return True;
-}
-
-static Bool
-CopyRedirectKeyArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbRedirectKeyAction * act;
-char tbuf[32],*tmp;
-unsigned kc;
-unsigned vmods,vmods_mask;
-
- act= &action->redirect;
- kc= act->new_key;
- vmods= XkbSARedirectVMods(act);
- vmods_mask= XkbSARedirectVModsMask(act);
- if (xkb && xkb->names && xkb->names->keys && (kc<=xkb->max_key_code) &&
- (xkb->names->keys[kc].name[0]!='\0')) {
- char *kn;
- kn= XkbKeyNameText(xkb->names->keys[kc].name,XkbXKBFile);
- sprintf(tbuf,"key=%s",kn);
- }
- else sprintf(tbuf,"key=%d",kc);
- TryCopyStr(buf,tbuf,sz);
- if ((act->mods_mask==0)&&(vmods_mask==0))
- return True;
- if ((act->mods_mask==XkbAllModifiersMask)&&
- (vmods_mask==XkbAllVirtualModsMask)) {
- tmp= XkbVModMaskText(dpy,xkb,act->mods,vmods,XkbXKBFile);
- TryCopyStr(buf,",mods=",sz);
- TryCopyStr(buf,tmp,sz);
- }
- else {
- if ((act->mods_mask&act->mods)||(vmods_mask&vmods)) {
- tmp= XkbVModMaskText(dpy,xkb,act->mods_mask&act->mods,
- vmods_mask&vmods,XkbXKBFile);
- TryCopyStr(buf,",mods= ",sz);
- TryCopyStr(buf,tmp,sz);
- }
- if ((act->mods_mask&(~act->mods))||(vmods_mask&(~vmods))) {
- tmp= XkbVModMaskText(dpy,xkb,act->mods_mask&(~act->mods),
- vmods_mask&(~vmods),XkbXKBFile);
- TryCopyStr(buf,",clearMods= ",sz);
- TryCopyStr(buf,tmp,sz);
- }
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyDeviceBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
- int *sz)
-{
-XkbDeviceBtnAction * act;
-char tbuf[32];
-
- act= &action->devbtn;
- sprintf(tbuf,"device= %d",act->device); TryCopyStr(buf,tbuf,sz);
- TryCopyStr(buf,",button=",sz);
- sprintf(tbuf,"%d",act->button);
- TryCopyStr(buf,tbuf,sz);
- if (act->count>0) {
- sprintf(tbuf,",count=%d",act->count);
- TryCopyStr(buf,tbuf,sz);
- }
- if (action->type==XkbSA_LockDeviceBtn) {
- switch (act->flags&(XkbSA_LockNoUnlock|XkbSA_LockNoLock)) {
- case XkbSA_LockNoLock:
- sprintf(tbuf,",affect=unlock"); break;
- case XkbSA_LockNoUnlock:
- sprintf(tbuf,",affect=lock"); break;
- case XkbSA_LockNoUnlock|XkbSA_LockNoLock:
- sprintf(tbuf,",affect=neither"); break;
- default:
- sprintf(tbuf,",affect=both"); break;
- }
- TryCopyStr(buf,tbuf,sz);
- }
- return True;
-}
-
-/*ARGSUSED*/
-static Bool
-CopyOtherArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
-{
-XkbAnyAction * act;
-char tbuf[32];
-
- act= &action->any;
- sprintf(tbuf,"type=0x%02x",act->type); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[0]=0x%02x",act->data[0]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[1]=0x%02x",act->data[1]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[2]=0x%02x",act->data[2]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[3]=0x%02x",act->data[3]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[4]=0x%02x",act->data[4]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[5]=0x%02x",act->data[5]); TryCopyStr(buf,tbuf,sz);
- sprintf(tbuf,",data[6]=0x%02x",act->data[6]); TryCopyStr(buf,tbuf,sz);
- return True;
-}
-
-typedef Bool (*actionCopy)(
- Display * /* dpy */,
- XkbDescPtr /* xkb */,
- XkbAction * /* action */,
- char * /* buf */,
- int* /* sz */
-);
-static actionCopy copyActionArgs[XkbSA_NumActions] = {
- CopyNoActionArgs /* NoAction */,
- CopyModActionArgs /* SetMods */,
- CopyModActionArgs /* LatchMods */,
- CopyModActionArgs /* LockMods */,
- CopyGroupActionArgs /* SetGroup */,
- CopyGroupActionArgs /* LatchGroup */,
- CopyGroupActionArgs /* LockGroup */,
- CopyMovePtrArgs /* MovePtr */,
- CopyPtrBtnArgs /* PtrBtn */,
- CopyPtrBtnArgs /* LockPtrBtn */,
- CopySetPtrDfltArgs /* SetPtrDflt */,
- CopyISOLockArgs /* ISOLock */,
- CopyNoActionArgs /* Terminate */,
- CopySwitchScreenArgs /* SwitchScreen */,
- CopySetLockControlsArgs /* SetControls */,
- CopySetLockControlsArgs /* LockControls */,
- CopyActionMessageArgs /* ActionMessage*/,
- CopyRedirectKeyArgs /* RedirectKey */,
- CopyDeviceBtnArgs /* DeviceBtn */,
- CopyDeviceBtnArgs /* LockDeviceBtn*/
-};
-
-#define ACTION_SZ 256
-
-char *
-XkbActionText(Display *dpy,XkbDescPtr xkb,XkbAction *action,unsigned format)
-{
-char buf[ACTION_SZ],*tmp;
-int sz;
-
- if (format==XkbCFile) {
- sprintf(buf,
- "{ %20s, { 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x } }",
- XkbActionTypeText(action->type,XkbCFile),
- action->any.data[0],action->any.data[1],action->any.data[2],
- action->any.data[3],action->any.data[4],action->any.data[5],
- action->any.data[6]);
- }
- else {
- sprintf(buf,"%s(",XkbActionTypeText(action->type,XkbXKBFile));
- sz= ACTION_SZ-strlen(buf)+2; /* room for close paren and NULL */
- if (action->type<(unsigned)XkbSA_NumActions)
- (*copyActionArgs[action->type])(dpy,xkb,action,buf,&sz);
- else CopyOtherArgs(dpy,xkb,action,buf,&sz);
- TryCopyStr(buf,")",&sz);
- }
- tmp= tbGetBuffer(strlen(buf)+1);
- if (tmp!=NULL)
- strcpy(tmp,buf);
- return tmp;
-}
-
-char *
-XkbBehaviorText(XkbDescPtr xkb,XkbBehavior *behavior,unsigned format)
-{
-char buf[256],*tmp;
-
- if (format==XkbCFile) {
- if (behavior->type==XkbKB_Default)
- sprintf(buf,"{ 0, 0 }");
- else sprintf(buf,"{ %3d, 0x%02x }",behavior->type,behavior->data);
- }
- else {
- unsigned type,permanent;
- type= behavior->type&XkbKB_OpMask;
- permanent=((behavior->type&XkbKB_Permanent)!=0);
-
- if (type==XkbKB_Lock) {
- sprintf(buf,"lock= %s",(permanent?"Permanent":"True"));
- }
- else if (type==XkbKB_RadioGroup) {
- int g;
- char *tmp;
- g= ((behavior->data)&(~XkbKB_RGAllowNone))+1;
- if (XkbKB_RGAllowNone&behavior->data) {
- sprintf(buf,"allowNone,");
- tmp= &buf[strlen(buf)];
- }
- else tmp= buf;
- if (permanent)
- sprintf(tmp,"permanentRadioGroup= %d",g);
- else sprintf(tmp,"radioGroup= %d",g);
- }
- else if ((type==XkbKB_Overlay1)||(type==XkbKB_Overlay2)) {
- int ndx,kc;
- char *kn;
-
- ndx= ((type==XkbKB_Overlay1)?1:2);
- kc= behavior->data;
- if ((xkb)&&(xkb->names)&&(xkb->names->keys))
- kn= XkbKeyNameText(xkb->names->keys[kc].name,XkbXKBFile);
- else {
- static char tbuf[8];
- sprintf(tbuf,"%d",kc);
- kn= tbuf;
- }
- if (permanent)
- sprintf(buf,"permanentOverlay%d= %s",ndx,kn);
- else sprintf(buf,"overlay%d= %s",ndx,kn);
- }
- }
- tmp= tbGetBuffer(strlen(buf)+1);
- if (tmp!=NULL)
- strcpy(tmp,buf);
- return tmp;
-}
-
-/***====================================================================***/
-
-char *
-XkbIndentText(unsigned size)
-{
-static char buf[32];
-register int i;
-
- if (size>31)
- size= 31;
-
- for (i=0;i<size;i++) {
- buf[i]= ' ';
- }
- buf[size]= '\0';
- return buf;
-}
-
-#ifndef XKB_IN_SERVER
-
-/***====================================================================***/
-
-#define PIXEL_MAX 65535
-
-Bool
-XkbLookupCanonicalRGBColor(char *def,XColor *color)
-{
-int tmp;
-
- if (_XkbStrCaseEqual(def,"black")) {
- color->red= color->green= color->blue= 0;
- return True;
- }
- else if (_XkbStrCaseEqual(def,"white")) {
- color->red= color->green= color->blue= PIXEL_MAX;
- return True;
- }
- else if ((sscanf(def,"grey%d",&tmp)==1)||
- (sscanf(def,"gray%d",&tmp)==1)||
- (sscanf(def,"Grey%d",&tmp)==1)||
- (sscanf(def,"Gray%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->red= color->green= color->blue= tmp;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"red")*100))||
- (sscanf(def,"red%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->red= tmp;
- color->green= color->blue= 0;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"green")*100))||
- (sscanf(def,"green%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->green= tmp;
- color->red= color->blue= 0;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"blue")*100))||
- (sscanf(def,"blue%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->blue= tmp;
- color->red= color->green= 0;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"magenta")*100))||
- (sscanf(def,"magenta%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->green= 0;
- color->red= color->blue= tmp;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"cyan")*100))||
- (sscanf(def,"cyan%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->red= 0;
- color->green= color->blue= tmp;
- return True;
- }
- }
- else if ((tmp=(_XkbStrCaseEqual(def,"yellow")*100))||
- (sscanf(def,"yellow%d",&tmp)==1)) {
- if ((tmp>0)&&(tmp<=100)) {
- tmp= (PIXEL_MAX*tmp)/100;
- color->blue= 0;
- color->red= color->green= tmp;
- return True;
- }
- }
- return False;
-}
-
-#endif
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
deleted file mode 100644
index b7a08e267..000000000
--- a/xkb/xkmread.c
+++ /dev/null
@@ -1,1309 +0,0 @@
-/* $Xorg: xkmread.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */
-/************************************************************
- Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
-/* $XFree86: xc/lib/xkbfile/xkmread.c,v 1.7 2003/11/17 22:20:24 dawes Exp $ */
-
-#include <stdio.h>
-
-#include <X11/Xos.h>
-#include <X11/Xfuncs.h>
-
-#ifndef XKB_IN_SERVER
-
-#include <stdlib.h>
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
-
-#include <X11/XKBlib.h>
-
-#include <X11/extensions/XKBgeom.h>
-#include "XKMformat.h"
-#include "XKBfileInt.h"
-
-#else
-
-#include "X.h"
-#define NEED_EVENTS
-#include "Xproto.h"
-#include <X11/keysym.h>
-#include "misc.h"
-#include "inputstr.h"
-#include "XKBstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include "XKBsrv.h"
-#include "XKBgeom.h"
-
-Atom
-XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
-{
- if (str==NULL)
- return None;
- return MakeAtom(str,strlen(str),!only_if_exists);
-}
-
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-char *
-_XkbDupString(char *str)
-{
-char *new;
-
- if (str==NULL)
- return NULL;
- new= (char *)_XkbCalloc(strlen(str)+1,sizeof(char));
- if (new)
- strcpy(new,str);
- return new;
-}
-
-/***====================================================================***/
-
-static XPointer
-XkmInsureSize(XPointer oldPtr,int oldCount,int *newCountRtrn,int elemSize)
-{
-int newCount= *newCountRtrn;
-
- if (oldPtr==NULL) {
- if (newCount==0)
- return NULL;
- oldPtr= (XPointer)_XkbCalloc(newCount,elemSize);
- }
- else if (oldCount<newCount) {
- oldPtr= (XPointer)_XkbRealloc(oldPtr,newCount*elemSize);
- if (oldPtr!=NULL) {
- char *tmp= (char *)oldPtr;
- bzero(&tmp[oldCount*elemSize],(newCount-oldCount)*elemSize);
- }
- }
- else if (newCount<oldCount) {
- *newCountRtrn= oldCount;
- }
- return oldPtr;
-}
-
-#define XkmInsureTypedSize(p,o,n,t) ((p)=((t *)XkmInsureSize((char *)(p),(o),(n),sizeof(t))))
-
-static CARD8
-XkmGetCARD8(FILE *file,int *pNRead)
-{
-int tmp;
- tmp= getc(file);
- if (pNRead&&(tmp!=EOF))
- (*pNRead)+= 1;
- return tmp;
-}
-
-static CARD16
-XkmGetCARD16(FILE *file,int *pNRead)
-{
-CARD16 val;
-
- if ((fread(&val,2,1,file)==1)&&(pNRead))
- (*pNRead)+= 2;
- return val;
-}
-
-static CARD32
-XkmGetCARD32(FILE *file,int *pNRead)
-{
-CARD32 val;
-
- if ((fread(&val,4,1,file)==1)&&(pNRead))
- (*pNRead)+= 4;
- return val;
-}
-
-static int
-XkmSkipPadding(FILE *file,unsigned pad)
-{
-register int i,nRead=0;
-
- for (i=0;i<pad;i++) {
- if (getc(file)!=EOF)
- nRead++;
- }
- return nRead;
-}
-
-static int
-XkmGetCountedString(FILE *file,char *str,int max_len)
-{
-int count,nRead=0;
-
- count= XkmGetCARD16(file,&nRead);
- if (count>0) {
- int tmp;
- if (count>max_len) {
- tmp= fread(str,1,max_len,file);
- while (tmp<count) {
- if ((getc(file))!=EOF)
- tmp++;
- else break;
- }
- }
- else {
- tmp= fread(str,1,count,file);
- }
- nRead+= tmp;
- }
- if (count>=max_len) str[max_len-1]= '\0';
- else str[count]= '\0';
- count= XkbPaddedSize(nRead)-nRead;
- if (count>0)
- nRead+= XkmSkipPadding(file,count);
- return nRead;
-}
-
-/***====================================================================***/
-
-static int
-ReadXkmVirtualMods(FILE *file,XkbFileInfo *result,XkbChangesPtr changes)
-{
-register unsigned int i,bit;
-unsigned int bound,named,tmp;
-int nRead=0;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- if (XkbAllocServerMap(xkb,XkbVirtualModsMask,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmVirtualMods",0);
- return -1;
- }
- bound= XkmGetCARD16(file,&nRead);
- named= XkmGetCARD16(file,&nRead);
- for (i=tmp=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (bound&bit) {
- xkb->server->vmods[i]= XkmGetCARD8(file,&nRead);
- if (changes)
- changes->map.vmods|= bit;
- tmp++;
- }
- }
- if ((i= XkbPaddedSize(tmp)-tmp)>0)
- nRead+= XkmSkipPadding(file,i);
- if (XkbAllocNames(xkb,XkbVirtualModNamesMask,0,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmVirtualMods",0);
- return -1;
- }
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- char name[100];
- if (named&bit) {
- if (nRead+=XkmGetCountedString(file,name,100)) {
- xkb->names->vmods[i]= XkbInternAtom(xkb->dpy,name,False);
- if (changes)
- changes->names.changed_vmods|= bit;
- }
- }
- }
- return nRead;
-}
-
-/***====================================================================***/
-
-static int
-ReadXkmKeycodes(FILE *file,XkbFileInfo *result,XkbChangesPtr changes)
-{
-register int i;
-unsigned minKC,maxKC,nAl;
-int nRead=0;
-char name[100];
-XkbKeyNamePtr pN;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- name[0]= '\0';
- nRead+= XkmGetCountedString(file,name,100);
- minKC= XkmGetCARD8(file,&nRead);
- maxKC= XkmGetCARD8(file,&nRead);
- if (xkb->min_key_code==0) {
- xkb->min_key_code= minKC;
- xkb->max_key_code= maxKC;
- }
- else {
- if (minKC<xkb->min_key_code)
- xkb->min_key_code= minKC;
- if (maxKC>xkb->max_key_code) {
- _XkbLibError(_XkbErrBadValue,"ReadXkmKeycodes",maxKC);
- return -1;
- }
- }
- nAl= XkmGetCARD8(file,&nRead);
- nRead+= XkmSkipPadding(file,1);
-
-#define WANTED (XkbKeycodesNameMask|XkbKeyNamesMask|XkbKeyAliasesMask)
- if (XkbAllocNames(xkb,WANTED,0,nAl)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmKeycodes",0);
- return -1;
- }
- if (name[0]!='\0') {
- xkb->names->keycodes= XkbInternAtom(xkb->dpy,name,False);
- }
-
- for (pN=&xkb->names->keys[minKC],i=minKC;i<=(int)maxKC;i++,pN++) {
- if (fread(pN,1,XkbKeyNameLength,file)!=XkbKeyNameLength) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeycodes",0);
- return -1;
- }
- nRead+= XkbKeyNameLength;
- }
- if (nAl>0) {
- XkbKeyAliasPtr pAl;
- for (pAl= xkb->names->key_aliases,i=0;i<nAl;i++,pAl++) {
- int tmp;
- tmp= fread(pAl,1,2*XkbKeyNameLength,file);
- if (tmp!=2*XkbKeyNameLength) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeycodes",0);
- return -1;
- }
- nRead+= 2*XkbKeyNameLength;
- }
- if (changes)
- changes->names.changed|= XkbKeyAliasesMask;
- }
- if (changes)
- changes->names.changed|= XkbKeyNamesMask;
- return nRead;
-}
-
-/***====================================================================***/
-
-static int
-ReadXkmKeyTypes(FILE *file,XkbFileInfo *result,XkbChangesPtr changes)
-{
-register unsigned i,n;
-unsigned num_types;
-int nRead=0;
-int tmp;
-XkbKeyTypePtr type;
-xkmKeyTypeDesc wire;
-XkbKTMapEntryPtr entry;
-xkmKTMapEntryDesc wire_entry;
-char buf[100];
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- if ((tmp= XkmGetCountedString(file,buf,100))<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeyTypes",0);
- return -1;
- }
- nRead+= tmp;
- if (buf[0]!='\0') {
- if (XkbAllocNames(xkb,XkbTypesNameMask,0,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0);
- return -1;
- }
- xkb->names->types= XkbInternAtom(xkb->dpy,buf,False);
- }
- num_types= XkmGetCARD16(file,&nRead);
- nRead+= XkmSkipPadding(file,2);
- if (num_types<1)
- return nRead;
- if (XkbAllocClientMap(xkb,XkbKeyTypesMask,num_types)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0);
- return nRead;
- }
- xkb->map->num_types= num_types;
- if (num_types<XkbNumRequiredTypes) {
- _XkbLibError(_XkbErrMissingReqTypes,"ReadXkmKeyTypes",0);
- return -1;
- }
- type= xkb->map->types;
- for (i=0;i<num_types;i++,type++) {
- if ((int)fread(&wire,SIZEOF(xkmKeyTypeDesc),1,file)<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeyTypes",0);
- return -1;
- }
- nRead+= SIZEOF(xkmKeyTypeDesc);
- if (((i==XkbOneLevelIndex)&&(wire.numLevels!=1))||
- (((i==XkbTwoLevelIndex)||(i==XkbAlphabeticIndex)||
- ((i)==XkbKeypadIndex))&&(wire.numLevels!=2))) {
- _XkbLibError(_XkbErrBadTypeWidth,"ReadXkmKeyTypes",i);
- return -1;
- }
- tmp= wire.nMapEntries;
- XkmInsureTypedSize(type->map,type->map_count,&tmp,XkbKTMapEntryRec);
- if ((wire.nMapEntries>0)&&(type->map==NULL)) {
- _XkbLibError(_XkbErrBadValue,"ReadXkmKeyTypes",wire.nMapEntries);
- return -1;
- }
- for (n=0,entry= type->map;n<wire.nMapEntries;n++,entry++) {
- if (fread(&wire_entry,SIZEOF(xkmKTMapEntryDesc),1,file)<(int)1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeyTypes",0);
- return -1;
- }
- nRead+= SIZEOF(xkmKTMapEntryDesc);
- entry->active= (wire_entry.virtualMods==0);
- entry->level= wire_entry.level;
- entry->mods.mask= wire_entry.realMods;
- entry->mods.real_mods= wire_entry.realMods;
- entry->mods.vmods= wire_entry.virtualMods;
- }
- nRead+= XkmGetCountedString(file,buf,100);
- if (((i==XkbOneLevelIndex)&&(strcmp(buf,"ONE_LEVEL")!=0))||
- ((i==XkbTwoLevelIndex)&&(strcmp(buf,"TWO_LEVEL")!=0))||
- ((i==XkbAlphabeticIndex)&&(strcmp(buf,"ALPHABETIC")!=0))||
- ((i==XkbKeypadIndex)&&(strcmp(buf,"KEYPAD")!=0))) {
- _XkbLibError(_XkbErrBadTypeName,"ReadXkmKeyTypes",0);
- return -1;
- }
- if (buf[0]!='\0') {
- type->name= XkbInternAtom(xkb->dpy,buf,False);
- }
- else type->name= None;
-
- if (wire.preserve) {
- xkmModsDesc p_entry;
- XkbModsPtr pre;
- XkmInsureTypedSize(type->preserve,type->map_count,&tmp,
- XkbModsRec);
- if (type->preserve==NULL) {
- _XkbLibError(_XkbErrBadMatch,"ReadXkmKeycodes",0);
- return -1;
- }
- for (n=0,pre=type->preserve;n<wire.nMapEntries;n++,pre++) {
- if (fread(&p_entry,SIZEOF(xkmModsDesc),1,file)<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmKeycodes",0);
- return -1;
- }
- nRead+= SIZEOF(xkmModsDesc);
- pre->mask= p_entry.realMods;
- pre->real_mods= p_entry.realMods;
- pre->vmods= p_entry.virtualMods;
- }
- }
- if (wire.nLevelNames>0) {
- int width= wire.numLevels;
- if (wire.nLevelNames>(unsigned)width) {
- _XkbLibError(_XkbErrBadMatch,"ReadXkmKeycodes",0);
- return -1;
- }
- XkmInsureTypedSize(type->level_names,type->num_levels,&width,Atom);
- if (type->level_names!=NULL) {
- for (n=0;n<wire.nLevelNames;n++) {
- if ((tmp=XkmGetCountedString(file,buf,100))<1)
- return -1;
- nRead+= tmp;
- if (strlen(buf)==0)
- type->level_names[n]= None;
- else type->level_names[n]= XkbInternAtom(xkb->dpy,buf,0);
- }
- }
- }
- type->mods.mask= wire.realMods;
- type->mods.real_mods= wire.realMods;
- type->mods.vmods= wire.virtualMods;
- type->num_levels= wire.numLevels;
- type->map_count= wire.nMapEntries;
- }
- if (changes) {
- changes->map.changed|= XkbKeyTypesMask;
- changes->map.first_type= 0;
- changes->map.num_types= xkb->map->num_types;
- }
- return nRead;
-}
-
-/***====================================================================***/
-
-static int
-ReadXkmCompatMap(FILE *file,XkbFileInfo *result,XkbChangesPtr changes)
-{
-register int i;
-unsigned num_si,groups;
-char name[100];
-XkbSymInterpretPtr interp;
-xkmSymInterpretDesc wire;
-unsigned tmp;
-int nRead=0;
-XkbDescPtr xkb;
-XkbCompatMapPtr compat;
-
- xkb= result->xkb;
- if ((tmp= XkmGetCountedString(file,name,100))<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmCompatMap",0);
- return -1;
- }
- nRead+= tmp;
- if (name[0]!='\0') {
- if (XkbAllocNames(xkb,XkbCompatNameMask,0,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmCompatMap",0);
- return -1;
- }
- xkb->names->compat= XkbInternAtom(xkb->dpy,name,False);
- }
- num_si= XkmGetCARD16(file,&nRead);
- groups= XkmGetCARD8(file,&nRead);
- nRead+= XkmSkipPadding(file,1);
- if (XkbAllocCompatMap(xkb,XkbAllCompatMask,num_si)!=Success)
- return -1;
- compat= xkb->compat;
- compat->num_si= num_si;
- interp= compat->sym_interpret;
- for (i=0;i<num_si;i++,interp++) {
- tmp= fread(&wire,SIZEOF(xkmSymInterpretDesc),1,file);
- nRead+= tmp*SIZEOF(xkmSymInterpretDesc);
- interp->sym= wire.sym;
- interp->mods= wire.mods;
- interp->match= wire.match;
- interp->virtual_mod= wire.virtualMod;
- interp->flags= wire.flags;
- interp->act.type= wire.actionType;
- interp->act.data[0]= wire.actionData[0];
- interp->act.data[1]= wire.actionData[1];
- interp->act.data[2]= wire.actionData[2];
- interp->act.data[3]= wire.actionData[3];
- interp->act.data[4]= wire.actionData[4];
- interp->act.data[5]= wire.actionData[5];
- interp->act.data[6]= wire.actionData[6];
- }
- if ((num_si>0)&&(changes)) {
- changes->compat.first_si= 0;
- changes->compat.num_si= num_si;
- }
- if (groups) {
- register unsigned bit;
- for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
- xkmModsDesc md;
- if (groups&bit) {
- tmp= fread(&md,SIZEOF(xkmModsDesc),1,file);
- nRead+= tmp*SIZEOF(xkmModsDesc);
- xkb->compat->groups[i].real_mods= md.realMods;
- xkb->compat->groups[i].vmods= md.virtualMods;
- if (md.virtualMods != 0) {
- unsigned mask;
- if (XkbVirtualModsToReal(xkb,md.virtualMods,&mask))
- xkb->compat->groups[i].mask= md.realMods|mask;
- }
- else xkb->compat->groups[i].mask= md.realMods;
- }
- }
- if (changes)
- changes->compat.changed_groups|= groups;
- }
- return nRead;
-}
-
-static int
-ReadXkmIndicators(FILE *file,XkbFileInfo *result,XkbChangesPtr changes)
-{
-register unsigned nLEDs;
-xkmIndicatorMapDesc wire;
-char buf[100];
-unsigned tmp;
-int nRead=0;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- if ((xkb->indicators==NULL)&&(XkbAllocIndicatorMaps(xkb)!=Success)) {
- _XkbLibError(_XkbErrBadAlloc,"indicator rec",0);
- return -1;
- }
- if (XkbAllocNames(xkb,XkbIndicatorNamesMask,0,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"indicator names",0);
- return -1;
- }
- nLEDs= XkmGetCARD8(file,&nRead);
- nRead+= XkmSkipPadding(file,3);
- xkb->indicators->phys_indicators= XkmGetCARD32(file,&nRead);
- while (nLEDs-->0) {
- Atom name;
- XkbIndicatorMapPtr map;
-
- if ((tmp=XkmGetCountedString(file,buf,100))<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0);
- return -1;
- }
- nRead+= tmp;
- if (buf[0]!='\0')
- name= XkbInternAtom(xkb->dpy,buf,False);
- else name= None;
- if ((tmp=fread(&wire,SIZEOF(xkmIndicatorMapDesc),1,file))<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0);
- return -1;
- }
- nRead+= tmp*SIZEOF(xkmIndicatorMapDesc);
- if (xkb->names) {
- xkb->names->indicators[wire.indicator-1]= name;
- if (changes)
- changes->names.changed_indicators|= (1<<(wire.indicator-1));
- }
- map= &xkb->indicators->maps[wire.indicator-1];
- map->flags= wire.flags;
- map->which_groups= wire.which_groups;
- map->groups= wire.groups;
- map->which_mods= wire.which_mods;
- map->mods.mask= wire.real_mods;
- map->mods.real_mods= wire.real_mods;
- map->mods.vmods= wire.vmods;
- map->ctrls= wire.ctrls;
- }
- return nRead;
-}
-
-static XkbKeyTypePtr
-FindTypeForKey(XkbDescPtr xkb,Atom name,unsigned width,KeySym *syms)
-{
- if ((!xkb)||(!xkb->map))
- return NULL;
- if (name!=None) {
- register unsigned i;
- for (i=0;i<xkb->map->num_types;i++) {
- if (xkb->map->types[i].name==name) {
-#ifdef DEBUG
- if (xkb->map->types[i].num_levels!=width)
- fprintf(stderr,"Group width mismatch between key and type\n");
-#endif
- return &xkb->map->types[i];
- }
- }
- }
- if ((width<2)||((syms!=NULL)&&(syms[1]==NoSymbol)))
- return &xkb->map->types[XkbOneLevelIndex];
- if (syms!=NULL) {
- if (XkbKSIsLower(syms[0])&&XkbKSIsUpper(syms[1]))
- return &xkb->map->types[XkbAlphabeticIndex];
- else if (XkbKSIsKeypad(syms[0])||XkbKSIsKeypad(syms[1]))
- return &xkb->map->types[XkbKeypadIndex];
- }
- return &xkb->map->types[XkbTwoLevelIndex];
-}
-
-static int
-ReadXkmSymbols(FILE *file,XkbFileInfo *result)
-{
-register int i,g,s,totalVModMaps;
-xkmKeySymMapDesc wireMap;
-char buf[100];
-unsigned minKC,maxKC,groupNames,tmp;
-int nRead=0;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- if ((tmp=XkmGetCountedString(file,buf,100))<1)
- return -1;
- nRead+= tmp;
- minKC= XkmGetCARD8(file,&nRead);
- maxKC= XkmGetCARD8(file,&nRead);
- groupNames= XkmGetCARD8(file,&nRead);
- totalVModMaps= XkmGetCARD8(file,&nRead);
- if (XkbAllocNames(xkb,
- XkbSymbolsNameMask|XkbPhysSymbolsNameMask|XkbGroupNamesMask,
- 0,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"physical names",0);
- return -1;
- }
- if ((buf[0]!='\0')&&(xkb->names)) {
- Atom name;
- name= XkbInternAtom(xkb->dpy,buf,0);
- xkb->names->symbols= name;
- xkb->names->phys_symbols= name;
- }
- for (i=0,g=1;i<XkbNumKbdGroups;i++,g<<=1) {
- if (groupNames&g) {
- if ((tmp=XkmGetCountedString(file,buf,100))<1)
- return -1;
- nRead+= tmp;
- if ((buf[0]!='\0')&&(xkb->names)) {
- Atom name;
- name= XkbInternAtom(xkb->dpy,buf,0);
- xkb->names->groups[i]= name;
- }
- else xkb->names->groups[i]= None;
- }
- }
- if (XkbAllocServerMap(xkb,XkbAllServerInfoMask,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"server map",0);
- return -1;
- }
- if (XkbAllocClientMap(xkb,XkbAllClientInfoMask,0)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"client map",0);
- return -1;
- }
- if (XkbAllocControls(xkb,XkbAllControlsMask)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"controls",0);
- return -1;
- }
- if ((xkb->map==NULL)||(xkb->server==NULL))
- return -1;
- if (xkb->min_key_code<8) xkb->min_key_code= minKC;
- if (xkb->max_key_code<8) xkb->max_key_code= maxKC;
- if ((minKC>=8)&&(minKC<xkb->min_key_code))
- xkb->min_key_code= minKC;
- if ((maxKC>=8)&&(maxKC>xkb->max_key_code)) {
- _XkbLibError(_XkbErrBadValue,"keys in symbol map",maxKC);
- return -1;
- }
- for (i=minKC;i<=(int)maxKC;i++) {
- Atom typeName[XkbNumKbdGroups];
- XkbKeyTypePtr type[XkbNumKbdGroups];
- if ((tmp=fread(&wireMap,SIZEOF(xkmKeySymMapDesc),1,file))<1) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmSymbols",0);
- return -1;
- }
- nRead+= tmp*SIZEOF(xkmKeySymMapDesc);
- bzero((char *)typeName,XkbNumKbdGroups*sizeof(Atom));
- bzero((char *)type,XkbNumKbdGroups*sizeof(XkbKeyTypePtr));
- if (wireMap.flags&XkmKeyHasTypes) {
- register int g;
- for (g=0;g<XkbNumKbdGroups;g++) {
- if ((wireMap.flags&(1<<g))&&
- ((tmp=XkmGetCountedString(file,buf,100))>0)) {
- typeName[g]= XkbInternAtom(xkb->dpy,buf,1);
- nRead+= tmp;
- }
- type[g]=FindTypeForKey(xkb,typeName[g],wireMap.width,NULL);
- if (type[g]==NULL) {
- _XkbLibError(_XkbErrMissingTypes,"ReadXkmSymbols",0);
- return -1;
- }
- if (typeName[g]==type[g]->name)
- xkb->server->explicit[i]|= (1<<g);
- }
- }
- if (wireMap.flags&XkmRepeatingKey) {
- xkb->ctrls->per_key_repeat[i/8]|= (1<<(i%8));
- xkb->server->explicit[i]|= XkbExplicitAutoRepeatMask;
- }
- else if (wireMap.flags&XkmNonRepeatingKey) {
- xkb->ctrls->per_key_repeat[i/8]&= ~(1<<(i%8));
- xkb->server->explicit[i]|= XkbExplicitAutoRepeatMask;
- }
- xkb->map->modmap[i]= wireMap.modifier_map;
- if (XkbNumGroups(wireMap.num_groups)>0) {
- KeySym *sym;
- int nSyms;
-
- if (XkbNumGroups(wireMap.num_groups)>xkb->ctrls->num_groups)
- xkb->ctrls->num_groups= wireMap.num_groups;
- nSyms= XkbNumGroups(wireMap.num_groups)*wireMap.width;
- sym= XkbResizeKeySyms(xkb,i,nSyms);
- if (!sym)
- return -1;
- for (s=0;s<nSyms;s++) {
- *sym++= XkmGetCARD32(file,&nRead);
- }
- if (wireMap.flags&XkmKeyHasActions) {
- XkbAction * act;
- act= XkbResizeKeyActions(xkb,i,nSyms);
- for (s=0;s<nSyms;s++,act++) {
- tmp=fread(act,SIZEOF(xkmActionDesc),1,file);
- nRead+= tmp*SIZEOF(xkmActionDesc);
- }
- xkb->server->explicit[i]|= XkbExplicitInterpretMask;
- }
- }
- for (g=0;g<XkbNumGroups(wireMap.num_groups);g++) {
- if (((xkb->server->explicit[i]&(1<<g))==0)||(type[g]==NULL)) {
- KeySym *tmpSyms;
- tmpSyms= XkbKeySymsPtr(xkb,i)+(wireMap.width*g);
- type[g]= FindTypeForKey(xkb,None,wireMap.width,tmpSyms);
- }
- xkb->map->key_sym_map[i].kt_index[g]= type[g]-(&xkb->map->types[0]);
- }
- xkb->map->key_sym_map[i].group_info= wireMap.num_groups;
- xkb->map->key_sym_map[i].width= wireMap.width;
- if (wireMap.flags&XkmKeyHasBehavior) {
- xkmBehaviorDesc b;
- tmp= fread(&b,SIZEOF(xkmBehaviorDesc),1,file);
- nRead+= tmp*SIZEOF(xkmBehaviorDesc);
- xkb->server->behaviors[i].type= b.type;
- xkb->server->behaviors[i].data= b.data;
- xkb->server->explicit[i]|= XkbExplicitBehaviorMask;
- }
- }
- if (totalVModMaps>0) {
- xkmVModMapDesc v;
- for (i=0;i<totalVModMaps;i++) {
- tmp= fread(&v,SIZEOF(xkmVModMapDesc),1,file);
- nRead+= tmp*SIZEOF(xkmVModMapDesc);
- if (tmp>0)
- xkb->server->vmodmap[v.key]= v.vmods;
- }
- }
- return nRead;
-}
-
-static int
-ReadXkmGeomDoodad(
- FILE * file,
- Display * dpy,
- XkbGeometryPtr geom,
- XkbSectionPtr section)
-{
-XkbDoodadPtr doodad;
-xkmDoodadDesc doodadWire;
-char buf[100];
-unsigned tmp;
-int nRead=0;
-
- nRead+= XkmGetCountedString(file,buf,100);
- tmp= fread(&doodadWire,SIZEOF(xkmDoodadDesc),1,file);
- nRead+= SIZEOF(xkmDoodadDesc)*tmp;
- doodad= XkbAddGeomDoodad(geom,section,XkbInternAtom(dpy,buf,False));
- if (!doodad)
- return nRead;
- doodad->any.type= doodadWire.any.type;
- doodad->any.priority= doodadWire.any.priority;
- doodad->any.top= doodadWire.any.top;
- doodad->any.left= doodadWire.any.left;
- switch (doodadWire.any.type) {
- case XkbOutlineDoodad:
- case XkbSolidDoodad:
- doodad->shape.angle= doodadWire.shape.angle;
- doodad->shape.color_ndx= doodadWire.shape.color_ndx;
- doodad->shape.shape_ndx= doodadWire.shape.shape_ndx;
- break;
- case XkbTextDoodad:
- doodad->text.angle= doodadWire.text.angle;
- doodad->text.width= doodadWire.text.width;
- doodad->text.height= doodadWire.text.height;
- doodad->text.color_ndx= doodadWire.text.color_ndx;
- nRead+= XkmGetCountedString(file,buf,100);
- doodad->text.text= _XkbDupString(buf);
- nRead+= XkmGetCountedString(file,buf,100);
- doodad->text.font= _XkbDupString(buf);
- break;
- case XkbIndicatorDoodad:
- doodad->indicator.shape_ndx= doodadWire.indicator.shape_ndx;
- doodad->indicator.on_color_ndx= doodadWire.indicator.on_color_ndx;
- doodad->indicator.off_color_ndx= doodadWire.indicator.off_color_ndx;
- break;
- case XkbLogoDoodad:
- doodad->logo.angle= doodadWire.logo.angle;
- doodad->logo.color_ndx= doodadWire.logo.color_ndx;
- doodad->logo.shape_ndx= doodadWire.logo.shape_ndx;
- nRead+= XkmGetCountedString(file,buf,100);
- doodad->logo.logo_name= _XkbDupString(buf);
- break;
- default:
- /* report error? */
- return nRead;
- }
- return nRead;
-}
-
-static int
-ReadXkmGeomOverlay( FILE * file,
- Display * dpy,
- XkbGeometryPtr geom,
- XkbSectionPtr section)
-{
-char buf[100];
-unsigned tmp;
-int nRead=0;
-XkbOverlayPtr ol;
-XkbOverlayRowPtr row;
-xkmOverlayDesc olWire;
-xkmOverlayRowDesc rowWire;
-register int r;
-
- nRead+= XkmGetCountedString(file,buf,100);
- tmp= fread(&olWire,SIZEOF(xkmOverlayDesc),1,file);
- nRead+= tmp*SIZEOF(xkmOverlayDesc);
- ol= XkbAddGeomOverlay(section,XkbInternAtom(dpy,buf,False),
- olWire.num_rows);
- if (!ol)
- return nRead;
- for (r=0;r<olWire.num_rows;r++) {
- int k;
- xkmOverlayKeyDesc keyWire;
- tmp= fread(&rowWire,SIZEOF(xkmOverlayRowDesc),1,file);
- nRead+= tmp*SIZEOF(xkmOverlayRowDesc);
- row= XkbAddGeomOverlayRow(ol,rowWire.row_under,rowWire.num_keys);
- if (!row) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeomOverlay",0);
- return nRead;
- }
- for (k=0;k<rowWire.num_keys;k++) {
- tmp= fread(&keyWire,SIZEOF(xkmOverlayKeyDesc),1,file);
- nRead+= tmp*SIZEOF(xkmOverlayKeyDesc);
- memcpy(row->keys[k].over.name,keyWire.over,XkbKeyNameLength);
- memcpy(row->keys[k].under.name,keyWire.under,XkbKeyNameLength);
- }
- row->num_keys= rowWire.num_keys;
- }
- return nRead;
-}
-
-static int
-ReadXkmGeomSection( FILE * file,
- Display * dpy,
- XkbGeometryPtr geom)
-{
-register int i;
-XkbSectionPtr section;
-xkmSectionDesc sectionWire;
-unsigned tmp;
-int nRead= 0;
-char buf[100];
-Atom nameAtom;
-
- nRead+= XkmGetCountedString(file,buf,100);
- nameAtom= XkbInternAtom(dpy,buf,False);
- tmp= fread(&sectionWire,SIZEOF(xkmSectionDesc),1,file);
- nRead+= SIZEOF(xkmSectionDesc)*tmp;
- section= XkbAddGeomSection(geom,nameAtom,sectionWire.num_rows,
- sectionWire.num_doodads,
- sectionWire.num_overlays);
- if (!section) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeomSection",0);
- return nRead;
- }
- section->top= sectionWire.top;
- section->left= sectionWire.left;
- section->width= sectionWire.width;
- section->height= sectionWire.height;
- section->angle= sectionWire.angle;
- section->priority= sectionWire.priority;
- if (sectionWire.num_rows>0) {
- register int k;
- XkbRowPtr row;
- xkmRowDesc rowWire;
- XkbKeyPtr key;
- xkmKeyDesc keyWire;
-
- for (i=0;i<sectionWire.num_rows;i++) {
- tmp= fread(&rowWire,SIZEOF(xkmRowDesc),1,file);
- nRead+= SIZEOF(xkmRowDesc)*tmp;
- row= XkbAddGeomRow(section,rowWire.num_keys);
- if (!row) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmKeycodes",0);
- return nRead;
- }
- row->top= rowWire.top;
- row->left= rowWire.left;
- row->vertical= rowWire.vertical;
- for (k=0;k<rowWire.num_keys;k++) {
- tmp= fread(&keyWire,SIZEOF(xkmKeyDesc),1,file);
- nRead+= SIZEOF(xkmKeyDesc)*tmp;
- key= XkbAddGeomKey(row);
- if (!key) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeomSection",0);
- return nRead;
- }
- memcpy(key->name.name,keyWire.name,XkbKeyNameLength);
- key->gap= keyWire.gap;
- key->shape_ndx= keyWire.shape_ndx;
- key->color_ndx= keyWire.color_ndx;
- }
- }
- }
- if (sectionWire.num_doodads>0) {
- for (i=0;i<sectionWire.num_doodads;i++) {
- tmp= ReadXkmGeomDoodad(file,dpy,geom,section);
- nRead+= tmp;
- if (tmp<1)
- return nRead;
- }
- }
- if (sectionWire.num_overlays>0) {
- for (i=0;i<sectionWire.num_overlays;i++) {
- tmp= ReadXkmGeomOverlay(file,dpy,geom,section);
- nRead+= tmp;
- if (tmp<1)
- return nRead;
- }
- }
- return nRead;
-}
-
-static int
-ReadXkmGeometry(FILE *file,XkbFileInfo *result)
-{
-register int i;
-char buf[100];
-unsigned tmp;
-int nRead= 0;
-xkmGeometryDesc wireGeom;
-XkbGeometryPtr geom;
-XkbGeometrySizesRec sizes;
-
- nRead+= XkmGetCountedString(file,buf,100);
- tmp= fread(&wireGeom,SIZEOF(xkmGeometryDesc),1,file);
- nRead+= tmp*SIZEOF(xkmGeometryDesc);
- sizes.which= XkbGeomAllMask;
- sizes.num_properties= wireGeom.num_properties;
- sizes.num_colors= wireGeom.num_colors;
- sizes.num_shapes= wireGeom.num_shapes;
- sizes.num_sections= wireGeom.num_sections;
- sizes.num_doodads= wireGeom.num_doodads;
- sizes.num_key_aliases= wireGeom.num_key_aliases;
- if (XkbAllocGeometry(result->xkb,&sizes)!=Success) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeometry",0);
- return nRead;
- }
- geom= result->xkb->geom;
- geom->name= XkbInternAtom(result->xkb->dpy,buf,False);
- geom->width_mm= wireGeom.width_mm;
- geom->height_mm= wireGeom.height_mm;
- nRead+= XkmGetCountedString(file,buf,100);
- geom->label_font= _XkbDupString(buf);
- if (wireGeom.num_properties>0) {
- char val[1024];
- for (i=0;i<wireGeom.num_properties;i++) {
- nRead+= XkmGetCountedString(file,buf,100);
- nRead+= XkmGetCountedString(file,val,1024);
- if (XkbAddGeomProperty(geom,buf,val)==NULL) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeometry",0);
- return nRead;
- }
- }
- }
- if (wireGeom.num_colors>0) {
- for (i=0;i<wireGeom.num_colors;i++) {
- nRead+= XkmGetCountedString(file,buf,100);
- if (XkbAddGeomColor(geom,buf,i)==NULL) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeometry",0);
- return nRead;
- }
- }
- }
- geom->base_color= &geom->colors[wireGeom.base_color_ndx];
- geom->label_color= &geom->colors[wireGeom.label_color_ndx];
- if (wireGeom.num_shapes>0) {
- XkbShapePtr shape;
- xkmShapeDesc shapeWire;
- Atom nameAtom;
- for (i=0;i<wireGeom.num_shapes;i++) {
- register int n;
- XkbOutlinePtr ol;
- xkmOutlineDesc olWire;
- nRead+= XkmGetCountedString(file,buf,100);
- nameAtom= XkbInternAtom(result->xkb->dpy,buf,False);
- tmp= fread(&shapeWire,SIZEOF(xkmShapeDesc),1,file);
- nRead+= tmp*SIZEOF(xkmShapeDesc);
- shape= XkbAddGeomShape(geom,nameAtom,shapeWire.num_outlines);
- if (!shape) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeometry",0);
- return nRead;
- }
- for (n=0;n<shapeWire.num_outlines;n++) {
- register int p;
- xkmPointDesc ptWire;
- tmp= fread(&olWire,SIZEOF(xkmOutlineDesc),1,file);
- nRead+= tmp*SIZEOF(xkmOutlineDesc);
- ol= XkbAddGeomOutline(shape,olWire.num_points);
- if (!ol) {
- _XkbLibError(_XkbErrBadAlloc,"ReadXkmGeometry",0);
- return nRead;
- }
- ol->num_points= olWire.num_points;
- ol->corner_radius= olWire.corner_radius;
- for (p=0;p<olWire.num_points;p++) {
- tmp= fread(&ptWire,SIZEOF(xkmPointDesc),1,file);
- nRead+= tmp*SIZEOF(xkmPointDesc);
- ol->points[p].x= ptWire.x;
- ol->points[p].y= ptWire.y;
- if (ptWire.x<shape->bounds.x1) shape->bounds.x1= ptWire.x;
- if (ptWire.x>shape->bounds.x2) shape->bounds.x2= ptWire.x;
- if (ptWire.y<shape->bounds.y1) shape->bounds.y1= ptWire.y;
- if (ptWire.y>shape->bounds.y2) shape->bounds.y2= ptWire.y;
- }
- }
- if (shapeWire.primary_ndx!=XkbNoShape)
- shape->primary= &shape->outlines[shapeWire.primary_ndx];
- if (shapeWire.approx_ndx!=XkbNoShape)
- shape->approx= &shape->outlines[shapeWire.approx_ndx];
- }
- }
- if (wireGeom.num_sections>0) {
- for (i=0;i<wireGeom.num_sections;i++) {
- tmp= ReadXkmGeomSection(file,result->xkb->dpy,geom);
- nRead+= tmp;
- if (tmp==0)
- return nRead;
- }
- }
- if (wireGeom.num_doodads>0) {
- for (i=0;i<wireGeom.num_doodads;i++) {
- tmp= ReadXkmGeomDoodad(file,result->xkb->dpy,geom,NULL);
- nRead+= tmp;
- if (tmp==0)
- return nRead;
- }
- }
- if ((wireGeom.num_key_aliases>0)&&(geom->key_aliases)) {
- int sz= XkbKeyNameLength*2;
- int num= wireGeom.num_key_aliases;
- if (fread(geom->key_aliases,sz,num,file)!=num) {
- _XkbLibError(_XkbErrBadLength,"ReadXkmGeometry",0);
- return -1;
- }
- nRead+= (num*sz);
- geom->num_key_aliases= num;
- }
- return nRead;
-}
-
-Bool
-XkmProbe(FILE *file)
-{
-unsigned hdr,tmp;
-int nRead=0;
-
- hdr= (('x'<<24)|('k'<<16)|('m'<<8)|XkmFileVersion);
- tmp= XkmGetCARD32(file,&nRead);
- if (tmp!=hdr) {
- if ((tmp&(~0xff))==(hdr&(~0xff))) {
- _XkbLibError(_XkbErrBadFileVersion,"XkmProbe",tmp&0xff);
- }
- return 0;
- }
- return 1;
-}
-
-Bool
-XkmReadTOC(FILE *file,xkmFileInfo* file_info,int max_toc,xkmSectionInfo *toc)
-{
-unsigned hdr,tmp;
-int nRead=0;
-unsigned i,size_toc;
-
- hdr= (('x'<<24)|('k'<<16)|('m'<<8)|XkmFileVersion);
- tmp= XkmGetCARD32(file,&nRead);
- if (tmp!=hdr) {
- if ((tmp&(~0xff))==(hdr&(~0xff))) {
- _XkbLibError(_XkbErrBadFileVersion,"XkmReadTOC",tmp&0xff);
- }
- else {
- _XkbLibError(_XkbErrBadFileType,"XkmReadTOC",tmp);
- }
- return 0;
- }
- fread(file_info,SIZEOF(xkmFileInfo),1,file);
- size_toc= file_info->num_toc;
- if (size_toc>max_toc) {
-#ifdef DEBUG
- fprintf(stderr,"Warning! Too many TOC entries; last %d ignored\n",
- size_toc-max_toc);
-#endif
- size_toc= max_toc;
- }
- for (i=0;i<size_toc;i++) {
- fread(&toc[i],SIZEOF(xkmSectionInfo),1,file);
- }
- return 1;
-}
-
-xkmSectionInfo *
-XkmFindTOCEntry(xkmFileInfo *finfo,xkmSectionInfo *toc,unsigned type)
-{
-register int i;
-
- for (i=0;i<finfo->num_toc;i++) {
- if (toc[i].type==type)
- return &toc[i];
- }
- return NULL;
-}
-
-Bool
-XkmReadFileSection( FILE * file,
- xkmSectionInfo * toc,
- XkbFileInfo * result,
- unsigned * loaded_rtrn)
-{
-xkmSectionInfo tmpTOC;
-int nRead;
-
- if ((!result)||(!result->xkb)) {
- _XkbLibError(_XkbErrBadMatch,"XkmReadFileSection",0);
- return 0;
- }
- fseek(file,toc->offset,SEEK_SET);
- fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
- nRead= SIZEOF(xkmSectionInfo);
- if ((tmpTOC.type!=toc->type)||(tmpTOC.format!=toc->format)||
- (tmpTOC.size!=toc->size)||(tmpTOC.offset!=toc->offset)) {
- _XkbLibError(_XkbErrIllegalContents,"XkmReadFileSection",0);
- return 0;
- }
- switch (tmpTOC.type) {
- case XkmVirtualModsIndex:
- nRead+= ReadXkmVirtualMods(file,result,NULL);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmVirtualModsMask;
- break;
- case XkmTypesIndex:
- nRead+= ReadXkmKeyTypes(file,result,NULL);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmTypesMask;
- break;
- case XkmCompatMapIndex:
- nRead+= ReadXkmCompatMap(file,result,NULL);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmCompatMapMask;
- break;
- case XkmKeyNamesIndex:
- nRead+= ReadXkmKeycodes(file,result,NULL);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmKeyNamesMask;
- break;
- case XkmSymbolsIndex:
- nRead+= ReadXkmSymbols(file,result);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmSymbolsMask;
- break;
- case XkmIndicatorsIndex:
- nRead+= ReadXkmIndicators(file,result,NULL);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmIndicatorsMask;
- break;
- case XkmGeometryIndex:
- nRead+= ReadXkmGeometry(file,result);
- if ((loaded_rtrn)&&(nRead>=0))
- *loaded_rtrn|= XkmGeometryMask;
- break;
- default:
- _XkbLibError(_XkbErrBadImplementation,
- XkbConfigText(tmpTOC.type,XkbMessage),0);
- nRead= 0;
- break;
- }
- if (nRead!=tmpTOC.size) {
- _XkbLibError(_XkbErrBadLength,XkbConfigText(tmpTOC.type,XkbMessage),
- nRead-tmpTOC.size);
- return 0;
- }
- return (nRead>=0);
-}
-
-char *
-XkmReadFileSectionName(FILE *file,xkmSectionInfo *toc)
-{
-xkmSectionInfo tmpTOC;
-char name[100];
-
- if ((!file)||(!toc))
- return 0;
- switch (toc->type) {
- case XkmVirtualModsIndex:
- case XkmIndicatorsIndex:
- break;
- case XkmTypesIndex:
- case XkmCompatMapIndex:
- case XkmKeyNamesIndex:
- case XkmSymbolsIndex:
- case XkmGeometryIndex:
- fseek(file,toc->offset,SEEK_SET);
- fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
- if ((tmpTOC.type!=toc->type)||(tmpTOC.format!=toc->format)||
- (tmpTOC.size!=toc->size)||(tmpTOC.offset!=toc->offset)) {
- _XkbLibError(_XkbErrIllegalContents,"XkmReadFileSectionName",0);
- return 0;
- }
- if (XkmGetCountedString(file,name,100)>0)
- return _XkbDupString(name);
- break;
- default:
- _XkbLibError(_XkbErrBadImplementation,
- XkbConfigText(tmpTOC.type,XkbMessage),0);
- break;
- }
- return NULL;
-}
-
-/***====================================================================***/
-
-#define MAX_TOC 16
-unsigned
-XkmReadFile(FILE *file,unsigned need,unsigned want,XkbFileInfo *result)
-{
-register unsigned i;
-xkmSectionInfo toc[MAX_TOC],tmpTOC;
-xkmFileInfo fileInfo;
-unsigned tmp,nRead=0;
-unsigned which= need|want;
-
- if (!XkmReadTOC(file,&fileInfo,MAX_TOC,toc))
- return which;
- if ((fileInfo.present&need)!=need) {
- _XkbLibError(_XkbErrIllegalContents,"XkmReadFile",
- need&(~fileInfo.present));
- return which;
- }
- result->type= fileInfo.type;
- if (result->xkb==NULL)
- result->xkb= XkbAllocKeyboard();
- for (i=0;i<fileInfo.num_toc;i++) {
-#ifdef SEEK_SET
- fseek(file,toc[i].offset,SEEK_SET);
-#else
- fseek(file,toc[i].offset,0);
-#endif
- tmp= fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
- nRead= tmp*SIZEOF(xkmSectionInfo);
- if ((tmpTOC.type!=toc[i].type)||(tmpTOC.format!=toc[i].format)||
- (tmpTOC.size!=toc[i].size)||(tmpTOC.offset!=toc[i].offset)) {
- return which;
- }
- if ((which&(1<<tmpTOC.type))==0) {
- continue;
- }
- switch (tmpTOC.type) {
- case XkmVirtualModsIndex:
- tmp= ReadXkmVirtualMods(file,result,NULL);
- break;
- case XkmTypesIndex:
- tmp= ReadXkmKeyTypes(file,result,NULL);
- break;
- case XkmCompatMapIndex:
- tmp= ReadXkmCompatMap(file,result,NULL);
- break;
- case XkmKeyNamesIndex:
- tmp= ReadXkmKeycodes(file,result,NULL);
- break;
- case XkmIndicatorsIndex:
- tmp= ReadXkmIndicators(file,result,NULL);
- break;
- case XkmSymbolsIndex:
- tmp= ReadXkmSymbols(file,result);
- break;
- case XkmGeometryIndex:
- tmp= ReadXkmGeometry(file,result);
- break;
- default:
- _XkbLibError(_XkbErrBadImplementation,
- XkbConfigText(tmpTOC.type,XkbMessage),0);
- tmp= 0;
- break;
- }
- if (tmp>0) {
- nRead+= tmp;
- which&= ~(1<<toc[i].type);
- result->defined|= (1<<toc[i].type);
- }
- if (nRead!=tmpTOC.size) {
- _XkbLibError(_XkbErrBadLength,XkbConfigText(tmpTOC.type,XkbMessage),
- nRead-tmpTOC.size);
- }
- }
- return which;
-}